_ZN4absl12lts_2026052613base_internal16SchedulingHelperC2ENS1_14SchedulingModeE:
  118|     50|  explicit SchedulingHelper(base_internal::SchedulingMode mode) : mode_(mode) {
  119|     50|    if (mode_ == base_internal::SCHEDULE_KERNEL_ONLY) {
  ------------------
  |  Branch (119:9): [True: 0, False: 50]
  ------------------
  120|      0|      guard_result_ = base_internal::SchedulingGuard::DisableRescheduling();
  121|      0|    }
  122|     50|  }
_ZN4absl12lts_2026052613base_internal16SchedulingHelperD2Ev:
  124|     50|  ~SchedulingHelper() {
  125|     50|    if (mode_ == base_internal::SCHEDULE_KERNEL_ONLY) {
  ------------------
  |  Branch (125:9): [True: 0, False: 50]
  ------------------
  126|      0|      base_internal::SchedulingGuard::EnableRescheduling(guard_result_);
  127|      0|    }
  128|     50|  }
_ZN4absl12lts_2026052613base_internal11ControlWordEPNS0_9once_flagE:
  195|     76|    once_flag* absl_nonnull flag) {
  196|     76|  return &flag->control_;
  197|     76|}
_ZN4absl12lts_202605269call_onceIMNS0_14flags_internal8FlagImplEFvvEJPS3_EEEvRNS0_9once_flagEOT_DpOT0_:
  215|     74|    call_once(absl::once_flag& flag, Callable&& fn, Args&&... args) {
  216|     74|  std::atomic<uint32_t>* once = base_internal::ControlWord(&flag);
  217|     74|  uint32_t s = once->load(std::memory_order_acquire);
  218|     74|  if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) {
  ------------------
  |  |  190|     74|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 48, False: 26]
  |  |  |  Branch (190:49): [Folded, False: 74]
  |  |  |  Branch (190:58): [True: 48, False: 26]
  |  |  ------------------
  ------------------
  219|     48|    base_internal::CallOnceImpl(
  220|     48|        once, base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL,
  221|     48|        std::forward<Callable>(fn), std::forward<Args>(args)...);
  222|     48|  }
  223|     74|}
_ZN4absl12lts_2026052613base_internal12CallOnceImplIMNS0_14flags_internal8FlagImplEFvvEJPS4_EEEvPNSt3__16atomicIjEENS1_14SchedulingModeEOT_DpOT0_:
  155|     48|                 Args&&... args) {
  156|       |#ifndef NDEBUG
  157|       |  {
  158|       |    uint32_t old_control = control->load(std::memory_order_relaxed);
  159|       |    if (old_control != kOnceInit &&
  160|       |        old_control != kOnceRunning &&
  161|       |        old_control != kOnceWaiter &&
  162|       |        old_control != kOnceDone) {
  163|       |      // Memory corruption may cause this error.
  164|       |      ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx",
  165|       |                   static_cast<unsigned long>(old_control));  // NOLINT
  166|       |    }
  167|       |  }
  168|       |#endif  // NDEBUG
  169|     48|  static const base_internal::SpinLockWaitTransition trans[] = {
  170|     48|      {kOnceInit, kOnceRunning, true},
  171|     48|      {kOnceRunning, kOnceWaiter, false},
  172|     48|      {kOnceDone, kOnceDone, true}};
  173|       |
  174|       |  // Must do this before potentially modifying control word's state.
  175|     48|  base_internal::SchedulingHelper maybe_disable_scheduling(scheduling_mode);
  176|       |  // Short circuit the simplest case to avoid procedure call overhead.
  177|       |  // The base_internal::SpinLockWait() call returns either kOnceInit or
  178|       |  // kOnceDone. If it returns kOnceDone, it must have loaded the control word
  179|       |  // with std::memory_order_acquire and seen a value of kOnceDone.
  180|     48|  uint32_t old_control = kOnceInit;
  181|     48|  if (control->compare_exchange_strong(old_control, kOnceRunning,
  ------------------
  |  Branch (181:7): [True: 48, False: 0]
  ------------------
  182|     48|                                       std::memory_order_relaxed) ||
  183|      0|      base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans,
  ------------------
  |  |   46|      0|  (sizeof(::absl::macros_internal::ArraySizeHelper(array)))
  ------------------
  |  Branch (183:7): [True: 0, False: 0]
  ------------------
  184|     48|                                  scheduling_mode) == kOnceInit) {
  185|     48|    std::invoke(std::forward<Callable>(fn), std::forward<Args>(args)...);
  186|     48|    old_control =
  187|     48|        control->exchange(base_internal::kOnceDone, std::memory_order_release);
  188|     48|    if (old_control == base_internal::kOnceWaiter) {
  ------------------
  |  Branch (188:9): [True: 0, False: 48]
  ------------------
  189|      0|      base_internal::SpinLockWake(control, true);
  190|      0|    }
  191|     48|  }  // else *control is already kOnceDone
  192|     48|}
_ZN4absl12lts_202605269call_onceIRFvvEJEEEvRNS0_9once_flagEOT_DpOT0_:
  215|      2|    call_once(absl::once_flag& flag, Callable&& fn, Args&&... args) {
  216|      2|  std::atomic<uint32_t>* once = base_internal::ControlWord(&flag);
  217|      2|  uint32_t s = once->load(std::memory_order_acquire);
  218|      2|  if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  219|      2|    base_internal::CallOnceImpl(
  220|      2|        once, base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL,
  221|      2|        std::forward<Callable>(fn), std::forward<Args>(args)...);
  222|      2|  }
  223|      2|}
_ZN4absl12lts_2026052613base_internal12CallOnceImplIRFvvEJEEEvPNSt3__16atomicIjEENS1_14SchedulingModeEOT_DpOT0_:
  155|      2|                 Args&&... args) {
  156|       |#ifndef NDEBUG
  157|       |  {
  158|       |    uint32_t old_control = control->load(std::memory_order_relaxed);
  159|       |    if (old_control != kOnceInit &&
  160|       |        old_control != kOnceRunning &&
  161|       |        old_control != kOnceWaiter &&
  162|       |        old_control != kOnceDone) {
  163|       |      // Memory corruption may cause this error.
  164|       |      ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx",
  165|       |                   static_cast<unsigned long>(old_control));  // NOLINT
  166|       |    }
  167|       |  }
  168|       |#endif  // NDEBUG
  169|      2|  static const base_internal::SpinLockWaitTransition trans[] = {
  170|      2|      {kOnceInit, kOnceRunning, true},
  171|      2|      {kOnceRunning, kOnceWaiter, false},
  172|      2|      {kOnceDone, kOnceDone, true}};
  173|       |
  174|       |  // Must do this before potentially modifying control word's state.
  175|      2|  base_internal::SchedulingHelper maybe_disable_scheduling(scheduling_mode);
  176|       |  // Short circuit the simplest case to avoid procedure call overhead.
  177|       |  // The base_internal::SpinLockWait() call returns either kOnceInit or
  178|       |  // kOnceDone. If it returns kOnceDone, it must have loaded the control word
  179|       |  // with std::memory_order_acquire and seen a value of kOnceDone.
  180|      2|  uint32_t old_control = kOnceInit;
  181|      2|  if (control->compare_exchange_strong(old_control, kOnceRunning,
  ------------------
  |  Branch (181:7): [True: 2, False: 0]
  ------------------
  182|      2|                                       std::memory_order_relaxed) ||
  183|      0|      base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans,
  ------------------
  |  |   46|      0|  (sizeof(::absl::macros_internal::ArraySizeHelper(array)))
  ------------------
  |  Branch (183:7): [True: 0, False: 0]
  ------------------
  184|      2|                                  scheduling_mode) == kOnceInit) {
  185|      2|    std::invoke(std::forward<Callable>(fn), std::forward<Args>(args)...);
  186|      2|    old_control =
  187|      2|        control->exchange(base_internal::kOnceDone, std::memory_order_release);
  188|      2|    if (old_control == base_internal::kOnceWaiter) {
  ------------------
  |  Branch (188:9): [True: 0, False: 2]
  ------------------
  189|      0|      base_internal::SpinLockWake(control, true);
  190|      0|    }
  191|      2|  }  // else *control is already kOnceDone
  192|      2|}

_ZN4absl12lts_202605268bit_castImlTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS5_EE5valuesr3std21is_trivially_copyableIS4_EE5valueEiE4typeELi0EEES4_RKS5_:
  190|  57.1k|inline constexpr Dest bit_cast(const Source& source) {
  191|  57.1k|  return __builtin_bit_cast(Dest, source);
  192|  57.1k|}
_ZN4absl12lts_202605268bit_castIlmTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS5_EE5valuesr3std21is_trivially_copyableIS4_EE5valueEiE4typeELi0EEES4_RKS5_:
  190|  29.5k|inline constexpr Dest bit_cast(const Source& source) {
  191|  29.5k|  return __builtin_bit_cast(Dest, source);
  192|  29.5k|}
_ZN4absl12lts_202605268bit_castIdmTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS5_EE5valuesr3std21is_trivially_copyableIS4_EE5valueEiE4typeELi0EEES4_RKS5_:
  190|  14.8k|inline constexpr Dest bit_cast(const Source& source) {
  191|  14.8k|  return __builtin_bit_cast(Dest, source);
  192|  14.8k|}
_ZN4absl12lts_202605268bit_castINS0_14flags_internal19FlagValueAndInitBitIN8fuzztest8internal14TimeBudgetTypeEEElTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableISB_EE5valuesr3std21is_trivially_copyableISA_EE5valueEiE4typeELi0EEESA_RKSB_:
  190|      2|inline constexpr Dest bit_cast(const Source& source) {
  191|      2|  return __builtin_bit_cast(Dest, source);
  192|      2|}
_ZN4absl12lts_202605268bit_castIPvNS0_14FastTypeIdTypeETnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS7_EE5valuesr3std21is_trivially_copyableIS6_EE5valueEiE4typeELi0EEES6_RKS7_:
  190|      4|inline constexpr Dest bit_cast(const Source& source) {
  191|      4|  return __builtin_bit_cast(Dest, source);
  192|      4|}
_ZN4absl12lts_202605268bit_castINS0_14flags_internal19FlagValueAndInitBitIbEElTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS8_EE5valuesr3std21is_trivially_copyableIS7_EE5valueEiE4typeELi0EEES7_RKS8_:
  190|     12|inline constexpr Dest bit_cast(const Source& source) {
  191|     12|  return __builtin_bit_cast(Dest, source);
  192|     12|}
_ZN4absl12lts_202605268bit_castINS0_14FastTypeIdTypeEPvTnNSt3__19enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS7_EE5valuesr3std21is_trivially_copyableIS6_EE5valueEiE4typeELi0EEES6_RKS7_:
  190|      4|inline constexpr Dest bit_cast(const Source& source) {
  191|      4|  return __builtin_bit_cast(Dest, source);
  192|      4|}
_ZN4absl12lts_202605268bit_castIlNSt3__15arrayIcLm8EEETnNS2_9enable_ifIXaaaaeqstT_stT0_sr3std21is_trivially_copyableIS7_EE5valuesr3std21is_trivially_copyableIS6_EE5valueEiE4typeELi0EEES6_RKS7_:
  190|     16|inline constexpr Dest bit_cast(const Source& source) {
  191|     16|  return __builtin_bit_cast(Dest, source);
  192|     16|}

_ZN4absl12lts_20260526eqENS0_14FastTypeIdTypeES1_:
   45|      4|  friend constexpr bool operator==(FastTypeIdType a, FastTypeIdType b) {
   46|      4|    return a.ptr_ == b.ptr_;
   47|      4|  }
_ZN4absl12lts_2026052614FastTypeIdTypeC2EPKv:
   57|      8|  explicit constexpr FastTypeIdType(const void* ptr) : ptr_(ptr) {}
_ZN4absl12lts_2026052610FastTypeIdIbEENS0_14FastTypeIdTypeEv:
   66|      4|constexpr FastTypeIdType FastTypeId() {
   67|      4|  return FastTypeIdType(&base_internal::FastTypeTag<Type>::kDummyVar);
   68|      4|}
_ZN4absl12lts_2026052610FastTypeIdINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS0_14FastTypeIdTypeEv:
   66|      2|constexpr FastTypeIdType FastTypeId() {
   67|      2|  return FastTypeIdType(&base_internal::FastTypeTag<Type>::kDummyVar);
   68|      2|}
_ZN4absl12lts_2026052610FastTypeIdImEENS0_14FastTypeIdTypeEv:
   66|      2|constexpr FastTypeIdType FastTypeId() {
   67|      2|  return FastTypeIdType(&base_internal::FastTypeTag<Type>::kDummyVar);
   68|      2|}

_ZN4absl12lts_202605269gbswap_32Ej:
   48|     20|constexpr uint32_t gbswap_32(uint32_t x) {
   49|     20|#if ABSL_HAVE_BUILTIN(__builtin_bswap32) || defined(__GNUC__)
   50|     20|  return __builtin_bswap32(x);
   51|       |#else
   52|       |  return (((x & uint32_t{0xFF}) << 24) |
   53|       |          ((x & uint32_t{0xFF00}) << 8) |
   54|       |          ((x & uint32_t{0xFF0000}) >> 8) |
   55|       |          ((x & uint32_t{0xFF000000}) >> 24));
   56|       |#endif
   57|     20|}
_ZN4absl12lts_202605269gbswap_16Et:
   59|      2|constexpr uint16_t gbswap_16(uint16_t x) {
   60|      2|#if ABSL_HAVE_BUILTIN(__builtin_bswap16) || defined(__GNUC__)
   61|      2|  return __builtin_bswap16(x);
   62|       |#else
   63|       |  return (((x & uint16_t{0xFF}) << 8) |
   64|       |          ((x & uint16_t{0xFF00}) >> 8));
   65|       |#endif
   66|      2|}
_ZN4absl12lts_2026052613little_endian10FromHost16Et:
  103|     62|inline uint16_t FromHost16(uint16_t x) { return x; }
_ZN4absl12lts_2026052613little_endian10FromHost64Em:
  109|     17|inline uint64_t FromHost64(uint64_t x) { return x; }
_ZN4absl12lts_2026052613little_endian8ToHost64Em:
  110|     20|inline uint64_t ToHost64(uint64_t x) { return x; }
_ZN4absl12lts_2026052613little_endian6ToHostEm:
  136|     16|inline uint64_t ToHost(uint64_t x) { return ToHost64(x); }
_ZN4absl12lts_2026052613little_endian7Store16EPvt:
  164|     62|inline void Store16(void* absl_nonnull p, uint16_t v) {
  165|     62|  ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v));
  ------------------
  |  |   81|     62|  (absl::base_internal::UnalignedStore16(_p, _val))
  ------------------
  166|     62|}
_ZN4absl12lts_2026052613little_endian6Load64EPKv:
  176|      4|inline uint64_t Load64(const void* absl_nonnull p) {
  177|      4|  return ToHost64(ABSL_INTERNAL_UNALIGNED_LOAD64(p));
  ------------------
  |  |   78|      4|  (absl::base_internal::UnalignedLoad64(_p))
  ------------------
  178|      4|}
_ZN4absl12lts_2026052613little_endian7Store64EPvm:
  180|     17|inline void Store64(void* absl_nonnull p, uint64_t v) {
  181|     17|  ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v));
  ------------------
  |  |   85|     17|  (absl::base_internal::UnalignedStore64(_p, _val))
  ------------------
  182|     17|}
_ZN4absl12lts_2026052610big_endian8ToHost16Et:
  194|      2|inline uint16_t ToHost16(uint16_t x) { return gbswap_16(x); }
_ZN4absl12lts_2026052610big_endian8ToHost32Ej:
  197|     20|inline uint32_t ToHost32(uint32_t x) { return gbswap_32(x); }
_ZN4absl12lts_2026052610big_endian6Load16EPKv:
  250|      2|inline uint16_t Load16(const void* absl_nonnull p) {
  251|      2|  return ToHost16(ABSL_INTERNAL_UNALIGNED_LOAD16(p));
  ------------------
  |  |   74|      2|  (absl::base_internal::UnalignedLoad16(_p))
  ------------------
  252|      2|}
_ZN4absl12lts_2026052610big_endian6Load32EPKv:
  258|     20|inline uint32_t Load32(const void* absl_nonnull p) {
  259|     20|  return ToHost32(ABSL_INTERNAL_UNALIGNED_LOAD32(p));
  ------------------
  |  |   76|     20|  (absl::base_internal::UnalignedLoad32(_p))
  ------------------
  260|     20|}

_ZN4absl12lts_2026052613base_internal17HardeningAssertLTImEEvT_S3_:
   88|   533k|constexpr void HardeningAssertLT(T val1, T val2) {
   89|   533k|  ABSL_ASSERT(val1 < val2);
  ------------------
  |  |  127|   533k|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  ------------------
  |  |  |  |   87|   533k|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:42): [Folded, False: 533k]
  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|       |#if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
   91|       |  if (!ABSL_PREDICT_TRUE(val1 < val2)) {
   92|       |    base_internal::HardeningAbort();
   93|       |  }
   94|       |#endif
   95|   533k|}
_ZN4absl12lts_2026052613base_internal17HardeningAssertLEIPKjEEvT_S5_:
   98|      4|constexpr void HardeningAssertLE(T val1, T val2) {
   99|      4|  ABSL_ASSERT(val1 <= val2);
  ------------------
  |  |  127|      4|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  ------------------
  |  |  |  |   87|      4|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:42): [Folded, False: 4]
  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|       |#if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
  101|       |  if (!ABSL_PREDICT_TRUE(val1 <= val2)) {
  102|       |    base_internal::HardeningAbort();
  103|       |  }
  104|       |#endif
  105|      4|}

_ZN4absl12lts_2026052613base_internal8SpinLockC2Ev:
   62|     16|  constexpr SpinLock() : lockword_(kSpinLockCooperative) { RegisterWithTsan(); }
_ZN4absl12lts_2026052613base_internal8SpinLock16RegisterWithTsanEv:
  221|     16|  constexpr void RegisterWithTsan() {
  222|     16|#if ABSL_HAVE_BUILTIN(__builtin_is_constant_evaluated)
  223|     16|    if (!__builtin_is_constant_evaluated()) {
  ------------------
  |  Branch (223:9): [True: 16, Folded]
  ------------------
  224|     16|      ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
  225|     16|    }
  226|     16|#endif
  227|     16|  }
_ZN4absl12lts_2026052613base_internal14SpinLockHolderC2ERNS1_8SpinLockE:
  257|     18|      : std::lock_guard<SpinLock>(l) {}
_ZN4absl12lts_2026052613base_internal8SpinLock4lockEv:
   98|     18|  inline void lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() {
   99|     18|    ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
  100|     18|    if (!TryLockImpl()) {
  ------------------
  |  Branch (100:9): [True: 0, False: 18]
  ------------------
  101|      0|      SlowLock();
  102|      0|    }
  103|     18|    ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
  104|     18|  }
_ZN4absl12lts_2026052613base_internal8SpinLock11TryLockImplEv:
  238|     18|  inline bool TryLockImpl() {
  239|     18|    uint32_t lock_value = lockword_.load(std::memory_order_relaxed);
  240|     18|    return (TryLockInternal(lock_value, 0) & kSpinLockHeld) == 0;
  241|     18|  }
_ZN4absl12lts_2026052613base_internal8SpinLock15TryLockInternalEjj:
  282|     18|                                          uint32_t wait_cycles) {
  283|     18|  if ((lock_value & kSpinLockHeld) != 0) {
  ------------------
  |  Branch (283:7): [True: 0, False: 18]
  ------------------
  284|      0|    return lock_value;
  285|      0|  }
  286|       |
  287|     18|  uint32_t sched_disabled_bit = 0;
  288|     18|  if ((lock_value & kSpinLockCooperative) == 0) {
  ------------------
  |  Branch (288:7): [True: 0, False: 18]
  ------------------
  289|       |    // For non-cooperative locks we must make sure we mark ourselves as
  290|       |    // non-reschedulable before we attempt to CompareAndSwap.
  291|      0|    if (SchedulingGuard::DisableRescheduling()) {
  ------------------
  |  Branch (291:9): [True: 0, False: 0]
  ------------------
  292|      0|      sched_disabled_bit = kSpinLockDisabledScheduling;
  293|      0|    }
  294|      0|  }
  295|       |
  296|     18|  if (!lockword_.compare_exchange_strong(
  ------------------
  |  Branch (296:7): [True: 0, False: 18]
  ------------------
  297|     18|          lock_value,
  298|     18|          kSpinLockHeld | lock_value | wait_cycles | sched_disabled_bit,
  299|     18|          std::memory_order_acquire, std::memory_order_relaxed)) {
  300|      0|    SchedulingGuard::EnableRescheduling(sched_disabled_bit != 0);
  301|      0|  }
  302|       |
  303|     18|  return lock_value;
  304|     18|}
_ZN4absl12lts_2026052613base_internal8SpinLock6unlockEv:
  128|     18|  inline void unlock() ABSL_UNLOCK_FUNCTION() {
  129|     18|    ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0);
  130|     18|    uint32_t lock_value = lockword_.load(std::memory_order_relaxed);
  131|     18|    lock_value = lockword_.exchange(lock_value & kSpinLockCooperative,
  132|     18|                                    std::memory_order_release);
  133|       |
  134|     18|    if ((lock_value & kSpinLockDisabledScheduling) != 0) {
  ------------------
  |  Branch (134:9): [True: 0, False: 18]
  ------------------
  135|      0|      SchedulingGuard::EnableRescheduling(true);
  136|      0|    }
  137|     18|    if ((lock_value & kWaitTimeMask) != 0) {
  ------------------
  |  Branch (137:9): [True: 0, False: 18]
  ------------------
  138|       |      // Collect contentionz profile info, and speed the wakeup of any waiter.
  139|       |      // The wait_cycles value indicates how long this thread spent waiting
  140|       |      // for the lock.
  141|      0|      SlowUnlock(lock_value);
  142|      0|    }
  143|     18|    ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0);
  144|     18|  }

_ZN4absl12lts_2026052613base_internal15UnalignedLoad16EPKv:
   39|      2|inline uint16_t UnalignedLoad16(const void* absl_nonnull p) {
   40|      2|  uint16_t t;
   41|      2|  memcpy(&t, p, sizeof t);
   42|      2|  return t;
   43|      2|}
_ZN4absl12lts_2026052613base_internal15UnalignedLoad32EPKv:
   45|     60|inline uint32_t UnalignedLoad32(const void* absl_nonnull p) {
   46|     60|  uint32_t t;
   47|     60|  memcpy(&t, p, sizeof t);
   48|     60|  return t;
   49|     60|}
_ZN4absl12lts_2026052613base_internal15UnalignedLoad64EPKv:
   51|    278|inline uint64_t UnalignedLoad64(const void* absl_nonnull p) {
   52|    278|  uint64_t t;
   53|    278|  memcpy(&t, p, sizeof t);
   54|    278|  return t;
   55|    278|}
_ZN4absl12lts_2026052613base_internal16UnalignedStore16EPvt:
   57|     62|inline void UnalignedStore16(void* absl_nonnull p, uint16_t v) {
   58|     62|  memcpy(p, &v, sizeof v);
   59|     62|}
_ZN4absl12lts_2026052613base_internal16UnalignedStore64EPvm:
   65|     17|inline void UnalignedStore64(void* absl_nonnull p, uint64_t v) {
   66|     17|  memcpy(p, &v, sizeof v);
   67|     17|}

_ZN4absl12lts_2026052612NoDestructorINS0_5MutexEEC2IJETnNSt3__19enable_ifIXntsr3std7is_sameIFvDpRu7__decayIT_EEFvRS3_EEE5valueEiE4typeELi0EEEDpOS7_:
  122|     10|      : impl_(std::forward<Ts>(args)...) {}
_ZN4absl12lts_2026052612NoDestructorINS0_5MutexEE13PlacementImplC2IJEEEDpOT_:
  160|     10|    explicit PlacementImpl(Args&&... args) {
  161|     10|      new (&space_) T(std::forward<Args>(args)...);
  162|     10|    }
_ZN4absl12lts_2026052612NoDestructorINS0_5MutexEEdeEv:
  137|    118|  T& operator*() { return *get(); }
_ZN4absl12lts_2026052612NoDestructorINS0_5MutexEE3getEv:
  139|    118|  T* absl_nonnull get() { return impl_.get(); }
_ZN4absl12lts_2026052612NoDestructorINS0_5MutexEE13PlacementImpl3getEv:
  166|    118|    T* absl_nonnull get() {
  167|    118|      return std::launder(reinterpret_cast<T*>(&space_));
  168|    118|    }
_ZN4absl12lts_2026052612NoDestructorINS0_14flags_internal12FlagRegistryEEC2IJETnNSt3__19enable_ifIXntsr3std7is_sameIFvDpRu7__decayIT_EEFvRS4_EEE5valueEiE4typeELi0EEEDpOS8_:
  122|      2|      : impl_(std::forward<Ts>(args)...) {}
_ZN4absl12lts_2026052612NoDestructorINS0_14flags_internal12FlagRegistryEE13PlacementImplC2IJEEEDpOT_:
  160|      2|    explicit PlacementImpl(Args&&... args) {
  161|      2|      new (&space_) T(std::forward<Args>(args)...);
  162|      2|    }
_ZN4absl12lts_2026052612NoDestructorINS0_14flags_internal12FlagRegistryEEdeEv:
  137|     56|  T& operator*() { return *get(); }
_ZN4absl12lts_2026052612NoDestructorINS0_14flags_internal12FlagRegistryEE3getEv:
  139|     56|  T* absl_nonnull get() { return impl_.get(); }
_ZN4absl12lts_2026052612NoDestructorINS0_14flags_internal12FlagRegistryEE13PlacementImpl3getEv:
  166|     56|    T* absl_nonnull get() {
  167|     56|      return std::launder(reinterpret_cast<T*>(&space_));
  168|     56|    }

_ZN4absl12lts_2026052620PrefetchToLocalCacheEPKv:
  146|     46|    const void* addr) {
  147|     46|  __builtin_prefetch(addr, 0, 3);
  148|     46|}

_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE5applyINS1_12EqualElementIS7_NS1_8StringEqEEEJRNS3_4pairIKS7_S9_EEEEEDTclsr4absl18container_internalE13DecomposePairclsr3stdE7declvalIT_EEspclsr3stdE7declvalIT0_EEEEOSJ_DpOSK_:
  680|      4|  apply(F&& f, Args&&... args) {
  681|      4|    return absl::container_internal::DecomposePair(std::forward<F>(f),
  682|      4|                                                   std::forward<Args>(args)...);
  683|      4|  }
_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE7elementEPNS1_13map_slot_typeIS7_S9_EE:
  694|     82|  static std::pair<const K, V>& element(slot_type* slot) { return slot->value; }
_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE5applyINS1_12raw_hash_setISA_JEE19EmplaceDecomposableEJNS3_4pairIKS7_S9_EEEEEDTclsr4absl18container_internalE13DecomposePairclsr3stdE7declvalIT_EEspclsr3stdE7declvalIT0_EEEEOSI_DpOSJ_:
  680|     50|  apply(F&& f, Args&&... args) {
  681|     50|    return absl::container_internal::DecomposePair(std::forward<F>(f),
  682|     50|                                                   std::forward<Args>(args)...);
  683|     50|  }
_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE5applyINS1_11HashElementINS1_10StringHashELb1EEEJRNS3_4pairIKS7_S9_EEEEEDTclsr4absl18container_internalE13DecomposePairclsr3stdE7declvalIT_EEspclsr3stdE7declvalIT0_EEEEOSJ_DpOSK_:
  680|     28|  apply(F&& f, Args&&... args) {
  681|     28|    return absl::container_internal::DecomposePair(std::forward<F>(f),
  682|     28|                                                   std::forward<Args>(args)...);
  683|     28|  }
_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE8transferINS3_9allocatorINS3_4pairIKS7_S9_EEEEEEDaPT_PNS1_13map_slot_typeIS7_S9_EESL_:
  673|     28|                       slot_type* old_slot) {
  674|     28|    return slot_policy::transfer(alloc, new_slot, old_slot);
  675|     28|  }
_ZN4absl12lts_2026052618container_internal17FlatHashMapPolicyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE9constructINS3_9allocatorINS3_4pairIKS7_S9_EEEEJRKNS3_21piecewise_construct_tENS3_5tupleIJOSE_EEENSK_IJOS9_EEEEEEvPT_PNS1_13map_slot_typeIS7_S9_EEDpOT0_:
  661|     50|  static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
  662|     50|    slot_policy::construct(alloc, slot, std::forward<Args>(args)...);
  663|     50|  }
_ZN4absl12lts_2026052613flat_hash_mapINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPNS0_15CommandLineFlagENS0_18container_internal10StringHashENS9_8StringEqENS2_9allocatorINS2_4pairIKS6_S8_EEEEEC2Ev:
  196|      2|  flat_hash_map() {}

_ZN4absl12lts_2026052613InlinedVectorINS0_14SourceLocationELm1ENSt3__19allocatorIS2_EEED2Ev:
  300|  2.27k|  ~InlinedVector() {}
_ZN4absl12lts_2026052613InlinedVectorINS0_14SourceLocationELm1ENSt3__19allocatorIS2_EEEC2Ev:
  128|  2.27k|  InlinedVector() noexcept(noexcept(allocator_type())) : storage_() {}
_ZN4absl12lts_2026052613InlinedVectorINS0_14SourceLocationELm1ENSt3__19allocatorIS2_EEE9push_backERKS2_:
  753|  2.27k|  void push_back(const_reference v) { static_cast<void>(emplace_back(v)); }
_ZN4absl12lts_2026052613InlinedVectorINS0_14SourceLocationELm1ENSt3__19allocatorIS2_EEE12emplace_backIJRKS2_EEERS2_DpOT_:
  746|  2.27k|  reference emplace_back(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
  747|  2.27k|    return storage_.EmplaceBack(std::forward<Args>(args)...);
  748|  2.27k|  }

_ZN4absl12lts_2026052618container_internal20common_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE7elementISB_EEDTclsrT_7elementfp_EEPNS1_13map_slot_typeIS8_SA_EE:
   85|     82|      -> decltype(P::element(slot)) {
   86|     82|    return P::element(slot);
   87|     82|  }
_ZN4absl12lts_2026052618container_internal20common_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE8transferINS4_9allocatorINS4_4pairIKS8_SA_EEEEEEvPT_PNS1_13map_slot_typeIS8_SA_EESN_:
   75|     28|  static void transfer(Alloc* alloc, slot_type* new_slot, slot_type* old_slot) {
   76|     28|    transfer_impl(alloc, new_slot, old_slot, Rank2{});
   77|     28|  }
_ZN4absl12lts_2026052618container_internal20common_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE13transfer_implINS4_9allocatorINS4_4pairIKS8_SA_EEEESB_EEDTclsrT0_8transferfp_fp0_fp1_EEPT_PNS1_13map_slot_typeIS8_SA_EESP_NSC_5Rank2E:
  119|     28|                                                           old_slot)) {
  120|     28|    return P::transfer(alloc, new_slot, old_slot);
  121|     28|  }
_ZN4absl12lts_2026052618container_internal20common_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE9constructINS4_9allocatorINS4_4pairIKS8_SA_EEEEJRKNS4_21piecewise_construct_tENS4_5tupleIJOSG_EEENSM_IJOSA_EEEEEEvPT_PNS1_13map_slot_typeIS8_SA_EEDpOT0_:
   51|     50|  static void construct(Alloc* alloc, slot_type* slot, Args&&... args) {
   52|     50|    Policy::construct(alloc, slot, std::forward<Args>(args)...);
   53|     50|  }

_ZNR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageImLm1ENS2_10StorageTagIJNSt3__19allocatorINS0_14SourceLocationEEEmEEELb0EE3getEv:
   92|  4.55k|  constexpr T& get() & { return value; }
_ZNR4absl12lts_2026052618container_internal15CompressedTupleIJNSt3__19allocatorINS0_14SourceLocationEEEmEE3getILi1EEERNS1_25internal_compressed_tuple4ElemIS7_XT_EE4typeEv:
  244|  4.55k|  constexpr ElemT<I>& get() & {
  245|  4.55k|    return StorageT<I>::get();
  246|  4.55k|  }
_ZNKR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageImLm1ENS2_10StorageTagIJNSt3__19allocatorINS0_14SourceLocationEEEmEEELb0EE3getEv:
   91|  6.82k|  constexpr const T& get() const& { return value; }
_ZNKR4absl12lts_2026052618container_internal15CompressedTupleIJNSt3__19allocatorINS0_14SourceLocationEEEmEE3getILi1EEERKNS1_25internal_compressed_tuple4ElemIS7_XT_EE4typeEv:
  249|  6.82k|  constexpr const ElemT<I>& get() const& {
  250|  6.82k|    return StorageT<I>::get();
  251|  6.82k|  }
_ZNR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINSt3__19allocatorINS0_14SourceLocationEEELm0ENS2_10StorageTagIJS7_mEEELb1EE3getEv:
  105|  2.27k|  constexpr T& get() & { return *this; }
_ZNR4absl12lts_2026052618container_internal15CompressedTupleIJNSt3__19allocatorINS0_14SourceLocationEEEmEE3getILi0EEERNS1_25internal_compressed_tuple4ElemIS7_XT_EE4typeEv:
  244|  2.27k|  constexpr ElemT<I>& get() & {
  245|  2.27k|    return StorageT<I>::get();
  246|  2.27k|  }
_ZNKR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_12CommonFieldsELm0ENS2_10StorageTagIJS4_NS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEEELb0EE3getEv:
   91|    376|  constexpr const T& get() const& { return value; }
_ZNKR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi0EEERKNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  249|    376|  constexpr const ElemT<I>& get() const& {
  250|    376|    return StorageT<I>::get();
  251|    376|  }
_ZNR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_12CommonFieldsELm0ENS2_10StorageTagIJS4_NS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEEELb0EE3getEv:
   92|    236|  constexpr T& get() & { return value; }
_ZNR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi0EEERNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  244|    236|  constexpr ElemT<I>& get() & {
  245|    236|    return StorageT<I>::get();
  246|    236|  }
_ZNR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINSt3__19allocatorIcEELm3ENS2_10StorageTagIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqES6_EEELb1EE3getEv:
  105|     80|  constexpr T& get() & { return *this; }
_ZNR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi3EEERNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  244|     80|  constexpr ElemT<I>& get() & {
  245|     80|    return StorageT<I>::get();
  246|     80|  }
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_12CommonFieldsELm0ENS2_10StorageTagIJS4_NS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEEELb0EEC2IS4_EENS8_10in_place_tEOT_:
   90|      2|      : value(std::forward<V>(v)) {}
_ZNKR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi1EEERKNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  249|     74|  constexpr const ElemT<I>& get() const& {
  250|     74|    return StorageT<I>::get();
  251|     74|  }
_ZNKR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_10StringHashELm1ENS2_10StorageTagIJNS1_12CommonFieldsES4_NS1_8StringEqENSt3__19allocatorIcEEEEELb1EE3getEv:
  104|     74|  constexpr const T& get() const& { return *this; }
_ZNKR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi2EEERKNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  249|      4|  constexpr const ElemT<I>& get() const& {
  250|      4|    return StorageT<I>::get();
  251|      4|  }
_ZNKR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_8StringEqELm2ENS2_10StorageTagIJNS1_12CommonFieldsENS1_10StringHashES4_NSt3__19allocatorIcEEEEELb1EE3getEv:
  104|      4|  constexpr const T& get() const& { return *this; }
_ZNR4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEE3getILi1EEERNS1_25internal_compressed_tuple4ElemIS9_XT_EE4typeEv:
  244|      4|  constexpr ElemT<I>& get() & {
  245|      4|    return StorageT<I>::get();
  246|      4|  }
_ZNR4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_10StringHashELm1ENS2_10StorageTagIJNS1_12CommonFieldsES4_NS1_8StringEqENSt3__19allocatorIcEEEEELb1EE3getEv:
  105|      4|  constexpr T& get() & { return *this; }
_ZN4absl12lts_2026052618container_internal15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEEC2IS3_JS4_S5_S8_ETnNS6_9enable_ifIXsr3std11conjunctionINS6_8negationINS6_7is_sameIFvS9_EFvu7__decayIT_EEEEEENS1_25internal_compressed_tuple27TupleItemsMoveConstructibleIS9_JSF_DpT0_EEEEE5valueEbE4typeELb1EEEOSF_DpOSM_:
  239|      2|      : CompressedTuple::CompressedTupleImpl(std::in_place,
  240|      2|                                             std::forward<First>(first),
  241|      2|                                             std::forward<Vs>(base)...) {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple19CompressedTupleImplINS1_15CompressedTupleIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqENSt3__19allocatorIcEEEEENS8_16integer_sequenceImJLm0ELm1ELm2ELm3EEEELb1EEC2IJS5_S6_S7_SA_EEENS8_10in_place_tEDpOT_:
  126|      8|      : Storage<Ts, I, StorageTag<Ts...>>(std::in_place,
  127|      8|                                          std::forward<Vs>(args))... {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_10StringHashELm1ENS2_10StorageTagIJNS1_12CommonFieldsES4_NS1_8StringEqENSt3__19allocatorIcEEEEELb1EEC2IS4_EENS8_10in_place_tEOT_:
  102|      2|  explicit constexpr Storage(std::in_place_t, V&& v) : T(std::forward<V>(v)) {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINS1_8StringEqELm2ENS2_10StorageTagIJNS1_12CommonFieldsENS1_10StringHashES4_NSt3__19allocatorIcEEEEELb1EEC2IS4_EENS8_10in_place_tEOT_:
  102|      2|  explicit constexpr Storage(std::in_place_t, V&& v) : T(std::forward<V>(v)) {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINSt3__19allocatorIcEELm3ENS2_10StorageTagIJNS1_12CommonFieldsENS1_10StringHashENS1_8StringEqES6_EEELb1EEC2IS6_EENS4_10in_place_tEOT_:
  102|      2|  explicit constexpr Storage(std::in_place_t, V&& v) : T(std::forward<V>(v)) {}
_ZN4absl12lts_2026052618container_internal15CompressedTupleIJNSt3__19allocatorINS0_14SourceLocationEEEmEEC2IS6_JjETnNS3_9enable_ifIXsr3std11conjunctionINS3_8negationINS3_7is_sameIFvS7_EFvu7__decayIT_EEEEEENS1_25internal_compressed_tuple27TupleItemsMoveConstructibleIS7_JSD_DpT0_EEEEE5valueEbE4typeELb1EEEOSD_DpOSK_:
  239|  2.27k|      : CompressedTuple::CompressedTupleImpl(std::in_place,
  240|  2.27k|                                             std::forward<First>(first),
  241|  2.27k|                                             std::forward<Vs>(base)...) {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple19CompressedTupleImplINS1_15CompressedTupleIJNSt3__19allocatorINS0_14SourceLocationEEEmEEENS5_16integer_sequenceImJLm0ELm1EEEELb1EEC2IJS8_jEEENS5_10in_place_tEDpOT_:
  126|  4.55k|      : Storage<Ts, I, StorageTag<Ts...>>(std::in_place,
  127|  4.55k|                                          std::forward<Vs>(args))... {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageINSt3__19allocatorINS0_14SourceLocationEEELm0ENS2_10StorageTagIJS7_mEEELb1EEC2IS7_EENS4_10in_place_tEOT_:
  102|  2.27k|  explicit constexpr Storage(std::in_place_t, V&& v) : T(std::forward<V>(v)) {}
_ZN4absl12lts_2026052618container_internal25internal_compressed_tuple7StorageImLm1ENS2_10StorageTagIJNSt3__19allocatorINS0_14SourceLocationEEEmEEELb0EEC2IjEENS5_10in_place_tEOT_:
   90|  2.27k|      : value(std::forward<V>(v)) {}

_ZN4absl12lts_2026052618container_internal27SanitizerPoisonMemoryRegionEPKvm:
  240|     38|inline void SanitizerPoisonMemoryRegion(const void* m, size_t s) {
  241|       |#ifdef ABSL_HAVE_ADDRESS_SANITIZER
  242|       |  ASAN_POISON_MEMORY_REGION(m, s);
  243|       |#endif
  244|       |#ifdef ABSL_HAVE_MEMORY_SANITIZER
  245|       |  __msan_poison(m, s);
  246|       |#endif
  247|     38|  (void)m;
  248|     38|  (void)s;
  249|     38|}
_ZN4absl12lts_2026052618container_internal29SanitizerUnpoisonMemoryRegionEPKvm:
  251|     90|inline void SanitizerUnpoisonMemoryRegion(const void* m, size_t s) {
  252|       |#ifdef ABSL_HAVE_ADDRESS_SANITIZER
  253|       |  ASAN_UNPOISON_MEMORY_REGION(m, s);
  254|       |#endif
  255|       |#ifdef ABSL_HAVE_MEMORY_SANITIZER
  256|       |  __msan_unpoison(m, s);
  257|       |#endif
  258|     90|  (void)m;
  259|     90|  (void)s;
  260|     90|}
_ZN4absl12lts_2026052618container_internal11HashElementINS1_10StringHashELb1EEC2ERKS3_m:
  495|     78|  HashElement(const Hash& h, size_t s) : hash(h), seed(s) {}
_ZN4absl12lts_2026052618container_internal13DecomposePairINS1_12EqualElementINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEENS1_8StringEqEEEJRNS4_4pairIKS8_PNS0_15CommandLineFlagEEEEEEDTclsr15memory_internalE17DecomposePairImplclsr3stdE7forwardIT_Efp_Ecl8PairArgsspclsr3stdE7forwardIT0_Efp0_EEEEOSH_DpOSI_:
  226|      4|        std::forward<F>(f), PairArgs(std::forward<Args>(args)...))) {
  227|      4|  return memory_internal::DecomposePairImpl(
  228|      4|      std::forward<F>(f), PairArgs(std::forward<Args>(args)...));
  229|      4|}
_ZN4absl12lts_2026052618container_internal15memory_internal17DecomposePairImplINS1_12EqualElementINSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS1_8StringEqEEERKS9_NS5_5tupleIJRKPNS0_15CommandLineFlagEEEEEEDTclclsr3stdE7declvalIT_EEclsr3stdE7declvalIRKT0_EEL_ZNS5_19piecewise_constructEEclsr3stdE7declvalINSE_IJSL_EEEEEclsr3stdE7declvalIT1_EEEEOSK_NS5_4pairISO_SP_EE:
  158|      4|DecomposePairImpl(F&& f, std::pair<std::tuple<K>, V> p) {
  159|      4|  const auto& key = std::get<0>(p.first);
  160|      4|  return std::forward<F>(f)(key, std::piecewise_construct, std::move(p.first),
  161|      4|                            std::move(p.second));
  162|      4|}
_ZNK4absl12lts_2026052618container_internal12EqualElementINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEENS1_8StringEqEEclIS7_JRKNS3_21piecewise_construct_tENS3_5tupleIJRKS7_EEENSE_IJRKPNS0_15CommandLineFlagEEEEEEEbRKT_DpOT0_:
  529|      4|  bool operator()(const K2& lhs, Args&&...) const {
  530|      4|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(eq(lhs, rhs));
  ------------------
  |  |  488|      4|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
  531|      4|  }
_ZN4absl12lts_2026052618container_internal8PairArgsIKNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEEENS3_4pairINS3_5tupleIJRKT_EEENSC_IJRKT0_EEEEERKNSB_ISD_SH_EE:
  207|     32|    const std::pair<F, S>& p) {
  208|     32|  return PairArgs(p.first, p.second);
  209|     32|}
_ZN4absl12lts_2026052618container_internal8PairArgsIRKNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERKPNS0_15CommandLineFlagEEENS3_4pairINS3_5tupleIJOT_EEENSF_IJOT0_EEEEESH_SK_:
  201|     32|std::pair<std::tuple<F&&>, std::tuple<S&&>> PairArgs(F&& f, S&& s) {
  202|     32|  return {std::piecewise_construct, std::forward_as_tuple(std::forward<F>(f)),
  203|     32|          std::forward_as_tuple(std::forward<S>(s))};
  204|     32|}
_ZNK4absl12lts_2026052618container_internal11HashElementINS1_10StringHashELb1EEclINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEJEEEmRKT_DpOT0_:
  498|     50|  size_t operator()(const K& key, Args&&...) const {
  499|     50|    if constexpr (kIsDefault) {
  500|       |      // TODO(b/384509507): resolve `no header providing
  501|       |      // "absl::hash_internal::SupportsHashWithSeed" is directly included`.
  502|       |      // Maybe we should make "internal/hash.h" be a separate library.
  503|     50|      return absl::hash_internal::HashWithSeed().hash(hash, key, seed);
  504|     50|    }
  505|       |    // NOLINTNEXTLINE(clang-diagnostic-sign-conversion)
  506|      0|    return hash(key) ^ seed;
  507|     50|  }
_ZN4absl12lts_2026052618container_internal13DecomposePairINS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS5_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE19EmplaceDecomposableEJNS5_4pairIKS9_SB_EEEEEDTclsr15memory_internalE17DecomposePairImplclsr3stdE7forwardIT_Efp_Ecl8PairArgsspclsr3stdE7forwardIT0_Efp0_EEEEOSI_DpOSJ_:
  226|     50|        std::forward<F>(f), PairArgs(std::forward<Args>(args)...))) {
  227|     50|  return memory_internal::DecomposePairImpl(
  228|     50|      std::forward<F>(f), PairArgs(std::forward<Args>(args)...));
  229|     50|}
_ZN4absl12lts_2026052618container_internal15memory_internal17DecomposePairImplINS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE19EmplaceDecomposableEOKSA_NS6_5tupleIJOSC_EEEEEDTclclsr3stdE7declvalIT_EEclsr3stdE7declvalIRKT0_EEL_ZNS6_19piecewise_constructEEclsr3stdE7declvalINSI_IJSM_EEEEEclsr3stdE7declvalIT1_EEEEOSL_NS6_4pairISP_SQ_EE:
  158|     50|DecomposePairImpl(F&& f, std::pair<std::tuple<K>, V> p) {
  159|     50|  const auto& key = std::get<0>(p.first);
  160|     50|  return std::forward<F>(f)(key, std::piecewise_construct, std::move(p.first),
  161|     50|                            std::move(p.second));
  162|     50|}
_ZN4absl12lts_2026052618container_internal23TypeErasedApplyToSlotFnINS1_10StringHashENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELb1EEEmPKvPvm:
  542|      2|size_t TypeErasedApplyToSlotFn(const void* fn, void* slot, size_t seed) {
  543|      2|  const auto* f = static_cast<const Fn*>(fn);
  544|      2|  return HashElement<Fn, kIsDefault>{*f, seed}(*static_cast<const T*>(slot));
  545|      2|}
_ZN4absl12lts_2026052618container_internal13DecomposePairINS1_11HashElementINS1_10StringHashELb1EEEJRNSt3__14pairIKNS6_17basic_string_viewIcNS6_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEEEEDTclsr15memory_internalE17DecomposePairImplclsr3stdE7forwardIT_Efp_Ecl8PairArgsspclsr3stdE7forwardIT0_Efp0_EEEEOSH_DpOSI_:
  226|     28|        std::forward<F>(f), PairArgs(std::forward<Args>(args)...))) {
  227|     28|  return memory_internal::DecomposePairImpl(
  228|     28|      std::forward<F>(f), PairArgs(std::forward<Args>(args)...));
  229|     28|}
_ZN4absl12lts_2026052618container_internal15memory_internal17DecomposePairImplINS1_11HashElementINS1_10StringHashELb1EEERKNSt3__117basic_string_viewIcNS7_11char_traitsIcEEEENS7_5tupleIJRKPNS0_15CommandLineFlagEEEEEEDTclclsr3stdE7declvalIT_EEclsr3stdE7declvalIRKT0_EEL_ZNS7_19piecewise_constructEEclsr3stdE7declvalINSE_IJSL_EEEEEclsr3stdE7declvalIT1_EEEEOSK_NS7_4pairISO_SP_EE:
  158|     28|DecomposePairImpl(F&& f, std::pair<std::tuple<K>, V> p) {
  159|     28|  const auto& key = std::get<0>(p.first);
  160|     28|  return std::forward<F>(f)(key, std::piecewise_construct, std::move(p.first),
  161|     28|                            std::move(p.second));
  162|     28|}
_ZNK4absl12lts_2026052618container_internal11HashElementINS1_10StringHashELb1EEclINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEJRKNS6_21piecewise_construct_tENS6_5tupleIJRKSA_EEENSE_IJRKPNS0_15CommandLineFlagEEEEEEEmRKT_DpOT0_:
  498|     28|  size_t operator()(const K& key, Args&&...) const {
  499|     28|    if constexpr (kIsDefault) {
  500|       |      // TODO(b/384509507): resolve `no header providing
  501|       |      // "absl::hash_internal::SupportsHashWithSeed" is directly included`.
  502|       |      // Maybe we should make "internal/hash.h" be a separate library.
  503|     28|      return absl::hash_internal::HashWithSeed().hash(hash, key, seed);
  504|     28|    }
  505|       |    // NOLINTNEXTLINE(clang-diagnostic-sign-conversion)
  506|      0|    return hash(key) ^ seed;
  507|     28|  }
_ZN4absl12lts_2026052618container_internal15map_slot_policyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE8transferINS3_9allocatorINS3_4pairIKS7_S9_EEEEEEDaPT_PNS1_13map_slot_typeIS7_S9_EESL_:
  442|     28|                       slot_type* old_slot) {
  443|       |    // This should really just be
  444|       |    // typename absl::is_trivially_relocatable<value_type>::type()
  445|       |    // but std::pair is not trivially copyable in C++23 in some standard
  446|       |    // library versions.
  447|       |    // See https://github.com/llvm/llvm-project/pull/95444 for instance.
  448|     28|    auto is_relocatable = typename std::conjunction<
  449|     28|        absl::is_trivially_relocatable<typename value_type::first_type>,
  450|     28|        absl::is_trivially_relocatable<typename value_type::second_type>>::
  451|     28|        type();
  452|       |
  453|     28|    emplace(new_slot);
  454|     28|    if (is_relocatable) {
  ------------------
  |  Branch (454:9): [True: 28, Folded]
  ------------------
  455|       |      // TODO(b/247130232,b/251814870): remove casts after fixing warnings.
  456|     28|      std::memcpy(static_cast<void*>(std::launder(&new_slot->value)),
  457|     28|                  static_cast<const void*>(&old_slot->value),
  458|     28|                  sizeof(value_type));
  459|     28|      return is_relocatable;
  460|     28|    }
  461|       |
  462|      0|    if (kMutableKeys::value) {
  ------------------
  |  Branch (462:9): [True: 0, Folded]
  ------------------
  463|      0|      std::allocator_traits<Allocator>::construct(
  464|      0|          *alloc, &new_slot->mutable_value, std::move(old_slot->mutable_value));
  465|      0|    } else {
  466|      0|      std::allocator_traits<Allocator>::construct(*alloc, &new_slot->value,
  467|      0|                                                  std::move(old_slot->value));
  468|      0|    }
  469|      0|    destroy(alloc, old_slot);
  470|      0|    return is_relocatable;
  471|     28|  }
_ZN4absl12lts_2026052618container_internal15map_slot_policyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE7emplaceEPNS1_13map_slot_typeIS7_S9_EE:
  368|     78|  static void emplace(slot_type* slot) {
  369|       |    // The construction of union doesn't do anything at runtime but it allows us
  370|       |    // to access its members without violating aliasing rules.
  371|     78|    new (slot) slot_type;
  372|     78|  }
_ZN4absl12lts_2026052618container_internal13map_slot_typeINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEEC2Ev:
  349|     78|  map_slot_type() {}
_ZN4absl12lts_2026052618container_internal7HashKeyINS1_10StringHashENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELb1EEC2ERKS3_RKS8_:
  515|      4|  HashKey(const Hash& h, const Key& k) : hash(h), key(k) {}
_ZNK4absl12lts_2026052618container_internal7HashKeyINS1_10StringHashENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELb1EEclEm:
  517|      2|  size_t operator()(size_t seed) const {
  518|      2|    return HashElement<Hash, kIsDefault>{hash, seed}(key);
  519|      2|  }
_ZN4absl12lts_2026052618container_internal15map_slot_policyINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEE9constructINS3_9allocatorINS3_4pairIKS7_S9_EEEEJRKNS3_21piecewise_construct_tENS3_5tupleIJOSE_EEENSK_IJOS9_EEEEEEvPT_PNS1_13map_slot_typeIS7_S9_EEDpOT0_:
  397|     50|  static void construct(Allocator* alloc, slot_type* slot, Args&&... args) {
  398|     50|    emplace(slot);
  399|     50|    if (kMutableKeys::value) {
  ------------------
  |  Branch (399:9): [True: 50, Folded]
  ------------------
  400|     50|      std::allocator_traits<Allocator>::construct(*alloc, &slot->mutable_value,
  401|     50|                                                  std::forward<Args>(args)...);
  402|     50|    } else {
  403|      0|      std::allocator_traits<Allocator>::construct(*alloc, &slot->value,
  404|      0|                                                  std::forward<Args>(args)...);
  405|      0|    }
  406|     50|  }
_ZN4absl12lts_2026052618container_internal8PairArgsIKNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEEENS3_4pairINS3_5tupleIJOT_EEENSC_IJOT0_EEEEEONSB_ISD_SG_EE:
  211|     50|std::pair<std::tuple<F&&>, std::tuple<S&&>> PairArgs(std::pair<F, S>&& p) {
  212|     50|  return PairArgs(std::forward<F>(p.first), std::forward<S>(p.second));
  213|     50|}
_ZN4absl12lts_2026052618container_internal8PairArgsIKNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS0_15CommandLineFlagEEENS3_4pairINS3_5tupleIJOT_EEENSC_IJOT0_EEEEESE_SH_:
  201|     50|std::pair<std::tuple<F&&>, std::tuple<S&&>> PairArgs(F&& f, S&& s) {
  202|     50|  return {std::piecewise_construct, std::forward_as_tuple(std::forward<F>(f)),
  203|     50|          std::forward_as_tuple(std::forward<S>(s))};
  204|     50|}
_ZN4absl12lts_2026052618container_internal8AllocateILm8ENSt3__19allocatorIcEEEEPvPT0_m:
   62|     10|void* Allocate(Alloc* alloc, size_t n) {
   63|     10|  static_assert(Alignment > 0, "");
   64|     10|  assert(n && "n must be positive");
   65|     10|  using M = AlignedType<Alignment>;
   66|     10|  using A = typename std::allocator_traits<Alloc>::template rebind_alloc<M>;
   67|     10|  using AT = typename std::allocator_traits<Alloc>::template rebind_traits<M>;
   68|       |  // On macOS, "mem_alloc" is a #define with one argument defined in
   69|       |  // rpc/types.h, so we can't name the variable "mem_alloc" and initialize it
   70|       |  // with the "foo(bar)" syntax.
   71|     10|  A my_mem_alloc(*alloc);
   72|     10|  void* p = AT::allocate(my_mem_alloc, (n + sizeof(M) - 1) / sizeof(M));
   73|       |  assert(reinterpret_cast<uintptr_t>(p) % Alignment == 0 &&
   74|     10|         "allocator does not respect alignment");
   75|     10|  return p;
   76|     10|}
_ZN4absl12lts_2026052618container_internal10DeallocateILm8ENSt3__19allocatorIcEEEEvPT0_Pvm:
   93|      8|void Deallocate(Alloc* alloc, void* p, size_t n) {
   94|      8|  static_assert(Alignment > 0, "");
   95|      8|  assert(n && "n must be positive");
   96|      8|  using M = AlignedType<Alignment>;
   97|      8|  using A = typename std::allocator_traits<Alloc>::template rebind_alloc<M>;
   98|      8|  using AT = typename std::allocator_traits<Alloc>::template rebind_traits<M>;
   99|       |  // On macOS, "mem_alloc" is a #define with one argument defined in
  100|       |  // rpc/types.h, so we can't name the variable "mem_alloc" and initialize it
  101|       |  // with the "foo(bar)" syntax.
  102|      8|  A my_mem_alloc(*alloc);
  103|      8|  AT::deallocate(my_mem_alloc, static_cast<M*>(p),
  104|      8|                 (n + sizeof(M) - 1) / sizeof(M));
  105|      8|}

_ZNK4absl12lts_2026052618container_internal10StringHash14hash_with_seedENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEm:
   86|     78|  size_t hash_with_seed(absl::string_view v, size_t seed) const {
   87|     78|    return absl::hash_internal::HashWithSeed().hash(
   88|     78|        absl::Hash<absl::string_view>{}, v, seed);
   89|     78|  }
_ZNK4absl12lts_2026052618container_internal8StringEqclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEES7_:
   98|      4|  bool operator()(absl::string_view lhs, absl::string_view rhs) const {
   99|      4|    return lhs == rhs;
  100|      4|  }

_ZN4absl12lts_2026052618container_internal18hash_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE5applyINS1_12EqualElementIS8_NS1_8StringEqEEEJRNS4_4pairIKS8_SA_EEESB_EEDTclsrT1_5applyclsr3stdE7forwardIT_Efp_Espclsr3stdE7forwardIT0_Efp0_EEEOSM_DpOSN_:
  130|      4|      -> decltype(P::apply(std::forward<F>(f), std::forward<Ts>(ts)...)) {
  131|      4|    return P::apply(std::forward<F>(f), std::forward<Ts>(ts)...);
  132|      4|  }
_ZN4absl12lts_2026052618container_internal18hash_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE5applyINS1_12raw_hash_setISB_JEE19EmplaceDecomposableEJNS4_4pairIKS8_SA_EEESB_EEDTclsrT1_5applyclsr3stdE7forwardIT_Efp_Espclsr3stdE7forwardIT0_Efp0_EEEOSL_DpOSM_:
  130|     50|      -> decltype(P::apply(std::forward<F>(f), std::forward<Ts>(ts)...)) {
  131|     50|    return P::apply(std::forward<F>(f), std::forward<Ts>(ts)...);
  132|     50|  }
_ZN4absl12lts_2026052618container_internal18hash_policy_traitsINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEvE5applyINS1_11HashElementINS1_10StringHashELb1EEEJRNS4_4pairIKS8_SA_EEESB_EEDTclsrT1_5applyclsr3stdE7forwardIT_Efp_Espclsr3stdE7forwardIT0_Efp0_EEEOSM_DpOSN_:
  130|     28|      -> decltype(P::apply(std::forward<F>(f), std::forward<Ts>(ts)...)) {
  131|     28|    return P::apply(std::forward<F>(f), std::forward<Ts>(ts)...);
  132|     28|  }

_ZN4absl12lts_2026052618container_internal13GroupSse2ImplC2EPKNS1_6ctrl_tE:
  284|     50|  explicit GroupSse2Impl(const ctrl_t* pos) {
  285|     50|    ctrl = _mm_loadu_si128(reinterpret_cast<const __m128i*>(pos));
  286|     50|  }
_ZNK4absl12lts_2026052618container_internal13GroupSse2Impl5MatchEh:
  289|     46|  BitMaskType Match(h2_t hash) const {
  290|     46|    auto match = _mm_set1_epi8(static_cast<char>(hash));
  291|     46|    return BitMaskType(MoveMask(_mm_cmpeq_epi8(match, ctrl)));
  292|     46|  }
_ZNK4absl12lts_2026052618container_internal13GroupSse2Impl9MaskEmptyEv:
  295|     46|  NonIterableBitMaskType MaskEmpty() const {
  296|       |#ifdef ABSL_INTERNAL_HAVE_SSSE3
  297|       |    // This only works because ctrl_t::kEmpty is -128.
  298|       |    return NonIterableBitMaskType(MoveMask(_mm_sign_epi8(ctrl, ctrl)));
  299|       |#else
  300|     46|    auto match = _mm_set1_epi8(static_cast<char>(ctrl_t::kEmpty));
  301|     46|    return NonIterableBitMaskType(MoveMask(_mm_cmpeq_epi8(match, ctrl)));
  302|     46|#endif
  303|     46|  }
_ZNK4absl12lts_2026052618container_internal13GroupSse2Impl8MaskFullEv:
  308|      2|  BitMaskType MaskFull() const { return BitMaskType(MoveMask(ctrl) ^ 0xffff); }
_ZNK4absl12lts_2026052618container_internal13GroupSse2Impl18MaskEmptyOrDeletedEv:
  316|      2|  NonIterableBitMaskType MaskEmptyOrDeleted() const {
  317|      2|    auto special = _mm_set1_epi8(static_cast<char>(ctrl_t::kSentinel));
  318|      2|    return NonIterableBitMaskType(
  319|      2|        MoveMask(_mm_cmpgt_epi8_fixed(special, ctrl)));
  320|      2|  }
_ZN4absl12lts_2026052618container_internal13GroupSse2Impl8MoveMaskEDv2_x:
  344|     96|  static MaskInt MoveMask(__m128i xmm) {
  345|     96|    auto mask = static_cast<MaskInt>(_mm_movemask_epi8(xmm));
  346|     96|#ifdef __clang__
  347|       |    // TODO(b/472522597): Without the inline asm, clang ends up generating an
  348|       |    // unnecessary movzx to zero the upper bits of the output, but those bits
  349|       |    // are already zero. See https://godbolt.org/z/G6xW1Ecbx.
  350|     96|    asm("" : "+r"(mask));  // NOLINT
  351|     96|#endif
  352|     96|    return mask;
  353|     96|  }
_ZN4absl12lts_2026052618container_internal6IsFullENS1_6ctrl_tE:
  221|     46|inline bool IsFull(ctrl_t c) {
  222|       |  // Cast `c` to the underlying type instead of casting `0` to `ctrl_t` as `0`
  223|       |  // is not a value in the enum. Both ways are equivalent, but this way makes
  224|       |  // linters happier.
  225|     46|  return static_cast<std::underlying_type_t<ctrl_t>>(c) >= 0;
  226|     46|}
_ZN4absl12lts_2026052618container_internal16IsEmptyOrDeletedENS1_6ctrl_tE:
  228|     66|inline bool IsEmptyOrDeleted(ctrl_t c) { return c < ctrl_t::kSentinel; }
_ZN4absl12lts_2026052618container_internal20_mm_cmpgt_epi8_fixedEDv2_xS2_:
  264|      2|inline __m128i _mm_cmpgt_epi8_fixed(__m128i a, __m128i b) {
  265|       |#if defined(__GNUC__) && !defined(__clang__)
  266|       |  if (std::is_unsigned<char>::value) {
  267|       |    const __m128i mask = _mm_set1_epi8(0x80);
  268|       |    const __m128i diff = _mm_subs_epi8(b, a);
  269|       |    return _mm_cmpeq_epi8(_mm_and_si128(diff, mask), mask);
  270|       |  }
  271|       |#endif
  272|      2|  return _mm_cmpgt_epi8(a, b);
  273|      2|}
_ZNK4absl12lts_2026052618container_internal7BitMaskIjLi16ELi0ELb0EE5beginEv:
  153|     48|  BitMask begin() const { return *this; }
_ZNK4absl12lts_2026052618container_internal7BitMaskIjLi16ELi0ELb0EE3endEv:
  154|     48|  BitMask end() const { return BitMask(0); }
_ZN4absl12lts_2026052618container_internalneERKNS1_7BitMaskIjLi16ELi0ELb0EEES5_:
  160|     78|  friend bool operator!=(const BitMask& a, const BitMask& b) {
  161|     78|    return a.mask_ != b.mask_;
  162|     78|  }
_ZN4absl12lts_2026052618container_internal7BitMaskIjLi16ELi0ELb0EEppEv:
  143|     30|  BitMask& operator++() {
  144|     30|    if (Shift == 3 && NullifyBitsOnIteration) {
  ------------------
  |  Branch (144:9): [Folded, False: 30]
  |  Branch (144:23): [Folded, False: 0]
  ------------------
  145|      0|      this->mask_ &= kMsbs8Bytes;
  146|      0|    }
  147|     30|    this->mask_ &= (this->mask_ - 1);
  148|     30|    return *this;
  149|     30|  }
_ZNK4absl12lts_2026052618container_internal7BitMaskIjLi16ELi0ELb0EEdeEv:
  151|     30|  uint32_t operator*() const { return Base::LowestBitSet(); }
_ZNK4absl12lts_2026052618container_internal18NonIterableBitMaskIjLi16ELi0EE12LowestBitSetEv:
   90|     72|  uint32_t LowestBitSet() const {
   91|     72|    return container_internal::TrailingZeros(mask_) >> Shift;
   92|     72|  }
_ZN4absl12lts_2026052618container_internal13TrailingZerosIjEEjT_:
   63|     72|uint32_t TrailingZeros(T x) {
   64|     72|  ABSL_ASSUME(x != 0);
  ------------------
  |  |  271|     72|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
   65|     72|  return static_cast<uint32_t>(countr_zero(x));
   66|     72|}
_ZNK4absl12lts_2026052618container_internal18NonIterableBitMaskIjLi16ELi0EEcvbEv:
   87|     48|  explicit operator bool() const { return mask_ != 0; }
_ZN4absl12lts_2026052618container_internal13TrailingZerosImEEjT_:
   63|     12|uint32_t TrailingZeros(T x) {
   64|     12|  ABSL_ASSUME(x != 0);
  ------------------
  |  |  271|     12|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
   65|     12|  return static_cast<uint32_t>(countr_zero(x));
   66|     12|}
_ZN4absl12lts_2026052618container_internal7BitMaskIjLi16ELi0ELb0EEC2Ej:
  133|     96|  explicit BitMask(T mask) : Base(mask) {
  134|     96|    if (Shift == 3 && !NullifyBitsOnIteration) {
  ------------------
  |  Branch (134:9): [Folded, False: 96]
  |  Branch (134:23): [True: 0, Folded]
  ------------------
  135|       |      ABSL_SWISSTABLE_ASSERT(this->mask_ == (this->mask_ & kMsbs8Bytes));
  ------------------
  |  |   58|      0|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  136|      0|    }
  137|     96|  }
_ZN4absl12lts_2026052618container_internal18NonIterableBitMaskIjLi16ELi0EEC2Ej:
   85|    144|  explicit NonIterableBitMask(T mask) : mask_(mask) {}

_ZNK4absl12lts_2026052618container_internal20HashtablezInfoHandle9IsSampledEv:
  204|     10|  inline bool IsSampled() const { return false; }
_ZN4absl12lts_2026052618container_internal20HashtablezInfoHandle20RecordStorageChangedEmm:
  205|      2|  inline void RecordStorageChanged(size_t /*size*/, size_t /*capacity*/) {}
_ZN4absl12lts_2026052618container_internal20HashtablezInfoHandle16RecordInsertMissEmm:
  210|     40|                               size_t /*distance_from_desired*/) {}
_ZN4absl12lts_2026052618container_internal21ShouldSampleNextTableEv:
  226|      2|inline bool ShouldSampleNextTable() {
  227|       |#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
  228|       |  if (ABSL_PREDICT_TRUE(--global_next_sample.next_sample > 0)) {
  229|       |    return false;
  230|       |  }
  231|       |  return true;
  232|       |#else
  233|      2|  return false;
  234|      2|#endif  // ABSL_INTERNAL_HASHTABLEZ_SAMPLE
  235|      2|}

_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE21GetSizeAndIsAllocatedEv:
  365|  4.55k|  SizeType<A>& GetSizeAndIsAllocated() { return metadata_.template get<1>(); }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE21DeallocateIfAllocatedEv:
  521|  2.27k|  void DeallocateIfAllocated() {
  522|  2.27k|    if (GetIsAllocated()) {
  ------------------
  |  Branch (522:9): [True: 0, False: 2.27k]
  ------------------
  523|      0|      MallocAdapter<A>::Deallocate(GetAllocator(), GetAllocatedData(),
  524|      0|                                   GetAllocatedCapacity());
  525|      0|    }
  526|  2.27k|  }
_ZNK4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE14GetIsAllocatedEv:
  373|  4.55k|  bool GetIsAllocated() const { return GetSizeAndIsAllocated() & 1; }
_ZNK4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE21GetSizeAndIsAllocatedEv:
  367|  6.82k|  const SizeType<A>& GetSizeAndIsAllocated() const {
  368|  6.82k|    return metadata_.template get<1>();
  369|  6.82k|  }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE12GetAllocatorEv:
  420|  2.27k|  A& GetAllocator() { return metadata_.template get<0>(); }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE14GetInlinedDataEv:
  397|  2.27k|  ABSL_ATTRIBUTE_NO_SANITIZE_CFI Pointer<A> GetInlinedData() {
  398|  2.27k|    return reinterpret_cast<Pointer<A>>(data_.inlined.inlined_data);
  399|  2.27k|  }
_ZNK4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE7GetSizeEv:
  371|  2.27k|  SizeType<A> GetSize() const { return GetSizeAndIsAllocated() >> 1; }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEED2Ev:
  343|  2.27k|  ~Storage() {
  344|       |    // Fast path: if we are empty and not allocated, there's nothing to do.
  345|  2.27k|    if (GetSizeAndIsAllocated() == 0) {
  ------------------
  |  Branch (345:9): [True: 0, False: 2.27k]
  ------------------
  346|      0|      return;
  347|      0|    }
  348|       |
  349|       |    // Fast path: if no destructors need to be run and we know the allocator
  350|       |    // doesn't do anything fancy, then all we need to do is deallocate (and
  351|       |    // maybe not even that).
  352|  2.27k|    if (std::is_trivially_destructible<ValueType<A>>::value &&
  ------------------
  |  Branch (352:9): [True: 0, Folded]
  ------------------
  353|  2.27k|        std::is_same<A, std::allocator<ValueType<A>>>::value) {
  ------------------
  |  Branch (353:9): [True: 0, Folded]
  ------------------
  354|  2.27k|      DeallocateIfAllocated();
  355|  2.27k|      return;
  356|  2.27k|    }
  357|       |
  358|      0|    DestroyContents();
  359|      0|  }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEEC2Ev:
  338|  2.27k|  Storage() : metadata_(A(), /* size and is_allocated */ 0u) {}
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE11EmplaceBackIJRKS3_EEERS3_DpOT_:
  817|  2.27k|auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> Reference<A> {
  818|  2.27k|  StorageView<A> storage_view = MakeStorageView();
  819|  2.27k|  const SizeType<A> n = storage_view.size;
  820|  2.27k|  if (ABSL_PREDICT_TRUE(n != storage_view.capacity)) {
  ------------------
  |  |  191|  2.27k|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 2.27k, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 2.27k]
  |  |  |  Branch (191:57): [True: 2.27k, False: 0]
  |  |  ------------------
  ------------------
  821|       |    // Fast path; new element fits.
  822|  2.27k|    Pointer<A> last_ptr = storage_view.data + n;
  823|  2.27k|    AllocatorTraits<A>::construct(GetAllocator(), last_ptr,
  824|  2.27k|                                  std::forward<Args>(args)...);
  825|  2.27k|    AddSize(1);
  826|  2.27k|    return *last_ptr;
  827|  2.27k|  }
  828|       |  // TODO(b/173712035): Annotate with musttail attribute to prevent regression.
  829|      0|  return EmplaceBackSlow(std::forward<Args>(args)...);
  830|  2.27k|}
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE15MakeStorageViewEv:
  413|  2.27k|  StorageView<A> MakeStorageView() {
  414|  2.27k|    return GetIsAllocated() ? StorageView<A>{GetAllocatedData(), GetSize(),
  ------------------
  |  Branch (414:12): [True: 0, False: 2.27k]
  ------------------
  415|      0|                                             GetAllocatedCapacity()}
  416|  2.27k|                            : StorageView<A>{GetInlinedData(), GetSize(),
  417|  2.27k|                                             GetInlinedCapacity()};
  418|  2.27k|  }
_ZNK4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE18GetInlinedCapacityEv:
  409|  2.27k|  SizeType<A> GetInlinedCapacity() const {
  410|  2.27k|    return static_cast<SizeType<A>>(kOptimalInlinedSize);
  411|  2.27k|  }
_ZN4absl12lts_2026052623inlined_vector_internal7StorageINS0_14SourceLocationELm1ENSt3__19allocatorIS3_EEE7AddSizeEm:
  475|  2.27k|  void AddSize(SizeType<A> count) {
  476|  2.27k|    GetSizeAndIsAllocated() += count << static_cast<SizeType<A>>(1);
  477|  2.27k|  }

_ZN4absl12lts_2026052618container_internal12raw_hash_mapINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEEC2Ev:
  107|      2|  raw_hash_map() {}

_ZN4absl12lts_2026052618container_internal17NextHashTableSeedEv:
  138|      2|uint16_t NextHashTableSeed() {
  139|      2|  static_assert(PerTableSeed::kBitCount <= 16);
  140|      2|  thread_local uint16_t seed =
  141|      2|      static_cast<uint16_t>(reinterpret_cast<uintptr_t>(&seed));
  142|      2|  seed += uint16_t{0xad53};
  143|      2|  return seed;
  144|      2|}
_ZN4absl12lts_2026052618container_internal17ClearBackingArrayERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEPvb:
  670|      2|                       bool reuse) {
  671|      2|  ABSL_SWISSTABLE_ASSERT(c.capacity() > MaxSmallCapacity());
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  672|      2|  if (reuse) {
  ------------------
  |  Branch (672:7): [True: 2, False: 0]
  ------------------
  673|      2|    c.set_size_to_zero();
  674|      2|    ResetCtrl(c, policy.slot_size);
  675|      2|    ResetGrowthLeft(c);
  676|      2|    c.infoz().RecordStorageChanged(0, c.capacity());
  677|      2|  } else {
  678|      0|    ClearBackingArrayNoReuse(c, policy, alloc);
  679|      0|  }
  680|      2|}
_ZN4absl12lts_2026052618container_internal24PrepareInsertSmallNonSooERNS1_12CommonFieldsERKNS1_15PolicyFunctionsENS0_11FunctionRefIFmmEEE:
 1541|      4|    absl::FunctionRef<size_t(size_t)> get_hash) {
 1542|      4|  ABSL_SWISSTABLE_ASSERT(common.is_small());
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1543|      4|  ABSL_SWISSTABLE_ASSERT(!policy.soo_enabled);
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1544|      4|  if (common.capacity() == 1) {
  ------------------
  |  Branch (1544:7): [True: 2, False: 2]
  ------------------
 1545|      2|    if (common.empty()) {
  ------------------
  |  Branch (1545:9): [True: 0, False: 2]
  ------------------
 1546|      0|      IncrementSmallSizeNonSoo(common, policy);
 1547|      0|      if (common.has_infoz()) {
  ------------------
  |  Branch (1547:11): [True: 0, False: 0]
  ------------------
 1548|      0|        common.infoz().RecordInsertMiss(get_hash(common.seed().seed()),
 1549|      0|                                        /*distance_from_desired=*/0);
 1550|      0|      }
 1551|      0|      return {SooControl(), common.slot_array()};
 1552|      2|    } else {
 1553|      2|      return Grow1To3AndPrepareInsert(common, policy, get_hash);
 1554|      2|    }
 1555|      2|  }
 1556|       |
 1557|       |  // Growing from 0 to 1 capacity.
 1558|      2|  ABSL_SWISSTABLE_ASSERT(common.capacity() == 0);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1559|      2|  constexpr size_t kNewCapacity = 1;
 1560|       |
 1561|      2|  common.set_capacity(kNewCapacity);
 1562|      2|  HashtablezInfoHandle infoz;
 1563|      2|  const bool should_sample =
 1564|      2|      policy.is_hashtablez_eligible && ShouldSampleNextTable();
  ------------------
  |  Branch (1564:7): [True: 2, False: 0]
  |  Branch (1564:40): [True: 0, False: 2]
  ------------------
 1565|      2|  if (ABSL_PREDICT_FALSE(should_sample)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 1566|      0|    infoz = ForcedTrySample(policy.slot_size, policy.key_size,
 1567|      0|                            policy.value_size, policy.soo_capacity());
 1568|      0|  }
 1569|      2|  const bool has_infoz = infoz.IsSampled();
 1570|      2|  void* alloc = policy.get_char_alloc(common);
 1571|       |
 1572|      2|  const auto [new_ctrl, new_slots] =
 1573|      2|      AllocBackingArray(common, policy, kNewCapacity, has_infoz, alloc);
 1574|      2|  common.set_control(new_ctrl);
 1575|      2|  common.set_slots(new_slots);
 1576|       |
 1577|      2|  static_assert(NextCapacity(0) == 1);
 1578|      2|  PrepareInsertCommon(common);
 1579|       |
 1580|      2|  if (ABSL_PREDICT_FALSE(has_infoz)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 1581|      0|    common.generate_new_seed(/*has_infoz=*/true);
 1582|      0|    ReportSingleGroupTableGrowthToInfoz(common, infoz,
 1583|      0|                                        get_hash(common.seed().seed()));
 1584|      0|  }
 1585|      2|  return {SooControl(), new_slots};
 1586|      4|}
_ZN4absl12lts_2026052618container_internal19GetRefForEmptyClassERNS1_12CommonFieldsE:
 1752|     12|void* GetRefForEmptyClass(CommonFields& common) {
 1753|       |  // Empty base optimization typically make the empty base class address to be
 1754|       |  // the same as the first address of the derived class object.
 1755|       |  // But we generally assume that for empty classes we can return any valid
 1756|       |  // pointer.
 1757|     12|  return &common;
 1758|     12|}
_ZN4absl12lts_2026052618container_internal18PrepareInsertLargeERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEmNS1_18NonIterableBitMaskIjLi16ELi0EEENS1_8FindInfoE:
 2012|     46|                          FindInfo target_group) {
 2013|       |  // NOLINTNEXTLINE(misc-static-assert)
 2014|       |  ABSL_SWISSTABLE_ASSERT(!SwisstableGenerationsEnabled());
  ------------------
  |  |   62|     46|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 2015|     46|  return PrepareInsertLargeImpl(common, policy, hash, mask_empty, target_group);
 2016|     46|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119Resize1To3NewOffsetEmNS1_16PerTableSeedImplIhEE:
  107|      2|size_t Resize1To3NewOffset(size_t hash, PerTableSeed seed) {
  108|       |  // After resize from capacity 1 to 3, we always have exactly the slot with
  109|       |  // index 1 occupied, so we need to insert either at index 0 or index 2.
  110|      2|  static_assert(SooSlotIndex() == 1);
  111|      2|  return SingleGroupTableH1(hash, seed) & 2;
  112|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_118SingleGroupTableH1EmNS1_16PerTableSeedImplIhEE:
  102|      6|size_t SingleGroupTableH1(size_t hash, PerTableSeed seed) {
  103|      6|  return hash ^ seed.seed();
  104|      6|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_111SlotAddressEPvmm:
  116|      2|inline void* SlotAddress(void* slot_array, size_t slot, size_t slot_size) {
  117|      2|  return static_cast<void*>(static_cast<char*>(slot_array) +
  118|      2|                            (slot * slot_size));
  119|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119PrepareInsertCommonERNS1_12CommonFieldsE:
  335|     50|void PrepareInsertCommon(CommonFields& common) {
  336|     50|  common.increment_size();
  337|     50|  common.maybe_increment_generation_on_insert();
  338|     50|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_135InitializeThreeElementsControlBytesEhhmPNS1_6ctrl_tE:
  557|      2|    h2_t orig_h2, h2_t new_h2, size_t new_offset, ctrl_t* new_ctrl) {
  558|      2|  static constexpr size_t kNewCapacity = NextCapacity(SooCapacity());
  559|      2|  static_assert(kNewCapacity == 3);
  560|      2|  static_assert(is_single_group(kNewCapacity));
  561|      2|  static_assert(SooSlotIndex() == 1);
  562|      2|  ABSL_SWISSTABLE_ASSERT(new_offset == 0 || new_offset == 2);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  563|       |
  564|      2|  static constexpr uint64_t kEmptyXorSentinel =
  565|      2|      static_cast<uint8_t>(ctrl_t::kEmpty) ^
  566|      2|      static_cast<uint8_t>(ctrl_t::kSentinel);
  567|      2|  static constexpr uint64_t kEmpty64 = static_cast<uint8_t>(ctrl_t::kEmpty);
  568|      2|  static constexpr size_t kMirroredSooSlotIndex =
  569|      2|      SooSlotIndex() + kNewCapacity + 1;
  570|       |  // The first 8 bytes, where SOO slot original and mirrored positions are
  571|       |  // replaced with 0.
  572|       |  // Result will look like: E0ESE0EE
  573|      2|  static constexpr uint64_t kFirstCtrlBytesWithZeroes =
  574|      2|      k8EmptyBytes ^ (kEmpty64 << (8 * SooSlotIndex())) ^
  575|      2|      (kEmptyXorSentinel << (8 * kNewCapacity)) ^
  576|      2|      (kEmpty64 << (8 * kMirroredSooSlotIndex));
  577|       |
  578|      2|  const uint64_t soo_h2 = static_cast<uint64_t>(orig_h2);
  579|      2|  const uint64_t new_h2_xor_empty =
  580|      2|      static_cast<uint64_t>(new_h2 ^ static_cast<uint8_t>(ctrl_t::kEmpty));
  581|       |  // Fill the original and mirrored bytes for SOO slot.
  582|       |  // Result will look like:
  583|       |  // EHESEHEE
  584|       |  // Where H = soo_h2, E = kEmpty, S = kSentinel.
  585|      2|  uint64_t first_ctrl_bytes =
  586|      2|      ((soo_h2 << (8 * SooSlotIndex())) | kFirstCtrlBytesWithZeroes) |
  587|      2|      (soo_h2 << (8 * kMirroredSooSlotIndex));
  588|       |  // Replace original and mirrored empty bytes for the new position.
  589|       |  // Result for new_offset 0 will look like:
  590|       |  // NHESNHEE
  591|       |  // Where H = soo_h2, N = H2(new_hash), E = kEmpty, S = kSentinel.
  592|       |  // Result for new_offset 2 will look like:
  593|       |  // EHNSEHNE
  594|      2|  first_ctrl_bytes ^= (new_h2_xor_empty << (8 * new_offset));
  595|      2|  size_t new_mirrored_offset = new_offset + kNewCapacity + 1;
  596|      2|  first_ctrl_bytes ^= (new_h2_xor_empty << (8 * new_mirrored_offset));
  597|       |
  598|       |  // Fill last bytes with kEmpty.
  599|      2|  std::memset(new_ctrl + kNewCapacity, static_cast<int8_t>(ctrl_t::kEmpty),
  600|      2|              Group::kWidth);
  601|       |  // Overwrite the first 8 bytes with first_ctrl_bytes.
  602|      2|  absl::little_endian::Store64(new_ctrl, first_ctrl_bytes);
  603|       |
  604|       |  // Example for group size 16:
  605|       |  // new_ctrl after 1st memset =      ???EEEEEEEEEEEEEEEE
  606|       |  // new_offset 0:
  607|       |  // new_ctrl after 2nd store  =      NHESNHEEEEEEEEEEEEE
  608|       |  // new_offset 2:
  609|       |  // new_ctrl after 2nd store  =      EHNSEHNEEEEEEEEEEEE
  610|       |
  611|       |  // Example for group size 8:
  612|       |  // new_ctrl after 1st memset =      ???EEEEEEEE
  613|       |  // new_offset 0:
  614|       |  // new_ctrl after 2nd store  =      NHESNHEEEEE
  615|       |  // new_offset 2:
  616|       |  // new_ctrl after 2nd store  =      EHNSEHNEEEE
  617|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_17SetCtrlERKNS1_12CommonFieldsEmNS1_6ctrl_tEm:
  357|     40|                    size_t slot_size) {
  358|       |  ABSL_SWISSTABLE_ASSERT(!c.is_small());
  ------------------
  |  |   62|     40|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  359|     40|  DoSanitizeOnSetCtrl(c, i, h, slot_size);
  360|     40|  ctrl_t* ctrl = c.control();
  361|     40|  ctrl[i] = h;
  362|     40|  ctrl[((i - NumClonedBytes()) & c.capacity()) +
  363|     40|       (NumClonedBytes() & c.capacity())] = h;
  364|     40|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119DoSanitizeOnSetCtrlERKNS1_12CommonFieldsEmNS1_6ctrl_tEm:
  342|     46|                                size_t slot_size) {
  343|     46|  ABSL_SWISSTABLE_ASSERT(i < c.capacity());
  ------------------
  |  |   62|     46|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  344|     46|  auto* slot_i = static_cast<const char*>(c.slot_array()) + i * slot_size;
  345|     46|  if (IsFull(h)) {
  ------------------
  |  Branch (345:7): [True: 46, False: 0]
  ------------------
  346|     46|    SanitizerUnpoisonMemoryRegion(slot_i, slot_size);
  347|     46|  } else {
  348|      0|    SanitizerPoisonMemoryRegion(slot_i, slot_size);
  349|      0|  }
  350|     46|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119SetCtrlInLargeTableERKNS1_12CommonFieldsEmNS1_6ctrl_tEm:
  390|      2|                                size_t slot_size) {
  391|       |  ABSL_SWISSTABLE_ASSERT(c.capacity() >= Group::kWidth - 1);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  392|      2|  DoSanitizeOnSetCtrl(c, i, h, slot_size);
  393|      2|  ctrl_t* ctrl = c.control();
  394|      2|  ctrl[i] = h;
  395|      2|  ctrl[((i - NumClonedBytes()) & c.capacity()) + NumClonedBytes()] = h;
  396|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_19ResetCtrlERNS1_12CommonFieldsEm:
  532|      2|void ResetCtrl(CommonFields& common, size_t slot_size) {
  533|      2|  const size_t capacity = common.capacity();
  534|      2|  ctrl_t* ctrl = common.control();
  535|      2|  static constexpr size_t kTwoGroupCapacity = 2 * Group::kWidth - 1;
  536|      2|  if (ABSL_PREDICT_TRUE(capacity <= kTwoGroupCapacity)) {
  ------------------
  |  |  191|      2|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 2, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 2]
  |  |  |  Branch (191:57): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  537|      2|    if (IsSmallCapacity(capacity)) return;
  ------------------
  |  Branch (537:9): [True: 0, False: 2]
  ------------------
  538|      2|    std::memset(ctrl, static_cast<int8_t>(ctrl_t::kEmpty), Group::kWidth);
  539|      2|    std::memset(ctrl + capacity, static_cast<int8_t>(ctrl_t::kEmpty),
  540|      2|                Group::kWidth);
  541|      2|    if (capacity == kTwoGroupCapacity) {
  ------------------
  |  Branch (541:9): [True: 2, False: 0]
  ------------------
  542|      2|      std::memset(ctrl + Group::kWidth, static_cast<int8_t>(ctrl_t::kEmpty),
  543|      2|                  Group::kWidth);
  544|      2|    }
  545|      2|  } else {
  546|      0|    std::memset(ctrl, static_cast<int8_t>(ctrl_t::kEmpty),
  547|      0|                capacity + 1 + NumClonedBytes());
  548|      0|  }
  549|      2|  ctrl[capacity] = ctrl_t::kSentinel;
  550|      2|  SanitizerPoisonMemoryRegion(common.slot_array(), slot_size * capacity);
  551|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_115ResetGrowthLeftERNS1_12CommonFieldsE:
  306|      2|void ResetGrowthLeft(CommonFields& common) {
  307|      2|  ResetGrowthLeft(common.growth_info(), common.capacity(), common.size());
  308|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_115ResetGrowthLeftERNS1_10GrowthInfoEmm:
  302|      8|void ResetGrowthLeft(GrowthInfo& growth_info, size_t capacity, size_t size) {
  303|      8|  growth_info.InitGrowthLeftNoDeleted(CapacityToGrowth(capacity) - size);
  304|      8|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_117AllocBackingArrayERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEmbPv:
  776|     10|                                   void* alloc) {
  777|     10|  RawHashSetLayout layout(new_capacity, policy.slot_size, policy.slot_align,
  778|     10|                          has_infoz);
  779|       |  // Perform a direct call in the common case to allow for profile-guided
  780|       |  // heap optimization (PGHO) to understand which allocation function is used.
  781|     10|  constexpr size_t kDefaultAlignment = BackingArrayAlignment(alignof(size_t));
  782|     10|  char* mem = static_cast<char*>(
  783|     10|      ABSL_PREDICT_TRUE(
  ------------------
  |  |  191|     10|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 10, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 10]
  |  |  |  Branch (191:57): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  784|     10|          policy.alloc ==
  785|     10|          (&AllocateBackingArray<kDefaultAlignment, std::allocator<char>>))
  786|     10|          ? AllocateBackingArray<kDefaultAlignment, std::allocator<char>>(
  787|     10|                alloc, layout.alloc_size())
  788|     10|          : policy.alloc(alloc, layout.alloc_size()));
  789|     10|  const GenerationType old_generation = common.generation();
  790|     10|  common.set_generation_ptr(
  791|     10|      reinterpret_cast<GenerationType*>(mem + layout.generation_offset()));
  792|     10|  common.set_generation(NextGeneration(old_generation));
  793|       |
  794|     10|  return {reinterpret_cast<ctrl_t*>(mem + layout.control_offset()),
  795|     10|          mem + layout.slot_offset()};
  796|     10|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_124Grow1To3AndPrepareInsertERNS1_12CommonFieldsERKNS1_15PolicyFunctionsENS0_11FunctionRefIFmmEEE:
 1415|      2|    absl::FunctionRef<size_t(size_t)> get_hash) {
 1416|       |  // TODO(b/413062340): Refactor to reuse more code with
 1417|       |  // GrowSooTableToNextCapacityAndPrepareInsert.
 1418|      2|  ABSL_SWISSTABLE_ASSERT(common.capacity() == 1);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1419|      2|  ABSL_SWISSTABLE_ASSERT(!common.empty());
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1420|      2|  ABSL_SWISSTABLE_ASSERT(!policy.soo_enabled);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1421|      2|  constexpr size_t kOldCapacity = 1;
 1422|      2|  constexpr size_t kNewCapacity = NextCapacity(kOldCapacity);
 1423|      2|  ctrl_t* old_ctrl = common.control();
 1424|      2|  void* old_slots = common.slot_array();
 1425|       |
 1426|      2|  const size_t slot_size = policy.slot_size;
 1427|      2|  const size_t slot_align = policy.slot_align;
 1428|      2|  void* alloc = policy.get_char_alloc(common);
 1429|      2|  HashtablezInfoHandle infoz = common.infoz();
 1430|      2|  const bool has_infoz = infoz.IsSampled();
 1431|      2|  common.set_capacity(kNewCapacity);
 1432|       |
 1433|      2|  const auto [new_ctrl, new_slots] =
 1434|      2|      AllocBackingArray(common, policy, kNewCapacity, has_infoz, alloc);
 1435|      2|  common.set_control(new_ctrl);
 1436|      2|  common.set_slots(new_slots);
 1437|      2|  SanitizerPoisonMemoryRegion(new_slots, kNewCapacity * slot_size);
 1438|       |
 1439|      2|  if (ABSL_PREDICT_TRUE(!has_infoz)) {
  ------------------
  |  |  191|      2|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 2, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 2]
  |  |  |  Branch (191:57): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 1440|       |    // When we're sampled, we already have a seed.
 1441|      2|    common.generate_new_seed(/*has_infoz=*/false);
 1442|      2|  }
 1443|      2|  const size_t new_hash = get_hash(common.seed().seed());
 1444|      2|  h2_t new_h2 = H2(new_hash);
 1445|      2|  size_t orig_hash =
 1446|      2|      policy.hash_slot(policy.hash_fn(common), old_slots, common.seed().seed());
 1447|      2|  size_t offset = Resize1To3NewOffset(new_hash, common.seed());
 1448|      2|  InitializeThreeElementsControlBytes(H2(orig_hash), new_h2, offset, new_ctrl);
 1449|       |
 1450|      2|  void* old_element_target = NextSlot(new_slots, slot_size);
 1451|      2|  SanitizerUnpoisonMemoryRegion(old_element_target, slot_size);
 1452|      2|  policy.transfer_n(&common, old_element_target, old_slots, 1);
 1453|       |
 1454|      2|  void* new_element_target_slot = SlotAddress(new_slots, offset, slot_size);
 1455|      2|  SanitizerUnpoisonMemoryRegion(new_element_target_slot, slot_size);
 1456|       |
 1457|      2|  policy.dealloc(alloc, kOldCapacity, old_ctrl, slot_size, slot_align,
 1458|      2|                 has_infoz);
 1459|      2|  PrepareInsertCommon(common);
 1460|      2|  ABSL_SWISSTABLE_ASSERT(common.size() == 2);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1461|      2|  GetGrowthInfoFromControl(new_ctrl).InitGrowthLeftNoDeleted(kNewCapacity - 2);
 1462|       |
 1463|      2|  if (ABSL_PREDICT_FALSE(has_infoz)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 1464|      0|    ReportSingleGroupTableGrowthToInfoz(common, infoz, new_hash);
 1465|      0|  }
 1466|      2|  return {new_ctrl + offset, new_element_target_slot};
 1467|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_18NextSlotEPvmm:
  123|      6|inline void* NextSlot(void* slot, size_t slot_size, size_t i = 1) {
  124|      6|  return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(slot) +
  125|      6|                                 slot_size * i);
  126|      6|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_125SetCtrlInSingleGroupTableERKNS1_12CommonFieldsEmhm:
  383|      4|                                      size_t slot_size) {
  384|      4|  SetCtrlInSingleGroupTable(c, i, static_cast<ctrl_t>(h), slot_size);
  385|      4|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_125SetCtrlInSingleGroupTableERKNS1_12CommonFieldsEmNS1_6ctrl_tEm:
  373|      4|                                      size_t slot_size) {
  374|      4|  ABSL_SWISSTABLE_ASSERT(!c.is_small());
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  375|       |  ABSL_SWISSTABLE_ASSERT(is_single_group(c.capacity()));
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  376|      4|  DoSanitizeOnSetCtrl(c, i, h, slot_size);
  377|      4|  ctrl_t* ctrl = c.control();
  378|      4|  ctrl[i] = h;
  379|      4|  ctrl[i + c.capacity() + 1] = h;
  380|      4|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_17SetCtrlERKNS1_12CommonFieldsEmhm:
  366|     40|inline void SetCtrl(const CommonFields& c, size_t i, h2_t h, size_t slot_size) {
  367|     40|  SetCtrl(c, i, static_cast<ctrl_t>(h), slot_size);
  368|     40|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_122PrepareInsertLargeImplERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEmNS1_18NonIterableBitMaskIjLi16ELi0EEENS1_8FindInfoE:
 1990|     46|                              FindInfo target_group) {
 1991|     46|  ABSL_SWISSTABLE_ASSERT(!common.is_small());
  ------------------
  |  |   62|     46|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1992|     46|  const GrowthInfo growth_info = common.growth_info();
 1993|       |  // When there are no deleted slots in the table
 1994|       |  // and growth_left is positive, we can insert at the first
 1995|       |  // empty slot in the probe sequence (target).
 1996|     46|  if (ABSL_PREDICT_FALSE(!growth_info.HasNoDeletedAndGrowthLeft())) {
  ------------------
  |  |  190|     46|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 6, False: 40]
  |  |  |  Branch (190:49): [Folded, False: 46]
  |  |  |  Branch (190:58): [True: 6, False: 40]
  |  |  ------------------
  ------------------
 1997|      6|    return PrepareInsertLargeSlow(common, policy, hash);
 1998|      6|  }
 1999|     40|  PrepareInsertCommon(common);
 2000|     40|  common.growth_info().OverwriteEmptyAsFull();
 2001|     40|  target_group.offset += mask_empty.LowestBitSet();
 2002|     40|  target_group.offset &= common.capacity();
 2003|     40|  SetCtrl(common, target_group.offset, H2(hash), policy.slot_size);
 2004|     40|  common.infoz().RecordInsertMiss(hash, target_group.probe_length);
 2005|     40|  return target_group.offset;
 2006|     46|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_122PrepareInsertLargeSlowERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEm:
 1653|      6|                              size_t hash) {
 1654|      6|  const GrowthInfo growth_info = common.growth_info();
 1655|      6|  ABSL_SWISSTABLE_ASSERT(!growth_info.HasNoDeletedAndGrowthLeft());
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1656|      6|  if (ABSL_PREDICT_TRUE(growth_info.HasNoGrowthLeftAndNoDeleted())) {
  ------------------
  |  |  191|      6|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 6, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 6]
  |  |  |  Branch (191:57): [True: 6, False: 0]
  |  |  ------------------
  ------------------
 1657|       |    // Table without deleted slots (>95% cases) that needs to be resized.
 1658|      6|    ABSL_SWISSTABLE_ASSERT(growth_info.HasNoDeleted() &&
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1659|      6|                           growth_info.GetGrowthLeft() == 0);
 1660|      6|    return GrowToNextCapacityAndPrepareInsert(common, policy, hash);
 1661|      6|  }
 1662|      0|  if (ABSL_PREDICT_FALSE(growth_info.HasNoGrowthLeftAssumingMayHaveDeleted())) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1663|       |    // Table with deleted slots that needs to be rehashed or resized.
 1664|      0|    return RehashOrGrowToNextCapacityAndPrepareInsert(common, policy, hash);
 1665|      0|  }
 1666|       |  // Table with deleted slots that has space for the inserting element.
 1667|      0|  FindInfo target = find_first_non_full(common, hash);
 1668|      0|  PrepareInsertCommon(common);
 1669|      0|  common.growth_info().OverwriteControlAsFull(common.control()[target.offset]);
 1670|      0|  SetCtrlInLargeTable(common, target.offset, H2(hash), policy.slot_size);
 1671|      0|  common.infoz().RecordInsertMiss(hash, target.probe_length);
 1672|      0|  return target.offset;
 1673|      0|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_134GrowToNextCapacityAndPrepareInsertERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEm:
 1473|      6|    size_t new_hash) {
 1474|      6|  ABSL_SWISSTABLE_ASSERT(common.growth_left() == 0);
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1475|      6|  const size_t old_capacity = common.capacity();
 1476|      6|  ABSL_SWISSTABLE_ASSERT(old_capacity > policy.soo_capacity());
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1477|      6|  ABSL_SWISSTABLE_ASSERT(!IsSmallCapacity(old_capacity));
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1478|       |
 1479|      6|  const size_t new_capacity = NextCapacity(old_capacity);
 1480|      6|  ctrl_t* old_ctrl = common.control();
 1481|      6|  void* old_slots = common.slot_array();
 1482|       |
 1483|      6|  common.set_capacity(new_capacity);
 1484|      6|  const size_t slot_size = policy.slot_size;
 1485|      6|  const size_t slot_align = policy.slot_align;
 1486|      6|  void* alloc = policy.get_char_alloc(common);
 1487|      6|  HashtablezInfoHandle infoz = common.infoz();
 1488|      6|  const bool has_infoz = infoz.IsSampled();
 1489|       |
 1490|      6|  const auto [new_ctrl, new_slots] =
 1491|      6|      AllocBackingArray(common, policy, new_capacity, has_infoz, alloc);
 1492|      6|  common.set_control(new_ctrl);
 1493|      6|  common.set_slots(new_slots);
 1494|      6|  SanitizerPoisonMemoryRegion(new_slots, new_capacity * slot_size);
 1495|       |
 1496|      6|  h2_t new_h2 = H2(new_hash);
 1497|      6|  size_t total_probe_length = 0;
 1498|      6|  FindInfo find_info;
 1499|      6|  if (ABSL_PREDICT_TRUE(is_single_group(new_capacity))) {
  ------------------
  |  |  191|      6|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 4, False: 2]
  |  |  |  Branch (191:48): [Folded, False: 6]
  |  |  |  Branch (191:57): [True: 4, False: 2]
  |  |  ------------------
  ------------------
 1500|      4|    size_t offset;
 1501|      4|    GrowIntoSingleGroupShuffleControlBytes(old_ctrl, old_capacity, new_ctrl,
 1502|      4|                                           new_capacity);
 1503|       |    // We put the new element either at the beginning or at the end of the
 1504|       |    // table with approximately equal probability.
 1505|      4|    offset =
 1506|      4|        SingleGroupTableH1(new_hash, common.seed()) & 1 ? 0 : new_capacity - 1;
  ------------------
  |  Branch (1506:9): [True: 4, False: 0]
  ------------------
 1507|       |
 1508|      4|    ABSL_SWISSTABLE_ASSERT(IsEmpty(new_ctrl[offset]));
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1509|      4|    SetCtrlInSingleGroupTable(common, offset, new_h2, policy.slot_size);
 1510|      4|    find_info = FindInfo{offset, 0};
 1511|       |    // Single group tables have all slots full on resize. So we can transfer
 1512|       |    // all slots without checking the control bytes.
 1513|      4|    ABSL_SWISSTABLE_ASSERT(common.size() == old_capacity);
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1514|      4|    void* target = NextSlot(new_slots, slot_size);
 1515|      4|    SanitizerUnpoisonMemoryRegion(target, old_capacity * slot_size);
 1516|      4|    policy.transfer_n(&common, target, old_slots, old_capacity);
 1517|      4|  } else {
 1518|      2|    total_probe_length =
 1519|      2|        GrowToNextCapacityDispatch(common, policy, old_ctrl, old_slots);
 1520|      2|    find_info = find_first_non_full(common, new_hash);
 1521|      2|    SetCtrlInLargeTable(common, find_info.offset, new_h2, policy.slot_size);
 1522|      2|  }
 1523|      6|  ABSL_SWISSTABLE_ASSERT(old_capacity > policy.soo_capacity());
  ------------------
  |  |   62|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1524|      6|  (*policy.dealloc)(alloc, old_capacity, old_ctrl, slot_size, slot_align,
 1525|      6|                    has_infoz);
 1526|      6|  PrepareInsertCommon(common);
 1527|      6|  ResetGrowthLeft(GetGrowthInfoFromControl(new_ctrl), new_capacity,
 1528|      6|                  common.size());
 1529|       |
 1530|      6|  if (ABSL_PREDICT_FALSE(has_infoz)) {
  ------------------
  |  |  190|      6|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 6]
  |  |  |  Branch (190:49): [Folded, False: 6]
  |  |  |  Branch (190:58): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 1531|      0|    ReportGrowthToInfoz(common, infoz, new_hash, total_probe_length,
 1532|      0|                        find_info.probe_length);
 1533|      0|  }
 1534|      6|  return find_info.offset;
 1535|      6|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_138GrowIntoSingleGroupShuffleControlBytesEPNS1_6ctrl_tEmS4_m:
  957|      4|                                            size_t new_capacity) {
  958|      4|  ABSL_SWISSTABLE_ASSERT(is_single_group(new_capacity));
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  959|      4|  constexpr size_t kHalfWidth = Group::kWidth / 2;
  960|      4|  ABSL_ASSUME(old_capacity < kHalfWidth);
  ------------------
  |  |  271|      4|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  961|      4|  ABSL_ASSUME(old_capacity > 0);
  ------------------
  |  |  271|      4|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  962|      4|  static_assert(Group::kWidth == 8 || Group::kWidth == 16,
  963|      4|                "Group size is not supported.");
  964|       |
  965|       |  // NOTE: operations are done with compile time known size = 8.
  966|       |  // Compiler optimizes that into single ASM operation.
  967|       |
  968|       |  // Load the bytes from old_capacity. This contains
  969|       |  // - the sentinel byte
  970|       |  // - all the old control bytes
  971|       |  // - the rest is filled with kEmpty bytes
  972|       |  // Example:
  973|       |  // old_ctrl =     012S012EEEEEEEEE...
  974|       |  // copied_bytes = S012EEEE
  975|      4|  uint64_t copied_bytes = absl::little_endian::Load64(old_ctrl + old_capacity);
  976|       |
  977|       |  // We change the sentinel byte to kEmpty before storing to both the start of
  978|       |  // the new_ctrl, and past the end of the new_ctrl later for the new cloned
  979|       |  // bytes. Note that this is faster than setting the sentinel byte to kEmpty
  980|       |  // after the copy directly in new_ctrl because we are limited on store
  981|       |  // bandwidth.
  982|      4|  static constexpr uint64_t kEmptyXorSentinel =
  983|      4|      static_cast<uint8_t>(ctrl_t::kEmpty) ^
  984|      4|      static_cast<uint8_t>(ctrl_t::kSentinel);
  985|       |
  986|       |  // Replace the first byte kSentinel with kEmpty.
  987|       |  // Resulting bytes will be shifted by one byte old control blocks.
  988|       |  // Example:
  989|       |  // old_ctrl = 012S012EEEEEEEEE...
  990|       |  // before =   S012EEEE
  991|       |  // after  =   E012EEEE
  992|      4|  copied_bytes ^= kEmptyXorSentinel;
  993|       |
  994|      4|  if (Group::kWidth == 8) {
  ------------------
  |  Branch (994:7): [Folded, False: 4]
  ------------------
  995|       |    // With group size 8, we can grow with two write operations.
  996|      0|    ABSL_SWISSTABLE_ASSERT(old_capacity < 8 &&
  ------------------
  |  |   62|      0|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  997|      0|                           "old_capacity is too large for group size 8");
  998|      0|    absl::little_endian::Store64(new_ctrl, copied_bytes);
  999|       |
 1000|      0|    static constexpr uint64_t kSentinal64 =
 1001|      0|        static_cast<uint8_t>(ctrl_t::kSentinel);
 1002|       |
 1003|       |    // Prepend kSentinel byte to the beginning of copied_bytes.
 1004|       |    // We have maximum 3 non-empty bytes at the beginning of copied_bytes for
 1005|       |    // group size 8.
 1006|       |    // Example:
 1007|       |    // old_ctrl = 012S012EEEE
 1008|       |    // before =   E012EEEE
 1009|       |    // after  =   SE012EEE
 1010|      0|    copied_bytes = (copied_bytes << 8) ^ kSentinal64;
 1011|      0|    absl::little_endian::Store64(new_ctrl + new_capacity, copied_bytes);
 1012|       |    // Example for capacity 3:
 1013|       |    // old_ctrl = 012S012EEEE
 1014|       |    // After the first store:
 1015|       |    //           >!
 1016|       |    // new_ctrl = E012EEEE???????
 1017|       |    // After the second store:
 1018|       |    //                  >!
 1019|       |    // new_ctrl = E012EEESE012EEE
 1020|      0|    return;
 1021|      0|  }
 1022|       |
 1023|      4|  ABSL_SWISSTABLE_ASSERT(Group::kWidth == 16);  // NOLINT(misc-static-assert)
  ------------------
  |  |   62|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1024|       |
 1025|       |  // Fill the second half of the main control bytes with kEmpty.
 1026|       |  // For small capacity that may write into mirrored control bytes.
 1027|       |  // It is fine as we will overwrite all the bytes later.
 1028|      4|  std::memset(new_ctrl + kHalfWidth, static_cast<int8_t>(ctrl_t::kEmpty),
 1029|      4|              kHalfWidth);
 1030|       |  // Fill the second half of the mirrored control bytes with kEmpty.
 1031|      4|  std::memset(new_ctrl + new_capacity + kHalfWidth,
 1032|      4|              static_cast<int8_t>(ctrl_t::kEmpty), kHalfWidth);
 1033|       |  // Copy the first half of the non-mirrored control bytes.
 1034|      4|  absl::little_endian::Store64(new_ctrl, copied_bytes);
 1035|      4|  new_ctrl[new_capacity] = ctrl_t::kSentinel;
 1036|       |  // Copy the first half of the mirrored control bytes.
 1037|      4|  absl::little_endian::Store64(new_ctrl + new_capacity + 1, copied_bytes);
 1038|       |
 1039|       |  // Example for growth capacity 1->3:
 1040|       |  // old_ctrl =                  0S0EEEEEEEEEEEEEE
 1041|       |  // new_ctrl at the end =       E0ESE0EEEEEEEEEEEEE
 1042|       |  //                                    >!
 1043|       |  // new_ctrl after 1st memset = ????????EEEEEEEE???
 1044|       |  //                                       >!
 1045|       |  // new_ctrl after 2nd memset = ????????EEEEEEEEEEE
 1046|       |  //                            >!
 1047|       |  // new_ctrl after 1st store =  E0EEEEEEEEEEEEEEEEE
 1048|       |  // new_ctrl after kSentinel =  E0ESEEEEEEEEEEEEEEE
 1049|       |  //                                >!
 1050|       |  // new_ctrl after 2nd store =  E0ESE0EEEEEEEEEEEEE
 1051|       |
 1052|       |  // Example for growth capacity 3->7:
 1053|       |  // old_ctrl =                  012S012EEEEEEEEEEEE
 1054|       |  // new_ctrl at the end =       E012EEESE012EEEEEEEEEEE
 1055|       |  //                                    >!
 1056|       |  // new_ctrl after 1st memset = ????????EEEEEEEE???????
 1057|       |  //                                           >!
 1058|       |  // new_ctrl after 2nd memset = ????????EEEEEEEEEEEEEEE
 1059|       |  //                            >!
 1060|       |  // new_ctrl after 1st store =  E012EEEEEEEEEEEEEEEEEEE
 1061|       |  // new_ctrl after kSentinel =  E012EEESEEEEEEEEEEEEEEE
 1062|       |  //                                >!
 1063|       |  // new_ctrl after 2nd store =  E012EEESE012EEEEEEEEEEE
 1064|       |
 1065|       |  // Example for growth capacity 7->15:
 1066|       |  // old_ctrl =                  0123456S0123456EEEEEEEE
 1067|       |  // new_ctrl at the end =       E0123456EEEEEEESE0123456EEEEEEE
 1068|       |  //                                    >!
 1069|       |  // new_ctrl after 1st memset = ????????EEEEEEEE???????????????
 1070|       |  //                                                   >!
 1071|       |  // new_ctrl after 2nd memset = ????????EEEEEEEE???????EEEEEEEE
 1072|       |  //                            >!
 1073|       |  // new_ctrl after 1st store =  E0123456EEEEEEEE???????EEEEEEEE
 1074|       |  // new_ctrl after kSentinel =  E0123456EEEEEEES???????EEEEEEEE
 1075|       |  //                                            >!
 1076|       |  // new_ctrl after 2nd store =  E0123456EEEEEEESE0123456EEEEEEE
 1077|      4|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_126GrowToNextCapacityDispatchERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEPNS1_6ctrl_tEPv:
 1385|      2|                                  ctrl_t* old_ctrl, void* old_slots) {
 1386|      2|  const size_t new_capacity = common.capacity();
 1387|      2|  if (ABSL_PREDICT_TRUE(new_capacity <= kMaxLocalBufferNewCapacity)) {
  ------------------
  |  |  191|      2|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 2, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 2]
  |  |  |  Branch (191:57): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 1388|      2|    return GrowToNextCapacityThatFitsInLocalBuffer(common, policy, old_ctrl,
 1389|      2|                                                   old_slots);
 1390|      2|  } else {
 1391|      0|    return GrowToNextCapacityOverflowLocalBuffer(common, policy, old_ctrl,
 1392|      0|                                                 old_slots);
 1393|      0|  }
 1394|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_139GrowToNextCapacityThatFitsInLocalBufferERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEPNS1_6ctrl_tEPv:
 1335|      2|    ctrl_t* old_ctrl, void* old_slots) {
 1336|       |  ABSL_SWISSTABLE_ASSERT(common.capacity() <= kMaxLocalBufferNewCapacity);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1337|      2|  return GrowToNextCapacity<
 1338|      2|      ProbedItemEncoder<ProbedItem4Bytes, /*kGuaranteedFitToBuffer=*/true>>(
 1339|      2|      common, policy, old_ctrl, old_slots);
 1340|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_118GrowToNextCapacityINS2_17ProbedItemEncoderINS1_14ProbedItemImplIjLm32EEELb1EEEEEmRNS1_12CommonFieldsERKNS1_15PolicyFunctionsEPNS1_6ctrl_tEPv:
 1316|      2|                          ctrl_t* old_ctrl, void* old_slots) {
 1317|      2|  using ProbedItem = typename Encoder::ProbedItem;
 1318|       |  ABSL_SWISSTABLE_ASSERT(common.capacity() <= ProbedItem::kMaxNewCapacity);
  ------------------
  |  |   62|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1319|      2|  Encoder encoder(old_ctrl);
 1320|      2|  policy.transfer_unprobed_elements_to_next_capacity(
 1321|      2|      common, old_ctrl, old_slots, &encoder,
 1322|      2|      [](void* probed_storage, h2_t h2, size_t source_offset, size_t h1) {
 1323|      2|        auto encoder_ptr = static_cast<Encoder*>(probed_storage);
 1324|      2|        encoder_ptr->EncodeItem(ProbedItem(h2, source_offset, h1));
 1325|      2|      });
 1326|      2|  InitializeMirroredControlBytes(common.control(), common.capacity());
 1327|      2|  return encoder.DecodeAndInsertToTable(common, policy, old_slots);
 1328|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_117ProbedItemEncoderINS1_14ProbedItemImplIjLm32EEELb1EEC2EPNS1_6ctrl_tE:
 1190|      2|  explicit ProbedItemEncoder(ctrl_t* control) : control_(control) {}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_130InitializeMirroredControlBytesEPNS1_6ctrl_tEm:
 1166|      2|void InitializeMirroredControlBytes(ctrl_t* new_ctrl, size_t new_capacity) {
 1167|      2|  std::memcpy(new_ctrl + new_capacity,
 1168|       |              // We own GrowthInfo just before control bytes. So it is ok
 1169|       |              // to read one byte from it.
 1170|      2|              new_ctrl - 1, Group::kWidth);
 1171|      2|  new_ctrl[new_capacity] = ctrl_t::kSentinel;
 1172|      2|}
raw_hash_set.cc:_ZNK4absl12lts_2026052618container_internal12_GLOBAL__N_117ProbedItemEncoderINS1_14ProbedItemImplIjLm32EEELb1EE22DecodeAndInsertToTableERNS1_12CommonFieldsERKNS1_15PolicyFunctionsEPv:
 1207|      2|                                void* old_slots) const {
 1208|      2|    if (pos_ == buffer_) {
  ------------------
  |  Branch (1208:9): [True: 2, False: 0]
  ------------------
 1209|      2|      return 0;
 1210|      2|    }
 1211|      0|    if constexpr (kGuaranteedFitToBuffer) {
 1212|      0|      return DecodeAndInsertImpl(common, policy, buffer_, pos_, old_slots);
 1213|      0|    }
 1214|      0|    size_t total_probe_length = DecodeAndInsertImpl(
 1215|      0|        common, policy, buffer_,
 1216|      0|        local_buffer_full_ ? buffer_ + kBufferSize : pos_, old_slots);
  ------------------
  |  Branch (1216:9): [True: 0, False: 0]
  ------------------
 1217|      0|    if (!local_buffer_full_) {
  ------------------
  |  Branch (1217:9): [True: 0, False: 0]
  ------------------
 1218|      0|      return total_probe_length;
 1219|      0|    }
 1220|      0|    total_probe_length +=
 1221|      0|        DecodeAndInsertToTableOverflow(common, policy, old_slots);
 1222|      0|    return total_probe_length;
 1223|      0|  }
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_127find_first_non_full_from_h1EPKNS1_6ctrl_tEmNS1_21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEE:
  188|      2|                                     HashtableCapacity capacity) {
  189|      2|  auto seq = probe_h1(capacity, h1);
  190|      2|  if (IsEmptyOrDeleted(ctrl[seq.offset()])) {
  ------------------
  |  Branch (190:7): [True: 0, False: 2]
  ------------------
  191|      0|    return {seq.offset(), /*probe_length=*/0};
  192|      0|  }
  193|      2|  auto mask = probe_till_first_non_full_group(ctrl, seq, capacity.capacity());
  194|      2|  return {seq.offset(mask.LowestBitSet()), seq.index()};
  195|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_131probe_till_first_non_full_groupEPKNS1_6ctrl_tERNS1_9probe_seqILm16EEEm:
  175|      2|    [[maybe_unused]] size_t capacity) {
  176|      2|  while (true) {
  ------------------
  |  Branch (176:10): [True: 2, Folded]
  ------------------
  177|      2|    GroupFullEmptyOrDeleted g{ctrl + seq.offset()};
  178|      2|    auto mask = g.MaskEmptyOrDeleted();
  179|      2|    if (mask) {
  ------------------
  |  Branch (179:9): [True: 2, False: 0]
  ------------------
  180|      2|      return mask;
  181|      2|    }
  182|      0|    seq.next();
  183|       |    ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity && "full table!");
  ------------------
  |  |   62|      0|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  184|      0|  }
  185|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119find_first_non_fullERKNS1_12CommonFieldsEm:
  204|      2|FindInfo find_first_non_full(const CommonFields& common, size_t hash) {
  205|      2|  return find_first_non_full_from_h1(common.control(), H1(hash),
  206|      2|                                     common.capacity_impl());
  207|      2|}
raw_hash_set.cc:_ZN4absl12lts_2026052618container_internal12_GLOBAL__N_119SetCtrlInLargeTableERKNS1_12CommonFieldsEmhm:
  399|      2|                                size_t slot_size) {
  400|      2|  SetCtrlInLargeTable(c, i, static_cast<ctrl_t>(h), slot_size);
  401|      2|}

_ZN4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled36maybe_increment_generation_on_insertEv:
  838|     50|  void maybe_increment_generation_on_insert() {}
_ZN4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled19set_reserved_growthEm:
  842|      2|  void set_reserved_growth(size_t) {}
_ZN4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled20set_reservation_sizeEm:
  844|      2|  void set_reservation_size(size_t) {}
_ZNK4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled10generationEv:
  845|     10|  GenerationType generation() const { return 0; }
_ZN4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled14set_generationEh:
  846|     10|  void set_generation(GenerationType) {}
_ZNK4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled14generation_ptrEv:
  847|     54|  GenerationType* generation_ptr() const { return nullptr; }
_ZN4absl12lts_2026052618container_internal34CommonFieldsGenerationInfoDisabled18set_generation_ptrEPh:
  848|     10|  void set_generation_ptr(GenerationType*) {}
_ZN4absl12lts_2026052618container_internal37HashSetIteratorGenerationInfoDisabledC2EPKh:
  871|     54|  explicit HashSetIteratorGenerationInfoDisabled(const GenerationType*) {}
_ZNK4absl12lts_2026052618container_internal37HashSetIteratorGenerationInfoDisabled10generationEv:
  873|    204|  GenerationType generation() const { return 0; }
_ZNK4absl12lts_2026052618container_internal37HashSetIteratorGenerationInfoDisabled14generation_ptrEv:
  875|    308|  const GenerationType* generation_ptr() const { return nullptr; }
_ZN4absl12lts_2026052618container_internal10GrowthInfo23InitGrowthLeftNoDeletedEm:
  914|     10|  void InitGrowthLeftNoDeleted(size_t growth_left) {
  915|     10|    growth_left_info_ = growth_left;
  916|     10|  }
_ZN4absl12lts_2026052618container_internal10GrowthInfo20OverwriteEmptyAsFullEv:
  922|     40|  void OverwriteEmptyAsFull() {
  923|       |    ABSL_SWISSTABLE_ASSERT(GetGrowthLeft() > 0);
  ------------------
  |  |  256|     40|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  924|     40|    --growth_left_info_;
  925|     40|  }
_ZNK4absl12lts_2026052618container_internal10GrowthInfo25HasNoDeletedAndGrowthLeftEv:
  946|     46|  bool HasNoDeletedAndGrowthLeft() const {
  947|     46|    return static_cast<std::make_signed_t<size_t>>(growth_left_info_) > 0;
  948|     46|  }
_ZNK4absl12lts_2026052618container_internal10GrowthInfo27HasNoGrowthLeftAndNoDeletedEv:
  953|      6|  bool HasNoGrowthLeftAndNoDeleted() const { return growth_left_info_ == 0; }
_ZN4absl12lts_2026052618container_internal16RawHashSetLayoutC2Emmmb:
 1020|     18|            ControlOffset(has_infoz, HasGrowthInfoForCapacity(capacity))),
 1021|     18|        generation_offset_(control_offset_ + NumControlBytes(capacity)),
 1022|       |        slot_offset_(
 1023|     18|            AlignUpTo(generation_offset_ + NumGenerationBytes(), slot_align)),
 1024|     18|        alloc_size_(slot_offset_ + capacity * slot_size) {
 1025|     18|    ABSL_SWISSTABLE_ASSERT(IsValidCapacity(capacity));
  ------------------
  |  |  256|     18|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1026|       |    ABSL_SWISSTABLE_ASSERT(
  ------------------
  |  |  256|     18|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1027|     18|        slot_size <=
 1028|     18|        ((std::numeric_limits<size_t>::max)() - slot_offset_) / capacity);
 1029|     18|  }
_ZNK4absl12lts_2026052618container_internal16RawHashSetLayout14control_offsetEv:
 1033|     18|  size_t control_offset() const { return control_offset_; }
_ZNK4absl12lts_2026052618container_internal16RawHashSetLayout17generation_offsetEv:
 1037|     10|  size_t generation_offset() const { return generation_offset_; }
_ZNK4absl12lts_2026052618container_internal16RawHashSetLayout11slot_offsetEv:
 1041|     10|  size_t slot_offset() const { return slot_offset_; }
_ZNK4absl12lts_2026052618container_internal16RawHashSetLayout10alloc_sizeEv:
 1045|     26|  size_t alloc_size() const { return alloc_size_; }
_ZN4absl12lts_2026052618container_internal9HeapOrSoo7controlEv:
 1088|     10|  MaybeInitializedPtr<ctrl_t>& control() {
 1089|     10|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(heap.control);
  ------------------
  |  |  488|     10|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
 1090|     10|  }
_ZNK4absl12lts_2026052618container_internal9HeapOrSoo7controlEv:
 1091|    296|  MaybeInitializedPtr<ctrl_t> control() const {
 1092|    296|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(heap.control);
  ------------------
  |  |  488|    296|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
 1093|    296|  }
_ZN4absl12lts_2026052618container_internal9HeapOrSoo10slot_arrayEv:
 1094|     10|  MaybeInitializedPtr<void>& slot_array() {
 1095|     10|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(heap.slot_array);
  ------------------
  |  |  488|     10|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
 1096|     10|  }
_ZNK4absl12lts_2026052618container_internal9HeapOrSoo10slot_arrayEv:
 1097|    156|  MaybeInitializedPtr<void> slot_array() const {
 1098|    156|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(heap.slot_array);
  ------------------
  |  |  488|    156|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
 1099|    156|  }
_ZN4absl12lts_2026052618container_internal12CommonFieldsC2ENS1_13non_soo_tag_tE:
 1131|      2|      : inline_data_(HashtableCapacity(0), no_seed_empty_tag_t{}) {}
_ZNK4absl12lts_2026052618container_internal12CommonFields7controlEv:
 1158|    296|  ctrl_t* control() const {
 1159|    296|    ABSL_SWISSTABLE_ASSERT(capacity() > 0);
  ------------------
  |  |  256|    296|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1160|       |    // Assume that the control bytes don't alias `this`.
 1161|    296|    ctrl_t* ctrl = heap_or_soo_.control().get();
 1162|    296|    [[maybe_unused]] size_t num_control_bytes = NumControlBytes(capacity());
 1163|    296|    ABSL_ASSUME(reinterpret_cast<uintptr_t>(ctrl + num_control_bytes) <=
  ------------------
  |  |  271|    592|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  |  |  ------------------
  |  |  |  Branch (271:44): [True: 0, False: 296]
  |  |  |  Branch (271:44): [True: 296, False: 0]
  |  |  ------------------
  ------------------
 1164|    296|                    reinterpret_cast<uintptr_t>(this) ||
 1165|    296|                reinterpret_cast<uintptr_t>(this + 1) <=
 1166|    296|                    reinterpret_cast<uintptr_t>(ctrl));
 1167|    296|    ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(ctrl);
  ------------------
  |  |  488|    296|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
 1168|    296|  }
_ZN4absl12lts_2026052618container_internal12CommonFields11set_controlEPNS1_6ctrl_tE:
 1170|     10|  void set_control(ctrl_t* c) { heap_or_soo_.control().set(c); }
_ZNK4absl12lts_2026052618container_internal12CommonFields10slot_arrayEv:
 1173|    154|  void* slot_array() const { return heap_or_soo_.slot_array().get(); }
_ZNK4absl12lts_2026052618container_internal12CommonFields11slots_unionEv:
 1174|      2|  MaybeInitializedPtr<void> slots_union() const {
 1175|      2|    return heap_or_soo_.slot_array();
 1176|      2|  }
_ZN4absl12lts_2026052618container_internal12CommonFields9set_slotsEPv:
 1177|     10|  void set_slots(void* s) { heap_or_soo_.slot_array().set(s); }
_ZNK4absl12lts_2026052618container_internal12CommonFields4sizeEv:
 1180|     16|  size_t size() const { return inline_data_.size(); }
_ZN4absl12lts_2026052618container_internal12CommonFields16set_size_to_zeroEv:
 1182|      2|  void set_size_to_zero() { inline_data_.set_size(0); }
_ZN4absl12lts_2026052618container_internal12CommonFields14increment_sizeEv:
 1191|     50|  void increment_size() {
 1192|       |    ABSL_SWISSTABLE_ASSERT(size() < capacity());
  ------------------
  |  |  256|     50|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1193|     50|    inline_data_.increment_size();
 1194|     50|  }
_ZNK4absl12lts_2026052618container_internal12CommonFields5emptyEv:
 1203|      2|  bool empty() const { return inline_data_.empty(); }
_ZNK4absl12lts_2026052618container_internal12CommonFields4seedEv:
 1212|     84|  PerTableSeed seed() const { return inline_data_.seed(); }
_ZN4absl12lts_2026052618container_internal12CommonFields17generate_new_seedEb:
 1216|      2|  void generate_new_seed(bool has_infoz) {
 1217|       |    // Note: we can't use has_infoz() here because we set has_infoz later than
 1218|       |    // we generate the seed.
 1219|      2|    if (ABSL_PREDICT_FALSE(has_infoz)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 1220|      0|      inline_data_.set_sampled_seed();
 1221|      0|      return;
 1222|      0|    }
 1223|      2|    inline_data_.generate_new_seed();
 1224|      2|  }
_ZNK4absl12lts_2026052618container_internal12CommonFields13capacity_implEv:
 1227|    494|  HashtableCapacity capacity_impl() const {
 1228|    494|    HashtableCapacity cap = inline_data_.capacity();
 1229|       |    ABSL_SWISSTABLE_ASSERT(cap.IsValid());
  ------------------
  |  |  256|    494|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1230|    494|    return cap;
 1231|    494|  }
_ZNK4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EE8capacityEv:
  520|    500|  constexpr size_t capacity() const {
  521|    500|    ABSL_SWISSTABLE_ASSERT(IsValid());
  ------------------
  |  |  256|    500|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  522|    500|    return StorageMode == kCapacityByValue ? capacity_data_
  ------------------
  |  Branch (522:12): [Folded, False: 500]
  ------------------
  523|    500|                                           : (size_t{1} << capacity_data_) - 1;
  524|    500|  }
_ZNK4absl12lts_2026052618container_internal12CommonFields8capacityEv:
 1232|    446|  size_t capacity() const { return capacity_impl().capacity(); }
_ZN4absl12lts_2026052618container_internal12CommonFields12set_capacityENS1_21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEE:
 1238|     10|  void set_capacity(HashtableCapacity c) { inline_data_.set_capacity(c); }
_ZN4absl12lts_2026052618container_internal12CommonFields12set_capacityEm:
 1239|     10|  void set_capacity(size_t c) {
 1240|     10|    set_capacity(HashtableCapacity(c));
 1241|     10|  }
_ZNK4absl12lts_2026052618container_internal12CommonFields8is_smallEv:
 1242|     54|  bool is_small() const { return inline_data_.is_small(); }
_ZN4absl12lts_2026052618container_internal12CommonFields11growth_infoEv:
 1250|     94|  GrowthInfo& growth_info() {
 1251|       |    ABSL_SWISSTABLE_ASSERT(HasGrowthInfoForCapacity(capacity()));
  ------------------
  |  |  256|     94|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1252|     94|    return GetGrowthInfoFromControl(control());
 1253|     94|  }
_ZNK4absl12lts_2026052618container_internal12CommonFields9has_infozEv:
 1258|     50|  bool has_infoz() const { return inline_data_.has_infoz(); }
_ZN4absl12lts_2026052618container_internal12CommonFields5infozEv:
 1274|     50|  HashtablezInfoHandle infoz() {
 1275|     50|    return has_infoz() ? *infoz_ptr() : HashtablezInfoHandle();
  ------------------
  |  Branch (1275:12): [True: 0, False: 50]
  ------------------
 1276|     50|  }
_ZNK4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EE4maskEm:
  536|     52|  constexpr size_t mask(size_t value) const {
  537|       |#ifdef __BMI2__
  538|       |    if constexpr (StorageMode == kCapacityByLog) {
  539|       |      if constexpr (sizeof(size_t) == 8) {
  540|       |        return _bzhi_u64(value, capacity_data_);
  541|       |      } else {
  542|       |        return _bzhi_u32(value, capacity_data_);
  543|       |      }
  544|       |    }
  545|       |#endif  // __BMI2__
  546|     52|    return value & capacity();
  547|     52|  }
_ZN4absl12lts_2026052618container_internal23SentinelEmptyGenerationEv:
  264|     10|constexpr GenerationType SentinelEmptyGeneration() { return 0; }
_ZN4absl12lts_2026052618container_internal14NextGenerationEh:
  266|     10|constexpr GenerationType NextGeneration(GenerationType generation) {
  267|     10|  return ++generation == SentinelEmptyGeneration() ? ++generation : generation;
  ------------------
  |  Branch (267:10): [True: 0, False: 10]
  ------------------
  268|     10|}
_ZN4absl12lts_2026052618container_internal18NumGenerationBytesEv:
  275|     18|constexpr size_t NumGenerationBytes() { return 0; }
_ZN4absl12lts_2026052618container_internal10SooControlEv:
  340|      2|inline ctrl_t* SooControl() {
  341|       |  // Const must be cast away here; no uses of this function will actually write
  342|       |  // to it because it is only used for SOO iterators.
  343|      2|  return const_cast<ctrl_t*>(kSooControl);
  344|      2|}
_ZN4absl12lts_2026052618container_internal16MaxSmallCapacityEv:
  366|    334|constexpr size_t MaxSmallCapacity() { return 1; }
_ZN4absl12lts_2026052618container_internal15IsValidCapacityEm:
  381|      2|constexpr bool IsValidCapacity(size_t n) { return ((n + 1) & n) == 0 && n > 0; }
  ------------------
  |  Branch (381:51): [True: 2, False: 0]
  |  Branch (381:73): [True: 2, False: 0]
  ------------------
_ZN4absl12lts_2026052618container_internal15IsSmallCapacityEm:
  384|    334|constexpr bool IsSmallCapacity(size_t capacity) {
  385|    334|  return capacity <= MaxSmallCapacity();
  386|    334|}
_ZN4absl12lts_2026052618container_internal12NextCapacityEm:
  394|      6|constexpr size_t NextCapacity(size_t n) {
  395|       |  ABSL_SWISSTABLE_ASSERT(IsValidCapacity(n) || n == 0);
  ------------------
  |  |  256|      6|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  396|      6|  return n * 2 + 1;
  397|      6|}
_ZN4absl12lts_2026052618container_internal16PreviousCapacityEm:
  400|      2|constexpr size_t PreviousCapacity(size_t n) {
  401|       |  ABSL_SWISSTABLE_ASSERT(IsValidCapacity(n));
  ------------------
  |  |  256|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  402|      2|  return n / 2;
  403|      2|}
_ZN4absl12lts_2026052618container_internal16CapacityToGrowthEm:
  415|      8|constexpr size_t CapacityToGrowth(size_t capacity) {
  416|      8|  ABSL_SWISSTABLE_ASSERT(IsValidCapacity(capacity));
  ------------------
  |  |  256|      8|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  417|       |  // `capacity*7/8`
  418|      8|  if (Group::kWidth == 8 && capacity == 7) {
  ------------------
  |  Branch (418:7): [Folded, False: 8]
  |  Branch (418:29): [True: 0, False: 0]
  ------------------
  419|       |    // x-x/8 does not work when x==7.
  420|      0|    return 6;
  421|      0|  }
  422|      8|  return capacity - capacity / 8;
  423|      8|}
_ZN4absl12lts_2026052618container_internal2H1Em:
  740|     76|inline size_t H1(size_t hash) { return hash; }
_ZN4absl12lts_2026052618container_internal2H2Em:
  745|    124|inline h2_t H2(size_t hash) { return hash >> (sizeof(size_t) * 8 - 7); }
_ZN4absl12lts_2026052618container_internal14NumClonedBytesEv:
  985|    392|constexpr size_t NumClonedBytes() { return Group::kWidth - 1; }
_ZN4absl12lts_2026052618container_internal15NumControlBytesEm:
  988|    314|constexpr size_t NumControlBytes(size_t capacity) {
  989|    314|  return IsSmallCapacity(capacity) ? 0 : capacity + 1 + NumClonedBytes();
  ------------------
  |  Branch (989:10): [True: 6, False: 308]
  ------------------
  990|    314|}
_ZN4absl12lts_2026052618container_internal24HasGrowthInfoForCapacityEm:
  993|     18|constexpr bool HasGrowthInfoForCapacity(size_t capacity) {
  994|     18|  return !IsSmallCapacity(capacity);
  995|     18|}
_ZN4absl12lts_2026052618container_internal13ControlOffsetEbb:
  999|     18|constexpr size_t ControlOffset(bool has_infoz, bool has_growth_info) {
 1000|     18|  if (ABSL_PREDICT_FALSE(has_infoz)) {
  ------------------
  |  |  190|     18|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 18]
  |  |  |  Branch (190:49): [Folded, False: 18]
  |  |  |  Branch (190:58): [True: 0, False: 18]
  |  |  ------------------
  ------------------
 1001|       |    // We always allocate GrowthInfo for sampled tables to allow branchless
 1002|       |    // access to infoz pointer.
 1003|      0|    return sizeof(HashtablezInfoHandle) + sizeof(GrowthInfo);
 1004|      0|  }
 1005|     18|  return has_growth_info ? sizeof(GrowthInfo) : 0;
  ------------------
  |  Branch (1005:10): [True: 14, False: 4]
  ------------------
 1006|     18|}
_ZN4absl12lts_2026052618container_internal9AlignUpToEmm:
 1010|     18|constexpr size_t AlignUpTo(size_t offset, size_t align) {
 1011|     18|  return (offset + align - 1) & (~align + 1);
 1012|     18|}
_ZN4absl12lts_2026052618container_internal24GetGrowthInfoFromControlEPNS1_6ctrl_tE:
 1113|    102|inline GrowthInfo& GetGrowthInfoFromControl(ctrl_t* control) {
 1114|    102|  auto* gl_ptr = reinterpret_cast<GrowthInfo*>(control) - 1;
 1115|       |  ABSL_SWISSTABLE_ASSERT(
  ------------------
  |  |  256|    102|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1116|    102|      reinterpret_cast<uintptr_t>(gl_ptr) % alignof(GrowthInfo) == 0);
 1117|    102|  return *gl_ptr;
 1118|    102|}
_ZN4absl12lts_2026052618container_internal12AssertIsFullEPKNS1_6ctrl_tEhPKhPKc:
 1413|    100|                         const char* operation) {
 1414|    100|  if (!SwisstableDebugEnabled()) return;
  ------------------
  |  Branch (1414:7): [True: 100, Folded]
  ------------------
 1415|       |  // `SwisstableDebugEnabled()` is also true for release builds with hardening
 1416|       |  // enabled. To minimize their impact in those builds:
 1417|       |  // - use `ABSL_PREDICT_FALSE()` to provide a compiler hint for code layout
 1418|       |  // - use `ABSL_RAW_LOG()` with a format string to reduce code size and improve
 1419|       |  //   the chances that the hot paths will be inlined.
 1420|      0|  if (ABSL_PREDICT_FALSE(ctrl == nullptr)) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1421|      0|    ABSL_RAW_LOG(FATAL, "%s called on end() iterator.", operation);
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1422|      0|  }
 1423|      0|  if (ABSL_PREDICT_FALSE(ctrl == DefaultIterControl())) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1424|      0|    ABSL_RAW_LOG(FATAL, "%s called on default-constructed iterator.",
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1425|      0|                 operation);
 1426|      0|  }
 1427|      0|  if (SwisstableGenerationsEnabled()) {
  ------------------
  |  Branch (1427:7): [Folded, False: 0]
  ------------------
 1428|      0|    if (ABSL_PREDICT_FALSE(generation !=
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1429|      0|                           CrashIfIteratorIsInvalid(generation_ptr))) {
 1430|      0|      ABSL_RAW_LOG(FATAL,
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1431|      0|                   "%s called on invalid iterator. The table could have "
 1432|      0|                   "rehashed or moved since this iterator was initialized.",
 1433|      0|                   operation);
 1434|      0|    }
 1435|      0|    if (ABSL_PREDICT_FALSE(!IsFull(CrashIfIteratorIsInvalid(ctrl)))) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1436|      0|      ABSL_RAW_LOG(
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1437|      0|          FATAL,
 1438|      0|          "%s called on invalid iterator. The element was likely erased.",
 1439|      0|          operation);
 1440|      0|    }
 1441|      0|  } else {
 1442|      0|    if (ABSL_PREDICT_FALSE(!IsFull(CrashIfIteratorIsInvalid(ctrl)))) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1443|       |      ABSL_RAW_LOG(
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1444|      0|          FATAL,
 1445|      0|          "%s called on invalid iterator. The element might have been erased "
 1446|      0|          "or the table might have rehashed. Consider running with "
 1447|      0|          "--config=asan to diagnose rehashing issues.",
 1448|      0|          operation);
 1449|      0|    }
 1450|      0|  }
 1451|      0|}
_ZN4absl12lts_2026052618container_internal26AssertIsValidForComparisonEPKNS1_6ctrl_tEhPKh:
 1456|    104|                                       const GenerationType* generation_ptr) {
 1457|    104|  if (!SwisstableDebugEnabled()) return;
  ------------------
  |  Branch (1457:7): [True: 104, Folded]
  ------------------
 1458|      0|  const bool ctrl_is_valid_for_comparison =
 1459|      0|      ctrl == nullptr || ctrl == DefaultIterControl() ||
  ------------------
  |  Branch (1459:7): [True: 0, False: 0]
  |  Branch (1459:26): [True: 0, False: 0]
  ------------------
 1460|      0|      IsFull(CrashIfIteratorIsInvalid(ctrl));
  ------------------
  |  Branch (1460:7): [True: 0, False: 0]
  ------------------
 1461|      0|  if (SwisstableGenerationsEnabled()) {
  ------------------
  |  Branch (1461:7): [Folded, False: 0]
  ------------------
 1462|      0|    if (ABSL_PREDICT_FALSE(generation !=
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1463|      0|                           CrashIfIteratorIsInvalid(generation_ptr))) {
 1464|       |      // Note: in the case of a rehash, we would expect to see a sanitizer crash
 1465|       |      // in CrashIfIteratorIsInvalid so this assertion will only catch moved
 1466|       |      // table cases, unless we're using a custom allocator that does not
 1467|       |      // deallocate the old backing array (e.g. an arena allocator).
 1468|      0|      ABSL_RAW_LOG(
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1469|      0|          FATAL,
 1470|      0|          "Invalid iterator comparison. The table was likely moved (or "
 1471|      0|          "possibly rehashed) since this iterator was initialized.");
 1472|      0|    }
 1473|      0|    if (ABSL_PREDICT_FALSE(!ctrl_is_valid_for_comparison)) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1474|      0|      ABSL_RAW_LOG(
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1475|      0|          FATAL, "Invalid iterator comparison. The element was likely erased.");
 1476|      0|    }
 1477|      0|  } else {
 1478|      0|    ABSL_HARDENING_ASSERT_SLOW(
  ------------------
  |  |  175|      0|#define ABSL_HARDENING_ASSERT_SLOW(expr) ABSL_ASSERT(expr)
  |  |  ------------------
  |  |  |  |  127|      0|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|      0|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (87:42): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (87:57): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1479|      0|        ctrl_is_valid_for_comparison &&
 1480|      0|        "Invalid iterator comparison. The element might have been erased or "
 1481|      0|        "the table might have rehashed. Consider running with --config=asan to "
 1482|      0|        "diagnose rehashing issues.");
 1483|      0|  }
 1484|      0|}
_ZN4absl12lts_2026052618container_internal19AssertSameContainerEPKNS1_6ctrl_tES4_RKPKvS8_PKhSA_:
 1516|     52|                                const GenerationType* generation_ptr_b) {
 1517|     52|  if (!SwisstableDebugEnabled()) return;
  ------------------
  |  Branch (1517:7): [True: 52, Folded]
  ------------------
 1518|       |  // `SwisstableDebugEnabled()` is also true for release builds with hardening
 1519|       |  // enabled. To minimize their impact in those builds:
 1520|       |  // - use `ABSL_PREDICT_FALSE()` to provide a compiler hint for code layout
 1521|       |  // - use `ABSL_RAW_LOG()` with a format string to reduce code size and improve
 1522|       |  //   the chances that the hot paths will be inlined.
 1523|       |
 1524|       |  // fail_if(is_invalid, message) crashes when is_invalid is true and provides
 1525|       |  // an error message based on `message`.
 1526|      0|  const auto fail_if = [](bool is_invalid, const char* message) {
 1527|      0|    if (ABSL_PREDICT_FALSE(is_invalid)) {
 1528|      0|      ABSL_RAW_LOG(FATAL, "Invalid iterator comparison. %s", message);
 1529|      0|    }
 1530|      0|  };
 1531|       |
 1532|      0|  const bool a_is_default = ctrl_a == DefaultIterControl();
 1533|      0|  const bool b_is_default = ctrl_b == DefaultIterControl();
 1534|      0|  if (a_is_default && b_is_default) return;
  ------------------
  |  Branch (1534:7): [True: 0, False: 0]
  |  Branch (1534:23): [True: 0, False: 0]
  ------------------
 1535|      0|  fail_if(a_is_default != b_is_default,
 1536|      0|          "Comparing default-constructed hashtable iterator with a "
 1537|      0|          "non-default-constructed hashtable iterator.");
 1538|       |
 1539|      0|  if (SwisstableGenerationsEnabled()) {
  ------------------
  |  Branch (1539:7): [Folded, False: 0]
  ------------------
 1540|      0|    if (ABSL_PREDICT_TRUE(generation_ptr_a == generation_ptr_b)) return;
  ------------------
  |  |  191|      0|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 0, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 0]
  |  |  |  Branch (191:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1541|      0|    const bool a_is_empty = IsEmptyGeneration(generation_ptr_a);
 1542|      0|    const bool b_is_empty = IsEmptyGeneration(generation_ptr_b);
 1543|      0|    fail_if(a_is_empty != b_is_empty,
 1544|      0|            "Comparing an iterator from an empty hashtable with an iterator "
 1545|      0|            "from a non-empty hashtable.");
 1546|      0|    fail_if(a_is_empty && b_is_empty,
  ------------------
  |  Branch (1546:13): [True: 0, False: 0]
  |  Branch (1546:27): [True: 0, False: 0]
  ------------------
 1547|      0|            "Comparing iterators from different empty hashtables.");
 1548|       |
 1549|      0|    const bool a_is_end = ctrl_a == nullptr;
 1550|      0|    const bool b_is_end = ctrl_b == nullptr;
 1551|      0|    fail_if(a_is_end || b_is_end,
  ------------------
  |  Branch (1551:13): [True: 0, False: 0]
  |  Branch (1551:25): [True: 0, False: 0]
  ------------------
 1552|      0|            "Comparing iterator with an end() iterator from a different "
 1553|      0|            "hashtable.");
 1554|      0|    fail_if(true, "Comparing non-end() iterators from different hashtables.");
 1555|      0|  } else {
 1556|      0|    ABSL_HARDENING_ASSERT_SLOW(
  ------------------
  |  |  175|      0|#define ABSL_HARDENING_ASSERT_SLOW(expr) ABSL_ASSERT(expr)
  |  |  ------------------
  |  |  |  |  127|      0|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|      0|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (87:42): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (87:57): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1557|      0|        AreItersFromSameContainer(ctrl_a, ctrl_b, slot_a, slot_b) &&
 1558|      0|        "Invalid iterator comparison. The iterators may be from different "
 1559|      0|        "containers or the container might have rehashed or moved. Consider "
 1560|      0|        "running with --config=asan to diagnose issues.");
 1561|      0|  }
 1562|      0|}
_ZN4absl12lts_2026052618container_internal15is_single_groupEm:
 1571|      6|constexpr bool is_single_group(size_t capacity) {
 1572|      6|  return capacity <= Group::kWidth;
 1573|      6|}
_ZN4absl12lts_2026052618container_internal8probe_h1ENS1_21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEEm:
 1625|     48|                                         size_t h1) {
 1626|     48|  return probe_seq<Group::kWidth>(capacity, h1);
 1627|     48|}
_ZN4absl12lts_2026052618container_internal5probeENS1_21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEEm:
 1628|     46|inline probe_seq<Group::kWidth> probe(HashtableCapacity capacity, size_t hash) {
 1629|     46|  return probe_h1(capacity, H1(hash));
 1630|     46|}
_ZN4absl12lts_2026052618container_internal5probeERKNS1_12CommonFieldsEm:
 1631|     46|inline probe_seq<Group::kWidth> probe(const CommonFields& common, size_t hash) {
 1632|     46|  return probe(common.capacity_impl(), hash);
 1633|     46|}
_ZN4absl12lts_2026052618container_internal12SooSlotIndexEv:
 1848|      2|constexpr size_t SooSlotIndex() { return 1; }
_ZN4absl12lts_2026052618container_internal12CommonFields13CreateDefaultILb0EEES2_v:
 1149|      2|  static CommonFields CreateDefault() {
 1150|      2|    return kSooEnabled ? CommonFields{soo_tag_t{}}
  ------------------
  |  Branch (1150:12): [Folded, False: 2]
  ------------------
 1151|      2|                       : CommonFields{non_soo_tag_t{}};
 1152|      2|  }
_ZNK4absl12lts_2026052618container_internal16PerTableSeedImplIhE4seedEv:
  598|     84|  size_t seed() const { return seed_; }
_ZN4absl12lts_2026052618container_internal29TryFindNewIndexWithoutProbingIvEEmmmmPNS1_6ctrl_tEm:
 1652|     28|                                            size_t new_capacity) {
 1653|     28|  size_t index_diff = old_index - h1;
 1654|       |  // The first probe group starts with h1 & capacity.
 1655|       |  // All following groups start at (h1 + Group::kWidth * K) & capacity.
 1656|       |  // We can find an index within the floating group as index_diff modulo
 1657|       |  // Group::kWidth.
 1658|       |  // Both old and new capacity are larger than Group::kWidth so we can avoid
 1659|       |  // computing `& capacity`.
 1660|     28|  size_t in_floating_group_index = index_diff & (Group::kWidth - 1);
 1661|       |  // By subtracting we will get the difference between the first probe group
 1662|       |  // and the probe group corresponding to old_index.
 1663|     28|  index_diff -= in_floating_group_index;
 1664|     28|  if (ABSL_PREDICT_TRUE((index_diff & old_capacity) == 0)) {
  ------------------
  |  |  191|     28|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 28, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 28]
  |  |  |  Branch (191:57): [True: 28, False: 0]
  |  |  ------------------
  ------------------
 1665|     28|    size_t new_index = (h1 + in_floating_group_index) & new_capacity;
 1666|     28|    ABSL_ASSUME(new_index != kProbedElementIndexSentinel);
  ------------------
  |  |  271|     28|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1667|     28|    return new_index;
 1668|     28|  }
 1669|      0|  ABSL_SWISSTABLE_ASSERT(((old_index - h1) & old_capacity) >= Group::kWidth);
  ------------------
  |  |  256|      0|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 1670|       |  // Try to insert element into the first probe group.
 1671|       |  // new_ctrl is not yet fully initialized so we can't use regular search via
 1672|       |  // find_first_non_full.
 1673|       |
 1674|       |  // We can search in the first probe group only if it is located in already
 1675|       |  // initialized part of the table.
 1676|      0|  if (ABSL_PREDICT_FALSE((h1 & old_capacity) >= old_index)) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1677|      0|    return kProbedElementIndexSentinel;
 1678|      0|  }
 1679|      0|  size_t offset = h1 & new_capacity;
 1680|      0|  Group new_g(new_ctrl + offset);
 1681|      0|  if (auto mask = new_g.MaskNonFull(); ABSL_PREDICT_TRUE(mask)) {
  ------------------
  |  |  191|      0|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 0, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 0]
  |  |  |  Branch (191:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1682|      0|    size_t result = offset + mask.LowestBitSet();
 1683|      0|    ABSL_ASSUME(result != kProbedElementIndexSentinel);
  ------------------
  |  |  271|      0|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1684|      0|    return result;
 1685|      0|  }
 1686|      0|  return kProbedElementIndexSentinel;
 1687|      0|}
_ZNK4absl12lts_2026052618container_internal9probe_seqILm16EE6offsetEv:
 1606|    142|  size_t offset() const { return offset_; }
_ZNK4absl12lts_2026052618container_internal9probe_seqILm16EE6offsetEm:
 1607|      4|  size_t offset(size_t i) const { return capacity_.mask(offset_ + i); }
_ZNK4absl12lts_2026052618container_internal9probe_seqILm16EE5indexEv:
 1615|     48|  size_t index() const { return index_; }
_ZNK4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EE9ToRawDataEv:
  506|     12|  IntType ToRawData() const { return capacity_data_; }
_ZNK4absl12lts_2026052618container_internal19MaybeInitializedPtrINS1_6ctrl_tEE3getEv:
 1060|    296|  T* get() const { ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(p); }
  ------------------
  |  |  488|    296|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
_ZN4absl12lts_2026052618container_internal19MaybeInitializedPtrINS1_6ctrl_tEE3setEPS3_:
 1061|     10|  void set(T* ptr) { p = ptr; }
_ZNK4absl12lts_2026052618container_internal19MaybeInitializedPtrIvE3getEv:
 1060|    156|  T* get() const { ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(p); }
  ------------------
  |  |  488|    156|#define ABSL_SWISSTABLE_IGNORE_UNINITIALIZED_RETURN(x) return x
  ------------------
_ZN4absl12lts_2026052618container_internal19MaybeInitializedPtrIvE3setEPv:
 1061|     10|  void set(T* ptr) { p = ptr; }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE4sizeEv:
  645|     16|  size_t size() const { return static_cast<size_t>(data_ >> kSizeShift); }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE8set_sizeEm:
  663|      2|  void set_size(size_t size) {
  664|      2|    data_ =
  665|      2|        (data_ & kMetadataMask) | (static_cast<uint64_t>(size) << kSizeShift);
  666|      2|  }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE14increment_sizeEv:
  646|     50|  void increment_size() { data_ += kSizeOneNoMetadata; }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE5emptyEv:
  652|      2|  bool empty() const { return data_ < kSizeOneNoMetadata; }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE4seedEv:
  668|     84|  PerTableSeed seed() const { return PerTableSeed(data_ & kSeedMask); }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE8set_seedEh:
  712|      2|  void set_seed(typename PerTableSeed::IntType seed) {
  713|      2|    data_ = (data_ & ~kSeedMask) | seed;
  714|      2|  }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE17generate_new_seedEv:
  670|      2|  void generate_new_seed() {
  671|      2|    set_seed(static_cast<typename PerTableSeed::IntType>(NextHashTableSeed()));
  672|      2|  }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE8capacityEv:
  636|    548|  HashtableCapacity capacity() const {
  637|    548|    return HashtableCapacity::FromRawData(capacity_internal_);
  638|    548|  }
_ZN4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EE11FromRawDataEm:
  501|    548|  static HashtableCapacityImpl FromRawData(uint64_t capacity) {
  502|    548|    auto cap = HashtableCapacityImpl(uninitialized_tag_t{});
  503|    548|    cap.capacity_data_ = static_cast<IntType>(capacity);
  504|    548|    return cap;
  505|    548|  }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE12set_capacityENS1_21HashtableCapacityImplILS3_1EEE:
  641|     10|  void set_capacity(HashtableCapacity c) { capacity_internal_ = c.ToRawData(); }
_ZNK4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EE8is_smallEv:
  526|     54|  constexpr bool is_small() const {
  527|       |    // Small tables have capacity 0 or 1. This expression is valid for both
  528|       |    // capacity storage modes.
  529|       |    // Comparing capacity_data_ directly leads to a better generated code.
  530|       |    // One byte comparison is used before computing the capacity in order to
  531|       |    // detect small tables faster for critical path.
  532|     54|    static_assert(MaxSmallCapacity() == 1);
  533|     54|    return capacity_data_ <= 1;
  534|     54|  }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE8is_smallEv:
  639|     54|  bool is_small() const { return capacity().is_small(); }
_ZNK4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EE9has_infozEv:
  683|     50|  bool has_infoz() const {
  684|     50|    return ABSL_PREDICT_FALSE((data_ & kHasInfozMask) != 0);
  ------------------
  |  |  190|     50|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:49): [Folded, False: 50]
  |  |  |  Branch (190:58): [True: 0, False: 50]
  |  |  ------------------
  ------------------
  685|     50|  }
_ZN4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEC2Em:
  491|     12|      : capacity_data_(static_cast<IntType>(
  492|     12|            StorageMode == kCapacityByValue ? capacity
  ------------------
  |  Branch (492:13): [Folded, False: 12]
  ------------------
  493|     12|                                            : TrailingZeros(capacity + 1))) {
  494|       |    ABSL_SWISSTABLE_ASSERT(capacity == 0 || IsValidCapacity(capacity));
  ------------------
  |  |  256|     12|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
  495|     12|  }
_ZN4absl12lts_2026052618container_internal23HashtableInlineDataImplILNS1_28HashtableCapacityStorageModeE1EEC2ENS1_21HashtableCapacityImplILS3_1EEENS1_19no_seed_empty_tag_tE:
  629|      2|      : capacity_internal_(capacity.ToRawData()), data_(0) {}
_ZN4absl12lts_2026052618container_internal21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEC2ENS1_19uninitialized_tag_tE:
  489|    548|  explicit HashtableCapacityImpl(uninitialized_tag_t) {}
_ZN4absl12lts_2026052618container_internal16PerTableSeedImplIhEC2Em:
  605|     84|      : seed_(static_cast<IntType>(seed)) {}
_ZN4absl12lts_2026052618container_internal9probe_seqILm16EEC2ENS1_21HashtableCapacityImplILNS1_28HashtableCapacityStorageModeE1EEEm:
 1603|     48|      : capacity_(capacity), offset_(capacity.mask(hash)) {}
_ZN4absl12lts_2026052618container_internal20TransferNRelocatableILm24EEEvPvS3_S3_m:
 1955|      6|                                                  size_t count) {
 1956|       |  // TODO(b/382423690): Experiment with making specialization for power of 2 and
 1957|       |  // non power of 2. This would require passing the size of the slot.
 1958|      6|  memcpy(dst, src, SizeOfSlot * count);
 1959|      6|}
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8capacityEv:
 2601|      2|  size_t capacity() const {
 2602|      2|    const size_t cap = common().capacity();
 2603|       |    // Compiler complains when using functions in ASSUME so use local variables.
 2604|      2|    [[maybe_unused]] const bool kIsValid = IsValidCapacity(cap);
 2605|      2|    [[maybe_unused]] const size_t kDefaultCapacity = DefaultCapacity();
 2606|      2|    [[maybe_unused]] const size_t kMaxValidCapacity = MaxValidCapacity();
 2607|      2|    ABSL_ASSUME(kIsValid || cap == 0);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  |  |  ------------------
  |  |  |  Branch (271:44): [True: 2, False: 0]
  |  |  |  Branch (271:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2608|      2|    ABSL_ASSUME(cap >= kDefaultCapacity);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 2609|      2|    ABSL_ASSUME(cap <= kMaxValidCapacity);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 2610|      2|    return cap;
 2611|      2|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE6commonEv:
 3719|    376|  const CommonFields& common() const { return settings_.template get<0>(); }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8is_smallEv:
 2117|     54|  bool is_small() const { return common().is_small(); }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE5emptyEv:
 2593|      6|  bool empty() const { return !size(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE6commonEv:
 3718|    236|  CommonFields& common() { return settings_.template get<0>(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE14char_alloc_refEv:
 3772|     80|  CharAlloc& char_alloc_ref() { return settings_.template get<3>(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE11single_slotEv:
 3743|      2|  slot_type* single_slot() {
 3744|      2|    ABSL_SWISSTABLE_ASSERT(is_small());
  ------------------
  |  |  256|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3745|      2|    return SooEnabled() ? soo_slot() : slot_array();
  ------------------
  |  Branch (3745:12): [Folded, False: 2]
  ------------------
 3746|      2|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE10slot_arrayEv:
 3730|     98|  slot_type* slot_array() const {
 3731|       |    ABSL_SWISSTABLE_ASSERT(!is_soo());
  ------------------
  |  |  256|     98|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3732|     98|    return static_cast<slot_type*>(common().slot_array());
 3733|     98|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE13destroy_slotsEv:
 3280|      2|  void destroy_slots() {
 3281|      2|    ABSL_SWISSTABLE_ASSERT(!is_small());
  ------------------
  |  |  256|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3282|      2|    if (PolicyTraits::template destroy_is_trivial<Alloc>()) return;
  ------------------
  |  Branch (3282:9): [True: 2, Folded]
  ------------------
 3283|      0|    auto destroy_slot = [&](const ctrl_t*, void* slot) {
 3284|      0|      this->destroy(static_cast<slot_type*>(slot));
 3285|      0|    };
 3286|       |    if constexpr (SwisstableAssertAccessToDestroyedTable()) {
 3287|       |      CommonFields common_copy(non_soo_tag_t{}, this->common());
 3288|       |      common().set_capacity(HashtableCapacity::CreateDestroyed());
 3289|       |      IterateOverFullSlots(common_copy, sizeof(slot_type), destroy_slot);
 3290|       |      common().set_capacity(common_copy.capacity());
 3291|      0|    } else {
 3292|      0|      IterateOverFullSlots(common(), sizeof(slot_type), destroy_slot);
 3293|      0|    }
 3294|      0|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE7controlEv:
 3726|    140|  ctrl_t* control() const {
 3727|       |    ABSL_SWISSTABLE_ASSERT(!is_soo());
  ------------------
  |  |  256|    140|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3728|    140|    return common().control();
 3729|    140|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE12AssertOnFindIS8_EEvRKT_:
 3567|     50|  void AssertOnFind([[maybe_unused]] const K& key) {
 3568|     50|    AssertHashEqConsistent(key);
 3569|     50|    AssertNotDebugCapacity();
 3570|     50|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE22AssertHashEqConsistentIS8_EEvRKT_:
 3605|     50|  void AssertHashEqConsistent(const K& key) {
 3606|     50|#ifdef NDEBUG
 3607|     50|    return;
 3608|      0|#endif
 3609|       |    // If the hash/eq functors are known to be consistent, then skip validation.
 3610|      0|    if (std::is_same<hasher, absl::container_internal::StringHash>::value &&
  ------------------
  |  Branch (3610:9): [True: 0, Folded]
  ------------------
 3611|      0|        std::is_same<key_equal, absl::container_internal::StringEq>::value) {
  ------------------
  |  Branch (3611:9): [True: 0, Folded]
  ------------------
 3612|      0|      return;
 3613|      0|    }
 3614|      0|    if (std::is_scalar<key_type>::value &&
  ------------------
  |  Branch (3614:9): [Folded, False: 0]
  ------------------
 3615|      0|        std::is_same<hasher, absl::Hash<key_type>>::value &&
  ------------------
  |  Branch (3615:9): [Folded, False: 0]
  ------------------
 3616|      0|        std::is_same<key_equal, std::equal_to<key_type>>::value) {
  ------------------
  |  Branch (3616:9): [Folded, False: 0]
  ------------------
 3617|      0|      return;
 3618|      0|    }
 3619|      0|    if (empty()) return;
  ------------------
  |  Branch (3619:9): [True: 0, False: 0]
  ------------------
 3620|       |
 3621|      0|    const size_t hash_of_arg = hash_of(key);
 3622|      0|    const auto assert_consistent = [&](const ctrl_t*, void* slot) {
 3623|      0|      const bool is_key_equal = equal_to(key, to_slot(slot));
 3624|      0|      if (!is_key_equal) return;
 3625|       |
 3626|      0|      [[maybe_unused]] const bool is_hash_equal =
 3627|      0|          hash_of_arg == hash_of(to_slot(slot));
 3628|      0|      assert((!is_key_equal || is_hash_equal) &&
 3629|      0|             "eq(k1, k2) must imply that hash(k1) == hash(k2). "
 3630|      0|             "hash/eq functors are inconsistent.");
 3631|      0|    };
 3632|       |
 3633|      0|    if (is_small()) {
  ------------------
  |  Branch (3633:9): [True: 0, False: 0]
  ------------------
 3634|      0|      assert_consistent(/*unused*/ nullptr, single_slot());
 3635|      0|      return;
 3636|      0|    }
 3637|       |    // We only do validation for small tables so that it's constant time.
 3638|      0|    if (capacity() > 16) return;
  ------------------
  |  Branch (3638:9): [True: 0, False: 0]
  ------------------
 3639|      0|    IterateOverFullSlots(common(), sizeof(slot_type), assert_consistent);
 3640|      0|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE22AssertNotDebugCapacityEv:
 3573|     62|  void AssertNotDebugCapacity() const {
 3574|     62|#ifdef NDEBUG
 3575|     62|    if (!SwisstableGenerationsEnabled()) {
  ------------------
  |  Branch (3575:9): [True: 62, Folded]
  ------------------
 3576|     62|      return;
 3577|     62|    }
 3578|      0|#endif
 3579|      0|    const HashtableCapacity cap = maybe_invalid_capacity();
 3580|      0|    if (ABSL_PREDICT_TRUE(cap.IsValid())) {
  ------------------
  |  |  191|      0|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 0, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 0]
  |  |  |  Branch (191:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3581|      0|      return;
 3582|      0|    }
 3583|      0|    assert(!cap.IsReentrance() &&
 3584|      0|           "Reentrant container access during element construction/destruction "
 3585|      0|           "is not allowed.");
 3586|       |    if constexpr (SwisstableAssertAccessToDestroyedTable()) {
 3587|       |      if (cap.IsDestroyed()) {
 3588|       |        ABSL_RAW_LOG(FATAL, "Use of destroyed hash table.");
 3589|       |      }
 3590|       |    }
 3591|      0|    if (SwisstableGenerationsEnabled() &&
  ------------------
  |  Branch (3591:9): [Folded, False: 0]
  ------------------
 3592|      0|        ABSL_PREDICT_FALSE(cap.IsMovedFrom())) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3593|      0|      if (cap.IsSelfMovedFrom()) {
  ------------------
  |  Branch (3593:11): [True: 0, False: 0]
  ------------------
 3594|       |        // If this log triggers, then a hash table was move-assigned to itself
 3595|       |        // and then used again later without being reinitialized.
 3596|      0|        ABSL_RAW_LOG(FATAL, "Use of self-move-assigned hash table.");
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3597|      0|      }
 3598|      0|      ABSL_RAW_LOG(FATAL, "Use of moved-from hash table.");
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3599|      0|    }
 3600|      0|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8equal_toIS8_EEbRKT_PNS1_13map_slot_typeIS8_SA_EE:
 3344|      4|                                             slot_type* slot) const {
 3345|      4|    return PolicyTraits::apply(EqualElement<K, key_equal>{key, eq_ref()},
 3346|      4|                               PolicyTraits::element(slot));
 3347|      4|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE6eq_refEv:
 3771|      4|  const key_equal& eq_ref() const { return settings_.template get<2>(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorC2EPNS1_6ctrl_tEPNS1_13map_slot_typeIS8_SA_EEPKh:
 2236|     50|        : HashSetIteratorGenerationInfo(generation_ptr),
 2237|     50|          ctrl_(ctrl),
 2238|     50|          slot_(slot) {
 2239|       |      // This assumption helps the compiler know that any non-end iterator is
 2240|       |      // not equal to any end iterator.
 2241|     50|      ABSL_ASSUME(ctrl != nullptr);
  ------------------
  |  |  271|     50|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 2242|     50|    }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE19prefetch_heap_blockEv:
 3711|     46|  void prefetch_heap_block() const {
 3712|       |    ABSL_SWISSTABLE_ASSERT(!is_soo());
  ------------------
  |  |  256|     46|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3713|     46|#if ABSL_HAVE_BUILTIN(__builtin_prefetch) || defined(__GNUC__)
 3714|     46|    __builtin_prefetch(control(), 0, 1);
 3715|     46|#endif
 3716|     46|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE11iterator_atEm:
 3671|     46|  iterator iterator_at(size_t i) ABSL_ATTRIBUTE_LIFETIME_BOUND {
 3672|     46|    return {control() + i, slot_array() + i, common().generation_ptr()};
 3673|     46|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE7hash_ofIS8_EEmRKT_:
 3349|     46|  ABSL_ATTRIBUTE_ALWAYS_INLINE size_t hash_of(const K& key) const {
 3350|     46|    return HashElement<hasher, kIsDefaultHash>{hash_ref(),
 3351|     46|                                               common().seed().seed()}(key);
 3352|     46|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8hash_refEv:
 3769|     74|  const hasher& hash_ref() const { return settings_.template get<1>(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE3endEv:
 2577|      2|  iterator end() ABSL_ATTRIBUTE_LIFETIME_BOUND {
 2578|      2|    AssertNotDebugCapacity();
 2579|      2|    return iterator(common().generation_ptr());
 2580|      2|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorC2EPKh:
 2257|      2|        : HashSetIteratorGenerationInfo(generation_ptr), ctrl_(nullptr) {}
_ZN4absl12lts_2026052618container_internalneERKNS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorESF_:
 2229|     52|    friend bool operator!=(const iterator& a, const iterator& b) {
 2230|     52|      return !(a == b);
 2231|     52|    }
_ZN4absl12lts_2026052618container_internaleqERKNS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorESF_:
 2222|     52|    friend bool operator==(const iterator& a, const iterator& b) {
 2223|     52|      AssertIsValidForComparison(a.ctrl_, a.generation(), a.generation_ptr());
 2224|     52|      AssertIsValidForComparison(b.ctrl_, b.generation(), b.generation_ptr());
 2225|     52|      AssertSameContainer(a.ctrl_, b.ctrl_, a.slot_, b.slot_,
 2226|     52|                          a.generation_ptr(), b.generation_ptr());
 2227|     52|      return a.ctrl_ == b.ctrl_;
 2228|     52|    }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iterator14assert_is_fullEPKc:
 2259|    100|    void assert_is_full(const char* operation) const {
 2260|    100|      AssertIsFull(ctrl_, generation(), generation_ptr(), operation);
 2261|    100|    }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE6insertINS4_4pairIKS8_SA_EELi0EEENSE_INSC_8iteratorEbEEOT_:
 2653|     50|  std::pair<iterator, bool> insert(T&& value) ABSL_ATTRIBUTE_LIFETIME_BOUND {
 2654|     50|    return emplace(std::forward<T>(value));
 2655|     50|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE7emplaceIJNS4_4pairIKS8_SA_EEETnNS4_9enable_ifIXsr14IsDecomposableIDpT_EE5valueEiE4typeELi0EEENSE_INSC_8iteratorEbEEDpOSI_:
 2799|     50|      ABSL_ATTRIBUTE_LIFETIME_BOUND {
 2800|     50|    return PolicyTraits::apply(EmplaceDecomposable{*this},
 2801|     50|                               std::forward<Args>(args)...);
 2802|     50|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE19EmplaceDecomposableclIS8_JRKNS4_21piecewise_construct_tENS4_5tupleIJOKS8_EEENSI_IJOSA_EEEEEENS4_4pairINSC_8iteratorEbEERKT_DpOT0_:
 3177|     50|    std::pair<iterator, bool> operator()(const K& key, Args&&... args) const {
 3178|     50|      auto res = s.find_or_prepare_insert(key);
 3179|     50|      if (res.second) {
  ------------------
  |  Branch (3179:11): [True: 50, False: 0]
  ------------------
 3180|     50|        s.emplace_at(res.first, std::forward<Args>(args)...);
 3181|     50|      }
 3182|     50|      return res;
 3183|     50|    }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE22find_or_prepare_insertIS8_EENS4_4pairINSC_8iteratorEbEERKT_:
 3646|     50|  std::pair<iterator, bool> find_or_prepare_insert(const K& key) {
 3647|     50|    AssertOnFind(key);
 3648|     50|    if (is_small()) return find_or_prepare_insert_small(key);
  ------------------
  |  Branch (3648:9): [True: 4, False: 46]
  ------------------
 3649|     46|    return find_or_prepare_insert_large(key);
 3650|     50|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE28find_or_prepare_insert_smallIS8_EENS4_4pairINSC_8iteratorEbEERKT_:
 3497|      4|  std::pair<iterator, bool> find_or_prepare_insert_small(const K& key) {
 3498|      4|    ABSL_SWISSTABLE_ASSERT(is_small());
  ------------------
  |  |  256|      4|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3499|       |    if constexpr (SooEnabled()) {
 3500|       |      return find_or_prepare_insert_soo(key);
 3501|       |    }
 3502|      4|    if (!empty()) {
  ------------------
  |  Branch (3502:9): [True: 2, False: 2]
  ------------------
 3503|      2|      if (equal_to(key, single_slot())) {
  ------------------
  |  Branch (3503:11): [True: 0, False: 2]
  ------------------
 3504|      0|        return {single_iterator(), false};
 3505|      0|      }
 3506|      2|    }
 3507|      4|    return {iterator_at_ptr(PrepareInsertSmallNonSoo(
 3508|      4|                common(), GetPolicyFunctions(),
 3509|      4|                HashKey<hasher, K, kIsDefaultHash>{hash_ref(), key})),
 3510|      4|            true};
 3511|      4|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE15iterator_at_ptrENS4_4pairIPNS1_6ctrl_tEPvEE:
 3678|      4|      ABSL_ATTRIBUTE_LIFETIME_BOUND {
 3679|      4|    return {ptrs.first, to_slot(ptrs.second), common().generation_ptr()};
 3680|      4|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE7to_slotEPv:
 3361|      8|  static ABSL_ATTRIBUTE_ALWAYS_INLINE slot_type* to_slot(void* buf) {
 3362|      8|    return static_cast<slot_type*>(buf);
 3363|      8|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE18GetPolicyFunctionsEv:
 3851|     52|  static const PolicyFunctions& GetPolicyFunctions() {
 3852|     52|    static_assert(sizeof(slot_type) <= (std::numeric_limits<uint32_t>::max)(),
 3853|     52|                  "Slot size is too large. Use std::unique_ptr for value type "
 3854|     52|                  "or use absl::node_hash_{map,set}.");
 3855|     52|    static_assert(alignof(slot_type) <=
 3856|     52|                  size_t{(std::numeric_limits<uint16_t>::max)()});
 3857|     52|    static_assert(sizeof(key_type) <=
 3858|     52|                  size_t{(std::numeric_limits<uint32_t>::max)()});
 3859|     52|    static_assert(sizeof(value_type) <=
 3860|     52|                  size_t{(std::numeric_limits<uint32_t>::max)()});
 3861|     52|    static constexpr size_t kBackingArrayAlignment =
 3862|     52|        BackingArrayAlignment(alignof(slot_type));
 3863|     52|    static constexpr PolicyFunctions value = {
 3864|     52|        static_cast<uint32_t>(sizeof(key_type)),
 3865|     52|        static_cast<uint32_t>(sizeof(value_type)),
 3866|     52|        static_cast<uint32_t>(sizeof(slot_type)),
 3867|     52|        static_cast<uint16_t>(alignof(slot_type)), SooEnabled(),
 3868|     52|        ShouldSampleHashtablezInfoForAlloc<CharAlloc>(),
 3869|       |        // TODO(b/328722020): try to type erase
 3870|       |        // for standard layout and alignof(Hash) <= alignof(CommonFields).
 3871|     52|        std::is_empty_v<hasher> ? &GetRefForEmptyClass
  ------------------
  |  Branch (3871:9): [True: 0, Folded]
  ------------------
 3872|     52|                                : &raw_hash_set::get_hash_ref_fn,
 3873|     52|        PolicyTraits::template get_hash_slot_fn<hasher, kIsDefaultHash>(),
 3874|     52|        PolicyTraits::transfer_uses_memcpy()
  ------------------
  |  Branch (3874:9): [True: 0, Folded]
  ------------------
 3875|     52|            ? TransferNRelocatable<sizeof(slot_type)>
 3876|     52|            : &raw_hash_set::transfer_n_slots_fn,
 3877|     52|        std::is_empty_v<Alloc> ? &GetRefForEmptyClass
  ------------------
  |  Branch (3877:9): [True: 0, Folded]
  ------------------
 3878|     52|                               : &raw_hash_set::get_char_alloc_ref_fn,
 3879|     52|        &AllocateBackingArray<kBackingArrayAlignment, CharAlloc>,
 3880|     52|        &DeallocateBackingArray<kBackingArrayAlignment, CharAlloc>,
 3881|     52|        &raw_hash_set::transfer_unprobed_elements_to_next_capacity_fn};
 3882|     52|    return value;
 3883|     52|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE46transfer_unprobed_elements_to_next_capacity_fnERNS1_12CommonFieldsEPKNS1_6ctrl_tEPvSI_PFvSI_hmmE:
 3804|      2|                                    size_t source_offset, size_t h1)) {
 3805|      2|    const size_t new_capacity = common.capacity();
 3806|      2|    const size_t old_capacity = PreviousCapacity(new_capacity);
 3807|      2|    ABSL_ASSUME(old_capacity + 1 >= Group::kWidth);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 3808|      2|    ABSL_ASSUME((old_capacity + 1) % Group::kWidth == 0);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 3809|       |
 3810|      2|    auto* set = reinterpret_cast<raw_hash_set*>(&common);
 3811|      2|    slot_type* old_slots_ptr = to_slot(old_slots);
 3812|      2|    ctrl_t* new_ctrl = common.control();
 3813|      2|    slot_type* new_slots = set->slot_array();
 3814|       |
 3815|      4|    for (size_t group_index = 0; group_index < old_capacity;
  ------------------
  |  Branch (3815:34): [True: 2, False: 2]
  ------------------
 3816|      2|         group_index += Group::kWidth) {
 3817|      2|      GroupFullEmptyOrDeleted old_g(old_ctrl + group_index);
 3818|      2|      std::memset(new_ctrl + group_index, static_cast<int8_t>(ctrl_t::kEmpty),
 3819|      2|                  Group::kWidth);
 3820|      2|      std::memset(new_ctrl + group_index + old_capacity + 1,
 3821|      2|                  static_cast<int8_t>(ctrl_t::kEmpty), Group::kWidth);
 3822|       |      // TODO(b/382423690): try to type erase everything outside of the loop.
 3823|       |      // We will share a lot of code in expense of one function call per group.
 3824|     28|      for (auto in_fixed_group_index : old_g.MaskFull()) {
  ------------------
  |  Branch (3824:38): [True: 28, False: 2]
  ------------------
 3825|     28|        size_t old_index = group_index + in_fixed_group_index;
 3826|     28|        slot_type* old_slot = old_slots_ptr + old_index;
 3827|       |        // TODO(b/382423690): try to avoid entire hash calculation since we need
 3828|       |        // only one new bit of h1.
 3829|     28|        size_t hash = set->hash_of(old_slot);
 3830|     28|        size_t h1 = H1(hash);
 3831|     28|        h2_t h2 = H2(hash);
 3832|     28|        size_t new_index = TryFindNewIndexWithoutProbing(
 3833|     28|            h1, old_index, old_capacity, new_ctrl, new_capacity);
 3834|       |        // Note that encode_probed_element is allowed to use old_ctrl buffer
 3835|       |        // till and included the old_index.
 3836|     28|        if (ABSL_PREDICT_FALSE(new_index == kProbedElementIndexSentinel)) {
  ------------------
  |  |  190|     28|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 28]
  |  |  |  Branch (190:49): [Folded, False: 28]
  |  |  |  Branch (190:58): [True: 0, False: 28]
  |  |  ------------------
  ------------------
 3837|      0|          encode_probed_element(probed_storage, h2, old_index, h1);
 3838|      0|          continue;
 3839|      0|        }
 3840|     28|        ABSL_SWISSTABLE_ASSERT((new_index & old_capacity) <= old_index);
  ------------------
  |  |  256|     28|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3841|       |        ABSL_SWISSTABLE_ASSERT(IsEmpty(new_ctrl[new_index]));
  ------------------
  |  |  256|     28|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3842|     28|        new_ctrl[new_index] = static_cast<ctrl_t>(h2);
 3843|     28|        auto* new_slot = new_slots + new_index;
 3844|     28|        SanitizerUnpoisonMemoryRegion(new_slot, sizeof(slot_type));
 3845|     28|        set->transfer(new_slot, old_slot);
 3846|     28|        SanitizerPoisonMemoryRegion(old_slot, sizeof(slot_type));
 3847|     28|      }
 3848|      2|    }
 3849|      2|  }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE7hash_ofEPNS1_13map_slot_typeIS8_SA_EE:
 3353|     28|  ABSL_ATTRIBUTE_ALWAYS_INLINE size_t hash_of(slot_type* slot) const {
 3354|     28|    return PolicyTraits::apply(
 3355|     28|        HashElement<hasher, kIsDefaultHash>{hash_ref(), common().seed().seed()},
 3356|     28|        PolicyTraits::element(slot));
 3357|     28|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8transferEPNS1_13map_slot_typeIS8_SA_EESF_:
 3217|     28|  inline void transfer(slot_type* to, slot_type* from) {
 3218|     28|    common().RunWithReentrancyGuard([&] {
 3219|     28|      allocator_type alloc(char_alloc_ref());
 3220|     28|      PolicyTraits::transfer(&alloc, to, from);
 3221|     28|    });
 3222|     28|  }
_ZN4absl12lts_2026052618container_internal12CommonFields22RunWithReentrancyGuardIZNS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8transferEPNS1_13map_slot_typeISA_SC_EESH_EUlvE_EEvT_:
 1322|     28|  void RunWithReentrancyGuard(F f) {
 1323|     28|#ifdef NDEBUG
 1324|     28|    f();
 1325|     28|    return;
 1326|      0|#endif
 1327|      0|    const HashtableCapacity cap = maybe_invalid_capacity();
 1328|      0|    set_capacity(HashtableCapacity::CreateReentrance());
 1329|      0|    f();
 1330|      0|    set_capacity(cap);
 1331|      0|  }
_ZZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8transferEPNS1_13map_slot_typeIS8_SA_EESF_ENKUlvE_clEv:
 3218|     28|    common().RunWithReentrancyGuard([&] {
 3219|     28|      allocator_type alloc(char_alloc_ref());
 3220|     28|      PolicyTraits::transfer(&alloc, to, from);
 3221|     28|    });
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8hash_refEv:
 3768|      4|  hasher& hash_ref() { return settings_.template get<1>(); }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE28find_or_prepare_insert_largeIS8_EENS4_4pairINSC_8iteratorEbEERKT_:
 3514|     46|  std::pair<iterator, bool> find_or_prepare_insert_large(const K& key) {
 3515|     46|    ABSL_SWISSTABLE_ASSERT(!is_soo());
  ------------------
  |  |  256|     46|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3516|     46|    prefetch_heap_block();
 3517|     46|    const size_t hash = hash_of(key);
 3518|     46|    auto seq = probe(common(), hash);
 3519|     46|    const h2_t h2 = H2(hash);
 3520|     46|    const ctrl_t* ctrl = control();
 3521|     46|    size_t index;
 3522|     46|    bool inserted;
 3523|       |    // We use a lambda function to be able to exit from the nested loop without
 3524|       |    // duplicating generated code for the return statement (e.g. iterator_at).
 3525|     46|    [&]() ABSL_ATTRIBUTE_ALWAYS_INLINE {
 3526|     46|      while (true) {
 3527|     46|#ifndef ABSL_HAVE_MEMORY_SANITIZER
 3528|     46|        absl::PrefetchToLocalCache(slot_array() + seq.offset());
 3529|     46|#endif
 3530|     46|        Group g{ctrl + seq.offset()};
 3531|     46|        for (uint32_t i : g.Match(h2)) {
 3532|     46|          if (ABSL_PREDICT_TRUE(equal_to(key, slot_array() + seq.offset(i)))) {
 3533|     46|            index = seq.offset(i);
 3534|     46|            inserted = false;
 3535|     46|            return;
 3536|     46|          }
 3537|     46|        }
 3538|     46|        auto mask_empty = g.MaskEmpty();
 3539|     46|        if (ABSL_PREDICT_TRUE(mask_empty)) {
 3540|     46|          size_t target_group_offset = seq.offset();
 3541|     46|          index = SwisstableGenerationsEnabled()
 3542|     46|                      ? PrepareInsertLargeGenerationsEnabled(
 3543|     46|                            common(), GetPolicyFunctions(), hash, mask_empty,
 3544|     46|                            FindInfo{target_group_offset, seq.index()},
 3545|     46|                            HashKey<hasher, K, kIsDefaultHash>{hash_ref(), key})
 3546|     46|                      : PrepareInsertLarge(
 3547|     46|                            common(), GetPolicyFunctions(), hash, mask_empty,
 3548|     46|                            FindInfo{target_group_offset, seq.index()});
 3549|     46|          inserted = true;
 3550|     46|          return;
 3551|     46|        }
 3552|     46|        seq.next();
 3553|     46|        ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity() && "full table!");
 3554|     46|      }
 3555|     46|    }();
 3556|     46|    return {iterator_at(index), inserted};
 3557|     46|  }
_ZZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE28find_or_prepare_insert_largeIS8_EENS4_4pairINSC_8iteratorEbEERKT_ENKUlvE_clEv:
 3525|     46|    [&]() ABSL_ATTRIBUTE_ALWAYS_INLINE {
 3526|     46|      while (true) {
  ------------------
  |  Branch (3526:14): [True: 46, Folded]
  ------------------
 3527|     46|#ifndef ABSL_HAVE_MEMORY_SANITIZER
 3528|     46|        absl::PrefetchToLocalCache(slot_array() + seq.offset());
 3529|     46|#endif
 3530|     46|        Group g{ctrl + seq.offset()};
 3531|     46|        for (uint32_t i : g.Match(h2)) {
  ------------------
  |  Branch (3531:25): [True: 2, False: 46]
  ------------------
 3532|      2|          if (ABSL_PREDICT_TRUE(equal_to(key, slot_array() + seq.offset(i)))) {
  ------------------
  |  |  191|      2|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 0, False: 2]
  |  |  |  Branch (191:48): [Folded, False: 2]
  |  |  |  Branch (191:57): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3533|      0|            index = seq.offset(i);
 3534|      0|            inserted = false;
 3535|      0|            return;
 3536|      0|          }
 3537|      2|        }
 3538|     46|        auto mask_empty = g.MaskEmpty();
 3539|     46|        if (ABSL_PREDICT_TRUE(mask_empty)) {
  ------------------
  |  |  191|     46|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 46, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 46]
  |  |  |  Branch (191:57): [True: 46, False: 0]
  |  |  ------------------
  ------------------
 3540|     46|          size_t target_group_offset = seq.offset();
 3541|     46|          index = SwisstableGenerationsEnabled()
  ------------------
  |  Branch (3541:19): [Folded, False: 46]
  ------------------
 3542|     46|                      ? PrepareInsertLargeGenerationsEnabled(
 3543|      0|                            common(), GetPolicyFunctions(), hash, mask_empty,
 3544|      0|                            FindInfo{target_group_offset, seq.index()},
 3545|      0|                            HashKey<hasher, K, kIsDefaultHash>{hash_ref(), key})
 3546|     46|                      : PrepareInsertLarge(
 3547|     46|                            common(), GetPolicyFunctions(), hash, mask_empty,
 3548|     46|                            FindInfo{target_group_offset, seq.index()});
 3549|     46|          inserted = true;
 3550|     46|          return;
 3551|     46|        }
 3552|      0|        seq.next();
 3553|       |        ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity() && "full table!");
  ------------------
  |  |  256|      0|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3554|      0|      }
 3555|     46|    }();
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE10emplace_atIJRKNS4_21piecewise_construct_tENS4_5tupleIJOKS8_EEENSH_IJOSA_EEEEEEvNSC_8iteratorEDpOT_:
 3661|     50|  void emplace_at(iterator iter, Args&&... args) {
 3662|     50|    construct(iter.slot(), std::forward<Args>(args)...);
 3663|       |
 3664|       |    // When is_small, find calls find_small and if size is 0, then it will
 3665|       |    // return an end iterator. This can happen in the raw_hash_set copy ctor.
 3666|       |    assert((is_small() ||
 3667|     50|            PolicyTraits::apply(FindElement{*this}, *iter) == iter) &&
 3668|     50|           "constructed value does not match the lookup key");
 3669|     50|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE9constructIJRKNS4_21piecewise_construct_tENS4_5tupleIJOKS8_EEENSH_IJOSA_EEEEEEvPNS1_13map_slot_typeIS8_SA_EEDpOT_:
 3205|     50|  inline void construct(slot_type* slot, Args&&... args) {
 3206|     50|    common().RunWithReentrancyGuard([&] {
 3207|     50|      allocator_type alloc(char_alloc_ref());
 3208|     50|      PolicyTraits::construct(&alloc, slot, std::forward<Args>(args)...);
 3209|     50|    });
 3210|     50|  }
_ZN4absl12lts_2026052618container_internal12CommonFields22RunWithReentrancyGuardIZNS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE9constructIJRKNS6_21piecewise_construct_tENS6_5tupleIJOKSA_EEENSJ_IJOSC_EEEEEEvPNS1_13map_slot_typeISA_SC_EEDpOT_EUlvE_EEvT_:
 1322|     50|  void RunWithReentrancyGuard(F f) {
 1323|     50|#ifdef NDEBUG
 1324|     50|    f();
 1325|     50|    return;
 1326|      0|#endif
 1327|      0|    const HashtableCapacity cap = maybe_invalid_capacity();
 1328|      0|    set_capacity(HashtableCapacity::CreateReentrance());
 1329|      0|    f();
 1330|      0|    set_capacity(cap);
 1331|      0|  }
_ZZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE9constructIJRKNS4_21piecewise_construct_tENS4_5tupleIJOKS8_EEENSH_IJOSA_EEEEEEvPNS1_13map_slot_typeIS8_SA_EEDpOT_ENKUlvE_clEv:
 3206|     50|    common().RunWithReentrancyGuard([&] {
 3207|     50|      allocator_type alloc(char_alloc_ref());
 3208|     50|      PolicyTraits::construct(&alloc, slot, std::forward<Args>(args)...);
 3209|     50|    });
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iterator4slotEv:
 2285|     50|    slot_type* slot() const { return slot_; }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE5beginEv:
 2568|      2|  iterator begin() ABSL_ATTRIBUTE_LIFETIME_BOUND {
 2569|      2|    if (ABSL_PREDICT_FALSE(empty())) return end();
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 2570|      2|    if (is_small()) return single_iterator();
  ------------------
  |  Branch (2570:9): [True: 0, False: 2]
  ------------------
 2571|      2|    iterator it = {control(), common().slots_union(),
 2572|      2|                   common().generation_ptr()};
 2573|      2|    it.skip_empty_or_deleted();
 2574|       |    ABSL_SWISSTABLE_ASSERT(IsFull(*it.control()));
  ------------------
  |  |  256|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 2575|      2|    return it;
 2576|      2|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorC2EPNS1_6ctrl_tENS1_19MaybeInitializedPtrIvEEPKh:
 2248|      2|        : HashSetIteratorGenerationInfo(generation_ptr),
 2249|      2|          ctrl_(ctrl),
 2250|      2|          slot_(to_slot(slot.get())) {
 2251|       |      // This assumption helps the compiler know that any non-end iterator is
 2252|       |      // not equal to any end iterator.
 2253|      2|      ABSL_ASSUME(ctrl != nullptr);
  ------------------
  |  |  271|      2|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 2254|      2|    }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iterator21skip_empty_or_deletedEv:
 2265|     52|    void skip_empty_or_deleted() {
 2266|     64|      while (IsEmptyOrDeleted(*ctrl_)) {
  ------------------
  |  Branch (2266:14): [True: 12, False: 52]
  ------------------
 2267|     12|        ++ctrl_;
 2268|     12|        ++slot_;
 2269|     12|      }
 2270|     52|    }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratorppEv:
 2207|     50|    iterator& operator++() {
 2208|     50|      assert_is_full("operator++");
 2209|     50|      ++ctrl_;
 2210|     50|      ++slot_;
 2211|     50|      skip_empty_or_deleted();
 2212|     50|      if (ABSL_PREDICT_FALSE(*ctrl_ == ctrl_t::kSentinel)) ctrl_ = nullptr;
  ------------------
  |  |  190|     50|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 48]
  |  |  |  Branch (190:49): [Folded, False: 50]
  |  |  |  Branch (190:58): [True: 2, False: 48]
  |  |  ------------------
  ------------------
 2213|     50|      return *this;
 2214|     50|    }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iteratordeEv:
 2195|     50|    reference operator*() const {
 2196|     50|      assert_is_full("operator*()");
 2197|     50|      return unchecked_deref();
 2198|     50|    }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE8iterator15unchecked_derefEv:
 2282|     50|    reference unchecked_deref() const { return PolicyTraits::element(slot_); }
_ZNK4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE4sizeEv:
 2594|      8|  size_t size() const {
 2595|      8|    AssertNotDebugCapacity();
 2596|      8|    const size_t size = common().size();
 2597|      8|    [[maybe_unused]] const size_t kMaxValidSize = MaxValidSize();
 2598|      8|    ABSL_ASSUME(size <= kMaxValidSize);
  ------------------
  |  |  271|      8|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 2599|      8|    return size;
 2600|      8|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE5clearEv:
 2614|      2|  ABSL_ATTRIBUTE_REINITIALIZES void clear() {
 2615|      2|    if (SwisstableGenerationsEnabled() &&
  ------------------
  |  Branch (2615:9): [Folded, False: 2]
  |  Branch (2615:9): [Folded, False: 2]
  ------------------
 2616|      0|        maybe_invalid_capacity().IsMovedFrom()) {
  ------------------
  |  Branch (2616:9): [True: 0, False: 0]
  ------------------
 2617|      0|      common().set_capacity(DefaultCapacity());
 2618|      0|    }
 2619|      2|    AssertNotDebugCapacity();
 2620|       |    // Iterating over this container is O(bucket_count()). When bucket_count()
 2621|       |    // is much greater than size(), iteration becomes prohibitively expensive.
 2622|       |    // For clear() it is more important to reuse the allocated array when the
 2623|       |    // container is small because allocation takes comparatively long time
 2624|       |    // compared to destruction of the elements of the container. So we pick the
 2625|       |    // largest bucket_count() threshold for which iteration is still fast and
 2626|       |    // past that we simply deallocate the array.
 2627|      2|    const size_t cap = capacity();
 2628|      2|    if (cap == 0) {
  ------------------
  |  Branch (2628:9): [True: 0, False: 2]
  ------------------
 2629|       |      // Already guaranteed to be empty; so nothing to do.
 2630|      2|    } else if (is_small()) {
  ------------------
  |  Branch (2630:16): [True: 0, False: 2]
  ------------------
 2631|      0|      if (!empty()) {
  ------------------
  |  Branch (2631:11): [True: 0, False: 0]
  ------------------
 2632|      0|        destroy(single_slot());
 2633|      0|        decrement_small_size();
 2634|      0|      }
 2635|      2|    } else {
 2636|      2|      destroy_slots();
 2637|      2|      clear_backing_array(/*reuse=*/cap < 128);
 2638|      2|    }
 2639|      2|    common().set_reserved_growth(0);
 2640|      2|    common().set_reservation_size(0);
 2641|      2|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEE19clear_backing_arrayEb:
 3275|      2|  void clear_backing_array(bool reuse) {
 3276|       |    ABSL_SWISSTABLE_ASSERT(capacity() > MaxSmallCapacity());
  ------------------
  |  |  256|      2|  assert((CONDITION) && "Try enabling sanitizers.")
  ------------------
 3277|      2|    ClearBackingArray(common(), GetPolicyFunctions(), &char_alloc_ref(), reuse);
 3278|      2|  }
_ZN4absl12lts_2026052618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEPNS0_15CommandLineFlagEEEJEEC2Ev:
 2352|      2|      std::is_nothrow_default_constructible<allocator_type>::value) {}
_ZN4absl12lts_2026052618container_internal20AllocateBackingArrayILm8ENSt3__19allocatorIcEEEEPvS6_m:
 1722|     10|void* AllocateBackingArray(void* alloc, size_t n) {
 1723|     10|  return Allocate<AlignOfBackingArray>(static_cast<Alloc*>(alloc), n);
 1724|     10|}
_ZN4absl12lts_2026052618container_internal22DeallocateBackingArrayILm8ENSt3__19allocatorIcEEEEvPvmPNS1_6ctrl_tEmmb:
 1731|      8|    size_t slot_align, bool had_infoz) {
 1732|      8|  RawHashSetLayout layout(capacity, slot_size, slot_align, had_infoz);
 1733|      8|  void* backing_array = ctrl - layout.control_offset();
 1734|       |  // Unpoison before returning the memory to the allocator.
 1735|      8|  SanitizerUnpoisonMemoryRegion(backing_array, layout.alloc_size());
 1736|      8|  Deallocate<AlignOfBackingArray>(static_cast<Alloc*>(alloc), backing_array,
 1737|      8|                                  layout.alloc_size());
 1738|      8|}

_ZN4absl12lts_2026052627InstallFailureSignalHandlerERKNS0_27FailureSignalHandlerOptionsE:
  426|      2|void InstallFailureSignalHandler(const FailureSignalHandlerOptions& options) {
  427|      2|  fsh_options = options;
  428|     14|  for (auto& it : failure_signal_data) {
  ------------------
  |  Branch (428:17): [True: 14, False: 2]
  ------------------
  429|     14|    InstallOneFailureHandler(&it, AbslFailureSignalHandler);
  430|     14|  }
  431|      2|}
failure_signal_handler.cc:_ZN4absl12lts_20260526L24InstallOneFailureHandlerEPNS0_17FailureSignalDataEPFviP9siginfo_tPvE:
  231|     14|                                     void (*handler)(int, siginfo_t*, void*)) {
  232|     14|  struct sigaction act;
  233|     14|  memset(&act, 0, sizeof(act));
  234|     14|  sigemptyset(&act.sa_mask);
  235|     14|  act.sa_flags |= SA_SIGINFO;
  236|       |  // SA_NODEFER is required to handle SIGABRT from
  237|       |  // ImmediateAbortSignalHandler().
  238|     14|  act.sa_flags |= SA_NODEFER;
  239|     14|  if (fsh_options.use_alternate_stack) {
  ------------------
  |  Branch (239:7): [True: 14, False: 0]
  ------------------
  240|     14|    act.sa_flags |= MaybeSetupAlternateStack();
  241|     14|  }
  242|     14|  act.sa_sigaction = handler;
  243|       |  ABSL_RAW_CHECK(sigaction(data->signo, &act, &data->previous_action) == 0,
  ------------------
  |  |   60|     14|  do {                                                                 \
  |  |   61|     14|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     14|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 14]
  |  |  |  |  |  Branch (190:49): [Folded, False: 14]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     14|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 14]
  |  |  ------------------
  ------------------
  244|     14|                 "sigaction() failed");
  245|     14|}
failure_signal_handler.cc:_ZN4absl12lts_20260526L24MaybeSetupAlternateStackEv:
  221|     14|static int MaybeSetupAlternateStack() {
  222|     14|#ifdef ABSL_HAVE_SIGALTSTACK
  223|     14|  ABSL_ATTRIBUTE_UNUSED static const bool kOnce = SetupAlternateStackOnce();
  ------------------
  |  |  582|     14|#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__))
  ------------------
  224|     14|  return SA_ONSTACK;
  225|       |#else
  226|       |  return 0;
  227|       |#endif
  228|     14|}
failure_signal_handler.cc:_ZN4absl12lts_20260526L23SetupAlternateStackOnceEv:
  159|      2|static bool SetupAlternateStackOnce() {
  160|       |#if defined(__wasm__) || defined(__asmjs__)
  161|       |  const size_t page_mask = static_cast<size_t>(getpagesize()) - 1;
  162|       |#else
  163|      2|  const size_t page_mask = static_cast<size_t>(sysconf(_SC_PAGESIZE)) - 1;
  164|      2|#endif
  165|      2|  size_t stack_size =
  166|      2|      (std::max(static_cast<size_t>(SIGSTKSZ), size_t{65536}) + page_mask) &
  167|      2|      ~page_mask;
  168|       |#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
  169|       |    defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
  170|       |  // Account for sanitizer instrumentation requiring additional stack space.
  171|       |  stack_size *= 5;
  172|       |#endif
  173|       |
  174|      2|  stack_t sigstk;
  175|      2|  memset(&sigstk, 0, sizeof(sigstk));
  176|      2|  sigstk.ss_size = stack_size;
  177|       |
  178|      2|#ifdef ABSL_HAVE_MMAP
  179|       |#ifndef MAP_STACK
  180|       |#define MAP_STACK 0
  181|       |#endif
  182|      2|  sigstk.ss_sp = mmap(nullptr, sigstk.ss_size, PROT_READ | PROT_WRITE,
  183|      2|                      MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
  184|      2|  if (sigstk.ss_sp == MAP_FAILED) {
  ------------------
  |  Branch (184:7): [True: 0, False: 2]
  ------------------
  185|      0|    ABSL_RAW_LOG(FATAL, "mmap() for alternate signal stack failed");
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  186|      0|  }
  187|       |#else
  188|       |  sigstk.ss_sp = malloc(sigstk.ss_size);
  189|       |  if (sigstk.ss_sp == nullptr) {
  190|       |    ABSL_RAW_LOG(FATAL, "malloc() for alternate signal stack failed");
  191|       |  }
  192|       |#endif
  193|       |
  194|      2|  if (sigaltstack(&sigstk, nullptr) != 0) {
  ------------------
  |  Branch (194:7): [True: 0, False: 2]
  ------------------
  195|      0|    ABSL_RAW_LOG(FATAL, "sigaltstack() failed with errno=%d", errno);
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  196|      0|  }
  197|       |
  198|      2|#ifdef __linux__
  199|       |#if defined(PR_SET_VMA) && defined(PR_SET_VMA_ANON_NAME)
  200|       |  // Make a best-effort attempt to name the allocated region in
  201|       |  // /proc/$PID/smaps.
  202|       |  //
  203|       |  // The call to prctl() may fail if the kernel was not configured with the
  204|       |  // CONFIG_ANON_VMA_NAME kernel option.  This is OK since the call is
  205|       |  // primarily a debugging aid.
  206|       |  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, sigstk.ss_sp, sigstk.ss_size,
  207|       |        "absl-signalstack");
  208|       |#endif
  209|      2|#endif  // __linux__
  210|       |
  211|      2|  return true;
  212|      2|}

_ZN4absl12lts_2026052618debugging_internal11ElfMemImageC2EPKv:
   87|      2|ElfMemImage::ElfMemImage(const void *base) {
   88|      2|  ABSL_RAW_CHECK(base != kInvalidBase, "bad pointer");
  ------------------
  |  |   60|      2|  do {                                                                 \
  |  |   61|      2|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
   89|      2|  Init(base);
   90|      2|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage13GetNumSymbolsEv:
   92|     68|uint32_t ElfMemImage::GetNumSymbols() const { return num_syms_; }
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9GetDynsymEj:
   94|     22|const ElfW(Sym) * ElfMemImage::GetDynsym(uint32_t index) const {
   95|     22|  ABSL_RAW_CHECK(index < GetNumSymbols(), "index out of range");
  ------------------
  |  |   60|     22|  do {                                                                 \
  |  |   61|     22|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     22|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 22]
  |  |  |  |  |  Branch (190:49): [Folded, False: 22]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     22|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 22]
  |  |  ------------------
  ------------------
   96|     22|  return dynsym_ + index;
   97|     22|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9GetVersymEj:
   99|     22|const ElfW(Versym) *ElfMemImage::GetVersym(uint32_t index) const {
  100|     22|  ABSL_RAW_CHECK(index < GetNumSymbols(), "index out of range");
  ------------------
  |  |   60|     22|  do {                                                                 \
  |  |   61|     22|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     22|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 22]
  |  |  |  |  |  Branch (190:49): [Folded, False: 22]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     22|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 22]
  |  |  ------------------
  ------------------
  101|     22|  return versym_ + index;
  102|     22|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage7GetPhdrEi:
  104|      8|const ElfW(Phdr) *ElfMemImage::GetPhdr(int index) const {
  105|      8|  ABSL_RAW_CHECK(index >= 0 && index < ehdr_->e_phnum, "index out of range");
  ------------------
  |  |   60|      8|  do {                                                                 \
  |  |   61|      8|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     16|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 8]
  |  |  |  |  |  Branch (190:49): [Folded, False: 8]
  |  |  |  |  |  Branch (190:59): [True: 8, False: 0]
  |  |  |  |  |  Branch (190:59): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|      8|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 8]
  |  |  ------------------
  ------------------
  106|      8|  return GetTableElement<ElfW(Phdr)>(ehdr_, ehdr_->e_phoff, ehdr_->e_phentsize,
  107|      8|                                     static_cast<size_t>(index));
  108|      8|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9GetDynstrEj:
  110|     22|const char *ElfMemImage::GetDynstr(ElfW(Word) offset) const {
  111|     22|  ABSL_RAW_CHECK(offset < strsize_, "offset out of range");
  ------------------
  |  |   60|     22|  do {                                                                 \
  |  |   61|     22|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     22|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 22]
  |  |  |  |  |  Branch (190:49): [Folded, False: 22]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     22|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 22]
  |  |  ------------------
  ------------------
  112|     22|  return dynstr_ + offset;
  113|     22|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage10GetSymAddrEPK9Elf64_Sym:
  115|     22|const void *ElfMemImage::GetSymAddr(const ElfW(Sym) *sym) const {
  116|     22|  if (sym->st_shndx == SHN_UNDEF || sym->st_shndx >= SHN_LORESERVE) {
  ------------------
  |  Branch (116:7): [True: 2, False: 20]
  |  Branch (116:37): [True: 2, False: 18]
  ------------------
  117|       |    // Symbol corresponds to "special" (e.g. SHN_ABS) section.
  118|      4|    return reinterpret_cast<const void *>(sym->st_value);
  119|      4|  }
  120|     18|  ABSL_RAW_CHECK(link_base_ < sym->st_value, "symbol out of range");
  ------------------
  |  |   60|     18|  do {                                                                 \
  |  |   61|     18|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     18|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 18]
  |  |  |  |  |  Branch (190:49): [Folded, False: 18]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     18|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 18]
  |  |  ------------------
  ------------------
  121|     18|  return GetTableElement<char>(ehdr_, 0, 1, sym->st_value - link_base_);
  122|     18|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9GetVerdefEi:
  124|     20|const ElfW(Verdef) *ElfMemImage::GetVerdef(int index) const {
  125|     20|  ABSL_RAW_CHECK(0 <= index && static_cast<size_t>(index) <= verdefnum_,
  ------------------
  |  |   60|     20|  do {                                                                 \
  |  |   61|     20|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     40|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 20]
  |  |  |  |  |  Branch (190:49): [Folded, False: 20]
  |  |  |  |  |  Branch (190:59): [True: 20, False: 0]
  |  |  |  |  |  Branch (190:59): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     20|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 20]
  |  |  ------------------
  ------------------
  126|     20|                 "index out of range");
  127|     20|  const ElfW(Verdef) *version_definition = verdef_;
  128|     40|  while (version_definition->vd_ndx < index && version_definition->vd_next) {
  ------------------
  |  Branch (128:10): [True: 20, False: 20]
  |  Branch (128:48): [True: 20, False: 0]
  ------------------
  129|     20|    const char *const version_definition_as_char =
  130|     20|        reinterpret_cast<const char *>(version_definition);
  131|     20|    version_definition =
  132|     20|        reinterpret_cast<const ElfW(Verdef) *>(version_definition_as_char +
  133|     20|                                               version_definition->vd_next);
  134|     20|  }
  135|     20|  return version_definition->vd_ndx == index ? version_definition : nullptr;
  ------------------
  |  Branch (135:10): [True: 20, False: 0]
  ------------------
  136|     20|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage12GetVerdefAuxEPK12Elf64_Verdef:
  139|     20|    const ElfW(Verdef) *verdef) const {
  140|     20|  return reinterpret_cast<const ElfW(Verdaux) *>(verdef+1);
  141|     20|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9GetVerstrEj:
  143|     20|const char *ElfMemImage::GetVerstr(ElfW(Word) offset) const {
  144|     20|  ABSL_RAW_CHECK(offset < strsize_, "offset out of range");
  ------------------
  |  |   60|     20|  do {                                                                 \
  |  |   61|     20|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     20|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 20]
  |  |  |  |  |  Branch (190:49): [Folded, False: 20]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     20|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 20]
  |  |  ------------------
  ------------------
  145|     20|  return dynstr_ + offset;
  146|     20|}
_ZN4absl12lts_2026052618debugging_internal11ElfMemImage4InitEPKv:
  148|      2|void ElfMemImage::Init(const void *base) {
  149|      2|  ehdr_      = nullptr;
  150|      2|  dynsym_    = nullptr;
  151|      2|  dynstr_    = nullptr;
  152|      2|  versym_    = nullptr;
  153|      2|  verdef_    = nullptr;
  154|      2|  num_syms_ = 0;
  155|      2|  strsize_   = 0;
  156|      2|  verdefnum_ = 0;
  157|       |  // Sentinel: PT_LOAD .p_vaddr can't possibly be this.
  158|      2|  link_base_ = ~ElfW(Addr){0};  // NOLINT(readability/braces)
  159|      2|  if (!base) {
  ------------------
  |  Branch (159:7): [True: 0, False: 2]
  ------------------
  160|      0|    return;
  161|      0|  }
  162|      2|  const char *const base_as_char = reinterpret_cast<const char *>(base);
  163|      2|  if (base_as_char[EI_MAG0] != ELFMAG0 || base_as_char[EI_MAG1] != ELFMAG1 ||
  ------------------
  |  Branch (163:7): [True: 0, False: 2]
  |  Branch (163:43): [True: 0, False: 2]
  ------------------
  164|      2|      base_as_char[EI_MAG2] != ELFMAG2 || base_as_char[EI_MAG3] != ELFMAG3) {
  ------------------
  |  Branch (164:7): [True: 0, False: 2]
  |  Branch (164:43): [True: 0, False: 2]
  ------------------
  165|      0|    assert(false);
  166|      0|    return;
  167|      0|  }
  168|      2|  int elf_class = base_as_char[EI_CLASS];
  169|      2|  if (elf_class != kElfClass) {
  ------------------
  |  Branch (169:7): [True: 0, False: 2]
  ------------------
  170|      0|    assert(false);
  171|      0|    return;
  172|      0|  }
  173|      2|  switch (base_as_char[EI_DATA]) {
  174|      2|    case ELFDATA2LSB: {
  ------------------
  |  Branch (174:5): [True: 2, False: 0]
  ------------------
  175|       |#ifndef ABSL_IS_LITTLE_ENDIAN
  176|       |      assert(false);
  177|       |      return;
  178|       |#endif
  179|      2|      break;
  180|      0|    }
  181|      0|    case ELFDATA2MSB: {
  ------------------
  |  Branch (181:5): [True: 0, False: 2]
  ------------------
  182|      0|#ifndef ABSL_IS_BIG_ENDIAN
  183|      0|      assert(false);
  184|      0|      return;
  185|      0|#endif
  186|      0|      break;
  187|      0|    }
  188|      0|    default: {
  ------------------
  |  Branch (188:5): [True: 0, False: 2]
  ------------------
  189|      0|      assert(false);
  190|      0|      return;
  191|      0|    }
  192|      2|  }
  193|       |
  194|      2|  ehdr_ = reinterpret_cast<const ElfW(Ehdr) *>(base);
  195|      2|  const ElfW(Phdr) *dynamic_program_header = nullptr;
  196|     10|  for (int i = 0; i < ehdr_->e_phnum; ++i) {
  ------------------
  |  Branch (196:19): [True: 8, False: 2]
  ------------------
  197|      8|    const ElfW(Phdr) *const program_header = GetPhdr(i);
  198|      8|    switch (program_header->p_type) {
  ------------------
  |  Branch (198:13): [True: 4, False: 4]
  ------------------
  199|      2|      case PT_LOAD:
  ------------------
  |  Branch (199:7): [True: 2, False: 6]
  ------------------
  200|      2|        if (!~link_base_) {
  ------------------
  |  Branch (200:13): [True: 2, False: 0]
  ------------------
  201|      2|          link_base_ = program_header->p_vaddr;
  202|      2|        }
  203|      2|        break;
  204|      2|      case PT_DYNAMIC:
  ------------------
  |  Branch (204:7): [True: 2, False: 6]
  ------------------
  205|      2|        dynamic_program_header = program_header;
  206|      2|        break;
  207|      8|    }
  208|      8|  }
  209|      2|  if (!~link_base_ || !dynamic_program_header) {
  ------------------
  |  Branch (209:7): [True: 0, False: 2]
  |  Branch (209:23): [True: 0, False: 2]
  ------------------
  210|      0|    assert(false);
  211|       |    // Mark this image as not present. Can not recur infinitely.
  212|      0|    Init(nullptr);
  213|      0|    return;
  214|      0|  }
  215|      2|  ptrdiff_t relocation =
  216|      2|      base_as_char - reinterpret_cast<const char *>(link_base_);
  217|      2|  ElfW(Dyn)* dynamic_entry = reinterpret_cast<ElfW(Dyn)*>(
  218|      2|      static_cast<intptr_t>(dynamic_program_header->p_vaddr) + relocation);
  219|      2|  uint32_t *sysv_hash = nullptr;
  220|      2|  uint32_t *gnu_hash = nullptr;
  221|     26|  for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) {
  ------------------
  |  Branch (221:10): [True: 24, False: 2]
  ------------------
  222|     24|    const auto value =
  223|     24|        static_cast<intptr_t>(dynamic_entry->d_un.d_val) + relocation;
  224|     24|    switch (dynamic_entry->d_tag) {
  225|      2|      case DT_HASH:
  ------------------
  |  Branch (225:7): [True: 2, False: 22]
  ------------------
  226|      2|        sysv_hash = reinterpret_cast<uint32_t *>(value);
  227|      2|        break;
  228|      2|      case DT_GNU_HASH:
  ------------------
  |  Branch (228:7): [True: 2, False: 22]
  ------------------
  229|      2|        gnu_hash = reinterpret_cast<uint32_t *>(value);
  230|      2|        break;
  231|      2|      case DT_SYMTAB:
  ------------------
  |  Branch (231:7): [True: 2, False: 22]
  ------------------
  232|      2|        dynsym_ = reinterpret_cast<ElfW(Sym) *>(value);
  233|      2|        break;
  234|      2|      case DT_STRTAB:
  ------------------
  |  Branch (234:7): [True: 2, False: 22]
  ------------------
  235|      2|        dynstr_ = reinterpret_cast<const char *>(value);
  236|      2|        break;
  237|      2|      case DT_VERSYM:
  ------------------
  |  Branch (237:7): [True: 2, False: 22]
  ------------------
  238|      2|        versym_ = reinterpret_cast<ElfW(Versym) *>(value);
  239|      2|        break;
  240|      2|      case DT_VERDEF:
  ------------------
  |  Branch (240:7): [True: 2, False: 22]
  ------------------
  241|      2|        verdef_ = reinterpret_cast<ElfW(Verdef) *>(value);
  242|      2|        break;
  243|      2|      case DT_VERDEFNUM:
  ------------------
  |  Branch (243:7): [True: 2, False: 22]
  ------------------
  244|      2|        verdefnum_ = static_cast<size_t>(dynamic_entry->d_un.d_val);
  245|      2|        break;
  246|      2|      case DT_STRSZ:
  ------------------
  |  Branch (246:7): [True: 2, False: 22]
  ------------------
  247|      2|        strsize_ = static_cast<size_t>(dynamic_entry->d_un.d_val);
  248|      2|        break;
  249|      8|      default:
  ------------------
  |  Branch (249:7): [True: 8, False: 16]
  ------------------
  250|       |        // Unrecognized entries explicitly ignored.
  251|      8|        break;
  252|     24|    }
  253|     24|  }
  254|      2|  if ((!sysv_hash && !gnu_hash) || !dynsym_ || !dynstr_ || !versym_ ||
  ------------------
  |  Branch (254:8): [True: 0, False: 2]
  |  Branch (254:22): [True: 0, False: 0]
  |  Branch (254:36): [True: 0, False: 2]
  |  Branch (254:48): [True: 0, False: 2]
  |  Branch (254:60): [True: 0, False: 2]
  ------------------
  255|      2|      !verdef_ || !verdefnum_ || !strsize_) {
  ------------------
  |  Branch (255:7): [True: 0, False: 2]
  |  Branch (255:19): [True: 0, False: 2]
  |  Branch (255:34): [True: 0, False: 2]
  ------------------
  256|      0|    assert(false);  // invalid VDSO
  257|       |    // Mark this image as not present. Can not recur infinitely.
  258|      0|    Init(nullptr);
  259|      0|    return;
  260|      0|  }
  261|      2|  if (sysv_hash) {
  ------------------
  |  Branch (261:7): [True: 2, False: 0]
  ------------------
  262|      2|    num_syms_ = sysv_hash[1];
  263|      2|  } else {
  264|      0|    assert(gnu_hash);
  265|       |    // Compute the number of symbols for DT_GNU_HASH, which is specified by
  266|       |    // https://sourceware.org/gnu-gabi/program-loading-and-dynamic-linking.txt
  267|      0|    uint32_t nbuckets = gnu_hash[0];
  268|       |    // The buckets array is located after the header (4 uint32) and the bloom
  269|       |    // filter (size_t array of gnu_hash[2] elements).
  270|      0|    uint32_t *buckets = gnu_hash + 4 + sizeof(size_t) / 4 * gnu_hash[2];
  271|       |    // Find the chain of the last non-empty bucket.
  272|      0|    uint32_t idx = 0;
  273|      0|    for (uint32_t i = nbuckets; i > 0;) {
  ------------------
  |  Branch (273:33): [True: 0, False: 0]
  ------------------
  274|      0|      idx = buckets[--i];
  275|      0|      if (idx != 0) break;
  ------------------
  |  Branch (275:11): [True: 0, False: 0]
  ------------------
  276|      0|    }
  277|      0|    if (idx != 0) {
  ------------------
  |  Branch (277:9): [True: 0, False: 0]
  ------------------
  278|       |      // Find the last element of the chain, which has an odd value.
  279|       |      // Add one to get the number of symbols.
  280|      0|      uint32_t *chain = buckets + nbuckets - gnu_hash[1];
  281|      0|      while (chain[idx++] % 2 == 0) {
  ------------------
  |  Branch (281:14): [True: 0, False: 0]
  ------------------
  282|      0|      }
  283|      0|    }
  284|      0|    num_syms_ = idx;
  285|      0|  }
  286|      2|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage12LookupSymbolEPKcS4_iPNS2_10SymbolInfoE:
  291|      2|                               SymbolInfo *info_out) const {
  292|     22|  for (const SymbolInfo& info : *this) {
  ------------------
  |  Branch (292:31): [True: 22, False: 0]
  ------------------
  293|     22|    if (strcmp(info.name, name) == 0 && strcmp(info.version, version) == 0 &&
  ------------------
  |  Branch (293:9): [True: 2, False: 20]
  |  Branch (293:41): [True: 2, False: 0]
  ------------------
  294|      2|        ElfType(info.symbol) == type) {
  ------------------
  |  Branch (294:9): [True: 2, False: 0]
  ------------------
  295|      2|      if (info_out) {
  ------------------
  |  Branch (295:11): [True: 2, False: 0]
  ------------------
  296|      2|        *info_out = info;
  297|      2|      }
  298|      2|      return true;
  299|      2|    }
  300|     22|  }
  301|      0|  return false;
  302|      2|}
_ZN4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIteratorC2EPKvj:
  332|      4|    : index_(index), image_(image) {}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIteratordeEv:
  338|     22|const ElfMemImage::SymbolInfo& ElfMemImage::SymbolIterator::operator*() const {
  339|     22|  return info_;
  340|     22|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIteratoreqERKS3_:
  342|     22|bool ElfMemImage::SymbolIterator::operator==(const SymbolIterator &rhs) const {
  343|     22|  return this->image_ == rhs.image_ && this->index_ == rhs.index_;
  ------------------
  |  Branch (343:10): [True: 22, False: 0]
  |  Branch (343:40): [True: 0, False: 22]
  ------------------
  344|     22|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIteratorneERKS3_:
  346|     22|bool ElfMemImage::SymbolIterator::operator!=(const SymbolIterator &rhs) const {
  347|     22|  return !(*this == rhs);
  348|     22|}
_ZN4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIteratorppEv:
  350|     20|ElfMemImage::SymbolIterator &ElfMemImage::SymbolIterator::operator++() {
  351|     20|  this->Update(1);
  352|     20|  return *this;
  353|     20|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage5beginEv:
  355|      2|ElfMemImage::SymbolIterator ElfMemImage::begin() const {
  356|      2|  SymbolIterator it(this, 0);
  357|      2|  it.Update(0);
  358|      2|  return it;
  359|      2|}
_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage3endEv:
  361|      2|ElfMemImage::SymbolIterator ElfMemImage::end() const {
  362|      2|  return SymbolIterator(this, GetNumSymbols());
  363|      2|}
_ZN4absl12lts_2026052618debugging_internal11ElfMemImage14SymbolIterator6UpdateEj:
  365|     22|void ElfMemImage::SymbolIterator::Update(uint32_t increment) {
  366|     22|  const ElfMemImage *image = reinterpret_cast<const ElfMemImage *>(image_);
  367|     22|  ABSL_RAW_CHECK(image->IsPresent() || increment == 0, "");
  ------------------
  |  |   60|     22|  do {                                                                 \
  |  |   61|     22|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     22|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 22]
  |  |  |  |  |  Branch (190:49): [Folded, False: 22]
  |  |  |  |  |  Branch (190:59): [True: 22, False: 0]
  |  |  |  |  |  Branch (190:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     22|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 22]
  |  |  ------------------
  ------------------
  368|     22|  if (!image->IsPresent()) {
  ------------------
  |  Branch (368:7): [True: 0, False: 22]
  ------------------
  369|      0|    return;
  370|      0|  }
  371|     22|  index_ += increment;
  372|     22|  if (index_ >= image->GetNumSymbols()) {
  ------------------
  |  Branch (372:7): [True: 0, False: 22]
  ------------------
  373|      0|    index_ = image->GetNumSymbols();
  374|      0|    return;
  375|      0|  }
  376|     22|  const ElfW(Sym)    *symbol = image->GetDynsym(index_);
  377|     22|  const ElfW(Versym) *version_symbol = image->GetVersym(index_);
  378|     22|  ABSL_RAW_CHECK(symbol && version_symbol, "");
  ------------------
  |  |   60|     22|  do {                                                                 \
  |  |   61|     22|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     44|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 22]
  |  |  |  |  |  Branch (190:49): [Folded, False: 22]
  |  |  |  |  |  Branch (190:59): [True: 22, False: 0]
  |  |  |  |  |  Branch (190:59): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     22|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 22]
  |  |  ------------------
  ------------------
  379|     22|  const char *const symbol_name = image->GetDynstr(symbol->st_name);
  380|       |#if defined(__NetBSD__)
  381|       |  const int version_index = version_symbol->vs_vers & VERSYM_VERSION;
  382|       |#else
  383|     22|  const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION;
  ------------------
  |  |   42|     22|#define VERSYM_VERSION 0x7fff
  ------------------
  384|     22|#endif
  385|     22|  const ElfW(Verdef) *version_definition = nullptr;
  386|     22|  const char *version_name = "";
  387|     22|  if (symbol->st_shndx == SHN_UNDEF) {
  ------------------
  |  Branch (387:7): [True: 2, False: 20]
  ------------------
  388|       |    // Undefined symbols reference DT_VERNEED, not DT_VERDEF, and
  389|       |    // version_index could well be greater than verdefnum_, so calling
  390|       |    // GetVerdef(version_index) may trigger assertion.
  391|     20|  } else {
  392|     20|    version_definition = image->GetVerdef(version_index);
  393|     20|  }
  394|     22|  if (version_definition) {
  ------------------
  |  Branch (394:7): [True: 20, False: 2]
  ------------------
  395|       |    // I am expecting 1 or 2 auxiliary entries: 1 for the version itself,
  396|       |    // optional 2nd if the version has a parent.
  397|     20|    ABSL_RAW_CHECK(
  ------------------
  |  |   60|     20|  do {                                                                 \
  |  |   61|     20|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|     20|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 20]
  |  |  |  |  |  Branch (190:49): [Folded, False: 20]
  |  |  |  |  |  Branch (190:59): [True: 20, False: 0]
  |  |  |  |  |  Branch (190:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|     20|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 20]
  |  |  ------------------
  ------------------
  398|     20|        version_definition->vd_cnt == 1 || version_definition->vd_cnt == 2,
  399|     20|        "wrong number of entries");
  400|     20|    const ElfW(Verdaux) *version_aux = image->GetVerdefAux(version_definition);
  401|     20|    version_name = image->GetVerstr(version_aux->vda_name);
  402|     20|  }
  403|     22|  info_.name    = symbol_name;
  404|     22|  info_.version = version_name;
  405|     22|  info_.address = image->GetSymAddr(symbol);
  406|     22|  info_.symbol  = symbol;
  407|     22|}
elf_mem_image.cc:_ZN4absl12lts_2026052618debugging_internal12_GLOBAL__N_17ElfTypeEPK9Elf64_Sym:
   57|      2|int ElfType(const ElfW(Sym) *symbol) { return ELF64_ST_TYPE(symbol->st_info); }
elf_mem_image.cc:_ZN4absl12lts_2026052618debugging_internal12_GLOBAL__N_115GetTableElementI10Elf64_PhdrEEPKT_PK10Elf64_Ehdrmjm:
   75|      8|                         ElfW(Word) element_size, size_t index) {
   76|      8|  return reinterpret_cast<const T*>(reinterpret_cast<const char *>(ehdr)
   77|      8|                                    + table_offset
   78|      8|                                    + index * element_size);
   79|      8|}
elf_mem_image.cc:_ZN4absl12lts_2026052618debugging_internal12_GLOBAL__N_115GetTableElementIcEEPKT_PK10Elf64_Ehdrmjm:
   75|     18|                         ElfW(Word) element_size, size_t index) {
   76|     18|  return reinterpret_cast<const T*>(reinterpret_cast<const char *>(ehdr)
   77|     18|                                    + table_offset
   78|     18|                                    + index * element_size);
   79|     18|}

_ZNK4absl12lts_2026052618debugging_internal11ElfMemImage9IsPresentEv:
   96|     44|  bool                 IsPresent() const { return ehdr_ != nullptr; }

_ZN4absl12lts_2026052618debugging_internal11VDSOSupportC2Ev:
   79|      2|    : image_(vdso_base_.load(std::memory_order_relaxed) ==
  ------------------
  |  Branch (79:14): [True: 0, False: 2]
  ------------------
   80|      2|                     debugging_internal::ElfMemImage::kInvalidBase
   81|      2|                 ? Init()
   82|      2|                 : vdso_base_.load(std::memory_order_relaxed)) {}
_ZN4absl12lts_2026052618debugging_internal11VDSOSupport4InitEv:
   93|      2|const void *VDSOSupport::Init() {
   94|      2|  const auto kInvalidBase = debugging_internal::ElfMemImage::kInvalidBase;
   95|      2|#ifdef ABSL_HAVE_GETAUXVAL
   96|      2|  if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
  ------------------
  |  Branch (96:7): [True: 2, False: 0]
  ------------------
   97|      2|    errno = 0;
   98|      2|    const void *const sysinfo_ehdr =
   99|      2|        reinterpret_cast<const void *>(getauxval(AT_SYSINFO_EHDR));
  100|      2|    if (errno == 0) {
  ------------------
  |  Branch (100:9): [True: 2, False: 0]
  ------------------
  101|      2|      vdso_base_.store(sysinfo_ehdr, std::memory_order_relaxed);
  102|      2|    }
  103|      2|  }
  104|      2|#endif  // ABSL_HAVE_GETAUXVAL
  105|      2|  if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
  ------------------
  |  Branch (105:7): [True: 0, False: 2]
  ------------------
  106|      0|    int fd = open("/proc/self/auxv", O_RDONLY);
  107|      0|    if (fd == -1) {
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  108|       |      // Kernel too old to have a VDSO.
  109|      0|      vdso_base_.store(nullptr, std::memory_order_relaxed);
  110|      0|      getcpu_fn_.store(&GetCPUViaSyscall, std::memory_order_relaxed);
  111|      0|      return nullptr;
  112|      0|    }
  113|      0|    ElfW(auxv_t) aux;
  114|      0|    while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) {
  ------------------
  |  Branch (114:12): [True: 0, False: 0]
  ------------------
  115|      0|      if (aux.a_type == AT_SYSINFO_EHDR) {
  ------------------
  |  Branch (115:11): [True: 0, False: 0]
  ------------------
  116|       |#if defined(__NetBSD__)
  117|       |        vdso_base_.store(reinterpret_cast<void *>(aux.a_v),
  118|       |                         std::memory_order_relaxed);
  119|       |#else
  120|      0|        vdso_base_.store(reinterpret_cast<void *>(aux.a_un.a_val),
  121|      0|                         std::memory_order_relaxed);
  122|      0|#endif
  123|      0|        break;
  124|      0|      }
  125|      0|    }
  126|      0|    close(fd);
  127|      0|    if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|       |      // Didn't find AT_SYSINFO_EHDR in auxv[].
  129|      0|      vdso_base_.store(nullptr, std::memory_order_relaxed);
  130|      0|    }
  131|      0|  }
  132|      2|  GetCpuFn fn = &GetCPUViaSyscall;  // default if VDSO not present.
  133|      2|  if (vdso_base_.load(std::memory_order_relaxed)) {
  ------------------
  |  Branch (133:7): [True: 2, False: 0]
  ------------------
  134|      2|    VDSOSupport vdso;
  135|      2|    SymbolInfo info;
  136|      2|    if (vdso.LookupSymbol("__vdso_getcpu", "LINUX_2.6", STT_FUNC, &info)) {
  ------------------
  |  Branch (136:9): [True: 2, False: 0]
  ------------------
  137|      2|      fn = reinterpret_cast<GetCpuFn>(const_cast<void *>(info.address));
  138|      2|    }
  139|      2|  }
  140|       |  // Subtle: this code runs outside of any locks; prevent compiler
  141|       |  // from assigning to getcpu_fn_ more than once.
  142|      2|  getcpu_fn_.store(fn, std::memory_order_relaxed);
  143|      2|  return vdso_base_.load(std::memory_order_relaxed);
  144|      2|}
_ZNK4absl12lts_2026052618debugging_internal11VDSOSupport12LookupSymbolEPKcS4_iPNS1_11ElfMemImage10SymbolInfoE:
  160|      2|                               SymbolInfo *info) const {
  161|      2|  return image_.LookupSymbol(name, version, type, info);
  162|      2|}

_ZN4absl12lts_2026052620InitializeSymbolizerEPKc:
   92|      2|void InitializeSymbolizer(const char *argv0) {
   93|      2|#ifdef ABSL_HAVE_VDSO_SUPPORT
   94|       |  // We need to make sure VDSOSupport::Init() is called before any setuid or
   95|       |  // chroot calls, so InitializeSymbolizer() should be called very early in the
   96|       |  // life of a program.
   97|      2|  absl::debugging_internal::VDSOSupport::Init();
   98|      2|#endif
   99|      2|  if (argv0_value != nullptr) {
  ------------------
  |  Branch (99:7): [True: 0, False: 2]
  ------------------
  100|      0|    free(argv0_value);
  101|      0|    argv0_value = nullptr;
  102|      0|  }
  103|      2|  if (argv0 != nullptr && argv0[0] != '\0') {
  ------------------
  |  Branch (103:7): [True: 2, False: 0]
  |  Branch (103:27): [True: 2, False: 0]
  ------------------
  104|      2|    argv0_value = strdup(argv0);
  105|      2|  }
  106|      2|}

_ZNK4absl12lts_2026052615CommandLineFlag8IsOfTypeIbEEbv:
   84|      4|  inline bool IsOfType() const {
   85|      4|    return TypeId() == FastTypeId<T>();
   86|      4|  }

_ZN25AbslFlagDefaultGenForfuzz3GenEPv:
  258|      4|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      4|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      4|    }                                                                         \
_ZN29AbslFlagDefaultGenForfuzz_for3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN36AbslFlagDefaultGenForcorpus_database3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN34AbslFlagDefaultGenForreplay_corpus3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN38AbslFlagDefaultGenForreplay_corpus_for3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN37AbslFlagDefaultGenFortime_budget_type3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN33AbslFlagDefaultGenForexecution_id3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN41AbslFlagDefaultGenFortime_limit_per_input3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN25AbslFlagDefaultGenForjobs3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN47AbslFlagDefaultGenForsubprocess_cleanup_timeout3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN47AbslFlagDefaultGenForinternal_centipede_command3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN48AbslFlagDefaultGenForinternal_override_fuzz_test3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN4absl12lts_202605267GetFlagINSt3__18optionalINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEET_RKNS0_14flags_internal4FlagISB_EE:
   98|     14|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|     14|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|     14|}
_ZN55AbslFlagDefaultGenForinternal_override_total_time_limit3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN4absl12lts_202605267GetFlagINS0_8DurationEEET_RKNS0_14flags_internal4FlagIS3_EE:
   98|     14|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|     14|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|     14|}
_ZN57AbslFlagDefaultGenForinternal_crashing_input_to_reproduce3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN4absl12lts_202605267GetFlagIN8fuzztest8internal14TimeBudgetTypeEEET_RKNS0_14flags_internal4FlagIS5_EE:
   98|      2|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|      2|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|      2|}
_ZN4absl12lts_202605267GetFlagINSt3__18optionalImEEEET_RKNS0_14flags_internal4FlagIS5_EE:
   98|      2|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|      2|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|      2|}
_ZN4absl12lts_202605267GetFlagImEET_RKNS0_14flags_internal4FlagIS2_EE:
   98|      4|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|      4|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|      4|}
_ZN4absl12lts_202605267GetFlagIbEET_RKNS0_14flags_internal4FlagIS2_EE:
   98|     12|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|     12|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|     12|}
_ZN4absl12lts_202605267GetFlagINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEET_RKNS0_14flags_internal4FlagIS9_EE:
   98|     16|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|     16|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|     16|}
_ZN29AbslFlagDefaultGenForflagfile3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN28AbslFlagDefaultGenForfromenv3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN31AbslFlagDefaultGenFortryfromenv3GenEPv:
  258|      2|    static void Gen(void* absl_flag_default_loc) {                            \
  259|      2|      new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value);  \
  260|      2|    }                                                                         \
_ZN4absl12lts_202605267GetFlagINSt3__16vectorINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS7_IS9_EEEEEET_RKNS0_14flags_internal4FlagISC_EE:
   98|     10|[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
   99|     10|  return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
  100|     10|}

_ZN4absl12lts_2026052614flags_internal15DynValueDeleterC2EPFPvNS1_6FlagOpEPKvS3_S3_E:
  168|      4|DynValueDeleter::DynValueDeleter(FlagOpFn op_arg) : op(op_arg) {}
_ZNK4absl12lts_2026052614flags_internal15DynValueDeleterclEPv:
  170|      4|void DynValueDeleter::operator()(void* ptr) const {
  171|      4|  if (op == nullptr) return;
  ------------------
  |  Branch (171:7): [True: 0, False: 4]
  ------------------
  172|       |
  173|      4|  Delete(op, ptr);
  174|      4|}
_ZN4absl12lts_2026052614flags_internal13MaskedPointerC2EPvb:
  176|     20|MaskedPointer::MaskedPointer(ptr_t rhs, bool is_candidate) : ptr_(rhs) {
  177|     20|  if (is_candidate) {
  ------------------
  |  Branch (177:7): [True: 20, False: 0]
  ------------------
  178|     20|    ApplyMask(kUnprotectedReadCandidate);
  179|     20|  }
  180|     20|}
_ZNK4absl12lts_2026052614flags_internal13MaskedPointer26IsUnprotectedReadCandidateEv:
  182|     22|bool MaskedPointer::IsUnprotectedReadCandidate() const {
  183|     22|  return CheckMask(kUnprotectedReadCandidate);
  184|     22|}
_ZNK4absl12lts_2026052614flags_internal13MaskedPointer11HasBeenReadEv:
  186|     22|bool MaskedPointer::HasBeenRead() const { return CheckMask(kHasBeenRead); }
_ZN4absl12lts_2026052614flags_internal13MaskedPointer3SetEPFPvNS1_6FlagOpEPKvS3_S3_ES6_b:
  188|      2|void MaskedPointer::Set(FlagOpFn op, const void* src, bool is_candidate) {
  189|      2|  flags_internal::Copy(op, src, Ptr());
  190|      2|  if (is_candidate) {
  ------------------
  |  Branch (190:7): [True: 2, False: 0]
  ------------------
  191|      2|    ApplyMask(kUnprotectedReadCandidate);
  192|      2|  }
  193|      2|}
_ZN4absl12lts_2026052614flags_internal13MaskedPointer10MarkAsReadEv:
  194|     20|void MaskedPointer::MarkAsRead() { ApplyMask(kHasBeenRead); }
_ZN4absl12lts_2026052614flags_internal13MaskedPointer9ApplyMaskEm:
  196|     42|void MaskedPointer::ApplyMask(mask_t mask) {
  197|     42|  ptr_ = reinterpret_cast<ptr_t>(reinterpret_cast<mask_t>(ptr_) | mask);
  198|     42|}
_ZNK4absl12lts_2026052614flags_internal13MaskedPointer9CheckMaskEm:
  199|     44|bool MaskedPointer::CheckMask(mask_t mask) const {
  200|     44|  return (reinterpret_cast<mask_t>(ptr_) & mask) != 0;
  201|     44|}
_ZN4absl12lts_2026052614flags_internal8FlagImpl4InitEv:
  203|     48|void FlagImpl::Init() {
  204|     48|  new (&data_guard_) absl::Mutex;
  205|       |
  206|     48|  auto def_kind = static_cast<FlagDefaultKind>(def_kind_);
  207|       |
  208|     48|  switch (ValueStorageKind()) {
  ------------------
  |  Branch (208:11): [True: 48, False: 0]
  ------------------
  209|     12|    case FlagValueStorageKind::kValueAndInitBit:
  ------------------
  |  Branch (209:5): [True: 12, False: 36]
  ------------------
  210|     16|    case FlagValueStorageKind::kOneWordAtomic: {
  ------------------
  |  Branch (210:5): [True: 4, False: 44]
  ------------------
  211|     16|      alignas(int64_t) std::array<char, sizeof(int64_t)> buf{};
  212|     16|      if (def_kind == FlagDefaultKind::kGenFunc) {
  ------------------
  |  Branch (212:11): [True: 2, False: 14]
  ------------------
  213|      2|        (*default_value_.gen_func)(buf.data());
  214|     14|      } else {
  215|     14|        assert(def_kind != FlagDefaultKind::kDynamicValue);
  216|     14|        std::memcpy(buf.data(), &default_value_, Sizeof(op_));
  217|     14|      }
  218|     16|      if (ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit) {
  ------------------
  |  Branch (218:11): [True: 12, False: 4]
  ------------------
  219|       |        // We presume here the memory layout of FlagValueAndInitBit struct.
  220|     12|        uint8_t initialized = 1;
  221|     12|        std::memcpy(buf.data() + Sizeof(op_), &initialized,
  222|     12|                    sizeof(initialized));
  223|     12|      }
  224|       |      // Type can contain valid uninitialized bits, e.g. padding.
  225|     16|      ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(buf.data(), buf.size());
  226|     16|      OneWordValue().store(absl::bit_cast<int64_t>(buf),
  227|     16|                           std::memory_order_release);
  228|     16|      break;
  229|     12|    }
  230|     12|    case FlagValueStorageKind::kSequenceLocked: {
  ------------------
  |  Branch (230:5): [True: 12, False: 36]
  ------------------
  231|       |      // For this storage kind the default_value_ always points to gen_func
  232|       |      // during initialization.
  233|     12|      assert(def_kind == FlagDefaultKind::kGenFunc);
  234|     12|      (*default_value_.gen_func)(AtomicBufferValue());
  235|     12|      break;
  236|     12|    }
  237|     20|    case FlagValueStorageKind::kHeapAllocated:
  ------------------
  |  Branch (237:5): [True: 20, False: 28]
  ------------------
  238|       |      // For this storage kind the default_value_ always points to gen_func
  239|       |      // during initialization.
  240|     20|      assert(def_kind == FlagDefaultKind::kGenFunc);
  241|       |      // Flag value initially points to the internal buffer.
  242|     20|      MaskedPointer ptr_value = PtrStorage().load(std::memory_order_acquire);
  243|     20|      (*default_value_.gen_func)(ptr_value.Ptr());
  244|       |      // Default value is a candidate for an unprotected read.
  245|     20|      PtrStorage().store(MaskedPointer(ptr_value.Ptr(), true),
  246|     20|                         std::memory_order_release);
  247|     20|      break;
  248|     48|  }
  249|     48|  seq_lock_.MarkInitialized();
  250|     48|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl9DataGuardEv:
  252|     74|absl::Mutex& FlagImpl::DataGuard() const {
  253|     74|  absl::call_once(const_cast<FlagImpl*>(this)->init_control_, &FlagImpl::Init,
  254|     74|                  const_cast<FlagImpl*>(this));
  255|       |
  256|       |  // data_guard_ is initialized inside Init.
  257|     74|  return *reinterpret_cast<absl::Mutex*>(&data_guard_);
  258|     74|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl13MakeInitValueEv:
  285|      4|std::unique_ptr<void, DynValueDeleter> FlagImpl::MakeInitValue() const {
  286|      4|  void* res = nullptr;
  287|      4|  switch (DefaultKind()) {
  288|      0|    case FlagDefaultKind::kDynamicValue:
  ------------------
  |  Branch (288:5): [True: 0, False: 4]
  ------------------
  289|      0|      res = flags_internal::Clone(op_, default_value_.dynamic_value);
  290|      0|      break;
  291|      2|    case FlagDefaultKind::kGenFunc:
  ------------------
  |  Branch (291:5): [True: 2, False: 2]
  ------------------
  292|      2|      res = flags_internal::Alloc(op_);
  293|      2|      (*default_value_.gen_func)(res);
  294|      2|      break;
  295|      2|    default:
  ------------------
  |  Branch (295:5): [True: 2, False: 2]
  ------------------
  296|      2|      res = flags_internal::Clone(op_, &default_value_);
  297|      2|      break;
  298|      4|  }
  299|      4|  return {res, DynValueDeleter{op_}};
  300|      4|}
_ZN4absl12lts_2026052614flags_internal8FlagImpl10StoreValueEPKvNS1_11ValueSourceE:
  302|      4|void FlagImpl::StoreValue(const void* src, ValueSource source) {
  303|      4|  switch (ValueStorageKind()) {
  ------------------
  |  Branch (303:11): [True: 4, False: 0]
  ------------------
  304|      0|    case FlagValueStorageKind::kValueAndInitBit:
  ------------------
  |  Branch (304:5): [True: 0, False: 4]
  ------------------
  305|      2|    case FlagValueStorageKind::kOneWordAtomic: {
  ------------------
  |  Branch (305:5): [True: 2, False: 2]
  ------------------
  306|       |      // Load the current value to avoid setting 'init' bit manually.
  307|      2|      int64_t one_word_val = OneWordValue().load(std::memory_order_acquire);
  308|      2|      std::memcpy(&one_word_val, src, Sizeof(op_));
  309|      2|      OneWordValue().store(one_word_val, std::memory_order_release);
  310|      2|      seq_lock_.IncrementModificationCount();
  311|      2|      break;
  312|      0|    }
  313|      0|    case FlagValueStorageKind::kSequenceLocked: {
  ------------------
  |  Branch (313:5): [True: 0, False: 4]
  ------------------
  314|      0|      seq_lock_.Write(AtomicBufferValue(), src, Sizeof(op_));
  315|      0|      break;
  316|      0|    }
  317|      2|    case FlagValueStorageKind::kHeapAllocated:
  ------------------
  |  Branch (317:5): [True: 2, False: 2]
  ------------------
  318|      2|      MaskedPointer ptr_value = PtrStorage().load(std::memory_order_acquire);
  319|       |
  320|      2|      if (ptr_value.IsUnprotectedReadCandidate() && ptr_value.HasBeenRead()) {
  ------------------
  |  Branch (320:11): [True: 2, False: 0]
  |  Branch (320:53): [True: 0, False: 2]
  ------------------
  321|       |        // If current value is a candidate for an unprotected read and if it was
  322|       |        // already read at least once, follow up reads (if any) are done without
  323|       |        // mutex protection. We can't guarantee it is safe to reuse this memory
  324|       |        // since it may have been accessed by another thread concurrently, so
  325|       |        // instead we move the memory to a freelist so it can still be safely
  326|       |        // accessed, and allocate a new one for the new value.
  327|      0|        AddToFreelist(ptr_value.Ptr());
  328|      0|        ptr_value = MaskedPointer(Clone(op_, src), source == kCommandLine);
  329|      2|      } else {
  330|       |        // Current value either was set programmatically or was never read.
  331|       |        // We can reuse the memory since all accesses to this value (if any)
  332|       |        // were protected by mutex. That said, if a new value comes from command
  333|       |        // line it now becomes a candidate for an unprotected read.
  334|      2|        ptr_value.Set(op_, src, source == kCommandLine);
  335|      2|      }
  336|       |
  337|      2|      PtrStorage().store(ptr_value, std::memory_order_release);
  338|      2|      seq_lock_.IncrementModificationCount();
  339|      2|      break;
  340|      4|  }
  341|      4|  modified_ = true;
  342|      4|  InvokeCallback();
  343|      4|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl4NameEv:
  345|    598|absl::string_view FlagImpl::Name() const { return name_; }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl8FilenameEv:
  349|     50|std::string FlagImpl::Filename() const {
  350|     50|  return flags_internal::GetUsageConfig().normalize_filename(filename_);
  351|     50|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl6TypeIdEv:
  358|      4|FlagFastTypeId FlagImpl::TypeId() const {
  359|      4|  return flags_internal::FastTypeId(op_);
  360|      4|}
_ZN4absl12lts_2026052614flags_internal8FlagImpl11SetCallbackEPFvvE:
  404|     14|void FlagImpl::SetCallback(const FlagCallbackFunc mutation_callback) {
  405|     14|  absl::MutexLock l(DataGuard());
  406|       |
  407|     14|  if (callback_ == nullptr) {
  ------------------
  |  Branch (407:7): [True: 14, False: 0]
  ------------------
  408|     14|    callback_ = new FlagCallback;
  409|     14|  }
  410|     14|  callback_->func = mutation_callback;
  411|       |
  412|     14|  InvokeCallback();
  413|     14|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl14InvokeCallbackEv:
  415|     18|void FlagImpl::InvokeCallback() const {
  416|     18|  if (!callback_) return;
  ------------------
  |  Branch (416:7): [True: 4, False: 14]
  ------------------
  417|       |
  418|       |  // Make a copy of the C-style function pointer that we are about to invoke
  419|       |  // before we release the lock guarding it.
  420|     14|  FlagCallbackFunc cb = callback_->func;
  421|       |
  422|       |  // If the flag has a mutation callback this function invokes it. While the
  423|       |  // callback is being invoked the primary flag's mutex is unlocked and it is
  424|       |  // re-locked back after call to callback is completed. Callback invocation is
  425|       |  // guarded by flag's secondary mutex instead which prevents concurrent
  426|       |  // callback invocation. Note that it is possible for other thread to grab the
  427|       |  // primary lock and update flag's value at any time during the callback
  428|       |  // invocation. This is by design. Callback can get a value of the flag if
  429|       |  // necessary, but it might be different from the value initiated the callback
  430|       |  // and it also can be different by the time the callback invocation is
  431|       |  // completed. Requires that *primary_lock be held in exclusive mode; it may be
  432|       |  // released and reacquired by the implementation.
  433|     14|  MutexRelock relock(DataGuard());
  434|     14|  absl::MutexLock lock(callback_->guard);
  435|     14|  cb();
  436|     14|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl17AtomicBufferValueEv:
  503|     22|std::atomic<uint64_t>* FlagImpl::AtomicBufferValue() const {
  504|       |  assert(ValueStorageKind() == FlagValueStorageKind::kSequenceLocked);
  505|     22|  return OffsetValue<std::atomic<uint64_t>>();
  506|     22|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl12OneWordValueEv:
  508|     32|std::atomic<int64_t>& FlagImpl::OneWordValue() const {
  509|       |  assert(ValueStorageKind() == FlagValueStorageKind::kOneWordAtomic ||
  510|     32|         ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
  511|     32|  return OffsetValue<FlagOneWordValue>()->value;
  512|     32|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl10PtrStorageEv:
  514|     84|std::atomic<MaskedPointer>& FlagImpl::PtrStorage() const {
  515|       |  assert(ValueStorageKind() == FlagValueStorageKind::kHeapAllocated);
  516|     84|  return OffsetValue<FlagMaskedPointerValue>()->value;
  517|     84|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl8TryParseENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERNS3_12basic_stringIcS6_NS3_9allocatorIcEEEE:
  524|      4|    absl::string_view value, std::string& err) const {
  525|      4|  std::unique_ptr<void, DynValueDeleter> tentative_value = MakeInitValue();
  526|       |
  527|      4|  std::string parse_err;
  528|      4|  if (!flags_internal::Parse(op_, value, tentative_value.get(), &parse_err)) {
  ------------------
  |  Branch (528:7): [True: 0, False: 4]
  ------------------
  529|      0|    absl::string_view err_sep = parse_err.empty() ? "" : "; ";
  ------------------
  |  Branch (529:33): [True: 0, False: 0]
  ------------------
  530|      0|    err = absl::StrCat("Illegal value '", value, "' specified for flag '",
  531|      0|                       Name(), "'", err_sep, parse_err);
  532|      0|    return nullptr;
  533|      0|  }
  534|       |
  535|      4|  return tentative_value;
  536|      4|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl4ReadEPv:
  538|     30|void FlagImpl::Read(void* dst) const {
  539|     30|  auto& guard = DataGuard();  // Make sure flag initialized
  540|     30|  switch (ValueStorageKind()) {
  ------------------
  |  Branch (540:11): [True: 30, False: 0]
  ------------------
  541|      0|    case FlagValueStorageKind::kValueAndInitBit:
  ------------------
  |  Branch (541:5): [True: 0, False: 30]
  ------------------
  542|      0|    case FlagValueStorageKind::kOneWordAtomic: {
  ------------------
  |  Branch (542:5): [True: 0, False: 30]
  ------------------
  543|      0|      const int64_t one_word_val =
  544|      0|          OneWordValue().load(std::memory_order_acquire);
  545|      0|      std::memcpy(dst, &one_word_val, Sizeof(op_));
  546|      0|      break;
  547|      0|    }
  548|     10|    case FlagValueStorageKind::kSequenceLocked: {
  ------------------
  |  Branch (548:5): [True: 10, False: 20]
  ------------------
  549|     10|      ReadSequenceLockedData(dst);
  550|     10|      break;
  551|      0|    }
  552|     20|    case FlagValueStorageKind::kHeapAllocated: {
  ------------------
  |  Branch (552:5): [True: 20, False: 10]
  ------------------
  553|     20|      absl::MutexLock l(guard);
  554|     20|      MaskedPointer ptr_value = PtrStorage().load(std::memory_order_acquire);
  555|       |
  556|     20|      flags_internal::CopyConstruct(op_, ptr_value.Ptr(), dst);
  557|       |
  558|       |      // For unprotected read candidates, mark that the value as has been read.
  559|     20|      if (ptr_value.IsUnprotectedReadCandidate() && !ptr_value.HasBeenRead()) {
  ------------------
  |  Branch (559:11): [True: 20, False: 0]
  |  Branch (559:53): [True: 20, False: 0]
  ------------------
  560|     20|        ptr_value.MarkAsRead();
  561|     20|        PtrStorage().store(ptr_value, std::memory_order_release);
  562|     20|      }
  563|     20|      break;
  564|      0|    }
  565|     30|  }
  566|     30|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11ReadOneWordEv:
  568|      4|int64_t FlagImpl::ReadOneWord() const {
  569|       |  assert(ValueStorageKind() == FlagValueStorageKind::kOneWordAtomic ||
  570|      4|         ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
  571|      4|  auto& guard = DataGuard();  // Make sure flag initialized
  572|      4|  (void)guard;
  573|      4|  return OneWordValue().load(std::memory_order_acquire);
  574|      4|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11ReadOneBoolEv:
  576|      8|bool FlagImpl::ReadOneBool() const {
  577|       |  assert(ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
  578|      8|  auto& guard = DataGuard();  // Make sure flag initialized
  579|      8|  (void)guard;
  580|      8|  return absl::bit_cast<FlagValueAndInitBit<bool>>(
  581|      8|             OneWordValue().load(std::memory_order_acquire))
  582|      8|      .value;
  583|      8|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl22ReadSequenceLockedDataEPv:
  585|     10|void FlagImpl::ReadSequenceLockedData(void* dst) const {
  586|     10|  size_t size = Sizeof(op_);
  587|       |  // Attempt to read using the sequence lock.
  588|     10|  if (ABSL_PREDICT_TRUE(seq_lock_.TryRead(dst, AtomicBufferValue(), size))) {
  ------------------
  |  |  191|     10|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 10, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 10]
  |  |  |  Branch (191:57): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  589|     10|    return;
  590|     10|  }
  591|       |  // We failed due to contention. Acquire the lock to prevent contention
  592|       |  // and try again.
  593|      0|  absl::ReaderMutexLock l(DataGuard());
  594|      0|  bool success = seq_lock_.TryRead(dst, AtomicBufferValue(), size);
  595|       |  assert(success);
  596|      0|  static_cast<void>(success);
  597|      0|}
_ZN4absl12lts_2026052614flags_internal8FlagImpl9ParseFromENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEENS1_15FlagSettingModeENS1_11ValueSourceERNS3_12basic_stringIcS6_NS3_9allocatorIcEEEE:
  625|      4|                         ValueSource source, std::string& err) {
  626|      4|  absl::MutexLock l(DataGuard());
  627|       |
  628|      4|  switch (set_mode) {
  ------------------
  |  Branch (628:11): [True: 4, False: 0]
  ------------------
  629|      4|    case SET_FLAGS_VALUE: {
  ------------------
  |  Branch (629:5): [True: 4, False: 0]
  ------------------
  630|       |      // set or modify the flag's value
  631|      4|      auto tentative_value = TryParse(value, err);
  632|      4|      if (!tentative_value) return false;
  ------------------
  |  Branch (632:11): [True: 0, False: 4]
  ------------------
  633|       |
  634|      4|      StoreValue(tentative_value.get(), source);
  635|       |
  636|      4|      if (source == kCommandLine) {
  ------------------
  |  Branch (636:11): [True: 4, False: 0]
  ------------------
  637|      4|        on_command_line_ = true;
  638|      4|      }
  639|      4|      break;
  640|      4|    }
  641|      0|    case SET_FLAG_IF_DEFAULT: {
  ------------------
  |  Branch (641:5): [True: 0, False: 4]
  ------------------
  642|       |      // set the flag's value, but only if it hasn't been set by someone else
  643|      0|      if (modified_) {
  ------------------
  |  Branch (643:11): [True: 0, False: 0]
  ------------------
  644|       |        // TODO(rogeeff): review and fix this semantic. Currently we do not fail
  645|       |        // in this case if flag is modified. This is misleading since the flag's
  646|       |        // value is not updated even though we return true.
  647|       |        // *err = absl::StrCat(Name(), " is already set to ",
  648|       |        //                     CurrentValue(), "\n");
  649|       |        // return false;
  650|      0|        return true;
  651|      0|      }
  652|      0|      auto tentative_value = TryParse(value, err);
  653|      0|      if (!tentative_value) return false;
  ------------------
  |  Branch (653:11): [True: 0, False: 0]
  ------------------
  654|       |
  655|      0|      StoreValue(tentative_value.get(), source);
  656|      0|      break;
  657|      0|    }
  658|      0|    case SET_FLAGS_DEFAULT: {
  ------------------
  |  Branch (658:5): [True: 0, False: 4]
  ------------------
  659|      0|      auto tentative_value = TryParse(value, err);
  660|      0|      if (!tentative_value) return false;
  ------------------
  |  Branch (660:11): [True: 0, False: 0]
  ------------------
  661|       |
  662|      0|      if (DefaultKind() == FlagDefaultKind::kDynamicValue) {
  ------------------
  |  Branch (662:11): [True: 0, False: 0]
  ------------------
  663|      0|        void* old_value = default_value_.dynamic_value;
  664|      0|        default_value_.dynamic_value = tentative_value.release();
  665|      0|        tentative_value.reset(old_value);
  666|      0|      } else {
  667|      0|        default_value_.dynamic_value = tentative_value.release();
  668|      0|        def_kind_ = static_cast<uint8_t>(FlagDefaultKind::kDynamicValue);
  669|      0|      }
  670|       |
  671|      0|      if (!modified_) {
  ------------------
  |  Branch (671:11): [True: 0, False: 0]
  ------------------
  672|       |        // Need to set both default value *and* current, in this case.
  673|      0|        StoreValue(default_value_.dynamic_value, source);
  674|      0|        modified_ = false;
  675|      0|      }
  676|      0|      break;
  677|      0|    }
  678|      4|  }
  679|       |
  680|      4|  return true;
  681|      4|}
flag.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_111MutexRelockC2ERNS0_5MutexE:
   77|     14|  explicit MutexRelock(absl::Mutex& mu) : mu_(mu) { mu_.unlock(); }
flag.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_111MutexRelockD2Ev:
   78|     14|  ~MutexRelock() { mu_.lock(); }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11OffsetValueINSt3__16atomicImEEEEPT_v:
  495|     22|StorageT* FlagImpl::OffsetValue() const {
  496|     22|  char* p = reinterpret_cast<char*>(const_cast<FlagImpl*>(this));
  497|       |  // The offset is deduced via Flag value type specific op_.
  498|     22|  ptrdiff_t offset = flags_internal::ValueOffset(op_);
  499|       |
  500|     22|  return reinterpret_cast<StorageT*>(p + offset);
  501|     22|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11OffsetValueINS1_16FlagOneWordValueEEEPT_v:
  495|     32|StorageT* FlagImpl::OffsetValue() const {
  496|     32|  char* p = reinterpret_cast<char*>(const_cast<FlagImpl*>(this));
  497|       |  // The offset is deduced via Flag value type specific op_.
  498|     32|  ptrdiff_t offset = flags_internal::ValueOffset(op_);
  499|       |
  500|     32|  return reinterpret_cast<StorageT*>(p + offset);
  501|     32|}
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11OffsetValueINS1_22FlagMaskedPointerValueEEEPT_v:
  495|     84|StorageT* FlagImpl::OffsetValue() const {
  496|     84|  char* p = reinterpret_cast<char*>(const_cast<FlagImpl*>(this));
  497|       |  // The offset is deduced via Flag value type specific op_.
  498|     84|  ptrdiff_t offset = flags_internal::ValueOffset(op_);
  499|       |
  500|     84|  return reinterpret_cast<StorageT*>(p + offset);
  501|     84|}

_ZN4absl12lts_2026052614flags_internal13FlagRegistrarIbLb1EEC2ERNS1_4FlagIbEEPKc:
  942|     10|      : flag_(flag) {
  943|     10|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 10, Folded]
  ------------------
  944|     10|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|     10|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarIbLb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|     10|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEET_SA_:
  276|      8|constexpr T InitDefaultValue(T t) {
  277|      8|  return t;
  278|      8|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELb1EEC2ERNS1_4FlagIS9_EEPKc:
  942|      6|      : flag_(flag) {
  943|      6|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 6, Folded]
  ------------------
  944|      6|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      6|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      6|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueINS0_8DurationEEET_S4_:
  276|     10|constexpr T InitDefaultValue(T t) {
  277|     10|  return t;
  278|     10|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarINS0_8DurationELb1EEC2ERNS1_4FlagIS3_EEPKc:
  942|     10|      : flag_(flag) {
  943|     10|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 10, Folded]
  ------------------
  944|     10|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|     10|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarINS0_8DurationELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|     10|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueIN8fuzztest8internal14TimeBudgetTypeEEET_S6_:
  276|      2|constexpr T InitDefaultValue(T t) {
  277|      2|  return t;
  278|      2|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarIN8fuzztest8internal14TimeBudgetTypeELb1EEC2ERNS1_4FlagIS5_EEPKc:
  942|      2|      : flag_(flag) {
  943|      2|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 2, Folded]
  ------------------
  944|      2|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      2|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarIN8fuzztest8internal14TimeBudgetTypeELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      2|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEET_SC_:
  276|      8|constexpr T InitDefaultValue(T t) {
  277|      8|  return t;
  278|      8|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEELb1EEC2ERNS1_4FlagISB_EEPKc:
  942|      8|      : flag_(flag) {
  943|      8|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 8, Folded]
  ------------------
  944|      8|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      8|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      8|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarImLb1EEC2ERNS1_4FlagImEEPKc:
  942|      4|      : flag_(flag) {
  943|      4|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 4, Folded]
  ------------------
  944|      4|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      4|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarImLb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      4|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueINSt3__18optionalImEEEET_S6_:
  276|      2|constexpr T InitDefaultValue(T t) {
  277|      2|  return t;
  278|      2|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__18optionalImEELb1EEC2ERNS1_4FlagIS5_EEPKc:
  942|      2|      : flag_(flag) {
  943|      2|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 2, Folded]
  ------------------
  944|      2|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      2|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__18optionalImEELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      2|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetINSt3__18optionalINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEENS1_4FlagISC_EEEET_RKT0_:
  860|     14|  static T InvokeGet(const FlagType& flag) {
  861|     14|    return flag.Get();
  862|     14|  }
_ZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEE3GetEv:
  820|     14|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|     14|    union U {
  823|     14|      T value;
  824|     14|      U() {}
  825|     14|      ~U() { value.~T(); }
  826|     14|    };
  827|     14|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|     14|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|     14|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 8, False: 6]
  |  |  |  Branch (190:49): [Folded, False: 14]
  |  |  |  Branch (190:58): [True: 8, False: 6]
  |  |  ------------------
  ------------------
  834|      8|      impl_.Read(&u.value);
  835|      8|    }
  836|     14|    return std::move(u.value);
  837|     14|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEE3GetEvEN1UC2Ev:
  824|     14|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEELNS1_20FlagValueStorageKindE3EE3GetERKNS1_12SequenceLockERSB_:
  536|     14|  bool Get(const SequenceLock&, T& dst) const {
  537|     14|    MaskedPointer ptr_value = value.load(std::memory_order_acquire);
  538|       |
  539|     14|    if (ABSL_PREDICT_TRUE(ptr_value.AllowsUnprotectedRead())) {
  ------------------
  |  |  191|     14|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 6, False: 8]
  |  |  |  Branch (191:48): [Folded, False: 14]
  |  |  |  Branch (191:57): [True: 6, False: 8]
  |  |  ------------------
  ------------------
  540|      6|      ::new (static_cast<void*>(&dst)) T(*static_cast<T*>(ptr_value.Ptr()));
  541|      6|      return true;
  542|      6|    }
  543|      8|    return false;
  544|     14|  }
_ZNK4absl12lts_2026052614flags_internal13MaskedPointer21AllowsUnprotectedReadEv:
  387|     40|  bool AllowsUnprotectedRead() const {
  388|     40|    return (reinterpret_cast<mask_t>(ptr_) & kAllowsUnprotectedRead) ==
  389|     40|           kAllowsUnprotectedRead;
  390|     40|  }
_ZNK4absl12lts_2026052614flags_internal13MaskedPointer3PtrEv:
  383|     82|  void* Ptr() const {
  384|     82|    return reinterpret_cast<void*>(reinterpret_cast<mask_t>(ptr_) &
  385|     82|                                   kPtrValueMask);
  386|     82|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEE3GetEvEN1UD2Ev:
  825|     14|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetINS0_8DurationENS1_4FlagIS4_EEEET_RKT0_:
  860|     14|  static T InvokeGet(const FlagType& flag) {
  861|     14|    return flag.Get();
  862|     14|  }
_ZNK4absl12lts_2026052614flags_internal4FlagINS0_8DurationEE3GetEv:
  820|     14|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|     14|    union U {
  823|     14|      T value;
  824|     14|      U() {}
  825|     14|      ~U() { value.~T(); }
  826|     14|    };
  827|     14|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|     14|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|     14|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 8, False: 6]
  |  |  |  Branch (190:49): [Folded, False: 14]
  |  |  |  Branch (190:58): [True: 8, False: 6]
  |  |  ------------------
  ------------------
  834|      8|      impl_.Read(&u.value);
  835|      8|    }
  836|     14|    return std::move(u.value);
  837|     14|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINS0_8DurationEE3GetEvEN1UC2Ev:
  824|     14|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueINS0_8DurationELNS1_20FlagValueStorageKindE2EE3GetERKNS1_12SequenceLockERS3_:
  481|     14|  bool Get(const SequenceLock& lock, T& dst) const {
  482|     14|    return lock.TryRead(&dst, value_words, sizeof(T));
  483|     14|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINS0_8DurationEE3GetEvEN1UD2Ev:
  825|     14|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetIN8fuzztest8internal14TimeBudgetTypeENS1_4FlagIS6_EEEET_RKT0_:
  860|      2|  static T InvokeGet(const FlagType& flag) {
  861|      2|    return flag.Get();
  862|      2|  }
_ZNK4absl12lts_2026052614flags_internal4FlagIN8fuzztest8internal14TimeBudgetTypeEE3GetEv:
  820|      2|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|      2|    union U {
  823|      2|      T value;
  824|      2|      U() {}
  825|      2|      ~U() { value.~T(); }
  826|      2|    };
  827|      2|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|      2|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  834|      2|      impl_.Read(&u.value);
  835|      2|    }
  836|      2|    return std::move(u.value);
  837|      2|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagIN8fuzztest8internal14TimeBudgetTypeEE3GetEvEN1UC2Ev:
  824|      2|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueIN8fuzztest8internal14TimeBudgetTypeELNS1_20FlagValueStorageKindE0EE3GetERKNS1_12SequenceLockERS5_:
  442|      2|  bool Get(const SequenceLock&, T& dst) const {
  443|      2|    int64_t storage = value.load(std::memory_order_acquire);
  444|      2|    if (ABSL_PREDICT_FALSE(storage == 0)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  445|       |      // This assert is to ensure that the initialization inside FlagImpl::Init
  446|       |      // is able to set init member correctly.
  447|      2|      static_assert(offsetof(FlagValueAndInitBit<T>, init) == sizeof(T),
  448|      2|                    "Unexpected memory layout of FlagValueAndInitBit");
  449|      2|      return false;
  450|      2|    }
  451|      0|    dst = absl::bit_cast<FlagValueAndInitBit<T>>(storage).value;
  452|      0|    return true;
  453|      2|  }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl4ReadIN8fuzztest8internal14TimeBudgetTypeETnNSt3__19enable_ifIXeqclsr14flags_internalE11StorageKindIT_EELNS1_20FlagValueStorageKindE0EEiE4typeELi0EEEvPS9_:
  622|      2|  void Read(T* value) const ABSL_LOCKS_EXCLUDED(DataGuard()) {
  623|      2|    *value = absl::bit_cast<FlagValueAndInitBit<T>>(ReadOneWord()).value;
  624|      2|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagIN8fuzztest8internal14TimeBudgetTypeEE3GetEvEN1UD2Ev:
  825|      2|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetINSt3__18optionalImEENS1_4FlagIS6_EEEET_RKT0_:
  860|      2|  static T InvokeGet(const FlagType& flag) {
  861|      2|    return flag.Get();
  862|      2|  }
_ZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalImEEE3GetEv:
  820|      2|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|      2|    union U {
  823|      2|      T value;
  824|      2|      U() {}
  825|      2|      ~U() { value.~T(); }
  826|      2|    };
  827|      2|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|      2|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  834|      2|      impl_.Read(&u.value);
  835|      2|    }
  836|      2|    return std::move(u.value);
  837|      2|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalImEEE3GetEvEN1UC2Ev:
  824|      2|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueINSt3__18optionalImEELNS1_20FlagValueStorageKindE2EE3GetERKNS1_12SequenceLockERS5_:
  481|      2|  bool Get(const SequenceLock& lock, T& dst) const {
  482|      2|    return lock.TryRead(&dst, value_words, sizeof(T));
  483|      2|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__18optionalImEEE3GetEvEN1UD2Ev:
  825|      2|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetImNS1_4FlagImEEEET_RKT0_:
  860|      4|  static T InvokeGet(const FlagType& flag) {
  861|      4|    return flag.Get();
  862|      4|  }
_ZNK4absl12lts_2026052614flags_internal4FlagImE3GetEv:
  820|      4|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|      4|    union U {
  823|      4|      T value;
  824|      4|      U() {}
  825|      4|      ~U() { value.~T(); }
  826|      4|    };
  827|      4|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|      4|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|      4|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 4]
  |  |  |  Branch (190:58): [True: 2, False: 2]
  |  |  ------------------
  ------------------
  834|      2|      impl_.Read(&u.value);
  835|      2|    }
  836|      4|    return std::move(u.value);
  837|      4|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagImE3GetEvEN1UC2Ev:
  824|      4|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueImLNS1_20FlagValueStorageKindE1EE3GetERKNS1_12SequenceLockERm:
  463|      4|  bool Get(const SequenceLock&, T& dst) const {
  464|      4|    int64_t one_word_val = value.load(std::memory_order_acquire);
  465|      4|    if (ABSL_PREDICT_FALSE(one_word_val == FlagOneWordValue::Uninitialized())) {
  ------------------
  |  |  190|      4|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 4]
  |  |  |  Branch (190:58): [True: 2, False: 2]
  |  |  ------------------
  ------------------
  466|      2|      return false;
  467|      2|    }
  468|      2|    std::memcpy(&dst, static_cast<const void*>(&one_word_val), sizeof(T));
  469|      2|    return true;
  470|      4|  }
_ZN4absl12lts_2026052614flags_internal16FlagOneWordValue13UninitializedEv:
  342|      4|  constexpr static int64_t Uninitialized() {
  343|      4|    return static_cast<int64_t>(0xababababababababll);
  344|      4|  }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl4ReadImTnNSt3__19enable_ifIXeqclsr14flags_internalE11StorageKindIT_EELNS1_20FlagValueStorageKindE1EEiE4typeELi0EEEvPS6_:
  614|      2|  void Read(T* value) const ABSL_LOCKS_EXCLUDED(DataGuard()) {
  615|      2|    int64_t v = ReadOneWord();
  616|      2|    std::memcpy(value, static_cast<const void*>(&v), sizeof(T));
  617|      2|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagImE3GetEvEN1UD2Ev:
  825|      4|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal7FlagOpsIbEEPvNS1_6FlagOpEPKvS3_S3_:
  876|     38|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     38|  struct AlignedSpace {
  878|     38|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     38|        T) unsigned char buf[sizeof(T)];
  880|     38|  };
  881|     38|  using Allocator = std::allocator<AlignedSpace>;
  882|     38|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 38, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 38]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 38]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 38]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      0|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 0, False: 38]
  ------------------
  899|      0|      new (v2) T(*static_cast<const T*>(v1));
  900|      0|      return nullptr;
  901|     20|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 20, False: 18]
  ------------------
  902|     20|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 38]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 38]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 38]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 38]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     18|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 18, False: 20]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     18|      size_t round_to = alignof(FlagValue<T>);
  926|     18|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     18|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|     38|  }
  930|      0|  return nullptr;
  931|     38|}
_ZNO4absl12lts_2026052614flags_internal13FlagRegistrarIbLb1EE8OnUpdateEPFvvE:
  947|      2|  FlagRegistrar OnUpdate(FlagCallbackFunc cb) && {
  948|      2|    flag_.impl_.SetCallback(cb);
  949|      2|    return *this;
  950|      2|  }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetIbNS1_4FlagIbEEEET_RKT0_:
  860|     12|  static T InvokeGet(const FlagType& flag) {
  861|     12|    return flag.Get();
  862|     12|  }
_ZNK4absl12lts_2026052614flags_internal4FlagIbE3GetEv:
  820|     12|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|     12|    union U {
  823|     12|      T value;
  824|     12|      U() {}
  825|     12|      ~U() { value.~T(); }
  826|     12|    };
  827|     12|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|     12|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|     12|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 8, False: 4]
  |  |  |  Branch (190:49): [Folded, False: 12]
  |  |  |  Branch (190:58): [True: 8, False: 4]
  |  |  ------------------
  ------------------
  834|      8|      impl_.Read(&u.value);
  835|      8|    }
  836|     12|    return std::move(u.value);
  837|     12|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagIbE3GetEvEN1UC2Ev:
  824|     12|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueIbLNS1_20FlagValueStorageKindE0EE3GetERKNS1_12SequenceLockERb:
  442|     12|  bool Get(const SequenceLock&, T& dst) const {
  443|     12|    int64_t storage = value.load(std::memory_order_acquire);
  444|     12|    if (ABSL_PREDICT_FALSE(storage == 0)) {
  ------------------
  |  |  190|     12|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 8, False: 4]
  |  |  |  Branch (190:49): [Folded, False: 12]
  |  |  |  Branch (190:58): [True: 8, False: 4]
  |  |  ------------------
  ------------------
  445|       |      // This assert is to ensure that the initialization inside FlagImpl::Init
  446|       |      // is able to set init member correctly.
  447|      8|      static_assert(offsetof(FlagValueAndInitBit<T>, init) == sizeof(T),
  448|      8|                    "Unexpected memory layout of FlagValueAndInitBit");
  449|      8|      return false;
  450|      8|    }
  451|      4|    dst = absl::bit_cast<FlagValueAndInitBit<T>>(storage).value;
  452|      4|    return true;
  453|     12|  }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl4ReadEPb:
  607|      8|  void Read(bool* value) const ABSL_LOCKS_EXCLUDED(DataGuard()) {
  608|      8|    *value = ReadOneBool();
  609|      8|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagIbE3GetEvEN1UD2Ev:
  825|     12|      ~U() { value.~T(); }
_ZN4absl12lts_2026052614flags_internal7FlagOpsINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEPvNS1_6FlagOpEPKvSA_SA_:
  876|     44|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     44|  struct AlignedSpace {
  878|     44|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     44|        T) unsigned char buf[sizeof(T)];
  880|     44|  };
  881|     44|  using Allocator = std::allocator<AlignedSpace>;
  882|     44|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 44, False: 0]
  ------------------
  883|      2|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 2, False: 42]
  ------------------
  884|      2|      Allocator alloc;
  885|      2|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      2|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 2, False: 42]
  ------------------
  888|      2|      T* p = static_cast<T*>(v2);
  889|      2|      p->~T();
  890|      2|      Allocator alloc;
  891|      2|      std::allocator_traits<Allocator>::deallocate(
  892|      2|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      2|      return nullptr;
  894|      0|    }
  895|      2|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 2, False: 42]
  ------------------
  896|      2|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      2|      return nullptr;
  898|      6|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 6, False: 38]
  ------------------
  899|      6|      new (v2) T(*static_cast<const T*>(v1));
  900|      6|      return nullptr;
  901|      0|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 0, False: 44]
  ------------------
  902|      0|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      2|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 2, False: 42]
  ------------------
  904|      2|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 44]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      2|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 2, False: 42]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      2|      T temp(*static_cast<T*>(v2));
  911|      2|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 2]
  ------------------
  912|      2|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      2|      *static_cast<T*>(v2) = std::move(temp);
  916|      2|      return v2;
  917|      2|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 44]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     28|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 28, False: 16]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     28|      size_t round_to = alignof(FlagValue<T>);
  926|     28|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     28|      return reinterpret_cast<void*>(offset);
  928|      2|    }
  929|     44|  }
  930|      0|  return nullptr;
  931|     44|}
_ZN4absl12lts_2026052614flags_internal7FlagOpsINS0_8DurationEEEPvNS1_6FlagOpEPKvS4_S4_:
  876|     26|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     26|  struct AlignedSpace {
  878|     26|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     26|        T) unsigned char buf[sizeof(T)];
  880|     26|  };
  881|     26|  using Allocator = std::allocator<AlignedSpace>;
  882|     26|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 26, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 26]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 26]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 26]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      0|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 0, False: 26]
  ------------------
  899|      0|      new (v2) T(*static_cast<const T*>(v1));
  900|      0|      return nullptr;
  901|      8|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 8, False: 18]
  ------------------
  902|      8|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 26]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 26]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 26]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 26]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     18|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 18, False: 8]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     18|      size_t round_to = alignof(FlagValue<T>);
  926|     18|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     18|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|     26|  }
  930|      0|  return nullptr;
  931|     26|}
_ZN4absl12lts_2026052614flags_internal7FlagOpsIN8fuzztest8internal14TimeBudgetTypeEEEPvNS1_6FlagOpEPKvS6_S6_:
  876|      6|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|      6|  struct AlignedSpace {
  878|      6|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|      6|        T) unsigned char buf[sizeof(T)];
  880|      6|  };
  881|      6|  using Allocator = std::allocator<AlignedSpace>;
  882|      6|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 6, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 6]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 6]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 6]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      0|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 0, False: 6]
  ------------------
  899|      0|      new (v2) T(*static_cast<const T*>(v1));
  900|      0|      return nullptr;
  901|      2|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 2, False: 4]
  ------------------
  902|      2|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 6]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 6]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 6]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 6]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|      4|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 4, False: 2]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|      4|      size_t round_to = alignof(FlagValue<T>);
  926|      4|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|      4|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|      6|  }
  930|      0|  return nullptr;
  931|      6|}
_ZN4absl12lts_2026052614flags_internal7FlagOpsINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEEPvNS1_6FlagOpEPKvSC_SC_:
  876|     40|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     40|  struct AlignedSpace {
  878|     40|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     40|        T) unsigned char buf[sizeof(T)];
  880|     40|  };
  881|     40|  using Allocator = std::allocator<AlignedSpace>;
  882|     40|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 40, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 40]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 40]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 40]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      8|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 8, False: 32]
  ------------------
  899|      8|      new (v2) T(*static_cast<const T*>(v1));
  900|      8|      return nullptr;
  901|      0|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 0, False: 40]
  ------------------
  902|      0|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 40]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 40]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 40]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 40]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     32|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 32, False: 8]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     32|      size_t round_to = alignof(FlagValue<T>);
  926|     32|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     32|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|     40|  }
  930|      0|  return nullptr;
  931|     40|}
_ZN4absl12lts_2026052614flags_internal7FlagOpsImEEPvNS1_6FlagOpEPKvS3_S3_:
  876|     26|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     26|  struct AlignedSpace {
  878|     26|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     26|        T) unsigned char buf[sizeof(T)];
  880|     26|  };
  881|     26|  using Allocator = std::allocator<AlignedSpace>;
  882|     26|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 26, False: 0]
  ------------------
  883|      2|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 2, False: 24]
  ------------------
  884|      2|      Allocator alloc;
  885|      2|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      2|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 2, False: 24]
  ------------------
  888|      2|      T* p = static_cast<T*>(v2);
  889|      2|      p->~T();
  890|      2|      Allocator alloc;
  891|      2|      std::allocator_traits<Allocator>::deallocate(
  892|      2|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      2|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 26]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      2|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 2, False: 24]
  ------------------
  899|      2|      new (v2) T(*static_cast<const T*>(v1));
  900|      2|      return nullptr;
  901|      6|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 6, False: 20]
  ------------------
  902|      6|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      2|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 2, False: 24]
  ------------------
  904|      2|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 26]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      2|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 2, False: 24]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      2|      T temp(*static_cast<T*>(v2));
  911|      2|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 2]
  ------------------
  912|      2|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      2|      *static_cast<T*>(v2) = std::move(temp);
  916|      2|      return v2;
  917|      2|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 26]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     10|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 10, False: 16]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     10|      size_t round_to = alignof(FlagValue<T>);
  926|     10|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     10|      return reinterpret_cast<void*>(offset);
  928|      2|    }
  929|     26|  }
  930|      0|  return nullptr;
  931|     26|}
_ZN4absl12lts_2026052614flags_internal7FlagOpsINSt3__18optionalImEEEEPvNS1_6FlagOpEPKvS6_S6_:
  876|      6|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|      6|  struct AlignedSpace {
  878|      6|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|      6|        T) unsigned char buf[sizeof(T)];
  880|      6|  };
  881|      6|  using Allocator = std::allocator<AlignedSpace>;
  882|      6|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 6, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 6]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 6]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 6]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      0|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 0, False: 6]
  ------------------
  899|      0|      new (v2) T(*static_cast<const T*>(v1));
  900|      0|      return nullptr;
  901|      2|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 2, False: 4]
  ------------------
  902|      2|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 6]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 6]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 6]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 6]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|      4|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 4, False: 2]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|      4|      size_t round_to = alignof(FlagValue<T>);
  926|      4|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|      4|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|      6|  }
  930|      0|  return nullptr;
  931|      6|}
_ZNO4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__18optionalINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEELb1EE8OnUpdateEPFvvE:
  947|      4|  FlagRegistrar OnUpdate(FlagCallbackFunc cb) && {
  948|      4|    flag_.impl_.SetCallback(cb);
  949|      4|    return *this;
  950|      4|  }
_ZNO4absl12lts_2026052614flags_internal13FlagRegistrarINS0_8DurationELb1EE8OnUpdateEPFvvE:
  947|      2|  FlagRegistrar OnUpdate(FlagCallbackFunc cb) && {
  948|      2|    flag_.impl_.SetCallback(cb);
  949|      2|    return *this;
  950|      2|  }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS1_4FlagISA_EEEET_RKT0_:
  860|     16|  static T InvokeGet(const FlagType& flag) {
  861|     16|    return flag.Get();
  862|     16|  }
_ZNK4absl12lts_2026052614flags_internal4FlagINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE3GetEv:
  820|     16|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|     16|    union U {
  823|     16|      T value;
  824|     16|      U() {}
  825|     16|      ~U() { value.~T(); }
  826|     16|    };
  827|     16|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|     16|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|     16|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 6, False: 10]
  |  |  |  Branch (190:49): [Folded, False: 16]
  |  |  |  Branch (190:58): [True: 6, False: 10]
  |  |  ------------------
  ------------------
  834|      6|      impl_.Read(&u.value);
  835|      6|    }
  836|     16|    return std::move(u.value);
  837|     16|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE3GetEvEN1UC2Ev:
  824|     16|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEELNS1_20FlagValueStorageKindE3EE3GetERKNS1_12SequenceLockERS9_:
  536|     16|  bool Get(const SequenceLock&, T& dst) const {
  537|     16|    MaskedPointer ptr_value = value.load(std::memory_order_acquire);
  538|       |
  539|     16|    if (ABSL_PREDICT_TRUE(ptr_value.AllowsUnprotectedRead())) {
  ------------------
  |  |  191|     16|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 10, False: 6]
  |  |  |  Branch (191:48): [Folded, False: 16]
  |  |  |  Branch (191:57): [True: 10, False: 6]
  |  |  ------------------
  ------------------
  540|     10|      ::new (static_cast<void*>(&dst)) T(*static_cast<T*>(ptr_value.Ptr()));
  541|     10|      return true;
  542|     10|    }
  543|      6|    return false;
  544|     16|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE3GetEvEN1UD2Ev:
  825|     16|      ~U() { value.~T(); }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl16ValueStorageKindEv:
  692|     98|  FlagValueStorageKind ValueStorageKind() const {
  693|     98|    return static_cast<FlagValueStorageKind>(value_storage_kind_);
  694|     98|  }
_ZNK4absl12lts_2026052614flags_internal8FlagImpl11DefaultKindEv:
  696|      4|      ABSL_EXCLUSIVE_LOCKS_REQUIRED(DataGuard()) {
  697|      4|    return static_cast<FlagDefaultKind>(def_kind_);
  698|      4|  }
_ZN4absl12lts_2026052614flags_internal5AllocEPFPvNS1_6FlagOpEPKvS2_S2_E:
   96|      4|inline void* Alloc(FlagOpFn op) {
   97|      4|  return op(FlagOp::kAlloc, nullptr, nullptr, nullptr);
   98|      4|}
_ZN4absl12lts_2026052614flags_internal6DeleteEPFPvNS1_6FlagOpEPKvS2_S2_ES2_:
  100|      4|inline void Delete(FlagOpFn op, void* obj) {
  101|      4|  op(FlagOp::kDelete, nullptr, obj, nullptr);
  102|      4|}
_ZN4absl12lts_2026052614flags_internal4CopyEPFPvNS1_6FlagOpEPKvS2_S2_ES5_S2_:
  104|      2|inline void Copy(FlagOpFn op, const void* src, void* dst) {
  105|      2|  op(FlagOp::kCopy, src, dst, nullptr);
  106|      2|}
_ZN4absl12lts_2026052614flags_internal13CopyConstructEPFPvNS1_6FlagOpEPKvS2_S2_ES5_S2_:
  109|     22|inline void CopyConstruct(FlagOpFn op, const void* src, void* dst) {
  110|     22|  op(FlagOp::kCopyConstruct, src, dst, nullptr);
  111|     22|}
_ZN4absl12lts_2026052614flags_internal5CloneEPFPvNS1_6FlagOpEPKvS2_S2_ES5_:
  113|      2|inline void* Clone(FlagOpFn op, const void* obj) {
  114|      2|  void* res = flags_internal::Alloc(op);
  115|      2|  flags_internal::CopyConstruct(op, obj, res);
  116|      2|  return res;
  117|      2|}
_ZN4absl12lts_2026052614flags_internal5ParseEPFPvNS1_6FlagOpEPKvS2_S2_ENSt3__117basic_string_viewIcNS8_11char_traitsIcEEEES2_PNS8_12basic_stringIcSB_NS8_9allocatorIcEEEE:
  120|      4|                  std::string* error) {
  121|      4|  return op(FlagOp::kParse, &text, dst, error) != nullptr;
  122|      4|}
_ZN4absl12lts_2026052614flags_internal6SizeofEPFPvNS1_6FlagOpEPKvS2_S2_E:
  130|     38|inline size_t Sizeof(FlagOpFn op) {
  131|       |  // This sequence of casts reverses the sequence from
  132|       |  // `flags_internal::FlagOps()`
  133|     38|  return static_cast<size_t>(reinterpret_cast<intptr_t>(
  134|     38|      op(FlagOp::kSizeof, nullptr, nullptr, nullptr)));
  135|     38|}
_ZN4absl12lts_2026052614flags_internal10FastTypeIdEPFPvNS1_6FlagOpEPKvS2_S2_E:
  137|      4|inline FlagFastTypeId FastTypeId(FlagOpFn op) {
  138|      4|  return absl::bit_cast<FlagFastTypeId>(
  139|      4|      op(FlagOp::kFastTypeId, nullptr, nullptr, nullptr));
  140|      4|}
_ZN4absl12lts_2026052614flags_internal11ValueOffsetEPFPvNS1_6FlagOpEPKvS2_S2_E:
  150|    138|inline ptrdiff_t ValueOffset(FlagOpFn op) {
  151|       |  // This sequence of casts reverses the sequence from
  152|       |  // `flags_internal::FlagOps()`
  153|    138|  return static_cast<ptrdiff_t>(reinterpret_cast<intptr_t>(
  154|    138|      op(FlagOp::kValueOffset, nullptr, nullptr, nullptr)));
  155|    138|}
_ZN4absl12lts_2026052614flags_internal16InitDefaultValueINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEEEET_NS1_11EmptyBracesE:
  281|      6|constexpr T InitDefaultValue(EmptyBraces) {
  282|      6|  return T{};
  283|      6|}
_ZN4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEELb1EEC2ERNS1_4FlagISC_EEPKc:
  942|      8|      : flag_(flag) {
  943|      8|    if (do_register)
  ------------------
  |  Branch (943:9): [True: 8, Folded]
  ------------------
  944|      8|      flags_internal::RegisterCommandLineFlag(flag_.impl_, filename);
  945|      8|  }
_ZNK4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEELb1EEcvNS1_18FlagRegistrarEmptyEEv:
  955|      8|  constexpr operator FlagRegistrarEmpty() const { return {}; }  // NOLINT
_ZN4absl12lts_2026052614flags_internal7FlagOpsINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEEEEPvNS1_6FlagOpEPKvSD_SD_:
  876|     30|void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
  877|     30|  struct AlignedSpace {
  878|     30|    alignas(MaskedPointer::RequiredAlignment()) alignas(
  879|     30|        T) unsigned char buf[sizeof(T)];
  880|     30|  };
  881|     30|  using Allocator = std::allocator<AlignedSpace>;
  882|     30|  switch (op) {
  ------------------
  |  Branch (882:11): [True: 30, False: 0]
  ------------------
  883|      0|    case FlagOp::kAlloc: {
  ------------------
  |  Branch (883:5): [True: 0, False: 30]
  ------------------
  884|      0|      Allocator alloc;
  885|      0|      return std::allocator_traits<Allocator>::allocate(alloc, 1);
  886|      0|    }
  887|      0|    case FlagOp::kDelete: {
  ------------------
  |  Branch (887:5): [True: 0, False: 30]
  ------------------
  888|      0|      T* p = static_cast<T*>(v2);
  889|      0|      p->~T();
  890|      0|      Allocator alloc;
  891|      0|      std::allocator_traits<Allocator>::deallocate(
  892|      0|          alloc, reinterpret_cast<AlignedSpace*>(p), 1);
  893|      0|      return nullptr;
  894|      0|    }
  895|      0|    case FlagOp::kCopy:
  ------------------
  |  Branch (895:5): [True: 0, False: 30]
  ------------------
  896|      0|      *static_cast<T*>(v2) = *static_cast<const T*>(v1);
  897|      0|      return nullptr;
  898|      6|    case FlagOp::kCopyConstruct:
  ------------------
  |  Branch (898:5): [True: 6, False: 24]
  ------------------
  899|      6|      new (v2) T(*static_cast<const T*>(v1));
  900|      6|      return nullptr;
  901|      0|    case FlagOp::kSizeof:
  ------------------
  |  Branch (901:5): [True: 0, False: 30]
  ------------------
  902|      0|      return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
  903|      0|    case FlagOp::kFastTypeId:
  ------------------
  |  Branch (903:5): [True: 0, False: 30]
  ------------------
  904|      0|      return absl::bit_cast<void*>(absl::FastTypeId<T>());
  905|      0|    case FlagOp::kRuntimeTypeId:
  ------------------
  |  Branch (905:5): [True: 0, False: 30]
  ------------------
  906|      0|      return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
  907|      0|    case FlagOp::kParse: {
  ------------------
  |  Branch (907:5): [True: 0, False: 30]
  ------------------
  908|       |      // Initialize the temporary instance of type T based on current value in
  909|       |      // destination (which is going to be flag's default value).
  910|      0|      T temp(*static_cast<T*>(v2));
  911|      0|      if (!absl::ParseFlag<T>(*static_cast<const absl::string_view*>(v1), &temp,
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|                              static_cast<std::string*>(v3))) {
  913|      0|        return nullptr;
  914|      0|      }
  915|      0|      *static_cast<T*>(v2) = std::move(temp);
  916|      0|      return v2;
  917|      0|    }
  918|      0|    case FlagOp::kUnparse:
  ------------------
  |  Branch (918:5): [True: 0, False: 30]
  ------------------
  919|      0|      *static_cast<std::string*>(v2) =
  920|      0|          absl::UnparseFlag<T>(*static_cast<const T*>(v1));
  921|      0|      return nullptr;
  922|     24|    case FlagOp::kValueOffset: {
  ------------------
  |  Branch (922:5): [True: 24, False: 6]
  ------------------
  923|       |      // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the
  924|       |      // offset of the data.
  925|     24|      size_t round_to = alignof(FlagValue<T>);
  926|     24|      size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to;
  927|     24|      return reinterpret_cast<void*>(offset);
  928|      0|    }
  929|     30|  }
  930|      0|  return nullptr;
  931|     30|}
_ZNO4absl12lts_2026052614flags_internal13FlagRegistrarINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEELb1EE8OnUpdateEPFvvE:
  947|      6|  FlagRegistrar OnUpdate(FlagCallbackFunc cb) && {
  948|      6|    flag_.impl_.SetCallback(cb);
  949|      6|    return *this;
  950|      6|  }
_ZN4absl12lts_2026052614flags_internal12FlagImplPeer9InvokeGetINSt3__16vectorINS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS9_ISB_EEEENS1_4FlagISD_EEEET_RKT0_:
  860|     10|  static T InvokeGet(const FlagType& flag) {
  861|     10|    return flag.Get();
  862|     10|  }
_ZNK4absl12lts_2026052614flags_internal4FlagINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEEE3GetEv:
  820|     10|  T Get() const {
  821|       |    // See implementation notes in CommandLineFlag::Get().
  822|     10|    union U {
  823|     10|      T value;
  824|     10|      U() {}
  825|     10|      ~U() { value.~T(); }
  826|     10|    };
  827|     10|    U u;
  828|       |
  829|       |#if !defined(NDEBUG)
  830|       |    impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
  831|       |#endif
  832|       |
  833|     10|    if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
  ------------------
  |  |  190|     10|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 6, False: 4]
  |  |  |  Branch (190:49): [Folded, False: 10]
  |  |  |  Branch (190:58): [True: 6, False: 4]
  |  |  ------------------
  ------------------
  834|      6|      impl_.Read(&u.value);
  835|      6|    }
  836|     10|    return std::move(u.value);
  837|     10|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEEE3GetEvEN1UC2Ev:
  824|     10|      U() {}
_ZNK4absl12lts_2026052614flags_internal9FlagValueINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEELNS1_20FlagValueStorageKindE3EE3GetERKNS1_12SequenceLockERSC_:
  536|     10|  bool Get(const SequenceLock&, T& dst) const {
  537|     10|    MaskedPointer ptr_value = value.load(std::memory_order_acquire);
  538|       |
  539|     10|    if (ABSL_PREDICT_TRUE(ptr_value.AllowsUnprotectedRead())) {
  ------------------
  |  |  191|     10|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 4, False: 6]
  |  |  |  Branch (191:48): [Folded, False: 10]
  |  |  |  Branch (191:57): [True: 4, False: 6]
  |  |  ------------------
  ------------------
  540|      4|      ::new (static_cast<void*>(&dst)) T(*static_cast<T*>(ptr_value.Ptr()));
  541|      4|      return true;
  542|      4|    }
  543|      6|    return false;
  544|     10|  }
_ZZNK4absl12lts_2026052614flags_internal4FlagINSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEEE3GetEvEN1UD2Ev:
  825|     10|      ~U() { value.~T(); }

_ZN4absl12lts_2026052614flags_internal21PrivateHandleAccessor9ParseFromERNS0_15CommandLineFlagENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS1_15FlagSettingModeENS1_11ValueSourceERNS5_12basic_stringIcS8_NS5_9allocatorIcEEEE:
   58|      4|                                      std::string& error) {
   59|      4|  return flag.ParseFrom(value, set_mode, source, error);
   60|      4|}

_ZN4absl12lts_2026052614flags_internal21ProgramInvocationNameEv:
   39|      2|std::string ProgramInvocationName() {
   40|      2|  absl::MutexLock l(ProgramNameMutex());
   41|      2|  return program_name ? *program_name : "UNKNOWN";
  ------------------
  |  Branch (41:10): [True: 0, False: 2]
  ------------------
   42|      2|}
_ZN4absl12lts_2026052614flags_internal24SetProgramInvocationNameENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   50|      2|void SetProgramInvocationName(absl::string_view prog_name_str) {
   51|      2|  absl::MutexLock l(ProgramNameMutex());
   52|      2|  if (!program_name) {
  ------------------
  |  Branch (52:7): [True: 2, False: 0]
  ------------------
   53|      2|    program_name = new std::string(prog_name_str);
   54|      2|  } else {
   55|      0|    program_name->assign(prog_name_str.data(), prog_name_str.size());
   56|      0|  }
   57|      2|}
program_name.cc:_ZN4absl12lts_2026052614flags_internalL16ProgramNameMutexEv:
   32|      4|static absl::Mutex& ProgramNameMutex() {
   33|      4|  static absl::NoDestructor<absl::Mutex> mutex;
   34|      4|  return *mutex;
   35|      4|}

_ZNK4absl12lts_2026052614flags_internal12SequenceLock7TryReadEPvPKNSt3__16atomicImEEm:
   80|     26|  bool TryRead(void* dst, const std::atomic<uint64_t>* src, size_t size) const {
   81|       |    // Acquire barrier ensures that no loads done by f() are reordered
   82|       |    // above the first load of the sequence counter.
   83|     26|    int64_t seq_before = lock_.load(std::memory_order_acquire);
   84|     26|    if (ABSL_PREDICT_FALSE(seq_before & 1) == 1) return false;
  ------------------
  |  |  190|     26|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:49): [Folded, False: 26]
  |  |  |  Branch (190:58): [True: 10, False: 16]
  |  |  ------------------
  ------------------
  |  Branch (84:9): [True: 10, False: 16]
  ------------------
   85|     16|    RelaxedCopyFromAtomic(dst, src, size);
   86|       |    // Another acquire fence ensures that the load of 'lock_' below is
   87|       |    // strictly ordered after the RelaxedCopyToAtomic call above.
   88|     16|    std::atomic_thread_fence(std::memory_order_acquire);
   89|     16|    int64_t seq_after = lock_.load(std::memory_order_relaxed);
   90|     16|    return ABSL_PREDICT_TRUE(seq_before == seq_after);
  ------------------
  |  |  191|     16|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:48): [Folded, False: 16]
  |  |  |  Branch (191:57): [True: 16, False: 0]
  |  |  ------------------
  ------------------
   91|     26|  }
_ZN4absl12lts_2026052614flags_internal12SequenceLock21RelaxedCopyFromAtomicEPvPKNSt3__16atomicImEEm:
  144|     16|                                    size_t size) {
  145|     16|    char* dst_byte = static_cast<char*>(dst);
  146|     34|    while (size >= sizeof(uint64_t)) {
  ------------------
  |  Branch (146:12): [True: 18, False: 16]
  ------------------
  147|     18|      uint64_t word = src->load(std::memory_order_relaxed);
  148|     18|      std::memcpy(dst_byte, &word, sizeof(word));
  149|     18|      dst_byte += sizeof(word);
  150|     18|      src++;
  151|     18|      size -= sizeof(word);
  152|     18|    }
  153|     16|    if (size > 0) {
  ------------------
  |  Branch (153:9): [True: 14, False: 2]
  ------------------
  154|     14|      uint64_t word = src->load(std::memory_order_relaxed);
  155|     14|      std::memcpy(dst_byte, &word, size);
  156|     14|    }
  157|     16|  }
_ZN4absl12lts_2026052614flags_internal12SequenceLock15MarkInitializedEv:
   63|     48|  void MarkInitialized() {
   64|       |    assert(lock_.load(std::memory_order_relaxed) == kUninitialized);
   65|     48|    lock_.store(0, std::memory_order_release);
   66|     48|  }
_ZN4absl12lts_2026052614flags_internal12SequenceLock26IncrementModificationCountEv:
  134|      4|  void IncrementModificationCount() {
  135|      4|    int64_t val = lock_.load(std::memory_order_relaxed);
  136|       |    assert(val != kUninitialized);
  137|      4|    lock_.store(val + 2, std::memory_order_relaxed);
  138|      4|  }

_ZN4absl12lts_2026052614flags_internal16HandleUsageFlagsERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEENS2_17basic_string_viewIcS5_EE:
  373|      2|                          absl::string_view program_usage_message) {
  374|      2|  switch (GetFlagsHelpMode()) {
  ------------------
  |  Branch (374:11): [True: 2, False: 0]
  ------------------
  375|      2|    case HelpMode::kNone:
  ------------------
  |  Branch (375:5): [True: 2, False: 0]
  ------------------
  376|      2|      break;
  377|      0|    case HelpMode::kImportant:
  ------------------
  |  Branch (377:5): [True: 0, False: 2]
  ------------------
  378|      0|      flags_internal::FlagsHelpImpl(
  379|      0|          out, flags_internal::GetUsageConfig().contains_help_flags,
  380|      0|          GetFlagsHelpFormat(), program_usage_message);
  381|      0|      break;
  382|       |
  383|      0|    case HelpMode::kShort:
  ------------------
  |  Branch (383:5): [True: 0, False: 2]
  ------------------
  384|      0|      flags_internal::FlagsHelpImpl(
  385|      0|          out, flags_internal::GetUsageConfig().contains_helpshort_flags,
  386|      0|          GetFlagsHelpFormat(), program_usage_message);
  387|      0|      break;
  388|       |
  389|      0|    case HelpMode::kFull:
  ------------------
  |  Branch (389:5): [True: 0, False: 2]
  ------------------
  390|      0|      flags_internal::FlagsHelp(out, "", GetFlagsHelpFormat(),
  391|      0|                                program_usage_message);
  392|      0|      break;
  393|       |
  394|      0|    case HelpMode::kPackage:
  ------------------
  |  Branch (394:5): [True: 0, False: 2]
  ------------------
  395|      0|      flags_internal::FlagsHelpImpl(
  396|      0|          out, flags_internal::GetUsageConfig().contains_helppackage_flags,
  397|      0|          GetFlagsHelpFormat(), program_usage_message);
  398|      0|      break;
  399|       |
  400|      0|    case HelpMode::kMatch: {
  ------------------
  |  Branch (400:5): [True: 0, False: 2]
  ------------------
  401|      0|      std::string substr = GetFlagsHelpMatchSubstr();
  402|      0|      if (substr.empty()) {
  ------------------
  |  Branch (402:11): [True: 0, False: 0]
  ------------------
  403|       |        // show all options
  404|      0|        flags_internal::FlagsHelp(out, substr, GetFlagsHelpFormat(),
  405|      0|                                  program_usage_message);
  406|      0|      } else {
  407|      0|        auto filter_cb = [&substr](const absl::CommandLineFlag& flag) {
  408|      0|          if (absl::StrContains(flag.Name(), substr)) return true;
  409|      0|          if (absl::StrContains(flag.Filename(), substr)) return true;
  410|      0|          if (absl::StrContains(flag.Help(), substr)) return true;
  411|       |
  412|      0|          return false;
  413|      0|        };
  414|      0|        flags_internal::FlagsHelpImpl(
  415|      0|            out, filter_cb, HelpFormat::kHumanReadable, program_usage_message);
  416|      0|      }
  417|      0|      break;
  418|      0|    }
  419|      0|    case HelpMode::kVersion:
  ------------------
  |  Branch (419:5): [True: 0, False: 2]
  ------------------
  420|      0|      if (flags_internal::GetUsageConfig().version_string)
  ------------------
  |  Branch (420:11): [True: 0, False: 0]
  ------------------
  421|      0|        out << flags_internal::GetUsageConfig().version_string();
  422|       |      // Unlike help, we may be asking for version in a script, so return 0
  423|      0|      break;
  424|       |
  425|      0|    case HelpMode::kOnlyCheckArgs:
  ------------------
  |  Branch (425:5): [True: 0, False: 2]
  ------------------
  426|      0|      break;
  427|      2|  }
  428|       |
  429|      2|  return GetFlagsHelpMode();
  430|      2|}
_ZN4absl12lts_2026052614flags_internal16GetFlagsHelpModeEv:
  462|      4|HelpMode GetFlagsHelpMode() {
  463|      4|  absl::MutexLock l(HelpAttributesMutex());
  464|      4|  return help_mode;
  465|      4|}
_ZN4absl12lts_2026052614flags_internal9MaybeExitENS1_8HelpModeE:
  542|      2|void MaybeExit(HelpMode mode) {
  543|      2|  switch (mode) {
  544|      2|    case flags_internal::HelpMode::kNone:
  ------------------
  |  Branch (544:5): [True: 2, False: 0]
  ------------------
  545|      2|      return;
  546|      0|    case flags_internal::HelpMode::kOnlyCheckArgs:
  ------------------
  |  Branch (546:5): [True: 0, False: 2]
  ------------------
  547|      0|    case flags_internal::HelpMode::kVersion:
  ------------------
  |  Branch (547:5): [True: 0, False: 2]
  ------------------
  548|      0|      std::exit(0);
  549|      0|    default:  // For all the other modes we exit with 1
  ------------------
  |  Branch (549:5): [True: 0, False: 2]
  ------------------
  550|      0|      std::exit(1);
  551|      2|  }
  552|      2|}
usage.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_119HelpAttributesMutexEv:
  437|      4|absl::Mutex& HelpAttributesMutex() {
  438|      4|  static absl::NoDestructor<absl::Mutex> mutex;
  439|      4|  return *mutex;
  440|      4|}

_ZN4absl12lts_2026052614flags_internal13AbslParseFlagENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPmPNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
  104|      2|bool AbslParseFlag(absl::string_view text, unsigned long* dst, std::string*) {
  105|      2|  return ParseFlagImpl(text, *dst);
  106|      2|}
_ZN4absl12lts_2026052614flags_internal13AbslParseFlagENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPNS2_12basic_stringIcS5_NS2_9allocatorIcEEEESB_:
  157|      2|bool AbslParseFlag(absl::string_view text, std::string* dst, std::string*) {
  158|      2|  dst->assign(text.data(), text.size());
  159|      2|  return true;
  160|      2|}
marshalling.cc:_ZN4absl12lts_2026052614flags_internalL11NumericBaseENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   57|      2|static int NumericBase(absl::string_view text) {
   58|      2|  if (text.empty()) return 0;
  ------------------
  |  Branch (58:7): [True: 0, False: 2]
  ------------------
   59|      2|  size_t num_start = (text[0] == '-' || text[0] == '+') ? 1 : 0;
  ------------------
  |  Branch (59:23): [True: 0, False: 2]
  |  Branch (59:41): [True: 0, False: 2]
  ------------------
   60|      2|  const bool hex = (text.size() >= num_start + 2 && text[num_start] == '0' &&
  ------------------
  |  Branch (60:21): [True: 2, False: 0]
  |  Branch (60:53): [True: 0, False: 2]
  ------------------
   61|      0|                    (text[num_start + 1] == 'x' || text[num_start + 1] == 'X'));
  ------------------
  |  Branch (61:22): [True: 0, False: 0]
  |  Branch (61:52): [True: 0, False: 0]
  ------------------
   62|      2|  return hex ? 16 : 10;
  ------------------
  |  Branch (62:10): [True: 0, False: 2]
  ------------------
   63|      2|}
_ZN4absl12lts_2026052614flags_internal13ParseFlagImplImEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERT_:
   66|      2|inline bool ParseFlagImpl(absl::string_view text, IntType& dst) {
   67|      2|  text = absl::StripAsciiWhitespace(text);
   68|       |
   69|      2|  return absl::numbers_internal::safe_strtoi_base(text, &dst,
   70|      2|                                                  NumericBase(text));
   71|      2|}

_ZN4absl12lts_202605269ParseFlagINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEbNS2_17basic_string_viewIcS5_EEPT_PS8_:
  307|      2|inline bool ParseFlag(absl::string_view input, T* dst, std::string* error) {
  308|      2|  return flags_internal::InvokeParseFlag(input, dst, error);
  309|      2|}
_ZN4absl12lts_2026052614flags_internal15InvokeParseFlagINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEbNS3_17basic_string_viewIcS6_EEPT_PS9_:
  256|      2|bool InvokeParseFlag(absl::string_view input, T* dst, std::string* err) {
  257|       |  // Comment on next line provides a good compiler error message if T
  258|       |  // does not have AbslParseFlag(absl::string_view, T*, std::string*).
  259|      2|  return AbslParseFlag(input, dst, err);  // Is T missing AbslParseFlag?
  260|      2|}
_ZN4absl12lts_202605269ParseFlagImEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPT_PNS2_12basic_stringIcS5_NS2_9allocatorIcEEEE:
  307|      2|inline bool ParseFlag(absl::string_view input, T* dst, std::string* error) {
  308|      2|  return flags_internal::InvokeParseFlag(input, dst, error);
  309|      2|}
_ZN4absl12lts_2026052614flags_internal15InvokeParseFlagImEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPT_PNS3_12basic_stringIcS6_NS3_9allocatorIcEEEE:
  256|      2|bool InvokeParseFlag(absl::string_view input, T* dst, std::string* err) {
  257|       |  // Comment on next line provides a good compiler error message if T
  258|       |  // does not have AbslParseFlag(absl::string_view, T*, std::string*).
  259|      2|  return AbslParseFlag(input, dst, err);  // Is T missing AbslParseFlag?
  260|      2|}

_ZN4absl12lts_2026052614flags_internal24ParseAbseilFlagsOnlyImplEiPPcRNSt3__16vectorIS2_NS4_9allocatorIS2_EEEERNS5_INS0_16UnrecognizedFlagENS6_ISA_EEEENS1_16UsageFlagsActionE:
  753|      2|    UsageFlagsAction usage_flag_action) {
  754|      2|  ABSL_INTERNAL_CHECK(argc > 0, "Missing argv[0]");
  ------------------
  |  |   85|      2|  do {                                                             \
  |  |   86|      2|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  755|       |
  756|      2|  using flags_internal::ArgsList;
  757|      2|  using flags_internal::specified_flags;
  758|       |
  759|      2|  std::vector<std::string> flagfile_value;
  760|      2|  std::vector<ArgsList> input_args;
  761|       |
  762|       |  // Once parsing has started we will not allow more flag registrations.
  763|      2|  flags_internal::FinalizeRegistry();
  764|       |
  765|       |  // This routine does not return anything since we abort on failure.
  766|      2|  flags_internal::CheckDefaultValuesParsingRoundtrip();
  767|       |
  768|      2|  input_args.push_back(ArgsList(argc, argv));
  769|       |
  770|       |  // Set program invocation name if it is not set before.
  771|      2|  if (flags_internal::ProgramInvocationName() == "UNKNOWN") {
  ------------------
  |  Branch (771:7): [True: 2, False: 0]
  ------------------
  772|      2|    flags_internal::SetProgramInvocationName(argv[0]);
  773|      2|  }
  774|      2|  positional_args.push_back(argv[0]);
  775|       |
  776|      2|  absl::MutexLock l(flags_internal::SpecifiedFlagsMutex());
  777|      2|  if (specified_flags == nullptr) {
  ------------------
  |  Branch (777:7): [True: 2, False: 0]
  ------------------
  778|      2|    specified_flags = new std::vector<const CommandLineFlag*>;
  779|      2|  } else {
  780|      0|    specified_flags->clear();
  781|      0|  }
  782|       |
  783|       |  // Iterate through the list of the input arguments. First level are
  784|       |  // arguments originated from argc/argv. Following levels are arguments
  785|       |  // originated from recursive parsing of flagfile(s).
  786|      2|  bool success = true;
  787|      6|  while (!input_args.empty()) {
  ------------------
  |  Branch (787:10): [True: 6, False: 0]
  ------------------
  788|       |    // First we process the built-in generator flags.
  789|      6|    success &= flags_internal::HandleGeneratorFlags(input_args, flagfile_value);
  790|       |
  791|       |    // Select top-most (most recent) arguments list. If it is empty drop it
  792|       |    // and re-try.
  793|      6|    ArgsList& curr_list = input_args.back();
  794|       |
  795|       |    // Every ArgsList starts with real or fake program name, so we can always
  796|       |    // start by skipping it.
  797|      6|    curr_list.PopFront();
  798|       |
  799|      6|    if (curr_list.Size() == 0) {
  ------------------
  |  Branch (799:9): [True: 0, False: 6]
  ------------------
  800|      0|      input_args.pop_back();
  801|      0|      continue;
  802|      0|    }
  803|       |
  804|       |    // Handle the next argument in the current list. If the stack of argument
  805|       |    // lists contains only one element - we are processing an argument from
  806|       |    // the original argv.
  807|      6|    absl::string_view arg(curr_list.Front());
  808|      6|    bool arg_from_argv = input_args.size() == 1;
  809|       |
  810|       |    // If argument does not start with '-' or is just "-" - this is
  811|       |    // positional argument.
  812|      6|    if (!absl::ConsumePrefix(&arg, "-") || arg.empty()) {
  ------------------
  |  Branch (812:9): [True: 0, False: 6]
  |  Branch (812:44): [True: 0, False: 6]
  ------------------
  813|      0|      ABSL_INTERNAL_CHECK(arg_from_argv,
  ------------------
  |  |   85|      0|  do {                                                             \
  |  |   86|      0|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  814|      0|                          "Flagfile cannot contain positional argument");
  815|       |
  816|      0|      positional_args.push_back(argv[curr_list.FrontIndex()]);
  817|      0|      continue;
  818|      0|    }
  819|       |
  820|       |    // Split the current argument on '=' to deduce the argument flag name and
  821|       |    // value. If flag name is empty it means we've got an "--" argument. Value
  822|       |    // can be empty either if there were no '=' in argument string at all or
  823|       |    // an argument looked like "--foo=". In a latter case is_empty_value is
  824|       |    // true.
  825|      6|    absl::string_view flag_name;
  826|      6|    absl::string_view value;
  827|      6|    bool is_empty_value = false;
  828|       |
  829|      6|    std::tie(flag_name, value, is_empty_value) =
  830|      6|        flags_internal::SplitNameAndValue(arg);
  831|       |
  832|       |    // Standalone "--" argument indicates that the rest of the arguments are
  833|       |    // positional. We do not support positional arguments in flagfiles.
  834|      6|    if (flag_name.empty()) {
  ------------------
  |  Branch (834:9): [True: 2, False: 4]
  ------------------
  835|      2|      ABSL_INTERNAL_CHECK(arg_from_argv,
  ------------------
  |  |   85|      2|  do {                                                             \
  |  |   86|      2|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  836|      2|                          "Flagfile cannot contain positional argument");
  837|       |
  838|      2|      curr_list.PopFront();
  839|      2|      break;
  840|      2|    }
  841|       |
  842|       |    // Locate the flag based on flag name. Handle both --foo and --nofoo.
  843|      4|    CommandLineFlag* flag = nullptr;
  844|      4|    bool is_negative = false;
  845|      4|    std::tie(flag, is_negative) = flags_internal::LocateFlag(flag_name);
  846|       |
  847|      4|    if (flag == nullptr) {
  ------------------
  |  Branch (847:9): [True: 0, False: 4]
  ------------------
  848|       |      // Usage flags are not modeled as Abseil flags. Locate them separately.
  849|      0|      if (flags_internal::DeduceUsageFlags(flag_name, value)) {
  ------------------
  |  Branch (849:11): [True: 0, False: 0]
  ------------------
  850|      0|        continue;
  851|      0|      }
  852|      0|      unrecognized_flags.emplace_back(arg_from_argv
  ------------------
  |  Branch (852:39): [True: 0, False: 0]
  ------------------
  853|      0|                                          ? UnrecognizedFlag::kFromArgv
  854|      0|                                          : UnrecognizedFlag::kFromFlagfile,
  855|      0|                                      flag_name);
  856|      0|      continue;
  857|      0|    }
  858|       |
  859|       |    // Deduce flag's value (from this or next argument).
  860|      4|    bool value_success = true;
  861|      4|    std::tie(value_success, value) = flags_internal::DeduceFlagValue(
  862|      4|        *flag, value, is_negative, is_empty_value, &curr_list);
  863|      4|    success &= value_success;
  864|       |
  865|       |    // Set the located flag to a new value, unless it is retired. Setting
  866|       |    // retired flag fails, but we ignoring it here while also reporting access
  867|       |    // to retired flag.
  868|      4|    std::string error;
  869|      4|    if (!flags_internal::PrivateHandleAccessor::ParseFrom(
  ------------------
  |  Branch (869:9): [True: 0, False: 4]
  ------------------
  870|      4|            *flag, value, flags_internal::SET_FLAGS_VALUE,
  871|      4|            flags_internal::kCommandLine, error)) {
  872|      0|      if (flag->IsRetired()) continue;
  ------------------
  |  Branch (872:11): [True: 0, False: 0]
  ------------------
  873|       |
  874|      0|      flags_internal::ReportUsageError(error, true);
  875|      0|      success = false;
  876|      4|    } else {
  877|      4|      specified_flags->push_back(flag);
  878|      4|    }
  879|      4|  }
  880|       |
  881|      2|  flags_internal::ResetGeneratorFlags(flagfile_value);
  882|       |
  883|       |  // All the remaining arguments are positional.
  884|      2|  if (!input_args.empty()) {
  ------------------
  |  Branch (884:7): [True: 2, False: 0]
  ------------------
  885|      2|    for (size_t arg_index = input_args.back().FrontIndex();
  886|     11|         arg_index < static_cast<size_t>(argc); ++arg_index) {
  ------------------
  |  Branch (886:10): [True: 9, False: 2]
  ------------------
  887|      9|      positional_args.push_back(argv[arg_index]);
  888|      9|    }
  889|      2|  }
  890|       |
  891|       |  // Trim and sort the vector.
  892|      2|  specified_flags->shrink_to_fit();
  893|      2|  std::sort(specified_flags->begin(), specified_flags->end(),
  894|      2|            flags_internal::SpecifiedFlagsCompare{});
  895|       |
  896|       |  // Filter out unrecognized flags, which are ok to ignore.
  897|      2|  std::vector<UnrecognizedFlag> filtered;
  898|      2|  filtered.reserve(unrecognized_flags.size());
  899|      2|  for (const auto& unrecognized : unrecognized_flags) {
  ------------------
  |  Branch (899:33): [True: 0, False: 2]
  ------------------
  900|      0|    if (flags_internal::CanIgnoreUndefinedFlag(unrecognized.flag_name))
  ------------------
  |  Branch (900:9): [True: 0, False: 0]
  ------------------
  901|      0|      continue;
  902|      0|    filtered.push_back(unrecognized);
  903|      0|  }
  904|       |
  905|      2|  std::swap(unrecognized_flags, filtered);
  906|       |
  907|      2|  if (!success) {
  ------------------
  |  Branch (907:7): [True: 0, False: 2]
  ------------------
  908|       |#if ABSL_FLAGS_STRIP_NAMES
  909|       |    flags_internal::ReportUsageError(
  910|       |        "NOTE: command line flags are disabled in this build", true);
  911|       |#else
  912|      0|    flags_internal::HandleUsageFlags(std::cerr, ProgramUsageMessage());
  913|      0|#endif
  914|      0|    return HelpMode::kFull;  // We just need to make sure the exit with
  915|       |                             // code 1.
  916|      0|  }
  917|       |
  918|      2|  return usage_flag_action == UsageFlagsAction::kHandleUsage
  ------------------
  |  Branch (918:10): [True: 2, False: 0]
  ------------------
  919|      2|             ? flags_internal::HandleUsageFlags(std::cout,
  920|      2|                                                ProgramUsageMessage())
  921|      2|             : HelpMode::kNone;
  922|      2|}
_ZN4absl12lts_2026052620ParseAbseilFlagsOnlyEiPPcRNSt3__16vectorIS1_NS3_9allocatorIS1_EEEERNS4_INS0_16UnrecognizedFlagENS5_IS9_EEEE:
  928|      2|                          std::vector<UnrecognizedFlag>& unrecognized_flags) {
  929|      2|  auto help_mode = flags_internal::ParseAbseilFlagsOnlyImpl(
  930|      2|      argc, argv, positional_args, unrecognized_flags,
  931|      2|      flags_internal::UsageFlagsAction::kHandleUsage);
  932|       |
  933|      2|  flags_internal::MaybeExit(help_mode);
  934|      2|}
parse.cc:_ZNK3$_0clEv:
  113|      2|    .OnUpdate([]() {
  114|      2|      if (absl::GetFlag(FLAGS_flagfile).empty()) return;
  ------------------
  |  Branch (114:11): [True: 2, False: 0]
  ------------------
  115|       |
  116|      0|      absl::MutexLock l(absl::flags_internal::ProcessingChecksMutex());
  117|       |
  118|       |      // Setting this flag twice before it is handled most likely an internal
  119|       |      // error and should be reviewed by developers.
  120|      0|      if (absl::flags_internal::flagfile_needs_processing) {
  ------------------
  |  Branch (120:11): [True: 0, False: 0]
  ------------------
  121|      0|        ABSL_INTERNAL_LOG(WARNING, "flagfile set twice before it is handled");
  ------------------
  |  |   76|      0|  do {                                                                    \
  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  ------------------
  |  |  |  |  108|      0|#define ABSL_RAW_LOG_INTERNAL_WARNING ::absl::LogSeverity::kWarning
  |  |  ------------------
  |  |   80|      0|        __LINE__, message);                                               \
  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |   82|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  122|      0|      }
  123|       |
  124|      0|      absl::flags_internal::flagfile_needs_processing = true;
  125|      0|    });
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_121ProcessingChecksMutexEv:
   67|      8|absl::Mutex& ProcessingChecksMutex() {
   68|      8|  static absl::NoDestructor<absl::Mutex> mutex;
   69|      8|  return *mutex;
   70|      8|}
parse.cc:_ZNK3$_1clEv:
  129|      2|    .OnUpdate([]() {
  130|      2|      if (absl::GetFlag(FLAGS_fromenv).empty()) return;
  ------------------
  |  Branch (130:11): [True: 2, False: 0]
  ------------------
  131|       |
  132|      0|      absl::MutexLock l(absl::flags_internal::ProcessingChecksMutex());
  133|       |
  134|       |      // Setting this flag twice before it is handled most likely an internal
  135|       |      // error and should be reviewed by developers.
  136|      0|      if (absl::flags_internal::fromenv_needs_processing) {
  ------------------
  |  Branch (136:11): [True: 0, False: 0]
  ------------------
  137|      0|        ABSL_INTERNAL_LOG(WARNING, "fromenv set twice before it is handled.");
  ------------------
  |  |   76|      0|  do {                                                                    \
  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  ------------------
  |  |  |  |  108|      0|#define ABSL_RAW_LOG_INTERNAL_WARNING ::absl::LogSeverity::kWarning
  |  |  ------------------
  |  |   80|      0|        __LINE__, message);                                               \
  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |   82|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  138|      0|      }
  139|       |
  140|      0|      absl::flags_internal::fromenv_needs_processing = true;
  141|      0|    });
parse.cc:_ZNK3$_2clEv:
  145|      2|    .OnUpdate([]() {
  146|      2|      if (absl::GetFlag(FLAGS_tryfromenv).empty()) return;
  ------------------
  |  Branch (146:11): [True: 2, False: 0]
  ------------------
  147|       |
  148|      0|      absl::MutexLock l(absl::flags_internal::ProcessingChecksMutex());
  149|       |
  150|       |      // Setting this flag twice before it is handled most likely an internal
  151|       |      // error and should be reviewed by developers.
  152|      0|      if (absl::flags_internal::tryfromenv_needs_processing) {
  ------------------
  |  Branch (152:11): [True: 0, False: 0]
  ------------------
  153|      0|        ABSL_INTERNAL_LOG(WARNING,
  ------------------
  |  |   76|      0|  do {                                                                    \
  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  ------------------
  |  |  |  |  108|      0|#define ABSL_RAW_LOG_INTERNAL_WARNING ::absl::LogSeverity::kWarning
  |  |  ------------------
  |  |   80|      0|        __LINE__, message);                                               \
  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |   82|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|      0|                          "tryfromenv set twice before it is handled.");
  155|      0|      }
  156|       |
  157|      0|      absl::flags_internal::tryfromenv_needs_processing = true;
  158|      0|    });
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_119SpecifiedFlagsMutexEv:
   79|      2|absl::Mutex& SpecifiedFlagsMutex() {
   80|      2|  static absl::NoDestructor<absl::Mutex> mutex;
   81|      2|  return *mutex;
   82|      2|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_134CheckDefaultValuesParsingRoundtripEv:
  331|      2|void CheckDefaultValuesParsingRoundtrip() {
  332|       |#ifndef NDEBUG
  333|       |  flags_internal::ForEachFlag([&](CommandLineFlag& flag) {
  334|       |    if (flag.IsRetired()) return;
  335|       |
  336|       |#define ABSL_FLAGS_INTERNAL_IGNORE_TYPE(T, _) \
  337|       |  if (flag.IsOfType<T>()) return;
  338|       |
  339|       |    ABSL_FLAGS_INTERNAL_SUPPORTED_TYPES(ABSL_FLAGS_INTERNAL_IGNORE_TYPE)
  340|       |#undef ABSL_FLAGS_INTERNAL_IGNORE_TYPE
  341|       |
  342|       |    flags_internal::PrivateHandleAccessor::CheckDefaultValueParsingRoundtrip(
  343|       |        flag);
  344|       |  });
  345|       |#endif
  346|      2|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_18ArgsListC2EiPPc:
  176|      2|  ArgsList(int argc, char* argv[]) : args_(argv, argv + argc), next_arg_(0) {}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_120HandleGeneratorFlagsERNSt3__16vectorINS2_8ArgsListENS3_9allocatorIS5_EEEERNS4_INS3_12basic_stringIcNS3_11char_traitsIcEENS6_IcEEEENS6_ISE_EEEE:
  424|      6|                          std::vector<std::string>& flagfile_value) {
  425|      6|  bool success = true;
  426|       |
  427|      6|  absl::MutexLock l(flags_internal::ProcessingChecksMutex());
  428|       |
  429|       |  // flagfile could have been set either on a command line or
  430|       |  // programmatically before invoking ParseCommandLine. Note that we do not
  431|       |  // actually process arguments specified in the flagfile, but instead
  432|       |  // create a secondary arguments list to be processed along with the rest
  433|       |  // of the command line arguments. Since we always the process most recently
  434|       |  // created list of arguments first, this will result in flagfile argument
  435|       |  // being processed before any other argument in the command line. If
  436|       |  // FLAGS_flagfile contains more than one file name we create multiple new
  437|       |  // levels of arguments in a reverse order of file names. Thus we always
  438|       |  // process arguments from first file before arguments containing in a
  439|       |  // second file, etc. If flagfile contains another
  440|       |  // --flagfile inside of it, it will produce new level of arguments and
  441|       |  // processed before the rest of the flagfile. We are also collecting all
  442|       |  // flagfiles set on original command line. Unlike the rest of the flags,
  443|       |  // this flag can be set multiple times and is expected to be handled
  444|       |  // multiple times. We are collecting them all into a single list and set
  445|       |  // the value of FLAGS_flagfile to that value at the end of the parsing.
  446|      6|  if (flags_internal::flagfile_needs_processing) {
  ------------------
  |  Branch (446:7): [True: 0, False: 6]
  ------------------
  447|      0|    auto flagfiles = absl::GetFlag(FLAGS_flagfile);
  448|       |
  449|      0|    if (input_args.size() == 1) {
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  ------------------
  450|      0|      flagfile_value.insert(flagfile_value.end(), flagfiles.begin(),
  451|      0|                            flagfiles.end());
  452|      0|    }
  453|       |
  454|      0|    success &= ReadFlagfiles(flagfiles, input_args);
  455|       |
  456|      0|    flags_internal::flagfile_needs_processing = false;
  457|      0|  }
  458|       |
  459|       |  // Similar to flagfile fromenv/tryfromemv can be set both
  460|       |  // programmatically and at runtime on a command line. Unlike flagfile these
  461|       |  // can't be recursive.
  462|      6|  if (flags_internal::fromenv_needs_processing) {
  ------------------
  |  Branch (462:7): [True: 0, False: 6]
  ------------------
  463|      0|    auto flags_list = absl::GetFlag(FLAGS_fromenv);
  464|       |
  465|      0|    success &= ReadFlagsFromEnv(flags_list, input_args, true);
  466|       |
  467|      0|    flags_internal::fromenv_needs_processing = false;
  468|      0|  }
  469|       |
  470|      6|  if (flags_internal::tryfromenv_needs_processing) {
  ------------------
  |  Branch (470:7): [True: 0, False: 6]
  ------------------
  471|      0|    auto flags_list = absl::GetFlag(FLAGS_tryfromenv);
  472|       |
  473|      0|    success &= ReadFlagsFromEnv(flags_list, input_args, false);
  474|       |
  475|      0|    flags_internal::tryfromenv_needs_processing = false;
  476|      0|  }
  477|       |
  478|      6|  return success;
  479|      6|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_18ArgsList8PopFrontEv:
  186|      8|  void PopFront() { next_arg_++; }
parse.cc:_ZNK4absl12lts_2026052614flags_internal12_GLOBAL__N_18ArgsList4SizeEv:
  183|      6|  size_t Size() const { return args_.size() - next_arg_; }
parse.cc:_ZNK4absl12lts_2026052614flags_internal12_GLOBAL__N_18ArgsList5FrontEv:
  185|      6|  absl::string_view Front() const { return args_[next_arg_]; }
parse.cc:_ZNK4absl12lts_2026052614flags_internal12_GLOBAL__N_18ArgsList10FrontIndexEv:
  184|      2|  size_t FrontIndex() const { return next_arg_; }
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_117SplitNameAndValueENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  287|      6|    absl::string_view arg) {
  288|       |  // Allow -foo and --foo
  289|      6|  absl::ConsumePrefix(&arg, "-");
  290|       |
  291|      6|  if (arg.empty()) {
  ------------------
  |  Branch (291:7): [True: 2, False: 4]
  ------------------
  292|      2|    return std::make_tuple("", "", false);
  293|      2|  }
  294|       |
  295|      4|  auto equal_sign_pos = arg.find('=');
  296|       |
  297|      4|  absl::string_view flag_name = arg.substr(0, equal_sign_pos);
  298|       |
  299|      4|  absl::string_view value;
  300|      4|  bool is_empty_value = false;
  301|       |
  302|      4|  if (equal_sign_pos != absl::string_view::npos) {
  ------------------
  |  Branch (302:7): [True: 4, False: 0]
  ------------------
  303|      4|    value = arg.substr(equal_sign_pos + 1);
  304|      4|    is_empty_value = value.empty();
  305|      4|  }
  306|       |
  307|      4|  return std::make_tuple(flag_name, value, is_empty_value);
  308|      6|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_110LocateFlagENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  315|      4|std::tuple<CommandLineFlag*, bool> LocateFlag(absl::string_view flag_name) {
  316|      4|  CommandLineFlag* flag = absl::FindCommandLineFlag(flag_name);
  317|      4|  bool is_negative = false;
  318|       |
  319|      4|  if (!flag && absl::ConsumePrefix(&flag_name, "no")) {
  ------------------
  |  Branch (319:7): [True: 0, False: 4]
  |  Branch (319:16): [True: 0, False: 0]
  ------------------
  320|      0|    flag = absl::FindCommandLineFlag(flag_name);
  321|      0|    is_negative = true;
  322|      0|  }
  323|       |
  324|      4|  return std::make_tuple(flag, is_negative);
  325|      4|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_115DeduceFlagValueERKNS0_15CommandLineFlagENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEbbPNS2_8ArgsListE:
  518|      4|                                                    ArgsList* curr_list) {
  519|       |  // Value is either an argument suffix after `=` in "--foo=<value>"
  520|       |  // or separate argument in case of "--foo" "<value>".
  521|       |
  522|       |  // boolean flags have these forms:
  523|       |  //   --foo
  524|       |  //   --nofoo
  525|       |  //   --foo=true
  526|       |  //   --foo=false
  527|       |  //   --nofoo=<value> is not supported
  528|       |  //   --foo <value> is not supported
  529|       |
  530|       |  // non boolean flags have these forms:
  531|       |  // --foo=<value>
  532|       |  // --foo <value>
  533|       |  // --nofoo is not supported
  534|       |
  535|      4|  if (flag.IsOfType<bool>()) {
  ------------------
  |  Branch (535:7): [True: 0, False: 4]
  ------------------
  536|      0|    if (value.empty()) {
  ------------------
  |  Branch (536:9): [True: 0, False: 0]
  ------------------
  537|      0|      if (is_empty_value) {
  ------------------
  |  Branch (537:11): [True: 0, False: 0]
  ------------------
  538|       |        // "--bool_flag=" case
  539|      0|        flags_internal::ReportUsageError(
  540|      0|            absl::StrCat(
  541|      0|                "Missing the value after assignment for the boolean flag '",
  542|      0|                flag.Name(), "'"),
  543|      0|            true);
  544|      0|        return std::make_tuple(false, "");
  545|      0|      }
  546|       |
  547|       |      // "--bool_flag" case
  548|      0|      value = is_negative ? "0" : "1";
  ------------------
  |  Branch (548:15): [True: 0, False: 0]
  ------------------
  549|      0|    } else if (is_negative) {
  ------------------
  |  Branch (549:16): [True: 0, False: 0]
  ------------------
  550|       |      // "--nobool_flag=Y" case
  551|      0|      flags_internal::ReportUsageError(
  552|      0|          absl::StrCat("Negative form with assignment is not valid for the "
  553|      0|                       "boolean flag '",
  554|      0|                       flag.Name(), "'"),
  555|      0|          true);
  556|      0|      return std::make_tuple(false, "");
  557|      0|    }
  558|      4|  } else if (is_negative) {
  ------------------
  |  Branch (558:14): [True: 0, False: 4]
  ------------------
  559|       |    // "--noint_flag=1" case
  560|      0|    flags_internal::ReportUsageError(
  561|      0|        absl::StrCat("Negative form is not valid for the flag '", flag.Name(),
  562|      0|                     "'"),
  563|      0|        true);
  564|      0|    return std::make_tuple(false, "");
  565|      4|  } else if (value.empty() && (!is_empty_value)) {
  ------------------
  |  Branch (565:14): [True: 0, False: 4]
  |  Branch (565:31): [True: 0, False: 0]
  ------------------
  566|      0|    if (curr_list->Size() == 1) {
  ------------------
  |  Branch (566:9): [True: 0, False: 0]
  ------------------
  567|       |      // "--int_flag" case
  568|      0|      flags_internal::ReportUsageError(
  569|      0|          absl::StrCat("Missing the value for the flag '", flag.Name(), "'"),
  570|      0|          true);
  571|      0|      return std::make_tuple(false, "");
  572|      0|    }
  573|       |
  574|       |    // "--int_flag" "10" case
  575|      0|    curr_list->PopFront();
  576|      0|    value = curr_list->Front();
  577|       |
  578|       |    // Heuristic to detect the case where someone treats a string arg
  579|       |    // like a bool or just forgets to pass a value:
  580|       |    // --my_string_var --foo=bar
  581|       |    // We look for a flag of string type, whose value begins with a
  582|       |    // dash and corresponds to known flag or standalone --.
  583|      0|    if (!value.empty() && value[0] == '-' && flag.IsOfType<std::string>()) {
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  |  Branch (583:27): [True: 0, False: 0]
  |  Branch (583:46): [True: 0, False: 0]
  ------------------
  584|      0|      auto maybe_flag_name = std::get<0>(SplitNameAndValue(value.substr(1)));
  585|       |
  586|      0|      if (maybe_flag_name.empty() ||
  ------------------
  |  Branch (586:11): [True: 0, False: 0]
  |  Branch (586:11): [True: 0, False: 0]
  ------------------
  587|      0|          std::get<0>(LocateFlag(maybe_flag_name)) != nullptr) {
  ------------------
  |  Branch (587:11): [True: 0, False: 0]
  ------------------
  588|       |        // "--string_flag" "--known_flag" case
  589|      0|        ABSL_INTERNAL_LOG(
  ------------------
  |  |   76|      0|  do {                                                                    \
  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  ------------------
  |  |  |  |  108|      0|#define ABSL_RAW_LOG_INTERNAL_WARNING ::absl::LogSeverity::kWarning
  |  |  ------------------
  |  |   80|      0|        __LINE__, message);                                               \
  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |   82|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  590|      0|            WARNING,
  591|      0|            absl::StrCat("Did you really mean to set flag '", flag.Name(),
  592|      0|                         "' to the value '", value, "'?"));
  593|      0|      }
  594|      0|    }
  595|      0|  }
  596|       |
  597|      4|  return std::make_tuple(true, value);
  598|      4|}
parse.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_119ResetGeneratorFlagsERKNSt3__16vectorINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS8_ISA_EEEE:
  483|      2|void ResetGeneratorFlags(const std::vector<std::string>& flagfile_value) {
  484|       |  // Setting flagfile to the value which collates all the values set on a
  485|       |  // command line and programmatically. So if command line looked like
  486|       |  // --flagfile=f1 --flagfile=f2 the final value of the FLAGS_flagfile flag is
  487|       |  // going to be {"f1", "f2"}
  488|      2|  if (!flagfile_value.empty()) {
  ------------------
  |  Branch (488:7): [True: 0, False: 2]
  ------------------
  489|      0|    absl::SetFlag(&FLAGS_flagfile, flagfile_value);
  490|      0|    absl::MutexLock l(flags_internal::ProcessingChecksMutex());
  491|      0|    flags_internal::flagfile_needs_processing = false;
  492|      0|  }
  493|       |
  494|       |  // fromenv/tryfromenv are set to <undefined> value.
  495|      2|  if (!absl::GetFlag(FLAGS_fromenv).empty()) {
  ------------------
  |  Branch (495:7): [True: 0, False: 2]
  ------------------
  496|      0|    absl::SetFlag(&FLAGS_fromenv, {});
  497|      0|  }
  498|      2|  if (!absl::GetFlag(FLAGS_tryfromenv).empty()) {
  ------------------
  |  Branch (498:7): [True: 0, False: 2]
  ------------------
  499|      0|    absl::SetFlag(&FLAGS_tryfromenv, {});
  500|      0|  }
  501|       |
  502|      2|  absl::MutexLock l(flags_internal::ProcessingChecksMutex());
  503|      2|  flags_internal::fromenv_needs_processing = false;
  504|      2|  flags_internal::tryfromenv_needs_processing = false;
  505|      2|}
parse.cc:_ZNK4absl12lts_2026052614flags_internal12_GLOBAL__N_121SpecifiedFlagsCompareclEPKNS0_15CommandLineFlagES6_:
   93|      2|  bool operator()(const CommandLineFlag* a, const CommandLineFlag* b) const {
   94|      2|    return a->Name() < b->Name();
   95|      2|  }

_ZN4absl12lts_2026052614flags_internal12FlagRegistry8FindFlagENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  103|      4|CommandLineFlag* FlagRegistry::FindFlag(absl::string_view name) {
  104|      4|  if (finalized_flags_.load(std::memory_order_acquire)) {
  ------------------
  |  Branch (104:7): [True: 4, False: 0]
  ------------------
  105|       |    // We could save some gcus here if we make `Name()` be non-virtual.
  106|       |    // We could move the `const char*` name to the base class.
  107|      4|    auto it = std::partition_point(
  108|      4|        flat_flags_.begin(), flat_flags_.end(),
  109|      4|        [=](CommandLineFlag* f) { return f->Name() < name; });
  110|      4|    if (it != flat_flags_.end() && (*it)->Name() == name) return *it;
  ------------------
  |  Branch (110:9): [True: 4, False: 0]
  |  Branch (110:9): [True: 4, False: 0]
  |  Branch (110:36): [True: 4, False: 0]
  ------------------
  111|      4|  }
  112|       |
  113|      0|  FlagRegistryLock frl(*this);
  114|      0|  auto it = flags_.find(name);
  115|      0|  return it != flags_.end() ? it->second : nullptr;
  ------------------
  |  Branch (115:10): [True: 0, False: 0]
  ------------------
  116|      4|}
_ZN4absl12lts_2026052614flags_internal12FlagRegistry12RegisterFlagERNS0_15CommandLineFlagEPKc:
  118|     50|void FlagRegistry::RegisterFlag(CommandLineFlag& flag, const char* filename) {
  119|     50|  if (filename != nullptr &&
  ------------------
  |  Branch (119:7): [True: 50, False: 0]
  |  Branch (119:7): [True: 0, False: 50]
  ------------------
  120|     50|      flag.Filename() != GetUsageConfig().normalize_filename(filename)) {
  ------------------
  |  Branch (120:7): [True: 0, False: 50]
  ------------------
  121|      0|    flags_internal::ReportUsageError(
  122|      0|        absl::StrCat(
  123|      0|            "Inconsistency between flag object and registration for flag '",
  124|      0|            flag.Name(),
  125|      0|            "', likely due to duplicate flags or an ODR violation. Relevant "
  126|      0|            "files: ",
  127|      0|            flag.Filename(), " and ", filename),
  128|      0|        true);
  129|      0|    std::exit(1);
  130|      0|  }
  131|       |
  132|     50|  FlagRegistryLock registry_lock(*this);
  133|       |
  134|     50|  std::pair<FlagIterator, bool> ins =
  135|     50|      flags_.insert(FlagMap::value_type(flag.Name(), &flag));
  136|     50|  if (ins.second == false) {  // means the name was already in the map
  ------------------
  |  Branch (136:7): [True: 0, False: 50]
  ------------------
  137|      0|    CommandLineFlag& old_flag = *ins.first->second;
  138|      0|    if (flag.IsRetired() != old_flag.IsRetired()) {
  ------------------
  |  Branch (138:9): [True: 0, False: 0]
  ------------------
  139|       |      // All registrations must agree on the 'retired' flag.
  140|      0|      flags_internal::ReportUsageError(
  141|      0|          absl::StrCat(
  142|      0|              "Retired flag '", flag.Name(), "' was defined normally in file '",
  143|      0|              (flag.IsRetired() ? old_flag.Filename() : flag.Filename()), "'."),
  ------------------
  |  Branch (143:16): [True: 0, False: 0]
  ------------------
  144|      0|          true);
  145|      0|    } else if (flags_internal::PrivateHandleAccessor::TypeId(flag) !=
  ------------------
  |  Branch (145:16): [True: 0, False: 0]
  ------------------
  146|      0|               flags_internal::PrivateHandleAccessor::TypeId(old_flag)) {
  147|      0|      flags_internal::ReportUsageError(
  148|      0|          absl::StrCat("Flag '", flag.Name(),
  149|      0|                       "' was defined more than once but with "
  150|      0|                       "differing types. Defined in files '",
  151|      0|                       old_flag.Filename(), "' and '", flag.Filename(), "'."),
  152|      0|          true);
  153|      0|    } else if (old_flag.IsRetired()) {
  ------------------
  |  Branch (153:16): [True: 0, False: 0]
  ------------------
  154|      0|      return;
  155|      0|    } else if (old_flag.Filename() != flag.Filename()) {
  ------------------
  |  Branch (155:16): [True: 0, False: 0]
  ------------------
  156|      0|      flags_internal::ReportUsageError(
  157|      0|          absl::StrCat("Flag '", flag.Name(),
  158|      0|                       "' was defined more than once (in files '",
  159|      0|                       old_flag.Filename(), "' and '", flag.Filename(), "')."),
  160|      0|          true);
  161|      0|    } else {
  162|      0|      flags_internal::ReportUsageError(
  163|      0|          absl::StrCat(
  164|      0|              "Something is wrong with flag '", flag.Name(), "' in file '",
  165|      0|              flag.Filename(), "'. One possibility: file '", flag.Filename(),
  166|      0|              "' is being linked both statically and dynamically into this "
  167|      0|              "executable. e.g. some files listed as srcs to a test and also "
  168|      0|              "listed as srcs of some shared lib deps of the same test."),
  169|      0|          true);
  170|      0|    }
  171|       |    // All cases above are fatal, except for the retired flags.
  172|      0|    std::exit(1);
  173|      0|  }
  174|     50|}
_ZN4absl12lts_2026052614flags_internal12FlagRegistry14GlobalRegistryEv:
  176|     56|FlagRegistry& FlagRegistry::GlobalRegistry() {
  177|     56|  static absl::NoDestructor<FlagRegistry> global_registry;
  178|     56|  return *global_registry;
  179|     56|}
_ZN4absl12lts_2026052614flags_internal23RegisterCommandLineFlagERNS0_15CommandLineFlagEPKc:
  196|     50|bool RegisterCommandLineFlag(CommandLineFlag& flag, const char* filename) {
  197|     50|  FlagRegistry::GlobalRegistry().RegisterFlag(flag, filename);
  198|     50|  return true;
  199|     50|}
_ZN4absl12lts_2026052614flags_internal16FinalizeRegistryEv:
  201|      2|void FinalizeRegistry() {
  202|      2|  auto& registry = FlagRegistry::GlobalRegistry();
  203|      2|  FlagRegistryLock frl(registry);
  204|      2|  if (registry.finalized_flags_.load(std::memory_order_relaxed)) {
  ------------------
  |  Branch (204:7): [True: 0, False: 2]
  ------------------
  205|       |    // Was already finalized. Ignore the second time.
  206|      0|    return;
  207|      0|  }
  208|      2|  registry.flat_flags_.reserve(registry.flags_.size());
  209|     50|  for (const auto& f : registry.flags_) {
  ------------------
  |  Branch (209:22): [True: 50, False: 2]
  ------------------
  210|     50|    registry.flat_flags_.push_back(f.second);
  211|     50|  }
  212|      2|  std::sort(std::begin(registry.flat_flags_), std::end(registry.flat_flags_),
  213|      2|            [](const CommandLineFlag* lhs, const CommandLineFlag* rhs) {
  214|      2|              return lhs->Name() < rhs->Name();
  215|      2|            });
  216|      2|  registry.flags_.clear();
  217|      2|  registry.finalized_flags_.store(true, std::memory_order_release);
  218|      2|}
_ZN4absl12lts_2026052619FindCommandLineFlagENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  350|      4|CommandLineFlag* FindCommandLineFlag(absl::string_view name) {
  351|      4|  if (name.empty()) return nullptr;
  ------------------
  |  Branch (351:7): [True: 0, False: 4]
  ------------------
  352|      4|  flags_internal::FlagRegistry& registry =
  353|      4|      flags_internal::FlagRegistry::GlobalRegistry();
  354|      4|  return registry.FindFlag(name);
  355|      4|}
reflection.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_116FlagRegistryLockC2ERNS1_12FlagRegistryE:
   94|     52|  explicit FlagRegistryLock(FlagRegistry& fr) : fr_(fr) { fr_.lock(); }
_ZN4absl12lts_2026052614flags_internal12FlagRegistry4lockEv:
   57|     52|  void lock() ABSL_EXCLUSIVE_LOCK_FUNCTION(lock_) { lock_.lock(); }
reflection.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_116FlagRegistryLockD2Ev:
   95|     52|  ~FlagRegistryLock() { fr_.unlock(); }
_ZN4absl12lts_2026052614flags_internal12FlagRegistry6unlockEv:
   60|     52|  void unlock() ABSL_UNLOCK_FUNCTION(lock_) { lock_.unlock(); }
_ZN4absl12lts_2026052614flags_internal12FlagRegistryC2Ev:
   51|      2|  FlagRegistry() = default;
reflection.cc:_ZZN4absl12lts_2026052614flags_internal12FlagRegistry8FindFlagENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEENK3$_0clEPNS0_15CommandLineFlagE:
  109|     20|        [=](CommandLineFlag* f) { return f->Name() < name; });
reflection.cc:_ZZN4absl12lts_2026052614flags_internal16FinalizeRegistryEvENK3$_0clEPKNS0_15CommandLineFlagES5_:
  213|    260|            [](const CommandLineFlag* lhs, const CommandLineFlag* rhs) {
  214|    260|              return lhs->Name() < rhs->Name();
  215|    260|            });

_ZN4absl12lts_2026052619ProgramUsageMessageEv:
   57|      2|absl::string_view ProgramUsageMessage() {
   58|      2|  absl::MutexLock l(flags_internal::usage_message_guard);
   59|       |
   60|      2|  return flags_internal::program_usage_message != nullptr
  ------------------
  |  Branch (60:10): [True: 0, False: 2]
  ------------------
   61|      2|             ? absl::string_view(*flags_internal::program_usage_message)
   62|      2|             : "Warning: SetProgramUsageMessage() never called";
   63|      2|}

_ZN4absl12lts_2026052614flags_internal14GetUsageConfigEv:
  118|    100|FlagsUsageConfig GetUsageConfig() {
  119|    100|  absl::MutexLock l(CustomUsageConfigMutex());
  120|       |
  121|    100|  if (custom_usage_config) return *custom_usage_config;
  ------------------
  |  Branch (121:7): [True: 0, False: 100]
  ------------------
  122|       |
  123|    100|  FlagsUsageConfig default_config;
  124|    100|  default_config.contains_helpshort_flags = &ContainsHelpshortFlags;
  125|    100|  default_config.contains_help_flags = &ContainsHelppackageFlags;
  126|    100|  default_config.contains_helppackage_flags = &ContainsHelppackageFlags;
  127|    100|  default_config.version_string = &VersionString;
  128|    100|  default_config.normalize_filename = &NormalizeFilename;
  129|       |
  130|    100|  return default_config;
  131|    100|}
usage_config.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_122CustomUsageConfigMutexEv:
  108|    100|absl::Mutex& CustomUsageConfigMutex() {
  109|    100|  static absl::NoDestructor<absl::Mutex> mutex;
  110|    100|  return *mutex;
  111|    100|}
usage_config.cc:_ZN4absl12lts_2026052614flags_internal12_GLOBAL__N_117NormalizeFilenameENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   97|    100|std::string NormalizeFilename(absl::string_view filename) {
   98|       |  // Skip any leading slashes
   99|    100|  auto pos = filename.find_first_not_of("\\/");
  100|    100|  if (pos == absl::string_view::npos) return "";
  ------------------
  |  Branch (100:7): [True: 0, False: 100]
  ------------------
  101|       |
  102|    100|  filename.remove_prefix(pos);
  103|    100|  return std::string(filename);
  104|    100|}

_ZN4absl12lts_2026052612AnyInvocableIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS2_14default_deleteIS6_EEEERKNS5_8FuzzTestEEEC2IZNS5_17RegistrationToken24GetFuzzTestFuzzerFactoryINS5_27RegistrationWithDomainsBaseIJNS2_6vectorINS3_I9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorISN_EEEENS2_5arrayI15avifScalingModeLm4EEENS3_I11avifEncoderSM_EENS3_I11avifDecoderSM_EEEEENS5_9NoFixtureEPFvSQ_RKST_SV_SX_EPvEESE_ONS5_12RegistrationIT0_T1_T_T2_EEEUlSC_E_vEEOS18_:
  197|      2|      : Impl(internal_any_invocable::ConversionConstruct(),
  198|      2|             std::forward<F>(f)) {}
_ZN4absl12lts_2026052612AnyInvocableIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS2_14default_deleteIS6_EEEERKNS5_8FuzzTestEEEC2IZNS5_17RegistrationToken24GetFuzzTestFuzzerFactoryINS5_27RegistrationWithDomainsBaseIJNS2_6vectorINS3_I9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorISN_EEEENS3_I11avifEncoderSM_EENS3_I11avifDecoderSM_EEEEENS5_9NoFixtureEPFvSQ_SS_SU_EPvEESE_ONS5_12RegistrationIT0_T1_T_T2_EEEUlSC_E_vEEOS13_:
  197|      2|      : Impl(internal_any_invocable::ConversionConstruct(),
  198|      2|             std::forward<F>(f)) {}
_ZN4absl12lts_2026052612AnyInvocableIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS2_14default_deleteIS6_EEEERKNS5_8FuzzTestEEEC2EOSE_:
  187|      8|  AnyInvocable(AnyInvocable&& /*f*/) noexcept = default;
compatibility_mode.cc:_ZN4absl12lts_2026052612AnyInvocableIFvvOEEC2IZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS6_13ConfigurationEE3$_0vEEOT_:
  197|      2|      : Impl(internal_any_invocable::ConversionConstruct(),
  198|      2|             std::forward<F>(f)) {}
runtime.cc:_ZN4absl12lts_2026052612AnyInvocableIFvvOEEC2IZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS7_5InputEE3$_0vEEOT_:
  197|  13.7k|      : Impl(internal_any_invocable::ConversionConstruct(),
  198|  13.7k|             std::forward<F>(f)) {}

init_fuzztest.cc:_ZN4absl12lts_2026052611FunctionRefIFvRN8fuzztest8internal8FuzzTestEEEC2IZNS2_19ListRegisteredTestsEvE3$_0vEEOT_:
  112|      6|      : FunctionRef(std::in_place, std::forward<F>(f)) {}
init_fuzztest.cc:_ZN4absl12lts_2026052611FunctionRefIFvRN8fuzztest8internal8FuzzTestEEEC2IZNS2_19ListRegisteredTestsEvE3$_0EENSt3__110in_place_tEOT_:
  100|      6|      : invoker_(&absl::functional_internal::InvokeObject<F&, R, Args...>) {
  101|      6|    absl::functional_internal::AssertNonNull(f);
  102|      6|    ptr_.obj = &f;
  103|      6|  }
_ZN4absl12lts_2026052611FunctionRefIFmmEEC2INS0_18container_internal7HashKeyINS5_10StringHashENSt3__117basic_string_viewIcNS8_11char_traitsIcEEEELb1EEEvEEOT_:
  112|      4|      : FunctionRef(std::in_place, std::forward<F>(f)) {}
_ZN4absl12lts_2026052611FunctionRefIFmmEEC2INS0_18container_internal7HashKeyINS5_10StringHashENSt3__117basic_string_viewIcNS8_11char_traitsIcEEEELb1EEEEENS8_10in_place_tEOT_:
  100|      4|      : invoker_(&absl::functional_internal::InvokeObject<F&, R, Args...>) {
  101|      4|    absl::functional_internal::AssertNonNull(f);
  102|      4|    ptr_.obj = &f;
  103|      4|  }
googletest_adaptor.cc:_ZN4absl12lts_2026052611FunctionRefIFvRN8fuzztest8internal8FuzzTestEEEC2IZNS3_30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS3_13ConfigurationEE3$_0vEEOT_:
  112|      2|      : FunctionRef(std::in_place, std::forward<F>(f)) {}
googletest_adaptor.cc:_ZN4absl12lts_2026052611FunctionRefIFvRN8fuzztest8internal8FuzzTestEEEC2IZNS3_30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS3_13ConfigurationEE3$_0EENSt3__110in_place_tEOT_:
  100|      2|      : invoker_(&absl::functional_internal::InvokeObject<F&, R, Args...>) {
  101|      2|    absl::functional_internal::AssertNonNull(f);
  102|      2|    ptr_.obj = &f;
  103|      2|  }
_ZNK4absl12lts_2026052611FunctionRefIFvRN8fuzztest8internal8FuzzTestEEEclES5_:
  164|     16|  R operator()(Args... args) const {
  165|     16|    return invoker_(ptr_, std::forward<Args>(args)...);
  166|     16|  }
status.cc:_ZN4absl12lts_2026052611FunctionRefIFvNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS0_4CordEEEC2IZ10SetMessageRKNS0_6StatusES6_E3$_0vEEOT_:
  112|    115|      : FunctionRef(std::in_place, std::forward<F>(f)) {}
status.cc:_ZN4absl12lts_2026052611FunctionRefIFvNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS0_4CordEEEC2IZ10SetMessageRKNS0_6StatusES6_E3$_0EENS2_10in_place_tEOT_:
  100|    115|      : invoker_(&absl::functional_internal::InvokeObject<F&, R, Args...>) {
  101|    115|    absl::functional_internal::AssertNonNull(f);
  102|    115|    ptr_.obj = &f;
  103|    115|  }
_ZNK4absl12lts_2026052611FunctionRefIFmmEEclEm:
  164|      2|  R operator()(Args... args) const {
  165|      2|    return invoker_(ptr_, std::forward<Args>(args)...);
  166|      2|  }

_ZN4absl12lts_2026052622internal_any_invocable12EmptyManagerENS1_14FunctionToCallEPNS1_15TypeErasedStateES4_:
  213|      8|                         TypeErasedState* /*to*/) noexcept {}
_ZN4absl12lts_2026052622internal_any_invocable19LocalManagerTrivialENS1_14FunctionToCallEPNS1_15TypeErasedStateES4_:
  219|  13.7k|                                TypeErasedState* const to) noexcept {
  220|       |  // This single statement without branching handles both possible operations.
  221|       |  //
  222|       |  // For FunctionToCall::dispose, "from" and "to" point to the same state, and
  223|       |  // so this assignment logically would do nothing.
  224|       |  //
  225|       |  // Note: Correctness here relies on http://wg21.link/p0593, which has only
  226|       |  // become standard in C++20, though implementations do not break it in
  227|       |  // practice for earlier versions of C++.
  228|       |  //
  229|       |  // The correct way to do this without that paper is to first placement-new a
  230|       |  // default-constructed T in "to->storage" prior to the memmove, but doing so
  231|       |  // requires a different function to be created for each T that is stored
  232|       |  // locally, which can cause unnecessary bloat and be less cache friendly.
  233|  13.7k|  *to = *from;
  234|       |
  235|       |  // Note: Because the type is trivially copyable, the destructor does not need
  236|       |  // to be called ("trivially copyable" requires a trivial destructor).
  237|  13.7k|}
_ZNK4absl12lts_2026052622internal_any_invocable4ImplIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEERKNS6_8FuzzTestEEE14ExtractInvokerEv:
  736|      2|    InvokerType<noex, ReturnType, P...>* ExtractInvoker() cv {                 \
  737|      2|      using QualifiedTestType = int cv ref;                                    \
  738|      2|      auto* invoker = this->invoker_;                                          \
  739|      2|      if (!std::is_const<QualifiedTestType>::value &&                          \
  ------------------
  |  Branch (739:11): [Folded, False: 2]
  ------------------
  740|      2|          std::is_rvalue_reference<QualifiedTestType>::value) {                \
  ------------------
  |  Branch (740:11): [Folded, False: 0]
  ------------------
  741|      0|        ABSL_ASSERT([this]() {                                                 \
  ------------------
  |  |  127|      0|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  ------------------
  |  |  |  |   87|      0|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:42): [Folded, False: 0]
  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  742|      0|          /* We checked that this isn't const above, so const_cast is safe */  \
  743|      0|          const_cast<Impl*>(this)->invoker_ = InvokedAfterMove;                \
  744|      0|          return this->HasValue();                                             \
  745|      0|        }());                                                                  \
  746|      0|      }                                                                        \
  747|      2|      return invoker;                                                          \
  748|      2|    }                                                                          \
_ZN4absl12lts_2026052622internal_any_invocable4ImplIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEERKNS6_8FuzzTestEEEC2IZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISO_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSN_EENS4_I11avifDecoderSN_EEEEENS6_9NoFixtureEPFvSR_RKSU_SW_SY_EPvEENS0_12AnyInvocableISE_EEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_EENS1_19ConversionConstructEOS1B_:
  719|      2|        : Core(TypedConversionConstruct<                                       \
  720|      2|                   typename std::decay<F>::type inv_quals>(),                  \
  721|      2|               std::forward<F>(f)) {}                                          \
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEEC2IRKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_RKST_SV_SX_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_S1F_EENS1_24TypedConversionConstructIS1B_EEOS19_:
  417|      2|  explicit CoreImpl(TypedConversionConstruct<QualDecayedTRef>, F&& f) {
  418|      2|    using DecayedT = RemoveCVRef<QualDecayedTRef>;
  419|       |
  420|       |    if constexpr (std::is_pointer<DecayedT>::value ||
  421|       |                  std::is_member_pointer<DecayedT>::value) {
  422|       |      // This condition handles types that decay into pointers. This includes
  423|       |      // function references, which cannot be null. GCC warns against comparing
  424|       |      // their decayed form with nullptr (https://godbolt.org/z/9r9TMTcPK).
  425|       |      // We could work around this warning with constexpr programming, using
  426|       |      // std::is_function_v<std::remove_reference_t<F>>, but we choose to ignore
  427|       |      // it instead of writing more code.
  428|       |#if !defined(__clang__) && defined(__GNUC__)
  429|       |#pragma GCC diagnostic push
  430|       |#pragma GCC diagnostic ignored "-Wpragmas"
  431|       |#pragma GCC diagnostic ignored "-Waddress"
  432|       |#pragma GCC diagnostic ignored "-Wnonnull-compare"
  433|       |#endif
  434|       |      if (static_cast<DecayedT>(f) == nullptr) {
  435|       |#if !defined(__clang__) && defined(__GNUC__)
  436|       |#pragma GCC diagnostic pop
  437|       |#endif
  438|       |        manager_ = EmptyManager;
  439|       |        invoker_ = nullptr;
  440|       |      } else {
  441|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  442|       |      }
  443|       |    } else if constexpr (IsCompatibleAnyInvocable<DecayedT>::value) {
  444|       |      // In this case we can "steal the guts" of the other AnyInvocable.
  445|       |      f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
  446|       |      manager_ = f.manager_;
  447|       |      invoker_ = f.invoker_;
  448|       |
  449|       |      f.manager_ = EmptyManager;
  450|       |      f.invoker_ = nullptr;
  451|       |    } else if constexpr (IsAnyInvocable<DecayedT>::value) {
  452|       |      if (f.HasValue()) {
  453|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  454|       |      } else {
  455|       |        manager_ = EmptyManager;
  456|       |        invoker_ = nullptr;
  457|       |      }
  458|      2|    } else {
  459|      2|      InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  460|      2|    }
  461|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEE17InitializeStorageIRKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_RKST_SV_SX_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_JS1F_EEEvDpOT0_:
  513|      2|  void InitializeStorage(Args&&... args) {
  514|      2|    using RawT = RemoveCVRef<QualTRef>;
  515|       |    if constexpr (IsStoredLocally<RawT>()) {
  516|       |      ::new (static_cast<void*>(&state_.storage))
  517|       |          RawT(std::forward<Args>(args)...);
  518|       |      invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  519|       |      // We can simplify our manager if we know the type is trivially copyable.
  520|       |      if constexpr (std::is_trivially_copyable_v<RawT>) {
  521|       |        manager_ = LocalManagerTrivial;
  522|       |      } else {
  523|       |        manager_ = LocalManagerNontrivial<RawT>;
  524|       |      }
  525|      2|    } else {
  526|      2|      InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
  527|       |      // This is set after everything else in case an exception is thrown in an
  528|       |      // earlier step of the initialization.
  529|      2|      invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  530|      2|    }
  531|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEE23InitializeRemoteManagerIZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_RKST_SV_SX_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_JS1F_EEEvDpOT0_:
  534|      2|  void InitializeRemoteManager(Args&&... args) {
  535|       |    if constexpr (std::is_trivially_destructible_v<T> &&
  536|       |                  alignof(T) <= ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT) {
  537|       |      // unique_ptr is used for exception-safety in case construction throws.
  538|       |      std::unique_ptr<void, TrivialDeleter> uninitialized_target(
  539|       |          ::operator new(sizeof(T)), TrivialDeleter(sizeof(T)));
  540|       |      ::new (uninitialized_target.get()) T(std::forward<Args>(args)...);
  541|       |      state_.remote.target = uninitialized_target.release();
  542|       |      state_.remote.size = sizeof(T);
  543|       |      manager_ = RemoteManagerTrivial;
  544|      2|    } else {
  545|      2|      state_.remote.target = ::new T(std::forward<Args>(args)...);
  546|      2|      manager_ = RemoteManagerNontrivial<T>;
  547|      2|    }
  548|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable23RemoteManagerNontrivialIZN8fuzztest8internal17RegistrationToken24GetFuzzTestFuzzerFactoryINS4_27RegistrationWithDomainsBaseIJNSt3__16vectorINS8_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS8_9allocatorISE_EEEENS8_5arrayI15avifScalingModeLm4EEENSA_I11avifEncoderSD_EENSA_I11avifDecoderSD_EEEEENS4_9NoFixtureEPFvSH_RKSK_SM_SO_EPvEENS0_12AnyInvocableIKFNSA_INS4_14FuzzTestFuzzerENS8_14default_deleteISX_EEEERKNS4_8FuzzTestEEEEONS4_12RegistrationIT0_T1_T_T2_EEEUlS13_E_EEvNS1_14FunctionToCallEPNS1_15TypeErasedStateES1G_:
  309|      4|                             TypeErasedState* const to) noexcept {
  310|      4|  static_assert(!IsStoredLocally<T>(),
  311|      4|                "Remote storage must only be used for types that do not "
  312|      4|                "qualify for local storage.");
  313|       |
  314|      4|  switch (operation) {
  ------------------
  |  Branch (314:11): [True: 4, False: 0]
  ------------------
  315|      4|    case FunctionToCall::relocate_from_to:
  ------------------
  |  Branch (315:5): [True: 4, False: 0]
  ------------------
  316|      4|    case FunctionToCall::relocate_from_to_and_query_rust:
  ------------------
  |  Branch (316:5): [True: 0, False: 4]
  ------------------
  317|       |      // NOTE: Requires that the left-hand operand is already empty.
  318|      4|      to->remote.target = from->remote.target;
  319|      4|      return;
  320|      0|    case FunctionToCall::dispose:
  ------------------
  |  Branch (320:5): [True: 0, False: 4]
  ------------------
  321|      0|      ::delete static_cast<T*>(from->remote.target);  // Must not throw.
  322|      0|      return;
  323|      4|  }
  324|      0|  ABSL_UNREACHABLE();
  ------------------
  |  |  237|      0|  do {                                           \
  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  ------------------
  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  ------------------
  |  |  241|      0|  } while (false)
  |  |  ------------------
  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  325|      0|}
_ZN4absl12lts_2026052622internal_any_invocable13RemoteInvokerILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEERKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISI_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSH_EENS4_I11avifDecoderSH_EEEEENS6_9NoFixtureEPFvSL_RKSO_SQ_SS_EPvEENS0_12AnyInvocableIKFSA_RKNS6_8FuzzTestEEEEONS6_12RegistrationIT0_T1_T_T2_EEEUlS13_E_JS13_EEES17_PNS1_15TypeErasedStateEDpNS1_18ForwardedParameterIT2_E4typeE:
  331|      2|    ForwardedParameterType<P>... args) noexcept(SigIsNoexcept) {
  332|      2|  using RawT = RemoveCVRef<QualTRef>;
  333|      2|  static_assert(!IsStoredLocally<RawT>(),
  334|      2|                "Target object must be in remote storage in order to be "
  335|      2|                "invoked from it.");
  336|       |
  337|      2|  auto& f = *static_cast<RawT*>(state->remote.target);
  338|      2|  return (InvokeR<ReturnType>)(static_cast<QualTRef>(f),
  339|      2|                               static_cast<ForwardedParameterType<P>>(args)...);
  340|      2|}
_ZN4absl12lts_2026052622internal_any_invocable7InvokeRINSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEERKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISI_EEEENS3_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderSH_EENS4_I11avifDecoderSH_EEEEENS6_9NoFixtureEPFvSL_RKSO_SQ_SS_EPvEENS0_12AnyInvocableIKFSA_RKNS6_8FuzzTestEEEEONS6_12RegistrationIT0_T1_T_T2_EEEUlS13_E_JS13_EEES19_OS17_DpOT1_:
  119|      2|ReturnType InvokeR(F&& f, P&&... args) {
  120|       |  if constexpr (std::is_void_v<ReturnType>) {
  121|       |    std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  122|      2|  } else {
  123|      2|    return std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  124|      2|  }
  125|      2|}
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEED2Ev:
  499|      8|  ~CoreImpl() { manager_(FunctionToCall::dispose, &state_, &state_); }
_ZN4absl12lts_2026052622internal_any_invocable4ImplIKFNSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEERKNS6_8FuzzTestEEEC2IZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISO_EEEENS4_I11avifEncoderSN_EENS4_I11avifDecoderSN_EEEEENS6_9NoFixtureEPFvSR_ST_SV_EPvEENS0_12AnyInvocableISE_EEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_EENS1_19ConversionConstructEOS16_:
  719|      2|        : Core(TypedConversionConstruct<                                       \
  720|      2|                   typename std::decay<F>::type inv_quals>(),                  \
  721|      2|               std::forward<F>(f)) {}                                          \
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEEC2IRKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_SS_SU_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_S1A_EENS1_24TypedConversionConstructIS16_EEOS14_:
  417|      2|  explicit CoreImpl(TypedConversionConstruct<QualDecayedTRef>, F&& f) {
  418|      2|    using DecayedT = RemoveCVRef<QualDecayedTRef>;
  419|       |
  420|       |    if constexpr (std::is_pointer<DecayedT>::value ||
  421|       |                  std::is_member_pointer<DecayedT>::value) {
  422|       |      // This condition handles types that decay into pointers. This includes
  423|       |      // function references, which cannot be null. GCC warns against comparing
  424|       |      // their decayed form with nullptr (https://godbolt.org/z/9r9TMTcPK).
  425|       |      // We could work around this warning with constexpr programming, using
  426|       |      // std::is_function_v<std::remove_reference_t<F>>, but we choose to ignore
  427|       |      // it instead of writing more code.
  428|       |#if !defined(__clang__) && defined(__GNUC__)
  429|       |#pragma GCC diagnostic push
  430|       |#pragma GCC diagnostic ignored "-Wpragmas"
  431|       |#pragma GCC diagnostic ignored "-Waddress"
  432|       |#pragma GCC diagnostic ignored "-Wnonnull-compare"
  433|       |#endif
  434|       |      if (static_cast<DecayedT>(f) == nullptr) {
  435|       |#if !defined(__clang__) && defined(__GNUC__)
  436|       |#pragma GCC diagnostic pop
  437|       |#endif
  438|       |        manager_ = EmptyManager;
  439|       |        invoker_ = nullptr;
  440|       |      } else {
  441|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  442|       |      }
  443|       |    } else if constexpr (IsCompatibleAnyInvocable<DecayedT>::value) {
  444|       |      // In this case we can "steal the guts" of the other AnyInvocable.
  445|       |      f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
  446|       |      manager_ = f.manager_;
  447|       |      invoker_ = f.invoker_;
  448|       |
  449|       |      f.manager_ = EmptyManager;
  450|       |      f.invoker_ = nullptr;
  451|       |    } else if constexpr (IsAnyInvocable<DecayedT>::value) {
  452|       |      if (f.HasValue()) {
  453|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  454|       |      } else {
  455|       |        manager_ = EmptyManager;
  456|       |        invoker_ = nullptr;
  457|       |      }
  458|      2|    } else {
  459|      2|      InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  460|      2|    }
  461|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEE17InitializeStorageIRKZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_SS_SU_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_JS1A_EEEvDpOT0_:
  513|      2|  void InitializeStorage(Args&&... args) {
  514|      2|    using RawT = RemoveCVRef<QualTRef>;
  515|       |    if constexpr (IsStoredLocally<RawT>()) {
  516|       |      ::new (static_cast<void*>(&state_.storage))
  517|       |          RawT(std::forward<Args>(args)...);
  518|       |      invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  519|       |      // We can simplify our manager if we know the type is trivially copyable.
  520|       |      if constexpr (std::is_trivially_copyable_v<RawT>) {
  521|       |        manager_ = LocalManagerTrivial;
  522|       |      } else {
  523|       |        manager_ = LocalManagerNontrivial<RawT>;
  524|       |      }
  525|      2|    } else {
  526|      2|      InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
  527|       |      // This is set after everything else in case an exception is thrown in an
  528|       |      // earlier step of the initialization.
  529|      2|      invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  530|      2|    }
  531|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEE23InitializeRemoteManagerIZNS6_17RegistrationToken24GetFuzzTestFuzzerFactoryINS6_27RegistrationWithDomainsBaseIJNS3_6vectorINS4_I9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISN_EEEENS4_I11avifEncoderSM_EENS4_I11avifDecoderSM_EEEEENS6_9NoFixtureEPFvSQ_SS_SU_EPvEENS0_12AnyInvocableIKFSA_SD_EEEONS6_12RegistrationIT0_T1_T_T2_EEEUlSD_E_JS1A_EEEvDpOT0_:
  534|      2|  void InitializeRemoteManager(Args&&... args) {
  535|       |    if constexpr (std::is_trivially_destructible_v<T> &&
  536|       |                  alignof(T) <= ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT) {
  537|       |      // unique_ptr is used for exception-safety in case construction throws.
  538|       |      std::unique_ptr<void, TrivialDeleter> uninitialized_target(
  539|       |          ::operator new(sizeof(T)), TrivialDeleter(sizeof(T)));
  540|       |      ::new (uninitialized_target.get()) T(std::forward<Args>(args)...);
  541|       |      state_.remote.target = uninitialized_target.release();
  542|       |      state_.remote.size = sizeof(T);
  543|       |      manager_ = RemoteManagerTrivial;
  544|      2|    } else {
  545|      2|      state_.remote.target = ::new T(std::forward<Args>(args)...);
  546|      2|      manager_ = RemoteManagerNontrivial<T>;
  547|      2|    }
  548|      2|  }
_ZN4absl12lts_2026052622internal_any_invocable23RemoteManagerNontrivialIZN8fuzztest8internal17RegistrationToken24GetFuzzTestFuzzerFactoryINS4_27RegistrationWithDomainsBaseIJNSt3__16vectorINS8_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS8_9allocatorISE_EEEENSA_I11avifEncoderSD_EENSA_I11avifDecoderSD_EEEEENS4_9NoFixtureEPFvSH_SJ_SL_EPvEENS0_12AnyInvocableIKFNSA_INS4_14FuzzTestFuzzerENS8_14default_deleteISS_EEEERKNS4_8FuzzTestEEEEONS4_12RegistrationIT0_T1_T_T2_EEEUlSY_E_EEvNS1_14FunctionToCallEPNS1_15TypeErasedStateES1B_:
  309|      4|                             TypeErasedState* const to) noexcept {
  310|      4|  static_assert(!IsStoredLocally<T>(),
  311|      4|                "Remote storage must only be used for types that do not "
  312|      4|                "qualify for local storage.");
  313|       |
  314|      4|  switch (operation) {
  ------------------
  |  Branch (314:11): [True: 4, False: 0]
  ------------------
  315|      4|    case FunctionToCall::relocate_from_to:
  ------------------
  |  Branch (315:5): [True: 4, False: 0]
  ------------------
  316|      4|    case FunctionToCall::relocate_from_to_and_query_rust:
  ------------------
  |  Branch (316:5): [True: 0, False: 4]
  ------------------
  317|       |      // NOTE: Requires that the left-hand operand is already empty.
  318|      4|      to->remote.target = from->remote.target;
  319|      4|      return;
  320|      0|    case FunctionToCall::dispose:
  ------------------
  |  Branch (320:5): [True: 0, False: 4]
  ------------------
  321|      0|      ::delete static_cast<T*>(from->remote.target);  // Must not throw.
  322|      0|      return;
  323|      4|  }
  324|      0|  ABSL_UNREACHABLE();
  ------------------
  |  |  237|      0|  do {                                           \
  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  ------------------
  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  ------------------
  |  |  241|      0|  } while (false)
  |  |  ------------------
  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  325|      0|}
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0ENSt3__110unique_ptrIN8fuzztest8internal14FuzzTestFuzzerENS3_14default_deleteIS7_EEEEJRKNS6_8FuzzTestEEEC2EOSE_:
  471|      8|  CoreImpl(CoreImpl&& other) noexcept {
  472|      8|    other.manager_(FunctionToCall::relocate_from_to, &other.state_, &state_);
  473|      8|    manager_ = other.manager_;
  474|      8|    invoker_ = other.invoker_;
  475|      8|    other.manager_ = EmptyManager;
  476|      8|    other.invoker_ = nullptr;
  477|      8|  }
_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0EvJEED2Ev:
  499|  13.7k|  ~CoreImpl() { manager_(FunctionToCall::dispose, &state_, &state_); }
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable4ImplIFvvOEEC2IZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS7_13ConfigurationEE3$_0EENS1_19ConversionConstructEOT_:
  719|      2|        : Core(TypedConversionConstruct<                                       \
  720|      2|                   typename std::decay<F>::type inv_quals>(),                  \
  721|      2|               std::forward<F>(f)) {}                                          \
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0EvJEEC2IOZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS6_13ConfigurationEE3$_0SF_EENS1_24TypedConversionConstructIT_EEOT0_:
  417|      2|  explicit CoreImpl(TypedConversionConstruct<QualDecayedTRef>, F&& f) {
  418|      2|    using DecayedT = RemoveCVRef<QualDecayedTRef>;
  419|       |
  420|       |    if constexpr (std::is_pointer<DecayedT>::value ||
  421|       |                  std::is_member_pointer<DecayedT>::value) {
  422|       |      // This condition handles types that decay into pointers. This includes
  423|       |      // function references, which cannot be null. GCC warns against comparing
  424|       |      // their decayed form with nullptr (https://godbolt.org/z/9r9TMTcPK).
  425|       |      // We could work around this warning with constexpr programming, using
  426|       |      // std::is_function_v<std::remove_reference_t<F>>, but we choose to ignore
  427|       |      // it instead of writing more code.
  428|       |#if !defined(__clang__) && defined(__GNUC__)
  429|       |#pragma GCC diagnostic push
  430|       |#pragma GCC diagnostic ignored "-Wpragmas"
  431|       |#pragma GCC diagnostic ignored "-Waddress"
  432|       |#pragma GCC diagnostic ignored "-Wnonnull-compare"
  433|       |#endif
  434|       |      if (static_cast<DecayedT>(f) == nullptr) {
  435|       |#if !defined(__clang__) && defined(__GNUC__)
  436|       |#pragma GCC diagnostic pop
  437|       |#endif
  438|       |        manager_ = EmptyManager;
  439|       |        invoker_ = nullptr;
  440|       |      } else {
  441|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  442|       |      }
  443|       |    } else if constexpr (IsCompatibleAnyInvocable<DecayedT>::value) {
  444|       |      // In this case we can "steal the guts" of the other AnyInvocable.
  445|       |      f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
  446|       |      manager_ = f.manager_;
  447|       |      invoker_ = f.invoker_;
  448|       |
  449|       |      f.manager_ = EmptyManager;
  450|       |      f.invoker_ = nullptr;
  451|       |    } else if constexpr (IsAnyInvocable<DecayedT>::value) {
  452|       |      if (f.HasValue()) {
  453|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  454|       |      } else {
  455|       |        manager_ = EmptyManager;
  456|       |        invoker_ = nullptr;
  457|       |      }
  458|      2|    } else {
  459|      2|      InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  460|      2|    }
  461|      2|  }
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0EvJEE17InitializeStorageIOZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS6_13ConfigurationEE3$_0JSF_EEEvDpOT0_:
  513|      2|  void InitializeStorage(Args&&... args) {
  514|      2|    using RawT = RemoveCVRef<QualTRef>;
  515|      2|    if constexpr (IsStoredLocally<RawT>()) {
  516|      2|      ::new (static_cast<void*>(&state_.storage))
  517|      2|          RawT(std::forward<Args>(args)...);
  518|      2|      invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  519|       |      // We can simplify our manager if we know the type is trivially copyable.
  520|      2|      if constexpr (std::is_trivially_copyable_v<RawT>) {
  521|      2|        manager_ = LocalManagerTrivial;
  522|       |      } else {
  523|       |        manager_ = LocalManagerNontrivial<RawT>;
  524|       |      }
  525|       |    } else {
  526|       |      InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
  527|       |      // This is set after everything else in case an exception is thrown in an
  528|       |      // earlier step of the initialization.
  529|       |      invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  530|       |    }
  531|      2|  }
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable12LocalInvokerILb0EvOZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS4_13ConfigurationEE3$_0JEEET0_PNS1_15TypeErasedStateEDpNS1_18ForwardedParameterIT2_E4typeE:
  271|      2|    ForwardedParameterType<P>... args) noexcept(SigIsNoexcept) {
  272|      2|  using RawT = RemoveCVRef<QualTRef>;
  273|      2|  static_assert(
  274|      2|      IsStoredLocally<RawT>(),
  275|      2|      "Target object must be in local storage in order to be invoked from it.");
  276|       |
  277|      2|  auto& f = (ObjectInLocalStorage<RawT>)(state);
  278|      2|  return (InvokeR<ReturnType>)(static_cast<QualTRef>(f),
  279|      2|                               static_cast<ForwardedParameterType<P>>(args)...);
  280|      2|}
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable20ObjectInLocalStorageIZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS4_13ConfigurationEE3$_0EERT_PNS1_15TypeErasedStateE:
  191|      2|T& ObjectInLocalStorage(TypeErasedState* const state) {
  192|       |  // We launder here because the storage may be reused with the same type.
  193|      2|  return *std::launder(reinterpret_cast<T*>(&state->storage));
  194|      2|}
compatibility_mode.cc:_ZN4absl12lts_2026052622internal_any_invocable7InvokeRIvZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS4_13ConfigurationEE3$_0JEEET_OT0_DpOT1_:
  119|      2|ReturnType InvokeR(F&& f, P&&... args) {
  120|      2|  if constexpr (std::is_void_v<ReturnType>) {
  121|      2|    std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  122|       |  } else {
  123|       |    return std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  124|       |  }
  125|      2|}
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable4ImplIFvvOEEC2IZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS8_5InputEE3$_0EENS1_19ConversionConstructEOT_:
  719|  13.7k|        : Core(TypedConversionConstruct<                                       \
  720|  13.7k|                   typename std::decay<F>::type inv_quals>(),                  \
  721|  13.7k|               std::forward<F>(f)) {}                                          \
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0EvJEEC2IOZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS7_5InputEE3$_0SB_EENS1_24TypedConversionConstructIT_EEOT0_:
  417|  13.7k|  explicit CoreImpl(TypedConversionConstruct<QualDecayedTRef>, F&& f) {
  418|  13.7k|    using DecayedT = RemoveCVRef<QualDecayedTRef>;
  419|       |
  420|       |    if constexpr (std::is_pointer<DecayedT>::value ||
  421|       |                  std::is_member_pointer<DecayedT>::value) {
  422|       |      // This condition handles types that decay into pointers. This includes
  423|       |      // function references, which cannot be null. GCC warns against comparing
  424|       |      // their decayed form with nullptr (https://godbolt.org/z/9r9TMTcPK).
  425|       |      // We could work around this warning with constexpr programming, using
  426|       |      // std::is_function_v<std::remove_reference_t<F>>, but we choose to ignore
  427|       |      // it instead of writing more code.
  428|       |#if !defined(__clang__) && defined(__GNUC__)
  429|       |#pragma GCC diagnostic push
  430|       |#pragma GCC diagnostic ignored "-Wpragmas"
  431|       |#pragma GCC diagnostic ignored "-Waddress"
  432|       |#pragma GCC diagnostic ignored "-Wnonnull-compare"
  433|       |#endif
  434|       |      if (static_cast<DecayedT>(f) == nullptr) {
  435|       |#if !defined(__clang__) && defined(__GNUC__)
  436|       |#pragma GCC diagnostic pop
  437|       |#endif
  438|       |        manager_ = EmptyManager;
  439|       |        invoker_ = nullptr;
  440|       |      } else {
  441|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  442|       |      }
  443|       |    } else if constexpr (IsCompatibleAnyInvocable<DecayedT>::value) {
  444|       |      // In this case we can "steal the guts" of the other AnyInvocable.
  445|       |      f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
  446|       |      manager_ = f.manager_;
  447|       |      invoker_ = f.invoker_;
  448|       |
  449|       |      f.manager_ = EmptyManager;
  450|       |      f.invoker_ = nullptr;
  451|       |    } else if constexpr (IsAnyInvocable<DecayedT>::value) {
  452|       |      if (f.HasValue()) {
  453|       |        InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  454|       |      } else {
  455|       |        manager_ = EmptyManager;
  456|       |        invoker_ = nullptr;
  457|       |      }
  458|  13.7k|    } else {
  459|  13.7k|      InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
  460|  13.7k|    }
  461|  13.7k|  }
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable8CoreImplILb0EvJEE17InitializeStorageIOZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS7_5InputEE3$_0JSB_EEEvDpOT0_:
  513|  13.7k|  void InitializeStorage(Args&&... args) {
  514|  13.7k|    using RawT = RemoveCVRef<QualTRef>;
  515|  13.7k|    if constexpr (IsStoredLocally<RawT>()) {
  516|  13.7k|      ::new (static_cast<void*>(&state_.storage))
  517|  13.7k|          RawT(std::forward<Args>(args)...);
  518|  13.7k|      invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  519|       |      // We can simplify our manager if we know the type is trivially copyable.
  520|  13.7k|      if constexpr (std::is_trivially_copyable_v<RawT>) {
  521|  13.7k|        manager_ = LocalManagerTrivial;
  522|       |      } else {
  523|       |        manager_ = LocalManagerNontrivial<RawT>;
  524|       |      }
  525|       |    } else {
  526|       |      InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
  527|       |      // This is set after everything else in case an exception is thrown in an
  528|       |      // earlier step of the initialization.
  529|       |      invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
  530|       |    }
  531|  13.7k|  }
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable12LocalInvokerILb0EvOZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS5_5InputEE3$_0JEEET0_PNS1_15TypeErasedStateEDpNS1_18ForwardedParameterIT2_E4typeE:
  271|  13.7k|    ForwardedParameterType<P>... args) noexcept(SigIsNoexcept) {
  272|  13.7k|  using RawT = RemoveCVRef<QualTRef>;
  273|  13.7k|  static_assert(
  274|  13.7k|      IsStoredLocally<RawT>(),
  275|  13.7k|      "Target object must be in local storage in order to be invoked from it.");
  276|       |
  277|  13.7k|  auto& f = (ObjectInLocalStorage<RawT>)(state);
  278|  13.7k|  return (InvokeR<ReturnType>)(static_cast<QualTRef>(f),
  279|  13.7k|                               static_cast<ForwardedParameterType<P>>(args)...);
  280|  13.7k|}
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable20ObjectInLocalStorageIZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS5_5InputEE3$_0EERT_PNS1_15TypeErasedStateE:
  191|  13.7k|T& ObjectInLocalStorage(TypeErasedState* const state) {
  192|       |  // We launder here because the storage may be reused with the same type.
  193|  13.7k|  return *std::launder(reinterpret_cast<T*>(&state->storage));
  194|  13.7k|}
runtime.cc:_ZN4absl12lts_2026052622internal_any_invocable7InvokeRIvZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS5_5InputEE3$_0JEEET_OT0_DpOT1_:
  119|  13.7k|ReturnType InvokeR(F&& f, P&&... args) {
  120|  13.7k|  if constexpr (std::is_void_v<ReturnType>) {
  121|  13.7k|    std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  122|       |  } else {
  123|       |    return std::invoke(std::forward<F>(f), std::forward<P>(args)...);
  124|       |  }
  125|  13.7k|}
_ZN4absl12lts_2026052622internal_any_invocable4ImplIFvvOEE14ExtractInvokerEv:
  736|  13.7k|    InvokerType<noex, ReturnType, P...>* ExtractInvoker() cv {                 \
  737|  13.7k|      using QualifiedTestType = int cv ref;                                    \
  738|  13.7k|      auto* invoker = this->invoker_;                                          \
  739|  13.7k|      if (!std::is_const<QualifiedTestType>::value &&                          \
  ------------------
  |  Branch (739:11): [True: 0, Folded]
  ------------------
  740|  13.7k|          std::is_rvalue_reference<QualifiedTestType>::value) {                \
  ------------------
  |  Branch (740:11): [True: 0, Folded]
  ------------------
  741|  13.7k|        ABSL_ASSERT([this]() {                                                 \
  ------------------
  |  |  127|  13.7k|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  ------------------
  |  |  |  |   87|  13.7k|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:42): [Folded, False: 13.7k]
  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  742|  13.7k|          /* We checked that this isn't const above, so const_cast is safe */  \
  743|  13.7k|          const_cast<Impl*>(this)->invoker_ = InvokedAfterMove;                \
  744|  13.7k|          return this->HasValue();                                             \
  745|  13.7k|        }());                                                                  \
  746|  13.7k|      }                                                                        \
  747|  13.7k|      return invoker;                                                          \
  748|  13.7k|    }                                                                          \

init_fuzztest.cc:_ZN4absl12lts_2026052619functional_internal12InvokeObjectIRZN8fuzztest19ListRegisteredTestsEvE3$_0vJRNS3_8internal8FuzzTestEEEET0_NS1_7VoidPtrEDpNS1_8ForwardTIT1_E4typeE:
   74|     12|R InvokeObject(VoidPtr ptr, typename ForwardT<Args>::type... args) {
   75|     12|  using T = std::remove_reference_t<Obj>;
   76|     12|  return static_cast<R>(std::invoke(
   77|     12|      std::forward<Obj>(*const_cast<T*>(static_cast<const T*>(ptr.obj))),
   78|     12|      std::forward<typename ForwardT<Args>::type>(args)...));
   79|     12|}
init_fuzztest.cc:_ZN4absl12lts_2026052619functional_internal13AssertNonNullIZN8fuzztest19ListRegisteredTestsEvE3$_0EEvRKT_:
  136|      6|void AssertNonNull(const F&) {}
_ZN4absl12lts_2026052619functional_internal12InvokeObjectIRNS0_18container_internal7HashKeyINS3_10StringHashENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEELb1EEEmJmEEET0_NS1_7VoidPtrEDpNS1_8ForwardTIT1_E4typeE:
   74|      2|R InvokeObject(VoidPtr ptr, typename ForwardT<Args>::type... args) {
   75|      2|  using T = std::remove_reference_t<Obj>;
   76|      2|  return static_cast<R>(std::invoke(
   77|      2|      std::forward<Obj>(*const_cast<T*>(static_cast<const T*>(ptr.obj))),
   78|      2|      std::forward<typename ForwardT<Args>::type>(args)...));
   79|      2|}
_ZN4absl12lts_2026052619functional_internal13AssertNonNullINS0_18container_internal7HashKeyINS3_10StringHashENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEELb1EEEEEvRKT_:
  136|      4|void AssertNonNull(const F&) {}
googletest_adaptor.cc:_ZN4absl12lts_2026052619functional_internal12InvokeObjectIRZN8fuzztest8internal30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS4_13ConfigurationEE3$_0vJRNS4_8FuzzTestEEEET0_NS1_7VoidPtrEDpNS1_8ForwardTIT1_E4typeE:
   74|      4|R InvokeObject(VoidPtr ptr, typename ForwardT<Args>::type... args) {
   75|      4|  using T = std::remove_reference_t<Obj>;
   76|      4|  return static_cast<R>(std::invoke(
   77|      4|      std::forward<Obj>(*const_cast<T*>(static_cast<const T*>(ptr.obj))),
   78|      4|      std::forward<typename ForwardT<Args>::type>(args)...));
   79|      4|}
googletest_adaptor.cc:_ZN4absl12lts_2026052619functional_internal13AssertNonNullIZN8fuzztest8internal30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS4_13ConfigurationEE3$_0EEvRKT_:
  136|      2|void AssertNonNull(const F&) {}
status.cc:_ZN4absl12lts_2026052619functional_internal13AssertNonNullIZ10SetMessageRKNS0_6StatusENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEE3$_0EEvRKT_:
  136|    115|void AssertNonNull(const F&) {}

_ZN4absl12lts_2026052613hash_internal43CombineLargeContiguousImplOn64BitLengthGt32EmPKhm:
  417|      8|                                                     size_t len) {
  418|      8|  assert(len > 32);
  419|      8|  assert(sizeof(size_t) == 8);  // NOLINT(misc-static-assert)
  420|      8|  if (ABSL_PREDICT_TRUE(len <= PiecewiseChunkSize())) {
  ------------------
  |  |  191|      8|#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
  |  |  ------------------
  |  |  |  Branch (191:30): [True: 8, False: 0]
  |  |  |  Branch (191:48): [Folded, False: 8]
  |  |  |  Branch (191:57): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  421|      8|    return HashBlockOn64Bit(state, first, len);
  422|      8|  }
  423|      0|  return SplitAndCombineOn64Bit(state, first, len);
  424|      8|}
hash.cc:_ZN4absl12lts_2026052613hash_internal12_GLOBAL__N_116HashBlockOn64BitEmPKhm:
  376|      8|    uint64_t state, const unsigned char* data, size_t len) {
  377|      8|#ifdef ABSL_HAVE_INTRINSIC_INT128
  378|      8|  return LowLevelHashLenGt32(state, data, len);
  379|       |#else
  380|       |  return hash_internal::CityHash64WithSeed(reinterpret_cast<const char*>(data),
  381|       |                                           len, state);
  382|       |#endif
  383|      8|}
hash.cc:_ZN4absl12lts_2026052613hash_internal12_GLOBAL__N_119LowLevelHashLenGt32EmPKvm:
  341|      8|                                              size_t len) {
  342|      8|  assert(len > 32);
  343|      8|  if (ABSL_PREDICT_FALSE(len > 64)) {
  ------------------
  |  |  190|      8|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 8]
  |  |  |  Branch (190:49): [Folded, False: 8]
  |  |  |  Branch (190:58): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  344|      0|    return LowLevelHashLenGt64(seed, data, len);
  345|      0|  }
  346|      8|  return LowLevelHash33To64(seed, static_cast<const uint8_t*>(data), len);
  347|      8|}
hash.cc:_ZN4absl12lts_2026052613hash_internal12_GLOBAL__N_110Mix32BytesEPKhm:
  271|     16|uint64_t Mix32Bytes(const uint8_t* ptr, uint64_t current_state) {
  272|     16|  uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
  273|     16|  uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
  274|     16|  uint64_t c = absl::base_internal::UnalignedLoad64(ptr + 16);
  275|     16|  uint64_t d = absl::base_internal::UnalignedLoad64(ptr + 24);
  276|       |
  277|     16|  uint64_t cs0 = Mix(a ^ kStaticRandomData[1], b ^ current_state);
  278|     16|  uint64_t cs1 = Mix(c ^ kStaticRandomData[2], d ^ current_state);
  279|     16|  return cs0 ^ cs1;
  280|     16|}
hash.cc:_ZN4absl12lts_2026052613hash_internal12_GLOBAL__N_118LowLevelHash33To64EmPKhm:
  282|      8|uint64_t LowLevelHash33To64(uint64_t seed, const uint8_t* ptr, size_t len) {
  283|      8|  assert(len > 32);
  284|       |  assert(len <= 64);
  285|      8|  uint64_t current_state = seed ^ kStaticRandomData[0] ^ len;
  286|      8|  const uint8_t* last_32_ptr = ptr + len - 32;
  287|      8|  return Mix32Bytes(last_32_ptr, Mix32Bytes(ptr, current_state));
  288|      8|}

_ZN4absl12lts_2026052613hash_internal15MixingHashState18combine_contiguousES2_PKhm:
 1399|     78|                                            size_t size) {
 1400|     78|    return MixingHashState(
 1401|     78|        CombineContiguousImpl(hash_state.state_, first, size,
 1402|     78|                              std::integral_constant<int, sizeof(size_t)>{}));
 1403|     78|  }
_ZN4absl12lts_2026052613hash_internal15MixingHashStateC2Em:
 1450|    156|  explicit MixingHashState(uint64_t state) : state_(state) {}
_ZN4absl12lts_2026052613hash_internal18PiecewiseChunkSizeEv:
  157|      8|constexpr size_t PiecewiseChunkSize() { return 1024; }
_ZN4absl12lts_2026052613hash_internal19PrecombineLengthMixEmm:
 1005|     70|inline uint64_t PrecombineLengthMix(uint64_t state, size_t len) {
 1006|     70|  ABSL_ASSUME(len + sizeof(uint64_t) <= sizeof(kStaticRandomData));
  ------------------
  |  |  271|     70|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1007|     70|  uint64_t data = absl::base_internal::UnalignedLoad64(
 1008|     70|      reinterpret_cast<const unsigned char*>(&kStaticRandomData[0]) + len);
 1009|     70|  return state ^ data;
 1010|     70|}
_ZN4absl12lts_2026052613hash_internal3MixEmm:
 1012|    122|ABSL_ATTRIBUTE_ALWAYS_INLINE inline uint64_t Mix(uint64_t lhs, uint64_t rhs) {
 1013|       |  // Though the 128-bit product needs multiple instructions on non-x86-64
 1014|       |  // platforms, it is still a good balance between speed and hash quality.
 1015|    122|  absl::uint128 m = lhs;
 1016|    122|  m *= rhs;
 1017|    122|  return Uint128High64(m) ^ Uint128Low64(m);
 1018|    122|}
_ZN4absl12lts_2026052613hash_internal5Read8EPKh:
 1028|    140|inline uint64_t Read8(const unsigned char* p) {
 1029|    140|  return absl::base_internal::UnalignedLoad64(p);
 1030|    140|}
_ZN4absl12lts_2026052613hash_internal9Read9To16EPKhm:
 1039|     30|                                               size_t len) {
 1040|     30|  return {Read8(p), Read8(p + len - 8)};
 1041|     30|}
_ZN4absl12lts_2026052613hash_internal8Read4To8EPKhm:
 1045|     20|inline uint64_t Read4To8(const unsigned char* p, size_t len) {
 1046|       |  // If `len < 8`, we duplicate bytes. We always put low memory at the end.
 1047|       |  // E.g., on little endian platforms:
 1048|       |  // `ABCD` will be read as `ABCDABCD`.
 1049|       |  // `ABCDE` will be read as `BCDEABCD`.
 1050|       |  // `ABCDEF` will be read as `CDEFABCD`.
 1051|       |  // `ABCDEFG` will be read as `DEFGABCD`.
 1052|       |  // `ABCDEFGH` will be read as `EFGHABCD`.
 1053|       |  // We also do not care about endianness. On big-endian platforms, bytes will
 1054|       |  // be permuted differently. We always shift low memory by 32, because that
 1055|       |  // can be pipelined earlier. Reading high memory requires computing
 1056|       |  // `p + len - 4`.
 1057|     20|  uint64_t most_significant =
 1058|     20|      static_cast<uint64_t>(absl::base_internal::UnalignedLoad32(p)) << 32;
 1059|     20|  uint64_t least_significant =
 1060|     20|      absl::base_internal::UnalignedLoad32(p + len - 4);
 1061|     20|  return most_significant | least_significant;
 1062|     20|}
_ZN4absl12lts_2026052613hash_internal14CombineRawImplEmm:
 1120|     20|                                                            uint64_t value) {
 1121|     20|  return Mix(state ^ value, kMul);
 1122|     20|}
_ZN4absl12lts_2026052613hash_internal26CombineSmallContiguousImplEmPKhm:
 1136|     20|    uint64_t state, const unsigned char* first, size_t len) {
 1137|     20|  ABSL_ASSUME(len <= 8);
  ------------------
  |  |  271|     20|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1138|     20|  uint64_t v;
 1139|     20|  if (len >= 4) {
  ------------------
  |  Branch (1139:7): [True: 20, False: 0]
  ------------------
 1140|     20|    v = Read4To8(first, len);
 1141|     20|  } else if (len > 0) {
  ------------------
  |  Branch (1141:14): [True: 0, False: 0]
  ------------------
 1142|      0|    v = Read1To3(first, len);
 1143|      0|  } else {
 1144|       |    // Empty string must modify the state.
 1145|      0|    v = 0x57;
 1146|      0|  }
 1147|     20|  return CombineRawImpl(state, v);
 1148|     20|}
_ZN4absl12lts_2026052613hash_internal26CombineContiguousImpl9to16EmPKhm:
 1151|     30|    uint64_t state, const unsigned char* first, size_t len) {
 1152|     30|  ABSL_ASSUME(len >= 9);
  ------------------
  |  |  271|     30|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1153|     30|  ABSL_ASSUME(len <= 16);
  ------------------
  |  |  271|     30|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1154|       |  // Note: any time one half of the mix function becomes zero it will fail to
 1155|       |  // incorporate any bits from the other half. However, there is exactly 1 in
 1156|       |  // 2^64 values for each side that achieve this, and only when the size is
 1157|       |  // exactly 16 -- for smaller sizes there is an overlapping byte that makes
 1158|       |  // this impossible unless the seed is *also* incredibly unlucky.
 1159|     30|  auto p = Read9To16(first, len);
 1160|     30|  return Mix(state ^ p.first, kMul ^ p.second);
 1161|     30|}
_ZN4absl12lts_2026052613hash_internal27CombineContiguousImpl17to32EmPKhm:
 1164|     20|    uint64_t state, const unsigned char* first, size_t len) {
 1165|     20|  ABSL_ASSUME(len >= 17);
  ------------------
  |  |  271|     20|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1166|     20|  ABSL_ASSUME(len <= 32);
  ------------------
  |  |  271|     20|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1167|       |  // Do two mixes of overlapping 16-byte ranges in parallel to minimize
 1168|       |  // latency.
 1169|     20|  const uint64_t m0 =
 1170|     20|      Mix(Read8(first) ^ kStaticRandomData[1], Read8(first + 8) ^ state);
 1171|       |
 1172|     20|  const unsigned char* tail_16b_ptr = first + (len - 16);
 1173|     20|  const uint64_t m1 = Mix(Read8(tail_16b_ptr) ^ kStaticRandomData[3],
 1174|     20|                          Read8(tail_16b_ptr + 8) ^ state);
 1175|     20|  return m0 ^ m1;
 1176|     20|}
_ZN4absl12lts_2026052613hash_internal21CombineContiguousImplEmPKhmNSt3__117integral_constantIiLi8EEE:
 1260|     78|    std::integral_constant<int, 8> /* sizeof_size_t */) {
 1261|       |  // For large values we use LowLevelHash or CityHash depending on the platform,
 1262|       |  // for small ones we use custom low latency hash.
 1263|     78|  if (len <= 8) {
  ------------------
  |  Branch (1263:7): [True: 20, False: 58]
  ------------------
 1264|     20|    return CombineSmallContiguousImpl(PrecombineLengthMix(state, len), first,
 1265|     20|                                      len);
 1266|     20|  }
 1267|     58|  if (len <= 16) {
  ------------------
  |  Branch (1267:7): [True: 30, False: 28]
  ------------------
 1268|     30|    return CombineContiguousImpl9to16(PrecombineLengthMix(state, len), first,
 1269|     30|                                      len);
 1270|     30|  }
 1271|     28|  if (len <= 32) {
  ------------------
  |  Branch (1271:7): [True: 20, False: 8]
  ------------------
 1272|     20|    return CombineContiguousImpl17to32(PrecombineLengthMix(state, len), first,
 1273|     20|                                       len);
 1274|     20|  }
 1275|       |  // We must not mix length into the state here because calling
 1276|       |  // CombineContiguousImpl twice with PiecewiseChunkSize() must be equivalent
 1277|       |  // to calling CombineLargeContiguousImpl once with 2 * PiecewiseChunkSize().
 1278|      8|  return CombineLargeContiguousImplOn64BitLengthGt32(state, first, len);
 1279|     28|}
_ZN4absl12lts_2026052613hash_internal13AbslHashValueINS1_15MixingHashStateEEET_S4_NSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
  661|     78|H AbslHashValue(H hash_state, absl::string_view str) {
  662|     78|  return H::combine_contiguous(std::move(hash_state), str.data(), str.size());
  663|     78|}
_ZN4absl12lts_2026052613hash_internal13HashStateBaseINS1_15MixingHashStateEE18combine_contiguousIcEES3_S3_PKT_m:
 1556|     78|H HashStateBase<H>::combine_contiguous(H state, const T* data, size_t size) {
 1557|     78|  return hash_internal::hash_range_or_bytes(std::move(state), data, size);
 1558|     78|}
_ZN4absl12lts_2026052613hash_internal19hash_range_or_bytesINS1_15MixingHashStateEcEENSt3__19enable_ifIXsr23is_uniquely_representedIT0_EE5valueET_E4typeES7_PKS6_m:
  978|     78|hash_range_or_bytes(H hash_state, const T* data, size_t size) {
  979|     78|  const auto* bytes = reinterpret_cast<const unsigned char*>(data);
  980|     78|  return H::combine_contiguous(std::move(hash_state), bytes, sizeof(T) * size);
  981|     78|}
_ZN4absl12lts_2026052613hash_internal13HashStateBaseINS1_15MixingHashStateEE7combineES3_:
  299|     78|  static H combine(H state) { return state; }
_ZN4absl12lts_2026052613hash_internal15MixingHashState14hash_with_seedINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEETnNS4_9enable_ifIXntsr16IntegralFastPathIT_EE5valueEiE4typeELi0EEEmRKSA_m:
 1423|     78|  static size_t hash_with_seed(const T& value, size_t seed) {
 1424|     78|    return static_cast<size_t>(combine(MixingHashState{seed}, value).state_);
 1425|     78|  }
_ZN4absl12lts_2026052613hash_internal13HashStateBaseINS1_15MixingHashStateEE7combineINSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEJEEES3_S3_RKT_DpRKT0_:
 1548|     78|H HashStateBase<H>::combine(H state, const T& value, const Ts&... values) {
 1549|     78|  return H::combine(hash_internal::HashSelect::template Apply<T>::Invoke(
 1550|     78|                        std::move(state), value),
 1551|     78|                    values...);
 1552|     78|}
_ZN4absl12lts_2026052613hash_internal10HashSelect14HashValueProbe6InvokeINS1_15MixingHashStateENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEENS6_9enable_ifIXsr3std7is_sameIT_DTcl13AbslHashValueclsr3stdE4movefp_Efp0_EEEE5valueESC_E4typeESC_RKT0_:
 1326|     78|        H> {
 1327|     78|      return AbslHashValue(std::move(state), value);
 1328|     78|    }
_ZNK4absl12lts_2026052613hash_internal12HashWithSeed4hashINS1_4HashINSt3__117basic_string_viewIcNS5_11char_traitsIcEEEEEES9_EEmRKT_RKT0_m:
  412|     78|  size_t hash(const Hasher& hasher, const T& value, size_t seed) const {
  413|       |    // NOLINTNEXTLINE(clang-diagnostic-sign-conversion)
  414|     78|    return hasher.hash_with_seed(value, seed);
  415|     78|  }
_ZNK4absl12lts_2026052613hash_internal8HashImplINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEE14hash_with_seedERKS7_m:
 1537|     78|  size_t hash_with_seed(const T& value, size_t seed) const {
 1538|     78|    return MixingHashState::hash_with_seed(value, seed);
 1539|     78|  }
_ZNK4absl12lts_2026052613hash_internal12HashWithSeed4hashINS0_18container_internal10StringHashENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEEmRKT_RKT0_m:
  412|     78|  size_t hash(const Hasher& hasher, const T& value, size_t seed) const {
  413|       |    // NOLINTNEXTLINE(clang-diagnostic-sign-conversion)
  414|     78|    return hasher.hash_with_seed(value, seed);
  415|     78|  }

_ZN4absl12lts_2026052611countl_zeroImEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  108|  20.6k|    countl_zero(T x) noexcept {
  109|  20.6k|  return numeric_internal::CountLeadingZeroes(x);
  110|  20.6k|}
_ZN4absl12lts_202605269bit_widthImEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  165|  4.08k|    bit_width(T x) noexcept {
  166|  4.08k|  return std::numeric_limits<T>::digits - countl_zero(x);
  167|  4.08k|}
_ZN4absl12lts_2026052611countr_zeroIjEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  123|     72|    countr_zero(T x) noexcept {
  124|     72|  return numeric_internal::CountTrailingZeroes(x);
  125|     72|}
_ZN4absl12lts_2026052611countr_zeroImEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  123|     19|    countr_zero(T x) noexcept {
  124|     19|  return numeric_internal::CountTrailingZeroes(x);
  125|     19|}
_ZN4absl12lts_2026052611countl_zeroIjEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  108|  11.6k|    countl_zero(T x) noexcept {
  109|  11.6k|  return numeric_internal::CountLeadingZeroes(x);
  110|  11.6k|}
_ZN4absl12lts_202605269bit_widthIjEENSt3__19enable_ifIXsr3std11is_unsignedIT_EE5valueEiE4typeES4_:
  165|  11.6k|    bit_width(T x) noexcept {
  166|  11.6k|  return std::numeric_limits<T>::digits - countl_zero(x);
  167|  11.6k|}

_ZN4absl12lts_202605267uint128rSEi:
  631|  22.2k|inline uint128& uint128::operator>>=(int amount) {
  632|  22.2k|  *this = *this >> amount;
  633|  22.2k|  return *this;
  634|  22.2k|}
_ZN4absl12lts_202605267uint128pLES1_:
  636|  2.20k|inline uint128& uint128::operator+=(uint128 other) {
  637|  2.20k|  *this = *this + other;
  638|  2.20k|  return *this;
  639|  2.20k|}
_ZN4absl12lts_202605267uint128mLES1_:
  646|  10.8k|inline uint128& uint128::operator*=(uint128 other) {
  647|  10.8k|  *this = *this * other;
  648|  10.8k|  return *this;
  649|  10.8k|}
_ZN4absl12lts_202605267uint128dVES1_:
  651|     62|inline uint128& uint128::operator/=(uint128 other) {
  652|     62|  *this = *this / other;
  653|     62|  return *this;
  654|     62|}
_ZN4absl12lts_2026052612Uint128Low64ENS0_7uint128E:
  661|  10.6k|constexpr uint64_t Uint128Low64(uint128 v) { return v.lo_; }
_ZN4absl12lts_2026052613Uint128High64ENS0_7uint128E:
  663|  45.4k|constexpr uint64_t Uint128High64(uint128 v) { return v.hi_; }
_ZNK4absl12lts_202605267uint128cvbEv:
  737|     62|constexpr uint128::operator bool() const { return lo_ || hi_; }
  ------------------
  |  Branch (737:51): [True: 26, False: 36]
  |  Branch (737:58): [True: 0, False: 36]
  ------------------
_ZNK4absl12lts_202605267uint128cvjEv:
  770|     62|constexpr uint128::operator unsigned int() const {
  771|     62|  return static_cast<unsigned int>(lo_);
  772|     62|}
_ZNK4absl12lts_202605267uint128cvmEv:
  777|  13.8k|constexpr uint128::operator unsigned long() const {  // NOLINT(runtime/int)
  778|  13.8k|  return static_cast<unsigned long>(lo_);            // NOLINT(runtime/int)
  779|  13.8k|}
_ZNK4absl12lts_202605267uint128cvoEv:
  794|   227k|constexpr uint128::operator unsigned __int128() const {
  795|   227k|  return (static_cast<unsigned __int128>(hi_) << 64) + lo_;
  796|   227k|}
_ZN4absl12lts_20260526eqENS0_7uint128ES1_:
  820|  20.6k|constexpr bool operator==(uint128 lhs, uint128 rhs) {
  821|  20.6k|#if defined(ABSL_HAVE_INTRINSIC_INT128)
  822|  20.6k|  return static_cast<unsigned __int128>(lhs) ==
  823|  20.6k|         static_cast<unsigned __int128>(rhs);
  824|       |#else
  825|       |  return (Uint128Low64(lhs) == Uint128Low64(rhs) &&
  826|       |          Uint128High64(lhs) == Uint128High64(rhs));
  827|       |#endif
  828|  20.6k|}
_ZN4absl12lts_20260526ltENS0_7uint128ES1_:
  832|  12.0k|constexpr bool operator<(uint128 lhs, uint128 rhs) {
  833|  12.0k|#ifdef ABSL_HAVE_INTRINSIC_INT128
  834|  12.0k|  return static_cast<unsigned __int128>(lhs) <
  835|  12.0k|         static_cast<unsigned __int128>(rhs);
  836|       |#else
  837|       |  return (Uint128High64(lhs) == Uint128High64(rhs))
  838|       |             ? (Uint128Low64(lhs) < Uint128Low64(rhs))
  839|       |             : (Uint128High64(lhs) < Uint128High64(rhs));
  840|       |#endif
  841|  12.0k|}
_ZN4absl12lts_20260526gtENS0_7uint128ES1_:
  843|  12.0k|constexpr bool operator>(uint128 lhs, uint128 rhs) { return rhs < lhs; }
_ZN4absl12lts_20260526anENS0_7uint128ES1_:
  923|  13.4k|constexpr inline uint128 operator&(uint128 lhs, uint128 rhs) {
  924|  13.4k|#if defined(ABSL_HAVE_INTRINSIC_INT128)
  925|  13.4k|  return static_cast<unsigned __int128>(lhs) &
  926|  13.4k|         static_cast<unsigned __int128>(rhs);
  927|       |#else
  928|       |  return MakeUint128(Uint128High64(lhs) & Uint128High64(rhs),
  929|       |                     Uint128Low64(lhs) & Uint128Low64(rhs));
  930|       |#endif
  931|  13.4k|}
_ZN4absl12lts_20260526eoENS0_7uint128ES1_:
  933|      4|constexpr inline uint128 operator^(uint128 lhs, uint128 rhs) {
  934|      4|#if defined(ABSL_HAVE_INTRINSIC_INT128)
  935|      4|  return static_cast<unsigned __int128>(lhs) ^
  936|      4|         static_cast<unsigned __int128>(rhs);
  937|       |#else
  938|       |  return MakeUint128(Uint128High64(lhs) ^ Uint128High64(rhs),
  939|       |                     Uint128Low64(lhs) ^ Uint128Low64(rhs));
  940|       |#endif
  941|      4|}
_ZN4absl12lts_202605267uint128eOES1_:
  953|      4|inline uint128& uint128::operator^=(uint128 other) {
  954|      4|  *this = *this ^ other;
  955|      4|  return *this;
  956|      4|}
_ZN4absl12lts_20260526lsENS0_7uint128Ei:
  960|  25.9k|constexpr uint128 operator<<(uint128 lhs, int amount) {
  961|  25.9k|#ifdef ABSL_HAVE_INTRINSIC_INT128
  962|  25.9k|  return static_cast<unsigned __int128>(lhs) << amount;
  963|       |#else
  964|       |  // uint64_t shifts of >= 64 are undefined, so we will need some
  965|       |  // special-casing.
  966|       |  return amount >= 64  ? MakeUint128(Uint128Low64(lhs) << (amount - 64), 0)
  967|       |         : amount == 0 ? lhs
  968|       |                       : MakeUint128((Uint128High64(lhs) << amount) |
  969|       |                                         (Uint128Low64(lhs) >> (64 - amount)),
  970|       |                                     Uint128Low64(lhs) << amount);
  971|       |#endif
  972|  25.9k|}
_ZN4absl12lts_20260526rsENS0_7uint128Ei:
  974|  22.2k|constexpr uint128 operator>>(uint128 lhs, int amount) {
  975|  22.2k|#ifdef ABSL_HAVE_INTRINSIC_INT128
  976|  22.2k|  return static_cast<unsigned __int128>(lhs) >> amount;
  977|       |#else
  978|       |  // uint64_t shifts of >= 64 are undefined, so we will need some
  979|       |  // special-casing.
  980|       |  return amount >= 64  ? MakeUint128(0, Uint128High64(lhs) >> (amount - 64))
  981|       |         : amount == 0 ? lhs
  982|       |                       : MakeUint128(Uint128High64(lhs) >> amount,
  983|       |                                     (Uint128Low64(lhs) >> amount) |
  984|       |                                         (Uint128High64(lhs) << (64 - amount)));
  985|       |#endif
  986|  22.2k|}
_ZN4absl12lts_20260526plENS0_7uint128ES1_:
  999|  3.66k|constexpr uint128 operator+(uint128 lhs, uint128 rhs) {
 1000|  3.66k|#if defined(ABSL_HAVE_INTRINSIC_INT128)
 1001|  3.66k|  return static_cast<unsigned __int128>(lhs) +
 1002|  3.66k|         static_cast<unsigned __int128>(rhs);
 1003|       |#else
 1004|       |  return int128_internal::AddResult(
 1005|       |      MakeUint128(Uint128High64(lhs) + Uint128High64(rhs),
 1006|       |                  Uint128Low64(lhs) + Uint128Low64(rhs)),
 1007|       |      lhs);
 1008|       |#endif
 1009|  3.66k|}
_ZN4absl12lts_20260526miENS0_7uint128ES1_:
 1022|  20.7k|constexpr uint128 operator-(uint128 lhs, uint128 rhs) {
 1023|  20.7k|#if defined(ABSL_HAVE_INTRINSIC_INT128)
 1024|  20.7k|  return static_cast<unsigned __int128>(lhs) -
 1025|  20.7k|         static_cast<unsigned __int128>(rhs);
 1026|       |#else
 1027|       |  return int128_internal::SubstructResult(
 1028|       |      MakeUint128(Uint128High64(lhs) - Uint128High64(rhs),
 1029|       |                  Uint128Low64(lhs) - Uint128Low64(rhs)),
 1030|       |      lhs, rhs);
 1031|       |#endif
 1032|  20.7k|}
_ZN4absl12lts_20260526mlENS0_7uint128ES1_:
 1059|  18.9k|constexpr uint128 operator*(uint128 lhs, uint128 rhs) {
 1060|       |  // TODO(strel) Remove once alignment issues are resolved and unsigned __int128
 1061|       |  // can be used for uint128 storage.
 1062|  18.9k|  return static_cast<unsigned __int128>(lhs) *
 1063|  18.9k|         static_cast<unsigned __int128>(rhs);
 1064|  18.9k|}
_ZN4absl12lts_20260526dvENS0_7uint128ES1_:
 1066|     62|constexpr uint128 operator/(uint128 lhs, uint128 rhs) {
 1067|     62|  return static_cast<unsigned __int128>(lhs) /
 1068|     62|         static_cast<unsigned __int128>(rhs);
 1069|     62|}
_ZN4absl12lts_20260526rmENS0_7uint128ES1_:
 1071|     62|constexpr uint128 operator%(uint128 lhs, uint128 rhs) {
 1072|     62|  return static_cast<unsigned __int128>(lhs) %
 1073|     62|         static_cast<unsigned __int128>(rhs);
 1074|     62|}
_ZN4absl12lts_202605267uint128ppEv:
 1091|    626|inline uint128& uint128::operator++() {
 1092|    626|  *this += 1;
 1093|    626|  return *this;
 1094|    626|}
_ZN4absl12lts_2026052615int128_internal15BitCastToSignedEm:
 1201|     21|constexpr int64_t BitCastToSigned(uint64_t v) {
 1202|       |  // Casting an unsigned integer to a signed integer of the same
 1203|       |  // width is implementation defined behavior if the source value would not fit
 1204|       |  // in the destination type. We step around it with a roundtrip bitwise not
 1205|       |  // operation to make sure this function remains constexpr. Clang, GCC, and
 1206|       |  // MSVC optimize this to a no-op on x86-64.
 1207|     21|  return v & (uint64_t{1} << 63) ? ~static_cast<int64_t>(~v)
  ------------------
  |  Branch (1207:10): [True: 0, False: 21]
  ------------------
 1208|     21|                                 : static_cast<int64_t>(v);
 1209|     21|}
_ZN4absl12lts_202605267uint128C2Ei:
  672|  49.8k|    : lo_{static_cast<uint64_t>(v)},
  673|  49.8k|      hi_{v < 0 ? (std::numeric_limits<uint64_t>::max)() : 0} {}
  ------------------
  |  Branch (673:11): [True: 0, False: 49.8k]
  ------------------
_ZN4absl12lts_202605267uint128C2Em:
  683|  42.8k|constexpr uint128::uint128(unsigned long v) : lo_{v}, hi_{0} {}
_ZN4absl12lts_202605267uint128C2Eo:
  692|   105k|    : lo_{static_cast<uint64_t>(v & ~uint64_t{0})},
  693|   105k|      hi_{static_cast<uint64_t>(v >> 64)} {}
_ZN4absl12lts_202605267uint128C2ENS0_6int128E:
  697|     21|    : lo_{Int128Low64(v)}, hi_{static_cast<uint64_t>(Int128High64(v))} {}

_ZN4absl12lts_2026052611Int128Low64ENS0_6int128E:
   42|     21|constexpr uint64_t Int128Low64(int128 v) {
   43|     21|  return static_cast<uint64_t>(v.v_ & ~uint64_t{0});
   44|     21|}
_ZN4absl12lts_2026052612Int128High64ENS0_6int128E:
   46|     21|constexpr int64_t Int128High64(int128 v) {
   47|       |  // Initially cast to unsigned to prevent a right shift on a negative value.
   48|     21|  return int128_internal::BitCastToSigned(
   49|     21|      static_cast<uint64_t>(static_cast<unsigned __int128>(v.v_) >> 64));
   50|     21|}
_ZNK4absl12lts_202605266int128cvnEv:
  138|     42|constexpr int128::operator __int128() const { return v_; }
_ZN4absl12lts_20260526ltENS0_6int128ES1_:
  201|     21|constexpr bool operator<(int128 lhs, int128 rhs) {
  202|     21|  return static_cast<__int128>(lhs) < static_cast<__int128>(rhs);
  203|     21|}
_ZN4absl12lts_202605266int128C2Ei:
   59|     42|constexpr int128::int128(int v) : v_{v} {}

_ZN4absl12lts_2026052616numeric_internal20CountLeadingZeroes32Ej:
  165|  11.6k|CountLeadingZeroes32(uint32_t x) {
  166|  11.6k|#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clz)
  167|       |  // Use __builtin_clz, which uses the following instructions:
  168|       |  //  x86: bsr, lzcnt
  169|       |  //  ARM64: clz
  170|       |  //  PPC: cntlzd
  171|       |
  172|  11.6k|  static_assert(sizeof(unsigned int) == sizeof(x),
  173|  11.6k|                "__builtin_clz does not take 32-bit arg");
  174|       |  // Handle 0 as a special case because __builtin_clz(0) is undefined.
  175|  11.6k|  return x == 0 ? 32 : __builtin_clz(x);
  ------------------
  |  Branch (175:10): [True: 0, False: 11.6k]
  ------------------
  176|       |#elif defined(_MSC_VER) && !defined(__clang__)
  177|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  178|       |  if (_BitScanReverse(&result, x)) {
  179|       |    return 31 - result;
  180|       |  }
  181|       |  return 32;
  182|       |#else
  183|       |  int zeroes = 28;
  184|       |  if (x >> 16) {
  185|       |    zeroes -= 16;
  186|       |    x >>= 16;
  187|       |  }
  188|       |  if (x >> 8) {
  189|       |    zeroes -= 8;
  190|       |    x >>= 8;
  191|       |  }
  192|       |  if (x >> 4) {
  193|       |    zeroes -= 4;
  194|       |    x >>= 4;
  195|       |  }
  196|       |  return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[x] + zeroes;
  197|       |#endif
  198|  11.6k|}
_ZN4absl12lts_2026052616numeric_internal20CountLeadingZeroes64Em:
  214|  20.6k|CountLeadingZeroes64(uint64_t x) {
  215|  20.6k|#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clzll)
  216|       |  // Use __builtin_clzll, which uses the following instructions:
  217|       |  //  x86: bsr, lzcnt
  218|       |  //  ARM64: clz
  219|       |  //  PPC: cntlzd
  220|  20.6k|  static_assert(sizeof(unsigned long long) == sizeof(x),  // NOLINT(runtime/int)
  221|  20.6k|                "__builtin_clzll does not take 64-bit arg");
  222|       |
  223|       |  // Handle 0 as a special case because __builtin_clzll(0) is undefined.
  224|  20.6k|  return x == 0 ? 64 : __builtin_clzll(x);
  ------------------
  |  Branch (224:10): [True: 0, False: 20.6k]
  ------------------
  225|       |#elif defined(_MSC_VER) && !defined(__clang__) && \
  226|       |    (defined(_M_X64) || defined(_M_ARM64))
  227|       |  // MSVC does not have __buitin_clzll. Use _BitScanReverse64.
  228|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  229|       |  if (_BitScanReverse64(&result, x)) {
  230|       |    return 63 - result;
  231|       |  }
  232|       |  return 64;
  233|       |#elif defined(_MSC_VER) && !defined(__clang__)
  234|       |  // MSVC does not have __buitin_clzll. Compose two calls to _BitScanReverse
  235|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  236|       |  if ((x >> 32) &&
  237|       |      _BitScanReverse(&result, static_cast<unsigned long>(x >> 32))) {
  238|       |    return 31 - result;
  239|       |  }
  240|       |  if (_BitScanReverse(&result, static_cast<unsigned long>(x))) {
  241|       |    return 63 - result;
  242|       |  }
  243|       |  return 64;
  244|       |#else
  245|       |  int zeroes = 60;
  246|       |  if (x >> 32) {
  247|       |    zeroes -= 32;
  248|       |    x >>= 32;
  249|       |  }
  250|       |  if (x >> 16) {
  251|       |    zeroes -= 16;
  252|       |    x >>= 16;
  253|       |  }
  254|       |  if (x >> 8) {
  255|       |    zeroes -= 8;
  256|       |    x >>= 8;
  257|       |  }
  258|       |  if (x >> 4) {
  259|       |    zeroes -= 4;
  260|       |    x >>= 4;
  261|       |  }
  262|       |  return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[x] + zeroes;
  263|       |#endif
  264|  20.6k|}
_ZN4absl12lts_2026052616numeric_internal28CountTrailingZeroesNonzero32Ej:
  285|     72|CountTrailingZeroesNonzero32(uint32_t x) {
  286|     72|#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctz)
  287|     72|  static_assert(sizeof(unsigned int) == sizeof(x),
  288|     72|                "__builtin_ctz does not take 32-bit arg");
  289|     72|  return __builtin_ctz(x);
  290|       |#elif defined(_MSC_VER) && !defined(__clang__)
  291|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  292|       |  _BitScanForward(&result, x);
  293|       |  return result;
  294|       |#else
  295|       |  int c = 31;
  296|       |  x &= ~x + 1;
  297|       |  if (x & 0x0000FFFF) c -= 16;
  298|       |  if (x & 0x00FF00FF) c -= 8;
  299|       |  if (x & 0x0F0F0F0F) c -= 4;
  300|       |  if (x & 0x33333333) c -= 2;
  301|       |  if (x & 0x55555555) c -= 1;
  302|       |  return c;
  303|       |#endif
  304|     72|}
_ZN4absl12lts_2026052616numeric_internal28CountTrailingZeroesNonzero64Em:
  307|     19|CountTrailingZeroesNonzero64(uint64_t x) {
  308|     19|#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctzll)
  309|     19|  static_assert(sizeof(unsigned long long) == sizeof(x),  // NOLINT(runtime/int)
  310|     19|                "__builtin_ctzll does not take 64-bit arg");
  311|     19|  return __builtin_ctzll(x);
  312|       |#elif defined(_MSC_VER) && !defined(__clang__) && \
  313|       |    (defined(_M_X64) || defined(_M_ARM64))
  314|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  315|       |  _BitScanForward64(&result, x);
  316|       |  return result;
  317|       |#elif defined(_MSC_VER) && !defined(__clang__)
  318|       |  unsigned long result = 0;  // NOLINT(runtime/int)
  319|       |  if (static_cast<uint32_t>(x) == 0) {
  320|       |    _BitScanForward(&result, static_cast<unsigned long>(x >> 32));
  321|       |    return result + 32;
  322|       |  }
  323|       |  _BitScanForward(&result, static_cast<unsigned long>(x));
  324|       |  return result;
  325|       |#else
  326|       |  int c = 63;
  327|       |  x &= ~x + 1;
  328|       |  if (x & 0x00000000FFFFFFFF) c -= 32;
  329|       |  if (x & 0x0000FFFF0000FFFF) c -= 16;
  330|       |  if (x & 0x00FF00FF00FF00FF) c -= 8;
  331|       |  if (x & 0x0F0F0F0F0F0F0F0F) c -= 4;
  332|       |  if (x & 0x3333333333333333) c -= 2;
  333|       |  if (x & 0x5555555555555555) c -= 1;
  334|       |  return c;
  335|       |#endif
  336|     19|}
_ZN4absl12lts_2026052616numeric_internal18CountLeadingZeroesImEEiT_:
  268|  20.6k|CountLeadingZeroes(T x) {
  269|  20.6k|  static_assert(std::is_unsigned<T>::value, "T must be unsigned");
  270|  20.6k|  static_assert(IsPowerOf2(std::numeric_limits<T>::digits),
  271|  20.6k|                "T must have a power-of-2 size");
  272|  20.6k|  static_assert(sizeof(T) <= sizeof(uint64_t), "T too large");
  273|  20.6k|  return sizeof(T) <= sizeof(uint16_t)
  ------------------
  |  Branch (273:10): [Folded, False: 20.6k]
  ------------------
  274|  20.6k|             ? CountLeadingZeroes16(static_cast<uint16_t>(x)) -
  275|      0|                   (std::numeric_limits<uint16_t>::digits -
  276|      0|                    std::numeric_limits<T>::digits)
  277|  20.6k|             : (sizeof(T) <= sizeof(uint32_t)
  ------------------
  |  Branch (277:17): [Folded, False: 20.6k]
  ------------------
  278|  20.6k|                    ? CountLeadingZeroes32(static_cast<uint32_t>(x)) -
  279|      0|                          (std::numeric_limits<uint32_t>::digits -
  280|      0|                           std::numeric_limits<T>::digits)
  281|  20.6k|                    : CountLeadingZeroes64(x));
  282|  20.6k|}
_ZN4absl12lts_2026052616numeric_internal19CountTrailingZeroesIjEEiT_:
  353|     72|CountTrailingZeroes(T x) noexcept {
  354|     72|  static_assert(std::is_unsigned<T>::value, "T must be unsigned");
  355|     72|  static_assert(IsPowerOf2(std::numeric_limits<T>::digits),
  356|     72|                "T must have a power-of-2 size");
  357|     72|  static_assert(sizeof(T) <= sizeof(uint64_t), "T too large");
  358|     72|  return x == 0 ? std::numeric_limits<T>::digits
  ------------------
  |  Branch (358:10): [True: 0, False: 72]
  ------------------
  359|     72|                : (sizeof(T) <= sizeof(uint16_t)
  ------------------
  |  Branch (359:20): [Folded, False: 72]
  ------------------
  360|     72|                       ? CountTrailingZeroesNonzero16(static_cast<uint16_t>(x))
  361|     72|                       : (sizeof(T) <= sizeof(uint32_t)
  ------------------
  |  Branch (361:27): [True: 72, Folded]
  ------------------
  362|     72|                              ? CountTrailingZeroesNonzero32(
  363|     72|                                    static_cast<uint32_t>(x))
  364|     72|                              : CountTrailingZeroesNonzero64(x)));
  365|     72|}
_ZN4absl12lts_2026052616numeric_internal19CountTrailingZeroesImEEiT_:
  353|     19|CountTrailingZeroes(T x) noexcept {
  354|     19|  static_assert(std::is_unsigned<T>::value, "T must be unsigned");
  355|     19|  static_assert(IsPowerOf2(std::numeric_limits<T>::digits),
  356|     19|                "T must have a power-of-2 size");
  357|     19|  static_assert(sizeof(T) <= sizeof(uint64_t), "T too large");
  358|     19|  return x == 0 ? std::numeric_limits<T>::digits
  ------------------
  |  Branch (358:10): [True: 0, False: 19]
  ------------------
  359|     19|                : (sizeof(T) <= sizeof(uint16_t)
  ------------------
  |  Branch (359:20): [Folded, False: 19]
  ------------------
  360|     19|                       ? CountTrailingZeroesNonzero16(static_cast<uint16_t>(x))
  361|     19|                       : (sizeof(T) <= sizeof(uint32_t)
  ------------------
  |  Branch (361:27): [Folded, False: 19]
  ------------------
  362|     19|                              ? CountTrailingZeroesNonzero32(
  363|      0|                                    static_cast<uint32_t>(x))
  364|     19|                              : CountTrailingZeroesNonzero64(x)));
  365|     19|}
_ZN4absl12lts_2026052616numeric_internal18CountLeadingZeroesIjEEiT_:
  268|  11.6k|CountLeadingZeroes(T x) {
  269|  11.6k|  static_assert(std::is_unsigned<T>::value, "T must be unsigned");
  270|  11.6k|  static_assert(IsPowerOf2(std::numeric_limits<T>::digits),
  271|  11.6k|                "T must have a power-of-2 size");
  272|  11.6k|  static_assert(sizeof(T) <= sizeof(uint64_t), "T too large");
  273|  11.6k|  return sizeof(T) <= sizeof(uint16_t)
  ------------------
  |  Branch (273:10): [Folded, False: 11.6k]
  ------------------
  274|  11.6k|             ? CountLeadingZeroes16(static_cast<uint16_t>(x)) -
  275|      0|                   (std::numeric_limits<uint16_t>::digits -
  276|      0|                    std::numeric_limits<T>::digits)
  277|  11.6k|             : (sizeof(T) <= sizeof(uint32_t)
  ------------------
  |  Branch (277:17): [True: 11.6k, Folded]
  ------------------
  278|  11.6k|                    ? CountLeadingZeroes32(static_cast<uint32_t>(x)) -
  279|  11.6k|                          (std::numeric_limits<uint32_t>::digits -
  280|  11.6k|                           std::numeric_limits<T>::digits)
  281|  11.6k|                    : CountLeadingZeroes64(x));
  282|  11.6k|}

_ZN4absl12lts_2026052615random_internal24InitDiscreteDistributionEPNSt3__16vectorIdNS2_9allocatorIdEEEE:
   34|      2|    std::vector<double>* probabilities) {
   35|       |  // The empty-case should already be handled by the constructor.
   36|      2|  assert(probabilities);
   37|      2|  assert(!probabilities->empty());
   38|       |
   39|       |  // Step 1. Normalize the input probabilities to 1.0.
   40|      2|  double sum = std::accumulate(std::begin(*probabilities),
   41|      2|                               std::end(*probabilities), 0.0);
   42|      2|  if (std::fabs(sum - 1.0) > 1e-6) {
  ------------------
  |  Branch (42:7): [True: 2, False: 0]
  ------------------
   43|       |    // Scale `probabilities` only when the sum is too far from 1.0.  Scaling
   44|       |    // unconditionally will alter the probabilities slightly.
   45|      2|    for (double& item : *probabilities) {
  ------------------
  |  Branch (45:23): [True: 2, False: 2]
  ------------------
   46|      2|      item = item / sum;
   47|      2|    }
   48|      2|  }
   49|       |
   50|       |  // Step 2. At this point `probabilities` is set to the conditional
   51|       |  // probabilities of each element which sum to 1.0, to within reasonable error.
   52|       |  // These values are used to construct the proportional probability tables for
   53|       |  // the selection phases of Walker's Aliasing algorithm.
   54|       |  //
   55|       |  // To construct the table, pick an element which is under-full (i.e., an
   56|       |  // element for which `(*probabilities)[i] < 1.0/n`), and pair it with an
   57|       |  // element which is over-full (i.e., an element for which
   58|       |  // `(*probabilities)[i] > 1.0/n`). The smaller value can always be retired.
   59|       |  // The larger may still be greater than 1.0/n, or may now be less than 1.0/n,
   60|       |  // and put back onto the appropriate collection.
   61|      2|  const size_t n = probabilities->size();
   62|      2|  std::vector<std::pair<double, size_t>> q;
   63|      2|  q.reserve(n);
   64|       |
   65|      2|  std::vector<size_t> over;
   66|      2|  std::vector<size_t> under;
   67|      2|  size_t idx = 0;
   68|      2|  for (const double item : *probabilities) {
  ------------------
  |  Branch (68:26): [True: 2, False: 2]
  ------------------
   69|      2|    assert(item >= 0);
   70|      2|    const double v = item * n;
   71|      2|    q.emplace_back(v, 0);
   72|      2|    if (v < 1.0) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2]
  ------------------
   73|      0|      under.push_back(idx++);
   74|      2|    } else {
   75|      2|      over.push_back(idx++);
   76|      2|    }
   77|      2|  }
   78|      2|  while (!over.empty() && !under.empty()) {
  ------------------
  |  Branch (78:10): [True: 2, False: 0]
  |  Branch (78:27): [True: 0, False: 2]
  ------------------
   79|      0|    auto lo = under.back();
   80|      0|    under.pop_back();
   81|      0|    auto hi = over.back();
   82|      0|    over.pop_back();
   83|       |
   84|      0|    q[lo].second = hi;
   85|      0|    const double r = q[hi].first - (1.0 - q[lo].first);
   86|      0|    q[hi].first = r;
   87|      0|    if (r < 1.0) {
  ------------------
  |  Branch (87:9): [True: 0, False: 0]
  ------------------
   88|      0|      under.push_back(hi);
   89|      0|    } else {
   90|      0|      over.push_back(hi);
   91|      0|    }
   92|      0|  }
   93|       |
   94|       |  // Due to rounding errors, there may be un-paired elements in either
   95|       |  // collection; these should all be values near 1.0.  For these values, set `q`
   96|       |  // to 1.0 and set the alternate to the identity.
   97|      2|  for (auto i : over) {
  ------------------
  |  Branch (97:15): [True: 2, False: 2]
  ------------------
   98|      2|    q[i] = {1.0, i};
   99|      2|  }
  100|      2|  for (auto i : under) {
  ------------------
  |  Branch (100:15): [True: 0, False: 2]
  ------------------
  101|      0|    q[i] = {1.0, i};
  102|      0|  }
  103|      2|  return q;
  104|      2|}

_ZN4absl12lts_2026052621discrete_distributionIiEC2Ev:
  113|      2|  discrete_distribution() : param_() {}
_ZN4absl12lts_2026052621discrete_distributionIiE10param_typeC2Ev:
   62|      2|    param_type() { init(); }
_ZN4absl12lts_2026052621discrete_distributionIiE10param_type4initEv:
  185|      4|void discrete_distribution<IntType>::param_type::init() {
  186|      4|  if (p_.empty()) {
  ------------------
  |  Branch (186:7): [True: 2, False: 2]
  ------------------
  187|      2|    p_.push_back(1.0);
  188|      2|    q_.emplace_back(1.0, 0);
  189|      2|  } else {
  190|       |    assert(n() <= (std::numeric_limits<IntType>::max)());
  191|      2|    q_ = random_internal::InitDiscreteDistribution(&p_);
  192|      2|  }
  193|      4|}
_ZN4absl12lts_2026052621discrete_distributionIiEC2INSt3__111__wrap_iterIPdEEEET_S8_:
  119|      2|      : param_(begin, end) {}
_ZN4absl12lts_2026052621discrete_distributionIiE10param_typeC2INSt3__111__wrap_iterIPdEEEET_S9_:
   66|      2|        : p_(begin, end) {
   67|      2|      init();
   68|      2|    }

_ZN4absl12lts_202605267UniformIjRNS0_6BitGenEEENSt3__19enable_ifIXntsr3std14numeric_limitsIT_EE9is_signedES6_E4typeEOT0_:
  210|     16|Uniform(URBG&& urbg) {  // NOLINT(runtime/references)
  211|     16|  using gen_t = std::decay_t<URBG>;
  212|     16|  using distribution_t = random_internal::UniformDistributionWrapper<R>;
  213|       |
  214|     16|  return random_internal::DistributionCaller<gen_t>::template Call<
  215|     16|      distribution_t>(&urbg);
  216|     16|}

_ZN4absl12lts_2026052615random_internal18DistributionCallerINS0_6BitGenEE4CallINS1_26UniformDistributionWrapperIjEEJEEENT_11result_typeEPS3_DpOT0_:
   73|     16|  static typename DistrT::result_type Call(URBG* urbg, Args&&... args) {
   74|     16|    return Impl<DistrT, Args...>(RandomMockingAccess::HasInvokeMock<URBG>{},
   75|     16|                                 urbg, std::forward<Args>(args)...);
   76|     16|  }
_ZN4absl12lts_2026052615random_internal18DistributionCallerINS0_6BitGenEE4ImplINS1_26UniformDistributionWrapperIjEEJEEENT_11result_typeENSt3__117integral_constantIbLb0EEEPS3_DpOT0_:
   47|     16|                                           Args&&... args) {
   48|     16|    DistrT dist(std::forward<Args>(args)...);
   49|     16|    return dist(*urbg);
   50|     16|  }

_ZN4absl12lts_2026052615random_internal24GetEntropyFromRandenPoolEPvm:
  178|      2|void GetEntropyFromRandenPool(void* dest, size_t bytes) {
  179|      2|  auto* pool = GetPoolForCurrentThread();
  180|      2|  pool->Fill(reinterpret_cast<uint8_t*>(dest), bytes);
  181|      2|}
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_123GetPoolForCurrentThreadEv:
  171|      2|RandenPoolEntry* GetPoolForCurrentThread() {
  172|      2|  absl::call_once(pool_once, InitPoolURBG);
  173|      2|  return shared_pools[GetPoolID()];
  174|      2|}
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_112InitPoolURBGEv:
  155|      2|void InitPoolURBG() {
  156|      2|  static constexpr size_t kSeedSize =
  157|      2|      RandenTraits::kStateBytes / sizeof(uint32_t);
  158|       |  // Read OS entropy once, and use it to initialize each pool entry.
  159|      2|  uint32_t seed_material[kPoolSize * kSeedSize];
  160|      2|  if (!ReadSeedMaterialFromOSEntropy(absl::MakeSpan(seed_material))) {
  ------------------
  |  Branch (160:7): [True: 0, False: 2]
  ------------------
  161|      0|    ThrowSeedGenException();
  162|      0|  }
  163|     18|  for (size_t i = 0; i < kPoolSize; i++) {
  ------------------
  |  Branch (163:22): [True: 16, False: 2]
  ------------------
  164|     16|    shared_pools[i] = new RandenPoolEntry();
  165|     16|    shared_pools[i]->Init(
  166|     16|        absl::MakeSpan(&seed_material[i * kSeedSize], kSeedSize));
  167|     16|  }
  168|      2|}
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_115RandenPoolEntry4InitENS0_4SpanIKjEE:
   57|     16|  void Init(absl::Span<const uint32_t> data) {
   58|     16|    SpinLockHolder l(mu_);  // Always uncontested.
   59|     16|    std::copy(data.begin(), data.end(), std::begin(state_));
   60|     16|    next_ = kState;
   61|     16|  }
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_19GetPoolIDEv:
  116|      2|size_t GetPoolID() {
  117|      2|  static_assert(kPoolSize >= 1,
  118|      2|                "At least one urbg instance is required for PoolURBG");
  119|       |
  120|      2|  ABSL_CONST_INIT static std::atomic<uint64_t> sequence{0};
  ------------------
  |  |  849|      2|#define ABSL_CONST_INIT [[clang::require_constant_initialization]]
  ------------------
  121|       |
  122|      2|#ifdef ABSL_HAVE_THREAD_LOCAL
  123|      2|  static thread_local size_t my_pool_id = kPoolSize;
  124|      2|  if (ABSL_PREDICT_FALSE(my_pool_id == kPoolSize)) {
  ------------------
  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 2, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:58): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  125|      2|    my_pool_id = (sequence++ % kPoolSize);
  126|      2|  }
  127|      2|  return my_pool_id;
  128|       |#else
  129|       |  static pthread_key_t tid_key = [] {
  130|       |    pthread_key_t tmp_key;
  131|       |    int err = pthread_key_create(&tmp_key, nullptr);
  132|       |    if (err) {
  133|       |      ABSL_RAW_LOG(FATAL, "pthread_key_create failed with %d", err);
  134|       |    }
  135|       |    return tmp_key;
  136|       |  }();
  137|       |
  138|       |  // Store the value in the pthread_{get/set}specific. However an uninitialized
  139|       |  // value is 0, so add +1 to distinguish from the null value.
  140|       |  uintptr_t my_pool_id =
  141|       |      reinterpret_cast<uintptr_t>(pthread_getspecific(tid_key));
  142|       |  if (ABSL_PREDICT_FALSE(my_pool_id == 0)) {
  143|       |    // No allocated ID, allocate the next value, cache it, and return.
  144|       |    my_pool_id = (sequence++ % kPoolSize) + 1;
  145|       |    int err = pthread_setspecific(tid_key, reinterpret_cast<void*>(my_pool_id));
  146|       |    if (err) {
  147|       |      ABSL_RAW_LOG(FATAL, "pthread_setspecific failed with %d", err);
  148|       |    }
  149|       |  }
  150|       |  return my_pool_id - 1;
  151|       |#endif
  152|      2|}
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_115RandenPoolEntry4FillEPhm:
   86|      2|void RandenPoolEntry::Fill(uint8_t* out, size_t bytes) {
   87|      2|  SpinLockHolder l(mu_);
   88|      4|  while (bytes > 0) {
  ------------------
  |  Branch (88:10): [True: 2, False: 2]
  ------------------
   89|      2|    MaybeRefill();
   90|      2|    size_t remaining = available() * sizeof(state_[0]);
   91|      2|    size_t to_copy = std::min(bytes, remaining);
   92|      2|    std::memcpy(out, &state_[next_], to_copy);
   93|      2|    out += to_copy;
   94|      2|    bytes -= to_copy;
   95|      2|    next_ += (to_copy + sizeof(state_[0]) - 1) / sizeof(state_[0]);
   96|      2|  }
   97|      2|}
entropy_pool.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_115RandenPoolEntry11MaybeRefillEv:
   66|      2|  inline void MaybeRefill() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
   67|      2|    if (next_ >= kState) {
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|      next_ = kCapacity;
   69|      2|      impl_.Generate(state_);
   70|      2|    }
   71|      2|  }
entropy_pool.cc:_ZNK4absl12lts_2026052615random_internal12_GLOBAL__N_115RandenPoolEntry9availableEv:
   73|      2|  inline size_t available() const ABSL_SHARED_LOCKS_REQUIRED(mu_) {
   74|      2|    return kState - next_;
   75|      2|  }

_ZN4absl12lts_2026052615random_internal15FastUniformBitsIjEclINS0_6BitGenEEEjRT_:
  122|     16|FastUniformBits<UIntType>::operator()(URBG& g) {  // NOLINT(runtime/references)
  123|       |  // kRangeMask is the mask used when sampling variates from the URBG when the
  124|       |  // width of the URBG range is not a power of 2.
  125|       |  // Y = (2 ^ kRange) - 1
  126|     16|  static_assert((URBG::max)() > (URBG::min)(),
  127|     16|                "URBG::max and URBG::min may not be equal.");
  128|       |
  129|     16|  using tag = std::conditional_t<IsPowerOfTwoOrZero(RangeSize<URBG>()),
  130|     16|                                  SimplifiedLoopTag, RejectionLoopTag>;
  131|     16|  return Generate(g, tag{});
  132|     16|}
_ZN4absl12lts_2026052615random_internal15FastUniformBitsIjE8GenerateINS0_6BitGenEEEjRT_NS1_17SimplifiedLoopTagE:
  138|     16|                                    SimplifiedLoopTag) {
  139|       |  // The simplified version of FastUniformBits works only on URBGs that have
  140|       |  // a range that is a power of 2. In this case we simply loop and shift without
  141|       |  // attempting to balance the bits across calls.
  142|     16|  static_assert(IsPowerOfTwoOrZero(RangeSize<URBG>()),
  143|     16|                "incorrect Generate tag for URBG instance");
  144|       |
  145|     16|  static constexpr size_t kResultBits =
  146|     16|      std::numeric_limits<result_type>::digits;
  147|     16|  static constexpr size_t kUrbgBits = NumBits<URBG>();
  148|     16|  static constexpr size_t kIters =
  149|     16|      (kResultBits / kUrbgBits) + (kResultBits % kUrbgBits != 0);
  150|     16|  static constexpr size_t kShift = (kIters == 1) ? 0 : kUrbgBits;
  ------------------
  |  Branch (150:36): [True: 0, Folded]
  ------------------
  151|     16|  static constexpr auto kMin = (URBG::min)();
  152|       |
  153|     16|  result_type r = static_cast<result_type>(g() - kMin);
  154|     16|  for (size_t n = 1; n < kIters; ++n) {
  ------------------
  |  Branch (154:22): [True: 0, False: 16]
  ------------------
  155|      0|    r = static_cast<result_type>(r << kShift) +
  156|      0|        static_cast<result_type>(g() - kMin);
  157|      0|  }
  158|     16|  return r;
  159|     16|}

_ZN4absl12lts_2026052615random_internal17RandenPoolSeedSeq4sizeEv:
   66|      2|  size_t size() { return 0; }
_ZN4absl12lts_2026052615random_internal17NonsecureURBGBaseINS1_13randen_engineImEENS1_17RandenPoolSeedSeqEEC2Ev:
  100|      2|  NonsecureURBGBase() : urbg_(ConstructURBG()) {}
_ZN4absl12lts_2026052615random_internal17NonsecureURBGBaseINS1_13randen_engineImEENS1_17RandenPoolSeedSeqEE13ConstructURBGEv:
  141|      2|  static URBG ConstructURBG() {
  142|      2|    Seeder seeder;
  143|      2|    return URBG(seeder);
  144|      2|  }
_ZN4absl12lts_2026052615random_internal17RandenPoolSeedSeq8generateIPjEEvT_S5_:
   72|      2|  void generate(RandomAccessIterator begin, RandomAccessIterator end) {
   73|       |    // RandomAccessIterator must be assignable from uint32_t
   74|      2|    if (begin != end) {
  ------------------
  |  Branch (74:9): [True: 2, False: 0]
  ------------------
   75|      2|      using U = typename std::iterator_traits<RandomAccessIterator>::value_type;
   76|       |      // ContiguousTag indicates the common case of a known contiguous buffer,
   77|       |      // which allows directly filling the buffer. In C++20,
   78|       |      // std::contiguous_iterator_tag provides a mechanism for testing this
   79|       |      // capability, however until Abseil's support requirements allow us to
   80|       |      // assume C++20, limit checks to a few common cases.
   81|      2|      using TagType = std::conditional_t<
   82|      2|          (std::is_pointer<RandomAccessIterator>::value ||
   83|      2|           std::is_same<RandomAccessIterator,
   84|      2|                        typename std::vector<U>::iterator>::value),
   85|      2|          ContiguousTag, BufferTag>;
   86|       |
   87|      2|      generate_impl(TagType{}, begin, end);
   88|      2|    }
   89|      2|  }
_ZN4absl12lts_2026052615random_internal17RandenPoolSeedSeq13generate_implIPjEEvNS2_13ContiguousTagET_S6_:
   46|      2|  void generate_impl(ContiguousTag, Contiguous begin, Contiguous end) {
   47|      2|    const size_t n = static_cast<size_t>(std::distance(begin, end));
   48|      2|    auto* a = &(*begin);
   49|      2|    GetEntropyFromRandenPool(a, sizeof(*a) * n);
   50|      2|  }
_ZN4absl12lts_2026052615random_internal17NonsecureURBGBaseINS1_13randen_engineImEENS1_17RandenPoolSeedSeqEEclEv:
  125|     16|  result_type operator()() { return urbg_(); }

_ZN4absl12lts_2026052615random_internal6RandenC2Ev:
   81|     18|Randen::Randen() {
   82|     18|  auto tmp = GetRandenState();
   83|     18|  keys_ = tmp.keys;
   84|     18|#if ABSL_RANDOM_INTERNAL_AES_DISPATCH
   85|     18|  has_crypto_ = tmp.has_crypto;
   86|     18|#endif
   87|     18|}
randen.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_114GetRandenStateEv:
   53|     18|RandenState GetRandenState() {
   54|     18|  static const RandenState state = []() {
   55|     18|    RandenState tmp;
   56|     18|#if ABSL_RANDOM_INTERNAL_AES_DISPATCH
   57|       |    // HW AES Dispatch.
   58|     18|    if (HasRandenHwAesImplementation() && CPUSupportsRandenHwAes()) {
   59|     18|      tmp.has_crypto = true;
   60|     18|      tmp.keys = RandenHwAes::GetKeys();
   61|     18|    } else {
   62|     18|      tmp.has_crypto = false;
   63|     18|      tmp.keys = RandenSlow::GetKeys();
   64|     18|    }
   65|       |#elif ABSL_HAVE_ACCELERATED_AES
   66|       |    // HW AES is enabled.
   67|       |    tmp.has_crypto = true;
   68|       |    tmp.keys = RandenHwAes::GetKeys();
   69|       |#else
   70|       |    // HW AES is disabled.
   71|       |    tmp.has_crypto = false;
   72|       |    tmp.keys = RandenSlow::GetKeys();
   73|       |#endif
   74|     18|    return tmp;
   75|     18|  }();
   76|     18|  return state;
   77|     18|}
randen.cc:_ZZN4absl12lts_2026052615random_internal12_GLOBAL__N_114GetRandenStateEvENK3$_0clEv:
   54|      2|  static const RandenState state = []() {
   55|      2|    RandenState tmp;
   56|      2|#if ABSL_RANDOM_INTERNAL_AES_DISPATCH
   57|       |    // HW AES Dispatch.
   58|      2|    if (HasRandenHwAesImplementation() && CPUSupportsRandenHwAes()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 2]
  |  Branch (58:43): [True: 0, False: 0]
  ------------------
   59|      0|      tmp.has_crypto = true;
   60|      0|      tmp.keys = RandenHwAes::GetKeys();
   61|      2|    } else {
   62|      2|      tmp.has_crypto = false;
   63|      2|      tmp.keys = RandenSlow::GetKeys();
   64|      2|    }
   65|       |#elif ABSL_HAVE_ACCELERATED_AES
   66|       |    // HW AES is enabled.
   67|       |    tmp.has_crypto = true;
   68|       |    tmp.keys = RandenHwAes::GetKeys();
   69|       |#else
   70|       |    // HW AES is disabled.
   71|       |    tmp.has_crypto = false;
   72|       |    tmp.keys = RandenSlow::GetKeys();
   73|       |#endif
   74|      2|    return tmp;
   75|      2|  }();

_ZNK4absl12lts_2026052615random_internal6Randen8GenerateEPv:
   47|      4|  inline void Generate(void* state) const {
   48|      4|#if ABSL_RANDOM_INTERNAL_AES_DISPATCH
   49|       |    // HW AES Dispatch.
   50|      4|    if (has_crypto_) {
  ------------------
  |  Branch (50:9): [True: 0, False: 4]
  ------------------
   51|      0|      RandenHwAes::Generate(keys_, state);
   52|      4|    } else {
   53|      4|      RandenSlow::Generate(keys_, state);
   54|      4|    }
   55|       |#elif ABSL_HAVE_ACCELERATED_AES
   56|       |    // HW AES is enabled.
   57|       |    RandenHwAes::Generate(keys_, state);
   58|       |#else
   59|       |    // HW AES is disabled.
   60|       |    RandenSlow::Generate(keys_, state);
   61|       |#endif
   62|      4|  }
_ZNK4absl12lts_2026052615random_internal6Randen6AbsorbEPKvPv:
   68|      2|  inline void Absorb(const void* seed, void* state) const {
   69|      2|#if ABSL_RANDOM_INTERNAL_AES_DISPATCH
   70|       |    // HW AES Dispatch.
   71|      2|    if (has_crypto_) {
  ------------------
  |  Branch (71:9): [True: 0, False: 2]
  ------------------
   72|      0|      RandenHwAes::Absorb(seed, state);
   73|      2|    } else {
   74|      2|      RandenSlow::Absorb(seed, state);
   75|      2|    }
   76|       |#elif ABSL_HAVE_ACCELERATED_AES
   77|       |    // HW AES is enabled.
   78|       |    RandenHwAes::Absorb(seed, state);
   79|       |#else
   80|       |    // HW AES is disabled.
   81|       |    RandenSlow::Absorb(seed, state);
   82|       |#endif
   83|      2|  }

_ZN4absl12lts_2026052615random_internal13randen_engineImEC2IRNS1_17RandenPoolSeedSeqEvEEOT_:
   68|      2|  explicit randen_engine(SeedSequence&& seq) {
   69|      2|    seed(seq);
   70|      2|  }
_ZN4absl12lts_2026052615random_internal13randen_engineImE4seedIRNS1_17RandenPoolSeedSeqEEENSt3__19enable_ifIXntsr3std14is_convertibleIT_mEE5valueEvE4typeEOS9_:
   98|      2|  seed(SeedSequence&& seq) {
   99|       |    // Zeroes the state.
  100|      2|    seed();
  101|      2|    reseed(seq);
  102|      2|  }
_ZN4absl12lts_2026052615random_internal13randen_engineImE4seedEm:
  104|      2|  void seed(result_type seed_value = 0) {
  105|      2|    next_ = kStateSizeT;
  106|       |    // Zeroes the inner state and fills the outer state with seed_value to
  107|       |    // mimic the behaviour of reseed
  108|      2|    auto* begin = state();
  109|      2|    std::fill(begin, begin + kCapacityT, 0);
  110|      2|    std::fill(begin + kCapacityT, begin + kStateSizeT, seed_value);
  111|      2|  }
_ZN4absl12lts_2026052615random_internal13randen_engineImE5stateEv:
  245|     20|  result_type* state() {
  246|     20|    return reinterpret_cast<result_type*>(
  247|     20|        (reinterpret_cast<uintptr_t>(&raw_state_) & 0xf) ? (raw_state_ + 8)
  ------------------
  |  Branch (247:9): [True: 20, False: 0]
  ------------------
  248|     20|                                                         : raw_state_);
  249|     20|  }
_ZN4absl12lts_2026052615random_internal13randen_engineImE6reseedINS1_17RandenPoolSeedSeqEEEvRT_:
  117|      2|  void reseed(SeedSequence& seq) {
  118|      2|    using sequence_result_type = typename SeedSequence::result_type;
  119|      2|    static_assert(sizeof(sequence_result_type) == 4,
  120|      2|                  "SeedSequence::result_type must be 32-bit");
  121|      2|    constexpr size_t kBufferSize =
  122|      2|        Randen::kSeedBytes / sizeof(sequence_result_type);
  123|      2|    alignas(16) sequence_result_type buffer[kBufferSize];
  124|       |
  125|       |    // Randen::Absorb XORs the seed into state, which is then mixed by a call
  126|       |    // to Randen::Generate. Seeding with only the provided entropy is preferred
  127|       |    // to using an arbitrary generate() call, so use [rand.req.seed_seq]
  128|       |    // size as a proxy for the number of entropy units that can be generated
  129|       |    // without relying on seed sequence mixing...
  130|      2|    const size_t entropy_size = seq.size();
  131|      2|    if (entropy_size < kBufferSize) {
  ------------------
  |  Branch (131:9): [True: 2, False: 0]
  ------------------
  132|       |      // ... and only request that many values, or 256-bits, when unspecified.
  133|      2|      const size_t requested_entropy = (entropy_size == 0) ? 8u : entropy_size;
  ------------------
  |  Branch (133:40): [True: 2, False: 0]
  ------------------
  134|      2|      std::fill(buffer + requested_entropy, buffer + kBufferSize, 0);
  135|      2|      seq.generate(buffer, buffer + requested_entropy);
  136|       |#ifdef ABSL_IS_BIG_ENDIAN
  137|       |      // Randen expects the seed buffer to be in Little Endian; reverse it on
  138|       |      // Big Endian platforms.
  139|       |      for (sequence_result_type& e : buffer) {
  140|       |        e = absl::little_endian::FromHost(e);
  141|       |      }
  142|       |#endif
  143|       |      // The Randen paper suggests preferentially initializing even-numbered
  144|       |      // 128-bit vectors of the randen state (there are 16 such vectors).
  145|       |      // The seed data is merged into the state offset by 128-bits, which
  146|       |      // implies preferring seed bytes [16..31, ..., 208..223]. Since the
  147|       |      // buffer is 32-bit values, we swap the corresponding buffer positions in
  148|       |      // 128-bit chunks.
  149|      2|      size_t dst = kBufferSize;
  150|     16|      while (dst > 7) {
  ------------------
  |  Branch (150:14): [True: 14, False: 2]
  ------------------
  151|       |        // leave the odd bucket as-is.
  152|     14|        dst -= 4;
  153|     14|        size_t src = dst >> 1;
  154|       |        // swap 128-bits into the even bucket
  155|     14|        std::swap(buffer[--dst], buffer[--src]);
  156|     14|        std::swap(buffer[--dst], buffer[--src]);
  157|     14|        std::swap(buffer[--dst], buffer[--src]);
  158|     14|        std::swap(buffer[--dst], buffer[--src]);
  159|     14|      }
  160|      2|    } else {
  161|      0|      seq.generate(buffer, buffer + kBufferSize);
  162|      0|    }
  163|      2|    impl_.Absorb(buffer, state());
  164|       |
  165|       |    // Generate will be called when operator() is called
  166|      2|    next_ = kStateSizeT;
  167|      2|  }
_ZN4absl12lts_2026052615random_internal13randen_engineImEclEv:
   85|     16|  result_type operator()() {
   86|       |    // Refill the buffer if needed (unlikely).
   87|     16|    auto* begin = state();
   88|     16|    if (next_ >= kStateSizeT) {
  ------------------
  |  Branch (88:9): [True: 2, False: 14]
  ------------------
   89|      2|      next_ = kCapacityT;
   90|      2|      impl_.Generate(begin);
   91|      2|    }
   92|     16|    return little_endian::ToHost(begin[next_++]);
   93|     16|  }

_ZN4absl12lts_2026052615random_internal28HasRandenHwAesImplementationEv:
   54|      2|bool HasRandenHwAesImplementation() { return false; }

_ZN4absl12lts_2026052615random_internal10RandenSlow7GetKeysEv:
  421|      2|const void* RandenSlow::GetKeys() {
  422|       |  // Round keys for one AES per Feistel round and branch.
  423|       |  // The canonical implementation uses first digits of Pi.
  424|      2|#ifdef ABSL_IS_LITTLE_ENDIAN
  425|      2|  return kRandenRoundKeys;
  426|       |#else
  427|       |  return kRandenRoundKeysBE;
  428|       |#endif
  429|      2|}
_ZN4absl12lts_2026052615random_internal10RandenSlow6AbsorbEPKvPv:
  431|      2|void RandenSlow::Absorb(const void* seed_void, void* state_void) {
  432|      2|  auto* state =
  433|      2|      reinterpret_cast<uint64_t * ABSL_RANDOM_INTERNAL_RESTRICT>(state_void);
  434|      2|  const auto* seed =
  435|      2|      reinterpret_cast<const uint64_t * ABSL_RANDOM_INTERNAL_RESTRICT>(
  436|      2|          seed_void);
  437|       |
  438|      2|  constexpr size_t kCapacityBlocks =
  439|      2|      RandenTraits::kCapacityBytes / sizeof(uint64_t);
  440|      2|  static_assert(
  441|      2|      kCapacityBlocks * sizeof(uint64_t) == RandenTraits::kCapacityBytes,
  442|      2|      "Not i*V");
  443|       |
  444|      2|  for (size_t i = kCapacityBlocks;
  445|     62|       i < RandenTraits::kStateBytes / sizeof(uint64_t); ++i) {
  ------------------
  |  Branch (445:8): [True: 60, False: 2]
  ------------------
  446|     60|    state[i] ^= seed[i - kCapacityBlocks];
  447|     60|  }
  448|      2|}
_ZN4absl12lts_2026052615random_internal10RandenSlow8GenerateEPKvPv:
  450|      4|void RandenSlow::Generate(const void* keys_void, void* state_void) {
  451|      4|  static_assert(RandenTraits::kCapacityBytes == sizeof(absl::uint128),
  452|      4|                "Capacity mismatch");
  453|       |
  454|      4|  auto* state = reinterpret_cast<absl::uint128*>(state_void);
  455|      4|  const auto* keys = reinterpret_cast<const absl::uint128*>(keys_void);
  456|       |
  457|      4|  const absl::uint128 prev_inner = state[0];
  458|       |
  459|      4|  SwapEndian(state);
  460|       |
  461|      4|  Permute(state, keys);
  462|       |
  463|      4|  SwapEndian(state);
  464|       |
  465|       |  // Ensure backtracking resistance.
  466|      4|  *state ^= prev_inner;
  467|      4|}
randen_slow.cc:_ZN12_GLOBAL__N_110SwapEndianEPN4absl12lts_202605267uint128E:
  400|      8|    absl::uint128* state) {
  401|       |#ifdef ABSL_IS_BIG_ENDIAN
  402|       |  for (uint32_t block = 0; block < RandenTraits::kFeistelBlocks; ++block) {
  403|       |    uint64_t new_lo = absl::little_endian::ToHost64(
  404|       |        static_cast<uint64_t>(state[block] >> 64));
  405|       |    uint64_t new_hi = absl::little_endian::ToHost64(
  406|       |        static_cast<uint64_t>((state[block] << 64) >> 64));
  407|       |    state[block] = (static_cast<absl::uint128>(new_hi) << 64) | new_lo;
  408|       |  }
  409|       |#else
  410|       |  // Avoid warning about unused variable.
  411|      8|  (void)state;
  412|      8|#endif
  413|      8|}
randen_slow.cc:_ZN12_GLOBAL__N_17PermuteEPN4absl12lts_202605267uint128EPKS2_:
  391|      4|    const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
  392|     72|  for (size_t round = 0; round < RandenTraits::kFeistelRounds; ++round) {
  ------------------
  |  Branch (392:26): [True: 68, False: 4]
  ------------------
  393|     68|    keys = FeistelRound(state, keys);
  394|     68|    BlockShuffle(state);
  395|     68|  }
  396|      4|}
randen_slow.cc:_ZN12_GLOBAL__N_112FeistelRoundEPN4absl12lts_202605267uint128EPKS2_:
  365|     68|             const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
  366|    340|  for (size_t branch = 0; branch < RandenTraits::kFeistelBlocks; branch += 4) {
  ------------------
  |  Branch (366:27): [True: 272, False: 68]
  ------------------
  367|    272|    const Vector128 s0 = Vector128Load(state + branch);
  368|    272|    const Vector128 s1 = Vector128Load(state + branch + 1);
  369|    272|    const Vector128 f0 = AesRound(s0, Vector128Load(keys));
  370|    272|    keys++;
  371|    272|    const Vector128 o1 = AesRound(f0, s1);
  372|    272|    Vector128Store(o1, state + branch + 1);
  373|       |
  374|       |    // Manually unroll this loop once. about 10% better than not unrolled.
  375|    272|    const Vector128 s2 = Vector128Load(state + branch + 2);
  376|    272|    const Vector128 s3 = Vector128Load(state + branch + 3);
  377|    272|    const Vector128 f2 = AesRound(s2, Vector128Load(keys));
  378|    272|    keys++;
  379|    272|    const Vector128 o3 = AesRound(f2, s3);
  380|    272|    Vector128Store(o3, state + branch + 3);
  381|    272|  }
  382|     68|  return keys;
  383|     68|}
randen_slow.cc:_ZN12_GLOBAL__N_113Vector128LoadEPKv:
  239|  1.63k|Vector128Load(const void* from) {
  240|  1.63k|  Vector128 result;
  241|  1.63k|  std::memcpy(result.s, from, sizeof(Vector128));
  242|  1.63k|  return result;
  243|  1.63k|}
randen_slow.cc:_ZN12_GLOBAL__N_18AesRoundERKNS_9Vector128ES2_:
  253|  1.08k|AesRound(const Vector128& state, const Vector128& round_key) {
  254|  1.08k|  Vector128 result;
  255|  1.08k|#ifdef ABSL_IS_LITTLE_ENDIAN
  256|  1.08k|  result.s[0] = round_key.s[0] ^                  //
  257|  1.08k|                te0[uint8_t(state.s[0])] ^        //
  258|  1.08k|                te1[uint8_t(state.s[1] >> 8)] ^   //
  259|  1.08k|                te2[uint8_t(state.s[2] >> 16)] ^  //
  260|  1.08k|                te3[uint8_t(state.s[3] >> 24)];
  261|  1.08k|  result.s[1] = round_key.s[1] ^                  //
  262|  1.08k|                te0[uint8_t(state.s[1])] ^        //
  263|  1.08k|                te1[uint8_t(state.s[2] >> 8)] ^   //
  264|  1.08k|                te2[uint8_t(state.s[3] >> 16)] ^  //
  265|  1.08k|                te3[uint8_t(state.s[0] >> 24)];
  266|  1.08k|  result.s[2] = round_key.s[2] ^                  //
  267|  1.08k|                te0[uint8_t(state.s[2])] ^        //
  268|  1.08k|                te1[uint8_t(state.s[3] >> 8)] ^   //
  269|  1.08k|                te2[uint8_t(state.s[0] >> 16)] ^  //
  270|  1.08k|                te3[uint8_t(state.s[1] >> 24)];
  271|  1.08k|  result.s[3] = round_key.s[3] ^                  //
  272|  1.08k|                te0[uint8_t(state.s[3])] ^        //
  273|  1.08k|                te1[uint8_t(state.s[0] >> 8)] ^   //
  274|  1.08k|                te2[uint8_t(state.s[1] >> 16)] ^  //
  275|  1.08k|                te3[uint8_t(state.s[2] >> 24)];
  276|       |#else
  277|       |  result.s[0] = round_key.s[0] ^                  //
  278|       |                te0[uint8_t(state.s[0])] ^        //
  279|       |                te1[uint8_t(state.s[3] >> 8)] ^   //
  280|       |                te2[uint8_t(state.s[2] >> 16)] ^  //
  281|       |                te3[uint8_t(state.s[1] >> 24)];
  282|       |  result.s[1] = round_key.s[1] ^                  //
  283|       |                te0[uint8_t(state.s[1])] ^        //
  284|       |                te1[uint8_t(state.s[0] >> 8)] ^   //
  285|       |                te2[uint8_t(state.s[3] >> 16)] ^  //
  286|       |                te3[uint8_t(state.s[2] >> 24)];
  287|       |  result.s[2] = round_key.s[2] ^                  //
  288|       |                te0[uint8_t(state.s[2])] ^        //
  289|       |                te1[uint8_t(state.s[1] >> 8)] ^   //
  290|       |                te2[uint8_t(state.s[0] >> 16)] ^  //
  291|       |                te3[uint8_t(state.s[3] >> 24)];
  292|       |  result.s[3] = round_key.s[3] ^                  //
  293|       |                te0[uint8_t(state.s[3])] ^        //
  294|       |                te1[uint8_t(state.s[2] >> 8)] ^   //
  295|       |                te2[uint8_t(state.s[1] >> 16)] ^  //
  296|       |                te3[uint8_t(state.s[0] >> 24)];
  297|       |#endif
  298|  1.08k|  return result;
  299|  1.08k|}
randen_slow.cc:_ZN12_GLOBAL__N_114Vector128StoreERKNS_9Vector128EPv:
  246|    544|    const Vector128& v, void* to) {
  247|    544|  std::memcpy(to, v.s, sizeof(Vector128));
  248|    544|}
randen_slow.cc:_ZN12_GLOBAL__N_112BlockShuffleEPN4absl12lts_202605267uint128E:
  305|     68|    absl::uint128* state) {
  306|     68|  static_assert(RandenTraits::kFeistelBlocks == 16,
  307|     68|                "Feistel block shuffle only works for 16 blocks.");
  308|       |
  309|     68|  constexpr size_t shuffle[RandenTraits::kFeistelBlocks] = {
  310|     68|      7, 2, 13, 4, 11, 8, 3, 6, 15, 0, 9, 10, 1, 14, 5, 12};
  311|       |
  312|       |  // The fully unrolled loop without the memcpy improves the speed by about
  313|       |  // 30% over the equivalent:
  314|       |#if 0
  315|       |  absl::uint128 source[RandenTraits::kFeistelBlocks];
  316|       |  std::memcpy(source, state, sizeof(source));
  317|       |  for (size_t i = 0; i < RandenTraits::kFeistelBlocks; i++) {
  318|       |    const absl::uint128 v0 = source[shuffle[i]];
  319|       |    state[i] = v0;
  320|       |  }
  321|       |  return;
  322|       |#endif
  323|       |
  324|     68|  const absl::uint128 v0 = state[shuffle[0]];
  325|     68|  const absl::uint128 v1 = state[shuffle[1]];
  326|     68|  const absl::uint128 v2 = state[shuffle[2]];
  327|     68|  const absl::uint128 v3 = state[shuffle[3]];
  328|     68|  const absl::uint128 v4 = state[shuffle[4]];
  329|     68|  const absl::uint128 v5 = state[shuffle[5]];
  330|     68|  const absl::uint128 v6 = state[shuffle[6]];
  331|     68|  const absl::uint128 v7 = state[shuffle[7]];
  332|     68|  const absl::uint128 w0 = state[shuffle[8]];
  333|     68|  const absl::uint128 w1 = state[shuffle[9]];
  334|     68|  const absl::uint128 w2 = state[shuffle[10]];
  335|     68|  const absl::uint128 w3 = state[shuffle[11]];
  336|     68|  const absl::uint128 w4 = state[shuffle[12]];
  337|     68|  const absl::uint128 w5 = state[shuffle[13]];
  338|     68|  const absl::uint128 w6 = state[shuffle[14]];
  339|     68|  const absl::uint128 w7 = state[shuffle[15]];
  340|     68|  state[0] = v0;
  341|     68|  state[1] = v1;
  342|     68|  state[2] = v2;
  343|     68|  state[3] = v3;
  344|     68|  state[4] = v4;
  345|     68|  state[5] = v5;
  346|     68|  state[6] = v6;
  347|     68|  state[7] = v7;
  348|     68|  state[8] = w0;
  349|     68|  state[9] = w1;
  350|     68|  state[10] = w2;
  351|     68|  state[11] = w3;
  352|     68|  state[12] = w4;
  353|     68|  state[13] = w5;
  354|     68|  state[14] = w6;
  355|     68|  state[15] = w7;
  356|     68|}

_ZN4absl12lts_2026052615random_internal29ReadSeedMaterialFromOSEntropyENS0_4SpanIjEE:
  188|      2|bool ReadSeedMaterialFromOSEntropy(absl::Span<uint32_t> values) {
  189|      2|  assert(values.data() != nullptr);
  190|      2|  if (values.data() == nullptr) {
  ------------------
  |  Branch (190:7): [True: 0, False: 2]
  ------------------
  191|      0|    return false;
  192|      0|  }
  193|      2|  if (values.empty()) {
  ------------------
  |  Branch (193:7): [True: 0, False: 2]
  ------------------
  194|      0|    return true;
  195|      0|  }
  196|      2|  return ReadSeedMaterialFromOSEntropyImpl(values);
  197|      2|}
seed_material.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_133ReadSeedMaterialFromOSEntropyImplENS0_4SpanIjEE:
  173|      2|bool ReadSeedMaterialFromOSEntropyImpl(absl::Span<uint32_t> values) {
  174|      2|#if defined(ABSL_RANDOM_USE_GET_ENTROPY)
  175|      2|  if (ReadSeedMaterialFromGetEntropy(values)) {
  ------------------
  |  Branch (175:7): [True: 2, False: 0]
  ------------------
  176|      2|    return true;
  177|      2|  }
  178|      0|#endif
  179|       |  // Libc may support getentropy, but the kernel may not, so we still have
  180|       |  // to fallback to ReadSeedMaterialFromDevURandom().
  181|      0|  return ReadSeedMaterialFromDevURandom(values);
  182|      2|}
seed_material.cc:_ZN4absl12lts_2026052615random_internal12_GLOBAL__N_130ReadSeedMaterialFromGetEntropyENS0_4SpanIjEE:
  122|      2|bool ReadSeedMaterialFromGetEntropy(absl::Span<uint32_t> values) {
  123|      2|  auto buffer = reinterpret_cast<uint8_t*>(values.data());
  124|      2|  size_t buffer_size = sizeof(uint32_t) * values.size();
  125|     18|  while (buffer_size > 0) {
  ------------------
  |  Branch (125:10): [True: 16, False: 2]
  ------------------
  126|       |    // getentropy() has a maximum permitted length of 256.
  127|     16|    size_t to_read = std::min<size_t>(buffer_size, 256);
  128|     16|    int result = getentropy(buffer, to_read);
  129|     16|    if (result < 0) {
  ------------------
  |  Branch (129:9): [True: 0, False: 16]
  ------------------
  130|      0|      return false;
  131|      0|    }
  132|       |    // https://github.com/google/sanitizers/issues/1173
  133|       |    // MemorySanitizer can't see through getentropy().
  134|     16|    ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, to_read);
  135|     16|    buffer += to_read;
  136|     16|    buffer_size -= to_read;
  137|     16|  }
  138|      2|  return true;
  139|      2|}

_ZN4absl12lts_2026052615random_internal26UniformDistributionWrapperIjEC2Ev:
  236|     16|      : UniformDistribution<NumType>(std::numeric_limits<NumType>::lowest(),
  237|     16|                                     (std::numeric_limits<NumType>::max)()) {}

_ZNK4absl12lts_2026052624uniform_int_distributionIjE5paramEv:
  135|     16|  param_type param() const { return param_; }
_ZNK4absl12lts_2026052624uniform_int_distributionIjE10param_type1aEv:
   81|     16|    result_type a() const { return lo_; }
_ZNK4absl12lts_2026052624uniform_int_distributionIjE10param_type5rangeEv:
   96|     16|    unsigned_type range() const { return range_; }
_ZN4absl12lts_2026052624uniform_int_distributionIjEC2Ejj:
  111|     16|      : param_(lo, hi) {}
_ZN4absl12lts_2026052624uniform_int_distributionIjE10param_typeC2Ejj:
   74|     16|        : lo_(lo),
   75|     16|          range_(static_cast<unsigned_type>(hi) -
   76|     16|                 static_cast<unsigned_type>(lo)) {
   77|       |      // [rand.dist.uni.int] precondition 2
   78|       |      assert(lo <= hi);
   79|     16|    }
_ZN4absl12lts_2026052624uniform_int_distributionIjEclINS0_6BitGenEEEjRT_:
  122|     16|  result_type operator()(URBG& gen) {  // NOLINT(runtime/references)
  123|     16|    return (*this)(gen, param());
  124|     16|  }
_ZN4absl12lts_2026052624uniform_int_distributionIjEclINS0_6BitGenEEEjRT_RKNS2_10param_typeE:
  128|     16|      URBG& gen, const param_type& param) {  // NOLINT(runtime/references)
  129|     16|    return static_cast<result_type>(param.a() + Generate(gen, param.range()));
  130|     16|  }
_ZN4absl12lts_2026052624uniform_int_distributionIjE8GenerateINS0_6BitGenEEEjRT_j:
  199|     16|    typename random_internal::make_unsigned_bits<IntType>::type R) {
  200|     16|  random_internal::FastUniformBits<unsigned_type> fast_bits;
  201|     16|  unsigned_type bits = fast_bits(g);
  202|     16|  const unsigned_type Lim = R + 1;
  203|     16|  if ((R & Lim) == 0) {
  ------------------
  |  Branch (203:7): [True: 16, False: 0]
  ------------------
  204|       |    // If the interval's length is a power of two range, just take the low bits.
  205|     16|    return bits & R;
  206|     16|  }
  207|       |
  208|       |  // Generates a uniform variate on [0, Lim) using fixed-point multiplication.
  209|       |  // The above fast-path guarantees that Lim is representable in unsigned_type.
  210|       |  //
  211|       |  // Algorithm adapted from
  212|       |  // http://lemire.me/blog/2016/06/30/fast-random-shuffling/, with added
  213|       |  // explanation.
  214|       |  //
  215|       |  // The algorithm creates a uniform variate `bits` in the interval [0, 2^N),
  216|       |  // and treats it as the fractional part of a fixed-point real value in [0, 1),
  217|       |  // multiplied by 2^N.  For example, 0.25 would be represented as 2^(N - 2),
  218|       |  // because 2^N * 0.25 == 2^(N - 2).
  219|       |  //
  220|       |  // Next, `bits` and `Lim` are multiplied with a wide-multiply to bring the
  221|       |  // value into the range [0, Lim).  The integral part (the high word of the
  222|       |  // multiplication result) is then very nearly the desired result.  However,
  223|       |  // this is not quite accurate; viewing the multiplication result as one
  224|       |  // double-width integer, the resulting values for the sample are mapped as
  225|       |  // follows:
  226|       |  //
  227|       |  // If the result lies in this interval:       Return this value:
  228|       |  //        [0, 2^N)                                    0
  229|       |  //        [2^N, 2 * 2^N)                              1
  230|       |  //        ...                                         ...
  231|       |  //        [K * 2^N, (K + 1) * 2^N)                    K
  232|       |  //        ...                                         ...
  233|       |  //        [(Lim - 1) * 2^N, Lim * 2^N)                Lim - 1
  234|       |  //
  235|       |  // While all of these intervals have the same size, the result of `bits * Lim`
  236|       |  // must be a multiple of `Lim`, and not all of these intervals contain the
  237|       |  // same number of multiples of `Lim`.  In particular, some contain
  238|       |  // `F = floor(2^N / Lim)` and some contain `F + 1 = ceil(2^N / Lim)`.  This
  239|       |  // difference produces a small nonuniformity, which is corrected by applying
  240|       |  // rejection sampling to one of the values in the "larger intervals" (i.e.,
  241|       |  // the intervals containing `F + 1` multiples of `Lim`.
  242|       |  //
  243|       |  // An interval contains `F + 1` multiples of `Lim` if and only if its smallest
  244|       |  // value modulo 2^N is less than `2^N % Lim`.  The unique value satisfying
  245|       |  // this property is used as the one for rejection.  That is, a value of
  246|       |  // `bits * Lim` is rejected if `(bit * Lim) % 2^N < (2^N % Lim)`.
  247|       |
  248|      0|  using helper = random_internal::wide_multiply<unsigned_type>;
  249|      0|  auto product = helper::multiply(bits, Lim);
  250|       |
  251|       |  // Two optimizations here:
  252|       |  // * Rejection occurs with some probability less than 1/2, and for reasonable
  253|       |  //   ranges considerably less (in particular, less than 1/(F+1)), so
  254|       |  //   ABSL_PREDICT_FALSE is apt.
  255|       |  // * `Lim` is an overestimate of `threshold`, and doesn't require a divide.
  256|      0|  if (ABSL_PREDICT_FALSE(helper::lo(product) < Lim)) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  257|       |    // This quantity is exactly equal to `2^N % Lim`, but does not require high
  258|       |    // precision calculations: `2^N % Lim` is congruent to `(2^N - Lim) % Lim`.
  259|       |    // Ideally this could be expressed simply as `-X` rather than `2^N - X`, but
  260|       |    // for types smaller than int, this calculation is incorrect due to integer
  261|       |    // promotion rules.
  262|      0|    const unsigned_type threshold =
  263|      0|        ((std::numeric_limits<unsigned_type>::max)() - Lim + 1) % Lim;
  264|      0|    while (helper::lo(product) < threshold) {
  ------------------
  |  Branch (264:12): [True: 0, False: 0]
  ------------------
  265|      0|      bits = fast_bits(g);
  266|      0|      product = helper::multiply(bits, Lim);
  267|      0|    }
  268|      0|  }
  269|       |
  270|      0|  return helper::hi(product);
  271|     16|}

_ZNK4absl12lts_2026052615status_internal9StatusRep5UnrefEv:
   53|  2.27k|void StatusRep::Unref() const {
   54|       |  // Fast path: if ref==1, there is no need for a RefCountDec (since
   55|       |  // this is the only reference and therefore no other thread is
   56|       |  // allowed to be mucking with r).
   57|  2.27k|  if (ref_.load(std::memory_order_acquire) == 1 ||
  ------------------
  |  Branch (57:7): [True: 2.27k, False: 0]
  ------------------
   58|  2.27k|      ref_.fetch_sub(1, std::memory_order_acq_rel) - 1 == 0) {
  ------------------
  |  Branch (58:7): [True: 0, False: 0]
  ------------------
   59|  2.27k|    delete this;
   60|  2.27k|  }
   61|  2.27k|}
_ZNK4absl12lts_2026052615status_internal9StatusRep14ForEachPayloadENS0_11FunctionRefIFvNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERKNS0_4CordEEEE:
  115|    115|    const {
  116|    115|  if (auto* payloads = payloads_.get()) {
  ------------------
  |  Branch (116:13): [True: 0, False: 115]
  ------------------
  117|      0|    bool in_reverse =
  118|      0|        payloads->size() > 1 && reinterpret_cast<uintptr_t>(payloads) % 13 > 6;
  ------------------
  |  Branch (118:9): [True: 0, False: 0]
  |  Branch (118:33): [True: 0, False: 0]
  ------------------
  119|       |
  120|      0|    for (size_t index = 0; index < payloads->size(); ++index) {
  ------------------
  |  Branch (120:28): [True: 0, False: 0]
  ------------------
  121|      0|      const auto& elem =
  122|      0|          (*payloads)[in_reverse ? payloads->size() - 1 - index : index];
  ------------------
  |  Branch (122:23): [True: 0, False: 0]
  ------------------
  123|       |
  124|      0|#ifdef NDEBUG
  125|      0|      visitor(elem.type_url, elem.payload);
  126|       |#else
  127|       |      // In debug mode invalidate the type url to prevent users from relying on
  128|       |      // this string lifetime.
  129|       |
  130|       |      // NOLINTNEXTLINE intentional extra conversion to force temporary.
  131|       |      visitor(std::string(elem.type_url), elem.payload);
  132|       |#endif  // NDEBUG
  133|      0|    }
  134|      0|  }
  135|    115|}
_ZN4absl12lts_2026052615status_internal9StatusRep17AddSourceLocationENS0_14SourceLocationE:
  141|  2.27k|void StatusRep::AddSourceLocation(absl::SourceLocation loc) {
  142|  2.27k|  source_locations_.push_back(loc);
  143|  2.27k|}
_ZN4absl12lts_2026052615status_internal14MapToLocalCodeEi:
  257|    115|absl::StatusCode MapToLocalCode(int value) {
  258|    115|  absl::StatusCode code = static_cast<absl::StatusCode>(value);
  259|    115|  switch (code) {
  260|      0|    case absl::StatusCode::kOk:
  ------------------
  |  Branch (260:5): [True: 0, False: 115]
  ------------------
  261|      0|    case absl::StatusCode::kCancelled:
  ------------------
  |  Branch (261:5): [True: 0, False: 115]
  ------------------
  262|      0|    case absl::StatusCode::kUnknown:
  ------------------
  |  Branch (262:5): [True: 0, False: 115]
  ------------------
  263|    115|    case absl::StatusCode::kInvalidArgument:
  ------------------
  |  Branch (263:5): [True: 115, False: 0]
  ------------------
  264|    115|    case absl::StatusCode::kDeadlineExceeded:
  ------------------
  |  Branch (264:5): [True: 0, False: 115]
  ------------------
  265|    115|    case absl::StatusCode::kNotFound:
  ------------------
  |  Branch (265:5): [True: 0, False: 115]
  ------------------
  266|    115|    case absl::StatusCode::kAlreadyExists:
  ------------------
  |  Branch (266:5): [True: 0, False: 115]
  ------------------
  267|    115|    case absl::StatusCode::kPermissionDenied:
  ------------------
  |  Branch (267:5): [True: 0, False: 115]
  ------------------
  268|    115|    case absl::StatusCode::kResourceExhausted:
  ------------------
  |  Branch (268:5): [True: 0, False: 115]
  ------------------
  269|    115|    case absl::StatusCode::kFailedPrecondition:
  ------------------
  |  Branch (269:5): [True: 0, False: 115]
  ------------------
  270|    115|    case absl::StatusCode::kAborted:
  ------------------
  |  Branch (270:5): [True: 0, False: 115]
  ------------------
  271|    115|    case absl::StatusCode::kOutOfRange:
  ------------------
  |  Branch (271:5): [True: 0, False: 115]
  ------------------
  272|    115|    case absl::StatusCode::kUnimplemented:
  ------------------
  |  Branch (272:5): [True: 0, False: 115]
  ------------------
  273|    115|    case absl::StatusCode::kInternal:
  ------------------
  |  Branch (273:5): [True: 0, False: 115]
  ------------------
  274|    115|    case absl::StatusCode::kUnavailable:
  ------------------
  |  Branch (274:5): [True: 0, False: 115]
  ------------------
  275|    115|    case absl::StatusCode::kDataLoss:
  ------------------
  |  Branch (275:5): [True: 0, False: 115]
  ------------------
  276|    115|    case absl::StatusCode::kUnauthenticated:
  ------------------
  |  Branch (276:5): [True: 0, False: 115]
  ------------------
  277|    115|      return code;
  278|      0|    default:
  ------------------
  |  Branch (278:5): [True: 0, False: 115]
  ------------------
  279|      0|      return absl::StatusCode::kUnknown;
  280|    115|  }
  281|    115|}

_ZN4absl12lts_2026052615status_internal9StatusRepC2ENS0_10StatusCodeENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEENS4_10unique_ptrINS0_13InlinedVectorINS1_7PayloadELm1ENS4_9allocatorISB_EEEENS4_14default_deleteISE_EEEE:
   82|  2.27k|      : ref_(int32_t{1}),
   83|  2.27k|        code_(code_arg),
   84|  2.27k|        message_(message_arg),
   85|  2.27k|        payloads_(std::move(payloads_arg)) {}
_ZNK4absl12lts_2026052615status_internal9StatusRep4codeEv:
   87|    115|  absl::StatusCode code() const { return code_; }
_ZNK4absl12lts_2026052615status_internal9StatusRep7messageEv:
   88|    118|  const std::string& message() const { return message_; }

_ZN4absl12lts_2026052617internal_statusor12PlacementNewINS0_6StatusEJEEEvPvDpOT0_:
  246|  13.7k|void PlacementNew(void* absl_nonnull p, Args&&... args) {
  247|  13.7k|  new (p) T(std::forward<Args>(args)...);
  248|  13.7k|}
_ZN4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEED2Ev:
  358|  15.9k|  ~StatusOrData() {
  359|  15.9k|    if (ok()) {
  ------------------
  |  Branch (359:9): [True: 13.7k, False: 2.15k]
  ------------------
  360|  13.7k|      status_.~Status();
  361|  13.7k|      if constexpr (!std::is_trivially_destructible_v<T>) {
  362|  13.7k|        data_.~T();
  363|  13.7k|      }
  364|  13.7k|    } else {
  365|  2.15k|      status_.~Status();
  366|  2.15k|    }
  367|  15.9k|  }
_ZNK4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEE2okEv:
  386|  31.8k|  bool ok() const { return status_.ok(); }
_ZNO4absl12lts_2026052617internal_statusor12OperatorBaseIN8fuzztest8internal11CopyableAnyEEdeEv:
  473|  13.7k|  T&& operator*() && ABSL_ATTRIBUTE_LIFETIME_BOUND {
  474|  13.7k|    self().EnsureOk();
  475|  13.7k|    return std::move(self().data_);
  476|  13.7k|  }
_ZN4absl12lts_2026052617internal_statusor12OperatorBaseIN8fuzztest8internal11CopyableAnyEE4selfEv:
  459|  27.5k|  auto& self() { return static_cast<StatusOr<T>&>(*this); }
_ZNK4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEE8EnsureOkEv:
  413|  13.7k|  void EnsureOk() const {
  414|  13.7k|    if (ABSL_PREDICT_FALSE(!ok())) Helper::Crash(status_);
  ------------------
  |  |  190|  13.7k|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 13.7k]
  |  |  |  Branch (190:49): [Folded, False: 13.7k]
  |  |  |  Branch (190:58): [True: 0, False: 13.7k]
  |  |  ------------------
  ------------------
  415|  13.7k|  }
_ZN4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEEC2INS0_6StatusETnNSt3__19enable_ifIXsr3std16is_constructibleIS8_OT_EE5valueEiE4typeELi0EEESC_:
  336|  2.15k|  explicit StatusOrData(U&& v) : status_(std::forward<U>(v)) {
  337|  2.15k|    EnsureNotOk();
  338|  2.15k|  }
_ZN4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEE11EnsureNotOkEv:
  417|  2.15k|  void EnsureNotOk() {
  418|  2.15k|    if (ABSL_PREDICT_FALSE(ok())) Helper::HandleInvalidStatusCtorArg(&status_);
  ------------------
  |  |  190|  2.15k|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2.15k]
  |  |  |  Branch (190:49): [Folded, False: 2.15k]
  |  |  |  Branch (190:58): [True: 0, False: 2.15k]
  |  |  ------------------
  ------------------
  419|  2.15k|  }
_ZN4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEEC2IJRS5_EEENSt3__110in_place_tEDpOT_:
  329|  13.7k|      : data_(std::forward<Args>(args)...) {
  330|  13.7k|    MakeStatus();
  331|  13.7k|  }
_ZN4absl12lts_2026052617internal_statusor12StatusOrDataIN8fuzztest8internal11CopyableAnyEE10MakeStatusIJEEEvDpOT_:
  432|  13.7k|  void MakeStatus(Args&&... args) {
  433|  13.7k|    internal_statusor::PlacementNew<Status>(&status_,
  434|  13.7k|                                            std::forward<Args>(args)...);
  435|  13.7k|  }

_ZN4absl12lts_2026052615status_internal13MakeErrorImplILi3EEENS0_6StatusENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEENS0_14SourceLocationE:
  164|  2.16k|Status MakeErrorImpl(string_view message, SourceLocation loc) {
  165|  2.16k|  return Status(static_cast<StatusCode>(error_code), message, loc);
  166|  2.16k|}
_ZN4absl12lts_202605266Status7MakeRepEmNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS0_14SourceLocationE:
  116|  2.27k|                          absl::SourceLocation loc) {
  117|  2.27k|  bool ok = inlined_rep == CodeToInlinedRep(absl::StatusCode::kOk);
  118|  2.27k|  if (ok) return inlined_rep;
  ------------------
  |  Branch (118:7): [True: 0, False: 2.27k]
  ------------------
  119|  2.27k|  if (msg.empty()
  ------------------
  |  Branch (119:7): [True: 0, False: 2.27k]
  ------------------
  120|  2.27k|  ) {
  121|      0|    return inlined_rep;
  122|      0|  }
  123|  2.27k|  auto* rep = new status_internal::StatusRep(InlinedRepToCode(inlined_rep), msg,
  124|  2.27k|                                             nullptr);
  125|  2.27k|  if (loc.file_name()[0] != '\0') {
  ------------------
  |  Branch (125:7): [True: 2.27k, False: 0]
  ------------------
  126|  2.27k|    rep->AddSourceLocation(loc);
  127|  2.27k|  }
  128|  2.27k|  return PointerToRep(rep);
  129|  2.27k|}

_ZN4absl12lts_202605266StatusC2Em:
  714|   429M|  explicit Status(uintptr_t rep) : rep_(rep) {}
_ZN4absl12lts_202605266StatusaSEOS1_:
  918|   550k|inline Status& Status::operator=(Status&& x) noexcept {
  919|   550k|  uintptr_t old_rep = rep_;
  920|   550k|  if (x.rep_ != old_rep) {
  ------------------
  |  Branch (920:7): [True: 72, False: 550k]
  ------------------
  921|     72|    rep_ = x.rep_;
  922|     72|    x.rep_ = MovedFromRep();
  923|     72|    Unref(old_rep);
  924|     72|  }
  925|   550k|  return *this;
  926|   550k|}
_ZNK4absl12lts_202605266Status2okEv:
  942|   429M|inline bool Status::ok() const {
  943|   429M|  return rep_ == CodeToInlinedRep(absl::StatusCode::kOk);
  944|   429M|}
_ZNK4absl12lts_202605266Status4codeEv:
  946|    115|inline absl::StatusCode Status::code() const {
  947|    115|  return status_internal::MapToLocalCode(raw_code());
  948|    115|}
_ZNK4absl12lts_202605266Status8raw_codeEv:
  950|    115|inline int Status::raw_code() const {
  951|    115|  if (IsInlined(rep_)) return static_cast<int>(InlinedRepToCode(rep_));
  ------------------
  |  Branch (951:7): [True: 0, False: 115]
  ------------------
  952|    115|  return static_cast<int>(RepToPointer(rep_)->code());
  953|    115|}
_ZNK4absl12lts_202605266Status7messageEv:
  955|    118|inline absl::string_view Status::message() const {
  956|    118|  return !IsInlined(rep_)
  ------------------
  |  Branch (956:10): [True: 118, False: 0]
  ------------------
  957|    118|             ? RepToPointer(rep_)->message()
  958|    118|             : (IsMovedFrom(rep_) ? absl::string_view(kMovedFromString)
  ------------------
  |  Branch (958:17): [True: 0, False: 0]
  ------------------
  959|      0|                                  : absl::string_view());
  960|    118|}
_ZNK4absl12lts_202605266Status14ForEachPayloadENS0_11FunctionRefIFvNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEERKNS0_4CordEEEE:
 1009|    115|    const {
 1010|    115|  if (IsInlined(rep_)) return;
  ------------------
  |  Branch (1010:7): [True: 0, False: 115]
  ------------------
 1011|    115|  RepToPointer(rep_)->ForEachPayload(visitor);
 1012|    115|}
_ZN4absl12lts_202605266Status9IsInlinedEm:
 1014|   430M|constexpr bool Status::IsInlined(uintptr_t rep) { return (rep & 1) != 0; }
_ZN4absl12lts_202605266Status16CodeToInlinedRepENS0_10StatusCodeE:
 1018|   858M|constexpr uintptr_t Status::CodeToInlinedRep(absl::StatusCode code) {
 1019|   858M|  return (static_cast<uintptr_t>(code) << 2) + 1;
 1020|   858M|}
_ZN4absl12lts_202605266Status16InlinedRepToCodeEm:
 1022|  2.27k|constexpr absl::StatusCode Status::InlinedRepToCode(uintptr_t rep) {
 1023|  2.27k|  ABSL_ASSERT(IsInlined(rep));
  ------------------
  |  |  127|  2.27k|#define ABSL_ASSERT(expr) ABSL_INTERNAL_UNEVALUATED((expr) ? void() : void())
  |  |  ------------------
  |  |  |  |   87|  2.27k|#define ABSL_INTERNAL_UNEVALUATED(expr) (false ? (void)(expr) : void())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (87:42): [Folded, False: 2.27k]
  |  |  |  |  |  Branch (87:57): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|  2.27k|  return static_cast<absl::StatusCode>(rep >> 2);
 1025|  2.27k|}
_ZN4absl12lts_202605266Status12MovedFromRepEv:
 1027|  29.8k|constexpr uintptr_t Status::MovedFromRep() {
 1028|  29.8k|  return CodeToInlinedRep(absl::StatusCode::kInternal) | 2;
 1029|  29.8k|}
_ZN4absl12lts_202605266Status12RepToPointerEm:
 1032|  2.62k|    uintptr_t rep) {
 1033|       |  assert(!IsInlined(rep));
 1034|  2.62k|  return reinterpret_cast<const status_internal::StatusRep*>(rep);
 1035|  2.62k|}
_ZN4absl12lts_202605266Status12PointerToRepEPNS0_15status_internal9StatusRepE:
 1038|  2.27k|    status_internal::StatusRep* absl_nonnull rep) {
 1039|  2.27k|  return reinterpret_cast<uintptr_t>(rep);
 1040|  2.27k|}
_ZN4absl12lts_202605266Status3RefEm:
 1042|   564k|inline void Status::Ref(uintptr_t rep) {
 1043|   564k|  if (!IsInlined(rep)) RepToPointer(rep)->Ref();
  ------------------
  |  Branch (1043:7): [True: 0, False: 564k]
  ------------------
 1044|   564k|}
_ZN4absl12lts_202605266Status5UnrefEm:
 1046|   429M|inline void Status::Unref(uintptr_t rep) {
 1047|   429M|  if (!IsInlined(rep)) RepToPointer(rep)->Unref();
  ------------------
  |  Branch (1047:7): [True: 2.27k, False: 429M]
  ------------------
 1048|   429M|}
_ZN4absl12lts_202605268OkStatusEv:
 1050|   428M|inline Status OkStatus() { return Status(); }
_ZN4absl12lts_2026052620InvalidArgumentErrorENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS0_14SourceLocationE:
 1133|  2.16k|                                   absl::SourceLocation loc) {
 1134|  2.16k|  return status_internal::MakeError<StatusCode::kInvalidArgument>(message, loc);
 1135|  2.16k|}
_ZN4absl12lts_2026052615status_internal9MakeErrorILNS0_10StatusCodeE3EEENS0_6StatusENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS0_14SourceLocationE:
 1090|  2.16k|Status MakeError(string_view message, SourceLocation loc) {
 1091|  2.16k|  Status out = MakeErrorImpl<static_cast<int>(error_code)>(message, loc);
 1092|       |  // -Wassume warning complains about potential side effects of `ok()`, so use a
 1093|       |  // local to avoid that.
 1094|  2.16k|  ABSL_ATTRIBUTE_UNUSED bool ok = out.ok();
  ------------------
  |  |  582|  2.16k|#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__))
  ------------------
 1095|  2.16k|  ABSL_ASSUME(!ok);
  ------------------
  |  |  271|  2.16k|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
 1096|  2.16k|  return out;
 1097|  2.16k|}
_ZN4absl12lts_202605266StatusC2Ev:
  894|   428M|inline Status::Status() : Status(absl::StatusCode::kOk) {}
_ZN4absl12lts_202605266StatusC2ENS0_10StatusCodeE:
  896|   428M|inline Status::Status(absl::StatusCode code) : Status(CodeToInlinedRep(code)) {}
_ZN4absl12lts_202605266StatusC2EOS1_:
  914|  29.8k|inline Status::Status(Status&& x) noexcept : Status(x.rep_) {
  915|  29.8k|  x.rep_ = MovedFromRep();
  916|  29.8k|}
_ZN4absl12lts_202605266StatusD2Ev:
  940|   429M|inline Status::~Status() { Unref(rep_); }
_ZN4absl12lts_202605266StatusC2ENS0_10StatusCodeENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEENS0_14SourceLocationE:
  900|  2.27k|    : Status(MakeRep(CodeToInlinedRep(code), msg, loc)) {}
_ZN4absl12lts_202605266StatusC2ERKS1_:
  902|   564k|inline Status::Status(const Status& x) : Status(x.rep_) { Ref(rep_); }

_ZNK4absl12lts_202605268StatusOrIN8fuzztest8internal11CopyableAnyEE2okEv:
  471|  15.9k|  ABSL_MUST_USE_RESULT bool ok() const { return this->status_.ok(); }
_ZN4absl12lts_202605268StatusOrIN8fuzztest8internal11CopyableAnyEEC2INS0_6StatusETnNSt3__19enable_ifIXsr17internal_statusor29IsConstructionFromStatusValidILb0ES4_T_EE5valueEiE4typeELi0EEEOSA_:
  367|  2.15k|  StatusOr(U&& v) : Base(std::forward<U>(v)) {}
_ZN4absl12lts_202605268StatusOrIN8fuzztest8internal11CopyableAnyEEC2IRS4_TnNSt3__19enable_ifIXsr17internal_statusor19IsConstructionValidILb0ES4_T_Lb0EEE5valueEiE4typeELi0EEEOSA_:
  436|  13.7k|      : StatusOr(std::in_place, std::forward<U>(u)) {}
_ZN4absl12lts_202605268StatusOrIN8fuzztest8internal11CopyableAnyEEC2IJRS4_EEENSt3__110in_place_tEDpOT_:
  751|  13.7k|    : Base(std::in_place, std::forward<Args>(args)...) {}

_ZN4absl12lts_2026052613ascii_isspaceEh:
  105|  47.6k|inline bool ascii_isspace(unsigned char c) {
  106|  47.6k|  return (ascii_internal::kPropertyBits[c] & 0x08) != 0;
  107|  47.6k|}
_ZN4absl12lts_2026052627StripLeadingAsciiWhitespaceENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  244|  22.7k|    absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) {
  245|  22.7k|  auto it = std::find_if_not(str.begin(), str.end(), absl::ascii_isspace);
  246|  22.7k|  return str.substr(static_cast<size_t>(it - str.begin()));
  247|  22.7k|}
_ZN4absl12lts_2026052628StripTrailingAsciiWhitespaceENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  258|  22.7k|    absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) {
  259|  22.7k|  auto it = std::find_if_not(str.rbegin(), str.rend(), absl::ascii_isspace);
  260|  22.7k|  return str.substr(0, static_cast<size_t>(str.rend() - it));
  261|  22.7k|}
_ZN4absl12lts_2026052620StripAsciiWhitespaceENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  272|  22.7k|    absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) {
  273|  22.7k|  return StripTrailingAsciiWhitespace(StripLeadingAsciiWhitespace(str));
  274|  22.7k|}

_ZN4absl12lts_2026052610from_charsEPKcS2_RdNS0_12chars_formatE:
  949|  22.7k|                             chars_format fmt) {
  950|  22.7k|  return FromCharsImpl(first, last, value, fmt);
  951|  22.7k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113FromCharsImplIdEENS0_17from_chars_resultEPKcS5_RT_NS0_12chars_formatE:
  862|  22.7k|                                chars_format fmt_flags) {
  863|  22.7k|  from_chars_result result;
  864|  22.7k|  result.ptr = first;  // overwritten on successful parse
  865|  22.7k|  result.ec = std::errc();
  866|       |
  867|  22.7k|  bool negative = false;
  868|  22.7k|  if (first != last && *first == '-') {
  ------------------
  |  Branch (868:7): [True: 22.7k, False: 0]
  |  Branch (868:24): [True: 2.98k, False: 19.8k]
  ------------------
  869|  2.98k|    ++first;
  870|  2.98k|    negative = true;
  871|  2.98k|  }
  872|       |  // If the `hex` flag is *not* set, then we will accept a 0x prefix and try
  873|       |  // to parse a hexadecimal float.
  874|  22.7k|  if ((fmt_flags & chars_format::hex) == chars_format{} && last - first >= 2 &&
  ------------------
  |  Branch (874:7): [True: 22.7k, False: 0]
  |  Branch (874:60): [True: 20.9k, False: 1.83k]
  ------------------
  875|  20.9k|      *first == '0' && (first[1] == 'x' || first[1] == 'X')) {
  ------------------
  |  Branch (875:7): [True: 5.94k, False: 15.0k]
  |  Branch (875:25): [True: 560, False: 5.38k]
  |  Branch (875:44): [True: 4.18k, False: 1.19k]
  ------------------
  876|  4.74k|    const char* hex_first = first + 2;
  877|  4.74k|    strings_internal::ParsedFloat hex_parse =
  878|  4.74k|        strings_internal::ParseFloat<16>(hex_first, last, fmt_flags);
  879|  4.74k|    if (hex_parse.end == nullptr ||
  ------------------
  |  Branch (879:9): [True: 30, False: 4.71k]
  ------------------
  880|  4.71k|        hex_parse.type != strings_internal::FloatType::kNumber) {
  ------------------
  |  Branch (880:9): [True: 1, False: 4.71k]
  ------------------
  881|       |      // Either we failed to parse a hex float after the "0x", or we read
  882|       |      // "0xinf" or "0xnan" which we don't want to match.
  883|       |      //
  884|       |      // However, a string that begins with "0x" also begins with "0", which
  885|       |      // is normally a valid match for the number zero.  So we want these
  886|       |      // strings to match zero unless fmt_flags is `scientific`.  (This flag
  887|       |      // means an exponent is required, which the string "0" does not have.)
  888|     31|      if (fmt_flags == chars_format::scientific) {
  ------------------
  |  Branch (888:11): [True: 0, False: 31]
  ------------------
  889|      0|        result.ec = std::errc::invalid_argument;
  890|     31|      } else {
  891|     31|        result.ptr = first + 1;
  892|     31|        value = negative ? -0.0f : 0.0f;
  ------------------
  |  Branch (892:17): [True: 0, False: 31]
  ------------------
  893|     31|      }
  894|     31|      return result;
  895|     31|    }
  896|       |    // We matched a value.
  897|  4.71k|    result.ptr = hex_parse.end;
  898|  4.71k|    if (HandleEdgeCase(hex_parse, negative, &value)) {
  ------------------
  |  Branch (898:9): [True: 1.34k, False: 3.37k]
  ------------------
  899|  1.34k|      return result;
  900|  1.34k|    }
  901|  3.37k|    CalculatedFloat calculated =
  902|  3.37k|        CalculateFromParsedHexadecimal<FloatType>(hex_parse);
  903|  3.37k|    EncodeResult(calculated, negative, &result, &value);
  904|  3.37k|    return result;
  905|  4.71k|  }
  906|       |  // Otherwise, we choose the number base based on the flags.
  907|  18.0k|  if ((fmt_flags & chars_format::hex) == chars_format::hex) {
  ------------------
  |  Branch (907:7): [True: 0, False: 18.0k]
  ------------------
  908|      0|    strings_internal::ParsedFloat hex_parse =
  909|      0|        strings_internal::ParseFloat<16>(first, last, fmt_flags);
  910|      0|    if (hex_parse.end == nullptr) {
  ------------------
  |  Branch (910:9): [True: 0, False: 0]
  ------------------
  911|      0|      result.ec = std::errc::invalid_argument;
  912|      0|      return result;
  913|      0|    }
  914|      0|    result.ptr = hex_parse.end;
  915|      0|    if (HandleEdgeCase(hex_parse, negative, &value)) {
  ------------------
  |  Branch (915:9): [True: 0, False: 0]
  ------------------
  916|      0|      return result;
  917|      0|    }
  918|      0|    CalculatedFloat calculated =
  919|      0|        CalculateFromParsedHexadecimal<FloatType>(hex_parse);
  920|      0|    EncodeResult(calculated, negative, &result, &value);
  921|      0|    return result;
  922|  18.0k|  } else {
  923|  18.0k|    strings_internal::ParsedFloat decimal_parse =
  924|  18.0k|        strings_internal::ParseFloat<10>(first, last, fmt_flags);
  925|  18.0k|    if (decimal_parse.end == nullptr) {
  ------------------
  |  Branch (925:9): [True: 70, False: 17.9k]
  ------------------
  926|     70|      result.ec = std::errc::invalid_argument;
  927|     70|      return result;
  928|     70|    }
  929|  17.9k|    result.ptr = decimal_parse.end;
  930|  17.9k|    if (HandleEdgeCase(decimal_parse, negative, &value)) {
  ------------------
  |  Branch (930:9): [True: 2.82k, False: 15.1k]
  ------------------
  931|  2.82k|      return result;
  932|  2.82k|    }
  933|       |    // A nullptr subrange_begin means that the decimal_parse.mantissa is exact
  934|       |    // (not truncated), a precondition of the Eisel-Lemire algorithm.
  935|  15.1k|    if ((decimal_parse.subrange_begin == nullptr) &&
  ------------------
  |  Branch (935:9): [True: 7.29k, False: 7.85k]
  ------------------
  936|  7.29k|        EiselLemire<FloatType>(decimal_parse, negative, &value, &result.ec)) {
  ------------------
  |  Branch (936:9): [True: 4.00k, False: 3.29k]
  ------------------
  937|  4.00k|      return result;
  938|  4.00k|    }
  939|  11.1k|    CalculatedFloat calculated =
  940|  11.1k|        CalculateFromParsedDecimal<FloatType>(decimal_parse);
  941|  11.1k|    EncodeResult(calculated, negative, &result, &value);
  942|  11.1k|    return result;
  943|  15.1k|  }
  944|  18.0k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_114HandleEdgeCaseIdEEbRKNS0_16strings_internal11ParsedFloatEbPT_:
  360|  22.6k|                    FloatType* absl_nonnull value) {
  361|  22.6k|  if (input.type == strings_internal::FloatType::kNan) {
  ------------------
  |  Branch (361:7): [True: 613, False: 22.0k]
  ------------------
  362|       |    // A bug in gcc would cause the compiler to optimize away the buffer we are
  363|       |    // building below.  Declaring the buffer volatile avoids the issue, and has
  364|       |    // no measurable performance impact in microbenchmarks.
  365|       |    //
  366|       |    // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86113
  367|    613|    constexpr ptrdiff_t kNanBufferSize = 128;
  368|       |#if (defined(__GNUC__) && !defined(__clang__))
  369|       |    volatile char n_char_sequence[kNanBufferSize];
  370|       |#else
  371|    613|    char n_char_sequence[kNanBufferSize];
  372|    613|#endif
  373|    613|    if (input.subrange_begin == nullptr) {
  ------------------
  |  Branch (373:9): [True: 613, False: 0]
  ------------------
  374|    613|      n_char_sequence[0] = '\0';
  375|    613|    } else {
  376|      0|      ptrdiff_t nan_size = input.subrange_end - input.subrange_begin;
  377|      0|      nan_size = std::min(nan_size, kNanBufferSize - 1);
  378|      0|      std::copy_n(input.subrange_begin, nan_size, n_char_sequence);
  379|      0|      n_char_sequence[nan_size] = '\0';
  380|      0|    }
  381|    613|    char* nan_argument = const_cast<char*>(n_char_sequence);
  382|    613|    *value = negative ? -FloatTraits<FloatType>::MakeNan(nan_argument)
  ------------------
  |  Branch (382:14): [True: 194, False: 419]
  ------------------
  383|    613|                      : FloatTraits<FloatType>::MakeNan(nan_argument);
  384|    613|    return true;
  385|    613|  }
  386|  22.0k|  if (input.type == strings_internal::FloatType::kInfinity) {
  ------------------
  |  Branch (386:7): [True: 421, False: 21.6k]
  ------------------
  387|    421|    *value = negative ? -std::numeric_limits<FloatType>::infinity()
  ------------------
  |  Branch (387:14): [True: 0, False: 421]
  ------------------
  388|    421|                      : std::numeric_limits<FloatType>::infinity();
  389|    421|    return true;
  390|    421|  }
  391|  21.6k|  if (input.mantissa == 0) {
  ------------------
  |  Branch (391:7): [True: 3.12k, False: 18.5k]
  ------------------
  392|  3.12k|    *value = negative ? -0.0f : 0.0f;
  ------------------
  |  Branch (392:14): [True: 40, False: 3.08k]
  ------------------
  393|  3.12k|    return true;
  394|  3.12k|  }
  395|  18.5k|  return false;
  396|  21.6k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_111FloatTraitsIdE7MakeNanEPKc:
  123|    613|  static double MakeNan(const char* absl_nonnull tagp) {
  124|    613|#if ABSL_HAVE_BUILTIN(__builtin_nan)
  125|       |    // Use __builtin_nan() if available since it has a fix for
  126|       |    // https://bugs.llvm.org/show_bug.cgi?id=37778
  127|       |    // std::nan may use the glibc implementation.
  128|    613|    return __builtin_nan(tagp);
  129|       |#else
  130|       |    // Support nan no matter which namespace it's in.  Some platforms
  131|       |    // incorrectly don't put it in namespace std.
  132|       |    using namespace std;  // NOLINT
  133|       |    return nan(tagp);
  134|       |#endif
  135|    613|  }
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_130CalculateFromParsedHexadecimalIdEENS1_15CalculatedFloatERKNS0_16strings_internal11ParsedFloatE:
  599|  3.37k|    const strings_internal::ParsedFloat& parsed_hex) {
  600|  3.37k|  uint64_t mantissa = parsed_hex.mantissa;
  601|  3.37k|  int exponent = parsed_hex.exponent;
  602|       |  // This static_cast is only needed when using a std::bit_width()
  603|       |  // implementation that does not have the fix for LWG 3656 applied.
  604|  3.37k|  int mantissa_width = static_cast<int>(bit_width(mantissa));
  605|  3.37k|  const int shift = NormalizedShiftSize<FloatType>(mantissa_width, exponent);
  606|  3.37k|  bool result_exact;
  607|  3.37k|  exponent += shift;
  608|  3.37k|  mantissa = ShiftRightAndRound(mantissa, shift,
  609|  3.37k|                                /* input exact= */ true, &result_exact);
  610|       |  // ParseFloat handles rounding in the hexadecimal case, so we don't have to
  611|       |  // check `result_exact` here.
  612|  3.37k|  return CalculatedFloatFromRawValues<FloatType>(mantissa, exponent);
  613|  3.37k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_119NormalizedShiftSizeIdEEiii:
  335|  14.0k|int NormalizedShiftSize(int mantissa_width, int binary_exponent) {
  336|  14.0k|  const int normal_shift =
  337|  14.0k|      mantissa_width - FloatTraits<FloatType>::kTargetMantissaBits;
  338|  14.0k|  const int minimum_shift =
  339|  14.0k|      FloatTraits<FloatType>::kMinNormalExponent - binary_exponent;
  340|  14.0k|  return std::max(normal_shift, minimum_shift);
  341|  14.0k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_118ShiftRightAndRoundENS0_7uint128EibPb:
  453|  14.0k|                            bool* absl_nonnull output_exact) {
  454|  14.0k|  if (shift <= 0) {
  ------------------
  |  Branch (454:7): [True: 1.77k, False: 12.3k]
  ------------------
  455|  1.77k|    *output_exact = input_exact;
  456|  1.77k|    return static_cast<uint64_t>(value << -shift);
  457|  1.77k|  }
  458|  12.3k|  if (shift >= 128) {
  ------------------
  |  Branch (458:7): [True: 254, False: 12.0k]
  ------------------
  459|       |    // Exponent is so small that we are shifting away all significant bits.
  460|       |    // Answer will not be representable, even as a subnormal, so return a zero
  461|       |    // mantissa (which represents underflow).
  462|    254|    *output_exact = true;
  463|    254|    return 0;
  464|    254|  }
  465|       |
  466|  12.0k|  *output_exact = true;
  467|  12.0k|  const uint128 shift_mask = (uint128(1) << shift) - 1;
  468|  12.0k|  const uint128 halfway_point = uint128(1) << (shift - 1);
  469|       |
  470|  12.0k|  const uint128 shifted_bits = value & shift_mask;
  471|  12.0k|  value >>= shift;
  472|  12.0k|  if (shifted_bits > halfway_point) {
  ------------------
  |  Branch (472:7): [True: 1.46k, False: 10.5k]
  ------------------
  473|       |    // Shifted bits greater than 10000... require rounding up.
  474|  1.46k|    return static_cast<uint64_t>(value + 1);
  475|  1.46k|  }
  476|  10.5k|  if (shifted_bits == halfway_point) {
  ------------------
  |  Branch (476:7): [True: 1.36k, False: 9.23k]
  ------------------
  477|       |    // In exact mode, shifted bits of 10000... mean we're exactly halfway
  478|       |    // between two numbers, and we must round to even.  So only round up if
  479|       |    // the low bit of `value` is set.
  480|       |    //
  481|       |    // In inexact mode, the nonzero error means the actual value is greater
  482|       |    // than the halfway point and we must always round up.
  483|  1.36k|    if ((value & 1) == 1 || !input_exact) {
  ------------------
  |  Branch (483:9): [True: 411, False: 953]
  |  Branch (483:29): [True: 215, False: 738]
  ------------------
  484|    626|      ++value;
  485|    626|    }
  486|  1.36k|    return static_cast<uint64_t>(value);
  487|  1.36k|  }
  488|  9.23k|  if (!input_exact && shifted_bits == halfway_point - 1) {
  ------------------
  |  Branch (488:7): [True: 8.67k, False: 564]
  |  Branch (488:23): [True: 7.99k, False: 676]
  ------------------
  489|       |    // Rounding direction is unclear, due to error.
  490|  7.99k|    *output_exact = false;
  491|  7.99k|  }
  492|       |  // Otherwise, round down.
  493|  9.23k|  return static_cast<uint64_t>(value);
  494|  10.5k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_128CalculatedFloatFromRawValuesIdEENS1_15CalculatedFloatEmi:
  580|  14.0k|CalculatedFloat CalculatedFloatFromRawValues(uint64_t mantissa, int exponent) {
  581|  14.0k|  CalculatedFloat result;
  582|  14.0k|  if (mantissa == uint64_t{1} << FloatTraits<FloatType>::kTargetMantissaBits) {
  ------------------
  |  Branch (582:7): [True: 505, False: 13.5k]
  ------------------
  583|    505|    mantissa >>= 1;
  584|    505|    exponent += 1;
  585|    505|  }
  586|  14.0k|  if (exponent > FloatTraits<FloatType>::kMaxExponent) {
  ------------------
  |  Branch (586:7): [True: 1.65k, False: 12.4k]
  ------------------
  587|  1.65k|    result.exponent = kOverflow;
  588|  12.4k|  } else if (mantissa == 0) {
  ------------------
  |  Branch (588:14): [True: 786, False: 11.6k]
  ------------------
  589|    786|    result.exponent = kUnderflow;
  590|  11.6k|  } else {
  591|  11.6k|    result.exponent = exponent;
  592|  11.6k|    result.mantissa = mantissa;
  593|  11.6k|  }
  594|  14.0k|  return result;
  595|  14.0k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_112EncodeResultIdEEvRKNS1_15CalculatedFloatEbPNS0_17from_chars_resultEPT_:
  407|  14.5k|                  FloatType* absl_nonnull value) {
  408|  14.5k|  if (calculated.exponent == kOverflow) {
  ------------------
  |  Branch (408:7): [True: 1.86k, False: 12.6k]
  ------------------
  409|  1.86k|    result->ec = std::errc::result_out_of_range;
  410|  1.86k|    *value = negative ? -std::numeric_limits<FloatType>::max()
  ------------------
  |  Branch (410:14): [True: 145, False: 1.72k]
  ------------------
  411|  1.86k|                      : std::numeric_limits<FloatType>::max();
  412|  1.86k|    return;
  413|  12.6k|  } else if (calculated.mantissa == 0 || calculated.exponent == kUnderflow) {
  ------------------
  |  Branch (413:14): [True: 1.00k, False: 11.6k]
  |  Branch (413:42): [True: 0, False: 11.6k]
  ------------------
  414|  1.00k|    result->ec = std::errc::result_out_of_range;
  415|  1.00k|    *value = negative ? -0.0f : 0.0f;
  ------------------
  |  Branch (415:14): [True: 59, False: 941]
  ------------------
  416|  1.00k|    return;
  417|  1.00k|  }
  418|  11.6k|  *value = FloatTraits<FloatType>::Make(
  419|  11.6k|      static_cast<typename FloatTraits<FloatType>::mantissa_t>(
  420|  11.6k|          calculated.mantissa),
  421|  11.6k|      calculated.exponent, negative);
  422|  11.6k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_111FloatTraitsIdE4MakeEmib:
  150|  11.6k|  static double Make(mantissa_t mantissa, int exponent, bool sign) {
  151|       |#ifndef ABSL_BIT_PACK_FLOATS
  152|       |    // Support ldexp no matter which namespace it's in.  Some platforms
  153|       |    // incorrectly don't put it in namespace std.
  154|       |    using namespace std;  // NOLINT
  155|       |    return sign ? -ldexp(mantissa, exponent) : ldexp(mantissa, exponent);
  156|       |#else
  157|  11.6k|    constexpr uint64_t kMantissaMask =
  158|  11.6k|        (uint64_t{1} << (kTargetMantissaBits - 1)) - 1;
  159|  11.6k|    uint64_t dbl = static_cast<uint64_t>(sign) << 63;
  160|  11.6k|    if (mantissa > kMantissaMask) {
  ------------------
  |  Branch (160:9): [True: 11.0k, False: 610]
  ------------------
  161|       |      // Normal value.
  162|       |      // Adjust by 1023 for the exponent representation bias, and an additional
  163|       |      // 52 due to the implied decimal point in the IEEE mantissa
  164|       |      // representation.
  165|  11.0k|      dbl += static_cast<uint64_t>(exponent + 1023 + kTargetMantissaBits - 1)
  166|  11.0k|             << 52;
  167|  11.0k|      mantissa &= kMantissaMask;
  168|  11.0k|    } else {
  169|       |      // subnormal value
  170|       |      assert(exponent == kMinNormalExponent);
  171|    610|    }
  172|  11.6k|    dbl += mantissa;
  173|  11.6k|    return absl::bit_cast<double>(dbl);
  174|  11.6k|#endif  // ABSL_BIT_PACK_FLOATS
  175|  11.6k|  }
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_111EiselLemireIdEEbRKNS0_16strings_internal11ParsedFloatEbPT_PNSt3__14errcE:
  687|  7.29k|                 FloatType* absl_nonnull value, std::errc* absl_nonnull ec) {
  688|  7.29k|  uint64_t man = input.mantissa;
  689|  7.29k|  int exp10 = input.exponent;
  690|  7.29k|  if (exp10 < FloatTraits<FloatType>::kEiselLemireMinInclusiveExp10) {
  ------------------
  |  Branch (690:7): [True: 219, False: 7.07k]
  ------------------
  691|    219|    *value = negative ? -0.0f : 0.0f;
  ------------------
  |  Branch (691:14): [True: 0, False: 219]
  ------------------
  692|    219|    *ec = std::errc::result_out_of_range;
  693|    219|    return true;
  694|  7.07k|  } else if (exp10 >= FloatTraits<FloatType>::kEiselLemireMaxExclusiveExp10) {
  ------------------
  |  Branch (694:14): [True: 551, False: 6.52k]
  ------------------
  695|       |    // Return max (a finite value) consistent with from_chars and DR 3081. For
  696|       |    // SimpleAtod and SimpleAtof, post-processing will return infinity.
  697|    551|    *value = negative ? -std::numeric_limits<FloatType>::max()
  ------------------
  |  Branch (697:14): [True: 198, False: 353]
  ------------------
  698|    551|                      : std::numeric_limits<FloatType>::max();
  699|    551|    *ec = std::errc::result_out_of_range;
  700|    551|    return true;
  701|    551|  }
  702|       |
  703|       |  // Assert kPower10TableMinInclusive <= exp10 < kPower10TableMaxExclusive.
  704|       |  // Equivalently, !Power10Underflow(exp10) and !Power10Overflow(exp10).
  705|  6.52k|  static_assert(
  706|  6.52k|      FloatTraits<FloatType>::kEiselLemireMinInclusiveExp10 >=
  707|  6.52k|          kPower10TableMinInclusive,
  708|  6.52k|      "(exp10-kPower10TableMinInclusive) in kPower10MantissaHighTable bounds");
  709|  6.52k|  static_assert(
  710|  6.52k|      FloatTraits<FloatType>::kEiselLemireMaxExclusiveExp10 <=
  711|  6.52k|          kPower10TableMaxExclusive,
  712|  6.52k|      "(exp10-kPower10TableMinInclusive) in kPower10MantissaHighTable bounds");
  713|       |
  714|       |  // The terse (+) comments in this function body refer to sections of the
  715|       |  // https://nigeltao.github.io/blog/2020/eisel-lemire.html blog post.
  716|       |  //
  717|       |  // That blog post discusses double precision (11 exponent bits with a -1023
  718|       |  // bias, 52 mantissa bits), but the same approach applies to single precision
  719|       |  // (8 exponent bits with a -127 bias, 23 mantissa bits). Either way, the
  720|       |  // computation here happens with 64-bit values (e.g. man) or 128-bit values
  721|       |  // (e.g. x) before finally converting to 64- or 32-bit floating point.
  722|       |  //
  723|       |  // See also "Number Parsing at a Gigabyte per Second, Software: Practice and
  724|       |  // Experience 51 (8), 2021" (https://arxiv.org/abs/2101.11408) for detail.
  725|       |
  726|       |  // (+) Normalization.
  727|  6.52k|  int clz = countl_zero(man);
  728|  6.52k|  man <<= static_cast<unsigned int>(clz);
  729|       |  // The 217706 etc magic numbers are from the Power10Exponent function.
  730|  6.52k|  uint64_t ret_exp2 =
  731|  6.52k|      static_cast<uint64_t>((217706 * exp10 >> 16) + 64 +
  732|  6.52k|                            FloatTraits<FloatType>::kExponentBias - clz);
  733|       |
  734|       |  // (+) Multiplication.
  735|  6.52k|  uint128 x = static_cast<uint128>(man) *
  736|  6.52k|              static_cast<uint128>(
  737|  6.52k|                  kPower10MantissaHighTable[exp10 - kPower10TableMinInclusive]);
  738|       |
  739|       |  // (+) Wider Approximation.
  740|  6.52k|  static constexpr uint64_t high64_mask =
  741|  6.52k|      FloatTraits<FloatType>::kEiselLemireMask;
  742|  6.52k|  if (((Uint128High64(x) & high64_mask) == high64_mask) &&
  ------------------
  |  Branch (742:7): [True: 2.00k, False: 4.52k]
  ------------------
  743|  2.00k|      (man > (std::numeric_limits<uint64_t>::max() - Uint128Low64(x)))) {
  ------------------
  |  Branch (743:7): [True: 1.57k, False: 428]
  ------------------
  744|  1.57k|    uint128 y =
  745|  1.57k|        static_cast<uint128>(man) *
  746|  1.57k|        static_cast<uint128>(
  747|  1.57k|            kPower10MantissaLowTable[exp10 - kPower10TableMinInclusive]);
  748|  1.57k|    x += Uint128High64(y);
  749|       |    // For example, parsing "4503599627370497.5" will take the if-true
  750|       |    // branch here (for double precision), since:
  751|       |    //  - x   = 0x8000000000000BFF_FFFFFFFFFFFFFFFF
  752|       |    //  - y   = 0x8000000000000BFF_7FFFFFFFFFFFF400
  753|       |    //  - man = 0xA000000000000F00
  754|       |    // Likewise, when parsing "0.0625" for single precision:
  755|       |    //  - x   = 0x7FFFFFFFFFFFFFFF_FFFFFFFFFFFFFFFF
  756|       |    //  - y   = 0x813FFFFFFFFFFFFF_8A00000000000000
  757|       |    //  - man = 0x9C40000000000000
  758|  1.57k|    if (((Uint128High64(x) & high64_mask) == high64_mask) &&
  ------------------
  |  Branch (758:9): [True: 1.25k, False: 319]
  ------------------
  759|  1.25k|        ((Uint128Low64(x) + 1) == 0) &&
  ------------------
  |  Branch (759:9): [True: 860, False: 396]
  ------------------
  760|    860|        (man > (std::numeric_limits<uint64_t>::max() - Uint128Low64(y)))) {
  ------------------
  |  Branch (760:9): [True: 860, False: 0]
  ------------------
  761|    860|      return false;
  762|    860|    }
  763|  1.57k|  }
  764|       |
  765|       |  // (+) Shifting to 54 Bits (or for single precision, to 25 bits).
  766|  5.66k|  uint64_t msb = Uint128High64(x) >> 63;
  767|  5.66k|  uint64_t ret_man =
  768|  5.66k|      Uint128High64(x) >> (msb + FloatTraits<FloatType>::kEiselLemireShift);
  769|  5.66k|  ret_exp2 -= 1 ^ msb;
  770|       |
  771|       |  // (+) Half-way Ambiguity.
  772|       |  //
  773|       |  // For example, parsing "1e+23" will take the if-true branch here (for double
  774|       |  // precision), since:
  775|       |  //  - x       = 0x54B40B1F852BDA00_0000000000000000
  776|       |  //  - ret_man = 0x002A5A058FC295ED
  777|       |  // Likewise, when parsing "20040229.0" for single precision:
  778|       |  //  - x       = 0x4C72894000000000_0000000000000000
  779|       |  //  - ret_man = 0x000000000131CA25
  780|  5.66k|  if ((Uint128Low64(x) == 0) && ((Uint128High64(x) & high64_mask) == 0) &&
  ------------------
  |  Branch (780:7): [True: 3.58k, False: 2.08k]
  |  Branch (780:33): [True: 2.28k, False: 1.29k]
  ------------------
  781|  2.28k|      ((ret_man & 3) == 1)) {
  ------------------
  |  Branch (781:7): [True: 542, False: 1.74k]
  ------------------
  782|    542|    return false;
  783|    542|  }
  784|       |
  785|       |  // (+) From 54 to 53 Bits (or for single precision, from 25 to 24 bits).
  786|  5.12k|  ret_man += ret_man & 1;  // Line From54a.
  787|  5.12k|  ret_man >>= 1;           // Line From54b.
  788|       |  // Incrementing ret_man (at line From54a) may have overflowed 54 bits (53
  789|       |  // bits after the right shift by 1 at line From54b), so adjust for that.
  790|       |  //
  791|       |  // For example, parsing "9223372036854775807" will take the if-true branch
  792|       |  // here (for double precision), since:
  793|       |  //  - ret_man = 0x0020000000000000 = (1 << 53)
  794|       |  // Likewise, when parsing "2147483647.0" for single precision:
  795|       |  //  - ret_man = 0x0000000001000000 = (1 << 24)
  796|  5.12k|  if ((ret_man >> FloatTraits<FloatType>::kTargetMantissaBits) > 0) {
  ------------------
  |  Branch (796:7): [True: 202, False: 4.92k]
  ------------------
  797|    202|    ret_exp2 += 1;
  798|       |    // Conceptually, we need a "ret_man >>= 1" in this if-block to balance
  799|       |    // incrementing ret_exp2 in the line immediately above. However, we only
  800|       |    // get here when line From54a overflowed (after adding a 1), so ret_man
  801|       |    // here is (1 << 53). Its low 53 bits are therefore all zeroes. The only
  802|       |    // remaining use of ret_man is to mask it with ((1 << 52) - 1), so only its
  803|       |    // low 52 bits matter. A "ret_man >>= 1" would have no effect in practice.
  804|       |    //
  805|       |    // We omit the "ret_man >>= 1", even if it is cheap (and this if-branch is
  806|       |    // rarely taken) and technically 'more correct', so that mutation tests
  807|       |    // that would otherwise modify or omit that "ret_man >>= 1" don't complain
  808|       |    // that such code mutations have no observable effect.
  809|    202|  }
  810|       |
  811|       |  // ret_exp2 is a uint64_t. Zero or underflow means that we're in subnormal
  812|       |  // space. max_exp2 (0x7FF for double precision, 0xFF for single precision) or
  813|       |  // above means that we're in Inf/NaN space.
  814|       |  //
  815|       |  // The if block is equivalent to (but has fewer branches than):
  816|       |  //   if ((ret_exp2 <= 0) || (ret_exp2 >= max_exp2)) { etc }
  817|       |  //
  818|       |  // For example, parsing "4.9406564584124654e-324" will take the if-true
  819|       |  // branch here, since ret_exp2 = -51.
  820|  5.12k|  static constexpr uint64_t max_exp2 =
  821|  5.12k|      (1 << FloatTraits<FloatType>::kTargetExponentBits) - 1;
  822|  5.12k|  if ((ret_exp2 - 1) >= (max_exp2 - 1)) {
  ------------------
  |  Branch (822:7): [True: 1.89k, False: 3.23k]
  ------------------
  823|  1.89k|    return false;
  824|  1.89k|  }
  825|       |
  826|       |#ifndef ABSL_BIT_PACK_FLOATS
  827|       |  if (FloatTraits<FloatType>::kTargetBits == 64) {
  828|       |    *value = FloatTraits<FloatType>::Make(
  829|       |        (ret_man & 0x000FFFFFFFFFFFFFu) | 0x0010000000000000u,
  830|       |        static_cast<int>(ret_exp2) - 1023 - 52, negative);
  831|       |    return true;
  832|       |  } else if (FloatTraits<FloatType>::kTargetBits == 32) {
  833|       |    *value = FloatTraits<FloatType>::Make(
  834|       |        (static_cast<uint32_t>(ret_man) & 0x007FFFFFu) | 0x00800000u,
  835|       |        static_cast<int>(ret_exp2) - 127 - 23, negative);
  836|       |    return true;
  837|       |  }
  838|       |#else
  839|  3.23k|  if (FloatTraits<FloatType>::kTargetBits == 64) {
  ------------------
  |  Branch (839:7): [True: 3.23k, Folded]
  ------------------
  840|  3.23k|    uint64_t ret_bits = (ret_exp2 << 52) | (ret_man & 0x000FFFFFFFFFFFFFu);
  841|  3.23k|    if (negative) {
  ------------------
  |  Branch (841:9): [True: 414, False: 2.81k]
  ------------------
  842|    414|      ret_bits |= 0x8000000000000000u;
  843|    414|    }
  844|  3.23k|    *value = static_cast<FloatType>(absl::bit_cast<double>(ret_bits));
  845|  3.23k|    return true;
  846|  3.23k|  } else if (FloatTraits<FloatType>::kTargetBits == 32) {
  ------------------
  |  Branch (846:14): [Folded, False: 0]
  ------------------
  847|      0|    uint32_t ret_bits = (static_cast<uint32_t>(ret_exp2) << 23) |
  848|      0|                        (static_cast<uint32_t>(ret_man) & 0x007FFFFFu);
  849|      0|    if (negative) {
  ------------------
  |  Branch (849:9): [True: 0, False: 0]
  ------------------
  850|      0|      ret_bits |= 0x80000000u;
  851|      0|    }
  852|      0|    *value = static_cast<FloatType>(absl::bit_cast<float>(ret_bits));
  853|      0|    return true;
  854|      0|  }
  855|      0|#endif  // ABSL_BIT_PACK_FLOATS
  856|      0|  return false;
  857|  3.23k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_126CalculateFromParsedDecimalIdEENS1_15CalculatedFloatERKNS0_16strings_internal11ParsedFloatE:
  617|  11.1k|    const strings_internal::ParsedFloat& parsed_decimal) {
  618|  11.1k|  CalculatedFloat result;
  619|       |
  620|       |  // Large or small enough decimal exponents will always result in overflow
  621|       |  // or underflow.
  622|  11.1k|  if (Power10Underflow(parsed_decimal.exponent)) {
  ------------------
  |  Branch (622:7): [True: 214, False: 10.9k]
  ------------------
  623|    214|    result.exponent = kUnderflow;
  624|    214|    return result;
  625|  10.9k|  } else if (Power10Overflow(parsed_decimal.exponent)) {
  ------------------
  |  Branch (625:14): [True: 212, False: 10.7k]
  ------------------
  626|    212|    result.exponent = kOverflow;
  627|    212|    return result;
  628|    212|  }
  629|       |
  630|       |  // Otherwise convert our power of 10 into a power of 2 times an integer
  631|       |  // mantissa, and multiply this by our parsed decimal mantissa.
  632|  10.7k|  uint128 wide_binary_mantissa = parsed_decimal.mantissa;
  633|  10.7k|  wide_binary_mantissa *= Power10Mantissa(parsed_decimal.exponent);
  634|  10.7k|  int binary_exponent = Power10Exponent(parsed_decimal.exponent);
  635|       |
  636|       |  // Discard bits that are inaccurate due to truncation error.  The magic
  637|       |  // `mantissa_width` constants below are justified in
  638|       |  // https://abseil.io/about/design/charconv. They represent the number of bits
  639|       |  // in `wide_binary_mantissa` that are guaranteed to be unaffected by error
  640|       |  // propagation.
  641|  10.7k|  bool mantissa_exact;
  642|  10.7k|  int mantissa_width;
  643|  10.7k|  if (parsed_decimal.subrange_begin) {
  ------------------
  |  Branch (643:7): [True: 7.42k, False: 3.29k]
  ------------------
  644|       |    // Truncated mantissa
  645|  7.42k|    mantissa_width = 58;
  646|  7.42k|    mantissa_exact = false;
  647|  7.42k|    binary_exponent +=
  648|  7.42k|        TruncateToBitWidth(mantissa_width, &wide_binary_mantissa);
  649|  7.42k|  } else if (!Power10Exact(parsed_decimal.exponent)) {
  ------------------
  |  Branch (649:14): [True: 2.75k, False: 542]
  ------------------
  650|       |    // Exact mantissa, truncated power of ten
  651|  2.75k|    mantissa_width = 63;
  652|  2.75k|    mantissa_exact = false;
  653|  2.75k|    binary_exponent +=
  654|  2.75k|        TruncateToBitWidth(mantissa_width, &wide_binary_mantissa);
  655|  2.75k|  } else {
  656|       |    // Product is exact
  657|    542|    mantissa_width = BitWidth(wide_binary_mantissa);
  658|    542|    mantissa_exact = true;
  659|    542|  }
  660|       |
  661|       |  // Shift into an FloatType-sized mantissa, and round to nearest.
  662|  10.7k|  const int shift =
  663|  10.7k|      NormalizedShiftSize<FloatType>(mantissa_width, binary_exponent);
  664|  10.7k|  bool result_exact;
  665|  10.7k|  binary_exponent += shift;
  666|  10.7k|  uint64_t binary_mantissa = ShiftRightAndRound(wide_binary_mantissa, shift,
  667|  10.7k|                                                mantissa_exact, &result_exact);
  668|  10.7k|  if (!result_exact) {
  ------------------
  |  Branch (668:7): [True: 7.99k, False: 2.72k]
  ------------------
  669|       |    // We could not determine the rounding direction using int128 math.  Use
  670|       |    // full resolution math instead.
  671|  7.99k|    if (MustRoundUp(binary_mantissa, binary_exponent, parsed_decimal)) {
  ------------------
  |  Branch (671:9): [True: 2.27k, False: 5.71k]
  ------------------
  672|  2.27k|      binary_mantissa += 1;
  673|  2.27k|    }
  674|  7.99k|  }
  675|       |
  676|  10.7k|  return CalculatedFloatFromRawValues<FloatType>(binary_mantissa,
  677|  10.7k|                                                 binary_exponent);
  678|  11.1k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_116Power10UnderflowEi:
  288|  11.1k|bool Power10Underflow(int n) { return n < kPower10TableMinInclusive; }
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_115Power10OverflowEi:
  284|  10.9k|bool Power10Overflow(int n) { return n >= kPower10TableMaxExclusive; }
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_115Power10MantissaEi:
  270|  10.7k|uint64_t Power10Mantissa(int n) {
  271|  10.7k|  return kPower10MantissaHighTable[n - kPower10TableMinInclusive];
  272|  10.7k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_115Power10ExponentEi:
  274|  10.7k|int Power10Exponent(int n) {
  275|       |  // The 217706 etc magic numbers encode the results as a formula instead of a
  276|       |  // table. Their equivalence (over the kPower10TableMinInclusive ..
  277|       |  // kPower10TableMaxExclusive range) is confirmed by
  278|       |  // https://github.com/google/wuffs/blob/315b2e52625ebd7b02d8fac13e3cd85ea374fb80/script/print-mpb-powers-of-10.go
  279|  10.7k|  return (217706 * n >> 16) - 63;
  280|  10.7k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_118TruncateToBitWidthEiPNS0_7uint128E:
  348|  10.1k|int TruncateToBitWidth(int bit_width, uint128* absl_nonnull value) {
  349|  10.1k|  const int current_bit_width = BitWidth(*value);
  350|  10.1k|  const int shift = current_bit_width - bit_width;
  351|  10.1k|  *value >>= shift;
  352|  10.1k|  return shift;
  353|  10.1k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_112Power10ExactEi:
  293|  3.29k|bool Power10Exact(int n) { return n >= 0 && n <= 27; }
  ------------------
  |  Branch (293:35): [True: 1.87k, False: 1.42k]
  |  Branch (293:45): [True: 542, False: 1.32k]
  ------------------
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_18BitWidthENS0_7uint128E:
  317|  10.7k|int BitWidth(uint128 value) {
  318|  10.7k|  if (Uint128High64(value) == 0) {
  ------------------
  |  Branch (318:7): [True: 707, False: 10.0k]
  ------------------
  319|       |    // This static_cast is only needed when using a std::bit_width()
  320|       |    // implementation that does not have the fix for LWG 3656 applied.
  321|    707|    return static_cast<int>(bit_width(Uint128Low64(value)));
  322|    707|  }
  323|  10.0k|  return 128 - countl_zero(Uint128High64(value));
  324|  10.7k|}
charconv.cc:_ZN4absl12lts_2026052612_GLOBAL__N_111MustRoundUpEmiRKNS0_16strings_internal11ParsedFloatE:
  510|  7.99k|                 const strings_internal::ParsedFloat& parsed_decimal) {
  511|       |  // 768 is the number of digits needed in the worst case.  We could determine a
  512|       |  // better limit dynamically based on the value of parsed_decimal.exponent.
  513|       |  // This would optimize pathological input cases only.  (Sane inputs won't have
  514|       |  // hundreds of digits of mantissa.)
  515|  7.99k|  absl::strings_internal::BigUnsigned<84> exact_mantissa;
  516|  7.99k|  int exact_exponent = exact_mantissa.ReadFloatMantissa(parsed_decimal, 768);
  517|       |
  518|       |  // Adjust the `guess` arguments to be halfway between A and B.
  519|  7.99k|  guess_mantissa = guess_mantissa * 2 + 1;
  520|  7.99k|  guess_exponent -= 1;
  521|       |
  522|       |  // In our comparison:
  523|       |  // lhs = exact = exact_mantissa * 10**exact_exponent
  524|       |  //             = exact_mantissa * 5**exact_exponent * 2**exact_exponent
  525|       |  // rhs = guess = guess_mantissa * 2**guess_exponent
  526|       |  //
  527|       |  // Because we are doing integer math, we can't directly deal with negative
  528|       |  // exponents.  We instead move these to the other side of the inequality.
  529|  7.99k|  absl::strings_internal::BigUnsigned<84>& lhs = exact_mantissa;
  530|  7.99k|  int comparison;
  531|  7.99k|  if (exact_exponent >= 0) {
  ------------------
  |  Branch (531:7): [True: 2.61k, False: 5.38k]
  ------------------
  532|  2.61k|    lhs.MultiplyByFiveToTheNth(exact_exponent);
  533|  2.61k|    absl::strings_internal::BigUnsigned<84> rhs(guess_mantissa);
  534|       |    // There are powers of 2 on both sides of the inequality; reduce this to
  535|       |    // a single bit-shift.
  536|  2.61k|    if (exact_exponent > guess_exponent) {
  ------------------
  |  Branch (536:9): [True: 0, False: 2.61k]
  ------------------
  537|      0|      lhs.ShiftLeft(exact_exponent - guess_exponent);
  538|  2.61k|    } else {
  539|  2.61k|      rhs.ShiftLeft(guess_exponent - exact_exponent);
  540|  2.61k|    }
  541|  2.61k|    comparison = Compare(lhs, rhs);
  542|  5.38k|  } else {
  543|       |    // Move the power of 5 to the other side of the equation, giving us:
  544|       |    // lhs = exact_mantissa * 2**exact_exponent
  545|       |    // rhs = guess_mantissa * 5**(-exact_exponent) * 2**guess_exponent
  546|  5.38k|    absl::strings_internal::BigUnsigned<84> rhs =
  547|  5.38k|        absl::strings_internal::BigUnsigned<84>::FiveToTheNth(-exact_exponent);
  548|  5.38k|    rhs.MultiplyBy(guess_mantissa);
  549|  5.38k|    if (exact_exponent > guess_exponent) {
  ------------------
  |  Branch (549:9): [True: 1.11k, False: 4.26k]
  ------------------
  550|  1.11k|      lhs.ShiftLeft(exact_exponent - guess_exponent);
  551|  4.26k|    } else {
  552|  4.26k|      rhs.ShiftLeft(guess_exponent - exact_exponent);
  553|  4.26k|    }
  554|  5.38k|    comparison = Compare(lhs, rhs);
  555|  5.38k|  }
  556|  7.99k|  if (comparison < 0) {
  ------------------
  |  Branch (556:7): [True: 5.09k, False: 2.89k]
  ------------------
  557|  5.09k|    return false;
  558|  5.09k|  } else if (comparison > 0) {
  ------------------
  |  Branch (558:14): [True: 2.22k, False: 674]
  ------------------
  559|  2.22k|    return true;
  560|  2.22k|  } else {
  561|       |    // When lhs == rhs, the decimal input is exactly between A and B.
  562|       |    // Round towards even -- round up only if the low bit of the initial
  563|       |    // `guess_mantissa` was a 1.  We shifted guess_mantissa left 1 bit at
  564|       |    // the beginning of this function, so test the 2nd bit here.
  565|    674|    return (guess_mantissa & 2) == 2;
  566|    674|  }
  567|  7.99k|}

_ZN4absl12lts_20260526anENS0_12chars_formatES1_:
   92|   110k|inline constexpr chars_format operator&(chars_format lhs, chars_format rhs) {
   93|   110k|  return static_cast<chars_format>(static_cast<int>(lhs) &
   94|   110k|                                   static_cast<int>(rhs));
   95|   110k|}

_ZN4absl12lts_2026052619WebSafeBase64EscapeENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1123|      2|std::string WebSafeBase64Escape(absl::string_view src) {
 1124|      2|  return Base64EscapeToStringInternal(
 1125|      2|      reinterpret_cast<const unsigned char*>(src.data()), src.size(), false,
 1126|      2|      kWebSafeBase64Chars);
 1127|      2|}
escaping.cc:_ZN4absl12lts_2026052612_GLOBAL__N_128Base64EscapeToStringInternalEPKhmbPKc:
  615|      2|                                         const char* base64_chars) {
  616|      2|  std::string escaped;
  617|      2|  const size_t calc_escaped_size =
  618|      2|      strings_internal::CalculateBase64EscapedLenInternal(szsrc, do_padding);
  619|      2|  StringResizeAndOverwrite(
  620|      2|      escaped, calc_escaped_size,
  621|      2|      [src, szsrc, base64_chars, do_padding](char* buf, size_t buf_size) {
  622|      2|        const size_t escaped_len = Base64EscapeInternal(
  623|      2|            src, szsrc, buf, buf_size, base64_chars, do_padding);
  624|      2|        assert(escaped_len == buf_size);
  625|      2|        return escaped_len;
  626|      2|      });
  627|      2|  return escaped;
  628|      2|}
escaping.cc:_ZZN4absl12lts_2026052612_GLOBAL__N_128Base64EscapeToStringInternalEPKhmbPKcENK3$_0clEPcm:
  621|      2|      [src, szsrc, base64_chars, do_padding](char* buf, size_t buf_size) {
  622|      2|        const size_t escaped_len = Base64EscapeInternal(
  623|      2|            src, szsrc, buf, buf_size, base64_chars, do_padding);
  624|       |        assert(escaped_len == buf_size);
  625|      2|        return escaped_len;
  626|      2|      });
escaping.cc:_ZN4absl12lts_2026052612_GLOBAL__N_120Base64EscapeInternalEPKhmPcmPKcb:
  498|      2|                            bool do_padding) {
  499|      2|  constexpr char kPad64 = '=';
  500|       |
  501|      2|  constexpr size_t kMaxSize = (std::numeric_limits<size_t>::max() - 1) / 4 * 3;
  502|      2|  if (ABSL_PREDICT_FALSE(szsrc > kMaxSize || szsrc * 4 > szdest * 3)) return 0;
  ------------------
  |  |  190|      4|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  Branch (190:59): [True: 0, False: 2]
  |  |  |  Branch (190:59): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  503|       |
  504|      2|  char* cur_dest = dest;
  505|      2|  const unsigned char* cur_src = src;
  506|       |
  507|      2|  char* const limit_dest = dest + szdest;
  508|      2|  const unsigned char* const limit_src = src + szsrc;
  509|       |
  510|       |  // (from https://tools.ietf.org/html/rfc3548)
  511|       |  // Special processing is performed if fewer than 24 bits are available
  512|       |  // at the end of the data being encoded.  A full encoding quantum is
  513|       |  // always completed at the end of a quantity.  When fewer than 24 input
  514|       |  // bits are available in an input group, zero bits are added (on the
  515|       |  // right) to form an integral number of 6-bit groups.
  516|       |  //
  517|       |  // If do_padding is true, padding at the end of the data is performed. This
  518|       |  // output padding uses the '=' character.
  519|       |
  520|       |  // Three bytes of data encodes to four characters of cyphertext.
  521|       |  // So we can pump through three-byte chunks atomically.
  522|      2|  if (szsrc >= 3) {                    // "limit_src - 3" is UB if szsrc < 3.
  ------------------
  |  Branch (522:7): [True: 2, False: 0]
  ------------------
  523|     22|    while (cur_src < limit_src - 3) {  // While we have >= 32 bits.
  ------------------
  |  Branch (523:12): [True: 20, False: 2]
  ------------------
  524|     20|      uint32_t in = absl::big_endian::Load32(cur_src) >> 8;
  525|       |
  526|     20|      cur_dest[0] = base64[in >> 18];
  527|     20|      in &= 0x3FFFF;
  528|     20|      cur_dest[1] = base64[in >> 12];
  529|     20|      in &= 0xFFF;
  530|     20|      cur_dest[2] = base64[in >> 6];
  531|     20|      in &= 0x3F;
  532|     20|      cur_dest[3] = base64[in];
  533|       |
  534|     20|      cur_dest += 4;
  535|     20|      cur_src += 3;
  536|     20|    }
  537|      2|  }
  538|       |  // To save time, we didn't update szdest or szsrc in the loop.  So do it now.
  539|      2|  szdest = static_cast<size_t>(limit_dest - cur_dest);
  540|      2|  szsrc = static_cast<size_t>(limit_src - cur_src);
  541|       |
  542|       |  /* now deal with the tail (<=3 bytes) */
  543|      2|  switch (szsrc) {
  544|      0|    case 0:
  ------------------
  |  Branch (544:5): [True: 0, False: 2]
  ------------------
  545|       |      // Nothing left; nothing more to do.
  546|      0|      break;
  547|      0|    case 1: {
  ------------------
  |  Branch (547:5): [True: 0, False: 2]
  ------------------
  548|       |      // One byte left: this encodes to two characters, and (optionally)
  549|       |      // two pad characters to round out the four-character cypherblock.
  550|      0|      if (szdest < 2) return 0;
  ------------------
  |  Branch (550:11): [True: 0, False: 0]
  ------------------
  551|      0|      uint32_t in = cur_src[0];
  552|      0|      cur_dest[0] = base64[in >> 2];
  553|      0|      in &= 0x3;
  554|      0|      cur_dest[1] = base64[in << 4];
  555|      0|      cur_dest += 2;
  556|      0|      szdest -= 2;
  557|      0|      if (do_padding) {
  ------------------
  |  Branch (557:11): [True: 0, False: 0]
  ------------------
  558|      0|        if (szdest < 2) return 0;
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|        cur_dest[0] = kPad64;
  560|      0|        cur_dest[1] = kPad64;
  561|      0|        cur_dest += 2;
  562|      0|        szdest -= 2;
  563|      0|      }
  564|      0|      break;
  565|      0|    }
  566|      2|    case 2: {
  ------------------
  |  Branch (566:5): [True: 2, False: 0]
  ------------------
  567|       |      // Two bytes left: this encodes to three characters, and (optionally)
  568|       |      // one pad character to round out the four-character cypherblock.
  569|      2|      if (szdest < 3) return 0;
  ------------------
  |  Branch (569:11): [True: 0, False: 2]
  ------------------
  570|      2|      uint32_t in = absl::big_endian::Load16(cur_src);
  571|      2|      cur_dest[0] = base64[in >> 10];
  572|      2|      in &= 0x3FF;
  573|      2|      cur_dest[1] = base64[in >> 4];
  574|      2|      in &= 0x00F;
  575|      2|      cur_dest[2] = base64[in << 2];
  576|      2|      cur_dest += 3;
  577|      2|      szdest -= 3;
  578|      2|      if (do_padding) {
  ------------------
  |  Branch (578:11): [True: 0, False: 2]
  ------------------
  579|      0|        if (szdest < 1) return 0;
  ------------------
  |  Branch (579:13): [True: 0, False: 0]
  ------------------
  580|      0|        cur_dest[0] = kPad64;
  581|      0|        cur_dest += 1;
  582|      0|        szdest -= 1;
  583|      0|      }
  584|      2|      break;
  585|      2|    }
  586|      2|    case 3: {
  ------------------
  |  Branch (586:5): [True: 0, False: 2]
  ------------------
  587|       |      // Three bytes left: same as in the big loop above.  We can't do this in
  588|       |      // the loop because the loop above always reads 4 bytes, and the fourth
  589|       |      // byte is past the end of the input.
  590|      0|      if (szdest < 4) return 0;
  ------------------
  |  Branch (590:11): [True: 0, False: 0]
  ------------------
  591|      0|      uint32_t in =
  592|      0|          (uint32_t{cur_src[0]} << 16) + absl::big_endian::Load16(cur_src + 1);
  593|      0|      cur_dest[0] = base64[in >> 18];
  594|      0|      in &= 0x3FFFF;
  595|      0|      cur_dest[1] = base64[in >> 12];
  596|      0|      in &= 0xFFF;
  597|      0|      cur_dest[2] = base64[in >> 6];
  598|      0|      in &= 0x3F;
  599|      0|      cur_dest[3] = base64[in];
  600|      0|      cur_dest += 4;
  601|      0|      szdest -= 4;
  602|      0|      break;
  603|      0|    }
  604|      0|    default:
  ------------------
  |  Branch (604:5): [True: 0, False: 2]
  ------------------
  605|       |      // Should not be reached: blocks of 4 bytes are handled
  606|       |      // in the while loop before this switch statement.
  607|      0|      ABSL_RAW_LOG(FATAL, "Logic problem? szsrc = %zu", szsrc);
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  608|      0|      break;
  609|      2|  }
  610|      2|  return static_cast<size_t>(cur_dest - dest);
  611|      2|}

_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE17ReadFloatMantissaERKNS1_11ParsedFloatEi:
  172|  7.99k|                                              int significant_digits) {
  173|  7.99k|  SetToZero();
  174|  7.99k|  assert(fp.type == FloatType::kNumber);
  175|       |
  176|  7.99k|  if (fp.subrange_begin == nullptr) {
  ------------------
  |  Branch (176:7): [True: 1.24k, False: 6.74k]
  ------------------
  177|       |    // We already exactly parsed the mantissa, so no more work is necessary.
  178|  1.24k|    words_[0] = fp.mantissa & 0xffffffffu;
  179|  1.24k|    words_[1] = fp.mantissa >> 32;
  180|  1.24k|    if (words_[1]) {
  ------------------
  |  Branch (180:9): [True: 318, False: 931]
  ------------------
  181|    318|      size_ = 2;
  182|    931|    } else if (words_[0]) {
  ------------------
  |  Branch (182:16): [True: 931, False: 0]
  ------------------
  183|    931|      size_ = 1;
  184|    931|    }
  185|  1.24k|    return fp.exponent;
  186|  1.24k|  }
  187|  6.74k|  int exponent_adjust =
  188|  6.74k|      ReadDigits(fp.subrange_begin, fp.subrange_end, significant_digits);
  189|  6.74k|  return fp.literal_exponent + exponent_adjust;
  190|  7.99k|}
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE12FiveToTheNthEi:
  289|  5.38k|    int n) {
  290|  5.38k|  BigUnsigned answer(1u);
  291|       |
  292|       |  // Seed from the table of large powers, if possible.
  293|  5.38k|  bool first_pass = true;
  294|  11.2k|  while (n >= kLargePowerOfFiveStep) {
  ------------------
  |  Branch (294:10): [True: 5.88k, False: 5.38k]
  ------------------
  295|  5.88k|    int big_power =
  296|  5.88k|        std::min(n / kLargePowerOfFiveStep, kLargestPowerOfFiveIndex);
  297|  5.88k|    if (first_pass) {
  ------------------
  |  Branch (297:9): [True: 3.19k, False: 2.69k]
  ------------------
  298|       |      // just copy, rather than multiplying by 1
  299|  3.19k|      std::copy_n(LargePowerOfFiveData(big_power),
  300|  3.19k|                  LargePowerOfFiveSize(big_power), answer.words_);
  301|  3.19k|      answer.size_ = LargePowerOfFiveSize(big_power);
  302|  3.19k|      first_pass = false;
  303|  3.19k|    } else {
  304|  2.69k|      answer.MultiplyBy(LargePowerOfFiveSize(big_power),
  305|  2.69k|                        LargePowerOfFiveData(big_power));
  306|  2.69k|    }
  307|  5.88k|    n -= kLargePowerOfFiveStep * big_power;
  308|  5.88k|  }
  309|  5.38k|  answer.MultiplyByFiveToTheNth(n);
  310|  5.38k|  return answer;
  311|  5.38k|}
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE10ReadDigitsEPKcS5_i:
  194|  6.74k|                                       int significant_digits) {
  195|  6.74k|  assert(significant_digits <= Digits10() + 1);
  196|  6.74k|  SetToZero();
  197|       |
  198|  6.74k|  bool after_decimal_point = false;
  199|       |  // Discard any leading zeroes before the decimal point
  200|  6.94k|  while (begin < end && *begin == '0') {
  ------------------
  |  Branch (200:10): [True: 6.94k, False: 0]
  |  Branch (200:25): [True: 196, False: 6.74k]
  ------------------
  201|    196|    ++begin;
  202|    196|  }
  203|  6.74k|  int dropped_digits = 0;
  204|       |  // Discard any trailing zeroes.  These may or may not be after the decimal
  205|       |  // point.
  206|  7.96k|  while (begin < end && *std::prev(end) == '0') {
  ------------------
  |  Branch (206:10): [True: 7.96k, False: 0]
  |  Branch (206:25): [True: 1.21k, False: 6.74k]
  ------------------
  207|  1.21k|    --end;
  208|  1.21k|    ++dropped_digits;
  209|  1.21k|  }
  210|  6.74k|  if (begin < end && *std::prev(end) == '.') {
  ------------------
  |  Branch (210:7): [True: 6.74k, False: 0]
  |  Branch (210:22): [True: 395, False: 6.35k]
  ------------------
  211|       |    // If the string ends in '.', either before or after dropping zeroes, then
  212|       |    // drop the decimal point and look for more digits to drop.
  213|    395|    dropped_digits = 0;
  214|    395|    --end;
  215|    589|    while (begin < end && *std::prev(end) == '0') {
  ------------------
  |  Branch (215:12): [True: 589, False: 0]
  |  Branch (215:27): [True: 194, False: 395]
  ------------------
  216|    194|      --end;
  217|    194|      ++dropped_digits;
  218|    194|    }
  219|  6.35k|  } else if (dropped_digits) {
  ------------------
  |  Branch (219:14): [True: 632, False: 5.71k]
  ------------------
  220|       |    // We dropped digits, and aren't sure if they're before or after the decimal
  221|       |    // point.  Figure that out now.
  222|    632|    const char* dp = std::find(begin, end, '.');
  223|    632|    if (dp != end) {
  ------------------
  |  Branch (223:9): [True: 427, False: 205]
  ------------------
  224|       |      // The dropped trailing digits were after the decimal point, so don't
  225|       |      // count them.
  226|    427|      dropped_digits = 0;
  227|    427|    }
  228|    632|  }
  229|       |  // Any non-fraction digits we dropped need to be accounted for in our exponent
  230|       |  // adjustment.
  231|  6.74k|  int exponent_adjust = dropped_digits;
  232|       |
  233|  6.74k|  uint32_t queued = 0;
  234|  6.74k|  int digits_queued = 0;
  235|  1.97M|  for (; begin != end && significant_digits > 0; ++begin) {
  ------------------
  |  Branch (235:10): [True: 1.96M, False: 5.73k]
  |  Branch (235:26): [True: 1.96M, False: 1.01k]
  ------------------
  236|  1.96M|    if (*begin == '.') {
  ------------------
  |  Branch (236:9): [True: 4.52k, False: 1.95M]
  ------------------
  237|  4.52k|      after_decimal_point = true;
  238|  4.52k|      continue;
  239|  4.52k|    }
  240|  1.95M|    if (after_decimal_point) {
  ------------------
  |  Branch (240:9): [True: 1.84M, False: 109k]
  ------------------
  241|       |      // For each fractional digit we emit in our parsed integer, adjust our
  242|       |      // decimal exponent to compensate.
  243|  1.84M|      --exponent_adjust;
  244|  1.84M|    }
  245|  1.95M|    char digit = (*begin - '0');
  246|  1.95M|    --significant_digits;
  247|  1.95M|    if (significant_digits == 0 && std::next(begin) != end &&
  ------------------
  |  Branch (247:9): [True: 1.33k, False: 1.95M]
  |  Branch (247:36): [True: 1.01k, False: 325]
  ------------------
  248|  1.01k|        (digit == 0 || digit == 5)) {
  ------------------
  |  Branch (248:10): [True: 308, False: 702]
  |  Branch (248:24): [True: 333, False: 369]
  ------------------
  249|       |      // If this is the very last significant digit, but insignificant digits
  250|       |      // remain, we know that the last of those remaining significant digits is
  251|       |      // nonzero.  (If it wasn't, we would have stripped it before we got here.)
  252|       |      // So if this final digit is a 0 or 5, adjust it upward by 1.
  253|       |      //
  254|       |      // This adjustment is what allows incredibly large mantissas ending in
  255|       |      // 500000...000000000001 to correctly round up, rather than to nearest.
  256|    641|      ++digit;
  257|    641|    }
  258|  1.95M|    queued = 10 * queued + static_cast<uint32_t>(digit);
  259|  1.95M|    ++digits_queued;
  260|  1.95M|    if (digits_queued == kMaxSmallPowerOfTen) {
  ------------------
  |  Branch (260:9): [True: 215k, False: 1.74M]
  ------------------
  261|   215k|      MultiplyBy(kTenToNth[kMaxSmallPowerOfTen]);
  262|   215k|      AddWithCarry(0, queued);
  263|   215k|      queued = digits_queued = 0;
  264|   215k|    }
  265|  1.95M|  }
  266|       |  // Encode any remaining digits.
  267|  6.74k|  if (digits_queued) {
  ------------------
  |  Branch (267:7): [True: 5.60k, False: 1.13k]
  ------------------
  268|  5.60k|    MultiplyBy(kTenToNth[digits_queued]);
  269|  5.60k|    AddWithCarry(0, queued);
  270|  5.60k|  }
  271|       |
  272|       |  // If any insignificant digits remain, we will drop them.  But if we have not
  273|       |  // yet read the decimal point, then we have to adjust the exponent to account
  274|       |  // for the dropped digits.
  275|  6.74k|  if (begin < end && !after_decimal_point) {
  ------------------
  |  Branch (275:7): [True: 1.01k, False: 5.73k]
  |  Branch (275:22): [True: 3, False: 1.00k]
  ------------------
  276|       |    // This call to std::find will result in a pointer either to the decimal
  277|       |    // point, or to the end of our buffer if there was none.
  278|       |    //
  279|       |    // Either way, [begin, decimal_point) will contain the set of dropped digits
  280|       |    // that require an exponent adjustment.
  281|      3|    const char* decimal_point = std::find(begin, end, '.');
  282|      3|    exponent_adjust += static_cast<int>(decimal_point - begin);
  283|      3|  }
  284|  6.74k|  return exponent_adjust;
  285|  6.74k|}
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE12MultiplyStepEiPKjii:
  316|   276k|                                          int other_size, int step) {
  317|   276k|  int this_i = std::min(original_size - 1, step);
  318|   276k|  int other_i = step - this_i;
  319|       |
  320|   276k|  uint64_t this_word = 0;
  321|   276k|  uint64_t carry = 0;
  322|  1.53M|  for (; this_i >= 0 && other_i < other_size; --this_i, ++other_i) {
  ------------------
  |  Branch (322:10): [True: 1.50M, False: 35.2k]
  |  Branch (322:25): [True: 1.26M, False: 241k]
  ------------------
  323|  1.26M|    uint64_t product = words_[this_i];
  324|  1.26M|    product *= other_words[other_i];
  325|  1.26M|    this_word += product;
  326|  1.26M|    carry += (this_word >> 32);
  327|  1.26M|    this_word &= 0xffffffff;
  328|  1.26M|  }
  329|   276k|  AddWithCarry(step + 1, carry);
  330|   276k|  words_[step] = this_word & 0xffffffff;
  331|   276k|  if (this_word > 0 && size_ <= step) {
  ------------------
  |  Branch (331:7): [True: 276k, False: 0]
  |  Branch (331:24): [True: 4.81k, False: 271k]
  ------------------
  332|  4.81k|    size_ = step + 1;
  333|  4.81k|  }
  334|   276k|}
charconv_bigint.cc:_ZN4absl12lts_2026052616strings_internal12_GLOBAL__N_120LargePowerOfFiveDataEi:
  152|  5.88k|const uint32_t* LargePowerOfFiveData(int i) {
  153|  5.88k|  return kLargePowersOfFive + i * (i - 1);
  154|  5.88k|}
charconv_bigint.cc:_ZN4absl12lts_2026052616strings_internal12_GLOBAL__N_120LargePowerOfFiveSizeEi:
  158|  9.08k|int LargePowerOfFiveSize(int i) { return 2 * i; }

_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EEC2Ev:
   62|  7.99k|  BigUnsigned() : size_(0), words_{} {}
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE22MultiplyByFiveToTheNthEi:
  174|  7.99k|  void MultiplyByFiveToTheNth(int n) {
  175|  34.0k|    while (n >= kMaxSmallPowerOfFive) {
  ------------------
  |  Branch (175:12): [True: 26.0k, False: 7.99k]
  ------------------
  176|  26.0k|      MultiplyBy(kFiveToNth[kMaxSmallPowerOfFive]);
  177|  26.0k|      n -= kMaxSmallPowerOfFive;
  178|  26.0k|    }
  179|  7.99k|    if (n > 0) {
  ------------------
  |  Branch (179:9): [True: 6.41k, False: 1.57k]
  ------------------
  180|  6.41k|      MultiplyBy(kFiveToNth[n]);
  181|  6.41k|    }
  182|  7.99k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE10MultiplyByEj:
  140|   253k|  void MultiplyBy(uint32_t v) {
  141|   253k|    if (size_ == 0 || v == 1) {
  ------------------
  |  Branch (141:9): [True: 6.75k, False: 246k]
  |  Branch (141:23): [True: 0, False: 246k]
  ------------------
  142|  6.75k|      return;
  143|  6.75k|    }
  144|   246k|    if (v == 0) {
  ------------------
  |  Branch (144:9): [True: 0, False: 246k]
  ------------------
  145|      0|      SetToZero();
  146|      0|      return;
  147|      0|    }
  148|   246k|    const uint64_t factor = v;
  149|   246k|    uint64_t window = 0;
  150|  8.22M|    for (int i = 0; i < size_; ++i) {
  ------------------
  |  Branch (150:21): [True: 7.97M, False: 246k]
  ------------------
  151|  7.97M|      window += factor * words_[i];
  152|  7.97M|      words_[i] = window & 0xffffffff;
  153|  7.97M|      window >>= 32;
  154|  7.97M|    }
  155|       |    // If carry bits remain and there's space for them, grow size_.
  156|   246k|    if (window && size_ < max_words) {
  ------------------
  |  Branch (156:9): [True: 226k, False: 20.8k]
  |  Branch (156:19): [True: 226k, False: 0]
  ------------------
  157|   226k|      words_[size_] = window & 0xffffffff;
  158|   226k|      ++size_;
  159|   226k|    }
  160|   246k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE9SetToZeroEv:
  209|  14.7k|  void SetToZero() {
  210|  14.7k|    std::fill_n(words_, size_, 0u);
  211|  14.7k|    size_ = 0;
  212|  14.7k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EEC2Em:
   64|  7.99k|      : size_((v >> 32) ? 2 : v ? 1 : 0),
  ------------------
  |  Branch (64:15): [True: 2.61k, False: 5.38k]
  |  Branch (64:31): [True: 5.38k, False: 0]
  ------------------
   65|  7.99k|        words_{static_cast<uint32_t>(v & 0xffffffffu),
   66|  7.99k|               static_cast<uint32_t>(v >> 32)} {}
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE9ShiftLeftEi:
  102|  7.99k|  void ShiftLeft(int count) {
  103|  7.99k|    if (count > 0) {
  ------------------
  |  Branch (103:9): [True: 7.68k, False: 308]
  ------------------
  104|  7.68k|      const int word_shift = count / 32;
  105|  7.68k|      if (word_shift >= max_words) {
  ------------------
  |  Branch (105:11): [True: 0, False: 7.68k]
  ------------------
  106|      0|        SetToZero();
  107|      0|        return;
  108|      0|      }
  109|  7.68k|      size_ = (std::min)(size_ + word_shift, max_words);
  110|  7.68k|      count %= 32;
  111|  7.68k|      if (count == 0) {
  ------------------
  |  Branch (111:11): [True: 855, False: 6.83k]
  ------------------
  112|       |// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=warray-bounds
  113|       |// shows a lot of bogus -Warray-bounds warnings under GCC.
  114|       |// This is not the only one in Abseil.
  115|       |#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(14, 0)
  116|       |#pragma GCC diagnostic push
  117|       |#pragma GCC diagnostic ignored "-Warray-bounds"
  118|       |#endif
  119|    855|        std::copy_backward(words_, words_ + size_ - word_shift, words_ + size_);
  120|       |#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(14, 0)
  121|       |#pragma GCC diagnostic pop
  122|       |#endif
  123|  6.83k|      } else {
  124|   147k|        for (int i = (std::min)(size_, max_words - 1); i > word_shift; --i) {
  ------------------
  |  Branch (124:56): [True: 140k, False: 6.83k]
  ------------------
  125|   140k|          words_[i] = (words_[i - word_shift] << count) |
  126|   140k|                      (words_[i - word_shift - 1] >> (32 - count));
  127|   140k|        }
  128|  6.83k|        words_[word_shift] = words_[0] << count;
  129|       |        // Grow size_ if necessary.
  130|  6.83k|        if (size_ < max_words && words_[size_]) {
  ------------------
  |  Branch (130:13): [True: 6.83k, False: 0]
  |  Branch (130:34): [True: 4.51k, False: 2.31k]
  ------------------
  131|  4.51k|          ++size_;
  132|  4.51k|        }
  133|  6.83k|      }
  134|  7.68k|      std::fill_n(words_, word_shift, 0u);
  135|  7.68k|    }
  136|  7.99k|  }
_ZN4absl12lts_2026052616strings_internal7CompareILi84ELi84EEEiRKNS1_11BigUnsignedIXT_EEERKNS3_IXT0_EEE:
  363|  7.99k|int Compare(const BigUnsigned<N>& lhs, const BigUnsigned<M>& rhs) {
  364|  7.99k|  int limit = (std::max)(lhs.size(), rhs.size());
  365|  23.7k|  for (int i = limit - 1; i >= 0; --i) {
  ------------------
  |  Branch (365:27): [True: 23.0k, False: 674]
  ------------------
  366|  23.0k|    const uint32_t lhs_word = lhs.GetWord(i);
  367|  23.0k|    const uint32_t rhs_word = rhs.GetWord(i);
  368|  23.0k|    if (lhs_word < rhs_word) {
  ------------------
  |  Branch (368:9): [True: 5.09k, False: 17.9k]
  ------------------
  369|  5.09k|      return -1;
  370|  17.9k|    } else if (lhs_word > rhs_word) {
  ------------------
  |  Branch (370:16): [True: 2.22k, False: 15.7k]
  ------------------
  371|  2.22k|      return 1;
  372|  2.22k|    }
  373|  23.0k|  }
  374|    674|  return 0;
  375|  7.99k|}
_ZNK4absl12lts_2026052616strings_internal11BigUnsignedILi84EE4sizeEv:
  227|  15.9k|  int size() const { return size_; }
_ZNK4absl12lts_2026052616strings_internal11BigUnsignedILi84EE7GetWordEi:
  216|  46.1k|  uint32_t GetWord(int index) const {
  217|  46.1k|    if (index < 0 || index >= size_) {
  ------------------
  |  Branch (217:9): [True: 0, False: 46.1k]
  |  Branch (217:22): [True: 194, False: 45.9k]
  ------------------
  218|    194|      return 0;
  219|    194|    }
  220|  45.9k|    return words_[index];
  221|  46.1k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE10MultiplyByEm:
  162|  5.38k|  void MultiplyBy(uint64_t v) {
  163|  5.38k|    uint32_t words[2];
  164|  5.38k|    words[0] = static_cast<uint32_t>(v);
  165|  5.38k|    words[1] = static_cast<uint32_t>(v >> 32);
  166|  5.38k|    if (words[1] == 0) {
  ------------------
  |  Branch (166:9): [True: 0, False: 5.38k]
  ------------------
  167|      0|      MultiplyBy(words[0]);
  168|  5.38k|    } else {
  169|  5.38k|      MultiplyBy(2, words);
  170|  5.38k|    }
  171|  5.38k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE10MultiplyByEiPKj:
  280|  8.07k|  void MultiplyBy(int other_size, const uint32_t* other_words) {
  281|  8.07k|    const int original_size = size_;
  282|  8.07k|    const int first_step =
  283|  8.07k|        (std::min)(original_size + other_size - 2, max_words - 1);
  284|   284k|    for (int step = first_step; step >= 0; --step) {
  ------------------
  |  Branch (284:33): [True: 276k, False: 8.07k]
  ------------------
  285|   276k|      MultiplyStep(original_size, other_words, other_size, step);
  286|   276k|    }
  287|  8.07k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE12AddWithCarryEij:
  290|   350k|  void AddWithCarry(int index, uint32_t value) {
  291|   350k|    if (value) {
  ------------------
  |  Branch (291:9): [True: 350k, False: 362]
  ------------------
  292|   729k|      while (index < max_words && value > 0) {
  ------------------
  |  Branch (292:14): [True: 729k, False: 0]
  |  Branch (292:35): [True: 379k, False: 350k]
  ------------------
  293|   379k|        words_[index] += value;
  294|       |        // carry if we overflowed in this word:
  295|   379k|        if (value > words_[index]) {
  ------------------
  |  Branch (295:13): [True: 29.2k, False: 350k]
  ------------------
  296|  29.2k|          value = 1;
  297|  29.2k|          ++index;
  298|   350k|        } else {
  299|   350k|          value = 0;
  300|   350k|        }
  301|   379k|      }
  302|   350k|      size_ = (std::min)(max_words, (std::max)(index + 1, size_));
  303|   350k|    }
  304|   350k|  }
_ZN4absl12lts_2026052616strings_internal11BigUnsignedILi84EE12AddWithCarryEim:
  306|   276k|  void AddWithCarry(int index, uint64_t value) {
  307|   276k|    if (value && index < max_words) {
  ------------------
  |  Branch (307:9): [True: 271k, False: 5.34k]
  |  Branch (307:18): [True: 271k, False: 0]
  ------------------
  308|   271k|      uint32_t high = value >> 32;
  309|   271k|      uint32_t low = value & 0xffffffff;
  310|   271k|      words_[index] += low;
  311|   271k|      if (words_[index] < low) {
  ------------------
  |  Branch (311:11): [True: 85.0k, False: 186k]
  ------------------
  312|  85.0k|        ++high;
  313|  85.0k|        if (high == 0) {
  ------------------
  |  Branch (313:13): [True: 0, False: 85.0k]
  ------------------
  314|       |          // Carry from the low word caused our high word to overflow.
  315|       |          // Short circuit here to do the right thing.
  316|      0|          AddWithCarry(index + 2, static_cast<uint32_t>(1));
  317|      0|          return;
  318|      0|        }
  319|  85.0k|      }
  320|   271k|      if (high > 0) {
  ------------------
  |  Branch (320:11): [True: 129k, False: 141k]
  ------------------
  321|   129k|        AddWithCarry(index + 1, high);
  322|   141k|      } else {
  323|       |        // Normally 32-bit AddWithCarry() sets size_, but since we don't call
  324|       |        // it when `high` is 0, do it ourselves here.
  325|   141k|        size_ = (std::min)(max_words, (std::max)(index + 1, size_));
  326|   141k|      }
  327|   271k|    }
  328|   276k|  }

_ZN4absl12lts_2026052616strings_internal10ParseFloatILi10EEENS1_11ParsedFloatEPKcS5_NS0_12chars_formatE:
  356|  18.0k|                                         chars_format format_flags) {
  357|  18.0k|  strings_internal::ParsedFloat result;
  358|       |
  359|       |  // Exit early if we're given an empty range.
  360|  18.0k|  if (begin == end) return result;
  ------------------
  |  Branch (360:7): [True: 9, False: 18.0k]
  ------------------
  361|       |
  362|       |  // Handle the infinity and NaN cases.
  363|  18.0k|  if (ParseInfinityOrNan(begin, end, &result)) {
  ------------------
  |  Branch (363:7): [True: 1.03k, False: 16.9k]
  ------------------
  364|  1.03k|    return result;
  365|  1.03k|  }
  366|       |
  367|  16.9k|  const char* const mantissa_begin = begin;
  368|  19.3k|  while (begin < end && *begin == '0') {
  ------------------
  |  Branch (368:10): [True: 18.5k, False: 831]
  |  Branch (368:25): [True: 2.38k, False: 16.1k]
  ------------------
  369|  2.38k|    ++begin;  // skip leading zeros
  370|  2.38k|  }
  371|  16.9k|  uint64_t mantissa = 0;
  372|       |
  373|  16.9k|  int exponent_adjustment = 0;
  374|  16.9k|  bool mantissa_is_inexact = false;
  375|  16.9k|  int pre_decimal_digits = ConsumeDigits<base>(
  376|  16.9k|      begin, end, MantissaDigitsMax<base>(), &mantissa, &mantissa_is_inexact);
  377|  16.9k|  begin += pre_decimal_digits;
  378|  16.9k|  int digits_left;
  379|  16.9k|  if (pre_decimal_digits >= DigitLimit<base>()) {
  ------------------
  |  Branch (379:7): [True: 0, False: 16.9k]
  ------------------
  380|       |    // refuse to parse pathological inputs
  381|      0|    return result;
  382|  16.9k|  } else if (pre_decimal_digits > MantissaDigitsMax<base>()) {
  ------------------
  |  Branch (382:14): [True: 4.74k, False: 12.2k]
  ------------------
  383|       |    // We dropped some non-fraction digits on the floor.  Adjust our exponent
  384|       |    // to compensate.
  385|  4.74k|    exponent_adjustment =
  386|  4.74k|        static_cast<int>(pre_decimal_digits - MantissaDigitsMax<base>());
  387|  4.74k|    digits_left = 0;
  388|  12.2k|  } else {
  389|  12.2k|    digits_left =
  390|  12.2k|        static_cast<int>(MantissaDigitsMax<base>() - pre_decimal_digits);
  391|  12.2k|  }
  392|  16.9k|  if (begin < end && *begin == '.') {
  ------------------
  |  Branch (392:7): [True: 13.8k, False: 3.14k]
  |  Branch (392:22): [True: 7.60k, False: 6.25k]
  ------------------
  393|  7.60k|    ++begin;
  394|  7.60k|    if (mantissa == 0) {
  ------------------
  |  Branch (394:9): [True: 2.86k, False: 4.74k]
  ------------------
  395|       |      // If we haven't seen any nonzero digits yet, keep skipping zeros.  We
  396|       |      // have to adjust the exponent to reflect the changed place value.
  397|  2.86k|      const char* begin_zeros = begin;
  398|  3.56k|      while (begin < end && *begin == '0') {
  ------------------
  |  Branch (398:14): [True: 3.04k, False: 513]
  |  Branch (398:29): [True: 698, False: 2.34k]
  ------------------
  399|    698|        ++begin;
  400|    698|      }
  401|  2.86k|      int zeros_skipped = static_cast<int>(begin - begin_zeros);
  402|  2.86k|      if (zeros_skipped >= DigitLimit<base>()) {
  ------------------
  |  Branch (402:11): [True: 0, False: 2.86k]
  ------------------
  403|       |        // refuse to parse pathological inputs
  404|      0|        return result;
  405|      0|      }
  406|  2.86k|      exponent_adjustment -= static_cast<int>(zeros_skipped);
  407|  2.86k|    }
  408|  7.60k|    int post_decimal_digits = ConsumeDigits<base>(
  409|  7.60k|        begin, end, digits_left, &mantissa, &mantissa_is_inexact);
  410|  7.60k|    begin += post_decimal_digits;
  411|       |
  412|       |    // Since `mantissa` is an integer, each significant digit we read after
  413|       |    // the decimal point requires an adjustment to the exponent. "1.23e0" will
  414|       |    // be stored as `mantissa` == 123 and `exponent` == -2 (that is,
  415|       |    // "123e-2").
  416|  7.60k|    if (post_decimal_digits >= DigitLimit<base>()) {
  ------------------
  |  Branch (416:9): [True: 0, False: 7.60k]
  ------------------
  417|       |      // refuse to parse pathological inputs
  418|      0|      return result;
  419|  7.60k|    } else if (post_decimal_digits > digits_left) {
  ------------------
  |  Branch (419:16): [True: 5.22k, False: 2.37k]
  ------------------
  420|  5.22k|      exponent_adjustment -= digits_left;
  421|  5.22k|    } else {
  422|  2.37k|      exponent_adjustment -= post_decimal_digits;
  423|  2.37k|    }
  424|  7.60k|  }
  425|       |  // If we've found no mantissa whatsoever, this isn't a number.
  426|  16.9k|  if (mantissa_begin == begin) {
  ------------------
  |  Branch (426:7): [True: 50, False: 16.9k]
  ------------------
  427|     50|    return result;
  428|     50|  }
  429|       |  // A bare "." doesn't count as a mantissa either.
  430|  16.9k|  if (begin - mantissa_begin == 1 && *mantissa_begin == '.') {
  ------------------
  |  Branch (430:7): [True: 4.81k, False: 12.1k]
  |  Branch (430:38): [True: 11, False: 4.80k]
  ------------------
  431|     11|    return result;
  432|     11|  }
  433|       |
  434|  16.9k|  if (mantissa_is_inexact) {
  ------------------
  |  Branch (434:7): [True: 7.85k, False: 9.08k]
  ------------------
  435|       |    // We dropped significant digits on the floor.  Handle this appropriately.
  436|  7.85k|    if (base == 10) {
  ------------------
  |  Branch (436:9): [True: 7.85k, Folded]
  ------------------
  437|       |      // If we truncated significant decimal digits, store the full range of the
  438|       |      // mantissa for future big integer math for exact rounding.
  439|  7.85k|      result.subrange_begin = mantissa_begin;
  440|  7.85k|      result.subrange_end = begin;
  441|  7.85k|    } else if (base == 16) {
  ------------------
  |  Branch (441:16): [Folded, False: 0]
  ------------------
  442|       |      // If we truncated hex digits, reflect this fact by setting the low
  443|       |      // ("sticky") bit.  This allows for correct rounding in all cases.
  444|      0|      mantissa |= 1;
  445|      0|    }
  446|  7.85k|  }
  447|  16.9k|  result.mantissa = mantissa;
  448|       |
  449|  16.9k|  const char* const exponent_begin = begin;
  450|  16.9k|  result.literal_exponent = 0;
  451|  16.9k|  bool found_exponent = false;
  452|  16.9k|  if (AllowExponent(format_flags) && begin < end &&
  ------------------
  |  Branch (452:7): [True: 16.9k, False: 0]
  |  Branch (452:38): [True: 6.61k, False: 10.3k]
  ------------------
  453|  6.61k|      IsExponentCharacter<base>(*begin)) {
  ------------------
  |  Branch (453:7): [True: 6.58k, False: 30]
  ------------------
  454|  6.58k|    bool negative_exponent = false;
  455|  6.58k|    ++begin;
  456|  6.58k|    if (begin < end && *begin == '-') {
  ------------------
  |  Branch (456:9): [True: 6.57k, False: 10]
  |  Branch (456:24): [True: 2.04k, False: 4.53k]
  ------------------
  457|  2.04k|      negative_exponent = true;
  458|  2.04k|      ++begin;
  459|  4.54k|    } else if (begin < end && *begin == '+') {
  ------------------
  |  Branch (459:16): [True: 4.53k, False: 10]
  |  Branch (459:31): [True: 491, False: 4.04k]
  ------------------
  460|    491|      ++begin;
  461|    491|    }
  462|  6.58k|    const char* const exponent_digits_begin = begin;
  463|       |    // Exponent is always expressed in decimal, even for hexadecimal floats.
  464|  6.58k|    begin += ConsumeDigits<10>(begin, end, kDecimalExponentDigitsMax,
  465|  6.58k|                               &result.literal_exponent, nullptr);
  466|  6.58k|    if (begin == exponent_digits_begin) {
  ------------------
  |  Branch (466:9): [True: 20, False: 6.56k]
  ------------------
  467|       |      // there were no digits where we expected an exponent.  We failed to read
  468|       |      // an exponent and should not consume the 'e' after all.  Rewind 'begin'.
  469|     20|      found_exponent = false;
  470|     20|      begin = exponent_begin;
  471|  6.56k|    } else {
  472|  6.56k|      found_exponent = true;
  473|  6.56k|      if (negative_exponent) {
  ------------------
  |  Branch (473:11): [True: 2.03k, False: 4.53k]
  ------------------
  474|  2.03k|        result.literal_exponent = -result.literal_exponent;
  475|  2.03k|      }
  476|  6.56k|    }
  477|  6.58k|  }
  478|       |
  479|  16.9k|  if (!found_exponent && RequireExponent(format_flags)) {
  ------------------
  |  Branch (479:7): [True: 10.3k, False: 6.56k]
  |  Branch (479:26): [True: 0, False: 10.3k]
  ------------------
  480|       |    // Provided flags required an exponent, but none was found.  This results
  481|       |    // in a failure to scan.
  482|      0|    return result;
  483|      0|  }
  484|       |
  485|       |  // Success!
  486|  16.9k|  result.type = strings_internal::FloatType::kNumber;
  487|  16.9k|  if (result.mantissa > 0) {
  ------------------
  |  Branch (487:7): [True: 15.1k, False: 1.78k]
  ------------------
  488|  15.1k|    result.exponent = result.literal_exponent +
  489|  15.1k|                      (DigitMagnitude<base>() * exponent_adjustment);
  490|  15.1k|  } else {
  491|  1.78k|    result.exponent = 0;
  492|  1.78k|  }
  493|  16.9k|  result.end = begin;
  494|  16.9k|  return result;
  495|  16.9k|}
_ZN4absl12lts_2026052616strings_internal10ParseFloatILi16EEENS1_11ParsedFloatEPKcS5_NS0_12chars_formatE:
  356|  4.74k|                                         chars_format format_flags) {
  357|  4.74k|  strings_internal::ParsedFloat result;
  358|       |
  359|       |  // Exit early if we're given an empty range.
  360|  4.74k|  if (begin == end) return result;
  ------------------
  |  Branch (360:7): [True: 13, False: 4.73k]
  ------------------
  361|       |
  362|       |  // Handle the infinity and NaN cases.
  363|  4.73k|  if (ParseInfinityOrNan(begin, end, &result)) {
  ------------------
  |  Branch (363:7): [True: 1, False: 4.73k]
  ------------------
  364|      1|    return result;
  365|      1|  }
  366|       |
  367|  4.73k|  const char* const mantissa_begin = begin;
  368|  6.12k|  while (begin < end && *begin == '0') {
  ------------------
  |  Branch (368:10): [True: 5.63k, False: 491]
  |  Branch (368:25): [True: 1.38k, False: 4.24k]
  ------------------
  369|  1.38k|    ++begin;  // skip leading zeros
  370|  1.38k|  }
  371|  4.73k|  uint64_t mantissa = 0;
  372|       |
  373|  4.73k|  int exponent_adjustment = 0;
  374|  4.73k|  bool mantissa_is_inexact = false;
  375|  4.73k|  int pre_decimal_digits = ConsumeDigits<base>(
  376|  4.73k|      begin, end, MantissaDigitsMax<base>(), &mantissa, &mantissa_is_inexact);
  377|  4.73k|  begin += pre_decimal_digits;
  378|  4.73k|  int digits_left;
  379|  4.73k|  if (pre_decimal_digits >= DigitLimit<base>()) {
  ------------------
  |  Branch (379:7): [True: 0, False: 4.73k]
  ------------------
  380|       |    // refuse to parse pathological inputs
  381|      0|    return result;
  382|  4.73k|  } else if (pre_decimal_digits > MantissaDigitsMax<base>()) {
  ------------------
  |  Branch (382:14): [True: 248, False: 4.48k]
  ------------------
  383|       |    // We dropped some non-fraction digits on the floor.  Adjust our exponent
  384|       |    // to compensate.
  385|    248|    exponent_adjustment =
  386|    248|        static_cast<int>(pre_decimal_digits - MantissaDigitsMax<base>());
  387|    248|    digits_left = 0;
  388|  4.48k|  } else {
  389|  4.48k|    digits_left =
  390|  4.48k|        static_cast<int>(MantissaDigitsMax<base>() - pre_decimal_digits);
  391|  4.48k|  }
  392|  4.73k|  if (begin < end && *begin == '.') {
  ------------------
  |  Branch (392:7): [True: 3.31k, False: 1.42k]
  |  Branch (392:22): [True: 1.60k, False: 1.70k]
  ------------------
  393|  1.60k|    ++begin;
  394|  1.60k|    if (mantissa == 0) {
  ------------------
  |  Branch (394:9): [True: 1.04k, False: 561]
  ------------------
  395|       |      // If we haven't seen any nonzero digits yet, keep skipping zeros.  We
  396|       |      // have to adjust the exponent to reflect the changed place value.
  397|  1.04k|      const char* begin_zeros = begin;
  398|  2.61k|      while (begin < end && *begin == '0') {
  ------------------
  |  Branch (398:14): [True: 1.99k, False: 618]
  |  Branch (398:29): [True: 1.56k, False: 428]
  ------------------
  399|  1.56k|        ++begin;
  400|  1.56k|      }
  401|  1.04k|      int zeros_skipped = static_cast<int>(begin - begin_zeros);
  402|  1.04k|      if (zeros_skipped >= DigitLimit<base>()) {
  ------------------
  |  Branch (402:11): [True: 0, False: 1.04k]
  ------------------
  403|       |        // refuse to parse pathological inputs
  404|      0|        return result;
  405|      0|      }
  406|  1.04k|      exponent_adjustment -= static_cast<int>(zeros_skipped);
  407|  1.04k|    }
  408|  1.60k|    int post_decimal_digits = ConsumeDigits<base>(
  409|  1.60k|        begin, end, digits_left, &mantissa, &mantissa_is_inexact);
  410|  1.60k|    begin += post_decimal_digits;
  411|       |
  412|       |    // Since `mantissa` is an integer, each significant digit we read after
  413|       |    // the decimal point requires an adjustment to the exponent. "1.23e0" will
  414|       |    // be stored as `mantissa` == 123 and `exponent` == -2 (that is,
  415|       |    // "123e-2").
  416|  1.60k|    if (post_decimal_digits >= DigitLimit<base>()) {
  ------------------
  |  Branch (416:9): [True: 0, False: 1.60k]
  ------------------
  417|       |      // refuse to parse pathological inputs
  418|      0|      return result;
  419|  1.60k|    } else if (post_decimal_digits > digits_left) {
  ------------------
  |  Branch (419:16): [True: 317, False: 1.29k]
  ------------------
  420|    317|      exponent_adjustment -= digits_left;
  421|  1.29k|    } else {
  422|  1.29k|      exponent_adjustment -= post_decimal_digits;
  423|  1.29k|    }
  424|  1.60k|  }
  425|       |  // If we've found no mantissa whatsoever, this isn't a number.
  426|  4.73k|  if (mantissa_begin == begin) {
  ------------------
  |  Branch (426:7): [True: 5, False: 4.72k]
  ------------------
  427|      5|    return result;
  428|      5|  }
  429|       |  // A bare "." doesn't count as a mantissa either.
  430|  4.72k|  if (begin - mantissa_begin == 1 && *mantissa_begin == '.') {
  ------------------
  |  Branch (430:7): [True: 2.41k, False: 2.31k]
  |  Branch (430:38): [True: 12, False: 2.40k]
  ------------------
  431|     12|    return result;
  432|     12|  }
  433|       |
  434|  4.71k|  if (mantissa_is_inexact) {
  ------------------
  |  Branch (434:7): [True: 436, False: 4.28k]
  ------------------
  435|       |    // We dropped significant digits on the floor.  Handle this appropriately.
  436|    436|    if (base == 10) {
  ------------------
  |  Branch (436:9): [Folded, False: 436]
  ------------------
  437|       |      // If we truncated significant decimal digits, store the full range of the
  438|       |      // mantissa for future big integer math for exact rounding.
  439|      0|      result.subrange_begin = mantissa_begin;
  440|      0|      result.subrange_end = begin;
  441|    436|    } else if (base == 16) {
  ------------------
  |  Branch (441:16): [True: 436, Folded]
  ------------------
  442|       |      // If we truncated hex digits, reflect this fact by setting the low
  443|       |      // ("sticky") bit.  This allows for correct rounding in all cases.
  444|    436|      mantissa |= 1;
  445|    436|    }
  446|    436|  }
  447|  4.71k|  result.mantissa = mantissa;
  448|       |
  449|  4.71k|  const char* const exponent_begin = begin;
  450|  4.71k|  result.literal_exponent = 0;
  451|  4.71k|  bool found_exponent = false;
  452|  4.71k|  if (AllowExponent(format_flags) && begin < end &&
  ------------------
  |  Branch (452:7): [True: 4.71k, False: 0]
  |  Branch (452:38): [True: 1.89k, False: 2.82k]
  ------------------
  453|  1.89k|      IsExponentCharacter<base>(*begin)) {
  ------------------
  |  Branch (453:7): [True: 1.88k, False: 4]
  ------------------
  454|  1.88k|    bool negative_exponent = false;
  455|  1.88k|    ++begin;
  456|  1.88k|    if (begin < end && *begin == '-') {
  ------------------
  |  Branch (456:9): [True: 1.87k, False: 11]
  |  Branch (456:24): [True: 1.01k, False: 859]
  ------------------
  457|  1.01k|      negative_exponent = true;
  458|  1.01k|      ++begin;
  459|  1.01k|    } else if (begin < end && *begin == '+') {
  ------------------
  |  Branch (459:16): [True: 859, False: 11]
  |  Branch (459:31): [True: 194, False: 665]
  ------------------
  460|    194|      ++begin;
  461|    194|    }
  462|  1.88k|    const char* const exponent_digits_begin = begin;
  463|       |    // Exponent is always expressed in decimal, even for hexadecimal floats.
  464|  1.88k|    begin += ConsumeDigits<10>(begin, end, kDecimalExponentDigitsMax,
  465|  1.88k|                               &result.literal_exponent, nullptr);
  466|  1.88k|    if (begin == exponent_digits_begin) {
  ------------------
  |  Branch (466:9): [True: 21, False: 1.86k]
  ------------------
  467|       |      // there were no digits where we expected an exponent.  We failed to read
  468|       |      // an exponent and should not consume the 'e' after all.  Rewind 'begin'.
  469|     21|      found_exponent = false;
  470|     21|      begin = exponent_begin;
  471|  1.86k|    } else {
  472|  1.86k|      found_exponent = true;
  473|  1.86k|      if (negative_exponent) {
  ------------------
  |  Branch (473:11): [True: 1.01k, False: 850]
  ------------------
  474|  1.01k|        result.literal_exponent = -result.literal_exponent;
  475|  1.01k|      }
  476|  1.86k|    }
  477|  1.88k|  }
  478|       |
  479|  4.71k|  if (!found_exponent && RequireExponent(format_flags)) {
  ------------------
  |  Branch (479:7): [True: 2.85k, False: 1.86k]
  |  Branch (479:26): [True: 0, False: 2.85k]
  ------------------
  480|       |    // Provided flags required an exponent, but none was found.  This results
  481|       |    // in a failure to scan.
  482|      0|    return result;
  483|      0|  }
  484|       |
  485|       |  // Success!
  486|  4.71k|  result.type = strings_internal::FloatType::kNumber;
  487|  4.71k|  if (result.mantissa > 0) {
  ------------------
  |  Branch (487:7): [True: 3.37k, False: 1.34k]
  ------------------
  488|  3.37k|    result.exponent = result.literal_exponent +
  489|  3.37k|                      (DigitMagnitude<base>() * exponent_adjustment);
  490|  3.37k|  } else {
  491|  1.34k|    result.exponent = 0;
  492|  1.34k|  }
  493|  4.71k|  result.end = begin;
  494|  4.71k|  return result;
  495|  4.71k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113AllowExponentENS0_12chars_formatE:
  122|  21.6k|bool AllowExponent(chars_format flags) {
  123|  21.6k|  bool fixed = (flags & chars_format::fixed) == chars_format::fixed;
  124|  21.6k|  bool scientific =
  125|  21.6k|      (flags & chars_format::scientific) == chars_format::scientific;
  126|  21.6k|  return scientific || !fixed;
  ------------------
  |  Branch (126:10): [True: 21.6k, False: 0]
  |  Branch (126:24): [True: 0, False: 0]
  ------------------
  127|  21.6k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_115RequireExponentENS0_12chars_formatE:
  130|  13.2k|bool RequireExponent(chars_format flags) {
  131|  13.2k|  bool fixed = (flags & chars_format::fixed) == chars_format::fixed;
  132|  13.2k|  bool scientific =
  133|  13.2k|      (flags & chars_format::scientific) == chars_format::scientific;
  134|  13.2k|  return scientific && !fixed;
  ------------------
  |  Branch (134:10): [True: 13.2k, False: 0]
  |  Branch (134:24): [True: 0, False: 13.2k]
  ------------------
  135|  13.2k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_119IsExponentCharacterILi10EEEbc:
  201|  6.61k|bool IsExponentCharacter<10>(char ch) {
  202|  6.61k|  return ch == 'e' || ch == 'E';
  ------------------
  |  Branch (202:10): [True: 5.50k, False: 1.11k]
  |  Branch (202:23): [True: 1.08k, False: 30]
  ------------------
  203|  6.61k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_119IsExponentCharacterILi16EEEbc:
  206|  1.89k|bool IsExponentCharacter<16>(char ch) {
  207|  1.89k|  return ch == 'p' || ch == 'P';
  ------------------
  |  Branch (207:10): [True: 1.29k, False: 599]
  |  Branch (207:23): [True: 595, False: 4]
  ------------------
  208|  1.89k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_117MantissaDigitsMaxILi10EEEiv:
  211|  50.9k|constexpr int MantissaDigitsMax<10>() {
  212|  50.9k|  return kDecimalMantissaDigitsMax;
  213|  50.9k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_117MantissaDigitsMaxILi16EEEiv:
  215|  14.1k|constexpr int MantissaDigitsMax<16>() {
  216|  14.1k|  return kHexadecimalMantissaDigitsMax;
  217|  14.1k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_110DigitLimitILi10EEEiv:
  220|  27.4k|constexpr int DigitLimit<10>() {
  221|  27.4k|  return kDecimalDigitLimit;
  222|  27.4k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_110DigitLimitILi16EEEiv:
  224|  7.38k|constexpr int DigitLimit<16>() {
  225|  7.38k|  return kHexadecimalDigitLimit;
  226|  7.38k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_114DigitMagnitudeILi10EEEiv:
  229|  15.1k|constexpr int DigitMagnitude<10>() {
  230|  15.1k|  return 1;
  231|  15.1k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_114DigitMagnitudeILi16EEEiv:
  233|  3.37k|constexpr int DigitMagnitude<16>() {
  234|  3.37k|  return 4;
  235|  3.37k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_118ParseInfinityOrNanEPKcS3_PNS0_16strings_internal11ParsedFloatE:
  298|  22.7k|                        strings_internal::ParsedFloat* out) {
  299|  22.7k|  if (end - begin < 3) {
  ------------------
  |  Branch (299:7): [True: 4.52k, False: 18.2k]
  ------------------
  300|  4.52k|    return false;
  301|  4.52k|  }
  302|  18.2k|  switch (*begin) {
  303|    202|    case 'i':
  ------------------
  |  Branch (303:5): [True: 202, False: 18.0k]
  ------------------
  304|    427|    case 'I': {
  ------------------
  |  Branch (304:5): [True: 225, False: 18.0k]
  ------------------
  305|       |      // An infinity string consists of the characters "inf" or "infinity",
  306|       |      // case insensitive.
  307|    427|      if (strings_internal::memcasecmp(begin + 1, "nf", 2) != 0) {
  ------------------
  |  Branch (307:11): [True: 6, False: 421]
  ------------------
  308|      6|        return false;
  309|      6|      }
  310|    421|      out->type = strings_internal::FloatType::kInfinity;
  311|    421|      if (end - begin >= 8 &&
  ------------------
  |  Branch (311:11): [True: 3, False: 418]
  ------------------
  312|      3|          strings_internal::memcasecmp(begin + 3, "inity", 5) == 0) {
  ------------------
  |  Branch (312:11): [True: 1, False: 2]
  ------------------
  313|      1|        out->end = begin + 8;
  314|    420|      } else {
  315|    420|        out->end = begin + 3;
  316|    420|      }
  317|    421|      return true;
  318|    427|    }
  319|    194|    case 'n':
  ------------------
  |  Branch (319:5): [True: 194, False: 18.0k]
  ------------------
  320|    617|    case 'N': {
  ------------------
  |  Branch (320:5): [True: 423, False: 17.8k]
  ------------------
  321|       |      // A NaN consists of the characters "nan", case insensitive, optionally
  322|       |      // followed by a parenthesized sequence of zero or more alphanumeric
  323|       |      // characters and/or underscores.
  324|    617|      if (strings_internal::memcasecmp(begin + 1, "an", 2) != 0) {
  ------------------
  |  Branch (324:11): [True: 3, False: 614]
  ------------------
  325|      3|        return false;
  326|      3|      }
  327|    614|      out->type = strings_internal::FloatType::kNan;
  328|    614|      out->end = begin + 3;
  329|       |      // NaN is allowed to be followed by a parenthesized string, consisting of
  330|       |      // only the characters [a-zA-Z0-9_].  Match that if it's present.
  331|    614|      begin += 3;
  332|    614|      if (begin < end && *begin == '(') {
  ------------------
  |  Branch (332:11): [True: 1, False: 613]
  |  Branch (332:26): [True: 0, False: 1]
  ------------------
  333|      0|        const char* nan_begin = begin + 1;
  334|      0|        while (nan_begin < end && IsNanChar(*nan_begin)) {
  ------------------
  |  Branch (334:16): [True: 0, False: 0]
  |  Branch (334:35): [True: 0, False: 0]
  ------------------
  335|      0|          ++nan_begin;
  336|      0|        }
  337|      0|        if (nan_begin < end && *nan_begin == ')') {
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  |  Branch (337:32): [True: 0, False: 0]
  ------------------
  338|       |          // We found an extra NaN specifier range
  339|      0|          out->subrange_begin = begin + 1;
  340|      0|          out->subrange_end = nan_begin;
  341|      0|          out->end = nan_begin + 1;
  342|      0|        }
  343|      0|      }
  344|    614|      return true;
  345|    617|    }
  346|  17.1k|    default:
  ------------------
  |  Branch (346:5): [True: 17.1k, False: 1.04k]
  ------------------
  347|  17.1k|      return false;
  348|  18.2k|  }
  349|  18.2k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113ConsumeDigitsILi10EmEEiPKcS4_iPT0_Pb:
  250|  24.6k|                  bool* dropped_nonzero_digit) {
  251|  24.6k|  if (base == 10) {
  ------------------
  |  Branch (251:7): [True: 24.6k, Folded]
  ------------------
  252|  24.6k|    assert(max_digits <= std::numeric_limits<T>::digits10);
  253|  24.6k|  } else if (base == 16) {
  ------------------
  |  Branch (253:14): [Folded, False: 0]
  ------------------
  254|      0|    assert(max_digits * 4 <= std::numeric_limits<T>::digits);
  255|      0|  }
  256|  24.6k|  const char* const original_begin = begin;
  257|       |
  258|       |  // Skip leading zeros, but only if *out is zero.
  259|       |  // They don't cause an overflow so we don't have to count them for
  260|       |  // `max_digits`.
  261|  24.6k|  while (!*out && end != begin && *begin == '0') ++begin;
  ------------------
  |  Branch (261:10): [True: 19.8k, False: 4.74k]
  |  Branch (261:19): [True: 18.5k, False: 1.34k]
  |  Branch (261:35): [True: 0, False: 18.5k]
  ------------------
  262|       |
  263|  24.6k|  T accumulator = *out;
  264|  24.6k|  const char* significant_digits_end =
  265|  24.6k|      (end - begin > max_digits) ? begin + max_digits : end;
  ------------------
  |  Branch (265:7): [True: 13.3k, False: 11.2k]
  ------------------
  266|   201k|  while (begin < significant_digits_end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (266:10): [True: 186k, False: 15.0k]
  |  Branch (266:44): [True: 176k, False: 9.53k]
  ------------------
  267|       |    // Do not guard against *out overflow; max_digits was chosen to avoid this.
  268|       |    // Do assert against it, to detect problems in debug builds.
  269|   176k|    auto digit = static_cast<T>(ToDigit<base>(*begin));
  270|   176k|    assert(accumulator * base >= accumulator);
  271|   176k|    accumulator *= base;
  272|   176k|    assert(accumulator + digit >= accumulator);
  273|   176k|    accumulator += digit;
  274|   176k|    ++begin;
  275|   176k|  }
  276|  24.6k|  bool dropped_nonzero = false;
  277|  2.97M|  while (begin < end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (277:10): [True: 2.96M, False: 10.3k]
  |  Branch (277:25): [True: 2.94M, False: 14.2k]
  ------------------
  278|  2.94M|    dropped_nonzero = dropped_nonzero || (*begin != '0');
  ------------------
  |  Branch (278:23): [True: 2.93M, False: 13.0k]
  |  Branch (278:42): [True: 9.51k, False: 3.49k]
  ------------------
  279|  2.94M|    ++begin;
  280|  2.94M|  }
  281|  24.6k|  if (dropped_nonzero && dropped_nonzero_digit != nullptr) {
  ------------------
  |  Branch (281:7): [True: 9.51k, False: 15.0k]
  |  Branch (281:26): [True: 9.51k, False: 0]
  ------------------
  282|  9.51k|    *dropped_nonzero_digit = true;
  283|  9.51k|  }
  284|  24.6k|  *out = accumulator;
  285|  24.6k|  return static_cast<int>(begin - original_begin);
  286|  24.6k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_17IsDigitILi10EEEbc:
  183|  3.21M|bool IsDigit<10>(char ch) {
  184|  3.21M|  return ch >= '0' && ch <= '9';
  ------------------
  |  Branch (184:10): [True: 3.20M, False: 12.6k]
  |  Branch (184:23): [True: 3.19M, False: 11.2k]
  ------------------
  185|  3.21M|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_17ToDigitILi10EEEjc:
  192|   199k|unsigned ToDigit<10>(char ch) {
  193|   199k|  return static_cast<unsigned>(ch - '0');
  194|   199k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113ConsumeDigitsILi10EiEEiPKcS4_iPT0_Pb:
  250|  8.47k|                  bool* dropped_nonzero_digit) {
  251|  8.47k|  if (base == 10) {
  ------------------
  |  Branch (251:7): [True: 8.47k, Folded]
  ------------------
  252|  8.47k|    assert(max_digits <= std::numeric_limits<T>::digits10);
  253|  8.47k|  } else if (base == 16) {
  ------------------
  |  Branch (253:14): [Folded, False: 0]
  ------------------
  254|      0|    assert(max_digits * 4 <= std::numeric_limits<T>::digits);
  255|      0|  }
  256|  8.47k|  const char* const original_begin = begin;
  257|       |
  258|       |  // Skip leading zeros, but only if *out is zero.
  259|       |  // They don't cause an overflow so we don't have to count them for
  260|       |  // `max_digits`.
  261|  9.54k|  while (!*out && end != begin && *begin == '0') ++begin;
  ------------------
  |  Branch (261:10): [True: 9.54k, False: 0]
  |  Branch (261:19): [True: 8.65k, False: 892]
  |  Branch (261:35): [True: 1.07k, False: 7.57k]
  ------------------
  262|       |
  263|  8.47k|  T accumulator = *out;
  264|  8.47k|  const char* significant_digits_end =
  265|  8.47k|      (end - begin > max_digits) ? begin + max_digits : end;
  ------------------
  |  Branch (265:7): [True: 357, False: 8.11k]
  ------------------
  266|  31.5k|  while (begin < significant_digits_end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (266:10): [True: 23.0k, False: 8.45k]
  |  Branch (266:44): [True: 23.0k, False: 14]
  ------------------
  267|       |    // Do not guard against *out overflow; max_digits was chosen to avoid this.
  268|       |    // Do assert against it, to detect problems in debug builds.
  269|  23.0k|    auto digit = static_cast<T>(ToDigit<base>(*begin));
  270|  23.0k|    assert(accumulator * base >= accumulator);
  271|  23.0k|    accumulator *= base;
  272|  23.0k|    assert(accumulator + digit >= accumulator);
  273|  23.0k|    accumulator += digit;
  274|  23.0k|    ++begin;
  275|  23.0k|  }
  276|  8.47k|  bool dropped_nonzero = false;
  277|  55.1k|  while (begin < end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (277:10): [True: 46.6k, False: 8.45k]
  |  Branch (277:25): [True: 46.6k, False: 15]
  ------------------
  278|  46.6k|    dropped_nonzero = dropped_nonzero || (*begin != '0');
  ------------------
  |  Branch (278:23): [True: 42.3k, False: 4.32k]
  |  Branch (278:42): [True: 354, False: 3.96k]
  ------------------
  279|  46.6k|    ++begin;
  280|  46.6k|  }
  281|  8.47k|  if (dropped_nonzero && dropped_nonzero_digit != nullptr) {
  ------------------
  |  Branch (281:7): [True: 354, False: 8.11k]
  |  Branch (281:26): [True: 0, False: 354]
  ------------------
  282|      0|    *dropped_nonzero_digit = true;
  283|      0|  }
  284|  8.47k|  *out = accumulator;
  285|  8.47k|  return static_cast<int>(begin - original_begin);
  286|  8.47k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113ConsumeDigitsILi16EmEEiPKcS4_iPT0_Pb:
  250|  6.34k|                  bool* dropped_nonzero_digit) {
  251|  6.34k|  if (base == 10) {
  ------------------
  |  Branch (251:7): [Folded, False: 6.34k]
  ------------------
  252|      0|    assert(max_digits <= std::numeric_limits<T>::digits10);
  253|  6.34k|  } else if (base == 16) {
  ------------------
  |  Branch (253:14): [True: 6.34k, Folded]
  ------------------
  254|  6.34k|    assert(max_digits * 4 <= std::numeric_limits<T>::digits);
  255|  6.34k|  }
  256|  6.34k|  const char* const original_begin = begin;
  257|       |
  258|       |  // Skip leading zeros, but only if *out is zero.
  259|       |  // They don't cause an overflow so we don't have to count them for
  260|       |  // `max_digits`.
  261|  6.34k|  while (!*out && end != begin && *begin == '0') ++begin;
  ------------------
  |  Branch (261:10): [True: 5.77k, False: 561]
  |  Branch (261:19): [True: 4.67k, False: 1.10k]
  |  Branch (261:35): [True: 0, False: 4.67k]
  ------------------
  262|       |
  263|  6.34k|  T accumulator = *out;
  264|  6.34k|  const char* significant_digits_end =
  265|  6.34k|      (end - begin > max_digits) ? begin + max_digits : end;
  ------------------
  |  Branch (265:7): [True: 883, False: 5.45k]
  ------------------
  266|  25.8k|  while (begin < significant_digits_end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (266:10): [True: 22.7k, False: 3.11k]
  |  Branch (266:44): [True: 19.5k, False: 3.22k]
  ------------------
  267|       |    // Do not guard against *out overflow; max_digits was chosen to avoid this.
  268|       |    // Do assert against it, to detect problems in debug builds.
  269|  19.5k|    auto digit = static_cast<T>(ToDigit<base>(*begin));
  270|  19.5k|    assert(accumulator * base >= accumulator);
  271|  19.5k|    accumulator *= base;
  272|  19.5k|    assert(accumulator + digit >= accumulator);
  273|  19.5k|    accumulator += digit;
  274|  19.5k|    ++begin;
  275|  19.5k|  }
  276|  6.34k|  bool dropped_nonzero = false;
  277|  3.25M|  while (begin < end && IsDigit<base>(*begin)) {
  ------------------
  |  Branch (277:10): [True: 3.24M, False: 2.83k]
  |  Branch (277:25): [True: 3.24M, False: 3.50k]
  ------------------
  278|  3.24M|    dropped_nonzero = dropped_nonzero || (*begin != '0');
  ------------------
  |  Branch (278:23): [True: 3.24M, False: 753]
  |  Branch (278:42): [True: 458, False: 295]
  ------------------
  279|  3.24M|    ++begin;
  280|  3.24M|  }
  281|  6.34k|  if (dropped_nonzero && dropped_nonzero_digit != nullptr) {
  ------------------
  |  Branch (281:7): [True: 458, False: 5.88k]
  |  Branch (281:26): [True: 458, False: 0]
  ------------------
  282|    458|    *dropped_nonzero_digit = true;
  283|    458|  }
  284|  6.34k|  *out = accumulator;
  285|  6.34k|  return static_cast<int>(begin - original_begin);
  286|  6.34k|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_17IsDigitILi16EEEbc:
  187|  3.27M|bool IsDigit<16>(char ch) {
  188|  3.27M|  return kAsciiToInt[static_cast<unsigned char>(ch)] >= 0;
  189|  3.27M|}
charconv_parse.cc:_ZN4absl12lts_2026052612_GLOBAL__N_17ToDigitILi16EEEjc:
  196|  19.5k|unsigned ToDigit<16>(char ch) {
  197|  19.5k|  return static_cast<unsigned>(kAsciiToInt[static_cast<unsigned char>(ch)]);
  198|  19.5k|}

_ZN4absl12lts_2026052616strings_internal33CalculateBase64EscapedLenInternalEmb:
   26|      2|size_t CalculateBase64EscapedLenInternal(size_t input_len, bool do_padding) {
   27|       |  // Base64 encodes three bytes of input at a time. If the input is not
   28|       |  // divisible by three, we pad as appropriate.
   29|       |  //
   30|       |  // Base64 encodes each three bytes of input into four bytes of output.
   31|      2|  constexpr size_t kMaxSize = (std::numeric_limits<size_t>::max() - 1) / 4 * 3;
   32|      2|  ABSL_INTERNAL_CHECK(input_len <= kMaxSize,
  ------------------
  |  |   85|      2|  do {                                                             \
  |  |   86|      2|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
   33|      2|                      "CalculateBase64EscapedLenInternal() overflow");
   34|      2|  size_t len = (input_len / 3) * 4;
   35|       |
   36|       |  // Since all base 64 input is an integral number of octets, only the following
   37|       |  // cases can arise:
   38|      2|  if (input_len % 3 == 0) {
  ------------------
  |  Branch (38:7): [True: 0, False: 2]
  ------------------
   39|       |    // (from https://tools.ietf.org/html/rfc3548)
   40|       |    // (1) the final quantum of encoding input is an integral multiple of 24
   41|       |    // bits; here, the final unit of encoded output will be an integral
   42|       |    // multiple of 4 characters with no "=" padding,
   43|      2|  } else if (input_len % 3 == 1) {
  ------------------
  |  Branch (43:14): [True: 0, False: 2]
  ------------------
   44|       |    // (from https://tools.ietf.org/html/rfc3548)
   45|       |    // (2) the final quantum of encoding input is exactly 8 bits; here, the
   46|       |    // final unit of encoded output will be two characters followed by two
   47|       |    // "=" padding characters, or
   48|      0|    len += 2;
   49|      0|    if (do_padding) {
  ------------------
  |  Branch (49:9): [True: 0, False: 0]
  ------------------
   50|      0|      len += 2;
   51|      0|    }
   52|      2|  } else {  // (input_len % 3 == 2)
   53|       |    // (from https://tools.ietf.org/html/rfc3548)
   54|       |    // (3) the final quantum of encoding input is exactly 16 bits; here, the
   55|       |    // final unit of encoded output will be three characters followed by one
   56|       |    // "=" padding character.
   57|      2|    len += 3;
   58|      2|    if (do_padding) {
  ------------------
  |  Branch (58:9): [True: 0, False: 2]
  ------------------
   59|      0|      len += 1;
   60|      0|    }
   61|      2|  }
   62|       |
   63|      2|  return len;
   64|      2|}

_ZN4absl12lts_2026052616strings_internal10memcasecmpEPKcS3_m:
   25|  1.04k|int memcasecmp(const char* s1, const char* s2, size_t len) {
   26|  1.04k|  const unsigned char* us1 = reinterpret_cast<const unsigned char*>(s1);
   27|  1.04k|  const unsigned char* us2 = reinterpret_cast<const unsigned char*>(s2);
   28|       |
   29|  3.12k|  for (size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (29:22): [True: 2.09k, False: 1.03k]
  ------------------
   30|  2.09k|    unsigned char c1 = us1[i];
   31|  2.09k|    unsigned char c2 = us2[i];
   32|       |    // If bytes are the same, they will be the same when converted to lower.
   33|       |    // So we only need to convert if bytes are not equal.
   34|       |    // NOTE(b/308193381): We do not use `absl::ascii_tolower` here in order
   35|       |    // to avoid its lookup table and improve performance.
   36|  2.09k|    if (c1 != c2) {
  ------------------
  |  Branch (36:9): [True: 590, False: 1.50k]
  ------------------
   37|    590|      c1 = c1 >= 'A' && c1 <= 'Z' ? c1 - 'A' + 'a' : c1;
  ------------------
  |  Branch (37:12): [True: 586, False: 4]
  |  Branch (37:25): [True: 581, False: 5]
  ------------------
   38|    590|      c2 = c2 >= 'A' && c2 <= 'Z' ? c2 - 'A' + 'a' : c2;
  ------------------
  |  Branch (38:12): [True: 590, False: 0]
  |  Branch (38:25): [True: 0, False: 590]
  ------------------
   39|    590|      const int diff = int{c1} - int{c2};
   40|    590|      if (diff != 0) return diff;
  ------------------
  |  Branch (40:11): [True: 11, False: 579]
  ------------------
   41|    590|    }
   42|  2.09k|  }
   43|  1.03k|  return 0;
   44|  1.04k|}

_ZN4absl12lts_2026052619str_format_internal17FormatConvertImplENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  455|      3|                                      FormatSinkImpl *sink) {
  456|      3|  return {ConvertStringArg(v, conv, sink)};
  457|      3|}
_ZN4absl12lts_2026052619str_format_internal17FormatConvertImplENS0_6int128ENS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  599|     21|                                        FormatSinkImpl *sink) {
  600|     21|  return {ConvertIntArg(v, conv, sink)};
  601|     21|}
_ZN4absl12lts_2026052619str_format_internal17FormatConvertImplENS0_7uint128ENS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  604|     15|                                        FormatSinkImpl *sink) {
  605|     15|  return {ConvertIntArg(v, conv, sink)};
  606|     15|}
arg.cc:_ZNK4absl12lts_2026052619str_format_internal12_GLOBAL__N_19IntDigits17with_neg_and_zeroEv:
  174|     36|  string_view with_neg_and_zero() const { return {start_, size_}; }
arg.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_116ConvertStringArgENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEENS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  303|      3|                             FormatSinkImpl *sink) {
  304|      3|  if (conv.is_basic()) {
  ------------------
  |  Branch (304:7): [True: 3, False: 0]
  ------------------
  305|      3|    sink->Append(v);
  306|      3|    return true;
  307|      3|  }
  308|      0|  return sink->PutPaddedString(v, conv.width(), conv.precision(),
  309|      0|                               conv.has_left_flag());
  310|      3|}
_ZN4absl12lts_2026052619str_format_internal13ConvertIntArgINS0_6int128EEEbT_NS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  349|     21|bool ConvertIntArg(T v, FormatConversionSpecImpl conv, FormatSinkImpl *sink) {
  350|     21|  using U = typename MakeUnsigned<T>::type;
  351|     21|  IntDigits as_digits;
  352|       |
  353|       |  // This odd casting is due to a bug in -Wswitch behavior in gcc49 which causes
  354|       |  // it to complain about a switch/case type mismatch, even though both are
  355|       |  // FormatConversionChar.  Likely this is because at this point
  356|       |  // FormatConversionChar is declared, but not defined.
  357|     21|  switch (static_cast<uint8_t>(conv.conversion_char())) {
  358|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::c):
  ------------------
  |  Branch (358:5): [True: 0, False: 21]
  ------------------
  359|      0|      return (std::is_same<T, wchar_t>::value ||
  ------------------
  |  Branch (359:15): [Folded, False: 0]
  ------------------
  360|      0|              (conv.length_mod() == LengthMod::l))
  ------------------
  |  Branch (360:15): [True: 0, False: 0]
  ------------------
  361|      0|                 ? ConvertWCharTImpl(static_cast<wchar_t>(v), conv, sink)
  362|      0|                 : ConvertCharImpl(static_cast<char>(v), conv, sink);
  363|       |
  364|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::o):
  ------------------
  |  Branch (364:5): [True: 0, False: 21]
  ------------------
  365|      0|      as_digits.PrintAsOct(static_cast<U>(v));
  366|      0|      break;
  367|       |
  368|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::x):
  ------------------
  |  Branch (368:5): [True: 0, False: 21]
  ------------------
  369|      0|      as_digits.PrintAsHexLower(static_cast<U>(v));
  370|      0|      break;
  371|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::X):
  ------------------
  |  Branch (371:5): [True: 0, False: 21]
  ------------------
  372|      0|      as_digits.PrintAsHexUpper(static_cast<U>(v));
  373|      0|      break;
  374|       |
  375|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::u):
  ------------------
  |  Branch (375:5): [True: 0, False: 21]
  ------------------
  376|      0|      as_digits.PrintAsDec(static_cast<U>(v));
  377|      0|      break;
  378|       |
  379|     21|    case static_cast<uint8_t>(FormatConversionCharInternal::d):
  ------------------
  |  Branch (379:5): [True: 21, False: 0]
  ------------------
  380|     21|    case static_cast<uint8_t>(FormatConversionCharInternal::i):
  ------------------
  |  Branch (380:5): [True: 0, False: 21]
  ------------------
  381|     21|    case static_cast<uint8_t>(FormatConversionCharInternal::v):
  ------------------
  |  Branch (381:5): [True: 0, False: 21]
  ------------------
  382|     21|      as_digits.PrintAsDec(v);
  383|     21|      break;
  384|       |
  385|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::a):
  ------------------
  |  Branch (385:5): [True: 0, False: 21]
  ------------------
  386|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::e):
  ------------------
  |  Branch (386:5): [True: 0, False: 21]
  ------------------
  387|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::f):
  ------------------
  |  Branch (387:5): [True: 0, False: 21]
  ------------------
  388|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::g):
  ------------------
  |  Branch (388:5): [True: 0, False: 21]
  ------------------
  389|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::A):
  ------------------
  |  Branch (389:5): [True: 0, False: 21]
  ------------------
  390|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::E):
  ------------------
  |  Branch (390:5): [True: 0, False: 21]
  ------------------
  391|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::F):
  ------------------
  |  Branch (391:5): [True: 0, False: 21]
  ------------------
  392|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::G):
  ------------------
  |  Branch (392:5): [True: 0, False: 21]
  ------------------
  393|      0|      return ConvertFloatImpl(static_cast<double>(v), conv, sink);
  394|       |
  395|      0|    default:
  ------------------
  |  Branch (395:5): [True: 0, False: 21]
  ------------------
  396|      0|      ABSL_ASSUME(false);
  ------------------
  |  |  271|      0|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  397|     21|  }
  398|       |
  399|     21|  if (conv.is_basic()) {
  ------------------
  |  Branch (399:7): [True: 21, False: 0]
  ------------------
  400|     21|    sink->Append(as_digits.with_neg_and_zero());
  401|     21|    return true;
  402|     21|  }
  403|      0|  return ConvertIntImplInnerSlow(as_digits, conv, sink);
  404|     21|}
arg.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_19IntDigits10PrintAsDecENS0_7uint128Eb:
  114|     36|  void PrintAsDec(uint128 v, bool add_neg = false) {
  115|       |    // This function can be sped up if needed. We can call FastIntToBuffer
  116|       |    // twice, or fix FastIntToBuffer to support uint128.
  117|     36|    char *p = storage_ + sizeof(storage_);
  118|     62|    do {
  119|     62|      p -= 2;
  120|     62|      numbers_internal::PutTwoDigits(static_cast<uint32_t>(v % 100), p);
  121|     62|      v /= 100;
  122|     62|    } while (v);
  ------------------
  |  Branch (122:14): [True: 26, False: 36]
  ------------------
  123|     36|    if (p[0] == '0') {
  ------------------
  |  Branch (123:9): [True: 25, False: 11]
  ------------------
  124|       |      // We printed one too many hexits.
  125|     25|      ++p;
  126|     25|    }
  127|     36|    if (add_neg) {
  ------------------
  |  Branch (127:9): [True: 0, False: 36]
  ------------------
  128|      0|      *--p = '-';
  129|      0|    }
  130|     36|    size_ = static_cast<size_t>(storage_ + sizeof(storage_) - p);
  131|     36|    start_ = p;
  132|     36|  }
arg.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_19IntDigits10PrintAsDecENS0_6int128E:
  104|     21|  void PrintAsDec(int128 v) {
  105|     21|    auto u = static_cast<uint128>(v);
  106|     21|    bool add_neg = false;
  107|     21|    if (v < 0) {
  ------------------
  |  Branch (107:9): [True: 0, False: 21]
  ------------------
  108|      0|      add_neg = true;
  109|      0|      u = uint128{} - u;
  110|      0|    }
  111|     21|    PrintAsDec(u, add_neg);
  112|     21|  }
_ZN4absl12lts_2026052619str_format_internal13ConvertIntArgINS0_7uint128EEEbT_NS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  349|     15|bool ConvertIntArg(T v, FormatConversionSpecImpl conv, FormatSinkImpl *sink) {
  350|     15|  using U = typename MakeUnsigned<T>::type;
  351|     15|  IntDigits as_digits;
  352|       |
  353|       |  // This odd casting is due to a bug in -Wswitch behavior in gcc49 which causes
  354|       |  // it to complain about a switch/case type mismatch, even though both are
  355|       |  // FormatConversionChar.  Likely this is because at this point
  356|       |  // FormatConversionChar is declared, but not defined.
  357|     15|  switch (static_cast<uint8_t>(conv.conversion_char())) {
  358|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::c):
  ------------------
  |  Branch (358:5): [True: 0, False: 15]
  ------------------
  359|      0|      return (std::is_same<T, wchar_t>::value ||
  ------------------
  |  Branch (359:15): [Folded, False: 0]
  ------------------
  360|      0|              (conv.length_mod() == LengthMod::l))
  ------------------
  |  Branch (360:15): [True: 0, False: 0]
  ------------------
  361|      0|                 ? ConvertWCharTImpl(static_cast<wchar_t>(v), conv, sink)
  362|      0|                 : ConvertCharImpl(static_cast<char>(v), conv, sink);
  363|       |
  364|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::o):
  ------------------
  |  Branch (364:5): [True: 0, False: 15]
  ------------------
  365|      0|      as_digits.PrintAsOct(static_cast<U>(v));
  366|      0|      break;
  367|       |
  368|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::x):
  ------------------
  |  Branch (368:5): [True: 0, False: 15]
  ------------------
  369|      0|      as_digits.PrintAsHexLower(static_cast<U>(v));
  370|      0|      break;
  371|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::X):
  ------------------
  |  Branch (371:5): [True: 0, False: 15]
  ------------------
  372|      0|      as_digits.PrintAsHexUpper(static_cast<U>(v));
  373|      0|      break;
  374|       |
  375|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::u):
  ------------------
  |  Branch (375:5): [True: 0, False: 15]
  ------------------
  376|      0|      as_digits.PrintAsDec(static_cast<U>(v));
  377|      0|      break;
  378|       |
  379|     15|    case static_cast<uint8_t>(FormatConversionCharInternal::d):
  ------------------
  |  Branch (379:5): [True: 15, False: 0]
  ------------------
  380|     15|    case static_cast<uint8_t>(FormatConversionCharInternal::i):
  ------------------
  |  Branch (380:5): [True: 0, False: 15]
  ------------------
  381|     15|    case static_cast<uint8_t>(FormatConversionCharInternal::v):
  ------------------
  |  Branch (381:5): [True: 0, False: 15]
  ------------------
  382|     15|      as_digits.PrintAsDec(v);
  383|     15|      break;
  384|       |
  385|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::a):
  ------------------
  |  Branch (385:5): [True: 0, False: 15]
  ------------------
  386|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::e):
  ------------------
  |  Branch (386:5): [True: 0, False: 15]
  ------------------
  387|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::f):
  ------------------
  |  Branch (387:5): [True: 0, False: 15]
  ------------------
  388|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::g):
  ------------------
  |  Branch (388:5): [True: 0, False: 15]
  ------------------
  389|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::A):
  ------------------
  |  Branch (389:5): [True: 0, False: 15]
  ------------------
  390|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::E):
  ------------------
  |  Branch (390:5): [True: 0, False: 15]
  ------------------
  391|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::F):
  ------------------
  |  Branch (391:5): [True: 0, False: 15]
  ------------------
  392|      0|    case static_cast<uint8_t>(FormatConversionCharInternal::G):
  ------------------
  |  Branch (392:5): [True: 0, False: 15]
  ------------------
  393|      0|      return ConvertFloatImpl(static_cast<double>(v), conv, sink);
  394|       |
  395|      0|    default:
  ------------------
  |  Branch (395:5): [True: 0, False: 15]
  ------------------
  396|      0|      ABSL_ASSUME(false);
  ------------------
  |  |  271|      0|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  397|     15|  }
  398|       |
  399|     15|  if (conv.is_basic()) {
  ------------------
  |  Branch (399:7): [True: 15, False: 0]
  ------------------
  400|     15|    sink->Append(as_digits.with_neg_and_zero());
  401|     15|    return true;
  402|     15|  }
  403|      0|  return ConvertIntImplInnerSlow(as_digits, conv, sink);
  404|     15|}

_ZN4absl12lts_2026052619str_format_internal14ExtractCharSetILNS0_23FormatConversionCharSetE655355EEES3_NS1_16ArgConvertResultIXT_EEE:
  206|     36|constexpr FormatConversionCharSet ExtractCharSet(ArgConvertResult<C>) {
  207|     36|  return C;
  208|     36|}
_ZN4absl12lts_2026052619str_format_internal14ExtractCharSetILNS0_23FormatConversionCharSetE524292EEES3_NS1_16ArgConvertResultIXT_EEE:
  206|      3|constexpr FormatConversionCharSet ExtractCharSet(ArgConvertResult<C>) {
  207|      3|  return C;
  208|      3|}
_ZN4absl12lts_2026052619str_format_internal14ArgumentToConvINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEENS0_23FormatConversionCharSetEv:
  420|      3|constexpr FormatConversionCharSet ArgumentToConv() {
  421|      3|  using ConvResult = decltype(str_format_internal::FormatConvertImpl(
  422|      3|      std::declval<const Arg&>(),
  423|      3|      std::declval<const FormatConversionSpecImpl&>(),
  424|      3|      std::declval<FormatSinkImpl*>()));
  425|      3|  return absl::str_format_internal::ExtractCharSet(ConvResult{});
  426|      3|}
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl4InitINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEEEvRKT_:
  547|      3|  void Init(const T& value) {
  548|      3|    data_ = Manager<T>::SetValue(value);
  549|      3|    dispatcher_ = &Dispatch<T>;
  550|      3|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELNS2_13StoragePolicyE0EE8SetValueERKS8_:
  509|      3|    static Data SetValue(const T& value) {
  510|      3|      Data data;
  511|      3|      data.ptr = std::addressof(value);
  512|      3|      return data;
  513|      3|    }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl8DispatchINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEEEbNS2_4DataENS1_24FormatConversionSpecImplEPv:
  588|      3|  static bool Dispatch(Data arg, FormatConversionSpecImpl spec, void* out) {
  589|       |    // A `none` conv indicates that we want the `int` conversion.
  590|      3|    if (ABSL_PREDICT_FALSE(spec.conversion_char() ==
  ------------------
  |  |  190|      3|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 3]
  |  |  |  Branch (190:49): [Folded, False: 3]
  |  |  |  Branch (190:58): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  591|      3|                           FormatConversionCharInternal::kNone)) {
  592|      0|      return ToInt<T>(arg, static_cast<int*>(out), std::is_integral<T>(),
  593|      0|                      std::is_enum<T>());
  594|      0|    }
  595|      3|    if (ABSL_PREDICT_FALSE(
  ------------------
  |  |  190|      3|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 3]
  |  |  |  Branch (190:49): [Folded, False: 3]
  |  |  |  Branch (190:58): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  596|      3|            !Contains(ArgumentToConv<T>(), spec.conversion_char()))) {
  597|      0|      return false;
  598|      0|    }
  599|      3|    return str_format_internal::FormatConvertImpl(
  600|      3|               Manager<T>::Value(arg), spec, static_cast<FormatSinkImpl*>(out))
  601|      3|        .value;
  602|      3|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINSt3__117basic_string_viewIcNS4_11char_traitsIcEEEELNS2_13StoragePolicyE0EE5ValueENS2_4DataE:
  515|      3|    static const T& Value(Data arg) { return *static_cast<const T*>(arg.ptr); }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImplC2INSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEEERKT_:
  494|      3|  explicit FormatArgImpl(const T& value) {
  495|      3|    using D = typename DecayType<T>::type;
  496|      3|    static_assert(
  497|      3|        std::is_same<D, const T&>::value || storage_policy<D>::value == ByValue,
  498|      3|        "Decayed types must be stored by value");
  499|      3|    Init(static_cast<D>(value));
  500|      3|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImplC2INS0_7uint128EEERKT_:
  494|     15|  explicit FormatArgImpl(const T& value) {
  495|     15|    using D = typename DecayType<T>::type;
  496|     15|    static_assert(
  497|     15|        std::is_same<D, const T&>::value || storage_policy<D>::value == ByValue,
  498|     15|        "Decayed types must be stored by value");
  499|     15|    Init(static_cast<D>(value));
  500|     15|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl4InitINS0_7uint128EEEvRKT_:
  547|     15|  void Init(const T& value) {
  548|     15|    data_ = Manager<T>::SetValue(value);
  549|     15|    dispatcher_ = &Dispatch<T>;
  550|     15|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINS0_7uint128ELNS2_13StoragePolicyE0EE8SetValueERKS4_:
  509|     15|    static Data SetValue(const T& value) {
  510|     15|      Data data;
  511|     15|      data.ptr = std::addressof(value);
  512|     15|      return data;
  513|     15|    }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl8DispatchINS0_7uint128EEEbNS2_4DataENS1_24FormatConversionSpecImplEPv:
  588|     15|  static bool Dispatch(Data arg, FormatConversionSpecImpl spec, void* out) {
  589|       |    // A `none` conv indicates that we want the `int` conversion.
  590|     15|    if (ABSL_PREDICT_FALSE(spec.conversion_char() ==
  ------------------
  |  |  190|     15|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 15]
  |  |  |  Branch (190:49): [Folded, False: 15]
  |  |  |  Branch (190:58): [True: 0, False: 15]
  |  |  ------------------
  ------------------
  591|     15|                           FormatConversionCharInternal::kNone)) {
  592|      0|      return ToInt<T>(arg, static_cast<int*>(out), std::is_integral<T>(),
  593|      0|                      std::is_enum<T>());
  594|      0|    }
  595|     15|    if (ABSL_PREDICT_FALSE(
  ------------------
  |  |  190|     15|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 15]
  |  |  |  Branch (190:49): [Folded, False: 15]
  |  |  |  Branch (190:58): [True: 0, False: 15]
  |  |  ------------------
  ------------------
  596|     15|            !Contains(ArgumentToConv<T>(), spec.conversion_char()))) {
  597|      0|      return false;
  598|      0|    }
  599|     15|    return str_format_internal::FormatConvertImpl(
  600|     15|               Manager<T>::Value(arg), spec, static_cast<FormatSinkImpl*>(out))
  601|     15|        .value;
  602|     15|  }
_ZN4absl12lts_2026052619str_format_internal14ArgumentToConvINS0_7uint128EEENS0_23FormatConversionCharSetEv:
  420|     15|constexpr FormatConversionCharSet ArgumentToConv() {
  421|     15|  using ConvResult = decltype(str_format_internal::FormatConvertImpl(
  422|     15|      std::declval<const Arg&>(),
  423|     15|      std::declval<const FormatConversionSpecImpl&>(),
  424|     15|      std::declval<FormatSinkImpl*>()));
  425|     15|  return absl::str_format_internal::ExtractCharSet(ConvResult{});
  426|     15|}
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINS0_7uint128ELNS2_13StoragePolicyE0EE5ValueENS2_4DataE:
  515|     15|    static const T& Value(Data arg) { return *static_cast<const T*>(arg.ptr); }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImplC2INS0_6int128EEERKT_:
  494|     21|  explicit FormatArgImpl(const T& value) {
  495|     21|    using D = typename DecayType<T>::type;
  496|     21|    static_assert(
  497|     21|        std::is_same<D, const T&>::value || storage_policy<D>::value == ByValue,
  498|     21|        "Decayed types must be stored by value");
  499|     21|    Init(static_cast<D>(value));
  500|     21|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl4InitINS0_6int128EEEvRKT_:
  547|     21|  void Init(const T& value) {
  548|     21|    data_ = Manager<T>::SetValue(value);
  549|     21|    dispatcher_ = &Dispatch<T>;
  550|     21|  }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINS0_6int128ELNS2_13StoragePolicyE0EE8SetValueERKS4_:
  509|     21|    static Data SetValue(const T& value) {
  510|     21|      Data data;
  511|     21|      data.ptr = std::addressof(value);
  512|     21|      return data;
  513|     21|    }
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl8DispatchINS0_6int128EEEbNS2_4DataENS1_24FormatConversionSpecImplEPv:
  588|     21|  static bool Dispatch(Data arg, FormatConversionSpecImpl spec, void* out) {
  589|       |    // A `none` conv indicates that we want the `int` conversion.
  590|     21|    if (ABSL_PREDICT_FALSE(spec.conversion_char() ==
  ------------------
  |  |  190|     21|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 21]
  |  |  |  Branch (190:49): [Folded, False: 21]
  |  |  |  Branch (190:58): [True: 0, False: 21]
  |  |  ------------------
  ------------------
  591|     21|                           FormatConversionCharInternal::kNone)) {
  592|      0|      return ToInt<T>(arg, static_cast<int*>(out), std::is_integral<T>(),
  593|      0|                      std::is_enum<T>());
  594|      0|    }
  595|     21|    if (ABSL_PREDICT_FALSE(
  ------------------
  |  |  190|     21|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 21]
  |  |  |  Branch (190:49): [Folded, False: 21]
  |  |  |  Branch (190:58): [True: 0, False: 21]
  |  |  ------------------
  ------------------
  596|     21|            !Contains(ArgumentToConv<T>(), spec.conversion_char()))) {
  597|      0|      return false;
  598|      0|    }
  599|     21|    return str_format_internal::FormatConvertImpl(
  600|     21|               Manager<T>::Value(arg), spec, static_cast<FormatSinkImpl*>(out))
  601|     21|        .value;
  602|     21|  }
_ZN4absl12lts_2026052619str_format_internal14ArgumentToConvINS0_6int128EEENS0_23FormatConversionCharSetEv:
  420|     21|constexpr FormatConversionCharSet ArgumentToConv() {
  421|     21|  using ConvResult = decltype(str_format_internal::FormatConvertImpl(
  422|     21|      std::declval<const Arg&>(),
  423|     21|      std::declval<const FormatConversionSpecImpl&>(),
  424|     21|      std::declval<FormatSinkImpl*>()));
  425|     21|  return absl::str_format_internal::ExtractCharSet(ConvResult{});
  426|     21|}
_ZN4absl12lts_2026052619str_format_internal13FormatArgImpl7ManagerINS0_6int128ELNS2_13StoragePolicyE0EE5ValueENS2_4DataE:
  515|     21|    static const T& Value(Data arg) { return *static_cast<const T*>(arg.ptr); }
_ZN4absl12lts_2026052619str_format_internal19FormatArgImplFriend7ConvertINS1_13FormatArgImplEEEbT_NS1_24FormatConversionSpecImplEPNS1_14FormatSinkImplE:
  409|     39|                      FormatSinkImpl* out) {
  410|     39|    return arg.dispatcher_(arg.data_, conv, out);
  411|     39|  }

_ZN4absl12lts_2026052619str_format_internal13FormatUntypedENS1_17FormatRawSinkImplENS1_21UntypedFormatSpecImplENS0_4SpanIKNS1_13FormatArgImplEEE:
  214|     87|                   absl::Span<const FormatArgImpl> args) {
  215|     87|  FormatSinkImpl sink(raw_sink);
  216|     87|  using Converter = DefaultConverter;
  217|     87|  return ConvertAll(format, args, Converter(&sink));
  218|     87|}
_ZN4absl12lts_2026052619str_format_internal7FprintFEP8_IO_FILENS1_21UntypedFormatSpecImplENS0_4SpanIKNS1_13FormatArgImplEEE:
  244|      3|            absl::Span<const FormatArgImpl> args) {
  245|      3|  FILERawSink sink(output);
  246|      3|  if (!FormatUntyped(&sink, format, args)) {
  ------------------
  |  Branch (246:7): [True: 0, False: 3]
  ------------------
  247|      0|    errno = EINVAL;
  248|      0|    return -1;
  249|      0|  }
  250|      3|  if (sink.error()) {
  ------------------
  |  Branch (250:7): [True: 0, False: 3]
  ------------------
  251|      0|    errno = sink.error();
  252|      0|    return -1;
  253|      0|  }
  254|      3|  if (sink.count() > static_cast<size_t>(std::numeric_limits<int>::max())) {
  ------------------
  |  Branch (254:7): [True: 0, False: 3]
  ------------------
  255|      0|    errno = EFBIG;
  256|      0|    return -1;
  257|      0|  }
  258|      3|  return static_cast<int>(sink.count());
  259|      3|}
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_110ArgContextC2ENS0_4SpanIKNS1_13FormatArgImplEEE:
   55|     87|  explicit ArgContext(absl::Span<const FormatArgImpl> pack) : pack_(pack) {}
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_110ArgContext4BindEPKNS1_17UnboundConversionEPNS1_15BoundConversionE:
   70|     39|                             BoundConversion* bound) {
   71|     39|  const FormatArgImpl* arg = nullptr;
   72|     39|  int arg_position = unbound->arg_position;
   73|     39|  if (static_cast<size_t>(arg_position - 1) >= pack_.size()) return false;
  ------------------
  |  Branch (73:7): [True: 0, False: 39]
  ------------------
   74|     39|  arg = &pack_[static_cast<size_t>(arg_position - 1)];  // 1-based
   75|       |
   76|     39|  if (unbound->flags != Flags::kBasic) {
  ------------------
  |  Branch (76:7): [True: 0, False: 39]
  ------------------
   77|      0|    int width = unbound->width.value();
   78|      0|    bool force_left = false;
   79|      0|    if (unbound->width.is_from_arg()) {
  ------------------
  |  Branch (79:9): [True: 0, False: 0]
  ------------------
   80|      0|      if (!BindFromPosition(unbound->width.get_from_arg(), &width, pack_))
  ------------------
  |  Branch (80:11): [True: 0, False: 0]
  ------------------
   81|      0|        return false;
   82|      0|      if (width < 0) {
  ------------------
  |  Branch (82:11): [True: 0, False: 0]
  ------------------
   83|       |        // "A negative field width is taken as a '-' flag followed by a
   84|       |        // positive field width."
   85|      0|        force_left = true;
   86|       |        // Make sure we don't overflow the width when negating it.
   87|      0|        width = -std::max(width, -std::numeric_limits<int>::max());
   88|      0|      }
   89|      0|    }
   90|       |
   91|      0|    int precision = unbound->precision.value();
   92|      0|    if (unbound->precision.is_from_arg()) {
  ------------------
  |  Branch (92:9): [True: 0, False: 0]
  ------------------
   93|      0|      if (!BindFromPosition(unbound->precision.get_from_arg(), &precision,
  ------------------
  |  Branch (93:11): [True: 0, False: 0]
  ------------------
   94|      0|                            pack_))
   95|      0|        return false;
   96|      0|    }
   97|       |
   98|      0|    FormatConversionSpecImplFriend::SetWidth(width, bound);
   99|      0|    FormatConversionSpecImplFriend::SetPrecision(precision, bound);
  100|       |
  101|      0|    if (force_left) {
  ------------------
  |  Branch (101:9): [True: 0, False: 0]
  ------------------
  102|      0|      FormatConversionSpecImplFriend::SetFlags(unbound->flags | Flags::kLeft,
  103|      0|                                               bound);
  104|      0|    } else {
  105|      0|      FormatConversionSpecImplFriend::SetFlags(unbound->flags, bound);
  106|      0|    }
  107|       |
  108|      0|    FormatConversionSpecImplFriend::SetLengthMod(unbound->length_mod, bound);
  109|     39|  } else {
  110|     39|    FormatConversionSpecImplFriend::SetFlags(unbound->flags, bound);
  111|     39|    FormatConversionSpecImplFriend::SetWidth(-1, bound);
  112|     39|    FormatConversionSpecImplFriend::SetPrecision(-1, bound);
  113|     39|  }
  114|     39|  FormatConversionSpecImplFriend::SetConversionChar(unbound->conv, bound);
  115|     39|  bound->set_arg(arg);
  116|     39|  return true;
  117|     39|}
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_116DefaultConverterC2EPNS1_14FormatSinkImplE:
  154|     87|  explicit DefaultConverter(FormatSinkImpl* sink) : sink_(sink) {}
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_110ConvertAllINS2_16DefaultConverterEEEbNS1_21UntypedFormatSpecImplENS0_4SpanIKNS1_13FormatArgImplEEET_:
  142|     87|                absl::Span<const FormatArgImpl> args, Converter converter) {
  143|     87|  if (format.has_parsed_conversion()) {
  ------------------
  |  Branch (143:7): [True: 0, False: 87]
  ------------------
  144|      0|    return format.parsed_conversion()->ProcessFormat(
  145|      0|        ConverterConsumer<Converter>(converter, args));
  146|     87|  } else {
  147|     87|    return ParseFormatString(format.str(),
  148|     87|                             ConverterConsumer<Converter>(converter, args));
  149|     87|  }
  150|     87|}
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_117ConverterConsumerINS2_16DefaultConverterEE10ConvertOneERKNS1_17UnboundConversionENSt3__117basic_string_viewIcNS9_11char_traitsIcEEEE:
  129|     39|  bool ConvertOne(const UnboundConversion& conv, string_view conv_string) {
  130|     39|    BoundConversion bound;
  131|     39|    if (!arg_context_.Bind(&conv, &bound)) return false;
  ------------------
  |  Branch (131:9): [True: 0, False: 39]
  ------------------
  132|     39|    return converter_.ConvertOne(bound, conv_string);
  133|     39|  }
bind.cc:_ZNK4absl12lts_2026052619str_format_internal12_GLOBAL__N_116DefaultConverter10ConvertOneERKNS1_15BoundConversionENSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE:
  158|     39|  bool ConvertOne(const BoundConversion& bound, string_view /*conv*/) const {
  159|     39|    return FormatArgImplFriend::Convert(*bound.arg(), bound, sink_);
  160|     39|  }
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_117ConverterConsumerINS2_16DefaultConverterEE6AppendENSt3__117basic_string_viewIcNS6_11char_traitsIcEEEE:
  125|     87|  bool Append(string_view s) {
  126|     87|    converter_.Append(s);
  127|     87|    return true;
  128|     87|  }
bind.cc:_ZNK4absl12lts_2026052619str_format_internal12_GLOBAL__N_116DefaultConverter6AppendENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
  156|     87|  void Append(string_view s) const { sink_->Append(s); }
bind.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_117ConverterConsumerINS2_16DefaultConverterEEC2ES4_NS0_4SpanIKNS1_13FormatArgImplEEE:
  123|     87|      : converter_(converter), arg_context_(pack) {}

_ZNK4absl12lts_2026052619str_format_internal15BoundConversion3argEv:
   43|     39|  const FormatArgImpl* arg() const { return arg_; }
_ZN4absl12lts_2026052619str_format_internal15BoundConversion7set_argEPKNS1_13FormatArgImplE:
   44|     39|  void set_arg(const FormatArgImpl* a) { arg_ = a; }
_ZN4absl12lts_2026052619str_format_internal21UntypedFormatSpecImplC2ENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   56|     87|      : data_(s.data()), size_(s.size()) {}
_ZNK4absl12lts_2026052619str_format_internal21UntypedFormatSpecImpl21has_parsed_conversionEv:
   61|     87|  bool has_parsed_conversion() const { return size_ == ~size_t{}; }
_ZNK4absl12lts_2026052619str_format_internal21UntypedFormatSpecImpl3strEv:
   63|     87|  string_view str() const {
   64|       |    assert(!has_parsed_conversion());
   65|     87|    return string_view(static_cast<const char*>(data_), size_);
   66|     87|  }
_ZN4absl12lts_2026052619str_format_internal21UntypedFormatSpecImpl7ExtractINS1_18FormatSpecTemplateIJLNS0_23FormatConversionCharSetE524292EEEEEERKS2_RKT_:
   73|      3|  static const UntypedFormatSpecImpl& Extract(const T& s) {
   74|      3|    return s.spec_;
   75|      3|  }
_ZN4absl12lts_2026052619str_format_internal21UntypedFormatSpecImpl7ExtractINS1_18FormatSpecTemplateIJEEEEERKS2_RKT_:
   73|     48|  static const UntypedFormatSpecImpl& Extract(const T& s) {
   74|     48|    return s.spec_;
   75|     48|  }
_ZN4absl12lts_2026052619str_format_internal21UntypedFormatSpecImpl7ExtractINS1_18FormatSpecTemplateIJLNS0_23FormatConversionCharSetE655355EEEEEERKS2_RKT_:
   73|     36|  static const UntypedFormatSpecImpl& Extract(const T& s) {
   74|     36|    return s.spec_;
   75|     36|  }
_ZN4absl12lts_2026052619str_format_internal18FormatSpecTemplateIJEEC2EUa9enable_ifIXclL_ZNS1_15ValidFormatImplITpTnNS0_23FormatConversionCharSetEJEEEbNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEfL0p_EEEPKc:
  159|     48|      : Base(s) {}
_ZN4absl12lts_2026052619str_format_internal18FormatSpecTemplateIJLNS0_23FormatConversionCharSetE524292EEEC2EUa9enable_ifIXclL_ZNS1_15ValidFormatImplIJLS3_524292EEEEbNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEfL0p_EEEPKc:
  159|      3|      : Base(s) {}
_ZN4absl12lts_2026052619str_format_internal18FormatSpecTemplateIJLNS0_23FormatConversionCharSetE655355EEEC2EUa9enable_ifIXclL_ZNS1_15ValidFormatImplIJLS3_655355EEEEbNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEfL0p_EEEPKc:
  159|     36|      : Base(s) {}

_ZN4absl12lts_2026052619str_format_internal17UnboundConversionC2Ev:
   36|     39|  UnboundConversion() {}  // NOLINT
_ZNK4absl12lts_2026052619str_format_internal7ConvTag7is_convEv:
   94|     39|  constexpr bool is_conv() const { return (tag_ & 0x80) == 0; }
_ZNK4absl12lts_2026052619str_format_internal7ConvTag7as_convEv:
   98|     39|  constexpr FormatConversionChar as_conv() const {
   99|     39|    assert(is_conv());
  100|     39|    assert(!is_length());
  101|       |    assert(!is_flags());
  102|     39|    return static_cast<FormatConversionChar>(tag_);
  103|     39|  }
_ZN4absl12lts_2026052619str_format_internal13GetTagForCharEc:
  169|     39|constexpr ConvTag GetTagForChar(char c) {
  170|     39|  return ConvTagHolder::value[static_cast<unsigned char>(c)];
  171|     39|}

_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImpl5WriteENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   48|     87|  void Write(string_view s) { write_(sink_, s); }
_ZN4absl12lts_2026052619str_format_internal14FormatSinkImplC2ENS1_17FormatRawSinkImplE:
   68|     87|  explicit FormatSinkImpl(FormatRawSinkImpl raw) : raw_(raw) {}
_ZN4absl12lts_2026052619str_format_internal14FormatSinkImplD2Ev:
   70|     87|  ~FormatSinkImpl() { Flush(); }
_ZN4absl12lts_2026052619str_format_internal14FormatSinkImpl5FlushEv:
   72|     87|  void Flush() {
   73|     87|    raw_.Write(string_view(buf_, static_cast<size_t>(pos_ - buf_)));
   74|     87|    pos_ = buf_;
   75|     87|  }
_ZN4absl12lts_2026052619str_format_internal14FormatSinkImpl6AppendENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   94|    126|  void Append(string_view v) {
   95|    126|    size_t n = v.size();
   96|    126|    if (n == 0) return;
  ------------------
  |  Branch (96:9): [True: 36, False: 90]
  ------------------
   97|     90|    size_ += n;
   98|     90|    if (n >= Avail()) {
  ------------------
  |  Branch (98:9): [True: 0, False: 90]
  ------------------
   99|      0|      Flush();
  100|      0|      raw_.Write(v);
  101|      0|      return;
  102|      0|    }
  103|     90|    memcpy(pos_, v.data(), n);
  104|     90|    pos_ += n;
  105|     90|  }
_ZNK4absl12lts_2026052619str_format_internal14FormatSinkImpl5AvailEv:
  123|     90|  size_t Avail() const {
  124|     90|    return static_cast<size_t>(buf_ + sizeof(buf_) - pos_);
  125|     90|  }
_ZNK4absl12lts_2026052619str_format_internal24FormatConversionSpecImpl8is_basicEv:
  277|     39|  bool is_basic() const { return flags_ == Flags::kBasic; }
_ZNK4absl12lts_2026052619str_format_internal24FormatConversionSpecImpl15conversion_charEv:
  290|    114|  FormatConversionChar conversion_char() const {
  291|       |    // Keep this field first in the struct . It generates better code when
  292|       |    // accessing it when ConversionSpec is passed by value in registers.
  293|    114|    static_assert(offsetof(FormatConversionSpecImpl, conv_) == 0, "");
  294|    114|    return conv_;
  295|    114|  }
_ZN4absl12lts_2026052619str_format_internal30FormatConversionSpecImplFriend8SetFlagsENS1_5FlagsEPNS1_24FormatConversionSpecImplE:
  321|     39|  static void SetFlags(Flags f, FormatConversionSpecImpl* conv) {
  322|     39|    conv->flags_ = f;
  323|     39|  }
_ZN4absl12lts_2026052619str_format_internal30FormatConversionSpecImplFriend17SetConversionCharENS0_20FormatConversionCharEPNS1_24FormatConversionSpecImplE:
  328|     39|                                FormatConversionSpecImpl* conv) {
  329|     39|    conv->conv_ = c;
  330|     39|  }
_ZN4absl12lts_2026052619str_format_internal30FormatConversionSpecImplFriend8SetWidthEiPNS1_24FormatConversionSpecImplE:
  331|     39|  static void SetWidth(int w, FormatConversionSpecImpl* conv) {
  332|     39|    conv->width_ = w;
  333|     39|  }
_ZN4absl12lts_2026052619str_format_internal30FormatConversionSpecImplFriend12SetPrecisionEiPNS1_24FormatConversionSpecImplE:
  334|     39|  static void SetPrecision(int p, FormatConversionSpecImpl* conv) {
  335|     39|    conv->precision_ = p;
  336|     39|  }
_ZN4absl12lts_2026052619str_format_internal29FormatConversionCharToConvIntENS0_20FormatConversionCharE:
  360|     39|constexpr uint64_t FormatConversionCharToConvInt(FormatConversionChar c) {
  361|     39|  return uint64_t{1} << (1 + static_cast<uint8_t>(c));
  362|     39|}
_ZN4absl12lts_2026052619str_format_internal8ContainsENS0_23FormatConversionCharSetENS0_20FormatConversionCharE:
  442|     39|constexpr bool Contains(FormatConversionCharSet set, FormatConversionChar c) {
  443|     39|  return (static_cast<uint64_t>(set) & FormatConversionCharToConvInt(c)) != 0;
  444|     39|}
_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImpl5FlushINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEvPvNS4_17basic_string_viewIcS7_EE:
   57|     84|  static void Flush(void* r, string_view s) {
   58|     84|    str_format_internal::InvokeFlush(static_cast<T*>(r), s);
   59|     84|  }
_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImpl7ExtractINS0_13FormatRawSinkEEES2_T_:
   51|     84|  static FormatRawSinkImpl Extract(T s) {
   52|     84|    return s.sink_;
   53|     84|  }
_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImplC2INSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETnPDTclsr19str_format_internalE11InvokeFlushclsr3stdE7declvalIPT_EEcvNS4_17basic_string_viewIcS7_EE_EEELPv0EEESC_:
   46|     84|      : sink_(raw), write_(&FormatRawSinkImpl::Flush<T>) {}
_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImplC2INS1_11FILERawSinkETnPDTclsr19str_format_internalE11InvokeFlushclsr3stdE7declvalIPT_EEcvNSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE_EEELPv0EEES6_:
   46|      3|      : sink_(raw), write_(&FormatRawSinkImpl::Flush<T>) {}
_ZN4absl12lts_2026052619str_format_internal17FormatRawSinkImpl5FlushINS1_11FILERawSinkEEEvPvNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEE:
   57|      3|  static void Flush(void* r, string_view s) {
   58|      3|    str_format_internal::InvokeFlush(static_cast<T*>(r), s);
   59|      3|  }

_ZN4absl12lts_2026052619str_format_internal11FILERawSink5WriteENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   44|      3|void FILERawSink::Write(string_view v) {
   45|      6|  while (!v.empty() && !error_) {
  ------------------
  |  Branch (45:10): [True: 3, False: 3]
  |  Branch (45:24): [True: 3, False: 0]
  ------------------
   46|       |    // Reset errno to zero in case the libc implementation doesn't set errno
   47|       |    // when a failure occurs.
   48|      3|    ClearErrnoGuard guard;
   49|       |
   50|      3|    if (size_t result = std::fwrite(v.data(), 1, v.size(), output_)) {
  ------------------
  |  Branch (50:16): [True: 3, False: 0]
  ------------------
   51|       |      // Some progress was made.
   52|      3|      count_ += result;
   53|      3|      v.remove_prefix(result);
   54|      3|    } else {
   55|      0|      if (errno == EINTR) {
  ------------------
  |  Branch (55:11): [True: 0, False: 0]
  ------------------
   56|      0|        continue;
   57|      0|      } else if (errno) {
  ------------------
  |  Branch (57:18): [True: 0, False: 0]
  ------------------
   58|      0|        error_ = errno;
   59|      0|      } else if (std::ferror(output_)) {
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|       |        // Non-POSIX compliant libc implementations may not set errno, so we
   61|       |        // have check the streams error indicator.
   62|      0|        error_ = EBADF;
   63|      0|      } else {
   64|       |        // We're likely on a non-POSIX system that encountered EINTR but had no
   65|       |        // way of reporting it.
   66|      0|        continue;
   67|      0|      }
   68|      0|    }
   69|      3|  }
   70|      3|}
output.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_115ClearErrnoGuardC2Ev:
   26|      3|  ClearErrnoGuard() : old_value(errno) { errno = 0; }
output.cc:_ZN4absl12lts_2026052619str_format_internal12_GLOBAL__N_115ClearErrnoGuardD2Ev:
   27|      3|  ~ClearErrnoGuard() {
   28|      3|    if (!errno) errno = old_value;
  ------------------
  |  Branch (28:9): [True: 3, False: 0]
  ------------------
   29|      3|  }

_ZN4absl12lts_2026052619str_format_internal11FILERawSinkC2EP8_IO_FILE:
   57|      3|  explicit FILERawSink(std::FILE* output) : output_(output) {}
_ZNK4absl12lts_2026052619str_format_internal11FILERawSink5countEv:
   61|      6|  size_t count() const { return count_; }
_ZNK4absl12lts_2026052619str_format_internal11FILERawSink5errorEv:
   62|      3|  int error() const { return error_; }
_ZN4absl12lts_2026052619str_format_internal15AbslFormatFlushEPNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EE:
   71|     84|inline void AbslFormatFlush(std::string* out, string_view s) {
   72|     84|  out->append(s.data(), s.size());
   73|     84|}
_ZN4absl12lts_2026052619str_format_internal15AbslFormatFlushEPNS1_11FILERawSinkENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
   78|      3|inline void AbslFormatFlush(FILERawSink* sink, string_view v) {
   79|      3|  sink->Write(v);
   80|      3|}
_ZN4absl12lts_2026052619str_format_internal11InvokeFlushINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEDTcl15AbslFormatFlushfp_fp0_EEPT_NS3_17basic_string_viewIcS6_EE:
   89|     84|auto InvokeFlush(T* out, string_view s) -> decltype(AbslFormatFlush(out, s)) {
   90|     84|  AbslFormatFlush(out, s);
   91|     84|}
_ZN4absl12lts_2026052619str_format_internal11InvokeFlushINS1_11FILERawSinkEEEDTcl15AbslFormatFlushfp_fp0_EEPT_NSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE:
   89|      3|auto InvokeFlush(T* out, string_view s) -> decltype(AbslFormatFlush(out, s)) {
   90|      3|  AbslFormatFlush(out, s);
   91|      3|}

bind.cc:_ZN4absl12lts_2026052619str_format_internal17ParseFormatStringINS1_12_GLOBAL__N_117ConverterConsumerINS3_16DefaultConverterEEEEEbNSt3__117basic_string_viewIcNS7_11char_traitsIcEEEET_:
   57|     87|bool ParseFormatString(string_view src, Consumer consumer) {
   58|     87|  int next_arg = 0;
   59|     87|  const char* p = src.data();
   60|     87|  const char* const end = p + src.size();
   61|    126|  while (p != end) {
  ------------------
  |  Branch (61:10): [True: 87, False: 39]
  ------------------
   62|     87|    const char* percent =
   63|     87|        static_cast<const char*>(memchr(p, '%', static_cast<size_t>(end - p)));
   64|     87|    if (!percent) {
  ------------------
  |  Branch (64:9): [True: 48, False: 39]
  ------------------
   65|       |      // We found the last substring.
   66|     48|      return consumer.Append(string_view(p, static_cast<size_t>(end - p)));
   67|     48|    }
   68|       |    // We found a percent, so push the text run then process the percent.
   69|     39|    if (ABSL_PREDICT_FALSE(!consumer.Append(
  ------------------
  |  |  190|     39|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 39]
  |  |  |  Branch (190:49): [Folded, False: 39]
  |  |  |  Branch (190:58): [True: 0, False: 39]
  |  |  ------------------
  ------------------
   70|     39|            string_view(p, static_cast<size_t>(percent - p))))) {
   71|      0|      return false;
   72|      0|    }
   73|     39|    if (ABSL_PREDICT_FALSE(percent + 1 >= end)) return false;
  ------------------
  |  |  190|     39|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 39]
  |  |  |  Branch (190:49): [Folded, False: 39]
  |  |  |  Branch (190:58): [True: 0, False: 39]
  |  |  ------------------
  ------------------
   74|       |
   75|     39|    auto tag = GetTagForChar(percent[1]);
   76|     39|    if (tag.is_conv()) {
  ------------------
  |  Branch (76:9): [True: 39, False: 0]
  ------------------
   77|     39|      if (ABSL_PREDICT_FALSE(next_arg < 0)) {
  ------------------
  |  |  190|     39|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 39]
  |  |  |  Branch (190:49): [Folded, False: 39]
  |  |  |  Branch (190:58): [True: 0, False: 39]
  |  |  ------------------
  ------------------
   78|       |        // This indicates an error in the format string.
   79|       |        // The only way to get `next_arg < 0` here is to have a positional
   80|       |        // argument first which sets next_arg to -1 and then a non-positional
   81|       |        // argument.
   82|      0|        return false;
   83|      0|      }
   84|     39|      p = percent + 2;
   85|       |
   86|       |      // Keep this case separate from the one below.
   87|       |      // ConvertOne is more efficient when the compiler can see that the `basic`
   88|       |      // flag is set.
   89|     39|      UnboundConversion conv;
   90|     39|      conv.conv = tag.as_conv();
   91|     39|      conv.arg_position = ++next_arg;
   92|     39|      if (ABSL_PREDICT_FALSE(
  ------------------
  |  |  190|     39|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 39]
  |  |  |  Branch (190:49): [Folded, False: 39]
  |  |  |  Branch (190:58): [True: 0, False: 39]
  |  |  ------------------
  ------------------
   93|     39|              !consumer.ConvertOne(conv, string_view(percent + 1, 1)))) {
   94|      0|        return false;
   95|      0|      }
   96|     39|    } else if (percent[1] != '%') {
  ------------------
  |  Branch (96:16): [True: 0, False: 0]
  ------------------
   97|      0|      UnboundConversion conv;
   98|      0|      p = ConsumeUnboundConversionNoInline(percent + 1, end, &conv, &next_arg);
   99|      0|      if (ABSL_PREDICT_FALSE(p == nullptr)) return false;
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  100|      0|      if (ABSL_PREDICT_FALSE(!consumer.ConvertOne(
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  101|      0|              conv, string_view(percent + 1,
  102|      0|                                static_cast<size_t>(p - (percent + 1)))))) {
  103|      0|        return false;
  104|      0|      }
  105|      0|    } else {
  106|      0|      if (ABSL_PREDICT_FALSE(!consumer.Append("%"))) return false;
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  107|      0|      p = percent + 2;
  108|      0|      continue;
  109|      0|    }
  110|     39|  }
  111|     39|  return true;
  112|     87|}

_ZN4absl12lts_2026052611StrContainsENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   47|      2|                        absl::string_view needle) noexcept {
   48|      2|  return haystack.find(needle, 0) != haystack.npos;
   49|      2|}
_ZN4absl12lts_2026052610StartsWithENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   59|     12|                                 absl::string_view prefix) noexcept {
   60|     12|  if (prefix.empty()) {
  ------------------
  |  Branch (60:7): [True: 0, False: 12]
  ------------------
   61|      0|    return true;
   62|      0|  }
   63|     12|  if (text.size() < prefix.size()) {
  ------------------
  |  Branch (63:7): [True: 0, False: 12]
  ------------------
   64|      0|    return false;
   65|      0|  }
   66|     12|  absl::string_view possible_match = text.substr(0, prefix.size());
   67|       |
   68|     12|  return possible_match == prefix;
   69|     12|}

_ZN4absl12lts_2026052610SimpleAtodENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPd:
   86|  22.7k|bool SimpleAtod(absl::string_view str, double* absl_nonnull out) {
   87|  22.7k|  *out = 0.0;
   88|  22.7k|  str = StripAsciiWhitespace(str);
   89|  22.7k|  if (str.empty()) {
  ------------------
  |  Branch (89:7): [True: 5, False: 22.7k]
  ------------------
   90|       |    // absl::from_chars doesn't accept empty strings.
   91|      5|    return false;
   92|      5|  }
   93|       |  // std::from_chars doesn't accept an initial +, but SimpleAtod does, so if one
   94|       |  // is present, skip it, while avoiding accepting "+-0" as valid.
   95|  22.7k|  if (str[0] == '+') {
  ------------------
  |  Branch (95:7): [True: 216, False: 22.5k]
  ------------------
   96|    216|    str.remove_prefix(1);
   97|    216|    if (str.empty() || str[0] == '-') {
  ------------------
  |  Branch (97:9): [True: 1, False: 215]
  |  Branch (97:24): [True: 1, False: 214]
  ------------------
   98|      2|      return false;
   99|      2|    }
  100|    216|  }
  101|  22.7k|  auto result = absl::from_chars(str.data(), str.data() + str.size(), *out);
  102|  22.7k|  if (result.ec == std::errc::invalid_argument) {
  ------------------
  |  Branch (102:7): [True: 70, False: 22.7k]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|  22.7k|  if (result.ptr != str.data() + str.size()) {
  ------------------
  |  Branch (105:7): [True: 121, False: 22.5k]
  ------------------
  106|       |    // not all non-whitespace characters consumed
  107|    121|    return false;
  108|    121|  }
  109|       |  // from_chars() with DR 3081's current wording will return max() on
  110|       |  // overflow.  SimpleAtod returns infinity instead.
  111|  22.5k|  if (result.ec == std::errc::result_out_of_range) {
  ------------------
  |  Branch (111:7): [True: 3.63k, False: 18.9k]
  ------------------
  112|  3.63k|    if (*out > 1.0) {
  ------------------
  |  Branch (112:9): [True: 2.07k, False: 1.56k]
  ------------------
  113|  2.07k|      *out = std::numeric_limits<double>::infinity();
  114|  2.07k|    } else if (*out < -1.0) {
  ------------------
  |  Branch (114:16): [True: 343, False: 1.21k]
  ------------------
  115|    343|      *out = -std::numeric_limits<double>::infinity();
  116|    343|    }
  117|  3.63k|  }
  118|  22.5k|  return true;
  119|  22.7k|}
_ZN4absl12lts_2026052616numbers_internal12PutTwoDigitsEjPc:
  332|     62|void numbers_internal::PutTwoDigits(uint32_t i, char* absl_nonnull buf) {
  333|       |  assert(i < 100);
  334|     62|  uint32_t base = kTwoZeroBytes;
  335|     62|  uint32_t div10 = (i * kDivisionBy10Mul) / kDivisionBy10Div;
  336|     62|  uint32_t mod10 = i - 10u * div10;
  337|     62|  base += div10 + (mod10 << 8);
  338|     62|  little_endian::Store16(buf, static_cast<uint16_t>(base));
  339|     62|}
_ZN4absl12lts_2026052616numbers_internal15FastIntToBufferEiPc:
  349|      3|    int32_t i, char* absl_nonnull buffer) {
  350|      3|  uint32_t u = static_cast<uint32_t>(i);
  351|      3|  if (i < 0) {
  ------------------
  |  Branch (351:7): [True: 0, False: 3]
  ------------------
  352|      0|    *buffer++ = '-';
  353|       |    // We need to do the negation in modular (i.e., "unsigned")
  354|       |    // arithmetic; MSVC++ apparently warns for plain "-u", so
  355|       |    // we write the equivalent expression "0 - u" instead.
  356|      0|    u = 0 - u;
  357|      0|  }
  358|      3|  buffer = EncodeFullU32(u, buffer);
  359|      3|  *buffer = '\0';
  360|      3|  return buffer;
  361|      3|}
_ZN4absl12lts_2026052616numbers_internal15FastIntToBufferEmPc:
  364|      4|    uint64_t i, char* absl_nonnull buffer) {
  365|      4|  buffer = EncodeFullU64(i, buffer);
  366|      4|  *buffer = '\0';
  367|      4|  return buffer;
  368|      4|}
_ZN4absl12lts_2026052616numbers_internal18safe_strtou64_baseENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPmi:
 1625|    850|                        int base) {
 1626|    850|  return safe_uint_internal<uint64_t>(text, value, base);
 1627|    850|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113EncodeFullU32EjPc:
  259|      7|    uint32_t n, char* absl_nonnull out_str) {
  260|      7|  if (n < 10) {
  ------------------
  |  Branch (260:7): [True: 0, False: 7]
  ------------------
  261|      0|    *out_str = static_cast<char>('0' + n);
  262|      0|    return out_str + 1;
  263|      0|  }
  264|      7|  if (n < 100'000'000) {
  ------------------
  |  Branch (264:7): [True: 7, False: 0]
  ------------------
  265|      7|    uint64_t bottom = PrepareEightDigits(n);
  266|      7|    ABSL_ASSUME(bottom != 0);
  ------------------
  |  |  271|      7|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  267|       |    // 0 minus 8 to make MSVC happy.
  268|      7|    uint32_t zeroes =
  269|      7|        static_cast<uint32_t>(absl::countr_zero(bottom)) & (0 - 8u);
  270|      7|    little_endian::Store64(out_str, (bottom + kEightZeroBytes) >> zeroes);
  271|      7|    return out_str + sizeof(bottom) - zeroes / 8;
  272|      7|  }
  273|      0|  uint32_t div08 = n / 100'000'000;
  274|      0|  uint32_t mod08 = n % 100'000'000;
  275|      0|  uint64_t bottom = PrepareEightDigits(mod08) + kEightZeroBytes;
  276|      0|  out_str = EncodeHundred(div08, out_str);
  277|      0|  little_endian::Store64(out_str, bottom);
  278|      0|  return out_str + sizeof(bottom);
  279|      7|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_118PrepareEightDigitsEj:
  230|      7|inline uint64_t PrepareEightDigits(uint32_t i) {
  231|      7|  ABSL_ASSUME(i < 10000'0000);
  ------------------
  |  |  271|      7|#define ABSL_ASSUME(cond) __builtin_assume(cond)
  ------------------
  232|       |  // Prepare 2 blocks of 4 digits "in parallel".
  233|      7|  uint32_t hi = i / 10000;
  234|      7|  uint32_t lo = i % 10000;
  235|      7|  uint64_t merged = hi | (uint64_t{lo} << 32);
  236|      7|  uint64_t div100 = ((merged * kDivisionBy100Mul) / kDivisionBy100Div) &
  237|      7|                    ((0x7Full << 32) | 0x7Full);
  238|      7|  uint64_t mod100 = merged - 100ull * div100;
  239|      7|  uint64_t hundreds = (mod100 << 16) + div100;
  240|      7|  uint64_t tens = (hundreds * kDivisionBy10Mul) / kDivisionBy10Div;
  241|      7|  tens &= (0xFull << 48) | (0xFull << 32) | (0xFull << 16) | 0xFull;
  242|      7|  tens += (hundreds - 10ull * tens) << 8;
  243|      7|  return tens;
  244|      7|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_113EncodeFullU64EmPc:
  282|      4|    uint64_t i, char* absl_nonnull buffer) {
  283|      4|  if (i <= std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (283:7): [True: 4, False: 0]
  ------------------
  284|      4|    return EncodeFullU32(static_cast<uint32_t>(i), buffer);
  285|      4|  }
  286|      0|  uint32_t mod08;
  287|      0|  if (i < 1'0000'0000'0000'0000ull) {
  ------------------
  |  Branch (287:7): [True: 0, False: 0]
  ------------------
  288|      0|    uint32_t div08 = static_cast<uint32_t>(i / 100'000'000ull);
  289|      0|    mod08 = static_cast<uint32_t>(i % 100'000'000ull);
  290|      0|    buffer = EncodeFullU32(div08, buffer);
  291|      0|  } else {
  292|      0|    uint64_t div08 = i / 100'000'000ull;
  293|      0|    mod08 = static_cast<uint32_t>(i % 100'000'000ull);
  294|      0|    uint32_t div016 = static_cast<uint32_t>(div08 / 100'000'000ull);
  295|      0|    uint32_t div08mod08 = static_cast<uint32_t>(div08 % 100'000'000ull);
  296|      0|    uint64_t mid_result = PrepareEightDigits(div08mod08) + kEightZeroBytes;
  297|      0|    buffer = EncodeTenThousand(div016, buffer);
  298|      0|    little_endian::Store64(buffer, mid_result);
  299|      0|    buffer += sizeof(mid_result);
  300|      0|  }
  301|      0|  uint64_t mod_result = PrepareEightDigits(mod08) + kEightZeroBytes;
  302|      0|  little_endian::Store64(buffer, mod_result);
  303|      0|  return buffer + sizeof(mod_result);
  304|      4|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_124safe_parse_sign_and_baseEPNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPiPb:
 1168|    850|    bool* absl_nonnull negative_ptr /*output*/) {
 1169|    850|  if (text->data() == nullptr) {
  ------------------
  |  Branch (1169:7): [True: 0, False: 850]
  ------------------
 1170|      0|    return false;
 1171|      0|  }
 1172|       |
 1173|    850|  const char* start = text->data();
 1174|    850|  const char* end = start + text->size();
 1175|    850|  int base = *base_ptr;
 1176|       |
 1177|       |  // Consume whitespace.
 1178|    850|  while (start < end &&
  ------------------
  |  Branch (1178:10): [True: 845, False: 5]
  ------------------
 1179|    845|         absl::ascii_isspace(static_cast<unsigned char>(start[0]))) {
  ------------------
  |  Branch (1179:10): [True: 0, False: 845]
  ------------------
 1180|      0|    ++start;
 1181|      0|  }
 1182|  1.04k|  while (start < end &&
  ------------------
  |  Branch (1182:10): [True: 1.03k, False: 5]
  ------------------
 1183|  1.03k|         absl::ascii_isspace(static_cast<unsigned char>(end[-1]))) {
  ------------------
  |  Branch (1183:10): [True: 194, False: 845]
  ------------------
 1184|    194|    --end;
 1185|    194|  }
 1186|    850|  if (start >= end) {
  ------------------
  |  Branch (1186:7): [True: 5, False: 845]
  ------------------
 1187|      5|    return false;
 1188|      5|  }
 1189|       |
 1190|       |  // Consume sign.
 1191|    845|  *negative_ptr = (start[0] == '-');
 1192|    845|  if (*negative_ptr || start[0] == '+') {
  ------------------
  |  Branch (1192:7): [True: 2, False: 843]
  |  Branch (1192:24): [True: 261, False: 582]
  ------------------
 1193|    263|    ++start;
 1194|    263|    if (start >= end) {
  ------------------
  |  Branch (1194:9): [True: 7, False: 256]
  ------------------
 1195|      7|      return false;
 1196|      7|    }
 1197|    263|  }
 1198|       |
 1199|       |  // Consume base-dependent prefix.
 1200|       |  //  base 0: "0x" -> base 16, "0" -> base 8, default -> base 10
 1201|       |  //  base 16: "0x" -> base 16
 1202|       |  // Also validate the base.
 1203|    838|  if (base == 0) {
  ------------------
  |  Branch (1203:7): [True: 0, False: 838]
  ------------------
 1204|      0|    if (end - start >= 2 && start[0] == '0' &&
  ------------------
  |  Branch (1204:9): [True: 0, False: 0]
  |  Branch (1204:29): [True: 0, False: 0]
  ------------------
 1205|      0|        (start[1] == 'x' || start[1] == 'X')) {
  ------------------
  |  Branch (1205:10): [True: 0, False: 0]
  |  Branch (1205:29): [True: 0, False: 0]
  ------------------
 1206|      0|      base = 16;
 1207|      0|      start += 2;
 1208|      0|      if (start >= end) {
  ------------------
  |  Branch (1208:11): [True: 0, False: 0]
  ------------------
 1209|       |        // "0x" with no digits after is invalid.
 1210|      0|        return false;
 1211|      0|      }
 1212|      0|    } else if (end - start >= 1 && start[0] == '0') {
  ------------------
  |  Branch (1212:16): [True: 0, False: 0]
  |  Branch (1212:36): [True: 0, False: 0]
  ------------------
 1213|      0|      base = 8;
 1214|      0|      start += 1;
 1215|      0|    } else {
 1216|      0|      base = 10;
 1217|      0|    }
 1218|    838|  } else if (base == 16) {
  ------------------
  |  Branch (1218:14): [True: 0, False: 838]
  ------------------
 1219|      0|    if (end - start >= 2 && start[0] == '0' &&
  ------------------
  |  Branch (1219:9): [True: 0, False: 0]
  |  Branch (1219:29): [True: 0, False: 0]
  ------------------
 1220|      0|        (start[1] == 'x' || start[1] == 'X')) {
  ------------------
  |  Branch (1220:10): [True: 0, False: 0]
  |  Branch (1220:29): [True: 0, False: 0]
  ------------------
 1221|      0|      start += 2;
 1222|      0|      if (start >= end) {
  ------------------
  |  Branch (1222:11): [True: 0, False: 0]
  ------------------
 1223|       |        // "0x" with no digits after is invalid.
 1224|      0|        return false;
 1225|      0|      }
 1226|      0|    }
 1227|    838|  } else if (base >= 2 && base <= 36) {
  ------------------
  |  Branch (1227:14): [True: 838, False: 0]
  |  Branch (1227:27): [True: 838, False: 0]
  ------------------
 1228|       |    // okay
 1229|    838|  } else {
 1230|      0|    return false;
 1231|      0|  }
 1232|    838|  *text = absl::string_view(start, static_cast<size_t>(end - start));
 1233|    838|  *base_ptr = base;
 1234|    838|  return true;
 1235|    838|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_118safe_uint_internalImEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPT_i:
 1550|    850|                               IntType* absl_nonnull value_p, int base) {
 1551|    850|  *value_p = 0;
 1552|    850|  bool negative;
 1553|    850|  if (!safe_parse_sign_and_base(&text, &base, &negative) || negative) {
  ------------------
  |  Branch (1553:7): [True: 12, False: 838]
  |  Branch (1553:61): [True: 2, False: 836]
  ------------------
 1554|     14|    return false;
 1555|     14|  }
 1556|    836|  return safe_parse_positive_int(text, base, value_p);
 1557|    850|}
numbers.cc:_ZN4absl12lts_2026052612_GLOBAL__N_123safe_parse_positive_intImEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEiPT_:
 1453|    836|                                    IntType* absl_nonnull value_p) {
 1454|    836|  IntType value = 0;
 1455|    836|  const IntType vmax = std::numeric_limits<IntType>::max();
 1456|    836|  assert(vmax > 0);
 1457|    836|  assert(base >= 0);
 1458|    836|  const IntType base_inttype = static_cast<IntType>(base);
 1459|    836|  assert(vmax >= base_inttype);
 1460|    836|  const IntType vmax_over_base = LookupTables<IntType>::kVmaxOverBase[base];
 1461|    836|  assert(base < 2 ||
 1462|    836|         std::numeric_limits<IntType>::max() / base_inttype == vmax_over_base);
 1463|    836|  const char* start = text.data();
 1464|    836|  const char* end = start + text.size();
 1465|       |  // loop over digits
 1466|  3.68k|  for (; start < end; ++start) {
  ------------------
  |  Branch (1466:10): [True: 2.91k, False: 766]
  ------------------
 1467|  2.91k|    unsigned char c = static_cast<unsigned char>(start[0]);
 1468|  2.91k|    IntType digit = static_cast<IntType>(kAsciiToInt[c]);
 1469|  2.91k|    if (digit >= base_inttype) {
  ------------------
  |  Branch (1469:9): [True: 17, False: 2.90k]
  ------------------
 1470|     17|      *value_p = value;
 1471|     17|      return false;
 1472|     17|    }
 1473|  2.90k|    if (value > vmax_over_base) {
  ------------------
  |  Branch (1473:9): [True: 52, False: 2.85k]
  ------------------
 1474|     52|      *value_p = vmax;
 1475|     52|      return false;
 1476|     52|    }
 1477|  2.85k|    value *= base_inttype;
 1478|  2.85k|    if (value > vmax - digit) {
  ------------------
  |  Branch (1478:9): [True: 1, False: 2.84k]
  ------------------
 1479|      1|      *value_p = vmax;
 1480|      1|      return false;
 1481|      1|    }
 1482|  2.84k|    value += digit;
 1483|  2.84k|  }
 1484|    766|  *value_p = value;
 1485|    766|  return true;
 1486|    836|}

_ZN4absl12lts_2026052616numbers_internal16safe_strtoi_baseImEEbNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPT_i:
  247|    850|                                    int_type* absl_nonnull out, int base) {
  248|    850|  static_assert(sizeof(*out) == 1 || sizeof(*out) == 2 || sizeof(*out) == 4 ||
  249|    850|                    sizeof(*out) == 8,
  250|    850|                "SimpleAtoi works only with 8, 16, 32, or 64-bit integers.");
  251|    850|  static_assert(!std::is_floating_point<int_type>::value,
  252|    850|                "Use SimpleAtof or SimpleAtod instead.");
  253|    850|  bool parsed;
  254|       |  // These conditions are constexpr bools to suppress MSVC warning C4127.
  255|    850|  constexpr bool kIsSigned = is_signed<int_type>();
  256|    850|  constexpr int kIntTypeSize = sizeof(*out) * 8;
  257|    850|  if (kIsSigned) {
  ------------------
  |  Branch (257:7): [Folded, False: 850]
  ------------------
  258|      0|    if (kIntTypeSize == 64) {
  ------------------
  |  Branch (258:9): [True: 0, Folded]
  ------------------
  259|      0|      int64_t val;
  260|      0|      parsed = numbers_internal::safe_strto64_base(s, &val, base);
  261|      0|      *out = static_cast<int_type>(val);
  262|      0|    } else if (kIntTypeSize == 32) {
  ------------------
  |  Branch (262:16): [Folded, False: 0]
  ------------------
  263|      0|      int32_t val;
  264|      0|      parsed = numbers_internal::safe_strto32_base(s, &val, base);
  265|      0|      *out = static_cast<int_type>(val);
  266|      0|    } else if (kIntTypeSize == 16) {
  ------------------
  |  Branch (266:16): [Folded, False: 0]
  ------------------
  267|      0|      int16_t val;
  268|      0|      parsed = numbers_internal::safe_strto16_base(s, &val, base);
  269|      0|      *out = static_cast<int_type>(val);
  270|      0|    } else if (kIntTypeSize == 8) {
  ------------------
  |  Branch (270:16): [Folded, False: 0]
  ------------------
  271|      0|      int8_t val;
  272|      0|      parsed = numbers_internal::safe_strto8_base(s, &val, base);
  273|      0|      *out = static_cast<int_type>(val);
  274|      0|    }
  275|    850|  } else {
  276|    850|    if (kIntTypeSize == 64) {
  ------------------
  |  Branch (276:9): [True: 850, Folded]
  ------------------
  277|    850|      uint64_t val;
  278|    850|      parsed = numbers_internal::safe_strtou64_base(s, &val, base);
  279|    850|      *out = static_cast<int_type>(val);
  280|    850|    } else if (kIntTypeSize == 32) {
  ------------------
  |  Branch (280:16): [Folded, False: 0]
  ------------------
  281|      0|      uint32_t val;
  282|      0|      parsed = numbers_internal::safe_strtou32_base(s, &val, base);
  283|      0|      *out = static_cast<int_type>(val);
  284|      0|    } else if (kIntTypeSize == 16) {
  ------------------
  |  Branch (284:16): [Folded, False: 0]
  ------------------
  285|      0|      uint16_t val;
  286|      0|      parsed = numbers_internal::safe_strtou16_base(s, &val, base);
  287|      0|      *out = static_cast<int_type>(val);
  288|      0|    } else if (kIntTypeSize == 8) {
  ------------------
  |  Branch (288:16): [Folded, False: 0]
  ------------------
  289|      0|      uint8_t val;
  290|      0|      parsed = numbers_internal::safe_strtou8_base(s, &val, base);
  291|      0|      *out = static_cast<int_type>(val);
  292|      0|    }
  293|    850|  }
  294|    850|  return parsed;
  295|    850|}
_ZN4absl12lts_2026052610SimpleAtoiImEEbNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEPT_:
  330|    848|                              int_type* absl_nonnull out) {
  331|    848|  return numbers_internal::safe_strtoi_base(str, out, 10);
  332|    848|}

escaping.cc:_ZN4absl12lts_2026052624StringResizeAndOverwriteINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEZNS0_12_GLOBAL__N_128Base64EscapeToStringInternalEPKhmbPKcE3$_0EEvRT_NSF_9size_typeET0_:
  186|      2|void StringResizeAndOverwrite(T& str, typename T::size_type n, Op op) {
  187|      2|  strings_internal::StringResizeAndOverwriteImpl(str, n, std::move(op));
  188|       |#if defined(ABSL_HAVE_MEMORY_SANITIZER)
  189|       |  __msan_check_mem_is_initialized(str.data(), str.size());
  190|       |#endif
  191|      2|}
escaping.cc:_ZN4absl12lts_2026052616strings_internal28StringResizeAndOverwriteImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEZNS0_12_GLOBAL__N_128Base64EscapeToStringInternalEPKhmbPKcE3$_0EEvRT_NSG_9size_typeET0_:
  149|      2|void StringResizeAndOverwriteImpl(T& str, typename T::size_type n, Op op) {
  150|       |#ifdef ABSL_INTERNAL_HAS_RESIZE_AND_OVERWRITE
  151|       |  str.resize_and_overwrite(n, std::move(op));
  152|       |#else
  153|       |  if constexpr (strings_internal::
  154|       |                    has__google_nonstandard_backport_resize_and_overwrite<
  155|       |                        T>::value) {
  156|       |    str.__google_nonstandard_backport_resize_and_overwrite(n, std::move(op));
  157|       |  } else if constexpr (strings_internal::has__resize_and_overwrite<T>::value) {
  158|       |    str.__resize_and_overwrite(n, std::move(op));
  159|      2|  } else if constexpr (strings_internal::has__resize_default_init<T>::value) {
  160|      2|    str.__resize_default_init(n);
  161|      2|    str.__resize_default_init(
  162|      2|        static_cast<typename T::size_type>(std::move(op)(str.data(), n)));
  163|       |  } else if constexpr (strings_internal::has_Resize_and_overwrite<T>::value) {
  164|       |    str._Resize_and_overwrite(n, std::move(op));
  165|       |  } else {
  166|       |    strings_internal::StringResizeAndOverwriteFallback(str, n, std::move(op));
  167|       |  }
  168|      2|#endif
  169|      2|}
str_cat.cc:_ZN4absl12lts_2026052624StringResizeAndOverwriteINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESB_E3$_0EEvRT_NSD_9size_typeET0_:
  186|      3|void StringResizeAndOverwrite(T& str, typename T::size_type n, Op op) {
  187|      3|  strings_internal::StringResizeAndOverwriteImpl(str, n, std::move(op));
  188|       |#if defined(ABSL_HAVE_MEMORY_SANITIZER)
  189|       |  __msan_check_mem_is_initialized(str.data(), str.size());
  190|       |#endif
  191|      3|}
str_cat.cc:_ZN4absl12lts_2026052616strings_internal28StringResizeAndOverwriteImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESC_E3$_0EEvRT_NSE_9size_typeET0_:
  149|      3|void StringResizeAndOverwriteImpl(T& str, typename T::size_type n, Op op) {
  150|       |#ifdef ABSL_INTERNAL_HAS_RESIZE_AND_OVERWRITE
  151|       |  str.resize_and_overwrite(n, std::move(op));
  152|       |#else
  153|       |  if constexpr (strings_internal::
  154|       |                    has__google_nonstandard_backport_resize_and_overwrite<
  155|       |                        T>::value) {
  156|       |    str.__google_nonstandard_backport_resize_and_overwrite(n, std::move(op));
  157|       |  } else if constexpr (strings_internal::has__resize_and_overwrite<T>::value) {
  158|       |    str.__resize_and_overwrite(n, std::move(op));
  159|      3|  } else if constexpr (strings_internal::has__resize_default_init<T>::value) {
  160|      3|    str.__resize_default_init(n);
  161|      3|    str.__resize_default_init(
  162|      3|        static_cast<typename T::size_type>(std::move(op)(str.data(), n)));
  163|       |  } else if constexpr (strings_internal::has_Resize_and_overwrite<T>::value) {
  164|       |    str._Resize_and_overwrite(n, std::move(op));
  165|       |  } else {
  166|       |    strings_internal::StringResizeAndOverwriteFallback(str, n, std::move(op));
  167|       |  }
  168|      3|#endif
  169|      3|}
str_cat.cc:_ZN4absl12lts_2026052624StringResizeAndOverwriteINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESB_SB_E3$_0EEvRT_NSD_9size_typeET0_:
  186|    129|void StringResizeAndOverwrite(T& str, typename T::size_type n, Op op) {
  187|    129|  strings_internal::StringResizeAndOverwriteImpl(str, n, std::move(op));
  188|       |#if defined(ABSL_HAVE_MEMORY_SANITIZER)
  189|       |  __msan_check_mem_is_initialized(str.data(), str.size());
  190|       |#endif
  191|    129|}
str_cat.cc:_ZN4absl12lts_2026052616strings_internal28StringResizeAndOverwriteImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESC_SC_E3$_0EEvRT_NSE_9size_typeET0_:
  149|    129|void StringResizeAndOverwriteImpl(T& str, typename T::size_type n, Op op) {
  150|       |#ifdef ABSL_INTERNAL_HAS_RESIZE_AND_OVERWRITE
  151|       |  str.resize_and_overwrite(n, std::move(op));
  152|       |#else
  153|       |  if constexpr (strings_internal::
  154|       |                    has__google_nonstandard_backport_resize_and_overwrite<
  155|       |                        T>::value) {
  156|       |    str.__google_nonstandard_backport_resize_and_overwrite(n, std::move(op));
  157|       |  } else if constexpr (strings_internal::has__resize_and_overwrite<T>::value) {
  158|       |    str.__resize_and_overwrite(n, std::move(op));
  159|    129|  } else if constexpr (strings_internal::has__resize_default_init<T>::value) {
  160|    129|    str.__resize_default_init(n);
  161|    129|    str.__resize_default_init(
  162|    129|        static_cast<typename T::size_type>(std::move(op)(str.data(), n)));
  163|       |  } else if constexpr (strings_internal::has_Resize_and_overwrite<T>::value) {
  164|       |    str._Resize_and_overwrite(n, std::move(op));
  165|       |  } else {
  166|       |    strings_internal::StringResizeAndOverwriteFallback(str, n, std::move(op));
  167|       |  }
  168|    129|#endif
  169|    129|}
str_cat.cc:_ZN4absl12lts_2026052624StringResizeAndOverwriteINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESB_SB_SB_E3$_0EEvRT_NSD_9size_typeET0_:
  186|      2|void StringResizeAndOverwrite(T& str, typename T::size_type n, Op op) {
  187|      2|  strings_internal::StringResizeAndOverwriteImpl(str, n, std::move(op));
  188|       |#if defined(ABSL_HAVE_MEMORY_SANITIZER)
  189|       |  __msan_check_mem_is_initialized(str.data(), str.size());
  190|       |#endif
  191|      2|}
str_cat.cc:_ZN4absl12lts_2026052616strings_internal28StringResizeAndOverwriteImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEZNS0_6StrCatERKNS0_8AlphaNumESC_SC_SC_E3$_0EEvRT_NSE_9size_typeET0_:
  149|      2|void StringResizeAndOverwriteImpl(T& str, typename T::size_type n, Op op) {
  150|       |#ifdef ABSL_INTERNAL_HAS_RESIZE_AND_OVERWRITE
  151|       |  str.resize_and_overwrite(n, std::move(op));
  152|       |#else
  153|       |  if constexpr (strings_internal::
  154|       |                    has__google_nonstandard_backport_resize_and_overwrite<
  155|       |                        T>::value) {
  156|       |    str.__google_nonstandard_backport_resize_and_overwrite(n, std::move(op));
  157|       |  } else if constexpr (strings_internal::has__resize_and_overwrite<T>::value) {
  158|       |    str.__resize_and_overwrite(n, std::move(op));
  159|      2|  } else if constexpr (strings_internal::has__resize_default_init<T>::value) {
  160|      2|    str.__resize_default_init(n);
  161|      2|    str.__resize_default_init(
  162|      2|        static_cast<typename T::size_type>(std::move(op)(str.data(), n)));
  163|       |  } else if constexpr (strings_internal::has_Resize_and_overwrite<T>::value) {
  164|       |    str._Resize_and_overwrite(n, std::move(op));
  165|       |  } else {
  166|       |    strings_internal::StringResizeAndOverwriteFallback(str, n, std::move(op));
  167|       |  }
  168|      2|#endif
  169|      2|}

_ZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_:
   58|      3|std::string StrCat(const AlphaNum& a, const AlphaNum& b) {
   59|      3|  std::string result;
   60|       |  // Use uint64_t to prevent size_t overflow. We assume it is not possible for
   61|       |  // in memory strings to overflow a uint64_t.
   62|      3|  constexpr uint64_t kMaxSize = uint64_t{std::numeric_limits<size_t>::max()};
   63|      3|  const uint64_t result_size =
   64|      3|      static_cast<uint64_t>(a.size()) + static_cast<uint64_t>(b.size());
   65|      3|  ABSL_INTERNAL_CHECK(result_size <= kMaxSize, "size_t overflow");
  ------------------
  |  |   85|      3|  do {                                                             \
  |  |   86|      3|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      3|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 3]
  |  |  |  |  |  Branch (190:49): [Folded, False: 3]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      3|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 3]
  |  |  ------------------
  ------------------
   66|      3|  absl::StringResizeAndOverwrite(result, static_cast<size_t>(result_size),
   67|      3|                                 [&a, &b](char* const begin, size_t buf_size) {
   68|      3|                                   char* out = begin;
   69|      3|                                   out = Append(out, a);
   70|      3|                                   out = Append(out, b);
   71|      3|                                   assert(out == begin + buf_size);
   72|      3|                                   return buf_size;
   73|      3|                                 });
   74|      3|  return result;
   75|      3|}
_ZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_S3_:
   77|    129|std::string StrCat(const AlphaNum& a, const AlphaNum& b, const AlphaNum& c) {
   78|    129|  std::string result;
   79|       |  // Use uint64_t to prevent size_t overflow. We assume it is not possible for
   80|       |  // in memory strings to overflow a uint64_t.
   81|    129|  constexpr uint64_t kMaxSize = uint64_t{std::numeric_limits<size_t>::max()};
   82|    129|  const uint64_t result_size = static_cast<uint64_t>(a.size()) +
   83|    129|                               static_cast<uint64_t>(b.size()) +
   84|    129|                               static_cast<uint64_t>(c.size());
   85|    129|  ABSL_INTERNAL_CHECK(result_size <= kMaxSize, "size_t overflow");
  ------------------
  |  |   85|    129|  do {                                                             \
  |  |   86|    129|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|    129|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 129]
  |  |  |  |  |  Branch (190:49): [Folded, False: 129]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|    129|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 129]
  |  |  ------------------
  ------------------
   86|    129|  absl::StringResizeAndOverwrite(
   87|    129|      result, static_cast<size_t>(result_size),
   88|    129|      [&a, &b, &c](char* const begin, size_t buf_size) {
   89|    129|        char* out = begin;
   90|    129|        out = Append(out, a);
   91|    129|        out = Append(out, b);
   92|    129|        out = Append(out, c);
   93|    129|        assert(out == begin + buf_size);
   94|    129|        return buf_size;
   95|    129|      });
   96|    129|  return result;
   97|    129|}
_ZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_S3_S3_:
  100|      2|                   const AlphaNum& d) {
  101|      2|  std::string result;
  102|       |  // Use uint64_t to prevent size_t overflow. We assume it is not possible for
  103|       |  // in memory strings to overflow a uint64_t.
  104|      2|  constexpr uint64_t kMaxSize = uint64_t{std::numeric_limits<size_t>::max()};
  105|      2|  const uint64_t result_size =
  106|      2|      static_cast<uint64_t>(a.size()) + static_cast<uint64_t>(b.size()) +
  107|      2|      static_cast<uint64_t>(c.size()) + static_cast<uint64_t>(d.size());
  108|      2|  ABSL_INTERNAL_CHECK(result_size <= kMaxSize, "size_t overflow");
  ------------------
  |  |   85|      2|  do {                                                             \
  |  |   86|      2|    if (ABSL_PREDICT_FALSE(!(condition))) {                        \
  |  |  ------------------
  |  |  |  |  190|      2|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 2]
  |  |  |  |  |  Branch (190:49): [Folded, False: 2]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   87|      0|      std::string death_message = "Check " #condition " failed: "; \
  |  |   88|      0|      death_message += std::string(message);                       \
  |  |   89|      0|      ABSL_INTERNAL_LOG(FATAL, death_message);                     \
  |  |  ------------------
  |  |  |  |   76|      0|  do {                                                                    \
  |  |  |  |   77|      0|    constexpr const char* absl_raw_log_internal_filename = __FILE__;      \
  |  |  |  |   78|      0|    ::absl::raw_log_internal::internal_log_function(                      \
  |  |  |  |   79|      0|        ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        __LINE__, message);                                               \
  |  |  |  |   81|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   82|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    }                                                              \
  |  |   91|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (91:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  109|      2|  absl::StringResizeAndOverwrite(
  110|      2|      result, static_cast<size_t>(result_size),
  111|      2|      [&a, &b, &c, &d](char* const begin, size_t buf_size) {
  112|      2|        char* out = begin;
  113|      2|        out = Append(out, a);
  114|      2|        out = Append(out, b);
  115|      2|        out = Append(out, c);
  116|      2|        out = Append(out, d);
  117|      2|        assert(out == begin + buf_size);
  118|      2|        return buf_size;
  119|      2|      });
  120|      2|  return result;
  121|      2|}
str_cat.cc:_ZZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_ENK3$_0clEPcm:
   67|      3|                                 [&a, &b](char* const begin, size_t buf_size) {
   68|      3|                                   char* out = begin;
   69|      3|                                   out = Append(out, a);
   70|      3|                                   out = Append(out, b);
   71|       |                                   assert(out == begin + buf_size);
   72|      3|                                   return buf_size;
   73|      3|                                 });
str_cat.cc:_ZN4absl12lts_2026052612_GLOBAL__N_16AppendEPcRKNS0_8AlphaNumE:
   46|    401|inline char* absl_nonnull Append(char* absl_nonnull out, const AlphaNum& x) {
   47|       |  // memcpy is allowed to overwrite arbitrary memory, so doing this after the
   48|       |  // call would force an extra fetch of x.size().
   49|    401|  char* after = out + x.size();
   50|    401|  if (x.size() != 0) {
  ------------------
  |  Branch (50:7): [True: 401, False: 0]
  ------------------
   51|    401|    memcpy(out, x.data(), x.size());
   52|    401|  }
   53|    401|  return after;
   54|    401|}
str_cat.cc:_ZZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_S3_ENK3$_0clEPcm:
   88|    129|      [&a, &b, &c](char* const begin, size_t buf_size) {
   89|    129|        char* out = begin;
   90|    129|        out = Append(out, a);
   91|    129|        out = Append(out, b);
   92|    129|        out = Append(out, c);
   93|       |        assert(out == begin + buf_size);
   94|    129|        return buf_size;
   95|    129|      });
str_cat.cc:_ZZN4absl12lts_202605266StrCatERKNS0_8AlphaNumES3_S3_S3_ENK3$_0clEPcm:
  111|      2|      [&a, &b, &c, &d](char* const begin, size_t buf_size) {
  112|      2|        char* out = begin;
  113|      2|        out = Append(out, a);
  114|      2|        out = Append(out, b);
  115|      2|        out = Append(out, c);
  116|      2|        out = Append(out, d);
  117|       |        assert(out == begin + buf_size);
  118|      2|        return buf_size;
  119|      2|      });

_ZN4absl12lts_202605268AlphaNumC2Ei:
  363|      3|      : piece_(digits_, static_cast<size_t>(
  364|      3|                            numbers_internal::FastIntToBuffer(x, digits_) -
  365|      3|                            &digits_[0])) {}
_ZN4absl12lts_202605268AlphaNumC2Em:
  375|      4|      : piece_(digits_, static_cast<size_t>(
  376|      4|                            numbers_internal::FastIntToBuffer(x, digits_) -
  377|      4|                            &digits_[0])) {}
_ZN4absl12lts_202605268AlphaNumC2EPKc:
  400|    140|      : piece_(NullSafeStringView(c_str)) {}
_ZN4absl12lts_202605268AlphaNumC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  403|    230|      : piece_(pc) {}
_ZNK4absl12lts_202605268AlphaNum4sizeEv:
  430|  1.60k|  absl::string_view::size_type size() const { return piece_.size(); }
_ZNK4absl12lts_202605268AlphaNum4dataEv:
  431|    401|  const char* absl_nullable data() const { return piece_.data(); }
_ZN4absl12lts_202605268AlphaNumC2INSt3__19allocatorIcEEEERKNS3_12basic_stringIcNS3_11char_traitsIcEET_EE:
  422|     24|      : piece_(str) {}

_ZN4absl12lts_2026052617UntypedFormatSpecC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  111|     87|  explicit UntypedFormatSpec(string_view s) : spec_(s) {}
_ZN4absl12lts_202605266FormatIJEEEbNS0_13FormatRawSinkERKNS0_19str_format_internal18FormatSpecTemplateIJXspclsr19str_format_internalE14ArgumentToConvIT_EEEEEEDpRKS5_:
  529|     48|            const Args&... args) {
  530|     48|  return str_format_internal::FormatUntyped(
  531|     48|      str_format_internal::FormatRawSinkImpl::Extract(raw_sink),
  532|     48|      str_format_internal::UntypedFormatSpecImpl::Extract(format),
  533|     48|      {str_format_internal::FormatArgImpl(args)...});
  534|     48|}
_ZN4absl12lts_202605267FPrintFIJNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEEiP8_IO_FILERKNS0_19str_format_internal18FormatSpecTemplateIJXspclsr19str_format_internalE14ArgumentToConvIT_EEEEEEDpRKSB_:
  441|      3|            const Args&... args) {
  442|      3|  return str_format_internal::FprintF(
  443|      3|      output, str_format_internal::UntypedFormatSpecImpl::Extract(format),
  444|      3|      {str_format_internal::FormatArgImpl(args)...});
  445|      3|}
_ZN4absl12lts_2026052613FormatRawSinkC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEvEEPT_:
  504|     84|      : sink_(raw) {}
_ZN4absl12lts_202605266FormatIJNS0_7uint128EEEEbNS0_13FormatRawSinkERKNS0_19str_format_internal18FormatSpecTemplateIJXspclsr19str_format_internalE14ArgumentToConvIT_EEEEEEDpRKS6_:
  529|     15|            const Args&... args) {
  530|     15|  return str_format_internal::FormatUntyped(
  531|     15|      str_format_internal::FormatRawSinkImpl::Extract(raw_sink),
  532|     15|      str_format_internal::UntypedFormatSpecImpl::Extract(format),
  533|     15|      {str_format_internal::FormatArgImpl(args)...});
  534|     15|}
_ZN4absl12lts_202605266FormatIJNS0_6int128EEEEbNS0_13FormatRawSinkERKNS0_19str_format_internal18FormatSpecTemplateIJXspclsr19str_format_internalE14ArgumentToConvIT_EEEEEEDpRKS6_:
  529|     21|            const Args&... args) {
  530|     21|  return str_format_internal::FormatUntyped(
  531|     21|      str_format_internal::FormatRawSinkImpl::Extract(raw_sink),
  532|     21|      str_format_internal::UntypedFormatSpecImpl::Extract(format),
  533|     21|      {str_format_internal::FormatArgImpl(args)...});
  534|     21|}

_ZN4absl12lts_2026052618NullSafeStringViewEPKc:
   53|    140|constexpr string_view NullSafeStringView(const char* absl_nullable p) {
   54|    140|  return p ? string_view(p) : string_view();
  ------------------
  |  Branch (54:10): [True: 140, False: 0]
  ------------------
   55|    140|}

_ZN4absl12lts_2026052613ConsumePrefixEPNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   49|     12|                                    absl::string_view expected) {
   50|     12|  if (!absl::StartsWith(*str, expected)) return false;
  ------------------
  |  Branch (50:7): [True: 0, False: 12]
  ------------------
   51|     12|  str->remove_prefix(expected.size());
   52|     12|  return true;
   53|     12|}

_ZN4absl12lts_2026052624synchronization_internal14InvalidGraphIdEv:
   58|    243|inline GraphId InvalidGraphId() {
   59|    243|  return GraphId{0};
   60|    243|}

_ZN4absl12lts_202605265Mutex4lockEv:
 1530|    243|void Mutex::lock() {
 1531|    243|  ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
 1532|    243|  GraphId id = DebugOnlyDeadlockCheck(this);
 1533|    243|  intptr_t v = mu_.load(std::memory_order_relaxed);
 1534|       |  // try fast acquire, then spin loop
 1535|    243|  if (ABSL_PREDICT_FALSE((v & (kMuWriter | kMuReader | kMuEvent)) != 0) ||
  ------------------
  |  |  190|    486|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 243]
  |  |  |  Branch (190:49): [Folded, False: 243]
  |  |  |  Branch (190:58): [True: 0, False: 243]
  |  |  ------------------
  ------------------
 1536|    243|      ABSL_PREDICT_FALSE(!mu_.compare_exchange_strong(
  ------------------
  |  |  190|    243|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 243]
  |  |  |  Branch (190:49): [Folded, False: 243]
  |  |  |  Branch (190:58): [True: 0, False: 243]
  |  |  ------------------
  ------------------
 1537|    243|          v, kMuWriter | v, std::memory_order_acquire,
 1538|    243|          std::memory_order_relaxed))) {
 1539|       |    // try spin acquire, then slow loop
 1540|      0|    if (ABSL_PREDICT_FALSE(!TryAcquireWithSpinning(&this->mu_))) {
  ------------------
  |  |  190|      0|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  ------------------
  |  |  |  Branch (190:31): [True: 0, False: 0]
  |  |  |  Branch (190:49): [Folded, False: 0]
  |  |  |  Branch (190:58): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1541|      0|      this->LockSlow(kExclusive, nullptr, 0);
 1542|      0|    }
 1543|      0|  }
 1544|    243|  DebugOnlyLockEnter(this, id);
 1545|    243|  ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
 1546|    243|}
_ZN4absl12lts_202605265Mutex6unlockEv:
 1708|    243|void Mutex::unlock() {
 1709|    243|  ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0);
 1710|    243|  DebugOnlyLockLeave(this);
 1711|    243|  intptr_t v = mu_.load(std::memory_order_relaxed);
 1712|       |
 1713|    243|  if (kDebugMode && ((v & (kMuWriter | kMuReader)) != kMuWriter)) {
  ------------------
  |  Branch (1713:7): [Folded, False: 243]
  |  Branch (1713:21): [True: 0, False: 0]
  ------------------
 1714|      0|    ABSL_RAW_LOG(FATAL, "Mutex unlocked when destroyed or not locked: v=0x%x",
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1715|      0|                 static_cast<unsigned>(v));
 1716|      0|  }
 1717|       |
 1718|       |  // should_try_cas is whether we'll try a compare-and-swap immediately.
 1719|       |  // NOTE: optimized out when kDebugMode is false.
 1720|    243|  bool should_try_cas = ((v & (kMuEvent | kMuWriter)) == kMuWriter &&
  ------------------
  |  Branch (1720:26): [True: 243, False: 0]
  ------------------
 1721|    243|                         (v & (kMuWait | kMuDesig)) != kMuWait);
  ------------------
  |  Branch (1721:26): [True: 243, False: 0]
  ------------------
 1722|       |
 1723|       |  // But, we can use an alternate computation of it, that compilers
 1724|       |  // currently don't find on their own.  When that changes, this function
 1725|       |  // can be simplified.
 1726|       |  //
 1727|       |  // should_try_cas is true iff the bits satisfy the following conditions:
 1728|       |  //
 1729|       |  //                   Ev Wr Wa De
 1730|       |  // equal to           0  1
 1731|       |  // and not equal to         1  0
 1732|       |  //
 1733|       |  // after xoring by    0  1  0  1,  this is equivalent to:
 1734|       |  //
 1735|       |  // equal to           0  0
 1736|       |  // and not equal to         1  1,  which is the same as:
 1737|       |  //
 1738|       |  // smaller than       0  0  1  1
 1739|    243|  static_assert(kMuEvent > kMuWait, "Needed for should_try_cas_fast");
 1740|    243|  static_assert(kMuEvent > kMuDesig, "Needed for should_try_cas_fast");
 1741|    243|  static_assert(kMuWriter > kMuWait, "Needed for should_try_cas_fast");
 1742|    243|  static_assert(kMuWriter > kMuDesig, "Needed for should_try_cas_fast");
 1743|       |
 1744|    243|  bool should_try_cas_fast =
 1745|    243|      ((v ^ (kMuWriter | kMuDesig)) &
 1746|    243|       (kMuEvent | kMuWriter | kMuWait | kMuDesig)) < (kMuWait | kMuDesig);
 1747|       |
 1748|    243|  if (kDebugMode && should_try_cas != should_try_cas_fast) {
  ------------------
  |  Branch (1748:7): [Folded, False: 243]
  |  Branch (1748:21): [True: 0, False: 0]
  ------------------
 1749|       |    // We would usually use PRIdPTR here, but is not correctly implemented
 1750|       |    // within the android toolchain.
 1751|      0|    ABSL_RAW_LOG(FATAL, "internal logic error %llx %llx %llx\n",
  ------------------
  |  |   45|      0|  do {                                                                         \
  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  ------------------
  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  ------------------
  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  ------------------
  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1752|      0|                 static_cast<long long>(v),
 1753|      0|                 static_cast<long long>(should_try_cas),
 1754|      0|                 static_cast<long long>(should_try_cas_fast));
 1755|      0|  }
 1756|    243|  if (should_try_cas_fast &&
  ------------------
  |  Branch (1756:7): [True: 243, False: 0]
  ------------------
 1757|    243|      mu_.compare_exchange_strong(v, v & ~(kMuWrWait | kMuWriter),
  ------------------
  |  Branch (1757:7): [True: 243, False: 0]
  ------------------
 1758|    243|                                  std::memory_order_release,
 1759|    243|                                  std::memory_order_relaxed)) {
 1760|       |    // fast writer release (writer with no waiters or with designated waker)
 1761|    243|  } else {
 1762|      0|    this->UnlockSlow(nullptr /*no waitp*/);  // take slow path
 1763|      0|  }
 1764|    243|  ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0);
 1765|    243|}
mutex.cc:_ZN4absl12lts_20260526L22DebugOnlyDeadlockCheckEPNS0_5MutexE:
 1472|    243|static inline GraphId DebugOnlyDeadlockCheck(Mutex* mu) {
 1473|    243|  if (kDebugMode && synch_deadlock_detection.load(std::memory_order_acquire) !=
  ------------------
  |  Branch (1473:7): [Folded, False: 243]
  |  Branch (1473:21): [True: 0, False: 0]
  ------------------
 1474|      0|                        OnDeadlockCycle::kIgnore) {
 1475|      0|    return DeadlockCheck(mu);
 1476|    243|  } else {
 1477|    243|    return InvalidGraphId();
 1478|    243|  }
 1479|    243|}
mutex.cc:_ZN4absl12lts_20260526L18DebugOnlyLockEnterEPNS0_5MutexENS0_24synchronization_internal7GraphIdE:
 1305|    243|static inline void DebugOnlyLockEnter(Mutex* mu, GraphId id) {
 1306|    243|  if (kDebugMode) {
  ------------------
  |  Branch (1306:7): [Folded, False: 243]
  ------------------
 1307|      0|    if (synch_deadlock_detection.load(std::memory_order_acquire) !=
  ------------------
  |  Branch (1307:9): [True: 0, False: 0]
  ------------------
 1308|      0|        OnDeadlockCycle::kIgnore) {
 1309|      0|      LockEnter(mu, id, Synch_GetAllLocks());
 1310|      0|    }
 1311|      0|  }
 1312|    243|}
mutex.cc:_ZN4absl12lts_20260526L18DebugOnlyLockLeaveEPNS0_5MutexE:
 1315|    243|static inline void DebugOnlyLockLeave(Mutex* mu) {
 1316|    243|  if (kDebugMode) {
  ------------------
  |  Branch (1316:7): [Folded, False: 243]
  ------------------
 1317|      0|    if (synch_deadlock_detection.load(std::memory_order_acquire) !=
  ------------------
  |  Branch (1317:9): [True: 0, False: 0]
  ------------------
 1318|      0|        OnDeadlockCycle::kIgnore) {
 1319|      0|      LockLeave(mu, GetGraphId(mu), Synch_GetAllLocks());
 1320|      0|    }
 1321|      0|  }
 1322|    243|}

_ZN4absl12lts_202605269MutexLockC2ERNS0_5MutexE:
  626|    177|      : mu_(mu) {
  627|    177|    this->mu_.lock();
  628|    177|  }
_ZN4absl12lts_202605269MutexLockD2Ev:
  658|    177|  ~MutexLock() ABSL_UNLOCK_FUNCTION() { this->mu_.unlock(); }
_ZN4absl12lts_202605265MutexC2Ev:
 1186|     74|inline Mutex::Mutex() : mu_(0) {
 1187|     74|  ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
 1188|     74|}

_ZN4absl12lts_202605263NowEv:
   39|  41.3k|Time Now() {
   40|       |  // TODO(bww): Get a timespec instead so we don't have to divide.
   41|  41.3k|  int64_t n = absl::GetCurrentTimeNanos();
   42|  41.3k|  if (n >= 0) {
  ------------------
  |  Branch (42:7): [True: 41.3k, False: 0]
  ------------------
   43|  41.3k|    return time_internal::FromUnixDuration(
   44|  41.3k|        time_internal::MakeDuration(n / 1000000000, n % 1000000000 * 4));
   45|  41.3k|  }
   46|      0|  return time_internal::FromUnixDuration(absl::Nanoseconds(n));
   47|  41.3k|}
_ZN4absl12lts_2026052619GetCurrentTimeNanosEv:
   77|  41.3k|int64_t GetCurrentTimeNanos() { return GET_CURRENT_TIME_NANOS_FROM_SYSTEM(); }
  ------------------
  |  |   71|  41.3k|  ::absl::time_internal::GetCurrentTimeNanosFromSystem()
  ------------------

_ZN4absl12lts_202605268DurationmIES1_:
  436|  27.5k|Duration& Duration::operator-=(Duration rhs) {
  437|  27.5k|  if (time_internal::IsInfiniteDuration(*this)) return *this;
  ------------------
  |  Branch (437:7): [True: 0, False: 27.5k]
  ------------------
  438|  27.5k|  if (time_internal::IsInfiniteDuration(rhs)) {
  ------------------
  |  Branch (438:7): [True: 0, False: 27.5k]
  ------------------
  439|      0|    return *this = rhs.rep_hi_.Get() >= 0 ? -InfiniteDuration()
  ------------------
  |  Branch (439:20): [True: 0, False: 0]
  ------------------
  440|      0|                                          : InfiniteDuration();
  441|      0|  }
  442|  27.5k|  const int64_t orig_rep_hi = rep_hi_.Get();
  443|  27.5k|  rep_hi_ = DecodeTwosComp(EncodeTwosComp(rep_hi_.Get()) -
  444|  27.5k|                           EncodeTwosComp(rhs.rep_hi_.Get()));
  445|  27.5k|  if (rep_lo_ < rhs.rep_lo_) {
  ------------------
  |  Branch (445:7): [True: 1.94k, False: 25.6k]
  ------------------
  446|  1.94k|    rep_hi_ = DecodeTwosComp(EncodeTwosComp(rep_hi_.Get()) - 1);
  447|  1.94k|    rep_lo_ += kTicksPerSecond;
  448|  1.94k|  }
  449|  27.5k|  rep_lo_ -= rhs.rep_lo_;
  450|  27.5k|  if (rhs.rep_hi_.Get() < 0 ? rep_hi_.Get() < orig_rep_hi
  ------------------
  |  Branch (450:7): [True: 0, False: 27.5k]
  |  Branch (450:7): [True: 0, False: 27.5k]
  ------------------
  451|  27.5k|                            : rep_hi_.Get() > orig_rep_hi) {
  452|      0|    return *this = rhs.rep_hi_.Get() >= 0 ? -InfiniteDuration()
  ------------------
  |  Branch (452:20): [True: 0, False: 0]
  ------------------
  453|      0|                                          : InfiniteDuration();
  454|      0|  }
  455|  27.5k|  return *this;
  456|  27.5k|}
duration.cc:_ZN4absl12lts_2026052612_GLOBAL__N_114DecodeTwosCompEm:
  187|  29.5k|inline int64_t DecodeTwosComp(uint64_t v) { return absl::bit_cast<int64_t>(v); }
duration.cc:_ZN4absl12lts_2026052612_GLOBAL__N_114EncodeTwosCompEl:
  184|  57.1k|inline uint64_t EncodeTwosComp(int64_t v) {
  185|  57.1k|  return absl::bit_cast<uint64_t>(v);
  186|  57.1k|}

clock.cc:_ZN4absl12lts_2026052613time_internalL29GetCurrentTimeNanosFromSystemEv:
   13|  41.3k|static int64_t GetCurrentTimeNanosFromSystem() {
   14|  41.3k|  const int64_t kNanosPerSecond = 1000 * 1000 * 1000;
   15|  41.3k|  struct timespec ts;
   16|  41.3k|  ABSL_RAW_CHECK(clock_gettime(CLOCK_REALTIME, &ts) == 0,
  ------------------
  |  |   60|  41.3k|  do {                                                                 \
  |  |   61|  41.3k|    if (ABSL_PREDICT_FALSE(!(condition))) {                            \
  |  |  ------------------
  |  |  |  |  190|  41.3k|#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (190:31): [True: 0, False: 41.3k]
  |  |  |  |  |  Branch (190:49): [Folded, False: 41.3k]
  |  |  |  |  |  Branch (190:58): [True: 0, False: 41.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|      0|      ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
  |  |  ------------------
  |  |  |  |   45|      0|  do {                                                                         \
  |  |  |  |   46|      0|    constexpr const char* absl_raw_log_internal_basename =                     \
  |  |  |  |   47|      0|        ::absl::raw_log_internal::Basename(__FILE__, sizeof(__FILE__) - 1);    \
  |  |  |  |   48|      0|    ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity,         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#define ABSL_RAW_LOG_INTERNAL_FATAL ::absl::LogSeverity::kFatal
  |  |  |  |  ------------------
  |  |  |  |   49|      0|                                     absl_raw_log_internal_basename, __LINE__, \
  |  |  |  |   50|      0|                                     __VA_ARGS__);                             \
  |  |  |  |   51|      0|    ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity;                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|  do {                                           \
  |  |  |  |  |  |  |  |  238|      0|    /* NOLINTNEXTLINE: misc-static-assert */     \
  |  |  |  |  |  |  |  |  239|      0|    assert(false && "ABSL_UNREACHABLE reached"); \
  |  |  |  |  |  |  |  |  240|      0|    ABSL_INTERNAL_UNREACHABLE_IMPL();            \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  215|      0|#define ABSL_INTERNAL_UNREACHABLE_IMPL() __builtin_unreachable()
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  241|      0|  } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (241:12): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   52|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|      0|    }                                                                  \
  |  |   64|  41.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (64:12): [Folded, False: 41.3k]
  |  |  ------------------
  ------------------
   17|  41.3k|                 "Failed to read real-time clock.");
   18|  41.3k|  return (int64_t{ts.tv_sec} * kNanosPerSecond +
   19|  41.3k|          int64_t{ts.tv_nsec});
   20|  41.3k|}

_ZN4absl12lts_202605268DurationC2Ev:
  186|  27.5k|  constexpr Duration() : rep_hi_(0), rep_lo_(0) {}  // zero-length duration
_ZN4absl12lts_202605268DurationC2Elj:
  248|  57.3k|  constexpr Duration(int64_t hi, uint32_t lo) : rep_hi_(hi), rep_lo_(lo) {}
_ZN4absl12lts_202605268Duration5HiRepC2El:
  268|  84.9k|          lo_(0),
  269|  84.9k|          hi_(0)
  270|       |#endif
  271|  84.9k|    {
  272|  84.9k|      *this = value;
  273|  84.9k|    }
_ZNK4absl12lts_202605268Duration5HiRep3GetEv:
  275|   226k|    constexpr int64_t Get() const {
  276|   226k|      const uint64_t unsigned_value =
  277|   226k|          (static_cast<uint64_t>(hi_) << 32) | static_cast<uint64_t>(lo_);
  278|       |      // `static_cast<int64_t>(unsigned_value)` is implementation-defined
  279|       |      // before c++20. On all supported platforms the behaviour is that mandated
  280|       |      // by c++20, i.e. "If the destination type is signed, [...] the result is
  281|       |      // the unique value of the destination type equal to the source value
  282|       |      // modulo 2^n, where n is the number of bits used to represent the
  283|       |      // destination type."
  284|   226k|      static_assert(
  285|   226k|          (static_cast<int64_t>((std::numeric_limits<uint64_t>::max)()) ==
  286|   226k|           int64_t{-1}) &&
  287|   226k|              (static_cast<int64_t>(static_cast<uint64_t>(
  288|   226k|                                        (std::numeric_limits<int64_t>::max)()) +
  289|   226k|                                    1) ==
  290|   226k|               (std::numeric_limits<int64_t>::min)()),
  291|   226k|          "static_cast<int64_t>(uint64_t) does not have c++20 semantics");
  292|   226k|      return static_cast<int64_t>(unsigned_value);
  293|   226k|    }
_ZN4absl12lts_202605268Duration5HiRepaSEl:
  295|   114k|    constexpr HiRep& operator=(const int64_t value) {
  296|       |      // "If the destination type is unsigned, the resulting value is the
  297|       |      // smallest unsigned value equal to the source value modulo 2^n
  298|       |      // where `n` is the number of bits used to represent the destination
  299|       |      // type".
  300|   114k|      const auto unsigned_value = static_cast<uint64_t>(value);
  301|   114k|      hi_ = static_cast<uint32_t>(unsigned_value >> 32);
  302|   114k|      lo_ = static_cast<uint32_t>(unsigned_value);
  303|   114k|      return *this;
  304|   114k|    }
_ZN4absl12lts_202605264TimeC2ENS0_8DurationE:
  878|  57.3k|  constexpr explicit Time(Duration rep) : rep_(rep) {}
_ZN4absl12lts_2026052613time_internal9FromInt64ILl1EEENS0_8DurationElNSt3__15ratioILl1EXT_EEE:
 1672|      2|                                                           std::ratio<1, N>) {
 1673|      2|  static_assert(0 < N && N <= 1000 * 1000 * 1000, "Unsupported ratio");
 1674|       |  // Subsecond ratios cannot overflow.
 1675|      2|  return MakeNormalizedDuration(
 1676|      2|      v / N, v % N * kTicksPerNanosecond * 1000 * 1000 * 1000 / N);
 1677|      2|}
_ZN4absl12lts_20260526gtENS0_8DurationES1_:
  337|  27.5k|                                                       Duration rhs) {
  338|  27.5k|  return rhs < lhs;
  339|  27.5k|}
_ZN4absl12lts_20260526leENS0_8DurationES1_:
  345|      8|                                                        Duration rhs) {
  346|      8|  return !(rhs < lhs);
  347|      8|}
_ZN4absl12lts_20260526miENS0_8DurationES1_:
  362|  27.5k|                                                        Duration rhs) {
  363|  27.5k|  return lhs -= rhs;
  364|  27.5k|}
_ZN4absl12lts_2026052612ZeroDurationEv:
  438|  27.5k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration ZeroDuration() {
  439|  27.5k|  return Duration();
  440|  27.5k|}
_ZN4absl12lts_20260526eqENS0_4TimeES1_:
  904|  15.9k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator==(Time lhs, Time rhs) {
  905|  15.9k|  return lhs.rep_ == rhs.rep_;
  906|  15.9k|}
_ZN4absl12lts_20260526neENS0_4TimeES1_:
  907|  15.9k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator!=(Time lhs, Time rhs) {
  908|  15.9k|  return !(lhs == rhs);
  909|  15.9k|}
_ZN4absl12lts_20260526miENS0_4TimeES1_:
  921|  27.5k|ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration operator-(Time lhs, Time rhs) {
  922|  27.5k|  return lhs.rep_ - rhs.rep_;
  923|  27.5k|}
_ZN4absl12lts_2026052614InfiniteFutureEv:
  944|  15.9k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time InfiniteFuture() {
  945|  15.9k|  return Time(time_internal::MakeDuration((std::numeric_limits<int64_t>::max)(),
  946|  15.9k|                                          ~uint32_t{0}));
  947|  15.9k|}
_ZN4absl12lts_2026052613time_internal12MakeDurationElj:
 1598|  57.3k|                                                              uint32_t lo = 0) {
 1599|  57.3k|  return Duration(hi, lo);
 1600|  57.3k|}
_ZN4absl12lts_2026052613time_internal12MakeDurationEll:
 1603|  41.3k|                                                              int64_t lo) {
 1604|  41.3k|  return MakeDuration(hi, static_cast<uint32_t>(lo));
 1605|  41.3k|}
_ZN4absl12lts_2026052613time_internal22MakeNormalizedDurationEll:
 1624|      2|    int64_t sec, int64_t ticks) {
 1625|      2|  return (ticks < 0) ? MakeDuration(sec - 1, ticks + kTicksPerSecond)
  ------------------
  |  Branch (1625:10): [True: 0, False: 2]
  ------------------
 1626|      2|                     : MakeDuration(sec, ticks);
 1627|      2|}
_ZN4absl12lts_2026052613time_internal8GetRepHiENS0_8DurationE:
 1630|  87.0k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t GetRepHi(Duration d) {
 1631|  87.0k|  return d.rep_hi_.Get();
 1632|  87.0k|}
_ZN4absl12lts_2026052613time_internal8GetRepLoENS0_8DurationE:
 1633|  87.0k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr uint32_t GetRepLo(Duration d) {
 1634|  87.0k|  return d.rep_lo_;
 1635|  87.0k|}
_ZN4absl12lts_2026052613time_internal18IsInfiniteDurationENS0_8DurationE:
 1638|  55.1k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool IsInfiniteDuration(Duration d) {
 1639|  55.1k|  return GetRepLo(d) == ~uint32_t{0};
 1640|  55.1k|}
_ZN4absl12lts_2026052613time_internal16FromUnixDurationENS0_8DurationE:
 1663|  41.3k|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixDuration(Duration d) {
 1664|  41.3k|  return Time(d);
 1665|  41.3k|}
_ZN4absl12lts_20260526ltENS0_8DurationES1_:
 1760|  27.5k|                                                       Duration rhs) {
 1761|  27.5k|  return time_internal::GetRepHi(lhs) != time_internal::GetRepHi(rhs)
  ------------------
  |  Branch (1761:10): [True: 27.5k, False: 6]
  ------------------
 1762|  27.5k|             ? time_internal::GetRepHi(lhs) < time_internal::GetRepHi(rhs)
 1763|  27.5k|         : time_internal::GetRepHi(lhs) == (std::numeric_limits<int64_t>::min)()
  ------------------
  |  Branch (1763:12): [True: 0, False: 6]
  ------------------
 1764|      6|             ? time_internal::GetRepLo(lhs) + 1 <
 1765|      0|                   time_internal::GetRepLo(rhs) + 1
 1766|      6|             : time_internal::GetRepLo(lhs) < time_internal::GetRepLo(rhs);
 1767|  27.5k|}
_ZN4absl12lts_20260526eqENS0_8DurationES1_:
 1788|  15.9k|                                                        Duration rhs) {
 1789|  15.9k|  return time_internal::GetRepHi(lhs) == time_internal::GetRepHi(rhs) &&
  ------------------
  |  Branch (1789:10): [True: 15.9k, False: 0]
  ------------------
 1790|  15.9k|         time_internal::GetRepLo(lhs) == time_internal::GetRepLo(rhs);
  ------------------
  |  Branch (1790:10): [True: 15.9k, False: 0]
  ------------------
 1791|  15.9k|}
_ZN4absl12lts_2026052616InfiniteDurationEv:
 1818|     10|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration InfiniteDuration() {
 1819|     10|  return time_internal::MakeDuration((std::numeric_limits<int64_t>::max)(),
 1820|     10|                                     ~uint32_t{0});
 1821|     10|}
_ZN4absl12lts_202605267SecondsIiTnNSt3__19enable_ifIXoosr3std11is_integralIT_EE5valuesr3std7is_enumIS4_EE5valueEiE4typeELi0EEENS0_8DurationES4_:
  551|      2|ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Seconds(T n) {
  552|      2|  return time_internal::FromInt64(n, std::ratio<1>{});
  553|      2|}
_ZN4absl12lts_202605264TimeC2Ev:
  803|      4|  constexpr Time() = default;

_ZN4absl12lts_2026052613span_internal11GetDataImplIKNSt3__16vectorIN8fuzztest8internal6no_adl8IRObjectENS3_9allocatorIS8_EEEEEEDTcldtfp_4dataEERT_c:
   38|   128k|    -> decltype(c.data()) {
   39|   128k|  return c.data();
   40|   128k|}
_ZN4absl12lts_2026052613span_internal7GetDataIKNSt3__16vectorIN8fuzztest8internal6no_adl8IRObjectENS3_9allocatorIS8_EEEEEEDTcl11GetDataImplfp_Li0EEERT_:
   50|   128k|    -> decltype(GetDataImpl(c, 0)) {
   51|   128k|  return GetDataImpl(c, 0);
   52|   128k|}
_ZN4absl12lts_2026052613span_internal7GetDataIKNSt3__16vectorIjNS3_9allocatorIjEEEEEEDTcl11GetDataImplfp_Li0EEERT_:
   50|      2|    -> decltype(GetDataImpl(c, 0)) {
   51|      2|  return GetDataImpl(c, 0);
   52|      2|}
_ZN4absl12lts_2026052613span_internal11GetDataImplIKNSt3__16vectorIjNS3_9allocatorIjEEEEEEDTcldtfp_4dataEERT_c:
   38|      2|    -> decltype(c.data()) {
   39|      2|  return c.data();
   40|      2|}
_ZN4absl12lts_2026052613span_internal7GetDataIKNS0_4SpanIjEEEEDTcl11GetDataImplfp_Li0EEERT_:
   50|     16|    -> decltype(GetDataImpl(c, 0)) {
   51|     16|  return GetDataImpl(c, 0);
   52|     16|}
_ZN4absl12lts_2026052613span_internal11GetDataImplIKNS0_4SpanIjEEEEDTcldtfp_4dataEERT_c:
   38|     16|    -> decltype(c.data()) {
   39|     16|  return c.data();
   40|     16|}

_ZN4absl12lts_2026052614SourceLocation7currentENS1_10PrivateTagEjPKc:
  113|  2.27k|      const char* absl_nonnull file_name = __builtin_FILE()) {
  114|  2.27k|    return SourceLocation(line, file_name);
  115|  2.27k|  }
_ZNK4absl12lts_2026052614SourceLocation9file_nameEv:
  133|  2.27k|  constexpr const char* absl_nonnull file_name() const noexcept {
  134|  2.27k|    return file_name_;
  135|  2.27k|  }
_ZN4absl12lts_2026052614SourceLocationC2EjPKc:
  151|  2.27k|      : line_(line), file_name_(file_name) {}

_ZNK4absl12lts_202605264SpanIKNS0_19str_format_internal13FormatArgImplEE4sizeEv:
  323|     78|  constexpr size_type size() const noexcept { return len_; }
_ZNK4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEE4sizeEv:
  323|   648k|  constexpr size_type size() const noexcept { return len_; }
_ZNK4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEEixEm:
  338|   533k|  constexpr reference operator[](size_type i) const noexcept {
  339|   533k|    absl::base_internal::HardeningAssertLT(i, size());
  340|   533k|    return ptr_[i];
  341|   533k|  }
_ZNK4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEE4dataEv:
  318|  7.78k|  constexpr pointer data() const noexcept { return ptr_; }
_ZNK4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEE5beginEv:
  375|  3.89k|  constexpr iterator begin() const noexcept { return data(); }
_ZNK4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEE3endEv:
  388|  3.89k|  constexpr iterator end() const noexcept { return data() + size(); }
_ZNK4absl12lts_202605264SpanIjE4dataEv:
  318|     20|  constexpr pointer data() const noexcept { return ptr_; }
_ZNK4absl12lts_202605264SpanIjE4sizeEv:
  323|     20|  constexpr size_type size() const noexcept { return len_; }
_ZN4absl12lts_202605268MakeSpanITpTnRiJEKjEENS0_4SpanIT0_EEPS5_S7_:
  740|      4|                 T* absl_nullable end) noexcept {
  741|      4|  absl::base_internal::HardeningAssertLE(begin, end);
  742|      4|  return Span<T>(begin, static_cast<size_t>(end - begin));
  743|      4|}
_ZNK4absl12lts_202605264SpanIKjE4dataEv:
  318|     42|  constexpr pointer data() const noexcept { return ptr_; }
_ZNK4absl12lts_202605264SpanIKjE5beginEv:
  375|     20|  constexpr iterator begin() const noexcept { return data(); }
_ZNK4absl12lts_202605264SpanIKjE4sizeEv:
  323|     90|  constexpr size_type size() const noexcept { return len_; }
_ZNK4absl12lts_202605264SpanIKjE3endEv:
  388|     20|  constexpr iterator end() const noexcept { return data() + size(); }
_ZNK4absl12lts_202605264SpanIKjE5emptyEv:
  333|      4|  constexpr bool empty() const noexcept { return size() == 0; }
_ZNK4absl12lts_202605264SpanIKjEixEm:
  338|     24|  constexpr reference operator[](size_type i) const noexcept {
  339|     24|    absl::base_internal::HardeningAssertLT(i, size());
  340|     24|    return ptr_[i];
  341|     24|  }
_ZN4absl12lts_202605264SpanIKNS0_19str_format_internal13FormatArgImplEEC2Ev:
  227|     48|  constexpr Span() noexcept : Span(nullptr, 0) {}
_ZN4absl12lts_202605264SpanIKNS0_19str_format_internal13FormatArgImplEEC2EPS4_m:
  230|     87|      : ptr_(array), len_(length) {}
_ZN4absl12lts_202605264SpanIKNS0_19str_format_internal13FormatArgImplEEC2IS4_S4_EESt16initializer_listIS3_E:
  310|     39|      : Span(v.begin(), v.size()) {}
_ZN4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEEC2INSt3__16vectorIS5_NS9_9allocatorIS5_EEEEvSD_iEERKT_:
  254|   128k|      : Span(span_internal::GetData(v), v.size()) {}
_ZN4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEEC2EPS6_m:
  230|   128k|      : ptr_(array), len_(length) {}
_ZN4absl12lts_202605264SpanIKN8fuzztest8internal6no_adl8IRObjectEEC2Ev:
  227|      8|  constexpr Span() noexcept : Span(nullptr, 0) {}
_ZN4absl12lts_202605264SpanIKjEC2EPS2_m:
  230|     22|      : ptr_(array), len_(length) {}
_ZN4absl12lts_202605264SpanIKjEC2INSt3__16vectorIjNS5_9allocatorIjEEEEvS9_iEERKT_:
  254|      2|      : Span(span_internal::GetData(v), v.size()) {}
_ZN4absl12lts_202605268MakeSpanITpTnRiJEjLm512EEENS0_4SpanIT0_EERAT1__S4_:
  764|      2|    T (&array ABSL_ATTRIBUTE_LIFETIME_BOUND)[N]) noexcept {
  765|      2|  return Span<T>(array, N);
  766|      2|}
_ZN4absl12lts_202605264SpanIjEC2EPjm:
  230|     18|      : ptr_(array), len_(length) {}
_ZN4absl12lts_202605268MakeSpanITpTnRiJEjEENS0_4SpanIT0_EEPS4_m:
  734|     16|                           size_t size) noexcept {
  735|     16|  return Span<T>(ptr, size);
  736|     16|}
_ZN4absl12lts_202605264SpanIKjEC2INS1_IjEEvS5_TnNSt3__19enable_ifIXsr6IsViewIT_EE5valueEiE4typeELi0EEERKS8_:
  269|     16|      : Span(span_internal::GetData(v), v.size()) {}
_ZNK4absl12lts_202605264SpanIjE5emptyEv:
  333|      2|  constexpr bool empty() const noexcept { return size() == 0; }
_ZNK4absl12lts_202605264SpanIKNS0_19str_format_internal13FormatArgImplEEixEm:
  338|     39|  constexpr reference operator[](size_type i) const noexcept {
  339|     39|    absl::base_internal::HardeningAssertLT(i, size());
  340|     39|    return ptr_[i];
  341|     39|  }

_ZN8fuzztest15internal_no_adl7InRangeIiEEDaT_S2_:
  359|     32|auto InRange(T min, T max) {
  360|     32|  return internal::InRangeImpl<T>(min, max);
  361|     32|}
_ZN8fuzztest15internal_no_adl9ElementOfI15avifPixelFormatEEDaSt16initializer_listIT_E:
  293|      8|auto ElementOf(std::initializer_list<T> values) {
  294|      8|  return internal::ElementOfImpl<T>(values);
  295|      8|}
_ZN8fuzztest15internal_no_adl4JustImEEDaT_:
  309|  82.9k|auto Just(T val) {
  310|  82.9k|  return internal::ElementOfImpl<T>({std::move(val)});
  311|  82.9k|}
_ZN8fuzztest15internal_no_adl4JustI15avifPixelFormatEEDaT_:
  309|  41.4k|auto Just(T val) {
  310|  41.4k|  return internal::ElementOfImpl<T>({std::move(val)});
  311|  41.4k|}
_ZN8fuzztest15internal_no_adl4JustIbEEDaT_:
  309|  41.4k|auto Just(T val) {
  310|  41.4k|  return internal::ElementOfImpl<T>({std::move(val)});
  311|  41.4k|}
_ZN8fuzztest15internal_no_adl9ArbitraryINSt3__16vectorIhNS2_9allocatorIhEEEEEEDav:
  281|  29.8k|auto Arbitrary() {
  282|  29.8k|  return internal::ArbitraryImpl<T>{};
  283|  29.8k|}
_ZN8fuzztest15internal_no_adl7InRangeItEEDaT_S2_:
  359|  11.6k|auto InRange(T min, T max) {
  360|  11.6k|  return internal::InRangeImpl<T>(min, max);
  361|  11.6k|}
_ZN8fuzztest15internal_no_adl9ArbitraryIbEEDav:
  281|     24|auto Arbitrary() {
  282|     24|  return internal::ArbitraryImpl<T>{};
  283|     24|}
_ZN8fuzztest15internal_no_adl4JustIiEEDaT_:
  309|  11.6k|auto Just(T val) {
  310|  11.6k|  return internal::ElementOfImpl<T>({std::move(val)});
  311|  11.6k|}
_ZN8fuzztest15internal_no_adl11ContainerOfINSt3__16vectorItNS2_9allocatorItEEEETpTnRiJENS_8internal11InRangeImplItEEEEDaT1_:
  494|  11.6k|auto ContainerOf(Inner inner) {
  495|  11.6k|  static_assert(
  496|  11.6k|      std::is_same_v<internal::DropConst<typename T::value_type>,
  497|  11.6k|                     internal::DropConst<internal::value_type_t<Inner>>>);
  498|  11.6k|  return internal::ContainerOfImpl<T, Inner>(std::move(inner));
  499|  11.6k|}
_ZN8fuzztest15internal_no_adl9ElementOfIiEEDaSt16initializer_listIT_E:
  293|      4|auto ElementOf(std::initializer_list<T> values) {
  294|      4|  return internal::ElementOfImpl<T>(values);
  295|      4|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmm15avifPixelFormatbRKNS4_IhNSA_IhEEEEEJNS_8internal13ElementOfImplImEESM_NSL_ISD_EENSL_IbEENSK_23SequenceContainerOfImplISF_NSK_13ArbitraryImplIhvEEEEEEEDaT0_DpT1_:
  727|  29.8k|auto Map(Mapper mapper, Inner... inner) {
  728|  29.8k|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|  29.8k|                                             std::move(inner)...);
  730|  29.8k|}
_ZN8fuzztest15internal_no_adl7FlatMapITpTnRiJEZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS_8internal11InRangeImplItEES9_NS7_13ElementOfImplIS5_EENS7_13ArbitraryImplIbvEEEEEDaT0_DpT1_:
  814|      2|auto FlatMap(FlatMapper flat_mapper, Inner... inner) {
  815|      2|  return internal::FlatMapImpl<FlatMapper, Inner...>(std::move(flat_mapper),
  816|      2|                                                     std::move(inner)...);
  817|      2|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmmi15avifPixelFormatbRKNS4_ItNSA_ItEEEEEJNS_8internal13ElementOfImplImEESM_NSL_IiEENSL_ISD_EENSL_IbEENSK_23SequenceContainerOfImplISF_NSK_11InRangeImplItEEEEEEEDaT0_DpT1_:
  727|  11.6k|auto Map(Mapper mapper, Inner... inner) {
  728|  11.6k|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|  11.6k|                                             std::move(inner)...);
  730|  11.6k|}
_ZN8fuzztest15internal_no_adl7FlatMapITpTnRiJEZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS_8internal11InRangeImplItEES9_NS7_13ElementOfImplIiEENSA_IS5_EENS7_13ArbitraryImplIbvEEEEEDaT0_DpT1_:
  814|      2|auto FlatMap(FlatMapper flat_mapper, Inner... inner) {
  815|      2|  return internal::FlatMapImpl<FlatMapper, Inner...>(std::move(flat_mapper),
  816|      2|                                                     std::move(inner)...);
  817|      2|}
_ZN8fuzztest15internal_no_adl5OneOfITpTnRiJEJNS_8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS3_11InRangeImplItEESA_NS3_13ElementOfImplIS7_EENS3_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEEDaDpT0_:
  314|      2|auto OneOf(Inner... domains) {
  315|      2|  return internal::OneOfImpl<Inner...>(std::move(domains)...);
  316|      2|}
_ZN8fuzztest15internal_no_adl7FlatMapITpTnRiJEZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS_8internal11InRangeImplItEES9_NS7_13ElementOfImplIS5_EENS7_13ArbitraryImplIbvEEEEEDaT0_DpT1_:
  814|      2|auto FlatMap(FlatMapper flat_mapper, Inner... inner) {
  815|      2|  return internal::FlatMapImpl<FlatMapper, Inner...>(std::move(flat_mapper),
  816|      2|                                                     std::move(inner)...);
  817|      2|}
_ZN8fuzztest15internal_no_adl7FlatMapITpTnRiJEZN4avif8testutil30ArbitraryAvifLayeredRandDim16bEvEUlmmi15avifPixelFormatbE_JNS_8internal11InRangeImplItEES9_NS7_13ElementOfImplIiEENSA_IS5_EENS7_13ArbitraryImplIbvEEEEEDaT0_DpT1_:
  814|      2|auto FlatMap(FlatMapper flat_mapper, Inner... inner) {
  815|      2|  return internal::FlatMapImpl<FlatMapper, Inner...>(std::move(flat_mapper),
  816|      2|                                                     std::move(inner)...);
  817|      2|}
_ZN8fuzztest15internal_no_adl5OneOfITpTnRiJEJNS_8internal11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS3_11InRangeImplItEESA_NS3_13ElementOfImplIS7_EENS3_13ArbitraryImplIbvEEEEENS4_IZNS6_30ArbitraryAvifLayeredRandDim16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEEDaDpT0_:
  314|      2|auto OneOf(Inner... domains) {
  315|      2|  return internal::OneOfImpl<Inner...>(std::move(domains)...);
  316|      2|}
_ZN8fuzztest15internal_no_adl9ElementOfI15avifCodecChoiceEEDaSt16initializer_listIT_E:
  293|      8|auto ElementOf(std::initializer_list<T> values) {
  294|      8|  return internal::ElementOfImpl<T>(values);
  295|      8|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS_8internal13ElementOfImplIS9_EENSC_11InRangeImplIiEESG_SG_SG_SG_SG_EEEDaT0_DpT1_:
  727|      4|auto Map(Mapper mapper, Inner... inner) {
  728|      4|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|      4|                                             std::move(inner)...);
  730|      4|}
_ZN8fuzztest15internal_no_adl9ElementOfI17avifDecoderSourceEEDaSt16initializer_listIT_E:
  293|      4|auto ElementOf(std::initializer_list<T> values) {
  294|      4|  return internal::ElementOfImpl<T>(values);
  295|      4|}
_ZN8fuzztest15internal_no_adl20BitFlagCombinationOfIjEEDaSt16initializer_listIT_E:
  471|      4|auto BitFlagCombinationOf(std::initializer_list<T> flags) {
  472|      4|  return internal::BitFlagCombinationOfImpl<T>(
  473|      4|      absl::MakeSpan(flags.begin(), flags.end()));
  474|      4|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS_8internal13ElementOfImplIS9_EENSD_11InRangeImplIiEENSE_ISA_EENSD_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENSD_24BitFlagCombinationOfImplIjEEEEEDaT0_DpT1_:
  727|      4|auto Map(Mapper mapper, Inner... inner) {
  728|      4|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|      4|                                             std::move(inner)...);
  730|      4|}
_ZN8fuzztest15internal_no_adl9ElementOfIjEEDaSt16initializer_listIT_E:
  293|      4|auto ElementOf(std::initializer_list<T> values) {
  294|      4|  return internal::ElementOfImpl<T>(values);
  295|      4|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES8_jEJNS_8internal7MapImplIPFS8_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNSB_13ElementOfImplISD_EENSB_11InRangeImplIiEENSH_ISE_EENSB_13ArbitraryImplIbvEESN_SN_SN_NSH_ImEESO_NSH_IiEENSB_24BitFlagCombinationOfImplIjEEEEENSH_IjEEEEEDaT0_DpT1_:
  727|      4|auto Map(Mapper mapper, Inner... inner) {
  728|      4|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|      4|                                             std::move(inner)...);
  730|      4|}
_ZN8fuzztest15internal_no_adl7TupleOfITpTnRiJEJNS_8internal9OneOfImplIJNS3_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS3_11InRangeImplItEESB_NS3_13ElementOfImplIS8_EENS3_13ArbitraryImplIbvEEEEENS5_IZNS7_23ArbitraryAvifLayered16bEvEUlmmiS8_bE_JSB_SB_NSC_IiEESD_SF_EEEEEENS3_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNSA_IiEESS_EEENSL_IPFNSM_10unique_ptrI11avifEncoderNS6_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSC_ISY_EESS_SS_SS_SS_SS_SS_EEENSL_IPFNSU_I11avifDecoderSW_EES14_jEJNSL_IPFS14_SY_i17avifDecoderSourcebbbbjjjjEJS11_SS_NSC_IS17_EESF_SF_SF_SF_NSC_ImEES1B_SI_NS3_24BitFlagCombinationOfImplIjEEEEENSC_IjEEEEEEEEDaDpT0_:
  594|      2|auto TupleOf(Inner... inner) {
  595|      2|  return internal::AggregateOfImpl<std::tuple<internal::value_type_t<Inner>...>,
  596|      2|                                   internal::RequireCustomCorpusType::kNo,
  597|      2|                                   Inner...>(std::in_place,
  598|      2|                                             std::move(inner)...);
  599|      2|}
_ZN8fuzztest15internal_no_adl3MapITpTnRiJEPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS_8internal11InRangeImplIiEESB_EEEDaT0_DpT1_:
  727|      2|auto Map(Mapper mapper, Inner... inner) {
  728|      2|  return internal::MapImpl<Mapper, Inner...>(std::move(mapper),
  729|      2|                                             std::move(inner)...);
  730|      2|}
_ZN8fuzztest15internal_no_adl7TupleOfITpTnRiJEJNS_8internal9OneOfImplIJNS3_11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS3_11InRangeImplItEESB_NS3_13ElementOfImplIS8_EENS3_13ArbitraryImplIbvEEEEENS5_IZNS7_30ArbitraryAvifLayeredRandDim16bEvEUlmmiS8_bE_JSB_SB_NSC_IiEESD_SF_EEEEEENS3_7MapImplIPFNSt3__110unique_ptrI11avifEncoderNS6_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSC_ISR_EENSA_IiEESV_SV_SV_SV_SV_EEENSL_IPFNSN_I11avifDecoderSP_EESY_jEJNSL_IPFSY_SR_i17avifDecoderSourcebbbbjjjjEJSU_SV_NSC_IS11_EESF_SF_SF_SF_NSC_ImEES15_SI_NS3_24BitFlagCombinationOfImplIjEEEEENSC_IjEEEEEEEEDaDpT0_:
  594|      2|auto TupleOf(Inner... inner) {
  595|      2|  return internal::AggregateOfImpl<std::tuple<internal::value_type_t<Inner>...>,
  596|      2|                                   internal::RequireCustomCorpusType::kNo,
  597|      2|                                   Inner...>(std::in_place,
  598|      2|                                             std::move(inner)...);
  599|      2|}

main:
   20|      2|int main(int argc, char** argv) {
   21|      2|  absl::InitializeSymbolizer(argv[0]);
   22|      2|  absl::FailureSignalHandlerOptions options;
   23|      2|  options.call_previous_handler = true;
   24|      2|  absl::InstallFailureSignalHandler(options);
   25|      2|  testing::InitGoogleTest(&argc, argv);
   26|       |  // We call fuzztest::ParseAbslFlags rather than absl::ParseCommandLine
   27|       |  // since the latter would complain about any unknown flags that need
   28|       |  // to be passed to legacy fuzzing engines (e.g. libfuzzer).
   29|      2|  fuzztest::ParseAbslFlags(argc, argv);
   30|      2|  fuzztest::InitFuzzTest(&argc, &argv);
   31|      2|  return RUN_ALL_TESTS();
   32|      2|}

_ZN8fuzztest19ListRegisteredTestsEv:
  258|      6|std::vector<std::string> ListRegisteredTests() {
  259|      6|  std::vector<std::string> result;
  260|      6|  internal::ForEachTest(
  261|      6|      [&](const auto& test) { result.push_back(test.full_name()); });
  262|      6|  return result;
  263|      6|}
_ZN8fuzztest25GetMatchingFuzzTestOrExitENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  265|      2|std::string GetMatchingFuzzTestOrExit(std::string_view name) {
  266|      2|  const std::string partial_name(name);
  267|      2|  const std::vector<std::string> full_names = ListRegisteredTests();
  268|      2|  std::vector<const std::string*> matches;
  269|      2|  for (const std::string& full_name : full_names) {
  ------------------
  |  Branch (269:37): [True: 2, False: 0]
  ------------------
  270|      2|    if (absl::StrContains(full_name, partial_name)) {
  ------------------
  |  Branch (270:9): [True: 2, False: 0]
  ------------------
  271|      2|      if (full_name == partial_name) {
  ------------------
  |  Branch (271:11): [True: 2, False: 0]
  ------------------
  272|       |        // In case of an exact match, we end the search and use it. This is to
  273|       |        // handle the case when we want to select `MySuite.MyTest`, but the
  274|       |        // binary has both `MySuite.MyTest` and `MySuite.MyTestX`.
  275|      2|        return full_name;
  276|      2|      } else {
  277|      0|        matches.push_back(&full_name);
  278|      0|      }
  279|      2|    }
  280|      2|  }
  281|       |
  282|      0|  if (matches.empty()) {
  ------------------
  |  Branch (282:7): [True: 0, False: 0]
  ------------------
  283|      0|    absl::FPrintF(stderr, "\n\nNo FUZZ_TEST matches the name: %s\n\n",
  284|      0|                  partial_name);
  285|      0|    absl::FPrintF(stderr, "Valid tests:\n");
  286|      0|    for (const std::string& full_name : full_names) {
  ------------------
  |  Branch (286:39): [True: 0, False: 0]
  ------------------
  287|      0|      absl::FPrintF(stderr, " %s\n", full_name);
  288|      0|    }
  289|      0|    exit(1);
  290|      0|  } else if (matches.size() > 1) {
  ------------------
  |  Branch (290:14): [True: 0, False: 0]
  ------------------
  291|      0|    absl::FPrintF(stderr, "\n\nMultiple FUZZ_TESTs match the name: %s\n\n",
  292|      0|                  partial_name);
  293|      0|    absl::FPrintF(stderr, "Please select one. Matching tests:\n");
  294|      0|    for (const std::string* full_name : matches) {
  ------------------
  |  Branch (294:39): [True: 0, False: 0]
  ------------------
  295|      0|      absl::FPrintF(stderr, " %s\n", *full_name);
  296|      0|    }
  297|      0|    exit(1);
  298|      0|  }
  299|      0|  return *matches[0];
  300|      0|}
_ZN8fuzztest12InitFuzzTestEPiPPPcNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
  403|      2|void InitFuzzTest(int* argc, char*** argv, std::string_view binary_id) {
  404|      2|  auto& runtime = internal::Runtime::instance();
  405|      2|  const bool is_listing = absl::GetFlag(FUZZTEST_FLAG(list_fuzz_tests));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  406|      2|  if (is_listing) {
  ------------------
  |  Branch (406:7): [True: 0, False: 2]
  ------------------
  407|      0|    for (const auto& name : ListRegisteredTests()) {
  ------------------
  |  Branch (407:27): [True: 0, False: 0]
  ------------------
  408|      0|      std::cout << "[*] Fuzz test: " << name << '\n';
  409|      0|    }
  410|      0|    std::cout << std::flush;
  411|      0|    std::exit(0);
  412|      0|  }
  413|      2|  std::optional<absl::Duration> fuzzing_time_limit = GetFuzzingTime();
  414|      2|  std::optional<absl::Duration> replay_corpus_time_limit =
  415|      2|      GetReplayCorpusTime();
  416|      4|  FUZZTEST_CHECK(!fuzzing_time_limit || !replay_corpus_time_limit)
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      8|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  417|      4|      << "Cannot run in fuzzing and corpus replay mode at the same time.";
  418|      2|  const auto test_to_fuzz = absl::GetFlag(FUZZTEST_FLAG(fuzz));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  419|      2|  const auto test_to_replay_corpus =
  420|      2|      absl::GetFlag(FUZZTEST_FLAG(replay_corpus));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  421|      2|  const auto specified_test = []() -> std::optional<std::string> {
  422|      2|    if (auto internal_selected_test =
  423|      2|            absl::GetFlag(FUZZTEST_FLAG(internal_override_fuzz_test));
  424|      2|        internal_selected_test.has_value()) {
  425|      2|      return internal_selected_test;
  426|      2|    }
  427|      2|    if (auto test_to_fuzz = absl::GetFlag(FUZZTEST_FLAG(fuzz));
  428|      2|        test_to_fuzz != kUnspecified) {
  429|      2|      return test_to_fuzz;
  430|      2|    }
  431|      2|    if (auto test_to_replay_corpus =
  432|      2|            absl::GetFlag(FUZZTEST_FLAG(replay_corpus));
  433|      2|        test_to_replay_corpus != kUnspecified) {
  434|      2|      return test_to_replay_corpus;
  435|      2|    }
  436|      2|    return std::nullopt;
  437|      2|  }();
  438|      2|  if (specified_test.has_value()) {
  ------------------
  |  Branch (438:7): [True: 2, False: 0]
  ------------------
  439|      2|    const std::string matching_fuzz_test =
  440|      2|        GetMatchingFuzzTestOrExit(*specified_test);
  441|       |    // Delegate the test to GoogleTest.
  442|      2|    GTEST_FLAG_SET(filter, matching_fuzz_test);
  443|      2|  }
  444|       |
  445|      2|  std::string derived_binary_id =
  446|      2|      binary_id.empty() ? std::string(internal::Basename(*argv[0]))
  ------------------
  |  Branch (446:7): [True: 2, False: 0]
  ------------------
  447|      2|                        : std::string(binary_id);
  448|      2|  std::optional<std::string> reproduction_command_template;
  449|      2|  internal::Configuration configuration =
  450|      2|      CreateConfigurationsFromFlags(derived_binary_id);
  451|      2|  configuration.reproduction_command_template = reproduction_command_template;
  452|      2|  internal::RegisterFuzzTestsAsGoogleTests(argc, argv, configuration);
  453|       |
  454|      2|  const bool is_fuzzing_or_replaying =
  455|      2|      (fuzzing_time_limit || replay_corpus_time_limit);
  ------------------
  |  Branch (455:8): [True: 2, False: 0]
  |  Branch (455:30): [True: 0, False: 0]
  ------------------
  456|      2|  if (is_fuzzing_or_replaying && !specified_test.has_value()) {
  ------------------
  |  Branch (456:7): [True: 2, False: 0]
  |  Branch (456:34): [True: 0, False: 2]
  ------------------
  457|      0|    absl::flat_hash_set<std::string> fuzz_tests = {
  458|      0|        configuration.fuzz_tests.begin(), configuration.fuzz_tests.end()};
  459|      0|    std::vector<std::string> non_fuzz_tests;
  460|      0|    for (const auto* test : internal::GetRegisteredTests()) {
  ------------------
  |  Branch (460:27): [True: 0, False: 0]
  ------------------
  461|      0|      const std::string test_name =
  462|      0|          absl::StrCat(test->test_suite_name(), ".", test->name());
  463|      0|      if (!fuzz_tests.contains(test_name)) {
  ------------------
  |  Branch (463:11): [True: 0, False: 0]
  ------------------
  464|      0|        non_fuzz_tests.push_back(test_name);
  465|      0|      }
  466|      0|    }
  467|      0|    if (!non_fuzz_tests.empty()) {
  ------------------
  |  Branch (467:9): [True: 0, False: 0]
  ------------------
  468|       |      // Run only the fuzz tests, and not the unit tests.
  469|       |      // TODO: b/340232436 -- This is needed because we currently rely on a fuzz
  470|       |      // test being the first test to run so that Centipede can get the
  471|       |      // serialized configuration from the binary.
  472|      0|      std::string filter = absl::StrCat(
  473|      0|          GTEST_FLAG_GET(filter),
  474|       |          // When the filter already includes the negative patterns, append to
  475|       |          // the negative patterns.
  476|      0|          absl::StrContains(GTEST_FLAG_GET(filter), '-') ? ":" : "-",
  ------------------
  |  Branch (476:11): [True: 0, False: 0]
  ------------------
  477|      0|          absl::StrJoin(non_fuzz_tests, ":"));
  478|      0|      GTEST_FLAG_SET(filter, filter);
  479|      0|    }
  480|      0|  }
  481|       |  // TODO(b/307513669): Use the Configuration class instead of Runtime.
  482|      2|  if (!absl::GetFlag(FUZZTEST_FLAG(unguided)) &&
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  |  Branch (482:7): [True: 2, False: 0]
  ------------------
  483|      2|      fuzzing_time_limit.has_value()) {
  ------------------
  |  Branch (483:7): [True: 2, False: 0]
  ------------------
  484|      2|    runtime.SetRunMode(RunMode::kFuzz);
  485|      2|  } else {
  486|      0|    runtime.SetRunMode(RunMode::kUnitTest);
  487|      0|  }
  488|      2|}
_ZN8fuzztest14ParseAbslFlagsEiPPc:
  490|      2|void ParseAbslFlags(int argc, char** argv) {
  491|      2|  std::vector<char*> positional_args;
  492|      2|  std::vector<absl::UnrecognizedFlag> unrecognized_flags;
  493|      2|  absl::ParseAbseilFlagsOnly(argc, argv, positional_args, unrecognized_flags);
  494|      2|}
init_fuzztest.cc:_ZNK3$_0clEv:
   47|      2|    .OnUpdate([]() {
   48|      2|      fuzztest::internal::SetFuzzTestListingModeValidatorForGoogleTest(
   49|      2|          absl::GetFlag(FUZZTEST_FLAG(list_fuzz_tests)));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
   50|      2|    });
init_fuzztest.cc:_ZNK3$_1clEv:
  216|      2|    .OnUpdate([] {
  217|      4|      FUZZTEST_PRECONDITION(
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      6|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|      4|          !absl::GetFlag(FUZZTEST_FLAG(internal_override_fuzz_test))
  219|      4|               .has_value() ||
  220|      4|          std::getenv("CENTIPEDE_RUNNER_FLAGS") != nullptr)
  221|      4|          << "must not set --" FUZZTEST_FLAG_PREFIX
  222|      4|             "internal_override_fuzz_test directly";
  223|      2|    });
init_fuzztest.cc:_ZNK3$_2clEv:
  232|      2|    .OnUpdate([] {
  233|      4|      FUZZTEST_PRECONDITION(
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      6|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|      4|          absl::GetFlag(FUZZTEST_FLAG(internal_override_total_time_limit)) ==
  235|      4|              absl::InfiniteDuration() ||
  236|      4|          std::getenv("CENTIPEDE_RUNNER_FLAGS") != nullptr)
  237|      4|          << "must not set --" FUZZTEST_FLAG_PREFIX
  238|      4|             "internal_override_total_time_limit directly";
  239|      2|    });
init_fuzztest.cc:_ZNK3$_3clEv:
  247|      2|    .OnUpdate([] {
  248|      4|      FUZZTEST_PRECONDITION(
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      6|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      4|          !absl::GetFlag(FUZZTEST_FLAG(internal_crashing_input_to_reproduce))
  250|      4|               .has_value() ||
  251|      4|          std::getenv("CENTIPEDE_RUNNER_FLAGS") != nullptr)
  252|      4|          << "must not set --" FUZZTEST_FLAG_PREFIX
  253|      4|             "internal_crashing_input_to_reproduce directly";
  254|      2|    });
init_fuzztest.cc:_ZN8fuzztest12_GLOBAL__N_129CreateConfigurationsFromFlagsENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  331|      2|    absl::string_view binary_identifier) {
  332|      2|  const bool reproduce_findings_as_separate_tests =
  333|      2|      absl::GetFlag(FUZZTEST_FLAG(reproduce_findings_as_separate_tests));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  334|      2|  const std::optional<absl::Duration> fuzzing_time_limit = GetFuzzingTime();
  335|      2|  const std::optional<absl::Duration> replay_corpus_time_limit =
  336|      2|      GetReplayCorpusTime();
  337|      2|  const std::optional<std::string> override_fuzz_test =
  338|      2|      absl::GetFlag(FUZZTEST_FLAG(internal_override_fuzz_test));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  339|      2|  const bool replay_coverage_inputs =
  340|      2|      fuzzing_time_limit.has_value() || replay_corpus_time_limit.has_value();
  ------------------
  |  Branch (340:7): [True: 2, False: 0]
  |  Branch (340:41): [True: 0, False: 0]
  ------------------
  341|      2|  const absl::Duration time_limit =
  342|      2|      override_fuzz_test.has_value()
  ------------------
  |  Branch (342:7): [True: 0, False: 2]
  ------------------
  343|      2|          ? absl::GetFlag(FUZZTEST_FLAG(internal_override_total_time_limit))
  ------------------
  |  |   20|      0|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  344|      2|      : fuzzing_time_limit.has_value()       ? *fuzzing_time_limit
  ------------------
  |  Branch (344:9): [True: 2, False: 0]
  ------------------
  345|      2|      : replay_corpus_time_limit.has_value() ? *replay_corpus_time_limit
  ------------------
  |  Branch (345:9): [True: 0, False: 0]
  ------------------
  346|      0|                                             : absl::ZeroDuration();
  347|      2|  const internal::TimeBudgetType time_budget_type =
  348|      2|      override_fuzz_test.has_value()
  ------------------
  |  Branch (348:7): [True: 0, False: 2]
  ------------------
  349|      2|          ? internal::TimeBudgetType::kTotal
  350|      2|          : absl::GetFlag(FUZZTEST_FLAG(time_budget_type));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  351|      2|  const std::optional<size_t> jobs = absl::GetFlag(FUZZTEST_FLAG(jobs));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  352|      4|  FUZZTEST_CHECK(!jobs.has_value() || *jobs > 0)
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      6|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|      4|      << "If specified, --" << FUZZTEST_FLAG(jobs).Name()
  ------------------
  |  |   20|      0|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  354|      4|      << " must be positive.";
  355|      2|  std::string corpus_database = absl::GetFlag(FUZZTEST_FLAG(corpus_database));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  356|      2|  if (!corpus_database.empty() && corpus_database[0] != '/' &&
  ------------------
  |  Branch (356:7): [True: 2, False: 0]
  |  Branch (356:35): [True: 2, False: 0]
  ------------------
  357|      2|      std::getenv("TEST_SRCDIR")) {
  ------------------
  |  Branch (357:7): [True: 0, False: 2]
  ------------------
  358|      0|    corpus_database =
  359|      0|        absl::StrCat(std::getenv("TEST_SRCDIR"), "/", corpus_database);
  360|      0|  }
  361|      2|  return internal::Configuration{
  362|      2|      corpus_database,
  363|      2|      /*stats_root=*/"",
  364|      2|      /*workdir_root=*/"",
  365|      2|      std::string(binary_identifier),
  366|      2|      /*fuzz_tests=*/ListRegisteredTests(),
  367|      2|      /*fuzz_tests_in_current_shard=*/ListRegisteredTests(),
  368|       |      /*continue_after_crash=*/
  369|      2|      absl::GetFlag(FUZZTEST_FLAG(continue_after_crash)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  370|      2|      reproduce_findings_as_separate_tests,
  371|      2|      replay_coverage_inputs,
  372|       |      /*only_replay=*/
  373|      2|      replay_corpus_time_limit.has_value(),
  374|      2|      /*replay_in_single_process=*/false,
  375|      2|      absl::GetFlag(FUZZTEST_FLAG(execution_id)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  376|      2|      absl::GetFlag(FUZZTEST_FLAG(print_subprocess_log)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  377|      2|      absl::GetFlag(FUZZTEST_FLAG(subprocess_cleanup_timeout)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  378|      2|      /*stack_limit=*/absl::GetFlag(FUZZTEST_FLAG(stack_limit_kb)) * 1024,
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  379|      2|      /*rss_limit=*/absl::GetFlag(FUZZTEST_FLAG(rss_limit_mb)) * 1024 * 1024,
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  380|      2|      absl::GetFlag(FUZZTEST_FLAG(time_limit_per_input)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  381|      2|      time_limit,
  382|      2|      time_budget_type,
  383|      2|      jobs.value_or(0),
  384|      2|      absl::GetFlag(FUZZTEST_FLAG(internal_centipede_command)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  385|      2|      absl::GetFlag(FUZZTEST_FLAG(internal_crashing_input_to_reproduce)),
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  386|      2|  };
  387|      2|}
init_fuzztest.cc:_ZN8fuzztest12_GLOBAL__N_114GetFuzzingTimeEv:
  304|      4|std::optional<absl::Duration> GetFuzzingTime() {
  305|      4|  absl::Duration fuzz_time_limit = absl::GetFlag(FUZZTEST_FLAG(fuzz_for));
  ------------------
  |  |   20|      4|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  306|      4|  if (fuzz_time_limit <= absl::ZeroDuration()) {
  ------------------
  |  Branch (306:7): [True: 0, False: 4]
  ------------------
  307|      0|    fuzz_time_limit = absl::InfiniteDuration();
  308|      0|  }
  309|      4|  if (absl::GetFlag(FUZZTEST_FLAG(fuzz)) == kUnspecified &&
  ------------------
  |  |   20|      4|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  |  Branch (309:7): [True: 0, False: 4]
  |  Branch (309:7): [True: 0, False: 4]
  ------------------
  310|      0|      fuzz_time_limit == absl::InfiniteDuration()) {
  ------------------
  |  Branch (310:7): [True: 0, False: 0]
  ------------------
  311|      0|    return std::nullopt;
  312|      0|  }
  313|      4|  return fuzz_time_limit;
  314|      4|}
init_fuzztest.cc:_ZN8fuzztest12_GLOBAL__N_119GetReplayCorpusTimeEv:
  316|      4|std::optional<absl::Duration> GetReplayCorpusTime() {
  317|      4|  absl::Duration replay_corpus_time_limit =
  318|      4|      absl::GetFlag(FUZZTEST_FLAG(replay_corpus_for));
  ------------------
  |  |   20|      4|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  319|      4|  if (absl::GetFlag(FUZZTEST_FLAG(replay_corpus)) == kUnspecified &&
  ------------------
  |  |   20|      4|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  |  Branch (319:7): [True: 4, False: 0]
  |  Branch (319:7): [True: 4, False: 0]
  ------------------
  320|      4|      replay_corpus_time_limit <= absl::ZeroDuration()) {
  ------------------
  |  Branch (320:7): [True: 4, False: 0]
  ------------------
  321|      4|    return std::nullopt;
  322|      4|  }
  323|      0|  if (absl::GetFlag(FUZZTEST_FLAG(replay_corpus)) != kUnspecified &&
  ------------------
  |  |   20|      0|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  |  Branch (323:7): [True: 0, False: 0]
  |  Branch (323:7): [True: 0, False: 0]
  ------------------
  324|      0|      replay_corpus_time_limit <= absl::ZeroDuration()) {
  ------------------
  |  Branch (324:7): [True: 0, False: 0]
  ------------------
  325|      0|    replay_corpus_time_limit = absl::InfiniteDuration();
  326|      0|  }
  327|      0|  return replay_corpus_time_limit;
  328|      4|}
init_fuzztest.cc:_ZZN8fuzztest12InitFuzzTestEPiPPPcNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEENK3$_0clEv:
  421|      2|  const auto specified_test = []() -> std::optional<std::string> {
  422|      2|    if (auto internal_selected_test =
  423|      2|            absl::GetFlag(FUZZTEST_FLAG(internal_override_fuzz_test));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  424|      2|        internal_selected_test.has_value()) {
  ------------------
  |  Branch (424:9): [True: 0, False: 2]
  ------------------
  425|      0|      return internal_selected_test;
  426|      0|    }
  427|      2|    if (auto test_to_fuzz = absl::GetFlag(FUZZTEST_FLAG(fuzz));
  ------------------
  |  |   20|      2|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  428|      2|        test_to_fuzz != kUnspecified) {
  ------------------
  |  Branch (428:9): [True: 2, False: 0]
  ------------------
  429|      2|      return test_to_fuzz;
  430|      2|    }
  431|      0|    if (auto test_to_replay_corpus =
  432|      0|            absl::GetFlag(FUZZTEST_FLAG(replay_corpus));
  ------------------
  |  |   20|      0|#define FUZZTEST_FLAG(name) FLAGS_##name
  ------------------
  433|      0|        test_to_replay_corpus != kUnspecified) {
  ------------------
  |  Branch (433:9): [True: 0, False: 0]
  ------------------
  434|      0|      return test_to_replay_corpus;
  435|      0|    }
  436|      0|    return std::nullopt;
  437|      0|  }();
init_fuzztest.cc:_ZZN8fuzztest19ListRegisteredTestsEvENK3$_0clINS_8internal8FuzzTestEEEDaRKT_:
  261|     12|      [&](const auto& test) { result.push_back(test.full_name()); });

_ZNK8fuzztest8internal7AnyBase9has_valueEv:
   47|   179k|  bool has_value() const {
   48|   358k|    FUZZTEST_CHECK((vtable_ == nullptr) == (value_ == nullptr))
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|   179k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|   179k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|   358k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|   358k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 179k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|   179k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 179k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|   358k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 179k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 179k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 179k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|   179k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|   179k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|   358k|        << "Inconsistent state between value and vtable.";
   50|   179k|    return value_ != nullptr;
   51|   179k|  }
_ZN8fuzztest8internal7AnyBaseC2Ev:
   87|  13.7k|  AnyBase() : vtable_(nullptr), value_(nullptr) {}
_ZN8fuzztest8internal7AnyBaseC2EOS1_:
   90|  27.6k|      : vtable_(std::exchange(other.vtable_, nullptr)),
   91|  27.6k|        value_(std::exchange(other.value_, nullptr)) {}
_ZN8fuzztest8internal7AnyBaseD2Ev:
  101|  69.0k|  ~AnyBase() { Destroy(); }
_ZN8fuzztest8internal7AnyBase7DestroyEv:
  103|  69.0k|  void Destroy() {
  104|  69.0k|    if (has_value()) vtable_->destroy(value_);
  ------------------
  |  Branch (104:9): [True: 41.4k, False: 27.6k]
  ------------------
  105|  69.0k|  }
_ZN8fuzztest8internal7AnyBase8CopyFromERKS1_:
  107|  13.7k|  void CopyFrom(const AnyBase& other) {
  108|  27.5k|    FUZZTEST_CHECK(!has_value()) << "CopyFrom called on a full object";
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|  13.7k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  13.7k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  27.5k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  27.5k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  13.7k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  27.5k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  13.7k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  13.7k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|  13.7k|    if (other.has_value()) {
  ------------------
  |  Branch (109:9): [True: 13.7k, False: 0]
  ------------------
  110|  13.7k|      vtable_ = other.vtable_;
  111|  13.7k|      value_ = vtable_->copy(other.value_);
  112|  13.7k|    }
  113|  13.7k|  }
_ZN8fuzztest8internal11CopyableAnyC2ERKS1_:
  174|  13.7k|  CopyableAny(const CopyableAny& other) { CopyFrom(other); }
_ZN8fuzztest8internal11CopyableAnyC2EOS1_:
  175|  27.6k|  CopyableAny(CopyableAny&& other) = default;
_ZN8fuzztest8internal11CopyableAnyC2INSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEJSM_EEENS3_15in_place_type_tIT_EEDpOT0_:
  170|  13.8k|      : AnyBase(std::in_place, std::true_type{},
  171|  13.8k|                new T(std::forward<U>(args)...)) {}
_ZN8fuzztest8internal7AnyBaseC2INSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEEENS3_10in_place_tENS3_17integral_constantIbLb1EEEPT_:
   35|  13.8k|  explicit AnyBase(std::in_place_t, std::true_type, T* value) {
   36|  13.8k|    static constexpr VTable kVTable = {type_id<T>, DestroyImpl<T>, CopyImpl<T>};
   37|  13.8k|    vtable_ = &kVTable;
   38|  13.8k|    value_ = const_cast<void*>(static_cast<const void*>(value));
   39|  13.8k|  }
_ZN8fuzztest8internal7AnyBase11DestroyImplINSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEEEvPv:
  123|  27.6k|  static void DestroyImpl(void* p) {
  124|  27.6k|    delete static_cast<T*>(p);
  125|  27.6k|  }
_ZN8fuzztest8internal7AnyBase8CopyImplINSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEEEPvSN_:
  128|  13.7k|  static void* CopyImpl(void* p) {
  129|  13.7k|    return new T(*static_cast<T*>(p));
  130|  13.7k|  }
_ZNK8fuzztest8internal7AnyBase3HasINSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEEEbv:
   54|  27.6k|  bool Has() const {
   55|  27.6k|    return has_value() && vtable_->type_id == type_id<T>;
  ------------------
  |  Branch (55:12): [True: 27.6k, False: 0]
  |  Branch (55:27): [True: 27.6k, False: 0]
  ------------------
   56|  27.6k|  }
_ZNKR8fuzztest8internal7AnyBase5GetAsINSt3__15tupleIJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES6_S6_S6_NS3_6vectorIhNS3_9allocatorIhEEEEEEEttS6_bEEENS4_IJNS4_IJS6_S6_S6_S6_S6_NS7_ItNS8_ItEEEEEEEttS6_S6_bEEEEEENS4_IJiiEEENS4_IJS6_iiiiiiEEENS4_IJNS4_IJS6_iS6_bbbbS6_S6_S6_jEEES6_EEEEEEEERKT_v:
   66|  27.6k|  const T& GetAs() const& {
   67|  55.2k|    FUZZTEST_PRECONDITION(has_value()) << "Object is empty!";
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  27.6k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  27.6k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  55.2k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  55.2k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  27.6k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  55.2k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  27.6k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  27.6k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   68|  55.2k|    FUZZTEST_PRECONDITION(Has<T>()) << "Wrong type!";
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  27.6k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  27.6k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  55.2k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  55.2k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  27.6k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  55.2k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 27.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 27.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  27.6k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  27.6k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|  27.6k|    return *static_cast<T*>(value_);
   70|  27.6k|  }
_ZN8fuzztest8internal11MoveOnlyAnyC2INSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEJSL_EEENS3_15in_place_type_tIT_EEDpOT0_:
  151|  13.7k|      : AnyBase(std::in_place, std::false_type{},
  152|  13.7k|                new T(std::forward<U>(args)...)) {}
_ZN8fuzztest8internal7AnyBaseC2INSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEENS3_10in_place_tENS3_17integral_constantIbLb0EEEPT_:
   41|  13.7k|  explicit AnyBase(std::in_place_t, std::false_type, T* value) {
   42|  13.7k|    static constexpr VTable kVTable = {type_id<T>, DestroyImpl<T>, nullptr};
   43|  13.7k|    vtable_ = &kVTable;
   44|  13.7k|    value_ = const_cast<void*>(static_cast<const void*>(value));
   45|  13.7k|  }
_ZN8fuzztest8internal7AnyBase11DestroyImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEEvPv:
  123|  13.7k|  static void DestroyImpl(void* p) {
  124|  13.7k|    delete static_cast<T*>(p);
  125|  13.7k|  }
_ZNR8fuzztest8internal7AnyBase5GetAsINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEERT_v:
   59|  13.7k|  T& GetAs() & {
   60|  27.5k|    FUZZTEST_PRECONDITION(has_value()) << "Object is empty!";
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  13.7k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  13.7k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  27.5k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  27.5k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  13.7k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  27.5k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  13.7k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  13.7k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|  27.5k|    FUZZTEST_PRECONDITION(Has<T>()) << "Wrong type!";
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  13.7k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  13.7k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  27.5k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  27.5k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  13.7k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  27.5k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  13.7k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  13.7k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|  13.7k|    return *static_cast<T*>(value_);
   63|  13.7k|  }
_ZNK8fuzztest8internal7AnyBase3HasINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEEbv:
   54|  13.7k|  bool Has() const {
   55|  13.7k|    return has_value() && vtable_->type_id == type_id<T>;
  ------------------
  |  Branch (55:12): [True: 13.7k, False: 0]
  |  Branch (55:27): [True: 13.7k, False: 0]
  ------------------
   56|  13.7k|  }

_ZN8fuzztest8internal25SetExternalEngineCallbackEPNS0_22ExternalEngineCallbackE:
   33|      2|void SetExternalEngineCallback(ExternalEngineCallback* callback) {
   34|      2|  external_engine_callback = callback;
   35|      2|}
_ZN8fuzztest8internal25GetExternalEngineCallbackEv:
   37|  15.9k|ExternalEngineCallback* GetExternalEngineCallback() {
   38|  15.9k|  return external_engine_callback;
   39|  15.9k|}
_ZN8fuzztest8internal29FuzzTestExternalEngineAdaptorC2ERKNS0_8FuzzTestENSt3__110unique_ptrINS0_20UntypedFixtureDriverENS5_14default_deleteIS7_EEEE:
   65|      2|    : test_(test), fixture_driver_staging_(std::move(fixture_driver)) {}
_ZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS0_13ConfigurationE:
   73|      2|    int* argc, char*** argv, const Configuration& configuration) {
   74|      4|  FUZZTEST_CHECK(&LLVMFuzzerRunDriver) << "LibFuzzer Driver API not defined.";
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      2|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, Folded]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|      4|  FUZZTEST_CHECK(GetExternalEngineCallback() == nullptr)
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      4|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|      4|      << "External engine callback is already set while running a fuzz test.";
   77|      2|  SetExternalEngineCallback(this);
   78|      2|  runtime_.SetRunMode(RunMode::kFuzz);
   79|      2|  auto& impl = GetFuzzerImpl();
   80|      2|  runtime_.SetCurrentTest(&impl.test_, &configuration);
   81|      2|  runtime_.EnableReporter(&impl.stats_, [] { return absl::Now(); });
   82|       |
   83|      4|  FUZZTEST_CHECK(impl.fixture_driver_ != nullptr) << "Invalid fixture driver!";
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      4|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|      2|  impl.fixture_driver_->RunFuzzTest([&] {
   85|      2|    static bool driver_started = false;
   86|      2|    FUZZTEST_CHECK(!driver_started) << "Driver started more than once!";
   87|      2|    driver_started = true;
   88|      2|    LLVMFuzzerRunDriver(
   89|      2|        argc, argv, [](const uint8_t* data, size_t size) -> int {
   90|      2|          GetExternalEngineCallback()->RunOneInputData(
   91|      2|              absl::string_view(reinterpret_cast<const char*>(data), size));
   92|      2|          return 0;
   93|      2|        });
   94|      2|  });
   95|       |
   96|      2|  return true;
   97|      2|}
_ZN8fuzztest8internal29FuzzTestExternalEngineAdaptor15RunOneInputDataENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  109|  15.9k|void FuzzTestExternalEngineAdaptor::RunOneInputData(absl::string_view data) {
  110|  15.9k|  auto& impl = GetFuzzerImpl();
  111|  15.9k|  if (impl.ShouldStop()) {
  ------------------
  |  Branch (111:7): [True: 0, False: 15.9k]
  ------------------
  112|      0|    runtime_.PrintFinalStatsOnDefaultSink();
  113|       |    // Use _Exit instead of exit so libFuzzer does not treat it as a crash.
  114|      0|    std::_Exit(0);
  115|      0|  }
  116|  15.9k|  if (data.size() == 0) return;
  ------------------
  |  Branch (116:7): [True: 0, False: 15.9k]
  ------------------
  117|  15.9k|  auto input = impl.TryParse(data);
  118|  15.9k|  if (!input.ok()) return;
  ------------------
  |  Branch (118:7): [True: 2.15k, False: 13.7k]
  ------------------
  119|  13.7k|  impl.RunOneInput({*std::move(input)});
  120|  13.7k|}
_ZN8fuzztest8internal29FuzzTestExternalEngineAdaptor13GetFuzzerImplEv:
  151|  15.9k|FuzzTestExternalEngineAdaptor::GetFuzzerImpl() {
  152|       |  // Postpone the creation to override libFuzzer signal setup.
  153|  15.9k|  if (!fuzzer_impl_) {
  ------------------
  |  Branch (153:7): [True: 2, False: 15.9k]
  ------------------
  154|      2|    fuzzer_impl_ =
  155|      2|        std::make_unique<FuzzerImpl>(test_, std::move(fixture_driver_staging_));
  156|      2|    fixture_driver_staging_ = nullptr;
  157|      2|  }
  158|  15.9k|  return *fuzzer_impl_;
  159|  15.9k|}
compatibility_mode.cc:_ZZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS0_13ConfigurationEENK3$_1clEv:
   81|  13.7k|  runtime_.EnableReporter(&impl.stats_, [] { return absl::Now(); });
compatibility_mode.cc:_ZZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS0_13ConfigurationEENK3$_0clEv:
   84|      2|  impl.fixture_driver_->RunFuzzTest([&] {
   85|      2|    static bool driver_started = false;
   86|      4|    FUZZTEST_CHECK(!driver_started) << "Driver started more than once!";
  ------------------
  |  |   22|      0|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      4|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|      2|    driver_started = true;
   88|      2|    LLVMFuzzerRunDriver(
   89|      2|        argc, argv, [](const uint8_t* data, size_t size) -> int {
   90|      2|          GetExternalEngineCallback()->RunOneInputData(
   91|      2|              absl::string_view(reinterpret_cast<const char*>(data), size));
   92|      2|          return 0;
   93|      2|        });
   94|      2|  });
compatibility_mode.cc:_ZZZN8fuzztest8internal29FuzzTestExternalEngineAdaptor16RunInFuzzingModeEPiPPPcRKNS0_13ConfigurationEENK3$_0clEvENKUlPKhmE_clESB_m:
   89|  15.9k|        argc, argv, [](const uint8_t* data, size_t size) -> int {
   90|  15.9k|          GetExternalEngineCallback()->RunOneInputData(
   91|  15.9k|              absl::string_view(reinterpret_cast<const char*>(data), size));
   92|  15.9k|          return 0;
   93|  15.9k|        });

_ZNK8fuzztest8internal13Configuration19GetTimeLimitPerTestEv:
  318|      2|absl::Duration Configuration::GetTimeLimitPerTest() const {
  319|      2|  switch (time_budget_type) {
  320|      2|    case TimeBudgetType::kPerTest:
  ------------------
  |  Branch (320:5): [True: 2, False: 0]
  ------------------
  321|      2|      return time_limit;
  322|      0|    case TimeBudgetType::kTotal:
  ------------------
  |  Branch (322:5): [True: 0, False: 2]
  ------------------
  323|      0|      return time_limit / fuzz_tests_in_current_shard.size();
  324|      0|    default:
  ------------------
  |  Branch (324:5): [True: 0, False: 2]
  ------------------
  325|      0|      return absl::InfiniteDuration();
  326|      2|  }
  327|      2|}

_ZN8fuzztest8internal20GetExecutionCoverageEv:
   91|      2|ExecutionCoverage* GetExecutionCoverage() {
   92|      2|  return execution_coverage_instance;
   93|      2|}
_ZN8fuzztest8internal14CorpusCoverageC2Em:
  279|      2|CorpusCoverage::CorpusCoverage(size_t map_size) {
  280|      2|  size_t alignment = alignof(Vector);
  281|       |  // Round up to a multiple of alignment.
  282|      2|  map_size += alignment - 1;
  283|      2|  map_size -= map_size % alignment;
  284|       |  // And allocate an extra step to make sure the alignment logic has the
  285|       |  // necessary space.
  286|      2|  map_size += alignment;
  287|      2|  corpus_map_size_ = map_size;
  288|       |#if defined(_WIN32)
  289|       |  corpus_map_ = static_cast<uint8_t*>(_aligned_malloc(map_size, alignment));
  290|       |#else
  291|      2|  corpus_map_ = static_cast<uint8_t*>(std::aligned_alloc(alignment, map_size));
  292|      2|#endif
  293|      2|  std::fill(corpus_map_, corpus_map_ + corpus_map_size_, 0);
  294|      2|}

_ZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEE:
  173|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  174|  13.8k|    absl::Status result = absl::OkStatus();
  175|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
  176|  13.8k|      (
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
  183|  13.8k|          ...);
  184|  13.8k|    });
  185|  13.8k|    return result;
  186|  13.8k|  }
_ZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_:
  175|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
  176|  13.8k|      (
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
  183|  13.8k|          ...);
  184|  13.8k|    });
_ZZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_ENKUlvE2_clEv:
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (178:17): [True: 0, False: 13.8k]
  ------------------
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
_ZZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_ENKUlvE1_clEv:
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (178:17): [True: 9, False: 13.8k]
  ------------------
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
_ZZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_ENKUlvE0_clEv:
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (178:17): [True: 11, False: 13.8k]
  ------------------
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
_ZZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE19ValidateCorpusValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_ENKUlvE_clEv:
  177|  13.8k|          [&] {
  178|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (178:17): [True: 18, False: 13.8k]
  ------------------
  179|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  180|  13.8k|                std::get<I>(corpus_value));
  181|  13.8k|            result = Prefix(s, "Invalid value in aggregate");
  182|  13.8k|          }(),
_ZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  157|  15.0k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  158|  15.0k|    if constexpr (has_custom_corpus_type) {
  159|  15.0k|      return ParseWithDomainTuple(inner_, obj);
  160|       |    } else {
  161|       |      return obj.ToCorpus<corpus_type>();
  162|       |    }
  163|  15.0k|  }
_ZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE8GetValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEE:
  115|  13.7k|  value_type GetValue(const corpus_type& value) const {
  116|  13.7k|    if constexpr (has_custom_corpus_type) {
  117|       |      if constexpr (DetectBindableFieldCount<value_type>() ==
  118|  13.7k|                    DetectBraceInitCount<value_type>()) {
  119|  13.7k|        return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
  120|  13.7k|          return T{std::get<I>(inner_).GetValue(std::get<I>(value))...};
  121|  13.7k|        });
  122|       |      } else {
  123|       |        // Right now the only other possibility is that the bindable field count
  124|       |        // is one less than the brace init field count. In that case, that extra
  125|       |        // field is used to initialize an empty base class. We'll need to update
  126|       |        // this if that ever changes.
  127|       |        return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
  128|       |          return T{{}, std::get<I>(inner_).GetValue(std::get<I>(value))...};
  129|       |        });
  130|       |      }
  131|       |    } else {
  132|       |      return value;
  133|       |    }
  134|  13.7k|  }
_ZZNK8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEE8GetValueERKNS3_IJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES1Q_S1Q_S1Q_NS4_IhNSA_IhEEEEEEEttS1Q_bEEENS3_IJNS3_IJS1Q_S1Q_S1Q_S1Q_S1Q_NS4_ItNSA_ItEEEEEEEttS1Q_S1Q_bEEEEEENS3_IJiiEEENS3_IJS1Q_iiiiiiEEENS3_IJNS3_IJS1Q_iS1Q_bbbbS1Q_S1Q_S1Q_jEEES1Q_EEEEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS2B_ImLm1EEENS2B_ImLm2EEENS2B_ImLm3EEEEEEDaS28_:
  119|  13.7k|        return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
  120|  13.7k|          return T{std::get<I>(inner_).GetValue(std::get<I>(value))...};
  121|  13.7k|        });
_ZN8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESS_NS0_13ElementOfImplISP_EENS0_13ArbitraryImplIbvEEEEENSN_IZNSO_23ArbitraryAvifLayered16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENS0_7MapImplIPFSF_iiEJNSR_IiEES15_EEENS12_IPFSH_15avifCodecChoiceiiiiiiEJNST_IS17_EES15_S15_S15_S15_S15_S15_EEENS12_IPFSJ_SJ_jEJNS12_IPFSJ_S17_i17avifDecoderSourcebbbbjjjjEJS1A_S15_NST_IS1E_EESW_SW_SW_SW_NST_ImEES1I_SZ_NS0_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEEC2ENS2_10in_place_tES11_S16_S1B_S1N_:
   58|      2|      : inner_(std::move(inner)...) {}
_ZN8fuzztest8internal15AggregateOfImplINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESP_NS0_13ElementOfImplISM_EENS0_13ArbitraryImplIbvEEEEENSK_IZNSL_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSM_bE_JSP_SP_NSQ_IiEESR_ST_EEEEEENS0_7MapImplIPFSE_15avifCodecChoiceiiiiiiEJNSQ_IS10_EENSO_IiEES14_S14_S14_S14_S14_EEENSZ_IPFSG_SG_jEJNSZ_IPFSG_S10_i17avifDecoderSourcebbbbjjjjEJS13_S14_NSQ_IS18_EEST_ST_ST_ST_NSQ_ImEES1C_SW_NS0_24BitFlagCombinationOfImplIjEEEEENSQ_IjEEEEEEEC2ENS2_10in_place_tESY_S15_S1H_:
   58|      2|      : inner_(std::move(inner)...) {}

_ZNK8fuzztest8internal13ArbitraryImplIbvE19ValidateCorpusValueERKb:
  131|  82.8k|  absl::Status ValidateCorpusValue(const value_type&) const {
  132|  82.8k|    return absl::OkStatus();  // Nothing to validate.
  133|  82.8k|  }
_ZNK8fuzztest8internal13ArbitraryImplIhvE19ValidateCorpusValueERKh:
  209|   393M|  absl::Status ValidateCorpusValue(const value_type&) const {
  210|   393M|    return absl::OkStatus();  // Nothing to validate.
  211|   393M|  }

_ZNK8fuzztest8internal24BitFlagCombinationOfImplIjE19ValidateCorpusValueERKj:
   70|  13.7k|  absl::Status ValidateCorpusValue(const value_type& val) const {
   71|  13.7k|    if (BitOr(val, all_flags_combo_) != all_flags_combo_) {
  ------------------
  |  Branch (71:9): [True: 1, False: 13.7k]
  ------------------
   72|      1|      return absl::InvalidArgumentError("Invalid bit flag combination.");
   73|      1|    }
   74|  13.7k|    return absl::OkStatus();
   75|  13.7k|  }
_ZN8fuzztest8internal24BitFlagCombinationOfImplIjE6BitAndIjEEjT_S4_:
   81|     12|  static value_type BitAnd(U a, U b) {
   82|       |    if constexpr (std::is_enum_v<U>) {
   83|       |      return BitAnd(static_cast<std::underlying_type_t<U>>(a),
   84|       |                    static_cast<std::underlying_type_t<U>>(b));
   85|     12|    } else {
   86|     12|      return static_cast<value_type>(a & b);
   87|     12|    }
   88|     12|  }
_ZN8fuzztest8internal24BitFlagCombinationOfImplIjE5BitOrIjEEjT_S4_:
   91|  13.8k|  static value_type BitOr(U a, U b) {
   92|       |    if constexpr (std::is_enum_v<U>) {
   93|       |      return BitOr(static_cast<std::underlying_type_t<U>>(a),
   94|       |                   static_cast<std::underlying_type_t<U>>(b));
   95|  13.8k|    } else {
   96|  13.8k|      return static_cast<value_type>(a | b);
   97|  13.8k|    }
   98|  13.8k|  }
_ZN8fuzztest8internal24BitFlagCombinationOfImplIjEC2EN4absl12lts_202605264SpanIKjEE:
   38|      4|      : flags_(flags.begin(), flags.end()), all_flags_combo_{} {
   39|      8|    FUZZTEST_PRECONDITION(!flags.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      4|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      4|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      8|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      8|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      4|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      8|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      4|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      4|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|      8|        << "BitFlagCombinationOf requires a non empty list.";
   41|       |    // Make sure they are mutually exclusive metadata, only_shrink and none are
   42|       |    // empty.
   43|     16|    for (int i = 0; i < flags.size(); ++i) {
  ------------------
  |  Branch (43:21): [True: 12, False: 4]
  ------------------
   44|     12|      T v1 = flags[i];
   45|     24|      FUZZTEST_PRECONDITION(v1 != T{})
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|     12|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|     12|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|     24|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|     24|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 12, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|     12|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 12]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|     24|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 12, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 12]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 12]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|     12|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|     12|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|     24|          << "BitFlagCombinationOf requires non zero flags.";
   47|     24|      for (int j = i + 1; j < flags.size(); ++j) {
  ------------------
  |  Branch (47:27): [True: 12, False: 12]
  ------------------
   48|     12|        T v2 = flags[j];
   49|     24|        FUZZTEST_PRECONDITION(BitAnd(v1, v2) == T{})
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|     12|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|     12|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|     24|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|     24|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 12, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|     12|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 12]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|     24|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 12, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 12]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 12]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|     12|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|     12|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|     24|            << "BitFlagCombinationOf requires flags to be mutually exclusive.";
   51|     12|      }
   52|     12|      all_flags_combo_ = BitOr(all_flags_combo_, v1);
   53|     12|    }
   54|      4|  }

_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E19ValidateCorpusValueERKS7_:
  339|  9.93k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  340|       |    // Check size.
  341|  9.93k|    if (corpus_value.size() < min_size()) {
  ------------------
  |  Branch (341:9): [True: 0, False: 9.93k]
  ------------------
  342|      0|      return absl::InvalidArgumentError(absl::StrCat(
  343|      0|          "Invalid size: ", corpus_value.size(), ". Min size: ", min_size()));
  344|      0|    }
  345|  9.93k|    if (validate_max_size() && corpus_value.size() > max_size()) {
  ------------------
  |  Branch (345:9): [True: 9.93k, False: 0]
  |  Branch (345:32): [True: 1, False: 9.93k]
  ------------------
  346|      1|      return absl::InvalidArgumentError(absl::StrCat(
  347|      1|          "Invalid size: ", corpus_value.size(), ". Max size: ", max_size()));
  348|      1|    }
  349|       |    // Check elements.
  350|  9.93k|    int i = 0;
  351|   393M|    for (const auto& elem : corpus_value) {
  ------------------
  |  Branch (351:27): [True: 393M, False: 9.93k]
  ------------------
  352|   393M|      const absl::Status s = inner_.ValidateCorpusValue(elem);
  353|   393M|      if (!s.ok()) {
  ------------------
  |  Branch (353:11): [True: 0, False: 393M]
  ------------------
  354|      0|        return Prefix(s,
  355|      0|                      absl::StrCat("Invalid value in container at index ", i));
  356|      0|      }
  357|   393M|      i++;
  358|   393M|    }
  359|  9.93k|    return absl::OkStatus();
  360|  9.93k|  }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E8min_sizeEv:
  394|  9.93k|  size_t min_size() const { return min_size_; }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E17validate_max_sizeEv:
  398|  9.93k|  bool validate_max_size() const { return validate_max_size_; }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E8max_sizeEv:
  395|  9.93k|  size_t max_size() const {
  396|  9.93k|    return max_size_.value_or(std::max(min_size_, kDefaultContainerMaxSize));
  397|  9.93k|  }
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E4SelfEv:
  401|  29.8k|  Derived& Self() { return static_cast<Derived&>(*this); }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E11ParseCorpusERKNS0_6no_adl8IRObjectE:
  305|  9.95k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  306|       |    // Use the generic serializer when no custom corpus type is used, since it
  307|       |    // is more efficient. Eg a string value can be serialized as a string
  308|       |    // instead of as a sequence of char values.
  309|       |    if constexpr (has_custom_corpus_type) {
  310|       |      auto subs = obj.Subs();
  311|       |      if (!subs) return std::nullopt;
  312|       |      corpus_type res;
  313|       |      for (const auto& elem : *subs) {
  314|       |        if (auto parsed_elem = inner_.ParseCorpus(elem)) {
  315|       |          res.insert(res.end(), std::move(*parsed_elem));
  316|       |        } else {
  317|       |          return std::nullopt;
  318|       |        }
  319|       |      }
  320|       |      return res;
  321|  9.95k|    } else {
  322|  9.95k|      return obj.ToCorpus<corpus_type>();
  323|  9.95k|    }
  324|  9.95k|  }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E8GetValueERKS7_:
  279|  9.91k|  value_type GetValue(const corpus_type& value) const {
  280|       |    if constexpr (has_custom_corpus_type) {
  281|       |      value_type result;
  282|       |      for (const auto& v : value) {
  283|       |        result.insert(result.end(), inner_.GetValue(v));
  284|       |      }
  285|       |      return result;
  286|  9.91k|    } else {
  287|  9.91k|      return value;
  288|  9.91k|    }
  289|  9.91k|  }
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_E8WithSizeEm:
  225|  29.8k|  Derived& WithSize(size_t s) {
  226|  29.8k|    max_size_ = min_size_ = s;
  227|  29.8k|    return Self();
  228|  29.8k|  }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E19ValidateCorpusValueERKS7_:
  339|  3.88k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  340|       |    // Check size.
  341|  3.88k|    if (corpus_value.size() < min_size()) {
  ------------------
  |  Branch (341:9): [True: 1, False: 3.88k]
  ------------------
  342|      1|      return absl::InvalidArgumentError(absl::StrCat(
  343|      1|          "Invalid size: ", corpus_value.size(), ". Min size: ", min_size()));
  344|      1|    }
  345|  3.88k|    if (validate_max_size() && corpus_value.size() > max_size()) {
  ------------------
  |  Branch (345:9): [True: 3.88k, False: 0]
  |  Branch (345:32): [True: 0, False: 3.88k]
  ------------------
  346|      0|      return absl::InvalidArgumentError(absl::StrCat(
  347|      0|          "Invalid size: ", corpus_value.size(), ". Max size: ", max_size()));
  348|      0|    }
  349|       |    // Check elements.
  350|  3.88k|    int i = 0;
  351|  35.1M|    for (const auto& elem : corpus_value) {
  ------------------
  |  Branch (351:27): [True: 35.1M, False: 3.87k]
  ------------------
  352|  35.1M|      const absl::Status s = inner_.ValidateCorpusValue(elem);
  353|  35.1M|      if (!s.ok()) {
  ------------------
  |  Branch (353:11): [True: 3, False: 35.1M]
  ------------------
  354|      3|        return Prefix(s,
  355|      3|                      absl::StrCat("Invalid value in container at index ", i));
  356|      3|      }
  357|  35.1M|      i++;
  358|  35.1M|    }
  359|  3.87k|    return absl::OkStatus();
  360|  3.88k|  }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E8min_sizeEv:
  394|  3.88k|  size_t min_size() const { return min_size_; }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E17validate_max_sizeEv:
  398|  3.88k|  bool validate_max_size() const { return validate_max_size_; }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E8max_sizeEv:
  395|  3.88k|  size_t max_size() const {
  396|  3.88k|    return max_size_.value_or(std::max(min_size_, kDefaultContainerMaxSize));
  397|  3.88k|  }
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E4SelfEv:
  401|  11.6k|  Derived& Self() { return static_cast<Derived&>(*this); }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E11ParseCorpusERKNS0_6no_adl8IRObjectE:
  305|  3.88k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  306|       |    // Use the generic serializer when no custom corpus type is used, since it
  307|       |    // is more efficient. Eg a string value can be serialized as a string
  308|       |    // instead of as a sequence of char values.
  309|       |    if constexpr (has_custom_corpus_type) {
  310|       |      auto subs = obj.Subs();
  311|       |      if (!subs) return std::nullopt;
  312|       |      corpus_type res;
  313|       |      for (const auto& elem : *subs) {
  314|       |        if (auto parsed_elem = inner_.ParseCorpus(elem)) {
  315|       |          res.insert(res.end(), std::move(*parsed_elem));
  316|       |        } else {
  317|       |          return std::nullopt;
  318|       |        }
  319|       |      }
  320|       |      return res;
  321|  3.88k|    } else {
  322|  3.88k|      return obj.ToCorpus<corpus_type>();
  323|  3.88k|    }
  324|  3.88k|  }
_ZNK8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E8GetValueERKS7_:
  279|  3.87k|  value_type GetValue(const corpus_type& value) const {
  280|       |    if constexpr (has_custom_corpus_type) {
  281|       |      value_type result;
  282|       |      for (const auto& v : value) {
  283|       |        result.insert(result.end(), inner_.GetValue(v));
  284|       |      }
  285|       |      return result;
  286|  3.87k|    } else {
  287|  3.87k|      return value;
  288|  3.87k|    }
  289|  3.87k|  }
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_E8WithSizeEm:
  225|  11.6k|  Derived& WithSize(size_t s) {
  226|  11.6k|    max_size_ = min_size_ = s;
  227|  11.6k|    return Self();
  228|  11.6k|  }
_ZN8fuzztest8internal27SequenceContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_EC2Ev:
  572|  29.8k|  SequenceContainerOfImplBase() = default;
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorIhNS3_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEES7_S9_EC2Ev:
  110|  29.8k|  ContainerOfImplBase() = default;
_ZN8fuzztest8internal27SequenceContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_EC2ES9_:
  574|  11.6k|      : Base(std::move(inner)) {}
_ZN8fuzztest8internal19ContainerOfImplBaseINS0_23SequenceContainerOfImplINSt3__16vectorItNS3_9allocatorItEEEENS0_11InRangeImplItEEEES7_S9_EC2ES9_:
  111|  11.6k|  explicit ContainerOfImplBase(InnerDomainT inner) : inner_(std::move(inner)) {}

_ZNK8fuzztest13UntypedDomain8GetValueERKNS_8internal11CopyableAnyE:
  347|  13.7k|  value_type GetValue(const corpus_type& corpus_value) const {
  348|  13.7k|    return inner_->UntypedGetValue(corpus_value);
  349|  13.7k|  }
_ZNK8fuzztest13UntypedDomain11ParseCorpusERKNS_8internal6no_adl8IRObjectE:
  351|  15.0k|  std::optional<corpus_type> ParseCorpus(const internal::IRObject& obj) const {
  352|  15.0k|    return inner_->UntypedParseCorpus(obj);
  353|  15.0k|  }
_ZNK8fuzztest13UntypedDomain19ValidateCorpusValueERKNS_8internal11CopyableAnyE:
  359|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  360|  13.8k|    return inner_->UntypedValidateCorpusValue(corpus_value);
  361|  13.8k|  }
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS1_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEC2INS_8internal15AggregateOfImplISJ_LNSM_23RequireCustomCorpusTypeE0EJNSM_9OneOfImplIJNSM_11FlatMapImplIZNS6_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNSM_11InRangeImplItEESV_NSM_13ElementOfImplISS_EENSM_13ArbitraryImplIbvEEEEENSQ_IZNSR_23ArbitraryAvifLayered16bEvEUlmmiSS_bE_JSV_SV_NSW_IiEESX_SZ_EEEEEENSM_7MapImplIPFSE_iiEJNSU_IiEES18_EEENS15_IPFSG_15avifCodecChoiceiiiiiiEJNSW_IS1A_EES18_S18_S18_S18_S18_S18_EEENS15_IPFSI_SI_jEJNS15_IPFSI_S1A_i17avifDecoderSourcebbbbjjjjEJS1D_S18_NSW_IS1H_EESZ_SZ_SZ_SZ_NSW_ImEES1L_S12_NSM_24BitFlagCombinationOfImplIjEEEEENSW_IjEEEEEEEENS2_IJNS1_7variantIJNS2_IJNS2_IJNSM_23ElementOfImplCorpusTypeES1T_S1T_S1T_NS3_IhNS9_IhEEEEEEEttS1T_bEEENS2_IJNS2_IJS1T_S1T_S1T_S1T_S1T_NS3_ItNS9_ItEEEEEEEttS1T_S1T_bEEEEEENS2_IJiiEEENS2_IJS1T_iiiiiiEEENS2_IJNS2_IJS1T_iS1T_bbbbS1T_S1T_S1T_jEEES1T_EEEEEEEEONS_18domain_implementor10DomainBaseIT_SJ_T0_EE:
  112|      2|      : inner_(std::make_unique<internal::DomainModel<Inner>>(
  113|      2|            static_cast<Inner&&>(inner))) {}
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS1_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEC2ERKSK_:
  115|     12|  Domain(const Domain& other) { *this = other; }
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS1_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEaSERKSK_:
  116|     12|  Domain& operator=(const Domain& other) {
  117|     12|    inner_ = other.inner_->TypedClone();
  118|     12|    return *this;
  119|     12|  }
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEC2INS_8internal15AggregateOfImplISG_LNSJ_23RequireCustomCorpusTypeE0EJNSJ_9OneOfImplIJNSJ_11FlatMapImplIZNS6_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNSJ_11InRangeImplItEESS_NSJ_13ElementOfImplISP_EENSJ_13ArbitraryImplIbvEEEEENSN_IZNSO_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSP_bE_JSS_SS_NST_IiEESU_SW_EEEEEENSJ_7MapImplIPFSD_15avifCodecChoiceiiiiiiEJNST_IS13_EENSR_IiEES17_S17_S17_S17_S17_EEENS12_IPFSF_SF_jEJNS12_IPFSF_S13_i17avifDecoderSourcebbbbjjjjEJS16_S17_NST_IS1B_EESW_SW_SW_SW_NST_ImEES1F_SZ_NSJ_24BitFlagCombinationOfImplIjEEEEENST_IjEEEEEEEENS2_IJNS1_7variantIJNS2_IJNS2_IJNSJ_23ElementOfImplCorpusTypeES1N_S1N_S1N_NS3_IhNS9_IhEEEEEEEttS1N_bEEENS2_IJNS2_IJS1N_S1N_S1N_S1N_S1N_NS3_ItNS9_ItEEEEEEEttS1N_S1N_bEEEEEENS2_IJS1N_iiiiiiEEENS2_IJNS2_IJS1N_iS1N_bbbbS1N_S1N_S1N_jEEES1N_EEEEEEEEONS_18domain_implementor10DomainBaseIT_SG_T0_EE:
  112|      2|      : inner_(std::make_unique<internal::DomainModel<Inner>>(
  113|      2|            static_cast<Inner&&>(inner))) {}
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEC2ERKSH_:
  115|      6|  Domain(const Domain& other) { *this = other; }
_ZN8fuzztest6DomainINSt3__15tupleIJNS1_6vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS8_EEEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEEEEaSERKSH_:
  116|      6|  Domain& operator=(const Domain& other) {
  117|      6|    inner_ = other.inner_->TypedClone();
  118|      6|    return *this;
  119|      6|  }
_ZN8fuzztest13UntypedDomainC2INSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEEEERKNS_6DomainIT_EE:
  332|      2|      : inner_(domain.inner_->UntypedClone()) {}

_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplIiEEiiE8GetValueERKi:
  139|   124k|  ValueType GetValue(const ValueType& v) const {
  140|   124k|    static_assert(!has_custom_corpus_type);
  141|   124k|    return v;
  142|   124k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplIiEEiiE11ParseCorpusERKNS2_6no_adl8IRObjectE:
  148|   124k|  std::optional<CorpusType> ParseCorpus(const IRObject& obj) const {
  149|   124k|    static_assert(!has_custom_corpus_type);
  150|   124k|    return obj.ToCorpus<CorpusType>();
  151|   124k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplItEEttE8GetValueERKt:
  139|  82.9k|  ValueType GetValue(const ValueType& v) const {
  140|  82.9k|    static_assert(!has_custom_corpus_type);
  141|  82.9k|    return v;
  142|  82.9k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplItEEttE11ParseCorpusERKNS2_6no_adl8IRObjectE:
  148|  27.6k|  std::optional<CorpusType> ParseCorpus(const IRObject& obj) const {
  149|  27.6k|    static_assert(!has_custom_corpus_type);
  150|  27.6k|    return obj.ToCorpus<CorpusType>();
  151|  27.6k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal13ArbitraryImplIbvEEbbE11ParseCorpusERKNS2_6no_adl8IRObjectE:
  148|  69.2k|  std::optional<CorpusType> ParseCorpus(const IRObject& obj) const {
  149|  69.2k|    static_assert(!has_custom_corpus_type);
  150|  69.2k|    return obj.ToCorpus<CorpusType>();
  151|  69.2k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal13ArbitraryImplIbvEEbbE8GetValueERKb:
  139|  96.6k|  ValueType GetValue(const ValueType& v) const {
  140|  96.6k|    static_assert(!has_custom_corpus_type);
  141|  96.6k|    return v;
  142|  96.6k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal24BitFlagCombinationOfImplIjEEjjE11ParseCorpusERKNS2_6no_adl8IRObjectE:
  148|  13.8k|  std::optional<CorpusType> ParseCorpus(const IRObject& obj) const {
  149|  13.8k|    static_assert(!has_custom_corpus_type);
  150|  13.8k|    return obj.ToCorpus<CorpusType>();
  151|  13.8k|  }
_ZNK8fuzztest18domain_implementor10DomainBaseINS_8internal24BitFlagCombinationOfImplIjEEjjE8GetValueERKj:
  139|  13.7k|  ValueType GetValue(const ValueType& v) const {
  140|  13.7k|    static_assert(!has_custom_corpus_type);
  141|  13.7k|    return v;
  142|  13.7k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEEmm15avifPixelFormatbRKNS5_IhNSB_IhEEEEEJNS2_13ElementOfImplImEESM_NSL_ISE_EENSL_IbEENS2_23SequenceContainerOfImplISG_NS2_13ArbitraryImplIhvEEEEEEESD_NS4_5tupleIJNS2_23ElementOfImplCorpusTypeESV_SV_SV_SG_EEEEC2Ev:
  111|  29.8k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  29.8k|    fuzztest::internal::CheckIsSame<
  118|  29.8k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  29.8k|    fuzztest::internal::CheckIsSame<
  120|  29.8k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  29.8k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  29.8k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 29.8k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  29.8k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplImEEmNS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|  82.9k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  82.9k|    fuzztest::internal::CheckIsSame<
  118|  82.9k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  82.9k|    fuzztest::internal::CheckIsSame<
  120|  82.9k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  82.9k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  82.9k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 82.9k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  82.9k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplI15avifPixelFormatEES4_NS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|  41.4k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  41.4k|    fuzztest::internal::CheckIsSame<
  118|  41.4k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  41.4k|    fuzztest::internal::CheckIsSame<
  120|  41.4k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  41.4k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  41.4k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 41.4k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  41.4k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplIbEEbNS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|  41.4k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  41.4k|    fuzztest::internal::CheckIsSame<
  118|  41.4k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  41.4k|    fuzztest::internal::CheckIsSame<
  120|  41.4k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  41.4k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  41.4k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 41.4k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  41.4k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal23SequenceContainerOfImplINSt3__16vectorIhNS4_9allocatorIhEEEENS2_13ArbitraryImplIhvEEEES8_S8_EC2Ev:
  111|  29.8k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  29.8k|    fuzztest::internal::CheckIsSame<
  118|  29.8k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  29.8k|    fuzztest::internal::CheckIsSame<
  120|  29.8k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  29.8k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  29.8k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 29.8k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  29.8k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ArbitraryImplIhvEEhhEC2Ev:
  111|  29.8k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  29.8k|    fuzztest::internal::CheckIsSame<
  118|  29.8k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  29.8k|    fuzztest::internal::CheckIsSame<
  120|  29.8k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  29.8k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  29.8k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 29.8k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  29.8k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEEmmi15avifPixelFormatbRKNS5_ItNSB_ItEEEEEJNS2_13ElementOfImplImEESM_NSL_IiEENSL_ISE_EENSL_IbEENS2_23SequenceContainerOfImplISG_NS2_11InRangeImplItEEEEEEESD_NS4_5tupleIJNS2_23ElementOfImplCorpusTypeESW_SW_SW_SW_SG_EEEEC2Ev:
  111|  11.6k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  11.6k|    fuzztest::internal::CheckIsSame<
  118|  11.6k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  11.6k|    fuzztest::internal::CheckIsSame<
  120|  11.6k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  11.6k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  11.6k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 11.6k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  11.6k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplIiEEiNS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|  11.6k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  11.6k|    fuzztest::internal::CheckIsSame<
  118|  11.6k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  11.6k|    fuzztest::internal::CheckIsSame<
  120|  11.6k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  11.6k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  11.6k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 11.6k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  11.6k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal23SequenceContainerOfImplINSt3__16vectorItNS4_9allocatorItEEEENS2_11InRangeImplItEEEES8_S8_EC2Ev:
  111|  11.6k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  11.6k|    fuzztest::internal::CheckIsSame<
  118|  11.6k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  11.6k|    fuzztest::internal::CheckIsSame<
  120|  11.6k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  11.6k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  11.6k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 11.6k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  11.6k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplItEEttEC2Ev:
  111|  11.6k|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|  11.6k|    fuzztest::internal::CheckIsSame<
  118|  11.6k|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|  11.6k|    fuzztest::internal::CheckIsSame<
  120|  11.6k|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|  11.6k|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|  11.6k|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 11.6k]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|  11.6k|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal15AggregateOfImplINSt3__15tupleIJNS4_6vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISB_EEEENS4_5arrayI15avifScalingModeLm4EEENS7_I11avifEncoderSA_EENS7_I11avifDecoderSA_EEEEELNS2_23RequireCustomCorpusTypeE0EJNS2_9OneOfImplIJNS2_11FlatMapImplIZNS9_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEESU_NS2_13ElementOfImplISR_EENS2_13ArbitraryImplIbvEEEEENSP_IZNSQ_23ArbitraryAvifLayered16bEvEUlmmiSR_bE_JSU_SU_NSV_IiEESW_SY_EEEEEENS2_7MapImplIPFSH_iiEJNST_IiEES17_EEENS14_IPFSJ_15avifCodecChoiceiiiiiiEJNSV_IS19_EES17_S17_S17_S17_S17_S17_EEENS14_IPFSL_SL_jEJNS14_IPFSL_S19_i17avifDecoderSourcebbbbjjjjEJS1C_S17_NSV_IS1G_EESY_SY_SY_SY_NSV_ImEES1K_S11_NS2_24BitFlagCombinationOfImplIjEEEEENSV_IjEEEEEEEESM_NS5_IJNS4_7variantIJNS5_IJNS5_IJNS2_23ElementOfImplCorpusTypeES1S_S1S_S1S_NS6_IhNSC_IhEEEEEEEttS1S_bEEENS5_IJNS5_IJS1S_S1S_S1S_S1S_S1S_NS6_ItNSC_ItEEEEEEEttS1S_S1S_bEEEEEENS5_IJiiEEENS5_IJS1S_iiiiiiEEENS5_IJNS5_IJS1S_iS1S_bbbbS1S_S1S_S1S_jEEES1S_EEEEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal9OneOfImplIJNS2_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEESA_NS2_13ElementOfImplIS7_EENS2_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEENSt3__16vectorINSK_10unique_ptrI9avifImageNS5_16UniquePtrDeleterEEENSK_9allocatorISP_EEEENSK_7variantIJNSK_5tupleIJNSU_IJNS2_23ElementOfImplCorpusTypeESV_SV_SV_NSL_IhNSQ_IhEEEEEEEttSV_bEEENSU_IJNSU_IJSV_SV_SV_SV_SV_NSL_ItNSQ_ItEEEEEEEttSV_SV_bEEEEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEES9_NS2_13ElementOfImplIS6_EENS2_13ArbitraryImplIbvEEEEENSt3__16vectorINSF_10unique_ptrI9avifImageNS4_16UniquePtrDeleterEEENSF_9allocatorISK_EEEENSF_5tupleIJNSO_IJNS2_23ElementOfImplCorpusTypeESP_SP_SP_NSG_IhNSL_IhEEEEEEEttSP_bEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ArbitraryImplIbvEEbbEC2Ev:
  111|     24|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|     24|    fuzztest::internal::CheckIsSame<
  118|     24|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|     24|    fuzztest::internal::CheckIsSame<
  120|     24|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|     24|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|     24|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 24]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|     24|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS2_11InRangeImplItEES9_NS2_13ElementOfImplIiEENSA_IS6_EENS2_13ArbitraryImplIbvEEEEENSt3__16vectorINSG_10unique_ptrI9avifImageNS4_16UniquePtrDeleterEEENSG_9allocatorISL_EEEENSG_5tupleIJNSP_IJNS2_23ElementOfImplCorpusTypeESQ_SQ_SQ_SQ_NSH_ItNSM_ItEEEEEEEttSQ_SQ_bEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS2_11InRangeImplIiEESB_EEES7_NS4_5tupleIJiiEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11InRangeImplIiEEiiEC2Ev:
  111|     32|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|     32|    fuzztest::internal::CheckIsSame<
  118|     32|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|     32|    fuzztest::internal::CheckIsSame<
  120|     32|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|     32|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|     32|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 32]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|     32|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplI15avifCodecChoiceEES4_NS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|      8|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      8|    fuzztest::internal::CheckIsSame<
  118|      8|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      8|    fuzztest::internal::CheckIsSame<
  120|      8|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      8|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      8|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 8]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      8|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS2_13ElementOfImplISA_EENS2_11InRangeImplIiEESG_SG_SG_SG_SG_EEES9_NS4_5tupleIJNS2_23ElementOfImplCorpusTypeEiiiiiiEEEEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES9_jEJNS3_IPFS9_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS2_13ElementOfImplISC_EENS2_11InRangeImplIiEENSG_ISD_EENS2_13ArbitraryImplIbvEESM_SM_SM_NSG_ImEESN_NSG_IiEENS2_24BitFlagCombinationOfImplIjEEEEENSG_IjEEEEES9_NS4_5tupleIJNSU_IJNS2_23ElementOfImplCorpusTypeEiSV_bbbbSV_SV_SV_jEEESV_EEEEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS2_13ElementOfImplISA_EENS2_11InRangeImplIiEENSE_ISB_EENS2_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS2_24BitFlagCombinationOfImplIjEEEEES9_NS4_5tupleIJNS2_23ElementOfImplCorpusTypeEiSR_bbbbSR_SR_SR_jEEEEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplI17avifDecoderSourceEES4_NS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal24BitFlagCombinationOfImplIjEEjjEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal13ElementOfImplIjEEjNS2_23ElementOfImplCorpusTypeEEC2Ev:
  111|      4|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      4|    fuzztest::internal::CheckIsSame<
  118|      4|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      4|    fuzztest::internal::CheckIsSame<
  120|      4|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      4|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      4|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 4]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      4|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal15AggregateOfImplINSt3__15tupleIJNS4_6vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISB_EEEENS7_I11avifEncoderSA_EENS7_I11avifDecoderSA_EEEEELNS2_23RequireCustomCorpusTypeE0EJNS2_9OneOfImplIJNS2_11FlatMapImplIZNS9_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEESR_NS2_13ElementOfImplISO_EENS2_13ArbitraryImplIbvEEEEENSM_IZNSN_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSO_bE_JSR_SR_NSS_IiEEST_SV_EEEEEENS2_7MapImplIPFSG_15avifCodecChoiceiiiiiiEJNSS_IS12_EENSQ_IiEES16_S16_S16_S16_S16_EEENS11_IPFSI_SI_jEJNS11_IPFSI_S12_i17avifDecoderSourcebbbbjjjjEJS15_S16_NSS_IS1A_EESV_SV_SV_SV_NSS_ImEES1E_SY_NS2_24BitFlagCombinationOfImplIjEEEEENSS_IjEEEEEEEESJ_NS5_IJNS4_7variantIJNS5_IJNS5_IJNS2_23ElementOfImplCorpusTypeES1M_S1M_S1M_NS6_IhNSC_IhEEEEEEEttS1M_bEEENS5_IJNS5_IJS1M_S1M_S1M_S1M_S1M_NS6_ItNSC_ItEEEEEEEttS1M_S1M_bEEEEEENS5_IJS1M_iiiiiiEEENS5_IJNS5_IJS1M_iS1M_bbbbS1M_S1M_S1M_jEEES1M_EEEEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal9OneOfImplIJNS2_11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEESA_NS2_13ElementOfImplIS7_EENS2_13ArbitraryImplIbvEEEEENS4_IZNS6_30ArbitraryAvifLayeredRandDim16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEENSt3__16vectorINSK_10unique_ptrI9avifImageNS5_16UniquePtrDeleterEEENSK_9allocatorISP_EEEENSK_7variantIJNSK_5tupleIJNSU_IJNS2_23ElementOfImplCorpusTypeESV_SV_SV_NSL_IhNSQ_IhEEEEEEEttSV_bEEENSU_IJNSU_IJSV_SV_SV_SV_SV_NSL_ItNSQ_ItEEEEEEEttSV_SV_bEEEEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS2_11InRangeImplItEES9_NS2_13ElementOfImplIS6_EENS2_13ArbitraryImplIbvEEEEENSt3__16vectorINSF_10unique_ptrI9avifImageNS4_16UniquePtrDeleterEEENSF_9allocatorISK_EEEENSF_5tupleIJNSO_IJNS2_23ElementOfImplCorpusTypeESP_SP_SP_NSG_IhNSL_IhEEEEEEEttSP_bEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }
_ZN8fuzztest18domain_implementor10DomainBaseINS_8internal11FlatMapImplIZN4avif8testutil30ArbitraryAvifLayeredRandDim16bEvEUlmmi15avifPixelFormatbE_JNS2_11InRangeImplItEES9_NS2_13ElementOfImplIiEENSA_IS6_EENS2_13ArbitraryImplIbvEEEEENSt3__16vectorINSG_10unique_ptrI9avifImageNS4_16UniquePtrDeleterEEENSG_9allocatorISL_EEEENSG_5tupleIJNSP_IJNS2_23ElementOfImplCorpusTypeESQ_SQ_SQ_SQ_NSH_ItNSM_ItEEEEEEEttSQ_SQ_bEEEEC2Ev:
  111|      2|  DomainBase() {
  112|       |    // Check that the interface of `Derived` matches the requirements for a
  113|       |    // domain implementation. We check these inside the constructor of
  114|       |    // `DomainBase`, where `Derived` is already fully defined. If we try to
  115|       |    // check them at class scope we would see an incomplete `Derived` class and
  116|       |    // the checks would not work.
  117|      2|    fuzztest::internal::CheckIsSame<
  118|      2|        ValueType, fuzztest::internal::value_type_t<Derived>>();
  119|      2|    fuzztest::internal::CheckIsSame<
  120|      2|        CorpusType, fuzztest::internal::corpus_type_t<Derived>>();
  121|      2|    static_assert(has_custom_corpus_type == Derived::has_custom_corpus_type);
  122|       |
  123|       |    // Check that `Derived` type-checks against the type-erased `Domain<T>`
  124|       |    // interface by forcing the `DomainModel` template specialization.
  125|      2|    if (Derived* domain = nullptr) {
  ------------------
  |  Branch (125:18): [True: 0, False: 2]
  ------------------
  126|      0|      (void)fuzztest::internal::DomainModel<Derived>{*domain};
  127|      0|    }
  128|      2|  }

_ZN8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEEEEC2EOS1P_:
  132|      2|  explicit DomainModel(D&& domain) : domain_(std::forward<D>(domain)) {}
_ZN8fuzztest8internal20UntypedDomainConceptD2Ev:
   57|     16|  virtual ~UntypedDomainConcept() = default;
_ZNK8fuzztest8internal18TypedDomainConceptINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEEE12UntypedCloneEv:
  110|      2|  std::unique_ptr<UntypedDomainConcept> UntypedClone() const final {
  111|      2|    return TypedClone();
  112|      2|  }
_ZNK8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEEEE18UntypedParseCorpusERKNS0_6no_adl8IRObjectE:
  180|  15.0k|      const IRObject& obj) const final {
  181|  15.0k|    if (auto res = domain_.ParseCorpus(obj)) {
  ------------------
  |  Branch (181:14): [True: 13.8k, False: 1.23k]
  ------------------
  182|  13.8k|      return GenericDomainCorpusType(std::in_place_type<CorpusType>,
  183|  13.8k|                                     *std::move(res));
  184|  13.8k|    } else {
  185|  1.23k|      return std::nullopt;
  186|  1.23k|    }
  187|  15.0k|  }
_ZNK8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEEEE26UntypedValidateCorpusValueERKNS0_11CopyableAnyE:
  195|  13.8k|      const GenericDomainCorpusType& corpus_value) const final {
  196|  13.8k|    return domain_.ValidateCorpusValue(corpus_value.GetAs<CorpusType>());
  197|  13.8k|  }
_ZNK8fuzztest8internal18TypedDomainConceptINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEEE15UntypedGetValueERKNS0_11CopyableAnyE:
  115|  13.7k|      const GenericDomainCorpusType& v) const final {
  116|  13.7k|    return GenericDomainValueType(std::in_place_type<ValueType>,
  117|  13.7k|                                  TypedGetValue(v));
  118|  13.7k|  }
_ZNK8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEEEE10TypedCloneEv:
  134|     14|  std::unique_ptr<TypedDomainConcept<ValueType>> TypedClone() const final {
  135|     14|    return std::make_unique<DomainModel>(*this);
  136|     14|  }
_ZNK8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEEEE13TypedGetValueERKNS0_11CopyableAnyE:
  159|  13.7k|  ValueType TypedGetValue(const GenericDomainCorpusType& v) const final {
  160|  13.7k|    return domain_.GetValue(v.GetAs<CorpusType>());
  161|  13.7k|  }
_ZN8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESQ_NS0_13ElementOfImplISN_EENS0_13ArbitraryImplIbvEEEEENSL_IZNSM_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSN_bE_JSQ_SQ_NSR_IiEESS_SU_EEEEEENS0_7MapImplIPFSF_15avifCodecChoiceiiiiiiEJNSR_IS11_EENSP_IiEES15_S15_S15_S15_S15_EEENS10_IPFSH_SH_jEJNS10_IPFSH_S11_i17avifDecoderSourcebbbbjjjjEJS14_S15_NSR_IS19_EESU_SU_SU_SU_NSR_ImEES1D_SX_NS0_24BitFlagCombinationOfImplIjEEEEENSR_IjEEEEEEEEEC2EOS1J_:
  132|      2|  explicit DomainModel(D&& domain) : domain_(std::forward<D>(domain)) {}
_ZNK8fuzztest8internal11DomainModelINS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESQ_NS0_13ElementOfImplISN_EENS0_13ArbitraryImplIbvEEEEENSL_IZNSM_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSN_bE_JSQ_SQ_NSR_IiEESS_SU_EEEEEENS0_7MapImplIPFSF_15avifCodecChoiceiiiiiiEJNSR_IS11_EENSP_IiEES15_S15_S15_S15_S15_EEENS10_IPFSH_SH_jEJNS10_IPFSH_S11_i17avifDecoderSourcebbbbjjjjEJS14_S15_NSR_IS19_EESU_SU_SU_SU_NSR_ImEES1D_SX_NS0_24BitFlagCombinationOfImplIjEEEEENSR_IjEEEEEEEEE10TypedCloneEv:
  134|      6|  std::unique_ptr<TypedDomainConcept<ValueType>> TypedClone() const final {
  135|      6|    return std::make_unique<DomainModel>(*this);
  136|      6|  }

_ZNK8fuzztest8internal13ElementOfImplImE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  55.2k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  55.2k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 55.2k, False: 3]
  ------------------
  112|  55.2k|      return absl::OkStatus();
  113|  55.2k|    }
  114|      3|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  55.2k|  }
_ZNK8fuzztest8internal13ElementOfImplImE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  55.3k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  55.3k|    return obj.ToCorpus<corpus_type>();
  104|  55.3k|  }
_ZNK8fuzztest8internal13ElementOfImplImE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  55.1k|  value_type GetValue(corpus_type value) const {
   75|  55.1k|    return values_[static_cast<size_t>(value)];
   76|  55.1k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifPixelFormatE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  41.4k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  41.4k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 41.4k, False: 3]
  ------------------
  112|  41.4k|      return absl::OkStatus();
  113|  41.4k|    }
  114|      3|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  41.4k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifPixelFormatE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  27.6k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  27.6k|    return obj.ToCorpus<corpus_type>();
  104|  27.6k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifPixelFormatE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  55.2k|  value_type GetValue(corpus_type value) const {
   75|  55.2k|    return values_[static_cast<size_t>(value)];
   76|  55.2k|  }
_ZNK8fuzztest8internal13ElementOfImplIbE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  13.8k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 13.8k, False: 1]
  ------------------
  112|  13.8k|      return absl::OkStatus();
  113|  13.8k|    }
  114|      1|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  13.8k|  }
_ZNK8fuzztest8internal13ElementOfImplIbE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  13.8k|    return obj.ToCorpus<corpus_type>();
  104|  13.8k|  }
_ZNK8fuzztest8internal13ElementOfImplIbE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  13.7k|  value_type GetValue(corpus_type value) const {
   75|  13.7k|    return values_[static_cast<size_t>(value)];
   76|  13.7k|  }
_ZNK8fuzztest8internal13ElementOfImplIiE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  25.4k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  25.4k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 25.4k, False: 2]
  ------------------
  112|  25.4k|      return absl::OkStatus();
  113|  25.4k|    }
  114|      2|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  25.4k|  }
_ZNK8fuzztest8internal13ElementOfImplIiE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  21.6k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  21.6k|    return obj.ToCorpus<corpus_type>();
  104|  21.6k|  }
_ZNK8fuzztest8internal13ElementOfImplIiE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  29.3k|  value_type GetValue(corpus_type value) const {
   75|  29.3k|    return values_[static_cast<size_t>(value)];
   76|  29.3k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifCodecChoiceE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  27.6k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  27.6k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 27.6k, False: 2]
  ------------------
  112|  27.6k|      return absl::OkStatus();
  113|  27.6k|    }
  114|      2|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  27.6k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifCodecChoiceE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  27.6k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  27.6k|    return obj.ToCorpus<corpus_type>();
  104|  27.6k|  }
_ZNK8fuzztest8internal13ElementOfImplI15avifCodecChoiceE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  27.5k|  value_type GetValue(corpus_type value) const {
   75|  27.5k|    return values_[static_cast<size_t>(value)];
   76|  27.5k|  }
_ZNK8fuzztest8internal13ElementOfImplI17avifDecoderSourceE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  13.8k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 13.8k, False: 2]
  ------------------
  112|  13.8k|      return absl::OkStatus();
  113|  13.8k|    }
  114|      2|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  13.8k|  }
_ZNK8fuzztest8internal13ElementOfImplI17avifDecoderSourceE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  13.8k|    return obj.ToCorpus<corpus_type>();
  104|  13.8k|  }
_ZNK8fuzztest8internal13ElementOfImplI17avifDecoderSourceE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  13.7k|  value_type GetValue(corpus_type value) const {
   75|  13.7k|    return values_[static_cast<size_t>(value)];
   76|  13.7k|  }
_ZNK8fuzztest8internal13ElementOfImplIjE19ValidateCorpusValueERKNS0_23ElementOfImplCorpusTypeE:
  110|  13.7k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  111|  13.7k|    if (static_cast<size_t>(corpus_value) < values_.size()) {
  ------------------
  |  Branch (111:9): [True: 13.7k, False: 6]
  ------------------
  112|  13.7k|      return absl::OkStatus();
  113|  13.7k|    }
  114|      6|    return absl::InvalidArgumentError("Invalid ElementOf() value");
  115|  13.7k|  }
_ZNK8fuzztest8internal13ElementOfImplIjE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  102|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  103|  13.8k|    return obj.ToCorpus<corpus_type>();
  104|  13.8k|  }
_ZNK8fuzztest8internal13ElementOfImplIjE8GetValueENS0_23ElementOfImplCorpusTypeE:
   74|  13.7k|  value_type GetValue(corpus_type value) const {
   75|  13.7k|    return values_[static_cast<size_t>(value)];
   76|  13.7k|  }
_ZN8fuzztest8internal13ElementOfImplImEC2ENSt3__16vectorImNS3_9allocatorImEEEE:
   46|  82.9k|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|   165k|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  82.9k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  82.9k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|   165k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|   165k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 82.9k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  82.9k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 82.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|   165k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 82.9k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 82.9k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 82.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  82.9k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  82.9k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|   165k|        << "ElementOf requires a non empty list.";
   49|  82.9k|  }
_ZN8fuzztest8internal13ElementOfImplI15avifPixelFormatEC2ENSt3__16vectorIS2_NS4_9allocatorIS2_EEEE:
   46|  41.4k|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|  82.9k|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  41.4k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  41.4k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  82.9k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  82.9k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 41.4k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  41.4k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  82.9k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 41.4k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  41.4k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  41.4k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  82.9k|        << "ElementOf requires a non empty list.";
   49|  41.4k|  }
_ZN8fuzztest8internal13ElementOfImplIbEC2ENSt3__16vectorIbNS3_9allocatorIbEEEE:
   46|  41.4k|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|  82.9k|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  41.4k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  41.4k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  82.9k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  82.9k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 41.4k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  41.4k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  82.9k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 41.4k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 41.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  41.4k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  41.4k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  82.9k|        << "ElementOf requires a non empty list.";
   49|  41.4k|  }
_ZN8fuzztest8internal13ElementOfImplIiEC2ENSt3__16vectorIiNS3_9allocatorIiEEEE:
   46|  11.6k|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|  23.3k|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  11.6k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  11.6k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  23.3k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  23.3k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 11.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  11.6k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  23.3k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 11.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  11.6k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  11.6k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  23.3k|        << "ElementOf requires a non empty list.";
   49|  11.6k|  }
_ZN8fuzztest8internal13ElementOfImplI15avifCodecChoiceEC2ENSt3__16vectorIS2_NS4_9allocatorIS2_EEEE:
   46|      8|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|     16|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      8|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      8|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|     16|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|     16|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      8|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|     16|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      8|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      8|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|     16|        << "ElementOf requires a non empty list.";
   49|      8|  }
_ZN8fuzztest8internal13ElementOfImplI17avifDecoderSourceEC2ENSt3__16vectorIS2_NS4_9allocatorIS2_EEEE:
   46|      4|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|      8|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      4|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      4|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      8|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      8|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      4|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      8|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      4|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      4|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|      8|        << "ElementOf requires a non empty list.";
   49|      4|  }
_ZN8fuzztest8internal13ElementOfImplIjEC2ENSt3__16vectorIjNS3_9allocatorIjEEEE:
   46|      4|  explicit ElementOfImpl(std::vector<T> values) : values_(std::move(values)) {
   47|      8|    FUZZTEST_PRECONDITION(!values_.empty())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      4|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      4|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      8|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      8|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      4|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      8|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      4|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      4|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|      8|        << "ElementOf requires a non empty list.";
   49|      4|  }

_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateCorpusValueERKNSt3__15tupleIJNSE_IJNS0_23ElementOfImplCorpusTypeESF_SF_SF_NSD_6vectorIhNSD_9allocatorIhEEEEEEEttSF_bEEE:
  147|  9.93k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  148|       |    // Check input values first.
  149|  9.93k|    absl::Status input_values_validity = ValidateInputValues(corpus_value);
  150|  9.93k|    if (!input_values_validity.ok()) return input_values_validity;
  ------------------
  |  Branch (150:9): [True: 0, False: 9.93k]
  ------------------
  151|       |    // Check the output value.
  152|  9.93k|    return GetOutputDomain(corpus_value)
  153|  9.93k|        .ValidateCorpusValue(std::get<0>(corpus_value));
  154|  9.93k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEEEEEDaSU_:
  183|  9.93k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  9.93k|      absl::Status input_values_validity = absl::OkStatus();
  185|  9.93k|      (
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
  194|  9.93k|          ...);
  195|  9.93k|      return input_values_validity;
  196|  9.93k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_:
  178|  9.93k|  absl::Status ValidateInputValues(const Tuple& tuple) const {
  179|  9.93k|    static_assert(is_tuple_v<Tuple> &&
  180|  9.93k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  181|  9.93k|    static constexpr size_t kOffset =
  182|  9.93k|        std::tuple_size_v<Tuple> - kNumInputValues;
  183|  9.93k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  9.93k|      absl::Status input_values_validity = absl::OkStatus();
  185|  9.93k|      (
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
  194|  9.93k|          ...);
  195|  9.93k|      return input_values_validity;
  196|  9.93k|    });
  197|  9.93k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEENS0_7MapImplIPFNSH_INSE_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSI_ISR_EEEEmmS4_bRKSK_EJNS8_ImEESY_S9_NS8_IbEENS0_23SequenceContainerOfImplISK_NSA_IhvEEEEEEERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENS1B_ImLm1EEENS1B_ImLm2EEENS1B_ImLm3EEEEEEDaS18_:
  167|  19.8k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  19.8k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  19.8k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  19.8k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEENS0_7MapImplIPFNSH_INSE_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSI_ISR_EEEEmmS4_bRKSK_EJNS8_ImEESY_S9_NS8_IbEENS0_23SequenceContainerOfImplISK_NSA_IhvEEEEEEERKT_:
  162|  19.8k|      const Tuple& tuple) const {
  163|  19.8k|    static_assert(is_tuple_v<Tuple> &&
  164|  19.8k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  165|  19.8k|    static constexpr size_t kOffset =
  166|  19.8k|        std::tuple_size_v<Tuple> - kNumInputValues;
  167|  19.8k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  19.8k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  19.8k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  19.8k|    });
  172|  19.8k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEENS0_7MapImplIPFNSE_6vectorINSE_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSE_9allocatorISN_EEEEmmS4_bRKNSJ_IhNSO_IhEEEEEJNS8_ImEESX_S9_NS8_IbEENS0_23SequenceContainerOfImplISS_NSA_IhvEEEEEEERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENS1A_ImLm1EEENS1A_ImLm2EEENS1A_ImLm3EEEEEEDaS17_:
  167|  9.95k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  9.95k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  9.95k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  9.95k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEENS0_7MapImplIPFNSE_6vectorINSE_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSE_9allocatorISN_EEEEmmS4_bRKNSJ_IhNSO_IhEEEEEJNS8_ImEESX_S9_NS8_IbEENS0_23SequenceContainerOfImplISS_NSA_IhvEEEEEEERKT_:
  162|  9.95k|      const Tuple& tuple) const {
  163|  9.95k|    static_assert(is_tuple_v<Tuple> &&
  164|  9.95k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  165|  9.95k|    static constexpr size_t kOffset =
  166|  9.95k|        std::tuple_size_v<Tuple> - kNumInputValues;
  167|  9.95k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  9.95k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  9.95k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  9.95k|    });
  172|  9.95k|  }
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  122|  9.96k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  123|  9.96k|    auto input_corpus = ParseWithDomainTuple(input_domains_, obj, /*skip=*/1);
  124|  9.96k|    if (!input_corpus.has_value()) {
  ------------------
  |  Branch (124:9): [True: 6, False: 9.95k]
  ------------------
  125|      6|      return std::nullopt;
  126|      6|    }
  127|  9.95k|    absl::Status input_values_validity = ValidateInputValues(*input_corpus);
  128|  9.95k|    if (!input_values_validity.ok()) {
  ------------------
  |  Branch (128:9): [True: 2, False: 9.95k]
  ------------------
  129|      2|      absl::FPrintF(GetStderr(), "[!] %s", input_values_validity.message());
  130|      2|      return std::nullopt;
  131|      2|    }
  132|  9.95k|    auto output_domain = GetOutputDomain(*input_corpus);
  133|       |    // We know obj.Subs()[0] exists because ParseWithDomainTuple succeeded.
  134|  9.95k|    auto output_corpus = output_domain.ParseCorpus((*obj.Subs())[0]);
  135|  9.95k|    if (!output_corpus.has_value()) {
  ------------------
  |  Branch (135:9): [True: 1, False: 9.95k]
  ------------------
  136|      1|      return std::nullopt;
  137|      1|    }
  138|  9.95k|    return std::tuple_cat(std::make_tuple(*output_corpus), *input_corpus);
  139|  9.95k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEEEEEDaSP_:
  183|  9.95k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  9.95k|      absl::Status input_values_validity = absl::OkStatus();
  185|  9.95k|      (
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
  194|  9.95k|          ...);
  195|  9.95k|      return input_values_validity;
  196|  9.95k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_:
  178|  9.95k|  absl::Status ValidateInputValues(const Tuple& tuple) const {
  179|  9.95k|    static_assert(is_tuple_v<Tuple> &&
  180|  9.95k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  181|  9.95k|    static constexpr size_t kOffset =
  182|  9.95k|        std::tuple_size_v<Tuple> - kNumInputValues;
  183|  9.95k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  9.95k|      absl::Status input_values_validity = absl::OkStatus();
  185|  9.95k|      (
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
  194|  9.95k|          ...);
  195|  9.95k|      return input_values_validity;
  196|  9.95k|    });
  197|  9.95k|  }
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE8GetValueERKNSt3__15tupleIJNSE_IJNS0_23ElementOfImplCorpusTypeESF_SF_SF_NSD_6vectorIhNSD_9allocatorIhEEEEEEEttSF_bEEE:
  107|  9.91k|  value_type GetValue(const corpus_type& v) const {
  108|  9.91k|    return GetOutputDomain(v).GetValue(std::get<0>(v));
  109|  9.91k|  }
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateCorpusValueERKNSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_SG_NSE_6vectorItNSE_9allocatorItEEEEEEEttSG_SG_bEEE:
  147|  3.88k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  148|       |    // Check input values first.
  149|  3.88k|    absl::Status input_values_validity = ValidateInputValues(corpus_value);
  150|  3.88k|    if (!input_values_validity.ok()) return input_values_validity;
  ------------------
  |  Branch (150:9): [True: 0, False: 3.88k]
  ------------------
  151|       |    // Check the output value.
  152|  3.88k|    return GetOutputDomain(corpus_value)
  153|  3.88k|        .ValidateCorpusValue(std::get<0>(corpus_value));
  154|  3.88k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_:
  183|  3.88k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  3.88k|      absl::Status input_values_validity = absl::OkStatus();
  185|  3.88k|      (
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
  194|  3.88k|          ...);
  195|  3.88k|      return input_values_validity;
  196|  3.88k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_:
  178|  3.88k|  absl::Status ValidateInputValues(const Tuple& tuple) const {
  179|  3.88k|    static_assert(is_tuple_v<Tuple> &&
  180|  3.88k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  181|  3.88k|    static constexpr size_t kOffset =
  182|  3.88k|        std::tuple_size_v<Tuple> - kNumInputValues;
  183|  3.88k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  3.88k|      absl::Status input_values_validity = absl::OkStatus();
  185|  3.88k|      (
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
  194|  3.88k|          ...);
  195|  3.88k|      return input_values_validity;
  196|  3.88k|    });
  197|  3.88k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEENS0_7MapImplIPFNSI_INSF_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSJ_ISS_EEEEmmiS4_bRKSL_EJNS8_ImEESZ_S9_SA_NS8_IbEENS0_23SequenceContainerOfImplISL_S7_EEEEERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENS1B_ImLm1EEENS1B_ImLm2EEENS1B_ImLm3EEENS1B_ImLm4EEEEEEDaS18_:
  167|  7.75k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  7.75k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  7.75k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  7.75k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEENS0_7MapImplIPFNSI_INSF_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSJ_ISS_EEEEmmiS4_bRKSL_EJNS8_ImEESZ_S9_SA_NS8_IbEENS0_23SequenceContainerOfImplISL_S7_EEEEERKT_:
  162|  7.75k|      const Tuple& tuple) const {
  163|  7.75k|    static_assert(is_tuple_v<Tuple> &&
  164|  7.75k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  165|  7.75k|    static constexpr size_t kOffset =
  166|  7.75k|        std::tuple_size_v<Tuple> - kNumInputValues;
  167|  7.75k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  7.75k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  7.75k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  7.75k|    });
  172|  7.75k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEENS0_7MapImplIPFNSF_6vectorINSF_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSF_9allocatorISO_EEEEmmiS4_bRKNSK_ItNSP_ItEEEEEJNS8_ImEESY_S9_SA_NS8_IbEENS0_23SequenceContainerOfImplIST_S7_EEEEERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENS1A_ImLm1EEENS1A_ImLm2EEENS1A_ImLm3EEENS1A_ImLm4EEEEEEDaS17_:
  167|  3.88k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  3.88k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  3.88k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  3.88k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEENS0_7MapImplIPFNSF_6vectorINSF_10unique_ptrI9avifImageNS2_16UniquePtrDeleterEEENSF_9allocatorISO_EEEEmmiS4_bRKNSK_ItNSP_ItEEEEEJNS8_ImEESY_S9_SA_NS8_IbEENS0_23SequenceContainerOfImplIST_S7_EEEEERKT_:
  162|  3.88k|      const Tuple& tuple) const {
  163|  3.88k|    static_assert(is_tuple_v<Tuple> &&
  164|  3.88k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  165|  3.88k|    static constexpr size_t kOffset =
  166|  3.88k|        std::tuple_size_v<Tuple> - kNumInputValues;
  167|  3.88k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  168|       |      // The first field of `tuple` may be the output corpus value, so skip it.
  169|  3.88k|      return flat_mapper_(std::get<I>(input_domains_)
  170|  3.88k|                              .GetValue(std::get<kOffset + I>(tuple))...);
  171|  3.88k|    });
  172|  3.88k|  }
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  122|  3.89k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  123|  3.89k|    auto input_corpus = ParseWithDomainTuple(input_domains_, obj, /*skip=*/1);
  124|  3.89k|    if (!input_corpus.has_value()) {
  ------------------
  |  Branch (124:9): [True: 1, False: 3.89k]
  ------------------
  125|      1|      return std::nullopt;
  126|      1|    }
  127|  3.89k|    absl::Status input_values_validity = ValidateInputValues(*input_corpus);
  128|  3.89k|    if (!input_values_validity.ok()) {
  ------------------
  |  Branch (128:9): [True: 1, False: 3.88k]
  ------------------
  129|      1|      absl::FPrintF(GetStderr(), "[!] %s", input_values_validity.message());
  130|      1|      return std::nullopt;
  131|      1|    }
  132|  3.88k|    auto output_domain = GetOutputDomain(*input_corpus);
  133|       |    // We know obj.Subs()[0] exists because ParseWithDomainTuple succeeded.
  134|  3.88k|    auto output_corpus = output_domain.ParseCorpus((*obj.Subs())[0]);
  135|  3.88k|    if (!output_corpus.has_value()) {
  ------------------
  |  Branch (135:9): [True: 1, False: 3.88k]
  ------------------
  136|      1|      return std::nullopt;
  137|      1|    }
  138|  3.88k|    return std::tuple_cat(std::make_tuple(*output_corpus), *input_corpus);
  139|  3.88k|  }
_ZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_:
  183|  3.89k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  3.89k|      absl::Status input_values_validity = absl::OkStatus();
  185|  3.89k|      (
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  188|  3.89k|            const absl::Status s =
  189|  3.89k|                std::get<I>(input_domains_)
  190|  3.89k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.89k|            input_values_validity =
  192|  3.89k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.89k|          }(),
  194|  3.89k|          ...);
  195|  3.89k|      return input_values_validity;
  196|  3.89k|    });
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_:
  178|  3.89k|  absl::Status ValidateInputValues(const Tuple& tuple) const {
  179|  3.89k|    static_assert(is_tuple_v<Tuple> &&
  180|  3.89k|                  std::tuple_size_v<Tuple> >= kNumInputValues);
  181|  3.89k|    static constexpr size_t kOffset =
  182|  3.89k|        std::tuple_size_v<Tuple> - kNumInputValues;
  183|  3.89k|    return ApplyIndex<kNumInputValues>([&](auto... I) {
  184|  3.89k|      absl::Status input_values_validity = absl::OkStatus();
  185|  3.89k|      (
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  188|  3.89k|            const absl::Status s =
  189|  3.89k|                std::get<I>(input_domains_)
  190|  3.89k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.89k|            input_values_validity =
  192|  3.89k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.89k|          }(),
  194|  3.89k|          ...);
  195|  3.89k|      return input_values_validity;
  196|  3.89k|    });
  197|  3.89k|  }
_ZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE8GetValueERKNSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_SG_NSE_6vectorItNSE_9allocatorItEEEEEEEttSG_SG_bEEE:
  107|  3.87k|  value_type GetValue(const corpus_type& v) const {
  108|  3.87k|    return GetOutputDomain(v).GetValue(std::get<0>(v));
  109|  3.87k|  }
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEEEEEDaSU_ENKUlvE2_clEv:
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 9.93k]
  ------------------
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEEEEEDaSU_ENKUlvE1_clEv:
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 9.93k]
  ------------------
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEEEEEDaSU_ENKUlvE0_clEv:
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 9.93k]
  ------------------
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSF_IJNS0_23ElementOfImplCorpusTypeESG_SG_SG_NSE_6vectorIhNSE_9allocatorIhEEEEEEEttSG_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEEEEEDaSU_ENKUlvE_clEv:
  186|  9.93k|          [&] {
  187|  9.93k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 9.93k]
  ------------------
  188|  9.93k|            const absl::Status s =
  189|  9.93k|                std::get<I>(input_domains_)
  190|  9.93k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.93k|            input_values_validity =
  192|  9.93k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.93k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_ENKUlvE3_clEv:
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_ENKUlvE2_clEv:
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_ENKUlvE1_clEv:
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_ENKUlvE0_clEv:
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_SH_NSF_6vectorItNSF_9allocatorItEEEEEEEttSH_SH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEEEEEDaSV_ENKUlvE_clEv:
  186|  3.88k|          [&] {
  187|  3.88k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEEEEEDaSP_ENKUlvE2_clEv:
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 9.95k]
  ------------------
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEEEEEDaSP_ENKUlvE1_clEv:
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 9.95k]
  ------------------
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEEEEEDaSP_ENKUlvE0_clEv:
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 9.95k]
  ------------------
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSE_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEEEEEDaSP_ENKUlvE_clEv:
  186|  9.95k|          [&] {
  187|  9.95k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 2, False: 9.95k]
  ------------------
  188|  9.95k|            const absl::Status s =
  189|  9.95k|                std::get<I>(input_domains_)
  190|  9.95k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  9.95k|            input_values_validity =
  192|  9.95k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  9.95k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_ENKUlvE3_clEv:
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 0, False: 3.89k]
  ------------------
  188|  3.89k|            const absl::Status s =
  189|  3.89k|                std::get<I>(input_domains_)
  190|  3.89k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.89k|            input_values_validity =
  192|  3.89k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.89k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_ENKUlvE2_clEv:
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_ENKUlvE1_clEv:
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_ENKUlvE0_clEv:
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZZZNK8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESH_bEEEEEN4absl12lts_202605266StatusERKT_ENKUlDpT_E_clIJNSF_17integral_constantImLm0EEENST_ImLm1EEENST_ImLm2EEENST_ImLm3EEENST_ImLm4EEEEEEDaSQ_ENKUlvE_clEv:
  186|  3.89k|          [&] {
  187|  3.89k|            if (!input_values_validity.ok()) return;
  ------------------
  |  Branch (187:17): [True: 1, False: 3.88k]
  ------------------
  188|  3.88k|            const absl::Status s =
  189|  3.88k|                std::get<I>(input_domains_)
  190|  3.88k|                    .ValidateCorpusValue(std::get<kOffset + I>(tuple));
  191|  3.88k|            input_values_validity =
  192|  3.88k|                Prefix(s, "Invalid value for FlatMap()-ed domain");
  193|  3.88k|          }(),
_ZN8fuzztest8internal11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEEC2ES5_S7_S7_S9_SB_:
   65|      2|      : flat_mapper_(std::move(flat_mapper)),
   66|      2|        input_domains_(std::move(input_domains)...) {}
_ZN8fuzztest8internal11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEEC2ES5_S7_S7_S9_SA_SC_:
   65|      2|      : flat_mapper_(std::move(flat_mapper)),
   66|      2|        input_domains_(std::move(input_domains)...) {}
_ZN8fuzztest8internal11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIS4_EENS0_13ArbitraryImplIbvEEEEC2ES5_S7_S7_S9_SB_:
   65|      2|      : flat_mapper_(std::move(flat_mapper)),
   66|      2|        input_domains_(std::move(input_domains)...) {}
_ZN8fuzztest8internal11FlatMapImplIZN4avif8testutil30ArbitraryAvifLayeredRandDim16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES7_NS0_13ElementOfImplIiEENS8_IS4_EENS0_13ArbitraryImplIbvEEEEC2ES5_S7_S7_S9_SA_SC_:
   65|      2|      : flat_mapper_(std::move(flat_mapper)),
   66|      2|        input_domains_(std::move(input_domains)...) {}

_ZNK8fuzztest8internal11InRangeImplIiE19ValidateCorpusValueERKi:
  174|   124k|  absl::Status ValidateCorpusValue(const value_type& corpus_value) const {
  175|   124k|    if (min_ <= corpus_value && corpus_value <= max_) return absl::OkStatus();
  ------------------
  |  Branch (175:9): [True: 124k, False: 0]
  |  Branch (175:33): [True: 124k, False: 7]
  ------------------
  176|       |    // We cannot just absl::StrCat() the error message, because it doesn't
  177|       |    // accept some types (like char).
  178|      7|    std::string error_message;
  179|      7|    absl::Format(&error_message, "The value ");
  180|      7|    domain_implementor::PrintValue(*this, corpus_value, &error_message,
  181|      7|                                   domain_implementor::PrintMode::kSourceCode);
  182|      7|    absl::Format(&error_message, " is not InRange(");
  183|      7|    domain_implementor::PrintValue(*this, min_, &error_message,
  184|      7|                                   domain_implementor::PrintMode::kSourceCode);
  185|      7|    absl::Format(&error_message, ", ");
  186|      7|    domain_implementor::PrintValue(*this, max_, &error_message,
  187|      7|                                   domain_implementor::PrintMode::kSourceCode);
  188|      7|    absl::Format(&error_message, ")");
  189|      7|    return absl::InvalidArgumentError(error_message);
  190|   124k|  }
_ZNK8fuzztest8internal11InRangeImplIiE10GetPrinterEv:
  192|     21|  auto GetPrinter() const {
  193|     21|    if constexpr (std::numeric_limits<T>::is_integer) {
  194|     21|      return IntegralPrinter{};
  195|       |    } else {
  196|       |      return FloatingPrinter{};
  197|       |    }
  198|     21|  }
_ZNK8fuzztest8internal11InRangeImplItE19ValidateCorpusValueERKt:
  174|  35.1M|  absl::Status ValidateCorpusValue(const value_type& corpus_value) const {
  175|  35.1M|    if (min_ <= corpus_value && corpus_value <= max_) return absl::OkStatus();
  ------------------
  |  Branch (175:9): [True: 35.1M, False: 1]
  |  Branch (175:33): [True: 35.1M, False: 4]
  ------------------
  176|       |    // We cannot just absl::StrCat() the error message, because it doesn't
  177|       |    // accept some types (like char).
  178|      5|    std::string error_message;
  179|      5|    absl::Format(&error_message, "The value ");
  180|      5|    domain_implementor::PrintValue(*this, corpus_value, &error_message,
  181|      5|                                   domain_implementor::PrintMode::kSourceCode);
  182|      5|    absl::Format(&error_message, " is not InRange(");
  183|      5|    domain_implementor::PrintValue(*this, min_, &error_message,
  184|      5|                                   domain_implementor::PrintMode::kSourceCode);
  185|      5|    absl::Format(&error_message, ", ");
  186|      5|    domain_implementor::PrintValue(*this, max_, &error_message,
  187|      5|                                   domain_implementor::PrintMode::kSourceCode);
  188|      5|    absl::Format(&error_message, ")");
  189|      5|    return absl::InvalidArgumentError(error_message);
  190|  35.1M|  }
_ZNK8fuzztest8internal11InRangeImplItE10GetPrinterEv:
  192|     15|  auto GetPrinter() const {
  193|     15|    if constexpr (std::numeric_limits<T>::is_integer) {
  194|     15|      return IntegralPrinter{};
  195|       |    } else {
  196|       |      return FloatingPrinter{};
  197|       |    }
  198|     15|  }
_ZN8fuzztest8internal11InRangeImplItEC2Ett:
   56|  11.6k|  explicit InRangeImpl(T min, T max) : min_(min), max_(max) {
   57|  23.3k|    FUZZTEST_PRECONDITION(min <= max)
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|  11.6k|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  11.6k|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|  23.3k|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|  23.3k|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 11.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|  11.6k|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|  23.3k|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 11.6k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|  11.6k|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|  11.6k|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|  23.3k|        << "min must be less than or equal to max!";
   59|       |    if constexpr (!T_is_integer) {
   60|       |      FUZZTEST_PRECONDITION(!(min == std::numeric_limits<T>::lowest() &&
   61|       |                              max == std::numeric_limits<T>::max()))
   62|       |          << "Consider using the Finite<T>() domain instead.";
   63|       |      FUZZTEST_PRECONDITION(std::isfinite(max - min)) << "Range is too large!";
   64|       |    }
   65|  11.6k|    if constexpr (T_is_integer) {
   66|       |      // Find the longest common prefix
   67|       |      // (from the most significant bit to the least significant bit) of
   68|       |      // min_ and max_, and we only mutate the bits after the prefix.
   69|       |      // This way it can somehow restrict the bit flipping range, but it
   70|       |      // may still fail for range like [0b10000000, 0b01111111] which has
   71|       |      // no valid bit flipping mutations.
   72|       |      // We need to split the signed type range to positve range and
   73|       |      // negative range because of their two's complement representation.
   74|       |      if constexpr (T_is_signed) {
   75|       |        if (min_ < 0 && max_ >= 0) {
   76|       |          largest_mutable_bit_negative = BitWidth(~min);
   77|       |          largest_mutable_bit_positive = BitWidth(max);
   78|       |        } else if (min_ >= 0) {
   79|       |          largest_mutable_bit_positive = BitWidth(min ^ max);
   80|       |        } else if (max_ < 0) {
   81|       |          largest_mutable_bit_negative = BitWidth(min ^ max);
   82|       |        }
   83|  11.6k|      } else {
   84|  11.6k|        largest_mutable_bit_positive = BitWidth(min ^ max);
   85|  11.6k|      }
   86|  11.6k|    }
   87|  11.6k|  }
_ZN8fuzztest8internal11InRangeImplIiEC2Eii:
   56|     32|  explicit InRangeImpl(T min, T max) : min_(min), max_(max) {
   57|     64|    FUZZTEST_PRECONDITION(min <= max)
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|     32|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|     32|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|     64|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|     64|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 32, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|     32|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 32]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|     64|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 32, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 32]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 32]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|     32|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|     32|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|     64|        << "min must be less than or equal to max!";
   59|       |    if constexpr (!T_is_integer) {
   60|       |      FUZZTEST_PRECONDITION(!(min == std::numeric_limits<T>::lowest() &&
   61|       |                              max == std::numeric_limits<T>::max()))
   62|       |          << "Consider using the Finite<T>() domain instead.";
   63|       |      FUZZTEST_PRECONDITION(std::isfinite(max - min)) << "Range is too large!";
   64|       |    }
   65|     32|    if constexpr (T_is_integer) {
   66|       |      // Find the longest common prefix
   67|       |      // (from the most significant bit to the least significant bit) of
   68|       |      // min_ and max_, and we only mutate the bits after the prefix.
   69|       |      // This way it can somehow restrict the bit flipping range, but it
   70|       |      // may still fail for range like [0b10000000, 0b01111111] which has
   71|       |      // no valid bit flipping mutations.
   72|       |      // We need to split the signed type range to positve range and
   73|       |      // negative range because of their two's complement representation.
   74|     32|      if constexpr (T_is_signed) {
   75|     32|        if (min_ < 0 && max_ >= 0) {
  ------------------
  |  Branch (75:13): [True: 0, False: 32]
  |  Branch (75:25): [True: 0, False: 0]
  ------------------
   76|      0|          largest_mutable_bit_negative = BitWidth(~min);
   77|      0|          largest_mutable_bit_positive = BitWidth(max);
   78|     32|        } else if (min_ >= 0) {
  ------------------
  |  Branch (78:20): [True: 32, False: 0]
  ------------------
   79|     32|          largest_mutable_bit_positive = BitWidth(min ^ max);
   80|     32|        } else if (max_ < 0) {
  ------------------
  |  Branch (80:20): [True: 0, False: 0]
  ------------------
   81|      0|          largest_mutable_bit_negative = BitWidth(min ^ max);
   82|      0|        }
   83|       |      } else {
   84|       |        largest_mutable_bit_positive = BitWidth(min ^ max);
   85|       |      }
   86|     32|    }
   87|     32|  }

_ZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_:
   95|  9.93k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  9.93k|      (
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
  103|  9.93k|          ...);
  104|  9.93k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEE:
   93|  9.93k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  9.93k|    absl::Status result = absl::OkStatus();
   95|  9.93k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  9.93k|      (
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
  103|  9.93k|          ...);
  104|  9.93k|    });
  105|  9.93k|    return result;
  106|  9.93k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  9.95k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  9.95k|    return ParseWithDomainTuple(inner_, obj);
   87|  9.95k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_:
   72|  9.91k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  9.91k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  9.91k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEE:
   71|  9.91k|  value_type GetValue(const corpus_type& v) const {
   72|  9.91k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  9.91k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  9.91k|    });
   75|  9.91k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_:
   95|  3.88k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  3.88k|      (
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
  103|  3.88k|          ...);
  104|  3.88k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEE:
   93|  3.88k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  3.88k|    absl::Status result = absl::OkStatus();
   95|  3.88k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  3.88k|      (
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
  103|  3.88k|          ...);
  104|  3.88k|    });
  105|  3.88k|    return result;
  106|  3.88k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  3.88k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  3.88k|    return ParseWithDomainTuple(inner_, obj);
   87|  3.88k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_:
   72|  3.87k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  3.87k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  3.87k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEE:
   71|  3.87k|  value_type GetValue(const corpus_type& v) const {
   72|  3.87k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  3.87k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  3.87k|    });
   75|  3.87k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_:
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEE:
   93|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  13.8k|    absl::Status result = absl::OkStatus();
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
  105|  13.8k|    return result;
  106|  13.8k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  13.8k|    return ParseWithDomainTuple(inner_, obj);
   87|  13.8k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_:
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEE:
   71|  13.7k|  value_type GetValue(const corpus_type& v) const {
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
   75|  13.7k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_:
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEE:
   93|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  13.8k|    absl::Status result = absl::OkStatus();
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
  105|  13.8k|    return result;
  106|  13.8k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  13.8k|    return ParseWithDomainTuple(inner_, obj);
   87|  13.8k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_:
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE8GetValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEE:
   71|  13.7k|  value_type GetValue(const corpus_type& v) const {
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
   75|  13.7k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE19ValidateCorpusValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEEEEEDaSZ_:
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE19ValidateCorpusValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEE:
   93|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  13.8k|    absl::Status result = absl::OkStatus();
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
  105|  13.8k|    return result;
  106|  13.8k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  13.8k|    return ParseWithDomainTuple(inner_, obj);
   87|  13.8k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE8GetValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEEEEEDaSZ_:
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
_ZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE8GetValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEE:
   71|  13.7k|  value_type GetValue(const corpus_type& v) const {
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
   75|  13.7k|  }
_ZN8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEEC2ESI_SK_SK_SL_SM_SQ_:
   47|  29.8k|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_ENKUlvE3_clEv:
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 9.93k]
  ------------------
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_ENKUlvE2_clEv:
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 9.93k]
  ------------------
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_ENKUlvE1_clEv:
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 1, False: 9.93k]
  ------------------
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_ENKUlvE0_clEv:
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 9.93k]
  ------------------
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmm15avifPixelFormatbRKNS3_IhNS9_IhEEEEEJNS0_13ElementOfImplImEESK_NSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEST_ST_ST_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS11_ImLm1EEENS11_ImLm2EEENS11_ImLm3EEENS11_ImLm4EEEEEEDaSY_ENKUlvE_clEv:
   97|  9.93k|          [&] {
   98|  9.93k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 3, False: 9.93k]
  ------------------
   99|  9.93k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  9.93k|                std::get<I>(corpus_value));
  101|  9.93k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  9.93k|          }(),
_ZN8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEEC2ESI_SK_SK_SL_SM_SN_SR_:
   47|  11.6k|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE4_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE3_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE2_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE1_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE0_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 1, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEEmmi15avifPixelFormatbRKNS3_ItNS9_ItEEEEEJNS0_13ElementOfImplImEESK_NSJ_IiEENSJ_ISC_EENSJ_IbEENS0_23SequenceContainerOfImplISE_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SU_SE_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEENS12_ImLm2EEENS12_ImLm3EEENS12_ImLm4EEENS12_ImLm5EEEEEEDaSZ_ENKUlvE_clEv:
   97|  3.88k|          [&] {
   98|  3.88k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 1, False: 3.88k]
  ------------------
   99|  3.88k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  3.88k|                std::get<I>(corpus_value));
  101|  3.88k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  3.88k|          }(),
_ZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE19ValidateCorpusValueERKNS2_5tupleIJiiEEE:
   93|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
   94|  13.8k|    absl::Status result = absl::OkStatus();
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
  105|  13.8k|    return result;
  106|  13.8k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE19ValidateCorpusValueERKNS2_5tupleIJiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSJ_ImLm1EEEEEEDaSG_:
   95|  13.8k|    ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   96|  13.8k|      (
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
  103|  13.8k|          ...);
  104|  13.8k|    });
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE19ValidateCorpusValueERKNS2_5tupleIJiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSJ_ImLm1EEEEEEDaSG_ENKUlvE0_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE19ValidateCorpusValueERKNS2_5tupleIJiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSJ_ImLm1EEEEEEDaSG_ENKUlvE_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 1, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE5_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE4_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE3_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 3, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE2_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 3, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE1_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 6, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE0_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 6, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSM_ENKUlvE_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 7, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE19ValidateCorpusValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEEEEEDaSZ_ENKUlvE0_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE9_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE8_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE7_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 0, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE6_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE5_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE4_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE3_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE2_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 2, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE1_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 3, False: 13.8k]
  ------------------
   99|  13.8k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.8k|                std::get<I>(corpus_value));
  101|  13.8k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.8k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE0_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 4, False: 13.7k]
  ------------------
   99|  13.7k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.7k|                std::get<I>(corpus_value));
  101|  13.7k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.7k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS2_5tupleIJNS0_23ElementOfImplCorpusTypeEiSP_bbbbSP_SP_SP_jEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSU_ENKUlvE_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 6, False: 13.7k]
  ------------------
   99|  13.7k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.7k|                std::get<I>(corpus_value));
  101|  13.7k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.7k|          }(),
_ZZZNK8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEE19ValidateCorpusValueERKNS2_5tupleIJNSS_IJNS0_23ElementOfImplCorpusTypeEiST_bbbbST_ST_ST_jEEEST_EEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENS12_ImLm1EEEEEEDaSZ_ENKUlvE_clEv:
   97|  13.8k|          [&] {
   98|  13.8k|            if (!result.ok()) return;
  ------------------
  |  Branch (98:17): [True: 7, False: 13.7k]
  ------------------
   99|  13.7k|            const absl::Status s = std::get<I>(inner_).ValidateCorpusValue(
  100|  13.7k|                std::get<I>(corpus_value));
  101|  13.7k|            result = Prefix(s, "Invalid value for Map()-ed domain");
  102|  13.7k|          }(),
_ZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE11ParseCorpusERKNS0_6no_adl8IRObjectE:
   85|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
   86|  13.8k|    return ParseWithDomainTuple(inner_, obj);
   87|  13.8k|  }
_ZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE8GetValueERKNS2_5tupleIJiiEEE:
   71|  13.7k|  value_type GetValue(const corpus_type& v) const {
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
   75|  13.7k|  }
_ZZNK8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EE8GetValueERKNS2_5tupleIJiiEEEENKUlDpT_E_clIJNS2_17integral_constantImLm0EEENSJ_ImLm1EEEEEEDaSG_:
   72|  13.7k|    return ApplyIndex<sizeof...(Inner)>([&](auto... I) {
   73|  13.7k|      return mapper_(std::get<I>(inner_).GetValue(std::get<I>(v))...);
   74|  13.7k|    });
_ZN8fuzztest8internal7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEES9_EEC2ES7_S9_S9_:
   47|      2|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}
_ZN8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEESE_SE_SE_SE_SE_EEC2ESA_SC_SE_SE_SE_SE_SE_SE_:
   47|      4|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}
_ZN8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_jEJNS1_IPFS7_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEEC2ES9_SP_SQ_:
   47|      4|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}
_ZN8fuzztest8internal7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS8_EENS0_11InRangeImplIiEENSC_IS9_EENS0_13ArbitraryImplIbvEESI_SI_SI_NSC_ImEESJ_NSC_IiEENS0_24BitFlagCombinationOfImplIjEEEEC2ESB_SD_SF_SG_SI_SI_SI_SI_SJ_SJ_SK_SM_:
   47|      4|      : mapper_(std::move(mapper)), inner_(std::move(inner)...) {}

_ZZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEENKUlT_E_clINSI_17integral_constantImLm1EEEEEDaSZ_:
  127|  3.88k|    return Switch<kNumDomains>(corpus_value.index(), [&](auto I) {
  128|  3.88k|      const absl::Status s =
  129|  3.88k|          std::get<I>(domains_).ValidateCorpusValue(std::get<I>(corpus_value));
  130|  3.88k|      return Prefix(s, "Invalid value for OneOf() domain");
  131|  3.88k|    });
_ZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEE:
  126|  13.8k|  absl::Status ValidateCorpusValue(const corpus_type& corpus_value) const {
  127|  13.8k|    return Switch<kNumDomains>(corpus_value.index(), [&](auto I) {
  128|  13.8k|      const absl::Status s =
  129|  13.8k|          std::get<I>(domains_).ValidateCorpusValue(std::get<I>(corpus_value));
  130|  13.8k|      return Prefix(s, "Invalid value for OneOf() domain");
  131|  13.8k|    });
  132|  13.8k|  }
_ZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE11ParseCorpusERKNS0_6no_adl8IRObjectE:
  118|  13.8k|  std::optional<corpus_type> ParseCorpus(const IRObject& obj) const {
  119|  13.8k|    return ParseWithDomainVariant(domains_, obj);
  120|  13.8k|  }
_ZZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE8GetValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEENKUlT_E_clINSI_17integral_constantImLm0EEEEENSM_INSI_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSN_IS17_EEEESZ_:
   88|  9.91k|    return Switch<kNumDomains>(v.index(), [&](auto I) -> value_type {
   89|  9.91k|      const auto& domain = std::get<I>(domains_);
   90|  9.91k|      return domain.GetValue(std::get<I>(v));
   91|  9.91k|    });
_ZZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE8GetValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEENKUlT_E_clINSI_17integral_constantImLm1EEEEENSM_INSI_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSN_IS17_EEEESZ_:
   88|  3.87k|    return Switch<kNumDomains>(v.index(), [&](auto I) -> value_type {
   89|  3.87k|      const auto& domain = std::get<I>(domains_);
   90|  3.87k|      return domain.GetValue(std::get<I>(v));
   91|  3.87k|    });
_ZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE8GetValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEE:
   87|  13.7k|  value_type GetValue(const corpus_type& v) const {
   88|  13.7k|    return Switch<kNumDomains>(v.index(), [&](auto I) -> value_type {
   89|  13.7k|      const auto& domain = std::get<I>(domains_);
   90|  13.7k|      return domain.GetValue(std::get<I>(v));
   91|  13.7k|    });
   92|  13.7k|  }
_ZZNK8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEENKUlT_E_clINSI_17integral_constantImLm0EEEEEDaSZ_:
  127|  9.93k|    return Switch<kNumDomains>(corpus_value.index(), [&](auto I) {
  128|  9.93k|      const absl::Status s =
  129|  9.93k|          std::get<I>(domains_).ValidateCorpusValue(std::get<I>(corpus_value));
  130|  9.93k|      return Prefix(s, "Invalid value for OneOf() domain");
  131|  9.93k|    });
_ZN8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEEC2ESD_SG_:
   52|      2|  explicit OneOfImpl(Inner... domains) : domains_(std::move(domains)...) {}
_ZN8fuzztest8internal9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_30ArbitraryAvifLayeredRandDim16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEEEC2ESD_SG_:
   52|      2|  explicit OneOfImpl(Inner... domains) : domains_(std::move(domains)...) {}

_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorIhNS8_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEEEEENS8_8optionalINS8_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEiENKUlSN_E_clIJNS8_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEEEEEDaSN_ENKUlSN_E_clIJNSG_INS0_23ElementOfImplCorpusTypeEEES16_S16_S16_NSG_ISC_EEEEEDaSN_:
  118|  9.95k|    return [](auto... opts) {
  119|  89.5k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 1, False: 9.95k]
  |  Branch (119:15): [True: 0, False: 9.95k]
  |  Branch (119:15): [True: 0, False: 9.95k]
  |  Branch (119:15): [True: 0, False: 9.95k]
  |  Branch (119:15): [True: 0, False: 9.95k]
  ------------------
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorIhNS8_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEEEEENS8_8optionalINS8_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEiENKUlSN_E_clIJNS8_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEEEEEDaSN_:
  117|  9.95k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  9.95k|    return [](auto... opts) {
  119|  9.95k|      return (!opts || ...)
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  9.95k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorIhNS8_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEEEEENS8_8optionalINS8_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEi:
  114|  9.95k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  9.95k|  auto subs = obj.Subs();
  116|  9.95k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 0, False: 9.95k]
  |  Branch (116:16): [True: 0, False: 9.95k]
  ------------------
  117|  9.95k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  9.95k|    return [](auto... opts) {
  119|  9.95k|      return (!opts || ...)
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  9.95k|  });
  125|  9.95k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplI15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSB_IJDpSC_EEERKNS0_6no_adl8IRObjectEiENKUlSH_E_clIJNS9_17integral_constantImLm0EEENSR_ImLm1EEENSR_ImLm2EEENSR_ImLm3EEEEEEDaSH_ENKUlSH_E_clIJNSA_ItEESY_NSA_INS0_23ElementOfImplCorpusTypeEEENSA_IbEEEEEDaSH_:
  118|  9.95k|    return [](auto... opts) {
  119|  69.6k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 0, False: 9.95k]
  |  Branch (119:15): [True: 1, False: 9.95k]
  |  Branch (119:15): [True: 0, False: 9.95k]
  |  Branch (119:15): [True: 3, False: 9.95k]
  ------------------
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplI15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSB_IJDpSC_EEERKNS0_6no_adl8IRObjectEiENKUlSH_E_clIJNS9_17integral_constantImLm0EEENSR_ImLm1EEENSR_ImLm2EEENSR_ImLm3EEEEEEDaSH_:
  117|  9.95k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  9.95k|    return [](auto... opts) {
  119|  9.95k|      return (!opts || ...)
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  9.95k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplI15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSB_IJDpSC_EEERKNS0_6no_adl8IRObjectEi:
  114|  9.96k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  9.96k|  auto subs = obj.Subs();
  116|  9.96k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 1, False: 9.95k]
  |  Branch (116:16): [True: 1, False: 9.95k]
  ------------------
  117|  9.95k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  9.95k|    return [](auto... opts) {
  119|  9.95k|      return (!opts || ...)
  120|  9.95k|                 ? std::nullopt
  121|  9.95k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  9.95k|                       *std::move(opts)...});
  123|  9.95k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  9.95k|  });
  125|  9.96k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_IiEENS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorItNS9_9allocatorItEEEENS0_11InRangeImplItEEEEEEENS9_8optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiENKUlSO_E_clIJNS9_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEENSY_ImLm5EEEEEEDaSO_ENKUlSO_E_clIJNSH_INS0_23ElementOfImplCorpusTypeEEES18_S18_S18_S18_NSH_ISD_EEEEEDaSO_:
  118|  3.88k|    return [](auto... opts) {
  119|  42.7k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 0, False: 3.88k]
  |  Branch (119:15): [True: 1, False: 3.88k]
  |  Branch (119:15): [True: 0, False: 3.88k]
  |  Branch (119:15): [True: 0, False: 3.88k]
  |  Branch (119:15): [True: 0, False: 3.88k]
  |  Branch (119:15): [True: 0, False: 3.88k]
  ------------------
  120|  3.88k|                 ? std::nullopt
  121|  3.88k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.88k|                       *std::move(opts)...});
  123|  3.88k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_IiEENS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorItNS9_9allocatorItEEEENS0_11InRangeImplItEEEEEEENS9_8optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiENKUlSO_E_clIJNS9_17integral_constantImLm0EEENSY_ImLm1EEENSY_ImLm2EEENSY_ImLm3EEENSY_ImLm4EEENSY_ImLm5EEEEEEDaSO_:
  117|  3.88k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  3.88k|    return [](auto... opts) {
  119|  3.88k|      return (!opts || ...)
  120|  3.88k|                 ? std::nullopt
  121|  3.88k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.88k|                       *std::move(opts)...});
  123|  3.88k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  3.88k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplImEES3_NS2_IiEENS2_I15avifPixelFormatEENS2_IbEENS0_23SequenceContainerOfImplINSt3__16vectorItNS9_9allocatorItEEEENS0_11InRangeImplItEEEEEEENS9_8optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEi:
  114|  3.88k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  3.88k|  auto subs = obj.Subs();
  116|  3.88k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 0, False: 3.88k]
  |  Branch (116:16): [True: 0, False: 3.88k]
  ------------------
  117|  3.88k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  3.88k|    return [](auto... opts) {
  119|  3.88k|      return (!opts || ...)
  120|  3.88k|                 ? std::nullopt
  121|  3.88k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.88k|                       *std::move(opts)...});
  123|  3.88k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  3.88k|  });
  125|  3.88k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplIiEENS4_I15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSC_IJDpSD_EEERKNS0_6no_adl8IRObjectEiENKUlSI_E_clIJNSA_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEENSS_ImLm4EEEEEEDaSI_ENKUlSI_E_clIJNSB_ItEES10_NSB_INS0_23ElementOfImplCorpusTypeEEES12_NSB_IbEEEEEDaSI_:
  118|  3.89k|    return [](auto... opts) {
  119|  35.0k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 0, False: 3.89k]
  |  Branch (119:15): [True: 0, False: 3.89k]
  |  Branch (119:15): [True: 0, False: 3.89k]
  |  Branch (119:15): [True: 0, False: 3.89k]
  |  Branch (119:15): [True: 1, False: 3.89k]
  ------------------
  120|  3.89k|                 ? std::nullopt
  121|  3.89k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.89k|                       *std::move(opts)...});
  123|  3.89k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplIiEENS4_I15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSC_IJDpSD_EEERKNS0_6no_adl8IRObjectEiENKUlSI_E_clIJNSA_17integral_constantImLm0EEENSS_ImLm1EEENSS_ImLm2EEENSS_ImLm3EEENSS_ImLm4EEEEEEDaSI_:
  117|  3.89k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  3.89k|    return [](auto... opts) {
  119|  3.89k|      return (!opts || ...)
  120|  3.89k|                 ? std::nullopt
  121|  3.89k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.89k|                       *std::move(opts)...});
  123|  3.89k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  3.89k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplItEES3_NS0_13ElementOfImplIiEENS4_I15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSC_IJDpSD_EEERKNS0_6no_adl8IRObjectEi:
  114|  3.89k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  3.89k|  auto subs = obj.Subs();
  116|  3.89k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 0, False: 3.89k]
  |  Branch (116:16): [True: 0, False: 3.89k]
  ------------------
  117|  3.89k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  3.89k|    return [](auto... opts) {
  119|  3.89k|      return (!opts || ...)
  120|  3.89k|                 ? std::nullopt
  121|  3.89k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  3.89k|                       *std::move(opts)...});
  123|  3.89k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  3.89k|  });
  125|  3.89k|}
_ZZN8fuzztest8internal22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEENSt3__17variantIJNSH_5tupleIJNSJ_IJNS0_23ElementOfImplCorpusTypeESK_SK_SK_NSH_6vectorIhNSH_9allocatorIhEEEEEEEttSK_bEEENSJ_IJNSJ_IJSK_SK_SK_SK_SK_NSL_ItNSM_ItEEEEEEEttSK_SK_bEEEEEEEENSH_8optionalIT0_EERKNSJ_IJDpT_EEERKNS0_6no_adl8IRObjectEENKUlT_E_clINSH_17integral_constantImLm0EEEEENSW_ISV_EES18_:
   58|  9.96k|      *alternative, [&](auto I) -> std::optional<ReturnT> {
   59|  9.96k|        auto inner_corpus = std::get<I>(domains).ParseCorpus((*subs)[1]);
   60|  9.96k|        if (!inner_corpus) return std::nullopt;
  ------------------
  |  Branch (60:13): [True: 9, False: 9.95k]
  ------------------
   61|  9.95k|        return ReturnT(std::in_place_index<I>, *std::move(inner_corpus));
   62|  9.96k|      });
_ZZN8fuzztest8internal22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEENSt3__17variantIJNSH_5tupleIJNSJ_IJNS0_23ElementOfImplCorpusTypeESK_SK_SK_NSH_6vectorIhNSH_9allocatorIhEEEEEEEttSK_bEEENSJ_IJNSJ_IJSK_SK_SK_SK_SK_NSL_ItNSM_ItEEEEEEEttSK_SK_bEEEEEEEENSH_8optionalIT0_EERKNSJ_IJDpT_EEERKNS0_6no_adl8IRObjectEENKUlT_E_clINSH_17integral_constantImLm1EEEEENSW_ISV_EES18_:
   58|  3.89k|      *alternative, [&](auto I) -> std::optional<ReturnT> {
   59|  3.89k|        auto inner_corpus = std::get<I>(domains).ParseCorpus((*subs)[1]);
   60|  3.89k|        if (!inner_corpus) return std::nullopt;
  ------------------
  |  Branch (60:13): [True: 3, False: 3.88k]
  ------------------
   61|  3.88k|        return ReturnT(std::in_place_index<I>, *std::move(inner_corpus));
   62|  3.89k|      });
_ZN8fuzztest8internal22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEEENS2_IZNS4_23ArbitraryAvifLayered16bEvEUlmmiS5_bE_JS8_S8_NS9_IiEESA_SC_EEEENSt3__17variantIJNSH_5tupleIJNSJ_IJNS0_23ElementOfImplCorpusTypeESK_SK_SK_NSH_6vectorIhNSH_9allocatorIhEEEEEEEttSK_bEEENSJ_IJNSJ_IJSK_SK_SK_SK_SK_NSL_ItNSM_ItEEEEEEEttSK_SK_bEEEEEEEENSH_8optionalIT0_EERKNSJ_IJDpT_EEERKNS0_6no_adl8IRObjectE:
   50|  13.8k|    const std::tuple<Domain...>& domains, const IRObject& obj) {
   51|  13.8k|  auto subs = obj.Subs();
   52|  13.8k|  if (!subs || subs->size() != 2) return std::nullopt;
  ------------------
  |  Branch (52:7): [True: 18, False: 13.8k]
  |  Branch (52:16): [True: 1, False: 13.8k]
  ------------------
   53|       |
   54|  13.8k|  auto alternative = (*subs)[0].GetScalar<size_t>();
   55|  13.8k|  if (!alternative || *alternative >= sizeof...(Domain)) return std::nullopt;
  ------------------
  |  Branch (55:7): [True: 0, False: 13.8k]
  |  Branch (55:23): [True: 0, False: 13.8k]
  ------------------
   56|       |
   57|  13.8k|  return Switch<sizeof...(Domain)>(
   58|  13.8k|      *alternative, [&](auto I) -> std::optional<ReturnT> {
   59|  13.8k|        auto inner_corpus = std::get<I>(domains).ParseCorpus((*subs)[1]);
   60|  13.8k|        if (!inner_corpus) return std::nullopt;
   61|  13.8k|        return ReturnT(std::in_place_index<I>, *std::move(inner_corpus));
   62|  13.8k|      });
   63|  13.8k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEES6_S6_S6_S6_S6_EEENSt3__18optionalINS7_5tupleIJDpNT_11corpus_typeEEEEEERKNS9_IJDpSA_EEERKNS0_6no_adl8IRObjectEiENKUlSF_E_clIJNS7_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSF_ENKUlSF_E_clIJNS8_INS0_23ElementOfImplCorpusTypeEEENS8_IiEES11_S11_S11_S11_S11_EEEDaSF_:
  118|  13.8k|    return [](auto... opts) {
  119|   179k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  ------------------
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEES6_S6_S6_S6_S6_EEENSt3__18optionalINS7_5tupleIJDpNT_11corpus_typeEEEEEERKNS9_IJDpSA_EEERKNS0_6no_adl8IRObjectEiENKUlSF_E_clIJNS7_17integral_constantImLm0EEENSP_ImLm1EEENSP_ImLm2EEENSP_ImLm3EEENSP_ImLm4EEENSP_ImLm5EEENSP_ImLm6EEEEEEDaSF_:
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEES6_S6_S6_S6_S6_EEENSt3__18optionalINS7_5tupleIJDpNT_11corpus_typeEEEEEERKNS9_IJDpSA_EEERKNS0_6no_adl8IRObjectEi:
  114|  13.8k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  13.8k|  auto subs = obj.Subs();
  116|  13.8k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 22, False: 13.8k]
  |  Branch (116:16): [True: 4, False: 13.8k]
  ------------------
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
  125|  13.8k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEENS2_I17avifDecoderSourceEENS0_13ArbitraryImplIbvEESA_SA_SA_NS2_ImEESB_NS2_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSt3__18optionalINSF_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEiENKUlSN_E_clIJNSF_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSN_ENKUlSN_E_clIJNSG_INS0_23ElementOfImplCorpusTypeEEENSG_IiEES1C_NSG_IbEES1E_S1E_S1E_S1C_S1C_S1C_NSG_IjEEEEEDaSN_:
  118|  13.8k|    return [](auto... opts) {
  119|   290k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  ------------------
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEENS2_I17avifDecoderSourceEENS0_13ArbitraryImplIbvEESA_SA_SA_NS2_ImEESB_NS2_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSt3__18optionalINSF_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEiENKUlSN_E_clIJNSF_17integral_constantImLm0EEENSX_ImLm1EEENSX_ImLm2EEENSX_ImLm3EEENSX_ImLm4EEENSX_ImLm5EEENSX_ImLm6EEENSX_ImLm7EEENSX_ImLm8EEENSX_ImLm9EEENSX_ImLm10EEEEEEDaSN_:
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEENS2_I17avifDecoderSourceEENS0_13ArbitraryImplIbvEESA_SA_SA_NS2_ImEESB_NS2_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSt3__18optionalINSF_5tupleIJDpNT_11corpus_typeEEEEEERKNSH_IJDpSI_EEERKNS0_6no_adl8IRObjectEi:
  114|  13.8k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  13.8k|  auto subs = obj.Subs();
  116|  13.8k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 0, False: 13.8k]
  |  Branch (116:16): [True: 1, False: 13.8k]
  ------------------
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
  125|  13.8k|}
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSD_IjEEEEENS3_8optionalINS3_5tupleIJDpNT_11corpus_typeEEEEEERKNSR_IJDpSS_EEERKNS0_6no_adl8IRObjectEiENKUlSX_E_clIJNS3_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaSX_ENKUlSX_E_clIJNSQ_INSR_IJNS0_23ElementOfImplCorpusTypeEiS1C_bbbbS1C_S1C_S1C_jEEEEENSQ_IS1C_EEEEEDaSX_:
  118|  13.8k|    return [](auto... opts) {
  119|  41.5k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 10, False: 13.8k]
  |  Branch (119:15): [True: 0, False: 13.8k]
  ------------------
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSD_IjEEEEENS3_8optionalINS3_5tupleIJDpNT_11corpus_typeEEEEEERKNSR_IJDpSS_EEERKNS0_6no_adl8IRObjectEiENKUlSX_E_clIJNS3_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaSX_:
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSD_IjEEEEENS3_8optionalINS3_5tupleIJDpNT_11corpus_typeEEEEEERKNSR_IJDpSS_EEERKNS0_6no_adl8IRObjectEi:
  114|  13.8k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  13.8k|  auto subs = obj.Subs();
  116|  13.8k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 25, False: 13.8k]
  |  Branch (116:16): [True: 3, False: 13.8k]
  ------------------
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
  125|  13.8k|}
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEEENS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS8_IiEESQ_EEENSJ_IPFNSK_10unique_ptrI11avifEncoderNS4_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSA_ISW_EESQ_SQ_SQ_SQ_SQ_SQ_EEENSJ_IPFNSS_I11avifDecoderSU_EES12_jEJNSJ_IPFS12_SW_i17avifDecoderSourcebbbbjjjjEJSZ_SQ_NSA_IS15_EESD_SD_SD_SD_NSA_ImEES19_SG_NS0_24BitFlagCombinationOfImplIjEEEEENSA_IjEEEEEEEENSK_8optionalINSK_5tupleIJDpNT_11corpus_typeEEEEEERKNS1G_IJDpS1H_EEERKNS0_6no_adl8IRObjectEi:
  114|  15.0k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  15.0k|  auto subs = obj.Subs();
  116|  15.0k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 1.00k, False: 14.0k]
  |  Branch (116:16): [True: 178, False: 13.8k]
  ------------------
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
  125|  15.0k|}
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEEENS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS8_IiEESQ_EEENSJ_IPFNSK_10unique_ptrI11avifEncoderNS4_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSA_ISW_EESQ_SQ_SQ_SQ_SQ_SQ_EEENSJ_IPFNSS_I11avifDecoderSU_EES12_jEJNSJ_IPFS12_SW_i17avifDecoderSourcebbbbjjjjEJSZ_SQ_NSA_IS15_EESD_SD_SD_SD_NSA_ImEES19_SG_NS0_24BitFlagCombinationOfImplIjEEEEENSA_IjEEEEEEEENSK_8optionalINSK_5tupleIJDpNT_11corpus_typeEEEEEERKNS1G_IJDpS1H_EEERKNS0_6no_adl8IRObjectEiENKUlS1M_E_clIJNSK_17integral_constantImLm0EEENS1W_ImLm1EEENS1W_ImLm2EEENS1W_ImLm3EEEEEEDaS1M_:
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEEENS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS8_IiEESQ_EEENSJ_IPFNSK_10unique_ptrI11avifEncoderNS4_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSA_ISW_EESQ_SQ_SQ_SQ_SQ_SQ_EEENSJ_IPFNSS_I11avifDecoderSU_EES12_jEJNSJ_IPFS12_SW_i17avifDecoderSourcebbbbjjjjEJSZ_SQ_NSA_IS15_EESD_SD_SD_SD_NSA_ImEES19_SG_NS0_24BitFlagCombinationOfImplIjEEEEENSA_IjEEEEEEEENSK_8optionalINSK_5tupleIJDpNT_11corpus_typeEEEEEERKNS1G_IJDpS1H_EEERKNS0_6no_adl8IRObjectEiENKUlS1M_E_clIJNSK_17integral_constantImLm0EEENS1W_ImLm1EEENS1W_ImLm2EEENS1W_ImLm3EEEEEEDaS1M_ENKUlS1M_E_clIJNS1F_INSK_7variantIJNS1G_IJNS1G_IJNS0_23ElementOfImplCorpusTypeES24_S24_S24_NSK_6vectorIhNSK_9allocatorIhEEEEEEEttS24_bEEENS1G_IJNS1G_IJS24_S24_S24_S24_S24_NS25_ItNS26_ItEEEEEEEttS24_S24_bEEEEEEEENS1F_INS1G_IJiiEEEEENS1F_INS1G_IJS24_iiiiiiEEEEENS1F_INS1G_IJNS1G_IJS24_iS24_bbbbS24_S24_S24_jEEES24_EEEEEEEEDaS1M_:
  118|  13.8k|    return [](auto... opts) {
  119|  96.9k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 3, False: 13.8k]
  |  Branch (119:15): [True: 11, False: 13.8k]
  |  Branch (119:15): [True: 4, False: 13.8k]
  |  Branch (119:15): [True: 31, False: 13.8k]
  ------------------
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
_ZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplIiEES3_EEENSt3__18optionalINS4_5tupleIJDpNT_11corpus_typeEEEEEERKNS6_IJDpS7_EEERKNS0_6no_adl8IRObjectEi:
  114|  13.8k|    const std::tuple<Domain...>& domains, const IRObject& obj, int skip = 0) {
  115|  13.8k|  auto subs = obj.Subs();
  116|  13.8k|  if (!subs || subs->size() != sizeof...(Domain) + skip) return std::nullopt;
  ------------------
  |  Branch (116:7): [True: 24, False: 13.8k]
  |  Branch (116:16): [True: 4, False: 13.8k]
  ------------------
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
  125|  13.8k|}
_ZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplIiEES3_EEENSt3__18optionalINS4_5tupleIJDpNT_11corpus_typeEEEEEERKNS6_IJDpS7_EEERKNS0_6no_adl8IRObjectEiENKUlSC_E_clIJNS4_17integral_constantImLm0EEENSM_ImLm1EEEEEEDaSC_:
  117|  13.8k|  return ApplyIndex<sizeof...(Domain)>([&](auto... I) {
  118|  13.8k|    return [](auto... opts) {
  119|  13.8k|      return (!opts || ...)
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);
  124|  13.8k|  });
_ZZZN8fuzztest8internal20ParseWithDomainTupleIJNS0_11InRangeImplIiEES3_EEENSt3__18optionalINS4_5tupleIJDpNT_11corpus_typeEEEEEERKNS6_IJDpS7_EEERKNS0_6no_adl8IRObjectEiENKUlSC_E_clIJNS4_17integral_constantImLm0EEENSM_ImLm1EEEEEEDaSC_ENKUlSC_E_clIJNS5_IiEESR_EEEDaSC_:
  118|  13.8k|    return [](auto... opts) {
  119|  41.5k|      return (!opts || ...)
  ------------------
  |  Branch (119:15): [True: 1, False: 13.8k]
  |  Branch (119:15): [True: 1, False: 13.8k]
  ------------------
  120|  13.8k|                 ? std::nullopt
  121|  13.8k|                 : std::optional(std::tuple<corpus_type_t<Domain>...>{
  122|  13.8k|                       *std::move(opts)...});
  123|  13.8k|    }(std::get<I>(domains).ParseCorpus((*subs)[I + skip])...);

_ZN8fuzztest8internal8BitWidthIiEEmT_:
   45|  11.6k|size_t BitWidth(T val) {
   46|       |  if constexpr (std::is_same_v<T, absl::int128> ||
   47|       |                std::is_same_v<T, absl::uint128>) {
   48|       |    auto val_unsigned = MakeUnsignedT<T>(val);
   49|       |    size_t res = 0;
   50|       |    while (val_unsigned >>= 1) ++res;
   51|       |    return res;
   52|  11.6k|  } else {
   53|  11.6k|    return absl::bit_width(static_cast<MakeUnsignedT<T>>(val));
   54|  11.6k|  }
   55|  11.6k|}

_ZN8fuzztest8internal20UntypedFixtureDriver11RunFuzzTestEN4absl12lts_2026052612AnyInvocableIFvvOEEE:
   24|      2|void UntypedFixtureDriver::RunFuzzTest(absl::AnyInvocable<void() &&> run_test) {
   25|      2|  std::move(run_test)();
   26|      2|}
_ZN8fuzztest8internal20UntypedFixtureDriver20RunFuzzTestIterationEN4absl12lts_2026052612AnyInvocableIFvvOEEE:
   28|  13.7k|    absl::AnyInvocable<void() &&> run_iteration) {
   29|  13.7k|  std::move(run_iteration)();
   30|  13.7k|}

_ZN8fuzztest8internal13FixtureDriverINS_6DomainINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvEC2ESR_SM_NS5_INS0_11CopyableAnyENSB_ISU_EEEERKSS_:
  317|      2|      : FixtureDriver::TypedFixtureDriver(std::move(domain), std::move(seeds),
  318|      2|                                          seed_provider),
  319|      2|        target_function_(target_function) {}
_ZN8fuzztest8internal18TypedFixtureDriverINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEEPvEC2ENS_6DomainISK_EENS4_INS0_11CopyableAnyENSA_ISP_EEEERKSL_:
  135|      2|      : domain_(std::move(domain)),
  136|      2|        seeds_(std::move(seeds)),
  137|      2|        seed_provider_(seed_provider) {}
_ZNK8fuzztest8internal13FixtureDriverINS_6DomainINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvE4TestEONS0_11MoveOnlyAnyE:
  321|  13.7k|  void Test(MoveOnlyAny&& args_untyped) const override {
  322|  13.7k|    std::apply(
  323|  13.7k|        [&](auto&&... args) {
  324|  13.7k|          target_function_(ForceVectorForStringView<Args>(std::move(args))...);
  325|  13.7k|        },
  326|  13.7k|        args_untyped.GetAs<value_type_t<DomainT>>());
  327|  13.7k|  }
_ZZNK8fuzztest8internal13FixtureDriverINS_6DomainINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvE4TestEONS0_11MoveOnlyAnyEENKUlDpOT_E_clIJRSD_RSG_RSI_RSK_EEEDaSY_:
  323|  13.7k|        [&](auto&&... args) {
  324|  13.7k|          target_function_(ForceVectorForStringView<Args>(std::move(args))...);
  325|  13.7k|        },
_ZN8fuzztest8internal24ForceVectorForStringViewINSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEESB_EEDcOT0_:
  212|  13.7k|decltype(auto) ForceVectorForStringView(Src&& src) {
  213|       |  // We only do this when Src is a std::string. If it's a string view it is
  214|       |  // handled by the string view domain itself.
  215|       |  if constexpr (std::is_same_v<void(std::decay_t<Dest>, std::decay_t<Src>),
  216|       |                               void(std::string_view, std::string)>) {
  217|       |    return ForceVector{std::vector<char>(src.begin(), src.end())};
  218|  13.7k|  } else {
  219|  13.7k|    return std::forward<Src>(src);
  220|  13.7k|  }
  221|  13.7k|}
_ZN8fuzztest8internal24ForceVectorForStringViewIRKNSt3__15arrayI15avifScalingModeLm4EEES5_EEDcOT0_:
  212|  13.7k|decltype(auto) ForceVectorForStringView(Src&& src) {
  213|       |  // We only do this when Src is a std::string. If it's a string view it is
  214|       |  // handled by the string view domain itself.
  215|       |  if constexpr (std::is_same_v<void(std::decay_t<Dest>, std::decay_t<Src>),
  216|       |                               void(std::string_view, std::string)>) {
  217|       |    return ForceVector{std::vector<char>(src.begin(), src.end())};
  218|  13.7k|  } else {
  219|  13.7k|    return std::forward<Src>(src);
  220|  13.7k|  }
  221|  13.7k|}
_ZN8fuzztest8internal24ForceVectorForStringViewINSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEES7_EEDcOT0_:
  212|  13.7k|decltype(auto) ForceVectorForStringView(Src&& src) {
  213|       |  // We only do this when Src is a std::string. If it's a string view it is
  214|       |  // handled by the string view domain itself.
  215|       |  if constexpr (std::is_same_v<void(std::decay_t<Dest>, std::decay_t<Src>),
  216|       |                               void(std::string_view, std::string)>) {
  217|       |    return ForceVector{std::vector<char>(src.begin(), src.end())};
  218|  13.7k|  } else {
  219|  13.7k|    return std::forward<Src>(src);
  220|  13.7k|  }
  221|  13.7k|}
_ZN8fuzztest8internal24ForceVectorForStringViewINSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_EEDcOT0_:
  212|  13.7k|decltype(auto) ForceVectorForStringView(Src&& src) {
  213|       |  // We only do this when Src is a std::string. If it's a string view it is
  214|       |  // handled by the string view domain itself.
  215|       |  if constexpr (std::is_same_v<void(std::decay_t<Dest>, std::decay_t<Src>),
  216|       |                               void(std::string_view, std::string)>) {
  217|       |    return ForceVector{std::vector<char>(src.begin(), src.end())};
  218|  13.7k|  } else {
  219|  13.7k|    return std::forward<Src>(src);
  220|  13.7k|  }
  221|  13.7k|}
_ZNK8fuzztest8internal18TypedFixtureDriverINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEEPvE10GetDomainsEv:
  151|      2|  UntypedDomain GetDomains() const final { return domain_; }

_ZNK8fuzztest8internal17GTest_TestAdaptor26GetFuzzTestsInCurrentShardEv:
   28|      2|std::vector<std::string> GTest_TestAdaptor::GetFuzzTestsInCurrentShard() const {
   29|      2|  std::vector<std::string> result;
   30|      4|  for (const auto* test : GetRegisteredTests()) {
  ------------------
  |  Branch (30:25): [True: 4, False: 2]
  ------------------
   31|      4|    if (!test->should_run()) continue;
  ------------------
  |  Branch (31:9): [True: 2, False: 2]
  ------------------
   32|      2|    if (test->is_in_another_shard()) continue;
  ------------------
  |  Branch (32:9): [True: 0, False: 2]
  ------------------
   33|      2|    for (const auto& fuzztest : configuration_.fuzz_tests) {
  ------------------
  |  Branch (33:31): [True: 2, False: 0]
  ------------------
   34|      2|      if (fuzztest ==
  ------------------
  |  Branch (34:11): [True: 2, False: 0]
  ------------------
   35|      2|          absl::StrCat(test->test_suite_name(), ".", test->name())) {
   36|      2|        result.push_back(fuzztest);
   37|      2|        break;
   38|      2|      }
   39|      2|    }
   40|      2|  }
   41|      2|  return result;
   42|      2|}
_ZN8fuzztest8internal30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS0_13ConfigurationE:
  105|      2|                                    const Configuration& configuration) {
  106|      2|  ::fuzztest::internal::ForEachTest([&](auto& test) {
  107|      2|    if (test.uses_fixture()) {
  108|      2|      RegisterTests<::fuzztest::internal::GTest_TestAdaptor>(argc, argv, test,
  109|      2|                                                             configuration);
  110|      2|    } else {
  111|      2|      RegisterTests<::testing::Test>(argc, argv, test, configuration);
  112|      2|    }
  113|      2|  });
  114|       |
  115|      2|  ::testing::UnitTest::GetInstance()->listeners().Append(
  116|      2|      new ::fuzztest::internal::GTest_EventListener<
  117|      2|          ::testing::EmptyTestEventListener, ::testing::TestPartResult>());
  118|      2|}
_ZN8fuzztest8internal28FuzzTestListingModeValidator26RegisterGoogleTestListenerEv:
  174|      2|void FuzzTestListingModeValidator::RegisterGoogleTestListener() {
  175|      2|  testing::UnitTest::GetInstance()->listeners().Append(
  176|      2|      new ValidatorProxyListener(this));
  177|      2|}
_ZN8fuzztest8internal44SetFuzzTestListingModeValidatorForGoogleTestEb:
  179|      2|void SetFuzzTestListingModeValidatorForGoogleTest(bool listing_mode) {
  180|      2|  FuzzTestListingModeValidator::GetInstance().set_listing_mode(listing_mode);
  181|      2|}
_ZN8fuzztest8internal18GetRegisteredTestsEv:
  183|      2|std::vector<const testing::TestInfo*> GetRegisteredTests() {
  184|      2|  std::vector<const testing::TestInfo*> result;
  185|      2|  auto& unit_test = *testing::UnitTest::GetInstance();
  186|       |  // TODO(b/416466508): Remove this call once the bug is fixed. This function is
  187|       |  // internal to GoogleTest.
  188|      2|  unit_test.parameterized_test_registry().RegisterTests();
  189|      4|  for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
  ------------------
  |  Branch (189:19): [True: 2, False: 2]
  ------------------
  190|      6|    for (int j = 0; j < unit_test.GetTestSuite(i)->total_test_count(); ++j) {
  ------------------
  |  Branch (190:21): [True: 4, False: 2]
  ------------------
  191|      4|      result.push_back(unit_test.GetTestSuite(i)->GetTestInfo(j));
  192|      4|    }
  193|      2|  }
  194|      2|  return result;
  195|      2|}
_ZN8fuzztest8internal22ValidatorProxyListenerC2EPNS0_28FuzzTestListingModeValidatorE:
  169|      2|      : validator_(validator) {}
_ZN8fuzztest8internal22ValidatorProxyListener18OnTestProgramStartERKN7testing8UnitTestE:
  161|      2|  void OnTestProgramStart(const testing::UnitTest& unit_test) override {
  162|      2|    validator_->Run();
  163|      2|  }
_ZN8fuzztest8internal28FuzzTestListingModeValidator3RunEv:
  124|      2|  void Run() {
  125|      2|    if (listing_mode_) {
  ------------------
  |  Branch (125:9): [True: 0, False: 2]
  ------------------
  126|       |      // Since InitFuzzTest calls std::exit after listing the fuzz tests, we
  127|       |      // would not reach here if InitFuzzTest is called before.
  128|       |      absl::FPrintF(stderr,
  129|      0|                    "[!] --" FUZZTEST_FLAG_PREFIX
  130|      0|                    "list_fuzz_tests not handled by InitFuzzTest - fuzz tests "
  131|      0|                    "would not be listed even if defined.\n");
  132|      0|      std::exit(0);
  133|      0|    }
  134|      2|  }
_ZN8fuzztest8internal28FuzzTestListingModeValidator11GetInstanceEv:
  138|      2|  static FuzzTestListingModeValidator& GetInstance() {
  139|      2|    static auto* instance = [] {
  140|      2|      static_assert(
  141|      2|          std::is_trivially_destructible_v<FuzzTestListingModeValidator>);
  142|      2|      static FuzzTestListingModeValidator instance;
  143|      2|      instance.RegisterGoogleTestListener();
  144|      2|      return &instance;
  145|      2|    }();
  146|      2|    return *instance;
  147|      2|  }
_ZZN8fuzztest8internal28FuzzTestListingModeValidator11GetInstanceEvENKUlvE_clEv:
  139|      2|    static auto* instance = [] {
  140|      2|      static_assert(
  141|      2|          std::is_trivially_destructible_v<FuzzTestListingModeValidator>);
  142|      2|      static FuzzTestListingModeValidator instance;
  143|      2|      instance.RegisterGoogleTestListener();
  144|      2|      return &instance;
  145|      2|    }();
_ZN8fuzztest8internal28FuzzTestListingModeValidator16set_listing_modeEb:
  136|      2|  void set_listing_mode(bool listing_mode) { listing_mode_ = listing_mode; }
googletest_adaptor.cc:_ZZN8fuzztest8internal30RegisterFuzzTestsAsGoogleTestsEPiPPPcRKNS0_13ConfigurationEENK3$_0clINS0_8FuzzTestEEEDaRT_:
  106|      4|  ::fuzztest::internal::ForEachTest([&](auto& test) {
  107|      4|    if (test.uses_fixture()) {
  ------------------
  |  Branch (107:9): [True: 0, False: 4]
  ------------------
  108|      0|      RegisterTests<::fuzztest::internal::GTest_TestAdaptor>(argc, argv, test,
  109|      0|                                                             configuration);
  110|      4|    } else {
  111|      4|      RegisterTests<::testing::Test>(argc, argv, test, configuration);
  112|      4|    }
  113|      4|  });
googletest_adaptor.cc:_ZN8fuzztest8internal12_GLOBAL__N_113RegisterTestsIN7testing4TestEEEvPiPPPcRNS0_8FuzzTestERKNS0_13ConfigurationE:
   96|      4|                   const Configuration& configuration) {
   97|      4|  RegisterFuzzTestAsGTest<T>(argc, argv, test, configuration);
   98|      4|  RegisterSeparateRegressionTestForEachCrashingInput<T>(argc, argv, test,
   99|      4|                                                        configuration);
  100|      4|}
googletest_adaptor.cc:_ZN8fuzztest8internal12_GLOBAL__N_123RegisterFuzzTestAsGTestIN7testing4TestEEEvPiPPPcRNS0_8FuzzTestERKNS0_13ConfigurationENSt3__117basic_string_viewIcNSE_11char_traitsIcEEEE:
   48|      4|                             absl::string_view crashing_input_path = "") {
   49|      4|  auto fixture_factory = [argc, argv, &test,
   50|      4|                          configuration = configuration]() mutable -> T* {
   51|      4|    return new ::fuzztest::internal::GTest_TestAdaptor(
   52|      4|        test, argc, argv, std::move(configuration));
   53|      4|  };
   54|      4|  if (crashing_input_path.empty()) {
  ------------------
  |  Branch (54:7): [True: 4, False: 0]
  ------------------
   55|      4|    ::testing::RegisterTest(test.suite_name().c_str(), test.test_name().c_str(),
   56|      4|                            nullptr, nullptr, test.file().c_str(), test.line(),
   57|      4|                            std::move(fixture_factory));
   58|      4|    return;
   59|      4|  }
   60|      0|  const absl::StatusOr<std::string> regression_test_name =
   61|      0|      RegressionTestNameForCrashingInput(test.test_name(), crashing_input_path);
   62|      0|  if (!regression_test_name.ok()) {
  ------------------
  |  Branch (62:7): [True: 0, False: 0]
  ------------------
   63|      0|    FUZZTEST_LOG(WARNING)
  ------------------
  |  |   36|      0|#define FUZZTEST_LOG(severity) ABSL_LOG(severity)
  |  |  ------------------
  |  |  |  |   38|      0|#define ABSL_LOG(severity) ABSL_LOG_INTERNAL_LOG_IMPL(_##severity)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION##severity(STATELESS, true) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  174|      0|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      0|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      0|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      0|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      0|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|      ABSL_LOG_INTERNAL_LOG##severity.InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|  ::absl::log_internal::LogMessage(   \
  |  |  |  |  |  |  |  |   61|      0|      __FILE__, __LINE__, ::absl::log_internal::LogMessage::WarningTag{})
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|      0|        << "Failed to get regression test name for crashing input "
   65|      0|        << crashing_input_path << ". Not registering a regression test for it. "
   66|      0|        << "Status: " << regression_test_name.status();
   67|      0|    return;
   68|      0|  }
   69|      0|  ::testing::RegisterTest(
   70|      0|      test.suite_name().c_str(), regression_test_name->c_str(), nullptr,
   71|      0|      nullptr, test.file().c_str(), test.line(), std::move(fixture_factory));
   72|      0|}
googletest_adaptor.cc:_ZZN8fuzztest8internal12_GLOBAL__N_123RegisterFuzzTestAsGTestIN7testing4TestEEEvPiPPPcRNS0_8FuzzTestERKNS0_13ConfigurationENSt3__117basic_string_viewIcNSE_11char_traitsIcEEEEENUlvE_clEv:
   50|      2|                          configuration = configuration]() mutable -> T* {
   51|      2|    return new ::fuzztest::internal::GTest_TestAdaptor(
   52|      2|        test, argc, argv, std::move(configuration));
   53|      2|  };
googletest_adaptor.cc:_ZN8fuzztest8internal12_GLOBAL__N_150RegisterSeparateRegressionTestForEachCrashingInputIN7testing4TestEEEvPiPPPcRNS0_8FuzzTestERKNS0_13ConfigurationE:
   77|      4|    const Configuration& configuration) {
   78|      4|  if (!configuration.reproduce_findings_as_separate_tests) return;
  ------------------
  |  Branch (78:7): [True: 4, False: 0]
  ------------------
   79|       |#ifdef FUZZTEST_USE_CENTIPEDE
   80|       |  const std::vector<std::string> crash_inputs =
   81|       |      ListCrashIdsUsingCentipede(configuration, test.full_name());
   82|       |#else
   83|      0|  CorpusDatabase corpus_database(configuration);
   84|      0|  const std::vector<std::string> crash_inputs =
   85|      0|      corpus_database.GetCrashingInputsIfAny(test.full_name());
   86|      0|#endif
   87|      0|  for (const std::string& input : crash_inputs) {
  ------------------
  |  Branch (87:33): [True: 0, False: 0]
  ------------------
   88|      0|    Configuration updated_configuration = configuration;
   89|      0|    updated_configuration.crashing_input_to_reproduce = input;
   90|      0|    RegisterFuzzTestAsGTest<T>(argc, argv, test, updated_configuration, input);
   91|      0|  }
   92|      0|}

_ZN8fuzztest8internal17GTest_TestAdaptorC2ERNS0_8FuzzTestEPiPPPcNS0_13ConfigurationE:
   35|      2|      : test_(test),
   36|      2|        argc_(argc),
   37|      2|        argv_(argv),
   38|      2|        configuration_(std::move(configuration)) {}
_ZN8fuzztest8internal17GTest_TestAdaptor8TestBodyEv:
   40|      2|  void TestBody() override {
   41|      2|    RecordProperty("fuzz_test", "true");
   42|      2|    auto test = test_.make();
   43|      2|    configuration_.fuzz_tests_in_current_shard = GetFuzzTestsInCurrentShard();
   44|       |    // We replay a reproducer in the same process to help debugging when
   45|       |    // (1) we're replaying a single reproducer and (2) we're running locally.
   46|      2|    const bool running_locally =
   47|      2|        !std::getenv("FUZZTEST_RUNNING_UNDER_CI");
   48|      2|    configuration_.replay_in_single_process =
   49|      2|        configuration_.crashing_input_to_reproduce.has_value() &&
  ------------------
  |  Branch (49:9): [True: 0, False: 2]
  ------------------
   50|      0|        testing::UnitTest::GetInstance()->test_to_run_count() == 1 &&
  ------------------
  |  Branch (50:9): [True: 0, False: 0]
  ------------------
   51|      0|        running_locally;
  ------------------
  |  Branch (51:9): [True: 0, False: 0]
  ------------------
   52|      2|    if (Runtime::instance().run_mode() == RunMode::kUnitTest) {
  ------------------
  |  Branch (52:9): [True: 0, False: 2]
  ------------------
   53|       |      // In "bug reproduction" mode, sometimes we need to reproduce multiple
   54|       |      // bugs, i.e., run multiple tests that lead to a crash.
   55|      0|#if defined(GTEST_HAS_DEATH_TEST) && !defined(FUZZTEST_USE_CENTIPEDE)
   56|      0|      const bool needs_subprocess =
   57|      0|          configuration_.crashing_input_to_reproduce.has_value() &&
  ------------------
  |  Branch (57:11): [True: 0, False: 0]
  ------------------
   58|      0|          (!configuration_.replay_in_single_process ||
  ------------------
  |  Branch (58:12): [True: 0, False: 0]
  ------------------
   59|       |           // EXPECT_EXIT is required in the death-test subprocess, but in
   60|       |           // the subprocess there's only one test to run.
   61|      0|           testing::internal::InDeathTestChild());
  ------------------
  |  Branch (61:12): [True: 0, False: 0]
  ------------------
   62|       |#else
   63|       |      const bool needs_subprocess = false;
   64|       |#endif
   65|      0|      if (needs_subprocess) {
  ------------------
  |  Branch (65:11): [True: 0, False: 0]
  ------------------
   66|      0|        configuration_.preprocess_crash_reproducing = [] {
   67|       |          // EXPECT_EXIT disables event forwarding in gtest and as a result,
   68|       |          // EXPECT/ASSERT-s are disabled. Here, we overwrite this option.
   69|      0|          testing::UnitTest::GetInstance()->listeners().SuppressEventForwarding(
   70|      0|              false);
   71|      0|        };
   72|       |        // `RunInUnitTestMode` is supposed to fail and we wish to show the
   73|       |        // failure to the user. Directly running the test would terminate the
   74|       |        // process and using `EXPECT_DEATH` causes the test to pass. We use
   75|       |        // `EXPECT_EXIT` so that the test exit unsuccessfully, meaning that the
   76|       |        // test below fails without terminating the process.
   77|      0|#ifdef GTEST_HAS_DEATH_TEST
   78|      0|        EXPECT_EXIT(
  ------------------
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  |  Branch (78:9): [True: 0, False: 0]
  ------------------
   79|      0|            (test->RunInUnitTestMode(configuration_),
   80|      0|             void(
   81|      0|                 R"( FuzzTest failure! Please see 'actual message' below for the crash report. )"),
   82|      0|             std::exit(0)),
   83|      0|            ::testing::ExitedWithCode(0), "");
   84|       |#else
   85|       |        EXPECT_TRUE(false) << "Death test is not supported.";
   86|       |#endif
   87|      0|      } else {
   88|      0|        EXPECT_TRUE(test->RunInUnitTestMode(configuration_))
  ------------------
  |  Branch (88:9): [True: 0, False: 0]
  |  Branch (88:9): [True: 0, False: 0]
  |  Branch (88:9): [True: 0, False: 0]
  ------------------
   89|      0|            << "Failure(s) found in the unit-test mode - please see the test "
   90|      0|               "log for more details.";
   91|      0|      }
   92|      2|    } else {
   93|       |      // TODO(b/245753736): Consider using `tolerate_failure` when FuzzTest can
   94|       |      // tolerate crashes in fuzzing mode.
   95|      6|      EXPECT_TRUE(test->RunInFuzzingMode(argc_, argv_, configuration_))
  ------------------
  |  Branch (95:7): [True: 0, False: 2]
  |  Branch (95:7): [True: 0, False: 2]
  |  Branch (95:7): [True: 2, False: 0]
  ------------------
   96|      6|          << "Failure(s) found in the fuzzing mode - please see the test log "
   97|      6|             "for more details.";
   98|      2|    }
   99|      2|  }

_ZN8fuzztest8internal8BasenameENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  184|      2|absl::string_view Basename(absl::string_view filename) {
  185|      2|  auto last_slash_pos = filename.find_last_of("/\\");
  186|       |
  187|      2|  return last_slash_pos == absl::string_view::npos
  ------------------
  |  Branch (187:10): [True: 0, False: 2]
  ------------------
  188|      2|             ? filename
  189|      2|             : filename.substr(last_slash_pos + 1);
  190|      2|}

_ZN8fuzztest8internal14GetStderrFdDupEv:
   79|      2|int GetStderrFdDup() {
   80|       |  static int fd = DupLocally(STDERR_FILENO);
   81|      2|  return fd;
   82|      2|}
_ZN8fuzztest8internal9GetStderrEv:
   84|      5|FILE* GetStderr() {
   85|      5|  absl::MutexLock lock(stderr_file_guard_);
   86|      5|  if (!stderr_file_) {
  ------------------
  |  Branch (86:7): [True: 2, False: 3]
  ------------------
   87|       |    stderr_file_ = stderr;
   88|      2|  }
   89|      5|  return stderr_file_;
   90|      5|}
logging.cc:_ZN8fuzztest8internal12_GLOBAL__N_110DupLocallyEi:
   45|      4|int DupLocally(int fd) {
   46|      4|  int dup_fd = dup(fd);
   47|       |  // Error conditions below are extremely unlikely, so we don't spend too much
   48|       |  // effort in handling/logging them.
   49|      4|  if (dup_fd == -1) {
  ------------------
  |  Branch (49:7): [True: 0, False: 4]
  ------------------
   50|      0|    constexpr char msg[] = "[!] dup() failed in DupLocally(), returning -1\n";
   51|      0|    (void)write(STDERR_FILENO, msg, sizeof(msg) - 1);
   52|      0|    return -1;
   53|      0|  }
   54|      4|  int flags = fcntl(dup_fd, F_GETFD);
   55|      4|  if (flags == -1) {
  ------------------
  |  Branch (55:7): [True: 0, False: 4]
  ------------------
   56|      0|    constexpr char msg[] =
   57|      0|        "[!] fcntl(F_GETFD) failed in DupLocally(), ignoring the "
   58|      0|        "error..\n";
   59|      0|    (void)write(STDERR_FILENO, msg, sizeof(msg) - 1);
   60|      0|    return dup_fd;
   61|      0|  }
   62|      4|  flags |= FD_CLOEXEC;
   63|      4|  if (fcntl(dup_fd, F_SETFD, flags) == -1) {
  ------------------
  |  Branch (63:7): [True: 0, False: 4]
  ------------------
   64|      0|    constexpr char msg[] =
   65|      0|        "[!] fcntl(F_SETFD) failed in DupLocally(), ignoring the "
   66|      0|        "error..\n";
   67|       |    (void)write(STDERR_FILENO, msg, sizeof(msg) - 1);
   68|      0|  }
   69|      4|  return dup_fd;
   70|      4|}
logging.cc:_ZN8fuzztest8internal12_GLOBAL__N_114GetStdoutFdDupEv:
   94|      2|int GetStdoutFdDup() {
   95|       |  static int fd = DupLocally(STDOUT_FILENO);
   96|      2|  return fd;
   97|      2|}

_ZN8fuzztest8internal11CheckIsSameINS0_23ElementOfImplCorpusTypeES2_EEvv:
  839|   177k|constexpr void CheckIsSame() {
  840|   177k|  static_assert(std::is_same_v<T, U>);
  841|   177k|}
_ZN8fuzztest8internal11CheckIsSameIjjEEvv:
  839|     12|constexpr void CheckIsSame() {
  840|     12|  static_assert(std::is_same_v<T, U>);
  841|     12|}
_ZN8fuzztest8internal11CheckIsSameIiiEEvv:
  839|  11.7k|constexpr void CheckIsSame() {
  840|  11.7k|  static_assert(std::is_same_v<T, U>);
  841|  11.7k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__16vectorIhNS2_9allocatorIhEEEES6_EEvv:
  839|  59.6k|constexpr void CheckIsSame() {
  840|  59.6k|  static_assert(std::is_same_v<T, U>);
  841|  59.6k|}
_ZN8fuzztest8internal11CheckIsSameIhhEEvv:
  839|  59.6k|constexpr void CheckIsSame() {
  840|  59.6k|  static_assert(std::is_same_v<T, U>);
  841|  59.6k|}
_ZN8fuzztest8internal11CheckIsSameImmEEvv:
  839|  82.9k|constexpr void CheckIsSame() {
  840|  82.9k|  static_assert(std::is_same_v<T, U>);
  841|  82.9k|}
_ZN8fuzztest8internal11CheckIsSameI15avifPixelFormatS2_EEvv:
  839|  41.4k|constexpr void CheckIsSame() {
  840|  41.4k|  static_assert(std::is_same_v<T, U>);
  841|  41.4k|}
_ZN8fuzztest8internal11CheckIsSameIbbEEvv:
  839|  41.5k|constexpr void CheckIsSame() {
  840|  41.5k|  static_assert(std::is_same_v<T, U>);
  841|  41.5k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS0_23ElementOfImplCorpusTypeES4_S4_S4_NS2_6vectorIhNS2_9allocatorIhEEEEEEES9_EEvv:
  839|  29.8k|constexpr void CheckIsSame() {
  840|  29.8k|  static_assert(std::is_same_v<T, U>);
  841|  29.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplImEES4_NS3_I15avifPixelFormatEENS3_IbEENS0_23SequenceContainerOfImplINSt3__16vectorIhNS9_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEEEEENS9_8optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiEUlSO_E_EEDaT0_NS9_16integer_sequenceImJXspT_EEEE:
   39|  9.95k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.95k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.95k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplImEES4_NS3_I15avifPixelFormatEENS3_IbEENS0_23SequenceContainerOfImplINSt3__16vectorIhNS9_9allocatorIhEEEENS0_13ArbitraryImplIhvEEEEEEENS9_8optionalINS9_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiEUlSO_E_EEDaT0_:
   54|  9.95k|constexpr auto ApplyIndex(F f) {
   55|  9.95k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.95k|}
_ZN8fuzztest8internal11CheckIsSameIttEEvv:
  839|  23.3k|constexpr void CheckIsSame() {
  840|  23.3k|  static_assert(std::is_same_v<T, U>);
  841|  23.3k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS3_IJNS0_23ElementOfImplCorpusTypeES4_S4_S4_NS2_6vectorIhNS2_9allocatorIhEEEEEEEttS4_bEEESA_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplItEES4_NS0_13ElementOfImplI15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSC_IJDpSD_EEERKNS0_6no_adl8IRObjectEiEUlSI_E_EEDaT0_NSA_16integer_sequenceImJXspT_EEEE:
   39|  9.95k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.95k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.95k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplItEES4_NS0_13ElementOfImplI15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSC_IJDpSD_EEERKNS0_6no_adl8IRObjectEiEUlSI_E_EEDaT0_:
   54|  9.95k|constexpr auto ApplyIndex(F f) {
   55|  9.95k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.95k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__16vectorItNS2_9allocatorItEEEES6_EEvv:
  839|  23.2k|constexpr void CheckIsSame() {
  840|  23.2k|  static_assert(std::is_same_v<T, U>);
  841|  23.2k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS0_23ElementOfImplCorpusTypeES4_S4_S4_S4_NS2_6vectorItNS2_9allocatorItEEEEEEES9_EEvv:
  839|  11.6k|constexpr void CheckIsSame() {
  840|  11.6k|  static_assert(std::is_same_v<T, U>);
  841|  11.6k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5EEZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplImEES4_NS3_IiEENS3_I15avifPixelFormatEENS3_IbEENS0_23SequenceContainerOfImplINSt3__16vectorItNSA_9allocatorItEEEENS0_11InRangeImplItEEEEEEENSA_8optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSJ_IJDpSK_EEERKNS0_6no_adl8IRObjectEiEUlSP_E_EEDaT0_NSA_16integer_sequenceImJXspT_EEEE:
   39|  3.88k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.88k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.88k|}
_ZN8fuzztest8internal10ApplyIndexILm6EZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplImEES4_NS3_IiEENS3_I15avifPixelFormatEENS3_IbEENS0_23SequenceContainerOfImplINSt3__16vectorItNSA_9allocatorItEEEENS0_11InRangeImplItEEEEEEENSA_8optionalINSA_5tupleIJDpNT_11corpus_typeEEEEEERKNSJ_IJDpSK_EEERKNS0_6no_adl8IRObjectEiEUlSP_E_EEDaT0_:
   54|  3.88k|constexpr auto ApplyIndex(F f) {
   55|  3.88k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.88k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS3_IJNS0_23ElementOfImplCorpusTypeES4_S4_S4_S4_NS2_6vectorItNS2_9allocatorItEEEEEEEttS4_S4_bEEESA_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplItEES4_NS0_13ElementOfImplIiEENS5_I15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSB_5tupleIJDpNT_11corpus_typeEEEEEERKNSD_IJDpSE_EEERKNS0_6no_adl8IRObjectEiEUlSJ_E_EEDaT0_NSB_16integer_sequenceImJXspT_EEEE:
   39|  3.89k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.89k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.89k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplItEES4_NS0_13ElementOfImplIiEENS5_I15avifPixelFormatEENS0_13ArbitraryImplIbvEEEEENSt3__18optionalINSB_5tupleIJDpNT_11corpus_typeEEEEEERKNSD_IJDpSE_EEERKNS0_6no_adl8IRObjectEiEUlSJ_E_EEDaT0_:
   54|  3.89k|constexpr auto ApplyIndex(F f) {
   55|  3.89k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.89k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEESB_EEvv:
  839|  41.4k|constexpr void CheckIsSame() {
  840|  41.4k|  static_assert(std::is_same_v<T, U>);
  841|  41.4k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__17variantIJNS2_5tupleIJNS4_IJNS0_23ElementOfImplCorpusTypeES5_S5_S5_NS2_6vectorIhNS2_9allocatorIhEEEEEEEttS5_bEEENS4_IJNS4_IJS5_S5_S5_S5_S5_NS6_ItNS7_ItEEEEEEEttS5_S5_bEEEEEESG_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmm15avifPixelFormatbRKNS4_IhNSA_IhEEEEEJNS0_13ElementOfImplImEESL_NSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SF_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  9.93k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.93k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.93k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmm15avifPixelFormatbRKNS4_IhNSA_IhEEEEEJNS0_13ElementOfImplImEESL_NSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_13ArbitraryImplIhvEEEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SF_EEEEUlDpT_E_EEDaT0_:
   54|  9.93k|constexpr auto ApplyIndex(F f) {
   55|  9.93k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.93k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmm15avifPixelFormatbRKNS4_IhNSA_IhEEEEEJNS0_13ElementOfImplImEESL_NSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_13ArbitraryImplIhvEEEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SF_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  9.91k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.91k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.91k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmm15avifPixelFormatbRKNS4_IhNSA_IhEEEEEJNS0_13ElementOfImplImEESL_NSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_13ArbitraryImplIhvEEEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESU_SU_SU_SF_EEEEUlDpT_E_EEDaT0_:
   54|  9.91k|constexpr auto ApplyIndex(F f) {
   55|  9.91k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.91k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_NSF_6vectorIhNSF_9allocatorIhEEEEEEEttSH_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_NSF_16integer_sequenceImJXspT_EEEE:
   39|  9.93k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.93k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.93k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_NSF_6vectorIhNSF_9allocatorIhEEEEEEEttSH_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_:
   54|  9.93k|constexpr auto ApplyIndex(F f) {
   55|  9.93k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.93k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_NSF_6vectorIhNSF_9allocatorIhEEEEEEEttSH_bEEEEENS0_7MapImplIPFNSI_INSF_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSJ_ISS_EEEEmmS5_bRKSL_EJNS9_ImEESZ_SA_NS9_IbEENS0_23SequenceContainerOfImplISL_NSB_IhvEEEEEEERKT_EUlDpT_E_EEDaT0_NSF_16integer_sequenceImJXspT_EEEE:
   39|  19.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  19.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  19.8k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSG_IJNS0_23ElementOfImplCorpusTypeESH_SH_SH_NSF_6vectorIhNSF_9allocatorIhEEEEEEEttSH_bEEEEENS0_7MapImplIPFNSI_INSF_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSJ_ISS_EEEEmmS5_bRKSL_EJNS9_ImEESZ_SA_NS9_IbEENS0_23SequenceContainerOfImplISL_NSB_IhvEEEEEEERKT_EUlDpT_E_EEDaT0_:
   54|  19.8k|constexpr auto ApplyIndex(F f) {
   55|  19.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  19.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEENS0_7MapImplIPFNSF_6vectorINSF_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSF_9allocatorISO_EEEEmmS5_bRKNSK_IhNSP_IhEEEEEJNS9_ImEESY_SA_NS9_IbEENS0_23SequenceContainerOfImplIST_NSB_IhvEEEEEEERKT_EUlDpT_E_EEDaT0_NSF_16integer_sequenceImJXspT_EEEE:
   39|  9.95k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.95k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.95k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEENS0_7MapImplIPFNSF_6vectorINSF_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSF_9allocatorISO_EEEEmmS5_bRKNSK_IhNSP_IhEEEEEJNS9_ImEESY_SA_NS9_IbEENS0_23SequenceContainerOfImplIST_NSB_IhvEEEEEEERKT_EUlDpT_E_EEDaT0_:
   54|  9.95k|constexpr auto ApplyIndex(F f) {
   55|  9.95k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.95k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_NSF_16integer_sequenceImJXspT_EEEE:
   39|  9.95k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  9.95k|  return f(std::integral_constant<size_t, I>{}...);
   41|  9.95k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeEbEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_:
   54|  9.95k|constexpr auto ApplyIndex(F f) {
   55|  9.95k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  9.95k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5EEZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmmi15avifPixelFormatbRKNS4_ItNSA_ItEEEEEJNS0_13ElementOfImplImEESL_NSK_IiEENSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESV_SV_SV_SV_SF_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  3.88k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.88k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.88k|}
_ZN8fuzztest8internal10ApplyIndexILm6EZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmmi15avifPixelFormatbRKNS4_ItNSA_ItEEEEEJNS0_13ElementOfImplImEESL_NSK_IiEENSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_11InRangeImplItEEEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESV_SV_SV_SV_SF_EEEEUlDpT_E_EEDaT0_:
   54|  3.88k|constexpr auto ApplyIndex(F f) {
   55|  3.88k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.88k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5EEZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmmi15avifPixelFormatbRKNS4_ItNSA_ItEEEEEJNS0_13ElementOfImplImEESL_NSK_IiEENSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_11InRangeImplItEEEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESV_SV_SV_SV_SF_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  3.87k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.87k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.87k|}
_ZN8fuzztest8internal10ApplyIndexILm6EZNKS0_7MapImplIPFNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEEmmi15avifPixelFormatbRKNS4_ItNSA_ItEEEEEJNS0_13ElementOfImplImEESL_NSK_IiEENSK_ISD_EENSK_IbEENS0_23SequenceContainerOfImplISF_NS0_11InRangeImplItEEEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeESV_SV_SV_SV_SF_EEEEUlDpT_E_EEDaT0_:
   54|  3.87k|constexpr auto ApplyIndex(F f) {
   55|  3.87k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.87k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSH_IJNS0_23ElementOfImplCorpusTypeESI_SI_SI_SI_NSG_6vectorItNSG_9allocatorItEEEEEEEttSI_SI_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_NSG_16integer_sequenceImJXspT_EEEE:
   39|  3.88k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.88k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.88k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJNSH_IJNS0_23ElementOfImplCorpusTypeESI_SI_SI_SI_NSG_6vectorItNSG_9allocatorItEEEEEEEttSI_SI_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_:
   54|  3.88k|constexpr auto ApplyIndex(F f) {
   55|  3.88k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.88k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSH_IJNS0_23ElementOfImplCorpusTypeESI_SI_SI_SI_NSG_6vectorItNSG_9allocatorItEEEEEEEttSI_SI_bEEEEENS0_7MapImplIPFNSJ_INSG_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSK_IST_EEEEmmiS5_bRKSM_EJNS9_ImEES10_SA_SB_NS9_IbEENS0_23SequenceContainerOfImplISM_S8_EEEEERKT_EUlDpT_E_EEDaT0_NSG_16integer_sequenceImJXspT_EEEE:
   39|  7.75k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  7.75k|  return f(std::integral_constant<size_t, I>{}...);
   41|  7.75k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJNSH_IJNS0_23ElementOfImplCorpusTypeESI_SI_SI_SI_NSG_6vectorItNSG_9allocatorItEEEEEEEttSI_SI_bEEEEENS0_7MapImplIPFNSJ_INSG_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSK_IST_EEEEmmiS5_bRKSM_EJNS9_ImEES10_SA_SB_NS9_IbEENS0_23SequenceContainerOfImplISM_S8_EEEEERKT_EUlDpT_E_EEDaT0_:
   54|  7.75k|constexpr auto ApplyIndex(F f) {
   55|  7.75k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  7.75k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESI_bEEEEENS0_7MapImplIPFNSG_6vectorINSG_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSG_9allocatorISP_EEEEmmiS5_bRKNSL_ItNSQ_ItEEEEEJNS9_ImEESZ_SA_SB_NS9_IbEENS0_23SequenceContainerOfImplISU_S8_EEEEERKT_EUlDpT_E_EEDaT0_NSG_16integer_sequenceImJXspT_EEEE:
   39|  3.88k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.88k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.88k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE15GetOutputDomainINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESI_bEEEEENS0_7MapImplIPFNSG_6vectorINSG_10unique_ptrI9avifImageNS3_16UniquePtrDeleterEEENSG_9allocatorISP_EEEEmmiS5_bRKNSL_ItNSQ_ItEEEEEJNS9_ImEESZ_SA_SB_NS9_IbEENS0_23SequenceContainerOfImplISU_S8_EEEEERKT_EUlDpT_E_EEDaT0_:
   54|  3.88k|constexpr auto ApplyIndex(F f) {
   55|  3.88k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.88k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4EEZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESI_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_NSG_16integer_sequenceImJXspT_EEEE:
   39|  3.89k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  3.89k|  return f(std::integral_constant<size_t, I>{}...);
   41|  3.89k|}
_ZN8fuzztest8internal10ApplyIndexILm5EZNKS0_11FlatMapImplIZN4avif8testutil23ArbitraryAvifLayered16bEvEUlmmi15avifPixelFormatbE_JNS0_11InRangeImplItEES8_NS0_13ElementOfImplIiEENS9_IS5_EENS0_13ArbitraryImplIbvEEEE19ValidateInputValuesINSt3__15tupleIJttNS0_23ElementOfImplCorpusTypeESI_bEEEEEN4absl12lts_202605266StatusERKT_EUlDpT_E_EEDaT0_:
   54|  3.89k|constexpr auto ApplyIndex(F f) {
   55|  3.89k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  3.89k|}
_ZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_:
   65|  13.8k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.8k|    static constexpr Call kFuncs[] = {
   67|  13.8k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.8k|    return kFuncs;
   69|  13.8k|  })[i](f);
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNS0_6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSK_5tupleIJNSM_IJNS0_23ElementOfImplCorpusTypeESN_SN_SN_NSK_6vectorIhNSK_9allocatorIhEEEEEEEttSN_bEEENSM_IJNSM_IJSN_SN_SN_SN_SN_NSO_ItNSP_ItEEEEEEEttSN_SN_bEEEEEEEUlT_E_EEDcmT0_EUlDpT_E_EEDaS13_NSK_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNS0_6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSK_5tupleIJNSM_IJNS0_23ElementOfImplCorpusTypeESN_SN_SN_NSK_6vectorIhNSK_9allocatorIhEEEEEEEttSN_bEEENSM_IJNSM_IJSN_SN_SN_SN_SN_NSO_ItNSP_ItEEEEEEEttSN_SN_bEEEEEEEUlT_E_EEDcmT0_EUlDpT_E_EEDaS13_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_:
   63|  13.8k|decltype(auto) Switch(size_t i, F f) {
   64|  13.8k|  using Call = decltype(f(std::integral_constant<size_t, 0>())) (*)(F&);
   65|  13.8k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.8k|    static constexpr Call kFuncs[] = {
   67|  13.8k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.8k|    return kFuncs;
   69|  13.8k|  })[i](f);
   70|  13.8k|}
_ZZN8fuzztest8internal6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEENSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEEENSI_8optionalIT0_EERKNSK_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSY_ENKUlS11_E_clIJNSI_17integral_constantImLm0EEENS1D_ImLm1EEEEEEDaS11_:
   65|  13.8k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.8k|    static constexpr Call kFuncs[] = {
   67|  13.8k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.8k|    return kFuncs;
   69|  13.8k|  })[i](f);
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNS0_6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEENSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEENSJ_8optionalIT0_EERKNSL_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSZ_EUlS12_E_EEDaSZ_NSJ_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNS0_6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEENSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEENSJ_8optionalIT0_EERKNSL_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSZ_EUlS12_E_EEDaSZ_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEENSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEEENSI_8optionalIT0_EERKNSK_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSY_:
   63|  13.8k|decltype(auto) Switch(size_t i, F f) {
   64|  13.8k|  using Call = decltype(f(std::integral_constant<size_t, 0>())) (*)(F&);
   65|  13.8k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.8k|    static constexpr Call kFuncs[] = {
   67|  13.8k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.8k|    return kFuncs;
   69|  13.8k|  })[i](f);
   70|  13.8k|}
_ZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE8GetValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_:
   65|  13.7k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.7k|    static constexpr Call kFuncs[] = {
   67|  13.7k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.7k|    return kFuncs;
   69|  13.7k|  })[i](f);
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNS0_6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEE8GetValueERKNSt3__17variantIJNSK_5tupleIJNSM_IJNS0_23ElementOfImplCorpusTypeESN_SN_SN_NSK_6vectorIhNSK_9allocatorIhEEEEEEEttSN_bEEENSM_IJNSM_IJSN_SN_SN_SN_SN_NSO_ItNSP_ItEEEEEEEttSN_SN_bEEEEEEEUlT_E_EEDcmT0_EUlDpT_E_EEDaS13_NSK_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNS0_6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEE8GetValueERKNSt3__17variantIJNSK_5tupleIJNSM_IJNS0_23ElementOfImplCorpusTypeESN_SN_SN_NSK_6vectorIhNSK_9allocatorIhEEEEEEEttSN_bEEENSM_IJNSM_IJSN_SN_SN_SN_SN_NSO_ItNSP_ItEEEEEEEttSN_SN_bEEEEEEEUlT_E_EEDcmT0_EUlDpT_E_EEDaS13_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE8GetValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_:
   63|  13.7k|decltype(auto) Switch(size_t i, F f) {
   64|  13.7k|  using Call = decltype(f(std::integral_constant<size_t, 0>())) (*)(F&);
   65|  13.7k|  return ApplyIndex<Max>([](auto... I) {
   66|  13.7k|    static constexpr Call kFuncs[] = {
   67|  13.7k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
   68|  13.7k|    return kFuncs;
   69|  13.7k|  })[i](f);
   70|  13.7k|}
_ZN8fuzztest8internal11CheckIsSameI15avifCodecChoiceS2_EEvv:
  839|      8|constexpr void CheckIsSame() {
  840|      8|  static_assert(std::is_same_v<T, U>);
  841|      8|}
_ZN8fuzztest8internal11CheckIsSameINSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEES7_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEES5_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEESF_SF_SF_SF_SF_EE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm7EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEESF_SF_SF_SF_SF_EE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEEUlDpT_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6EEZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEES7_S7_S7_S7_S7_EEENSt3__18optionalINS8_5tupleIJDpNT_11corpus_typeEEEEEERKNSA_IJDpSB_EEERKNS0_6no_adl8IRObjectEiEUlSG_E_EEDaT0_NS8_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm7EZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEES7_S7_S7_S7_S7_EEENSt3__18optionalINS8_5tupleIJDpNT_11corpus_typeEEEEEERKNSA_IJDpSB_EEERKNS0_6no_adl8IRObjectEiEUlSG_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEESF_SF_SF_SF_SF_EE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZN8fuzztest8internal10ApplyIndexILm7EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifEncoderN4avif16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEESF_SF_SF_SF_SF_EE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiiiiiiEEEEUlDpT_E_EEDaT0_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal11CheckIsSameI17avifDecoderSourceS2_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal11CheckIsSameINSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES7_EEvv:
  839|      8|constexpr void CheckIsSame() {
  840|      8|  static_assert(std::is_same_v<T, U>);
  841|      8|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS0_23ElementOfImplCorpusTypeEiS4_bbbbS4_S4_S4_jEEES5_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6ELm7ELm8ELm9ELm10EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiSQ_bbbbSQ_SQ_SQ_jEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm11EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEE19ValidateCorpusValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiSQ_bbbbSQ_SQ_SQ_jEEEEUlDpT_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6ELm7ELm8ELm9ELm10EEZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEENS3_I17avifDecoderSourceEENS0_13ArbitraryImplIbvEESB_SB_SB_NS3_ImEESC_NS3_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSt3__18optionalINSG_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiEUlSO_E_EEDaT0_NSG_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm11EZNS0_20ParseWithDomainTupleIJNS0_13ElementOfImplI15avifCodecChoiceEENS0_11InRangeImplIiEENS3_I17avifDecoderSourceEENS0_13ArbitraryImplIbvEESB_SB_SB_NS3_ImEESC_NS3_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSt3__18optionalINSG_5tupleIJDpNT_11corpus_typeEEEEEERKNSI_IJDpSJ_EEERKNS0_6no_adl8IRObjectEiEUlSO_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3ELm4ELm5ELm6ELm7ELm8ELm9ELm10EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiSQ_bbbbSQ_SQ_SQ_jEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZN8fuzztest8internal10ApplyIndexILm11EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplIS9_EENS0_11InRangeImplIiEENSD_ISA_EENS0_13ArbitraryImplIbvEESJ_SJ_SJ_NSD_ImEESK_NSD_IiEENS0_24BitFlagCombinationOfImplIjEEEE8GetValueERKNS3_5tupleIJNS0_23ElementOfImplCorpusTypeEiSQ_bbbbSQ_SQ_SQ_jEEEEUlDpT_E_EEDaT0_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS3_IJNS0_23ElementOfImplCorpusTypeEiS4_bbbbS4_S4_S4_jEEES4_EEES6_EEvv:
  839|      4|constexpr void CheckIsSame() {
  840|      4|  static_assert(std::is_same_v<T, U>);
  841|      4|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES8_jEJNS2_IPFS8_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISB_EENS0_11InRangeImplIiEENSF_ISC_EENS0_13ArbitraryImplIbvEESL_SL_SL_NSF_ImEESM_NSF_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSF_IjEEEE19ValidateCorpusValueERKNS3_5tupleIJNST_IJNS0_23ElementOfImplCorpusTypeEiSU_bbbbSU_SU_SU_jEEESU_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES8_jEJNS2_IPFS8_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISB_EENS0_11InRangeImplIiEENSF_ISC_EENS0_13ArbitraryImplIbvEESL_SL_SL_NSF_ImEESM_NSF_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSF_IjEEEE19ValidateCorpusValueERKNS3_5tupleIJNST_IJNS0_23ElementOfImplCorpusTypeEiSU_bbbbSU_SU_SU_jEEESU_EEEEUlDpT_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNS0_20ParseWithDomainTupleIJNS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEEENS4_8optionalINS4_5tupleIJDpNT_11corpus_typeEEEEEERKNSS_IJDpST_EEERKNS0_6no_adl8IRObjectEiEUlSY_E_EEDaT0_NS4_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNS0_20ParseWithDomainTupleIJNS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEE15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISA_EENS0_11InRangeImplIiEENSE_ISB_EENS0_13ArbitraryImplIbvEESK_SK_SK_NSE_ImEESL_NSE_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSE_IjEEEEENS4_8optionalINS4_5tupleIJDpNT_11corpus_typeEEEEEERKNSS_IJDpST_EEERKNS0_6no_adl8IRObjectEiEUlSY_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES8_jEJNS2_IPFS8_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISB_EENS0_11InRangeImplIiEENSF_ISC_EENS0_13ArbitraryImplIbvEESL_SL_SL_NSF_ImEESM_NSF_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSF_IjEEEE8GetValueERKNS3_5tupleIJNST_IJNS0_23ElementOfImplCorpusTypeEiSU_bbbbSU_SU_SU_jEEESU_EEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZN8fuzztest8internal10ApplyIndexILm2EZNKS0_7MapImplIPFNSt3__110unique_ptrI11avifDecoderN4avif16UniquePtrDeleterEEES8_jEJNS2_IPFS8_15avifCodecChoicei17avifDecoderSourcebbbbjjjjEJNS0_13ElementOfImplISB_EENS0_11InRangeImplIiEENSF_ISC_EENS0_13ArbitraryImplIbvEESL_SL_SL_NSF_ImEESM_NSF_IiEENS0_24BitFlagCombinationOfImplIjEEEEENSF_IjEEEE8GetValueERKNS3_5tupleIJNST_IJNS0_23ElementOfImplCorpusTypeEiSU_bbbbSU_SU_SU_jEEESU_EEEEUlDpT_E_EEDaT0_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEE19ValidateCorpusValueERKNS4_IJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES1R_S1R_S1R_NS5_IhNSB_IhEEEEEEEttS1R_bEEENS4_IJNS4_IJS1R_S1R_S1R_S1R_S1R_NS5_ItNSB_ItEEEEEEEttS1R_S1R_bEEEEEENS4_IJiiEEENS4_IJS1R_iiiiiiEEENS4_IJNS4_IJS1R_iS1R_bbbbS1R_S1R_S1R_jEEES1R_EEEEEEEUlDpT_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEE19ValidateCorpusValueERKNS4_IJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES1R_S1R_S1R_NS5_IhNSB_IhEEEEEEEttS1R_bEEENS4_IJNS4_IJS1R_S1R_S1R_S1R_S1R_NS5_ItNSB_ItEEEEEEEttS1R_S1R_bEEEEEENS4_IJiiEEENS4_IJS1R_iiiiiiEEENS4_IJNS4_IJS1R_iS1R_bbbbS1R_S1R_S1R_jEEES1R_EEEEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_ENKUlRS11_E_clES1A_:
   67|  9.93k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE19ValidateCorpusValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_ENKUlRS11_E0_clES1A_:
   67|  3.88k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZN8fuzztest8internal10ApplyIndexILm2EZNKS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEESA_EE19ValidateCorpusValueERKNS3_5tupleIJiiEEEEUlDpT_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNKS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEESA_EE19ValidateCorpusValueERKNS3_5tupleIJiiEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNS0_20ParseWithDomainTupleIJNS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEENS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS9_IiEESR_EEENSK_IPFNSL_10unique_ptrI11avifEncoderNS5_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSB_ISX_EESR_SR_SR_SR_SR_SR_EEENSK_IPFNST_I11avifDecoderSV_EES13_jEJNSK_IPFS13_SX_i17avifDecoderSourcebbbbjjjjEJS10_SR_NSB_IS16_EESE_SE_SE_SE_NSB_ImEES1A_SH_NS0_24BitFlagCombinationOfImplIjEEEEENSB_IjEEEEEEEENSL_8optionalINSL_5tupleIJDpNT_11corpus_typeEEEEEERKNS1H_IJDpS1I_EEERKNS0_6no_adl8IRObjectEiEUlS1N_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNS0_20ParseWithDomainTupleIJNS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESA_NS0_13ElementOfImplIS7_EENS0_13ArbitraryImplIbvEEEEENS4_IZNS6_23ArbitraryAvifLayered16bEvEUlmmiS7_bE_JSA_SA_NSB_IiEESC_SE_EEEEEENS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS9_IiEESR_EEENSK_IPFNSL_10unique_ptrI11avifEncoderNS5_16UniquePtrDeleterEEE15avifCodecChoiceiiiiiiEJNSB_ISX_EESR_SR_SR_SR_SR_SR_EEENSK_IPFNST_I11avifDecoderSV_EES13_jEJNSK_IPFS13_SX_i17avifDecoderSourcebbbbjjjjEJS10_SR_NSB_IS16_EESE_SE_SE_SE_NSB_ImEES1A_SH_NS0_24BitFlagCombinationOfImplIjEEEEENSB_IjEEEEEEEENSL_8optionalINSL_5tupleIJDpNT_11corpus_typeEEEEEERKNS1H_IJDpS1I_EEERKNS0_6no_adl8IRObjectEiEUlS1N_E_EEDaT0_NSL_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZZZN8fuzztest8internal6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEENSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEEENSI_8optionalIT0_EERKNSK_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSY_ENKUlS11_E_clIJNSI_17integral_constantImLm0EEENS1D_ImLm1EEEEEEDaS11_ENKUlRS1A_E_clES1G_:
   67|  9.96k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZZZN8fuzztest8internal6SwitchILm2EZNS0_22ParseWithDomainVariantIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEENSt3__17variantIJNSI_5tupleIJNSK_IJNS0_23ElementOfImplCorpusTypeESL_SL_SL_NSI_6vectorIhNSI_9allocatorIhEEEEEEEttSL_bEEENSK_IJNSK_IJSL_SL_SL_SL_SL_NSM_ItNSN_ItEEEEEEEttSL_SL_bEEEEEEEENSI_8optionalIT0_EERKNSK_IJDpT_EEERKNS0_6no_adl8IRObjectEEUlT_E_EEDcmSY_ENKUlS11_E_clIJNSI_17integral_constantImLm0EEENS1D_ImLm1EEEEEEDaS11_ENKUlRS1A_E0_clES1G_:
   67|  3.89k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZN8fuzztest8internal10ApplyIndexILm2EZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplIiEES4_EEENSt3__18optionalINS5_5tupleIJDpNT_11corpus_typeEEEEEERKNS7_IJDpS8_EEERKNS0_6no_adl8IRObjectEiEUlSD_E_EEDaT0_:
   54|  13.8k|constexpr auto ApplyIndex(F f) {
   55|  13.8k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.8k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNS0_20ParseWithDomainTupleIJNS0_11InRangeImplIiEES4_EEENSt3__18optionalINS5_5tupleIJDpNT_11corpus_typeEEEEEERKNS7_IJDpS8_EEERKNS0_6no_adl8IRObjectEiEUlSD_E_EEDaT0_NS5_16integer_sequenceImJXspT_EEEE:
   39|  13.8k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.8k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.8k|}
_ZN8fuzztest8internal10ApplyIndexILm4EZNKS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEE8GetValueERKNS4_IJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES1R_S1R_S1R_NS5_IhNSB_IhEEEEEEEttS1R_bEEENS4_IJNS4_IJS1R_S1R_S1R_S1R_S1R_NS5_ItNSB_ItEEEEEEEttS1R_S1R_bEEEEEENS4_IJiiEEENS4_IJS1R_iiiiiiEEENS4_IJNS4_IJS1R_iS1R_bbbbS1R_S1R_S1R_jEEES1R_EEEEEEEUlDpT_E_EEDaT0_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1ELm2ELm3EEZNKS0_15AggregateOfImplINSt3__15tupleIJNS3_6vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorISA_EEEENS3_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEELNS0_23RequireCustomCorpusTypeE0EJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS8_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEEST_NS0_13ElementOfImplISQ_EENS0_13ArbitraryImplIbvEEEEENSO_IZNSP_23ArbitraryAvifLayered16bEvEUlmmiSQ_bE_JST_ST_NSU_IiEESV_SX_EEEEEENS0_7MapImplIPFSG_iiEJNSS_IiEES16_EEENS13_IPFSI_15avifCodecChoiceiiiiiiEJNSU_IS18_EES16_S16_S16_S16_S16_S16_EEENS13_IPFSK_SK_jEJNS13_IPFSK_S18_i17avifDecoderSourcebbbbjjjjEJS1B_S16_NSU_IS1F_EESX_SX_SX_SX_NSU_ImEES1J_S10_NS0_24BitFlagCombinationOfImplIjEEEEENSU_IjEEEEEEE8GetValueERKNS4_IJNS3_7variantIJNS4_IJNS4_IJNS0_23ElementOfImplCorpusTypeES1R_S1R_S1R_NS5_IhNSB_IhEEEEEEEttS1R_bEEENS4_IJNS4_IJS1R_S1R_S1R_S1R_S1R_NS5_ItNSB_ItEEEEEEEttS1R_S1R_bEEEEEENS4_IJiiEEENS4_IJS1R_iiiiiiEEENS4_IJNS4_IJS1R_iS1R_bbbbS1R_S1R_S1R_jEEES1R_EEEEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE8GetValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_ENKUlRS11_E_clES1A_:
   67|  9.91k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZZZN8fuzztest8internal6SwitchILm2EZNKS0_9OneOfImplIJNS0_11FlatMapImplIZN4avif8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEES9_NS0_13ElementOfImplIS6_EENS0_13ArbitraryImplIbvEEEEENS3_IZNS5_23ArbitraryAvifLayered16bEvEUlmmiS6_bE_JS9_S9_NSA_IiEESB_SD_EEEEE8GetValueERKNSt3__17variantIJNSJ_5tupleIJNSL_IJNS0_23ElementOfImplCorpusTypeESM_SM_SM_NSJ_6vectorIhNSJ_9allocatorIhEEEEEEEttSM_bEEENSL_IJNSL_IJSM_SM_SM_SM_SM_NSN_ItNSO_ItEEEEEEEttSM_SM_bEEEEEEEUlT_E_EEDcmT0_ENKUlDpT_E_clIJNSJ_17integral_constantImLm0EEENS17_ImLm1EEEEEEDaS14_ENKUlRS11_E0_clES1A_:
   67|  3.87k|        [](F& f) { return std::move(f)(decltype(I){}); }...};
_ZN8fuzztest8internal10ApplyIndexILm2EZNKS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEESA_EE8GetValueERKNS3_5tupleIJiiEEEEUlDpT_E_EEDaT0_:
   54|  13.7k|constexpr auto ApplyIndex(F f) {
   55|  13.7k|  return ApplyIndexImpl(f, std::make_index_sequence<N>{});
   56|  13.7k|}
_ZN8fuzztest8internal14ApplyIndexImplIJLm0ELm1EEZNKS0_7MapImplIPFNSt3__15arrayI15avifScalingModeLm4EEEiiEJNS0_11InRangeImplIiEESA_EE8GetValueERKNS3_5tupleIJiiEEEEUlDpT_E_EEDaT0_NS3_16integer_sequenceImJXspT_EEEE:
   39|  13.7k|constexpr auto ApplyIndexImpl(F f, std::index_sequence<I...>) {
   40|  13.7k|  return f(std::integral_constant<size_t, I>{}...);
   41|  13.7k|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS2_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEESK_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES5_S5_S5_NS2_6vectorIhNS2_9allocatorIhEEEEEEEttS5_bEEENS3_IJNS3_IJS5_S5_S5_S5_S5_NS6_ItNS7_ItEEEEEEEttS5_S5_bEEEEEENS3_IJiiEEENS3_IJS5_iiiiiiEEENS3_IJNS3_IJS5_iS5_bbbbS5_S5_S5_jEEES5_EEEEEESL_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15arrayI15avifScalingModeLm4EEES5_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJiiEEES4_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS2_6vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEEEESH_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}
_ZN8fuzztest8internal11CheckIsSameINSt3__15tupleIJNS2_7variantIJNS3_IJNS3_IJNS0_23ElementOfImplCorpusTypeES5_S5_S5_NS2_6vectorIhNS2_9allocatorIhEEEEEEEttS5_bEEENS3_IJNS3_IJS5_S5_S5_S5_S5_NS6_ItNS7_ItEEEEEEEttS5_S5_bEEEEEENS3_IJS5_iiiiiiEEENS3_IJNS3_IJS5_iS5_bbbbS5_S5_S5_jEEES5_EEEEEESK_EEvv:
  839|      2|constexpr void CheckIsSame() {
  840|      2|  static_assert(std::is_same_v<T, U>);
  841|      2|}

_ZN8fuzztest18domain_implementor10PrintValueINS_8internal11InRangeImplIiEEEEvRKT_RKNS5_11corpus_typeEN4absl12lts_2026052613FormatRawSinkENS0_9PrintModeE:
   47|     21|                RawSink out, PrintMode mode) {
   48|     21|  auto printer = domain.GetPrinter();
   49|       |  if constexpr (internal::Requires<decltype(printer)>(
   50|       |                    [&](auto t) -> decltype(t.PrintCorpusValue(
   51|       |                                    corpus_value, out, mode)) {})) {
   52|       |    printer.PrintCorpusValue(corpus_value, out, mode);
   53|     21|  } else {
   54|     21|    printer.PrintUserValue(domain.GetValue(corpus_value), out, mode);
   55|     21|  }
   56|     21|}
_ZN8fuzztest18domain_implementor10PrintValueINS_8internal11InRangeImplItEEEEvRKT_RKNS5_11corpus_typeEN4absl12lts_2026052613FormatRawSinkENS0_9PrintModeE:
   47|     15|                RawSink out, PrintMode mode) {
   48|     15|  auto printer = domain.GetPrinter();
   49|       |  if constexpr (internal::Requires<decltype(printer)>(
   50|       |                    [&](auto t) -> decltype(t.PrintCorpusValue(
   51|       |                                    corpus_value, out, mode)) {})) {
   52|       |    printer.PrintCorpusValue(corpus_value, out, mode);
   53|     15|  } else {
   54|     15|    printer.PrintUserValue(domain.GetValue(corpus_value), out, mode);
   55|     15|  }
   56|     15|}

_ZN8fuzztest15GetRegistrationIPFvNSt3__16vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS7_EEEERKNS1_5arrayI15avifScalingModeLm4EEENS3_I11avifEncoderS6_EENS3_I11avifDecoderS6_EEEEEDaNS1_12basic_stringIcNS1_11char_traitsIcEENS8_IcEEEESQ_SQ_iT_:
  338|      2|                     TargetFunction target_function) {
  339|      2|  return ::fuzztest::internal::Registration<::fuzztest::internal::NoFixture,
  340|      2|                                            TargetFunction>(
  341|      2|      ::fuzztest::internal::BasicTestInfo{std::move(suite_name),
  342|      2|                                          std::move(test_name), std::move(file),
  343|      2|                                          line, false},
  344|      2|      target_function);
  345|      2|}
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SF_SJ_SL_EEEPvEC2ENS0_13BasicTestInfoESN_:
  134|      2|      : test_info_(std::move(info)), target_function_(target_function) {}
_ZNO8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SF_SJ_SL_EEEPvE11WithDomainsIJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESZ_NS0_13ElementOfImplISW_EENS0_13ArbitraryImplIbvEEEEENSU_IZNSV_23ArbitraryAvifLayered16bEvEUlmmiSW_bE_JSZ_SZ_NS10_IiEES11_S13_EEEEEENS0_7MapImplIPFSF_iiEJNSY_IiEES1C_EEENS19_IPFSJ_15avifCodecChoiceiiiiiiEJNS10_IS1E_EES1C_S1C_S1C_S1C_S1C_S1C_EEENS19_IPFSL_SL_jEJNS19_IPFSL_S1E_i17avifDecoderSourcebbbbjjjjEJS1H_S1C_NS10_IS1L_EES13_S13_S13_S13_NS10_ImEES1P_S16_NS0_24BitFlagCombinationOfImplIjEEEEENS10_IjEEEEEEEEDaDpOT_:
  172|      2|  auto WithDomains(NewDomains&&... domains) && {
  173|      2|    return std::move(*this).WithDomains(
  174|      2|        TupleOf(std::forward<NewDomains>(domains)...));
  175|      2|  }
_ZNO8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SF_SJ_SL_EEEPvE11WithDomainsIJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil22ArbitraryAvifLayered8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESZ_NS0_13ElementOfImplISW_EENS0_13ArbitraryImplIbvEEEEENSU_IZNSV_23ArbitraryAvifLayered16bEvEUlmmiSW_bE_JSZ_SZ_NS10_IiEES11_S13_EEEEEENS0_7MapImplIPFSF_iiEJNSY_IiEES1C_EEENS19_IPFSJ_15avifCodecChoiceiiiiiiEJNS10_IS1E_EES1C_S1C_S1C_S1C_S1C_S1C_EEENS19_IPFSL_SL_jEJNS19_IPFSL_S1E_i17avifDecoderSourcebbbbjjjjEJS1H_S1C_NS10_IS1L_EES13_S13_S13_S13_NS10_ImEES1P_S16_NS0_24BitFlagCombinationOfImplIjEEEEENS10_IjEEEEEEEEDaNS0_15AggregateOfImplINS3_5tupleIJDpNT_10value_typeEEEELNS0_23RequireCustomCorpusTypeE0EJDpS1X_EEE:
  149|      2|                       domain) && {
  150|      2|    static_assert(!Registration::kHasDomain,
  151|      2|                  "WithDomains can only be called once.");
  152|      2|    static_assert(!Registration::kHasSeeds,
  153|      2|                  "WithDomains can not be called after WithSeeds.");
  154|      2|    static_assert(!Registration::kHasSeedProvider,
  155|      2|                  "WithDomains can not be called after WithSeedProvider.");
  156|      2|    static_assert(
  157|      2|        Base::kNumArgs == sizeof...(NewDomains),
  158|      2|        "Number of domains specified in .WithDomains() does not match "
  159|      2|        "the number of function parameters.");
  160|      2|    using NewBase = RegistrationWithDomainsBase<value_type_t<NewDomains>...>;
  161|      2|    return Registration<Fixture, TargetFunction, NewBase, SeedProvider>(
  162|      2|        std::move(test_info_), target_function_, NewBase{std::move(domain)});
  163|      2|  }
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SF_SJ_SL_EEEPvEC2ENS0_13BasicTestInfoESN_SP_:
  293|      2|      : Base(std::move(base)),
  294|      2|        test_info_(std::move(info)),
  295|      2|        target_function_(target_function) {}
_ZN8fuzztest15GetRegistrationIPFvNSt3__16vectorINS1_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS1_9allocatorIS7_EEEENS3_I11avifEncoderS6_EENS3_I11avifDecoderS6_EEEEEDaNS1_12basic_stringIcNS1_11char_traitsIcEENS8_IcEEEESL_SL_iT_:
  338|      2|                     TargetFunction target_function) {
  339|      2|  return ::fuzztest::internal::Registration<::fuzztest::internal::NoFixture,
  340|      2|                                            TargetFunction>(
  341|      2|      ::fuzztest::internal::BasicTestInfo{std::move(suite_name),
  342|      2|                                          std::move(test_name), std::move(file),
  343|      2|                                          line, false},
  344|      2|      target_function);
  345|      2|}
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SE_SG_EEEPvEC2ENS0_13BasicTestInfoESI_:
  134|      2|      : test_info_(std::move(info)), target_function_(target_function) {}
_ZNO8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SE_SG_EEEPvE11WithDomainsIJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESU_NS0_13ElementOfImplISR_EENS0_13ArbitraryImplIbvEEEEENSP_IZNSQ_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSR_bE_JSU_SU_NSV_IiEESW_SY_EEEEEENS0_7MapImplIPFSE_15avifCodecChoiceiiiiiiEJNSV_IS15_EENST_IiEES19_S19_S19_S19_S19_EEENS14_IPFSG_SG_jEJNS14_IPFSG_S15_i17avifDecoderSourcebbbbjjjjEJS18_S19_NSV_IS1D_EESY_SY_SY_SY_NSV_ImEES1H_S11_NS0_24BitFlagCombinationOfImplIjEEEEENSV_IjEEEEEEEEDaDpOT_:
  172|      2|  auto WithDomains(NewDomains&&... domains) && {
  173|      2|    return std::move(*this).WithDomains(
  174|      2|        TupleOf(std::forward<NewDomains>(domains)...));
  175|      2|  }
_ZNO8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_23DefaultRegistrationBaseIJSC_SE_SG_EEEPvE11WithDomainsIJNS0_9OneOfImplIJNS0_11FlatMapImplIZNS7_8testutil29ArbitraryAvifLayeredRandDim8bEvEUlmm15avifPixelFormatbE_JNS0_11InRangeImplItEESU_NS0_13ElementOfImplISR_EENS0_13ArbitraryImplIbvEEEEENSP_IZNSQ_30ArbitraryAvifLayeredRandDim16bEvEUlmmiSR_bE_JSU_SU_NSV_IiEESW_SY_EEEEEENS0_7MapImplIPFSE_15avifCodecChoiceiiiiiiEJNSV_IS15_EENST_IiEES19_S19_S19_S19_S19_EEENS14_IPFSG_SG_jEJNS14_IPFSG_S15_i17avifDecoderSourcebbbbjjjjEJS18_S19_NSV_IS1D_EESY_SY_SY_SY_NSV_ImEES1H_S11_NS0_24BitFlagCombinationOfImplIjEEEEENSV_IjEEEEEEEEDaNS0_15AggregateOfImplINS3_5tupleIJDpNT_10value_typeEEEELNS0_23RequireCustomCorpusTypeE0EJDpS1P_EEE:
  149|      2|                       domain) && {
  150|      2|    static_assert(!Registration::kHasDomain,
  151|      2|                  "WithDomains can only be called once.");
  152|      2|    static_assert(!Registration::kHasSeeds,
  153|      2|                  "WithDomains can not be called after WithSeeds.");
  154|      2|    static_assert(!Registration::kHasSeedProvider,
  155|      2|                  "WithDomains can not be called after WithSeedProvider.");
  156|      2|    static_assert(
  157|      2|        Base::kNumArgs == sizeof...(NewDomains),
  158|      2|        "Number of domains specified in .WithDomains() does not match "
  159|      2|        "the number of function parameters.");
  160|      2|    using NewBase = RegistrationWithDomainsBase<value_type_t<NewDomains>...>;
  161|      2|    return Registration<Fixture, TargetFunction, NewBase, SeedProvider>(
  162|      2|        std::move(test_info_), target_function_, NewBase{std::move(domain)});
  163|      2|  }
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SE_SG_EEEPvEC2ENS0_13BasicTestInfoESI_SK_:
  293|      2|      : Base(std::move(base)),
  294|      2|        test_info_(std::move(info)),
  295|      2|        target_function_(target_function) {}
_ZNK8fuzztest8internal27RegistrationWithDomainsBaseIJNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEENS2_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEE10GetDomainsEv:
   95|      2|  const auto& GetDomains() const { return domains_; }
_ZNK8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SF_SJ_SL_EEEPvE5seedsEv:
  271|      2|  std::vector<GenericDomainCorpusType> seeds() const {
  272|       |    if constexpr (Base::kHasSeeds) {
  273|       |      return this->seeds_;
  274|      2|    } else {
  275|      2|      return {};
  276|      2|    }
  277|      2|  }
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEERKNS3_5arrayI15avifScalingModeLm4EEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SF_SJ_SL_EEEPvE13seed_providerEv:
  279|      2|  SeedProvider seed_provider() {
  280|       |    if constexpr (Base::kHasSeedProvider) {
  281|       |      return std::move(this->seed_provider_);
  282|      2|    } else {
  283|      2|      return {};
  284|      2|    }
  285|      2|  }
_ZNK8fuzztest8internal27RegistrationWithDomainsBaseIJNSt3__16vectorINS2_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS2_9allocatorIS8_EEEENS4_I11avifEncoderS7_EENS4_I11avifDecoderS7_EEEE10GetDomainsEv:
   95|      2|  const auto& GetDomains() const { return domains_; }
_ZNK8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SE_SG_EEEPvE5seedsEv:
  271|      2|  std::vector<GenericDomainCorpusType> seeds() const {
  272|       |    if constexpr (Base::kHasSeeds) {
  273|       |      return this->seeds_;
  274|      2|    } else {
  275|      2|      return {};
  276|      2|    }
  277|      2|  }
_ZN8fuzztest8internal12RegistrationINS0_9NoFixtureEPFvNSt3__16vectorINS3_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS3_9allocatorIS9_EEEENS5_I11avifEncoderS8_EENS5_I11avifDecoderS8_EEENS0_27RegistrationWithDomainsBaseIJSC_SE_SG_EEEPvE13seed_providerEv:
  279|      2|  SeedProvider seed_provider() {
  280|       |    if constexpr (Base::kHasSeedProvider) {
  281|       |      return std::move(this->seed_provider_);
  282|      2|    } else {
  283|      2|      return {};
  284|      2|    }
  285|      2|  }

_ZN8fuzztest8internal11ForEachTestEN4absl12lts_2026052611FunctionRefIFvRNS0_8FuzzTestEEEE:
   56|      8|void ForEachTest(absl::FunctionRef<void(FuzzTest&)> func) {
   57|     16|  for (auto& t : Regs()) func(t);
  ------------------
  |  Branch (57:16): [True: 16, False: 8]
  ------------------
   58|      8|}
_ZN8fuzztest8internal12RegisterImplENS0_13BasicTestInfoEN4absl12lts_2026052612AnyInvocableIKFNSt3__110unique_ptrINS0_14FuzzTestFuzzerENS5_14default_deleteIS7_EEEERKNS0_8FuzzTestEEEE:
   60|      4|void RegisterImpl(BasicTestInfo test_info, FuzzTestFuzzerFactory factory) {
   61|      4|  Regs().emplace_back(std::move(test_info), std::move(factory));
   62|      4|}
registry.cc:_ZN8fuzztest8internal12_GLOBAL__N_14RegsEv:
   30|     12|auto& Regs() {
   31|       |  // We use a deque because FuzzTest is not copyable/movable.
   32|     12|  static auto* reg = new std::deque<FuzzTest>;
   33|     12|  return *reg;
   34|     12|}

_ZN8fuzztest8internal17RegistrationTokenaSINS0_27RegistrationWithDomainsBaseIJNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEENS4_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvEERS1_ONS0_12RegistrationIT0_T1_T_T2_EE:
   57|      2|      Registration<Fixture, TargetFunction, RegBase, SeedProvider>&& reg) {
   58|       |    if constexpr (std::is_base_of_v<FixtureWithExplicitSetUp, Fixture>) {
   59|       |      RegisterSetUpTearDownTestSuiteFunctions(reg.test_info_.suite_name,
   60|       |                                              &Fixture::SetUpTestSuite,
   61|       |                                              &Fixture::TearDownTestSuite);
   62|       |    }
   63|      2|    BasicTestInfo test_info = reg.test_info_;
   64|      2|    RegisterImpl(std::move(test_info),
   65|      2|                 GetFuzzTestFuzzerFactory(std::move(reg)));
   66|      2|    return *this;
   67|      2|  }
_ZN8fuzztest8internal17RegistrationToken24GetFuzzTestFuzzerFactoryINS0_27RegistrationWithDomainsBaseIJNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEENS4_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvEEN4absl12lts_2026052612AnyInvocableIKFNS6_INS0_14FuzzTestFuzzerENS4_14default_deleteISV_EEEERKNS0_8FuzzTestEEEEONS0_12RegistrationIT0_T1_T_T2_EE:
   72|      2|      Registration<Fixture, TargetFunction, RegBase, SeedProvider>&& reg) {
   73|       |#if defined(FUZZTEST_COMPATIBILITY_MODE) && defined(FUZZTEST_USE_CENTIPEDE)
   74|       |#error FuzzTest compatibility mode cannot work together with Centipede.
   75|       |#endif
   76|      2|#if defined(FUZZTEST_COMPATIBILITY_MODE)
   77|      2|    using FuzzerImpl = FuzzTestExternalEngineAdaptor;
   78|       |#elif defined(FUZZTEST_USE_CENTIPEDE)
   79|       |    using FuzzerImpl = CentipedeFuzzerAdaptor;
   80|       |#else
   81|       |    using FuzzerImpl = FuzzTestFuzzerImpl;
   82|       |#endif
   83|       |
   84|      2|    return [target_function = reg.target_function_, domain = reg.GetDomains(),
   85|      2|            seeds = reg.seeds(), seed_provider = reg.seed_provider()](
   86|      2|               const FuzzTest& test) -> std::unique_ptr<FuzzTestFuzzer> {
   87|      2|      return std::make_unique<FuzzerImpl>(
   88|      2|          test,
   89|      2|          std::make_unique<FixtureDriverImpl<decltype(domain), Fixture,
   90|      2|                                             TargetFunction, SeedProvider>>(
   91|      2|              target_function, domain, seeds, seed_provider));
   92|      2|    };
   93|      2|  }
_ZZN8fuzztest8internal17RegistrationToken24GetFuzzTestFuzzerFactoryINS0_27RegistrationWithDomainsBaseIJNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEENS4_5arrayI15avifScalingModeLm4EEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEENS0_9NoFixtureEPFvSD_RKSG_SI_SK_EPvEEN4absl12lts_2026052612AnyInvocableIKFNS6_INS0_14FuzzTestFuzzerENS4_14default_deleteISV_EEEERKNS0_8FuzzTestEEEEONS0_12RegistrationIT0_T1_T_T2_EEENKUlS11_E_clES11_:
   86|      2|               const FuzzTest& test) -> std::unique_ptr<FuzzTestFuzzer> {
   87|      2|      return std::make_unique<FuzzerImpl>(
   88|      2|          test,
   89|      2|          std::make_unique<FixtureDriverImpl<decltype(domain), Fixture,
   90|      2|                                             TargetFunction, SeedProvider>>(
   91|      2|              target_function, domain, seeds, seed_provider));
   92|      2|    };
_ZN8fuzztest8internal17RegistrationTokenaSINS0_27RegistrationWithDomainsBaseIJNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEENS0_9NoFixtureEPFvSD_SF_SH_EPvEERS1_ONS0_12RegistrationIT0_T1_T_T2_EE:
   57|      2|      Registration<Fixture, TargetFunction, RegBase, SeedProvider>&& reg) {
   58|       |    if constexpr (std::is_base_of_v<FixtureWithExplicitSetUp, Fixture>) {
   59|       |      RegisterSetUpTearDownTestSuiteFunctions(reg.test_info_.suite_name,
   60|       |                                              &Fixture::SetUpTestSuite,
   61|       |                                              &Fixture::TearDownTestSuite);
   62|       |    }
   63|      2|    BasicTestInfo test_info = reg.test_info_;
   64|      2|    RegisterImpl(std::move(test_info),
   65|      2|                 GetFuzzTestFuzzerFactory(std::move(reg)));
   66|      2|    return *this;
   67|      2|  }
_ZN8fuzztest8internal17RegistrationToken24GetFuzzTestFuzzerFactoryINS0_27RegistrationWithDomainsBaseIJNSt3__16vectorINS4_10unique_ptrI9avifImageN4avif16UniquePtrDeleterEEENS4_9allocatorISA_EEEENS6_I11avifEncoderS9_EENS6_I11avifDecoderS9_EEEEENS0_9NoFixtureEPFvSD_SF_SH_EPvEEN4absl12lts_2026052612AnyInvocableIKFNS6_INS0_14FuzzTestFuzzerENS4_14default_deleteISQ_EEEERKNS0_8FuzzTestEEEEONS0_12RegistrationIT0_T1_T_T2_EE:
   72|      2|      Registration<Fixture, TargetFunction, RegBase, SeedProvider>&& reg) {
   73|       |#if defined(FUZZTEST_COMPATIBILITY_MODE) && defined(FUZZTEST_USE_CENTIPEDE)
   74|       |#error FuzzTest compatibility mode cannot work together with Centipede.
   75|       |#endif
   76|      2|#if defined(FUZZTEST_COMPATIBILITY_MODE)
   77|      2|    using FuzzerImpl = FuzzTestExternalEngineAdaptor;
   78|       |#elif defined(FUZZTEST_USE_CENTIPEDE)
   79|       |    using FuzzerImpl = CentipedeFuzzerAdaptor;
   80|       |#else
   81|       |    using FuzzerImpl = FuzzTestFuzzerImpl;
   82|       |#endif
   83|       |
   84|      2|    return [target_function = reg.target_function_, domain = reg.GetDomains(),
   85|      2|            seeds = reg.seeds(), seed_provider = reg.seed_provider()](
   86|      2|               const FuzzTest& test) -> std::unique_ptr<FuzzTestFuzzer> {
   87|      2|      return std::make_unique<FuzzerImpl>(
   88|      2|          test,
   89|      2|          std::make_unique<FixtureDriverImpl<decltype(domain), Fixture,
   90|      2|                                             TargetFunction, SeedProvider>>(
   91|      2|              target_function, domain, seeds, seed_provider));
   92|      2|    };
   93|      2|  }

_ZN8fuzztest8internal7RuntimeC2Ev:
  247|      2|Runtime::Runtime() {
  248|      2|  if (const char* crash_metadata_path =
  249|      2|          std::getenv("FUZZTEST_CRASH_METADATA_PATH");
  250|      2|      crash_metadata_path != nullptr) {
  ------------------
  |  Branch (250:7): [True: 0, False: 2]
  ------------------
  251|      0|    RegisterCrashMetadataListener(
  252|      0|        [=](absl::string_view crash_type,
  253|      0|            absl::Span<const std::string> /*stack_frames*/) {
  254|      0|          WriteFile(crash_metadata_path, crash_type);
  255|      0|        });
  256|      0|  }
  257|      2|}
_ZN8fuzztest8internal7Runtime8Spinlock4LockEv:
  434|  41.3k|void Runtime::Spinlock::Lock() {
  435|  41.3k|  while (locked_.test_and_set(std::memory_order_acq_rel)) {
  ------------------
  |  Branch (435:10): [True: 0, False: 41.3k]
  ------------------
  436|      0|    std::this_thread::yield();
  437|      0|  }
  438|  41.3k|}
_ZN8fuzztest8internal7Runtime8Spinlock6UnlockEv:
  440|  41.3k|void Runtime::Spinlock::Unlock() { locked_.clear(std::memory_order_release); }
_ZN8fuzztest8internal7Runtime19CheckWatchdogLimitsEv:
  453|  13.7k|void Runtime::CheckWatchdogLimits() {
  454|       |  // Centipede runner has its own watchdog.
  455|  13.7k|#ifndef FUZZTEST_USE_CENTIPEDE
  456|  13.7k|  watchdog_spinlock_.Lock();
  457|  13.7k|  if (current_configuration_ == nullptr || !test_iteration_started_ ||
  ------------------
  |  Branch (457:7): [True: 0, False: 13.7k]
  |  Branch (457:44): [True: 0, False: 13.7k]
  ------------------
  458|  13.7k|      watchdog_limit_exceeded_) {
  ------------------
  |  Branch (458:7): [True: 0, False: 13.7k]
  ------------------
  459|      0|    watchdog_spinlock_.Unlock();
  460|      0|    return;
  461|      0|  }
  462|  13.7k|  const absl::Duration run_duration =
  463|  13.7k|      clock_fn_() - current_iteration_start_time_;
  464|  13.7k|  if (current_configuration_->time_limit_per_input > absl::ZeroDuration() &&
  ------------------
  |  Branch (464:7): [True: 13.7k, False: 0]
  ------------------
  465|  13.7k|      run_duration > current_configuration_->time_limit_per_input) {
  ------------------
  |  Branch (465:7): [True: 0, False: 13.7k]
  ------------------
  466|      0|    absl::FPrintF(
  467|      0|        GetStderr(), "[!] Per-input timeout exceeded: %s > %s - aborting\n",
  468|      0|        absl::FormatDuration(run_duration),
  469|      0|        absl::FormatDuration(current_configuration_->time_limit_per_input));
  470|      0|    watchdog_limit_exceeded_ = true;
  471|      0|    watchdog_spinlock_.Unlock();
  472|      0|    std::abort();
  473|      0|  }
  474|  13.7k|  const size_t rss_usage = GetPeakRSSBytes();
  475|  13.7k|  if (current_configuration_->rss_limit > 0 &&
  ------------------
  |  Branch (475:7): [True: 0, False: 13.7k]
  ------------------
  476|      0|      rss_usage > current_configuration_->rss_limit) {
  ------------------
  |  Branch (476:7): [True: 0, False: 0]
  ------------------
  477|      0|    absl::FPrintF(GetStderr(),
  478|      0|                  "[!] RSS limit exceeded: %zu > %zu (bytes) - aborting\n",
  479|      0|                  rss_usage, current_configuration_->rss_limit);
  480|      0|    watchdog_limit_exceeded_ = true;
  481|      0|    watchdog_spinlock_.Unlock();
  482|      0|    std::abort();
  483|      0|  }
  484|  13.7k|  watchdog_spinlock_.Unlock();
  485|  13.7k|#endif  // FUZZTEST_USE_CENTIPEDE
  486|  13.7k|}
_ZN8fuzztest8internal7Runtime14SetCurrentTestEPKNS0_8FuzzTestEPKNS0_13ConfigurationE:
  489|      2|                             const Configuration* configuration) {
  490|      2|  FUZZTEST_CHECK((test != nullptr) == (configuration != nullptr));
  ------------------
  |  |   22|      2|#define FUZZTEST_CHECK(cond) ABSL_CHECK(cond)
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      4|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      4|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      4|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      4|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      0|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|      2|  current_test_ = test;
  492|      2|  current_configuration_ = configuration;
  493|      2|  if (configuration == nullptr) return;
  ------------------
  |  Branch (493:7): [True: 0, False: 2]
  ------------------
  494|      2|  if (const auto test_time_limit = configuration->GetTimeLimitPerTest();
  495|      2|      test_time_limit < absl::InfiniteDuration()) {
  ------------------
  |  Branch (495:7): [True: 0, False: 2]
  ------------------
  496|      0|    const absl::Status has_enough_time =
  497|      0|        fuzztest::internal::VerifyBazelHasEnoughTimeToRunTest(
  498|      0|            creation_time_, test_time_limit, test_counter_,
  499|      0|            configuration->fuzz_tests.size());
  500|      0|    FUZZTEST_PRECONDITION(has_enough_time.ok())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      0|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      0|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      0|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      0|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      0|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      0|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      0|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      0|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|      0|        << "Not enough time for running the fuzz test " << test->full_name()
  502|      0|        << " for " << test_time_limit << ": " << has_enough_time;
  503|      0|  }
  504|      2|  ++test_counter_;
  505|      2|}
_ZN8fuzztest8internal7Runtime20OnTestIterationStartERKN4absl12lts_202605264TimeE:
  507|  13.7k|void Runtime::OnTestIterationStart(const absl::Time& start_time) {
  508|  13.7k|  watchdog_spinlock_.Lock();
  509|  13.7k|  current_iteration_start_time_ = start_time;
  510|  13.7k|  test_iteration_started_ = true;
  511|  13.7k|  watchdog_spinlock_.Unlock();
  512|  13.7k|}
_ZN8fuzztest8internal7Runtime18OnTestIterationEndEv:
  514|  13.7k|void Runtime::OnTestIterationEnd() {
  515|  13.7k|  CheckWatchdogLimits();
  516|  13.7k|  watchdog_spinlock_.Lock();
  517|  13.7k|  test_iteration_started_ = false;
  518|  13.7k|  watchdog_spinlock_.Unlock();
  519|  13.7k|}
_ZN8fuzztest8internal21InstallSignalHandlersEP8_IO_FILE:
  632|      2|void InstallSignalHandlers(FILE* out) {
  633|      2|  if (signal_out != nullptr) {
  ------------------
  |  Branch (633:7): [True: 0, False: 2]
  ------------------
  634|       |    // Already installed. Noop.
  635|      0|    return;
  636|      0|  }
  637|      2|  signal_out = out;
  638|       |
  639|       |#if defined(FUZZTEST_HAS_SANITIZER)
  640|       |  // An ASan failure might come without a signal.
  641|       |  // Eg a divide by zero is intercepted by ASan and it terminates the process
  642|       |  // after printing its output. This handler helps us print our output
  643|       |  // afterwards.
  644|       |  __sanitizer_set_death_callback(
  645|       |      [](auto...) { Runtime::instance().PrintReport(&signal_out_sink); });
  646|       |#endif
  647|       |
  648|     12|  for (OldSignalHandler& h : crash_handlers) {
  ------------------
  |  Branch (648:28): [True: 12, False: 2]
  ------------------
  649|     12|    SetNewSigAction(h.signum, &HandleCrash, &h.action);
  650|     12|  }
  651|       |
  652|      6|  for (OldSignalHandler& h : termination_handlers) {
  ------------------
  |  Branch (652:28): [True: 6, False: 2]
  ------------------
  653|      6|    SetNewSigAction(h.signum, &HandleTermination, nullptr);
  654|      6|  }
  655|      2|}
_ZN8fuzztest8internal28InstallUnexpectedExitHandlerEv:
  674|      2|void InstallUnexpectedExitHandler() {
  675|       |#ifndef FUZZTEST_COMPATIBILITY_MODE
  676|       |  // In compatibility mode we don't install the handler because libFuzzer
  677|       |  // always explicitly exits, so every run would finish with an unexpected
  678|       |  // exit.
  679|       |  // https://github.com/llvm/llvm-project/blob/fa511cde48ea218dadfa8b35658ac06368f34607/compiler-rt/lib/fuzzer/FuzzerDriver.cpp#L930
  680|       |  [[maybe_unused]] const bool installed = [] {
  681|       |    std::atexit([] { Runtime::instance().HandleUnexpectedExit(); });
  682|       |    return true;
  683|       |  }();
  684|       |#endif
  685|      2|}
_ZN8fuzztest8internal18FuzzTestFuzzerImplC2ERKNS0_8FuzzTestENSt3__110unique_ptrINS0_20UntypedFixtureDriverENS5_14default_deleteIS7_EEEE:
  697|      2|    : test_(test),
  698|      2|      fixture_driver_(std::move(fixture_driver)),
  699|      2|      params_domain_(fixture_driver_->GetDomains()),
  700|      2|      execution_coverage_(internal::GetExecutionCoverage()),
  701|      2|      corpus_coverage_(execution_coverage_ != nullptr
  ------------------
  |  Branch (701:24): [True: 0, False: 2]
  ------------------
  702|      2|                           ? execution_coverage_->GetCounterMap().size()
  703|      2|                           : 0) {
  704|      4|  FUZZTEST_PRECONDITION(fixture_driver_ != nullptr)
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      2|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      2|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      4|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      4|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      2|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      4|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      2|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      2|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|      4|      << "Invalid fixture driver!";
  706|      2|  stats_.start_time = absl::Now();
  707|      2|  const char* corpus_out_dir_chars = getenv("FUZZTEST_TESTSUITE_OUT_DIR");
  708|      2|  if (corpus_out_dir_chars) corpus_out_dir_ = corpus_out_dir_chars;
  ------------------
  |  Branch (708:7): [True: 0, False: 2]
  ------------------
  709|       |
  710|      2|  std::vector<double> weights = {100.};
  711|      2|  corpus_distribution_ =
  712|      2|      absl::discrete_distribution<>(weights.begin(), weights.end());
  713|      2|}
_ZN8fuzztest8internal18FuzzTestFuzzerImpl8TryParseENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  720|  15.9k|    absl::string_view data) {
  721|  15.9k|  auto ir_value = ParseIRObject(data);
  722|  15.9k|  if (!ir_value) {
  ------------------
  |  Branch (722:7): [True: 893, False: 15.0k]
  ------------------
  723|    893|    return absl::InvalidArgumentError("Unexpected file format");
  724|    893|  }
  725|  15.0k|  auto corpus_value = params_domain_.ParseCorpus(*ir_value);
  726|  15.0k|  if (!corpus_value) {
  ------------------
  |  Branch (726:7): [True: 1.23k, False: 13.8k]
  ------------------
  727|  1.23k|    return absl::InvalidArgumentError("Unexpected intermediate representation");
  728|  1.23k|  }
  729|  13.8k|  absl::Status is_valid = params_domain_.ValidateCorpusValue(*corpus_value);
  730|  13.8k|  if (!is_valid.ok()) {
  ------------------
  |  Branch (730:7): [True: 31, False: 13.7k]
  ------------------
  731|     31|    return Prefix(is_valid, "Invalid corpus value");
  732|     31|  }
  733|  13.7k|  return *corpus_value;
  734|  13.8k|}
_ZN8fuzztest8internal18FuzzTestFuzzerImpl10ShouldStopEv:
 1010|  15.9k|bool FuzzTestFuzzerImpl::ShouldStop() {
 1011|  15.9k|  if (runs_limit_.has_value() && stats_.runs >= *runs_limit_) return true;
  ------------------
  |  Branch (1011:7): [True: 0, False: 15.9k]
  |  Branch (1011:34): [True: 0, False: 0]
  ------------------
 1012|  15.9k|  if (time_limit_ != absl::InfiniteFuture() && absl::Now() > time_limit_)
  ------------------
  |  Branch (1012:7): [True: 0, False: 15.9k]
  |  Branch (1012:48): [True: 0, False: 0]
  ------------------
 1013|      0|    return true;
 1014|  15.9k|  return runtime_.termination_requested();
 1015|  15.9k|}
_ZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS1_5InputE:
 1128|  13.7k|    const Input& input) {
 1129|  13.7k|  ++stats_.runs;
 1130|  13.7k|  auto untyped_args = params_domain_.GetValue(input.args);
 1131|  13.7k|  Runtime::Args debug_args{input.args, params_domain_};
 1132|  13.7k|  runtime_.SetCurrentArgs(&debug_args);
 1133|       |
 1134|       |  // Reset and observe the coverage map and start tracing in
 1135|       |  // the tightest scope possible. In particular, we can't include the call
 1136|       |  // to GetValue in the scope as it will run user code.
 1137|  13.7k|  if (execution_coverage_ != nullptr) {
  ------------------
  |  Branch (1137:7): [True: 0, False: 13.7k]
  ------------------
 1138|      0|    execution_coverage_->ResetState();
 1139|      0|  }
 1140|  13.7k|  absl::Time start = absl::Now();
 1141|  13.7k|  runtime_.OnTestIterationStart(start);
 1142|       |  // Set tracing after absl::Now(), otherwise it will make
 1143|       |  // FuzzingModeTest.MinimizesDuplicatedCorpustest flaky because
 1144|       |  // randomness in absl::Now() being traced by cmp coverage.
 1145|  13.7k|  if (execution_coverage_ != nullptr) {
  ------------------
  |  Branch (1145:7): [True: 0, False: 13.7k]
  ------------------
 1146|      0|    execution_coverage_->SetIsTracing(true);
 1147|      0|  }
 1148|       |
 1149|  13.7k|  runtime_.SetSkippingRequested(false);
 1150|  13.7k|  fixture_driver_->RunFuzzTestIteration([&] {
 1151|  13.7k|    if (!runtime_.skipping_requested()) {
 1152|  13.7k|      fixture_driver_->Test(std::move(untyped_args));
 1153|  13.7k|    }
 1154|  13.7k|  });
 1155|  13.7k|  if (execution_coverage_ != nullptr) {
  ------------------
  |  Branch (1155:7): [True: 0, False: 13.7k]
  ------------------
 1156|      0|    execution_coverage_->SetIsTracing(false);
 1157|      0|  }
 1158|  13.7k|  const absl::Duration run_time = absl::Now() - start;
 1159|       |
 1160|  13.7k|  bool new_coverage = false;
 1161|  13.7k|  if (execution_coverage_ != nullptr && !runtime_.skipping_requested()) {
  ------------------
  |  Branch (1161:7): [True: 0, False: 13.7k]
  |  Branch (1161:41): [True: 0, False: 0]
  ------------------
 1162|      0|    new_coverage = corpus_coverage_.Update(execution_coverage_);
 1163|      0|    stats_.max_stack_used =
 1164|      0|        std::max(stats_.max_stack_used, execution_coverage_->MaxStackUsed());
 1165|      0|  }
 1166|       |
 1167|  13.7k|  runtime_.OnTestIterationEnd();
 1168|  13.7k|  runtime_.UnsetCurrentArgs();
 1169|  13.7k|  return {new_coverage, run_time};
 1170|  13.7k|}
runtime.cc:_ZN8fuzztest8internalL15GetPeakRSSBytesEv:
  442|  13.7k|static size_t GetPeakRSSBytes() {
  443|       |#ifndef FUZZTEST_HAS_RUSAGE
  444|       |  return 0;
  445|       |#else
  446|  13.7k|  struct rusage usage = {};
  447|  13.7k|  if (getrusage(RUSAGE_SELF, &usage) != 0) return 0;
  ------------------
  |  Branch (447:7): [True: 0, False: 13.7k]
  ------------------
  448|       |  // On Linux, ru_maxrss is in KiB
  449|  13.7k|  return usage.ru_maxrss * 1024;
  450|  13.7k|#endif
  451|  13.7k|}
runtime.cc:_ZN8fuzztest8internalL15SetNewSigActionEiPFviP9siginfo_tPvEP9sigaction:
  615|     18|                            struct sigaction* old_sigact) {
  616|     18|  struct sigaction new_sigact = {};
  617|     18|  sigemptyset(&new_sigact.sa_mask);
  618|     18|  new_sigact.sa_sigaction = handler;
  619|       |
  620|       |  // We make use of the SA_ONSTACK flag so that signal handlers are executed on
  621|       |  // a separate stack. This is needed to properly handle cases where stack space
  622|       |  // is limited and the delivery of a signal needs to be properly handled.
  623|     18|  new_sigact.sa_flags = SA_SIGINFO | SA_ONSTACK;
  624|       |
  625|     18|  if (sigaction(signum, &new_sigact, old_sigact) == -1) {
  ------------------
  |  Branch (625:7): [True: 0, False: 18]
  ------------------
  626|      0|    fprintf(GetStderr(), "Error installing signal handler: %s\n",
  627|       |            strerror(errno));
  628|      0|    exit(1);
  629|      0|  }
  630|     18|}
runtime.cc:_ZZN8fuzztest8internal18FuzzTestFuzzerImpl11RunOneInputERKNS1_5InputEENK3$_0clEv:
 1150|  13.7k|  fixture_driver_->RunFuzzTestIteration([&] {
 1151|  13.7k|    if (!runtime_.skipping_requested()) {
  ------------------
  |  Branch (1151:9): [True: 13.7k, False: 0]
  ------------------
 1152|  13.7k|      fixture_driver_->Test(std::move(untyped_args));
 1153|  13.7k|    }
 1154|  13.7k|  });

_ZN8fuzztest8internal8FuzzTestC2ENS0_13BasicTestInfoEN4absl12lts_2026052612AnyInvocableIKFNSt3__110unique_ptrINS0_14FuzzTestFuzzerENS6_14default_deleteIS8_EEEERKS1_EEE:
   83|      4|      : test_info_(std::move(test_info)), make_(std::move(factory)) {}
_ZNK8fuzztest8internal8FuzzTest10suite_nameEv:
   85|      4|  const std::string& suite_name() const { return test_info_.suite_name; }
_ZNK8fuzztest8internal8FuzzTest9test_nameEv:
   86|      4|  const std::string& test_name() const { return test_info_.test_name; }
_ZNK8fuzztest8internal8FuzzTest9full_nameEv:
   87|     12|  std::string full_name() const {
   88|     12|    return absl::StrCat(test_info_.suite_name, ".", test_info_.test_name);
   89|     12|  }
_ZNK8fuzztest8internal8FuzzTest4fileEv:
   90|      4|  const std::string& file() const { return test_info_.file; }
_ZNK8fuzztest8internal8FuzzTest4lineEv:
   91|      4|  int line() const { return test_info_.line; }
_ZNK8fuzztest8internal8FuzzTest12uses_fixtureEv:
   92|      4|  bool uses_fixture() const { return test_info_.uses_fixture; }
_ZNK8fuzztest8internal8FuzzTest4makeEv:
   93|      2|  auto make() const { return make_(*this); }
_ZN8fuzztest8internal7Runtime8instanceEv:
  127|      8|  static Runtime& instance() {
  128|      8|    static auto* runtime = new Runtime();
  129|      8|    return *runtime;
  130|      8|  }
_ZN8fuzztest8internal7Runtime20SetSkippingRequestedEb:
  139|  13.7k|  void SetSkippingRequested(bool requested) {
  140|  13.7k|    skipping_requested_.store(requested, std::memory_order_relaxed);
  141|  13.7k|  }
_ZNK8fuzztest8internal7Runtime18skipping_requestedEv:
  143|  13.7k|  bool skipping_requested() const {
  144|  13.7k|    return skipping_requested_.load(std::memory_order_relaxed);
  145|  13.7k|  }
_ZNK8fuzztest8internal7Runtime21termination_requestedEv:
  159|  15.9k|  bool termination_requested() const {
  160|  15.9k|    return termination_requested_.load(std::memory_order_relaxed);
  161|  15.9k|  }
_ZN8fuzztest8internal7Runtime10SetRunModeENS_7RunModeE:
  163|      4|  void SetRunMode(RunMode run_mode) { run_mode_ = run_mode; }
_ZNK8fuzztest8internal7Runtime8run_modeEv:
  164|      2|  RunMode run_mode() const { return run_mode_; }
_ZN8fuzztest8internal7Runtime14EnableReporterEPKNS0_12RuntimeStatsEPFN4absl12lts_202605264TimeEvE:
  168|      2|  void EnableReporter(const RuntimeStats* stats, absl::Time (*clock_fn)()) {
  169|      2|    reporter_enabled_ = true;
  170|      2|    stats_ = stats;
  171|      2|    clock_fn_ = clock_fn;
  172|       |    // In case we have not installed them yet, do so now.
  173|      2|    InstallSignalHandlers(GetStderr());
  174|      2|    InstallUnexpectedExitHandler();
  175|      2|    ResetCrashType();
  176|      2|  }
_ZN8fuzztest8internal7Runtime14SetCurrentArgsEPNS1_4ArgsE:
  193|  13.7k|  void SetCurrentArgs(Args* args) { current_args_ = args; }
_ZN8fuzztest8internal7Runtime16UnsetCurrentArgsEv:
  194|  13.7k|  void UnsetCurrentArgs() { current_args_ = nullptr; }
_ZN8fuzztest8internal7Runtime14ResetCrashTypeEv:
  211|      2|  void ResetCrashType() { crash_type_ = std::nullopt; }
_ZN8fuzztest8internal7Runtime8SpinlockC2Ev:
  272|      2|    Spinlock() = default;

_ZN8fuzztest8internal23GetFromEnvOrMakeSeedSeqERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS1_17basic_string_viewIcS4_EE:
   64|      2|                                      absl::string_view env_var) {
   65|      2|  const std::vector<uint32_t> seed_material =
   66|      2|      GetFromEnvOrMakeSeedMaterial(env_var);
   67|      2|  const std::string encoded_seed_material = EncodeSeedMaterial(seed_material);
   68|      2|  out << env_var << "=" << encoded_seed_material << '\n';
   69|      2|  return std::seed_seq(seed_material.begin(), seed_material.end());
   70|      2|}
_ZN8fuzztest8internal18EncodeSeedMaterialEN4absl12lts_202605264SpanIKjEE:
   72|      2|std::string EncodeSeedMaterial(absl::Span<const uint32_t> seed_material) {
   73|      2|  return absl::WebSafeBase64Escape(
   74|      2|      absl::string_view(reinterpret_cast<const char*>(seed_material.data()),
   75|      2|                        seed_material.size() * sizeof(uint32_t)));
   76|      2|}
seed_seq.cc:_ZN8fuzztest8internal12_GLOBAL__N_128GetFromEnvOrMakeSeedMaterialENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   48|      2|std::vector<uint32_t> GetFromEnvOrMakeSeedMaterial(absl::string_view env_var) {
   49|      2|  const char* encoded_seed_material = std::getenv(env_var.data());
   50|      2|  if (encoded_seed_material == nullptr) {
  ------------------
  |  Branch (50:7): [True: 2, False: 0]
  ------------------
   51|      2|    return MakeSeedMaterial();
   52|      2|  }
   53|      0|  std::optional<std::vector<uint32_t>> seed_material =
   54|      0|      DecodeSeedMaterial(encoded_seed_material);
   55|      0|  FUZZTEST_PRECONDITION(seed_material.has_value())
  ------------------
  |  |   32|      0|  ABSL_CHECK(cond) << "[Failed precondition] Incorrect usage: "
  |  |  ------------------
  |  |  |  |   41|      0|  ABSL_LOG_INTERNAL_CHECK_IMPL((condition), #condition)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|  ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS,                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      0|  ABSL_LOG_INTERNAL_##type##_CONDITION(condition)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      0|  switch (0)                                             \
  |  |  |  |  |  |  |  |  |  |   66|      0|  case 0:                                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (66:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   67|      0|  default:                                               \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (67:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   68|      0|    !(condition) ? (void)0 : ::absl::log_internal::Voidify() &&
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (68:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                                    ABSL_PREDICT_FALSE(!(condition))) \
  |  |  |  |  |  |   29|      0|  ABSL_LOG_INTERNAL_CHECK(condition_text).InternalStream()
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   84|      0|  ::absl::log_internal::LogMessageFatal(__FILE__, __LINE__, failure_message)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|      0|      << "Failed to decode seed material from the environment variable "
   57|      0|      << env_var;
   58|      0|  return *std::move(seed_material);
   59|      0|}
seed_seq.cc:_ZN8fuzztest8internal12_GLOBAL__N_116MakeSeedMaterialEv:
   38|      2|std::vector<uint32_t> MakeSeedMaterial() {
   39|      2|  absl::BitGen gen;
   40|      2|  static constexpr int kNumberOfEntropyBits = 256;
   41|      2|  std::vector<uint32_t> seed_material(kNumberOfEntropyBits /
   42|      2|                                      (8 * sizeof(uint32_t)));
   43|      2|  std::generate(seed_material.begin(), seed_material.end(),
   44|      2|                [&gen] { return absl::Uniform<uint32_t>(gen); });
   45|      2|  return seed_material;
   46|      2|}
seed_seq.cc:_ZZN8fuzztest8internal12_GLOBAL__N_116MakeSeedMaterialEvENK3$_0clEv:
   44|     16|                [&gen] { return absl::Uniform<uint32_t>(gen); });

_ZN8fuzztest8internal13ParseIRObjectENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  328|  15.9k|std::optional<IRObject> ParseIRObject(absl::string_view str) {
  329|  15.9k|  IRObject object;
  330|  15.9k|  if (IsInBinaryFormat(str)) {
  ------------------
  |  Branch (330:7): [True: 13.8k, False: 2.07k]
  ------------------
  331|  13.8k|    BinaryParseBuf buf = {str.data(), str.size()};
  332|  13.8k|    buf.Advance(kBinaryHeader.size());
  333|  13.8k|    if (!BinaryParse(object, buf, /*recursion_depth=*/0) || !buf.empty())
  ------------------
  |  Branch (333:9): [True: 15, False: 13.8k]
  |  Branch (333:61): [True: 3, False: 13.8k]
  ------------------
  334|     18|      return std::nullopt;
  335|  13.8k|  } else {
  336|  2.07k|    if (ReadToken(str) != kHeader) return std::nullopt;
  ------------------
  |  Branch (336:9): [True: 7, False: 2.07k]
  ------------------
  337|  2.07k|    if (!ParseImpl(object, str, /*recursion_depth=*/0) ||
  ------------------
  |  Branch (337:9): [True: 782, False: 1.28k]
  |  Branch (337:9): [True: 868, False: 1.20k]
  ------------------
  338|  1.28k|        !ReadToken(str).empty())
  ------------------
  |  Branch (338:9): [True: 86, False: 1.20k]
  ------------------
  339|    868|      return std::nullopt;
  340|  2.07k|  }
  341|  15.0k|  return object;
  342|  15.9k|}
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_116IsInBinaryFormatENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  299|  15.9k|bool IsInBinaryFormat(absl::string_view str) {
  300|       |  // Not using absl::string_view or std::memcmp because they could be
  301|       |  // instrumented and using them could pollute coverage.
  302|  15.9k|  return str.size() >= kBinaryHeader.size() &&
  ------------------
  |  Branch (302:10): [True: 15.9k, False: 3]
  ------------------
  303|  15.9k|         __builtin_memcmp(str.data(), kBinaryHeader.data(),
  ------------------
  |  Branch (303:10): [True: 13.8k, False: 2.07k]
  ------------------
  304|  15.9k|                          kBinaryHeader.size()) == 0;
  305|  15.9k|}
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_114BinaryParseBuf7AdvanceEm:
  239|  71.3M|  void Advance(size_t s) {
  240|  71.3M|    if (s > size) s = size;
  ------------------
  |  Branch (240:9): [True: 0, False: 71.3M]
  ------------------
  241|  71.3M|    str += s;
  242|  71.3M|    size -= s;
  243|  71.3M|  }
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_111BinaryParseERNS0_6no_adl8IRObjectERNS1_14BinaryParseBufEi:
  246|  35.6M|bool BinaryParse(IRObject& obj, BinaryParseBuf& buf, int recursion_depth) {
  247|  35.6M|  if (recursion_depth > kMaxParseRecursionDepth) return false;
  ------------------
  |  Branch (247:7): [True: 0, False: 35.6M]
  ------------------
  248|  35.6M|  if (buf.empty()) return false;
  ------------------
  |  Branch (248:7): [True: 3, False: 35.6M]
  ------------------
  249|  35.6M|  const auto h = static_cast<BinaryFormatHeader>(buf.str[0]);
  250|  35.6M|  buf.Advance(1);
  251|  35.6M|  switch (h) {
  ------------------
  |  Branch (251:11): [True: 35.6M, False: 4]
  ------------------
  252|    700|    case BinaryFormatHeader::kEmpty: {
  ------------------
  |  Branch (252:5): [True: 700, False: 35.6M]
  ------------------
  253|    700|      return true;
  254|      0|    }
  255|  35.5M|    case BinaryFormatHeader::kUInt64: {
  ------------------
  |  Branch (255:5): [True: 35.5M, False: 125k]
  ------------------
  256|  35.5M|      if (buf.size < sizeof(uint64_t)) return false;
  ------------------
  |  Branch (256:11): [True: 7, False: 35.5M]
  ------------------
  257|  35.5M|      auto& t = obj.MutableScalar<uint64_t>();
  258|  35.5M|      std::memcpy(&t, buf.str, sizeof(uint64_t));
  259|  35.5M|      buf.Advance(sizeof(uint64_t));
  260|  35.5M|      return true;
  261|  35.5M|    }
  262|      4|    case BinaryFormatHeader::kDouble: {
  ------------------
  |  Branch (262:5): [True: 4, False: 35.6M]
  ------------------
  263|      4|      if (buf.size < sizeof(double)) return false;
  ------------------
  |  Branch (263:11): [True: 0, False: 4]
  ------------------
  264|      4|      auto& t = obj.MutableScalar<double>();
  265|      4|      std::memcpy(&t, buf.str, sizeof(t));
  266|      4|      buf.Advance(sizeof(double));
  267|      4|      return true;
  268|      4|    }
  269|  9.97k|    case BinaryFormatHeader::kString: {
  ------------------
  |  Branch (269:5): [True: 9.97k, False: 35.6M]
  ------------------
  270|  9.97k|      if (buf.size < sizeof(uint64_t)) return false;
  ------------------
  |  Branch (270:11): [True: 0, False: 9.97k]
  ------------------
  271|  9.97k|      uint64_t str_size;
  272|  9.97k|      std::memcpy(&str_size, buf.str, sizeof(str_size));
  273|  9.97k|      buf.Advance(sizeof(uint64_t));
  274|  9.97k|      if (buf.size < str_size) return false;
  ------------------
  |  Branch (274:11): [True: 0, False: 9.97k]
  ------------------
  275|  9.97k|      obj.MutableScalar<std::string>() = {buf.str,
  276|  9.97k|                                          static_cast<size_t>(str_size)};
  277|  9.97k|      buf.Advance(str_size);
  278|  9.97k|      return true;
  279|  9.97k|    }
  280|   115k|    case BinaryFormatHeader::kObject: {
  ------------------
  |  Branch (280:5): [True: 115k, False: 35.5M]
  ------------------
  281|   115k|      if (buf.size < sizeof(uint64_t)) return false;
  ------------------
  |  Branch (281:11): [True: 0, False: 115k]
  ------------------
  282|   115k|      uint64_t vec_size;
  283|   115k|      std::memcpy(&vec_size, buf.str, sizeof(vec_size));
  284|   115k|      buf.Advance(sizeof(vec_size));
  285|       |      // This could happen for malformed inputs.
  286|   115k|      if (vec_size > buf.size) return false;
  ------------------
  |  Branch (286:11): [True: 1, False: 115k]
  ------------------
  287|   115k|      auto& v = obj.MutableSubs();
  288|   115k|      v.reserve(vec_size);
  289|  35.7M|      for (uint64_t i = 0; i < vec_size; ++i) {
  ------------------
  |  Branch (289:28): [True: 35.6M, False: 114k]
  ------------------
  290|  35.6M|        if (!BinaryParse(v.emplace_back(), buf, recursion_depth + 1))
  ------------------
  |  Branch (290:13): [True: 443, False: 35.6M]
  ------------------
  291|    443|          return false;
  292|  35.6M|      }
  293|   114k|      return true;
  294|   115k|    }
  295|  35.6M|  }
  296|      4|  return false;
  297|  35.6M|}
serialization.cc:_ZNK8fuzztest8internal12_GLOBAL__N_114BinaryParseBuf5emptyEv:
  238|  35.6M|  bool empty() const { return size == 0; }
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_19ReadTokenERNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   76|   150k|absl::string_view ReadToken(absl::string_view& in) {
   77|   188k|  while (!in.empty() && std::isspace(in[0])) in.remove_prefix(1);
  ------------------
  |  Branch (77:10): [True: 186k, False: 1.87k]
  |  Branch (77:25): [True: 38.1k, False: 148k]
  ------------------
   78|   150k|  if (in.empty()) return in;
  ------------------
  |  Branch (78:7): [True: 1.87k, False: 148k]
  ------------------
   79|   148k|  size_t end = 1;
   80|   148k|  const auto is_literal = [](char c) {
   81|   148k|    return std::isalnum(c) != 0 || c == '+' || c == '-' || c == '.';
   82|   148k|  };
   83|   148k|  if (is_literal(in[0])) {
  ------------------
  |  Branch (83:7): [True: 75.1k, False: 73.6k]
  ------------------
   84|  8.70M|    while (end < in.size() && is_literal(in[end])) ++end;
  ------------------
  |  Branch (84:12): [True: 8.70M, False: 1.54k]
  |  Branch (84:31): [True: 8.63M, False: 73.5k]
  ------------------
   85|  75.1k|  } else if (in[0] == '"') {
  ------------------
  |  Branch (85:14): [True: 397, False: 73.2k]
  ------------------
   86|  5.74k|    while (end < in.size() && in[end] != '"') ++end;
  ------------------
  |  Branch (86:12): [True: 5.72k, False: 18]
  |  Branch (86:31): [True: 5.34k, False: 379]
  ------------------
   87|    397|    if (end < in.size()) ++end;
  ------------------
  |  Branch (87:9): [True: 379, False: 18]
  ------------------
   88|    397|  }
   89|   148k|  absl::string_view res = in.substr(0, end);
   90|   148k|  in.remove_prefix(end);
   91|   148k|  return res;
   92|   150k|}
serialization.cc:_ZZN8fuzztest8internal12_GLOBAL__N_19ReadTokenERNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEENK3$_0clEc:
   80|  8.85M|  const auto is_literal = [](char c) {
   81|  8.85M|    return std::isalnum(c) != 0 || c == '+' || c == '-' || c == '.';
  ------------------
  |  Branch (81:12): [True: 8.69M, False: 163k]
  |  Branch (81:36): [True: 1.17k, False: 162k]
  |  Branch (81:48): [True: 6.07k, False: 156k]
  |  Branch (81:60): [True: 9.22k, False: 147k]
  ------------------
   82|  8.85M|  };
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_19ParseImplERNS0_6no_adl8IRObjectERNSt3__117basic_string_viewIcNS5_11char_traitsIcEEEEi:
  134|  27.3k|bool ParseImpl(IRObject& obj, absl::string_view& str, int recursion_depth) {
  135|  27.3k|  if (recursion_depth > kMaxParseRecursionDepth) return false;
  ------------------
  |  Branch (135:7): [True: 0, False: 27.3k]
  ------------------
  136|  27.3k|  absl::string_view key = ReadToken(str);
  137|  27.3k|  if (key.empty() || key == "}") {
  ------------------
  |  Branch (137:7): [True: 38, False: 27.3k]
  |  Branch (137:22): [True: 605, False: 26.7k]
  ------------------
  138|       |    // The object is empty. Put the token back and return.
  139|    643|    str = absl::string_view(key.data(), str.data() + str.size() - key.data());
  140|    643|    return true;
  141|    643|  }
  142|       |
  143|  26.7k|  if (key == "sub") {
  ------------------
  |  Branch (143:7): [True: 2.67k, False: 24.0k]
  ------------------
  144|  2.67k|    auto& v = obj.MutableSubs();
  145|  25.2k|    do {
  146|  25.2k|      if (ReadToken(str) != "{") return false;
  ------------------
  |  Branch (146:11): [True: 15, False: 25.2k]
  ------------------
  147|  25.2k|      if (!ParseImpl(v.emplace_back(), str, recursion_depth + 1)) return false;
  ------------------
  |  Branch (147:11): [True: 1.78k, False: 23.5k]
  ------------------
  148|  23.5k|      if (ReadToken(str) != "}") return false;
  ------------------
  |  Branch (148:11): [True: 464, False: 23.0k]
  ------------------
  149|  23.0k|      key = ReadToken(str);
  150|  23.0k|    } while (key == "sub");
  ------------------
  |  Branch (150:14): [True: 22.6k, False: 412]
  ------------------
  151|       |    // We are done reading this repeated sub.
  152|       |    // Put the token back for the caller.
  153|    412|    str = absl::string_view(key.data(), str.data() + str.size() - key.data());
  154|    412|    return true;
  155|  24.0k|  } else {
  156|  24.0k|    if (ReadToken(str) != ":") return false;
  ------------------
  |  Branch (156:9): [True: 16, False: 24.0k]
  ------------------
  157|  24.0k|    auto value = ReadToken(str);
  158|  24.0k|    if (key == "i") {
  ------------------
  |  Branch (158:9): [True: 848, False: 23.1k]
  ------------------
  159|    848|      return ReadScalar(obj.MutableScalar<uint64_t>(), value);
  160|  23.1k|    } else if (key == "d") {
  ------------------
  |  Branch (160:16): [True: 22.7k, False: 383]
  ------------------
  161|  22.7k|      return ReadScalar(obj.MutableScalar<double>(), value);
  162|  22.7k|    } else if (key == "s") {
  ------------------
  |  Branch (162:16): [True: 381, False: 2]
  ------------------
  163|    381|      return ReadScalar(obj.MutableScalar<std::string>(), value);
  164|    381|    } else {
  165|       |      // Unrecognized key
  166|      2|      return false;
  167|      2|    }
  168|  24.0k|  }
  169|  26.7k|}
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_110ReadScalarERmNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   94|    848|bool ReadScalar(uint64_t& out, absl::string_view value) {
   95|    848|  return absl::SimpleAtoi(value, &out);
   96|    848|}
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_110ReadScalarERdNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   98|  22.7k|bool ReadScalar(double& out, absl::string_view value) {
   99|  22.7k|  return absl::SimpleAtod(value, &out);
  100|  22.7k|}
serialization.cc:_ZN8fuzztest8internal12_GLOBAL__N_110ReadScalarERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EE:
  102|    381|bool ReadScalar(std::string& out, absl::string_view value) {
  103|    381|  if (value.empty() || value[0] != '"') return false;
  ------------------
  |  Branch (103:7): [True: 3, False: 378]
  |  Branch (103:24): [True: 0, False: 378]
  ------------------
  104|    378|  value.remove_prefix(1);
  105|       |
  106|    378|  if (value.empty() || value.back() != '"') return false;
  ------------------
  |  Branch (106:7): [True: 0, False: 378]
  |  Branch (106:24): [True: 0, False: 378]
  ------------------
  107|    378|  value.remove_suffix(1);
  108|       |
  109|  5.32k|  while (!value.empty()) {
  ------------------
  |  Branch (109:10): [True: 4.94k, False: 378]
  ------------------
  110|  4.94k|    if (value[0] != '\\') {
  ------------------
  |  Branch (110:9): [True: 4.94k, False: 1]
  ------------------
  111|  4.94k|      out += value[0];
  112|  4.94k|      value.remove_prefix(1);
  113|  4.94k|    } else {
  114|      1|      uint32_t v = 0;
  115|       |
  116|      1|      if (value.size() < 4) return false;
  ------------------
  |  Branch (116:11): [True: 0, False: 1]
  ------------------
  117|      4|      for (int i = 1; i < 4; ++i) {
  ------------------
  |  Branch (117:23): [True: 3, False: 1]
  ------------------
  118|      3|        if (value[i] < '0' || value[i] > '7') {
  ------------------
  |  Branch (118:13): [True: 0, False: 3]
  |  Branch (118:31): [True: 0, False: 3]
  ------------------
  119|      0|          return false;
  120|      0|        }
  121|      3|        v = 8 * v + value[i] - '0';
  122|      3|      }
  123|      1|      if (v > 255) return false;
  ------------------
  |  Branch (123:11): [True: 0, False: 1]
  ------------------
  124|       |
  125|      1|      out += static_cast<char>(v);
  126|      1|      value.remove_prefix(4);
  127|      1|    }
  128|  4.94k|  }
  129|    378|  return true;
  130|    378|}

_ZNK8fuzztest8internal6no_adl8IRObject4SubsEv:
  152|   129k|  std::optional<absl::Span<const IRObject>> Subs() const {
  153|   129k|    if (const auto* i = std::get_if<std::vector<IRObject>>(&value_)) {
  ------------------
  |  Branch (153:21): [True: 128k, False: 1.10k]
  ------------------
  154|   128k|      return *i;
  155|   128k|    }
  156|       |    // The empty vector is serialized the same way as the monostate: nothing.
  157|       |    // Handle that case too.
  158|  1.10k|    if (std::holds_alternative<std::monostate>(value_)) {
  ------------------
  |  Branch (158:9): [True: 8, False: 1.09k]
  ------------------
  159|      8|      return absl::Span<const IRObject>{};
  160|      8|    }
  161|  1.09k|    return std::nullopt;
  162|  1.10k|  }
_ZN8fuzztest8internal6no_adl8IRObject11MutableSubsEv:
  167|   117k|  std::vector<IRObject>& MutableSubs() {
  168|   117k|    if (!std::holds_alternative<std::vector<IRObject>>(value_)) {
  ------------------
  |  Branch (168:9): [True: 117k, False: 0]
  ------------------
  169|   117k|      value_.emplace<std::vector<IRObject>>();
  170|   117k|    }
  171|   117k|    return std::get<std::vector<IRObject>>(value_);
  172|   117k|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarImEEDav:
   99|   187k|  auto GetScalar() const {
  100|       |    if constexpr (std::is_enum_v<T>) {
  101|       |      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|       |      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  103|   187k|    } else if constexpr (std::is_integral_v<T>) {
  104|   187k|      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|   187k|      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  ------------------
  |  Branch (105:14): [True: 187k, False: 12]
  ------------------
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|   187k|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarIiEEDav:
   99|   124k|  auto GetScalar() const {
  100|       |    if constexpr (std::is_enum_v<T>) {
  101|       |      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|       |      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  103|   124k|    } else if constexpr (std::is_integral_v<T>) {
  104|   124k|      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|   124k|      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  ------------------
  |  Branch (105:14): [True: 124k, False: 9]
  ------------------
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|   124k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusIiEENSt3__18optionalIT_EEv:
  245|   124k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|   124k|    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|   124k|      if (auto v = GetScalar<T>()) {
  ------------------
  |  Branch (254:16): [True: 124k, False: 9]
  ------------------
  255|   124k|        return static_cast<T>(*v);
  256|   124k|      }
  257|      9|      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|       |    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|       |      auto elems = Subs();
  293|       |      if (!elems) return std::nullopt;
  294|       |
  295|       |      T out;
  296|       |      for (const auto& elem : *elems) {
  297|       |        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  298|       |          out.insert(out.end(), *std::move(inner));
  299|       |        } else {
  300|       |          return std::nullopt;
  301|       |        }
  302|       |      }
  303|       |      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|   124k|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarINS0_23ElementOfImplCorpusTypeEEEDav:
   99|   173k|  auto GetScalar() const {
  100|   173k|    if constexpr (std::is_enum_v<T>) {
  101|   173k|      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|   173k|      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  ------------------
  |  Branch (102:14): [True: 173k, False: 12]
  ------------------
  103|       |    } else if constexpr (std::is_integral_v<T>) {
  104|       |      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|   173k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusINS0_23ElementOfImplCorpusTypeEEENSt3__18optionalIT_EEv:
  245|   173k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|   173k|    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|   173k|      if (auto v = GetScalar<T>()) {
  ------------------
  |  Branch (254:16): [True: 173k, False: 12]
  ------------------
  255|   173k|        return static_cast<T>(*v);
  256|   173k|      }
  257|     12|      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|       |    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|       |      auto elems = Subs();
  293|       |      if (!elems) return std::nullopt;
  294|       |
  295|       |      T out;
  296|       |      for (const auto& elem : *elems) {
  297|       |        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  298|       |          out.insert(out.end(), *std::move(inner));
  299|       |        } else {
  300|       |          return std::nullopt;
  301|       |        }
  302|       |      }
  303|       |      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|   173k|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarIjEEDav:
   99|  13.8k|  auto GetScalar() const {
  100|       |    if constexpr (std::is_enum_v<T>) {
  101|       |      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|       |      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  103|  13.8k|    } else if constexpr (std::is_integral_v<T>) {
  104|  13.8k|      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|  13.8k|      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  ------------------
  |  Branch (105:14): [True: 13.8k, False: 3]
  ------------------
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|  13.8k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusIjEENSt3__18optionalIT_EEv:
  245|  13.8k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|  13.8k|    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|  13.8k|      if (auto v = GetScalar<T>()) {
  ------------------
  |  Branch (254:16): [True: 13.8k, False: 3]
  ------------------
  255|  13.8k|        return static_cast<T>(*v);
  256|  13.8k|      }
  257|      3|      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|       |    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|       |      auto elems = Subs();
  293|       |      if (!elems) return std::nullopt;
  294|       |
  295|       |      T out;
  296|       |      for (const auto& elem : *elems) {
  297|       |        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  298|       |          out.insert(out.end(), *std::move(inner));
  299|       |        } else {
  300|       |          return std::nullopt;
  301|       |        }
  302|       |      }
  303|       |      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|  13.8k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusINSt3__16vectorIhNS4_9allocatorIhEEEEEENS4_8optionalIT_EEv:
  245|  9.95k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|       |    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|       |      if (auto v = GetScalar<T>()) {
  255|       |        return static_cast<T>(*v);
  256|       |      }
  257|       |      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|  9.95k|    } else if constexpr (is_dynamic_container_v<T>) {
  282|  9.95k|      if constexpr (is_bytevector_v<T>) {
  283|  9.95k|        const std::string* v = std::get_if<std::string>(&value_);
  284|  9.95k|        if (v) {
  ------------------
  |  Branch (284:13): [True: 9.95k, False: 1]
  ------------------
  285|  9.95k|          T out;
  286|  9.95k|          out.resize(v->size());
  287|  9.95k|          std::memcpy(out.data(), v->data(), v->size());
  288|  9.95k|          return out;
  289|  9.95k|        }
  290|  9.95k|      }
  291|       |
  292|      1|      auto elems = Subs();
  293|  9.95k|      if (!elems) return std::nullopt;
  ------------------
  |  Branch (293:11): [True: 0, False: 9.95k]
  ------------------
  294|       |
  295|  9.95k|      T out;
  296|  9.95k|      for (const auto& elem : *elems) {
  ------------------
  |  Branch (296:29): [True: 0, False: 9.95k]
  ------------------
  297|      0|        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  ------------------
  |  Branch (297:18): [True: 0, False: 0]
  ------------------
  298|      0|          out.insert(out.end(), *std::move(inner));
  299|      0|        } else {
  300|      0|          return std::nullopt;
  301|      0|        }
  302|      0|      }
  303|  9.95k|      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|  9.95k|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarItEEDav:
   99|  35.1M|  auto GetScalar() const {
  100|       |    if constexpr (std::is_enum_v<T>) {
  101|       |      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|       |      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  103|  35.1M|    } else if constexpr (std::is_integral_v<T>) {
  104|  35.1M|      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|  35.1M|      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  ------------------
  |  Branch (105:14): [True: 35.1M, False: 6]
  ------------------
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|  35.1M|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusItEENSt3__18optionalIT_EEv:
  245|  35.1M|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|  35.1M|    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|  35.1M|      if (auto v = GetScalar<T>()) {
  ------------------
  |  Branch (254:16): [True: 35.1M, False: 6]
  ------------------
  255|  35.1M|        return static_cast<T>(*v);
  256|  35.1M|      }
  257|      6|      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|       |    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|       |      auto elems = Subs();
  293|       |      if (!elems) return std::nullopt;
  294|       |
  295|       |      T out;
  296|       |      for (const auto& elem : *elems) {
  297|       |        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  298|       |          out.insert(out.end(), *std::move(inner));
  299|       |        } else {
  300|       |          return std::nullopt;
  301|       |        }
  302|       |      }
  303|       |      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|  35.1M|  }
_ZNK8fuzztest8internal6no_adl8IRObject9GetScalarIbEEDav:
   99|  69.2k|  auto GetScalar() const {
  100|       |    if constexpr (std::is_enum_v<T>) {
  101|       |      auto inner = GetScalar<std::underlying_type_t<T>>();
  102|       |      return inner ? std::optional(static_cast<T>(*inner)) : std::nullopt;
  103|  69.2k|    } else if constexpr (std::is_integral_v<T>) {
  104|  69.2k|      const uint64_t* i = std::get_if<uint64_t>(&value_);
  105|  69.2k|      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  ------------------
  |  Branch (105:14): [True: 69.2k, False: 8]
  ------------------
  106|       |    } else if constexpr (std::is_same_v<float, T> ||
  107|       |                         std::is_same_v<double, T>) {
  108|       |      const double* i = std::get_if<double>(&value_);
  109|       |      return i != nullptr ? std::optional(static_cast<T>(*i)) : std::nullopt;
  110|       |    } else if constexpr (std::is_same_v<std::string, T>) {
  111|       |      std::optional<absl::string_view> out;
  112|       |      if (const auto* s = std::get_if<std::string>(&value_)) {
  113|       |        out = *s;
  114|       |      }
  115|       |      return out;
  116|       |    }
  117|  69.2k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusIbEENSt3__18optionalIT_EEv:
  245|  69.2k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|  69.2k|    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|  69.2k|      if (auto v = GetScalar<T>()) {
  ------------------
  |  Branch (254:16): [True: 69.2k, False: 8]
  ------------------
  255|  69.2k|        return static_cast<T>(*v);
  256|  69.2k|      }
  257|      8|      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|       |    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|       |      auto elems = Subs();
  293|       |      if (!elems) return std::nullopt;
  294|       |
  295|       |      T out;
  296|       |      for (const auto& elem : *elems) {
  297|       |        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  298|       |          out.insert(out.end(), *std::move(inner));
  299|       |        } else {
  300|       |          return std::nullopt;
  301|       |        }
  302|       |      }
  303|       |      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|  69.2k|  }
_ZNK8fuzztest8internal6no_adl8IRObject8ToCorpusINSt3__16vectorItNS4_9allocatorItEEEEEENS4_8optionalIT_EEv:
  245|  3.88k|  std::optional<T> ToCorpus() const {
  246|       |    if constexpr (std::is_const_v<T>) {
  247|       |      return ToCorpus<std::remove_const_t<T>>();
  248|       |    } else if constexpr (is_monostate_v<T>) {
  249|       |      if (std::holds_alternative<std::monostate>(value_)) return T{};
  250|       |      return std::nullopt;
  251|       |    } else if constexpr (std::is_same_v<T, IRObject>) {
  252|       |      return *this;
  253|       |    } else if constexpr (std::is_constructible_v<IRObject, T>) {
  254|       |      if (auto v = GetScalar<T>()) {
  255|       |        return static_cast<T>(*v);
  256|       |      }
  257|       |      return std::nullopt;
  258|       |    } else if constexpr (is_variant_v<T>) {
  259|       |      auto elems = Subs();
  260|       |      if (!elems || elems->size() != 2) return std::nullopt;
  261|       |      auto index = (*elems)[0].ToCorpus<size_t>();
  262|       |      if (!index || *index >= std::variant_size_v<T>) return std::nullopt;
  263|       |      return Switch<std::variant_size_v<T>>(
  264|       |          *index, [&](auto I) -> std::optional<T> {
  265|       |            auto inner =
  266|       |                (*elems)[1].ToCorpus<std::variant_alternative_t<I, T>>();
  267|       |            if (inner) return T(std::in_place_index<I>, *std::move(inner));
  268|       |            return std::nullopt;
  269|       |          });
  270|       |    } else if constexpr (std::is_same_v<T, absl::int128> ||
  271|       |                         std::is_same_v<T, absl::uint128>) {
  272|       |      if (auto res = ToCorpus<std::pair<uint64_t, uint64_t>>()) {
  273|       |        return static_cast<T>(absl::MakeUint128(res->first, res->second));
  274|       |      }
  275|       |      return std::nullopt;
  276|       |    } else if constexpr (is_protocol_buffer_v<T>) {
  277|       |      const std::string* v = std::get_if<std::string>(&value_);
  278|       |      T out;
  279|       |      if (v && out.ParseFromString(*v)) return out;
  280|       |      return std::nullopt;
  281|  3.88k|    } else if constexpr (is_dynamic_container_v<T>) {
  282|       |      if constexpr (is_bytevector_v<T>) {
  283|       |        const std::string* v = std::get_if<std::string>(&value_);
  284|       |        if (v) {
  285|       |          T out;
  286|       |          out.resize(v->size());
  287|       |          std::memcpy(out.data(), v->data(), v->size());
  288|       |          return out;
  289|       |        }
  290|       |      }
  291|       |
  292|  3.88k|      auto elems = Subs();
  293|  3.88k|      if (!elems) return std::nullopt;
  ------------------
  |  Branch (293:11): [True: 0, False: 3.88k]
  ------------------
  294|       |
  295|  3.88k|      T out;
  296|  35.1M|      for (const auto& elem : *elems) {
  ------------------
  |  Branch (296:29): [True: 35.1M, False: 3.88k]
  ------------------
  297|  35.1M|        if (auto inner = elem.ToCorpus<typename T::value_type>()) {
  ------------------
  |  Branch (297:18): [True: 35.1M, False: 1]
  ------------------
  298|  35.1M|          out.insert(out.end(), *std::move(inner));
  299|  35.1M|        } else {
  300|      1|          return std::nullopt;
  301|      1|        }
  302|  35.1M|      }
  303|  3.88k|      return out;
  304|       |    } else {
  305|       |      // Must be a tuple like object.
  306|       |      auto elems = Subs();
  307|       |      if (!elems || elems->size() != std::tuple_size_v<T>) return std::nullopt;
  308|       |      auto it = elems->begin();
  309|       |      auto parts = ApplyIndex<std::tuple_size_v<T>>([&](auto... I) {
  310|       |        return std::tuple{it++->ToCorpus<std::tuple_element_t<I, T>>()...};
  311|       |      });
  312|       |      return std::apply(
  313|       |          [&](auto&... part) -> std::optional<T> {
  314|       |            if ((!part || ...)) return std::nullopt;
  315|       |            return T{*std::move(part)...};
  316|       |          },
  317|       |          parts);
  318|       |    }
  319|  3.88k|  }
_ZN8fuzztest8internal6no_adl8IRObjectC2Ev:
   75|  35.7M|  IRObject() = default;
_ZN8fuzztest8internal6no_adl8IRObject13MutableScalarImEERDav:
  141|  35.5M|  auto& MutableScalar() {
  142|       |    if constexpr (is_monostate_v<T>) {
  143|       |      static_assert(always_false<T>, "Invalid type");
  144|       |    }
  145|  35.5M|    if (!std::holds_alternative<T>(value_)) {
  ------------------
  |  Branch (145:9): [True: 35.5M, False: 0]
  ------------------
  146|  35.5M|      value_.emplace<T>();
  147|  35.5M|    }
  148|  35.5M|    return std::get<T>(value_);
  149|  35.5M|  }
_ZN8fuzztest8internal6no_adl8IRObject13MutableScalarIdEERDav:
  141|  22.7k|  auto& MutableScalar() {
  142|       |    if constexpr (is_monostate_v<T>) {
  143|       |      static_assert(always_false<T>, "Invalid type");
  144|       |    }
  145|  22.7k|    if (!std::holds_alternative<T>(value_)) {
  ------------------
  |  Branch (145:9): [True: 22.7k, False: 0]
  ------------------
  146|  22.7k|      value_.emplace<T>();
  147|  22.7k|    }
  148|  22.7k|    return std::get<T>(value_);
  149|  22.7k|  }
_ZN8fuzztest8internal6no_adl8IRObject13MutableScalarINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEERDav:
  141|  10.3k|  auto& MutableScalar() {
  142|       |    if constexpr (is_monostate_v<T>) {
  143|       |      static_assert(always_false<T>, "Invalid type");
  144|       |    }
  145|  10.3k|    if (!std::holds_alternative<T>(value_)) {
  ------------------
  |  Branch (145:9): [True: 10.3k, False: 0]
  ------------------
  146|  10.3k|      value_.emplace<T>();
  147|  10.3k|    }
  148|  10.3k|    return std::get<T>(value_);
  149|  10.3k|  }

_Z10SetMessageRKN4absl12lts_202605266StatusENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
    8|    115|absl::Status SetMessage(const absl::Status& status, absl::string_view message) {
    9|    115|  absl::Status result(status.code(), message);
   10|    115|  status.ForEachPayload(
   11|    115|      [&](absl::string_view type_url, const absl::Cord& payload) {
   12|    115|        result.SetPayload(type_url, payload);
   13|    115|      });
   14|    115|  return result;
   15|    115|}
_Z6PrefixRKN4absl12lts_202605266StatusENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
   17|   564k|absl::Status Prefix(const absl::Status& status, absl::string_view prefix) {
   18|   564k|  if (status.ok() || prefix.empty()) return status;
  ------------------
  |  Branch (18:7): [True: 564k, False: 115]
  |  Branch (18:22): [True: 0, False: 115]
  ------------------
   19|    115|  return SetMessage(status, absl::StrCat(prefix, " >> ", status.message()));
   20|   564k|}

_ZNK8fuzztest8internal15IntegralPrinter14PrintUserValueEN4absl12lts_202605267uint128ENS3_13FormatRawSinkENS_18domain_implementor9PrintModeE:
   60|     15|                                     PrintMode) const {
   61|     15|  absl::Format(out, "%d", v);
   62|     15|}
_ZNK8fuzztest8internal15IntegralPrinter14PrintUserValueEN4absl12lts_202605266int128ENS3_13FormatRawSinkENS_18domain_implementor9PrintModeE:
   65|     21|                                     PrintMode) const {
   66|     21|  absl::Format(out, "%d", v);
   67|     21|}

_ZNK8fuzztest8internal15IntegralPrinter14PrintUserValueIiEEvT_N4absl12lts_2026052613FormatRawSinkENS_18domain_implementor9PrintModeE:
  141|     21|                      domain_implementor::PrintMode mode) const {
  142|       |    if constexpr (std::is_enum_v<T>) {
  143|       |      // TODO(sbenzaquen): Try to use enum labels where possible.
  144|       |      // Use static_cast<> when printing source code to avoid init conversion.
  145|       |      switch (mode) {
  146|       |        case domain_implementor::PrintMode::kHumanReadable:
  147|       |          absl::Format(out, "%s{", GetTypeName<T>());
  148|       |          break;
  149|       |        case domain_implementor::PrintMode::kSourceCode:
  150|       |          absl::Format(out, "static_cast<%s>(", GetTypeName<T>());
  151|       |          break;
  152|       |      }
  153|       |      PrintUserValue(static_cast<std::underlying_type_t<T>>(v), out, mode);
  154|       |      switch (mode) {
  155|       |        case domain_implementor::PrintMode::kHumanReadable:
  156|       |          absl::Format(out, "}");
  157|       |          break;
  158|       |        case domain_implementor::PrintMode::kSourceCode:
  159|       |          absl::Format(out, ")");
  160|       |          break;
  161|       |      }
  162|     21|    } else if constexpr (std::is_signed_v<T>) {
  163|       |      // Cast to [u]int128 to cover all integral types.
  164|     21|      PrintUserValue(static_cast<absl::int128>(v), out, mode);
  165|       |    } else {
  166|       |      PrintUserValue(static_cast<absl::uint128>(v), out, mode);
  167|       |    }
  168|     21|  }
_ZNK8fuzztest8internal15IntegralPrinter14PrintUserValueItEEvT_N4absl12lts_2026052613FormatRawSinkENS_18domain_implementor9PrintModeE:
  141|     15|                      domain_implementor::PrintMode mode) const {
  142|       |    if constexpr (std::is_enum_v<T>) {
  143|       |      // TODO(sbenzaquen): Try to use enum labels where possible.
  144|       |      // Use static_cast<> when printing source code to avoid init conversion.
  145|       |      switch (mode) {
  146|       |        case domain_implementor::PrintMode::kHumanReadable:
  147|       |          absl::Format(out, "%s{", GetTypeName<T>());
  148|       |          break;
  149|       |        case domain_implementor::PrintMode::kSourceCode:
  150|       |          absl::Format(out, "static_cast<%s>(", GetTypeName<T>());
  151|       |          break;
  152|       |      }
  153|       |      PrintUserValue(static_cast<std::underlying_type_t<T>>(v), out, mode);
  154|       |      switch (mode) {
  155|       |        case domain_implementor::PrintMode::kHumanReadable:
  156|       |          absl::Format(out, "}");
  157|       |          break;
  158|       |        case domain_implementor::PrintMode::kSourceCode:
  159|       |          absl::Format(out, ")");
  160|       |          break;
  161|       |      }
  162|       |    } else if constexpr (std::is_signed_v<T>) {
  163|       |      // Cast to [u]int128 to cover all integral types.
  164|       |      PrintUserValue(static_cast<absl::int128>(v), out, mode);
  165|     15|    } else {
  166|     15|      PrintUserValue(static_cast<absl::uint128>(v), out, mode);
  167|     15|    }
  168|     15|  }

_ZN7testing15AssertionResultC2IbEERKT_PNSt3__19enable_ifIXntsr3std14is_convertibleIS2_S0_EE5valueEvE4typeE:
  168|   450k|      : success_(success) {}

_ZN7testing7MessagelsIKcEERS0_RKPT_:
  181|     44|  inline Message& operator<<(T* const& pointer) {  // NOLINT
  182|     44|    if (pointer == nullptr) {
  ------------------
  |  Branch (182:9): [True: 0, False: 44]
  ------------------
  183|      0|      *ss_ << "(null)";
  184|     44|    } else {
  185|     44|      *ss_ << pointer;
  186|     44|    }
  187|     44|    return *this;
  188|     44|  }
_ZN7testing8internal18StreamableToStringIiEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKT_:
  242|      6|std::string StreamableToString(const T& streamable) {
  243|      6|  return (Message() << streamable).GetString();
  244|      6|}
_ZN7testing7MessagelsIiEERS0_RKT_:
  132|      6|  inline Message& operator<<(const T& val) {
  133|       |        // Some libraries overload << for STL containers.  These
  134|       |    // overloads are defined in the global namespace instead of ::std.
  135|       |    //
  136|       |    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  137|       |    // overloads are visible in either the std namespace or the global
  138|       |    // namespace, but not other namespaces, including the testing
  139|       |    // namespace which Google Test's Message class is in.
  140|       |    //
  141|       |    // To allow STL containers (and other types that has a << operator
  142|       |    // defined in the global namespace) to be used in Google Test
  143|       |    // assertions, testing::Message must access the custom << operator
  144|       |    // from the global namespace.  With this using declaration,
  145|       |    // overloads of << defined in the global namespace and those
  146|       |    // visible via Koenig lookup are both exposed in this function.
  147|      6|    using ::operator<<;
  148|      6|    *ss_ << val;
  149|      6|    return *this;
  150|      6|  }
_ZN7testing7MessagelsIA7_cEERS0_RKT_:
  132|     44|  inline Message& operator<<(const T& val) {
  133|       |        // Some libraries overload << for STL containers.  These
  134|       |    // overloads are defined in the global namespace instead of ::std.
  135|       |    //
  136|       |    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  137|       |    // overloads are visible in either the std namespace or the global
  138|       |    // namespace, but not other namespaces, including the testing
  139|       |    // namespace which Google Test's Message class is in.
  140|       |    //
  141|       |    // To allow STL containers (and other types that has a << operator
  142|       |    // defined in the global namespace) to be used in Google Test
  143|       |    // assertions, testing::Message must access the custom << operator
  144|       |    // from the global namespace.  With this using declaration,
  145|       |    // overloads of << defined in the global namespace and those
  146|       |    // visible via Koenig lookup are both exposed in this function.
  147|     44|    using ::operator<<;
  148|     44|    *ss_ << val;
  149|     44|    return *this;
  150|     44|  }
_ZN7testing7MessagelsIcEERS0_RKT_:
  132|    884|  inline Message& operator<<(const T& val) {
  133|       |        // Some libraries overload << for STL containers.  These
  134|       |    // overloads are defined in the global namespace instead of ::std.
  135|       |    //
  136|       |    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
  137|       |    // overloads are visible in either the std namespace or the global
  138|       |    // namespace, but not other namespaces, including the testing
  139|       |    // namespace which Google Test's Message class is in.
  140|       |    //
  141|       |    // To allow STL containers (and other types that has a << operator
  142|       |    // defined in the global namespace) to be used in Google Test
  143|       |    // assertions, testing::Message must access the custom << operator
  144|       |    // from the global namespace.  With this using declaration,
  145|       |    // overloads of << defined in the global namespace and those
  146|       |    // visible via Koenig lookup are both exposed in this function.
  147|    884|    using ::operator<<;
  148|    884|    *ss_ << val;
  149|    884|    return *this;
  150|    884|  }
_ZN7testing8internal18StreamableToStringIPcEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKT_:
  242|     32|std::string StreamableToString(const T& streamable) {
  243|     32|  return (Message() << streamable).GetString();
  244|     32|}
_ZN7testing7MessagelsIcEERS0_RKPT_:
  181|     32|  inline Message& operator<<(T* const& pointer) {  // NOLINT
  182|     32|    if (pointer == nullptr) {
  ------------------
  |  Branch (182:9): [True: 0, False: 32]
  ------------------
  183|      0|      *ss_ << "(null)";
  184|     32|    } else {
  185|     32|      *ss_ << pointer;
  186|     32|    }
  187|     32|    return *this;
  188|     32|  }

_ZNK7testing8TestInfo15test_suite_nameEv:
  540|      2|  const char* test_suite_name() const { return test_suite_name_.c_str(); }
_ZNK7testing8TestInfo4nameEv:
  548|      6|  const char* name() const { return name_.c_str(); }
_ZN7testing8UnitTest4implEv:
 1280|     50|  internal::UnitTestImpl* impl() { return impl_; }
_ZNK7testing12TestProperty3keyEv:
  378|      4|  const char* key() const { return key_.c_str(); }
_ZNK7testing9TestSuite14test_info_listEv:
  761|      2|  const std::vector<TestInfo*>& test_info_list() const {
  762|      2|    return test_info_list_;
  763|      2|  }
_ZN7testing10TestResult19set_start_timestampEl:
  467|      2|  void set_start_timestamp(TimeInMillis start) { start_timestamp_ = start; }
_ZNK7testing8TestInfo4fileEv:
  565|      4|  const char* file() const { return location_.file.c_str(); }
_ZNK7testing8TestInfo4lineEv:
  568|      4|  int line() const { return location_.line; }
_ZN7testing9TestSuite13ShouldRunTestEPKNS_8TestInfoE:
  838|      8|  static bool ShouldRunTest(const TestInfo* test_info) {
  839|      8|    return test_info->should_run();
  840|      8|  }
_ZN7testing9TestSuite17RunSetUpTestSuiteEv:
  792|      2|  void RunSetUpTestSuite() {
  793|      2|    if (set_up_tc_ != nullptr) {
  ------------------
  |  Branch (793:9): [True: 0, False: 2]
  ------------------
  794|      0|      (*set_up_tc_)();
  795|      0|    }
  796|      2|  }
_ZNK7testing9TestSuite18ad_hoc_test_resultEv:
  751|      4|  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
_ZN7testing8TestInfo15ClearTestResultEPS0_:
  638|      4|  static void ClearTestResult(TestInfo* test_info) {
  639|      4|    test_info->result_.Clear();
  640|      4|  }
_ZNK7testing9TestSuite4nameEv:
  694|      2|  const char* name() const { return name_.c_str(); }
_ZNK7testing9TestSuite10type_paramEv:
  698|      2|  const char* type_param() const {
  699|      2|    if (type_param_ != nullptr) return type_param_->c_str();
  ------------------
  |  Branch (699:9): [True: 0, False: 2]
  ------------------
  700|      2|    return nullptr;
  701|      2|  }
_ZNK7testing9TestSuite10should_runEv:
  704|      6|  bool should_run() const { return should_run_; }
_ZNK7testing8TestInfo10should_runEv:
  589|      8|  bool should_run() const { return should_run_; }
_ZNK7testing8TestInfo10type_paramEv:
  552|      4|  const char* type_param() const {
  553|      4|    if (type_param_ != nullptr) return type_param_->c_str();
  ------------------
  |  Branch (553:9): [True: 0, False: 4]
  ------------------
  554|      4|    return nullptr;
  555|      4|  }
_ZNK7testing8UnitTest4implEv:
 1281|     18|  const internal::UnitTestImpl* impl() const { return impl_; }
_ZN7testing12TestPropertyC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  375|      2|      : key_(a_key), value_(a_value) {}
_ZN7testing9TestSuite20ClearTestSuiteResultEPS0_:
  780|      2|  static void ClearTestSuiteResult(TestSuite* test_suite) {
  781|      2|    test_suite->ClearResult();
  782|      2|  }
_ZN7testing9TestSuite14set_should_runEb:
  770|      6|  void set_should_run(bool should) { should_run_ = should; }
_ZN7testing9TestSuite14test_info_listEv:
  758|      2|  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
_ZN7testing17TestEventListener16OnTestSuiteStartERKNS_9TestSuiteE:
  945|      2|  virtual void OnTestSuiteStart(const TestSuite& /*test_suite*/) {}

_ZN7testing8internal8FilePathC2ENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   76|      2|  explicit FilePath(std::string pathname) : pathname_(std::move(pathname)) {
   77|      2|    Normalize();
   78|      2|  }
_ZNK7testing8internal8FilePath7IsEmptyEv:
  124|      6|  bool IsEmpty() const { return pathname_.empty(); }
_ZN7testing8internal8FilePathC2Ev:
   72|      2|  FilePath() : pathname_("") {}
_ZN7testing8internal8FilePathaSEOS1_:
   84|      2|  FilePath& operator=(FilePath&& rhs) noexcept {
   85|      2|    pathname_ = std::move(rhs.pathname_);
   86|      2|    return *this;
   87|      2|  }

_ZN7testing8internal6RandomC2Ej:
  845|      2|  explicit Random(uint32_t seed) : state_(seed) {}
_ZN7testing8internal9GetTypeIdINS_4TestEEEPKvv:
  410|      2|TypeId GetTypeId() {
  411|       |  // The compiler is required to allocate a different
  412|       |  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
  413|       |  // the template.  Therefore, the address of dummy_ is guaranteed to
  414|       |  // be unique.
  415|      2|  return &(TypeIdHelper<T>::dummy_);
  416|      2|}

_ZN7testing8internal30ParameterizedTestSuiteRegistry13RegisterTestsEv:
  734|      2|  void RegisterTests() {
  735|      2|    for (auto& test_suite_info : test_suite_infos_) {
  ------------------
  |  Branch (735:32): [True: 0, False: 2]
  ------------------
  736|      0|      test_suite_info->RegisterTests();
  737|      0|    }
  738|      2|  }
_ZN7testing8internal30ParameterizedTestSuiteRegistryC2Ev:
  693|      2|  ParameterizedTestSuiteRegistry() = default;

_ZN7testing8internal7ToUpperEc:
 1979|    884|inline char ToUpper(char ch) {
 1980|    884|  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
 1981|    884|}
_ZN7testing8internal5posix6GetEnvEPKc:
 2138|     64|inline const char* GetEnv(const char* name) {
 2139|       |#if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \
 2140|       |    defined(GTEST_OS_ESP8266) || defined(GTEST_OS_XTENSA) ||               \
 2141|       |    defined(GTEST_OS_QURT)
 2142|       |  // We are on an embedded platform, which has no environment variables.
 2143|       |  static_cast<void>(name);  // To prevent 'unused argument' warning.
 2144|       |  return nullptr;
 2145|       |#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
 2146|       |  // Environment variables which we programmatically clear will be set to the
 2147|       |  // empty string rather than unset (NULL).  Handle that case.
 2148|       |  const char* const env = getenv(name);
 2149|       |  return (env != nullptr && env[0] != '\0') ? env : nullptr;
 2150|       |#else
 2151|     64|  return getenv(name);
 2152|     64|#endif
 2153|     64|}
_ZN7testing8internal14GTestMutexLockC2EPNS0_9MutexBaseE:
 1732|      6|  explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->Lock(); }
_ZN7testing8internal9MutexBase4LockEv:
 1657|      6|  void Lock() {
 1658|      6|    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
  ------------------
  |  | 1100|      6|  if (const int gtest_error = (posix_call))    \
  |  |  ------------------
  |  |  |  Branch (1100:17): [True: 0, False: 6]
  |  |  ------------------
  |  | 1101|      6|  GTEST_LOG_(FATAL) << #posix_call << "failed with error " << gtest_error
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 1659|      6|    owner_ = pthread_self();
 1660|      6|    has_owner_ = true;
 1661|      6|  }
_ZN7testing8internal14GTestMutexLockD2Ev:
 1734|      6|  ~GTestMutexLock() { mutex_->Unlock(); }
_ZN7testing8internal9MutexBase6UnlockEv:
 1664|      6|  void Unlock() {
 1665|       |    // Since the lock is being released the owner_ field should no longer be
 1666|       |    // considered valid. We don't protect writing to has_owner_ here, as it's
 1667|       |    // the caller's responsibility to ensure that the current thread holds the
 1668|       |    // mutex when this is called.
 1669|      6|    has_owner_ = false;
 1670|      6|    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
  ------------------
  |  | 1100|      6|  if (const int gtest_error = (posix_call))    \
  |  |  ------------------
  |  |  |  Branch (1100:17): [True: 0, False: 6]
  |  |  ------------------
  |  | 1101|      6|  GTEST_LOG_(FATAL) << #posix_call << "failed with error " << gtest_error
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 1671|      6|  }
_ZN7testing8internal5posix10StrCaseCmpEPKcS3_:
 2074|      2|inline int StrCaseCmp(const char* s1, const char* s2) {
 2075|      2|  return strcasecmp(s1, s2);
 2076|      2|}
_ZN7testing8internal5MutexC2Ev:
 1714|     12|  Mutex() {
 1715|     12|    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, nullptr));
  ------------------
  |  | 1100|     12|  if (const int gtest_error = (posix_call))    \
  |  |  ------------------
  |  |  |  Branch (1100:17): [True: 0, False: 12]
  |  |  ------------------
  |  | 1101|     12|  GTEST_LOG_(FATAL) << #posix_call << "failed with error " << gtest_error
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 1716|     12|    has_owner_ = false;
 1717|     12|  }
_ZN7testing8internal5posix6IsATTYEi:
 2080|      2|inline int IsATTY(int fd) {
 2081|       |  // DoIsATTY might change errno (for example ENOTTY in case you redirect stdout
 2082|       |  // to a file on Linux), which is unexpected, so save the previous value, and
 2083|       |  // restore it after the call.
 2084|      2|  int savedErrno = errno;
 2085|      2|  int isAttyValue = DoIsATTY(fd);
 2086|      2|  errno = savedErrno;
 2087|       |
 2088|      2|  return isAttyValue;
 2089|      2|}
_ZN7testing8internal5posix8DoIsATTYEi:
 2073|      2|inline int DoIsATTY(int fd) { return isatty(fd); }
_ZN7testing8internal5posix6FileNoEP8_IO_FILE:
 2035|      2|inline int FileNo(FILE* file) { return fileno(file); }
_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEEC2ERKS3_:
 1769|      2|      : key_(CreateKey()),
 1770|      2|        default_factory_(new InstanceValueHolderFactory(value)) {}
_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv:
 1801|      2|  static pthread_key_t CreateKey() {
 1802|      2|    pthread_key_t key;
 1803|       |    // When a thread exits, DeleteThreadLocalValue() will be called on
 1804|       |    // the object managed for that thread.
 1805|      2|    GTEST_CHECK_POSIX_SUCCESS_(
  ------------------
  |  | 1100|      2|  if (const int gtest_error = (posix_call))    \
  |  |  ------------------
  |  |  |  Branch (1100:17): [True: 0, False: 2]
  |  |  ------------------
  |  | 1101|      2|  GTEST_LOG_(FATAL) << #posix_call << "failed with error " << gtest_error
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 1806|      2|        pthread_key_create(&key, &DeleteThreadLocalValue));
 1807|      2|    return key;
 1808|      2|  }
_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE26InstanceValueHolderFactoryC2ERKS3_:
 1847|      2|    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE18ValueHolderFactoryC2Ev:
 1825|      2|    ValueHolderFactory() = default;
_ZN7testing8internal11ThreadLocalINSt3__16vectorINS0_9TraceInfoENS2_9allocatorIS4_EEEEEC2Ev:
 1767|      2|      : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
_ZN7testing8internal11ThreadLocalINSt3__16vectorINS0_9TraceInfoENS2_9allocatorIS4_EEEEE9CreateKeyEv:
 1801|      2|  static pthread_key_t CreateKey() {
 1802|      2|    pthread_key_t key;
 1803|       |    // When a thread exits, DeleteThreadLocalValue() will be called on
 1804|       |    // the object managed for that thread.
 1805|      2|    GTEST_CHECK_POSIX_SUCCESS_(
  ------------------
  |  | 1100|      2|  if (const int gtest_error = (posix_call))    \
  |  |  ------------------
  |  |  |  Branch (1100:17): [True: 0, False: 2]
  |  |  ------------------
  |  | 1101|      2|  GTEST_LOG_(FATAL) << #posix_call << "failed with error " << gtest_error
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 1806|      2|        pthread_key_create(&key, &DeleteThreadLocalValue));
 1807|      2|    return key;
 1808|      2|  }
_ZN7testing8internal11ThreadLocalINSt3__16vectorINS0_9TraceInfoENS2_9allocatorIS4_EEEEE25DefaultValueHolderFactoryC2Ev:
 1836|      2|    DefaultValueHolderFactory() = default;
_ZN7testing8internal11ThreadLocalINSt3__16vectorINS0_9TraceInfoENS2_9allocatorIS4_EEEEE18ValueHolderFactoryC2Ev:
 1825|      2|    ValueHolderFactory() = default;

_ZN7testing16AssertionSuccessEv:
   66|   450k|AssertionResult AssertionSuccess() { return AssertionResult(true); }

_ZN7testing8internal29ParseInternalRunDeathTestFlagEv:
 1533|      2|InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
 1534|      2|  if (GTEST_FLAG_GET(internal_run_death_test).empty()) return nullptr;
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  |  Branch (1534:7): [True: 2, False: 0]
  ------------------
 1535|       |
 1536|       |  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
 1537|       |  // can use it here.
 1538|      0|  int line = -1;
 1539|      0|  int index = -1;
 1540|      0|  ::std::vector< ::std::string> fields;
 1541|      0|  SplitString(GTEST_FLAG_GET(internal_run_death_test), '|', &fields);
  ------------------
  |  | 2310|      0|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 1542|      0|  int write_fd = -1;
 1543|       |
 1544|       |#ifdef GTEST_OS_WINDOWS
 1545|       |
 1546|       |  unsigned int parent_process_id = 0;
 1547|       |  size_t write_handle_as_size_t = 0;
 1548|       |  size_t event_handle_as_size_t = 0;
 1549|       |
 1550|       |  if (fields.size() != 6 || !ParseNaturalNumber(fields[1], &line) ||
 1551|       |      !ParseNaturalNumber(fields[2], &index) ||
 1552|       |      !ParseNaturalNumber(fields[3], &parent_process_id) ||
 1553|       |      !ParseNaturalNumber(fields[4], &write_handle_as_size_t) ||
 1554|       |      !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
 1555|       |    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
 1556|       |                   GTEST_FLAG_GET(internal_run_death_test));
 1557|       |  }
 1558|       |  write_fd = GetStatusFileDescriptor(parent_process_id, write_handle_as_size_t,
 1559|       |                                     event_handle_as_size_t);
 1560|       |
 1561|       |#elif defined(GTEST_OS_FUCHSIA)
 1562|       |
 1563|       |  if (fields.size() != 3 || !ParseNaturalNumber(fields[1], &line) ||
 1564|       |      !ParseNaturalNumber(fields[2], &index)) {
 1565|       |    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
 1566|       |                   GTEST_FLAG_GET(internal_run_death_test));
 1567|       |  }
 1568|       |
 1569|       |#else
 1570|       |
 1571|      0|  if (fields.size() != 4 || !ParseNaturalNumber(fields[1], &line) ||
  ------------------
  |  Branch (1571:7): [True: 0, False: 0]
  |  Branch (1571:29): [True: 0, False: 0]
  ------------------
 1572|      0|      !ParseNaturalNumber(fields[2], &index) ||
  ------------------
  |  Branch (1572:7): [True: 0, False: 0]
  ------------------
 1573|      0|      !ParseNaturalNumber(fields[3], &write_fd)) {
  ------------------
  |  Branch (1573:7): [True: 0, False: 0]
  ------------------
 1574|      0|    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
 1575|      0|                   GTEST_FLAG_GET(internal_run_death_test));
  ------------------
  |  | 2310|      0|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 1576|      0|  }
 1577|       |
 1578|      0|#endif  // GTEST_OS_WINDOWS
 1579|       |
 1580|      0|  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
 1581|      2|}

_ZN7testing8internal8FilePath13GetCurrentDirEv:
  101|      2|FilePath FilePath::GetCurrentDir() {
  102|       |#if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \
  103|       |    defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_ESP8266) ||           \
  104|       |    defined(GTEST_OS_ESP32) || defined(GTEST_OS_XTENSA) ||                 \
  105|       |    defined(GTEST_OS_QURT) || defined(GTEST_OS_NXP_QN9090) ||              \
  106|       |    defined(GTEST_OS_NRF52)
  107|       |  // These platforms do not have a current directory, so we just return
  108|       |  // something reasonable.
  109|       |  return FilePath(kCurrentDirectoryString);
  110|       |#elif defined(GTEST_OS_WINDOWS)
  111|       |  char cwd[GTEST_PATH_MAX_ + 1] = {'\0'};
  112|       |  return FilePath(_getcwd(cwd, sizeof(cwd)) == nullptr ? "" : cwd);
  113|       |#else
  114|      2|  char cwd[GTEST_PATH_MAX_ + 1] = {'\0'};
  115|      2|  char* result = getcwd(cwd, sizeof(cwd));
  116|       |#ifdef GTEST_OS_NACL
  117|       |  // getcwd will likely fail in NaCl due to the sandbox, so return something
  118|       |  // reasonable. The user may have provided a shim implementation for getcwd,
  119|       |  // however, so fallback only when failure is detected.
  120|       |  return FilePath(result == nullptr ? kCurrentDirectoryString : cwd);
  121|       |#endif  // GTEST_OS_NACL
  122|      2|  return FilePath(result == nullptr ? "" : cwd);
  ------------------
  |  Branch (122:19): [True: 0, False: 2]
  ------------------
  123|      2|#endif  // GTEST_OS_WINDOWS_MOBILE
  124|      2|}
_ZN7testing8internal8FilePath9NormalizeEv:
  386|      2|void FilePath::Normalize() {
  387|      2|  auto out = pathname_.begin();
  388|       |
  389|      2|  auto i = pathname_.cbegin();
  390|       |#ifdef GTEST_OS_WINDOWS
  391|       |  // UNC paths are treated specially
  392|       |  if (pathname_.end() - i >= 3 && IsPathSeparator(*i) &&
  393|       |      IsPathSeparator(*(i + 1)) && !IsPathSeparator(*(i + 2))) {
  394|       |    *(out++) = kPathSeparator;
  395|       |    *(out++) = kPathSeparator;
  396|       |  }
  397|       |#endif
  398|     82|  while (i != pathname_.end()) {
  ------------------
  |  Branch (398:10): [True: 80, False: 2]
  ------------------
  399|     80|    const char character = *i;
  400|     80|    if (!IsPathSeparator(character)) {
  ------------------
  |  Branch (400:9): [True: 74, False: 6]
  ------------------
  401|     74|      *(out++) = character;
  402|     74|    } else if (out == pathname_.begin() || *std::prev(out) != kPathSeparator) {
  ------------------
  |  Branch (402:16): [True: 2, False: 4]
  |  Branch (402:16): [True: 6, False: 0]
  |  Branch (402:44): [True: 4, False: 0]
  ------------------
  403|      6|      *(out++) = kPathSeparator;
  404|      6|    }
  405|     80|    ++i;
  406|     80|  }
  407|       |
  408|      2|  pathname_.erase(out, pathname_.end());
  409|      2|}
gtest-all.cc:_ZN7testing8internalL15IsPathSeparatorEc:
   92|     80|static bool IsPathSeparator(char c) {
   93|       |#if GTEST_HAS_ALT_PATH_SEP_
   94|       |  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
   95|       |#else
   96|     80|  return c == kPathSeparator;
   97|     80|#endif
   98|     80|}

_ZN7testing8internal15GetUnitTestImplEv:
  982|     32|inline UnitTestImpl* GetUnitTestImpl() {
  983|     32|  return UnitTest::GetInstance()->impl();
  984|     32|}
_ZN7testing8internal12UnitTestImpl17current_test_infoEv:
  757|      2|  TestInfo* current_test_info() { return current_test_info_; }
_ZN7testing8internal12UnitTestImpl9listenersEv:
  609|     12|  TestEventListeners* listeners() { return &listeners_; }
_ZN7testing8internal12UnitTestImpl33ignored_parameterized_test_suitesEv:
  704|      2|  std::set<std::string>* ignored_parameterized_test_suites() {
  705|      2|    return &ignored_parameterized_test_suites_;
  706|      2|  }
_ZN7testing8internal17TestPropertyKeyIsC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  348|      2|  explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
_ZN7testing8internal14GTestFlagSaverC2Ev:
  144|      2|  GTestFlagSaver() {
  145|      2|    also_run_disabled_tests_ = GTEST_FLAG_GET(also_run_disabled_tests);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  146|      2|    break_on_failure_ = GTEST_FLAG_GET(break_on_failure);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  147|      2|    catch_exceptions_ = GTEST_FLAG_GET(catch_exceptions);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  148|      2|    color_ = GTEST_FLAG_GET(color);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  149|      2|    death_test_style_ = GTEST_FLAG_GET(death_test_style);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  150|      2|    death_test_use_fork_ = GTEST_FLAG_GET(death_test_use_fork);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  151|      2|    fail_fast_ = GTEST_FLAG_GET(fail_fast);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  152|      2|    filter_ = GTEST_FLAG_GET(filter);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  153|      2|    internal_run_death_test_ = GTEST_FLAG_GET(internal_run_death_test);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  154|      2|    list_tests_ = GTEST_FLAG_GET(list_tests);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  155|      2|    output_ = GTEST_FLAG_GET(output);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  156|      2|    brief_ = GTEST_FLAG_GET(brief);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  157|      2|    print_time_ = GTEST_FLAG_GET(print_time);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  158|      2|    print_utf8_ = GTEST_FLAG_GET(print_utf8);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  159|      2|    random_seed_ = GTEST_FLAG_GET(random_seed);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  160|      2|    repeat_ = GTEST_FLAG_GET(repeat);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  161|      2|    recreate_environments_when_repeating_ =
  162|      2|        GTEST_FLAG_GET(recreate_environments_when_repeating);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  163|      2|    shuffle_ = GTEST_FLAG_GET(shuffle);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  164|      2|    stack_trace_depth_ = GTEST_FLAG_GET(stack_trace_depth);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  165|      2|    stream_result_to_ = GTEST_FLAG_GET(stream_result_to);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  166|      2|    throw_on_failure_ = GTEST_FLAG_GET(throw_on_failure);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  167|      2|  }
_ZNK7testing8internal12UnitTestImpl18current_test_suiteEv:
  756|      2|  const TestSuite* current_test_suite() const { return current_test_suite_; }
_ZN7testing8internal12UnitTestImpl11AddTestInfoEPFvvES3_PNS_8TestInfoE:
  677|      4|                   TestInfo* test_info) {
  678|      4|#if GTEST_HAS_FILE_SYSTEM
  679|       |    // In order to support thread-safe death tests, we need to
  680|       |    // remember the original working directory when the test program
  681|       |    // was first invoked.  We cannot do this in RUN_ALL_TESTS(), as
  682|       |    // the user may have changed the current directory before calling
  683|       |    // RUN_ALL_TESTS().  Therefore we capture the current directory in
  684|       |    // AddTestInfo(), which is called to register a TEST or TEST_F
  685|       |    // before main() is reached.
  686|      4|    if (original_working_dir_.IsEmpty()) {
  ------------------
  |  Branch (686:9): [True: 2, False: 2]
  ------------------
  687|      2|      original_working_dir_ = FilePath::GetCurrentDir();
  688|      4|      GTEST_CHECK_(!original_working_dir_.IsEmpty())
  ------------------
  |  | 1087|      2|  GTEST_AMBIGUOUS_ELSE_BLOCKER_               \
  |  |  ------------------
  |  |  |  |  728|      4|  switch (0)                          \
  |  |  |  |  729|      4|  case 0:                             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (729:3): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  730|      2|  default:  // NOLINT
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (730:3): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1088|      2|  if (::testing::internal::IsTrue(condition)) \
  |  |  ------------------
  |  |  |  Branch (1088:7): [True: 2, False: 0]
  |  |  ------------------
  |  | 1089|      2|    ;                                         \
  |  | 1090|      2|  else                                        \
  |  | 1091|      2|    GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
  689|      4|          << "Failed to get the current working directory.";
  690|      2|    }
  691|      4|#endif  // GTEST_HAS_FILE_SYSTEM
  692|       |
  693|      4|    GetTestSuite(test_info->test_suite_name_, test_info->type_param(),
  694|      4|                 set_up_tc, tear_down_tc)
  695|      4|        ->AddTestInfo(test_info);
  696|      4|  }
_ZNK7testing8internal12UnitTestImpl12GetTestSuiteEi:
  591|     10|  const TestSuite* GetTestSuite(int i) const {
  592|     10|    const int index = GetElementOr(test_suite_indices_, i, -1);
  593|     10|    return index < 0 ? nullptr : test_suites_[static_cast<size_t>(i)];
  ------------------
  |  Branch (593:12): [True: 0, False: 10]
  ------------------
  594|     10|  }
_ZN7testing8internal12UnitTestImpl19GetMutableSuiteCaseEi:
  603|      2|  TestSuite* GetMutableSuiteCase(int i) {
  604|      2|    const int index = GetElementOr(test_suite_indices_, i, -1);
  605|      2|    return index < 0 ? nullptr : test_suites_[static_cast<size_t>(index)];
  ------------------
  |  Branch (605:12): [True: 0, False: 2]
  ------------------
  606|      2|  }
_ZN7testing8internal12UnitTestImpl22set_current_test_suiteEPNS_9TestSuiteE:
  846|      2|  void set_current_test_suite(TestSuite* a_current_test_suite) {
  847|      2|    current_test_suite_ = a_current_test_suite;
  848|      2|  }
_ZN7testing8internal12UnitTestImpl21set_current_test_infoEPNS_8TestInfoE:
  853|      2|  void set_current_test_info(TestInfo* a_current_test_info) {
  854|      2|    current_test_info_ = a_current_test_info;
  855|      2|  }
_ZN7testing8internal12UnitTestImpl20set_catch_exceptionsEb:
  843|      2|  void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
_ZN7testing8internal12UnitTestImpl27parameterized_test_registryEv:
  700|      2|  internal::ParameterizedTestSuiteRegistry& parameterized_test_registry() {
  701|      2|    return parameterized_test_registry_;
  702|      2|  }
_ZN7testing8internal12UnitTestImpl34InitDeathTestSubprocessControlInfoEv:
  773|      2|  void InitDeathTestSubprocessControlInfo() {
  774|      2|    internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
  775|      2|  }
_ZN7testing8internal21GetRandomSeedFromFlagEi:
  114|      2|inline int GetRandomSeedFromFlag(int32_t random_seed_flag) {
  115|      2|  const unsigned int raw_seed =
  116|      2|      (random_seed_flag == 0) ? static_cast<unsigned int>(GetTimeInMillis())
  ------------------
  |  Branch (116:7): [True: 2, False: 0]
  ------------------
  117|      2|                              : static_cast<unsigned int>(random_seed_flag);
  118|       |
  119|       |  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
  120|       |  // it's easy to type.
  121|      2|  const int normalized_seed =
  122|      2|      static_cast<int>((raw_seed - 1U) %
  123|      2|                       static_cast<unsigned int>(kMaxRandomSeed)) +
  124|      2|      1;
  125|      2|  return normalized_seed;
  126|      2|}
_ZN7testing8internal12UnitTestImpl23ClearNonAdHocTestResultEv:
  730|      2|  void ClearNonAdHocTestResult() {
  731|      2|    ForEach(test_suites_, TestSuite::ClearTestSuiteResult);
  732|      2|  }
_ZN7testing8internal18OsStackTraceGetterC2Ev:
  440|      2|  OsStackTraceGetter() = default;
_ZN7testing8internal27OsStackTraceGetterInterfaceC2Ev:
  411|      2|  OsStackTraceGetterInterface() = default;
_ZN7testing8internal12GetElementOrIiEET_RKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEEiS2_:
  295|     18|inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
  296|     18|  return (i < 0 || i >= static_cast<int>(v.size())) ? default_value
  ------------------
  |  Branch (296:11): [True: 0, False: 18]
  |  Branch (296:20): [True: 0, False: 18]
  ------------------
  297|     18|                                                    : v[static_cast<size_t>(i)];
  298|     18|}
_ZN7testing8internal7ForEachINSt3__16vectorIPNS_9TestSuiteENS2_9allocatorIS5_EEEEPFvS5_EEEvRKT_T0_:
  288|      2|void ForEach(const Container& c, Functor functor) {
  289|      2|  std::for_each(c.begin(), c.end(), functor);
  290|      2|}
_ZN7testing8internal7CountIfINSt3__16vectorIPNS_9TestSuiteENS2_9allocatorIS5_EEEEPFbPKS4_EEEiRKT_T0_:
  276|      2|inline int CountIf(const Container& c, Predicate predicate) {
  277|       |  // Implemented as an explicit loop since std::count_if() in libCstd on
  278|       |  // Solaris has a non-standard signature.
  279|      2|  int count = 0;
  280|      4|  for (auto it = c.begin(); it != c.end(); ++it) {
  ------------------
  |  Branch (280:29): [True: 2, False: 2]
  ------------------
  281|      2|    if (predicate(*it)) ++count;
  ------------------
  |  Branch (281:9): [True: 2, False: 0]
  ------------------
  282|      2|  }
  283|      2|  return count;
  284|      2|}
_ZN7testing8internal7CountIfINSt3__16vectorINS_14TestPartResultENS2_9allocatorIS4_EEEEPFbRKS4_EEEiRKT_T0_:
  276|     14|inline int CountIf(const Container& c, Predicate predicate) {
  277|       |  // Implemented as an explicit loop since std::count_if() in libCstd on
  278|       |  // Solaris has a non-standard signature.
  279|     14|  int count = 0;
  280|     14|  for (auto it = c.begin(); it != c.end(); ++it) {
  ------------------
  |  Branch (280:29): [True: 0, False: 14]
  ------------------
  281|      0|    if (predicate(*it)) ++count;
  ------------------
  |  Branch (281:9): [True: 0, False: 0]
  ------------------
  282|      0|  }
  283|     14|  return count;
  284|     14|}
_ZNK7testing8internal12UnitTestImpl16catch_exceptionsEv:
  826|     10|  bool catch_exceptions() const { return catch_exceptions_; }
_ZN7testing8internal7CountIfINSt3__16vectorIPNS_8TestInfoENS2_9allocatorIS5_EEEEPFbPKS4_EEEiRKT_T0_:
  276|      4|inline int CountIf(const Container& c, Predicate predicate) {
  277|       |  // Implemented as an explicit loop since std::count_if() in libCstd on
  278|       |  // Solaris has a non-standard signature.
  279|      4|  int count = 0;
  280|     12|  for (auto it = c.begin(); it != c.end(); ++it) {
  ------------------
  |  Branch (280:29): [True: 8, False: 4]
  ------------------
  281|      8|    if (predicate(*it)) ++count;
  ------------------
  |  Branch (281:9): [True: 4, False: 4]
  ------------------
  282|      8|  }
  283|      4|  return count;
  284|      4|}
_ZN7testing8internal7ForEachINSt3__16vectorIPNS_8TestInfoENS2_9allocatorIS5_EEEEPFvS5_EEEvRKT_T0_:
  288|      2|void ForEach(const Container& c, Functor functor) {
  289|      2|  std::for_each(c.begin(), c.end(), functor);
  290|      2|}
_ZN7testing8internal7ForEachINSt3__16vectorIPNS_11EnvironmentENS2_9allocatorIS5_EEEEPFvS5_EEEvRKT_T0_:
  288|      2|void ForEach(const Container& c, Functor functor) {
  289|      2|  std::for_each(c.begin(), c.end(), functor);
  290|      2|}

_ZN7testing8internal16BoolFromGTestEnvEPKcb:
 1366|     26|bool BoolFromGTestEnv(const char* flag, bool default_value) {
 1367|       |#if defined(GTEST_GET_BOOL_FROM_ENV_)
 1368|       |  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
 1369|       |#else
 1370|     26|  const std::string env_var = FlagToEnvVar(flag);
 1371|     26|  const char* const string_value = posix::GetEnv(env_var.c_str());
 1372|     26|  return string_value == nullptr ? default_value
  ------------------
  |  Branch (1372:10): [True: 26, False: 0]
  ------------------
 1373|     26|                                 : strcmp(string_value, "0") != 0;
 1374|     26|#endif  // defined(GTEST_GET_BOOL_FROM_ENV_)
 1375|     26|}
_ZN7testing8internal17Int32FromGTestEnvEPKci:
 1380|      6|int32_t Int32FromGTestEnv(const char* flag, int32_t default_value) {
 1381|       |#if defined(GTEST_GET_INT32_FROM_ENV_)
 1382|       |  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
 1383|       |#else
 1384|      6|  const std::string env_var = FlagToEnvVar(flag);
 1385|      6|  const char* const string_value = posix::GetEnv(env_var.c_str());
 1386|      6|  if (string_value == nullptr) {
  ------------------
  |  Branch (1386:7): [True: 6, False: 0]
  ------------------
 1387|       |    // The environment variable is not set.
 1388|      6|    return default_value;
 1389|      6|  }
 1390|       |
 1391|      0|  int32_t result = default_value;
 1392|      0|  if (!ParseInt32(Message() << "Environment variable " << env_var, string_value,
  ------------------
  |  Branch (1392:7): [True: 0, False: 0]
  ------------------
 1393|      0|                  &result)) {
 1394|      0|    printf("The default value %s is used.\n",
 1395|      0|           (Message() << default_value).GetString().c_str());
 1396|      0|    fflush(stdout);
 1397|      0|    return default_value;
 1398|      0|  }
 1399|       |
 1400|      0|  return result;
 1401|      0|#endif  // defined(GTEST_GET_INT32_FROM_ENV_)
 1402|      0|}
_ZN7testing8internal25OutputFlagAlsoCheckEnvVarEv:
 1412|      2|std::string OutputFlagAlsoCheckEnvVar() {
 1413|      2|  std::string default_value_for_output_flag = "";
 1414|      2|  const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE");
 1415|      2|  if (nullptr != xml_output_file_env) {
  ------------------
  |  Branch (1415:7): [True: 0, False: 2]
  ------------------
 1416|      0|    default_value_for_output_flag = std::string("xml:") + xml_output_file_env;
 1417|      0|  }
 1418|      2|  return default_value_for_output_flag;
 1419|      2|}
_ZN7testing8internal18StringFromGTestEnvEPKcS2_:
 1423|     12|const char* StringFromGTestEnv(const char* flag, const char* default_value) {
 1424|       |#if defined(GTEST_GET_STRING_FROM_ENV_)
 1425|       |  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
 1426|       |#else
 1427|     12|  const std::string env_var = FlagToEnvVar(flag);
 1428|     12|  const char* const value = posix::GetEnv(env_var.c_str());
 1429|     12|  return value == nullptr ? default_value : value;
  ------------------
  |  Branch (1429:10): [True: 12, False: 0]
  ------------------
 1430|     12|#endif  // defined(GTEST_GET_STRING_FROM_ENV_)
 1431|     12|}
gtest-all.cc:_ZN7testing8internalL12FlagToEnvVarEPKc:
 1309|     44|static std::string FlagToEnvVar(const char* flag) {
 1310|     44|  const std::string full_flag =
 1311|     44|      (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
  ------------------
  |  |  346|     44|#define GTEST_FLAG_PREFIX_ "gtest_"
  ------------------
 1312|       |
 1313|     44|  Message env_var;
 1314|    928|  for (size_t i = 0; i != full_flag.length(); i++) {
  ------------------
  |  Branch (1314:22): [True: 884, False: 44]
  ------------------
 1315|    884|    env_var << ToUpper(full_flag.c_str()[i]);
 1316|    884|  }
 1317|       |
 1318|     44|  return env_var.GetString();
 1319|     44|}

_ZN7testing8internal33GetIgnoredParameterizedTestSuitesEv:
  533|      2|std::set<std::string>* GetIgnoredParameterizedTestSuites() {
  534|      2|  return UnitTest::GetInstance()->impl()->ignored_parameterized_test_suites();
  535|      2|}
_ZN7testing8internal34TypeParameterizedTestSuiteRegistry22CheckForInstantiationsEv:
  617|      2|void TypeParameterizedTestSuiteRegistry::CheckForInstantiations() {
  618|      2|  const auto& ignored = *GetIgnoredParameterizedTestSuites();
  619|      2|  for (const auto& testcase : suites_) {
  ------------------
  |  Branch (619:29): [True: 0, False: 2]
  ------------------
  620|      0|    if (testcase.second.instantiated) continue;
  ------------------
  |  Branch (620:9): [True: 0, False: 0]
  ------------------
  621|      0|    if (ignored.find(testcase.first) != ignored.end()) continue;
  ------------------
  |  Branch (621:9): [True: 0, False: 0]
  ------------------
  622|       |
  623|      0|    std::string message =
  624|      0|        "Type parameterized test suite " + testcase.first +
  625|      0|        " is defined via REGISTER_TYPED_TEST_SUITE_P, but never instantiated "
  626|      0|        "via INSTANTIATE_TYPED_TEST_SUITE_P. None of the test cases will run."
  627|      0|        "\n\n"
  628|      0|        "Ideally, TYPED_TEST_P definitions should only ever be included as "
  629|      0|        "part of binaries that intend to use them. (As opposed to, for "
  630|      0|        "example, being placed in a library that may be linked in to get "
  631|      0|        "other "
  632|      0|        "utilities.)"
  633|      0|        "\n\n"
  634|      0|        "To suppress this error for this test suite, insert the following "
  635|      0|        "line "
  636|      0|        "(in a non-header) in the namespace it is defined in:"
  637|      0|        "\n\n"
  638|      0|        "GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" +
  639|      0|        testcase.first + ");";
  640|       |
  641|      0|    std::string full_name =
  642|      0|        "UninstantiatedTypeParameterizedTestSuite<" + testcase.first + ">";
  643|      0|    RegisterTest(  //
  644|      0|        "GoogleTestVerification", full_name.c_str(),
  645|      0|        nullptr,  // No type parameter.
  646|      0|        nullptr,  // No value parameter.
  647|      0|        testcase.second.code_location.file.c_str(),
  648|      0|        testcase.second.code_location.line, [message, testcase] {
  649|      0|          return new FailureTest(testcase.second.code_location, message,
  650|      0|                                 kErrorOnUninstantiatedTypeParameterizedTest);
  651|      0|        });
  652|      0|  }
  653|      2|}
_ZN7testing8internal8GetArgvsEv:
  658|      4|::std::vector<std::string> GetArgvs() {
  659|       |#if defined(GTEST_CUSTOM_GET_ARGVS_)
  660|       |  // GTEST_CUSTOM_GET_ARGVS_() may return a container of std::string or
  661|       |  // ::string. This code converts it to the appropriate type.
  662|       |  const auto& custom = GTEST_CUSTOM_GET_ARGVS_();
  663|       |  return ::std::vector<std::string>(custom.begin(), custom.end());
  664|       |#else   // defined(GTEST_CUSTOM_GET_ARGVS_)
  665|      4|  return g_argvs;
  666|      4|#endif  // defined(GTEST_CUSTOM_GET_ARGVS_)
  667|      4|}
_ZN7testing8internal15UnitTestOptions15GetOutputFormatEv:
  691|      2|std::string UnitTestOptions::GetOutputFormat() {
  692|      2|  std::string s = GTEST_FLAG_GET(output);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  693|      2|  const char* const gtest_output_flag = s.c_str();
  694|      2|  const char* const colon = strchr(gtest_output_flag, ':');
  695|      2|  return (colon == nullptr)
  ------------------
  |  Branch (695:10): [True: 2, False: 0]
  ------------------
  696|      2|             ? std::string(gtest_output_flag)
  697|      2|             : std::string(gtest_output_flag,
  698|      0|                           static_cast<size_t>(colon - gtest_output_flag));
  699|      2|}
_ZN7testing8internal13GetTestTypeIdEv:
  999|      2|TypeId GetTestTypeId() { return GetTypeId<Test>(); }
_ZN7testing8internal35DefaultGlobalTestPartResultReporterC2EPNS0_12UnitTestImplE:
 1062|      2|    : unit_test_(unit_test) {}
_ZN7testing8internal38DefaultPerThreadTestPartResultReporterC2EPNS0_12UnitTestImplE:
 1072|      2|    : unit_test_(unit_test) {}
_ZNK7testing8internal12UnitTestImpl22total_test_suite_countEv:
 1116|      6|int UnitTestImpl::total_test_suite_count() const {
 1117|      6|  return static_cast<int>(test_suites_.size());
 1118|      6|}
_ZNK7testing8internal12UnitTestImpl23test_suite_to_run_countEv:
 1122|      2|int UnitTestImpl::test_suite_to_run_count() const {
 1123|      2|  return CountIf(test_suites_, ShouldRunTestSuite);
 1124|      2|}
_ZNK7testing8internal12UnitTestImpl16total_test_countEv:
 1158|      2|int UnitTestImpl::total_test_count() const {
 1159|      2|  return SumOverTestSuiteList(test_suites_, &TestSuite::total_test_count);
 1160|      2|}
_ZNK7testing8internal12UnitTestImpl17test_to_run_countEv:
 1163|      2|int UnitTestImpl::test_to_run_count() const {
 1164|      2|  return SumOverTestSuiteList(test_suites_, &TestSuite::test_to_run_count);
 1165|      2|}
_ZN7testing8internal15GetTimeInMillisEv:
 1211|      8|TimeInMillis GetTimeInMillis() {
 1212|      8|  return std::chrono::duration_cast<std::chrono::milliseconds>(
 1213|      8|             std::chrono::system_clock::now() -
 1214|      8|             std::chrono::system_clock::from_time_t(0))
 1215|      8|      .count();
 1216|      8|}
_ZN7testing8internal6String13CStringEqualsEPKcS3_:
 1261|      2|bool String::CStringEquals(const char* lhs, const char* rhs) {
 1262|      2|  if (lhs == nullptr) return rhs == nullptr;
  ------------------
  |  Branch (1262:7): [True: 0, False: 2]
  ------------------
 1263|       |
 1264|      2|  if (rhs == nullptr) return false;
  ------------------
  |  Branch (1264:7): [True: 0, False: 2]
  ------------------
 1265|       |
 1266|      2|  return strcmp(lhs, rhs) == 0;
 1267|      2|}
_ZN7testing8internal11SplitStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEcPNS1_6vectorIS7_NS5_IS7_EEEE:
 1289|      8|                 ::std::vector< ::std::string>* dest) {
 1290|      8|  ::std::vector< ::std::string> parsed;
 1291|      8|  ::std::string::size_type pos = 0;
 1292|     12|  while (::testing::internal::AlwaysTrue()) {
  ------------------
  |  Branch (1292:10): [True: 12, False: 0]
  ------------------
 1293|     12|    const ::std::string::size_type colon = str.find(delimiter, pos);
 1294|     12|    if (colon == ::std::string::npos) {
  ------------------
  |  Branch (1294:9): [True: 8, False: 4]
  ------------------
 1295|      8|      parsed.push_back(str.substr(pos));
 1296|      8|      break;
 1297|      8|    } else {
 1298|      4|      parsed.push_back(str.substr(pos, colon - pos));
 1299|      4|      pos = colon + 1;
 1300|      4|    }
 1301|     12|  }
 1302|      8|  dest->swap(parsed);
 1303|      8|}
_ZN7testing7MessageC2Ev:
 1312|    126|Message::Message() : ss_(new ::std::stringstream) {
 1313|       |  // By default, we want there to be enough precision when printing
 1314|       |  // a double to a Message.
 1315|    126|  *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
 1316|    126|}
_ZNK7testing7Message9GetStringEv:
 1338|    126|std::string Message::GetString() const {
 1339|    126|  return internal::StringStreamToString(ss_.get());
 1340|    126|}
_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_:
 2183|      2|bool String::CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {
 2184|      2|  if (lhs == nullptr) return rhs == nullptr;
  ------------------
  |  Branch (2184:7): [True: 0, False: 2]
  ------------------
 2185|      2|  if (rhs == nullptr) return false;
  ------------------
  |  Branch (2185:7): [True: 0, False: 2]
  ------------------
 2186|      2|  return posix::StrCaseCmp(lhs, rhs) == 0;
 2187|      2|}
_ZN7testing8internal20StringStreamToStringEPNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2268|    126|std::string StringStreamToString(::std::stringstream* ss) {
 2269|    126|  const ::std::string& str = ss->str();
 2270|    126|  const char* const start = str.c_str();
 2271|    126|  const char* const end = start + str.length();
 2272|       |
 2273|    126|  std::string result;
 2274|    126|  result.reserve(static_cast<size_t>(2 * (end - start)));
 2275|  3.57k|  for (const char* ch = start; ch != end; ++ch) {
  ------------------
  |  Branch (2275:32): [True: 3.45k, False: 126]
  ------------------
 2276|  3.45k|    if (*ch == '\0') {
  ------------------
  |  Branch (2276:9): [True: 0, False: 3.45k]
  ------------------
 2277|      0|      result += "\\0";  // Replaces NUL with "\\0";
 2278|  3.45k|    } else {
 2279|  3.45k|      result += *ch;
 2280|  3.45k|    }
 2281|  3.45k|  }
 2282|       |
 2283|    126|  return result;
 2284|    126|}
_ZN7testing10TestResultC2Ev:
 2306|      8|    : death_test_count_(0), start_timestamp_(0), elapsed_time_(0) {}
_ZN7testing10TestResult14RecordPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_12TestPropertyE:
 2339|      2|                                const TestProperty& test_property) {
 2340|      2|  if (!ValidateTestProperty(xml_element, test_property)) {
  ------------------
  |  Branch (2340:7): [True: 0, False: 2]
  ------------------
 2341|      0|    return;
 2342|      0|  }
 2343|      2|  internal::MutexLock lock(&test_properties_mutex_);
 2344|      2|  const std::vector<TestProperty>::iterator property_with_matching_key =
 2345|      2|      std::find_if(test_properties_.begin(), test_properties_.end(),
 2346|      2|                   internal::TestPropertyKeyIs(test_property.key()));
 2347|      2|  if (property_with_matching_key == test_properties_.end()) {
  ------------------
  |  Branch (2347:7): [True: 2, False: 0]
  ------------------
 2348|      2|    test_properties_.push_back(test_property);
 2349|      2|    return;
 2350|      2|  }
 2351|      0|  property_with_matching_key->SetValue(test_property.value());
 2352|      0|}
_ZN7testing10TestResult20ValidateTestPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_12TestPropertyE:
 2446|      2|                                      const TestProperty& test_property) {
 2447|      2|  return ValidateTestPropertyName(test_property.key(),
 2448|      2|                                  GetReservedAttributesForElement(xml_element));
 2449|      2|}
_ZN7testing10TestResult5ClearEv:
 2452|      6|void TestResult::Clear() {
 2453|      6|  test_part_results_.clear();
 2454|      6|  test_properties_.clear();
 2455|      6|  death_test_count_ = 0;
 2456|      6|  elapsed_time_ = 0;
 2457|      6|}
_ZNK7testing10TestResult7SkippedEv:
 2465|      8|bool TestResult::Skipped() const {
 2466|      8|  return !Failed() && CountIf(test_part_results_, TestPartSkipped) > 0;
  ------------------
  |  Branch (2466:10): [True: 8, False: 0]
  |  Branch (2466:23): [True: 0, False: 8]
  ------------------
 2467|      8|}
_ZNK7testing10TestResult6FailedEv:
 2470|     10|bool TestResult::Failed() const {
 2471|     10|  for (int i = 0; i < total_part_count(); ++i) {
  ------------------
  |  Branch (2471:19): [True: 0, False: 10]
  ------------------
 2472|      0|    if (GetTestPartResult(i).failed()) return true;
  ------------------
  |  Branch (2472:9): [True: 0, False: 0]
  ------------------
 2473|      0|  }
 2474|     10|  return false;
 2475|     10|}
_ZNK7testing10TestResult15HasFatalFailureEv:
 2483|      6|bool TestResult::HasFatalFailure() const {
 2484|      6|  return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
 2485|      6|}
_ZNK7testing10TestResult16total_part_countEv:
 2499|     10|int TestResult::total_part_count() const {
 2500|     10|  return static_cast<int>(test_part_results_.size());
 2501|     10|}
_ZN7testing4TestC2Ev:
 2513|      2|Test::Test() : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {}
  ------------------
  |  | 2308|      2|#define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
  ------------------
_ZN7testing4Test5SetUpEv:
 2523|      2|void Test::SetUp() {}
_ZN7testing4Test14RecordPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 2531|      2|void Test::RecordProperty(const std::string& key, const std::string& value) {
 2532|      2|  UnitTest::GetInstance()->RecordProperty(key, value);
 2533|      2|}
_ZN7testing4Test19HasSameFixtureClassEv:
 2556|      2|bool Test::HasSameFixtureClass() {
 2557|      2|  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
 2558|      2|  const TestSuite* const test_suite = impl->current_test_suite();
 2559|       |
 2560|       |  // Info about the first test in the current test suite.
 2561|      2|  const TestInfo* const first_test_info = test_suite->test_info_list()[0];
 2562|      2|  const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
 2563|      2|  const char* const first_test_name = first_test_info->name();
 2564|       |
 2565|       |  // Info about the current test.
 2566|      2|  const TestInfo* const this_test_info = impl->current_test_info();
 2567|      2|  const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;
 2568|      2|  const char* const this_test_name = this_test_info->name();
 2569|       |
 2570|      2|  if (this_fixture_id != first_fixture_id) {
  ------------------
  |  Branch (2570:7): [True: 0, False: 2]
  ------------------
 2571|       |    // Is the first test defined using TEST?
 2572|      0|    const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
 2573|       |    // Is this test defined using TEST?
 2574|      0|    const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
 2575|       |
 2576|      0|    if (first_is_TEST || this_is_TEST) {
  ------------------
  |  Branch (2576:9): [True: 0, False: 0]
  |  Branch (2576:26): [True: 0, False: 0]
  ------------------
 2577|       |      // Both TEST and TEST_F appear in same test suite, which is incorrect.
 2578|       |      // Tell the user how to fix this.
 2579|       |
 2580|       |      // Gets the name of the TEST and the name of the TEST_F.  Note
 2581|       |      // that first_is_TEST and this_is_TEST cannot both be true, as
 2582|       |      // the fixture IDs are different for the two tests.
 2583|      0|      const char* const TEST_name =
 2584|      0|          first_is_TEST ? first_test_name : this_test_name;
  ------------------
  |  Branch (2584:11): [True: 0, False: 0]
  ------------------
 2585|      0|      const char* const TEST_F_name =
 2586|      0|          first_is_TEST ? this_test_name : first_test_name;
  ------------------
  |  Branch (2586:11): [True: 0, False: 0]
  ------------------
 2587|       |
 2588|      0|      ADD_FAILURE()
  ------------------
  |  | 1750|      0|#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  |  |  ------------------
  |  |  |  | 1296|      0|  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1290|      0|  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1286|      0|  ::testing::internal::AssertHelper(result_type, file, line, message) = \
  |  |  |  |  |  |  |  | 1287|      0|      ::testing::Message()
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2589|      0|          << "All tests in the same test suite must use the same test fixture\n"
 2590|      0|          << "class, so mixing TEST_F and TEST in the same test suite is\n"
 2591|      0|          << "illegal.  In test suite " << this_test_info->test_suite_name()
 2592|      0|          << ",\n"
 2593|      0|          << "test " << TEST_F_name << " is defined using TEST_F but\n"
 2594|      0|          << "test " << TEST_name << " is defined using TEST.  You probably\n"
 2595|      0|          << "want to change the TEST to TEST_F or move it to another test\n"
 2596|      0|          << "case.";
 2597|      0|    } else {
 2598|       |      // Two fixture classes with the same name appear in two different
 2599|       |      // namespaces, which is not allowed. Tell the user how to fix this.
 2600|      0|      ADD_FAILURE()
  ------------------
  |  | 1750|      0|#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  |  |  ------------------
  |  |  |  | 1296|      0|  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1290|      0|  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1286|      0|  ::testing::internal::AssertHelper(result_type, file, line, message) = \
  |  |  |  |  |  |  |  | 1287|      0|      ::testing::Message()
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2601|      0|          << "All tests in the same test suite must use the same test fixture\n"
 2602|      0|          << "class.  However, in test suite "
 2603|      0|          << this_test_info->test_suite_name() << ",\n"
 2604|      0|          << "you defined test " << first_test_name << " and test "
 2605|      0|          << this_test_name << "\n"
 2606|      0|          << "using two different test fixture classes.  This can happen if\n"
 2607|      0|          << "the two classes are from different namespaces or translation\n"
 2608|      0|          << "units and have the same name.  You should probably rename one\n"
 2609|      0|          << "of the classes to put the tests into different test suites.";
 2610|      0|    }
 2611|      0|    return false;
 2612|      0|  }
 2613|       |
 2614|      2|  return true;
 2615|      2|}
_ZN7testing4Test3RunEv:
 2729|      2|void Test::Run() {
 2730|      2|  if (!HasSameFixtureClass()) return;
  ------------------
  |  Branch (2730:7): [True: 0, False: 2]
  ------------------
 2731|       |
 2732|      2|  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
 2733|      2|  impl->os_stack_trace_getter()->UponLeavingGTest();
 2734|      2|  internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
 2735|       |  // We will run the test only if SetUp() was successful and didn't call
 2736|       |  // GTEST_SKIP().
 2737|      2|  if (!HasFatalFailure() && !IsSkipped()) {
  ------------------
  |  Branch (2737:7): [True: 2, False: 0]
  |  Branch (2737:29): [True: 2, False: 0]
  ------------------
 2738|      2|    impl->os_stack_trace_getter()->UponLeavingGTest();
 2739|      2|    internal::HandleExceptionsInMethodIfSupported(this, &Test::TestBody,
 2740|      2|                                                  "the test body");
 2741|      2|  }
 2742|       |
 2743|       |  // However, we want to clean up as much as possible.  Hence we will
 2744|       |  // always call TearDown(), even if SetUp() or the test body has
 2745|       |  // failed.
 2746|      2|  impl->os_stack_trace_getter()->UponLeavingGTest();
 2747|      2|  internal::HandleExceptionsInMethodIfSupported(this, &Test::TearDown,
 2748|      2|                                                "TearDown()");
 2749|      2|}
_ZN7testing4Test15HasFatalFailureEv:
 2752|      6|bool Test::HasFatalFailure() {
 2753|      6|  return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
 2754|      6|}
_ZN7testing4Test9IsSkippedEv:
 2764|      6|bool Test::IsSkipped() {
 2765|      6|  return internal::GetUnitTestImpl()->current_test_result()->Skipped();
 2766|      6|}
_ZN7testing8TestInfoC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_PKcS9_NS_8internal12CodeLocationEPKvPNSA_15TestFactoryBaseE:
 2777|      4|    : test_suite_name_(std::move(a_test_suite_name)),
 2778|      4|      name_(std::move(a_name)),
 2779|      4|      type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
  ------------------
  |  Branch (2779:19): [True: 0, False: 4]
  ------------------
 2780|      4|      value_param_(a_value_param ? new std::string(a_value_param) : nullptr),
  ------------------
  |  Branch (2780:20): [True: 0, False: 4]
  ------------------
 2781|      4|      location_(std::move(a_code_location)),
 2782|      4|      fixture_class_id_(fixture_class_id),
 2783|      4|      should_run_(false),
 2784|      4|      is_disabled_(false),
 2785|      4|      matches_filter_(false),
 2786|      4|      is_in_another_shard_(false),
 2787|      4|      factory_(factory),
 2788|      4|      result_() {}
_ZN7testing8internal23MakeAndRegisterTestInfoENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcS9_S9_NS0_12CodeLocationEPKvPFvvESE_PNS0_15TestFactoryBaseE:
 2817|      4|    TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) {
 2818|      4|  TestInfo* const test_info =
 2819|      4|      new TestInfo(std::move(test_suite_name), name, type_param, value_param,
 2820|      4|                   std::move(code_location), fixture_class_id, factory);
 2821|      4|  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
 2822|      4|  return test_info;
 2823|      4|}
_ZN7testing8internal12UnitTestImpl26RegisterParameterizedTestsEv:
 2846|      2|void UnitTestImpl::RegisterParameterizedTests() {
 2847|      2|  if (!parameterized_tests_registered_) {
  ------------------
  |  Branch (2847:7): [True: 2, False: 0]
  ------------------
 2848|      2|    parameterized_test_registry_.RegisterTests();
 2849|      2|    type_parameterized_test_registry_.CheckForInstantiations();
 2850|      2|    parameterized_tests_registered_ = true;
 2851|      2|  }
 2852|      2|}
_ZN7testing8TestInfo3RunEv:
 2858|      2|void TestInfo::Run() {
 2859|      2|  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
 2860|      2|  if (!should_run_) {
  ------------------
  |  Branch (2860:7): [True: 0, False: 2]
  ------------------
 2861|      0|    if (is_disabled_ && matches_filter_) repeater->OnTestDisabled(*this);
  ------------------
  |  Branch (2861:9): [True: 0, False: 0]
  |  Branch (2861:25): [True: 0, False: 0]
  ------------------
 2862|      0|    return;
 2863|      0|  }
 2864|       |
 2865|       |  // Tells UnitTest where to store test result.
 2866|      2|  UnitTest::GetInstance()->set_current_test_info(this);
 2867|       |
 2868|       |  // Notifies the unit test event listeners that a test is about to start.
 2869|      2|  repeater->OnTestStart(*this);
 2870|      2|  result_.set_start_timestamp(internal::GetTimeInMillis());
 2871|      2|  internal::Timer timer;
 2872|      2|  UnitTest::GetInstance()->UponLeavingGTest();
 2873|       |
 2874|       |  // Creates the test object.
 2875|      2|  Test* const test = internal::HandleExceptionsInMethodIfSupported(
 2876|      2|      factory_, &internal::TestFactoryBase::CreateTest,
 2877|      2|      "the test fixture's constructor");
 2878|       |
 2879|       |  // Runs the test if the constructor didn't generate a fatal failure or invoke
 2880|       |  // GTEST_SKIP().
 2881|       |  // Note that the object will not be null
 2882|      2|  if (!Test::HasFatalFailure() && !Test::IsSkipped()) {
  ------------------
  |  Branch (2882:7): [True: 2, False: 0]
  |  Branch (2882:35): [True: 2, False: 0]
  ------------------
 2883|       |    // This doesn't throw as all user code that can throw are wrapped into
 2884|       |    // exception handling code.
 2885|      2|    test->Run();
 2886|      2|  }
 2887|       |
 2888|      2|  if (test != nullptr) {
  ------------------
  |  Branch (2888:7): [True: 0, False: 2]
  ------------------
 2889|       |    // Deletes the test object.
 2890|      0|    UnitTest::GetInstance()->UponLeavingGTest();
 2891|      0|    internal::HandleExceptionsInMethodIfSupported(
 2892|      0|        test, &Test::DeleteSelf_, "the test fixture's destructor");
 2893|      0|  }
 2894|       |
 2895|      2|  result_.set_elapsed_time(timer.Elapsed());
 2896|       |
 2897|       |  // Notifies the unit test event listener that a test has just finished.
 2898|      2|  repeater->OnTestEnd(*this);
 2899|       |
 2900|       |  // Tells UnitTest to stop associating assertion results to this
 2901|       |  // test.
 2902|      2|  UnitTest::GetInstance()->set_current_test_info(nullptr);
 2903|      2|}
_ZNK7testing9TestSuite17test_to_run_countEv:
 2960|      4|int TestSuite::test_to_run_count() const {
 2961|      4|  return CountIf(test_info_list_, ShouldRunTest);
 2962|      4|}
_ZNK7testing9TestSuite16total_test_countEv:
 2965|     10|int TestSuite::total_test_count() const {
 2966|     10|  return static_cast<int>(test_info_list_.size());
 2967|     10|}
_ZN7testing9TestSuiteC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcPFvvESD_:
 2981|      2|    : name_(a_name),
 2982|      2|      type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
  ------------------
  |  Branch (2982:19): [True: 0, False: 2]
  ------------------
 2983|      2|      set_up_tc_(set_up_tc),
 2984|      2|      tear_down_tc_(tear_down_tc),
 2985|      2|      should_run_(false),
 2986|      2|      start_timestamp_(0),
 2987|      2|      elapsed_time_(0) {}
_ZNK7testing9TestSuite11GetTestInfoEi:
 2997|      4|const TestInfo* TestSuite::GetTestInfo(int i) const {
 2998|      4|  const int index = GetElementOr(test_indices_, i, -1);
 2999|      4|  return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
  ------------------
  |  Branch (2999:10): [True: 0, False: 4]
  ------------------
 3000|      4|}
_ZN7testing9TestSuite18GetMutableTestInfoEi:
 3004|      2|TestInfo* TestSuite::GetMutableTestInfo(int i) {
 3005|      2|  const int index = GetElementOr(test_indices_, i, -1);
 3006|      2|  return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
  ------------------
  |  Branch (3006:10): [True: 0, False: 2]
  ------------------
 3007|      2|}
_ZN7testing9TestSuite11AddTestInfoEPNS_8TestInfoE:
 3011|      4|void TestSuite::AddTestInfo(TestInfo* test_info) {
 3012|      4|  test_info_list_.push_back(test_info);
 3013|      4|  test_indices_.push_back(static_cast<int>(test_indices_.size()));
 3014|      4|}
_ZN7testing9TestSuite3RunEv:
 3017|      2|void TestSuite::Run() {
 3018|      2|  if (!should_run_) return;
  ------------------
  |  Branch (3018:7): [True: 0, False: 2]
  ------------------
 3019|       |
 3020|      2|  UnitTest::GetInstance()->set_current_test_suite(this);
 3021|       |
 3022|      2|  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
 3023|       |
 3024|       |  // Ensure our tests are in a deterministic order.
 3025|       |  //
 3026|       |  // We do this by sorting lexicographically on (file, line number), providing
 3027|       |  // an order matching what the user can see in the source code.
 3028|       |  //
 3029|       |  // In the common case the line number comparison shouldn't be necessary,
 3030|       |  // because the registrations made by the TEST macro are executed in order
 3031|       |  // within a translation unit. But this is not true of the manual registration
 3032|       |  // API, and in more exotic scenarios a single file may be part of multiple
 3033|       |  // translation units.
 3034|      2|  std::stable_sort(test_info_list_.begin(), test_info_list_.end(),
 3035|      2|                   [](const TestInfo* const a, const TestInfo* const b) {
 3036|      2|                     if (const int result = std::strcmp(a->file(), b->file())) {
 3037|      2|                       return result < 0;
 3038|      2|                     }
 3039|       |
 3040|      2|                     return a->line() < b->line();
 3041|      2|                   });
 3042|       |
 3043|       |  // Call both legacy and the new API
 3044|      2|  repeater->OnTestSuiteStart(*this);
 3045|       |//  Legacy API is deprecated but still available
 3046|      2|#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
 3047|      2|  repeater->OnTestCaseStart(*this);
 3048|      2|#endif  //  GTEST_REMOVE_LEGACY_TEST_CASEAPI_
 3049|       |
 3050|      2|  UnitTest::GetInstance()->UponLeavingGTest();
 3051|      2|  internal::HandleExceptionsInMethodIfSupported(
 3052|      2|      this, &TestSuite::RunSetUpTestSuite, "SetUpTestSuite()");
 3053|       |
 3054|      2|  const bool skip_all =
 3055|      2|      ad_hoc_test_result().Failed() || ad_hoc_test_result().Skipped();
  ------------------
  |  Branch (3055:7): [True: 0, False: 2]
  |  Branch (3055:40): [True: 0, False: 2]
  ------------------
 3056|       |
 3057|      2|  start_timestamp_ = internal::GetTimeInMillis();
 3058|      2|  internal::Timer timer;
 3059|      4|  for (int i = 0; i < total_test_count(); i++) {
  ------------------
  |  Branch (3059:19): [True: 2, False: 2]
  ------------------
 3060|      2|    if (skip_all) {
  ------------------
  |  Branch (3060:9): [True: 0, False: 2]
  ------------------
 3061|      0|      GetMutableTestInfo(i)->Skip();
 3062|      2|    } else {
 3063|      2|      GetMutableTestInfo(i)->Run();
 3064|      2|    }
 3065|      2|    if (GTEST_FLAG_GET(fail_fast) &&
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3066|      0|        GetMutableTestInfo(i)->result()->Failed()) {
  ------------------
  |  Branch (3066:9): [True: 0, False: 0]
  ------------------
 3067|      0|      for (int j = i + 1; j < total_test_count(); j++) {
  ------------------
  |  Branch (3067:27): [True: 0, False: 0]
  ------------------
 3068|      0|        GetMutableTestInfo(j)->Skip();
 3069|      0|      }
 3070|      0|      break;
 3071|      0|    }
 3072|      2|  }
 3073|      2|  elapsed_time_ = timer.Elapsed();
 3074|       |
 3075|      2|  UnitTest::GetInstance()->UponLeavingGTest();
 3076|      2|  internal::HandleExceptionsInMethodIfSupported(
 3077|      2|      this, &TestSuite::RunTearDownTestSuite, "TearDownTestSuite()");
 3078|       |
 3079|       |  // Call both legacy and the new API
 3080|      2|  repeater->OnTestSuiteEnd(*this);
 3081|       |//  Legacy API is deprecated but still available
 3082|      2|#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
 3083|      2|  repeater->OnTestCaseEnd(*this);
 3084|      2|#endif  //  GTEST_REMOVE_LEGACY_TEST_CASEAPI_
 3085|       |
 3086|      2|  UnitTest::GetInstance()->set_current_test_suite(nullptr);
 3087|      2|}
_ZN7testing9TestSuite11ClearResultEv:
 3119|      2|void TestSuite::ClearResult() {
 3120|      2|  ad_hoc_test_result_.Clear();
 3121|      2|  ForEach(test_info_list_, TestInfo::ClearTestResult);
 3122|      2|}
_ZN7testing8internal14ShouldUseColorEb:
 3286|      2|bool ShouldUseColor(bool stdout_is_tty) {
 3287|      2|  std::string c = GTEST_FLAG_GET(color);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 3288|      2|  const char* const gtest_color = c.c_str();
 3289|       |
 3290|      2|  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
  ------------------
  |  Branch (3290:7): [True: 2, False: 0]
  ------------------
 3291|       |#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MINGW)
 3292|       |    // On Windows the TERM variable is usually not set, but the
 3293|       |    // console there does support colors.
 3294|       |    return stdout_is_tty;
 3295|       |#else
 3296|       |    // On non-Windows platforms, we rely on the TERM variable.
 3297|      2|    const char* const term = posix::GetEnv("TERM");
 3298|      2|    const bool term_supports_color =
 3299|      2|        term != nullptr && (String::CStringEquals(term, "xterm") ||
  ------------------
  |  Branch (3299:9): [True: 0, False: 2]
  |  Branch (3299:29): [True: 0, False: 0]
  ------------------
 3300|      0|                            String::CStringEquals(term, "xterm-color") ||
  ------------------
  |  Branch (3300:29): [True: 0, False: 0]
  ------------------
 3301|      0|                            String::CStringEquals(term, "xterm-kitty") ||
  ------------------
  |  Branch (3301:29): [True: 0, False: 0]
  ------------------
 3302|      0|                            String::CStringEquals(term, "alacritty") ||
  ------------------
  |  Branch (3302:29): [True: 0, False: 0]
  ------------------
 3303|      0|                            String::CStringEquals(term, "screen") ||
  ------------------
  |  Branch (3303:29): [True: 0, False: 0]
  ------------------
 3304|      0|                            String::CStringEquals(term, "tmux") ||
  ------------------
  |  Branch (3304:29): [True: 0, False: 0]
  ------------------
 3305|      0|                            String::CStringEquals(term, "rxvt-unicode") ||
  ------------------
  |  Branch (3305:29): [True: 0, False: 0]
  ------------------
 3306|      0|                            String::CStringEquals(term, "linux") ||
  ------------------
  |  Branch (3306:29): [True: 0, False: 0]
  ------------------
 3307|      0|                            String::CStringEquals(term, "cygwin") ||
  ------------------
  |  Branch (3307:29): [True: 0, False: 0]
  ------------------
 3308|      0|                            String::EndsWithCaseInsensitive(term, "-256color"));
  ------------------
  |  Branch (3308:29): [True: 0, False: 0]
  ------------------
 3309|      2|    return stdout_is_tty && term_supports_color;
  ------------------
  |  Branch (3309:12): [True: 0, False: 2]
  |  Branch (3309:29): [True: 0, False: 0]
  ------------------
 3310|      2|#endif  // GTEST_OS_WINDOWS
 3311|      2|  }
 3312|       |
 3313|      0|  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
  ------------------
  |  Branch (3313:10): [True: 0, False: 0]
  ------------------
 3314|      0|         String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
  ------------------
  |  Branch (3314:10): [True: 0, False: 0]
  ------------------
 3315|      0|         String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
  ------------------
  |  Branch (3315:10): [True: 0, False: 0]
  ------------------
 3316|      0|         String::CStringEquals(gtest_color, "1");
  ------------------
  |  Branch (3316:10): [True: 0, False: 0]
  ------------------
 3317|       |  // We take "yes", "true", "t", and "1" as meaning "yes".  If the
 3318|       |  // value is neither one of these nor "auto", we treat it as "no" to
 3319|       |  // be conservative.
 3320|      2|}
_ZN7testing8internal27PrettyUnitTestResultPrinter20OnTestIterationStartERKNS_8UnitTestEi:
 3441|      2|    const UnitTest& unit_test, int iteration) {
 3442|      2|  if (GTEST_FLAG_GET(repeat) != 1)
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  |  Branch (3442:7): [True: 0, False: 2]
  ------------------
 3443|      0|    printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
 3444|       |
 3445|      2|  std::string f = GTEST_FLAG_GET(filter);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 3446|      2|  const char* const filter = f.c_str();
 3447|       |
 3448|       |  // Prints the filter if it's not *.  This reminds the user that some
 3449|       |  // tests may be skipped.
 3450|      2|  if (!String::CStringEquals(filter, kUniversalFilter)) {
  ------------------
  |  Branch (3450:7): [True: 2, False: 0]
  ------------------
 3451|      2|    ColoredPrintf(GTestColor::kYellow, "Note: %s filter = %s\n", GTEST_NAME_,
  ------------------
  |  |  349|      2|#define GTEST_NAME_ "Google Test"
  ------------------
 3452|      2|                  filter);
 3453|      2|  }
 3454|       |
 3455|      2|  if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
  ------------------
  |  Branch (3455:7): [True: 0, False: 2]
  ------------------
 3456|      0|    const int32_t shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
 3457|      0|    ColoredPrintf(GTestColor::kYellow, "Note: This is test shard %d of %s.\n",
 3458|      0|                  static_cast<int>(shard_index) + 1,
 3459|      0|                  internal::posix::GetEnv(kTestTotalShards));
 3460|      0|  }
 3461|       |
 3462|      2|  if (GTEST_FLAG_GET(shuffle)) {
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3463|      0|    ColoredPrintf(GTestColor::kYellow,
 3464|      0|                  "Note: Randomizing tests' orders with a seed of %d .\n",
 3465|      0|                  unit_test.random_seed());
 3466|      0|  }
 3467|       |
 3468|      2|  ColoredPrintf(GTestColor::kGreen, "[==========] ");
 3469|      2|  printf("Running %s from %s.\n",
 3470|      2|         FormatTestCount(unit_test.test_to_run_count()).c_str(),
 3471|      2|         FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
 3472|       |  fflush(stdout);
 3473|      2|}
_ZN7testing8internal27PrettyUnitTestResultPrinter24OnEnvironmentsSetUpStartERKNS_8UnitTestE:
 3476|      2|    const UnitTest& /*unit_test*/) {
 3477|      2|  ColoredPrintf(GTestColor::kGreen, "[----------] ");
 3478|      2|  printf("Global test environment set-up.\n");
 3479|       |  fflush(stdout);
 3480|      2|}
_ZN7testing8internal27PrettyUnitTestResultPrinter15OnTestCaseStartERKNS_9TestSuiteE:
 3483|      2|void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
 3484|      2|  const std::string counts =
 3485|      2|      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
 3486|      2|  ColoredPrintf(GTestColor::kGreen, "[----------] ");
 3487|      2|  printf("%s from %s", counts.c_str(), test_case.name());
 3488|      2|  if (test_case.type_param() == nullptr) {
  ------------------
  |  Branch (3488:7): [True: 2, False: 0]
  ------------------
 3489|      2|    printf("\n");
 3490|      2|  } else {
 3491|      0|    printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
 3492|      0|  }
 3493|       |  fflush(stdout);
 3494|      2|}
_ZN7testing8internal27PrettyUnitTestResultPrinter11OnTestStartERKNS_8TestInfoE:
 3511|      2|void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
 3512|      2|  ColoredPrintf(GTestColor::kGreen, "[ RUN      ] ");
 3513|      2|  PrintTestName(test_info.test_suite_name(), test_info.name());
 3514|      2|  printf("\n");
 3515|       |  fflush(stdout);
 3516|      2|}
_ZN7testing8internal17TestEventRepeater6AppendEPNS_17TestEventListenerE:
 3862|      6|void TestEventRepeater::Append(TestEventListener* listener) {
 3863|      6|  listeners_.push_back(listener);
 3864|      6|}
_ZN7testing8internal17TestEventRepeater7ReleaseEPNS_17TestEventListenerE:
 3866|      2|TestEventListener* TestEventRepeater::Release(TestEventListener* listener) {
 3867|      2|  for (size_t i = 0; i < listeners_.size(); ++i) {
  ------------------
  |  Branch (3867:22): [True: 0, False: 2]
  ------------------
 3868|      0|    if (listeners_[i] == listener) {
  ------------------
  |  Branch (3868:9): [True: 0, False: 0]
  ------------------
 3869|      0|      listeners_.erase(listeners_.begin() + static_cast<int>(i));
 3870|      0|      return listener;
 3871|      0|    }
 3872|      0|  }
 3873|       |
 3874|      2|  return nullptr;
 3875|      2|}
_ZN7testing8internal17TestEventRepeater18OnTestProgramStartERKNS_8UnitTestE:
 3880|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3881|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3881:9): [True: 2, False: 0]
  ------------------
 3882|      8|      for (size_t i = 0; i < listeners_.size(); i++) {  \
  ------------------
  |  Branch (3882:26): [True: 6, False: 2]
  ------------------
 3883|      6|        listeners_[i]->Name(parameter);                 \
 3884|      6|      }                                                 \
 3885|      2|    }                                                   \
 3886|      2|  }
_ZN7testing8internal17TestEventRepeater24OnEnvironmentsSetUpStartERKNS_8UnitTestE:
 3880|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3881|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3881:9): [True: 2, False: 0]
  ------------------
 3882|      8|      for (size_t i = 0; i < listeners_.size(); i++) {  \
  ------------------
  |  Branch (3882:26): [True: 6, False: 2]
  ------------------
 3883|      6|        listeners_[i]->Name(parameter);                 \
 3884|      6|      }                                                 \
 3885|      2|    }                                                   \
 3886|      2|  }
_ZN7testing8internal17TestEventRepeater15OnTestCaseStartERKNS_9TestSuiteE:
 3880|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3881|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3881:9): [True: 2, False: 0]
  ------------------
 3882|      8|      for (size_t i = 0; i < listeners_.size(); i++) {  \
  ------------------
  |  Branch (3882:26): [True: 6, False: 2]
  ------------------
 3883|      6|        listeners_[i]->Name(parameter);                 \
 3884|      6|      }                                                 \
 3885|      2|    }                                                   \
 3886|      2|  }
_ZN7testing8internal17TestEventRepeater16OnTestSuiteStartERKNS_9TestSuiteE:
 3880|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3881|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3881:9): [True: 2, False: 0]
  ------------------
 3882|      8|      for (size_t i = 0; i < listeners_.size(); i++) {  \
  ------------------
  |  Branch (3882:26): [True: 6, False: 2]
  ------------------
 3883|      6|        listeners_[i]->Name(parameter);                 \
 3884|      6|      }                                                 \
 3885|      2|    }                                                   \
 3886|      2|  }
_ZN7testing8internal17TestEventRepeater11OnTestStartERKNS_8TestInfoE:
 3880|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3881|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3881:9): [True: 2, False: 0]
  ------------------
 3882|      8|      for (size_t i = 0; i < listeners_.size(); i++) {  \
  ------------------
  |  Branch (3882:26): [True: 6, False: 2]
  ------------------
 3883|      6|        listeners_[i]->Name(parameter);                 \
 3884|      6|      }                                                 \
 3885|      2|    }                                                   \
 3886|      2|  }
_ZN7testing8internal17TestEventRepeater22OnEnvironmentsSetUpEndERKNS_8UnitTestE:
 3890|      2|  void TestEventRepeater::Name(const Type& parameter) { \
 3891|      2|    if (forwarding_enabled_) {                          \
  ------------------
  |  Branch (3891:9): [True: 2, False: 0]
  ------------------
 3892|      8|      for (size_t i = listeners_.size(); i != 0; i--) { \
  ------------------
  |  Branch (3892:42): [True: 6, False: 2]
  ------------------
 3893|      6|        listeners_[i - 1]->Name(parameter);             \
 3894|      6|      }                                                 \
 3895|      2|    }                                                   \
 3896|      2|  }
_ZN7testing8internal17TestEventRepeater20OnTestIterationStartERKNS_8UnitTestEi:
 3923|      2|                                             int iteration) {
 3924|      2|  if (forwarding_enabled_) {
  ------------------
  |  Branch (3924:7): [True: 2, False: 0]
  ------------------
 3925|      8|    for (size_t i = 0; i < listeners_.size(); i++) {
  ------------------
  |  Branch (3925:24): [True: 6, False: 2]
  ------------------
 3926|      6|      listeners_[i]->OnTestIterationStart(unit_test, iteration);
 3927|      6|    }
 3928|      2|  }
 3929|      2|}
_ZN7testing8internal18OsStackTraceGetter16UponLeavingGTestEv:
 5115|      8|void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
 5116|       |#ifdef GTEST_HAS_ABSL
 5117|       |  void* caller_frame = nullptr;
 5118|       |  if (absl::GetStackTrace(&caller_frame, 1, 3) <= 0) {
 5119|       |    caller_frame = nullptr;
 5120|       |  }
 5121|       |
 5122|       |  MutexLock lock(&mutex_);
 5123|       |  caller_frame_ = caller_frame;
 5124|       |#endif  // GTEST_HAS_ABSL
 5125|      8|}
_ZN7testing18TestEventListenersC2Ev:
 5172|      2|    : repeater_(new internal::TestEventRepeater()),
 5173|      2|      default_result_printer_(nullptr),
 5174|      2|      default_xml_generator_(nullptr) {}
_ZN7testing18TestEventListeners6AppendEPNS_17TestEventListenerE:
 5182|      6|void TestEventListeners::Append(TestEventListener* listener) {
 5183|      6|  repeater_->Append(listener);
 5184|      6|}
_ZN7testing18TestEventListeners7ReleaseEPNS_17TestEventListenerE:
 5189|      2|TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
 5190|      2|  if (listener == default_result_printer_)
  ------------------
  |  Branch (5190:7): [True: 2, False: 0]
  ------------------
 5191|      2|    default_result_printer_ = nullptr;
 5192|      0|  else if (listener == default_xml_generator_)
  ------------------
  |  Branch (5192:12): [True: 0, False: 0]
  ------------------
 5193|      0|    default_xml_generator_ = nullptr;
 5194|      2|  return repeater_->Release(listener);
 5195|      2|}
_ZN7testing18TestEventListeners8repeaterEv:
 5199|      6|TestEventListener* TestEventListeners::repeater() { return repeater_; }
_ZN7testing18TestEventListeners23SetDefaultResultPrinterEPNS_17TestEventListenerE:
 5206|      2|void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
 5207|      2|  if (default_result_printer_ != listener) {
  ------------------
  |  Branch (5207:7): [True: 2, False: 0]
  ------------------
 5208|       |    // It is an error to pass this method a listener that is already in the
 5209|       |    // list.
 5210|      2|    delete Release(default_result_printer_);
 5211|      2|    default_result_printer_ = listener;
 5212|      2|    if (listener != nullptr) Append(listener);
  ------------------
  |  Branch (5212:9): [True: 2, False: 0]
  ------------------
 5213|      2|  }
 5214|      2|}
_ZN7testing8UnitTest11GetInstanceEv:
 5250|     56|UnitTest* UnitTest::GetInstance() {
 5251|       |  // CodeGear C++Builder insists on a public destructor for the
 5252|       |  // default implementation.  Use this implementation to keep good OO
 5253|       |  // design with private destructor.
 5254|       |
 5255|       |#if defined(__BORLANDC__)
 5256|       |  static UnitTest* const instance = new UnitTest;
 5257|       |  return instance;
 5258|       |#else
 5259|     56|  static UnitTest instance;
 5260|     56|  return &instance;
 5261|     56|#endif  // defined(__BORLANDC__)
 5262|     56|}
_ZNK7testing8UnitTest22total_test_suite_countEv:
 5275|      4|int UnitTest::total_test_suite_count() const {
 5276|      4|  return impl()->total_test_suite_count();
 5277|      4|}
_ZNK7testing8UnitTest23test_suite_to_run_countEv:
 5281|      2|int UnitTest::test_suite_to_run_count() const {
 5282|      2|  return impl()->test_suite_to_run_count();
 5283|      2|}
_ZNK7testing8UnitTest17test_to_run_countEv:
 5333|      2|int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
_ZNK7testing8UnitTest12GetTestSuiteEi:
 5356|     10|const TestSuite* UnitTest::GetTestSuite(int i) const {
 5357|     10|  return impl()->GetTestSuite(i);
 5358|     10|}
_ZN7testing8UnitTest16UponLeavingGTestEv:
 5379|      4|void UnitTest::UponLeavingGTest() {
 5380|      4|  impl()->os_stack_trace_getter()->UponLeavingGTest();
 5381|      4|}
_ZN7testing8UnitTest22set_current_test_suiteEPNS_9TestSuiteE:
 5384|      2|void UnitTest::set_current_test_suite(TestSuite* a_current_test_suite) {
 5385|      2|  internal::MutexLock lock(&mutex_);
 5386|      2|  impl_->set_current_test_suite(a_current_test_suite);
 5387|      2|}
_ZN7testing8UnitTest21set_current_test_infoEPNS_8TestInfoE:
 5390|      2|void UnitTest::set_current_test_info(TestInfo* a_current_test_info) {
 5391|      2|  internal::MutexLock lock(&mutex_);
 5392|      2|  impl_->set_current_test_info(a_current_test_info);
 5393|      2|}
_ZN7testing8UnitTest9listenersEv:
 5397|      8|TestEventListeners& UnitTest::listeners() { return *impl()->listeners(); }
_ZN7testing8UnitTest14RecordPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 5500|      2|                              const std::string& value) {
 5501|      2|  impl_->RecordProperty(TestProperty(key, value));
 5502|      2|}
_ZN7testing8UnitTest3RunEv:
 5509|      2|int UnitTest::Run() {
 5510|      2|#ifdef GTEST_HAS_DEATH_TEST
 5511|      2|  const bool in_death_test_child_process =
 5512|      2|      !GTEST_FLAG_GET(internal_run_death_test).empty();
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 5513|       |
 5514|       |  // Google Test implements this protocol for catching that a test
 5515|       |  // program exits before returning control to Google Test:
 5516|       |  //
 5517|       |  //   1. Upon start, Google Test creates a file whose absolute path
 5518|       |  //      is specified by the environment variable
 5519|       |  //      TEST_PREMATURE_EXIT_FILE.
 5520|       |  //   2. When Google Test has finished its work, it deletes the file.
 5521|       |  //
 5522|       |  // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
 5523|       |  // running a Google-Test-based test program and check the existence
 5524|       |  // of the file at the end of the test execution to see if it has
 5525|       |  // exited prematurely.
 5526|       |
 5527|       |  // If we are in the child process of a death test, don't
 5528|       |  // create/delete the premature exit file, as doing so is unnecessary
 5529|       |  // and will confuse the parent process.  Otherwise, create/delete
 5530|       |  // the file upon entering/leaving this function.  If the program
 5531|       |  // somehow exits before this function has a chance to return, the
 5532|       |  // premature-exit file will be left undeleted, causing a test runner
 5533|       |  // that understands the premature-exit-file protocol to report the
 5534|       |  // test as having failed.
 5535|      2|  const internal::ScopedPrematureExitFile premature_exit_file(
 5536|      2|      in_death_test_child_process
  ------------------
  |  Branch (5536:7): [True: 0, False: 2]
  ------------------
 5537|      2|          ? nullptr
 5538|      2|          : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
 5539|       |#else
 5540|       |  const bool in_death_test_child_process = false;
 5541|       |#endif  // GTEST_HAS_DEATH_TEST
 5542|       |
 5543|       |  // Captures the value of GTEST_FLAG(catch_exceptions).  This value will be
 5544|       |  // used for the duration of the program.
 5545|      2|  impl()->set_catch_exceptions(GTEST_FLAG_GET(catch_exceptions));
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 5546|       |
 5547|       |#ifdef GTEST_OS_WINDOWS
 5548|       |  // Either the user wants Google Test to catch exceptions thrown by the
 5549|       |  // tests or this is executing in the context of death test child
 5550|       |  // process. In either case the user does not want to see pop-up dialogs
 5551|       |  // about crashes - they are expected.
 5552|       |  if (impl()->catch_exceptions() || in_death_test_child_process) {
 5553|       |#if !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_PHONE) && \
 5554|       |    !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_GAMES)
 5555|       |    // SetErrorMode doesn't exist on CE.
 5556|       |    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
 5557|       |                 SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
 5558|       |#endif  // !GTEST_OS_WINDOWS_MOBILE
 5559|       |
 5560|       |#if (defined(_MSC_VER) || defined(GTEST_OS_WINDOWS_MINGW)) && \
 5561|       |    !defined(GTEST_OS_WINDOWS_MOBILE)
 5562|       |    // Death test children can be terminated with _abort().  On Windows,
 5563|       |    // _abort() can show a dialog with a warning message.  This forces the
 5564|       |    // abort message to go to stderr instead.
 5565|       |    _set_error_mode(_OUT_TO_STDERR);
 5566|       |#endif
 5567|       |
 5568|       |#if defined(_MSC_VER) && !defined(GTEST_OS_WINDOWS_MOBILE)
 5569|       |    // In the debug version, Visual Studio pops up a separate dialog
 5570|       |    // offering a choice to debug the aborted program. We need to suppress
 5571|       |    // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
 5572|       |    // executed. Google Test will notify the user of any unexpected
 5573|       |    // failure via stderr.
 5574|       |    if (!GTEST_FLAG_GET(break_on_failure))
 5575|       |      _set_abort_behavior(
 5576|       |          0x0,                                    // Clear the following flags:
 5577|       |          _WRITE_ABORT_MSG | _CALL_REPORTFAULT);  // pop-up window, core dump.
 5578|       |
 5579|       |    // In debug mode, the Windows CRT can crash with an assertion over invalid
 5580|       |    // input (e.g. passing an invalid file descriptor).  The default handling
 5581|       |    // for these assertions is to pop up a dialog and wait for user input.
 5582|       |    // Instead ask the CRT to dump such assertions to stderr non-interactively.
 5583|       |    if (!IsDebuggerPresent()) {
 5584|       |      (void)_CrtSetReportMode(_CRT_ASSERT,
 5585|       |                              _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
 5586|       |      (void)_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
 5587|       |    }
 5588|       |#endif
 5589|       |  }
 5590|       |#else
 5591|      2|  (void)in_death_test_child_process;  // Needed inside the #if block above
 5592|      2|#endif  // GTEST_OS_WINDOWS
 5593|       |
 5594|      2|  return internal::HandleExceptionsInMethodIfSupported(
  ------------------
  |  Branch (5594:10): [True: 0, False: 2]
  ------------------
 5595|      2|             impl(), &internal::UnitTestImpl::RunAllTests,
 5596|      2|             "auxiliary test code (environments or event listeners)")
 5597|      2|             ? 0
 5598|      2|             : 1;
 5599|      2|}
_ZN7testing8UnitTest27parameterized_test_registryEv:
 5640|      2|UnitTest::parameterized_test_registry() GTEST_LOCK_EXCLUDED_(mutex_) {
 5641|      2|  return impl_->parameterized_test_registry();
 5642|      2|}
_ZN7testing8UnitTestC2Ev:
 5645|      2|UnitTest::UnitTest() { impl_ = new internal::UnitTestImpl(this); }
_ZN7testing8internal12UnitTestImplC2EPNS_8UnitTestE:
 5667|      2|    : parent_(parent),
 5668|       |      GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
 5669|      2|          default_global_test_part_result_reporter_(this),
 5670|      2|      default_per_thread_test_part_result_reporter_(this),
 5671|       |      GTEST_DISABLE_MSC_WARNINGS_POP_() global_test_part_result_reporter_(
 5672|      2|          &default_global_test_part_result_reporter_),
 5673|      2|      per_thread_test_part_result_reporter_(
 5674|      2|          &default_per_thread_test_part_result_reporter_),
 5675|      2|      parameterized_test_registry_(),
 5676|      2|      parameterized_tests_registered_(false),
 5677|      2|      last_death_test_suite_(-1),
 5678|      2|      current_test_suite_(nullptr),
 5679|      2|      current_test_info_(nullptr),
 5680|      2|      ad_hoc_test_result_(),
 5681|      2|      os_stack_trace_getter_(nullptr),
 5682|      2|      post_flag_parse_init_performed_(false),
 5683|      2|      random_seed_(0),  // Will be overridden by the flag before first use.
 5684|      2|      random_(0),       // Will be reseeded before first use.
 5685|      2|      start_timestamp_(0),
 5686|      2|      elapsed_time_(0),
 5687|       |#ifdef GTEST_HAS_DEATH_TEST
 5688|      2|      death_test_factory_(new DefaultDeathTestFactory),
 5689|       |#endif
 5690|       |      // Will be overridden by the flag before first use.
 5691|      2|      catch_exceptions_(false) {
 5692|      2|  listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
 5693|      2|}
_ZN7testing8internal12UnitTestImpl14RecordPropertyERKNS_12TestPropertyE:
 5710|      2|void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
 5711|      2|  std::string xml_element;
 5712|      2|  TestResult* test_result;  // TestResult appropriate for property recording.
 5713|       |
 5714|      2|  if (current_test_info_ != nullptr) {
  ------------------
  |  Branch (5714:7): [True: 2, False: 0]
  ------------------
 5715|      2|    xml_element = "testcase";
 5716|      2|    test_result = &(current_test_info_->result_);
 5717|      2|  } else if (current_test_suite_ != nullptr) {
  ------------------
  |  Branch (5717:14): [True: 0, False: 0]
  ------------------
 5718|      0|    xml_element = "testsuite";
 5719|      0|    test_result = &(current_test_suite_->ad_hoc_test_result_);
 5720|      0|  } else {
 5721|      0|    xml_element = "testsuites";
 5722|      0|    test_result = &ad_hoc_test_result_;
 5723|      0|  }
 5724|      2|  test_result->RecordProperty(xml_element, test_property);
 5725|      2|}
_ZN7testing8internal12UnitTestImpl32SuppressTestEventsIfInSubprocessEv:
 5730|      2|void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
 5731|      2|  if (internal_run_death_test_flag_ != nullptr)
  ------------------
  |  Branch (5731:7): [True: 0, False: 2]
  ------------------
 5732|      0|    listeners()->SuppressEventForwarding(true);
 5733|      2|}
_ZN7testing8internal12UnitTestImpl18ConfigureXmlOutputEv:
 5738|      2|void UnitTestImpl::ConfigureXmlOutput() {
 5739|      2|  const std::string& output_format = UnitTestOptions::GetOutputFormat();
 5740|      2|#if GTEST_HAS_FILE_SYSTEM
 5741|      2|  if (output_format == "xml") {
  ------------------
  |  Branch (5741:7): [True: 0, False: 2]
  ------------------
 5742|      0|    listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
 5743|      0|        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
 5744|      2|  } else if (output_format == "json") {
  ------------------
  |  Branch (5744:14): [True: 0, False: 2]
  ------------------
 5745|      0|    listeners()->SetDefaultXmlGenerator(new JsonUnitTestResultPrinter(
 5746|      0|        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
 5747|      2|  } else if (!output_format.empty()) {
  ------------------
  |  Branch (5747:14): [True: 0, False: 2]
  ------------------
 5748|      0|    GTEST_LOG_(WARNING) << "WARNING: unrecognized output format \""
  ------------------
  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  | 1064|      0|      .GetStream()
  ------------------
 5749|      0|                        << output_format << "\" ignored.";
 5750|      0|  }
 5751|       |#else
 5752|       |  if (!output_format.empty()) {
 5753|       |    GTEST_LOG_(ERROR) << "ERROR: alternative output formats require "
 5754|       |                      << "GTEST_HAS_FILE_SYSTEM to be enabled";
 5755|       |  }
 5756|       |#endif  // GTEST_HAS_FILE_SYSTEM
 5757|      2|}
_ZN7testing8internal12UnitTestImpl24ConfigureStreamingOutputEv:
 5762|      2|void UnitTestImpl::ConfigureStreamingOutput() {
 5763|      2|  const std::string& target = GTEST_FLAG_GET(stream_result_to);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 5764|      2|  if (!target.empty()) {
  ------------------
  |  Branch (5764:7): [True: 0, False: 2]
  ------------------
 5765|      0|    const size_t pos = target.find(':');
 5766|      0|    if (pos != std::string::npos) {
  ------------------
  |  Branch (5766:9): [True: 0, False: 0]
  ------------------
 5767|      0|      listeners()->Append(
 5768|      0|          new StreamingListener(target.substr(0, pos), target.substr(pos + 1)));
 5769|      0|    } else {
 5770|      0|      GTEST_LOG_(WARNING) << "unrecognized streaming target \"" << target
  ------------------
  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  | 1064|      0|      .GetStream()
  ------------------
 5771|      0|                          << "\" ignored.";
 5772|      0|    }
 5773|      0|  }
 5774|      2|}
_ZN7testing8internal12UnitTestImpl19PostFlagParsingInitEv:
 5782|      4|void UnitTestImpl::PostFlagParsingInit() {
 5783|       |  // Ensures that this function does not execute more than once.
 5784|      4|  if (!post_flag_parse_init_performed_) {
  ------------------
  |  Branch (5784:7): [True: 2, False: 2]
  ------------------
 5785|      2|    post_flag_parse_init_performed_ = true;
 5786|       |
 5787|       |#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
 5788|       |    // Register to send notifications about key process state changes.
 5789|       |    listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
 5790|       |#endif  // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
 5791|       |
 5792|      2|#ifdef GTEST_HAS_DEATH_TEST
 5793|      2|    InitDeathTestSubprocessControlInfo();
 5794|      2|    SuppressTestEventsIfInSubprocess();
 5795|      2|#endif  // GTEST_HAS_DEATH_TEST
 5796|       |
 5797|       |    // Registers parameterized tests. This makes parameterized tests
 5798|       |    // available to the UnitTest reflection API without running
 5799|       |    // RUN_ALL_TESTS.
 5800|      2|    RegisterParameterizedTests();
 5801|       |
 5802|       |    // Configures listeners for XML output. This makes it possible for users
 5803|       |    // to shut down the default XML output before invoking RUN_ALL_TESTS.
 5804|      2|    ConfigureXmlOutput();
 5805|       |
 5806|      2|    if (GTEST_FLAG_GET(brief)) {
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 5807|      0|      listeners()->SetDefaultResultPrinter(new BriefUnitTestResultPrinter);
 5808|      0|    }
 5809|       |
 5810|      2|#if GTEST_CAN_STREAM_RESULTS_
 5811|       |    // Configures listeners for streaming test results to the specified server.
 5812|      2|    ConfigureStreamingOutput();
 5813|      2|#endif  // GTEST_CAN_STREAM_RESULTS_
 5814|       |
 5815|       |#ifdef GTEST_HAS_ABSL
 5816|       |    if (GTEST_FLAG_GET(install_failure_signal_handler)) {
 5817|       |      absl::FailureSignalHandlerOptions options;
 5818|       |      absl::InstallFailureSignalHandler(options);
 5819|       |    }
 5820|       |#endif  // GTEST_HAS_ABSL
 5821|      2|  }
 5822|      4|}
_ZN7testing8internal12UnitTestImpl12GetTestSuiteERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPKcPFvvESE_:
 5839|      4|    internal::TearDownTestSuiteFunc tear_down_tc) {
 5840|       |  // During initialization, all TestInfos for a given suite are added in
 5841|       |  // sequence. To optimize this case, see if the most recently added suite is
 5842|       |  // the one being requested now.
 5843|      4|  if (!test_suites_.empty() &&
  ------------------
  |  Branch (5843:7): [True: 2, False: 2]
  |  Branch (5843:7): [True: 2, False: 2]
  ------------------
 5844|      2|      (*test_suites_.rbegin())->name_ == test_suite_name) {
  ------------------
  |  Branch (5844:7): [True: 2, False: 0]
  ------------------
 5845|      2|    return *test_suites_.rbegin();
 5846|      2|  }
 5847|       |
 5848|       |  // Fall back to searching the collection.
 5849|      2|  auto item_it = test_suites_by_name_.find(test_suite_name);
 5850|      2|  if (item_it != test_suites_by_name_.end()) {
  ------------------
  |  Branch (5850:7): [True: 0, False: 2]
  ------------------
 5851|      0|    return item_it->second;
 5852|      0|  }
 5853|       |
 5854|       |  // Not found. Create a new instance.
 5855|      2|  auto* const new_test_suite =
 5856|      2|      new TestSuite(test_suite_name, type_param, set_up_tc, tear_down_tc);
 5857|      2|  test_suites_by_name_.emplace(test_suite_name, new_test_suite);
 5858|       |
 5859|      2|  const UnitTestFilter death_test_suite_filter(kDeathTestSuiteFilter);
 5860|       |  // Is this a death test suite?
 5861|      2|  if (death_test_suite_filter.MatchesName(test_suite_name)) {
  ------------------
  |  Branch (5861:7): [True: 0, False: 2]
  ------------------
 5862|       |    // Yes.  Inserts the test suite after the last death test suite
 5863|       |    // defined so far.  This only works when the test suites haven't
 5864|       |    // been shuffled.  Otherwise we may end up running a death test
 5865|       |    // after a non-death test.
 5866|      0|    ++last_death_test_suite_;
 5867|      0|    test_suites_.insert(test_suites_.begin() + last_death_test_suite_,
 5868|      0|                        new_test_suite);
 5869|      2|  } else {
 5870|       |    // No.  Appends to the end of the list.
 5871|      2|    test_suites_.push_back(new_test_suite);
 5872|      2|  }
 5873|       |
 5874|      2|  test_suite_indices_.push_back(static_cast<int>(test_suite_indices_.size()));
 5875|      2|  return new_test_suite;
 5876|      2|}
_ZN7testing8internal12UnitTestImpl11RunAllTestsEv:
 5909|      2|bool UnitTestImpl::RunAllTests() {
 5910|       |  // True if and only if Google Test is initialized before RUN_ALL_TESTS() is
 5911|       |  // called.
 5912|      2|  const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized();
 5913|       |
 5914|       |  // Do not run any test if the --help flag was specified.
 5915|      2|  if (g_help_flag) return true;
  ------------------
  |  Branch (5915:7): [True: 0, False: 2]
  ------------------
 5916|       |
 5917|       |  // Repeats the call to the post-flag parsing initialization in case the
 5918|       |  // user didn't call InitGoogleTest.
 5919|      2|  PostFlagParsingInit();
 5920|       |
 5921|       |  // Handle the case where the program has no tests linked.
 5922|       |  // Sometimes this is a programmer mistake, but sometimes it is intended.
 5923|      2|  if (total_test_count() == 0) {
  ------------------
  |  Branch (5923:7): [True: 0, False: 2]
  ------------------
 5924|      0|    constexpr char kNoTestLinkedMessage[] =
 5925|      0|        "This test program does NOT link in any test case.";
 5926|      0|    constexpr char kNoTestLinkedFatal[] =
 5927|      0|        "This is INVALID. Please make sure to link in at least one test case.";
 5928|      0|    constexpr char kNoTestLinkedWarning[] =
 5929|      0|        "Please make sure this is intended.";
 5930|      0|    const bool fail_if_no_test_linked = GTEST_FLAG_GET(fail_if_no_test_linked);
  ------------------
  |  | 2310|      0|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 5931|      0|    ColoredPrintf(
 5932|      0|        GTestColor::kRed, "%s %s\n", kNoTestLinkedMessage,
 5933|      0|        fail_if_no_test_linked ? kNoTestLinkedFatal : kNoTestLinkedWarning);
  ------------------
  |  Branch (5933:9): [True: 0, False: 0]
  ------------------
 5934|      0|    if (fail_if_no_test_linked) {
  ------------------
  |  Branch (5934:9): [True: 0, False: 0]
  ------------------
 5935|      0|      return false;
 5936|      0|    }
 5937|      0|#if GTEST_HAS_FILE_SYSTEM
 5938|      0|    AppendToTestWarningsOutputFile(std::string(kNoTestLinkedMessage) + ' ' +
 5939|      0|                                   kNoTestLinkedWarning + '\n');
 5940|      0|#endif  // GTEST_HAS_FILE_SYSTEM
 5941|      0|  }
 5942|       |
 5943|      2|#if GTEST_HAS_FILE_SYSTEM
 5944|       |  // Even if sharding is not on, test runners may want to use the
 5945|       |  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
 5946|       |  // protocol.
 5947|      2|  internal::WriteToShardStatusFileIfNeeded();
 5948|      2|#endif  // GTEST_HAS_FILE_SYSTEM
 5949|       |
 5950|       |  // True if and only if we are in a subprocess for running a thread-safe-style
 5951|       |  // death test.
 5952|      2|  bool in_subprocess_for_death_test = false;
 5953|       |
 5954|      2|#ifdef GTEST_HAS_DEATH_TEST
 5955|      2|  in_subprocess_for_death_test = (internal_run_death_test_flag_ != nullptr);
 5956|       |#if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
 5957|       |  if (in_subprocess_for_death_test) {
 5958|       |    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
 5959|       |  }
 5960|       |#endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
 5961|      2|#endif  // GTEST_HAS_DEATH_TEST
 5962|       |
 5963|      2|  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
 5964|      2|                                        in_subprocess_for_death_test);
 5965|       |
 5966|       |  // Compares the full test names with the filter to decide which
 5967|       |  // tests to run.
 5968|      2|  const bool has_tests_to_run =
 5969|      2|      FilterTests(should_shard ? HONOR_SHARDING_PROTOCOL
  ------------------
  |  Branch (5969:19): [True: 0, False: 2]
  ------------------
 5970|      2|                               : IGNORE_SHARDING_PROTOCOL) > 0;
 5971|       |
 5972|       |  // Lists the tests and exits if the --gtest_list_tests flag was specified.
 5973|      2|  if (GTEST_FLAG_GET(list_tests)) {
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 5974|       |    // This must be called *after* FilterTests() has been called.
 5975|      0|    ListTestsMatchingFilter();
 5976|      0|    return true;
 5977|      0|  }
 5978|       |
 5979|      2|  random_seed_ = GetRandomSeedFromFlag(GTEST_FLAG_GET(random_seed));
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 5980|       |
 5981|       |  // True if and only if at least one test has failed.
 5982|      2|  bool failed = false;
 5983|       |
 5984|      2|  TestEventListener* repeater = listeners()->repeater();
 5985|       |
 5986|      2|  start_timestamp_ = GetTimeInMillis();
 5987|      2|  repeater->OnTestProgramStart(*parent_);
 5988|       |
 5989|       |  // How many times to repeat the tests?  We don't want to repeat them
 5990|       |  // when we are inside the subprocess of a death test.
 5991|      2|  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG_GET(repeat);
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
  |  Branch (5991:22): [True: 0, False: 2]
  ------------------
 5992|       |
 5993|       |  // Repeats forever if the repeat count is negative.
 5994|      2|  const bool gtest_repeat_forever = repeat < 0;
 5995|       |
 5996|       |  // Should test environments be set up and torn down for each repeat, or only
 5997|       |  // set up on the first and torn down on the last iteration? If there is no
 5998|       |  // "last" iteration because the tests will repeat forever, always recreate the
 5999|       |  // environments to avoid leaks in case one of the environments is using
 6000|       |  // resources that are external to this process. Without this check there would
 6001|       |  // be no way to clean up those external resources automatically.
 6002|      2|  const bool recreate_environments_when_repeating =
 6003|      2|      GTEST_FLAG_GET(recreate_environments_when_repeating) ||
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 6004|      2|      gtest_repeat_forever;
  ------------------
  |  Branch (6004:7): [True: 0, False: 2]
  ------------------
 6005|       |
 6006|      4|  for (int i = 0; gtest_repeat_forever || i != repeat; i++) {
  ------------------
  |  Branch (6006:19): [True: 2, False: 2]
  |  Branch (6006:43): [True: 2, False: 0]
  ------------------
 6007|       |    // We want to preserve failures generated by ad-hoc test
 6008|       |    // assertions executed before RUN_ALL_TESTS().
 6009|      2|    ClearNonAdHocTestResult();
 6010|       |
 6011|      2|    Timer timer;
 6012|       |
 6013|       |    // Shuffles test suites and tests if requested.
 6014|      2|    if (has_tests_to_run && GTEST_FLAG_GET(shuffle)) {
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (6014:9): [True: 2, False: 0]
  ------------------
 6015|      0|      random()->Reseed(static_cast<uint32_t>(random_seed_));
 6016|       |      // This should be done before calling OnTestIterationStart(),
 6017|       |      // such that a test event listener can see the actual test order
 6018|       |      // in the event.
 6019|      0|      ShuffleTests();
 6020|      0|    }
 6021|       |
 6022|       |    // Tells the unit test event listeners that the tests are about to start.
 6023|      2|    repeater->OnTestIterationStart(*parent_, i);
 6024|       |
 6025|       |    // Runs each test suite if there is at least one test to run.
 6026|      2|    if (has_tests_to_run) {
  ------------------
  |  Branch (6026:9): [True: 2, False: 0]
  ------------------
 6027|       |      // Sets up all environments beforehand. If test environments aren't
 6028|       |      // recreated for each iteration, only do so on the first iteration.
 6029|      2|      if (i == 0 || recreate_environments_when_repeating) {
  ------------------
  |  Branch (6029:11): [True: 2, False: 0]
  |  Branch (6029:21): [True: 0, False: 0]
  ------------------
 6030|      2|        repeater->OnEnvironmentsSetUpStart(*parent_);
 6031|      2|        ForEach(environments_, SetUpEnvironment);
 6032|      2|        repeater->OnEnvironmentsSetUpEnd(*parent_);
 6033|      2|      }
 6034|       |
 6035|       |      // Runs the tests only if there was no fatal failure or skip triggered
 6036|       |      // during global set-up.
 6037|      2|      if (Test::IsSkipped()) {
  ------------------
  |  Branch (6037:11): [True: 0, False: 2]
  ------------------
 6038|       |        // Emit diagnostics when global set-up calls skip, as it will not be
 6039|       |        // emitted by default.
 6040|      0|        TestResult& test_result =
 6041|      0|            *internal::GetUnitTestImpl()->current_test_result();
 6042|      0|        for (int j = 0; j < test_result.total_part_count(); ++j) {
  ------------------
  |  Branch (6042:25): [True: 0, False: 0]
  ------------------
 6043|      0|          const TestPartResult& test_part_result =
 6044|      0|              test_result.GetTestPartResult(j);
 6045|      0|          if (test_part_result.type() == TestPartResult::kSkip) {
  ------------------
  |  Branch (6045:15): [True: 0, False: 0]
  ------------------
 6046|      0|            const std::string& result = test_part_result.message();
 6047|      0|            printf("%s\n", result.c_str());
 6048|      0|          }
 6049|      0|        }
 6050|      0|        fflush(stdout);
 6051|      2|      } else if (!Test::HasFatalFailure()) {
  ------------------
  |  Branch (6051:18): [True: 2, False: 0]
  ------------------
 6052|      4|        for (int test_index = 0; test_index < total_test_suite_count();
  ------------------
  |  Branch (6052:34): [True: 2, False: 2]
  ------------------
 6053|      2|             test_index++) {
 6054|      2|          GetMutableSuiteCase(test_index)->Run();
 6055|      2|          if (GTEST_FLAG_GET(fail_fast) &&
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 6056|      0|              GetMutableSuiteCase(test_index)->Failed()) {
  ------------------
  |  Branch (6056:15): [True: 0, False: 0]
  ------------------
 6057|      0|            for (int j = test_index + 1; j < total_test_suite_count(); j++) {
  ------------------
  |  Branch (6057:42): [True: 0, False: 0]
  ------------------
 6058|      0|              GetMutableSuiteCase(j)->Skip();
 6059|      0|            }
 6060|      0|            break;
 6061|      0|          }
 6062|      2|        }
 6063|      2|      } else if (Test::HasFatalFailure()) {
  ------------------
  |  Branch (6063:18): [True: 0, False: 0]
  ------------------
 6064|       |        // If there was a fatal failure during the global setup then we know we
 6065|       |        // aren't going to run any tests. Explicitly mark all of the tests as
 6066|       |        // skipped to make this obvious in the output.
 6067|      0|        for (int test_index = 0; test_index < total_test_suite_count();
  ------------------
  |  Branch (6067:34): [True: 0, False: 0]
  ------------------
 6068|      0|             test_index++) {
 6069|      0|          GetMutableSuiteCase(test_index)->Skip();
 6070|      0|        }
 6071|      0|      }
 6072|       |
 6073|       |      // Tears down all environments in reverse order afterwards. If test
 6074|       |      // environments aren't recreated for each iteration, only do so on the
 6075|       |      // last iteration.
 6076|      2|      if (i == repeat - 1 || recreate_environments_when_repeating) {
  ------------------
  |  Branch (6076:11): [True: 2, False: 0]
  |  Branch (6076:30): [True: 0, False: 0]
  ------------------
 6077|      0|        repeater->OnEnvironmentsTearDownStart(*parent_);
 6078|      0|        std::for_each(environments_.rbegin(), environments_.rend(),
 6079|      0|                      TearDownEnvironment);
 6080|      0|        repeater->OnEnvironmentsTearDownEnd(*parent_);
 6081|      0|      }
 6082|      2|    }
 6083|       |
 6084|      2|    elapsed_time_ = timer.Elapsed();
 6085|       |
 6086|       |    // Tells the unit test event listener that the tests have just finished.
 6087|      2|    repeater->OnTestIterationEnd(*parent_, i);
 6088|       |
 6089|       |    // Gets the result and clears it.
 6090|      2|    if (!Passed()) {
  ------------------
  |  Branch (6090:9): [True: 0, False: 2]
  ------------------
 6091|      0|      failed = true;
 6092|      0|    }
 6093|       |
 6094|       |    // Restores the original test order after the iteration.  This
 6095|       |    // allows the user to quickly repro a failure that happens in the
 6096|       |    // N-th iteration without repeating the first (N - 1) iterations.
 6097|       |    // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
 6098|       |    // case the user somehow changes the value of the flag somewhere
 6099|       |    // (it's always safe to unshuffle the tests).
 6100|      2|    UnshuffleTests();
 6101|       |
 6102|      2|    if (GTEST_FLAG_GET(shuffle)) {
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 6103|       |      // Picks a new random seed for each iteration.
 6104|      0|      random_seed_ = GetNextRandomSeed(random_seed_);
 6105|      0|    }
 6106|      2|  }
 6107|       |
 6108|      2|  repeater->OnTestProgramEnd(*parent_);
 6109|       |  // Destroy environments in normal code, not in static teardown.
 6110|      2|  bool delete_environment_on_teardown = true;
 6111|      2|  if (delete_environment_on_teardown) {
  ------------------
  |  Branch (6111:7): [True: 0, False: 2]
  ------------------
 6112|      0|    ForEach(environments_, internal::Delete<Environment>);
 6113|      0|    environments_.clear();
 6114|      0|  }
 6115|       |
 6116|       |  // Try to warn the user if no tests matched the test filter.
 6117|      2|  if (ShouldWarnIfNoTestsMatchFilter()) {
  ------------------
  |  Branch (6117:7): [True: 0, False: 2]
  ------------------
 6118|      0|    const std::string filter_warning =
 6119|      0|        std::string("filter \"") + GTEST_FLAG_GET(filter) +
  ------------------
  |  | 2310|      0|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 6120|      0|        "\" did not match any test; no tests were run\n";
 6121|      0|    ColoredPrintf(GTestColor::kRed, "WARNING: %s", filter_warning.c_str());
 6122|      0|#if GTEST_HAS_FILE_SYSTEM
 6123|      0|    AppendToTestWarningsOutputFile(filter_warning);
 6124|      0|#endif  // GTEST_HAS_FILE_SYSTEM
 6125|      0|  }
 6126|       |
 6127|      2|  if (!gtest_is_initialized_before_run_all_tests) {
  ------------------
  |  Branch (6127:7): [True: 0, False: 2]
  ------------------
 6128|      0|    ColoredPrintf(
 6129|      0|        GTestColor::kRed,
 6130|      0|        "\nIMPORTANT NOTICE - DO NOT IGNORE:\n"
 6131|      0|        "This test program did NOT call " GTEST_INIT_GOOGLE_TEST_NAME_
 6132|      0|        "() before calling RUN_ALL_TESTS(). This is INVALID. Soon " GTEST_NAME_
 6133|      0|        " will start to enforce the valid usage. "
 6134|      0|        "Please fix it ASAP, or IT WILL START TO FAIL.\n");  // NOLINT
 6135|      0|  }
 6136|       |
 6137|      2|  return !failed;
 6138|      2|}
_ZN7testing8internal30WriteToShardStatusFileIfNeededEv:
 6145|      2|void WriteToShardStatusFileIfNeeded() {
 6146|      2|  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
 6147|      2|  if (test_shard_file != nullptr) {
  ------------------
  |  Branch (6147:7): [True: 0, False: 2]
  ------------------
 6148|      0|    FILE* const file = posix::FOpen(test_shard_file, "w");
 6149|      0|    if (file == nullptr) {
  ------------------
  |  Branch (6149:9): [True: 0, False: 0]
  ------------------
 6150|      0|      ColoredPrintf(GTestColor::kRed,
 6151|      0|                    "Could not write to the test shard status file \"%s\" "
 6152|      0|                    "specified by the %s environment variable.\n",
 6153|      0|                    test_shard_file, kTestShardStatusFile);
 6154|      0|      fflush(stdout);
 6155|      0|      exit(EXIT_FAILURE);
 6156|      0|    }
 6157|      0|    fclose(file);
 6158|      0|  }
 6159|      2|}
_ZN7testing8internal11ShouldShardEPKcS2_b:
 6169|      4|                 bool in_subprocess_for_death_test) {
 6170|      4|  if (in_subprocess_for_death_test) {
  ------------------
  |  Branch (6170:7): [True: 0, False: 4]
  ------------------
 6171|      0|    return false;
 6172|      0|  }
 6173|       |
 6174|      4|  const int32_t total_shards = Int32FromEnvOrDie(total_shards_env, -1);
 6175|      4|  const int32_t shard_index = Int32FromEnvOrDie(shard_index_env, -1);
 6176|       |
 6177|      4|  if (total_shards == -1 && shard_index == -1) {
  ------------------
  |  Branch (6177:7): [True: 4, False: 0]
  |  Branch (6177:29): [True: 4, False: 0]
  ------------------
 6178|      4|    return false;
 6179|      4|  } else if (total_shards == -1 && shard_index != -1) {
  ------------------
  |  Branch (6179:14): [True: 0, False: 0]
  |  Branch (6179:36): [True: 0, False: 0]
  ------------------
 6180|      0|    const Message msg = Message() << "Invalid environment variables: you have "
 6181|      0|                                  << kTestShardIndex << " = " << shard_index
 6182|      0|                                  << ", but have left " << kTestTotalShards
 6183|      0|                                  << " unset.\n";
 6184|      0|    ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
 6185|      0|    fflush(stdout);
 6186|      0|    exit(EXIT_FAILURE);
 6187|      0|  } else if (total_shards != -1 && shard_index == -1) {
  ------------------
  |  Branch (6187:14): [True: 0, False: 0]
  |  Branch (6187:36): [True: 0, False: 0]
  ------------------
 6188|      0|    const Message msg = Message()
 6189|      0|                        << "Invalid environment variables: you have "
 6190|      0|                        << kTestTotalShards << " = " << total_shards
 6191|      0|                        << ", but have left " << kTestShardIndex << " unset.\n";
 6192|      0|    ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
 6193|      0|    fflush(stdout);
 6194|      0|    exit(EXIT_FAILURE);
 6195|      0|  } else if (shard_index < 0 || shard_index >= total_shards) {
  ------------------
  |  Branch (6195:14): [True: 0, False: 0]
  |  Branch (6195:33): [True: 0, False: 0]
  ------------------
 6196|      0|    const Message msg =
 6197|      0|        Message() << "Invalid environment variables: we require 0 <= "
 6198|      0|                  << kTestShardIndex << " < " << kTestTotalShards
 6199|      0|                  << ", but you have " << kTestShardIndex << "=" << shard_index
 6200|      0|                  << ", " << kTestTotalShards << "=" << total_shards << ".\n";
 6201|      0|    ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
 6202|      0|    fflush(stdout);
 6203|      0|    exit(EXIT_FAILURE);
 6204|      0|  }
 6205|       |
 6206|      0|  return total_shards > 1;
 6207|      4|}
_ZN7testing8internal17Int32FromEnvOrDieEPKci:
 6212|      8|int32_t Int32FromEnvOrDie(const char* var, int32_t default_val) {
 6213|      8|  const char* str_val = posix::GetEnv(var);
 6214|      8|  if (str_val == nullptr) {
  ------------------
  |  Branch (6214:7): [True: 8, False: 0]
  ------------------
 6215|      8|    return default_val;
 6216|      8|  }
 6217|       |
 6218|      0|  int32_t result;
 6219|      0|  if (!ParseInt32(Message() << "The value of environment variable " << var,
  ------------------
  |  Branch (6219:7): [True: 0, False: 0]
  ------------------
 6220|      0|                  str_val, &result)) {
 6221|      0|    exit(EXIT_FAILURE);
 6222|      0|  }
 6223|      0|  return result;
 6224|      0|}
_ZN7testing8internal12UnitTestImpl11FilterTestsENS1_18ReactionToShardingE:
 6241|      2|int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
 6242|      2|  const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL
  ------------------
  |  Branch (6242:32): [True: 0, False: 2]
  ------------------
 6243|      2|                                   ? Int32FromEnvOrDie(kTestTotalShards, -1)
 6244|      2|                                   : -1;
 6245|      2|  const int32_t shard_index = shard_tests == HONOR_SHARDING_PROTOCOL
  ------------------
  |  Branch (6245:31): [True: 0, False: 2]
  ------------------
 6246|      2|                                  ? Int32FromEnvOrDie(kTestShardIndex, -1)
 6247|      2|                                  : -1;
 6248|       |
 6249|      2|  const PositiveAndNegativeUnitTestFilter gtest_flag_filter(
 6250|      2|      GTEST_FLAG_GET(filter));
  ------------------
  |  | 2310|      2|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      2|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 6251|      2|  const UnitTestFilter disable_test_filter(kDisableTestFilter);
 6252|       |  // num_runnable_tests are the number of tests that will
 6253|       |  // run across all shards (i.e., match filter and are not disabled).
 6254|       |  // num_selected_tests are the number of tests to be run on
 6255|       |  // this shard.
 6256|      2|  int num_runnable_tests = 0;
 6257|      2|  int num_selected_tests = 0;
 6258|      2|  for (auto* test_suite : test_suites_) {
  ------------------
  |  Branch (6258:25): [True: 2, False: 2]
  ------------------
 6259|      2|    const std::string& test_suite_name = test_suite->name_;
 6260|      2|    test_suite->set_should_run(false);
 6261|       |
 6262|      4|    for (TestInfo* test_info : test_suite->test_info_list()) {
  ------------------
  |  Branch (6262:30): [True: 4, False: 2]
  ------------------
 6263|      4|      const std::string& test_name = test_info->name_;
 6264|       |      // A test is disabled if test suite name or test name matches
 6265|       |      // kDisableTestFilter.
 6266|      4|      const bool is_disabled =
 6267|      4|          disable_test_filter.MatchesName(test_suite_name) ||
  ------------------
  |  Branch (6267:11): [True: 0, False: 4]
  ------------------
 6268|      4|          disable_test_filter.MatchesName(test_name);
  ------------------
  |  Branch (6268:11): [True: 0, False: 4]
  ------------------
 6269|      4|      test_info->is_disabled_ = is_disabled;
 6270|       |
 6271|      4|      const bool matches_filter =
 6272|      4|          gtest_flag_filter.MatchesTest(test_suite_name, test_name);
 6273|      4|      test_info->matches_filter_ = matches_filter;
 6274|       |
 6275|      4|      const bool is_runnable =
 6276|      4|          (GTEST_FLAG_GET(also_run_disabled_tests) || !is_disabled) &&
  ------------------
  |  | 2310|      4|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  ------------------
  |  |  |  | 2242|      4|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  |  |  |  Branch (2310:30): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  |  Branch (6276:55): [True: 4, False: 0]
  ------------------
 6277|      4|          matches_filter;
  ------------------
  |  Branch (6277:11): [True: 2, False: 2]
  ------------------
 6278|       |
 6279|      4|      const bool is_in_another_shard =
 6280|      4|          shard_tests != IGNORE_SHARDING_PROTOCOL &&
  ------------------
  |  Branch (6280:11): [True: 0, False: 4]
  ------------------
 6281|      0|          !ShouldRunTestOnShard(total_shards, shard_index, num_runnable_tests);
  ------------------
  |  Branch (6281:11): [True: 0, False: 0]
  ------------------
 6282|      4|      test_info->is_in_another_shard_ = is_in_another_shard;
 6283|      4|      const bool is_selected = is_runnable && !is_in_another_shard;
  ------------------
  |  Branch (6283:32): [True: 2, False: 2]
  |  Branch (6283:47): [True: 2, False: 0]
  ------------------
 6284|       |
 6285|      4|      num_runnable_tests += is_runnable;
 6286|      4|      num_selected_tests += is_selected;
 6287|       |
 6288|      4|      test_info->should_run_ = is_selected;
 6289|      4|      test_suite->set_should_run(test_suite->should_run() || is_selected);
  ------------------
  |  Branch (6289:34): [True: 2, False: 2]
  |  Branch (6289:62): [True: 2, False: 0]
  ------------------
 6290|      4|    }
 6291|      2|  }
 6292|      2|  return num_selected_tests;
 6293|      2|}
_ZN7testing8internal12UnitTestImpl21os_stack_trace_getterEv:
 6412|      8|OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
 6413|      8|  if (os_stack_trace_getter_ == nullptr) {
  ------------------
  |  Branch (6413:7): [True: 2, False: 6]
  ------------------
 6414|       |#ifdef GTEST_OS_STACK_TRACE_GETTER_
 6415|       |    os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
 6416|       |#else
 6417|      2|    os_stack_trace_getter_ = new OsStackTraceGetter;
 6418|      2|#endif  // GTEST_OS_STACK_TRACE_GETTER_
 6419|      2|  }
 6420|       |
 6421|      8|  return os_stack_trace_getter_;
 6422|      8|}
_ZN7testing8internal12UnitTestImpl19current_test_resultEv:
 6425|     12|TestResult* UnitTestImpl::current_test_result() {
 6426|     12|  if (current_test_info_ != nullptr) {
  ------------------
  |  Branch (6426:7): [True: 8, False: 4]
  ------------------
 6427|      8|    return &current_test_info_->result_;
 6428|      8|  }
 6429|      4|  if (current_test_suite_ != nullptr) {
  ------------------
  |  Branch (6429:7): [True: 0, False: 4]
  ------------------
 6430|      0|    return &current_test_suite_->ad_hoc_test_result_;
 6431|      0|  }
 6432|      4|  return &ad_hoc_test_result_;
 6433|      4|}
_ZN7testing8internal6IsTrueEb:
 6484|     22|bool IsTrue(bool condition) { return condition; }
_ZN7testing8internal10AlwaysTrueEv:
 6486|     12|bool AlwaysTrue() {
 6487|     12|#if GTEST_HAS_EXCEPTIONS
 6488|       |  // This condition is always false so AlwaysTrue() never actually throws,
 6489|       |  // but it makes the compiler think that it may throw.
 6490|     12|  if (IsTrue(false)) throw ClassUniqueToAlwaysTrue();
  ------------------
  |  Branch (6490:7): [True: 0, False: 12]
  ------------------
 6491|     12|#endif  // GTEST_HAS_EXCEPTIONS
 6492|     12|  return true;
 6493|     12|}
_ZN7testing8internal10SkipPrefixEPKcPS2_:
 6498|     73|bool SkipPrefix(const char* prefix, const char** pstr) {
 6499|     73|  const size_t prefix_len = strlen(prefix);
 6500|     73|  if (strncmp(*pstr, prefix, prefix_len) == 0) {
  ------------------
  |  Branch (6500:7): [True: 15, False: 58]
  ------------------
 6501|     15|    *pstr += prefix_len;
 6502|     15|    return true;
 6503|     15|  }
 6504|     58|  return false;
 6505|     73|}
_ZN7testing8internal9ParseFlagEPKcS2_Pi:
 6566|     45|bool ParseFlag(const char* str, const char* flag_name, int32_t* value) {
 6567|       |  // Gets the value of the flag as a string.
 6568|     45|  const char* const value_str = ParseFlagValue(str, flag_name, false);
 6569|       |
 6570|       |  // Aborts if the parsing failed.
 6571|     45|  if (value_str == nullptr) return false;
  ------------------
  |  Branch (6571:7): [True: 45, False: 0]
  ------------------
 6572|       |
 6573|       |  // Sets *value to the value of the flag.
 6574|      0|  return ParseInt32(Message() << "The value of flag --" << flag_name, value_str,
 6575|      0|                    value);
 6576|     45|}
_ZN7testing8internal24ParseGoogleTestFlagsOnlyEPiPPc:
 6860|      2|void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
 6861|       |#ifdef GTEST_HAS_ABSL_FLAGS
 6862|       |  if (*argc <= 0) return;
 6863|       |
 6864|       |  std::vector<char*> positional_args;
 6865|       |  std::vector<absl::UnrecognizedFlag> unrecognized_flags;
 6866|       |  absl::ParseAbseilFlagsOnly(*argc, argv, positional_args, unrecognized_flags);
 6867|       |  absl::flat_hash_set<absl::string_view> unrecognized;
 6868|       |  for (const auto& flag : unrecognized_flags) {
 6869|       |    unrecognized.insert(flag.flag_name);
 6870|       |  }
 6871|       |  absl::flat_hash_set<char*> positional;
 6872|       |  for (const auto& arg : positional_args) {
 6873|       |    positional.insert(arg);
 6874|       |  }
 6875|       |
 6876|       |  int out_pos = 1;
 6877|       |  int in_pos = 1;
 6878|       |  for (; in_pos < *argc; ++in_pos) {
 6879|       |    char* arg = argv[in_pos];
 6880|       |    absl::string_view arg_str(arg);
 6881|       |    if (absl::ConsumePrefix(&arg_str, "--")) {
 6882|       |      // Flag-like argument. If the flag was unrecognized, keep it.
 6883|       |      // If it was a GoogleTest flag, remove it.
 6884|       |      if (unrecognized.contains(arg_str)) {
 6885|       |        argv[out_pos++] = argv[in_pos];
 6886|       |        continue;
 6887|       |      }
 6888|       |    }
 6889|       |
 6890|       |    if (arg_str.empty()) {
 6891|       |      ++in_pos;
 6892|       |      break;  // '--' indicates that the rest of the arguments are positional
 6893|       |    }
 6894|       |
 6895|       |    // Probably a positional argument. If it is in fact positional, keep it.
 6896|       |    // If it was a value for the flag argument, remove it.
 6897|       |    if (positional.contains(arg)) {
 6898|       |      argv[out_pos++] = arg;
 6899|       |    }
 6900|       |  }
 6901|       |
 6902|       |  // The rest are positional args for sure.
 6903|       |  while (in_pos < *argc) {
 6904|       |    argv[out_pos++] = argv[in_pos++];
 6905|       |  }
 6906|       |
 6907|       |  *argc = out_pos;
 6908|       |  argv[out_pos] = nullptr;
 6909|       |#else
 6910|      2|  ParseGoogleTestFlagsOnlyImpl(argc, argv);
 6911|      2|#endif
 6912|       |
 6913|       |  // Fix the value of *_NSGetArgc() on macOS, but if and only if
 6914|       |  // *_NSGetArgv() == argv
 6915|       |  // Only applicable to char** version of argv
 6916|       |#ifdef GTEST_OS_MAC
 6917|       |#ifndef GTEST_OS_IOS
 6918|       |  if (*_NSGetArgv() == argv) {
 6919|       |    *_NSGetArgc() = *argc;
 6920|       |  }
 6921|       |#endif
 6922|       |#endif
 6923|      2|}
_ZN7testing14InitGoogleTestEPiPPc:
 6971|      2|void InitGoogleTest(int* argc, char** argv) {
 6972|       |#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
 6973|       |  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
 6974|       |#else   // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
 6975|      2|  internal::InitGoogleTestImpl(argc, argv);
 6976|      2|#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
 6977|      2|}
gtest-all.cc:_ZN7testingL18GetDefaultFailFastEv:
  249|      2|static bool GetDefaultFailFast() {
  250|      2|  const char* const testbridge_test_runner_fail_fast =
  251|      2|      internal::posix::GetEnv("TESTBRIDGE_TEST_RUNNER_FAIL_FAST");
  252|      2|  if (testbridge_test_runner_fail_fast != nullptr) {
  ------------------
  |  Branch (252:7): [True: 0, False: 2]
  ------------------
  253|      0|    return strcmp(testbridge_test_runner_fail_fast, "1") == 0;
  254|      0|  }
  255|      2|  return false;
  256|      2|}
gtest-all.cc:_ZN7testingL16GetDefaultFilterEv:
  238|      2|static const char* GetDefaultFilter() {
  239|      2|  const char* const testbridge_test_only =
  240|      2|      internal::posix::GetEnv("TESTBRIDGE_TEST_ONLY");
  241|      2|  if (testbridge_test_only != nullptr) {
  ------------------
  |  Branch (241:7): [True: 0, False: 2]
  ------------------
  242|      0|    return testbridge_test_only;
  243|      0|  }
  244|      2|  return kUniversalFilter;
  245|      2|}
gtest-all.cc:_ZN7testing8internal12_GLOBAL__N_114UnitTestFilterC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  799|      6|  explicit UnitTestFilter(const std::string& filter) {
  800|       |    // By design "" filter matches "" string.
  801|      6|    std::vector<std::string> all_patterns;
  802|      6|    SplitString(filter, ':', &all_patterns);
  803|      6|    const auto exact_match_patterns_begin = std::partition(
  804|      6|        all_patterns.begin(), all_patterns.end(), &IsGlobPattern);
  805|       |
  806|      6|    glob_patterns_.reserve(static_cast<size_t>(
  807|      6|        std::distance(all_patterns.begin(), exact_match_patterns_begin)));
  808|      6|    std::move(all_patterns.begin(), exact_match_patterns_begin,
  809|      6|              std::inserter(glob_patterns_, glob_patterns_.begin()));
  810|      6|    std::move(
  811|      6|        exact_match_patterns_begin, all_patterns.end(),
  812|      6|        std::inserter(exact_match_patterns_, exact_match_patterns_.begin()));
  813|      6|  }
gtest-all.cc:_ZN7testing8internal12_GLOBAL__N_113IsGlobPatternERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  789|     10|bool IsGlobPattern(const std::string& pattern) {
  790|     10|  return std::any_of(pattern.begin(), pattern.end(),
  791|     10|                     [](const char c) { return c == '?' || c == '*'; });
  792|     10|}
gtest-all.cc:_ZZN7testing8internal12_GLOBAL__N_113IsGlobPatternERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEENK3$_0clEc:
  791|    144|                     [](const char c) { return c == '?' || c == '*'; });
  ------------------
  |  Branch (791:48): [True: 0, False: 144]
  |  Branch (791:60): [True: 8, False: 136]
  ------------------
gtest-all.cc:_ZNK7testing8internal12_GLOBAL__N_114UnitTestFilter11MatchesNameERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  817|     16|  bool MatchesName(const std::string& name) const {
  818|     16|    return exact_match_patterns_.find(name) != exact_match_patterns_.end() ||
  ------------------
  |  Branch (818:12): [True: 2, False: 14]
  ------------------
  819|     14|           std::any_of(glob_patterns_.begin(), glob_patterns_.end(),
  ------------------
  |  Branch (819:12): [True: 0, False: 14]
  ------------------
  820|     14|                       [&name](const std::string& pattern) {
  821|     14|                         return PatternMatchesString(
  822|     14|                             name, pattern.c_str(),
  823|     14|                             pattern.c_str() + pattern.size());
  824|     14|                       });
  825|     16|  }
gtest-all.cc:_ZZNK7testing8internal12_GLOBAL__N_114UnitTestFilter11MatchesNameERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEENKUlSB_E_clESB_:
  820|     20|                       [&name](const std::string& pattern) {
  821|     20|                         return PatternMatchesString(
  822|     20|                             name, pattern.c_str(),
  823|     20|                             pattern.c_str() + pattern.size());
  824|     20|                       });
gtest-all.cc:_ZN7testing8internalL20PatternMatchesStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKcSB_:
  741|     20|                                 const char* pattern, const char* pattern_end) {
  742|     20|  const char* name = name_str.c_str();
  743|     20|  const char* const name_begin = name;
  744|     20|  const char* const name_end = name + name_str.size();
  745|       |
  746|     20|  const char* pattern_next = pattern;
  747|     20|  const char* name_next = name;
  748|       |
  749|    784|  while (pattern < pattern_end || name < name_end) {
  ------------------
  |  Branch (749:10): [True: 784, False: 0]
  |  Branch (749:35): [True: 0, False: 0]
  ------------------
  750|    784|    if (pattern < pattern_end) {
  ------------------
  |  Branch (750:9): [True: 784, False: 0]
  ------------------
  751|    784|      switch (*pattern) {
  752|    400|        default:  // Match an ordinary character.
  ------------------
  |  Branch (752:9): [True: 400, False: 384]
  ------------------
  753|    400|          if (name < name_end && *name == *pattern) {
  ------------------
  |  Branch (753:15): [True: 388, False: 12]
  |  Branch (753:34): [True: 8, False: 380]
  ------------------
  754|      8|            ++pattern;
  755|      8|            ++name;
  756|      8|            continue;
  757|      8|          }
  758|    392|          break;
  759|    392|        case '?':  // Match any single character.
  ------------------
  |  Branch (759:9): [True: 0, False: 784]
  ------------------
  760|      0|          if (name < name_end) {
  ------------------
  |  Branch (760:15): [True: 0, False: 0]
  ------------------
  761|      0|            ++pattern;
  762|      0|            ++name;
  763|      0|            continue;
  764|      0|          }
  765|      0|          break;
  766|    384|        case '*':
  ------------------
  |  Branch (766:9): [True: 384, False: 400]
  ------------------
  767|       |          // Match zero or more characters. Start by skipping over the wildcard
  768|       |          // and matching zero characters from name. If that fails, restart and
  769|       |          // match one more character than the last attempt.
  770|    384|          pattern_next = pattern;
  771|    384|          name_next = name + 1;
  772|    384|          ++pattern;
  773|    384|          continue;
  774|    784|      }
  775|    784|    }
  776|       |    // Failed to match a character. Restart if possible.
  777|    392|    if (name_begin < name_next && name_next <= name_end) {
  ------------------
  |  Branch (777:9): [True: 384, False: 8]
  |  Branch (777:35): [True: 372, False: 12]
  ------------------
  778|    372|      pattern = pattern_next;
  779|    372|      name = name_next;
  780|    372|      continue;
  781|    372|    }
  782|     20|    return false;
  783|    392|  }
  784|      0|  return true;
  785|     20|}
gtest-all.cc:_ZN7testing8internal12_GLOBAL__N_133PositiveAndNegativeUnitTestFilterC2ERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  839|      2|  explicit PositiveAndNegativeUnitTestFilter(const std::string& filter) {
  840|      2|    std::vector<std::string> positive_and_negative_filters;
  841|       |
  842|       |    // NOTE: `SplitString` always returns a non-empty container.
  843|      2|    SplitString(filter, '-', &positive_and_negative_filters);
  844|      2|    const auto& positive_filter = positive_and_negative_filters.front();
  845|       |
  846|      2|    if (positive_and_negative_filters.size() > 1) {
  ------------------
  |  Branch (846:9): [True: 0, False: 2]
  ------------------
  847|      0|      positive_filter_ = UnitTestFilter(
  848|      0|          positive_filter.empty() ? kUniversalFilter : positive_filter);
  ------------------
  |  Branch (848:11): [True: 0, False: 0]
  ------------------
  849|       |
  850|       |      // TODO(b/214626361): Fail on multiple '-' characters
  851|       |      // For the moment to preserve old behavior we concatenate the rest of the
  852|       |      // string parts with `-` as separator to generate the negative filter.
  853|      0|      auto negative_filter_string = positive_and_negative_filters[1];
  854|      0|      for (std::size_t i = 2; i < positive_and_negative_filters.size(); i++)
  ------------------
  |  Branch (854:31): [True: 0, False: 0]
  ------------------
  855|      0|        negative_filter_string =
  856|      0|            negative_filter_string + '-' + positive_and_negative_filters[i];
  857|      0|      negative_filter_ = UnitTestFilter(negative_filter_string);
  858|      2|    } else {
  859|       |      // In case we don't have a negative filter and positive filter is ""
  860|       |      // we do not use kUniversalFilter by design as opposed to when we have a
  861|       |      // negative filter.
  862|      2|      positive_filter_ = UnitTestFilter(positive_filter);
  863|      2|    }
  864|      2|  }
gtest-all.cc:_ZN7testing8internal12_GLOBAL__N_114UnitTestFilterC2Ev:
  796|      4|  UnitTestFilter() = default;
gtest-all.cc:_ZNK7testing8internal12_GLOBAL__N_133PositiveAndNegativeUnitTestFilter11MatchesTestERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_:
  870|      4|                   const std::string& test_name) const {
  871|      4|    return MatchesName(test_suite_name + "." + test_name);
  872|      4|  }
gtest-all.cc:_ZNK7testing8internal12_GLOBAL__N_133PositiveAndNegativeUnitTestFilter11MatchesNameERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  876|      4|  bool MatchesName(const std::string& name) const {
  877|      4|    return positive_filter_.MatchesName(name) &&
  ------------------
  |  Branch (877:12): [True: 2, False: 2]
  ------------------
  878|      2|           !negative_filter_.MatchesName(name);
  ------------------
  |  Branch (878:12): [True: 2, False: 0]
  ------------------
  879|      4|  }
gtest-all.cc:_ZN7testing8internalL18ShouldRunTestSuiteEPKNS_9TestSuiteE:
  461|      2|static bool ShouldRunTestSuite(const TestSuite* test_suite) {
  462|      2|  return test_suite->should_run();
  463|      2|}
gtest-all.cc:_ZN7testing8internalL20SumOverTestSuiteListERKNSt3__16vectorIPNS_9TestSuiteENS1_9allocatorIS4_EEEEMS3_KFivE:
  441|      4|                                int (TestSuite::*method)() const) {
  442|      4|  int sum = 0;
  443|      8|  for (size_t i = 0; i < case_list.size(); i++) {
  ------------------
  |  Branch (443:22): [True: 4, False: 4]
  ------------------
  444|      4|    sum += (case_list[i]->*method)();
  445|      4|  }
  446|      4|  return sum;
  447|      4|}
gtest-all.cc:_ZN7testingL24ValidateTestPropertyNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 2432|      2|    const std::vector<std::string>& reserved_names) {
 2433|      2|  if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=
  ------------------
  |  Branch (2433:7): [True: 0, False: 2]
  ------------------
 2434|      2|      reserved_names.end()) {
 2435|      0|    ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name
  ------------------
  |  | 1750|      0|#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
  |  |  ------------------
  |  |  |  | 1296|      0|  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1290|      0|  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1286|      0|  ::testing::internal::AssertHelper(result_type, file, line, message) = \
  |  |  |  |  |  |  |  | 1287|      0|      ::testing::Message()
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2436|      0|                  << " (" << FormatWordList(reserved_names)
 2437|      0|                  << " are reserved by " << GTEST_NAME_ << ")";
  ------------------
  |  |  349|      0|#define GTEST_NAME_ "Google Test"
  ------------------
 2438|      0|    return false;
 2439|      0|  }
 2440|      2|  return true;
 2441|      2|}
gtest-all.cc:_ZN7testingL31GetReservedAttributesForElementERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2383|      2|    const std::string& xml_element) {
 2384|      2|  if (xml_element == "testsuites") {
  ------------------
  |  Branch (2384:7): [True: 0, False: 2]
  ------------------
 2385|      0|    return ArrayAsVector(kReservedTestSuitesAttributes);
 2386|      2|  } else if (xml_element == "testsuite") {
  ------------------
  |  Branch (2386:14): [True: 0, False: 2]
  ------------------
 2387|      0|    return ArrayAsVector(kReservedTestSuiteAttributes);
 2388|      2|  } else if (xml_element == "testcase") {
  ------------------
  |  Branch (2388:14): [True: 2, False: 0]
  ------------------
 2389|      2|    return ArrayAsVector(kReservedTestCaseAttributes);
 2390|      2|  } else {
 2391|      0|    GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
  ------------------
  |  | 1087|      0|  GTEST_AMBIGUOUS_ELSE_BLOCKER_               \
  |  |  ------------------
  |  |  |  |  728|      0|  switch (0)                          \
  |  |  |  |  729|      0|  case 0:                             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (729:3): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  730|      0|  default:  // NOLINT
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (730:3): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1088|      0|  if (::testing::internal::IsTrue(condition)) \
  |  |  ------------------
  |  |  |  Branch (1088:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 1089|      0|    ;                                         \
  |  | 1090|      0|  else                                        \
  |  | 1091|      0|    GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
  |  |  ------------------
  |  |  |  | 1062|      0|  ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
  |  |  |  | 1063|      0|                                __FILE__, __LINE__)                    \
  |  |  |  | 1064|      0|      .GetStream()
  |  |  ------------------
  ------------------
 2392|      0|  }
 2393|       |  // This code is unreachable but some compilers may not realizes that.
 2394|      0|  return std::vector<std::string>();
 2395|      2|}
_ZN7testing13ArrayAsVectorILm8EEENSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEERAT__KPKc:
 2378|      2|std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
 2379|      2|  return std::vector<std::string>(array, array + kSize);
 2380|      2|}
_ZN7testing8internal5TimerC2Ev:
 1188|      6|  Timer() : start_(clock::now()) {}
gtest-all.cc:_ZN7testing8internalL13ColoredPrintfENS0_12_GLOBAL__N_110GTestColorEPKcz:
 3328|     10|static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
 3329|     10|  va_list args;
 3330|     10|  va_start(args, fmt);
 3331|       |
 3332|     10|  static const bool in_color_mode =
 3333|       |      // We don't condition this on GTEST_HAS_FILE_SYSTEM because we still need
 3334|       |      // to be able to detect terminal I/O regardless.
 3335|     10|      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
 3336|       |
 3337|     10|  const bool use_color = in_color_mode && (color != GTestColor::kDefault);
  ------------------
  |  Branch (3337:26): [True: 0, False: 10]
  |  Branch (3337:43): [True: 0, False: 0]
  ------------------
 3338|       |
 3339|     10|  if (!use_color) {
  ------------------
  |  Branch (3339:7): [True: 10, False: 0]
  ------------------
 3340|     10|    vprintf(fmt, args);
 3341|     10|    va_end(args);
 3342|     10|    return;
 3343|     10|  }
 3344|       |
 3345|       |#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) &&       \
 3346|       |    !defined(GTEST_OS_WINDOWS_GAMES) && !defined(GTEST_OS_WINDOWS_PHONE) && \
 3347|       |    !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_MINGW)
 3348|       |  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
 3349|       |
 3350|       |  // Gets the current text color.
 3351|       |  CONSOLE_SCREEN_BUFFER_INFO buffer_info;
 3352|       |  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
 3353|       |  const WORD old_color_attrs = buffer_info.wAttributes;
 3354|       |  const WORD new_color = GetNewColor(color, old_color_attrs);
 3355|       |
 3356|       |  // We need to flush the stream buffers into the console before each
 3357|       |  // SetConsoleTextAttribute call lest it affect the text that is already
 3358|       |  // printed but has not yet reached the console.
 3359|       |  fflush(stdout);
 3360|       |  SetConsoleTextAttribute(stdout_handle, new_color);
 3361|       |
 3362|       |  vprintf(fmt, args);
 3363|       |
 3364|       |  fflush(stdout);
 3365|       |  // Restores the text color.
 3366|       |  SetConsoleTextAttribute(stdout_handle, old_color_attrs);
 3367|       |#else
 3368|      0|  printf("\033[0;3%sm", GetAnsiColorCode(color));
 3369|      0|  vprintf(fmt, args);
 3370|      0|  printf("\033[m");  // Resets the terminal to default.
 3371|      0|#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
 3372|       |  va_end(args);
 3373|      0|}
gtest-all.cc:_ZN7testingL15FormatTestCountEi:
 3148|      2|static std::string FormatTestCount(int test_count) {
 3149|      2|  return FormatCountableNoun(test_count, "test", "tests");
 3150|      2|}
gtest-all.cc:_ZN7testingL20FormatTestSuiteCountEi:
 3153|      2|static std::string FormatTestSuiteCount(int test_suite_count) {
 3154|      2|  return FormatCountableNoun(test_suite_count, "test suite", "test suites");
 3155|      2|}
gtest-all.cc:_ZN7testingL19FormatCountableNounEiPKcS1_:
 3142|      6|                                       const char* plural_form) {
 3143|      6|  return internal::StreamableToString(count) + " " +
 3144|      6|         (count == 1 ? singular_form : plural_form);
  ------------------
  |  Branch (3144:11): [True: 6, False: 0]
  ------------------
 3145|      6|}
_ZN7testing8internal27PrettyUnitTestResultPrinter13PrintTestNameEPKcS3_:
 3402|      2|  static void PrintTestName(const char* test_suite, const char* test) {
 3403|      2|    printf("%s.%s", test_suite, test);
 3404|      2|  }
_ZN7testing8internal17TestEventRepeaterC2Ev:
 3814|      2|  TestEventRepeater() : forwarding_enabled_(true) {}
_ZN7testing8internal23ScopedPrematureExitFileC2EPKc:
 5133|      2|      : premature_exit_filepath_(
 5134|      2|            premature_exit_filepath ? premature_exit_filepath : "") {
  ------------------
  |  Branch (5134:13): [True: 0, False: 2]
  ------------------
 5135|       |    // If a path to the premature-exit file is specified...
 5136|      2|    if (!premature_exit_filepath_.empty()) {
  ------------------
  |  Branch (5136:9): [True: 0, False: 2]
  ------------------
 5137|       |      // create the file with a single "0" character in it.  I/O
 5138|       |      // errors are ignored as there's nothing better we can do and we
 5139|       |      // don't want to fail the test because of this.
 5140|      0|      FILE* pfile = posix::FOpen(premature_exit_filepath_.c_str(), "w");
 5141|      0|      fwrite("0", 1, 1, pfile);
 5142|      0|      fclose(pfile);
 5143|      0|    }
 5144|      2|  }
_ZN7testing8internal27PrettyUnitTestResultPrinterC2Ev:
 3401|      2|  PrettyUnitTestResultPrinter() = default;
gtest-all.cc:_ZN7testing8internalL18GTestIsInitializedEv:
  435|      4|static bool GTestIsInitialized() { return !GetArgvs().empty(); }
gtest-all.cc:_ZN7testing8internalL14ParseFlagValueEPKcS2_b:
 6513|    345|                                  bool def_optional) {
 6514|       |  // str and flag must not be NULL.
 6515|    345|  if (str == nullptr || flag_name == nullptr) return nullptr;
  ------------------
  |  Branch (6515:7): [True: 0, False: 345]
  |  Branch (6515:25): [True: 0, False: 345]
  ------------------
 6516|       |
 6517|       |  // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
 6518|    345|  const std::string flag_str =
 6519|    345|      std::string("--") + GTEST_FLAG_PREFIX_ + flag_name;
  ------------------
  |  |  346|    345|#define GTEST_FLAG_PREFIX_ "gtest_"
  ------------------
 6520|    345|  const size_t flag_len = flag_str.length();
 6521|    345|  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return nullptr;
  ------------------
  |  Branch (6521:7): [True: 345, False: 0]
  ------------------
 6522|       |
 6523|       |  // Skips the flag name.
 6524|      0|  const char* flag_end = str + flag_len;
 6525|       |
 6526|       |  // When def_optional is true, it's OK to not have a "=value" part.
 6527|      0|  if (def_optional && (flag_end[0] == '\0')) {
  ------------------
  |  Branch (6527:7): [True: 0, False: 0]
  |  Branch (6527:23): [True: 0, False: 0]
  ------------------
 6528|      0|    return flag_end;
 6529|      0|  }
 6530|       |
 6531|       |  // If def_optional is true and there are more characters after the
 6532|       |  // flag name, or if def_optional is false, there must be a '=' after
 6533|       |  // the flag name.
 6534|      0|  if (flag_end[0] != '=') return nullptr;
  ------------------
  |  Branch (6534:7): [True: 0, False: 0]
  ------------------
 6535|       |
 6536|       |  // Returns the string after "=".
 6537|      0|  return flag_end + 1;
 6538|      0|}
_ZN7testing8internal27PrettyUnitTestResultPrinter18OnTestProgramStartERKNS_8UnitTestE:
 3407|      2|  void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
_ZN7testing8internal27PrettyUnitTestResultPrinter22OnEnvironmentsSetUpEndERKNS_8UnitTestE:
 3410|      2|  void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc:
 2673|      4|                                           const char* location) {
 2674|       |  // NOTE: The user code can affect the way in which Google Test handles
 2675|       |  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
 2676|       |  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
 2677|       |  // after the exception is caught and either report or re-throw the
 2678|       |  // exception based on the flag's value:
 2679|       |  //
 2680|       |  // try {
 2681|       |  //   // Perform the test method.
 2682|       |  // } catch (...) {
 2683|       |  //   if (GTEST_FLAG_GET(catch_exceptions))
 2684|       |  //     // Report the exception as failure.
 2685|       |  //   else
 2686|       |  //     throw;  // Re-throws the original exception.
 2687|       |  // }
 2688|       |  //
 2689|       |  // However, the purpose of this flag is to allow the program to drop into
 2690|       |  // the debugger when the exception is thrown. On most platforms, once the
 2691|       |  // control enters the catch block, the exception origin information is
 2692|       |  // lost and the debugger will stop the program at the point of the
 2693|       |  // re-throw in this function -- instead of at the point of the original
 2694|       |  // throw statement in the code under test.  For this reason, we perform
 2695|       |  // the check early, sacrificing the ability to affect Google Test's
 2696|       |  // exception handling in the method where the exception is thrown.
 2697|      4|  if (internal::GetUnitTestImpl()->catch_exceptions()) {
  ------------------
  |  Branch (2697:7): [True: 4, False: 0]
  ------------------
 2698|      4|#if GTEST_HAS_EXCEPTIONS
 2699|      4|    try {
 2700|      4|      return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2701|      4|    } catch (const AssertionException&) {  // NOLINT
 2702|       |      // This failure was reported already.
 2703|      0|    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
 2704|       |      // This exception type can only be thrown by a failed Google
 2705|       |      // Test assertion with the intention of letting another testing
 2706|       |      // framework catch it.  Therefore we just re-throw it.
 2707|      0|      throw;
 2708|      0|    } catch (const std::exception& e) {  // NOLINT
 2709|      0|      internal::ReportFailureInUnknownLocation(
 2710|      0|          TestPartResult::kFatalFailure,
 2711|      0|          FormatCxxExceptionMessage(e.what(), location));
 2712|      0|    } catch (...) {  // NOLINT
 2713|      0|      internal::ReportFailureInUnknownLocation(
 2714|      0|          TestPartResult::kFatalFailure,
 2715|      0|          FormatCxxExceptionMessage(nullptr, location));
 2716|      0|    }
 2717|      0|    return static_cast<Result>(0);
 2718|       |#else
 2719|       |    return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2720|       |#endif  // GTEST_HAS_EXCEPTIONS
 2721|      4|  } else {
 2722|      0|    return (object->*method)();
 2723|      0|  }
 2724|      4|}
_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc:
 2654|      4|                                              const char* location) {
 2655|       |#if GTEST_HAS_SEH
 2656|       |  __try {
 2657|       |    return (object->*method)();
 2658|       |  } __except (internal::UnitTestOptions::GTestProcessSEH(  // NOLINT
 2659|       |      GetExceptionCode(), location)) {
 2660|       |    return static_cast<Result>(0);
 2661|       |  }
 2662|       |#else
 2663|      4|  (void)location;
 2664|      4|  return (object->*method)();
 2665|      4|#endif  // GTEST_HAS_SEH
 2666|      4|}
_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS0_15TestFactoryBaseEPNS_4TestEEET0_PT_MS6_FS5_vEPKc:
 2673|      2|                                           const char* location) {
 2674|       |  // NOTE: The user code can affect the way in which Google Test handles
 2675|       |  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
 2676|       |  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
 2677|       |  // after the exception is caught and either report or re-throw the
 2678|       |  // exception based on the flag's value:
 2679|       |  //
 2680|       |  // try {
 2681|       |  //   // Perform the test method.
 2682|       |  // } catch (...) {
 2683|       |  //   if (GTEST_FLAG_GET(catch_exceptions))
 2684|       |  //     // Report the exception as failure.
 2685|       |  //   else
 2686|       |  //     throw;  // Re-throws the original exception.
 2687|       |  // }
 2688|       |  //
 2689|       |  // However, the purpose of this flag is to allow the program to drop into
 2690|       |  // the debugger when the exception is thrown. On most platforms, once the
 2691|       |  // control enters the catch block, the exception origin information is
 2692|       |  // lost and the debugger will stop the program at the point of the
 2693|       |  // re-throw in this function -- instead of at the point of the original
 2694|       |  // throw statement in the code under test.  For this reason, we perform
 2695|       |  // the check early, sacrificing the ability to affect Google Test's
 2696|       |  // exception handling in the method where the exception is thrown.
 2697|      2|  if (internal::GetUnitTestImpl()->catch_exceptions()) {
  ------------------
  |  Branch (2697:7): [True: 2, False: 0]
  ------------------
 2698|      2|#if GTEST_HAS_EXCEPTIONS
 2699|      2|    try {
 2700|      2|      return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2701|      2|    } catch (const AssertionException&) {  // NOLINT
 2702|       |      // This failure was reported already.
 2703|      0|    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
 2704|       |      // This exception type can only be thrown by a failed Google
 2705|       |      // Test assertion with the intention of letting another testing
 2706|       |      // framework catch it.  Therefore we just re-throw it.
 2707|      0|      throw;
 2708|      0|    } catch (const std::exception& e) {  // NOLINT
 2709|      0|      internal::ReportFailureInUnknownLocation(
 2710|      0|          TestPartResult::kFatalFailure,
 2711|      0|          FormatCxxExceptionMessage(e.what(), location));
 2712|      0|    } catch (...) {  // NOLINT
 2713|      0|      internal::ReportFailureInUnknownLocation(
 2714|      0|          TestPartResult::kFatalFailure,
 2715|      0|          FormatCxxExceptionMessage(nullptr, location));
 2716|      0|    }
 2717|      0|    return static_cast<Result>(0);
 2718|       |#else
 2719|       |    return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2720|       |#endif  // GTEST_HAS_EXCEPTIONS
 2721|      2|  } else {
 2722|      0|    return (object->*method)();
 2723|      0|  }
 2724|      2|}
_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS0_15TestFactoryBaseEPNS_4TestEEET0_PT_MS6_FS5_vEPKc:
 2654|      2|                                              const char* location) {
 2655|       |#if GTEST_HAS_SEH
 2656|       |  __try {
 2657|       |    return (object->*method)();
 2658|       |  } __except (internal::UnitTestOptions::GTestProcessSEH(  // NOLINT
 2659|       |      GetExceptionCode(), location)) {
 2660|       |    return static_cast<Result>(0);
 2661|       |  }
 2662|       |#else
 2663|      2|  (void)location;
 2664|      2|  return (object->*method)();
 2665|      2|#endif  // GTEST_HAS_SEH
 2666|      2|}
gtest-all.cc:_ZZN7testing9TestSuite3RunEvENK3$_0clEPKNS_8TestInfoES4_:
 3035|      2|                   [](const TestInfo* const a, const TestInfo* const b) {
 3036|      2|                     if (const int result = std::strcmp(a->file(), b->file())) {
  ------------------
  |  Branch (3036:36): [True: 0, False: 2]
  ------------------
 3037|      0|                       return result < 0;
 3038|      0|                     }
 3039|       |
 3040|      2|                     return a->line() < b->line();
 3041|      2|                   });
_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_9TestSuiteEvEET0_PT_MS4_FS3_vEPKc:
 2673|      2|                                           const char* location) {
 2674|       |  // NOTE: The user code can affect the way in which Google Test handles
 2675|       |  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
 2676|       |  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
 2677|       |  // after the exception is caught and either report or re-throw the
 2678|       |  // exception based on the flag's value:
 2679|       |  //
 2680|       |  // try {
 2681|       |  //   // Perform the test method.
 2682|       |  // } catch (...) {
 2683|       |  //   if (GTEST_FLAG_GET(catch_exceptions))
 2684|       |  //     // Report the exception as failure.
 2685|       |  //   else
 2686|       |  //     throw;  // Re-throws the original exception.
 2687|       |  // }
 2688|       |  //
 2689|       |  // However, the purpose of this flag is to allow the program to drop into
 2690|       |  // the debugger when the exception is thrown. On most platforms, once the
 2691|       |  // control enters the catch block, the exception origin information is
 2692|       |  // lost and the debugger will stop the program at the point of the
 2693|       |  // re-throw in this function -- instead of at the point of the original
 2694|       |  // throw statement in the code under test.  For this reason, we perform
 2695|       |  // the check early, sacrificing the ability to affect Google Test's
 2696|       |  // exception handling in the method where the exception is thrown.
 2697|      2|  if (internal::GetUnitTestImpl()->catch_exceptions()) {
  ------------------
  |  Branch (2697:7): [True: 2, False: 0]
  ------------------
 2698|      2|#if GTEST_HAS_EXCEPTIONS
 2699|      2|    try {
 2700|      2|      return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2701|      2|    } catch (const AssertionException&) {  // NOLINT
 2702|       |      // This failure was reported already.
 2703|      0|    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
 2704|       |      // This exception type can only be thrown by a failed Google
 2705|       |      // Test assertion with the intention of letting another testing
 2706|       |      // framework catch it.  Therefore we just re-throw it.
 2707|      0|      throw;
 2708|      0|    } catch (const std::exception& e) {  // NOLINT
 2709|      0|      internal::ReportFailureInUnknownLocation(
 2710|      0|          TestPartResult::kFatalFailure,
 2711|      0|          FormatCxxExceptionMessage(e.what(), location));
 2712|      0|    } catch (...) {  // NOLINT
 2713|      0|      internal::ReportFailureInUnknownLocation(
 2714|      0|          TestPartResult::kFatalFailure,
 2715|      0|          FormatCxxExceptionMessage(nullptr, location));
 2716|      0|    }
 2717|      0|    return static_cast<Result>(0);
 2718|       |#else
 2719|       |    return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2720|       |#endif  // GTEST_HAS_EXCEPTIONS
 2721|      2|  } else {
 2722|      0|    return (object->*method)();
 2723|      0|  }
 2724|      2|}
_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_9TestSuiteEvEET0_PT_MS4_FS3_vEPKc:
 2654|      2|                                              const char* location) {
 2655|       |#if GTEST_HAS_SEH
 2656|       |  __try {
 2657|       |    return (object->*method)();
 2658|       |  } __except (internal::UnitTestOptions::GTestProcessSEH(  // NOLINT
 2659|       |      GetExceptionCode(), location)) {
 2660|       |    return static_cast<Result>(0);
 2661|       |  }
 2662|       |#else
 2663|      2|  (void)location;
 2664|      2|  return (object->*method)();
 2665|      2|#endif  // GTEST_HAS_SEH
 2666|      2|}
_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc:
 2673|      2|                                           const char* location) {
 2674|       |  // NOTE: The user code can affect the way in which Google Test handles
 2675|       |  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
 2676|       |  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
 2677|       |  // after the exception is caught and either report or re-throw the
 2678|       |  // exception based on the flag's value:
 2679|       |  //
 2680|       |  // try {
 2681|       |  //   // Perform the test method.
 2682|       |  // } catch (...) {
 2683|       |  //   if (GTEST_FLAG_GET(catch_exceptions))
 2684|       |  //     // Report the exception as failure.
 2685|       |  //   else
 2686|       |  //     throw;  // Re-throws the original exception.
 2687|       |  // }
 2688|       |  //
 2689|       |  // However, the purpose of this flag is to allow the program to drop into
 2690|       |  // the debugger when the exception is thrown. On most platforms, once the
 2691|       |  // control enters the catch block, the exception origin information is
 2692|       |  // lost and the debugger will stop the program at the point of the
 2693|       |  // re-throw in this function -- instead of at the point of the original
 2694|       |  // throw statement in the code under test.  For this reason, we perform
 2695|       |  // the check early, sacrificing the ability to affect Google Test's
 2696|       |  // exception handling in the method where the exception is thrown.
 2697|      2|  if (internal::GetUnitTestImpl()->catch_exceptions()) {
  ------------------
  |  Branch (2697:7): [True: 2, False: 0]
  ------------------
 2698|      2|#if GTEST_HAS_EXCEPTIONS
 2699|      2|    try {
 2700|      2|      return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2701|      2|    } catch (const AssertionException&) {  // NOLINT
 2702|       |      // This failure was reported already.
 2703|      0|    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
 2704|       |      // This exception type can only be thrown by a failed Google
 2705|       |      // Test assertion with the intention of letting another testing
 2706|       |      // framework catch it.  Therefore we just re-throw it.
 2707|      0|      throw;
 2708|      0|    } catch (const std::exception& e) {  // NOLINT
 2709|      0|      internal::ReportFailureInUnknownLocation(
 2710|      0|          TestPartResult::kFatalFailure,
 2711|      0|          FormatCxxExceptionMessage(e.what(), location));
 2712|      0|    } catch (...) {  // NOLINT
 2713|      0|      internal::ReportFailureInUnknownLocation(
 2714|      0|          TestPartResult::kFatalFailure,
 2715|      0|          FormatCxxExceptionMessage(nullptr, location));
 2716|      0|    }
 2717|      0|    return static_cast<Result>(0);
 2718|       |#else
 2719|       |    return HandleSehExceptionsInMethodIfSupported(object, method, location);
 2720|       |#endif  // GTEST_HAS_EXCEPTIONS
 2721|      2|  } else {
 2722|      0|    return (object->*method)();
 2723|      0|  }
 2724|      2|}
_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc:
 2654|      2|                                              const char* location) {
 2655|       |#if GTEST_HAS_SEH
 2656|       |  __try {
 2657|       |    return (object->*method)();
 2658|       |  } __except (internal::UnitTestOptions::GTestProcessSEH(  // NOLINT
 2659|       |      GetExceptionCode(), location)) {
 2660|       |    return static_cast<Result>(0);
 2661|       |  }
 2662|       |#else
 2663|      2|  (void)location;
 2664|      2|  return (object->*method)();
 2665|      2|#endif  // GTEST_HAS_SEH
 2666|      2|}
_ZN7testing8internal28ParseGoogleTestFlagsOnlyImplIcEEvPiPPT_:
 6805|      2|void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
 6806|      2|  std::string flagfile_value;
 6807|     17|  for (int i = 1; i < *argc; i++) {
  ------------------
  |  Branch (6807:19): [True: 15, False: 2]
  ------------------
 6808|     15|    const std::string arg_string = StreamableToString(argv[i]);
 6809|     15|    const char* const arg = arg_string.c_str();
 6810|       |
 6811|     15|    using internal::ParseFlag;
 6812|       |
 6813|     15|    bool remove_flag = false;
 6814|     15|    if (ParseGoogleTestFlag(arg)) {
  ------------------
  |  Branch (6814:9): [True: 0, False: 15]
  ------------------
 6815|      0|      remove_flag = true;
 6816|      0|#if GTEST_USE_OWN_FLAGFILE_FLAG_ && GTEST_HAS_FILE_SYSTEM
 6817|     15|    } else if (ParseFlag(arg, "flagfile", &flagfile_value)) {
  ------------------
  |  Branch (6817:16): [True: 0, False: 15]
  ------------------
 6818|      0|      GTEST_FLAG_SET(flagfile, flagfile_value);
  ------------------
  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  ------------------
  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  ------------------
  ------------------
 6819|      0|      LoadFlagsFromFile(flagfile_value);
 6820|      0|      remove_flag = true;
 6821|      0|#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_ && GTEST_HAS_FILE_SYSTEM
 6822|     15|    } else if (arg_string == "--help" || HasGoogleTestFlagPrefix(arg)) {
  ------------------
  |  Branch (6822:16): [True: 0, False: 15]
  |  Branch (6822:42): [True: 0, False: 15]
  ------------------
 6823|       |      // Both help flag and unrecognized Google Test flags (excluding
 6824|       |      // internal ones) trigger help display.
 6825|      0|      g_help_flag = true;
 6826|      0|    }
 6827|       |
 6828|     15|    if (remove_flag) {
  ------------------
  |  Branch (6828:9): [True: 0, False: 15]
  ------------------
 6829|       |      // Shift the remainder of the argv list left by one.
 6830|      0|      for (int j = i + 1; j < *argc; ++j) {
  ------------------
  |  Branch (6830:27): [True: 0, False: 0]
  ------------------
 6831|      0|        argv[j - 1] = argv[j];
 6832|      0|      }
 6833|       |
 6834|       |      // Decrements the argument count.
 6835|      0|      (*argc)--;
 6836|       |
 6837|       |      // Terminate the array with nullptr.
 6838|      0|      argv[*argc] = nullptr;
 6839|       |
 6840|       |      // We also need to decrement the iterator as we just removed
 6841|       |      // an element.
 6842|      0|      i--;
 6843|      0|    }
 6844|     15|  }
 6845|       |
 6846|      2|  if (g_help_flag) {
  ------------------
  |  Branch (6846:7): [True: 0, False: 2]
  ------------------
 6847|       |    // We print the help here instead of in RUN_ALL_TESTS(), as the
 6848|       |    // latter may not be called at all if the user is using Google
 6849|       |    // Test with another testing framework.
 6850|      0|    PrintColorEncoded(kColorEncodedHelpMessage);
 6851|      0|  }
 6852|      2|}
gtest-all.cc:_ZN7testing8internalL19ParseGoogleTestFlagEPKc:
 6748|     15|static bool ParseGoogleTestFlag(const char* const arg) {
 6749|     15|#define GTEST_INTERNAL_PARSE_FLAG(flag_name)  \
 6750|     15|  do {                                        \
 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
 6753|     15|      GTEST_FLAG_SET(flag_name, value);       \
 6754|     15|      return true;                            \
 6755|     15|    }                                         \
 6756|     15|  } while (false)
 6757|       |
 6758|     15|  GTEST_INTERNAL_PARSE_FLAG(also_run_disabled_tests);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6759|     15|  GTEST_INTERNAL_PARSE_FLAG(break_on_failure);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6760|     15|  GTEST_INTERNAL_PARSE_FLAG(catch_exceptions);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6761|     15|  GTEST_INTERNAL_PARSE_FLAG(color);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6762|     15|  GTEST_INTERNAL_PARSE_FLAG(death_test_style);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6763|     15|  GTEST_INTERNAL_PARSE_FLAG(death_test_use_fork);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6764|     15|  GTEST_INTERNAL_PARSE_FLAG(fail_fast);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6765|     15|  GTEST_INTERNAL_PARSE_FLAG(fail_if_no_test_linked);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6766|     15|  GTEST_INTERNAL_PARSE_FLAG(filter);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6767|     15|  GTEST_INTERNAL_PARSE_FLAG(internal_run_death_test);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6768|     15|  GTEST_INTERNAL_PARSE_FLAG(list_tests);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6769|     15|  GTEST_INTERNAL_PARSE_FLAG(output);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6770|     15|  GTEST_INTERNAL_PARSE_FLAG(brief);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6771|     15|  GTEST_INTERNAL_PARSE_FLAG(print_time);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6772|     15|  GTEST_INTERNAL_PARSE_FLAG(print_utf8);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6773|     15|  GTEST_INTERNAL_PARSE_FLAG(random_seed);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6774|     15|  GTEST_INTERNAL_PARSE_FLAG(repeat);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6775|     15|  GTEST_INTERNAL_PARSE_FLAG(recreate_environments_when_repeating);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6776|     15|  GTEST_INTERNAL_PARSE_FLAG(shuffle);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6777|     15|  GTEST_INTERNAL_PARSE_FLAG(stack_trace_depth);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6778|     15|  GTEST_INTERNAL_PARSE_FLAG(stream_result_to);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6779|     15|  GTEST_INTERNAL_PARSE_FLAG(throw_on_failure);
  ------------------
  |  | 6750|     15|  do {                                        \
  |  | 6751|     15|    auto value = GTEST_FLAG_GET(flag_name);   \
  |  |  ------------------
  |  |  |  | 2310|     15|#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|     15|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6752|     15|    if (ParseFlag(arg, #flag_name, &value)) { \
  |  |  ------------------
  |  |  |  Branch (6752:9): [True: 0, False: 15]
  |  |  ------------------
  |  | 6753|      0|      GTEST_FLAG_SET(flag_name, value);       \
  |  |  ------------------
  |  |  |  | 2311|      0|#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2242|      0|#define GTEST_FLAG(name) FLAGS_gtest_##name
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 6754|      0|      return true;                            \
  |  | 6755|      0|    }                                         \
  |  | 6756|     15|  } while (false)
  |  |  ------------------
  |  |  |  Branch (6756:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
 6780|     15|  return false;
 6781|     15|}
gtest-all.cc:_ZN7testing8internalL9ParseFlagEPKcS2_Pb:
 6550|    195|static bool ParseFlag(const char* str, const char* flag_name, bool* value) {
 6551|       |  // Gets the value of the flag as a string.
 6552|    195|  const char* const value_str = ParseFlagValue(str, flag_name, true);
 6553|       |
 6554|       |  // Aborts if the parsing failed.
 6555|    195|  if (value_str == nullptr) return false;
  ------------------
  |  Branch (6555:7): [True: 195, False: 0]
  ------------------
 6556|       |
 6557|       |  // Converts the string value to a bool.
 6558|      0|  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
  ------------------
  |  Branch (6558:14): [True: 0, False: 0]
  |  Branch (6558:35): [True: 0, False: 0]
  |  Branch (6558:56): [True: 0, False: 0]
  ------------------
 6559|      0|  return true;
 6560|    195|}
gtest-all.cc:_ZN7testing8internalL9ParseFlagINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEbPKcSA_PT_:
 6583|    105|static bool ParseFlag(const char* str, const char* flag_name, String* value) {
 6584|       |  // Gets the value of the flag as a string.
 6585|    105|  const char* const value_str = ParseFlagValue(str, flag_name, false);
 6586|       |
 6587|       |  // Aborts if the parsing failed.
 6588|    105|  if (value_str == nullptr) return false;
  ------------------
  |  Branch (6588:7): [True: 105, False: 0]
  ------------------
 6589|       |
 6590|       |  // Sets *value to the value of the flag.
 6591|      0|  *value = value_str;
 6592|      0|  return true;
 6593|    105|}
gtest-all.cc:_ZN7testing8internalL23HasGoogleTestFlagPrefixEPKc:
 6601|     15|static bool HasGoogleTestFlagPrefix(const char* str) {
 6602|     15|  return (SkipPrefix("--", &str) || SkipPrefix("-", &str) ||
  ------------------
  |  Branch (6602:11): [True: 6, False: 9]
  |  Branch (6602:37): [True: 5, False: 4]
  ------------------
 6603|      4|          SkipPrefix("/", &str)) &&
  ------------------
  |  Branch (6603:11): [True: 4, False: 0]
  ------------------
 6604|     15|         !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
  ------------------
  |  |  346|     15|#define GTEST_FLAG_PREFIX_ "gtest_"
  ------------------
  |  Branch (6604:10): [True: 15, False: 0]
  ------------------
 6605|     15|         (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
  ------------------
  |  |  346|     15|#define GTEST_FLAG_PREFIX_ "gtest_"
  ------------------
  |  Branch (6605:11): [True: 0, False: 15]
  ------------------
 6606|     15|          SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
  ------------------
  |  |  347|     15|#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
  ------------------
  |  Branch (6606:11): [True: 0, False: 15]
  ------------------
 6607|     15|}
_ZN7testing8internal18InitGoogleTestImplIcEEvPiPPT_:
 6933|      2|void InitGoogleTestImpl(int* argc, CharType** argv) {
 6934|       |  // We don't want to run the initialization code twice.
 6935|      2|  if (GTestIsInitialized()) return;
  ------------------
  |  Branch (6935:7): [True: 0, False: 2]
  ------------------
 6936|       |
 6937|      2|  if (*argc <= 0) return;
  ------------------
  |  Branch (6937:7): [True: 0, False: 2]
  ------------------
 6938|       |
 6939|      2|  g_argvs.clear();
 6940|     19|  for (int i = 0; i != *argc; i++) {
  ------------------
  |  Branch (6940:19): [True: 17, False: 2]
  ------------------
 6941|     17|    g_argvs.push_back(StreamableToString(argv[i]));
 6942|     17|  }
 6943|       |
 6944|       |#ifdef GTEST_HAS_ABSL
 6945|       |  absl::InitializeSymbolizer(g_argvs[0].c_str());
 6946|       |
 6947|       |#ifdef GTEST_HAS_ABSL_FLAGS
 6948|       |  // When using the Abseil Flags library, set the program usage message to the
 6949|       |  // help message, but remove the color-encoding from the message first.
 6950|       |  absl::SetProgramUsageMessage(absl::StrReplaceAll(
 6951|       |      kColorEncodedHelpMessage,
 6952|       |      {{"@D", ""}, {"@R", ""}, {"@G", ""}, {"@Y", ""}, {"@@", "@"}}));
 6953|       |#endif  // GTEST_HAS_ABSL_FLAGS
 6954|       |#endif  // GTEST_HAS_ABSL
 6955|       |
 6956|      2|  ParseGoogleTestFlagsOnly(argc, argv);
 6957|      2|  GetUnitTestImpl()->PostFlagParsingInit();
 6958|      2|}

aom_codec.c:at_ctrl_map_end:
  191|  4.78M|static inline int at_ctrl_map_end(aom_codec_ctrl_fn_map_t *e) {
  192|  4.78M|  return e->ctrl_id == 0 && e->fn == NULL;
  ------------------
  |  Branch (192:10): [True: 0, False: 4.78M]
  |  Branch (192:29): [True: 0, False: 0]
  ------------------
  193|  4.78M|}

aom_codec_version:
   26|  90.6k|int aom_codec_version(void) { return VERSION_PACKED; }
  ------------------
  |  |   19|  90.6k|  ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   14|  90.6k|#define VERSION_MAJOR 3
  |  |  ------------------
  |  |                 ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   15|  90.6k|#define VERSION_MINOR 15
  |  |  ------------------
  |  |                 ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   16|  90.6k|#define VERSION_PATCH 3
  |  |  ------------------
  ------------------
aom_codec_destroy:
   68|  25.4k|aom_codec_err_t aom_codec_destroy(aom_codec_ctx_t *ctx) {
   69|  25.4k|  if (!ctx) {
  ------------------
  |  Branch (69:7): [True: 0, False: 25.4k]
  ------------------
   70|      0|    return AOM_CODEC_INVALID_PARAM;
   71|      0|  }
   72|  25.4k|  if (!ctx->iface || !ctx->priv) {
  ------------------
  |  Branch (72:7): [True: 0, False: 25.4k]
  |  Branch (72:22): [True: 0, False: 25.4k]
  ------------------
   73|      0|    ctx->err = AOM_CODEC_ERROR;
   74|      0|    return AOM_CODEC_ERROR;
   75|      0|  }
   76|  25.4k|  ctx->iface->destroy((aom_codec_alg_priv_t *)ctx->priv);
   77|  25.4k|  ctx->iface = NULL;
   78|  25.4k|  ctx->name = NULL;
   79|       |  ctx->priv = NULL;
   80|  25.4k|  ctx->err = AOM_CODEC_OK;
   81|  25.4k|  return AOM_CODEC_OK;
   82|  25.4k|}
aom_codec_control:
   88|   268k|aom_codec_err_t aom_codec_control(aom_codec_ctx_t *ctx, int ctrl_id, ...) {
   89|   268k|  if (!ctx) {
  ------------------
  |  Branch (89:7): [True: 0, False: 268k]
  ------------------
   90|      0|    return AOM_CODEC_INVALID_PARAM;
   91|      0|  }
   92|       |  // Control ID must be non-zero.
   93|   268k|  if (!ctrl_id) {
  ------------------
  |  Branch (93:7): [True: 0, False: 268k]
  ------------------
   94|      0|    ctx->err = AOM_CODEC_INVALID_PARAM;
   95|      0|    return AOM_CODEC_INVALID_PARAM;
   96|      0|  }
   97|   268k|  if (!ctx->iface || !ctx->priv || !ctx->iface->ctrl_maps) {
  ------------------
  |  Branch (97:7): [True: 0, False: 268k]
  |  Branch (97:22): [True: 0, False: 268k]
  |  Branch (97:36): [True: 0, False: 268k]
  ------------------
   98|      0|    ctx->err = AOM_CODEC_ERROR;
   99|      0|    return AOM_CODEC_ERROR;
  100|      0|  }
  101|       |
  102|       |  // "ctrl_maps" is an array of (control ID, function pointer) elements,
  103|       |  // with CTRL_MAP_END as a sentinel.
  104|   268k|  for (aom_codec_ctrl_fn_map_t *entry = ctx->iface->ctrl_maps;
  105|  4.78M|       !at_ctrl_map_end(entry); ++entry) {
  ------------------
  |  Branch (105:8): [True: 4.78M, False: 0]
  ------------------
  106|  4.78M|    if (entry->ctrl_id == ctrl_id) {
  ------------------
  |  Branch (106:9): [True: 268k, False: 4.52M]
  ------------------
  107|   268k|      va_list ap;
  108|   268k|      va_start(ap, ctrl_id);
  109|   268k|      ctx->err = entry->fn((aom_codec_alg_priv_t *)ctx->priv, ap);
  110|   268k|      va_end(ap);
  111|   268k|      return ctx->err;
  112|   268k|    }
  113|  4.78M|  }
  114|      0|  ctx->err = AOM_CODEC_ERROR;
  115|      0|  ctx->priv->err_detail = "Invalid control ID";
  116|      0|  return AOM_CODEC_ERROR;
  117|   268k|}
aom_merge_corrupted_flag:
  182|   283k|void aom_merge_corrupted_flag(int *corrupted, int value) {
  183|   283k|  *corrupted |= value;
  184|   283k|}

aom_codec_dec_init_ver:
   28|  7.01k|                                       aom_codec_flags_t flags, int ver) {
   29|  7.01k|  aom_codec_err_t res;
   30|       |
   31|  7.01k|  if (ver != AOM_DECODER_ABI_VERSION)
  ------------------
  |  |   45|  7.01k|  (6 + AOM_CODEC_ABI_VERSION) /**<\hideinitializer*/
  |  |  ------------------
  |  |  |  |  152|  7.01k|#define AOM_CODEC_ABI_VERSION (7 + AOM_IMAGE_ABI_VERSION) /**<\hideinitializer*/
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  7.01k|#define AOM_IMAGE_ABI_VERSION (9) /**<\hideinitializer*/
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (31:7): [True: 0, False: 7.01k]
  ------------------
   32|      0|    res = AOM_CODEC_ABI_MISMATCH;
   33|  7.01k|  else if (!ctx || !iface)
  ------------------
  |  Branch (33:12): [True: 0, False: 7.01k]
  |  Branch (33:20): [True: 0, False: 7.01k]
  ------------------
   34|      0|    res = AOM_CODEC_INVALID_PARAM;
   35|  7.01k|  else if (iface->abi_version != AOM_CODEC_INTERNAL_ABI_VERSION)
  ------------------
  |  |   65|  7.01k|#define AOM_CODEC_INTERNAL_ABI_VERSION (7) /**<\hideinitializer*/
  ------------------
  |  Branch (35:12): [True: 0, False: 7.01k]
  ------------------
   36|      0|    res = AOM_CODEC_ABI_MISMATCH;
   37|  7.01k|  else if (!(iface->caps & AOM_CODEC_CAP_DECODER))
  ------------------
  |  |  218|  7.01k|#define AOM_CODEC_CAP_DECODER 0x1 /**< Is a decoder */
  ------------------
  |  Branch (37:12): [True: 0, False: 7.01k]
  ------------------
   38|      0|    res = AOM_CODEC_INCAPABLE;
   39|  7.01k|  else {
   40|  7.01k|    memset(ctx, 0, sizeof(*ctx));
   41|  7.01k|    ctx->iface = iface;
   42|  7.01k|    ctx->name = iface->name;
   43|  7.01k|    ctx->priv = NULL;
   44|  7.01k|    ctx->init_flags = flags;
   45|  7.01k|    ctx->config.dec = cfg;
   46|       |
   47|  7.01k|    res = ctx->iface->init(ctx);
   48|  7.01k|    if (res) {
  ------------------
  |  Branch (48:9): [True: 0, False: 7.01k]
  ------------------
   49|      0|      ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL;
  ------------------
  |  Branch (49:25): [True: 0, False: 0]
  ------------------
   50|      0|      aom_codec_destroy(ctx);
   51|      0|    }
   52|  7.01k|  }
   53|       |
   54|  7.01k|  return SAVE_STATUS(ctx, res);
  ------------------
  |  |   19|  7.01k|#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
  |  |  ------------------
  |  |  |  Branch (19:32): [True: 7.01k, False: 0]
  |  |  ------------------
  ------------------
   55|  7.01k|}
aom_codec_decode:
   95|  17.6k|                                 size_t data_sz, void *user_priv) {
   96|  17.6k|  aom_codec_err_t res;
   97|       |
   98|  17.6k|  if (!ctx)
  ------------------
  |  Branch (98:7): [True: 0, False: 17.6k]
  ------------------
   99|      0|    res = AOM_CODEC_INVALID_PARAM;
  100|  17.6k|  else if (!ctx->iface || !ctx->priv)
  ------------------
  |  Branch (100:12): [True: 0, False: 17.6k]
  |  Branch (100:27): [True: 0, False: 17.6k]
  ------------------
  101|      0|    res = AOM_CODEC_ERROR;
  102|  17.6k|  else {
  103|  17.6k|    res = ctx->iface->dec.decode(get_alg_priv(ctx), data, data_sz, user_priv);
  104|  17.6k|  }
  105|       |
  106|  17.6k|  return SAVE_STATUS(ctx, res);
  ------------------
  |  |   19|  17.6k|#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
  |  |  ------------------
  |  |  |  Branch (19:32): [True: 17.6k, False: 0]
  |  |  ------------------
  ------------------
  107|  17.6k|}
aom_codec_get_frame:
  109|  35.3k|aom_image_t *aom_codec_get_frame(aom_codec_ctx_t *ctx, aom_codec_iter_t *iter) {
  110|  35.3k|  aom_image_t *img;
  111|       |
  112|  35.3k|  if (!ctx || !iter || !ctx->iface || !ctx->priv)
  ------------------
  |  Branch (112:7): [True: 0, False: 35.3k]
  |  Branch (112:15): [True: 0, False: 35.3k]
  |  Branch (112:24): [True: 0, False: 35.3k]
  |  Branch (112:39): [True: 0, False: 35.3k]
  ------------------
  113|      0|    img = NULL;
  114|  35.3k|  else
  115|  35.3k|    img = ctx->iface->dec.get_frame(get_alg_priv(ctx), iter);
  116|       |
  117|  35.3k|  return img;
  118|  35.3k|}
aom_decoder.c:get_alg_priv:
   21|  53.0k|static aom_codec_alg_priv_t *get_alg_priv(aom_codec_ctx_t *ctx) {
   22|  53.0k|  return (aom_codec_alg_priv_t *)ctx->priv;
   23|  53.0k|}

aom_codec_enc_init_ver:
   41|  18.4k|                                       aom_codec_flags_t flags, int ver) {
   42|  18.4k|  aom_codec_err_t res;
   43|       |  // The value of AOM_ENCODER_ABI_VERSION in libaom v3.0.0 and v3.1.0 - v3.1.3.
   44|       |  //
   45|       |  // We are compatible with these older libaom releases. AOM_ENCODER_ABI_VERSION
   46|       |  // was incremented after these releases for two reasons:
   47|       |  // 1. AOM_ENCODER_ABI_VERSION takes contribution from
   48|       |  //    AOM_EXT_PART_ABI_VERSION. The external partition API is still
   49|       |  //    experimental, so it should not be considered as part of the stable ABI.
   50|       |  //    fd9ed8366 External partition: Define APIs
   51|       |  //    https://aomedia-review.googlesource.com/c/aom/+/135663
   52|       |  // 2. As a way to detect the presence of speeds 7-9 in all-intra mode. I (wtc)
   53|       |  //    suggested this change because I misunderstood how
   54|       |  //    AOM_ENCODER_ABI_VERSION was used.
   55|       |  //    bbdfa68d1 AllIntra: Redefine all-intra mode speed features for speed 7+
   56|       |  //    https://aomedia-review.googlesource.com/c/aom/+/140624
   57|  18.4k|  const int aom_encoder_abi_version_25 = 25;
   58|       |
   59|       |  // TODO(bug aomedia:3228): Remove the check for aom_encoder_abi_version_25 in
   60|       |  // libaom v4.0.0.
   61|  18.4k|  if (ver != AOM_ENCODER_ABI_VERSION && ver != aom_encoder_abi_version_25)
  ------------------
  |  |   55|  36.8k|  (10 + AOM_CODEC_ABI_VERSION + /*AOM_EXT_PART_ABI_VERSION=*/3)
  |  |  ------------------
  |  |  |  |  152|  18.4k|#define AOM_CODEC_ABI_VERSION (7 + AOM_IMAGE_ABI_VERSION) /**<\hideinitializer*/
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  18.4k|#define AOM_IMAGE_ABI_VERSION (9) /**<\hideinitializer*/
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (61:7): [True: 0, False: 18.4k]
  |  Branch (61:41): [True: 0, False: 0]
  ------------------
   62|      0|    res = AOM_CODEC_ABI_MISMATCH;
   63|  18.4k|  else if (!ctx || !iface || !cfg)
  ------------------
  |  Branch (63:12): [True: 0, False: 18.4k]
  |  Branch (63:20): [True: 0, False: 18.4k]
  |  Branch (63:30): [True: 0, False: 18.4k]
  ------------------
   64|      0|    res = AOM_CODEC_INVALID_PARAM;
   65|  18.4k|  else if (iface->abi_version != AOM_CODEC_INTERNAL_ABI_VERSION)
  ------------------
  |  |   65|  18.4k|#define AOM_CODEC_INTERNAL_ABI_VERSION (7) /**<\hideinitializer*/
  ------------------
  |  Branch (65:12): [True: 0, False: 18.4k]
  ------------------
   66|      0|    res = AOM_CODEC_ABI_MISMATCH;
   67|  18.4k|  else if (!(iface->caps & AOM_CODEC_CAP_ENCODER))
  ------------------
  |  |  219|  18.4k|#define AOM_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
  ------------------
  |  Branch (67:12): [True: 0, False: 18.4k]
  ------------------
   68|      0|    res = AOM_CODEC_INCAPABLE;
   69|  18.4k|  else if ((flags & AOM_CODEC_USE_PSNR) && !(iface->caps & AOM_CODEC_CAP_PSNR))
  ------------------
  |  |   79|  18.4k|#define AOM_CODEC_USE_PSNR 0x10000         /**< Calculate PSNR on each frame */
  ------------------
                else if ((flags & AOM_CODEC_USE_PSNR) && !(iface->caps & AOM_CODEC_CAP_PSNR))
  ------------------
  |  |   66|      0|#define AOM_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */
  ------------------
  |  Branch (69:12): [True: 0, False: 18.4k]
  |  Branch (69:44): [True: 0, False: 0]
  ------------------
   70|      0|    res = AOM_CODEC_INCAPABLE;
   71|  18.4k|  else if ((flags & AOM_CODEC_USE_HIGHBITDEPTH) &&
  ------------------
  |  |   80|  18.4k|#define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
  ------------------
  |  Branch (71:12): [True: 5.12k, False: 13.2k]
  ------------------
   72|  5.12k|           !(iface->caps & AOM_CODEC_CAP_HIGHBITDEPTH)) {
  ------------------
  |  |   70|  5.12k|#define AOM_CODEC_CAP_HIGHBITDEPTH 0x40000
  ------------------
  |  Branch (72:12): [True: 0, False: 5.12k]
  ------------------
   73|      0|    res = AOM_CODEC_INCAPABLE;
   74|  18.4k|  } else if (cfg->g_bit_depth > 8 &&
  ------------------
  |  Branch (74:14): [True: 5.12k, False: 13.2k]
  ------------------
   75|  5.12k|             (flags & AOM_CODEC_USE_HIGHBITDEPTH) == 0) {
  ------------------
  |  |   80|  5.12k|#define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
  ------------------
  |  Branch (75:14): [True: 0, False: 5.12k]
  ------------------
   76|      0|    res = AOM_CODEC_INVALID_PARAM;
   77|      0|    ctx->err_detail =
   78|      0|        "High bit-depth used without the AOM_CODEC_USE_HIGHBITDEPTH flag.";
   79|  18.4k|  } else {
   80|  18.4k|    ctx->iface = iface;
   81|  18.4k|    ctx->name = iface->name;
   82|  18.4k|    ctx->priv = NULL;
   83|  18.4k|    ctx->init_flags = flags;
   84|  18.4k|    ctx->config.enc = cfg;
   85|  18.4k|    res = ctx->iface->init(ctx);
   86|       |
   87|  18.4k|    if (res) {
  ------------------
  |  Branch (87:9): [True: 0, False: 18.4k]
  ------------------
   88|       |      // IMPORTANT: ctx->priv->err_detail must be null or point to a string
   89|       |      // that remains valid after ctx->priv is destroyed, such as a C string
   90|       |      // literal. This makes it safe to call aom_codec_error_detail() after
   91|       |      // aom_codec_enc_init_ver() failed.
   92|      0|      ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL;
  ------------------
  |  Branch (92:25): [True: 0, False: 0]
  ------------------
   93|      0|      aom_codec_destroy(ctx);
   94|      0|    }
   95|  18.4k|  }
   96|       |
   97|  18.4k|  return SAVE_STATUS(ctx, res);
  ------------------
  |  |   32|  18.4k|#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 18.4k, False: 0]
  |  |  ------------------
  ------------------
   98|  18.4k|}
aom_codec_enc_config_default:
  102|  18.4k|                                             unsigned int usage) {
  103|  18.4k|  aom_codec_err_t res;
  104|       |
  105|  18.4k|  if (!iface || !cfg)
  ------------------
  |  Branch (105:7): [True: 0, False: 18.4k]
  |  Branch (105:17): [True: 0, False: 18.4k]
  ------------------
  106|      0|    res = AOM_CODEC_INVALID_PARAM;
  107|  18.4k|  else if (!(iface->caps & AOM_CODEC_CAP_ENCODER))
  ------------------
  |  |  219|  18.4k|#define AOM_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
  ------------------
  |  Branch (107:12): [True: 0, False: 18.4k]
  ------------------
  108|      0|    res = AOM_CODEC_INCAPABLE;
  109|  18.4k|  else {
  110|  18.4k|    res = AOM_CODEC_INVALID_PARAM;
  111|       |
  112|  24.5k|    for (int i = 0; i < iface->enc.cfg_count; ++i) {
  ------------------
  |  Branch (112:21): [True: 24.5k, False: 0]
  ------------------
  113|  24.5k|      if (iface->enc.cfgs[i].g_usage == usage) {
  ------------------
  |  Branch (113:11): [True: 18.4k, False: 6.10k]
  ------------------
  114|  18.4k|        *cfg = iface->enc.cfgs[i];
  115|  18.4k|        res = AOM_CODEC_OK;
  116|       |        /* default values */
  117|  18.4k|        memset(&cfg->encoder_cfg, 0, sizeof(cfg->encoder_cfg));
  118|  18.4k|        cfg->encoder_cfg.super_block_size = 0;  // Dynamic
  119|  18.4k|        cfg->encoder_cfg.max_partition_size = 128;
  120|  18.4k|        cfg->encoder_cfg.min_partition_size = 4;
  121|  18.4k|        cfg->encoder_cfg.disable_trellis_quant = 3;
  122|  18.4k|        break;
  123|  18.4k|      }
  124|  24.5k|    }
  125|  18.4k|  }
  126|  18.4k|  return res;
  127|  18.4k|}
aom_codec_encode:
  170|  92.0k|                                 aom_enc_frame_flags_t flags) {
  171|  92.0k|  aom_codec_err_t res = AOM_CODEC_OK;
  172|       |
  173|  92.0k|  if (!ctx || (img && !duration))
  ------------------
  |  Branch (173:7): [True: 0, False: 92.0k]
  |  Branch (173:16): [True: 73.6k, False: 18.4k]
  |  Branch (173:23): [True: 0, False: 73.6k]
  ------------------
  174|      0|    res = AOM_CODEC_INVALID_PARAM;
  175|  92.0k|  else if (!ctx->iface || !ctx->priv)
  ------------------
  |  Branch (175:12): [True: 0, False: 92.0k]
  |  Branch (175:27): [True: 0, False: 92.0k]
  ------------------
  176|      0|    res = AOM_CODEC_ERROR;
  177|  92.0k|  else if (!(ctx->iface->caps & AOM_CODEC_CAP_ENCODER))
  ------------------
  |  |  219|  92.0k|#define AOM_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
  ------------------
  |  Branch (177:12): [True: 0, False: 92.0k]
  ------------------
  178|      0|    res = AOM_CODEC_INCAPABLE;
  179|  92.0k|  else if (img && ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) != 0) !=
  ------------------
  |  |   38|  73.6k|#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
  ------------------
  |  Branch (179:12): [True: 73.6k, False: 18.4k]
  |  Branch (179:19): [True: 0, False: 73.6k]
  ------------------
  180|  73.6k|                      ((ctx->init_flags & AOM_CODEC_USE_HIGHBITDEPTH) != 0)) {
  ------------------
  |  |   80|  73.6k|#define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
  ------------------
  181|      0|    res = AOM_CODEC_INVALID_PARAM;
  182|      0|    ctx->priv->err_detail =
  183|      0|        "img is high bit-depth and codec was not initialized with "
  184|      0|        "AOM_CODEC_USE_HIGHBITDEPTH, or vice versa.";
  185|      0|#if ULONG_MAX > UINT32_MAX
  186|  92.0k|  } else if (duration > UINT32_MAX) {
  ------------------
  |  Branch (186:14): [True: 0, False: 92.0k]
  ------------------
  187|      0|    res = AOM_CODEC_INVALID_PARAM;
  188|      0|#endif
  189|  92.0k|  } else {
  190|       |    /* Execute in a normalized floating point environment, if the platform
  191|       |     * requires it.
  192|       |     */
  193|  92.0k|    FLOATING_POINT_INIT
  ------------------
  |  |  158|  92.0k|  do {                         \
  |  |  159|  92.0k|  FLOATING_POINT_SET_PRECISION \
  |  |  ------------------
  |  |  |  |  135|  92.0k|  unsigned short x87_orig_mode = x87_set_double_precision();
  |  |  ------------------
  |  |  160|  92.0k|  FLOATING_POINT_SET_EXCEPTIONS
  ------------------
  194|  92.0k|    res = ctx->iface->enc.encode(get_alg_priv(ctx), img, pts, duration, flags);
  195|  92.0k|    FLOATING_POINT_RESTORE
  ------------------
  |  |  163|  92.0k|  FLOATING_POINT_RESTORE_EXCEPTIONS \
  |  |  164|  92.0k|  FLOATING_POINT_RESTORE_PRECISION  \
  |  |  ------------------
  |  |  |  |  136|  92.0k|#define FLOATING_POINT_RESTORE_PRECISION x87_set_control_word(x87_orig_mode);
  |  |  ------------------
  |  |  165|  92.0k|  } while (0);
  |  |  ------------------
  |  |  |  Branch (165:12): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
  196|  92.0k|  }
  197|       |
  198|  92.0k|  return SAVE_STATUS(ctx, res);
  ------------------
  |  |   32|  92.0k|#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 92.0k, False: 0]
  |  |  ------------------
  ------------------
  199|  92.0k|}
aom_codec_get_cx_data:
  202|   165k|                                                aom_codec_iter_t *iter) {
  203|   165k|  const aom_codec_cx_pkt_t *pkt = NULL;
  204|       |
  205|   165k|  if (ctx) {
  ------------------
  |  Branch (205:7): [True: 165k, False: 0]
  ------------------
  206|   165k|    if (!iter)
  ------------------
  |  Branch (206:9): [True: 0, False: 165k]
  ------------------
  207|      0|      ctx->err = AOM_CODEC_INVALID_PARAM;
  208|   165k|    else if (!ctx->iface || !ctx->priv)
  ------------------
  |  Branch (208:14): [True: 0, False: 165k]
  |  Branch (208:29): [True: 0, False: 165k]
  ------------------
  209|      0|      ctx->err = AOM_CODEC_ERROR;
  210|   165k|    else if (!(ctx->iface->caps & AOM_CODEC_CAP_ENCODER))
  ------------------
  |  |  219|   165k|#define AOM_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */
  ------------------
  |  Branch (210:14): [True: 0, False: 165k]
  ------------------
  211|      0|      ctx->err = AOM_CODEC_INCAPABLE;
  212|   165k|    else
  213|   165k|      pkt = ctx->iface->enc.get_cx_data(get_alg_priv(ctx), iter);
  214|   165k|  }
  215|       |
  216|   165k|  if (pkt && pkt->kind == AOM_CODEC_CX_FRAME_PKT) {
  ------------------
  |  Branch (216:7): [True: 73.6k, False: 92.0k]
  |  Branch (216:14): [True: 73.6k, False: 0]
  ------------------
  217|       |    // If the application has specified a destination area for the
  218|       |    // compressed data, and the codec has not placed the data there,
  219|       |    // and it fits, copy it.
  220|  73.6k|    aom_codec_priv_t *const priv = ctx->priv;
  221|  73.6k|    char *const dst_buf = (char *)priv->enc.cx_data_dst_buf.buf;
  222|       |
  223|  73.6k|    if (dst_buf && pkt->data.raw.buf != dst_buf &&
  ------------------
  |  Branch (223:9): [True: 0, False: 73.6k]
  |  Branch (223:20): [True: 0, False: 0]
  ------------------
  224|      0|        pkt->data.raw.sz + priv->enc.cx_data_pad_before +
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|      0|                priv->enc.cx_data_pad_after <=
  226|      0|            priv->enc.cx_data_dst_buf.sz) {
  227|      0|      aom_codec_cx_pkt_t *modified_pkt = &priv->enc.cx_data_pkt;
  228|       |
  229|      0|      memcpy(dst_buf + priv->enc.cx_data_pad_before, pkt->data.raw.buf,
  230|      0|             pkt->data.raw.sz);
  231|      0|      *modified_pkt = *pkt;
  232|      0|      modified_pkt->data.raw.buf = dst_buf;
  233|      0|      modified_pkt->data.raw.sz +=
  234|      0|          priv->enc.cx_data_pad_before + priv->enc.cx_data_pad_after;
  235|      0|      pkt = modified_pkt;
  236|      0|    }
  237|       |
  238|  73.6k|    if (dst_buf == pkt->data.raw.buf) {
  ------------------
  |  Branch (238:9): [True: 0, False: 73.6k]
  ------------------
  239|      0|      priv->enc.cx_data_dst_buf.buf = dst_buf + pkt->data.raw.sz;
  240|      0|      priv->enc.cx_data_dst_buf.sz -= pkt->data.raw.sz;
  241|      0|    }
  242|  73.6k|  }
  243|       |
  244|   165k|  return pkt;
  245|   165k|}
aom_codec_pkt_list_add:
  316|  73.6k|                           const struct aom_codec_cx_pkt *pkt) {
  317|  73.6k|  if (list->cnt < list->max) {
  ------------------
  |  Branch (317:7): [True: 73.6k, False: 0]
  ------------------
  318|  73.6k|    list->pkts[list->cnt++] = *pkt;
  319|  73.6k|    return 0;
  320|  73.6k|  }
  321|       |
  322|      0|  return 1;
  323|  73.6k|}
aom_codec_pkt_list_get:
  326|   165k|    struct aom_codec_pkt_list *list, aom_codec_iter_t *iter) {
  327|   165k|  const aom_codec_cx_pkt_t *pkt;
  328|       |
  329|   165k|  if (!(*iter)) {
  ------------------
  |  Branch (329:7): [True: 92.0k, False: 73.6k]
  ------------------
  330|  92.0k|    *iter = list->pkts;
  331|  92.0k|  }
  332|       |
  333|   165k|  pkt = (const aom_codec_cx_pkt_t *)*iter;
  334|       |
  335|   165k|  if ((size_t)(pkt - list->pkts) < list->cnt)
  ------------------
  |  Branch (335:7): [True: 73.6k, False: 92.0k]
  ------------------
  336|  73.6k|    *iter = pkt + 1;
  337|  92.0k|  else
  338|  92.0k|    pkt = NULL;
  339|       |
  340|   165k|  return pkt;
  341|   165k|}
aom_encoder.c:get_alg_priv:
   34|   257k|static aom_codec_alg_priv_t *get_alg_priv(aom_codec_ctx_t *ctx) {
   35|   257k|  return (aom_codec_alg_priv_t *)ctx->priv;
   36|   257k|}

aom_img_free:
  319|  7.01k|void aom_img_free(aom_image_t *img) {
  320|  7.01k|  if (img) {
  ------------------
  |  Branch (320:7): [True: 7.01k, False: 0]
  ------------------
  321|  7.01k|    aom_img_remove_metadata(img);
  322|  7.01k|    if (img->img_data && img->img_data_owner) aom_free(img->img_data);
  ------------------
  |  Branch (322:9): [True: 7.01k, False: 0]
  |  Branch (322:26): [True: 0, False: 7.01k]
  ------------------
  323|       |
  324|  7.01k|    if (img->self_allocd) free(img);
  ------------------
  |  Branch (324:9): [True: 0, False: 7.01k]
  ------------------
  325|  7.01k|  }
  326|  7.01k|}
aom_img_plane_width:
  328|  39.0k|int aom_img_plane_width(const aom_image_t *img, int plane) {
  329|  39.0k|  if (plane > 0)
  ------------------
  |  Branch (329:7): [True: 18.5k, False: 20.4k]
  ------------------
  330|  18.5k|    return (img->d_w + img->x_chroma_shift) >> img->x_chroma_shift;
  331|  20.4k|  else
  332|  20.4k|    return img->d_w;
  333|  39.0k|}
aom_img_plane_height:
  335|  39.0k|int aom_img_plane_height(const aom_image_t *img, int plane) {
  336|  39.0k|  if (plane > 0)
  ------------------
  |  Branch (336:7): [True: 18.5k, False: 20.4k]
  ------------------
  337|  18.5k|    return (img->d_h + img->y_chroma_shift) >> img->y_chroma_shift;
  338|  20.4k|  else
  339|  20.4k|    return img->d_h;
  340|  39.0k|}
aom_img_metadata_array_free:
  383|  7.01k|void aom_img_metadata_array_free(aom_metadata_array_t *arr) {
  384|  7.01k|  if (arr) {
  ------------------
  |  Branch (384:7): [True: 0, False: 7.01k]
  ------------------
  385|      0|    if (arr->metadata_array) {
  ------------------
  |  Branch (385:9): [True: 0, False: 0]
  ------------------
  386|      0|      for (size_t i = 0; i < arr->sz; i++) {
  ------------------
  |  Branch (386:26): [True: 0, False: 0]
  ------------------
  387|      0|        aom_img_metadata_free(arr->metadata_array[i]);
  388|      0|      }
  389|      0|      free(arr->metadata_array);
  390|      0|    }
  391|      0|    free(arr);
  392|      0|  }
  393|  7.01k|}
aom_img_remove_metadata:
  427|  24.6k|void aom_img_remove_metadata(aom_image_t *img) {
  428|  24.6k|  if (img && img->metadata) {
  ------------------
  |  Branch (428:7): [True: 24.6k, False: 0]
  |  Branch (428:14): [True: 0, False: 24.6k]
  ------------------
  429|      0|    aom_img_metadata_array_free(img->metadata);
  430|       |    img->metadata = NULL;
  431|      0|  }
  432|  24.6k|}

aom_uleb_size_in_bytes:
   23|   239k|size_t aom_uleb_size_in_bytes(uint64_t value) {
   24|   239k|  size_t size = 0;
   25|   323k|  do {
   26|   323k|    ++size;
   27|   323k|  } while ((value >>= 7) != 0);
  ------------------
  |  Branch (27:12): [True: 84.2k, False: 239k]
  ------------------
   28|   239k|  return size;
   29|   239k|}
aom_uleb_decode:
   32|  81.7k|                    size_t *length) {
   33|  81.7k|  if (buffer && value) {
  ------------------
  |  Branch (33:7): [True: 81.7k, False: 0]
  |  Branch (33:17): [True: 81.7k, False: 0]
  ------------------
   34|  81.7k|    *value = 0;
   35|   113k|    for (size_t i = 0; i < kMaximumLeb128Size && i < available; ++i) {
  ------------------
  |  Branch (35:24): [True: 113k, False: 0]
  |  Branch (35:50): [True: 113k, False: 0]
  ------------------
   36|   113k|      const uint8_t decoded_byte = *(buffer + i) & kLeb128ByteMask;
   37|   113k|      *value |= ((uint64_t)decoded_byte) << (i * 7);
   38|   113k|      if ((*(buffer + i) >> 7) == 0) {
  ------------------
  |  Branch (38:11): [True: 81.7k, False: 31.5k]
  ------------------
   39|  81.7k|        if (length) {
  ------------------
  |  Branch (39:13): [True: 81.7k, False: 0]
  ------------------
   40|  81.7k|          *length = i + 1;
   41|  81.7k|        }
   42|       |
   43|       |        // Fail on values larger than 32-bits to ensure consistent behavior on
   44|       |        // 32 and 64 bit targets: value is typically used to determine buffer
   45|       |        // allocation size.
   46|  81.7k|        if (*value > UINT32_MAX) return -1;
  ------------------
  |  Branch (46:13): [True: 0, False: 81.7k]
  ------------------
   47|       |
   48|  81.7k|        return 0;
   49|  81.7k|      }
   50|   113k|    }
   51|  81.7k|  }
   52|       |
   53|       |  // If we get here, either the buffer/value pointers were invalid,
   54|       |  // or we ran over the available space
   55|      0|  return -1;
   56|  81.7k|}
aom_uleb_encode:
   59|   128k|                    size_t *coded_size) {
   60|   128k|  const size_t leb_size = aom_uleb_size_in_bytes(value);
   61|   128k|  if (value > kMaximumLeb128Value || leb_size > kMaximumLeb128Size ||
  ------------------
  |  Branch (61:7): [True: 0, False: 128k]
  |  Branch (61:38): [True: 0, False: 128k]
  ------------------
   62|   128k|      leb_size > available || !coded_value || !coded_size) {
  ------------------
  |  Branch (62:7): [True: 0, False: 128k]
  |  Branch (62:31): [True: 0, False: 128k]
  |  Branch (62:47): [True: 0, False: 128k]
  ------------------
   63|      0|    return -1;
   64|      0|  }
   65|       |
   66|   308k|  for (size_t i = 0; i < leb_size; ++i) {
  ------------------
  |  Branch (66:22): [True: 179k, False: 128k]
  ------------------
   67|   179k|    uint8_t byte = value & 0x7f;
   68|   179k|    value >>= 7;
   69|       |
   70|   179k|    if (value != 0) byte |= 0x80;  // Signal that more bytes follow.
  ------------------
  |  Branch (70:9): [True: 50.3k, False: 128k]
  ------------------
   71|       |
   72|   179k|    *(coded_value + i) = byte;
   73|   179k|  }
   74|       |
   75|   128k|  *coded_size = leb_size;
   76|   128k|  return 0;
   77|   128k|}

aom_scaled_2d_c:
  117|  9.95k|                     int h) {
  118|       |  // Note: Fixed size intermediate buffer, temp, places limits on parameters.
  119|       |  // 2d filtering proceeds in 2 steps:
  120|       |  //   (1) Interpolate horizontally into an intermediate buffer, temp.
  121|       |  //   (2) Interpolate temp vertically to derive the sub-pixel result.
  122|       |  // Deriving the maximum number of rows in the temp buffer (135):
  123|       |  // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative).
  124|       |  // --Largest block size is 64x64 pixels.
  125|       |  // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the
  126|       |  //   original frame (in 1/16th pixel units).
  127|       |  // --Must round-up because block may be located at sub-pixel position.
  128|       |  // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails.
  129|       |  // --((64 - 1) * 32 + 15) >> 4 + 8 = 135.
  130|       |  // When calling in frame scaling function, the smallest scaling factor is x1/4
  131|       |  // ==> y_step_q4 = 64. Since w and h are at most 16, the temp buffer is still
  132|       |  // big enough.
  133|  9.95k|  uint8_t temp[64 * 135];
  134|  9.95k|  const int intermediate_height =
  135|  9.95k|      (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS;
  ------------------
  |  |   23|  9.95k|#define SUBPEL_BITS 4
  ------------------
                    (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS;
  ------------------
  |  |   26|  9.95k|#define SUBPEL_TAPS 8
  ------------------
  136|       |
  137|  9.95k|  assert(w <= 64);
  138|  9.95k|  assert(h <= 64);
  139|  9.95k|  assert(y_step_q4 <= 32 || (y_step_q4 <= 64 && h <= 32));
  140|  9.95k|  assert(x_step_q4 <= 64);
  141|       |
  142|  9.95k|  convolve_horiz(src - src_stride * (SUBPEL_TAPS / 2 - 1), src_stride, temp, 64,
  ------------------
  |  |   26|  9.95k|#define SUBPEL_TAPS 8
  ------------------
  143|  9.95k|                 filter, x0_q4, x_step_q4, w, intermediate_height);
  144|  9.95k|  convolve_vert(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst, dst_stride, filter,
  ------------------
  |  |   26|  9.95k|#define SUBPEL_TAPS 8
  ------------------
  145|  9.95k|                y0_q4, y_step_q4, w, h);
  146|  9.95k|}
aom_convolve.c:convolve_horiz:
   39|  9.95k|                           int x_step_q4, int w, int h) {
   40|  9.95k|  src -= SUBPEL_TAPS / 2 - 1;
  ------------------
  |  |   26|  9.95k|#define SUBPEL_TAPS 8
  ------------------
   41|   175k|  for (int y = 0; y < h; ++y) {
  ------------------
  |  Branch (41:19): [True: 165k, False: 9.95k]
  ------------------
   42|   165k|    int x_q4 = x0_q4;
   43|  1.51M|    for (int x = 0; x < w; ++x) {
  ------------------
  |  Branch (43:21): [True: 1.34M, False: 165k]
  ------------------
   44|  1.34M|      const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
  ------------------
  |  |   23|  1.34M|#define SUBPEL_BITS 4
  ------------------
   45|  1.34M|      const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK];
  ------------------
  |  |   24|  1.34M|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  1.34M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   46|  1.34M|      const int sum = horz_scalar_product(src_x, x_filter);
   47|  1.34M|      dst[x] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|  1.34M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   48|  1.34M|      x_q4 += x_step_q4;
   49|  1.34M|    }
   50|   165k|    src += src_stride;
   51|   165k|    dst += dst_stride;
   52|   165k|  }
   53|  9.95k|}
aom_convolve.c:horz_scalar_product:
   23|  1.34M|static inline int horz_scalar_product(const uint8_t *a, const int16_t *b) {
   24|  1.34M|  int sum = 0;
   25|  12.1M|  for (int k = 0; k < SUBPEL_TAPS; ++k) sum += a[k] * b[k];
  ------------------
  |  |   26|  12.1M|#define SUBPEL_TAPS 8
  ------------------
  |  Branch (25:19): [True: 10.7M, False: 1.34M]
  ------------------
   26|  1.34M|  return sum;
   27|  1.34M|}
aom_convolve.c:convolve_vert:
   58|  9.95k|                          int y_step_q4, int w, int h) {
   59|  9.95k|  src -= src_stride * (SUBPEL_TAPS / 2 - 1);
  ------------------
  |  |   26|  9.95k|#define SUBPEL_TAPS 8
  ------------------
   60|       |
   61|  97.0k|  for (int x = 0; x < w; ++x) {
  ------------------
  |  Branch (61:19): [True: 87.1k, False: 9.95k]
  ------------------
   62|  87.1k|    int y_q4 = y0_q4;
   63|   797k|    for (int y = 0; y < h; ++y) {
  ------------------
  |  Branch (63:21): [True: 710k, False: 87.1k]
  ------------------
   64|   710k|      const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
  ------------------
  |  |   23|   710k|#define SUBPEL_BITS 4
  ------------------
   65|   710k|      const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK];
  ------------------
  |  |   24|   710k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   710k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   66|   710k|      const int sum = vert_scalar_product(src_y, src_stride, y_filter);
   67|   710k|      dst[y * dst_stride] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|   710k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   68|   710k|      y_q4 += y_step_q4;
   69|   710k|    }
   70|  87.1k|    ++src;
   71|  87.1k|    ++dst;
   72|  87.1k|  }
   73|  9.95k|}
aom_convolve.c:vert_scalar_product:
   30|   710k|                                      const int16_t *b) {
   31|   710k|  int sum = 0;
   32|  6.39M|  for (int k = 0; k < SUBPEL_TAPS; ++k) sum += a[k * a_stride] * b[k];
  ------------------
  |  |   26|  6.39M|#define SUBPEL_TAPS 8
  ------------------
  |  Branch (32:19): [True: 5.68M, False: 710k]
  ------------------
   33|   710k|  return sum;
   34|   710k|}

decodeframe.c:clamp:
   74|  1.11M|static inline int clamp(int value, int low, int high) {
   75|  1.11M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 309, False: 1.11M]
  |  Branch (75:31): [True: 2.44k, False: 1.10M]
  ------------------
   76|  1.11M|}
decodemv.c:clamp:
   74|   152k|static inline int clamp(int value, int low, int high) {
   75|   152k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 152k]
  |  Branch (75:31): [True: 0, False: 152k]
  ------------------
   76|   152k|}
decodetxb.c:clamp:
   74|  31.9M|static inline int clamp(int value, int low, int high) {
   75|  31.9M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 31.9M]
  |  Branch (75:31): [True: 0, False: 31.9M]
  ------------------
   76|  31.9M|}
av1_cx_iface.c:clamp:
   74|   174k|static inline int clamp(int value, int low, int high) {
   75|   174k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 174k]
  |  Branch (75:31): [True: 0, False: 174k]
  ------------------
   76|   174k|}
allintra_vis.c:fclamp:
   82|   187k|static inline double fclamp(double value, double low, double high) {
   83|   187k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (83:10): [True: 59.2k, False: 128k]
  |  Branch (83:31): [True: 0, False: 128k]
  ------------------
   84|   187k|}
av1_quantize.c:clamp64:
   78|   405M|static inline int64_t clamp64(int64_t value, int64_t low, int64_t high) {
   79|   405M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (79:10): [True: 0, False: 405M]
  |  Branch (79:31): [True: 0, False: 405M]
  ------------------
   80|   405M|}
av1_quantize.c:clamp:
   74|   470k|static inline int clamp(int value, int low, int high) {
   75|   470k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 4.79k, False: 465k]
  |  Branch (75:31): [True: 42.3k, False: 423k]
  ------------------
   76|   470k|}
encodemb.c:clamp:
   74|  3.34M|static inline int clamp(int value, int low, int high) {
   75|  3.34M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 302k, False: 3.04M]
  |  Branch (75:31): [True: 213k, False: 2.82M]
  ------------------
   76|  3.34M|}
lookahead.c:clamp:
   74|  18.4k|static inline int clamp(int value, int low, int high) {
   75|  18.4k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 18.4k, False: 0]
  |  Branch (75:31): [True: 0, False: 0]
  ------------------
   76|  18.4k|}
mcomp.c:clamp:
   74|  14.0M|static inline int clamp(int value, int low, int high) {
   75|  14.0M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 175k, False: 13.9M]
  |  Branch (75:31): [True: 52.7k, False: 13.8M]
  ------------------
   76|  14.0M|}
palette.c:clip_pixel_highbd:
   86|  5.27M|static inline uint16_t clip_pixel_highbd(int val, int bd) {
   87|  5.27M|  switch (bd) {
   88|      0|    case 8:
  ------------------
  |  Branch (88:5): [True: 0, False: 5.27M]
  ------------------
   89|      0|    default: return (uint16_t)clamp(val, 0, 255);
  ------------------
  |  Branch (89:5): [True: 0, False: 5.27M]
  ------------------
   90|  2.84M|    case 10: return (uint16_t)clamp(val, 0, 1023);
  ------------------
  |  Branch (90:5): [True: 2.84M, False: 2.42M]
  ------------------
   91|  2.42M|    case 12: return (uint16_t)clamp(val, 0, 4095);
  ------------------
  |  Branch (91:5): [True: 2.42M, False: 2.84M]
  ------------------
   92|  5.27M|  }
   93|  5.27M|}
palette.c:clamp:
   74|  5.27M|static inline int clamp(int value, int low, int high) {
   75|  5.27M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 5.27M]
  |  Branch (75:31): [True: 0, False: 5.27M]
  ------------------
   76|  5.27M|}
partition_search.c:clamp:
   74|   304k|static inline int clamp(int value, int low, int high) {
   75|   304k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 304k, False: 0]
  |  Branch (75:31): [True: 0, False: 0]
  ------------------
   76|   304k|}
pickcdef.c:clamp:
   74|  92.8k|static inline int clamp(int value, int low, int high) {
   75|  92.8k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.06k, False: 91.7k]
  |  Branch (75:31): [True: 3.59k, False: 88.1k]
  ------------------
   76|  92.8k|}
picklpf.c:clamp:
   74|   177k|static inline int clamp(int value, int low, int high) {
   75|   177k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 628, False: 176k]
  |  Branch (75:31): [True: 15.6k, False: 160k]
  ------------------
   76|   177k|}
pickrst.c:clamp:
   74|  6.02k|static inline int clamp(int value, int low, int high) {
   75|  6.02k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.95k, False: 4.06k]
  |  Branch (75:31): [True: 3.13k, False: 936]
  ------------------
   76|  6.02k|}
ratectrl.c:clamp:
   74|   394k|static inline int clamp(int value, int low, int high) {
   75|   394k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 291k, False: 102k]
  |  Branch (75:31): [True: 15.8k, False: 86.7k]
  ------------------
   76|   394k|}
ratectrl.c:fclamp:
   82|   186k|static inline double fclamp(double value, double low, double high) {
   83|   186k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (83:10): [True: 0, False: 186k]
  |  Branch (83:31): [True: 1.89k, False: 184k]
  ------------------
   84|   186k|}
ratectrl.c:saturate_cast_double_to_int:
  104|   358k|static inline int saturate_cast_double_to_int(double d) {
  105|   358k|  if (d > INT_MAX) return INT_MAX;
  ------------------
  |  Branch (105:7): [True: 0, False: 358k]
  ------------------
  106|   358k|  return (int)d;
  107|   358k|}
rd.c:clamp:
   74|  12.9M|static inline int clamp(int value, int low, int high) {
   75|  12.9M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.83k, False: 12.9M]
  |  Branch (75:31): [True: 3.38M, False: 9.51M]
  ------------------
   76|  12.9M|}
rdopt.c:clamp:
   74|  10.3M|static inline int clamp(int value, int low, int high) {
   75|  10.3M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 10.3M]
  |  Branch (75:31): [True: 0, False: 10.3M]
  ------------------
   76|  10.3M|}
nonrd_pickmode.c:clamp:
   74|  3.98M|static inline int clamp(int value, int low, int high) {
   75|  3.98M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 3.98M]
  |  Branch (75:31): [True: 6.67k, False: 3.97M]
  ------------------
   76|  3.98M|}
reconinter_enc.c:clamp:
   74|   110M|static inline int clamp(int value, int low, int high) {
   75|   110M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 110M]
  |  Branch (75:31): [True: 274k, False: 109M]
  ------------------
   76|   110M|}
tx_search.c:clamp:
   74|  3.73M|static inline int clamp(int value, int low, int high) {
   75|  3.73M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 200k, False: 3.53M]
  |  Branch (75:31): [True: 1.10M, False: 2.42M]
  ------------------
   76|  3.73M|}
var_based_part.c:clamp:
   74|  60.8k|static inline int clamp(int value, int low, int high) {
   75|  60.8k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 60.8k]
  |  Branch (75:31): [True: 1, False: 60.8k]
  ------------------
   76|  60.8k|}
aom_convolve.c:clip_pixel:
   70|  2.06M|static inline uint8_t clip_pixel(int val) {
   71|  2.06M|  return (val > 255) ? 255 : (val < 0) ? 0 : val;
  ------------------
  |  Branch (71:10): [True: 5, False: 2.06M]
  |  Branch (71:30): [True: 6, False: 2.06M]
  ------------------
   72|  2.06M|}
quantize.c:clamp:
   74|   736M|static inline int clamp(int value, int low, int high) {
   75|   736M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 736M]
  |  Branch (75:31): [True: 0, False: 736M]
  ------------------
   76|   736M|}
disflow_avx2.c:clamp:
   74|   174k|static inline int clamp(int value, int low, int high) {
   75|   174k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 402, False: 174k]
  |  Branch (75:31): [True: 113, False: 174k]
  ------------------
   76|   174k|}
disflow_avx2.c:fclamp:
   82|   173k|static inline double fclamp(double value, double low, double high) {
   83|   173k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (83:10): [True: 38, False: 173k]
  |  Branch (83:31): [True: 54, False: 173k]
  ------------------
   84|   173k|}
av1_inv_txfm2d.c:clip_pixel_highbd:
   86|   161k|static inline uint16_t clip_pixel_highbd(int val, int bd) {
   87|   161k|  switch (bd) {
   88|   138k|    case 8:
  ------------------
  |  Branch (88:5): [True: 138k, False: 22.7k]
  ------------------
   89|   138k|    default: return (uint16_t)clamp(val, 0, 255);
  ------------------
  |  Branch (89:5): [True: 0, False: 161k]
  ------------------
   90|  14.0k|    case 10: return (uint16_t)clamp(val, 0, 1023);
  ------------------
  |  Branch (90:5): [True: 14.0k, False: 147k]
  ------------------
   91|  8.64k|    case 12: return (uint16_t)clamp(val, 0, 4095);
  ------------------
  |  Branch (91:5): [True: 8.64k, False: 152k]
  ------------------
   92|   161k|  }
   93|   161k|}
av1_inv_txfm2d.c:clamp:
   74|   161k|static inline int clamp(int value, int low, int high) {
   75|   161k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 403, False: 161k]
  |  Branch (75:31): [True: 19, False: 161k]
  ------------------
   76|   161k|}
av1_loopfilter.c:clamp:
   74|  51.0M|static inline int clamp(int value, int low, int high) {
   75|  51.0M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 51.0M]
  |  Branch (75:31): [True: 172k, False: 50.9M]
  ------------------
   76|  51.0M|}
mvref_common.c:clamp:
   74|  11.2M|static inline int clamp(int value, int low, int high) {
   75|  11.2M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.48M, False: 9.74M]
  |  Branch (75:31): [True: 3.55k, False: 9.74M]
  ------------------
   76|  11.2M|}
quant_common.c:clamp:
   74|  89.8M|static inline int clamp(int value, int low, int high) {
   75|  89.8M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 549k, False: 89.2M]
  |  Branch (75:31): [True: 151k, False: 89.1M]
  ------------------
   76|  89.8M|}
reconintra.c:clip_pixel_highbd:
   86|   190M|static inline uint16_t clip_pixel_highbd(int val, int bd) {
   87|   190M|  switch (bd) {
   88|      0|    case 8:
  ------------------
  |  Branch (88:5): [True: 0, False: 190M]
  ------------------
   89|      0|    default: return (uint16_t)clamp(val, 0, 255);
  ------------------
  |  Branch (89:5): [True: 0, False: 190M]
  ------------------
   90|  92.7M|    case 10: return (uint16_t)clamp(val, 0, 1023);
  ------------------
  |  Branch (90:5): [True: 92.7M, False: 97.5M]
  ------------------
   91|  98.0M|    case 12: return (uint16_t)clamp(val, 0, 4095);
  ------------------
  |  Branch (91:5): [True: 98.0M, False: 92.2M]
  ------------------
   92|   190M|  }
   93|   190M|}
reconintra.c:clamp:
   74|   190M|static inline int clamp(int value, int low, int high) {
   75|   190M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.94M, False: 188M]
  |  Branch (75:31): [True: 896k, False: 187M]
  ------------------
   76|   190M|}
resize.c:clip_pixel:
   70|   804M|static inline uint8_t clip_pixel(int val) {
   71|   804M|  return (val > 255) ? 255 : (val < 0) ? 0 : val;
  ------------------
  |  Branch (71:10): [True: 1.28M, False: 802M]
  |  Branch (71:30): [True: 1.28M, False: 801M]
  ------------------
   72|   804M|}
resize.c:clamp:
   74|   193M|static inline int clamp(int value, int low, int high) {
   75|   193M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 31.7M, False: 161M]
  |  Branch (75:31): [True: 28.1M, False: 133M]
  ------------------
   76|   193M|}
resize.c:clip_pixel_highbd:
   86|  73.5M|static inline uint16_t clip_pixel_highbd(int val, int bd) {
   87|  73.5M|  switch (bd) {
   88|      0|    case 8:
  ------------------
  |  Branch (88:5): [True: 0, False: 73.5M]
  ------------------
   89|      0|    default: return (uint16_t)clamp(val, 0, 255);
  ------------------
  |  Branch (89:5): [True: 0, False: 73.5M]
  ------------------
   90|  37.1M|    case 10: return (uint16_t)clamp(val, 0, 1023);
  ------------------
  |  Branch (90:5): [True: 37.1M, False: 36.4M]
  ------------------
   91|  36.4M|    case 12: return (uint16_t)clamp(val, 0, 4095);
  ------------------
  |  Branch (91:5): [True: 36.4M, False: 37.1M]
  ------------------
   92|  73.5M|  }
   93|  73.5M|}
warped_motion.c:clamp:
   74|  1.45M|static inline int clamp(int value, int low, int high) {
   75|  1.45M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 189, False: 1.45M]
  |  Branch (75:31): [True: 350, False: 1.44M]
  ------------------
   76|  1.45M|}
warped_motion.c:clamp64:
   78|   572k|static inline int64_t clamp64(int64_t value, int64_t low, int64_t high) {
   79|   572k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (79:10): [True: 75.8k, False: 497k]
  |  Branch (79:31): [True: 60.6k, False: 436k]
  ------------------
   80|   572k|}
cost.c:clamp:
   74|   906M|static inline int clamp(int value, int low, int high) {
   75|   906M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 0, False: 906M]
  |  Branch (75:31): [True: 0, False: 906M]
  ------------------
   76|   906M|}
global_motion.c:clamp:
   74|  1.59k|static inline int clamp(int value, int low, int high) {
   75|  1.59k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 25, False: 1.56k]
  |  Branch (75:31): [True: 41, False: 1.52k]
  ------------------
   76|  1.59k|}
av1_convolve_scale_sse4.c:clip_pixel_highbd:
   86|   827k|static inline uint16_t clip_pixel_highbd(int val, int bd) {
   87|   827k|  switch (bd) {
   88|      0|    case 8:
  ------------------
  |  Branch (88:5): [True: 0, False: 827k]
  ------------------
   89|      0|    default: return (uint16_t)clamp(val, 0, 255);
  ------------------
  |  Branch (89:5): [True: 0, False: 827k]
  ------------------
   90|   385k|    case 10: return (uint16_t)clamp(val, 0, 1023);
  ------------------
  |  Branch (90:5): [True: 385k, False: 441k]
  ------------------
   91|   441k|    case 12: return (uint16_t)clamp(val, 0, 4095);
  ------------------
  |  Branch (91:5): [True: 441k, False: 385k]
  ------------------
   92|   827k|  }
   93|   827k|}
av1_convolve_scale_sse4.c:clamp:
   74|   827k|static inline int clamp(int value, int low, int high) {
   75|   827k|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 1.95k, False: 825k]
  |  Branch (75:31): [True: 281, False: 825k]
  ------------------
   76|   827k|}
warp_plane_avx2.c:clamp:
   74|  4.24M|static inline int clamp(int value, int low, int high) {
   75|  4.24M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 265k, False: 3.97M]
  |  Branch (75:31): [True: 560k, False: 3.41M]
  ------------------
   76|  4.24M|}
highbd_warp_affine_avx2.c:clamp:
   74|  17.4M|static inline int clamp(int value, int low, int high) {
   75|  17.4M|  return value < low ? low : (value > high ? high : value);
  ------------------
  |  Branch (75:10): [True: 2.07M, False: 15.3M]
  |  Branch (75:31): [True: 7.01M, False: 8.32M]
  ------------------
   76|  17.4M|}

aom_dsp_rtcd:
   18|  25.4k|void aom_dsp_rtcd(void) { aom_once(setup_rtcd_internal); }

aom_highbd_avg_8x8_c:
   63|   101k|unsigned int aom_highbd_avg_8x8_c(const uint8_t *s8, int p) {
   64|   101k|  int i, j;
   65|   101k|  int sum = 0;
   66|   101k|  const uint16_t *s = CONVERT_TO_SHORTPTR(s8);
  ------------------
  |  |   79|   101k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   67|   914k|  for (i = 0; i < 8; ++i, s += p)
  ------------------
  |  Branch (67:15): [True: 812k, False: 101k]
  ------------------
   68|  7.31M|    for (j = 0; j < 8; sum += s[j], ++j) {
  ------------------
  |  Branch (68:17): [True: 6.49M, False: 812k]
  ------------------
   69|  6.49M|    }
   70|       |
   71|   101k|  return (sum + 32) >> 6;
   72|   101k|}
aom_highbd_avg_4x4_c:
   74|  24.3k|unsigned int aom_highbd_avg_4x4_c(const uint8_t *s8, int p) {
   75|  24.3k|  int i, j;
   76|  24.3k|  int sum = 0;
   77|  24.3k|  const uint16_t *s = CONVERT_TO_SHORTPTR(s8);
  ------------------
  |  |   79|  24.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   78|   121k|  for (i = 0; i < 4; ++i, s += p)
  ------------------
  |  Branch (78:15): [True: 97.3k, False: 24.3k]
  ------------------
   79|   486k|    for (j = 0; j < 4; sum += s[j], ++j) {
  ------------------
  |  Branch (79:17): [True: 389k, False: 97.3k]
  ------------------
   80|   389k|    }
   81|       |
   82|  24.3k|  return (sum + 8) >> 4;
   83|  24.3k|}

aom_read_primitive_refsubexpfin_:
   57|  1.80k|                                          uint16_t ref ACCT_STR_PARAM) {
   58|  1.80k|  return inv_recenter_finite_nonneg(
   59|  1.80k|      n, ref, read_primitive_subexpfin(r, n, k, ACCT_STR_NAME));
  ------------------
  |  |   18|  1.80k|  read_primitive_subexpfin_(r, n, k ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   60|  1.80k|}
binary_codes_reader.c:read_primitive_subexpfin_:
   32|  1.80k|                                          uint16_t k ACCT_STR_PARAM) {
   33|  1.80k|  int i = 0;
   34|  1.80k|  int mk = 0;
   35|       |
   36|  5.22k|  while (1) {
  ------------------
  |  Branch (36:10): [True: 5.22k, Folded]
  ------------------
   37|  5.22k|    int b = (i ? k + i - 1 : k);
  ------------------
  |  Branch (37:14): [True: 3.42k, False: 1.79k]
  ------------------
   38|  5.22k|    int a = (1 << b);
   39|       |
   40|  5.22k|    if (n <= mk + 3 * a) {
  ------------------
  |  Branch (40:9): [True: 1.69k, False: 3.53k]
  ------------------
   41|  1.69k|      return read_primitive_quniform(r, n - mk, ACCT_STR_NAME) + mk;
  ------------------
  |  |   16|  1.69k|  read_primitive_quniform_(r, n ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   42|  1.69k|    }
   43|       |
   44|  3.53k|    if (!aom_read_bit(r, ACCT_STR_NAME)) {
  ------------------
  |  |   43|  3.53k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (44:9): [True: 108, False: 3.42k]
  ------------------
   45|    108|      return aom_read_literal(r, b, ACCT_STR_NAME) + mk;
  ------------------
  |  |   47|    108|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   46|    108|    }
   47|       |
   48|  3.42k|    i = i + 1;
   49|  3.42k|    mk += a;
   50|  3.42k|  }
   51|       |
   52|  1.80k|  assert(0);
   53|      3|  return 0;
   54|  1.80k|}
binary_codes_reader.c:read_primitive_quniform_:
   21|  1.69k|                                         uint16_t n ACCT_STR_PARAM) {
   22|  1.69k|  if (n <= 1) return 0;
  ------------------
  |  Branch (22:7): [True: 0, False: 1.69k]
  ------------------
   23|  1.69k|  const int l = get_msb(n) + 1;
   24|  1.69k|  const int m = (1 << l) - n;
   25|  1.69k|  const int v = aom_read_literal(r, l - 1, ACCT_STR_NAME);
  ------------------
  |  |   47|  1.69k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   26|  1.69k|  return v < m ? v : (v << 1) - m + aom_read_bit(r, ACCT_STR_NAME);
  ------------------
  |  |   43|  2.17k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (26:10): [True: 1.20k, False: 488]
  ------------------
   27|  1.69k|}

aom_write_primitive_refsubexpfin:
   91|  4.55k|                                      uint16_t ref, uint16_t v) {
   92|  4.55k|  write_primitive_subexpfin(w, n, k, recenter_finite_nonneg(n, ref, v));
   93|  4.55k|}
aom_count_primitive_refsubexpfin:
   96|  41.4k|                                     uint16_t v) {
   97|  41.4k|  return count_primitive_subexpfin(n, k, recenter_finite_nonneg(n, ref, v));
   98|  41.4k|}
aom_count_signed_primitive_refsubexpfin:
  101|  1.00k|                                            int16_t v) {
  102|  1.00k|  ref += n - 1;
  103|  1.00k|  v += n - 1;
  104|  1.00k|  const uint16_t scaled_n = (n << 1) - 1;
  105|  1.00k|  return aom_count_primitive_refsubexpfin(scaled_n, k, ref, v);
  106|  1.00k|}
binary_codes_writer.c:write_primitive_subexpfin:
   39|  4.55k|                                      uint16_t v) {
   40|  4.55k|  int i = 0;
   41|  4.55k|  int mk = 0;
   42|  13.3k|  while (1) {
  ------------------
  |  Branch (42:10): [True: 13.3k, Folded]
  ------------------
   43|  13.3k|    int b = (i ? k + i - 1 : k);
  ------------------
  |  Branch (43:14): [True: 8.75k, False: 4.55k]
  ------------------
   44|  13.3k|    int a = (1 << b);
   45|  13.3k|    if (n <= mk + 3 * a) {
  ------------------
  |  Branch (45:9): [True: 4.31k, False: 8.98k]
  ------------------
   46|  4.31k|      write_primitive_quniform(w, n - mk, v - mk);
   47|  4.31k|      break;
   48|  8.98k|    } else {
   49|  8.98k|      int t = (v >= mk + a);
   50|  8.98k|      aom_write_bit(w, t);
   51|  8.98k|      if (t) {
  ------------------
  |  Branch (51:11): [True: 8.75k, False: 235]
  ------------------
   52|  8.75k|        i = i + 1;
   53|  8.75k|        mk += a;
   54|  8.75k|      } else {
   55|    235|        aom_write_literal(w, v - mk, b);
   56|    235|        break;
   57|    235|      }
   58|  8.98k|    }
   59|  13.3k|  }
   60|  4.55k|}
binary_codes_writer.c:write_primitive_quniform:
   18|  4.31k|static void write_primitive_quniform(aom_writer *w, uint16_t n, uint16_t v) {
   19|  4.31k|  if (n <= 1) return;
  ------------------
  |  Branch (19:7): [True: 0, False: 4.31k]
  ------------------
   20|  4.31k|  const int l = get_msb(n) + 1;
   21|  4.31k|  const int m = (1 << l) - n;
   22|  4.31k|  if (v < m) {
  ------------------
  |  Branch (22:7): [True: 3.09k, False: 1.22k]
  ------------------
   23|  3.09k|    aom_write_literal(w, v, l - 1);
   24|  3.09k|  } else {
   25|  1.22k|    aom_write_literal(w, m + ((v - m) >> 1), l - 1);
   26|  1.22k|    aom_write_bit(w, (v - m) & 1);
   27|  1.22k|  }
   28|  4.31k|}
binary_codes_writer.c:count_primitive_subexpfin:
   62|  41.4k|static int count_primitive_subexpfin(uint16_t n, uint16_t k, uint16_t v) {
   63|  41.4k|  int count = 0;
   64|  41.4k|  int i = 0;
   65|  41.4k|  int mk = 0;
   66|   120k|  while (1) {
  ------------------
  |  Branch (66:10): [True: 120k, Folded]
  ------------------
   67|   120k|    int b = (i ? k + i - 1 : k);
  ------------------
  |  Branch (67:14): [True: 79.0k, False: 41.4k]
  ------------------
   68|   120k|    int a = (1 << b);
   69|   120k|    if (n <= mk + 3 * a) {
  ------------------
  |  Branch (69:9): [True: 35.7k, False: 84.7k]
  ------------------
   70|  35.7k|      count += count_primitive_quniform(n - mk, v - mk);
   71|  35.7k|      break;
   72|  84.7k|    } else {
   73|  84.7k|      int t = (v >= mk + a);
   74|  84.7k|      count++;
   75|  84.7k|      if (t) {
  ------------------
  |  Branch (75:11): [True: 79.0k, False: 5.73k]
  ------------------
   76|  79.0k|        i = i + 1;
   77|  79.0k|        mk += a;
   78|  79.0k|      } else {
   79|  5.73k|        count += b;
   80|  5.73k|        break;
   81|  5.73k|      }
   82|  84.7k|    }
   83|   120k|  }
   84|  41.4k|  return count;
   85|  41.4k|}
binary_codes_writer.c:count_primitive_quniform:
   30|  35.7k|static int count_primitive_quniform(uint16_t n, uint16_t v) {
   31|  35.7k|  if (n <= 1) return 0;
  ------------------
  |  Branch (31:7): [True: 0, False: 35.7k]
  ------------------
   32|  35.7k|  const int l = get_msb(n) + 1;
   33|  35.7k|  const int m = (1 << l) - n;
   34|  35.7k|  return v < m ? l - 1 : l;
  ------------------
  |  Branch (34:10): [True: 22.6k, False: 13.0k]
  ------------------
   35|  35.7k|}

aom_reader_init:
   14|  44.9k|int aom_reader_init(aom_reader *r, const uint8_t *buffer, size_t size) {
   15|  44.9k|  if (size && !buffer) {
  ------------------
  |  Branch (15:7): [True: 44.9k, False: 1]
  |  Branch (15:15): [True: 0, False: 44.9k]
  ------------------
   16|      0|    return 1;
   17|      0|  }
   18|  44.9k|  r->buffer_end = buffer + size;
   19|  44.9k|  r->buffer = buffer;
   20|  44.9k|  od_ec_dec_init(&r->ec, buffer, (uint32_t)size);
   21|       |#if CONFIG_ACCOUNTING
   22|       |  r->accounting = NULL;
   23|       |#endif
   24|  44.9k|  return 0;
   25|  44.9k|}
aom_reader_find_begin:
   27|  45.0k|const uint8_t *aom_reader_find_begin(aom_reader *r) { return r->buffer; }
aom_reader_find_end:
   29|  73.0k|const uint8_t *aom_reader_find_end(aom_reader *r) { return r->buffer_end; }
aom_reader_tell:
   31|   141k|uint32_t aom_reader_tell(const aom_reader *r) { return od_ec_dec_tell(&r->ec); }
aom_reader_has_overflowed:
   37|  96.9k|int aom_reader_has_overflowed(const aom_reader *r) {
   38|  96.9k|  const uint32_t tell_bits = aom_reader_tell(r);
   39|  96.9k|  const uint32_t tell_bytes = (tell_bits + 7) >> 3;
   40|  96.9k|  return ((ptrdiff_t)tell_bytes > r->buffer_end - r->buffer);
   41|  96.9k|}

decodeframe.c:aom_read_symbol_:
  221|  1.65M|                                   int nsymbs ACCT_STR_PARAM) {
  222|  1.65M|  int ret;
  223|  1.65M|  ret = aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME);
  ------------------
  |  |   49|  1.65M|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  224|  1.65M|  if (r->allow_update_cdf) update_cdf(cdf, ret, nsymbs);
  ------------------
  |  Branch (224:7): [True: 1.64M, False: 1.96k]
  ------------------
  225|  1.65M|  return ret;
  226|  1.65M|}
decodeframe.c:aom_read_cdf_:
  169|  1.77M|                                int nsymbs ACCT_STR_PARAM) {
  170|  1.77M|  int symb;
  171|  1.77M|  assert(cdf != NULL);
  172|  1.77M|  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
  173|       |
  174|       |#if CONFIG_BITSTREAM_DEBUG
  175|       |  {
  176|       |    int i;
  177|       |    int cdf_error = 0;
  178|       |    int ref_symb, ref_nsymbs;
  179|       |    aom_cdf_prob ref_cdf[16];
  180|       |    const int queue_r = bitstream_queue_get_read();
  181|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  182|       |    bitstream_queue_pop(&ref_symb, ref_cdf, &ref_nsymbs);
  183|       |    if (nsymbs != ref_nsymbs) {
  184|       |      fprintf(stderr,
  185|       |              "\n *** nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs %d "
  186|       |              "queue_r %d\n",
  187|       |              frame_idx, nsymbs, ref_nsymbs, queue_r);
  188|       |      cdf_error = 0;
  189|       |      assert(0);
  190|       |    } else {
  191|       |      for (i = 0; i < nsymbs; ++i)
  192|       |        if (cdf[i] != ref_cdf[i]) cdf_error = 1;
  193|       |    }
  194|       |    if (cdf_error) {
  195|       |      fprintf(stderr, "\n *** cdf error, frame_idx_r %d cdf {%d", frame_idx,
  196|       |              cdf[0]);
  197|       |      for (i = 1; i < nsymbs; ++i) fprintf(stderr, ", %d", cdf[i]);
  198|       |      fprintf(stderr, "} ref_cdf {%d", ref_cdf[0]);
  199|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  200|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  201|       |      assert(0);
  202|       |    }
  203|       |    if (symb != ref_symb) {
  204|       |      fprintf(
  205|       |          stderr,
  206|       |          "\n *** symb error, frame_idx_r %d symb %d ref_symb %d queue_r %d\n",
  207|       |          frame_idx, symb, ref_symb, queue_r);
  208|       |      assert(0);
  209|       |    }
  210|       |  }
  211|       |#endif
  212|       |
  213|       |#if CONFIG_ACCOUNTING
  214|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  215|       |  aom_update_symb_counts(r, (nsymbs == 2));
  216|       |#endif
  217|  1.77M|  return symb;
  218|  1.77M|}
decodeframe.c:aom_read_literal_:
  158|     11|static inline int aom_read_literal_(aom_reader *r, int bits ACCT_STR_PARAM) {
  159|     11|  int literal = 0, bit;
  160|       |
  161|     55|  for (bit = bits - 1; bit >= 0; bit--) literal |= aom_read_bit(r, NULL) << bit;
  ------------------
  |  |   43|     44|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (161:24): [True: 44, False: 11]
  ------------------
  162|       |#if CONFIG_ACCOUNTING
  163|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  164|       |#endif
  165|     11|  return literal;
  166|     11|}
decodeframe.c:aom_read_bit_:
  149|     44|static inline int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
  150|     44|  int ret;
  151|     44|  ret = aom_read(r, 128, NULL);  // aom_prob_half
  ------------------
  |  |   41|     44|  aom_read_(r, prob ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  152|       |#if CONFIG_ACCOUNTING
  153|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  154|       |#endif
  155|     44|  return ret;
  156|     44|}
decodeframe.c:aom_read_:
  104|     44|static inline int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
  105|     44|  int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
  106|     44|  int bit = od_ec_decode_bool_q15(&r->ec, p);
  107|       |
  108|       |#if CONFIG_BITSTREAM_DEBUG
  109|       |  {
  110|       |    int i;
  111|       |    int ref_bit, ref_nsymbs;
  112|       |    aom_cdf_prob ref_cdf[16];
  113|       |    const int queue_r = bitstream_queue_get_read();
  114|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  115|       |    bitstream_queue_pop(&ref_bit, ref_cdf, &ref_nsymbs);
  116|       |    if (ref_nsymbs != 2) {
  117|       |      fprintf(stderr,
  118|       |              "\n *** [bit] nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs "
  119|       |              "%d queue_r %d\n",
  120|       |              frame_idx, 2, ref_nsymbs, queue_r);
  121|       |      assert(0);
  122|       |    }
  123|       |    if ((ref_nsymbs != 2) || (ref_cdf[0] != (aom_cdf_prob)p) ||
  124|       |        (ref_cdf[1] != 32767)) {
  125|       |      fprintf(stderr,
  126|       |              "\n *** [bit] cdf error, frame_idx_r %d cdf {%d, %d} ref_cdf {%d",
  127|       |              frame_idx, p, 32767, ref_cdf[0]);
  128|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  129|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  130|       |      assert(0);
  131|       |    }
  132|       |    if (bit != ref_bit) {
  133|       |      fprintf(stderr,
  134|       |              "\n *** [bit] symb error, frame_idx_r %d symb %d ref_symb %d "
  135|       |              "queue_r %d\n",
  136|       |              frame_idx, bit, ref_bit, queue_r);
  137|       |      assert(0);
  138|       |    }
  139|       |  }
  140|       |#endif
  141|       |
  142|       |#if CONFIG_ACCOUNTING
  143|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  144|       |  aom_update_symb_counts(r, 1);
  145|       |#endif
  146|     44|  return bit;
  147|     44|}
decodemv.c:aom_read_symbol_:
  221|  6.80M|                                   int nsymbs ACCT_STR_PARAM) {
  222|  6.80M|  int ret;
  223|  6.80M|  ret = aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME);
  ------------------
  |  |   49|  6.80M|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  224|  6.80M|  if (r->allow_update_cdf) update_cdf(cdf, ret, nsymbs);
  ------------------
  |  Branch (224:7): [True: 6.80M, False: 4.69k]
  ------------------
  225|  6.80M|  return ret;
  226|  6.80M|}
decodemv.c:aom_read_cdf_:
  169|  6.80M|                                int nsymbs ACCT_STR_PARAM) {
  170|  6.80M|  int symb;
  171|  6.80M|  assert(cdf != NULL);
  172|  6.80M|  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
  173|       |
  174|       |#if CONFIG_BITSTREAM_DEBUG
  175|       |  {
  176|       |    int i;
  177|       |    int cdf_error = 0;
  178|       |    int ref_symb, ref_nsymbs;
  179|       |    aom_cdf_prob ref_cdf[16];
  180|       |    const int queue_r = bitstream_queue_get_read();
  181|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  182|       |    bitstream_queue_pop(&ref_symb, ref_cdf, &ref_nsymbs);
  183|       |    if (nsymbs != ref_nsymbs) {
  184|       |      fprintf(stderr,
  185|       |              "\n *** nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs %d "
  186|       |              "queue_r %d\n",
  187|       |              frame_idx, nsymbs, ref_nsymbs, queue_r);
  188|       |      cdf_error = 0;
  189|       |      assert(0);
  190|       |    } else {
  191|       |      for (i = 0; i < nsymbs; ++i)
  192|       |        if (cdf[i] != ref_cdf[i]) cdf_error = 1;
  193|       |    }
  194|       |    if (cdf_error) {
  195|       |      fprintf(stderr, "\n *** cdf error, frame_idx_r %d cdf {%d", frame_idx,
  196|       |              cdf[0]);
  197|       |      for (i = 1; i < nsymbs; ++i) fprintf(stderr, ", %d", cdf[i]);
  198|       |      fprintf(stderr, "} ref_cdf {%d", ref_cdf[0]);
  199|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  200|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  201|       |      assert(0);
  202|       |    }
  203|       |    if (symb != ref_symb) {
  204|       |      fprintf(
  205|       |          stderr,
  206|       |          "\n *** symb error, frame_idx_r %d symb %d ref_symb %d queue_r %d\n",
  207|       |          frame_idx, symb, ref_symb, queue_r);
  208|       |      assert(0);
  209|       |    }
  210|       |  }
  211|       |#endif
  212|       |
  213|       |#if CONFIG_ACCOUNTING
  214|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  215|       |  aom_update_symb_counts(r, (nsymbs == 2));
  216|       |#endif
  217|  6.80M|  return symb;
  218|  6.80M|}
decodemv.c:aom_read_literal_:
  158|   204k|static inline int aom_read_literal_(aom_reader *r, int bits ACCT_STR_PARAM) {
  159|   204k|  int literal = 0, bit;
  160|       |
  161|  1.43M|  for (bit = bits - 1; bit >= 0; bit--) literal |= aom_read_bit(r, NULL) << bit;
  ------------------
  |  |   43|  1.23M|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (161:24): [True: 1.23M, False: 204k]
  ------------------
  162|       |#if CONFIG_ACCOUNTING
  163|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  164|       |#endif
  165|   204k|  return literal;
  166|   204k|}
decodemv.c:aom_read_bit_:
  149|  1.37M|static inline int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
  150|  1.37M|  int ret;
  151|  1.37M|  ret = aom_read(r, 128, NULL);  // aom_prob_half
  ------------------
  |  |   41|  1.37M|  aom_read_(r, prob ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  152|       |#if CONFIG_ACCOUNTING
  153|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  154|       |#endif
  155|  1.37M|  return ret;
  156|  1.37M|}
decodemv.c:aom_read_:
  104|  1.37M|static inline int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
  105|  1.37M|  int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
  106|  1.37M|  int bit = od_ec_decode_bool_q15(&r->ec, p);
  107|       |
  108|       |#if CONFIG_BITSTREAM_DEBUG
  109|       |  {
  110|       |    int i;
  111|       |    int ref_bit, ref_nsymbs;
  112|       |    aom_cdf_prob ref_cdf[16];
  113|       |    const int queue_r = bitstream_queue_get_read();
  114|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  115|       |    bitstream_queue_pop(&ref_bit, ref_cdf, &ref_nsymbs);
  116|       |    if (ref_nsymbs != 2) {
  117|       |      fprintf(stderr,
  118|       |              "\n *** [bit] nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs "
  119|       |              "%d queue_r %d\n",
  120|       |              frame_idx, 2, ref_nsymbs, queue_r);
  121|       |      assert(0);
  122|       |    }
  123|       |    if ((ref_nsymbs != 2) || (ref_cdf[0] != (aom_cdf_prob)p) ||
  124|       |        (ref_cdf[1] != 32767)) {
  125|       |      fprintf(stderr,
  126|       |              "\n *** [bit] cdf error, frame_idx_r %d cdf {%d, %d} ref_cdf {%d",
  127|       |              frame_idx, p, 32767, ref_cdf[0]);
  128|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  129|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  130|       |      assert(0);
  131|       |    }
  132|       |    if (bit != ref_bit) {
  133|       |      fprintf(stderr,
  134|       |              "\n *** [bit] symb error, frame_idx_r %d symb %d ref_symb %d "
  135|       |              "queue_r %d\n",
  136|       |              frame_idx, bit, ref_bit, queue_r);
  137|       |      assert(0);
  138|       |    }
  139|       |  }
  140|       |#endif
  141|       |
  142|       |#if CONFIG_ACCOUNTING
  143|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  144|       |  aom_update_symb_counts(r, 1);
  145|       |#endif
  146|  1.37M|  return bit;
  147|  1.37M|}
decodetxb.c:aom_read_symbol_:
  221|  79.7M|                                   int nsymbs ACCT_STR_PARAM) {
  222|  79.7M|  int ret;
  223|  79.7M|  ret = aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME);
  ------------------
  |  |   49|  79.7M|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  224|  79.7M|  if (r->allow_update_cdf) update_cdf(cdf, ret, nsymbs);
  ------------------
  |  Branch (224:7): [True: 79.7M, False: 12.7k]
  ------------------
  225|  79.7M|  return ret;
  226|  79.7M|}
decodetxb.c:aom_read_cdf_:
  169|  79.5M|                                int nsymbs ACCT_STR_PARAM) {
  170|  79.5M|  int symb;
  171|  79.5M|  assert(cdf != NULL);
  172|  79.5M|  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
  173|       |
  174|       |#if CONFIG_BITSTREAM_DEBUG
  175|       |  {
  176|       |    int i;
  177|       |    int cdf_error = 0;
  178|       |    int ref_symb, ref_nsymbs;
  179|       |    aom_cdf_prob ref_cdf[16];
  180|       |    const int queue_r = bitstream_queue_get_read();
  181|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  182|       |    bitstream_queue_pop(&ref_symb, ref_cdf, &ref_nsymbs);
  183|       |    if (nsymbs != ref_nsymbs) {
  184|       |      fprintf(stderr,
  185|       |              "\n *** nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs %d "
  186|       |              "queue_r %d\n",
  187|       |              frame_idx, nsymbs, ref_nsymbs, queue_r);
  188|       |      cdf_error = 0;
  189|       |      assert(0);
  190|       |    } else {
  191|       |      for (i = 0; i < nsymbs; ++i)
  192|       |        if (cdf[i] != ref_cdf[i]) cdf_error = 1;
  193|       |    }
  194|       |    if (cdf_error) {
  195|       |      fprintf(stderr, "\n *** cdf error, frame_idx_r %d cdf {%d", frame_idx,
  196|       |              cdf[0]);
  197|       |      for (i = 1; i < nsymbs; ++i) fprintf(stderr, ", %d", cdf[i]);
  198|       |      fprintf(stderr, "} ref_cdf {%d", ref_cdf[0]);
  199|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  200|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  201|       |      assert(0);
  202|       |    }
  203|       |    if (symb != ref_symb) {
  204|       |      fprintf(
  205|       |          stderr,
  206|       |          "\n *** symb error, frame_idx_r %d symb %d ref_symb %d queue_r %d\n",
  207|       |          frame_idx, symb, ref_symb, queue_r);
  208|       |      assert(0);
  209|       |    }
  210|       |  }
  211|       |#endif
  212|       |
  213|       |#if CONFIG_ACCOUNTING
  214|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  215|       |  aom_update_symb_counts(r, (nsymbs == 2));
  216|       |#endif
  217|  79.5M|  return symb;
  218|  79.5M|}
decodetxb.c:aom_read_bit_:
  149|  69.9M|static inline int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
  150|  69.9M|  int ret;
  151|  69.9M|  ret = aom_read(r, 128, NULL);  // aom_prob_half
  ------------------
  |  |   41|  69.9M|  aom_read_(r, prob ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  152|       |#if CONFIG_ACCOUNTING
  153|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  154|       |#endif
  155|  69.9M|  return ret;
  156|  69.9M|}
decodetxb.c:aom_read_:
  104|  69.9M|static inline int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
  105|  69.9M|  int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
  106|  69.9M|  int bit = od_ec_decode_bool_q15(&r->ec, p);
  107|       |
  108|       |#if CONFIG_BITSTREAM_DEBUG
  109|       |  {
  110|       |    int i;
  111|       |    int ref_bit, ref_nsymbs;
  112|       |    aom_cdf_prob ref_cdf[16];
  113|       |    const int queue_r = bitstream_queue_get_read();
  114|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  115|       |    bitstream_queue_pop(&ref_bit, ref_cdf, &ref_nsymbs);
  116|       |    if (ref_nsymbs != 2) {
  117|       |      fprintf(stderr,
  118|       |              "\n *** [bit] nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs "
  119|       |              "%d queue_r %d\n",
  120|       |              frame_idx, 2, ref_nsymbs, queue_r);
  121|       |      assert(0);
  122|       |    }
  123|       |    if ((ref_nsymbs != 2) || (ref_cdf[0] != (aom_cdf_prob)p) ||
  124|       |        (ref_cdf[1] != 32767)) {
  125|       |      fprintf(stderr,
  126|       |              "\n *** [bit] cdf error, frame_idx_r %d cdf {%d, %d} ref_cdf {%d",
  127|       |              frame_idx, p, 32767, ref_cdf[0]);
  128|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  129|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  130|       |      assert(0);
  131|       |    }
  132|       |    if (bit != ref_bit) {
  133|       |      fprintf(stderr,
  134|       |              "\n *** [bit] symb error, frame_idx_r %d symb %d ref_symb %d "
  135|       |              "queue_r %d\n",
  136|       |              frame_idx, bit, ref_bit, queue_r);
  137|       |      assert(0);
  138|       |    }
  139|       |  }
  140|       |#endif
  141|       |
  142|       |#if CONFIG_ACCOUNTING
  143|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  144|       |  aom_update_symb_counts(r, 1);
  145|       |#endif
  146|  69.9M|  return bit;
  147|  69.9M|}
detokenize.c:aom_read_literal_:
  158|  30.9k|static inline int aom_read_literal_(aom_reader *r, int bits ACCT_STR_PARAM) {
  159|  30.9k|  int literal = 0, bit;
  160|       |
  161|  80.6k|  for (bit = bits - 1; bit >= 0; bit--) literal |= aom_read_bit(r, NULL) << bit;
  ------------------
  |  |   43|  49.6k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (161:24): [True: 49.6k, False: 30.9k]
  ------------------
  162|       |#if CONFIG_ACCOUNTING
  163|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  164|       |#endif
  165|  30.9k|  return literal;
  166|  30.9k|}
detokenize.c:aom_read_bit_:
  149|  49.6k|static inline int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
  150|  49.6k|  int ret;
  151|  49.6k|  ret = aom_read(r, 128, NULL);  // aom_prob_half
  ------------------
  |  |   41|  49.6k|  aom_read_(r, prob ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  152|       |#if CONFIG_ACCOUNTING
  153|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  154|       |#endif
  155|  49.6k|  return ret;
  156|  49.6k|}
detokenize.c:aom_read_:
  104|  49.6k|static inline int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
  105|  49.6k|  int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
  106|  49.6k|  int bit = od_ec_decode_bool_q15(&r->ec, p);
  107|       |
  108|       |#if CONFIG_BITSTREAM_DEBUG
  109|       |  {
  110|       |    int i;
  111|       |    int ref_bit, ref_nsymbs;
  112|       |    aom_cdf_prob ref_cdf[16];
  113|       |    const int queue_r = bitstream_queue_get_read();
  114|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  115|       |    bitstream_queue_pop(&ref_bit, ref_cdf, &ref_nsymbs);
  116|       |    if (ref_nsymbs != 2) {
  117|       |      fprintf(stderr,
  118|       |              "\n *** [bit] nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs "
  119|       |              "%d queue_r %d\n",
  120|       |              frame_idx, 2, ref_nsymbs, queue_r);
  121|       |      assert(0);
  122|       |    }
  123|       |    if ((ref_nsymbs != 2) || (ref_cdf[0] != (aom_cdf_prob)p) ||
  124|       |        (ref_cdf[1] != 32767)) {
  125|       |      fprintf(stderr,
  126|       |              "\n *** [bit] cdf error, frame_idx_r %d cdf {%d, %d} ref_cdf {%d",
  127|       |              frame_idx, p, 32767, ref_cdf[0]);
  128|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  129|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  130|       |      assert(0);
  131|       |    }
  132|       |    if (bit != ref_bit) {
  133|       |      fprintf(stderr,
  134|       |              "\n *** [bit] symb error, frame_idx_r %d symb %d ref_symb %d "
  135|       |              "queue_r %d\n",
  136|       |              frame_idx, bit, ref_bit, queue_r);
  137|       |      assert(0);
  138|       |    }
  139|       |  }
  140|       |#endif
  141|       |
  142|       |#if CONFIG_ACCOUNTING
  143|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  144|       |  aom_update_symb_counts(r, 1);
  145|       |#endif
  146|  49.6k|  return bit;
  147|  49.6k|}
detokenize.c:aom_read_symbol_:
  221|  1.27M|                                   int nsymbs ACCT_STR_PARAM) {
  222|  1.27M|  int ret;
  223|  1.27M|  ret = aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME);
  ------------------
  |  |   49|  1.27M|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  224|  1.27M|  if (r->allow_update_cdf) update_cdf(cdf, ret, nsymbs);
  ------------------
  |  Branch (224:7): [True: 1.26M, False: 17.9k]
  ------------------
  225|  1.27M|  return ret;
  226|  1.27M|}
detokenize.c:aom_read_cdf_:
  169|  1.27M|                                int nsymbs ACCT_STR_PARAM) {
  170|  1.27M|  int symb;
  171|  1.27M|  assert(cdf != NULL);
  172|  1.27M|  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
  173|       |
  174|       |#if CONFIG_BITSTREAM_DEBUG
  175|       |  {
  176|       |    int i;
  177|       |    int cdf_error = 0;
  178|       |    int ref_symb, ref_nsymbs;
  179|       |    aom_cdf_prob ref_cdf[16];
  180|       |    const int queue_r = bitstream_queue_get_read();
  181|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  182|       |    bitstream_queue_pop(&ref_symb, ref_cdf, &ref_nsymbs);
  183|       |    if (nsymbs != ref_nsymbs) {
  184|       |      fprintf(stderr,
  185|       |              "\n *** nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs %d "
  186|       |              "queue_r %d\n",
  187|       |              frame_idx, nsymbs, ref_nsymbs, queue_r);
  188|       |      cdf_error = 0;
  189|       |      assert(0);
  190|       |    } else {
  191|       |      for (i = 0; i < nsymbs; ++i)
  192|       |        if (cdf[i] != ref_cdf[i]) cdf_error = 1;
  193|       |    }
  194|       |    if (cdf_error) {
  195|       |      fprintf(stderr, "\n *** cdf error, frame_idx_r %d cdf {%d", frame_idx,
  196|       |              cdf[0]);
  197|       |      for (i = 1; i < nsymbs; ++i) fprintf(stderr, ", %d", cdf[i]);
  198|       |      fprintf(stderr, "} ref_cdf {%d", ref_cdf[0]);
  199|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  200|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  201|       |      assert(0);
  202|       |    }
  203|       |    if (symb != ref_symb) {
  204|       |      fprintf(
  205|       |          stderr,
  206|       |          "\n *** symb error, frame_idx_r %d symb %d ref_symb %d queue_r %d\n",
  207|       |          frame_idx, symb, ref_symb, queue_r);
  208|       |      assert(0);
  209|       |    }
  210|       |  }
  211|       |#endif
  212|       |
  213|       |#if CONFIG_ACCOUNTING
  214|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  215|       |  aom_update_symb_counts(r, (nsymbs == 2));
  216|       |#endif
  217|  1.27M|  return symb;
  218|  1.27M|}
binary_codes_reader.c:aom_read_bit_:
  149|  11.1k|static inline int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
  150|  11.1k|  int ret;
  151|  11.1k|  ret = aom_read(r, 128, NULL);  // aom_prob_half
  ------------------
  |  |   41|  11.1k|  aom_read_(r, prob ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  152|       |#if CONFIG_ACCOUNTING
  153|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  154|       |#endif
  155|  11.1k|  return ret;
  156|  11.1k|}
binary_codes_reader.c:aom_read_:
  104|  11.1k|static inline int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
  105|  11.1k|  int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
  106|  11.1k|  int bit = od_ec_decode_bool_q15(&r->ec, p);
  107|       |
  108|       |#if CONFIG_BITSTREAM_DEBUG
  109|       |  {
  110|       |    int i;
  111|       |    int ref_bit, ref_nsymbs;
  112|       |    aom_cdf_prob ref_cdf[16];
  113|       |    const int queue_r = bitstream_queue_get_read();
  114|       |    const int frame_idx = aom_bitstream_queue_get_frame_read();
  115|       |    bitstream_queue_pop(&ref_bit, ref_cdf, &ref_nsymbs);
  116|       |    if (ref_nsymbs != 2) {
  117|       |      fprintf(stderr,
  118|       |              "\n *** [bit] nsymbs error, frame_idx_r %d nsymbs %d ref_nsymbs "
  119|       |              "%d queue_r %d\n",
  120|       |              frame_idx, 2, ref_nsymbs, queue_r);
  121|       |      assert(0);
  122|       |    }
  123|       |    if ((ref_nsymbs != 2) || (ref_cdf[0] != (aom_cdf_prob)p) ||
  124|       |        (ref_cdf[1] != 32767)) {
  125|       |      fprintf(stderr,
  126|       |              "\n *** [bit] cdf error, frame_idx_r %d cdf {%d, %d} ref_cdf {%d",
  127|       |              frame_idx, p, 32767, ref_cdf[0]);
  128|       |      for (i = 1; i < ref_nsymbs; ++i) fprintf(stderr, ", %d", ref_cdf[i]);
  129|       |      fprintf(stderr, "} queue_r %d\n", queue_r);
  130|       |      assert(0);
  131|       |    }
  132|       |    if (bit != ref_bit) {
  133|       |      fprintf(stderr,
  134|       |              "\n *** [bit] symb error, frame_idx_r %d symb %d ref_symb %d "
  135|       |              "queue_r %d\n",
  136|       |              frame_idx, bit, ref_bit, queue_r);
  137|       |      assert(0);
  138|       |    }
  139|       |  }
  140|       |#endif
  141|       |
  142|       |#if CONFIG_ACCOUNTING
  143|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  144|       |  aom_update_symb_counts(r, 1);
  145|       |#endif
  146|  11.1k|  return bit;
  147|  11.1k|}
binary_codes_reader.c:aom_read_literal_:
  158|  1.79k|static inline int aom_read_literal_(aom_reader *r, int bits ACCT_STR_PARAM) {
  159|  1.79k|  int literal = 0, bit;
  160|       |
  161|  8.92k|  for (bit = bits - 1; bit >= 0; bit--) literal |= aom_read_bit(r, NULL) << bit;
  ------------------
  |  |   43|  7.13k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  |  Branch (161:24): [True: 7.13k, False: 1.79k]
  ------------------
  162|       |#if CONFIG_ACCOUNTING
  163|       |  if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
  164|       |#endif
  165|  1.79k|  return literal;
  166|  1.79k|}

aom_rb_bytes_read:
   21|  28.0k|size_t aom_rb_bytes_read(const struct aom_read_bit_buffer *rb) {
   22|  28.0k|  return (rb->bit_offset + 7) >> 3;
   23|  28.0k|}
aom_rb_read_bit:
   25|  6.46M|int aom_rb_read_bit(struct aom_read_bit_buffer *rb) {
   26|  6.46M|  const uint32_t off = rb->bit_offset;
   27|  6.46M|  const uint32_t p = off >> 3;
   28|  6.46M|  const int q = 7 - (int)(off & 0x7);
   29|  6.46M|  if (rb->bit_buffer + p < rb->bit_buffer_end) {
  ------------------
  |  Branch (29:7): [True: 6.46M, False: 0]
  ------------------
   30|  6.46M|    const int bit = (rb->bit_buffer[p] >> q) & 1;
   31|  6.46M|    rb->bit_offset = off + 1;
   32|  6.46M|    return bit;
   33|  6.46M|  } else {
   34|      0|    if (rb->error_handler) rb->error_handler(rb->error_handler_data);
  ------------------
  |  Branch (34:9): [True: 0, False: 0]
  ------------------
   35|      0|    return 0;
   36|      0|  }
   37|  6.46M|}
aom_rb_read_literal:
   39|  1.00M|int aom_rb_read_literal(struct aom_read_bit_buffer *rb, int bits) {
   40|  1.00M|  assert(bits <= 31);
   41|  1.00M|  int value = 0, bit;
   42|  5.94M|  for (bit = bits - 1; bit >= 0; bit--) value |= aom_rb_read_bit(rb) << bit;
  ------------------
  |  Branch (42:24): [True: 4.93M, False: 1.00M]
  ------------------
   43|  1.00M|  return value;
   44|  1.00M|}
aom_rb_read_inv_signed_literal:
   57|  13.7k|int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits) {
   58|  13.7k|  const int nbits = sizeof(unsigned) * 8 - bits - 1;
   59|  13.7k|  const unsigned value = (unsigned)aom_rb_read_literal(rb, bits + 1) << nbits;
   60|  13.7k|  return ((int)value) >> nbits;
   61|  13.7k|}

aom_start_encode:
   15|   117k|void aom_start_encode(aom_writer *w, uint8_t *source, size_t size) {
   16|   117k|  w->buffer = source;
   17|   117k|  w->size = size;
   18|   117k|  w->pos = 0;
   19|   117k|  od_ec_enc_init(&w->ec, 62025);
   20|   117k|}
aom_stop_encode:
   22|   117k|int aom_stop_encode(aom_writer *w) {
   23|   117k|  int nb_bits;
   24|   117k|  uint32_t bytes;
   25|   117k|  unsigned char *data;
   26|   117k|  data = od_ec_enc_done(&w->ec, &bytes);
   27|   117k|  if (!data || bytes > w->size) {
  ------------------
  |  Branch (27:7): [True: 18.4E, False: 117k]
  |  Branch (27:16): [True: 0, False: 117k]
  ------------------
   28|      0|    od_ec_enc_clear(&w->ec);
   29|      0|    return -1;
   30|      0|  }
   31|   117k|  nb_bits = od_ec_enc_tell(&w->ec);
   32|   117k|  memcpy(w->buffer, data, bytes);
   33|   117k|  w->pos = bytes;
   34|   117k|  od_ec_enc_clear(&w->ec);
   35|   117k|  return nb_bits;
   36|   117k|}
aom_tell_size:
   38|  3.94M|int aom_tell_size(aom_writer *w) {
   39|  3.94M|  const int nb_bits = od_ec_enc_tell(&w->ec);
   40|  3.94M|  return nb_bits;
   41|  3.94M|}

bitstream.c:aom_write_symbol:
  102|  22.6M|                                    int nsymbs) {
  103|  22.6M|  aom_write_cdf(w, symb, cdf, nsymbs);
  104|  22.6M|  if (w->allow_update_cdf) update_cdf(cdf, symb, nsymbs);
  ------------------
  |  Branch (104:7): [True: 22.5M, False: 92.8k]
  ------------------
  105|  22.6M|}
bitstream.c:aom_write_cdf:
   93|  22.9M|                                 const aom_cdf_prob *cdf, int nsymbs) {
   94|       |#if CONFIG_BITSTREAM_DEBUG
   95|       |  bitstream_queue_push(symb, cdf, nsymbs);
   96|       |#endif
   97|       |
   98|  22.9M|  od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
   99|  22.9M|}
bitstream.c:aom_write_literal:
   86|   628k|static inline void aom_write_literal(aom_writer *w, int data, int bits) {
   87|   628k|  int bit;
   88|       |
   89|  4.07M|  for (bit = bits - 1; bit >= 0; bit--) aom_write_bit(w, 1 & (data >> bit));
  ------------------
  |  Branch (89:24): [True: 3.45M, False: 628k]
  ------------------
   90|   628k|}
bitstream.c:aom_write_bit:
   82|  3.82M|static inline void aom_write_bit(aom_writer *w, int bit) {
   83|  3.82M|  aom_write(w, bit, 128);  // aom_prob_half
   84|  3.82M|}
bitstream.c:aom_write:
   72|  3.82M|static inline void aom_write(aom_writer *w, int bit, int probability) {
   73|  3.82M|  int p = (0x7FFFFF - (probability << 15) + probability) >> 8;
   74|       |#if CONFIG_BITSTREAM_DEBUG
   75|       |  aom_cdf_prob cdf[2] = { (aom_cdf_prob)p, 32767 };
   76|       |  bitstream_queue_push(bit, cdf, 2);
   77|       |#endif
   78|       |
   79|  3.82M|  od_ec_encode_bool_q15(&w->ec, bit, p);
   80|  3.82M|}
bitstream.c:init_token_stats:
   52|   467k|static inline void init_token_stats(TOKEN_STATS *token_stats) {
   53|       |#if CONFIG_RD_DEBUG
   54|       |  int r, c;
   55|       |  for (r = 0; r < TXB_COEFF_COST_MAP_SIZE; ++r) {
   56|       |    for (c = 0; c < TXB_COEFF_COST_MAP_SIZE; ++c) {
   57|       |      token_stats->txb_coeff_cost_map[r][c] = 0;
   58|       |    }
   59|       |  }
   60|       |#endif
   61|   467k|  token_stats->cost = 0;
   62|   467k|}
encodemv.c:aom_write_symbol:
  102|  2.74M|                                    int nsymbs) {
  103|  2.74M|  aom_write_cdf(w, symb, cdf, nsymbs);
  104|  2.74M|  if (w->allow_update_cdf) update_cdf(cdf, symb, nsymbs);
  ------------------
  |  Branch (104:7): [True: 2.74M, False: 1.64k]
  ------------------
  105|  2.74M|}
encodemv.c:aom_write_cdf:
   93|  2.74M|                                 const aom_cdf_prob *cdf, int nsymbs) {
   94|       |#if CONFIG_BITSTREAM_DEBUG
   95|       |  bitstream_queue_push(symb, cdf, nsymbs);
   96|       |#endif
   97|       |
   98|  2.74M|  od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
   99|  2.74M|}
encodetxb.c:aom_write_symbol:
  102|   230M|                                    int nsymbs) {
  103|   230M|  aom_write_cdf(w, symb, cdf, nsymbs);
  104|   230M|  if (w->allow_update_cdf) update_cdf(cdf, symb, nsymbs);
  ------------------
  |  Branch (104:7): [True: 230M, False: 18.4E]
  ------------------
  105|   230M|}
encodetxb.c:aom_write_cdf:
   93|   230M|                                 const aom_cdf_prob *cdf, int nsymbs) {
   94|       |#if CONFIG_BITSTREAM_DEBUG
   95|       |  bitstream_queue_push(symb, cdf, nsymbs);
   96|       |#endif
   97|       |
   98|   230M|  od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
   99|   230M|}
encodetxb.c:aom_write_bit:
   82|   200M|static inline void aom_write_bit(aom_writer *w, int bit) {
   83|   200M|  aom_write(w, bit, 128);  // aom_prob_half
   84|   200M|}
encodetxb.c:aom_write:
   72|   200M|static inline void aom_write(aom_writer *w, int bit, int probability) {
   73|   200M|  int p = (0x7FFFFF - (probability << 15) + probability) >> 8;
   74|       |#if CONFIG_BITSTREAM_DEBUG
   75|       |  aom_cdf_prob cdf[2] = { (aom_cdf_prob)p, 32767 };
   76|       |  bitstream_queue_push(bit, cdf, 2);
   77|       |#endif
   78|       |
   79|   200M|  od_ec_encode_bool_q15(&w->ec, bit, p);
   80|   200M|}
binary_codes_writer.c:aom_write_bit:
   82|  28.3k|static inline void aom_write_bit(aom_writer *w, int bit) {
   83|  28.3k|  aom_write(w, bit, 128);  // aom_prob_half
   84|  28.3k|}
binary_codes_writer.c:aom_write:
   72|  28.3k|static inline void aom_write(aom_writer *w, int bit, int probability) {
   73|  28.3k|  int p = (0x7FFFFF - (probability << 15) + probability) >> 8;
   74|       |#if CONFIG_BITSTREAM_DEBUG
   75|       |  aom_cdf_prob cdf[2] = { (aom_cdf_prob)p, 32767 };
   76|       |  bitstream_queue_push(bit, cdf, 2);
   77|       |#endif
   78|       |
   79|  28.3k|  od_ec_encode_bool_q15(&w->ec, bit, p);
   80|  28.3k|}
binary_codes_writer.c:aom_write_literal:
   86|  4.55k|static inline void aom_write_literal(aom_writer *w, int data, int bits) {
   87|  4.55k|  int bit;
   88|       |
   89|  22.7k|  for (bit = bits - 1; bit >= 0; bit--) aom_write_bit(w, 1 & (data >> bit));
  ------------------
  |  Branch (89:24): [True: 18.1k, False: 4.55k]
  ------------------
   90|  4.55k|}

aom_wb_is_byte_aligned:
   22|  18.4k|int aom_wb_is_byte_aligned(const struct aom_write_bit_buffer *wb) {
   23|       |  return (wb->bit_offset % CHAR_BIT == 0);
   24|  18.4k|}
aom_wb_bytes_written:
   26|   110k|uint32_t aom_wb_bytes_written(const struct aom_write_bit_buffer *wb) {
   27|   110k|  return wb->bit_offset / CHAR_BIT + (wb->bit_offset % CHAR_BIT > 0);
   28|   110k|}
aom_wb_write_bit:
   30|  12.5M|void aom_wb_write_bit(struct aom_write_bit_buffer *wb, int bit) {
   31|  12.5M|  const int off = (int)wb->bit_offset;
   32|  12.5M|  const int p = off / CHAR_BIT;
   33|  12.5M|  const int q = CHAR_BIT - 1 - off % CHAR_BIT;
   34|  12.5M|  if (q == CHAR_BIT - 1) {
  ------------------
  |  Branch (34:7): [True: 1.62M, False: 10.9M]
  ------------------
   35|       |    // Zero next char and write bit
   36|  1.62M|    wb->bit_buffer[p] = bit << q;
   37|  10.9M|  } else {
   38|  10.9M|    wb->bit_buffer[p] &= ~(1 << q);
   39|  10.9M|    wb->bit_buffer[p] |= bit << q;
   40|  10.9M|  }
   41|  12.5M|  wb->bit_offset = off + 1;
   42|  12.5M|}
aom_wb_write_literal:
   54|  1.89M|void aom_wb_write_literal(struct aom_write_bit_buffer *wb, int data, int bits) {
   55|  1.89M|  assert(bits <= 31);
   56|  1.89M|  int bit;
   57|  11.6M|  for (bit = bits - 1; bit >= 0; bit--) aom_wb_write_bit(wb, (data >> bit) & 1);
  ------------------
  |  Branch (57:24): [True: 9.71M, False: 1.89M]
  ------------------
   58|  1.89M|}
aom_wb_overwrite_literal:
   68|  37.1k|                              int bits) {
   69|  37.1k|  int bit;
   70|   105k|  for (bit = bits - 1; bit >= 0; bit--) overwrite_bit(wb, (data >> bit) & 1);
  ------------------
  |  Branch (70:24): [True: 68.0k, False: 37.1k]
  ------------------
   71|  37.1k|}
aom_wb_write_inv_signed_literal:
   74|  36.3k|                                     int bits) {
   75|  36.3k|  aom_wb_write_literal(wb, data, bits + 1);
   76|  36.3k|}
bitwriter_buffer.c:overwrite_bit:
   44|  68.0k|static void overwrite_bit(struct aom_write_bit_buffer *wb, int bit) {
   45|       |  // Do not zero bytes but overwrite exisiting values
   46|  68.0k|  const int off = (int)wb->bit_offset;
   47|  68.0k|  const int p = off / CHAR_BIT;
   48|  68.0k|  const int q = CHAR_BIT - 1 - off % CHAR_BIT;
   49|  68.0k|  wb->bit_buffer[p] &= ~(1 << q);
   50|  68.0k|  wb->bit_buffer[p] |= bit << q;
   51|  68.0k|  wb->bit_offset = off + 1;
   52|  68.0k|}

od_ec_dec_init:
  144|  44.9k|                    uint32_t storage) {
  145|  44.9k|  dec->buf = buf;
  146|  44.9k|  dec->tell_offs = 10 - (OD_EC_WINDOW_SIZE - 8);
  ------------------
  |  |   28|  44.9k|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
  147|  44.9k|  dec->end = buf + storage;
  148|  44.9k|  dec->bptr = buf;
  149|       |  dec->dif = ((od_ec_window)1 << (OD_EC_WINDOW_SIZE - 1)) - 1;
  ------------------
  |  |   28|  44.9k|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
  150|  44.9k|  dec->rng = 0x8000;
  151|  44.9k|  dec->cnt = -15;
  152|  44.9k|  od_ec_dec_refill(dec);
  153|  44.9k|}
od_ec_decode_bool_q15:
  158|  71.3M|int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f) {
  159|  71.3M|  od_ec_window dif;
  160|  71.3M|  od_ec_window vw;
  161|  71.3M|  unsigned r;
  162|  71.3M|  unsigned r_new;
  163|  71.3M|  unsigned v;
  164|  71.3M|  int ret;
  165|  71.3M|  assert(0 < f);
  166|  71.3M|  assert(f < 32768U);
  167|  71.3M|  dif = dec->dif;
  168|  71.3M|  r = dec->rng;
  169|  71.3M|  assert(dif >> (OD_EC_WINDOW_SIZE - 16) < r);
  170|  71.3M|  assert(32768U <= r);
  171|  71.3M|  v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
  ------------------
  |  |   20|  71.3M|#define EC_PROB_SHIFT 6
  ------------------
                v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
  ------------------
  |  |   20|  71.3M|#define EC_PROB_SHIFT 6
  ------------------
  172|  71.3M|  v += EC_MIN_PROB;
  ------------------
  |  |   21|  71.3M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  173|  71.3M|  vw = (od_ec_window)v << (OD_EC_WINDOW_SIZE - 16);
  ------------------
  |  |   28|  71.3M|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
  174|  71.3M|  ret = 1;
  175|  71.3M|  r_new = v;
  176|  71.3M|  if (dif >= vw) {
  ------------------
  |  Branch (176:7): [True: 42.6M, False: 28.6M]
  ------------------
  177|  42.6M|    r_new = r - v;
  178|  42.6M|    dif -= vw;
  179|  42.6M|    ret = 0;
  180|  42.6M|  }
  181|  71.3M|  return od_ec_dec_normalize(dec, dif, r_new, ret);
  182|  71.3M|}
od_ec_decode_cdf_q15:
  193|  84.9M|int od_ec_decode_cdf_q15(od_ec_dec *dec, const uint16_t *icdf, int nsyms) {
  194|  84.9M|  od_ec_window dif;
  195|  84.9M|  unsigned r;
  196|  84.9M|  unsigned c;
  197|  84.9M|  unsigned u;
  198|  84.9M|  unsigned v;
  199|  84.9M|  int ret;
  200|  84.9M|  (void)nsyms;
  201|  84.9M|  dif = dec->dif;
  202|  84.9M|  r = dec->rng;
  203|  84.9M|  const int N = nsyms - 1;
  204|       |
  205|  84.9M|  assert(dif >> (OD_EC_WINDOW_SIZE - 16) < r);
  206|  84.9M|  assert(icdf[nsyms - 1] == OD_ICDF(CDF_PROB_TOP));
  207|  84.9M|  assert(32768U <= r);
  208|  84.9M|  assert(7 - EC_PROB_SHIFT >= 0);
  209|  84.9M|  c = (unsigned)(dif >> (OD_EC_WINDOW_SIZE - 16));
  ------------------
  |  |   28|  84.9M|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
  210|  84.9M|  v = r;
  211|  84.9M|  ret = -1;
  212|   246M|  do {
  213|   246M|    u = v;
  214|   246M|    v = ((r >> 8) * (uint32_t)(icdf[++ret] >> EC_PROB_SHIFT) >>
  ------------------
  |  |   20|   246M|#define EC_PROB_SHIFT 6
  ------------------
  215|   246M|         (7 - EC_PROB_SHIFT));
  ------------------
  |  |   20|   246M|#define EC_PROB_SHIFT 6
  ------------------
  216|   246M|    v += EC_MIN_PROB * (N - ret);
  ------------------
  |  |   21|   246M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  217|   246M|  } while (c < v);
  ------------------
  |  Branch (217:12): [True: 161M, False: 84.9M]
  ------------------
  218|  84.9M|  assert(v < u);
  219|  84.9M|  assert(u <= r);
  220|  84.9M|  r = u - v;
  221|       |  dif -= (od_ec_window)v << (OD_EC_WINDOW_SIZE - 16);
  ------------------
  |  |   28|  84.9M|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
  222|  84.9M|  return od_ec_dec_normalize(dec, dif, r, ret);
  223|  84.9M|}
od_ec_dec_tell:
  231|   141k|int od_ec_dec_tell(const od_ec_dec *dec) {
  232|       |  /*There is a window of bits stored in dec->dif. The difference
  233|       |     (dec->bptr - dec->buf) tells us how many bytes have been read into this
  234|       |     window. The difference (dec->cnt - dec->tell_offs) tells us how many of
  235|       |     the bits in that window remain unconsumed.*/
  236|   141k|  return (int)((dec->bptr - dec->buf) * 8 - dec->cnt + dec->tell_offs);
  237|   141k|}
entdec.c:od_ec_dec_refill:
   78|  13.1M|static void od_ec_dec_refill(od_ec_dec *dec) {
   79|  13.1M|  int s;
   80|  13.1M|  od_ec_window dif;
   81|  13.1M|  int16_t cnt;
   82|  13.1M|  const unsigned char *bptr;
   83|  13.1M|  const unsigned char *end;
   84|  13.1M|  dif = dec->dif;
   85|  13.1M|  cnt = dec->cnt;
   86|  13.1M|  bptr = dec->bptr;
   87|  13.1M|  end = dec->end;
   88|  13.1M|  s = OD_EC_WINDOW_SIZE - 9 - (cnt + 15);
  ------------------
  |  |   28|  13.1M|#define OD_EC_WINDOW_SIZE ((int)sizeof(od_ec_window) * CHAR_BIT)
  ------------------
   89|  39.4M|  for (; s >= 0 && bptr < end; s -= 8, bptr++) {
  ------------------
  |  Branch (89:10): [True: 26.3M, False: 13.0M]
  |  Branch (89:20): [True: 26.2M, False: 72.0k]
  ------------------
   90|       |    /*Each time a byte is inserted into the window (dif), bptr advances and cnt
   91|       |       is incremented by 8, so the total number of consumed bits (the return
   92|       |       value of od_ec_dec_tell) does not change.*/
   93|  26.2M|    assert(s <= OD_EC_WINDOW_SIZE - 8);
   94|  26.2M|    dif ^= (od_ec_window)bptr[0] << s;
   95|  26.2M|    cnt += 8;
   96|  26.2M|  }
   97|  13.1M|  if (bptr >= end) {
  ------------------
  |  Branch (97:7): [True: 44.9k, False: 13.1M]
  ------------------
   98|       |    /*We've reached the end of the buffer. It is perfectly valid for us to need
   99|       |       to fill the window with additional bits past the end of the buffer (and
  100|       |       this happens in normal operation). These bits should all just be taken
  101|       |       as zero. But we cannot increment bptr past 'end' (this is undefined
  102|       |       behavior), so we start to increment dec->tell_offs. We also don't want
  103|       |       to keep testing bptr against 'end', so we set cnt to OD_EC_LOTS_OF_BITS
  104|       |       and adjust dec->tell_offs so that the total number of unconsumed bits in
  105|       |       the window (dec->cnt - dec->tell_offs) does not change. This effectively
  106|       |       puts lots of zero bits into the window, and means we won't try to refill
  107|       |       it from the buffer for a very long time (at which point we'll put lots
  108|       |       of zero bits into the window again).*/
  109|  44.9k|    dec->tell_offs += OD_EC_LOTS_OF_BITS - cnt;
  ------------------
  |  |   74|  44.9k|#define OD_EC_LOTS_OF_BITS (0x4000)
  ------------------
  110|  44.9k|    cnt = OD_EC_LOTS_OF_BITS;
  ------------------
  |  |   74|  44.9k|#define OD_EC_LOTS_OF_BITS (0x4000)
  ------------------
  111|  44.9k|  }
  112|  13.1M|  dec->dif = dif;
  113|  13.1M|  dec->cnt = cnt;
  114|  13.1M|  dec->bptr = bptr;
  115|  13.1M|}
entdec.c:od_ec_dec_normalize:
  126|   133M|                               int ret) {
  127|   133M|  int d;
  128|   133M|  assert(rng <= 65535U);
  129|       |  /*The number of leading zeros in the 16-bit binary representation of rng.*/
  130|   133M|  d = 16 - OD_ILOG_NZ(rng);
  ------------------
  |  |   50|   133M|#define OD_ILOG_NZ(x) (1 + get_msb(x))
  ------------------
  131|       |  /*d bits in dec->dif are consumed.*/
  132|   133M|  dec->cnt -= d;
  133|       |  /*This is equivalent to shifting in 1's instead of 0's.*/
  134|   133M|  dec->dif = ((dif + 1) << d) - 1;
  135|   133M|  dec->rng = rng << d;
  136|   133M|  if (dec->cnt < 0) od_ec_dec_refill(dec);
  ------------------
  |  Branch (136:7): [True: 13.1M, False: 120M]
  ------------------
  137|   133M|  return ret;
  138|   133M|}

od_ec_enc_init:
  127|   117k|void od_ec_enc_init(od_ec_enc *enc, uint32_t size) {
  128|   117k|  od_ec_enc_reset(enc);
  129|   117k|  enc->buf = (unsigned char *)malloc(sizeof(*enc->buf) * size);
  130|   117k|  enc->storage = size;
  131|   117k|  if (size > 0 && enc->buf == NULL) {
  ------------------
  |  Branch (131:7): [True: 117k, False: 18.4E]
  |  Branch (131:19): [True: 0, False: 117k]
  ------------------
  132|      0|    enc->storage = 0;
  133|      0|    enc->error = -1;
  134|      0|  }
  135|   117k|}
od_ec_enc_reset:
  138|   117k|void od_ec_enc_reset(od_ec_enc *enc) {
  139|   117k|  enc->offs = 0;
  140|   117k|  enc->low = 0;
  141|   117k|  enc->rng = 0x8000;
  142|       |  /*This is initialized to -9 so that it crosses zero after we've accumulated
  143|       |     one byte + one carry bit.*/
  144|   117k|  enc->cnt = -9;
  145|   117k|  enc->error = 0;
  146|       |#if OD_MEASURE_EC_OVERHEAD
  147|       |  enc->entropy = 0;
  148|       |  enc->nb_symbols = 0;
  149|       |#endif
  150|   117k|}
od_ec_enc_clear:
  153|   117k|void od_ec_enc_clear(od_ec_enc *enc) { free(enc->buf); }
od_ec_encode_bool_q15:
  194|   204M|void od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f) {
  195|   204M|  od_ec_enc_window l;
  196|   204M|  unsigned r;
  197|   204M|  unsigned v;
  198|   204M|  assert(0 < f);
  199|   204M|  assert(f < 32768U);
  200|   204M|  l = enc->low;
  201|   204M|  r = enc->rng;
  202|   204M|  assert(32768U <= r);
  203|   204M|  v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
  ------------------
  |  |   20|   204M|#define EC_PROB_SHIFT 6
  ------------------
                v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
  ------------------
  |  |   20|   204M|#define EC_PROB_SHIFT 6
  ------------------
  204|   204M|  v += EC_MIN_PROB;
  ------------------
  |  |   21|   204M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  205|   204M|  if (val) l += r - v;
  ------------------
  |  Branch (205:7): [True: 88.8M, False: 115M]
  ------------------
  206|   204M|  r = val ? v : r - v;
  ------------------
  |  Branch (206:7): [True: 88.8M, False: 115M]
  ------------------
  207|   204M|  od_ec_enc_normalize(enc, l, r);
  208|       |#if OD_MEASURE_EC_OVERHEAD
  209|       |  enc->entropy -= OD_LOG2((double)(val ? f : (32768 - f)) / 32768.);
  210|       |  enc->nb_symbols++;
  211|       |#endif
  212|   204M|}
od_ec_encode_cdf_q15:
  223|   247M|                          int nsyms) {
  224|   247M|  (void)nsyms;
  225|   247M|  assert(s >= 0);
  226|   247M|  assert(s < nsyms);
  227|   247M|  assert(icdf[nsyms - 1] == OD_ICDF(CDF_PROB_TOP));
  228|   247M|  od_ec_encode_q15(enc, s > 0 ? icdf[s - 1] : OD_ICDF(0), icdf[s], s, nsyms);
  ------------------
  |  |   34|  63.6M|#define OD_ICDF AOM_ICDF
  |  |  ------------------
  |  |  |  |   38|   310M|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  63.6M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   32|  63.6M|#define CDF_PROB_BITS 15
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (228:25): [True: 183M, False: 63.6M]
  ------------------
  229|   247M|}
od_ec_enc_done:
  241|   117k|unsigned char *od_ec_enc_done(od_ec_enc *enc, uint32_t *nbytes) {
  242|   117k|  unsigned char *out;
  243|   117k|  uint32_t storage;
  244|   117k|  uint32_t offs;
  245|   117k|  od_ec_enc_window m;
  246|   117k|  od_ec_enc_window e;
  247|   117k|  od_ec_enc_window l;
  248|   117k|  int c;
  249|   117k|  int s;
  250|   117k|  if (enc->error) return NULL;
  ------------------
  |  Branch (250:7): [True: 0, False: 117k]
  ------------------
  251|       |#if OD_MEASURE_EC_OVERHEAD
  252|       |  {
  253|       |    uint32_t tell;
  254|       |    /* Don't count the 1 bit we lose to raw bits as overhead. */
  255|       |    tell = od_ec_enc_tell(enc) - 1;
  256|       |    fprintf(stderr, "overhead: %f%%\n",
  257|       |            100 * (tell - enc->entropy) / enc->entropy);
  258|       |    fprintf(stderr, "efficiency: %f bits/symbol\n",
  259|       |            (double)tell / enc->nb_symbols);
  260|       |  }
  261|       |#endif
  262|       |
  263|   117k|  l = enc->low;
  264|   117k|  c = enc->cnt;
  265|   117k|  s = 10;
  266|   117k|  m = 0x3FFF;
  267|   117k|  e = ((l + m) & ~m) | (m + 1);
  268|   117k|  s += c;
  269|   117k|  offs = enc->offs;
  270|       |
  271|       |  /*Make sure there's enough room for the entropy-coded bits.*/
  272|   117k|  out = enc->buf;
  273|   117k|  storage = enc->storage;
  274|   117k|  const int s_bits = (s + 7) >> 3;
  275|   117k|  int b = OD_MAXI(s_bits, 0);
  ------------------
  |  |   45|   117k|#define OD_MAXI AOMMAX
  |  |  ------------------
  |  |  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:23): [True: 117k, False: 18.4E]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|   117k|  if (offs + b > storage) {
  ------------------
  |  Branch (276:7): [True: 0, False: 117k]
  ------------------
  277|      0|    storage = offs + b;
  278|      0|    out = (unsigned char *)realloc(out, sizeof(*out) * storage);
  279|      0|    if (out == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 0]
  ------------------
  280|      0|      enc->error = -1;
  281|      0|      return NULL;
  282|      0|    }
  283|      0|    enc->buf = out;
  284|      0|    enc->storage = storage;
  285|      0|  }
  286|       |
  287|       |  /*We output the minimum number of bits that ensures that the symbols encoded
  288|       |     thus far will be decoded correctly regardless of the bits that follow.*/
  289|   117k|  if (s > 0) {
  ------------------
  |  Branch (289:7): [True: 117k, False: 18.4E]
  ------------------
  290|   117k|    uint64_t n;
  291|   117k|    n = ((uint64_t)1 << (c + 16)) - 1;
  292|   423k|    do {
  293|   423k|      assert(offs < storage);
  294|   423k|      uint16_t val = (uint16_t)(e >> (c + 16));
  295|   423k|      out[offs] = (unsigned char)(val & 0x00FF);
  296|   423k|      if (val & 0x0100) {
  ------------------
  |  Branch (296:11): [True: 33.1k, False: 390k]
  ------------------
  297|  33.1k|        assert(offs > 0);
  298|  33.1k|        propagate_carry_bwd(out, offs - 1);
  299|  33.1k|      }
  300|   423k|      offs++;
  301|       |
  302|   423k|      e &= n;
  303|   423k|      s -= 8;
  304|   423k|      c -= 8;
  305|   423k|      n >>= 8;
  306|   423k|    } while (s > 0);
  ------------------
  |  Branch (306:14): [True: 305k, False: 117k]
  ------------------
  307|   117k|  }
  308|   117k|  *nbytes = offs;
  309|       |
  310|   117k|  return out;
  311|   117k|}
od_ec_enc_tell:
  322|  4.06M|int od_ec_enc_tell(const od_ec_enc *enc) {
  323|       |  /*The 10 here counteracts the offset of -9 baked into cnt, and adds 1 extra
  324|       |     bit, which we reserve for terminating the stream.*/
  325|  4.06M|  return (enc->cnt + 10) + enc->offs * 8;
  326|  4.06M|}
entenc.c:od_ec_enc_normalize:
   57|   398M|                                unsigned rng) {
   58|   398M|  int d;
   59|   398M|  int c;
   60|   398M|  int s;
   61|   398M|  if (enc->error) return;
  ------------------
  |  Branch (61:7): [True: 0, False: 398M]
  ------------------
   62|   398M|  c = enc->cnt;
   63|   398M|  assert(rng <= 65535U);
   64|       |  /*The number of leading zeros in the 16-bit binary representation of rng.*/
   65|   398M|  d = 16 - OD_ILOG_NZ(rng);
  ------------------
  |  |   50|   398M|#define OD_ILOG_NZ(x) (1 + get_msb(x))
  ------------------
   66|   398M|  s = c + d;
   67|       |
   68|       |  /* We flush every time "low" cannot safely and efficiently accommodate any
   69|       |     more data. Overall, c must not exceed 63 at the time of byte flush out. To
   70|       |     facilitate this, "s" cannot exceed 56-bits because we have to keep 1 byte
   71|       |     for carry. Also, we need to subtract 16 because we want to keep room for
   72|       |     the next symbol worth "d"-bits (max 15). An alternate condition would be if
   73|       |     (e < d), where e = number of leading zeros in "low", indicating there is
   74|       |     not enough rooom to accommodate "rng" worth of "d"-bits in "low". However,
   75|       |     this approach needs additional computations: (i) compute "e", (ii) push
   76|       |     the leading 0x00's as a special case.
   77|       |  */
   78|   398M|  if (s >= 40) {  // 56 - 16
  ------------------
  |  Branch (78:7): [True: 12.5M, False: 385M]
  ------------------
   79|  12.5M|    unsigned char *out = enc->buf;
   80|  12.5M|    uint32_t storage = enc->storage;
   81|  12.5M|    uint32_t offs = enc->offs;
   82|  12.5M|    if (offs + 8 > storage) {
  ------------------
  |  Branch (82:9): [True: 5, False: 12.5M]
  ------------------
   83|      5|      storage = 2 * storage + 8;
   84|      5|      out = (unsigned char *)realloc(out, sizeof(*out) * storage);
   85|      5|      if (out == NULL) {
  ------------------
  |  Branch (85:11): [True: 0, False: 5]
  ------------------
   86|      0|        enc->error = -1;
   87|      0|        return;
   88|      0|      }
   89|      5|      enc->buf = out;
   90|      5|      enc->storage = storage;
   91|      5|    }
   92|       |    // Need to add 1 byte here since enc->cnt always counts 1 byte less
   93|       |    // (enc->cnt = -9) to ensure correct operation
   94|  12.5M|    uint8_t num_bytes_ready = (s >> 3) + 1;
   95|       |
   96|       |    // Update "c" to contain the number of non-ready bits in "low". Since "low"
   97|       |    // has 64-bit capacity, we need to add the (64 - 40) cushion bits and take
   98|       |    // off the number of ready bits.
   99|  12.5M|    c += 24 - (num_bytes_ready << 3);
  100|       |
  101|       |    // Prepare "output" and update "low"
  102|  12.5M|    uint64_t output = low >> c;
  103|  12.5M|    low = low & (((uint64_t)1 << c) - 1);
  104|       |
  105|       |    // Prepare data and carry mask
  106|  12.5M|    uint64_t mask = (uint64_t)1 << (num_bytes_ready << 3);
  107|  12.5M|    uint64_t carry = output & mask;
  108|       |
  109|  12.5M|    mask = mask - 0x01;
  110|  12.5M|    output = output & mask;
  111|       |
  112|       |    // Write data in a single operation
  113|  12.5M|    write_enc_data_to_out_buf(out, offs, output, carry, &enc->offs,
  114|  12.5M|                              num_bytes_ready);
  115|       |
  116|       |    // Update state of the encoder: enc->cnt to contain the number of residual
  117|       |    // bits
  118|  12.5M|    s = c + d - 24;
  119|  12.5M|  }
  120|   398M|  enc->low = low << d;
  121|   398M|  enc->rng = rng << d;
  122|   398M|  enc->cnt = s;
  123|   398M|}
entenc.c:od_ec_encode_q15:
  161|   247M|                             int nsyms) {
  162|   247M|  od_ec_enc_window l;
  163|   247M|  unsigned r;
  164|   247M|  unsigned u;
  165|   247M|  unsigned v;
  166|   247M|  l = enc->low;
  167|   247M|  r = enc->rng;
  168|   247M|  assert(32768U <= r);
  169|   247M|  assert(fh <= fl);
  170|   247M|  assert(fl <= 32768U);
  171|   247M|  assert(7 - EC_PROB_SHIFT >= 0);
  172|   247M|  const int N = nsyms - 1;
  173|   247M|  if (fl < CDF_PROB_TOP) {
  ------------------
  |  |   33|   247M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   247M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  |  Branch (173:7): [True: 184M, False: 63.5M]
  ------------------
  174|   184M|    u = ((r >> 8) * (uint32_t)(fl >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|   184M|#define EC_PROB_SHIFT 6
  ------------------
                  u = ((r >> 8) * (uint32_t)(fl >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|   184M|#define EC_PROB_SHIFT 6
  ------------------
  175|   184M|        EC_MIN_PROB * (N - (s - 1));
  ------------------
  |  |   21|   184M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  176|   184M|    v = ((r >> 8) * (uint32_t)(fh >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|   184M|#define EC_PROB_SHIFT 6
  ------------------
                  v = ((r >> 8) * (uint32_t)(fh >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|   184M|#define EC_PROB_SHIFT 6
  ------------------
  177|   184M|        EC_MIN_PROB * (N - (s + 0));
  ------------------
  |  |   21|   184M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  178|   184M|    l += r - u;
  179|   184M|    r = u - v;
  180|   184M|  } else {
  181|  63.5M|    r -= ((r >> 8) * (uint32_t)(fh >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|  63.5M|#define EC_PROB_SHIFT 6
  ------------------
                  r -= ((r >> 8) * (uint32_t)(fh >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT)) +
  ------------------
  |  |   20|  63.5M|#define EC_PROB_SHIFT 6
  ------------------
  182|  63.5M|         EC_MIN_PROB * (N - (s + 0));
  ------------------
  |  |   21|  63.5M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  183|  63.5M|  }
  184|   247M|  od_ec_enc_normalize(enc, l, r);
  185|       |#if OD_MEASURE_EC_OVERHEAD
  186|       |  enc->entropy -= OD_LOG2((double)(OD_ICDF(fh) - OD_ICDF(fl)) / CDF_PROB_TOP.);
  187|       |  enc->nb_symbols++;
  188|       |#endif
  189|   247M|}

entenc.c:write_enc_data_to_out_buf:
   90|  12.5M|                                             uint8_t num_bytes_ready) {
   91|  12.5M|  const uint64_t reg = HToBE64(output << ((8 - num_bytes_ready) << 3));
  ------------------
  |  |   51|  12.5M|#define HToBE64(X) BSwap64(X)
  ------------------
   92|  12.5M|  memcpy(&out[offs], &reg, 8);
   93|       |  // Propagate carry backwards if exists
   94|  12.5M|  if (carry) {
  ------------------
  |  Branch (94:7): [True: 3.69M, False: 8.85M]
  ------------------
   95|       |    assert(offs > 0);
   96|  3.69M|    propagate_carry_bwd(out, offs - 1);
   97|  3.69M|  }
   98|  12.5M|  *enc_offs = offs + num_bytes_ready;
   99|  12.5M|}
entenc.c:propagate_carry_bwd:
   76|  3.72M|static inline void propagate_carry_bwd(unsigned char *buf, uint32_t offs) {
   77|  3.72M|  uint16_t sum, carry = 1;
   78|  3.73M|  do {
   79|  3.73M|    sum = (uint16_t)buf[offs] + 1;
   80|  3.73M|    buf[offs--] = (unsigned char)sum;
   81|  3.73M|    carry = sum >> 8;
   82|  3.73M|  } while (carry);
  ------------------
  |  Branch (82:12): [True: 14.6k, False: 3.72M]
  ------------------
   83|  3.72M|}

av1_get_corner_list_size:
   28|   184k|size_t av1_get_corner_list_size(void) { return sizeof(CornerList); }
av1_alloc_corner_list:
   30|   184k|CornerList *av1_alloc_corner_list(void) {
   31|   184k|  CornerList *corners = (CornerList *)aom_calloc(1, sizeof(*corners));
   32|   184k|  if (!corners) {
  ------------------
  |  Branch (32:7): [True: 0, False: 184k]
  ------------------
   33|      0|    return NULL;
   34|      0|  }
   35|       |
   36|   184k|  corners->valid = false;
   37|   184k|#if CONFIG_MULTITHREAD
   38|       |  pthread_mutex_init(&corners->mutex, NULL);
   39|   184k|#endif  // CONFIG_MULTITHREAD
   40|   184k|  return corners;
   41|   184k|}
av1_compute_corner_list:
  121|  6.58k|                             int downsample_level, CornerList *corners) {
  122|  6.58k|  assert(corners);
  123|       |
  124|  6.58k|#if CONFIG_MULTITHREAD
  125|  6.58k|  pthread_mutex_lock(&corners->mutex);
  126|  6.58k|#endif  // CONFIG_MULTITHREAD
  127|       |
  128|  6.58k|  if (!corners->valid) {
  ------------------
  |  Branch (128:7): [True: 3.70k, False: 2.88k]
  ------------------
  129|  3.70k|    corners->valid =
  130|  3.70k|        compute_corner_list(frame, bit_depth, downsample_level, corners);
  131|  3.70k|  }
  132|  6.58k|  bool valid = corners->valid;
  133|       |
  134|  6.58k|#if CONFIG_MULTITHREAD
  135|  6.58k|  pthread_mutex_unlock(&corners->mutex);
  136|  6.58k|#endif  // CONFIG_MULTITHREAD
  137|  6.58k|  return valid;
  138|  6.58k|}
av1_invalidate_corner_list:
  168|   157k|void av1_invalidate_corner_list(CornerList *corners) {
  169|   157k|  if (corners) {
  ------------------
  |  Branch (169:7): [True: 61.5k, False: 95.4k]
  ------------------
  170|  61.5k|#if CONFIG_MULTITHREAD
  171|  61.5k|    pthread_mutex_lock(&corners->mutex);
  172|  61.5k|#endif  // CONFIG_MULTITHREAD
  173|       |    corners->valid = false;
  174|  61.5k|#if CONFIG_MULTITHREAD
  175|  61.5k|    pthread_mutex_unlock(&corners->mutex);
  176|  61.5k|#endif  // CONFIG_MULTITHREAD
  177|  61.5k|  }
  178|   157k|}
av1_free_corner_list:
  180|   184k|void av1_free_corner_list(CornerList *corners) {
  181|   184k|  if (corners) {
  ------------------
  |  Branch (181:7): [True: 184k, False: 0]
  ------------------
  182|   184k|#if CONFIG_MULTITHREAD
  183|   184k|    pthread_mutex_destroy(&corners->mutex);
  184|   184k|#endif  // CONFIG_MULTITHREAD
  185|   184k|    aom_free(corners);
  186|   184k|  }
  187|   184k|}
corner_detect.c:compute_corner_list:
   44|  3.70k|                                int downsample_level, CornerList *corners) {
   45|  3.70k|  ImagePyramid *pyr = frame->y_pyramid;
   46|  3.70k|  const int layers =
   47|  3.70k|      aom_compute_pyramid(frame, bit_depth, downsample_level + 1, pyr);
   48|       |
   49|  3.70k|  if (layers < 0) {
  ------------------
  |  Branch (49:7): [True: 0, False: 3.70k]
  ------------------
   50|      0|    return false;
   51|      0|  }
   52|       |
   53|       |  // Clamp downsampling ratio base on max number of layers allowed
   54|       |  // for this frame size
   55|  3.70k|  downsample_level = layers - 1;
   56|       |
   57|  3.70k|  const uint8_t *buf = pyr->layers[downsample_level].buffer;
   58|  3.70k|  int width = pyr->layers[downsample_level].width;
   59|  3.70k|  int height = pyr->layers[downsample_level].height;
   60|  3.70k|  int stride = pyr->layers[downsample_level].stride;
   61|       |
   62|  3.70k|  int *scores = NULL;
   63|  3.70k|  int num_corners;
   64|  3.70k|  xy *const frame_corners_xy = aom_fast9_detect_nonmax(
   65|  3.70k|      buf, width, height, stride, FAST_BARRIER, &scores, &num_corners);
  ------------------
  |  |   26|  3.70k|#define FAST_BARRIER 18
  ------------------
   66|  3.70k|  if (num_corners < 0) return false;
  ------------------
  |  Branch (66:7): [True: 0, False: 3.70k]
  ------------------
   67|       |
   68|  3.70k|  if (num_corners <= MAX_CORNERS) {
  ------------------
  |  |   27|  3.70k|#define MAX_CORNERS 4096
  ------------------
  |  Branch (68:7): [True: 3.70k, False: 0]
  ------------------
   69|       |    // Use all detected corners
   70|  60.1k|    for (int i = 0; i < num_corners; i++) {
  ------------------
  |  Branch (70:21): [True: 56.4k, False: 3.70k]
  ------------------
   71|  56.4k|      corners->corners[2 * i + 0] =
   72|  56.4k|          frame_corners_xy[i].x * (1 << downsample_level);
   73|  56.4k|      corners->corners[2 * i + 1] =
   74|  56.4k|          frame_corners_xy[i].y * (1 << downsample_level);
   75|  56.4k|    }
   76|  3.70k|    corners->num_corners = num_corners;
   77|  3.70k|  } else {
   78|       |    // There are more than MAX_CORNERS corners avilable, so pick out a subset
   79|       |    // of the sharpest corners, as these will be the most useful for flow
   80|       |    // estimation
   81|      0|    int histogram[256];
   82|      0|    av1_zero(histogram);
  ------------------
  |  |   43|      0|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   83|      0|    for (int i = 0; i < num_corners; i++) {
  ------------------
  |  Branch (83:21): [True: 0, False: 0]
  ------------------
   84|      0|      assert(FAST_BARRIER <= scores[i] && scores[i] <= 255);
   85|      0|      histogram[scores[i]] += 1;
   86|      0|    }
   87|       |
   88|      0|    int threshold = -1;
   89|      0|    int found_corners = 0;
   90|      0|    for (int bucket = 255; bucket >= 0; bucket--) {
  ------------------
  |  Branch (90:28): [True: 0, False: 0]
  ------------------
   91|      0|      if (found_corners + histogram[bucket] > MAX_CORNERS) {
  ------------------
  |  |   27|      0|#define MAX_CORNERS 4096
  ------------------
  |  Branch (91:11): [True: 0, False: 0]
  ------------------
   92|       |        // Set threshold here
   93|      0|        threshold = bucket;
   94|      0|        break;
   95|      0|      }
   96|      0|      found_corners += histogram[bucket];
   97|      0|    }
   98|      0|    assert(threshold != -1 && "Failed to select a valid threshold");
   99|       |
  100|      0|    int copied_corners = 0;
  101|      0|    for (int i = 0; i < num_corners; i++) {
  ------------------
  |  Branch (101:21): [True: 0, False: 0]
  ------------------
  102|      0|      if (scores[i] > threshold) {
  ------------------
  |  Branch (102:11): [True: 0, False: 0]
  ------------------
  103|      0|        assert(copied_corners < MAX_CORNERS);
  104|      0|        corners->corners[2 * copied_corners + 0] =
  105|      0|            frame_corners_xy[i].x * (1 << downsample_level);
  106|      0|        corners->corners[2 * copied_corners + 1] =
  107|      0|            frame_corners_xy[i].y * (1 << downsample_level);
  108|      0|        copied_corners += 1;
  109|      0|      }
  110|      0|    }
  111|      0|    assert(copied_corners == found_corners);
  112|      0|    corners->num_corners = copied_corners;
  113|      0|  }
  114|       |
  115|  3.70k|  free(scores);
  116|  3.70k|  free(frame_corners_xy);
  117|       |  return true;
  118|  3.70k|}

av1_compute_global_motion_disflow:
  768|  6.58k|    int num_motion_models, bool *mem_alloc_failed) {
  769|       |  // Precompute information we will need about each frame
  770|  6.58k|  ImagePyramid *src_pyramid = src->y_pyramid;
  771|  6.58k|  CornerList *src_corners = src->corners;
  772|  6.58k|  ImagePyramid *ref_pyramid = ref->y_pyramid;
  773|       |
  774|  6.58k|  const int src_layers =
  775|  6.58k|      aom_compute_pyramid(src, bit_depth, DISFLOW_PYRAMID_LEVELS, src_pyramid);
  ------------------
  |  |   25|  6.58k|#define DISFLOW_PYRAMID_LEVELS 12
  ------------------
  776|  6.58k|  const int ref_layers =
  777|  6.58k|      aom_compute_pyramid(ref, bit_depth, DISFLOW_PYRAMID_LEVELS, ref_pyramid);
  ------------------
  |  |   25|  6.58k|#define DISFLOW_PYRAMID_LEVELS 12
  ------------------
  778|       |
  779|  6.58k|  if (src_layers < 0 || ref_layers < 0) {
  ------------------
  |  Branch (779:7): [True: 18.4E, False: 6.58k]
  |  Branch (779:25): [True: 0, False: 6.58k]
  ------------------
  780|      0|    *mem_alloc_failed = true;
  781|      0|    return false;
  782|      0|  }
  783|  6.58k|  if (!av1_compute_corner_list(src, bit_depth, downsample_level, src_corners)) {
  ------------------
  |  Branch (783:7): [True: 0, False: 6.58k]
  ------------------
  784|      0|    *mem_alloc_failed = true;
  785|      0|    return false;
  786|      0|  }
  787|       |
  788|  6.58k|  assert(src_layers == ref_layers);
  789|       |
  790|  6.58k|  const int src_width = src_pyramid->layers[0].width;
  791|  6.58k|  const int src_height = src_pyramid->layers[0].height;
  792|  6.58k|  assert(ref_pyramid->layers[0].width == src_width);
  793|  6.58k|  assert(ref_pyramid->layers[0].height == src_height);
  794|       |
  795|  6.58k|  FlowField *flow = alloc_flow_field(src_width, src_height);
  796|  6.58k|  if (!flow) {
  ------------------
  |  Branch (796:7): [True: 0, False: 6.58k]
  ------------------
  797|      0|    *mem_alloc_failed = true;
  798|      0|    return false;
  799|      0|  }
  800|       |
  801|  6.58k|  if (!compute_flow_field(src_pyramid, ref_pyramid, src_layers, flow)) {
  ------------------
  |  Branch (801:7): [True: 0, False: 6.58k]
  ------------------
  802|      0|    *mem_alloc_failed = true;
  803|      0|    free_flow_field(flow);
  804|      0|    return false;
  805|      0|  }
  806|       |
  807|       |  // find correspondences between the two images using the flow field
  808|  6.58k|  Correspondence *correspondences =
  809|  6.58k|      aom_malloc(src_corners->num_corners * sizeof(*correspondences));
  810|  6.58k|  if (!correspondences) {
  ------------------
  |  Branch (810:7): [True: 0, False: 6.58k]
  ------------------
  811|      0|    *mem_alloc_failed = true;
  812|      0|    free_flow_field(flow);
  813|      0|    return false;
  814|      0|  }
  815|       |
  816|  6.58k|  const int num_correspondences = determine_disflow_correspondence(
  817|  6.58k|      src_pyramid, ref_pyramid, src_corners, flow, correspondences);
  818|       |
  819|  6.58k|  bool result = ransac(correspondences, num_correspondences, type,
  820|  6.58k|                       motion_models, num_motion_models, mem_alloc_failed);
  821|       |
  822|  6.58k|  aom_free(correspondences);
  823|  6.58k|  free_flow_field(flow);
  824|  6.58k|  return result;
  825|  6.58k|}
disflow.c:get_cubic_kernel_dbl:
   66|  14.8k|static inline void get_cubic_kernel_dbl(double x, double kernel[4]) {
   67|       |  // Check that the fractional position is in range.
   68|       |  //
   69|       |  // Note: x is calculated from, e.g., `u_frac = u - floor(u)`.
   70|       |  // Mathematically, this implies that 0 <= x < 1. However, in practice it is
   71|       |  // possible to have x == 1 due to floating point rounding. This is fine,
   72|       |  // and we still interpolate correctly if we allow x = 1.
   73|  14.8k|  assert(0 <= x && x <= 1);
   74|       |
   75|  14.8k|  double x2 = x * x;
   76|  14.8k|  double x3 = x2 * x;
   77|  14.8k|  kernel[0] = -0.5 * x + x2 - 0.5 * x3;
   78|  14.8k|  kernel[1] = 1.0 - 2.5 * x2 + 1.5 * x3;
   79|  14.8k|  kernel[2] = 0.5 * x + 2.0 * x2 - 1.5 * x3;
   80|  14.8k|  kernel[3] = -0.5 * x2 + 0.5 * x3;
   81|  14.8k|}
disflow.c:alloc_flow_field:
  730|  6.58k|static FlowField *alloc_flow_field(int frame_width, int frame_height) {
  731|  6.58k|  FlowField *flow = (FlowField *)aom_malloc(sizeof(FlowField));
  732|  6.58k|  if (flow == NULL) return NULL;
  ------------------
  |  Branch (732:7): [True: 0, False: 6.58k]
  ------------------
  733|       |
  734|       |  // Calculate the size of the bottom (largest) layer of the flow pyramid
  735|  6.58k|  flow->width = frame_width >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|  6.58k|#define DOWNSAMPLE_SHIFT 3
  ------------------
  736|  6.58k|  flow->height = frame_height >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|  6.58k|#define DOWNSAMPLE_SHIFT 3
  ------------------
  737|  6.58k|  flow->stride = flow->width + 2 * FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  6.58k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  6.58k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  738|       |
  739|  6.58k|  const size_t flow_size =
  740|  6.58k|      flow->stride * (size_t)(flow->height + 2 * FLOW_BORDER_OUTER);
  ------------------
  |  |   48|  6.58k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  6.58k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  741|       |
  742|  6.58k|  flow->buf0 = aom_calloc(2 * flow_size, sizeof(*flow->buf0));
  743|  6.58k|  if (!flow->buf0) {
  ------------------
  |  Branch (743:7): [True: 0, False: 6.58k]
  ------------------
  744|      0|    aom_free(flow);
  745|      0|    return NULL;
  746|      0|  }
  747|       |
  748|  6.58k|  flow->u = flow->buf0 + FLOW_BORDER_OUTER * flow->stride + FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  6.58k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  6.58k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
                flow->u = flow->buf0 + FLOW_BORDER_OUTER * flow->stride + FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  6.58k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  6.58k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  749|  6.58k|  flow->v = flow->u + flow_size;
  750|       |
  751|  6.58k|  return flow;
  752|  6.58k|}
disflow.c:compute_flow_field:
  607|  6.58k|                               FlowField *flow) {
  608|  6.58k|  bool mem_status = true;
  609|       |
  610|  6.58k|  double *flow_u = flow->u;
  611|  6.58k|  double *flow_v = flow->v;
  612|       |
  613|  6.58k|  double *tmpbuf0;
  614|  6.58k|  double *tmpbuf;
  615|       |
  616|  6.58k|  if (n_levels < 2) {
  ------------------
  |  Branch (616:7): [True: 6.03k, False: 553]
  ------------------
  617|       |    // tmpbuf not needed
  618|  6.03k|    tmpbuf0 = NULL;
  619|  6.03k|    tmpbuf = NULL;
  620|  6.03k|  } else {
  621|       |    // This line must match the calculation of cur_flow_height below
  622|    553|    const int layer1_height = src_pyr->layers[1].height >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|    553|#define DOWNSAMPLE_SHIFT 3
  ------------------
  623|       |
  624|    553|    const size_t tmpbuf_size =
  625|    553|        (layer1_height + 2 * FLOW_BORDER_OUTER) * flow->stride;
  ------------------
  |  |   48|    553|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|    553|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  626|    553|    tmpbuf0 = aom_malloc(tmpbuf_size * sizeof(*tmpbuf0));
  627|    553|    if (!tmpbuf0) {
  ------------------
  |  Branch (627:9): [True: 0, False: 553]
  ------------------
  628|      0|      mem_status = false;
  629|      0|      goto free_tmpbuf;
  630|      0|    }
  631|    553|    tmpbuf = tmpbuf0 + FLOW_BORDER_OUTER * flow->stride;
  ------------------
  |  |   48|    553|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|    553|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  632|    553|  }
  633|       |
  634|       |  // Compute flow field from coarsest to finest level of the pyramid
  635|       |  //
  636|       |  // Note: We stop after refining pyramid level 1 and interpolating it to
  637|       |  // generate an initial flow field at level 0. We do *not* refine the dense
  638|       |  // flow field at level 0. Instead, we wait until we have generated
  639|       |  // correspondences by interpolating this flow field, and then refine the
  640|       |  // correspondences themselves. This is both faster and gives better output
  641|       |  // compared to refining the flow field at level 0 and then interpolating.
  642|  7.39k|  for (int level = n_levels - 1; level >= 1; --level) {
  ------------------
  |  Branch (642:34): [True: 805, False: 6.58k]
  ------------------
  643|    805|    const PyramidLayer *cur_layer = &src_pyr->layers[level];
  644|    805|    const int cur_width = cur_layer->width;
  645|    805|    const int cur_height = cur_layer->height;
  646|    805|    const int cur_stride = cur_layer->stride;
  647|       |
  648|    805|    const uint8_t *src_buffer = cur_layer->buffer;
  649|    805|    const uint8_t *ref_buffer = ref_pyr->layers[level].buffer;
  650|       |
  651|    805|    const int cur_flow_width = cur_width >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|    805|#define DOWNSAMPLE_SHIFT 3
  ------------------
  652|    805|    const int cur_flow_height = cur_height >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|    805|#define DOWNSAMPLE_SHIFT 3
  ------------------
  653|    805|    const int cur_flow_stride = flow->stride;
  654|       |
  655|  5.02k|    for (int i = FLOW_BORDER_INNER; i < cur_flow_height - FLOW_BORDER_INNER;
  ------------------
  |  |   43|    805|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|    805|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|    805|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|    805|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
                  for (int i = FLOW_BORDER_INNER; i < cur_flow_height - FLOW_BORDER_INNER;
  ------------------
  |  |   43|  5.02k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  5.02k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  5.02k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  5.02k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  |  Branch (655:37): [True: 4.21k, False: 805]
  ------------------
  656|  4.21k|         i += 1) {
  657|  22.2k|      for (int j = FLOW_BORDER_INNER; j < cur_flow_width - FLOW_BORDER_INNER;
  ------------------
  |  |   43|  4.21k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  4.21k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  4.21k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  4.21k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
                    for (int j = FLOW_BORDER_INNER; j < cur_flow_width - FLOW_BORDER_INNER;
  ------------------
  |  |   43|  22.2k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  22.2k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  22.2k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  |  Branch (657:39): [True: 18.0k, False: 4.21k]
  ------------------
  658|  18.0k|           j += 1) {
  659|  18.0k|        const int flow_field_idx = i * cur_flow_stride + j;
  660|       |
  661|       |        // Calculate the position of a patch of size DISFLOW_PATCH_SIZE pixels,
  662|       |        // which is centered on the region covered by this flow field entry
  663|  18.0k|        const int patch_center_x =
  664|  18.0k|            (j << DOWNSAMPLE_SHIFT) + UPSAMPLE_CENTER_OFFSET;  // In pixels
  ------------------
  |  |   31|  18.0k|#define DOWNSAMPLE_SHIFT 3
  ------------------
                          (j << DOWNSAMPLE_SHIFT) + UPSAMPLE_CENTER_OFFSET;  // In pixels
  ------------------
  |  |   58|  18.0k|#define UPSAMPLE_CENTER_OFFSET ((DOWNSAMPLE_FACTOR - 1) / 2)
  |  |  ------------------
  |  |  |  |   32|  18.0k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  18.0k|#define DOWNSAMPLE_SHIFT 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  665|  18.0k|        const int patch_center_y =
  666|  18.0k|            (i << DOWNSAMPLE_SHIFT) + UPSAMPLE_CENTER_OFFSET;  // In pixels
  ------------------
  |  |   31|  18.0k|#define DOWNSAMPLE_SHIFT 3
  ------------------
                          (i << DOWNSAMPLE_SHIFT) + UPSAMPLE_CENTER_OFFSET;  // In pixels
  ------------------
  |  |   58|  18.0k|#define UPSAMPLE_CENTER_OFFSET ((DOWNSAMPLE_FACTOR - 1) / 2)
  |  |  ------------------
  |  |  |  |   32|  18.0k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  18.0k|#define DOWNSAMPLE_SHIFT 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|  18.0k|        const int patch_tl_x = patch_center_x - DISFLOW_PATCH_CENTER;
  ------------------
  |  |   32|  18.0k|#define DISFLOW_PATCH_CENTER ((DISFLOW_PATCH_SIZE / 2) - 1)
  |  |  ------------------
  |  |  |  |   30|  18.0k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  18.0k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  668|  18.0k|        const int patch_tl_y = patch_center_y - DISFLOW_PATCH_CENTER;
  ------------------
  |  |   32|  18.0k|#define DISFLOW_PATCH_CENTER ((DISFLOW_PATCH_SIZE / 2) - 1)
  |  |  ------------------
  |  |  |  |   30|  18.0k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  18.0k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  669|  18.0k|        assert(patch_tl_x >= 0);
  670|  18.0k|        assert(patch_tl_y >= 0);
  671|       |
  672|  18.0k|        aom_compute_flow_at_point(src_buffer, ref_buffer, patch_tl_x,
  673|  18.0k|                                  patch_tl_y, cur_width, cur_height, cur_stride,
  674|  18.0k|                                  &flow_u[flow_field_idx],
  675|  18.0k|                                  &flow_v[flow_field_idx]);
  676|  18.0k|      }
  677|  4.21k|    }
  678|       |
  679|       |    // Fill in the areas which we haven't explicitly computed, with copies
  680|       |    // of the outermost values which we did compute
  681|    805|    fill_flow_field_borders(flow_u, cur_flow_width, cur_flow_height,
  682|    805|                            cur_flow_stride);
  683|    805|    fill_flow_field_borders(flow_v, cur_flow_width, cur_flow_height,
  684|    805|                            cur_flow_stride);
  685|       |
  686|    805|    if (level > 0) {
  ------------------
  |  Branch (686:9): [True: 804, False: 1]
  ------------------
  687|    804|      const int upscale_flow_width = cur_flow_width << 1;
  688|    804|      const int upscale_flow_height = cur_flow_height << 1;
  689|    804|      const int upscale_stride = flow->stride;
  690|       |
  691|    804|      upscale_flow_component(flow_u, cur_flow_width, cur_flow_height,
  692|    804|                             cur_flow_stride, tmpbuf);
  693|    804|      upscale_flow_component(flow_v, cur_flow_width, cur_flow_height,
  694|    804|                             cur_flow_stride, tmpbuf);
  695|       |
  696|       |      // If we didn't fill in the rightmost column or bottommost row during
  697|       |      // upsampling (in order to keep the ratio to exactly 2), fill them
  698|       |      // in here by copying the next closest column/row
  699|    804|      const PyramidLayer *next_layer = &src_pyr->layers[level - 1];
  700|    804|      const int next_flow_width = next_layer->width >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|    804|#define DOWNSAMPLE_SHIFT 3
  ------------------
  701|    804|      const int next_flow_height = next_layer->height >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|    804|#define DOWNSAMPLE_SHIFT 3
  ------------------
  702|       |
  703|       |      // Rightmost column
  704|    804|      if (next_flow_width > upscale_flow_width) {
  ------------------
  |  Branch (704:11): [True: 287, False: 517]
  ------------------
  705|    287|        assert(next_flow_width == upscale_flow_width + 1);
  706|  3.11k|        for (int i = 0; i < upscale_flow_height; i++) {
  ------------------
  |  Branch (706:25): [True: 2.82k, False: 287]
  ------------------
  707|  2.82k|          const int index = i * upscale_stride + upscale_flow_width;
  708|  2.82k|          flow_u[index] = flow_u[index - 1];
  709|  2.82k|          flow_v[index] = flow_v[index - 1];
  710|  2.82k|        }
  711|    287|      }
  712|       |
  713|       |      // Bottommost row
  714|    804|      if (next_flow_height > upscale_flow_height) {
  ------------------
  |  Branch (714:11): [True: 308, False: 496]
  ------------------
  715|    308|        assert(next_flow_height == upscale_flow_height + 1);
  716|  3.04k|        for (int j = 0; j < next_flow_width; j++) {
  ------------------
  |  Branch (716:25): [True: 2.73k, False: 308]
  ------------------
  717|  2.73k|          const int index = upscale_flow_height * upscale_stride + j;
  718|  2.73k|          flow_u[index] = flow_u[index - upscale_stride];
  719|  2.73k|          flow_v[index] = flow_v[index - upscale_stride];
  720|  2.73k|        }
  721|    308|      }
  722|    804|    }
  723|    805|  }
  724|       |
  725|  6.58k|free_tmpbuf:
  726|  6.58k|  aom_free(tmpbuf0);
  727|  6.58k|  return mem_status;
  728|  6.58k|}
disflow.c:fill_flow_field_borders:
  449|  1.60k|                                    int stride) {
  450|       |  // Calculate the bounds of the rectangle which was filled in by
  451|       |  // compute_flow_field() before calling this function.
  452|       |  // These indices are inclusive on both ends.
  453|  1.60k|  const int left_index = FLOW_BORDER_INNER;
  ------------------
  |  |   43|  1.60k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  1.60k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.60k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  454|  1.60k|  const int right_index = (width - FLOW_BORDER_INNER - 1);
  ------------------
  |  |   43|  1.60k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  1.60k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.60k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  455|  1.60k|  const int top_index = FLOW_BORDER_INNER;
  ------------------
  |  |   43|  1.60k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  1.60k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.60k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  456|  1.60k|  const int bottom_index = (height - FLOW_BORDER_INNER - 1);
  ------------------
  |  |   43|  1.60k|#define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   30|  1.60k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.60k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLOW_BORDER_INNER ((DISFLOW_PATCH_SIZE >> 1) >> DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|  1.60k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  457|       |
  458|       |  // Left area
  459|  10.0k|  for (int i = top_index; i <= bottom_index; i += 1) {
  ------------------
  |  Branch (459:27): [True: 8.48k, False: 1.60k]
  ------------------
  460|  8.48k|    double *row = flow + i * stride;
  461|  8.48k|    const double left = row[left_index];
  462|  25.4k|    for (int j = -FLOW_BORDER_OUTER; j < left_index; j++) {
  ------------------
  |  |   48|  8.48k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  8.48k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (462:38): [True: 16.9k, False: 8.48k]
  ------------------
  463|  16.9k|      row[j] = left;
  464|  16.9k|    }
  465|  8.48k|  }
  466|       |
  467|       |  // Right area
  468|  10.0k|  for (int i = top_index; i <= bottom_index; i += 1) {
  ------------------
  |  Branch (468:27): [True: 8.47k, False: 1.60k]
  ------------------
  469|  8.47k|    double *row = flow + i * stride;
  470|  8.47k|    const double right = row[right_index];
  471|  25.4k|    for (int j = right_index + 1; j < width + FLOW_BORDER_OUTER; j++) {
  ------------------
  |  |   48|  25.4k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  25.4k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (471:35): [True: 16.9k, False: 8.47k]
  ------------------
  472|  16.9k|      row[j] = right;
  473|  16.9k|    }
  474|  8.47k|  }
  475|       |
  476|       |  // Top area
  477|  1.60k|  const double *top_row = flow + top_index * stride - FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  1.60k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  1.60k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  478|  4.82k|  for (int i = -FLOW_BORDER_OUTER; i < top_index; i++) {
  ------------------
  |  |   48|  1.60k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  1.60k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (478:36): [True: 3.21k, False: 1.60k]
  ------------------
  479|  3.21k|    double *row = flow + i * stride - FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  3.21k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  3.21k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  480|  3.21k|    size_t length = width + 2 * FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  3.21k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  3.21k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  481|  3.21k|    memcpy(row, top_row, length * sizeof(*row));
  482|  3.21k|  }
  483|       |
  484|       |  // Bottom area
  485|  1.60k|  const double *bottom_row = flow + bottom_index * stride - FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  1.60k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  1.60k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  486|  4.82k|  for (int i = bottom_index + 1; i < height + FLOW_BORDER_OUTER; i++) {
  ------------------
  |  |   48|  4.82k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  4.82k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (486:34): [True: 3.21k, False: 1.60k]
  ------------------
  487|  3.21k|    double *row = flow + i * stride - FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  3.21k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  3.21k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  488|  3.21k|    size_t length = width + 2 * FLOW_BORDER_OUTER;
  ------------------
  |  |   48|  3.21k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  3.21k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  489|  3.21k|    memcpy(row, bottom_row, length * sizeof(*row));
  490|  3.21k|  }
  491|  1.60k|}
disflow.c:upscale_flow_component:
  543|  1.60k|                                   int stride, double *tmpbuf) {
  544|  1.60k|  const int half_len = FLOW_UPSCALE_TAPS / 2;
  ------------------
  |  |   36|  1.60k|#define FLOW_UPSCALE_TAPS 4
  ------------------
  545|       |
  546|       |  // Check that the outer border is large enough to avoid needing to clamp
  547|       |  // the source locations
  548|  1.60k|  assert(half_len <= FLOW_BORDER_OUTER);
  549|       |
  550|       |  // Horizontal upscale and multiply by 2
  551|  10.0k|  for (int i = 0; i < cur_height; i++) {
  ------------------
  |  Branch (551:19): [True: 8.47k, False: 1.60k]
  ------------------
  552|  47.0k|    for (int j = 0; j < cur_width; j++) {
  ------------------
  |  Branch (552:21): [True: 38.5k, False: 8.47k]
  ------------------
  553|  38.5k|      double left = 0;
  554|   192k|      for (int k = -half_len; k < half_len; k++) {
  ------------------
  |  Branch (554:31): [True: 153k, False: 38.5k]
  ------------------
  555|   153k|        left +=
  556|   153k|            flow[i * stride + (j + k)] * flow_upscale_filter[0][k + half_len];
  557|   153k|      }
  558|  38.5k|      tmpbuf[i * stride + (2 * j + 0)] = 2.0 * left;
  559|       |
  560|       |      // Right output pixel is 0.25 units to the right of the input pixel
  561|  38.5k|      double right = 0;
  562|   192k|      for (int k = -(half_len - 1); k < (half_len + 1); k++) {
  ------------------
  |  Branch (562:37): [True: 154k, False: 38.5k]
  ------------------
  563|   154k|        right += flow[i * stride + (j + k)] *
  564|   154k|                 flow_upscale_filter[1][k + (half_len - 1)];
  565|   154k|      }
  566|  38.5k|      tmpbuf[i * stride + (2 * j + 1)] = 2.0 * right;
  567|  38.5k|    }
  568|  8.47k|  }
  569|       |
  570|       |  // Fill in top and bottom borders of tmpbuf
  571|  1.60k|  const double *top_row = &tmpbuf[0];
  572|  4.82k|  for (int i = -FLOW_BORDER_OUTER; i < 0; i++) {
  ------------------
  |  |   48|  1.60k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  1.60k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (572:36): [True: 3.22k, False: 1.60k]
  ------------------
  573|  3.22k|    double *row = &tmpbuf[i * stride];
  574|  3.22k|    memcpy(row, top_row, 2 * cur_width * sizeof(*row));
  575|  3.22k|  }
  576|       |
  577|  1.60k|  const double *bottom_row = &tmpbuf[(cur_height - 1) * stride];
  578|  4.82k|  for (int i = cur_height; i < cur_height + FLOW_BORDER_OUTER; i++) {
  ------------------
  |  |   48|  4.82k|#define FLOW_BORDER_OUTER (FLOW_UPSCALE_TAPS / 2)
  |  |  ------------------
  |  |  |  |   36|  4.82k|#define FLOW_UPSCALE_TAPS 4
  |  |  ------------------
  ------------------
  |  Branch (578:28): [True: 3.22k, False: 1.60k]
  ------------------
  579|  3.22k|    double *row = &tmpbuf[i * stride];
  580|  3.22k|    memcpy(row, bottom_row, 2 * cur_width * sizeof(*row));
  581|  3.22k|  }
  582|       |
  583|       |  // Vertical upscale
  584|  1.60k|  int upscaled_width = cur_width * 2;
  585|  10.0k|  for (int i = 0; i < cur_height; i++) {
  ------------------
  |  Branch (585:19): [True: 8.48k, False: 1.60k]
  ------------------
  586|  85.5k|    for (int j = 0; j < upscaled_width; j++) {
  ------------------
  |  Branch (586:21): [True: 77.0k, False: 8.48k]
  ------------------
  587|  77.0k|      double top = 0;
  588|   384k|      for (int k = -half_len; k < half_len; k++) {
  ------------------
  |  Branch (588:31): [True: 307k, False: 77.0k]
  ------------------
  589|   307k|        top +=
  590|   307k|            tmpbuf[(i + k) * stride + j] * flow_upscale_filter[0][k + half_len];
  591|   307k|      }
  592|  77.0k|      flow[(2 * i) * stride + j] = top;
  593|       |
  594|  77.0k|      double bottom = 0;
  595|   385k|      for (int k = -(half_len - 1); k < (half_len + 1); k++) {
  ------------------
  |  Branch (595:37): [True: 308k, False: 77.0k]
  ------------------
  596|   308k|        bottom += tmpbuf[(i + k) * stride + j] *
  597|   308k|                  flow_upscale_filter[1][k + (half_len - 1)];
  598|   308k|      }
  599|  77.0k|      flow[(2 * i + 1) * stride + j] = bottom;
  600|  77.0k|    }
  601|  8.48k|  }
  602|  1.60k|}
disflow.c:free_flow_field:
  754|  6.58k|static void free_flow_field(FlowField *flow) {
  755|  6.58k|  aom_free(flow->buf0);
  756|  6.58k|  aom_free(flow);
  757|  6.58k|}
disflow.c:determine_disflow_correspondence:
  122|  6.58k|                                            Correspondence *correspondences) {
  123|  6.58k|  const int width = flow->width;
  124|  6.58k|  const int height = flow->height;
  125|  6.58k|  const int stride = flow->stride;
  126|       |
  127|  6.58k|  int num_correspondences = 0;
  128|   116k|  for (int i = 0; i < corners->num_corners; ++i) {
  ------------------
  |  Branch (128:19): [True: 109k, False: 6.58k]
  ------------------
  129|   109k|    const int x0 = corners->corners[2 * i];
  130|   109k|    const int y0 = corners->corners[2 * i + 1];
  131|       |
  132|       |    // Offset points, to compensate for the fact that (say) a flow field entry
  133|       |    // at horizontal index i, is nominally associated with the pixel at
  134|       |    // horizontal coordinate (i << DOWNSAMPLE_FACTOR) + UPSAMPLE_CENTER_OFFSET
  135|       |    // This offset must be applied before we split the coordinate into integer
  136|       |    // and fractional parts, in order for the interpolation to be correct.
  137|   109k|    const int x = x0 - UPSAMPLE_CENTER_OFFSET;
  ------------------
  |  |   58|   109k|#define UPSAMPLE_CENTER_OFFSET ((DOWNSAMPLE_FACTOR - 1) / 2)
  |  |  ------------------
  |  |  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|   109k|    const int y = y0 - UPSAMPLE_CENTER_OFFSET;
  ------------------
  |  |   58|   109k|#define UPSAMPLE_CENTER_OFFSET ((DOWNSAMPLE_FACTOR - 1) / 2)
  |  |  ------------------
  |  |  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|       |
  140|       |    // Split the pixel coordinates into integer flow field coordinates and
  141|       |    // an offset for interpolation
  142|   109k|    const int flow_x = x >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  ------------------
  143|   109k|    const double flow_sub_x =
  144|   109k|        (x & (DOWNSAMPLE_FACTOR - 1)) / (double)DOWNSAMPLE_FACTOR;
  ------------------
  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
                      (x & (DOWNSAMPLE_FACTOR - 1)) / (double)DOWNSAMPLE_FACTOR;
  ------------------
  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  145|   109k|    const int flow_y = y >> DOWNSAMPLE_SHIFT;
  ------------------
  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  ------------------
  146|   109k|    const double flow_sub_y =
  147|   109k|        (y & (DOWNSAMPLE_FACTOR - 1)) / (double)DOWNSAMPLE_FACTOR;
  ------------------
  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
                      (y & (DOWNSAMPLE_FACTOR - 1)) / (double)DOWNSAMPLE_FACTOR;
  ------------------
  |  |   32|   109k|#define DOWNSAMPLE_FACTOR (1 << DOWNSAMPLE_SHIFT)
  |  |  ------------------
  |  |  |  |   31|   109k|#define DOWNSAMPLE_SHIFT 3
  |  |  ------------------
  ------------------
  148|       |
  149|       |    // Exclude points which would sample from the outer border of the flow
  150|       |    // field, as this would give lower-quality results.
  151|       |    //
  152|       |    // Note: As we never read from the border region at pyramid level 0, we
  153|       |    // can skip filling it in. If the conditions here are removed, or any
  154|       |    // other logic is added which reads from this border region, then
  155|       |    // compute_flow_field() will need to be modified to call
  156|       |    // fill_flow_field_borders() at pyramid level 0 to set up the correct
  157|       |    // border data.
  158|   109k|    if (flow_x < 1 || (flow_x + 2) >= width) continue;
  ------------------
  |  Branch (158:9): [True: 41.6k, False: 68.2k]
  |  Branch (158:23): [True: 26.6k, False: 41.6k]
  ------------------
  159|  41.5k|    if (flow_y < 1 || (flow_y + 2) >= height) continue;
  ------------------
  |  Branch (159:9): [True: 19.2k, False: 22.3k]
  |  Branch (159:23): [True: 14.9k, False: 7.44k]
  ------------------
  160|       |
  161|  7.32k|    double h_kernel[4];
  162|  7.32k|    double v_kernel[4];
  163|  7.32k|    get_cubic_kernel_dbl(flow_sub_x, h_kernel);
  164|  7.32k|    get_cubic_kernel_dbl(flow_sub_y, v_kernel);
  165|       |
  166|  7.32k|    double flow_u = bicubic_interp_one(&flow->u[flow_y * stride + flow_x],
  167|  7.32k|                                       stride, h_kernel, v_kernel);
  168|  7.32k|    double flow_v = bicubic_interp_one(&flow->v[flow_y * stride + flow_x],
  169|  7.32k|                                       stride, h_kernel, v_kernel);
  170|       |
  171|       |    // Refine the interpolated flow vector one last time
  172|  7.32k|    const int patch_tl_x = x0 - DISFLOW_PATCH_CENTER;
  ------------------
  |  |   32|  7.32k|#define DISFLOW_PATCH_CENTER ((DISFLOW_PATCH_SIZE / 2) - 1)
  |  |  ------------------
  |  |  |  |   30|  7.32k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  7.32k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  7.32k|    const int patch_tl_y = y0 - DISFLOW_PATCH_CENTER;
  ------------------
  |  |   32|  7.32k|#define DISFLOW_PATCH_CENTER ((DISFLOW_PATCH_SIZE / 2) - 1)
  |  |  ------------------
  |  |  |  |   30|  7.32k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  7.32k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  7.32k|    aom_compute_flow_at_point(
  175|  7.32k|        src_pyr->layers[0].buffer, ref_pyr->layers[0].buffer, patch_tl_x,
  176|  7.32k|        patch_tl_y, src_pyr->layers[0].width, src_pyr->layers[0].height,
  177|  7.32k|        src_pyr->layers[0].stride, &flow_u, &flow_v);
  178|       |
  179|       |    // Use original points (without offsets) when filling in correspondence
  180|       |    // array
  181|  7.32k|    correspondences[num_correspondences].x = x0;
  182|  7.32k|    correspondences[num_correspondences].y = y0;
  183|  7.32k|    correspondences[num_correspondences].rx = x0 + flow_u;
  184|  7.32k|    correspondences[num_correspondences].ry = y0 + flow_v;
  185|  7.32k|    num_correspondences++;
  186|  7.32k|  }
  187|  6.58k|  return num_correspondences;
  188|  6.58k|}
disflow.c:bicubic_interp_one:
  106|  14.8k|                                        const double v_kernel[4]) {
  107|  14.8k|  double tmp[1 * 4];
  108|       |
  109|       |  // Horizontal convolution
  110|  74.3k|  for (int i = -1; i < 3; ++i) {
  ------------------
  |  Branch (110:20): [True: 59.4k, False: 14.8k]
  ------------------
  111|  59.4k|    tmp[i + 1] = get_cubic_value_dbl(&arr[i * stride - 1], h_kernel);
  112|  59.4k|  }
  113|       |
  114|       |  // Vertical convolution
  115|  14.8k|  return get_cubic_value_dbl(tmp, v_kernel);
  116|  14.8k|}
disflow.c:get_cubic_value_dbl:
   94|  74.3k|                                         const double kernel[4]) {
   95|  74.3k|  return kernel[0] * p[0] + kernel[1] * p[1] + kernel[2] * p[2] +
   96|  74.3k|         kernel[3] * p[3];
   97|  74.3k|}

aom_compute_global_motion:
   39|  6.58k|                               int num_motion_models, bool *mem_alloc_failed) {
   40|  6.58k|  switch (gm_method) {
   41|      0|    case GLOBAL_MOTION_METHOD_FEATURE_MATCH:
  ------------------
  |  Branch (41:5): [True: 0, False: 6.58k]
  ------------------
   42|      0|      return av1_compute_global_motion_feature_match(
   43|      0|          type, src, ref, bit_depth, downsample_level, motion_models,
   44|      0|          num_motion_models, mem_alloc_failed);
   45|  6.58k|    case GLOBAL_MOTION_METHOD_DISFLOW:
  ------------------
  |  Branch (45:5): [True: 6.58k, False: 0]
  ------------------
   46|  6.58k|      return av1_compute_global_motion_disflow(
   47|  6.58k|          type, src, ref, bit_depth, downsample_level, motion_models,
   48|  6.58k|          num_motion_models, mem_alloc_failed);
   49|      0|    default: assert(0 && "Unknown global motion estimation type");
  ------------------
  |  Branch (49:5): [True: 0, False: 6.58k]
  ------------------
   50|  6.58k|  }
   51|      0|  return false;
   52|  6.58k|}

ransac:
  493|  6.58k|            int num_desired_motions, bool *mem_alloc_failed) {
  494|       |#if ALLOW_TRANSLATION_MODELS
  495|       |  assert(type > IDENTITY && type < TRANS_TYPES);
  496|       |#else
  497|  6.58k|  assert(type > TRANSLATION && type < TRANS_TYPES);
  498|  6.58k|#endif  // ALLOW_TRANSLATION_MODELS
  499|       |
  500|  6.58k|  return ransac_internal(matched_points, npoints, motion_models,
  501|  6.58k|                         num_desired_motions, &ransac_model_info[type],
  502|  6.58k|                         mem_alloc_failed);
  503|  6.58k|}
ransac.c:ransac_internal:
  289|  6.58k|                            bool *mem_alloc_failed) {
  290|  6.58k|  assert(npoints >= 0);
  291|  6.58k|  int i = 0;
  292|  6.58k|  int minpts = model_info->minpts;
  293|  6.58k|  bool ret_val = true;
  294|       |
  295|  6.58k|  unsigned int seed = (unsigned int)npoints;
  296|       |
  297|  6.58k|  int indices[MAX_MINPTS] = { 0 };
  298|       |
  299|       |  // Store information for the num_desired_motions best transformations found
  300|       |  // and the worst motion among them, as well as the motion currently under
  301|       |  // consideration.
  302|  6.58k|  RANSAC_MOTION *motions, *worst_kept_motion = NULL;
  303|  6.58k|  RANSAC_MOTION current_motion;
  304|       |
  305|       |  // Store the parameters and the indices of the inlier points for the motion
  306|       |  // currently under consideration.
  307|  6.58k|  double params_this_motion[MAX_PARAMDIM];
  308|       |
  309|       |  // Initialize output models, as a fallback in case we can't find a model
  310|  13.1k|  for (i = 0; i < num_desired_motions; i++) {
  ------------------
  |  Branch (310:15): [True: 6.58k, False: 6.58k]
  ------------------
  311|  6.58k|    memcpy(motion_models[i].params, kIdentityParams,
  312|  6.58k|           MAX_PARAMDIM * sizeof(*(motion_models[i].params)));
  ------------------
  |  |   24|  6.58k|#define MAX_PARAMDIM 6
  ------------------
  313|  6.58k|    motion_models[i].num_inliers = 0;
  314|  6.58k|  }
  315|       |
  316|  6.58k|  if (npoints < minpts * MINPTS_MULTIPLIER || npoints == 0) {
  ------------------
  |  |   28|  13.1k|#define MINPTS_MULTIPLIER 5
  ------------------
  |  Branch (316:7): [True: 6.31k, False: 269]
  |  Branch (316:47): [True: 0, False: 269]
  ------------------
  317|  6.31k|    return false;
  318|  6.31k|  }
  319|       |
  320|    270|  int min_inliers = AOMMAX((int)(MIN_INLIER_PROB * npoints), minpts);
  ------------------
  |  |   35|    270|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 77, False: 193]
  |  |  ------------------
  ------------------
  321|       |
  322|    270|  motions =
  323|    270|      (RANSAC_MOTION *)aom_calloc(num_desired_motions, sizeof(RANSAC_MOTION));
  324|       |
  325|       |  // Allocate one large buffer which will be carved up to store the inlier
  326|       |  // indices for the current motion plus the num_desired_motions many
  327|       |  // output models
  328|       |  // This allows us to keep the allocation/deallocation logic simple, without
  329|       |  // having to (for example) check that `motions` is non-null before allocating
  330|       |  // the inlier arrays
  331|    270|  int *inlier_buffer = (int *)aom_malloc(sizeof(*inlier_buffer) * npoints *
  332|    270|                                         (num_desired_motions + 1));
  333|       |
  334|    270|  if (!(motions && inlier_buffer)) {
  ------------------
  |  Branch (334:9): [True: 270, False: 0]
  |  Branch (334:20): [True: 270, False: 0]
  ------------------
  335|      0|    ret_val = false;
  336|      0|    *mem_alloc_failed = true;
  337|      0|    goto finish_ransac;
  338|      0|  }
  339|       |
  340|       |  // Once all our allocations are known-good, we can fill in our structures
  341|    270|  worst_kept_motion = motions;
  342|       |
  343|    540|  for (i = 0; i < num_desired_motions; ++i) {
  ------------------
  |  Branch (343:15): [True: 270, False: 270]
  ------------------
  344|    270|    motions[i].inlier_indices = inlier_buffer + i * npoints;
  345|    270|  }
  346|    270|  memset(&current_motion, 0, sizeof(current_motion));
  347|    270|  current_motion.inlier_indices = inlier_buffer + num_desired_motions * npoints;
  348|       |
  349|  5.65k|  for (int trial_count = 0; trial_count < NUM_TRIALS; trial_count++) {
  ------------------
  |  |   34|  5.65k|#define NUM_TRIALS 20
  ------------------
  |  Branch (349:29): [True: 5.38k, False: 270]
  ------------------
  350|  5.38k|    lcg_pick(npoints, minpts, indices, &seed);
  351|       |
  352|  5.38k|    if (!model_info->find_transformation(matched_points, indices, minpts,
  ------------------
  |  Branch (352:9): [True: 0, False: 5.38k]
  ------------------
  353|  5.38k|                                         params_this_motion)) {
  354|      0|      continue;
  355|      0|    }
  356|       |
  357|  5.38k|    model_info->score_model(params_this_motion, matched_points, npoints,
  358|  5.38k|                            &current_motion);
  359|       |
  360|  5.38k|    if (current_motion.num_inliers < min_inliers) {
  ------------------
  |  Branch (360:9): [True: 328, False: 5.05k]
  ------------------
  361|       |      // Reject models with too few inliers
  362|    328|      continue;
  363|    328|    }
  364|       |
  365|  5.05k|    if (is_better_motion(&current_motion, worst_kept_motion)) {
  ------------------
  |  Branch (365:9): [True: 875, False: 4.18k]
  ------------------
  366|       |      // This motion is better than the worst currently kept motion. Remember
  367|       |      // the inlier points and sse. The parameters for each kept motion
  368|       |      // will be recomputed later using only the inliers.
  369|    875|      worst_kept_motion->num_inliers = current_motion.num_inliers;
  370|    875|      worst_kept_motion->sse = current_motion.sse;
  371|       |
  372|       |      // Rather than copying the (potentially many) inlier indices from
  373|       |      // current_motion.inlier_indices to worst_kept_motion->inlier_indices,
  374|       |      // we can swap the underlying pointers.
  375|       |      //
  376|       |      // This is okay because the next time current_motion.inlier_indices
  377|       |      // is used will be in the next trial, where we ignore its previous
  378|       |      // contents anyway. And both arrays will be deallocated together at the
  379|       |      // end of this function, so there are no lifetime issues.
  380|    875|      int *tmp = worst_kept_motion->inlier_indices;
  381|    875|      worst_kept_motion->inlier_indices = current_motion.inlier_indices;
  382|    875|      current_motion.inlier_indices = tmp;
  383|       |
  384|       |      // Determine the new worst kept motion and its num_inliers and sse.
  385|  1.75k|      for (i = 0; i < num_desired_motions; ++i) {
  ------------------
  |  Branch (385:19): [True: 875, False: 875]
  ------------------
  386|    875|        if (is_better_motion(worst_kept_motion, &motions[i])) {
  ------------------
  |  Branch (386:13): [True: 0, False: 875]
  ------------------
  387|      0|          worst_kept_motion = &motions[i];
  388|      0|        }
  389|    875|      }
  390|    875|    }
  391|  5.05k|  }
  392|       |
  393|       |  // Sort the motions, best first.
  394|    270|  qsort(motions, num_desired_motions, sizeof(RANSAC_MOTION), compare_motions);
  395|       |
  396|       |  // Refine each of the best N models using iterative estimation.
  397|       |  //
  398|       |  // The idea here is loosely based on the iterative method from
  399|       |  // "Locally Optimized RANSAC" by O. Chum, J. Matas and Josef Kittler:
  400|       |  // https://cmp.felk.cvut.cz/ftp/articles/matas/chum-dagm03.pdf
  401|       |  //
  402|       |  // However, we implement a simpler version than their proposal, and simply
  403|       |  // refit the model repeatedly until the number of inliers stops increasing,
  404|       |  // with a cap on the number of iterations to defend against edge cases which
  405|       |  // only improve very slowly.
  406|    538|  for (i = 0; i < num_desired_motions; ++i) {
  ------------------
  |  Branch (406:15): [True: 268, False: 270]
  ------------------
  407|    268|    if (motions[i].num_inliers <= 0) {
  ------------------
  |  Branch (407:9): [True: 0, False: 268]
  ------------------
  408|       |      // Output model has already been initialized to the identity model,
  409|       |      // so just skip setup
  410|      0|      continue;
  411|      0|    }
  412|       |
  413|    268|    bool bad_model = false;
  414|    335|    for (int refine_count = 0; refine_count < NUM_REFINES; refine_count++) {
  ------------------
  |  |   37|    334|#define NUM_REFINES 5
  ------------------
  |  Branch (414:32): [True: 335, False: 18.4E]
  ------------------
  415|    335|      int num_inliers = motions[i].num_inliers;
  416|    335|      assert(num_inliers >= min_inliers);
  417|       |
  418|    335|      if (!model_info->find_transformation(matched_points,
  ------------------
  |  Branch (418:11): [True: 0, False: 335]
  ------------------
  419|    335|                                           motions[i].inlier_indices,
  420|    335|                                           num_inliers, params_this_motion)) {
  421|       |        // In the unlikely event that this model fitting fails, we don't have a
  422|       |        // good fallback. So leave this model set to the identity model
  423|      0|        bad_model = true;
  424|      0|        break;
  425|      0|      }
  426|       |
  427|       |      // Score the newly generated model
  428|    335|      model_info->score_model(params_this_motion, matched_points, npoints,
  429|    335|                              &current_motion);
  430|       |
  431|       |      // At this point, there are three possibilities:
  432|       |      // 1) If we found more inliers, keep refining.
  433|       |      // 2) If we found the same number of inliers but a lower SSE, we want to
  434|       |      //    keep the new model, but further refinement is unlikely to gain much.
  435|       |      //    So commit to this new model
  436|       |      // 3) It is possible, but very unlikely, that the new model will have
  437|       |      //    fewer inliers. If it does happen, we probably just lost a few
  438|       |      //    borderline inliers. So treat the same as case (2).
  439|    335|      if (current_motion.num_inliers > motions[i].num_inliers) {
  ------------------
  |  Branch (439:11): [True: 66, False: 269]
  ------------------
  440|     66|        motions[i].num_inliers = current_motion.num_inliers;
  441|     66|        motions[i].sse = current_motion.sse;
  442|     66|        int *tmp = motions[i].inlier_indices;
  443|     66|        motions[i].inlier_indices = current_motion.inlier_indices;
  444|     66|        current_motion.inlier_indices = tmp;
  445|    269|      } else {
  446|       |        // Refined model is no better, so stop
  447|       |        // This shouldn't be significantly worse than the previous model,
  448|       |        // so it's fine to use the parameters in params_this_motion.
  449|       |        // This saves us from having to cache the previous iteration's params.
  450|    269|        break;
  451|    269|      }
  452|    335|    }
  453|       |
  454|    268|    if (bad_model) continue;
  ------------------
  |  Branch (454:9): [True: 0, False: 268]
  ------------------
  455|       |
  456|       |    // Fill in output struct
  457|    268|    memcpy(motion_models[i].params, params_this_motion,
  458|    268|           MAX_PARAMDIM * sizeof(*motion_models[i].params));
  ------------------
  |  |   24|    268|#define MAX_PARAMDIM 6
  ------------------
  459|  2.51k|    for (int j = 0; j < motions[i].num_inliers; j++) {
  ------------------
  |  Branch (459:21): [True: 2.24k, False: 268]
  ------------------
  460|  2.24k|      int index = motions[i].inlier_indices[j];
  461|  2.24k|      const Correspondence *corr = &matched_points[index];
  462|  2.24k|      motion_models[i].inliers[2 * j + 0] = (int)rint(corr->x);
  463|  2.24k|      motion_models[i].inliers[2 * j + 1] = (int)rint(corr->y);
  464|  2.24k|    }
  465|    268|    motion_models[i].num_inliers = motions[i].num_inliers;
  466|    268|  }
  467|       |
  468|    270|finish_ransac:
  469|    270|  aom_free(inlier_buffer);
  470|    270|  aom_free(motions);
  471|       |
  472|    270|  return ret_val;
  473|    270|}
ransac.c:is_better_motion:
  281|  5.93k|                             const RANSAC_MOTION *motion_b) {
  282|  5.93k|  return compare_motions(motion_a, motion_b) < 0;
  283|  5.93k|}
ransac.c:compare_motions:
  269|  5.93k|static int compare_motions(const void *arg_a, const void *arg_b) {
  270|  5.93k|  const RANSAC_MOTION *motion_a = (RANSAC_MOTION *)arg_a;
  271|  5.93k|  const RANSAC_MOTION *motion_b = (RANSAC_MOTION *)arg_b;
  272|       |
  273|  5.93k|  if (motion_a->num_inliers > motion_b->num_inliers) return -1;
  ------------------
  |  Branch (273:7): [True: 635, False: 5.29k]
  ------------------
  274|  5.29k|  if (motion_a->num_inliers < motion_b->num_inliers) return 1;
  ------------------
  |  Branch (274:7): [True: 3.74k, False: 1.55k]
  ------------------
  275|  1.55k|  if (motion_a->sse < motion_b->sse) return -1;
  ------------------
  |  Branch (275:7): [True: 240, False: 1.31k]
  ------------------
  276|  1.31k|  if (motion_a->sse > motion_b->sse) return 1;
  ------------------
  |  Branch (276:7): [True: 427, False: 889]
  ------------------
  277|    889|  return 0;
  278|  1.31k|}
ransac.c:find_rotzoom:
  167|  5.71k|                         int num_indices, double *params) {
  168|  5.71k|  const int n = 4;    // Size of least-squares problem
  169|  5.71k|  double mat[4 * 4];  // Accumulator for A'A
  170|  5.71k|  double y[4];        // Accumulator for A'b
  171|  5.71k|  double a[4];        // Single row of A
  172|  5.71k|  double b;           // Single element of b
  173|       |
  174|  5.71k|  least_squares_init(mat, y, n);
  175|  19.5k|  for (int i = 0; i < num_indices; ++i) {
  ------------------
  |  Branch (175:19): [True: 13.7k, False: 5.71k]
  ------------------
  176|  13.7k|    int index = indices[i];
  177|  13.7k|    const double sx = points[index].x;
  178|  13.7k|    const double sy = points[index].y;
  179|  13.7k|    const double dx = points[index].rx;
  180|  13.7k|    const double dy = points[index].ry;
  181|       |
  182|  13.7k|    a[0] = 1;
  183|  13.7k|    a[1] = 0;
  184|  13.7k|    a[2] = sx;
  185|  13.7k|    a[3] = sy;
  186|  13.7k|    b = dx;
  187|  13.7k|    least_squares_accumulate(mat, y, a, b, n);
  188|       |
  189|  13.7k|    a[0] = 0;
  190|  13.7k|    a[1] = 1;
  191|  13.7k|    a[2] = sy;
  192|  13.7k|    a[3] = -sx;
  193|  13.7k|    b = dy;
  194|  13.7k|    least_squares_accumulate(mat, y, a, b, n);
  195|  13.7k|  }
  196|       |
  197|       |  // Fill in params[0] .. params[3] with output model
  198|  5.71k|  if (!least_squares_solve(mat, y, params, n)) {
  ------------------
  |  Branch (198:7): [True: 0, False: 5.71k]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|       |
  202|       |  // Fill in remaining parameters
  203|  5.71k|  params[4] = -params[3];
  204|  5.71k|  params[5] = params[2];
  205|       |
  206|       |  return true;
  207|  5.71k|}
ransac.c:score_affine:
  115|  5.71k|                         int num_points, RANSAC_MOTION *model) {
  116|  5.71k|  model->num_inliers = 0;
  117|  5.71k|  model->sse = 0.0;
  118|       |
  119|   140k|  for (int i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (119:19): [True: 135k, False: 5.71k]
  ------------------
  120|   135k|    const double x1 = points[i].x;
  121|   135k|    const double y1 = points[i].y;
  122|   135k|    const double x2 = points[i].rx;
  123|   135k|    const double y2 = points[i].ry;
  124|       |
  125|   135k|    const double proj_x = mat[2] * x1 + mat[3] * y1 + mat[0];
  126|   135k|    const double proj_y = mat[4] * x1 + mat[5] * y1 + mat[1];
  127|       |
  128|   135k|    const double dx = proj_x - x2;
  129|   135k|    const double dy = proj_y - y2;
  130|   135k|    const double sse = dx * dx + dy * dy;
  131|       |
  132|   135k|    if (sse < INLIER_THRESHOLD_SQUARED) {
  ------------------
  |  |   31|   135k|#define INLIER_THRESHOLD_SQUARED (INLIER_THRESHOLD * INLIER_THRESHOLD)
  |  |  ------------------
  |  |  |  |   30|   135k|#define INLIER_THRESHOLD 1.25
  |  |  ------------------
  |  |               #define INLIER_THRESHOLD_SQUARED (INLIER_THRESHOLD * INLIER_THRESHOLD)
  |  |  ------------------
  |  |  |  |   30|   135k|#define INLIER_THRESHOLD 1.25
  |  |  ------------------
  ------------------
  |  Branch (132:9): [True: 27.5k, False: 107k]
  ------------------
  133|  27.5k|      model->inlier_indices[model->num_inliers++] = i;
  134|  27.5k|      model->sse += sse;
  135|  27.5k|    }
  136|   135k|  }
  137|  5.71k|}

aom_compute_flow_at_point_avx2:
  387|  25.5k|                                    int stride, double *u, double *v) {
  388|  25.5k|  DECLARE_ALIGNED(32, double, M[4]);
  ------------------
  |  |   19|  25.5k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  389|  25.5k|  DECLARE_ALIGNED(32, double, M_inv[4]);
  ------------------
  |  |   19|  25.5k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  390|  25.5k|  DECLARE_ALIGNED(32, int16_t, dx[DISFLOW_PATCH_SIZE * DISFLOW_PATCH_SIZE]);
  ------------------
  |  |   19|  25.5k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  391|  25.5k|  DECLARE_ALIGNED(32, int16_t, dy[DISFLOW_PATCH_SIZE * DISFLOW_PATCH_SIZE]);
  ------------------
  |  |   19|  25.5k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  392|  25.5k|  int b[2];
  393|       |
  394|       |  // Compute gradients within this patch
  395|  25.5k|  const uint8_t *src_patch = &src[y * stride + x];
  396|  25.5k|  sobel_filter(src_patch, stride, dx, dy);
  397|       |
  398|  25.5k|  compute_flow_matrix(dx, DISFLOW_PATCH_SIZE, dy, DISFLOW_PATCH_SIZE, M);
  ------------------
  |  |   30|  25.5k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|  25.5k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
                compute_flow_matrix(dx, DISFLOW_PATCH_SIZE, dy, DISFLOW_PATCH_SIZE, M);
  ------------------
  |  |   30|  25.5k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|  25.5k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  399|  25.5k|  invert_2x2(M, M_inv);
  400|       |
  401|   105k|  for (int itr = 0; itr < DISFLOW_MAX_ITR; itr++) {
  ------------------
  |  |   70|   105k|#define DISFLOW_MAX_ITR 4
  ------------------
  |  Branch (401:21): [True: 87.6k, False: 17.9k]
  ------------------
  402|  87.6k|    compute_flow_vector(src, ref, width, height, stride, x, y, *u, *v, dx, dy,
  403|  87.6k|                        b);
  404|       |
  405|       |    // Solve flow equations to find a better estimate for the flow vector
  406|       |    // at this point
  407|  87.6k|    const double step_u = M_inv[0] * b[0] + M_inv[1] * b[1];
  408|  87.6k|    const double step_v = M_inv[2] * b[0] + M_inv[3] * b[1];
  409|  87.6k|    *u += fclamp(step_u * DISFLOW_STEP_SIZE, -2, 2);
  ------------------
  |  |   50|  87.6k|#define DISFLOW_STEP_SIZE 1.0
  ------------------
  410|  87.6k|    *v += fclamp(step_v * DISFLOW_STEP_SIZE, -2, 2);
  ------------------
  |  |   50|  87.6k|#define DISFLOW_STEP_SIZE 1.0
  ------------------
  411|       |
  412|  87.6k|    if (fabs(step_u) + fabs(step_v) < DISFLOW_STEP_SIZE_THRESOLD) {
  ------------------
  |  |   67|  87.6k|#define DISFLOW_STEP_SIZE_THRESOLD (1. / 8.)
  ------------------
  |  Branch (412:9): [True: 7.58k, False: 80.0k]
  ------------------
  413|       |      // Stop iteration when we're close to convergence
  414|  7.58k|      break;
  415|  7.58k|    }
  416|  87.6k|  }
  417|  25.5k|}
disflow_avx2.c:sobel_filter:
  271|  25.5k|                                int16_t *dy) {
  272|  25.5k|  const __m256i zero = _mm256_setzero_si256();
  273|       |
  274|       |  // Loop setup: Load the first two rows (of 10 input rows) and apply
  275|       |  // the horizontal parts of the two filters
  276|  25.5k|  __m256i row_m1_0 =
  277|  25.5k|      yy_loadu2_128((__m128i *)(src - 1), (__m128i *)(src - src_stride - 1));
  278|  25.5k|  __m256i row_m1_0_a = _mm256_unpacklo_epi8(row_m1_0, zero);
  279|  25.5k|  __m256i row_m1_0_b =
  280|  25.5k|      _mm256_unpacklo_epi8(_mm256_srli_si256(row_m1_0, 1), zero);
  281|  25.5k|  __m256i row_m1_0_c =
  282|  25.5k|      _mm256_unpacklo_epi8(_mm256_srli_si256(row_m1_0, 2), zero);
  283|       |
  284|  25.5k|  __m256i row_m1_0_hsmooth =
  285|  25.5k|      _mm256_add_epi16(_mm256_add_epi16(row_m1_0_a, row_m1_0_c),
  286|  25.5k|                       _mm256_slli_epi16(row_m1_0_b, 1));
  287|  25.5k|  __m256i row_m1_0_hdiff = _mm256_sub_epi16(row_m1_0_a, row_m1_0_c);
  288|       |
  289|       |  // Main loop: For each pair of output rows (i, i+1):
  290|       |  // * Load rows (i+1, i+2) and apply both horizontal filters
  291|       |  // * Apply vertical filters and store results
  292|       |  // * Shift rows for next iteration
  293|   127k|  for (int i = 0; i < DISFLOW_PATCH_SIZE; i += 2) {
  ------------------
  |  |   30|   127k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   127k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  |  Branch (293:19): [True: 102k, False: 25.5k]
  ------------------
  294|       |    // Load rows (i+1, i+2) and apply both horizontal filters
  295|   102k|    const __m256i row_p1_p2 =
  296|   102k|        yy_loadu2_128((__m128i *)(src + (i + 2) * src_stride - 1),
  297|   102k|                      (__m128i *)(src + (i + 1) * src_stride - 1));
  298|   102k|    const __m256i row_p1_p2_a = _mm256_unpacklo_epi8(row_p1_p2, zero);
  299|   102k|    const __m256i row_p1_p2_b =
  300|   102k|        _mm256_unpacklo_epi8(_mm256_srli_si256(row_p1_p2, 1), zero);
  301|   102k|    const __m256i row_p1_p2_c =
  302|   102k|        _mm256_unpacklo_epi8(_mm256_srli_si256(row_p1_p2, 2), zero);
  303|       |
  304|   102k|    const __m256i row_p1_p2_hsmooth =
  305|   102k|        _mm256_add_epi16(_mm256_add_epi16(row_p1_p2_a, row_p1_p2_c),
  306|   102k|                         _mm256_slli_epi16(row_p1_p2_b, 1));
  307|   102k|    const __m256i row_p1_p2_hdiff = _mm256_sub_epi16(row_p1_p2_a, row_p1_p2_c);
  308|       |
  309|       |    // Apply vertical filters and store results
  310|       |    // dx = vertical smooth(horizontal diff(input))
  311|       |    // dy = vertical diff(horizontal smooth(input))
  312|   102k|    const __m256i row_0_p1_hdiff =
  313|   102k|        _mm256_permute2x128_si256(row_m1_0_hdiff, row_p1_p2_hdiff, 0x21);
  314|   102k|    const __m256i dx_row =
  315|   102k|        _mm256_add_epi16(_mm256_add_epi16(row_m1_0_hdiff, row_p1_p2_hdiff),
  316|   102k|                         _mm256_slli_epi16(row_0_p1_hdiff, 1));
  317|   102k|    const __m256i dy_row =
  318|   102k|        _mm256_sub_epi16(row_m1_0_hsmooth, row_p1_p2_hsmooth);
  319|       |
  320|   102k|    _mm256_storeu_si256((__m256i *)(dx + i * DISFLOW_PATCH_SIZE), dx_row);
  ------------------
  |  |   30|   102k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   102k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  321|   102k|    _mm256_storeu_si256((__m256i *)(dy + i * DISFLOW_PATCH_SIZE), dy_row);
  ------------------
  |  |   30|   102k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   102k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  322|       |
  323|       |    // Shift rows for next iteration
  324|       |    // This allows a lot of work to be reused, reducing the number of
  325|       |    // horizontal filtering operations from 2*3*8 = 48 to 2*10 = 20
  326|   102k|    row_m1_0_hsmooth = row_p1_p2_hsmooth;
  327|   102k|    row_m1_0_hdiff = row_p1_p2_hdiff;
  328|   102k|  }
  329|  25.5k|}
disflow_avx2.c:compute_flow_matrix:
  333|  26.1k|                                       double *M) {
  334|  26.1k|  __m256i acc[4] = { 0 };
  335|       |
  336|   130k|  for (int i = 0; i < DISFLOW_PATCH_SIZE; i += 2) {
  ------------------
  |  |   30|   130k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   130k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  |  Branch (336:19): [True: 104k, False: 26.1k]
  ------------------
  337|   104k|    __m256i dx_row = _mm256_loadu_si256((__m256i *)&dx[i * dx_stride]);
  338|   104k|    __m256i dy_row = _mm256_loadu_si256((__m256i *)&dy[i * dy_stride]);
  339|       |
  340|   104k|    acc[0] = _mm256_add_epi32(acc[0], _mm256_madd_epi16(dx_row, dx_row));
  341|   104k|    acc[1] = _mm256_add_epi32(acc[1], _mm256_madd_epi16(dx_row, dy_row));
  342|       |    // Don't compute acc[2], as it should be equal to acc[1]
  343|   104k|    acc[3] = _mm256_add_epi32(acc[3], _mm256_madd_epi16(dy_row, dy_row));
  344|   104k|  }
  345|       |
  346|       |  // Condense sums
  347|  26.1k|  __m256i partial_sum_0 = _mm256_hadd_epi32(acc[0], acc[1]);
  348|  26.1k|  __m256i partial_sum_1 = _mm256_hadd_epi32(acc[1], acc[3]);
  349|  26.1k|  __m256i result_256 = _mm256_hadd_epi32(partial_sum_0, partial_sum_1);
  350|  26.1k|  __m128i result = _mm_add_epi32(_mm256_extracti128_si256(result_256, 0),
  351|  26.1k|                                 _mm256_extracti128_si256(result_256, 1));
  352|       |
  353|       |  // Apply regularization
  354|       |  // We follow the standard regularization method of adding `k * I` before
  355|       |  // inverting. This ensures that the matrix will be invertible.
  356|       |  //
  357|       |  // Setting the regularization strength k to 1 seems to work well here, as
  358|       |  // typical values coming from the other equations are very large (1e5 to
  359|       |  // 1e6, with an upper limit of around 6e7, at the time of writing).
  360|       |  // It also preserves the property that all matrix values are whole numbers,
  361|       |  // which is convenient for integerized SIMD implementation.
  362|  26.1k|  result = _mm_add_epi32(result, _mm_set_epi32(1, 0, 0, 1));
  363|       |
  364|       |  // Convert results to doubles and store
  365|  26.1k|  _mm256_storeu_pd(M, _mm256_cvtepi32_pd(result));
  366|  26.1k|}
disflow_avx2.c:invert_2x2:
  374|  26.2k|static inline void invert_2x2(const double *M, double *M_inv) {
  375|  26.2k|  double det = (M[0] * M[3]) - (M[1] * M[2]);
  376|  26.2k|  assert(det >= 1);
  377|  26.2k|  const double det_inv = 1 / det;
  378|       |
  379|  26.2k|  M_inv[0] = M[3] * det_inv;
  380|  26.2k|  M_inv[1] = -M[1] * det_inv;
  381|  26.2k|  M_inv[2] = -M[2] * det_inv;
  382|  26.2k|  M_inv[3] = M[0] * det_inv;
  383|  26.2k|}
disflow_avx2.c:compute_flow_vector:
   88|  87.4k|                                       int *b) {
   89|  87.4k|  const __m256i zero = _mm256_setzero_si256();
   90|       |
   91|       |  // Accumulate 8 32-bit partial sums for each element of b
   92|       |  // These will be flattened at the end.
   93|  87.4k|  __m256i b0_acc = _mm256_setzero_si256();
   94|  87.4k|  __m256i b1_acc = _mm256_setzero_si256();
   95|       |
   96|       |  // Split offset into integer and fractional parts, and compute cubic
   97|       |  // interpolation kernels
   98|  87.4k|  const int u_int = (int)floor(u);
   99|  87.4k|  const int v_int = (int)floor(v);
  100|  87.4k|  const double u_frac = u - floor(u);
  101|  87.4k|  const double v_frac = v - floor(v);
  102|       |
  103|  87.4k|  const __m128i kernels = compute_cubic_kernels(u_frac, v_frac);
  104|       |
  105|       |  // Storage for intermediate values between the two convolution directions
  106|       |  // In the AVX2 implementation, this needs a dummy row at the end, because
  107|       |  // we generate 2 rows at a time but the total number of rows is odd.
  108|       |  // So we generate one more row than we actually need.
  109|  87.4k|  DECLARE_ALIGNED(32, int16_t,
  ------------------
  |  |   19|  87.4k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  110|  87.4k|                  tmp_[DISFLOW_PATCH_SIZE * (DISFLOW_PATCH_SIZE + 4)]);
  111|  87.4k|  int16_t *tmp = tmp_ + DISFLOW_PATCH_SIZE;  // Offset by one row
  ------------------
  |  |   30|  87.4k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|  87.4k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  112|       |
  113|       |  // Clamp coordinates so that all pixels we fetch will remain within the
  114|       |  // allocated border region, but allow them to go far enough out that
  115|       |  // the border pixels' values do not change.
  116|       |  // Since we are calculating an 8x8 block, the bottom-right pixel
  117|       |  // in the block has coordinates (x0 + 7, y0 + 7). Then, the cubic
  118|       |  // interpolation has 4 taps, meaning that the output of pixel
  119|       |  // (x_w, y_w) depends on the pixels in the range
  120|       |  // ([x_w - 1, x_w + 2], [y_w - 1, y_w + 2]).
  121|       |  //
  122|       |  // Thus the most extreme coordinates which will be fetched are
  123|       |  // (x0 - 1, y0 - 1) and (x0 + 9, y0 + 9).
  124|  87.4k|  const int x0 = clamp(x + u_int, -9, width);
  125|  87.4k|  const int y0 = clamp(y + v_int, -9, height);
  126|       |
  127|       |  // Horizontal convolution
  128|       |
  129|       |  // Prepare the kernel vectors
  130|       |  // We split the kernel into two vectors with kernel indices:
  131|       |  // 0, 1, 0, 1, 0, 1, 0, 1, and
  132|       |  // 2, 3, 2, 3, 2, 3, 2, 3
  133|  87.4k|  __m256i h_kernel_01 = _mm256_broadcastd_epi32(kernels);
  134|  87.4k|  __m256i h_kernel_23 = _mm256_broadcastd_epi32(_mm_srli_si128(kernels, 8));
  135|       |
  136|  87.4k|  __m256i round_const_h = _mm256_set1_epi32(1 << (DISFLOW_INTERP_BITS - 6 - 1));
  ------------------
  |  |   78|  87.4k|#define DISFLOW_INTERP_BITS 14
  ------------------
  137|       |
  138|   605k|  for (int i = -1; i < DISFLOW_PATCH_SIZE + 2; i += 2) {
  ------------------
  |  |   30|   605k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   605k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  |  Branch (138:20): [True: 517k, False: 87.4k]
  ------------------
  139|   517k|    const int y_w = y0 + i;
  140|   517k|    const uint8_t *ref_row = &ref[y_w * stride + (x0 - 1)];
  141|   517k|    int16_t *tmp_row = &tmp[i * DISFLOW_PATCH_SIZE];
  ------------------
  |  |   30|   517k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   517k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  142|       |
  143|       |    // Load this row of pixels.
  144|       |    // For an 8x8 patch, we need to load the 8 image pixels + 3 extras,
  145|       |    // for a total of 11 pixels. Here we load 16 pixels, but only use
  146|       |    // the first 11.
  147|   517k|    __m256i row =
  148|   517k|        yy_loadu2_128((__m128i *)(ref_row + stride), (__m128i *)ref_row);
  149|       |
  150|       |    // Expand pixels to int16s
  151|       |    // We must use unpacks here, as we have one row in each 128-bit lane
  152|       |    // and want to handle each of those independently.
  153|       |    // This is in contrast to _mm256_cvtepu8_epi16(), which takes a single
  154|       |    // 128-bit input and widens it to 256 bits.
  155|   517k|    __m256i px_0to7_i16 = _mm256_unpacklo_epi8(row, zero);
  156|   517k|    __m256i px_4to10_i16 =
  157|   517k|        _mm256_unpacklo_epi8(_mm256_srli_si256(row, 4), zero);
  158|       |
  159|       |    // Compute first four outputs
  160|       |    // input pixels 0, 1, 1, 2, 2, 3, 3, 4
  161|       |    // * kernel     0, 1, 0, 1, 0, 1, 0, 1
  162|   517k|    __m256i px0 =
  163|   517k|        _mm256_unpacklo_epi16(px_0to7_i16, _mm256_srli_si256(px_0to7_i16, 2));
  164|       |    // input pixels 2, 3, 3, 4, 4, 5, 5, 6
  165|       |    // * kernel     2, 3, 2, 3, 2, 3, 2, 3
  166|   517k|    __m256i px1 = _mm256_unpacklo_epi16(_mm256_srli_si256(px_0to7_i16, 4),
  167|   517k|                                        _mm256_srli_si256(px_0to7_i16, 6));
  168|       |    // Convolve with kernel and sum 2x2 boxes to form first 4 outputs
  169|   517k|    __m256i sum0 = _mm256_add_epi32(_mm256_madd_epi16(px0, h_kernel_01),
  170|   517k|                                    _mm256_madd_epi16(px1, h_kernel_23));
  171|       |
  172|   517k|    __m256i out0 = _mm256_srai_epi32(_mm256_add_epi32(sum0, round_const_h),
  173|   517k|                                     DISFLOW_INTERP_BITS - 6);
  ------------------
  |  |   78|   517k|#define DISFLOW_INTERP_BITS 14
  ------------------
  174|       |
  175|       |    // Compute second four outputs
  176|   517k|    __m256i px2 =
  177|   517k|        _mm256_unpacklo_epi16(px_4to10_i16, _mm256_srli_si256(px_4to10_i16, 2));
  178|   517k|    __m256i px3 = _mm256_unpacklo_epi16(_mm256_srli_si256(px_4to10_i16, 4),
  179|   517k|                                        _mm256_srli_si256(px_4to10_i16, 6));
  180|   517k|    __m256i sum1 = _mm256_add_epi32(_mm256_madd_epi16(px2, h_kernel_01),
  181|   517k|                                    _mm256_madd_epi16(px3, h_kernel_23));
  182|       |
  183|       |    // Round by just enough bits that the result is
  184|       |    // guaranteed to fit into an i16. Then the next stage can use 16 x 16 -> 32
  185|       |    // bit multiplies, which should be a fair bit faster than 32 x 32 -> 32
  186|       |    // as it does now
  187|       |    // This means shifting down so we have 6 extra bits, for a maximum value
  188|       |    // of +18360, which can occur if u_frac == 0.5 and the input pixels are
  189|       |    // {0, 255, 255, 0}.
  190|   517k|    __m256i out1 = _mm256_srai_epi32(_mm256_add_epi32(sum1, round_const_h),
  191|   517k|                                     DISFLOW_INTERP_BITS - 6);
  ------------------
  |  |   78|   517k|#define DISFLOW_INTERP_BITS 14
  ------------------
  192|       |
  193|   517k|    _mm256_storeu_si256((__m256i *)tmp_row, _mm256_packs_epi32(out0, out1));
  194|   517k|  }
  195|       |
  196|       |  // Vertical convolution
  197|  87.4k|  const int round_bits = DISFLOW_INTERP_BITS + 6 - DISFLOW_DERIV_SCALE_LOG2;
  ------------------
  |  |   78|  87.4k|#define DISFLOW_INTERP_BITS 14
  ------------------
                const int round_bits = DISFLOW_INTERP_BITS + 6 - DISFLOW_DERIV_SCALE_LOG2;
  ------------------
  |  |   41|  87.4k|#define DISFLOW_DERIV_SCALE_LOG2 3
  ------------------
  198|  87.4k|  __m256i round_const_v = _mm256_set1_epi32(1 << (round_bits - 1));
  199|       |
  200|  87.4k|  __m256i v_kernel_01 = _mm256_broadcastd_epi32(_mm_srli_si128(kernels, 4));
  201|  87.4k|  __m256i v_kernel_23 = _mm256_broadcastd_epi32(_mm_srli_si128(kernels, 12));
  202|       |
  203|   430k|  for (int i = 0; i < DISFLOW_PATCH_SIZE; i += 2) {
  ------------------
  |  |   30|   430k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   430k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  |  Branch (203:19): [True: 343k, False: 87.4k]
  ------------------
  204|   343k|    int16_t *tmp_row = &tmp[i * DISFLOW_PATCH_SIZE];
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  205|       |
  206|       |    // Load 5 rows of 8 x 16-bit values, and pack into 4 registers
  207|       |    // holding rows {0, 1}, {1, 2}, {2, 3}, {3, 4}
  208|   343k|    __m128i row0 = _mm_loadu_si128((__m128i *)(tmp_row - DISFLOW_PATCH_SIZE));
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  209|   343k|    __m128i row1 = _mm_loadu_si128((__m128i *)tmp_row);
  210|   343k|    __m128i row2 = _mm_loadu_si128((__m128i *)(tmp_row + DISFLOW_PATCH_SIZE));
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  211|   343k|    __m128i row3 =
  212|   343k|        _mm_loadu_si128((__m128i *)(tmp_row + 2 * DISFLOW_PATCH_SIZE));
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  213|   343k|    __m128i row4 =
  214|   343k|        _mm_loadu_si128((__m128i *)(tmp_row + 3 * DISFLOW_PATCH_SIZE));
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  215|       |
  216|   343k|    __m256i px0 = _mm256_set_m128i(row1, row0);
  217|   343k|    __m256i px1 = _mm256_set_m128i(row2, row1);
  218|   343k|    __m256i px2 = _mm256_set_m128i(row3, row2);
  219|   343k|    __m256i px3 = _mm256_set_m128i(row4, row3);
  220|       |
  221|       |    // We want to calculate px0 * v_kernel[0] + px1 * v_kernel[1] + ... ,
  222|       |    // but each multiply expands its output to 32 bits. So we need to be
  223|       |    // a little clever about how we do this
  224|   343k|    __m256i sum0 = _mm256_add_epi32(
  225|   343k|        _mm256_madd_epi16(_mm256_unpacklo_epi16(px0, px1), v_kernel_01),
  226|   343k|        _mm256_madd_epi16(_mm256_unpacklo_epi16(px2, px3), v_kernel_23));
  227|   343k|    __m256i sum1 = _mm256_add_epi32(
  228|   343k|        _mm256_madd_epi16(_mm256_unpackhi_epi16(px0, px1), v_kernel_01),
  229|   343k|        _mm256_madd_epi16(_mm256_unpackhi_epi16(px2, px3), v_kernel_23));
  230|       |
  231|   343k|    __m256i sum0_rounded =
  232|   343k|        _mm256_srai_epi32(_mm256_add_epi32(sum0, round_const_v), round_bits);
  233|   343k|    __m256i sum1_rounded =
  234|   343k|        _mm256_srai_epi32(_mm256_add_epi32(sum1, round_const_v), round_bits);
  235|       |
  236|   343k|    __m256i warped = _mm256_packs_epi32(sum0_rounded, sum1_rounded);
  237|   343k|    __m128i src_pixels_u8 = xx_loadu_2x64(&src[(y + i + 1) * stride + x],
  238|   343k|                                          &src[(y + i) * stride + x]);
  239|   343k|    __m256i src_pixels =
  240|   343k|        _mm256_slli_epi16(_mm256_cvtepu8_epi16(src_pixels_u8), 3);
  241|       |
  242|       |    // Calculate delta from the target patch
  243|   343k|    __m256i dt = _mm256_sub_epi16(warped, src_pixels);
  244|       |
  245|       |    // Load 2x8 elements each of dx and dt, to pair with the 2x8 elements of dt
  246|       |    // that we have just computed. Then compute 2x8 partial sums of dx * dt
  247|       |    // and dy * dt, implicitly sum to give 2x4 partial sums of each, and
  248|       |    // accumulate.
  249|   343k|    __m256i dx_row = _mm256_loadu_si256((__m256i *)&dx[i * DISFLOW_PATCH_SIZE]);
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  250|   343k|    __m256i dy_row = _mm256_loadu_si256((__m256i *)&dy[i * DISFLOW_PATCH_SIZE]);
  ------------------
  |  |   30|   343k|#define DISFLOW_PATCH_SIZE (1 << DISFLOW_PATCH_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   29|   343k|#define DISFLOW_PATCH_SIZE_LOG2 3
  |  |  ------------------
  ------------------
  251|   343k|    b0_acc = _mm256_add_epi32(b0_acc, _mm256_madd_epi16(dx_row, dt));
  252|   343k|    b1_acc = _mm256_add_epi32(b1_acc, _mm256_madd_epi16(dy_row, dt));
  253|   343k|  }
  254|       |
  255|       |  // Flatten the two sets of partial sums to find the final value of b
  256|       |  // We need to set b[0] = sum(b0_acc), b[1] = sum(b1_acc).
  257|       |  // We need to do 14 additions in total; a `hadd` instruction can take care
  258|       |  // of eight of them, then a vertical sum can do four more, leaving two
  259|       |  // scalar additions.
  260|  87.4k|  __m256i partial_sum_256 = _mm256_hadd_epi32(b0_acc, b1_acc);
  261|  87.4k|  __m128i partial_sum =
  262|  87.4k|      _mm_add_epi32(_mm256_extracti128_si256(partial_sum_256, 0),
  263|  87.4k|                    _mm256_extracti128_si256(partial_sum_256, 1));
  264|  87.4k|  b[0] = _mm_extract_epi32(partial_sum, 0) + _mm_extract_epi32(partial_sum, 1);
  265|  87.4k|  b[1] = _mm_extract_epi32(partial_sum, 2) + _mm_extract_epi32(partial_sum, 3);
  266|  87.4k|}
disflow_avx2.c:compute_cubic_kernels:
   33|  87.3k|static inline __m128i compute_cubic_kernels(double u, double v) {
   34|  87.3k|  const __m128d x = _mm_set_pd(v, u);
   35|       |
   36|  87.3k|  const __m128d x2 = _mm_mul_pd(x, x);
   37|  87.3k|  const __m128d x3 = _mm_mul_pd(x2, x);
   38|       |
   39|       |  // Macro to multiply a value v by a constant coefficient c
   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
   41|       |
   42|       |  // Compute floating-point kernel
   43|       |  // Note: To ensure results are bit-identical to the C code, we need to perform
   44|       |  // exactly the same sequence of operations here as in the C code.
   45|  87.3k|  __m128d k0 = _mm_sub_pd(_mm_add_pd(MULC(-0.5, x), x2), MULC(0.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
                __m128d k0 = _mm_sub_pd(_mm_add_pd(MULC(-0.5, x), x2), MULC(0.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
   46|  87.3k|  __m128d k1 =
   47|  87.3k|      _mm_add_pd(_mm_sub_pd(_mm_set1_pd(1.0), MULC(2.5, x2)), MULC(1.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
                    _mm_add_pd(_mm_sub_pd(_mm_set1_pd(1.0), MULC(2.5, x2)), MULC(1.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
   48|  87.3k|  __m128d k2 =
   49|  87.3k|      _mm_sub_pd(_mm_add_pd(MULC(0.5, x), MULC(2.0, x2)), MULC(1.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
                    _mm_sub_pd(_mm_add_pd(MULC(0.5, x), MULC(2.0, x2)), MULC(1.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
                    _mm_sub_pd(_mm_add_pd(MULC(0.5, x), MULC(2.0, x2)), MULC(1.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
   50|  87.3k|  __m128d k3 = _mm_add_pd(MULC(-0.5, x2), MULC(0.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
                __m128d k3 = _mm_add_pd(MULC(-0.5, x2), MULC(0.5, x3));
  ------------------
  |  |   40|  87.3k|#define MULC(c, v) _mm_mul_pd(_mm_set1_pd(c), v)
  ------------------
   51|  87.3k|#undef MULC
   52|       |
   53|       |  // Integerize
   54|  87.3k|  __m128d prec = _mm_set1_pd((double)(1 << DISFLOW_INTERP_BITS));
  ------------------
  |  |   78|  87.3k|#define DISFLOW_INTERP_BITS 14
  ------------------
   55|       |
   56|  87.3k|  k0 = _mm_round_pd(_mm_mul_pd(k0, prec),
   57|  87.3k|                    _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
   58|  87.3k|  k1 = _mm_round_pd(_mm_mul_pd(k1, prec),
   59|  87.3k|                    _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
   60|  87.3k|  k2 = _mm_round_pd(_mm_mul_pd(k2, prec),
   61|  87.3k|                    _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
   62|  87.3k|  k3 = _mm_round_pd(_mm_mul_pd(k3, prec),
   63|  87.3k|                    _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
   64|       |
   65|  87.3k|  const __m128i c0 = _mm_cvtpd_epi32(k0);
   66|  87.3k|  const __m128i c1 = _mm_cvtpd_epi32(k1);
   67|  87.3k|  const __m128i c2 = _mm_cvtpd_epi32(k2);
   68|  87.3k|  const __m128i c3 = _mm_cvtpd_epi32(k3);
   69|       |
   70|       |  // Rearrange results and convert down to 16 bits, giving the target output
   71|       |  // ordering
   72|  87.3k|  const __m128i c01 = _mm_unpacklo_epi32(c0, c1);
   73|  87.3k|  const __m128i c23 = _mm_unpacklo_epi32(c2, c3);
   74|  87.3k|  return _mm_packs_epi32(c01, c23);
   75|  87.3k|}

aom_highbd_smooth_predictor_4x4_c:
  737|   417k|      const uint16_t *left, int bd) {                                       \
  738|   417k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   417k|  }
aom_highbd_smooth_predictor_8x8_c:
  737|  63.2k|      const uint16_t *left, int bd) {                                       \
  738|  63.2k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  63.2k|  }
aom_highbd_smooth_predictor_16x16_c:
  737|     39|      const uint16_t *left, int bd) {                                       \
  738|     39|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|     39|  }
aom_highbd_smooth_predictor_4x8_c:
  737|   102k|      const uint16_t *left, int bd) {                                       \
  738|   102k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   102k|  }
aom_highbd_smooth_predictor_8x4_c:
  737|  43.7k|      const uint16_t *left, int bd) {                                       \
  738|  43.7k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  43.7k|  }
aom_highbd_smooth_v_predictor_4x4_c:
  737|   406k|      const uint16_t *left, int bd) {                                       \
  738|   406k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   406k|  }
aom_highbd_smooth_v_predictor_8x8_c:
  737|  60.7k|      const uint16_t *left, int bd) {                                       \
  738|  60.7k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  60.7k|  }
aom_highbd_smooth_v_predictor_4x8_c:
  737|  98.4k|      const uint16_t *left, int bd) {                                       \
  738|  98.4k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  98.4k|  }
aom_highbd_smooth_v_predictor_8x4_c:
  737|  41.4k|      const uint16_t *left, int bd) {                                       \
  738|  41.4k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  41.4k|  }
aom_highbd_smooth_h_predictor_4x4_c:
  737|   402k|      const uint16_t *left, int bd) {                                       \
  738|   402k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   402k|  }
aom_highbd_smooth_h_predictor_8x8_c:
  737|  63.1k|      const uint16_t *left, int bd) {                                       \
  738|  63.1k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  63.1k|  }
aom_highbd_smooth_h_predictor_4x8_c:
  737|  97.3k|      const uint16_t *left, int bd) {                                       \
  738|  97.3k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  97.3k|  }
aom_highbd_smooth_h_predictor_8x4_c:
  737|  41.9k|      const uint16_t *left, int bd) {                                       \
  738|  41.9k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  41.9k|  }
aom_highbd_paeth_predictor_4x4_c:
  737|  1.21M|      const uint16_t *left, int bd) {                                       \
  738|  1.21M|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  1.21M|  }
aom_highbd_paeth_predictor_8x8_c:
  737|   479k|      const uint16_t *left, int bd) {                                       \
  738|   479k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   479k|  }
aom_highbd_paeth_predictor_16x16_c:
  737|  12.9k|      const uint16_t *left, int bd) {                                       \
  738|  12.9k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  12.9k|  }
aom_highbd_paeth_predictor_4x8_c:
  737|   122k|      const uint16_t *left, int bd) {                                       \
  738|   122k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|   122k|  }
aom_highbd_paeth_predictor_8x4_c:
  737|  83.8k|      const uint16_t *left, int bd) {                                       \
  738|  83.8k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  83.8k|  }
aom_highbd_paeth_predictor_8x16_c:
  737|  9.98k|      const uint16_t *left, int bd) {                                       \
  738|  9.98k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  9.98k|  }
aom_highbd_paeth_predictor_16x8_c:
  737|  9.83k|      const uint16_t *left, int bd) {                                       \
  738|  9.83k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  9.83k|  }
aom_highbd_paeth_predictor_16x32_c:
  737|  1.37k|      const uint16_t *left, int bd) {                                       \
  738|  1.37k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  1.37k|  }
aom_highbd_paeth_predictor_32x16_c:
  737|  1.61k|      const uint16_t *left, int bd) {                                       \
  738|  1.61k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  1.61k|  }
aom_highbd_dc_128_predictor_64x64_c:
  737|    222|      const uint16_t *left, int bd) {                                       \
  738|    222|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|    222|  }
aom_highbd_dc_128_predictor_32x64_c:
  737|  1.05k|      const uint16_t *left, int bd) {                                       \
  738|  1.05k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  1.05k|  }
aom_highbd_dc_128_predictor_64x32_c:
  737|  1.22k|      const uint16_t *left, int bd) {                                       \
  738|  1.22k|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|  1.22k|  }
aom_highbd_dc_left_predictor_64x64_c:
  737|      6|      const uint16_t *left, int bd) {                                       \
  738|      6|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|      6|  }
aom_highbd_dc_left_predictor_32x64_c:
  737|      2|      const uint16_t *left, int bd) {                                       \
  738|      2|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|      2|  }
aom_highbd_dc_left_predictor_64x32_c:
  737|    112|      const uint16_t *left, int bd) {                                       \
  738|    112|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|    112|  }
aom_highbd_dc_top_predictor_64x64_c:
  737|      2|      const uint16_t *left, int bd) {                                       \
  738|      2|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|      2|  }
aom_highbd_dc_top_predictor_32x64_c:
  737|     71|      const uint16_t *left, int bd) {                                       \
  738|     71|    highbd_##type##_predictor(dst, stride, width, height, above, left, bd); \
  739|     71|  }
intrapred.c:highbd_smooth_predictor:
  412|   627k|                                           const uint16_t *left, int bd) {
  413|   627k|  (void)bd;
  414|   627k|  const uint16_t below_pred = left[bh - 1];   // estimated by bottom-left pixel
  415|   627k|  const uint16_t right_pred = above[bw - 1];  // estimated by top-right pixel
  416|   627k|  const uint8_t *const sm_weights_w = smooth_weights + bw - 4;
  417|   627k|  const uint8_t *const sm_weights_h = smooth_weights + bh - 4;
  418|       |  // scale = 2 * 2^SMOOTH_WEIGHT_LOG2_SCALE
  419|   627k|  const int log2_scale = 1 + SMOOTH_WEIGHT_LOG2_SCALE;
  ------------------
  |  |   19|   627k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  420|   627k|  const uint16_t scale = (1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   627k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  421|   627k|  sm_weights_sanity_checks(sm_weights_w, sm_weights_h, scale,
  ------------------
  |  |   76|   627k|  assert(weights_w[0] < weights_scale);                               \
  |  |   77|   627k|  assert(weights_h[0] < weights_scale);                               \
  |  |   78|   627k|  assert(weights_scale - weights_w[bw - 1] < weights_scale);          \
  |  |   79|   627k|  assert(weights_scale - weights_h[bh - 1] < weights_scale);          \
  |  |   80|   627k|  assert(pred_scale < 31)  // ensures no overflow when calculating predictor.
  ------------------
  422|   627k|                           log2_scale + sizeof(*dst));
  423|   627k|  int r;
  424|  3.80M|  for (r = 0; r < bh; ++r) {
  ------------------
  |  Branch (424:15): [True: 3.17M, False: 627k]
  ------------------
  425|  3.17M|    int c;
  426|  18.6M|    for (c = 0; c < bw; ++c) {
  ------------------
  |  Branch (426:17): [True: 15.4M, False: 3.17M]
  ------------------
  427|  15.4M|      const uint16_t pixels[] = { above[c], below_pred, left[r], right_pred };
  428|  15.4M|      const uint8_t weights[] = { sm_weights_h[r], scale - sm_weights_h[r],
  429|  15.4M|                                  sm_weights_w[c], scale - sm_weights_w[c] };
  430|  15.4M|      uint32_t this_pred = 0;
  431|  15.4M|      int i;
  432|  15.4M|      assert(scale >= sm_weights_h[r] && scale >= sm_weights_w[c]);
  433|  77.1M|      for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (433:19): [True: 61.7M, False: 15.4M]
  ------------------
  434|  61.7M|        this_pred += weights[i] * pixels[i];
  435|  61.7M|      }
  436|  15.4M|      dst[c] = divide_round(this_pred, log2_scale);
  ------------------
  |  |   82|  15.4M|#define divide_round(value, bits) (((value) + (1 << ((bits) - 1))) >> (bits))
  ------------------
  437|  15.4M|    }
  438|  3.17M|    dst += stride;
  439|  3.17M|  }
  440|   627k|}
intrapred.c:highbd_smooth_v_predictor:
  445|   606k|                                             const uint16_t *left, int bd) {
  446|   606k|  (void)bd;
  447|   606k|  const uint16_t below_pred = left[bh - 1];  // estimated by bottom-left pixel
  448|   606k|  const uint8_t *const sm_weights = smooth_weights + bh - 4;
  449|       |  // scale = 2^SMOOTH_WEIGHT_LOG2_SCALE
  450|   606k|  const int log2_scale = SMOOTH_WEIGHT_LOG2_SCALE;
  ------------------
  |  |   19|   606k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  451|   606k|  const uint16_t scale = (1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   606k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  452|   606k|  sm_weights_sanity_checks(sm_weights, sm_weights, scale,
  ------------------
  |  |   76|   606k|  assert(weights_w[0] < weights_scale);                               \
  |  |   77|   606k|  assert(weights_h[0] < weights_scale);                               \
  |  |   78|   606k|  assert(weights_scale - weights_w[bw - 1] < weights_scale);          \
  |  |   79|   606k|  assert(weights_scale - weights_h[bh - 1] < weights_scale);          \
  |  |   80|   606k|  assert(pred_scale < 31)  // ensures no overflow when calculating predictor.
  ------------------
  453|   606k|                           log2_scale + sizeof(*dst));
  454|       |
  455|   606k|  int r;
  456|  3.67M|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (456:15): [True: 3.06M, False: 606k]
  ------------------
  457|  3.06M|    int c;
  458|  17.9M|    for (c = 0; c < bw; ++c) {
  ------------------
  |  Branch (458:17): [True: 14.8M, False: 3.06M]
  ------------------
  459|  14.8M|      const uint16_t pixels[] = { above[c], below_pred };
  460|  14.8M|      const uint8_t weights[] = { sm_weights[r], scale - sm_weights[r] };
  461|  14.8M|      uint32_t this_pred = 0;
  462|  14.8M|      assert(scale >= sm_weights[r]);
  463|  14.8M|      int i;
  464|  44.5M|      for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (464:19): [True: 29.7M, False: 14.8M]
  ------------------
  465|  29.7M|        this_pred += weights[i] * pixels[i];
  466|  29.7M|      }
  467|  14.8M|      dst[c] = divide_round(this_pred, log2_scale);
  ------------------
  |  |   82|  14.8M|#define divide_round(value, bits) (((value) + (1 << ((bits) - 1))) >> (bits))
  ------------------
  468|  14.8M|    }
  469|  3.06M|    dst += stride;
  470|  3.06M|  }
  471|   606k|}
intrapred.c:highbd_smooth_h_predictor:
  476|   604k|                                             const uint16_t *left, int bd) {
  477|   604k|  (void)bd;
  478|   604k|  const uint16_t right_pred = above[bw - 1];  // estimated by top-right pixel
  479|   604k|  const uint8_t *const sm_weights = smooth_weights + bw - 4;
  480|       |  // scale = 2^SMOOTH_WEIGHT_LOG2_SCALE
  481|   604k|  const int log2_scale = SMOOTH_WEIGHT_LOG2_SCALE;
  ------------------
  |  |   19|   604k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  482|   604k|  const uint16_t scale = (1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   604k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  483|   604k|  sm_weights_sanity_checks(sm_weights, sm_weights, scale,
  ------------------
  |  |   76|   604k|  assert(weights_w[0] < weights_scale);                               \
  |  |   77|   604k|  assert(weights_h[0] < weights_scale);                               \
  |  |   78|   604k|  assert(weights_scale - weights_w[bw - 1] < weights_scale);          \
  |  |   79|   604k|  assert(weights_scale - weights_h[bh - 1] < weights_scale);          \
  |  |   80|   604k|  assert(pred_scale < 31)  // ensures no overflow when calculating predictor.
  ------------------
  484|   604k|                           log2_scale + sizeof(*dst));
  485|       |
  486|   604k|  int r;
  487|  3.66M|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (487:15): [True: 3.06M, False: 604k]
  ------------------
  488|  3.06M|    int c;
  489|  17.9M|    for (c = 0; c < bw; ++c) {
  ------------------
  |  Branch (489:17): [True: 14.9M, False: 3.06M]
  ------------------
  490|  14.9M|      const uint16_t pixels[] = { left[r], right_pred };
  491|  14.9M|      const uint8_t weights[] = { sm_weights[c], scale - sm_weights[c] };
  492|  14.9M|      uint32_t this_pred = 0;
  493|  14.9M|      assert(scale >= sm_weights[c]);
  494|  14.9M|      int i;
  495|  44.8M|      for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (495:19): [True: 29.8M, False: 14.9M]
  ------------------
  496|  29.8M|        this_pred += weights[i] * pixels[i];
  497|  29.8M|      }
  498|  14.9M|      dst[c] = divide_round(this_pred, log2_scale);
  ------------------
  |  |   82|  14.9M|#define divide_round(value, bits) (((value) + (1 << ((bits) - 1))) >> (bits))
  ------------------
  499|  14.9M|    }
  500|  3.06M|    dst += stride;
  501|  3.06M|  }
  502|   604k|}
intrapred.c:paeth_predictor_single:
   48|  64.0M|                                              uint16_t top_left) {
   49|  64.0M|  const int base = top + left - top_left;
   50|  64.0M|  const int p_left = abs_diff(base, left);
   51|  64.0M|  const int p_top = abs_diff(base, top);
   52|  64.0M|  const int p_top_left = abs_diff(base, top_left);
   53|       |
   54|       |  // Return nearest to base of left, top and top_left.
   55|  64.0M|  return (p_left <= p_top && p_left <= p_top_left) ? left
  ------------------
  |  Branch (55:11): [True: 42.7M, False: 21.2M]
  |  Branch (55:30): [True: 32.8M, False: 9.92M]
  ------------------
   56|  64.0M|         : (p_top <= p_top_left)                   ? top
  ------------------
  |  Branch (56:12): [True: 20.5M, False: 10.6M]
  ------------------
   57|  31.1M|                                                   : top_left;
   58|  64.0M|}
intrapred.c:abs_diff:
   45|   192M|static inline int abs_diff(int a, int b) { return (a > b) ? a - b : b - a; }
  ------------------
  |  Branch (45:51): [True: 59.9M, False: 132M]
  ------------------
intrapred.c:highbd_paeth_predictor:
  397|  1.93M|                                          const uint16_t *left, int bd) {
  398|  1.93M|  int r, c;
  399|  1.93M|  const uint16_t ytop_left = above[-1];
  400|  1.93M|  (void)bd;
  401|       |
  402|  12.4M|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (402:15): [True: 10.5M, False: 1.93M]
  ------------------
  403|  74.5M|    for (c = 0; c < bw; c++)
  ------------------
  |  Branch (403:17): [True: 64.0M, False: 10.5M]
  ------------------
  404|  64.0M|      dst[c] = paeth_predictor_single(left[r], above[c], ytop_left);
  405|  10.5M|    dst += stride;
  406|  10.5M|  }
  407|  1.93M|}
intrapred.c:highbd_dc_128_predictor:
  507|  2.49k|                                           const uint16_t *left, int bd) {
  508|  2.49k|  int r;
  509|  2.49k|  (void)above;
  510|  2.49k|  (void)left;
  511|       |
  512|   123k|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (512:15): [True: 120k, False: 2.49k]
  ------------------
  513|   120k|    aom_memset16(dst, 128 << (bd - 8), bw);
  514|   120k|    dst += stride;
  515|   120k|  }
  516|  2.49k|}
intrapred.c:highbd_dc_left_predictor:
  521|    120|                                            const uint16_t *left, int bd) {
  522|    120|  int i, r, expected_dc, sum = 0;
  523|    120|  (void)above;
  524|    120|  (void)bd;
  525|       |
  526|  4.21k|  for (i = 0; i < bh; i++) sum += left[i];
  ------------------
  |  Branch (526:15): [True: 4.09k, False: 120]
  ------------------
  527|    120|  expected_dc = (sum + (bh >> 1)) / bh;
  528|       |
  529|  4.21k|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (529:15): [True: 4.09k, False: 120]
  ------------------
  530|  4.09k|    aom_memset16(dst, expected_dc, bw);
  531|  4.09k|    dst += stride;
  532|  4.09k|  }
  533|    120|}
intrapred.c:highbd_dc_top_predictor:
  538|     73|                                           const uint16_t *left, int bd) {
  539|     73|  int i, r, expected_dc, sum = 0;
  540|     73|  (void)left;
  541|     73|  (void)bd;
  542|       |
  543|  2.47k|  for (i = 0; i < bw; i++) sum += above[i];
  ------------------
  |  Branch (543:15): [True: 2.40k, False: 73]
  ------------------
  544|     73|  expected_dc = (sum + (bw >> 1)) / bw;
  545|       |
  546|  4.74k|  for (r = 0; r < bh; r++) {
  ------------------
  |  Branch (546:15): [True: 4.67k, False: 73]
  ------------------
  547|  4.67k|    aom_memset16(dst, expected_dc, bw);
  548|  4.67k|    dst += stride;
  549|  4.67k|  }
  550|     73|}

ransac.c:least_squares_init:
   84|  5.71k|static inline void least_squares_init(double *mat, double *y, int n) {
   85|  5.71k|  memset(mat, 0, n * n * sizeof(double));
   86|  5.71k|  memset(y, 0, n * sizeof(double));
   87|  5.71k|}
ransac.c:least_squares_accumulate:
   96|  27.4k|                                            const double *a, double b, int n) {
   97|   137k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (97:19): [True: 109k, False: 27.4k]
  ------------------
   98|   549k|    for (int j = 0; j < n; j++) {
  ------------------
  |  Branch (98:21): [True: 439k, False: 109k]
  ------------------
   99|   439k|      mat[i * n + j] += a[i] * a[j];
  100|   439k|    }
  101|   109k|  }
  102|   137k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (102:19): [True: 109k, False: 27.4k]
  ------------------
  103|   109k|    y[i] += a[i] * b;
  104|   109k|  }
  105|  27.4k|}
ransac.c:least_squares_solve:
  108|  5.72k|                                      int n) {
  109|  5.72k|  return linsolve(n, mat, n, y, x);
  110|  5.72k|}
ransac.c:linsolve:
   24|  5.72k|static inline int linsolve(int n, double *A, int stride, double *b, double *x) {
   25|  5.72k|  int i, j, k;
   26|  5.72k|  double c;
   27|       |  // Forward elimination
   28|  22.8k|  for (k = 0; k < n - 1; k++) {
  ------------------
  |  Branch (28:15): [True: 17.1k, False: 5.72k]
  ------------------
   29|       |    // Bring the largest magnitude to the diagonal position
   30|  51.2k|    for (i = n - 1; i > k; i--) {
  ------------------
  |  Branch (30:21): [True: 34.1k, False: 17.1k]
  ------------------
   31|  34.1k|      if (fabs(A[(i - 1) * stride + k]) < fabs(A[i * stride + k])) {
  ------------------
  |  Branch (31:11): [True: 29.4k, False: 4.60k]
  ------------------
   32|   147k|        for (j = 0; j < n; j++) {
  ------------------
  |  Branch (32:21): [True: 117k, False: 29.4k]
  ------------------
   33|   117k|          c = A[i * stride + j];
   34|   117k|          A[i * stride + j] = A[(i - 1) * stride + j];
   35|   117k|          A[(i - 1) * stride + j] = c;
   36|   117k|        }
   37|  29.4k|        c = b[i];
   38|  29.4k|        b[i] = b[i - 1];
   39|  29.4k|        b[i - 1] = c;
   40|  29.4k|      }
   41|  34.1k|    }
   42|  51.3k|    for (i = k; i < n - 1; i++) {
  ------------------
  |  Branch (42:17): [True: 34.2k, False: 17.1k]
  ------------------
   43|  34.2k|      if (fabs(A[k * stride + k]) < TINY_NEAR_ZERO) return 0;
  ------------------
  |  Branch (43:11): [True: 0, False: 34.2k]
  ------------------
   44|  34.2k|      c = A[(i + 1) * stride + k] / A[k * stride + k];
   45|   171k|      for (j = 0; j < n; j++) A[(i + 1) * stride + j] -= c * A[k * stride + j];
  ------------------
  |  Branch (45:19): [True: 136k, False: 34.2k]
  ------------------
   46|  34.2k|      b[i + 1] -= c * b[k];
   47|  34.2k|    }
   48|  17.1k|  }
   49|       |  // Backward substitution
   50|  28.5k|  for (i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (50:19): [True: 22.8k, False: 5.72k]
  ------------------
   51|  22.8k|    if (fabs(A[i * stride + i]) < TINY_NEAR_ZERO) return 0;
  ------------------
  |  Branch (51:9): [True: 0, False: 22.8k]
  ------------------
   52|  22.8k|    c = 0;
   53|  57.1k|    for (j = i + 1; j <= n - 1; j++) c += A[i * stride + j] * x[j];
  ------------------
  |  Branch (53:21): [True: 34.2k, False: 22.8k]
  ------------------
   54|  22.8k|    x[i] = (b[i] - c) / A[i * stride + i];
   55|  22.8k|  }
   56|       |
   57|  5.72k|  return 1;
   58|  5.72k|}

decodeframe.c:update_cdf:
  110|  1.64M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  1.64M|  assert(nsymbs < 17);
  112|  1.64M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  1.64M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  1.64M|  int i = 0;
  130|  5.13M|  do {
  131|  5.13M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 809k, False: 4.32M]
  ------------------
  132|   809k|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|   809k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   809k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  4.32M|    } else {
  134|  4.32M|      cdf[i] -= cdf[i] >> rate;
  135|  4.32M|    }
  136|  5.13M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 3.48M, False: 1.64M]
  ------------------
  137|  1.64M|  cdf[nsymbs] += (count < 32);
  138|  1.64M|}
decodemv.c:update_cdf:
  110|  6.80M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  6.80M|  assert(nsymbs < 17);
  112|  6.80M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  6.80M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  6.80M|  int i = 0;
  130|  30.6M|  do {
  131|  30.6M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 10.0M, False: 20.5M]
  ------------------
  132|  10.0M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  10.0M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  10.0M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  20.5M|    } else {
  134|  20.5M|      cdf[i] -= cdf[i] >> rate;
  135|  20.5M|    }
  136|  30.6M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 23.8M, False: 6.80M]
  ------------------
  137|  6.80M|  cdf[nsymbs] += (count < 32);
  138|  6.80M|}
decodetxb.c:update_cdf:
  110|  79.6M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  79.6M|  assert(nsymbs < 17);
  112|  79.6M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  79.6M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  79.6M|  int i = 0;
  130|   233M|  do {
  131|   233M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 154M, False: 79.9M]
  ------------------
  132|   154M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|   154M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   154M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|   154M|    } else {
  134|  79.9M|      cdf[i] -= cdf[i] >> rate;
  135|  79.9M|    }
  136|   233M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 154M, False: 79.6M]
  ------------------
  137|  79.6M|  cdf[nsymbs] += (count < 32);
  138|  79.6M|}
detokenize.c:update_cdf:
  110|  1.26M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  1.26M|  assert(nsymbs < 17);
  112|  1.26M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  1.26M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  1.26M|  int i = 0;
  130|  4.53M|  do {
  131|  4.53M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 1.47M, False: 3.05M]
  ------------------
  132|  1.47M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  1.47M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  1.47M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  3.05M|    } else {
  134|  3.05M|      cdf[i] -= cdf[i] >> rate;
  135|  3.05M|    }
  136|  4.53M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 3.27M, False: 1.26M]
  ------------------
  137|  1.26M|  cdf[nsymbs] += (count < 32);
  138|  1.26M|}
bitstream.c:update_cdf:
  110|  22.5M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  22.5M|  assert(nsymbs < 17);
  112|  22.5M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  22.5M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  22.5M|  int i = 0;
  130|  96.0M|  do {
  131|  96.0M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 29.4M, False: 66.6M]
  ------------------
  132|  29.4M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  29.4M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  29.4M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  66.6M|    } else {
  134|  66.6M|      cdf[i] -= cdf[i] >> rate;
  135|  66.6M|    }
  136|  96.0M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 73.5M, False: 22.5M]
  ------------------
  137|  22.5M|  cdf[nsymbs] += (count < 32);
  138|  22.5M|}
encodeframe_utils.c:update_cdf:
  110|  6.95M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  6.95M|  assert(nsymbs < 17);
  112|  6.95M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  6.95M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  6.95M|  int i = 0;
  130|  52.2M|  do {
  131|  52.2M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 10.3M, False: 41.9M]
  ------------------
  132|  10.3M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  10.3M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  10.3M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  41.9M|    } else {
  134|  41.9M|      cdf[i] -= cdf[i] >> rate;
  135|  41.9M|    }
  136|  52.2M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 45.2M, False: 6.95M]
  ------------------
  137|  6.95M|  cdf[nsymbs] += (count < 32);
  138|  6.95M|}
encodemv.c:update_cdf:
  110|  5.50M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  5.50M|  assert(nsymbs < 17);
  112|  5.50M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  5.50M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  5.50M|  int i = 0;
  130|  17.6M|  do {
  131|  17.6M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 5.25M, False: 12.3M]
  ------------------
  132|  5.25M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  5.25M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  5.25M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  12.3M|    } else {
  134|  12.3M|      cdf[i] -= cdf[i] >> rate;
  135|  12.3M|    }
  136|  17.6M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 12.1M, False: 5.50M]
  ------------------
  137|  5.50M|  cdf[nsymbs] += (count < 32);
  138|  5.50M|}
encodetxb.c:update_cdf:
  110|   523M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|   523M|  assert(nsymbs < 17);
  112|   523M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|   523M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|   523M|  int i = 0;
  130|  1.54G|  do {
  131|  1.54G|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 971M, False: 571M]
  ------------------
  132|   971M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|   971M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   971M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|   971M|    } else {
  134|   571M|      cdf[i] -= cdf[i] >> rate;
  135|   571M|    }
  136|  1.54G|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 1.01G, False: 523M]
  ------------------
  137|   523M|  cdf[nsymbs] += (count < 32);
  138|   523M|}
partition_search.c:update_cdf:
  110|  10.9M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  10.9M|  assert(nsymbs < 17);
  112|  10.9M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  10.9M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  10.9M|  int i = 0;
  130|  17.7M|  do {
  131|  17.7M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 2.47M, False: 15.2M]
  ------------------
  132|  2.47M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  2.47M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  2.47M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  15.2M|    } else {
  134|  15.2M|      cdf[i] -= cdf[i] >> rate;
  135|  15.2M|    }
  136|  17.7M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 6.80M, False: 10.9M]
  ------------------
  137|  10.9M|  cdf[nsymbs] += (count < 32);
  138|  10.9M|}
partition_search.c:get_prob:
  100|   304k|static inline uint8_t get_prob(unsigned int num, unsigned int den) {
  101|   304k|  assert(den != 0);
  102|   304k|  {
  103|   304k|    const int p = (int)(((uint64_t)num * 256 + (den >> 1)) / den);
  104|       |    // (p > 255) ? 255 : (p < 1) ? 1 : p;
  105|   304k|    const int clipped_prob = p | ((255 - p) >> 23) | (p == 0);
  106|   304k|    return (uint8_t)clipped_prob;
  107|   304k|  }
  108|   304k|}
tokenize.c:update_cdf:
  110|  3.65M|static inline void update_cdf(aom_cdf_prob *cdf, int8_t val, int nsymbs) {
  111|  3.65M|  assert(nsymbs < 17);
  112|  3.65M|  const int count = cdf[nsymbs];
  113|       |
  114|       |  // rate is computed in the spec as:
  115|       |  //  3 + ( cdf[N] > 15 ) + ( cdf[N] > 31 ) + Min(FloorLog2(N), 2)
  116|       |  // In this case cdf[N] is |count|.
  117|       |  // Min(FloorLog2(N), 2) is 1 for nsymbs == {2, 3} and 2 for all
  118|       |  // nsymbs > 3. So the equation becomes:
  119|       |  //  4 + (count > 15) + (count > 31) + (nsymbs > 3).
  120|       |  // Note that the largest value for count is 32 (it is not incremented beyond
  121|       |  // 32). So using that information:
  122|       |  //  count >> 4 is 0 for count from 0 to 15.
  123|       |  //  count >> 4 is 1 for count from 16 to 31.
  124|       |  //  count >> 4 is 2 for count == 31.
  125|       |  // Now, the equation becomes:
  126|       |  //  4 + (count >> 4) + (nsymbs > 3).
  127|  3.65M|  const int rate = 4 + (count >> 4) + (nsymbs > 3);
  128|       |
  129|  3.65M|  int i = 0;
  130|  13.1M|  do {
  131|  13.1M|    if (i < val) {
  ------------------
  |  Branch (131:9): [True: 4.21M, False: 8.91M]
  ------------------
  132|  4.21M|      cdf[i] += (CDF_PROB_TOP - cdf[i]) >> rate;
  ------------------
  |  |   33|  4.21M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  4.21M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  133|  8.91M|    } else {
  134|  8.91M|      cdf[i] -= cdf[i] >> rate;
  135|  8.91M|    }
  136|  13.1M|  } while (++i < nsymbs - 1);
  ------------------
  |  Branch (136:12): [True: 9.48M, False: 3.65M]
  ------------------
  137|  3.65M|  cdf[nsymbs] += (count < 32);
  138|  3.65M|}
cost.c:get_prob:
  100|   907M|static inline uint8_t get_prob(unsigned int num, unsigned int den) {
  101|   907M|  assert(den != 0);
  102|   907M|  {
  103|   907M|    const int p = (int)(((uint64_t)num * 256 + (den >> 1)) / den);
  104|       |    // (p > 255) ? 255 : (p < 1) ? 1 : p;
  105|   907M|    const int clipped_prob = p | ((255 - p) >> 23) | (p == 0);
  106|   907M|    return (uint8_t)clipped_prob;
  107|   907M|  }
  108|   907M|}

aom_get_y_var:
  163|  8.25k|                       int vstart, int height) {
  164|  8.25k|  return aom_var_2d_u8(a->y_buffer + vstart * a->y_stride + hstart, a->y_stride,
  165|  8.25k|                       width, height) /
  166|  8.25k|         (width * height);
  167|  8.25k|}
aom_get_u_var:
  170|    734|                       int vstart, int height) {
  171|    734|  return aom_var_2d_u8(a->u_buffer + vstart * a->uv_stride + hstart,
  172|    734|                       a->uv_stride, width, height) /
  173|    734|         (width * height);
  174|    734|}
aom_get_v_var:
  177|    734|                       int vstart, int height) {
  178|    734|  return aom_var_2d_u8(a->v_buffer + vstart * a->uv_stride + hstart,
  179|    734|                       a->uv_stride, width, height) /
  180|    734|         (width * height);
  181|    734|}
aom_get_y_sse_part:
  185|  13.2k|                           int vstart, int height) {
  186|  13.2k|  return get_sse(a->y_buffer + vstart * a->y_stride + hstart, a->y_stride,
  187|  13.2k|                 b->y_buffer + vstart * b->y_stride + hstart, b->y_stride,
  188|  13.2k|                 width, height);
  189|  13.2k|}
aom_get_y_sse:
  192|  86.5k|                      const YV12_BUFFER_CONFIG *b) {
  193|  86.5k|  assert(a->y_crop_width == b->y_crop_width);
  194|  86.5k|  assert(a->y_crop_height == b->y_crop_height);
  195|       |
  196|  86.5k|  return get_sse(a->y_buffer, a->y_stride, b->y_buffer, b->y_stride,
  197|  86.5k|                 a->y_crop_width, a->y_crop_height);
  198|  86.5k|}
aom_get_u_sse_part:
  202|  1.11k|                           int vstart, int height) {
  203|  1.11k|  return get_sse(a->u_buffer + vstart * a->uv_stride + hstart, a->uv_stride,
  204|  1.11k|                 b->u_buffer + vstart * b->uv_stride + hstart, b->uv_stride,
  205|  1.11k|                 width, height);
  206|  1.11k|}
aom_get_u_sse:
  209|  32.2k|                      const YV12_BUFFER_CONFIG *b) {
  210|  32.2k|  assert(a->uv_crop_width == b->uv_crop_width);
  211|  32.2k|  assert(a->uv_crop_height == b->uv_crop_height);
  212|       |
  213|  32.2k|  return get_sse(a->u_buffer, a->uv_stride, b->u_buffer, b->uv_stride,
  214|  32.2k|                 a->uv_crop_width, a->uv_crop_height);
  215|  32.2k|}
aom_get_v_sse_part:
  219|  1.11k|                           int vstart, int height) {
  220|  1.11k|  return get_sse(a->v_buffer + vstart * a->uv_stride + hstart, a->uv_stride,
  221|  1.11k|                 b->v_buffer + vstart * b->uv_stride + hstart, b->uv_stride,
  222|  1.11k|                 width, height);
  223|  1.11k|}
aom_get_v_sse:
  226|  32.1k|                      const YV12_BUFFER_CONFIG *b) {
  227|  32.1k|  assert(a->uv_crop_width == b->uv_crop_width);
  228|  32.1k|  assert(a->uv_crop_height == b->uv_crop_height);
  229|       |
  230|  32.1k|  return get_sse(a->v_buffer, a->uv_stride, b->v_buffer, b->uv_stride,
  231|  32.1k|                 a->uv_crop_width, a->uv_crop_height);
  232|  32.1k|}
aom_highbd_get_y_var:
  236|  2.12k|                              int width, int vstart, int height) {
  237|  2.12k|  return aom_var_2d_u16(a->y_buffer + vstart * a->y_stride + hstart,
  238|  2.12k|                        a->y_stride, width, height) /
  239|  2.12k|         (width * height);
  240|  2.12k|}
aom_highbd_get_u_var:
  243|    200|                              int width, int vstart, int height) {
  244|    200|  return aom_var_2d_u16(a->u_buffer + vstart * a->uv_stride + hstart,
  245|    200|                        a->uv_stride, width, height) /
  246|    200|         (width * height);
  247|    200|}
aom_highbd_get_v_var:
  250|    200|                              int width, int vstart, int height) {
  251|    200|  return aom_var_2d_u16(a->v_buffer + vstart * a->uv_stride + hstart,
  252|    200|                        a->uv_stride, width, height) /
  253|    200|         (width * height);
  254|    200|}
aom_highbd_get_y_sse_part:
  258|  3.52k|                                  int width, int vstart, int height) {
  259|  3.52k|  return highbd_get_sse(
  260|  3.52k|      a->y_buffer + vstart * a->y_stride + hstart, a->y_stride,
  261|  3.52k|      b->y_buffer + vstart * b->y_stride + hstart, b->y_stride, width, height);
  262|  3.52k|}
aom_highbd_get_y_sse:
  265|  42.6k|                             const YV12_BUFFER_CONFIG *b) {
  266|  42.6k|  assert(a->y_crop_width == b->y_crop_width);
  267|  42.6k|  assert(a->y_crop_height == b->y_crop_height);
  268|  42.6k|  assert((a->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  269|  42.6k|  assert((b->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  270|       |
  271|  42.6k|  return highbd_get_sse(a->y_buffer, a->y_stride, b->y_buffer, b->y_stride,
  272|  42.6k|                        a->y_crop_width, a->y_crop_height);
  273|  42.6k|}
aom_highbd_get_u_sse_part:
  277|    333|                                  int width, int vstart, int height) {
  278|    333|  return highbd_get_sse(a->u_buffer + vstart * a->uv_stride + hstart,
  279|    333|                        a->uv_stride,
  280|    333|                        b->u_buffer + vstart * b->uv_stride + hstart,
  281|    333|                        b->uv_stride, width, height);
  282|    333|}
aom_highbd_get_u_sse:
  285|  20.0k|                             const YV12_BUFFER_CONFIG *b) {
  286|  20.0k|  assert(a->uv_crop_width == b->uv_crop_width);
  287|  20.0k|  assert(a->uv_crop_height == b->uv_crop_height);
  288|  20.0k|  assert((a->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  289|  20.0k|  assert((b->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  290|       |
  291|  20.0k|  return highbd_get_sse(a->u_buffer, a->uv_stride, b->u_buffer, b->uv_stride,
  292|  20.0k|                        a->uv_crop_width, a->uv_crop_height);
  293|  20.0k|}
aom_highbd_get_v_sse_part:
  297|    350|                                  int width, int vstart, int height) {
  298|    350|  return highbd_get_sse(a->v_buffer + vstart * a->uv_stride + hstart,
  299|    350|                        a->uv_stride,
  300|    350|                        b->v_buffer + vstart * b->uv_stride + hstart,
  301|    350|                        b->uv_stride, width, height);
  302|    350|}
aom_highbd_get_v_sse:
  305|  19.9k|                             const YV12_BUFFER_CONFIG *b) {
  306|  19.9k|  assert(a->uv_crop_width == b->uv_crop_width);
  307|  19.9k|  assert(a->uv_crop_height == b->uv_crop_height);
  308|  19.9k|  assert((a->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  309|  19.9k|  assert((b->flags & YV12_FLAG_HIGHBITDEPTH) != 0);
  310|       |
  311|  19.9k|  return highbd_get_sse(a->v_buffer, a->uv_stride, b->v_buffer, b->uv_stride,
  312|  19.9k|                        a->uv_crop_width, a->uv_crop_height);
  313|  19.9k|}
aom_get_sse_plane:
  317|   233k|                          const YV12_BUFFER_CONFIG *b, int plane, int highbd) {
  318|   233k|#if CONFIG_AV1_HIGHBITDEPTH
  319|   233k|  if (highbd) {
  ------------------
  |  Branch (319:7): [True: 82.5k, False: 151k]
  ------------------
  320|  82.5k|    switch (plane) {
  321|  42.6k|      case 0: return aom_highbd_get_y_sse(a, b);
  ------------------
  |  Branch (321:7): [True: 42.6k, False: 39.9k]
  ------------------
  322|  20.0k|      case 1: return aom_highbd_get_u_sse(a, b);
  ------------------
  |  Branch (322:7): [True: 20.0k, False: 62.5k]
  ------------------
  323|  19.9k|      case 2: return aom_highbd_get_v_sse(a, b);
  ------------------
  |  Branch (323:7): [True: 19.9k, False: 62.6k]
  ------------------
  324|      0|      default: assert(plane >= 0 && plane <= 2); return 0;
  ------------------
  |  Branch (324:7): [True: 0, False: 82.5k]
  ------------------
  325|  82.5k|    }
  326|   151k|  } else {
  327|   151k|    switch (plane) {
  328|  86.5k|      case 0: return aom_get_y_sse(a, b);
  ------------------
  |  Branch (328:7): [True: 86.5k, False: 64.4k]
  ------------------
  329|  32.2k|      case 1: return aom_get_u_sse(a, b);
  ------------------
  |  Branch (329:7): [True: 32.2k, False: 118k]
  ------------------
  330|  32.1k|      case 2: return aom_get_v_sse(a, b);
  ------------------
  |  Branch (330:7): [True: 32.1k, False: 118k]
  ------------------
  331|      0|      default: assert(plane >= 0 && plane <= 2); return 0;
  ------------------
  |  Branch (331:7): [True: 0, False: 151k]
  ------------------
  332|   151k|    }
  333|   151k|  }
  334|       |#else
  335|       |  (void)highbd;
  336|       |  switch (plane) {
  337|       |    case 0: return aom_get_y_sse(a, b);
  338|       |    case 1: return aom_get_u_sse(a, b);
  339|       |    case 2: return aom_get_v_sse(a, b);
  340|       |    default: assert(plane >= 0 && plane <= 2); return 0;
  341|       |  }
  342|       |#endif
  343|   233k|}
psnr.c:get_sse:
   76|   166k|                       int b_stride, int width, int height) {
   77|   166k|  const int dw = width % 16;
   78|   166k|  const int dh = height % 16;
   79|   166k|  int64_t total_sse = 0;
   80|   166k|  int x, y;
   81|       |
   82|   166k|  if (dw > 0) {
  ------------------
  |  Branch (82:7): [True: 159k, False: 7.04k]
  ------------------
   83|   159k|    total_sse += encoder_sse(&a[width - dw], a_stride, &b[width - dw], b_stride,
   84|   159k|                             dw, height);
   85|   159k|  }
   86|       |
   87|   166k|  if (dh > 0) {
  ------------------
  |  Branch (87:7): [True: 159k, False: 6.56k]
  ------------------
   88|   159k|    total_sse +=
   89|   159k|        encoder_sse(&a[(height - dh) * a_stride], a_stride,
   90|   159k|                    &b[(height - dh) * b_stride], b_stride, width - dw, dh);
   91|   159k|  }
   92|       |
   93|   450k|  for (y = 0; y < height / 16; ++y) {
  ------------------
  |  Branch (93:15): [True: 284k, False: 166k]
  ------------------
   94|   284k|    const uint8_t *pa = a;
   95|   284k|    const uint8_t *pb = b;
   96|  1.30M|    for (x = 0; x < width / 16; ++x) {
  ------------------
  |  Branch (96:17): [True: 1.01M, False: 284k]
  ------------------
   97|  1.01M|      total_sse += aom_sse(pa, a_stride, pb, b_stride, 16, 16);
   98|       |
   99|  1.01M|      pa += 16;
  100|  1.01M|      pb += 16;
  101|  1.01M|    }
  102|       |
  103|   284k|    a += 16 * a_stride;
  104|   284k|    b += 16 * b_stride;
  105|   284k|  }
  106|       |
  107|   166k|  return total_sse;
  108|   166k|}
psnr.c:encoder_sse:
   39|   319k|                           int b_stride, int w, int h) {
   40|   319k|  int i, j;
   41|   319k|  int64_t sse = 0;
   42|       |
   43|  6.68M|  for (i = 0; i < h; i++) {
  ------------------
  |  Branch (43:15): [True: 6.36M, False: 319k]
  ------------------
   44|  74.9M|    for (j = 0; j < w; j++) {
  ------------------
  |  Branch (44:17): [True: 68.6M, False: 6.36M]
  ------------------
   45|  68.6M|      const int diff = a[j] - b[j];
   46|  68.6M|      sse += diff * diff;
   47|  68.6M|    }
   48|       |
   49|  6.36M|    a += a_stride;
   50|  6.36M|    b += b_stride;
   51|  6.36M|  }
   52|   319k|  return sse;
   53|   319k|}
psnr.c:highbd_get_sse:
  131|  86.7k|                              int b_stride, int width, int height) {
  132|  86.7k|  int64_t total_sse = 0;
  133|  86.7k|  int x, y;
  134|  86.7k|  const int dw = width % 16;
  135|  86.7k|  const int dh = height % 16;
  136|       |
  137|  86.7k|  if (dw > 0) {
  ------------------
  |  Branch (137:7): [True: 83.5k, False: 3.22k]
  ------------------
  138|  83.5k|    total_sse += encoder_highbd_sse(&a[width - dw], a_stride, &b[width - dw],
  139|  83.5k|                                    b_stride, dw, height);
  140|  83.5k|  }
  141|  86.7k|  if (dh > 0) {
  ------------------
  |  Branch (141:7): [True: 83.3k, False: 3.46k]
  ------------------
  142|  83.3k|    total_sse += encoder_highbd_sse(&a[(height - dh) * a_stride], a_stride,
  143|  83.3k|                                    &b[(height - dh) * b_stride], b_stride,
  144|  83.3k|                                    width - dw, dh);
  145|  83.3k|  }
  146|       |
  147|   207k|  for (y = 0; y < height / 16; ++y) {
  ------------------
  |  Branch (147:15): [True: 121k, False: 86.7k]
  ------------------
  148|   121k|    const uint8_t *pa = a;
  149|   121k|    const uint8_t *pb = b;
  150|   156k|    for (x = 0; x < width / 16; ++x) {
  ------------------
  |  Branch (150:17): [True: 35.0k, False: 121k]
  ------------------
  151|  35.0k|      total_sse += aom_highbd_sse(pa, a_stride, pb, b_stride, 16, 16);
  152|  35.0k|      pa += 16;
  153|  35.0k|      pb += 16;
  154|  35.0k|    }
  155|   121k|    a += 16 * a_stride;
  156|   121k|    b += 16 * b_stride;
  157|   121k|  }
  158|  86.7k|  return total_sse;
  159|  86.7k|}
psnr.c:encoder_highbd_sse:
   58|   166k|                                  int h) {
   59|   166k|  const uint16_t *a = CONVERT_TO_SHORTPTR(a8);
  ------------------
  |  |   79|   166k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   60|   166k|  const uint16_t *b = CONVERT_TO_SHORTPTR(b8);
  ------------------
  |  |   79|   166k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   61|   166k|  int64_t sse = 0;
   62|  3.15M|  for (int i = 0; i < h; ++i) {
  ------------------
  |  Branch (62:19): [True: 2.99M, False: 166k]
  ------------------
   63|  33.2M|    for (int j = 0; j < w; ++j) {
  ------------------
  |  Branch (63:21): [True: 30.2M, False: 2.99M]
  ------------------
   64|  30.2M|      const int diff = a[j] - b[j];
   65|  30.2M|      sse += diff * diff;
   66|  30.2M|    }
   67|  2.99M|    a += a_stride;
   68|  2.99M|    b += b_stride;
   69|  2.99M|  }
   70|   166k|  return sse;
   71|   166k|}

aom_get_pyramid_alloc_size:
   35|   184k|size_t aom_get_pyramid_alloc_size(int width, int height, bool image_is_16bit) {
   36|       |  // Allocate the maximum possible number of layers for this width and height
   37|   184k|  const int msb = get_msb(AOMMIN(width, height));
  ------------------
  |  |   34|   184k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 83.3k, False: 101k]
  |  |  ------------------
  ------------------
   38|   184k|  const int n_levels = AOMMAX(msb - MIN_PYRAMID_SIZE_LOG2, 1);
  ------------------
  |  |   35|   184k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 20.3k, False: 164k]
  |  |  ------------------
  ------------------
   39|       |
   40|   184k|  size_t alloc_size = 0;
   41|   184k|  alloc_size += sizeof(ImagePyramid);
   42|   184k|  alloc_size += n_levels * sizeof(PyramidLayer);
   43|       |
   44|       |  // Calculate how much memory is needed for downscaled frame buffers
   45|   184k|  size_t buffer_size = 0;
   46|       |
   47|       |  // Work out if we need to allocate a few extra bytes for alignment.
   48|       |  // aom_memalign() will ensure that the start of the allocation is aligned
   49|       |  // to a multiple of PYRAMID_ALIGNMENT. But we want the first image pixel
   50|       |  // to be aligned, not the first byte of the allocation.
   51|       |  //
   52|       |  // In the loop below, we ensure that the stride of every image is a multiple
   53|       |  // of PYRAMID_ALIGNMENT. Thus the allocated size of each pyramid level will
   54|       |  // also be a multiple of PYRAMID_ALIGNMENT. Thus, as long as we can get the
   55|       |  // first pixel in the first pyramid layer aligned properly, that will
   56|       |  // automatically mean that the first pixel of every row of every layer is
   57|       |  // properly aligned too.
   58|       |  //
   59|       |  // Thus all we need to consider is the first pixel in the first layer.
   60|       |  // This is located at offset
   61|       |  //   extra_bytes + level_stride * PYRAMID_PADDING + PYRAMID_PADDING
   62|       |  // bytes into the buffer. Since level_stride is a multiple of
   63|       |  // PYRAMID_ALIGNMENT, we can ignore that. So we need
   64|       |  //   extra_bytes + PYRAMID_PADDING = multiple of PYRAMID_ALIGNMENT
   65|       |  //
   66|       |  // To solve this, we can round PYRAMID_PADDING up to the next multiple
   67|       |  // of PYRAMID_ALIGNMENT, then subtract the orginal value to calculate
   68|       |  // how many extra bytes are needed.
   69|   184k|  size_t first_px_offset =
   70|   184k|      (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   38|   184k|#define PYRAMID_PADDING 16
  ------------------
                    (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|   184k|#define PYRAMID_ALIGNMENT 32
  ------------------
                    (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|   184k|#define PYRAMID_ALIGNMENT 32
  ------------------
   71|   184k|  size_t extra_bytes = first_px_offset - PYRAMID_PADDING;
  ------------------
  |  |   38|   184k|#define PYRAMID_PADDING 16
  ------------------
   72|   184k|  buffer_size += extra_bytes;
   73|       |
   74|       |  // If the original image is stored in an 8-bit buffer, then we can point the
   75|       |  // lowest pyramid level at that buffer rather than allocating a new one.
   76|   184k|  int first_allocated_level = image_is_16bit ? 0 : 1;
  ------------------
  |  Branch (76:31): [True: 59.2k, False: 125k]
  ------------------
   77|       |
   78|   280k|  for (int level = first_allocated_level; level < n_levels; level++) {
  ------------------
  |  Branch (78:43): [True: 95.5k, False: 184k]
  ------------------
   79|  95.5k|    int level_width = width >> level;
   80|  95.5k|    int level_height = height >> level;
   81|       |
   82|       |    // Allocate padding for each layer
   83|  95.5k|    int padded_width = level_width + 2 * PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
   84|  95.5k|    int padded_height = level_height + 2 * PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
   85|       |
   86|       |    // Align the layer stride to be a multiple of PYRAMID_ALIGNMENT
   87|       |    // This ensures that, as long as the top-left pixel in this pyramid level is
   88|       |    // properly aligned, then so will the leftmost pixel in every row of the
   89|       |    // pyramid level.
   90|  95.5k|    int level_stride =
   91|  95.5k|        (padded_width + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|  95.5k|#define PYRAMID_ALIGNMENT 32
  ------------------
                      (padded_width + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|  95.5k|#define PYRAMID_ALIGNMENT 32
  ------------------
   92|       |
   93|  95.5k|    buffer_size += level_stride * padded_height;
   94|  95.5k|  }
   95|       |
   96|   184k|  alloc_size += buffer_size;
   97|       |
   98|   184k|  return alloc_size;
   99|   184k|}
aom_alloc_pyramid:
  101|   184k|ImagePyramid *aom_alloc_pyramid(int width, int height, bool image_is_16bit) {
  102|       |  // Allocate the maximum possible number of layers for this width and height
  103|   184k|  const int msb = get_msb(AOMMIN(width, height));
  ------------------
  |  |   34|   184k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 83.3k, False: 101k]
  |  |  ------------------
  ------------------
  104|   184k|  const int n_levels = AOMMAX(msb - MIN_PYRAMID_SIZE_LOG2, 1);
  ------------------
  |  |   35|   184k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 20.3k, False: 164k]
  |  |  ------------------
  ------------------
  105|       |
  106|   184k|  ImagePyramid *pyr = aom_calloc(1, sizeof(*pyr));
  107|   184k|  if (!pyr) {
  ------------------
  |  Branch (107:7): [True: 0, False: 184k]
  ------------------
  108|      0|    return NULL;
  109|      0|  }
  110|       |
  111|   184k|  pyr->layers = aom_calloc(n_levels, sizeof(*pyr->layers));
  112|   184k|  if (!pyr->layers) {
  ------------------
  |  Branch (112:7): [True: 0, False: 184k]
  ------------------
  113|      0|    aom_free(pyr);
  114|      0|    return NULL;
  115|      0|  }
  116|       |
  117|   184k|  pyr->max_levels = n_levels;
  118|   184k|  pyr->filled_levels = 0;
  119|       |
  120|       |  // Compute sizes and offsets for each pyramid level
  121|       |  // These are gathered up first, so that we can allocate all pyramid levels
  122|       |  // in a single buffer
  123|   184k|  size_t buffer_size = 0;
  124|   184k|  size_t *layer_offsets = aom_calloc(n_levels, sizeof(*layer_offsets));
  125|   184k|  if (!layer_offsets) {
  ------------------
  |  Branch (125:7): [True: 0, False: 184k]
  ------------------
  126|      0|    aom_free(pyr->layers);
  127|      0|    aom_free(pyr);
  128|      0|    return NULL;
  129|      0|  }
  130|       |
  131|       |  // Work out if we need to allocate a few extra bytes for alignment.
  132|       |  // aom_memalign() will ensure that the start of the allocation is aligned
  133|       |  // to a multiple of PYRAMID_ALIGNMENT. But we want the first image pixel
  134|       |  // to be aligned, not the first byte of the allocation.
  135|       |  //
  136|       |  // In the loop below, we ensure that the stride of every image is a multiple
  137|       |  // of PYRAMID_ALIGNMENT. Thus the allocated size of each pyramid level will
  138|       |  // also be a multiple of PYRAMID_ALIGNMENT. Thus, as long as we can get the
  139|       |  // first pixel in the first pyramid layer aligned properly, that will
  140|       |  // automatically mean that the first pixel of every row of every layer is
  141|       |  // properly aligned too.
  142|       |  //
  143|       |  // Thus all we need to consider is the first pixel in the first layer.
  144|       |  // This is located at offset
  145|       |  //   extra_bytes + level_stride * PYRAMID_PADDING + PYRAMID_PADDING
  146|       |  // bytes into the buffer. Since level_stride is a multiple of
  147|       |  // PYRAMID_ALIGNMENT, we can ignore that. So we need
  148|       |  //   extra_bytes + PYRAMID_PADDING = multiple of PYRAMID_ALIGNMENT
  149|       |  //
  150|       |  // To solve this, we can round PYRAMID_PADDING up to the next multiple
  151|       |  // of PYRAMID_ALIGNMENT, then subtract the orginal value to calculate
  152|       |  // how many extra bytes are needed.
  153|   184k|  size_t first_px_offset =
  154|   184k|      (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   38|   184k|#define PYRAMID_PADDING 16
  ------------------
                    (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|   184k|#define PYRAMID_ALIGNMENT 32
  ------------------
                    (PYRAMID_PADDING + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|   184k|#define PYRAMID_ALIGNMENT 32
  ------------------
  155|   184k|  size_t extra_bytes = first_px_offset - PYRAMID_PADDING;
  ------------------
  |  |   38|   184k|#define PYRAMID_PADDING 16
  ------------------
  156|   184k|  buffer_size += extra_bytes;
  157|       |
  158|       |  // If the original image is stored in an 8-bit buffer, then we can point the
  159|       |  // lowest pyramid level at that buffer rather than allocating a new one.
  160|   184k|  int first_allocated_level = image_is_16bit ? 0 : 1;
  ------------------
  |  Branch (160:31): [True: 59.2k, False: 125k]
  ------------------
  161|       |
  162|   280k|  for (int level = first_allocated_level; level < n_levels; level++) {
  ------------------
  |  Branch (162:43): [True: 95.5k, False: 184k]
  ------------------
  163|  95.5k|    PyramidLayer *layer = &pyr->layers[level];
  164|       |
  165|  95.5k|    int level_width = width >> level;
  166|  95.5k|    int level_height = height >> level;
  167|       |
  168|       |    // Allocate padding for each layer
  169|  95.5k|    int padded_width = level_width + 2 * PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
  170|  95.5k|    int padded_height = level_height + 2 * PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
  171|       |
  172|       |    // Align the layer stride to be a multiple of PYRAMID_ALIGNMENT
  173|       |    // This ensures that, as long as the top-left pixel in this pyramid level is
  174|       |    // properly aligned, then so will the leftmost pixel in every row of the
  175|       |    // pyramid level.
  176|  95.5k|    int level_stride =
  177|  95.5k|        (padded_width + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|  95.5k|#define PYRAMID_ALIGNMENT 32
  ------------------
                      (padded_width + PYRAMID_ALIGNMENT - 1) & ~(PYRAMID_ALIGNMENT - 1);
  ------------------
  |  |   44|  95.5k|#define PYRAMID_ALIGNMENT 32
  ------------------
  178|       |
  179|  95.5k|    size_t level_alloc_start = buffer_size;
  180|  95.5k|    size_t level_start =
  181|  95.5k|        level_alloc_start + PYRAMID_PADDING * level_stride + PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
                      level_alloc_start + PYRAMID_PADDING * level_stride + PYRAMID_PADDING;
  ------------------
  |  |   38|  95.5k|#define PYRAMID_PADDING 16
  ------------------
  182|       |
  183|  95.5k|    buffer_size += level_stride * padded_height;
  184|       |
  185|  95.5k|    layer_offsets[level] = level_start;
  186|  95.5k|    layer->width = level_width;
  187|  95.5k|    layer->height = level_height;
  188|  95.5k|    layer->stride = level_stride;
  189|  95.5k|  }
  190|       |
  191|   184k|  pyr->buffer_alloc =
  192|   184k|      aom_memalign(PYRAMID_ALIGNMENT, buffer_size * sizeof(*pyr->buffer_alloc));
  ------------------
  |  |   44|   184k|#define PYRAMID_ALIGNMENT 32
  ------------------
  193|   184k|  if (!pyr->buffer_alloc) {
  ------------------
  |  Branch (193:7): [True: 0, False: 184k]
  ------------------
  194|      0|    aom_free(pyr->layers);
  195|      0|    aom_free(pyr);
  196|      0|    aom_free(layer_offsets);
  197|      0|    return NULL;
  198|      0|  }
  199|       |
  200|       |  // Fill in pointers for each level
  201|       |  // If image is 8-bit, then the lowest level is left unconfigured for now,
  202|       |  // and will be set up properly when the pyramid is filled in
  203|   280k|  for (int level = first_allocated_level; level < n_levels; level++) {
  ------------------
  |  Branch (203:43): [True: 95.5k, False: 184k]
  ------------------
  204|  95.5k|    PyramidLayer *layer = &pyr->layers[level];
  205|  95.5k|    layer->buffer = pyr->buffer_alloc + layer_offsets[level];
  206|  95.5k|  }
  207|       |
  208|   184k|#if CONFIG_MULTITHREAD
  209|   184k|  pthread_mutex_init(&pyr->mutex, NULL);
  210|   184k|#endif  // CONFIG_MULTITHREAD
  211|       |
  212|   184k|  aom_free(layer_offsets);
  213|   184k|  return pyr;
  214|   184k|}
aom_compute_pyramid:
  384|  16.8k|                        int n_levels, ImagePyramid *pyr) {
  385|  16.8k|  assert(pyr);
  386|       |
  387|       |  // Per the comments in the ImagePyramid struct, we must take this mutex
  388|       |  // before reading or writing the filled_levels field, and hold it while
  389|       |  // computing any additional pyramid levels, to ensure proper behaviour
  390|       |  // when multithreading is used
  391|  16.8k|#if CONFIG_MULTITHREAD
  392|  16.8k|  pthread_mutex_lock(&pyr->mutex);
  393|  16.8k|#endif  // CONFIG_MULTITHREAD
  394|       |
  395|  16.8k|  n_levels = AOMMIN(n_levels, pyr->max_levels);
  ------------------
  |  |   34|  16.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 22, False: 16.8k]
  |  |  ------------------
  ------------------
  396|  16.8k|  int result = n_levels;
  397|  16.8k|  if (pyr->filled_levels < n_levels) {
  ------------------
  |  Branch (397:7): [True: 7.40k, False: 9.47k]
  ------------------
  398|       |    // Compute any missing levels that we need
  399|  7.40k|    result = fill_pyramid(frame, bit_depth, n_levels, pyr);
  400|  7.40k|  }
  401|       |
  402|       |  // At this point, as long as result >= 0, the requested number of pyramid
  403|       |  // levels are guaranteed to be valid, and can be safely read from without
  404|       |  // holding the mutex any further
  405|       |  assert(IMPLIES(result >= 0, pyr->filled_levels >= n_levels));
  406|  16.8k|#if CONFIG_MULTITHREAD
  407|  16.8k|  pthread_mutex_unlock(&pyr->mutex);
  408|  16.8k|#endif  // CONFIG_MULTITHREAD
  409|  16.8k|  return result;
  410|  16.8k|}
aom_invalidate_pyramid:
  446|   157k|void aom_invalidate_pyramid(ImagePyramid *pyr) {
  447|   157k|  if (pyr) {
  ------------------
  |  Branch (447:7): [True: 61.5k, False: 95.4k]
  ------------------
  448|  61.5k|#if CONFIG_MULTITHREAD
  449|  61.5k|    pthread_mutex_lock(&pyr->mutex);
  450|  61.5k|#endif  // CONFIG_MULTITHREAD
  451|  61.5k|    pyr->filled_levels = 0;
  452|  61.5k|#if CONFIG_MULTITHREAD
  453|  61.5k|    pthread_mutex_unlock(&pyr->mutex);
  454|  61.5k|#endif  // CONFIG_MULTITHREAD
  455|  61.5k|  }
  456|   157k|}
aom_free_pyramid:
  459|   184k|void aom_free_pyramid(ImagePyramid *pyr) {
  460|   184k|  if (pyr) {
  ------------------
  |  Branch (460:7): [True: 184k, False: 0]
  ------------------
  461|   184k|#if CONFIG_MULTITHREAD
  462|   184k|    pthread_mutex_destroy(&pyr->mutex);
  463|   184k|#endif  // CONFIG_MULTITHREAD
  464|   184k|    aom_free(pyr->buffer_alloc);
  465|   184k|    aom_free(pyr->layers);
  466|   184k|    aom_free(pyr);
  467|   184k|  }
  468|   184k|}
pyramid.c:fill_pyramid:
  258|  7.40k|                               int n_levels, ImagePyramid *frame_pyr) {
  259|  7.40k|  int already_filled_levels = frame_pyr->filled_levels;
  260|       |
  261|       |  // This condition should already be enforced by aom_compute_pyramid
  262|  7.40k|  assert(n_levels <= frame_pyr->max_levels);
  263|       |
  264|  7.40k|  if (already_filled_levels >= n_levels) {
  ------------------
  |  Branch (264:7): [True: 0, False: 7.40k]
  ------------------
  265|      0|    return n_levels;
  266|      0|  }
  267|       |
  268|  7.40k|  const int frame_width = frame->y_crop_width;
  269|  7.40k|  const int frame_height = frame->y_crop_height;
  270|  7.40k|  const int frame_stride = frame->y_stride;
  271|  7.40k|  assert((frame_width >> n_levels) >= 0);
  272|  7.40k|  assert((frame_height >> n_levels) >= 0);
  273|       |
  274|  7.40k|  if (already_filled_levels == 0) {
  ------------------
  |  Branch (274:7): [True: 7.40k, False: 0]
  ------------------
  275|       |    // Fill in largest level from the original image
  276|  7.40k|    PyramidLayer *first_layer = &frame_pyr->layers[0];
  277|  7.40k|    if (frame->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  7.40k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (277:9): [True: 1.59k, False: 5.80k]
  ------------------
  278|       |      // For frames stored in a 16-bit buffer, we need to downconvert to 8 bits
  279|  1.59k|      assert(first_layer->width == frame_width);
  280|  1.59k|      assert(first_layer->height == frame_height);
  281|       |
  282|  1.59k|      uint16_t *frame_buffer = CONVERT_TO_SHORTPTR(frame->y_buffer);
  ------------------
  |  |   79|  1.59k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  283|  1.59k|      uint8_t *pyr_buffer = first_layer->buffer;
  284|  1.59k|      int pyr_stride = first_layer->stride;
  285|  46.2k|      for (int y = 0; y < frame_height; y++) {
  ------------------
  |  Branch (285:23): [True: 44.6k, False: 1.59k]
  ------------------
  286|  44.6k|        uint16_t *frame_row = frame_buffer + y * frame_stride;
  287|  44.6k|        uint8_t *pyr_row = pyr_buffer + y * pyr_stride;
  288|   592k|        for (int x = 0; x < frame_width; x++) {
  ------------------
  |  Branch (288:25): [True: 547k, False: 44.6k]
  ------------------
  289|   547k|          pyr_row[x] = frame_row[x] >> (bit_depth - 8);
  290|   547k|        }
  291|  44.6k|      }
  292|       |
  293|  1.59k|      fill_border(pyr_buffer, frame_width, frame_height, pyr_stride);
  294|  5.80k|    } else {
  295|       |      // For frames stored in an 8-bit buffer, we don't need to copy anything -
  296|       |      // we can just reference the original image buffer
  297|  5.80k|      first_layer->buffer = frame->y_buffer;
  298|  5.80k|      first_layer->width = frame_width;
  299|  5.80k|      first_layer->height = frame_height;
  300|  5.80k|      first_layer->stride = frame_stride;
  301|  5.80k|    }
  302|       |
  303|  7.40k|    already_filled_levels = 1;
  304|  7.40k|  }
  305|       |
  306|       |  // Fill in the remaining levels through progressive downsampling
  307|  8.25k|  for (int level = already_filled_levels; level < n_levels; ++level) {
  ------------------
  |  Branch (307:43): [True: 850, False: 7.40k]
  ------------------
  308|    850|    bool mem_status = false;
  309|    850|    PyramidLayer *prev_layer = &frame_pyr->layers[level - 1];
  310|    850|    uint8_t *prev_buffer = prev_layer->buffer;
  311|    850|    int prev_stride = prev_layer->stride;
  312|       |
  313|    850|    PyramidLayer *this_layer = &frame_pyr->layers[level];
  314|    850|    uint8_t *this_buffer = this_layer->buffer;
  315|    850|    int this_width = this_layer->width;
  316|    850|    int this_height = this_layer->height;
  317|    850|    int this_stride = this_layer->stride;
  318|       |
  319|       |    // The width and height of the previous layer that needs to be considered to
  320|       |    // derive the current layer frame.
  321|    850|    const int input_layer_width = this_width << 1;
  322|    850|    const int input_layer_height = this_height << 1;
  323|       |
  324|       |    // Compute the this pyramid level by downsampling the current level.
  325|       |    //
  326|       |    // We downsample by a factor of exactly 2, clipping the rightmost and
  327|       |    // bottommost pixel off of the current level if needed. We do this for
  328|       |    // two main reasons:
  329|       |    //
  330|       |    // 1) In the disflow code, when stepping from a higher pyramid level to a
  331|       |    //    lower pyramid level, we need to not just interpolate the flow field
  332|       |    //    but also to scale each flow vector by the upsampling ratio.
  333|       |    //    So it is much more convenient if this ratio is simply 2.
  334|       |    //
  335|       |    // 2) Up/downsampling by a factor of 2 can be implemented much more
  336|       |    //    efficiently than up/downsampling by a generic ratio.
  337|       |    //    TODO(rachelbarker): Use optimized downsample-by-2 function
  338|       |
  339|       |    // SIMD support has been added specifically for cases where the downsample
  340|       |    // factor is exactly 2. In such instances, horizontal and vertical resizing
  341|       |    // is performed utilizing the down2_symeven() function, which considers the
  342|       |    // even dimensions of the input layer.
  343|    850|    if (should_resize_by_half(input_layer_height, input_layer_width,
  ------------------
  |  Branch (343:9): [True: 850, False: 0]
  ------------------
  344|    850|                              this_height, this_width)) {
  345|    850|      assert(input_layer_height % 2 == 0 && input_layer_width % 2 == 0 &&
  346|    850|             "Input width or height cannot be odd.");
  347|    850|      mem_status = av1_resize_plane_to_half(
  348|    850|          prev_buffer, input_layer_height, input_layer_width, prev_stride,
  349|    850|          this_buffer, this_height, this_width, this_stride);
  350|    850|    } else {
  351|      0|      mem_status = av1_resize_plane(prev_buffer, input_layer_height,
  352|      0|                                    input_layer_width, prev_stride, this_buffer,
  353|      0|                                    this_height, this_width, this_stride);
  354|      0|    }
  355|       |
  356|       |    // Terminate early in cases of memory allocation failure.
  357|    850|    if (!mem_status) {
  ------------------
  |  Branch (357:9): [True: 0, False: 850]
  ------------------
  358|      0|      frame_pyr->filled_levels = n_levels;
  359|      0|      return -1;
  360|      0|    }
  361|       |
  362|    850|    fill_border(this_buffer, this_width, this_height, this_stride);
  363|    850|  }
  364|       |
  365|  7.40k|  frame_pyr->filled_levels = n_levels;
  366|  7.40k|  return n_levels;
  367|  7.40k|}
pyramid.c:fill_border:
  221|  2.44k|                               const int height, const int stride) {
  222|       |  // Fill left and right areas
  223|  85.3k|  for (int row = 0; row < height; row++) {
  ------------------
  |  Branch (223:21): [True: 82.8k, False: 2.44k]
  ------------------
  224|  82.8k|    uint8_t *row_start = &img_buf[row * stride];
  225|  82.8k|    uint8_t left_pixel = row_start[0];
  226|  82.8k|    memset(row_start - PYRAMID_PADDING, left_pixel, PYRAMID_PADDING);
  ------------------
  |  |   38|  82.8k|#define PYRAMID_PADDING 16
  ------------------
                  memset(row_start - PYRAMID_PADDING, left_pixel, PYRAMID_PADDING);
  ------------------
  |  |   38|  82.8k|#define PYRAMID_PADDING 16
  ------------------
  227|  82.8k|    uint8_t right_pixel = row_start[width - 1];
  228|  82.8k|    memset(row_start + width, right_pixel, PYRAMID_PADDING);
  ------------------
  |  |   38|  82.8k|#define PYRAMID_PADDING 16
  ------------------
  229|  82.8k|  }
  230|       |
  231|       |  // Fill top area
  232|  41.6k|  for (int row = -PYRAMID_PADDING; row < 0; row++) {
  ------------------
  |  |   38|  2.44k|#define PYRAMID_PADDING 16
  ------------------
  |  Branch (232:36): [True: 39.1k, False: 2.44k]
  ------------------
  233|  39.1k|    uint8_t *row_start = &img_buf[row * stride];
  234|  39.1k|    memcpy(row_start - PYRAMID_PADDING, img_buf - PYRAMID_PADDING,
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
                  memcpy(row_start - PYRAMID_PADDING, img_buf - PYRAMID_PADDING,
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
  235|  39.1k|           width + 2 * PYRAMID_PADDING);
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
  236|  39.1k|  }
  237|       |
  238|       |  // Fill bottom area
  239|  2.44k|  uint8_t *last_row_start = &img_buf[(height - 1) * stride];
  240|  41.6k|  for (int row = height; row < height + PYRAMID_PADDING; row++) {
  ------------------
  |  |   38|  41.6k|#define PYRAMID_PADDING 16
  ------------------
  |  Branch (240:26): [True: 39.1k, False: 2.44k]
  ------------------
  241|  39.1k|    uint8_t *row_start = &img_buf[row * stride];
  242|  39.1k|    memcpy(row_start - PYRAMID_PADDING, last_row_start - PYRAMID_PADDING,
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
                  memcpy(row_start - PYRAMID_PADDING, last_row_start - PYRAMID_PADDING,
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
  243|  39.1k|           width + 2 * PYRAMID_PADDING);
  ------------------
  |  |   38|  39.1k|#define PYRAMID_PADDING 16
  ------------------
  244|  39.1k|  }
  245|  2.44k|}

aom_quantize_b_helper_c:
  117|  33.6M|                             const int log_scale) {
  118|  33.6M|  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
  ------------------
  |  |   41|  33.6M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  119|  33.6M|                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
  ------------------
  |  |   41|  33.6M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  120|  33.6M|  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
  121|  33.6M|  int i, non_zero_count = (int)n_coeffs, eob = -1;
  122|  33.6M|  (void)iscan;
  123|       |
  124|  33.6M|  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
  125|  33.6M|  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
  126|       |
  127|       |  // Pre-scan pass
  128|   710M|  for (i = (int)n_coeffs - 1; i >= 0; i--) {
  ------------------
  |  Branch (128:31): [True: 707M, False: 2.11M]
  ------------------
  129|   707M|    const int rc = scan[i];
  130|  18.4E|    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (130:25): [True: 707M, False: 18.4E]
  ------------------
  131|   707M|    const int coeff = coeff_ptr[rc] * wt;
  132|       |
  133|   707M|    if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS)) &&
  ------------------
  |  |   62|   707M|#define AOM_QM_BITS 5
  ------------------
  |  Branch (133:9): [True: 692M, False: 15.7M]
  ------------------
  134|   692M|        coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS)))
  ------------------
  |  |   62|   692M|#define AOM_QM_BITS 5
  ------------------
  |  Branch (134:9): [True: 676M, False: 15.7M]
  ------------------
  135|   676M|      non_zero_count--;
  136|  31.5M|    else
  137|  31.5M|      break;
  138|   707M|  }
  139|       |
  140|       |  // Quantization pass: All coefficients with index >= zero_flag are
  141|       |  // skippable. Note: zero_flag can be zero.
  142|  1.15G|  for (i = 0; i < non_zero_count; i++) {
  ------------------
  |  Branch (142:15): [True: 1.11G, False: 33.6M]
  ------------------
  143|  1.11G|    const int rc = scan[i];
  144|  1.11G|    const int coeff = coeff_ptr[rc];
  145|  1.11G|    const int coeff_sign = AOMSIGN(coeff);
  ------------------
  |  |   36|  1.11G|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 552M, False: 563M]
  |  |  ------------------
  ------------------
  146|  1.11G|    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
  147|  1.11G|    int tmp32;
  148|       |
  149|  18.4E|    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (149:25): [True: 1.12G, False: 18.4E]
  ------------------
  150|  1.11G|    if (abs_coeff * wt >= (zbins[rc != 0] << AOM_QM_BITS)) {
  ------------------
  |  |   62|  1.11G|#define AOM_QM_BITS 5
  ------------------
  |  Branch (150:9): [True: 736M, False: 379M]
  ------------------
  151|   736M|      int64_t tmp =
  152|   736M|          clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale),
  ------------------
  |  |   41|   736M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  153|   736M|                INT16_MIN, INT16_MAX);
  154|   736M|      tmp *= wt;
  155|   736M|      tmp32 = (int)(((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
  156|   736M|                     quant_shift_ptr[rc != 0]) >>
  157|   736M|                    (16 - log_scale + AOM_QM_BITS));  // quantization
  ------------------
  |  |   62|   736M|#define AOM_QM_BITS 5
  ------------------
  158|   736M|      qcoeff_ptr[rc] = (tmp32 ^ coeff_sign) - coeff_sign;
  159|   736M|      const int iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|   358k|#define AOM_QM_BITS 5
  ------------------
  |  Branch (159:23): [True: 736M, False: 358k]
  ------------------
  160|   736M|      const int dequant =
  161|   736M|          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
  ------------------
  |  |   62|   736M|#define AOM_QM_BITS 5
  ------------------
  162|   736M|          AOM_QM_BITS;
  ------------------
  |  |   62|   736M|#define AOM_QM_BITS 5
  ------------------
  163|   736M|      const tran_low_t abs_dqcoeff = (tmp32 * dequant) >> log_scale;
  164|   736M|      dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
  165|       |
  166|   736M|      if (tmp32) eob = i;
  ------------------
  |  Branch (166:11): [True: 717M, False: 19.1M]
  ------------------
  167|   736M|    }
  168|  1.11G|  }
  169|  33.6M|  *eob_ptr = eob + 1;
  170|  33.6M|}
aom_highbd_quantize_b_helper_c:
  268|  24.0M|    const qm_val_t *iqm_ptr, const int log_scale) {
  269|  24.0M|  int i, eob = -1;
  270|  24.0M|  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
  ------------------
  |  |   41|  24.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  271|  24.0M|                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
  ------------------
  |  |   41|  24.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  272|  24.0M|  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
  273|  24.0M|  int dequant;
  274|  24.0M|  int idx_arr[4096];
  275|  24.0M|  (void)iscan;
  276|  24.0M|  int idx = 0;
  277|       |
  278|  24.0M|  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
  279|  24.0M|  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
  280|       |
  281|       |  // Pre-scan pass
  282|   766M|  for (i = 0; i < n_coeffs; i++) {
  ------------------
  |  Branch (282:15): [True: 742M, False: 24.0M]
  ------------------
  283|   742M|    const int rc = scan[i];
  284|  18.4E|    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (284:25): [True: 742M, False: 18.4E]
  ------------------
  285|   742M|    const int coeff = coeff_ptr[rc] * wt;
  286|       |
  287|       |    // If the coefficient is out of the base ZBIN range, keep it for
  288|       |    // quantization.
  289|   742M|    if (coeff >= (zbins[rc != 0] * (1 << AOM_QM_BITS)) ||
  ------------------
  |  |   62|   742M|#define AOM_QM_BITS 5
  ------------------
  |  Branch (289:9): [True: 188M, False: 554M]
  ------------------
  290|   554M|        coeff <= (nzbins[rc != 0] * (1 << AOM_QM_BITS)))
  ------------------
  |  |   62|   554M|#define AOM_QM_BITS 5
  ------------------
  |  Branch (290:9): [True: 188M, False: 365M]
  ------------------
  291|   377M|      idx_arr[idx++] = i;
  292|   742M|  }
  293|       |
  294|       |  // Quantization pass: only process the coefficients selected in
  295|       |  // pre-scan pass. Note: idx can be zero.
  296|   401M|  for (i = 0; i < idx; i++) {
  ------------------
  |  Branch (296:15): [True: 377M, False: 24.0M]
  ------------------
  297|   377M|    const int rc = scan[idx_arr[i]];
  298|   377M|    const int coeff = coeff_ptr[rc];
  299|   377M|    const int coeff_sign = AOMSIGN(coeff);
  ------------------
  |  |   36|   377M|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 189M, False: 188M]
  |  |  ------------------
  ------------------
  300|  18.4E|    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (300:25): [True: 377M, False: 18.4E]
  ------------------
  301|  18.4E|    const qm_val_t iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (301:26): [True: 377M, False: 18.4E]
  ------------------
  302|   377M|    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
  303|   377M|    const int64_t tmp1 =
  304|   377M|        abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale);
  ------------------
  |  |   41|   377M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  305|   377M|    const int64_t tmpw = tmp1 * wt;
  306|   377M|    const int64_t tmp2 = ((tmpw * quant_ptr[rc != 0]) >> 16) + tmpw;
  307|   377M|    const int abs_qcoeff = (int)((tmp2 * quant_shift_ptr[rc != 0]) >>
  308|   377M|                                 (16 - log_scale + AOM_QM_BITS));
  ------------------
  |  |   62|   377M|#define AOM_QM_BITS 5
  ------------------
  309|   377M|    qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
  310|   377M|    dequant =
  311|   377M|        (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|   377M|#define AOM_QM_BITS 5
  ------------------
                      (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|   377M|#define AOM_QM_BITS 5
  ------------------
  312|   377M|    const tran_low_t abs_dqcoeff = (abs_qcoeff * dequant) >> log_scale;
  313|   377M|    dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
  314|   377M|    if (abs_qcoeff) eob = idx_arr[i];
  ------------------
  |  Branch (314:9): [True: 368M, False: 9.14M]
  ------------------
  315|   377M|  }
  316|  24.0M|  *eob_ptr = eob + 1;
  317|  24.0M|}

binary_codes_reader.c:inv_recenter_finite_nonneg:
   32|  1.79k|                                                  uint16_t v) {
   33|  1.79k|  if ((r << 1) <= n) {
  ------------------
  |  Branch (33:7): [True: 1.79k, False: 1]
  ------------------
   34|  1.79k|    return inv_recenter_nonneg(r, v);
   35|  1.79k|  } else {
   36|      1|    return n - 1 - inv_recenter_nonneg(n - 1 - r, v);
   37|      1|  }
   38|  1.79k|}
binary_codes_reader.c:inv_recenter_nonneg:
   20|  1.79k|static inline uint16_t inv_recenter_nonneg(uint16_t r, uint16_t v) {
   21|  1.79k|  if (v > (r << 1))
  ------------------
  |  Branch (21:7): [True: 6, False: 1.79k]
  ------------------
   22|      6|    return v;
   23|  1.79k|  else if ((v & 1) == 0)
  ------------------
  |  Branch (23:12): [True: 664, False: 1.12k]
  ------------------
   24|    664|    return (v >> 1) + r;
   25|  1.12k|  else
   26|  1.12k|    return r - ((v + 1) >> 1);
   27|  1.79k|}
binary_codes_writer.c:recenter_finite_nonneg:
   53|  46.0k|                                              uint16_t v) {
   54|  46.0k|  if ((r << 1) <= n) {
  ------------------
  |  Branch (54:7): [True: 46.0k, False: 13]
  ------------------
   55|  46.0k|    return recenter_nonneg(r, v);
   56|  46.0k|  } else {
   57|     13|    return recenter_nonneg(n - 1 - r, n - 1 - v);
   58|     13|  }
   59|  46.0k|}
binary_codes_writer.c:recenter_nonneg:
   41|  46.0k|static inline uint16_t recenter_nonneg(uint16_t r, uint16_t v) {
   42|  46.0k|  if (v > (r << 1))
  ------------------
  |  Branch (42:7): [True: 293, False: 45.7k]
  ------------------
   43|    293|    return v;
   44|  45.7k|  else if (v >= r)
  ------------------
  |  Branch (44:12): [True: 16.8k, False: 28.8k]
  ------------------
   45|  16.8k|    return ((v - r) << 1);
   46|  28.8k|  else
   47|  28.8k|    return ((r - v) << 1) - 1;
   48|  46.0k|}

aom_sad8x16x3d_c:
  100|  17.9k|                               int ref_stride, uint32_t sad_array[4]) {       \
  101|  17.9k|    aom_sad##m##x##n##x4d(src, src_stride, ref_array, ref_stride, sad_array); \
  ------------------
  |  | 4782|  17.9k|#define aom_sad8x16x4d aom_sad8x16x4d_sse2
  ------------------
  102|  17.9k|  }
aom_sad8x8x3d_c:
  100|   711k|                               int ref_stride, uint32_t sad_array[4]) {       \
  101|   711k|    aom_sad##m##x##n##x4d(src, src_stride, ref_array, ref_stride, sad_array); \
  ------------------
  |  | 4823|   711k|#define aom_sad8x8x4d aom_sad8x8x4d_sse2
  ------------------
  102|   711k|  }
aom_highbd_sad8x16x3d_c:
  306|  4.17k|                                      int ref_stride, uint32_t sad_array[4]) { \
  307|  4.17k|    aom_highbd_sad##m##x##n##x4d(src, src_stride, ref_array, ref_stride,       \
  ------------------
  |  | 3242|  4.17k|#define aom_highbd_sad8x16x4d aom_highbd_sad8x16x4d_sse2
  ------------------
  308|  4.17k|                                 sad_array);                                   \
  309|  4.17k|  }
aom_highbd_sad8x8x3d_c:
  306|  47.6k|                                      int ref_stride, uint32_t sad_array[4]) { \
  307|  47.6k|    aom_highbd_sad##m##x##n##x4d(src, src_stride, ref_array, ref_stride,       \
  ------------------
  |  | 3283|  47.6k|#define aom_highbd_sad8x8x4d aom_highbd_sad8x8x4d_sse2
  ------------------
  308|  47.6k|                                 sad_array);                                   \
  309|  47.6k|  }

cdef_block_avx2.c:v128_load_unaligned:
   46|   424M|SIMD_INLINE v128 v128_load_unaligned(const void *p) {
   47|   424M|#if defined(__SSSE3__)
   48|   424M|  return _mm_lddqu_si128((__m128i *)p);
   49|       |#else
   50|       |  return _mm_loadu_si128((__m128i *)p);
   51|       |#endif
   52|   424M|}
cdef_block_avx2.c:v128_sub_16:
  120|   347k|SIMD_INLINE v128 v128_sub_16(v128 a, v128 b) { return _mm_sub_epi16(a, b); }
cdef_block_avx2.c:v128_shr_s16:
  562|   347k|SIMD_INLINE v128 v128_shr_s16(v128 a, unsigned int c) {
  563|   347k|  return _mm_sra_epi16(a, _mm_cvtsi32_si128((int)c));
  564|   347k|}
cdef_block_avx2.c:v128_dup_16:
   86|   347k|SIMD_INLINE v128 v128_dup_16(uint16_t x) { return _mm_set1_epi16((short)x); }
cdef_block_avx2.c:v128_add_16:
   98|  2.77M|SIMD_INLINE v128 v128_add_16(v128 a, v128 b) { return _mm_add_epi16(a, b); }
cdef_block_avx2.c:v128_shuffle_8:
  300|   260k|SIMD_INLINE v128 v128_shuffle_8(v128 x, v128 pattern) {
  301|   260k|#if defined(__SSSE3__)
  302|   260k|  return _mm_shuffle_epi8(x, pattern);
  303|       |#else
  304|       |  v128 output;
  305|       |  unsigned char *input = (unsigned char *)&x;
  306|       |  unsigned char *index = (unsigned char *)&pattern;
  307|       |  unsigned char *selected = (unsigned char *)&output;
  308|       |  int counter;
  309|       |
  310|       |  for (counter = 0; counter < 16; counter++) {
  311|       |    selected[counter] = input[index[counter] & 15];
  312|       |  }
  313|       |
  314|       |  return output;
  315|       |#endif
  316|   260k|}
cdef_block_avx2.c:v128_ziplo_16:
  155|   434k|SIMD_INLINE v128 v128_ziplo_16(v128 a, v128 b) {
  156|   434k|  return _mm_unpacklo_epi16(b, a);
  157|   434k|}
cdef_block_avx2.c:v128_ziphi_16:
  159|   434k|SIMD_INLINE v128 v128_ziphi_16(v128 a, v128 b) {
  160|   434k|  return _mm_unpackhi_epi16(b, a);
  161|   434k|}
cdef_block_avx2.c:v128_add_32:
  106|   521k|SIMD_INLINE v128 v128_add_32(v128 a, v128 b) { return _mm_add_epi32(a, b); }
cdef_block_avx2.c:v128_from_32:
   38|   781k|SIMD_INLINE v128 v128_from_32(uint32_t a, uint32_t b, uint32_t c, uint32_t d) {
   39|   781k|  return _mm_set_epi32((int)a, (int)b, (int)c, (int)d);
   40|   781k|}
cdef_block_avx2.c:v128_madd_s16:
  425|   607k|SIMD_INLINE v128 v128_madd_s16(v128 a, v128 b) { return _mm_madd_epi16(a, b); }
cdef_block_avx2.c:v128_mullo_s32:
  406|   607k|SIMD_INLINE v128 v128_mullo_s32(v128 a, v128 b) {
  407|   607k|#if defined(__SSE4_1__)
  408|   607k|  return _mm_mullo_epi32(a, b);
  409|       |#else
  410|       |  return _mm_unpacklo_epi32(
  411|       |      _mm_shuffle_epi32(_mm_mul_epu32(a, b), 8),
  412|       |      _mm_shuffle_epi32(
  413|       |          _mm_mul_epu32(_mm_srli_si128(a, 4), _mm_srli_si128(b, 4)), 8));
  414|       |#endif
  415|   607k|}
cdef_block_avx2.c:v128_dup_32:
   88|  86.8k|SIMD_INLINE v128 v128_dup_32(uint32_t x) { return _mm_set1_epi32((int)x); }
cdef_block_avx2.c:v128_ziplo_32:
  163|   347k|SIMD_INLINE v128 v128_ziplo_32(v128 a, v128 b) {
  164|   347k|  return _mm_unpacklo_epi32(b, a);
  165|   347k|}
cdef_block_avx2.c:v128_ziphi_32:
  167|   347k|SIMD_INLINE v128 v128_ziphi_32(v128 a, v128 b) {
  168|   347k|  return _mm_unpackhi_epi32(b, a);
  169|   347k|}
cdef_block_avx2.c:v128_ziplo_64:
  171|   347k|SIMD_INLINE v128 v128_ziplo_64(v128 a, v128 b) {
  172|   347k|  return _mm_unpacklo_epi64(b, a);
  173|   347k|}
cdef_block_avx2.c:v128_ziphi_64:
  175|   347k|SIMD_INLINE v128 v128_ziphi_64(v128 a, v128 b) {
  176|   347k|  return _mm_unpackhi_epi64(b, a);
  177|   347k|}
cdef_block_avx2.c:v128_max_s32:
  503|   130k|SIMD_INLINE v128 v128_max_s32(v128 a, v128 b) {
  504|   130k|#if defined(__SSE4_1__)
  505|   130k|  return _mm_max_epi32(a, b);
  506|       |#else
  507|       |  v128 mask = _mm_cmplt_epi32(b, a);
  508|       |  return _mm_or_si128(_mm_andnot_si128(mask, b), _mm_and_si128(mask, a));
  509|       |#endif
  510|   130k|}
cdef_block_avx2.c:v128_low_u32:
   20|  43.4k|SIMD_INLINE uint32_t v128_low_u32(v128 a) {
   21|  43.4k|  return (uint32_t)_mm_cvtsi128_si32(a);
   22|  43.4k|}
cdef_block_avx2.c:v128_pack_s32_s16:
  255|  43.4k|SIMD_INLINE v128 v128_pack_s32_s16(v128 a, v128 b) {
  256|  43.4k|  return _mm_packs_epi32(b, a);
  257|  43.4k|}
cdef_block_avx2.c:v128_cmpeq_32:
  526|  86.8k|SIMD_INLINE v128 v128_cmpeq_32(v128 a, v128 b) { return _mm_cmpeq_epi32(a, b); }
cdef_block_avx2.c:v128_movemask_8:
  470|  43.4k|SIMD_INLINE uint32_t v128_movemask_8(v128 a) { return _mm_movemask_epi8(a); }
cdef_block_avx2.c:v128_pack_s16_s8:
  272|  43.4k|SIMD_INLINE v128 v128_pack_s16_s8(v128 a, v128 b) {
  273|  43.4k|  return _mm_packs_epi16(b, a);
  274|  43.4k|}
cdef_block_avx2.c:v128_load_aligned:
   42|  55.3M|SIMD_INLINE v128 v128_load_aligned(const void *p) {
   43|  55.3M|  return _mm_load_si128((__m128i *)p);
   44|  55.3M|}
cdef_block_avx2.c:v128_high_v64:
   28|  33.0M|SIMD_INLINE v64 v128_high_v64(v128 a) { return _mm_srli_si128(a, 8); }
cdef_block_avx2.c:v128_low_v64:
   24|  33.1M|SIMD_INLINE v64 v128_low_v64(v128 a) {
   25|  33.1M|  return _mm_unpacklo_epi64(a, v64_zero());
   26|  33.1M|}
cdef_block_avx2.c:v128_from_v64:
   30|  85.1M|SIMD_INLINE v128 v128_from_v64(v64 a, v64 b) {
   31|  85.1M|  return _mm_unpacklo_epi64(b, a);
   32|  85.1M|}
cdef_block_avx2.c:v128_pack_s16_u8:
  268|   440k|SIMD_INLINE v128 v128_pack_s16_u8(v128 a, v128 b) {
  269|   440k|  return _mm_packus_epi16(b, a);
  270|   440k|}
cdef_block_avx2.c:v128_store_unaligned:
   58|  11.9M|SIMD_INLINE void v128_store_unaligned(void *p, v128 a) {
   59|  11.9M|  _mm_storeu_si128((__m128i *)p, a);
   60|  11.9M|}

cdef_block_avx2.c:v256_dup_16:
   83|   355M|SIMD_INLINE v256 v256_dup_16(uint16_t x) { return _mm256_set1_epi16((short)x); }
cdef_block_avx2.c:v256_zero:
   79|  60.2M|SIMD_INLINE v256 v256_zero(void) { return _mm256_setzero_si256(); }
cdef_block_avx2.c:v256_from_v128:
   50|   268M|SIMD_INLINE v256 v256_from_v128(v128 a, v128 b) {
   51|       |  // gcc seems to be missing _mm256_set_m128i()
   52|       |  return _mm256_inserti128_si256(_mm256_castsi128_si256(b), a, 1);
   53|   268M|}
cdef_block_avx2.c:v256_sub_16:
  121|   241M|SIMD_INLINE v256 v256_sub_16(v256 a, v256 b) { return _mm256_sub_epi16(a, b); }
cdef_block_avx2.c:v256_abs_s16:
  135|   241M|SIMD_INLINE v256 v256_abs_s16(v256 a) { return _mm256_abs_epi16(a); }
cdef_block_avx2.c:v256_ssub_u16:
  127|   242M|SIMD_INLINE v256 v256_ssub_u16(v256 a, v256 b) {
  128|   242M|  return _mm256_subs_epu16(a, b);
  129|   242M|}
cdef_block_avx2.c:v256_shr_u16:
  622|   242M|SIMD_INLINE v256 v256_shr_u16(v256 a, unsigned int c) {
  623|   242M|  return _mm256_srl_epi16(a, _mm_cvtsi32_si128((int)c));
  624|   242M|}
cdef_block_avx2.c:v256_xor:
  493|   242M|SIMD_INLINE v256 v256_xor(v256 a, v256 b) { return _mm256_xor_si256(a, b); }
cdef_block_avx2.c:v256_add_16:
   93|   561M|SIMD_INLINE v256 v256_add_16(v256 a, v256 b) { return _mm256_add_epi16(a, b); }
cdef_block_avx2.c:v256_mullo_s16:
  506|  82.6M|SIMD_INLINE v256 v256_mullo_s16(v256 a, v256 b) {
  507|  82.6M|  return _mm256_mullo_epi16(a, b);
  508|  82.6M|}
cdef_block_avx2.c:v256_max_u8:
  544|   122M|SIMD_INLINE v256 v256_max_u8(v256 a, v256 b) { return _mm256_max_epu8(a, b); }
cdef_block_avx2.c:v256_and:
  495|  45.1M|SIMD_INLINE v256 v256_and(v256 a, v256 b) { return _mm256_and_si256(a, b); }
cdef_block_avx2.c:v256_min_s16:
  558|   401M|SIMD_INLINE v256 v256_min_s16(v256 a, v256 b) { return _mm256_min_epi16(a, b); }
cdef_block_avx2.c:v256_cmplt_s16:
  582|  31.1M|SIMD_INLINE v256 v256_cmplt_s16(v256 a, v256 b) {
  583|  31.1M|  return _mm256_cmpgt_epi16(b, a);
  584|  31.1M|}
cdef_block_avx2.c:v256_max_s16:
  560|  58.7M|SIMD_INLINE v256 v256_max_s16(v256 a, v256 b) { return _mm256_max_epi16(a, b); }
cdef_block_avx2.c:v256_low_v128:
   44|  31.6M|SIMD_INLINE v128 v256_low_v128(v256 a) { return _mm256_castsi256_si128(a); }
cdef_block_avx2.c:v256_pack_s16_u8:
  303|  27.2M|SIMD_INLINE v256 v256_pack_s16_u8(v256 a, v256 b) {
  304|       |  return _mm256_permute4x64_epi64(_mm256_packus_epi16(b, a),
  305|  27.2M|                                  _MM_SHUFFLE(3, 1, 2, 0));
  306|  27.2M|}
cdef_block_avx2.c:v256_high_v128:
   46|  4.55M|SIMD_INLINE v128 v256_high_v128(v256 a) {
   47|       |  return _mm256_extracti128_si256(a, 1);
   48|  4.55M|}
cdef_block_avx2.c:v256_from_v64:
   55|  42.5M|SIMD_INLINE v256 v256_from_v64(v64 a, v64 b, v64 c, v64 d) {
   56|  42.5M|  return v256_from_v128(v128_from_v64(a, b), v128_from_v64(c, d));
   57|  42.5M|}

cdef_block_avx2.c:v64_store_aligned:
   85|  49.0M|SIMD_INLINE void v64_store_aligned(void *p, v64 a) {
   86|  49.0M|  _mm_storel_epi64((__m128i *)p, a);
   87|  49.0M|}
cdef_block_avx2.c:v64_zero:
  102|  33.1M|SIMD_INLINE v64 v64_zero(void) { return _mm_setzero_si128(); }
cdef_block_avx2.c:v64_load_aligned:
   77|  21.6M|SIMD_INLINE v64 v64_load_aligned(const void *p) {
   78|  21.6M|  return _mm_loadl_epi64((__m128i *)p);
   79|  21.6M|}
cdef_block_avx2.c:v64_load_unaligned:
   81|   152M|SIMD_INLINE v64 v64_load_unaligned(const void *p) {
   82|   152M|  return _mm_loadl_epi64((__m128i *)p);
   83|   152M|}
cdef_block_avx2.c:u32_store_aligned:
   69|  17.7M|SIMD_INLINE void u32_store_aligned(void *p, uint32_t a) {
   70|  17.7M|  *((uint32_t *)p) = a;
   71|  17.7M|}
cdef_block_avx2.c:v64_high_u32:
   29|  8.94M|SIMD_INLINE uint32_t v64_high_u32(v64 a) {
   30|       |  return (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(a, 4));
   31|  8.94M|}
cdef_block_avx2.c:v64_low_u32:
   25|  8.92M|SIMD_INLINE uint32_t v64_low_u32(v64 a) {
   26|  8.92M|  return (uint32_t)_mm_cvtsi128_si32(a);
   27|  8.92M|}

aom_sum_squares_2d_i16_c:
   18|  38.8k|                                  int height) {
   19|  38.8k|  int r, c;
   20|  38.8k|  uint64_t ss = 0;
   21|       |
   22|  1.78M|  for (r = 0; r < height; r++) {
  ------------------
  |  Branch (22:15): [True: 1.74M, False: 38.8k]
  ------------------
   23|  68.6M|    for (c = 0; c < width; c++) {
  ------------------
  |  Branch (23:17): [True: 66.8M, False: 1.74M]
  ------------------
   24|  66.8M|      const int16_t v = src[c];
   25|  66.8M|      ss += v * v;
   26|  66.8M|    }
   27|  1.74M|    src += src_stride;
   28|  1.74M|  }
   29|       |
   30|  38.8k|  return ss;
   31|  38.8k|}
aom_sum_sse_2d_i16_c:
   79|   559k|                              int height, int *sum) {
   80|   559k|  int r, c;
   81|   559k|  int16_t *srcp = (int16_t *)src;
   82|   559k|  int64_t ss = 0;
   83|       |
   84|  5.42M|  for (r = 0; r < height; r++) {
  ------------------
  |  Branch (84:15): [True: 4.86M, False: 559k]
  ------------------
   85|  69.5M|    for (c = 0; c < width; c++) {
  ------------------
  |  Branch (85:17): [True: 64.7M, False: 4.86M]
  ------------------
   86|  64.7M|      const int16_t v = srcp[c];
   87|  64.7M|      ss += v * v;
   88|  64.7M|      *sum += v;
   89|  64.7M|    }
   90|  4.86M|    srcp += src_stride;
   91|  4.86M|  }
   92|   559k|  return ss;
   93|   559k|}

aom_sse_odd_size:
   60|   208k|                          int b_stride, int w, int h) {
   61|   208k|  uint32_t sse;
   62|   208k|  int sum;
   63|   208k|  variance(a, a_stride, b, b_stride, w, h, &sse, &sum);
   64|   208k|  return sse;
   65|   208k|}
aom_highbd_sse_odd_size:
  291|  78.2k|                                 const uint8_t *b, int b_stride, int w, int h) {
  292|  78.2k|  uint64_t sse;
  293|  78.2k|  int64_t sum;
  294|  78.2k|  highbd_variance64(a, a_stride, b, b_stride, w, h, &sse, &sum);
  295|  78.2k|  return sse;
  296|  78.2k|}
aom_highbd_var_filter_block2d_bil_first_pass:
  386|   702k|    const uint8_t *filter) {
  387|   702k|  unsigned int i, j;
  388|   702k|  uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8);
  ------------------
  |  |   79|   702k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  389|  4.78M|  for (i = 0; i < output_height; ++i) {
  ------------------
  |  Branch (389:15): [True: 4.08M, False: 702k]
  ------------------
  390|  20.4M|    for (j = 0; j < output_width; ++j) {
  ------------------
  |  Branch (390:17): [True: 16.3M, False: 4.08M]
  ------------------
  391|  16.3M|      output_ptr[j] = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  16.3M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  392|  16.3M|          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
  393|  16.3M|          FILTER_BITS);
  394|       |
  395|  16.3M|      ++src_ptr;
  396|  16.3M|    }
  397|       |
  398|       |    // Next row...
  399|  4.08M|    src_ptr += src_pixels_per_line - output_width;
  400|  4.08M|    output_ptr += output_width;
  401|  4.08M|  }
  402|   702k|}
aom_highbd_var_filter_block2d_bil_second_pass:
  408|   702k|    const uint8_t *filter) {
  409|   702k|  unsigned int i, j;
  410|       |
  411|  4.08M|  for (i = 0; i < output_height; ++i) {
  ------------------
  |  Branch (411:15): [True: 3.38M, False: 702k]
  ------------------
  412|  16.9M|    for (j = 0; j < output_width; ++j) {
  ------------------
  |  Branch (412:17): [True: 13.5M, False: 3.38M]
  ------------------
  413|  13.5M|      output_ptr[j] = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  13.5M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  414|  13.5M|          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
  415|  13.5M|          FILTER_BITS);
  416|  13.5M|      ++src_ptr;
  417|  13.5M|    }
  418|       |
  419|  3.38M|    src_ptr += src_pixels_per_line - output_width;
  420|  3.38M|    output_ptr += output_width;
  421|  3.38M|  }
  422|   702k|}
aom_highbd_10_variance8x4_c:
  339|  1.65M|                                               uint32_t *sse) {                \
  340|  1.65M|    int sum;                                                                   \
  341|  1.65M|    int64_t var;                                                               \
  342|  1.65M|    highbd_10_variance(a, a_stride, b, b_stride, W, H, sse, &sum);             \
  343|  1.65M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));                  \
  344|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (344:12): [True: 1.65M, False: 18.4E]
  ------------------
  345|  1.65M|  }                                                                            \
aom_highbd_12_variance8x4_c:
  349|  1.92M|                                               uint32_t *sse) {                \
  350|  1.92M|    int sum;                                                                   \
  351|  1.92M|    int64_t var;                                                               \
  352|  1.92M|    highbd_12_variance(a, a_stride, b, b_stride, W, H, sse, &sum);             \
  353|  1.92M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));                  \
  354|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (354:12): [True: 1.92M, False: 18.4E]
  ------------------
  355|  1.92M|  }
aom_highbd_10_variance4x8_c:
  339|  1.82M|                                               uint32_t *sse) {                \
  340|  1.82M|    int sum;                                                                   \
  341|  1.82M|    int64_t var;                                                               \
  342|  1.82M|    highbd_10_variance(a, a_stride, b, b_stride, W, H, sse, &sum);             \
  343|  1.82M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));                  \
  344|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (344:12): [True: 1.82M, False: 18.4E]
  ------------------
  345|  1.82M|  }                                                                            \
aom_highbd_12_variance4x8_c:
  349|  2.30M|                                               uint32_t *sse) {                \
  350|  2.30M|    int sum;                                                                   \
  351|  2.30M|    int64_t var;                                                               \
  352|  2.30M|    highbd_12_variance(a, a_stride, b, b_stride, W, H, sse, &sum);             \
  353|  2.30M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));                  \
  354|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (354:12): [True: 2.30M, False: 18.4E]
  ------------------
  355|  2.30M|  }
aom_highbd_10_sub_pixel_variance4x8_c:
  442|  60.1k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  443|  60.1k|    uint16_t fdata3[(H + 1) * W];                                            \
  444|  60.1k|    uint16_t temp2[H * W];                                                   \
  445|  60.1k|                                                                             \
  446|  60.1k|    aom_highbd_var_filter_block2d_bil_first_pass(                            \
  447|  60.1k|        src, fdata3, src_stride, 1, H + 1, W, bilinear_filters_2t[xoffset]); \
  448|  60.1k|    aom_highbd_var_filter_block2d_bil_second_pass(                           \
  449|  60.1k|        fdata3, temp2, W, W, H, W, bilinear_filters_2t[yoffset]);            \
  450|  60.1k|                                                                             \
  451|  60.1k|    return aom_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W, \
  ------------------
  |  |   80|  60.1k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  452|  60.1k|                                               dst, dst_stride, sse);        \
  453|  60.1k|  }                                                                          \
aom_highbd_12_sub_pixel_variance4x8_c:
  457|  82.9k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  458|  82.9k|    uint16_t fdata3[(H + 1) * W];                                            \
  459|  82.9k|    uint16_t temp2[H * W];                                                   \
  460|  82.9k|                                                                             \
  461|  82.9k|    aom_highbd_var_filter_block2d_bil_first_pass(                            \
  462|  82.9k|        src, fdata3, src_stride, 1, H + 1, W, bilinear_filters_2t[xoffset]); \
  463|  82.9k|    aom_highbd_var_filter_block2d_bil_second_pass(                           \
  464|  82.9k|        fdata3, temp2, W, W, H, W, bilinear_filters_2t[yoffset]);            \
  465|  82.9k|                                                                             \
  466|  82.9k|    return aom_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W, \
  ------------------
  |  |   80|  82.9k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  467|  82.9k|                                               dst, dst_stride, sse);        \
  468|  82.9k|  }
variance.c:variance:
   40|   208k|                     int b_stride, int w, int h, uint32_t *sse, int *sum) {
   41|   208k|  int i, j;
   42|   208k|  int tsum = 0;
   43|   208k|  uint32_t tsse = 0;
   44|       |
   45|  1.23M|  for (i = 0; i < h; ++i) {
  ------------------
  |  Branch (45:15): [True: 1.02M, False: 208k]
  ------------------
   46|  8.15M|    for (j = 0; j < w; ++j) {
  ------------------
  |  Branch (46:17): [True: 7.12M, False: 1.02M]
  ------------------
   47|  7.12M|      const int diff = a[j] - b[j];
   48|  7.12M|      tsum += diff;
   49|  7.12M|      tsse += diff * diff;
   50|  7.12M|    }
   51|       |
   52|  1.02M|    a += a_stride;
   53|  1.02M|    b += b_stride;
   54|  1.02M|  }
   55|   208k|  *sum = tsum;
   56|   208k|  *sse = tsse;
   57|   208k|}
variance.c:highbd_variance64:
  270|  7.78M|                              uint64_t *sse, int64_t *sum) {
  271|  7.78M|  const uint16_t *a = CONVERT_TO_SHORTPTR(a8);
  ------------------
  |  |   79|  7.78M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  272|  7.78M|  const uint16_t *b = CONVERT_TO_SHORTPTR(b8);
  ------------------
  |  |   79|  7.78M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  273|  7.78M|  int64_t tsum = 0;
  274|  7.78M|  uint64_t tsse = 0;
  275|  55.5M|  for (int i = 0; i < h; ++i) {
  ------------------
  |  Branch (275:19): [True: 47.7M, False: 7.78M]
  ------------------
  276|  47.7M|    int32_t lsum = 0;
  277|   296M|    for (int j = 0; j < w; ++j) {
  ------------------
  |  Branch (277:21): [True: 248M, False: 47.7M]
  ------------------
  278|   248M|      const int diff = a[j] - b[j];
  279|   248M|      lsum += diff;
  280|   248M|      tsse += (uint32_t)(diff * diff);
  281|   248M|    }
  282|  47.7M|    tsum += lsum;
  283|  47.7M|    a += a_stride;
  284|  47.7M|    b += b_stride;
  285|  47.7M|  }
  286|  7.78M|  *sum = tsum;
  287|  7.78M|  *sse = tsse;
  288|  7.78M|}
variance.c:highbd_10_variance:
  310|  3.47M|                               uint32_t *sse, int *sum) {
  311|  3.47M|  uint64_t sse_long = 0;
  312|  3.47M|  int64_t sum_long = 0;
  313|  3.47M|  highbd_variance64(a8, a_stride, b8, b_stride, w, h, &sse_long, &sum_long);
  314|  3.47M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 4);
  ------------------
  |  |   41|  3.47M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  315|  3.47M|  *sum = (int)ROUND_POWER_OF_TWO(sum_long, 2);
  ------------------
  |  |   41|  3.47M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  316|  3.47M|}
variance.c:highbd_12_variance:
  320|  4.23M|                               uint32_t *sse, int *sum) {
  321|  4.23M|  uint64_t sse_long = 0;
  322|  4.23M|  int64_t sum_long = 0;
  323|  4.23M|  highbd_variance64(a8, a_stride, b8, b_stride, w, h, &sse_long, &sum_long);
  324|  4.23M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 8);
  ------------------
  |  |   41|  4.23M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  325|  4.23M|  *sum = (int)ROUND_POWER_OF_TWO(sum_long, 4);
  ------------------
  |  |   41|  4.23M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  326|  4.23M|}

aom_convolve_copy_avx2:
   29|  40.9M|                            uint8_t *dst, ptrdiff_t dst_stride, int w, int h) {
   30|       |  // The w == 16 case uses _mm_store_si128(), which requires its output address
   31|       |  // be aligned on a 16-byte boundary.
   32|  40.9M|  if (w == 16) {
  ------------------
  |  Branch (32:7): [True: 1.18M, False: 39.7M]
  ------------------
   33|  1.18M|    assert(!((intptr_t)dst % 16));
   34|  1.18M|    assert(!(dst_stride % 16));
   35|  1.18M|  }
   36|       |
   37|  40.9M|  if (w == 2) {
  ------------------
  |  Branch (37:7): [True: 0, False: 40.9M]
  ------------------
   38|      0|    do {
   39|      0|      memmove(dst, src, 2 * sizeof(*src));
   40|      0|      src += src_stride;
   41|      0|      dst += dst_stride;
   42|      0|      memmove(dst, src, 2 * sizeof(*src));
   43|      0|      src += src_stride;
   44|      0|      dst += dst_stride;
   45|      0|      h -= 2;
   46|      0|    } while (h);
  ------------------
  |  Branch (46:14): [True: 0, False: 0]
  ------------------
   47|  40.9M|  } else if (w == 4) {
  ------------------
  |  Branch (47:14): [True: 22.7M, False: 18.1M]
  ------------------
   48|  53.3M|    do {
   49|  53.3M|      memmove(dst, src, 4 * sizeof(*src));
   50|  53.3M|      src += src_stride;
   51|  53.3M|      dst += dst_stride;
   52|  53.3M|      memmove(dst, src, 4 * sizeof(*src));
   53|  53.3M|      src += src_stride;
   54|  53.3M|      dst += dst_stride;
   55|  53.3M|      h -= 2;
   56|  53.3M|    } while (h);
  ------------------
  |  Branch (56:14): [True: 30.5M, False: 22.7M]
  ------------------
   57|  22.7M|  } else if (w == 8) {
  ------------------
  |  Branch (57:14): [True: 16.9M, False: 1.26M]
  ------------------
   58|  69.4M|    do {
   59|  69.4M|      __m128i s[2];
   60|  69.4M|      s[0] = _mm_loadl_epi64((__m128i *)src);
   61|  69.4M|      src += src_stride;
   62|  69.4M|      s[1] = _mm_loadl_epi64((__m128i *)src);
   63|  69.4M|      src += src_stride;
   64|  69.4M|      _mm_storel_epi64((__m128i *)dst, s[0]);
   65|  69.4M|      dst += dst_stride;
   66|  69.4M|      _mm_storel_epi64((__m128i *)dst, s[1]);
   67|  69.4M|      dst += dst_stride;
   68|  69.4M|      h -= 2;
   69|  69.4M|    } while (h);
  ------------------
  |  Branch (69:14): [True: 52.5M, False: 16.9M]
  ------------------
   70|  16.9M|  } else if (w == 16) {
  ------------------
  |  Branch (70:14): [True: 1.18M, False: 74.2k]
  ------------------
   71|  8.31M|    do {
   72|  8.31M|      __m128i s[2];
   73|  8.31M|      s[0] = _mm_loadu_si128((__m128i *)src);
   74|  8.31M|      src += src_stride;
   75|  8.31M|      s[1] = _mm_loadu_si128((__m128i *)src);
   76|  8.31M|      src += src_stride;
   77|  8.31M|      _mm_store_si128((__m128i *)dst, s[0]);
   78|  8.31M|      dst += dst_stride;
   79|  8.31M|      _mm_store_si128((__m128i *)dst, s[1]);
   80|  8.31M|      dst += dst_stride;
   81|  8.31M|      h -= 2;
   82|  8.31M|    } while (h);
  ------------------
  |  Branch (82:14): [True: 7.12M, False: 1.18M]
  ------------------
   83|  1.18M|  } else if (w == 32) {
  ------------------
  |  Branch (83:14): [True: 178k, False: 18.4E]
  ------------------
   84|  2.70M|    do {
   85|  2.70M|      __m256i s[2];
   86|  2.70M|      s[0] = _mm256_loadu_si256((__m256i *)src);
   87|  2.70M|      src += src_stride;
   88|  2.70M|      s[1] = _mm256_loadu_si256((__m256i *)src);
   89|  2.70M|      src += src_stride;
   90|  2.70M|      _mm256_storeu_si256((__m256i *)dst, s[0]);
   91|  2.70M|      dst += dst_stride;
   92|  2.70M|      _mm256_storeu_si256((__m256i *)dst, s[1]);
   93|  2.70M|      dst += dst_stride;
   94|  2.70M|      h -= 2;
   95|  2.70M|    } while (h);
  ------------------
  |  Branch (95:14): [True: 2.52M, False: 178k]
  ------------------
   96|  18.4E|  } else if (w == 64) {
  ------------------
  |  Branch (96:14): [True: 20.8k, False: 18.4E]
  ------------------
   97|   627k|    do {
   98|   627k|      __m256i s[4];
   99|   627k|      s[0] = _mm256_loadu_si256((__m256i *)(src + 0 * 32));
  100|   627k|      s[1] = _mm256_loadu_si256((__m256i *)(src + 1 * 32));
  101|   627k|      src += src_stride;
  102|   627k|      s[2] = _mm256_loadu_si256((__m256i *)(src + 0 * 32));
  103|   627k|      s[3] = _mm256_loadu_si256((__m256i *)(src + 1 * 32));
  104|   627k|      src += src_stride;
  105|   627k|      _mm256_storeu_si256((__m256i *)(dst + 0 * 32), s[0]);
  106|   627k|      _mm256_storeu_si256((__m256i *)(dst + 1 * 32), s[1]);
  107|   627k|      dst += dst_stride;
  108|   627k|      _mm256_storeu_si256((__m256i *)(dst + 0 * 32), s[2]);
  109|   627k|      _mm256_storeu_si256((__m256i *)(dst + 1 * 32), s[3]);
  110|   627k|      dst += dst_stride;
  111|   627k|      h -= 2;
  112|   627k|    } while (h);
  ------------------
  |  Branch (112:14): [True: 606k, False: 20.8k]
  ------------------
  113|  18.4E|  } else {
  114|  18.4E|    do {
  115|  18.4E|      copy_128(src, dst);
  116|  18.4E|      src += src_stride;
  117|  18.4E|      dst += dst_stride;
  118|  18.4E|      copy_128(src, dst);
  119|  18.4E|      src += src_stride;
  120|  18.4E|      dst += dst_stride;
  121|  18.4E|      h -= 2;
  122|  18.4E|    } while (h);
  ------------------
  |  Branch (122:14): [True: 0, False: 18.4E]
  ------------------
  123|  18.4E|  }
  124|  40.9M|}
aom_highbd_convolve_copy_avx2:
  163|  20.4M|                                   int h) {
  164|       |  // The w == 8 case uses _mm_store_si128(), which requires its output address
  165|       |  // be aligned on a 16-byte boundary.
  166|  20.4M|  if (w == 8) {
  ------------------
  |  Branch (166:7): [True: 5.16M, False: 15.3M]
  ------------------
  167|  5.16M|    assert(!((intptr_t)dst % 16));
  168|  5.16M|    assert(!(dst_stride % 8));
  169|  5.16M|  }
  170|       |
  171|  20.4M|  if (w == 2) {
  ------------------
  |  Branch (171:7): [True: 8.51k, False: 20.4M]
  ------------------
  172|  13.7k|    do {
  173|  13.7k|      memmove(dst, src, 2 * sizeof(*src));
  174|  13.7k|      src += src_stride;
  175|  13.7k|      dst += dst_stride;
  176|  13.7k|      memmove(dst, src, 2 * sizeof(*src));
  177|  13.7k|      src += src_stride;
  178|  13.7k|      dst += dst_stride;
  179|  13.7k|      h -= 2;
  180|  13.7k|    } while (h);
  ------------------
  |  Branch (180:14): [True: 5.25k, False: 8.51k]
  ------------------
  181|  20.4M|  } else if (w == 4) {
  ------------------
  |  Branch (181:14): [True: 15.0M, False: 5.47M]
  ------------------
  182|  34.4M|    do {
  183|  34.4M|      __m128i s[2];
  184|  34.4M|      s[0] = _mm_loadl_epi64((__m128i *)src);
  185|  34.4M|      src += src_stride;
  186|  34.4M|      s[1] = _mm_loadl_epi64((__m128i *)src);
  187|  34.4M|      src += src_stride;
  188|  34.4M|      _mm_storel_epi64((__m128i *)dst, s[0]);
  189|  34.4M|      dst += dst_stride;
  190|  34.4M|      _mm_storel_epi64((__m128i *)dst, s[1]);
  191|  34.4M|      dst += dst_stride;
  192|  34.4M|      h -= 2;
  193|  34.4M|    } while (h);
  ------------------
  |  Branch (193:14): [True: 19.4M, False: 15.0M]
  ------------------
  194|  15.0M|  } else if (w == 8) {
  ------------------
  |  Branch (194:14): [True: 5.16M, False: 310k]
  ------------------
  195|  18.3M|    do {
  196|  18.3M|      __m128i s[2];
  197|  18.3M|      s[0] = _mm_loadu_si128((__m128i *)src);
  198|  18.3M|      src += src_stride;
  199|  18.3M|      s[1] = _mm_loadu_si128((__m128i *)src);
  200|  18.3M|      src += src_stride;
  201|  18.3M|      _mm_store_si128((__m128i *)dst, s[0]);
  202|  18.3M|      dst += dst_stride;
  203|  18.3M|      _mm_store_si128((__m128i *)dst, s[1]);
  204|  18.3M|      dst += dst_stride;
  205|  18.3M|      h -= 2;
  206|  18.3M|    } while (h);
  ------------------
  |  Branch (206:14): [True: 13.2M, False: 5.16M]
  ------------------
  207|  5.16M|  } else if (w == 16) {
  ------------------
  |  Branch (207:14): [True: 295k, False: 15.3k]
  ------------------
  208|  1.67M|    do {
  209|  1.67M|      __m256i s[2];
  210|  1.67M|      s[0] = _mm256_loadu_si256((__m256i *)src);
  211|  1.67M|      src += src_stride;
  212|  1.67M|      s[1] = _mm256_loadu_si256((__m256i *)src);
  213|  1.67M|      src += src_stride;
  214|  1.67M|      _mm256_storeu_si256((__m256i *)dst, s[0]);
  215|  1.67M|      dst += dst_stride;
  216|  1.67M|      _mm256_storeu_si256((__m256i *)dst, s[1]);
  217|  1.67M|      dst += dst_stride;
  218|  1.67M|      h -= 2;
  219|  1.67M|    } while (h);
  ------------------
  |  Branch (219:14): [True: 1.37M, False: 295k]
  ------------------
  220|   295k|  } else if (w == 32) {
  ------------------
  |  Branch (220:14): [True: 34.0k, False: 18.4E]
  ------------------
  221|   414k|    do {
  222|   414k|      __m256i s[4];
  223|   414k|      s[0] = _mm256_loadu_si256((__m256i *)(src + 0 * 16));
  224|   414k|      s[1] = _mm256_loadu_si256((__m256i *)(src + 1 * 16));
  225|   414k|      src += src_stride;
  226|   414k|      s[2] = _mm256_loadu_si256((__m256i *)(src + 0 * 16));
  227|   414k|      s[3] = _mm256_loadu_si256((__m256i *)(src + 1 * 16));
  228|   414k|      src += src_stride;
  229|   414k|      _mm256_storeu_si256((__m256i *)(dst + 0 * 16), s[0]);
  230|   414k|      _mm256_storeu_si256((__m256i *)(dst + 1 * 16), s[1]);
  231|   414k|      dst += dst_stride;
  232|   414k|      _mm256_storeu_si256((__m256i *)(dst + 0 * 16), s[2]);
  233|   414k|      _mm256_storeu_si256((__m256i *)(dst + 1 * 16), s[3]);
  234|   414k|      dst += dst_stride;
  235|   414k|      h -= 2;
  236|   414k|    } while (h);
  ------------------
  |  Branch (236:14): [True: 380k, False: 34.0k]
  ------------------
  237|  18.4E|  } else if (w == 64) {
  ------------------
  |  Branch (237:14): [True: 2.11k, False: 18.4E]
  ------------------
  238|  41.4k|    do {
  239|  41.4k|      highbd_copy_64(src, dst);
  240|  41.4k|      src += src_stride;
  241|  41.4k|      dst += dst_stride;
  242|  41.4k|      highbd_copy_64(src, dst);
  243|  41.4k|      src += src_stride;
  244|  41.4k|      dst += dst_stride;
  245|  41.4k|      h -= 2;
  246|  41.4k|    } while (h);
  ------------------
  |  Branch (246:14): [True: 39.3k, False: 2.11k]
  ------------------
  247|  18.4E|  } else {
  248|  18.4E|    assert(w == 128);
  249|  18.4E|    do {
  250|  18.4E|      highbd_copy_128(src, dst);
  251|  18.4E|      src += src_stride;
  252|  18.4E|      dst += dst_stride;
  253|  18.4E|      highbd_copy_128(src, dst);
  254|  18.4E|      src += src_stride;
  255|  18.4E|      dst += dst_stride;
  256|  18.4E|      h -= 2;
  257|  18.4E|    } while (h);
  ------------------
  |  Branch (257:14): [True: 0, False: 18.4E]
  ------------------
  258|  18.4E|  }
  259|  20.4M|}
aom_convolve_copy_avx2.c:highbd_copy_64:
  128|  82.9k|static inline void highbd_copy_64(const uint16_t *src, uint16_t *dst) {
  129|  82.9k|  __m256i s[4];
  130|  82.9k|  s[0] = _mm256_loadu_si256((__m256i *)(src + 0 * 16));
  131|  82.9k|  s[1] = _mm256_loadu_si256((__m256i *)(src + 1 * 16));
  132|  82.9k|  s[2] = _mm256_loadu_si256((__m256i *)(src + 2 * 16));
  133|  82.9k|  s[3] = _mm256_loadu_si256((__m256i *)(src + 3 * 16));
  134|  82.9k|  _mm256_storeu_si256((__m256i *)(dst + 0 * 16), s[0]);
  135|  82.9k|  _mm256_storeu_si256((__m256i *)(dst + 1 * 16), s[1]);
  136|  82.9k|  _mm256_storeu_si256((__m256i *)(dst + 2 * 16), s[2]);
  137|  82.9k|  _mm256_storeu_si256((__m256i *)(dst + 3 * 16), s[3]);
  138|  82.9k|}

aom_scaled_2d_ssse3:
  774|  8.20k|                         int w, int h) {
  775|       |  // Note: Fixed size intermediate buffer, temp, places limits on parameters.
  776|       |  // 2d filtering proceeds in 2 steps:
  777|       |  //   (1) Interpolate horizontally into an intermediate buffer, temp.
  778|       |  //   (2) Interpolate temp vertically to derive the sub-pixel result.
  779|       |  // Deriving the maximum number of rows in the temp buffer (135):
  780|       |  // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative).
  781|       |  // --Largest block size is 64x64 pixels.
  782|       |  // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the
  783|       |  //   original frame (in 1/16th pixel units).
  784|       |  // --Must round-up because block may be located at sub-pixel position.
  785|       |  // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails.
  786|       |  // --((64 - 1) * 32 + 15) >> 4 + 8 = 135.
  787|       |  // --Require an additional 8 rows for the horiz_w8 transpose tail.
  788|       |  // When calling in frame scaling function, the smallest scaling factor is x1/4
  789|       |  // ==> y_step_q4 = 64. Since w and h are at most 16, the temp buffer is still
  790|       |  // big enough.
  791|  8.20k|  DECLARE_ALIGNED(16, uint8_t, temp[(135 + 8) * 64]);
  ------------------
  |  |   19|  8.20k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  792|  8.20k|  const int intermediate_height =
  793|  8.20k|      (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS;
  ------------------
  |  |   23|  8.20k|#define SUBPEL_BITS 4
  ------------------
                    (((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS;
  ------------------
  |  |   26|  8.20k|#define SUBPEL_TAPS 8
  ------------------
  794|       |
  795|  8.20k|  assert(w <= 64);
  796|  8.20k|  assert(h <= 64);
  797|  8.20k|  assert(y_step_q4 <= 32 || (y_step_q4 <= 64 && h <= 32));
  798|  8.20k|  assert(x_step_q4 <= 64);
  799|       |
  800|  8.20k|  if (w >= 8) {
  ------------------
  |  Branch (800:7): [True: 8.20k, False: 0]
  ------------------
  801|  8.20k|    scaledconvolve_horiz_w8(src - src_stride * (SUBPEL_TAPS / 2 - 1),
  ------------------
  |  |   26|  8.20k|#define SUBPEL_TAPS 8
  ------------------
  802|  8.20k|                            src_stride, temp, 64, filter, x0_q4, x_step_q4, w,
  803|  8.20k|                            intermediate_height);
  804|  8.20k|  } else {
  805|      0|    scaledconvolve_horiz_w4(src - src_stride * (SUBPEL_TAPS / 2 - 1),
  ------------------
  |  |   26|      0|#define SUBPEL_TAPS 8
  ------------------
  806|      0|                            src_stride, temp, 64, filter, x0_q4, x_step_q4, w,
  807|      0|                            intermediate_height);
  808|      0|  }
  809|       |
  810|  8.20k|  if (w >= 16) {
  ------------------
  |  Branch (810:7): [True: 8.20k, False: 0]
  ------------------
  811|  8.20k|    scaledconvolve_vert_w16(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst,
  ------------------
  |  |   26|  8.20k|#define SUBPEL_TAPS 8
  ------------------
  812|  8.20k|                            dst_stride, filter, y0_q4, y_step_q4, w, h);
  813|  8.20k|  } else if (w == 8) {
  ------------------
  |  Branch (813:14): [True: 0, False: 0]
  ------------------
  814|      0|    scaledconvolve_vert_w8(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst,
  ------------------
  |  |   26|      0|#define SUBPEL_TAPS 8
  ------------------
  815|      0|                           dst_stride, filter, y0_q4, y_step_q4, w, h);
  816|      0|  } else {
  817|      0|    scaledconvolve_vert_w4(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst,
  ------------------
  |  |   26|      0|#define SUBPEL_TAPS 8
  ------------------
  818|      0|                           dst_stride, filter, y0_q4, y_step_q4, w, h);
  819|      0|  }
  820|  8.20k|}
aom_subpixel_8t_intrin_ssse3.c:scaledconvolve_horiz_w8:
  529|  8.20k|                                    const int w, const int h) {
  530|  8.20k|  DECLARE_ALIGNED(16, uint8_t, temp[8 * 8]);
  ------------------
  |  |   19|  8.20k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  531|  8.20k|  int x, y, z;
  532|  8.20k|  src -= SUBPEL_TAPS / 2 - 1;
  ------------------
  |  |   26|  8.20k|#define SUBPEL_TAPS 8
  ------------------
  533|       |
  534|       |  // This function processes 8x8 areas. The intermediate height is not always
  535|       |  // a multiple of 8, so force it to be a multiple of 8 here.
  536|  8.20k|  y = h + (8 - (h & 0x7));
  537|       |
  538|  28.8k|  do {
  539|  28.8k|    int x_q4 = x0_q4;
  540|  86.5k|    for (x = 0; x < w; x += 8) {
  ------------------
  |  Branch (540:17): [True: 57.7k, False: 28.8k]
  ------------------
  541|       |      // process 8 src_x steps
  542|   519k|      for (z = 0; z < 8; ++z) {
  ------------------
  |  Branch (542:19): [True: 461k, False: 57.7k]
  ------------------
  543|   461k|        const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
  ------------------
  |  |   23|   461k|#define SUBPEL_BITS 4
  ------------------
  544|   461k|        const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK];
  ------------------
  |  |   24|   461k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   461k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  545|   461k|        if (x_q4 & SUBPEL_MASK) {
  ------------------
  |  |   24|   461k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   461k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (545:13): [True: 257k, False: 204k]
  ------------------
  546|   257k|          filter_horiz_w8_ssse3(src_x, src_stride, temp + (z * 8), x_filter);
  547|   257k|        } else {
  548|   204k|          int i;
  549|  1.83M|          for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (549:23): [True: 1.63M, False: 204k]
  ------------------
  550|  1.63M|            temp[z * 8 + i] = src_x[i * src_stride + 3];
  551|  1.63M|          }
  552|   204k|        }
  553|   461k|        x_q4 += x_step_q4;
  554|   461k|      }
  555|       |
  556|       |      // transpose the 8x8 filters values back to dst
  557|  57.7k|      transpose8x8_to_dst(temp, 8, dst + x, dst_stride);
  558|  57.7k|    }
  559|       |
  560|  28.8k|    src += src_stride * 8;
  561|  28.8k|    dst += dst_stride * 8;
  562|  28.8k|  } while (y -= 8);
  ------------------
  |  Branch (562:12): [True: 20.6k, False: 8.20k]
  ------------------
  563|  8.20k|}
aom_subpixel_8t_intrin_ssse3.c:filter_horiz_w8_ssse3:
  498|   257k|                                  const int16_t *const x_filter) {
  499|   257k|  __m128i s[8], ss[4], temp;
  500|       |
  501|   257k|  load_8bit_8x8(src, src_stride, s);
  502|       |  // 00 01 10 11 20 21 30 31  40 41 50 51 60 61 70 71
  503|       |  // 02 03 12 13 22 23 32 33  42 43 52 53 62 63 72 73
  504|       |  // 04 05 14 15 24 25 34 35  44 45 54 55 64 65 74 75
  505|       |  // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77
  506|   257k|  transpose_16bit_4x8(s, ss);
  507|   257k|  temp = shuffle_filter_convolve8_8_ssse3(ss, x_filter);
  508|       |  // shrink to 8 bit each 16 bits
  509|   257k|  temp = _mm_packus_epi16(temp, temp);
  510|       |  // save only 8 bytes convolve result
  511|   257k|  _mm_storel_epi64((__m128i *)dst, temp);
  512|   257k|}
aom_subpixel_8t_intrin_ssse3.c:shuffle_filter_convolve8_8_ssse3:
  489|   257k|    const __m128i *const s, const int16_t *const filter) {
  490|   257k|  __m128i f[4];
  491|   257k|  shuffle_filter_ssse3(filter, f);
  492|   257k|  return convolve8_8_ssse3(s, f);
  493|   257k|}
aom_subpixel_8t_intrin_ssse3.c:transpose8x8_to_dst:
  516|  57.7k|                                const ptrdiff_t dst_stride) {
  517|  57.7k|  __m128i s[8];
  518|       |
  519|  57.7k|  load_8bit_8x8(src, src_stride, s);
  520|  57.7k|  transpose_8bit_8x8(s, s);
  521|  57.7k|  store_8bit_8x8(s, dst, dst_stride);
  522|  57.7k|}
aom_subpixel_8t_intrin_ssse3.c:scaledconvolve_vert_w16:
  753|  8.20k|    const int y0_q4, const int y_step_q4, const int w, const int h) {
  754|  8.20k|  int y;
  755|  8.20k|  int y_q4 = y0_q4;
  756|       |
  757|  8.20k|  src -= src_stride * (SUBPEL_TAPS / 2 - 1);
  ------------------
  |  |   26|  8.20k|#define SUBPEL_TAPS 8
  ------------------
  758|   139k|  for (y = 0; y < h; ++y) {
  ------------------
  |  Branch (758:15): [True: 131k, False: 8.20k]
  ------------------
  759|   131k|    const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
  ------------------
  |  |   23|   131k|#define SUBPEL_BITS 4
  ------------------
  760|   131k|    const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK];
  ------------------
  |  |   24|   131k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   131k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  761|   131k|    if (y_q4 & SUBPEL_MASK) {
  ------------------
  |  |   24|   131k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   131k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (761:9): [True: 67.6k, False: 63.6k]
  ------------------
  762|  67.6k|      filter_vert_w16_ssse3(src_y, src_stride, &dst[y * dst_stride], y_filter,
  763|  67.6k|                            w);
  764|  67.6k|    } else {
  765|  63.6k|      memcpy(&dst[y * dst_stride], &src_y[3 * src_stride], w);
  766|  63.6k|    }
  767|   131k|    y_q4 += y_step_q4;
  768|   131k|  }
  769|  8.20k|}
aom_subpixel_8t_intrin_ssse3.c:filter_vert_w16_ssse3:
  719|  67.6k|                                  const int16_t *const filter, const int w) {
  720|  67.6k|  int i;
  721|  67.6k|  __m128i f[4];
  722|  67.6k|  shuffle_filter_ssse3(filter, f);
  723|       |
  724|   135k|  for (i = 0; i < w; i += 16) {
  ------------------
  |  Branch (724:15): [True: 67.6k, False: 67.6k]
  ------------------
  725|  67.6k|    __m128i s[8], s_lo[4], s_hi[4], temp_lo, temp_hi;
  726|       |
  727|  67.6k|    loadu_8bit_16x8(src, src_stride, s);
  728|       |
  729|       |    // merge the result together
  730|  67.6k|    s_lo[0] = _mm_unpacklo_epi8(s[0], s[1]);
  731|  67.6k|    s_hi[0] = _mm_unpackhi_epi8(s[0], s[1]);
  732|  67.6k|    s_lo[1] = _mm_unpacklo_epi8(s[2], s[3]);
  733|  67.6k|    s_hi[1] = _mm_unpackhi_epi8(s[2], s[3]);
  734|  67.6k|    s_lo[2] = _mm_unpacklo_epi8(s[4], s[5]);
  735|  67.6k|    s_hi[2] = _mm_unpackhi_epi8(s[4], s[5]);
  736|  67.6k|    s_lo[3] = _mm_unpacklo_epi8(s[6], s[7]);
  737|  67.6k|    s_hi[3] = _mm_unpackhi_epi8(s[6], s[7]);
  738|  67.6k|    temp_lo = convolve8_8_ssse3(s_lo, f);
  739|  67.6k|    temp_hi = convolve8_8_ssse3(s_hi, f);
  740|       |
  741|       |    // shrink to 8 bit each 16 bits, the first lane contain the first convolve
  742|       |    // result and the second lane contain the second convolve result
  743|  67.6k|    temp_hi = _mm_packus_epi16(temp_lo, temp_hi);
  744|  67.6k|    src += 16;
  745|       |    // save 16 bytes convolve result
  746|  67.6k|    _mm_store_si128((__m128i *)&dst[i], temp_hi);
  747|  67.6k|  }
  748|  67.6k|}

aom_hadamard_lp_8x8_dual_avx2:
  105|  3.64M|                                   ptrdiff_t src_stride, int16_t *coeff) {
  106|  3.64M|  __m256i src[8];
  107|  3.64M|  src[0] = _mm256_loadu_si256((const __m256i *)src_diff);
  108|  3.64M|  src[1] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  109|  3.64M|  src[2] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  110|  3.64M|  src[3] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  111|  3.64M|  src[4] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  112|  3.64M|  src[5] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  113|  3.64M|  src[6] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
  114|  3.64M|  src[7] = _mm256_loadu_si256((const __m256i *)(src_diff + src_stride));
  115|       |
  116|  3.64M|  hadamard_col8x2_avx2(src, 0);
  117|  3.64M|  hadamard_col8x2_avx2(src, 1);
  118|       |
  119|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  120|  3.64M|                      _mm256_permute2x128_si256(src[0], src[1], 0x20));
  121|  3.64M|  coeff += 16;
  122|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  123|  3.64M|                      _mm256_permute2x128_si256(src[2], src[3], 0x20));
  124|  3.64M|  coeff += 16;
  125|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  126|  3.64M|                      _mm256_permute2x128_si256(src[4], src[5], 0x20));
  127|  3.64M|  coeff += 16;
  128|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  129|  3.64M|                      _mm256_permute2x128_si256(src[6], src[7], 0x20));
  130|  3.64M|  coeff += 16;
  131|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  132|  3.64M|                      _mm256_permute2x128_si256(src[0], src[1], 0x31));
  133|  3.64M|  coeff += 16;
  134|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  135|  3.64M|                      _mm256_permute2x128_si256(src[2], src[3], 0x31));
  136|  3.64M|  coeff += 16;
  137|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  138|  3.64M|                      _mm256_permute2x128_si256(src[4], src[5], 0x31));
  139|  3.64M|  coeff += 16;
  140|  3.64M|  _mm256_storeu_si256((__m256i *)coeff,
  141|       |                      _mm256_permute2x128_si256(src[6], src[7], 0x31));
  142|  3.64M|}
aom_hadamard_16x16_avx2:
  190|   572k|                             tran_low_t *coeff) {
  191|   572k|  hadamard_16x16_avx2(src_diff, src_stride, coeff, 1);
  192|   572k|}
aom_hadamard_lp_16x16_avx2:
  195|   407k|                                int16_t *coeff) {
  196|   407k|  int16_t *t_coeff = coeff;
  197|  1.22M|  for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (197:21): [True: 815k, False: 407k]
  ------------------
  198|   815k|    const int16_t *src_ptr = src_diff + idx * 8 * src_stride;
  199|   815k|    aom_hadamard_lp_8x8_dual_avx2(src_ptr, src_stride,
  200|   815k|                                  t_coeff + (idx * 64 * 2));
  201|   815k|  }
  202|       |
  203|  2.03M|  for (int idx = 0; idx < 64; idx += 16) {
  ------------------
  |  Branch (203:21): [True: 1.62M, False: 407k]
  ------------------
  204|  1.62M|    const __m256i coeff0 = _mm256_loadu_si256((const __m256i *)t_coeff);
  205|  1.62M|    const __m256i coeff1 = _mm256_loadu_si256((const __m256i *)(t_coeff + 64));
  206|  1.62M|    const __m256i coeff2 = _mm256_loadu_si256((const __m256i *)(t_coeff + 128));
  207|  1.62M|    const __m256i coeff3 = _mm256_loadu_si256((const __m256i *)(t_coeff + 192));
  208|       |
  209|  1.62M|    __m256i b0 = _mm256_add_epi16(coeff0, coeff1);
  210|  1.62M|    __m256i b1 = _mm256_sub_epi16(coeff0, coeff1);
  211|  1.62M|    __m256i b2 = _mm256_add_epi16(coeff2, coeff3);
  212|  1.62M|    __m256i b3 = _mm256_sub_epi16(coeff2, coeff3);
  213|       |
  214|  1.62M|    b0 = _mm256_srai_epi16(b0, 1);
  215|  1.62M|    b1 = _mm256_srai_epi16(b1, 1);
  216|  1.62M|    b2 = _mm256_srai_epi16(b2, 1);
  217|  1.62M|    b3 = _mm256_srai_epi16(b3, 1);
  218|  1.62M|    _mm256_storeu_si256((__m256i *)coeff, _mm256_add_epi16(b0, b2));
  219|  1.62M|    _mm256_storeu_si256((__m256i *)(coeff + 64), _mm256_add_epi16(b1, b3));
  220|  1.62M|    _mm256_storeu_si256((__m256i *)(coeff + 128), _mm256_sub_epi16(b0, b2));
  221|  1.62M|    _mm256_storeu_si256((__m256i *)(coeff + 192), _mm256_sub_epi16(b1, b3));
  222|  1.62M|    coeff += 16;
  223|  1.62M|    t_coeff += 16;
  224|  1.62M|  }
  225|   407k|}
aom_hadamard_32x32_avx2:
  228|  67.9k|                             tran_low_t *coeff) {
  229|       |  // For high bitdepths, it is unnecessary to store_tran_low
  230|       |  // (mult/unpack/store), then load_tran_low (load/pack) the same memory in the
  231|       |  // next stage.  Output to an intermediate buffer first, then store_tran_low()
  232|       |  // in the final stage.
  233|  67.9k|  DECLARE_ALIGNED(32, int16_t, temp_coeff[32 * 32]);
  ------------------
  |  |   19|  67.9k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  234|  67.9k|  int16_t *t_coeff = temp_coeff;
  235|  67.9k|  int idx;
  236|  67.9k|  __m256i coeff0_lo, coeff1_lo, coeff2_lo, coeff3_lo, b0_lo, b1_lo, b2_lo,
  237|  67.9k|      b3_lo;
  238|  67.9k|  __m256i coeff0_hi, coeff1_hi, coeff2_hi, coeff3_hi, b0_hi, b1_hi, b2_hi,
  239|  67.9k|      b3_hi;
  240|  67.9k|  __m256i b0, b1, b2, b3;
  241|  67.9k|  const __m256i zero = _mm256_setzero_si256();
  242|   339k|  for (idx = 0; idx < 4; ++idx) {
  ------------------
  |  Branch (242:17): [True: 271k, False: 67.9k]
  ------------------
  243|       |    // src_diff: 9 bit, dynamic range [-255, 255]
  244|   271k|    const int16_t *src_ptr =
  245|   271k|        src_diff + (idx >> 1) * 16 * src_stride + (idx & 0x01) * 16;
  246|   271k|    hadamard_16x16_avx2(src_ptr, src_stride,
  247|   271k|                        (tran_low_t *)(t_coeff + idx * 256), 0);
  248|   271k|  }
  249|       |
  250|  1.15M|  for (idx = 0; idx < 256; idx += 16) {
  ------------------
  |  Branch (250:17): [True: 1.08M, False: 67.9k]
  ------------------
  251|  1.08M|    const __m256i coeff0 = _mm256_loadu_si256((const __m256i *)t_coeff);
  252|  1.08M|    const __m256i coeff1 = _mm256_loadu_si256((const __m256i *)(t_coeff + 256));
  253|  1.08M|    const __m256i coeff2 = _mm256_loadu_si256((const __m256i *)(t_coeff + 512));
  254|  1.08M|    const __m256i coeff3 = _mm256_loadu_si256((const __m256i *)(t_coeff + 768));
  255|       |
  256|       |    // Sign extend 16 bit to 32 bit.
  257|  1.08M|    sign_extend_16bit_to_32bit_avx2(coeff0, zero, &coeff0_lo, &coeff0_hi);
  258|  1.08M|    sign_extend_16bit_to_32bit_avx2(coeff1, zero, &coeff1_lo, &coeff1_hi);
  259|  1.08M|    sign_extend_16bit_to_32bit_avx2(coeff2, zero, &coeff2_lo, &coeff2_hi);
  260|  1.08M|    sign_extend_16bit_to_32bit_avx2(coeff3, zero, &coeff3_lo, &coeff3_hi);
  261|       |
  262|  1.08M|    b0_lo = _mm256_add_epi32(coeff0_lo, coeff1_lo);
  263|  1.08M|    b0_hi = _mm256_add_epi32(coeff0_hi, coeff1_hi);
  264|       |
  265|  1.08M|    b1_lo = _mm256_sub_epi32(coeff0_lo, coeff1_lo);
  266|  1.08M|    b1_hi = _mm256_sub_epi32(coeff0_hi, coeff1_hi);
  267|       |
  268|  1.08M|    b2_lo = _mm256_add_epi32(coeff2_lo, coeff3_lo);
  269|  1.08M|    b2_hi = _mm256_add_epi32(coeff2_hi, coeff3_hi);
  270|       |
  271|  1.08M|    b3_lo = _mm256_sub_epi32(coeff2_lo, coeff3_lo);
  272|  1.08M|    b3_hi = _mm256_sub_epi32(coeff2_hi, coeff3_hi);
  273|       |
  274|  1.08M|    b0_lo = _mm256_srai_epi32(b0_lo, 2);
  275|  1.08M|    b1_lo = _mm256_srai_epi32(b1_lo, 2);
  276|  1.08M|    b2_lo = _mm256_srai_epi32(b2_lo, 2);
  277|  1.08M|    b3_lo = _mm256_srai_epi32(b3_lo, 2);
  278|       |
  279|  1.08M|    b0_hi = _mm256_srai_epi32(b0_hi, 2);
  280|  1.08M|    b1_hi = _mm256_srai_epi32(b1_hi, 2);
  281|  1.08M|    b2_hi = _mm256_srai_epi32(b2_hi, 2);
  282|  1.08M|    b3_hi = _mm256_srai_epi32(b3_hi, 2);
  283|       |
  284|  1.08M|    b0 = _mm256_packs_epi32(b0_lo, b0_hi);
  285|  1.08M|    b1 = _mm256_packs_epi32(b1_lo, b1_hi);
  286|  1.08M|    b2 = _mm256_packs_epi32(b2_lo, b2_hi);
  287|  1.08M|    b3 = _mm256_packs_epi32(b3_lo, b3_hi);
  288|       |
  289|  1.08M|    store_tran_low(_mm256_add_epi16(b0, b2), coeff);
  290|  1.08M|    store_tran_low(_mm256_add_epi16(b1, b3), coeff + 256);
  291|  1.08M|    store_tran_low(_mm256_sub_epi16(b0, b2), coeff + 512);
  292|  1.08M|    store_tran_low(_mm256_sub_epi16(b1, b3), coeff + 768);
  293|       |
  294|  1.08M|    coeff += 16;
  295|  1.08M|    t_coeff += 16;
  296|  1.08M|  }
  297|  67.9k|}
aom_highbd_hadamard_8x8_avx2:
  377|  2.52M|                                  tran_low_t *coeff) {
  378|  2.52M|  __m128i src16[8];
  379|  2.52M|  __m256i src32[8];
  380|       |
  381|  2.52M|  src16[0] = _mm_loadu_si128((const __m128i *)src_diff);
  382|  2.52M|  src16[1] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  383|  2.52M|  src16[2] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  384|  2.52M|  src16[3] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  385|  2.52M|  src16[4] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  386|  2.52M|  src16[5] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  387|  2.52M|  src16[6] = _mm_loadu_si128((const __m128i *)(src_diff += src_stride));
  388|  2.52M|  src16[7] = _mm_loadu_si128((const __m128i *)(src_diff + src_stride));
  389|       |
  390|  2.52M|  src32[0] = _mm256_cvtepi16_epi32(src16[0]);
  391|  2.52M|  src32[1] = _mm256_cvtepi16_epi32(src16[1]);
  392|  2.52M|  src32[2] = _mm256_cvtepi16_epi32(src16[2]);
  393|  2.52M|  src32[3] = _mm256_cvtepi16_epi32(src16[3]);
  394|  2.52M|  src32[4] = _mm256_cvtepi16_epi32(src16[4]);
  395|  2.52M|  src32[5] = _mm256_cvtepi16_epi32(src16[5]);
  396|  2.52M|  src32[6] = _mm256_cvtepi16_epi32(src16[6]);
  397|  2.52M|  src32[7] = _mm256_cvtepi16_epi32(src16[7]);
  398|       |
  399|  2.52M|  highbd_hadamard_col8_avx2(src32, 0);
  400|  2.52M|  highbd_hadamard_col8_avx2(src32, 1);
  401|       |
  402|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[0]);
  403|  2.52M|  coeff += 8;
  404|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[1]);
  405|  2.52M|  coeff += 8;
  406|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[2]);
  407|  2.52M|  coeff += 8;
  408|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[3]);
  409|  2.52M|  coeff += 8;
  410|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[4]);
  411|  2.52M|  coeff += 8;
  412|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[5]);
  413|  2.52M|  coeff += 8;
  414|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[6]);
  415|  2.52M|  coeff += 8;
  416|  2.52M|  _mm256_storeu_si256((__m256i *)coeff, src32[7]);
  417|  2.52M|}
aom_highbd_hadamard_16x16_avx2:
  420|   139k|                                    ptrdiff_t src_stride, tran_low_t *coeff) {
  421|   139k|  int idx;
  422|   139k|  tran_low_t *t_coeff = coeff;
  423|   698k|  for (idx = 0; idx < 4; ++idx) {
  ------------------
  |  Branch (423:17): [True: 558k, False: 139k]
  ------------------
  424|   558k|    const int16_t *src_ptr =
  425|   558k|        src_diff + (idx >> 1) * 8 * src_stride + (idx & 0x01) * 8;
  426|   558k|    aom_highbd_hadamard_8x8_avx2(src_ptr, src_stride, t_coeff + idx * 64);
  427|   558k|  }
  428|       |
  429|  1.25M|  for (idx = 0; idx < 64; idx += 8) {
  ------------------
  |  Branch (429:17): [True: 1.11M, False: 139k]
  ------------------
  430|  1.11M|    __m256i coeff0 = _mm256_loadu_si256((const __m256i *)t_coeff);
  431|  1.11M|    __m256i coeff1 = _mm256_loadu_si256((const __m256i *)(t_coeff + 64));
  432|  1.11M|    __m256i coeff2 = _mm256_loadu_si256((const __m256i *)(t_coeff + 128));
  433|  1.11M|    __m256i coeff3 = _mm256_loadu_si256((const __m256i *)(t_coeff + 192));
  434|       |
  435|  1.11M|    __m256i b0 = _mm256_add_epi32(coeff0, coeff1);
  436|  1.11M|    __m256i b1 = _mm256_sub_epi32(coeff0, coeff1);
  437|  1.11M|    __m256i b2 = _mm256_add_epi32(coeff2, coeff3);
  438|  1.11M|    __m256i b3 = _mm256_sub_epi32(coeff2, coeff3);
  439|       |
  440|  1.11M|    b0 = _mm256_srai_epi32(b0, 1);
  441|  1.11M|    b1 = _mm256_srai_epi32(b1, 1);
  442|  1.11M|    b2 = _mm256_srai_epi32(b2, 1);
  443|  1.11M|    b3 = _mm256_srai_epi32(b3, 1);
  444|       |
  445|  1.11M|    coeff0 = _mm256_add_epi32(b0, b2);
  446|  1.11M|    coeff1 = _mm256_add_epi32(b1, b3);
  447|  1.11M|    coeff2 = _mm256_sub_epi32(b0, b2);
  448|  1.11M|    coeff3 = _mm256_sub_epi32(b1, b3);
  449|       |
  450|  1.11M|    _mm256_storeu_si256((__m256i *)coeff, coeff0);
  451|  1.11M|    _mm256_storeu_si256((__m256i *)(coeff + 64), coeff1);
  452|  1.11M|    _mm256_storeu_si256((__m256i *)(coeff + 128), coeff2);
  453|  1.11M|    _mm256_storeu_si256((__m256i *)(coeff + 192), coeff3);
  454|       |
  455|  1.11M|    coeff += 8;
  456|  1.11M|    t_coeff += 8;
  457|  1.11M|  }
  458|   139k|}
aom_highbd_hadamard_32x32_avx2:
  461|  6.18k|                                    ptrdiff_t src_stride, tran_low_t *coeff) {
  462|  6.18k|  int idx;
  463|  6.18k|  tran_low_t *t_coeff = coeff;
  464|  30.9k|  for (idx = 0; idx < 4; ++idx) {
  ------------------
  |  Branch (464:17): [True: 24.7k, False: 6.18k]
  ------------------
  465|  24.7k|    const int16_t *src_ptr =
  466|  24.7k|        src_diff + (idx >> 1) * 16 * src_stride + (idx & 0x01) * 16;
  467|  24.7k|    aom_highbd_hadamard_16x16_avx2(src_ptr, src_stride, t_coeff + idx * 256);
  468|  24.7k|  }
  469|       |
  470|   204k|  for (idx = 0; idx < 256; idx += 8) {
  ------------------
  |  Branch (470:17): [True: 197k, False: 6.18k]
  ------------------
  471|   197k|    __m256i coeff0 = _mm256_loadu_si256((const __m256i *)t_coeff);
  472|   197k|    __m256i coeff1 = _mm256_loadu_si256((const __m256i *)(t_coeff + 256));
  473|   197k|    __m256i coeff2 = _mm256_loadu_si256((const __m256i *)(t_coeff + 512));
  474|   197k|    __m256i coeff3 = _mm256_loadu_si256((const __m256i *)(t_coeff + 768));
  475|       |
  476|   197k|    __m256i b0 = _mm256_add_epi32(coeff0, coeff1);
  477|   197k|    __m256i b1 = _mm256_sub_epi32(coeff0, coeff1);
  478|   197k|    __m256i b2 = _mm256_add_epi32(coeff2, coeff3);
  479|   197k|    __m256i b3 = _mm256_sub_epi32(coeff2, coeff3);
  480|       |
  481|   197k|    b0 = _mm256_srai_epi32(b0, 2);
  482|   197k|    b1 = _mm256_srai_epi32(b1, 2);
  483|   197k|    b2 = _mm256_srai_epi32(b2, 2);
  484|   197k|    b3 = _mm256_srai_epi32(b3, 2);
  485|       |
  486|   197k|    coeff0 = _mm256_add_epi32(b0, b2);
  487|   197k|    coeff1 = _mm256_add_epi32(b1, b3);
  488|   197k|    coeff2 = _mm256_sub_epi32(b0, b2);
  489|   197k|    coeff3 = _mm256_sub_epi32(b1, b3);
  490|       |
  491|   197k|    _mm256_storeu_si256((__m256i *)coeff, coeff0);
  492|   197k|    _mm256_storeu_si256((__m256i *)(coeff + 256), coeff1);
  493|   197k|    _mm256_storeu_si256((__m256i *)(coeff + 512), coeff2);
  494|   197k|    _mm256_storeu_si256((__m256i *)(coeff + 768), coeff3);
  495|       |
  496|   197k|    coeff += 8;
  497|   197k|    t_coeff += 8;
  498|   197k|  }
  499|  6.18k|}
aom_satd_avx2:
  502|  36.8M|int aom_satd_avx2(const tran_low_t *coeff, int length) {
  503|  36.8M|  __m256i accum = _mm256_setzero_si256();
  504|  36.8M|  int i;
  505|       |
  506|   276M|  for (i = 0; i < length; i += 8, coeff += 8) {
  ------------------
  |  Branch (506:15): [True: 239M, False: 36.8M]
  ------------------
  507|   239M|    const __m256i src_line = _mm256_loadu_si256((const __m256i *)coeff);
  508|   239M|    const __m256i abs = _mm256_abs_epi32(src_line);
  509|   239M|    accum = _mm256_add_epi32(accum, abs);
  510|   239M|  }
  511|       |
  512|  36.8M|  {  // 32 bit horizontal add
  513|  36.8M|    const __m256i a = _mm256_srli_si256(accum, 8);
  514|  36.8M|    const __m256i b = _mm256_add_epi32(accum, a);
  515|  36.8M|    const __m256i c = _mm256_srli_epi64(b, 32);
  516|  36.8M|    const __m256i d = _mm256_add_epi32(b, c);
  517|  36.8M|    const __m128i accum_128 = _mm_add_epi32(_mm256_castsi256_si128(d),
  518|       |                                            _mm256_extractf128_si256(d, 1));
  519|  36.8M|    return _mm_cvtsi128_si32(accum_128);
  520|  36.8M|  }
  521|  36.8M|}
aom_satd_lp_avx2:
  523|  5.74M|int aom_satd_lp_avx2(const int16_t *coeff, int length) {
  524|  5.74M|  const __m256i one = _mm256_set1_epi16(1);
  525|  5.74M|  __m256i accum = _mm256_setzero_si256();
  526|       |
  527|  30.5M|  for (int i = 0; i < length; i += 16) {
  ------------------
  |  Branch (527:19): [True: 24.7M, False: 5.74M]
  ------------------
  528|  24.7M|    const __m256i src_line = _mm256_loadu_si256((const __m256i *)coeff);
  529|  24.7M|    const __m256i abs = _mm256_abs_epi16(src_line);
  530|  24.7M|    const __m256i sum = _mm256_madd_epi16(abs, one);
  531|  24.7M|    accum = _mm256_add_epi32(accum, sum);
  532|  24.7M|    coeff += 16;
  533|  24.7M|  }
  534|       |
  535|  5.74M|  {  // 32 bit horizontal add
  536|  5.74M|    const __m256i a = _mm256_srli_si256(accum, 8);
  537|  5.74M|    const __m256i b = _mm256_add_epi32(accum, a);
  538|  5.74M|    const __m256i c = _mm256_srli_epi64(b, 32);
  539|  5.74M|    const __m256i d = _mm256_add_epi32(b, c);
  540|  5.74M|    const __m128i accum_128 = _mm_add_epi32(_mm256_castsi256_si128(d),
  541|       |                                            _mm256_extractf128_si256(d, 1));
  542|  5.74M|    return _mm_cvtsi128_si32(accum_128);
  543|  5.74M|  }
  544|  5.74M|}
aom_avg_8x8_quad_avx2:
  547|   447k|                           int *avg) {
  548|   447k|  const uint8_t *s_y0 = s + y16_idx * p + x16_idx;
  549|   447k|  const uint8_t *s_y1 = s_y0 + 8 * p;
  550|   447k|  __m256i sum0, sum1, s0, s1, s2, s3, u0;
  551|   447k|  u0 = _mm256_setzero_si256();
  552|   447k|  s0 = _mm256_sad_epu8(yy_loadu2_128(s_y1, s_y0), u0);
  553|   447k|  s1 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + p, s_y0 + p), u0);
  554|   447k|  s2 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 2 * p, s_y0 + 2 * p), u0);
  555|   447k|  s3 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 3 * p, s_y0 + 3 * p), u0);
  556|   447k|  sum0 = _mm256_add_epi16(s0, s1);
  557|   447k|  sum1 = _mm256_add_epi16(s2, s3);
  558|   447k|  s0 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 4 * p, s_y0 + 4 * p), u0);
  559|   447k|  s1 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 5 * p, s_y0 + 5 * p), u0);
  560|   447k|  s2 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 6 * p, s_y0 + 6 * p), u0);
  561|   447k|  s3 = _mm256_sad_epu8(yy_loadu2_128(s_y1 + 7 * p, s_y0 + 7 * p), u0);
  562|   447k|  sum0 = _mm256_add_epi16(sum0, _mm256_add_epi16(s0, s1));
  563|   447k|  sum1 = _mm256_add_epi16(sum1, _mm256_add_epi16(s2, s3));
  564|   447k|  sum0 = _mm256_add_epi16(sum0, sum1);
  565|       |
  566|       |  // (avg + 32) >> 6
  567|   447k|  __m256i rounding = _mm256_set1_epi32(32);
  568|   447k|  sum0 = _mm256_add_epi32(sum0, rounding);
  569|   447k|  sum0 = _mm256_srli_epi32(sum0, 6);
  570|   447k|  __m128i lo = _mm256_castsi256_si128(sum0);
  571|   447k|  __m128i hi = _mm256_extracti128_si256(sum0, 1);
  572|   447k|  avg[0] = _mm_cvtsi128_si32(lo);
  573|   447k|  avg[1] = _mm_extract_epi32(lo, 2);
  574|   447k|  avg[2] = _mm_cvtsi128_si32(hi);
  575|       |  avg[3] = _mm_extract_epi32(hi, 2);
  576|   447k|}
aom_int_pro_row_avx2:
  580|  14.5k|                          const int height, int norm_factor) {
  581|       |  // SIMD implementation assumes width and height to be multiple of 16 and 2
  582|       |  // respectively. For any odd width or height, SIMD support needs to be added.
  583|  14.5k|  assert(width % 16 == 0 && height % 2 == 0);
  584|       |
  585|  14.5k|  if (width % 32 == 0) {
  ------------------
  |  Branch (585:7): [True: 14.5k, False: 18.4E]
  ------------------
  586|  14.5k|    const __m256i zero = _mm256_setzero_si256();
  587|  58.2k|    for (int wd = 0; wd < width; wd += 32) {
  ------------------
  |  Branch (587:22): [True: 43.6k, False: 14.5k]
  ------------------
  588|  43.6k|      const uint8_t *ref_tmp = ref + wd;
  589|  43.6k|      int16_t *hbuf_tmp = hbuf + wd;
  590|  43.6k|      __m256i s0 = zero;
  591|  43.6k|      __m256i s1 = zero;
  592|  43.6k|      int idx = 0;
  593|  1.39M|      do {
  594|  1.39M|        __m256i src_line = _mm256_loadu_si256((const __m256i *)ref_tmp);
  595|  1.39M|        __m256i t0 = _mm256_unpacklo_epi8(src_line, zero);
  596|  1.39M|        __m256i t1 = _mm256_unpackhi_epi8(src_line, zero);
  597|  1.39M|        s0 = _mm256_add_epi16(s0, t0);
  598|  1.39M|        s1 = _mm256_add_epi16(s1, t1);
  599|  1.39M|        ref_tmp += ref_stride;
  600|       |
  601|  1.39M|        src_line = _mm256_loadu_si256((const __m256i *)ref_tmp);
  602|  1.39M|        t0 = _mm256_unpacklo_epi8(src_line, zero);
  603|  1.39M|        t1 = _mm256_unpackhi_epi8(src_line, zero);
  604|  1.39M|        s0 = _mm256_add_epi16(s0, t0);
  605|  1.39M|        s1 = _mm256_add_epi16(s1, t1);
  606|  1.39M|        ref_tmp += ref_stride;
  607|  1.39M|        idx += 2;
  608|  1.39M|      } while (idx < height);
  ------------------
  |  Branch (608:16): [True: 1.34M, False: 43.6k]
  ------------------
  609|  43.6k|      s0 = _mm256_srai_epi16(s0, norm_factor);
  610|  43.6k|      s1 = _mm256_srai_epi16(s1, norm_factor);
  611|  43.6k|      _mm_storeu_si128((__m128i *)(hbuf_tmp), _mm256_castsi256_si128(s0));
  612|  43.6k|      _mm_storeu_si128((__m128i *)(hbuf_tmp + 8), _mm256_castsi256_si128(s1));
  613|  43.6k|      _mm_storeu_si128((__m128i *)(hbuf_tmp + 16),
  614|  43.6k|                       _mm256_extractf128_si256(s0, 1));
  615|  43.6k|      _mm_storeu_si128((__m128i *)(hbuf_tmp + 24),
  616|  43.6k|                       _mm256_extractf128_si256(s1, 1));
  617|  43.6k|    }
  618|  18.4E|  } else if (width % 16 == 0) {
  ------------------
  |  Branch (618:14): [True: 0, False: 18.4E]
  ------------------
  619|      0|    aom_int_pro_row_sse2(hbuf, ref, ref_stride, width, height, norm_factor);
  620|      0|  }
  621|  14.5k|}
aom_int_pro_col_avx2:
  707|  14.5k|                          const int height, int norm_factor) {
  708|  14.5k|  assert(width % 16 == 0);
  709|  14.5k|  if (width == 128) {
  ------------------
  |  Branch (709:7): [True: 0, False: 14.5k]
  ------------------
  710|      0|    const __m256i zero = _mm256_setzero_si256();
  711|      0|    for (int ht = 0; ht < height; ht += 4) {
  ------------------
  |  Branch (711:22): [True: 0, False: 0]
  ------------------
  712|      0|      __m256i src[16];
  713|       |      // Load source data.
  714|      0|      load_from_src_buf(ref, &src[0], ref_stride);
  715|      0|      load_from_src_buf(ref + 32, &src[4], ref_stride);
  716|      0|      load_from_src_buf(ref + 64, &src[8], ref_stride);
  717|      0|      load_from_src_buf(ref + 96, &src[12], ref_stride);
  718|       |
  719|       |      // Row0 output: r00 x x x r01 x x x | r02 x x x r03 x x x
  720|      0|      const __m256i s0 = _mm256_add_epi16(_mm256_sad_epu8(src[0], zero),
  721|      0|                                          _mm256_sad_epu8(src[4], zero));
  722|      0|      const __m256i s1 = _mm256_add_epi16(_mm256_sad_epu8(src[8], zero),
  723|      0|                                          _mm256_sad_epu8(src[12], zero));
  724|      0|      const __m256i r0 = _mm256_add_epi16(s0, s1);
  725|       |      // Row1 output: r10 x x x r11 x x x | r12 x x x r13 x x x
  726|      0|      const __m256i s2 = _mm256_add_epi16(_mm256_sad_epu8(src[1], zero),
  727|      0|                                          _mm256_sad_epu8(src[5], zero));
  728|      0|      const __m256i s3 = _mm256_add_epi16(_mm256_sad_epu8(src[9], zero),
  729|      0|                                          _mm256_sad_epu8(src[13], zero));
  730|      0|      const __m256i r1 = _mm256_add_epi16(s2, s3);
  731|       |      // Row2 output: r20 x x x r21 x x x | r22 x x x r23 x x x
  732|      0|      const __m256i s4 = _mm256_add_epi16(_mm256_sad_epu8(src[2], zero),
  733|      0|                                          _mm256_sad_epu8(src[6], zero));
  734|      0|      const __m256i s5 = _mm256_add_epi16(_mm256_sad_epu8(src[10], zero),
  735|      0|                                          _mm256_sad_epu8(src[14], zero));
  736|      0|      const __m256i r2 = _mm256_add_epi16(s4, s5);
  737|       |      // Row3 output: r30 x x x r31 x x x | r32 x x x r33 x x x
  738|      0|      const __m256i s6 = _mm256_add_epi16(_mm256_sad_epu8(src[3], zero),
  739|      0|                                          _mm256_sad_epu8(src[7], zero));
  740|      0|      const __m256i s7 = _mm256_add_epi16(_mm256_sad_epu8(src[11], zero),
  741|      0|                                          _mm256_sad_epu8(src[15], zero));
  742|      0|      const __m256i r3 = _mm256_add_epi16(s6, s7);
  743|       |
  744|      0|      CALC_TOT_SAD_AND_STORE
  ------------------
  |  |  633|      0|  const __m256i r01 = _mm256_add_epi16(_mm256_slli_si256(r1, 2), r0);         \
  |  |  634|      0|  /* r00 r10 r20 x r01 r11 r21 x | r02 r12 r22 x r03 r13 r23 x */             \
  |  |  635|      0|  const __m256i r012 = _mm256_add_epi16(_mm256_slli_si256(r2, 4), r01);       \
  |  |  636|      0|  /* r00 r10 r20 r30 r01 r11 r21 r31 | r02 r12 r22 r32 r03 r13 r23 r33 */     \
  |  |  637|      0|  const __m256i result0 = _mm256_add_epi16(_mm256_slli_si256(r3, 6), r012);   \
  |  |  638|      0|                                                                              \
  |  |  639|      0|  const __m128i results0 = _mm_add_epi16(                                     \
  |  |  640|      0|      _mm256_castsi256_si128(result0), _mm256_extractf128_si256(result0, 1)); \
  |  |  641|      0|  const __m128i results1 =                                                    \
  |  |  642|      0|      _mm_add_epi16(results0, _mm_srli_si128(results0, 8));                   \
  |  |  643|      0|  _mm_storel_epi64((__m128i *)vbuf, _mm_srli_epi16(results1, norm_factor));
  ------------------
  745|      0|      vbuf += 4;
  746|      0|      ref += ref_stride << 2;
  747|      0|    }
  748|  14.5k|  } else if (width == 64) {
  ------------------
  |  Branch (748:14): [True: 14.5k, False: 0]
  ------------------
  749|  14.5k|    const __m256i zero = _mm256_setzero_si256();
  750|   363k|    for (int ht = 0; ht < height; ht += 4) {
  ------------------
  |  Branch (750:22): [True: 348k, False: 14.5k]
  ------------------
  751|   348k|      __m256i src[8];
  752|       |      // Load source data.
  753|   348k|      load_from_src_buf(ref, &src[0], ref_stride);
  754|   348k|      load_from_src_buf(ref + 32, &src[4], ref_stride);
  755|       |
  756|       |      // Row0 output: r00 x x x r01 x x x | r02 x x x r03 x x x
  757|   348k|      const __m256i s0 = _mm256_sad_epu8(src[0], zero);
  758|   348k|      const __m256i s1 = _mm256_sad_epu8(src[4], zero);
  759|   348k|      const __m256i r0 = _mm256_add_epi16(s0, s1);
  760|       |      // Row1 output: r10 x x x r11 x x x | r12 x x x r13 x x x
  761|   348k|      const __m256i s2 = _mm256_sad_epu8(src[1], zero);
  762|   348k|      const __m256i s3 = _mm256_sad_epu8(src[5], zero);
  763|   348k|      const __m256i r1 = _mm256_add_epi16(s2, s3);
  764|       |      // Row2 output: r20 x x x r21 x x x | r22 x x x r23 x x x
  765|   348k|      const __m256i s4 = _mm256_sad_epu8(src[2], zero);
  766|   348k|      const __m256i s5 = _mm256_sad_epu8(src[6], zero);
  767|   348k|      const __m256i r2 = _mm256_add_epi16(s4, s5);
  768|       |      // Row3 output: r30 x x x r31 x x x | r32 x x x r33 x x x
  769|   348k|      const __m256i s6 = _mm256_sad_epu8(src[3], zero);
  770|   348k|      const __m256i s7 = _mm256_sad_epu8(src[7], zero);
  771|   348k|      const __m256i r3 = _mm256_add_epi16(s6, s7);
  772|       |
  773|   348k|      CALC_TOT_SAD_AND_STORE
  ------------------
  |  |  633|   348k|  const __m256i r01 = _mm256_add_epi16(_mm256_slli_si256(r1, 2), r0);         \
  |  |  634|   348k|  /* r00 r10 r20 x r01 r11 r21 x | r02 r12 r22 x r03 r13 r23 x */             \
  |  |  635|   348k|  const __m256i r012 = _mm256_add_epi16(_mm256_slli_si256(r2, 4), r01);       \
  |  |  636|   348k|  /* r00 r10 r20 r30 r01 r11 r21 r31 | r02 r12 r22 r32 r03 r13 r23 r33 */     \
  |  |  637|   348k|  const __m256i result0 = _mm256_add_epi16(_mm256_slli_si256(r3, 6), r012);   \
  |  |  638|   348k|                                                                              \
  |  |  639|   348k|  const __m128i results0 = _mm_add_epi16(                                     \
  |  |  640|   348k|      _mm256_castsi256_si128(result0), _mm256_extractf128_si256(result0, 1)); \
  |  |  641|   348k|  const __m128i results1 =                                                    \
  |  |  642|   348k|      _mm_add_epi16(results0, _mm_srli_si128(results0, 8));                   \
  |  |  643|   348k|  _mm_storel_epi64((__m128i *)vbuf, _mm_srli_epi16(results1, norm_factor));
  ------------------
  774|   348k|      vbuf += 4;
  775|   348k|      ref += ref_stride << 2;
  776|   348k|    }
  777|  14.5k|  } else if (width == 32) {
  ------------------
  |  Branch (777:14): [True: 0, False: 0]
  ------------------
  778|      0|    assert(height % 2 == 0);
  779|      0|    const __m256i zero = _mm256_setzero_si256();
  780|      0|    for (int ht = 0; ht < height; ht += 4) {
  ------------------
  |  Branch (780:22): [True: 0, False: 0]
  ------------------
  781|      0|      __m256i src[4];
  782|       |      // Load source data.
  783|      0|      load_from_src_buf(ref, &src[0], ref_stride);
  784|       |
  785|       |      // s00 x x x s01 x x x s02 x x x s03 x x x
  786|      0|      const __m256i r0 = _mm256_sad_epu8(src[0], zero);
  787|       |      // s10 x x x s11 x x x s12 x x x s13 x x x
  788|      0|      const __m256i r1 = _mm256_sad_epu8(src[1], zero);
  789|       |      // s20 x x x s21 x x x s22 x x x s23 x x x
  790|      0|      const __m256i r2 = _mm256_sad_epu8(src[2], zero);
  791|       |      // s30 x x x s31 x x x s32 x x x s33 x x x
  792|      0|      const __m256i r3 = _mm256_sad_epu8(src[3], zero);
  793|       |
  794|      0|      CALC_TOT_SAD_AND_STORE
  ------------------
  |  |  633|      0|  const __m256i r01 = _mm256_add_epi16(_mm256_slli_si256(r1, 2), r0);         \
  |  |  634|      0|  /* r00 r10 r20 x r01 r11 r21 x | r02 r12 r22 x r03 r13 r23 x */             \
  |  |  635|      0|  const __m256i r012 = _mm256_add_epi16(_mm256_slli_si256(r2, 4), r01);       \
  |  |  636|      0|  /* r00 r10 r20 r30 r01 r11 r21 r31 | r02 r12 r22 r32 r03 r13 r23 r33 */     \
  |  |  637|      0|  const __m256i result0 = _mm256_add_epi16(_mm256_slli_si256(r3, 6), r012);   \
  |  |  638|      0|                                                                              \
  |  |  639|      0|  const __m128i results0 = _mm_add_epi16(                                     \
  |  |  640|      0|      _mm256_castsi256_si128(result0), _mm256_extractf128_si256(result0, 1)); \
  |  |  641|      0|  const __m128i results1 =                                                    \
  |  |  642|      0|      _mm_add_epi16(results0, _mm_srli_si128(results0, 8));                   \
  |  |  643|      0|  _mm_storel_epi64((__m128i *)vbuf, _mm_srli_epi16(results1, norm_factor));
  ------------------
  795|      0|      vbuf += 4;
  796|      0|      ref += ref_stride << 2;
  797|      0|    }
  798|      0|  } else if (width == 16) {
  ------------------
  |  Branch (798:14): [True: 0, False: 0]
  ------------------
  799|      0|    aom_int_pro_col_16wd_avx2(vbuf, ref, ref_stride, height, norm_factor);
  800|      0|  }
  801|  14.5k|}
aom_vector_var_avx2:
  849|   166k|int aom_vector_var_avx2(const int16_t *ref, const int16_t *src, int bwl) {
  850|   166k|  const int width = 4 << bwl;
  851|   166k|  assert(width % 16 == 0 && width <= 128);
  852|   166k|  int var = 0;
  853|       |
  854|       |  // Instead of having a loop over width 16, considered loop unrolling to avoid
  855|       |  // some addition operations.
  856|   166k|  if (width == 128) {
  ------------------
  |  Branch (856:7): [True: 0, False: 166k]
  ------------------
  857|      0|    __m256i mean = _mm256_setzero_si256();
  858|      0|    __m256i sse = _mm256_setzero_si256();
  859|       |
  860|      0|    calc_vector_mean_sse_64wd(src, ref, &mean, &sse);
  861|      0|    calc_vector_mean_sse_64wd(src + 64, ref + 64, &mean, &sse);
  862|      0|    CALC_VAR_FROM_MEAN_SSE(mean, sse)
  ------------------
  |  |  833|      0|  {                                                                          \
  |  |  834|      0|    mean = _mm256_madd_epi16(mean, _mm256_set1_epi16(1));                    \
  |  |  835|      0|    mean = _mm256_hadd_epi32(mean, sse);                                     \
  |  |  836|      0|    mean = _mm256_add_epi32(mean, _mm256_bsrli_epi128(mean, 4));             \
  |  |  837|      0|    const __m128i result = _mm_add_epi32(_mm256_castsi256_si128(mean),       \
  |  |  838|      0|                                         _mm256_extractf128_si256(mean, 1)); \
  |  |  839|      0|    /*(mean * mean): dynamic range 31 bits.*/                                \
  |  |  840|      0|    const int mean_int = _mm_extract_epi32(result, 0);                       \
  |  |  841|      0|    const int sse_int = _mm_extract_epi32(result, 2);                        \
  |  |  842|      0|    const unsigned int mean_abs = abs(mean_int);                             \
  |  |  843|      0|    var = sse_int - ((mean_abs * mean_abs) >> (bwl + 2));                    \
  |  |  844|      0|  }
  ------------------
  863|   166k|  } else if (width == 64) {
  ------------------
  |  Branch (863:14): [True: 166k, False: 18.4E]
  ------------------
  864|   166k|    __m256i mean = _mm256_setzero_si256();
  865|   166k|    __m256i sse = _mm256_setzero_si256();
  866|       |
  867|   166k|    calc_vector_mean_sse_64wd(src, ref, &mean, &sse);
  868|   166k|    CALC_VAR_FROM_MEAN_SSE(mean, sse)
  ------------------
  |  |  833|   166k|  {                                                                          \
  |  |  834|   166k|    mean = _mm256_madd_epi16(mean, _mm256_set1_epi16(1));                    \
  |  |  835|   166k|    mean = _mm256_hadd_epi32(mean, sse);                                     \
  |  |  836|   166k|    mean = _mm256_add_epi32(mean, _mm256_bsrli_epi128(mean, 4));             \
  |  |  837|   166k|    const __m128i result = _mm_add_epi32(_mm256_castsi256_si128(mean),       \
  |  |  838|   166k|                                         _mm256_extractf128_si256(mean, 1)); \
  |  |  839|   166k|    /*(mean * mean): dynamic range 31 bits.*/                                \
  |  |  840|   166k|    const int mean_int = _mm_extract_epi32(result, 0);                       \
  |  |  841|   166k|    const int sse_int = _mm_extract_epi32(result, 2);                        \
  |  |  842|   166k|    const unsigned int mean_abs = abs(mean_int);                             \
  |  |  843|   166k|    var = sse_int - ((mean_abs * mean_abs) >> (bwl + 2));                    \
  |  |  844|   166k|  }
  ------------------
  869|  18.4E|  } else if (width == 32) {
  ------------------
  |  Branch (869:14): [True: 0, False: 18.4E]
  ------------------
  870|      0|    const __m256i src_line0 = _mm256_loadu_si256((const __m256i *)src);
  871|      0|    const __m256i ref_line0 = _mm256_loadu_si256((const __m256i *)ref);
  872|      0|    const __m256i src_line1 = _mm256_loadu_si256((const __m256i *)(src + 16));
  873|      0|    const __m256i ref_line1 = _mm256_loadu_si256((const __m256i *)(ref + 16));
  874|       |
  875|      0|    const __m256i diff0 = _mm256_sub_epi16(ref_line0, src_line0);
  876|      0|    const __m256i diff1 = _mm256_sub_epi16(ref_line1, src_line1);
  877|      0|    const __m256i diff_sqr0 = _mm256_madd_epi16(diff0, diff0);
  878|      0|    const __m256i diff_sqr1 = _mm256_madd_epi16(diff1, diff1);
  879|      0|    const __m256i sse = _mm256_add_epi32(diff_sqr0, diff_sqr1);
  880|      0|    __m256i mean = _mm256_add_epi16(diff0, diff1);
  881|       |
  882|      0|    CALC_VAR_FROM_MEAN_SSE(mean, sse)
  ------------------
  |  |  833|      0|  {                                                                          \
  |  |  834|      0|    mean = _mm256_madd_epi16(mean, _mm256_set1_epi16(1));                    \
  |  |  835|      0|    mean = _mm256_hadd_epi32(mean, sse);                                     \
  |  |  836|      0|    mean = _mm256_add_epi32(mean, _mm256_bsrli_epi128(mean, 4));             \
  |  |  837|      0|    const __m128i result = _mm_add_epi32(_mm256_castsi256_si128(mean),       \
  |  |  838|      0|                                         _mm256_extractf128_si256(mean, 1)); \
  |  |  839|      0|    /*(mean * mean): dynamic range 31 bits.*/                                \
  |  |  840|      0|    const int mean_int = _mm_extract_epi32(result, 0);                       \
  |  |  841|      0|    const int sse_int = _mm_extract_epi32(result, 2);                        \
  |  |  842|      0|    const unsigned int mean_abs = abs(mean_int);                             \
  |  |  843|      0|    var = sse_int - ((mean_abs * mean_abs) >> (bwl + 2));                    \
  |  |  844|      0|  }
  ------------------
  883|  18.4E|  } else if (width == 16) {
  ------------------
  |  Branch (883:14): [True: 0, False: 18.4E]
  ------------------
  884|      0|    const __m256i src_line = _mm256_loadu_si256((const __m256i *)src);
  885|      0|    const __m256i ref_line = _mm256_loadu_si256((const __m256i *)ref);
  886|      0|    __m256i mean = _mm256_sub_epi16(ref_line, src_line);
  887|      0|    const __m256i sse = _mm256_madd_epi16(mean, mean);
  888|       |
  889|       |    CALC_VAR_FROM_MEAN_SSE(mean, sse)
  ------------------
  |  |  833|      0|  {                                                                          \
  |  |  834|      0|    mean = _mm256_madd_epi16(mean, _mm256_set1_epi16(1));                    \
  |  |  835|      0|    mean = _mm256_hadd_epi32(mean, sse);                                     \
  |  |  836|      0|    mean = _mm256_add_epi32(mean, _mm256_bsrli_epi128(mean, 4));             \
  |  |  837|      0|    const __m128i result = _mm_add_epi32(_mm256_castsi256_si128(mean),       \
  |  |  838|      0|                                         _mm256_extractf128_si256(mean, 1)); \
  |  |  839|      0|    /*(mean * mean): dynamic range 31 bits.*/                                \
  |  |  840|      0|    const int mean_int = _mm_extract_epi32(result, 0);                       \
  |  |  841|      0|    const int sse_int = _mm_extract_epi32(result, 2);                        \
  |  |  842|      0|    const unsigned int mean_abs = abs(mean_int);                             \
  |  |  843|      0|    var = sse_int - ((mean_abs * mean_abs) >> (bwl + 2));                    \
  |  |  844|      0|  }
  ------------------
  890|      0|  }
  891|   166k|  return var;
  892|   166k|}
avg_intrin_avx2.c:hadamard_col8x2_avx2:
   28|  7.29M|static void hadamard_col8x2_avx2(__m256i *in, int iter) {
   29|  7.29M|  __m256i a0 = in[0];
   30|  7.29M|  __m256i a1 = in[1];
   31|  7.29M|  __m256i a2 = in[2];
   32|  7.29M|  __m256i a3 = in[3];
   33|  7.29M|  __m256i a4 = in[4];
   34|  7.29M|  __m256i a5 = in[5];
   35|  7.29M|  __m256i a6 = in[6];
   36|  7.29M|  __m256i a7 = in[7];
   37|       |
   38|  7.29M|  __m256i b0 = _mm256_add_epi16(a0, a1);
   39|  7.29M|  __m256i b1 = _mm256_sub_epi16(a0, a1);
   40|  7.29M|  __m256i b2 = _mm256_add_epi16(a2, a3);
   41|  7.29M|  __m256i b3 = _mm256_sub_epi16(a2, a3);
   42|  7.29M|  __m256i b4 = _mm256_add_epi16(a4, a5);
   43|  7.29M|  __m256i b5 = _mm256_sub_epi16(a4, a5);
   44|  7.29M|  __m256i b6 = _mm256_add_epi16(a6, a7);
   45|  7.29M|  __m256i b7 = _mm256_sub_epi16(a6, a7);
   46|       |
   47|  7.29M|  a0 = _mm256_add_epi16(b0, b2);
   48|  7.29M|  a1 = _mm256_add_epi16(b1, b3);
   49|  7.29M|  a2 = _mm256_sub_epi16(b0, b2);
   50|  7.29M|  a3 = _mm256_sub_epi16(b1, b3);
   51|  7.29M|  a4 = _mm256_add_epi16(b4, b6);
   52|  7.29M|  a5 = _mm256_add_epi16(b5, b7);
   53|  7.29M|  a6 = _mm256_sub_epi16(b4, b6);
   54|  7.29M|  a7 = _mm256_sub_epi16(b5, b7);
   55|       |
   56|  7.29M|  if (iter == 0) {
  ------------------
  |  Branch (56:7): [True: 3.64M, False: 3.64M]
  ------------------
   57|  3.64M|    b0 = _mm256_add_epi16(a0, a4);
   58|  3.64M|    b7 = _mm256_add_epi16(a1, a5);
   59|  3.64M|    b3 = _mm256_add_epi16(a2, a6);
   60|  3.64M|    b4 = _mm256_add_epi16(a3, a7);
   61|  3.64M|    b2 = _mm256_sub_epi16(a0, a4);
   62|  3.64M|    b6 = _mm256_sub_epi16(a1, a5);
   63|  3.64M|    b1 = _mm256_sub_epi16(a2, a6);
   64|  3.64M|    b5 = _mm256_sub_epi16(a3, a7);
   65|       |
   66|  3.64M|    a0 = _mm256_unpacklo_epi16(b0, b1);
   67|  3.64M|    a1 = _mm256_unpacklo_epi16(b2, b3);
   68|  3.64M|    a2 = _mm256_unpackhi_epi16(b0, b1);
   69|  3.64M|    a3 = _mm256_unpackhi_epi16(b2, b3);
   70|  3.64M|    a4 = _mm256_unpacklo_epi16(b4, b5);
   71|  3.64M|    a5 = _mm256_unpacklo_epi16(b6, b7);
   72|  3.64M|    a6 = _mm256_unpackhi_epi16(b4, b5);
   73|  3.64M|    a7 = _mm256_unpackhi_epi16(b6, b7);
   74|       |
   75|  3.64M|    b0 = _mm256_unpacklo_epi32(a0, a1);
   76|  3.64M|    b1 = _mm256_unpacklo_epi32(a4, a5);
   77|  3.64M|    b2 = _mm256_unpackhi_epi32(a0, a1);
   78|  3.64M|    b3 = _mm256_unpackhi_epi32(a4, a5);
   79|  3.64M|    b4 = _mm256_unpacklo_epi32(a2, a3);
   80|  3.64M|    b5 = _mm256_unpacklo_epi32(a6, a7);
   81|  3.64M|    b6 = _mm256_unpackhi_epi32(a2, a3);
   82|  3.64M|    b7 = _mm256_unpackhi_epi32(a6, a7);
   83|       |
   84|  3.64M|    in[0] = _mm256_unpacklo_epi64(b0, b1);
   85|  3.64M|    in[1] = _mm256_unpackhi_epi64(b0, b1);
   86|  3.64M|    in[2] = _mm256_unpacklo_epi64(b2, b3);
   87|  3.64M|    in[3] = _mm256_unpackhi_epi64(b2, b3);
   88|  3.64M|    in[4] = _mm256_unpacklo_epi64(b4, b5);
   89|  3.64M|    in[5] = _mm256_unpackhi_epi64(b4, b5);
   90|  3.64M|    in[6] = _mm256_unpacklo_epi64(b6, b7);
   91|  3.64M|    in[7] = _mm256_unpackhi_epi64(b6, b7);
   92|  3.64M|  } else {
   93|  3.64M|    in[0] = _mm256_add_epi16(a0, a4);
   94|  3.64M|    in[7] = _mm256_add_epi16(a1, a5);
   95|  3.64M|    in[3] = _mm256_add_epi16(a2, a6);
   96|  3.64M|    in[4] = _mm256_add_epi16(a3, a7);
   97|  3.64M|    in[2] = _mm256_sub_epi16(a0, a4);
   98|  3.64M|    in[6] = _mm256_sub_epi16(a1, a5);
   99|  3.64M|    in[1] = _mm256_sub_epi16(a2, a6);
  100|  3.64M|    in[5] = _mm256_sub_epi16(a3, a7);
  101|  3.64M|  }
  102|  7.29M|}
avg_intrin_avx2.c:hadamard_16x16_avx2:
  146|   844k|                                       int is_final) {
  147|   844k|  DECLARE_ALIGNED(32, int16_t, temp_coeff[16 * 16]);
  ------------------
  |  |   19|   844k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  148|   844k|  int16_t *t_coeff = temp_coeff;
  149|   844k|  int16_t *coeff16 = (int16_t *)coeff;
  150|   844k|  int idx;
  151|  2.53M|  for (idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (151:17): [True: 1.68M, False: 844k]
  ------------------
  152|  1.68M|    const int16_t *src_ptr = src_diff + idx * 8 * src_stride;
  153|  1.68M|    aom_hadamard_lp_8x8_dual_avx2(src_ptr, src_stride,
  154|  1.68M|                                  t_coeff + (idx * 64 * 2));
  155|  1.68M|  }
  156|       |
  157|  4.22M|  for (idx = 0; idx < 64; idx += 16) {
  ------------------
  |  Branch (157:17): [True: 3.37M, False: 844k]
  ------------------
  158|  3.37M|    const __m256i coeff0 = _mm256_loadu_si256((const __m256i *)t_coeff);
  159|  3.37M|    const __m256i coeff1 = _mm256_loadu_si256((const __m256i *)(t_coeff + 64));
  160|  3.37M|    const __m256i coeff2 = _mm256_loadu_si256((const __m256i *)(t_coeff + 128));
  161|  3.37M|    const __m256i coeff3 = _mm256_loadu_si256((const __m256i *)(t_coeff + 192));
  162|       |
  163|  3.37M|    __m256i b0 = _mm256_add_epi16(coeff0, coeff1);
  164|  3.37M|    __m256i b1 = _mm256_sub_epi16(coeff0, coeff1);
  165|  3.37M|    __m256i b2 = _mm256_add_epi16(coeff2, coeff3);
  166|  3.37M|    __m256i b3 = _mm256_sub_epi16(coeff2, coeff3);
  167|       |
  168|  3.37M|    b0 = _mm256_srai_epi16(b0, 1);
  169|  3.37M|    b1 = _mm256_srai_epi16(b1, 1);
  170|  3.37M|    b2 = _mm256_srai_epi16(b2, 1);
  171|  3.37M|    b3 = _mm256_srai_epi16(b3, 1);
  172|  3.37M|    if (is_final) {
  ------------------
  |  Branch (172:9): [True: 2.29M, False: 1.08M]
  ------------------
  173|  2.29M|      store_tran_low(_mm256_add_epi16(b0, b2), coeff);
  174|  2.29M|      store_tran_low(_mm256_add_epi16(b1, b3), coeff + 64);
  175|  2.29M|      store_tran_low(_mm256_sub_epi16(b0, b2), coeff + 128);
  176|  2.29M|      store_tran_low(_mm256_sub_epi16(b1, b3), coeff + 192);
  177|  2.29M|      coeff += 16;
  178|  2.29M|    } else {
  179|  1.08M|      _mm256_storeu_si256((__m256i *)coeff16, _mm256_add_epi16(b0, b2));
  180|  1.08M|      _mm256_storeu_si256((__m256i *)(coeff16 + 64), _mm256_add_epi16(b1, b3));
  181|  1.08M|      _mm256_storeu_si256((__m256i *)(coeff16 + 128), _mm256_sub_epi16(b0, b2));
  182|  1.08M|      _mm256_storeu_si256((__m256i *)(coeff16 + 192), _mm256_sub_epi16(b1, b3));
  183|  1.08M|      coeff16 += 16;
  184|  1.08M|    }
  185|  3.37M|    t_coeff += 16;
  186|  3.37M|  }
  187|   844k|}
avg_intrin_avx2.c:sign_extend_16bit_to_32bit_avx2:
   22|  4.33M|                                                   __m256i *out_hi) {
   23|  4.33M|  const __m256i sign_bits = _mm256_cmpgt_epi16(zero, in);
   24|  4.33M|  *out_lo = _mm256_unpacklo_epi16(in, sign_bits);
   25|  4.33M|  *out_hi = _mm256_unpackhi_epi16(in, sign_bits);
   26|  4.33M|}
avg_intrin_avx2.c:highbd_hadamard_col8_avx2:
  300|  5.04M|static void highbd_hadamard_col8_avx2(__m256i *in, int iter) {
  301|  5.04M|  __m256i a0 = in[0];
  302|  5.04M|  __m256i a1 = in[1];
  303|  5.04M|  __m256i a2 = in[2];
  304|  5.04M|  __m256i a3 = in[3];
  305|  5.04M|  __m256i a4 = in[4];
  306|  5.04M|  __m256i a5 = in[5];
  307|  5.04M|  __m256i a6 = in[6];
  308|  5.04M|  __m256i a7 = in[7];
  309|       |
  310|  5.04M|  __m256i b0 = _mm256_add_epi32(a0, a1);
  311|  5.04M|  __m256i b1 = _mm256_sub_epi32(a0, a1);
  312|  5.04M|  __m256i b2 = _mm256_add_epi32(a2, a3);
  313|  5.04M|  __m256i b3 = _mm256_sub_epi32(a2, a3);
  314|  5.04M|  __m256i b4 = _mm256_add_epi32(a4, a5);
  315|  5.04M|  __m256i b5 = _mm256_sub_epi32(a4, a5);
  316|  5.04M|  __m256i b6 = _mm256_add_epi32(a6, a7);
  317|  5.04M|  __m256i b7 = _mm256_sub_epi32(a6, a7);
  318|       |
  319|  5.04M|  a0 = _mm256_add_epi32(b0, b2);
  320|  5.04M|  a1 = _mm256_add_epi32(b1, b3);
  321|  5.04M|  a2 = _mm256_sub_epi32(b0, b2);
  322|  5.04M|  a3 = _mm256_sub_epi32(b1, b3);
  323|  5.04M|  a4 = _mm256_add_epi32(b4, b6);
  324|  5.04M|  a5 = _mm256_add_epi32(b5, b7);
  325|  5.04M|  a6 = _mm256_sub_epi32(b4, b6);
  326|  5.04M|  a7 = _mm256_sub_epi32(b5, b7);
  327|       |
  328|  5.04M|  if (iter == 0) {
  ------------------
  |  Branch (328:7): [True: 2.52M, False: 2.52M]
  ------------------
  329|  2.52M|    b0 = _mm256_add_epi32(a0, a4);
  330|  2.52M|    b7 = _mm256_add_epi32(a1, a5);
  331|  2.52M|    b3 = _mm256_add_epi32(a2, a6);
  332|  2.52M|    b4 = _mm256_add_epi32(a3, a7);
  333|  2.52M|    b2 = _mm256_sub_epi32(a0, a4);
  334|  2.52M|    b6 = _mm256_sub_epi32(a1, a5);
  335|  2.52M|    b1 = _mm256_sub_epi32(a2, a6);
  336|  2.52M|    b5 = _mm256_sub_epi32(a3, a7);
  337|       |
  338|  2.52M|    a0 = _mm256_unpacklo_epi32(b0, b1);
  339|  2.52M|    a1 = _mm256_unpacklo_epi32(b2, b3);
  340|  2.52M|    a2 = _mm256_unpackhi_epi32(b0, b1);
  341|  2.52M|    a3 = _mm256_unpackhi_epi32(b2, b3);
  342|  2.52M|    a4 = _mm256_unpacklo_epi32(b4, b5);
  343|  2.52M|    a5 = _mm256_unpacklo_epi32(b6, b7);
  344|  2.52M|    a6 = _mm256_unpackhi_epi32(b4, b5);
  345|  2.52M|    a7 = _mm256_unpackhi_epi32(b6, b7);
  346|       |
  347|  2.52M|    b0 = _mm256_unpacklo_epi64(a0, a1);
  348|  2.52M|    b1 = _mm256_unpacklo_epi64(a4, a5);
  349|  2.52M|    b2 = _mm256_unpackhi_epi64(a0, a1);
  350|  2.52M|    b3 = _mm256_unpackhi_epi64(a4, a5);
  351|  2.52M|    b4 = _mm256_unpacklo_epi64(a2, a3);
  352|  2.52M|    b5 = _mm256_unpacklo_epi64(a6, a7);
  353|  2.52M|    b6 = _mm256_unpackhi_epi64(a2, a3);
  354|  2.52M|    b7 = _mm256_unpackhi_epi64(a6, a7);
  355|       |
  356|  2.52M|    in[0] = _mm256_permute2x128_si256(b0, b1, 0x20);
  357|  2.52M|    in[1] = _mm256_permute2x128_si256(b0, b1, 0x31);
  358|  2.52M|    in[2] = _mm256_permute2x128_si256(b2, b3, 0x20);
  359|  2.52M|    in[3] = _mm256_permute2x128_si256(b2, b3, 0x31);
  360|  2.52M|    in[4] = _mm256_permute2x128_si256(b4, b5, 0x20);
  361|  2.52M|    in[5] = _mm256_permute2x128_si256(b4, b5, 0x31);
  362|  2.52M|    in[6] = _mm256_permute2x128_si256(b6, b7, 0x20);
  363|  2.52M|    in[7] = _mm256_permute2x128_si256(b6, b7, 0x31);
  364|  2.52M|  } else {
  365|  2.52M|    in[0] = _mm256_add_epi32(a0, a4);
  366|  2.52M|    in[7] = _mm256_add_epi32(a1, a5);
  367|  2.52M|    in[3] = _mm256_add_epi32(a2, a6);
  368|  2.52M|    in[4] = _mm256_add_epi32(a3, a7);
  369|  2.52M|    in[2] = _mm256_sub_epi32(a0, a4);
  370|  2.52M|    in[6] = _mm256_sub_epi32(a1, a5);
  371|  2.52M|    in[1] = _mm256_sub_epi32(a2, a6);
  372|  2.52M|    in[5] = _mm256_sub_epi32(a3, a7);
  373|  2.52M|  }
  374|  5.04M|}
avg_intrin_avx2.c:load_from_src_buf:
  624|   698k|                                     const int stride) {
  625|   698k|  src[0] = _mm256_loadu_si256((const __m256i *)ref1);
  626|   698k|  src[1] = _mm256_loadu_si256((const __m256i *)(ref1 + stride));
  627|   698k|  src[2] = _mm256_loadu_si256((const __m256i *)(ref1 + (2 * stride)));
  628|   698k|  src[3] = _mm256_loadu_si256((const __m256i *)(ref1 + (3 * stride)));
  629|   698k|}
avg_intrin_avx2.c:calc_vector_mean_sse_64wd:
  805|   166k|                                             __m256i *sse) {
  806|   166k|  const __m256i src_line0 = _mm256_loadu_si256((const __m256i *)src);
  807|   166k|  const __m256i src_line1 = _mm256_loadu_si256((const __m256i *)(src + 16));
  808|   166k|  const __m256i src_line2 = _mm256_loadu_si256((const __m256i *)(src + 32));
  809|   166k|  const __m256i src_line3 = _mm256_loadu_si256((const __m256i *)(src + 48));
  810|   166k|  const __m256i ref_line0 = _mm256_loadu_si256((const __m256i *)ref);
  811|   166k|  const __m256i ref_line1 = _mm256_loadu_si256((const __m256i *)(ref + 16));
  812|   166k|  const __m256i ref_line2 = _mm256_loadu_si256((const __m256i *)(ref + 32));
  813|   166k|  const __m256i ref_line3 = _mm256_loadu_si256((const __m256i *)(ref + 48));
  814|       |
  815|   166k|  const __m256i diff0 = _mm256_sub_epi16(ref_line0, src_line0);
  816|   166k|  const __m256i diff1 = _mm256_sub_epi16(ref_line1, src_line1);
  817|   166k|  const __m256i diff2 = _mm256_sub_epi16(ref_line2, src_line2);
  818|   166k|  const __m256i diff3 = _mm256_sub_epi16(ref_line3, src_line3);
  819|   166k|  const __m256i diff_sqr0 = _mm256_madd_epi16(diff0, diff0);
  820|   166k|  const __m256i diff_sqr1 = _mm256_madd_epi16(diff1, diff1);
  821|   166k|  const __m256i diff_sqr2 = _mm256_madd_epi16(diff2, diff2);
  822|   166k|  const __m256i diff_sqr3 = _mm256_madd_epi16(diff3, diff3);
  823|       |
  824|   166k|  *mean = _mm256_add_epi16(*mean, _mm256_add_epi16(diff0, diff1));
  825|   166k|  *mean = _mm256_add_epi16(*mean, diff2);
  826|   166k|  *mean = _mm256_add_epi16(*mean, diff3);
  827|   166k|  *sse = _mm256_add_epi32(*sse, _mm256_add_epi32(diff_sqr0, diff_sqr1));
  828|   166k|  *sse = _mm256_add_epi32(*sse, diff_sqr2);
  829|   166k|  *sse = _mm256_add_epi32(*sse, diff_sqr3);
  830|   166k|}

aom_avg_8x8_sse2:
  112|   173k|unsigned int aom_avg_8x8_sse2(const uint8_t *s, int p) {
  113|   173k|  __m128i sum0, sum1, s0, s1, s2, s3, u0;
  114|   173k|  unsigned int avg = 0;
  115|   173k|  u0 = _mm_setzero_si128();
  116|   173k|  s0 = loadh_epi64((const __m128i *)(s + p),
  117|   173k|                   _mm_loadl_epi64((const __m128i *)(s)));
  118|   173k|  s1 = loadh_epi64((const __m128i *)(s + 3 * p),
  119|   173k|                   _mm_loadl_epi64((const __m128i *)(s + 2 * p)));
  120|   173k|  s2 = loadh_epi64((const __m128i *)(s + 5 * p),
  121|   173k|                   _mm_loadl_epi64((const __m128i *)(s + 4 * p)));
  122|   173k|  s3 = loadh_epi64((const __m128i *)(s + 7 * p),
  123|   173k|                   _mm_loadl_epi64((const __m128i *)(s + 6 * p)));
  124|   173k|  s0 = _mm_sad_epu8(s0, u0);
  125|   173k|  s1 = _mm_sad_epu8(s1, u0);
  126|   173k|  s2 = _mm_sad_epu8(s2, u0);
  127|   173k|  s3 = _mm_sad_epu8(s3, u0);
  128|       |
  129|   173k|  sum0 = _mm_add_epi16(s0, s1);
  130|   173k|  sum1 = _mm_add_epi16(s2, s3);
  131|   173k|  sum0 = _mm_add_epi16(sum0, sum1);
  132|       |  sum0 = _mm_add_epi16(sum0, _mm_srli_si128(sum0, 8));
  133|   173k|  avg = _mm_cvtsi128_si32(sum0);
  134|   173k|  return (avg + 32) >> 6;
  135|   173k|}
aom_avg_4x4_sse2:
  171|   418k|unsigned int aom_avg_4x4_sse2(const uint8_t *s, int p) {
  172|   418k|  __m128i s0, s1, u0;
  173|   418k|  unsigned int avg = 0;
  174|   418k|  u0 = _mm_setzero_si128();
  175|   418k|  s0 = _mm_unpacklo_epi32(xx_loadl_32(s), xx_loadl_32(s + p));
  176|   418k|  s1 = _mm_unpacklo_epi32(xx_loadl_32(s + p * 2), xx_loadl_32(s + p * 3));
  177|   418k|  s0 = _mm_sad_epu8(s0, u0);
  178|   418k|  s1 = _mm_sad_epu8(s1, u0);
  179|   418k|  s0 = _mm_add_epi16(s0, s1);
  180|   418k|  avg = _mm_cvtsi128_si32(s0);
  181|   418k|  return (avg + 8) >> 4;
  182|   418k|}
aom_hadamard_4x4_sse2:
  211|  5.56M|                           tran_low_t *coeff) {
  212|  5.56M|  __m128i src[4];
  213|  5.56M|  src[0] = _mm_loadl_epi64((const __m128i *)src_diff);
  214|  5.56M|  src[1] = _mm_loadl_epi64((const __m128i *)(src_diff += src_stride));
  215|  5.56M|  src[2] = _mm_loadl_epi64((const __m128i *)(src_diff += src_stride));
  216|  5.56M|  src[3] = _mm_loadl_epi64((const __m128i *)(src_diff + src_stride));
  217|       |
  218|  5.56M|  hadamard_col4_sse2(src, 0);
  219|  5.56M|  hadamard_col4_sse2(src, 1);
  220|       |
  221|  5.56M|  store_tran_low(_mm_unpacklo_epi64(src[0], src[1]), coeff);
  222|  5.56M|  coeff += 8;
  223|  5.56M|  store_tran_low(_mm_unpacklo_epi64(src[2], src[3]), coeff);
  224|  5.56M|}
aom_hadamard_8x8_sse2:
  355|  11.3M|                           tran_low_t *coeff) {
  356|  11.3M|  hadamard_8x8_sse2(src_diff, src_stride, coeff, 1);
  357|  11.3M|}
aom_hadamard_lp_8x8_sse2:
  392|  2.13M|                              int16_t *coeff) {
  393|  2.13M|  hadamard_lp_8x8_sse2(src_diff, src_stride, coeff);
  394|  2.13M|}
avg_intrin_sse2.c:hadamard_col4_sse2:
  184|  11.1M|static inline void hadamard_col4_sse2(__m128i *in, int iter) {
  185|  11.1M|  const __m128i a0 = in[0];
  186|  11.1M|  const __m128i a1 = in[1];
  187|  11.1M|  const __m128i a2 = in[2];
  188|  11.1M|  const __m128i a3 = in[3];
  189|  11.1M|  const __m128i b0 = _mm_srai_epi16(_mm_add_epi16(a0, a1), 1);
  190|  11.1M|  const __m128i b1 = _mm_srai_epi16(_mm_sub_epi16(a0, a1), 1);
  191|  11.1M|  const __m128i b2 = _mm_srai_epi16(_mm_add_epi16(a2, a3), 1);
  192|  11.1M|  const __m128i b3 = _mm_srai_epi16(_mm_sub_epi16(a2, a3), 1);
  193|  11.1M|  in[0] = _mm_add_epi16(b0, b2);
  194|  11.1M|  in[1] = _mm_add_epi16(b1, b3);
  195|  11.1M|  in[2] = _mm_sub_epi16(b0, b2);
  196|  11.1M|  in[3] = _mm_sub_epi16(b1, b3);
  197|       |
  198|  11.1M|  if (iter == 0) {
  ------------------
  |  Branch (198:7): [True: 5.56M, False: 5.56M]
  ------------------
  199|  5.56M|    const __m128i ba = _mm_unpacklo_epi16(in[0], in[1]);
  200|  5.56M|    const __m128i dc = _mm_unpacklo_epi16(in[2], in[3]);
  201|  5.56M|    const __m128i dcba_lo = _mm_unpacklo_epi32(ba, dc);
  202|  5.56M|    const __m128i dcba_hi = _mm_unpackhi_epi32(ba, dc);
  203|  5.56M|    in[0] = dcba_lo;
  204|  5.56M|    in[1] = _mm_srli_si128(dcba_lo, 8);
  205|  5.56M|    in[2] = dcba_hi;
  206|       |    in[3] = _mm_srli_si128(dcba_hi, 8);
  207|  5.56M|  }
  208|  11.1M|}
avg_intrin_sse2.c:hadamard_8x8_sse2:
  304|  11.3M|                                     int is_final) {
  305|  11.3M|  __m128i src[8];
  306|  11.3M|  src[0] = _mm_load_si128((const __m128i *)src_diff);
  307|  11.3M|  src[1] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  308|  11.3M|  src[2] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  309|  11.3M|  src[3] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  310|  11.3M|  src[4] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  311|  11.3M|  src[5] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  312|  11.3M|  src[6] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  313|  11.3M|  src[7] = _mm_load_si128((const __m128i *)(src_diff + src_stride));
  314|       |
  315|  11.3M|  hadamard_col8_sse2(src, 0);
  316|  11.3M|  hadamard_col8_sse2(src, 1);
  317|       |
  318|  11.3M|  if (is_final) {
  ------------------
  |  Branch (318:7): [True: 11.3M, False: 18.4E]
  ------------------
  319|  11.3M|    store_tran_low(src[0], coeff);
  320|  11.3M|    coeff += 8;
  321|  11.3M|    store_tran_low(src[1], coeff);
  322|  11.3M|    coeff += 8;
  323|  11.3M|    store_tran_low(src[2], coeff);
  324|  11.3M|    coeff += 8;
  325|  11.3M|    store_tran_low(src[3], coeff);
  326|  11.3M|    coeff += 8;
  327|  11.3M|    store_tran_low(src[4], coeff);
  328|  11.3M|    coeff += 8;
  329|  11.3M|    store_tran_low(src[5], coeff);
  330|  11.3M|    coeff += 8;
  331|  11.3M|    store_tran_low(src[6], coeff);
  332|  11.3M|    coeff += 8;
  333|  11.3M|    store_tran_low(src[7], coeff);
  334|  18.4E|  } else {
  335|  18.4E|    int16_t *coeff16 = (int16_t *)coeff;
  336|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[0]);
  337|  18.4E|    coeff16 += 8;
  338|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[1]);
  339|  18.4E|    coeff16 += 8;
  340|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[2]);
  341|  18.4E|    coeff16 += 8;
  342|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[3]);
  343|  18.4E|    coeff16 += 8;
  344|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[4]);
  345|  18.4E|    coeff16 += 8;
  346|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[5]);
  347|  18.4E|    coeff16 += 8;
  348|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[6]);
  349|  18.4E|    coeff16 += 8;
  350|  18.4E|    _mm_store_si128((__m128i *)coeff16, src[7]);
  351|  18.4E|  }
  352|  11.3M|}
avg_intrin_sse2.c:hadamard_col8_sse2:
  226|  26.9M|static inline void hadamard_col8_sse2(__m128i *in, int iter) {
  227|  26.9M|  __m128i a0 = in[0];
  228|  26.9M|  __m128i a1 = in[1];
  229|  26.9M|  __m128i a2 = in[2];
  230|  26.9M|  __m128i a3 = in[3];
  231|  26.9M|  __m128i a4 = in[4];
  232|  26.9M|  __m128i a5 = in[5];
  233|  26.9M|  __m128i a6 = in[6];
  234|  26.9M|  __m128i a7 = in[7];
  235|       |
  236|  26.9M|  __m128i b0 = _mm_add_epi16(a0, a1);
  237|  26.9M|  __m128i b1 = _mm_sub_epi16(a0, a1);
  238|  26.9M|  __m128i b2 = _mm_add_epi16(a2, a3);
  239|  26.9M|  __m128i b3 = _mm_sub_epi16(a2, a3);
  240|  26.9M|  __m128i b4 = _mm_add_epi16(a4, a5);
  241|  26.9M|  __m128i b5 = _mm_sub_epi16(a4, a5);
  242|  26.9M|  __m128i b6 = _mm_add_epi16(a6, a7);
  243|  26.9M|  __m128i b7 = _mm_sub_epi16(a6, a7);
  244|       |
  245|  26.9M|  a0 = _mm_add_epi16(b0, b2);
  246|  26.9M|  a1 = _mm_add_epi16(b1, b3);
  247|  26.9M|  a2 = _mm_sub_epi16(b0, b2);
  248|  26.9M|  a3 = _mm_sub_epi16(b1, b3);
  249|  26.9M|  a4 = _mm_add_epi16(b4, b6);
  250|  26.9M|  a5 = _mm_add_epi16(b5, b7);
  251|  26.9M|  a6 = _mm_sub_epi16(b4, b6);
  252|  26.9M|  a7 = _mm_sub_epi16(b5, b7);
  253|       |
  254|  26.9M|  if (iter == 0) {
  ------------------
  |  Branch (254:7): [True: 13.4M, False: 13.4M]
  ------------------
  255|  13.4M|    b0 = _mm_add_epi16(a0, a4);
  256|  13.4M|    b7 = _mm_add_epi16(a1, a5);
  257|  13.4M|    b3 = _mm_add_epi16(a2, a6);
  258|  13.4M|    b4 = _mm_add_epi16(a3, a7);
  259|  13.4M|    b2 = _mm_sub_epi16(a0, a4);
  260|  13.4M|    b6 = _mm_sub_epi16(a1, a5);
  261|  13.4M|    b1 = _mm_sub_epi16(a2, a6);
  262|  13.4M|    b5 = _mm_sub_epi16(a3, a7);
  263|       |
  264|  13.4M|    a0 = _mm_unpacklo_epi16(b0, b1);
  265|  13.4M|    a1 = _mm_unpacklo_epi16(b2, b3);
  266|  13.4M|    a2 = _mm_unpackhi_epi16(b0, b1);
  267|  13.4M|    a3 = _mm_unpackhi_epi16(b2, b3);
  268|  13.4M|    a4 = _mm_unpacklo_epi16(b4, b5);
  269|  13.4M|    a5 = _mm_unpacklo_epi16(b6, b7);
  270|  13.4M|    a6 = _mm_unpackhi_epi16(b4, b5);
  271|  13.4M|    a7 = _mm_unpackhi_epi16(b6, b7);
  272|       |
  273|  13.4M|    b0 = _mm_unpacklo_epi32(a0, a1);
  274|  13.4M|    b1 = _mm_unpacklo_epi32(a4, a5);
  275|  13.4M|    b2 = _mm_unpackhi_epi32(a0, a1);
  276|  13.4M|    b3 = _mm_unpackhi_epi32(a4, a5);
  277|  13.4M|    b4 = _mm_unpacklo_epi32(a2, a3);
  278|  13.4M|    b5 = _mm_unpacklo_epi32(a6, a7);
  279|  13.4M|    b6 = _mm_unpackhi_epi32(a2, a3);
  280|  13.4M|    b7 = _mm_unpackhi_epi32(a6, a7);
  281|       |
  282|  13.4M|    in[0] = _mm_unpacklo_epi64(b0, b1);
  283|  13.4M|    in[1] = _mm_unpackhi_epi64(b0, b1);
  284|  13.4M|    in[2] = _mm_unpacklo_epi64(b2, b3);
  285|  13.4M|    in[3] = _mm_unpackhi_epi64(b2, b3);
  286|  13.4M|    in[4] = _mm_unpacklo_epi64(b4, b5);
  287|  13.4M|    in[5] = _mm_unpackhi_epi64(b4, b5);
  288|  13.4M|    in[6] = _mm_unpacklo_epi64(b6, b7);
  289|  13.4M|    in[7] = _mm_unpackhi_epi64(b6, b7);
  290|  13.4M|  } else {
  291|  13.4M|    in[0] = _mm_add_epi16(a0, a4);
  292|  13.4M|    in[7] = _mm_add_epi16(a1, a5);
  293|  13.4M|    in[3] = _mm_add_epi16(a2, a6);
  294|  13.4M|    in[4] = _mm_add_epi16(a3, a7);
  295|  13.4M|    in[2] = _mm_sub_epi16(a0, a4);
  296|  13.4M|    in[6] = _mm_sub_epi16(a1, a5);
  297|  13.4M|    in[1] = _mm_sub_epi16(a2, a6);
  298|  13.4M|    in[5] = _mm_sub_epi16(a3, a7);
  299|  13.4M|  }
  300|  26.9M|}
avg_intrin_sse2.c:hadamard_lp_8x8_sse2:
  360|  2.13M|                                        ptrdiff_t src_stride, int16_t *coeff) {
  361|  2.13M|  __m128i src[8];
  362|  2.13M|  src[0] = _mm_load_si128((const __m128i *)src_diff);
  363|  2.13M|  src[1] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  364|  2.13M|  src[2] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  365|  2.13M|  src[3] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  366|  2.13M|  src[4] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  367|  2.13M|  src[5] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  368|  2.13M|  src[6] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
  369|  2.13M|  src[7] = _mm_load_si128((const __m128i *)(src_diff + src_stride));
  370|       |
  371|  2.13M|  hadamard_col8_sse2(src, 0);
  372|  2.13M|  hadamard_col8_sse2(src, 1);
  373|       |
  374|  2.13M|  _mm_store_si128((__m128i *)coeff, src[0]);
  375|  2.13M|  coeff += 8;
  376|  2.13M|  _mm_store_si128((__m128i *)coeff, src[1]);
  377|  2.13M|  coeff += 8;
  378|  2.13M|  _mm_store_si128((__m128i *)coeff, src[2]);
  379|  2.13M|  coeff += 8;
  380|  2.13M|  _mm_store_si128((__m128i *)coeff, src[3]);
  381|  2.13M|  coeff += 8;
  382|  2.13M|  _mm_store_si128((__m128i *)coeff, src[4]);
  383|  2.13M|  coeff += 8;
  384|  2.13M|  _mm_store_si128((__m128i *)coeff, src[5]);
  385|  2.13M|  coeff += 8;
  386|  2.13M|  _mm_store_si128((__m128i *)coeff, src[6]);
  387|  2.13M|  coeff += 8;
  388|  2.13M|  _mm_store_si128((__m128i *)coeff, src[7]);
  389|  2.13M|}

avg_intrin_avx2.c:store_tran_low:
   24|  13.4M|static inline void store_tran_low(__m256i a, tran_low_t *b) {
   25|  13.4M|  const __m256i one = _mm256_set1_epi16(1);
   26|  13.4M|  const __m256i a_hi = _mm256_mulhi_epi16(a, one);
   27|  13.4M|  const __m256i a_lo = _mm256_mullo_epi16(a, one);
   28|  13.4M|  const __m256i a_1 = _mm256_unpacklo_epi16(a_lo, a_hi);
   29|  13.4M|  const __m256i a_2 = _mm256_unpackhi_epi16(a_lo, a_hi);
   30|  13.4M|  _mm256_storeu_si256((__m256i *)b, a_1);
   31|  13.4M|  _mm256_storeu_si256((__m256i *)(b + 8), a_2);
   32|  13.4M|}

avg_intrin_sse2.c:store_tran_low:
   35|   101M|static inline void store_tran_low(__m128i a, tran_low_t *b) {
   36|   101M|  __m128i a_1, a_2;
   37|   101M|  unpack_trans(a, &a_1, &a_2);
   38|   101M|  _mm_store_si128((__m128i *)(b), a_1);
   39|   101M|  _mm_store_si128((__m128i *)(b + 4), a_2);
   40|   101M|}
avg_intrin_sse2.c:unpack_trans:
   25|   101M|static inline void unpack_trans(__m128i a, __m128i *a_1, __m128i *a_2) {
   26|   101M|  const __m128i one = _mm_set1_epi16(1);
   27|   101M|  const __m128i a_hi = _mm_mulhi_epi16(a, one);
   28|   101M|  const __m128i a_lo = _mm_mullo_epi16(a, one);
   29|   101M|  *a_1 = _mm_unpacklo_epi16(a_lo, a_hi);
   30|   101M|  *a_2 = _mm_unpackhi_epi16(a_lo, a_hi);
   31|   101M|}

aom_get_blk_sse_sum_avx2:
  155|   534k|                              int *x_sum, int64_t *x2_sum) {
  156|   534k|  *x_sum = 0;
  157|   534k|  *x2_sum = 0;
  158|       |
  159|   534k|  if ((bh & 3) == 0) {
  ------------------
  |  Branch (159:7): [True: 534k, False: 18.4E]
  ------------------
  160|   534k|    switch (bw) {
  161|       |        // For smaller block widths, compute multiple rows simultaneously.
  162|   486k|      case 4: sse_sum_wd4_avx2(data, stride, bh, x_sum, x2_sum); break;
  ------------------
  |  Branch (162:7): [True: 486k, False: 48.0k]
  ------------------
  163|  3.85k|      case 8: sse_sum_wd8_avx2(data, stride, bh, x_sum, x2_sum); break;
  ------------------
  |  Branch (163:7): [True: 3.85k, False: 530k]
  ------------------
  164|  25.3k|      case 16:
  ------------------
  |  Branch (164:7): [True: 25.3k, False: 509k]
  ------------------
  165|  44.1k|      case 32:
  ------------------
  |  Branch (165:7): [True: 18.8k, False: 515k]
  ------------------
  166|  44.1k|        sse_sum_wd16_avx2(data, stride, bh, x_sum, x2_sum, bw >> 4);
  167|  44.1k|        break;
  168|      0|      case 64:
  ------------------
  |  Branch (168:7): [True: 0, False: 534k]
  ------------------
  169|       |        // 32-bit variables will overflow for 64 rows at a single time, so
  170|       |        // compute 32 rows at a time.
  171|      0|        if (bh <= 32) {
  ------------------
  |  Branch (171:13): [True: 0, False: 0]
  ------------------
  172|      0|          sse_sum_wd16_avx2(data, stride, bh, x_sum, x2_sum, bw >> 4);
  173|      0|        } else {
  174|      0|          sse_sum_wd16_avx2(data, stride, 32, x_sum, x2_sum, bw >> 4);
  175|      0|          sse_sum_wd16_avx2(data + 32 * stride, stride, 32, x_sum, x2_sum,
  176|      0|                            bw >> 4);
  177|      0|        }
  178|      0|        break;
  179|       |
  180|      0|      default: aom_get_blk_sse_sum_c(data, stride, bw, bh, x_sum, x2_sum);
  ------------------
  |  Branch (180:7): [True: 0, False: 534k]
  ------------------
  181|   534k|    }
  182|  18.4E|  } else {
  183|  18.4E|    aom_get_blk_sse_sum_c(data, stride, bw, bh, x_sum, x2_sum);
  184|  18.4E|  }
  185|   534k|}
blk_sse_sum_avx2.c:sse_sum_wd4_avx2:
   46|   486k|                                    int *x_sum, int64_t *x2_sum) {
   47|   486k|  __m128i row1, row2, row3;
   48|   486k|  __m256i regx_sum, regx2_sum, load_pixels, sum_buffer, sse_buffer,
   49|   486k|      temp_buffer1, temp_buffer2, row_sum_buffer, row_sse_buffer;
   50|   486k|  const int16_t *data_tmp = data;
   51|   486k|  __m256i one = _mm256_set1_epi16(1);
   52|   486k|  regx_sum = _mm256_setzero_si256();
   53|   486k|  regx2_sum = regx_sum;
   54|   486k|  sum_buffer = _mm256_setzero_si256();
   55|   486k|  sse_buffer = sum_buffer;
   56|       |
   57|   973k|  for (int j = 0; j < (bh >> 2); ++j) {
  ------------------
  |  Branch (57:19): [True: 486k, False: 486k]
  ------------------
   58|       |    // Load 4 rows at a time.
   59|   486k|    row1 = _mm_loadl_epi64((__m128i const *)(data_tmp));
   60|   486k|    row2 = _mm_loadl_epi64((__m128i const *)(data_tmp + stride));
   61|   486k|    row1 = _mm_unpacklo_epi64(row1, row2);
   62|   486k|    row2 = _mm_loadl_epi64((__m128i const *)(data_tmp + 2 * stride));
   63|   486k|    row3 = _mm_loadl_epi64((__m128i const *)(data_tmp + 3 * stride));
   64|   486k|    row2 = _mm_unpacklo_epi64(row2, row3);
   65|   486k|    load_pixels =
   66|   486k|        _mm256_insertf128_si256(_mm256_castsi128_si256(row1), row2, 1);
   67|       |
   68|   486k|    row_sum_buffer = _mm256_madd_epi16(load_pixels, one);
   69|   486k|    row_sse_buffer = _mm256_madd_epi16(load_pixels, load_pixels);
   70|   486k|    sum_buffer = _mm256_add_epi32(row_sum_buffer, sum_buffer);
   71|   486k|    sse_buffer = _mm256_add_epi32(row_sse_buffer, sse_buffer);
   72|   486k|    data_tmp += 4 * stride;
   73|   486k|  }
   74|       |
   75|       |  // To prevent 32-bit variable overflow, unpack the elements to 64-bit.
   76|   486k|  temp_buffer1 = _mm256_unpacklo_epi32(sse_buffer, _mm256_setzero_si256());
   77|   486k|  temp_buffer2 = _mm256_unpackhi_epi32(sse_buffer, _mm256_setzero_si256());
   78|   486k|  sse_buffer = _mm256_add_epi64(temp_buffer1, temp_buffer2);
   79|   486k|  regx_sum = _mm256_add_epi32(sum_buffer, regx_sum);
   80|   486k|  regx2_sum = _mm256_add_epi64(sse_buffer, regx2_sum);
   81|       |
   82|   486k|  accumulate_sse_sum(regx_sum, regx2_sum, x_sum, x2_sum);
   83|   486k|}
blk_sse_sum_avx2.c:accumulate_sse_sum:
   17|   534k|                                      int *x_sum, int64_t *x2_sum) {
   18|   534k|  __m256i sum_buffer, sse_buffer;
   19|   534k|  __m128i out_buffer;
   20|       |
   21|       |  // Accumulate the various elements of register into first element.
   22|   534k|  sum_buffer = _mm256_permute2f128_si256(regx_sum, regx_sum, 1);
   23|   534k|  regx_sum = _mm256_add_epi32(sum_buffer, regx_sum);
   24|   534k|  regx_sum = _mm256_add_epi32(regx_sum, _mm256_srli_si256(regx_sum, 8));
   25|   534k|  regx_sum = _mm256_add_epi32(regx_sum, _mm256_srli_si256(regx_sum, 4));
   26|       |
   27|   534k|  sse_buffer = _mm256_permute2f128_si256(regx2_sum, regx2_sum, 1);
   28|   534k|  regx2_sum = _mm256_add_epi64(sse_buffer, regx2_sum);
   29|   534k|  regx2_sum = _mm256_add_epi64(regx2_sum, _mm256_srli_si256(regx2_sum, 8));
   30|       |
   31|   534k|  out_buffer = _mm256_castsi256_si128(regx_sum);
   32|   534k|  *x_sum += _mm_cvtsi128_si32(out_buffer);
   33|   534k|  out_buffer = _mm256_castsi256_si128(regx2_sum);
   34|   534k|#if AOM_ARCH_X86_64
   35|   534k|  *x2_sum += _mm_cvtsi128_si64(out_buffer);
   36|       |#else
   37|       |  {
   38|       |    int64_t tmp;
   39|       |    _mm_storel_epi64((__m128i *)&tmp, out_buffer);
   40|       |    *x2_sum += tmp;
   41|       |  }
   42|       |#endif
   43|   534k|}
blk_sse_sum_avx2.c:sse_sum_wd8_avx2:
   86|  3.85k|                                    int *x_sum, int64_t *x2_sum) {
   87|  3.85k|  __m128i load_128bit, load_next_128bit;
   88|  3.85k|  __m256i regx_sum, regx2_sum, load_pixels, sum_buffer, sse_buffer,
   89|  3.85k|      temp_buffer1, temp_buffer2, row_sum_buffer, row_sse_buffer;
   90|  3.85k|  const int16_t *data_tmp = data;
   91|  3.85k|  __m256i one = _mm256_set1_epi16(1);
   92|  3.85k|  regx_sum = _mm256_setzero_si256();
   93|  3.85k|  regx2_sum = regx_sum;
   94|  3.85k|  sum_buffer = _mm256_setzero_si256();
   95|  3.85k|  sse_buffer = sum_buffer;
   96|       |
   97|  19.2k|  for (int j = 0; j < (bh >> 1); ++j) {
  ------------------
  |  Branch (97:19): [True: 15.4k, False: 3.85k]
  ------------------
   98|       |    // Load 2 rows at a time.
   99|  15.4k|    load_128bit = _mm_loadu_si128((__m128i const *)(data_tmp));
  100|  15.4k|    load_next_128bit = _mm_loadu_si128((__m128i const *)(data_tmp + stride));
  101|  15.4k|    load_pixels = _mm256_insertf128_si256(_mm256_castsi128_si256(load_128bit),
  102|  15.4k|                                          load_next_128bit, 1);
  103|       |
  104|  15.4k|    row_sum_buffer = _mm256_madd_epi16(load_pixels, one);
  105|  15.4k|    row_sse_buffer = _mm256_madd_epi16(load_pixels, load_pixels);
  106|  15.4k|    sum_buffer = _mm256_add_epi32(row_sum_buffer, sum_buffer);
  107|  15.4k|    sse_buffer = _mm256_add_epi32(row_sse_buffer, sse_buffer);
  108|  15.4k|    data_tmp += 2 * stride;
  109|  15.4k|  }
  110|       |
  111|  3.85k|  temp_buffer1 = _mm256_unpacklo_epi32(sse_buffer, _mm256_setzero_si256());
  112|  3.85k|  temp_buffer2 = _mm256_unpackhi_epi32(sse_buffer, _mm256_setzero_si256());
  113|  3.85k|  sse_buffer = _mm256_add_epi64(temp_buffer1, temp_buffer2);
  114|  3.85k|  regx_sum = _mm256_add_epi32(sum_buffer, regx_sum);
  115|  3.85k|  regx2_sum = _mm256_add_epi64(sse_buffer, regx2_sum);
  116|       |
  117|  3.85k|  accumulate_sse_sum(regx_sum, regx2_sum, x_sum, x2_sum);
  118|  3.85k|}
blk_sse_sum_avx2.c:sse_sum_wd16_avx2:
  122|  44.1k|                                     int loop_count) {
  123|  44.1k|  __m256i regx_sum, regx2_sum, load_pixels, sum_buffer, sse_buffer,
  124|  44.1k|      temp_buffer1, temp_buffer2, row_sum_buffer, row_sse_buffer;
  125|  44.1k|  const int16_t *data_tmp = data;
  126|  44.1k|  __m256i one = _mm256_set1_epi16(1);
  127|  44.1k|  regx_sum = _mm256_setzero_si256();
  128|  44.1k|  regx2_sum = regx_sum;
  129|  44.1k|  sum_buffer = _mm256_setzero_si256();
  130|  44.1k|  sse_buffer = sum_buffer;
  131|       |
  132|   107k|  for (int i = 0; i < loop_count; ++i) {
  ------------------
  |  Branch (132:19): [True: 63.0k, False: 44.1k]
  ------------------
  133|  63.0k|    data_tmp = data + 16 * i;
  134|  1.67M|    for (int j = 0; j < bh; ++j) {
  ------------------
  |  Branch (134:21): [True: 1.61M, False: 63.0k]
  ------------------
  135|  1.61M|      load_pixels = _mm256_lddqu_si256((__m256i const *)(data_tmp));
  136|       |
  137|  1.61M|      row_sum_buffer = _mm256_madd_epi16(load_pixels, one);
  138|  1.61M|      row_sse_buffer = _mm256_madd_epi16(load_pixels, load_pixels);
  139|  1.61M|      sum_buffer = _mm256_add_epi32(row_sum_buffer, sum_buffer);
  140|  1.61M|      sse_buffer = _mm256_add_epi32(row_sse_buffer, sse_buffer);
  141|  1.61M|      data_tmp += stride;
  142|  1.61M|    }
  143|  63.0k|  }
  144|       |
  145|  44.1k|  temp_buffer1 = _mm256_unpacklo_epi32(sse_buffer, _mm256_setzero_si256());
  146|  44.1k|  temp_buffer2 = _mm256_unpackhi_epi32(sse_buffer, _mm256_setzero_si256());
  147|  44.1k|  sse_buffer = _mm256_add_epi64(temp_buffer1, temp_buffer2);
  148|  44.1k|  regx_sum = _mm256_add_epi32(sum_buffer, regx_sum);
  149|  44.1k|  regx2_sum = _mm256_add_epi64(sse_buffer, regx2_sum);
  150|       |
  151|  44.1k|  accumulate_sse_sum(regx_sum, regx2_sum, x_sum, x2_sum);
  152|  44.1k|}

highbd_convolve_avx2.c:prepare_coeffs:
  849|   121k|                                  __m256i *const coeffs /* [4] */) {
  850|   121k|  const int16_t *filter = av1_get_interp_filter_subpel_kernel(
  851|   121k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|   121k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   121k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  852|       |
  853|   121k|  const __m128i coeff_8 = _mm_loadu_si128((__m128i *)filter);
  854|   121k|  const __m256i coeff = _mm256_broadcastsi128_si256(coeff_8);
  855|       |
  856|       |  // coeffs 0 1 0 1 0 1 0 1
  857|   121k|  coeffs[0] = _mm256_shuffle_epi32(coeff, 0x00);
  858|       |  // coeffs 2 3 2 3 2 3 2 3
  859|   121k|  coeffs[1] = _mm256_shuffle_epi32(coeff, 0x55);
  860|       |  // coeffs 4 5 4 5 4 5 4 5
  861|   121k|  coeffs[2] = _mm256_shuffle_epi32(coeff, 0xaa);
  862|       |  // coeffs 6 7 6 7 6 7 6 7
  863|       |  coeffs[3] = _mm256_shuffle_epi32(coeff, 0xff);
  864|   121k|}
highbd_convolve_avx2.c:convolve:
  988|   977k|                               const __m256i *const coeffs) {
  989|   977k|  const __m256i res_0 = _mm256_madd_epi16(s[0], coeffs[0]);
  990|   977k|  const __m256i res_1 = _mm256_madd_epi16(s[1], coeffs[1]);
  991|   977k|  const __m256i res_2 = _mm256_madd_epi16(s[2], coeffs[2]);
  992|   977k|  const __m256i res_3 = _mm256_madd_epi16(s[3], coeffs[3]);
  993|       |
  994|   977k|  const __m256i res = _mm256_add_epi32(_mm256_add_epi32(res_0, res_1),
  995|   977k|                                       _mm256_add_epi32(res_2, res_3));
  996|       |
  997|   977k|  return res;
  998|   977k|}
convolve_2d_avx2.c:prepare_coeffs_4t_ssse3:
  630|   555k|    __m128i *const coeffs /* [4] */) {
  631|   555k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  632|   555k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|   555k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   555k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  633|   555k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  634|       |
  635|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  636|       |  // This extra right shift will be taken care of at the end while rounding
  637|       |  // the result.
  638|       |  // Since all filter co-efficients are even, this change will not affect the
  639|       |  // end result
  640|   555k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  641|   555k|                            _mm_set1_epi16((short)0xffff)));
  642|       |
  643|   555k|  const __m128i coeffs_1 = _mm_srai_epi16(coeffs_8, 1);
  644|       |
  645|       |  // coeffs 2 3 2 3 2 3 2 3
  646|   555k|  coeffs[0] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0604u));
  647|       |  // coeffs 4 5 4 5 4 5 4 5
  648|   555k|  coeffs[1] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0a08u));
  649|   555k|}
convolve_2d_avx2.c:prepare_coeffs_2t:
  805|    911|    __m256i *const coeffs /* [4] */) {
  806|    911|  const int16_t *filter = av1_get_interp_filter_subpel_kernel(
  807|    911|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|    911|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|    911|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  808|       |
  809|    911|  const __m128i coeff_8 = _mm_loadu_si128((__m128i *)(filter + 1));
  810|    911|  const __m256i coeff = _mm256_broadcastsi128_si256(coeff_8);
  811|       |
  812|       |  // coeffs 3 4 3 4 3 4 3 4
  813|       |  coeffs[0] = _mm256_shuffle_epi32(coeff, 0x55);
  814|    911|}
convolve_2d_avx2.c:prepare_coeffs_4t:
  818|  1.18M|    __m256i *const coeffs /* [4] */) {
  819|  1.18M|  const int16_t *filter = av1_get_interp_filter_subpel_kernel(
  820|  1.18M|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  1.18M|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  1.18M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  821|       |
  822|  1.18M|  const __m128i coeff_8 = _mm_loadu_si128((__m128i *)filter);
  823|  1.18M|  const __m256i coeff = _mm256_broadcastsi128_si256(coeff_8);
  824|       |  // coeffs 2 3 2 3 2 3 2 3
  825|  1.18M|  coeffs[0] = _mm256_shuffle_epi32(coeff, 0x55);
  826|       |  // coeffs 4 5 4 5 4 5 4 5
  827|       |  coeffs[1] = _mm256_shuffle_epi32(coeff, 0xaa);
  828|  1.18M|}
convolve_2d_avx2.c:prepare_coeffs_6t:
  832|  2.21M|    __m256i *const coeffs /* [4] */) {
  833|  2.21M|  const int16_t *filter = av1_get_interp_filter_subpel_kernel(
  834|  2.21M|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  2.21M|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  2.21M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  835|       |
  836|  2.21M|  const __m128i coeff_8 = _mm_loadu_si128((__m128i *)(filter + 1));
  837|  2.21M|  const __m256i coeff = _mm256_broadcastsi128_si256(coeff_8);
  838|       |
  839|       |  // coeffs 1 2 1 2 1 2 1 2
  840|  2.21M|  coeffs[0] = _mm256_shuffle_epi32(coeff, 0x00);
  841|       |  // coeffs 3 4 3 4 3 4 3 4
  842|  2.21M|  coeffs[1] = _mm256_shuffle_epi32(coeff, 0x55);
  843|       |  // coeffs 5 6 5 6 5 6 5 6
  844|       |  coeffs[2] = _mm256_shuffle_epi32(coeff, 0xaa);
  845|  2.21M|}
convolve_2d_avx2.c:convolve_lowbd_x_4tap_ssse3:
 1020|  2.61M|                                                  const __m128i *const filt) {
 1021|  2.61M|  __m128i s[2];
 1022|       |
 1023|  2.61M|  s[0] = _mm_shuffle_epi8(data, filt[0]);
 1024|  2.61M|  s[1] = _mm_shuffle_epi8(data, filt[1]);
 1025|       |
 1026|  2.61M|  return convolve_lowbd_4tap_ssse3(s, coeffs);
 1027|  2.61M|}
convolve_2d_avx2.c:convolve_lowbd_4tap_ssse3:
  891|  2.61M|                                                const __m128i coeffs[2]) {
  892|  2.61M|  const __m128i res_01 = _mm_maddubs_epi16(ss[0], coeffs[0]);
  893|  2.61M|  const __m128i res_23 = _mm_maddubs_epi16(ss[1], coeffs[1]);
  894|       |
  895|  2.61M|  return _mm_add_epi16(res_01, res_23);
  896|  2.61M|}
convolve_2d_avx2.c:sr_2d_ver_round_and_store_w4:
  117|  1.41M|                                                __m256i round_const_v) {
  118|  1.41M|  const __m256i res_round =
  119|  1.41M|      _mm256_srai_epi32(_mm256_add_epi32(res, round_const_v), 11);
  120|       |
  121|  1.41M|  const __m256i res_16bit = _mm256_packs_epi32(res_round, res_round);
  122|  1.41M|  const __m256i res_8b = _mm256_packus_epi16(res_16bit, res_16bit);
  123|       |
  124|  1.41M|  const __m128i r0 = _mm256_castsi256_si128(res_8b);
  125|  1.41M|  const __m128i r1 = _mm256_extracti128_si256(res_8b, 1);
  126|       |
  127|  1.41M|  __m128i *const p0 = (__m128i *)dst;
  128|  1.41M|  __m128i *const p1 = (__m128i *)(dst + dst_stride);
  129|       |
  130|  1.41M|  if (w == 4) {
  ------------------
  |  Branch (130:7): [True: 1.41M, False: 18.4E]
  ------------------
  131|  1.41M|    xx_storel_32(p0, r0);
  132|  1.41M|    xx_storel_32(p1, r1);
  133|  18.4E|  } else {
  134|       |    assert(w == 2);
  135|  18.4E|    *(uint16_t *)p0 = (uint16_t)_mm_cvtsi128_si32(r0);
  136|  18.4E|    *(uint16_t *)p1 = (uint16_t)_mm_cvtsi128_si32(r1);
  137|  18.4E|  }
  138|  1.41M|}
convolve_2d_avx2.c:convolve_4tap:
 1001|  11.0M|                                    const __m256i *const coeffs) {
 1002|  11.0M|  const __m256i res_1 = _mm256_madd_epi16(s[0], coeffs[0]);
 1003|  11.0M|  const __m256i res_2 = _mm256_madd_epi16(s[1], coeffs[1]);
 1004|       |
 1005|  11.0M|  const __m256i res = _mm256_add_epi32(res_1, res_2);
 1006|  11.0M|  return res;
 1007|  11.0M|}
convolve_2d_avx2.c:convolve_6tap:
  961|  34.9M|                                    const __m256i *const coeffs) {
  962|  34.9M|  const __m256i res_0 = _mm256_madd_epi16(s[0], coeffs[0]);
  963|  34.9M|  const __m256i res_1 = _mm256_madd_epi16(s[1], coeffs[1]);
  964|  34.9M|  const __m256i res_2 = _mm256_madd_epi16(s[2], coeffs[2]);
  965|       |
  966|  34.9M|  const __m256i res = _mm256_add_epi32(_mm256_add_epi32(res_0, res_1), res_2);
  967|       |
  968|  34.9M|  return res;
  969|  34.9M|}
convolve_2d_avx2.c:prepare_coeffs_2t_lowbd:
  705|    911|    __m256i *const coeffs /* [4] */) {
  706|    911|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  707|    911|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|    911|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|    911|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  708|    911|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  709|    911|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  710|       |
  711|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  712|       |  // This extra right shift will be taken care of at the end while rounding
  713|       |  // the result.
  714|       |  // Since all filter co-efficients are even, this change will not affect the
  715|       |  // end result
  716|    911|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  717|    911|                            _mm_set1_epi16((int16_t)0xffff)));
  718|       |
  719|    911|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  720|       |
  721|       |  // coeffs 3 4 3 4 3 4 3 4
  722|    911|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0806u));
  723|    911|}
convolve_2d_avx2.c:prepare_coeffs_4t_lowbd:
  727|   767k|    __m256i *const coeffs /* [4] */) {
  728|   767k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  729|   767k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|   767k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   767k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  730|   767k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  731|   767k|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  732|       |
  733|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  734|       |  // This extra right shift will be taken care of at the end while rounding
  735|       |  // the result.
  736|       |  // Since all filter co-efficients are even, this change will not affect the
  737|       |  // end result
  738|   767k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  739|   767k|                            _mm_set1_epi16((short)0xffff)));
  740|       |
  741|   767k|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  742|       |
  743|       |  // coeffs 2 3 2 3 2 3 2 3
  744|   767k|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0604u));
  745|       |  // coeffs 4 5 4 5 4 5 4 5
  746|   767k|  coeffs[1] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0a08u));
  747|   767k|}
convolve_2d_avx2.c:prepare_coeffs_6t_lowbd:
  751|  2.08M|    __m256i *const coeffs /* [4] */) {
  752|  2.08M|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  753|  2.08M|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  2.08M|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  2.08M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  754|  2.08M|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  755|  2.08M|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  756|       |
  757|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  758|       |  // This extra right shift will be taken care of at the end while rounding
  759|       |  // the result.
  760|       |  // Since all filter co-efficients are even, this change will not affect the
  761|       |  // end result
  762|  2.08M|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  763|  2.08M|                            _mm_set1_epi16((int16_t)0xffff)));
  764|       |
  765|  2.08M|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  766|       |
  767|       |  // coeffs 1 2 1 2 1 2 1 2
  768|  2.08M|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0402u));
  769|       |  // coeffs 3 4 3 4 3 4 3 4
  770|  2.08M|  coeffs[1] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0806u));
  771|       |  // coeffs 5 6 5 6 5 6 5 6
  772|  2.08M|  coeffs[2] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0c0au));
  773|  2.08M|}
convolve_2d_avx2.c:convolve_lowbd_x_2tap:
 1067|  61.6k|                                            const __m256i *const filt) {
 1068|  61.6k|  __m256i s;
 1069|  61.6k|  s = _mm256_shuffle_epi8(data, filt[0]);
 1070|       |
 1071|  61.6k|  return _mm256_maddubs_epi16(s, coeffs[0]);
 1072|  61.6k|}
convolve_2d_avx2.c:convolve_lowbd_x_4tap:
 1056|  7.69M|                                            const __m256i *const filt) {
 1057|  7.69M|  __m256i s[2];
 1058|       |
 1059|  7.69M|  s[0] = _mm256_shuffle_epi8(data, filt[0]);
 1060|  7.69M|  s[1] = _mm256_shuffle_epi8(data, filt[1]);
 1061|       |
 1062|  7.69M|  return convolve_lowbd_4tap(s, coeffs);
 1063|  7.69M|}
convolve_2d_avx2.c:convolve_lowbd_4tap:
  950|  7.69M|                                          const __m256i *const coeffs) {
  951|  7.69M|  const __m256i res_23 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  952|  7.69M|  const __m256i res_45 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  953|       |
  954|       |  // order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  955|  7.69M|  const __m256i res = _mm256_add_epi16(res_45, res_23);
  956|       |
  957|  7.69M|  return res;
  958|  7.69M|}
convolve_2d_avx2.c:convolve_lowbd_x_6tap:
 1044|  24.2M|                                            const __m256i *const filt) {
 1045|  24.2M|  __m256i s[4];
 1046|       |
 1047|  24.2M|  s[0] = _mm256_shuffle_epi8(data, filt[0]);
 1048|  24.2M|  s[1] = _mm256_shuffle_epi8(data, filt[1]);
 1049|  24.2M|  s[2] = _mm256_shuffle_epi8(data, filt[2]);
 1050|       |
 1051|  24.2M|  return convolve_lowbd_6tap(s, coeffs);
 1052|  24.2M|}
convolve_2d_avx2.c:convolve_lowbd_6tap:
  937|  24.2M|                                          const __m256i *const coeffs) {
  938|  24.2M|  const __m256i res_01 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  939|  24.2M|  const __m256i res_23 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  940|  24.2M|  const __m256i res_45 = _mm256_maddubs_epi16(s[2], coeffs[2]);
  941|       |
  942|       |  // order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  943|  24.2M|  const __m256i res =
  944|  24.2M|      _mm256_add_epi16(_mm256_add_epi16(res_01, res_45), res_23);
  945|       |
  946|  24.2M|  return res;
  947|  24.2M|}
convolve_2d_avx2.c:sr_2d_ver_round_and_store:
  293|  22.2M|                                             __m256i round_const_v) {
  294|  22.2M|  const __m256i res_a_round =
  295|  22.2M|      _mm256_srai_epi32(_mm256_add_epi32(res_a, round_const_v), 11);
  296|  22.2M|  const __m256i res_b_round =
  297|  22.2M|      _mm256_srai_epi32(_mm256_add_epi32(res_b, round_const_v), 11);
  298|  22.2M|  const __m256i r16 = _mm256_packs_epi32(res_a_round, res_b_round);
  299|  22.2M|  const __m256i r8 = _mm256_packus_epi16(r16, r16);
  300|       |
  301|  22.2M|  _mm_storel_epi64((__m128i *)dst, _mm256_castsi256_si128(r8));
  302|  22.2M|  _mm_storel_epi64((__m128i *)(dst + dst_stride),
  303|       |                   _mm256_extracti128_si256(r8, 1));
  304|  22.2M|}
convolve_avx2.c:round_sr_y_ssse3:
 1448|   118k|static inline __m128i round_sr_y_ssse3(const __m128i data) {
 1449|   118k|  const __m128i value = _mm_set1_epi16(32);
 1450|   118k|  const __m128i reg = _mm_add_epi16(data, value);
 1451|   118k|  return _mm_srai_epi16(reg, FILTER_BITS - 1);
  ------------------
  |  |   21|   118k|#define FILTER_BITS 7
  ------------------
 1452|   118k|}
convolve_avx2.c:pack_store_u8_4x2_sse2:
 1188|   277k|                                          const ptrdiff_t dst_stride) {
 1189|   277k|  const __m128i reg_pack = _mm_packus_epi16(reg, reg);
 1190|   277k|  store_8bit_4x2_sse2(reg_pack, dst, dst_stride);
 1191|   277k|}
convolve_avx2.c:store_8bit_4x2_sse2:
 1181|   277k|                                       const ptrdiff_t dst_stride) {
 1182|   277k|  xx_storel_32(dst, reg);
 1183|   277k|  *(uint32_t *)(dst + dst_stride) =
 1184|   277k|      ((uint32_t)_mm_extract_epi16(reg, 3) << 16) | _mm_extract_epi16(reg, 2);
 1185|   277k|}
convolve_avx2.c:round_pack_store_y_8x2_avx2:
 1462|  1.15M|                                               const ptrdiff_t dst_stride) {
 1463|  1.15M|  __m256i r;
 1464|       |
 1465|  1.15M|  r = round_sr_y_avx2(res);
 1466|  1.15M|  pack_store_8x2_avx2(r, dst, dst_stride);
 1467|  1.15M|}
convolve_avx2.c:round_sr_y_avx2:
 1454|  2.50M|static inline __m256i round_sr_y_avx2(const __m256i data) {
 1455|  2.50M|  const __m256i value = _mm256_set1_epi16(32);
 1456|  2.50M|  const __m256i reg = _mm256_add_epi16(data, value);
 1457|  2.50M|  return _mm256_srai_epi16(reg, FILTER_BITS - 1);
  ------------------
  |  |   21|  2.50M|#define FILTER_BITS 7
  ------------------
 1458|  2.50M|}
convolve_avx2.c:pack_store_8x2_avx2:
 1313|  1.15M|                                       const ptrdiff_t stride) {
 1314|  1.15M|  const __m256i res = _mm256_packus_epi16(data, data);
 1315|  1.15M|  store_u8_8x2_avx2(res, dst, stride);
 1316|  1.15M|}
convolve_avx2.c:store_u8_8x2_avx2:
 1298|  1.15M|                                     const ptrdiff_t stride) {
 1299|  1.15M|  const __m128i reg0 = _mm256_castsi256_si128(src);
 1300|       |  const __m128i reg1 = _mm256_extracti128_si256(src, 1);
 1301|  1.15M|  _mm_storel_epi64((__m128i *)dst, reg0);
 1302|  1.15M|  _mm_storel_epi64((__m128i *)(dst + stride), reg1);
 1303|  1.15M|}
convolve_avx2.c:round_pack_store_y_16x2_avx2:
 1471|   625k|                                                const ptrdiff_t dst_stride) {
 1472|   625k|  __m256i r[2];
 1473|       |
 1474|   625k|  r[0] = round_sr_y_avx2(res[0]);
 1475|   625k|  r[1] = round_sr_y_avx2(res[1]);
 1476|   625k|  pack_store_16x2_avx2(r[0], r[1], dst, dst_stride);
 1477|   625k|}
convolve_avx2.c:pack_store_16x2_avx2:
 1307|   892k|                                        const ptrdiff_t stride) {
 1308|   892k|  const __m256i res = _mm256_packus_epi16(data0, data1);
 1309|   892k|  store_u8_16x2_avx2(res, dst, stride);
 1310|   892k|}
convolve_avx2.c:store_u8_16x2_avx2:
 1290|   892k|                                      const ptrdiff_t stride) {
 1291|   892k|  const __m128i reg0 = _mm256_castsi256_si128(src);
 1292|       |  const __m128i reg1 = _mm256_extracti128_si256(src, 1);
 1293|   892k|  _mm_storeu_si128((__m128i *)dst, reg0);
 1294|   892k|  _mm_storeu_si128((__m128i *)((uint8_t *)dst + stride), reg1);
 1295|   892k|}
convolve_avx2.c:round_pack_store_y_32x2_avx2:
 1490|  23.8k|                                                const ptrdiff_t dst_stride) {
 1491|  23.8k|  round_pack_store_y_32_avx2(res, dst);
 1492|  23.8k|  round_pack_store_y_32_avx2(res + 2, dst + dst_stride);
 1493|  23.8k|}
convolve_avx2.c:round_pack_store_y_32_avx2:
 1480|  47.7k|                                              uint8_t *const dst) {
 1481|  47.7k|  __m256i r[2];
 1482|       |
 1483|  47.7k|  r[0] = round_sr_y_avx2(res[0]);
 1484|  47.7k|  r[1] = round_sr_y_avx2(res[1]);
 1485|  47.7k|  pack_store_32_avx2(r[0], r[1], dst);
 1486|  47.7k|}
convolve_avx2.c:pack_store_32_avx2:
 1341|   256k|                                      uint8_t *const dst) {
 1342|   256k|  const __m256i reg = _mm256_packus_epi16(data0, data1);
 1343|   256k|  _mm256_storeu_si256((__m256i *)dst, reg);
 1344|   256k|}
convolve_avx2.c:prepare_coeffs_4t_ssse3:
  630|  85.0k|    __m128i *const coeffs /* [4] */) {
  631|  85.0k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  632|  85.0k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  85.0k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  85.0k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  633|  85.0k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  634|       |
  635|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  636|       |  // This extra right shift will be taken care of at the end while rounding
  637|       |  // the result.
  638|       |  // Since all filter co-efficients are even, this change will not affect the
  639|       |  // end result
  640|  85.0k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  641|  85.0k|                            _mm_set1_epi16((short)0xffff)));
  642|       |
  643|  85.0k|  const __m128i coeffs_1 = _mm_srai_epi16(coeffs_8, 1);
  644|       |
  645|       |  // coeffs 2 3 2 3 2 3 2 3
  646|  85.0k|  coeffs[0] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0604u));
  647|       |  // coeffs 4 5 4 5 4 5 4 5
  648|  85.0k|  coeffs[1] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0a08u));
  649|  85.0k|}
convolve_avx2.c:convolve_lowbd_4tap_ssse3:
  891|   226k|                                                const __m128i coeffs[2]) {
  892|   226k|  const __m128i res_01 = _mm_maddubs_epi16(ss[0], coeffs[0]);
  893|   226k|  const __m128i res_23 = _mm_maddubs_epi16(ss[1], coeffs[1]);
  894|       |
  895|   226k|  return _mm_add_epi16(res_01, res_23);
  896|   226k|}
convolve_avx2.c:convolve_y_4tap_4x2_ssse3:
 1572|  68.0k|                                             __m128i *res) {
 1573|  68.0k|  d[3] = _mm_cvtsi32_si128(loadu_int32(data + 3 * stride));
 1574|  68.0k|  const __m128i src_23a = _mm_unpacklo_epi32(d[2], d[3]);
 1575|  68.0k|  d[2] = _mm_cvtsi32_si128(loadu_int32(data + 4 * stride));
 1576|  68.0k|  const __m128i src_34a = _mm_unpacklo_epi32(d[3], d[2]);
 1577|       |
 1578|  68.0k|  s[1] = _mm_unpacklo_epi8(src_23a, src_34a);
 1579|       |
 1580|  68.0k|  *res = convolve_lowbd_4tap_ssse3(s, coeffs);
 1581|  68.0k|}
convolve_avx2.c:prepare_coeffs_4t_lowbd:
  727|  69.7k|    __m256i *const coeffs /* [4] */) {
  728|  69.7k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  729|  69.7k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  69.7k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  69.7k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  730|  69.7k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  731|  69.7k|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  732|       |
  733|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  734|       |  // This extra right shift will be taken care of at the end while rounding
  735|       |  // the result.
  736|       |  // Since all filter co-efficients are even, this change will not affect the
  737|       |  // end result
  738|  69.7k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  739|  69.7k|                            _mm_set1_epi16((short)0xffff)));
  740|       |
  741|  69.7k|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  742|       |
  743|       |  // coeffs 2 3 2 3 2 3 2 3
  744|  69.7k|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0604u));
  745|       |  // coeffs 4 5 4 5 4 5 4 5
  746|  69.7k|  coeffs[1] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0a08u));
  747|  69.7k|}
convolve_avx2.c:convolve_y_4tap_8x2_avx2:
 1631|   241k|                                            __m256i *res) {
 1632|   241k|  d[3] = _mm_loadu_si128((__m128i *)(data + 3 * stride));
 1633|   241k|  const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
 1634|   241k|  d[2] = _mm_loadu_si128((__m128i *)(data + 4 * stride));
 1635|   241k|  const __m256i src_34a = _mm256_setr_m128i(d[3], d[2]);
 1636|       |
 1637|   241k|  s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
 1638|       |
 1639|   241k|  *res = convolve_lowbd_4tap(s, coeffs);
 1640|   241k|}
convolve_avx2.c:convolve_lowbd_4tap:
  950|   992k|                                          const __m256i *const coeffs) {
  951|   992k|  const __m256i res_23 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  952|   992k|  const __m256i res_45 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  953|       |
  954|       |  // order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  955|   992k|  const __m256i res = _mm256_add_epi16(res_45, res_23);
  956|       |
  957|   992k|  return res;
  958|   992k|}
convolve_avx2.c:convolve_y_4tap_16x2_avx2:
 1692|  84.1k|                                             __m256i res[2]) {
 1693|  84.1k|  d[3] = _mm_loadu_si128((__m128i *)(data + 3 * stride));
 1694|  84.1k|  const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
 1695|  84.1k|  d[2] = _mm_loadu_si128((__m128i *)(data + 4 * stride));
 1696|  84.1k|  const __m256i src_34a = _mm256_setr_m128i(d[3], d[2]);
 1697|       |
 1698|  84.1k|  s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
 1699|  84.1k|  s[3] = _mm256_unpackhi_epi8(src_23a, src_34a);
 1700|       |
 1701|  84.1k|  res[0] = convolve_lowbd_4tap(s, coeffs);
 1702|  84.1k|  res[1] = convolve_lowbd_4tap(s + 2, coeffs);
 1703|  84.1k|}
convolve_avx2.c:convolve_y_4tap_32x2_avx2:
 1760|  23.8k|                                             __m256i s2[4], __m256i res[4]) {
 1761|  23.8k|  d[3] = _mm256_loadu_si256((__m256i *)(data + 3 * stride));
 1762|  23.8k|  s1[1] = _mm256_unpacklo_epi8(d[2], d[3]);
 1763|  23.8k|  s1[3] = _mm256_unpackhi_epi8(d[2], d[3]);
 1764|  23.8k|  d[2] = _mm256_loadu_si256((__m256i *)(data + 4 * stride));
 1765|  23.8k|  s2[1] = _mm256_unpacklo_epi8(d[3], d[2]);
 1766|  23.8k|  s2[3] = _mm256_unpackhi_epi8(d[3], d[2]);
 1767|       |
 1768|  23.8k|  res[0] = convolve_lowbd_4tap(s1, coeffs);
 1769|  23.8k|  res[1] = convolve_lowbd_4tap(s1 + 2, coeffs);
 1770|  23.8k|  res[2] = convolve_lowbd_4tap(s2, coeffs);
 1771|  23.8k|  res[3] = convolve_lowbd_4tap(s2 + 2, coeffs);
 1772|  23.8k|}
convolve_avx2.c:prepare_coeffs_6t_ssse3:
  653|  12.5k|    __m128i *const coeffs /* [4] */) {
  654|  12.5k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  655|  12.5k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  12.5k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  12.5k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  656|  12.5k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  657|       |
  658|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  659|       |  // This extra right shift will be taken care of at the end while rounding
  660|       |  // the result.
  661|       |  // Since all filter co-efficients are even, this change will not affect the
  662|       |  // end result
  663|  12.5k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  664|  12.5k|                            _mm_set1_epi16((short)0xffff)));
  665|       |
  666|  12.5k|  const __m128i coeffs_1 = _mm_srai_epi16(coeffs_8, 1);
  667|       |
  668|       |  // coeffs 2 3 2 3 2 3 2 3
  669|  12.5k|  coeffs[0] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0402u));
  670|       |  // coeffs 4 5 4 5 4 5 4 5
  671|  12.5k|  coeffs[1] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0806u));
  672|       |  // coeffs 5 6 5 6 5 6 5 6
  673|  12.5k|  coeffs[2] = _mm_shuffle_epi8(coeffs_1, _mm_set1_epi16(0x0c0au));
  674|  12.5k|}
convolve_avx2.c:convolve_lowbd_6tap_ssse3:
  899|  50.2k|                                                const __m128i coeffs[3]) {
  900|  50.2k|  const __m128i res_01 = _mm_maddubs_epi16(ss[0], coeffs[0]);
  901|  50.2k|  const __m128i res_23 = _mm_maddubs_epi16(ss[1], coeffs[1]);
  902|  50.2k|  const __m128i res_45 = _mm_maddubs_epi16(ss[2], coeffs[2]);
  903|       |
  904|  50.2k|  const __m128i res = _mm_add_epi16(_mm_add_epi16(res_01, res_45), res_23);
  905|       |
  906|  50.2k|  return res;
  907|  50.2k|}
convolve_avx2.c:convolve_y_6tap_4x2_ssse3:
 1587|  50.2k|                                             __m128i *res) {
 1588|  50.2k|  d[5] = _mm_cvtsi32_si128(loadu_int32(data + 5 * stride));
 1589|  50.2k|  const __m128i src_45a = _mm_unpacklo_epi32(d[4], d[5]);
 1590|  50.2k|  d[4] = _mm_cvtsi32_si128(loadu_int32(data + 6 * stride));
 1591|  50.2k|  const __m128i src_56a = _mm_unpacklo_epi32(d[5], d[4]);
 1592|       |
 1593|  50.2k|  s[2] = _mm_unpacklo_epi8(src_45a, src_56a);
 1594|       |
 1595|  50.2k|  *res = convolve_lowbd_6tap_ssse3(s, coeffs);
 1596|  50.2k|}
convolve_avx2.c:prepare_coeffs_6t_lowbd:
  751|   520k|    __m256i *const coeffs /* [4] */) {
  752|   520k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  753|   520k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|   520k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   520k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  754|   520k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  755|   520k|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  756|       |
  757|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  758|       |  // This extra right shift will be taken care of at the end while rounding
  759|       |  // the result.
  760|       |  // Since all filter co-efficients are even, this change will not affect the
  761|       |  // end result
  762|   520k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  763|   520k|                            _mm_set1_epi16((int16_t)0xffff)));
  764|       |
  765|   520k|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  766|       |
  767|       |  // coeffs 1 2 1 2 1 2 1 2
  768|   520k|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0402u));
  769|       |  // coeffs 3 4 3 4 3 4 3 4
  770|   520k|  coeffs[1] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0806u));
  771|       |  // coeffs 5 6 5 6 5 6 5 6
  772|   520k|  coeffs[2] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0c0au));
  773|   520k|}
convolve_avx2.c:convolve_y_6tap_8x2_avx2:
 1646|   915k|                                            __m256i *res) {
 1647|   915k|  d[5] = _mm_loadu_si128((__m128i *)(data + 5 * stride));
 1648|   915k|  const __m256i src_45a = _mm256_setr_m128i(d[4], d[5]);
 1649|   915k|  d[4] = _mm_loadu_si128((__m128i *)(data + 6 * stride));
 1650|   915k|  const __m256i src_56a = _mm256_setr_m128i(d[5], d[4]);
 1651|       |
 1652|   915k|  s[2] = _mm256_unpacklo_epi8(src_45a, src_56a);
 1653|       |
 1654|   915k|  *res = convolve_lowbd_6tap(s, coeffs);
 1655|   915k|}
convolve_avx2.c:convolve_lowbd_6tap:
  937|  3.83M|                                          const __m256i *const coeffs) {
  938|  3.83M|  const __m256i res_01 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  939|  3.83M|  const __m256i res_23 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  940|  3.83M|  const __m256i res_45 = _mm256_maddubs_epi16(s[2], coeffs[2]);
  941|       |
  942|       |  // order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  943|  3.83M|  const __m256i res =
  944|  3.83M|      _mm256_add_epi16(_mm256_add_epi16(res_01, res_45), res_23);
  945|       |
  946|  3.83M|  return res;
  947|  3.83M|}
convolve_avx2.c:convolve_y_6tap_16x2_avx2:
 1709|   541k|                                             __m256i res[2]) {
 1710|   541k|  d[5] = _mm_loadu_si128((__m128i *)(data + 5 * stride));
 1711|   541k|  const __m256i src_45a = _mm256_setr_m128i(d[4], d[5]);
 1712|   541k|  d[4] = _mm_loadu_si128((__m128i *)(data + 6 * stride));
 1713|   541k|  const __m256i src_56a = _mm256_setr_m128i(d[5], d[4]);
 1714|       |
 1715|   541k|  s[2] = _mm256_unpacklo_epi8(src_45a, src_56a);
 1716|   541k|  s[5] = _mm256_unpackhi_epi8(src_45a, src_56a);
 1717|       |
 1718|   541k|  res[0] = convolve_lowbd_6tap(s, coeffs);
 1719|   541k|  res[1] = convolve_lowbd_6tap(s + 3, coeffs);
 1720|   541k|}
convolve_avx2.c:prepare_coeffs_lowbd:
  777|  73.5k|    __m256i *const coeffs /* [4] */) {
  778|  73.5k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  779|  73.5k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|  73.5k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  73.5k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  780|  73.5k|  const __m128i coeffs_8 = _mm_loadu_si128((__m128i *)filter);
  781|  73.5k|  const __m256i filter_coeffs = _mm256_broadcastsi128_si256(coeffs_8);
  782|       |
  783|       |  // right shift all filter co-efficients by 1 to reduce the bits required.
  784|       |  // This extra right shift will be taken care of at the end while rounding
  785|       |  // the result.
  786|       |  // Since all filter co-efficients are even, this change will not affect the
  787|       |  // end result
  788|  73.5k|  assert(_mm_test_all_zeros(_mm_and_si128(coeffs_8, _mm_set1_epi16(1)),
  789|  73.5k|                            _mm_set1_epi16((short)0xffff)));
  790|       |
  791|  73.5k|  const __m256i coeffs_1 = _mm256_srai_epi16(filter_coeffs, 1);
  792|       |
  793|       |  // coeffs 0 1 0 1 0 1 0 1
  794|  73.5k|  coeffs[0] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0200u));
  795|       |  // coeffs 2 3 2 3 2 3 2 3
  796|  73.5k|  coeffs[1] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0604u));
  797|       |  // coeffs 4 5 4 5 4 5 4 5
  798|  73.5k|  coeffs[2] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0a08u));
  799|       |  // coeffs 6 7 6 7 6 7 6 7
  800|  73.5k|  coeffs[3] = _mm256_shuffle_epi8(coeffs_1, _mm256_set1_epi16(0x0e0cu));
  801|  73.5k|}
convolve_avx2.c:round_sr_x_ssse3:
 1174|   158k|static inline __m128i round_sr_x_ssse3(const __m128i data) {
 1175|   158k|  const __m128i val = _mm_set1_epi16(34);
 1176|   158k|  const __m128i reg = _mm_add_epi16(data, val);
 1177|   158k|  return _mm_srai_epi16(reg, 6);
 1178|   158k|}
convolve_avx2.c:convolve_x_4tap_4x2_ssse3:
 1162|   158k|                                                __m128i *const coeffs) {
 1163|   158k|  __m128i data[2];
 1164|   158k|  const __m128i f_l0 = _mm_load_si128((__m128i const *)filt1_global_sse2);
 1165|   158k|  const __m128i f_l1 = _mm_load_si128((__m128i const *)filt2_global_sse2);
 1166|   158k|  const __m128i src_1 =
 1167|   158k|      load_8bit_8x2_to_1_reg_sse2(src, (int)(sizeof(*src) * src_stride));
 1168|       |
 1169|   158k|  data[0] = _mm_shuffle_epi8(src_1, f_l0);
 1170|   158k|  data[1] = _mm_shuffle_epi8(src_1, f_l1);
 1171|   158k|  return convolve_lowbd_4tap_ssse3(data, coeffs);
 1172|   158k|}
convolve_avx2.c:convolve_lowbd_x_4tap:
 1056|   487k|                                            const __m256i *const filt) {
 1057|   487k|  __m256i s[2];
 1058|       |
 1059|   487k|  s[0] = _mm256_shuffle_epi8(data, filt[0]);
 1060|   487k|  s[1] = _mm256_shuffle_epi8(data, filt[1]);
 1061|       |
 1062|   487k|  return convolve_lowbd_4tap(s, coeffs);
 1063|   487k|}
convolve_avx2.c:round_sr_x_avx2:
 1149|  2.32M|static inline __m256i round_sr_x_avx2(const __m256i data) {
 1150|       |  // we can perform the below steps:
 1151|       |  // data = (data + 2) >> 2
 1152|       |  // data = (data + 8) >> 4,
 1153|       |  // in the below form as well
 1154|       |  // data = (data + 0x22) >> 6
 1155|  2.32M|  const __m256i value = _mm256_set1_epi16(34);
 1156|  2.32M|  const __m256i reg = _mm256_add_epi16(data, value);
 1157|  2.32M|  return _mm256_srai_epi16(reg, 6);
 1158|  2.32M|}
convolve_avx2.c:convolve_lowbd_x_6tap:
 1044|  1.83M|                                            const __m256i *const filt) {
 1045|  1.83M|  __m256i s[4];
 1046|       |
 1047|  1.83M|  s[0] = _mm256_shuffle_epi8(data, filt[0]);
 1048|  1.83M|  s[1] = _mm256_shuffle_epi8(data, filt[1]);
 1049|  1.83M|  s[2] = _mm256_shuffle_epi8(data, filt[2]);
 1050|       |
 1051|  1.83M|  return convolve_lowbd_6tap(s, coeffs);
 1052|  1.83M|}
convolve_avx2.c:load_convolve_6tap_16x2_avx2:
 1443|   268k|                                                __m256i *data) {
 1444|   268k|  data[0] = load_convolve_6tap_8x2_avx2(src + 0, src_stride, coeffs, filt);
 1445|   268k|  data[1] = load_convolve_6tap_8x2_avx2(src + 8, src_stride, coeffs, filt);
 1446|   268k|}
convolve_avx2.c:load_convolve_6tap_8x2_avx2:
 1434|   536k|                                                  const __m256i *filt) {
 1435|   536k|  const __m256i data = loadu_x_8bit_16x2_avx2(src, stride);
 1436|   536k|  return convolve_lowbd_x_6tap(data, coeffs, filt);
 1437|   536k|}
convolve_avx2.c:loadu_x_8bit_16x2_avx2:
 1266|   536k|                                             const ptrdiff_t offset) {
 1267|   536k|  const __m128i reg0 = _mm_loadu_si128((__m128i *)src);
 1268|   536k|  const __m128i reg1 = _mm_loadu_si128((__m128i *)((uint8_t *)src + offset));
 1269|   536k|  return _mm256_setr_m128i(reg0, reg1);
 1270|   536k|}
convolve_avx2.c:round_pack_store_16x2_avx2:
 1320|   268k|                                              const ptrdiff_t dst_stride) {
 1321|   268k|  __m256i reg[2];
 1322|       |
 1323|   268k|  reg[0] = round_sr_x_avx2(data[0]);
 1324|   268k|  reg[1] = round_sr_x_avx2(data[1]);
 1325|   268k|  pack_store_16x2_avx2(reg[0], reg[1], dst, dst_stride);
 1326|   268k|}
convolve_avx2.c:convolve_sr_store_6tap_32_avx2:
 1424|   208k|                                                  uint8_t *const dst) {
 1425|   208k|  __m256i data[2];
 1426|       |
 1427|   208k|  load_convolve_6tap_32_avx2(src, coeffs, filt, data);
 1428|   208k|  round_pack_store_32_avx2(data, dst);
 1429|   208k|}
convolve_avx2.c:load_convolve_6tap_32_avx2:
 1413|   208k|                                              __m256i *data) {
 1414|   208k|  const __m256i reg0 = _mm256_loadu_si256((__m256i *)src);
 1415|   208k|  const __m256i reg1 = _mm256_loadu_si256((__m256i *)(src + 8));
 1416|       |
 1417|   208k|  data[0] = convolve_lowbd_x_6tap(reg0, coeffs, filt);
 1418|   208k|  data[1] = convolve_lowbd_x_6tap(reg1, coeffs, filt);
 1419|   208k|}
convolve_avx2.c:round_pack_store_32_avx2:
 1347|   208k|                                            uint8_t *const dst) {
 1348|   208k|  __m256i reg[2];
 1349|       |
 1350|   208k|  reg[0] = round_sr_x_avx2(data[0]);
 1351|   208k|  reg[1] = round_sr_x_avx2(data[1]);
 1352|   208k|  pack_store_32_avx2(reg[0], reg[1], dst);
 1353|   208k|}
convolve_avx2.c:load_avg_store_2tap_32_avx2:
 1365|  86.7k|                                               uint8_t *const dst) {
 1366|  86.7k|  const __m256i res0 = _mm256_loadu_si256((__m256i *)src);
 1367|  86.7k|  const __m256i res1 = _mm256_loadu_si256((__m256i *)(src + 1));
 1368|  86.7k|  const __m256i data = _mm256_avg_epu8(res0, res1);
 1369|  86.7k|  _mm256_storeu_si256((__m256i *)dst, data);
 1370|  86.7k|}
wiener_convolve_avx2.c:convolve_lowbd_x:
 1031|  1.22M|                                       const __m256i *const filt) {
 1032|  1.22M|  __m256i s[4];
 1033|       |
 1034|  1.22M|  s[0] = _mm256_shuffle_epi8(data, filt[0]);
 1035|  1.22M|  s[1] = _mm256_shuffle_epi8(data, filt[1]);
 1036|  1.22M|  s[2] = _mm256_shuffle_epi8(data, filt[2]);
 1037|  1.22M|  s[3] = _mm256_shuffle_epi8(data, filt[3]);
 1038|       |
 1039|  1.22M|  return convolve_lowbd(s, coeffs);
 1040|  1.22M|}
wiener_convolve_avx2.c:convolve_lowbd:
  923|  1.22M|                                     const __m256i *const coeffs) {
  924|  1.22M|  const __m256i res_01 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  925|  1.22M|  const __m256i res_23 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  926|  1.22M|  const __m256i res_45 = _mm256_maddubs_epi16(s[2], coeffs[2]);
  927|  1.22M|  const __m256i res_67 = _mm256_maddubs_epi16(s[3], coeffs[3]);
  928|       |
  929|       |  // order: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  930|  1.22M|  const __m256i res = _mm256_add_epi16(_mm256_add_epi16(res_01, res_45),
  931|  1.22M|                                       _mm256_add_epi16(res_23, res_67));
  932|       |
  933|  1.22M|  return res;
  934|  1.22M|}
wiener_convolve_avx2.c:convolve:
  988|  2.07M|                               const __m256i *const coeffs) {
  989|  2.07M|  const __m256i res_0 = _mm256_madd_epi16(s[0], coeffs[0]);
  990|  2.07M|  const __m256i res_1 = _mm256_madd_epi16(s[1], coeffs[1]);
  991|  2.07M|  const __m256i res_2 = _mm256_madd_epi16(s[2], coeffs[2]);
  992|  2.07M|  const __m256i res_3 = _mm256_madd_epi16(s[3], coeffs[3]);
  993|       |
  994|  2.07M|  const __m256i res = _mm256_add_epi32(_mm256_add_epi32(res_0, res_1),
  995|  2.07M|                                       _mm256_add_epi32(res_2, res_3));
  996|       |
  997|  2.07M|  return res;
  998|  2.07M|}
highbd_convolve_2d_avx2.c:prepare_coeffs:
  849|   367k|                                  __m256i *const coeffs /* [4] */) {
  850|   367k|  const int16_t *filter = av1_get_interp_filter_subpel_kernel(
  851|   367k|      filter_params, subpel_q4 & SUBPEL_MASK);
  ------------------
  |  |   24|   367k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   367k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  852|       |
  853|   367k|  const __m128i coeff_8 = _mm_loadu_si128((__m128i *)filter);
  854|   367k|  const __m256i coeff = _mm256_broadcastsi128_si256(coeff_8);
  855|       |
  856|       |  // coeffs 0 1 0 1 0 1 0 1
  857|   367k|  coeffs[0] = _mm256_shuffle_epi32(coeff, 0x00);
  858|       |  // coeffs 2 3 2 3 2 3 2 3
  859|   367k|  coeffs[1] = _mm256_shuffle_epi32(coeff, 0x55);
  860|       |  // coeffs 4 5 4 5 4 5 4 5
  861|   367k|  coeffs[2] = _mm256_shuffle_epi32(coeff, 0xaa);
  862|       |  // coeffs 6 7 6 7 6 7 6 7
  863|       |  coeffs[3] = _mm256_shuffle_epi32(coeff, 0xff);
  864|   367k|}
highbd_convolve_2d_avx2.c:convolve:
  988|  5.56M|                               const __m256i *const coeffs) {
  989|  5.56M|  const __m256i res_0 = _mm256_madd_epi16(s[0], coeffs[0]);
  990|  5.56M|  const __m256i res_1 = _mm256_madd_epi16(s[1], coeffs[1]);
  991|  5.56M|  const __m256i res_2 = _mm256_madd_epi16(s[2], coeffs[2]);
  992|  5.56M|  const __m256i res_3 = _mm256_madd_epi16(s[3], coeffs[3]);
  993|       |
  994|  5.56M|  const __m256i res = _mm256_add_epi32(_mm256_add_epi32(res_0, res_1),
  995|  5.56M|                                       _mm256_add_epi32(res_2, res_3));
  996|       |
  997|  5.56M|  return res;
  998|  5.56M|}

aom_subpixel_8t_intrin_ssse3.c:shuffle_filter_ssse3:
   18|   325k|                                        __m128i *const f) {
   19|   325k|  const __m128i f_values = _mm_load_si128((const __m128i *)filter);
   20|       |  // pack and duplicate the filter values
   21|   325k|  f[0] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0200u));
   22|   325k|  f[1] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0604u));
   23|   325k|  f[2] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0a08u));
   24|   325k|  f[3] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0e0cu));
   25|   325k|}
aom_subpixel_8t_intrin_ssse3.c:convolve8_8_ssse3:
   28|   392k|                                        const __m128i *const f) {
   29|       |  // multiply 2 adjacent elements with the filter and add the result
   30|   392k|  const __m128i k_64 = _mm_set1_epi16(1 << 6);
   31|   392k|  const __m128i x0 = _mm_maddubs_epi16(s[0], f[0]);
   32|   392k|  const __m128i x1 = _mm_maddubs_epi16(s[1], f[1]);
   33|   392k|  const __m128i x2 = _mm_maddubs_epi16(s[2], f[2]);
   34|   392k|  const __m128i x3 = _mm_maddubs_epi16(s[3], f[3]);
   35|   392k|  __m128i sum1, sum2;
   36|       |
   37|       |  // sum the results together, saturating only on the final step
   38|       |  // adding x0 with x2 and x1 with x3 is the only order that prevents
   39|       |  // outranges for all filters
   40|   392k|  sum1 = _mm_add_epi16(x0, x2);
   41|   392k|  sum2 = _mm_add_epi16(x1, x3);
   42|       |  // add the rounding offset early to avoid another saturated add
   43|   392k|  sum1 = _mm_add_epi16(sum1, k_64);
   44|   392k|  sum1 = _mm_adds_epi16(sum1, sum2);
   45|       |  // shift by 7 bit each 16 bit
   46|   392k|  sum1 = _mm_srai_epi16(sum1, 7);
   47|   392k|  return sum1;
   48|   392k|}
resize_ssse3.c:shuffle_filter_ssse3:
   18|  2.82k|                                        __m128i *const f) {
   19|  2.82k|  const __m128i f_values = _mm_load_si128((const __m128i *)filter);
   20|       |  // pack and duplicate the filter values
   21|  2.82k|  f[0] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0200u));
   22|  2.82k|  f[1] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0604u));
   23|  2.82k|  f[2] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0a08u));
   24|  2.82k|  f[3] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0e0cu));
   25|  2.82k|}
resize_ssse3.c:convolve8_8_ssse3:
   28|   493k|                                        const __m128i *const f) {
   29|       |  // multiply 2 adjacent elements with the filter and add the result
   30|   493k|  const __m128i k_64 = _mm_set1_epi16(1 << 6);
   31|   493k|  const __m128i x0 = _mm_maddubs_epi16(s[0], f[0]);
   32|   493k|  const __m128i x1 = _mm_maddubs_epi16(s[1], f[1]);
   33|   493k|  const __m128i x2 = _mm_maddubs_epi16(s[2], f[2]);
   34|   493k|  const __m128i x3 = _mm_maddubs_epi16(s[3], f[3]);
   35|   493k|  __m128i sum1, sum2;
   36|       |
   37|       |  // sum the results together, saturating only on the final step
   38|       |  // adding x0 with x2 and x1 with x3 is the only order that prevents
   39|       |  // outranges for all filters
   40|   493k|  sum1 = _mm_add_epi16(x0, x2);
   41|   493k|  sum2 = _mm_add_epi16(x1, x3);
   42|       |  // add the rounding offset early to avoid another saturated add
   43|   493k|  sum1 = _mm_add_epi16(sum1, k_64);
   44|   493k|  sum1 = _mm_adds_epi16(sum1, sum2);
   45|       |  // shift by 7 bit each 16 bit
   46|   493k|  sum1 = _mm_srai_epi16(sum1, 7);
   47|   493k|  return sum1;
   48|   493k|}

aom_fdct4x4_sse2:
  192|  24.1k|void FDCT4x4_2D(const int16_t *input, tran_low_t *output, int stride) {
  193|       |  // This 2D transform implements 4 vertical 1D transforms followed
  194|       |  // by 4 horizontal 1D transforms.  The multiplies and adds are as given
  195|       |  // by Chen, Smith and Fralick ('77).  The commands for moving the data
  196|       |  // around have been minimized by hand.
  197|       |  // For the purposes of the comments, the 16 inputs are referred to at i0
  198|       |  // through iF (in raster order), intermediate variables are a0, b0, c0
  199|       |  // through f, and correspond to the in-place computations mapped to input
  200|       |  // locations.  The outputs, o0 through oF are labeled according to the
  201|       |  // output locations.
  202|  24.1k|  __m128i in0, in1;
  203|  24.1k|  FDCT4x4_2D_HELPER(input, stride, &in0, &in1);
  ------------------
  |  |   21|  24.1k|#define FDCT4x4_2D_HELPER fdct4x4_helper
  ------------------
  204|       |
  205|       |  // Post-condition (v + 1) >> 2 is now incorporated into previous
  206|       |  // add and right-shift commands.  Only 2 store instructions needed
  207|       |  // because we are using the fact that 1/3 are stored just after 0/2.
  208|  24.1k|  storeu_output(&in0, output + 0 * 4);
  209|  24.1k|  storeu_output(&in1, output + 2 * 4);
  210|  24.1k|}
aom_fdct4x4_lp_sse2:
  214|   980k|void FDCT4x4_2D_LP(const int16_t *input, int16_t *output, int stride) {
  215|   980k|  __m128i in0, in1;
  216|   980k|  FDCT4x4_2D_HELPER(input, stride, &in0, &in1);
  ------------------
  |  |   21|   980k|#define FDCT4x4_2D_HELPER fdct4x4_helper
  ------------------
  217|   980k|  _mm_storeu_si128((__m128i *)(output + 0 * 4), in0);
  218|   980k|  _mm_storeu_si128((__m128i *)(output + 2 * 4), in1);
  219|   980k|}
fwd_txfm_sse2.c:fdct4x4_helper:
   35|  1.00M|                              __m128i *in1) {
   36|       |  // Constants
   37|       |  // These are the coefficients used for the multiplies.
   38|       |  // In the comments, pN means cos(N pi /64) and mN is -cos(N pi /64),
   39|       |  // where cospi_N_64 = cos(N pi /64)
   40|  1.00M|  const __m128i k__cospi_A =
   41|  1.00M|      octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   42|  1.00M|                     cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64);
   43|  1.00M|  const __m128i k__cospi_B =
   44|  1.00M|      octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   45|  1.00M|                     cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64);
   46|  1.00M|  const __m128i k__cospi_C =
   47|  1.00M|      octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   48|  1.00M|                     cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64);
   49|  1.00M|  const __m128i k__cospi_D =
   50|  1.00M|      octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   51|  1.00M|                     cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64);
   52|  1.00M|  const __m128i k__cospi_E =
   53|  1.00M|      octa_set_epi16(cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   54|  1.00M|                     cospi_16_64, cospi_16_64, cospi_16_64, cospi_16_64);
   55|  1.00M|  const __m128i k__cospi_F =
   56|  1.00M|      octa_set_epi16(cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   57|  1.00M|                     cospi_16_64, -cospi_16_64, cospi_16_64, -cospi_16_64);
   58|  1.00M|  const __m128i k__cospi_G =
   59|  1.00M|      octa_set_epi16(cospi_8_64, cospi_24_64, cospi_8_64, cospi_24_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   60|  1.00M|                     -cospi_8_64, -cospi_24_64, -cospi_8_64, -cospi_24_64);
   61|  1.00M|  const __m128i k__cospi_H =
   62|  1.00M|      octa_set_epi16(cospi_24_64, -cospi_8_64, cospi_24_64, -cospi_8_64,
  ------------------
  |  |   30|  1.00M|  _mm_setr_epi16((int16_t)(a), (int16_t)(b), (int16_t)(c), (int16_t)(d), \
  |  |   31|  1.00M|                 (int16_t)(e), (int16_t)(f), (int16_t)(g), (int16_t)(h))
  ------------------
   63|  1.00M|                     -cospi_24_64, cospi_8_64, -cospi_24_64, cospi_8_64);
   64|       |
   65|  1.00M|  const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
  ------------------
  |  |   19|  1.00M|#define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1))
  |  |  ------------------
  |  |  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  |  |  ------------------
  ------------------
   66|       |  // This second rounding constant saves doing some extra adds at the end
   67|  1.00M|  const __m128i k__DCT_CONST_ROUNDING2 =
   68|  1.00M|      _mm_set1_epi32(DCT_CONST_ROUNDING + (DCT_CONST_ROUNDING << 1));
  ------------------
  |  |   19|  1.00M|#define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1))
  |  |  ------------------
  |  |  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  |  |  ------------------
  ------------------
                    _mm_set1_epi32(DCT_CONST_ROUNDING + (DCT_CONST_ROUNDING << 1));
  ------------------
  |  |   19|  1.00M|#define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1))
  |  |  ------------------
  |  |  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  |  |  ------------------
  ------------------
   69|  1.00M|  const int DCT_CONST_BITS2 = DCT_CONST_BITS + 2;
  ------------------
  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  ------------------
   70|  1.00M|  const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1);
   71|  1.00M|  const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
   72|       |
   73|       |  // Load inputs.
   74|  1.00M|  *in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
   75|  1.00M|  *in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
   76|  1.00M|  *in1 = _mm_unpacklo_epi64(
   77|  1.00M|      *in1, _mm_loadl_epi64((const __m128i *)(input + 2 * stride)));
   78|  1.00M|  *in0 = _mm_unpacklo_epi64(
   79|  1.00M|      *in0, _mm_loadl_epi64((const __m128i *)(input + 3 * stride)));
   80|       |  // in0 = [i0 i1 i2 i3 iC iD iE iF]
   81|       |  // in1 = [i4 i5 i6 i7 i8 i9 iA iB]
   82|       |  // multiply by 16 to give some extra precision
   83|  1.00M|  *in0 = _mm_slli_epi16(*in0, 4);
   84|  1.00M|  *in1 = _mm_slli_epi16(*in1, 4);
   85|       |  // if (i == 0 && input[0]) input[0] += 1;
   86|       |  // add 1 to the upper left pixel if it is non-zero, which helps reduce
   87|       |  // the round-trip error
   88|  1.00M|  {
   89|       |    // The mask will only contain whether the first value is zero, all
   90|       |    // other comparison will fail as something shifted by 4 (above << 4)
   91|       |    // can never be equal to one. To increment in the non-zero case, we
   92|       |    // add the mask and one for the first element:
   93|       |    //   - if zero, mask = -1, v = v - 1 + 1 = v
   94|       |    //   - if non-zero, mask = 0, v = v + 0 + 1 = v + 1
   95|  1.00M|    __m128i mask = _mm_cmpeq_epi16(*in0, k__nonzero_bias_a);
   96|  1.00M|    *in0 = _mm_add_epi16(*in0, mask);
   97|  1.00M|    *in0 = _mm_add_epi16(*in0, k__nonzero_bias_b);
   98|  1.00M|  }
   99|       |  // There are 4 total stages, alternating between an add/subtract stage
  100|       |  // followed by an multiply-and-add stage.
  101|  1.00M|  {
  102|       |    // Stage 1: Add/subtract
  103|       |
  104|       |    // in0 = [i0 i1 i2 i3 iC iD iE iF]
  105|       |    // in1 = [i4 i5 i6 i7 i8 i9 iA iB]
  106|  1.00M|    const __m128i r0 = _mm_unpacklo_epi16(*in0, *in1);
  107|  1.00M|    const __m128i r1 = _mm_unpackhi_epi16(*in0, *in1);
  108|       |    // r0 = [i0 i4 i1 i5 i2 i6 i3 i7]
  109|       |    // r1 = [iC i8 iD i9 iE iA iF iB]
  110|  1.00M|    const __m128i r2 = _mm_shuffle_epi32(r0, 0xB4);
  111|  1.00M|    const __m128i r3 = _mm_shuffle_epi32(r1, 0xB4);
  112|       |    // r2 = [i0 i4 i1 i5 i3 i7 i2 i6]
  113|       |    // r3 = [iC i8 iD i9 iF iB iE iA]
  114|       |
  115|  1.00M|    const __m128i t0 = _mm_add_epi16(r2, r3);
  116|  1.00M|    const __m128i t1 = _mm_sub_epi16(r2, r3);
  117|       |    // t0 = [a0 a4 a1 a5 a3 a7 a2 a6]
  118|       |    // t1 = [aC a8 aD a9 aF aB aE aA]
  119|       |
  120|       |    // Stage 2: multiply by constants (which gets us into 32 bits).
  121|       |    // The constants needed here are:
  122|       |    // k__cospi_A = [p16 p16 p16 p16 p16 m16 p16 m16]
  123|       |    // k__cospi_B = [p16 m16 p16 m16 p16 p16 p16 p16]
  124|       |    // k__cospi_C = [p08 p24 p08 p24 p24 m08 p24 m08]
  125|       |    // k__cospi_D = [p24 m08 p24 m08 p08 p24 p08 p24]
  126|  1.00M|    const __m128i u0 = _mm_madd_epi16(t0, k__cospi_A);
  127|  1.00M|    const __m128i u2 = _mm_madd_epi16(t0, k__cospi_B);
  128|  1.00M|    const __m128i u1 = _mm_madd_epi16(t1, k__cospi_C);
  129|  1.00M|    const __m128i u3 = _mm_madd_epi16(t1, k__cospi_D);
  130|       |    // Then add and right-shift to get back to 16-bit range
  131|  1.00M|    const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
  132|  1.00M|    const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
  133|  1.00M|    const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
  134|  1.00M|    const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
  135|  1.00M|    const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
  ------------------
  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  ------------------
  136|  1.00M|    const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
  ------------------
  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  ------------------
  137|  1.00M|    const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
  ------------------
  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  ------------------
  138|  1.00M|    const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
  ------------------
  |  |   18|  1.00M|#define DCT_CONST_BITS 14
  ------------------
  139|       |    // w0 = [b0 b1 b7 b6]
  140|       |    // w1 = [b8 b9 bF bE]
  141|       |    // w2 = [b4 b5 b3 b2]
  142|       |    // w3 = [bC bD bB bA]
  143|  1.00M|    const __m128i x0 = _mm_packs_epi32(w0, w1);
  144|  1.00M|    const __m128i x1 = _mm_packs_epi32(w2, w3);
  145|       |
  146|       |    // x0 = [b0 b1 b7 b6 b8 b9 bF bE]
  147|       |    // x1 = [b4 b5 b3 b2 bC bD bB bA]
  148|  1.00M|    *in0 = _mm_shuffle_epi32(x0, 0xD8);
  149|  1.00M|    *in1 = _mm_shuffle_epi32(x1, 0x8D);
  150|       |    // in0 = [b0 b1 b8 b9 b7 b6 bF bE]
  151|       |    // in1 = [b3 b2 bB bA b4 b5 bC bD]
  152|  1.00M|  }
  153|  1.00M|  {
  154|       |    // vertical DCTs finished. Now we do the horizontal DCTs.
  155|       |    // Stage 3: Add/subtract
  156|       |
  157|  1.00M|    const __m128i t0 = ADD_EPI16(*in0, *in1);
  ------------------
  |  |   29|  1.00M|#define ADD_EPI16 _mm_add_epi16
  ------------------
  158|  1.00M|    const __m128i t1 = SUB_EPI16(*in0, *in1);
  ------------------
  |  |   30|  1.00M|#define SUB_EPI16 _mm_sub_epi16
  ------------------
  159|       |
  160|       |    // Stage 4: multiply by constants (which gets us into 32 bits).
  161|  1.00M|    {
  162|       |      // The constants needed here are:
  163|       |      // k__cospi_E = [p16 p16 p16 p16 p16 p16 p16 p16]
  164|       |      // k__cospi_F = [p16 m16 p16 m16 p16 m16 p16 m16]
  165|       |      // k__cospi_G = [p08 p24 p08 p24 m08 m24 m08 m24]
  166|       |      // k__cospi_H = [p24 m08 p24 m08 m24 p08 m24 p08]
  167|  1.00M|      const __m128i u0 = _mm_madd_epi16(t0, k__cospi_E);
  168|  1.00M|      const __m128i u1 = _mm_madd_epi16(t0, k__cospi_F);
  169|  1.00M|      const __m128i u2 = _mm_madd_epi16(t1, k__cospi_G);
  170|  1.00M|      const __m128i u3 = _mm_madd_epi16(t1, k__cospi_H);
  171|       |      // Then add and right-shift to get back to 16-bit range
  172|       |      // but this combines the final right-shift as well to save operations
  173|       |      // This unusual rounding operations is to maintain bit-accurate
  174|       |      // compatibility with the c version of this function which has two
  175|       |      // rounding steps in a row.
  176|  1.00M|      const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING2);
  177|  1.00M|      const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING2);
  178|  1.00M|      const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING2);
  179|  1.00M|      const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING2);
  180|  1.00M|      const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS2);
  181|  1.00M|      const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS2);
  182|  1.00M|      const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS2);
  183|  1.00M|      const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS2);
  184|  1.00M|      *in0 = _mm_packs_epi32(w0, w2);
  185|  1.00M|      *in1 = _mm_packs_epi32(w1, w3);
  186|  1.00M|    }
  187|  1.00M|  }
  188|  1.00M|}

fwd_txfm_sse2.c:storeu_output:
  147|  48.2k|static inline void storeu_output(const __m128i *poutput, tran_low_t *dst_ptr) {
  148|  48.2k|  const __m128i zero = _mm_setzero_si128();
  149|  48.2k|  const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero);
  150|  48.2k|  __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits);
  151|  48.2k|  __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits);
  152|  48.2k|  _mm_storeu_si128((__m128i *)(dst_ptr), out0);
  153|  48.2k|  _mm_storeu_si128((__m128i *)(dst_ptr + 4), out1);
  154|  48.2k|}

av1_highbd_convolve_y_sr_avx2:
   44|  61.6k|                                   const int subpel_y_qn, int bd) {
   45|  61.6k|  if (filter_params_y->taps == 12) {
  ------------------
  |  Branch (45:7): [True: 0, False: 61.6k]
  ------------------
   46|      0|    av1_highbd_convolve_y_sr_ssse3(src, src_stride, dst, dst_stride, w, h,
   47|      0|                                   filter_params_y, subpel_y_qn, bd);
   48|      0|    return;
   49|      0|  }
   50|  61.6k|  int i, j;
   51|  61.6k|  const int fo_vert = filter_params_y->taps / 2 - 1;
   52|  61.6k|  const uint16_t *const src_ptr = src - fo_vert * src_stride;
   53|       |
   54|  61.6k|  __m256i s[8], coeffs_y[4];
   55|       |
   56|  61.6k|  const int bits = FILTER_BITS;
  ------------------
  |  |   21|  61.6k|#define FILTER_BITS 7
  ------------------
   57|       |
   58|  61.6k|  const __m128i round_shift_bits = _mm_cvtsi32_si128(bits);
   59|  61.6k|  const __m256i round_const_bits = _mm256_set1_epi32((1 << bits) >> 1);
   60|  61.6k|  const __m256i clip_pixel =
   61|  18.4E|      _mm256_set1_epi16(bd == 10 ? 1023 : (bd == 12 ? 4095 : 255));
  ------------------
  |  Branch (61:25): [True: 29.7k, False: 31.9k]
  |  Branch (61:44): [True: 31.9k, False: 18.4E]
  ------------------
   62|  61.6k|  const __m256i zero = _mm256_setzero_si256();
   63|       |
   64|  61.6k|  prepare_coeffs(filter_params_y, subpel_y_qn, coeffs_y);
   65|       |
   66|   127k|  for (j = 0; j < w; j += 8) {
  ------------------
  |  Branch (66:15): [True: 65.3k, False: 61.6k]
  ------------------
   67|  65.3k|    const uint16_t *data = &src_ptr[j];
   68|       |    /* Vertical filter */
   69|  65.3k|    {
   70|  65.3k|      __m256i src6;
   71|  65.3k|      __m256i s01 = _mm256_permute2x128_si256(
   72|  65.3k|          _mm256_castsi128_si256(
   73|  65.3k|              _mm_loadu_si128((__m128i *)(data + 0 * src_stride))),
   74|  65.3k|          _mm256_castsi128_si256(
   75|  65.3k|              _mm_loadu_si128((__m128i *)(data + 1 * src_stride))),
   76|  65.3k|          0x20);
   77|  65.3k|      __m256i s12 = _mm256_permute2x128_si256(
   78|  65.3k|          _mm256_castsi128_si256(
   79|  65.3k|              _mm_loadu_si128((__m128i *)(data + 1 * src_stride))),
   80|  65.3k|          _mm256_castsi128_si256(
   81|  65.3k|              _mm_loadu_si128((__m128i *)(data + 2 * src_stride))),
   82|  65.3k|          0x20);
   83|  65.3k|      __m256i s23 = _mm256_permute2x128_si256(
   84|  65.3k|          _mm256_castsi128_si256(
   85|  65.3k|              _mm_loadu_si128((__m128i *)(data + 2 * src_stride))),
   86|  65.3k|          _mm256_castsi128_si256(
   87|  65.3k|              _mm_loadu_si128((__m128i *)(data + 3 * src_stride))),
   88|  65.3k|          0x20);
   89|  65.3k|      __m256i s34 = _mm256_permute2x128_si256(
   90|  65.3k|          _mm256_castsi128_si256(
   91|  65.3k|              _mm_loadu_si128((__m128i *)(data + 3 * src_stride))),
   92|  65.3k|          _mm256_castsi128_si256(
   93|  65.3k|              _mm_loadu_si128((__m128i *)(data + 4 * src_stride))),
   94|  65.3k|          0x20);
   95|  65.3k|      __m256i s45 = _mm256_permute2x128_si256(
   96|  65.3k|          _mm256_castsi128_si256(
   97|  65.3k|              _mm_loadu_si128((__m128i *)(data + 4 * src_stride))),
   98|  65.3k|          _mm256_castsi128_si256(
   99|  65.3k|              _mm_loadu_si128((__m128i *)(data + 5 * src_stride))),
  100|  65.3k|          0x20);
  101|  65.3k|      src6 = _mm256_castsi128_si256(
  102|  65.3k|          _mm_loadu_si128((__m128i *)(data + 6 * src_stride)));
  103|  65.3k|      __m256i s56 = _mm256_permute2x128_si256(
  104|  65.3k|          _mm256_castsi128_si256(
  105|  65.3k|              _mm_loadu_si128((__m128i *)(data + 5 * src_stride))),
  106|  65.3k|          src6, 0x20);
  107|       |
  108|  65.3k|      s[0] = _mm256_unpacklo_epi16(s01, s12);
  109|  65.3k|      s[1] = _mm256_unpacklo_epi16(s23, s34);
  110|  65.3k|      s[2] = _mm256_unpacklo_epi16(s45, s56);
  111|       |
  112|  65.3k|      s[4] = _mm256_unpackhi_epi16(s01, s12);
  113|  65.3k|      s[5] = _mm256_unpackhi_epi16(s23, s34);
  114|  65.3k|      s[6] = _mm256_unpackhi_epi16(s45, s56);
  115|       |
  116|   334k|      for (i = 0; i < h; i += 2) {
  ------------------
  |  Branch (116:19): [True: 269k, False: 65.3k]
  ------------------
  117|   269k|        data = &src_ptr[i * src_stride + j];
  118|       |
  119|   269k|        const __m256i s67 = _mm256_permute2x128_si256(
  120|   269k|            src6,
  121|   269k|            _mm256_castsi128_si256(
  122|   269k|                _mm_loadu_si128((__m128i *)(data + 7 * src_stride))),
  123|   269k|            0x20);
  124|       |
  125|   269k|        src6 = _mm256_castsi128_si256(
  126|   269k|            _mm_loadu_si128((__m128i *)(data + 8 * src_stride)));
  127|       |
  128|   269k|        const __m256i s78 = _mm256_permute2x128_si256(
  129|   269k|            _mm256_castsi128_si256(
  130|   269k|                _mm_loadu_si128((__m128i *)(data + 7 * src_stride))),
  131|   269k|            src6, 0x20);
  132|       |
  133|   269k|        s[3] = _mm256_unpacklo_epi16(s67, s78);
  134|   269k|        s[7] = _mm256_unpackhi_epi16(s67, s78);
  135|       |
  136|   269k|        const __m256i res_a = convolve(s, coeffs_y);
  137|       |
  138|   269k|        __m256i res_a_round = _mm256_sra_epi32(
  139|   269k|            _mm256_add_epi32(res_a, round_const_bits), round_shift_bits);
  140|       |
  141|   269k|        if (w - j > 4) {
  ------------------
  |  Branch (141:13): [True: 209k, False: 59.8k]
  ------------------
  142|   209k|          const __m256i res_b = convolve(s + 4, coeffs_y);
  143|   209k|          __m256i res_b_round = _mm256_sra_epi32(
  144|   209k|              _mm256_add_epi32(res_b, round_const_bits), round_shift_bits);
  145|       |
  146|   209k|          __m256i res_16bit = _mm256_packs_epi32(res_a_round, res_b_round);
  147|   209k|          res_16bit = _mm256_min_epi16(res_16bit, clip_pixel);
  148|   209k|          res_16bit = _mm256_max_epi16(res_16bit, zero);
  149|       |
  150|   209k|          _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j],
  151|   209k|                           _mm256_castsi256_si128(res_16bit));
  152|   209k|          _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j + dst_stride],
  153|   209k|                           _mm256_extracti128_si256(res_16bit, 1));
  154|   209k|        } else if (w == 4) {
  ------------------
  |  Branch (154:20): [True: 58.4k, False: 1.39k]
  ------------------
  155|  58.4k|          res_a_round = _mm256_packs_epi32(res_a_round, res_a_round);
  156|  58.4k|          res_a_round = _mm256_min_epi16(res_a_round, clip_pixel);
  157|  58.4k|          res_a_round = _mm256_max_epi16(res_a_round, zero);
  158|       |
  159|  58.4k|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j],
  160|  58.4k|                           _mm256_castsi256_si128(res_a_round));
  161|  58.4k|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j + dst_stride],
  162|  58.4k|                           _mm256_extracti128_si256(res_a_round, 1));
  163|  58.4k|        } else {
  164|  1.39k|          res_a_round = _mm256_packs_epi32(res_a_round, res_a_round);
  165|  1.39k|          res_a_round = _mm256_min_epi16(res_a_round, clip_pixel);
  166|  1.39k|          res_a_round = _mm256_max_epi16(res_a_round, zero);
  167|       |
  168|  1.39k|          xx_storel_32(&dst[i * dst_stride + j],
  169|  1.39k|                       _mm256_castsi256_si128(res_a_round));
  170|  1.39k|          xx_storel_32(&dst[i * dst_stride + j + dst_stride],
  171|  1.39k|                       _mm256_extracti128_si256(res_a_round, 1));
  172|  1.39k|        }
  173|       |
  174|   269k|        s[0] = s[1];
  175|   269k|        s[1] = s[2];
  176|   269k|        s[2] = s[3];
  177|       |
  178|   269k|        s[4] = s[5];
  179|   269k|        s[5] = s[6];
  180|   269k|        s[6] = s[7];
  181|   269k|      }
  182|  65.3k|    }
  183|  65.3k|  }
  184|  61.6k|}
av1_highbd_convolve_x_sr_avx2:
  190|  60.3k|                                   ConvolveParams *conv_params, int bd) {
  191|  60.3k|  if (filter_params_x->taps == 12) {
  ------------------
  |  Branch (191:7): [True: 0, False: 60.3k]
  ------------------
  192|      0|    av1_highbd_convolve_x_sr_ssse3(src, src_stride, dst, dst_stride, w, h,
  193|      0|                                   filter_params_x, subpel_x_qn, conv_params,
  194|      0|                                   bd);
  195|      0|    return;
  196|      0|  }
  197|  60.3k|  int i, j;
  198|  60.3k|  const int fo_horiz = filter_params_x->taps / 2 - 1;
  199|  60.3k|  const uint16_t *const src_ptr = src - fo_horiz;
  200|       |
  201|       |  // Check that, even with 12-bit input, the intermediate values will fit
  202|       |  // into an unsigned 16-bit intermediate array.
  203|  60.3k|  assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
  204|       |
  205|  60.3k|  __m256i s[4], coeffs_x[4];
  206|       |
  207|  60.3k|  const __m256i round_const_x =
  208|  60.3k|      _mm256_set1_epi32(((1 << conv_params->round_0) >> 1));
  209|  60.3k|  const __m128i round_shift_x = _mm_cvtsi32_si128(conv_params->round_0);
  210|       |
  211|  60.3k|  const int bits = FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|  60.3k|#define FILTER_BITS 7
  ------------------
  212|  60.3k|  const __m128i round_shift_bits = _mm_cvtsi32_si128(bits);
  213|  60.3k|  const __m256i round_const_bits = _mm256_set1_epi32((1 << bits) >> 1);
  214|  60.3k|  const __m256i clip_pixel =
  215|  60.3k|      _mm256_set1_epi16(bd == 10 ? 1023 : (bd == 12 ? 4095 : 255));
  ------------------
  |  Branch (215:25): [True: 30.1k, False: 30.1k]
  |  Branch (215:44): [True: 30.1k, False: 0]
  ------------------
  216|  60.3k|  const __m256i zero = _mm256_setzero_si256();
  217|       |
  218|  60.3k|  assert(bits >= 0);
  219|  60.3k|  assert((FILTER_BITS - conv_params->round_1) >= 0 ||
  220|  60.3k|         ((conv_params->round_0 + conv_params->round_1) == 2 * FILTER_BITS));
  221|       |
  222|  60.3k|  prepare_coeffs(filter_params_x, subpel_x_qn, coeffs_x);
  223|       |
  224|   126k|  for (j = 0; j < w; j += 8) {
  ------------------
  |  Branch (224:15): [True: 66.0k, False: 60.3k]
  ------------------
  225|       |    /* Horizontal filter */
  226|   315k|    for (i = 0; i < h; i += 2) {
  ------------------
  |  Branch (226:17): [True: 249k, False: 66.0k]
  ------------------
  227|   249k|      const __m256i row0 =
  228|   249k|          _mm256_loadu_si256((__m256i *)&src_ptr[i * src_stride + j]);
  229|   249k|      __m256i row1 =
  230|   249k|          _mm256_loadu_si256((__m256i *)&src_ptr[(i + 1) * src_stride + j]);
  231|       |
  232|   249k|      const __m256i r0 = _mm256_permute2x128_si256(row0, row1, 0x20);
  233|   249k|      const __m256i r1 = _mm256_permute2x128_si256(row0, row1, 0x31);
  234|       |
  235|       |      // even pixels
  236|   249k|      s[0] = _mm256_alignr_epi8(r1, r0, 0);
  237|   249k|      s[1] = _mm256_alignr_epi8(r1, r0, 4);
  238|   249k|      s[2] = _mm256_alignr_epi8(r1, r0, 8);
  239|   249k|      s[3] = _mm256_alignr_epi8(r1, r0, 12);
  240|       |
  241|   249k|      __m256i res_even = convolve(s, coeffs_x);
  242|   249k|      res_even = _mm256_sra_epi32(_mm256_add_epi32(res_even, round_const_x),
  243|   249k|                                  round_shift_x);
  244|       |
  245|       |      // odd pixels
  246|   249k|      s[0] = _mm256_alignr_epi8(r1, r0, 2);
  247|   249k|      s[1] = _mm256_alignr_epi8(r1, r0, 6);
  248|   249k|      s[2] = _mm256_alignr_epi8(r1, r0, 10);
  249|   249k|      s[3] = _mm256_alignr_epi8(r1, r0, 14);
  250|       |
  251|   249k|      __m256i res_odd = convolve(s, coeffs_x);
  252|   249k|      res_odd = _mm256_sra_epi32(_mm256_add_epi32(res_odd, round_const_x),
  253|   249k|                                 round_shift_x);
  254|       |
  255|   249k|      res_even = _mm256_sra_epi32(_mm256_add_epi32(res_even, round_const_bits),
  256|   249k|                                  round_shift_bits);
  257|   249k|      res_odd = _mm256_sra_epi32(_mm256_add_epi32(res_odd, round_const_bits),
  258|   249k|                                 round_shift_bits);
  259|       |
  260|   249k|      __m256i res_even1 = _mm256_packs_epi32(res_even, res_even);
  261|   249k|      __m256i res_odd1 = _mm256_packs_epi32(res_odd, res_odd);
  262|       |
  263|   249k|      __m256i res = _mm256_unpacklo_epi16(res_even1, res_odd1);
  264|   249k|      res = _mm256_min_epi16(res, clip_pixel);
  265|   249k|      res = _mm256_max_epi16(res, zero);
  266|       |
  267|   249k|      if (w - j > 4) {
  ------------------
  |  Branch (267:11): [True: 186k, False: 62.6k]
  ------------------
  268|   186k|        _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j],
  269|   186k|                         _mm256_castsi256_si128(res));
  270|   186k|        _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j + dst_stride],
  271|   186k|                         _mm256_extracti128_si256(res, 1));
  272|   186k|      } else if (w == 4) {
  ------------------
  |  Branch (272:18): [True: 60.0k, False: 2.64k]
  ------------------
  273|  60.0k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j],
  274|  60.0k|                         _mm256_castsi256_si128(res));
  275|  60.0k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j + dst_stride],
  276|  60.0k|                         _mm256_extracti128_si256(res, 1));
  277|  60.0k|      } else {
  278|  2.64k|        xx_storel_32(&dst[i * dst_stride + j], _mm256_castsi256_si128(res));
  279|  2.64k|        xx_storel_32(&dst[i * dst_stride + j + dst_stride],
  280|       |                     _mm256_extracti128_si256(res, 1));
  281|  2.64k|      }
  282|   249k|    }
  283|  66.0k|  }
  284|  60.3k|}

aom_highbd_h_predictor_4x4_sse2:
   21|  1.09M|                                     const uint16_t *left, int bd) {
   22|  1.09M|  const __m128i left_u16 = _mm_loadl_epi64((const __m128i *)left);
   23|  1.09M|  const __m128i row0 = _mm_shufflelo_epi16(left_u16, 0x0);
   24|  1.09M|  const __m128i row1 = _mm_shufflelo_epi16(left_u16, 0x55);
   25|  1.09M|  const __m128i row2 = _mm_shufflelo_epi16(left_u16, 0xaa);
   26|       |  const __m128i row3 = _mm_shufflelo_epi16(left_u16, 0xff);
   27|  1.09M|  (void)above;
   28|  1.09M|  (void)bd;
   29|  1.09M|  _mm_storel_epi64((__m128i *)dst, row0);
   30|  1.09M|  dst += stride;
   31|  1.09M|  _mm_storel_epi64((__m128i *)dst, row1);
   32|  1.09M|  dst += stride;
   33|  1.09M|  _mm_storel_epi64((__m128i *)dst, row2);
   34|  1.09M|  dst += stride;
   35|  1.09M|  _mm_storel_epi64((__m128i *)dst, row3);
   36|  1.09M|}
aom_highbd_h_predictor_4x8_sse2:
   40|  69.0k|                                     const uint16_t *left, int bd) {
   41|  69.0k|  aom_highbd_h_predictor_4x4_sse2(dst, stride, above, left, bd);
   42|  69.0k|  dst += stride << 2;
   43|  69.0k|  left += 4;
   44|  69.0k|  aom_highbd_h_predictor_4x4_sse2(dst, stride, above, left, bd);
   45|  69.0k|}
aom_highbd_h_predictor_8x4_sse2:
   49|  69.4k|                                     const uint16_t *left, int bd) {
   50|  69.4k|  const __m128i left_u16 = _mm_load_si128((const __m128i *)left);
   51|  69.4k|  const __m128i row0 = _mm_shufflelo_epi16(left_u16, 0x0);
   52|  69.4k|  const __m128i row1 = _mm_shufflelo_epi16(left_u16, 0x55);
   53|  69.4k|  const __m128i row2 = _mm_shufflelo_epi16(left_u16, 0xaa);
   54|       |  const __m128i row3 = _mm_shufflelo_epi16(left_u16, 0xff);
   55|  69.4k|  (void)above;
   56|  69.4k|  (void)bd;
   57|  69.4k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row0, row0));
   58|  69.4k|  dst += stride;
   59|  69.4k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row1, row1));
   60|  69.4k|  dst += stride;
   61|  69.4k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row2, row2));
   62|  69.4k|  dst += stride;
   63|  69.4k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row3, row3));
   64|  69.4k|}
aom_highbd_h_predictor_8x8_sse2:
   68|   121k|                                     const uint16_t *left, int bd) {
   69|   121k|  const __m128i left_u16 = _mm_load_si128((const __m128i *)left);
   70|   121k|  const __m128i row0 = _mm_shufflelo_epi16(left_u16, 0x0);
   71|   121k|  const __m128i row1 = _mm_shufflelo_epi16(left_u16, 0x55);
   72|   121k|  const __m128i row2 = _mm_shufflelo_epi16(left_u16, 0xaa);
   73|   121k|  const __m128i row3 = _mm_shufflelo_epi16(left_u16, 0xff);
   74|   121k|  const __m128i row4 = _mm_shufflehi_epi16(left_u16, 0x0);
   75|   121k|  const __m128i row5 = _mm_shufflehi_epi16(left_u16, 0x55);
   76|   121k|  const __m128i row6 = _mm_shufflehi_epi16(left_u16, 0xaa);
   77|       |  const __m128i row7 = _mm_shufflehi_epi16(left_u16, 0xff);
   78|   121k|  (void)above;
   79|   121k|  (void)bd;
   80|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row0, row0));
   81|   121k|  dst += stride;
   82|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row1, row1));
   83|   121k|  dst += stride;
   84|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row2, row2));
   85|   121k|  dst += stride;
   86|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpacklo_epi64(row3, row3));
   87|   121k|  dst += stride;
   88|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpackhi_epi64(row4, row4));
   89|   121k|  dst += stride;
   90|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpackhi_epi64(row5, row5));
   91|   121k|  dst += stride;
   92|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpackhi_epi64(row6, row6));
   93|   121k|  dst += stride;
   94|   121k|  _mm_store_si128((__m128i *)dst, _mm_unpackhi_epi64(row7, row7));
   95|   121k|}
aom_highbd_h_predictor_8x16_sse2:
   99|  2.82k|                                      const uint16_t *left, int bd) {
  100|  2.82k|  aom_highbd_h_predictor_8x8_sse2(dst, stride, above, left, bd);
  101|  2.82k|  dst += stride << 3;
  102|  2.82k|  left += 8;
  103|  2.82k|  aom_highbd_h_predictor_8x8_sse2(dst, stride, above, left, bd);
  104|  2.82k|}
aom_highbd_h_predictor_16x8_sse2:
  145|  1.60k|                                      const uint16_t *left, int bd) {
  146|  1.60k|  (void)above;
  147|  1.60k|  (void)bd;
  148|  1.60k|  h_predictor_16x8(dst, stride, left);
  149|  1.60k|}
aom_highbd_h_predictor_16x16_sse2:
  153|  1.84k|                                       const uint16_t *left, int bd) {
  154|  1.84k|  int i;
  155|  1.84k|  (void)above;
  156|  1.84k|  (void)bd;
  157|       |
  158|  5.53k|  for (i = 0; i < 2; i++, left += 8) {
  ------------------
  |  Branch (158:15): [True: 3.69k, False: 1.84k]
  ------------------
  159|  3.69k|    h_predictor_16x8(dst, stride, left);
  160|  3.69k|    dst += stride << 3;
  161|  3.69k|  }
  162|  1.84k|}
aom_highbd_h_predictor_16x32_sse2:
  166|     55|                                       const uint16_t *left, int bd) {
  167|     55|  int i;
  168|     55|  (void)above;
  169|     55|  (void)bd;
  170|       |
  171|    275|  for (i = 0; i < 4; i++, left += 8) {
  ------------------
  |  Branch (171:15): [True: 220, False: 55]
  ------------------
  172|    220|    h_predictor_16x8(dst, stride, left);
  173|    220|    dst += stride << 3;
  174|    220|  }
  175|     55|}
aom_highbd_h_predictor_32x16_sse2:
  220|     85|                                       const uint16_t *left, int bd) {
  221|     85|  int i;
  222|     85|  (void)above;
  223|     85|  (void)bd;
  224|       |
  225|    255|  for (i = 0; i < 2; i++, left += 8) {
  ------------------
  |  Branch (225:15): [True: 170, False: 85]
  ------------------
  226|    170|    h_predictor_32x8(dst, stride, left);
  227|    170|    dst += stride << 3;
  228|    170|  }
  229|     85|}
aom_highbd_dc_left_predictor_4x4_sse2:
  267|   578k|                                           const uint16_t *left, int bd) {
  268|   578k|  const __m128i two = _mm_cvtsi32_si128(2);
  269|   578k|  const __m128i sum = dc_sum_4(left);
  270|   578k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, two), 2);
  271|   578k|  (void)above;
  272|   578k|  (void)bd;
  273|   578k|  dc_store_4x4(dst, stride, &dc);
  274|   578k|}
aom_highbd_dc_top_predictor_4x4_sse2:
  278|   596k|                                          const uint16_t *left, int bd) {
  279|   596k|  const __m128i two = _mm_cvtsi32_si128(2);
  280|   596k|  const __m128i sum = dc_sum_4(above);
  281|   596k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, two), 2);
  282|   596k|  (void)left;
  283|   596k|  (void)bd;
  284|   596k|  dc_store_4x4(dst, stride, &dc);
  285|   596k|}
aom_highbd_dc_128_predictor_4x4_sse2:
  289|   163k|                                          const uint16_t *left, int bd) {
  290|   163k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  291|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  292|   163k|  (void)above;
  293|   163k|  (void)left;
  294|   163k|  dc_store_4x4(dst, stride, &dc_dup);
  295|   163k|}
aom_highbd_dc_left_predictor_4x8_sse2:
  321|   107k|                                           const uint16_t *left, int bd) {
  322|   107k|  const __m128i sum = dc_sum_8(left);
  323|   107k|  const __m128i four = _mm_cvtsi32_si128(4);
  324|   107k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, four), 3);
  325|   107k|  (void)above;
  326|   107k|  (void)bd;
  327|   107k|  dc_store_4x8(dst, stride, &dc);
  328|   107k|}
aom_highbd_dc_top_predictor_4x8_sse2:
  332|   107k|                                          const uint16_t *left, int bd) {
  333|   107k|  const __m128i two = _mm_cvtsi32_si128(2);
  334|   107k|  const __m128i sum = dc_sum_4(above);
  335|   107k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, two), 2);
  336|   107k|  (void)left;
  337|   107k|  (void)bd;
  338|   107k|  dc_store_4x8(dst, stride, &dc);
  339|   107k|}
aom_highbd_dc_128_predictor_4x8_sse2:
  343|  43.0k|                                          const uint16_t *left, int bd) {
  344|  43.0k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  345|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  346|  43.0k|  (void)above;
  347|  43.0k|  (void)left;
  348|  43.0k|  dc_store_4x8(dst, stride, &dc_dup);
  349|  43.0k|}
aom_highbd_dc_top_predictor_8x4_sse2:
  377|  48.2k|                                          const uint16_t *left, int bd) {
  378|  48.2k|  (void)left;
  379|  48.2k|  (void)bd;
  380|  48.2k|  dc_top_predictor_8xh(dst, stride, 4, above);
  381|  48.2k|}
aom_highbd_dc_top_predictor_8x8_sse2:
  385|   257k|                                          const uint16_t *left, int bd) {
  386|   257k|  (void)left;
  387|   257k|  (void)bd;
  388|   257k|  dc_top_predictor_8xh(dst, stride, 8, above);
  389|   257k|}
aom_highbd_dc_top_predictor_8x16_sse2:
  393|  19.5k|                                           const uint16_t *left, int bd) {
  394|  19.5k|  (void)left;
  395|  19.5k|  (void)bd;
  396|  19.5k|  dc_top_predictor_8xh(dst, stride, 16, above);
  397|  19.5k|}
aom_highbd_dc_left_predictor_8x4_sse2:
  404|  67.4k|                                           const uint16_t *left, int bd) {
  405|  67.4k|  const __m128i two = _mm_cvtsi32_si128(2);
  406|  67.4k|  const __m128i sum = dc_sum_4(left);
  407|  67.4k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, two), 2);
  408|  67.4k|  (void)above;
  409|  67.4k|  (void)bd;
  410|  67.4k|  dc_store_8xh(dst, stride, 4, &dc);
  411|  67.4k|}
aom_highbd_dc_left_predictor_8x8_sse2:
  415|   270k|                                           const uint16_t *left, int bd) {
  416|   270k|  const __m128i four = _mm_cvtsi32_si128(4);
  417|   270k|  const __m128i sum = dc_sum_8(left);
  418|   270k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, four), 3);
  419|   270k|  (void)above;
  420|   270k|  (void)bd;
  421|   270k|  dc_store_8xh(dst, stride, 8, &dc);
  422|   270k|}
aom_highbd_dc_left_predictor_8x16_sse2:
  433|  6.95k|                                            const uint16_t *left, int bd) {
  434|  6.95k|  const __m128i eight = _mm_cvtsi32_si128(8);
  435|  6.95k|  const __m128i sum = dc_sum_16(left);
  436|  6.95k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  437|  6.95k|  (void)above;
  438|  6.95k|  (void)bd;
  439|  6.95k|  dc_store_8xh(dst, stride, 16, &dc);
  440|  6.95k|}
aom_highbd_dc_128_predictor_8x4_sse2:
  454|  20.0k|                                          const uint16_t *left, int bd) {
  455|  20.0k|  (void)above;
  456|  20.0k|  (void)left;
  457|  20.0k|  dc_128_predictor_8xh(dst, stride, 4, bd);
  458|  20.0k|}
aom_highbd_dc_128_predictor_8x8_sse2:
  462|   102k|                                          const uint16_t *left, int bd) {
  463|   102k|  (void)above;
  464|   102k|  (void)left;
  465|   102k|  dc_128_predictor_8xh(dst, stride, 8, bd);
  466|   102k|}
aom_highbd_dc_128_predictor_8x16_sse2:
  470|  12.5k|                                           const uint16_t *left, int bd) {
  471|  12.5k|  (void)above;
  472|  12.5k|  (void)left;
  473|  12.5k|  dc_128_predictor_8xh(dst, stride, 16, bd);
  474|  12.5k|}
aom_highbd_dc_left_predictor_16x8_sse2:
  495|  17.0k|                                            const uint16_t *left, int bd) {
  496|  17.0k|  const __m128i four = _mm_cvtsi32_si128(4);
  497|  17.0k|  const __m128i sum = dc_sum_8(left);
  498|  17.0k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, four), 3);
  499|  17.0k|  (void)above;
  500|  17.0k|  (void)bd;
  501|  17.0k|  dc_store_16xh(dst, stride, 8, &dc);
  502|  17.0k|}
aom_highbd_dc_left_predictor_16x16_sse2:
  506|  13.0k|                                             const uint16_t *left, int bd) {
  507|  13.0k|  const __m128i eight = _mm_cvtsi32_si128(8);
  508|  13.0k|  const __m128i sum = dc_sum_16(left);
  509|  13.0k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  510|  13.0k|  (void)above;
  511|  13.0k|  (void)bd;
  512|  13.0k|  dc_store_16xh(dst, stride, 16, &dc);
  513|  13.0k|}
aom_highbd_dc_left_predictor_16x32_sse2:
  527|    106|                                             const uint16_t *left, int bd) {
  528|    106|  const __m128i sixteen = _mm_cvtsi32_si128(16);
  529|    106|  const __m128i sum = dc_sum_32(left);
  530|    106|  const __m128i dc = _mm_srli_epi32(_mm_add_epi32(sum, sixteen), 5);
  531|    106|  (void)above;
  532|    106|  (void)bd;
  533|    106|  dc_store_16xh(dst, stride, 32, &dc);
  534|    106|}
aom_highbd_dc_top_predictor_16x8_sse2:
  541|  5.45k|                                           const uint16_t *left, int bd) {
  542|  5.45k|  const __m128i eight = _mm_cvtsi32_si128(8);
  543|  5.45k|  const __m128i sum = dc_sum_16(above);
  544|  5.45k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  545|  5.45k|  (void)left;
  546|  5.45k|  (void)bd;
  547|  5.45k|  dc_store_16xh(dst, stride, 8, &dc);
  548|  5.45k|}
aom_highbd_dc_top_predictor_16x16_sse2:
  552|  11.2k|                                            const uint16_t *left, int bd) {
  553|  11.2k|  const __m128i eight = _mm_cvtsi32_si128(8);
  554|  11.2k|  const __m128i sum = dc_sum_16(above);
  555|  11.2k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  556|  11.2k|  (void)left;
  557|  11.2k|  (void)bd;
  558|  11.2k|  dc_store_16xh(dst, stride, 16, &dc);
  559|  11.2k|}
aom_highbd_dc_top_predictor_16x32_sse2:
  563|  1.22k|                                            const uint16_t *left, int bd) {
  564|  1.22k|  const __m128i eight = _mm_cvtsi32_si128(8);
  565|  1.22k|  const __m128i sum = dc_sum_16(above);
  566|  1.22k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  567|  1.22k|  (void)left;
  568|  1.22k|  (void)bd;
  569|  1.22k|  dc_store_16xh(dst, stride, 32, &dc);
  570|  1.22k|}
aom_highbd_dc_128_predictor_16x8_sse2:
  577|  10.5k|                                           const uint16_t *left, int bd) {
  578|  10.5k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  579|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  580|  10.5k|  (void)above;
  581|  10.5k|  (void)left;
  582|  10.5k|  dc_store_16xh(dst, stride, 8, &dc_dup);
  583|  10.5k|}
aom_highbd_dc_128_predictor_16x16_sse2:
  587|  11.2k|                                            const uint16_t *left, int bd) {
  588|  11.2k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  589|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  590|  11.2k|  (void)above;
  591|  11.2k|  (void)left;
  592|  11.2k|  dc_store_16xh(dst, stride, 16, &dc_dup);
  593|  11.2k|}
aom_highbd_dc_128_predictor_16x32_sse2:
  597|  2.11k|                                            const uint16_t *left, int bd) {
  598|  2.11k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  599|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  600|  2.11k|  (void)above;
  601|  2.11k|  (void)left;
  602|  2.11k|  dc_store_16xh(dst, stride, 32, &dc_dup);
  603|  2.11k|}
aom_highbd_dc_left_predictor_32x16_sse2:
  623|  1.62k|                                             const uint16_t *left, int bd) {
  624|  1.62k|  const __m128i eight = _mm_cvtsi32_si128(8);
  625|  1.62k|  const __m128i sum = dc_sum_16(left);
  626|  1.62k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, eight), 4);
  627|  1.62k|  (void)above;
  628|  1.62k|  (void)bd;
  629|  1.62k|  dc_store_32xh(dst, stride, 16, &dc);
  630|  1.62k|}
aom_highbd_dc_left_predictor_32x32_sse2:
  634|  2.23k|                                             const uint16_t *left, int bd) {
  635|  2.23k|  const __m128i sixteen = _mm_cvtsi32_si128(16);
  636|  2.23k|  const __m128i sum = dc_sum_32(left);
  637|  2.23k|  const __m128i dc = _mm_srli_epi32(_mm_add_epi32(sum, sixteen), 5);
  638|  2.23k|  (void)above;
  639|  2.23k|  (void)bd;
  640|  2.23k|  dc_store_32xh(dst, stride, 32, &dc);
  641|  2.23k|}
aom_highbd_dc_top_predictor_32x16_sse2:
  645|     52|                                            const uint16_t *left, int bd) {
  646|     52|  const __m128i sixteen = _mm_cvtsi32_si128(16);
  647|     52|  const __m128i sum = dc_sum_32(above);
  648|     52|  const __m128i dc = _mm_srli_epi32(_mm_add_epi32(sum, sixteen), 5);
  649|     52|  (void)left;
  650|     52|  (void)bd;
  651|     52|  dc_store_32xh(dst, stride, 16, &dc);
  652|     52|}
aom_highbd_dc_128_predictor_32x16_sse2:
  656|  2.31k|                                            const uint16_t *left, int bd) {
  657|  2.31k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  658|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  659|  2.31k|  (void)above;
  660|  2.31k|  (void)left;
  661|  2.31k|  dc_store_32xh(dst, stride, 16, &dc_dup);
  662|  2.31k|}
aom_highbd_dc_top_predictor_32x32_sse2:
  666|  2.09k|                                            const uint16_t *left, int bd) {
  667|  2.09k|  const __m128i sixteen = _mm_cvtsi32_si128(16);
  668|  2.09k|  const __m128i sum = dc_sum_32(above);
  669|  2.09k|  const __m128i dc = _mm_srli_epi32(_mm_add_epi32(sum, sixteen), 5);
  670|  2.09k|  (void)left;
  671|  2.09k|  (void)bd;
  672|  2.09k|  dc_store_32xh(dst, stride, 32, &dc);
  673|  2.09k|}
aom_highbd_dc_128_predictor_32x32_sse2:
  677|  4.11k|                                            const uint16_t *left, int bd) {
  678|  4.11k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  679|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  680|  4.11k|  (void)above;
  681|  4.11k|  (void)left;
  682|  4.11k|  dc_store_32xh(dst, stride, 32, &dc_dup);
  683|  4.11k|}
aom_highbd_v_predictor_4x8_sse2:
  690|  49.3k|                                     const uint16_t *left, int bd) {
  691|  49.3k|  (void)left;
  692|  49.3k|  (void)bd;
  693|  49.3k|  const __m128i above_u16 = _mm_loadl_epi64((const __m128i *)above);
  694|  49.3k|  int i;
  695|   148k|  for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (695:15): [True: 98.7k, False: 49.3k]
  ------------------
  696|  98.7k|    _mm_storel_epi64((__m128i *)dst, above_u16);
  697|  98.7k|    _mm_storel_epi64((__m128i *)(dst + stride), above_u16);
  698|  98.7k|    _mm_storel_epi64((__m128i *)(dst + 2 * stride), above_u16);
  699|  98.7k|    _mm_storel_epi64((__m128i *)(dst + 3 * stride), above_u16);
  700|  98.7k|    dst += stride << 2;
  701|  98.7k|  }
  702|  49.3k|}
aom_highbd_v_predictor_8x4_sse2:
  706|  56.2k|                                     const uint16_t *left, int bd) {
  707|  56.2k|  (void)left;
  708|  56.2k|  (void)bd;
  709|  56.2k|  const __m128i above_u16 = _mm_load_si128((const __m128i *)above);
  710|  56.2k|  _mm_store_si128((__m128i *)dst, above_u16);
  711|  56.2k|  _mm_store_si128((__m128i *)(dst + stride), above_u16);
  712|  56.2k|  _mm_store_si128((__m128i *)(dst + 2 * stride), above_u16);
  713|  56.2k|  _mm_store_si128((__m128i *)(dst + 3 * stride), above_u16);
  714|  56.2k|}
aom_highbd_v_predictor_8x16_sse2:
  718|    642|                                      const uint16_t *left, int bd) {
  719|    642|  (void)left;
  720|    642|  (void)bd;
  721|    642|  const __m128i above_u16 = _mm_load_si128((const __m128i *)above);
  722|    642|  int i;
  723|  3.21k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (723:15): [True: 2.57k, False: 642]
  ------------------
  724|  2.57k|    _mm_store_si128((__m128i *)dst, above_u16);
  725|  2.57k|    _mm_store_si128((__m128i *)(dst + stride), above_u16);
  726|  2.57k|    _mm_store_si128((__m128i *)(dst + 2 * stride), above_u16);
  727|  2.57k|    _mm_store_si128((__m128i *)(dst + 3 * stride), above_u16);
  728|  2.57k|    dst += stride << 2;
  729|  2.57k|  }
  730|    642|}
aom_highbd_v_predictor_16x8_sse2:
  734|  2.88k|                                      const uint16_t *left, int bd) {
  735|  2.88k|  (void)left;
  736|  2.88k|  (void)bd;
  737|  2.88k|  const __m128i above0_u16 = _mm_load_si128((const __m128i *)above);
  738|  2.88k|  const __m128i above1_u16 = _mm_load_si128((const __m128i *)(above + 8));
  739|  2.88k|  int i;
  740|  8.65k|  for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (740:15): [True: 5.77k, False: 2.88k]
  ------------------
  741|  5.77k|    _mm_store_si128((__m128i *)dst, above0_u16);
  742|  5.77k|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  743|  5.77k|    dst += stride;
  744|  5.77k|    _mm_store_si128((__m128i *)dst, above0_u16);
  745|  5.77k|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  746|  5.77k|    dst += stride;
  747|  5.77k|    _mm_store_si128((__m128i *)dst, above0_u16);
  748|  5.77k|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  749|  5.77k|    dst += stride;
  750|  5.77k|    _mm_store_si128((__m128i *)dst, above0_u16);
  751|  5.77k|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  752|  5.77k|    dst += stride;
  753|  5.77k|  }
  754|  2.88k|}
aom_highbd_v_predictor_16x32_sse2:
  758|      6|                                       const uint16_t *left, int bd) {
  759|      6|  (void)left;
  760|      6|  (void)bd;
  761|      6|  const __m128i above0_u16 = _mm_load_si128((const __m128i *)above);
  762|      6|  const __m128i above1_u16 = _mm_load_si128((const __m128i *)(above + 8));
  763|      6|  int i;
  764|     54|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (764:15): [True: 48, False: 6]
  ------------------
  765|     48|    _mm_store_si128((__m128i *)dst, above0_u16);
  766|     48|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  767|     48|    dst += stride;
  768|     48|    _mm_store_si128((__m128i *)dst, above0_u16);
  769|     48|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  770|     48|    dst += stride;
  771|     48|    _mm_store_si128((__m128i *)dst, above0_u16);
  772|     48|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  773|     48|    dst += stride;
  774|     48|    _mm_store_si128((__m128i *)dst, above0_u16);
  775|     48|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  776|     48|    dst += stride;
  777|     48|  }
  778|      6|}
aom_highbd_v_predictor_32x16_sse2:
  782|     38|                                       const uint16_t *left, int bd) {
  783|     38|  (void)left;
  784|     38|  (void)bd;
  785|     38|  const __m128i above0_u16 = _mm_load_si128((const __m128i *)above);
  786|     38|  const __m128i above1_u16 = _mm_load_si128((const __m128i *)(above + 8));
  787|     38|  const __m128i above2_u16 = _mm_load_si128((const __m128i *)(above + 16));
  788|     38|  const __m128i above3_u16 = _mm_load_si128((const __m128i *)(above + 24));
  789|     38|  int i;
  790|    190|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (790:15): [True: 152, False: 38]
  ------------------
  791|    152|    _mm_store_si128((__m128i *)dst, above0_u16);
  792|    152|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  793|    152|    _mm_store_si128((__m128i *)(dst + 16), above2_u16);
  794|    152|    _mm_store_si128((__m128i *)(dst + 24), above3_u16);
  795|    152|    dst += stride;
  796|    152|    _mm_store_si128((__m128i *)dst, above0_u16);
  797|    152|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  798|    152|    _mm_store_si128((__m128i *)(dst + 16), above2_u16);
  799|    152|    _mm_store_si128((__m128i *)(dst + 24), above3_u16);
  800|    152|    dst += stride;
  801|    152|    _mm_store_si128((__m128i *)dst, above0_u16);
  802|    152|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  803|    152|    _mm_store_si128((__m128i *)(dst + 16), above2_u16);
  804|    152|    _mm_store_si128((__m128i *)(dst + 24), above3_u16);
  805|    152|    dst += stride;
  806|    152|    _mm_store_si128((__m128i *)dst, above0_u16);
  807|    152|    _mm_store_si128((__m128i *)(dst + 8), above1_u16);
  808|    152|    _mm_store_si128((__m128i *)(dst + 16), above2_u16);
  809|    152|    _mm_store_si128((__m128i *)(dst + 24), above3_u16);
  810|    152|    dst += stride;
  811|    152|  }
  812|     38|}
aom_highbd_dc_predictor_4x8_sse2:
  819|   129k|                                      const uint16_t *left, int bd) {
  820|   129k|  (void)bd;
  821|   129k|  const __m128i sum_above = dc_sum_4(above);
  822|   129k|  const __m128i sum_left = dc_sum_8(left);
  823|   129k|  const __m128i sum = _mm_add_epi16(sum_above, sum_left);
  824|   129k|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  825|   129k|  sum32 >>= 16;
  826|   129k|  sum32 += 6;
  827|   129k|  sum32 /= 12;
  828|   129k|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  829|   129k|  int i;
  830|   645k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (830:15): [True: 516k, False: 129k]
  ------------------
  831|   516k|    _mm_storel_epi64((__m128i *)dst, row);
  832|   516k|    dst += stride;
  833|   516k|    _mm_storel_epi64((__m128i *)dst, row);
  834|   516k|    dst += stride;
  835|   516k|  }
  836|   129k|}
aom_highbd_dc_predictor_8x4_sse2:
  840|  82.4k|                                      const uint16_t *left, int bd) {
  841|  82.4k|  (void)bd;
  842|  82.4k|  const __m128i sum_left = dc_sum_4(left);
  843|  82.4k|  const __m128i sum_above = dc_sum_8(above);
  844|  82.4k|  const __m128i sum = _mm_add_epi16(sum_above, sum_left);
  845|  82.4k|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  846|  82.4k|  sum32 >>= 16;
  847|  82.4k|  sum32 += 6;
  848|  82.4k|  sum32 /= 12;
  849|  82.4k|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  850|       |
  851|  82.4k|  _mm_store_si128((__m128i *)dst, row);
  852|  82.4k|  dst += stride;
  853|  82.4k|  _mm_store_si128((__m128i *)dst, row);
  854|  82.4k|  dst += stride;
  855|  82.4k|  _mm_store_si128((__m128i *)dst, row);
  856|  82.4k|  dst += stride;
  857|  82.4k|  _mm_store_si128((__m128i *)dst, row);
  858|  82.4k|}
aom_highbd_dc_predictor_8x16_sse2:
  862|  4.17k|                                       const uint16_t *left, int bd) {
  863|  4.17k|  (void)bd;
  864|  4.17k|  __m128i sum_left = dc_sum_16(left);
  865|  4.17k|  __m128i sum_above = dc_sum_8(above);
  866|  4.17k|  const __m128i zero = _mm_setzero_si128();
  867|  4.17k|  sum_left = _mm_unpacklo_epi16(sum_left, zero);
  868|  4.17k|  sum_above = _mm_unpacklo_epi16(sum_above, zero);
  869|  4.17k|  const __m128i sum = _mm_add_epi32(sum_left, sum_above);
  870|  4.17k|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  871|  4.17k|  sum32 += 12;
  872|  4.17k|  sum32 /= 24;
  873|  4.17k|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  874|  4.17k|  int i;
  875|  20.8k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (875:15): [True: 16.6k, False: 4.17k]
  ------------------
  876|  16.6k|    _mm_store_si128((__m128i *)dst, row);
  877|  16.6k|    dst += stride;
  878|  16.6k|    _mm_store_si128((__m128i *)dst, row);
  879|  16.6k|    dst += stride;
  880|  16.6k|    _mm_store_si128((__m128i *)dst, row);
  881|  16.6k|    dst += stride;
  882|  16.6k|    _mm_store_si128((__m128i *)dst, row);
  883|  16.6k|    dst += stride;
  884|  16.6k|  }
  885|  4.17k|}
aom_highbd_dc_predictor_16x8_sse2:
  889|  4.17k|                                       const uint16_t *left, int bd) {
  890|  4.17k|  (void)bd;
  891|  4.17k|  __m128i sum_left = dc_sum_8(left);
  892|  4.17k|  __m128i sum_above = dc_sum_16(above);
  893|  4.17k|  const __m128i zero = _mm_setzero_si128();
  894|  4.17k|  sum_left = _mm_unpacklo_epi16(sum_left, zero);
  895|  4.17k|  sum_above = _mm_unpacklo_epi16(sum_above, zero);
  896|  4.17k|  const __m128i sum = _mm_add_epi32(sum_left, sum_above);
  897|  4.17k|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  898|  4.17k|  sum32 += 12;
  899|  4.17k|  sum32 /= 24;
  900|  4.17k|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  901|  4.17k|  int i;
  902|  12.5k|  for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (902:15): [True: 8.35k, False: 4.17k]
  ------------------
  903|  8.35k|    _mm_store_si128((__m128i *)dst, row);
  904|  8.35k|    _mm_store_si128((__m128i *)(dst + 8), row);
  905|  8.35k|    dst += stride;
  906|  8.35k|    _mm_store_si128((__m128i *)dst, row);
  907|  8.35k|    _mm_store_si128((__m128i *)(dst + 8), row);
  908|  8.35k|    dst += stride;
  909|  8.35k|    _mm_store_si128((__m128i *)dst, row);
  910|  8.35k|    _mm_store_si128((__m128i *)(dst + 8), row);
  911|  8.35k|    dst += stride;
  912|  8.35k|    _mm_store_si128((__m128i *)dst, row);
  913|  8.35k|    _mm_store_si128((__m128i *)(dst + 8), row);
  914|  8.35k|    dst += stride;
  915|  8.35k|  }
  916|  4.17k|}
aom_highbd_dc_predictor_16x32_sse2:
  920|     14|                                        const uint16_t *left, int bd) {
  921|     14|  (void)bd;
  922|     14|  __m128i sum_left = dc_sum_32(left);
  923|     14|  __m128i sum_above = dc_sum_16(above);
  924|     14|  const __m128i zero = _mm_setzero_si128();
  925|     14|  sum_above = _mm_unpacklo_epi16(sum_above, zero);
  926|     14|  const __m128i sum = _mm_add_epi32(sum_left, sum_above);
  927|     14|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  928|     14|  sum32 += 24;
  929|     14|  sum32 /= 48;
  930|     14|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  931|     14|  int i;
  932|    126|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (932:15): [True: 112, False: 14]
  ------------------
  933|    112|    _mm_store_si128((__m128i *)dst, row);
  934|    112|    _mm_store_si128((__m128i *)(dst + 8), row);
  935|    112|    dst += stride;
  936|    112|    _mm_store_si128((__m128i *)dst, row);
  937|    112|    _mm_store_si128((__m128i *)(dst + 8), row);
  938|    112|    dst += stride;
  939|    112|    _mm_store_si128((__m128i *)dst, row);
  940|    112|    _mm_store_si128((__m128i *)(dst + 8), row);
  941|    112|    dst += stride;
  942|    112|    _mm_store_si128((__m128i *)dst, row);
  943|    112|    _mm_store_si128((__m128i *)(dst + 8), row);
  944|    112|    dst += stride;
  945|    112|  }
  946|     14|}
aom_highbd_dc_predictor_32x16_sse2:
  950|     13|                                        const uint16_t *left, int bd) {
  951|     13|  (void)bd;
  952|     13|  __m128i sum_left = dc_sum_16(left);
  953|     13|  __m128i sum_above = dc_sum_32(above);
  954|     13|  const __m128i zero = _mm_setzero_si128();
  955|     13|  sum_left = _mm_unpacklo_epi16(sum_left, zero);
  956|     13|  const __m128i sum = _mm_add_epi32(sum_left, sum_above);
  957|     13|  uint32_t sum32 = (uint32_t)_mm_cvtsi128_si32(sum);
  958|     13|  sum32 += 24;
  959|     13|  sum32 /= 48;
  960|     13|  const __m128i row = _mm_set1_epi16((int16_t)sum32);
  961|     13|  int i;
  962|     65|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (962:15): [True: 52, False: 13]
  ------------------
  963|     52|    _mm_store_si128((__m128i *)dst, row);
  964|     52|    _mm_store_si128((__m128i *)(dst + 8), row);
  965|     52|    _mm_store_si128((__m128i *)(dst + 16), row);
  966|     52|    _mm_store_si128((__m128i *)(dst + 24), row);
  967|     52|    dst += stride;
  968|     52|    _mm_store_si128((__m128i *)dst, row);
  969|     52|    _mm_store_si128((__m128i *)(dst + 8), row);
  970|     52|    _mm_store_si128((__m128i *)(dst + 16), row);
  971|     52|    _mm_store_si128((__m128i *)(dst + 24), row);
  972|     52|    dst += stride;
  973|     52|    _mm_store_si128((__m128i *)dst, row);
  974|     52|    _mm_store_si128((__m128i *)(dst + 8), row);
  975|     52|    _mm_store_si128((__m128i *)(dst + 16), row);
  976|     52|    _mm_store_si128((__m128i *)(dst + 24), row);
  977|     52|    dst += stride;
  978|     52|    _mm_store_si128((__m128i *)dst, row);
  979|     52|    _mm_store_si128((__m128i *)(dst + 8), row);
  980|     52|    _mm_store_si128((__m128i *)(dst + 16), row);
  981|     52|    _mm_store_si128((__m128i *)(dst + 24), row);
  982|     52|    dst += stride;
  983|     52|  }
  984|     13|}
highbd_intrapred_sse2.c:h_predictor_16x8:
  123|  5.51k|                                    const uint16_t *left) {
  124|  5.51k|  const __m128i left_u16 = _mm_load_si128((const __m128i *)left);
  125|  5.51k|  const __m128i row0 = _mm_shufflelo_epi16(left_u16, 0x0);
  126|  5.51k|  const __m128i row1 = _mm_shufflelo_epi16(left_u16, 0x55);
  127|  5.51k|  const __m128i row2 = _mm_shufflelo_epi16(left_u16, 0xaa);
  128|  5.51k|  const __m128i row3 = _mm_shufflelo_epi16(left_u16, 0xff);
  129|  5.51k|  const __m128i row4 = _mm_shufflehi_epi16(left_u16, 0x0);
  130|  5.51k|  const __m128i row5 = _mm_shufflehi_epi16(left_u16, 0x55);
  131|  5.51k|  const __m128i row6 = _mm_shufflehi_epi16(left_u16, 0xaa);
  132|       |  const __m128i row7 = _mm_shufflehi_epi16(left_u16, 0xff);
  133|  5.51k|  h_store_16_unpacklo(&dst, stride, &row0);
  134|  5.51k|  h_store_16_unpacklo(&dst, stride, &row1);
  135|  5.51k|  h_store_16_unpacklo(&dst, stride, &row2);
  136|  5.51k|  h_store_16_unpacklo(&dst, stride, &row3);
  137|  5.51k|  h_store_16_unpackhi(&dst, stride, &row4);
  138|  5.51k|  h_store_16_unpackhi(&dst, stride, &row5);
  139|  5.51k|  h_store_16_unpackhi(&dst, stride, &row6);
  140|  5.51k|  h_store_16_unpackhi(&dst, stride, &row7);
  141|  5.51k|}
highbd_intrapred_sse2.c:h_store_16_unpacklo:
  107|  22.0k|                                       const __m128i *row) {
  108|  22.0k|  const __m128i val = _mm_unpacklo_epi64(*row, *row);
  109|  22.0k|  _mm_store_si128((__m128i *)*dst, val);
  110|  22.0k|  _mm_store_si128((__m128i *)(*dst + 8), val);
  111|  22.0k|  *dst += stride;
  112|  22.0k|}
highbd_intrapred_sse2.c:h_store_16_unpackhi:
  115|  22.0k|                                       const __m128i *row) {
  116|  22.0k|  const __m128i val = _mm_unpackhi_epi64(*row, *row);
  117|  22.0k|  _mm_store_si128((__m128i *)(*dst), val);
  118|  22.0k|  _mm_store_si128((__m128i *)(*dst + 8), val);
  119|  22.0k|  *dst += stride;
  120|  22.0k|}
highbd_intrapred_sse2.c:h_predictor_32x8:
  198|    170|                                    const uint16_t *left) {
  199|    170|  const __m128i left_u16 = _mm_load_si128((const __m128i *)left);
  200|    170|  const __m128i row0 = _mm_shufflelo_epi16(left_u16, 0x0);
  201|    170|  const __m128i row1 = _mm_shufflelo_epi16(left_u16, 0x55);
  202|    170|  const __m128i row2 = _mm_shufflelo_epi16(left_u16, 0xaa);
  203|    170|  const __m128i row3 = _mm_shufflelo_epi16(left_u16, 0xff);
  204|    170|  const __m128i row4 = _mm_shufflehi_epi16(left_u16, 0x0);
  205|    170|  const __m128i row5 = _mm_shufflehi_epi16(left_u16, 0x55);
  206|    170|  const __m128i row6 = _mm_shufflehi_epi16(left_u16, 0xaa);
  207|       |  const __m128i row7 = _mm_shufflehi_epi16(left_u16, 0xff);
  208|    170|  h_store_32_unpacklo(&dst, stride, &row0);
  209|    170|  h_store_32_unpacklo(&dst, stride, &row1);
  210|    170|  h_store_32_unpacklo(&dst, stride, &row2);
  211|    170|  h_store_32_unpacklo(&dst, stride, &row3);
  212|    170|  h_store_32_unpackhi(&dst, stride, &row4);
  213|    170|  h_store_32_unpackhi(&dst, stride, &row5);
  214|    170|  h_store_32_unpackhi(&dst, stride, &row6);
  215|    170|  h_store_32_unpackhi(&dst, stride, &row7);
  216|    170|}
highbd_intrapred_sse2.c:h_store_32_unpacklo:
  178|    680|                                       const __m128i *row) {
  179|    680|  const __m128i val = _mm_unpacklo_epi64(*row, *row);
  180|    680|  _mm_store_si128((__m128i *)(*dst), val);
  181|    680|  _mm_store_si128((__m128i *)(*dst + 8), val);
  182|    680|  _mm_store_si128((__m128i *)(*dst + 16), val);
  183|    680|  _mm_store_si128((__m128i *)(*dst + 24), val);
  184|    680|  *dst += stride;
  185|    680|}
highbd_intrapred_sse2.c:h_store_32_unpackhi:
  188|    680|                                       const __m128i *row) {
  189|    680|  const __m128i val = _mm_unpackhi_epi64(*row, *row);
  190|    680|  _mm_store_si128((__m128i *)(*dst), val);
  191|    680|  _mm_store_si128((__m128i *)(*dst + 8), val);
  192|    680|  _mm_store_si128((__m128i *)(*dst + 16), val);
  193|    680|  _mm_store_si128((__m128i *)(*dst + 24), val);
  194|    680|  *dst += stride;
  195|    680|}
highbd_intrapred_sse2.c:dc_sum_4:
  249|  1.56M|static inline __m128i dc_sum_4(const uint16_t *ref) {
  250|  1.56M|  const __m128i _dcba = _mm_loadl_epi64((const __m128i *)ref);
  251|  1.56M|  const __m128i _xxdc = _mm_shufflelo_epi16(_dcba, 0xe);
  252|  1.56M|  const __m128i a = _mm_add_epi16(_dcba, _xxdc);
  253|       |  return _mm_add_epi16(a, _mm_shufflelo_epi16(a, 0x1));
  254|  1.56M|}
highbd_intrapred_sse2.c:dc_store_4x4:
  257|  1.33M|                                const __m128i *dc) {
  258|  1.33M|  const __m128i dc_dup = _mm_shufflelo_epi16(*dc, 0x0);
  259|  1.33M|  int i;
  260|  6.68M|  for (i = 0; i < 4; ++i, dst += stride) {
  ------------------
  |  Branch (260:15): [True: 5.35M, False: 1.33M]
  ------------------
  261|  5.35M|    _mm_storel_epi64((__m128i *)dst, dc_dup);
  262|  5.35M|  }
  263|  1.33M|}
highbd_intrapred_sse2.c:dc_sum_8:
  310|  1.05M|static inline __m128i dc_sum_8(const uint16_t *ref) {
  311|  1.05M|  const __m128i ref_u16 = _mm_load_si128((const __m128i *)ref);
  312|  1.05M|  const __m128i _dcba = _mm_add_epi16(ref_u16, _mm_srli_si128(ref_u16, 8));
  313|  1.05M|  const __m128i _xxdc = _mm_shufflelo_epi16(_dcba, 0xe);
  314|  1.05M|  const __m128i a = _mm_add_epi16(_dcba, _xxdc);
  315|       |
  316|       |  return _mm_add_epi16(a, _mm_shufflelo_epi16(a, 0x1));
  317|  1.05M|}
highbd_intrapred_sse2.c:dc_store_4x8:
  301|   257k|                                const __m128i *dc) {
  302|   257k|  const __m128i dc_dup = _mm_shufflelo_epi16(*dc, 0x0);
  303|   257k|  int i;
  304|  2.31M|  for (i = 0; i < 8; ++i, dst += stride) {
  ------------------
  |  Branch (304:15): [True: 2.06M, False: 257k]
  ------------------
  305|  2.06M|    _mm_storel_epi64((__m128i *)dst, dc_dup);
  306|  2.06M|  }
  307|   257k|}
highbd_intrapred_sse2.c:dc_top_predictor_8xh:
  368|   325k|                                        int height, const uint16_t *above) {
  369|   325k|  const __m128i four = _mm_cvtsi32_si128(4);
  370|   325k|  const __m128i sum = dc_sum_8(above);
  371|   325k|  const __m128i dc = _mm_srli_epi16(_mm_add_epi16(sum, four), 3);
  372|   325k|  dc_store_8xh(dst, stride, height, &dc);
  373|   325k|}
highbd_intrapred_sse2.c:dc_store_8xh:
  355|   805k|                                const __m128i *dc) {
  356|   805k|  const __m128i dc_dup_lo = _mm_shufflelo_epi16(*dc, 0);
  357|   805k|  const __m128i dc_dup = _mm_unpacklo_epi64(dc_dup_lo, dc_dup_lo);
  358|   805k|  int i;
  359|  7.01M|  for (i = 0; i < height; ++i, dst += stride) {
  ------------------
  |  Branch (359:15): [True: 6.21M, False: 805k]
  ------------------
  360|  6.21M|    _mm_store_si128((__m128i *)dst, dc_dup);
  361|  6.21M|  }
  362|   805k|}
highbd_intrapred_sse2.c:dc_sum_16:
  425|  56.9k|static inline __m128i dc_sum_16(const uint16_t *ref) {
  426|  56.9k|  const __m128i sum_lo = dc_sum_8(ref);
  427|  56.9k|  const __m128i sum_hi = dc_sum_8(ref + 8);
  428|  56.9k|  return _mm_add_epi16(sum_lo, sum_hi);
  429|  56.9k|}
highbd_intrapred_sse2.c:dc_128_predictor_8xh:
  446|   134k|                                        int height, int bd) {
  447|   134k|  const __m128i dc = _mm_cvtsi32_si128(1 << (bd - 1));
  448|       |  const __m128i dc_dup = _mm_shufflelo_epi16(dc, 0x0);
  449|   134k|  dc_store_8xh(dst, stride, height, &dc_dup);
  450|   134k|}
highbd_intrapred_sse2.c:dc_store_16xh:
  480|  72.0k|                                 const __m128i *dc) {
  481|  72.0k|  const __m128i dc_dup_lo = _mm_shufflelo_epi16(*dc, 0);
  482|  72.0k|  const __m128i dc_dup = _mm_unpacklo_epi64(dc_dup_lo, dc_dup_lo);
  483|  72.0k|  int i;
  484|  1.01M|  for (i = 0; i < height; ++i, dst += stride) {
  ------------------
  |  Branch (484:15): [True: 944k, False: 72.0k]
  ------------------
  485|   944k|    _mm_store_si128((__m128i *)dst, dc_dup);
  486|   944k|    _mm_store_si128((__m128i *)(dst + 8), dc_dup);
  487|   944k|  }
  488|  72.0k|}
highbd_intrapred_sse2.c:dc_sum_32:
  516|  4.51k|static inline __m128i dc_sum_32(const uint16_t *ref) {
  517|  4.51k|  const __m128i zero = _mm_setzero_si128();
  518|  4.51k|  const __m128i sum_a = dc_sum_16(ref);
  519|  4.51k|  const __m128i sum_b = dc_sum_16(ref + 16);
  520|       |  // 12 bit bd will outrange, so expand to 32 bit before adding final total
  521|  4.51k|  return _mm_add_epi32(_mm_unpacklo_epi16(sum_a, zero),
  522|  4.51k|                       _mm_unpacklo_epi16(sum_b, zero));
  523|  4.51k|}
highbd_intrapred_sse2.c:dc_store_32xh:
  609|  12.4k|                                 const __m128i *dc) {
  610|  12.4k|  const __m128i dc_dup_lo = _mm_shufflelo_epi16(*dc, 0);
  611|  12.4k|  const __m128i dc_dup = _mm_unpacklo_epi64(dc_dup_lo, dc_dup_lo);
  612|  12.4k|  int i;
  613|   346k|  for (i = 0; i < height; ++i, dst += stride) {
  ------------------
  |  Branch (613:15): [True: 333k, False: 12.4k]
  ------------------
  614|   333k|    _mm_store_si128((__m128i *)dst, dc_dup);
  615|   333k|    _mm_store_si128((__m128i *)(dst + 8), dc_dup);
  616|   333k|    _mm_store_si128((__m128i *)(dst + 16), dc_dup);
  617|   333k|    _mm_store_si128((__m128i *)(dst + 24), dc_dup);
  618|   333k|  }
  619|  12.4k|}

aom_highbd_lpf_horizontal_14_dual_avx2:
   23|  7.60k|    const uint8_t *thresh1, int bd) {
   24|  7.60k|  aom_highbd_lpf_horizontal_14_dual_sse2(s, p, blimit0, limit0, thresh0,
   25|  7.60k|                                         blimit1, limit1, thresh1, bd);
   26|  7.60k|}
aom_highbd_lpf_vertical_14_dual_avx2:
   31|  7.39k|    const uint8_t *thresh1, int bd) {
   32|  7.39k|  aom_highbd_lpf_vertical_14_dual_sse2(s, p, blimit0, limit0, thresh0, blimit1,
   33|  7.39k|                                       limit1, thresh1, bd);
   34|  7.39k|}
aom_highbd_lpf_horizontal_4_dual_avx2:
   39|   169k|    const uint8_t *thresh1, int bd) {
   40|   169k|  aom_highbd_lpf_horizontal_4_dual_sse2(s, p, blimit0, limit0, thresh0, blimit1,
   41|   169k|                                        limit1, thresh1, bd);
   42|   169k|}
aom_highbd_lpf_horizontal_8_dual_avx2:
   47|   102k|    const uint8_t *thresh1, int bd) {
   48|   102k|  aom_highbd_lpf_horizontal_8_dual_sse2(s, p, blimit0, limit0, thresh0, blimit1,
   49|   102k|                                        limit1, thresh1, bd);
   50|   102k|}
aom_highbd_lpf_vertical_4_dual_avx2:
   55|   202k|    const uint8_t *thresh1, int bd) {
   56|   202k|  aom_highbd_lpf_vertical_4_dual_sse2(s, p, blimit0, limit0, thresh0, blimit1,
   57|   202k|                                      limit1, thresh1, bd);
   58|   202k|}
aom_highbd_lpf_vertical_8_dual_avx2:
   63|   105k|    const uint8_t *thresh1, int bd) {
   64|   105k|  aom_highbd_lpf_vertical_8_dual_sse2(s, p, blimit0, limit0, thresh0, blimit1,
   65|   105k|                                      limit1, thresh1, bd);
   66|   105k|}

aom_highbd_lpf_horizontal_14_sse2:
  502|  4.51k|                                       const uint8_t *thresh, int bd) {
  503|  4.51k|  __m128i p[7], q[7], pq[7];
  504|  4.51k|  int i;
  505|       |
  506|  36.0k|  for (i = 0; i < 7; i++) {
  ------------------
  |  Branch (506:15): [True: 31.5k, False: 4.51k]
  ------------------
  507|  31.5k|    p[i] = _mm_loadl_epi64((__m128i *)(s - (i + 1) * pitch));
  508|  31.5k|    q[i] = _mm_loadl_epi64((__m128i *)(s + i * pitch));
  509|  31.5k|  }
  510|       |
  511|  4.51k|  highbd_lpf_internal_14_sse2(p, q, pq, blimit, limit, thresh, bd);
  512|       |
  513|  31.6k|  for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (513:15): [True: 27.1k, False: 4.51k]
  ------------------
  514|  27.1k|    _mm_storel_epi64((__m128i *)(s - (i + 1) * pitch), pq[i]);
  515|       |    _mm_storel_epi64((__m128i *)(s + i * pitch), _mm_srli_si128(pq[i], 8));
  516|  27.1k|  }
  517|  4.51k|}
aom_highbd_lpf_horizontal_14_dual_sse2:
  722|  7.60k|    const uint8_t *_thresh1, int bd) {
  723|  7.60k|  __m128i p[7], q[7];
  724|  7.60k|  int i;
  725|  7.60k|  load_highbd_pixel(s, 7, pitch, p, q);
  726|       |
  727|  7.60k|  highbd_lpf_internal_14_dual_sse2(p, q, _blimit0, _limit0, _thresh0, _blimit1,
  728|  7.60k|                                   _limit1, _thresh1, bd);
  729|       |
  730|  53.1k|  for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (730:15): [True: 45.5k, False: 7.60k]
  ------------------
  731|  45.5k|    _mm_storeu_si128((__m128i *)(s - (i + 1) * pitch), p[i]);
  732|  45.5k|    _mm_storeu_si128((__m128i *)(s + i * pitch), q[i]);
  733|  45.5k|  }
  734|  7.60k|}
aom_highbd_lpf_horizontal_6_sse2:
  952|  88.5k|                                      const uint8_t *_thresh, int bd) {
  953|  88.5k|  __m128i p2, p1, p0, q0, q1, q2, p1p0_out, q1q0_out;
  954|       |
  955|  88.5k|  p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p));
  956|  88.5k|  p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
  957|  88.5k|  p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
  958|  88.5k|  q0 = _mm_loadl_epi64((__m128i *)(s + 0 * p));
  959|  88.5k|  q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
  960|  88.5k|  q2 = _mm_loadl_epi64((__m128i *)(s + 2 * p));
  961|       |
  962|  88.5k|  highbd_lpf_internal_6_sse2(&p2, &p1, &p0, &q0, &q1, &q2, &p1p0_out, &q1q0_out,
  963|  88.5k|                             _blimit, _limit, _thresh, bd);
  964|       |
  965|  88.5k|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(p1p0_out, 8));
  966|  88.5k|  _mm_storel_epi64((__m128i *)(s - 1 * p), p1p0_out);
  967|  88.5k|  _mm_storel_epi64((__m128i *)(s + 0 * p), q1q0_out);
  968|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1q0_out, 8));
  969|  88.5k|}
aom_highbd_lpf_horizontal_6_dual_sse2:
  974|  31.8k|    const uint8_t *_thresh1, int bd) {
  975|  31.8k|  __m128i p2, p1, p0, q0, q1, q2;
  976|       |
  977|  31.8k|  p2 = _mm_loadu_si128((__m128i *)(s - 3 * p));
  978|  31.8k|  p1 = _mm_loadu_si128((__m128i *)(s - 2 * p));
  979|  31.8k|  p0 = _mm_loadu_si128((__m128i *)(s - 1 * p));
  980|  31.8k|  q0 = _mm_loadu_si128((__m128i *)(s + 0 * p));
  981|  31.8k|  q1 = _mm_loadu_si128((__m128i *)(s + 1 * p));
  982|  31.8k|  q2 = _mm_loadu_si128((__m128i *)(s + 2 * p));
  983|       |
  984|  31.8k|  highbd_lpf_internal_6_dual_sse2(&p2, &p1, &p0, &q0, &q1, &q2, _blimit0,
  985|  31.8k|                                  _limit0, _thresh0, _blimit1, _limit1,
  986|  31.8k|                                  _thresh1, bd);
  987|       |
  988|  31.8k|  _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
  989|  31.8k|  _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
  990|  31.8k|  _mm_storeu_si128((__m128i *)(s + 0 * p), q0);
  991|  31.8k|  _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
  992|  31.8k|}
aom_highbd_lpf_horizontal_8_sse2:
 1223|  67.0k|                                      const uint8_t *_thresh, int bd) {
 1224|  67.0k|  __m128i p2, p1, p0, q0, q1, q2, p3, q3;
 1225|  67.0k|  __m128i q1q0, p1p0;
 1226|       |
 1227|  67.0k|  p3 = _mm_loadl_epi64((__m128i *)(s - 4 * p));
 1228|  67.0k|  q3 = _mm_loadl_epi64((__m128i *)(s + 3 * p));
 1229|  67.0k|  p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p));
 1230|  67.0k|  q2 = _mm_loadl_epi64((__m128i *)(s + 2 * p));
 1231|  67.0k|  p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
 1232|  67.0k|  q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
 1233|  67.0k|  p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
 1234|  67.0k|  q0 = _mm_loadl_epi64((__m128i *)(s + 0 * p));
 1235|       |
 1236|  67.0k|  highbd_lpf_internal_8_sse2(&p3, &q3, &p2, &q2, &p1, &q1, &p0, &q0, &q1q0,
 1237|  67.0k|                             &p1p0, _blimit, _limit, _thresh, bd);
 1238|       |
 1239|  67.0k|  _mm_storel_epi64((__m128i *)(s - 3 * p), p2);
 1240|  67.0k|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(p1p0, 8));
 1241|  67.0k|  _mm_storel_epi64((__m128i *)(s - 1 * p), p1p0);
 1242|  67.0k|  _mm_storel_epi64((__m128i *)(s + 0 * p), q1q0);
 1243|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1q0, 8));
 1244|  67.0k|  _mm_storel_epi64((__m128i *)(s + 2 * p), q2);
 1245|  67.0k|}
aom_highbd_lpf_horizontal_8_dual_sse2:
 1250|   102k|    const uint8_t *_thresh1, int bd) {
 1251|   102k|  __m128i p2, p1, p0, q0, q1, q2, p3, q3;
 1252|       |
 1253|   102k|  p3 = _mm_loadu_si128((__m128i *)(s - 4 * p));
 1254|   102k|  q3 = _mm_loadu_si128((__m128i *)(s + 3 * p));
 1255|   102k|  p2 = _mm_loadu_si128((__m128i *)(s - 3 * p));
 1256|   102k|  q2 = _mm_loadu_si128((__m128i *)(s + 2 * p));
 1257|   102k|  p1 = _mm_loadu_si128((__m128i *)(s - 2 * p));
 1258|   102k|  q1 = _mm_loadu_si128((__m128i *)(s + 1 * p));
 1259|   102k|  p0 = _mm_loadu_si128((__m128i *)(s - 1 * p));
 1260|   102k|  q0 = _mm_loadu_si128((__m128i *)(s + 0 * p));
 1261|       |
 1262|   102k|  highbd_lpf_internal_8_dual_sse2(&p3, &q3, &p2, &q2, &p1, &q1, &p0, &q0,
 1263|   102k|                                  _blimit0, _limit0, _thresh0, _blimit1,
 1264|   102k|                                  _limit1, _thresh1, bd);
 1265|       |
 1266|   102k|  _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
 1267|   102k|  _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
 1268|   102k|  _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
 1269|   102k|  _mm_storeu_si128((__m128i *)(s + 0 * p), q0);
 1270|   102k|  _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
 1271|   102k|  _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
 1272|   102k|}
aom_highbd_lpf_horizontal_4_sse2:
 1348|   294k|                                      const uint8_t *_thresh, int bd) {
 1349|   294k|  __m128i p1p0, q1q0;
 1350|   294k|  __m128i p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
 1351|   294k|  __m128i p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
 1352|   294k|  __m128i q0 = _mm_loadl_epi64((__m128i *)(s - 0 * p));
 1353|   294k|  __m128i q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
 1354|       |
 1355|   294k|  highbd_lpf_internal_4_sse2(&p1, &p0, &q0, &q1, &q1q0, &p1p0, _blimit, _limit,
 1356|   294k|                             _thresh, bd);
 1357|       |
 1358|   294k|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(p1p0, 8));
 1359|   294k|  _mm_storel_epi64((__m128i *)(s - 1 * p), p1p0);
 1360|   294k|  _mm_storel_epi64((__m128i *)(s + 0 * p), q1q0);
 1361|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1q0, 8));
 1362|   294k|}
aom_highbd_lpf_horizontal_4_dual_sse2:
 1367|   169k|    const uint8_t *_thresh1, int bd) {
 1368|   169k|  __m128i p1 = _mm_loadu_si128((__m128i *)(s - 2 * p));
 1369|   169k|  __m128i p0 = _mm_loadu_si128((__m128i *)(s - 1 * p));
 1370|   169k|  __m128i q0 = _mm_loadu_si128((__m128i *)(s - 0 * p));
 1371|   169k|  __m128i q1 = _mm_loadu_si128((__m128i *)(s + 1 * p));
 1372|   169k|  __m128i ps[2], qs[2];
 1373|       |
 1374|   169k|  highbd_lpf_internal_4_dual_sse2(&p1, &p0, &q0, &q1, ps, qs, _blimit0, _limit0,
 1375|   169k|                                  _thresh0, _blimit1, _limit1, _thresh1, bd);
 1376|       |
 1377|   169k|  _mm_storeu_si128((__m128i *)(s - 2 * p), ps[1]);
 1378|   169k|  _mm_storeu_si128((__m128i *)(s - 1 * p), ps[0]);
 1379|   169k|  _mm_storeu_si128((__m128i *)(s + 0 * p), qs[0]);
 1380|   169k|  _mm_storeu_si128((__m128i *)(s + 1 * p), qs[1]);
 1381|   169k|}
aom_highbd_lpf_vertical_4_sse2:
 1385|   315k|                                    int bd) {
 1386|   315k|  __m128i x0, x1, x2, x3, d0, d1, d2, d3;
 1387|   315k|  __m128i p1p0, q1q0;
 1388|   315k|  __m128i p1, q1;
 1389|       |
 1390|   315k|  x0 = _mm_loadl_epi64((__m128i *)(s - 2 + 0 * p));
 1391|   315k|  x1 = _mm_loadl_epi64((__m128i *)(s - 2 + 1 * p));
 1392|   315k|  x2 = _mm_loadl_epi64((__m128i *)(s - 2 + 2 * p));
 1393|   315k|  x3 = _mm_loadl_epi64((__m128i *)(s - 2 + 3 * p));
 1394|       |
 1395|   315k|  highbd_transpose4x8_8x4_low_sse2(&x0, &x1, &x2, &x3, &d0, &d1, &d2, &d3);
 1396|       |
 1397|   315k|  highbd_lpf_internal_4_sse2(&d0, &d1, &d2, &d3, &q1q0, &p1p0, blimit, limit,
 1398|   315k|                             thresh, bd);
 1399|       |
 1400|   315k|  p1 = _mm_srli_si128(p1p0, 8);
 1401|   315k|  q1 = _mm_srli_si128(q1q0, 8);
 1402|       |
 1403|       |  // transpose from 8x4 to 4x8
 1404|   315k|  highbd_transpose4x8_8x4_low_sse2(&p1, &p1p0, &q1q0, &q1, &d0, &d1, &d2, &d3);
 1405|       |
 1406|   315k|  _mm_storel_epi64((__m128i *)(s - 2 + 0 * p), d0);
 1407|   315k|  _mm_storel_epi64((__m128i *)(s - 2 + 1 * p), d1);
 1408|   315k|  _mm_storel_epi64((__m128i *)(s - 2 + 2 * p), d2);
 1409|   315k|  _mm_storel_epi64((__m128i *)(s - 2 + 3 * p), d3);
 1410|   315k|}
aom_highbd_lpf_vertical_4_dual_sse2:
 1415|   202k|    const uint8_t *thresh1, int bd) {
 1416|   202k|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1417|   202k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1418|   202k|  __m128i ps[2], qs[2];
 1419|       |
 1420|   202k|  x0 = _mm_loadl_epi64((__m128i *)(s - 2 + 0 * p));
 1421|   202k|  x1 = _mm_loadl_epi64((__m128i *)(s - 2 + 1 * p));
 1422|   202k|  x2 = _mm_loadl_epi64((__m128i *)(s - 2 + 2 * p));
 1423|   202k|  x3 = _mm_loadl_epi64((__m128i *)(s - 2 + 3 * p));
 1424|   202k|  x4 = _mm_loadl_epi64((__m128i *)(s - 2 + 4 * p));
 1425|   202k|  x5 = _mm_loadl_epi64((__m128i *)(s - 2 + 5 * p));
 1426|   202k|  x6 = _mm_loadl_epi64((__m128i *)(s - 2 + 6 * p));
 1427|   202k|  x7 = _mm_loadl_epi64((__m128i *)(s - 2 + 7 * p));
 1428|       |
 1429|   202k|  highbd_transpose8x8_low_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &d0, &d1,
 1430|   202k|                               &d2, &d3);
 1431|       |
 1432|   202k|  highbd_lpf_internal_4_dual_sse2(&d0, &d1, &d2, &d3, ps, qs, blimit0, limit0,
 1433|   202k|                                  thresh0, blimit1, limit1, thresh1, bd);
 1434|       |
 1435|   202k|  highbd_transpose4x8_8x4_sse2(&ps[1], &ps[0], &qs[0], &qs[1], &d0, &d1, &d2,
 1436|   202k|                               &d3, &d4, &d5, &d6, &d7);
 1437|       |
 1438|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 0 * p), d0);
 1439|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 1 * p), d1);
 1440|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 2 * p), d2);
 1441|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 3 * p), d3);
 1442|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 4 * p), d4);
 1443|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 5 * p), d5);
 1444|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 6 * p), d6);
 1445|   202k|  _mm_storel_epi64((__m128i *)(s - 2 + 7 * p), d7);
 1446|   202k|}
aom_highbd_lpf_vertical_6_sse2:
 1450|  42.8k|                                    int bd) {
 1451|  42.8k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1452|  42.8k|  __m128i x3, x2, x1, x0, p0, q0;
 1453|  42.8k|  __m128i p1p0, q1q0;
 1454|       |
 1455|  42.8k|  x3 = _mm_loadu_si128((__m128i *)((s - 3) + 0 * p));
 1456|  42.8k|  x2 = _mm_loadu_si128((__m128i *)((s - 3) + 1 * p));
 1457|  42.8k|  x1 = _mm_loadu_si128((__m128i *)((s - 3) + 2 * p));
 1458|  42.8k|  x0 = _mm_loadu_si128((__m128i *)((s - 3) + 3 * p));
 1459|       |
 1460|  42.8k|  highbd_transpose4x8_8x4_sse2(&x3, &x2, &x1, &x0, &d0, &d1, &d2, &d3, &d4, &d5,
 1461|  42.8k|                               &d6, &d7);
 1462|       |
 1463|  42.8k|  highbd_lpf_internal_6_sse2(&d0, &d1, &d2, &d3, &d4, &d5, &p1p0, &q1q0, blimit,
 1464|  42.8k|                             limit, thresh, bd);
 1465|       |
 1466|  42.8k|  p0 = _mm_srli_si128(p1p0, 8);
 1467|  42.8k|  q0 = _mm_srli_si128(q1q0, 8);
 1468|       |
 1469|  42.8k|  highbd_transpose4x8_8x4_low_sse2(&p0, &p1p0, &q1q0, &q0, &d0, &d1, &d2, &d3);
 1470|       |
 1471|  42.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 0 * p), d0);
 1472|  42.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 1 * p), d1);
 1473|  42.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 2 * p), d2);
 1474|  42.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 3 * p), d3);
 1475|  42.8k|}
aom_highbd_lpf_vertical_6_dual_sse2:
 1480|  34.8k|    const uint8_t *_thresh1, int bd) {
 1481|  34.8k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1482|  34.8k|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1483|  34.8k|  __m128i p0, q0, p1, q1, p2, q2;
 1484|       |
 1485|  34.8k|  x0 = _mm_loadu_si128((__m128i *)((s - 3) + 0 * p));
 1486|  34.8k|  x1 = _mm_loadu_si128((__m128i *)((s - 3) + 1 * p));
 1487|  34.8k|  x2 = _mm_loadu_si128((__m128i *)((s - 3) + 2 * p));
 1488|  34.8k|  x3 = _mm_loadu_si128((__m128i *)((s - 3) + 3 * p));
 1489|  34.8k|  x4 = _mm_loadu_si128((__m128i *)((s - 3) + 4 * p));
 1490|  34.8k|  x5 = _mm_loadu_si128((__m128i *)((s - 3) + 5 * p));
 1491|  34.8k|  x6 = _mm_loadu_si128((__m128i *)((s - 3) + 6 * p));
 1492|  34.8k|  x7 = _mm_loadu_si128((__m128i *)((s - 3) + 7 * p));
 1493|       |
 1494|  34.8k|  highbd_transpose8x8_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &p2, &p1,
 1495|  34.8k|                           &p0, &q0, &q1, &q2, &d6, &d7);
 1496|       |
 1497|  34.8k|  highbd_lpf_internal_6_dual_sse2(&p2, &p1, &p0, &q0, &q1, &q2, _blimit0,
 1498|  34.8k|                                  _limit0, _thresh0, _blimit1, _limit1,
 1499|  34.8k|                                  _thresh1, bd);
 1500|       |
 1501|  34.8k|  highbd_transpose4x8_8x4_sse2(&p1, &p0, &q0, &q1, &d0, &d1, &d2, &d3, &d4, &d5,
 1502|  34.8k|                               &d6, &d7);
 1503|       |
 1504|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 0 * p), d0);
 1505|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 1 * p), d1);
 1506|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 2 * p), d2);
 1507|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 3 * p), d3);
 1508|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 4 * p), d4);
 1509|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 5 * p), d5);
 1510|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 6 * p), d6);
 1511|  34.8k|  _mm_storel_epi64((__m128i *)(s - 2 + 7 * p), d7);
 1512|  34.8k|}
aom_highbd_lpf_vertical_8_sse2:
 1516|  70.3k|                                    int bd) {
 1517|  70.3k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1518|  70.3k|  __m128i p2, p1, p0, p3, q0;
 1519|  70.3k|  __m128i q1q0, p1p0;
 1520|       |
 1521|  70.3k|  p3 = _mm_loadu_si128((__m128i *)((s - 4) + 0 * p));
 1522|  70.3k|  p2 = _mm_loadu_si128((__m128i *)((s - 4) + 1 * p));
 1523|  70.3k|  p1 = _mm_loadu_si128((__m128i *)((s - 4) + 2 * p));
 1524|  70.3k|  p0 = _mm_loadu_si128((__m128i *)((s - 4) + 3 * p));
 1525|       |
 1526|  70.3k|  highbd_transpose4x8_8x4_sse2(&p3, &p2, &p1, &p0, &d0, &d1, &d2, &d3, &d4, &d5,
 1527|  70.3k|                               &d6, &d7);
 1528|       |
 1529|       |  // Loop filtering
 1530|  70.3k|  highbd_lpf_internal_8_sse2(&d0, &d7, &d1, &d6, &d2, &d5, &d3, &d4, &q1q0,
 1531|  70.3k|                             &p1p0, blimit, limit, thresh, bd);
 1532|       |
 1533|  70.3k|  p0 = _mm_srli_si128(p1p0, 8);
 1534|  70.3k|  q0 = _mm_srli_si128(q1q0, 8);
 1535|       |
 1536|  70.3k|  highbd_transpose8x8_low_sse2(&d0, &d1, &p0, &p1p0, &q1q0, &q0, &d6, &d7, &d0,
 1537|  70.3k|                               &d1, &d2, &d3);
 1538|       |
 1539|  70.3k|  _mm_storeu_si128((__m128i *)(s - 4 + 0 * p), d0);
 1540|  70.3k|  _mm_storeu_si128((__m128i *)(s - 4 + 1 * p), d1);
 1541|  70.3k|  _mm_storeu_si128((__m128i *)(s - 4 + 2 * p), d2);
 1542|  70.3k|  _mm_storeu_si128((__m128i *)(s - 4 + 3 * p), d3);
 1543|  70.3k|}
aom_highbd_lpf_vertical_8_dual_sse2:
 1548|   105k|    const uint8_t *thresh1, int bd) {
 1549|   105k|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1550|   105k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1551|       |
 1552|   105k|  x0 = _mm_loadu_si128((__m128i *)(s - 4 + 0 * p));
 1553|   105k|  x1 = _mm_loadu_si128((__m128i *)(s - 4 + 1 * p));
 1554|   105k|  x2 = _mm_loadu_si128((__m128i *)(s - 4 + 2 * p));
 1555|   105k|  x3 = _mm_loadu_si128((__m128i *)(s - 4 + 3 * p));
 1556|   105k|  x4 = _mm_loadu_si128((__m128i *)(s - 4 + 4 * p));
 1557|   105k|  x5 = _mm_loadu_si128((__m128i *)(s - 4 + 5 * p));
 1558|   105k|  x6 = _mm_loadu_si128((__m128i *)(s - 4 + 6 * p));
 1559|   105k|  x7 = _mm_loadu_si128((__m128i *)(s - 4 + 7 * p));
 1560|       |
 1561|   105k|  highbd_transpose8x8_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &d0, &d1,
 1562|   105k|                           &d2, &d3, &d4, &d5, &d6, &d7);
 1563|       |
 1564|   105k|  highbd_lpf_internal_8_dual_sse2(&d0, &d7, &d1, &d6, &d2, &d5, &d3, &d4,
 1565|   105k|                                  blimit0, limit0, thresh0, blimit1, limit1,
 1566|   105k|                                  thresh1, bd);
 1567|       |
 1568|   105k|  highbd_transpose8x8_sse2(&d0, &d1, &d2, &d3, &d4, &d5, &d6, &d7, &x0, &x1,
 1569|   105k|                           &x2, &x3, &x4, &x5, &x6, &x7);
 1570|       |
 1571|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 0 * p), x0);
 1572|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 1 * p), x1);
 1573|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 2 * p), x2);
 1574|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 3 * p), x3);
 1575|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 4 * p), x4);
 1576|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 5 * p), x5);
 1577|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 6 * p), x6);
 1578|   105k|  _mm_storeu_si128((__m128i *)(s - 4 + 7 * p), x7);
 1579|   105k|}
aom_highbd_lpf_vertical_14_sse2:
 1584|  4.49k|                                     const uint8_t *thresh, int bd) {
 1585|  4.49k|  __m128i q[7], p[7], pq[7];
 1586|  4.49k|  __m128i p6, p5, p4, p3;
 1587|  4.49k|  __m128i p6_2, p5_2, p4_2, p3_2;
 1588|  4.49k|  __m128i d0, d1, d2, d3;
 1589|  4.49k|  __m128i d0_2, d1_2, d2_2, d3_2, d7_2;
 1590|       |
 1591|  4.49k|  p6 = _mm_loadu_si128((__m128i *)((s - 8) + 0 * pitch));
 1592|  4.49k|  p5 = _mm_loadu_si128((__m128i *)((s - 8) + 1 * pitch));
 1593|  4.49k|  p4 = _mm_loadu_si128((__m128i *)((s - 8) + 2 * pitch));
 1594|  4.49k|  p3 = _mm_loadu_si128((__m128i *)((s - 8) + 3 * pitch));
 1595|       |
 1596|  4.49k|  highbd_transpose4x8_8x4_sse2(&p6, &p5, &p4, &p3, &d0, &p[6], &p[5], &p[4],
 1597|  4.49k|                               &p[3], &p[2], &p[1], &p[0]);
 1598|       |
 1599|  4.49k|  p6_2 = _mm_loadu_si128((__m128i *)(s + 0 * pitch));
 1600|  4.49k|  p5_2 = _mm_loadu_si128((__m128i *)(s + 1 * pitch));
 1601|  4.49k|  p4_2 = _mm_loadu_si128((__m128i *)(s + 2 * pitch));
 1602|  4.49k|  p3_2 = _mm_loadu_si128((__m128i *)(s + 3 * pitch));
 1603|       |
 1604|  4.49k|  highbd_transpose4x8_8x4_sse2(&p6_2, &p5_2, &p4_2, &p3_2, &q[0], &q[1], &q[2],
 1605|  4.49k|                               &q[3], &q[4], &q[5], &q[6], &d7_2);
 1606|       |
 1607|  4.49k|  highbd_lpf_internal_14_sse2(p, q, pq, blimit, limit, thresh, bd);
 1608|       |
 1609|  4.49k|  highbd_transpose8x8_low_sse2(&d0, &p[6], &pq[5], &pq[4], &pq[3], &pq[2],
 1610|  4.49k|                               &pq[1], &pq[0], &d0, &d1, &d2, &d3);
 1611|       |
 1612|  4.49k|  q[0] = _mm_srli_si128(pq[0], 8);
 1613|  4.49k|  q[1] = _mm_srli_si128(pq[1], 8);
 1614|  4.49k|  q[2] = _mm_srli_si128(pq[2], 8);
 1615|  4.49k|  q[3] = _mm_srli_si128(pq[3], 8);
 1616|  4.49k|  q[4] = _mm_srli_si128(pq[4], 8);
 1617|  4.49k|  q[5] = _mm_srli_si128(pq[5], 8);
 1618|       |
 1619|  4.49k|  highbd_transpose8x8_low_sse2(&q[0], &q[1], &q[2], &q[3], &q[4], &q[5], &q[6],
 1620|  4.49k|                               &d7_2, &d0_2, &d1_2, &d2_2, &d3_2);
 1621|       |
 1622|  4.49k|  _mm_storeu_si128((__m128i *)(s - 8 + 0 * pitch), d0);
 1623|  4.49k|  _mm_storeu_si128((__m128i *)(s + 0 * pitch), d0_2);
 1624|       |
 1625|  4.49k|  _mm_storeu_si128((__m128i *)(s - 8 + 1 * pitch), d1);
 1626|  4.49k|  _mm_storeu_si128((__m128i *)(s + 1 * pitch), d1_2);
 1627|       |
 1628|  4.49k|  _mm_storeu_si128((__m128i *)(s - 8 + 2 * pitch), d2);
 1629|  4.49k|  _mm_storeu_si128((__m128i *)(s + 2 * pitch), d2_2);
 1630|       |
 1631|  4.49k|  _mm_storeu_si128((__m128i *)(s - 8 + 3 * pitch), d3);
 1632|  4.49k|  _mm_storeu_si128((__m128i *)(s + 3 * pitch), d3_2);
 1633|  4.49k|}
aom_highbd_lpf_vertical_14_dual_sse2:
 1638|  7.39k|    const uint8_t *thresh1, int bd) {
 1639|  7.39k|  __m128i q[7], p[7];
 1640|  7.39k|  __m128i p6, p5, p4, p3, p2, p1, p0, q0;
 1641|  7.39k|  __m128i p6_2, p5_2, p4_2, p3_2, p2_2, p1_2, q0_2, p0_2;
 1642|  7.39k|  __m128i d0, d7;
 1643|  7.39k|  __m128i d0_out, d1_out, d2_out, d3_out, d4_out, d5_out, d6_out, d7_out;
 1644|       |
 1645|  7.39k|  p6 = _mm_loadu_si128((__m128i *)((s - 8) + 0 * pitch));
 1646|  7.39k|  p5 = _mm_loadu_si128((__m128i *)((s - 8) + 1 * pitch));
 1647|  7.39k|  p4 = _mm_loadu_si128((__m128i *)((s - 8) + 2 * pitch));
 1648|  7.39k|  p3 = _mm_loadu_si128((__m128i *)((s - 8) + 3 * pitch));
 1649|  7.39k|  p2 = _mm_loadu_si128((__m128i *)((s - 8) + 4 * pitch));
 1650|  7.39k|  p1 = _mm_loadu_si128((__m128i *)((s - 8) + 5 * pitch));
 1651|  7.39k|  p0 = _mm_loadu_si128((__m128i *)((s - 8) + 6 * pitch));
 1652|  7.39k|  q0 = _mm_loadu_si128((__m128i *)((s - 8) + 7 * pitch));
 1653|       |
 1654|  7.39k|  highbd_transpose8x8_sse2(&p6, &p5, &p4, &p3, &p2, &p1, &p0, &q0, &d0, &p[6],
 1655|  7.39k|                           &p[5], &p[4], &p[3], &p[2], &p[1], &p[0]);
 1656|       |
 1657|  7.39k|  p6_2 = _mm_loadu_si128((__m128i *)(s + 0 * pitch));
 1658|  7.39k|  p5_2 = _mm_loadu_si128((__m128i *)(s + 1 * pitch));
 1659|  7.39k|  p4_2 = _mm_loadu_si128((__m128i *)(s + 2 * pitch));
 1660|  7.39k|  p3_2 = _mm_loadu_si128((__m128i *)(s + 3 * pitch));
 1661|  7.39k|  p2_2 = _mm_loadu_si128((__m128i *)(s + 4 * pitch));
 1662|  7.39k|  p1_2 = _mm_loadu_si128((__m128i *)(s + 5 * pitch));
 1663|  7.39k|  p0_2 = _mm_loadu_si128((__m128i *)(s + 6 * pitch));
 1664|  7.39k|  q0_2 = _mm_loadu_si128((__m128i *)(s + 7 * pitch));
 1665|       |
 1666|  7.39k|  highbd_transpose8x8_sse2(&p6_2, &p5_2, &p4_2, &p3_2, &p2_2, &p1_2, &p0_2,
 1667|  7.39k|                           &q0_2, &q[0], &q[1], &q[2], &q[3], &q[4], &q[5],
 1668|  7.39k|                           &q[6], &d7);
 1669|       |
 1670|  7.39k|  highbd_lpf_internal_14_dual_sse2(p, q, blimit0, limit0, thresh0, blimit1,
 1671|  7.39k|                                   limit1, thresh1, bd);
 1672|       |
 1673|  7.39k|  highbd_transpose8x8_sse2(&d0, &p[6], &p[5], &p[4], &p[3], &p[2], &p[1], &p[0],
 1674|  7.39k|                           &d0_out, &d1_out, &d2_out, &d3_out, &d4_out, &d5_out,
 1675|  7.39k|                           &d6_out, &d7_out);
 1676|       |
 1677|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 0 * pitch), d0_out);
 1678|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 1 * pitch), d1_out);
 1679|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 2 * pitch), d2_out);
 1680|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 3 * pitch), d3_out);
 1681|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 4 * pitch), d4_out);
 1682|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 5 * pitch), d5_out);
 1683|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 6 * pitch), d6_out);
 1684|  7.39k|  _mm_storeu_si128((__m128i *)(s - 8 + 7 * pitch), d7_out);
 1685|       |
 1686|  7.39k|  highbd_transpose8x8_sse2(&q[0], &q[1], &q[2], &q[3], &q[4], &q[5], &q[6], &d7,
 1687|  7.39k|                           &d0_out, &d1_out, &d2_out, &d3_out, &d4_out, &d5_out,
 1688|  7.39k|                           &d6_out, &d7_out);
 1689|       |
 1690|  7.39k|  _mm_storeu_si128((__m128i *)(s + 0 * pitch), d0_out);
 1691|  7.39k|  _mm_storeu_si128((__m128i *)(s + 1 * pitch), d1_out);
 1692|  7.39k|  _mm_storeu_si128((__m128i *)(s + 2 * pitch), d2_out);
 1693|  7.39k|  _mm_storeu_si128((__m128i *)(s + 3 * pitch), d3_out);
 1694|  7.39k|  _mm_storeu_si128((__m128i *)(s + 4 * pitch), d4_out);
 1695|  7.39k|  _mm_storeu_si128((__m128i *)(s + 5 * pitch), d5_out);
 1696|  7.39k|  _mm_storeu_si128((__m128i *)(s + 6 * pitch), d6_out);
 1697|  7.39k|  _mm_storeu_si128((__m128i *)(s + 7 * pitch), d7_out);
 1698|  7.39k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_14_sse2:
  328|  9.02k|    const unsigned char *lt, const unsigned char *thr, int bd) {
  329|  9.02k|  int i;
  330|  9.02k|  const __m128i zero = _mm_setzero_si128();
  331|  9.02k|  __m128i blimit, limit, thresh;
  332|  9.02k|  __m128i t80;
  333|  9.02k|  get_limit(blt, lt, thr, bd, &blimit, &limit, &thresh, &t80);
  334|       |
  335|  72.2k|  for (i = 0; i < 7; i++) {
  ------------------
  |  Branch (335:15): [True: 63.1k, False: 9.02k]
  ------------------
  336|  63.1k|    pq[i] = _mm_unpacklo_epi64(p[i], q[i]);
  337|  63.1k|  }
  338|  9.02k|  __m128i mask, hevhev;
  339|  9.02k|  __m128i p1p0, q1q0, abs_p1p0;
  340|       |
  341|  9.02k|  highbd_hev_filter_mask_x_sse2(pq, 4, &p1p0, &q1q0, &abs_p1p0, &limit, &blimit,
  342|  9.02k|                                &thresh, &hevhev, &mask);
  343|       |
  344|  9.02k|  __m128i ps0ps1, qs0qs1;
  345|       |  // filter4
  346|  9.02k|  highbd_filter4_sse2(&p1p0, &q1q0, &hevhev, &mask, &qs0qs1, &ps0ps1, &t80, bd);
  347|       |
  348|  9.02k|  __m128i flat, flat2;
  349|  9.02k|  highbd_flat_mask4_sse2(pq, &flat, &flat2, bd);
  350|       |
  351|  9.02k|  flat = _mm_and_si128(flat, mask);
  352|  9.02k|  flat2 = _mm_and_si128(flat2, flat);
  353|       |
  354|       |  // replicate for the further "merged variables" usage
  355|  9.02k|  flat = _mm_unpacklo_epi64(flat, flat);
  356|  9.02k|  flat2 = _mm_unpacklo_epi64(flat2, flat2);
  357|       |
  358|       |  // flat and wide flat calculations
  359|       |
  360|       |  // if flat ==0 then flat2 is zero as well and we don't need any calc below
  361|       |  // sse4.1 if (0==_mm_test_all_zeros(flat,ff))
  362|  9.02k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (362:7): [True: 1.53k, False: 7.49k]
  ------------------
  363|  1.53k|    __m128i flat_p[3], flat_q[3], flat_pq[3];
  364|  1.53k|    __m128i flat2_p[6], flat2_q[6];
  365|  1.53k|    __m128i flat2_pq[6];
  366|  1.53k|    __m128i sum_p6, sum_p3;
  367|  1.53k|    const __m128i eight = _mm_set1_epi16(8);
  368|  1.53k|    const __m128i four = _mm_set1_epi16(4);
  369|       |
  370|  1.53k|    __m128i work0, work0_0, work0_1, sum_p_0;
  371|  1.53k|    __m128i sum_p = _mm_add_epi16(pq[5], _mm_add_epi16(pq[4], pq[3]));
  372|  1.53k|    __m128i sum_lp = _mm_add_epi16(pq[0], _mm_add_epi16(pq[2], pq[1]));
  373|  1.53k|    sum_p = _mm_add_epi16(sum_p, sum_lp);
  374|       |
  375|  1.53k|    __m128i sum_lq = _mm_srli_si128(sum_lp, 8);
  376|  1.53k|    __m128i sum_q = _mm_srli_si128(sum_p, 8);
  377|       |
  378|  1.53k|    sum_p_0 = _mm_add_epi16(eight, _mm_add_epi16(sum_p, sum_q));
  379|  1.53k|    sum_lp = _mm_add_epi16(four, _mm_add_epi16(sum_lp, sum_lq));
  380|       |
  381|  1.53k|    flat_p[0] = _mm_add_epi16(sum_lp, _mm_add_epi16(pq[3], pq[0]));
  382|  1.53k|    flat_q[0] = _mm_add_epi16(sum_lp, _mm_add_epi16(q[3], q[0]));
  383|       |
  384|  1.53k|    sum_p6 = _mm_add_epi16(pq[6], pq[6]);
  385|  1.53k|    sum_p3 = _mm_add_epi16(pq[3], pq[3]);
  386|       |
  387|  1.53k|    sum_q = _mm_sub_epi16(sum_p_0, pq[5]);
  388|  1.53k|    sum_p = _mm_sub_epi16(sum_p_0, q[5]);
  389|       |
  390|  1.53k|    work0_0 = _mm_add_epi16(_mm_add_epi16(pq[6], pq[0]), pq[1]);
  391|  1.53k|    work0_1 = _mm_add_epi16(sum_p6,
  392|  1.53k|                            _mm_add_epi16(pq[1], _mm_add_epi16(pq[2], pq[0])));
  393|       |
  394|  1.53k|    sum_lq = _mm_sub_epi16(sum_lp, pq[2]);
  395|  1.53k|    sum_lp = _mm_sub_epi16(sum_lp, q[2]);
  396|       |
  397|  1.53k|    work0 = _mm_add_epi16(sum_p3, pq[1]);
  398|  1.53k|    flat_p[1] = _mm_add_epi16(sum_lp, work0);
  399|  1.53k|    flat_q[1] = _mm_add_epi16(sum_lq, _mm_srli_si128(work0, 8));
  400|       |
  401|  1.53k|    flat_pq[0] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[0], flat_q[0]), 3);
  402|  1.53k|    flat_pq[1] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[1], flat_q[1]), 3);
  403|       |
  404|  1.53k|    sum_lp = _mm_sub_epi16(sum_lp, q[1]);
  405|  1.53k|    sum_lq = _mm_sub_epi16(sum_lq, pq[1]);
  406|       |
  407|  1.53k|    sum_p3 = _mm_add_epi16(sum_p3, pq[3]);
  408|  1.53k|    work0 = _mm_add_epi16(sum_p3, pq[2]);
  409|       |
  410|  1.53k|    flat_p[2] = _mm_add_epi16(sum_lp, work0);
  411|  1.53k|    flat_q[2] = _mm_add_epi16(sum_lq, _mm_srli_si128(work0, 8));
  412|  1.53k|    flat_pq[2] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[2], flat_q[2]), 3);
  413|       |
  414|  1.53k|    int flat2_mask =
  415|  1.53k|        (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat2, zero)));
  416|  1.53k|    if (flat2_mask) {
  ------------------
  |  Branch (416:9): [True: 1.32k, False: 203]
  ------------------
  417|  1.32k|      flat2_p[0] = _mm_add_epi16(sum_p_0, _mm_add_epi16(work0_0, q[0]));
  418|  1.32k|      flat2_q[0] = _mm_add_epi16(
  419|  1.32k|          sum_p_0, _mm_add_epi16(_mm_srli_si128(work0_0, 8), pq[0]));
  420|       |
  421|  1.32k|      flat2_p[1] = _mm_add_epi16(sum_p, work0_1);
  422|  1.32k|      flat2_q[1] = _mm_add_epi16(sum_q, _mm_srli_si128(work0_1, 8));
  423|       |
  424|  1.32k|      flat2_pq[0] =
  425|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[0], flat2_q[0]), 4);
  426|  1.32k|      flat2_pq[1] =
  427|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[1], flat2_q[1]), 4);
  428|       |
  429|  1.32k|      sum_p = _mm_sub_epi16(sum_p, q[4]);
  430|  1.32k|      sum_q = _mm_sub_epi16(sum_q, pq[4]);
  431|       |
  432|  1.32k|      sum_p6 = _mm_add_epi16(sum_p6, pq[6]);
  433|  1.32k|      work0 = _mm_add_epi16(sum_p6,
  434|  1.32k|                            _mm_add_epi16(pq[2], _mm_add_epi16(pq[3], pq[1])));
  435|  1.32k|      flat2_p[2] = _mm_add_epi16(sum_p, work0);
  436|  1.32k|      flat2_q[2] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  437|  1.32k|      flat2_pq[2] =
  438|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[2], flat2_q[2]), 4);
  439|       |
  440|  1.32k|      sum_p6 = _mm_add_epi16(sum_p6, pq[6]);
  441|  1.32k|      sum_p = _mm_sub_epi16(sum_p, q[3]);
  442|  1.32k|      sum_q = _mm_sub_epi16(sum_q, pq[3]);
  443|       |
  444|  1.32k|      work0 = _mm_add_epi16(sum_p6,
  445|  1.32k|                            _mm_add_epi16(pq[3], _mm_add_epi16(pq[4], pq[2])));
  446|  1.32k|      flat2_p[3] = _mm_add_epi16(sum_p, work0);
  447|  1.32k|      flat2_q[3] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  448|  1.32k|      flat2_pq[3] =
  449|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[3], flat2_q[3]), 4);
  450|       |
  451|  1.32k|      sum_p6 = _mm_add_epi16(sum_p6, pq[6]);
  452|  1.32k|      sum_p = _mm_sub_epi16(sum_p, q[2]);
  453|  1.32k|      sum_q = _mm_sub_epi16(sum_q, pq[2]);
  454|       |
  455|  1.32k|      work0 = _mm_add_epi16(sum_p6,
  456|  1.32k|                            _mm_add_epi16(pq[4], _mm_add_epi16(pq[5], pq[3])));
  457|  1.32k|      flat2_p[4] = _mm_add_epi16(sum_p, work0);
  458|  1.32k|      flat2_q[4] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  459|  1.32k|      flat2_pq[4] =
  460|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[4], flat2_q[4]), 4);
  461|       |
  462|  1.32k|      sum_p6 = _mm_add_epi16(sum_p6, pq[6]);
  463|  1.32k|      sum_p = _mm_sub_epi16(sum_p, q[1]);
  464|  1.32k|      sum_q = _mm_sub_epi16(sum_q, pq[1]);
  465|       |
  466|  1.32k|      work0 = _mm_add_epi16(sum_p6,
  467|  1.32k|                            _mm_add_epi16(pq[5], _mm_add_epi16(pq[6], pq[4])));
  468|  1.32k|      flat2_p[5] = _mm_add_epi16(sum_p, work0);
  469|  1.32k|      flat2_q[5] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  470|  1.32k|      flat2_pq[5] =
  471|  1.32k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[5], flat2_q[5]), 4);
  472|  1.32k|    }  // flat2
  473|       |       // ~~~~~~~~~~ apply flat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  474|       |    // highbd_filter8
  475|  1.53k|    pq[0] = _mm_unpacklo_epi64(ps0ps1, qs0qs1);
  476|  1.53k|    pq[1] = _mm_unpackhi_epi64(ps0ps1, qs0qs1);
  477|       |
  478|  6.12k|    for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (478:17): [True: 4.59k, False: 1.53k]
  ------------------
  479|  4.59k|      pq[i] = _mm_andnot_si128(flat, pq[i]);
  480|  4.59k|      flat_pq[i] = _mm_and_si128(flat, flat_pq[i]);
  481|  4.59k|      pq[i] = _mm_or_si128(pq[i], flat_pq[i]);
  482|  4.59k|    }
  483|       |
  484|       |    // wide flat
  485|       |    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486|  1.53k|    if (flat2_mask) {
  ------------------
  |  Branch (486:9): [True: 1.32k, False: 205]
  ------------------
  487|  9.28k|      for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (487:19): [True: 7.96k, False: 1.32k]
  ------------------
  488|  7.96k|        pq[i] = _mm_andnot_si128(flat2, pq[i]);
  489|  7.96k|        flat2_pq[i] = _mm_and_si128(flat2, flat2_pq[i]);
  490|  7.96k|        pq[i] = _mm_or_si128(pq[i], flat2_pq[i]);  // full list of pq values
  491|  7.96k|      }
  492|  1.32k|    }
  493|  7.49k|  } else {
  494|  7.49k|    pq[0] = _mm_unpacklo_epi64(ps0ps1, qs0qs1);
  495|  7.49k|    pq[1] = _mm_unpackhi_epi64(ps0ps1, qs0qs1);
  496|  7.49k|  }
  497|  9.02k|}
highbd_loopfilter_sse2.c:get_limit:
   30|   882k|                             __m128i *lt, __m128i *thr, __m128i *t80_out) {
   31|   882k|  const int shift = bd - 8;
   32|   882k|  const __m128i zero = _mm_setzero_si128();
   33|       |
   34|   882k|  __m128i x = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)bl), zero);
   35|   882k|  *blt = _mm_slli_epi16(x, shift);
   36|       |
   37|   882k|  x = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)l), zero);
   38|   882k|  *lt = _mm_slli_epi16(x, shift);
   39|       |
   40|   882k|  x = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)t), zero);
   41|   882k|  *thr = _mm_slli_epi16(x, shift);
   42|       |
   43|   882k|  *t80_out = _mm_set1_epi16(1 << (bd - 1));
   44|   882k|}
highbd_loopfilter_sse2.c:highbd_hev_filter_mask_x_sse2:
  112|   882k|                                                 __m128i *hev, __m128i *mask) {
  113|   882k|  const __m128i zero = _mm_setzero_si128();
  114|   882k|  const __m128i one = _mm_set1_epi16(1);
  115|   882k|  const __m128i ffff = _mm_set1_epi16((short)0xFFFF);
  116|   882k|  __m128i abs_p0q0_p1q1, abs_p0q0, abs_p1q1, abs_q1q0;
  117|   882k|  __m128i max, max01, h;
  118|       |
  119|   882k|  *p1p0 = _mm_unpacklo_epi64(pq[0], pq[1]);
  120|   882k|  *q1q0 = _mm_unpackhi_epi64(pq[0], pq[1]);
  121|       |
  122|   882k|  abs_p0q0_p1q1 = abs_diff16(*p1p0, *q1q0);
  123|   882k|  abs_p0q0 = _mm_adds_epu16(abs_p0q0_p1q1, abs_p0q0_p1q1);
  124|   882k|  abs_p0q0 = _mm_unpacklo_epi64(abs_p0q0, zero);
  125|       |
  126|   882k|  abs_p1q1 = _mm_srli_si128(abs_p0q0_p1q1, 8);
  127|   882k|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1);  // divide by 2
  128|       |
  129|   882k|  max = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), *bl);
  130|   882k|  max = _mm_xor_si128(_mm_cmpeq_epi16(max, zero), ffff);
  131|       |  // mask |= (abs(*p0 - *q0) * 2 + abs(*p1 - *q1) / 2  > blimit) * -1;
  132|       |  // So taking maximums continues to work:
  133|   882k|  max = _mm_and_si128(max, _mm_adds_epu16(*l, one));
  134|       |
  135|   882k|  *abs_p1p0 = abs_diff16(pq[0], pq[1]);
  136|   882k|  abs_q1q0 = _mm_srli_si128(*abs_p1p0, 8);
  137|   882k|  max01 = _mm_max_epi16(*abs_p1p0, abs_q1q0);
  138|       |  // mask |= (abs(*p1 - *p0) > limit) * -1;
  139|       |  // mask |= (abs(*q1 - *q0) > limit) * -1;
  140|   882k|  h = _mm_subs_epu16(max01, *t);
  141|       |
  142|   882k|  *hev = _mm_xor_si128(_mm_cmpeq_epi16(h, zero), ffff);
  143|       |  // replicate for the further "merged variables" usage
  144|   882k|  *hev = _mm_unpacklo_epi64(*hev, *hev);
  145|       |
  146|   882k|  max = _mm_max_epi16(max, max01);
  147|   882k|  int i;
  148|  1.30M|  for (i = 2; i < x; ++i) {
  ------------------
  |  Branch (148:15): [True: 422k, False: 882k]
  ------------------
  149|   422k|    max = _mm_max_epi16(max, abs_diff16(pq[i], pq[i - 1]));
  150|   422k|  }
  151|   882k|  max = _mm_max_epi16(max, _mm_srli_si128(max, 8));
  152|       |
  153|   882k|  max = _mm_subs_epu16(max, *l);
  154|   882k|  *mask = _mm_cmpeq_epi16(max, zero);  //  ~mask
  155|   882k|}
highbd_loopfilter_sse2.c:abs_diff16:
   24|  8.74M|static AOM_FORCE_INLINE __m128i abs_diff16(__m128i a, __m128i b) {
   25|  8.74M|  return _mm_or_si128(_mm_subs_epu16(a, b), _mm_subs_epu16(b, a));
   26|  8.74M|}
highbd_loopfilter_sse2.c:highbd_filter4_sse2:
  217|   882k|                                                 int bd) {
  218|   882k|  const __m128i zero = _mm_setzero_si128();
  219|   882k|  const __m128i one = _mm_set1_epi16(1);
  220|   882k|  const __m128i pmax =
  221|   882k|      _mm_subs_epi16(_mm_subs_epi16(_mm_slli_epi16(one, bd), one), *t80);
  222|   882k|  const __m128i pmin = _mm_subs_epi16(zero, *t80);
  223|       |
  224|   882k|  const __m128i t3t4 = _mm_set_epi16(3, 3, 3, 3, 4, 4, 4, 4);
  225|   882k|  __m128i ps1ps0_work, qs1qs0_work, work;
  226|   882k|  __m128i filt, filter2filter1, filter2filt, filter1filt;
  227|       |
  228|   882k|  ps1ps0_work = _mm_subs_epi16(*p1p0, *t80);
  229|   882k|  qs1qs0_work = _mm_subs_epi16(*q1q0, *t80);
  230|       |
  231|   882k|  work = _mm_subs_epi16(ps1ps0_work, qs1qs0_work);
  232|   882k|  pixel_clamp(&pmin, &pmax, &work);
  233|   882k|  filt = _mm_and_si128(_mm_srli_si128(work, 8), *hev);
  234|       |
  235|   882k|  filt = _mm_subs_epi16(filt, work);
  236|   882k|  filt = _mm_subs_epi16(filt, work);
  237|   882k|  filt = _mm_subs_epi16(filt, work);
  238|       |  // (aom_filter + 3 * (qs0 - ps0)) & mask
  239|   882k|  pixel_clamp(&pmin, &pmax, &filt);
  240|   882k|  filt = _mm_and_si128(filt, *mask);
  241|   882k|  filt = _mm_unpacklo_epi64(filt, filt);
  242|       |
  243|   882k|  filter2filter1 = _mm_adds_epi16(filt, t3t4); /* signed_short_clamp */
  244|   882k|  pixel_clamp(&pmin, &pmax, &filter2filter1);
  245|   882k|  filter2filter1 = _mm_srai_epi16(filter2filter1, 3); /* >> 3 */
  246|       |
  247|   882k|  filt = _mm_unpacklo_epi64(filter2filter1, filter2filter1);
  248|       |
  249|       |  // filt >> 1
  250|   882k|  filt = _mm_adds_epi16(filt, one);
  251|   882k|  filt = _mm_srai_epi16(filt, 1);
  252|   882k|  filt = _mm_andnot_si128(*hev, filt);
  253|       |
  254|   882k|  filter2filt = _mm_unpackhi_epi64(filter2filter1, filt);
  255|   882k|  filter1filt = _mm_unpacklo_epi64(filter2filter1, filt);
  256|       |
  257|   882k|  qs1qs0_work = _mm_subs_epi16(qs1qs0_work, filter1filt);
  258|   882k|  ps1ps0_work = _mm_adds_epi16(ps1ps0_work, filter2filt);
  259|       |
  260|   882k|  pixel_clamp(&pmin, &pmax, &qs1qs0_work);
  261|   882k|  pixel_clamp(&pmin, &pmax, &ps1ps0_work);
  262|       |
  263|   882k|  *qs1qs0 = _mm_adds_epi16(qs1qs0_work, *t80);
  264|   882k|  *ps1ps0 = _mm_adds_epi16(ps1ps0_work, *t80);
  265|   882k|}
highbd_loopfilter_sse2.c:pixel_clamp:
   19|  9.66M|                                         __m128i *pixel) {
   20|  9.66M|  *pixel = _mm_min_epi16(*pixel, *max);
   21|  9.66M|  *pixel = _mm_max_epi16(*pixel, *min);
   22|  9.66M|}
highbd_loopfilter_sse2.c:highbd_flat_mask4_sse2:
  195|  9.02k|                                          __m128i *flat2, int bd) {
  196|       |  // check the distance 1,2,3 against 0
  197|  9.02k|  __m128i th = _mm_set1_epi16(1);
  198|  9.02k|  th = _mm_slli_epi16(th, bd - 8);
  199|  9.02k|  flat_mask_internal(&th, pq, 1, 4, flat);
  200|  9.02k|  flat_mask_internal(&th, pq, 4, 7, flat2);
  201|  9.02k|}
highbd_loopfilter_sse2.c:flat_mask_internal:
  158|  18.0k|                                      int start, int end, __m128i *flat) {
  159|  18.0k|  int i;
  160|  18.0k|  __m128i max = _mm_max_epi16(abs_diff16(pq[start], pq[0]),
  161|  18.0k|                              abs_diff16(pq[start + 1], pq[0]));
  162|       |
  163|  36.0k|  for (i = start + 2; i < end; ++i) {
  ------------------
  |  Branch (163:23): [True: 18.0k, False: 18.0k]
  ------------------
  164|  18.0k|    max = _mm_max_epi16(max, abs_diff16(pq[i], pq[0]));
  165|  18.0k|  }
  166|  18.0k|  max = _mm_max_epi16(max, _mm_srli_si128(max, 8));
  167|       |
  168|  18.0k|  __m128i ft;
  169|  18.0k|  ft = _mm_subs_epu16(max, *th);
  170|       |
  171|  18.0k|  const __m128i zero = _mm_setzero_si128();
  172|  18.0k|  *flat = _mm_cmpeq_epi16(ft, zero);
  173|  18.0k|}
highbd_loopfilter_sse2.c:load_highbd_pixel:
   75|  7.60k|                                     __m128i *p, __m128i *q) {
   76|  7.60k|  int i;
   77|  60.7k|  for (i = 0; i < size; i++) {
  ------------------
  |  Branch (77:15): [True: 53.1k, False: 7.60k]
  ------------------
   78|  53.1k|    p[i] = _mm_loadu_si128((__m128i *)(s - (i + 1) * pitch));
   79|  53.1k|    q[i] = _mm_loadu_si128((__m128i *)(s + i * pitch));
   80|  53.1k|  }
   81|  7.60k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_14_dual_sse2:
  522|  15.0k|    const uint8_t *thr1, int bd) {
  523|  15.0k|  __m128i blimit, limit, thresh, t80;
  524|  15.0k|  const __m128i zero = _mm_setzero_si128();
  525|       |
  526|  15.0k|  get_limit_dual(blt0, lt0, thr0, blt1, lt1, thr1, bd, &blimit, &limit, &thresh,
  527|  15.0k|                 &t80);
  528|  15.0k|  __m128i mask;
  529|  15.0k|  highbd_filter_mask_dual(p, q, &limit, &blimit, &mask);
  530|  15.0k|  __m128i flat, flat2;
  531|  15.0k|  highbd_flat_mask4_dual_sse2(p, q, &flat, &flat2, bd);
  532|       |
  533|  15.0k|  flat = _mm_and_si128(flat, mask);
  534|  15.0k|  flat2 = _mm_and_si128(flat2, flat);
  535|  15.0k|  __m128i ps[2], qs[2];
  536|  15.0k|  highbd_filter4_dual_sse2(p, q, ps, qs, &mask, &thresh, bd, &t80);
  537|       |  // flat and wide flat calculations
  538|       |
  539|       |  // if flat ==0 then flat2 is zero as well and we don't need any calc below
  540|       |  // sse4.1 if (0==_mm_test_all_zeros(flat,ff))
  541|  15.0k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (541:7): [True: 2.40k, False: 12.6k]
  ------------------
  542|  2.40k|    __m128i flat_p[3], flat_q[3];
  543|  2.40k|    __m128i flat2_p[6], flat2_q[6];
  544|  2.40k|    const __m128i eight = _mm_set1_epi16(8);
  545|  2.40k|    const __m128i four = _mm_set1_epi16(4);
  546|  2.40k|    __m128i sum_p_0 = _mm_add_epi16(p[5], _mm_add_epi16(p[4], p[3]));
  547|  2.40k|    __m128i sum_q = _mm_add_epi16(q[5], _mm_add_epi16(q[4], q[3]));
  548|  2.40k|    __m128i sum_lp = _mm_add_epi16(p[0], _mm_add_epi16(p[2], p[1]));
  549|  2.40k|    sum_p_0 = _mm_add_epi16(sum_p_0, sum_lp);
  550|  2.40k|    __m128i sum_lq = _mm_add_epi16(q[0], _mm_add_epi16(q[2], q[1]));
  551|  2.40k|    sum_q = _mm_add_epi16(sum_q, sum_lq);
  552|  2.40k|    sum_p_0 = _mm_add_epi16(eight, _mm_add_epi16(sum_p_0, sum_q));
  553|  2.40k|    sum_lp = _mm_add_epi16(four, _mm_add_epi16(sum_lp, sum_lq));
  554|  2.40k|    flat_p[0] =
  555|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lp, _mm_add_epi16(p[3], p[0])), 3);
  556|  2.40k|    flat_q[0] =
  557|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lp, _mm_add_epi16(q[3], q[0])), 3);
  558|  2.40k|    __m128i sum_p6 = _mm_add_epi16(p[6], p[6]);
  559|  2.40k|    __m128i sum_q6 = _mm_add_epi16(q[6], q[6]);
  560|  2.40k|    __m128i sum_p3 = _mm_add_epi16(p[3], p[3]);
  561|  2.40k|    __m128i sum_q3 = _mm_add_epi16(q[3], q[3]);
  562|       |
  563|  2.40k|    sum_q = _mm_sub_epi16(sum_p_0, p[5]);
  564|  2.40k|    __m128i sum_p = _mm_sub_epi16(sum_p_0, q[5]);
  565|       |
  566|  2.40k|    sum_lq = _mm_sub_epi16(sum_lp, p[2]);
  567|  2.40k|    sum_lp = _mm_sub_epi16(sum_lp, q[2]);
  568|  2.40k|    flat_p[1] =
  569|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lp, _mm_add_epi16(sum_p3, p[1])), 3);
  570|  2.40k|    flat_q[1] =
  571|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lq, _mm_add_epi16(sum_q3, q[1])), 3);
  572|       |
  573|  2.40k|    sum_lp = _mm_sub_epi16(sum_lp, q[1]);
  574|  2.40k|    sum_lq = _mm_sub_epi16(sum_lq, p[1]);
  575|  2.40k|    sum_p3 = _mm_add_epi16(sum_p3, p[3]);
  576|  2.40k|    sum_q3 = _mm_add_epi16(sum_q3, q[3]);
  577|  2.40k|    flat_p[2] =
  578|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lp, _mm_add_epi16(sum_p3, p[2])), 3);
  579|  2.40k|    flat_q[2] =
  580|  2.40k|        _mm_srli_epi16(_mm_add_epi16(sum_lq, _mm_add_epi16(sum_q3, q[2])), 3);
  581|       |
  582|  2.40k|    int flat2_mask =
  583|  2.40k|        (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat2, zero)));
  584|  2.40k|    if (flat2_mask) {
  ------------------
  |  Branch (584:9): [True: 2.01k, False: 386]
  ------------------
  585|  2.01k|      flat2_p[0] = _mm_srli_epi16(
  586|  2.01k|          _mm_add_epi16(sum_p_0, _mm_add_epi16(_mm_add_epi16(p[6], p[0]),
  587|  2.01k|                                               _mm_add_epi16(p[1], q[0]))),
  588|  2.01k|          4);
  589|  2.01k|      flat2_q[0] = _mm_srli_epi16(
  590|  2.01k|          _mm_add_epi16(sum_p_0, _mm_add_epi16(_mm_add_epi16(q[6], q[0]),
  591|  2.01k|                                               _mm_add_epi16(p[0], q[1]))),
  592|  2.01k|          4);
  593|       |
  594|  2.01k|      flat2_p[1] = _mm_srli_epi16(
  595|  2.01k|          _mm_add_epi16(
  596|  2.01k|              sum_p,
  597|  2.01k|              _mm_add_epi16(sum_p6,
  598|  2.01k|                            _mm_add_epi16(p[1], _mm_add_epi16(p[2], p[0])))),
  599|  2.01k|          4);
  600|  2.01k|      flat2_q[1] = _mm_srli_epi16(
  601|  2.01k|          _mm_add_epi16(
  602|  2.01k|              sum_q,
  603|  2.01k|              _mm_add_epi16(sum_q6,
  604|  2.01k|                            _mm_add_epi16(q[1], _mm_add_epi16(q[0], q[2])))),
  605|  2.01k|          4);
  606|  2.01k|      sum_p6 = _mm_add_epi16(sum_p6, p[6]);
  607|  2.01k|      sum_q6 = _mm_add_epi16(sum_q6, q[6]);
  608|  2.01k|      sum_p = _mm_sub_epi16(sum_p, q[4]);
  609|  2.01k|      sum_q = _mm_sub_epi16(sum_q, p[4]);
  610|  2.01k|      flat2_p[2] = _mm_srli_epi16(
  611|  2.01k|          _mm_add_epi16(
  612|  2.01k|              sum_p,
  613|  2.01k|              _mm_add_epi16(sum_p6,
  614|  2.01k|                            _mm_add_epi16(p[2], _mm_add_epi16(p[3], p[1])))),
  615|  2.01k|          4);
  616|  2.01k|      flat2_q[2] = _mm_srli_epi16(
  617|  2.01k|          _mm_add_epi16(
  618|  2.01k|              sum_q,
  619|  2.01k|              _mm_add_epi16(sum_q6,
  620|  2.01k|                            _mm_add_epi16(q[2], _mm_add_epi16(q[1], q[3])))),
  621|  2.01k|          4);
  622|  2.01k|      sum_p6 = _mm_add_epi16(sum_p6, p[6]);
  623|  2.01k|      sum_q6 = _mm_add_epi16(sum_q6, q[6]);
  624|  2.01k|      sum_p = _mm_sub_epi16(sum_p, q[3]);
  625|  2.01k|      sum_q = _mm_sub_epi16(sum_q, p[3]);
  626|  2.01k|      flat2_p[3] = _mm_srli_epi16(
  627|  2.01k|          _mm_add_epi16(
  628|  2.01k|              sum_p,
  629|  2.01k|              _mm_add_epi16(sum_p6,
  630|  2.01k|                            _mm_add_epi16(p[3], _mm_add_epi16(p[4], p[2])))),
  631|  2.01k|          4);
  632|  2.01k|      flat2_q[3] = _mm_srli_epi16(
  633|  2.01k|          _mm_add_epi16(
  634|  2.01k|              sum_q,
  635|  2.01k|              _mm_add_epi16(sum_q6,
  636|  2.01k|                            _mm_add_epi16(q[3], _mm_add_epi16(q[2], q[4])))),
  637|  2.01k|          4);
  638|  2.01k|      sum_p6 = _mm_add_epi16(sum_p6, p[6]);
  639|  2.01k|      sum_q6 = _mm_add_epi16(sum_q6, q[6]);
  640|  2.01k|      sum_p = _mm_sub_epi16(sum_p, q[2]);
  641|  2.01k|      sum_q = _mm_sub_epi16(sum_q, p[2]);
  642|  2.01k|      flat2_p[4] = _mm_srli_epi16(
  643|  2.01k|          _mm_add_epi16(
  644|  2.01k|              sum_p,
  645|  2.01k|              _mm_add_epi16(sum_p6,
  646|  2.01k|                            _mm_add_epi16(p[4], _mm_add_epi16(p[5], p[3])))),
  647|  2.01k|          4);
  648|  2.01k|      flat2_q[4] = _mm_srli_epi16(
  649|  2.01k|          _mm_add_epi16(
  650|  2.01k|              sum_q,
  651|  2.01k|              _mm_add_epi16(sum_q6,
  652|  2.01k|                            _mm_add_epi16(q[4], _mm_add_epi16(q[3], q[5])))),
  653|  2.01k|          4);
  654|  2.01k|      sum_p6 = _mm_add_epi16(sum_p6, p[6]);
  655|  2.01k|      sum_q6 = _mm_add_epi16(sum_q6, q[6]);
  656|  2.01k|      sum_p = _mm_sub_epi16(sum_p, q[1]);
  657|  2.01k|      sum_q = _mm_sub_epi16(sum_q, p[1]);
  658|  2.01k|      flat2_p[5] = _mm_srli_epi16(
  659|  2.01k|          _mm_add_epi16(
  660|  2.01k|              sum_p,
  661|  2.01k|              _mm_add_epi16(sum_p6,
  662|  2.01k|                            _mm_add_epi16(p[5], _mm_add_epi16(p[6], p[4])))),
  663|  2.01k|          4);
  664|  2.01k|      flat2_q[5] = _mm_srli_epi16(
  665|  2.01k|          _mm_add_epi16(
  666|  2.01k|              sum_q,
  667|  2.01k|              _mm_add_epi16(sum_q6,
  668|  2.01k|                            _mm_add_epi16(q[5], _mm_add_epi16(q[4], q[6])))),
  669|  2.01k|          4);
  670|  2.01k|    }
  671|       |    // highbd_filter8
  672|  2.40k|    int i;
  673|  7.21k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (673:17): [True: 4.81k, False: 2.40k]
  ------------------
  674|  4.81k|      ps[i] = _mm_andnot_si128(flat, ps[i]);
  675|  4.81k|      flat_p[i] = _mm_and_si128(flat, flat_p[i]);
  676|  4.81k|      p[i] = _mm_or_si128(ps[i], flat_p[i]);
  677|  4.81k|      qs[i] = _mm_andnot_si128(flat, qs[i]);
  678|  4.81k|      flat_q[i] = _mm_and_si128(flat, flat_q[i]);
  679|  4.81k|      q[i] = _mm_or_si128(qs[i], flat_q[i]);
  680|  4.81k|    }
  681|  2.40k|    p[2] = _mm_andnot_si128(flat, p[2]);
  682|       |    //  p2 remains unchanged if !(flat && mask)
  683|  2.40k|    flat_p[2] = _mm_and_si128(flat, flat_p[2]);
  684|       |    //  when (flat && mask)
  685|  2.40k|    p[2] = _mm_or_si128(p[2], flat_p[2]);  // full list of p2 values
  686|  2.40k|    q[2] = _mm_andnot_si128(flat, q[2]);
  687|  2.40k|    flat_q[2] = _mm_and_si128(flat, flat_q[2]);
  688|  2.40k|    q[2] = _mm_or_si128(q[2], flat_q[2]);  // full list of q2 values
  689|       |
  690|  7.21k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (690:17): [True: 4.81k, False: 2.40k]
  ------------------
  691|  4.81k|      ps[i] = _mm_andnot_si128(flat, ps[i]);
  692|  4.81k|      flat_p[i] = _mm_and_si128(flat, flat_p[i]);
  693|  4.81k|      p[i] = _mm_or_si128(ps[i], flat_p[i]);
  694|  4.81k|      qs[i] = _mm_andnot_si128(flat, qs[i]);
  695|  4.81k|      flat_q[i] = _mm_and_si128(flat, flat_q[i]);
  696|  4.81k|      q[i] = _mm_or_si128(qs[i], flat_q[i]);
  697|  4.81k|    }
  698|       |    // highbd_filter16
  699|  2.40k|    if (flat2_mask) {
  ------------------
  |  Branch (699:9): [True: 2.01k, False: 386]
  ------------------
  700|  14.1k|      for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (700:19): [True: 12.1k, False: 2.01k]
  ------------------
  701|       |        //  p[i] remains unchanged if !(flat2 && flat && mask)
  702|  12.1k|        p[i] = _mm_andnot_si128(flat2, p[i]);
  703|  12.1k|        flat2_p[i] = _mm_and_si128(flat2, flat2_p[i]);
  704|       |        //  get values for when (flat2 && flat && mask)
  705|  12.1k|        p[i] = _mm_or_si128(p[i], flat2_p[i]);  // full list of p values
  706|  12.1k|        q[i] = _mm_andnot_si128(flat2, q[i]);
  707|  12.1k|        flat2_q[i] = _mm_and_si128(flat2, flat2_q[i]);
  708|  12.1k|        q[i] = _mm_or_si128(q[i], flat2_q[i]);
  709|  12.1k|      }
  710|  2.01k|    }
  711|  12.6k|  } else {
  712|  12.6k|    p[0] = ps[0];
  713|  12.6k|    q[0] = qs[0];
  714|  12.6k|    p[1] = ps[1];
  715|  12.6k|    q[1] = qs[1];
  716|  12.6k|  }
  717|  15.0k|}
highbd_loopfilter_sse2.c:get_limit_dual:
   50|   659k|    __m128i *t80_out) {
   51|   659k|  const int shift = bd - 8;
   52|   659k|  const __m128i zero = _mm_setzero_si128();
   53|       |
   54|   659k|  __m128i x0 =
   55|   659k|      _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit0), zero);
   56|   659k|  __m128i x1 =
   57|   659k|      _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_blimit1), zero);
   58|   659k|  x0 = _mm_unpacklo_epi64(x0, x1);
   59|   659k|  *blt_out = _mm_slli_epi16(x0, shift);
   60|       |
   61|   659k|  x0 = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit0), zero);
   62|   659k|  x1 = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_limit1), zero);
   63|   659k|  x0 = _mm_unpacklo_epi64(x0, x1);
   64|   659k|  *lt_out = _mm_slli_epi16(x0, shift);
   65|       |
   66|   659k|  x0 = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh0), zero);
   67|   659k|  x1 = _mm_unpacklo_epi8(_mm_load_si128((const __m128i *)_thresh1), zero);
   68|   659k|  x0 = _mm_unpacklo_epi64(x0, x1);
   69|   659k|  *thr_out = _mm_slli_epi16(x0, shift);
   70|       |
   71|   659k|  *t80_out = _mm_set1_epi16(1 << (bd - 1));
   72|   659k|}
highbd_loopfilter_sse2.c:highbd_filter_mask_dual:
   85|  15.0k|                                           __m128i *mask) {
   86|  15.0k|  __m128i abs_p0q0 = abs_diff16(p[0], q[0]);
   87|  15.0k|  __m128i abs_p1q1 = abs_diff16(p[1], q[1]);
   88|  15.0k|  abs_p0q0 = _mm_adds_epu16(abs_p0q0, abs_p0q0);
   89|  15.0k|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1);
   90|       |
   91|  15.0k|  const __m128i zero = _mm_setzero_si128();
   92|  15.0k|  const __m128i one = _mm_set1_epi16(1);
   93|  15.0k|  const __m128i ffff = _mm_set1_epi16((short)0xFFFF);
   94|       |
   95|  15.0k|  __m128i max = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), *bl);
   96|  15.0k|  max = _mm_xor_si128(_mm_cmpeq_epi16(max, zero), ffff);
   97|  15.0k|  max = _mm_and_si128(max, _mm_adds_epu16(*l, one));
   98|       |
   99|  15.0k|  int i;
  100|  60.0k|  for (i = 1; i < 4; ++i) {
  ------------------
  |  Branch (100:15): [True: 45.0k, False: 15.0k]
  ------------------
  101|  45.0k|    max = _mm_max_epi16(max, abs_diff16(p[i], p[i - 1]));
  102|  45.0k|    max = _mm_max_epi16(max, abs_diff16(q[i], q[i - 1]));
  103|  45.0k|  }
  104|  15.0k|  max = _mm_subs_epu16(max, *l);
  105|  15.0k|  *mask = _mm_cmpeq_epi16(max, zero);  // return ~mask
  106|  15.0k|}
highbd_loopfilter_sse2.c:highbd_flat_mask4_dual_sse2:
  205|  15.0k|                                               __m128i *flat2, int bd) {
  206|       |  // check the distance 1,2,3 against 0
  207|  15.0k|  __m128i th = _mm_set1_epi16(1);
  208|  15.0k|  th = _mm_slli_epi16(th, bd - 8);
  209|  15.0k|  flat_mask_internal_dual(&th, p, q, 1, 4, flat);
  210|  15.0k|  flat_mask_internal_dual(&th, p, q, 4, 7, flat2);
  211|  15.0k|}
highbd_loopfilter_sse2.c:flat_mask_internal_dual:
  177|  30.0k|                                           __m128i *flat) {
  178|  30.0k|  int i;
  179|  30.0k|  __m128i max =
  180|  30.0k|      _mm_max_epi16(abs_diff16(q[start], q[0]), abs_diff16(p[start], p[0]));
  181|       |
  182|  90.0k|  for (i = start + 1; i < end; ++i) {
  ------------------
  |  Branch (182:23): [True: 60.0k, False: 30.0k]
  ------------------
  183|  60.0k|    max = _mm_max_epi16(max, abs_diff16(p[i], p[0]));
  184|  60.0k|    max = _mm_max_epi16(max, abs_diff16(q[i], q[0]));
  185|  60.0k|  }
  186|       |
  187|  30.0k|  __m128i ft;
  188|  30.0k|  ft = _mm_subs_epu16(max, *th);
  189|       |
  190|  30.0k|  const __m128i zero = _mm_setzero_si128();
  191|  30.0k|  *flat = _mm_cmpeq_epi16(ft, zero);
  192|  30.0k|}
highbd_loopfilter_sse2.c:highbd_filter4_dual_sse2:
  270|   659k|                                            __m128i *t80) {
  271|   659k|  __m128i ps0 = _mm_subs_epi16(p[0], *t80);
  272|   659k|  __m128i ps1 = _mm_subs_epi16(p[1], *t80);
  273|   659k|  __m128i qs0 = _mm_subs_epi16(q[0], *t80);
  274|   659k|  __m128i qs1 = _mm_subs_epi16(q[1], *t80);
  275|   659k|  const __m128i one = _mm_set1_epi16(1);
  276|   659k|  const __m128i pmax =
  277|   659k|      _mm_subs_epi16(_mm_subs_epi16(_mm_slli_epi16(one, bd), one), *t80);
  278|       |
  279|   659k|  const __m128i zero = _mm_setzero_si128();
  280|   659k|  const __m128i pmin = _mm_subs_epi16(zero, *t80);
  281|   659k|  __m128i filter = _mm_subs_epi16(ps1, qs1);
  282|   659k|  pixel_clamp(&pmin, &pmax, &filter);
  283|       |
  284|       |  // hev_filter
  285|   659k|  __m128i hev;
  286|   659k|  const __m128i abs_p1p0 = abs_diff16(p[1], p[0]);
  287|   659k|  const __m128i abs_q1q0 = abs_diff16(q[1], q[0]);
  288|   659k|  __m128i h = _mm_max_epi16(abs_p1p0, abs_q1q0);
  289|   659k|  h = _mm_subs_epu16(h, *th);
  290|   659k|  const __m128i ffff = _mm_cmpeq_epi16(h, h);
  291|   659k|  hev = _mm_xor_si128(_mm_cmpeq_epi16(h, zero), ffff);
  292|       |
  293|   659k|  filter = _mm_and_si128(filter, hev);
  294|       |
  295|   659k|  const __m128i x = _mm_subs_epi16(qs0, ps0);
  296|   659k|  filter = _mm_adds_epi16(filter, x);
  297|   659k|  filter = _mm_adds_epi16(filter, x);
  298|   659k|  filter = _mm_adds_epi16(filter, x);
  299|   659k|  pixel_clamp(&pmin, &pmax, &filter);
  300|   659k|  filter = _mm_and_si128(filter, *mask);
  301|   659k|  const __m128i t3 = _mm_set1_epi16(3);
  302|   659k|  const __m128i t4 = _mm_set1_epi16(4);
  303|   659k|  __m128i filter1 = _mm_adds_epi16(filter, t4);
  304|   659k|  __m128i filter2 = _mm_adds_epi16(filter, t3);
  305|   659k|  pixel_clamp(&pmin, &pmax, &filter1);
  306|   659k|  pixel_clamp(&pmin, &pmax, &filter2);
  307|   659k|  filter1 = _mm_srai_epi16(filter1, 3);
  308|   659k|  filter2 = _mm_srai_epi16(filter2, 3);
  309|   659k|  qs0 = _mm_subs_epi16(qs0, filter1);
  310|   659k|  pixel_clamp(&pmin, &pmax, &qs0);
  311|   659k|  ps0 = _mm_adds_epi16(ps0, filter2);
  312|   659k|  pixel_clamp(&pmin, &pmax, &ps0);
  313|   659k|  qs[0] = _mm_adds_epi16(qs0, *t80);
  314|   659k|  ps[0] = _mm_adds_epi16(ps0, *t80);
  315|   659k|  filter = _mm_adds_epi16(filter1, one);
  316|   659k|  filter = _mm_srai_epi16(filter, 1);
  317|   659k|  filter = _mm_andnot_si128(hev, filter);
  318|   659k|  qs1 = _mm_subs_epi16(qs1, filter);
  319|   659k|  pixel_clamp(&pmin, &pmax, &qs1);
  320|   659k|  ps1 = _mm_adds_epi16(ps1, filter);
  321|   659k|  pixel_clamp(&pmin, &pmax, &ps1);
  322|   659k|  qs[1] = _mm_adds_epi16(qs1, *t80);
  323|   659k|  ps[1] = _mm_adds_epi16(ps1, *t80);
  324|   659k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_6_sse2:
  739|   131k|    const uint8_t *_limit, const uint8_t *_thresh, int bd) {
  740|   131k|  __m128i blimit, limit, thresh;
  741|   131k|  __m128i mask, hev, flat;
  742|   131k|  __m128i pq[3];
  743|   131k|  __m128i p1p0, q1q0, abs_p1p0, ps1ps0, qs1qs0;
  744|   131k|  __m128i flat_p1p0, flat_q0q1;
  745|       |
  746|   131k|  pq[0] = _mm_unpacklo_epi64(*p0, *q0);
  747|   131k|  pq[1] = _mm_unpacklo_epi64(*p1, *q1);
  748|   131k|  pq[2] = _mm_unpacklo_epi64(*p2, *q2);
  749|       |
  750|   131k|  const __m128i zero = _mm_setzero_si128();
  751|   131k|  const __m128i four = _mm_set1_epi16(4);
  752|   131k|  __m128i t80;
  753|   131k|  const __m128i one = _mm_set1_epi16(0x1);
  754|       |
  755|   131k|  get_limit(_blimit, _limit, _thresh, bd, &blimit, &limit, &thresh, &t80);
  756|       |
  757|   131k|  highbd_hev_filter_mask_x_sse2(pq, 3, &p1p0, &q1q0, &abs_p1p0, &limit, &blimit,
  758|   131k|                                &thresh, &hev, &mask);
  759|       |
  760|       |  // lp filter
  761|   131k|  highbd_filter4_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out, &t80, bd);
  762|       |
  763|       |  // flat_mask
  764|   131k|  flat = _mm_max_epi16(abs_diff16(pq[2], pq[0]), abs_p1p0);
  765|   131k|  flat = _mm_max_epi16(flat, _mm_srli_si128(flat, 8));
  766|       |
  767|   131k|  flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, bd - 8));
  768|       |
  769|   131k|  flat = _mm_cmpeq_epi16(flat, zero);
  770|   131k|  flat = _mm_and_si128(flat, mask);
  771|       |  // replicate for the further "merged variables" usage
  772|   131k|  flat = _mm_unpacklo_epi64(flat, flat);
  773|       |
  774|       |  // 5 tap filter
  775|       |  // need it only if flat !=0
  776|   131k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (776:7): [True: 9.16k, False: 122k]
  ------------------
  777|  9.16k|    __m128i workp_a, workp_b, workp_c;
  778|  9.16k|    __m128i pq0x2_pq1, pq1_pq2;
  779|       |
  780|       |    // op1
  781|  9.16k|    pq0x2_pq1 =
  782|  9.16k|        _mm_add_epi16(_mm_add_epi16(pq[0], pq[0]), pq[1]);  // p0 *2 + p1
  783|  9.16k|    pq1_pq2 = _mm_add_epi16(pq[1], pq[2]);                  // p1 + p2
  784|  9.16k|    workp_a = _mm_add_epi16(_mm_add_epi16(pq0x2_pq1, four),
  785|  9.16k|                            pq1_pq2);  // p2 + p0 * 2 + p1 * 2 + 4
  786|       |
  787|  9.16k|    workp_b = _mm_add_epi16(_mm_add_epi16(pq[2], pq[2]), *q0);
  788|  9.16k|    workp_b =
  789|  9.16k|        _mm_add_epi16(workp_a, workp_b);  // p2 * 3 + p1 * 2 + p0 * 2 + q0 + 4
  790|       |
  791|       |    // op0
  792|  9.16k|    workp_c = _mm_srli_si128(pq0x2_pq1, 8);  // q0 * 2 + q1
  793|  9.16k|    workp_a = _mm_add_epi16(workp_a,
  794|  9.16k|                            workp_c);  // p2 + p0 * 2 + p1 * 2 + q0 * 2 + q1 + 4
  795|  9.16k|    workp_b = _mm_unpacklo_epi64(workp_a, workp_b);
  796|  9.16k|    flat_p1p0 = _mm_srli_epi16(workp_b, 3);
  797|       |
  798|       |    // oq0
  799|  9.16k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_a, pq[2]),
  800|  9.16k|                            pq[1]);  // p0 * 2 + p1  + q0 * 2 + q1 + 4
  801|  9.16k|    workp_b = _mm_srli_si128(pq1_pq2, 8);
  802|  9.16k|    workp_a = _mm_add_epi16(
  803|  9.16k|        workp_a, workp_b);  // p0 * 2 + p1  + q0 * 2 + q1 * 2 + q2 + 4
  804|       |    // workp_shft0 = _mm_srli_epi16(workp_a, 3);
  805|       |
  806|       |    // oq1
  807|  9.16k|    workp_c = _mm_sub_epi16(_mm_sub_epi16(workp_a, pq[1]),
  808|  9.16k|                            pq[0]);  // p0   + q0 * 2 + q1 * 2 + q2 + 4
  809|  9.16k|    workp_b = _mm_add_epi16(*q2, *q2);
  810|  9.16k|    workp_b =
  811|  9.16k|        _mm_add_epi16(workp_c, workp_b);  // p0  + q0 * 2 + q1 * 2 + q2 * 3 + 4
  812|       |
  813|  9.16k|    workp_a = _mm_unpacklo_epi64(workp_a, workp_b);
  814|  9.16k|    flat_q0q1 = _mm_srli_epi16(workp_a, 3);
  815|       |
  816|  9.16k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0_out);
  817|  9.16k|    q1q0 = _mm_and_si128(flat, flat_q0q1);
  818|  9.16k|    *q1q0_out = _mm_or_si128(qs1qs0, q1q0);
  819|       |
  820|  9.16k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0_out);
  821|  9.16k|    p1p0 = _mm_and_si128(flat, flat_p1p0);
  822|  9.16k|    *p1p0_out = _mm_or_si128(ps1ps0, p1p0);
  823|  9.16k|  }
  824|   131k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_6_dual_sse2:
  830|  66.7k|    const unsigned char *_limit1, const unsigned char *_thresh1, int bd) {
  831|  66.7k|  const __m128i zero = _mm_setzero_si128();
  832|  66.7k|  __m128i blimit0, limit0, thresh0;
  833|  66.7k|  __m128i t80;
  834|  66.7k|  __m128i mask, flat, work;
  835|  66.7k|  __m128i abs_p1q1, abs_p0q0, abs_p1p0, abs_p2p1, abs_q1q0, abs_q2q1;
  836|  66.7k|  __m128i op1, op0, oq0, oq1;
  837|  66.7k|  const __m128i four = _mm_set1_epi16(4);
  838|  66.7k|  const __m128i one = _mm_set1_epi16(0x1);
  839|  66.7k|  const __m128i ffff = _mm_cmpeq_epi16(one, one);
  840|       |
  841|  66.7k|  get_limit_dual(_blimit0, _limit0, _thresh0, _blimit1, _limit1, _thresh1, bd,
  842|  66.7k|                 &blimit0, &limit0, &thresh0, &t80);
  843|       |
  844|  66.7k|  abs_p2p1 = abs_diff16(*p2, *p1);
  845|  66.7k|  abs_p1p0 = abs_diff16(*p1, *p0);
  846|  66.7k|  abs_q1q0 = abs_diff16(*q1, *q0);
  847|  66.7k|  abs_q2q1 = abs_diff16(*q2, *q1);
  848|       |
  849|  66.7k|  abs_p0q0 = abs_diff16(*p0, *q0);
  850|  66.7k|  abs_p1q1 = abs_diff16(*p1, *q1);
  851|       |
  852|  66.7k|  abs_p0q0 = _mm_adds_epu16(abs_p0q0, abs_p0q0);
  853|  66.7k|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1);
  854|  66.7k|  mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit0);
  855|  66.7k|  mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff);
  856|       |  // mask |= (abs(*p0 - *q0) * 2 + abs(*p1 - *q1) / 2  > blimit) * -1;
  857|       |  // So taking maximums continues to work:
  858|  66.7k|  mask = _mm_and_si128(mask, _mm_adds_epu16(limit0, one));
  859|       |
  860|  66.7k|  mask = _mm_max_epi16(abs_q2q1, mask);
  861|  66.7k|  work = _mm_max_epi16(abs_p1p0, abs_q1q0);
  862|  66.7k|  mask = _mm_max_epi16(work, mask);
  863|  66.7k|  mask = _mm_max_epi16(mask, abs_p2p1);
  864|  66.7k|  mask = _mm_subs_epu16(mask, limit0);
  865|  66.7k|  mask = _mm_cmpeq_epi16(mask, zero);
  866|       |
  867|       |  // lp filter
  868|  66.7k|  __m128i ps[2], qs[2], p[2], q[2];
  869|  66.7k|  {
  870|  66.7k|    p[0] = *p0;
  871|  66.7k|    p[1] = *p1;
  872|  66.7k|    q[0] = *q0;
  873|  66.7k|    q[1] = *q1;
  874|       |    // filter_mask and hev_mask
  875|  66.7k|    highbd_filter4_dual_sse2(p, q, ps, qs, &mask, &thresh0, bd, &t80);
  876|  66.7k|  }
  877|       |
  878|       |  // flat_mask
  879|  66.7k|  flat = _mm_max_epi16(abs_diff16(*q2, *q0), abs_diff16(*p2, *p0));
  880|  66.7k|  flat = _mm_max_epi16(flat, work);
  881|       |
  882|  66.7k|  flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, bd - 8));
  883|       |
  884|  66.7k|  flat = _mm_cmpeq_epi16(flat, zero);
  885|  66.7k|  flat = _mm_and_si128(flat, mask);  // flat & mask
  886|       |
  887|       |  // 5 tap filter
  888|       |  // need it only if flat !=0
  889|  66.7k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (889:7): [True: 8.36k, False: 58.3k]
  ------------------
  890|  8.36k|    __m128i workp_a, workp_b, workp_shft0, workp_shft1;
  891|       |
  892|       |    // op1
  893|  8.36k|    workp_a = _mm_add_epi16(_mm_add_epi16(*p0, *p0),
  894|  8.36k|                            _mm_add_epi16(*p1, *p1));  // *p0 *2 + *p1 * 2
  895|  8.36k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four),
  896|  8.36k|                            *p2);  // *p2 + *p0 * 2 + *p1 * 2 + 4
  897|       |
  898|  8.36k|    workp_b = _mm_add_epi16(_mm_add_epi16(*p2, *p2), *q0);
  899|  8.36k|    workp_shft0 = _mm_add_epi16(
  900|  8.36k|        workp_a, workp_b);  // *p2 * 3 + *p1 * 2 + *p0 * 2 + *q0 + 4
  901|  8.36k|    op1 = _mm_srli_epi16(workp_shft0, 3);
  902|       |
  903|       |    // op0
  904|  8.36k|    workp_b = _mm_add_epi16(_mm_add_epi16(*q0, *q0), *q1);  // *q0 * 2 + *q1
  905|  8.36k|    workp_a =
  906|  8.36k|        _mm_add_epi16(workp_a,
  907|  8.36k|                      workp_b);  // *p2 + *p0 * 2 + *p1 * 2 + *q0 * 2 + *q1 + 4
  908|  8.36k|    op0 = _mm_srli_epi16(workp_a, 3);
  909|       |
  910|       |    // oq0
  911|  8.36k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_a, *p2),
  912|  8.36k|                            *p1);  // *p0 * 2 + *p1  + *q0 * 2 + *q1 + 4
  913|  8.36k|    workp_b = _mm_add_epi16(*q1, *q2);
  914|  8.36k|    workp_shft0 = _mm_add_epi16(
  915|  8.36k|        workp_a, workp_b);  // *p0 * 2 + *p1  + *q0 * 2 + *q1 * 2 + *q2 + 4
  916|  8.36k|    oq0 = _mm_srli_epi16(workp_shft0, 3);
  917|       |
  918|       |    // oq1
  919|  8.36k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_shft0, *p1),
  920|  8.36k|                            *p0);  // *p0   + *q0 * 2 + *q1 * 2 + *q2 + 4
  921|  8.36k|    workp_b = _mm_add_epi16(*q2, *q2);
  922|  8.36k|    workp_shft1 = _mm_add_epi16(
  923|  8.36k|        workp_a, workp_b);  // *p0  + *q0 * 2 + *q1 * 2 + *q2 * 3 + 4
  924|  8.36k|    oq1 = _mm_srli_epi16(workp_shft1, 3);
  925|       |
  926|  8.36k|    qs[0] = _mm_andnot_si128(flat, qs[0]);
  927|  8.36k|    oq0 = _mm_and_si128(flat, oq0);
  928|  8.36k|    *q0 = _mm_or_si128(qs[0], oq0);
  929|       |
  930|  8.36k|    qs[1] = _mm_andnot_si128(flat, qs[1]);
  931|  8.36k|    oq1 = _mm_and_si128(flat, oq1);
  932|  8.36k|    *q1 = _mm_or_si128(qs[1], oq1);
  933|       |
  934|  8.36k|    ps[0] = _mm_andnot_si128(flat, ps[0]);
  935|  8.36k|    op0 = _mm_and_si128(flat, op0);
  936|  8.36k|    *p0 = _mm_or_si128(ps[0], op0);
  937|       |
  938|  8.36k|    ps[1] = _mm_andnot_si128(flat, ps[1]);
  939|  8.36k|    op1 = _mm_and_si128(flat, op1);
  940|  8.36k|    *p1 = _mm_or_si128(ps[1], op1);
  941|  58.3k|  } else {
  942|  58.3k|    *q0 = qs[0];
  943|  58.3k|    *q1 = qs[1];
  944|  58.3k|    *p0 = ps[0];
  945|  58.3k|    *p1 = ps[1];
  946|  58.3k|  }
  947|  66.7k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_8_sse2:
  998|   137k|    const unsigned char *_thresh, int bd) {
  999|   137k|  const __m128i zero = _mm_setzero_si128();
 1000|   137k|  __m128i blimit, limit, thresh;
 1001|   137k|  __m128i mask, hev, flat;
 1002|   137k|  __m128i pq[4];
 1003|   137k|  __m128i p1p0, q1q0, ps1ps0, qs1qs0;
 1004|   137k|  __m128i work_a, opq2, flat_p1p0, flat_q0q1;
 1005|       |
 1006|   137k|  pq[0] = _mm_unpacklo_epi64(*p0, *q0);
 1007|   137k|  pq[1] = _mm_unpacklo_epi64(*p1, *q1);
 1008|   137k|  pq[2] = _mm_unpacklo_epi64(*p2, *q2);
 1009|   137k|  pq[3] = _mm_unpacklo_epi64(*p3, *q3);
 1010|       |
 1011|   137k|  __m128i abs_p1p0;
 1012|       |
 1013|   137k|  const __m128i four = _mm_set1_epi16(4);
 1014|   137k|  __m128i t80;
 1015|   137k|  const __m128i one = _mm_set1_epi16(0x1);
 1016|       |
 1017|   137k|  get_limit(_blimit, _limit, _thresh, bd, &blimit, &limit, &thresh, &t80);
 1018|       |
 1019|   137k|  highbd_hev_filter_mask_x_sse2(pq, 4, &p1p0, &q1q0, &abs_p1p0, &limit, &blimit,
 1020|   137k|                                &thresh, &hev, &mask);
 1021|       |
 1022|       |  // lp filter
 1023|   137k|  highbd_filter4_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out, &t80, bd);
 1024|       |
 1025|       |  // flat_mask4
 1026|   137k|  flat = _mm_max_epi16(abs_diff16(pq[2], pq[0]), abs_diff16(pq[3], pq[0]));
 1027|   137k|  flat = _mm_max_epi16(abs_p1p0, flat);
 1028|   137k|  flat = _mm_max_epi16(flat, _mm_srli_si128(flat, 8));
 1029|       |
 1030|   137k|  flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, bd - 8));
 1031|       |
 1032|   137k|  flat = _mm_cmpeq_epi16(flat, zero);
 1033|   137k|  flat = _mm_and_si128(flat, mask);
 1034|       |  // replicate for the further "merged variables" usage
 1035|   137k|  flat = _mm_unpacklo_epi64(flat, flat);
 1036|       |
 1037|   137k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (1037:7): [True: 4.82k, False: 132k]
  ------------------
 1038|  4.82k|    __m128i workp_a, workp_b, workp_c, workp_shft0, workp_shft1;
 1039|       |    // Added before shift for rounding part of ROUND_POWER_OF_TWO
 1040|       |
 1041|       |    // o*p2
 1042|  4.82k|    workp_a = _mm_add_epi16(_mm_add_epi16(*p3, *p3), _mm_add_epi16(*p2, *p1));
 1043|  4.82k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), *p0);
 1044|  4.82k|    workp_c = _mm_add_epi16(_mm_add_epi16(*q0, *p2), *p3);
 1045|  4.82k|    workp_c = _mm_add_epi16(workp_a, workp_c);
 1046|       |
 1047|       |    // o*p1
 1048|  4.82k|    workp_b = _mm_add_epi16(_mm_add_epi16(*q0, *q1), *p1);
 1049|  4.82k|    workp_shft0 = _mm_add_epi16(workp_a, workp_b);
 1050|       |
 1051|       |    // o*p0
 1052|  4.82k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p3), *q2);
 1053|  4.82k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *p1), *p0);
 1054|  4.82k|    workp_shft1 = _mm_add_epi16(workp_a, workp_b);
 1055|       |
 1056|  4.82k|    flat_p1p0 = _mm_srli_epi16(_mm_unpacklo_epi64(workp_shft1, workp_shft0), 3);
 1057|       |
 1058|       |    // oq0
 1059|  4.82k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p3), *q3);
 1060|  4.82k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *p0), *q0);
 1061|  4.82k|    workp_shft0 = _mm_add_epi16(workp_a, workp_b);
 1062|       |
 1063|       |    // oq1
 1064|  4.82k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p2), *q3);
 1065|  4.82k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *q0), *q1);
 1066|  4.82k|    workp_shft1 = _mm_add_epi16(workp_a, workp_b);
 1067|       |
 1068|  4.82k|    flat_q0q1 = _mm_srli_epi16(_mm_unpacklo_epi64(workp_shft0, workp_shft1), 3);
 1069|       |
 1070|       |    // oq2
 1071|  4.82k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p1), *q3);
 1072|  4.82k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *q1), *q2);
 1073|  4.82k|    workp_a = _mm_add_epi16(workp_a, workp_b);
 1074|  4.82k|    opq2 = _mm_srli_epi16(_mm_unpacklo_epi64(workp_c, workp_a), 3);
 1075|       |
 1076|  4.82k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0_out);
 1077|  4.82k|    q1q0 = _mm_and_si128(flat, flat_q0q1);
 1078|  4.82k|    *q1q0_out = _mm_or_si128(qs1qs0, q1q0);
 1079|       |
 1080|  4.82k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0_out);
 1081|  4.82k|    p1p0 = _mm_and_si128(flat, flat_p1p0);
 1082|  4.82k|    *p1p0_out = _mm_or_si128(ps1ps0, p1p0);
 1083|       |
 1084|  4.82k|    work_a = _mm_andnot_si128(flat, pq[2]);
 1085|  4.82k|    *p2 = _mm_and_si128(flat, opq2);
 1086|  4.82k|    *p2 = _mm_or_si128(work_a, *p2);
 1087|       |    *q2 = _mm_srli_si128(*p2, 8);
 1088|  4.82k|  }
 1089|   137k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_8_dual_sse2:
 1096|   208k|    const unsigned char *_thresh1, int bd) {
 1097|   208k|  __m128i blimit0, limit0, thresh0;
 1098|   208k|  __m128i t80;
 1099|   208k|  __m128i mask, flat;
 1100|   208k|  __m128i work_a, op2, oq2, op1, op0, oq0, oq1;
 1101|   208k|  __m128i abs_p1q1, abs_p0q0, work0, work1, work2;
 1102|       |
 1103|   208k|  const __m128i zero = _mm_setzero_si128();
 1104|   208k|  const __m128i four = _mm_set1_epi16(4);
 1105|   208k|  const __m128i one = _mm_set1_epi16(0x1);
 1106|   208k|  const __m128i ffff = _mm_cmpeq_epi16(one, one);
 1107|       |
 1108|   208k|  get_limit_dual(_blimit0, _limit0, _thresh0, _blimit1, _limit1, _thresh1, bd,
 1109|   208k|                 &blimit0, &limit0, &thresh0, &t80);
 1110|       |
 1111|   208k|  abs_p0q0 = abs_diff16(*p0, *q0);
 1112|   208k|  abs_p1q1 = abs_diff16(*p1, *q1);
 1113|       |
 1114|   208k|  abs_p0q0 = _mm_adds_epu16(abs_p0q0, abs_p0q0);
 1115|   208k|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1);
 1116|   208k|  mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit0);
 1117|   208k|  mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff);
 1118|       |  // mask |= (abs(*p0 - q0) * 2 + abs(*p1 - q1) / 2  > blimit) * -1;
 1119|       |
 1120|       |  // So taking maximums continues to work:
 1121|   208k|  mask = _mm_and_si128(mask, _mm_adds_epu16(limit0, one));
 1122|       |
 1123|   208k|  work0 = _mm_max_epi16(abs_diff16(*p3, *p2), abs_diff16(*p2, *p1));
 1124|   208k|  work1 =
 1125|   208k|      _mm_max_epi16(abs_diff16(*p1, *p0), abs_diff16(*q1, *q0));  // tbu 4 flat
 1126|   208k|  work0 = _mm_max_epi16(work0, work1);
 1127|   208k|  work2 = _mm_max_epi16(abs_diff16(*q2, *q1), abs_diff16(*q2, *q3));
 1128|   208k|  work2 = _mm_max_epi16(work2, work0);
 1129|   208k|  mask = _mm_max_epi16(work2, mask);
 1130|       |
 1131|   208k|  mask = _mm_subs_epu16(mask, limit0);
 1132|   208k|  mask = _mm_cmpeq_epi16(mask, zero);
 1133|       |
 1134|       |  // lp filter
 1135|   208k|  __m128i ps[2], qs[2], p[2], q[2];
 1136|   208k|  {
 1137|   208k|    p[0] = *p0;
 1138|   208k|    p[1] = *p1;
 1139|   208k|    q[0] = *q0;
 1140|   208k|    q[1] = *q1;
 1141|       |    // filter_mask and hev_mask
 1142|   208k|    highbd_filter4_dual_sse2(p, q, ps, qs, &mask, &thresh0, bd, &t80);
 1143|   208k|  }
 1144|       |
 1145|   208k|  flat = _mm_max_epi16(abs_diff16(*p2, *p0), abs_diff16(*q2, *q0));
 1146|   208k|  flat = _mm_max_epi16(work1, flat);
 1147|   208k|  work0 = _mm_max_epi16(abs_diff16(*p3, *p0), abs_diff16(*q3, *q0));
 1148|   208k|  flat = _mm_max_epi16(work0, flat);
 1149|       |
 1150|   208k|  flat = _mm_subs_epu16(flat, _mm_slli_epi16(one, bd - 8));
 1151|   208k|  flat = _mm_cmpeq_epi16(flat, zero);
 1152|   208k|  flat = _mm_and_si128(flat, mask);  // flat & mask
 1153|       |
 1154|       |  // filter8 need it only if flat !=0
 1155|   208k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi16(flat, zero))) {
  ------------------
  |  Branch (1155:7): [True: 14.9k, False: 193k]
  ------------------
 1156|  14.9k|    __m128i workp_a, workp_b;
 1157|       |    // Added before shift for rounding part of ROUND_POWER_OF_TWO
 1158|       |
 1159|       |    // o*p2
 1160|  14.9k|    workp_a = _mm_add_epi16(_mm_add_epi16(*p3, *p3), _mm_add_epi16(*p2, *p1));
 1161|  14.9k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), *p0);
 1162|  14.9k|    workp_b = _mm_add_epi16(_mm_add_epi16(*q0, *p2), *p3);
 1163|  14.9k|    op2 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1164|       |
 1165|       |    // o*p1
 1166|  14.9k|    workp_b = _mm_add_epi16(_mm_add_epi16(*q0, *q1), *p1);
 1167|  14.9k|    op1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1168|       |
 1169|       |    // o*p0
 1170|  14.9k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p3), *q2);
 1171|  14.9k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *p1), *p0);
 1172|  14.9k|    op0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1173|       |
 1174|       |    // oq0
 1175|  14.9k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p3), *q3);
 1176|  14.9k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *p0), *q0);
 1177|  14.9k|    oq0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1178|       |
 1179|       |    // oq1
 1180|  14.9k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p2), *q3);
 1181|  14.9k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *q0), *q1);
 1182|  14.9k|    oq1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1183|       |
 1184|       |    // oq2
 1185|  14.9k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, *p1), *q3);
 1186|  14.9k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, *q1), *q2);
 1187|  14.9k|    oq2 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1188|       |
 1189|  14.9k|    qs[0] = _mm_andnot_si128(flat, qs[0]);
 1190|  14.9k|    oq0 = _mm_and_si128(flat, oq0);
 1191|  14.9k|    *q0 = _mm_or_si128(qs[0], oq0);
 1192|       |
 1193|  14.9k|    qs[1] = _mm_andnot_si128(flat, qs[1]);
 1194|  14.9k|    oq1 = _mm_and_si128(flat, oq1);
 1195|  14.9k|    *q1 = _mm_or_si128(qs[1], oq1);
 1196|       |
 1197|  14.9k|    ps[0] = _mm_andnot_si128(flat, ps[0]);
 1198|  14.9k|    op0 = _mm_and_si128(flat, op0);
 1199|  14.9k|    *p0 = _mm_or_si128(ps[0], op0);
 1200|       |
 1201|  14.9k|    ps[1] = _mm_andnot_si128(flat, ps[1]);
 1202|  14.9k|    op1 = _mm_and_si128(flat, op1);
 1203|  14.9k|    *p1 = _mm_or_si128(ps[1], op1);
 1204|       |
 1205|  14.9k|    work_a = _mm_andnot_si128(flat, *q2);
 1206|  14.9k|    *q2 = _mm_and_si128(flat, oq2);
 1207|  14.9k|    *q2 = _mm_or_si128(work_a, *q2);
 1208|       |
 1209|  14.9k|    work_a = _mm_andnot_si128(flat, *p2);
 1210|  14.9k|    *p2 = _mm_and_si128(flat, op2);
 1211|  14.9k|    *p2 = _mm_or_si128(work_a, *p2);
 1212|   193k|  } else {
 1213|   193k|    *q0 = qs[0];
 1214|   193k|    *q1 = qs[1];
 1215|   193k|    *p0 = ps[0];
 1216|   193k|    *p1 = ps[1];
 1217|   193k|  }
 1218|   208k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_4_sse2:
 1277|   609k|    const uint8_t *_thresh, int bd) {
 1278|   609k|  __m128i blimit, limit, thresh;
 1279|   609k|  __m128i mask, hev;
 1280|   609k|  __m128i p1p0, q1q0;
 1281|   609k|  __m128i pq[2];
 1282|       |
 1283|   609k|  __m128i abs_p1p0;
 1284|       |
 1285|   609k|  __m128i t80;
 1286|   609k|  get_limit(_blimit, _limit, _thresh, bd, &blimit, &limit, &thresh, &t80);
 1287|       |
 1288|   609k|  pq[0] = _mm_unpacklo_epi64(*p0, *q0);
 1289|   609k|  pq[1] = _mm_unpacklo_epi64(*p1, *q1);
 1290|       |
 1291|   609k|  highbd_hev_filter_mask_x_sse2(pq, 2, &p1p0, &q1q0, &abs_p1p0, &limit, &blimit,
 1292|   609k|                                &thresh, &hev, &mask);
 1293|       |
 1294|   609k|  highbd_filter4_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out, &t80, bd);
 1295|   609k|}
highbd_loopfilter_sse2.c:highbd_lpf_internal_4_dual_sse2:
 1301|   371k|    const uint8_t *_thresh1, int bd) {
 1302|   371k|  __m128i blimit0, limit0, thresh0;
 1303|   371k|  __m128i mask, flat;
 1304|   371k|  __m128i p[2], q[2];
 1305|       |
 1306|   371k|  const __m128i zero = _mm_setzero_si128();
 1307|   371k|  __m128i abs_p0q0 = abs_diff16(*q0, *p0);
 1308|   371k|  __m128i abs_p1q1 = abs_diff16(*q1, *p1);
 1309|       |
 1310|   371k|  __m128i abs_p1p0 = abs_diff16(*p1, *p0);
 1311|   371k|  __m128i abs_q1q0 = abs_diff16(*q1, *q0);
 1312|       |
 1313|   371k|  const __m128i ffff = _mm_cmpeq_epi16(abs_p1p0, abs_p1p0);
 1314|   371k|  const __m128i one = _mm_set1_epi16(1);
 1315|       |
 1316|   371k|  __m128i t80;
 1317|       |
 1318|   371k|  get_limit_dual(_blimit0, _limit0, _thresh0, _blimit1, _limit1, _thresh1, bd,
 1319|   371k|                 &blimit0, &limit0, &thresh0, &t80);
 1320|       |
 1321|       |  // filter_mask and hev_mask
 1322|   371k|  flat = _mm_max_epi16(abs_p1p0, abs_q1q0);
 1323|       |
 1324|   371k|  abs_p0q0 = _mm_adds_epu16(abs_p0q0, abs_p0q0);
 1325|   371k|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 1);
 1326|       |
 1327|   371k|  mask = _mm_subs_epu16(_mm_adds_epu16(abs_p0q0, abs_p1q1), blimit0);
 1328|   371k|  mask = _mm_xor_si128(_mm_cmpeq_epi16(mask, zero), ffff);
 1329|       |  // mask |= (abs(*p0 - *q0) * 2 + abs(*p1 - *q1) / 2  > blimit) * -1;
 1330|       |  // So taking maximums continues to work:
 1331|   371k|  mask = _mm_and_si128(mask, _mm_adds_epu16(limit0, one));
 1332|   371k|  mask = _mm_max_epi16(flat, mask);
 1333|       |
 1334|   371k|  mask = _mm_subs_epu16(mask, limit0);
 1335|   371k|  mask = _mm_cmpeq_epi16(mask, zero);
 1336|       |
 1337|   371k|  p[0] = *p0;
 1338|   371k|  p[1] = *p1;
 1339|   371k|  q[0] = *q0;
 1340|   371k|  q[1] = *q1;
 1341|       |
 1342|   371k|  highbd_filter4_dual_sse2(p, q, ps, qs, &mask, &thresh0, bd, &t80);
 1343|   371k|}

aom_highbd_quantize_b_avx2:
  192|  4.53M|                                const int16_t *scan, const int16_t *iscan) {
  193|  4.53M|  (void)scan;
  194|  4.53M|  const int step = 8;
  195|       |
  196|  4.53M|  __m256i eob = _mm256_setzero_si256();
  197|  4.53M|  __m256i qp[5];
  198|       |
  199|  4.53M|  init_qp(zbin_ptr, round_ptr, quant_ptr, dequant_ptr, quant_shift_ptr, qp, 0);
  200|       |
  201|  4.53M|  quantize(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob);
  202|       |
  203|  4.53M|  coeff_ptr += step;
  204|  4.53M|  qcoeff_ptr += step;
  205|  4.53M|  dqcoeff_ptr += step;
  206|  4.53M|  iscan += step;
  207|  4.53M|  n_coeffs -= step;
  208|       |
  209|  4.53M|  update_qp(qp);
  210|       |
  211|  22.6M|  while (n_coeffs > 0) {
  ------------------
  |  Branch (211:10): [True: 18.1M, False: 4.53M]
  ------------------
  212|  18.1M|    quantize(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob);
  213|       |
  214|  18.1M|    coeff_ptr += step;
  215|  18.1M|    qcoeff_ptr += step;
  216|  18.1M|    dqcoeff_ptr += step;
  217|  18.1M|    iscan += step;
  218|  18.1M|    n_coeffs -= step;
  219|  18.1M|  }
  220|       |
  221|  4.53M|  *eob_ptr = get_max_eob(eob);
  222|  4.53M|}
aom_highbd_quantize_b_32x32_avx2:
  229|  12.9k|    const int16_t *scan, const int16_t *iscan) {
  230|  12.9k|  (void)scan;
  231|  12.9k|  const unsigned int step = 8;
  232|       |
  233|  12.9k|  __m256i eob = _mm256_setzero_si256();
  234|  12.9k|  __m256i qp[5];
  235|  12.9k|  init_qp(zbin_ptr, round_ptr, quant_ptr, dequant_ptr, quant_shift_ptr, qp, 1);
  236|       |
  237|  12.9k|  quantize_logscale(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob, 1);
  238|       |
  239|  12.9k|  coeff_ptr += step;
  240|  12.9k|  qcoeff_ptr += step;
  241|  12.9k|  dqcoeff_ptr += step;
  242|  12.9k|  iscan += step;
  243|  12.9k|  n_coeffs -= step;
  244|       |
  245|  12.9k|  update_qp(qp);
  246|       |
  247|  1.22M|  while (n_coeffs > 0) {
  ------------------
  |  Branch (247:10): [True: 1.21M, False: 12.9k]
  ------------------
  248|  1.21M|    quantize_logscale(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob, 1);
  249|       |
  250|  1.21M|    coeff_ptr += step;
  251|  1.21M|    qcoeff_ptr += step;
  252|  1.21M|    dqcoeff_ptr += step;
  253|  1.21M|    iscan += step;
  254|  1.21M|    n_coeffs -= step;
  255|  1.21M|  }
  256|       |
  257|  12.9k|  *eob_ptr = get_max_eob(eob);
  258|  12.9k|}
aom_highbd_quantize_b_64x64_avx2:
  265|    908|    const int16_t *scan, const int16_t *iscan) {
  266|    908|  (void)scan;
  267|    908|  const int step = 8;
  268|       |
  269|    908|  __m256i eob = _mm256_setzero_si256();
  270|    908|  __m256i qp[5];
  271|    908|  init_qp(zbin_ptr, round_ptr, quant_ptr, dequant_ptr, quant_shift_ptr, qp, 2);
  272|       |
  273|    908|  quantize_logscale(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob, 2);
  274|       |
  275|    908|  coeff_ptr += step;
  276|    908|  qcoeff_ptr += step;
  277|    908|  dqcoeff_ptr += step;
  278|    908|  iscan += step;
  279|    908|  n_coeffs -= step;
  280|       |
  281|    908|  update_qp(qp);
  282|       |
  283|   115k|  while (n_coeffs > 0) {
  ------------------
  |  Branch (283:10): [True: 114k, False: 908]
  ------------------
  284|   114k|    quantize_logscale(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob, 2);
  285|       |
  286|   114k|    coeff_ptr += step;
  287|   114k|    qcoeff_ptr += step;
  288|   114k|    dqcoeff_ptr += step;
  289|   114k|    iscan += step;
  290|   114k|    n_coeffs -= step;
  291|   114k|  }
  292|       |
  293|    908|  *eob_ptr = get_max_eob(eob);
  294|    908|}
highbd_quantize_intrin_avx2.c:init_qp:
   35|  4.55M|                           int log_scale) {
   36|  4.55M|  const __m128i zbin = _mm_loadu_si128((const __m128i *)zbin_ptr);
   37|  4.55M|  const __m128i round = _mm_loadu_si128((const __m128i *)round_ptr);
   38|  4.55M|  const __m128i quant = _mm_loadu_si128((const __m128i *)quant_ptr);
   39|  4.55M|  const __m128i dequant = _mm_loadu_si128((const __m128i *)dequant_ptr);
   40|  4.55M|  const __m128i quant_shift = _mm_loadu_si128((const __m128i *)quant_shift_ptr);
   41|  4.55M|  init_one_qp(&zbin, &qp[0]);
   42|  4.55M|  init_one_qp(&round, &qp[1]);
   43|  4.55M|  init_one_qp(&quant, &qp[2]);
   44|  4.55M|  init_one_qp(&dequant, &qp[3]);
   45|  4.55M|  init_one_qp(&quant_shift, &qp[4]);
   46|  4.55M|  if (log_scale > 0) {
  ------------------
  |  Branch (46:7): [True: 13.8k, False: 4.53M]
  ------------------
   47|  13.8k|    const __m256i rnd = _mm256_set1_epi32((int16_t)(1 << (log_scale - 1)));
   48|  13.8k|    qp[0] = _mm256_add_epi32(qp[0], rnd);
   49|  13.8k|    qp[0] = _mm256_srai_epi32(qp[0], log_scale);
   50|       |
   51|  13.8k|    qp[1] = _mm256_add_epi32(qp[1], rnd);
   52|  13.8k|    qp[1] = _mm256_srai_epi32(qp[1], log_scale);
   53|  13.8k|  }
   54|       |  // Subtracting 1 here eliminates a _mm256_cmpeq_epi32() instruction when
   55|       |  // calculating the zbin mask.
   56|  4.55M|  qp[0] = _mm256_sub_epi32(qp[0], _mm256_set1_epi32(1));
   57|  4.55M|}
highbd_quantize_intrin_avx2.c:init_one_qp:
   18|  22.7M|static inline void init_one_qp(const __m128i *p, __m256i *qp) {
   19|  22.7M|  const __m128i sign = _mm_srai_epi16(*p, 15);
   20|  22.7M|  const __m128i dc = _mm_unpacklo_epi16(*p, sign);
   21|  22.7M|  const __m128i ac = _mm_unpackhi_epi16(*p, sign);
   22|       |  *qp = _mm256_insertf128_si256(_mm256_castsi128_si256(dc), ac, 1);
   23|  22.7M|}
highbd_quantize_intrin_avx2.c:quantize:
  157|  22.6M|                                      __m256i *eob) {
  158|  22.6M|  const __m256i coeff = _mm256_loadu_si256((const __m256i *)coeff_ptr);
  159|  22.6M|  const __m256i abs_coeff = _mm256_abs_epi32(coeff);
  160|  22.6M|  const __m256i zbin_mask = _mm256_cmpgt_epi32(abs_coeff, qp[0]);
  161|       |
  162|  22.6M|  if (UNLIKELY(_mm256_movemask_epi8(zbin_mask) == 0)) {
  ------------------
  |  |   55|  22.6M|#define UNLIKELY(v) __builtin_expect(v, 0)
  |  |  ------------------
  |  |  |  Branch (55:21): [True: 2.52M, False: 20.1M]
  |  |  ------------------
  ------------------
  163|  2.52M|    const __m256i zero = _mm256_setzero_si256();
  164|  2.52M|    _mm256_storeu_si256((__m256i *)qcoeff, zero);
  165|  2.52M|    _mm256_storeu_si256((__m256i *)dqcoeff, zero);
  166|  2.52M|    return;
  167|  2.52M|  }
  168|       |
  169|  20.1M|  const __m256i tmp_rnd =
  170|  20.1M|      _mm256_and_si256(_mm256_add_epi32(abs_coeff, qp[1]), zbin_mask);
  171|  20.1M|  const __m256i tmp = mm256_mul_shift_epi32(&tmp_rnd, &qp[2]);
  172|  20.1M|  const __m256i tmp2 = _mm256_add_epi32(tmp, tmp_rnd);
  173|  20.1M|  const __m256i abs_q = mm256_mul_shift_epi32(&tmp2, &qp[4]);
  174|  20.1M|  const __m256i abs_dq = _mm256_mullo_epi32(abs_q, qp[3]);
  175|  20.1M|  const __m256i nz_mask = _mm256_cmpgt_epi32(abs_q, _mm256_setzero_si256());
  176|  20.1M|  const __m256i q = _mm256_sign_epi32(abs_q, coeff);
  177|  20.1M|  const __m256i dq = _mm256_sign_epi32(abs_dq, coeff);
  178|       |
  179|  20.1M|  _mm256_storeu_si256((__m256i *)qcoeff, q);
  180|  20.1M|  _mm256_storeu_si256((__m256i *)dqcoeff, dq);
  181|       |
  182|  20.1M|  *eob = get_max_lane_eob(iscan_ptr, *eob, nz_mask);
  183|  20.1M|}
highbd_quantize_intrin_avx2.c:mm256_mul_shift_epi32:
   63|  40.2M|                                            const __m256i *y) {
   64|  40.2M|  __m256i prod_lo = _mm256_mul_epi32(*x, *y);
   65|  40.2M|  __m256i prod_hi = _mm256_srli_epi64(*x, 32);
   66|  40.2M|  const __m256i mult_hi = _mm256_srli_epi64(*y, 32);
   67|  40.2M|  prod_hi = _mm256_mul_epi32(prod_hi, mult_hi);
   68|       |
   69|  40.2M|  prod_lo = _mm256_srli_epi64(prod_lo, 16);
   70|  40.2M|  const __m256i mask = _mm256_set_epi32(0, -1, 0, -1, 0, -1, 0, -1);
   71|  40.2M|  prod_lo = _mm256_and_si256(prod_lo, mask);
   72|  40.2M|  prod_hi = _mm256_srli_epi64(prod_hi, 16);
   73|       |
   74|  40.2M|  prod_hi = _mm256_slli_epi64(prod_hi, 32);
   75|  40.2M|  return _mm256_or_si256(prod_lo, prod_hi);
   76|  40.2M|}
highbd_quantize_intrin_avx2.c:get_max_lane_eob:
   80|  21.1M|                                                 __m256i nz_mask) {
   81|  21.1M|  const __m256i packed_nz_mask = _mm256_packs_epi32(nz_mask, nz_mask);
   82|  21.1M|  const __m256i packed_nz_mask_perm =
   83|       |      _mm256_permute4x64_epi64(packed_nz_mask, 0xD8);
   84|  21.1M|  const __m256i iscan =
   85|  21.1M|      _mm256_castsi128_si256(_mm_loadu_si128((const __m128i *)iscan_ptr));
   86|  21.1M|  const __m256i iscan_plus1 = _mm256_sub_epi16(iscan, packed_nz_mask_perm);
   87|  21.1M|  const __m256i nz_iscan = _mm256_and_si256(iscan_plus1, packed_nz_mask_perm);
   88|  21.1M|  return _mm256_max_epi16(eobmax, nz_iscan);
   89|  21.1M|}
highbd_quantize_intrin_avx2.c:update_qp:
   25|  4.55M|static inline void update_qp(__m256i *qp) {
   26|  4.55M|  int i;
   27|  27.3M|  for (i = 0; i < 5; ++i) {
  ------------------
  |  Branch (27:15): [True: 22.7M, False: 4.55M]
  ------------------
   28|       |    qp[i] = _mm256_permute2x128_si256(qp[i], qp[i], 0x11);
   29|  22.7M|  }
   30|  4.55M|}
highbd_quantize_intrin_avx2.c:get_max_eob:
   92|  4.55M|static AOM_FORCE_INLINE uint16_t get_max_eob(__m256i eob) {
   93|  4.55M|  __m256i eob_s;
   94|  4.55M|  eob_s = _mm256_shuffle_epi32(eob, 0xe);
   95|  4.55M|  eob = _mm256_max_epi16(eob, eob_s);
   96|  4.55M|  eob_s = _mm256_shufflelo_epi16(eob, 0xe);
   97|  4.55M|  eob = _mm256_max_epi16(eob, eob_s);
   98|  4.55M|  eob_s = _mm256_shufflelo_epi16(eob, 1);
   99|  4.55M|  eob = _mm256_max_epi16(eob, eob_s);
  100|       |  return (uint16_t)_mm256_extract_epi16(eob, 0);
  101|  4.55M|}
highbd_quantize_intrin_avx2.c:quantize_logscale:
  120|  1.34M|    tran_low_t *qcoeff, tran_low_t *dqcoeff, __m256i *eob, int log_scale) {
  121|  1.34M|  const __m256i coeff = _mm256_loadu_si256((const __m256i *)coeff_ptr);
  122|  1.34M|  const __m256i abs_coeff = _mm256_abs_epi32(coeff);
  123|  1.34M|  const __m256i zbin_mask = _mm256_cmpgt_epi32(abs_coeff, qp[0]);
  124|       |
  125|  1.34M|  if (UNLIKELY(_mm256_movemask_epi8(zbin_mask) == 0)) {
  ------------------
  |  |   55|  1.34M|#define UNLIKELY(v) __builtin_expect(v, 0)
  |  |  ------------------
  |  |  |  Branch (55:21): [True: 360k, False: 980k]
  |  |  ------------------
  ------------------
  126|   360k|    const __m256i zero = _mm256_setzero_si256();
  127|   360k|    _mm256_storeu_si256((__m256i *)qcoeff, zero);
  128|   360k|    _mm256_storeu_si256((__m256i *)dqcoeff, zero);
  129|   360k|    return;
  130|   360k|  }
  131|       |
  132|   980k|  const __m256i tmp_rnd =
  133|   980k|      _mm256_and_si256(_mm256_add_epi32(abs_coeff, qp[1]), zbin_mask);
  134|       |  // const int64_t tmp2 = ((tmpw * quant_ptr[rc != 0]) >> 16) + tmpw;
  135|   980k|  const __m256i tmp = mm256_mul_shift_epi32_logscale(&tmp_rnd, &qp[2], 0);
  136|   980k|  const __m256i tmp2 = _mm256_add_epi32(tmp, tmp_rnd);
  137|       |  // const int abs_qcoeff = (int)((tmp2 * quant_shift_ptr[rc != 0]) >>
  138|       |  //                              (16 - log_scale + AOM_QM_BITS));
  139|   980k|  const __m256i abs_q =
  140|   980k|      mm256_mul_shift_epi32_logscale(&tmp2, &qp[4], log_scale);
  141|   980k|  const __m256i abs_dq =
  142|   980k|      _mm256_srli_epi32(_mm256_mullo_epi32(abs_q, qp[3]), log_scale);
  143|   980k|  const __m256i nz_mask = _mm256_cmpgt_epi32(abs_q, _mm256_setzero_si256());
  144|   980k|  const __m256i q = _mm256_sign_epi32(abs_q, coeff);
  145|   980k|  const __m256i dq = _mm256_sign_epi32(abs_dq, coeff);
  146|       |
  147|   980k|  _mm256_storeu_si256((__m256i *)qcoeff, q);
  148|   980k|  _mm256_storeu_si256((__m256i *)dqcoeff, dq);
  149|       |
  150|   980k|  *eob = get_max_lane_eob(iscan_ptr, *eob, nz_mask);
  151|   980k|}
highbd_quantize_intrin_avx2.c:mm256_mul_shift_epi32_logscale:
  105|  1.96M|                                                               int log_scale) {
  106|  1.96M|  __m256i prod_lo = _mm256_mul_epi32(*x, *y);
  107|  1.96M|  __m256i prod_hi = _mm256_srli_epi64(*x, 32);
  108|  1.96M|  const __m256i mult_hi = _mm256_srli_epi64(*y, 32);
  109|  1.96M|  prod_hi = _mm256_mul_epi32(prod_hi, mult_hi);
  110|  1.96M|  prod_lo = _mm256_srli_epi64(prod_lo, 16 - log_scale);
  111|  1.96M|  const __m256i mask = _mm256_set_epi32(0, -1, 0, -1, 0, -1, 0, -1);
  112|  1.96M|  prod_lo = _mm256_and_si256(prod_lo, mask);
  113|  1.96M|  prod_hi = _mm256_srli_epi64(prod_hi, 16 - log_scale);
  114|  1.96M|  prod_hi = _mm256_slli_epi64(prod_hi, 32);
  115|  1.96M|  return _mm256_or_si256(prod_lo, prod_hi);
  116|  1.96M|}

aom_highbd_sad16x8_avx2:
  258|   146k|      int ref_stride) {                                                     \
  259|   146k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|   146k|  }
aom_highbd_sad16x16_avx2:
  258|  82.1k|      int ref_stride) {                                                     \
  259|  82.1k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  82.1k|  }
aom_highbd_sad16x32_avx2:
  258|  39.8k|      int ref_stride) {                                                     \
  259|  39.8k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  39.8k|  }
aom_highbd_sad32x16_avx2:
  258|  44.8k|      int ref_stride) {                                                     \
  259|  44.8k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  44.8k|  }
aom_highbd_sad32x32_avx2:
  258|  33.3k|      int ref_stride) {                                                     \
  259|  33.3k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  33.3k|  }
aom_highbd_sad32x64_avx2:
  258|  19.0k|      int ref_stride) {                                                     \
  259|  19.0k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  19.0k|  }
aom_highbd_sad64x32_avx2:
  258|  17.7k|      int ref_stride) {                                                     \
  259|  17.7k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  17.7k|  }
aom_highbd_sad64x64_avx2:
  258|  22.6k|      int ref_stride) {                                                     \
  259|  22.6k|    return aom_highbd_sad##m##xN_avx2(n, src, src_stride, ref, ref_stride); \
  260|  22.6k|  }
aom_highbd_sad_skip_16x16_avx2:
  265|   249k|      int ref_stride) {                                                      \
  266|   249k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|   249k|                                          2 * ref_stride);                   \
  268|   249k|  }
aom_highbd_sad_skip_16x32_avx2:
  265|   135k|      int ref_stride) {                                                      \
  266|   135k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|   135k|                                          2 * ref_stride);                   \
  268|   135k|  }
aom_highbd_sad_skip_32x16_avx2:
  265|   122k|      int ref_stride) {                                                      \
  266|   122k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|   122k|                                          2 * ref_stride);                   \
  268|   122k|  }
aom_highbd_sad_skip_32x32_avx2:
  265|   116k|      int ref_stride) {                                                      \
  266|   116k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|   116k|                                          2 * ref_stride);                   \
  268|   116k|  }
aom_highbd_sad_skip_32x64_avx2:
  265|  66.5k|      int ref_stride) {                                                      \
  266|  66.5k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|  66.5k|                                          2 * ref_stride);                   \
  268|  66.5k|  }
aom_highbd_sad_skip_64x32_avx2:
  265|  62.1k|      int ref_stride) {                                                      \
  266|  62.1k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|  62.1k|                                          2 * ref_stride);                   \
  268|  62.1k|  }
aom_highbd_sad_skip_64x64_avx2:
  265|  44.2k|      int ref_stride) {                                                      \
  266|  44.2k|    return 2 * aom_highbd_sad##m##xN_avx2((n / 2), src, 2 * src_stride, ref, \
  267|  44.2k|                                          2 * ref_stride);                   \
  268|  44.2k|  }
aom_highbd_sad16x8x4d_avx2:
  639|   411k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|   411k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|   411k|                             sad_array);                                      \
  642|   411k|  }
aom_highbd_sad16x16x4d_avx2:
  639|  55.8k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  55.8k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  55.8k|                             sad_array);                                      \
  642|  55.8k|  }
aom_highbd_sad16x32x4d_avx2:
  639|  8.27k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  8.27k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  8.27k|                             sad_array);                                      \
  642|  8.27k|  }
aom_highbd_sad32x16x4d_avx2:
  639|  43.5k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  43.5k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  43.5k|                             sad_array);                                      \
  642|  43.5k|  }
aom_highbd_sad32x32x4d_avx2:
  639|  15.9k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  15.9k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  15.9k|                             sad_array);                                      \
  642|  15.9k|  }
aom_highbd_sad32x64x4d_avx2:
  639|  3.96k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  3.96k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  3.96k|                             sad_array);                                      \
  642|  3.96k|  }
aom_highbd_sad64x32x4d_avx2:
  639|  17.7k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  17.7k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  17.7k|                             sad_array);                                      \
  642|  17.7k|  }
aom_highbd_sad64x64x4d_avx2:
  639|  1.71k|      int ref_stride, uint32_t sad_array[4]) {                                \
  640|  1.71k|    aom_highbd_sadMxNxD_avx2(m, n, 4, src, src_stride, ref_array, ref_stride, \
  641|  1.71k|                             sad_array);                                      \
  642|  1.71k|  }
aom_highbd_sad_skip_16x16x4d_avx2:
  646|   371k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|   371k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|   371k|                             2 * ref_stride, sad_array);                     \
  649|   371k|    sad_array[0] <<= 1;                                                      \
  650|   371k|    sad_array[1] <<= 1;                                                      \
  651|   371k|    sad_array[2] <<= 1;                                                      \
  652|   371k|    sad_array[3] <<= 1;                                                      \
  653|   371k|  }
aom_highbd_sad_skip_16x32x4d_avx2:
  646|   197k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|   197k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|   197k|                             2 * ref_stride, sad_array);                     \
  649|   197k|    sad_array[0] <<= 1;                                                      \
  650|   197k|    sad_array[1] <<= 1;                                                      \
  651|   197k|    sad_array[2] <<= 1;                                                      \
  652|   197k|    sad_array[3] <<= 1;                                                      \
  653|   197k|  }
aom_highbd_sad_skip_32x16x4d_avx2:
  646|   156k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|   156k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|   156k|                             2 * ref_stride, sad_array);                     \
  649|   156k|    sad_array[0] <<= 1;                                                      \
  650|   156k|    sad_array[1] <<= 1;                                                      \
  651|   156k|    sad_array[2] <<= 1;                                                      \
  652|   156k|    sad_array[3] <<= 1;                                                      \
  653|   156k|  }
aom_highbd_sad_skip_32x32x4d_avx2:
  646|   202k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|   202k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|   202k|                             2 * ref_stride, sad_array);                     \
  649|   202k|    sad_array[0] <<= 1;                                                      \
  650|   202k|    sad_array[1] <<= 1;                                                      \
  651|   202k|    sad_array[2] <<= 1;                                                      \
  652|   202k|    sad_array[3] <<= 1;                                                      \
  653|   202k|  }
aom_highbd_sad_skip_32x64x4d_avx2:
  646|  95.8k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|  95.8k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|  95.8k|                             2 * ref_stride, sad_array);                     \
  649|  95.8k|    sad_array[0] <<= 1;                                                      \
  650|  95.8k|    sad_array[1] <<= 1;                                                      \
  651|  95.8k|    sad_array[2] <<= 1;                                                      \
  652|  95.8k|    sad_array[3] <<= 1;                                                      \
  653|  95.8k|  }
aom_highbd_sad_skip_64x32x4d_avx2:
  646|  79.3k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|  79.3k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|  79.3k|                             2 * ref_stride, sad_array);                     \
  649|  79.3k|    sad_array[0] <<= 1;                                                      \
  650|  79.3k|    sad_array[1] <<= 1;                                                      \
  651|  79.3k|    sad_array[2] <<= 1;                                                      \
  652|  79.3k|    sad_array[3] <<= 1;                                                      \
  653|  79.3k|  }
aom_highbd_sad_skip_64x64x4d_avx2:
  646|  91.0k|      int ref_stride, uint32_t sad_array[4]) {                               \
  647|  91.0k|    aom_highbd_sadMxNxD_avx2(m, (n / 2), 4, src, 2 * src_stride, ref_array,  \
  648|  91.0k|                             2 * ref_stride, sad_array);                     \
  649|  91.0k|    sad_array[0] <<= 1;                                                      \
  650|  91.0k|    sad_array[1] <<= 1;                                                      \
  651|  91.0k|    sad_array[2] <<= 1;                                                      \
  652|  91.0k|    sad_array[3] <<= 1;                                                      \
  653|  91.0k|  }
aom_highbd_sad16x8x3d_avx2:
  657|  4.55k|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|  4.55k|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|  4.55k|                             sad_array);                                      \
  660|  4.55k|  }
aom_highbd_sad16x16x3d_avx2:
  657|  12.4k|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|  12.4k|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|  12.4k|                             sad_array);                                      \
  660|  12.4k|  }
aom_highbd_sad16x32x3d_avx2:
  657|     98|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|     98|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|     98|                             sad_array);                                      \
  660|     98|  }
aom_highbd_sad32x16x3d_avx2:
  657|    120|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|    120|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|    120|                             sad_array);                                      \
  660|    120|  }
aom_highbd_sad32x32x3d_avx2:
  657|    268|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|    268|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|    268|                             sad_array);                                      \
  660|    268|  }
aom_highbd_sad64x64x3d_avx2:
  657|  1.18k|      int ref_stride, uint32_t sad_array[4]) {                                \
  658|  1.18k|    aom_highbd_sadMxNxD_avx2(m, n, 3, src, src_stride, ref_array, ref_stride, \
  659|  1.18k|                             sad_array);                                      \
  660|  1.18k|  }
highbd_sad_avx2.c:aom_highbd_sad16xN_avx2:
   91|   653k|                                                             int ref_stride) {
   92|   653k|  const uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|   653k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   93|   653k|  const uint16_t *ref_ptr = CONVERT_TO_SHORTPTR(ref);
  ------------------
  |  |   79|   653k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   94|   653k|  int i;
   95|   653k|  __m256i sad = _mm256_setzero_si256();
   96|  2.63M|  for (i = 0; i < N; i += 4) {
  ------------------
  |  Branch (96:15): [True: 1.97M, False: 653k]
  ------------------
   97|       |    sad16x4(src_ptr, src_stride, ref_ptr, ref_stride, NULL, &sad);
   98|  1.97M|    src_ptr += src_stride << 2;
   99|  1.97M|    ref_ptr += ref_stride << 2;
  100|  1.97M|  }
  101|   653k|  return (unsigned int)get_sad_from_mm256_epi32(&sad);
  102|   653k|}
highbd_sad_avx2.c:aom_highbd_sad32xN_avx2:
  144|   402k|                                                             int ref_stride) {
  145|   402k|  __m256i sad = _mm256_setzero_si256();
  146|   402k|  uint16_t *srcp = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|   402k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  147|   402k|  uint16_t *refp = CONVERT_TO_SHORTPTR(ref);
  ------------------
  |  |   79|   402k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  148|   402k|  const int left_shift = 2;
  149|   402k|  int i;
  150|       |
  151|  2.39M|  for (i = 0; i < N; i += 4) {
  ------------------
  |  Branch (151:15): [True: 1.98M, False: 402k]
  ------------------
  152|       |    sad32x4(srcp, src_stride, refp, ref_stride, NULL, &sad);
  153|  1.98M|    srcp += src_stride << left_shift;
  154|  1.98M|    refp += ref_stride << left_shift;
  155|  1.98M|  }
  156|   402k|  return get_sad_from_mm256_epi32(&sad);
  157|   402k|}
highbd_sad_avx2.c:aom_highbd_sad64xN_avx2:
  195|   146k|                                                             int ref_stride) {
  196|   146k|  __m256i sad = _mm256_setzero_si256();
  197|   146k|  uint16_t *srcp = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|   146k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  198|   146k|  uint16_t *refp = CONVERT_TO_SHORTPTR(ref);
  ------------------
  |  |   79|   146k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  199|   146k|  const int left_shift = 1;
  200|   146k|  int i;
  201|  2.34M|  for (i = 0; i < N; i += 2) {
  ------------------
  |  Branch (201:15): [True: 2.20M, False: 146k]
  ------------------
  202|       |    sad64x2(srcp, src_stride, refp, ref_stride, NULL, &sad);
  203|  2.20M|    srcp += src_stride << left_shift;
  204|  2.20M|    refp += ref_stride << left_shift;
  205|  2.20M|  }
  206|   146k|  return get_sad_from_mm256_epi32(&sad);
  207|   146k|}
highbd_sad_avx2.c:sad16x4:
   63|  12.7M|                           const uint16_t *sec_ptr, __m256i *sad_acc) {
   64|  12.7M|  __m256i s[4], r[4];
   65|  12.7M|  s[0] = _mm256_loadu_si256((const __m256i *)src_ptr);
   66|  12.7M|  s[1] = _mm256_loadu_si256((const __m256i *)(src_ptr + src_stride));
   67|  12.7M|  s[2] = _mm256_loadu_si256((const __m256i *)(src_ptr + 2 * src_stride));
   68|  12.7M|  s[3] = _mm256_loadu_si256((const __m256i *)(src_ptr + 3 * src_stride));
   69|       |
   70|  12.7M|  r[0] = _mm256_loadu_si256((const __m256i *)ref_ptr);
   71|  12.7M|  r[1] = _mm256_loadu_si256((const __m256i *)(ref_ptr + ref_stride));
   72|  12.7M|  r[2] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 2 * ref_stride));
   73|  12.7M|  r[3] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 3 * ref_stride));
   74|       |
   75|  12.7M|  if (sec_ptr) {
  ------------------
  |  Branch (75:7): [True: 0, False: 12.7M]
  ------------------
   76|      0|    r[0] = _mm256_avg_epu16(r[0], _mm256_loadu_si256((const __m256i *)sec_ptr));
   77|      0|    r[1] = _mm256_avg_epu16(
   78|      0|        r[1], _mm256_loadu_si256((const __m256i *)(sec_ptr + 16)));
   79|      0|    r[2] = _mm256_avg_epu16(
   80|      0|        r[2], _mm256_loadu_si256((const __m256i *)(sec_ptr + 32)));
   81|      0|    r[3] = _mm256_avg_epu16(
   82|      0|        r[3], _mm256_loadu_si256((const __m256i *)(sec_ptr + 48)));
   83|      0|  }
   84|  12.7M|  highbd_sad16x4_core_avx2(s, r, sad_acc);
   85|  12.7M|}
highbd_sad_avx2.c:highbd_sad16x4_core_avx2:
   41|  57.1M|                                            __m256i *sad_acc) {
   42|  57.1M|  const __m256i zero = _mm256_setzero_si256();
   43|  57.1M|  int i;
   44|   285M|  for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (44:15): [True: 228M, False: 57.1M]
  ------------------
   45|   228M|    s[i] = _mm256_sub_epi16(s[i], r[i]);
   46|   228M|    s[i] = _mm256_abs_epi16(s[i]);
   47|   228M|  }
   48|       |
   49|  57.1M|  s[0] = _mm256_add_epi16(s[0], s[1]);
   50|  57.1M|  s[0] = _mm256_add_epi16(s[0], s[2]);
   51|  57.1M|  s[0] = _mm256_add_epi16(s[0], s[3]);
   52|       |
   53|  57.1M|  r[0] = _mm256_unpacklo_epi16(s[0], zero);
   54|  57.1M|  r[1] = _mm256_unpackhi_epi16(s[0], zero);
   55|       |
   56|  57.1M|  r[0] = _mm256_add_epi32(r[0], r[1]);
   57|  57.1M|  *sad_acc = _mm256_add_epi32(*sad_acc, r[0]);
   58|  57.1M|}
highbd_sad_avx2.c:get_sad_from_mm256_epi32:
   22|  1.20M|static inline unsigned int get_sad_from_mm256_epi32(const __m256i *v) {
   23|       |  // input 8 32-bit summation
   24|  1.20M|  __m128i lo128, hi128;
   25|  1.20M|  __m256i u = _mm256_srli_si256(*v, 8);
   26|  1.20M|  u = _mm256_add_epi32(u, *v);
   27|       |
   28|       |  // 4 32-bit summation
   29|  1.20M|  hi128 = _mm256_extracti128_si256(u, 1);
   30|  1.20M|  lo128 = _mm256_castsi256_si128(u);
   31|  1.20M|  lo128 = _mm_add_epi32(hi128, lo128);
   32|       |
   33|       |  // 2 32-bit summation
   34|  1.20M|  hi128 = _mm_srli_si128(lo128, 4);
   35|  1.20M|  lo128 = _mm_add_epi32(lo128, hi128);
   36|       |
   37|  1.20M|  return (unsigned int)_mm_cvtsi128_si32(lo128);
   38|  1.20M|}
highbd_sad_avx2.c:sad32x4:
  106|  10.8M|                    const uint16_t *sec_ptr, __m256i *sad_acc) {
  107|  10.8M|  __m256i s[4], r[4];
  108|  10.8M|  int row_sections = 0;
  109|       |
  110|  32.5M|  while (row_sections < 2) {
  ------------------
  |  Branch (110:10): [True: 21.7M, False: 10.8M]
  ------------------
  111|  21.7M|    s[0] = _mm256_loadu_si256((const __m256i *)src_ptr);
  112|  21.7M|    s[1] = _mm256_loadu_si256((const __m256i *)(src_ptr + 16));
  113|  21.7M|    s[2] = _mm256_loadu_si256((const __m256i *)(src_ptr + src_stride));
  114|  21.7M|    s[3] = _mm256_loadu_si256((const __m256i *)(src_ptr + src_stride + 16));
  115|       |
  116|  21.7M|    r[0] = _mm256_loadu_si256((const __m256i *)ref_ptr);
  117|  21.7M|    r[1] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 16));
  118|  21.7M|    r[2] = _mm256_loadu_si256((const __m256i *)(ref_ptr + ref_stride));
  119|  21.7M|    r[3] = _mm256_loadu_si256((const __m256i *)(ref_ptr + ref_stride + 16));
  120|       |
  121|  21.7M|    if (sec_ptr) {
  ------------------
  |  Branch (121:9): [True: 0, False: 21.7M]
  ------------------
  122|      0|      r[0] =
  123|      0|          _mm256_avg_epu16(r[0], _mm256_loadu_si256((const __m256i *)sec_ptr));
  124|      0|      r[1] = _mm256_avg_epu16(
  125|      0|          r[1], _mm256_loadu_si256((const __m256i *)(sec_ptr + 16)));
  126|      0|      r[2] = _mm256_avg_epu16(
  127|      0|          r[2], _mm256_loadu_si256((const __m256i *)(sec_ptr + 32)));
  128|      0|      r[3] = _mm256_avg_epu16(
  129|      0|          r[3], _mm256_loadu_si256((const __m256i *)(sec_ptr + 48)));
  130|      0|      sec_ptr += 32 << 1;
  131|      0|    }
  132|  21.7M|    highbd_sad16x4_core_avx2(s, r, sad_acc);
  133|       |
  134|  21.7M|    row_sections += 1;
  135|  21.7M|    src_ptr += src_stride << 1;
  136|  21.7M|    ref_ptr += ref_stride << 1;
  137|  21.7M|  }
  138|  10.8M|}
highbd_sad_avx2.c:sad64x2:
  161|  11.7M|                    const uint16_t *sec_ptr, __m256i *sad_acc) {
  162|  11.7M|  __m256i s[4], r[4];
  163|  11.7M|  int i;
  164|  35.3M|  for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (164:15): [True: 23.5M, False: 11.7M]
  ------------------
  165|  23.5M|    s[0] = _mm256_loadu_si256((const __m256i *)src_ptr);
  166|  23.5M|    s[1] = _mm256_loadu_si256((const __m256i *)(src_ptr + 16));
  167|  23.5M|    s[2] = _mm256_loadu_si256((const __m256i *)(src_ptr + 32));
  168|  23.5M|    s[3] = _mm256_loadu_si256((const __m256i *)(src_ptr + 48));
  169|       |
  170|  23.5M|    r[0] = _mm256_loadu_si256((const __m256i *)ref_ptr);
  171|  23.5M|    r[1] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 16));
  172|  23.5M|    r[2] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 32));
  173|  23.5M|    r[3] = _mm256_loadu_si256((const __m256i *)(ref_ptr + 48));
  174|  23.5M|    if (sec_ptr) {
  ------------------
  |  Branch (174:9): [True: 0, False: 23.5M]
  ------------------
  175|      0|      r[0] =
  176|      0|          _mm256_avg_epu16(r[0], _mm256_loadu_si256((const __m256i *)sec_ptr));
  177|      0|      r[1] = _mm256_avg_epu16(
  178|      0|          r[1], _mm256_loadu_si256((const __m256i *)(sec_ptr + 16)));
  179|      0|      r[2] = _mm256_avg_epu16(
  180|      0|          r[2], _mm256_loadu_si256((const __m256i *)(sec_ptr + 32)));
  181|      0|      r[3] = _mm256_avg_epu16(
  182|      0|          r[3], _mm256_loadu_si256((const __m256i *)(sec_ptr + 48)));
  183|      0|      sec_ptr += 64;
  184|      0|    }
  185|  23.5M|    highbd_sad16x4_core_avx2(s, r, sad_acc);
  186|  23.5M|    src_ptr += src_stride;
  187|  23.5M|    ref_ptr += ref_stride;
  188|  23.5M|  }
  189|  11.7M|}
highbd_sad_avx2.c:aom_highbd_sadMxNxD_avx2:
  603|  1.76M|    const uint8_t *const ref_array[4], int ref_stride, uint32_t sad_array[4]) {
  604|  1.76M|  __m256i sad_vec[4];
  605|  1.76M|  const uint16_t *refp[4];
  606|  1.76M|  const uint16_t *keep = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|  1.76M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  607|  1.76M|  const uint16_t *srcp;
  608|  1.76M|  const int shift_for_rows = (M < 128) + (M < 64);
  609|  1.76M|  const int row_units = 1 << shift_for_rows;
  610|  1.76M|  int i, r;
  611|       |
  612|  1.76M|  init_sad(sad_vec);
  613|  1.76M|  convert_pointers(ref_array, refp);
  614|       |
  615|  8.76M|  for (i = 0; i < D; ++i) {
  ------------------
  |  Branch (615:15): [True: 6.99M, False: 1.76M]
  ------------------
  616|  6.99M|    srcp = keep;
  617|  36.1M|    for (r = 0; r < N; r += row_units) {
  ------------------
  |  Branch (617:17): [True: 29.1M, False: 6.99M]
  ------------------
  618|  29.1M|      if (M == 128) {
  ------------------
  |  Branch (618:11): [True: 0, False: 29.1M]
  ------------------
  619|      0|        sad128x1(srcp, refp[i], NULL, &sad_vec[i]);
  620|  29.1M|      } else if (M == 64) {
  ------------------
  |  Branch (620:18): [True: 9.70M, False: 19.4M]
  ------------------
  621|  9.70M|        sad64x2(srcp, src_stride, refp[i], ref_stride, NULL, &sad_vec[i]);
  622|  19.4M|      } else if (M == 32) {
  ------------------
  |  Branch (622:18): [True: 8.95M, False: 10.5M]
  ------------------
  623|  8.95M|        sad32x4(srcp, src_stride, refp[i], ref_stride, 0, &sad_vec[i]);
  624|  10.7M|      } else if (M == 16) {
  ------------------
  |  Branch (624:18): [True: 10.7M, False: 18.4E]
  ------------------
  625|  10.7M|        sad16x4(srcp, src_stride, refp[i], ref_stride, 0, &sad_vec[i]);
  626|  18.4E|      } else {
  627|       |        assert(0);
  628|  18.4E|      }
  629|  29.1M|      srcp += src_stride << shift_for_rows;
  630|  29.1M|      refp[i] += ref_stride << shift_for_rows;
  631|  29.1M|    }
  632|  6.99M|  }
  633|  1.76M|  get_4d_sad_from_mm256_epi32(sad_vec, sad_array);
  634|  1.76M|}
highbd_sad_avx2.c:init_sad:
  594|  1.76M|static void init_sad(__m256i *s) {
  595|  1.76M|  s[0] = _mm256_setzero_si256();
  596|  1.76M|  s[1] = _mm256_setzero_si256();
  597|  1.76M|  s[2] = _mm256_setzero_si256();
  598|  1.76M|  s[3] = _mm256_setzero_si256();
  599|  1.76M|}
highbd_sad_avx2.c:convert_pointers:
  587|  1.76M|                             const uint16_t *ref[]) {
  588|  1.76M|  ref[0] = CONVERT_TO_SHORTPTR(ref8[0]);
  ------------------
  |  |   79|  1.76M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  589|  1.76M|  ref[1] = CONVERT_TO_SHORTPTR(ref8[1]);
  ------------------
  |  |   79|  1.76M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  590|  1.76M|  ref[2] = CONVERT_TO_SHORTPTR(ref8[2]);
  ------------------
  |  |   79|  1.76M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  591|  1.76M|  ref[3] = CONVERT_TO_SHORTPTR(ref8[3]);
  ------------------
  |  |   79|  1.76M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  592|  1.76M|}
highbd_sad_avx2.c:get_4d_sad_from_mm256_epi32:
  548|  1.76M|                                               uint32_t *res) {
  549|  1.76M|  __m256i u0, u1, u2, u3;
  550|  1.76M|  const __m256i mask = _mm256_set1_epi64x(~0u);
  551|  1.76M|  __m128i sad;
  552|       |
  553|       |  // 8 32-bit summation
  554|  1.76M|  u0 = _mm256_srli_si256(v[0], 4);
  555|  1.76M|  u1 = _mm256_srli_si256(v[1], 4);
  556|  1.76M|  u2 = _mm256_srli_si256(v[2], 4);
  557|  1.76M|  u3 = _mm256_srli_si256(v[3], 4);
  558|       |
  559|  1.76M|  u0 = _mm256_add_epi32(u0, v[0]);
  560|  1.76M|  u1 = _mm256_add_epi32(u1, v[1]);
  561|  1.76M|  u2 = _mm256_add_epi32(u2, v[2]);
  562|  1.76M|  u3 = _mm256_add_epi32(u3, v[3]);
  563|       |
  564|  1.76M|  u0 = _mm256_and_si256(u0, mask);
  565|  1.76M|  u1 = _mm256_and_si256(u1, mask);
  566|  1.76M|  u2 = _mm256_and_si256(u2, mask);
  567|  1.76M|  u3 = _mm256_and_si256(u3, mask);
  568|       |  // 4 32-bit summation, evenly positioned
  569|       |
  570|  1.76M|  u1 = _mm256_slli_si256(u1, 4);
  571|  1.76M|  u3 = _mm256_slli_si256(u3, 4);
  572|       |
  573|  1.76M|  u0 = _mm256_or_si256(u0, u1);
  574|  1.76M|  u2 = _mm256_or_si256(u2, u3);
  575|       |  // 8 32-bit summation, interleaved
  576|       |
  577|  1.76M|  u1 = _mm256_unpacklo_epi64(u0, u2);
  578|  1.76M|  u3 = _mm256_unpackhi_epi64(u0, u2);
  579|       |
  580|  1.76M|  u0 = _mm256_add_epi32(u1, u3);
  581|       |  sad = _mm_add_epi32(_mm256_extractf128_si256(u0, 1),
  582|  1.76M|                      _mm256_castsi256_si128(u0));
  583|  1.76M|  _mm_storeu_si128((__m128i *)res, sad);
  584|  1.76M|}

aom_highbd_subtract_block_sse2:
  259|  37.5M|                                    ptrdiff_t pred_stride) {
  260|  37.5M|  uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  37.5M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  261|  37.5M|  uint16_t *pred = CONVERT_TO_SHORTPTR(pred8);
  ------------------
  |  |   79|  37.5M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  262|  37.5M|  SubtractWxHFuncType func;
  263|       |
  264|  37.5M|  func = getSubtractFunc(rows, cols);
  265|  37.5M|  func(diff, diff_stride, src, src_stride, pred, pred_stride);
  266|  37.5M|}
highbd_subtract_sse2.c:getSubtractFunc:
  217|  37.5M|static SubtractWxHFuncType getSubtractFunc(int rows, int cols) {
  218|  37.5M|  if (rows == 4) {
  ------------------
  |  Branch (218:7): [True: 26.2M, False: 11.2M]
  ------------------
  219|  26.2M|    if (cols == 4) return subtract_4x4;
  ------------------
  |  Branch (219:9): [True: 24.1M, False: 2.01M]
  ------------------
  220|  2.02M|    if (cols == 8) return subtract_8x4;
  ------------------
  |  Branch (220:9): [True: 2.02M, False: 18.4E]
  ------------------
  221|  18.4E|    if (cols == 16) return subtract_16x4;
  ------------------
  |  Branch (221:9): [True: 0, False: 18.4E]
  ------------------
  222|  18.4E|  }
  223|  11.2M|  if (rows == 8) {
  ------------------
  |  Branch (223:7): [True: 10.6M, False: 601k]
  ------------------
  224|  10.6M|    if (cols == 4) return subtract_4x8;
  ------------------
  |  Branch (224:9): [True: 3.14M, False: 7.53M]
  ------------------
  225|  7.53M|    if (cols == 8) return subtract_8x8;
  ------------------
  |  Branch (225:9): [True: 7.24M, False: 290k]
  ------------------
  226|   296k|    if (cols == 16) return subtract_16x8;
  ------------------
  |  Branch (226:9): [True: 296k, False: 18.4E]
  ------------------
  227|  18.4E|    if (cols == 32) return subtract_32x8;
  ------------------
  |  Branch (227:9): [True: 0, False: 18.4E]
  ------------------
  228|  18.4E|  }
  229|   603k|  if (rows == 16) {
  ------------------
  |  Branch (229:7): [True: 603k, False: 18.4E]
  ------------------
  230|   603k|    if (cols == 4) return subtract_4x16;
  ------------------
  |  Branch (230:9): [True: 0, False: 603k]
  ------------------
  231|   603k|    if (cols == 8) return subtract_8x16;
  ------------------
  |  Branch (231:9): [True: 316k, False: 286k]
  ------------------
  232|   286k|    if (cols == 16) return subtract_16x16;
  ------------------
  |  Branch (232:9): [True: 248k, False: 38.4k]
  ------------------
  233|  38.5k|    if (cols == 32) return subtract_32x16;
  ------------------
  |  Branch (233:9): [True: 38.5k, False: 18.4E]
  ------------------
  234|  18.4E|    if (cols == 64) return subtract_64x16;
  ------------------
  |  Branch (234:9): [True: 0, False: 18.4E]
  ------------------
  235|  18.4E|  }
  236|  18.4E|  if (rows == 32) {
  ------------------
  |  Branch (236:7): [True: 57.1k, False: 18.4E]
  ------------------
  237|  57.1k|    if (cols == 8) return subtract_8x32;
  ------------------
  |  Branch (237:9): [True: 0, False: 57.1k]
  ------------------
  238|  57.1k|    if (cols == 16) return subtract_16x32;
  ------------------
  |  Branch (238:9): [True: 29.7k, False: 27.4k]
  ------------------
  239|  27.4k|    if (cols == 32) return subtract_32x32;
  ------------------
  |  Branch (239:9): [True: 24.5k, False: 2.85k]
  ------------------
  240|  2.85k|    if (cols == 64) return subtract_64x32;
  ------------------
  |  Branch (240:9): [True: 2.85k, False: 18.4E]
  ------------------
  241|  2.85k|  }
  242|  18.4E|  if (rows == 64) {
  ------------------
  |  Branch (242:7): [True: 4.59k, False: 18.4E]
  ------------------
  243|  4.59k|    if (cols == 16) return subtract_16x64;
  ------------------
  |  Branch (243:9): [True: 0, False: 4.59k]
  ------------------
  244|  4.59k|    if (cols == 32) return subtract_32x64;
  ------------------
  |  Branch (244:9): [True: 3.08k, False: 1.51k]
  ------------------
  245|  1.51k|    if (cols == 64) return subtract_64x64;
  ------------------
  |  Branch (245:9): [True: 1.51k, False: 0]
  ------------------
  246|      0|    if (cols == 128) return subtract_128x64;
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|  }
  248|  18.4E|  if (rows == 128) {
  ------------------
  |  Branch (248:7): [True: 0, False: 18.4E]
  ------------------
  249|      0|    if (cols == 64) return subtract_64x128;
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|    if (cols == 128) return subtract_128x128;
  ------------------
  |  Branch (250:9): [True: 0, False: 0]
  ------------------
  251|      0|  }
  252|  18.4E|  assert(0);
  253|       |  return NULL;
  254|  18.4E|}
highbd_subtract_sse2.c:subtract_4x4:
   26|  24.1M|                         const uint16_t *pred, ptrdiff_t pred_stride) {
   27|  24.1M|  __m128i u0, u1, u2, u3;
   28|  24.1M|  __m128i v0, v1, v2, v3;
   29|  24.1M|  __m128i x0, x1, x2, x3;
   30|  24.1M|  int64_t *store_diff = (int64_t *)(diff + 0 * diff_stride);
   31|       |
   32|  24.1M|  u0 = _mm_loadl_epi64((__m128i const *)(src + 0 * src_stride));
   33|  24.1M|  u1 = _mm_loadl_epi64((__m128i const *)(src + 1 * src_stride));
   34|  24.1M|  u2 = _mm_loadl_epi64((__m128i const *)(src + 2 * src_stride));
   35|  24.1M|  u3 = _mm_loadl_epi64((__m128i const *)(src + 3 * src_stride));
   36|       |
   37|  24.1M|  v0 = _mm_loadl_epi64((__m128i const *)(pred + 0 * pred_stride));
   38|  24.1M|  v1 = _mm_loadl_epi64((__m128i const *)(pred + 1 * pred_stride));
   39|  24.1M|  v2 = _mm_loadl_epi64((__m128i const *)(pred + 2 * pred_stride));
   40|  24.1M|  v3 = _mm_loadl_epi64((__m128i const *)(pred + 3 * pred_stride));
   41|       |
   42|  24.1M|  x0 = _mm_sub_epi16(u0, v0);
   43|  24.1M|  x1 = _mm_sub_epi16(u1, v1);
   44|  24.1M|  x2 = _mm_sub_epi16(u2, v2);
   45|  24.1M|  x3 = _mm_sub_epi16(u3, v3);
   46|       |
   47|  24.1M|  _mm_storel_epi64((__m128i *)store_diff, x0);
   48|  24.1M|  store_diff = (int64_t *)(diff + 1 * diff_stride);
   49|  24.1M|  _mm_storel_epi64((__m128i *)store_diff, x1);
   50|  24.1M|  store_diff = (int64_t *)(diff + 2 * diff_stride);
   51|  24.1M|  _mm_storel_epi64((__m128i *)store_diff, x2);
   52|  24.1M|  store_diff = (int64_t *)(diff + 3 * diff_stride);
   53|  24.1M|  _mm_storel_epi64((__m128i *)store_diff, x3);
   54|  24.1M|}
highbd_subtract_sse2.c:subtract_8x4:
  110|  2.02M|                         const uint16_t *pred, ptrdiff_t pred_stride) {
  111|  2.02M|  __m128i u0, u1, u2, u3;
  112|  2.02M|  __m128i v0, v1, v2, v3;
  113|  2.02M|  __m128i x0, x1, x2, x3;
  114|       |
  115|  2.02M|  u0 = _mm_loadu_si128((__m128i const *)(src + 0 * src_stride));
  116|  2.02M|  u1 = _mm_loadu_si128((__m128i const *)(src + 1 * src_stride));
  117|  2.02M|  u2 = _mm_loadu_si128((__m128i const *)(src + 2 * src_stride));
  118|  2.02M|  u3 = _mm_loadu_si128((__m128i const *)(src + 3 * src_stride));
  119|       |
  120|  2.02M|  v0 = _mm_loadu_si128((__m128i const *)(pred + 0 * pred_stride));
  121|  2.02M|  v1 = _mm_loadu_si128((__m128i const *)(pred + 1 * pred_stride));
  122|  2.02M|  v2 = _mm_loadu_si128((__m128i const *)(pred + 2 * pred_stride));
  123|  2.02M|  v3 = _mm_loadu_si128((__m128i const *)(pred + 3 * pred_stride));
  124|       |
  125|  2.02M|  x0 = _mm_sub_epi16(u0, v0);
  126|  2.02M|  x1 = _mm_sub_epi16(u1, v1);
  127|  2.02M|  x2 = _mm_sub_epi16(u2, v2);
  128|  2.02M|  x3 = _mm_sub_epi16(u3, v3);
  129|       |
  130|  2.02M|  _mm_storeu_si128((__m128i *)(diff + 0 * diff_stride), x0);
  131|  2.02M|  _mm_storeu_si128((__m128i *)(diff + 1 * diff_stride), x1);
  132|  2.02M|  _mm_storeu_si128((__m128i *)(diff + 2 * diff_stride), x2);
  133|  2.02M|  _mm_storeu_si128((__m128i *)(diff + 3 * diff_stride), x3);
  134|  2.02M|}
highbd_subtract_sse2.c:subtract_4x8:
   58|  3.14M|                         const uint16_t *pred, ptrdiff_t pred_stride) {
   59|  3.14M|  __m128i u0, u1, u2, u3, u4, u5, u6, u7;
   60|  3.14M|  __m128i v0, v1, v2, v3, v4, v5, v6, v7;
   61|  3.14M|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
   62|  3.14M|  int64_t *store_diff = (int64_t *)(diff + 0 * diff_stride);
   63|       |
   64|  3.14M|  u0 = _mm_loadl_epi64((__m128i const *)(src + 0 * src_stride));
   65|  3.14M|  u1 = _mm_loadl_epi64((__m128i const *)(src + 1 * src_stride));
   66|  3.14M|  u2 = _mm_loadl_epi64((__m128i const *)(src + 2 * src_stride));
   67|  3.14M|  u3 = _mm_loadl_epi64((__m128i const *)(src + 3 * src_stride));
   68|  3.14M|  u4 = _mm_loadl_epi64((__m128i const *)(src + 4 * src_stride));
   69|  3.14M|  u5 = _mm_loadl_epi64((__m128i const *)(src + 5 * src_stride));
   70|  3.14M|  u6 = _mm_loadl_epi64((__m128i const *)(src + 6 * src_stride));
   71|  3.14M|  u7 = _mm_loadl_epi64((__m128i const *)(src + 7 * src_stride));
   72|       |
   73|  3.14M|  v0 = _mm_loadl_epi64((__m128i const *)(pred + 0 * pred_stride));
   74|  3.14M|  v1 = _mm_loadl_epi64((__m128i const *)(pred + 1 * pred_stride));
   75|  3.14M|  v2 = _mm_loadl_epi64((__m128i const *)(pred + 2 * pred_stride));
   76|  3.14M|  v3 = _mm_loadl_epi64((__m128i const *)(pred + 3 * pred_stride));
   77|  3.14M|  v4 = _mm_loadl_epi64((__m128i const *)(pred + 4 * pred_stride));
   78|  3.14M|  v5 = _mm_loadl_epi64((__m128i const *)(pred + 5 * pred_stride));
   79|  3.14M|  v6 = _mm_loadl_epi64((__m128i const *)(pred + 6 * pred_stride));
   80|  3.14M|  v7 = _mm_loadl_epi64((__m128i const *)(pred + 7 * pred_stride));
   81|       |
   82|  3.14M|  x0 = _mm_sub_epi16(u0, v0);
   83|  3.14M|  x1 = _mm_sub_epi16(u1, v1);
   84|  3.14M|  x2 = _mm_sub_epi16(u2, v2);
   85|  3.14M|  x3 = _mm_sub_epi16(u3, v3);
   86|  3.14M|  x4 = _mm_sub_epi16(u4, v4);
   87|  3.14M|  x5 = _mm_sub_epi16(u5, v5);
   88|  3.14M|  x6 = _mm_sub_epi16(u6, v6);
   89|  3.14M|  x7 = _mm_sub_epi16(u7, v7);
   90|       |
   91|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x0);
   92|  3.14M|  store_diff = (int64_t *)(diff + 1 * diff_stride);
   93|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x1);
   94|  3.14M|  store_diff = (int64_t *)(diff + 2 * diff_stride);
   95|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x2);
   96|  3.14M|  store_diff = (int64_t *)(diff + 3 * diff_stride);
   97|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x3);
   98|  3.14M|  store_diff = (int64_t *)(diff + 4 * diff_stride);
   99|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x4);
  100|  3.14M|  store_diff = (int64_t *)(diff + 5 * diff_stride);
  101|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x5);
  102|  3.14M|  store_diff = (int64_t *)(diff + 6 * diff_stride);
  103|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x6);
  104|  3.14M|  store_diff = (int64_t *)(diff + 7 * diff_stride);
  105|  3.14M|  _mm_storel_epi64((__m128i *)store_diff, x7);
  106|  3.14M|}
highbd_subtract_sse2.c:subtract_8x8:
  138|  10.6M|                         const uint16_t *pred, ptrdiff_t pred_stride) {
  139|  10.6M|  __m128i u0, u1, u2, u3, u4, u5, u6, u7;
  140|  10.6M|  __m128i v0, v1, v2, v3, v4, v5, v6, v7;
  141|  10.6M|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
  142|       |
  143|  10.6M|  u0 = _mm_loadu_si128((__m128i const *)(src + 0 * src_stride));
  144|  10.6M|  u1 = _mm_loadu_si128((__m128i const *)(src + 1 * src_stride));
  145|  10.6M|  u2 = _mm_loadu_si128((__m128i const *)(src + 2 * src_stride));
  146|  10.6M|  u3 = _mm_loadu_si128((__m128i const *)(src + 3 * src_stride));
  147|  10.6M|  u4 = _mm_loadu_si128((__m128i const *)(src + 4 * src_stride));
  148|  10.6M|  u5 = _mm_loadu_si128((__m128i const *)(src + 5 * src_stride));
  149|  10.6M|  u6 = _mm_loadu_si128((__m128i const *)(src + 6 * src_stride));
  150|  10.6M|  u7 = _mm_loadu_si128((__m128i const *)(src + 7 * src_stride));
  151|       |
  152|  10.6M|  v0 = _mm_loadu_si128((__m128i const *)(pred + 0 * pred_stride));
  153|  10.6M|  v1 = _mm_loadu_si128((__m128i const *)(pred + 1 * pred_stride));
  154|  10.6M|  v2 = _mm_loadu_si128((__m128i const *)(pred + 2 * pred_stride));
  155|  10.6M|  v3 = _mm_loadu_si128((__m128i const *)(pred + 3 * pred_stride));
  156|  10.6M|  v4 = _mm_loadu_si128((__m128i const *)(pred + 4 * pred_stride));
  157|  10.6M|  v5 = _mm_loadu_si128((__m128i const *)(pred + 5 * pred_stride));
  158|  10.6M|  v6 = _mm_loadu_si128((__m128i const *)(pred + 6 * pred_stride));
  159|  10.6M|  v7 = _mm_loadu_si128((__m128i const *)(pred + 7 * pred_stride));
  160|       |
  161|  10.6M|  x0 = _mm_sub_epi16(u0, v0);
  162|  10.6M|  x1 = _mm_sub_epi16(u1, v1);
  163|  10.6M|  x2 = _mm_sub_epi16(u2, v2);
  164|  10.6M|  x3 = _mm_sub_epi16(u3, v3);
  165|  10.6M|  x4 = _mm_sub_epi16(u4, v4);
  166|  10.6M|  x5 = _mm_sub_epi16(u5, v5);
  167|  10.6M|  x6 = _mm_sub_epi16(u6, v6);
  168|  10.6M|  x7 = _mm_sub_epi16(u7, v7);
  169|       |
  170|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 0 * diff_stride), x0);
  171|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 1 * diff_stride), x1);
  172|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 2 * diff_stride), x2);
  173|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 3 * diff_stride), x3);
  174|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 4 * diff_stride), x4);
  175|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 5 * diff_stride), x5);
  176|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 6 * diff_stride), x6);
  177|  10.6M|  _mm_storeu_si128((__m128i *)(diff + 7 * diff_stride), x7);
  178|  10.6M|}
highbd_subtract_sse2.c:subtract_16x8:
  199|  1.40M|SUBTRACT_FUN(16x8) { STACK_H(8, subtract_8x8); }
  ------------------
  |  |  188|  1.40M|  do {                                                                      \
  |  |  189|  1.40M|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);             \
  |  |  190|  1.40M|    fun(diff + w, diff_stride, src + w, src_stride, pred + w, pred_stride); \
  |  |  191|  1.40M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (191:12): [Folded, False: 1.40M]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_8x16:
  198|   316k|SUBTRACT_FUN(8x16) { STACK_V(8, subtract_8x8); }
  ------------------
  |  |  181|   316k|  do {                                                                         \
  |  |  182|   316k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|   316k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|   316k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|   316k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 316k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_16x16:
  200|   554k|SUBTRACT_FUN(16x16) { STACK_V(8, subtract_16x8); }
  ------------------
  |  |  181|   554k|  do {                                                                         \
  |  |  182|   554k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|   554k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|   554k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|   554k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 554k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_32x16:
  202|   123k|SUBTRACT_FUN(32x16) { STACK_H(16, subtract_16x16); }
  ------------------
  |  |  188|   123k|  do {                                                                      \
  |  |  189|   123k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);             \
  |  |  190|   123k|    fun(diff + w, diff_stride, src + w, src_stride, pred + w, pred_stride); \
  |  |  191|   123k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (191:12): [Folded, False: 123k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_16x32:
  201|  29.7k|SUBTRACT_FUN(16x32) { STACK_V(16, subtract_16x16); }
  ------------------
  |  |  181|  29.7k|  do {                                                                         \
  |  |  182|  29.7k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|  29.7k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|  29.7k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|  29.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 29.7k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_32x32:
  203|  42.5k|SUBTRACT_FUN(32x32) { STACK_V(16, subtract_32x16); }
  ------------------
  |  |  181|  42.5k|  do {                                                                         \
  |  |  182|  42.5k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|  42.5k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|  42.5k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|  42.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 42.5k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_64x32:
  205|  5.89k|SUBTRACT_FUN(64x32) { STACK_H(32, subtract_32x32); }
  ------------------
  |  |  188|  5.89k|  do {                                                                      \
  |  |  189|  5.89k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);             \
  |  |  190|  5.89k|    fun(diff + w, diff_stride, src + w, src_stride, pred + w, pred_stride); \
  |  |  191|  5.89k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (191:12): [Folded, False: 5.89k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_32x64:
  204|  3.08k|SUBTRACT_FUN(32x64) { STACK_V(32, subtract_32x32); }
  ------------------
  |  |  181|  3.08k|  do {                                                                         \
  |  |  182|  3.08k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|  3.08k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|  3.08k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|  3.08k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 3.08k]
  |  |  ------------------
  ------------------
highbd_subtract_sse2.c:subtract_64x64:
  206|  1.51k|SUBTRACT_FUN(64x64) { STACK_V(32, subtract_64x32); }
  ------------------
  |  |  181|  1.51k|  do {                                                                         \
  |  |  182|  1.51k|    fun(diff, diff_stride, src, src_stride, pred, pred_stride);                \
  |  |  183|  1.51k|    fun(diff + diff_stride * h, diff_stride, src + src_stride * h, src_stride, \
  |  |  184|  1.51k|        pred + pred_stride * h, pred_stride);                                  \
  |  |  185|  1.51k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (185:12): [Folded, False: 1.51k]
  |  |  ------------------
  ------------------

aom_highbd_10_variance64x64_avx2:
  709|  23.6k|      int ref_stride, uint32_t *sse) {                                         \
  710|  23.6k|    int sum;                                                                   \
  711|  23.6k|    int64_t var;                                                               \
  712|  23.6k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  23.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  23.6k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  23.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  23.6k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  23.6k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  23.6k|                            block_size);                                       \
  717|  23.6k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  23.6k|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 23.6k, False: 0]
  ------------------
  719|  23.6k|  }
aom_highbd_10_variance64x32_avx2:
  709|  14.0k|      int ref_stride, uint32_t *sse) {                                         \
  710|  14.0k|    int sum;                                                                   \
  711|  14.0k|    int64_t var;                                                               \
  712|  14.0k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  14.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  14.0k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  14.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  14.0k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  14.0k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  14.0k|                            block_size);                                       \
  717|  14.0k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  14.0k|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 14.0k, False: 10]
  ------------------
  719|  14.0k|  }
aom_highbd_10_variance32x64_avx2:
  709|  13.8k|      int ref_stride, uint32_t *sse) {                                         \
  710|  13.8k|    int sum;                                                                   \
  711|  13.8k|    int64_t var;                                                               \
  712|  13.8k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  13.8k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  13.8k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  13.8k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  13.8k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  13.8k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  13.8k|                            block_size);                                       \
  717|  13.8k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  13.8k|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 13.8k, False: 3]
  ------------------
  719|  13.8k|  }
aom_highbd_10_variance32x32_avx2:
  709|  73.6k|      int ref_stride, uint32_t *sse) {                                         \
  710|  73.6k|    int sum;                                                                   \
  711|  73.6k|    int64_t var;                                                               \
  712|  73.6k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  73.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  73.6k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  73.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  73.6k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  73.6k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  73.6k|                            block_size);                                       \
  717|  73.6k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 73.6k, False: 18.4E]
  ------------------
  719|  73.6k|  }
aom_highbd_10_variance32x16_avx2:
  709|  30.0k|      int ref_stride, uint32_t *sse) {                                         \
  710|  30.0k|    int sum;                                                                   \
  711|  30.0k|    int64_t var;                                                               \
  712|  30.0k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  30.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  30.0k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  30.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  30.0k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  30.0k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  30.0k|                            block_size);                                       \
  717|  30.0k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  30.0k|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 30.0k, False: 5]
  ------------------
  719|  30.0k|  }
aom_highbd_10_variance16x32_avx2:
  709|  29.6k|      int ref_stride, uint32_t *sse) {                                         \
  710|  29.6k|    int sum;                                                                   \
  711|  29.6k|    int64_t var;                                                               \
  712|  29.6k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  29.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  29.6k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  29.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  29.6k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  29.6k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  29.6k|                            block_size);                                       \
  717|  29.6k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 29.6k, False: 18.4E]
  ------------------
  719|  29.6k|  }
aom_highbd_10_variance16x16_avx2:
  709|   157k|      int ref_stride, uint32_t *sse) {                                         \
  710|   157k|    int sum;                                                                   \
  711|   157k|    int64_t var;                                                               \
  712|   157k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|   157k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|   157k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|   157k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|   157k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|   157k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|   157k|                            block_size);                                       \
  717|   157k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 157k, False: 18.4E]
  ------------------
  719|   157k|  }
aom_highbd_10_variance16x8_avx2:
  709|   221k|      int ref_stride, uint32_t *sse) {                                         \
  710|   221k|    int sum;                                                                   \
  711|   221k|    int64_t var;                                                               \
  712|   221k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|   221k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|   221k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|   221k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|   221k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|   221k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|   221k|                            block_size);                                       \
  717|   221k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 221k, False: 18.4E]
  ------------------
  719|   221k|  }
aom_highbd_10_variance8x16_avx2:
  709|   210k|      int ref_stride, uint32_t *sse) {                                         \
  710|   210k|    int sum;                                                                   \
  711|   210k|    int64_t var;                                                               \
  712|   210k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|   210k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|   210k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|   210k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|   210k|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|   210k|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|   210k|                            block_size);                                       \
  717|   210k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 210k, False: 18.4E]
  ------------------
  719|   210k|  }
aom_highbd_10_variance8x8_avx2:
  709|  5.59M|      int ref_stride, uint32_t *sse) {                                         \
  710|  5.59M|    int sum;                                                                   \
  711|  5.59M|    int64_t var;                                                               \
  712|  5.59M|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                                 \
  ------------------
  |  |   79|  5.59M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  713|  5.59M|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                                 \
  ------------------
  |  |   79|  5.59M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  714|  5.59M|    highbd_10_variance_avx2(src, src_stride, ref, ref_stride, w, h, sse, &sum, \
  715|  5.59M|                            highbd_calc##block_size##x##block_size##var_avx2,  \
  716|  5.59M|                            block_size);                                       \
  717|  5.59M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);                   \
  718|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                     \
  ------------------
  |  Branch (718:12): [True: 5.59M, False: 18.4E]
  ------------------
  719|  5.59M|  }
aom_highbd_10_sub_pixel_variance64x64_avx2:
  768|    400|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|    400|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 400]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|    400|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|    400|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 400]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|    400|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|    400|    else                                                                     \
  776|    400|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|    400|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|    400|  }
aom_highbd_10_sub_pixel_variance64x32_avx2:
  768|     70|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|     70|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 70]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|     70|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|     70|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 70]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|     70|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|     70|    else                                                                     \
  776|     70|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|     70|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|     70|  }
aom_highbd_10_sub_pixel_variance32x64_avx2:
  768|    130|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|    130|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 130]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|    130|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|    130|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 130]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|    130|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|    130|    else                                                                     \
  776|    130|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|    130|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|    130|  }
aom_highbd_10_sub_pixel_variance32x32_avx2:
  768|  4.21k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|  4.21k|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 4.21k]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|  4.21k|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|  4.21k|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 4.21k]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|  4.21k|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|  4.21k|    else                                                                     \
  776|  4.21k|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|  4.21k|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|  4.21k|  }
aom_highbd_10_sub_pixel_variance32x16_avx2:
  768|    426|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|    426|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 426]
  |  Branch (769:19): [True: 0, Folded]
  ------------------
  770|    426|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|    426|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 426]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|    426|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|    426|    else                                                                     \
  776|    426|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|    426|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|    426|  }
aom_highbd_10_sub_pixel_variance16x32_avx2:
  768|    200|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|    200|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 200]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|    200|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|    200|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 200]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|    200|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|    200|    else                                                                     \
  776|    200|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|    200|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|    200|  }
aom_highbd_10_sub_pixel_variance16x16_avx2:
  768|  26.0k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|  26.0k|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 26.0k]
  |  Branch (769:19): [True: 0, Folded]
  ------------------
  770|  26.0k|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|  26.0k|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 26.0k]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|  26.0k|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|  26.0k|    else                                                                     \
  776|  26.0k|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|  26.0k|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|  26.0k|  }
aom_highbd_10_sub_pixel_variance16x8_avx2:
  768|  20.8k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|  20.8k|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [Folded, False: 20.8k]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|  20.8k|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|  20.8k|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [Folded, False: 20.8k]
  |  Branch (772:24): [True: 0, Folded]
  ------------------
  773|  20.8k|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|  20.8k|    else                                                                     \
  776|  20.8k|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|  20.8k|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|  20.8k|  }
aom_highbd_10_sub_pixel_variance8x16_avx2:
  768|  20.0k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|  20.0k|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [True: 0, Folded]
  |  Branch (769:19): [True: 0, Folded]
  ------------------
  770|  20.0k|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|  20.0k|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|  20.0k|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [True: 0, Folded]
  |  Branch (772:24): [Folded, False: 0]
  ------------------
  773|      0|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|      0|    else                                                                     \
  776|      0|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|      0|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|  20.0k|  }
aom_highbd_10_sub_pixel_variance8x8_avx2:
  768|   295k|      const uint8_t *dst, int dst_stride, uint32_t *sse) {                   \
  769|   295k|    if (W == 8 && H == 16)                                                   \
  ------------------
  |  Branch (769:9): [True: 0, Folded]
  |  Branch (769:19): [Folded, False: 0]
  ------------------
  770|   295k|      return aom_highbd_10_sub_pixel_variance8x16_sse2(                      \
  771|      0|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  772|   295k|    else if (W == 8 && H == 8)                                               \
  ------------------
  |  Branch (772:14): [True: 0, Folded]
  |  Branch (772:24): [True: 0, Folded]
  ------------------
  773|   295k|      return aom_highbd_10_sub_pixel_variance8x8_sse2(                       \
  774|   295k|          src, src_stride, xoffset, yoffset, dst, dst_stride, sse);          \
  775|   295k|    else                                                                     \
  776|  18.4E|      return aom_highbd_var_filter_block2d_bil_avx2(                         \
  777|  18.4E|          src, src_stride, 1, H, W, xoffset, yoffset, dst, dst_stride, sse); \
  778|   295k|  }
aom_mse_wxh_16bit_highbd_avx2:
  907|  1.26M|                                       int h) {
  908|  1.26M|  assert((w == 8 || w == 4) && (h == 8 || h == 4) &&
  909|  1.26M|         "w=8/4 and h=8/4 must satisfy");
  910|  1.26M|  switch (w) {
  911|   400k|    case 4: return mse_4xh_16bit_highbd_avx2(dst, dstride, src, sstride, h);
  ------------------
  |  Branch (911:5): [True: 400k, False: 860k]
  ------------------
  912|   862k|    case 8: return mse_8xh_16bit_highbd_avx2(dst, dstride, src, sstride, h);
  ------------------
  |  Branch (912:5): [True: 862k, False: 398k]
  ------------------
  913|      0|    default: assert(0 && "unsupported width"); return -1;
  ------------------
  |  Branch (913:5): [True: 0, False: 1.26M]
  ------------------
  914|  1.26M|  }
  915|  1.26M|}
highbd_variance_avx2.c:highbd_10_variance_avx2:
  687|  6.36M|                                    high_variance_fn_t var_fn, int block_size) {
  688|  6.36M|  int i, j;
  689|  6.36M|  uint64_t sse_long = 0;
  690|  6.36M|  int32_t sum_long = 0;
  691|       |
  692|  13.1M|  for (i = 0; i < h; i += block_size) {
  ------------------
  |  Branch (692:15): [True: 6.80M, False: 6.36M]
  ------------------
  693|  14.4M|    for (j = 0; j < w; j += block_size) {
  ------------------
  |  Branch (693:17): [True: 7.62M, False: 6.80M]
  ------------------
  694|  7.62M|      unsigned int sse0;
  695|  7.62M|      int sum0;
  696|  7.62M|      var_fn(src + src_stride * i + j, src_stride, ref + ref_stride * i + j,
  697|  7.62M|             ref_stride, &sse0, &sum0);
  698|  7.62M|      sse_long += sse0;
  699|  7.62M|      sum_long += sum0;
  700|  7.62M|    }
  701|  6.80M|  }
  702|  6.36M|  *sum = ROUND_POWER_OF_TWO(sum_long, 2);
  ------------------
  |  |   41|  6.36M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  703|  6.36M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 4);
  ------------------
  |  |   41|  6.36M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  704|  6.36M|}
highbd_variance_avx2.c:highbd_calc16x16var_avx2:
  658|  1.17M|                                     uint32_t *sse, int *sum) {
  659|  1.17M|  __m256i v_sum_d = _mm256_setzero_si256();
  660|  1.17M|  __m256i v_sse_d = _mm256_setzero_si256();
  661|  1.17M|  const __m256i one = _mm256_set1_epi16(1);
  662|  19.8M|  for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (662:19): [True: 18.7M, False: 1.17M]
  ------------------
  663|  18.7M|    const __m256i v_p_a = _mm256_loadu_si256((const __m256i *)src);
  664|  18.7M|    const __m256i v_p_b = _mm256_loadu_si256((const __m256i *)ref);
  665|  18.7M|    const __m256i v_diff = _mm256_sub_epi16(v_p_a, v_p_b);
  666|  18.7M|    const __m256i v_sqrdiff = _mm256_madd_epi16(v_diff, v_diff);
  667|  18.7M|    v_sum_d = _mm256_add_epi16(v_sum_d, v_diff);
  668|  18.7M|    v_sse_d = _mm256_add_epi32(v_sse_d, v_sqrdiff);
  669|  18.7M|    src += src_stride;
  670|  18.7M|    ref += ref_stride;
  671|  18.7M|  }
  672|  1.17M|  __m256i v_sum0 = _mm256_madd_epi16(v_sum_d, one);
  673|  1.17M|  __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, v_sse_d);
  674|  1.17M|  __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, v_sse_d);
  675|  1.17M|  __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  676|  1.17M|  const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  677|  1.17M|  const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  678|  1.17M|  __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  679|  1.17M|  v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  680|  1.17M|  *sum = _mm_extract_epi32(v_d, 0);
  681|       |  *sse = _mm_extract_epi32(v_d, 1);
  682|  1.17M|}
highbd_variance_avx2.c:highbd_calc8x8var_avx2:
  623|  6.45M|                                   uint32_t *sse, int *sum) {
  624|  6.45M|  __m256i v_sum_d = _mm256_setzero_si256();
  625|  6.45M|  __m256i v_sse_d = _mm256_setzero_si256();
  626|  32.2M|  for (int i = 0; i < 8; i += 2) {
  ------------------
  |  Branch (626:19): [True: 25.8M, False: 6.45M]
  ------------------
  627|  25.8M|    const __m128i v_p_a0 = _mm_loadu_si128((const __m128i *)src);
  628|  25.8M|    const __m128i v_p_a1 = _mm_loadu_si128((const __m128i *)(src + src_stride));
  629|  25.8M|    const __m128i v_p_b0 = _mm_loadu_si128((const __m128i *)ref);
  630|  25.8M|    const __m128i v_p_b1 = _mm_loadu_si128((const __m128i *)(ref + ref_stride));
  631|  25.8M|    __m256i v_p_a = _mm256_castsi128_si256(v_p_a0);
  632|  25.8M|    __m256i v_p_b = _mm256_castsi128_si256(v_p_b0);
  633|  25.8M|    v_p_a = _mm256_inserti128_si256(v_p_a, v_p_a1, 1);
  634|  25.8M|    v_p_b = _mm256_inserti128_si256(v_p_b, v_p_b1, 1);
  635|  25.8M|    const __m256i v_diff = _mm256_sub_epi16(v_p_a, v_p_b);
  636|  25.8M|    const __m256i v_sqrdiff = _mm256_madd_epi16(v_diff, v_diff);
  637|  25.8M|    v_sum_d = _mm256_add_epi16(v_sum_d, v_diff);
  638|  25.8M|    v_sse_d = _mm256_add_epi32(v_sse_d, v_sqrdiff);
  639|  25.8M|    src += src_stride * 2;
  640|  25.8M|    ref += ref_stride * 2;
  641|  25.8M|  }
  642|  6.45M|  __m256i v_sum00 = _mm256_cvtepi16_epi32(_mm256_castsi256_si128(v_sum_d));
  643|  6.45M|  __m256i v_sum01 = _mm256_cvtepi16_epi32(_mm256_extracti128_si256(v_sum_d, 1));
  644|  6.45M|  __m256i v_sum0 = _mm256_add_epi32(v_sum00, v_sum01);
  645|  6.45M|  __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, v_sse_d);
  646|  6.45M|  __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, v_sse_d);
  647|  6.45M|  __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  648|  6.45M|  const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  649|  6.45M|  const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  650|  6.45M|  __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  651|  6.45M|  v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  652|  6.45M|  *sum = _mm_extract_epi32(v_d, 0);
  653|       |  *sse = _mm_extract_epi32(v_d, 1);
  654|  6.45M|}
highbd_variance_avx2.c:aom_highbd_var_filter_block2d_bil_avx2:
   27|  52.3k|    int dst_stride, uint32_t *sse) {
   28|  52.3k|  const __m256i filter1 =
   29|  52.3k|      _mm256_set1_epi32((int)(bilinear_filters_2t[xoffset][1] << 16) |
   30|  52.3k|                        bilinear_filters_2t[xoffset][0]);
   31|  52.3k|  const __m256i filter2 =
   32|  52.3k|      _mm256_set1_epi32((int)(bilinear_filters_2t[yoffset][1] << 16) |
   33|  52.3k|                        bilinear_filters_2t[yoffset][0]);
   34|  52.3k|  const __m256i one = _mm256_set1_epi16(1);
   35|  52.3k|  const int bitshift = 0x40;
   36|  52.3k|  (void)pixel_step;
   37|  52.3k|  unsigned int i, j, prev = 0, curr = 2;
   38|  52.3k|  uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8);
  ------------------
  |  |   79|  52.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   39|  52.3k|  uint16_t *dst_ptr = CONVERT_TO_SHORTPTR(dst_ptr8);
  ------------------
  |  |   79|  52.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   40|  52.3k|  uint16_t *src_ptr_ref = src_ptr;
   41|  52.3k|  uint16_t *dst_ptr_ref = dst_ptr;
   42|  52.3k|  int64_t sum_long = 0;
   43|  52.3k|  uint64_t sse_long = 0;
   44|  52.3k|  unsigned int rshift = 0, inc = 1;
   45|  52.3k|  __m256i rbias = _mm256_set1_epi32(bitshift);
   46|  52.3k|  __m256i opointer[8];
   47|  52.3k|  unsigned int range;
   48|  52.3k|  if (xoffset == 0) {
  ------------------
  |  Branch (48:7): [True: 10.5k, False: 41.7k]
  ------------------
   49|  10.5k|    if (yoffset == 0) {  // xoffset==0 && yoffset==0
  ------------------
  |  Branch (49:9): [True: 0, False: 10.5k]
  ------------------
   50|      0|      range = output_width / 16;
   51|      0|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (51:11): [True: 0, False: 0]
  ------------------
   52|      0|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (52:11): [True: 0, False: 0]
  ------------------
   53|      0|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (53:19): [True: 0, False: 0]
  ------------------
   54|      0|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|          src_ptr = src_ptr_ref;
   56|      0|          src_ptr_ref += 16;
   57|      0|          dst_ptr = dst_ptr_ref;
   58|      0|          dst_ptr_ref += 16;
   59|      0|        }
   60|      0|        __m256i sum1 = _mm256_setzero_si256();
   61|      0|        __m256i sse1 = _mm256_setzero_si256();
   62|      0|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (62:21): [True: 0, False: 0]
  ------------------
   63|      0|          __m256i V_S_SRC = _mm256_loadu_si256((const __m256i *)src_ptr);
   64|      0|          src_ptr += src_pixels_per_line;
   65|      0|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
   66|      0|          dst_ptr += dst_stride;
   67|       |
   68|      0|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
   69|      0|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
   70|       |
   71|      0|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
   72|      0|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
   73|      0|        }
   74|       |
   75|      0|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
   76|      0|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
   77|      0|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
   78|      0|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
   79|      0|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
   80|      0|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
   81|      0|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
   82|      0|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
   83|      0|        sum_long += _mm_extract_epi32(v_d, 0);
   84|      0|        sse_long += _mm_extract_epi32(v_d, 1);
   85|      0|      }
   86|       |
   87|      0|      rshift = get_msb(output_height) + get_msb(output_width);
   88|       |
   89|  10.5k|    } else if (yoffset == 4) {  // xoffset==0 && yoffset==4
  ------------------
  |  Branch (89:16): [True: 7.49k, False: 3.06k]
  ------------------
   90|  7.49k|      range = output_width / 16;
   91|  7.49k|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (91:11): [True: 3.21k, False: 4.27k]
  ------------------
   92|  7.49k|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (92:11): [True: 0, False: 7.49k]
  ------------------
   93|  18.3k|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (93:19): [True: 10.8k, False: 7.49k]
  ------------------
   94|  10.8k|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (94:13): [True: 8.49k, False: 2.36k]
  ------------------
   95|  8.49k|          src_ptr = src_ptr_ref;
   96|  8.49k|          src_ptr_ref += 16;
   97|  8.49k|          dst_ptr = dst_ptr_ref;
   98|  8.49k|          dst_ptr_ref += 16;
   99|       |
  100|  8.49k|          opointer[0] = _mm256_loadu_si256((const __m256i *)src_ptr);
  101|  8.49k|          src_ptr += src_pixels_per_line;
  102|  8.49k|          curr = 0;
  103|  8.49k|        }
  104|       |
  105|  10.8k|        __m256i sum1 = _mm256_setzero_si256();
  106|  10.8k|        __m256i sse1 = _mm256_setzero_si256();
  107|       |
  108|   158k|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (108:21): [True: 147k, False: 10.8k]
  ------------------
  109|   147k|          prev = curr;
  110|   147k|          curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (110:18): [True: 73.9k, False: 73.9k]
  ------------------
  111|   147k|          opointer[curr] = _mm256_loadu_si256((const __m256i *)src_ptr);
  112|   147k|          src_ptr += src_pixels_per_line;
  113|       |
  114|   147k|          __m256i V_S_SRC = _mm256_avg_epu16(opointer[curr], opointer[prev]);
  115|       |
  116|   147k|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  117|   147k|          dst_ptr += dst_stride;
  118|   147k|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  119|   147k|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  120|   147k|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  121|   147k|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  122|   147k|        }
  123|       |
  124|  10.8k|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  125|  10.8k|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  126|  10.8k|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  127|  10.8k|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  128|  10.8k|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  129|  10.8k|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  130|  10.8k|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  131|  10.8k|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  132|  10.8k|        sum_long += _mm_extract_epi32(v_d, 0);
  133|  10.8k|        sse_long += _mm_extract_epi32(v_d, 1);
  134|  10.8k|      }
  135|       |
  136|  7.49k|      rshift = get_msb(output_height) + get_msb(output_width);
  137|       |
  138|  7.49k|    } else {  // xoffset==0 && yoffset==1,2,3,5,6,7
  139|  3.06k|      range = output_width / 16;
  140|  3.06k|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (140:11): [True: 1.20k, False: 1.85k]
  ------------------
  141|  3.06k|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (141:11): [True: 0, False: 3.06k]
  ------------------
  142|  7.20k|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (142:19): [True: 4.14k, False: 3.06k]
  ------------------
  143|  4.14k|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (143:13): [True: 3.37k, False: 768]
  ------------------
  144|  3.37k|          src_ptr = src_ptr_ref;
  145|  3.37k|          src_ptr_ref += 16;
  146|  3.37k|          dst_ptr = dst_ptr_ref;
  147|  3.37k|          dst_ptr_ref += 16;
  148|       |
  149|  3.37k|          opointer[0] = _mm256_loadu_si256((const __m256i *)src_ptr);
  150|  3.37k|          src_ptr += src_pixels_per_line;
  151|  3.37k|          curr = 0;
  152|  3.37k|        }
  153|       |
  154|  4.14k|        __m256i sum1 = _mm256_setzero_si256();
  155|  4.14k|        __m256i sse1 = _mm256_setzero_si256();
  156|       |
  157|  60.7k|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (157:21): [True: 56.6k, False: 4.14k]
  ------------------
  158|  56.6k|          prev = curr;
  159|  56.6k|          curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (159:18): [True: 28.3k, False: 28.3k]
  ------------------
  160|  56.6k|          opointer[curr] = _mm256_loadu_si256((const __m256i *)src_ptr);
  161|  56.6k|          src_ptr += src_pixels_per_line;
  162|       |
  163|  56.6k|          __m256i V_S_M1 =
  164|  56.6k|              _mm256_unpacklo_epi16(opointer[prev], opointer[curr]);
  165|  56.6k|          __m256i V_S_M2 =
  166|  56.6k|              _mm256_unpackhi_epi16(opointer[prev], opointer[curr]);
  167|       |
  168|  56.6k|          __m256i V_S_MAD1 = _mm256_madd_epi16(V_S_M1, filter2);
  169|  56.6k|          __m256i V_S_MAD2 = _mm256_madd_epi16(V_S_M2, filter2);
  170|       |
  171|  56.6k|          __m256i V_S_S1 =
  172|  56.6k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD1, rbias), 7);
  173|  56.6k|          __m256i V_S_S2 =
  174|  56.6k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD2, rbias), 7);
  175|       |
  176|  56.6k|          __m256i V_S_SRC = _mm256_packus_epi32(V_S_S1, V_S_S2);
  177|       |
  178|  56.6k|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  179|  56.6k|          dst_ptr += dst_stride;
  180|       |
  181|  56.6k|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  182|  56.6k|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  183|       |
  184|  56.6k|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  185|  56.6k|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  186|  56.6k|        }
  187|       |
  188|  4.14k|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  189|  4.14k|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  190|  4.14k|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  191|  4.14k|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  192|  4.14k|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  193|  4.14k|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  194|  4.14k|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  195|  4.14k|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  196|  4.14k|        sum_long += _mm_extract_epi32(v_d, 0);
  197|  4.14k|        sse_long += _mm_extract_epi32(v_d, 1);
  198|  4.14k|      }
  199|       |
  200|  3.06k|      rshift = get_msb(output_height) + get_msb(output_width);
  201|  3.06k|    }
  202|  41.7k|  } else if (xoffset == 4) {
  ------------------
  |  Branch (202:14): [True: 22.6k, False: 19.1k]
  ------------------
  203|  22.6k|    if (yoffset == 0) {  // xoffset==4 && yoffset==0
  ------------------
  |  Branch (203:9): [True: 7.49k, False: 15.1k]
  ------------------
  204|  7.49k|      range = output_width / 16;
  205|  7.49k|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (205:11): [True: 3.22k, False: 4.27k]
  ------------------
  206|  7.49k|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (206:11): [True: 0, False: 7.49k]
  ------------------
  207|  18.3k|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (207:19): [True: 10.8k, False: 7.49k]
  ------------------
  208|  10.8k|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (208:13): [True: 8.49k, False: 2.36k]
  ------------------
  209|  8.49k|          src_ptr = src_ptr_ref;
  210|  8.49k|          src_ptr_ref += 16;
  211|  8.49k|          dst_ptr = dst_ptr_ref;
  212|  8.49k|          dst_ptr_ref += 16;
  213|  8.49k|          __m256i V_H_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  214|  8.49k|          __m256i V_H_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  215|  8.49k|          src_ptr += src_pixels_per_line;
  216|       |
  217|  8.49k|          opointer[0] = _mm256_avg_epu16(V_H_D1, V_H_D2);
  218|       |
  219|  8.49k|          curr = 0;
  220|  8.49k|        }
  221|       |
  222|  10.8k|        __m256i sum1 = _mm256_setzero_si256();
  223|  10.8k|        __m256i sse1 = _mm256_setzero_si256();
  224|       |
  225|   158k|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (225:21): [True: 147k, False: 10.8k]
  ------------------
  226|   147k|          prev = curr;
  227|   147k|          curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (227:18): [True: 73.9k, False: 73.9k]
  ------------------
  228|   147k|          __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  229|   147k|          __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  230|   147k|          src_ptr += src_pixels_per_line;
  231|       |
  232|   147k|          opointer[curr] = _mm256_avg_epu16(V_V_D1, V_V_D2);
  233|       |
  234|   147k|          __m256i V_S_M1 =
  235|   147k|              _mm256_unpacklo_epi16(opointer[prev], opointer[curr]);
  236|   147k|          __m256i V_S_M2 =
  237|   147k|              _mm256_unpackhi_epi16(opointer[prev], opointer[curr]);
  238|       |
  239|   147k|          __m256i V_S_MAD1 = _mm256_madd_epi16(V_S_M1, filter2);
  240|   147k|          __m256i V_S_MAD2 = _mm256_madd_epi16(V_S_M2, filter2);
  241|       |
  242|   147k|          __m256i V_S_S1 =
  243|   147k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD1, rbias), 7);
  244|   147k|          __m256i V_S_S2 =
  245|   147k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD2, rbias), 7);
  246|       |
  247|   147k|          __m256i V_S_SRC = _mm256_packus_epi32(V_S_S1, V_S_S2);
  248|       |
  249|   147k|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  250|   147k|          dst_ptr += dst_stride;
  251|       |
  252|   147k|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  253|   147k|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  254|       |
  255|   147k|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  256|   147k|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  257|   147k|        }
  258|       |
  259|  10.8k|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  260|  10.8k|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  261|  10.8k|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  262|  10.8k|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  263|  10.8k|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  264|  10.8k|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  265|  10.8k|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  266|  10.8k|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  267|  10.8k|        sum_long += _mm_extract_epi32(v_d, 0);
  268|  10.8k|        sse_long += _mm_extract_epi32(v_d, 1);
  269|  10.8k|      }
  270|       |
  271|  7.49k|      rshift = get_msb(output_height) + get_msb(output_width);
  272|       |
  273|  15.1k|    } else if (yoffset == 4) {  // xoffset==4 && yoffset==4
  ------------------
  |  Branch (273:16): [True: 5.89k, False: 9.24k]
  ------------------
  274|  5.89k|      range = output_width / 16;
  275|  5.89k|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (275:11): [True: 2.16k, False: 3.73k]
  ------------------
  276|  5.89k|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (276:11): [True: 0, False: 5.89k]
  ------------------
  277|  13.6k|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (277:19): [True: 7.75k, False: 5.89k]
  ------------------
  278|  7.75k|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (278:13): [True: 6.46k, False: 1.29k]
  ------------------
  279|  6.46k|          src_ptr = src_ptr_ref;
  280|  6.46k|          src_ptr_ref += 16;
  281|  6.46k|          dst_ptr = dst_ptr_ref;
  282|  6.46k|          dst_ptr_ref += 16;
  283|       |
  284|  6.46k|          __m256i V_H_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  285|  6.46k|          __m256i V_H_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  286|  6.46k|          src_ptr += src_pixels_per_line;
  287|  6.46k|          opointer[0] = _mm256_avg_epu16(V_H_D1, V_H_D2);
  288|  6.46k|          curr = 0;
  289|  6.46k|        }
  290|       |
  291|  7.75k|        __m256i sum1 = _mm256_setzero_si256();
  292|  7.75k|        __m256i sse1 = _mm256_setzero_si256();
  293|       |
  294|   114k|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (294:21): [True: 106k, False: 7.75k]
  ------------------
  295|   106k|          prev = curr;
  296|   106k|          curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (296:18): [True: 53.2k, False: 53.2k]
  ------------------
  297|   106k|          __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  298|   106k|          __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  299|   106k|          src_ptr += src_pixels_per_line;
  300|   106k|          opointer[curr] = _mm256_avg_epu16(V_V_D1, V_V_D2);
  301|   106k|          __m256i V_S_SRC = _mm256_avg_epu16(opointer[curr], opointer[prev]);
  302|       |
  303|   106k|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  304|   106k|          dst_ptr += dst_stride;
  305|   106k|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  306|   106k|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  307|   106k|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  308|   106k|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  309|   106k|        }
  310|       |
  311|  7.75k|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  312|  7.75k|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  313|  7.75k|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  314|  7.75k|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  315|  7.75k|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  316|  7.75k|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  317|  7.75k|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  318|  7.75k|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  319|  7.75k|        sum_long += _mm_extract_epi32(v_d, 0);
  320|  7.75k|        sse_long += _mm_extract_epi32(v_d, 1);
  321|  7.75k|      }
  322|       |
  323|  5.89k|      rshift = get_msb(output_height) + get_msb(output_width);
  324|       |
  325|  9.24k|    } else {  // xoffset==4 && yoffset==1,2,3,5,6,7
  326|  9.24k|      range = output_width / 16;
  327|  9.24k|      if (output_height == 8) inc = 2;
  ------------------
  |  Branch (327:11): [True: 3.44k, False: 5.79k]
  ------------------
  328|  9.24k|      if (output_height == 4) inc = 4;
  ------------------
  |  Branch (328:11): [True: 0, False: 9.24k]
  ------------------
  329|  22.0k|      for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (329:19): [True: 12.8k, False: 9.24k]
  ------------------
  330|  12.8k|        if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (330:13): [True: 10.3k, False: 2.50k]
  ------------------
  331|  10.3k|          src_ptr = src_ptr_ref;
  332|  10.3k|          src_ptr_ref += 16;
  333|  10.3k|          dst_ptr = dst_ptr_ref;
  334|  10.3k|          dst_ptr_ref += 16;
  335|       |
  336|  10.3k|          __m256i V_H_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  337|  10.3k|          __m256i V_H_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  338|  10.3k|          src_ptr += src_pixels_per_line;
  339|  10.3k|          opointer[0] = _mm256_avg_epu16(V_H_D1, V_H_D2);
  340|  10.3k|          curr = 0;
  341|  10.3k|        }
  342|       |
  343|  12.8k|        __m256i sum1 = _mm256_setzero_si256();
  344|  12.8k|        __m256i sse1 = _mm256_setzero_si256();
  345|       |
  346|   190k|        for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (346:21): [True: 177k, False: 12.8k]
  ------------------
  347|   177k|          prev = curr;
  348|   177k|          curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (348:18): [True: 88.7k, False: 88.7k]
  ------------------
  349|   177k|          __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  350|   177k|          __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  351|   177k|          src_ptr += src_pixels_per_line;
  352|   177k|          opointer[curr] = _mm256_avg_epu16(V_V_D1, V_V_D2);
  353|       |
  354|   177k|          __m256i V_S_M1 =
  355|   177k|              _mm256_unpacklo_epi16(opointer[prev], opointer[curr]);
  356|   177k|          __m256i V_S_M2 =
  357|   177k|              _mm256_unpackhi_epi16(opointer[prev], opointer[curr]);
  358|       |
  359|   177k|          __m256i V_S_MAD1 = _mm256_madd_epi16(V_S_M1, filter2);
  360|   177k|          __m256i V_S_MAD2 = _mm256_madd_epi16(V_S_M2, filter2);
  361|       |
  362|   177k|          __m256i V_S_S1 =
  363|   177k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD1, rbias), 7);
  364|   177k|          __m256i V_S_S2 =
  365|   177k|              _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD2, rbias), 7);
  366|       |
  367|   177k|          __m256i V_S_SRC = _mm256_packus_epi32(V_S_S1, V_S_S2);
  368|       |
  369|   177k|          __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  370|   177k|          dst_ptr += dst_stride;
  371|       |
  372|   177k|          __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  373|   177k|          __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  374|       |
  375|   177k|          sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  376|   177k|          sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  377|   177k|        }
  378|       |
  379|  12.8k|        __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  380|  12.8k|        __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  381|  12.8k|        __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  382|  12.8k|        __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  383|  12.8k|        const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  384|  12.8k|        const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  385|  12.8k|        __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  386|  12.8k|        v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  387|  12.8k|        sum_long += _mm_extract_epi32(v_d, 0);
  388|  12.8k|        sse_long += _mm_extract_epi32(v_d, 1);
  389|  12.8k|      }
  390|       |
  391|  9.24k|      rshift = get_msb(output_height) + get_msb(output_width);
  392|  9.24k|    }
  393|  22.6k|  } else if (yoffset == 0) {  // xoffset==1,2,3,5,6,7 && yoffset==0
  ------------------
  |  Branch (393:14): [True: 4.09k, False: 15.0k]
  ------------------
  394|  4.09k|    range = output_width / 16;
  395|  4.09k|    if (output_height == 8) inc = 2;
  ------------------
  |  Branch (395:9): [True: 2.19k, False: 1.90k]
  ------------------
  396|  4.09k|    if (output_height == 4) inc = 4;
  ------------------
  |  Branch (396:9): [True: 0, False: 4.09k]
  ------------------
  397|  9.15k|    for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (397:17): [True: 5.06k, False: 4.09k]
  ------------------
  398|  5.06k|      if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (398:11): [True: 4.42k, False: 641]
  ------------------
  399|  4.42k|        src_ptr = src_ptr_ref;
  400|  4.42k|        src_ptr_ref += 16;
  401|  4.42k|        dst_ptr = dst_ptr_ref;
  402|  4.42k|        dst_ptr_ref += 16;
  403|       |
  404|  4.42k|        curr = 0;
  405|  4.42k|      }
  406|       |
  407|  5.06k|      __m256i sum1 = _mm256_setzero_si256();
  408|  5.06k|      __m256i sse1 = _mm256_setzero_si256();
  409|       |
  410|  68.5k|      for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (410:19): [True: 63.4k, False: 5.06k]
  ------------------
  411|  63.4k|        __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  412|  63.4k|        __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  413|  63.4k|        src_ptr += src_pixels_per_line;
  414|  63.4k|        __m256i V_V_M1 = _mm256_unpacklo_epi16(V_V_D1, V_V_D2);
  415|  63.4k|        __m256i V_V_M2 = _mm256_unpackhi_epi16(V_V_D1, V_V_D2);
  416|  63.4k|        __m256i V_V_MAD1 = _mm256_madd_epi16(V_V_M1, filter1);
  417|  63.4k|        __m256i V_V_MAD2 = _mm256_madd_epi16(V_V_M2, filter1);
  418|  63.4k|        __m256i V_V_S1 =
  419|  63.4k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD1, rbias), 7);
  420|  63.4k|        __m256i V_V_S2 =
  421|  63.4k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD2, rbias), 7);
  422|  63.4k|        opointer[curr] = _mm256_packus_epi32(V_V_S1, V_V_S2);
  423|       |
  424|  63.4k|        __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  425|  63.4k|        dst_ptr += dst_stride;
  426|  63.4k|        __m256i V_R_SUB = _mm256_sub_epi16(opointer[curr], V_D_DST);
  427|  63.4k|        __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  428|       |
  429|  63.4k|        sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  430|  63.4k|        sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  431|  63.4k|      }
  432|       |
  433|  5.06k|      __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  434|  5.06k|      __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  435|  5.06k|      __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  436|  5.06k|      __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  437|  5.06k|      const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  438|  5.06k|      const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  439|  5.06k|      __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  440|  5.06k|      v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  441|  5.06k|      sum_long += _mm_extract_epi32(v_d, 0);
  442|  5.06k|      sse_long += _mm_extract_epi32(v_d, 1);
  443|  5.06k|    }
  444|       |
  445|  4.09k|    rshift = get_msb(output_height) + get_msb(output_width);
  446|       |
  447|  15.0k|  } else if (yoffset == 4) {  // xoffset==1,2,3,5,6,7 && yoffset==4
  ------------------
  |  Branch (447:14): [True: 8.21k, False: 6.84k]
  ------------------
  448|       |
  449|  8.21k|    range = output_width / 16;
  450|  8.21k|    if (output_height == 8) inc = 2;
  ------------------
  |  Branch (450:9): [True: 2.45k, False: 5.76k]
  ------------------
  451|  8.21k|    if (output_height == 4) inc = 4;
  ------------------
  |  Branch (451:9): [True: 0, False: 8.21k]
  ------------------
  452|  20.1k|    for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (452:17): [True: 11.9k, False: 8.21k]
  ------------------
  453|  11.9k|      if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (453:11): [True: 9.29k, False: 2.67k]
  ------------------
  454|  9.29k|        src_ptr = src_ptr_ref;
  455|  9.29k|        src_ptr_ref += 16;
  456|  9.29k|        dst_ptr = dst_ptr_ref;
  457|  9.29k|        dst_ptr_ref += 16;
  458|       |
  459|  9.29k|        __m256i V_H_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  460|  9.29k|        __m256i V_H_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  461|  9.29k|        src_ptr += src_pixels_per_line;
  462|       |
  463|  9.29k|        __m256i V_H_M1 = _mm256_unpacklo_epi16(V_H_D1, V_H_D2);
  464|  9.29k|        __m256i V_H_M2 = _mm256_unpackhi_epi16(V_H_D1, V_H_D2);
  465|       |
  466|  9.29k|        __m256i V_H_MAD1 = _mm256_madd_epi16(V_H_M1, filter1);
  467|  9.29k|        __m256i V_H_MAD2 = _mm256_madd_epi16(V_H_M2, filter1);
  468|       |
  469|  9.29k|        __m256i V_H_S1 =
  470|  9.29k|            _mm256_srli_epi32(_mm256_add_epi32(V_H_MAD1, rbias), 7);
  471|  9.29k|        __m256i V_H_S2 =
  472|  9.29k|            _mm256_srli_epi32(_mm256_add_epi32(V_H_MAD2, rbias), 7);
  473|       |
  474|  9.29k|        opointer[0] = _mm256_packus_epi32(V_H_S1, V_H_S2);
  475|       |
  476|  9.29k|        curr = 0;
  477|  9.29k|      }
  478|       |
  479|  11.9k|      __m256i sum1 = _mm256_setzero_si256();
  480|  11.9k|      __m256i sse1 = _mm256_setzero_si256();
  481|       |
  482|   183k|      for (i = 0; i < 16 / inc; ++i) {
  ------------------
  |  Branch (482:19): [True: 171k, False: 11.9k]
  ------------------
  483|   171k|        prev = curr;
  484|   171k|        curr = (curr == 0) ? 1 : 0;
  ------------------
  |  Branch (484:16): [True: 85.8k, False: 85.7k]
  ------------------
  485|   171k|        __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  486|   171k|        __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  487|   171k|        src_ptr += src_pixels_per_line;
  488|   171k|        __m256i V_V_M1 = _mm256_unpacklo_epi16(V_V_D1, V_V_D2);
  489|   171k|        __m256i V_V_M2 = _mm256_unpackhi_epi16(V_V_D1, V_V_D2);
  490|   171k|        __m256i V_V_MAD1 = _mm256_madd_epi16(V_V_M1, filter1);
  491|   171k|        __m256i V_V_MAD2 = _mm256_madd_epi16(V_V_M2, filter1);
  492|   171k|        __m256i V_V_S1 =
  493|   171k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD1, rbias), 7);
  494|   171k|        __m256i V_V_S2 =
  495|   171k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD2, rbias), 7);
  496|   171k|        opointer[curr] = _mm256_packus_epi32(V_V_S1, V_V_S2);
  497|       |
  498|   171k|        __m256i V_S_SRC = _mm256_avg_epu16(opointer[prev], opointer[curr]);
  499|       |
  500|   171k|        __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  501|   171k|        dst_ptr += dst_stride;
  502|       |
  503|   171k|        __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  504|   171k|        __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  505|       |
  506|   171k|        sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  507|   171k|        sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  508|   171k|      }
  509|       |
  510|  11.9k|      __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  511|  11.9k|      __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  512|  11.9k|      __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  513|  11.9k|      __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  514|  11.9k|      const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  515|  11.9k|      const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  516|  11.9k|      __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  517|  11.9k|      v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  518|  11.9k|      sum_long += _mm_extract_epi32(v_d, 0);
  519|  11.9k|      sse_long += _mm_extract_epi32(v_d, 1);
  520|  11.9k|    }
  521|       |
  522|  8.21k|    rshift = get_msb(output_height) + get_msb(output_width);
  523|       |
  524|  8.21k|  } else {  // xoffset==1,2,3,5,6,7 && yoffset==1,2,3,5,6,7
  525|  6.84k|    range = output_width / 16;
  526|  6.84k|    if (output_height == 8) inc = 2;
  ------------------
  |  Branch (526:9): [True: 2.95k, False: 3.89k]
  ------------------
  527|  6.84k|    if (output_height == 4) inc = 4;
  ------------------
  |  Branch (527:9): [True: 0, False: 6.84k]
  ------------------
  528|  6.84k|    unsigned int nloop = 16 / inc;
  529|  16.3k|    for (j = 0; j < range * output_height * inc / 16; j++) {
  ------------------
  |  Branch (529:17): [True: 9.54k, False: 6.84k]
  ------------------
  530|  9.54k|      if (j % (output_height * inc / 16) == 0) {
  ------------------
  |  Branch (530:11): [True: 7.68k, False: 1.86k]
  ------------------
  531|  7.68k|        src_ptr = src_ptr_ref;
  532|  7.68k|        src_ptr_ref += 16;
  533|  7.68k|        dst_ptr = dst_ptr_ref;
  534|  7.68k|        dst_ptr_ref += 16;
  535|       |
  536|  7.68k|        __m256i V_H_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  537|  7.68k|        __m256i V_H_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  538|  7.68k|        src_ptr += src_pixels_per_line;
  539|       |
  540|  7.68k|        __m256i V_H_M1 = _mm256_unpacklo_epi16(V_H_D1, V_H_D2);
  541|  7.68k|        __m256i V_H_M2 = _mm256_unpackhi_epi16(V_H_D1, V_H_D2);
  542|       |
  543|  7.68k|        __m256i V_H_MAD1 = _mm256_madd_epi16(V_H_M1, filter1);
  544|  7.68k|        __m256i V_H_MAD2 = _mm256_madd_epi16(V_H_M2, filter1);
  545|       |
  546|  7.68k|        __m256i V_H_S1 =
  547|  7.68k|            _mm256_srli_epi32(_mm256_add_epi32(V_H_MAD1, rbias), 7);
  548|  7.68k|        __m256i V_H_S2 =
  549|  7.68k|            _mm256_srli_epi32(_mm256_add_epi32(V_H_MAD2, rbias), 7);
  550|       |
  551|  7.68k|        opointer[0] = _mm256_packus_epi32(V_H_S1, V_H_S2);
  552|       |
  553|  7.68k|        curr = 0;
  554|  7.68k|      }
  555|       |
  556|  9.54k|      __m256i sum1 = _mm256_setzero_si256();
  557|  9.54k|      __m256i sse1 = _mm256_setzero_si256();
  558|       |
  559|   138k|      for (i = 0; i < nloop; ++i) {
  ------------------
  |  Branch (559:19): [True: 128k, False: 9.54k]
  ------------------
  560|   128k|        prev = curr;
  561|   128k|        curr = !curr;
  562|   128k|        __m256i V_V_D1 = _mm256_loadu_si256((const __m256i *)src_ptr);
  563|   128k|        __m256i V_V_D2 = _mm256_loadu_si256((const __m256i *)(src_ptr + 1));
  564|   128k|        src_ptr += src_pixels_per_line;
  565|   128k|        __m256i V_V_M1 = _mm256_unpacklo_epi16(V_V_D1, V_V_D2);
  566|   128k|        __m256i V_V_M2 = _mm256_unpackhi_epi16(V_V_D1, V_V_D2);
  567|   128k|        __m256i V_V_MAD1 = _mm256_madd_epi16(V_V_M1, filter1);
  568|   128k|        __m256i V_V_MAD2 = _mm256_madd_epi16(V_V_M2, filter1);
  569|   128k|        __m256i V_V_S1 =
  570|   128k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD1, rbias), 7);
  571|   128k|        __m256i V_V_S2 =
  572|   128k|            _mm256_srli_epi32(_mm256_add_epi32(V_V_MAD2, rbias), 7);
  573|   128k|        opointer[curr] = _mm256_packus_epi32(V_V_S1, V_V_S2);
  574|       |
  575|   128k|        __m256i V_S_M1 = _mm256_unpacklo_epi16(opointer[prev], opointer[curr]);
  576|   128k|        __m256i V_S_M2 = _mm256_unpackhi_epi16(opointer[prev], opointer[curr]);
  577|       |
  578|   128k|        __m256i V_S_MAD1 = _mm256_madd_epi16(V_S_M1, filter2);
  579|   128k|        __m256i V_S_MAD2 = _mm256_madd_epi16(V_S_M2, filter2);
  580|       |
  581|   128k|        __m256i V_S_S1 =
  582|   128k|            _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD1, rbias), 7);
  583|   128k|        __m256i V_S_S2 =
  584|   128k|            _mm256_srli_epi32(_mm256_add_epi32(V_S_MAD2, rbias), 7);
  585|       |
  586|   128k|        __m256i V_S_SRC = _mm256_packus_epi32(V_S_S1, V_S_S2);
  587|       |
  588|   128k|        __m256i V_D_DST = _mm256_loadu_si256((const __m256i *)dst_ptr);
  589|   128k|        dst_ptr += dst_stride;
  590|       |
  591|   128k|        __m256i V_R_SUB = _mm256_sub_epi16(V_S_SRC, V_D_DST);
  592|   128k|        __m256i V_R_MAD = _mm256_madd_epi16(V_R_SUB, V_R_SUB);
  593|       |
  594|   128k|        sum1 = _mm256_add_epi16(sum1, V_R_SUB);
  595|   128k|        sse1 = _mm256_add_epi32(sse1, V_R_MAD);
  596|   128k|      }
  597|       |
  598|  9.54k|      __m256i v_sum0 = _mm256_madd_epi16(sum1, one);
  599|  9.54k|      __m256i v_d_l = _mm256_unpacklo_epi32(v_sum0, sse1);
  600|  9.54k|      __m256i v_d_h = _mm256_unpackhi_epi32(v_sum0, sse1);
  601|  9.54k|      __m256i v_d_lh = _mm256_add_epi32(v_d_l, v_d_h);
  602|  9.54k|      const __m128i v_d0_d = _mm256_castsi256_si128(v_d_lh);
  603|  9.54k|      const __m128i v_d1_d = _mm256_extracti128_si256(v_d_lh, 1);
  604|  9.54k|      __m128i v_d = _mm_add_epi32(v_d0_d, v_d1_d);
  605|  9.54k|      v_d = _mm_add_epi32(v_d, _mm_srli_si128(v_d, 8));
  606|  9.54k|      sum_long += _mm_extract_epi32(v_d, 0);
  607|  9.54k|      sse_long += _mm_extract_epi32(v_d, 1);
  608|  9.54k|    }
  609|       |
  610|  6.84k|    rshift = get_msb(output_height) + get_msb(output_width);
  611|  6.84k|  }
  612|       |
  613|  52.3k|  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 4);
  ------------------
  |  |   41|  52.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  614|  52.3k|  int sum = (int)ROUND_POWER_OF_TWO(sum_long, 2);
  ------------------
  |  |   41|  52.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  615|       |
  616|  52.3k|  int32_t var = *sse - (uint32_t)(((int64_t)sum * sum) >> rshift);
  617|       |
  618|  52.3k|  return (var > 0) ? var : 0;
  ------------------
  |  Branch (618:10): [True: 52.3k, False: 1]
  ------------------
  619|  52.3k|}
highbd_variance_avx2.c:mse_4xh_16bit_highbd_avx2:
  797|   400k|                                          uint16_t *src, int sstride, int h) {
  798|   400k|  uint64_t sum = 0;
  799|   400k|  __m128i reg0_4x16, reg1_4x16, reg2_4x16, reg3_4x16;
  800|   400k|  __m256i src0_8x16, src1_8x16, src_16x16;
  801|   400k|  __m256i dst0_8x16, dst1_8x16, dst_16x16;
  802|   400k|  __m256i res0_4x64, res1_4x64, res2_4x64, res3_4x64;
  803|   400k|  __m256i sub_result;
  804|   400k|  const __m256i zeros = _mm256_broadcastsi128_si256(_mm_setzero_si128());
  805|   400k|  __m256i square_result = _mm256_broadcastsi128_si256(_mm_setzero_si128());
  806|   984k|  for (int i = 0; i < h; i += 4) {
  ------------------
  |  Branch (806:19): [True: 583k, False: 400k]
  ------------------
  807|   583k|    reg0_4x16 = _mm_loadl_epi64((__m128i const *)(&dst[(i + 0) * dstride]));
  808|   583k|    reg1_4x16 = _mm_loadl_epi64((__m128i const *)(&dst[(i + 1) * dstride]));
  809|   583k|    reg2_4x16 = _mm_loadl_epi64((__m128i const *)(&dst[(i + 2) * dstride]));
  810|   583k|    reg3_4x16 = _mm_loadl_epi64((__m128i const *)(&dst[(i + 3) * dstride]));
  811|   583k|    dst0_8x16 =
  812|   583k|        _mm256_castsi128_si256(_mm_unpacklo_epi64(reg0_4x16, reg1_4x16));
  813|   583k|    dst1_8x16 =
  814|   583k|        _mm256_castsi128_si256(_mm_unpacklo_epi64(reg2_4x16, reg3_4x16));
  815|   583k|    dst_16x16 = _mm256_permute2x128_si256(dst0_8x16, dst1_8x16, 0x20);
  816|       |
  817|   583k|    reg0_4x16 = _mm_loadl_epi64((__m128i const *)(&src[(i + 0) * sstride]));
  818|   583k|    reg1_4x16 = _mm_loadl_epi64((__m128i const *)(&src[(i + 1) * sstride]));
  819|   583k|    reg2_4x16 = _mm_loadl_epi64((__m128i const *)(&src[(i + 2) * sstride]));
  820|   583k|    reg3_4x16 = _mm_loadl_epi64((__m128i const *)(&src[(i + 3) * sstride]));
  821|   583k|    src0_8x16 =
  822|   583k|        _mm256_castsi128_si256(_mm_unpacklo_epi64(reg0_4x16, reg1_4x16));
  823|   583k|    src1_8x16 =
  824|   583k|        _mm256_castsi128_si256(_mm_unpacklo_epi64(reg2_4x16, reg3_4x16));
  825|   583k|    src_16x16 = _mm256_permute2x128_si256(src0_8x16, src1_8x16, 0x20);
  826|       |
  827|   583k|    sub_result = _mm256_abs_epi16(_mm256_sub_epi16(src_16x16, dst_16x16));
  828|       |
  829|   583k|    src_16x16 = _mm256_unpacklo_epi16(sub_result, zeros);
  830|   583k|    dst_16x16 = _mm256_unpackhi_epi16(sub_result, zeros);
  831|       |
  832|   583k|    src_16x16 = _mm256_madd_epi16(src_16x16, src_16x16);
  833|   583k|    dst_16x16 = _mm256_madd_epi16(dst_16x16, dst_16x16);
  834|       |
  835|   583k|    res0_4x64 = _mm256_unpacklo_epi32(src_16x16, zeros);
  836|   583k|    res1_4x64 = _mm256_unpackhi_epi32(src_16x16, zeros);
  837|   583k|    res2_4x64 = _mm256_unpacklo_epi32(dst_16x16, zeros);
  838|   583k|    res3_4x64 = _mm256_unpackhi_epi32(dst_16x16, zeros);
  839|       |
  840|   583k|    square_result = _mm256_add_epi64(
  841|   583k|        square_result,
  842|   583k|        _mm256_add_epi64(
  843|   583k|            _mm256_add_epi64(_mm256_add_epi64(res0_4x64, res1_4x64), res2_4x64),
  844|   583k|            res3_4x64));
  845|   583k|  }
  846|   400k|  const __m128i sum_2x64 =
  847|   400k|      _mm_add_epi64(_mm256_castsi256_si128(square_result),
  848|   400k|                    _mm256_extracti128_si256(square_result, 1));
  849|       |  const __m128i sum_1x64 = _mm_add_epi64(sum_2x64, _mm_srli_si128(sum_2x64, 8));
  850|   400k|  xx_storel_64(&sum, sum_1x64);
  851|   400k|  return sum;
  852|   400k|}
highbd_variance_avx2.c:mse_8xh_16bit_highbd_avx2:
  855|   862k|                                          uint16_t *src, int sstride, int h) {
  856|   862k|  uint64_t sum = 0;
  857|   862k|  __m256i src0_8x16, src1_8x16, src_16x16;
  858|   862k|  __m256i dst0_8x16, dst1_8x16, dst_16x16;
  859|   862k|  __m256i res0_4x64, res1_4x64, res2_4x64, res3_4x64;
  860|   862k|  __m256i sub_result;
  861|   862k|  const __m256i zeros = _mm256_broadcastsi128_si256(_mm_setzero_si128());
  862|   862k|  __m256i square_result = _mm256_broadcastsi128_si256(_mm_setzero_si128());
  863|       |
  864|  4.30M|  for (int i = 0; i < h; i += 2) {
  ------------------
  |  Branch (864:19): [True: 3.44M, False: 862k]
  ------------------
  865|  3.44M|    dst0_8x16 =
  866|  3.44M|        _mm256_castsi128_si256(_mm_loadu_si128((__m128i *)&dst[i * dstride]));
  867|  3.44M|    dst1_8x16 = _mm256_castsi128_si256(
  868|  3.44M|        _mm_loadu_si128((__m128i *)&dst[(i + 1) * dstride]));
  869|  3.44M|    dst_16x16 = _mm256_permute2x128_si256(dst0_8x16, dst1_8x16, 0x20);
  870|       |
  871|  3.44M|    src0_8x16 =
  872|  3.44M|        _mm256_castsi128_si256(_mm_loadu_si128((__m128i *)&src[i * sstride]));
  873|  3.44M|    src1_8x16 = _mm256_castsi128_si256(
  874|  3.44M|        _mm_loadu_si128((__m128i *)&src[(i + 1) * sstride]));
  875|  3.44M|    src_16x16 = _mm256_permute2x128_si256(src0_8x16, src1_8x16, 0x20);
  876|       |
  877|  3.44M|    sub_result = _mm256_abs_epi16(_mm256_sub_epi16(src_16x16, dst_16x16));
  878|       |
  879|  3.44M|    src_16x16 = _mm256_unpacklo_epi16(sub_result, zeros);
  880|  3.44M|    dst_16x16 = _mm256_unpackhi_epi16(sub_result, zeros);
  881|       |
  882|  3.44M|    src_16x16 = _mm256_madd_epi16(src_16x16, src_16x16);
  883|  3.44M|    dst_16x16 = _mm256_madd_epi16(dst_16x16, dst_16x16);
  884|       |
  885|  3.44M|    res0_4x64 = _mm256_unpacklo_epi32(src_16x16, zeros);
  886|  3.44M|    res1_4x64 = _mm256_unpackhi_epi32(src_16x16, zeros);
  887|  3.44M|    res2_4x64 = _mm256_unpacklo_epi32(dst_16x16, zeros);
  888|  3.44M|    res3_4x64 = _mm256_unpackhi_epi32(dst_16x16, zeros);
  889|       |
  890|  3.44M|    square_result = _mm256_add_epi64(
  891|  3.44M|        square_result,
  892|  3.44M|        _mm256_add_epi64(
  893|  3.44M|            _mm256_add_epi64(_mm256_add_epi64(res0_4x64, res1_4x64), res2_4x64),
  894|  3.44M|            res3_4x64));
  895|  3.44M|  }
  896|       |
  897|   862k|  const __m128i sum_2x64 =
  898|   862k|      _mm_add_epi64(_mm256_castsi256_si128(square_result),
  899|   862k|                    _mm256_extracti128_si256(square_result, 1));
  900|       |  const __m128i sum_1x64 = _mm_add_epi64(sum_2x64, _mm_srli_si128(sum_2x64, 8));
  901|   862k|  xx_storel_64(&sum, sum_1x64);
  902|   862k|  return sum;
  903|   862k|}

aom_highbd_12_variance64x64_sse2:
  130|  25.1k|      int ref_stride, uint32_t *sse) {                                     \
  131|  25.1k|    int sum;                                                               \
  132|  25.1k|    int64_t var;                                                           \
  133|  25.1k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  25.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  25.1k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  25.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  25.1k|    highbd_12_variance_sse2(                                               \
  136|  25.1k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  25.1k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  25.1k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 25.2k, False: 18.4E]
  ------------------
  140|  25.1k|  }
aom_highbd_12_variance64x32_sse2:
  130|  15.0k|      int ref_stride, uint32_t *sse) {                                     \
  131|  15.0k|    int sum;                                                               \
  132|  15.0k|    int64_t var;                                                           \
  133|  15.0k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  15.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  15.0k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  15.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  15.0k|    highbd_12_variance_sse2(                                               \
  136|  15.0k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  15.0k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  15.0k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 15.0k, False: 18.4E]
  ------------------
  140|  15.0k|  }
aom_highbd_12_variance32x64_sse2:
  130|  16.1k|      int ref_stride, uint32_t *sse) {                                     \
  131|  16.1k|    int sum;                                                               \
  132|  16.1k|    int64_t var;                                                           \
  133|  16.1k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  16.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  16.1k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  16.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  16.1k|    highbd_12_variance_sse2(                                               \
  136|  16.1k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  16.1k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  16.1k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 16.1k, False: 18.4E]
  ------------------
  140|  16.1k|  }
aom_highbd_12_variance32x32_sse2:
  130|  67.6k|      int ref_stride, uint32_t *sse) {                                     \
  131|  67.6k|    int sum;                                                               \
  132|  67.6k|    int64_t var;                                                           \
  133|  67.6k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  67.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  67.6k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  67.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  67.6k|    highbd_12_variance_sse2(                                               \
  136|  67.6k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  67.6k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  67.6k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 67.7k, False: 18.4E]
  ------------------
  140|  67.6k|  }
aom_highbd_12_variance32x16_sse2:
  130|  30.1k|      int ref_stride, uint32_t *sse) {                                     \
  131|  30.1k|    int sum;                                                               \
  132|  30.1k|    int64_t var;                                                           \
  133|  30.1k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  30.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  30.1k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  30.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  30.1k|    highbd_12_variance_sse2(                                               \
  136|  30.1k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  30.1k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  30.1k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 30.1k, False: 18.4E]
  ------------------
  140|  30.1k|  }
aom_highbd_12_variance16x32_sse2:
  130|  30.5k|      int ref_stride, uint32_t *sse) {                                     \
  131|  30.5k|    int sum;                                                               \
  132|  30.5k|    int64_t var;                                                           \
  133|  30.5k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  30.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  30.5k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  30.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  30.5k|    highbd_12_variance_sse2(                                               \
  136|  30.5k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  30.5k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  30.5k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 30.5k, False: 18.4E]
  ------------------
  140|  30.5k|  }
aom_highbd_12_variance16x16_sse2:
  130|   161k|      int ref_stride, uint32_t *sse) {                                     \
  131|   161k|    int sum;                                                               \
  132|   161k|    int64_t var;                                                           \
  133|   161k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|   161k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|   161k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|   161k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|   161k|    highbd_12_variance_sse2(                                               \
  136|   161k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|   161k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|   161k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 161k, False: 18.4E]
  ------------------
  140|   161k|  }
aom_highbd_12_variance16x8_sse2:
  130|   242k|      int ref_stride, uint32_t *sse) {                                     \
  131|   242k|    int sum;                                                               \
  132|   242k|    int64_t var;                                                           \
  133|   242k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|   242k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|   242k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|   242k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|   242k|    highbd_12_variance_sse2(                                               \
  136|   242k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|   242k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|   242k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 242k, False: 18.4E]
  ------------------
  140|   242k|  }
aom_highbd_12_variance8x16_sse2:
  130|   278k|      int ref_stride, uint32_t *sse) {                                     \
  131|   278k|    int sum;                                                               \
  132|   278k|    int64_t var;                                                           \
  133|   278k|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|   278k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|   278k|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|   278k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|   278k|    highbd_12_variance_sse2(                                               \
  136|   278k|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|   278k|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|   278k|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 278k, False: 18.4E]
  ------------------
  140|   278k|  }
aom_highbd_12_variance8x8_sse2:
  130|  5.70M|      int ref_stride, uint32_t *sse) {                                     \
  131|  5.70M|    int sum;                                                               \
  132|  5.70M|    int64_t var;                                                           \
  133|  5.70M|    uint16_t *src = CONVERT_TO_SHORTPTR(src8);                             \
  ------------------
  |  |   79|  5.70M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  134|  5.70M|    uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);                             \
  ------------------
  |  |   79|  5.70M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  135|  5.70M|    highbd_12_variance_sse2(                                               \
  136|  5.70M|        src, src_stride, ref, ref_stride, w, h, sse, &sum,                 \
  137|  5.70M|        aom_highbd_calc##block_size##x##block_size##var_sse2, block_size); \
  138|  5.70M|    var = (int64_t)(*sse) - (((int64_t)sum * sum) >> shift);               \
  139|  18.4E|    return (var >= 0) ? (uint32_t)var : 0;                                 \
  ------------------
  |  Branch (139:12): [True: 5.70M, False: 18.4E]
  ------------------
  140|  5.70M|  }
highbd_variance_sse2.c:highbd_12_variance_sse2:
   82|  6.56M|                                    high_variance_fn_t var_fn, int block_size) {
   83|  6.56M|  int i, j;
   84|  6.56M|  uint64_t sse_long = 0;
   85|  6.56M|  int32_t sum_long = 0;
   86|       |
   87|  13.6M|  for (i = 0; i < h; i += block_size) {
  ------------------
  |  Branch (87:15): [True: 7.07M, False: 6.56M]
  ------------------
   88|  15.0M|    for (j = 0; j < w; j += block_size) {
  ------------------
  |  Branch (88:17): [True: 7.93M, False: 7.07M]
  ------------------
   89|  7.93M|      unsigned int sse0;
   90|  7.93M|      int sum0;
   91|  7.93M|      var_fn(src + src_stride * i + j, src_stride, ref + ref_stride * i + j,
   92|  7.93M|             ref_stride, &sse0, &sum0);
   93|  7.93M|      sse_long += sse0;
   94|  7.93M|      sum_long += sum0;
   95|  7.93M|    }
   96|  7.07M|  }
   97|  6.56M|  *sum = ROUND_POWER_OF_TWO(sum_long, 4);
  ------------------
  |  |   41|  6.56M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   98|  6.56M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 8);
  ------------------
  |  |   41|  6.56M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   99|  6.56M|}

aom_highbd_10_variance4x4_sse4_1:
   84|  11.7M|                                          uint32_t *sse) {
   85|  11.7M|  int64_t sum, diff;
   86|  11.7M|  uint64_t local_sse;
   87|       |
   88|  11.7M|  variance4x4_64_sse4_1(a, a_stride, b, b_stride, &local_sse, &sum);
   89|  11.7M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(local_sse, 4);
  ------------------
  |  |   41|  11.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   90|  11.7M|  sum = ROUND_POWER_OF_TWO(sum, 2);
  ------------------
  |  |   41|  11.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   91|       |
   92|  11.7M|  diff = (int64_t)*sse - ((sum * sum) >> 4);
   93|  18.4E|  return (diff >= 0) ? (uint32_t)diff : 0;
  ------------------
  |  Branch (93:10): [True: 11.7M, False: 18.4E]
  ------------------
   94|  11.7M|}
aom_highbd_12_variance4x4_sse4_1:
   98|  12.0M|                                          uint32_t *sse) {
   99|  12.0M|  int64_t sum, diff;
  100|  12.0M|  uint64_t local_sse;
  101|       |
  102|  12.0M|  variance4x4_64_sse4_1(a, a_stride, b, b_stride, &local_sse, &sum);
  103|  12.0M|  *sse = (uint32_t)ROUND_POWER_OF_TWO(local_sse, 8);
  ------------------
  |  |   41|  12.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  104|  12.0M|  sum = ROUND_POWER_OF_TWO(sum, 4);
  ------------------
  |  |   41|  12.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  105|       |
  106|  12.0M|  diff = (int64_t)*sse - ((sum * sum) >> 4);
  107|  12.0M|  return diff >= 0 ? (uint32_t)diff : 0;
  ------------------
  |  Branch (107:10): [True: 11.9M, False: 7.56k]
  ------------------
  108|  12.0M|}
aom_highbd_10_sub_pixel_variance4x4_sse4_1:
  128|   269k|    const uint8_t *dst, int dst_stride, uint32_t *sse) {
  129|   269k|  uint16_t fdata3[(4 + 1) * 4];
  130|   269k|  uint16_t temp2[4 * 4];
  131|       |
  132|   269k|  aom_highbd_var_filter_block2d_bil_first_pass(
  133|   269k|      src, fdata3, src_stride, 1, 4 + 1, 4, bilinear_filters_2t[xoffset]);
  134|   269k|  aom_highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 4, 4,
  135|   269k|                                                bilinear_filters_2t[yoffset]);
  136|       |
  137|   269k|  return aom_highbd_10_variance4x4(CONVERT_TO_BYTEPTR(temp2), 4, dst,
  ------------------
  |  |   80|   269k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  138|   269k|                                   dst_stride, sse);
  139|   269k|}
aom_highbd_12_sub_pixel_variance4x4_sse4_1:
  143|   290k|    const uint8_t *dst, int dst_stride, uint32_t *sse) {
  144|   290k|  uint16_t fdata3[(4 + 1) * 4];
  145|   290k|  uint16_t temp2[4 * 4];
  146|       |
  147|   290k|  aom_highbd_var_filter_block2d_bil_first_pass(
  148|   290k|      src, fdata3, src_stride, 1, 4 + 1, 4, bilinear_filters_2t[xoffset]);
  149|   290k|  aom_highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 4, 4,
  150|   290k|                                                bilinear_filters_2t[yoffset]);
  151|       |
  152|   290k|  return aom_highbd_12_variance4x4(CONVERT_TO_BYTEPTR(temp2), 4, dst,
  ------------------
  |  |   80|   290k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  153|   290k|                                   dst_stride, sse);
  154|   290k|}
highbd_variance_sse4.c:variance4x4_64_sse4_1:
   22|  23.7M|                                         uint64_t *sse, int64_t *sum) {
   23|  23.7M|  __m128i u0, u1, u2, u3;
   24|  23.7M|  __m128i s0, s1, s2, s3;
   25|  23.7M|  __m128i t0, t1, x0, y0;
   26|  23.7M|  __m128i a0, a1, a2, a3;
   27|  23.7M|  __m128i b0, b1, b2, b3;
   28|  23.7M|  __m128i k_one_epi16 = _mm_set1_epi16((int16_t)1);
   29|       |
   30|  23.7M|  uint16_t *a = CONVERT_TO_SHORTPTR(a8);
  ------------------
  |  |   79|  23.7M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   31|  23.7M|  uint16_t *b = CONVERT_TO_SHORTPTR(b8);
  ------------------
  |  |   79|  23.7M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   32|       |
   33|  23.7M|  a0 = _mm_loadl_epi64((__m128i const *)(a + 0 * a_stride));
   34|  23.7M|  a1 = _mm_loadl_epi64((__m128i const *)(a + 1 * a_stride));
   35|  23.7M|  a2 = _mm_loadl_epi64((__m128i const *)(a + 2 * a_stride));
   36|  23.7M|  a3 = _mm_loadl_epi64((__m128i const *)(a + 3 * a_stride));
   37|       |
   38|  23.7M|  b0 = _mm_loadl_epi64((__m128i const *)(b + 0 * b_stride));
   39|  23.7M|  b1 = _mm_loadl_epi64((__m128i const *)(b + 1 * b_stride));
   40|  23.7M|  b2 = _mm_loadl_epi64((__m128i const *)(b + 2 * b_stride));
   41|  23.7M|  b3 = _mm_loadl_epi64((__m128i const *)(b + 3 * b_stride));
   42|       |
   43|  23.7M|  u0 = _mm_unpacklo_epi16(a0, a1);
   44|  23.7M|  u1 = _mm_unpacklo_epi16(a2, a3);
   45|  23.7M|  u2 = _mm_unpacklo_epi16(b0, b1);
   46|  23.7M|  u3 = _mm_unpacklo_epi16(b2, b3);
   47|       |
   48|  23.7M|  s0 = _mm_sub_epi16(u0, u2);
   49|  23.7M|  s1 = _mm_sub_epi16(u1, u3);
   50|       |
   51|  23.7M|  t0 = _mm_madd_epi16(s0, k_one_epi16);
   52|  23.7M|  t1 = _mm_madd_epi16(s1, k_one_epi16);
   53|       |
   54|  23.7M|  s2 = _mm_hadd_epi32(t0, t1);
   55|  23.7M|  s3 = _mm_hadd_epi32(s2, s2);
   56|  23.7M|  y0 = _mm_hadd_epi32(s3, s3);
   57|       |
   58|  23.7M|  t0 = _mm_madd_epi16(s0, s0);
   59|  23.7M|  t1 = _mm_madd_epi16(s1, s1);
   60|       |
   61|  23.7M|  s2 = _mm_hadd_epi32(t0, t1);
   62|  23.7M|  s3 = _mm_hadd_epi32(s2, s2);
   63|  23.7M|  x0 = _mm_hadd_epi32(s3, s3);
   64|       |
   65|  23.7M|  *sse = (uint64_t)_mm_extract_epi32(x0, 0);
   66|       |  *sum = (int64_t)_mm_extract_epi32(y0, 0);
   67|  23.7M|}

aom_dc_predictor_32x32_avx2:
  323|  21.6k|                                 const uint8_t *above, const uint8_t *left) {
  324|  21.6k|  const __m256i sum_above = dc_sum_32(above);
  325|  21.6k|  __m256i sum_left = dc_sum_32(left);
  326|  21.6k|  sum_left = _mm256_add_epi16(sum_left, sum_above);
  327|  21.6k|  const __m256i thirtytwo = _mm256_set1_epi16(32);
  328|  21.6k|  sum_left = _mm256_add_epi16(sum_left, thirtytwo);
  329|  21.6k|  sum_left = _mm256_srai_epi16(sum_left, 6);
  330|  21.6k|  const __m256i zero = _mm256_setzero_si256();
  331|  21.6k|  __m256i row = _mm256_shuffle_epi8(sum_left, zero);
  332|  21.6k|  row_store_32xh(&row, 32, dst, stride);
  333|  21.6k|}
aom_dc_top_predictor_32x32_avx2:
  337|  24.3k|                                     const uint8_t *left) {
  338|  24.3k|  __m256i sum = dc_sum_32(above);
  339|  24.3k|  (void)left;
  340|       |
  341|  24.3k|  const __m256i sixteen = _mm256_set1_epi16(16);
  342|  24.3k|  sum = _mm256_add_epi16(sum, sixteen);
  343|  24.3k|  sum = _mm256_srai_epi16(sum, 5);
  344|  24.3k|  const __m256i zero = _mm256_setzero_si256();
  345|  24.3k|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  346|  24.3k|  row_store_32xh(&row, 32, dst, stride);
  347|  24.3k|}
aom_dc_left_predictor_32x32_avx2:
  351|  25.1k|                                      const uint8_t *left) {
  352|  25.1k|  __m256i sum = dc_sum_32(left);
  353|  25.1k|  (void)above;
  354|       |
  355|  25.1k|  const __m256i sixteen = _mm256_set1_epi16(16);
  356|  25.1k|  sum = _mm256_add_epi16(sum, sixteen);
  357|  25.1k|  sum = _mm256_srai_epi16(sum, 5);
  358|  25.1k|  const __m256i zero = _mm256_setzero_si256();
  359|  25.1k|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  360|  25.1k|  row_store_32xh(&row, 32, dst, stride);
  361|  25.1k|}
aom_dc_128_predictor_32x32_avx2:
  365|  28.4k|                                     const uint8_t *left) {
  366|  28.4k|  (void)above;
  367|  28.4k|  (void)left;
  368|  28.4k|  const __m256i row = _mm256_set1_epi8((int8_t)0x80);
  369|  28.4k|  row_store_32xh(&row, 32, dst, stride);
  370|  28.4k|}
aom_v_predictor_32x32_avx2:
  373|    870|                                const uint8_t *above, const uint8_t *left) {
  374|    870|  const __m256i row = _mm256_loadu_si256((const __m256i *)above);
  375|    870|  (void)left;
  376|    870|  row_store_32xh(&row, 32, dst, stride);
  377|    870|}
aom_h_predictor_32x32_avx2:
  402|    889|                                const uint8_t *above, const uint8_t *left) {
  403|    889|  (void)above;
  404|    889|  const __m256i left_col = _mm256_loadu_si256((__m256i const *)left);
  405|       |
  406|    889|  __m256i u = _mm256_unpacklo_epi8(left_col, left_col);
  407|       |
  408|    889|  __m256i v = _mm256_unpacklo_epi8(u, u);
  409|    889|  h_predictor_32x8line(&v, dst, stride);
  410|    889|  dst += stride << 2;
  411|       |
  412|    889|  v = _mm256_unpackhi_epi8(u, u);
  413|    889|  h_predictor_32x8line(&v, dst, stride);
  414|    889|  dst += stride << 2;
  415|       |
  416|    889|  u = _mm256_unpackhi_epi8(left_col, left_col);
  417|       |
  418|    889|  v = _mm256_unpacklo_epi8(u, u);
  419|    889|  h_predictor_32x8line(&v, dst, stride);
  420|    889|  dst += stride << 2;
  421|       |
  422|    889|  v = _mm256_unpackhi_epi8(u, u);
  423|    889|  h_predictor_32x8line(&v, dst, stride);
  424|    889|}
aom_dc_predictor_32x16_avx2:
  429|    540|                                 const uint8_t *above, const uint8_t *left) {
  430|    540|  const __m128i top_sum = dc_sum_32_sse2(above);
  431|    540|  __m128i left_sum = dc_sum_16_sse2(left);
  432|    540|  left_sum = _mm_add_epi16(top_sum, left_sum);
  433|    540|  uint16_t sum = (uint16_t)_mm_cvtsi128_si32(left_sum);
  434|    540|  sum += 24;
  435|    540|  sum /= 48;
  436|    540|  const __m256i row = _mm256_set1_epi8((int8_t)sum);
  437|    540|  row_store_32xh(&row, 16, dst, stride);
  438|    540|}
aom_dc_predictor_32x64_avx2:
  441|     20|                                 const uint8_t *above, const uint8_t *left) {
  442|     20|  const __m256i sum_above = dc_sum_32(above);
  443|     20|  __m256i sum_left = dc_sum_64(left);
  444|     20|  sum_left = _mm256_add_epi16(sum_left, sum_above);
  445|     20|  uint16_t sum = (uint16_t)_mm_cvtsi128_si32(_mm256_castsi256_si128(sum_left));
  446|     20|  sum += 48;
  447|     20|  sum /= 96;
  448|     20|  const __m256i row = _mm256_set1_epi8((int8_t)sum);
  449|     20|  row_store_32xh(&row, 64, dst, stride);
  450|     20|}
aom_dc_predictor_64x64_avx2:
  453|    122|                                 const uint8_t *above, const uint8_t *left) {
  454|    122|  const __m256i sum_above = dc_sum_64(above);
  455|    122|  __m256i sum_left = dc_sum_64(left);
  456|    122|  sum_left = _mm256_add_epi16(sum_left, sum_above);
  457|    122|  uint16_t sum = (uint16_t)_mm_cvtsi128_si32(_mm256_castsi256_si128(sum_left));
  458|    122|  sum += 64;
  459|    122|  sum /= 128;
  460|    122|  const __m256i row = _mm256_set1_epi8((int8_t)sum);
  461|    122|  row_store_64xh(&row, 64, dst, stride);
  462|    122|}
aom_dc_predictor_64x32_avx2:
  465|     20|                                 const uint8_t *above, const uint8_t *left) {
  466|     20|  const __m256i sum_above = dc_sum_64(above);
  467|     20|  __m256i sum_left = dc_sum_32(left);
  468|     20|  sum_left = _mm256_add_epi16(sum_left, sum_above);
  469|     20|  uint16_t sum = (uint16_t)_mm_cvtsi128_si32(_mm256_castsi256_si128(sum_left));
  470|     20|  sum += 48;
  471|     20|  sum /= 96;
  472|     20|  const __m256i row = _mm256_set1_epi8((int8_t)sum);
  473|     20|  row_store_64xh(&row, 32, dst, stride);
  474|     20|}
aom_dc_top_predictor_32x16_avx2:
  492|    945|                                     const uint8_t *left) {
  493|    945|  __m256i sum = dc_sum_32(above);
  494|    945|  (void)left;
  495|       |
  496|    945|  const __m256i sixteen = _mm256_set1_epi16(16);
  497|    945|  sum = _mm256_add_epi16(sum, sixteen);
  498|    945|  sum = _mm256_srai_epi16(sum, 5);
  499|    945|  const __m256i zero = _mm256_setzero_si256();
  500|    945|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  501|    945|  row_store_32xh(&row, 16, dst, stride);
  502|    945|}
aom_dc_top_predictor_32x64_avx2:
  506|    169|                                     const uint8_t *left) {
  507|    169|  __m256i sum = dc_sum_32(above);
  508|    169|  (void)left;
  509|       |
  510|    169|  const __m256i sixteen = _mm256_set1_epi16(16);
  511|    169|  sum = _mm256_add_epi16(sum, sixteen);
  512|    169|  sum = _mm256_srai_epi16(sum, 5);
  513|    169|  const __m256i zero = _mm256_setzero_si256();
  514|    169|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  515|    169|  row_store_32xh(&row, 64, dst, stride);
  516|    169|}
aom_dc_top_predictor_64x64_avx2:
  520|    620|                                     const uint8_t *left) {
  521|    620|  __m256i sum = dc_sum_64(above);
  522|    620|  (void)left;
  523|       |
  524|    620|  const __m256i thirtytwo = _mm256_set1_epi16(32);
  525|    620|  sum = _mm256_add_epi16(sum, thirtytwo);
  526|    620|  sum = _mm256_srai_epi16(sum, 6);
  527|    620|  const __m256i zero = _mm256_setzero_si256();
  528|    620|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  529|    620|  row_store_64xh(&row, 64, dst, stride);
  530|    620|}
aom_dc_top_predictor_64x32_avx2:
  534|     85|                                     const uint8_t *left) {
  535|     85|  __m256i sum = dc_sum_64(above);
  536|     85|  (void)left;
  537|       |
  538|     85|  const __m256i thirtytwo = _mm256_set1_epi16(32);
  539|     85|  sum = _mm256_add_epi16(sum, thirtytwo);
  540|     85|  sum = _mm256_srai_epi16(sum, 6);
  541|     85|  const __m256i zero = _mm256_setzero_si256();
  542|     85|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  543|     85|  row_store_64xh(&row, 32, dst, stride);
  544|     85|}
aom_dc_left_predictor_32x16_avx2:
  564|  2.07k|                                      const uint8_t *left) {
  565|  2.07k|  __m128i sum = dc_sum_16_sse2(left);
  566|  2.07k|  (void)above;
  567|       |
  568|  2.07k|  const __m128i eight = _mm_set1_epi16(8);
  569|  2.07k|  sum = _mm_add_epi16(sum, eight);
  570|  2.07k|  sum = _mm_srai_epi16(sum, 4);
  571|  2.07k|  const __m128i zero = _mm_setzero_si128();
  572|  2.07k|  const __m128i r = _mm_shuffle_epi8(sum, zero);
  573|       |  const __m256i row = _mm256_inserti128_si256(_mm256_castsi128_si256(r), r, 1);
  574|  2.07k|  row_store_32xh(&row, 16, dst, stride);
  575|  2.07k|}
aom_dc_left_predictor_32x64_avx2:
  579|    101|                                      const uint8_t *left) {
  580|    101|  __m256i sum = dc_sum_64(left);
  581|    101|  (void)above;
  582|       |
  583|    101|  const __m256i thirtytwo = _mm256_set1_epi16(32);
  584|    101|  sum = _mm256_add_epi16(sum, thirtytwo);
  585|    101|  sum = _mm256_srai_epi16(sum, 6);
  586|    101|  const __m256i zero = _mm256_setzero_si256();
  587|    101|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  588|    101|  row_store_32xh(&row, 64, dst, stride);
  589|    101|}
aom_dc_left_predictor_64x64_avx2:
  593|    649|                                      const uint8_t *left) {
  594|    649|  __m256i sum = dc_sum_64(left);
  595|    649|  (void)above;
  596|       |
  597|    649|  const __m256i thirtytwo = _mm256_set1_epi16(32);
  598|    649|  sum = _mm256_add_epi16(sum, thirtytwo);
  599|    649|  sum = _mm256_srai_epi16(sum, 6);
  600|    649|  const __m256i zero = _mm256_setzero_si256();
  601|    649|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  602|    649|  row_store_64xh(&row, 64, dst, stride);
  603|    649|}
aom_dc_left_predictor_64x32_avx2:
  607|    219|                                      const uint8_t *left) {
  608|    219|  __m256i sum = dc_sum_32(left);
  609|    219|  (void)above;
  610|       |
  611|    219|  const __m256i sixteen = _mm256_set1_epi16(16);
  612|    219|  sum = _mm256_add_epi16(sum, sixteen);
  613|    219|  sum = _mm256_srai_epi16(sum, 5);
  614|    219|  const __m256i zero = _mm256_setzero_si256();
  615|    219|  __m256i row = _mm256_shuffle_epi8(sum, zero);
  616|    219|  row_store_64xh(&row, 32, dst, stride);
  617|    219|}
aom_dc_128_predictor_32x16_avx2:
  638|  3.82k|                                     const uint8_t *left) {
  639|  3.82k|  (void)above;
  640|  3.82k|  (void)left;
  641|  3.82k|  const __m256i row = _mm256_set1_epi8((int8_t)0x80);
  642|  3.82k|  row_store_32xh(&row, 16, dst, stride);
  643|  3.82k|}
aom_dc_128_predictor_32x64_avx2:
  647|  2.00k|                                     const uint8_t *left) {
  648|  2.00k|  (void)above;
  649|  2.00k|  (void)left;
  650|  2.00k|  const __m256i row = _mm256_set1_epi8((int8_t)0x80);
  651|  2.00k|  row_store_32xh(&row, 64, dst, stride);
  652|  2.00k|}
aom_dc_128_predictor_64x64_avx2:
  656|  5.17k|                                     const uint8_t *left) {
  657|  5.17k|  (void)above;
  658|  5.17k|  (void)left;
  659|  5.17k|  const __m256i row = _mm256_set1_epi8((int8_t)0x80);
  660|  5.17k|  row_store_64xh(&row, 64, dst, stride);
  661|  5.17k|}
aom_dc_128_predictor_64x32_avx2:
  665|  2.25k|                                     const uint8_t *left) {
  666|  2.25k|  (void)above;
  667|  2.25k|  (void)left;
  668|  2.25k|  const __m256i row = _mm256_set1_epi8((int8_t)0x80);
  669|  2.25k|  row_store_64xh(&row, 32, dst, stride);
  670|  2.25k|}
aom_v_predictor_32x16_avx2:
  684|    487|                                const uint8_t *above, const uint8_t *left) {
  685|    487|  const __m256i row = _mm256_loadu_si256((const __m256i *)above);
  686|    487|  (void)left;
  687|    487|  row_store_32xh(&row, 16, dst, stride);
  688|    487|}
aom_paeth_predictor_16x8_avx2:
  768|  25.4k|                                   const uint8_t *above, const uint8_t *left) {
  769|  25.4k|  __m128i x = _mm_loadl_epi64((const __m128i *)left);
  770|  25.4k|  const __m256i l = _mm256_inserti128_si256(_mm256_castsi128_si256(x), x, 1);
  771|  25.4k|  const __m256i tl16 = _mm256_set1_epi16((int16_t)above[-1]);
  772|  25.4k|  __m256i rep = _mm256_set1_epi16((short)0x8000);
  773|  25.4k|  const __m256i one = _mm256_set1_epi16(1);
  774|  25.4k|  const __m256i top = get_top_vector(above);
  775|       |
  776|  25.4k|  int i;
  777|   228k|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (777:15): [True: 203k, False: 25.4k]
  ------------------
  778|   203k|    const __m256i l16 = _mm256_shuffle_epi8(l, rep);
  779|   203k|    const __m128i row = paeth_16x1_pred(&l16, &top, &tl16);
  780|       |
  781|   203k|    _mm_store_si128((__m128i *)dst, row);
  782|   203k|    dst += stride;
  783|   203k|    rep = _mm256_add_epi16(rep, one);
  784|   203k|  }
  785|  25.4k|}
aom_paeth_predictor_16x16_avx2:
  793|   109k|                                    const uint8_t *above, const uint8_t *left) {
  794|   109k|  const __m256i l = get_left_vector(left);
  795|   109k|  const __m256i tl16 = _mm256_set1_epi16((int16_t)above[-1]);
  796|   109k|  __m256i rep = _mm256_set1_epi16((short)0x8000);
  797|   109k|  const __m256i one = _mm256_set1_epi16(1);
  798|   109k|  const __m256i top = get_top_vector(above);
  799|       |
  800|   109k|  int i;
  801|  1.86M|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (801:15): [True: 1.75M, False: 109k]
  ------------------
  802|  1.75M|    const __m256i l16 = _mm256_shuffle_epi8(l, rep);
  803|  1.75M|    const __m128i row = paeth_16x1_pred(&l16, &top, &tl16);
  804|       |
  805|  1.75M|    _mm_store_si128((__m128i *)dst, row);
  806|  1.75M|    dst += stride;
  807|  1.75M|    rep = _mm256_add_epi16(rep, one);
  808|  1.75M|  }
  809|   109k|}
aom_paeth_predictor_16x32_avx2:
  812|  2.70k|                                    const uint8_t *above, const uint8_t *left) {
  813|  2.70k|  __m256i l = get_left_vector(left);
  814|  2.70k|  const __m256i tl16 = _mm256_set1_epi16((int16_t)above[-1]);
  815|  2.70k|  __m256i rep = _mm256_set1_epi16((short)0x8000);
  816|  2.70k|  const __m256i one = _mm256_set1_epi16(1);
  817|  2.70k|  const __m256i top = get_top_vector(above);
  818|       |
  819|  2.70k|  int i;
  820|  45.9k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (820:15): [True: 43.2k, False: 2.70k]
  ------------------
  821|  43.2k|    const __m256i l16 = _mm256_shuffle_epi8(l, rep);
  822|  43.2k|    const __m128i row = paeth_16x1_pred(&l16, &top, &tl16);
  823|       |
  824|  43.2k|    _mm_store_si128((__m128i *)dst, row);
  825|  43.2k|    dst += stride;
  826|  43.2k|    rep = _mm256_add_epi16(rep, one);
  827|  43.2k|  }
  828|       |
  829|  2.70k|  l = get_left_vector(left + 16);
  830|  2.70k|  rep = _mm256_set1_epi16((short)0x8000);
  831|  45.9k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (831:15): [True: 43.2k, False: 2.70k]
  ------------------
  832|  43.2k|    const __m256i l16 = _mm256_shuffle_epi8(l, rep);
  833|  43.2k|    const __m128i row = paeth_16x1_pred(&l16, &top, &tl16);
  834|       |
  835|  43.2k|    _mm_store_si128((__m128i *)dst, row);
  836|  43.2k|    dst += stride;
  837|  43.2k|    rep = _mm256_add_epi16(rep, one);
  838|  43.2k|  }
  839|  2.70k|}
aom_paeth_predictor_32x16_avx2:
  879|  3.12k|                                    const uint8_t *above, const uint8_t *left) {
  880|  3.12k|  const __m256i l = get_left_vector(left);
  881|  3.12k|  const __m256i t0 = get_top_vector(above);
  882|  3.12k|  const __m256i t1 = get_top_vector(above + 16);
  883|  3.12k|  const __m256i tl = _mm256_set1_epi16((int16_t)above[-1]);
  884|  3.12k|  __m256i rep = _mm256_set1_epi16((short)0x8000);
  885|  3.12k|  const __m256i one = _mm256_set1_epi16(1);
  886|       |
  887|  3.12k|  int i;
  888|  53.0k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (888:15): [True: 49.9k, False: 3.12k]
  ------------------
  889|  49.9k|    const __m256i l16 = _mm256_shuffle_epi8(l, rep);
  890|       |
  891|  49.9k|    const __m256i r = paeth_32x1_pred(&l16, &t0, &t1, &tl);
  892|       |
  893|  49.9k|    _mm256_storeu_si256((__m256i *)dst, r);
  894|       |
  895|  49.9k|    dst += stride;
  896|  49.9k|    rep = _mm256_add_epi16(rep, one);
  897|  49.9k|  }
  898|  3.12k|}
av1_highbd_dr_prediction_z1_avx2:
 1921|  1.69M|                                      int dx, int dy, int bd) {
 1922|  1.69M|  (void)left;
 1923|  1.69M|  (void)dy;
 1924|       |
 1925|  1.69M|  switch (bw) {
 1926|  1.44M|    case 4:
  ------------------
  |  Branch (1926:5): [True: 1.44M, False: 249k]
  ------------------
 1927|  1.44M|      highbd_dr_prediction_z1_4xN_avx2(bh, dst, stride, above, upsample_above,
 1928|  1.44M|                                       dx, bd);
 1929|  1.44M|      break;
 1930|   245k|    case 8:
  ------------------
  |  Branch (1930:5): [True: 245k, False: 1.44M]
  ------------------
 1931|   245k|      highbd_dr_prediction_z1_8xN_avx2(bh, dst, stride, above, upsample_above,
 1932|   245k|                                       dx, bd);
 1933|   245k|      break;
 1934|  3.69k|    case 16:
  ------------------
  |  Branch (1934:5): [True: 3.69k, False: 1.68M]
  ------------------
 1935|  3.69k|      highbd_dr_prediction_z1_16xN_avx2(bh, dst, stride, above, upsample_above,
 1936|  3.69k|                                        dx, bd);
 1937|  3.69k|      break;
 1938|     67|    case 32:
  ------------------
  |  Branch (1938:5): [True: 67, False: 1.69M]
  ------------------
 1939|     67|      highbd_dr_prediction_z1_32xN_avx2(bh, dst, stride, above, upsample_above,
 1940|     67|                                        dx, bd);
 1941|     67|      break;
 1942|      0|    case 64:
  ------------------
  |  Branch (1942:5): [True: 0, False: 1.69M]
  ------------------
 1943|      0|      if (bd < 12) {
  ------------------
  |  Branch (1943:11): [True: 0, False: 0]
  ------------------
 1944|      0|        highbd_dr_prediction_z1_64xN_avx2(bh, dst, stride, above,
 1945|      0|                                          upsample_above, dx);
 1946|      0|      } else {
 1947|      0|        highbd_dr_prediction_32bit_z1_64xN_avx2(bh, dst, stride, above,
 1948|      0|                                                upsample_above, dx);
 1949|      0|      }
 1950|      0|      break;
 1951|      0|    default: break;
  ------------------
  |  Branch (1951:5): [True: 0, False: 1.69M]
  ------------------
 1952|  1.69M|  }
 1953|  1.69M|  return;
 1954|  1.69M|}
av1_highbd_dr_prediction_z2_avx2:
 2874|  3.86M|                                      int bd) {
 2875|  3.86M|  (void)bd;
 2876|  3.86M|  assert(dx > 0);
 2877|  3.86M|  assert(dy > 0);
 2878|  3.86M|  switch (bw) {
 2879|  2.95M|    case 4:
  ------------------
  |  Branch (2879:5): [True: 2.95M, False: 913k]
  ------------------
 2880|  2.95M|      if (bd < 12) {
  ------------------
  |  Branch (2880:11): [True: 1.41M, False: 1.53M]
  ------------------
 2881|  1.41M|        highbd_dr_prediction_z2_Nx4_avx2(bh, dst, stride, above, left,
 2882|  1.41M|                                         upsample_above, upsample_left, dx, dy);
 2883|  1.53M|      } else {
 2884|  1.53M|        highbd_dr_prediction_32bit_z2_Nx4_avx2(bh, dst, stride, above, left,
 2885|  1.53M|                                               upsample_above, upsample_left,
 2886|  1.53M|                                               dx, dy);
 2887|  1.53M|      }
 2888|  2.95M|      break;
 2889|   859k|    case 8:
  ------------------
  |  Branch (2889:5): [True: 859k, False: 3.00M]
  ------------------
 2890|   859k|      if (bd < 12) {
  ------------------
  |  Branch (2890:11): [True: 385k, False: 473k]
  ------------------
 2891|   385k|        highbd_dr_prediction_z2_Nx8_avx2(bh, dst, stride, above, left,
 2892|   385k|                                         upsample_above, upsample_left, dx, dy);
 2893|   473k|      } else {
 2894|   473k|        highbd_dr_prediction_32bit_z2_Nx8_avx2(bh, dst, stride, above, left,
 2895|   473k|                                               upsample_above, upsample_left,
 2896|   473k|                                               dx, dy);
 2897|   473k|      }
 2898|   859k|      break;
 2899|  54.1k|    default:
  ------------------
  |  Branch (2899:5): [True: 54.1k, False: 3.80M]
  ------------------
 2900|  54.1k|      if (bd < 12) {
  ------------------
  |  Branch (2900:11): [True: 25.0k, False: 29.1k]
  ------------------
 2901|  25.0k|        highbd_dr_prediction_z2_HxW_avx2(bh, bw, dst, stride, above, left,
 2902|  25.0k|                                         upsample_above, upsample_left, dx, dy);
 2903|  29.1k|      } else {
 2904|  29.1k|        highbd_dr_prediction_32bit_z2_HxW_avx2(bh, bw, dst, stride, above, left,
 2905|  29.1k|                                               upsample_above, upsample_left,
 2906|  29.1k|                                               dx, dy);
 2907|  29.1k|      }
 2908|  54.1k|      break;
 2909|  3.86M|  }
 2910|  3.86M|}
av1_highbd_dr_prediction_z3_avx2:
 3342|  1.06M|                                      int dx, int dy, int bd) {
 3343|  1.06M|  (void)above;
 3344|  1.06M|  (void)dx;
 3345|       |
 3346|  1.06M|  assert(dx == 1);
 3347|  1.06M|  assert(dy > 0);
 3348|  1.06M|  if (bw == bh) {
  ------------------
  |  Branch (3348:7): [True: 967k, False: 94.4k]
  ------------------
 3349|   967k|    switch (bw) {
  ------------------
  |  Branch (3349:13): [True: 967k, False: 18.4E]
  ------------------
 3350|   732k|      case 4:
  ------------------
  |  Branch (3350:7): [True: 732k, False: 234k]
  ------------------
 3351|   732k|        highbd_dr_prediction_z3_4x4_avx2(dst, stride, left, upsample_left, dy,
 3352|   732k|                                         bd);
 3353|   732k|        break;
 3354|   230k|      case 8:
  ------------------
  |  Branch (3354:7): [True: 230k, False: 736k]
  ------------------
 3355|   230k|        highbd_dr_prediction_z3_8x8_avx2(dst, stride, left, upsample_left, dy,
 3356|   230k|                                         bd);
 3357|   230k|        break;
 3358|  3.41k|      case 16:
  ------------------
  |  Branch (3358:7): [True: 3.41k, False: 963k]
  ------------------
 3359|  3.41k|        highbd_dr_prediction_z3_16x16_avx2(dst, stride, left, upsample_left, dy,
 3360|  3.41k|                                           bd);
 3361|  3.41k|        break;
 3362|      0|      case 32:
  ------------------
  |  Branch (3362:7): [True: 0, False: 967k]
  ------------------
 3363|      0|        highbd_dr_prediction_z3_32x32_avx2(dst, stride, left, upsample_left, dy,
 3364|      0|                                           bd);
 3365|      0|        break;
 3366|      0|      case 64:
  ------------------
  |  Branch (3366:7): [True: 0, False: 967k]
  ------------------
 3367|      0|        highbd_dr_prediction_z3_64x64_avx2(dst, stride, left, upsample_left, dy,
 3368|      0|                                           bd);
 3369|      0|        break;
 3370|   967k|    }
 3371|   967k|  } else {
 3372|  94.4k|    if (bw < bh) {
  ------------------
  |  Branch (3372:9): [True: 46.0k, False: 48.4k]
  ------------------
 3373|  46.0k|      if (bw + bw == bh) {
  ------------------
  |  Branch (3373:11): [True: 46.0k, False: 0]
  ------------------
 3374|  46.0k|        switch (bw) {
  ------------------
  |  Branch (3374:17): [True: 46.0k, False: 0]
  ------------------
 3375|  43.6k|          case 4:
  ------------------
  |  Branch (3375:11): [True: 43.6k, False: 2.32k]
  ------------------
 3376|  43.6k|            highbd_dr_prediction_z3_4x8_avx2(dst, stride, left, upsample_left,
 3377|  43.6k|                                             dy, bd);
 3378|  43.6k|            break;
 3379|  2.27k|          case 8:
  ------------------
  |  Branch (3379:11): [True: 2.27k, False: 43.7k]
  ------------------
 3380|  2.27k|            highbd_dr_prediction_z3_8x16_avx2(dst, stride, left, upsample_left,
 3381|  2.27k|                                              dy, bd);
 3382|  2.27k|            break;
 3383|     59|          case 16:
  ------------------
  |  Branch (3383:11): [True: 59, False: 45.9k]
  ------------------
 3384|     59|            highbd_dr_prediction_z3_16x32_avx2(dst, stride, left, upsample_left,
 3385|     59|                                               dy, bd);
 3386|     59|            break;
 3387|      0|          case 32:
  ------------------
  |  Branch (3387:11): [True: 0, False: 46.0k]
  ------------------
 3388|      0|            highbd_dr_prediction_z3_32x64_avx2(dst, stride, left, upsample_left,
 3389|      0|                                               dy, bd);
 3390|      0|            break;
 3391|  46.0k|        }
 3392|  46.0k|      } else {
 3393|      0|        switch (bw) {
  ------------------
  |  Branch (3393:17): [True: 0, False: 0]
  ------------------
 3394|      0|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 3395|      0|          case 4:
  ------------------
  |  Branch (3395:11): [True: 0, False: 0]
  ------------------
 3396|      0|            highbd_dr_prediction_z3_4x16_avx2(dst, stride, left, upsample_left,
 3397|      0|                                              dy, bd);
 3398|      0|            break;
 3399|      0|          case 8:
  ------------------
  |  Branch (3399:11): [True: 0, False: 0]
  ------------------
 3400|      0|            highbd_dr_prediction_z3_8x32_avx2(dst, stride, left, upsample_left,
 3401|      0|                                              dy, bd);
 3402|      0|            break;
 3403|      0|          case 16:
  ------------------
  |  Branch (3403:11): [True: 0, False: 0]
  ------------------
 3404|      0|            highbd_dr_prediction_z3_16x64_avx2(dst, stride, left, upsample_left,
 3405|      0|                                               dy, bd);
 3406|      0|            break;
 3407|      0|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 3408|      0|        }
 3409|      0|      }
 3410|  48.4k|    } else {
 3411|  48.4k|      if (bh + bh == bw) {
  ------------------
  |  Branch (3411:11): [True: 48.4k, False: 18.4E]
  ------------------
 3412|  48.4k|        switch (bh) {
  ------------------
  |  Branch (3412:17): [True: 48.4k, False: 18.4E]
  ------------------
 3413|  46.1k|          case 4:
  ------------------
  |  Branch (3413:11): [True: 46.1k, False: 2.29k]
  ------------------
 3414|  46.1k|            highbd_dr_prediction_z3_8x4_avx2(dst, stride, left, upsample_left,
 3415|  46.1k|                                             dy, bd);
 3416|  46.1k|            break;
 3417|  2.13k|          case 8:
  ------------------
  |  Branch (3417:11): [True: 2.13k, False: 46.3k]
  ------------------
 3418|  2.13k|            highbd_dr_prediction_z3_16x8_avx2(dst, stride, left, upsample_left,
 3419|  2.13k|                                              dy, bd);
 3420|  2.13k|            break;
 3421|    160|          case 16:
  ------------------
  |  Branch (3421:11): [True: 160, False: 48.2k]
  ------------------
 3422|    160|            highbd_dr_prediction_z3_32x16_avx2(dst, stride, left, upsample_left,
 3423|    160|                                               dy, bd);
 3424|    160|            break;
 3425|      0|          case 32:
  ------------------
  |  Branch (3425:11): [True: 0, False: 48.4k]
  ------------------
 3426|      0|            highbd_dr_prediction_z3_64x32_avx2(dst, stride, left, upsample_left,
 3427|      0|                                               dy, bd);
 3428|      0|            break;
 3429|  48.4k|        }
 3430|  18.4E|      } else {
 3431|  18.4E|        switch (bh) {
  ------------------
  |  Branch (3431:17): [True: 0, False: 18.4E]
  ------------------
 3432|      0|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 3433|      0|          case 4:
  ------------------
  |  Branch (3433:11): [True: 0, False: 18.4E]
  ------------------
 3434|      0|            highbd_dr_prediction_z3_16x4_avx2(dst, stride, left, upsample_left,
 3435|      0|                                              dy, bd);
 3436|      0|            break;
 3437|      0|          case 8:
  ------------------
  |  Branch (3437:11): [True: 0, False: 18.4E]
  ------------------
 3438|      0|            highbd_dr_prediction_z3_32x8_avx2(dst, stride, left, upsample_left,
 3439|      0|                                              dy, bd);
 3440|      0|            break;
 3441|      0|          case 16:
  ------------------
  |  Branch (3441:11): [True: 0, False: 18.4E]
  ------------------
 3442|      0|            highbd_dr_prediction_z3_64x16_avx2(dst, stride, left, upsample_left,
 3443|      0|                                               dy, bd);
 3444|      0|            break;
 3445|  18.4E|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 3446|  18.4E|        }
 3447|  18.4E|      }
 3448|  48.4k|    }
 3449|  94.4k|  }
 3450|  1.06M|  return;
 3451|  1.06M|}
av1_dr_prediction_z1_avx2:
 3818|  2.35M|                               int upsample_above, int dx, int dy) {
 3819|  2.35M|  (void)left;
 3820|  2.35M|  (void)dy;
 3821|  2.35M|  switch (bw) {
 3822|   966k|    case 4:
  ------------------
  |  Branch (3822:5): [True: 966k, False: 1.38M]
  ------------------
 3823|   966k|      dr_prediction_z1_4xN_avx2(bh, dst, stride, above, upsample_above, dx);
 3824|   966k|      break;
 3825|  1.35M|    case 8:
  ------------------
  |  Branch (3825:5): [True: 1.35M, False: 1.00M]
  ------------------
 3826|  1.35M|      dr_prediction_z1_8xN_avx2(bh, dst, stride, above, upsample_above, dx);
 3827|  1.35M|      break;
 3828|  33.5k|    case 16:
  ------------------
  |  Branch (3828:5): [True: 33.5k, False: 2.31M]
  ------------------
 3829|  33.5k|      dr_prediction_z1_16xN_avx2(bh, dst, stride, above, upsample_above, dx);
 3830|  33.5k|      break;
 3831|    885|    case 32:
  ------------------
  |  Branch (3831:5): [True: 885, False: 2.35M]
  ------------------
 3832|    885|      dr_prediction_z1_32xN_avx2(bh, dst, stride, above, upsample_above, dx);
 3833|    885|      break;
 3834|      0|    case 64:
  ------------------
  |  Branch (3834:5): [True: 0, False: 2.35M]
  ------------------
 3835|      0|      dr_prediction_z1_64xN_avx2(bh, dst, stride, above, upsample_above, dx);
 3836|      0|      break;
 3837|      0|    default: break;
  ------------------
  |  Branch (3837:5): [True: 0, False: 2.35M]
  ------------------
 3838|  2.35M|  }
 3839|  2.35M|  return;
 3840|  2.35M|}
av1_dr_prediction_z2_avx2:
 4247|  5.36M|                               int dy) {
 4248|  5.36M|  assert(dx > 0);
 4249|  5.36M|  assert(dy > 0);
 4250|  5.36M|  switch (bw) {
 4251|  1.68M|    case 4:
  ------------------
  |  Branch (4251:5): [True: 1.68M, False: 3.67M]
  ------------------
 4252|  1.68M|      dr_prediction_z2_Nx4_avx2(bh, dst, stride, above, left, upsample_above,
 4253|  1.68M|                                upsample_left, dx, dy);
 4254|  1.68M|      break;
 4255|  3.48M|    case 8:
  ------------------
  |  Branch (4255:5): [True: 3.48M, False: 1.88M]
  ------------------
 4256|  3.48M|      dr_prediction_z2_Nx8_avx2(bh, dst, stride, above, left, upsample_above,
 4257|  3.48M|                                upsample_left, dx, dy);
 4258|  3.48M|      break;
 4259|   200k|    default:
  ------------------
  |  Branch (4259:5): [True: 200k, False: 5.15M]
  ------------------
 4260|   200k|      dr_prediction_z2_HxW_avx2(bh, bw, dst, stride, above, left,
 4261|   200k|                                upsample_above, upsample_left, dx, dy);
 4262|   200k|      break;
 4263|  5.36M|  }
 4264|  5.36M|  return;
 4265|  5.36M|}
av1_dr_prediction_z3_avx2:
 4652|  2.79M|                               int upsample_left, int dx, int dy) {
 4653|  2.79M|  (void)above;
 4654|  2.79M|  (void)dx;
 4655|  2.79M|  assert(dx == 1);
 4656|  2.79M|  assert(dy > 0);
 4657|       |
 4658|  2.79M|  if (bw == bh) {
  ------------------
  |  Branch (4658:7): [True: 2.61M, False: 177k]
  ------------------
 4659|  2.61M|    switch (bw) {
  ------------------
  |  Branch (4659:13): [True: 2.61M, False: 18.4E]
  ------------------
 4660|   565k|      case 4:
  ------------------
  |  Branch (4660:7): [True: 565k, False: 2.05M]
  ------------------
 4661|   565k|        dr_prediction_z3_4x4_avx2(dst, stride, left, upsample_left, dy);
 4662|   565k|        break;
 4663|  1.98M|      case 8:
  ------------------
  |  Branch (4663:7): [True: 1.98M, False: 629k]
  ------------------
 4664|  1.98M|        dr_prediction_z3_8x8_avx2(dst, stride, left, upsample_left, dy);
 4665|  1.98M|        break;
 4666|  63.9k|      case 16:
  ------------------
  |  Branch (4666:7): [True: 63.9k, False: 2.55M]
  ------------------
 4667|  63.9k|        dr_prediction_z3_16x16_avx2(dst, stride, left, upsample_left, dy);
 4668|  63.9k|        break;
 4669|      0|      case 32:
  ------------------
  |  Branch (4669:7): [True: 0, False: 2.61M]
  ------------------
 4670|      0|        dr_prediction_z3_32x32_avx2(dst, stride, left, upsample_left, dy);
 4671|      0|        break;
 4672|      0|      case 64:
  ------------------
  |  Branch (4672:7): [True: 0, False: 2.61M]
  ------------------
 4673|      0|        dr_prediction_z3_64x64_avx2(dst, stride, left, upsample_left, dy);
 4674|      0|        break;
 4675|  2.61M|    }
 4676|  2.61M|  } else {
 4677|   177k|    if (bw < bh) {
  ------------------
  |  Branch (4677:9): [True: 152k, False: 25.5k]
  ------------------
 4678|   152k|      if (bw + bw == bh) {
  ------------------
  |  Branch (4678:11): [True: 152k, False: 0]
  ------------------
 4679|   152k|        switch (bw) {
  ------------------
  |  Branch (4679:17): [True: 152k, False: 0]
  ------------------
 4680|   126k|          case 4:
  ------------------
  |  Branch (4680:11): [True: 126k, False: 25.2k]
  ------------------
 4681|   126k|            dr_prediction_z3_4x8_avx2(dst, stride, left, upsample_left, dy);
 4682|   126k|            break;
 4683|  24.5k|          case 8:
  ------------------
  |  Branch (4683:11): [True: 24.5k, False: 127k]
  ------------------
 4684|  24.5k|            dr_prediction_z3_8x16_avx2(dst, stride, left, upsample_left, dy);
 4685|  24.5k|            break;
 4686|    682|          case 16:
  ------------------
  |  Branch (4686:11): [True: 682, False: 151k]
  ------------------
 4687|    682|            dr_prediction_z3_16x32_avx2(dst, stride, left, upsample_left, dy);
 4688|    682|            break;
 4689|      0|          case 32:
  ------------------
  |  Branch (4689:11): [True: 0, False: 152k]
  ------------------
 4690|      0|            dr_prediction_z3_32x64_avx2(dst, stride, left, upsample_left, dy);
 4691|      0|            break;
 4692|   152k|        }
 4693|   152k|      } else {
 4694|      0|        switch (bw) {
  ------------------
  |  Branch (4694:17): [True: 0, False: 0]
  ------------------
 4695|      0|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 4696|      0|          case 4:
  ------------------
  |  Branch (4696:11): [True: 0, False: 0]
  ------------------
 4697|      0|            dr_prediction_z3_4x16_avx2(dst, stride, left, upsample_left, dy);
 4698|      0|            break;
 4699|      0|          case 8:
  ------------------
  |  Branch (4699:11): [True: 0, False: 0]
  ------------------
 4700|      0|            dr_prediction_z3_8x32_avx2(dst, stride, left, upsample_left, dy);
 4701|      0|            break;
 4702|      0|          case 16:
  ------------------
  |  Branch (4702:11): [True: 0, False: 0]
  ------------------
 4703|      0|            dr_prediction_z3_16x64_avx2(dst, stride, left, upsample_left, dy);
 4704|      0|            break;
 4705|      0|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 4706|      0|        }
 4707|      0|      }
 4708|   152k|    } else {
 4709|  25.6k|      if (bh + bh == bw) {
  ------------------
  |  Branch (4709:11): [True: 25.6k, False: 18.4E]
  ------------------
 4710|  25.6k|        switch (bh) {
  ------------------
  |  Branch (4710:17): [True: 25.6k, False: 1]
  ------------------
 4711|  5.78k|          case 4:
  ------------------
  |  Branch (4711:11): [True: 5.78k, False: 19.8k]
  ------------------
 4712|  5.78k|            dr_prediction_z3_8x4_avx2(dst, stride, left, upsample_left, dy);
 4713|  5.78k|            break;
 4714|  19.7k|          case 8:
  ------------------
  |  Branch (4714:11): [True: 19.7k, False: 5.95k]
  ------------------
 4715|  19.7k|            dr_prediction_z3_16x8_avx2(dst, stride, left, upsample_left, dy);
 4716|  19.7k|            break;
 4717|    169|          case 16:
  ------------------
  |  Branch (4717:11): [True: 169, False: 25.4k]
  ------------------
 4718|    169|            dr_prediction_z3_32x16_avx2(dst, stride, left, upsample_left, dy);
 4719|    169|            break;
 4720|      0|          case 32:
  ------------------
  |  Branch (4720:11): [True: 0, False: 25.6k]
  ------------------
 4721|      0|            dr_prediction_z3_64x32_avx2(dst, stride, left, upsample_left, dy);
 4722|      0|            break;
 4723|  25.6k|        }
 4724|  18.4E|      } else {
 4725|  18.4E|        switch (bh) {
  ------------------
  |  Branch (4725:17): [True: 0, False: 18.4E]
  ------------------
 4726|      0|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 4727|      0|          case 4:
  ------------------
  |  Branch (4727:11): [True: 0, False: 18.4E]
  ------------------
 4728|      0|            dr_prediction_z3_16x4_avx2(dst, stride, left, upsample_left, dy);
 4729|      0|            break;
 4730|      0|          case 8:
  ------------------
  |  Branch (4730:11): [True: 0, False: 18.4E]
  ------------------
 4731|      0|            dr_prediction_z3_32x8_avx2(dst, stride, left, upsample_left, dy);
 4732|      0|            break;
 4733|      0|          case 16:
  ------------------
  |  Branch (4733:11): [True: 0, False: 18.4E]
  ------------------
 4734|      0|            dr_prediction_z3_64x16_avx2(dst, stride, left, upsample_left, dy);
 4735|      0|            break;
 4736|  18.4E|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 4737|  18.4E|        }
 4738|  18.4E|      }
 4739|  25.5k|    }
 4740|   177k|  }
 4741|  2.79M|}
intrapred_avx2.c:dc_sum_32:
   32|  94.0k|static inline __m256i dc_sum_32(const uint8_t *ref) {
   33|  94.0k|  const __m256i x = _mm256_loadu_si256((const __m256i *)ref);
   34|  94.0k|  const __m256i zero = _mm256_setzero_si256();
   35|  94.0k|  __m256i y = _mm256_sad_epu8(x, zero);
   36|       |  __m256i u = _mm256_permute2x128_si256(y, y, 1);
   37|  94.0k|  y = _mm256_add_epi64(u, y);
   38|  94.0k|  u = _mm256_unpackhi_epi64(y, y);
   39|  94.0k|  return _mm256_add_epi16(y, u);
   40|  94.0k|}
intrapred_avx2.c:row_store_32xh:
   43|   110k|                                  ptrdiff_t stride) {
   44|  3.59M|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (44:19): [True: 3.48M, False: 110k]
  ------------------
   45|  3.48M|    _mm256_storeu_si256((__m256i *)dst, *r);
   46|  3.48M|    dst += stride;
   47|  3.48M|  }
   48|   110k|}
intrapred_avx2.c:h_predictor_32x8line:
  384|  3.55k|                                        ptrdiff_t stride) {
  385|  3.55k|  __m256i t[4];
  386|  3.55k|  __m256i m = _mm256_setzero_si256();
  387|  3.55k|  const __m256i inc = _mm256_set1_epi8(4);
  388|  3.55k|  int i;
  389|       |
  390|  17.7k|  for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (390:15): [True: 14.2k, False: 3.55k]
  ------------------
  391|  14.2k|    t[i] = _mm256_shuffle_epi8(*row, m);
  392|  14.2k|    __m256i r0 = _mm256_permute2x128_si256(t[i], t[i], 0);
  393|       |    __m256i r1 = _mm256_permute2x128_si256(t[i], t[i], 0x11);
  394|  14.2k|    _mm256_storeu_si256((__m256i *)dst, r0);
  395|  14.2k|    _mm256_storeu_si256((__m256i *)(dst + (stride << 4)), r1);
  396|  14.2k|    dst += stride;
  397|  14.2k|    m = _mm256_add_epi8(m, inc);
  398|  14.2k|  }
  399|  3.55k|}
intrapred_avx2.c:dc_sum_64:
   19|  1.73k|static inline __m256i dc_sum_64(const uint8_t *ref) {
   20|  1.73k|  const __m256i x0 = _mm256_loadu_si256((const __m256i *)ref);
   21|  1.73k|  const __m256i x1 = _mm256_loadu_si256((const __m256i *)(ref + 32));
   22|  1.73k|  const __m256i zero = _mm256_setzero_si256();
   23|  1.73k|  __m256i y0 = _mm256_sad_epu8(x0, zero);
   24|  1.73k|  __m256i y1 = _mm256_sad_epu8(x1, zero);
   25|  1.73k|  y0 = _mm256_add_epi64(y0, y1);
   26|       |  __m256i u0 = _mm256_permute2x128_si256(y0, y0, 1);
   27|  1.73k|  y0 = _mm256_add_epi64(u0, y0);
   28|  1.73k|  u0 = _mm256_unpackhi_epi64(y0, y0);
   29|  1.73k|  return _mm256_add_epi16(y0, u0);
   30|  1.73k|}
intrapred_avx2.c:row_store_64xh:
   61|  9.14k|                                  ptrdiff_t stride) {
   62|   512k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (62:19): [True: 502k, False: 9.14k]
  ------------------
   63|   502k|    _mm256_storeu_si256((__m256i *)dst, *r);
   64|   502k|    _mm256_storeu_si256((__m256i *)(dst + 32), *r);
   65|   502k|    dst += stride;
   66|   502k|  }
   67|  9.14k|}
intrapred_avx2.c:get_top_vector:
  759|   144k|static inline __m256i get_top_vector(const uint8_t *above) {
  760|   144k|  const __m128i x = _mm_load_si128((const __m128i *)above);
  761|   144k|  const __m128i zero = _mm_setzero_si128();
  762|   144k|  const __m128i t0 = _mm_unpacklo_epi8(x, zero);
  763|   144k|  const __m128i t1 = _mm_unpackhi_epi8(x, zero);
  764|       |  return _mm256_inserti128_si256(_mm256_castsi128_si256(t0), t1, 1);
  765|   144k|}
intrapred_avx2.c:paeth_16x1_pred:
  752|  2.04M|                                      const __m256i *topleft) {
  753|  2.04M|  const __m256i p0 = paeth_pred(left, top, topleft);
  754|       |  const __m256i p1 = _mm256_permute4x64_epi64(p0, 0xe);
  755|  2.04M|  const __m256i p = _mm256_packus_epi16(p0, p1);
  756|  2.04M|  return _mm256_castsi256_si128(p);
  757|  2.04M|}
intrapred_avx2.c:paeth_pred:
  728|  2.14M|                                 const __m256i *topleft) {
  729|  2.14M|  const __m256i base =
  730|  2.14M|      _mm256_sub_epi16(_mm256_add_epi16(*top, *left), *topleft);
  731|       |
  732|  2.14M|  __m256i pl = _mm256_abs_epi16(_mm256_sub_epi16(base, *left));
  733|  2.14M|  __m256i pt = _mm256_abs_epi16(_mm256_sub_epi16(base, *top));
  734|  2.14M|  __m256i ptl = _mm256_abs_epi16(_mm256_sub_epi16(base, *topleft));
  735|       |
  736|  2.14M|  __m256i mask1 = _mm256_cmpgt_epi16(pl, pt);
  737|  2.14M|  mask1 = _mm256_or_si256(mask1, _mm256_cmpgt_epi16(pl, ptl));
  738|  2.14M|  __m256i mask2 = _mm256_cmpgt_epi16(pt, ptl);
  739|       |
  740|  2.14M|  pl = _mm256_andnot_si256(mask1, *left);
  741|       |
  742|  2.14M|  ptl = _mm256_and_si256(mask2, *topleft);
  743|  2.14M|  pt = _mm256_andnot_si256(mask2, *top);
  744|  2.14M|  pt = _mm256_or_si256(pt, ptl);
  745|  2.14M|  pt = _mm256_and_si256(mask1, pt);
  746|       |
  747|  2.14M|  return _mm256_or_si256(pt, pl);
  748|  2.14M|}
intrapred_avx2.c:get_left_vector:
  787|   118k|static inline __m256i get_left_vector(const uint8_t *left) {
  788|   118k|  const __m128i x = _mm_load_si128((const __m128i *)left);
  789|       |  return _mm256_inserti128_si256(_mm256_castsi128_si256(x), x, 1);
  790|   118k|}
intrapred_avx2.c:paeth_32x1_pred:
  866|  49.9k|                                      const __m256i *topleft) {
  867|  49.9k|  __m256i p0 = paeth_pred(left, top0, topleft);
  868|  49.9k|  __m256i p1 = _mm256_permute4x64_epi64(p0, 0xe);
  869|  49.9k|  const __m256i x0 = _mm256_packus_epi16(p0, p1);
  870|       |
  871|  49.9k|  p0 = paeth_pred(left, top1, topleft);
  872|  49.9k|  p1 = _mm256_permute4x64_epi64(p0, 0xe);
  873|  49.9k|  const __m256i x1 = _mm256_packus_epi16(p0, p1);
  874|       |
  875|       |  return _mm256_permute2x128_si256(x0, x1, 0x20);
  876|  49.9k|}
intrapred_avx2.c:highbd_dr_prediction_z1_4xN_avx2:
 1207|  1.44M|                                             int bd) {
 1208|  1.44M|  __m128i dstvec[16];
 1209|  1.44M|  if (bd < 12) {
  ------------------
  |  Branch (1209:7): [True: 672k, False: 769k]
  ------------------
 1210|   672k|    highbd_dr_prediction_z1_4xN_internal_avx2(N, dstvec, above, upsample_above,
 1211|   672k|                                              dx);
 1212|   769k|  } else {
 1213|   769k|    highbd_dr_prediction_32bit_z1_4xN_internal_avx2(N, dstvec, above,
 1214|   769k|                                                    upsample_above, dx);
 1215|   769k|  }
 1216|  7.51M|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (1216:19): [True: 6.07M, False: 1.44M]
  ------------------
 1217|  6.07M|    _mm_storel_epi64((__m128i *)(dst + stride * i), dstvec[i]);
 1218|  6.07M|  }
 1219|  1.44M|}
intrapred_avx2.c:highbd_dr_prediction_z1_4xN_internal_avx2:
 1064|  1.05M|    int N, __m128i *dst, const uint16_t *above, int upsample_above, int dx) {
 1065|  1.05M|  const int frac_bits = 6 - upsample_above;
 1066|  1.05M|  const int max_base_x = ((N + 4) - 1) << upsample_above;
 1067|       |
 1068|  1.05M|  assert(dx > 0);
 1069|       |  // pre-filter above pixels
 1070|       |  // store in temp buffers:
 1071|       |  //   above[x] * 32 + 16
 1072|       |  //   above[x+1] - above[x]
 1073|       |  // final pixels will be calculated as:
 1074|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1075|  1.05M|  __m256i a0, a1, a32, a16;
 1076|  1.05M|  __m256i diff, c3f;
 1077|  1.05M|  __m128i a_mbase_x, max_base_x128, base_inc128, mask128;
 1078|  1.05M|  __m128i a0_128, a1_128;
 1079|  1.05M|  a16 = _mm256_set1_epi16(16);
 1080|  1.05M|  a_mbase_x = _mm_set1_epi16(above[max_base_x]);
 1081|  1.05M|  max_base_x128 = _mm_set1_epi16(max_base_x);
 1082|  1.05M|  c3f = _mm256_set1_epi16(0x3f);
 1083|       |
 1084|  1.05M|  int x = dx;
 1085|  5.46M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1085:19): [True: 4.41M, False: 1.05M]
  ------------------
 1086|  4.41M|    __m256i b, res, shift;
 1087|  4.41M|    __m128i res1;
 1088|       |
 1089|  4.41M|    int base = x >> frac_bits;
 1090|  4.41M|    if (base >= max_base_x) {
  ------------------
  |  Branch (1090:9): [True: 94, False: 4.41M]
  ------------------
 1091|    188|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1091:23): [True: 94, False: 94]
  ------------------
 1092|     94|        dst[i] = a_mbase_x;  // save 4 values
 1093|     94|      }
 1094|     94|      return;
 1095|     94|    }
 1096|       |
 1097|  4.41M|    a0_128 = _mm_loadu_si128((__m128i *)(above + base));
 1098|  4.41M|    a1_128 = _mm_loadu_si128((__m128i *)(above + base + 1));
 1099|       |
 1100|  4.41M|    if (upsample_above) {
  ------------------
  |  Branch (1100:9): [True: 3.06M, False: 1.34M]
  ------------------
 1101|  3.06M|      a0_128 = _mm_shuffle_epi8(a0_128, *(__m128i *)HighbdEvenOddMaskx4[0]);
 1102|  3.06M|      a1_128 = _mm_srli_si128(a0_128, 8);
 1103|       |
 1104|  3.06M|      base_inc128 = _mm_setr_epi16(base, base + 2, base + 4, base + 6, base + 8,
 1105|  3.06M|                                   base + 10, base + 12, base + 14);
 1106|  3.06M|      shift = _mm256_srli_epi16(
 1107|  3.06M|          _mm256_and_si256(
 1108|  3.06M|              _mm256_slli_epi16(_mm256_set1_epi16(x), upsample_above),
 1109|  3.06M|              _mm256_set1_epi16(0x3f)),
 1110|  3.06M|          1);
 1111|  3.06M|    } else {
 1112|  1.34M|      base_inc128 = _mm_setr_epi16(base, base + 1, base + 2, base + 3, base + 4,
 1113|  1.34M|                                   base + 5, base + 6, base + 7);
 1114|  1.34M|      shift = _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 1115|  1.34M|    }
 1116|  4.41M|    a0 = _mm256_castsi128_si256(a0_128);
 1117|  4.41M|    a1 = _mm256_castsi128_si256(a1_128);
 1118|  4.41M|    diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 1119|  4.41M|    a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 1120|  4.41M|    a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 1121|       |
 1122|  4.41M|    b = _mm256_mullo_epi16(diff, shift);
 1123|  4.41M|    res = _mm256_add_epi16(a32, b);
 1124|  4.41M|    res = _mm256_srli_epi16(res, 5);
 1125|  4.41M|    res1 = _mm256_castsi256_si128(res);
 1126|       |
 1127|  4.41M|    mask128 = _mm_cmpgt_epi16(max_base_x128, base_inc128);
 1128|  4.41M|    dst[r] = _mm_blendv_epi8(a_mbase_x, res1, mask128);
 1129|  4.41M|    x += dx;
 1130|  4.41M|  }
 1131|  1.05M|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z1_4xN_internal_avx2:
 1134|  1.16M|    int N, __m128i *dst, const uint16_t *above, int upsample_above, int dx) {
 1135|  1.16M|  const int frac_bits = 6 - upsample_above;
 1136|  1.16M|  const int max_base_x = ((N + 4) - 1) << upsample_above;
 1137|       |
 1138|  1.16M|  assert(dx > 0);
 1139|       |  // pre-filter above pixels
 1140|       |  // store in temp buffers:
 1141|       |  //   above[x] * 32 + 16
 1142|       |  //   above[x+1] - above[x]
 1143|       |  // final pixels will be calculated as:
 1144|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1145|  1.16M|  __m256i a0, a1, a32, a16;
 1146|  1.16M|  __m256i diff;
 1147|  1.16M|  __m128i a_mbase_x, max_base_x128, base_inc128, mask128;
 1148|       |
 1149|  1.16M|  a16 = _mm256_set1_epi32(16);
 1150|  1.16M|  a_mbase_x = _mm_set1_epi16(above[max_base_x]);
 1151|  1.16M|  max_base_x128 = _mm_set1_epi32(max_base_x);
 1152|       |
 1153|  1.16M|  int x = dx;
 1154|  6.12M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1154:19): [True: 4.96M, False: 1.16M]
  ------------------
 1155|  4.96M|    __m256i b, res, shift;
 1156|  4.96M|    __m128i res1;
 1157|       |
 1158|  4.96M|    int base = x >> frac_bits;
 1159|  4.96M|    if (base >= max_base_x) {
  ------------------
  |  Branch (1159:9): [True: 42, False: 4.96M]
  ------------------
 1160|     84|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1160:23): [True: 42, False: 42]
  ------------------
 1161|     42|        dst[i] = a_mbase_x;  // save 4 values
 1162|     42|      }
 1163|     42|      return;
 1164|     42|    }
 1165|       |
 1166|  4.96M|    a0 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base)));
 1167|  4.96M|    a1 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 1)));
 1168|       |
 1169|  4.96M|    if (upsample_above) {
  ------------------
  |  Branch (1169:9): [True: 3.34M, False: 1.62M]
  ------------------
 1170|  3.34M|      a0 = _mm256_permutevar8x32_epi32(
 1171|  3.34M|          a0, _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0));
 1172|  3.34M|      a1 = _mm256_castsi128_si256(_mm256_extracti128_si256(a0, 1));
 1173|  3.34M|      base_inc128 = _mm_setr_epi32(base, base + 2, base + 4, base + 6);
 1174|  3.34M|      shift = _mm256_srli_epi32(
 1175|  3.34M|          _mm256_and_si256(
 1176|  3.34M|              _mm256_slli_epi32(_mm256_set1_epi32(x), upsample_above),
 1177|  3.34M|              _mm256_set1_epi32(0x3f)),
 1178|  3.34M|          1);
 1179|  3.34M|    } else {
 1180|  1.62M|      base_inc128 = _mm_setr_epi32(base, base + 1, base + 2, base + 3);
 1181|  1.62M|      shift = _mm256_srli_epi32(
 1182|  1.62M|          _mm256_and_si256(_mm256_set1_epi32(x), _mm256_set1_epi32(0x3f)), 1);
 1183|  1.62M|    }
 1184|       |
 1185|  4.96M|    diff = _mm256_sub_epi32(a1, a0);   // a[x+1] - a[x]
 1186|  4.96M|    a32 = _mm256_slli_epi32(a0, 5);    // a[x] * 32
 1187|  4.96M|    a32 = _mm256_add_epi32(a32, a16);  // a[x] * 32 + 16
 1188|       |
 1189|  4.96M|    b = _mm256_mullo_epi32(diff, shift);
 1190|  4.96M|    res = _mm256_add_epi32(a32, b);
 1191|  4.96M|    res = _mm256_srli_epi32(res, 5);
 1192|       |
 1193|  4.96M|    res1 = _mm256_castsi256_si128(res);
 1194|  4.96M|    res1 = _mm_packus_epi32(res1, res1);
 1195|       |
 1196|  4.96M|    mask128 = _mm_cmpgt_epi32(max_base_x128, base_inc128);
 1197|  4.96M|    mask128 = _mm_packs_epi32(mask128, mask128);  // goto 16 bit
 1198|  4.96M|    dst[r] = _mm_blendv_epi8(a_mbase_x, res1, mask128);
 1199|  4.96M|    x += dx;
 1200|  4.96M|  }
 1201|  1.16M|}
intrapred_avx2.c:highbd_dr_prediction_z1_8xN_avx2:
 1390|   245k|                                             int bd) {
 1391|   245k|  __m128i dstvec[32];
 1392|   245k|  if (bd < 12) {
  ------------------
  |  Branch (1392:7): [True: 104k, False: 141k]
  ------------------
 1393|   104k|    highbd_dr_prediction_z1_8xN_internal_avx2(N, dstvec, above, upsample_above,
 1394|   104k|                                              dx);
 1395|   141k|  } else {
 1396|   141k|    highbd_dr_prediction_32bit_z1_8xN_internal_avx2(N, dstvec, above,
 1397|   141k|                                                    upsample_above, dx);
 1398|   141k|  }
 1399|  1.94M|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (1399:19): [True: 1.69M, False: 245k]
  ------------------
 1400|  1.69M|    _mm_storeu_si128((__m128i *)(dst + stride * i), dstvec[i]);
 1401|  1.69M|  }
 1402|   245k|}
intrapred_avx2.c:highbd_dr_prediction_z1_8xN_internal_avx2:
 1305|   233k|    int N, __m128i *dst, const uint16_t *above, int upsample_above, int dx) {
 1306|   233k|  const int frac_bits = 6 - upsample_above;
 1307|   233k|  const int max_base_x = ((8 + N) - 1) << upsample_above;
 1308|       |
 1309|   233k|  assert(dx > 0);
 1310|       |  // pre-filter above pixels
 1311|       |  // store in temp buffers:
 1312|       |  //   above[x] * 32 + 16
 1313|       |  //   above[x+1] - above[x]
 1314|       |  // final pixels will be calculated as:
 1315|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1316|   233k|  __m256i a0, a1, a32, a16, c3f;
 1317|   233k|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1318|   233k|  __m128i a0_x128, a1_x128;
 1319|       |
 1320|   233k|  a16 = _mm256_set1_epi16(16);
 1321|   233k|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1322|   233k|  max_base_x256 = _mm256_set1_epi16(max_base_x);
 1323|   233k|  c3f = _mm256_set1_epi16(0x3f);
 1324|       |
 1325|   233k|  int x = dx;
 1326|  1.94M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1326:19): [True: 1.71M, False: 233k]
  ------------------
 1327|  1.71M|    __m256i b, res, res1, shift;
 1328|       |
 1329|  1.71M|    int base = x >> frac_bits;
 1330|  1.71M|    if (base >= max_base_x) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 1.71M]
  ------------------
 1331|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1331:23): [True: 0, False: 0]
  ------------------
 1332|      0|        dst[i] = _mm256_castsi256_si128(a_mbase_x);  // save 8 values
 1333|      0|      }
 1334|      0|      return;
 1335|      0|    }
 1336|       |
 1337|  1.71M|    a0_x128 = _mm_loadu_si128((__m128i *)(above + base));
 1338|  1.71M|    if (upsample_above) {
  ------------------
  |  Branch (1338:9): [True: 1.60M, False: 109k]
  ------------------
 1339|  1.60M|      __m128i mask, atmp0, atmp1, atmp2, atmp3;
 1340|  1.60M|      a1_x128 = _mm_loadu_si128((__m128i *)(above + base + 8));
 1341|  1.60M|      atmp0 = _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdEvenOddMaskx[0]);
 1342|  1.60M|      atmp1 = _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdEvenOddMaskx[0]);
 1343|  1.60M|      atmp2 =
 1344|  1.60M|          _mm_shuffle_epi8(a0_x128, *(__m128i *)(HighbdEvenOddMaskx[0] + 16));
 1345|  1.60M|      atmp3 =
 1346|  1.60M|          _mm_shuffle_epi8(a1_x128, *(__m128i *)(HighbdEvenOddMaskx[0] + 16));
 1347|  1.60M|      mask =
 1348|  1.60M|          _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[0], _mm_set1_epi8(15));
 1349|  1.60M|      a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask);
 1350|  1.60M|      mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[0] + 16),
 1351|  1.60M|                            _mm_set1_epi8(15));
 1352|  1.60M|      a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask);
 1353|       |
 1354|  1.60M|      base_inc256 = _mm256_setr_epi16(base, base + 2, base + 4, base + 6,
 1355|  1.60M|                                      base + 8, base + 10, base + 12, base + 14,
 1356|  1.60M|                                      0, 0, 0, 0, 0, 0, 0, 0);
 1357|  1.60M|      shift = _mm256_srli_epi16(
 1358|  1.60M|          _mm256_and_si256(
 1359|  1.60M|              _mm256_slli_epi16(_mm256_set1_epi16(x), upsample_above), c3f),
 1360|  1.60M|          1);
 1361|  1.60M|    } else {
 1362|   109k|      a1_x128 = _mm_loadu_si128((__m128i *)(above + base + 1));
 1363|   109k|      base_inc256 = _mm256_setr_epi16(base, base + 1, base + 2, base + 3,
 1364|   109k|                                      base + 4, base + 5, base + 6, base + 7, 0,
 1365|   109k|                                      0, 0, 0, 0, 0, 0, 0);
 1366|   109k|      shift = _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 1367|   109k|    }
 1368|  1.71M|    a0 = _mm256_castsi128_si256(a0_x128);
 1369|  1.71M|    a1 = _mm256_castsi128_si256(a1_x128);
 1370|       |
 1371|  1.71M|    diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 1372|  1.71M|    a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 1373|  1.71M|    a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 1374|       |
 1375|  1.71M|    b = _mm256_mullo_epi16(diff, shift);
 1376|  1.71M|    res = _mm256_add_epi16(a32, b);
 1377|  1.71M|    res = _mm256_srli_epi16(res, 5);
 1378|       |
 1379|  1.71M|    mask256 = _mm256_cmpgt_epi16(max_base_x256, base_inc256);
 1380|  1.71M|    res1 = _mm256_blendv_epi8(a_mbase_x, res, mask256);
 1381|  1.71M|    dst[r] = _mm256_castsi256_si128(res1);
 1382|  1.71M|    x += dx;
 1383|  1.71M|  }
 1384|   233k|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z1_8xN_internal_avx2:
 1222|   289k|    int N, __m128i *dst, const uint16_t *above, int upsample_above, int dx) {
 1223|   289k|  const int frac_bits = 6 - upsample_above;
 1224|   289k|  const int max_base_x = ((8 + N) - 1) << upsample_above;
 1225|       |
 1226|   289k|  assert(dx > 0);
 1227|       |  // pre-filter above pixels
 1228|       |  // store in temp buffers:
 1229|       |  //   above[x] * 32 + 16
 1230|       |  //   above[x+1] - above[x]
 1231|       |  // final pixels will be calculated as:
 1232|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1233|   289k|  __m256i a0, a1, a0_1, a1_1, a32, a16;
 1234|   289k|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1235|       |
 1236|   289k|  a16 = _mm256_set1_epi32(16);
 1237|   289k|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1238|   289k|  max_base_x256 = _mm256_set1_epi32(max_base_x);
 1239|       |
 1240|   289k|  int x = dx;
 1241|  2.33M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1241:19): [True: 2.04M, False: 289k]
  ------------------
 1242|  2.04M|    __m256i b, res, res1, shift;
 1243|       |
 1244|  2.04M|    int base = x >> frac_bits;
 1245|  2.04M|    if (base >= max_base_x) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 2.04M]
  ------------------
 1246|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1246:23): [True: 0, False: 0]
  ------------------
 1247|      0|        dst[i] = _mm256_castsi256_si128(a_mbase_x);  // save 8 values
 1248|      0|      }
 1249|      0|      return;
 1250|      0|    }
 1251|       |
 1252|  2.04M|    a0 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base)));
 1253|  2.04M|    a1 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 1)));
 1254|       |
 1255|  2.04M|    if (upsample_above) {
  ------------------
  |  Branch (1255:9): [True: 1.83M, False: 206k]
  ------------------
 1256|  1.83M|      a0 = _mm256_permutevar8x32_epi32(
 1257|  1.83M|          a0, _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0));
 1258|  1.83M|      a1 = _mm256_castsi128_si256(_mm256_extracti128_si256(a0, 1));
 1259|       |
 1260|  1.83M|      a0_1 =
 1261|  1.83M|          _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 8)));
 1262|  1.83M|      a0_1 = _mm256_permutevar8x32_epi32(
 1263|  1.83M|          a0_1, _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0));
 1264|  1.83M|      a1_1 = _mm256_castsi128_si256(_mm256_extracti128_si256(a0_1, 1));
 1265|       |
 1266|  1.83M|      a0 = _mm256_inserti128_si256(a0, _mm256_castsi256_si128(a0_1), 1);
 1267|  1.83M|      a1 = _mm256_inserti128_si256(a1, _mm256_castsi256_si128(a1_1), 1);
 1268|  1.83M|      base_inc256 =
 1269|  1.83M|          _mm256_setr_epi32(base, base + 2, base + 4, base + 6, base + 8,
 1270|  1.83M|                            base + 10, base + 12, base + 14);
 1271|  1.83M|      shift = _mm256_srli_epi32(
 1272|  1.83M|          _mm256_and_si256(
 1273|  1.83M|              _mm256_slli_epi32(_mm256_set1_epi32(x), upsample_above),
 1274|  1.83M|              _mm256_set1_epi32(0x3f)),
 1275|  1.83M|          1);
 1276|  1.83M|    } else {
 1277|   206k|      base_inc256 = _mm256_setr_epi32(base, base + 1, base + 2, base + 3,
 1278|   206k|                                      base + 4, base + 5, base + 6, base + 7);
 1279|   206k|      shift = _mm256_srli_epi32(
 1280|   206k|          _mm256_and_si256(_mm256_set1_epi32(x), _mm256_set1_epi32(0x3f)), 1);
 1281|   206k|    }
 1282|       |
 1283|  2.04M|    diff = _mm256_sub_epi32(a1, a0);   // a[x+1] - a[x]
 1284|  2.04M|    a32 = _mm256_slli_epi32(a0, 5);    // a[x] * 32
 1285|  2.04M|    a32 = _mm256_add_epi32(a32, a16);  // a[x] * 32 + 16
 1286|       |
 1287|  2.04M|    b = _mm256_mullo_epi32(diff, shift);
 1288|  2.04M|    res = _mm256_add_epi32(a32, b);
 1289|  2.04M|    res = _mm256_srli_epi32(res, 5);
 1290|       |
 1291|  2.04M|    res1 = _mm256_packus_epi32(
 1292|  2.04M|        res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1)));
 1293|       |
 1294|  2.04M|    mask256 = _mm256_cmpgt_epi32(max_base_x256, base_inc256);
 1295|  2.04M|    mask256 = _mm256_packs_epi32(
 1296|  2.04M|        mask256, _mm256_castsi128_si256(
 1297|       |                     _mm256_extracti128_si256(mask256, 1)));  // goto 16 bit
 1298|  2.04M|    res1 = _mm256_blendv_epi8(a_mbase_x, res1, mask256);
 1299|  2.04M|    dst[r] = _mm256_castsi256_si128(res1);
 1300|  2.04M|    x += dx;
 1301|  2.04M|  }
 1302|   289k|}
intrapred_avx2.c:highbd_dr_prediction_z1_16xN_avx2:
 1543|  3.69k|                                              int bd) {
 1544|  3.69k|  __m256i dstvec[64];
 1545|  3.69k|  if (bd < 12) {
  ------------------
  |  Branch (1545:7): [True: 1.57k, False: 2.11k]
  ------------------
 1546|  1.57k|    highbd_dr_prediction_z1_16xN_internal_avx2(N, dstvec, above, upsample_above,
 1547|  1.57k|                                               dx);
 1548|  2.11k|  } else {
 1549|  2.11k|    highbd_dr_prediction_32bit_z1_16xN_internal_avx2(N, dstvec, above,
 1550|  2.11k|                                                     upsample_above, dx);
 1551|  2.11k|  }
 1552|  43.8k|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (1552:19): [True: 40.1k, False: 3.69k]
  ------------------
 1553|  40.1k|    _mm256_storeu_si256((__m256i *)(dst + stride * i), dstvec[i]);
 1554|  40.1k|  }
 1555|  3.69k|}
intrapred_avx2.c:highbd_dr_prediction_z1_16xN_internal_avx2:
 1484|  4.34k|    int N, __m256i *dstvec, const uint16_t *above, int upsample_above, int dx) {
 1485|       |  // here upsample_above is 0 by design of av1_use_intra_edge_upsample
 1486|  4.34k|  (void)upsample_above;
 1487|  4.34k|  const int frac_bits = 6;
 1488|  4.34k|  const int max_base_x = ((16 + N) - 1);
 1489|       |
 1490|       |  // pre-filter above pixels
 1491|       |  // store in temp buffers:
 1492|       |  //   above[x] * 32 + 16
 1493|       |  //   above[x+1] - above[x]
 1494|       |  // final pixels will be calculated as:
 1495|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1496|  4.34k|  __m256i a0, a1, a32, a16, c3f;
 1497|  4.34k|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1498|       |
 1499|  4.34k|  a16 = _mm256_set1_epi16(16);
 1500|  4.34k|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1501|  4.34k|  max_base_x256 = _mm256_set1_epi16(max_base_x);
 1502|  4.34k|  c3f = _mm256_set1_epi16(0x3f);
 1503|       |
 1504|  4.34k|  int x = dx;
 1505|  57.9k|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1505:19): [True: 53.6k, False: 4.34k]
  ------------------
 1506|  53.6k|    __m256i b, res;
 1507|       |
 1508|  53.6k|    int base = x >> frac_bits;
 1509|  53.6k|    if (base >= max_base_x) {
  ------------------
  |  Branch (1509:9): [True: 0, False: 53.6k]
  ------------------
 1510|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1510:23): [True: 0, False: 0]
  ------------------
 1511|      0|        dstvec[i] = a_mbase_x;  // save 16 values
 1512|      0|      }
 1513|      0|      return;
 1514|      0|    }
 1515|  53.6k|    __m256i shift =
 1516|  53.6k|        _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 1517|       |
 1518|  53.6k|    a0 = _mm256_loadu_si256((__m256i *)(above + base));
 1519|  53.6k|    a1 = _mm256_loadu_si256((__m256i *)(above + base + 1));
 1520|       |
 1521|  53.6k|    diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 1522|  53.6k|    a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 1523|  53.6k|    a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 1524|  53.6k|    b = _mm256_mullo_epi16(diff, shift);
 1525|       |
 1526|  53.6k|    res = _mm256_add_epi16(a32, b);
 1527|  53.6k|    res = _mm256_srli_epi16(res, 5);  // 16 16bit values
 1528|       |
 1529|  53.6k|    base_inc256 = _mm256_setr_epi16(base, base + 1, base + 2, base + 3,
 1530|  53.6k|                                    base + 4, base + 5, base + 6, base + 7,
 1531|  53.6k|                                    base + 8, base + 9, base + 10, base + 11,
 1532|  53.6k|                                    base + 12, base + 13, base + 14, base + 15);
 1533|  53.6k|    mask256 = _mm256_cmpgt_epi16(max_base_x256, base_inc256);
 1534|  53.6k|    dstvec[r] = _mm256_blendv_epi8(a_mbase_x, res, mask256);
 1535|  53.6k|    x += dx;
 1536|  53.6k|  }
 1537|  4.34k|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z1_16xN_internal_avx2:
 1405|  5.19k|    int N, __m256i *dstvec, const uint16_t *above, int upsample_above, int dx) {
 1406|       |  // here upsample_above is 0 by design of av1_use_intra_edge_upsample
 1407|  5.19k|  (void)upsample_above;
 1408|  5.19k|  const int frac_bits = 6;
 1409|  5.19k|  const int max_base_x = ((16 + N) - 1);
 1410|       |
 1411|       |  // pre-filter above pixels
 1412|       |  // store in temp buffers:
 1413|       |  //   above[x] * 32 + 16
 1414|       |  //   above[x+1] - above[x]
 1415|       |  // final pixels will be calculated as:
 1416|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1417|  5.19k|  __m256i a0, a0_1, a1, a1_1, a32, a16;
 1418|  5.19k|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1419|       |
 1420|  5.19k|  a16 = _mm256_set1_epi32(16);
 1421|  5.19k|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1422|  5.19k|  max_base_x256 = _mm256_set1_epi16(max_base_x);
 1423|       |
 1424|  5.19k|  int x = dx;
 1425|  69.6k|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1425:19): [True: 64.4k, False: 5.19k]
  ------------------
 1426|  64.4k|    __m256i b, res[2], res1;
 1427|       |
 1428|  64.4k|    int base = x >> frac_bits;
 1429|  64.4k|    if (base >= max_base_x) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 64.4k]
  ------------------
 1430|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1430:23): [True: 0, False: 0]
  ------------------
 1431|      0|        dstvec[i] = a_mbase_x;  // save 16 values
 1432|      0|      }
 1433|      0|      return;
 1434|      0|    }
 1435|  64.4k|    __m256i shift = _mm256_srli_epi32(
 1436|  64.4k|        _mm256_and_si256(_mm256_set1_epi32(x), _mm256_set1_epi32(0x3f)), 1);
 1437|       |
 1438|  64.4k|    a0 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base)));
 1439|  64.4k|    a1 = _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 1)));
 1440|       |
 1441|  64.4k|    diff = _mm256_sub_epi32(a1, a0);   // a[x+1] - a[x]
 1442|  64.4k|    a32 = _mm256_slli_epi32(a0, 5);    // a[x] * 32
 1443|  64.4k|    a32 = _mm256_add_epi32(a32, a16);  // a[x] * 32 + 16
 1444|  64.4k|    b = _mm256_mullo_epi32(diff, shift);
 1445|       |
 1446|  64.4k|    res[0] = _mm256_add_epi32(a32, b);
 1447|  64.4k|    res[0] = _mm256_srli_epi32(res[0], 5);
 1448|  64.4k|    res[0] = _mm256_packus_epi32(
 1449|  64.4k|        res[0], _mm256_castsi128_si256(_mm256_extracti128_si256(res[0], 1)));
 1450|       |
 1451|  64.4k|    int mdif = max_base_x - base;
 1452|  64.4k|    if (mdif > 8) {
  ------------------
  |  Branch (1452:9): [True: 64.4k, False: 0]
  ------------------
 1453|  64.4k|      a0_1 =
 1454|  64.4k|          _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 8)));
 1455|  64.4k|      a1_1 =
 1456|  64.4k|          _mm256_cvtepu16_epi32(_mm_loadu_si128((__m128i *)(above + base + 9)));
 1457|       |
 1458|  64.4k|      diff = _mm256_sub_epi32(a1_1, a0_1);  // a[x+1] - a[x]
 1459|  64.4k|      a32 = _mm256_slli_epi32(a0_1, 5);     // a[x] * 32
 1460|  64.4k|      a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 1461|  64.4k|      b = _mm256_mullo_epi32(diff, shift);
 1462|       |
 1463|  64.4k|      res[1] = _mm256_add_epi32(a32, b);
 1464|  64.4k|      res[1] = _mm256_srli_epi32(res[1], 5);
 1465|  64.4k|      res[1] = _mm256_packus_epi32(
 1466|  64.4k|          res[1], _mm256_castsi128_si256(_mm256_extracti128_si256(res[1], 1)));
 1467|  64.4k|    } else {
 1468|      0|      res[1] = a_mbase_x;
 1469|      0|    }
 1470|  64.4k|    res1 = _mm256_inserti128_si256(res[0], _mm256_castsi256_si128(res[1]),
 1471|  64.4k|                                   1);  // 16 16bit values
 1472|       |
 1473|  64.4k|    base_inc256 = _mm256_setr_epi16(base, base + 1, base + 2, base + 3,
 1474|  64.4k|                                    base + 4, base + 5, base + 6, base + 7,
 1475|  64.4k|                                    base + 8, base + 9, base + 10, base + 11,
 1476|  64.4k|                                    base + 12, base + 13, base + 14, base + 15);
 1477|  64.4k|    mask256 = _mm256_cmpgt_epi16(max_base_x256, base_inc256);
 1478|  64.4k|    dstvec[r] = _mm256_blendv_epi8(a_mbase_x, res1, mask256);
 1479|  64.4k|    x += dx;
 1480|  64.4k|  }
 1481|  5.19k|}
intrapred_avx2.c:highbd_dr_prediction_z1_32xN_avx2:
 1730|     67|                                              int bd) {
 1731|     67|  __m256i dstvec[128];
 1732|     67|  if (bd < 12) {
  ------------------
  |  Branch (1732:7): [True: 51, False: 16]
  ------------------
 1733|     51|    highbd_dr_prediction_z1_32xN_internal_avx2(N, dstvec, above, upsample_above,
 1734|     51|                                               dx);
 1735|     51|  } else {
 1736|     16|    highbd_dr_prediction_32bit_z1_32xN_internal_avx2(N, dstvec, above,
 1737|     16|                                                     upsample_above, dx);
 1738|     16|  }
 1739|  1.13k|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (1739:19): [True: 1.07k, False: 67]
  ------------------
 1740|  1.07k|    _mm256_storeu_si256((__m256i *)(dst + stride * i), dstvec[i]);
 1741|  1.07k|    _mm256_storeu_si256((__m256i *)(dst + stride * i + 16), dstvec[i + N]);
 1742|  1.07k|  }
 1743|     67|}
intrapred_avx2.c:highbd_dr_prediction_z1_32xN_internal_avx2:
 1655|     70|    int N, __m256i *dstvec, const uint16_t *above, int upsample_above, int dx) {
 1656|       |  // here upsample_above is 0 by design of av1_use_intra_edge_upsample
 1657|     70|  (void)upsample_above;
 1658|     70|  const int frac_bits = 6;
 1659|     70|  const int max_base_x = ((32 + N) - 1);
 1660|       |
 1661|       |  // pre-filter above pixels
 1662|       |  // store in temp buffers:
 1663|       |  //   above[x] * 32 + 16
 1664|       |  //   above[x+1] - above[x]
 1665|       |  // final pixels will be calculated as:
 1666|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1667|     70|  __m256i a0, a1, a32, a16, c3f;
 1668|     70|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1669|       |
 1670|     70|  a16 = _mm256_set1_epi16(16);
 1671|     70|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1672|     70|  max_base_x256 = _mm256_set1_epi16(max_base_x);
 1673|     70|  c3f = _mm256_set1_epi16(0x3f);
 1674|       |
 1675|     70|  int x = dx;
 1676|  1.19k|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1676:19): [True: 1.12k, False: 70]
  ------------------
 1677|  1.12k|    __m256i b, res;
 1678|       |
 1679|  1.12k|    int base = x >> frac_bits;
 1680|  1.12k|    if (base >= max_base_x) {
  ------------------
  |  Branch (1680:9): [True: 0, False: 1.12k]
  ------------------
 1681|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1681:23): [True: 0, False: 0]
  ------------------
 1682|      0|        dstvec[i] = a_mbase_x;  // save 32 values
 1683|      0|        dstvec[i + N] = a_mbase_x;
 1684|      0|      }
 1685|      0|      return;
 1686|      0|    }
 1687|       |
 1688|  1.12k|    __m256i shift =
 1689|  1.12k|        _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 1690|       |
 1691|  3.36k|    for (int j = 0; j < 32; j += 16) {
  ------------------
  |  Branch (1691:21): [True: 2.24k, False: 1.12k]
  ------------------
 1692|  2.24k|      int mdif = max_base_x - (base + j);
 1693|  2.24k|      if (mdif <= 0) {
  ------------------
  |  Branch (1693:11): [True: 0, False: 2.24k]
  ------------------
 1694|      0|        res = a_mbase_x;
 1695|  2.24k|      } else {
 1696|  2.24k|        a0 = _mm256_loadu_si256((__m256i *)(above + base + j));
 1697|  2.24k|        a1 = _mm256_loadu_si256((__m256i *)(above + base + 1 + j));
 1698|       |
 1699|  2.24k|        diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 1700|  2.24k|        a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 1701|  2.24k|        a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 1702|  2.24k|        b = _mm256_mullo_epi16(diff, shift);
 1703|       |
 1704|  2.24k|        res = _mm256_add_epi16(a32, b);
 1705|  2.24k|        res = _mm256_srli_epi16(res, 5);
 1706|       |
 1707|  2.24k|        base_inc256 = _mm256_setr_epi16(
 1708|  2.24k|            base + j, base + j + 1, base + j + 2, base + j + 3, base + j + 4,
 1709|  2.24k|            base + j + 5, base + j + 6, base + j + 7, base + j + 8,
 1710|  2.24k|            base + j + 9, base + j + 10, base + j + 11, base + j + 12,
 1711|  2.24k|            base + j + 13, base + j + 14, base + j + 15);
 1712|       |
 1713|  2.24k|        mask256 = _mm256_cmpgt_epi16(max_base_x256, base_inc256);
 1714|  2.24k|        res = _mm256_blendv_epi8(a_mbase_x, res, mask256);
 1715|  2.24k|      }
 1716|  2.24k|      if (!j) {
  ------------------
  |  Branch (1716:11): [True: 1.12k, False: 1.12k]
  ------------------
 1717|  1.12k|        dstvec[r] = res;
 1718|  1.12k|      } else {
 1719|  1.12k|        dstvec[r + N] = res;
 1720|  1.12k|      }
 1721|  2.24k|    }
 1722|  1.12k|    x += dx;
 1723|  1.12k|  }
 1724|     70|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z1_32xN_internal_avx2:
 1558|     56|    int N, __m256i *dstvec, const uint16_t *above, int upsample_above, int dx) {
 1559|       |  // here upsample_above is 0 by design of av1_use_intra_edge_upsample
 1560|     56|  (void)upsample_above;
 1561|     56|  const int frac_bits = 6;
 1562|     56|  const int max_base_x = ((32 + N) - 1);
 1563|       |
 1564|       |  // pre-filter above pixels
 1565|       |  // store in temp buffers:
 1566|       |  //   above[x] * 32 + 16
 1567|       |  //   above[x+1] - above[x]
 1568|       |  // final pixels will be calculated as:
 1569|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1570|     56|  __m256i a0, a0_1, a1, a1_1, a32, a16, c3f;
 1571|     56|  __m256i a_mbase_x, diff, max_base_x256, base_inc256, mask256;
 1572|       |
 1573|     56|  a16 = _mm256_set1_epi32(16);
 1574|     56|  a_mbase_x = _mm256_set1_epi16(above[max_base_x]);
 1575|     56|  max_base_x256 = _mm256_set1_epi16(max_base_x);
 1576|     56|  c3f = _mm256_set1_epi16(0x3f);
 1577|       |
 1578|     56|  int x = dx;
 1579|    952|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (1579:19): [True: 896, False: 56]
  ------------------
 1580|    896|    __m256i b, res[2], res1;
 1581|       |
 1582|    896|    int base = x >> frac_bits;
 1583|    896|    if (base >= max_base_x) {
  ------------------
  |  Branch (1583:9): [True: 0, False: 896]
  ------------------
 1584|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (1584:23): [True: 0, False: 0]
  ------------------
 1585|      0|        dstvec[i] = a_mbase_x;  // save 32 values
 1586|      0|        dstvec[i + N] = a_mbase_x;
 1587|      0|      }
 1588|      0|      return;
 1589|      0|    }
 1590|       |
 1591|    896|    __m256i shift =
 1592|    896|        _mm256_srli_epi32(_mm256_and_si256(_mm256_set1_epi32(x), c3f), 1);
 1593|       |
 1594|  2.68k|    for (int j = 0; j < 32; j += 16) {
  ------------------
  |  Branch (1594:21): [True: 1.79k, False: 896]
  ------------------
 1595|  1.79k|      int mdif = max_base_x - (base + j);
 1596|  1.79k|      if (mdif <= 0) {
  ------------------
  |  Branch (1596:11): [True: 0, False: 1.79k]
  ------------------
 1597|      0|        res1 = a_mbase_x;
 1598|  1.79k|      } else {
 1599|  1.79k|        a0 = _mm256_cvtepu16_epi32(
 1600|  1.79k|            _mm_loadu_si128((__m128i *)(above + base + j)));
 1601|  1.79k|        a1 = _mm256_cvtepu16_epi32(
 1602|  1.79k|            _mm_loadu_si128((__m128i *)(above + base + 1 + j)));
 1603|       |
 1604|  1.79k|        diff = _mm256_sub_epi32(a1, a0);   // a[x+1] - a[x]
 1605|  1.79k|        a32 = _mm256_slli_epi32(a0, 5);    // a[x] * 32
 1606|  1.79k|        a32 = _mm256_add_epi32(a32, a16);  // a[x] * 32 + 16
 1607|  1.79k|        b = _mm256_mullo_epi32(diff, shift);
 1608|       |
 1609|  1.79k|        res[0] = _mm256_add_epi32(a32, b);
 1610|  1.79k|        res[0] = _mm256_srli_epi32(res[0], 5);
 1611|  1.79k|        res[0] = _mm256_packus_epi32(
 1612|  1.79k|            res[0],
 1613|  1.79k|            _mm256_castsi128_si256(_mm256_extracti128_si256(res[0], 1)));
 1614|  1.79k|        if (mdif > 8) {
  ------------------
  |  Branch (1614:13): [True: 1.79k, False: 0]
  ------------------
 1615|  1.79k|          a0_1 = _mm256_cvtepu16_epi32(
 1616|  1.79k|              _mm_loadu_si128((__m128i *)(above + base + 8 + j)));
 1617|  1.79k|          a1_1 = _mm256_cvtepu16_epi32(
 1618|  1.79k|              _mm_loadu_si128((__m128i *)(above + base + 9 + j)));
 1619|       |
 1620|  1.79k|          diff = _mm256_sub_epi32(a1_1, a0_1);  // a[x+1] - a[x]
 1621|  1.79k|          a32 = _mm256_slli_epi32(a0_1, 5);     // a[x] * 32
 1622|  1.79k|          a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 1623|  1.79k|          b = _mm256_mullo_epi32(diff, shift);
 1624|       |
 1625|  1.79k|          res[1] = _mm256_add_epi32(a32, b);
 1626|  1.79k|          res[1] = _mm256_srli_epi32(res[1], 5);
 1627|  1.79k|          res[1] = _mm256_packus_epi32(
 1628|  1.79k|              res[1],
 1629|  1.79k|              _mm256_castsi128_si256(_mm256_extracti128_si256(res[1], 1)));
 1630|  1.79k|        } else {
 1631|      0|          res[1] = a_mbase_x;
 1632|      0|        }
 1633|  1.79k|        res1 = _mm256_inserti128_si256(res[0], _mm256_castsi256_si128(res[1]),
 1634|  1.79k|                                       1);  // 16 16bit values
 1635|  1.79k|        base_inc256 = _mm256_setr_epi16(
 1636|  1.79k|            base + j, base + j + 1, base + j + 2, base + j + 3, base + j + 4,
 1637|  1.79k|            base + j + 5, base + j + 6, base + j + 7, base + j + 8,
 1638|  1.79k|            base + j + 9, base + j + 10, base + j + 11, base + j + 12,
 1639|  1.79k|            base + j + 13, base + j + 14, base + j + 15);
 1640|       |
 1641|  1.79k|        mask256 = _mm256_cmpgt_epi16(max_base_x256, base_inc256);
 1642|  1.79k|        res1 = _mm256_blendv_epi8(a_mbase_x, res1, mask256);
 1643|  1.79k|      }
 1644|  1.79k|      if (!j) {
  ------------------
  |  Branch (1644:11): [True: 896, False: 896]
  ------------------
 1645|    896|        dstvec[r] = res1;
 1646|    896|      } else {
 1647|    896|        dstvec[r + N] = res1;
 1648|    896|      }
 1649|  1.79k|    }
 1650|    896|    x += dx;
 1651|    896|  }
 1652|     56|}
intrapred_avx2.c:highbd_dr_prediction_z2_Nx4_avx2:
 2107|  1.41M|    int dy) {
 2108|  1.41M|  const int min_base_x = -(1 << upsample_above);
 2109|  1.41M|  const int min_base_y = -(1 << upsample_left);
 2110|  1.41M|  const int frac_bits_x = 6 - upsample_above;
 2111|  1.41M|  const int frac_bits_y = 6 - upsample_left;
 2112|       |
 2113|  1.41M|  assert(dx > 0);
 2114|       |  // pre-filter above pixels
 2115|       |  // store in temp buffers:
 2116|       |  //   above[x] * 32 + 16
 2117|       |  //   above[x+1] - above[x]
 2118|       |  // final pixels will be calculated as:
 2119|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 2120|  1.41M|  __m256i a0_x, a1_x, a32, a16;
 2121|  1.41M|  __m256i diff;
 2122|  1.41M|  __m128i c3f, min_base_y128;
 2123|       |
 2124|  1.41M|  a16 = _mm256_set1_epi16(16);
 2125|  1.41M|  c3f = _mm_set1_epi16(0x3f);
 2126|  1.41M|  min_base_y128 = _mm_set1_epi16(min_base_y);
 2127|       |
 2128|  7.32M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (2128:19): [True: 5.91M, False: 1.41M]
  ------------------
 2129|  5.91M|    __m256i b, res, shift;
 2130|  5.91M|    __m128i resx, resy, resxy;
 2131|  5.91M|    __m128i a0_x128, a1_x128;
 2132|  5.91M|    int y = r + 1;
 2133|  5.91M|    int base_x = (-y * dx) >> frac_bits_x;
 2134|  5.91M|    int base_shift = 0;
 2135|  5.91M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (2135:9): [True: 3.52M, False: 2.38M]
  ------------------
 2136|  3.52M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 2137|  3.52M|    }
 2138|  5.91M|    int base_min_diff =
 2139|  5.91M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 2140|  5.91M|    if (base_min_diff > 4) {
  ------------------
  |  Branch (2140:9): [True: 1.17M, False: 4.74M]
  ------------------
 2141|  1.17M|      base_min_diff = 4;
 2142|  4.74M|    } else {
 2143|  4.74M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2143:11): [True: 0, False: 4.74M]
  ------------------
 2144|  4.74M|    }
 2145|       |
 2146|  5.91M|    if (base_shift > 3) {
  ------------------
  |  Branch (2146:9): [True: 1.17M, False: 4.74M]
  ------------------
 2147|  1.17M|      a0_x = _mm256_setzero_si256();
 2148|  1.17M|      a1_x = _mm256_setzero_si256();
 2149|  1.17M|      shift = _mm256_setzero_si256();
 2150|  4.74M|    } else {
 2151|  4.74M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2152|  4.74M|      if (upsample_above) {
  ------------------
  |  Branch (2152:11): [True: 1.98M, False: 2.75M]
  ------------------
 2153|  1.98M|        a0_x128 = _mm_shuffle_epi8(a0_x128,
 2154|  1.98M|                                   *(__m128i *)HighbdEvenOddMaskx4[base_shift]);
 2155|  1.98M|        a1_x128 = _mm_srli_si128(a0_x128, 8);
 2156|       |
 2157|  1.98M|        shift = _mm256_castsi128_si256(_mm_srli_epi16(
 2158|  1.98M|            _mm_and_si128(
 2159|  1.98M|                _mm_slli_epi16(_mm_setr_epi16(-y * dx, (1 << 6) - y * dx,
 2160|  1.98M|                                              (2 << 6) - y * dx,
 2161|  1.98M|                                              (3 << 6) - y * dx, 0, 0, 0, 0),
 2162|  1.98M|                               upsample_above),
 2163|  1.98M|                c3f),
 2164|  1.98M|            1));
 2165|  2.75M|      } else {
 2166|  2.75M|        a0_x128 =
 2167|  2.75M|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2168|  2.75M|        a1_x128 = _mm_srli_si128(a0_x128, 2);
 2169|       |
 2170|  2.75M|        shift = _mm256_castsi128_si256(_mm_srli_epi16(
 2171|  2.75M|            _mm_and_si128(
 2172|  2.75M|                _mm_setr_epi16(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx,
 2173|  2.75M|                               (3 << 6) - y * dx, 0, 0, 0, 0),
 2174|  2.75M|                c3f),
 2175|  2.75M|            1));
 2176|  2.75M|      }
 2177|  4.74M|      a0_x = _mm256_castsi128_si256(a0_x128);
 2178|  4.74M|      a1_x = _mm256_castsi128_si256(a1_x128);
 2179|  4.74M|    }
 2180|       |    // y calc
 2181|  5.91M|    __m128i a0_y, a1_y, shifty;
 2182|  5.91M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (2182:9): [True: 4.43M, False: 1.47M]
  ------------------
 2183|  4.43M|      __m128i r6, c1234, dy128, y_c128, base_y_c128, mask128;
 2184|  4.43M|      DECLARE_ALIGNED(32, int16_t, base_y_c[8]);
  ------------------
  |  |   19|  4.43M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2185|  4.43M|      r6 = _mm_set1_epi16(r << 6);
 2186|  4.43M|      dy128 = _mm_set1_epi16(dy);
 2187|  4.43M|      c1234 = _mm_setr_epi16(1, 2, 3, 4, 0, 0, 0, 0);
 2188|  4.43M|      y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128));
 2189|  4.43M|      base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y);
 2190|  4.43M|      mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128);
 2191|  4.43M|      base_y_c128 = _mm_andnot_si128(mask128, base_y_c128);
 2192|  4.43M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 2193|       |
 2194|  4.43M|      a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 2195|  4.43M|                            left[base_y_c[2]], left[base_y_c[3]], 0, 0, 0, 0);
 2196|  4.43M|      a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1],
 2197|  4.43M|                            left[base_y_c[2] + 1], left[base_y_c[3] + 1], 0, 0,
 2198|  4.43M|                            0, 0);
 2199|       |
 2200|  4.43M|      if (upsample_left) {
  ------------------
  |  Branch (2200:11): [True: 2.02M, False: 2.41M]
  ------------------
 2201|  2.02M|        shifty = _mm_srli_epi16(
 2202|  2.02M|            _mm_and_si128(_mm_slli_epi16(y_c128, upsample_left), c3f), 1);
 2203|  2.41M|      } else {
 2204|  2.41M|        shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1);
 2205|  2.41M|      }
 2206|  4.43M|      a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1);
 2207|  4.43M|      a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);
 2208|  4.43M|      shift = _mm256_inserti128_si256(shift, shifty, 1);
 2209|  4.43M|    }
 2210|       |
 2211|  5.91M|    diff = _mm256_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 2212|  5.91M|    a32 = _mm256_slli_epi16(a0_x, 5);     // a[x] * 32
 2213|  5.91M|    a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 2214|       |
 2215|  5.91M|    b = _mm256_mullo_epi16(diff, shift);
 2216|  5.91M|    res = _mm256_add_epi16(a32, b);
 2217|  5.91M|    res = _mm256_srli_epi16(res, 5);
 2218|       |
 2219|  5.91M|    resx = _mm256_castsi256_si128(res);
 2220|       |    resy = _mm256_extracti128_si256(res, 1);
 2221|  5.91M|    resxy =
 2222|  5.91M|        _mm_blendv_epi8(resx, resy, *(__m128i *)HighbdBaseMask[base_min_diff]);
 2223|  5.91M|    _mm_storel_epi64((__m128i *)(dst), resxy);
 2224|  5.91M|    dst += stride;
 2225|  5.91M|  }
 2226|  1.41M|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z2_Nx4_avx2:
 1981|  1.53M|    int dy) {
 1982|  1.53M|  const int min_base_x = -(1 << upsample_above);
 1983|  1.53M|  const int min_base_y = -(1 << upsample_left);
 1984|  1.53M|  const int frac_bits_x = 6 - upsample_above;
 1985|  1.53M|  const int frac_bits_y = 6 - upsample_left;
 1986|       |
 1987|  1.53M|  assert(dx > 0);
 1988|       |  // pre-filter above pixels
 1989|       |  // store in temp buffers:
 1990|       |  //   above[x] * 32 + 16
 1991|       |  //   above[x+1] - above[x]
 1992|       |  // final pixels will be calculated as:
 1993|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 1994|  1.53M|  __m256i a0_x, a1_x, a32, a16;
 1995|  1.53M|  __m256i diff;
 1996|  1.53M|  __m128i c3f, min_base_y128;
 1997|       |
 1998|  1.53M|  a16 = _mm256_set1_epi32(16);
 1999|  1.53M|  c3f = _mm_set1_epi32(0x3f);
 2000|  1.53M|  min_base_y128 = _mm_set1_epi32(min_base_y);
 2001|       |
 2002|  8.11M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (2002:19): [True: 6.57M, False: 1.53M]
  ------------------
 2003|  6.57M|    __m256i b, res, shift;
 2004|  6.57M|    __m128i resx, resy, resxy;
 2005|  6.57M|    __m128i a0_x128, a1_x128;
 2006|  6.57M|    int y = r + 1;
 2007|  6.57M|    int base_x = (-y * dx) >> frac_bits_x;
 2008|  6.57M|    int base_shift = 0;
 2009|  6.57M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (2009:9): [True: 4.00M, False: 2.57M]
  ------------------
 2010|  4.00M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 2011|  4.00M|    }
 2012|  6.57M|    int base_min_diff =
 2013|  6.57M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 2014|  6.57M|    if (base_min_diff > 4) {
  ------------------
  |  Branch (2014:9): [True: 1.34M, False: 5.22M]
  ------------------
 2015|  1.34M|      base_min_diff = 4;
 2016|  5.22M|    } else {
 2017|  5.22M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2017:11): [True: 0, False: 5.22M]
  ------------------
 2018|  5.22M|    }
 2019|       |
 2020|  6.57M|    if (base_shift > 3) {
  ------------------
  |  Branch (2020:9): [True: 1.34M, False: 5.22M]
  ------------------
 2021|  1.34M|      a0_x = _mm256_setzero_si256();
 2022|  1.34M|      a1_x = _mm256_setzero_si256();
 2023|  1.34M|      shift = _mm256_setzero_si256();
 2024|  5.22M|    } else {
 2025|  5.22M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2026|  5.22M|      if (upsample_above) {
  ------------------
  |  Branch (2026:11): [True: 2.15M, False: 3.06M]
  ------------------
 2027|  2.15M|        a0_x128 = _mm_shuffle_epi8(a0_x128,
 2028|  2.15M|                                   *(__m128i *)HighbdEvenOddMaskx4[base_shift]);
 2029|  2.15M|        a1_x128 = _mm_srli_si128(a0_x128, 8);
 2030|       |
 2031|  2.15M|        shift = _mm256_castsi128_si256(_mm_srli_epi32(
 2032|  2.15M|            _mm_and_si128(
 2033|  2.15M|                _mm_slli_epi32(
 2034|  2.15M|                    _mm_setr_epi32(-y * dx, (1 << 6) - y * dx,
 2035|  2.15M|                                   (2 << 6) - y * dx, (3 << 6) - y * dx),
 2036|  2.15M|                    upsample_above),
 2037|  2.15M|                c3f),
 2038|  2.15M|            1));
 2039|  3.06M|      } else {
 2040|  3.06M|        a0_x128 =
 2041|  3.06M|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2042|  3.06M|        a1_x128 = _mm_srli_si128(a0_x128, 2);
 2043|       |
 2044|  3.06M|        shift = _mm256_castsi128_si256(_mm_srli_epi32(
 2045|  3.06M|            _mm_and_si128(_mm_setr_epi32(-y * dx, (1 << 6) - y * dx,
 2046|  3.06M|                                         (2 << 6) - y * dx, (3 << 6) - y * dx),
 2047|  3.06M|                          c3f),
 2048|  3.06M|            1));
 2049|  3.06M|      }
 2050|  5.22M|      a0_x = _mm256_cvtepu16_epi32(a0_x128);
 2051|  5.22M|      a1_x = _mm256_cvtepu16_epi32(a1_x128);
 2052|  5.22M|    }
 2053|       |    // y calc
 2054|  6.57M|    __m128i a0_y, a1_y, shifty;
 2055|  6.57M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (2055:9): [True: 5.00M, False: 1.56M]
  ------------------
 2056|  5.00M|      __m128i r6, c1234, dy128, y_c128, base_y_c128, mask128;
 2057|  5.00M|      DECLARE_ALIGNED(32, int, base_y_c[4]);
  ------------------
  |  |   19|  5.00M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2058|  5.00M|      r6 = _mm_set1_epi32(r << 6);
 2059|  5.00M|      dy128 = _mm_set1_epi32(dy);
 2060|  5.00M|      c1234 = _mm_setr_epi32(1, 2, 3, 4);
 2061|  5.00M|      y_c128 = _mm_sub_epi32(r6, _mm_mullo_epi32(c1234, dy128));
 2062|  5.00M|      base_y_c128 = _mm_srai_epi32(y_c128, frac_bits_y);
 2063|  5.00M|      mask128 = _mm_cmpgt_epi32(min_base_y128, base_y_c128);
 2064|  5.00M|      base_y_c128 = _mm_andnot_si128(mask128, base_y_c128);
 2065|  5.00M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 2066|       |
 2067|  5.00M|      a0_y = _mm_setr_epi32(left[base_y_c[0]], left[base_y_c[1]],
 2068|  5.00M|                            left[base_y_c[2]], left[base_y_c[3]]);
 2069|  5.00M|      a1_y = _mm_setr_epi32(left[base_y_c[0] + 1], left[base_y_c[1] + 1],
 2070|  5.00M|                            left[base_y_c[2] + 1], left[base_y_c[3] + 1]);
 2071|       |
 2072|  5.00M|      if (upsample_left) {
  ------------------
  |  Branch (2072:11): [True: 2.23M, False: 2.77M]
  ------------------
 2073|  2.23M|        shifty = _mm_srli_epi32(
 2074|  2.23M|            _mm_and_si128(_mm_slli_epi32(y_c128, upsample_left), c3f), 1);
 2075|  2.77M|      } else {
 2076|  2.77M|        shifty = _mm_srli_epi32(_mm_and_si128(y_c128, c3f), 1);
 2077|  2.77M|      }
 2078|  5.00M|      a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1);
 2079|  5.00M|      a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);
 2080|  5.00M|      shift = _mm256_inserti128_si256(shift, shifty, 1);
 2081|  5.00M|    }
 2082|       |
 2083|  6.57M|    diff = _mm256_sub_epi32(a1_x, a0_x);  // a[x+1] - a[x]
 2084|  6.57M|    a32 = _mm256_slli_epi32(a0_x, 5);     // a[x] * 32
 2085|  6.57M|    a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2086|       |
 2087|  6.57M|    b = _mm256_mullo_epi32(diff, shift);
 2088|  6.57M|    res = _mm256_add_epi32(a32, b);
 2089|  6.57M|    res = _mm256_srli_epi32(res, 5);
 2090|       |
 2091|  6.57M|    resx = _mm256_castsi256_si128(res);
 2092|  6.57M|    resx = _mm_packus_epi32(resx, resx);
 2093|       |
 2094|  6.57M|    resy = _mm256_extracti128_si256(res, 1);
 2095|  6.57M|    resy = _mm_packus_epi32(resy, resy);
 2096|       |
 2097|  6.57M|    resxy =
 2098|  6.57M|        _mm_blendv_epi8(resx, resy, *(__m128i *)HighbdBaseMask[base_min_diff]);
 2099|  6.57M|    _mm_storel_epi64((__m128i *)(dst), resxy);
 2100|  6.57M|    dst += stride;
 2101|  6.57M|  }
 2102|  1.53M|}
intrapred_avx2.c:highbd_dr_prediction_z2_Nx8_avx2:
 2381|   385k|    int dy) {
 2382|   385k|  const int min_base_x = -(1 << upsample_above);
 2383|   385k|  const int min_base_y = -(1 << upsample_left);
 2384|   385k|  const int frac_bits_x = 6 - upsample_above;
 2385|   385k|  const int frac_bits_y = 6 - upsample_left;
 2386|       |
 2387|       |  // pre-filter above pixels
 2388|       |  // store in temp buffers:
 2389|       |  //   above[x] * 32 + 16
 2390|       |  //   above[x+1] - above[x]
 2391|       |  // final pixels will be calculated as:
 2392|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 2393|   385k|  __m128i c3f, min_base_y128;
 2394|   385k|  __m256i a0_x, a1_x, diff, a32, a16;
 2395|   385k|  __m128i a0_x128, a1_x128;
 2396|       |
 2397|   385k|  a16 = _mm256_set1_epi16(16);
 2398|   385k|  c3f = _mm_set1_epi16(0x3f);
 2399|   385k|  min_base_y128 = _mm_set1_epi16(min_base_y);
 2400|       |
 2401|  3.28M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (2401:19): [True: 2.90M, False: 385k]
  ------------------
 2402|  2.90M|    __m256i b, res, shift;
 2403|  2.90M|    __m128i resx, resy, resxy;
 2404|  2.90M|    int y = r + 1;
 2405|  2.90M|    int base_x = (-y * dx) >> frac_bits_x;
 2406|  2.90M|    int base_shift = 0;
 2407|  2.90M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (2407:9): [True: 1.68M, False: 1.21M]
  ------------------
 2408|  1.68M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 2409|  1.68M|    }
 2410|  2.90M|    int base_min_diff =
 2411|  2.90M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 2412|  2.90M|    if (base_min_diff > 8) {
  ------------------
  |  Branch (2412:9): [True: 1.34M, False: 1.56M]
  ------------------
 2413|  1.34M|      base_min_diff = 8;
 2414|  1.56M|    } else {
 2415|  1.56M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2415:11): [True: 0, False: 1.56M]
  ------------------
 2416|  1.56M|    }
 2417|       |
 2418|  2.90M|    if (base_shift > 7) {
  ------------------
  |  Branch (2418:9): [True: 1.34M, False: 1.56M]
  ------------------
 2419|  1.34M|      a0_x = _mm256_setzero_si256();
 2420|  1.34M|      a1_x = _mm256_setzero_si256();
 2421|  1.34M|      shift = _mm256_setzero_si256();
 2422|  1.56M|    } else {
 2423|  1.56M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2424|  1.56M|      if (upsample_above) {
  ------------------
  |  Branch (2424:11): [True: 1.19M, False: 367k]
  ------------------
 2425|  1.19M|        __m128i mask, atmp0, atmp1, atmp2, atmp3;
 2426|  1.19M|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift));
 2427|  1.19M|        atmp0 = _mm_shuffle_epi8(a0_x128,
 2428|  1.19M|                                 *(__m128i *)HighbdEvenOddMaskx[base_shift]);
 2429|  1.19M|        atmp1 = _mm_shuffle_epi8(a1_x128,
 2430|  1.19M|                                 *(__m128i *)HighbdEvenOddMaskx[base_shift]);
 2431|  1.19M|        atmp2 = _mm_shuffle_epi8(
 2432|  1.19M|            a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16));
 2433|  1.19M|        atmp3 = _mm_shuffle_epi8(
 2434|  1.19M|            a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16));
 2435|  1.19M|        mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift],
 2436|  1.19M|                              _mm_set1_epi8(15));
 2437|  1.19M|        a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask);
 2438|  1.19M|        mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16),
 2439|  1.19M|                              _mm_set1_epi8(15));
 2440|  1.19M|        a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask);
 2441|       |
 2442|  1.19M|        shift = _mm256_castsi128_si256(_mm_srli_epi16(
 2443|  1.19M|            _mm_and_si128(
 2444|  1.19M|                _mm_slli_epi16(
 2445|  1.19M|                    _mm_setr_epi16(-y * dx, (1 << 6) - y * dx,
 2446|  1.19M|                                   (2 << 6) - y * dx, (3 << 6) - y * dx,
 2447|  1.19M|                                   (4 << 6) - y * dx, (5 << 6) - y * dx,
 2448|  1.19M|                                   (6 << 6) - y * dx, (7 << 6) - y * dx),
 2449|  1.19M|                    upsample_above),
 2450|  1.19M|                c3f),
 2451|  1.19M|            1));
 2452|  1.19M|      } else {
 2453|   367k|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 1 + base_shift));
 2454|   367k|        a0_x128 =
 2455|   367k|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2456|   367k|        a1_x128 =
 2457|   367k|            _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2458|       |
 2459|   367k|        shift = _mm256_castsi128_si256(_mm_srli_epi16(
 2460|   367k|            _mm_and_si128(_mm_setr_epi16(-y * dx, (1 << 6) - y * dx,
 2461|   367k|                                         (2 << 6) - y * dx, (3 << 6) - y * dx,
 2462|   367k|                                         (4 << 6) - y * dx, (5 << 6) - y * dx,
 2463|   367k|                                         (6 << 6) - y * dx, (7 << 6) - y * dx),
 2464|   367k|                          c3f),
 2465|   367k|            1));
 2466|   367k|      }
 2467|  1.56M|      a0_x = _mm256_castsi128_si256(a0_x128);
 2468|  1.56M|      a1_x = _mm256_castsi128_si256(a1_x128);
 2469|  1.56M|    }
 2470|       |
 2471|       |    // y calc
 2472|  2.90M|    __m128i a0_y, a1_y, shifty;
 2473|  2.90M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (2473:9): [True: 1.87M, False: 1.02M]
  ------------------
 2474|  1.87M|      DECLARE_ALIGNED(32, int16_t, base_y_c[8]);
  ------------------
  |  |   19|  1.87M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2475|  1.87M|      __m128i r6, c1234, dy128, y_c128, base_y_c128, mask128;
 2476|  1.87M|      r6 = _mm_set1_epi16(r << 6);
 2477|  1.87M|      dy128 = _mm_set1_epi16(dy);
 2478|  1.87M|      c1234 = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
 2479|  1.87M|      y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128));
 2480|  1.87M|      base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y);
 2481|  1.87M|      mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128);
 2482|  1.87M|      base_y_c128 = _mm_andnot_si128(mask128, base_y_c128);
 2483|  1.87M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 2484|       |
 2485|  1.87M|      a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 2486|  1.87M|                            left[base_y_c[2]], left[base_y_c[3]],
 2487|  1.87M|                            left[base_y_c[4]], left[base_y_c[5]],
 2488|  1.87M|                            left[base_y_c[6]], left[base_y_c[7]]);
 2489|  1.87M|      a1_y = _mm_setr_epi16(left[base_y_c[0] + 1], left[base_y_c[1] + 1],
 2490|  1.87M|                            left[base_y_c[2] + 1], left[base_y_c[3] + 1],
 2491|  1.87M|                            left[base_y_c[4] + 1], left[base_y_c[5] + 1],
 2492|  1.87M|                            left[base_y_c[6] + 1], left[base_y_c[7] + 1]);
 2493|       |
 2494|  1.87M|      if (upsample_left) {
  ------------------
  |  Branch (2494:11): [True: 1.44M, False: 424k]
  ------------------
 2495|  1.44M|        shifty = _mm_srli_epi16(
 2496|  1.44M|            _mm_and_si128(_mm_slli_epi16((y_c128), upsample_left), c3f), 1);
 2497|  1.44M|      } else {
 2498|   424k|        shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1);
 2499|   424k|      }
 2500|  1.87M|      a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1);
 2501|  1.87M|      a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);
 2502|  1.87M|      shift = _mm256_inserti128_si256(shift, shifty, 1);
 2503|  1.87M|    }
 2504|       |
 2505|  2.90M|    diff = _mm256_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 2506|  2.90M|    a32 = _mm256_slli_epi16(a0_x, 5);     // a[x] * 32
 2507|  2.90M|    a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 2508|       |
 2509|  2.90M|    b = _mm256_mullo_epi16(diff, shift);
 2510|  2.90M|    res = _mm256_add_epi16(a32, b);
 2511|  2.90M|    res = _mm256_srli_epi16(res, 5);
 2512|       |
 2513|  2.90M|    resx = _mm256_castsi256_si128(res);
 2514|  2.90M|    resy = _mm256_extracti128_si256(res, 1);
 2515|       |
 2516|  2.90M|    resxy =
 2517|  2.90M|        _mm_blendv_epi8(resx, resy, *(__m128i *)HighbdBaseMask[base_min_diff]);
 2518|  2.90M|    _mm_storeu_si128((__m128i *)(dst), resxy);
 2519|  2.90M|    dst += stride;
 2520|  2.90M|  }
 2521|   385k|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z2_Nx8_avx2:
 2231|   473k|    int dy) {
 2232|   473k|  const int min_base_x = -(1 << upsample_above);
 2233|   473k|  const int min_base_y = -(1 << upsample_left);
 2234|   473k|  const int frac_bits_x = 6 - upsample_above;
 2235|   473k|  const int frac_bits_y = 6 - upsample_left;
 2236|       |
 2237|       |  // pre-filter above pixels
 2238|       |  // store in temp buffers:
 2239|       |  //   above[x] * 32 + 16
 2240|       |  //   above[x+1] - above[x]
 2241|       |  // final pixels will be calculated as:
 2242|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 2243|   473k|  __m256i a0_x, a1_x, a0_y, a1_y, a32, a16, c3f, min_base_y256;
 2244|   473k|  __m256i diff;
 2245|   473k|  __m128i a0_x128, a1_x128;
 2246|       |
 2247|   473k|  a16 = _mm256_set1_epi32(16);
 2248|   473k|  c3f = _mm256_set1_epi32(0x3f);
 2249|   473k|  min_base_y256 = _mm256_set1_epi32(min_base_y);
 2250|       |
 2251|  3.92M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (2251:19): [True: 3.44M, False: 473k]
  ------------------
 2252|  3.44M|    __m256i b, res, shift;
 2253|  3.44M|    __m128i resx, resy, resxy;
 2254|  3.44M|    int y = r + 1;
 2255|  3.44M|    int base_x = (-y * dx) >> frac_bits_x;
 2256|  3.44M|    int base_shift = 0;
 2257|  3.44M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (2257:9): [True: 2.03M, False: 1.41M]
  ------------------
 2258|  2.03M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 2259|  2.03M|    }
 2260|  3.44M|    int base_min_diff =
 2261|  3.44M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 2262|  3.44M|    if (base_min_diff > 8) {
  ------------------
  |  Branch (2262:9): [True: 1.53M, False: 1.91M]
  ------------------
 2263|  1.53M|      base_min_diff = 8;
 2264|  1.91M|    } else {
 2265|  1.91M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2265:11): [True: 0, False: 1.91M]
  ------------------
 2266|  1.91M|    }
 2267|       |
 2268|  3.44M|    if (base_shift > 7) {
  ------------------
  |  Branch (2268:9): [True: 1.53M, False: 1.91M]
  ------------------
 2269|  1.53M|      resx = _mm_setzero_si128();
 2270|  1.91M|    } else {
 2271|  1.91M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2272|  1.91M|      if (upsample_above) {
  ------------------
  |  Branch (2272:11): [True: 1.36M, False: 545k]
  ------------------
 2273|  1.36M|        __m128i mask, atmp0, atmp1, atmp2, atmp3;
 2274|  1.36M|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 8 + base_shift));
 2275|  1.36M|        atmp0 = _mm_shuffle_epi8(a0_x128,
 2276|  1.36M|                                 *(__m128i *)HighbdEvenOddMaskx[base_shift]);
 2277|  1.36M|        atmp1 = _mm_shuffle_epi8(a1_x128,
 2278|  1.36M|                                 *(__m128i *)HighbdEvenOddMaskx[base_shift]);
 2279|  1.36M|        atmp2 = _mm_shuffle_epi8(
 2280|  1.36M|            a0_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16));
 2281|  1.36M|        atmp3 = _mm_shuffle_epi8(
 2282|  1.36M|            a1_x128, *(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16));
 2283|  1.36M|        mask = _mm_cmpgt_epi8(*(__m128i *)HighbdEvenOddMaskx[base_shift],
 2284|  1.36M|                              _mm_set1_epi8(15));
 2285|  1.36M|        a0_x128 = _mm_blendv_epi8(atmp0, atmp1, mask);
 2286|  1.36M|        mask = _mm_cmpgt_epi8(*(__m128i *)(HighbdEvenOddMaskx[base_shift] + 16),
 2287|  1.36M|                              _mm_set1_epi8(15));
 2288|  1.36M|        a1_x128 = _mm_blendv_epi8(atmp2, atmp3, mask);
 2289|  1.36M|        shift = _mm256_srli_epi32(
 2290|  1.36M|            _mm256_and_si256(
 2291|  1.36M|                _mm256_slli_epi32(
 2292|  1.36M|                    _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx,
 2293|  1.36M|                                      (2 << 6) - y * dx, (3 << 6) - y * dx,
 2294|  1.36M|                                      (4 << 6) - y * dx, (5 << 6) - y * dx,
 2295|  1.36M|                                      (6 << 6) - y * dx, (7 << 6) - y * dx),
 2296|  1.36M|                    upsample_above),
 2297|  1.36M|                c3f),
 2298|  1.36M|            1);
 2299|  1.36M|      } else {
 2300|   545k|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + 1 + base_shift));
 2301|   545k|        a0_x128 =
 2302|   545k|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2303|   545k|        a1_x128 =
 2304|   545k|            _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2305|       |
 2306|   545k|        shift = _mm256_srli_epi32(
 2307|   545k|            _mm256_and_si256(
 2308|   545k|                _mm256_setr_epi32(-y * dx, (1 << 6) - y * dx, (2 << 6) - y * dx,
 2309|   545k|                                  (3 << 6) - y * dx, (4 << 6) - y * dx,
 2310|   545k|                                  (5 << 6) - y * dx, (6 << 6) - y * dx,
 2311|   545k|                                  (7 << 6) - y * dx),
 2312|   545k|                c3f),
 2313|   545k|            1);
 2314|   545k|      }
 2315|  1.91M|      a0_x = _mm256_cvtepu16_epi32(a0_x128);
 2316|  1.91M|      a1_x = _mm256_cvtepu16_epi32(a1_x128);
 2317|       |
 2318|  1.91M|      diff = _mm256_sub_epi32(a1_x, a0_x);  // a[x+1] - a[x]
 2319|  1.91M|      a32 = _mm256_slli_epi32(a0_x, 5);     // a[x] * 32
 2320|  1.91M|      a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2321|       |
 2322|  1.91M|      b = _mm256_mullo_epi32(diff, shift);
 2323|  1.91M|      res = _mm256_add_epi32(a32, b);
 2324|  1.91M|      res = _mm256_srli_epi32(res, 5);
 2325|       |
 2326|  1.91M|      resx = _mm256_castsi256_si128(_mm256_packus_epi32(
 2327|  1.91M|          res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1))));
 2328|  1.91M|    }
 2329|       |    // y calc
 2330|  3.44M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (2330:9): [True: 2.28M, False: 1.16M]
  ------------------
 2331|  2.28M|      DECLARE_ALIGNED(32, int, base_y_c[8]);
  ------------------
  |  |   19|  2.28M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2332|  2.28M|      __m256i r6, c256, dy256, y_c256, base_y_c256, mask256;
 2333|  2.28M|      r6 = _mm256_set1_epi32(r << 6);
 2334|  2.28M|      dy256 = _mm256_set1_epi32(dy);
 2335|  2.28M|      c256 = _mm256_setr_epi32(1, 2, 3, 4, 5, 6, 7, 8);
 2336|  2.28M|      y_c256 = _mm256_sub_epi32(r6, _mm256_mullo_epi32(c256, dy256));
 2337|  2.28M|      base_y_c256 = _mm256_srai_epi32(y_c256, frac_bits_y);
 2338|  2.28M|      mask256 = _mm256_cmpgt_epi32(min_base_y256, base_y_c256);
 2339|  2.28M|      base_y_c256 = _mm256_andnot_si256(mask256, base_y_c256);
 2340|  2.28M|      _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 2341|       |
 2342|  2.28M|      a0_y = _mm256_cvtepu16_epi32(_mm_setr_epi16(
 2343|  2.28M|          left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 2344|  2.28M|          left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 2345|  2.28M|          left[base_y_c[6]], left[base_y_c[7]]));
 2346|  2.28M|      a1_y = _mm256_cvtepu16_epi32(_mm_setr_epi16(
 2347|  2.28M|          left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1],
 2348|  2.28M|          left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1],
 2349|  2.28M|          left[base_y_c[6] + 1], left[base_y_c[7] + 1]));
 2350|       |
 2351|  2.28M|      if (upsample_left) {
  ------------------
  |  Branch (2351:11): [True: 1.68M, False: 597k]
  ------------------
 2352|  1.68M|        shift = _mm256_srli_epi32(
 2353|  1.68M|            _mm256_and_si256(_mm256_slli_epi32((y_c256), upsample_left), c3f),
 2354|  1.68M|            1);
 2355|  1.68M|      } else {
 2356|   597k|        shift = _mm256_srli_epi32(_mm256_and_si256(y_c256, c3f), 1);
 2357|   597k|      }
 2358|  2.28M|      diff = _mm256_sub_epi32(a1_y, a0_y);  // a[x+1] - a[x]
 2359|  2.28M|      a32 = _mm256_slli_epi32(a0_y, 5);     // a[x] * 32
 2360|  2.28M|      a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2361|       |
 2362|  2.28M|      b = _mm256_mullo_epi32(diff, shift);
 2363|  2.28M|      res = _mm256_add_epi32(a32, b);
 2364|  2.28M|      res = _mm256_srli_epi32(res, 5);
 2365|       |
 2366|  2.28M|      resy = _mm256_castsi256_si128(_mm256_packus_epi32(
 2367|  2.28M|          res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1))));
 2368|  2.28M|    } else {
 2369|  1.16M|      resy = resx;
 2370|  1.16M|    }
 2371|  3.44M|    resxy =
 2372|  3.44M|        _mm_blendv_epi8(resx, resy, *(__m128i *)HighbdBaseMask[base_min_diff]);
 2373|  3.44M|    _mm_storeu_si128((__m128i *)(dst), resxy);
 2374|  3.44M|    dst += stride;
 2375|  3.44M|  }
 2376|   473k|}
intrapred_avx2.c:highbd_dr_prediction_z2_HxW_avx2:
 2722|  25.0k|    int dy) {
 2723|       |  // here upsample_above and upsample_left are 0 by design of
 2724|       |  // av1_use_intra_edge_upsample
 2725|  25.0k|  const int min_base_x = -1;
 2726|  25.0k|  const int min_base_y = -1;
 2727|  25.0k|  (void)upsample_above;
 2728|  25.0k|  (void)upsample_left;
 2729|  25.0k|  const int frac_bits_x = 6;
 2730|  25.0k|  const int frac_bits_y = 6;
 2731|       |
 2732|       |  // pre-filter above pixels
 2733|       |  // store in temp buffers:
 2734|       |  //   above[x] * 32 + 16
 2735|       |  //   above[x+1] - above[x]
 2736|       |  // final pixels will be calculated as:
 2737|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 2738|  25.0k|  __m256i a0_x, a1_x, a32, a16, c3f, c1;
 2739|  25.0k|  __m256i diff, min_base_y256, dy256, c1234, c0123;
 2740|  25.0k|  DECLARE_ALIGNED(32, int16_t, base_y_c[16]);
  ------------------
  |  |   19|  25.0k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2741|       |
 2742|  25.0k|  a16 = _mm256_set1_epi16(16);
 2743|  25.0k|  c1 = _mm256_srli_epi16(a16, 4);
 2744|  25.0k|  min_base_y256 = _mm256_set1_epi16(min_base_y);
 2745|  25.0k|  c3f = _mm256_set1_epi16(0x3f);
 2746|  25.0k|  dy256 = _mm256_set1_epi16(dy);
 2747|  25.0k|  c0123 =
 2748|  25.0k|      _mm256_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
 2749|  25.0k|  c1234 = _mm256_add_epi16(c0123, c1);
 2750|       |
 2751|   376k|  for (int r = 0; r < H; r++) {
  ------------------
  |  Branch (2751:19): [True: 351k, False: 25.0k]
  ------------------
 2752|   351k|    __m256i b, res, shift;
 2753|   351k|    __m256i resx, resy, ydx;
 2754|   351k|    __m256i resxy, j256, r6;
 2755|   351k|    __m128i a0_x128, a1_x128, a0_1_x128, a1_1_x128;
 2756|   351k|    int y = r + 1;
 2757|   351k|    ydx = _mm256_set1_epi16((short)(y * dx));
 2758|       |
 2759|   727k|    for (int j = 0; j < W; j += 16) {
  ------------------
  |  Branch (2759:21): [True: 375k, False: 351k]
  ------------------
 2760|   375k|      j256 = _mm256_set1_epi16(j);
 2761|   375k|      int base_x = ((j << 6) - y * dx) >> frac_bits_x;
 2762|   375k|      int base_shift = 0;
 2763|   375k|      if ((base_x) < (min_base_x - 1)) {
  ------------------
  |  Branch (2763:11): [True: 176k, False: 198k]
  ------------------
 2764|   176k|        base_shift = (min_base_x - (base_x)-1);
 2765|   176k|      }
 2766|   375k|      int base_min_diff = (min_base_x - base_x);
 2767|   375k|      if (base_min_diff > 16) {
  ------------------
  |  Branch (2767:11): [True: 148k, False: 226k]
  ------------------
 2768|   148k|        base_min_diff = 16;
 2769|   226k|      } else {
 2770|   226k|        if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2770:13): [True: 23.1k, False: 203k]
  ------------------
 2771|   226k|      }
 2772|       |
 2773|   375k|      if (base_shift < 8) {
  ------------------
  |  Branch (2773:11): [True: 219k, False: 155k]
  ------------------
 2774|   219k|        a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2775|   219k|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1));
 2776|   219k|        a0_x128 =
 2777|   219k|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2778|   219k|        a1_x128 =
 2779|   219k|            _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2780|       |
 2781|   219k|        a0_x = _mm256_castsi128_si256(a0_x128);
 2782|   219k|        a1_x = _mm256_castsi128_si256(a1_x128);
 2783|   219k|      } else {
 2784|   155k|        a0_x = _mm256_setzero_si256();
 2785|   155k|        a1_x = _mm256_setzero_si256();
 2786|   155k|      }
 2787|       |
 2788|   375k|      int base_shift1 = 0;
 2789|   375k|      if (base_shift > 8) {
  ------------------
  |  Branch (2789:11): [True: 155k, False: 219k]
  ------------------
 2790|   155k|        base_shift1 = base_shift - 8;
 2791|   155k|      }
 2792|   375k|      if (base_shift1 < 8) {
  ------------------
  |  Branch (2792:11): [True: 226k, False: 148k]
  ------------------
 2793|   226k|        a0_1_x128 =
 2794|   226k|            _mm_loadu_si128((__m128i *)(above + base_x + base_shift1 + 8));
 2795|   226k|        a1_1_x128 =
 2796|   226k|            _mm_loadu_si128((__m128i *)(above + base_x + base_shift1 + 9));
 2797|   226k|        a0_1_x128 = _mm_shuffle_epi8(a0_1_x128,
 2798|   226k|                                     *(__m128i *)HighbdLoadMaskx[base_shift1]);
 2799|   226k|        a1_1_x128 = _mm_shuffle_epi8(a1_1_x128,
 2800|   226k|                                     *(__m128i *)HighbdLoadMaskx[base_shift1]);
 2801|       |
 2802|   226k|        a0_x = _mm256_inserti128_si256(a0_x, a0_1_x128, 1);
 2803|   226k|        a1_x = _mm256_inserti128_si256(a1_x, a1_1_x128, 1);
 2804|   226k|      }
 2805|   375k|      r6 = _mm256_slli_epi16(_mm256_add_epi16(c0123, j256), 6);
 2806|   375k|      shift = _mm256_srli_epi16(
 2807|   375k|          _mm256_and_si256(_mm256_sub_epi16(r6, ydx), c3f), 1);
 2808|       |
 2809|   375k|      diff = _mm256_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 2810|   375k|      a32 = _mm256_slli_epi16(a0_x, 5);     // a[x] * 32
 2811|   375k|      a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 2812|       |
 2813|   375k|      b = _mm256_mullo_epi16(diff, shift);
 2814|   375k|      res = _mm256_add_epi16(a32, b);
 2815|   375k|      resx = _mm256_srli_epi16(res, 5);  // 16 16-bit values
 2816|       |
 2817|       |      // y calc
 2818|   375k|      resy = _mm256_setzero_si256();
 2819|   375k|      __m256i a0_y, a1_y, shifty;
 2820|   375k|      if ((base_x < min_base_x)) {
  ------------------
  |  Branch (2820:11): [True: 219k, False: 156k]
  ------------------
 2821|   219k|        __m256i c256, y_c256, base_y_c256, mask256, mul16;
 2822|   219k|        r6 = _mm256_set1_epi16(r << 6);
 2823|   219k|        c256 = _mm256_add_epi16(j256, c1234);
 2824|   219k|        mul16 = _mm256_min_epu16(_mm256_mullo_epi16(c256, dy256),
 2825|   219k|                                 _mm256_srli_epi16(min_base_y256, 1));
 2826|   219k|        y_c256 = _mm256_sub_epi16(r6, mul16);
 2827|   219k|        base_y_c256 = _mm256_srai_epi16(y_c256, frac_bits_y);
 2828|   219k|        mask256 = _mm256_cmpgt_epi16(min_base_y256, base_y_c256);
 2829|   219k|        base_y_c256 = _mm256_andnot_si256(mask256, base_y_c256);
 2830|   219k|        _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 2831|       |
 2832|   219k|        a0_y = _mm256_setr_epi16(
 2833|   219k|            left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 2834|   219k|            left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 2835|   219k|            left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]],
 2836|   219k|            left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]],
 2837|   219k|            left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]],
 2838|   219k|            left[base_y_c[15]]);
 2839|   219k|        base_y_c256 = _mm256_add_epi16(base_y_c256, c1);
 2840|   219k|        _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 2841|       |
 2842|   219k|        a1_y = _mm256_setr_epi16(
 2843|   219k|            left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 2844|   219k|            left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 2845|   219k|            left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]],
 2846|   219k|            left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]],
 2847|   219k|            left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]],
 2848|   219k|            left[base_y_c[15]]);
 2849|       |
 2850|   219k|        shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1);
 2851|       |
 2852|   219k|        diff = _mm256_sub_epi16(a1_y, a0_y);  // a[x+1] - a[x]
 2853|   219k|        a32 = _mm256_slli_epi16(a0_y, 5);     // a[x] * 32
 2854|   219k|        a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 2855|       |
 2856|   219k|        b = _mm256_mullo_epi16(diff, shifty);
 2857|   219k|        res = _mm256_add_epi16(a32, b);
 2858|   219k|        resy = _mm256_srli_epi16(res, 5);
 2859|   219k|      }
 2860|       |
 2861|   375k|      resxy = _mm256_blendv_epi8(resx, resy,
 2862|   375k|                                 *(__m256i *)HighbdBaseMask[base_min_diff]);
 2863|   375k|      _mm256_storeu_si256((__m256i *)(dst + j), resxy);
 2864|   375k|    }  // for j
 2865|   351k|    dst += stride;
 2866|   351k|  }
 2867|  25.0k|}
intrapred_avx2.c:highbd_dr_prediction_32bit_z2_HxW_avx2:
 2526|  29.1k|    int dy) {
 2527|       |  // here upsample_above and upsample_left are 0 by design of
 2528|       |  // av1_use_intra_edge_upsample
 2529|  29.1k|  const int min_base_x = -1;
 2530|  29.1k|  const int min_base_y = -1;
 2531|  29.1k|  (void)upsample_above;
 2532|  29.1k|  (void)upsample_left;
 2533|  29.1k|  const int frac_bits_x = 6;
 2534|  29.1k|  const int frac_bits_y = 6;
 2535|       |
 2536|       |  // pre-filter above pixels
 2537|       |  // store in temp buffers:
 2538|       |  //   above[x] * 32 + 16
 2539|       |  //   above[x+1] - above[x]
 2540|       |  // final pixels will be calculated as:
 2541|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 2542|  29.1k|  __m256i a0_x, a1_x, a0_y, a1_y, a32, a0_1_x, a1_1_x, a16, c1;
 2543|  29.1k|  __m256i diff, min_base_y256, c3f, dy256, c1234, c0123, c8;
 2544|  29.1k|  __m128i a0_x128, a1_x128, a0_1_x128, a1_1_x128;
 2545|  29.1k|  DECLARE_ALIGNED(32, int, base_y_c[16]);
  ------------------
  |  |   19|  29.1k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2546|       |
 2547|  29.1k|  a16 = _mm256_set1_epi32(16);
 2548|  29.1k|  c1 = _mm256_srli_epi32(a16, 4);
 2549|  29.1k|  c8 = _mm256_srli_epi32(a16, 1);
 2550|  29.1k|  min_base_y256 = _mm256_set1_epi32(min_base_y);
 2551|  29.1k|  c3f = _mm256_set1_epi32(0x3f);
 2552|  29.1k|  dy256 = _mm256_set1_epi32(dy);
 2553|  29.1k|  c0123 = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
 2554|  29.1k|  c1234 = _mm256_add_epi32(c0123, c1);
 2555|       |
 2556|   427k|  for (int r = 0; r < H; r++) {
  ------------------
  |  Branch (2556:19): [True: 397k, False: 29.1k]
  ------------------
 2557|   397k|    __m256i b, res, shift, ydx;
 2558|   397k|    __m256i resx[2], resy[2];
 2559|   397k|    __m256i resxy, j256, r6;
 2560|   819k|    for (int j = 0; j < W; j += 16) {
  ------------------
  |  Branch (2560:21): [True: 421k, False: 397k]
  ------------------
 2561|   421k|      j256 = _mm256_set1_epi32(j);
 2562|   421k|      int y = r + 1;
 2563|   421k|      ydx = _mm256_set1_epi32(y * dx);
 2564|       |
 2565|   421k|      int base_x = ((j << 6) - y * dx) >> frac_bits_x;
 2566|   421k|      int base_shift = 0;
 2567|   421k|      if ((base_x) < (min_base_x - 1)) {
  ------------------
  |  Branch (2567:11): [True: 195k, False: 226k]
  ------------------
 2568|   195k|        base_shift = (min_base_x - base_x - 1);
 2569|   195k|      }
 2570|   421k|      int base_min_diff = (min_base_x - base_x);
 2571|   421k|      if (base_min_diff > 16) {
  ------------------
  |  Branch (2571:11): [True: 163k, False: 258k]
  ------------------
 2572|   163k|        base_min_diff = 16;
 2573|   258k|      } else {
 2574|   258k|        if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (2574:13): [True: 22.3k, False: 236k]
  ------------------
 2575|   258k|      }
 2576|       |
 2577|   421k|      if (base_shift > 7) {
  ------------------
  |  Branch (2577:11): [True: 170k, False: 250k]
  ------------------
 2578|   170k|        resx[0] = _mm256_setzero_si256();
 2579|   250k|      } else {
 2580|   250k|        a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 2581|   250k|        a1_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1));
 2582|   250k|        a0_x128 =
 2583|   250k|            _mm_shuffle_epi8(a0_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2584|   250k|        a1_x128 =
 2585|   250k|            _mm_shuffle_epi8(a1_x128, *(__m128i *)HighbdLoadMaskx[base_shift]);
 2586|       |
 2587|   250k|        a0_x = _mm256_cvtepu16_epi32(a0_x128);
 2588|   250k|        a1_x = _mm256_cvtepu16_epi32(a1_x128);
 2589|       |
 2590|   250k|        r6 = _mm256_slli_epi32(_mm256_add_epi32(c0123, j256), 6);
 2591|   250k|        shift = _mm256_srli_epi32(
 2592|   250k|            _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
 2593|       |
 2594|   250k|        diff = _mm256_sub_epi32(a1_x, a0_x);  // a[x+1] - a[x]
 2595|   250k|        a32 = _mm256_slli_epi32(a0_x, 5);     // a[x] * 32
 2596|   250k|        a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2597|       |
 2598|   250k|        b = _mm256_mullo_epi32(diff, shift);
 2599|   250k|        res = _mm256_add_epi32(a32, b);
 2600|   250k|        res = _mm256_srli_epi32(res, 5);
 2601|       |
 2602|   250k|        resx[0] = _mm256_packus_epi32(
 2603|   250k|            res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1)));
 2604|   250k|      }
 2605|   421k|      int base_shift8 = 0;
 2606|   421k|      if ((base_x + 8) < (min_base_x - 1)) {
  ------------------
  |  Branch (2606:11): [True: 170k, False: 250k]
  ------------------
 2607|   170k|        base_shift8 = (min_base_x - (base_x + 8) - 1);
 2608|   170k|      }
 2609|   421k|      if (base_shift8 > 7) {
  ------------------
  |  Branch (2609:11): [True: 163k, False: 258k]
  ------------------
 2610|   163k|        resx[1] = _mm256_setzero_si256();
 2611|   258k|      } else {
 2612|   258k|        a0_1_x128 =
 2613|   258k|            _mm_loadu_si128((__m128i *)(above + base_x + base_shift8 + 8));
 2614|   258k|        a1_1_x128 =
 2615|   258k|            _mm_loadu_si128((__m128i *)(above + base_x + base_shift8 + 9));
 2616|   258k|        a0_1_x128 = _mm_shuffle_epi8(a0_1_x128,
 2617|   258k|                                     *(__m128i *)HighbdLoadMaskx[base_shift8]);
 2618|   258k|        a1_1_x128 = _mm_shuffle_epi8(a1_1_x128,
 2619|   258k|                                     *(__m128i *)HighbdLoadMaskx[base_shift8]);
 2620|       |
 2621|   258k|        a0_1_x = _mm256_cvtepu16_epi32(a0_1_x128);
 2622|   258k|        a1_1_x = _mm256_cvtepu16_epi32(a1_1_x128);
 2623|       |
 2624|   258k|        r6 = _mm256_slli_epi32(
 2625|   258k|            _mm256_add_epi32(c0123, _mm256_add_epi32(j256, c8)), 6);
 2626|   258k|        shift = _mm256_srli_epi32(
 2627|   258k|            _mm256_and_si256(_mm256_sub_epi32(r6, ydx), c3f), 1);
 2628|       |
 2629|   258k|        diff = _mm256_sub_epi32(a1_1_x, a0_1_x);  // a[x+1] - a[x]
 2630|   258k|        a32 = _mm256_slli_epi32(a0_1_x, 5);       // a[x] * 32
 2631|   258k|        a32 = _mm256_add_epi32(a32, a16);         // a[x] * 32 + 16
 2632|   258k|        b = _mm256_mullo_epi32(diff, shift);
 2633|       |
 2634|   258k|        resx[1] = _mm256_add_epi32(a32, b);
 2635|   258k|        resx[1] = _mm256_srli_epi32(resx[1], 5);
 2636|   258k|        resx[1] = _mm256_packus_epi32(
 2637|   258k|            resx[1],
 2638|   258k|            _mm256_castsi128_si256(_mm256_extracti128_si256(resx[1], 1)));
 2639|   258k|      }
 2640|   421k|      resx[0] =
 2641|   421k|          _mm256_inserti128_si256(resx[0], _mm256_castsi256_si128(resx[1]),
 2642|   421k|                                  1);  // 16 16bit values
 2643|       |
 2644|       |      // y calc
 2645|   421k|      resy[0] = _mm256_setzero_si256();
 2646|   421k|      if ((base_x < min_base_x)) {
  ------------------
  |  Branch (2646:11): [True: 243k, False: 177k]
  ------------------
 2647|   243k|        __m256i c256, y_c256, y_c_1_256, base_y_c256, mask256;
 2648|   243k|        r6 = _mm256_set1_epi32(r << 6);
 2649|   243k|        c256 = _mm256_add_epi32(j256, c1234);
 2650|   243k|        y_c256 = _mm256_sub_epi32(r6, _mm256_mullo_epi32(c256, dy256));
 2651|   243k|        base_y_c256 = _mm256_srai_epi32(y_c256, frac_bits_y);
 2652|   243k|        mask256 = _mm256_cmpgt_epi32(min_base_y256, base_y_c256);
 2653|   243k|        base_y_c256 = _mm256_andnot_si256(mask256, base_y_c256);
 2654|   243k|        _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 2655|   243k|        c256 = _mm256_add_epi32(c256, c8);
 2656|   243k|        y_c_1_256 = _mm256_sub_epi32(r6, _mm256_mullo_epi32(c256, dy256));
 2657|   243k|        base_y_c256 = _mm256_srai_epi32(y_c_1_256, frac_bits_y);
 2658|   243k|        mask256 = _mm256_cmpgt_epi32(min_base_y256, base_y_c256);
 2659|   243k|        base_y_c256 = _mm256_andnot_si256(mask256, base_y_c256);
 2660|   243k|        _mm256_store_si256((__m256i *)(base_y_c + 8), base_y_c256);
 2661|       |
 2662|   243k|        a0_y = _mm256_cvtepu16_epi32(_mm_setr_epi16(
 2663|   243k|            left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 2664|   243k|            left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 2665|   243k|            left[base_y_c[6]], left[base_y_c[7]]));
 2666|   243k|        a1_y = _mm256_cvtepu16_epi32(_mm_setr_epi16(
 2667|   243k|            left[base_y_c[0] + 1], left[base_y_c[1] + 1], left[base_y_c[2] + 1],
 2668|   243k|            left[base_y_c[3] + 1], left[base_y_c[4] + 1], left[base_y_c[5] + 1],
 2669|   243k|            left[base_y_c[6] + 1], left[base_y_c[7] + 1]));
 2670|       |
 2671|   243k|        shift = _mm256_srli_epi32(_mm256_and_si256(y_c256, c3f), 1);
 2672|       |
 2673|   243k|        diff = _mm256_sub_epi32(a1_y, a0_y);  // a[x+1] - a[x]
 2674|   243k|        a32 = _mm256_slli_epi32(a0_y, 5);     // a[x] * 32
 2675|   243k|        a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2676|       |
 2677|   243k|        b = _mm256_mullo_epi32(diff, shift);
 2678|   243k|        res = _mm256_add_epi32(a32, b);
 2679|   243k|        res = _mm256_srli_epi32(res, 5);
 2680|       |
 2681|   243k|        resy[0] = _mm256_packus_epi32(
 2682|   243k|            res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1)));
 2683|       |
 2684|   243k|        a0_y = _mm256_cvtepu16_epi32(_mm_setr_epi16(
 2685|   243k|            left[base_y_c[8]], left[base_y_c[9]], left[base_y_c[10]],
 2686|   243k|            left[base_y_c[11]], left[base_y_c[12]], left[base_y_c[13]],
 2687|   243k|            left[base_y_c[14]], left[base_y_c[15]]));
 2688|   243k|        a1_y = _mm256_cvtepu16_epi32(
 2689|   243k|            _mm_setr_epi16(left[base_y_c[8] + 1], left[base_y_c[9] + 1],
 2690|   243k|                           left[base_y_c[10] + 1], left[base_y_c[11] + 1],
 2691|   243k|                           left[base_y_c[12] + 1], left[base_y_c[13] + 1],
 2692|   243k|                           left[base_y_c[14] + 1], left[base_y_c[15] + 1]));
 2693|   243k|        shift = _mm256_srli_epi32(_mm256_and_si256(y_c_1_256, c3f), 1);
 2694|       |
 2695|   243k|        diff = _mm256_sub_epi32(a1_y, a0_y);  // a[x+1] - a[x]
 2696|   243k|        a32 = _mm256_slli_epi32(a0_y, 5);     // a[x] * 32
 2697|   243k|        a32 = _mm256_add_epi32(a32, a16);     // a[x] * 32 + 16
 2698|       |
 2699|   243k|        b = _mm256_mullo_epi32(diff, shift);
 2700|   243k|        res = _mm256_add_epi32(a32, b);
 2701|   243k|        res = _mm256_srli_epi32(res, 5);
 2702|       |
 2703|   243k|        resy[1] = _mm256_packus_epi32(
 2704|   243k|            res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1)));
 2705|       |
 2706|   243k|        resy[0] =
 2707|   243k|            _mm256_inserti128_si256(resy[0], _mm256_castsi256_si128(resy[1]),
 2708|   243k|                                    1);  // 16 16bit values
 2709|   243k|      }
 2710|       |
 2711|   421k|      resxy = _mm256_blendv_epi8(resx[0], resy[0],
 2712|   421k|                                 *(__m256i *)HighbdBaseMask[base_min_diff]);
 2713|   421k|      _mm256_storeu_si256((__m256i *)(dst + j), resxy);
 2714|   421k|    }  // for j
 2715|   397k|    dst += stride;
 2716|   397k|  }
 2717|  29.1k|}
intrapred_avx2.c:highbd_dr_prediction_z3_4x4_avx2:
 2916|   732k|                                             int bd) {
 2917|   732k|  __m128i dstvec[4], d[4];
 2918|   732k|  if (bd < 12) {
  ------------------
  |  Branch (2918:7): [True: 365k, False: 367k]
  ------------------
 2919|   365k|    highbd_dr_prediction_z1_4xN_internal_avx2(4, dstvec, left, upsample_left,
 2920|   365k|                                              dy);
 2921|   367k|  } else {
 2922|   367k|    highbd_dr_prediction_32bit_z1_4xN_internal_avx2(4, dstvec, left,
 2923|   367k|                                                    upsample_left, dy);
 2924|   367k|  }
 2925|   732k|  highbd_transpose4x8_8x4_low_sse2(&dstvec[0], &dstvec[1], &dstvec[2],
 2926|   732k|                                   &dstvec[3], &d[0], &d[1], &d[2], &d[3]);
 2927|   732k|  _mm_storel_epi64((__m128i *)(dst + 0 * stride), d[0]);
 2928|   732k|  _mm_storel_epi64((__m128i *)(dst + 1 * stride), d[1]);
 2929|   732k|  _mm_storel_epi64((__m128i *)(dst + 2 * stride), d[2]);
 2930|   732k|  _mm_storel_epi64((__m128i *)(dst + 3 * stride), d[3]);
 2931|   732k|  return;
 2932|   732k|}
intrapred_avx2.c:highbd_dr_prediction_z3_8x8_avx2:
 2937|   230k|                                             int bd) {
 2938|   230k|  __m128i dstvec[8], d[8];
 2939|   230k|  if (bd < 12) {
  ------------------
  |  Branch (2939:7): [True: 109k, False: 121k]
  ------------------
 2940|   109k|    highbd_dr_prediction_z1_8xN_internal_avx2(8, dstvec, left, upsample_left,
 2941|   109k|                                              dy);
 2942|   121k|  } else {
 2943|   121k|    highbd_dr_prediction_32bit_z1_8xN_internal_avx2(8, dstvec, left,
 2944|   121k|                                                    upsample_left, dy);
 2945|   121k|  }
 2946|   230k|  highbd_transpose8x8_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3],
 2947|   230k|                           &dstvec[4], &dstvec[5], &dstvec[6], &dstvec[7],
 2948|   230k|                           &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6],
 2949|   230k|                           &d[7]);
 2950|  2.07M|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (2950:19): [True: 1.84M, False: 230k]
  ------------------
 2951|  1.84M|    _mm_storeu_si128((__m128i *)(dst + i * stride), d[i]);
 2952|  1.84M|  }
 2953|   230k|}
intrapred_avx2.c:highbd_dr_prediction_z3_16x16_avx2:
 3164|  3.41k|                                               int bd) {
 3165|  3.41k|  __m256i dstvec[16], d[16];
 3166|  3.41k|  if (bd < 12) {
  ------------------
  |  Branch (3166:7): [True: 1.63k, False: 1.77k]
  ------------------
 3167|  1.63k|    highbd_dr_prediction_z1_16xN_internal_avx2(16, dstvec, left, upsample_left,
 3168|  1.63k|                                               dy);
 3169|  1.77k|  } else {
 3170|  1.77k|    highbd_dr_prediction_32bit_z1_16xN_internal_avx2(16, dstvec, left,
 3171|  1.77k|                                                     upsample_left, dy);
 3172|  1.77k|  }
 3173|       |
 3174|  3.41k|  highbd_transpose16x16_avx2(dstvec, d);
 3175|       |
 3176|  58.0k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3176:19): [True: 54.6k, False: 3.41k]
  ------------------
 3177|  54.6k|    _mm256_storeu_si256((__m256i *)(dst + i * stride), d[i]);
 3178|  54.6k|  }
 3179|  3.41k|}
intrapred_avx2.c:highbd_transpose16x16_avx2:
  243|  3.73k|static inline void highbd_transpose16x16_avx2(__m256i *x, __m256i *d) {
  244|  3.73k|  __m256i w0, w1, w2, w3, ww0, ww1;
  245|  3.73k|  __m256i dd[16];
  246|  3.73k|  w0 = _mm256_unpacklo_epi16(x[0], x[1]);
  247|  3.73k|  w1 = _mm256_unpacklo_epi16(x[2], x[3]);
  248|  3.73k|  w2 = _mm256_unpacklo_epi16(x[4], x[5]);
  249|  3.73k|  w3 = _mm256_unpacklo_epi16(x[6], x[7]);
  250|       |
  251|  3.73k|  ww0 = _mm256_unpacklo_epi32(w0, w1);  //
  252|  3.73k|  ww1 = _mm256_unpacklo_epi32(w2, w3);  //
  253|       |
  254|  3.73k|  dd[0] = _mm256_unpacklo_epi64(ww0, ww1);
  255|  3.73k|  dd[1] = _mm256_unpackhi_epi64(ww0, ww1);
  256|       |
  257|  3.73k|  ww0 = _mm256_unpackhi_epi32(w0, w1);  //
  258|  3.73k|  ww1 = _mm256_unpackhi_epi32(w2, w3);  //
  259|       |
  260|  3.73k|  dd[2] = _mm256_unpacklo_epi64(ww0, ww1);
  261|  3.73k|  dd[3] = _mm256_unpackhi_epi64(ww0, ww1);
  262|       |
  263|  3.73k|  w0 = _mm256_unpackhi_epi16(x[0], x[1]);
  264|  3.73k|  w1 = _mm256_unpackhi_epi16(x[2], x[3]);
  265|  3.73k|  w2 = _mm256_unpackhi_epi16(x[4], x[5]);
  266|  3.73k|  w3 = _mm256_unpackhi_epi16(x[6], x[7]);
  267|       |
  268|  3.73k|  ww0 = _mm256_unpacklo_epi32(w0, w1);  //
  269|  3.73k|  ww1 = _mm256_unpacklo_epi32(w2, w3);  //
  270|       |
  271|  3.73k|  dd[4] = _mm256_unpacklo_epi64(ww0, ww1);
  272|  3.73k|  dd[5] = _mm256_unpackhi_epi64(ww0, ww1);
  273|       |
  274|  3.73k|  ww0 = _mm256_unpackhi_epi32(w0, w1);  //
  275|  3.73k|  ww1 = _mm256_unpackhi_epi32(w2, w3);  //
  276|       |
  277|  3.73k|  dd[6] = _mm256_unpacklo_epi64(ww0, ww1);
  278|  3.73k|  dd[7] = _mm256_unpackhi_epi64(ww0, ww1);
  279|       |
  280|  3.73k|  w0 = _mm256_unpacklo_epi16(x[8], x[9]);
  281|  3.73k|  w1 = _mm256_unpacklo_epi16(x[10], x[11]);
  282|  3.73k|  w2 = _mm256_unpacklo_epi16(x[12], x[13]);
  283|  3.73k|  w3 = _mm256_unpacklo_epi16(x[14], x[15]);
  284|       |
  285|  3.73k|  ww0 = _mm256_unpacklo_epi32(w0, w1);
  286|  3.73k|  ww1 = _mm256_unpacklo_epi32(w2, w3);
  287|       |
  288|  3.73k|  dd[8] = _mm256_unpacklo_epi64(ww0, ww1);
  289|  3.73k|  dd[9] = _mm256_unpackhi_epi64(ww0, ww1);
  290|       |
  291|  3.73k|  ww0 = _mm256_unpackhi_epi32(w0, w1);
  292|  3.73k|  ww1 = _mm256_unpackhi_epi32(w2, w3);
  293|       |
  294|  3.73k|  dd[10] = _mm256_unpacklo_epi64(ww0, ww1);
  295|  3.73k|  dd[11] = _mm256_unpackhi_epi64(ww0, ww1);
  296|       |
  297|  3.73k|  w0 = _mm256_unpackhi_epi16(x[8], x[9]);
  298|  3.73k|  w1 = _mm256_unpackhi_epi16(x[10], x[11]);
  299|  3.73k|  w2 = _mm256_unpackhi_epi16(x[12], x[13]);
  300|  3.73k|  w3 = _mm256_unpackhi_epi16(x[14], x[15]);
  301|       |
  302|  3.73k|  ww0 = _mm256_unpacklo_epi32(w0, w1);
  303|  3.73k|  ww1 = _mm256_unpacklo_epi32(w2, w3);
  304|       |
  305|  3.73k|  dd[12] = _mm256_unpacklo_epi64(ww0, ww1);
  306|  3.73k|  dd[13] = _mm256_unpackhi_epi64(ww0, ww1);
  307|       |
  308|  3.73k|  ww0 = _mm256_unpackhi_epi32(w0, w1);
  309|  3.73k|  ww1 = _mm256_unpackhi_epi32(w2, w3);
  310|       |
  311|  3.73k|  dd[14] = _mm256_unpacklo_epi64(ww0, ww1);
  312|  3.73k|  dd[15] = _mm256_unpackhi_epi64(ww0, ww1);
  313|       |
  314|  33.6k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (314:19): [True: 29.8k, False: 3.73k]
  ------------------
  315|  29.8k|    d[i] = _mm256_insertf128_si256(dd[i], _mm256_castsi256_si128(dd[i + 8]), 1);
  316|       |    d[i + 8] = _mm256_insertf128_si256(dd[i + 8],
  317|  29.8k|                                       _mm256_extracti128_si256(dd[i], 1), 0);
  318|  29.8k|  }
  319|  3.73k|}
intrapred_avx2.c:highbd_dr_prediction_z3_4x8_avx2:
 2958|  43.6k|                                             int bd) {
 2959|  43.6k|  __m128i dstvec[4], d[8];
 2960|  43.6k|  if (bd < 12) {
  ------------------
  |  Branch (2960:7): [True: 18.0k, False: 25.6k]
  ------------------
 2961|  18.0k|    highbd_dr_prediction_z1_8xN_internal_avx2(4, dstvec, left, upsample_left,
 2962|  18.0k|                                              dy);
 2963|  25.6k|  } else {
 2964|  25.6k|    highbd_dr_prediction_32bit_z1_8xN_internal_avx2(4, dstvec, left,
 2965|  25.6k|                                                    upsample_left, dy);
 2966|  25.6k|  }
 2967|       |
 2968|  43.6k|  highbd_transpose4x8_8x4_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3],
 2969|  43.6k|                               &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6],
 2970|  43.6k|                               &d[7]);
 2971|   393k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (2971:19): [True: 349k, False: 43.6k]
  ------------------
 2972|   349k|    _mm_storel_epi64((__m128i *)(dst + i * stride), d[i]);
 2973|   349k|  }
 2974|  43.6k|}
intrapred_avx2.c:highbd_dr_prediction_z3_8x16_avx2:
 3001|  2.27k|                                              int bd) {
 3002|  2.27k|  __m256i dstvec[8], d[8];
 3003|  2.27k|  if (bd < 12) {
  ------------------
  |  Branch (3003:7): [True: 1.07k, False: 1.19k]
  ------------------
 3004|  1.07k|    highbd_dr_prediction_z1_16xN_internal_avx2(8, dstvec, left, upsample_left,
 3005|  1.07k|                                               dy);
 3006|  1.19k|  } else {
 3007|  1.19k|    highbd_dr_prediction_32bit_z1_16xN_internal_avx2(8, dstvec, left,
 3008|  1.19k|                                                     upsample_left, dy);
 3009|  1.19k|  }
 3010|  2.27k|  highbd_transpose8x16_16x8_avx2(dstvec, d);
 3011|  20.4k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3011:19): [True: 18.1k, False: 2.27k]
  ------------------
 3012|  18.1k|    _mm_storeu_si128((__m128i *)(dst + i * stride),
 3013|  18.1k|                     _mm256_castsi256_si128(d[i]));
 3014|  18.1k|  }
 3015|  20.4k|  for (int i = 8; i < 16; i++) {
  ------------------
  |  Branch (3015:19): [True: 18.1k, False: 2.27k]
  ------------------
 3016|  18.1k|    _mm_storeu_si128((__m128i *)(dst + i * stride),
 3017|       |                     _mm256_extracti128_si256(d[i - 8], 1));
 3018|  18.1k|  }
 3019|  2.27k|}
intrapred_avx2.c:highbd_transpose8x16_16x8_avx2:
  205|  2.50k|static inline void highbd_transpose8x16_16x8_avx2(__m256i *x, __m256i *d) {
  206|  2.50k|  __m256i w0, w1, w2, w3, ww0, ww1;
  207|       |
  208|  2.50k|  w0 = _mm256_unpacklo_epi16(x[0], x[1]);  // 00 10 01 11 02 12 03 13
  209|  2.50k|  w1 = _mm256_unpacklo_epi16(x[2], x[3]);  // 20 30 21 31 22 32 23 33
  210|  2.50k|  w2 = _mm256_unpacklo_epi16(x[4], x[5]);  // 40 50 41 51 42 52 43 53
  211|  2.50k|  w3 = _mm256_unpacklo_epi16(x[6], x[7]);  // 60 70 61 71 62 72 63 73
  212|       |
  213|  2.50k|  ww0 = _mm256_unpacklo_epi32(w0, w1);  // 00 10 20 30 01 11 21 31
  214|  2.50k|  ww1 = _mm256_unpacklo_epi32(w2, w3);  // 40 50 60 70 41 51 61 71
  215|       |
  216|  2.50k|  d[0] = _mm256_unpacklo_epi64(ww0, ww1);  // 00 10 20 30 40 50 60 70
  217|  2.50k|  d[1] = _mm256_unpackhi_epi64(ww0, ww1);  // 01 11 21 31 41 51 61 71
  218|       |
  219|  2.50k|  ww0 = _mm256_unpackhi_epi32(w0, w1);  // 02 12 22 32 03 13 23 33
  220|  2.50k|  ww1 = _mm256_unpackhi_epi32(w2, w3);  // 42 52 62 72 43 53 63 73
  221|       |
  222|  2.50k|  d[2] = _mm256_unpacklo_epi64(ww0, ww1);  // 02 12 22 32 42 52 62 72
  223|  2.50k|  d[3] = _mm256_unpackhi_epi64(ww0, ww1);  // 03 13 23 33 43 53 63 73
  224|       |
  225|  2.50k|  w0 = _mm256_unpackhi_epi16(x[0], x[1]);  // 04 14 05 15 06 16 07 17
  226|  2.50k|  w1 = _mm256_unpackhi_epi16(x[2], x[3]);  // 24 34 25 35 26 36 27 37
  227|  2.50k|  w2 = _mm256_unpackhi_epi16(x[4], x[5]);  // 44 54 45 55 46 56 47 57
  228|  2.50k|  w3 = _mm256_unpackhi_epi16(x[6], x[7]);  // 64 74 65 75 66 76 67 77
  229|       |
  230|  2.50k|  ww0 = _mm256_unpacklo_epi32(w0, w1);  // 04 14 24 34 05 15 25 35
  231|  2.50k|  ww1 = _mm256_unpacklo_epi32(w2, w3);  // 44 54 64 74 45 55 65 75
  232|       |
  233|  2.50k|  d[4] = _mm256_unpacklo_epi64(ww0, ww1);  // 04 14 24 34 44 54 64 74
  234|  2.50k|  d[5] = _mm256_unpackhi_epi64(ww0, ww1);  // 05 15 25 35 45 55 65 75
  235|       |
  236|  2.50k|  ww0 = _mm256_unpackhi_epi32(w0, w1);  // 06 16 26 36 07 17 27 37
  237|  2.50k|  ww1 = _mm256_unpackhi_epi32(w2, w3);  // 46 56 66 76 47 57 67 77
  238|       |
  239|  2.50k|  d[6] = _mm256_unpacklo_epi64(ww0, ww1);  // 06 16 26 36 46 56 66 76
  240|  2.50k|  d[7] = _mm256_unpackhi_epi64(ww0, ww1);  // 07 17 27 37 47 57 67 77
  241|  2.50k|}
intrapred_avx2.c:highbd_dr_prediction_z3_16x32_avx2:
 3228|     59|                                               int bd) {
 3229|     59|  __m256i dstvec[32], d[32];
 3230|     59|  if (bd < 12) {
  ------------------
  |  Branch (3230:7): [True: 19, False: 40]
  ------------------
 3231|     19|    highbd_dr_prediction_z1_32xN_internal_avx2(16, dstvec, left, upsample_left,
 3232|     19|                                               dy);
 3233|     40|  } else {
 3234|     40|    highbd_dr_prediction_32bit_z1_32xN_internal_avx2(16, dstvec, left,
 3235|     40|                                                     upsample_left, dy);
 3236|     40|  }
 3237|    295|  for (int i = 0; i < 32; i += 8) {
  ------------------
  |  Branch (3237:19): [True: 236, False: 59]
  ------------------
 3238|    236|    highbd_transpose8x16_16x8_avx2(dstvec + i, d + i);
 3239|    236|  }
 3240|       |  // store
 3241|    177|  for (int j = 0; j < 32; j += 16) {
  ------------------
  |  Branch (3241:19): [True: 118, False: 59]
  ------------------
 3242|  1.06k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3242:21): [True: 944, False: 118]
  ------------------
 3243|    944|      _mm_storeu_si128((__m128i *)(dst + (i + j) * stride),
 3244|    944|                       _mm256_castsi256_si128(d[(i + j)]));
 3245|    944|    }
 3246|  1.06k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3246:21): [True: 944, False: 118]
  ------------------
 3247|    944|      _mm_storeu_si128((__m128i *)(dst + (i + j) * stride + 8),
 3248|    944|                       _mm256_castsi256_si128(d[(i + j) + 8]));
 3249|    944|    }
 3250|  1.06k|    for (int i = 8; i < 16; i++) {
  ------------------
  |  Branch (3250:21): [True: 944, False: 118]
  ------------------
 3251|    944|      _mm256_storeu_si256(
 3252|    944|          (__m256i *)(dst + (i + j) * stride),
 3253|       |          _mm256_inserti128_si256(
 3254|    944|              d[(i + j)], _mm256_extracti128_si256(d[(i + j) - 8], 1), 0));
 3255|    944|    }
 3256|    118|  }
 3257|     59|}
intrapred_avx2.c:highbd_dr_prediction_z3_8x4_avx2:
 2979|  46.1k|                                             int bd) {
 2980|  46.1k|  __m128i dstvec[8], d[4];
 2981|  46.1k|  if (bd < 12) {
  ------------------
  |  Branch (2981:7): [True: 18.6k, False: 27.5k]
  ------------------
 2982|  18.6k|    highbd_dr_prediction_z1_4xN_internal_avx2(8, dstvec, left, upsample_left,
 2983|  18.6k|                                              dy);
 2984|  27.5k|  } else {
 2985|  27.5k|    highbd_dr_prediction_32bit_z1_4xN_internal_avx2(8, dstvec, left,
 2986|  27.5k|                                                    upsample_left, dy);
 2987|  27.5k|  }
 2988|       |
 2989|  46.1k|  highbd_transpose8x8_low_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3],
 2990|  46.1k|                               &dstvec[4], &dstvec[5], &dstvec[6], &dstvec[7],
 2991|  46.1k|                               &d[0], &d[1], &d[2], &d[3]);
 2992|  46.1k|  _mm_storeu_si128((__m128i *)(dst + 0 * stride), d[0]);
 2993|  46.1k|  _mm_storeu_si128((__m128i *)(dst + 1 * stride), d[1]);
 2994|  46.1k|  _mm_storeu_si128((__m128i *)(dst + 2 * stride), d[2]);
 2995|  46.1k|  _mm_storeu_si128((__m128i *)(dst + 3 * stride), d[3]);
 2996|  46.1k|}
intrapred_avx2.c:highbd_dr_prediction_z3_16x8_avx2:
 3024|  2.13k|                                              int bd) {
 3025|  2.13k|  __m128i dstvec[16], d[16];
 3026|  2.13k|  if (bd < 12) {
  ------------------
  |  Branch (3026:7): [True: 857, False: 1.27k]
  ------------------
 3027|    857|    highbd_dr_prediction_z1_8xN_internal_avx2(16, dstvec, left, upsample_left,
 3028|    857|                                              dy);
 3029|  1.27k|  } else {
 3030|  1.27k|    highbd_dr_prediction_32bit_z1_8xN_internal_avx2(16, dstvec, left,
 3031|  1.27k|                                                    upsample_left, dy);
 3032|  1.27k|  }
 3033|  6.40k|  for (int i = 0; i < 16; i += 8) {
  ------------------
  |  Branch (3033:19): [True: 4.27k, False: 2.13k]
  ------------------
 3034|  4.27k|    highbd_transpose8x8_sse2(&dstvec[0 + i], &dstvec[1 + i], &dstvec[2 + i],
 3035|  4.27k|                             &dstvec[3 + i], &dstvec[4 + i], &dstvec[5 + i],
 3036|  4.27k|                             &dstvec[6 + i], &dstvec[7 + i], &d[0 + i],
 3037|  4.27k|                             &d[1 + i], &d[2 + i], &d[3 + i], &d[4 + i],
 3038|  4.27k|                             &d[5 + i], &d[6 + i], &d[7 + i]);
 3039|  4.27k|  }
 3040|  19.2k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3040:19): [True: 17.0k, False: 2.13k]
  ------------------
 3041|  17.0k|    _mm_storeu_si128((__m128i *)(dst + i * stride), d[i]);
 3042|  17.0k|    _mm_storeu_si128((__m128i *)(dst + i * stride + 8), d[i + 8]);
 3043|  17.0k|  }
 3044|  2.13k|}
intrapred_avx2.c:highbd_dr_prediction_z3_32x16_avx2:
 3262|    160|                                               int bd) {
 3263|    160|  __m256i dstvec[32], d[16];
 3264|    160|  if (bd < 12) {
  ------------------
  |  Branch (3264:7): [True: 55, False: 105]
  ------------------
 3265|     55|    highbd_dr_prediction_z1_16xN_internal_avx2(32, dstvec, left, upsample_left,
 3266|     55|                                               dy);
 3267|    105|  } else {
 3268|    105|    highbd_dr_prediction_32bit_z1_16xN_internal_avx2(32, dstvec, left,
 3269|    105|                                                     upsample_left, dy);
 3270|    105|  }
 3271|    480|  for (int i = 0; i < 32; i += 16) {
  ------------------
  |  Branch (3271:19): [True: 320, False: 160]
  ------------------
 3272|    320|    highbd_transpose16x16_avx2((dstvec + i), d);
 3273|  5.44k|    for (int j = 0; j < 16; j++) {
  ------------------
  |  Branch (3273:21): [True: 5.12k, False: 320]
  ------------------
 3274|  5.12k|      _mm256_storeu_si256((__m256i *)(dst + j * stride + i), d[j]);
 3275|  5.12k|    }
 3276|    320|  }
 3277|    160|}
intrapred_avx2.c:dr_prediction_z1_4xN_avx2:
 3621|   966k|                                      int dx) {
 3622|   966k|  __m128i dstvec[16];
 3623|       |
 3624|   966k|  dr_prediction_z1_HxW_internal_avx2(4, N, dstvec, above, upsample_above, dx);
 3625|  5.46M|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (3625:19): [True: 4.49M, False: 966k]
  ------------------
 3626|  4.49M|    *(int *)(dst + stride * i) = _mm_cvtsi128_si32(dstvec[i]);
 3627|  4.49M|  }
 3628|   966k|}
intrapred_avx2.c:dr_prediction_z1_HxW_internal_avx2:
 3550|  5.14M|    int dx) {
 3551|  5.14M|  const int frac_bits = 6 - upsample_above;
 3552|  5.14M|  const int max_base_x = ((W + H) - 1) << upsample_above;
 3553|       |
 3554|  5.14M|  assert(dx > 0);
 3555|       |  // pre-filter above pixels
 3556|       |  // store in temp buffers:
 3557|       |  //   above[x] * 32 + 16
 3558|       |  //   above[x+1] - above[x]
 3559|       |  // final pixels will be calculated as:
 3560|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 3561|  5.14M|  __m256i a0, a1, a32, a16;
 3562|  5.14M|  __m256i diff, c3f;
 3563|  5.14M|  __m128i a_mbase_x;
 3564|       |
 3565|  5.14M|  a16 = _mm256_set1_epi16(16);
 3566|  5.14M|  a_mbase_x = _mm_set1_epi8((int8_t)above[max_base_x]);
 3567|  5.14M|  c3f = _mm256_set1_epi16(0x3f);
 3568|       |
 3569|  5.14M|  int x = dx;
 3570|  41.0M|  for (int r = 0; r < W; r++) {
  ------------------
  |  Branch (3570:19): [True: 35.9M, False: 5.13M]
  ------------------
 3571|  35.9M|    __m256i b, res, shift;
 3572|  35.9M|    __m128i res1, a0_128, a1_128;
 3573|       |
 3574|  35.9M|    int base = x >> frac_bits;
 3575|  35.9M|    int base_max_diff = (max_base_x - base) >> upsample_above;
 3576|  35.9M|    if (base_max_diff <= 0) {
  ------------------
  |  Branch (3576:9): [True: 1.54k, False: 35.9M]
  ------------------
 3577|  3.09k|      for (int i = r; i < W; ++i) {
  ------------------
  |  Branch (3577:23): [True: 1.54k, False: 1.54k]
  ------------------
 3578|  1.54k|        dst[i] = a_mbase_x;  // save 4 values
 3579|  1.54k|      }
 3580|  1.54k|      return;
 3581|  1.54k|    }
 3582|  35.9M|    if (base_max_diff > H) base_max_diff = H;
  ------------------
  |  Branch (3582:9): [True: 34.8M, False: 1.12M]
  ------------------
 3583|  35.9M|    a0_128 = _mm_loadu_si128((__m128i *)(above + base));
 3584|  35.9M|    a1_128 = _mm_loadu_si128((__m128i *)(above + base + 1));
 3585|       |
 3586|  35.9M|    if (upsample_above) {
  ------------------
  |  Branch (3586:9): [True: 29.9M, False: 6.03M]
  ------------------
 3587|  29.9M|      a0_128 = _mm_shuffle_epi8(a0_128, *(__m128i *)EvenOddMaskx[0]);
 3588|  29.9M|      a1_128 = _mm_srli_si128(a0_128, 8);
 3589|       |
 3590|  29.9M|      shift = _mm256_srli_epi16(
 3591|  29.9M|          _mm256_and_si256(
 3592|  29.9M|              _mm256_slli_epi16(_mm256_set1_epi16(x), upsample_above), c3f),
 3593|  29.9M|          1);
 3594|  29.9M|    } else {
 3595|  6.03M|      shift = _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 3596|  6.03M|    }
 3597|  35.9M|    a0 = _mm256_cvtepu8_epi16(a0_128);
 3598|  35.9M|    a1 = _mm256_cvtepu8_epi16(a1_128);
 3599|       |
 3600|  35.9M|    diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 3601|  35.9M|    a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 3602|  35.9M|    a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 3603|       |
 3604|  35.9M|    b = _mm256_mullo_epi16(diff, shift);
 3605|  35.9M|    res = _mm256_add_epi16(a32, b);
 3606|  35.9M|    res = _mm256_srli_epi16(res, 5);
 3607|       |
 3608|  35.9M|    res = _mm256_packus_epi16(
 3609|  35.9M|        res, _mm256_castsi128_si256(
 3610|  35.9M|                 _mm256_extracti128_si256(res, 1)));  // goto 8 bit
 3611|  35.9M|    res1 = _mm256_castsi256_si128(res);               // 16 8bit values
 3612|       |
 3613|  35.9M|    dst[r] =
 3614|  35.9M|        _mm_blendv_epi8(a_mbase_x, res1, *(__m128i *)BaseMask[base_max_diff]);
 3615|  35.9M|    x += dx;
 3616|  35.9M|  }
 3617|  5.14M|}
intrapred_avx2.c:dr_prediction_z1_8xN_avx2:
 3632|  1.35M|                                      int dx) {
 3633|  1.35M|  __m128i dstvec[32];
 3634|       |
 3635|  1.35M|  dr_prediction_z1_HxW_internal_avx2(8, N, dstvec, above, upsample_above, dx);
 3636|  12.2M|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (3636:19): [True: 10.8M, False: 1.35M]
  ------------------
 3637|  10.8M|    _mm_storel_epi64((__m128i *)(dst + stride * i), dstvec[i]);
 3638|  10.8M|  }
 3639|  1.35M|}
intrapred_avx2.c:dr_prediction_z1_16xN_avx2:
 3643|  33.5k|                                       int dx) {
 3644|  33.5k|  __m128i dstvec[64];
 3645|       |
 3646|  33.5k|  dr_prediction_z1_HxW_internal_avx2(16, N, dstvec, above, upsample_above, dx);
 3647|   477k|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (3647:19): [True: 443k, False: 33.5k]
  ------------------
 3648|   443k|    _mm_storeu_si128((__m128i *)(dst + stride * i), dstvec[i]);
 3649|   443k|  }
 3650|  33.5k|}
intrapred_avx2.c:dr_prediction_z1_32xN_avx2:
 3724|    885|                                       int dx) {
 3725|    885|  __m256i dstvec[64];
 3726|    885|  dr_prediction_z1_32xN_internal_avx2(N, dstvec, above, upsample_above, dx);
 3727|  15.0k|  for (int i = 0; i < N; i++) {
  ------------------
  |  Branch (3727:19): [True: 14.1k, False: 885]
  ------------------
 3728|  14.1k|    _mm256_storeu_si256((__m256i *)(dst + stride * i), dstvec[i]);
 3729|  14.1k|  }
 3730|    885|}
intrapred_avx2.c:dr_prediction_z1_32xN_internal_avx2:
 3653|  1.56k|    int N, __m256i *dstvec, const uint8_t *above, int upsample_above, int dx) {
 3654|       |  // here upsample_above is 0 by design of av1_use_intra_edge_upsample
 3655|  1.56k|  (void)upsample_above;
 3656|  1.56k|  const int frac_bits = 6;
 3657|  1.56k|  const int max_base_x = ((32 + N) - 1);
 3658|       |
 3659|       |  // pre-filter above pixels
 3660|       |  // store in temp buffers:
 3661|       |  //   above[x] * 32 + 16
 3662|       |  //   above[x+1] - above[x]
 3663|       |  // final pixels will be calculated as:
 3664|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 3665|  1.56k|  __m256i a0, a1, a32, a16;
 3666|  1.56k|  __m256i a_mbase_x, diff, c3f;
 3667|       |
 3668|  1.56k|  a16 = _mm256_set1_epi16(16);
 3669|  1.56k|  a_mbase_x = _mm256_set1_epi8((int8_t)above[max_base_x]);
 3670|  1.56k|  c3f = _mm256_set1_epi16(0x3f);
 3671|       |
 3672|  1.56k|  int x = dx;
 3673|  26.6k|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (3673:19): [True: 25.0k, False: 1.56k]
  ------------------
 3674|  25.0k|    __m256i b, res, res16[2];
 3675|  25.0k|    __m128i a0_128, a1_128;
 3676|       |
 3677|  25.0k|    int base = x >> frac_bits;
 3678|  25.0k|    int base_max_diff = (max_base_x - base);
 3679|  25.0k|    if (base_max_diff <= 0) {
  ------------------
  |  Branch (3679:9): [True: 0, False: 25.0k]
  ------------------
 3680|      0|      for (int i = r; i < N; ++i) {
  ------------------
  |  Branch (3680:23): [True: 0, False: 0]
  ------------------
 3681|      0|        dstvec[i] = a_mbase_x;  // save 32 values
 3682|      0|      }
 3683|      0|      return;
 3684|      0|    }
 3685|  25.0k|    if (base_max_diff > 32) base_max_diff = 32;
  ------------------
  |  Branch (3685:9): [True: 25.0k, False: 0]
  ------------------
 3686|  25.0k|    __m256i shift =
 3687|  25.0k|        _mm256_srli_epi16(_mm256_and_si256(_mm256_set1_epi16(x), c3f), 1);
 3688|       |
 3689|  75.2k|    for (int j = 0, jj = 0; j < 32; j += 16, jj++) {
  ------------------
  |  Branch (3689:29): [True: 50.1k, False: 25.0k]
  ------------------
 3690|  50.1k|      int mdiff = base_max_diff - j;
 3691|  50.1k|      if (mdiff <= 0) {
  ------------------
  |  Branch (3691:11): [True: 0, False: 50.1k]
  ------------------
 3692|      0|        res16[jj] = a_mbase_x;
 3693|  50.1k|      } else {
 3694|  50.1k|        a0_128 = _mm_loadu_si128((__m128i *)(above + base + j));
 3695|  50.1k|        a1_128 = _mm_loadu_si128((__m128i *)(above + base + j + 1));
 3696|  50.1k|        a0 = _mm256_cvtepu8_epi16(a0_128);
 3697|  50.1k|        a1 = _mm256_cvtepu8_epi16(a1_128);
 3698|       |
 3699|  50.1k|        diff = _mm256_sub_epi16(a1, a0);   // a[x+1] - a[x]
 3700|  50.1k|        a32 = _mm256_slli_epi16(a0, 5);    // a[x] * 32
 3701|  50.1k|        a32 = _mm256_add_epi16(a32, a16);  // a[x] * 32 + 16
 3702|  50.1k|        b = _mm256_mullo_epi16(diff, shift);
 3703|       |
 3704|  50.1k|        res = _mm256_add_epi16(a32, b);
 3705|  50.1k|        res = _mm256_srli_epi16(res, 5);
 3706|  50.1k|        res16[jj] = _mm256_packus_epi16(
 3707|  50.1k|            res, _mm256_castsi128_si256(
 3708|  50.1k|                     _mm256_extracti128_si256(res, 1)));  // 16 8bit values
 3709|  50.1k|      }
 3710|  50.1k|    }
 3711|  25.0k|    res16[1] =
 3712|  25.0k|        _mm256_inserti128_si256(res16[0], _mm256_castsi256_si128(res16[1]),
 3713|  25.0k|                                1);  // 32 8bit values
 3714|       |
 3715|  25.0k|    dstvec[r] = _mm256_blendv_epi8(
 3716|  25.0k|        a_mbase_x, res16[1],
 3717|  25.0k|        *(__m256i *)BaseMask[base_max_diff]);  // 32 8bit values
 3718|  25.0k|    x += dx;
 3719|  25.0k|  }
 3720|  1.56k|}
intrapred_avx2.c:dr_prediction_z2_Nx4_avx2:
 3845|  1.68M|                                      int dx, int dy) {
 3846|  1.68M|  const int min_base_x = -(1 << upsample_above);
 3847|  1.68M|  const int min_base_y = -(1 << upsample_left);
 3848|  1.68M|  const int frac_bits_x = 6 - upsample_above;
 3849|  1.68M|  const int frac_bits_y = 6 - upsample_left;
 3850|       |
 3851|  1.68M|  assert(dx > 0);
 3852|       |  // pre-filter above pixels
 3853|       |  // store in temp buffers:
 3854|       |  //   above[x] * 32 + 16
 3855|       |  //   above[x+1] - above[x]
 3856|       |  // final pixels will be calculated as:
 3857|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 3858|  1.68M|  __m128i a0_x, a1_x, a32, a16, diff;
 3859|  1.68M|  __m128i c3f, min_base_y128, c1234, dy128;
 3860|       |
 3861|  1.68M|  a16 = _mm_set1_epi16(16);
 3862|  1.68M|  c3f = _mm_set1_epi16(0x3f);
 3863|  1.68M|  min_base_y128 = _mm_set1_epi16(min_base_y);
 3864|  1.68M|  c1234 = _mm_setr_epi16(0, 1, 2, 3, 4, 0, 0, 0);
 3865|  1.68M|  dy128 = _mm_set1_epi16(dy);
 3866|       |
 3867|  9.42M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (3867:19): [True: 7.74M, False: 1.68M]
  ------------------
 3868|  7.74M|    __m128i b, res, shift, r6, ydx;
 3869|  7.74M|    __m128i resx, resy, resxy;
 3870|  7.74M|    __m128i a0_x128, a1_x128;
 3871|  7.74M|    int y = r + 1;
 3872|  7.74M|    int base_x = (-y * dx) >> frac_bits_x;
 3873|  7.74M|    int base_shift = 0;
 3874|  7.74M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (3874:9): [True: 4.79M, False: 2.95M]
  ------------------
 3875|  4.79M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 3876|  4.79M|    }
 3877|  7.74M|    int base_min_diff =
 3878|  7.74M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 3879|  7.74M|    if (base_min_diff > 4) {
  ------------------
  |  Branch (3879:9): [True: 2.77M, False: 4.97M]
  ------------------
 3880|  2.77M|      base_min_diff = 4;
 3881|  4.97M|    } else {
 3882|  4.97M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (3882:11): [True: 0, False: 4.97M]
  ------------------
 3883|  4.97M|    }
 3884|       |
 3885|  7.74M|    if (base_shift > 3) {
  ------------------
  |  Branch (3885:9): [True: 2.77M, False: 4.97M]
  ------------------
 3886|  2.77M|      a0_x = _mm_setzero_si128();
 3887|  2.77M|      a1_x = _mm_setzero_si128();
 3888|  2.77M|      shift = _mm_setzero_si128();
 3889|  4.97M|    } else {
 3890|  4.97M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 3891|  4.97M|      ydx = _mm_set1_epi16(y * dx);
 3892|  4.97M|      r6 = _mm_slli_epi16(c1234, 6);
 3893|       |
 3894|  4.97M|      if (upsample_above) {
  ------------------
  |  Branch (3894:11): [True: 2.92M, False: 2.04M]
  ------------------
 3895|  2.92M|        a0_x128 =
 3896|  2.92M|            _mm_shuffle_epi8(a0_x128, *(__m128i *)EvenOddMaskx[base_shift]);
 3897|  2.92M|        a1_x128 = _mm_srli_si128(a0_x128, 8);
 3898|       |
 3899|  2.92M|        shift = _mm_srli_epi16(
 3900|  2.92M|            _mm_and_si128(
 3901|  2.92M|                _mm_slli_epi16(_mm_sub_epi16(r6, ydx), upsample_above), c3f),
 3902|  2.92M|            1);
 3903|  2.92M|      } else {
 3904|  2.04M|        a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)LoadMaskx[base_shift]);
 3905|  2.04M|        a1_x128 = _mm_srli_si128(a0_x128, 1);
 3906|       |
 3907|  2.04M|        shift = _mm_srli_epi16(_mm_and_si128(_mm_sub_epi16(r6, ydx), c3f), 1);
 3908|  2.04M|      }
 3909|  4.97M|      a0_x = _mm_cvtepu8_epi16(a0_x128);
 3910|  4.97M|      a1_x = _mm_cvtepu8_epi16(a1_x128);
 3911|  4.97M|    }
 3912|       |    // y calc
 3913|  7.74M|    __m128i a0_y, a1_y, shifty;
 3914|  7.74M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (3914:9): [True: 5.59M, False: 2.15M]
  ------------------
 3915|  5.59M|      DECLARE_ALIGNED(32, int16_t, base_y_c[8]);
  ------------------
  |  |   19|  5.59M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 3916|  5.59M|      __m128i y_c128, base_y_c128, mask128, c1234_;
 3917|  5.59M|      c1234_ = _mm_srli_si128(c1234, 2);
 3918|  5.59M|      r6 = _mm_set1_epi16(r << 6);
 3919|  5.59M|      y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234_, dy128));
 3920|  5.59M|      base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y);
 3921|  5.59M|      mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128);
 3922|  5.59M|      base_y_c128 = _mm_andnot_si128(mask128, base_y_c128);
 3923|  5.59M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 3924|       |
 3925|  5.59M|      a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 3926|  5.59M|                            left[base_y_c[2]], left[base_y_c[3]], 0, 0, 0, 0);
 3927|  5.59M|      base_y_c128 = _mm_add_epi16(base_y_c128, _mm_srli_epi16(a16, 4));
 3928|  5.59M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 3929|  5.59M|      a1_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 3930|  5.59M|                            left[base_y_c[2]], left[base_y_c[3]], 0, 0, 0, 0);
 3931|       |
 3932|  5.59M|      if (upsample_left) {
  ------------------
  |  Branch (3932:11): [True: 3.33M, False: 2.25M]
  ------------------
 3933|  3.33M|        shifty = _mm_srli_epi16(
 3934|  3.33M|            _mm_and_si128(_mm_slli_epi16(y_c128, upsample_left), c3f), 1);
 3935|  3.33M|      } else {
 3936|  2.25M|        shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1);
 3937|  2.25M|      }
 3938|  5.59M|      a0_x = _mm_unpacklo_epi64(a0_x, a0_y);
 3939|  5.59M|      a1_x = _mm_unpacklo_epi64(a1_x, a1_y);
 3940|  5.59M|      shift = _mm_unpacklo_epi64(shift, shifty);
 3941|  5.59M|    }
 3942|       |
 3943|  7.74M|    diff = _mm_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 3944|  7.74M|    a32 = _mm_slli_epi16(a0_x, 5);     // a[x] * 32
 3945|  7.74M|    a32 = _mm_add_epi16(a32, a16);     // a[x] * 32 + 16
 3946|       |
 3947|  7.74M|    b = _mm_mullo_epi16(diff, shift);
 3948|  7.74M|    res = _mm_add_epi16(a32, b);
 3949|  7.74M|    res = _mm_srli_epi16(res, 5);
 3950|       |
 3951|  7.74M|    resx = _mm_packus_epi16(res, res);
 3952|  7.74M|    resy = _mm_srli_si128(resx, 4);
 3953|       |
 3954|  7.74M|    resxy = _mm_blendv_epi8(resx, resy, *(__m128i *)BaseMask[base_min_diff]);
 3955|  7.74M|    *(int *)(dst) = _mm_cvtsi128_si32(resxy);
 3956|  7.74M|    dst += stride;
 3957|  7.74M|  }
 3958|  1.68M|}
intrapred_avx2.c:dr_prediction_z2_Nx8_avx2:
 3963|  3.47M|                                      int dx, int dy) {
 3964|  3.47M|  const int min_base_x = -(1 << upsample_above);
 3965|  3.47M|  const int min_base_y = -(1 << upsample_left);
 3966|  3.47M|  const int frac_bits_x = 6 - upsample_above;
 3967|  3.47M|  const int frac_bits_y = 6 - upsample_left;
 3968|       |
 3969|       |  // pre-filter above pixels
 3970|       |  // store in temp buffers:
 3971|       |  //   above[x] * 32 + 16
 3972|       |  //   above[x+1] - above[x]
 3973|       |  // final pixels will be calculated as:
 3974|       |  //   (above[x] * 32 + 16 + (above[x+1] - above[x]) * shift) >> 5
 3975|  3.47M|  __m256i diff, a32, a16;
 3976|  3.47M|  __m256i a0_x, a1_x;
 3977|  3.47M|  __m128i a0_x128, a1_x128, min_base_y128, c3f;
 3978|  3.47M|  __m128i c1234, dy128;
 3979|       |
 3980|  3.47M|  a16 = _mm256_set1_epi16(16);
 3981|  3.47M|  c3f = _mm_set1_epi16(0x3f);
 3982|  3.47M|  min_base_y128 = _mm_set1_epi16(min_base_y);
 3983|  3.47M|  dy128 = _mm_set1_epi16(dy);
 3984|  3.47M|  c1234 = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
 3985|       |
 3986|  31.6M|  for (int r = 0; r < N; r++) {
  ------------------
  |  Branch (3986:19): [True: 28.2M, False: 3.47M]
  ------------------
 3987|  28.2M|    __m256i b, res, shift;
 3988|  28.2M|    __m128i resx, resy, resxy, r6, ydx;
 3989|       |
 3990|  28.2M|    int y = r + 1;
 3991|  28.2M|    int base_x = (-y * dx) >> frac_bits_x;
 3992|  28.2M|    int base_shift = 0;
 3993|  28.2M|    if (base_x < (min_base_x - 1)) {
  ------------------
  |  Branch (3993:9): [True: 18.8M, False: 9.40M]
  ------------------
 3994|  18.8M|      base_shift = (min_base_x - base_x - 1) >> upsample_above;
 3995|  18.8M|    }
 3996|  28.2M|    int base_min_diff =
 3997|  28.2M|        (min_base_x - base_x + upsample_above) >> upsample_above;
 3998|  28.2M|    if (base_min_diff > 8) {
  ------------------
  |  Branch (3998:9): [True: 13.7M, False: 14.4M]
  ------------------
 3999|  13.7M|      base_min_diff = 8;
 4000|  14.4M|    } else {
 4001|  14.4M|      if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (4001:11): [True: 0, False: 14.4M]
  ------------------
 4002|  14.4M|    }
 4003|       |
 4004|  28.2M|    if (base_shift > 7) {
  ------------------
  |  Branch (4004:9): [True: 13.7M, False: 14.4M]
  ------------------
 4005|  13.7M|      a0_x = _mm256_setzero_si256();
 4006|  13.7M|      a1_x = _mm256_setzero_si256();
 4007|  13.7M|      shift = _mm256_setzero_si256();
 4008|  14.4M|    } else {
 4009|  14.4M|      a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift));
 4010|  14.4M|      ydx = _mm_set1_epi16(y * dx);
 4011|  14.4M|      r6 = _mm_slli_epi16(_mm_srli_si128(c1234, 2), 6);
 4012|  14.4M|      if (upsample_above) {
  ------------------
  |  Branch (4012:11): [True: 10.3M, False: 4.05M]
  ------------------
 4013|  10.3M|        a0_x128 =
 4014|  10.3M|            _mm_shuffle_epi8(a0_x128, *(__m128i *)EvenOddMaskx[base_shift]);
 4015|  10.3M|        a1_x128 = _mm_srli_si128(a0_x128, 8);
 4016|       |
 4017|  10.3M|        shift = _mm256_castsi128_si256(_mm_srli_epi16(
 4018|  10.3M|            _mm_and_si128(
 4019|  10.3M|                _mm_slli_epi16(_mm_sub_epi16(r6, ydx), upsample_above), c3f),
 4020|  10.3M|            1));
 4021|  10.3M|      } else {
 4022|  4.05M|        a1_x128 = _mm_srli_si128(a0_x128, 1);
 4023|  4.05M|        a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)LoadMaskx[base_shift]);
 4024|  4.05M|        a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)LoadMaskx[base_shift]);
 4025|       |
 4026|  4.05M|        shift = _mm256_castsi128_si256(
 4027|  4.05M|            _mm_srli_epi16(_mm_and_si128(_mm_sub_epi16(r6, ydx), c3f), 1));
 4028|  4.05M|      }
 4029|  14.4M|      a0_x = _mm256_castsi128_si256(_mm_cvtepu8_epi16(a0_x128));
 4030|  14.4M|      a1_x = _mm256_castsi128_si256(_mm_cvtepu8_epi16(a1_x128));
 4031|  14.4M|    }
 4032|       |
 4033|       |    // y calc
 4034|  28.2M|    __m128i a0_y, a1_y, shifty;
 4035|  28.2M|    if (base_x < min_base_x) {
  ------------------
  |  Branch (4035:9): [True: 20.4M, False: 7.72M]
  ------------------
 4036|  20.4M|      DECLARE_ALIGNED(32, int16_t, base_y_c[16]);
  ------------------
  |  |   19|  20.4M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 4037|  20.4M|      __m128i y_c128, base_y_c128, mask128;
 4038|  20.4M|      r6 = _mm_set1_epi16(r << 6);
 4039|  20.4M|      y_c128 = _mm_sub_epi16(r6, _mm_mullo_epi16(c1234, dy128));
 4040|  20.4M|      base_y_c128 = _mm_srai_epi16(y_c128, frac_bits_y);
 4041|  20.4M|      mask128 = _mm_cmpgt_epi16(min_base_y128, base_y_c128);
 4042|  20.4M|      base_y_c128 = _mm_andnot_si128(mask128, base_y_c128);
 4043|  20.4M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 4044|       |
 4045|  20.4M|      a0_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 4046|  20.4M|                            left[base_y_c[2]], left[base_y_c[3]],
 4047|  20.4M|                            left[base_y_c[4]], left[base_y_c[5]],
 4048|  20.4M|                            left[base_y_c[6]], left[base_y_c[7]]);
 4049|  20.4M|      base_y_c128 = _mm_add_epi16(
 4050|  20.4M|          base_y_c128, _mm_srli_epi16(_mm256_castsi256_si128(a16), 4));
 4051|  20.4M|      _mm_store_si128((__m128i *)base_y_c, base_y_c128);
 4052|       |
 4053|  20.4M|      a1_y = _mm_setr_epi16(left[base_y_c[0]], left[base_y_c[1]],
 4054|  20.4M|                            left[base_y_c[2]], left[base_y_c[3]],
 4055|  20.4M|                            left[base_y_c[4]], left[base_y_c[5]],
 4056|  20.4M|                            left[base_y_c[6]], left[base_y_c[7]]);
 4057|       |
 4058|  20.4M|      if (upsample_left) {
  ------------------
  |  Branch (4058:11): [True: 15.3M, False: 5.14M]
  ------------------
 4059|  15.3M|        shifty = _mm_srli_epi16(
 4060|  15.3M|            _mm_and_si128(_mm_slli_epi16(y_c128, upsample_left), c3f), 1);
 4061|  15.3M|      } else {
 4062|  5.14M|        shifty = _mm_srli_epi16(_mm_and_si128(y_c128, c3f), 1);
 4063|  5.14M|      }
 4064|       |
 4065|  20.4M|      a0_x = _mm256_inserti128_si256(a0_x, a0_y, 1);
 4066|  20.4M|      a1_x = _mm256_inserti128_si256(a1_x, a1_y, 1);
 4067|  20.4M|      shift = _mm256_inserti128_si256(shift, shifty, 1);
 4068|  20.4M|    }
 4069|       |
 4070|  28.2M|    diff = _mm256_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 4071|  28.2M|    a32 = _mm256_slli_epi16(a0_x, 5);     // a[x] * 32
 4072|  28.2M|    a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 4073|       |
 4074|  28.2M|    b = _mm256_mullo_epi16(diff, shift);
 4075|  28.2M|    res = _mm256_add_epi16(a32, b);
 4076|  28.2M|    res = _mm256_srli_epi16(res, 5);
 4077|       |
 4078|  28.2M|    resx = _mm_packus_epi16(_mm256_castsi256_si128(res),
 4079|  28.2M|                            _mm256_castsi256_si128(res));
 4080|  28.2M|    resy = _mm256_extracti128_si256(res, 1);
 4081|  28.2M|    resy = _mm_packus_epi16(resy, resy);
 4082|       |
 4083|  28.2M|    resxy = _mm_blendv_epi8(resx, resy, *(__m128i *)BaseMask[base_min_diff]);
 4084|  28.2M|    _mm_storel_epi64((__m128i *)(dst), resxy);
 4085|  28.2M|    dst += stride;
 4086|  28.2M|  }
 4087|  3.47M|}
intrapred_avx2.c:dr_prediction_z2_HxW_avx2:
 4092|   200k|                                      int upsample_left, int dx, int dy) {
 4093|       |  // here upsample_above and upsample_left are 0 by design of
 4094|       |  // av1_use_intra_edge_upsample
 4095|   200k|  const int min_base_x = -1;
 4096|   200k|  const int min_base_y = -1;
 4097|   200k|  (void)upsample_above;
 4098|   200k|  (void)upsample_left;
 4099|   200k|  const int frac_bits_x = 6;
 4100|   200k|  const int frac_bits_y = 6;
 4101|       |
 4102|   200k|  __m256i a0_x, a1_x, a0_y, a1_y, a32, a16, c1234, c0123;
 4103|   200k|  __m256i diff, min_base_y256, c3f, shifty, dy256, c1;
 4104|   200k|  __m128i a0_x128, a1_x128;
 4105|       |
 4106|   200k|  DECLARE_ALIGNED(32, int16_t, base_y_c[16]);
  ------------------
  |  |   19|   200k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 4107|   200k|  a16 = _mm256_set1_epi16(16);
 4108|   200k|  c1 = _mm256_srli_epi16(a16, 4);
 4109|   200k|  min_base_y256 = _mm256_set1_epi16(min_base_y);
 4110|   200k|  c3f = _mm256_set1_epi16(0x3f);
 4111|   200k|  dy256 = _mm256_set1_epi16(dy);
 4112|   200k|  c0123 =
 4113|   200k|      _mm256_setr_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
 4114|   200k|  c1234 = _mm256_add_epi16(c0123, c1);
 4115|       |
 4116|  3.07M|  for (int r = 0; r < H; r++) {
  ------------------
  |  Branch (4116:19): [True: 2.87M, False: 200k]
  ------------------
 4117|  2.87M|    __m256i b, res, shift, j256, r6, ydx;
 4118|  2.87M|    __m128i resx, resy;
 4119|  2.87M|    __m128i resxy;
 4120|  2.87M|    int y = r + 1;
 4121|  2.87M|    ydx = _mm256_set1_epi16((int16_t)(y * dx));
 4122|       |
 4123|  2.87M|    int base_x = (-y * dx) >> frac_bits_x;
 4124|  5.81M|    for (int j = 0; j < W; j += 16) {
  ------------------
  |  Branch (4124:21): [True: 2.94M, False: 2.87M]
  ------------------
 4125|  2.94M|      j256 = _mm256_set1_epi16(j);
 4126|  2.94M|      int base_shift = 0;
 4127|  2.94M|      if ((base_x + j) < (min_base_x - 1)) {
  ------------------
  |  Branch (4127:11): [True: 1.95M, False: 982k]
  ------------------
 4128|  1.95M|        base_shift = (min_base_x - (base_x + j) - 1);
 4129|  1.95M|      }
 4130|  2.94M|      int base_min_diff = (min_base_x - base_x - j);
 4131|  2.94M|      if (base_min_diff > 16) {
  ------------------
  |  Branch (4131:11): [True: 1.68M, False: 1.25M]
  ------------------
 4132|  1.68M|        base_min_diff = 16;
 4133|  1.68M|      } else {
 4134|  1.25M|        if (base_min_diff < 0) base_min_diff = 0;
  ------------------
  |  Branch (4134:13): [True: 61.0k, False: 1.19M]
  ------------------
 4135|  1.25M|      }
 4136|       |
 4137|  2.94M|      if (base_shift < 16) {
  ------------------
  |  Branch (4137:11): [True: 1.25M, False: 1.68M]
  ------------------
 4138|  1.25M|        a0_x128 = _mm_loadu_si128((__m128i *)(above + base_x + base_shift + j));
 4139|  1.25M|        a1_x128 =
 4140|  1.25M|            _mm_loadu_si128((__m128i *)(above + base_x + base_shift + 1 + j));
 4141|  1.25M|        a0_x128 = _mm_shuffle_epi8(a0_x128, *(__m128i *)LoadMaskx[base_shift]);
 4142|  1.25M|        a1_x128 = _mm_shuffle_epi8(a1_x128, *(__m128i *)LoadMaskx[base_shift]);
 4143|       |
 4144|  1.25M|        a0_x = _mm256_cvtepu8_epi16(a0_x128);
 4145|  1.25M|        a1_x = _mm256_cvtepu8_epi16(a1_x128);
 4146|       |
 4147|  1.25M|        r6 = _mm256_slli_epi16(_mm256_add_epi16(c0123, j256), 6);
 4148|  1.25M|        shift = _mm256_srli_epi16(
 4149|  1.25M|            _mm256_and_si256(_mm256_sub_epi16(r6, ydx), c3f), 1);
 4150|       |
 4151|  1.25M|        diff = _mm256_sub_epi16(a1_x, a0_x);  // a[x+1] - a[x]
 4152|  1.25M|        a32 = _mm256_slli_epi16(a0_x, 5);     // a[x] * 32
 4153|  1.25M|        a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 4154|       |
 4155|  1.25M|        b = _mm256_mullo_epi16(diff, shift);
 4156|  1.25M|        res = _mm256_add_epi16(a32, b);
 4157|  1.25M|        res = _mm256_srli_epi16(res, 5);  // 16 16-bit values
 4158|  1.25M|        resx = _mm256_castsi256_si128(_mm256_packus_epi16(
 4159|  1.25M|            res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1))));
 4160|  1.68M|      } else {
 4161|  1.68M|        resx = _mm_setzero_si128();
 4162|  1.68M|      }
 4163|       |
 4164|       |      // y calc
 4165|  2.94M|      if (base_x < min_base_x) {
  ------------------
  |  Branch (4165:11): [True: 2.21M, False: 721k]
  ------------------
 4166|  2.21M|        __m256i c256, y_c256, base_y_c256, mask256, mul16;
 4167|  2.21M|        r6 = _mm256_set1_epi16(r << 6);
 4168|  2.21M|        c256 = _mm256_add_epi16(j256, c1234);
 4169|  2.21M|        mul16 = _mm256_min_epu16(_mm256_mullo_epi16(c256, dy256),
 4170|  2.21M|                                 _mm256_srli_epi16(min_base_y256, 1));
 4171|  2.21M|        y_c256 = _mm256_sub_epi16(r6, mul16);
 4172|       |
 4173|  2.21M|        base_y_c256 = _mm256_srai_epi16(y_c256, frac_bits_y);
 4174|  2.21M|        mask256 = _mm256_cmpgt_epi16(min_base_y256, base_y_c256);
 4175|       |
 4176|  2.21M|        base_y_c256 = _mm256_blendv_epi8(base_y_c256, min_base_y256, mask256);
 4177|  2.21M|        int16_t min_y = (int16_t)_mm_extract_epi16(
 4178|  2.21M|            _mm256_extracti128_si256(base_y_c256, 1), 7);
 4179|  2.21M|        int16_t max_y =
 4180|  2.21M|            (int16_t)_mm_extract_epi16(_mm256_castsi256_si128(base_y_c256), 0);
 4181|  2.21M|        int16_t offset_diff = max_y - min_y;
 4182|       |
 4183|  2.21M|        if (offset_diff < 16) {
  ------------------
  |  Branch (4183:13): [True: 2.21M, False: 836]
  ------------------
 4184|  2.21M|          __m256i min_y256 = _mm256_set1_epi16(min_y);
 4185|       |
 4186|  2.21M|          __m256i base_y_offset = _mm256_sub_epi16(base_y_c256, min_y256);
 4187|  2.21M|          __m128i base_y_offset128 =
 4188|  2.21M|              _mm_packs_epi16(_mm256_extracti128_si256(base_y_offset, 0),
 4189|  2.21M|                              _mm256_extracti128_si256(base_y_offset, 1));
 4190|       |
 4191|  2.21M|          __m128i a0_y128 = _mm_maskload_epi32(
 4192|  2.21M|              (int *)(left + min_y), *(__m128i *)LoadMaskz2[offset_diff / 4]);
 4193|  2.21M|          __m128i a1_y128 =
 4194|  2.21M|              _mm_maskload_epi32((int *)(left + min_y + 1),
 4195|  2.21M|                                 *(__m128i *)LoadMaskz2[offset_diff / 4]);
 4196|  2.21M|          a0_y128 = _mm_shuffle_epi8(a0_y128, base_y_offset128);
 4197|  2.21M|          a1_y128 = _mm_shuffle_epi8(a1_y128, base_y_offset128);
 4198|  2.21M|          a0_y = _mm256_cvtepu8_epi16(a0_y128);
 4199|  2.21M|          a1_y = _mm256_cvtepu8_epi16(a1_y128);
 4200|  2.21M|        } else {
 4201|    836|          base_y_c256 = _mm256_andnot_si256(mask256, base_y_c256);
 4202|    836|          _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 4203|       |
 4204|    836|          a0_y = _mm256_setr_epi16(
 4205|    836|              left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 4206|    836|              left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 4207|    836|              left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]],
 4208|    836|              left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]],
 4209|    836|              left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]],
 4210|    836|              left[base_y_c[15]]);
 4211|    836|          base_y_c256 = _mm256_add_epi16(base_y_c256, c1);
 4212|    836|          _mm256_store_si256((__m256i *)base_y_c, base_y_c256);
 4213|       |
 4214|    836|          a1_y = _mm256_setr_epi16(
 4215|    836|              left[base_y_c[0]], left[base_y_c[1]], left[base_y_c[2]],
 4216|    836|              left[base_y_c[3]], left[base_y_c[4]], left[base_y_c[5]],
 4217|    836|              left[base_y_c[6]], left[base_y_c[7]], left[base_y_c[8]],
 4218|    836|              left[base_y_c[9]], left[base_y_c[10]], left[base_y_c[11]],
 4219|    836|              left[base_y_c[12]], left[base_y_c[13]], left[base_y_c[14]],
 4220|    836|              left[base_y_c[15]]);
 4221|    836|        }
 4222|  2.21M|        shifty = _mm256_srli_epi16(_mm256_and_si256(y_c256, c3f), 1);
 4223|       |
 4224|  2.21M|        diff = _mm256_sub_epi16(a1_y, a0_y);  // a[x+1] - a[x]
 4225|  2.21M|        a32 = _mm256_slli_epi16(a0_y, 5);     // a[x] * 32
 4226|  2.21M|        a32 = _mm256_add_epi16(a32, a16);     // a[x] * 32 + 16
 4227|       |
 4228|  2.21M|        b = _mm256_mullo_epi16(diff, shifty);
 4229|  2.21M|        res = _mm256_add_epi16(a32, b);
 4230|  2.21M|        res = _mm256_srli_epi16(res, 5);  // 16 16-bit values
 4231|  2.21M|        resy = _mm256_castsi256_si128(_mm256_packus_epi16(
 4232|  2.21M|            res, _mm256_castsi128_si256(_mm256_extracti128_si256(res, 1))));
 4233|  2.21M|      } else {
 4234|   721k|        resy = _mm_setzero_si128();
 4235|   721k|      }
 4236|  2.94M|      resxy = _mm_blendv_epi8(resx, resy, *(__m128i *)BaseMask[base_min_diff]);
 4237|  2.94M|      _mm_storeu_si128((__m128i *)(dst + j), resxy);
 4238|  2.94M|    }  // for j
 4239|  2.87M|    dst += stride;
 4240|  2.87M|  }
 4241|   200k|}
intrapred_avx2.c:dr_prediction_z3_4x4_avx2:
 4360|   565k|                                      int dy) {
 4361|   565k|  __m128i dstvec[4], d[4];
 4362|       |
 4363|   565k|  dr_prediction_z1_HxW_internal_avx2(4, 4, dstvec, left, upsample_left, dy);
 4364|   565k|  transpose4x8_8x4_low_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3],
 4365|   565k|                            &d[0], &d[1], &d[2], &d[3]);
 4366|       |
 4367|   565k|  *(int *)(dst + stride * 0) = _mm_cvtsi128_si32(d[0]);
 4368|   565k|  *(int *)(dst + stride * 1) = _mm_cvtsi128_si32(d[1]);
 4369|   565k|  *(int *)(dst + stride * 2) = _mm_cvtsi128_si32(d[2]);
 4370|   565k|  *(int *)(dst + stride * 3) = _mm_cvtsi128_si32(d[3]);
 4371|   565k|  return;
 4372|   565k|}
intrapred_avx2.c:dr_prediction_z3_8x8_avx2:
 4376|  1.98M|                                      int dy) {
 4377|  1.98M|  __m128i dstvec[8], d[8];
 4378|       |
 4379|  1.98M|  dr_prediction_z1_HxW_internal_avx2(8, 8, dstvec, left, upsample_left, dy);
 4380|  1.98M|  transpose8x8_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3], &dstvec[4],
 4381|  1.98M|                    &dstvec[5], &dstvec[6], &dstvec[7], &d[0], &d[1], &d[2],
 4382|  1.98M|                    &d[3]);
 4383|       |
 4384|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 0 * stride), d[0]);
 4385|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 1 * stride), _mm_srli_si128(d[0], 8));
 4386|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 2 * stride), d[1]);
 4387|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 3 * stride), _mm_srli_si128(d[1], 8));
 4388|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 4 * stride), d[2]);
 4389|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 5 * stride), _mm_srli_si128(d[2], 8));
 4390|  1.98M|  _mm_storel_epi64((__m128i *)(dst + 6 * stride), d[3]);
 4391|       |  _mm_storel_epi64((__m128i *)(dst + 7 * stride), _mm_srli_si128(d[3], 8));
 4392|  1.98M|}
intrapred_avx2.c:dr_prediction_z3_16x16_avx2:
 4538|  63.9k|                                        int dy) {
 4539|  63.9k|  __m128i dstvec[16], d[16];
 4540|       |
 4541|  63.9k|  dr_prediction_z1_HxW_internal_avx2(16, 16, dstvec, left, upsample_left, dy);
 4542|  63.9k|  transpose16x16_sse2(dstvec, d);
 4543|       |
 4544|  1.08M|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (4544:19): [True: 1.02M, False: 63.9k]
  ------------------
 4545|  1.02M|    _mm_storeu_si128((__m128i *)(dst + i * stride), d[i]);
 4546|  1.02M|  }
 4547|  63.9k|}
intrapred_avx2.c:transpose16x32_avx2:
 4268|    682|static inline void transpose16x32_avx2(__m256i *x, __m256i *d) {
 4269|    682|  __m256i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
 4270|    682|  __m256i w10, w11, w12, w13, w14, w15;
 4271|       |
 4272|    682|  w0 = _mm256_unpacklo_epi8(x[0], x[1]);
 4273|    682|  w1 = _mm256_unpacklo_epi8(x[2], x[3]);
 4274|    682|  w2 = _mm256_unpacklo_epi8(x[4], x[5]);
 4275|    682|  w3 = _mm256_unpacklo_epi8(x[6], x[7]);
 4276|       |
 4277|    682|  w8 = _mm256_unpacklo_epi8(x[8], x[9]);
 4278|    682|  w9 = _mm256_unpacklo_epi8(x[10], x[11]);
 4279|    682|  w10 = _mm256_unpacklo_epi8(x[12], x[13]);
 4280|    682|  w11 = _mm256_unpacklo_epi8(x[14], x[15]);
 4281|       |
 4282|    682|  w4 = _mm256_unpacklo_epi16(w0, w1);
 4283|    682|  w5 = _mm256_unpacklo_epi16(w2, w3);
 4284|    682|  w12 = _mm256_unpacklo_epi16(w8, w9);
 4285|    682|  w13 = _mm256_unpacklo_epi16(w10, w11);
 4286|       |
 4287|    682|  w6 = _mm256_unpacklo_epi32(w4, w5);
 4288|    682|  w7 = _mm256_unpackhi_epi32(w4, w5);
 4289|    682|  w14 = _mm256_unpacklo_epi32(w12, w13);
 4290|    682|  w15 = _mm256_unpackhi_epi32(w12, w13);
 4291|       |
 4292|       |  // Store first 4-line result
 4293|    682|  d[0] = _mm256_unpacklo_epi64(w6, w14);
 4294|    682|  d[1] = _mm256_unpackhi_epi64(w6, w14);
 4295|    682|  d[2] = _mm256_unpacklo_epi64(w7, w15);
 4296|    682|  d[3] = _mm256_unpackhi_epi64(w7, w15);
 4297|       |
 4298|    682|  w4 = _mm256_unpackhi_epi16(w0, w1);
 4299|    682|  w5 = _mm256_unpackhi_epi16(w2, w3);
 4300|    682|  w12 = _mm256_unpackhi_epi16(w8, w9);
 4301|    682|  w13 = _mm256_unpackhi_epi16(w10, w11);
 4302|       |
 4303|    682|  w6 = _mm256_unpacklo_epi32(w4, w5);
 4304|    682|  w7 = _mm256_unpackhi_epi32(w4, w5);
 4305|    682|  w14 = _mm256_unpacklo_epi32(w12, w13);
 4306|    682|  w15 = _mm256_unpackhi_epi32(w12, w13);
 4307|       |
 4308|       |  // Store second 4-line result
 4309|    682|  d[4] = _mm256_unpacklo_epi64(w6, w14);
 4310|    682|  d[5] = _mm256_unpackhi_epi64(w6, w14);
 4311|    682|  d[6] = _mm256_unpacklo_epi64(w7, w15);
 4312|    682|  d[7] = _mm256_unpackhi_epi64(w7, w15);
 4313|       |
 4314|       |  // upper half
 4315|    682|  w0 = _mm256_unpackhi_epi8(x[0], x[1]);
 4316|    682|  w1 = _mm256_unpackhi_epi8(x[2], x[3]);
 4317|    682|  w2 = _mm256_unpackhi_epi8(x[4], x[5]);
 4318|    682|  w3 = _mm256_unpackhi_epi8(x[6], x[7]);
 4319|       |
 4320|    682|  w8 = _mm256_unpackhi_epi8(x[8], x[9]);
 4321|    682|  w9 = _mm256_unpackhi_epi8(x[10], x[11]);
 4322|    682|  w10 = _mm256_unpackhi_epi8(x[12], x[13]);
 4323|    682|  w11 = _mm256_unpackhi_epi8(x[14], x[15]);
 4324|       |
 4325|    682|  w4 = _mm256_unpacklo_epi16(w0, w1);
 4326|    682|  w5 = _mm256_unpacklo_epi16(w2, w3);
 4327|    682|  w12 = _mm256_unpacklo_epi16(w8, w9);
 4328|    682|  w13 = _mm256_unpacklo_epi16(w10, w11);
 4329|       |
 4330|    682|  w6 = _mm256_unpacklo_epi32(w4, w5);
 4331|    682|  w7 = _mm256_unpackhi_epi32(w4, w5);
 4332|    682|  w14 = _mm256_unpacklo_epi32(w12, w13);
 4333|    682|  w15 = _mm256_unpackhi_epi32(w12, w13);
 4334|       |
 4335|       |  // Store first 4-line result
 4336|    682|  d[8] = _mm256_unpacklo_epi64(w6, w14);
 4337|    682|  d[9] = _mm256_unpackhi_epi64(w6, w14);
 4338|    682|  d[10] = _mm256_unpacklo_epi64(w7, w15);
 4339|    682|  d[11] = _mm256_unpackhi_epi64(w7, w15);
 4340|       |
 4341|    682|  w4 = _mm256_unpackhi_epi16(w0, w1);
 4342|    682|  w5 = _mm256_unpackhi_epi16(w2, w3);
 4343|    682|  w12 = _mm256_unpackhi_epi16(w8, w9);
 4344|    682|  w13 = _mm256_unpackhi_epi16(w10, w11);
 4345|       |
 4346|    682|  w6 = _mm256_unpacklo_epi32(w4, w5);
 4347|    682|  w7 = _mm256_unpackhi_epi32(w4, w5);
 4348|    682|  w14 = _mm256_unpacklo_epi32(w12, w13);
 4349|    682|  w15 = _mm256_unpackhi_epi32(w12, w13);
 4350|       |
 4351|       |  // Store second 4-line result
 4352|    682|  d[12] = _mm256_unpacklo_epi64(w6, w14);
 4353|    682|  d[13] = _mm256_unpackhi_epi64(w6, w14);
 4354|    682|  d[14] = _mm256_unpacklo_epi64(w7, w15);
 4355|    682|  d[15] = _mm256_unpackhi_epi64(w7, w15);
 4356|    682|}
intrapred_avx2.c:dr_prediction_z3_4x8_avx2:
 4396|   126k|                                      int dy) {
 4397|   126k|  __m128i dstvec[4], d[8];
 4398|       |
 4399|   126k|  dr_prediction_z1_HxW_internal_avx2(8, 4, dstvec, left, upsample_left, dy);
 4400|   126k|  transpose4x8_8x4_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3], &d[0],
 4401|   126k|                        &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]);
 4402|  1.14M|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (4402:19): [True: 1.01M, False: 126k]
  ------------------
 4403|  1.01M|    *(int *)(dst + stride * i) = _mm_cvtsi128_si32(d[i]);
 4404|  1.01M|  }
 4405|   126k|}
intrapred_avx2.c:dr_prediction_z3_8x16_avx2:
 4424|  24.5k|                                       int dy) {
 4425|  24.5k|  __m128i dstvec[8], d[8];
 4426|       |
 4427|  24.5k|  dr_prediction_z1_HxW_internal_avx2(16, 8, dstvec, left, upsample_left, dy);
 4428|  24.5k|  transpose8x16_16x8_sse2(dstvec, dstvec + 1, dstvec + 2, dstvec + 3,
 4429|  24.5k|                          dstvec + 4, dstvec + 5, dstvec + 6, dstvec + 7, d,
 4430|  24.5k|                          d + 1, d + 2, d + 3, d + 4, d + 5, d + 6, d + 7);
 4431|   221k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (4431:19): [True: 196k, False: 24.5k]
  ------------------
 4432|   196k|    _mm_storel_epi64((__m128i *)(dst + i * stride), d[i]);
 4433|   196k|    _mm_storel_epi64((__m128i *)(dst + (i + 8) * stride),
 4434|       |                     _mm_srli_si128(d[i], 8));
 4435|   196k|  }
 4436|  24.5k|}
intrapred_avx2.c:dr_prediction_z3_16x32_avx2:
 4581|    682|                                        int dy) {
 4582|    682|  __m256i dstvec[16], d[16];
 4583|       |
 4584|    682|  dr_prediction_z1_32xN_internal_avx2(16, dstvec, left, upsample_left, dy);
 4585|    682|  transpose16x32_avx2(dstvec, d);
 4586|       |  // store
 4587|  11.5k|  for (int j = 0; j < 16; j++) {
  ------------------
  |  Branch (4587:19): [True: 10.9k, False: 682]
  ------------------
 4588|  10.9k|    _mm_storeu_si128((__m128i *)(dst + j * stride),
 4589|  10.9k|                     _mm256_castsi256_si128(d[j]));
 4590|  10.9k|    _mm_storeu_si128((__m128i *)(dst + (j + 16) * stride),
 4591|       |                     _mm256_extracti128_si256(d[j], 1));
 4592|  10.9k|  }
 4593|    682|}
intrapred_avx2.c:dr_prediction_z3_8x4_avx2:
 4409|  5.78k|                                      int dy) {
 4410|  5.78k|  __m128i dstvec[8], d[4];
 4411|       |
 4412|  5.78k|  dr_prediction_z1_HxW_internal_avx2(4, 8, dstvec, left, upsample_left, dy);
 4413|  5.78k|  transpose8x8_low_sse2(&dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3],
 4414|  5.78k|                        &dstvec[4], &dstvec[5], &dstvec[6], &dstvec[7], &d[0],
 4415|  5.78k|                        &d[1], &d[2], &d[3]);
 4416|  5.78k|  _mm_storel_epi64((__m128i *)(dst + 0 * stride), d[0]);
 4417|  5.78k|  _mm_storel_epi64((__m128i *)(dst + 1 * stride), d[1]);
 4418|  5.78k|  _mm_storel_epi64((__m128i *)(dst + 2 * stride), d[2]);
 4419|  5.78k|  _mm_storel_epi64((__m128i *)(dst + 3 * stride), d[3]);
 4420|  5.78k|}
intrapred_avx2.c:dr_prediction_z3_16x8_avx2:
 4440|  19.7k|                                       int dy) {
 4441|  19.7k|  __m128i dstvec[16], d[16];
 4442|       |
 4443|  19.7k|  dr_prediction_z1_HxW_internal_avx2(8, 16, dstvec, left, upsample_left, dy);
 4444|  19.7k|  transpose16x8_8x16_sse2(
 4445|  19.7k|      &dstvec[0], &dstvec[1], &dstvec[2], &dstvec[3], &dstvec[4], &dstvec[5],
 4446|  19.7k|      &dstvec[6], &dstvec[7], &dstvec[8], &dstvec[9], &dstvec[10], &dstvec[11],
 4447|  19.7k|      &dstvec[12], &dstvec[13], &dstvec[14], &dstvec[15], &d[0], &d[1], &d[2],
 4448|  19.7k|      &d[3], &d[4], &d[5], &d[6], &d[7]);
 4449|       |
 4450|   177k|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (4450:19): [True: 157k, False: 19.7k]
  ------------------
 4451|   157k|    _mm_storeu_si128((__m128i *)(dst + i * stride), d[i]);
 4452|   157k|  }
 4453|  19.7k|}
intrapred_avx2.c:dr_prediction_z3_32x16_avx2:
 4597|    169|                                        int dy) {
 4598|    169|  __m128i dstvec[32], d[16];
 4599|       |
 4600|    169|  dr_prediction_z1_HxW_internal_avx2(16, 32, dstvec, left, upsample_left, dy);
 4601|    507|  for (int i = 0; i < 32; i += 16) {
  ------------------
  |  Branch (4601:19): [True: 338, False: 169]
  ------------------
 4602|    338|    transpose16x16_sse2((dstvec + i), d);
 4603|  5.74k|    for (int j = 0; j < 16; j++) {
  ------------------
  |  Branch (4603:21): [True: 5.40k, False: 338]
  ------------------
 4604|  5.40k|      _mm_storeu_si128((__m128i *)(dst + j * stride + i), d[j]);
 4605|  5.40k|    }
 4606|    338|  }
 4607|    169|}

aom_dc_predictor_4x8_sse2:
  110|  1.08M|                               const uint8_t *above, const uint8_t *left) {
  111|  1.08M|  const __m128i sum_left = dc_sum_8(left);
  112|  1.08M|  __m128i sum_above = dc_sum_4(above);
  113|  1.08M|  sum_above = _mm_add_epi16(sum_left, sum_above);
  114|       |
  115|  1.08M|  uint32_t sum = (uint32_t)_mm_cvtsi128_si32(sum_above);
  116|  1.08M|  sum += 6;
  117|  1.08M|  sum = divide_using_multiply_shift(sum, 2, DC_MULTIPLIER_1X2);
  ------------------
  |  |   95|  1.08M|#define DC_MULTIPLIER_1X2 0x5556
  ------------------
  118|       |
  119|  1.08M|  const __m128i row = _mm_set1_epi8((int8_t)sum);
  120|  1.08M|  const uint32_t pred = (uint32_t)_mm_cvtsi128_si32(row);
  121|  1.08M|  dc_store_4xh(pred, 8, dst, stride);
  122|  1.08M|}
aom_dc_predictor_8x4_sse2:
  142|  18.4k|                               const uint8_t *above, const uint8_t *left) {
  143|  18.4k|  const __m128i sum_left = dc_sum_4(left);
  144|  18.4k|  __m128i sum_above = dc_sum_8(above);
  145|  18.4k|  sum_above = _mm_add_epi16(sum_above, sum_left);
  146|       |
  147|  18.4k|  uint32_t sum = (uint32_t)_mm_cvtsi128_si32(sum_above);
  148|  18.4k|  sum += 6;
  149|  18.4k|  sum = divide_using_multiply_shift(sum, 2, DC_MULTIPLIER_1X2);
  ------------------
  |  |   95|  18.4k|#define DC_MULTIPLIER_1X2 0x5556
  ------------------
  150|       |
  151|  18.4k|  const __m128i row = _mm_set1_epi8((int8_t)sum);
  152|  18.4k|  dc_store_8xh(&row, 4, dst, stride);
  153|  18.4k|}
aom_dc_predictor_8x16_sse2:
  156|   110k|                                const uint8_t *above, const uint8_t *left) {
  157|   110k|  const __m128i sum_left = dc_sum_16_sse2(left);
  158|   110k|  __m128i sum_above = dc_sum_8(above);
  159|   110k|  sum_above = _mm_add_epi16(sum_above, sum_left);
  160|       |
  161|   110k|  uint32_t sum = (uint32_t)_mm_cvtsi128_si32(sum_above);
  162|   110k|  sum += 12;
  163|   110k|  sum = divide_using_multiply_shift(sum, 3, DC_MULTIPLIER_1X2);
  ------------------
  |  |   95|   110k|#define DC_MULTIPLIER_1X2 0x5556
  ------------------
  164|   110k|  const __m128i row = _mm_set1_epi8((int8_t)sum);
  165|   110k|  dc_store_8xh(&row, 16, dst, stride);
  166|   110k|}
aom_dc_predictor_16x8_sse2:
  197|  34.3k|                                const uint8_t *above, const uint8_t *left) {
  198|  34.3k|  const __m128i sum_left = dc_sum_8(left);
  199|  34.3k|  __m128i sum_above = dc_sum_16_sse2(above);
  200|  34.3k|  sum_above = _mm_add_epi16(sum_above, sum_left);
  201|       |
  202|  34.3k|  uint32_t sum = (uint32_t)_mm_cvtsi128_si32(sum_above);
  203|  34.3k|  sum += 12;
  204|  34.3k|  sum = divide_using_multiply_shift(sum, 3, DC_MULTIPLIER_1X2);
  ------------------
  |  |   95|  34.3k|#define DC_MULTIPLIER_1X2 0x5556
  ------------------
  205|  34.3k|  const __m128i row = _mm_set1_epi8((int8_t)sum);
  206|  34.3k|  dc_store_16xh(&row, 8, dst, stride);
  207|  34.3k|}
aom_dc_predictor_16x32_sse2:
  210|  2.93k|                                 const uint8_t *above, const uint8_t *left) {
  211|  2.93k|  const __m128i sum_left = dc_sum_32_sse2(left);
  212|  2.93k|  __m128i sum_above = dc_sum_16_sse2(above);
  213|  2.93k|  sum_above = _mm_add_epi16(sum_left, sum_above);
  214|       |
  215|  2.93k|  uint32_t sum = (uint32_t)_mm_cvtsi128_si32(sum_above);
  216|  2.93k|  sum += 24;
  217|  2.93k|  sum = divide_using_multiply_shift(sum, 4, DC_MULTIPLIER_1X2);
  ------------------
  |  |   95|  2.93k|#define DC_MULTIPLIER_1X2 0x5556
  ------------------
  218|  2.93k|  const __m128i row = _mm_set1_epi8((int8_t)sum);
  219|  2.93k|  dc_store_16xh(&row, 32, dst, stride);
  220|  2.93k|}
aom_dc_top_predictor_4x8_sse2:
  321|   238k|                                   const uint8_t *above, const uint8_t *left) {
  322|   238k|  (void)left;
  323|   238k|  __m128i sum_above = dc_sum_4(above);
  324|   238k|  const __m128i two = _mm_set1_epi16(2);
  325|   238k|  sum_above = _mm_add_epi16(sum_above, two);
  326|   238k|  sum_above = _mm_srai_epi16(sum_above, 2);
  327|   238k|  sum_above = _mm_shufflelo_epi16(sum_above, 0);
  328|   238k|  sum_above = _mm_packus_epi16(sum_above, sum_above);
  329|       |
  330|   238k|  const uint32_t pred = (uint32_t)_mm_cvtsi128_si32(sum_above);
  331|   238k|  dc_store_4xh(pred, 8, dst, stride);
  332|   238k|}
aom_dc_top_predictor_8x4_sse2:
  351|  9.81k|                                   const uint8_t *above, const uint8_t *left) {
  352|  9.81k|  (void)left;
  353|  9.81k|  __m128i sum_above = dc_sum_8(above);
  354|  9.81k|  const __m128i four = _mm_set1_epi16(4);
  355|  9.81k|  sum_above = _mm_add_epi16(sum_above, four);
  356|  9.81k|  sum_above = _mm_srai_epi16(sum_above, 3);
  357|  9.81k|  sum_above = _mm_unpacklo_epi8(sum_above, sum_above);
  358|       |  const __m128i row = _mm_shufflelo_epi16(sum_above, 0);
  359|  9.81k|  dc_store_8xh(&row, 4, dst, stride);
  360|  9.81k|}
aom_dc_top_predictor_8x16_sse2:
  363|  63.0k|                                    const uint8_t *above, const uint8_t *left) {
  364|  63.0k|  (void)left;
  365|  63.0k|  __m128i sum_above = dc_sum_8(above);
  366|  63.0k|  const __m128i four = _mm_set1_epi16(4);
  367|  63.0k|  sum_above = _mm_add_epi16(sum_above, four);
  368|  63.0k|  sum_above = _mm_srai_epi16(sum_above, 3);
  369|  63.0k|  sum_above = _mm_unpacklo_epi8(sum_above, sum_above);
  370|       |  const __m128i row = _mm_shufflelo_epi16(sum_above, 0);
  371|  63.0k|  dc_store_8xh(&row, 16, dst, stride);
  372|  63.0k|}
aom_dc_top_predictor_16x8_sse2:
  402|  19.2k|                                    const uint8_t *above, const uint8_t *left) {
  403|  19.2k|  (void)left;
  404|  19.2k|  __m128i sum_above = dc_sum_16_sse2(above);
  405|  19.2k|  const __m128i eight = _mm_set1_epi16(8);
  406|  19.2k|  sum_above = _mm_add_epi16(sum_above, eight);
  407|  19.2k|  sum_above = _mm_srai_epi16(sum_above, 4);
  408|  19.2k|  sum_above = _mm_unpacklo_epi8(sum_above, sum_above);
  409|       |  sum_above = _mm_shufflelo_epi16(sum_above, 0);
  410|  19.2k|  const __m128i row = _mm_unpacklo_epi64(sum_above, sum_above);
  411|  19.2k|  dc_store_16xh(&row, 8, dst, stride);
  412|  19.2k|}
aom_dc_top_predictor_16x32_sse2:
  416|  4.23k|                                     const uint8_t *left) {
  417|  4.23k|  (void)left;
  418|  4.23k|  __m128i sum_above = dc_sum_16_sse2(above);
  419|  4.23k|  const __m128i eight = _mm_set1_epi16(8);
  420|  4.23k|  sum_above = _mm_add_epi16(sum_above, eight);
  421|  4.23k|  sum_above = _mm_srai_epi16(sum_above, 4);
  422|  4.23k|  sum_above = _mm_unpacklo_epi8(sum_above, sum_above);
  423|       |  sum_above = _mm_shufflelo_epi16(sum_above, 0);
  424|  4.23k|  const __m128i row = _mm_unpacklo_epi64(sum_above, sum_above);
  425|  4.23k|  dc_store_16xh(&row, 32, dst, stride);
  426|  4.23k|}
aom_dc_left_predictor_4x8_sse2:
  533|   233k|                                    const uint8_t *above, const uint8_t *left) {
  534|   233k|  (void)above;
  535|   233k|  __m128i sum_left = dc_sum_8(left);
  536|   233k|  const __m128i four = _mm_set1_epi16(4);
  537|   233k|  sum_left = _mm_add_epi16(sum_left, four);
  538|   233k|  sum_left = _mm_srai_epi16(sum_left, 3);
  539|   233k|  sum_left = _mm_shufflelo_epi16(sum_left, 0);
  540|   233k|  sum_left = _mm_packus_epi16(sum_left, sum_left);
  541|       |
  542|   233k|  const uint32_t pred = (uint32_t)_mm_cvtsi128_si32(sum_left);
  543|   233k|  dc_store_4xh(pred, 8, dst, stride);
  544|   233k|}
aom_dc_left_predictor_8x4_sse2:
  564|  12.1k|                                    const uint8_t *above, const uint8_t *left) {
  565|  12.1k|  (void)above;
  566|  12.1k|  __m128i sum_left = dc_sum_4(left);
  567|  12.1k|  const __m128i two = _mm_set1_epi16(2);
  568|  12.1k|  sum_left = _mm_add_epi16(sum_left, two);
  569|  12.1k|  sum_left = _mm_srai_epi16(sum_left, 2);
  570|  12.1k|  sum_left = _mm_unpacklo_epi8(sum_left, sum_left);
  571|       |  const __m128i row = _mm_shufflelo_epi16(sum_left, 0);
  572|  12.1k|  dc_store_8xh(&row, 4, dst, stride);
  573|  12.1k|}
aom_dc_left_predictor_8x16_sse2:
  577|  53.0k|                                     const uint8_t *left) {
  578|  53.0k|  (void)above;
  579|  53.0k|  __m128i sum_left = dc_sum_16_sse2(left);
  580|  53.0k|  const __m128i eight = _mm_set1_epi16(8);
  581|  53.0k|  sum_left = _mm_add_epi16(sum_left, eight);
  582|  53.0k|  sum_left = _mm_srai_epi16(sum_left, 4);
  583|  53.0k|  sum_left = _mm_unpacklo_epi8(sum_left, sum_left);
  584|       |  const __m128i row = _mm_shufflelo_epi16(sum_left, 0);
  585|  53.0k|  dc_store_8xh(&row, 16, dst, stride);
  586|  53.0k|}
aom_dc_left_predictor_16x8_sse2:
  619|  23.4k|                                     const uint8_t *left) {
  620|  23.4k|  (void)above;
  621|  23.4k|  __m128i sum_left = dc_sum_8(left);
  622|  23.4k|  const __m128i four = _mm_set1_epi16(4);
  623|  23.4k|  sum_left = _mm_add_epi16(sum_left, four);
  624|  23.4k|  sum_left = _mm_srai_epi16(sum_left, 3);
  625|  23.4k|  sum_left = _mm_unpacklo_epi8(sum_left, sum_left);
  626|       |  sum_left = _mm_shufflelo_epi16(sum_left, 0);
  627|  23.4k|  const __m128i row = _mm_unpacklo_epi64(sum_left, sum_left);
  628|  23.4k|  dc_store_16xh(&row, 8, dst, stride);
  629|  23.4k|}
aom_dc_left_predictor_16x32_sse2:
  633|  3.61k|                                      const uint8_t *left) {
  634|  3.61k|  (void)above;
  635|  3.61k|  __m128i sum_left = dc_sum_32_sse2(left);
  636|  3.61k|  const __m128i sixteen = _mm_set1_epi16(16);
  637|  3.61k|  sum_left = _mm_add_epi16(sum_left, sixteen);
  638|  3.61k|  sum_left = _mm_srai_epi16(sum_left, 5);
  639|  3.61k|  sum_left = _mm_unpacklo_epi8(sum_left, sum_left);
  640|       |  sum_left = _mm_shufflelo_epi16(sum_left, 0);
  641|  3.61k|  const __m128i row = _mm_unpacklo_epi64(sum_left, sum_left);
  642|  3.61k|  dc_store_16xh(&row, 32, dst, stride);
  643|  3.61k|}
aom_dc_128_predictor_4x8_sse2:
  751|  63.4k|                                   const uint8_t *above, const uint8_t *left) {
  752|  63.4k|  (void)above;
  753|  63.4k|  (void)left;
  754|  63.4k|  const uint32_t pred = 0x80808080;
  755|  63.4k|  dc_store_4xh(pred, 8, dst, stride);
  756|  63.4k|}
aom_dc_128_predictor_8x4_sse2:
  769|  7.78k|                                   const uint8_t *above, const uint8_t *left) {
  770|  7.78k|  (void)above;
  771|  7.78k|  (void)left;
  772|  7.78k|  const __m128i row = _mm_set1_epi8((int8_t)128);
  773|  7.78k|  dc_store_8xh(&row, 4, dst, stride);
  774|  7.78k|}
aom_dc_128_predictor_8x16_sse2:
  777|  33.8k|                                    const uint8_t *above, const uint8_t *left) {
  778|  33.8k|  (void)above;
  779|  33.8k|  (void)left;
  780|  33.8k|  const __m128i row = _mm_set1_epi8((int8_t)128);
  781|  33.8k|  dc_store_8xh(&row, 16, dst, stride);
  782|  33.8k|}
aom_dc_128_predictor_16x8_sse2:
  803|  14.4k|                                    const uint8_t *above, const uint8_t *left) {
  804|  14.4k|  (void)above;
  805|  14.4k|  (void)left;
  806|  14.4k|  const __m128i row = _mm_set1_epi8((int8_t)128);
  807|  14.4k|  dc_store_16xh(&row, 8, dst, stride);
  808|  14.4k|}
aom_dc_128_predictor_16x32_sse2:
  812|  6.82k|                                     const uint8_t *left) {
  813|  6.82k|  (void)above;
  814|  6.82k|  (void)left;
  815|  6.82k|  const __m128i row = _mm_set1_epi8((int8_t)128);
  816|  6.82k|  dc_store_16xh(&row, 32, dst, stride);
  817|  6.82k|}
aom_v_predictor_4x8_sse2:
  889|  40.7k|                              const uint8_t *above, const uint8_t *left) {
  890|  40.7k|  const uint32_t pred = *(uint32_t *)above;
  891|  40.7k|  (void)left;
  892|  40.7k|  dc_store_4xh(pred, 8, dst, stride);
  893|  40.7k|}
aom_v_predictor_8x4_sse2:
  905|  2.59k|                              const uint8_t *above, const uint8_t *left) {
  906|  2.59k|  const __m128i row = _mm_loadl_epi64((__m128i const *)above);
  907|  2.59k|  (void)left;
  908|  2.59k|  dc_store_8xh(&row, 4, dst, stride);
  909|  2.59k|}
aom_v_predictor_8x16_sse2:
  912|  7.22k|                               const uint8_t *above, const uint8_t *left) {
  913|  7.22k|  const __m128i row = _mm_loadl_epi64((__m128i const *)above);
  914|  7.22k|  (void)left;
  915|  7.22k|  dc_store_8xh(&row, 16, dst, stride);
  916|  7.22k|}
aom_v_predictor_16x8_sse2:
  935|  9.50k|                               const uint8_t *above, const uint8_t *left) {
  936|  9.50k|  const __m128i row = _mm_load_si128((__m128i const *)above);
  937|  9.50k|  (void)left;
  938|  9.50k|  dc_store_16xh(&row, 8, dst, stride);
  939|  9.50k|}
aom_v_predictor_16x32_sse2:
  942|     48|                                const uint8_t *above, const uint8_t *left) {
  943|     48|  const __m128i row = _mm_load_si128((__m128i const *)above);
  944|     48|  (void)left;
  945|     48|  dc_store_16xh(&row, 32, dst, stride);
  946|     48|}
aom_h_predictor_4x8_sse2:
 1027|  50.8k|                              const uint8_t *above, const uint8_t *left) {
 1028|  50.8k|  (void)above;
 1029|  50.8k|  __m128i left_col = _mm_loadl_epi64((__m128i const *)left);
 1030|  50.8k|  left_col = _mm_unpacklo_epi8(left_col, left_col);
 1031|  50.8k|  __m128i row0 = _mm_shufflelo_epi16(left_col, 0);
 1032|  50.8k|  __m128i row1 = _mm_shufflelo_epi16(left_col, 0x55);
 1033|  50.8k|  __m128i row2 = _mm_shufflelo_epi16(left_col, 0xaa);
 1034|  50.8k|  __m128i row3 = _mm_shufflelo_epi16(left_col, 0xff);
 1035|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row0);
 1036|  50.8k|  dst += stride;
 1037|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row1);
 1038|  50.8k|  dst += stride;
 1039|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row2);
 1040|  50.8k|  dst += stride;
 1041|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row3);
 1042|  50.8k|  dst += stride;
 1043|  50.8k|  left_col = _mm_unpackhi_epi64(left_col, left_col);
 1044|  50.8k|  row0 = _mm_shufflelo_epi16(left_col, 0);
 1045|  50.8k|  row1 = _mm_shufflelo_epi16(left_col, 0x55);
 1046|  50.8k|  row2 = _mm_shufflelo_epi16(left_col, 0xaa);
 1047|       |  row3 = _mm_shufflelo_epi16(left_col, 0xff);
 1048|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row0);
 1049|  50.8k|  dst += stride;
 1050|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row1);
 1051|  50.8k|  dst += stride;
 1052|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row2);
 1053|  50.8k|  dst += stride;
 1054|  50.8k|  *(int *)dst = _mm_cvtsi128_si32(row3);
 1055|  50.8k|}
aom_h_predictor_8x4_sse2:
 1121|  1.58k|                              const uint8_t *above, const uint8_t *left) {
 1122|  1.58k|  (void)above;
 1123|  1.58k|  __m128i left_col = _mm_loadl_epi64((__m128i const *)left);
 1124|  1.58k|  left_col = _mm_unpacklo_epi8(left_col, left_col);
 1125|  1.58k|  __m128i row0 = _mm_shufflelo_epi16(left_col, 0);
 1126|  1.58k|  __m128i row1 = _mm_shufflelo_epi16(left_col, 0x55);
 1127|  1.58k|  __m128i row2 = _mm_shufflelo_epi16(left_col, 0xaa);
 1128|       |  __m128i row3 = _mm_shufflelo_epi16(left_col, 0xff);
 1129|  1.58k|  _mm_storel_epi64((__m128i *)dst, row0);
 1130|  1.58k|  dst += stride;
 1131|  1.58k|  _mm_storel_epi64((__m128i *)dst, row1);
 1132|  1.58k|  dst += stride;
 1133|  1.58k|  _mm_storel_epi64((__m128i *)dst, row2);
 1134|  1.58k|  dst += stride;
 1135|  1.58k|  _mm_storel_epi64((__m128i *)dst, row3);
 1136|  1.58k|}
aom_h_predictor_8x16_sse2:
 1205|  21.5k|                               const uint8_t *above, const uint8_t *left) {
 1206|  21.5k|  h_predictor_8x16xc(dst, stride, above, left, 1);
 1207|  21.5k|}
aom_h_predictor_16x8_sse2:
 1278|  12.5k|                               const uint8_t *above, const uint8_t *left) {
 1279|  12.5k|  (void)above;
 1280|  12.5k|  const __m128i left_col = _mm_loadl_epi64((const __m128i *)left);
 1281|  12.5k|  const __m128i left_col_8p = _mm_unpacklo_epi8(left_col, left_col);
 1282|  12.5k|  h_prediction_16x8_1(&left_col_8p, dst, stride);
 1283|  12.5k|  dst += stride << 2;
 1284|  12.5k|  h_prediction_16x8_2(&left_col_8p, dst, stride);
 1285|  12.5k|}
aom_h_predictor_16x32_sse2:
 1310|    534|                                const uint8_t *above, const uint8_t *left) {
 1311|    534|  (void)above;
 1312|    534|  h_predictor_16xh(dst, stride, left, 2);
 1313|    534|}
aom_h_predictor_32x16_sse2:
 1367|    137|                                const uint8_t *above, const uint8_t *left) {
 1368|    137|  __m128i left_col, left_col_8p;
 1369|    137|  (void)above;
 1370|       |
 1371|    137|  left_col = _mm_load_si128((const __m128i *)left);
 1372|       |
 1373|    137|  left_col_8p = _mm_unpacklo_epi8(left_col, left_col);
 1374|    137|  h_prediction_32x8_1(&left_col_8p, dst, stride);
 1375|    137|  dst += stride << 2;
 1376|    137|  h_prediction_32x8_2(&left_col_8p, dst, stride);
 1377|    137|  dst += stride << 2;
 1378|       |
 1379|    137|  left_col_8p = _mm_unpackhi_epi8(left_col, left_col);
 1380|    137|  h_prediction_32x8_1(&left_col_8p, dst, stride);
 1381|    137|  dst += stride << 2;
 1382|    137|  h_prediction_32x8_2(&left_col_8p, dst, stride);
 1383|    137|}
intrapred_sse2.c:dc_sum_8:
   72|  1.57M|static inline __m128i dc_sum_8(const uint8_t *ref) {
   73|  1.57M|  __m128i x = _mm_loadl_epi64((__m128i const *)ref);
   74|  1.57M|  const __m128i zero = _mm_setzero_si128();
   75|  1.57M|  return _mm_sad_epu8(x, zero);
   76|  1.57M|}
intrapred_sse2.c:dc_sum_4:
   65|  1.35M|static inline __m128i dc_sum_4(const uint8_t *ref) {
   66|  1.35M|  __m128i x = _mm_loadl_epi64((__m128i const *)ref);
   67|  1.35M|  const __m128i zero = _mm_setzero_si128();
   68|  1.35M|  x = _mm_unpacklo_epi8(x, zero);
   69|  1.35M|  return _mm_sad_epu8(x, zero);
   70|  1.35M|}
intrapred_sse2.c:divide_using_multiply_shift:
  101|  1.24M|                                              int multiplier) {
  102|  1.24M|  const int interm = num >> shift1;
  103|  1.24M|  return interm * multiplier >> DC_SHIFT2;
  ------------------
  |  |   98|  1.24M|#define DC_SHIFT2 16
  ------------------
  104|  1.24M|}
intrapred_sse2.c:dc_store_4xh:
   17|  1.65M|                                ptrdiff_t stride) {
   18|  8.28M|  for (int i = 0; i < height; i += 2) {
  ------------------
  |  Branch (18:19): [True: 6.63M, False: 1.65M]
  ------------------
   19|  6.63M|    *(uint32_t *)dst = dc;
   20|  6.63M|    dst += stride;
   21|  6.63M|    *(uint32_t *)dst = dc;
   22|  6.63M|    dst += stride;
   23|  6.63M|  }
   24|  1.65M|}
intrapred_sse2.c:dc_store_8xh:
   27|   317k|                                ptrdiff_t stride) {
   28|   317k|  int i;
   29|  4.79M|  for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (29:15): [True: 4.47M, False: 317k]
  ------------------
   30|  4.47M|    _mm_storel_epi64((__m128i *)dst, *row);
   31|  4.47M|    dst += stride;
   32|  4.47M|  }
   33|   317k|}
intrapred_sse2.c:dc_store_16xh:
   36|   118k|                                 ptrdiff_t stride) {
   37|   118k|  int i;
   38|  1.49M|  for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (38:15): [True: 1.37M, False: 118k]
  ------------------
   39|  1.37M|    _mm_store_si128((__m128i *)dst, *row);
   40|  1.37M|    dst += stride;
   41|  1.37M|  }
   42|   118k|}
intrapred_sse2.c:h_predictor_8x16xc:
 1140|  21.5k|                                      int count) {
 1141|  21.5k|  (void)above;
 1142|  43.1k|  for (int i = 0; i < count; ++i) {
  ------------------
  |  Branch (1142:19): [True: 21.5k, False: 21.5k]
  ------------------
 1143|  21.5k|    const __m128i left_col = _mm_load_si128((__m128i const *)left);
 1144|  21.5k|    __m128i left_col_low = _mm_unpacklo_epi8(left_col, left_col);
 1145|  21.5k|    __m128i left_col_high = _mm_unpackhi_epi8(left_col, left_col);
 1146|       |
 1147|  21.5k|    __m128i row0 = _mm_shufflelo_epi16(left_col_low, 0);
 1148|  21.5k|    __m128i row1 = _mm_shufflelo_epi16(left_col_low, 0x55);
 1149|  21.5k|    __m128i row2 = _mm_shufflelo_epi16(left_col_low, 0xaa);
 1150|  21.5k|    __m128i row3 = _mm_shufflelo_epi16(left_col_low, 0xff);
 1151|  21.5k|    _mm_storel_epi64((__m128i *)dst, row0);
 1152|  21.5k|    dst += stride;
 1153|  21.5k|    _mm_storel_epi64((__m128i *)dst, row1);
 1154|  21.5k|    dst += stride;
 1155|  21.5k|    _mm_storel_epi64((__m128i *)dst, row2);
 1156|  21.5k|    dst += stride;
 1157|  21.5k|    _mm_storel_epi64((__m128i *)dst, row3);
 1158|  21.5k|    dst += stride;
 1159|       |
 1160|  21.5k|    left_col_low = _mm_unpackhi_epi64(left_col_low, left_col_low);
 1161|  21.5k|    row0 = _mm_shufflelo_epi16(left_col_low, 0);
 1162|  21.5k|    row1 = _mm_shufflelo_epi16(left_col_low, 0x55);
 1163|  21.5k|    row2 = _mm_shufflelo_epi16(left_col_low, 0xaa);
 1164|  21.5k|    row3 = _mm_shufflelo_epi16(left_col_low, 0xff);
 1165|  21.5k|    _mm_storel_epi64((__m128i *)dst, row0);
 1166|  21.5k|    dst += stride;
 1167|  21.5k|    _mm_storel_epi64((__m128i *)dst, row1);
 1168|  21.5k|    dst += stride;
 1169|  21.5k|    _mm_storel_epi64((__m128i *)dst, row2);
 1170|  21.5k|    dst += stride;
 1171|  21.5k|    _mm_storel_epi64((__m128i *)dst, row3);
 1172|  21.5k|    dst += stride;
 1173|       |
 1174|  21.5k|    row0 = _mm_shufflelo_epi16(left_col_high, 0);
 1175|  21.5k|    row1 = _mm_shufflelo_epi16(left_col_high, 0x55);
 1176|  21.5k|    row2 = _mm_shufflelo_epi16(left_col_high, 0xaa);
 1177|  21.5k|    row3 = _mm_shufflelo_epi16(left_col_high, 0xff);
 1178|  21.5k|    _mm_storel_epi64((__m128i *)dst, row0);
 1179|  21.5k|    dst += stride;
 1180|  21.5k|    _mm_storel_epi64((__m128i *)dst, row1);
 1181|  21.5k|    dst += stride;
 1182|  21.5k|    _mm_storel_epi64((__m128i *)dst, row2);
 1183|  21.5k|    dst += stride;
 1184|  21.5k|    _mm_storel_epi64((__m128i *)dst, row3);
 1185|  21.5k|    dst += stride;
 1186|       |
 1187|  21.5k|    left_col_high = _mm_unpackhi_epi64(left_col_high, left_col_high);
 1188|  21.5k|    row0 = _mm_shufflelo_epi16(left_col_high, 0);
 1189|  21.5k|    row1 = _mm_shufflelo_epi16(left_col_high, 0x55);
 1190|  21.5k|    row2 = _mm_shufflelo_epi16(left_col_high, 0xaa);
 1191|       |    row3 = _mm_shufflelo_epi16(left_col_high, 0xff);
 1192|  21.5k|    _mm_storel_epi64((__m128i *)dst, row0);
 1193|  21.5k|    dst += stride;
 1194|  21.5k|    _mm_storel_epi64((__m128i *)dst, row1);
 1195|  21.5k|    dst += stride;
 1196|  21.5k|    _mm_storel_epi64((__m128i *)dst, row2);
 1197|  21.5k|    dst += stride;
 1198|  21.5k|    _mm_storel_epi64((__m128i *)dst, row3);
 1199|  21.5k|    dst += stride;
 1200|  21.5k|    left += 16;
 1201|  21.5k|  }
 1202|  21.5k|}
intrapred_sse2.c:h_prediction_16x8_1:
 1252|  14.6k|                                       ptrdiff_t stride) {
 1253|  14.6k|  __m128i row[4];
 1254|  14.6k|  repeat_low_4pixels(left, row);
 1255|  14.6k|  h_pred_store_16xh(row, 4, dst, stride);
 1256|  14.6k|}
intrapred_sse2.c:repeat_low_4pixels:
 1225|  14.9k|static inline void repeat_low_4pixels(const __m128i *x, __m128i *row) {
 1226|  14.9k|  const __m128i u0 = _mm_shufflelo_epi16(*x, 0);
 1227|  14.9k|  const __m128i u1 = _mm_shufflelo_epi16(*x, 0x55);
 1228|  14.9k|  const __m128i u2 = _mm_shufflelo_epi16(*x, 0xaa);
 1229|  14.9k|  const __m128i u3 = _mm_shufflelo_epi16(*x, 0xff);
 1230|       |
 1231|  14.9k|  row[0] = _mm_unpacklo_epi64(u0, u0);
 1232|  14.9k|  row[1] = _mm_unpacklo_epi64(u1, u1);
 1233|  14.9k|  row[2] = _mm_unpacklo_epi64(u2, u2);
 1234|  14.9k|  row[3] = _mm_unpacklo_epi64(u3, u3);
 1235|  14.9k|}
intrapred_sse2.c:h_pred_store_16xh:
 1217|  29.3k|                                     ptrdiff_t stride) {
 1218|  29.3k|  int i;
 1219|   146k|  for (i = 0; i < h; ++i) {
  ------------------
  |  Branch (1219:15): [True: 117k, False: 29.3k]
  ------------------
 1220|   117k|    _mm_store_si128((__m128i *)dst, row[i]);
 1221|   117k|    dst += stride;
 1222|   117k|  }
 1223|  29.3k|}
intrapred_sse2.c:h_prediction_16x8_2:
 1261|  14.6k|                                       ptrdiff_t stride) {
 1262|  14.6k|  __m128i row[4];
 1263|  14.6k|  repeat_high_4pixels(left, row);
 1264|  14.6k|  h_pred_store_16xh(row, 4, dst, stride);
 1265|  14.6k|}
intrapred_sse2.c:repeat_high_4pixels:
 1237|  14.9k|static inline void repeat_high_4pixels(const __m128i *x, __m128i *row) {
 1238|  14.9k|  const __m128i u0 = _mm_shufflehi_epi16(*x, 0);
 1239|  14.9k|  const __m128i u1 = _mm_shufflehi_epi16(*x, 0x55);
 1240|  14.9k|  const __m128i u2 = _mm_shufflehi_epi16(*x, 0xaa);
 1241|  14.9k|  const __m128i u3 = _mm_shufflehi_epi16(*x, 0xff);
 1242|       |
 1243|  14.9k|  row[0] = _mm_unpackhi_epi64(u0, u0);
 1244|  14.9k|  row[1] = _mm_unpackhi_epi64(u1, u1);
 1245|  14.9k|  row[2] = _mm_unpackhi_epi64(u2, u2);
 1246|  14.9k|  row[3] = _mm_unpackhi_epi64(u3, u3);
 1247|  14.9k|}
intrapred_sse2.c:h_predictor_16xh:
 1288|    534|                                    const uint8_t *left, int count) {
 1289|    534|  int i = 0;
 1290|  1.06k|  do {
 1291|  1.06k|    const __m128i left_col = _mm_load_si128((const __m128i *)left);
 1292|  1.06k|    const __m128i left_col_8p_lo = _mm_unpacklo_epi8(left_col, left_col);
 1293|  1.06k|    h_prediction_16x8_1(&left_col_8p_lo, dst, stride);
 1294|  1.06k|    dst += stride << 2;
 1295|  1.06k|    h_prediction_16x8_2(&left_col_8p_lo, dst, stride);
 1296|  1.06k|    dst += stride << 2;
 1297|       |
 1298|  1.06k|    const __m128i left_col_8p_hi = _mm_unpackhi_epi8(left_col, left_col);
 1299|  1.06k|    h_prediction_16x8_1(&left_col_8p_hi, dst, stride);
 1300|  1.06k|    dst += stride << 2;
 1301|  1.06k|    h_prediction_16x8_2(&left_col_8p_hi, dst, stride);
 1302|  1.06k|    dst += stride << 2;
 1303|       |
 1304|  1.06k|    left += 16;
 1305|  1.06k|    i++;
 1306|  1.06k|  } while (i < count);
  ------------------
  |  Branch (1306:12): [True: 534, False: 534]
  ------------------
 1307|    534|}
intrapred_sse2.c:h_prediction_32x8_1:
 1336|    274|                                       ptrdiff_t stride) {
 1337|    274|  __m128i row[4];
 1338|    274|  repeat_low_4pixels(left, row);
 1339|    274|  h_pred_store_32xh(row, 4, dst, stride);
 1340|    274|}
intrapred_sse2.c:h_pred_store_32xh:
 1324|    548|                                     ptrdiff_t stride) {
 1325|    548|  int i;
 1326|  2.74k|  for (i = 0; i < h; ++i) {
  ------------------
  |  Branch (1326:15): [True: 2.19k, False: 548]
  ------------------
 1327|  2.19k|    _mm_store_si128((__m128i *)dst, row[i]);
 1328|  2.19k|    _mm_store_si128((__m128i *)(dst + 16), row[i]);
 1329|  2.19k|    dst += stride;
 1330|  2.19k|  }
 1331|    548|}
intrapred_sse2.c:h_prediction_32x8_2:
 1345|    274|                                       ptrdiff_t stride) {
 1346|    274|  __m128i row[4];
 1347|    274|  repeat_high_4pixels(left, row);
 1348|    274|  h_pred_store_32xh(row, 4, dst, stride);
 1349|    274|}

aom_paeth_predictor_4x4_ssse3:
   45|  1.14M|                                   const uint8_t *above, const uint8_t *left) {
   46|  1.14M|  __m128i l = _mm_loadl_epi64((const __m128i *)left);
   47|  1.14M|  const __m128i t = _mm_loadl_epi64((const __m128i *)above);
   48|  1.14M|  const __m128i zero = _mm_setzero_si128();
   49|  1.14M|  const __m128i t16 = _mm_unpacklo_epi8(t, zero);
   50|  1.14M|  const __m128i tl16 = _mm_set1_epi16((int16_t)above[-1]);
   51|  1.14M|  __m128i rep = _mm_set1_epi16((short)0x8000);
   52|  1.14M|  const __m128i one = _mm_set1_epi16(1);
   53|       |
   54|  1.14M|  int i;
   55|  5.71M|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (55:15): [True: 4.57M, False: 1.14M]
  ------------------
   56|  4.57M|    const __m128i l16 = _mm_shuffle_epi8(l, rep);
   57|  4.57M|    const __m128i row = paeth_8x1_pred(&l16, &t16, &tl16);
   58|       |
   59|  4.57M|    *(int *)dst = _mm_cvtsi128_si32(_mm_packus_epi16(row, row));
   60|  4.57M|    dst += stride;
   61|  4.57M|    rep = _mm_add_epi16(rep, one);
   62|  4.57M|  }
   63|  1.14M|}
aom_paeth_predictor_4x8_ssse3:
   66|   337k|                                   const uint8_t *above, const uint8_t *left) {
   67|   337k|  __m128i l = _mm_loadl_epi64((const __m128i *)left);
   68|   337k|  const __m128i t = _mm_loadl_epi64((const __m128i *)above);
   69|   337k|  const __m128i zero = _mm_setzero_si128();
   70|   337k|  const __m128i t16 = _mm_unpacklo_epi8(t, zero);
   71|   337k|  const __m128i tl16 = _mm_set1_epi16((int16_t)above[-1]);
   72|   337k|  __m128i rep = _mm_set1_epi16((short)0x8000);
   73|   337k|  const __m128i one = _mm_set1_epi16(1);
   74|       |
   75|   337k|  int i;
   76|  3.03M|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (76:15): [True: 2.69M, False: 337k]
  ------------------
   77|  2.69M|    const __m128i l16 = _mm_shuffle_epi8(l, rep);
   78|  2.69M|    const __m128i row = paeth_8x1_pred(&l16, &t16, &tl16);
   79|       |
   80|  2.69M|    *(int *)dst = _mm_cvtsi128_si32(_mm_packus_epi16(row, row));
   81|  2.69M|    dst += stride;
   82|  2.69M|    rep = _mm_add_epi16(rep, one);
   83|  2.69M|  }
   84|   337k|}
aom_paeth_predictor_8x4_ssse3:
  109|  15.0k|                                   const uint8_t *above, const uint8_t *left) {
  110|  15.0k|  __m128i l = _mm_loadl_epi64((const __m128i *)left);
  111|  15.0k|  const __m128i t = _mm_loadl_epi64((const __m128i *)above);
  112|  15.0k|  const __m128i zero = _mm_setzero_si128();
  113|  15.0k|  const __m128i t16 = _mm_unpacklo_epi8(t, zero);
  114|  15.0k|  const __m128i tl16 = _mm_set1_epi16((int16_t)above[-1]);
  115|  15.0k|  __m128i rep = _mm_set1_epi16((short)0x8000);
  116|  15.0k|  const __m128i one = _mm_set1_epi16(1);
  117|       |
  118|  15.0k|  int i;
  119|  75.0k|  for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (119:15): [True: 60.0k, False: 15.0k]
  ------------------
  120|  60.0k|    const __m128i l16 = _mm_shuffle_epi8(l, rep);
  121|  60.0k|    const __m128i row = paeth_8x1_pred(&l16, &t16, &tl16);
  122|       |
  123|  60.0k|    _mm_storel_epi64((__m128i *)dst, _mm_packus_epi16(row, row));
  124|  60.0k|    dst += stride;
  125|  60.0k|    rep = _mm_add_epi16(rep, one);
  126|  60.0k|  }
  127|  15.0k|}
aom_paeth_predictor_8x8_ssse3:
  130|  3.12M|                                   const uint8_t *above, const uint8_t *left) {
  131|  3.12M|  __m128i l = _mm_loadl_epi64((const __m128i *)left);
  132|  3.12M|  const __m128i t = _mm_loadl_epi64((const __m128i *)above);
  133|  3.12M|  const __m128i zero = _mm_setzero_si128();
  134|  3.12M|  const __m128i t16 = _mm_unpacklo_epi8(t, zero);
  135|  3.12M|  const __m128i tl16 = _mm_set1_epi16((int16_t)above[-1]);
  136|  3.12M|  __m128i rep = _mm_set1_epi16((short)0x8000);
  137|  3.12M|  const __m128i one = _mm_set1_epi16(1);
  138|       |
  139|  3.12M|  int i;
  140|  28.1M|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (140:15): [True: 24.9M, False: 3.12M]
  ------------------
  141|  24.9M|    const __m128i l16 = _mm_shuffle_epi8(l, rep);
  142|  24.9M|    const __m128i row = paeth_8x1_pred(&l16, &t16, &tl16);
  143|       |
  144|  24.9M|    _mm_storel_epi64((__m128i *)dst, _mm_packus_epi16(row, row));
  145|  24.9M|    dst += stride;
  146|  24.9M|    rep = _mm_add_epi16(rep, one);
  147|  24.9M|  }
  148|  3.12M|}
aom_paeth_predictor_8x16_ssse3:
  151|  32.5k|                                    const uint8_t *above, const uint8_t *left) {
  152|  32.5k|  __m128i l = _mm_load_si128((const __m128i *)left);
  153|  32.5k|  const __m128i t = _mm_loadl_epi64((const __m128i *)above);
  154|  32.5k|  const __m128i zero = _mm_setzero_si128();
  155|  32.5k|  const __m128i t16 = _mm_unpacklo_epi8(t, zero);
  156|  32.5k|  const __m128i tl16 = _mm_set1_epi16((int16_t)above[-1]);
  157|  32.5k|  __m128i rep = _mm_set1_epi16((short)0x8000);
  158|  32.5k|  const __m128i one = _mm_set1_epi16(1);
  159|       |
  160|  32.5k|  int i;
  161|   552k|  for (i = 0; i < 16; ++i) {
  ------------------
  |  Branch (161:15): [True: 520k, False: 32.5k]
  ------------------
  162|   520k|    const __m128i l16 = _mm_shuffle_epi8(l, rep);
  163|   520k|    const __m128i row = paeth_8x1_pred(&l16, &t16, &tl16);
  164|       |
  165|   520k|    _mm_storel_epi64((__m128i *)dst, _mm_packus_epi16(row, row));
  166|   520k|    dst += stride;
  167|   520k|    rep = _mm_add_epi16(rep, one);
  168|   520k|  }
  169|  32.5k|}
aom_smooth_predictor_4x4_ssse3:
  678|  1.01M|                                    const uint8_t *above, const uint8_t *left) {
  679|  1.01M|  __m128i pixels[3];
  680|  1.01M|  load_pixel_w4(above, left, 4, pixels);
  681|       |
  682|  1.01M|  __m128i wh[4], ww[2];
  683|  1.01M|  load_weight_w4(4, wh, ww);
  684|       |
  685|  1.01M|  smooth_pred_4xh(pixels, wh, ww, 4, dst, stride, 0);
  686|  1.01M|}
aom_smooth_predictor_4x8_ssse3:
  689|   426k|                                    const uint8_t *above, const uint8_t *left) {
  690|   426k|  __m128i pixels[3];
  691|   426k|  load_pixel_w4(above, left, 8, pixels);
  692|       |
  693|   426k|  __m128i wh[4], ww[2];
  694|   426k|  load_weight_w4(8, wh, ww);
  695|       |
  696|   426k|  smooth_pred_4xh(pixels, wh, ww, 8, dst, stride, 0);
  697|   426k|}
aom_smooth_predictor_8x4_ssse3:
  845|  16.6k|                                    const uint8_t *above, const uint8_t *left) {
  846|  16.6k|  __m128i pixels[4];
  847|  16.6k|  load_pixel_w8(above, left, 4, pixels);
  848|       |
  849|  16.6k|  __m128i wh[4], ww[2];
  850|  16.6k|  load_weight_w8(4, wh, ww);
  851|       |
  852|  16.6k|  smooth_pred_8xh(pixels, wh, ww, 4, dst, stride, 0);
  853|  16.6k|}
aom_smooth_predictor_8x8_ssse3:
  856|   335k|                                    const uint8_t *above, const uint8_t *left) {
  857|   335k|  __m128i pixels[4];
  858|   335k|  load_pixel_w8(above, left, 8, pixels);
  859|       |
  860|   335k|  __m128i wh[4], ww[2];
  861|   335k|  load_weight_w8(8, wh, ww);
  862|       |
  863|   335k|  smooth_pred_8xh(pixels, wh, ww, 8, dst, stride, 0);
  864|   335k|}
aom_smooth_predictor_16x16_ssse3:
 1031|  4.38k|                                      const uint8_t *left) {
 1032|  4.38k|  smooth_predictor_wxh(dst, stride, above, left, 16, 16);
 1033|  4.38k|}
aom_smooth_predictor_32x32_ssse3:
 1063|  2.49k|                                      const uint8_t *left) {
 1064|  2.49k|  smooth_predictor_wxh(dst, stride, above, left, 32, 32);
 1065|  2.49k|}
aom_smooth_v_predictor_4x4_ssse3:
 1198|   855k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 1199|   855k|  __m128i pixels;
 1200|   855k|  load_smooth_vertical_pixels4(top_row, left_column, 4, &pixels);
 1201|       |
 1202|   855k|  __m128i weights[2];
 1203|   855k|  load_smooth_vertical_weights4(smooth_weights, 4, weights);
 1204|       |
 1205|   855k|  write_smooth_vertical4xh(&pixels, weights, 4, dst, stride);
 1206|   855k|}
aom_smooth_v_predictor_4x8_ssse3:
 1211|   382k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 1212|   382k|  __m128i pixels;
 1213|   382k|  load_smooth_vertical_pixels4(top_row, left_column, 8, &pixels);
 1214|       |
 1215|   382k|  __m128i weights[2];
 1216|   382k|  load_smooth_vertical_weights4(smooth_weights, 8, weights);
 1217|       |
 1218|   382k|  write_smooth_vertical4xh(&pixels, weights, 8, dst, stride);
 1219|   382k|}
aom_smooth_v_predictor_8x4_ssse3:
 1241|  15.7k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 1242|  15.7k|  const __m128i bottom_left = _mm_set1_epi16(left_column[3]);
 1243|  15.7k|  const __m128i weights = cvtepu8_epi16(Load4(smooth_weights));
 1244|  15.7k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  15.7k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1245|  15.7k|  const __m128i inverted_weights = _mm_sub_epi16(scale, weights);
 1246|  15.7k|  const __m128i scaled_bottom_left =
 1247|  15.7k|      _mm_mullo_epi16(inverted_weights, bottom_left);
 1248|  15.7k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|  15.7k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1249|  15.7k|  __m128i y_select = _mm_set1_epi32(0x01000100);
 1250|  15.7k|  const __m128i top = cvtepu8_epi16(LoadLo8(top_row));
 1251|  15.7k|  __m128i weights_y = _mm_shuffle_epi8(weights, y_select);
 1252|  15.7k|  __m128i scaled_bottom_left_y = _mm_shuffle_epi8(scaled_bottom_left, y_select);
 1253|  15.7k|  write_smooth_directional_sum8(dst, &top, &weights_y, &scaled_bottom_left_y,
 1254|  15.7k|                                &round);
 1255|  15.7k|  dst += stride;
 1256|  15.7k|  y_select = _mm_set1_epi32(0x03020302);
 1257|  15.7k|  weights_y = _mm_shuffle_epi8(weights, y_select);
 1258|  15.7k|  scaled_bottom_left_y = _mm_shuffle_epi8(scaled_bottom_left, y_select);
 1259|  15.7k|  write_smooth_directional_sum8(dst, &top, &weights_y, &scaled_bottom_left_y,
 1260|  15.7k|                                &round);
 1261|  15.7k|  dst += stride;
 1262|  15.7k|  y_select = _mm_set1_epi32(0x05040504);
 1263|  15.7k|  weights_y = _mm_shuffle_epi8(weights, y_select);
 1264|  15.7k|  scaled_bottom_left_y = _mm_shuffle_epi8(scaled_bottom_left, y_select);
 1265|  15.7k|  write_smooth_directional_sum8(dst, &top, &weights_y, &scaled_bottom_left_y,
 1266|  15.7k|                                &round);
 1267|  15.7k|  dst += stride;
 1268|  15.7k|  y_select = _mm_set1_epi32(0x07060706);
 1269|  15.7k|  weights_y = _mm_shuffle_epi8(weights, y_select);
 1270|  15.7k|  scaled_bottom_left_y = _mm_shuffle_epi8(scaled_bottom_left, y_select);
 1271|  15.7k|  write_smooth_directional_sum8(dst, &top, &weights_y, &scaled_bottom_left_y,
 1272|  15.7k|                                &round);
 1273|  15.7k|}
aom_smooth_v_predictor_8x8_ssse3:
 1278|   305k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 1279|   305k|  const __m128i bottom_left = _mm_set1_epi16(left_column[7]);
 1280|   305k|  const __m128i weights = cvtepu8_epi16(LoadLo8(smooth_weights + 4));
 1281|   305k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   305k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1282|   305k|  const __m128i inverted_weights = _mm_sub_epi16(scale, weights);
 1283|   305k|  const __m128i scaled_bottom_left =
 1284|   305k|      _mm_mullo_epi16(inverted_weights, bottom_left);
 1285|   305k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|   305k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1286|   305k|  const __m128i top = cvtepu8_epi16(LoadLo8(top_row));
 1287|  2.74M|  for (int y_mask = 0x01000100; y_mask < 0x0F0E0F0F; y_mask += 0x02020202) {
  ------------------
  |  Branch (1287:33): [True: 2.44M, False: 305k]
  ------------------
 1288|  2.44M|    const __m128i y_select = _mm_set1_epi32(y_mask);
 1289|  2.44M|    const __m128i weights_y = _mm_shuffle_epi8(weights, y_select);
 1290|  2.44M|    const __m128i scaled_bottom_left_y =
 1291|  2.44M|        _mm_shuffle_epi8(scaled_bottom_left, y_select);
 1292|  2.44M|    write_smooth_directional_sum8(dst, &top, &weights_y, &scaled_bottom_left_y,
 1293|  2.44M|                                  &round);
 1294|  2.44M|    dst += stride;
 1295|  2.44M|  }
 1296|   305k|}
aom_smooth_h_predictor_4x4_ssse3:
 2138|   876k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 2139|   876k|  const __m128i top_right = _mm_set1_epi32(top_row[3]);
 2140|   876k|  const __m128i left = cvtepu8_epi32(Load4(left_column));
 2141|   876k|  const __m128i weights = cvtepu8_epi32(Load4(smooth_weights));
 2142|   876k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   876k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2143|   876k|  const __m128i inverted_weights = _mm_sub_epi32(scale, weights);
 2144|   876k|  const __m128i scaled_top_right = _mm_mullo_epi16(inverted_weights, top_right);
 2145|   876k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|   876k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2146|   876k|  __m128i left_y = _mm_shuffle_epi32(left, 0);
 2147|   876k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2148|   876k|                               &round);
 2149|   876k|  dst += stride;
 2150|   876k|  left_y = _mm_shuffle_epi32(left, 0x55);
 2151|   876k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2152|   876k|                               &round);
 2153|   876k|  dst += stride;
 2154|   876k|  left_y = _mm_shuffle_epi32(left, 0xaa);
 2155|   876k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2156|   876k|                               &round);
 2157|   876k|  dst += stride;
 2158|       |  left_y = _mm_shuffle_epi32(left, 0xff);
 2159|   876k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2160|   876k|                               &round);
 2161|   876k|}
aom_smooth_h_predictor_4x8_ssse3:
 2166|   376k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 2167|   376k|  const __m128i top_right = _mm_set1_epi32(top_row[3]);
 2168|   376k|  const __m128i weights = cvtepu8_epi32(Load4(smooth_weights));
 2169|   376k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   376k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2170|   376k|  const __m128i inverted_weights = _mm_sub_epi32(scale, weights);
 2171|   376k|  const __m128i scaled_top_right = _mm_mullo_epi16(inverted_weights, top_right);
 2172|   376k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|   376k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2173|   376k|  __m128i left = cvtepu8_epi32(Load4(left_column));
 2174|   376k|  __m128i left_y = _mm_shuffle_epi32(left, 0);
 2175|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2176|   376k|                               &round);
 2177|   376k|  dst += stride;
 2178|   376k|  left_y = _mm_shuffle_epi32(left, 0x55);
 2179|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2180|   376k|                               &round);
 2181|   376k|  dst += stride;
 2182|   376k|  left_y = _mm_shuffle_epi32(left, 0xaa);
 2183|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2184|   376k|                               &round);
 2185|   376k|  dst += stride;
 2186|   376k|  left_y = _mm_shuffle_epi32(left, 0xff);
 2187|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2188|   376k|                               &round);
 2189|   376k|  dst += stride;
 2190|       |
 2191|   376k|  left = cvtepu8_epi32(Load4(left_column + 4));
 2192|   376k|  left_y = _mm_shuffle_epi32(left, 0);
 2193|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2194|   376k|                               &round);
 2195|   376k|  dst += stride;
 2196|   376k|  left_y = _mm_shuffle_epi32(left, 0x55);
 2197|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2198|   376k|                               &round);
 2199|   376k|  dst += stride;
 2200|   376k|  left_y = _mm_shuffle_epi32(left, 0xaa);
 2201|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2202|   376k|                               &round);
 2203|   376k|  dst += stride;
 2204|       |  left_y = _mm_shuffle_epi32(left, 0xff);
 2205|   376k|  write_smooth_horizontal_sum4(dst, &left_y, &weights, &scaled_top_right,
 2206|   376k|                               &round);
 2207|   376k|}
aom_smooth_h_predictor_8x4_ssse3:
 2299|  16.4k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 2300|  16.4k|  const __m128i top_right = _mm_set1_epi16(top_row[7]);
 2301|  16.4k|  const __m128i left = cvtepu8_epi16(Load4(left_column));
 2302|  16.4k|  const __m128i weights = cvtepu8_epi16(LoadLo8(smooth_weights + 4));
 2303|  16.4k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  16.4k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2304|  16.4k|  const __m128i inverted_weights = _mm_sub_epi16(scale, weights);
 2305|  16.4k|  const __m128i scaled_top_right = _mm_mullo_epi16(inverted_weights, top_right);
 2306|  16.4k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|  16.4k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2307|  16.4k|  __m128i y_select = _mm_set1_epi32(0x01000100);
 2308|  16.4k|  __m128i left_y = _mm_shuffle_epi8(left, y_select);
 2309|  16.4k|  write_smooth_directional_sum8(dst, &left_y, &weights, &scaled_top_right,
 2310|  16.4k|                                &round);
 2311|  16.4k|  dst += stride;
 2312|  16.4k|  y_select = _mm_set1_epi32(0x03020302);
 2313|  16.4k|  left_y = _mm_shuffle_epi8(left, y_select);
 2314|  16.4k|  write_smooth_directional_sum8(dst, &left_y, &weights, &scaled_top_right,
 2315|  16.4k|                                &round);
 2316|  16.4k|  dst += stride;
 2317|  16.4k|  y_select = _mm_set1_epi32(0x05040504);
 2318|  16.4k|  left_y = _mm_shuffle_epi8(left, y_select);
 2319|  16.4k|  write_smooth_directional_sum8(dst, &left_y, &weights, &scaled_top_right,
 2320|  16.4k|                                &round);
 2321|  16.4k|  dst += stride;
 2322|  16.4k|  y_select = _mm_set1_epi32(0x07060706);
 2323|  16.4k|  left_y = _mm_shuffle_epi8(left, y_select);
 2324|  16.4k|  write_smooth_directional_sum8(dst, &left_y, &weights, &scaled_top_right,
 2325|  16.4k|                                &round);
 2326|  16.4k|}
aom_smooth_h_predictor_8x8_ssse3:
 2331|   309k|    const uint8_t *LIBAOM_RESTRICT left_column) {
 2332|   309k|  const __m128i top_right = _mm_set1_epi16(top_row[7]);
 2333|   309k|  const __m128i left = cvtepu8_epi16(LoadLo8(left_column));
 2334|   309k|  const __m128i weights = cvtepu8_epi16(LoadLo8(smooth_weights + 4));
 2335|   309k|  const __m128i scale = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|   309k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2336|   309k|  const __m128i inverted_weights = _mm_sub_epi16(scale, weights);
 2337|   309k|  const __m128i scaled_top_right = _mm_mullo_epi16(inverted_weights, top_right);
 2338|   309k|  const __m128i round = _mm_set1_epi16(1 << (SMOOTH_WEIGHT_LOG2_SCALE - 1));
  ------------------
  |  |   19|   309k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 2339|  2.78M|  for (int y_mask = 0x01000100; y_mask < 0x0F0E0F0F; y_mask += 0x02020202) {
  ------------------
  |  Branch (2339:33): [True: 2.47M, False: 309k]
  ------------------
 2340|  2.47M|    const __m128i y_select = _mm_set1_epi32(y_mask);
 2341|  2.47M|    const __m128i left_y = _mm_shuffle_epi8(left, y_select);
 2342|  2.47M|    write_smooth_directional_sum8(dst, &left_y, &weights, &scaled_top_right,
 2343|  2.47M|                                  &round);
 2344|  2.47M|    dst += stride;
 2345|  2.47M|  }
 2346|   309k|}
intrapred_ssse3.c:paeth_8x1_pred:
   23|  32.8M|                                     const __m128i *topleft) {
   24|  32.8M|  const __m128i base = _mm_sub_epi16(_mm_add_epi16(*top, *left), *topleft);
   25|       |
   26|  32.8M|  __m128i pl = _mm_abs_epi16(_mm_sub_epi16(base, *left));
   27|  32.8M|  __m128i pt = _mm_abs_epi16(_mm_sub_epi16(base, *top));
   28|  32.8M|  __m128i ptl = _mm_abs_epi16(_mm_sub_epi16(base, *topleft));
   29|       |
   30|  32.8M|  __m128i mask1 = _mm_cmpgt_epi16(pl, pt);
   31|  32.8M|  mask1 = _mm_or_si128(mask1, _mm_cmpgt_epi16(pl, ptl));
   32|  32.8M|  __m128i mask2 = _mm_cmpgt_epi16(pt, ptl);
   33|       |
   34|  32.8M|  pl = _mm_andnot_si128(mask1, *left);
   35|       |
   36|  32.8M|  ptl = _mm_and_si128(mask2, *topleft);
   37|  32.8M|  pt = _mm_andnot_si128(mask2, *top);
   38|  32.8M|  pt = _mm_or_si128(pt, ptl);
   39|  32.8M|  pt = _mm_and_si128(mask1, pt);
   40|       |
   41|  32.8M|  return _mm_or_si128(pl, pt);
   42|  32.8M|}
intrapred_ssse3.c:load_pixel_w4:
  598|  1.44M|                                 int height, __m128i *pixels) {
  599|  1.44M|  __m128i d = _mm_cvtsi32_si128(((const int *)above)[0]);
  600|  1.44M|  if (height == 4)
  ------------------
  |  Branch (600:7): [True: 1.01M, False: 425k]
  ------------------
  601|  1.01M|    pixels[1] = _mm_cvtsi32_si128(((const int *)left)[0]);
  602|   425k|  else if (height == 8)
  ------------------
  |  Branch (602:12): [True: 426k, False: 18.4E]
  ------------------
  603|   426k|    pixels[1] = _mm_loadl_epi64(((const __m128i *)left));
  604|  18.4E|  else
  605|  18.4E|    pixels[1] = _mm_loadu_si128(((const __m128i *)left));
  606|       |
  607|  1.44M|  pixels[2] = _mm_set1_epi16((int16_t)above[3]);
  608|       |
  609|  1.44M|  const __m128i bp = _mm_set1_epi16((int16_t)left[height - 1]);
  610|  1.44M|  const __m128i zero = _mm_setzero_si128();
  611|  1.44M|  d = _mm_unpacklo_epi8(d, zero);
  612|  1.44M|  pixels[0] = _mm_unpacklo_epi16(d, bp);
  613|  1.44M|}
intrapred_ssse3.c:load_weight_w4:
  621|  1.44M|                                  __m128i *weight_w) {
  622|  1.44M|  const __m128i zero = _mm_setzero_si128();
  623|  1.44M|  const __m128i d = _mm_set1_epi16((int16_t)(1 << SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|  1.44M|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  624|  1.44M|  const __m128i t = _mm_cvtsi32_si128(((const int *)smooth_weights)[0]);
  625|  1.44M|  weight_h[0] = _mm_unpacklo_epi8(t, zero);
  626|  1.44M|  weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  627|  1.44M|  weight_w[0] = _mm_unpacklo_epi16(weight_h[0], weight_h[1]);
  628|       |
  629|  1.44M|  if (height == 8) {
  ------------------
  |  Branch (629:7): [True: 426k, False: 1.01M]
  ------------------
  630|   426k|    const __m128i weight = _mm_loadl_epi64((const __m128i *)&smooth_weights[4]);
  631|   426k|    weight_h[0] = _mm_unpacklo_epi8(weight, zero);
  632|   426k|    weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  633|  1.01M|  } else if (height == 16) {
  ------------------
  |  Branch (633:14): [True: 0, False: 1.01M]
  ------------------
  634|      0|    const __m128i weight =
  635|      0|        _mm_loadu_si128((const __m128i *)&smooth_weights[12]);
  636|      0|    weight_h[0] = _mm_unpacklo_epi8(weight, zero);
  637|      0|    weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  638|      0|    weight_h[2] = _mm_unpackhi_epi8(weight, zero);
  639|      0|    weight_h[3] = _mm_sub_epi16(d, weight_h[2]);
  640|      0|  }
  641|  1.44M|}
intrapred_ssse3.c:smooth_pred_4xh:
  645|  1.44M|                                   ptrdiff_t stride, int second_half) {
  646|  1.44M|  const __m128i round = _mm_set1_epi32((1 << SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|  1.44M|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  647|  1.44M|  const __m128i one = _mm_set1_epi16(1);
  648|  1.44M|  const __m128i inc = _mm_set1_epi16(0x202);
  649|  1.44M|  const __m128i gat = _mm_set1_epi32(0xc080400);
  650|  1.44M|  __m128i rep = second_half ? _mm_set1_epi16((short)0x8008)
  ------------------
  |  Branch (650:17): [True: 0, False: 1.44M]
  ------------------
  651|  1.44M|                            : _mm_set1_epi16((short)0x8000);
  652|  1.44M|  __m128i d = _mm_set1_epi16(0x100);
  653|       |
  654|  8.91M|  for (int i = 0; i < h; ++i) {
  ------------------
  |  Branch (654:19): [True: 7.47M, False: 1.44M]
  ------------------
  655|  7.47M|    const __m128i wg_wg = _mm_shuffle_epi8(wh[0], d);
  656|  7.47M|    const __m128i sc_sc = _mm_shuffle_epi8(wh[1], d);
  657|  7.47M|    const __m128i wh_sc = _mm_unpacklo_epi16(wg_wg, sc_sc);
  658|  7.47M|    __m128i s = _mm_madd_epi16(pixel[0], wh_sc);
  659|       |
  660|  7.47M|    __m128i b = _mm_shuffle_epi8(pixel[1], rep);
  661|  7.47M|    b = _mm_unpacklo_epi16(b, pixel[2]);
  662|  7.47M|    __m128i sum = _mm_madd_epi16(b, ww[0]);
  663|       |
  664|  7.47M|    sum = _mm_add_epi32(s, sum);
  665|  7.47M|    sum = _mm_add_epi32(sum, round);
  666|  7.47M|    sum = _mm_srai_epi32(sum, 1 + SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  7.47M|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  667|       |
  668|  7.47M|    sum = _mm_shuffle_epi8(sum, gat);
  669|  7.47M|    *(int *)dst = _mm_cvtsi128_si32(sum);
  670|  7.47M|    dst += stride;
  671|       |
  672|  7.47M|    rep = _mm_add_epi16(rep, one);
  673|  7.47M|    d = _mm_add_epi16(d, inc);
  674|  7.47M|  }
  675|  1.44M|}
intrapred_ssse3.c:load_pixel_w8:
  724|   352k|                                 int height, __m128i *pixels) {
  725|   352k|  const __m128i zero = _mm_setzero_si128();
  726|   352k|  const __m128i bp = _mm_set1_epi16((int16_t)left[height - 1]);
  727|   352k|  __m128i d = _mm_loadl_epi64((const __m128i *)above);
  728|   352k|  d = _mm_unpacklo_epi8(d, zero);
  729|   352k|  pixels[0] = _mm_unpacklo_epi16(d, bp);
  730|   352k|  pixels[1] = _mm_unpackhi_epi16(d, bp);
  731|       |
  732|   352k|  pixels[3] = _mm_set1_epi16((int16_t)above[7]);
  733|       |
  734|   352k|  if (height == 4) {
  ------------------
  |  Branch (734:7): [True: 16.6k, False: 335k]
  ------------------
  735|  16.6k|    pixels[2] = _mm_cvtsi32_si128(((const int *)left)[0]);
  736|   335k|  } else if (height == 8) {
  ------------------
  |  Branch (736:14): [True: 335k, False: 18.4E]
  ------------------
  737|   335k|    pixels[2] = _mm_loadl_epi64((const __m128i *)left);
  738|  18.4E|  } else if (height == 16) {
  ------------------
  |  Branch (738:14): [True: 0, False: 18.4E]
  ------------------
  739|      0|    pixels[2] = _mm_load_si128((const __m128i *)left);
  740|  18.4E|  } else {
  741|  18.4E|    pixels[2] = _mm_load_si128((const __m128i *)left);
  742|  18.4E|    pixels[4] = pixels[0];
  743|  18.4E|    pixels[5] = pixels[1];
  744|  18.4E|    pixels[6] = _mm_load_si128((const __m128i *)(left + 16));
  745|  18.4E|    pixels[7] = pixels[3];
  746|  18.4E|  }
  747|   352k|}
intrapred_ssse3.c:load_weight_w8:
  760|   352k|                                  __m128i *weight_w) {
  761|   352k|  const __m128i zero = _mm_setzero_si128();
  762|   352k|  const int we_offset = height < 8 ? 0 : 4;
  ------------------
  |  Branch (762:25): [True: 16.6k, False: 335k]
  ------------------
  763|   352k|  __m128i we = _mm_loadu_si128((const __m128i *)&smooth_weights[we_offset]);
  764|   352k|  weight_h[0] = _mm_unpacklo_epi8(we, zero);
  765|   352k|  const __m128i d = _mm_set1_epi16((int16_t)(1 << SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|   352k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  766|   352k|  weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  767|       |
  768|   352k|  if (height == 4) {
  ------------------
  |  Branch (768:7): [True: 16.6k, False: 335k]
  ------------------
  769|  16.6k|    we = _mm_srli_si128(we, 4);
  770|  16.6k|    __m128i tmp1 = _mm_unpacklo_epi8(we, zero);
  771|  16.6k|    __m128i tmp2 = _mm_sub_epi16(d, tmp1);
  772|  16.6k|    weight_w[0] = _mm_unpacklo_epi16(tmp1, tmp2);
  773|  16.6k|    weight_w[1] = _mm_unpackhi_epi16(tmp1, tmp2);
  774|   335k|  } else {
  775|   335k|    weight_w[0] = _mm_unpacklo_epi16(weight_h[0], weight_h[1]);
  776|   335k|    weight_w[1] = _mm_unpackhi_epi16(weight_h[0], weight_h[1]);
  777|   335k|  }
  778|       |
  779|   352k|  if (height == 16) {
  ------------------
  |  Branch (779:7): [True: 0, False: 352k]
  ------------------
  780|      0|    we = _mm_loadu_si128((const __m128i *)&smooth_weights[12]);
  781|      0|    weight_h[0] = _mm_unpacklo_epi8(we, zero);
  782|      0|    weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  783|      0|    weight_h[2] = _mm_unpackhi_epi8(we, zero);
  784|      0|    weight_h[3] = _mm_sub_epi16(d, weight_h[2]);
  785|   352k|  } else if (height == 32) {
  ------------------
  |  Branch (785:14): [True: 0, False: 352k]
  ------------------
  786|      0|    const __m128i weight_lo =
  787|      0|        _mm_loadu_si128((const __m128i *)&smooth_weights[28]);
  788|      0|    weight_h[0] = _mm_unpacklo_epi8(weight_lo, zero);
  789|      0|    weight_h[1] = _mm_sub_epi16(d, weight_h[0]);
  790|      0|    weight_h[2] = _mm_unpackhi_epi8(weight_lo, zero);
  791|      0|    weight_h[3] = _mm_sub_epi16(d, weight_h[2]);
  792|      0|    const __m128i weight_hi =
  793|      0|        _mm_loadu_si128((const __m128i *)&smooth_weights[28 + 16]);
  794|      0|    weight_h[4] = _mm_unpacklo_epi8(weight_hi, zero);
  795|      0|    weight_h[5] = _mm_sub_epi16(d, weight_h[4]);
  796|      0|    weight_h[6] = _mm_unpackhi_epi8(weight_hi, zero);
  797|      0|    weight_h[7] = _mm_sub_epi16(d, weight_h[6]);
  798|      0|  }
  799|   352k|}
intrapred_ssse3.c:smooth_pred_8xh:
  803|   352k|                                   ptrdiff_t stride, int second_half) {
  804|   352k|  const __m128i round = _mm_set1_epi32((1 << SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|   352k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  805|   352k|  const __m128i one = _mm_set1_epi16(1);
  806|   352k|  const __m128i inc = _mm_set1_epi16(0x202);
  807|   352k|  const __m128i gat = _mm_set_epi32(0, 0, 0xe0c0a08, 0x6040200);
  808|       |
  809|   352k|  __m128i rep = second_half ? _mm_set1_epi16((short)0x8008)
  ------------------
  |  Branch (809:17): [True: 0, False: 352k]
  ------------------
  810|   352k|                            : _mm_set1_epi16((short)0x8000);
  811|   352k|  __m128i d = _mm_set1_epi16(0x100);
  812|       |
  813|   352k|  int i;
  814|  3.10M|  for (i = 0; i < h; ++i) {
  ------------------
  |  Branch (814:15): [True: 2.75M, False: 352k]
  ------------------
  815|  2.75M|    const __m128i wg_wg = _mm_shuffle_epi8(wh[0], d);
  816|  2.75M|    const __m128i sc_sc = _mm_shuffle_epi8(wh[1], d);
  817|  2.75M|    const __m128i wh_sc = _mm_unpacklo_epi16(wg_wg, sc_sc);
  818|  2.75M|    __m128i s0 = _mm_madd_epi16(pixels[0], wh_sc);
  819|  2.75M|    __m128i s1 = _mm_madd_epi16(pixels[1], wh_sc);
  820|       |
  821|  2.75M|    __m128i b = _mm_shuffle_epi8(pixels[2], rep);
  822|  2.75M|    b = _mm_unpacklo_epi16(b, pixels[3]);
  823|  2.75M|    __m128i sum0 = _mm_madd_epi16(b, ww[0]);
  824|  2.75M|    __m128i sum1 = _mm_madd_epi16(b, ww[1]);
  825|       |
  826|  2.75M|    s0 = _mm_add_epi32(s0, sum0);
  827|  2.75M|    s0 = _mm_add_epi32(s0, round);
  828|  2.75M|    s0 = _mm_srai_epi32(s0, 1 + SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  2.75M|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  829|       |
  830|  2.75M|    s1 = _mm_add_epi32(s1, sum1);
  831|  2.75M|    s1 = _mm_add_epi32(s1, round);
  832|  2.75M|    s1 = _mm_srai_epi32(s1, 1 + SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  2.75M|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  833|       |
  834|  2.75M|    sum0 = _mm_packus_epi16(s0, s1);
  835|  2.75M|    sum0 = _mm_shuffle_epi8(sum0, gat);
  836|  2.75M|    _mm_storel_epi64((__m128i *)dst, sum0);
  837|  2.75M|    dst += stride;
  838|       |
  839|  2.75M|    rep = _mm_add_epi16(rep, one);
  840|  2.75M|    d = _mm_add_epi16(d, inc);
  841|  2.75M|  }
  842|   352k|}
intrapred_ssse3.c:smooth_predictor_wxh:
  960|  6.88k|                                 int width, int height) {
  961|  6.88k|  const uint8_t *const sm_weights_h = smooth_weights + height - 4;
  962|  6.88k|  const uint8_t *const sm_weights_w = smooth_weights + width - 4;
  963|  6.88k|  const __m128i zero = _mm_setzero_si128();
  964|  6.88k|  const __m128i scale_value = _mm_set1_epi16(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  6.88k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  965|  6.88k|  const __m128i bottom_left = _mm_cvtsi32_si128(left_column[height - 1]);
  966|  6.88k|  const __m128i top_right = _mm_set1_epi16(top_row[width - 1]);
  967|  6.88k|  const __m128i round = _mm_set1_epi32(1 << SMOOTH_WEIGHT_LOG2_SCALE);
  ------------------
  |  |   19|  6.88k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
  968|   156k|  for (int y = 0; y < height; ++y) {
  ------------------
  |  Branch (968:19): [True: 149k, False: 6.88k]
  ------------------
  969|   149k|    const __m128i weights_y = _mm_cvtsi32_si128(sm_weights_h[y]);
  970|   149k|    const __m128i left_y = _mm_cvtsi32_si128(left_column[y]);
  971|   149k|    const __m128i scale_m_weights_y = _mm_sub_epi16(scale_value, weights_y);
  972|   149k|    __m128i scaled_bottom_left =
  973|   149k|        _mm_mullo_epi16(scale_m_weights_y, bottom_left);
  974|   149k|    const __m128i weight_left_y =
  975|   149k|        _mm_shuffle_epi32(_mm_unpacklo_epi16(weights_y, left_y), 0);
  976|   149k|    scaled_bottom_left = _mm_add_epi32(scaled_bottom_left, round);
  977|   149k|    scaled_bottom_left = _mm_shuffle_epi32(scaled_bottom_left, 0);
  978|   607k|    for (int x = 0; x < width; x += 8) {
  ------------------
  |  Branch (978:21): [True: 458k, False: 149k]
  ------------------
  979|   458k|      const __m128i top_x = LoadLo8(top_row + x);
  980|   458k|      const __m128i weights_x = LoadLo8(sm_weights_w + x);
  981|   458k|      const __m128i top_weights_x = _mm_unpacklo_epi8(top_x, weights_x);
  982|   458k|      const __m128i top_weights_x_lo = cvtepu8_epi16(top_weights_x);
  983|   458k|      const __m128i top_weights_x_hi = _mm_unpackhi_epi8(top_weights_x, zero);
  984|       |
  985|       |      // Here opposite weights and pixels are multiplied, where the order of
  986|       |      // interleaving is indicated in the names.
  987|   458k|      __m128i pred_lo = _mm_madd_epi16(top_weights_x_lo, weight_left_y);
  988|   458k|      __m128i pred_hi = _mm_madd_epi16(top_weights_x_hi, weight_left_y);
  989|       |
  990|       |      // |scaled_bottom_left| is always scaled by the same weight each row, so
  991|       |      // we only derive |scaled_top_right| values here.
  992|   458k|      const __m128i inverted_weights_x =
  993|   458k|          _mm_sub_epi16(scale_value, cvtepu8_epi16(weights_x));
  994|   458k|      const __m128i scaled_top_right =
  995|   458k|          _mm_mullo_epi16(inverted_weights_x, top_right);
  996|   458k|      const __m128i scaled_top_right_lo = cvtepu16_epi32(scaled_top_right);
  997|   458k|      const __m128i scaled_top_right_hi =
  998|   458k|          _mm_unpackhi_epi16(scaled_top_right, zero);
  999|   458k|      pred_lo = _mm_add_epi32(pred_lo, scaled_bottom_left);
 1000|   458k|      pred_hi = _mm_add_epi32(pred_hi, scaled_bottom_left);
 1001|   458k|      pred_lo = _mm_add_epi32(pred_lo, scaled_top_right_lo);
 1002|   458k|      pred_hi = _mm_add_epi32(pred_hi, scaled_top_right_hi);
 1003|       |
 1004|       |      // The round value for RightShiftWithRounding was added with
 1005|       |      // |scaled_bottom_left|.
 1006|   458k|      pred_lo = _mm_srli_epi32(pred_lo, (1 + SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|   458k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1007|   458k|      pred_hi = _mm_srli_epi32(pred_hi, (1 + SMOOTH_WEIGHT_LOG2_SCALE));
  ------------------
  |  |   19|   458k|#define SMOOTH_WEIGHT_LOG2_SCALE 8
  ------------------
 1008|   458k|      const __m128i pred = _mm_packus_epi16(pred_lo, pred_hi);
 1009|   458k|      StoreLo8(dst + x, _mm_packus_epi16(pred, pred));
 1010|   458k|    }
 1011|   149k|    dst += stride;
 1012|   149k|  }
 1013|  6.88k|}
intrapred_ssse3.c:cvtepu16_epi32:
  953|   458k|static AOM_FORCE_INLINE __m128i cvtepu16_epi32(__m128i x) {
  954|   458k|  return _mm_unpacklo_epi16((x), _mm_setzero_si128());
  955|   458k|}
intrapred_ssse3.c:StoreLo8:
  936|  5.49M|static AOM_FORCE_INLINE void StoreLo8(void *a, const __m128i v) {
  937|  5.49M|  _mm_storel_epi64((__m128i *)(a), v);
  938|  5.49M|}
intrapred_ssse3.c:load_smooth_vertical_pixels4:
 1135|  1.23M|    const int height, __m128i *pixels) {
 1136|  1.23M|  __m128i top = Load4(above);
 1137|  1.23M|  const __m128i bottom_left = _mm_set1_epi16(left[height - 1]);
 1138|  1.23M|  top = cvtepu8_epi16(top);
 1139|  1.23M|  pixels[0] = _mm_unpacklo_epi16(top, bottom_left);
 1140|  1.23M|}
intrapred_ssse3.c:load_smooth_vertical_weights4:
 1148|  1.23M|    __m128i *weights) {
 1149|  1.23M|  const __m128i inverter = _mm_set1_epi16(256);
 1150|       |
 1151|  1.23M|  if (height == 4) {
  ------------------
  |  Branch (1151:7): [True: 855k, False: 382k]
  ------------------
 1152|   855k|    const __m128i weight = Load4(weight_array);
 1153|   855k|    weights[0] = cvtepu8_epi16(weight);
 1154|   855k|    weights[1] = _mm_sub_epi16(inverter, weights[0]);
 1155|   855k|  } else if (height == 8) {
  ------------------
  |  Branch (1155:14): [True: 382k, False: 18.4E]
  ------------------
 1156|   382k|    const __m128i weight = LoadLo8(weight_array + 4);
 1157|   382k|    weights[0] = cvtepu8_epi16(weight);
 1158|   382k|    weights[1] = _mm_sub_epi16(inverter, weights[0]);
 1159|  18.4E|  } else {
 1160|  18.4E|    const __m128i weight = LoadUnaligned16(weight_array + 12);
 1161|  18.4E|    const __m128i zero = _mm_setzero_si128();
 1162|  18.4E|    weights[0] = cvtepu8_epi16(weight);
 1163|  18.4E|    weights[1] = _mm_sub_epi16(inverter, weights[0]);
 1164|  18.4E|    weights[2] = _mm_unpackhi_epi8(weight, zero);
 1165|  18.4E|    weights[3] = _mm_sub_epi16(inverter, weights[2]);
 1166|  18.4E|  }
 1167|  1.23M|}
intrapred_ssse3.c:write_smooth_vertical4xh:
 1171|  1.23M|    uint8_t *LIBAOM_RESTRICT dst, const ptrdiff_t stride) {
 1172|  1.23M|  const __m128i pred_round = _mm_set1_epi32(128);
 1173|  1.23M|  const __m128i mask_increment = _mm_set1_epi16(0x0202);
 1174|  1.23M|  const __m128i cvtepu8_epi32 = _mm_set1_epi32(0xC080400);
 1175|  1.23M|  __m128i y_select = _mm_set1_epi16(0x0100);
 1176|       |
 1177|  7.72M|  for (int y = 0; y < height; ++y) {
  ------------------
  |  Branch (1177:19): [True: 6.48M, False: 1.23M]
  ------------------
 1178|  6.48M|    const __m128i weight_y = _mm_shuffle_epi8(weight[0], y_select);
 1179|  6.48M|    const __m128i inverted_weight_y = _mm_shuffle_epi8(weight[1], y_select);
 1180|  6.48M|    const __m128i alternate_weights =
 1181|  6.48M|        _mm_unpacklo_epi16(weight_y, inverted_weight_y);
 1182|       |    // Here the pixel vector is top_row[0], corner, top_row[1], corner, ...
 1183|       |    // The madd instruction yields four results of the form:
 1184|       |    // (top_row[x] * weight[y] + corner * inverted_weight[y])
 1185|  6.48M|    __m128i sum = _mm_madd_epi16(pixel[0], alternate_weights);
 1186|  6.48M|    sum = _mm_add_epi32(sum, pred_round);
 1187|  6.48M|    sum = _mm_srai_epi32(sum, 8);
 1188|  6.48M|    sum = _mm_shuffle_epi8(sum, cvtepu8_epi32);
 1189|  6.48M|    Store4(dst, sum);
 1190|  6.48M|    dst += stride;
 1191|  6.48M|    y_select = _mm_add_epi16(y_select, mask_increment);
 1192|  6.48M|  }
 1193|  1.23M|}
intrapred_ssse3.c:Store4:
  931|  12.9M|static AOM_FORCE_INLINE void Store4(void *dst, const __m128i x) {
  932|  12.9M|  const int val = _mm_cvtsi128_si32(x);
  933|  12.9M|  memcpy(dst, &val, sizeof(val));
  934|  12.9M|}
intrapred_ssse3.c:cvtepu8_epi16:
  944|  4.68M|static AOM_FORCE_INLINE __m128i cvtepu8_epi16(__m128i x) {
  945|  4.68M|  return _mm_unpacklo_epi8((x), _mm_setzero_si128());
  946|  4.68M|}
intrapred_ssse3.c:Load4:
  911|  5.00M|static AOM_FORCE_INLINE __m128i Load4(const void *src) {
  912|       |  // With new compilers such as clang 8.0.0 we can use the new _mm_loadu_si32
  913|       |  // intrinsic. Both _mm_loadu_si32(src) and the code here are compiled into a
  914|       |  // movss instruction.
  915|       |  //
  916|       |  // Until compiler support of _mm_loadu_si32 is widespread, use of
  917|       |  // _mm_loadu_si32 is banned.
  918|  5.00M|  int val;
  919|  5.00M|  memcpy(&val, src, sizeof(val));
  920|  5.00M|  return _mm_cvtsi32_si128(val);
  921|  5.00M|}
intrapred_ssse3.c:LoadLo8:
  923|  2.55M|static AOM_FORCE_INLINE __m128i LoadLo8(const void *a) {
  924|  2.55M|  return _mm_loadl_epi64((const __m128i *)(a));
  925|  2.55M|}
intrapred_ssse3.c:write_smooth_directional_sum8:
 1122|  5.04M|    const __m128i *scaled_corner, const __m128i *round) {
 1123|  5.04M|  const __m128i pred_sum =
 1124|  5.04M|      smooth_directional_sum8(*pixels, *weights, *scaled_corner);
 1125|       |  // Equivalent to RightShiftWithRounding(pred[x][y], 8).
 1126|  5.04M|  const __m128i pred = _mm_srli_epi16(_mm_add_epi16(pred_sum, *round), 8);
 1127|  5.04M|  StoreLo8(dst, _mm_packus_epi16(pred, pred));
 1128|  5.04M|}
intrapred_ssse3.c:smooth_directional_sum8:
 1115|  5.04M|    const __m128i pixels, const __m128i weights, const __m128i scaled_corner) {
 1116|  5.04M|  const __m128i weighted_px = _mm_mullo_epi16(pixels, weights);
 1117|  5.04M|  return _mm_add_epi16(scaled_corner, weighted_px);
 1118|  5.04M|}
intrapred_ssse3.c:cvtepu8_epi32:
  948|  2.88M|static AOM_FORCE_INLINE __m128i cvtepu8_epi32(__m128i x) {
  949|  2.88M|  const __m128i tmp = _mm_unpacklo_epi8((x), _mm_setzero_si128());
  950|  2.88M|  return _mm_unpacklo_epi16(tmp, _mm_setzero_si128());
  951|  2.88M|}
intrapred_ssse3.c:write_smooth_horizontal_sum4:
 2126|  6.52M|    const __m128i *scaled_top_right, const __m128i *round) {
 2127|  6.52M|  const __m128i weighted_left_y = _mm_mullo_epi16(*left_y, *weights);
 2128|  6.52M|  const __m128i pred_sum = _mm_add_epi32(*scaled_top_right, weighted_left_y);
 2129|       |  // Equivalent to RightShiftWithRounding(pred[x][y], 8).
 2130|  6.52M|  const __m128i pred = _mm_srli_epi32(_mm_add_epi32(pred_sum, *round), 8);
 2131|  6.52M|  const __m128i cvtepi32_epi8 = _mm_set1_epi32(0x0C080400);
 2132|  6.52M|  Store4(dst, _mm_shuffle_epi8(pred, cvtepi32_epi8));
 2133|  6.52M|}

intrapred_avx2.c:transpose16x16_sse2:
   94|  64.2k|static inline void transpose16x16_sse2(__m128i *x, __m128i *d) {
   95|  64.2k|  __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
   96|  64.2k|  __m128i w10, w11, w12, w13, w14, w15;
   97|       |
   98|  64.2k|  w0 = _mm_unpacklo_epi8(x[0], x[1]);
   99|  64.2k|  w1 = _mm_unpacklo_epi8(x[2], x[3]);
  100|  64.2k|  w2 = _mm_unpacklo_epi8(x[4], x[5]);
  101|  64.2k|  w3 = _mm_unpacklo_epi8(x[6], x[7]);
  102|       |
  103|  64.2k|  w8 = _mm_unpacklo_epi8(x[8], x[9]);
  104|  64.2k|  w9 = _mm_unpacklo_epi8(x[10], x[11]);
  105|  64.2k|  w10 = _mm_unpacklo_epi8(x[12], x[13]);
  106|  64.2k|  w11 = _mm_unpacklo_epi8(x[14], x[15]);
  107|       |
  108|  64.2k|  w4 = _mm_unpacklo_epi16(w0, w1);
  109|  64.2k|  w5 = _mm_unpacklo_epi16(w2, w3);
  110|  64.2k|  w12 = _mm_unpacklo_epi16(w8, w9);
  111|  64.2k|  w13 = _mm_unpacklo_epi16(w10, w11);
  112|       |
  113|  64.2k|  w6 = _mm_unpacklo_epi32(w4, w5);
  114|  64.2k|  w7 = _mm_unpackhi_epi32(w4, w5);
  115|  64.2k|  w14 = _mm_unpacklo_epi32(w12, w13);
  116|  64.2k|  w15 = _mm_unpackhi_epi32(w12, w13);
  117|       |
  118|       |  // Store first 4-line result
  119|  64.2k|  d[0] = _mm_unpacklo_epi64(w6, w14);
  120|  64.2k|  d[1] = _mm_unpackhi_epi64(w6, w14);
  121|  64.2k|  d[2] = _mm_unpacklo_epi64(w7, w15);
  122|  64.2k|  d[3] = _mm_unpackhi_epi64(w7, w15);
  123|       |
  124|  64.2k|  w4 = _mm_unpackhi_epi16(w0, w1);
  125|  64.2k|  w5 = _mm_unpackhi_epi16(w2, w3);
  126|  64.2k|  w12 = _mm_unpackhi_epi16(w8, w9);
  127|  64.2k|  w13 = _mm_unpackhi_epi16(w10, w11);
  128|       |
  129|  64.2k|  w6 = _mm_unpacklo_epi32(w4, w5);
  130|  64.2k|  w7 = _mm_unpackhi_epi32(w4, w5);
  131|  64.2k|  w14 = _mm_unpacklo_epi32(w12, w13);
  132|  64.2k|  w15 = _mm_unpackhi_epi32(w12, w13);
  133|       |
  134|       |  // Store second 4-line result
  135|  64.2k|  d[4] = _mm_unpacklo_epi64(w6, w14);
  136|  64.2k|  d[5] = _mm_unpackhi_epi64(w6, w14);
  137|  64.2k|  d[6] = _mm_unpacklo_epi64(w7, w15);
  138|  64.2k|  d[7] = _mm_unpackhi_epi64(w7, w15);
  139|       |
  140|       |  // upper half
  141|  64.2k|  w0 = _mm_unpackhi_epi8(x[0], x[1]);
  142|  64.2k|  w1 = _mm_unpackhi_epi8(x[2], x[3]);
  143|  64.2k|  w2 = _mm_unpackhi_epi8(x[4], x[5]);
  144|  64.2k|  w3 = _mm_unpackhi_epi8(x[6], x[7]);
  145|       |
  146|  64.2k|  w8 = _mm_unpackhi_epi8(x[8], x[9]);
  147|  64.2k|  w9 = _mm_unpackhi_epi8(x[10], x[11]);
  148|  64.2k|  w10 = _mm_unpackhi_epi8(x[12], x[13]);
  149|  64.2k|  w11 = _mm_unpackhi_epi8(x[14], x[15]);
  150|       |
  151|  64.2k|  w4 = _mm_unpacklo_epi16(w0, w1);
  152|  64.2k|  w5 = _mm_unpacklo_epi16(w2, w3);
  153|  64.2k|  w12 = _mm_unpacklo_epi16(w8, w9);
  154|  64.2k|  w13 = _mm_unpacklo_epi16(w10, w11);
  155|       |
  156|  64.2k|  w6 = _mm_unpacklo_epi32(w4, w5);
  157|  64.2k|  w7 = _mm_unpackhi_epi32(w4, w5);
  158|  64.2k|  w14 = _mm_unpacklo_epi32(w12, w13);
  159|  64.2k|  w15 = _mm_unpackhi_epi32(w12, w13);
  160|       |
  161|       |  // Store first 4-line result
  162|  64.2k|  d[8] = _mm_unpacklo_epi64(w6, w14);
  163|  64.2k|  d[9] = _mm_unpackhi_epi64(w6, w14);
  164|  64.2k|  d[10] = _mm_unpacklo_epi64(w7, w15);
  165|  64.2k|  d[11] = _mm_unpackhi_epi64(w7, w15);
  166|       |
  167|  64.2k|  w4 = _mm_unpackhi_epi16(w0, w1);
  168|  64.2k|  w5 = _mm_unpackhi_epi16(w2, w3);
  169|  64.2k|  w12 = _mm_unpackhi_epi16(w8, w9);
  170|  64.2k|  w13 = _mm_unpackhi_epi16(w10, w11);
  171|       |
  172|  64.2k|  w6 = _mm_unpacklo_epi32(w4, w5);
  173|  64.2k|  w7 = _mm_unpackhi_epi32(w4, w5);
  174|  64.2k|  w14 = _mm_unpacklo_epi32(w12, w13);
  175|  64.2k|  w15 = _mm_unpackhi_epi32(w12, w13);
  176|       |
  177|       |  // Store second 4-line result
  178|  64.2k|  d[12] = _mm_unpacklo_epi64(w6, w14);
  179|  64.2k|  d[13] = _mm_unpackhi_epi64(w6, w14);
  180|  64.2k|  d[14] = _mm_unpacklo_epi64(w7, w15);
  181|  64.2k|  d[15] = _mm_unpackhi_epi64(w7, w15);
  182|  64.2k|}

intrapred_sse2.c:dc_sum_16_sse2:
   19|   223k|static inline __m128i dc_sum_16_sse2(const uint8_t *ref) {
   20|   223k|  __m128i x = _mm_load_si128((__m128i const *)ref);
   21|   223k|  const __m128i zero = _mm_setzero_si128();
   22|   223k|  x = _mm_sad_epu8(x, zero);
   23|   223k|  const __m128i high = _mm_unpackhi_epi64(x, x);
   24|   223k|  return _mm_add_epi16(x, high);
   25|   223k|}
intrapred_sse2.c:dc_sum_32_sse2:
   27|  6.55k|static inline __m128i dc_sum_32_sse2(const uint8_t *ref) {
   28|  6.55k|  __m128i x0 = _mm_load_si128((__m128i const *)ref);
   29|  6.55k|  __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16));
   30|  6.55k|  const __m128i zero = _mm_setzero_si128();
   31|  6.55k|  x0 = _mm_sad_epu8(x0, zero);
   32|  6.55k|  x1 = _mm_sad_epu8(x1, zero);
   33|  6.55k|  x0 = _mm_add_epi16(x0, x1);
   34|  6.55k|  const __m128i high = _mm_unpackhi_epi64(x0, x0);
   35|  6.55k|  return _mm_add_epi16(x0, high);
   36|  6.55k|}
intrapred_avx2.c:dc_sum_32_sse2:
   27|    540|static inline __m128i dc_sum_32_sse2(const uint8_t *ref) {
   28|    540|  __m128i x0 = _mm_load_si128((__m128i const *)ref);
   29|    540|  __m128i x1 = _mm_load_si128((__m128i const *)(ref + 16));
   30|    540|  const __m128i zero = _mm_setzero_si128();
   31|    540|  x0 = _mm_sad_epu8(x0, zero);
   32|    540|  x1 = _mm_sad_epu8(x1, zero);
   33|    540|  x0 = _mm_add_epi16(x0, x1);
   34|    540|  const __m128i high = _mm_unpackhi_epi64(x0, x0);
   35|    540|  return _mm_add_epi16(x0, high);
   36|    540|}
intrapred_avx2.c:dc_sum_16_sse2:
   19|  2.61k|static inline __m128i dc_sum_16_sse2(const uint8_t *ref) {
   20|  2.61k|  __m128i x = _mm_load_si128((__m128i const *)ref);
   21|  2.61k|  const __m128i zero = _mm_setzero_si128();
   22|  2.61k|  x = _mm_sad_epu8(x, zero);
   23|  2.61k|  const __m128i high = _mm_unpackhi_epi64(x, x);
   24|  2.61k|  return _mm_add_epi16(x, high);
   25|  2.61k|}

aom_lpf_horizontal_6_quad_avx2:
   24|  93.2k|                                    const unsigned char *_thresh0) {
   25|  93.2k|  __m256i p256_2, q256_2, p256_1, q256_1, p256_0, q256_0;
   26|  93.2k|  __m128i p2, p1, p0, q0, q1, q2;
   27|  93.2k|  __m128i mask, flat;
   28|       |
   29|  93.2k|  const __m128i thresh_v =
   30|  93.2k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_thresh0[0]));
   31|  93.2k|  const __m128i limit_v =
   32|  93.2k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_limit0[0]));
   33|  93.2k|  const __m128i blimit_v =
   34|  93.2k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_blimit0[0]));
   35|  93.2k|  const __m128i zero = _mm_setzero_si128();
   36|  93.2k|  const __m128i ff = _mm_cmpeq_epi8(zero, zero);
   37|       |
   38|  93.2k|  p256_2 =
   39|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 3 * p)));
   40|  93.2k|  p256_1 =
   41|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 2 * p)));
   42|  93.2k|  p256_0 =
   43|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 1 * p)));
   44|  93.2k|  q256_0 =
   45|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 0 * p)));
   46|  93.2k|  q256_1 =
   47|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 1 * p)));
   48|  93.2k|  q256_2 =
   49|  93.2k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 2 * p)));
   50|       |
   51|  93.2k|  p2 = _mm256_castsi256_si128(p256_2);
   52|  93.2k|  p1 = _mm256_castsi256_si128(p256_1);
   53|  93.2k|  p0 = _mm256_castsi256_si128(p256_0);
   54|  93.2k|  q0 = _mm256_castsi256_si128(q256_0);
   55|  93.2k|  q1 = _mm256_castsi256_si128(q256_1);
   56|  93.2k|  q2 = _mm256_castsi256_si128(q256_2);
   57|       |
   58|  93.2k|  {
   59|  93.2k|    __m128i work;
   60|  93.2k|    const __m128i fe = _mm_set1_epi8((int8_t)0xfe);
   61|  93.2k|    const __m128i abs_p1p0 =
   62|  93.2k|        _mm_or_si128(_mm_subs_epu8(p1, p0), _mm_subs_epu8(p0, p1));
   63|  93.2k|    const __m128i abs_q1q0 =
   64|  93.2k|        _mm_or_si128(_mm_subs_epu8(q1, q0), _mm_subs_epu8(q0, q1));
   65|  93.2k|    __m128i abs_p0q0 =
   66|  93.2k|        _mm_or_si128(_mm_subs_epu8(p0, q0), _mm_subs_epu8(q0, p0));
   67|  93.2k|    __m128i abs_p1q1 =
   68|  93.2k|        _mm_or_si128(_mm_subs_epu8(p1, q1), _mm_subs_epu8(q1, p1));
   69|       |
   70|  93.2k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
   71|       |
   72|  93.2k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
   73|  93.2k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
   74|  93.2k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit_v);
   75|  93.2k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
   76|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
   77|  93.2k|    mask = _mm_max_epu8(flat, mask);
   78|       |    // mask |= (abs(p1 - p0) > limit) * -1;
   79|       |    // mask |= (abs(q1 - q0) > limit) * -1;
   80|  93.2k|    work = _mm_max_epu8(
   81|  93.2k|        _mm_or_si128(_mm_subs_epu8(p2, p1), _mm_subs_epu8(p1, p2)),
   82|  93.2k|        _mm_or_si128(_mm_subs_epu8(q2, q1), _mm_subs_epu8(q1, q2)));
   83|  93.2k|    mask = _mm_max_epu8(work, mask);
   84|  93.2k|    mask = _mm_subs_epu8(mask, limit_v);
   85|  93.2k|    mask = _mm_cmpeq_epi8(mask, zero);
   86|  93.2k|  }
   87|       |
   88|  93.2k|  if (0xffff == _mm_movemask_epi8(_mm_cmpeq_epi8(mask, zero))) return;
  ------------------
  |  Branch (88:7): [True: 17.2k, False: 75.9k]
  ------------------
   89|       |
   90|       |  // loop filter
   91|  75.9k|  {
   92|  75.9k|    const __m128i t4 = _mm_set1_epi8(4);
   93|  75.9k|    const __m128i t3 = _mm_set1_epi8(3);
   94|  75.9k|    const __m128i t80 = _mm_set1_epi8((int8_t)0x80);
   95|  75.9k|    const __m128i te0 = _mm_set1_epi8((int8_t)0xe0);
   96|  75.9k|    const __m128i t1f = _mm_set1_epi8(0x1f);
   97|  75.9k|    const __m128i t1 = _mm_set1_epi8(0x1);
   98|  75.9k|    const __m128i t7f = _mm_set1_epi8(0x7f);
   99|  75.9k|    const __m128i one = _mm_set1_epi8(1);
  100|  75.9k|    __m128i hev;
  101|       |
  102|  75.9k|    hev = _mm_subs_epu8(flat, thresh_v);
  103|  75.9k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
  104|       |
  105|  75.9k|    __m128i ps1 = _mm_xor_si128(p1, t80);
  106|  75.9k|    __m128i ps0 = _mm_xor_si128(p0, t80);
  107|  75.9k|    __m128i qs0 = _mm_xor_si128(q0, t80);
  108|  75.9k|    __m128i qs1 = _mm_xor_si128(q1, t80);
  109|  75.9k|    __m128i filt;
  110|  75.9k|    __m128i work_a;
  111|  75.9k|    __m128i filter1, filter2;
  112|  75.9k|    __m128i flat_p1, flat_p0, flat_q0, flat_q1;
  113|       |
  114|  75.9k|    filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev);
  115|  75.9k|    work_a = _mm_subs_epi8(qs0, ps0);
  116|  75.9k|    filt = _mm_adds_epi8(filt, work_a);
  117|  75.9k|    filt = _mm_adds_epi8(filt, work_a);
  118|  75.9k|    filt = _mm_adds_epi8(filt, work_a);
  119|  75.9k|    filt = _mm_and_si128(filt, mask);
  120|       |
  121|  75.9k|    filter1 = _mm_adds_epi8(filt, t4);
  122|  75.9k|    filter2 = _mm_adds_epi8(filt, t3);
  123|       |
  124|  75.9k|    work_a = _mm_cmpgt_epi8(zero, filter1);
  125|  75.9k|    filter1 = _mm_srli_epi16(filter1, 3);
  126|  75.9k|    work_a = _mm_and_si128(work_a, te0);
  127|  75.9k|    filter1 = _mm_and_si128(filter1, t1f);
  128|  75.9k|    filter1 = _mm_or_si128(filter1, work_a);
  129|  75.9k|    qs0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
  130|       |
  131|  75.9k|    work_a = _mm_cmpgt_epi8(zero, filter2);
  132|  75.9k|    filter2 = _mm_srli_epi16(filter2, 3);
  133|  75.9k|    work_a = _mm_and_si128(work_a, te0);
  134|  75.9k|    filter2 = _mm_and_si128(filter2, t1f);
  135|  75.9k|    filter2 = _mm_or_si128(filter2, work_a);
  136|  75.9k|    ps0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
  137|       |
  138|  75.9k|    filt = _mm_adds_epi8(filter1, t1);
  139|  75.9k|    work_a = _mm_cmpgt_epi8(zero, filt);
  140|  75.9k|    filt = _mm_srli_epi16(filt, 1);
  141|  75.9k|    work_a = _mm_and_si128(work_a, t80);
  142|  75.9k|    filt = _mm_and_si128(filt, t7f);
  143|  75.9k|    filt = _mm_or_si128(filt, work_a);
  144|  75.9k|    filt = _mm_andnot_si128(hev, filt);
  145|  75.9k|    ps1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
  146|  75.9k|    qs1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
  147|       |
  148|  75.9k|    __m128i work;
  149|  75.9k|    work = _mm_max_epu8(
  150|  75.9k|        _mm_or_si128(_mm_subs_epu8(p2, p0), _mm_subs_epu8(p0, p2)),
  151|  75.9k|        _mm_or_si128(_mm_subs_epu8(q2, q0), _mm_subs_epu8(q0, q2)));
  152|  75.9k|    flat = _mm_max_epu8(work, flat);
  153|  75.9k|    flat = _mm_subs_epu8(flat, one);
  154|  75.9k|    flat = _mm_cmpeq_epi8(flat, zero);
  155|  75.9k|    flat = _mm_and_si128(flat, mask);
  156|       |
  157|  75.9k|    if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (157:9): [True: 41.3k, False: 34.6k]
  ------------------
  158|  41.3k|      const __m256i four = _mm256_set1_epi16(4);
  159|  41.3k|      __m256i pixetFilter, add, res;
  160|       |
  161|  41.3k|      const __m256i filter =
  162|  41.3k|          _mm256_load_si256((__m256i const *)filt_loopfilter_avx2);
  163|       |
  164|  41.3k|      p256_2 = _mm256_shuffle_epi8(p256_2, filter);
  165|  41.3k|      p256_1 = _mm256_shuffle_epi8(p256_1, filter);
  166|  41.3k|      p256_0 = _mm256_shuffle_epi8(p256_0, filter);
  167|  41.3k|      q256_0 = _mm256_shuffle_epi8(q256_0, filter);
  168|  41.3k|      q256_1 = _mm256_shuffle_epi8(q256_1, filter);
  169|  41.3k|      q256_2 = _mm256_shuffle_epi8(q256_2, filter);
  170|       |
  171|  41.3k|      pixetFilter = _mm256_slli_epi16(
  172|  41.3k|          _mm256_add_epi16(p256_2, _mm256_add_epi16(p256_1, p256_0)), 1);
  173|  41.3k|      pixetFilter =
  174|  41.3k|          _mm256_add_epi16(pixetFilter, _mm256_add_epi16(p256_2, q256_0));
  175|  41.3k|      pixetFilter = _mm256_add_epi16(four, pixetFilter);
  176|  41.3k|      res = _mm256_srli_epi16(pixetFilter, 3);
  177|  41.3k|      flat_p1 = _mm256_castsi256_si128(
  178|  41.3k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res, res), 168));
  179|  41.3k|      p1 = _mm_andnot_si128(flat, ps1);
  180|  41.3k|      flat_p1 = _mm_and_si128(flat, flat_p1);
  181|  41.3k|      p1 = _mm_or_si128(flat_p1, p1);
  182|       |
  183|  41.3k|      add = _mm256_add_epi16(_mm256_sub_epi16(q256_1, p256_2),
  184|  41.3k|                             _mm256_sub_epi16(q256_0, p256_2));
  185|  41.3k|      pixetFilter = _mm256_add_epi16(pixetFilter, add);
  186|  41.3k|      res = _mm256_srli_epi16(pixetFilter, 3);
  187|  41.3k|      flat_p0 = _mm256_castsi256_si128(
  188|  41.3k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res, res), 168));
  189|  41.3k|      p0 = _mm_andnot_si128(flat, ps0);
  190|  41.3k|      flat_p0 = _mm_and_si128(flat, flat_p0);
  191|  41.3k|      p0 = _mm_or_si128(flat_p0, p0);
  192|       |
  193|  41.3k|      add = _mm256_add_epi16(_mm256_sub_epi16(q256_2, p256_2),
  194|  41.3k|                             _mm256_sub_epi16(q256_1, p256_1));
  195|  41.3k|      pixetFilter = _mm256_add_epi16(pixetFilter, add);
  196|  41.3k|      res = _mm256_srli_epi16(pixetFilter, 3);
  197|  41.3k|      flat_q0 = _mm256_castsi256_si128(
  198|  41.3k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res, res), 168));
  199|  41.3k|      q0 = _mm_andnot_si128(flat, qs0);
  200|  41.3k|      flat_q0 = _mm_and_si128(flat, flat_q0);
  201|  41.3k|      q0 = _mm_or_si128(flat_q0, q0);
  202|       |
  203|  41.3k|      add = _mm256_add_epi16(_mm256_sub_epi16(q256_2, p256_1),
  204|  41.3k|                             _mm256_sub_epi16(q256_2, p256_0));
  205|  41.3k|      pixetFilter = _mm256_add_epi16(pixetFilter, add);
  206|  41.3k|      res = _mm256_srli_epi16(pixetFilter, 3);
  207|  41.3k|      flat_q1 = _mm256_castsi256_si128(
  208|  41.3k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res, res), 168));
  209|  41.3k|      q1 = _mm_andnot_si128(flat, qs1);
  210|  41.3k|      flat_q1 = _mm_and_si128(flat, flat_q1);
  211|  41.3k|      q1 = _mm_or_si128(flat_q1, q1);
  212|       |
  213|  41.3k|      _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
  214|  41.3k|      _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
  215|  41.3k|      _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
  216|  41.3k|      _mm_storeu_si128((__m128i *)(s - 0 * p), q0);
  217|  41.3k|      _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
  218|  41.3k|      _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
  219|  41.3k|    } else {
  220|  34.6k|      _mm_storeu_si128((__m128i *)(s - 2 * p), ps1);
  221|  34.6k|      _mm_storeu_si128((__m128i *)(s - 1 * p), ps0);
  222|  34.6k|      _mm_storeu_si128((__m128i *)(s - 0 * p), qs0);
  223|  34.6k|      _mm_storeu_si128((__m128i *)(s + 1 * p), qs1);
  224|  34.6k|    }
  225|  75.9k|  }
  226|  75.9k|}
aom_lpf_horizontal_8_quad_avx2:
  231|   324k|                                    const unsigned char *_thresh0) {
  232|   324k|  __m256i p256_3, q256_3, p256_2, q256_2, p256_1, q256_1, p256_0, q256_0;
  233|   324k|  __m128i p3, p2, p1, p0, q0, q1, q2, q3;
  234|   324k|  __m128i mask, flat;
  235|       |
  236|   324k|  const __m128i thresh_v =
  237|   324k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_thresh0[0]));
  238|   324k|  const __m128i limit_v =
  239|   324k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_limit0[0]));
  240|   324k|  const __m128i blimit_v =
  241|   324k|      _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_blimit0[0]));
  242|   324k|  const __m128i zero = _mm_setzero_si128();
  243|   324k|  const __m128i ff = _mm_cmpeq_epi8(zero, zero);
  244|       |
  245|   324k|  p256_3 =
  246|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 4 * p)));
  247|   324k|  p256_2 =
  248|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 3 * p)));
  249|   324k|  p256_1 =
  250|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 2 * p)));
  251|   324k|  p256_0 =
  252|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 1 * p)));
  253|   324k|  q256_0 =
  254|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 0 * p)));
  255|   324k|  q256_1 =
  256|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 1 * p)));
  257|   324k|  q256_2 =
  258|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 2 * p)));
  259|   324k|  q256_3 =
  260|   324k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 3 * p)));
  261|       |
  262|   324k|  p3 = _mm256_castsi256_si128(p256_3);
  263|   324k|  p2 = _mm256_castsi256_si128(p256_2);
  264|   324k|  p1 = _mm256_castsi256_si128(p256_1);
  265|   324k|  p0 = _mm256_castsi256_si128(p256_0);
  266|   324k|  q0 = _mm256_castsi256_si128(q256_0);
  267|   324k|  q1 = _mm256_castsi256_si128(q256_1);
  268|   324k|  q2 = _mm256_castsi256_si128(q256_2);
  269|   324k|  q3 = _mm256_castsi256_si128(q256_3);
  270|       |
  271|   324k|  {
  272|   324k|    __m128i work;
  273|   324k|    const __m128i fe = _mm_set1_epi8((int8_t)0xfe);
  274|   324k|    const __m128i abs_p1p0 =
  275|   324k|        _mm_or_si128(_mm_subs_epu8(p1, p0), _mm_subs_epu8(p0, p1));
  276|   324k|    const __m128i abs_q1q0 =
  277|   324k|        _mm_or_si128(_mm_subs_epu8(q1, q0), _mm_subs_epu8(q0, q1));
  278|   324k|    __m128i abs_p0q0 =
  279|   324k|        _mm_or_si128(_mm_subs_epu8(p0, q0), _mm_subs_epu8(q0, p0));
  280|   324k|    __m128i abs_p1q1 =
  281|   324k|        _mm_or_si128(_mm_subs_epu8(p1, q1), _mm_subs_epu8(q1, p1));
  282|       |
  283|   324k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
  284|       |
  285|   324k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
  286|   324k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
  287|   324k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit_v);
  288|   324k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
  289|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
  290|   324k|    mask = _mm_max_epu8(flat, mask);
  291|       |    // mask |= (abs(p1 - p0) > limit) * -1;
  292|       |    // mask |= (abs(q1 - q0) > limit) * -1;
  293|   324k|    work = _mm_max_epu8(
  294|   324k|        _mm_or_si128(_mm_subs_epu8(p2, p1), _mm_subs_epu8(p1, p2)),
  295|   324k|        _mm_or_si128(_mm_subs_epu8(p3, p2), _mm_subs_epu8(p2, p3)));
  296|   324k|    mask = _mm_max_epu8(work, mask);
  297|   324k|    work = _mm_max_epu8(
  298|   324k|        _mm_or_si128(_mm_subs_epu8(q2, q1), _mm_subs_epu8(q1, q2)),
  299|   324k|        _mm_or_si128(_mm_subs_epu8(q3, q2), _mm_subs_epu8(q2, q3)));
  300|   324k|    mask = _mm_max_epu8(work, mask);
  301|   324k|    mask = _mm_subs_epu8(mask, limit_v);
  302|   324k|    mask = _mm_cmpeq_epi8(mask, zero);
  303|   324k|  }
  304|       |
  305|   324k|  if (0xffff == _mm_movemask_epi8(_mm_cmpeq_epi8(mask, zero))) return;
  ------------------
  |  Branch (305:7): [True: 110k, False: 213k]
  ------------------
  306|       |
  307|       |  // loop filter
  308|   213k|  {
  309|   213k|    const __m128i t4 = _mm_set1_epi8(4);
  310|   213k|    const __m128i t3 = _mm_set1_epi8(3);
  311|   213k|    const __m128i t80 = _mm_set1_epi8((int8_t)0x80);
  312|   213k|    const __m128i te0 = _mm_set1_epi8((int8_t)0xe0);
  313|   213k|    const __m128i t1f = _mm_set1_epi8(0x1f);
  314|   213k|    const __m128i t1 = _mm_set1_epi8(0x1);
  315|   213k|    const __m128i t7f = _mm_set1_epi8(0x7f);
  316|   213k|    const __m128i one = _mm_set1_epi8(1);
  317|   213k|    __m128i hev;
  318|       |
  319|   213k|    hev = _mm_subs_epu8(flat, thresh_v);
  320|   213k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
  321|       |
  322|   213k|    __m128i ps1 = _mm_xor_si128(p1, t80);
  323|   213k|    __m128i ps0 = _mm_xor_si128(p0, t80);
  324|   213k|    __m128i qs0 = _mm_xor_si128(q0, t80);
  325|   213k|    __m128i qs1 = _mm_xor_si128(q1, t80);
  326|   213k|    __m128i filt;
  327|   213k|    __m128i work_a;
  328|   213k|    __m128i filter1, filter2;
  329|   213k|    __m128i flat_p2, flat_p1, flat_p0, flat_q0, flat_q1, flat_q2;
  330|       |
  331|   213k|    filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev);
  332|   213k|    work_a = _mm_subs_epi8(qs0, ps0);
  333|   213k|    filt = _mm_adds_epi8(filt, work_a);
  334|   213k|    filt = _mm_adds_epi8(filt, work_a);
  335|   213k|    filt = _mm_adds_epi8(filt, work_a);
  336|   213k|    filt = _mm_and_si128(filt, mask);
  337|       |
  338|   213k|    filter1 = _mm_adds_epi8(filt, t4);
  339|   213k|    filter2 = _mm_adds_epi8(filt, t3);
  340|       |
  341|   213k|    work_a = _mm_cmpgt_epi8(zero, filter1);
  342|   213k|    filter1 = _mm_srli_epi16(filter1, 3);
  343|   213k|    work_a = _mm_and_si128(work_a, te0);
  344|   213k|    filter1 = _mm_and_si128(filter1, t1f);
  345|   213k|    filter1 = _mm_or_si128(filter1, work_a);
  346|   213k|    qs0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
  347|       |
  348|   213k|    work_a = _mm_cmpgt_epi8(zero, filter2);
  349|   213k|    filter2 = _mm_srli_epi16(filter2, 3);
  350|   213k|    work_a = _mm_and_si128(work_a, te0);
  351|   213k|    filter2 = _mm_and_si128(filter2, t1f);
  352|   213k|    filter2 = _mm_or_si128(filter2, work_a);
  353|   213k|    ps0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
  354|       |
  355|   213k|    filt = _mm_adds_epi8(filter1, t1);
  356|   213k|    work_a = _mm_cmpgt_epi8(zero, filt);
  357|   213k|    filt = _mm_srli_epi16(filt, 1);
  358|   213k|    work_a = _mm_and_si128(work_a, t80);
  359|   213k|    filt = _mm_and_si128(filt, t7f);
  360|   213k|    filt = _mm_or_si128(filt, work_a);
  361|   213k|    filt = _mm_andnot_si128(hev, filt);
  362|   213k|    ps1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
  363|   213k|    qs1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
  364|       |
  365|   213k|    __m128i work;
  366|   213k|    work = _mm_max_epu8(
  367|   213k|        _mm_or_si128(_mm_subs_epu8(p2, p0), _mm_subs_epu8(p0, p2)),
  368|   213k|        _mm_or_si128(_mm_subs_epu8(q2, q0), _mm_subs_epu8(q0, q2)));
  369|   213k|    flat = _mm_max_epu8(work, flat);
  370|   213k|    work = _mm_max_epu8(
  371|   213k|        _mm_or_si128(_mm_subs_epu8(p3, p0), _mm_subs_epu8(p0, p3)),
  372|   213k|        _mm_or_si128(_mm_subs_epu8(q3, q0), _mm_subs_epu8(q0, q3)));
  373|   213k|    flat = _mm_max_epu8(work, flat);
  374|   213k|    flat = _mm_subs_epu8(flat, one);
  375|   213k|    flat = _mm_cmpeq_epi8(flat, zero);
  376|   213k|    flat = _mm_and_si128(flat, mask);
  377|       |
  378|   213k|    if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (378:9): [True: 55.9k, False: 157k]
  ------------------
  379|  55.9k|      const __m256i four = _mm256_set1_epi16(4);
  380|  55.9k|      __m256i pixetFilter_p2p1p0, p2p1p0, q2q1q0, pixetFilter_q2q1q0, sum_p,
  381|  55.9k|          sum_q, res_p, res_q;
  382|       |
  383|  55.9k|      const __m256i filter =
  384|  55.9k|          _mm256_load_si256((__m256i const *)filt_loopfilter_avx2);
  385|       |
  386|  55.9k|      p256_3 = _mm256_shuffle_epi8(p256_3, filter);
  387|  55.9k|      p256_2 = _mm256_shuffle_epi8(p256_2, filter);
  388|  55.9k|      p256_1 = _mm256_shuffle_epi8(p256_1, filter);
  389|  55.9k|      p256_0 = _mm256_shuffle_epi8(p256_0, filter);
  390|  55.9k|      q256_0 = _mm256_shuffle_epi8(q256_0, filter);
  391|  55.9k|      q256_1 = _mm256_shuffle_epi8(q256_1, filter);
  392|  55.9k|      q256_2 = _mm256_shuffle_epi8(q256_2, filter);
  393|  55.9k|      q256_3 = _mm256_shuffle_epi8(q256_3, filter);
  394|       |
  395|  55.9k|      p2p1p0 = _mm256_add_epi16(p256_0, _mm256_add_epi16(p256_2, p256_1));
  396|  55.9k|      q2q1q0 = _mm256_add_epi16(q256_0, _mm256_add_epi16(q256_2, q256_1));
  397|       |
  398|  55.9k|      pixetFilter_p2p1p0 =
  399|  55.9k|          _mm256_add_epi16(four, _mm256_add_epi16(p2p1p0, q2q1q0));
  400|  55.9k|      pixetFilter_q2q1q0 = pixetFilter_p2p1p0;
  401|       |
  402|  55.9k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, p256_3);
  403|  55.9k|      res_p =
  404|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_0), 3);
  405|  55.9k|      flat_p0 = _mm256_castsi256_si128(
  406|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), 168));
  407|  55.9k|      p0 = _mm_andnot_si128(flat, ps0);
  408|  55.9k|      flat_p0 = _mm_and_si128(flat, flat_p0);
  409|  55.9k|      p0 = _mm_or_si128(flat_p0, p0);
  410|       |
  411|  55.9k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, q256_3);
  412|  55.9k|      res_q =
  413|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_0), 3);
  414|  55.9k|      flat_q0 = _mm256_castsi256_si128(
  415|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), 168));
  416|  55.9k|      q0 = _mm_andnot_si128(flat, qs0);
  417|  55.9k|      flat_q0 = _mm_and_si128(flat, flat_q0);
  418|  55.9k|      q0 = _mm_or_si128(flat_q0, q0);
  419|       |
  420|  55.9k|      sum_p = _mm256_sub_epi16(p256_3, q256_2);
  421|  55.9k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, sum_p);
  422|  55.9k|      res_p =
  423|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_1), 3);
  424|  55.9k|      flat_p1 = _mm256_castsi256_si128(
  425|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), 168));
  426|  55.9k|      p1 = _mm_andnot_si128(flat, ps1);
  427|  55.9k|      flat_p1 = _mm_and_si128(flat, flat_p1);
  428|  55.9k|      p1 = _mm_or_si128(flat_p1, p1);
  429|       |
  430|  55.9k|      sum_q = _mm256_sub_epi16(q256_3, p256_2);
  431|  55.9k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, sum_q);
  432|  55.9k|      res_q =
  433|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_1), 3);
  434|  55.9k|      flat_q1 = _mm256_castsi256_si128(
  435|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), 168));
  436|  55.9k|      q1 = _mm_andnot_si128(flat, qs1);
  437|  55.9k|      flat_q1 = _mm_and_si128(flat, flat_q1);
  438|  55.9k|      q1 = _mm_or_si128(flat_q1, q1);
  439|       |
  440|  55.9k|      sum_p = _mm256_sub_epi16(p256_3, q256_1);
  441|  55.9k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, sum_p);
  442|  55.9k|      res_p =
  443|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_2), 3);
  444|  55.9k|      flat_p2 = _mm256_castsi256_si128(
  445|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_p), 168));
  446|  55.9k|      p2 = _mm_andnot_si128(flat, p2);
  447|  55.9k|      flat_p2 = _mm_and_si128(flat, flat_p2);
  448|  55.9k|      p2 = _mm_or_si128(flat_p2, p2);
  449|       |
  450|  55.9k|      sum_q = _mm256_sub_epi16(q256_3, p256_1);
  451|  55.9k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, sum_q);
  452|  55.9k|      res_q =
  453|  55.9k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_2), 3);
  454|  55.9k|      flat_q2 = _mm256_castsi256_si128(
  455|  55.9k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_q, res_q), 168));
  456|  55.9k|      q2 = _mm_andnot_si128(flat, q2);
  457|  55.9k|      flat_q2 = _mm_and_si128(flat, flat_q2);
  458|  55.9k|      q2 = _mm_or_si128(flat_q2, q2);
  459|       |
  460|  55.9k|      _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
  461|  55.9k|      _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
  462|  55.9k|      _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
  463|  55.9k|      _mm_storeu_si128((__m128i *)(s - 0 * p), q0);
  464|  55.9k|      _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
  465|  55.9k|      _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
  466|   157k|    } else {
  467|   157k|      _mm_storeu_si128((__m128i *)(s - 2 * p), ps1);
  468|   157k|      _mm_storeu_si128((__m128i *)(s - 1 * p), ps0);
  469|   157k|      _mm_storeu_si128((__m128i *)(s - 0 * p), qs0);
  470|   157k|      _mm_storeu_si128((__m128i *)(s + 1 * p), qs1);
  471|   157k|    }
  472|   213k|  }
  473|   213k|}
aom_lpf_horizontal_14_quad_avx2:
  595|   180k|                                     const unsigned char *_thresh0) {
  596|   180k|  __m128i mask, flat;
  597|   180k|  const __m128i zero = _mm_setzero_si128();
  598|   180k|  const __m128i ff = _mm_cmpeq_epi8(zero, zero);
  599|       |
  600|   180k|  __m256i p256_3 =
  601|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 4 * p)));
  602|   180k|  __m256i p256_2 =
  603|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 3 * p)));
  604|   180k|  __m256i p256_1 =
  605|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 2 * p)));
  606|   180k|  __m256i p256_0 =
  607|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 1 * p)));
  608|   180k|  __m256i q256_0 =
  609|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s - 0 * p)));
  610|   180k|  __m256i q256_1 =
  611|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 1 * p)));
  612|   180k|  __m256i q256_2 =
  613|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 2 * p)));
  614|   180k|  __m256i q256_3 =
  615|   180k|      _mm256_castpd_si256(_mm256_broadcast_pd((__m128d const *)(s + 3 * p)));
  616|       |
  617|   180k|  __m128i p3 = _mm256_castsi256_si128(p256_3);
  618|   180k|  __m128i p2 = _mm256_castsi256_si128(p256_2);
  619|   180k|  __m128i p1 = _mm256_castsi256_si128(p256_1);
  620|   180k|  __m128i p0 = _mm256_castsi256_si128(p256_0);
  621|   180k|  __m128i q0 = _mm256_castsi256_si128(q256_0);
  622|   180k|  __m128i q1 = _mm256_castsi256_si128(q256_1);
  623|   180k|  __m128i q2 = _mm256_castsi256_si128(q256_2);
  624|   180k|  __m128i q3 = _mm256_castsi256_si128(q256_3);
  625|       |
  626|   180k|  {
  627|   180k|    const __m128i limit_v =
  628|   180k|        _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_limit0[0]));
  629|   180k|    const __m128i blimit_v =
  630|   180k|        _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_blimit0[0]));
  631|   180k|    const __m128i fe = _mm_set1_epi8((int8_t)0xfe);
  632|   180k|    const __m128i abs_p1p0 =
  633|   180k|        _mm_or_si128(_mm_subs_epu8(p1, p0), _mm_subs_epu8(p0, p1));
  634|   180k|    const __m128i abs_q1q0 =
  635|   180k|        _mm_or_si128(_mm_subs_epu8(q1, q0), _mm_subs_epu8(q0, q1));
  636|   180k|    __m128i abs_p0q0 =
  637|   180k|        _mm_or_si128(_mm_subs_epu8(p0, q0), _mm_subs_epu8(q0, p0));
  638|   180k|    __m128i abs_p1q1 =
  639|   180k|        _mm_or_si128(_mm_subs_epu8(p1, q1), _mm_subs_epu8(q1, p1));
  640|       |
  641|   180k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
  642|       |
  643|   180k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
  644|   180k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
  645|   180k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit_v);
  646|   180k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
  647|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
  648|   180k|    mask = _mm_max_epu8(flat, mask);
  649|       |    // mask |= (abs(p1 - p0) > limit) * -1;
  650|       |    // mask |= (abs(q1 - q0) > limit) * -1;
  651|   180k|    __m128i work = _mm_max_epu8(
  652|   180k|        _mm_or_si128(_mm_subs_epu8(p2, p1), _mm_subs_epu8(p1, p2)),
  653|   180k|        _mm_or_si128(_mm_subs_epu8(p3, p2), _mm_subs_epu8(p2, p3)));
  654|   180k|    mask = _mm_max_epu8(work, mask);
  655|   180k|    work = _mm_max_epu8(
  656|   180k|        _mm_or_si128(_mm_subs_epu8(q2, q1), _mm_subs_epu8(q1, q2)),
  657|   180k|        _mm_or_si128(_mm_subs_epu8(q3, q2), _mm_subs_epu8(q2, q3)));
  658|   180k|    mask = _mm_max_epu8(work, mask);
  659|   180k|    mask = _mm_subs_epu8(mask, limit_v);
  660|   180k|    mask = _mm_cmpeq_epi8(mask, zero);
  661|   180k|  }
  662|       |
  663|   180k|  if (0xffff == _mm_movemask_epi8(_mm_cmpeq_epi8(mask, zero))) return;
  ------------------
  |  Branch (663:7): [True: 67.9k, False: 112k]
  ------------------
  664|       |
  665|       |  // loop filter
  666|   112k|  {
  667|   112k|    const __m128i thresh_v =
  668|   112k|        _mm_broadcastb_epi8(_mm_cvtsi32_si128((int)_thresh0[0]));
  669|   112k|    const __m128i one = _mm_set1_epi8(1);
  670|   112k|    const __m128i t3 = _mm_set1_epi8(3);
  671|   112k|    const __m128i t4 = _mm_add_epi8(one, t3);
  672|   112k|    const __m128i t80 = _mm_set1_epi8((int8_t)0x80);
  673|   112k|    const __m128i te0 = _mm_set1_epi8((int8_t)0xe0);
  674|   112k|    const __m128i t1f = _mm_set1_epi8(0x1f);
  675|   112k|    const __m128i t7f = _mm_sub_epi8(t80, one);
  676|       |
  677|   112k|    __m128i hev = _mm_subs_epu8(flat, thresh_v);
  678|   112k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
  679|       |
  680|   112k|    __m128i ps1 = _mm_xor_si128(p1, t80);
  681|   112k|    __m128i ps0 = _mm_xor_si128(p0, t80);
  682|   112k|    __m128i qs0 = _mm_xor_si128(q0, t80);
  683|   112k|    __m128i qs1 = _mm_xor_si128(q1, t80);
  684|       |
  685|   112k|    __m128i filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev);
  686|   112k|    __m128i work_a = _mm_subs_epi8(qs0, ps0);
  687|   112k|    filt = _mm_adds_epi8(filt, work_a);
  688|   112k|    filt = _mm_adds_epi8(filt, work_a);
  689|   112k|    filt = _mm_adds_epi8(filt, work_a);
  690|   112k|    filt = _mm_and_si128(filt, mask);
  691|       |
  692|   112k|    __m128i filter1 = _mm_adds_epi8(filt, t4);
  693|   112k|    __m128i filter2 = _mm_adds_epi8(filt, t3);
  694|       |
  695|   112k|    work_a = _mm_cmpgt_epi8(zero, filter1);
  696|   112k|    filter1 = _mm_srli_epi16(filter1, 3);
  697|   112k|    work_a = _mm_and_si128(work_a, te0);
  698|   112k|    filter1 = _mm_and_si128(filter1, t1f);
  699|   112k|    filter1 = _mm_or_si128(filter1, work_a);
  700|   112k|    qs0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
  701|       |
  702|   112k|    work_a = _mm_cmpgt_epi8(zero, filter2);
  703|   112k|    filter2 = _mm_srli_epi16(filter2, 3);
  704|   112k|    work_a = _mm_and_si128(work_a, te0);
  705|   112k|    filter2 = _mm_and_si128(filter2, t1f);
  706|   112k|    filter2 = _mm_or_si128(filter2, work_a);
  707|   112k|    ps0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
  708|       |
  709|   112k|    filt = _mm_adds_epi8(filter1, one);
  710|   112k|    work_a = _mm_cmpgt_epi8(zero, filt);
  711|   112k|    filt = _mm_srli_epi16(filt, 1);
  712|   112k|    work_a = _mm_and_si128(work_a, t80);
  713|   112k|    filt = _mm_and_si128(filt, t7f);
  714|   112k|    filt = _mm_or_si128(filt, work_a);
  715|   112k|    filt = _mm_andnot_si128(hev, filt);
  716|   112k|    ps1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
  717|   112k|    qs1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
  718|       |
  719|       |    // Derive flat
  720|   112k|    __m256i p0q0256 = _mm256_blend_epi32(p256_0, q256_0, 0xf0);
  721|   112k|    __m256i p2q2256 = _mm256_blend_epi32(p256_2, q256_2, 0xf0);
  722|   112k|    __m256i p3q3256 = _mm256_blend_epi32(p256_3, q256_3, 0xf0);
  723|   112k|    const __m256i ps0qs0256 =
  724|   112k|        _mm256_insertf128_si256(_mm256_castsi128_si256(ps0), qs0, 0x1);
  725|   112k|    const __m256i ps1qs1256 =
  726|   112k|        _mm256_insertf128_si256(_mm256_castsi128_si256(ps1), qs1, 0x1);
  727|   112k|    const __m256i work01 = _mm256_or_si256(_mm256_subs_epu8(p2q2256, p0q0256),
  728|   112k|                                           _mm256_subs_epu8(p0q0256, p2q2256));
  729|   112k|    const __m256i work02 = _mm256_or_si256(_mm256_subs_epu8(p3q3256, p0q0256),
  730|   112k|                                           _mm256_subs_epu8(p0q0256, p3q3256));
  731|   112k|    const __m256i max0_256 = _mm256_max_epu8(work01, work02);
  732|   112k|    const __m128i max1_256 =
  733|   112k|        _mm_max_epu8(_mm256_castsi256_si128(max0_256),
  734|   112k|                     _mm256_extractf128_si256(max0_256, 1));
  735|   112k|    flat = _mm_max_epu8(max1_256, flat);
  736|   112k|    flat = _mm_subs_epu8(flat, one);
  737|   112k|    flat = _mm_cmpeq_epi8(flat, zero);
  738|   112k|    flat = _mm_and_si128(flat, mask);
  739|       |
  740|       |    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  741|       |    // flat and wide flat calculations
  742|   112k|    if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (742:9): [True: 38.1k, False: 74.6k]
  ------------------
  743|  38.1k|      const __m256i flat256 =
  744|  38.1k|          _mm256_insertf128_si256(_mm256_castsi128_si256(flat), flat, 0x1);
  745|  38.1k|      const __m256i eight = _mm256_set1_epi16(8);
  746|  38.1k|      const __m256i four = _mm256_set1_epi16(4);
  747|       |
  748|  38.1k|      __m256i p256_4 = _mm256_castpd_si256(
  749|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s - 5 * p)));
  750|  38.1k|      __m256i q256_4 = _mm256_castpd_si256(
  751|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s + 4 * p)));
  752|  38.1k|      __m256i p256_5 = _mm256_castpd_si256(
  753|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s - 6 * p)));
  754|  38.1k|      __m256i q256_5 = _mm256_castpd_si256(
  755|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s + 5 * p)));
  756|  38.1k|      __m256i p256_6 = _mm256_castpd_si256(
  757|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s - 7 * p)));
  758|  38.1k|      __m256i q256_6 = _mm256_castpd_si256(
  759|  38.1k|          _mm256_broadcast_pd((__m128d const *)(s + 6 * p)));
  760|       |
  761|       |      // Derive flat2
  762|  38.1k|      __m256i p4q4256 = _mm256_blend_epi32(p256_4, q256_4, 0xf0);
  763|  38.1k|      __m256i p5q5256 = _mm256_blend_epi32(p256_5, q256_5, 0xf0);
  764|  38.1k|      const __m256i p6q6256 = _mm256_blend_epi32(p256_6, q256_6, 0xf0);
  765|  38.1k|      const __m256i work1 = _mm256_or_si256(_mm256_subs_epu8(p4q4256, p0q0256),
  766|  38.1k|                                            _mm256_subs_epu8(p0q0256, p4q4256));
  767|  38.1k|      const __m256i work2 = _mm256_or_si256(_mm256_subs_epu8(p5q5256, p0q0256),
  768|  38.1k|                                            _mm256_subs_epu8(p0q0256, p5q5256));
  769|  38.1k|      const __m256i work3 = _mm256_or_si256(_mm256_subs_epu8(p6q6256, p0q0256),
  770|  38.1k|                                            _mm256_subs_epu8(p0q0256, p6q6256));
  771|  38.1k|      __m256i flat2_256 = _mm256_max_epu8(work1, work2);
  772|  38.1k|      flat2_256 = _mm256_max_epu8(flat2_256, work3);
  773|  38.1k|      __m128i flat2 = _mm_max_epu8(_mm256_castsi256_si128(flat2_256),
  774|  38.1k|                                   _mm256_extractf128_si256(flat2_256, 1));
  775|  38.1k|      flat2 = _mm_subs_epu8(flat2, one);
  776|  38.1k|      flat2 = _mm_cmpeq_epi8(flat2, zero);
  777|  38.1k|      flat2 = _mm_and_si128(flat2, flat);  // flat2 & flat & mask
  778|       |
  779|  38.1k|      const __m256i filter =
  780|  38.1k|          _mm256_load_si256((__m256i const *)filt_loopfilter_avx2);
  781|       |
  782|  38.1k|      p256_3 = _mm256_shuffle_epi8(p256_3, filter);
  783|  38.1k|      p256_2 = _mm256_shuffle_epi8(p256_2, filter);
  784|  38.1k|      p256_1 = _mm256_shuffle_epi8(p256_1, filter);
  785|  38.1k|      p256_0 = _mm256_shuffle_epi8(p256_0, filter);
  786|  38.1k|      q256_0 = _mm256_shuffle_epi8(q256_0, filter);
  787|  38.1k|      q256_1 = _mm256_shuffle_epi8(q256_1, filter);
  788|  38.1k|      q256_2 = _mm256_shuffle_epi8(q256_2, filter);
  789|  38.1k|      q256_3 = _mm256_shuffle_epi8(q256_3, filter);
  790|       |
  791|  38.1k|      const __m256i p2p1p0 =
  792|  38.1k|          _mm256_add_epi16(p256_0, _mm256_add_epi16(p256_2, p256_1));
  793|  38.1k|      const __m256i q2q1q0 =
  794|  38.1k|          _mm256_add_epi16(q256_0, _mm256_add_epi16(q256_2, q256_1));
  795|       |
  796|  38.1k|      __m256i pixetFilter_p2p1p0 =
  797|  38.1k|          _mm256_add_epi16(four, _mm256_add_epi16(p2p1p0, q2q1q0));
  798|  38.1k|      __m256i pixetFilter_q2q1q0 = pixetFilter_p2p1p0;
  799|       |
  800|       |      // Derive p0 and q0
  801|  38.1k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, p256_3);
  802|  38.1k|      __m256i res_p =
  803|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_0), 3);
  804|  38.1k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, q256_3);
  805|  38.1k|      __m256i res_q =
  806|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_0), 3);
  807|  38.1k|      __m256i flat_p0q0 =
  808|  38.1k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  809|  38.1k|      p0q0256 = _mm256_andnot_si256(flat256, ps0qs0256);
  810|  38.1k|      flat_p0q0 = _mm256_and_si256(flat256, flat_p0q0);
  811|  38.1k|      p0q0256 = _mm256_or_si256(flat_p0q0, p0q0256);
  812|  38.1k|      p0 = _mm256_castsi256_si128(p0q0256);
  813|  38.1k|      q0 = _mm256_extractf128_si256(p0q0256, 1);
  814|       |
  815|       |      // Derive p1 and q1
  816|  38.1k|      __m256i sum_p = _mm256_sub_epi16(p256_3, q256_2);
  817|  38.1k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, sum_p);
  818|  38.1k|      res_p =
  819|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_1), 3);
  820|  38.1k|      __m256i sum_q = _mm256_sub_epi16(q256_3, p256_2);
  821|  38.1k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, sum_q);
  822|  38.1k|      res_q =
  823|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_1), 3);
  824|  38.1k|      __m256i flat_p1q1 =
  825|  38.1k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  826|  38.1k|      __m256i p1q1256 = _mm256_andnot_si256(flat256, ps1qs1256);
  827|  38.1k|      flat_p1q1 = _mm256_and_si256(flat256, flat_p1q1);
  828|  38.1k|      p1q1256 = _mm256_or_si256(flat_p1q1, p1q1256);
  829|  38.1k|      p1 = _mm256_castsi256_si128(p1q1256);
  830|  38.1k|      q1 = _mm256_extractf128_si256(p1q1256, 1);
  831|       |
  832|       |      // Derive p2 and q2
  833|  38.1k|      sum_p = _mm256_sub_epi16(p256_3, q256_1);
  834|  38.1k|      pixetFilter_p2p1p0 = _mm256_add_epi16(pixetFilter_p2p1p0, sum_p);
  835|  38.1k|      res_p =
  836|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_p2p1p0, p256_2), 3);
  837|  38.1k|      sum_q = _mm256_sub_epi16(q256_3, p256_1);
  838|  38.1k|      pixetFilter_q2q1q0 = _mm256_add_epi16(pixetFilter_q2q1q0, sum_q);
  839|  38.1k|      res_q =
  840|  38.1k|          _mm256_srli_epi16(_mm256_add_epi16(pixetFilter_q2q1q0, q256_2), 3);
  841|  38.1k|      __m256i flat_p2q2 =
  842|  38.1k|          _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  843|  38.1k|      p2q2256 = _mm256_andnot_si256(flat256, p2q2256);
  844|  38.1k|      flat_p2q2 = _mm256_and_si256(flat256, flat_p2q2);
  845|  38.1k|      p2q2256 = _mm256_or_si256(flat_p2q2, p2q2256);
  846|  38.1k|      p2 = _mm256_castsi256_si128(p2q2256);
  847|  38.1k|      q2 = _mm256_extractf128_si256(p2q2256, 1);
  848|  38.1k|      if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat2, zero))) {
  ------------------
  |  Branch (848:11): [True: 31.8k, False: 6.29k]
  ------------------
  849|  31.8k|        flat2_256 =
  850|  31.8k|            _mm256_insertf128_si256(_mm256_castsi128_si256(flat2), flat2, 0x1);
  851|  31.8k|        p256_6 = _mm256_shuffle_epi8(p256_6, filter);
  852|  31.8k|        p256_5 = _mm256_shuffle_epi8(p256_5, filter);
  853|  31.8k|        p256_4 = _mm256_shuffle_epi8(p256_4, filter);
  854|  31.8k|        q256_4 = _mm256_shuffle_epi8(q256_4, filter);
  855|  31.8k|        q256_5 = _mm256_shuffle_epi8(q256_5, filter);
  856|  31.8k|        q256_6 = _mm256_shuffle_epi8(q256_6, filter);
  857|       |
  858|  31.8k|        __m256i pixelFilter_p =
  859|  31.8k|            _mm256_add_epi16(p256_5, _mm256_add_epi16(p256_4, p256_3));
  860|  31.8k|        __m256i pixelFilter_q =
  861|  31.8k|            _mm256_add_epi16(q256_5, _mm256_add_epi16(q256_4, q256_3));
  862|       |
  863|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, p2p1p0);
  864|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, q2q1q0);
  865|       |
  866|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, p256_0);
  867|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, q256_0);
  868|  31.8k|        pixelFilter_p = _mm256_add_epi16(
  869|  31.8k|            eight, _mm256_add_epi16(pixelFilter_p, pixelFilter_q));
  870|  31.8k|        pixelFilter_q = pixelFilter_p;
  871|       |
  872|       |        // Derive p0 and q0
  873|  31.8k|        pixelFilter_p =
  874|  31.8k|            _mm256_add_epi16(_mm256_add_epi16(p256_6, p256_1), pixelFilter_p);
  875|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  876|  31.8k|        pixelFilter_q =
  877|  31.8k|            _mm256_add_epi16(_mm256_add_epi16(q256_6, q256_1), pixelFilter_q);
  878|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  879|  31.8k|        __m256i flat2_p0q0 =
  880|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  881|  31.8k|        p0q0256 = _mm256_andnot_si256(flat2_256, p0q0256);
  882|  31.8k|        flat2_p0q0 = _mm256_and_si256(flat2_256, flat2_p0q0);
  883|  31.8k|        p0q0256 = _mm256_or_si256(flat2_p0q0, p0q0256);
  884|       |
  885|  31.8k|        p0 = _mm256_castsi256_si128(p0q0256);
  886|  31.8k|        q0 = _mm256_extractf128_si256(p0q0256, 1);
  887|  31.8k|        _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
  888|  31.8k|        _mm_storeu_si128((__m128i *)(s - 0 * p), q0);
  889|       |
  890|       |        // Derive p1 and q1
  891|  31.8k|        sum_p = _mm256_add_epi16(_mm256_sub_epi16(p256_6, q256_5),
  892|  31.8k|                                 _mm256_sub_epi16(p256_2, q256_0));
  893|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, sum_p);
  894|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  895|  31.8k|        sum_q = _mm256_add_epi16(_mm256_sub_epi16(q256_6, p256_5),
  896|  31.8k|                                 _mm256_sub_epi16(q256_2, p256_0));
  897|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, sum_q);
  898|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  899|  31.8k|        __m256i flat2_p1q1 =
  900|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  901|  31.8k|        p1q1256 = _mm256_andnot_si256(flat2_256, p1q1256);
  902|  31.8k|        flat2_p1q1 = _mm256_and_si256(flat2_256, flat2_p1q1);
  903|  31.8k|        p1q1256 = _mm256_or_si256(flat2_p1q1, p1q1256);
  904|  31.8k|        p1 = _mm256_castsi256_si128(p1q1256);
  905|  31.8k|        q1 = _mm256_extractf128_si256(p1q1256, 1);
  906|  31.8k|        _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
  907|  31.8k|        _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
  908|       |
  909|       |        // Derive p2 and q2
  910|  31.8k|        sum_p = _mm256_add_epi16(_mm256_sub_epi16(p256_6, q256_4),
  911|  31.8k|                                 _mm256_sub_epi16(p256_3, p256_0));
  912|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, sum_p);
  913|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  914|  31.8k|        sum_q = _mm256_add_epi16(_mm256_sub_epi16(q256_6, p256_4),
  915|  31.8k|                                 _mm256_sub_epi16(q256_3, q256_0));
  916|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, sum_q);
  917|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  918|  31.8k|        __m256i flat2_p2q2 =
  919|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  920|  31.8k|        p2q2256 = _mm256_andnot_si256(flat2_256, p2q2256);
  921|  31.8k|        flat2_p2q2 = _mm256_and_si256(flat2_256, flat2_p2q2);
  922|  31.8k|        p2q2256 = _mm256_or_si256(flat2_p2q2, p2q2256);
  923|  31.8k|        p2 = _mm256_castsi256_si128(p2q2256);
  924|  31.8k|        q2 = _mm256_extractf128_si256(p2q2256, 1);
  925|  31.8k|        _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
  926|  31.8k|        _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
  927|       |
  928|       |        // Derive p3 and q3
  929|  31.8k|        sum_p = _mm256_add_epi16(_mm256_sub_epi16(p256_6, q256_3),
  930|  31.8k|                                 _mm256_sub_epi16(p256_4, p256_1));
  931|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, sum_p);
  932|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  933|  31.8k|        sum_q = _mm256_add_epi16(_mm256_sub_epi16(q256_6, p256_3),
  934|  31.8k|                                 _mm256_sub_epi16(q256_4, q256_1));
  935|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, sum_q);
  936|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  937|  31.8k|        __m256i flat2_p3q3 =
  938|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  939|  31.8k|        p3q3256 = _mm256_andnot_si256(flat2_256, p3q3256);
  940|  31.8k|        flat2_p3q3 = _mm256_and_si256(flat2_256, flat2_p3q3);
  941|  31.8k|        p3q3256 = _mm256_or_si256(flat2_p3q3, p3q3256);
  942|  31.8k|        p3 = _mm256_castsi256_si128(p3q3256);
  943|  31.8k|        q3 = _mm256_extractf128_si256(p3q3256, 1);
  944|  31.8k|        _mm_storeu_si128((__m128i *)(s - 4 * p), p3);
  945|  31.8k|        _mm_storeu_si128((__m128i *)(s + 3 * p), q3);
  946|       |
  947|       |        // Derive p4 and q4
  948|  31.8k|        sum_p = _mm256_add_epi16(_mm256_sub_epi16(p256_6, q256_2),
  949|  31.8k|                                 _mm256_sub_epi16(p256_5, p256_2));
  950|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, sum_p);
  951|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  952|  31.8k|        sum_q = _mm256_add_epi16(_mm256_sub_epi16(q256_6, p256_2),
  953|  31.8k|                                 _mm256_sub_epi16(q256_5, q256_2));
  954|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, sum_q);
  955|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  956|  31.8k|        __m256i flat2_p4q4 =
  957|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  958|  31.8k|        p4q4256 = _mm256_andnot_si256(flat2_256, p4q4256);
  959|  31.8k|        flat2_p4q4 = _mm256_and_si256(flat2_256, flat2_p4q4);
  960|  31.8k|        p4q4256 = _mm256_or_si256(flat2_p4q4, p4q4256);
  961|  31.8k|        _mm_storeu_si128((__m128i *)(s - 5 * p),
  962|  31.8k|                         _mm256_castsi256_si128(p4q4256));
  963|  31.8k|        _mm_storeu_si128((__m128i *)(s + 4 * p),
  964|  31.8k|                         _mm256_extractf128_si256(p4q4256, 1));
  965|       |
  966|       |        // Derive p5 and q5
  967|  31.8k|        sum_p = _mm256_add_epi16(_mm256_sub_epi16(p256_6, q256_1),
  968|  31.8k|                                 _mm256_sub_epi16(p256_6, p256_3));
  969|  31.8k|        pixelFilter_p = _mm256_add_epi16(pixelFilter_p, sum_p);
  970|  31.8k|        res_p = _mm256_srli_epi16(pixelFilter_p, 4);
  971|  31.8k|        sum_q = _mm256_add_epi16(_mm256_sub_epi16(q256_6, p256_1),
  972|  31.8k|                                 _mm256_sub_epi16(q256_6, q256_3));
  973|  31.8k|        pixelFilter_q = _mm256_add_epi16(pixelFilter_q, sum_q);
  974|  31.8k|        res_q = _mm256_srli_epi16(pixelFilter_q, 4);
  975|  31.8k|        __m256i flat2_p5q5 =
  976|  31.8k|            _mm256_permute4x64_epi64(_mm256_packus_epi16(res_p, res_q), 0xd8);
  977|  31.8k|        p5q5256 = _mm256_andnot_si256(flat2_256, p5q5256);
  978|  31.8k|        flat2_p5q5 = _mm256_and_si256(flat2_256, flat2_p5q5);
  979|  31.8k|        p5q5256 = _mm256_or_si256(flat2_p5q5, p5q5256);
  980|  31.8k|        _mm_storeu_si128((__m128i *)(s - 6 * p),
  981|  31.8k|                         _mm256_castsi256_si128(p5q5256));
  982|  31.8k|        _mm_storeu_si128((__m128i *)(s + 5 * p),
  983|  31.8k|                         _mm256_extractf128_si256(p5q5256, 1));
  984|  31.8k|      } else {
  985|  6.29k|        _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
  986|  6.29k|        _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
  987|  6.29k|        _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
  988|  6.29k|        _mm_storeu_si128((__m128i *)(s - 0 * p), q0);
  989|  6.29k|        _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
  990|  6.29k|        _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
  991|  6.29k|      }
  992|  74.6k|    } else {
  993|  74.6k|      _mm_storeu_si128((__m128i *)(s - 2 * p), ps1);
  994|  74.6k|      _mm_storeu_si128((__m128i *)(s - 1 * p), ps0);
  995|  74.6k|      _mm_storeu_si128((__m128i *)(s - 0 * p), qs0);
  996|  74.6k|      _mm_storeu_si128((__m128i *)(s + 1 * p), qs1);
  997|  74.6k|    }
  998|   112k|  }
  999|   112k|}
aom_lpf_vertical_14_quad_avx2:
 1004|  90.7k|                                   const uint8_t *_thresh0) {
 1005|  90.7k|  DECLARE_ALIGNED(16, unsigned char, t_dst[256]);
  ------------------
  |  |   19|  90.7k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1006|       |
 1007|       |  // Transpose 16x16
 1008|  90.7k|  trans_store_16x16_lpf_vert14(s - 8, pitch, t_dst, 16, 1);
 1009|       |
 1010|       |  // Loop filtering
 1011|  90.7k|  aom_lpf_horizontal_14_quad_avx2(t_dst + 8 * 16, 16, _blimit0, _limit0,
 1012|  90.7k|                                  _thresh0);
 1013|       |
 1014|       |  // Transpose back
 1015|  90.7k|  trans_store_16x16_lpf_vert14(t_dst, 16, s - 8, pitch, 0);
 1016|  90.7k|}
loopfilter_avx2.c:trans_store_16x16_lpf_vert14:
  477|   180k|                                                int is_store_avx2) {
  478|   180k|  const __m128i x0 = _mm_loadu_si128((__m128i *)in0);
  479|   180k|  const __m128i x1 = _mm_loadu_si128((__m128i *)(in0 + in_p * 1));
  480|   180k|  const __m128i x2 = _mm_loadu_si128((__m128i *)(in0 + in_p * 2));
  481|   180k|  const __m128i x3 = _mm_loadu_si128((__m128i *)(in0 + in_p * 3));
  482|   180k|  const __m128i x4 = _mm_loadu_si128((__m128i *)(in0 + in_p * 4));
  483|   180k|  const __m128i x5 = _mm_loadu_si128((__m128i *)(in0 + in_p * 5));
  484|   180k|  const __m128i x6 = _mm_loadu_si128((__m128i *)(in0 + in_p * 6));
  485|   180k|  const __m128i x7 = _mm_loadu_si128((__m128i *)(in0 + in_p * 7));
  486|       |
  487|   180k|  const __m256i y0 = _mm256_insertf128_si256(
  488|   180k|      _mm256_castsi128_si256(x0), _mm_loadu_si128((__m128i *)(in0 + in_p * 8)),
  489|   180k|      0x1);
  490|   180k|  const __m256i y1 = _mm256_insertf128_si256(
  491|   180k|      _mm256_castsi128_si256(x1), _mm_loadu_si128((__m128i *)(in0 + in_p * 9)),
  492|   180k|      0x1);
  493|   180k|  const __m256i y2 = _mm256_insertf128_si256(
  494|   180k|      _mm256_castsi128_si256(x2), _mm_loadu_si128((__m128i *)(in0 + in_p * 10)),
  495|   180k|      0x1);
  496|   180k|  const __m256i y3 = _mm256_insertf128_si256(
  497|   180k|      _mm256_castsi128_si256(x3), _mm_loadu_si128((__m128i *)(in0 + in_p * 11)),
  498|   180k|      0x1);
  499|   180k|  const __m256i y4 = _mm256_insertf128_si256(
  500|   180k|      _mm256_castsi128_si256(x4), _mm_loadu_si128((__m128i *)(in0 + in_p * 12)),
  501|   180k|      0x1);
  502|   180k|  const __m256i y5 = _mm256_insertf128_si256(
  503|   180k|      _mm256_castsi128_si256(x5), _mm_loadu_si128((__m128i *)(in0 + in_p * 13)),
  504|   180k|      0x1);
  505|   180k|  const __m256i y6 = _mm256_insertf128_si256(
  506|   180k|      _mm256_castsi128_si256(x6), _mm_loadu_si128((__m128i *)(in0 + in_p * 14)),
  507|   180k|      0x1);
  508|   180k|  const __m256i y7 = _mm256_insertf128_si256(
  509|   180k|      _mm256_castsi128_si256(x7), _mm_loadu_si128((__m128i *)(in0 + in_p * 15)),
  510|   180k|      0x1);
  511|       |
  512|   180k|  const __m256i y_s00 = _mm256_unpacklo_epi8(y0, y1);
  513|   180k|  const __m256i y_s01 = _mm256_unpackhi_epi8(y0, y1);
  514|   180k|  const __m256i y_s02 = _mm256_unpacklo_epi8(y2, y3);
  515|   180k|  const __m256i y_s03 = _mm256_unpackhi_epi8(y2, y3);
  516|   180k|  const __m256i y_s04 = _mm256_unpacklo_epi8(y4, y5);
  517|   180k|  const __m256i y_s05 = _mm256_unpackhi_epi8(y4, y5);
  518|   180k|  const __m256i y_s06 = _mm256_unpacklo_epi8(y6, y7);
  519|   180k|  const __m256i y_s07 = _mm256_unpackhi_epi8(y6, y7);
  520|       |
  521|   180k|  const __m256i y_s10 = _mm256_unpacklo_epi16(y_s00, y_s02);
  522|   180k|  const __m256i y_s11 = _mm256_unpackhi_epi16(y_s00, y_s02);
  523|   180k|  const __m256i y_s12 = _mm256_unpacklo_epi16(y_s01, y_s03);
  524|   180k|  const __m256i y_s13 = _mm256_unpackhi_epi16(y_s01, y_s03);
  525|   180k|  const __m256i y_s14 = _mm256_unpacklo_epi16(y_s04, y_s06);
  526|   180k|  const __m256i y_s15 = _mm256_unpackhi_epi16(y_s04, y_s06);
  527|   180k|  const __m256i y_s16 = _mm256_unpacklo_epi16(y_s05, y_s07);
  528|   180k|  const __m256i y_s17 = _mm256_unpackhi_epi16(y_s05, y_s07);
  529|       |
  530|   180k|  const __m256i y_s20 = _mm256_unpacklo_epi32(y_s10, y_s14);
  531|   180k|  const __m256i y_s21 = _mm256_unpackhi_epi32(y_s10, y_s14);
  532|   180k|  const __m256i y_s22 = _mm256_unpacklo_epi32(y_s11, y_s15);
  533|   180k|  const __m256i y_s23 = _mm256_unpackhi_epi32(y_s11, y_s15);
  534|   180k|  const __m256i y_s24 = _mm256_unpacklo_epi32(y_s12, y_s16);
  535|   180k|  const __m256i y_s25 = _mm256_unpackhi_epi32(y_s12, y_s16);
  536|   180k|  const __m256i y_s26 = _mm256_unpacklo_epi32(y_s13, y_s17);
  537|   180k|  const __m256i y_s27 = _mm256_unpackhi_epi32(y_s13, y_s17);
  538|       |
  539|   180k|  const __m256i row_s01 = _mm256_permute4x64_epi64(y_s20, 0xd8);
  540|   180k|  const __m256i row_s23 = _mm256_permute4x64_epi64(y_s21, 0xd8);
  541|   180k|  const __m256i row_s45 = _mm256_permute4x64_epi64(y_s22, 0xd8);
  542|   180k|  const __m256i row_s67 = _mm256_permute4x64_epi64(y_s23, 0xd8);
  543|   180k|  const __m256i row_s89 = _mm256_permute4x64_epi64(y_s24, 0xd8);
  544|   180k|  const __m256i row_s1011 = _mm256_permute4x64_epi64(y_s25, 0xd8);
  545|   180k|  const __m256i row_s1213 = _mm256_permute4x64_epi64(y_s26, 0xd8);
  546|   180k|  const __m256i row_s1415 = _mm256_permute4x64_epi64(y_s27, 0xd8);
  547|       |
  548|   180k|  if (is_store_avx2) {
  ------------------
  |  Branch (548:7): [True: 90.9k, False: 90.0k]
  ------------------
  549|  90.9k|    _mm256_storeu_si256((__m256i *)(out), row_s01);
  550|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (2 * out_p)), row_s23);
  551|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (4 * out_p)), row_s45);
  552|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (6 * out_p)), row_s67);
  553|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (8 * out_p)), row_s89);
  554|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (10 * out_p)), row_s1011);
  555|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (12 * out_p)), row_s1213);
  556|  90.9k|    _mm256_storeu_si256((__m256i *)(out + (14 * out_p)), row_s1415);
  557|  90.9k|  } else {
  558|  90.0k|    _mm_storeu_si128((__m128i *)(out), _mm256_castsi256_si128(row_s01));
  559|  90.0k|    _mm_storeu_si128((__m128i *)(out + (2 * out_p)),
  560|  90.0k|                     _mm256_castsi256_si128(row_s23));
  561|  90.0k|    _mm_storeu_si128((__m128i *)(out + (4 * out_p)),
  562|  90.0k|                     _mm256_castsi256_si128(row_s45));
  563|  90.0k|    _mm_storeu_si128((__m128i *)(out + (6 * out_p)),
  564|  90.0k|                     _mm256_castsi256_si128(row_s67));
  565|  90.0k|    _mm_storeu_si128((__m128i *)(out + (8 * out_p)),
  566|  90.0k|                     _mm256_castsi256_si128(row_s89));
  567|  90.0k|    _mm_storeu_si128((__m128i *)(out + (10 * out_p)),
  568|  90.0k|                     _mm256_castsi256_si128(row_s1011));
  569|  90.0k|    _mm_storeu_si128((__m128i *)(out + (12 * out_p)),
  570|  90.0k|                     _mm256_castsi256_si128(row_s1213));
  571|  90.0k|    _mm_storeu_si128((__m128i *)(out + (14 * out_p)),
  572|  90.0k|                     _mm256_castsi256_si128(row_s1415));
  573|  90.0k|    _mm_storeu_si128((__m128i *)(out + (1 * out_p)),
  574|  90.0k|                     _mm256_extracti128_si256(row_s01, 1));
  575|  90.0k|    _mm_storeu_si128((__m128i *)(out + (3 * out_p)),
  576|  90.0k|                     _mm256_extracti128_si256(row_s23, 1));
  577|  90.0k|    _mm_storeu_si128((__m128i *)(out + (5 * out_p)),
  578|  90.0k|                     _mm256_extracti128_si256(row_s45, 1));
  579|  90.0k|    _mm_storeu_si128((__m128i *)(out + (7 * out_p)),
  580|  90.0k|                     _mm256_extracti128_si256(row_s67, 1));
  581|  90.0k|    _mm_storeu_si128((__m128i *)(out + (9 * out_p)),
  582|  90.0k|                     _mm256_extracti128_si256(row_s89, 1));
  583|  90.0k|    _mm_storeu_si128((__m128i *)(out + (11 * out_p)),
  584|  90.0k|                     _mm256_extracti128_si256(row_s1011, 1));
  585|  90.0k|    _mm_storeu_si128((__m128i *)(out + (13 * out_p)),
  586|  90.0k|                     _mm256_extracti128_si256(row_s1213, 1));
  587|  90.0k|    _mm_storeu_si128((__m128i *)(out + (15 * out_p)),
  588|       |                     _mm256_extracti128_si256(row_s1415, 1));
  589|  90.0k|  }
  590|   180k|}

aom_lpf_horizontal_4_sse2:
  331|   988k|                               const uint8_t *_thresh) {
  332|   988k|  const __m128i zero = _mm_setzero_si128();
  333|   988k|  __m128i limit = _mm_unpacklo_epi32(_mm_loadl_epi64((const __m128i *)_blimit),
  334|   988k|                                     _mm_loadl_epi64((const __m128i *)_limit));
  335|   988k|  __m128i thresh =
  336|   988k|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh), zero);
  337|       |
  338|   988k|  __m128i qs1qs0, ps1ps0;
  339|   988k|  __m128i p1, p0, q0, q1;
  340|       |
  341|   988k|  p1 = xx_loadl_32(s - 2 * p);
  342|   988k|  p0 = xx_loadl_32(s - 1 * p);
  343|   988k|  q0 = xx_loadl_32(s - 0 * p);
  344|   988k|  q1 = xx_loadl_32(s + 1 * p);
  345|       |
  346|   988k|  lpf_internal_4_sse2(&p1, &p0, &q0, &q1, &limit, &thresh, &qs1qs0, &ps1ps0);
  347|       |
  348|   988k|  xx_storel_32(s - 1 * p, ps1ps0);
  349|   988k|  xx_storel_32(s - 2 * p, _mm_srli_si128(ps1ps0, 4));
  350|   988k|  xx_storel_32(s + 0 * p, qs1qs0);
  351|       |  xx_storel_32(s + 1 * p, _mm_srli_si128(qs1qs0, 4));
  352|   988k|}
aom_lpf_vertical_4_sse2:
  356|  1.06M|                             const uint8_t *_thresh) {
  357|  1.06M|  __m128i p1p0, q1q0;
  358|  1.06M|  __m128i p1, p0, q0, q1;
  359|       |
  360|  1.06M|  const __m128i zero = _mm_setzero_si128();
  361|  1.06M|  __m128i limit = _mm_unpacklo_epi32(_mm_loadl_epi64((const __m128i *)_blimit),
  362|  1.06M|                                     _mm_loadl_epi64((const __m128i *)_limit));
  363|  1.06M|  __m128i thresh =
  364|  1.06M|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh), zero);
  365|       |
  366|  1.06M|  __m128i x0, x1, x2, x3;
  367|  1.06M|  __m128i d0, d1, d2, d3;
  368|  1.06M|  x0 = _mm_loadl_epi64((__m128i *)(s - 2 + 0 * p));
  369|  1.06M|  x1 = _mm_loadl_epi64((__m128i *)(s - 2 + 1 * p));
  370|  1.06M|  x2 = _mm_loadl_epi64((__m128i *)(s - 2 + 2 * p));
  371|  1.06M|  x3 = _mm_loadl_epi64((__m128i *)(s - 2 + 3 * p));
  372|       |
  373|  1.06M|  transpose4x8_8x4_low_sse2(&x0, &x1, &x2, &x3, &p1, &p0, &q0, &q1);
  374|       |
  375|  1.06M|  lpf_internal_4_sse2(&p1, &p0, &q0, &q1, &limit, &thresh, &q1q0, &p1p0);
  376|       |
  377|       |  // Transpose 8x4 to 4x8
  378|  1.06M|  p1 = _mm_srli_si128(p1p0, 4);
  379|  1.06M|  q1 = _mm_srli_si128(q1q0, 4);
  380|       |
  381|  1.06M|  transpose4x8_8x4_low_sse2(&p1, &p1p0, &q1q0, &q1, &d0, &d1, &d2, &d3);
  382|       |
  383|  1.06M|  xx_storel_32(s + 0 * p - 2, d0);
  384|  1.06M|  xx_storel_32(s + 1 * p - 2, d1);
  385|  1.06M|  xx_storel_32(s + 2 * p - 2, d2);
  386|  1.06M|  xx_storel_32(s + 3 * p - 2, d3);
  387|  1.06M|}
aom_lpf_horizontal_14_sse2:
  960|  79.7k|                                const unsigned char *_thresh) {
  961|  79.7k|  __m128i q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0;
  962|  79.7k|  __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
  963|  79.7k|  __m128i limit = _mm_load_si128((const __m128i *)_limit);
  964|  79.7k|  __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
  965|       |
  966|  79.7k|  q4p4 = _mm_unpacklo_epi32(xx_loadl_32(s - 5 * p), xx_loadl_32(s + 4 * p));
  967|  79.7k|  q3p3 = _mm_unpacklo_epi32(xx_loadl_32(s - 4 * p), xx_loadl_32(s + 3 * p));
  968|  79.7k|  q2p2 = _mm_unpacklo_epi32(xx_loadl_32(s - 3 * p), xx_loadl_32(s + 2 * p));
  969|  79.7k|  q1p1 = _mm_unpacklo_epi32(xx_loadl_32(s - 2 * p), xx_loadl_32(s + 1 * p));
  970|       |
  971|  79.7k|  q0p0 = _mm_unpacklo_epi32(xx_loadl_32(s - 1 * p), xx_loadl_32(s - 0 * p));
  972|       |
  973|  79.7k|  q5p5 = _mm_unpacklo_epi32(xx_loadl_32(s - 6 * p), xx_loadl_32(s + 5 * p));
  974|       |
  975|  79.7k|  q6p6 = _mm_unpacklo_epi32(xx_loadl_32(s - 7 * p), xx_loadl_32(s + 6 * p));
  976|       |
  977|  79.7k|  lpf_internal_14_sse2(&q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1, &q0p0, &blimit,
  978|  79.7k|                       &limit, &thresh);
  979|       |
  980|  79.7k|  store_buffer_horz_8(q0p0, p, 0, s);
  981|  79.7k|  store_buffer_horz_8(q1p1, p, 1, s);
  982|  79.7k|  store_buffer_horz_8(q2p2, p, 2, s);
  983|  79.7k|  store_buffer_horz_8(q3p3, p, 3, s);
  984|  79.7k|  store_buffer_horz_8(q4p4, p, 4, s);
  985|  79.7k|  store_buffer_horz_8(q5p5, p, 5, s);
  986|  79.7k|}
aom_lpf_horizontal_6_sse2:
 1254|   631k|                               const unsigned char *_thresh) {
 1255|   631k|  __m128i p2, p1, p0, q0, q1, q2;
 1256|   631k|  __m128i p1p0, q1q0;
 1257|   631k|  __m128i blimit = _mm_load_si128((__m128i *)_blimit);
 1258|   631k|  __m128i limit = _mm_load_si128((__m128i *)_limit);
 1259|   631k|  __m128i thresh = _mm_load_si128((__m128i *)_thresh);
 1260|       |
 1261|   631k|  p2 = xx_loadl_32(s - 3 * p);
 1262|   631k|  p1 = xx_loadl_32(s - 2 * p);
 1263|   631k|  p0 = xx_loadl_32(s - 1 * p);
 1264|   631k|  q0 = xx_loadl_32(s - 0 * p);
 1265|   631k|  q1 = xx_loadl_32(s + 1 * p);
 1266|   631k|  q2 = xx_loadl_32(s + 2 * p);
 1267|       |
 1268|   631k|  lpf_internal_6_sse2(&p2, &q2, &p1, &q1, &p0, &q0, &q1q0, &p1p0, &blimit,
 1269|   631k|                      &limit, &thresh);
 1270|       |
 1271|   631k|  xx_storel_32(s - 1 * p, p1p0);
 1272|   631k|  xx_storel_32(s - 2 * p, _mm_srli_si128(p1p0, 4));
 1273|   631k|  xx_storel_32(s + 0 * p, q1q0);
 1274|       |  xx_storel_32(s + 1 * p, _mm_srli_si128(q1q0, 4));
 1275|   631k|}
aom_lpf_horizontal_6_dual_sse2:
 1283|   387k|                                    const unsigned char *_thresh1) {
 1284|   387k|  __m128i blimit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_blimit0),
 1285|   387k|                                      _mm_load_si128((__m128i *)_blimit1));
 1286|   387k|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_limit0),
 1287|   387k|                                     _mm_load_si128((__m128i *)_limit1));
 1288|   387k|  __m128i thresh = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_thresh0),
 1289|   387k|                                      _mm_load_si128((__m128i *)_thresh1));
 1290|       |
 1291|   387k|  __m128i p2, p1, p0, q0, q1, q2;
 1292|   387k|  __m128i p1p0, q1q0;
 1293|       |
 1294|   387k|  p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p));
 1295|   387k|  p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
 1296|   387k|  p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
 1297|   387k|  q0 = _mm_loadl_epi64((__m128i *)(s - 0 * p));
 1298|   387k|  q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
 1299|   387k|  q2 = _mm_loadl_epi64((__m128i *)(s + 2 * p));
 1300|       |
 1301|   387k|  lpf_internal_6_dual_sse2(&p2, &q2, &p1, &q1, &p0, &q0, &q1q0, &p1p0, &blimit,
 1302|   387k|                           &limit, &thresh);
 1303|       |
 1304|   387k|  _mm_storel_epi64((__m128i *)(s - 1 * p), p1p0);
 1305|   387k|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(p1p0, 8));
 1306|   387k|  _mm_storel_epi64((__m128i *)(s + 0 * p), q1q0);
 1307|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1q0, 8));
 1308|   387k|}
aom_lpf_horizontal_8_sse2:
 1612|   576k|                               const unsigned char *_thresh) {
 1613|   576k|  __m128i p3, p2, p1, p0, q0, q1, q2, q3;
 1614|   576k|  __m128i q1q0, p1p0;
 1615|   576k|  __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
 1616|   576k|  __m128i limit = _mm_load_si128((const __m128i *)_limit);
 1617|   576k|  __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
 1618|       |
 1619|   576k|  p3 = xx_loadl_32(s - 4 * p);
 1620|   576k|  p2 = xx_loadl_32(s - 3 * p);
 1621|   576k|  p1 = xx_loadl_32(s - 2 * p);
 1622|   576k|  p0 = xx_loadl_32(s - 1 * p);
 1623|   576k|  q0 = xx_loadl_32(s - 0 * p);
 1624|   576k|  q1 = xx_loadl_32(s + 1 * p);
 1625|   576k|  q2 = xx_loadl_32(s + 2 * p);
 1626|   576k|  q3 = xx_loadl_32(s + 3 * p);
 1627|       |
 1628|   576k|  lpf_internal_8_sse2(&p3, &q3, &p2, &q2, &p1, &q1, &p0, &q0, &q1q0, &p1p0,
 1629|   576k|                      &blimit, &limit, &thresh);
 1630|       |
 1631|   576k|  xx_storel_32(s - 1 * p, p1p0);
 1632|   576k|  xx_storel_32(s - 2 * p, _mm_srli_si128(p1p0, 4));
 1633|   576k|  xx_storel_32(s + 0 * p, q1q0);
 1634|       |  xx_storel_32(s + 1 * p, _mm_srli_si128(q1q0, 4));
 1635|   576k|  xx_storel_32(s - 3 * p, p2);
 1636|   576k|  xx_storel_32(s + 2 * p, q2);
 1637|   576k|}
aom_lpf_horizontal_14_dual_sse2:
 1645|  50.2k|                                     const unsigned char *_thresh1) {
 1646|  50.2k|  __m128i q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0;
 1647|  50.2k|  __m128i blimit =
 1648|  50.2k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_blimit0),
 1649|  50.2k|                         _mm_load_si128((const __m128i *)_blimit1));
 1650|  50.2k|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_limit0),
 1651|  50.2k|                                     _mm_load_si128((const __m128i *)_limit1));
 1652|  50.2k|  __m128i thresh =
 1653|  50.2k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_thresh0),
 1654|  50.2k|                         _mm_load_si128((const __m128i *)_thresh1));
 1655|       |
 1656|  50.2k|  q4p4 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 5 * p)),
 1657|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 4 * p)));
 1658|  50.2k|  q3p3 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 4 * p)),
 1659|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 3 * p)));
 1660|  50.2k|  q2p2 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 3 * p)),
 1661|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 2 * p)));
 1662|  50.2k|  q1p1 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 2 * p)),
 1663|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 1 * p)));
 1664|       |
 1665|  50.2k|  q0p0 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 1 * p)),
 1666|  50.2k|                            _mm_loadl_epi64((__m128i *)(s - 0 * p)));
 1667|       |
 1668|  50.2k|  q5p5 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 6 * p)),
 1669|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 5 * p)));
 1670|       |
 1671|  50.2k|  q6p6 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 7 * p)),
 1672|  50.2k|                            _mm_loadl_epi64((__m128i *)(s + 6 * p)));
 1673|       |
 1674|  50.2k|  lpf_internal_14_dual_sse2(&q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1, &q0p0,
 1675|  50.2k|                            &blimit, &limit, &thresh);
 1676|       |
 1677|  50.2k|  _mm_storel_epi64((__m128i *)(s - 1 * p), q0p0);
 1678|  50.2k|  _mm_storel_epi64((__m128i *)(s + 0 * p), _mm_srli_si128(q0p0, 8));
 1679|  50.2k|  _mm_storel_epi64((__m128i *)(s - 2 * p), q1p1);
 1680|  50.2k|  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1p1, 8));
 1681|  50.2k|  _mm_storel_epi64((__m128i *)(s - 3 * p), q2p2);
 1682|  50.2k|  _mm_storel_epi64((__m128i *)(s + 2 * p), _mm_srli_si128(q2p2, 8));
 1683|  50.2k|  _mm_storel_epi64((__m128i *)(s - 4 * p), q3p3);
 1684|  50.2k|  _mm_storel_epi64((__m128i *)(s + 3 * p), _mm_srli_si128(q3p3, 8));
 1685|  50.2k|  _mm_storel_epi64((__m128i *)(s - 5 * p), q4p4);
 1686|  50.2k|  _mm_storel_epi64((__m128i *)(s + 4 * p), _mm_srli_si128(q4p4, 8));
 1687|  50.2k|  _mm_storel_epi64((__m128i *)(s - 6 * p), q5p5);
 1688|       |  _mm_storel_epi64((__m128i *)(s + 5 * p), _mm_srli_si128(q5p5, 8));
 1689|  50.2k|}
aom_lpf_horizontal_8_dual_sse2:
 1696|  1.28M|                                    const uint8_t *_thresh1) {
 1697|  1.28M|  __m128i blimit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_blimit0),
 1698|  1.28M|                                      _mm_load_si128((__m128i *)_blimit1));
 1699|  1.28M|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_limit0),
 1700|  1.28M|                                     _mm_load_si128((__m128i *)_limit1));
 1701|  1.28M|  __m128i thresh = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_thresh0),
 1702|  1.28M|                                      _mm_load_si128((__m128i *)_thresh1));
 1703|       |
 1704|  1.28M|  __m128i p2, p1, p0, q0, q1, q2, p3, q3;
 1705|  1.28M|  __m128i q1q0, p1p0;
 1706|       |
 1707|  1.28M|  p3 = _mm_loadl_epi64((__m128i *)(s - 4 * p));
 1708|  1.28M|  p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p));
 1709|  1.28M|  p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
 1710|  1.28M|  p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
 1711|  1.28M|  q0 = _mm_loadl_epi64((__m128i *)(s - 0 * p));
 1712|  1.28M|  q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
 1713|  1.28M|  q2 = _mm_loadl_epi64((__m128i *)(s + 2 * p));
 1714|  1.28M|  q3 = _mm_loadl_epi64((__m128i *)(s + 3 * p));
 1715|       |
 1716|  1.28M|  lpf_internal_8_dual_sse2(&p3, &q3, &p2, &q2, &p1, &q1, &p0, &q0, &q1q0, &p1p0,
 1717|  1.28M|                           &blimit, &limit, &thresh);
 1718|       |
 1719|  1.28M|  _mm_storel_epi64((__m128i *)(s - 1 * p), p1p0);
 1720|  1.28M|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(p1p0, 8));
 1721|  1.28M|  _mm_storel_epi64((__m128i *)(s + 0 * p), q1q0);
 1722|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(q1q0, 8));
 1723|  1.28M|  _mm_storel_epi64((__m128i *)(s - 3 * p), p2);
 1724|  1.28M|  _mm_storel_epi64((__m128i *)(s + 2 * p), q2);
 1725|  1.28M|}
aom_lpf_horizontal_4_dual_sse2:
 1733|   783k|                                    const unsigned char *_thresh1) {
 1734|   783k|  __m128i p1, p0, q0, q1;
 1735|   783k|  __m128i qs1qs0, ps1ps0;
 1736|       |
 1737|   783k|  p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
 1738|   783k|  p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
 1739|   783k|  q0 = _mm_loadl_epi64((__m128i *)(s - 0 * p));
 1740|   783k|  q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
 1741|       |
 1742|   783k|  const __m128i zero = _mm_setzero_si128();
 1743|   783k|  const __m128i blimit =
 1744|   783k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_blimit0),
 1745|   783k|                         _mm_load_si128((const __m128i *)_blimit1));
 1746|   783k|  const __m128i limit =
 1747|   783k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_limit0),
 1748|   783k|                         _mm_load_si128((const __m128i *)_limit1));
 1749|       |
 1750|   783k|  __m128i l = _mm_unpacklo_epi64(blimit, limit);
 1751|       |
 1752|   783k|  __m128i thresh0 =
 1753|   783k|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh0), zero);
 1754|       |
 1755|   783k|  __m128i thresh1 =
 1756|   783k|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh1), zero);
 1757|       |
 1758|   783k|  __m128i t = _mm_unpacklo_epi64(thresh0, thresh1);
 1759|       |
 1760|   783k|  lpf_internal_4_dual_sse2(&p1, &p0, &q0, &q1, &l, &t, &qs1qs0, &ps1ps0);
 1761|       |
 1762|   783k|  _mm_storel_epi64((__m128i *)(s - 1 * p), ps1ps0);
 1763|   783k|  _mm_storel_epi64((__m128i *)(s - 2 * p), _mm_srli_si128(ps1ps0, 8));
 1764|   783k|  _mm_storel_epi64((__m128i *)(s + 0 * p), qs1qs0);
 1765|       |  _mm_storel_epi64((__m128i *)(s + 1 * p), _mm_srli_si128(qs1qs0, 8));
 1766|   783k|}
aom_lpf_vertical_4_dual_sse2:
 1773|  1.19M|                                  const uint8_t *_thresh1) {
 1774|  1.19M|  __m128i p0, q0, q1, p1;
 1775|  1.19M|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1776|  1.19M|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1777|  1.19M|  __m128i qs1qs0, ps1ps0;
 1778|       |
 1779|  1.19M|  const __m128i zero = _mm_setzero_si128();
 1780|  1.19M|  const __m128i blimit =
 1781|  1.19M|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_blimit0),
 1782|  1.19M|                         _mm_load_si128((const __m128i *)_blimit1));
 1783|  1.19M|  const __m128i limit =
 1784|  1.19M|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_limit0),
 1785|  1.19M|                         _mm_load_si128((const __m128i *)_limit1));
 1786|       |
 1787|  1.19M|  __m128i l = _mm_unpacklo_epi64(blimit, limit);
 1788|       |
 1789|  1.19M|  __m128i thresh0 =
 1790|  1.19M|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh0), zero);
 1791|       |
 1792|  1.19M|  __m128i thresh1 =
 1793|  1.19M|      _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)_thresh1), zero);
 1794|       |
 1795|  1.19M|  __m128i t = _mm_unpacklo_epi64(thresh0, thresh1);
 1796|       |
 1797|  1.19M|  x0 = _mm_loadl_epi64((__m128i *)((s - 2)));
 1798|  1.19M|  x1 = _mm_loadl_epi64((__m128i *)((s - 2) + p));
 1799|  1.19M|  x2 = _mm_loadl_epi64((__m128i *)((s - 2) + 2 * p));
 1800|  1.19M|  x3 = _mm_loadl_epi64((__m128i *)((s - 2) + 3 * p));
 1801|  1.19M|  x4 = _mm_loadl_epi64((__m128i *)((s - 2) + 4 * p));
 1802|  1.19M|  x5 = _mm_loadl_epi64((__m128i *)((s - 2) + 5 * p));
 1803|  1.19M|  x6 = _mm_loadl_epi64((__m128i *)((s - 2) + 6 * p));
 1804|  1.19M|  x7 = _mm_loadl_epi64((__m128i *)((s - 2) + 7 * p));
 1805|       |
 1806|  1.19M|  transpose8x8_low_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &p1, &p0, &q0,
 1807|  1.19M|                        &q1);
 1808|       |
 1809|  1.19M|  lpf_internal_4_dual_sse2(&p1, &p0, &q0, &q1, &l, &t, &qs1qs0, &ps1ps0);
 1810|       |
 1811|  1.19M|  p1 = _mm_srli_si128(ps1ps0, 8);
 1812|  1.19M|  q1 = _mm_srli_si128(qs1qs0, 8);
 1813|       |
 1814|  1.19M|  transpose4x8_8x4_sse2(&p1, &ps1ps0, &qs1qs0, &q1, &d0, &d1, &d2, &d3, &d4,
 1815|  1.19M|                        &d5, &d6, &d7);
 1816|       |
 1817|  1.19M|  xx_storel_32((s - 2 + 0 * p), d0);
 1818|  1.19M|  xx_storel_32((s - 2 + 1 * p), d1);
 1819|  1.19M|  xx_storel_32((s - 2 + 2 * p), d2);
 1820|  1.19M|  xx_storel_32((s - 2 + 3 * p), d3);
 1821|  1.19M|  xx_storel_32((s - 2 + 4 * p), d4);
 1822|  1.19M|  xx_storel_32((s - 2 + 5 * p), d5);
 1823|  1.19M|  xx_storel_32((s - 2 + 6 * p), d6);
 1824|  1.19M|  xx_storel_32((s - 2 + 7 * p), d7);
 1825|  1.19M|}
aom_lpf_vertical_6_sse2:
 1830|   160k|                             const unsigned char *_thresh) {
 1831|   160k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1832|   160k|  __m128i x2, x1, x0, x3;
 1833|   160k|  __m128i p0, q0;
 1834|   160k|  __m128i p1p0, q1q0;
 1835|   160k|  __m128i blimit = _mm_load_si128((__m128i *)_blimit);
 1836|   160k|  __m128i limit = _mm_load_si128((__m128i *)_limit);
 1837|   160k|  __m128i thresh = _mm_load_si128((__m128i *)_thresh);
 1838|       |
 1839|   160k|  x3 = _mm_loadl_epi64((__m128i *)((s - 3) + 0 * p));
 1840|   160k|  x2 = _mm_loadl_epi64((__m128i *)((s - 3) + 1 * p));
 1841|   160k|  x1 = _mm_loadl_epi64((__m128i *)((s - 3) + 2 * p));
 1842|   160k|  x0 = _mm_loadl_epi64((__m128i *)((s - 3) + 3 * p));
 1843|       |
 1844|   160k|  transpose4x8_8x4_sse2(&x3, &x2, &x1, &x0, &d0, &d1, &d2, &d3, &d4, &d5, &d6,
 1845|   160k|                        &d7);
 1846|       |
 1847|   160k|  lpf_internal_6_sse2(&d0, &d5, &d1, &d4, &d2, &d3, &q1q0, &p1p0, &blimit,
 1848|   160k|                      &limit, &thresh);
 1849|       |
 1850|   160k|  p0 = _mm_srli_si128(p1p0, 4);
 1851|   160k|  q0 = _mm_srli_si128(q1q0, 4);
 1852|       |
 1853|   160k|  transpose4x8_8x4_low_sse2(&p0, &p1p0, &q1q0, &q0, &d0, &d1, &d2, &d3);
 1854|       |
 1855|   160k|  xx_storel_32(s + 0 * p - 2, d0);
 1856|   160k|  xx_storel_32(s + 1 * p - 2, d1);
 1857|   160k|  xx_storel_32(s + 2 * p - 2, d2);
 1858|   160k|  xx_storel_32(s + 3 * p - 2, d3);
 1859|   160k|}
aom_lpf_vertical_6_dual_sse2:
 1866|   393k|                                  const uint8_t *_thresh1) {
 1867|   393k|  __m128i blimit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_blimit0),
 1868|   393k|                                      _mm_load_si128((__m128i *)_blimit1));
 1869|   393k|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_limit0),
 1870|   393k|                                     _mm_load_si128((__m128i *)_limit1));
 1871|   393k|  __m128i thresh = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_thresh0),
 1872|   393k|                                      _mm_load_si128((__m128i *)_thresh1));
 1873|       |
 1874|   393k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1875|   393k|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1876|   393k|  __m128i p0, q0;
 1877|   393k|  __m128i p1p0, q1q0;
 1878|   393k|  __m128i d0d1, d2d3, d4d5, d6d7;
 1879|       |
 1880|   393k|  x0 = _mm_loadl_epi64((__m128i *)((s - 3) + 0 * p));
 1881|   393k|  x1 = _mm_loadl_epi64((__m128i *)((s - 3) + 1 * p));
 1882|   393k|  x2 = _mm_loadl_epi64((__m128i *)((s - 3) + 2 * p));
 1883|   393k|  x3 = _mm_loadl_epi64((__m128i *)((s - 3) + 3 * p));
 1884|   393k|  x4 = _mm_loadl_epi64((__m128i *)((s - 3) + 4 * p));
 1885|   393k|  x5 = _mm_loadl_epi64((__m128i *)((s - 3) + 5 * p));
 1886|   393k|  x6 = _mm_loadl_epi64((__m128i *)((s - 3) + 6 * p));
 1887|   393k|  x7 = _mm_loadl_epi64((__m128i *)((s - 3) + 7 * p));
 1888|       |
 1889|   393k|  transpose8x8_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &d0d1, &d2d3, &d4d5,
 1890|   393k|                    &d6d7);
 1891|       |
 1892|   393k|  d1 = _mm_srli_si128(d0d1, 8);
 1893|   393k|  d3 = _mm_srli_si128(d2d3, 8);
 1894|   393k|  d5 = _mm_srli_si128(d4d5, 8);
 1895|   393k|  d7 = _mm_srli_si128(d6d7, 8);
 1896|       |
 1897|   393k|  lpf_internal_6_dual_sse2(&d0d1, &d5, &d1, &d4d5, &d2d3, &d3, &q1q0, &p1p0,
 1898|   393k|                           &blimit, &limit, &thresh);
 1899|       |
 1900|   393k|  p0 = _mm_srli_si128(p1p0, 8);
 1901|   393k|  q0 = _mm_srli_si128(q1q0, 8);
 1902|       |
 1903|   393k|  transpose4x8_8x4_sse2(&p0, &p1p0, &q1q0, &q0, &d0, &d1, &d2, &d3, &d4, &d5,
 1904|   393k|                        &d6, &d7);
 1905|       |
 1906|   393k|  xx_storel_32((s - 2 + 0 * p), d0);
 1907|   393k|  xx_storel_32((s - 2 + 1 * p), d1);
 1908|   393k|  xx_storel_32((s - 2 + 2 * p), d2);
 1909|   393k|  xx_storel_32((s - 2 + 3 * p), d3);
 1910|   393k|  xx_storel_32((s - 2 + 4 * p), d4);
 1911|   393k|  xx_storel_32((s - 2 + 5 * p), d5);
 1912|   393k|  xx_storel_32((s - 2 + 6 * p), d6);
 1913|   393k|  xx_storel_32((s - 2 + 7 * p), d7);
 1914|   393k|}
aom_lpf_vertical_8_sse2:
 1919|   592k|                             const unsigned char *_thresh) {
 1920|   592k|  __m128i d0, d1, d2, d3, d4, d5, d6, d7;
 1921|       |
 1922|   592k|  __m128i p0, q0;
 1923|   592k|  __m128i x2, x1, x0, x3;
 1924|   592k|  __m128i q1q0, p1p0;
 1925|   592k|  __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
 1926|   592k|  __m128i limit = _mm_load_si128((const __m128i *)_limit);
 1927|   592k|  __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
 1928|       |
 1929|   592k|  x3 = _mm_loadl_epi64((__m128i *)((s - 4) + 0 * p));
 1930|   592k|  x2 = _mm_loadl_epi64((__m128i *)((s - 4) + 1 * p));
 1931|   592k|  x1 = _mm_loadl_epi64((__m128i *)((s - 4) + 2 * p));
 1932|   592k|  x0 = _mm_loadl_epi64((__m128i *)((s - 4) + 3 * p));
 1933|       |
 1934|   592k|  transpose4x8_8x4_sse2(&x3, &x2, &x1, &x0, &d0, &d1, &d2, &d3, &d4, &d5, &d6,
 1935|   592k|                        &d7);
 1936|       |  // Loop filtering
 1937|   592k|  lpf_internal_8_sse2(&d0, &d7, &d1, &d6, &d2, &d5, &d3, &d4, &q1q0, &p1p0,
 1938|   592k|                      &blimit, &limit, &thresh);
 1939|       |
 1940|   592k|  p0 = _mm_srli_si128(p1p0, 4);
 1941|   592k|  q0 = _mm_srli_si128(q1q0, 4);
 1942|       |
 1943|   592k|  transpose8x8_low_sse2(&d0, &d1, &p0, &p1p0, &q1q0, &q0, &d6, &d7, &d0, &d1,
 1944|   592k|                        &d2, &d3);
 1945|       |
 1946|   592k|  _mm_storel_epi64((__m128i *)(s - 4 + 0 * p), d0);
 1947|   592k|  _mm_storel_epi64((__m128i *)(s - 4 + 1 * p), d1);
 1948|   592k|  _mm_storel_epi64((__m128i *)(s - 4 + 2 * p), d2);
 1949|   592k|  _mm_storel_epi64((__m128i *)(s - 4 + 3 * p), d3);
 1950|   592k|}
aom_lpf_vertical_8_dual_sse2:
 1957|  1.30M|                                  const uint8_t *_thresh1) {
 1958|  1.30M|  __m128i blimit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_blimit0),
 1959|  1.30M|                                      _mm_load_si128((__m128i *)_blimit1));
 1960|  1.30M|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_limit0),
 1961|  1.30M|                                     _mm_load_si128((__m128i *)_limit1));
 1962|  1.30M|  __m128i thresh = _mm_unpacklo_epi32(_mm_load_si128((__m128i *)_thresh0),
 1963|  1.30M|                                      _mm_load_si128((__m128i *)_thresh1));
 1964|       |
 1965|  1.30M|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
 1966|  1.30M|  __m128i d1, d3, d5, d7;
 1967|  1.30M|  __m128i q1q0, p1p0;
 1968|  1.30M|  __m128i p1, q1;
 1969|  1.30M|  __m128i d0d1, d2d3, d4d5, d6d7;
 1970|       |
 1971|  1.30M|  x0 = _mm_loadl_epi64((__m128i *)(s - 4 + 0 * p));
 1972|  1.30M|  x1 = _mm_loadl_epi64((__m128i *)(s - 4 + 1 * p));
 1973|  1.30M|  x2 = _mm_loadl_epi64((__m128i *)(s - 4 + 2 * p));
 1974|  1.30M|  x3 = _mm_loadl_epi64((__m128i *)(s - 4 + 3 * p));
 1975|  1.30M|  x4 = _mm_loadl_epi64((__m128i *)(s - 4 + 4 * p));
 1976|  1.30M|  x5 = _mm_loadl_epi64((__m128i *)(s - 4 + 5 * p));
 1977|  1.30M|  x6 = _mm_loadl_epi64((__m128i *)(s - 4 + 6 * p));
 1978|  1.30M|  x7 = _mm_loadl_epi64((__m128i *)(s - 4 + 7 * p));
 1979|       |
 1980|  1.30M|  transpose8x8_sse2(&x0, &x1, &x2, &x3, &x4, &x5, &x6, &x7, &d0d1, &d2d3, &d4d5,
 1981|  1.30M|                    &d6d7);
 1982|       |
 1983|  1.30M|  d1 = _mm_srli_si128(d0d1, 8);
 1984|  1.30M|  d3 = _mm_srli_si128(d2d3, 8);
 1985|  1.30M|  d5 = _mm_srli_si128(d4d5, 8);
 1986|  1.30M|  d7 = _mm_srli_si128(d6d7, 8);
 1987|       |
 1988|  1.30M|  lpf_internal_8_dual_sse2(&d0d1, &d7, &d1, &d6d7, &d2d3, &d5, &d3, &d4d5,
 1989|  1.30M|                           &q1q0, &p1p0, &blimit, &limit, &thresh);
 1990|       |
 1991|  1.30M|  p1 = _mm_srli_si128(p1p0, 8);
 1992|  1.30M|  q1 = _mm_srli_si128(q1q0, 8);
 1993|       |
 1994|  1.30M|  transpose8x8_sse2(&d0d1, &d1, &p1, &p1p0, &q1q0, &q1, &d6d7, &d7, &d0d1,
 1995|  1.30M|                    &d2d3, &d4d5, &d6d7);
 1996|       |
 1997|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 0 * p), d0d1);
 1998|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 1 * p), _mm_srli_si128(d0d1, 8));
 1999|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 2 * p), d2d3);
 2000|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 3 * p), _mm_srli_si128(d2d3, 8));
 2001|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 4 * p), d4d5);
 2002|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 5 * p), _mm_srli_si128(d4d5, 8));
 2003|  1.30M|  _mm_storel_epi64((__m128i *)(s - 4 + 6 * p), d6d7);
 2004|       |  _mm_storel_epi64((__m128i *)(s - 4 + 7 * p), _mm_srli_si128(d6d7, 8));
 2005|  1.30M|}
aom_lpf_vertical_14_sse2:
 2010|  78.0k|                              const unsigned char *_thresh) {
 2011|  78.0k|  __m128i q7p7, q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0;
 2012|  78.0k|  __m128i x6, x5, x4, x3;
 2013|  78.0k|  __m128i pq0, pq1, pq2, pq3;
 2014|  78.0k|  __m128i blimit = _mm_load_si128((__m128i *)_blimit);
 2015|  78.0k|  __m128i limit = _mm_load_si128((__m128i *)_limit);
 2016|  78.0k|  __m128i thresh = _mm_load_si128((__m128i *)_thresh);
 2017|       |
 2018|  78.0k|  x6 = _mm_loadu_si128((__m128i *)((s - 8) + 0 * p));
 2019|  78.0k|  x5 = _mm_loadu_si128((__m128i *)((s - 8) + 1 * p));
 2020|  78.0k|  x4 = _mm_loadu_si128((__m128i *)((s - 8) + 2 * p));
 2021|  78.0k|  x3 = _mm_loadu_si128((__m128i *)((s - 8) + 3 * p));
 2022|       |
 2023|  78.0k|  transpose_pq_14_sse2(&x6, &x5, &x4, &x3, &q0p0, &q1p1, &q2p2, &q3p3, &q4p4,
 2024|  78.0k|                       &q5p5, &q6p6, &q7p7);
 2025|       |
 2026|  78.0k|  lpf_internal_14_sse2(&q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1, &q0p0, &blimit,
 2027|  78.0k|                       &limit, &thresh);
 2028|       |
 2029|  78.0k|  transpose_pq_14_inv_sse2(&q7p7, &q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1,
 2030|  78.0k|                           &q0p0, &pq0, &pq1, &pq2, &pq3);
 2031|  78.0k|  _mm_storeu_si128((__m128i *)(s - 8 + 0 * p), pq0);
 2032|  78.0k|  _mm_storeu_si128((__m128i *)(s - 8 + 1 * p), pq1);
 2033|  78.0k|  _mm_storeu_si128((__m128i *)(s - 8 + 2 * p), pq2);
 2034|  78.0k|  _mm_storeu_si128((__m128i *)(s - 8 + 3 * p), pq3);
 2035|  78.0k|}
aom_lpf_vertical_14_dual_sse2:
 2040|  46.6k|    const uint8_t *_thresh1) {
 2041|  46.6k|  __m128i q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0;
 2042|  46.6k|  __m128i x7, x6, x5, x4, x3, x2, x1, x0;
 2043|  46.6k|  __m128i d0d1, d2d3, d4d5, d6d7, d8d9, d10d11, d12d13, d14d15;
 2044|  46.6k|  __m128i q0, q1, q2, q3, q7;
 2045|  46.6k|  __m128i p0p1, p2p3, p4p5, p6p7;
 2046|       |
 2047|  46.6k|  __m128i blimit =
 2048|  46.6k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_blimit0),
 2049|  46.6k|                         _mm_load_si128((const __m128i *)_blimit1));
 2050|  46.6k|  __m128i limit = _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_limit0),
 2051|  46.6k|                                     _mm_load_si128((const __m128i *)_limit1));
 2052|  46.6k|  __m128i thresh =
 2053|  46.6k|      _mm_unpacklo_epi32(_mm_load_si128((const __m128i *)_thresh0),
 2054|  46.6k|                         _mm_load_si128((const __m128i *)_thresh1));
 2055|       |
 2056|  46.6k|  x7 = _mm_loadu_si128((__m128i *)((s - 8) + 0 * p));
 2057|  46.6k|  x6 = _mm_loadu_si128((__m128i *)((s - 8) + 1 * p));
 2058|  46.6k|  x5 = _mm_loadu_si128((__m128i *)((s - 8) + 2 * p));
 2059|  46.6k|  x4 = _mm_loadu_si128((__m128i *)((s - 8) + 3 * p));
 2060|  46.6k|  x3 = _mm_loadu_si128((__m128i *)((s - 8) + 4 * p));
 2061|  46.6k|  x2 = _mm_loadu_si128((__m128i *)((s - 8) + 5 * p));
 2062|  46.6k|  x1 = _mm_loadu_si128((__m128i *)((s - 8) + 6 * p));
 2063|  46.6k|  x0 = _mm_loadu_si128((__m128i *)((s - 8) + 7 * p));
 2064|       |
 2065|  46.6k|  transpose8x16_16x8_sse2(&x7, &x6, &x5, &x4, &x3, &x2, &x1, &x0, &d0d1, &d2d3,
 2066|  46.6k|                          &d4d5, &d6d7, &d8d9, &d10d11, &d12d13, &d14d15);
 2067|       |
 2068|  46.6k|  q6p6 = _mm_unpacklo_epi64(d2d3, _mm_srli_si128(d12d13, 8));
 2069|  46.6k|  q5p5 = _mm_unpacklo_epi64(d4d5, _mm_srli_si128(d10d11, 8));
 2070|  46.6k|  q4p4 = _mm_unpacklo_epi64(d6d7, _mm_srli_si128(d8d9, 8));
 2071|  46.6k|  q3p3 = _mm_unpacklo_epi64(d8d9, _mm_srli_si128(d6d7, 8));
 2072|  46.6k|  q2p2 = _mm_unpacklo_epi64(d10d11, _mm_srli_si128(d4d5, 8));
 2073|  46.6k|  q1p1 = _mm_unpacklo_epi64(d12d13, _mm_srli_si128(d2d3, 8));
 2074|  46.6k|  q0p0 = _mm_unpacklo_epi64(d14d15, _mm_srli_si128(d0d1, 8));
 2075|  46.6k|  q7 = _mm_srli_si128(d14d15, 8);
 2076|       |
 2077|  46.6k|  lpf_internal_14_dual_sse2(&q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1, &q0p0,
 2078|  46.6k|                            &blimit, &limit, &thresh);
 2079|       |
 2080|  46.6k|  x0 = _mm_srli_si128(q0p0, 8);
 2081|  46.6k|  x1 = _mm_srli_si128(q1p1, 8);
 2082|  46.6k|  x2 = _mm_srli_si128(q2p2, 8);
 2083|  46.6k|  x3 = _mm_srli_si128(q3p3, 8);
 2084|  46.6k|  x4 = _mm_srli_si128(q4p4, 8);
 2085|  46.6k|  x5 = _mm_srli_si128(q5p5, 8);
 2086|  46.6k|  x6 = _mm_srli_si128(q6p6, 8);
 2087|       |
 2088|  46.6k|  transpose16x8_8x16_sse2(&d0d1, &q6p6, &q5p5, &q4p4, &q3p3, &q2p2, &q1p1,
 2089|  46.6k|                          &q0p0, &x0, &x1, &x2, &x3, &x4, &x5, &x6, &q7, &p0p1,
 2090|  46.6k|                          &p2p3, &p4p5, &p6p7, &q0, &q1, &q2, &q3);
 2091|       |
 2092|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 0 * p), p0p1);
 2093|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 1 * p), p2p3);
 2094|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 2 * p), p4p5);
 2095|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 3 * p), p6p7);
 2096|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 4 * p), q0);
 2097|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 5 * p), q1);
 2098|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 6 * p), q2);
 2099|  46.6k|  _mm_storeu_si128((__m128i *)(s - 8 + 7 * p), q3);
 2100|  46.6k|}
aom_lpf_vertical_8_quad_sse2:
 2929|   161k|                                  const uint8_t *_thresh0) {
 2930|   161k|  DECLARE_ALIGNED(16, unsigned char, t_dst[16 * 8]);
  ------------------
  |  |   19|   161k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2931|       |
 2932|       |  // Transpose 16x8
 2933|   161k|  transpose_16x8(s - 4, s - 4 + pitch * 8, pitch, t_dst, 16);
 2934|       |
 2935|       |  // Loop filtering
 2936|   161k|  aom_lpf_horizontal_8_quad(t_dst + 4 * 16, 16, _blimit0, _limit0, _thresh0);
 2937|       |
 2938|       |  // Transpose back
 2939|   161k|  transpose_16x8_to_8x16(t_dst, 16, s - 4, pitch);
 2940|   161k|}
aom_lpf_vertical_6_quad_sse2:
 2945|  61.6k|                                  const uint8_t *_thresh0) {
 2946|  61.6k|  DECLARE_ALIGNED(16, unsigned char, t_dst[16 * 8]);
  ------------------
  |  |   19|  61.6k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2947|       |
 2948|       |  // Transpose 16x8:: (wxh) 8x16 to 16x8
 2949|  61.6k|  transpose_16x8(s - 4, s - 4 + pitch * 8, pitch, t_dst, 16);
 2950|       |
 2951|       |  // Loop filtering
 2952|  61.6k|  aom_lpf_horizontal_6_quad(t_dst + 4 * 16, 16, _blimit0, _limit0, _thresh0);
 2953|       |
 2954|       |  // Transpose back:: (wxh) 16x8 to 8x16
 2955|  61.6k|  transpose_16x8_to_8x16(t_dst, 16, s - 4, pitch);
 2956|  61.6k|}
loopfilter_sse2.c:lpf_internal_4_sse2:
  246|  2.05M|    __m128i *thresh, __m128i *q1q0_out, __m128i *p1p0_out) {
  247|  2.05M|  __m128i q1p1, q0p0, p1p0, q1q0;
  248|  2.05M|  __m128i abs_p0q0, abs_p1q1;
  249|  2.05M|  __m128i mask, flat, hev;
  250|  2.05M|  const __m128i zero = _mm_setzero_si128();
  251|       |
  252|  2.05M|  q1p1 = _mm_unpacklo_epi32(*p1, *q1);
  253|  2.05M|  q0p0 = _mm_unpacklo_epi32(*p0, *q0);
  254|       |
  255|  2.05M|  p1p0 = _mm_unpacklo_epi32(q0p0, q1p1);
  256|  2.05M|  q1q0 = _mm_srli_si128(p1p0, 8);
  257|       |
  258|       |  /* (abs(q1 - q0), abs(p1 - p0) */
  259|  2.05M|  flat = abs_diff(q1p1, q0p0);
  260|       |  /* abs(p1 - q1), abs(p0 - q0) */
  261|  2.05M|  __m128i abs_p1q1p0q0 = abs_diff(p1p0, q1q0);
  262|       |
  263|       |  /* const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); */
  264|  2.05M|  flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 4));
  265|  2.05M|  hev = _mm_unpacklo_epi8(flat, zero);
  266|       |
  267|  2.05M|  hev = _mm_cmpgt_epi16(hev, *thresh);
  268|  2.05M|  hev = _mm_packs_epi16(hev, hev);
  269|  2.05M|  hev = _mm_unpacklo_epi32(hev, hev);
  270|       |
  271|  2.05M|  abs_p0q0 = _mm_adds_epu8(abs_p1q1p0q0, abs_p1q1p0q0); /* abs(p0 - q0) * 2 */
  272|  2.05M|  abs_p1q1 = _mm_srli_si128(abs_p1q1p0q0, 4);           /* abs(p1 - q1) */
  273|  2.05M|  abs_p1q1 = _mm_unpacklo_epi8(abs_p1q1, abs_p1q1);
  274|  2.05M|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 9);
  275|  2.05M|  abs_p1q1 = _mm_packs_epi16(abs_p1q1, abs_p1q1); /* abs(p1 - q1) / 2 */
  276|       |  /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 */
  277|       |
  278|  2.05M|  mask = _mm_adds_epu8(abs_p0q0, abs_p1q1);
  279|  2.05M|  mask = _mm_unpacklo_epi32(mask, flat);
  280|  2.05M|  mask = _mm_subs_epu8(mask, *limit);
  281|  2.05M|  mask = _mm_cmpeq_epi8(mask, zero);
  282|  2.05M|  mask = _mm_and_si128(mask, _mm_srli_si128(mask, 4));
  283|       |
  284|  2.05M|  filter4_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out);
  285|  2.05M|}
loopfilter_sse2.c:filter4_sse2:
  143|  4.09M|                                          __m128i *qs1qs0, __m128i *ps1ps0) {
  144|  4.09M|  __m128i filter, filter2filter1, work;
  145|  4.09M|  __m128i ps1ps0_work, qs1qs0_work;
  146|  4.09M|  __m128i hev1;
  147|  4.09M|  const __m128i t3t4 =
  148|  4.09M|      _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 4, 4, 4, 4);
  149|  4.09M|  const __m128i t80 = _mm_set1_epi8((char)0x80);
  150|  4.09M|  const __m128i ff = _mm_cmpeq_epi8(t80, t80);
  151|       |
  152|  4.09M|  ps1ps0_work = _mm_xor_si128(*p1p0, t80); /* ^ 0x80 */
  153|  4.09M|  qs1qs0_work = _mm_xor_si128(*q1q0, t80);
  154|       |
  155|       |  /* int8_t filter = signed_char_clamp(ps1 - qs1) & hev; */
  156|  4.09M|  work = _mm_subs_epi8(ps1ps0_work, qs1qs0_work);
  157|  4.09M|  filter = _mm_and_si128(_mm_srli_si128(work, 4), *hev);
  158|       |  /* filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; */
  159|  4.09M|  filter = _mm_subs_epi8(filter, work);
  160|  4.09M|  filter = _mm_subs_epi8(filter, work);
  161|  4.09M|  filter = _mm_subs_epi8(filter, work);  /* + 3 * (qs0 - ps0) */
  162|  4.09M|  filter = _mm_and_si128(filter, *mask); /* & mask */
  163|  4.09M|  filter = _mm_unpacklo_epi32(filter, filter);
  164|       |
  165|       |  /* filter1 = signed_char_clamp(filter + 4) >> 3; */
  166|       |  /* filter2 = signed_char_clamp(filter + 3) >> 3; */
  167|  4.09M|  filter2filter1 = _mm_adds_epi8(filter, t3t4); /* signed_char_clamp */
  168|  4.09M|  filter2filter1 =
  169|  4.09M|      _mm_unpacklo_epi8(filter2filter1, filter2filter1);  // goto 16 bit
  170|  4.09M|  filter2filter1 = _mm_srai_epi16(filter2filter1, 11);    /* >> 3 */
  171|  4.09M|  filter2filter1 = _mm_packs_epi16(filter2filter1, filter2filter1);
  172|       |
  173|       |  /* filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; */
  174|  4.09M|  filter = _mm_subs_epi8(filter2filter1, ff);  /* + 1 */
  175|  4.09M|  filter = _mm_unpacklo_epi8(filter, filter);  // goto 16 bit
  176|  4.09M|  filter = _mm_srai_epi16(filter, 9);          /* round */
  177|  4.09M|  filter = _mm_packs_epi16(filter, filter);
  178|  4.09M|  filter = _mm_andnot_si128(*hev, filter);
  179|  4.09M|  filter = _mm_unpacklo_epi32(filter, filter);
  180|       |
  181|  4.09M|  filter2filter1 = _mm_unpacklo_epi32(filter2filter1, filter);
  182|  4.09M|  hev1 = _mm_srli_si128(filter2filter1, 8);
  183|       |  /* signed_char_clamp(qs1 - filter), signed_char_clamp(qs0 - filter1) */
  184|  4.09M|  qs1qs0_work = _mm_subs_epi8(qs1qs0_work, filter2filter1);
  185|       |  /* signed_char_clamp(ps1 + filter), signed_char_clamp(ps0 + filter2) */
  186|  4.09M|  ps1ps0_work = _mm_adds_epi8(ps1ps0_work, hev1);
  187|       |
  188|  4.09M|  *qs1qs0 = _mm_xor_si128(qs1qs0_work, t80); /* ^ 0x80 */
  189|  4.09M|  *ps1ps0 = _mm_xor_si128(ps1ps0_work, t80); /* ^ 0x80 */
  190|  4.09M|}
loopfilter_sse2.c:lpf_internal_14_sse2:
  700|   158k|    __m128i *thresh) {
  701|   158k|  const __m128i zero = _mm_setzero_si128();
  702|   158k|  const __m128i one = _mm_set1_epi8(1);
  703|   158k|  __m128i mask, hev, flat, flat2;
  704|   158k|  __m128i flat2_pq[6], flat_pq[3];
  705|   158k|  __m128i qs0ps0, qs1ps1;
  706|   158k|  __m128i p1p0, q1q0, qs1qs0, ps1ps0;
  707|   158k|  __m128i abs_p1p0;
  708|       |
  709|   158k|  p1p0 = _mm_unpacklo_epi32(*q0p0, *q1p1);
  710|   158k|  q1q0 = _mm_srli_si128(p1p0, 8);
  711|       |
  712|   158k|  __m128i fe, ff, work;
  713|   158k|  {
  714|   158k|    __m128i abs_p1q1, abs_p0q0, abs_q1q0;
  715|   158k|    abs_p1p0 = abs_diff(*q1p1, *q0p0);
  716|   158k|    abs_q1q0 = _mm_srli_si128(abs_p1p0, 4);
  717|   158k|    fe = _mm_set1_epi8((char)0xfe);
  718|   158k|    ff = _mm_cmpeq_epi8(fe, fe);
  719|   158k|    abs_p0q0 = abs_diff(p1p0, q1q0);
  720|   158k|    abs_p1q1 = _mm_srli_si128(abs_p0q0, 4);
  721|       |
  722|   158k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
  723|       |
  724|   158k|    hev = _mm_subs_epu8(flat, *thresh);
  725|   158k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
  726|       |    // replicate for the further "merged variables" usage
  727|   158k|    hev = _mm_unpacklo_epi32(hev, hev);
  728|       |
  729|   158k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
  730|   158k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
  731|   158k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
  732|   158k|    mask = _mm_unpacklo_epi32(mask, zero);
  733|   158k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
  734|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
  735|   158k|    mask = _mm_max_epu8(abs_p1p0, mask);
  736|       |    // mask |= (abs(p1 - p0) > limit) * -1;
  737|       |    // mask |= (abs(q1 - q0) > limit) * -1;
  738|       |
  739|   158k|    work = _mm_max_epu8(abs_diff(*q2p2, *q1p1), abs_diff(*q3p3, *q2p2));
  740|   158k|    mask = _mm_max_epu8(work, mask);
  741|   158k|    mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 4));
  742|   158k|    mask = _mm_subs_epu8(mask, *limit);
  743|   158k|    mask = _mm_cmpeq_epi8(mask, zero);
  744|   158k|  }
  745|       |
  746|       |  // lp filter - the same for 6, 8 and 14 versions
  747|   158k|  filter4_sse2(&p1p0, &q1q0, &hev, &mask, &qs1qs0, &ps1ps0);
  748|   158k|  qs0ps0 = _mm_unpacklo_epi32(ps1ps0, qs1qs0);
  749|   158k|  qs1ps1 = _mm_srli_si128(qs0ps0, 8);
  750|       |  // loopfilter done
  751|       |
  752|   158k|  flat = _mm_max_epu8(abs_diff(*q2p2, *q0p0), abs_diff(*q3p3, *q0p0));
  753|   158k|  flat = _mm_max_epu8(abs_p1p0, flat);
  754|   158k|  flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 4));
  755|   158k|  flat = _mm_subs_epu8(flat, one);
  756|   158k|  flat = _mm_cmpeq_epi8(flat, zero);
  757|   158k|  flat = _mm_and_si128(flat, mask);
  758|   158k|  flat = _mm_unpacklo_epi32(flat, flat);
  759|   158k|  flat = _mm_unpacklo_epi64(flat, flat);
  760|       |
  761|       |  // if flat ==0 then flat2 is zero as well and we don't need any calc below
  762|       |  // sse4.1 if (0==_mm_test_all_zeros(flat,ff))
  763|   158k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (763:7): [True: 13.0k, False: 144k]
  ------------------
  764|       |    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  765|       |    // flat and wide flat calculations
  766|  13.0k|    __m128i q5_16, q4_16, q3_16, q2_16, q1_16, q0_16;
  767|  13.0k|    __m128i pq_16[7];
  768|  13.0k|    const __m128i eight = _mm_set1_epi16(8);
  769|  13.0k|    const __m128i four = _mm_set1_epi16(4);
  770|  13.0k|    __m128i sum_p6;
  771|  13.0k|    __m128i sum_p3;
  772|       |
  773|  13.0k|    pq_16[0] = _mm_unpacklo_epi8(*q0p0, zero);
  774|  13.0k|    pq_16[1] = _mm_unpacklo_epi8(*q1p1, zero);
  775|  13.0k|    pq_16[2] = _mm_unpacklo_epi8(*q2p2, zero);
  776|  13.0k|    pq_16[3] = _mm_unpacklo_epi8(*q3p3, zero);
  777|  13.0k|    pq_16[4] = _mm_unpacklo_epi8(*q4p4, zero);
  778|  13.0k|    pq_16[5] = _mm_unpacklo_epi8(*q5p5, zero);
  779|  13.0k|    pq_16[6] = _mm_unpacklo_epi8(*q6p6, zero);
  780|  13.0k|    q0_16 = _mm_srli_si128(pq_16[0], 8);
  781|  13.0k|    q1_16 = _mm_srli_si128(pq_16[1], 8);
  782|  13.0k|    q2_16 = _mm_srli_si128(pq_16[2], 8);
  783|  13.0k|    q3_16 = _mm_srli_si128(pq_16[3], 8);
  784|  13.0k|    q4_16 = _mm_srli_si128(pq_16[4], 8);
  785|  13.0k|    q5_16 = _mm_srli_si128(pq_16[5], 8);
  786|       |
  787|  13.0k|    __m128i flat_p[3], flat_q[3];
  788|  13.0k|    __m128i flat2_p[6], flat2_q[6];
  789|       |
  790|  13.0k|    __m128i work0, work0_0, work0_1, sum_p_0;
  791|  13.0k|    __m128i sum_p = _mm_add_epi16(pq_16[5], _mm_add_epi16(pq_16[4], pq_16[3]));
  792|  13.0k|    __m128i sum_lp = _mm_add_epi16(pq_16[0], _mm_add_epi16(pq_16[2], pq_16[1]));
  793|  13.0k|    sum_p = _mm_add_epi16(sum_p, sum_lp);
  794|       |
  795|  13.0k|    __m128i sum_lq = _mm_srli_si128(sum_lp, 8);
  796|  13.0k|    __m128i sum_q = _mm_srli_si128(sum_p, 8);
  797|       |
  798|  13.0k|    sum_p_0 = _mm_add_epi16(eight, _mm_add_epi16(sum_p, sum_q));
  799|  13.0k|    sum_lp = _mm_add_epi16(four, _mm_add_epi16(sum_lp, sum_lq));
  800|       |
  801|  13.0k|    flat_p[0] = _mm_add_epi16(sum_lp, _mm_add_epi16(pq_16[3], pq_16[0]));
  802|  13.0k|    flat_q[0] = _mm_add_epi16(sum_lp, _mm_add_epi16(q3_16, q0_16));
  803|       |
  804|  13.0k|    sum_p6 = _mm_add_epi16(pq_16[6], pq_16[6]);
  805|  13.0k|    sum_p3 = _mm_add_epi16(pq_16[3], pq_16[3]);
  806|       |
  807|  13.0k|    sum_q = _mm_sub_epi16(sum_p_0, pq_16[5]);
  808|  13.0k|    sum_p = _mm_sub_epi16(sum_p_0, q5_16);
  809|       |
  810|  13.0k|    work0_0 = _mm_add_epi16(_mm_add_epi16(pq_16[6], pq_16[0]), pq_16[1]);
  811|  13.0k|    work0_1 = _mm_add_epi16(
  812|  13.0k|        sum_p6, _mm_add_epi16(pq_16[1], _mm_add_epi16(pq_16[2], pq_16[0])));
  813|       |
  814|  13.0k|    sum_lq = _mm_sub_epi16(sum_lp, pq_16[2]);
  815|  13.0k|    sum_lp = _mm_sub_epi16(sum_lp, q2_16);
  816|       |
  817|  13.0k|    work0 = _mm_add_epi16(sum_p3, pq_16[1]);
  818|  13.0k|    flat_p[1] = _mm_add_epi16(sum_lp, work0);
  819|  13.0k|    flat_q[1] = _mm_add_epi16(sum_lq, _mm_srli_si128(work0, 8));
  820|       |
  821|  13.0k|    flat_pq[0] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[0], flat_q[0]), 3);
  822|  13.0k|    flat_pq[1] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[1], flat_q[1]), 3);
  823|  13.0k|    flat_pq[0] = _mm_packus_epi16(flat_pq[0], flat_pq[0]);
  824|  13.0k|    flat_pq[1] = _mm_packus_epi16(flat_pq[1], flat_pq[1]);
  825|       |
  826|  13.0k|    sum_lp = _mm_sub_epi16(sum_lp, q1_16);
  827|  13.0k|    sum_lq = _mm_sub_epi16(sum_lq, pq_16[1]);
  828|       |
  829|  13.0k|    sum_p3 = _mm_add_epi16(sum_p3, pq_16[3]);
  830|  13.0k|    work0 = _mm_add_epi16(sum_p3, pq_16[2]);
  831|       |
  832|  13.0k|    flat_p[2] = _mm_add_epi16(sum_lp, work0);
  833|  13.0k|    flat_q[2] = _mm_add_epi16(sum_lq, _mm_srli_si128(work0, 8));
  834|  13.0k|    flat_pq[2] = _mm_srli_epi16(_mm_unpacklo_epi64(flat_p[2], flat_q[2]), 3);
  835|  13.0k|    flat_pq[2] = _mm_packus_epi16(flat_pq[2], flat_pq[2]);
  836|       |
  837|       |    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ flat 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  838|  13.0k|    flat2 = _mm_max_epu8(abs_diff(*q4p4, *q0p0), abs_diff(*q5p5, *q0p0));
  839|       |
  840|  13.0k|    work = abs_diff(*q6p6, *q0p0);
  841|  13.0k|    flat2 = _mm_max_epu8(work, flat2);
  842|  13.0k|    flat2 = _mm_max_epu8(flat2, _mm_srli_si128(flat2, 4));
  843|  13.0k|    flat2 = _mm_subs_epu8(flat2, one);
  844|  13.0k|    flat2 = _mm_cmpeq_epi8(flat2, zero);
  845|  13.0k|    flat2 = _mm_and_si128(flat2, flat);  // flat2 & flat & mask
  846|  13.0k|    flat2 = _mm_unpacklo_epi32(flat2, flat2);
  847|       |
  848|       |    // ~~~~~~~~~~ apply flat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  849|  13.0k|    qs0ps0 = _mm_andnot_si128(flat, qs0ps0);
  850|  13.0k|    flat_pq[0] = _mm_and_si128(flat, flat_pq[0]);
  851|  13.0k|    *q0p0 = _mm_or_si128(qs0ps0, flat_pq[0]);
  852|       |
  853|  13.0k|    qs1ps1 = _mm_andnot_si128(flat, qs1ps1);
  854|  13.0k|    flat_pq[1] = _mm_and_si128(flat, flat_pq[1]);
  855|  13.0k|    *q1p1 = _mm_or_si128(qs1ps1, flat_pq[1]);
  856|       |
  857|  13.0k|    *q2p2 = _mm_andnot_si128(flat, *q2p2);
  858|  13.0k|    flat_pq[2] = _mm_and_si128(flat, flat_pq[2]);
  859|  13.0k|    *q2p2 = _mm_or_si128(*q2p2, flat_pq[2]);
  860|       |
  861|  13.0k|    if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat2, zero))) {
  ------------------
  |  Branch (861:9): [True: 11.7k, False: 1.27k]
  ------------------
  862|  11.7k|      flat2_p[0] = _mm_add_epi16(sum_p_0, _mm_add_epi16(work0_0, q0_16));
  863|  11.7k|      flat2_q[0] = _mm_add_epi16(
  864|  11.7k|          sum_p_0, _mm_add_epi16(_mm_srli_si128(work0_0, 8), pq_16[0]));
  865|       |
  866|  11.7k|      flat2_p[1] = _mm_add_epi16(sum_p, work0_1);
  867|  11.7k|      flat2_q[1] = _mm_add_epi16(sum_q, _mm_srli_si128(work0_1, 8));
  868|       |
  869|  11.7k|      flat2_pq[0] =
  870|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[0], flat2_q[0]), 4);
  871|  11.7k|      flat2_pq[1] =
  872|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[1], flat2_q[1]), 4);
  873|  11.7k|      flat2_pq[0] = _mm_packus_epi16(flat2_pq[0], flat2_pq[0]);
  874|  11.7k|      flat2_pq[1] = _mm_packus_epi16(flat2_pq[1], flat2_pq[1]);
  875|       |
  876|  11.7k|      sum_p = _mm_sub_epi16(sum_p, q4_16);
  877|  11.7k|      sum_q = _mm_sub_epi16(sum_q, pq_16[4]);
  878|       |
  879|  11.7k|      sum_p6 = _mm_add_epi16(sum_p6, pq_16[6]);
  880|  11.7k|      work0 = _mm_add_epi16(
  881|  11.7k|          sum_p6, _mm_add_epi16(pq_16[2], _mm_add_epi16(pq_16[3], pq_16[1])));
  882|  11.7k|      flat2_p[2] = _mm_add_epi16(sum_p, work0);
  883|  11.7k|      flat2_q[2] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  884|  11.7k|      flat2_pq[2] =
  885|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[2], flat2_q[2]), 4);
  886|  11.7k|      flat2_pq[2] = _mm_packus_epi16(flat2_pq[2], flat2_pq[2]);
  887|       |
  888|  11.7k|      sum_p6 = _mm_add_epi16(sum_p6, pq_16[6]);
  889|  11.7k|      sum_p = _mm_sub_epi16(sum_p, q3_16);
  890|  11.7k|      sum_q = _mm_sub_epi16(sum_q, pq_16[3]);
  891|       |
  892|  11.7k|      work0 = _mm_add_epi16(
  893|  11.7k|          sum_p6, _mm_add_epi16(pq_16[3], _mm_add_epi16(pq_16[4], pq_16[2])));
  894|  11.7k|      flat2_p[3] = _mm_add_epi16(sum_p, work0);
  895|  11.7k|      flat2_q[3] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  896|  11.7k|      flat2_pq[3] =
  897|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[3], flat2_q[3]), 4);
  898|  11.7k|      flat2_pq[3] = _mm_packus_epi16(flat2_pq[3], flat2_pq[3]);
  899|       |
  900|  11.7k|      sum_p6 = _mm_add_epi16(sum_p6, pq_16[6]);
  901|  11.7k|      sum_p = _mm_sub_epi16(sum_p, q2_16);
  902|  11.7k|      sum_q = _mm_sub_epi16(sum_q, pq_16[2]);
  903|       |
  904|  11.7k|      work0 = _mm_add_epi16(
  905|  11.7k|          sum_p6, _mm_add_epi16(pq_16[4], _mm_add_epi16(pq_16[5], pq_16[3])));
  906|  11.7k|      flat2_p[4] = _mm_add_epi16(sum_p, work0);
  907|  11.7k|      flat2_q[4] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  908|  11.7k|      flat2_pq[4] =
  909|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[4], flat2_q[4]), 4);
  910|  11.7k|      flat2_pq[4] = _mm_packus_epi16(flat2_pq[4], flat2_pq[4]);
  911|       |
  912|  11.7k|      sum_p6 = _mm_add_epi16(sum_p6, pq_16[6]);
  913|  11.7k|      sum_p = _mm_sub_epi16(sum_p, q1_16);
  914|  11.7k|      sum_q = _mm_sub_epi16(sum_q, pq_16[1]);
  915|       |
  916|  11.7k|      work0 = _mm_add_epi16(
  917|  11.7k|          sum_p6, _mm_add_epi16(pq_16[5], _mm_add_epi16(pq_16[6], pq_16[4])));
  918|  11.7k|      flat2_p[5] = _mm_add_epi16(sum_p, work0);
  919|  11.7k|      flat2_q[5] = _mm_add_epi16(sum_q, _mm_srli_si128(work0, 8));
  920|  11.7k|      flat2_pq[5] =
  921|  11.7k|          _mm_srli_epi16(_mm_unpacklo_epi64(flat2_p[5], flat2_q[5]), 4);
  922|  11.7k|      flat2_pq[5] = _mm_packus_epi16(flat2_pq[5], flat2_pq[5]);
  923|       |
  924|       |      // wide flat
  925|       |      // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  926|       |
  927|  11.7k|      *q0p0 = _mm_andnot_si128(flat2, *q0p0);
  928|  11.7k|      flat2_pq[0] = _mm_and_si128(flat2, flat2_pq[0]);
  929|  11.7k|      *q0p0 = _mm_or_si128(*q0p0, flat2_pq[0]);
  930|       |
  931|  11.7k|      *q1p1 = _mm_andnot_si128(flat2, *q1p1);
  932|  11.7k|      flat2_pq[1] = _mm_and_si128(flat2, flat2_pq[1]);
  933|  11.7k|      *q1p1 = _mm_or_si128(*q1p1, flat2_pq[1]);
  934|       |
  935|  11.7k|      *q2p2 = _mm_andnot_si128(flat2, *q2p2);
  936|  11.7k|      flat2_pq[2] = _mm_and_si128(flat2, flat2_pq[2]);
  937|  11.7k|      *q2p2 = _mm_or_si128(*q2p2, flat2_pq[2]);
  938|       |
  939|  11.7k|      *q3p3 = _mm_andnot_si128(flat2, *q3p3);
  940|  11.7k|      flat2_pq[3] = _mm_and_si128(flat2, flat2_pq[3]);
  941|  11.7k|      *q3p3 = _mm_or_si128(*q3p3, flat2_pq[3]);
  942|       |
  943|  11.7k|      *q4p4 = _mm_andnot_si128(flat2, *q4p4);
  944|  11.7k|      flat2_pq[4] = _mm_and_si128(flat2, flat2_pq[4]);
  945|  11.7k|      *q4p4 = _mm_or_si128(*q4p4, flat2_pq[4]);
  946|       |
  947|  11.7k|      *q5p5 = _mm_andnot_si128(flat2, *q5p5);
  948|  11.7k|      flat2_pq[5] = _mm_and_si128(flat2, flat2_pq[5]);
  949|  11.7k|      *q5p5 = _mm_or_si128(*q5p5, flat2_pq[5]);
  950|  11.7k|    }
  951|   144k|  } else {
  952|   144k|    *q0p0 = qs0ps0;
  953|   144k|    *q1p1 = qs1ps1;
  954|   144k|  }
  955|   158k|}
loopfilter_sse2.c:store_buffer_horz_8:
  389|   476k|static inline void store_buffer_horz_8(__m128i x, int p, int num, uint8_t *s) {
  390|   476k|  xx_storel_32(s - (num + 1) * p, x);
  391|       |  xx_storel_32(s + num * p, _mm_srli_si128(x, 4));
  392|   476k|}
loopfilter_sse2.c:lpf_internal_6_sse2:
 1120|   793k|    __m128i *thresh) {
 1121|   793k|  const __m128i zero = _mm_setzero_si128();
 1122|   793k|  __m128i mask, hev, flat;
 1123|   793k|  __m128i q2p2, q1p1, q0p0, flat_p1p0, flat_q0q1;
 1124|   793k|  __m128i pq2_16, q2_16, pq1_16, pq0_16, q0_16;
 1125|   793k|  __m128i ps1ps0, qs1qs0;
 1126|       |
 1127|   793k|  q2p2 = _mm_unpacklo_epi32(*p2, *q2);
 1128|   793k|  q1p1 = _mm_unpacklo_epi32(*p1, *q1);
 1129|   793k|  q0p0 = _mm_unpacklo_epi32(*p0, *q0);
 1130|       |
 1131|   793k|  *p1p0 = _mm_unpacklo_epi32(*p0, *p1);
 1132|   793k|  *q1q0 = _mm_unpacklo_epi32(*q0, *q1);
 1133|       |
 1134|   793k|  const __m128i one = _mm_set1_epi8(1);
 1135|   793k|  const __m128i fe = _mm_set1_epi8((char)0xfe);
 1136|   793k|  const __m128i ff = _mm_cmpeq_epi8(fe, fe);
 1137|   793k|  {
 1138|       |    // filter_mask and hev_mask
 1139|   793k|    __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work;
 1140|   793k|    abs_p1p0 = abs_diff(q1p1, q0p0);
 1141|   793k|    abs_q1q0 = _mm_srli_si128(abs_p1p0, 4);
 1142|       |
 1143|   793k|    abs_p0q0 = abs_diff(*p1p0, *q1q0);
 1144|   793k|    abs_p1q1 = _mm_srli_si128(abs_p0q0, 4);
 1145|       |
 1146|       |    // considering sse doesn't have unsigned elements comparison the idea is
 1147|       |    // to find at least one case when X > limit, it means the corresponding
 1148|       |    // mask bit is set.
 1149|       |    // to achieve that we find global max value of all inputs of abs(x-y) or
 1150|       |    // (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 If it is > limit the mask is set
 1151|       |    // otherwise - not
 1152|       |
 1153|   793k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
 1154|   793k|    hev = _mm_subs_epu8(flat, *thresh);
 1155|   793k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
 1156|       |    // replicate for the further "merged variables" usage
 1157|   793k|    hev = _mm_unpacklo_epi32(hev, hev);
 1158|       |
 1159|   793k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
 1160|   793k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
 1161|   793k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
 1162|   793k|    mask = _mm_unpacklo_epi32(mask, zero);
 1163|   793k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
 1164|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
 1165|   793k|    mask = _mm_max_epu8(abs_p1p0, mask);
 1166|       |    // mask |= (abs(p1 - p0) > limit) * -1;
 1167|       |    // mask |= (abs(q1 - q0) > limit) * -1;
 1168|       |
 1169|   793k|    work = abs_diff(q2p2, q1p1);
 1170|   793k|    mask = _mm_max_epu8(work, mask);
 1171|   793k|    mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 4));
 1172|   793k|    mask = _mm_subs_epu8(mask, *limit);
 1173|   793k|    mask = _mm_cmpeq_epi8(mask, zero);
 1174|       |
 1175|       |    // lp filter - the same for 6, 8 and 14 versions
 1176|   793k|    filter4_sse2(p1p0, q1q0, &hev, &mask, q1q0, p1p0);
 1177|       |
 1178|       |    // flat_mask
 1179|   793k|    flat = _mm_max_epu8(abs_diff(q2p2, q0p0), abs_p1p0);
 1180|   793k|    flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 4));
 1181|   793k|    flat = _mm_subs_epu8(flat, one);
 1182|   793k|    flat = _mm_cmpeq_epi8(flat, zero);
 1183|   793k|    flat = _mm_and_si128(flat, mask);
 1184|       |    // replicate for the further "merged variables" usage
 1185|   793k|    flat = _mm_unpacklo_epi32(flat, flat);
 1186|   793k|    flat = _mm_unpacklo_epi64(flat, flat);
 1187|   793k|  }
 1188|       |
 1189|       |  // 5 tap filter
 1190|       |  // need it only if flat !=0
 1191|   793k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (1191:7): [True: 106k, False: 686k]
  ------------------
 1192|   106k|    const __m128i four = _mm_set1_epi16(4);
 1193|   106k|    __m128i workp_a, workp_b, workp_c;
 1194|   106k|    __m128i pq0x2_pq1, pq1_pq2;
 1195|   106k|    pq2_16 = _mm_unpacklo_epi8(q2p2, zero);
 1196|   106k|    pq1_16 = _mm_unpacklo_epi8(q1p1, zero);
 1197|   106k|    pq0_16 = _mm_unpacklo_epi8(q0p0, zero);
 1198|   106k|    q0_16 = _mm_srli_si128(pq0_16, 8);
 1199|   106k|    q2_16 = _mm_srli_si128(pq2_16, 8);
 1200|       |
 1201|       |    // op1
 1202|   106k|    pq0x2_pq1 =
 1203|   106k|        _mm_add_epi16(_mm_add_epi16(pq0_16, pq0_16), pq1_16);  // p0 *2 + p1
 1204|   106k|    pq1_pq2 = _mm_add_epi16(pq1_16, pq2_16);                   // p1 + p2
 1205|   106k|    workp_a = _mm_add_epi16(_mm_add_epi16(pq0x2_pq1, four),
 1206|   106k|                            pq1_pq2);  // p2 + p0 * 2 + p1 * 2 + 4
 1207|       |
 1208|   106k|    workp_b = _mm_add_epi16(_mm_add_epi16(pq2_16, pq2_16), q0_16);
 1209|   106k|    workp_b =
 1210|   106k|        _mm_add_epi16(workp_a, workp_b);  // p2 * 3 + p1 * 2 + p0 * 2 + q0 + 4
 1211|       |
 1212|       |    // op0
 1213|   106k|    workp_c = _mm_srli_si128(pq0x2_pq1, 8);  // q0 * 2 + q1
 1214|   106k|    workp_a = _mm_add_epi16(workp_a,
 1215|   106k|                            workp_c);  // p2 + p0 * 2 + p1 * 2 + q0 * 2 + q1 + 4
 1216|   106k|    workp_b = _mm_unpacklo_epi64(workp_a, workp_b);
 1217|   106k|    workp_b = _mm_srli_epi16(workp_b, 3);
 1218|       |
 1219|   106k|    flat_p1p0 = _mm_packus_epi16(workp_b, workp_b);
 1220|       |
 1221|       |    // oq0
 1222|   106k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_a, pq2_16),
 1223|   106k|                            pq1_16);  // p0 * 2 + p1  + q0 * 2 + q1 + 4
 1224|   106k|    workp_b = _mm_srli_si128(pq1_pq2, 8);
 1225|   106k|    workp_a = _mm_add_epi16(
 1226|   106k|        workp_a, workp_b);  // p0 * 2 + p1  + q0 * 2 + q1 * 2 + q2 + 4
 1227|       |    // workp_shft0 = _mm_srli_epi16(workp_a, 3);
 1228|       |
 1229|       |    // oq1
 1230|   106k|    workp_c = _mm_sub_epi16(_mm_sub_epi16(workp_a, pq1_16),
 1231|   106k|                            pq0_16);  // p0   + q0 * 2 + q1 * 2 + q2 + 4
 1232|   106k|    workp_b = _mm_add_epi16(q2_16, q2_16);
 1233|   106k|    workp_b =
 1234|   106k|        _mm_add_epi16(workp_c, workp_b);  // p0  + q0 * 2 + q1 * 2 + q2 * 3 + 4
 1235|       |
 1236|   106k|    workp_a = _mm_unpacklo_epi64(workp_a, workp_b);
 1237|   106k|    workp_a = _mm_srli_epi16(workp_a, 3);
 1238|       |
 1239|   106k|    flat_q0q1 = _mm_packus_epi16(workp_a, workp_a);
 1240|       |
 1241|   106k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0);
 1242|   106k|    *q1q0 = _mm_and_si128(flat, flat_q0q1);
 1243|   106k|    *q1q0 = _mm_or_si128(qs1qs0, *q1q0);
 1244|       |
 1245|   106k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0);
 1246|   106k|    *p1p0 = _mm_and_si128(flat, flat_p1p0);
 1247|   106k|    *p1p0 = _mm_or_si128(ps1ps0, *p1p0);
 1248|   106k|  }
 1249|   793k|}
loopfilter_sse2.c:lpf_internal_6_dual_sse2:
  991|   780k|    __m128i *thresh) {
  992|   780k|  const __m128i zero = _mm_setzero_si128();
  993|   780k|  __m128i mask, hev, flat;
  994|   780k|  __m128i q2p2, q1p1, q0p0, flat_p1p0, flat_q0q1;
  995|   780k|  __m128i p2_16, q2_16, p1_16, q1_16, p0_16, q0_16;
  996|   780k|  __m128i ps1ps0, qs1qs0;
  997|       |
  998|   780k|  q2p2 = _mm_unpacklo_epi64(*p2, *q2);
  999|   780k|  q1p1 = _mm_unpacklo_epi64(*p1, *q1);
 1000|   780k|  q0p0 = _mm_unpacklo_epi64(*p0, *q0);
 1001|       |
 1002|   780k|  *p1p0 = _mm_unpacklo_epi64(q0p0, q1p1);
 1003|   780k|  *q1q0 = _mm_unpackhi_epi64(q0p0, q1p1);
 1004|       |
 1005|   780k|  const __m128i one = _mm_set1_epi8(1);
 1006|   780k|  const __m128i fe = _mm_set1_epi8((char)0xfe);
 1007|   780k|  const __m128i ff = _mm_cmpeq_epi8(fe, fe);
 1008|       |
 1009|   780k|  {
 1010|       |    // filter_mask and hev_mask
 1011|   780k|    __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work;
 1012|   780k|    abs_p1p0 = abs_diff(q1p1, q0p0);
 1013|   780k|    abs_q1q0 = _mm_srli_si128(abs_p1p0, 8);
 1014|       |
 1015|   780k|    abs_p0q0 = abs_diff(*p1p0, *q1q0);
 1016|   780k|    abs_p1q1 = _mm_srli_si128(abs_p0q0, 8);
 1017|   780k|    abs_p0q0 = _mm_unpacklo_epi64(abs_p0q0, zero);
 1018|       |
 1019|       |    // considering sse doesn't have unsigned elements comparison the idea is
 1020|       |    // to find at least one case when X > limit, it means the corresponding
 1021|       |    // mask bit is set.
 1022|       |    // to achieve that we find global max value of all inputs of abs(x-y) or
 1023|       |    // (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 If it is > limit the mask is set
 1024|       |    // otherwise - not
 1025|       |
 1026|   780k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
 1027|   780k|    hev = _mm_subs_epu8(flat, *thresh);
 1028|   780k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
 1029|       |    // replicate for the further "merged variables" usage
 1030|   780k|    hev = _mm_unpacklo_epi64(hev, hev);
 1031|       |
 1032|   780k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
 1033|   780k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
 1034|   780k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
 1035|   780k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
 1036|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
 1037|   780k|    mask = _mm_max_epu8(abs_p1p0, mask);
 1038|       |    // mask |= (abs(p1 - p0) > limit) * -1;
 1039|       |    // mask |= (abs(q1 - q0) > limit) * -1;
 1040|       |
 1041|   780k|    work = abs_diff(q2p2, q1p1);
 1042|   780k|    mask = _mm_max_epu8(work, mask);
 1043|   780k|    mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8));
 1044|   780k|    mask = _mm_subs_epu8(mask, *limit);
 1045|   780k|    mask = _mm_cmpeq_epi8(mask, zero);
 1046|       |
 1047|       |    // lp filter - the same for 6, 8 and 14 versions
 1048|   780k|    filter4_dual_sse2(p1p0, q1q0, &hev, &mask, q1q0, p1p0);
 1049|       |
 1050|       |    // flat_mask
 1051|   780k|    flat = _mm_max_epu8(abs_diff(q2p2, q0p0), abs_p1p0);
 1052|   780k|    flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8));
 1053|   780k|    flat = _mm_subs_epu8(flat, one);
 1054|   780k|    flat = _mm_cmpeq_epi8(flat, zero);
 1055|   780k|    flat = _mm_and_si128(flat, mask);
 1056|       |    // replicate for the further "merged variables" usage
 1057|   780k|    flat = _mm_unpacklo_epi64(flat, flat);
 1058|   780k|  }
 1059|       |
 1060|       |  // 5 tap filter
 1061|       |  // need it only if flat !=0
 1062|   780k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (1062:7): [True: 145k, False: 634k]
  ------------------
 1063|   145k|    const __m128i four = _mm_set1_epi16(4);
 1064|   145k|    __m128i workp_a, workp_b, workp_shft0, workp_shft1;
 1065|   145k|    p2_16 = _mm_unpacklo_epi8(*p2, zero);
 1066|   145k|    p1_16 = _mm_unpacklo_epi8(*p1, zero);
 1067|   145k|    p0_16 = _mm_unpacklo_epi8(*p0, zero);
 1068|   145k|    q0_16 = _mm_unpacklo_epi8(*q0, zero);
 1069|   145k|    q1_16 = _mm_unpacklo_epi8(*q1, zero);
 1070|   145k|    q2_16 = _mm_unpacklo_epi8(*q2, zero);
 1071|       |
 1072|       |    // op1
 1073|   145k|    workp_a = _mm_add_epi16(_mm_add_epi16(p0_16, p0_16),
 1074|   145k|                            _mm_add_epi16(p1_16, p1_16));  // p0 *2 + p1 * 2
 1075|   145k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four),
 1076|   145k|                            p2_16);  // p2 + p0 * 2 + p1 * 2 + 4
 1077|       |
 1078|   145k|    workp_b = _mm_add_epi16(_mm_add_epi16(p2_16, p2_16), q0_16);
 1079|   145k|    workp_shft0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b),
 1080|   145k|                                 3);  // p2 * 3 + p1 * 2 + p0 * 2 + q0 + 4
 1081|       |
 1082|       |    // op0
 1083|   145k|    workp_b = _mm_add_epi16(_mm_add_epi16(q0_16, q0_16), q1_16);  // q0 * 2 + q1
 1084|   145k|    workp_a = _mm_add_epi16(workp_a,
 1085|   145k|                            workp_b);  // p2 + p0 * 2 + p1 * 2 + q0 * 2 + q1 + 4
 1086|   145k|    workp_shft1 = _mm_srli_epi16(workp_a, 3);
 1087|       |
 1088|   145k|    flat_p1p0 = _mm_packus_epi16(workp_shft1, workp_shft0);
 1089|       |
 1090|       |    // oq0
 1091|   145k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_a, p2_16),
 1092|   145k|                            p1_16);  // p0 * 2 + p1  + q0 * 2 + q1 + 4
 1093|   145k|    workp_b = _mm_add_epi16(q1_16, q2_16);
 1094|   145k|    workp_a = _mm_add_epi16(
 1095|   145k|        workp_a, workp_b);  // p0 * 2 + p1  + q0 * 2 + q1 * 2 + q2 + 4
 1096|   145k|    workp_shft0 = _mm_srli_epi16(workp_a, 3);
 1097|       |
 1098|       |    // oq1
 1099|   145k|    workp_a = _mm_sub_epi16(_mm_sub_epi16(workp_a, p1_16),
 1100|   145k|                            p0_16);  // p0   + q0 * 2 + q1 * 2 + q2 + 4
 1101|   145k|    workp_b = _mm_add_epi16(q2_16, q2_16);
 1102|   145k|    workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b),
 1103|   145k|                                 3);  // p0  + q0 * 2 + q1 * 2 + q2 * 3 + 4
 1104|       |
 1105|   145k|    flat_q0q1 = _mm_packus_epi16(workp_shft0, workp_shft1);
 1106|       |
 1107|   145k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0);
 1108|   145k|    *q1q0 = _mm_and_si128(flat, flat_q0q1);
 1109|   145k|    *q1q0 = _mm_or_si128(qs1qs0, *q1q0);
 1110|       |
 1111|   145k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0);
 1112|   145k|    *p1p0 = _mm_and_si128(flat, flat_p1p0);
 1113|   145k|    *p1p0 = _mm_or_si128(ps1ps0, *p1p0);
 1114|   145k|  }
 1115|   780k|}
loopfilter_sse2.c:filter4_dual_sse2:
  195|  5.37M|                                               __m128i *ps1ps0) {
  196|  5.37M|  const __m128i t3t4 =
  197|  5.37M|      _mm_set_epi8(3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4);
  198|  5.37M|  const __m128i t80 = _mm_set1_epi8((char)0x80);
  199|  5.37M|  __m128i filter, filter2filter1, work;
  200|  5.37M|  __m128i ps1ps0_work, qs1qs0_work;
  201|  5.37M|  __m128i hev1;
  202|  5.37M|  const __m128i ff = _mm_cmpeq_epi8(t80, t80);
  203|       |
  204|  5.37M|  ps1ps0_work = _mm_xor_si128(*p1p0, t80); /* ^ 0x80 */
  205|  5.37M|  qs1qs0_work = _mm_xor_si128(*q1q0, t80);
  206|       |
  207|       |  /* int8_t filter = signed_char_clamp(ps1 - qs1) & hev; */
  208|  5.37M|  work = _mm_subs_epi8(ps1ps0_work, qs1qs0_work);
  209|  5.37M|  filter = _mm_and_si128(_mm_srli_si128(work, 8), *hev);
  210|       |  /* filter = signed_char_clamp(filter + 3 * (qs0 - ps0)) & mask; */
  211|  5.37M|  filter = _mm_subs_epi8(filter, work);
  212|  5.37M|  filter = _mm_subs_epi8(filter, work);
  213|  5.37M|  filter = _mm_subs_epi8(filter, work);  /* + 3 * (qs0 - ps0) */
  214|  5.37M|  filter = _mm_and_si128(filter, *mask); /* & mask */
  215|  5.37M|  filter = _mm_unpacklo_epi64(filter, filter);
  216|       |
  217|       |  /* filter1 = signed_char_clamp(filter + 4) >> 3; */
  218|       |  /* filter2 = signed_char_clamp(filter + 3) >> 3; */
  219|  5.37M|  filter2filter1 = _mm_adds_epi8(filter, t3t4); /* signed_char_clamp */
  220|  5.37M|  filter = _mm_unpackhi_epi8(filter2filter1, filter2filter1);
  221|  5.37M|  filter2filter1 = _mm_unpacklo_epi8(filter2filter1, filter2filter1);
  222|  5.37M|  filter2filter1 = _mm_srai_epi16(filter2filter1, 11); /* >> 3 */
  223|  5.37M|  filter = _mm_srai_epi16(filter, 11);                 /* >> 3 */
  224|  5.37M|  filter2filter1 = _mm_packs_epi16(filter2filter1, filter);
  225|       |
  226|       |  /* filter = ROUND_POWER_OF_TWO(filter1, 1) & ~hev; */
  227|  5.37M|  filter = _mm_subs_epi8(filter2filter1, ff); /* + 1 */
  228|  5.37M|  filter = _mm_unpacklo_epi8(filter, filter);
  229|  5.37M|  filter = _mm_srai_epi16(filter, 9); /* round */
  230|  5.37M|  filter = _mm_packs_epi16(filter, filter);
  231|  5.37M|  filter = _mm_andnot_si128(*hev, filter);
  232|       |
  233|  5.37M|  hev1 = _mm_unpackhi_epi64(filter2filter1, filter);
  234|  5.37M|  filter2filter1 = _mm_unpacklo_epi64(filter2filter1, filter);
  235|       |
  236|       |  /* signed_char_clamp(qs1 - filter), signed_char_clamp(qs0 - filter1) */
  237|  5.37M|  qs1qs0_work = _mm_subs_epi8(qs1qs0_work, filter2filter1);
  238|       |  /* signed_char_clamp(ps1 + filter), signed_char_clamp(ps0 + filter2) */
  239|  5.37M|  ps1ps0_work = _mm_adds_epi8(ps1ps0_work, hev1);
  240|  5.37M|  *qs1qs0 = _mm_xor_si128(qs1qs0_work, t80); /* ^ 0x80 */
  241|  5.37M|  *ps1ps0 = _mm_xor_si128(ps1ps0_work, t80); /* ^ 0x80 */
  242|  5.37M|}
loopfilter_sse2.c:lpf_internal_8_sse2:
 1313|  1.18M|    __m128i *blimit, __m128i *limit, __m128i *thresh) {
 1314|  1.18M|  const __m128i zero = _mm_setzero_si128();
 1315|  1.18M|  __m128i mask, hev, flat;
 1316|  1.18M|  __m128i p2_16, q2_16, p1_16, p0_16, q0_16, q1_16, p3_16, q3_16, q3p3,
 1317|  1.18M|      flat_p1p0, flat_q0q1;
 1318|  1.18M|  __m128i q2p2, q1p1, q0p0;
 1319|  1.18M|  __m128i q1q0, p1p0, ps1ps0, qs1qs0;
 1320|  1.18M|  __m128i work_pq, opq2, pq2;
 1321|       |
 1322|  1.18M|  q3p3 = _mm_unpacklo_epi32(*p3, *q3);
 1323|  1.18M|  q2p2 = _mm_unpacklo_epi32(*p2, *q2);
 1324|  1.18M|  q1p1 = _mm_unpacklo_epi32(*p1, *q1);
 1325|  1.18M|  q0p0 = _mm_unpacklo_epi32(*p0, *q0);
 1326|       |
 1327|  1.18M|  p1p0 = _mm_unpacklo_epi32(q0p0, q1p1);  // p1p0 q1q0
 1328|  1.18M|  q1q0 = _mm_srli_si128(p1p0, 8);
 1329|       |
 1330|       |  // filter_mask and hev_mask
 1331|       |
 1332|       |  // considering sse doesn't have unsigned elements comparison the idea is to
 1333|       |  // find at least one case when X > limit, it means the corresponding  mask
 1334|       |  // bit is set.
 1335|       |  // to achieve that we find global max value of all inputs of abs(x-y) or
 1336|       |  // (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 If it is > limit the mask is set
 1337|       |  // otherwise - not
 1338|       |
 1339|  1.18M|  const __m128i one = _mm_set1_epi8(1);
 1340|  1.18M|  const __m128i fe = _mm_set1_epi8((char)0xfe);
 1341|  1.18M|  const __m128i ff = _mm_cmpeq_epi8(fe, fe);
 1342|  1.18M|  __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work;
 1343|       |
 1344|  1.18M|  abs_p1p0 = abs_diff(q1p1, q0p0);
 1345|  1.18M|  abs_q1q0 = _mm_srli_si128(abs_p1p0, 4);
 1346|       |
 1347|  1.18M|  abs_p0q0 = abs_diff(p1p0, q1q0);
 1348|  1.18M|  abs_p1q1 = _mm_srli_si128(abs_p0q0, 4);
 1349|       |
 1350|  1.18M|  flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
 1351|  1.18M|  hev = _mm_subs_epu8(flat, *thresh);
 1352|  1.18M|  hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
 1353|       |  // replicate for the further "merged variables" usage
 1354|  1.18M|  hev = _mm_unpacklo_epi32(hev, hev);
 1355|       |
 1356|  1.18M|  abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
 1357|  1.18M|  abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
 1358|  1.18M|  mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
 1359|  1.18M|  mask = _mm_unpacklo_epi32(mask, zero);
 1360|  1.18M|  mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
 1361|       |  // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
 1362|  1.18M|  mask = _mm_max_epu8(abs_p1p0, mask);
 1363|       |  // mask |= (abs(p1 - p0) > limit) * -1;
 1364|       |  // mask |= (abs(q1 - q0) > limit) * -1;
 1365|       |
 1366|  1.18M|  work = _mm_max_epu8(abs_diff(q2p2, q1p1), abs_diff(q3p3, q2p2));
 1367|       |
 1368|  1.18M|  mask = _mm_max_epu8(work, mask);
 1369|  1.18M|  mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 4));
 1370|  1.18M|  mask = _mm_subs_epu8(mask, *limit);
 1371|  1.18M|  mask = _mm_cmpeq_epi8(mask, zero);
 1372|       |
 1373|       |  // lp filter - the same for 6, 8 and 14 versions
 1374|  1.18M|  filter4_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out);
 1375|       |
 1376|       |  // flat_mask4
 1377|  1.18M|  flat = _mm_max_epu8(abs_diff(q2p2, q0p0), abs_diff(q3p3, q0p0));
 1378|  1.18M|  flat = _mm_max_epu8(abs_p1p0, flat);
 1379|       |
 1380|  1.18M|  flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 4));
 1381|  1.18M|  flat = _mm_subs_epu8(flat, one);
 1382|  1.18M|  flat = _mm_cmpeq_epi8(flat, zero);
 1383|  1.18M|  flat = _mm_and_si128(flat, mask);
 1384|       |  // replicate for the further "merged variables" usage
 1385|  1.18M|  flat = _mm_unpacklo_epi32(flat, flat);
 1386|  1.18M|  flat = _mm_unpacklo_epi64(flat, flat);
 1387|       |
 1388|       |  // filter8 need it only if flat !=0
 1389|  1.18M|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (1389:7): [True: 37.0k, False: 1.14M]
  ------------------
 1390|  37.0k|    const __m128i four = _mm_set1_epi16(4);
 1391|  37.0k|    __m128i workp_a, workp_b, workp_c, workp_d, workp_shft1, workp_shft2;
 1392|  37.0k|    p2_16 = _mm_unpacklo_epi8(*p2, zero);
 1393|  37.0k|    p1_16 = _mm_unpacklo_epi8(*p1, zero);
 1394|  37.0k|    p0_16 = _mm_unpacklo_epi8(*p0, zero);
 1395|  37.0k|    q0_16 = _mm_unpacklo_epi8(*q0, zero);
 1396|  37.0k|    q1_16 = _mm_unpacklo_epi8(*q1, zero);
 1397|  37.0k|    q2_16 = _mm_unpacklo_epi8(*q2, zero);
 1398|  37.0k|    p3_16 = _mm_unpacklo_epi8(*p3, zero);
 1399|  37.0k|    q3_16 = _mm_unpacklo_epi8(*q3, zero);
 1400|       |
 1401|       |    // op2
 1402|  37.0k|    workp_a =
 1403|  37.0k|        _mm_add_epi16(_mm_add_epi16(p3_16, p3_16), _mm_add_epi16(p2_16, p1_16));
 1404|  37.0k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0_16);
 1405|  37.0k|    workp_b = _mm_add_epi16(_mm_add_epi16(q0_16, p2_16), p3_16);
 1406|  37.0k|    workp_shft2 = _mm_add_epi16(workp_a, workp_b);
 1407|       |
 1408|       |    // op1
 1409|  37.0k|    workp_b = _mm_add_epi16(_mm_add_epi16(q0_16, q1_16), p1_16);
 1410|  37.0k|    workp_c = _mm_add_epi16(workp_a, workp_b);
 1411|       |    // workp_shft0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1412|       |
 1413|       |    // op0
 1414|  37.0k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3_16), q2_16);
 1415|  37.0k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1_16), p0_16);
 1416|  37.0k|    workp_d = _mm_add_epi16(workp_a, workp_b);
 1417|       |    // workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1418|       |
 1419|  37.0k|    workp_c = _mm_unpacklo_epi64(workp_d, workp_c);
 1420|  37.0k|    workp_c = _mm_srli_epi16(workp_c, 3);
 1421|  37.0k|    flat_p1p0 = _mm_packus_epi16(workp_c, workp_c);
 1422|       |
 1423|       |    // oq0
 1424|  37.0k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3_16), q3_16);
 1425|  37.0k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0_16), q0_16);
 1426|       |    // workp_shft0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1427|  37.0k|    workp_c = _mm_add_epi16(workp_a, workp_b);
 1428|       |
 1429|       |    // oq1
 1430|  37.0k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2_16), q3_16);
 1431|  37.0k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0_16), q1_16);
 1432|  37.0k|    workp_d = _mm_add_epi16(workp_a, workp_b);
 1433|       |    // workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1434|       |
 1435|  37.0k|    workp_c = _mm_unpacklo_epi64(workp_c, workp_d);
 1436|  37.0k|    workp_c = _mm_srli_epi16(workp_c, 3);
 1437|  37.0k|    flat_q0q1 = _mm_packus_epi16(workp_c, workp_c);
 1438|       |
 1439|       |    // oq2
 1440|  37.0k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1_16), q3_16);
 1441|  37.0k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1_16), q2_16);
 1442|  37.0k|    workp_shft1 = _mm_add_epi16(workp_a, workp_b);
 1443|       |
 1444|  37.0k|    workp_c = _mm_unpacklo_epi64(workp_shft2, workp_shft1);
 1445|  37.0k|    workp_c = _mm_srli_epi16(workp_c, 3);
 1446|       |
 1447|  37.0k|    opq2 = _mm_packus_epi16(workp_c, workp_c);
 1448|       |
 1449|  37.0k|    work_pq = _mm_andnot_si128(flat, q2p2);
 1450|  37.0k|    pq2 = _mm_and_si128(flat, opq2);
 1451|  37.0k|    *p2 = _mm_or_si128(work_pq, pq2);
 1452|  37.0k|    *q2 = _mm_srli_si128(*p2, 4);
 1453|       |
 1454|  37.0k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0_out);
 1455|  37.0k|    q1q0 = _mm_and_si128(flat, flat_q0q1);
 1456|  37.0k|    *q1q0_out = _mm_or_si128(qs1qs0, q1q0);
 1457|       |
 1458|  37.0k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0_out);
 1459|  37.0k|    p1p0 = _mm_and_si128(flat, flat_p1p0);
 1460|  37.0k|    *p1p0_out = _mm_or_si128(ps1ps0, p1p0);
 1461|  37.0k|  }
 1462|  1.18M|}
loopfilter_sse2.c:lpf_internal_14_dual_sse2:
  397|  96.8k|    __m128i *thresh) {
  398|  96.8k|  const __m128i zero = _mm_setzero_si128();
  399|  96.8k|  const __m128i one = _mm_set1_epi8(1);
  400|  96.8k|  __m128i mask, hev, flat, flat2;
  401|  96.8k|  __m128i qs0ps0, qs1ps1;
  402|  96.8k|  __m128i p1p0, q1q0, qs1qs0, ps1ps0;
  403|  96.8k|  __m128i abs_p1p0;
  404|       |
  405|  96.8k|  p1p0 = _mm_unpacklo_epi64(*q0p0, *q1p1);
  406|  96.8k|  q1q0 = _mm_unpackhi_epi64(*q0p0, *q1p1);
  407|       |
  408|  96.8k|  {
  409|  96.8k|    __m128i abs_p1q1, abs_p0q0, abs_q1q0;
  410|  96.8k|    __m128i fe, ff, work;
  411|  96.8k|    abs_p1p0 = abs_diff(*q1p1, *q0p0);
  412|  96.8k|    abs_q1q0 = _mm_srli_si128(abs_p1p0, 8);
  413|  96.8k|    fe = _mm_set1_epi8((char)0xfe);
  414|  96.8k|    ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0);
  415|  96.8k|    abs_p0q0 = abs_diff(p1p0, q1q0);
  416|  96.8k|    abs_p1q1 = _mm_srli_si128(abs_p0q0, 8);
  417|  96.8k|    abs_p0q0 = _mm_unpacklo_epi64(abs_p0q0, zero);
  418|       |
  419|  96.8k|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
  420|  96.8k|    hev = _mm_subs_epu8(flat, *thresh);
  421|  96.8k|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
  422|       |    // replicate for the further "merged variables" usage
  423|  96.8k|    hev = _mm_unpacklo_epi64(hev, hev);
  424|       |
  425|  96.8k|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
  426|  96.8k|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
  427|  96.8k|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
  428|  96.8k|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
  429|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
  430|  96.8k|    mask = _mm_max_epu8(abs_p1p0, mask);
  431|       |    // mask |= (abs(p1 - p0) > limit) * -1;
  432|       |    // mask |= (abs(q1 - q0) > limit) * -1;
  433|       |
  434|  96.8k|    work = _mm_max_epu8(abs_diff(*q2p2, *q1p1), abs_diff(*q3p3, *q2p2));
  435|  96.8k|    mask = _mm_max_epu8(work, mask);
  436|  96.8k|    mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8));
  437|  96.8k|    mask = _mm_subs_epu8(mask, *limit);
  438|  96.8k|    mask = _mm_cmpeq_epi8(mask, zero);
  439|  96.8k|  }
  440|       |
  441|       |  // lp filter - the same for 6, 8 and 14 versions
  442|  96.8k|  filter4_dual_sse2(&p1p0, &q1q0, &hev, &mask, &qs1qs0, &ps1ps0);
  443|  96.8k|  qs0ps0 = _mm_unpacklo_epi64(ps1ps0, qs1qs0);
  444|  96.8k|  qs1ps1 = _mm_unpackhi_epi64(ps1ps0, qs1qs0);
  445|       |  // loopfilter done
  446|       |
  447|  96.8k|  __m128i flat2_q5p5, flat2_q4p4, flat2_q3p3, flat2_q2p2;
  448|  96.8k|  __m128i flat2_q1p1, flat2_q0p0, flat_q2p2, flat_q1p1, flat_q0p0;
  449|       |
  450|  96.8k|  __m128i work;
  451|  96.8k|  flat = _mm_max_epu8(abs_diff(*q2p2, *q0p0), abs_diff(*q3p3, *q0p0));
  452|  96.8k|  flat = _mm_max_epu8(abs_p1p0, flat);
  453|  96.8k|  flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8));
  454|  96.8k|  flat = _mm_subs_epu8(flat, one);
  455|  96.8k|  flat = _mm_cmpeq_epi8(flat, zero);
  456|  96.8k|  flat = _mm_and_si128(flat, mask);
  457|       |
  458|       |  // if flat ==0 then flat2 is zero as well and we don't need any calc below
  459|       |  // sse4.1 if (0==_mm_test_all_zeros(flat,ff))
  460|  96.8k|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (460:7): [True: 19.9k, False: 76.9k]
  ------------------
  461|       |    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  462|       |    // flat and wide flat calculations
  463|       |
  464|  19.9k|    const __m128i eight = _mm_set1_epi16(8);
  465|  19.9k|    const __m128i four = _mm_set1_epi16(4);
  466|  19.9k|    __m128i p6_16, p5_16, p4_16, p3_16, p2_16, p1_16, p0_16;
  467|  19.9k|    __m128i q6_16, q5_16, q4_16, q3_16, q2_16, q1_16, q0_16;
  468|  19.9k|    __m128i pixelFilter_p, pixelFilter_q;
  469|  19.9k|    __m128i pixetFilter_p2p1p0, pixetFilter_q2q1q0;
  470|  19.9k|    __m128i sum_p6, sum_q6;
  471|  19.9k|    __m128i sum_p3, sum_q3, res_p, res_q;
  472|       |
  473|  19.9k|    p6_16 = _mm_unpacklo_epi8(*q6p6, zero);
  474|  19.9k|    p5_16 = _mm_unpacklo_epi8(*q5p5, zero);
  475|  19.9k|    p4_16 = _mm_unpacklo_epi8(*q4p4, zero);
  476|  19.9k|    p3_16 = _mm_unpacklo_epi8(*q3p3, zero);
  477|  19.9k|    p2_16 = _mm_unpacklo_epi8(*q2p2, zero);
  478|  19.9k|    p1_16 = _mm_unpacklo_epi8(*q1p1, zero);
  479|  19.9k|    p0_16 = _mm_unpacklo_epi8(*q0p0, zero);
  480|  19.9k|    q0_16 = _mm_unpackhi_epi8(*q0p0, zero);
  481|  19.9k|    q1_16 = _mm_unpackhi_epi8(*q1p1, zero);
  482|  19.9k|    q2_16 = _mm_unpackhi_epi8(*q2p2, zero);
  483|  19.9k|    q3_16 = _mm_unpackhi_epi8(*q3p3, zero);
  484|  19.9k|    q4_16 = _mm_unpackhi_epi8(*q4p4, zero);
  485|  19.9k|    q5_16 = _mm_unpackhi_epi8(*q5p5, zero);
  486|  19.9k|    q6_16 = _mm_unpackhi_epi8(*q6p6, zero);
  487|  19.9k|    pixelFilter_p = _mm_add_epi16(p5_16, _mm_add_epi16(p4_16, p3_16));
  488|  19.9k|    pixelFilter_q = _mm_add_epi16(q5_16, _mm_add_epi16(q4_16, q3_16));
  489|       |
  490|  19.9k|    pixetFilter_p2p1p0 = _mm_add_epi16(p0_16, _mm_add_epi16(p2_16, p1_16));
  491|  19.9k|    pixelFilter_p = _mm_add_epi16(pixelFilter_p, pixetFilter_p2p1p0);
  492|       |
  493|  19.9k|    pixetFilter_q2q1q0 = _mm_add_epi16(q0_16, _mm_add_epi16(q2_16, q1_16));
  494|  19.9k|    pixelFilter_q = _mm_add_epi16(pixelFilter_q, pixetFilter_q2q1q0);
  495|  19.9k|    pixelFilter_p =
  496|  19.9k|        _mm_add_epi16(eight, _mm_add_epi16(pixelFilter_p, pixelFilter_q));
  497|  19.9k|    pixetFilter_p2p1p0 = _mm_add_epi16(
  498|  19.9k|        four, _mm_add_epi16(pixetFilter_p2p1p0, pixetFilter_q2q1q0));
  499|  19.9k|    res_p = _mm_srli_epi16(
  500|  19.9k|        _mm_add_epi16(pixelFilter_p,
  501|  19.9k|                      _mm_add_epi16(_mm_add_epi16(p6_16, p0_16),
  502|  19.9k|                                    _mm_add_epi16(p1_16, q0_16))),
  503|  19.9k|        4);
  504|  19.9k|    res_q = _mm_srli_epi16(
  505|  19.9k|        _mm_add_epi16(pixelFilter_p,
  506|  19.9k|                      _mm_add_epi16(_mm_add_epi16(q6_16, q0_16),
  507|  19.9k|                                    _mm_add_epi16(p0_16, q1_16))),
  508|  19.9k|        4);
  509|  19.9k|    flat2_q0p0 = _mm_packus_epi16(res_p, res_q);
  510|       |
  511|  19.9k|    res_p = _mm_srli_epi16(
  512|  19.9k|        _mm_add_epi16(pixetFilter_p2p1p0, _mm_add_epi16(p3_16, p0_16)), 3);
  513|  19.9k|    res_q = _mm_srli_epi16(
  514|  19.9k|        _mm_add_epi16(pixetFilter_p2p1p0, _mm_add_epi16(q3_16, q0_16)), 3);
  515|       |
  516|  19.9k|    flat_q0p0 = _mm_packus_epi16(res_p, res_q);
  517|       |
  518|  19.9k|    sum_p6 = _mm_add_epi16(p6_16, p6_16);
  519|  19.9k|    sum_q6 = _mm_add_epi16(q6_16, q6_16);
  520|  19.9k|    sum_p3 = _mm_add_epi16(p3_16, p3_16);
  521|  19.9k|    sum_q3 = _mm_add_epi16(q3_16, q3_16);
  522|       |
  523|  19.9k|    pixelFilter_q = _mm_sub_epi16(pixelFilter_p, p5_16);
  524|  19.9k|    pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q5_16);
  525|       |
  526|  19.9k|    res_p = _mm_srli_epi16(
  527|  19.9k|        _mm_add_epi16(
  528|  19.9k|            pixelFilter_p,
  529|  19.9k|            _mm_add_epi16(sum_p6,
  530|  19.9k|                          _mm_add_epi16(p1_16, _mm_add_epi16(p2_16, p0_16)))),
  531|  19.9k|        4);
  532|  19.9k|    res_q = _mm_srli_epi16(
  533|  19.9k|        _mm_add_epi16(
  534|  19.9k|            pixelFilter_q,
  535|  19.9k|            _mm_add_epi16(sum_q6,
  536|  19.9k|                          _mm_add_epi16(q1_16, _mm_add_epi16(q0_16, q2_16)))),
  537|  19.9k|        4);
  538|  19.9k|    flat2_q1p1 = _mm_packus_epi16(res_p, res_q);
  539|       |
  540|  19.9k|    pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_p2p1p0, p2_16);
  541|  19.9k|    pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q2_16);
  542|  19.9k|    res_p = _mm_srli_epi16(
  543|  19.9k|        _mm_add_epi16(pixetFilter_p2p1p0, _mm_add_epi16(sum_p3, p1_16)), 3);
  544|  19.9k|    res_q = _mm_srli_epi16(
  545|  19.9k|        _mm_add_epi16(pixetFilter_q2q1q0, _mm_add_epi16(sum_q3, q1_16)), 3);
  546|  19.9k|    flat_q1p1 = _mm_packus_epi16(res_p, res_q);
  547|       |
  548|  19.9k|    pixetFilter_p2p1p0 = _mm_sub_epi16(pixetFilter_p2p1p0, q1_16);
  549|  19.9k|    pixetFilter_q2q1q0 = _mm_sub_epi16(pixetFilter_q2q1q0, p1_16);
  550|       |
  551|  19.9k|    sum_p3 = _mm_add_epi16(sum_p3, p3_16);
  552|  19.9k|    sum_q3 = _mm_add_epi16(sum_q3, q3_16);
  553|       |
  554|  19.9k|    res_p = _mm_srli_epi16(
  555|  19.9k|        _mm_add_epi16(pixetFilter_p2p1p0, _mm_add_epi16(sum_p3, p2_16)), 3);
  556|  19.9k|    res_q = _mm_srli_epi16(
  557|  19.9k|        _mm_add_epi16(pixetFilter_q2q1q0, _mm_add_epi16(sum_q3, q2_16)), 3);
  558|  19.9k|    flat_q2p2 = _mm_packus_epi16(res_p, res_q);
  559|       |
  560|       |    // work with flat2
  561|  19.9k|    flat2 = _mm_max_epu8(abs_diff(*q4p4, *q0p0), abs_diff(*q5p5, *q0p0));
  562|  19.9k|    work = abs_diff(*q6p6, *q0p0);
  563|  19.9k|    flat2 = _mm_max_epu8(work, flat2);
  564|  19.9k|    flat2 = _mm_max_epu8(flat2, _mm_srli_si128(flat2, 8));
  565|  19.9k|    flat2 = _mm_subs_epu8(flat2, one);
  566|  19.9k|    flat2 = _mm_cmpeq_epi8(flat2, zero);
  567|  19.9k|    flat2 = _mm_and_si128(flat2, flat);  // flat2 & flat & mask
  568|       |
  569|       |    // ~~~~~~~~~~ apply flat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  570|  19.9k|    flat = _mm_unpacklo_epi64(flat, flat);
  571|  19.9k|    *q2p2 = _mm_andnot_si128(flat, *q2p2);
  572|  19.9k|    flat_q2p2 = _mm_and_si128(flat, flat_q2p2);
  573|  19.9k|    *q2p2 = _mm_or_si128(*q2p2, flat_q2p2);
  574|       |
  575|  19.9k|    qs1ps1 = _mm_andnot_si128(flat, qs1ps1);
  576|  19.9k|    flat_q1p1 = _mm_and_si128(flat, flat_q1p1);
  577|  19.9k|    *q1p1 = _mm_or_si128(qs1ps1, flat_q1p1);
  578|       |
  579|  19.9k|    qs0ps0 = _mm_andnot_si128(flat, qs0ps0);
  580|  19.9k|    flat_q0p0 = _mm_and_si128(flat, flat_q0p0);
  581|  19.9k|    *q0p0 = _mm_or_si128(qs0ps0, flat_q0p0);
  582|       |
  583|  19.9k|    if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat2, zero))) {
  ------------------
  |  Branch (583:9): [True: 16.0k, False: 3.91k]
  ------------------
  584|  16.0k|      pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q4_16);
  585|  16.0k|      pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p4_16);
  586|       |
  587|  16.0k|      sum_p6 = _mm_add_epi16(sum_p6, p6_16);
  588|  16.0k|      sum_q6 = _mm_add_epi16(sum_q6, q6_16);
  589|       |
  590|  16.0k|      res_p = _mm_srli_epi16(
  591|  16.0k|          _mm_add_epi16(
  592|  16.0k|              pixelFilter_p,
  593|  16.0k|              _mm_add_epi16(sum_p6,
  594|  16.0k|                            _mm_add_epi16(p2_16, _mm_add_epi16(p3_16, p1_16)))),
  595|  16.0k|          4);
  596|  16.0k|      res_q = _mm_srli_epi16(
  597|  16.0k|          _mm_add_epi16(
  598|  16.0k|              pixelFilter_q,
  599|  16.0k|              _mm_add_epi16(sum_q6,
  600|  16.0k|                            _mm_add_epi16(q2_16, _mm_add_epi16(q1_16, q3_16)))),
  601|  16.0k|          4);
  602|  16.0k|      flat2_q2p2 = _mm_packus_epi16(res_p, res_q);
  603|       |
  604|  16.0k|      sum_p6 = _mm_add_epi16(sum_p6, p6_16);
  605|  16.0k|      sum_q6 = _mm_add_epi16(sum_q6, q6_16);
  606|       |
  607|  16.0k|      pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q3_16);
  608|  16.0k|      pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p3_16);
  609|       |
  610|  16.0k|      res_p = _mm_srli_epi16(
  611|  16.0k|          _mm_add_epi16(
  612|  16.0k|              pixelFilter_p,
  613|  16.0k|              _mm_add_epi16(sum_p6,
  614|  16.0k|                            _mm_add_epi16(p3_16, _mm_add_epi16(p4_16, p2_16)))),
  615|  16.0k|          4);
  616|  16.0k|      res_q = _mm_srli_epi16(
  617|  16.0k|          _mm_add_epi16(
  618|  16.0k|              pixelFilter_q,
  619|  16.0k|              _mm_add_epi16(sum_q6,
  620|  16.0k|                            _mm_add_epi16(q3_16, _mm_add_epi16(q2_16, q4_16)))),
  621|  16.0k|          4);
  622|  16.0k|      flat2_q3p3 = _mm_packus_epi16(res_p, res_q);
  623|       |
  624|  16.0k|      sum_p6 = _mm_add_epi16(sum_p6, p6_16);
  625|  16.0k|      sum_q6 = _mm_add_epi16(sum_q6, q6_16);
  626|       |
  627|  16.0k|      pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q2_16);
  628|  16.0k|      pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p2_16);
  629|       |
  630|  16.0k|      res_p = _mm_srli_epi16(
  631|  16.0k|          _mm_add_epi16(
  632|  16.0k|              pixelFilter_p,
  633|  16.0k|              _mm_add_epi16(sum_p6,
  634|  16.0k|                            _mm_add_epi16(p4_16, _mm_add_epi16(p5_16, p3_16)))),
  635|  16.0k|          4);
  636|  16.0k|      res_q = _mm_srli_epi16(
  637|  16.0k|          _mm_add_epi16(
  638|  16.0k|              pixelFilter_q,
  639|  16.0k|              _mm_add_epi16(sum_q6,
  640|  16.0k|                            _mm_add_epi16(q4_16, _mm_add_epi16(q3_16, q5_16)))),
  641|  16.0k|          4);
  642|  16.0k|      flat2_q4p4 = _mm_packus_epi16(res_p, res_q);
  643|       |
  644|  16.0k|      sum_p6 = _mm_add_epi16(sum_p6, p6_16);
  645|  16.0k|      sum_q6 = _mm_add_epi16(sum_q6, q6_16);
  646|  16.0k|      pixelFilter_p = _mm_sub_epi16(pixelFilter_p, q1_16);
  647|  16.0k|      pixelFilter_q = _mm_sub_epi16(pixelFilter_q, p1_16);
  648|       |
  649|  16.0k|      res_p = _mm_srli_epi16(
  650|  16.0k|          _mm_add_epi16(
  651|  16.0k|              pixelFilter_p,
  652|  16.0k|              _mm_add_epi16(sum_p6,
  653|  16.0k|                            _mm_add_epi16(p5_16, _mm_add_epi16(p6_16, p4_16)))),
  654|  16.0k|          4);
  655|  16.0k|      res_q = _mm_srli_epi16(
  656|  16.0k|          _mm_add_epi16(
  657|  16.0k|              pixelFilter_q,
  658|  16.0k|              _mm_add_epi16(sum_q6,
  659|  16.0k|                            _mm_add_epi16(q5_16, _mm_add_epi16(q6_16, q4_16)))),
  660|  16.0k|          4);
  661|  16.0k|      flat2_q5p5 = _mm_packus_epi16(res_p, res_q);
  662|       |
  663|       |      // wide flat
  664|       |      // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  665|  16.0k|      flat2 = _mm_unpacklo_epi64(flat2, flat2);
  666|       |
  667|  16.0k|      *q5p5 = _mm_andnot_si128(flat2, *q5p5);
  668|  16.0k|      flat2_q5p5 = _mm_and_si128(flat2, flat2_q5p5);
  669|  16.0k|      *q5p5 = _mm_or_si128(*q5p5, flat2_q5p5);
  670|       |
  671|  16.0k|      *q4p4 = _mm_andnot_si128(flat2, *q4p4);
  672|  16.0k|      flat2_q4p4 = _mm_and_si128(flat2, flat2_q4p4);
  673|  16.0k|      *q4p4 = _mm_or_si128(*q4p4, flat2_q4p4);
  674|       |
  675|  16.0k|      *q3p3 = _mm_andnot_si128(flat2, *q3p3);
  676|  16.0k|      flat2_q3p3 = _mm_and_si128(flat2, flat2_q3p3);
  677|  16.0k|      *q3p3 = _mm_or_si128(*q3p3, flat2_q3p3);
  678|       |
  679|  16.0k|      *q2p2 = _mm_andnot_si128(flat2, *q2p2);
  680|  16.0k|      flat2_q2p2 = _mm_and_si128(flat2, flat2_q2p2);
  681|  16.0k|      *q2p2 = _mm_or_si128(*q2p2, flat2_q2p2);
  682|       |
  683|  16.0k|      *q1p1 = _mm_andnot_si128(flat2, *q1p1);
  684|  16.0k|      flat2_q1p1 = _mm_and_si128(flat2, flat2_q1p1);
  685|  16.0k|      *q1p1 = _mm_or_si128(*q1p1, flat2_q1p1);
  686|       |
  687|  16.0k|      *q0p0 = _mm_andnot_si128(flat2, *q0p0);
  688|  16.0k|      flat2_q0p0 = _mm_and_si128(flat2, flat2_q0p0);
  689|  16.0k|      *q0p0 = _mm_or_si128(*q0p0, flat2_q0p0);
  690|  16.0k|    }
  691|  76.9k|  } else {
  692|  76.9k|    *q0p0 = qs0ps0;
  693|  76.9k|    *q1p1 = qs1ps1;
  694|  76.9k|  }
  695|  96.8k|}
loopfilter_sse2.c:lpf_internal_8_dual_sse2:
 1467|  2.58M|    __m128i *blimit, __m128i *limit, __m128i *thresh) {
 1468|  2.58M|  const __m128i zero = _mm_setzero_si128();
 1469|  2.58M|  __m128i mask, hev, flat;
 1470|  2.58M|  __m128i p2_16, q2_16, p1_16, p0_16, q0_16, q1_16, p3_16, q3_16, q3p3,
 1471|  2.58M|      flat_p1p0, flat_q0q1;
 1472|  2.58M|  __m128i q2p2, q1p1, q0p0;
 1473|  2.58M|  __m128i q1q0, p1p0, ps1ps0, qs1qs0;
 1474|  2.58M|  __m128i work_pq, opq2, pq2;
 1475|       |
 1476|  2.58M|  q3p3 = _mm_unpacklo_epi64(*p3, *q3);
 1477|  2.58M|  q2p2 = _mm_unpacklo_epi64(*p2, *q2);
 1478|  2.58M|  q1p1 = _mm_unpacklo_epi64(*p1, *q1);
 1479|  2.58M|  q0p0 = _mm_unpacklo_epi64(*p0, *q0);
 1480|       |
 1481|  2.58M|  p1p0 = _mm_unpacklo_epi64(q0p0, q1p1);
 1482|  2.58M|  q1q0 = _mm_unpackhi_epi64(q0p0, q1p1);
 1483|       |
 1484|  2.58M|  {
 1485|       |    // filter_mask and hev_mask
 1486|       |
 1487|       |    // considering sse doesn't have unsigned elements comparison the idea is to
 1488|       |    // find at least one case when X > limit, it means the corresponding  mask
 1489|       |    // bit is set.
 1490|       |    // to achieve that we find global max value of all inputs of abs(x-y) or
 1491|       |    // (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 If it is > limit the mask is set
 1492|       |    // otherwise - not
 1493|       |
 1494|  2.58M|    const __m128i one = _mm_set1_epi8(1);
 1495|  2.58M|    const __m128i fe = _mm_set1_epi8((char)0xfe);
 1496|  2.58M|    const __m128i ff = _mm_cmpeq_epi8(fe, fe);
 1497|  2.58M|    __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work;
 1498|       |
 1499|  2.58M|    abs_p1p0 = abs_diff(q1p1, q0p0);
 1500|  2.58M|    abs_q1q0 = _mm_srli_si128(abs_p1p0, 8);
 1501|       |
 1502|  2.58M|    abs_p0q0 = abs_diff(p1p0, q1q0);
 1503|  2.58M|    abs_p1q1 = _mm_srli_si128(abs_p0q0, 8);
 1504|  2.58M|    abs_p0q0 = _mm_unpacklo_epi64(abs_p0q0, abs_p0q0);
 1505|       |
 1506|  2.58M|    flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
 1507|  2.58M|    hev = _mm_subs_epu8(flat, *thresh);
 1508|  2.58M|    hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
 1509|       |    // replicate for the further "merged variables" usage
 1510|  2.58M|    hev = _mm_unpacklo_epi64(hev, hev);
 1511|       |
 1512|  2.58M|    abs_p0q0 = _mm_adds_epu8(abs_p0q0, abs_p0q0);
 1513|  2.58M|    abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
 1514|  2.58M|    mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), *blimit);
 1515|  2.58M|    mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
 1516|       |    // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  > blimit) * -1;
 1517|  2.58M|    mask = _mm_max_epu8(abs_p1p0, mask);
 1518|       |    // mask |= (abs(p1 - p0) > limit) * -1;
 1519|       |    // mask |= (abs(q1 - q0) > limit) * -1;
 1520|       |
 1521|  2.58M|    work = _mm_max_epu8(abs_diff(q2p2, q1p1), abs_diff(q3p3, q2p2));
 1522|       |
 1523|  2.58M|    mask = _mm_max_epu8(work, mask);
 1524|  2.58M|    mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8));
 1525|  2.58M|    mask = _mm_subs_epu8(mask, *limit);
 1526|  2.58M|    mask = _mm_cmpeq_epi8(mask, zero);
 1527|       |
 1528|       |    // lp filter - the same for 6, 8 and 14 versions
 1529|  2.58M|    filter4_dual_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out);
 1530|       |
 1531|       |    // flat_mask4
 1532|  2.58M|    flat = _mm_max_epu8(abs_diff(q2p2, q0p0), abs_diff(q3p3, q0p0));
 1533|  2.58M|    flat = _mm_max_epu8(abs_p1p0, flat);
 1534|       |
 1535|  2.58M|    flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8));
 1536|  2.58M|    flat = _mm_subs_epu8(flat, one);
 1537|  2.58M|    flat = _mm_cmpeq_epi8(flat, zero);
 1538|  2.58M|    flat = _mm_and_si128(flat, mask);
 1539|       |    // replicate for the further "merged variables" usage
 1540|  2.58M|    flat = _mm_unpacklo_epi64(flat, flat);
 1541|  2.58M|  }
 1542|       |
 1543|       |  // filter8 need it only if flat !=0
 1544|  2.58M|  if (0xffff != _mm_movemask_epi8(_mm_cmpeq_epi8(flat, zero))) {
  ------------------
  |  Branch (1544:7): [True: 95.6k, False: 2.48M]
  ------------------
 1545|  95.6k|    const __m128i four = _mm_set1_epi16(4);
 1546|       |
 1547|  95.6k|    __m128i workp_a, workp_b, workp_shft0, workp_shft1, workp_shft2;
 1548|  95.6k|    p2_16 = _mm_unpacklo_epi8(*p2, zero);
 1549|  95.6k|    p1_16 = _mm_unpacklo_epi8(*p1, zero);
 1550|  95.6k|    p0_16 = _mm_unpacklo_epi8(*p0, zero);
 1551|  95.6k|    q0_16 = _mm_unpacklo_epi8(*q0, zero);
 1552|  95.6k|    q1_16 = _mm_unpacklo_epi8(*q1, zero);
 1553|  95.6k|    q2_16 = _mm_unpacklo_epi8(*q2, zero);
 1554|  95.6k|    p3_16 = _mm_unpacklo_epi8(*p3, zero);
 1555|  95.6k|    q3_16 = _mm_unpacklo_epi8(*q3, zero);
 1556|       |
 1557|       |    // op2
 1558|  95.6k|    workp_a =
 1559|  95.6k|        _mm_add_epi16(_mm_add_epi16(p3_16, p3_16), _mm_add_epi16(p2_16, p1_16));
 1560|  95.6k|    workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0_16);
 1561|  95.6k|    workp_b = _mm_add_epi16(_mm_add_epi16(q0_16, p2_16), p3_16);
 1562|  95.6k|    workp_shft2 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1563|       |
 1564|       |    // op1
 1565|  95.6k|    workp_b = _mm_add_epi16(_mm_add_epi16(q0_16, q1_16), p1_16);
 1566|  95.6k|    workp_shft0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1567|       |
 1568|       |    // op0
 1569|  95.6k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3_16), q2_16);
 1570|  95.6k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1_16), p0_16);
 1571|  95.6k|    workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1572|       |
 1573|  95.6k|    flat_p1p0 = _mm_packus_epi16(workp_shft1, workp_shft0);
 1574|       |
 1575|       |    // oq0
 1576|  95.6k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3_16), q3_16);
 1577|  95.6k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0_16), q0_16);
 1578|  95.6k|    workp_shft0 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1579|       |
 1580|       |    // oq1
 1581|  95.6k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2_16), q3_16);
 1582|  95.6k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0_16), q1_16);
 1583|  95.6k|    workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1584|       |
 1585|  95.6k|    flat_q0q1 = _mm_packus_epi16(workp_shft0, workp_shft1);
 1586|       |
 1587|       |    // oq2
 1588|  95.6k|    workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1_16), q3_16);
 1589|  95.6k|    workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1_16), q2_16);
 1590|  95.6k|    workp_shft1 = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
 1591|       |
 1592|  95.6k|    opq2 = _mm_packus_epi16(workp_shft2, workp_shft1);
 1593|       |
 1594|  95.6k|    work_pq = _mm_andnot_si128(flat, q2p2);
 1595|  95.6k|    pq2 = _mm_and_si128(flat, opq2);
 1596|  95.6k|    *p2 = _mm_or_si128(work_pq, pq2);
 1597|  95.6k|    *q2 = _mm_srli_si128(*p2, 8);
 1598|       |
 1599|  95.6k|    qs1qs0 = _mm_andnot_si128(flat, *q1q0_out);
 1600|  95.6k|    q1q0 = _mm_and_si128(flat, flat_q0q1);
 1601|  95.6k|    *q1q0_out = _mm_or_si128(qs1qs0, q1q0);
 1602|       |
 1603|  95.6k|    ps1ps0 = _mm_andnot_si128(flat, *p1p0_out);
 1604|  95.6k|    p1p0 = _mm_and_si128(flat, flat_p1p0);
 1605|  95.6k|    *p1p0_out = _mm_or_si128(ps1ps0, p1p0);
 1606|  95.6k|  }
 1607|  2.58M|}
loopfilter_sse2.c:lpf_internal_4_dual_sse2:
  289|  1.97M|    __m128i *thresh, __m128i *q1q0_out, __m128i *p1p0_out) {
  290|  1.97M|  __m128i q1p1, q0p0, p1p0, q1q0;
  291|  1.97M|  __m128i abs_p0q0, abs_p1q1;
  292|  1.97M|  __m128i mask, hev;
  293|  1.97M|  const __m128i zero = _mm_setzero_si128();
  294|       |
  295|  1.97M|  q1p1 = _mm_unpacklo_epi64(*p1, *q1);
  296|  1.97M|  q0p0 = _mm_unpacklo_epi64(*p0, *q0);
  297|       |
  298|  1.97M|  p1p0 = _mm_unpacklo_epi64(q0p0, q1p1);
  299|  1.97M|  q1q0 = _mm_unpackhi_epi64(q0p0, q1p1);
  300|       |
  301|       |  /* (abs(q1 - q0), abs(p1 - p0) */
  302|  1.97M|  __m128i flat = abs_diff(q1p1, q0p0);
  303|       |  /* abs(p1 - q1), abs(p0 - q0) */
  304|  1.97M|  const __m128i abs_p1q1p0q0 = abs_diff(p1p0, q1q0);
  305|       |
  306|       |  /* const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1); */
  307|  1.97M|  flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8));
  308|  1.97M|  hev = _mm_unpacklo_epi8(flat, zero);
  309|       |
  310|  1.97M|  hev = _mm_cmpgt_epi16(hev, *thresh);
  311|  1.97M|  hev = _mm_packs_epi16(hev, hev);
  312|       |
  313|       |  /* const int8_t mask = filter_mask2(*limit, *blimit, */
  314|       |  /*                                  p1, p0, q0, q1); */
  315|  1.97M|  abs_p0q0 = _mm_adds_epu8(abs_p1q1p0q0, abs_p1q1p0q0); /* abs(p0 - q0) * 2 */
  316|  1.97M|  abs_p1q1 = _mm_unpackhi_epi8(abs_p1q1p0q0, abs_p1q1p0q0); /* abs(p1 - q1) */
  317|  1.97M|  abs_p1q1 = _mm_srli_epi16(abs_p1q1, 9);
  318|  1.97M|  abs_p1q1 = _mm_packs_epi16(abs_p1q1, abs_p1q1); /* abs(p1 - q1) / 2 */
  319|       |  /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 */
  320|  1.97M|  mask = _mm_adds_epu8(abs_p0q0, abs_p1q1);
  321|  1.97M|  mask = _mm_unpacklo_epi64(mask, flat);
  322|  1.97M|  mask = _mm_subs_epu8(mask, *limit);
  323|  1.97M|  mask = _mm_cmpeq_epi8(mask, zero);
  324|  1.97M|  mask = _mm_and_si128(mask, _mm_srli_si128(mask, 8));
  325|       |
  326|  1.97M|  filter4_dual_sse2(&p1p0, &q1q0, &hev, &mask, q1q0_out, p1p0_out);
  327|  1.97M|}
loopfilter_sse2.c:transpose_pq_14_sse2:
   33|  78.1k|                                        __m128i *q7p7) {
   34|  78.1k|  __m128i w0, w1, ww0, ww1, w2, w3, ww2, ww3;
   35|  78.1k|  w0 = _mm_unpacklo_epi8(
   36|  78.1k|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
   37|  78.1k|  w1 = _mm_unpacklo_epi8(
   38|  78.1k|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
   39|  78.1k|  w2 = _mm_unpackhi_epi8(
   40|  78.1k|      *x0, *x1);  // 08 18 09 19 010 110 011 111 012 112 013 113 014 114 015 115
   41|  78.1k|  w3 = _mm_unpackhi_epi8(
   42|  78.1k|      *x2, *x3);  // 28 38 29 39 210 310 211 311 212 312 213 313 214 314 215 315
   43|       |
   44|  78.1k|  ww0 = _mm_unpacklo_epi16(
   45|  78.1k|      w0, w1);  // 00 10 20 30 01 11 21 31        02 12 22 32 03 13 23 33
   46|  78.1k|  ww1 = _mm_unpackhi_epi16(
   47|  78.1k|      w0, w1);  // 04 14 24 34 05 15 25 35        06 16 26 36 07 17 27 37
   48|  78.1k|  ww2 = _mm_unpacklo_epi16(
   49|  78.1k|      w2, w3);  // 08 18 28 38 09 19 29 39       010 110 210 310 011 111 211 311
   50|  78.1k|  ww3 = _mm_unpackhi_epi16(
   51|  78.1k|      w2,
   52|  78.1k|      w3);  // 012 112 212 312 013 113 213 313  014 114 214 314 015 115 215 315
   53|       |
   54|  78.1k|  *q7p7 = _mm_unpacklo_epi32(
   55|  78.1k|      ww0,
   56|  78.1k|      _mm_srli_si128(
   57|  78.1k|          ww3, 12));  // 00 10 20 30  015 115 215 315  xx xx xx xx xx xx xx xx
   58|  78.1k|  *q6p6 = _mm_unpackhi_epi32(
   59|  78.1k|      _mm_slli_si128(ww0, 4),
   60|  78.1k|      ww3);  // 01 11 21 31  014 114 214 314  xx xx xx xxxx xx xx xx
   61|  78.1k|  *q5p5 = _mm_unpackhi_epi32(
   62|  78.1k|      ww0,
   63|  78.1k|      _mm_slli_si128(
   64|  78.1k|          ww3, 4));  // 02 12 22 32  013 113 213 313  xx xx xx x xx xx xx xxx
   65|  78.1k|  *q4p4 = _mm_unpacklo_epi32(
   66|  78.1k|      _mm_srli_si128(ww0, 12),
   67|  78.1k|      ww3);  // 03 13 23 33  012 112 212 312 xx xx xx xx xx xx xx xx
   68|  78.1k|  *q3p3 = _mm_unpacklo_epi32(
   69|  78.1k|      ww1,
   70|  78.1k|      _mm_srli_si128(
   71|  78.1k|          ww2, 12));  // 04 14 24 34  011 111 211 311 xx xx xx xx xx xx xx xx
   72|  78.1k|  *q2p2 = _mm_unpackhi_epi32(
   73|  78.1k|      _mm_slli_si128(ww1, 4),
   74|  78.1k|      ww2);  // 05 15 25 35   010 110 210 310 xx xx xx xx xx xx xx xx
   75|  78.1k|  *q1p1 = _mm_unpackhi_epi32(
   76|  78.1k|      ww1,
   77|  78.1k|      _mm_slli_si128(
   78|  78.1k|          ww2, 4));  // 06 16 26 36   09 19 29 39     xx xx xx xx xx xx xx xx
   79|  78.1k|  *q0p0 = _mm_unpacklo_epi32(
   80|       |      _mm_srli_si128(ww1, 12),
   81|  78.1k|      ww2);  // 07 17 27 37  08 18 28 38     xx xx xx xx xx xx xx xx
   82|  78.1k|}
loopfilter_sse2.c:transpose_pq_14_inv_sse2:
   92|  78.1k|                                            __m128i *pq2, __m128i *pq3) {
   93|  78.1k|  __m128i w10, w11, w12, w13;
   94|  78.1k|  __m128i w0, w1, w2, w3, w4, w5;
   95|  78.1k|  __m128i d0, d1, d2, d3;
   96|       |
   97|  78.1k|  w0 = _mm_unpacklo_epi8(
   98|  78.1k|      *x0, *x1);  // p 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
   99|  78.1k|  w1 = _mm_unpacklo_epi8(
  100|  78.1k|      *x2, *x3);  // p 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  101|  78.1k|  w2 = _mm_unpacklo_epi8(
  102|  78.1k|      *x4, *x5);  // p 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57
  103|  78.1k|  w3 = _mm_unpacklo_epi8(
  104|  78.1k|      *x6, *x7);  // p 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77
  105|       |
  106|  78.1k|  w4 = _mm_unpacklo_epi16(
  107|  78.1k|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  108|  78.1k|  w5 = _mm_unpacklo_epi16(
  109|  78.1k|      w2, w3);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  110|       |
  111|  78.1k|  d0 = _mm_unpacklo_epi32(
  112|  78.1k|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  113|  78.1k|  d2 = _mm_unpackhi_epi32(
  114|  78.1k|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  115|       |
  116|  78.1k|  w10 = _mm_unpacklo_epi8(
  117|  78.1k|      *x7, *x6);  // q xx xx xx xx xx xx xx xx 00 10 01 11 02 12 03 13
  118|  78.1k|  w11 = _mm_unpacklo_epi8(
  119|  78.1k|      *x5, *x4);  // q  xx xx xx xx xx xx xx xx 20 30 21 31 22 32 23 33
  120|  78.1k|  w12 = _mm_unpacklo_epi8(
  121|  78.1k|      *x3, *x2);  // q  xx xx xx xx xx xx xx xx 40 50 41 51 42 52 43 53
  122|  78.1k|  w13 = _mm_unpacklo_epi8(
  123|  78.1k|      *x1, *x0);  // q  xx xx xx xx xx xx xx xx 60 70 61 71 62 72 63 73
  124|       |
  125|  78.1k|  w4 = _mm_unpackhi_epi16(
  126|  78.1k|      w10, w11);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  127|  78.1k|  w5 = _mm_unpackhi_epi16(
  128|  78.1k|      w12, w13);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  129|       |
  130|  78.1k|  d1 = _mm_unpacklo_epi32(
  131|  78.1k|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  132|  78.1k|  d3 = _mm_unpackhi_epi32(
  133|  78.1k|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  134|       |
  135|  78.1k|  *pq0 = _mm_unpacklo_epi64(d0, d1);  // pq
  136|  78.1k|  *pq1 = _mm_unpackhi_epi64(d0, d1);  // pq
  137|  78.1k|  *pq2 = _mm_unpacklo_epi64(d2, d3);  // pq
  138|  78.1k|  *pq3 = _mm_unpackhi_epi64(d2, d3);  // pq
  139|  78.1k|}
loopfilter_sse2.c:abs_diff:
   21|  37.6M|static inline __m128i abs_diff(__m128i a, __m128i b) {
   22|  37.6M|  return _mm_or_si128(_mm_subs_epu8(a, b), _mm_subs_epu8(b, a));
   23|  37.6M|}

loopfilter_sse2.c:transpose4x8_8x4_low_sse2:
  222|  2.29M|                                             __m128i *d2, __m128i *d3) {
  223|       |  // input
  224|       |  // x0   00 01 02 03 04 05 06 07 xx xx xx xx xx xx xx xx
  225|       |  // x1   10 11 12 13 14 15 16 17 xx xx xx xx xx xx xx xx
  226|       |  // x2   20 21 22 23 24 25 26 27 xx xx xx xx xx xx xx xx
  227|       |  // x3   30 31 32 33 34 35 36 37 xx xx xx xx xx xx xx xx
  228|       |  // output
  229|       |  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  230|       |  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  231|       |  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  232|       |  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  233|       |
  234|  2.29M|  __m128i w0, w1;
  235|       |
  236|  2.29M|  w0 = _mm_unpacklo_epi8(
  237|  2.29M|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  238|  2.29M|  w1 = _mm_unpacklo_epi8(
  239|  2.29M|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  240|       |
  241|  2.29M|  *d0 = _mm_unpacklo_epi16(
  242|  2.29M|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  243|       |
  244|  2.29M|  *d1 = _mm_srli_si128(*d0,
  245|  2.29M|                       4);  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  246|  2.29M|  *d2 = _mm_srli_si128(*d0,
  247|  2.29M|                       8);  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  248|       |  *d3 = _mm_srli_si128(*d0,
  249|  2.29M|                       12);  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  250|  2.29M|}
loopfilter_sse2.c:transpose8x8_low_sse2:
  305|  1.79M|                                         __m128i *d3) {
  306|       |  // input
  307|       |  // x0 00 01 02 03 04 05 06 07
  308|       |  // x1 10 11 12 13 14 15 16 17
  309|       |  // x2 20 21 22 23 24 25 26 27
  310|       |  // x3 30 31 32 33 34 35 36 37
  311|       |  // x4 40 41 42 43 44 45 46 47
  312|       |  // x5  50 51 52 53 54 55 56 57
  313|       |  // x6  60 61 62 63 64 65 66 67
  314|       |  // x7 70 71 72 73 74 75 76 77
  315|       |  // output
  316|       |  // d0 00 10 20 30 40 50 60 70 xx xx xx xx xx xx xx
  317|       |  // d1 01 11 21 31 41 51 61 71 xx xx xx xx xx xx xx xx
  318|       |  // d2 02 12 22 32 42 52 62 72 xx xx xx xx xx xx xx xx
  319|       |  // d3 03 13 23 33 43 53 63 73 xx xx xx xx xx xx xx xx
  320|       |
  321|  1.79M|  __m128i w0, w1, w2, w3, w4, w5;
  322|       |
  323|  1.79M|  w0 = _mm_unpacklo_epi8(
  324|  1.79M|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  325|       |
  326|  1.79M|  w1 = _mm_unpacklo_epi8(
  327|  1.79M|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  328|       |
  329|  1.79M|  w2 = _mm_unpacklo_epi8(
  330|  1.79M|      *x4, *x5);  // 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57
  331|       |
  332|  1.79M|  w3 = _mm_unpacklo_epi8(
  333|  1.79M|      *x6, *x7);  // 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77
  334|       |
  335|  1.79M|  w4 = _mm_unpacklo_epi16(
  336|  1.79M|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  337|  1.79M|  w5 = _mm_unpacklo_epi16(
  338|  1.79M|      w2, w3);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  339|       |
  340|  1.79M|  *d0 = _mm_unpacklo_epi32(
  341|  1.79M|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  342|  1.79M|  *d1 = _mm_srli_si128(*d0, 8);
  343|  1.79M|  *d2 = _mm_unpackhi_epi32(
  344|  1.79M|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  345|       |  *d3 = _mm_srli_si128(*d2, 8);
  346|  1.79M|}
loopfilter_sse2.c:transpose4x8_8x4_sse2:
  256|  2.32M|                                         __m128i *d7) {
  257|       |  // input
  258|       |  // x0   00 01 02 03 04 05 06 07 xx xx xx xx xx xx xx xx
  259|       |  // x1   10 11 12 13 14 15 16 17 xx xx xx xx xx xx xx xx
  260|       |  // x2   20 21 22 23 24 25 26 27 xx xx xx xx xx xx xx xx
  261|       |  // x3   30 31 32 33 34 35 36 37 xx xx xx xx xx xx xx xx
  262|       |  // output
  263|       |  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  264|       |  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  265|       |  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  266|       |  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  267|       |  // 04 14 24 34 xx xx xx xx xx xx xx xx xx xx xx xx
  268|       |  // 05 15 25 35 xx xx xx xx xx xx xx xx xx xx xx xx
  269|       |  // 06 16 26 36 xx xx xx xx xx xx xx xx xx xx xx xx
  270|       |  // 07 17 27 37 xx xx xx xx xx xx xx xx xx xx xx xx
  271|       |
  272|  2.32M|  __m128i w0, w1, ww0, ww1;
  273|       |
  274|  2.32M|  w0 = _mm_unpacklo_epi8(
  275|  2.32M|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  276|  2.32M|  w1 = _mm_unpacklo_epi8(
  277|  2.32M|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  278|       |
  279|  2.32M|  ww0 = _mm_unpacklo_epi16(
  280|  2.32M|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  281|  2.32M|  ww1 = _mm_unpackhi_epi16(
  282|  2.32M|      w0, w1);  // 04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37
  283|       |
  284|  2.32M|  *d0 = ww0;  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  285|  2.32M|  *d1 = _mm_srli_si128(ww0,
  286|  2.32M|                       4);  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  287|  2.32M|  *d2 = _mm_srli_si128(ww0,
  288|  2.32M|                       8);  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  289|  2.32M|  *d3 = _mm_srli_si128(ww0,
  290|  2.32M|                       12);  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  291|       |
  292|  2.32M|  *d4 = ww1;  // 04 14 24 34 xx xx xx xx xx xx xx xx xx xx xx xx
  293|  2.32M|  *d5 = _mm_srli_si128(ww1,
  294|  2.32M|                       4);  // 05 15 25 35 xx xx xx xx xx xx xx xx xx xx xx xx
  295|  2.32M|  *d6 = _mm_srli_si128(ww1,
  296|  2.32M|                       8);  // 06 16 26 36 xx xx xx xx xx xx xx xx xx xx xx xx
  297|       |  *d7 = _mm_srli_si128(ww1,
  298|  2.32M|                       12);  // 07 17 27 37 xx xx xx xx xx xx xx xx xx xx xx xx
  299|  2.32M|}
loopfilter_sse2.c:transpose8x8_sse2:
  352|  2.98M|                                     __m128i *d6d7) {
  353|  2.98M|  __m128i w0, w1, w2, w3, w4, w5, w6, w7;
  354|       |  // x0 00 01 02 03 04 05 06 07
  355|       |  // x1 10 11 12 13 14 15 16 17
  356|  2.98M|  w0 = _mm_unpacklo_epi8(
  357|  2.98M|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  358|       |
  359|       |  // x2 20 21 22 23 24 25 26 27
  360|       |  // x3 30 31 32 33 34 35 36 37
  361|  2.98M|  w1 = _mm_unpacklo_epi8(
  362|  2.98M|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  363|       |
  364|       |  // x4 40 41 42 43 44 45 46 47
  365|       |  // x5  50 51 52 53 54 55 56 57
  366|  2.98M|  w2 = _mm_unpacklo_epi8(
  367|  2.98M|      *x4, *x5);  // 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57
  368|       |
  369|       |  // x6  60 61 62 63 64 65 66 67
  370|       |  // x7 70 71 72 73 74 75 76 77
  371|  2.98M|  w3 = _mm_unpacklo_epi8(
  372|  2.98M|      *x6, *x7);  // 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77
  373|       |
  374|  2.98M|  w4 = _mm_unpacklo_epi16(
  375|  2.98M|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  376|  2.98M|  w5 = _mm_unpacklo_epi16(
  377|  2.98M|      w2, w3);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  378|       |
  379|  2.98M|  *d0d1 = _mm_unpacklo_epi32(
  380|  2.98M|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  381|  2.98M|  *d2d3 = _mm_unpackhi_epi32(
  382|  2.98M|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  383|       |
  384|  2.98M|  w6 = _mm_unpackhi_epi16(
  385|  2.98M|      w0, w1);  // 04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37
  386|  2.98M|  w7 = _mm_unpackhi_epi16(
  387|  2.98M|      w2, w3);  // 44 54 64 74 45 55 65 75 46 56 66 76 47 57 67 77
  388|       |
  389|  2.98M|  *d4d5 = _mm_unpacklo_epi32(
  390|  2.98M|      w6, w7);  // 04 14 24 34 44 54 64 74 05 15 25 35 45 55 65 75
  391|  2.98M|  *d6d7 = _mm_unpackhi_epi32(
  392|  2.98M|      w6, w7);  // 06 16 26 36 46 56 66 76 07 17 27 37 47 57 67 77
  393|  2.98M|}
loopfilter_sse2.c:transpose8x16_16x8_sse2:
  451|  46.6k|    __m128i *d12d13, __m128i *d14d15) {
  452|  46.6k|  __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
  453|  46.6k|  __m128i w10, w11, w12, w13, w14, w15;
  454|       |
  455|  46.6k|  w0 = _mm_unpacklo_epi8(*x0, *x1);
  456|  46.6k|  w1 = _mm_unpacklo_epi8(*x2, *x3);
  457|  46.6k|  w2 = _mm_unpacklo_epi8(*x4, *x5);
  458|  46.6k|  w3 = _mm_unpacklo_epi8(*x6, *x7);
  459|       |
  460|  46.6k|  w8 = _mm_unpackhi_epi8(*x0, *x1);
  461|  46.6k|  w9 = _mm_unpackhi_epi8(*x2, *x3);
  462|  46.6k|  w10 = _mm_unpackhi_epi8(*x4, *x5);
  463|  46.6k|  w11 = _mm_unpackhi_epi8(*x6, *x7);
  464|       |
  465|  46.6k|  w4 = _mm_unpacklo_epi16(w0, w1);
  466|  46.6k|  w5 = _mm_unpacklo_epi16(w2, w3);
  467|  46.6k|  w12 = _mm_unpacklo_epi16(w8, w9);
  468|  46.6k|  w13 = _mm_unpacklo_epi16(w10, w11);
  469|       |
  470|  46.6k|  w6 = _mm_unpacklo_epi32(w4, w5);
  471|  46.6k|  w7 = _mm_unpackhi_epi32(w4, w5);
  472|  46.6k|  w14 = _mm_unpacklo_epi32(w12, w13);
  473|  46.6k|  w15 = _mm_unpackhi_epi32(w12, w13);
  474|       |
  475|       |  // Store first 4-line result
  476|  46.6k|  *d0d1 = _mm_unpacklo_epi64(w6, w14);
  477|  46.6k|  *d2d3 = _mm_unpackhi_epi64(w6, w14);
  478|  46.6k|  *d4d5 = _mm_unpacklo_epi64(w7, w15);
  479|  46.6k|  *d6d7 = _mm_unpackhi_epi64(w7, w15);
  480|       |
  481|  46.6k|  w4 = _mm_unpackhi_epi16(w0, w1);
  482|  46.6k|  w5 = _mm_unpackhi_epi16(w2, w3);
  483|  46.6k|  w12 = _mm_unpackhi_epi16(w8, w9);
  484|  46.6k|  w13 = _mm_unpackhi_epi16(w10, w11);
  485|       |
  486|  46.6k|  w6 = _mm_unpacklo_epi32(w4, w5);
  487|  46.6k|  w7 = _mm_unpackhi_epi32(w4, w5);
  488|  46.6k|  w14 = _mm_unpacklo_epi32(w12, w13);
  489|  46.6k|  w15 = _mm_unpackhi_epi32(w12, w13);
  490|       |
  491|       |  // Store second 4-line result
  492|  46.6k|  *d8d9 = _mm_unpacklo_epi64(w6, w14);
  493|  46.6k|  *d10d11 = _mm_unpackhi_epi64(w6, w14);
  494|  46.6k|  *d12d13 = _mm_unpacklo_epi64(w7, w15);
  495|  46.6k|  *d14d15 = _mm_unpackhi_epi64(w7, w15);
  496|  46.6k|}
loopfilter_sse2.c:transpose16x8_8x16_sse2:
  400|  46.6k|    __m128i *d4, __m128i *d5, __m128i *d6, __m128i *d7) {
  401|  46.6k|  __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
  402|  46.6k|  __m128i w10, w11, w12, w13, w14, w15;
  403|       |
  404|  46.6k|  w0 = _mm_unpacklo_epi8(*x0, *x1);
  405|  46.6k|  w1 = _mm_unpacklo_epi8(*x2, *x3);
  406|  46.6k|  w2 = _mm_unpacklo_epi8(*x4, *x5);
  407|  46.6k|  w3 = _mm_unpacklo_epi8(*x6, *x7);
  408|       |
  409|  46.6k|  w8 = _mm_unpacklo_epi8(*x8, *x9);
  410|  46.6k|  w9 = _mm_unpacklo_epi8(*x10, *x11);
  411|  46.6k|  w10 = _mm_unpacklo_epi8(*x12, *x13);
  412|  46.6k|  w11 = _mm_unpacklo_epi8(*x14, *x15);
  413|       |
  414|  46.6k|  w4 = _mm_unpacklo_epi16(w0, w1);
  415|  46.6k|  w5 = _mm_unpacklo_epi16(w2, w3);
  416|  46.6k|  w12 = _mm_unpacklo_epi16(w8, w9);
  417|  46.6k|  w13 = _mm_unpacklo_epi16(w10, w11);
  418|       |
  419|  46.6k|  w6 = _mm_unpacklo_epi32(w4, w5);
  420|  46.6k|  w7 = _mm_unpackhi_epi32(w4, w5);
  421|  46.6k|  w14 = _mm_unpacklo_epi32(w12, w13);
  422|  46.6k|  w15 = _mm_unpackhi_epi32(w12, w13);
  423|       |
  424|       |  // Store first 4-line result
  425|  46.6k|  *d0 = _mm_unpacklo_epi64(w6, w14);
  426|  46.6k|  *d1 = _mm_unpackhi_epi64(w6, w14);
  427|  46.6k|  *d2 = _mm_unpacklo_epi64(w7, w15);
  428|  46.6k|  *d3 = _mm_unpackhi_epi64(w7, w15);
  429|       |
  430|  46.6k|  w4 = _mm_unpackhi_epi16(w0, w1);
  431|  46.6k|  w5 = _mm_unpackhi_epi16(w2, w3);
  432|  46.6k|  w12 = _mm_unpackhi_epi16(w8, w9);
  433|  46.6k|  w13 = _mm_unpackhi_epi16(w10, w11);
  434|       |
  435|  46.6k|  w6 = _mm_unpacklo_epi32(w4, w5);
  436|  46.6k|  w7 = _mm_unpackhi_epi32(w4, w5);
  437|  46.6k|  w14 = _mm_unpacklo_epi32(w12, w13);
  438|  46.6k|  w15 = _mm_unpackhi_epi32(w12, w13);
  439|       |
  440|       |  // Store second 4-line result
  441|  46.6k|  *d4 = _mm_unpacklo_epi64(w6, w14);
  442|  46.6k|  *d5 = _mm_unpackhi_epi64(w6, w14);
  443|  46.6k|  *d6 = _mm_unpacklo_epi64(w7, w15);
  444|  46.6k|  *d7 = _mm_unpackhi_epi64(w7, w15);
  445|  46.6k|}
loopfilter_sse2.c:transpose_16x8:
  499|   220k|                                  int in_p, unsigned char *out, int out_p) {
  500|   220k|  __m128i x0, x1, x2, x3, x4, x5, x6, x7;
  501|   220k|  __m128i x8, x9, x10, x11, x12, x13, x14, x15;
  502|       |
  503|   220k|  x0 = _mm_loadl_epi64((__m128i *)in0);
  504|   220k|  x1 = _mm_loadl_epi64((__m128i *)(in0 + in_p));
  505|   220k|  x0 = _mm_unpacklo_epi8(x0, x1);
  506|       |
  507|   220k|  x2 = _mm_loadl_epi64((__m128i *)(in0 + 2 * in_p));
  508|   220k|  x3 = _mm_loadl_epi64((__m128i *)(in0 + 3 * in_p));
  509|   220k|  x1 = _mm_unpacklo_epi8(x2, x3);
  510|       |
  511|   220k|  x4 = _mm_loadl_epi64((__m128i *)(in0 + 4 * in_p));
  512|   220k|  x5 = _mm_loadl_epi64((__m128i *)(in0 + 5 * in_p));
  513|   220k|  x2 = _mm_unpacklo_epi8(x4, x5);
  514|       |
  515|   220k|  x6 = _mm_loadl_epi64((__m128i *)(in0 + 6 * in_p));
  516|   220k|  x7 = _mm_loadl_epi64((__m128i *)(in0 + 7 * in_p));
  517|   220k|  x3 = _mm_unpacklo_epi8(x6, x7);
  518|   220k|  x4 = _mm_unpacklo_epi16(x0, x1);
  519|       |
  520|   220k|  x8 = _mm_loadl_epi64((__m128i *)in1);
  521|   220k|  x9 = _mm_loadl_epi64((__m128i *)(in1 + in_p));
  522|   220k|  x8 = _mm_unpacklo_epi8(x8, x9);
  523|   220k|  x5 = _mm_unpacklo_epi16(x2, x3);
  524|       |
  525|   220k|  x10 = _mm_loadl_epi64((__m128i *)(in1 + 2 * in_p));
  526|   220k|  x11 = _mm_loadl_epi64((__m128i *)(in1 + 3 * in_p));
  527|   220k|  x9 = _mm_unpacklo_epi8(x10, x11);
  528|       |
  529|   220k|  x12 = _mm_loadl_epi64((__m128i *)(in1 + 4 * in_p));
  530|   220k|  x13 = _mm_loadl_epi64((__m128i *)(in1 + 5 * in_p));
  531|   220k|  x10 = _mm_unpacklo_epi8(x12, x13);
  532|   220k|  x12 = _mm_unpacklo_epi16(x8, x9);
  533|       |
  534|   220k|  x14 = _mm_loadl_epi64((__m128i *)(in1 + 6 * in_p));
  535|   220k|  x15 = _mm_loadl_epi64((__m128i *)(in1 + 7 * in_p));
  536|   220k|  x11 = _mm_unpacklo_epi8(x14, x15);
  537|   220k|  x13 = _mm_unpacklo_epi16(x10, x11);
  538|       |
  539|   220k|  x6 = _mm_unpacklo_epi32(x4, x5);
  540|   220k|  x7 = _mm_unpackhi_epi32(x4, x5);
  541|   220k|  x14 = _mm_unpacklo_epi32(x12, x13);
  542|   220k|  x15 = _mm_unpackhi_epi32(x12, x13);
  543|       |
  544|       |  // Store first 4-line result
  545|   220k|  _mm_storeu_si128((__m128i *)out, _mm_unpacklo_epi64(x6, x14));
  546|   220k|  _mm_storeu_si128((__m128i *)(out + out_p), _mm_unpackhi_epi64(x6, x14));
  547|   220k|  _mm_storeu_si128((__m128i *)(out + 2 * out_p), _mm_unpacklo_epi64(x7, x15));
  548|   220k|  _mm_storeu_si128((__m128i *)(out + 3 * out_p), _mm_unpackhi_epi64(x7, x15));
  549|       |
  550|   220k|  x4 = _mm_unpackhi_epi16(x0, x1);
  551|   220k|  x5 = _mm_unpackhi_epi16(x2, x3);
  552|   220k|  x12 = _mm_unpackhi_epi16(x8, x9);
  553|   220k|  x13 = _mm_unpackhi_epi16(x10, x11);
  554|       |
  555|   220k|  x6 = _mm_unpacklo_epi32(x4, x5);
  556|   220k|  x7 = _mm_unpackhi_epi32(x4, x5);
  557|   220k|  x14 = _mm_unpacklo_epi32(x12, x13);
  558|   220k|  x15 = _mm_unpackhi_epi32(x12, x13);
  559|       |
  560|       |  // Store second 4-line result
  561|   220k|  _mm_storeu_si128((__m128i *)(out + 4 * out_p), _mm_unpacklo_epi64(x6, x14));
  562|   220k|  _mm_storeu_si128((__m128i *)(out + 5 * out_p), _mm_unpackhi_epi64(x6, x14));
  563|   220k|  _mm_storeu_si128((__m128i *)(out + 6 * out_p), _mm_unpacklo_epi64(x7, x15));
  564|   220k|  _mm_storeu_si128((__m128i *)(out + 7 * out_p), _mm_unpackhi_epi64(x7, x15));
  565|   220k|}
loopfilter_sse2.c:transpose_16x8_to_8x16:
  568|   221k|                                          unsigned char *dst, int out_p) {
  569|       |  // a0 b0 c0 d0 e0 f0 g0 h0 A0 B0 C0 D0 E0 F0 G0 H0
  570|       |  // a1 b1 c1 d1 e1 f1 g1 h1 A1 B1 C1 D1 E1 F1 G1 H1
  571|       |  // a2 b2 c2 d2 e2 f2 g2 h2 A2 B2 C2 D2 E2 F2 G2 H2
  572|       |  // a3 b3 c3 d3 e3 f3 g3 h3 A3 B3 C3 D3 E3 F3 G3 H3
  573|       |  // a4 b4 c4 d4 e4 f4 g4 h4 A4 B4 C4 D4 E4 F4 G4 H4
  574|       |  // a5 b5 c5 d5 e5 f5 g5 h5 A5 B5 C5 D5 E5 F5 G5 H5
  575|       |  // a6 b6 c6 d6 e6 f6 g6 h6 A6 B6 C6 D6 E6 F6 G6 H6
  576|       |  // a7 b7 c7 d7 e7 f7 g7 h7 A7 B7 C7 D7 E7 F7 G7 H7
  577|   221k|  const __m128i x0 = _mm_loadu_si128((__m128i *)(src));
  578|   221k|  const __m128i x1 = _mm_loadu_si128((__m128i *)(src + (1 * in_p)));
  579|   221k|  const __m128i x2 = _mm_loadu_si128((__m128i *)(src + (2 * in_p)));
  580|   221k|  const __m128i x3 = _mm_loadu_si128((__m128i *)(src + (3 * in_p)));
  581|   221k|  const __m128i x4 = _mm_loadu_si128((__m128i *)(src + (4 * in_p)));
  582|   221k|  const __m128i x5 = _mm_loadu_si128((__m128i *)(src + (5 * in_p)));
  583|   221k|  const __m128i x6 = _mm_loadu_si128((__m128i *)(src + (6 * in_p)));
  584|   221k|  const __m128i x7 = _mm_loadu_si128((__m128i *)(src + (7 * in_p)));
  585|       |
  586|       |  // a0 a1 b0 b1 c0 c1 d0 d1 A0 A1 B0 B1 C0 C1 D0 D1
  587|       |  // e0 e1 f0 f1 g0 g1 h0 h1 E0 E1 F0 F1 G0 G1 H0 H1
  588|       |  // a2 a3 b2 b3 c2 c3 d2 d3 A2 A3 B2 B3 C2 C3 D2 D3
  589|       |  // e2 e3 f2 f3 g2 g3 h2 h3 E2 E3 F2 F3 G2 G3 H2 H3
  590|       |  // a4 a5 b4 b5 c4 c5 d4 d5 A4 A5 B4 B5 C4 C5 D4 D5
  591|       |  // e4 e5 f4 f5 g4 g5 h4 h5 E4 E5 F4 F5 G4 G5 H4 H5
  592|       |  // a6 a7 b6 b7 c6 c7 d6 d7 A6 A7 B6 B7 C6 C7 D6 D7
  593|       |  // e6 e7 f6 f7 g6 g7 h6 h7 E6 E7 F6 F7 G6 G7 H6 H7
  594|   221k|  const __m128i x_s10 = _mm_unpacklo_epi8(x0, x1);
  595|   221k|  const __m128i x_s11 = _mm_unpackhi_epi8(x0, x1);
  596|   221k|  const __m128i x_s12 = _mm_unpacklo_epi8(x2, x3);
  597|   221k|  const __m128i x_s13 = _mm_unpackhi_epi8(x2, x3);
  598|   221k|  const __m128i x_s14 = _mm_unpacklo_epi8(x4, x5);
  599|   221k|  const __m128i x_s15 = _mm_unpackhi_epi8(x4, x5);
  600|   221k|  const __m128i x_s16 = _mm_unpacklo_epi8(x6, x7);
  601|   221k|  const __m128i x_s17 = _mm_unpackhi_epi8(x6, x7);
  602|       |
  603|       |  // a0 a1 a2 a3 b0 b1 b2 b3 | A0 A1 A2 A3 B0 B1 B2 B3
  604|       |  // c0 c1 c2 c3 d0 d1 d2 d3 | C0 C1 C2 C3 D0 D1 D2 D3
  605|       |  // e0 e1 e2 e3 f0 f1 f2 f3 | E0 E1 E2 E3 F0 F1 F2 F3
  606|       |  // g0 g1 g2 g3 h0 h1 h2 h3 | G0 G1 G2 G3 H0 H1 H2 H3
  607|       |  // a4 a5 a6 a7 b4 b5 b6 b7 | A4 A5 A6 A7 B4 B5 B6 B7
  608|       |  // c4 c5 c6 c7 d4 d5 d6 d7 | C4 C5 C6 C7 D4 D5 D6 D7
  609|       |  // e4 e5 e6 e7 f4 f5 f6 f7 | E4 E5 E6 E7 F4 F5 F6 F7
  610|       |  // g4 g5 g6 g7 h4 h5 h6 h7 | G4 G5 G6 G7 H4 H5 H6 H7
  611|   221k|  const __m128i x_s20 = _mm_unpacklo_epi16(x_s10, x_s12);
  612|   221k|  const __m128i x_s21 = _mm_unpackhi_epi16(x_s10, x_s12);
  613|   221k|  const __m128i x_s22 = _mm_unpacklo_epi16(x_s11, x_s13);
  614|   221k|  const __m128i x_s23 = _mm_unpackhi_epi16(x_s11, x_s13);
  615|   221k|  const __m128i x_s24 = _mm_unpacklo_epi16(x_s14, x_s16);
  616|   221k|  const __m128i x_s25 = _mm_unpackhi_epi16(x_s14, x_s16);
  617|   221k|  const __m128i x_s26 = _mm_unpacklo_epi16(x_s15, x_s17);
  618|   221k|  const __m128i x_s27 = _mm_unpackhi_epi16(x_s15, x_s17);
  619|       |
  620|       |  // a0 a1 a2 a3 a4 a5 a6 a7 | A0 A1 A2 A3 A4 A5 A6 A7
  621|       |  // b0 b1 b2 b3 b4 b5 b6 b7 | B0 B1 B2 B3 B4 B5 B6 B7
  622|       |  // c0 c1 c2 c3 c4 c5 c6 c7 | C0 C1 C2 C3 C4 C5 C6 C7
  623|       |  // d0 d1 d2 d3 d4 d5 d6 d7 | D0 D1 D2 D3 D4 D5 D6 D7
  624|       |  // e0 e1 e2 e3 e4 e5 e6 e7 | E0 E1 E2 E3 E4 E5 E6 E7
  625|       |  // f0 f1 f2 f3 f4 f5 f6 f7 | F0 F1 F2 F3 F4 F5 F6 F7
  626|       |  // g0 g1 g2 g3 g4 g5 g6 g7 | G0 G1 G2 G3 G4 G5 G6 G7
  627|       |  // h0 h1 h2 h3 h4 h5 h6 h7 | H0 H1 H2 H3 H4 H5 H6 H7
  628|   221k|  const __m128i x_s30 = _mm_unpacklo_epi32(x_s20, x_s24);
  629|   221k|  const __m128i x_s31 = _mm_unpackhi_epi32(x_s20, x_s24);
  630|   221k|  const __m128i x_s32 = _mm_unpacklo_epi32(x_s21, x_s25);
  631|   221k|  const __m128i x_s33 = _mm_unpackhi_epi32(x_s21, x_s25);
  632|   221k|  const __m128i x_s34 = _mm_unpacklo_epi32(x_s22, x_s26);
  633|   221k|  const __m128i x_s35 = _mm_unpackhi_epi32(x_s22, x_s26);
  634|   221k|  const __m128i x_s36 = _mm_unpacklo_epi32(x_s23, x_s27);
  635|   221k|  const __m128i x_s37 = _mm_unpackhi_epi32(x_s23, x_s27);
  636|       |
  637|   221k|  mm_storelu(dst, x_s30);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  638|   221k|  mm_storehu(dst + (1 * out_p), x_s30);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  639|   221k|  mm_storelu(dst + (2 * out_p), x_s31);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  640|   221k|  mm_storehu(dst + (3 * out_p), x_s31);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  641|   221k|  mm_storelu(dst + (4 * out_p), x_s32);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  642|   221k|  mm_storehu(dst + (5 * out_p), x_s32);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  643|   221k|  mm_storelu(dst + (6 * out_p), x_s33);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  644|   221k|  mm_storehu(dst + (7 * out_p), x_s33);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  645|   221k|  mm_storelu(dst + (8 * out_p), x_s34);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  646|   221k|  mm_storehu(dst + (9 * out_p), x_s34);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  647|   221k|  mm_storelu(dst + (10 * out_p), x_s35);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  648|   221k|  mm_storehu(dst + (11 * out_p), x_s35);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  649|   221k|  mm_storelu(dst + (12 * out_p), x_s36);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  650|   221k|  mm_storehu(dst + (13 * out_p), x_s36);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  651|   221k|  mm_storelu(dst + (14 * out_p), x_s37);
  ------------------
  |  |   19|   221k|#define mm_storelu(dst, v) memcpy((dst), (const char *)&(v), 8)
  ------------------
  652|   221k|  mm_storehu(dst + (15 * out_p), x_s37);
  ------------------
  |  |   20|   221k|#define mm_storehu(dst, v) memcpy((dst), (const char *)&(v) + 8, 8)
  ------------------
  653|   221k|}
highbd_loopfilter_sse2.c:highbd_transpose4x8_8x4_low_sse2:
   65|  1.03M|                                                    __m128i *d2, __m128i *d3) {
   66|  1.03M|  __m128i zero = _mm_setzero_si128();
   67|  1.03M|  __m128i w0, w1, ww0, ww1;
   68|       |
   69|  1.03M|  w0 = _mm_unpacklo_epi16(*x0, *x1);  // 00 10 01 11 02 12 03 13
   70|  1.03M|  w1 = _mm_unpacklo_epi16(*x2, *x3);  // 20 30 21 31 22 32 23 33
   71|       |
   72|  1.03M|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 00 10 20 30 01 11 21 31
   73|  1.03M|  ww1 = _mm_unpackhi_epi32(w0, w1);  // 02 12 22 32 03 13 23 33
   74|       |
   75|  1.03M|  *d0 = _mm_unpacklo_epi64(ww0, zero);  // 00 10 20 30 xx xx xx xx
   76|  1.03M|  *d1 = _mm_unpackhi_epi64(ww0, zero);  // 01 11 21 31 xx xx xx xx
   77|  1.03M|  *d2 = _mm_unpacklo_epi64(ww1, zero);  // 02 12 22 32 xx xx xx xx
   78|  1.03M|  *d3 = _mm_unpackhi_epi64(ww1, zero);  // 03 13 23 33 xx xx xx xx
   79|  1.03M|}
highbd_loopfilter_sse2.c:highbd_transpose8x8_low_sse2:
  131|   556k|                                                __m128i *d2, __m128i *d3) {
  132|   556k|  __m128i w0, w1, w2, w3, ww0, ww1;
  133|       |  // x0 00 01 02 03 04 05 06 07
  134|       |  // x1 10 11 12 13 14 15 16 17
  135|       |  // x2 20 21 22 23 24 25 26 27
  136|       |  // x3 30 31 32 33 34 35 36 37
  137|       |  // x4 40 41 42 43 44 45 46 47
  138|       |  // x5 50 51 52 53 54 55 56 57
  139|       |  // x6 60 61 62 63 64 65 66 67
  140|       |  // x7 70 71 72 73 74 75 76 77
  141|       |
  142|   556k|  w0 = _mm_unpacklo_epi16(*x0, *x1);  // 00 10 01 11 02 12 03 13
  143|   556k|  w1 = _mm_unpacklo_epi16(*x2, *x3);  // 20 30 21 31 22 32 23 33
  144|   556k|  w2 = _mm_unpacklo_epi16(*x4, *x5);  // 40 50 41 51 42 52 43 53
  145|   556k|  w3 = _mm_unpacklo_epi16(*x6, *x7);  // 60 70 61 71 62 72 63 73
  146|       |
  147|   556k|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 00 10 20 30 01 11 21 31
  148|   556k|  ww1 = _mm_unpacklo_epi32(w2, w3);  // 40 50 60 70 41 51 61 71
  149|       |
  150|   556k|  *d0 = _mm_unpacklo_epi64(ww0, ww1);  // 00 10 20 30 40 50 60 70
  151|   556k|  *d1 = _mm_unpackhi_epi64(ww0, ww1);  // 01 11 21 31 41 51 61 71
  152|       |
  153|   556k|  ww0 = _mm_unpackhi_epi32(w0, w1);  // 02 12 22 32 03 13 23 33
  154|   556k|  ww1 = _mm_unpackhi_epi32(w2, w3);  // 42 52 62 72 43 53 63 73
  155|       |
  156|   556k|  *d2 = _mm_unpacklo_epi64(ww0, ww1);  // 02 12 22 32 42 52 62 72
  157|   556k|  *d3 = _mm_unpackhi_epi64(ww0, ww1);  // 03 13 23 33 43 53 63 73
  158|   556k|}
highbd_loopfilter_sse2.c:highbd_transpose4x8_8x4_sse2:
  107|   359k|                                                __m128i *d6, __m128i *d7) {
  108|       |  // input
  109|       |  // x0 00 01 02 03 04 05 06 07
  110|       |  // x1 10 11 12 13 14 15 16 17
  111|       |  // x2 20 21 22 23 24 25 26 27
  112|       |  // x3 30 31 32 33 34 35 36 37
  113|       |  // output
  114|       |  // 00 10 20 30 xx xx xx xx
  115|       |  // 01 11 21 31 xx xx xx xx
  116|       |  // 02 12 22 32 xx xx xx xx
  117|       |  // 03 13 23 33 xx xx xx xx
  118|       |  // 04 14 24 34 xx xx xx xx
  119|       |  // 05 15 25 35 xx xx xx xx
  120|       |  // 06 16 26 36 xx xx xx xx
  121|       |  // 07 17 27 37 xx xx xx xx
  122|   359k|  highbd_transpose4x8_8x4_low_sse2(x0, x1, x2, x3, d0, d1, d2, d3);
  123|   359k|  highbd_transpose4x8_8x4_high_sse2(x0, x1, x2, x3, d4, d5, d6, d7);
  124|   359k|}
highbd_loopfilter_sse2.c:highbd_transpose4x8_8x4_high_sse2:
   84|   359k|                                                     __m128i *d6, __m128i *d7) {
   85|   359k|  __m128i w0, w1, ww2, ww3;
   86|   359k|  __m128i zero = _mm_setzero_si128();
   87|       |
   88|   359k|  w0 = _mm_unpackhi_epi16(*x0, *x1);  // 04 14 05 15 06 16 07 17
   89|   359k|  w1 = _mm_unpackhi_epi16(*x2, *x3);  // 24 34 25 35 26 36 27 37
   90|       |
   91|   359k|  ww2 = _mm_unpacklo_epi32(w0, w1);  //  04 14 24 34 05 15 25 35
   92|   359k|  ww3 = _mm_unpackhi_epi32(w0, w1);  //  06 16 26 36 07 17 27 37
   93|       |
   94|   359k|  *d4 = _mm_unpacklo_epi64(ww2, zero);  // 04 14 24 34 xx xx xx xx
   95|   359k|  *d5 = _mm_unpackhi_epi64(ww2, zero);  // 05 15 25 35 xx xx xx xx
   96|   359k|  *d6 = _mm_unpacklo_epi64(ww3, zero);  // 06 16 26 36 xx xx xx xx
   97|   359k|  *d7 = _mm_unpackhi_epi64(ww3, zero);  // 07 17 27 37 xx xx xx xx
   98|   359k|}
highbd_loopfilter_sse2.c:highbd_transpose8x8_sse2:
  199|   275k|    __m128i *d7) {
  200|   275k|  highbd_transpose8x8_low_sse2(x0, x1, x2, x3, x4, x5, x6, x7, d0, d1, d2, d3);
  201|   275k|  highbd_transpose8x8_high_sse2(x0, x1, x2, x3, x4, x5, x6, x7, d4, d5, d6, d7);
  202|   275k|}
highbd_loopfilter_sse2.c:highbd_transpose8x8_high_sse2:
  165|   275k|                                                 __m128i *d6, __m128i *d7) {
  166|   275k|  __m128i w0, w1, w2, w3, ww0, ww1;
  167|       |  // x0 00 01 02 03 04 05 06 07
  168|       |  // x1 10 11 12 13 14 15 16 17
  169|       |  // x2 20 21 22 23 24 25 26 27
  170|       |  // x3 30 31 32 33 34 35 36 37
  171|       |  // x4 40 41 42 43 44 45 46 47
  172|       |  // x5 50 51 52 53 54 55 56 57
  173|       |  // x6 60 61 62 63 64 65 66 67
  174|       |  // x7 70 71 72 73 74 75 76 77
  175|   275k|  w0 = _mm_unpackhi_epi16(*x0, *x1);  // 04 14 05 15 06 16 07 17
  176|   275k|  w1 = _mm_unpackhi_epi16(*x2, *x3);  // 24 34 25 35 26 36 27 37
  177|   275k|  w2 = _mm_unpackhi_epi16(*x4, *x5);  // 44 54 45 55 46 56 47 57
  178|   275k|  w3 = _mm_unpackhi_epi16(*x6, *x7);  // 64 74 65 75 66 76 67 77
  179|       |
  180|   275k|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 04 14 24 34 05 15 25 35
  181|   275k|  ww1 = _mm_unpacklo_epi32(w2, w3);  // 44 54 64 74 45 55 65 75
  182|       |
  183|   275k|  *d4 = _mm_unpacklo_epi64(ww0, ww1);  // 04 14 24 34 44 54 64 74
  184|   275k|  *d5 = _mm_unpackhi_epi64(ww0, ww1);  // 05 15 25 35 45 55 65 75
  185|       |
  186|   275k|  ww0 = _mm_unpackhi_epi32(w0, w1);  // 06 16 26 36 07 17 27 37
  187|   275k|  ww1 = _mm_unpackhi_epi32(w2, w3);  // 46 56 66 76 47 57 67 77
  188|       |
  189|   275k|  *d6 = _mm_unpacklo_epi64(ww0, ww1);  // 06 16 26 36 46 56 66 76
  190|   275k|  *d7 = _mm_unpackhi_epi64(ww0, ww1);  // 07 17 27 37 47 57 67 77
  191|   275k|}
intrapred_avx2.c:highbd_transpose4x8_8x4_low_sse2:
   65|   776k|                                                    __m128i *d2, __m128i *d3) {
   66|   776k|  __m128i zero = _mm_setzero_si128();
   67|   776k|  __m128i w0, w1, ww0, ww1;
   68|       |
   69|   776k|  w0 = _mm_unpacklo_epi16(*x0, *x1);  // 00 10 01 11 02 12 03 13
   70|   776k|  w1 = _mm_unpacklo_epi16(*x2, *x3);  // 20 30 21 31 22 32 23 33
   71|       |
   72|   776k|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 00 10 20 30 01 11 21 31
   73|   776k|  ww1 = _mm_unpackhi_epi32(w0, w1);  // 02 12 22 32 03 13 23 33
   74|       |
   75|   776k|  *d0 = _mm_unpacklo_epi64(ww0, zero);  // 00 10 20 30 xx xx xx xx
   76|   776k|  *d1 = _mm_unpackhi_epi64(ww0, zero);  // 01 11 21 31 xx xx xx xx
   77|   776k|  *d2 = _mm_unpacklo_epi64(ww1, zero);  // 02 12 22 32 xx xx xx xx
   78|   776k|  *d3 = _mm_unpackhi_epi64(ww1, zero);  // 03 13 23 33 xx xx xx xx
   79|   776k|}
intrapred_avx2.c:highbd_transpose8x8_sse2:
  199|   235k|    __m128i *d7) {
  200|   235k|  highbd_transpose8x8_low_sse2(x0, x1, x2, x3, x4, x5, x6, x7, d0, d1, d2, d3);
  201|   235k|  highbd_transpose8x8_high_sse2(x0, x1, x2, x3, x4, x5, x6, x7, d4, d5, d6, d7);
  202|   235k|}
intrapred_avx2.c:highbd_transpose8x8_low_sse2:
  131|   281k|                                                __m128i *d2, __m128i *d3) {
  132|   281k|  __m128i w0, w1, w2, w3, ww0, ww1;
  133|       |  // x0 00 01 02 03 04 05 06 07
  134|       |  // x1 10 11 12 13 14 15 16 17
  135|       |  // x2 20 21 22 23 24 25 26 27
  136|       |  // x3 30 31 32 33 34 35 36 37
  137|       |  // x4 40 41 42 43 44 45 46 47
  138|       |  // x5 50 51 52 53 54 55 56 57
  139|       |  // x6 60 61 62 63 64 65 66 67
  140|       |  // x7 70 71 72 73 74 75 76 77
  141|       |
  142|   281k|  w0 = _mm_unpacklo_epi16(*x0, *x1);  // 00 10 01 11 02 12 03 13
  143|   281k|  w1 = _mm_unpacklo_epi16(*x2, *x3);  // 20 30 21 31 22 32 23 33
  144|   281k|  w2 = _mm_unpacklo_epi16(*x4, *x5);  // 40 50 41 51 42 52 43 53
  145|   281k|  w3 = _mm_unpacklo_epi16(*x6, *x7);  // 60 70 61 71 62 72 63 73
  146|       |
  147|   281k|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 00 10 20 30 01 11 21 31
  148|   281k|  ww1 = _mm_unpacklo_epi32(w2, w3);  // 40 50 60 70 41 51 61 71
  149|       |
  150|   281k|  *d0 = _mm_unpacklo_epi64(ww0, ww1);  // 00 10 20 30 40 50 60 70
  151|   281k|  *d1 = _mm_unpackhi_epi64(ww0, ww1);  // 01 11 21 31 41 51 61 71
  152|       |
  153|   281k|  ww0 = _mm_unpackhi_epi32(w0, w1);  // 02 12 22 32 03 13 23 33
  154|   281k|  ww1 = _mm_unpackhi_epi32(w2, w3);  // 42 52 62 72 43 53 63 73
  155|       |
  156|   281k|  *d2 = _mm_unpacklo_epi64(ww0, ww1);  // 02 12 22 32 42 52 62 72
  157|   281k|  *d3 = _mm_unpackhi_epi64(ww0, ww1);  // 03 13 23 33 43 53 63 73
  158|   281k|}
intrapred_avx2.c:highbd_transpose8x8_high_sse2:
  165|   235k|                                                 __m128i *d6, __m128i *d7) {
  166|   235k|  __m128i w0, w1, w2, w3, ww0, ww1;
  167|       |  // x0 00 01 02 03 04 05 06 07
  168|       |  // x1 10 11 12 13 14 15 16 17
  169|       |  // x2 20 21 22 23 24 25 26 27
  170|       |  // x3 30 31 32 33 34 35 36 37
  171|       |  // x4 40 41 42 43 44 45 46 47
  172|       |  // x5 50 51 52 53 54 55 56 57
  173|       |  // x6 60 61 62 63 64 65 66 67
  174|       |  // x7 70 71 72 73 74 75 76 77
  175|   235k|  w0 = _mm_unpackhi_epi16(*x0, *x1);  // 04 14 05 15 06 16 07 17
  176|   235k|  w1 = _mm_unpackhi_epi16(*x2, *x3);  // 24 34 25 35 26 36 27 37
  177|   235k|  w2 = _mm_unpackhi_epi16(*x4, *x5);  // 44 54 45 55 46 56 47 57
  178|   235k|  w3 = _mm_unpackhi_epi16(*x6, *x7);  // 64 74 65 75 66 76 67 77
  179|       |
  180|   235k|  ww0 = _mm_unpacklo_epi32(w0, w1);  // 04 14 24 34 05 15 25 35
  181|   235k|  ww1 = _mm_unpacklo_epi32(w2, w3);  // 44 54 64 74 45 55 65 75
  182|       |
  183|   235k|  *d4 = _mm_unpacklo_epi64(ww0, ww1);  // 04 14 24 34 44 54 64 74
  184|   235k|  *d5 = _mm_unpackhi_epi64(ww0, ww1);  // 05 15 25 35 45 55 65 75
  185|       |
  186|   235k|  ww0 = _mm_unpackhi_epi32(w0, w1);  // 06 16 26 36 07 17 27 37
  187|   235k|  ww1 = _mm_unpackhi_epi32(w2, w3);  // 46 56 66 76 47 57 67 77
  188|       |
  189|   235k|  *d6 = _mm_unpacklo_epi64(ww0, ww1);  // 06 16 26 36 46 56 66 76
  190|   235k|  *d7 = _mm_unpackhi_epi64(ww0, ww1);  // 07 17 27 37 47 57 67 77
  191|   235k|}
intrapred_avx2.c:highbd_transpose4x8_8x4_sse2:
  107|  43.6k|                                                __m128i *d6, __m128i *d7) {
  108|       |  // input
  109|       |  // x0 00 01 02 03 04 05 06 07
  110|       |  // x1 10 11 12 13 14 15 16 17
  111|       |  // x2 20 21 22 23 24 25 26 27
  112|       |  // x3 30 31 32 33 34 35 36 37
  113|       |  // output
  114|       |  // 00 10 20 30 xx xx xx xx
  115|       |  // 01 11 21 31 xx xx xx xx
  116|       |  // 02 12 22 32 xx xx xx xx
  117|       |  // 03 13 23 33 xx xx xx xx
  118|       |  // 04 14 24 34 xx xx xx xx
  119|       |  // 05 15 25 35 xx xx xx xx
  120|       |  // 06 16 26 36 xx xx xx xx
  121|       |  // 07 17 27 37 xx xx xx xx
  122|  43.6k|  highbd_transpose4x8_8x4_low_sse2(x0, x1, x2, x3, d0, d1, d2, d3);
  123|  43.6k|  highbd_transpose4x8_8x4_high_sse2(x0, x1, x2, x3, d4, d5, d6, d7);
  124|  43.6k|}
intrapred_avx2.c:highbd_transpose4x8_8x4_high_sse2:
   84|  43.6k|                                                     __m128i *d6, __m128i *d7) {
   85|  43.6k|  __m128i w0, w1, ww2, ww3;
   86|  43.6k|  __m128i zero = _mm_setzero_si128();
   87|       |
   88|  43.6k|  w0 = _mm_unpackhi_epi16(*x0, *x1);  // 04 14 05 15 06 16 07 17
   89|  43.6k|  w1 = _mm_unpackhi_epi16(*x2, *x3);  // 24 34 25 35 26 36 27 37
   90|       |
   91|  43.6k|  ww2 = _mm_unpacklo_epi32(w0, w1);  //  04 14 24 34 05 15 25 35
   92|  43.6k|  ww3 = _mm_unpackhi_epi32(w0, w1);  //  06 16 26 36 07 17 27 37
   93|       |
   94|  43.6k|  *d4 = _mm_unpacklo_epi64(ww2, zero);  // 04 14 24 34 xx xx xx xx
   95|  43.6k|  *d5 = _mm_unpackhi_epi64(ww2, zero);  // 05 15 25 35 xx xx xx xx
   96|  43.6k|  *d6 = _mm_unpacklo_epi64(ww3, zero);  // 06 16 26 36 xx xx xx xx
   97|  43.6k|  *d7 = _mm_unpackhi_epi64(ww3, zero);  // 07 17 27 37 xx xx xx xx
   98|  43.6k|}
intrapred_avx2.c:transpose4x8_8x4_low_sse2:
  222|   565k|                                             __m128i *d2, __m128i *d3) {
  223|       |  // input
  224|       |  // x0   00 01 02 03 04 05 06 07 xx xx xx xx xx xx xx xx
  225|       |  // x1   10 11 12 13 14 15 16 17 xx xx xx xx xx xx xx xx
  226|       |  // x2   20 21 22 23 24 25 26 27 xx xx xx xx xx xx xx xx
  227|       |  // x3   30 31 32 33 34 35 36 37 xx xx xx xx xx xx xx xx
  228|       |  // output
  229|       |  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  230|       |  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  231|       |  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  232|       |  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  233|       |
  234|   565k|  __m128i w0, w1;
  235|       |
  236|   565k|  w0 = _mm_unpacklo_epi8(
  237|   565k|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  238|   565k|  w1 = _mm_unpacklo_epi8(
  239|   565k|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  240|       |
  241|   565k|  *d0 = _mm_unpacklo_epi16(
  242|   565k|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  243|       |
  244|   565k|  *d1 = _mm_srli_si128(*d0,
  245|   565k|                       4);  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  246|   565k|  *d2 = _mm_srli_si128(*d0,
  247|   565k|                       8);  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  248|       |  *d3 = _mm_srli_si128(*d0,
  249|   565k|                       12);  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  250|   565k|}
intrapred_avx2.c:transpose8x8_sse2:
  352|  1.98M|                                     __m128i *d6d7) {
  353|  1.98M|  __m128i w0, w1, w2, w3, w4, w5, w6, w7;
  354|       |  // x0 00 01 02 03 04 05 06 07
  355|       |  // x1 10 11 12 13 14 15 16 17
  356|  1.98M|  w0 = _mm_unpacklo_epi8(
  357|  1.98M|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  358|       |
  359|       |  // x2 20 21 22 23 24 25 26 27
  360|       |  // x3 30 31 32 33 34 35 36 37
  361|  1.98M|  w1 = _mm_unpacklo_epi8(
  362|  1.98M|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  363|       |
  364|       |  // x4 40 41 42 43 44 45 46 47
  365|       |  // x5  50 51 52 53 54 55 56 57
  366|  1.98M|  w2 = _mm_unpacklo_epi8(
  367|  1.98M|      *x4, *x5);  // 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57
  368|       |
  369|       |  // x6  60 61 62 63 64 65 66 67
  370|       |  // x7 70 71 72 73 74 75 76 77
  371|  1.98M|  w3 = _mm_unpacklo_epi8(
  372|  1.98M|      *x6, *x7);  // 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77
  373|       |
  374|  1.98M|  w4 = _mm_unpacklo_epi16(
  375|  1.98M|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  376|  1.98M|  w5 = _mm_unpacklo_epi16(
  377|  1.98M|      w2, w3);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  378|       |
  379|  1.98M|  *d0d1 = _mm_unpacklo_epi32(
  380|  1.98M|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  381|  1.98M|  *d2d3 = _mm_unpackhi_epi32(
  382|  1.98M|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  383|       |
  384|  1.98M|  w6 = _mm_unpackhi_epi16(
  385|  1.98M|      w0, w1);  // 04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37
  386|  1.98M|  w7 = _mm_unpackhi_epi16(
  387|  1.98M|      w2, w3);  // 44 54 64 74 45 55 65 75 46 56 66 76 47 57 67 77
  388|       |
  389|  1.98M|  *d4d5 = _mm_unpacklo_epi32(
  390|  1.98M|      w6, w7);  // 04 14 24 34 44 54 64 74 05 15 25 35 45 55 65 75
  391|  1.98M|  *d6d7 = _mm_unpackhi_epi32(
  392|  1.98M|      w6, w7);  // 06 16 26 36 46 56 66 76 07 17 27 37 47 57 67 77
  393|  1.98M|}
intrapred_avx2.c:transpose4x8_8x4_sse2:
  256|   126k|                                         __m128i *d7) {
  257|       |  // input
  258|       |  // x0   00 01 02 03 04 05 06 07 xx xx xx xx xx xx xx xx
  259|       |  // x1   10 11 12 13 14 15 16 17 xx xx xx xx xx xx xx xx
  260|       |  // x2   20 21 22 23 24 25 26 27 xx xx xx xx xx xx xx xx
  261|       |  // x3   30 31 32 33 34 35 36 37 xx xx xx xx xx xx xx xx
  262|       |  // output
  263|       |  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  264|       |  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  265|       |  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  266|       |  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  267|       |  // 04 14 24 34 xx xx xx xx xx xx xx xx xx xx xx xx
  268|       |  // 05 15 25 35 xx xx xx xx xx xx xx xx xx xx xx xx
  269|       |  // 06 16 26 36 xx xx xx xx xx xx xx xx xx xx xx xx
  270|       |  // 07 17 27 37 xx xx xx xx xx xx xx xx xx xx xx xx
  271|       |
  272|   126k|  __m128i w0, w1, ww0, ww1;
  273|       |
  274|   126k|  w0 = _mm_unpacklo_epi8(
  275|   126k|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  276|   126k|  w1 = _mm_unpacklo_epi8(
  277|   126k|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  278|       |
  279|   126k|  ww0 = _mm_unpacklo_epi16(
  280|   126k|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  281|   126k|  ww1 = _mm_unpackhi_epi16(
  282|   126k|      w0, w1);  // 04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37
  283|       |
  284|   126k|  *d0 = ww0;  // 00 10 20 30 xx xx xx xx xx xx xx xx xx xx xx xx
  285|   126k|  *d1 = _mm_srli_si128(ww0,
  286|   126k|                       4);  // 01 11 21 31 xx xx xx xx xx xx xx xx xx xx xx xx
  287|   126k|  *d2 = _mm_srli_si128(ww0,
  288|   126k|                       8);  // 02 12 22 32 xx xx xx xx xx xx xx xx xx xx xx xx
  289|   126k|  *d3 = _mm_srli_si128(ww0,
  290|   126k|                       12);  // 03 13 23 33 xx xx xx xx xx xx xx xx xx xx xx xx
  291|       |
  292|   126k|  *d4 = ww1;  // 04 14 24 34 xx xx xx xx xx xx xx xx xx xx xx xx
  293|   126k|  *d5 = _mm_srli_si128(ww1,
  294|   126k|                       4);  // 05 15 25 35 xx xx xx xx xx xx xx xx xx xx xx xx
  295|   126k|  *d6 = _mm_srli_si128(ww1,
  296|   126k|                       8);  // 06 16 26 36 xx xx xx xx xx xx xx xx xx xx xx xx
  297|       |  *d7 = _mm_srli_si128(ww1,
  298|   126k|                       12);  // 07 17 27 37 xx xx xx xx xx xx xx xx xx xx xx xx
  299|   126k|}
intrapred_avx2.c:transpose8x16_16x8_sse2:
  451|  24.5k|    __m128i *d12d13, __m128i *d14d15) {
  452|  24.5k|  __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
  453|  24.5k|  __m128i w10, w11, w12, w13, w14, w15;
  454|       |
  455|  24.5k|  w0 = _mm_unpacklo_epi8(*x0, *x1);
  456|  24.5k|  w1 = _mm_unpacklo_epi8(*x2, *x3);
  457|  24.5k|  w2 = _mm_unpacklo_epi8(*x4, *x5);
  458|  24.5k|  w3 = _mm_unpacklo_epi8(*x6, *x7);
  459|       |
  460|  24.5k|  w8 = _mm_unpackhi_epi8(*x0, *x1);
  461|  24.5k|  w9 = _mm_unpackhi_epi8(*x2, *x3);
  462|  24.5k|  w10 = _mm_unpackhi_epi8(*x4, *x5);
  463|  24.5k|  w11 = _mm_unpackhi_epi8(*x6, *x7);
  464|       |
  465|  24.5k|  w4 = _mm_unpacklo_epi16(w0, w1);
  466|  24.5k|  w5 = _mm_unpacklo_epi16(w2, w3);
  467|  24.5k|  w12 = _mm_unpacklo_epi16(w8, w9);
  468|  24.5k|  w13 = _mm_unpacklo_epi16(w10, w11);
  469|       |
  470|  24.5k|  w6 = _mm_unpacklo_epi32(w4, w5);
  471|  24.5k|  w7 = _mm_unpackhi_epi32(w4, w5);
  472|  24.5k|  w14 = _mm_unpacklo_epi32(w12, w13);
  473|  24.5k|  w15 = _mm_unpackhi_epi32(w12, w13);
  474|       |
  475|       |  // Store first 4-line result
  476|  24.5k|  *d0d1 = _mm_unpacklo_epi64(w6, w14);
  477|  24.5k|  *d2d3 = _mm_unpackhi_epi64(w6, w14);
  478|  24.5k|  *d4d5 = _mm_unpacklo_epi64(w7, w15);
  479|  24.5k|  *d6d7 = _mm_unpackhi_epi64(w7, w15);
  480|       |
  481|  24.5k|  w4 = _mm_unpackhi_epi16(w0, w1);
  482|  24.5k|  w5 = _mm_unpackhi_epi16(w2, w3);
  483|  24.5k|  w12 = _mm_unpackhi_epi16(w8, w9);
  484|  24.5k|  w13 = _mm_unpackhi_epi16(w10, w11);
  485|       |
  486|  24.5k|  w6 = _mm_unpacklo_epi32(w4, w5);
  487|  24.5k|  w7 = _mm_unpackhi_epi32(w4, w5);
  488|  24.5k|  w14 = _mm_unpacklo_epi32(w12, w13);
  489|  24.5k|  w15 = _mm_unpackhi_epi32(w12, w13);
  490|       |
  491|       |  // Store second 4-line result
  492|  24.5k|  *d8d9 = _mm_unpacklo_epi64(w6, w14);
  493|  24.5k|  *d10d11 = _mm_unpackhi_epi64(w6, w14);
  494|  24.5k|  *d12d13 = _mm_unpacklo_epi64(w7, w15);
  495|  24.5k|  *d14d15 = _mm_unpackhi_epi64(w7, w15);
  496|  24.5k|}
intrapred_avx2.c:transpose8x8_low_sse2:
  305|  5.78k|                                         __m128i *d3) {
  306|       |  // input
  307|       |  // x0 00 01 02 03 04 05 06 07
  308|       |  // x1 10 11 12 13 14 15 16 17
  309|       |  // x2 20 21 22 23 24 25 26 27
  310|       |  // x3 30 31 32 33 34 35 36 37
  311|       |  // x4 40 41 42 43 44 45 46 47
  312|       |  // x5  50 51 52 53 54 55 56 57
  313|       |  // x6  60 61 62 63 64 65 66 67
  314|       |  // x7 70 71 72 73 74 75 76 77
  315|       |  // output
  316|       |  // d0 00 10 20 30 40 50 60 70 xx xx xx xx xx xx xx
  317|       |  // d1 01 11 21 31 41 51 61 71 xx xx xx xx xx xx xx xx
  318|       |  // d2 02 12 22 32 42 52 62 72 xx xx xx xx xx xx xx xx
  319|       |  // d3 03 13 23 33 43 53 63 73 xx xx xx xx xx xx xx xx
  320|       |
  321|  5.78k|  __m128i w0, w1, w2, w3, w4, w5;
  322|       |
  323|  5.78k|  w0 = _mm_unpacklo_epi8(
  324|  5.78k|      *x0, *x1);  // 00 10 01 11 02 12 03 13 04 14 05 15 06 16 07 17
  325|       |
  326|  5.78k|  w1 = _mm_unpacklo_epi8(
  327|  5.78k|      *x2, *x3);  // 20 30 21 31 22 32 23 33 24 34 25 35 26 36 27 37
  328|       |
  329|  5.78k|  w2 = _mm_unpacklo_epi8(
  330|  5.78k|      *x4, *x5);  // 40 50 41 51 42 52 43 53 44 54 45 55 46 56 47 57
  331|       |
  332|  5.78k|  w3 = _mm_unpacklo_epi8(
  333|  5.78k|      *x6, *x7);  // 60 70 61 71 62 72 63 73 64 74 65 75 66 76 67 77
  334|       |
  335|  5.78k|  w4 = _mm_unpacklo_epi16(
  336|  5.78k|      w0, w1);  // 00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33
  337|  5.78k|  w5 = _mm_unpacklo_epi16(
  338|  5.78k|      w2, w3);  // 40 50 60 70 41 51 61 71 42 52 62 72 43 53 63 73
  339|       |
  340|  5.78k|  *d0 = _mm_unpacklo_epi32(
  341|  5.78k|      w4, w5);  // 00 10 20 30 40 50 60 70 01 11 21 31 41 51 61 71
  342|  5.78k|  *d1 = _mm_srli_si128(*d0, 8);
  343|  5.78k|  *d2 = _mm_unpackhi_epi32(
  344|  5.78k|      w4, w5);  // 02 12 22 32 42 52 62 72 03 13 23 33 43 53 63 73
  345|       |  *d3 = _mm_srli_si128(*d2, 8);
  346|  5.78k|}
intrapred_avx2.c:transpose16x8_8x16_sse2:
  400|  19.7k|    __m128i *d4, __m128i *d5, __m128i *d6, __m128i *d7) {
  401|  19.7k|  __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9;
  402|  19.7k|  __m128i w10, w11, w12, w13, w14, w15;
  403|       |
  404|  19.7k|  w0 = _mm_unpacklo_epi8(*x0, *x1);
  405|  19.7k|  w1 = _mm_unpacklo_epi8(*x2, *x3);
  406|  19.7k|  w2 = _mm_unpacklo_epi8(*x4, *x5);
  407|  19.7k|  w3 = _mm_unpacklo_epi8(*x6, *x7);
  408|       |
  409|  19.7k|  w8 = _mm_unpacklo_epi8(*x8, *x9);
  410|  19.7k|  w9 = _mm_unpacklo_epi8(*x10, *x11);
  411|  19.7k|  w10 = _mm_unpacklo_epi8(*x12, *x13);
  412|  19.7k|  w11 = _mm_unpacklo_epi8(*x14, *x15);
  413|       |
  414|  19.7k|  w4 = _mm_unpacklo_epi16(w0, w1);
  415|  19.7k|  w5 = _mm_unpacklo_epi16(w2, w3);
  416|  19.7k|  w12 = _mm_unpacklo_epi16(w8, w9);
  417|  19.7k|  w13 = _mm_unpacklo_epi16(w10, w11);
  418|       |
  419|  19.7k|  w6 = _mm_unpacklo_epi32(w4, w5);
  420|  19.7k|  w7 = _mm_unpackhi_epi32(w4, w5);
  421|  19.7k|  w14 = _mm_unpacklo_epi32(w12, w13);
  422|  19.7k|  w15 = _mm_unpackhi_epi32(w12, w13);
  423|       |
  424|       |  // Store first 4-line result
  425|  19.7k|  *d0 = _mm_unpacklo_epi64(w6, w14);
  426|  19.7k|  *d1 = _mm_unpackhi_epi64(w6, w14);
  427|  19.7k|  *d2 = _mm_unpacklo_epi64(w7, w15);
  428|  19.7k|  *d3 = _mm_unpackhi_epi64(w7, w15);
  429|       |
  430|  19.7k|  w4 = _mm_unpackhi_epi16(w0, w1);
  431|  19.7k|  w5 = _mm_unpackhi_epi16(w2, w3);
  432|  19.7k|  w12 = _mm_unpackhi_epi16(w8, w9);
  433|  19.7k|  w13 = _mm_unpackhi_epi16(w10, w11);
  434|       |
  435|  19.7k|  w6 = _mm_unpacklo_epi32(w4, w5);
  436|  19.7k|  w7 = _mm_unpackhi_epi32(w4, w5);
  437|  19.7k|  w14 = _mm_unpacklo_epi32(w12, w13);
  438|  19.7k|  w15 = _mm_unpackhi_epi32(w12, w13);
  439|       |
  440|       |  // Store second 4-line result
  441|  19.7k|  *d4 = _mm_unpacklo_epi64(w6, w14);
  442|  19.7k|  *d5 = _mm_unpackhi_epi64(w6, w14);
  443|  19.7k|  *d6 = _mm_unpacklo_epi64(w7, w15);
  444|  19.7k|  *d7 = _mm_unpackhi_epi64(w7, w15);
  445|  19.7k|}

encodetxb_sse2.c:load_8bit_4x4_to_1_reg_sse2:
   50|   175M|                                                  const int byte_stride) {
   51|   175M|  return _mm_setr_epi32(loadu_int32((int8_t *)src + 0 * byte_stride),
   52|   175M|                        loadu_int32((int8_t *)src + 1 * byte_stride),
   53|   175M|                        loadu_int32((int8_t *)src + 2 * byte_stride),
   54|   175M|                        loadu_int32((int8_t *)src + 3 * byte_stride));
   55|   175M|}
encodetxb_sse2.c:loadu_int32:
   28|   701M|static inline int32_t loadu_int32(const void *src) {
   29|   701M|  int32_t v;
   30|   701M|  memcpy(&v, src, sizeof(v));
   31|   701M|  return v;
   32|   701M|}
encodetxb_sse2.c:load_8bit_8x2_to_1_reg_sse2:
   58|   771M|                                                  const int byte_stride) {
   59|   771M|  __m128i dst;
   60|   771M|  dst = _mm_loadl_epi64((__m128i *)((int8_t *)src + 0 * byte_stride));
   61|   771M|  dst = loadh_epi64((int8_t *)src + 1 * byte_stride, dst);
   62|   771M|  return dst;
   63|   771M|}
encodetxb_sse2.c:loadh_epi64:
   44|   772M|static inline __m128i loadh_epi64(const void *const src, const __m128i s) {
   45|   772M|  return _mm_castps_si128(
   46|   772M|      _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src));
   47|   772M|}
avg_intrin_sse2.c:loadh_epi64:
   44|   693k|static inline __m128i loadh_epi64(const void *const src, const __m128i s) {
   45|   693k|  return _mm_castps_si128(
   46|   693k|      _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src));
   47|   693k|}
variance_sse2.c:loadu_int32:
   28|   245M|static inline int32_t loadu_int32(const void *src) {
   29|   245M|  int32_t v;
   30|   245M|  memcpy(&v, src, sizeof(v));
   31|   245M|  return v;
   32|   245M|}
aom_subpixel_8t_intrin_ssse3.c:load_8bit_8x8:
  124|   315k|                                 __m128i *const d) {
  125|   315k|  load_8bit_8x4(s + 0 * stride, stride, &d[0]);
  126|   315k|  load_8bit_8x4(s + 4 * stride, stride, &d[4]);
  127|   315k|}
aom_subpixel_8t_intrin_ssse3.c:load_8bit_8x4:
  108|   630k|                                 __m128i *const d) {
  109|   630k|  d[0] = _mm_loadl_epi64((const __m128i *)(s + 0 * stride));
  110|   630k|  d[1] = _mm_loadl_epi64((const __m128i *)(s + 1 * stride));
  111|   630k|  d[2] = _mm_loadl_epi64((const __m128i *)(s + 2 * stride));
  112|   630k|  d[3] = _mm_loadl_epi64((const __m128i *)(s + 3 * stride));
  113|   630k|}
aom_subpixel_8t_intrin_ssse3.c:store_8bit_8x8:
  148|  57.7k|                                  const ptrdiff_t stride) {
  149|  57.7k|  _mm_storel_epi64((__m128i *)(d + 0 * stride), s[0]);
  150|  57.7k|  _mm_storel_epi64((__m128i *)(d + 1 * stride), s[1]);
  151|  57.7k|  _mm_storel_epi64((__m128i *)(d + 2 * stride), s[2]);
  152|  57.7k|  _mm_storel_epi64((__m128i *)(d + 3 * stride), s[3]);
  153|  57.7k|  _mm_storel_epi64((__m128i *)(d + 4 * stride), s[4]);
  154|  57.7k|  _mm_storel_epi64((__m128i *)(d + 5 * stride), s[5]);
  155|  57.7k|  _mm_storel_epi64((__m128i *)(d + 6 * stride), s[6]);
  156|  57.7k|  _mm_storel_epi64((__m128i *)(d + 7 * stride), s[7]);
  157|  57.7k|}
aom_subpixel_8t_intrin_ssse3.c:loadu_8bit_16x8:
  142|  67.6k|                                   const ptrdiff_t stride, __m128i *const d) {
  143|  67.6k|  loadu_8bit_16x4(s + 0 * stride, stride, &d[0]);
  144|  67.6k|  loadu_8bit_16x4(s + 4 * stride, stride, &d[4]);
  145|  67.6k|}
aom_subpixel_8t_intrin_ssse3.c:loadu_8bit_16x4:
  116|   135k|                                   const ptrdiff_t stride, __m128i *const d) {
  117|   135k|  d[0] = _mm_loadu_si128((const __m128i *)(s + 0 * stride));
  118|   135k|  d[1] = _mm_loadu_si128((const __m128i *)(s + 1 * stride));
  119|   135k|  d[2] = _mm_loadu_si128((const __m128i *)(s + 2 * stride));
  120|   135k|  d[3] = _mm_loadu_si128((const __m128i *)(s + 3 * stride));
  121|   135k|}
resize_ssse3.c:load_8bit_8x8:
  124|   235k|                                 __m128i *const d) {
  125|   235k|  load_8bit_8x4(s + 0 * stride, stride, &d[0]);
  126|   235k|  load_8bit_8x4(s + 4 * stride, stride, &d[4]);
  127|   235k|}
resize_ssse3.c:load_8bit_8x4:
  108|   471k|                                 __m128i *const d) {
  109|   471k|  d[0] = _mm_loadl_epi64((const __m128i *)(s + 0 * stride));
  110|   471k|  d[1] = _mm_loadl_epi64((const __m128i *)(s + 1 * stride));
  111|   471k|  d[2] = _mm_loadl_epi64((const __m128i *)(s + 2 * stride));
  112|   471k|  d[3] = _mm_loadl_epi64((const __m128i *)(s + 3 * stride));
  113|   471k|}
resize_ssse3.c:store_8bit_8x4_from_16x2:
   67|   106k|                                            const ptrdiff_t stride) {
   68|   106k|  _mm_storel_epi64((__m128i *)(d + 0 * stride), s[0]);
   69|   106k|  _mm_storeh_epi64((__m128i *)(d + 1 * stride), s[0]);
   70|   106k|  _mm_storel_epi64((__m128i *)(d + 2 * stride), s[1]);
   71|   106k|  _mm_storeh_epi64((__m128i *)(d + 3 * stride), s[1]);
   72|   106k|}
resize_ssse3.c:_mm_storeh_epi64:
   40|   475k|static inline void _mm_storeh_epi64(__m128i *const d, const __m128i s) {
   41|   475k|  _mm_storeh_pi((__m64 *)d, _mm_castsi128_ps(s));
   42|   475k|}
resize_ssse3.c:loadu_8bit_16x4:
  116|   134k|                                   const ptrdiff_t stride, __m128i *const d) {
  117|   134k|  d[0] = _mm_loadu_si128((const __m128i *)(s + 0 * stride));
  118|   134k|  d[1] = _mm_loadu_si128((const __m128i *)(s + 1 * stride));
  119|   134k|  d[2] = _mm_loadu_si128((const __m128i *)(s + 2 * stride));
  120|   134k|  d[3] = _mm_loadu_si128((const __m128i *)(s + 3 * stride));
  121|   134k|}
resize_ssse3.c:store_8bit_4x4_sse2:
   83|  26.5k|                                       const ptrdiff_t stride) {
   84|  26.5k|  __m128i ss[4];
   85|       |
   86|  26.5k|  ss[0] = s;
   87|  26.5k|  ss[1] = _mm_srli_si128(s, 4);
   88|  26.5k|  ss[2] = _mm_srli_si128(s, 8);
   89|       |  ss[3] = _mm_srli_si128(s, 12);
   90|  26.5k|  store_8bit_4x4(ss, d, stride);
   91|  26.5k|}
resize_ssse3.c:store_8bit_4x4:
   75|  26.5k|                                  const ptrdiff_t stride) {
   76|  26.5k|  *(int *)(d + 0 * stride) = _mm_cvtsi128_si32(s[0]);
   77|  26.5k|  *(int *)(d + 1 * stride) = _mm_cvtsi128_si32(s[1]);
   78|  26.5k|  *(int *)(d + 2 * stride) = _mm_cvtsi128_si32(s[2]);
   79|  26.5k|  *(int *)(d + 3 * stride) = _mm_cvtsi128_si32(s[3]);
   80|  26.5k|}
resize_ssse3.c:storeu_8bit_16x4:
  160|   119k|                                    const ptrdiff_t stride) {
  161|   119k|  _mm_storeu_si128((__m128i *)(d + 0 * stride), s[0]);
  162|   119k|  _mm_storeu_si128((__m128i *)(d + 1 * stride), s[1]);
  163|   119k|  _mm_storeu_si128((__m128i *)(d + 2 * stride), s[2]);
  164|   119k|  _mm_storeu_si128((__m128i *)(d + 3 * stride), s[3]);
  165|   119k|}
convolve_2d_avx2.c:load_8bit_8x2_to_1_reg_sse2:
   58|  2.06M|                                                  const int byte_stride) {
   59|  2.06M|  __m128i dst;
   60|  2.06M|  dst = _mm_loadl_epi64((__m128i *)((int8_t *)src + 0 * byte_stride));
   61|  2.06M|  dst = loadh_epi64((int8_t *)src + 1 * byte_stride, dst);
   62|  2.06M|  return dst;
   63|  2.06M|}
convolve_2d_avx2.c:loadh_epi64:
   44|  2.06M|static inline __m128i loadh_epi64(const void *const src, const __m128i s) {
   45|  2.06M|  return _mm_castps_si128(
   46|  2.06M|      _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src));
   47|  2.06M|}
convolve_avx2.c:loadu_int32:
   28|   393k|static inline int32_t loadu_int32(const void *src) {
   29|   393k|  int32_t v;
   30|   393k|  memcpy(&v, src, sizeof(v));
   31|   393k|  return v;
   32|   393k|}
convolve_avx2.c:load_8bit_8x2_to_1_reg_sse2:
   58|   158k|                                                  const int byte_stride) {
   59|   158k|  __m128i dst;
   60|   158k|  dst = _mm_loadl_epi64((__m128i *)((int8_t *)src + 0 * byte_stride));
   61|   158k|  dst = loadh_epi64((int8_t *)src + 1 * byte_stride, dst);
   62|   158k|  return dst;
   63|   158k|}
convolve_avx2.c:loadh_epi64:
   44|   158k|static inline __m128i loadh_epi64(const void *const src, const __m128i s) {
   45|   158k|  return _mm_castps_si128(
   46|   158k|      _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src));
   47|   158k|}
rdopt_avx2.c:loadu_int64:
   34|  17.4M|static inline int64_t loadu_int64(const void *src) {
   35|  17.4M|  int64_t v;
   36|  17.4M|  memcpy(&v, src, sizeof(v));
   37|  17.4M|  return v;
   38|  17.4M|}
pickrst_avx2.c:loadu_int32:
   28|  8.63M|static inline int32_t loadu_int32(const void *src) {
   29|  8.63M|  int32_t v;
   30|  8.63M|  memcpy(&v, src, sizeof(v));
   31|  8.63M|  return v;
   32|  8.63M|}
pickrst_avx2.c:_mm_storeh_epi64:
   40|  37.5k|static inline void _mm_storeh_epi64(__m128i *const d, const __m128i s) {
   41|  37.5k|  _mm_storeh_pi((__m64 *)d, _mm_castsi128_ps(s));
   42|  37.5k|}

aom_quantize_b_avx2:
  128|  14.4M|                         const int16_t *iscan) {
  129|  14.4M|  (void)scan;
  130|  14.4M|  __m256i v_zbin, v_round, v_quant, v_dequant, v_quant_shift;
  131|  14.4M|  __m256i v_eobmax = _mm256_setzero_si256();
  132|       |
  133|  14.4M|  load_b_values_avx2(zbin_ptr, &v_zbin, round_ptr, &v_round, quant_ptr,
  134|  14.4M|                     &v_quant, dequant_ptr, &v_dequant, quant_shift_ptr,
  135|  14.4M|                     &v_quant_shift, 0);
  136|       |
  137|       |  // Do DC and first 15 AC.
  138|  14.4M|  __m256i v_nz_mask =
  139|  14.4M|      quantize_b_logscale0_16(coeff_ptr, qcoeff_ptr, dqcoeff_ptr, &v_quant,
  140|  14.4M|                              &v_dequant, &v_round, &v_zbin, &v_quant_shift);
  141|       |
  142|  14.4M|  v_eobmax = get_max_lane_eob(iscan, v_eobmax, v_nz_mask);
  143|       |
  144|  14.4M|  v_round = _mm256_unpackhi_epi64(v_round, v_round);
  145|  14.4M|  v_quant = _mm256_unpackhi_epi64(v_quant, v_quant);
  146|  14.4M|  v_dequant = _mm256_unpackhi_epi64(v_dequant, v_dequant);
  147|  14.4M|  v_quant_shift = _mm256_unpackhi_epi64(v_quant_shift, v_quant_shift);
  148|  14.4M|  v_zbin = _mm256_unpackhi_epi64(v_zbin, v_zbin);
  149|       |
  150|  50.7M|  for (intptr_t count = n_coeffs - 16; count > 0; count -= 16) {
  ------------------
  |  Branch (150:40): [True: 36.3M, False: 14.4M]
  ------------------
  151|  36.3M|    coeff_ptr += 16;
  152|  36.3M|    qcoeff_ptr += 16;
  153|  36.3M|    dqcoeff_ptr += 16;
  154|  36.3M|    iscan += 16;
  155|  36.3M|    v_nz_mask =
  156|  36.3M|        quantize_b_logscale0_16(coeff_ptr, qcoeff_ptr, dqcoeff_ptr, &v_quant,
  157|  36.3M|                                &v_dequant, &v_round, &v_zbin, &v_quant_shift);
  158|       |
  159|  36.3M|    v_eobmax = get_max_lane_eob(iscan, v_eobmax, v_nz_mask);
  160|  36.3M|  }
  161|       |
  162|  14.4M|  *eob_ptr = accumulate_eob256(v_eobmax);
  163|  14.4M|}
aom_quantize_b_32x32_avx2:
  255|  65.8k|                               const int16_t *scan, const int16_t *iscan) {
  256|  65.8k|  (void)scan;
  257|  65.8k|  quantize_b_no_qmatrix_avx2(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
  258|  65.8k|                             quant_ptr, quant_shift_ptr, qcoeff_ptr,
  259|  65.8k|                             dqcoeff_ptr, dequant_ptr, eob_ptr, iscan, 1);
  260|  65.8k|}
aom_quantize_b_64x64_avx2:
  269|  10.6k|                               const int16_t *scan, const int16_t *iscan) {
  270|  10.6k|  (void)scan;
  271|  10.6k|  quantize_b_no_qmatrix_avx2(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
  272|  10.6k|                             quant_ptr, quant_shift_ptr, qcoeff_ptr,
  273|  10.6k|                             dqcoeff_ptr, dequant_ptr, eob_ptr, iscan, 2);
  274|  10.6k|}
quantize_avx2.c:load_b_values_avx2:
   23|  14.5M|                                      int log_scale) {
   24|  14.5M|  *zbin = _mm256_castsi128_si256(_mm_load_si128((const __m128i *)zbin_ptr));
   25|  14.5M|  *zbin = _mm256_permute4x64_epi64(*zbin, 0x54);
   26|  14.5M|  if (log_scale > 0) {
  ------------------
  |  Branch (26:7): [True: 76.5k, False: 14.4M]
  ------------------
   27|  76.5k|    const __m256i rnd = _mm256_set1_epi16((int16_t)(1 << (log_scale - 1)));
   28|  76.5k|    *zbin = _mm256_add_epi16(*zbin, rnd);
   29|  76.5k|    *zbin = _mm256_srai_epi16(*zbin, log_scale);
   30|  76.5k|  }
   31|       |  // Subtracting 1 here eliminates a _mm256_cmpeq_epi16() instruction when
   32|       |  // calculating the zbin mask. (See quantize_b_logscale{0,1,2}_16)
   33|  14.5M|  *zbin = _mm256_sub_epi16(*zbin, _mm256_set1_epi16(1));
   34|       |
   35|  14.5M|  *round = _mm256_castsi128_si256(_mm_load_si128((const __m128i *)round_ptr));
   36|  14.5M|  *round = _mm256_permute4x64_epi64(*round, 0x54);
   37|  14.5M|  if (log_scale > 0) {
  ------------------
  |  Branch (37:7): [True: 76.5k, False: 14.4M]
  ------------------
   38|  76.5k|    const __m256i rnd = _mm256_set1_epi16((int16_t)(1 << (log_scale - 1)));
   39|  76.5k|    *round = _mm256_add_epi16(*round, rnd);
   40|  76.5k|    *round = _mm256_srai_epi16(*round, log_scale);
   41|  76.5k|  }
   42|       |
   43|  14.5M|  *quant = _mm256_castsi128_si256(_mm_load_si128((const __m128i *)quant_ptr));
   44|  14.5M|  *quant = _mm256_permute4x64_epi64(*quant, 0x54);
   45|  14.5M|  *dequant =
   46|  14.5M|      _mm256_castsi128_si256(_mm_load_si128((const __m128i *)dequant_ptr));
   47|  14.5M|  *dequant = _mm256_permute4x64_epi64(*dequant, 0x54);
   48|  14.5M|  *shift = _mm256_castsi128_si256(_mm_load_si128((const __m128i *)shift_ptr));
   49|       |  *shift = _mm256_permute4x64_epi64(*shift, 0x54);
   50|  14.5M|}
quantize_avx2.c:quantize_b_logscale0_16:
   70|  50.7M|    __m256i *v_round, __m256i *v_zbin, __m256i *v_quant_shift) {
   71|  50.7M|  const __m256i v_coeff = load_coefficients_avx2(coeff_ptr);
   72|  50.7M|  const __m256i v_abs_coeff = _mm256_abs_epi16(v_coeff);
   73|  50.7M|  const __m256i v_zbin_mask = _mm256_cmpgt_epi16(v_abs_coeff, *v_zbin);
   74|       |
   75|  50.7M|  if (_mm256_movemask_epi8(v_zbin_mask) == 0) {
  ------------------
  |  Branch (75:7): [True: 5.20M, False: 45.5M]
  ------------------
   76|  5.20M|    _mm256_store_si256((__m256i *)qcoeff_ptr, _mm256_setzero_si256());
   77|  5.20M|    _mm256_store_si256((__m256i *)dqcoeff_ptr, _mm256_setzero_si256());
   78|  5.20M|    _mm256_store_si256((__m256i *)(qcoeff_ptr + 8), _mm256_setzero_si256());
   79|  5.20M|    _mm256_store_si256((__m256i *)(dqcoeff_ptr + 8), _mm256_setzero_si256());
   80|  5.20M|    return _mm256_setzero_si256();
   81|  5.20M|  }
   82|       |
   83|       |  // tmp = v_zbin_mask ? (int64_t)abs_coeff + log_scaled_round : 0
   84|  45.5M|  const __m256i v_tmp_rnd =
   85|  45.5M|      _mm256_and_si256(_mm256_adds_epi16(v_abs_coeff, *v_round), v_zbin_mask);
   86|       |  //  tmp32 = (int)(((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
   87|       |  //                 quant_shift_ptr[rc != 0]) >>
   88|       |  //                (16 - log_scale + AOM_QM_BITS));
   89|  45.5M|  const __m256i v_tmp32_a = _mm256_mulhi_epi16(v_tmp_rnd, *v_quant);
   90|  45.5M|  const __m256i v_tmp32_b = _mm256_add_epi16(v_tmp32_a, v_tmp_rnd);
   91|  45.5M|  const __m256i v_tmp32 = _mm256_mulhi_epi16(v_tmp32_b, *v_quant_shift);
   92|  45.5M|  const __m256i v_nz_mask = _mm256_cmpgt_epi16(v_tmp32, _mm256_setzero_si256());
   93|  45.5M|  const __m256i v_qcoeff = _mm256_sign_epi16(v_tmp32, v_coeff);
   94|  45.5M|  const __m256i v_dqcoeff = _mm256_mullo_epi16(v_qcoeff, *v_dequant);
   95|  45.5M|  store_coefficients_avx2(v_qcoeff, qcoeff_ptr);
   96|  45.5M|  store_coefficients_avx2(v_dqcoeff, dqcoeff_ptr);
   97|  45.5M|  return v_nz_mask;
   98|  50.7M|}
quantize_avx2.c:load_coefficients_avx2:
   52|  55.2M|static inline __m256i load_coefficients_avx2(const tran_low_t *coeff_ptr) {
   53|  55.2M|  const __m256i coeff1 = _mm256_load_si256((__m256i *)coeff_ptr);
   54|  55.2M|  const __m256i coeff2 = _mm256_load_si256((__m256i *)(coeff_ptr + 8));
   55|  55.2M|  return _mm256_packs_epi32(coeff1, coeff2);
   56|  55.2M|}
quantize_avx2.c:store_coefficients_avx2:
   59|  97.5M|                                           tran_low_t *coeff_ptr) {
   60|  97.5M|  __m256i coeff_sign = _mm256_srai_epi16(coeff_vals, 15);
   61|  97.5M|  __m256i coeff_vals_lo = _mm256_unpacklo_epi16(coeff_vals, coeff_sign);
   62|  97.5M|  __m256i coeff_vals_hi = _mm256_unpackhi_epi16(coeff_vals, coeff_sign);
   63|  97.5M|  _mm256_store_si256((__m256i *)coeff_ptr, coeff_vals_lo);
   64|  97.5M|  _mm256_store_si256((__m256i *)(coeff_ptr + 8), coeff_vals_hi);
   65|  97.5M|}
quantize_avx2.c:get_max_lane_eob:
  101|  55.2M|                                       __m256i v_mask) {
  102|  55.2M|  const __m256i v_iscan = _mm256_loadu_si256((const __m256i *)iscan);
  103|       |  const __m256i v_iscan_perm = _mm256_permute4x64_epi64(v_iscan, 0xD8);
  104|  55.2M|  const __m256i v_iscan_plus1 = _mm256_sub_epi16(v_iscan_perm, v_mask);
  105|  55.2M|  const __m256i v_nz_iscan = _mm256_and_si256(v_iscan_plus1, v_mask);
  106|  55.2M|  return _mm256_max_epi16(v_eobmax, v_nz_iscan);
  107|  55.2M|}
quantize_avx2.c:accumulate_eob256:
  109|  14.5M|static inline int16_t accumulate_eob256(__m256i eob256) {
  110|  14.5M|  const __m128i eob_lo = _mm256_castsi256_si128(eob256);
  111|  14.5M|  const __m128i eob_hi = _mm256_extractf128_si256(eob256, 1);
  112|  14.5M|  __m128i eob = _mm_max_epi16(eob_lo, eob_hi);
  113|  14.5M|  __m128i eob_shuffled = _mm_shuffle_epi32(eob, 0xe);
  114|  14.5M|  eob = _mm_max_epi16(eob, eob_shuffled);
  115|  14.5M|  eob_shuffled = _mm_shufflelo_epi16(eob, 0xe);
  116|  14.5M|  eob = _mm_max_epi16(eob, eob_shuffled);
  117|  14.5M|  eob_shuffled = _mm_shufflelo_epi16(eob, 0x1);
  118|  14.5M|  eob = _mm_max_epi16(eob, eob_shuffled);
  119|       |  return _mm_extract_epi16(eob, 1);
  120|  14.5M|}
quantize_avx2.c:quantize_b_no_qmatrix_avx2:
  212|  76.5k|    const int16_t *iscan, int log_scale) {
  213|  76.5k|  __m256i v_zbin, v_round, v_quant, v_dequant, v_quant_shift;
  214|  76.5k|  __m256i v_eobmax = _mm256_setzero_si256();
  215|       |
  216|  76.5k|  load_b_values_avx2(zbin_ptr, &v_zbin, round_ptr, &v_round, quant_ptr,
  217|  76.5k|                     &v_quant, dequant_ptr, &v_dequant, quant_shift_ptr,
  218|  76.5k|                     &v_quant_shift, log_scale);
  219|       |
  220|       |  // Do DC and first 15 AC.
  221|  76.5k|  __m256i v_nz_mask = quantize_b_logscale_16(
  222|  76.5k|      coeff_ptr, qcoeff_ptr, dqcoeff_ptr, &v_quant, &v_dequant, &v_round,
  223|  76.5k|      &v_zbin, &v_quant_shift, log_scale);
  224|       |
  225|  76.5k|  v_eobmax = get_max_lane_eob(iscan, v_eobmax, v_nz_mask);
  226|       |
  227|  76.5k|  v_round = _mm256_unpackhi_epi64(v_round, v_round);
  228|  76.5k|  v_quant = _mm256_unpackhi_epi64(v_quant, v_quant);
  229|  76.5k|  v_dequant = _mm256_unpackhi_epi64(v_dequant, v_dequant);
  230|  76.5k|  v_quant_shift = _mm256_unpackhi_epi64(v_quant_shift, v_quant_shift);
  231|  76.5k|  v_zbin = _mm256_unpackhi_epi64(v_zbin, v_zbin);
  232|       |
  233|  4.52M|  for (intptr_t count = n_coeffs - 16; count > 0; count -= 16) {
  ------------------
  |  Branch (233:40): [True: 4.44M, False: 76.5k]
  ------------------
  234|  4.44M|    coeff_ptr += 16;
  235|  4.44M|    qcoeff_ptr += 16;
  236|  4.44M|    dqcoeff_ptr += 16;
  237|  4.44M|    iscan += 16;
  238|  4.44M|    v_nz_mask = quantize_b_logscale_16(coeff_ptr, qcoeff_ptr, dqcoeff_ptr,
  239|  4.44M|                                       &v_quant, &v_dequant, &v_round, &v_zbin,
  240|  4.44M|                                       &v_quant_shift, log_scale);
  241|       |
  242|  4.44M|    v_eobmax = get_max_lane_eob(iscan, v_eobmax, v_nz_mask);
  243|  4.44M|  }
  244|       |
  245|  76.5k|  *eob_ptr = accumulate_eob256(v_eobmax);
  246|  76.5k|}
quantize_avx2.c:quantize_b_logscale_16:
  168|  4.52M|    __m256i *v_round, __m256i *v_zbin, __m256i *v_quant_shift, int log_scale) {
  169|  4.52M|  const __m256i v_coeff = load_coefficients_avx2(coeff_ptr);
  170|  4.52M|  const __m256i v_abs_coeff = _mm256_abs_epi16(v_coeff);
  171|  4.52M|  const __m256i v_zbin_mask = _mm256_cmpgt_epi16(v_abs_coeff, *v_zbin);
  172|       |
  173|  4.52M|  if (_mm256_movemask_epi8(v_zbin_mask) == 0) {
  ------------------
  |  Branch (173:7): [True: 1.36M, False: 3.15M]
  ------------------
  174|  1.36M|    _mm256_store_si256((__m256i *)qcoeff_ptr, _mm256_setzero_si256());
  175|  1.36M|    _mm256_store_si256((__m256i *)dqcoeff_ptr, _mm256_setzero_si256());
  176|  1.36M|    _mm256_store_si256((__m256i *)(qcoeff_ptr + 8), _mm256_setzero_si256());
  177|  1.36M|    _mm256_store_si256((__m256i *)(dqcoeff_ptr + 8), _mm256_setzero_si256());
  178|  1.36M|    return _mm256_setzero_si256();
  179|  1.36M|  }
  180|       |
  181|       |  // tmp = v_zbin_mask ? (int64_t)abs_coeff + log_scaled_round : 0
  182|  3.15M|  const __m256i v_tmp_rnd =
  183|  3.15M|      _mm256_and_si256(_mm256_adds_epi16(v_abs_coeff, *v_round), v_zbin_mask);
  184|       |  //  tmp32 = (int)(((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
  185|       |  //                 quant_shift_ptr[rc != 0]) >>
  186|       |  //                (16 - log_scale + AOM_QM_BITS));
  187|  3.15M|  const __m256i v_tmp32_a = _mm256_mulhi_epi16(v_tmp_rnd, *v_quant);
  188|  3.15M|  const __m256i v_tmp32_b = _mm256_add_epi16(v_tmp32_a, v_tmp_rnd);
  189|  3.15M|  const __m256i v_tmp32_hi = _mm256_slli_epi16(
  190|  3.15M|      _mm256_mulhi_epi16(v_tmp32_b, *v_quant_shift), log_scale);
  191|  3.15M|  const __m256i v_tmp32_lo = _mm256_srli_epi16(
  192|  3.15M|      _mm256_mullo_epi16(v_tmp32_b, *v_quant_shift), 16 - log_scale);
  193|  3.15M|  const __m256i v_tmp32 = _mm256_or_si256(v_tmp32_hi, v_tmp32_lo);
  194|  3.15M|  const __m256i v_dqcoeff_hi = _mm256_slli_epi16(
  195|  3.15M|      _mm256_mulhi_epi16(v_tmp32, *v_dequant), 16 - log_scale);
  196|  3.15M|  const __m256i v_dqcoeff_lo =
  197|  3.15M|      _mm256_srli_epi16(_mm256_mullo_epi16(v_tmp32, *v_dequant), log_scale);
  198|  3.15M|  const __m256i v_dqcoeff =
  199|  3.15M|      _mm256_sign_epi16(_mm256_or_si256(v_dqcoeff_hi, v_dqcoeff_lo), v_coeff);
  200|  3.15M|  const __m256i v_qcoeff = _mm256_sign_epi16(v_tmp32, v_coeff);
  201|  3.15M|  const __m256i v_nz_mask = _mm256_cmpgt_epi16(v_tmp32, _mm256_setzero_si256());
  202|  3.15M|  store_coefficients_avx2(v_qcoeff, qcoeff_ptr);
  203|  3.15M|  store_coefficients_avx2(v_dqcoeff, dqcoeff_ptr);
  204|  3.15M|  return v_nz_mask;
  205|  4.52M|}

aom_sad32x16x4d_avx2:
  136|   103k|                                  uint32_t res[4]) {                           \
  137|   103k|    aom_sadMxNx4d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  138|   103k|  }                                                                            \
aom_sad32x16x3d_avx2:
  141|  2.41k|                                  uint32_t res[4]) {                           \
  142|  2.41k|    aom_sadMxNx3d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  143|  2.41k|  }
aom_sad32x32x4d_avx2:
  136|  96.4k|                                  uint32_t res[4]) {                           \
  137|  96.4k|    aom_sadMxNx4d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  138|  96.4k|  }                                                                            \
aom_sad32x32x3d_avx2:
  141|  31.3k|                                  uint32_t res[4]) {                           \
  142|  31.3k|    aom_sadMxNx3d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  143|  31.3k|  }
aom_sad32x64x4d_avx2:
  136|  10.3k|                                  uint32_t res[4]) {                           \
  137|  10.3k|    aom_sadMxNx4d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  138|  10.3k|  }                                                                            \
aom_sad64x32x4d_avx2:
  136|  36.3k|                                  uint32_t res[4]) {                           \
  137|  36.3k|    aom_sadMxNx4d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  138|  36.3k|  }                                                                            \
aom_sad64x32x3d_avx2:
  141|      1|                                  uint32_t res[4]) {                           \
  142|      1|    aom_sadMxNx3d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  143|      1|  }
aom_sad64x64x4d_avx2:
  136|  11.0k|                                  uint32_t res[4]) {                           \
  137|  11.0k|    aom_sadMxNx4d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  138|  11.0k|  }                                                                            \
aom_sad64x64x3d_avx2:
  141|  3.23k|                                  uint32_t res[4]) {                           \
  142|  3.23k|    aom_sadMxNx3d_avx2(m, n, src, src_stride, ref, ref_stride, res);           \
  143|  3.23k|  }
aom_sad_skip_32x16x4d_avx2:
  166|   406k|                                        int ref_stride, uint32_t res[4]) {  \
  167|   406k|    aom_sadMxNx4d_avx2(m, ((n) >> 1), src, 2 * src_stride, ref,             \
  168|   406k|                       2 * ref_stride, res);                                \
  169|   406k|    res[0] <<= 1;                                                           \
  170|   406k|    res[1] <<= 1;                                                           \
  171|   406k|    res[2] <<= 1;                                                           \
  172|   406k|    res[3] <<= 1;                                                           \
  173|   406k|  }
aom_sad_skip_32x32x4d_avx2:
  166|  1.22M|                                        int ref_stride, uint32_t res[4]) {  \
  167|  1.22M|    aom_sadMxNx4d_avx2(m, ((n) >> 1), src, 2 * src_stride, ref,             \
  168|  1.22M|                       2 * ref_stride, res);                                \
  169|  1.22M|    res[0] <<= 1;                                                           \
  170|  1.22M|    res[1] <<= 1;                                                           \
  171|  1.22M|    res[2] <<= 1;                                                           \
  172|  1.22M|    res[3] <<= 1;                                                           \
  173|  1.22M|  }
aom_sad_skip_32x64x4d_avx2:
  166|   275k|                                        int ref_stride, uint32_t res[4]) {  \
  167|   275k|    aom_sadMxNx4d_avx2(m, ((n) >> 1), src, 2 * src_stride, ref,             \
  168|   275k|                       2 * ref_stride, res);                                \
  169|   275k|    res[0] <<= 1;                                                           \
  170|   275k|    res[1] <<= 1;                                                           \
  171|   275k|    res[2] <<= 1;                                                           \
  172|   275k|    res[3] <<= 1;                                                           \
  173|   275k|  }
aom_sad_skip_64x32x4d_avx2:
  166|   235k|                                        int ref_stride, uint32_t res[4]) {  \
  167|   235k|    aom_sadMxNx4d_avx2(m, ((n) >> 1), src, 2 * src_stride, ref,             \
  168|   235k|                       2 * ref_stride, res);                                \
  169|   235k|    res[0] <<= 1;                                                           \
  170|   235k|    res[1] <<= 1;                                                           \
  171|   235k|    res[2] <<= 1;                                                           \
  172|   235k|    res[3] <<= 1;                                                           \
  173|   235k|  }
aom_sad_skip_64x64x4d_avx2:
  166|   413k|                                        int ref_stride, uint32_t res[4]) {  \
  167|   413k|    aom_sadMxNx4d_avx2(m, ((n) >> 1), src, 2 * src_stride, ref,             \
  168|   413k|                       2 * ref_stride, res);                                \
  169|   413k|    res[0] <<= 1;                                                           \
  170|   413k|    res[1] <<= 1;                                                           \
  171|   413k|    res[2] <<= 1;                                                           \
  172|   413k|    res[3] <<= 1;                                                           \
  173|   413k|  }
aom_sad16x32x4d_avx2:
  295|  27.7k|                               uint32_t res[4]) {                           \
  296|  27.7k|    aom_sad16xNx4d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  297|  27.7k|  }
aom_sad16x16x4d_avx2:
  295|   543k|                               uint32_t res[4]) {                           \
  296|   543k|    aom_sad16xNx4d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  297|   543k|  }
aom_sad16x8x4d_avx2:
  295|   860k|                               uint32_t res[4]) {                           \
  296|   860k|    aom_sad16xNx4d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  297|   860k|  }
aom_sad16x32x3d_avx2:
  289|  2.02k|                               uint32_t res[4]) {                           \
  290|  2.02k|    aom_sad16xNx3d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  291|  2.02k|  }
aom_sad16x16x3d_avx2:
  289|   236k|                               uint32_t res[4]) {                           \
  290|   236k|    aom_sad16xNx3d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  291|   236k|  }
aom_sad16x8x3d_avx2:
  289|  18.4k|                               uint32_t res[4]) {                           \
  290|  18.4k|    aom_sad16xNx3d_avx2(n, src, src_stride, ref, ref_stride, res);          \
  291|  18.4k|  }
aom_sad_skip_16x32x4d_avx2:
  319|   495k|                                     int ref_stride, uint32_t res[4]) {       \
  320|   495k|    aom_sad16xNx4d_avx2(((n) >> 1), src, 2 * src_stride, ref, 2 * ref_stride, \
  321|   495k|                        res);                                                 \
  322|   495k|    res[0] <<= 1;                                                             \
  323|   495k|    res[1] <<= 1;                                                             \
  324|   495k|    res[2] <<= 1;                                                             \
  325|   495k|    res[3] <<= 1;                                                             \
  326|   495k|  }
aom_sad_skip_16x16x4d_avx2:
  319|  3.25M|                                     int ref_stride, uint32_t res[4]) {       \
  320|  3.25M|    aom_sad16xNx4d_avx2(((n) >> 1), src, 2 * src_stride, ref, 2 * ref_stride, \
  321|  3.25M|                        res);                                                 \
  322|  3.25M|    res[0] <<= 1;                                                             \
  323|  3.25M|    res[1] <<= 1;                                                             \
  324|  3.25M|    res[2] <<= 1;                                                             \
  325|  3.25M|    res[3] <<= 1;                                                             \
  326|  3.25M|  }
sad4d_avx2.c:aom_sadMxNx4d_avx2:
   47|  2.80M|    const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) {
   48|  2.80M|  __m256i src_reg, ref0_reg, ref1_reg, ref2_reg, ref3_reg;
   49|  2.80M|  __m256i sum_ref0, sum_ref1, sum_ref2, sum_ref3;
   50|  2.80M|  int i, j;
   51|  2.80M|  const uint8_t *ref0, *ref1, *ref2, *ref3;
   52|       |
   53|  2.80M|  ref0 = ref[0];
   54|  2.80M|  ref1 = ref[1];
   55|  2.80M|  ref2 = ref[2];
   56|  2.80M|  ref3 = ref[3];
   57|  2.80M|  sum_ref0 = _mm256_setzero_si256();
   58|  2.80M|  sum_ref2 = _mm256_setzero_si256();
   59|  2.80M|  sum_ref1 = _mm256_setzero_si256();
   60|  2.80M|  sum_ref3 = _mm256_setzero_si256();
   61|       |
   62|  58.4M|  for (i = 0; i < N; i++) {
  ------------------
  |  Branch (62:15): [True: 55.5M, False: 2.80M]
  ------------------
   63|   129M|    for (j = 0; j < M; j += 32) {
  ------------------
  |  Branch (63:17): [True: 74.3M, False: 55.5M]
  ------------------
   64|       |      // load src and all refs
   65|  74.3M|      src_reg = _mm256_loadu_si256((const __m256i *)(src + j));
   66|  74.3M|      ref0_reg = _mm256_loadu_si256((const __m256i *)(ref0 + j));
   67|  74.3M|      ref1_reg = _mm256_loadu_si256((const __m256i *)(ref1 + j));
   68|  74.3M|      ref2_reg = _mm256_loadu_si256((const __m256i *)(ref2 + j));
   69|  74.3M|      ref3_reg = _mm256_loadu_si256((const __m256i *)(ref3 + j));
   70|       |
   71|       |      // sum of the absolute differences between every ref-i to src
   72|  74.3M|      ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg);
   73|  74.3M|      ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg);
   74|  74.3M|      ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg);
   75|  74.3M|      ref3_reg = _mm256_sad_epu8(ref3_reg, src_reg);
   76|       |      // sum every ref-i
   77|  74.3M|      sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg);
   78|  74.3M|      sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg);
   79|  74.3M|      sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg);
   80|  74.3M|      sum_ref3 = _mm256_add_epi32(sum_ref3, ref3_reg);
   81|  74.3M|    }
   82|  55.5M|    src += src_stride;
   83|  55.5M|    ref0 += ref_stride;
   84|  55.5M|    ref1 += ref_stride;
   85|  55.5M|    ref2 += ref_stride;
   86|  55.5M|    ref3 += ref_stride;
   87|  55.5M|  }
   88|       |
   89|  2.80M|  aggregate_and_store_sum(res, &sum_ref0, &sum_ref1, &sum_ref2, &sum_ref3);
   90|  2.80M|}
sad4d_avx2.c:aggregate_and_store_sum:
   22|  8.27M|                                                     const __m256i *sum_ref3) {
   23|       |  // In sum_ref-i the result is saved in the first 4 bytes and the other 4
   24|       |  // bytes are zeroed.
   25|       |  // merge sum_ref0 and sum_ref1 also sum_ref2 and sum_ref3
   26|       |  // 0, 0, 1, 1
   27|  8.27M|  __m256i sum_ref01 = _mm256_castps_si256(_mm256_shuffle_ps(
   28|  8.27M|      _mm256_castsi256_ps(*sum_ref0), _mm256_castsi256_ps(*sum_ref1),
   29|  8.27M|      _MM_SHUFFLE(2, 0, 2, 0)));
   30|       |  // 2, 2, 3, 3
   31|  8.27M|  __m256i sum_ref23 = _mm256_castps_si256(_mm256_shuffle_ps(
   32|  8.27M|      _mm256_castsi256_ps(*sum_ref2), _mm256_castsi256_ps(*sum_ref3),
   33|  8.27M|      _MM_SHUFFLE(2, 0, 2, 0)));
   34|       |
   35|       |  // sum adjacent 32 bit integers
   36|  8.27M|  __m256i sum_ref0123 = _mm256_hadd_epi32(sum_ref01, sum_ref23);
   37|       |
   38|       |  // add the low 128 bit to the high 128 bit
   39|  8.27M|  __m128i sum = _mm_add_epi32(_mm256_castsi256_si128(sum_ref0123),
   40|  8.27M|                              _mm256_extractf128_si256(sum_ref0123, 1));
   41|       |
   42|  8.27M|  _mm_storeu_si128((__m128i *)(res), sum);
   43|  8.27M|}
sad4d_avx2.c:aom_sadMxNx3d_avx2:
   94|  36.9k|    const uint8_t *const ref[4], int ref_stride, uint32_t res[4]) {
   95|  36.9k|  __m256i src_reg, ref0_reg, ref1_reg, ref2_reg;
   96|  36.9k|  __m256i sum_ref0, sum_ref1, sum_ref2;
   97|  36.9k|  int i, j;
   98|  36.9k|  const uint8_t *ref0, *ref1, *ref2;
   99|  36.9k|  const __m256i zero = _mm256_setzero_si256();
  100|       |
  101|  36.9k|  ref0 = ref[0];
  102|  36.9k|  ref1 = ref[1];
  103|  36.9k|  ref2 = ref[2];
  104|  36.9k|  sum_ref0 = _mm256_setzero_si256();
  105|  36.9k|  sum_ref2 = _mm256_setzero_si256();
  106|  36.9k|  sum_ref1 = _mm256_setzero_si256();
  107|       |
  108|  1.28M|  for (i = 0; i < N; i++) {
  ------------------
  |  Branch (108:15): [True: 1.24M, False: 36.9k]
  ------------------
  109|  2.70M|    for (j = 0; j < M; j += 32) {
  ------------------
  |  Branch (109:17): [True: 1.45M, False: 1.24M]
  ------------------
  110|       |      // load src and all refs
  111|  1.45M|      src_reg = _mm256_loadu_si256((const __m256i *)(src + j));
  112|  1.45M|      ref0_reg = _mm256_loadu_si256((const __m256i *)(ref0 + j));
  113|  1.45M|      ref1_reg = _mm256_loadu_si256((const __m256i *)(ref1 + j));
  114|  1.45M|      ref2_reg = _mm256_loadu_si256((const __m256i *)(ref2 + j));
  115|       |
  116|       |      // sum of the absolute differences between every ref-i to src
  117|  1.45M|      ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg);
  118|  1.45M|      ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg);
  119|  1.45M|      ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg);
  120|       |      // sum every ref-i
  121|  1.45M|      sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg);
  122|  1.45M|      sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg);
  123|  1.45M|      sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg);
  124|  1.45M|    }
  125|  1.24M|    src += src_stride;
  126|  1.24M|    ref0 += ref_stride;
  127|  1.24M|    ref1 += ref_stride;
  128|  1.24M|    ref2 += ref_stride;
  129|  1.24M|  }
  130|  36.9k|  aggregate_and_store_sum(res, &sum_ref0, &sum_ref1, &sum_ref2, &zero);
  131|  36.9k|}
sad4d_avx2.c:aom_sad16xNx4d_avx2:
  240|  5.18M|                                                 uint32_t res[4]) {
  241|  5.18M|  __m256i src_reg, ref0_reg, ref1_reg, ref2_reg, ref3_reg;
  242|  5.18M|  __m256i sum_ref0, sum_ref1, sum_ref2, sum_ref3;
  243|  5.18M|  const uint8_t *ref0, *ref1, *ref2, *ref3;
  244|  5.18M|  assert(N % 2 == 0);
  245|       |
  246|  5.18M|  ref0 = ref[0];
  247|  5.18M|  ref1 = ref[1];
  248|  5.18M|  ref2 = ref[2];
  249|  5.18M|  ref3 = ref[3];
  250|       |
  251|  5.18M|  sum_ref0 = _mm256_setzero_si256();
  252|  5.18M|  sum_ref2 = _mm256_setzero_si256();
  253|  5.18M|  sum_ref1 = _mm256_setzero_si256();
  254|  5.18M|  sum_ref3 = _mm256_setzero_si256();
  255|       |
  256|  30.3M|  for (int i = 0; i < N; i += 2) {
  ------------------
  |  Branch (256:19): [True: 25.2M, False: 5.18M]
  ------------------
  257|       |    // load src and all refs
  258|  25.2M|    src_reg = yy_loadu2_128(src + src_stride, src);
  259|  25.2M|    ref0_reg = yy_loadu2_128(ref0 + ref_stride, ref0);
  260|  25.2M|    ref1_reg = yy_loadu2_128(ref1 + ref_stride, ref1);
  261|  25.2M|    ref2_reg = yy_loadu2_128(ref2 + ref_stride, ref2);
  262|  25.2M|    ref3_reg = yy_loadu2_128(ref3 + ref_stride, ref3);
  263|       |
  264|       |    // sum of the absolute differences between every ref-i to src
  265|  25.2M|    ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg);
  266|  25.2M|    ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg);
  267|  25.2M|    ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg);
  268|  25.2M|    ref3_reg = _mm256_sad_epu8(ref3_reg, src_reg);
  269|       |
  270|       |    // sum every ref-i
  271|  25.2M|    sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg);
  272|  25.2M|    sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg);
  273|  25.2M|    sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg);
  274|  25.2M|    sum_ref3 = _mm256_add_epi32(sum_ref3, ref3_reg);
  275|       |
  276|  25.2M|    src += 2 * src_stride;
  277|  25.2M|    ref0 += 2 * ref_stride;
  278|  25.2M|    ref1 += 2 * ref_stride;
  279|  25.2M|    ref2 += 2 * ref_stride;
  280|  25.2M|    ref3 += 2 * ref_stride;
  281|  25.2M|  }
  282|       |
  283|  5.18M|  aggregate_and_store_sum(res, &sum_ref0, &sum_ref1, &sum_ref2, &sum_ref3);
  284|  5.18M|}
sad4d_avx2.c:aom_sad16xNx3d_avx2:
  196|   256k|                                                 uint32_t res[4]) {
  197|   256k|  __m256i src_reg, ref0_reg, ref1_reg, ref2_reg;
  198|   256k|  __m256i sum_ref0, sum_ref1, sum_ref2;
  199|   256k|  const uint8_t *ref0, *ref1, *ref2;
  200|   256k|  const __m256i zero = _mm256_setzero_si256();
  201|   256k|  assert(N % 2 == 0);
  202|       |
  203|   256k|  ref0 = ref[0];
  204|   256k|  ref1 = ref[1];
  205|   256k|  ref2 = ref[2];
  206|   256k|  sum_ref0 = _mm256_setzero_si256();
  207|   256k|  sum_ref2 = _mm256_setzero_si256();
  208|   256k|  sum_ref1 = _mm256_setzero_si256();
  209|       |
  210|  2.25M|  for (int i = 0; i < N; i += 2) {
  ------------------
  |  Branch (210:19): [True: 1.99M, False: 256k]
  ------------------
  211|       |    // load src and all refs
  212|  1.99M|    src_reg = yy_loadu2_128(src + src_stride, src);
  213|  1.99M|    ref0_reg = yy_loadu2_128(ref0 + ref_stride, ref0);
  214|  1.99M|    ref1_reg = yy_loadu2_128(ref1 + ref_stride, ref1);
  215|  1.99M|    ref2_reg = yy_loadu2_128(ref2 + ref_stride, ref2);
  216|       |
  217|       |    // sum of the absolute differences between every ref-i to src
  218|  1.99M|    ref0_reg = _mm256_sad_epu8(ref0_reg, src_reg);
  219|  1.99M|    ref1_reg = _mm256_sad_epu8(ref1_reg, src_reg);
  220|  1.99M|    ref2_reg = _mm256_sad_epu8(ref2_reg, src_reg);
  221|       |
  222|       |    // sum every ref-i
  223|  1.99M|    sum_ref0 = _mm256_add_epi32(sum_ref0, ref0_reg);
  224|  1.99M|    sum_ref1 = _mm256_add_epi32(sum_ref1, ref1_reg);
  225|  1.99M|    sum_ref2 = _mm256_add_epi32(sum_ref2, ref2_reg);
  226|       |
  227|  1.99M|    src += 2 * src_stride;
  228|  1.99M|    ref0 += 2 * ref_stride;
  229|  1.99M|    ref1 += 2 * ref_stride;
  230|  1.99M|    ref2 += 2 * ref_stride;
  231|  1.99M|  }
  232|       |
  233|   256k|  aggregate_and_store_sum(res, &sum_ref0, &sum_ref1, &sum_ref2, &zero);
  234|   256k|}

aom_sad64x64_avx2:
   50|   135k|                                    const uint8_t *ref_ptr, int ref_stride) { \
   51|   135k|    return sad64xh_avx2(src_ptr, src_stride, ref_ptr, ref_stride, h);         \
   52|   135k|  }
aom_sad64x32_avx2:
   50|  39.4k|                                    const uint8_t *ref_ptr, int ref_stride) { \
   51|  39.4k|    return sad64xh_avx2(src_ptr, src_stride, ref_ptr, ref_stride, h);         \
   52|  39.4k|  }
aom_sad_skip_64x64_avx2:
   57|   196k|      int ref_stride) {                                                       \
   58|   196k|    return 2 * sad64xh_avx2(src_ptr, src_stride * 2, ref_ptr, ref_stride * 2, \
   59|   196k|                            h / 2);                                           \
   60|   196k|  }
aom_sad_skip_64x32_avx2:
   57|   154k|      int ref_stride) {                                                       \
   58|   154k|    return 2 * sad64xh_avx2(src_ptr, src_stride * 2, ref_ptr, ref_stride * 2, \
   59|   154k|                            h / 2);                                           \
   60|   154k|  }
aom_sad32x64_avx2:
  156|  48.6k|                                    const uint8_t *ref_ptr, int ref_stride) { \
  157|  48.6k|    return sad32xh_avx2(src_ptr, src_stride, ref_ptr, ref_stride, h);         \
  158|  48.6k|  }
aom_sad32x32_avx2:
  156|   174k|                                    const uint8_t *ref_ptr, int ref_stride) { \
  157|   174k|    return sad32xh_avx2(src_ptr, src_stride, ref_ptr, ref_stride, h);         \
  158|   174k|  }
aom_sad32x16_avx2:
  156|  75.8k|                                    const uint8_t *ref_ptr, int ref_stride) { \
  157|  75.8k|    return sad32xh_avx2(src_ptr, src_stride, ref_ptr, ref_stride, h);         \
  158|  75.8k|  }
aom_sad_skip_32x64_avx2:
  163|   166k|      int ref_stride) {                                                       \
  164|   166k|    return 2 * sad32xh_avx2(src_ptr, src_stride * 2, ref_ptr, ref_stride * 2, \
  165|   166k|                            h / 2);                                           \
  166|   166k|  }
aom_sad_skip_32x32_avx2:
  163|   561k|      int ref_stride) {                                                       \
  164|   561k|    return 2 * sad32xh_avx2(src_ptr, src_stride * 2, ref_ptr, ref_stride * 2, \
  165|   561k|                            h / 2);                                           \
  166|   561k|  }
aom_sad_skip_32x16_avx2:
  163|   278k|      int ref_stride) {                                                       \
  164|   278k|    return 2 * sad32xh_avx2(src_ptr, src_stride * 2, ref_ptr, ref_stride * 2, \
  165|   278k|                            h / 2);                                           \
  166|   278k|  }
sad_avx2.c:sad64xh_avx2:
   22|   526k|                                        int h) {
   23|   526k|  int i;
   24|   526k|  __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg;
   25|   526k|  __m256i sum_sad = _mm256_setzero_si256();
   26|   526k|  __m256i sum_sad_h;
   27|   526k|  __m128i sum_sad128;
   28|  19.2M|  for (i = 0; i < h; i++) {
  ------------------
  |  Branch (28:15): [True: 18.6M, False: 526k]
  ------------------
   29|  18.6M|    ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr);
   30|  18.6M|    ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + 32));
   31|  18.6M|    sad1_reg =
   32|  18.6M|        _mm256_sad_epu8(ref1_reg, _mm256_loadu_si256((__m256i const *)src_ptr));
   33|  18.6M|    sad2_reg = _mm256_sad_epu8(
   34|  18.6M|        ref2_reg, _mm256_loadu_si256((__m256i const *)(src_ptr + 32)));
   35|  18.6M|    sum_sad = _mm256_add_epi32(sum_sad, _mm256_add_epi32(sad1_reg, sad2_reg));
   36|  18.6M|    ref_ptr += ref_stride;
   37|  18.6M|    src_ptr += src_stride;
   38|  18.6M|  }
   39|   526k|  sum_sad_h = _mm256_srli_si256(sum_sad, 8);
   40|   526k|  sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h);
   41|       |  sum_sad128 = _mm256_extracti128_si256(sum_sad, 1);
   42|   526k|  sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128);
   43|   526k|  unsigned int res = (unsigned int)_mm_cvtsi128_si32(sum_sad128);
   44|   526k|  _mm256_zeroupper();
   45|   526k|  return res;
   46|   526k|}
sad_avx2.c:sad32xh_avx2:
  125|  1.30M|                                        int h) {
  126|  1.30M|  int i;
  127|  1.30M|  __m256i sad1_reg, sad2_reg, ref1_reg, ref2_reg;
  128|  1.30M|  __m256i sum_sad = _mm256_setzero_si256();
  129|  1.30M|  __m256i sum_sad_h;
  130|  1.30M|  __m128i sum_sad128;
  131|  1.30M|  int ref2_stride = ref_stride << 1;
  132|  1.30M|  int src2_stride = src_stride << 1;
  133|  1.30M|  int max = h >> 1;
  134|  14.5M|  for (i = 0; i < max; i++) {
  ------------------
  |  Branch (134:15): [True: 13.2M, False: 1.30M]
  ------------------
  135|  13.2M|    ref1_reg = _mm256_loadu_si256((__m256i const *)ref_ptr);
  136|  13.2M|    ref2_reg = _mm256_loadu_si256((__m256i const *)(ref_ptr + ref_stride));
  137|  13.2M|    sad1_reg =
  138|  13.2M|        _mm256_sad_epu8(ref1_reg, _mm256_loadu_si256((__m256i const *)src_ptr));
  139|  13.2M|    sad2_reg = _mm256_sad_epu8(
  140|  13.2M|        ref2_reg, _mm256_loadu_si256((__m256i const *)(src_ptr + src_stride)));
  141|  13.2M|    sum_sad = _mm256_add_epi32(sum_sad, _mm256_add_epi32(sad1_reg, sad2_reg));
  142|  13.2M|    ref_ptr += ref2_stride;
  143|  13.2M|    src_ptr += src2_stride;
  144|  13.2M|  }
  145|  1.30M|  sum_sad_h = _mm256_srli_si256(sum_sad, 8);
  146|  1.30M|  sum_sad = _mm256_add_epi32(sum_sad, sum_sad_h);
  147|       |  sum_sad128 = _mm256_extracti128_si256(sum_sad, 1);
  148|  1.30M|  sum_sad128 = _mm_add_epi32(_mm256_castsi256_si128(sum_sad), sum_sad128);
  149|  1.30M|  unsigned int res = (unsigned int)_mm_cvtsi128_si32(sum_sad128);
  150|  1.30M|  _mm256_zeroupper();
  151|  1.30M|  return res;
  152|  1.30M|}

aom_sse_avx2:
  104|  3.47M|                     int b_stride, int width, int height) {
  105|  3.47M|  int32_t y = 0;
  106|  3.47M|  int64_t sse = 0;
  107|  3.47M|  __m256i sum = _mm256_setzero_si256();
  108|  3.47M|  __m256i zero = _mm256_setzero_si256();
  109|  3.47M|  switch (width) {
  110|   671k|    case 4:
  ------------------
  |  Branch (110:5): [True: 671k, False: 2.80M]
  ------------------
  111|  1.25M|      do {
  112|  1.25M|        sse_w4x4_avx2(a, a_stride, b, b_stride, &sum);
  113|  1.25M|        a += a_stride << 2;
  114|  1.25M|        b += b_stride << 2;
  115|  1.25M|        y += 4;
  116|  1.25M|      } while (y < height);
  ------------------
  |  Branch (116:16): [True: 585k, False: 671k]
  ------------------
  117|   671k|      sse = summary_all_avx2(&sum);
  118|   671k|      break;
  119|   564k|    case 8:
  ------------------
  |  Branch (119:5): [True: 564k, False: 2.91M]
  ------------------
  120|  2.30M|      do {
  121|  2.30M|        sse_w8x2_avx2(a, a_stride, b, b_stride, &sum);
  122|  2.30M|        a += a_stride << 1;
  123|  2.30M|        b += b_stride << 1;
  124|  2.30M|        y += 2;
  125|  2.30M|      } while (y < height);
  ------------------
  |  Branch (125:16): [True: 1.73M, False: 564k]
  ------------------
  126|   564k|      sse = summary_all_avx2(&sum);
  127|   564k|      break;
  128|  1.54M|    case 16:
  ------------------
  |  Branch (128:5): [True: 1.54M, False: 1.93M]
  ------------------
  129|  10.0M|      do {
  130|  10.0M|        const __m128i v_a0 = xx_loadu_128(a);
  131|  10.0M|        const __m128i v_a1 = xx_loadu_128(a + a_stride);
  132|  10.0M|        const __m128i v_b0 = xx_loadu_128(b);
  133|  10.0M|        const __m128i v_b1 = xx_loadu_128(b + b_stride);
  134|  10.0M|        const __m256i v_a =
  135|  10.0M|            _mm256_insertf128_si256(_mm256_castsi128_si256(v_a0), v_a1, 0x01);
  136|  10.0M|        const __m256i v_b =
  137|  10.0M|            _mm256_insertf128_si256(_mm256_castsi128_si256(v_b0), v_b1, 0x01);
  138|  10.0M|        const __m256i v_al = _mm256_unpacklo_epi8(v_a, zero);
  139|  10.0M|        const __m256i v_au = _mm256_unpackhi_epi8(v_a, zero);
  140|  10.0M|        const __m256i v_bl = _mm256_unpacklo_epi8(v_b, zero);
  141|  10.0M|        const __m256i v_bu = _mm256_unpackhi_epi8(v_b, zero);
  142|  10.0M|        const __m256i v_asub = _mm256_sub_epi16(v_al, v_bl);
  143|  10.0M|        const __m256i v_bsub = _mm256_sub_epi16(v_au, v_bu);
  144|  10.0M|        const __m256i temp =
  145|  10.0M|            _mm256_add_epi32(_mm256_madd_epi16(v_asub, v_asub),
  146|  10.0M|                             _mm256_madd_epi16(v_bsub, v_bsub));
  147|  10.0M|        sum = _mm256_add_epi32(sum, temp);
  148|  10.0M|        a += a_stride << 1;
  149|  10.0M|        b += b_stride << 1;
  150|  10.0M|        y += 2;
  151|  10.0M|      } while (y < height);
  ------------------
  |  Branch (151:16): [True: 8.48M, False: 1.54M]
  ------------------
  152|  1.54M|      sse = summary_all_avx2(&sum);
  153|  1.54M|      break;
  154|   587k|    case 32:
  ------------------
  |  Branch (154:5): [True: 587k, False: 2.89M]
  ------------------
  155|  6.13M|      do {
  156|  6.13M|        sse_w32_avx2(&sum, a, b);
  157|  6.13M|        a += a_stride;
  158|  6.13M|        b += b_stride;
  159|  6.13M|        y += 1;
  160|  6.13M|      } while (y < height);
  ------------------
  |  Branch (160:16): [True: 5.55M, False: 587k]
  ------------------
  161|   587k|      sse = summary_all_avx2(&sum);
  162|   587k|      break;
  163|  49.0k|    case 64:
  ------------------
  |  Branch (163:5): [True: 49.0k, False: 3.43M]
  ------------------
  164|  2.98M|      do {
  165|  2.98M|        sse_w32_avx2(&sum, a, b);
  166|  2.98M|        sse_w32_avx2(&sum, a + 32, b + 32);
  167|  2.98M|        a += a_stride;
  168|  2.98M|        b += b_stride;
  169|  2.98M|        y += 1;
  170|  2.98M|      } while (y < height);
  ------------------
  |  Branch (170:16): [True: 2.93M, False: 49.0k]
  ------------------
  171|  49.0k|      sse = summary_all_avx2(&sum);
  172|  49.0k|      break;
  173|      0|    case 128:
  ------------------
  |  Branch (173:5): [True: 0, False: 3.47M]
  ------------------
  174|      0|      do {
  175|      0|        sse_w32_avx2(&sum, a, b);
  176|      0|        sse_w32_avx2(&sum, a + 32, b + 32);
  177|      0|        sse_w32_avx2(&sum, a + 64, b + 64);
  178|      0|        sse_w32_avx2(&sum, a + 96, b + 96);
  179|      0|        a += a_stride;
  180|      0|        b += b_stride;
  181|      0|        y += 1;
  182|      0|      } while (y < height);
  ------------------
  |  Branch (182:16): [True: 0, False: 0]
  ------------------
  183|      0|      sse = summary_all_avx2(&sum);
  184|      0|      break;
  185|  69.1k|    default:
  ------------------
  |  Branch (185:5): [True: 69.1k, False: 3.41M]
  ------------------
  186|  69.1k|      if ((width & 0x07) == 0) {
  ------------------
  |  Branch (186:11): [True: 47.4k, False: 21.6k]
  ------------------
  187|   817k|        do {
  188|   817k|          int i = 0;
  189|  3.23M|          do {
  190|  3.23M|            sse_w8x2_avx2(a + i, a_stride, b + i, b_stride, &sum);
  191|  3.23M|            i += 8;
  192|  3.23M|          } while (i < width);
  ------------------
  |  Branch (192:20): [True: 2.41M, False: 817k]
  ------------------
  193|   817k|          a += a_stride << 1;
  194|   817k|          b += b_stride << 1;
  195|   817k|          y += 2;
  196|   817k|        } while (y < height);
  ------------------
  |  Branch (196:18): [True: 770k, False: 47.4k]
  ------------------
  197|  47.4k|      } else {
  198|   121k|        do {
  199|   121k|          int i = 0;
  200|   204k|          do {
  201|   204k|            sse_w8x2_avx2(a + i, a_stride, b + i, b_stride, &sum);
  202|   204k|            const uint8_t *a2 = a + i + (a_stride << 1);
  203|   204k|            const uint8_t *b2 = b + i + (b_stride << 1);
  204|   204k|            sse_w8x2_avx2(a2, a_stride, b2, b_stride, &sum);
  205|   204k|            i += 8;
  206|   204k|          } while (i + 4 < width);
  ------------------
  |  Branch (206:20): [True: 82.8k, False: 121k]
  ------------------
  207|   121k|          sse_w4x4_avx2(a + i, a_stride, b + i, b_stride, &sum);
  208|   121k|          a += a_stride << 2;
  209|   121k|          b += b_stride << 2;
  210|   121k|          y += 4;
  211|   121k|        } while (y < height);
  ------------------
  |  Branch (211:18): [True: 99.7k, False: 21.6k]
  ------------------
  212|  21.6k|      }
  213|  69.1k|      sse = summary_all_avx2(&sum);
  214|  69.1k|      break;
  215|  3.47M|  }
  216|       |
  217|  3.48M|  return sse;
  218|  3.47M|}
aom_highbd_sse_avx2:
  258|   107k|                            int b_stride, int width, int height) {
  259|   107k|  int32_t y = 0;
  260|   107k|  int64_t sse = 0;
  261|   107k|  uint16_t *a = CONVERT_TO_SHORTPTR(a8);
  ------------------
  |  |   79|   107k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  262|   107k|  uint16_t *b = CONVERT_TO_SHORTPTR(b8);
  ------------------
  |  |   79|   107k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  263|   107k|  __m256i sum = _mm256_setzero_si256();
  264|   107k|  switch (width) {
  265|  7.02k|    case 4:
  ------------------
  |  Branch (265:5): [True: 7.02k, False: 100k]
  ------------------
  266|  25.2k|      do {
  267|  25.2k|        highbd_sse_w4x4_avx2(&sum, a, a_stride, b, b_stride);
  268|  25.2k|        a += a_stride << 2;
  269|  25.2k|        b += b_stride << 2;
  270|  25.2k|        y += 4;
  271|  25.2k|      } while (y < height);
  ------------------
  |  Branch (271:16): [True: 18.1k, False: 7.02k]
  ------------------
  272|  7.02k|      sse = summary_all_avx2(&sum);
  273|  7.02k|      break;
  274|  17.5k|    case 8:
  ------------------
  |  Branch (274:5): [True: 17.5k, False: 90.2k]
  ------------------
  275|   216k|      do {
  276|   216k|        highbd_sse_w8x2_avx2(&sum, a, a_stride, b, b_stride);
  277|   216k|        a += a_stride << 1;
  278|   216k|        b += b_stride << 1;
  279|   216k|        y += 2;
  280|   216k|      } while (y < height);
  ------------------
  |  Branch (280:16): [True: 198k, False: 17.5k]
  ------------------
  281|  17.5k|      sse = summary_all_avx2(&sum);
  282|  17.5k|      break;
  283|  51.0k|    case 16:
  ------------------
  |  Branch (283:5): [True: 51.0k, False: 56.7k]
  ------------------
  284|   707k|      do {
  285|   707k|        highbd_sse_w16_avx2(&sum, a, b);
  286|   707k|        a += a_stride;
  287|   707k|        b += b_stride;
  288|   707k|        y += 1;
  289|   707k|      } while (y < height);
  ------------------
  |  Branch (289:16): [True: 656k, False: 51.0k]
  ------------------
  290|  51.0k|      sse = summary_all_avx2(&sum);
  291|  51.0k|      break;
  292|  19.6k|    case 32:
  ------------------
  |  Branch (292:5): [True: 19.6k, False: 88.1k]
  ------------------
  293|  19.6k|      do {
  294|  19.6k|        int l = 0;
  295|  19.6k|        __m256i sum32 = _mm256_setzero_si256();
  296|   215k|        do {
  297|   215k|          highbd_sse_w16_avx2(&sum32, a, b);
  298|   215k|          highbd_sse_w16_avx2(&sum32, a + 16, b + 16);
  299|   215k|          a += a_stride;
  300|   215k|          b += b_stride;
  301|   215k|          l += 1;
  302|   215k|        } while (l < 64 && l < (height - y));
  ------------------
  |  Branch (302:18): [True: 215k, False: 4]
  |  Branch (302:28): [True: 195k, False: 19.6k]
  ------------------
  303|  19.6k|        summary_32_avx2(&sum32, &sum);
  304|  19.6k|        y += 64;
  305|  19.6k|      } while (y < height);
  ------------------
  |  Branch (305:16): [True: 0, False: 19.6k]
  ------------------
  306|  19.6k|      sse = summary_4x64_avx2(sum);
  307|  19.6k|      break;
  308|  1.05k|    case 64:
  ------------------
  |  Branch (308:5): [True: 1.05k, False: 106k]
  ------------------
  309|  1.25k|      do {
  310|  1.25k|        int l = 0;
  311|  1.25k|        __m256i sum32 = _mm256_setzero_si256();
  312|  16.3k|        do {
  313|  16.3k|          highbd_sse_w16_avx2(&sum32, a, b);
  314|  16.3k|          highbd_sse_w16_avx2(&sum32, a + 16 * 1, b + 16 * 1);
  315|  16.3k|          highbd_sse_w16_avx2(&sum32, a + 16 * 2, b + 16 * 2);
  316|  16.3k|          highbd_sse_w16_avx2(&sum32, a + 16 * 3, b + 16 * 3);
  317|  16.3k|          a += a_stride;
  318|  16.3k|          b += b_stride;
  319|  16.3k|          l += 1;
  320|  16.3k|        } while (l < 32 && l < (height - y));
  ------------------
  |  Branch (320:18): [True: 16.1k, False: 204]
  |  Branch (320:28): [True: 15.0k, False: 1.05k]
  ------------------
  321|  1.25k|        summary_32_avx2(&sum32, &sum);
  322|  1.25k|        y += 32;
  323|  1.25k|      } while (y < height);
  ------------------
  |  Branch (323:16): [True: 204, False: 1.05k]
  ------------------
  324|  1.05k|      sse = summary_4x64_avx2(sum);
  325|  1.05k|      break;
  326|      0|    case 128:
  ------------------
  |  Branch (326:5): [True: 0, False: 107k]
  ------------------
  327|      0|      do {
  328|      0|        int l = 0;
  329|      0|        __m256i sum32 = _mm256_setzero_si256();
  330|      0|        do {
  331|      0|          highbd_sse_w16_avx2(&sum32, a, b);
  332|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 1, b + 16 * 1);
  333|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 2, b + 16 * 2);
  334|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 3, b + 16 * 3);
  335|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 4, b + 16 * 4);
  336|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 5, b + 16 * 5);
  337|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 6, b + 16 * 6);
  338|      0|          highbd_sse_w16_avx2(&sum32, a + 16 * 7, b + 16 * 7);
  339|      0|          a += a_stride;
  340|      0|          b += b_stride;
  341|      0|          l += 1;
  342|      0|        } while (l < 16 && l < (height - y));
  ------------------
  |  Branch (342:18): [True: 0, False: 0]
  |  Branch (342:28): [True: 0, False: 0]
  ------------------
  343|      0|        summary_32_avx2(&sum32, &sum);
  344|      0|        y += 16;
  345|      0|      } while (y < height);
  ------------------
  |  Branch (345:16): [True: 0, False: 0]
  ------------------
  346|      0|      sse = summary_4x64_avx2(sum);
  347|      0|      break;
  348|  11.4k|    default:
  ------------------
  |  Branch (348:5): [True: 11.4k, False: 96.3k]
  ------------------
  349|  11.4k|      if (width & 0x7) {
  ------------------
  |  Branch (349:11): [True: 3.52k, False: 7.87k]
  ------------------
  350|  13.4k|        do {
  351|  13.4k|          int i = 0;
  352|  13.4k|          __m256i sum32 = _mm256_setzero_si256();
  353|  17.0k|          do {
  354|  17.0k|            highbd_sse_w8x2_avx2(&sum32, a + i, a_stride, b + i, b_stride);
  355|  17.0k|            const uint16_t *a2 = a + i + (a_stride << 1);
  356|  17.0k|            const uint16_t *b2 = b + i + (b_stride << 1);
  357|  17.0k|            highbd_sse_w8x2_avx2(&sum32, a2, a_stride, b2, b_stride);
  358|  17.0k|            i += 8;
  359|  17.0k|          } while (i + 4 < width);
  ------------------
  |  Branch (359:20): [True: 3.62k, False: 13.4k]
  ------------------
  360|  13.4k|          highbd_sse_w4x4_avx2(&sum32, a + i, a_stride, b + i, b_stride);
  361|  13.4k|          summary_32_avx2(&sum32, &sum);
  362|  13.4k|          a += a_stride << 2;
  363|  13.4k|          b += b_stride << 2;
  364|  13.4k|          y += 4;
  365|  13.4k|        } while (y < height);
  ------------------
  |  Branch (365:18): [True: 9.89k, False: 3.52k]
  ------------------
  366|  7.87k|      } else {
  367|  23.3k|        do {
  368|  23.3k|          int l = 0;
  369|  23.3k|          __m256i sum32 = _mm256_setzero_si256();
  370|  93.2k|          do {
  371|  93.2k|            int i = 0;
  372|   313k|            do {
  373|   313k|              highbd_sse_w8x2_avx2(&sum32, a + i, a_stride, b + i, b_stride);
  374|   313k|              i += 8;
  375|   313k|            } while (i < width);
  ------------------
  |  Branch (375:22): [True: 220k, False: 93.2k]
  ------------------
  376|  93.2k|            a += a_stride << 1;
  377|  93.2k|            b += b_stride << 1;
  378|  93.2k|            l += 2;
  379|  93.2k|          } while (l < 8 && l < (height - y));
  ------------------
  |  Branch (379:20): [True: 69.9k, False: 23.2k]
  |  Branch (379:29): [True: 69.9k, False: 57]
  ------------------
  380|  23.3k|          summary_32_avx2(&sum32, &sum);
  381|  23.3k|          y += 8;
  382|  23.3k|        } while (y < height);
  ------------------
  |  Branch (382:18): [True: 15.4k, False: 7.87k]
  ------------------
  383|  7.87k|      }
  384|  11.4k|      sse = summary_4x64_avx2(sum);
  385|  11.4k|      break;
  386|   107k|  }
  387|   107k|  return sse;
  388|   107k|}
sse_avx2.c:sse_w4x4_avx2:
   72|  1.37M|                                 const uint8_t *b, int b_stride, __m256i *sum) {
   73|  1.37M|  const __m128i v_a0 = xx_loadl_32(a);
   74|  1.37M|  const __m128i v_a1 = xx_loadl_32(a + a_stride);
   75|  1.37M|  const __m128i v_a2 = xx_loadl_32(a + a_stride * 2);
   76|  1.37M|  const __m128i v_a3 = xx_loadl_32(a + a_stride * 3);
   77|  1.37M|  const __m128i v_b0 = xx_loadl_32(b);
   78|  1.37M|  const __m128i v_b1 = xx_loadl_32(b + b_stride);
   79|  1.37M|  const __m128i v_b2 = xx_loadl_32(b + b_stride * 2);
   80|  1.37M|  const __m128i v_b3 = xx_loadl_32(b + b_stride * 3);
   81|  1.37M|  const __m128i v_a0123 = _mm_unpacklo_epi64(_mm_unpacklo_epi32(v_a0, v_a1),
   82|  1.37M|                                             _mm_unpacklo_epi32(v_a2, v_a3));
   83|  1.37M|  const __m128i v_b0123 = _mm_unpacklo_epi64(_mm_unpacklo_epi32(v_b0, v_b1),
   84|  1.37M|                                             _mm_unpacklo_epi32(v_b2, v_b3));
   85|  1.37M|  const __m256i v_a_w = _mm256_cvtepu8_epi16(v_a0123);
   86|  1.37M|  const __m256i v_b_w = _mm256_cvtepu8_epi16(v_b0123);
   87|  1.37M|  const __m256i v_d_w = _mm256_sub_epi16(v_a_w, v_b_w);
   88|  1.37M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d_w, v_d_w));
   89|  1.37M|}
sse_avx2.c:summary_all_avx2:
   37|  3.55M|static inline int64_t summary_all_avx2(const __m256i *sum_all) {
   38|  3.55M|  int64_t sum;
   39|  3.55M|  __m256i zero = _mm256_setzero_si256();
   40|  3.55M|  const __m256i sum0_4x64 = _mm256_unpacklo_epi32(*sum_all, zero);
   41|  3.55M|  const __m256i sum1_4x64 = _mm256_unpackhi_epi32(*sum_all, zero);
   42|  3.55M|  const __m256i sum_4x64 = _mm256_add_epi64(sum0_4x64, sum1_4x64);
   43|  3.55M|  const __m128i sum_2x64 = _mm_add_epi64(_mm256_castsi256_si128(sum_4x64),
   44|  3.55M|                                         _mm256_extracti128_si256(sum_4x64, 1));
   45|       |  const __m128i sum_1x64 = _mm_add_epi64(sum_2x64, _mm_srli_si128(sum_2x64, 8));
   46|  3.55M|  xx_storel_64(&sum, sum_1x64);
   47|  3.55M|  return sum;
   48|  3.55M|}
sse_avx2.c:sse_w8x2_avx2:
   92|  5.94M|                                 const uint8_t *b, int b_stride, __m256i *sum) {
   93|  5.94M|  const __m128i v_a0 = xx_loadl_64(a);
   94|  5.94M|  const __m128i v_a1 = xx_loadl_64(a + a_stride);
   95|  5.94M|  const __m128i v_b0 = xx_loadl_64(b);
   96|  5.94M|  const __m128i v_b1 = xx_loadl_64(b + b_stride);
   97|  5.94M|  const __m256i v_a_w = _mm256_cvtepu8_epi16(_mm_unpacklo_epi64(v_a0, v_a1));
   98|  5.94M|  const __m256i v_b_w = _mm256_cvtepu8_epi16(_mm_unpacklo_epi64(v_b0, v_b1));
   99|  5.94M|  const __m256i v_d_w = _mm256_sub_epi16(v_a_w, v_b_w);
  100|  5.94M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d_w, v_d_w));
  101|  5.94M|}
sse_avx2.c:sse_w32_avx2:
   23|  12.0M|                                const uint8_t *b) {
   24|  12.0M|  const __m256i v_a0 = yy_loadu_256(a);
   25|  12.0M|  const __m256i v_b0 = yy_loadu_256(b);
   26|  12.0M|  const __m256i zero = _mm256_setzero_si256();
   27|  12.0M|  const __m256i v_a00_w = _mm256_unpacklo_epi8(v_a0, zero);
   28|  12.0M|  const __m256i v_a01_w = _mm256_unpackhi_epi8(v_a0, zero);
   29|  12.0M|  const __m256i v_b00_w = _mm256_unpacklo_epi8(v_b0, zero);
   30|  12.0M|  const __m256i v_b01_w = _mm256_unpackhi_epi8(v_b0, zero);
   31|  12.0M|  const __m256i v_d00_w = _mm256_sub_epi16(v_a00_w, v_b00_w);
   32|  12.0M|  const __m256i v_d01_w = _mm256_sub_epi16(v_a01_w, v_b01_w);
   33|  12.0M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d00_w, v_d00_w));
   34|  12.0M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d01_w, v_d01_w));
   35|  12.0M|}
sse_avx2.c:highbd_sse_w4x4_avx2:
  231|  38.6k|                                        int b_stride) {
  232|  38.6k|  const __m128i v_a0 = xx_loadl_64(a);
  233|  38.6k|  const __m128i v_a1 = xx_loadl_64(a + a_stride);
  234|  38.6k|  const __m128i v_a2 = xx_loadl_64(a + a_stride * 2);
  235|  38.6k|  const __m128i v_a3 = xx_loadl_64(a + a_stride * 3);
  236|  38.6k|  const __m128i v_b0 = xx_loadl_64(b);
  237|  38.6k|  const __m128i v_b1 = xx_loadl_64(b + b_stride);
  238|  38.6k|  const __m128i v_b2 = xx_loadl_64(b + b_stride * 2);
  239|  38.6k|  const __m128i v_b3 = xx_loadl_64(b + b_stride * 3);
  240|  38.6k|  const __m256i v_a_w = yy_set_m128i(_mm_unpacklo_epi64(v_a0, v_a1),
  241|  38.6k|                                     _mm_unpacklo_epi64(v_a2, v_a3));
  242|  38.6k|  const __m256i v_b_w = yy_set_m128i(_mm_unpacklo_epi64(v_b0, v_b1),
  243|  38.6k|                                     _mm_unpacklo_epi64(v_b2, v_b3));
  244|  38.6k|  const __m256i v_d_w = _mm256_sub_epi16(v_a_w, v_b_w);
  245|  38.6k|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d_w, v_d_w));
  246|  38.6k|}
sse_avx2.c:highbd_sse_w8x2_avx2:
  250|   564k|                                        int b_stride) {
  251|   564k|  const __m256i v_a_w = yy_loadu2_128(a + a_stride, a);
  252|   564k|  const __m256i v_b_w = yy_loadu2_128(b + b_stride, b);
  253|   564k|  const __m256i v_d_w = _mm256_sub_epi16(v_a_w, v_b_w);
  254|   564k|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d_w, v_d_w));
  255|   564k|}
sse_avx2.c:highbd_sse_w16_avx2:
  222|  1.20M|                                       const uint16_t *b) {
  223|  1.20M|  const __m256i v_a_w = yy_loadu_256(a);
  224|  1.20M|  const __m256i v_b_w = yy_loadu_256(b);
  225|  1.20M|  const __m256i v_d_w = _mm256_sub_epi16(v_a_w, v_b_w);
  226|  1.20M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(v_d_w, v_d_w));
  227|  1.20M|}
sse_avx2.c:summary_32_avx2:
   51|  57.6k|static inline void summary_32_avx2(const __m256i *sum32, __m256i *sum) {
   52|  57.6k|  const __m256i sum0_4x64 =
   53|  57.6k|      _mm256_cvtepu32_epi64(_mm256_castsi256_si128(*sum32));
   54|  57.6k|  const __m256i sum1_4x64 =
   55|       |      _mm256_cvtepu32_epi64(_mm256_extracti128_si256(*sum32, 1));
   56|  57.6k|  const __m256i sum_4x64 = _mm256_add_epi64(sum0_4x64, sum1_4x64);
   57|  57.6k|  *sum = _mm256_add_epi64(*sum, sum_4x64);
   58|  57.6k|}
sse_avx2.c:summary_4x64_avx2:
   60|  32.1k|static inline int64_t summary_4x64_avx2(const __m256i sum_4x64) {
   61|  32.1k|  int64_t sum;
   62|  32.1k|  const __m128i sum_2x64 = _mm_add_epi64(_mm256_castsi256_si128(sum_4x64),
   63|  32.1k|                                         _mm256_extracti128_si256(sum_4x64, 1));
   64|  32.1k|  const __m128i sum_1x64 = _mm_add_epi64(sum_2x64, _mm_srli_si128(sum_2x64, 8));
   65|       |
   66|  32.1k|  xx_storel_64(&sum, sum_1x64);
   67|  32.1k|  return sum;
   68|  32.1k|}

aom_subtract_block_avx2:
   86|  80.9M|                             ptrdiff_t pred_stride) {
   87|  80.9M|  switch (cols) {
   88|  3.03M|    case 16:
  ------------------
  |  Branch (88:5): [True: 3.03M, False: 77.9M]
  ------------------
   89|  3.03M|      subtract_block_16xn_avx2(rows, diff_ptr, diff_stride, src_ptr, src_stride,
   90|  3.03M|                               pred_ptr, pred_stride);
   91|  3.03M|      break;
   92|   366k|    case 32:
  ------------------
  |  Branch (92:5): [True: 366k, False: 80.6M]
  ------------------
   93|   366k|      subtract_block_32xn_avx2(rows, diff_ptr, diff_stride, src_ptr, src_stride,
   94|   366k|                               pred_ptr, pred_stride);
   95|   366k|      break;
   96|  36.1k|    case 64:
  ------------------
  |  Branch (96:5): [True: 36.1k, False: 80.9M]
  ------------------
   97|  36.1k|      subtract_block_64xn_avx2(rows, diff_ptr, diff_stride, src_ptr, src_stride,
   98|  36.1k|                               pred_ptr, pred_stride);
   99|  36.1k|      break;
  100|      0|    case 128:
  ------------------
  |  Branch (100:5): [True: 0, False: 80.9M]
  ------------------
  101|      0|      subtract_block_128xn_avx2(rows, diff_ptr, diff_stride, src_ptr,
  102|      0|                                src_stride, pred_ptr, pred_stride);
  103|      0|      break;
  104|  77.5M|    default:
  ------------------
  |  Branch (104:5): [True: 77.5M, False: 3.38M]
  ------------------
  105|  77.5M|      aom_subtract_block_sse2(rows, cols, diff_ptr, diff_stride, src_ptr,
  106|  77.5M|                              src_stride, pred_ptr, pred_stride);
  107|  77.5M|      break;
  108|  80.9M|  }
  109|  80.9M|}
subtract_avx2.c:subtract_block_16xn_avx2:
   32|  3.03M|    ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride) {
   33|  47.6M|  for (int32_t j = 0; j < rows; ++j) {
  ------------------
  |  Branch (33:23): [True: 44.6M, False: 3.03M]
  ------------------
   34|  44.6M|    __m128i s = _mm_lddqu_si128((__m128i *)(src_ptr));
   35|  44.6M|    __m128i p = _mm_lddqu_si128((__m128i *)(pred_ptr));
   36|  44.6M|    __m256i s_0 = _mm256_cvtepu8_epi16(s);
   37|  44.6M|    __m256i p_0 = _mm256_cvtepu8_epi16(p);
   38|  44.6M|    const __m256i d_0 = _mm256_sub_epi16(s_0, p_0);
   39|  44.6M|    _mm256_store_si256((__m256i *)(diff_ptr), d_0);
   40|  44.6M|    src_ptr += src_stride;
   41|  44.6M|    pred_ptr += pred_stride;
   42|  44.6M|    diff_ptr += diff_stride;
   43|  44.6M|  }
   44|  3.03M|}
subtract_avx2.c:subtract_block_32xn_avx2:
   48|   366k|    ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride) {
   49|  11.4M|  for (int32_t j = 0; j < rows; ++j) {
  ------------------
  |  Branch (49:23): [True: 11.0M, False: 366k]
  ------------------
   50|  11.0M|    subtract32_avx2(diff_ptr, src_ptr, pred_ptr);
   51|  11.0M|    src_ptr += src_stride;
   52|  11.0M|    pred_ptr += pred_stride;
   53|  11.0M|    diff_ptr += diff_stride;
   54|  11.0M|  }
   55|   366k|}
subtract_avx2.c:subtract32_avx2:
   16|  15.3M|                                   const uint8_t *pred_ptr) {
   17|  15.3M|  __m256i s = _mm256_lddqu_si256((__m256i *)(src_ptr));
   18|  15.3M|  __m256i p = _mm256_lddqu_si256((__m256i *)(pred_ptr));
   19|  15.3M|  __m256i set_one_minusone = _mm256_set1_epi32((int)0xff01ff01);
   20|  15.3M|  __m256i diff0 = _mm256_unpacklo_epi8(s, p);
   21|  15.3M|  __m256i diff1 = _mm256_unpackhi_epi8(s, p);
   22|  15.3M|  diff0 = _mm256_maddubs_epi16(diff0, set_one_minusone);
   23|  15.3M|  diff1 = _mm256_maddubs_epi16(diff1, set_one_minusone);
   24|  15.3M|  _mm256_store_si256((__m256i *)(diff_ptr),
   25|  15.3M|                     _mm256_permute2x128_si256(diff0, diff1, 0x20));
   26|  15.3M|  _mm256_store_si256((__m256i *)(diff_ptr + 16),
   27|       |                     _mm256_permute2x128_si256(diff0, diff1, 0x31));
   28|  15.3M|}
subtract_avx2.c:subtract_block_64xn_avx2:
   59|  36.1k|    ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride) {
   60|  2.19M|  for (int32_t j = 0; j < rows; ++j) {
  ------------------
  |  Branch (60:23): [True: 2.15M, False: 36.1k]
  ------------------
   61|  2.15M|    subtract32_avx2(diff_ptr, src_ptr, pred_ptr);
   62|  2.15M|    subtract32_avx2(diff_ptr + 32, src_ptr + 32, pred_ptr + 32);
   63|  2.15M|    src_ptr += src_stride;
   64|  2.15M|    pred_ptr += pred_stride;
   65|  2.15M|    diff_ptr += diff_stride;
   66|  2.15M|  }
   67|  36.1k|}

aom_sum_squares_2d_i16_avx2:
   68|  5.91M|                                     int height) {
   69|  5.91M|  if (LIKELY(width == 4 && height == 4)) {
  ------------------
  |  |   54|  7.13M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.04M, False: 4.87M]
  |  |  |  Branch (54:36): [True: 1.21M, False: 4.70M]
  |  |  |  Branch (54:36): [True: 1.04M, False: 165k]
  |  |  ------------------
  ------------------
   70|  1.04M|    return aom_sum_squares_2d_i16_4x4_sse2(src, stride);
   71|  4.87M|  } else if (LIKELY(width == 4 && (height & 3) == 0)) {
  ------------------
  |  |   54|  5.03M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 166k, False: 4.70M]
  |  |  |  Branch (54:36): [True: 166k, False: 4.70M]
  |  |  |  Branch (54:36): [True: 166k, False: 19]
  |  |  ------------------
  ------------------
   72|   166k|    return aom_sum_squares_2d_i16_4xn_sse2(src, stride, height);
   73|  4.70M|  } else if (LIKELY(width == 8 && (height & 3) == 0)) {
  ------------------
  |  |   54|  9.22M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 4.51M, False: 189k]
  |  |  |  Branch (54:36): [True: 4.51M, False: 189k]
  |  |  |  Branch (54:36): [True: 4.51M, False: 18.4E]
  |  |  ------------------
  ------------------
   74|  4.51M|    return aom_sum_squares_2d_i16_nxn_sse2(src, stride, width, height);
   75|  4.51M|  } else if (LIKELY(((width & 15) == 0) && ((height & 3) == 0))) {
  ------------------
  |  |   54|   342k|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 152k, False: 36.6k]
  |  |  |  Branch (54:36): [True: 153k, False: 35.9k]
  |  |  |  Branch (54:36): [True: 152k, False: 711]
  |  |  ------------------
  ------------------
   76|   152k|    return aom_sum_squares_2d_i16_nxn_avx2(src, stride, width, height);
   77|   152k|  } else {
   78|  36.6k|    return aom_sum_squares_2d_i16_c(src, stride, width, height);
   79|  36.6k|  }
   80|  5.91M|}
aom_sum_sse_2d_i16_avx2:
  146|  63.3M|                                 int height, int *sum) {
  147|  63.3M|  if (LIKELY(width == 4 && height == 4)) {
  ------------------
  |  |   54|   101M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 30.9M, False: 32.3M]
  |  |  |  Branch (54:36): [True: 37.9M, False: 25.3M]
  |  |  |  Branch (54:36): [True: 30.9M, False: 6.97M]
  |  |  ------------------
  ------------------
  148|  30.9M|    return aom_sum_sse_2d_i16_4x4_sse2(src, src_stride, sum);
  149|  32.3M|  } else if (LIKELY(width == 4 && (height & 3) == 0)) {
  ------------------
  |  |   54|  39.3M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 6.91M, False: 25.4M]
  |  |  |  Branch (54:36): [True: 7.01M, False: 25.3M]
  |  |  |  Branch (54:36): [True: 6.91M, False: 100k]
  |  |  ------------------
  ------------------
  150|  6.91M|    return aom_sum_sse_2d_i16_4xn_sse2(src, src_stride, height, sum);
  151|  25.4M|  } else if (LIKELY(width == 8 && (height & 3) == 0)) {
  ------------------
  |  |   54|  49.2M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 23.6M, False: 1.76M]
  |  |  |  Branch (54:36): [True: 23.7M, False: 1.69M]
  |  |  |  Branch (54:36): [True: 23.6M, False: 69.9k]
  |  |  ------------------
  ------------------
  152|  23.6M|    return aom_sum_sse_2d_i16_nxn_sse2(src, src_stride, width, height, sum);
  153|  23.6M|  } else if (LIKELY(((width & 15) == 0) && ((height & 3) == 0))) {
  ------------------
  |  |   54|  3.24M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.43M, False: 328k]
  |  |  |  Branch (54:36): [True: 1.47M, False: 288k]
  |  |  |  Branch (54:36): [True: 1.43M, False: 39.6k]
  |  |  ------------------
  ------------------
  154|  1.43M|    return aom_sum_sse_2d_i16_nxn_avx2(src, src_stride, width, height, sum);
  155|  1.43M|  } else {
  156|   328k|    return aom_sum_sse_2d_i16_c(src, src_stride, width, height, sum);
  157|   328k|  }
  158|  63.3M|}
aom_var_2d_u8_avx2:
  187|  9.72k|                            int height) {
  188|  9.72k|  uint8_t *srcp;
  189|  9.72k|  uint64_t s = 0, ss = 0;
  190|  9.72k|  __m256i vzero = _mm256_setzero_si256();
  191|  9.72k|  __m256i v_acc_sum = vzero;
  192|  9.72k|  __m256i v_acc_sqs = vzero;
  193|  9.72k|  int i, j;
  194|       |
  195|       |  // Process 32 elements in a row
  196|  15.1k|  for (i = 0; i < width - 31; i += 32) {
  ------------------
  |  Branch (196:15): [True: 5.43k, False: 9.72k]
  ------------------
  197|  5.43k|    srcp = src + i;
  198|       |    // Process 8 columns at a time
  199|  42.1k|    for (j = 0; j < height - 7; j += 8) {
  ------------------
  |  Branch (199:17): [True: 36.6k, False: 5.43k]
  ------------------
  200|  36.6k|      __m256i vsrc[8];
  201|   330k|      for (int k = 0; k < 8; k++) {
  ------------------
  |  Branch (201:23): [True: 293k, False: 36.6k]
  ------------------
  202|   293k|        vsrc[k] = _mm256_loadu_si256((__m256i *)srcp);
  203|   293k|        srcp += src_stride;
  204|   293k|      }
  205|   330k|      for (int k = 0; k < 8; k++) {
  ------------------
  |  Branch (205:23): [True: 293k, False: 36.6k]
  ------------------
  206|   293k|        __m256i vsrc0 = _mm256_unpacklo_epi8(vsrc[k], vzero);
  207|   293k|        __m256i vsrc1 = _mm256_unpackhi_epi8(vsrc[k], vzero);
  208|   293k|        v_acc_sum = _mm256_add_epi16(v_acc_sum, vsrc0);
  209|   293k|        v_acc_sum = _mm256_add_epi16(v_acc_sum, vsrc1);
  210|       |
  211|   293k|        __m256i vsqs0 = _mm256_madd_epi16(vsrc0, vsrc0);
  212|   293k|        __m256i vsqs1 = _mm256_madd_epi16(vsrc1, vsrc1);
  213|   293k|        v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs0);
  214|   293k|        v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs1);
  215|   293k|      }
  216|       |
  217|       |      // Update total sum and clear the vectors
  218|  36.6k|      s += mm256_accumulate_epi16(v_acc_sum);
  219|  36.6k|      ss += mm256_accumulate_epi32(v_acc_sqs);
  220|  36.6k|      v_acc_sum = vzero;
  221|  36.6k|      v_acc_sqs = vzero;
  222|  36.6k|    }
  223|       |
  224|       |    // Process remaining rows (height not a multiple of 8)
  225|  20.4k|    for (; j < height; j++) {
  ------------------
  |  Branch (225:12): [True: 15.0k, False: 5.43k]
  ------------------
  226|  15.0k|      __m256i vsrc = _mm256_loadu_si256((__m256i *)srcp);
  227|  15.0k|      __m256i vsrc0 = _mm256_unpacklo_epi8(vsrc, vzero);
  228|  15.0k|      __m256i vsrc1 = _mm256_unpackhi_epi8(vsrc, vzero);
  229|  15.0k|      v_acc_sum = _mm256_add_epi16(v_acc_sum, vsrc0);
  230|  15.0k|      v_acc_sum = _mm256_add_epi16(v_acc_sum, vsrc1);
  231|       |
  232|  15.0k|      __m256i vsqs0 = _mm256_madd_epi16(vsrc0, vsrc0);
  233|  15.0k|      __m256i vsqs1 = _mm256_madd_epi16(vsrc1, vsrc1);
  234|  15.0k|      v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs0);
  235|  15.0k|      v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs1);
  236|       |
  237|  15.0k|      srcp += src_stride;
  238|  15.0k|    }
  239|       |
  240|       |    // Update total sum and clear the vectors
  241|  5.43k|    s += mm256_accumulate_epi16(v_acc_sum);
  242|  5.43k|    ss += mm256_accumulate_epi32(v_acc_sqs);
  243|  5.43k|    v_acc_sum = vzero;
  244|  5.43k|    v_acc_sqs = vzero;
  245|  5.43k|  }
  246|       |
  247|       |  // Process the remaining area using C
  248|  9.72k|  srcp = src;
  249|   199k|  for (int k = 0; k < height; k++) {
  ------------------
  |  Branch (249:19): [True: 189k, False: 9.72k]
  ------------------
  250|  2.14M|    for (int m = i; m < width; m++) {
  ------------------
  |  Branch (250:21): [True: 1.95M, False: 189k]
  ------------------
  251|  1.95M|      uint8_t val = srcp[m];
  252|  1.95M|      s += val;
  253|  1.95M|      ss += val * val;
  254|  1.95M|    }
  255|   189k|    srcp += src_stride;
  256|   189k|  }
  257|  9.72k|  return (ss - s * s / (width * height));
  258|  9.72k|}
aom_var_2d_u16_avx2:
  262|  2.52k|                             int height) {
  263|  2.52k|  uint16_t *srcp1 = CONVERT_TO_SHORTPTR(src), *srcp;
  ------------------
  |  |   79|  2.52k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  264|  2.52k|  uint64_t s = 0, ss = 0;
  265|  2.52k|  __m256i vzero = _mm256_setzero_si256();
  266|  2.52k|  __m256i v_acc_sum = vzero;
  267|  2.52k|  __m256i v_acc_sqs = vzero;
  268|  2.52k|  int i, j;
  269|       |
  270|       |  // Process 16 elements in a row
  271|  5.01k|  for (i = 0; i < width - 15; i += 16) {
  ------------------
  |  Branch (271:15): [True: 2.49k, False: 2.52k]
  ------------------
  272|  2.49k|    srcp = srcp1 + i;
  273|       |    // Process 8 columns at a time
  274|  3.68k|    for (j = 0; j < height - 8; j += 8) {
  ------------------
  |  Branch (274:17): [True: 1.18k, False: 2.49k]
  ------------------
  275|  1.18k|      __m256i vsrc[8];
  276|  10.6k|      for (int k = 0; k < 8; k++) {
  ------------------
  |  Branch (276:23): [True: 9.48k, False: 1.18k]
  ------------------
  277|  9.48k|        vsrc[k] = _mm256_loadu_si256((__m256i *)srcp);
  278|  9.48k|        srcp += src_stride;
  279|  9.48k|      }
  280|  10.6k|      for (int k = 0; k < 8; k++) {
  ------------------
  |  Branch (280:23): [True: 9.48k, False: 1.18k]
  ------------------
  281|  9.48k|        __m256i vsrc0 = _mm256_unpacklo_epi16(vsrc[k], vzero);
  282|  9.48k|        __m256i vsrc1 = _mm256_unpackhi_epi16(vsrc[k], vzero);
  283|  9.48k|        v_acc_sum = _mm256_add_epi32(vsrc0, v_acc_sum);
  284|  9.48k|        v_acc_sum = _mm256_add_epi32(vsrc1, v_acc_sum);
  285|       |
  286|  9.48k|        __m256i vsqs0 = _mm256_madd_epi16(vsrc[k], vsrc[k]);
  287|  9.48k|        v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs0);
  288|  9.48k|      }
  289|       |
  290|       |      // Update total sum and clear the vectors
  291|  1.18k|      s += mm256_accumulate_epi32(v_acc_sum);
  292|  1.18k|      ss += mm256_accumulate_epi32(v_acc_sqs);
  293|  1.18k|      v_acc_sum = vzero;
  294|  1.18k|      v_acc_sqs = vzero;
  295|  1.18k|    }
  296|       |
  297|       |    // Process remaining rows (height not a multiple of 8)
  298|  15.8k|    for (; j < height; j++) {
  ------------------
  |  Branch (298:12): [True: 13.3k, False: 2.49k]
  ------------------
  299|  13.3k|      __m256i vsrc = _mm256_loadu_si256((__m256i *)srcp);
  300|  13.3k|      __m256i vsrc0 = _mm256_unpacklo_epi16(vsrc, vzero);
  301|  13.3k|      __m256i vsrc1 = _mm256_unpackhi_epi16(vsrc, vzero);
  302|  13.3k|      v_acc_sum = _mm256_add_epi32(vsrc0, v_acc_sum);
  303|  13.3k|      v_acc_sum = _mm256_add_epi32(vsrc1, v_acc_sum);
  304|       |
  305|  13.3k|      __m256i vsqs0 = _mm256_madd_epi16(vsrc, vsrc);
  306|  13.3k|      v_acc_sqs = _mm256_add_epi32(v_acc_sqs, vsqs0);
  307|  13.3k|      srcp += src_stride;
  308|  13.3k|    }
  309|       |
  310|       |    // Update total sum and clear the vectors
  311|  2.49k|    s += mm256_accumulate_epi32(v_acc_sum);
  312|  2.49k|    ss += mm256_accumulate_epi32(v_acc_sqs);
  313|  2.49k|    v_acc_sum = vzero;
  314|  2.49k|    v_acc_sqs = vzero;
  315|  2.49k|  }
  316|       |
  317|       |  // Process the remaining area using C
  318|  2.52k|  srcp = srcp1;
  319|  64.9k|  for (int k = 0; k < height; k++) {
  ------------------
  |  Branch (319:19): [True: 62.4k, False: 2.52k]
  ------------------
  320|   441k|    for (int m = i; m < width; m++) {
  ------------------
  |  Branch (320:21): [True: 378k, False: 62.4k]
  ------------------
  321|   378k|      uint16_t val = srcp[m];
  322|   378k|      s += val;
  323|   378k|      ss += val * val;
  324|   378k|    }
  325|  62.4k|    srcp += src_stride;
  326|  62.4k|  }
  327|  2.52k|  return (ss - s * s / (width * height));
  328|  2.52k|}
sum_squares_avx2.c:aom_sum_squares_2d_i16_nxn_avx2:
   22|   152k|                                                int width, int height) {
   23|   152k|  uint64_t result;
   24|   152k|  __m256i v_acc_q = _mm256_setzero_si256();
   25|   152k|  const __m256i v_zext_mask_q = _mm256_set1_epi64x(~0u);
   26|   939k|  for (int col = 0; col < height; col += 4) {
  ------------------
  |  Branch (26:21): [True: 787k, False: 152k]
  ------------------
   27|   787k|    __m256i v_acc_d = _mm256_setzero_si256();
   28|  2.58M|    for (int row = 0; row < width; row += 16) {
  ------------------
  |  Branch (28:23): [True: 1.79M, False: 787k]
  ------------------
   29|  1.79M|      const int16_t *tempsrc = src + row;
   30|  1.79M|      const __m256i v_val_0_w =
   31|  1.79M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 0 * stride));
   32|  1.79M|      const __m256i v_val_1_w =
   33|  1.79M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 1 * stride));
   34|  1.79M|      const __m256i v_val_2_w =
   35|  1.79M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 2 * stride));
   36|  1.79M|      const __m256i v_val_3_w =
   37|  1.79M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 3 * stride));
   38|       |
   39|  1.79M|      const __m256i v_sq_0_d = _mm256_madd_epi16(v_val_0_w, v_val_0_w);
   40|  1.79M|      const __m256i v_sq_1_d = _mm256_madd_epi16(v_val_1_w, v_val_1_w);
   41|  1.79M|      const __m256i v_sq_2_d = _mm256_madd_epi16(v_val_2_w, v_val_2_w);
   42|  1.79M|      const __m256i v_sq_3_d = _mm256_madd_epi16(v_val_3_w, v_val_3_w);
   43|       |
   44|  1.79M|      const __m256i v_sum_01_d = _mm256_add_epi32(v_sq_0_d, v_sq_1_d);
   45|  1.79M|      const __m256i v_sum_23_d = _mm256_add_epi32(v_sq_2_d, v_sq_3_d);
   46|  1.79M|      const __m256i v_sum_0123_d = _mm256_add_epi32(v_sum_01_d, v_sum_23_d);
   47|       |
   48|  1.79M|      v_acc_d = _mm256_add_epi32(v_acc_d, v_sum_0123_d);
   49|  1.79M|    }
   50|   787k|    v_acc_q =
   51|   787k|        _mm256_add_epi64(v_acc_q, _mm256_and_si256(v_acc_d, v_zext_mask_q));
   52|   787k|    v_acc_q = _mm256_add_epi64(v_acc_q, _mm256_srli_epi64(v_acc_d, 32));
   53|   787k|    src += 4 * stride;
   54|   787k|  }
   55|   152k|  __m128i lower_64_2_Value = _mm256_castsi256_si128(v_acc_q);
   56|   152k|  __m128i higher_64_2_Value = _mm256_extracti128_si256(v_acc_q, 1);
   57|   152k|  __m128i result_64_2_int = _mm_add_epi64(lower_64_2_Value, higher_64_2_Value);
   58|       |
   59|   152k|  result_64_2_int = _mm_add_epi64(
   60|   152k|      result_64_2_int, _mm_unpackhi_epi64(result_64_2_int, result_64_2_int));
   61|       |
   62|   152k|  xx_storel_64(&result, result_64_2_int);
   63|       |
   64|   152k|  return result;
   65|   152k|}
sum_squares_avx2.c:aom_sum_sse_2d_i16_nxn_avx2:
   83|  1.43M|                                            int width, int height, int *sum) {
   84|  1.43M|  uint64_t result;
   85|  1.43M|  const __m256i zero_reg = _mm256_setzero_si256();
   86|  1.43M|  const __m256i one_reg = _mm256_set1_epi16(1);
   87|       |
   88|  1.43M|  __m256i v_sse_total = zero_reg;
   89|  1.43M|  __m256i v_sum_total = zero_reg;
   90|       |
   91|  6.32M|  for (int col = 0; col < height; col += 4) {
  ------------------
  |  Branch (91:21): [True: 4.88M, False: 1.43M]
  ------------------
   92|  4.88M|    __m256i v_sse_row = zero_reg;
   93|  10.5M|    for (int row = 0; row < width; row += 16) {
  ------------------
  |  Branch (93:23): [True: 5.69M, False: 4.88M]
  ------------------
   94|  5.69M|      const int16_t *tempsrc = src + row;
   95|  5.69M|      const __m256i v_val_0_w =
   96|  5.69M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 0 * stride));
   97|  5.69M|      const __m256i v_val_1_w =
   98|  5.69M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 1 * stride));
   99|  5.69M|      const __m256i v_val_2_w =
  100|  5.69M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 2 * stride));
  101|  5.69M|      const __m256i v_val_3_w =
  102|  5.69M|          _mm256_loadu_si256((const __m256i *)(tempsrc + 3 * stride));
  103|       |
  104|  5.69M|      const __m256i v_sum_01 = _mm256_add_epi16(v_val_0_w, v_val_1_w);
  105|  5.69M|      const __m256i v_sum_23 = _mm256_add_epi16(v_val_2_w, v_val_3_w);
  106|  5.69M|      __m256i v_sum_0123 = _mm256_add_epi16(v_sum_01, v_sum_23);
  107|  5.69M|      v_sum_0123 = _mm256_madd_epi16(v_sum_0123, one_reg);
  108|  5.69M|      v_sum_total = _mm256_add_epi32(v_sum_total, v_sum_0123);
  109|       |
  110|  5.69M|      const __m256i v_sq_0_d = _mm256_madd_epi16(v_val_0_w, v_val_0_w);
  111|  5.69M|      const __m256i v_sq_1_d = _mm256_madd_epi16(v_val_1_w, v_val_1_w);
  112|  5.69M|      const __m256i v_sq_2_d = _mm256_madd_epi16(v_val_2_w, v_val_2_w);
  113|  5.69M|      const __m256i v_sq_3_d = _mm256_madd_epi16(v_val_3_w, v_val_3_w);
  114|  5.69M|      const __m256i v_sq_01_d = _mm256_add_epi32(v_sq_0_d, v_sq_1_d);
  115|  5.69M|      const __m256i v_sq_23_d = _mm256_add_epi32(v_sq_2_d, v_sq_3_d);
  116|  5.69M|      const __m256i v_sq_0123_d = _mm256_add_epi32(v_sq_01_d, v_sq_23_d);
  117|  5.69M|      v_sse_row = _mm256_add_epi32(v_sse_row, v_sq_0123_d);
  118|  5.69M|    }
  119|  4.88M|    const __m256i v_sse_row_low = _mm256_unpacklo_epi32(v_sse_row, zero_reg);
  120|  4.88M|    const __m256i v_sse_row_hi = _mm256_unpackhi_epi32(v_sse_row, zero_reg);
  121|  4.88M|    v_sse_row = _mm256_add_epi64(v_sse_row_low, v_sse_row_hi);
  122|  4.88M|    v_sse_total = _mm256_add_epi64(v_sse_total, v_sse_row);
  123|  4.88M|    src += 4 * stride;
  124|  4.88M|  }
  125|       |
  126|  1.43M|  const __m128i v_sum_total_low = _mm256_castsi256_si128(v_sum_total);
  127|  1.43M|  const __m128i v_sum_total_hi = _mm256_extracti128_si256(v_sum_total, 1);
  128|  1.43M|  __m128i sum_128bit = _mm_add_epi32(v_sum_total_hi, v_sum_total_low);
  129|  1.43M|  sum_128bit = _mm_add_epi32(sum_128bit, _mm_srli_si128(sum_128bit, 8));
  130|  1.43M|  sum_128bit = _mm_add_epi32(sum_128bit, _mm_srli_si128(sum_128bit, 4));
  131|  1.43M|  *sum += _mm_cvtsi128_si32(sum_128bit);
  132|       |
  133|  1.43M|  __m128i v_sse_total_lo = _mm256_castsi256_si128(v_sse_total);
  134|  1.43M|  __m128i v_sse_total_hi = _mm256_extracti128_si256(v_sse_total, 1);
  135|  1.43M|  __m128i sse_128bit = _mm_add_epi64(v_sse_total_lo, v_sse_total_hi);
  136|       |
  137|  1.43M|  sse_128bit =
  138|  1.43M|      _mm_add_epi64(sse_128bit, _mm_unpackhi_epi64(sse_128bit, sse_128bit));
  139|       |
  140|  1.43M|  xx_storel_64(&result, sse_128bit);
  141|       |
  142|  1.43M|  return result;
  143|  1.43M|}
sum_squares_avx2.c:mm256_accumulate_epi16:
  161|  42.1k|static inline int32_t mm256_accumulate_epi16(__m256i vec_a) {
  162|  42.1k|  __m128i vtmp1 = _mm256_extracti128_si256(vec_a, 1);
  163|  42.1k|  __m128i vtmp2 = _mm256_castsi256_si128(vec_a);
  164|  42.1k|  vtmp1 = _mm_add_epi16(vtmp1, vtmp2);
  165|  42.1k|  vtmp2 = _mm_srli_si128(vtmp1, 8);
  166|  42.1k|  vtmp1 = _mm_add_epi16(vtmp1, vtmp2);
  167|  42.1k|  vtmp2 = _mm_srli_si128(vtmp1, 4);
  168|  42.1k|  vtmp1 = _mm_add_epi16(vtmp1, vtmp2);
  169|  42.1k|  vtmp2 = _mm_srli_si128(vtmp1, 2);
  170|  42.1k|  vtmp1 = _mm_add_epi16(vtmp1, vtmp2);
  171|       |  return _mm_extract_epi16(vtmp1, 0);
  172|  42.1k|}
sum_squares_avx2.c:mm256_accumulate_epi32:
  175|  49.4k|static inline int32_t mm256_accumulate_epi32(__m256i vec_a) {
  176|  49.4k|  __m128i vtmp1 = _mm256_extracti128_si256(vec_a, 1);
  177|  49.4k|  __m128i vtmp2 = _mm256_castsi256_si128(vec_a);
  178|  49.4k|  vtmp1 = _mm_add_epi32(vtmp1, vtmp2);
  179|  49.4k|  vtmp2 = _mm_srli_si128(vtmp1, 8);
  180|  49.4k|  vtmp1 = _mm_add_epi32(vtmp1, vtmp2);
  181|       |  vtmp2 = _mm_srli_si128(vtmp1, 4);
  182|  49.4k|  vtmp1 = _mm_add_epi32(vtmp1, vtmp2);
  183|  49.4k|  return _mm_cvtsi128_si32(vtmp1);
  184|  49.4k|}

aom_sum_squares_2d_i16_4x4_sse2:
   48|  1.04M|uint64_t aom_sum_squares_2d_i16_4x4_sse2(const int16_t *src, int stride) {
   49|  1.04M|  const __m128i v_sum_0123_d = sum_squares_i16_4x4_sse2(src, stride);
   50|  1.04M|  __m128i v_sum_d =
   51|  1.04M|      _mm_add_epi32(v_sum_0123_d, _mm_srli_epi64(v_sum_0123_d, 32));
   52|       |  v_sum_d = _mm_add_epi32(v_sum_d, _mm_srli_si128(v_sum_d, 8));
   53|  1.04M|  return (uint64_t)_mm_cvtsi128_si32(v_sum_d);
   54|  1.04M|}
aom_sum_sse_2d_i16_4x4_sse2:
   56|  44.7M|uint64_t aom_sum_sse_2d_i16_4x4_sse2(const int16_t *src, int stride, int *sum) {
   57|  44.7M|  const __m128i one_reg = _mm_set1_epi16(1);
   58|  44.7M|  const __m128i v_val_0_w = xx_loadl_64(src + 0 * stride);
   59|  44.7M|  const __m128i v_val_2_w = xx_loadl_64(src + 2 * stride);
   60|  44.7M|  __m128i v_val_01_w = xx_loadh_64(v_val_0_w, src + 1 * stride);
   61|  44.7M|  __m128i v_val_23_w = xx_loadh_64(v_val_2_w, src + 3 * stride);
   62|       |
   63|  44.7M|  __m128i v_sum_0123_d = _mm_add_epi16(v_val_01_w, v_val_23_w);
   64|  44.7M|  v_sum_0123_d = _mm_madd_epi16(v_sum_0123_d, one_reg);
   65|  44.7M|  v_sum_0123_d = _mm_add_epi32(v_sum_0123_d, _mm_srli_si128(v_sum_0123_d, 8));
   66|  44.7M|  v_sum_0123_d = _mm_add_epi32(v_sum_0123_d, _mm_srli_si128(v_sum_0123_d, 4));
   67|  44.7M|  *sum = _mm_cvtsi128_si32(v_sum_0123_d);
   68|       |
   69|  44.7M|  const __m128i v_sq_01_d = _mm_madd_epi16(v_val_01_w, v_val_01_w);
   70|  44.7M|  const __m128i v_sq_23_d = _mm_madd_epi16(v_val_23_w, v_val_23_w);
   71|  44.7M|  __m128i v_sq_0123_d = _mm_add_epi32(v_sq_01_d, v_sq_23_d);
   72|  44.7M|  v_sq_0123_d = _mm_add_epi32(v_sq_0123_d, _mm_srli_si128(v_sq_0123_d, 8));
   73|       |  v_sq_0123_d = _mm_add_epi32(v_sq_0123_d, _mm_srli_si128(v_sq_0123_d, 4));
   74|  44.7M|  return (uint64_t)_mm_cvtsi128_si32(v_sq_0123_d);
   75|  44.7M|}
aom_sum_squares_2d_i16_4xn_sse2:
   78|   166k|                                         int height) {
   79|   166k|  int r = 0;
   80|   166k|  __m128i v_acc_q = _mm_setzero_si128();
   81|   332k|  do {
   82|   332k|    const __m128i v_acc_d = sum_squares_i16_4x4_sse2(src, stride);
   83|   332k|    v_acc_q = _mm_add_epi32(v_acc_q, v_acc_d);
   84|   332k|    src += stride << 2;
   85|   332k|    r += 4;
   86|   332k|  } while (r < height);
  ------------------
  |  Branch (86:12): [True: 166k, False: 166k]
  ------------------
   87|   166k|  const __m128i v_zext_mask_q = _mm_set1_epi64x(~0u);
   88|   166k|  __m128i v_acc_64 = _mm_add_epi64(_mm_srli_epi64(v_acc_q, 32),
   89|   166k|                                   _mm_and_si128(v_acc_q, v_zext_mask_q));
   90|       |  v_acc_64 = _mm_add_epi64(v_acc_64, _mm_srli_si128(v_acc_64, 8));
   91|   166k|  return xx_cvtsi128_si64(v_acc_64);
   92|   166k|}
aom_sum_sse_2d_i16_4xn_sse2:
   95|  6.91M|                                     int *sum) {
   96|  6.91M|  int r = 0;
   97|  6.91M|  uint64_t sse = 0;
   98|  13.8M|  do {
   99|  13.8M|    int curr_sum = 0;
  100|  13.8M|    sse += aom_sum_sse_2d_i16_4x4_sse2(src, stride, &curr_sum);
  101|  13.8M|    *sum += curr_sum;
  102|  13.8M|    src += stride << 2;
  103|  13.8M|    r += 4;
  104|  13.8M|  } while (r < height);
  ------------------
  |  Branch (104:12): [True: 6.94M, False: 6.91M]
  ------------------
  105|  6.91M|  return sse;
  106|  6.91M|}
aom_sum_squares_2d_i16_nxn_sse2:
  116|  4.51M|                                int height) {
  117|  4.51M|  int r = 0;
  118|       |
  119|  4.51M|  const __m128i v_zext_mask_q = _mm_set1_epi64x(~0u);
  120|  4.51M|  __m128i v_acc_q = _mm_setzero_si128();
  121|       |
  122|  9.05M|  do {
  123|  9.05M|    __m128i v_acc_d = _mm_setzero_si128();
  124|  9.05M|    int c = 0;
  125|  9.05M|    do {
  126|  9.05M|      const int16_t *b = src + c;
  127|       |
  128|  9.05M|      const __m128i v_val_0_w = xx_load_128(b + 0 * stride);
  129|  9.05M|      const __m128i v_val_1_w = xx_load_128(b + 1 * stride);
  130|  9.05M|      const __m128i v_val_2_w = xx_load_128(b + 2 * stride);
  131|  9.05M|      const __m128i v_val_3_w = xx_load_128(b + 3 * stride);
  132|       |
  133|  9.05M|      const __m128i v_sq_0_d = _mm_madd_epi16(v_val_0_w, v_val_0_w);
  134|  9.05M|      const __m128i v_sq_1_d = _mm_madd_epi16(v_val_1_w, v_val_1_w);
  135|  9.05M|      const __m128i v_sq_2_d = _mm_madd_epi16(v_val_2_w, v_val_2_w);
  136|  9.05M|      const __m128i v_sq_3_d = _mm_madd_epi16(v_val_3_w, v_val_3_w);
  137|       |
  138|  9.05M|      const __m128i v_sum_01_d = _mm_add_epi32(v_sq_0_d, v_sq_1_d);
  139|  9.05M|      const __m128i v_sum_23_d = _mm_add_epi32(v_sq_2_d, v_sq_3_d);
  140|       |
  141|  9.05M|      const __m128i v_sum_0123_d = _mm_add_epi32(v_sum_01_d, v_sum_23_d);
  142|       |
  143|  9.05M|      v_acc_d = _mm_add_epi32(v_acc_d, v_sum_0123_d);
  144|  9.05M|      c += 8;
  145|  9.05M|    } while (c < width);
  ------------------
  |  Branch (145:14): [True: 0, False: 9.05M]
  ------------------
  146|       |
  147|  9.05M|    v_acc_q = _mm_add_epi64(v_acc_q, _mm_and_si128(v_acc_d, v_zext_mask_q));
  148|  9.05M|    v_acc_q = _mm_add_epi64(v_acc_q, _mm_srli_epi64(v_acc_d, 32));
  149|       |
  150|  9.05M|    src += 4 * stride;
  151|  9.05M|    r += 4;
  152|  9.05M|  } while (r < height);
  ------------------
  |  Branch (152:12): [True: 4.54M, False: 4.51M]
  ------------------
  153|       |
  154|       |  v_acc_q = _mm_add_epi64(v_acc_q, _mm_srli_si128(v_acc_q, 8));
  155|  4.51M|  return xx_cvtsi128_si64(v_acc_q);
  156|  4.51M|}
aom_sum_sse_2d_i16_nxn_sse2:
  166|  23.6M|                            int height, int *sum) {
  167|  23.6M|  int r = 0;
  168|  23.6M|  uint64_t result;
  169|  23.6M|  const __m128i zero_reg = _mm_setzero_si128();
  170|  23.6M|  const __m128i one_reg = _mm_set1_epi16(1);
  171|       |
  172|  23.6M|  __m128i v_sse_total = zero_reg;
  173|  23.6M|  __m128i v_sum_total = zero_reg;
  174|       |
  175|  47.3M|  do {
  176|  47.3M|    int c = 0;
  177|  47.3M|    __m128i v_sse_row = zero_reg;
  178|  47.3M|    do {
  179|  47.3M|      const int16_t *b = src + c;
  180|       |
  181|  47.3M|      __m128i v_val_0_w = xx_load_128(b + 0 * stride);
  182|  47.3M|      __m128i v_val_1_w = xx_load_128(b + 1 * stride);
  183|  47.3M|      __m128i v_val_2_w = xx_load_128(b + 2 * stride);
  184|  47.3M|      __m128i v_val_3_w = xx_load_128(b + 3 * stride);
  185|       |
  186|  47.3M|      const __m128i v_sq_0_d = _mm_madd_epi16(v_val_0_w, v_val_0_w);
  187|  47.3M|      const __m128i v_sq_1_d = _mm_madd_epi16(v_val_1_w, v_val_1_w);
  188|  47.3M|      const __m128i v_sq_2_d = _mm_madd_epi16(v_val_2_w, v_val_2_w);
  189|  47.3M|      const __m128i v_sq_3_d = _mm_madd_epi16(v_val_3_w, v_val_3_w);
  190|  47.3M|      const __m128i v_sq_01_d = _mm_add_epi32(v_sq_0_d, v_sq_1_d);
  191|  47.3M|      const __m128i v_sq_23_d = _mm_add_epi32(v_sq_2_d, v_sq_3_d);
  192|  47.3M|      const __m128i v_sq_0123_d = _mm_add_epi32(v_sq_01_d, v_sq_23_d);
  193|  47.3M|      v_sse_row = _mm_add_epi32(v_sse_row, v_sq_0123_d);
  194|       |
  195|  47.3M|      const __m128i v_sum_01 = _mm_add_epi16(v_val_0_w, v_val_1_w);
  196|  47.3M|      const __m128i v_sum_23 = _mm_add_epi16(v_val_2_w, v_val_3_w);
  197|  47.3M|      __m128i v_sum_0123_d = _mm_add_epi16(v_sum_01, v_sum_23);
  198|  47.3M|      v_sum_0123_d = _mm_madd_epi16(v_sum_0123_d, one_reg);
  199|  47.3M|      v_sum_total = _mm_add_epi32(v_sum_total, v_sum_0123_d);
  200|       |
  201|  47.3M|      c += 8;
  202|  47.3M|    } while (c < width);
  ------------------
  |  Branch (202:14): [True: 0, False: 47.3M]
  ------------------
  203|       |
  204|  47.3M|    const __m128i v_sse_row_low = _mm_unpacklo_epi32(v_sse_row, zero_reg);
  205|  47.3M|    const __m128i v_sse_row_hi = _mm_unpackhi_epi32(v_sse_row, zero_reg);
  206|  47.3M|    v_sse_row = _mm_add_epi64(v_sse_row_low, v_sse_row_hi);
  207|  47.3M|    v_sse_total = _mm_add_epi64(v_sse_total, v_sse_row);
  208|  47.3M|    src += 4 * stride;
  209|  47.3M|    r += 4;
  210|  47.3M|  } while (r < height);
  ------------------
  |  Branch (210:12): [True: 23.6M, False: 23.6M]
  ------------------
  211|       |
  212|  23.6M|  v_sum_total = _mm_add_epi32(v_sum_total, _mm_srli_si128(v_sum_total, 8));
  213|  23.6M|  v_sum_total = _mm_add_epi32(v_sum_total, _mm_srli_si128(v_sum_total, 4));
  214|  23.6M|  *sum += _mm_cvtsi128_si32(v_sum_total);
  215|       |
  216|       |  v_sse_total = _mm_add_epi64(v_sse_total, _mm_srli_si128(v_sse_total, 8));
  217|  23.6M|  xx_storel_64(&result, v_sse_total);
  218|  23.6M|  return result;
  219|  23.6M|}
sum_squares_sse2.c:sum_squares_i16_4x4_sse2:
   37|  1.38M|static inline __m128i sum_squares_i16_4x4_sse2(const int16_t *src, int stride) {
   38|  1.38M|  const __m128i v_val_0_w = xx_loadl_64(src + 0 * stride);
   39|  1.38M|  const __m128i v_val_2_w = xx_loadl_64(src + 2 * stride);
   40|  1.38M|  const __m128i v_val_01_w = xx_loadh_64(v_val_0_w, src + 1 * stride);
   41|  1.38M|  const __m128i v_val_23_w = xx_loadh_64(v_val_2_w, src + 3 * stride);
   42|  1.38M|  const __m128i v_sq_01_d = _mm_madd_epi16(v_val_01_w, v_val_01_w);
   43|  1.38M|  const __m128i v_sq_23_d = _mm_madd_epi16(v_val_23_w, v_val_23_w);
   44|       |
   45|  1.38M|  return _mm_add_epi32(v_sq_01_d, v_sq_23_d);
   46|  1.38M|}
sum_squares_sse2.c:xx_loadh_64:
   20|  92.3M|static inline __m128i xx_loadh_64(__m128i a, const void *b) {
   21|  92.3M|  const __m128d ad = _mm_castsi128_pd(a);
   22|  92.3M|  return _mm_castpd_si128(_mm_loadh_pd(ad, (double *)b));
   23|  92.3M|}
sum_squares_sse2.c:xx_cvtsi128_si64:
   25|  4.68M|static inline uint64_t xx_cvtsi128_si64(__m128i a) {
   26|  4.68M|#if AOM_ARCH_X86_64
   27|  4.68M|  return (uint64_t)_mm_cvtsi128_si64(a);
   28|       |#else
   29|       |  {
   30|       |    uint64_t tmp;
   31|       |    _mm_storel_epi64((__m128i *)&tmp, a);
   32|       |    return tmp;
   33|       |  }
   34|       |#endif
   35|  4.68M|}

loopfilter_sse2.c:xx_loadl_32:
   31|  13.1M|static inline __m128i xx_loadl_32(const void *a) {
   32|  13.1M|  int val;
   33|  13.1M|  memcpy(&val, a, sizeof(val));
   34|  13.1M|  return _mm_cvtsi32_si128(val);
   35|  13.1M|}
loopfilter_sse2.c:xx_storel_32:
   62|  28.3M|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|  28.3M|  const int val = _mm_cvtsi128_si32(v);
   64|  28.3M|  memcpy(a, &val, sizeof(val));
   65|  28.3M|}
avg_intrin_sse2.c:xx_loadl_32:
   31|  1.67M|static inline __m128i xx_loadl_32(const void *a) {
   32|  1.67M|  int val;
   33|  1.67M|  memcpy(&val, a, sizeof(val));
   34|  1.67M|  return _mm_cvtsi32_si128(val);
   35|  1.67M|}
sum_squares_sse2.c:xx_loadl_64:
   37|  92.2M|static inline __m128i xx_loadl_64(const void *a) {
   38|  92.2M|  return _mm_loadl_epi64((const __m128i *)a);
   39|  92.2M|}
sum_squares_sse2.c:xx_load_128:
   41|   225M|static inline __m128i xx_load_128(const void *a) {
   42|   225M|  return _mm_load_si128((const __m128i *)a);
   43|   225M|}
sum_squares_sse2.c:xx_storel_64:
   67|  23.7M|static inline void xx_storel_64(void *const a, const __m128i v) {
   68|  23.7M|  _mm_storel_epi64((__m128i *)a, v);
   69|  23.7M|}
highbd_convolve_avx2.c:xx_storel_32:
   62|  8.25k|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|  8.25k|  const int val = _mm_cvtsi128_si32(v);
   64|  8.25k|  memcpy(a, &val, sizeof(val));
   65|  8.25k|}
disflow_avx2.c:xx_loadu_2x64:
   52|   343k|static inline __m128i xx_loadu_2x64(const void *hi, const void *lo) {
   53|   343k|  return _mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i *)lo),
   54|   343k|                            _mm_loadl_epi64((const __m128i *)hi));
   55|   343k|}
sse_avx2.c:xx_loadl_32:
   31|  11.0M|static inline __m128i xx_loadl_32(const void *a) {
   32|  11.0M|  int val;
   33|  11.0M|  memcpy(&val, a, sizeof(val));
   34|  11.0M|  return _mm_cvtsi32_si128(val);
   35|  11.0M|}
sse_avx2.c:xx_storel_64:
   67|  3.58M|static inline void xx_storel_64(void *const a, const __m128i v) {
   68|  3.58M|  _mm_storel_epi64((__m128i *)a, v);
   69|  3.58M|}
sse_avx2.c:xx_loadl_64:
   37|  24.0M|static inline __m128i xx_loadl_64(const void *a) {
   38|  24.0M|  return _mm_loadl_epi64((const __m128i *)a);
   39|  24.0M|}
sse_avx2.c:xx_loadu_128:
   45|  40.1M|static inline __m128i xx_loadu_128(const void *a) {
   46|  40.1M|  return _mm_loadu_si128((const __m128i *)a);
   47|  40.1M|}
sum_squares_avx2.c:xx_storel_64:
   67|  1.59M|static inline void xx_storel_64(void *const a, const __m128i v) {
   68|  1.59M|  _mm_storel_epi64((__m128i *)a, v);
   69|  1.59M|}
highbd_variance_avx2.c:xx_storel_64:
   67|  1.26M|static inline void xx_storel_64(void *const a, const __m128i v) {
   68|  1.26M|  _mm_storel_epi64((__m128i *)a, v);
   69|  1.26M|}
filterintra_sse4.c:xx_load_128:
   41|  66.5M|static inline __m128i xx_load_128(const void *a) {
   42|  66.5M|  return _mm_load_si128((const __m128i *)a);
   43|  66.5M|}
filterintra_sse4.c:xx_loadl_64:
   37|  11.2M|static inline __m128i xx_loadl_64(const void *a) {
   38|  11.2M|  return _mm_loadl_epi64((const __m128i *)a);
   39|  11.2M|}
filterintra_sse4.c:xx_loadl_32:
   31|   144M|static inline __m128i xx_loadl_32(const void *a) {
   32|   144M|  int val;
   33|   144M|  memcpy(&val, a, sizeof(val));
   34|   144M|  return _mm_cvtsi32_si128(val);
   35|   144M|}
filterintra_sse4.c:xx_roundn_epi16_unsigned:
  104|   252M|static inline __m128i xx_roundn_epi16_unsigned(__m128i v_val_d, int bits) {
  105|   252M|  const __m128i v_bias_d = _mm_set1_epi16((1 << bits) >> 1);
  106|   252M|  const __m128i v_tmp_d = _mm_add_epi16(v_val_d, v_bias_d);
  107|   252M|  return _mm_srai_epi16(v_tmp_d, bits);
  108|   252M|}
filterintra_sse4.c:xx_storel_32:
   62|   252M|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|   252M|  const int val = _mm_cvtsi128_si32(v);
   64|   252M|  memcpy(a, &val, sizeof(val));
   65|   252M|}
convolve_2d_avx2.c:xx_storel_32:
   62|  2.83M|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|  2.83M|  const int val = _mm_cvtsi128_si32(v);
   64|  2.83M|  memcpy(a, &val, sizeof(val));
   65|  2.83M|}
convolve_avx2.c:xx_storel_32:
   62|   277k|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|   277k|  const int val = _mm_cvtsi128_si32(v);
   64|   277k|  memcpy(a, &val, sizeof(val));
   65|   277k|}
resize_avx2.c:xx_storel_32:
   62|  40.3k|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|  40.3k|  const int val = _mm_cvtsi128_si32(v);
   64|  40.3k|  memcpy(a, &val, sizeof(val));
   65|  40.3k|}
selfguided_avx2.c:xx_loadl_64:
   37|  2.36M|static inline __m128i xx_loadl_64(const void *a) {
   38|  2.36M|  return _mm_loadl_epi64((const __m128i *)a);
   39|  2.36M|}
selfguided_avx2.c:xx_loadu_128:
   45|  4.26M|static inline __m128i xx_loadu_128(const void *a) {
   46|  4.26M|  return _mm_loadu_si128((const __m128i *)a);
   47|  4.26M|}
selfguided_avx2.c:xx_storeu_128:
   75|   197k|static inline void xx_storeu_128(void *const a, const __m128i v) {
   76|   197k|  _mm_storeu_si128((__m128i *)a, v);
   77|   197k|}
wiener_convolve_avx2.c:xx_loadu_128:
   45|  12.2k|static inline __m128i xx_loadu_128(const void *a) {
   46|  12.2k|  return _mm_loadu_si128((const __m128i *)a);
   47|  12.2k|}
highbd_convolve_2d_avx2.c:xx_storel_32:
   62|  5.15k|static inline void xx_storel_32(void *const a, const __m128i v) {
   63|  5.15k|  const int val = _mm_cvtsi128_si32(v);
   64|  5.15k|  memcpy(a, &val, sizeof(val));
   65|  5.15k|}
highbd_wiener_convolve_avx2.c:xx_loadu_128:
   45|  5.53k|static inline __m128i xx_loadu_128(const void *a) {
   46|  5.53k|  return _mm_loadu_si128((const __m128i *)a);
   47|  5.53k|}
encodetxb_avx2.c:xx_storel_64:
   67|   441M|static inline void xx_storel_64(void *const a, const __m128i v) {
   68|   441M|  _mm_storel_epi64((__m128i *)a, v);
   69|   441M|}
encodetxb_avx2.c:xx_storeu_128:
   75|  42.5M|static inline void xx_storeu_128(void *const a, const __m128i v) {
   76|  42.5M|  _mm_storeu_si128((__m128i *)a, v);
   77|  42.5M|}
pickrst_avx2.c:xx_loadu_128:
   45|  29.4M|static inline __m128i xx_loadu_128(const void *a) {
   46|  29.4M|  return _mm_loadu_si128((const __m128i *)a);
   47|  29.4M|}
pickrst_avx2.c:xx_storeu_128:
   75|  1.69k|static inline void xx_storeu_128(void *const a, const __m128i v) {
   76|  1.69k|  _mm_storeu_si128((__m128i *)a, v);
   77|  1.69k|}

disflow_avx2.c:yy_loadu2_128:
   79|   638k|static inline __m256i yy_loadu2_128(const void *hi, const void *lo) {
   80|   638k|  __m128i mhi = _mm_loadu_si128((const __m128i *)(hi));
   81|   638k|  __m128i mlo = _mm_loadu_si128((const __m128i *)(lo));
   82|   638k|  return yy_set_m128i(mhi, mlo);
   83|   638k|}
disflow_avx2.c:yy_set_m128i:
   59|   638k|static inline __m256i yy_set_m128i(__m128i hi, __m128i lo) {
   60|       |  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   61|   638k|}
avg_intrin_avx2.c:yy_loadu2_128:
   79|  3.58M|static inline __m256i yy_loadu2_128(const void *hi, const void *lo) {
   80|  3.58M|  __m128i mhi = _mm_loadu_si128((const __m128i *)(hi));
   81|  3.58M|  __m128i mlo = _mm_loadu_si128((const __m128i *)(lo));
   82|  3.58M|  return yy_set_m128i(mhi, mlo);
   83|  3.58M|}
avg_intrin_avx2.c:yy_set_m128i:
   59|  3.58M|static inline __m256i yy_set_m128i(__m128i hi, __m128i lo) {
   60|       |  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   61|  3.58M|}
sad4d_avx2.c:yy_loadu2_128:
   79|   134M|static inline __m256i yy_loadu2_128(const void *hi, const void *lo) {
   80|   134M|  __m128i mhi = _mm_loadu_si128((const __m128i *)(hi));
   81|   134M|  __m128i mlo = _mm_loadu_si128((const __m128i *)(lo));
   82|   134M|  return yy_set_m128i(mhi, mlo);
   83|   134M|}
sad4d_avx2.c:yy_set_m128i:
   59|   134M|static inline __m256i yy_set_m128i(__m128i hi, __m128i lo) {
   60|       |  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   61|   134M|}
sse_avx2.c:yy_loadu_256:
   34|  26.4M|static inline __m256i yy_loadu_256(const void *a) {
   35|  26.4M|  return _mm256_loadu_si256((const __m256i *)a);
   36|  26.4M|}
sse_avx2.c:yy_set_m128i:
   59|  1.20M|static inline __m256i yy_set_m128i(__m128i hi, __m128i lo) {
   60|       |  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   61|  1.20M|}
sse_avx2.c:yy_loadu2_128:
   79|  1.12M|static inline __m256i yy_loadu2_128(const void *hi, const void *lo) {
   80|  1.12M|  __m128i mhi = _mm_loadu_si128((const __m128i *)(hi));
   81|  1.12M|  __m128i mlo = _mm_loadu_si128((const __m128i *)(lo));
   82|  1.12M|  return yy_set_m128i(mhi, mlo);
   83|  1.12M|}
selfguided_avx2.c:yy_load_256:
   30|  5.17M|static inline __m256i yy_load_256(const void *a) {
   31|  5.17M|  return _mm256_load_si256((const __m256i *)a);
   32|  5.17M|}
selfguided_avx2.c:yy_store_256:
   38|  5.17M|static inline void yy_store_256(void *const a, const __m256i v) {
   39|  5.17M|  _mm256_store_si256((__m256i *)a, v);
   40|  5.17M|}
selfguided_avx2.c:yy_loadu_256:
   34|  79.6M|static inline __m256i yy_loadu_256(const void *a) {
   35|  79.6M|  return _mm256_loadu_si256((const __m256i *)a);
   36|  79.6M|}
selfguided_avx2.c:yy_storeu_256:
   42|  10.6M|static inline void yy_storeu_256(void *const a, const __m256i v) {
   43|  10.6M|  _mm256_storeu_si256((__m256i *)a, v);
   44|  10.6M|}
highbd_wiener_convolve_avx2.c:yy_set_m128i:
   59|  22.1k|static inline __m256i yy_set_m128i(__m128i hi, __m128i lo) {
   60|       |  return _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   61|  22.1k|}
highbd_wiener_convolve_avx2.c:yy_loadu_256:
   34|  1.66M|static inline __m256i yy_loadu_256(const void *a) {
   35|  1.66M|  return _mm256_loadu_si256((const __m256i *)a);
   36|  1.66M|}
highbd_wiener_convolve_avx2.c:yy_storeu_256:
   42|   208k|static inline void yy_storeu_256(void *const a, const __m256i v) {
   43|   208k|  _mm256_storeu_si256((__m256i *)a, v);
   44|   208k|}
encodetxb_avx2.c:yy_storeu_256:
   42|   267M|static inline void yy_storeu_256(void *const a, const __m256i v) {
   43|   267M|  _mm256_storeu_si256((__m256i *)a, v);
   44|   267M|}
encodetxb_avx2.c:yy_loadu_256:
   34|   695M|static inline __m256i yy_loadu_256(const void *a) {
   35|   695M|  return _mm256_loadu_si256((const __m256i *)a);
   36|   695M|}
rdopt_avx2.c:yy_storeu_256:
   42|  4.09M|static inline void yy_storeu_256(void *const a, const __m256i v) {
   43|  4.09M|  _mm256_storeu_si256((__m256i *)a, v);
   44|  4.09M|}
pickrst_avx2.c:yy_load_256:
   30|  92.0M|static inline __m256i yy_load_256(const void *a) {
   31|  92.0M|  return _mm256_load_si256((const __m256i *)a);
   32|  92.0M|}
pickrst_avx2.c:yy_store_256:
   38|  92.0M|static inline void yy_store_256(void *const a, const __m256i v) {
   39|  92.0M|  _mm256_store_si256((__m256i *)a, v);
   40|  92.0M|}
pickrst_avx2.c:yy_loadu_256:
   34|  61.0M|static inline __m256i yy_loadu_256(const void *a) {
   35|  61.0M|  return _mm256_loadu_si256((const __m256i *)a);
   36|  61.0M|}
pickrst_avx2.c:yy_storeu_256:
   42|  67.4k|static inline void yy_storeu_256(void *const a, const __m256i v) {
   43|  67.4k|  _mm256_storeu_si256((__m256i *)a, v);
   44|  67.4k|}

aom_subpixel_8t_intrin_ssse3.c:transpose_16bit_4x8:
  125|   257k|                                       __m128i *const out) {
  126|       |  // Unpack 16 bit elements. Goes from:
  127|       |  // in[0]: 00 01 02 03  XX XX XX XX
  128|       |  // in[1]: 10 11 12 13  XX XX XX XX
  129|       |  // in[2]: 20 21 22 23  XX XX XX XX
  130|       |  // in[3]: 30 31 32 33  XX XX XX XX
  131|       |  // in[4]: 40 41 42 43  XX XX XX XX
  132|       |  // in[5]: 50 51 52 53  XX XX XX XX
  133|       |  // in[6]: 60 61 62 63  XX XX XX XX
  134|       |  // in[7]: 70 71 72 73  XX XX XX XX
  135|       |  // to:
  136|       |  // a0:    00 10 01 11  02 12 03 13
  137|       |  // a1:    20 30 21 31  22 32 23 33
  138|       |  // a2:    40 50 41 51  42 52 43 53
  139|       |  // a3:    60 70 61 71  62 72 63 73
  140|   257k|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  141|   257k|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  142|   257k|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  143|   257k|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  144|       |
  145|       |  // Unpack 32 bit elements resulting in:
  146|       |  // b0: 00 10 20 30  01 11 21 31
  147|       |  // b1: 40 50 60 70  41 51 61 71
  148|       |  // b2: 02 12 22 32  03 13 23 33
  149|       |  // b3: 42 52 62 72  43 53 63 73
  150|   257k|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  151|   257k|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  152|   257k|  const __m128i b2 = _mm_unpackhi_epi32(a0, a1);
  153|   257k|  const __m128i b3 = _mm_unpackhi_epi32(a2, a3);
  154|       |
  155|       |  // Unpack 64 bit elements resulting in:
  156|       |  // out[0]: 00 10 20 30  40 50 60 70
  157|       |  // out[1]: 01 11 21 31  41 51 61 71
  158|       |  // out[2]: 02 12 22 32  42 52 62 72
  159|       |  // out[3]: 03 13 23 33  43 53 63 73
  160|   257k|  out[0] = _mm_unpacklo_epi64(b0, b1);
  161|   257k|  out[1] = _mm_unpackhi_epi64(b0, b1);
  162|   257k|  out[2] = _mm_unpacklo_epi64(b2, b3);
  163|   257k|  out[3] = _mm_unpackhi_epi64(b2, b3);
  164|   257k|}
aom_subpixel_8t_intrin_ssse3.c:transpose_8bit_8x8:
   37|  57.7k|                                      __m128i *const out) {
   38|       |  // Unpack 8 bit elements. Goes from:
   39|       |  // in[0]: 00 01 02 03 04 05 06 07
   40|       |  // in[1]: 10 11 12 13 14 15 16 17
   41|       |  // in[2]: 20 21 22 23 24 25 26 27
   42|       |  // in[3]: 30 31 32 33 34 35 36 37
   43|       |  // in[4]: 40 41 42 43 44 45 46 47
   44|       |  // in[5]: 50 51 52 53 54 55 56 57
   45|       |  // in[6]: 60 61 62 63 64 65 66 67
   46|       |  // in[7]: 70 71 72 73 74 75 76 77
   47|       |  // to:
   48|       |  // a0:    00 10 01 11 02 12 03 13  04 14 05 15 06 16 07 17
   49|       |  // a1:    20 30 21 31 22 32 23 33  24 34 25 35 26 36 27 37
   50|       |  // a2:    40 50 41 51 42 52 43 53  44 54 45 55 46 56 47 57
   51|       |  // a3:    60 70 61 71 62 72 63 73  64 74 65 75 66 76 67 77
   52|  57.7k|  const __m128i a0 = _mm_unpacklo_epi8(in[0], in[1]);
   53|  57.7k|  const __m128i a1 = _mm_unpacklo_epi8(in[2], in[3]);
   54|  57.7k|  const __m128i a2 = _mm_unpacklo_epi8(in[4], in[5]);
   55|  57.7k|  const __m128i a3 = _mm_unpacklo_epi8(in[6], in[7]);
   56|       |
   57|       |  // Unpack 16 bit elements resulting in:
   58|       |  // b0: 00 10 20 30 01 11 21 31  02 12 22 32 03 13 23 33
   59|       |  // b1: 40 50 60 70 41 51 61 71  42 52 62 72 43 53 63 73
   60|       |  // b2: 04 14 24 34 05 15 25 35  06 16 26 36 07 17 27 37
   61|       |  // b3: 44 54 64 74 45 55 65 75  46 56 66 76 47 57 67 77
   62|  57.7k|  const __m128i b0 = _mm_unpacklo_epi16(a0, a1);
   63|  57.7k|  const __m128i b1 = _mm_unpackhi_epi16(a0, a1);
   64|  57.7k|  const __m128i b2 = _mm_unpacklo_epi16(a2, a3);
   65|  57.7k|  const __m128i b3 = _mm_unpackhi_epi16(a2, a3);
   66|       |
   67|       |  // Unpack 32 bit elements resulting in:
   68|       |  // c0: 00 10 20 30 40 50 60 70  01 11 21 31 41 51 61 71
   69|       |  // c1: 02 12 22 32 42 52 62 72  03 13 23 33 43 53 63 73
   70|       |  // c2: 04 14 24 34 44 54 64 74  05 15 25 35 45 55 65 75
   71|       |  // c3: 06 16 26 36 46 56 66 76  07 17 27 37 47 57 67 77
   72|  57.7k|  const __m128i c0 = _mm_unpacklo_epi32(b0, b2);
   73|  57.7k|  const __m128i c1 = _mm_unpackhi_epi32(b0, b2);
   74|  57.7k|  const __m128i c2 = _mm_unpacklo_epi32(b1, b3);
   75|  57.7k|  const __m128i c3 = _mm_unpackhi_epi32(b1, b3);
   76|       |
   77|       |  // Unpack 64 bit elements resulting in:
   78|       |  // out[0]: 00 10 20 30 40 50 60 70
   79|       |  // out[1]: 01 11 21 31 41 51 61 71
   80|       |  // out[2]: 02 12 22 32 42 52 62 72
   81|       |  // out[3]: 03 13 23 33 43 53 63 73
   82|       |  // out[4]: 04 14 24 34 44 54 64 74
   83|       |  // out[5]: 05 15 25 35 45 55 65 75
   84|       |  // out[6]: 06 16 26 36 46 56 66 76
   85|       |  // out[7]: 07 17 27 37 47 57 67 77
   86|  57.7k|  out[0] = _mm_unpacklo_epi64(c0, c0);
   87|  57.7k|  out[1] = _mm_unpackhi_epi64(c0, c0);
   88|  57.7k|  out[2] = _mm_unpacklo_epi64(c1, c1);
   89|  57.7k|  out[3] = _mm_unpackhi_epi64(c1, c1);
   90|  57.7k|  out[4] = _mm_unpacklo_epi64(c2, c2);
   91|  57.7k|  out[5] = _mm_unpackhi_epi64(c2, c2);
   92|  57.7k|  out[6] = _mm_unpacklo_epi64(c3, c3);
   93|  57.7k|  out[7] = _mm_unpackhi_epi64(c3, c3);
   94|  57.7k|}
av1_inv_txfm_ssse3.c:transpose_16bit_8x8:
  215|  3.41M|                                       __m128i *const out) {
  216|       |  // Unpack 16 bit elements. Goes from:
  217|       |  // in[0]: 00 01 02 03  04 05 06 07
  218|       |  // in[1]: 10 11 12 13  14 15 16 17
  219|       |  // in[2]: 20 21 22 23  24 25 26 27
  220|       |  // in[3]: 30 31 32 33  34 35 36 37
  221|       |  // in[4]: 40 41 42 43  44 45 46 47
  222|       |  // in[5]: 50 51 52 53  54 55 56 57
  223|       |  // in[6]: 60 61 62 63  64 65 66 67
  224|       |  // in[7]: 70 71 72 73  74 75 76 77
  225|       |  // to:
  226|       |  // a0:    00 10 01 11  02 12 03 13
  227|       |  // a1:    20 30 21 31  22 32 23 33
  228|       |  // a2:    40 50 41 51  42 52 43 53
  229|       |  // a3:    60 70 61 71  62 72 63 73
  230|       |  // a4:    04 14 05 15  06 16 07 17
  231|       |  // a5:    24 34 25 35  26 36 27 37
  232|       |  // a6:    44 54 45 55  46 56 47 57
  233|       |  // a7:    64 74 65 75  66 76 67 77
  234|  3.41M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  235|  3.41M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  236|  3.41M|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  237|  3.41M|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  238|  3.41M|  const __m128i a4 = _mm_unpackhi_epi16(in[0], in[1]);
  239|  3.41M|  const __m128i a5 = _mm_unpackhi_epi16(in[2], in[3]);
  240|  3.41M|  const __m128i a6 = _mm_unpackhi_epi16(in[4], in[5]);
  241|  3.41M|  const __m128i a7 = _mm_unpackhi_epi16(in[6], in[7]);
  242|       |
  243|       |  // Unpack 32 bit elements resulting in:
  244|       |  // b0: 00 10 20 30  01 11 21 31
  245|       |  // b1: 40 50 60 70  41 51 61 71
  246|       |  // b2: 04 14 24 34  05 15 25 35
  247|       |  // b3: 44 54 64 74  45 55 65 75
  248|       |  // b4: 02 12 22 32  03 13 23 33
  249|       |  // b5: 42 52 62 72  43 53 63 73
  250|       |  // b6: 06 16 26 36  07 17 27 37
  251|       |  // b7: 46 56 66 76  47 57 67 77
  252|  3.41M|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  253|  3.41M|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  254|  3.41M|  const __m128i b2 = _mm_unpacklo_epi32(a4, a5);
  255|  3.41M|  const __m128i b3 = _mm_unpacklo_epi32(a6, a7);
  256|  3.41M|  const __m128i b4 = _mm_unpackhi_epi32(a0, a1);
  257|  3.41M|  const __m128i b5 = _mm_unpackhi_epi32(a2, a3);
  258|  3.41M|  const __m128i b6 = _mm_unpackhi_epi32(a4, a5);
  259|  3.41M|  const __m128i b7 = _mm_unpackhi_epi32(a6, a7);
  260|       |
  261|       |  // Unpack 64 bit elements resulting in:
  262|       |  // out[0]: 00 10 20 30  40 50 60 70
  263|       |  // out[1]: 01 11 21 31  41 51 61 71
  264|       |  // out[2]: 02 12 22 32  42 52 62 72
  265|       |  // out[3]: 03 13 23 33  43 53 63 73
  266|       |  // out[4]: 04 14 24 34  44 54 64 74
  267|       |  // out[5]: 05 15 25 35  45 55 65 75
  268|       |  // out[6]: 06 16 26 36  46 56 66 76
  269|       |  // out[7]: 07 17 27 37  47 57 67 77
  270|  3.41M|  out[0] = _mm_unpacklo_epi64(b0, b1);
  271|  3.41M|  out[1] = _mm_unpackhi_epi64(b0, b1);
  272|  3.41M|  out[2] = _mm_unpacklo_epi64(b4, b5);
  273|  3.41M|  out[3] = _mm_unpackhi_epi64(b4, b5);
  274|  3.41M|  out[4] = _mm_unpacklo_epi64(b2, b3);
  275|  3.41M|  out[5] = _mm_unpackhi_epi64(b2, b3);
  276|  3.41M|  out[6] = _mm_unpacklo_epi64(b6, b7);
  277|  3.41M|  out[7] = _mm_unpackhi_epi64(b6, b7);
  278|  3.41M|}
av1_inv_txfm_ssse3.c:transpose_16bit_4x4:
   97|  27.7M|                                       __m128i *const out) {
   98|       |  // Unpack 16 bit elements. Goes from:
   99|       |  // in[0]: 00 01 02 03  XX XX XX XX
  100|       |  // in[1]: 10 11 12 13  XX XX XX XX
  101|       |  // in[2]: 20 21 22 23  XX XX XX XX
  102|       |  // in[3]: 30 31 32 33  XX XX XX XX
  103|       |  // to:
  104|       |  // a0:    00 10 01 11  02 12 03 13
  105|       |  // a1:    20 30 21 31  22 32 23 33
  106|  27.7M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  107|  27.7M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  108|       |
  109|       |  // Unpack 32 bit elements resulting in:
  110|       |  // out[0]: 00 10 20 30  01 11 21 31
  111|       |  // out[1]: 01 11 21 31  __ __ __ __
  112|       |  // out[2]: 02 12 22 32  03 13 23 33
  113|       |  // out[3]: 03 13 23 33  __ __ __ __
  114|       |  //
  115|       |  // Note: The high 64 bits of the output registers are shown for informational
  116|       |  // purposes only. Callers should only use the low 64 bits of the output
  117|       |  // registers. "__" indicates zeros.
  118|  27.7M|  out[0] = _mm_unpacklo_epi32(a0, a1);
  119|  27.7M|  out[1] = _mm_srli_si128(out[0], 8);
  120|  27.7M|  out[2] = _mm_unpackhi_epi32(a0, a1);
  121|       |  out[3] = _mm_srli_si128(out[2], 8);
  122|  27.7M|}
av1_inv_txfm_ssse3.c:transpose_16bit_8x4:
  167|  4.72M|                                       __m128i *const out) {
  168|       |  // Unpack 16 bit elements. Goes from:
  169|       |  // in[0]: 00 01 02 03  04 05 06 07
  170|       |  // in[1]: 10 11 12 13  14 15 16 17
  171|       |  // in[2]: 20 21 22 23  24 25 26 27
  172|       |  // in[3]: 30 31 32 33  34 35 36 37
  173|       |
  174|       |  // to:
  175|       |  // a0:    00 10 01 11  02 12 03 13
  176|       |  // a1:    20 30 21 31  22 32 23 33
  177|       |  // a4:    04 14 05 15  06 16 07 17
  178|       |  // a5:    24 34 25 35  26 36 27 37
  179|  4.72M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  180|  4.72M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  181|  4.72M|  const __m128i a4 = _mm_unpackhi_epi16(in[0], in[1]);
  182|  4.72M|  const __m128i a5 = _mm_unpackhi_epi16(in[2], in[3]);
  183|       |
  184|       |  // Unpack 32 bit elements resulting in:
  185|       |  // b0: 00 10 20 30  01 11 21 31
  186|       |  // b2: 04 14 24 34  05 15 25 35
  187|       |  // b4: 02 12 22 32  03 13 23 33
  188|       |  // b6: 06 16 26 36  07 17 27 37
  189|  4.72M|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  190|  4.72M|  const __m128i b2 = _mm_unpacklo_epi32(a4, a5);
  191|  4.72M|  const __m128i b4 = _mm_unpackhi_epi32(a0, a1);
  192|  4.72M|  const __m128i b6 = _mm_unpackhi_epi32(a4, a5);
  193|       |
  194|       |  // Unpack 64 bit elements resulting in:
  195|       |  // out[0]: 00 10 20 30  XX XX XX XX
  196|       |  // out[1]: 01 11 21 31  XX XX XX XX
  197|       |  // out[2]: 02 12 22 32  XX XX XX XX
  198|       |  // out[3]: 03 13 23 33  XX XX XX XX
  199|       |  // out[4]: 04 14 24 34  XX XX XX XX
  200|       |  // out[5]: 05 15 25 35  XX XX XX XX
  201|       |  // out[6]: 06 16 26 36  XX XX XX XX
  202|       |  // out[7]: 07 17 27 37  XX XX XX XX
  203|  4.72M|  const __m128i zeros = _mm_setzero_si128();
  204|  4.72M|  out[0] = _mm_unpacklo_epi64(b0, zeros);
  205|  4.72M|  out[1] = _mm_unpackhi_epi64(b0, zeros);
  206|  4.72M|  out[2] = _mm_unpacklo_epi64(b4, zeros);
  207|  4.72M|  out[3] = _mm_unpackhi_epi64(b4, zeros);
  208|  4.72M|  out[4] = _mm_unpacklo_epi64(b2, zeros);
  209|  4.72M|  out[5] = _mm_unpackhi_epi64(b2, zeros);
  210|  4.72M|  out[6] = _mm_unpacklo_epi64(b6, zeros);
  211|  4.72M|  out[7] = _mm_unpackhi_epi64(b6, zeros);
  212|  4.72M|}
av1_inv_txfm_ssse3.c:transpose_16bit_4x8:
  125|   204k|                                       __m128i *const out) {
  126|       |  // Unpack 16 bit elements. Goes from:
  127|       |  // in[0]: 00 01 02 03  XX XX XX XX
  128|       |  // in[1]: 10 11 12 13  XX XX XX XX
  129|       |  // in[2]: 20 21 22 23  XX XX XX XX
  130|       |  // in[3]: 30 31 32 33  XX XX XX XX
  131|       |  // in[4]: 40 41 42 43  XX XX XX XX
  132|       |  // in[5]: 50 51 52 53  XX XX XX XX
  133|       |  // in[6]: 60 61 62 63  XX XX XX XX
  134|       |  // in[7]: 70 71 72 73  XX XX XX XX
  135|       |  // to:
  136|       |  // a0:    00 10 01 11  02 12 03 13
  137|       |  // a1:    20 30 21 31  22 32 23 33
  138|       |  // a2:    40 50 41 51  42 52 43 53
  139|       |  // a3:    60 70 61 71  62 72 63 73
  140|   204k|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  141|   204k|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  142|   204k|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  143|   204k|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  144|       |
  145|       |  // Unpack 32 bit elements resulting in:
  146|       |  // b0: 00 10 20 30  01 11 21 31
  147|       |  // b1: 40 50 60 70  41 51 61 71
  148|       |  // b2: 02 12 22 32  03 13 23 33
  149|       |  // b3: 42 52 62 72  43 53 63 73
  150|   204k|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  151|   204k|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  152|   204k|  const __m128i b2 = _mm_unpackhi_epi32(a0, a1);
  153|   204k|  const __m128i b3 = _mm_unpackhi_epi32(a2, a3);
  154|       |
  155|       |  // Unpack 64 bit elements resulting in:
  156|       |  // out[0]: 00 10 20 30  40 50 60 70
  157|       |  // out[1]: 01 11 21 31  41 51 61 71
  158|       |  // out[2]: 02 12 22 32  42 52 62 72
  159|       |  // out[3]: 03 13 23 33  43 53 63 73
  160|   204k|  out[0] = _mm_unpacklo_epi64(b0, b1);
  161|   204k|  out[1] = _mm_unpackhi_epi64(b0, b1);
  162|   204k|  out[2] = _mm_unpacklo_epi64(b2, b3);
  163|   204k|  out[3] = _mm_unpackhi_epi64(b2, b3);
  164|   204k|}
resize_ssse3.c:transpose_16bit_4x8:
  125|   235k|                                       __m128i *const out) {
  126|       |  // Unpack 16 bit elements. Goes from:
  127|       |  // in[0]: 00 01 02 03  XX XX XX XX
  128|       |  // in[1]: 10 11 12 13  XX XX XX XX
  129|       |  // in[2]: 20 21 22 23  XX XX XX XX
  130|       |  // in[3]: 30 31 32 33  XX XX XX XX
  131|       |  // in[4]: 40 41 42 43  XX XX XX XX
  132|       |  // in[5]: 50 51 52 53  XX XX XX XX
  133|       |  // in[6]: 60 61 62 63  XX XX XX XX
  134|       |  // in[7]: 70 71 72 73  XX XX XX XX
  135|       |  // to:
  136|       |  // a0:    00 10 01 11  02 12 03 13
  137|       |  // a1:    20 30 21 31  22 32 23 33
  138|       |  // a2:    40 50 41 51  42 52 43 53
  139|       |  // a3:    60 70 61 71  62 72 63 73
  140|   235k|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  141|   235k|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  142|   235k|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  143|   235k|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  144|       |
  145|       |  // Unpack 32 bit elements resulting in:
  146|       |  // b0: 00 10 20 30  01 11 21 31
  147|       |  // b1: 40 50 60 70  41 51 61 71
  148|       |  // b2: 02 12 22 32  03 13 23 33
  149|       |  // b3: 42 52 62 72  43 53 63 73
  150|   235k|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  151|   235k|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  152|   235k|  const __m128i b2 = _mm_unpackhi_epi32(a0, a1);
  153|   235k|  const __m128i b3 = _mm_unpackhi_epi32(a2, a3);
  154|       |
  155|       |  // Unpack 64 bit elements resulting in:
  156|       |  // out[0]: 00 10 20 30  40 50 60 70
  157|       |  // out[1]: 01 11 21 31  41 51 61 71
  158|       |  // out[2]: 02 12 22 32  42 52 62 72
  159|       |  // out[3]: 03 13 23 33  43 53 63 73
  160|   235k|  out[0] = _mm_unpacklo_epi64(b0, b1);
  161|   235k|  out[1] = _mm_unpackhi_epi64(b0, b1);
  162|   235k|  out[2] = _mm_unpacklo_epi64(b2, b3);
  163|   235k|  out[3] = _mm_unpackhi_epi64(b2, b3);
  164|   235k|}
highbd_inv_txfm_sse4.c:transpose_32bit_4x4:
  300|  22.5M|                                       __m128i *const out) {
  301|       |  // Unpack 32 bit elements. Goes from:
  302|       |  // in[0]: 00 01 02 03
  303|       |  // in[1]: 10 11 12 13
  304|       |  // in[2]: 20 21 22 23
  305|       |  // in[3]: 30 31 32 33
  306|       |  // to:
  307|       |  // a0:    00 10 01 11
  308|       |  // a1:    20 30 21 31
  309|       |  // a2:    02 12 03 13
  310|       |  // a3:    22 32 23 33
  311|       |
  312|  22.5M|  const __m128i a0 = _mm_unpacklo_epi32(in[0], in[1]);
  313|  22.5M|  const __m128i a1 = _mm_unpacklo_epi32(in[2], in[3]);
  314|  22.5M|  const __m128i a2 = _mm_unpackhi_epi32(in[0], in[1]);
  315|  22.5M|  const __m128i a3 = _mm_unpackhi_epi32(in[2], in[3]);
  316|       |
  317|       |  // Unpack 64 bit elements resulting in:
  318|       |  // out[0]: 00 10 20 30
  319|       |  // out[1]: 01 11 21 31
  320|       |  // out[2]: 02 12 22 32
  321|       |  // out[3]: 03 13 23 33
  322|  22.5M|  out[0] = _mm_unpacklo_epi64(a0, a1);
  323|  22.5M|  out[1] = _mm_unpackhi_epi64(a0, a1);
  324|  22.5M|  out[2] = _mm_unpacklo_epi64(a2, a3);
  325|  22.5M|  out[3] = _mm_unpackhi_epi64(a2, a3);
  326|  22.5M|}
highbd_fwd_txfm_sse4.c:transpose_32bit_4x4:
  300|  45.1M|                                       __m128i *const out) {
  301|       |  // Unpack 32 bit elements. Goes from:
  302|       |  // in[0]: 00 01 02 03
  303|       |  // in[1]: 10 11 12 13
  304|       |  // in[2]: 20 21 22 23
  305|       |  // in[3]: 30 31 32 33
  306|       |  // to:
  307|       |  // a0:    00 10 01 11
  308|       |  // a1:    20 30 21 31
  309|       |  // a2:    02 12 03 13
  310|       |  // a3:    22 32 23 33
  311|       |
  312|  45.1M|  const __m128i a0 = _mm_unpacklo_epi32(in[0], in[1]);
  313|  45.1M|  const __m128i a1 = _mm_unpacklo_epi32(in[2], in[3]);
  314|  45.1M|  const __m128i a2 = _mm_unpackhi_epi32(in[0], in[1]);
  315|  45.1M|  const __m128i a3 = _mm_unpackhi_epi32(in[2], in[3]);
  316|       |
  317|       |  // Unpack 64 bit elements resulting in:
  318|       |  // out[0]: 00 10 20 30
  319|       |  // out[1]: 01 11 21 31
  320|       |  // out[2]: 02 12 22 32
  321|       |  // out[3]: 03 13 23 33
  322|  45.1M|  out[0] = _mm_unpacklo_epi64(a0, a1);
  323|  45.1M|  out[1] = _mm_unpackhi_epi64(a0, a1);
  324|  45.1M|  out[2] = _mm_unpacklo_epi64(a2, a3);
  325|  45.1M|  out[3] = _mm_unpackhi_epi64(a2, a3);
  326|  45.1M|}
av1_fwd_txfm2d_avx2.c:transpose_16bit_8x8:
  215|  2.68M|                                       __m128i *const out) {
  216|       |  // Unpack 16 bit elements. Goes from:
  217|       |  // in[0]: 00 01 02 03  04 05 06 07
  218|       |  // in[1]: 10 11 12 13  14 15 16 17
  219|       |  // in[2]: 20 21 22 23  24 25 26 27
  220|       |  // in[3]: 30 31 32 33  34 35 36 37
  221|       |  // in[4]: 40 41 42 43  44 45 46 47
  222|       |  // in[5]: 50 51 52 53  54 55 56 57
  223|       |  // in[6]: 60 61 62 63  64 65 66 67
  224|       |  // in[7]: 70 71 72 73  74 75 76 77
  225|       |  // to:
  226|       |  // a0:    00 10 01 11  02 12 03 13
  227|       |  // a1:    20 30 21 31  22 32 23 33
  228|       |  // a2:    40 50 41 51  42 52 43 53
  229|       |  // a3:    60 70 61 71  62 72 63 73
  230|       |  // a4:    04 14 05 15  06 16 07 17
  231|       |  // a5:    24 34 25 35  26 36 27 37
  232|       |  // a6:    44 54 45 55  46 56 47 57
  233|       |  // a7:    64 74 65 75  66 76 67 77
  234|  2.68M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  235|  2.68M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  236|  2.68M|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  237|  2.68M|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  238|  2.68M|  const __m128i a4 = _mm_unpackhi_epi16(in[0], in[1]);
  239|  2.68M|  const __m128i a5 = _mm_unpackhi_epi16(in[2], in[3]);
  240|  2.68M|  const __m128i a6 = _mm_unpackhi_epi16(in[4], in[5]);
  241|  2.68M|  const __m128i a7 = _mm_unpackhi_epi16(in[6], in[7]);
  242|       |
  243|       |  // Unpack 32 bit elements resulting in:
  244|       |  // b0: 00 10 20 30  01 11 21 31
  245|       |  // b1: 40 50 60 70  41 51 61 71
  246|       |  // b2: 04 14 24 34  05 15 25 35
  247|       |  // b3: 44 54 64 74  45 55 65 75
  248|       |  // b4: 02 12 22 32  03 13 23 33
  249|       |  // b5: 42 52 62 72  43 53 63 73
  250|       |  // b6: 06 16 26 36  07 17 27 37
  251|       |  // b7: 46 56 66 76  47 57 67 77
  252|  2.68M|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  253|  2.68M|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  254|  2.68M|  const __m128i b2 = _mm_unpacklo_epi32(a4, a5);
  255|  2.68M|  const __m128i b3 = _mm_unpacklo_epi32(a6, a7);
  256|  2.68M|  const __m128i b4 = _mm_unpackhi_epi32(a0, a1);
  257|  2.68M|  const __m128i b5 = _mm_unpackhi_epi32(a2, a3);
  258|  2.68M|  const __m128i b6 = _mm_unpackhi_epi32(a4, a5);
  259|  2.68M|  const __m128i b7 = _mm_unpackhi_epi32(a6, a7);
  260|       |
  261|       |  // Unpack 64 bit elements resulting in:
  262|       |  // out[0]: 00 10 20 30  40 50 60 70
  263|       |  // out[1]: 01 11 21 31  41 51 61 71
  264|       |  // out[2]: 02 12 22 32  42 52 62 72
  265|       |  // out[3]: 03 13 23 33  43 53 63 73
  266|       |  // out[4]: 04 14 24 34  44 54 64 74
  267|       |  // out[5]: 05 15 25 35  45 55 65 75
  268|       |  // out[6]: 06 16 26 36  46 56 66 76
  269|       |  // out[7]: 07 17 27 37  47 57 67 77
  270|  2.68M|  out[0] = _mm_unpacklo_epi64(b0, b1);
  271|  2.68M|  out[1] = _mm_unpackhi_epi64(b0, b1);
  272|  2.68M|  out[2] = _mm_unpacklo_epi64(b4, b5);
  273|  2.68M|  out[3] = _mm_unpackhi_epi64(b4, b5);
  274|  2.68M|  out[4] = _mm_unpacklo_epi64(b2, b3);
  275|  2.68M|  out[5] = _mm_unpackhi_epi64(b2, b3);
  276|  2.68M|  out[6] = _mm_unpacklo_epi64(b6, b7);
  277|  2.68M|  out[7] = _mm_unpackhi_epi64(b6, b7);
  278|  2.68M|}
av1_fwd_txfm_sse2.c:transpose_16bit_4x4:
   97|  39.6M|                                       __m128i *const out) {
   98|       |  // Unpack 16 bit elements. Goes from:
   99|       |  // in[0]: 00 01 02 03  XX XX XX XX
  100|       |  // in[1]: 10 11 12 13  XX XX XX XX
  101|       |  // in[2]: 20 21 22 23  XX XX XX XX
  102|       |  // in[3]: 30 31 32 33  XX XX XX XX
  103|       |  // to:
  104|       |  // a0:    00 10 01 11  02 12 03 13
  105|       |  // a1:    20 30 21 31  22 32 23 33
  106|  39.6M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  107|  39.6M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  108|       |
  109|       |  // Unpack 32 bit elements resulting in:
  110|       |  // out[0]: 00 10 20 30  01 11 21 31
  111|       |  // out[1]: 01 11 21 31  __ __ __ __
  112|       |  // out[2]: 02 12 22 32  03 13 23 33
  113|       |  // out[3]: 03 13 23 33  __ __ __ __
  114|       |  //
  115|       |  // Note: The high 64 bits of the output registers are shown for informational
  116|       |  // purposes only. Callers should only use the low 64 bits of the output
  117|       |  // registers. "__" indicates zeros.
  118|  39.6M|  out[0] = _mm_unpacklo_epi32(a0, a1);
  119|  39.6M|  out[1] = _mm_srli_si128(out[0], 8);
  120|  39.6M|  out[2] = _mm_unpackhi_epi32(a0, a1);
  121|       |  out[3] = _mm_srli_si128(out[2], 8);
  122|  39.6M|}
av1_fwd_txfm_sse2.c:transpose_16bit_4x8:
  125|  7.04M|                                       __m128i *const out) {
  126|       |  // Unpack 16 bit elements. Goes from:
  127|       |  // in[0]: 00 01 02 03  XX XX XX XX
  128|       |  // in[1]: 10 11 12 13  XX XX XX XX
  129|       |  // in[2]: 20 21 22 23  XX XX XX XX
  130|       |  // in[3]: 30 31 32 33  XX XX XX XX
  131|       |  // in[4]: 40 41 42 43  XX XX XX XX
  132|       |  // in[5]: 50 51 52 53  XX XX XX XX
  133|       |  // in[6]: 60 61 62 63  XX XX XX XX
  134|       |  // in[7]: 70 71 72 73  XX XX XX XX
  135|       |  // to:
  136|       |  // a0:    00 10 01 11  02 12 03 13
  137|       |  // a1:    20 30 21 31  22 32 23 33
  138|       |  // a2:    40 50 41 51  42 52 43 53
  139|       |  // a3:    60 70 61 71  62 72 63 73
  140|  7.04M|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  141|  7.04M|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  142|  7.04M|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  143|  7.04M|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  144|       |
  145|       |  // Unpack 32 bit elements resulting in:
  146|       |  // b0: 00 10 20 30  01 11 21 31
  147|       |  // b1: 40 50 60 70  41 51 61 71
  148|       |  // b2: 02 12 22 32  03 13 23 33
  149|       |  // b3: 42 52 62 72  43 53 63 73
  150|  7.04M|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  151|  7.04M|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  152|  7.04M|  const __m128i b2 = _mm_unpackhi_epi32(a0, a1);
  153|  7.04M|  const __m128i b3 = _mm_unpackhi_epi32(a2, a3);
  154|       |
  155|       |  // Unpack 64 bit elements resulting in:
  156|       |  // out[0]: 00 10 20 30  40 50 60 70
  157|       |  // out[1]: 01 11 21 31  41 51 61 71
  158|       |  // out[2]: 02 12 22 32  42 52 62 72
  159|       |  // out[3]: 03 13 23 33  43 53 63 73
  160|  7.04M|  out[0] = _mm_unpacklo_epi64(b0, b1);
  161|  7.04M|  out[1] = _mm_unpackhi_epi64(b0, b1);
  162|  7.04M|  out[2] = _mm_unpacklo_epi64(b2, b3);
  163|  7.04M|  out[3] = _mm_unpackhi_epi64(b2, b3);
  164|  7.04M|}
av1_fwd_txfm_sse2.c:transpose_16bit_8x8:
  215|   289k|                                       __m128i *const out) {
  216|       |  // Unpack 16 bit elements. Goes from:
  217|       |  // in[0]: 00 01 02 03  04 05 06 07
  218|       |  // in[1]: 10 11 12 13  14 15 16 17
  219|       |  // in[2]: 20 21 22 23  24 25 26 27
  220|       |  // in[3]: 30 31 32 33  34 35 36 37
  221|       |  // in[4]: 40 41 42 43  44 45 46 47
  222|       |  // in[5]: 50 51 52 53  54 55 56 57
  223|       |  // in[6]: 60 61 62 63  64 65 66 67
  224|       |  // in[7]: 70 71 72 73  74 75 76 77
  225|       |  // to:
  226|       |  // a0:    00 10 01 11  02 12 03 13
  227|       |  // a1:    20 30 21 31  22 32 23 33
  228|       |  // a2:    40 50 41 51  42 52 43 53
  229|       |  // a3:    60 70 61 71  62 72 63 73
  230|       |  // a4:    04 14 05 15  06 16 07 17
  231|       |  // a5:    24 34 25 35  26 36 27 37
  232|       |  // a6:    44 54 45 55  46 56 47 57
  233|       |  // a7:    64 74 65 75  66 76 67 77
  234|   289k|  const __m128i a0 = _mm_unpacklo_epi16(in[0], in[1]);
  235|   289k|  const __m128i a1 = _mm_unpacklo_epi16(in[2], in[3]);
  236|   289k|  const __m128i a2 = _mm_unpacklo_epi16(in[4], in[5]);
  237|   289k|  const __m128i a3 = _mm_unpacklo_epi16(in[6], in[7]);
  238|   289k|  const __m128i a4 = _mm_unpackhi_epi16(in[0], in[1]);
  239|   289k|  const __m128i a5 = _mm_unpackhi_epi16(in[2], in[3]);
  240|   289k|  const __m128i a6 = _mm_unpackhi_epi16(in[4], in[5]);
  241|   289k|  const __m128i a7 = _mm_unpackhi_epi16(in[6], in[7]);
  242|       |
  243|       |  // Unpack 32 bit elements resulting in:
  244|       |  // b0: 00 10 20 30  01 11 21 31
  245|       |  // b1: 40 50 60 70  41 51 61 71
  246|       |  // b2: 04 14 24 34  05 15 25 35
  247|       |  // b3: 44 54 64 74  45 55 65 75
  248|       |  // b4: 02 12 22 32  03 13 23 33
  249|       |  // b5: 42 52 62 72  43 53 63 73
  250|       |  // b6: 06 16 26 36  07 17 27 37
  251|       |  // b7: 46 56 66 76  47 57 67 77
  252|   289k|  const __m128i b0 = _mm_unpacklo_epi32(a0, a1);
  253|   289k|  const __m128i b1 = _mm_unpacklo_epi32(a2, a3);
  254|   289k|  const __m128i b2 = _mm_unpacklo_epi32(a4, a5);
  255|   289k|  const __m128i b3 = _mm_unpacklo_epi32(a6, a7);
  256|   289k|  const __m128i b4 = _mm_unpackhi_epi32(a0, a1);
  257|   289k|  const __m128i b5 = _mm_unpackhi_epi32(a2, a3);
  258|   289k|  const __m128i b6 = _mm_unpackhi_epi32(a4, a5);
  259|   289k|  const __m128i b7 = _mm_unpackhi_epi32(a6, a7);
  260|       |
  261|       |  // Unpack 64 bit elements resulting in:
  262|       |  // out[0]: 00 10 20 30  40 50 60 70
  263|       |  // out[1]: 01 11 21 31  41 51 61 71
  264|       |  // out[2]: 02 12 22 32  42 52 62 72
  265|       |  // out[3]: 03 13 23 33  43 53 63 73
  266|       |  // out[4]: 04 14 24 34  44 54 64 74
  267|       |  // out[5]: 05 15 25 35  45 55 65 75
  268|       |  // out[6]: 06 16 26 36  46 56 66 76
  269|       |  // out[7]: 07 17 27 37  47 57 67 77
  270|   289k|  out[0] = _mm_unpacklo_epi64(b0, b1);
  271|   289k|  out[1] = _mm_unpackhi_epi64(b0, b1);
  272|   289k|  out[2] = _mm_unpacklo_epi64(b4, b5);
  273|   289k|  out[3] = _mm_unpackhi_epi64(b4, b5);
  274|   289k|  out[4] = _mm_unpacklo_epi64(b2, b3);
  275|   289k|  out[5] = _mm_unpackhi_epi64(b2, b3);
  276|   289k|  out[6] = _mm_unpacklo_epi64(b6, b7);
  277|   289k|  out[7] = _mm_unpackhi_epi64(b6, b7);
  278|   289k|}

av1_inv_txfm_avx2.c:pair_set_w16_epi16:
   23|  65.4M|static inline __m256i pair_set_w16_epi16(int16_t a, int16_t b) {
   24|  65.4M|  return _mm256_set1_epi32(
   25|  65.4M|      (int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)));
   26|  65.4M|}
av1_inv_txfm_avx2.c:btf_16_adds_subs_avx2:
   52|  66.5M|static inline void btf_16_adds_subs_avx2(__m256i *in0, __m256i *in1) {
   53|  66.5M|  const __m256i _in0 = *in0;
   54|  66.5M|  const __m256i _in1 = *in1;
   55|  66.5M|  *in0 = _mm256_adds_epi16(_in0, _in1);
   56|  66.5M|  *in1 = _mm256_subs_epi16(_in0, _in1);
   57|  66.5M|}
av1_inv_txfm_avx2.c:btf_16_w16_avx2:
   30|  44.1M|                                   const int32_t cos_bit) {
   31|  44.1M|  __m256i t0 = _mm256_unpacklo_epi16(*in0, *in1);
   32|  44.1M|  __m256i t1 = _mm256_unpackhi_epi16(*in0, *in1);
   33|  44.1M|  __m256i u0 = _mm256_madd_epi16(t0, w0);
   34|  44.1M|  __m256i u1 = _mm256_madd_epi16(t1, w0);
   35|  44.1M|  __m256i v0 = _mm256_madd_epi16(t0, w1);
   36|  44.1M|  __m256i v1 = _mm256_madd_epi16(t1, w1);
   37|       |
   38|  44.1M|  __m256i a0 = _mm256_add_epi32(u0, _r);
   39|  44.1M|  __m256i a1 = _mm256_add_epi32(u1, _r);
   40|  44.1M|  __m256i b0 = _mm256_add_epi32(v0, _r);
   41|  44.1M|  __m256i b1 = _mm256_add_epi32(v1, _r);
   42|       |
   43|  44.1M|  __m256i c0 = _mm256_srai_epi32(a0, cos_bit);
   44|  44.1M|  __m256i c1 = _mm256_srai_epi32(a1, cos_bit);
   45|  44.1M|  __m256i d0 = _mm256_srai_epi32(b0, cos_bit);
   46|  44.1M|  __m256i d1 = _mm256_srai_epi32(b1, cos_bit);
   47|       |
   48|  44.1M|  *in0 = _mm256_packs_epi32(c0, c1);
   49|  44.1M|  *in1 = _mm256_packs_epi32(d0, d1);
   50|  44.1M|}
av1_inv_txfm_avx2.c:btf_16_adds_subs_out_avx2:
   67|  21.5M|                                             __m256i in0, __m256i in1) {
   68|  21.5M|  const __m256i _in0 = in0;
   69|  21.5M|  const __m256i _in1 = in1;
   70|  21.5M|  *out0 = _mm256_adds_epi16(_in0, _in1);
   71|  21.5M|  *out1 = _mm256_subs_epi16(_in0, _in1);
   72|  21.5M|}
av1_inv_txfm_avx2.c:load_buffer_32bit_to_16bit_w16_avx2:
  111|  1.22M|                                                       int out_size) {
  112|  25.6M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (112:19): [True: 24.3M, False: 1.22M]
  ------------------
  113|  24.3M|    out[i] = load_32bit_to_16bit_w16_avx2(in + i * stride);
  114|  24.3M|  }
  115|  1.22M|}
av1_inv_txfm_avx2.c:load_32bit_to_16bit_w16_avx2:
  103|  25.1M|static inline __m256i load_32bit_to_16bit_w16_avx2(const int32_t *a) {
  104|  25.1M|  const __m256i a_low = _mm256_lddqu_si256((const __m256i *)a);
  105|  25.1M|  const __m256i b = _mm256_packs_epi32(a_low, *(const __m256i *)(a + 8));
  106|       |  return _mm256_permute4x64_epi64(b, 0xD8);
  107|  25.1M|}
av1_inv_txfm_avx2.c:flip_buf_avx2:
  228|  1.45k|static inline void flip_buf_avx2(__m256i *in, __m256i *out, int size) {
  229|  24.7k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (229:19): [True: 23.3k, False: 1.45k]
  ------------------
  230|  23.3k|    out[size - i - 1] = in[i];
  231|  23.3k|  }
  232|  1.45k|}
av1_inv_txfm_avx2.c:transpose_16bit_16x16_avx2:
  158|  1.63M|                                              __m256i *const out) {
  159|  1.63M|  __m256i t[16];
  160|       |
  161|  1.63M|#define LOADL(idx)                                                            \
  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  165|       |
  166|  1.63M|#define LOADR(idx)                                                           \
  167|  1.63M|  t[8 + idx] =                                                               \
  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  171|       |
  172|       |  // load left 8x16
  173|  1.63M|  LOADL(0)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  174|  1.63M|  LOADL(1)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  175|  1.63M|  LOADL(2)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  176|  1.63M|  LOADL(3)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  177|  1.63M|  LOADL(4)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  178|  1.63M|  LOADL(5)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  179|  1.63M|  LOADL(6)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  180|  1.63M|  LOADL(7)
  ------------------
  |  |  162|  1.63M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  1.63M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  1.63M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  181|       |
  182|       |  // load right 8x16
  183|  1.63M|  LOADR(0)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  184|  1.63M|  LOADR(1)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  185|  1.63M|  LOADR(2)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  186|  1.63M|  LOADR(3)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  187|  1.63M|  LOADR(4)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  188|  1.63M|  LOADR(5)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  189|  1.63M|  LOADR(6)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  190|  1.63M|  LOADR(7)
  ------------------
  |  |  167|  1.63M|  t[8 + idx] =                                                               \
  |  |  168|  1.63M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  1.63M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  1.63M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  191|       |
  192|       |  // get the top 16x8 result
  193|  1.63M|  transpose2_8x8_avx2(t, out);
  194|       |  // get the bottom 16x8 result
  195|  1.63M|  transpose2_8x8_avx2(&t[8], &out[8]);
  196|  1.63M|}
av1_inv_txfm_avx2.c:transpose2_8x8_avx2:
  118|  3.26M|                                       __m256i *const out) {
  119|  3.26M|  __m256i t[16], u[16];
  120|       |  // (1st, 2nd) ==> (lo, hi)
  121|       |  //   (0, 1)   ==>  (0, 1)
  122|       |  //   (2, 3)   ==>  (2, 3)
  123|       |  //   (4, 5)   ==>  (4, 5)
  124|       |  //   (6, 7)   ==>  (6, 7)
  125|  16.3M|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (125:19): [True: 13.0M, False: 3.26M]
  ------------------
  126|  13.0M|    t[2 * i] = _mm256_unpacklo_epi16(in[2 * i], in[2 * i + 1]);
  127|  13.0M|    t[2 * i + 1] = _mm256_unpackhi_epi16(in[2 * i], in[2 * i + 1]);
  128|  13.0M|  }
  129|       |
  130|       |  // (1st, 2nd) ==> (lo, hi)
  131|       |  //   (0, 2)   ==>  (0, 2)
  132|       |  //   (1, 3)   ==>  (1, 3)
  133|       |  //   (4, 6)   ==>  (4, 6)
  134|       |  //   (5, 7)   ==>  (5, 7)
  135|  9.78M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (135:19): [True: 6.52M, False: 3.26M]
  ------------------
  136|  6.52M|    u[i] = _mm256_unpacklo_epi32(t[i], t[i + 2]);
  137|  6.52M|    u[i + 2] = _mm256_unpackhi_epi32(t[i], t[i + 2]);
  138|       |
  139|  6.52M|    u[i + 4] = _mm256_unpacklo_epi32(t[i + 4], t[i + 6]);
  140|  6.52M|    u[i + 6] = _mm256_unpackhi_epi32(t[i + 4], t[i + 6]);
  141|  6.52M|  }
  142|       |
  143|       |  // (1st, 2nd) ==> (lo, hi)
  144|       |  //   (0, 4)   ==>  (0, 1)
  145|       |  //   (1, 5)   ==>  (4, 5)
  146|       |  //   (2, 6)   ==>  (2, 3)
  147|       |  //   (3, 7)   ==>  (6, 7)
  148|  9.78M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (148:19): [True: 6.52M, False: 3.26M]
  ------------------
  149|  6.52M|    out[2 * i] = _mm256_unpacklo_epi64(u[2 * i], u[2 * i + 4]);
  150|  6.52M|    out[2 * i + 1] = _mm256_unpackhi_epi64(u[2 * i], u[2 * i + 4]);
  151|       |
  152|  6.52M|    out[2 * i + 4] = _mm256_unpacklo_epi64(u[2 * i + 1], u[2 * i + 5]);
  153|  6.52M|    out[2 * i + 5] = _mm256_unpackhi_epi64(u[2 * i + 1], u[2 * i + 5]);
  154|  6.52M|  }
  155|  3.26M|}
av1_inv_txfm_avx2.c:round_shift_16bit_w16_avx2:
  234|    485|static inline void round_shift_16bit_w16_avx2(__m256i *in, int size, int bit) {
  235|    485|  if (bit < 0) {
  ------------------
  |  Branch (235:7): [True: 485, False: 0]
  ------------------
  236|    485|    bit = -bit;
  237|    485|    __m256i round = _mm256_set1_epi16(1 << (bit - 1));
  238|  8.24k|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (238:21): [True: 7.76k, False: 485]
  ------------------
  239|  7.76k|      in[i] = _mm256_adds_epi16(in[i], round);
  240|  7.76k|      in[i] = _mm256_srai_epi16(in[i], bit);
  241|  7.76k|    }
  242|    485|  } else if (bit > 0) {
  ------------------
  |  Branch (242:14): [True: 0, False: 0]
  ------------------
  243|      0|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (243:21): [True: 0, False: 0]
  ------------------
  244|      0|      in[i] = _mm256_slli_epi16(in[i], bit);
  245|      0|    }
  246|      0|  }
  247|    485|}
highbd_inv_txfm_avx2.c:round_shift_rect_array_32_avx2:
  274|   646k|                                                  const int val) {
  275|   646k|  const __m256i sqrt2 = _mm256_set1_epi32(val);
  276|   646k|  if (bit > 0) {
  ------------------
  |  Branch (276:7): [True: 0, False: 646k]
  ------------------
  277|      0|    int i;
  278|      0|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|      const __m256i r0 = round_shift_32_avx2(input[i], bit);
  280|      0|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  281|      0|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|      0|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  282|      0|    }
  283|   646k|  } else {
  284|   646k|    int i;
  285|  8.45M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (285:17): [True: 7.80M, False: 646k]
  ------------------
  286|  7.80M|      const __m256i r0 = _mm256_slli_epi32(input[i], -bit);
  287|  7.80M|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  288|  7.80M|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|  7.80M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  289|  7.80M|    }
  290|   646k|  }
  291|   646k|}
highbd_inv_txfm_avx2.c:round_shift_32_avx2:
  249|  51.2M|static inline __m256i round_shift_32_avx2(__m256i vec, int bit) {
  250|  51.2M|  __m256i tmp, round;
  251|  51.2M|  round = _mm256_set1_epi32(1 << (bit - 1));
  252|  51.2M|  tmp = _mm256_add_epi32(vec, round);
  253|  51.2M|  return _mm256_srai_epi32(tmp, bit);
  254|  51.2M|}
highbd_inv_txfm_avx2.c:round_shift_array_32_avx2:
  257|  4.62M|                                             const int size, const int bit) {
  258|  4.62M|  if (bit > 0) {
  ------------------
  |  Branch (258:7): [True: 4.62M, False: 18.4E]
  ------------------
  259|  4.62M|    int i;
  260|  48.1M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (260:17): [True: 43.4M, False: 4.62M]
  ------------------
  261|  43.4M|      output[i] = round_shift_32_avx2(input[i], bit);
  262|  43.4M|    }
  263|  18.4E|  } else {
  264|  18.4E|    int i;
  265|  18.4E|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (265:17): [True: 0, False: 18.4E]
  ------------------
  266|      0|      output[i] = _mm256_slli_epi32(input[i], -bit);
  267|      0|    }
  268|  18.4E|  }
  269|  4.62M|}
av1_fwd_txfm2d_avx2.c:pair_set_w16_epi16:
   23|   169M|static inline __m256i pair_set_w16_epi16(int16_t a, int16_t b) {
   24|   169M|  return _mm256_set1_epi32(
   25|   169M|      (int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)));
   26|   169M|}
av1_fwd_txfm2d_avx2.c:btf_16_adds_subs_out_avx2:
   67|  34.2M|                                             __m256i in0, __m256i in1) {
   68|  34.2M|  const __m256i _in0 = in0;
   69|  34.2M|  const __m256i _in1 = in1;
   70|  34.2M|  *out0 = _mm256_adds_epi16(_in0, _in1);
   71|  34.2M|  *out1 = _mm256_subs_epi16(_in0, _in1);
   72|  34.2M|}
av1_fwd_txfm2d_avx2.c:btf_16_adds_subs_avx2:
   52|   111M|static inline void btf_16_adds_subs_avx2(__m256i *in0, __m256i *in1) {
   53|   111M|  const __m256i _in0 = *in0;
   54|   111M|  const __m256i _in1 = *in1;
   55|   111M|  *in0 = _mm256_adds_epi16(_in0, _in1);
   56|   111M|  *in1 = _mm256_subs_epi16(_in0, _in1);
   57|   111M|}
av1_fwd_txfm2d_avx2.c:btf_16_w16_avx2:
   30|  96.3M|                                   const int32_t cos_bit) {
   31|  96.3M|  __m256i t0 = _mm256_unpacklo_epi16(*in0, *in1);
   32|  96.3M|  __m256i t1 = _mm256_unpackhi_epi16(*in0, *in1);
   33|  96.3M|  __m256i u0 = _mm256_madd_epi16(t0, w0);
   34|  96.3M|  __m256i u1 = _mm256_madd_epi16(t1, w0);
   35|  96.3M|  __m256i v0 = _mm256_madd_epi16(t0, w1);
   36|  96.3M|  __m256i v1 = _mm256_madd_epi16(t1, w1);
   37|       |
   38|  96.3M|  __m256i a0 = _mm256_add_epi32(u0, _r);
   39|  96.3M|  __m256i a1 = _mm256_add_epi32(u1, _r);
   40|  96.3M|  __m256i b0 = _mm256_add_epi32(v0, _r);
   41|  96.3M|  __m256i b1 = _mm256_add_epi32(v1, _r);
   42|       |
   43|  96.3M|  __m256i c0 = _mm256_srai_epi32(a0, cos_bit);
   44|  96.3M|  __m256i c1 = _mm256_srai_epi32(a1, cos_bit);
   45|  96.3M|  __m256i d0 = _mm256_srai_epi32(b0, cos_bit);
   46|  96.3M|  __m256i d1 = _mm256_srai_epi32(b1, cos_bit);
   47|       |
   48|  96.3M|  *in0 = _mm256_packs_epi32(c0, c1);
   49|  96.3M|  *in1 = _mm256_packs_epi32(d0, d1);
   50|  96.3M|}
av1_fwd_txfm2d_avx2.c:scale_round_avx2:
  293|  44.7M|static inline __m256i scale_round_avx2(const __m256i a, const int scale) {
  294|  44.7M|  const __m256i scale_rounding =
  295|  44.7M|      pair_set_w16_epi16(scale, 1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  44.7M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  296|  44.7M|  const __m256i b = _mm256_madd_epi16(a, scale_rounding);
  297|  44.7M|  return _mm256_srai_epi32(b, NewSqrt2Bits);
  ------------------
  |  |   42|  44.7M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  298|  44.7M|}
av1_fwd_txfm2d_avx2.c:load_buffer_16bit_to_16bit_flip_avx2:
   97|  2.19k|                                                        int out_size) {
   98|  37.3k|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (98:19): [True: 35.1k, False: 2.19k]
  ------------------
   99|  35.1k|    out[out_size - i - 1] = load_16bit_to_16bit_avx2(in + i * stride);
  100|  35.1k|  }
  101|  2.19k|}
av1_fwd_txfm2d_avx2.c:load_16bit_to_16bit_avx2:
   82|  51.1M|static inline __m256i load_16bit_to_16bit_avx2(const int16_t *a) {
   83|  51.1M|  return _mm256_load_si256((const __m256i *)a);
   84|  51.1M|}
av1_fwd_txfm2d_avx2.c:load_buffer_16bit_to_16bit_avx2:
   88|  2.43M|                                                   int out_size) {
   89|  53.6M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (89:19): [True: 51.2M, False: 2.43M]
  ------------------
   90|  51.2M|    out[i] = load_16bit_to_16bit_avx2(in + i * stride);
   91|  51.2M|  }
   92|  2.43M|}
av1_fwd_txfm2d_avx2.c:round_shift_16bit_w16_avx2:
  234|  10.3M|static inline void round_shift_16bit_w16_avx2(__m256i *in, int size, int bit) {
  235|  10.3M|  if (bit < 0) {
  ------------------
  |  Branch (235:7): [True: 3.33M, False: 6.98M]
  ------------------
  236|  3.33M|    bit = -bit;
  237|  3.33M|    __m256i round = _mm256_set1_epi16(1 << (bit - 1));
  238|  61.8M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (238:21): [True: 58.5M, False: 3.33M]
  ------------------
  239|  58.5M|      in[i] = _mm256_adds_epi16(in[i], round);
  240|  58.5M|      in[i] = _mm256_srai_epi16(in[i], bit);
  241|  58.5M|    }
  242|  6.98M|  } else if (bit > 0) {
  ------------------
  |  Branch (242:14): [True: 3.22M, False: 3.75M]
  ------------------
  243|  54.8M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (243:21): [True: 51.6M, False: 3.22M]
  ------------------
  244|  51.6M|      in[i] = _mm256_slli_epi16(in[i], bit);
  245|  51.6M|    }
  246|  3.22M|  }
  247|  10.3M|}
av1_fwd_txfm2d_avx2.c:transpose_16bit_16x16_avx2:
  158|  2.99M|                                              __m256i *const out) {
  159|  2.99M|  __m256i t[16];
  160|       |
  161|  2.99M|#define LOADL(idx)                                                            \
  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  165|       |
  166|  2.99M|#define LOADR(idx)                                                           \
  167|  2.99M|  t[8 + idx] =                                                               \
  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  171|       |
  172|       |  // load left 8x16
  173|  2.99M|  LOADL(0)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  174|  2.99M|  LOADL(1)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  175|  2.99M|  LOADL(2)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  176|  2.99M|  LOADL(3)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  177|  2.99M|  LOADL(4)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  178|  2.99M|  LOADL(5)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  179|  2.99M|  LOADL(6)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  180|  2.99M|  LOADL(7)
  ------------------
  |  |  162|  2.99M|  t[idx] = _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx])); \
  |  |  163|  2.99M|  t[idx] = _mm256_inserti128_si256(                                           \
  |  |  164|  2.99M|      t[idx], _mm_load_si128((__m128i const *)&in[idx + 8]), 1);
  ------------------
  181|       |
  182|       |  // load right 8x16
  183|  2.99M|  LOADR(0)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  184|  2.99M|  LOADR(1)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  185|  2.99M|  LOADR(2)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  186|  2.99M|  LOADR(3)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  187|  2.99M|  LOADR(4)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  188|  2.99M|  LOADR(5)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  189|  2.99M|  LOADR(6)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  190|  2.99M|  LOADR(7)
  ------------------
  |  |  167|  2.99M|  t[8 + idx] =                                                               \
  |  |  168|  2.99M|      _mm256_castsi128_si256(_mm_load_si128((__m128i const *)&in[idx] + 1)); \
  |  |  169|  2.99M|  t[8 + idx] = _mm256_inserti128_si256(                                      \
  |  |  170|  2.99M|      t[8 + idx], _mm_load_si128((__m128i const *)&in[idx + 8] + 1), 1);
  ------------------
  191|       |
  192|       |  // get the top 16x8 result
  193|  2.99M|  transpose2_8x8_avx2(t, out);
  194|       |  // get the bottom 16x8 result
  195|  2.99M|  transpose2_8x8_avx2(&t[8], &out[8]);
  196|  2.99M|}
av1_fwd_txfm2d_avx2.c:transpose2_8x8_avx2:
  118|  5.98M|                                       __m256i *const out) {
  119|  5.98M|  __m256i t[16], u[16];
  120|       |  // (1st, 2nd) ==> (lo, hi)
  121|       |  //   (0, 1)   ==>  (0, 1)
  122|       |  //   (2, 3)   ==>  (2, 3)
  123|       |  //   (4, 5)   ==>  (4, 5)
  124|       |  //   (6, 7)   ==>  (6, 7)
  125|  29.9M|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (125:19): [True: 23.9M, False: 5.98M]
  ------------------
  126|  23.9M|    t[2 * i] = _mm256_unpacklo_epi16(in[2 * i], in[2 * i + 1]);
  127|  23.9M|    t[2 * i + 1] = _mm256_unpackhi_epi16(in[2 * i], in[2 * i + 1]);
  128|  23.9M|  }
  129|       |
  130|       |  // (1st, 2nd) ==> (lo, hi)
  131|       |  //   (0, 2)   ==>  (0, 2)
  132|       |  //   (1, 3)   ==>  (1, 3)
  133|       |  //   (4, 6)   ==>  (4, 6)
  134|       |  //   (5, 7)   ==>  (5, 7)
  135|  17.9M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (135:19): [True: 11.9M, False: 5.98M]
  ------------------
  136|  11.9M|    u[i] = _mm256_unpacklo_epi32(t[i], t[i + 2]);
  137|  11.9M|    u[i + 2] = _mm256_unpackhi_epi32(t[i], t[i + 2]);
  138|       |
  139|  11.9M|    u[i + 4] = _mm256_unpacklo_epi32(t[i + 4], t[i + 6]);
  140|  11.9M|    u[i + 6] = _mm256_unpackhi_epi32(t[i + 4], t[i + 6]);
  141|  11.9M|  }
  142|       |
  143|       |  // (1st, 2nd) ==> (lo, hi)
  144|       |  //   (0, 4)   ==>  (0, 1)
  145|       |  //   (1, 5)   ==>  (4, 5)
  146|       |  //   (2, 6)   ==>  (2, 3)
  147|       |  //   (3, 7)   ==>  (6, 7)
  148|  17.9M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (148:19): [True: 11.9M, False: 5.98M]
  ------------------
  149|  11.9M|    out[2 * i] = _mm256_unpacklo_epi64(u[2 * i], u[2 * i + 4]);
  150|  11.9M|    out[2 * i + 1] = _mm256_unpackhi_epi64(u[2 * i], u[2 * i + 4]);
  151|       |
  152|  11.9M|    out[2 * i + 4] = _mm256_unpacklo_epi64(u[2 * i + 1], u[2 * i + 5]);
  153|  11.9M|    out[2 * i + 5] = _mm256_unpackhi_epi64(u[2 * i + 1], u[2 * i + 5]);
  154|  11.9M|  }
  155|  5.98M|}
av1_fwd_txfm2d_avx2.c:flip_buf_avx2:
  228|  2.45k|static inline void flip_buf_avx2(__m256i *in, __m256i *out, int size) {
  229|  41.7k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (229:19): [True: 39.3k, False: 2.45k]
  ------------------
  230|  39.3k|    out[size - i - 1] = in[i];
  231|  39.3k|  }
  232|  2.45k|}
av1_fwd_txfm2d_avx2.c:btf_32_add_sub_out_avx2:
   75|  3.74M|                                           __m256i in0, __m256i in1) {
   76|  3.74M|  const __m256i _in0 = in0;
   77|  3.74M|  const __m256i _in1 = in1;
   78|  3.74M|  *out0 = _mm256_add_epi32(_in0, _in1);
   79|  3.74M|  *out1 = _mm256_sub_epi32(_in0, _in1);
   80|  3.74M|}
av1_fwd_txfm2d_avx2.c:btf_32_add_sub_avx2:
   59|  14.8M|static inline void btf_32_add_sub_avx2(__m256i *in0, __m256i *in1) {
   60|  14.8M|  const __m256i _in0 = *in0;
   61|  14.8M|  const __m256i _in1 = *in1;
   62|  14.8M|  *in0 = _mm256_add_epi32(_in0, _in1);
   63|  14.8M|  *in1 = _mm256_sub_epi32(_in0, _in1);
   64|  14.8M|}
av1_fwd_txfm2d_avx2.c:round_shift_array_32_avx2:
  257|   101k|                                             const int size, const int bit) {
  258|   101k|  if (bit > 0) {
  ------------------
  |  Branch (258:7): [True: 101k, False: 18.4E]
  ------------------
  259|   101k|    int i;
  260|  3.34M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (260:17): [True: 3.24M, False: 101k]
  ------------------
  261|  3.24M|      output[i] = round_shift_32_avx2(input[i], bit);
  262|  3.24M|    }
  263|  18.4E|  } else {
  264|  18.4E|    int i;
  265|  18.4E|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (265:17): [True: 0, False: 18.4E]
  ------------------
  266|      0|      output[i] = _mm256_slli_epi32(input[i], -bit);
  267|      0|    }
  268|  18.4E|  }
  269|   101k|}
av1_fwd_txfm2d_avx2.c:round_shift_32_avx2:
  249|  4.57M|static inline __m256i round_shift_32_avx2(__m256i vec, int bit) {
  250|  4.57M|  __m256i tmp, round;
  251|  4.57M|  round = _mm256_set1_epi32(1 << (bit - 1));
  252|  4.57M|  tmp = _mm256_add_epi32(vec, round);
  253|  4.57M|  return _mm256_srai_epi32(tmp, bit);
  254|  4.57M|}
av1_fwd_txfm2d_avx2.c:pack_reg:
  322|  2.23M|                            __m256i *out) {
  323|  2.23M|  out[0] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[0]), in2[0], 0x1);
  324|  2.23M|  out[1] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[1]), in2[1], 0x1);
  325|  2.23M|  out[2] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[2]), in2[2], 0x1);
  326|  2.23M|  out[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[3]), in2[3], 0x1);
  327|  2.23M|  out[4] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[4]), in2[4], 0x1);
  328|  2.23M|  out[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[5]), in2[5], 0x1);
  329|  2.23M|  out[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[6]), in2[6], 0x1);
  330|       |  out[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(in1[7]), in2[7], 0x1);
  331|  2.23M|}
av1_fwd_txfm2d_avx2.c:transpose_16bit_16x8_avx2:
  199|   898k|                                             __m256i *const out) {
  200|   898k|  const __m256i a0 = _mm256_unpacklo_epi16(in[0], in[1]);
  201|   898k|  const __m256i a1 = _mm256_unpacklo_epi16(in[2], in[3]);
  202|   898k|  const __m256i a2 = _mm256_unpacklo_epi16(in[4], in[5]);
  203|   898k|  const __m256i a3 = _mm256_unpacklo_epi16(in[6], in[7]);
  204|   898k|  const __m256i a4 = _mm256_unpackhi_epi16(in[0], in[1]);
  205|   898k|  const __m256i a5 = _mm256_unpackhi_epi16(in[2], in[3]);
  206|   898k|  const __m256i a6 = _mm256_unpackhi_epi16(in[4], in[5]);
  207|   898k|  const __m256i a7 = _mm256_unpackhi_epi16(in[6], in[7]);
  208|       |
  209|   898k|  const __m256i b0 = _mm256_unpacklo_epi32(a0, a1);
  210|   898k|  const __m256i b1 = _mm256_unpacklo_epi32(a2, a3);
  211|   898k|  const __m256i b2 = _mm256_unpacklo_epi32(a4, a5);
  212|   898k|  const __m256i b3 = _mm256_unpacklo_epi32(a6, a7);
  213|   898k|  const __m256i b4 = _mm256_unpackhi_epi32(a0, a1);
  214|   898k|  const __m256i b5 = _mm256_unpackhi_epi32(a2, a3);
  215|   898k|  const __m256i b6 = _mm256_unpackhi_epi32(a4, a5);
  216|   898k|  const __m256i b7 = _mm256_unpackhi_epi32(a6, a7);
  217|       |
  218|   898k|  out[0] = _mm256_unpacklo_epi64(b0, b1);
  219|   898k|  out[1] = _mm256_unpackhi_epi64(b0, b1);
  220|   898k|  out[2] = _mm256_unpacklo_epi64(b4, b5);
  221|   898k|  out[3] = _mm256_unpackhi_epi64(b4, b5);
  222|   898k|  out[4] = _mm256_unpacklo_epi64(b2, b3);
  223|   898k|  out[5] = _mm256_unpackhi_epi64(b2, b3);
  224|   898k|  out[6] = _mm256_unpacklo_epi64(b6, b7);
  225|   898k|  out[7] = _mm256_unpackhi_epi64(b6, b7);
  226|   898k|}
av1_fwd_txfm2d_avx2.c:extract_reg:
  333|   898k|static inline void extract_reg(const __m256i *in, __m128i *out1) {
  334|   898k|  out1[0] = _mm256_castsi256_si128(in[0]);
  335|   898k|  out1[1] = _mm256_castsi256_si128(in[1]);
  336|   898k|  out1[2] = _mm256_castsi256_si128(in[2]);
  337|   898k|  out1[3] = _mm256_castsi256_si128(in[3]);
  338|   898k|  out1[4] = _mm256_castsi256_si128(in[4]);
  339|   898k|  out1[5] = _mm256_castsi256_si128(in[5]);
  340|   898k|  out1[6] = _mm256_castsi256_si128(in[6]);
  341|   898k|  out1[7] = _mm256_castsi256_si128(in[7]);
  342|       |
  343|   898k|  out1[8] = _mm256_extracti128_si256(in[0], 0x01);
  344|   898k|  out1[9] = _mm256_extracti128_si256(in[1], 0x01);
  345|   898k|  out1[10] = _mm256_extracti128_si256(in[2], 0x01);
  346|   898k|  out1[11] = _mm256_extracti128_si256(in[3], 0x01);
  347|   898k|  out1[12] = _mm256_extracti128_si256(in[4], 0x01);
  348|   898k|  out1[13] = _mm256_extracti128_si256(in[5], 0x01);
  349|   898k|  out1[14] = _mm256_extracti128_si256(in[6], 0x01);
  350|       |  out1[15] = _mm256_extracti128_si256(in[7], 0x01);
  351|   898k|}
av1_fwd_txfm2d_avx2.c:round_shift_rect_array_32_avx2:
  274|  20.7k|                                                  const int val) {
  275|  20.7k|  const __m256i sqrt2 = _mm256_set1_epi32(val);
  276|  20.7k|  if (bit > 0) {
  ------------------
  |  Branch (276:7): [True: 20.7k, False: 18.4E]
  ------------------
  277|  20.7k|    int i;
  278|   685k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (278:17): [True: 664k, False: 20.7k]
  ------------------
  279|   664k|      const __m256i r0 = round_shift_32_avx2(input[i], bit);
  280|   664k|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  281|   664k|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|   664k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  282|   664k|    }
  283|  18.4E|  } else {
  284|  18.4E|    int i;
  285|  18.4E|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (285:17): [True: 0, False: 18.4E]
  ------------------
  286|      0|      const __m256i r0 = _mm256_slli_epi32(input[i], -bit);
  287|      0|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  288|      0|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|      0|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  289|      0|    }
  290|  18.4E|  }
  291|  20.7k|}
highbd_fwd_txfm_avx2.c:round_shift_rect_array_32_avx2:
  274|   842k|                                                  const int val) {
  275|   842k|  const __m256i sqrt2 = _mm256_set1_epi32(val);
  276|   842k|  if (bit > 0) {
  ------------------
  |  Branch (276:7): [True: 0, False: 842k]
  ------------------
  277|      0|    int i;
  278|      0|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|      const __m256i r0 = round_shift_32_avx2(input[i], bit);
  280|      0|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  281|      0|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|      0|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  282|      0|    }
  283|   842k|  } else {
  284|   842k|    int i;
  285|  14.3M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (285:17): [True: 13.4M, False: 842k]
  ------------------
  286|  13.4M|      const __m256i r0 = _mm256_slli_epi32(input[i], -bit);
  287|  13.4M|      const __m256i r1 = _mm256_mullo_epi32(sqrt2, r0);
  288|  13.4M|      output[i] = round_shift_32_avx2(r1, NewSqrt2Bits);
  ------------------
  |  |   42|  13.4M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  289|  13.4M|    }
  290|   842k|  }
  291|   842k|}
highbd_fwd_txfm_avx2.c:round_shift_32_avx2:
  249|  13.4M|static inline __m256i round_shift_32_avx2(__m256i vec, int bit) {
  250|  13.4M|  __m256i tmp, round;
  251|  13.4M|  round = _mm256_set1_epi32(1 << (bit - 1));
  252|  13.4M|  tmp = _mm256_add_epi32(vec, round);
  253|  13.4M|  return _mm256_srai_epi32(tmp, bit);
  254|  13.4M|}

highbd_fwd_txfm_avx2.c:mm_reverse_epi16:
   23|   521k|static inline __m128i mm_reverse_epi16(const __m128i x) {
   24|   521k|  const __m128i a = _mm_shufflelo_epi16(x, 0x1b);
   25|   521k|  const __m128i b = _mm_shufflehi_epi16(a, 0x1b);
   26|       |  return _mm_shuffle_epi32(b, 0x4e);
   27|   521k|}

aom_variance16x8_avx2:
  181|   648k|      unsigned int *sse) {                                                    \
  182|   648k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|   648k|    __m256i vsum;                                                             \
  184|   648k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|   648k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|   648k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|   648k|  }
aom_variance16x16_avx2:
  181|  3.24M|      unsigned int *sse) {                                                    \
  182|  3.24M|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|  3.24M|    __m256i vsum;                                                             \
  184|  3.24M|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|  3.24M|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|  3.24M|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|  3.24M|  }
aom_variance16x32_avx2:
  181|   170k|      unsigned int *sse) {                                                    \
  182|   170k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|   170k|    __m256i vsum;                                                             \
  184|   170k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|   170k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|   170k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|   170k|  }
aom_variance32x16_avx2:
  181|   143k|      unsigned int *sse) {                                                    \
  182|   143k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|   143k|    __m256i vsum;                                                             \
  184|   143k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|   143k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|   143k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|   143k|  }
aom_variance32x32_avx2:
  181|   784k|      unsigned int *sse) {                                                    \
  182|   784k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|   784k|    __m256i vsum;                                                             \
  184|   784k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|   784k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|   784k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|   784k|  }
aom_variance32x64_avx2:
  181|  78.1k|      unsigned int *sse) {                                                    \
  182|  78.1k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|  78.1k|    __m256i vsum;                                                             \
  184|  78.1k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|  78.1k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|  78.1k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|  78.1k|  }
aom_variance64x32_avx2:
  181|  68.4k|      unsigned int *sse) {                                                    \
  182|  68.4k|    __m256i vsse = _mm256_setzero_si256();                                    \
  183|  68.4k|    __m256i vsum;                                                             \
  184|  68.4k|    variance##bw##_avx2(src, src_stride, ref, ref_stride, bh, &vsse, &vsum);  \
  185|  68.4k|    const int sum = variance_final_##max_pixel##_avx2(vsse, vsum, sse);       \
  186|  68.4k|    return *sse - (uint32_t)(((int64_t)sum * sum) >> bits);                   \
  187|  68.4k|  }
aom_variance64x64_avx2:
  209|   270k|      unsigned int *sse) {                                                    \
  210|   270k|    __m256i vsse = _mm256_setzero_si256();                                    \
  211|   270k|    __m256i vsum = _mm256_setzero_si256();                                    \
  212|   808k|    for (int i = 0; i < (bh / uh); i++) {                                     \
  ------------------
  |  Branch (212:21): [True: 538k, False: 270k]
  ------------------
  213|   538k|      __m256i vsum16;                                                         \
  214|   538k|      variance##bw##_avx2(src, src_stride, ref, ref_stride, uh, &vsse,        \
  215|   538k|                          &vsum16);                                           \
  216|   538k|      vsum = _mm256_add_epi32(vsum, sum_to_32bit_avx2(vsum16));               \
  217|   538k|      src += uh * src_stride;                                                 \
  218|   538k|      ref += uh * ref_stride;                                                 \
  219|   538k|    }                                                                         \
  220|   270k|    const __m128i vsum_128 = mm256_add_hi_lo_epi32(vsum);                     \
  221|   270k|    const int sum = variance_final_from_32bit_sum_avx2(vsse, vsum_128, sse);  \
  222|   270k|    return *sse - (unsigned int)(((int64_t)sum * sum) >> bits);               \
  223|   270k|  }
aom_get_var_sse_sum_8x8_quad_avx2:
 1321|   261k|                                       uint32_t *var8x8) {
 1322|   261k|  get_var_sse_sum_8x8_quad_avx2(src_ptr, source_stride, ref_ptr, ref_stride, 8,
 1323|   261k|                                sse8x8, sum8x8, tot_sse, tot_sum, var8x8);
 1324|   261k|}
aom_get_var_sse_sum_16x16_dual_avx2:
 1331|  1.20k|                                         uint32_t *var16x16) {
 1332|  1.20k|  get_var_sse_sum_16x16_dual_avx2(src_ptr, source_stride, ref_ptr, ref_stride,
 1333|  1.20k|                                  16, sse16x16, tot_sse, tot_sum, var16x16);
 1334|  1.20k|}
variance_avx2.c:variance16_avx2:
  125|  4.06M|                                   __m256i *const vsum) {
  126|  4.06M|  *vsum = _mm256_setzero_si256();
  127|       |
  128|  35.3M|  for (int i = 0; i < h; i += 2) {
  ------------------
  |  Branch (128:19): [True: 31.2M, False: 4.06M]
  ------------------
  129|  31.2M|    variance16_kernel_avx2(src, src_stride, ref, ref_stride, vsse, vsum);
  130|  31.2M|    src += 2 * src_stride;
  131|  31.2M|    ref += 2 * ref_stride;
  132|  31.2M|  }
  133|  4.06M|}
variance_avx2.c:variance16_kernel_avx2:
  103|  31.3M|    const int ref_stride, __m256i *const sse, __m256i *const sum) {
  104|  31.3M|  const __m128i s0 = _mm_loadu_si128((__m128i const *)(src + 0 * src_stride));
  105|  31.3M|  const __m128i s1 = _mm_loadu_si128((__m128i const *)(src + 1 * src_stride));
  106|  31.3M|  const __m128i r0 = _mm_loadu_si128((__m128i const *)(ref + 0 * ref_stride));
  107|  31.3M|  const __m128i r1 = _mm_loadu_si128((__m128i const *)(ref + 1 * ref_stride));
  108|  31.3M|  const __m256i s = _mm256_inserti128_si256(_mm256_castsi128_si256(s0), s1, 1);
  109|       |  const __m256i r = _mm256_inserti128_si256(_mm256_castsi128_si256(r0), r1, 1);
  110|  31.3M|  variance_kernel_avx2(s, r, sse, sum);
  111|  31.3M|}
variance_avx2.c:variance_kernel_avx2:
   31|   102M|                                        __m256i *const sum) {
   32|   102M|  const __m256i adj_sub = _mm256_set1_epi16((short)0xff01);  // (1,-1)
   33|       |
   34|       |  // unpack into pairs of source and reference values
   35|   102M|  const __m256i src_ref0 = _mm256_unpacklo_epi8(src, ref);
   36|   102M|  const __m256i src_ref1 = _mm256_unpackhi_epi8(src, ref);
   37|       |
   38|       |  // subtract adjacent elements using src*1 + ref*-1
   39|   102M|  const __m256i diff0 = _mm256_maddubs_epi16(src_ref0, adj_sub);
   40|   102M|  const __m256i diff1 = _mm256_maddubs_epi16(src_ref1, adj_sub);
   41|   102M|  const __m256i madd0 = _mm256_madd_epi16(diff0, diff0);
   42|   102M|  const __m256i madd1 = _mm256_madd_epi16(diff1, diff1);
   43|       |
   44|       |  // add to the running totals
   45|   102M|  *sum = _mm256_add_epi16(*sum, _mm256_add_epi16(diff0, diff1));
   46|   102M|  *sse = _mm256_add_epi32(*sse, _mm256_add_epi32(madd0, madd1));
   47|   102M|}
variance_avx2.c:variance_final_512_avx2:
   67|  4.21M|                                          unsigned int *const sse) {
   68|       |  // extract the low lane and add it to the high lane
   69|  4.21M|  const __m128i vsum_128 = mm256_add_hi_lo_epi16(vsum);
   70|       |  const __m128i vsum_64 = _mm_add_epi16(vsum_128, _mm_srli_si128(vsum_128, 8));
   71|  4.21M|  const __m128i sum_int32 = _mm_cvtepi16_epi32(vsum_64);
   72|  4.21M|  return variance_final_from_32bit_sum_avx2(vsse, sum_int32, sse);
   73|  4.21M|}
variance_avx2.c:mm256_add_hi_lo_epi16:
   19|  4.99M|static inline __m128i mm256_add_hi_lo_epi16(const __m256i val) {
   20|  4.99M|  return _mm_add_epi16(_mm256_castsi256_si128(val),
   21|       |                       _mm256_extractf128_si256(val, 1));
   22|  4.99M|}
variance_avx2.c:variance32_avx2:
  138|  1.00M|                                   __m256i *const vsum) {
  139|  1.00M|  *vsum = _mm256_setzero_si256();
  140|       |
  141|  33.3M|  for (int i = 0; i < h; i++) {
  ------------------
  |  Branch (141:19): [True: 32.3M, False: 1.00M]
  ------------------
  142|  32.3M|    variance32_kernel_avx2(src, ref, vsse, vsum);
  143|  32.3M|    src += src_stride;
  144|  32.3M|    ref += ref_stride;
  145|  32.3M|  }
  146|  1.00M|}
variance_avx2.c:variance32_kernel_avx2:
  116|  71.0M|                                          __m256i *const sum) {
  117|  71.0M|  const __m256i s = _mm256_loadu_si256((__m256i const *)(src));
  118|  71.0M|  const __m256i r = _mm256_loadu_si256((__m256i const *)(ref));
  119|  71.0M|  variance_kernel_avx2(s, r, sse, sum);
  120|  71.0M|}
variance_avx2.c:variance_final_1024_avx2:
   77|   784k|                                           unsigned int *const sse) {
   78|       |  // extract the low lane and add it to the high lane
   79|   784k|  const __m128i vsum_128 = mm256_add_hi_lo_epi16(vsum);
   80|   784k|  const __m128i vsum_64 =
   81|   784k|      _mm_add_epi32(_mm_cvtepi16_epi32(vsum_128),
   82|       |                    _mm_cvtepi16_epi32(_mm_srli_si128(vsum_128, 8)));
   83|   784k|  return variance_final_from_32bit_sum_avx2(vsse, vsum_64, sse);
   84|   784k|}
variance_avx2.c:variance_final_2048_avx2:
   95|   146k|                                           unsigned int *const sse) {
   96|   146k|  vsum = sum_to_32bit_avx2(vsum);
   97|   146k|  const __m128i vsum_128 = mm256_add_hi_lo_epi32(vsum);
   98|   146k|  return variance_final_from_32bit_sum_avx2(vsse, vsum_128, sse);
   99|   146k|}
variance_avx2.c:variance64_avx2:
  151|   606k|                                   __m256i *const vsum) {
  152|   606k|  *vsum = _mm256_setzero_si256();
  153|       |
  154|  20.0M|  for (int i = 0; i < h; i++) {
  ------------------
  |  Branch (154:19): [True: 19.4M, False: 606k]
  ------------------
  155|  19.4M|    variance32_kernel_avx2(src + 0, ref + 0, vsse, vsum);
  156|  19.4M|    variance32_kernel_avx2(src + 32, ref + 32, vsse, vsum);
  157|  19.4M|    src += src_stride;
  158|  19.4M|    ref += ref_stride;
  159|  19.4M|  }
  160|   606k|}
variance_avx2.c:sum_to_32bit_avx2:
   86|   684k|static inline __m256i sum_to_32bit_avx2(const __m256i sum) {
   87|   684k|  const __m256i sum_lo = _mm256_cvtepi16_epi32(_mm256_castsi256_si128(sum));
   88|   684k|  const __m256i sum_hi =
   89|       |      _mm256_cvtepi16_epi32(_mm256_extractf128_si256(sum, 1));
   90|   684k|  return _mm256_add_epi32(sum_lo, sum_hi);
   91|   684k|}
variance_avx2.c:mm256_add_hi_lo_epi32:
   24|  5.82M|static inline __m128i mm256_add_hi_lo_epi32(const __m256i val) {
   25|  5.82M|  return _mm_add_epi32(_mm256_castsi256_si128(val),
   26|       |                       _mm256_extractf128_si256(val, 1));
   27|  5.82M|}
variance_avx2.c:variance_final_from_32bit_sum_avx2:
   50|  5.40M|                                                     unsigned int *const sse) {
   51|       |  // extract the low lane and add it to the high lane
   52|  5.40M|  const __m128i sse_reg_128 = mm256_add_hi_lo_epi32(vsse);
   53|       |
   54|       |  // unpack sse and sum registers and add
   55|  5.40M|  const __m128i sse_sum_lo = _mm_unpacklo_epi32(sse_reg_128, vsum);
   56|  5.40M|  const __m128i sse_sum_hi = _mm_unpackhi_epi32(sse_reg_128, vsum);
   57|  5.40M|  const __m128i sse_sum = _mm_add_epi32(sse_sum_lo, sse_sum_hi);
   58|       |
   59|       |  // perform the final summation and extract the results
   60|  5.40M|  const __m128i res = _mm_add_epi32(sse_sum, _mm_srli_si128(sse_sum, 8));
   61|  5.40M|  *((int *)sse) = _mm_cvtsi128_si32(res);
   62|       |  return _mm_extract_epi32(res, 1);
   63|  5.40M|}
variance_avx2.c:get_var_sse_sum_8x8_quad_avx2:
  868|   261k|    unsigned int *tot_sse, int *tot_sum, uint32_t *var8x8) {
  869|   261k|  assert(h <= 128);  // May overflow for larger height.
  870|   261k|  __m256i sse_8x16[2], sum_8x16[2];
  871|   261k|  sum_8x16[0] = _mm256_setzero_si256();
  872|   261k|  sse_8x16[0] = _mm256_setzero_si256();
  873|   261k|  sum_8x16[1] = sum_8x16[0];
  874|   261k|  sse_8x16[1] = sse_8x16[0];
  875|   261k|  const __m256i set_one_minusone = _mm256_set1_epi16((short)0xff01);
  876|       |
  877|  2.35M|  for (int i = 0; i < h; i++) {
  ------------------
  |  Branch (877:19): [True: 2.08M, False: 261k]
  ------------------
  878|       |    // Process 8x32 block of one row.
  879|  2.08M|    calc_sum_sse_wd32_avx2(src, ref, set_one_minusone, sse_8x16, sum_8x16);
  880|  2.08M|    src += src_stride;
  881|  2.08M|    ref += ref_stride;
  882|  2.08M|  }
  883|       |
  884|   261k|  const __m256i sum_sse_order_add =
  885|   261k|      calc_sum_sse_order(sse_8x16, sum_8x16, tot_sse, tot_sum);
  886|       |
  887|       |  // s0 s1 s2 s3
  888|   261k|  _mm_storeu_si128((__m128i *)sse8x8,
  889|   261k|                   _mm256_castsi256_si128(sum_sse_order_add));
  890|       |  // d0 d1 d2 d3
  891|   261k|  const __m128i sum_temp8x8 = _mm256_extractf128_si256(sum_sse_order_add, 1);
  892|   261k|  _mm_storeu_si128((__m128i *)sum8x8, sum_temp8x8);
  893|       |
  894|       |  // (d0xd0 >> 6)=f0 (d1xd1 >> 6)=f1 (d2xd2 >> 6)=f2 (d3xd3 >> 6)=f3
  895|   261k|  const __m128i mull_results =
  896|   261k|      _mm_srli_epi32(_mm_mullo_epi32(sum_temp8x8, sum_temp8x8), 6);
  897|       |  // s0-f0=v0 s1-f1=v1 s2-f2=v2 s3-f3=v3
  898|   261k|  const __m128i variance_8x8 =
  899|   261k|      _mm_sub_epi32(_mm256_castsi256_si128(sum_sse_order_add), mull_results);
  900|       |  // v0 v1 v2 v3
  901|   261k|  _mm_storeu_si128((__m128i *)var8x8, variance_8x8);
  902|   261k|}
variance_avx2.c:calc_sum_sse_wd32_avx2:
  814|  2.10M|                                          __m256i sum_8x16[2]) {
  815|  2.10M|  const __m256i s00_256 = _mm256_loadu_si256((__m256i const *)(src));
  816|  2.10M|  const __m256i r00_256 = _mm256_loadu_si256((__m256i const *)(ref));
  817|       |
  818|  2.10M|  const __m256i u_low_256 = _mm256_unpacklo_epi8(s00_256, r00_256);
  819|  2.10M|  const __m256i u_high_256 = _mm256_unpackhi_epi8(s00_256, r00_256);
  820|       |
  821|  2.10M|  const __m256i diff0 = _mm256_maddubs_epi16(u_low_256, set_one_minusone);
  822|  2.10M|  const __m256i diff1 = _mm256_maddubs_epi16(u_high_256, set_one_minusone);
  823|       |
  824|  2.10M|  sse_8x16[0] = _mm256_add_epi32(sse_8x16[0], _mm256_madd_epi16(diff0, diff0));
  825|  2.10M|  sse_8x16[1] = _mm256_add_epi32(sse_8x16[1], _mm256_madd_epi16(diff1, diff1));
  826|  2.10M|  sum_8x16[0] = _mm256_add_epi16(sum_8x16[0], diff0);
  827|  2.10M|  sum_8x16[1] = _mm256_add_epi16(sum_8x16[1], diff1);
  828|  2.10M|}
variance_avx2.c:calc_sum_sse_order:
  831|   262k|                                         unsigned int *tot_sse, int *tot_sum) {
  832|       |  // s00 s01 s10 s11 s20 s21 s30 s31
  833|   262k|  const __m256i sse_results = _mm256_hadd_epi32(sse_hx16[0], sse_hx16[1]);
  834|       |  // d00 d01 d02 d03 | d10 d11 d12 d13 | d20 d21 d22 d23 | d30 d31 d32 d33
  835|   262k|  const __m256i sum_result_r0 = _mm256_hadd_epi16(sum_hx16[0], sum_hx16[1]);
  836|       |  // d00 d01 d10 d11 | d00 d02 d10 d11 | d20 d21 d30 d31 | d20 d21 d30 d31
  837|   262k|  const __m256i sum_result_1 = _mm256_hadd_epi16(sum_result_r0, sum_result_r0);
  838|       |  // d00 d01 d10 d11 d20 d21 d30 d31 | X
  839|   262k|  const __m256i sum_result_3 = _mm256_permute4x64_epi64(sum_result_1, 0x08);
  840|       |  // d00 d01 d10 d11 d20 d21 d30 d31
  841|   262k|  const __m256i sum_results =
  842|   262k|      _mm256_cvtepi16_epi32(_mm256_castsi256_si128(sum_result_3));
  843|       |
  844|       |  // Add sum & sse registers appropriately to get total sum & sse separately.
  845|       |  // s0 s1 d0 d1 s2 s3 d2 d3
  846|   262k|  const __m256i sum_sse_add = _mm256_hadd_epi32(sse_results, sum_results);
  847|       |  // s0 s1 s2 s3 d0 d1 d2 d3
  848|   262k|  const __m256i sum_sse_order_add = _mm256_permute4x64_epi64(sum_sse_add, 0xd8);
  849|       |  // s0+s1 s2+s3 s0+s1 s2+s3 d0+d1 d2+d3 d0+d1 d2+d3
  850|   262k|  const __m256i sum_sse_order_add_1 =
  851|   262k|      _mm256_hadd_epi32(sum_sse_order_add, sum_sse_order_add);
  852|       |  // s0 x x x | d0 x x x
  853|   262k|  const __m256i sum_sse_order_add_final =
  854|   262k|      _mm256_hadd_epi32(sum_sse_order_add_1, sum_sse_order_add_1);
  855|       |  // s0
  856|   262k|  const uint32_t first_value =
  857|   262k|      (uint32_t)_mm256_extract_epi32(sum_sse_order_add_final, 0);
  858|   262k|  *tot_sse += first_value;
  859|       |  // d0
  860|       |  const int second_value = _mm256_extract_epi32(sum_sse_order_add_final, 4);
  861|   262k|  *tot_sum += second_value;
  862|   262k|  return sum_sse_order_add;
  863|   262k|}
variance_avx2.c:get_var_sse_sum_16x16_dual_avx2:
  907|  1.20k|    unsigned int *tot_sse, int *tot_sum, uint32_t *var16x16) {
  908|  1.20k|  assert(h <= 128);  // May overflow for larger height.
  909|  1.20k|  __m256i sse_16x16[2], sum_16x16[2];
  910|  1.20k|  sum_16x16[0] = _mm256_setzero_si256();
  911|  1.20k|  sse_16x16[0] = _mm256_setzero_si256();
  912|  1.20k|  sum_16x16[1] = sum_16x16[0];
  913|  1.20k|  sse_16x16[1] = sse_16x16[0];
  914|  1.20k|  const __m256i set_one_minusone = _mm256_set1_epi16((short)0xff01);
  915|       |
  916|  20.4k|  for (int i = 0; i < h; i++) {
  ------------------
  |  Branch (916:19): [True: 19.2k, False: 1.20k]
  ------------------
  917|       |    // Process 16x32 block of one row.
  918|  19.2k|    calc_sum_sse_wd32_avx2(src, ref, set_one_minusone, sse_16x16, sum_16x16);
  919|  19.2k|    src += src_stride;
  920|  19.2k|    ref += ref_stride;
  921|  19.2k|  }
  922|       |
  923|  1.20k|  const __m256i sum_sse_order_add =
  924|  1.20k|      calc_sum_sse_order(sse_16x16, sum_16x16, tot_sse, tot_sum);
  925|       |
  926|  1.20k|  const __m256i sum_sse_order_add_1 =
  927|  1.20k|      _mm256_hadd_epi32(sum_sse_order_add, sum_sse_order_add);
  928|       |
  929|       |  // s0+s1 s2+s3 x x
  930|  1.20k|  _mm_storel_epi64((__m128i *)sse16x16,
  931|  1.20k|                   _mm256_castsi256_si128(sum_sse_order_add_1));
  932|       |
  933|       |  // d0+d1 d2+d3 x x
  934|  1.20k|  const __m128i sum_temp16x16 =
  935|  1.20k|      _mm256_extractf128_si256(sum_sse_order_add_1, 1);
  936|       |
  937|       |  // (d0xd0 >> 6)=f0 (d1xd1 >> 6)=f1 (d2xd2 >> 6)=f2 (d3xd3 >> 6)=f3
  938|  1.20k|  const __m128i mull_results =
  939|  1.20k|      _mm_srli_epi32(_mm_mullo_epi32(sum_temp16x16, sum_temp16x16), 8);
  940|       |
  941|       |  // s0-f0=v0 s1-f1=v1 s2-f2=v2 s3-f3=v3
  942|  1.20k|  const __m128i variance_16x16 =
  943|  1.20k|      _mm_sub_epi32(_mm256_castsi256_si128(sum_sse_order_add_1), mull_results);
  944|       |
  945|       |  // v0 v1 v2 v3
  946|  1.20k|  _mm_storel_epi64((__m128i *)var16x16, variance_16x16);
  947|  1.20k|}

aom_sub_pixel_variance32x64_avx2:
  508|    641|      const uint8_t *dst, int dst_stride, unsigned int *sse) {                 \
  509|    641|    const int sum = aom_sub_pixel_variance32x##height##_imp_avx2(              \
  510|    641|        src, src_stride, x_offset, y_offset, dst, dst_stride, sse);            \
  511|    641|    return *sse - (unsigned int)(((int64_t)sum * sum) >> (5 + log2height));    \
  512|    641|  }
aom_sub_pixel_variance32x32_avx2:
  508|   182k|      const uint8_t *dst, int dst_stride, unsigned int *sse) {                 \
  509|   182k|    const int sum = aom_sub_pixel_variance32x##height##_imp_avx2(              \
  510|   182k|        src, src_stride, x_offset, y_offset, dst, dst_stride, sse);            \
  511|   182k|    return *sse - (unsigned int)(((int64_t)sum * sum) >> (5 + log2height));    \
  512|   182k|  }
aom_sub_pixel_variance32x16_avx2:
  508|  9.04k|      const uint8_t *dst, int dst_stride, unsigned int *sse) {                 \
  509|  9.04k|    const int sum = aom_sub_pixel_variance32x##height##_imp_avx2(              \
  510|  9.04k|        src, src_stride, x_offset, y_offset, dst, dst_stride, sse);            \
  511|  9.04k|    return *sse - (unsigned int)(((int64_t)sum * sum) >> (5 + log2height));    \
  512|  9.04k|  }
aom_sub_pixel_variance64x64_avx2:
  521|  12.8k|      const uint8_t *dst, int dst_stride, unsigned int *sse_ptr) {        \
  522|  12.8k|    unsigned int sse = 0;                                                 \
  523|  12.8k|    int se = 0;                                                           \
  524|  38.5k|    for (int i = 0; i < (w / wf); ++i) {                                  \
  ------------------
  |  Branch (524:21): [True: 25.6k, False: 12.8k]
  ------------------
  525|  25.6k|      const uint8_t *src_ptr = src;                                       \
  526|  25.6k|      const uint8_t *dst_ptr = dst;                                       \
  527|  51.3k|      for (int j = 0; j < (h / hf); ++j) {                                \
  ------------------
  |  Branch (527:23): [True: 25.6k, False: 25.6k]
  ------------------
  528|  25.6k|        unsigned int sse2;                                                \
  529|  25.6k|        const int se2 = aom_sub_pixel_variance##wf##x##hf##_imp_avx2(     \
  530|  25.6k|            src_ptr, src_stride, x_offset, y_offset, dst_ptr, dst_stride, \
  531|  25.6k|            &sse2);                                                       \
  532|  25.6k|        dst_ptr += hf * dst_stride;                                       \
  533|  25.6k|        src_ptr += hf * src_stride;                                       \
  534|  25.6k|        se += se2;                                                        \
  535|  25.6k|        sse += sse2;                                                      \
  536|  25.6k|      }                                                                   \
  537|  25.6k|      src += wf;                                                          \
  538|  25.6k|      dst += wf;                                                          \
  539|  25.6k|    }                                                                     \
  540|  12.8k|    *sse_ptr = sse;                                                       \
  541|  12.8k|    return sse - (unsigned int)(((int64_t)se * se) >> (wlog2 + hlog2));   \
  542|  12.8k|  }
aom_sub_pixel_variance64x32_avx2:
  521|    118|      const uint8_t *dst, int dst_stride, unsigned int *sse_ptr) {        \
  522|    118|    unsigned int sse = 0;                                                 \
  523|    118|    int se = 0;                                                           \
  524|    354|    for (int i = 0; i < (w / wf); ++i) {                                  \
  ------------------
  |  Branch (524:21): [True: 236, False: 118]
  ------------------
  525|    236|      const uint8_t *src_ptr = src;                                       \
  526|    236|      const uint8_t *dst_ptr = dst;                                       \
  527|    472|      for (int j = 0; j < (h / hf); ++j) {                                \
  ------------------
  |  Branch (527:23): [True: 236, False: 236]
  ------------------
  528|    236|        unsigned int sse2;                                                \
  529|    236|        const int se2 = aom_sub_pixel_variance##wf##x##hf##_imp_avx2(     \
  530|    236|            src_ptr, src_stride, x_offset, y_offset, dst_ptr, dst_stride, \
  531|    236|            &sse2);                                                       \
  532|    236|        dst_ptr += hf * dst_stride;                                       \
  533|    236|        src_ptr += hf * src_stride;                                       \
  534|    236|        se += se2;                                                        \
  535|    236|        sse += sse2;                                                      \
  536|    236|      }                                                                   \
  537|    236|      src += wf;                                                          \
  538|    236|      dst += wf;                                                          \
  539|    236|    }                                                                     \
  540|    118|    *sse_ptr = sse;                                                       \
  541|    118|    return sse - (unsigned int)(((int64_t)se * se) >> (wlog2 + hlog2));   \
  542|    118|  }

variance_sse2.c:load8_8to16_sse2:
   46|  1.11G|static inline __m128i load8_8to16_sse2(const uint8_t *const p) {
   47|  1.11G|  const __m128i p0 = _mm_loadl_epi64((const __m128i *)p);
   48|  1.11G|  return _mm_unpacklo_epi8(p0, _mm_setzero_si128());
   49|  1.11G|}
variance_sse2.c:variance_final_128_pel_sse2:
   84|  94.6M|                                               int *const sum) {
   85|  94.6M|  *sse = add32x4_sse2(vsse);
   86|       |
   87|  94.6M|  vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 8));
   88|  94.6M|  vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 4));
   89|  94.6M|  vsum = _mm_add_epi16(vsum, _mm_srli_si128(vsum, 2));
   90|       |  *sum = (int16_t)_mm_extract_epi16(vsum, 0);
   91|  94.6M|}
variance_sse2.c:variance4_sse2:
  130|  25.9M|                                  __m128i *const sum) {
  131|  25.9M|  assert(h <= 256);  // May overflow for larger height.
  132|  25.9M|  *sum = _mm_setzero_si128();
  133|       |
  134|  87.3M|  for (int i = 0; i < h; i += 2) {
  ------------------
  |  Branch (134:19): [True: 61.3M, False: 25.9M]
  ------------------
  135|  61.3M|    const __m128i s = load4x2_sse2(src, src_stride);
  136|  61.3M|    const __m128i r = load4x2_sse2(ref, ref_stride);
  137|       |
  138|  61.3M|    variance_kernel_sse2(s, r, sse, sum);
  139|  61.3M|    src += 2 * src_stride;
  140|  61.3M|    ref += 2 * ref_stride;
  141|  61.3M|  }
  142|  25.9M|}
variance_sse2.c:load4x2_sse2:
   40|   122M|static inline __m128i load4x2_sse2(const uint8_t *const p, const int stride) {
   41|   122M|  const __m128i p0 = _mm_cvtsi32_si128(loadu_int32(p + 0 * stride));
   42|   122M|  const __m128i p1 = _mm_cvtsi32_si128(loadu_int32(p + 1 * stride));
   43|   122M|  return _mm_unpacklo_epi8(_mm_unpacklo_epi32(p0, p1), _mm_setzero_si128());
   44|   122M|}
variance_sse2.c:variance_kernel_sse2:
   73|   616M|                                        __m128i *const sum) {
   74|   616M|  const __m128i diff = _mm_sub_epi16(src, ref);
   75|   616M|  *sse = _mm_add_epi32(*sse, _mm_madd_epi16(diff, diff));
   76|   616M|  *sum = _mm_add_epi16(*sum, diff);
   77|   616M|}
variance_sse2.c:variance8_sse2:
  147|  69.2M|                                  __m128i *const sum) {
  148|  69.2M|  assert(h <= 128);  // May overflow for larger height.
  149|  69.2M|  *sum = _mm_setzero_si128();
  150|  69.2M|  *sse = _mm_setzero_si128();
  151|   627M|  for (int i = 0; i < h; i++) {
  ------------------
  |  Branch (151:19): [True: 558M, False: 69.2M]
  ------------------
  152|   558M|    const __m128i s = load8_8to16_sse2(src);
  153|   558M|    const __m128i r = load8_8to16_sse2(ref);
  154|       |
  155|   558M|    variance_kernel_sse2(s, r, sse, sum);
  156|   558M|    src += src_stride;
  157|   558M|    ref += ref_stride;
  158|   558M|  }
  159|  69.2M|}
variance_sse2.c:add32x4_sse2:
   58|  94.5M|static inline unsigned int add32x4_sse2(__m128i val) {
   59|  94.5M|  val = _mm_add_epi32(val, _mm_srli_si128(val, 8));
   60|       |  val = _mm_add_epi32(val, _mm_srli_si128(val, 4));
   61|  94.5M|  return (unsigned int)_mm_cvtsi128_si32(val);
   62|  94.5M|}

aom_memalign:
   55|  31.9M|void *aom_memalign(size_t align, size_t size) {
   56|  31.9M|  void *x = NULL;
   57|  31.9M|  if (!check_size_argument_overflow(1, size, align)) return NULL;
  ------------------
  |  Branch (57:7): [True: 0, False: 31.9M]
  ------------------
   58|  31.9M|  const size_t aligned_size = size + GetAllocationPaddingSize(align);
   59|  31.9M|  void *const addr = malloc(aligned_size);
   60|  31.9M|  if (addr) {
  ------------------
  |  Branch (60:7): [True: 31.9M, False: 18.4E]
  ------------------
   61|  31.9M|    x = aom_align_addr((unsigned char *)addr + ADDRESS_STORAGE_SIZE, align);
  ------------------
  |  |   51|  31.9M|  (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1))
  ------------------
   62|  31.9M|    SetActualMallocAddress(x, addr);
   63|  31.9M|  }
   64|  31.9M|  return x;
   65|  31.9M|}
aom_malloc:
   67|  15.5M|void *aom_malloc(size_t size) { return aom_memalign(DEFAULT_ALIGNMENT, size); }
  ------------------
  |  |   25|  15.5M|#define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */
  ------------------
aom_calloc:
   69|  12.1M|void *aom_calloc(size_t num, size_t size) {
   70|  12.1M|  if (!check_size_argument_overflow(num, size, DEFAULT_ALIGNMENT)) return NULL;
  ------------------
  |  |   25|  12.1M|#define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */
  ------------------
  |  Branch (70:7): [True: 0, False: 12.1M]
  ------------------
   71|  12.1M|  const size_t total_size = num * size;
   72|  12.1M|  void *const x = aom_malloc(total_size);
   73|  12.1M|  if (x) memset(x, 0, total_size);
  ------------------
  |  Branch (73:7): [True: 12.1M, False: 18.4E]
  ------------------
   74|  12.1M|  return x;
   75|  12.1M|}
aom_free:
   77|  41.9M|void aom_free(void *memblk) {
   78|  41.9M|  if (memblk) {
  ------------------
  |  Branch (78:7): [True: 31.6M, False: 10.3M]
  ------------------
   79|  31.6M|    void *addr = GetActualMallocAddress(memblk);
   80|  31.6M|    free(addr);
   81|  31.6M|  }
   82|  41.9M|}
aom_mem.c:check_size_argument_overflow:
   27|  44.1M|                                        size_t align) {
   28|  44.1M|  if (nmemb == 0) return 1;
  ------------------
  |  Branch (28:7): [True: 0, False: 44.1M]
  ------------------
   29|  44.1M|  const size_t alloc_padding = GetAllocationPaddingSize(align);
   30|  44.1M|#if defined(AOM_MAX_ALLOCABLE_MEMORY)
   31|  44.1M|  assert(AOM_MAX_ALLOCABLE_MEMORY >= alloc_padding);
   32|  44.1M|  assert(AOM_MAX_ALLOCABLE_MEMORY <= SIZE_MAX);
   33|  44.1M|  if (size > (AOM_MAX_ALLOCABLE_MEMORY - alloc_padding) / nmemb) return 0;
  ------------------
  |  |   30|  44.1M|#define AOM_MAX_ALLOCABLE_MEMORY 8589934592  // 8 GB
  ------------------
  |  Branch (33:7): [True: 0, False: 44.1M]
  ------------------
   34|       |#else
   35|       |  if (size > (SIZE_MAX - alloc_padding) / nmemb) return 0;
   36|       |#endif
   37|  44.1M|  return 1;
   38|  44.1M|}
aom_mem.c:GetAllocationPaddingSize:
   19|  76.0M|static size_t GetAllocationPaddingSize(size_t align) {
   20|  76.0M|  assert(align > 0);
   21|  76.0M|  assert(align < SIZE_MAX - ADDRESS_STORAGE_SIZE);
   22|  76.0M|  return align - 1 + ADDRESS_STORAGE_SIZE;
  ------------------
  |  |   17|  76.0M|#define ADDRESS_STORAGE_SIZE sizeof(size_t)
  ------------------
   23|  76.0M|}
aom_mem.c:SetActualMallocAddress:
   45|  31.9M|                                   const void *const malloc_addr) {
   46|  31.9M|  size_t *const malloc_addr_location = GetMallocAddressLocation(mem);
   47|  31.9M|  *malloc_addr_location = (size_t)malloc_addr;
   48|  31.9M|}
aom_mem.c:GetMallocAddressLocation:
   40|  63.6M|static size_t *GetMallocAddressLocation(void *const mem) {
   41|  63.6M|  return ((size_t *)mem) - 1;
   42|  63.6M|}
aom_mem.c:GetActualMallocAddress:
   50|  31.6M|static void *GetActualMallocAddress(void *const mem) {
   51|  31.6M|  const size_t *const malloc_addr_location = GetMallocAddressLocation(mem);
   52|  31.6M|  return (void *)(*malloc_addr_location);
   53|  31.6M|}

decodeframe.c:aom_memset16:
   42|   340k|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|   340k|  size_t i;
   44|   340k|  uint16_t *dest16 = (uint16_t *)dest;
   45|  2.07M|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 1.72M, False: 340k]
  ------------------
   46|   340k|  return dest;
   47|   340k|}
encodemb.c:aom_memset16:
   42|  28.5M|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|  28.5M|  size_t i;
   44|  28.5M|  uint16_t *dest16 = (uint16_t *)dest;
   45|   178M|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 150M, False: 28.5M]
  ------------------
   46|  28.5M|  return dest;
   47|  28.5M|}
intrapred.c:aom_memset16:
   42|   129k|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|   129k|  size_t i;
   44|   129k|  uint16_t *dest16 = (uint16_t *)dest;
   45|  6.09M|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 5.96M, False: 129k]
  ------------------
   46|   129k|  return dest;
   47|   129k|}
yv12extend.c:aom_memset16:
   42|  14.3M|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|  14.3M|  size_t i;
   44|  14.3M|  uint16_t *dest16 = (uint16_t *)dest;
   45|  3.22G|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 3.21G, False: 14.3M]
  ------------------
   46|  14.3M|  return dest;
   47|  14.3M|}
reconintra.c:aom_memset16:
   42|  71.7M|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|  71.7M|  size_t i;
   44|  71.7M|  uint16_t *dest16 = (uint16_t *)dest;
   45|  7.98G|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 7.91G, False: 71.7M]
  ------------------
   46|  71.7M|  return dest;
   47|  71.7M|}
restoration.c:aom_memset16:
   42|  37.7k|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|  37.7k|  size_t i;
   44|  37.7k|  uint16_t *dest16 = (uint16_t *)dest;
   45|   188k|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 150k, False: 37.7k]
  ------------------
   46|  37.7k|  return dest;
   47|  37.7k|}
extend.c:aom_memset16:
   42|  3.28M|static inline void *aom_memset16(void *dest, int val, size_t length) {
   43|  3.28M|  size_t i;
   44|  3.28M|  uint16_t *dest16 = (uint16_t *)dest;
   45|   259M|  for (i = 0; i < length; i++) *dest16++ = (uint16_t)val;
  ------------------
  |  Branch (45:15): [True: 256M, False: 3.28M]
  ------------------
   46|  3.28M|  return dest;
   47|  3.28M|}

ratectrl.c:aom_once:
   65|  18.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  18.4k|  pthread_once(&lock, func);
   68|  18.4k|}
rd.c:aom_once:
   65|  18.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  18.4k|  pthread_once(&lock, func);
   68|  18.4k|}
aom_dsp_rtcd.c:aom_once:
   65|  25.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  25.4k|  pthread_once(&lock, func);
   68|  25.4k|}
aom_scale_rtcd.c:aom_once:
   65|  25.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  25.4k|  pthread_once(&lock, func);
   68|  25.4k|}
av1_rtcd.c:aom_once:
   65|  25.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  25.4k|  pthread_once(&lock, func);
   68|  25.4k|}
reconintra.c:aom_once:
   65|  25.4k|static void aom_once(void (*func)(void)) {
   66|       |  static pthread_once_t lock = PTHREAD_ONCE_INIT;
   67|  25.4k|  pthread_once(&lock, func);
   68|  25.4k|}

decodemv.c:aom_ceil_log2:
   74|  78.7k|static inline int aom_ceil_log2(int n) {
   75|  78.7k|  if (n < 2) return 0;
  ------------------
  |  Branch (75:7): [True: 6.57k, False: 72.1k]
  ------------------
   76|  72.1k|  return get_msb(n - 1) + 1;
   77|  78.7k|}
decodemv.c:get_msb:
   42|  72.2k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  72.2k|  return 31 ^ __builtin_clz(n);
   45|  72.2k|}
detokenize.c:get_msb:
   42|  25.3k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  25.3k|  return 31 ^ __builtin_clz(n);
   45|  25.3k|}
av1_quantize.c:get_msb:
   42|  50.2M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  50.2M|  return 31 ^ __builtin_clz(n);
   45|  50.2M|}
bitstream.c:get_msb:
   42|   411k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   411k|  return 31 ^ __builtin_clz(n);
   45|   411k|}
bitstream.c:aom_ceil_log2:
   74|   307k|static inline int aom_ceil_log2(int n) {
   75|   307k|  if (n < 2) return 0;
  ------------------
  |  Branch (75:7): [True: 18.3k, False: 289k]
  ------------------
   76|   289k|  return get_msb(n - 1) + 1;
   77|   307k|}
encodemv.c:get_msb:
   42|   626k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   626k|  return 31 ^ __builtin_clz(n);
   45|   626k|}
encoder.c:get_msb:
   42|   311k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   311k|  return 31 ^ __builtin_clz(n);
   45|   311k|}
palette.c:aom_ceil_log2:
   74|  5.69M|static inline int aom_ceil_log2(int n) {
   75|  5.69M|  if (n < 2) return 0;
  ------------------
  |  Branch (75:7): [True: 260k, False: 5.43M]
  ------------------
   76|  5.43M|  return get_msb(n - 1) + 1;
   77|  5.69M|}
palette.c:get_msb:
   42|  6.26M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  6.26M|  return 31 ^ __builtin_clz(n);
   45|  6.26M|}
partition_search.c:get_msb:
   42|   304k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   304k|  return 31 ^ __builtin_clz(n);
   45|   304k|}
pickcdef.c:get_msb:
   42|  42.1k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  42.1k|  return 31 ^ __builtin_clz(n);
   45|  42.1k|}
rd.c:get_msb:
   42|  4.49M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  4.49M|  return 31 ^ __builtin_clz(n);
   45|  4.49M|}
rdopt.c:get_msb:
   42|  30.0k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  30.0k|  return 31 ^ __builtin_clz(n);
   45|  30.0k|}
nonrd_opt.c:get_msb:
   42|  6.04M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  6.04M|  return 31 ^ __builtin_clz(n);
   45|  6.04M|}
txb_rdopt.c:get_msb:
   42|   292M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   292M|  return 31 ^ __builtin_clz(n);
   45|   292M|}
intra_mode_search.c:get_msb:
   42|  4.47k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  4.47k|  return 31 ^ __builtin_clz(n);
   45|  4.47k|}
binary_codes_reader.c:get_msb:
   42|  1.69k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  1.69k|  return 31 ^ __builtin_clz(n);
   45|  1.69k|}
entdec.c:get_msb:
   42|   134M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   134M|  return 31 ^ __builtin_clz(n);
   45|   134M|}
entenc.c:get_msb:
   42|   398M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   398M|  return 31 ^ __builtin_clz(n);
   45|   398M|}
pyramid.c:get_msb:
   42|   369k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   369k|  return 31 ^ __builtin_clz(n);
   45|   369k|}
binary_codes_writer.c:get_msb:
   42|  40.0k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  40.0k|  return 31 ^ __builtin_clz(n);
   45|  40.0k|}
highbd_variance_avx2.c:get_msb:
   42|   104k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   104k|  return 31 ^ __builtin_clz(n);
   45|   104k|}
cdef_block.c:get_msb:
   42|  12.3M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  12.3M|  return 31 ^ __builtin_clz(n);
   45|  12.3M|}
warped_motion.c:get_msb:
   42|   434k|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   434k|  return 31 ^ __builtin_clz(n);
   45|   434k|}
cost.c:get_msb:
   42|   906M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|   906M|  return 31 ^ __builtin_clz(n);
   45|   906M|}
cdef_block_avx2.c:get_msb:
   42|  36.8M|static inline int get_msb(unsigned int n) {
   43|       |  assert(n != 0);
   44|  36.8M|  return 31 ^ __builtin_clz(n);
   45|  36.8M|}

decodeframe.c:mem_get_le16_as_int:
  102|  11.5k|static unsigned MEM_VALUE_T mem_get_le16(const void *vmem) {
  103|  11.5k|  unsigned MEM_VALUE_T val;
  104|  11.5k|  const MAU_T *mem = (const MAU_T *)vmem;
  105|       |
  106|  11.5k|  val = mem[1] << 8;
  107|  11.5k|  val |= mem[0];
  108|  11.5k|  return val;
  109|  11.5k|}
decodeframe.c:mem_get_le24_as_int:
  113|      1|static unsigned MEM_VALUE_T mem_get_le24(const void *vmem) {
  114|      1|  unsigned MEM_VALUE_T val;
  115|      1|  const MAU_T *mem = (const MAU_T *)vmem;
  116|       |
  117|      1|  val = mem[2] << 16;
  118|      1|  val |= mem[1] << 8;
  119|      1|  val |= mem[0];
  120|      1|  return val;
  121|      1|}
bitstream.c:mem_put_le32_as_int:
  219|  44.0k|static inline void mem_put_le32(void *vmem, MEM_VALUE_T val) {
  220|  44.0k|  MAU_T *mem = (MAU_T *)vmem;
  ------------------
  |  |   40|  44.0k|#define MAU_T unsigned char
  ------------------
  221|       |
  222|  44.0k|  mem[0] = (MAU_T)((val >>  0) & 0xff);
  223|  44.0k|  mem[1] = (MAU_T)((val >>  8) & 0xff);
  224|  44.0k|  mem[2] = (MAU_T)((val >> 16) & 0xff);
  225|  44.0k|  mem[3] = (MAU_T)((val >> 24) & 0xff);
  226|  44.0k|}
bitstream.c:mem_get_le32_as_int:
  125|  44.0k|static unsigned MEM_VALUE_T mem_get_le32(const void *vmem) {
  126|  44.0k|  unsigned MEM_VALUE_T val;
  127|  44.0k|  const MAU_T *mem = (const MAU_T *)vmem;
  128|       |
  129|  44.0k|  val = ((unsigned MEM_VALUE_T)mem[3]) << 24;
  130|  44.0k|  val |= mem[2] << 16;
  131|  44.0k|  val |= mem[1] << 8;
  132|  44.0k|  val |= mem[0];
  133|  44.0k|  return val;
  134|  44.0k|}
bitstream.c:mem_put_le16_as_int:
  200|  29.6k|static inline void mem_put_le16(void *vmem, MEM_VALUE_T val) {
  201|  29.6k|  MAU_T *mem = (MAU_T *)vmem;
  ------------------
  |  |   40|  29.6k|#define MAU_T unsigned char
  ------------------
  202|       |
  203|  29.6k|  mem[0] = (MAU_T)((val >> 0) & 0xff);
  204|  29.6k|  mem[1] = (MAU_T)((val >> 8) & 0xff);
  205|  29.6k|}
bitstream.c:mem_put_le24_as_int:
  209|      1|static inline void mem_put_le24(void *vmem, MEM_VALUE_T val) {
  210|      1|  MAU_T *mem = (MAU_T *)vmem;
  ------------------
  |  |   40|      1|#define MAU_T unsigned char
  ------------------
  211|       |
  212|      1|  mem[0] = (MAU_T)((val >>  0) & 0xff);
  213|      1|  mem[1] = (MAU_T)((val >>  8) & 0xff);
  214|      1|  mem[2] = (MAU_T)((val >> 16) & 0xff);
  215|      1|}

aom_encoder.c:x87_set_double_precision:
  403|  92.0k|static inline unsigned int x87_set_double_precision(void) {
  404|  92.0k|  unsigned int mode = x87_get_control_word();
  405|       |  // Intel 64 and IA-32 Architectures Developer's Manual: Vol. 1
  406|       |  // https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-1-manual.pdf
  407|       |  // 8.1.5.2 Precision Control Field
  408|       |  // Bits 8 and 9 (0x300) of the x87 FPU Control Word ("Precision Control")
  409|       |  // determine the number of bits used in floating point calculations. To match
  410|       |  // later SSE instructions restrict x87 operations to Double Precision (0x200).
  411|       |  // Precision                     PC Field
  412|       |  // Single Precision (24-Bits)    00B
  413|       |  // Reserved                      01B
  414|       |  // Double Precision (53-Bits)    10B
  415|       |  // Extended Precision (64-Bits)  11B
  416|  92.0k|  x87_set_control_word((mode & ~0x300u) | 0x200u);
  417|  92.0k|  return mode;
  418|  92.0k|}
aom_encoder.c:x87_get_control_word:
  372|  92.0k|static unsigned short x87_get_control_word(void) {
  373|  92.0k|  unsigned short mode;
  374|  92.0k|  __asm__ __volatile__("fstcw %0\n\t" : "=m"(*&mode) :);
  375|  92.0k|  return mode;
  376|  92.0k|}
aom_encoder.c:x87_set_control_word:
  369|   184k|static void x87_set_control_word(unsigned short mode) {
  370|   184k|  __asm__ __volatile__("fldcw %0" : : "m"(*&mode));
  371|   184k|}
aom_dsp_rtcd.c:x86_simd_caps:
  198|      1|static inline int x86_simd_caps(void) {
  199|      1|  unsigned int flags = 0;
  200|      1|  unsigned int mask = ~0u;
  201|      1|  unsigned int max_cpuid_val, reg_eax, reg_ebx, reg_ecx, reg_edx;
  202|      1|  char *env;
  203|       |
  204|       |  /* See if the CPU capabilities are being overridden by the environment */
  205|      1|  env = getenv("AOM_SIMD_CAPS");
  206|      1|  if (env && *env) return (int)strtol(env, NULL, 0);
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  |  Branch (206:14): [True: 0, False: 0]
  ------------------
  207|       |
  208|      1|  env = getenv("AOM_SIMD_CAPS_MASK");
  209|      1|  if (env && *env) mask = (unsigned int)strtoul(env, NULL, 0);
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  |  Branch (209:14): [True: 0, False: 0]
  ------------------
  210|       |
  211|       |  /* Ensure that the CPUID instruction supports extended features */
  212|      1|  cpuid(0, 0, max_cpuid_val, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  213|       |
  214|      1|  if (max_cpuid_val < 1) return 0;
  ------------------
  |  Branch (214:7): [True: 0, False: 1]
  ------------------
  215|       |
  216|       |  /* Get the standard feature flags */
  217|      1|  cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  218|       |
  219|      1|  flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  161|      1|#define HAS_MMX 0x01
  ------------------
  220|      1|  flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  162|      1|#define HAS_SSE 0x02
  ------------------
  221|      1|  flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  163|      1|#define HAS_SSE2 0x04
  ------------------
  222|      1|  flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  164|      1|#define HAS_SSE3 0x08
  ------------------
  223|      1|  flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  224|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  225|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  169|      1|#define HAS_SSE4_2 0x100
  ------------------
  226|       |
  227|       |  // bits 27 (OSXSAVE) & 28 (256-bit AVX)
  228|      1|  if (FEATURE_SET(reg_ecx, AVX)) {
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  229|       |    // Check for OS-support of YMM state. Necessary for AVX and AVX2.
  230|      1|    if ((xgetbv() & 0x6) == 0x6) {
  ------------------
  |  Branch (230:9): [True: 1, False: 0]
  ------------------
  231|      1|      flags |= HAS_AVX;
  ------------------
  |  |  167|      1|#define HAS_AVX 0x40
  ------------------
  232|      1|      if (max_cpuid_val >= 7) {
  ------------------
  |  Branch (232:11): [True: 1, False: 0]
  ------------------
  233|       |        /* Get the leaf 7 feature flags. Needed to check for AVX2 support */
  234|      1|        cpuid(7, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  235|      1|        flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                      flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  236|       |        // Check for OS-support of ZMM and YMM state. Necessary for AVX512.
  237|       |        // Only set HAS_AVX512 flag if AVX512_DL feature are supported.
  238|       |        // Older AVX512 implementations (such as Skylake) have turbo curves that
  239|       |        // are currently problematic for mixed AVX512/AVX2 code
  240|      1|        if ((xgetbv() & 0xe6) == 0xe6) {
  ------------------
  |  Branch (240:13): [True: 0, False: 1]
  ------------------
  241|      0|          flags |=
  242|      0|              FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                            FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  243|      0|                  ? HAS_AVX512
  ------------------
  |  |  170|      0|#define HAS_AVX512 0x200
  ------------------
  244|      0|                  : 0;
  245|      0|        }
  246|      1|      }
  247|      1|    }
  248|      1|  }
  249|      1|  (void)reg_eax;  // Avoid compiler warning on unused-but-set variable.
  250|      1|  return flags & mask;
  251|      1|}
aom_dsp_rtcd.c:xgetbv:
  121|      2|static inline uint64_t xgetbv(void) {
  122|      2|  const uint32_t ecx = 0;
  123|      2|  uint32_t eax, edx;
  124|       |  // Use the raw opcode for xgetbv for compatibility with older toolchains.
  125|      2|  __asm__ volatile(".byte 0x0f, 0x01, 0xd0\n"
  126|      2|                   : "=a"(eax), "=d"(edx)
  127|      2|                   : "c"(ecx));
  128|      2|  return ((uint64_t)edx << 32) | eax;
  129|      2|}
aom_scale_rtcd.c:x86_simd_caps:
  198|      1|static inline int x86_simd_caps(void) {
  199|      1|  unsigned int flags = 0;
  200|      1|  unsigned int mask = ~0u;
  201|      1|  unsigned int max_cpuid_val, reg_eax, reg_ebx, reg_ecx, reg_edx;
  202|      1|  char *env;
  203|       |
  204|       |  /* See if the CPU capabilities are being overridden by the environment */
  205|      1|  env = getenv("AOM_SIMD_CAPS");
  206|      1|  if (env && *env) return (int)strtol(env, NULL, 0);
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  |  Branch (206:14): [True: 0, False: 0]
  ------------------
  207|       |
  208|      1|  env = getenv("AOM_SIMD_CAPS_MASK");
  209|      1|  if (env && *env) mask = (unsigned int)strtoul(env, NULL, 0);
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  |  Branch (209:14): [True: 0, False: 0]
  ------------------
  210|       |
  211|       |  /* Ensure that the CPUID instruction supports extended features */
  212|      1|  cpuid(0, 0, max_cpuid_val, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  213|       |
  214|      1|  if (max_cpuid_val < 1) return 0;
  ------------------
  |  Branch (214:7): [True: 0, False: 1]
  ------------------
  215|       |
  216|       |  /* Get the standard feature flags */
  217|      1|  cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  218|       |
  219|      1|  flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  161|      1|#define HAS_MMX 0x01
  ------------------
  220|      1|  flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  162|      1|#define HAS_SSE 0x02
  ------------------
  221|      1|  flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  163|      1|#define HAS_SSE2 0x04
  ------------------
  222|      1|  flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  164|      1|#define HAS_SSE3 0x08
  ------------------
  223|      1|  flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  224|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  225|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  169|      1|#define HAS_SSE4_2 0x100
  ------------------
  226|       |
  227|       |  // bits 27 (OSXSAVE) & 28 (256-bit AVX)
  228|      1|  if (FEATURE_SET(reg_ecx, AVX)) {
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  229|       |    // Check for OS-support of YMM state. Necessary for AVX and AVX2.
  230|      1|    if ((xgetbv() & 0x6) == 0x6) {
  ------------------
  |  Branch (230:9): [True: 1, False: 0]
  ------------------
  231|      1|      flags |= HAS_AVX;
  ------------------
  |  |  167|      1|#define HAS_AVX 0x40
  ------------------
  232|      1|      if (max_cpuid_val >= 7) {
  ------------------
  |  Branch (232:11): [True: 1, False: 0]
  ------------------
  233|       |        /* Get the leaf 7 feature flags. Needed to check for AVX2 support */
  234|      1|        cpuid(7, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  235|      1|        flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                      flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  236|       |        // Check for OS-support of ZMM and YMM state. Necessary for AVX512.
  237|       |        // Only set HAS_AVX512 flag if AVX512_DL feature are supported.
  238|       |        // Older AVX512 implementations (such as Skylake) have turbo curves that
  239|       |        // are currently problematic for mixed AVX512/AVX2 code
  240|      1|        if ((xgetbv() & 0xe6) == 0xe6) {
  ------------------
  |  Branch (240:13): [True: 0, False: 1]
  ------------------
  241|      0|          flags |=
  242|      0|              FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                            FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  243|      0|                  ? HAS_AVX512
  ------------------
  |  |  170|      0|#define HAS_AVX512 0x200
  ------------------
  244|      0|                  : 0;
  245|      0|        }
  246|      1|      }
  247|      1|    }
  248|      1|  }
  249|      1|  (void)reg_eax;  // Avoid compiler warning on unused-but-set variable.
  250|      1|  return flags & mask;
  251|      1|}
aom_scale_rtcd.c:xgetbv:
  121|      2|static inline uint64_t xgetbv(void) {
  122|      2|  const uint32_t ecx = 0;
  123|      2|  uint32_t eax, edx;
  124|       |  // Use the raw opcode for xgetbv for compatibility with older toolchains.
  125|      2|  __asm__ volatile(".byte 0x0f, 0x01, 0xd0\n"
  126|      2|                   : "=a"(eax), "=d"(edx)
  127|      2|                   : "c"(ecx));
  128|      2|  return ((uint64_t)edx << 32) | eax;
  129|      2|}
av1_rtcd.c:x86_simd_caps:
  198|      1|static inline int x86_simd_caps(void) {
  199|      1|  unsigned int flags = 0;
  200|      1|  unsigned int mask = ~0u;
  201|      1|  unsigned int max_cpuid_val, reg_eax, reg_ebx, reg_ecx, reg_edx;
  202|      1|  char *env;
  203|       |
  204|       |  /* See if the CPU capabilities are being overridden by the environment */
  205|      1|  env = getenv("AOM_SIMD_CAPS");
  206|      1|  if (env && *env) return (int)strtol(env, NULL, 0);
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  |  Branch (206:14): [True: 0, False: 0]
  ------------------
  207|       |
  208|      1|  env = getenv("AOM_SIMD_CAPS_MASK");
  209|      1|  if (env && *env) mask = (unsigned int)strtoul(env, NULL, 0);
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  |  Branch (209:14): [True: 0, False: 0]
  ------------------
  210|       |
  211|       |  /* Ensure that the CPUID instruction supports extended features */
  212|      1|  cpuid(0, 0, max_cpuid_val, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  213|       |
  214|      1|  if (max_cpuid_val < 1) return 0;
  ------------------
  |  Branch (214:7): [True: 0, False: 1]
  ------------------
  215|       |
  216|       |  /* Get the standard feature flags */
  217|      1|  cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  218|       |
  219|      1|  flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  176|      1|#define MMX_BITS BIT(23)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, MMX) ? HAS_MMX : 0;
  ------------------
  |  |  161|      1|#define HAS_MMX 0x01
  ------------------
  220|      1|  flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  177|      1|#define SSE_BITS BIT(25)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE) ? HAS_SSE : 0;
  ------------------
  |  |  162|      1|#define HAS_SSE 0x02
  ------------------
  221|      1|  flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  178|      1|#define SSE2_BITS BIT(26)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_edx, SSE2) ? HAS_SSE2 : 0;
  ------------------
  |  |  163|      1|#define HAS_SSE2 0x04
  ------------------
  222|      1|  flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  179|      1|#define SSE3_BITS BIT(0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE3) ? HAS_SSE3 : 0;
  ------------------
  |  |  164|      1|#define HAS_SSE3 0x08
  ------------------
  223|      1|  flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  180|      1|#define SSSE3_BITS BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSSE3) ? HAS_SSSE3 : 0;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  224|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  181|      1|#define SSE4_1_BITS BIT(19)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_1) ? HAS_SSE4_1 : 0;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  225|      1|  flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  182|      1|#define SSE4_2_BITS BIT(20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                flags |= FEATURE_SET(reg_ecx, SSE4_2) ? HAS_SSE4_2 : 0;
  ------------------
  |  |  169|      1|#define HAS_SSE4_2 0x100
  ------------------
  226|       |
  227|       |  // bits 27 (OSXSAVE) & 28 (256-bit AVX)
  228|      1|  if (FEATURE_SET(reg_ecx, AVX)) {
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  184|      1|#define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX_BITS (BIT(27) | BIT(28))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  229|       |    // Check for OS-support of YMM state. Necessary for AVX and AVX2.
  230|      1|    if ((xgetbv() & 0x6) == 0x6) {
  ------------------
  |  Branch (230:9): [True: 1, False: 0]
  ------------------
  231|      1|      flags |= HAS_AVX;
  ------------------
  |  |  167|      1|#define HAS_AVX 0x40
  ------------------
  232|      1|      if (max_cpuid_val >= 7) {
  ------------------
  |  Branch (232:11): [True: 1, False: 0]
  ------------------
  233|       |        /* Get the leaf 7 feature flags. Needed to check for AVX2 support */
  234|      1|        cpuid(7, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
  ------------------
  |  |   49|      1|  __asm__ __volatile__("cpuid           \n\t"                   \
  |  |   50|      1|                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx) \
  |  |   51|      1|                       : "a"(func), "c"(func2))
  ------------------
  235|      1|        flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  196|      1|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  185|      1|#define AVX2_BITS BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      1|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 1, False: 0]
  |  |  ------------------
  ------------------
                      flags |= FEATURE_SET(reg_ebx, AVX2) ? HAS_AVX2 : 0;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  236|       |        // Check for OS-support of ZMM and YMM state. Necessary for AVX512.
  237|       |        // Only set HAS_AVX512 flag if AVX512_DL feature are supported.
  238|       |        // Older AVX512 implementations (such as Skylake) have turbo curves that
  239|       |        // are currently problematic for mixed AVX512/AVX2 code
  240|      1|        if ((xgetbv() & 0xe6) == 0xe6) {
  ------------------
  |  Branch (240:13): [True: 0, False: 1]
  ------------------
  241|      0|          flags |=
  242|      0|              FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  188|      0|#define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |               #define AVX512_BITS (BIT(16) | BIT(17) | BIT(28) | BIT(30) | BIT(31))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                            FEATURE_SET(reg_ebx, AVX512) && FEATURE_SET(reg_ecx, AVX512_DL)
  ------------------
  |  |  196|      0|  (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((reg) & (feature##_BITS)) == (feature##_BITS))
  |  |  ------------------
  |  |  |  |  193|      0|  (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  |  |                 (BIT(1) | BIT(6) | BIT(8) | BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(14))
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|      0|#define BIT(n) (1u << (n))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (196:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  243|      0|                  ? HAS_AVX512
  ------------------
  |  |  170|      0|#define HAS_AVX512 0x200
  ------------------
  244|      0|                  : 0;
  245|      0|        }
  246|      1|      }
  247|      1|    }
  248|      1|  }
  249|      1|  (void)reg_eax;  // Avoid compiler warning on unused-but-set variable.
  250|      1|  return flags & mask;
  251|      1|}
av1_rtcd.c:xgetbv:
  121|      2|static inline uint64_t xgetbv(void) {
  122|      2|  const uint32_t ecx = 0;
  123|      2|  uint32_t eax, edx;
  124|       |  // Use the raw opcode for xgetbv for compatibility with older toolchains.
  125|      2|  __asm__ volatile(".byte 0x0f, 0x01, 0xd0\n"
  126|      2|                   : "=a"(eax), "=d"(edx)
  127|      2|                   : "c"(ecx));
  128|      2|  return ((uint64_t)edx << 32) | eax;
  129|      2|}

aom_scale_rtcd:
   18|  25.4k|void aom_scale_rtcd(void) { aom_once(setup_rtcd_internal); }

aom_free_frame_buffer:
   34|  3.23M|int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
   35|  3.23M|  if (ybf) {
  ------------------
  |  Branch (35:7): [True: 3.23M, False: 0]
  ------------------
   36|  3.23M|    if (ybf->buffer_alloc_sz > 0) {
  ------------------
  |  Branch (36:9): [True: 162k, False: 3.07M]
  ------------------
   37|   162k|      aom_free(ybf->buffer_alloc);
   38|   162k|    }
   39|  3.23M|#if CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
   40|  3.23M|    if (ybf->y_pyramid) {
  ------------------
  |  Branch (40:9): [True: 86.1k, False: 3.15M]
  ------------------
   41|  86.1k|      aom_free_pyramid(ybf->y_pyramid);
   42|  86.1k|    }
   43|  3.23M|    if (ybf->corners) {
  ------------------
  |  Branch (43:9): [True: 86.1k, False: 3.15M]
  ------------------
   44|  86.1k|      av1_free_corner_list(ybf->corners);
   45|  86.1k|    }
   46|  3.23M|#endif  // CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
   47|  3.23M|    aom_remove_metadata_from_frame_buffer(ybf);
   48|       |    /* buffer_alloc isn't accessed by most functions.  Rather y_buffer,
   49|       |      u_buffer and v_buffer point to buffer_alloc and are used.  Clear out
   50|       |      all of this so that a freed pointer isn't inadvertently used */
   51|  3.23M|    memset(ybf, 0, sizeof(YV12_BUFFER_CONFIG));
   52|  3.23M|    return 0;
   53|  3.23M|  }
   54|       |
   55|      0|  return AOM_CODEC_MEM_ERROR;
   56|  3.23M|}
aom_realloc_frame_buffer:
  241|   382k|                             bool alloc_pyramid, int alloc_y_plane_only) {
  242|   382k|  if (ybf) {
  ------------------
  |  Branch (242:7): [True: 382k, False: 0]
  ------------------
  243|   382k|    int y_stride = 0;
  244|   382k|    int uv_stride = 0;
  245|   382k|    uint64_t yplane_size = 0;
  246|   382k|    uint64_t uvplane_size = 0;
  247|   382k|    const int aligned_width = (width + 7) & ~7;
  248|   382k|    const int aligned_height = (height + 7) & ~7;
  249|   382k|    const int uv_width = aligned_width >> ss_x;
  250|   382k|    const int uv_height = aligned_height >> ss_y;
  251|   382k|    const int uv_border_w = border >> ss_x;
  252|   382k|    const int uv_border_h = border >> ss_y;
  253|       |
  254|   382k|    int error = calc_stride_and_planesize(
  255|   382k|        ss_x, ss_y, aligned_width, aligned_height, border, byte_alignment,
  256|   382k|        alloc_y_plane_only, &y_stride, &uv_stride, &yplane_size, &uvplane_size,
  257|   382k|        uv_height);
  258|   382k|    if (error) return error;
  ------------------
  |  Branch (258:9): [True: 0, False: 382k]
  ------------------
  259|   382k|    return realloc_frame_buffer_aligned(
  260|   382k|        ybf, width, height, ss_x, ss_y, use_highbitdepth, border,
  261|   382k|        byte_alignment, fb, cb, cb_priv, y_stride, yplane_size, uvplane_size,
  262|   382k|        aligned_width, aligned_height, uv_width, uv_height, uv_stride,
  263|   382k|        uv_border_w, uv_border_h, alloc_pyramid, alloc_y_plane_only);
  264|   382k|  }
  265|      0|  return AOM_CODEC_MEM_ERROR;
  266|   382k|}
aom_remove_metadata_from_frame_buffer:
  281|  3.31M|void aom_remove_metadata_from_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
  282|  3.31M|  if (ybf && ybf->metadata) {
  ------------------
  |  Branch (282:7): [True: 3.31M, False: 0]
  |  Branch (282:14): [True: 0, False: 3.31M]
  ------------------
  283|      0|    aom_img_metadata_array_free(ybf->metadata);
  284|       |    ybf->metadata = NULL;
  285|      0|  }
  286|  3.31M|}
yv12config.c:calc_stride_and_planesize:
  213|   382k|    uint64_t *yplane_size, uint64_t *uvplane_size, const int uv_height) {
  214|       |  /* Only support allocating buffers that have a border that's a multiple
  215|       |   * of 32. The border restriction is required to get 16-byte alignment of
  216|       |   * the start of the chroma rows without introducing an arbitrary gap
  217|       |   * between planes, which would break the semantics of things like
  218|       |   * aom_img_set_rect(). */
  219|   382k|  if (border & 0x1f) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (219:7): [True: 0, False: 382k]
  ------------------
  220|   382k|  *y_stride = aom_calc_y_stride(aligned_width, border);
  221|   382k|  *yplane_size =
  222|   382k|      (aligned_height + 2 * border) * (uint64_t)(*y_stride) + byte_alignment;
  223|       |
  224|   382k|  if (!alloc_y_plane_only) {
  ------------------
  |  Branch (224:7): [True: 382k, False: 0]
  ------------------
  225|   382k|    *uv_stride = *y_stride >> ss_x;
  226|   382k|    *uvplane_size =
  227|   382k|        (uv_height + 2 * (border >> ss_y)) * (uint64_t)(*uv_stride) +
  228|   382k|        byte_alignment;
  229|   382k|  } else {
  230|      0|    *uv_stride = 0;
  231|      0|    *uvplane_size = 0;
  232|      0|  }
  233|   382k|  return 0;
  234|   382k|}
yv12config.c:realloc_frame_buffer_aligned:
   66|   382k|    bool alloc_pyramid, int alloc_y_plane_only) {
   67|   382k|  if (ybf) {
  ------------------
  |  Branch (67:7): [True: 382k, False: 0]
  ------------------
   68|   382k|    const int aom_byte_align = (byte_alignment == 0) ? 1 : byte_alignment;
  ------------------
  |  Branch (68:32): [True: 382k, False: 0]
  ------------------
   69|   382k|    const uint64_t frame_size =
   70|   382k|        (1 + use_highbitdepth) * (yplane_size + 2 * uvplane_size);
   71|       |
   72|   382k|    uint8_t *buf = NULL;
   73|       |
   74|       |#if CONFIG_REALTIME_ONLY || !CONFIG_AV1_ENCODER
   75|       |    // We should only need an 8-bit version of the source frame if we are
   76|       |    // encoding in non-realtime mode
   77|       |    (void)alloc_pyramid;
   78|       |    assert(!alloc_pyramid);
   79|       |#endif  // CONFIG_REALTIME_ONLY || !CONFIG_AV1_ENCODER
   80|       |
   81|   382k|#if defined AOM_MAX_ALLOCABLE_MEMORY
   82|       |    // The size of ybf->buffer_alloc.
   83|   382k|    uint64_t alloc_size = frame_size;
   84|   382k|#if CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
   85|       |    // The size of ybf->y_pyramid
   86|   382k|    if (alloc_pyramid) {
  ------------------
  |  Branch (86:9): [True: 184k, False: 198k]
  ------------------
   87|   184k|      alloc_size += aom_get_pyramid_alloc_size(width, height, use_highbitdepth);
   88|   184k|      alloc_size += av1_get_corner_list_size();
   89|   184k|    }
   90|   382k|#endif  // CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
   91|       |    // The decoder may allocate REF_FRAMES frame buffers in the frame buffer
   92|       |    // pool. Bound the total amount of allocated memory as if these REF_FRAMES
   93|       |    // frame buffers were allocated in a single allocation.
   94|   382k|    if (alloc_size > AOM_MAX_ALLOCABLE_MEMORY / REF_FRAMES)
  ------------------
  |  |   30|   382k|#define AOM_MAX_ALLOCABLE_MEMORY 8589934592  // 8 GB
  ------------------
  |  Branch (94:9): [True: 0, False: 382k]
  ------------------
   95|      0|      return AOM_CODEC_MEM_ERROR;
   96|   382k|#endif
   97|       |
   98|   382k|    if (cb != NULL) {
  ------------------
  |  Branch (98:9): [True: 28.0k, False: 354k]
  ------------------
   99|  28.0k|      const int align_addr_extra_size = 31;
  100|  28.0k|      const uint64_t external_frame_size = frame_size + align_addr_extra_size;
  101|       |
  102|  28.0k|      assert(fb != NULL);
  103|       |
  104|  28.0k|      if (external_frame_size != (size_t)external_frame_size)
  ------------------
  |  Branch (104:11): [True: 0, False: 28.0k]
  ------------------
  105|      0|        return AOM_CODEC_MEM_ERROR;
  106|       |
  107|       |      // Allocation to hold larger frame, or first allocation.
  108|  28.0k|      if (cb(cb_priv, (size_t)external_frame_size, fb) < 0)
  ------------------
  |  Branch (108:11): [True: 0, False: 28.0k]
  ------------------
  109|      0|        return AOM_CODEC_MEM_ERROR;
  110|       |
  111|  28.0k|      if (fb->data == NULL || fb->size < external_frame_size)
  ------------------
  |  Branch (111:11): [True: 0, False: 28.0k]
  |  Branch (111:31): [True: 0, False: 28.0k]
  ------------------
  112|      0|        return AOM_CODEC_MEM_ERROR;
  113|       |
  114|  28.0k|      ybf->buffer_alloc = (uint8_t *)aom_align_addr(fb->data, 32);
  ------------------
  |  |   51|  28.0k|  (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1))
  ------------------
  115|       |
  116|  28.0k|#if defined(__has_feature)
  117|       |#if __has_feature(memory_sanitizer)
  118|       |      // This memset is needed for fixing the issue of using uninitialized
  119|       |      // value in msan test. It will cause a perf loss, so only do this for
  120|       |      // msan test.
  121|       |      memset(ybf->buffer_alloc, 0, (size_t)frame_size);
  122|       |#endif
  123|  28.0k|#endif
  124|   354k|    } else if (frame_size > ybf->buffer_alloc_sz) {
  ------------------
  |  Branch (124:16): [True: 251k, False: 103k]
  ------------------
  125|       |      // Allocation to hold larger frame, or first allocation.
  126|   251k|      aom_free(ybf->buffer_alloc);
  127|   251k|      ybf->buffer_alloc = NULL;
  128|   251k|      ybf->buffer_alloc_sz = 0;
  129|       |
  130|   251k|      if (frame_size != (size_t)frame_size) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (130:11): [True: 0, False: 251k]
  ------------------
  131|       |
  132|   251k|      ybf->buffer_alloc = (uint8_t *)aom_memalign(32, (size_t)frame_size);
  133|   251k|      if (!ybf->buffer_alloc) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (133:11): [True: 0, False: 251k]
  ------------------
  134|       |
  135|   251k|      ybf->buffer_alloc_sz = (size_t)frame_size;
  136|       |
  137|       |      // This memset is needed for fixing valgrind error from C loop filter
  138|       |      // due to access uninitialized memory in frame border. It could be
  139|       |      // removed if border is totally removed.
  140|   251k|      memset(ybf->buffer_alloc, 0, ybf->buffer_alloc_sz);
  141|   251k|    }
  142|       |
  143|   382k|    ybf->y_crop_width = width;
  144|   382k|    ybf->y_crop_height = height;
  145|   382k|    ybf->y_width = aligned_width;
  146|   382k|    ybf->y_height = aligned_height;
  147|   382k|    ybf->y_stride = y_stride;
  148|       |
  149|   382k|    ybf->uv_crop_width = (width + ss_x) >> ss_x;
  150|   382k|    ybf->uv_crop_height = (height + ss_y) >> ss_y;
  151|   382k|    ybf->uv_width = uv_width;
  152|   382k|    ybf->uv_height = uv_height;
  153|   382k|    ybf->uv_stride = uv_stride;
  154|       |
  155|   382k|    ybf->border = border;
  156|   382k|    ybf->frame_size = (size_t)frame_size;
  157|   382k|    ybf->subsampling_x = ss_x;
  158|   382k|    ybf->subsampling_y = ss_y;
  159|       |
  160|   382k|    buf = ybf->buffer_alloc;
  161|   382k|    if (use_highbitdepth) {
  ------------------
  |  Branch (161:9): [True: 110k, False: 272k]
  ------------------
  162|       |      // Store uint16 addresses when using 16bit framebuffers
  163|   110k|      buf = CONVERT_TO_BYTEPTR(ybf->buffer_alloc);
  ------------------
  |  |   80|   110k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  164|   110k|      ybf->flags = YV12_FLAG_HIGHBITDEPTH;
  ------------------
  |  |  142|   110k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  165|   272k|    } else {
  166|   272k|      ybf->flags = 0;
  167|   272k|    }
  168|       |
  169|   382k|    ybf->y_buffer = (uint8_t *)aom_align_addr(
  ------------------
  |  |   51|   382k|  (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1))
  ------------------
  170|   382k|        buf + (border * y_stride) + border, aom_byte_align);
  171|   382k|    if (!alloc_y_plane_only) {
  ------------------
  |  Branch (171:9): [True: 382k, False: 0]
  ------------------
  172|   382k|      ybf->u_buffer = (uint8_t *)aom_align_addr(
  ------------------
  |  |   51|   382k|  (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1))
  ------------------
  173|   382k|          buf + yplane_size + (uv_border_h * uv_stride) + uv_border_w,
  174|   382k|          aom_byte_align);
  175|   382k|      ybf->v_buffer =
  176|   382k|          (uint8_t *)aom_align_addr(buf + yplane_size + uvplane_size +
  ------------------
  |  |   51|   382k|  (void *)(((uintptr_t)(addr) + ((align) - 1)) & ~(uintptr_t)((align) - 1))
  ------------------
  177|   382k|                                        (uv_border_h * uv_stride) + uv_border_w,
  178|   382k|                                    aom_byte_align);
  179|   382k|    } else {
  180|      0|      ybf->u_buffer = NULL;
  181|      0|      ybf->v_buffer = NULL;
  182|      0|    }
  183|       |
  184|   382k|    ybf->use_external_reference_buffers = 0;
  185|       |
  186|   382k|#if CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
  187|   382k|    if (ybf->y_pyramid) {
  ------------------
  |  Branch (187:9): [True: 98.4k, False: 284k]
  ------------------
  188|  98.4k|      aom_free_pyramid(ybf->y_pyramid);
  189|  98.4k|      ybf->y_pyramid = NULL;
  190|  98.4k|    }
  191|   382k|    if (ybf->corners) {
  ------------------
  |  Branch (191:9): [True: 98.4k, False: 284k]
  ------------------
  192|  98.4k|      av1_free_corner_list(ybf->corners);
  193|  98.4k|      ybf->corners = NULL;
  194|  98.4k|    }
  195|   382k|    if (alloc_pyramid) {
  ------------------
  |  Branch (195:9): [True: 184k, False: 198k]
  ------------------
  196|   184k|      ybf->y_pyramid = aom_alloc_pyramid(width, height, use_highbitdepth);
  197|   184k|      if (!ybf->y_pyramid) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (197:11): [True: 0, False: 184k]
  ------------------
  198|   184k|      ybf->corners = av1_alloc_corner_list();
  199|   184k|      if (!ybf->corners) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (199:11): [True: 0, False: 184k]
  ------------------
  200|   184k|    }
  201|   382k|#endif  // CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
  202|       |
  203|   382k|    ybf->corrupted = 0; /* assume not corrupted by errors */
  204|   382k|    return 0;
  205|   382k|  }
  206|      0|  return AOM_CODEC_MEM_ERROR;
  207|   382k|}

aom_extend_frame_borders_plane_row_c:
  113|   157k|                                          int plane, int v_start, int v_end) {
  114|   157k|  const int ext_size = ybf->border;
  115|   157k|  const int ss_x = ybf->subsampling_x;
  116|   157k|  const int ss_y = ybf->subsampling_y;
  117|       |
  118|   157k|  assert(ybf->y_height - ybf->y_crop_height < 16);
  119|   157k|  assert(ybf->y_width - ybf->y_crop_width < 16);
  120|   157k|  assert(ybf->y_height - ybf->y_crop_height >= 0);
  121|   157k|  assert(ybf->y_width - ybf->y_crop_width >= 0);
  122|       |
  123|   157k|  const int is_uv = plane > 0;
  124|   157k|  const int top = ext_size >> (is_uv ? ss_y : 0);
  ------------------
  |  Branch (124:32): [True: 67.9k, False: 89.0k]
  ------------------
  125|   157k|  const int left = ext_size >> (is_uv ? ss_x : 0);
  ------------------
  |  Branch (125:33): [True: 67.9k, False: 89.0k]
  ------------------
  126|   157k|  const int bottom = top + ybf->heights[is_uv] - ybf->crop_heights[is_uv];
  127|   157k|  const int right = left + ybf->widths[is_uv] - ybf->crop_widths[is_uv];
  128|   157k|  const int extend_top_border = (v_start == 0);
  129|   157k|  const int extend_bottom_border = (v_end == ybf->crop_heights[is_uv]);
  130|       |
  131|   157k|#if CONFIG_AV1_HIGHBITDEPTH
  132|   157k|  if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   157k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (132:7): [True: 44.8k, False: 112k]
  ------------------
  133|  44.8k|    extend_plane_high(ybf->buffers[plane], ybf->strides[is_uv],
  134|  44.8k|                      ybf->crop_widths[is_uv], ybf->crop_heights[is_uv],
  135|  44.8k|                      extend_top_border ? top : 0, left,
  ------------------
  |  Branch (135:23): [True: 39.0k, False: 5.78k]
  ------------------
  136|  44.8k|                      extend_bottom_border ? bottom : 0, right, v_start, v_end);
  ------------------
  |  Branch (136:23): [True: 39.0k, False: 5.78k]
  ------------------
  137|  44.8k|    return;
  138|  44.8k|  }
  139|   112k|#endif
  140|       |
  141|   112k|  extend_plane(ybf->buffers[plane], ybf->strides[is_uv],
  142|   112k|               ybf->crop_widths[is_uv], ybf->crop_heights[is_uv],
  143|   112k|               extend_top_border ? top : 0, left,
  ------------------
  |  Branch (143:16): [True: 90.5k, False: 21.6k]
  ------------------
  144|   112k|               extend_bottom_border ? bottom : 0, right, v_start, v_end);
  ------------------
  |  Branch (144:16): [True: 90.5k, False: 21.6k]
  ------------------
  145|   112k|}
aom_extend_frame_borders_c:
  185|   451k|void aom_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf, const int num_planes) {
  186|   451k|  extend_frame(ybf, ybf->border, num_planes);
  187|   451k|}
aom_yv12_copy_y_c:
  240|   194k|                       YV12_BUFFER_CONFIG *dst_ybc, int use_crop) {
  241|   194k|  int row;
  242|   194k|  int width = use_crop ? src_ybc->y_crop_width : src_ybc->y_width;
  ------------------
  |  Branch (242:15): [True: 18.4k, False: 176k]
  ------------------
  243|   194k|  int height = use_crop ? src_ybc->y_crop_height : src_ybc->y_height;
  ------------------
  |  Branch (243:16): [True: 18.4k, False: 176k]
  ------------------
  244|   194k|  const uint8_t *src = src_ybc->y_buffer;
  245|   194k|  uint8_t *dst = dst_ybc->y_buffer;
  246|       |
  247|   194k|#if CONFIG_AV1_HIGHBITDEPTH
  248|   194k|  if (src_ybc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   194k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (248:7): [True: 63.2k, False: 131k]
  ------------------
  249|  63.2k|    const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|  63.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  250|  63.2k|    uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  63.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  251|  2.37M|    for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (251:19): [True: 2.31M, False: 63.2k]
  ------------------
  252|  2.31M|      memcpy(dst16, src16, width * sizeof(uint16_t));
  253|  2.31M|      src16 += src_ybc->y_stride;
  254|  2.31M|      dst16 += dst_ybc->y_stride;
  255|  2.31M|    }
  256|  63.2k|    return;
  257|  63.2k|  }
  258|   131k|#endif
  259|       |
  260|  5.60M|  for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (260:17): [True: 5.47M, False: 131k]
  ------------------
  261|  5.47M|    memcpy(dst, src, width);
  262|  5.47M|    src += src_ybc->y_stride;
  263|  5.47M|    dst += dst_ybc->y_stride;
  264|  5.47M|  }
  265|   131k|}
aom_yv12_copy_u_c:
  268|  89.2k|                       YV12_BUFFER_CONFIG *dst_bc, int use_crop) {
  269|  89.2k|  int row;
  270|  89.2k|  int width = use_crop ? src_bc->uv_crop_width : src_bc->uv_width;
  ------------------
  |  Branch (270:15): [True: 18.4k, False: 70.8k]
  ------------------
  271|  89.2k|  int height = use_crop ? src_bc->uv_crop_height : src_bc->uv_height;
  ------------------
  |  Branch (271:16): [True: 18.4k, False: 70.8k]
  ------------------
  272|  89.2k|  const uint8_t *src = src_bc->u_buffer;
  273|  89.2k|  uint8_t *dst = dst_bc->u_buffer;
  274|  89.2k|#if CONFIG_AV1_HIGHBITDEPTH
  275|  89.2k|  if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  89.2k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (275:7): [True: 32.4k, False: 56.8k]
  ------------------
  276|  32.4k|    const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|  32.4k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  277|  32.4k|    uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  32.4k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  278|   869k|    for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (278:19): [True: 836k, False: 32.4k]
  ------------------
  279|   836k|      memcpy(dst16, src16, width * sizeof(uint16_t));
  280|   836k|      src16 += src_bc->uv_stride;
  281|   836k|      dst16 += dst_bc->uv_stride;
  282|   836k|    }
  283|  32.4k|    return;
  284|  32.4k|  }
  285|  56.8k|#endif
  286|  1.83M|  for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (286:17): [True: 1.78M, False: 56.8k]
  ------------------
  287|  1.78M|    memcpy(dst, src, width);
  288|  1.78M|    src += src_bc->uv_stride;
  289|  1.78M|    dst += dst_bc->uv_stride;
  290|  1.78M|  }
  291|  56.8k|}
aom_yv12_copy_v_c:
  294|  89.1k|                       YV12_BUFFER_CONFIG *dst_bc, int use_crop) {
  295|  89.1k|  int row;
  296|  89.1k|  int width = use_crop ? src_bc->uv_crop_width : src_bc->uv_width;
  ------------------
  |  Branch (296:15): [True: 18.4k, False: 70.7k]
  ------------------
  297|  89.1k|  int height = use_crop ? src_bc->uv_crop_height : src_bc->uv_height;
  ------------------
  |  Branch (297:16): [True: 18.4k, False: 70.7k]
  ------------------
  298|  89.1k|  const uint8_t *src = src_bc->v_buffer;
  299|  89.1k|  uint8_t *dst = dst_bc->v_buffer;
  300|  89.1k|#if CONFIG_AV1_HIGHBITDEPTH
  301|  89.1k|  if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  89.1k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (301:7): [True: 32.3k, False: 56.7k]
  ------------------
  302|  32.3k|    const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|  32.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  303|  32.3k|    uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  32.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  304|   870k|    for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (304:19): [True: 837k, False: 32.3k]
  ------------------
  305|   837k|      memcpy(dst16, src16, width * sizeof(uint16_t));
  306|   837k|      src16 += src_bc->uv_stride;
  307|   837k|      dst16 += dst_bc->uv_stride;
  308|   837k|    }
  309|  32.3k|    return;
  310|  32.3k|  }
  311|  56.7k|#endif
  312|  1.83M|  for (row = 0; row < height; ++row) {
  ------------------
  |  Branch (312:17): [True: 1.77M, False: 56.7k]
  ------------------
  313|  1.77M|    memcpy(dst, src, width);
  314|  1.77M|    src += src_bc->uv_stride;
  315|  1.77M|    dst += dst_bc->uv_stride;
  316|  1.77M|  }
  317|  56.7k|}
aom_yv12_partial_copy_y_c:
  322|    906|                               int vstart2) {
  323|    906|  int row;
  324|    906|  const uint8_t *src = src_ybc->y_buffer;
  325|    906|  uint8_t *dst = dst_ybc->y_buffer;
  326|    906|#if CONFIG_AV1_HIGHBITDEPTH
  327|    906|  if (src_ybc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|    906|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (327:7): [True: 249, False: 657]
  ------------------
  328|    249|    const uint16_t *src16 =
  329|    249|        CONVERT_TO_SHORTPTR(src + vstart1 * src_ybc->y_stride + hstart1);
  ------------------
  |  |   79|    249|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  330|    249|    uint16_t *dst16 =
  331|    249|        CONVERT_TO_SHORTPTR(dst + vstart2 * dst_ybc->y_stride + hstart2);
  ------------------
  |  |   79|    249|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  332|       |
  333|  24.3k|    for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (333:25): [True: 24.0k, False: 249]
  ------------------
  334|  24.0k|      memcpy(dst16, src16, (hend1 - hstart1) * sizeof(uint16_t));
  335|  24.0k|      src16 += src_ybc->y_stride;
  336|  24.0k|      dst16 += dst_ybc->y_stride;
  337|  24.0k|    }
  338|    249|    return;
  339|    249|  }
  340|    657|#endif
  341|    657|  src = (src + vstart1 * src_ybc->y_stride + hstart1);
  342|    657|  dst = (dst + vstart2 * dst_ybc->y_stride + hstart2);
  343|       |
  344|  66.4k|  for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (344:23): [True: 65.7k, False: 657]
  ------------------
  345|  65.7k|    memcpy(dst, src, (hend1 - hstart1));
  346|  65.7k|    src += src_ybc->y_stride;
  347|  65.7k|    dst += dst_ybc->y_stride;
  348|  65.7k|  }
  349|    657|}
aom_yv12_partial_coloc_copy_y_c:
  353|    906|                                     int hend, int vstart, int vend) {
  354|    906|  aom_yv12_partial_copy_y_c(src_ybc, hstart, hend, vstart, vend, dst_ybc,
  355|    906|                            hstart, vstart);
  356|    906|}
aom_yv12_partial_copy_u_c:
  361|    104|                               int vstart2) {
  362|    104|  int row;
  363|    104|  const uint8_t *src = src_bc->u_buffer;
  364|    104|  uint8_t *dst = dst_bc->u_buffer;
  365|    104|#if CONFIG_AV1_HIGHBITDEPTH
  366|    104|  if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|    104|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (366:7): [True: 24, False: 80]
  ------------------
  367|     24|    const uint16_t *src16 =
  368|     24|        CONVERT_TO_SHORTPTR(src + vstart1 * src_bc->uv_stride + hstart1);
  ------------------
  |  |   79|     24|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  369|     24|    uint16_t *dst16 =
  370|     24|        CONVERT_TO_SHORTPTR(dst + vstart2 * dst_bc->uv_stride + hstart2);
  ------------------
  |  |   79|     24|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  371|    518|    for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (371:25): [True: 494, False: 24]
  ------------------
  372|    494|      memcpy(dst16, src16, (hend1 - hstart1) * sizeof(uint16_t));
  373|    494|      src16 += src_bc->uv_stride;
  374|    494|      dst16 += dst_bc->uv_stride;
  375|    494|    }
  376|     24|    return;
  377|     24|  }
  378|     80|#endif
  379|     80|  src = (src + vstart1 * src_bc->uv_stride + hstart1);
  380|     80|  dst = (dst + vstart2 * dst_bc->uv_stride + hstart2);
  381|       |
  382|  2.81k|  for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (382:23): [True: 2.73k, False: 80]
  ------------------
  383|  2.73k|    memcpy(dst, src, (hend1 - hstart1));
  384|  2.73k|    src += src_bc->uv_stride;
  385|  2.73k|    dst += dst_bc->uv_stride;
  386|  2.73k|  }
  387|     80|}
aom_yv12_partial_coloc_copy_u_c:
  391|    104|                                     int hend, int vstart, int vend) {
  392|    104|  aom_yv12_partial_copy_u_c(src_bc, hstart, hend, vstart, vend, dst_bc, hstart,
  393|    104|                            vstart);
  394|    104|}
aom_yv12_partial_copy_v_c:
  399|    119|                               int vstart2) {
  400|    119|  int row;
  401|    119|  const uint8_t *src = src_bc->v_buffer;
  402|    119|  uint8_t *dst = dst_bc->v_buffer;
  403|    119|#if CONFIG_AV1_HIGHBITDEPTH
  404|    119|  if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|    119|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (404:7): [True: 33, False: 86]
  ------------------
  405|     33|    const uint16_t *src16 =
  406|     33|        CONVERT_TO_SHORTPTR(src + vstart1 * src_bc->uv_stride + hstart1);
  ------------------
  |  |   79|     33|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  407|     33|    uint16_t *dst16 =
  408|     33|        CONVERT_TO_SHORTPTR(dst + vstart2 * dst_bc->uv_stride + hstart2);
  ------------------
  |  |   79|     33|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  409|    532|    for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (409:25): [True: 499, False: 33]
  ------------------
  410|    499|      memcpy(dst16, src16, (hend1 - hstart1) * sizeof(uint16_t));
  411|    499|      src16 += src_bc->uv_stride;
  412|    499|      dst16 += dst_bc->uv_stride;
  413|    499|    }
  414|     33|    return;
  415|     33|  }
  416|     86|#endif
  417|     86|  src = (src + vstart1 * src_bc->uv_stride + hstart1);
  418|     86|  dst = (dst + vstart2 * dst_bc->uv_stride + hstart2);
  419|       |
  420|  2.87k|  for (row = vstart1; row < vend1; ++row) {
  ------------------
  |  Branch (420:23): [True: 2.79k, False: 86]
  ------------------
  421|  2.79k|    memcpy(dst, src, (hend1 - hstart1));
  422|  2.79k|    src += src_bc->uv_stride;
  423|  2.79k|    dst += dst_bc->uv_stride;
  424|  2.79k|  }
  425|     86|}
aom_yv12_partial_coloc_copy_v_c:
  429|    119|                                     int hend, int vstart, int vend) {
  430|    119|  aom_yv12_partial_copy_v_c(src_bc, hstart, hend, vstart, vend, dst_bc, hstart,
  431|    119|                            vstart);
  432|    119|}
yv12extend.c:extend_plane_high:
   70|   295k|                              int v_end) {
   71|   295k|  int i;
   72|   295k|  const int linesize = extend_left + extend_right + width;
   73|   295k|  assert(linesize <= src_stride);
   74|   295k|  uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|   295k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   75|       |
   76|       |  /* copy the left and right most columns out */
   77|   295k|  uint16_t *src_ptr1 = src + v_start * src_stride;
   78|   295k|  uint16_t *src_ptr2 = src + v_start * src_stride + width - 1;
   79|   295k|  uint16_t *dst_ptr1 = src + v_start * src_stride - extend_left;
   80|   295k|  uint16_t *dst_ptr2 = src_ptr2 + 1;
   81|       |
   82|  7.49M|  for (i = v_start; i < v_end; ++i) {
  ------------------
  |  Branch (82:21): [True: 7.19M, False: 295k]
  ------------------
   83|  7.19M|    aom_memset16(dst_ptr1, src_ptr1[0], extend_left);
   84|  7.19M|    aom_memset16(dst_ptr2, src_ptr2[0], extend_right);
   85|  7.19M|    src_ptr1 += src_stride;
   86|  7.19M|    src_ptr2 += src_stride;
   87|  7.19M|    dst_ptr1 += src_stride;
   88|  7.19M|    dst_ptr2 += src_stride;
   89|  7.19M|  }
   90|       |
   91|       |  /* Now copy the top and bottom lines into each line of the respective
   92|       |   * borders
   93|       |   */
   94|   295k|  src_ptr1 = src - extend_left;
   95|   295k|  dst_ptr1 = src_ptr1 + src_stride * -extend_top;
   96|       |
   97|  60.8M|  for (i = 0; i < extend_top; ++i) {
  ------------------
  |  Branch (97:15): [True: 60.5M, False: 295k]
  ------------------
   98|  60.5M|    memcpy(dst_ptr1, src_ptr1, linesize * sizeof(uint16_t));
   99|  60.5M|    dst_ptr1 += src_stride;
  100|  60.5M|  }
  101|       |
  102|   295k|  src_ptr2 = src_ptr1 + src_stride * (height - 1);
  103|   295k|  dst_ptr2 = src_ptr2;
  104|       |
  105|  61.7M|  for (i = 0; i < extend_bottom; ++i) {
  ------------------
  |  Branch (105:15): [True: 61.4M, False: 295k]
  ------------------
  106|  61.4M|    dst_ptr2 += src_stride;
  107|  61.4M|    memcpy(dst_ptr2, src_ptr2, linesize * sizeof(uint16_t));
  108|  61.4M|  }
  109|   295k|}
yv12extend.c:extend_plane:
   25|   660k|                         int v_end) {
   26|   660k|  assert(src != NULL);
   27|   660k|  int i;
   28|   660k|  const int linesize = extend_left + extend_right + width;
   29|   660k|  assert(linesize <= src_stride);
   30|       |
   31|       |  /* copy the left and right most columns out */
   32|   660k|  uint8_t *src_ptr1 = src + v_start * src_stride;
   33|   660k|  uint8_t *src_ptr2 = src + v_start * src_stride + width - 1;
   34|   660k|  uint8_t *dst_ptr1 = src + v_start * src_stride - extend_left;
   35|   660k|  uint8_t *dst_ptr2 = src_ptr2 + 1;
   36|       |
   37|  21.0M|  for (i = v_start; i < v_end; ++i) {
  ------------------
  |  Branch (37:21): [True: 20.4M, False: 660k]
  ------------------
   38|  20.4M|    memset(dst_ptr1, src_ptr1[0], extend_left);
   39|  20.4M|    memset(dst_ptr2, src_ptr2[0], extend_right);
   40|  20.4M|    src_ptr1 += src_stride;
   41|  20.4M|    src_ptr2 += src_stride;
   42|  20.4M|    dst_ptr1 += src_stride;
   43|  20.4M|    dst_ptr2 += src_stride;
   44|  20.4M|  }
   45|       |
   46|       |  /* Now copy the top and bottom lines into each line of the respective
   47|       |   * borders
   48|       |   */
   49|   660k|  src_ptr1 = src - extend_left;
   50|   660k|  dst_ptr1 = src_ptr1 + src_stride * -extend_top;
   51|       |
   52|   138M|  for (i = 0; i < extend_top; ++i) {
  ------------------
  |  Branch (52:15): [True: 137M, False: 660k]
  ------------------
   53|   137M|    memcpy(dst_ptr1, src_ptr1, linesize);
   54|   137M|    dst_ptr1 += src_stride;
   55|   137M|  }
   56|       |
   57|   660k|  src_ptr2 = src_ptr1 + src_stride * (height - 1);
   58|   660k|  dst_ptr2 = src_ptr2;
   59|       |
   60|   140M|  for (i = 0; i < extend_bottom; ++i) {
  ------------------
  |  Branch (60:15): [True: 140M, False: 660k]
  ------------------
   61|   140M|    dst_ptr2 += src_stride;
   62|   140M|    memcpy(dst_ptr2, src_ptr2, linesize);
   63|   140M|  }
   64|   660k|}
yv12extend.c:extend_frame:
  148|   451k|                         const int num_planes) {
  149|   451k|  const int ss_x = ybf->subsampling_x;
  150|   451k|  const int ss_y = ybf->subsampling_y;
  151|       |
  152|   451k|  assert(ybf->y_height - ybf->y_crop_height < 16);
  153|   451k|  assert(ybf->y_width - ybf->y_crop_width < 16);
  154|   451k|  assert(ybf->y_height - ybf->y_crop_height >= 0);
  155|   451k|  assert(ybf->y_width - ybf->y_crop_width >= 0);
  156|       |
  157|   451k|#if CONFIG_AV1_HIGHBITDEPTH
  158|   451k|  if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   451k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (158:7): [True: 131k, False: 320k]
  ------------------
  159|   381k|    for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (159:25): [True: 250k, False: 131k]
  ------------------
  160|   250k|      const int is_uv = plane > 0;
  161|   250k|      const int top = ext_size >> (is_uv ? ss_y : 0);
  ------------------
  |  Branch (161:36): [True: 119k, False: 131k]
  ------------------
  162|   250k|      const int left = ext_size >> (is_uv ? ss_x : 0);
  ------------------
  |  Branch (162:37): [True: 119k, False: 131k]
  ------------------
  163|   250k|      const int bottom = top + ybf->heights[is_uv] - ybf->crop_heights[is_uv];
  164|   250k|      const int right = left + ybf->widths[is_uv] - ybf->crop_widths[is_uv];
  165|   250k|      extend_plane_high(ybf->buffers[plane], ybf->strides[is_uv],
  166|   250k|                        ybf->crop_widths[is_uv], ybf->crop_heights[is_uv], top,
  167|   250k|                        left, bottom, right, 0, ybf->crop_heights[is_uv]);
  168|   250k|    }
  169|   131k|    return;
  170|   131k|  }
  171|   320k|#endif
  172|       |
  173|   869k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (173:23): [True: 548k, False: 320k]
  ------------------
  174|   548k|    const int is_uv = plane > 0;
  175|   548k|    const int top = ext_size >> (is_uv ? ss_y : 0);
  ------------------
  |  Branch (175:34): [True: 227k, False: 320k]
  ------------------
  176|   548k|    const int left = ext_size >> (is_uv ? ss_x : 0);
  ------------------
  |  Branch (176:35): [True: 227k, False: 320k]
  ------------------
  177|   548k|    const int bottom = top + ybf->heights[is_uv] - ybf->crop_heights[is_uv];
  178|   548k|    const int right = left + ybf->widths[is_uv] - ybf->crop_widths[is_uv];
  179|   548k|    extend_plane(ybf->buffers[plane], ybf->strides[is_uv],
  180|   548k|                 ybf->crop_widths[is_uv], ybf->crop_heights[is_uv], top, left,
  181|   548k|                 bottom, right, 0, ybf->crop_heights[is_uv]);
  182|   548k|  }
  183|   320k|}

encoder.c:aom_calc_y_stride:
  215|   141k|static inline int aom_calc_y_stride(int aligned_width, int border) {
  216|   141k|  return ((aligned_width + 2 * border) + 31) & ~31;
  217|   141k|}
yv12config.c:aom_calc_y_stride:
  215|   382k|static inline int aom_calc_y_stride(int aligned_width, int border) {
  216|   382k|  return ((aligned_width + 2 * border) + 31) & ~31;
  217|   382k|}

aom_get_worker_interface:
  244|   912k|const AVxWorkerInterface *aom_get_worker_interface(void) {
  245|   912k|  return &g_worker_interface;
  246|   912k|}
aom_thread.c:init:
  125|   327k|static void init(AVxWorker *const worker) {
  126|   327k|  memset(worker, 0, sizeof(*worker));
  127|   327k|  worker->status_ = AVX_WORKER_STATUS_NOT_OK;
  128|   327k|}
aom_thread.c:reset:
  138|   293k|static int reset(AVxWorker *const worker) {
  139|   293k|  int ok = 1;
  140|   293k|  worker->had_error = 0;
  141|   293k|  if (worker->status_ < AVX_WORKER_STATUS_OK) {
  ------------------
  |  Branch (141:7): [True: 293k, False: 0]
  ------------------
  142|   293k|#if CONFIG_MULTITHREAD
  143|   293k|    worker->impl_ = (AVxWorkerImpl *)aom_calloc(1, sizeof(*worker->impl_));
  144|   293k|    if (worker->impl_ == NULL) {
  ------------------
  |  Branch (144:9): [True: 0, False: 293k]
  ------------------
  145|      0|      return 0;
  146|      0|    }
  147|   293k|    if (pthread_mutex_init(&worker->impl_->mutex_, NULL)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 293k]
  ------------------
  148|      0|      goto Error;
  149|      0|    }
  150|   293k|    if (pthread_cond_init(&worker->impl_->condition_, NULL)) {
  ------------------
  |  Branch (150:9): [True: 0, False: 293k]
  ------------------
  151|      0|      pthread_mutex_destroy(&worker->impl_->mutex_);
  152|      0|      goto Error;
  153|      0|    }
  154|   293k|    pthread_attr_t attr;
  155|   293k|    if (pthread_attr_init(&attr)) goto Error2;
  ------------------
  |  Branch (155:9): [True: 0, False: 293k]
  ------------------
  156|       |    // Debug ASan builds require at least ~1MiB of stack; prevents
  157|       |    // failures on macOS arm64 where the default is 512KiB.
  158|       |    // See: https://crbug.com/aomedia/3379
  159|       |#if defined(AOM_ADDRESS_SANITIZER) && defined(__APPLE__) && AOM_ARCH_ARM && \
  160|       |    !defined(NDEBUG)
  161|       |    const size_t kMinStackSize = 1024 * 1024;
  162|       |#else
  163|   293k|    const size_t kMinStackSize = 256 * 1024;
  164|   293k|#endif
  165|   293k|    size_t stacksize;
  166|   293k|    if (!pthread_attr_getstacksize(&attr, &stacksize)) {
  ------------------
  |  Branch (166:9): [True: 293k, False: 0]
  ------------------
  167|   293k|      if (stacksize < kMinStackSize &&
  ------------------
  |  Branch (167:11): [True: 0, False: 293k]
  ------------------
  168|      0|          pthread_attr_setstacksize(&attr, kMinStackSize)) {
  ------------------
  |  Branch (168:11): [True: 0, False: 0]
  ------------------
  169|      0|        pthread_attr_destroy(&attr);
  170|      0|        goto Error2;
  171|      0|      }
  172|   293k|    }
  173|   293k|    pthread_mutex_lock(&worker->impl_->mutex_);
  174|   293k|    ok = !pthread_create(&worker->impl_->thread_, &attr, thread_loop, worker);
  175|   293k|    if (ok) worker->status_ = AVX_WORKER_STATUS_OK;
  ------------------
  |  Branch (175:9): [True: 293k, False: 0]
  ------------------
  176|   293k|    pthread_mutex_unlock(&worker->impl_->mutex_);
  177|   293k|    pthread_attr_destroy(&attr);
  178|   293k|    if (!ok) {
  ------------------
  |  Branch (178:9): [True: 0, False: 293k]
  ------------------
  179|      0|    Error2:
  180|      0|      pthread_mutex_destroy(&worker->impl_->mutex_);
  181|      0|      pthread_cond_destroy(&worker->impl_->condition_);
  182|      0|    Error:
  183|      0|      aom_free(worker->impl_);
  184|      0|      worker->impl_ = NULL;
  185|      0|      return 0;
  186|      0|    }
  187|       |#else
  188|       |    worker->status_ = AVX_WORKER_STATUS_OK;
  189|       |#endif
  190|   293k|  } else if (worker->status_ > AVX_WORKER_STATUS_OK) {
  ------------------
  |  Branch (190:14): [True: 0, False: 0]
  ------------------
  191|      0|    ok = sync(worker);
  192|      0|  }
  193|   293k|  assert(!ok || (worker->status_ == AVX_WORKER_STATUS_OK));
  194|   293k|  return ok;
  195|   293k|}
aom_thread.c:thread_loop:
   45|   292k|static THREADFN thread_loop(void *ptr) {
   46|   292k|  AVxWorker *const worker = (AVxWorker *)ptr;
   47|   292k|#ifdef HAVE_PTHREAD_SETNAME_NP
   48|       |#ifdef __APPLE__
   49|       |  if (worker->thread_name != NULL) {
   50|       |    // Apple's version of pthread_setname_np takes one argument and operates on
   51|       |    // the current thread only. The maximum size of the thread_name buffer was
   52|       |    // noted in the Chromium source code and was confirmed by experiments. If
   53|       |    // thread_name is too long, pthread_setname_np returns -1 with errno
   54|       |    // ENAMETOOLONG (63).
   55|       |    char thread_name[64];
   56|       |    strncpy(thread_name, worker->thread_name, sizeof(thread_name) - 1);
   57|       |    thread_name[sizeof(thread_name) - 1] = '\0';
   58|       |    pthread_setname_np(thread_name);
   59|       |  }
   60|       |#elif (defined(__GLIBC__) && !defined(__GNU__)) || defined(__BIONIC__)
   61|   293k|  if (worker->thread_name != NULL) {
  ------------------
  |  Branch (61:7): [True: 293k, False: 18.4E]
  ------------------
   62|       |    // Linux and Android require names (with nul) fit in 16 chars, otherwise
   63|       |    // pthread_setname_np() returns ERANGE (34).
   64|   293k|    char thread_name[16];
   65|   293k|    strncpy(thread_name, worker->thread_name, sizeof(thread_name) - 1);
   66|   293k|    thread_name[sizeof(thread_name) - 1] = '\0';
   67|   293k|    pthread_setname_np(pthread_self(), thread_name);
   68|   293k|  }
   69|   292k|#endif
   70|   292k|#endif
   71|   292k|  pthread_mutex_lock(&worker->impl_->mutex_);
   72|  1.47M|  for (;;) {
   73|  2.95M|    while (worker->status_ == AVX_WORKER_STATUS_OK) {  // wait in idling mode
  ------------------
  |  Branch (73:12): [True: 1.47M, False: 1.47M]
  ------------------
   74|  1.47M|      pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_);
   75|  1.47M|    }
   76|  1.47M|    if (worker->status_ == AVX_WORKER_STATUS_WORKING) {
  ------------------
  |  Branch (76:9): [True: 1.18M, False: 296k]
  ------------------
   77|       |      // When worker->status_ is AVX_WORKER_STATUS_WORKING, the main thread
   78|       |      // doesn't change worker->status_ and will wait until the worker changes
   79|       |      // worker->status_ to AVX_WORKER_STATUS_OK. See change_state(). So the
   80|       |      // worker can safely call execute() without holding worker->impl_->mutex_.
   81|       |      // When the worker reacquires worker->impl_->mutex_, worker->status_ must
   82|       |      // still be AVX_WORKER_STATUS_WORKING.
   83|  1.18M|      pthread_mutex_unlock(&worker->impl_->mutex_);
   84|  1.18M|      execute(worker);
   85|  1.18M|      pthread_mutex_lock(&worker->impl_->mutex_);
   86|  1.18M|      assert(worker->status_ == AVX_WORKER_STATUS_WORKING);
   87|  1.18M|      worker->status_ = AVX_WORKER_STATUS_OK;
   88|       |      // signal to the main thread that we're done (for sync())
   89|  1.18M|      pthread_cond_signal(&worker->impl_->condition_);
   90|  1.18M|    } else {
   91|   296k|      assert(worker->status_ == AVX_WORKER_STATUS_NOT_OK);  // finish the worker
   92|   296k|      break;
   93|   296k|    }
   94|  1.47M|  }
   95|   292k|  pthread_mutex_unlock(&worker->impl_->mutex_);
   96|       |  return THREAD_EXIT_SUCCESS;  // Thread is finished
  ------------------
  |  |  170|   292k|#define THREAD_EXIT_SUCCESS NULL
  ------------------
   97|   292k|}
aom_thread.c:sync:
  130|  1.38M|static int sync(AVxWorker *const worker) {
  131|  1.38M|#if CONFIG_MULTITHREAD
  132|  1.38M|  change_state(worker, AVX_WORKER_STATUS_OK);
  133|  1.38M|#endif
  134|       |  assert(worker->status_ <= AVX_WORKER_STATUS_OK);
  135|  1.38M|  return !worker->had_error;
  136|  1.38M|}
aom_thread.c:change_state:
  100|  2.86M|static void change_state(AVxWorker *const worker, AVxWorkerStatus new_status) {
  101|       |  // No-op when attempting to change state on a thread that didn't come up.
  102|       |  // Checking status_ without acquiring the lock first would result in a data
  103|       |  // race.
  104|  2.86M|  if (worker->impl_ == NULL) return;
  ------------------
  |  Branch (104:7): [True: 94.8k, False: 2.76M]
  ------------------
  105|       |
  106|  2.76M|  pthread_mutex_lock(&worker->impl_->mutex_);
  107|  2.76M|  if (worker->status_ >= AVX_WORKER_STATUS_OK) {
  ------------------
  |  Branch (107:7): [True: 2.76M, False: 0]
  ------------------
  108|       |    // wait for the worker to finish
  109|  2.88M|    while (worker->status_ != AVX_WORKER_STATUS_OK) {
  ------------------
  |  Branch (109:12): [True: 117k, False: 2.76M]
  ------------------
  110|   117k|      pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_);
  111|   117k|    }
  112|       |    // assign new status and release the working thread if needed
  113|  2.76M|    if (new_status != AVX_WORKER_STATUS_OK) {
  ------------------
  |  Branch (113:9): [True: 1.47M, False: 1.28M]
  ------------------
  114|  1.47M|      worker->status_ = new_status;
  115|  1.47M|      pthread_cond_signal(&worker->impl_->condition_);
  116|  1.47M|    }
  117|  2.76M|  }
  118|  2.76M|  pthread_mutex_unlock(&worker->impl_->mutex_);
  119|  2.76M|}
aom_thread.c:launch:
  203|  1.18M|static void launch(AVxWorker *const worker) {
  204|  1.18M|#if CONFIG_MULTITHREAD
  205|  1.18M|  change_state(worker, AVX_WORKER_STATUS_WORKING);
  206|       |#else
  207|       |  execute(worker);
  208|       |#endif
  209|  1.18M|}
aom_thread.c:execute:
  197|  1.43M|static void execute(AVxWorker *const worker) {
  198|  1.43M|  if (worker->hook != NULL) {
  ------------------
  |  Branch (198:7): [True: 1.43M, False: 18.4E]
  ------------------
  199|  1.43M|    worker->had_error |= !worker->hook(worker->data1, worker->data2);
  200|  1.43M|  }
  201|  1.43M|}
aom_thread.c:end:
  211|   327k|static void end(AVxWorker *const worker) {
  212|   327k|#if CONFIG_MULTITHREAD
  213|   327k|  if (worker->impl_ != NULL) {
  ------------------
  |  Branch (213:7): [True: 293k, False: 34.6k]
  ------------------
  214|   293k|    change_state(worker, AVX_WORKER_STATUS_NOT_OK);
  215|   293k|    pthread_join(worker->impl_->thread_, NULL);
  216|   293k|    pthread_mutex_destroy(&worker->impl_->mutex_);
  217|   293k|    pthread_cond_destroy(&worker->impl_->condition_);
  218|   293k|    aom_free(worker->impl_);
  219|   293k|    worker->impl_ = NULL;
  220|   293k|  }
  221|       |#else
  222|       |  worker->status_ = AVX_WORKER_STATUS_NOT_OK;
  223|       |  assert(worker->impl_ == NULL);
  224|       |#endif
  225|       |  assert(worker->status_ == AVX_WORKER_STATUS_NOT_OK);
  226|   327k|}

entenc.c:BSwap64:
   92|  12.5M|static inline uint64_t BSwap64(uint64_t x) {
   93|  12.5M|#if defined(HAVE_BUILTIN_BSWAP64)
   94|  12.5M|  return __builtin_bswap64(x);
   95|       |#elif defined(__x86_64__)
   96|       |  uint64_t swapped_bytes;
   97|       |  __asm__ volatile("bswapq %0" : "=r"(swapped_bytes) : "0"(x));
   98|       |  return swapped_bytes;
   99|       |#elif defined(_MSC_VER)
  100|       |  return (uint64_t)_byteswap_uint64(x);
  101|       |#else   // generic code for swapping 64-bit values (suggested by bdb@)
  102|       |  x = ((x & 0xffffffff00000000ull) >> 32) | ((x & 0x00000000ffffffffull) << 32);
  103|       |  x = ((x & 0xffff0000ffff0000ull) >> 16) | ((x & 0x0000ffff0000ffffull) << 16);
  104|       |  x = ((x & 0xff00ff00ff00ff00ull) >> 8) | ((x & 0x00ff00ff00ff00ffull) << 8);
  105|       |  return x;
  106|       |#endif  // HAVE_BUILTIN_BSWAP64
  107|  12.5M|}

av1_create_context_and_bufferpool:
 3005|  18.4k|                                                  int lap_lag_in_frames) {
 3006|  18.4k|  aom_codec_err_t res = AOM_CODEC_OK;
 3007|  18.4k|  BufferPool *buffer_pool = *p_buffer_pool;
 3008|       |
 3009|  18.4k|  if (buffer_pool == NULL) {
  ------------------
  |  Branch (3009:7): [True: 18.4k, False: 0]
  ------------------
 3010|  18.4k|    buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool));
 3011|  18.4k|    if (buffer_pool == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (3011:9): [True: 0, False: 18.4k]
  ------------------
 3012|  18.4k|    buffer_pool->num_frame_bufs =
 3013|  18.4k|        (oxcf->mode == ALLINTRA) ? FRAME_BUFFERS_ALLINTRA : FRAME_BUFFERS;
  ------------------
  |  |  567|      0|#define FRAME_BUFFERS_ALLINTRA 2
  ------------------
                      (oxcf->mode == ALLINTRA) ? FRAME_BUFFERS_ALLINTRA : FRAME_BUFFERS;
  ------------------
  |  |  561|  36.8k|#define FRAME_BUFFERS (REF_FRAMES + 1 + INTER_REFS_PER_FRAME)
  ------------------
  |  Branch (3013:9): [True: 0, False: 18.4k]
  ------------------
 3014|  18.4k|    buffer_pool->frame_bufs = (RefCntBuffer *)aom_calloc(
 3015|  18.4k|        buffer_pool->num_frame_bufs, sizeof(*buffer_pool->frame_bufs));
 3016|  18.4k|    if (buffer_pool->frame_bufs == NULL) {
  ------------------
  |  Branch (3016:9): [True: 0, False: 18.4k]
  ------------------
 3017|      0|      buffer_pool->num_frame_bufs = 0;
 3018|      0|      aom_free(buffer_pool);
 3019|      0|      return AOM_CODEC_MEM_ERROR;
 3020|      0|    }
 3021|  18.4k|#if CONFIG_MULTITHREAD
 3022|  18.4k|    if (pthread_mutex_init(&buffer_pool->pool_mutex, NULL)) {
  ------------------
  |  Branch (3022:9): [True: 0, False: 18.4k]
  ------------------
 3023|      0|      aom_free(buffer_pool->frame_bufs);
 3024|      0|      buffer_pool->frame_bufs = NULL;
 3025|      0|      buffer_pool->num_frame_bufs = 0;
 3026|      0|      aom_free(buffer_pool);
 3027|      0|      return AOM_CODEC_MEM_ERROR;
 3028|      0|    }
 3029|  18.4k|#endif
 3030|  18.4k|    *p_buffer_pool = buffer_pool;
 3031|  18.4k|  }
 3032|  18.4k|  *p_cpi =
 3033|  18.4k|      av1_create_compressor(ppi, oxcf, buffer_pool, stage, lap_lag_in_frames);
 3034|  18.4k|  if (*p_cpi == NULL) res = AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (3034:7): [True: 0, False: 18.4k]
  ------------------
 3035|       |
 3036|  18.4k|  return res;
 3037|  18.4k|}
av1_destroy_context_and_bufferpool:
 3195|  73.6k|                                        BufferPool **p_buffer_pool) {
 3196|  73.6k|  av1_remove_compressor(cpi);
 3197|  73.6k|  if (*p_buffer_pool) {
  ------------------
  |  Branch (3197:7): [True: 18.4k, False: 55.2k]
  ------------------
 3198|  18.4k|    av1_free_ref_frame_buffers(*p_buffer_pool);
 3199|  18.4k|#if CONFIG_MULTITHREAD
 3200|  18.4k|    pthread_mutex_destroy(&(*p_buffer_pool)->pool_mutex);
 3201|  18.4k|#endif
 3202|  18.4k|    aom_free(*p_buffer_pool);
 3203|       |    *p_buffer_pool = NULL;
 3204|  18.4k|  }
 3205|  73.6k|}
aom_codec_av1_cx:
 5413|  18.4k|aom_codec_iface_t *aom_codec_av1_cx(void) { return &aom_codec_av1_cx_algo; }
av1_cx_iface.c:set_encoder_config:
 1164|   155k|                               struct av1_extracfg *extra_cfg) {
 1165|   155k|  if (cfg->encoder_cfg.init_by_cfg_file) {
  ------------------
  |  Branch (1165:7): [True: 0, False: 155k]
  ------------------
 1166|      0|    update_default_encoder_config(&cfg->encoder_cfg, extra_cfg);
 1167|      0|  }
 1168|       |
 1169|   155k|  TuneCfg *const tune_cfg = &oxcf->tune_cfg;
 1170|   155k|  FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
 1171|   155k|  TileConfig *const tile_cfg = &oxcf->tile_cfg;
 1172|   155k|  ResizeCfg *const resize_cfg = &oxcf->resize_cfg;
 1173|   155k|  GFConfig *const gf_cfg = &oxcf->gf_cfg;
 1174|   155k|  PartitionCfg *const part_cfg = &oxcf->part_cfg;
 1175|   155k|  IntraModeCfg *const intra_mode_cfg = &oxcf->intra_mode_cfg;
 1176|   155k|  TxfmSizeTypeCfg *const txfm_cfg = &oxcf->txfm_cfg;
 1177|   155k|  CompoundTypeCfg *const comp_type_cfg = &oxcf->comp_type_cfg;
 1178|   155k|  SuperResCfg *const superres_cfg = &oxcf->superres_cfg;
 1179|   155k|  KeyFrameCfg *const kf_cfg = &oxcf->kf_cfg;
 1180|   155k|  DecoderModelCfg *const dec_model_cfg = &oxcf->dec_model_cfg;
 1181|   155k|  RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
 1182|   155k|  QuantizationCfg *const q_cfg = &oxcf->q_cfg;
 1183|   155k|  ColorCfg *const color_cfg = &oxcf->color_cfg;
 1184|   155k|  InputCfg *const input_cfg = &oxcf->input_cfg;
 1185|   155k|  AlgoCfg *const algo_cfg = &oxcf->algo_cfg;
 1186|   155k|  ToolCfg *const tool_cfg = &oxcf->tool_cfg;
 1187|       |
 1188|   155k|  oxcf->profile = cfg->g_profile;
 1189|   155k|  oxcf->max_threads = (int)cfg->g_threads;
 1190|       |
 1191|   155k|  switch (cfg->g_usage) {
 1192|  47.3k|    case AOM_USAGE_REALTIME: oxcf->mode = REALTIME; break;
  ------------------
  |  | 1029|  47.3k|#define AOM_USAGE_REALTIME 1u
  ------------------
  |  Branch (1192:5): [True: 47.3k, False: 108k]
  ------------------
 1193|      0|    case AOM_USAGE_ALL_INTRA: oxcf->mode = ALLINTRA; break;
  ------------------
  |  | 1031|      0|#define AOM_USAGE_ALL_INTRA 2u
  ------------------
  |  Branch (1193:5): [True: 0, False: 155k]
  ------------------
 1194|   108k|    default: oxcf->mode = GOOD; break;
  ------------------
  |  Branch (1194:5): [True: 108k, False: 47.3k]
  ------------------
 1195|   155k|  }
 1196|       |
 1197|       |  // Set frame-dimension related configuration.
 1198|   155k|  frm_dim_cfg->width = cfg->g_w;
 1199|   155k|  frm_dim_cfg->height = cfg->g_h;
 1200|   155k|  frm_dim_cfg->forced_max_frame_width = cfg->g_forced_max_frame_width;
 1201|   155k|  frm_dim_cfg->forced_max_frame_height = cfg->g_forced_max_frame_height;
 1202|   155k|  frm_dim_cfg->render_width = extra_cfg->render_width;
 1203|   155k|  frm_dim_cfg->render_height = extra_cfg->render_height;
 1204|       |
 1205|       |  // Set input video related configuration.
 1206|   155k|  input_cfg->input_bit_depth = cfg->g_input_bit_depth;
 1207|       |  // guess a frame rate if out of whack, use 30
 1208|   155k|  input_cfg->init_framerate = (double)cfg->g_timebase.den / cfg->g_timebase.num;
 1209|   155k|  if (cfg->g_pass >= AOM_RC_SECOND_PASS) {
  ------------------
  |  Branch (1209:7): [True: 0, False: 155k]
  ------------------
 1210|      0|    const size_t packet_sz = sizeof(FIRSTPASS_STATS);
 1211|      0|    const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);
 1212|      0|    input_cfg->limit = n_packets - 1;
 1213|   155k|  } else {
 1214|   155k|    input_cfg->limit = cfg->g_limit;
 1215|   155k|  }
 1216|   155k|  input_cfg->chroma_subsampling_x = extra_cfg->chroma_subsampling_x;
 1217|   155k|  input_cfg->chroma_subsampling_y = extra_cfg->chroma_subsampling_y;
 1218|   155k|  if (input_cfg->init_framerate > 180) {
  ------------------
  |  Branch (1218:7): [True: 0, False: 155k]
  ------------------
 1219|      0|    input_cfg->init_framerate = 30;
 1220|      0|    dec_model_cfg->timing_info_present = 0;
 1221|      0|  }
 1222|       |
 1223|       |  // Set Decoder model configuration.
 1224|   155k|  if (extra_cfg->timing_info_type == AOM_TIMING_EQUAL ||
  ------------------
  |  Branch (1224:7): [True: 0, False: 155k]
  ------------------
 1225|   155k|      extra_cfg->timing_info_type == AOM_TIMING_DEC_MODEL) {
  ------------------
  |  Branch (1225:7): [True: 0, False: 155k]
  ------------------
 1226|      0|    dec_model_cfg->timing_info_present = 1;
 1227|      0|    dec_model_cfg->timing_info.num_units_in_display_tick = cfg->g_timebase.num;
 1228|      0|    dec_model_cfg->timing_info.time_scale = cfg->g_timebase.den;
 1229|      0|    dec_model_cfg->timing_info.num_ticks_per_picture = 1;
 1230|   155k|  } else {
 1231|   155k|    dec_model_cfg->timing_info_present = 0;
 1232|   155k|  }
 1233|   155k|  if (extra_cfg->timing_info_type == AOM_TIMING_EQUAL) {
  ------------------
  |  Branch (1233:7): [True: 0, False: 155k]
  ------------------
 1234|      0|    dec_model_cfg->timing_info.equal_picture_interval = 1;
 1235|      0|    dec_model_cfg->decoder_model_info_present_flag = 0;
 1236|      0|    dec_model_cfg->display_model_info_present_flag = 1;
 1237|   155k|  } else if (extra_cfg->timing_info_type == AOM_TIMING_DEC_MODEL) {
  ------------------
  |  Branch (1237:14): [True: 0, False: 155k]
  ------------------
 1238|      0|    dec_model_cfg->num_units_in_decoding_tick = cfg->g_timebase.num;
 1239|      0|    dec_model_cfg->timing_info.equal_picture_interval = 0;
 1240|      0|    dec_model_cfg->decoder_model_info_present_flag = 1;
 1241|      0|    dec_model_cfg->display_model_info_present_flag = 1;
 1242|      0|  }
 1243|       |
 1244|   155k|  oxcf->pass = cfg->g_pass;
 1245|       |  // For backward compatibility, assume that if extra_cfg->passes==-1, then
 1246|       |  // passes = 1 or 2.
 1247|   155k|  if (extra_cfg->passes == -1) {
  ------------------
  |  Branch (1247:7): [True: 155k, False: 0]
  ------------------
 1248|   155k|    if (cfg->g_pass == AOM_RC_ONE_PASS) {
  ------------------
  |  Branch (1248:9): [True: 155k, False: 0]
  ------------------
 1249|   155k|      oxcf->passes = 1;
 1250|   155k|    } else {
 1251|      0|      oxcf->passes = 2;
 1252|      0|    }
 1253|   155k|  } else {
 1254|      0|    oxcf->passes = extra_cfg->passes;
 1255|      0|  }
 1256|       |
 1257|       |  // Set Rate Control configuration.
 1258|   155k|  rc_cfg->max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct;
 1259|   155k|  rc_cfg->max_inter_bitrate_pct = extra_cfg->rc_max_inter_bitrate_pct;
 1260|   155k|  rc_cfg->gf_cbr_boost_pct = extra_cfg->gf_cbr_boost_pct;
 1261|   155k|  rc_cfg->mode = cfg->rc_end_usage;
 1262|   155k|  rc_cfg->min_cr = extra_cfg->min_cr;
 1263|   155k|  rc_cfg->best_allowed_q =
 1264|   155k|      extra_cfg->lossless ? 0 : av1_quantizer_to_qindex(cfg->rc_min_quantizer);
  ------------------
  |  Branch (1264:7): [True: 5.24k, False: 150k]
  ------------------
 1265|   155k|  rc_cfg->worst_allowed_q =
 1266|   155k|      extra_cfg->lossless ? 0 : av1_quantizer_to_qindex(cfg->rc_max_quantizer);
  ------------------
  |  Branch (1266:7): [True: 5.24k, False: 150k]
  ------------------
 1267|   155k|  rc_cfg->cq_level = av1_quantizer_to_qindex(extra_cfg->cq_level);
 1268|   155k|  rc_cfg->under_shoot_pct = cfg->rc_undershoot_pct;
 1269|   155k|  rc_cfg->over_shoot_pct = cfg->rc_overshoot_pct;
 1270|   155k|  rc_cfg->maximum_buffer_size_ms = cfg->rc_buf_sz;
 1271|   155k|  rc_cfg->starting_buffer_level_ms = cfg->rc_buf_initial_sz;
 1272|   155k|  rc_cfg->optimal_buffer_level_ms = cfg->rc_buf_optimal_sz;
 1273|       |  // Convert target bandwidth from Kbit/s to Bit/s
 1274|   155k|  rc_cfg->target_bandwidth = 1000 * cfg->rc_target_bitrate;
 1275|   155k|  rc_cfg->drop_frames_water_mark = cfg->rc_dropframe_thresh;
 1276|   155k|  rc_cfg->vbr_corpus_complexity_lap = extra_cfg->vbr_corpus_complexity_lap;
 1277|   155k|  rc_cfg->vbrbias = cfg->rc_2pass_vbr_bias_pct;
 1278|   155k|  rc_cfg->vbrmin_section = cfg->rc_2pass_vbr_minsection_pct;
 1279|   155k|  rc_cfg->vbrmax_section = cfg->rc_2pass_vbr_maxsection_pct;
 1280|   155k|  rc_cfg->force_max_q = extra_cfg->force_max_q;
 1281|       |
 1282|       |  // Set Toolset related configuration.
 1283|   155k|  tool_cfg->bit_depth = cfg->g_bit_depth;
 1284|   155k|  tool_cfg->cdef_control = (CDEF_CONTROL)extra_cfg->enable_cdef;
 1285|   155k|  tool_cfg->enable_restoration =
 1286|   155k|      (cfg->g_usage == AOM_USAGE_REALTIME) ? 0 : extra_cfg->enable_restoration;
  ------------------
  |  | 1029|   155k|#define AOM_USAGE_REALTIME 1u
  ------------------
  |  Branch (1286:7): [True: 47.3k, False: 108k]
  ------------------
 1287|   155k|  tool_cfg->force_video_mode = extra_cfg->force_video_mode;
 1288|   155k|  tool_cfg->enable_palette = extra_cfg->enable_palette;
 1289|       |  // FIXME(debargha): Should this be:
 1290|       |  // tool_cfg->enable_ref_frame_mvs  = extra_cfg->allow_ref_frame_mvs &
 1291|       |  //                                         extra_cfg->enable_order_hint ?
 1292|       |  // Disallow using temporal MVs while large_scale_tile = 1.
 1293|   155k|  tool_cfg->enable_ref_frame_mvs =
 1294|   155k|      extra_cfg->allow_ref_frame_mvs && !cfg->large_scale_tile;
  ------------------
  |  Branch (1294:7): [True: 155k, False: 0]
  |  Branch (1294:41): [True: 155k, False: 0]
  ------------------
 1295|   155k|  tool_cfg->superblock_size = extra_cfg->superblock_size;
 1296|   155k|  tool_cfg->enable_monochrome = cfg->monochrome;
 1297|   155k|  tool_cfg->full_still_picture_hdr = cfg->full_still_picture_hdr != 0;
 1298|   155k|  tool_cfg->enable_dual_filter = extra_cfg->enable_dual_filter;
 1299|   155k|  tool_cfg->enable_order_hint = extra_cfg->enable_order_hint;
 1300|   155k|  tool_cfg->enable_interintra_comp = extra_cfg->enable_interintra_comp;
 1301|   155k|  tool_cfg->ref_frame_mvs_present =
 1302|   155k|      extra_cfg->enable_ref_frame_mvs & extra_cfg->enable_order_hint;
 1303|       |
 1304|       |  // Explicitly disable global motion in a few cases:
 1305|       |  // * For realtime mode, we never search global motion, and disabling
 1306|       |  //   it here prevents later code from allocating buffers we don't need
 1307|       |  // * For large scale tile mode, some of the intended use cases expect
 1308|       |  //   all frame headers to be identical. This breaks if global motion is
 1309|       |  //   used, since global motion data is stored in the frame header.
 1310|       |  //   eg, see test/lightfield_test.sh, which checks that all frame headers
 1311|       |  //   are the same.
 1312|   155k|  tool_cfg->enable_global_motion = extra_cfg->enable_global_motion &&
  ------------------
  |  Branch (1312:36): [True: 155k, False: 0]
  ------------------
 1313|   155k|                                   cfg->g_usage != AOM_USAGE_REALTIME &&
  ------------------
  |  | 1029|   311k|#define AOM_USAGE_REALTIME 1u
  ------------------
  |  Branch (1313:36): [True: 108k, False: 47.3k]
  ------------------
 1314|   108k|                                   !cfg->large_scale_tile;
  ------------------
  |  Branch (1314:36): [True: 108k, False: 0]
  ------------------
 1315|       |
 1316|   155k|  tool_cfg->error_resilient_mode =
 1317|   155k|      cfg->g_error_resilient | extra_cfg->error_resilient_mode;
 1318|   155k|  tool_cfg->frame_parallel_decoding_mode =
 1319|   155k|      extra_cfg->frame_parallel_decoding_mode;
 1320|       |
 1321|       |  // Set Quantization related configuration.
 1322|   155k|  q_cfg->using_qm = extra_cfg->enable_qm;
 1323|   155k|  q_cfg->qm_minlevel = extra_cfg->qm_min;
 1324|   155k|  q_cfg->qm_maxlevel = extra_cfg->qm_max;
 1325|   155k|  q_cfg->quant_b_adapt = extra_cfg->quant_b_adapt;
 1326|   155k|  q_cfg->enable_chroma_deltaq = extra_cfg->enable_chroma_deltaq;
 1327|   155k|  q_cfg->aq_mode = extra_cfg->aq_mode;
 1328|   155k|  q_cfg->deltaq_mode = extra_cfg->deltaq_mode;
 1329|   155k|  q_cfg->deltaq_strength = extra_cfg->deltaq_strength;
 1330|   155k|  q_cfg->use_fixed_qp_offsets =
 1331|   155k|      (rc_cfg->mode == AOM_Q) ? cfg->use_fixed_qp_offsets : 0;
  ------------------
  |  Branch (1331:7): [True: 108k, False: 47.3k]
  ------------------
 1332|       |
 1333|   155k|  q_cfg->enable_hdr_deltaq =
 1334|   155k|      (q_cfg->deltaq_mode == DELTA_Q_HDR) &&
  ------------------
  |  Branch (1334:7): [True: 0, False: 155k]
  ------------------
 1335|      0|      (cfg->g_bit_depth == AOM_BITS_10) &&
  ------------------
  |  Branch (1335:7): [True: 0, False: 0]
  ------------------
 1336|      0|      (extra_cfg->color_primaries == AOM_CICP_CP_BT_2020);
  ------------------
  |  Branch (1336:7): [True: 0, False: 0]
  ------------------
 1337|       |
 1338|   155k|  tool_cfg->enable_deltalf_mode =
 1339|   155k|      (q_cfg->deltaq_mode != NO_DELTA_Q) && extra_cfg->deltalf_mode;
  ------------------
  |  Branch (1339:7): [True: 155k, False: 0]
  |  Branch (1339:45): [True: 0, False: 155k]
  ------------------
 1340|       |
 1341|       |  // Set cost update frequency configuration.
 1342|   155k|  oxcf->cost_upd_freq.coeff = (COST_UPDATE_TYPE)extra_cfg->coeff_cost_upd_freq;
 1343|   155k|  oxcf->cost_upd_freq.mode = (COST_UPDATE_TYPE)extra_cfg->mode_cost_upd_freq;
 1344|       |  // Avoid MV cost update for allintra encoding mode.
 1345|   155k|  oxcf->cost_upd_freq.mv = (cfg->kf_max_dist != 0)
  ------------------
  |  Branch (1345:28): [True: 155k, False: 0]
  ------------------
 1346|   155k|                               ? (COST_UPDATE_TYPE)extra_cfg->mv_cost_upd_freq
 1347|   155k|                               : COST_UPD_OFF;
 1348|   155k|  oxcf->cost_upd_freq.dv = (COST_UPDATE_TYPE)extra_cfg->dv_cost_upd_freq;
 1349|       |
 1350|       |  // Set frame resize mode configuration.
 1351|   155k|  resize_cfg->resize_mode = (RESIZE_MODE)cfg->rc_resize_mode;
 1352|   155k|  resize_cfg->resize_scale_denominator = (uint8_t)cfg->rc_resize_denominator;
 1353|   155k|  resize_cfg->resize_kf_scale_denominator =
 1354|   155k|      (uint8_t)cfg->rc_resize_kf_denominator;
 1355|   155k|  if (resize_cfg->resize_mode == RESIZE_FIXED &&
  ------------------
  |  Branch (1355:7): [True: 0, False: 155k]
  ------------------
 1356|      0|      resize_cfg->resize_scale_denominator == SCALE_NUMERATOR &&
  ------------------
  |  |   22|   155k|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1356:7): [True: 0, False: 0]
  ------------------
 1357|      0|      resize_cfg->resize_kf_scale_denominator == SCALE_NUMERATOR)
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1357:7): [True: 0, False: 0]
  ------------------
 1358|      0|    resize_cfg->resize_mode = RESIZE_NONE;
 1359|       |
 1360|       |  // Set encoder algorithm related configuration.
 1361|   155k|  algo_cfg->enable_overlay = extra_cfg->enable_overlay;
 1362|   155k|  algo_cfg->disable_trellis_quant = extra_cfg->disable_trellis_quant;
 1363|   155k|  algo_cfg->sharpness = extra_cfg->sharpness;
 1364|   155k|  algo_cfg->enable_adaptive_sharpness = extra_cfg->enable_adaptive_sharpness;
 1365|   155k|  algo_cfg->arnr_max_frames = extra_cfg->arnr_max_frames;
 1366|   155k|  algo_cfg->arnr_strength = extra_cfg->arnr_strength;
 1367|   155k|  algo_cfg->cdf_update_mode = (uint8_t)extra_cfg->cdf_update_mode;
 1368|       |  // TODO(any): Fix and Enable TPL for resize-mode > 0
 1369|   155k|  algo_cfg->enable_tpl_model =
 1370|   155k|      resize_cfg->resize_mode ? 0 : extra_cfg->enable_tpl_model;
  ------------------
  |  Branch (1370:7): [True: 0, False: 155k]
  ------------------
 1371|   155k|  algo_cfg->loopfilter_control = extra_cfg->loopfilter_control;
 1372|   155k|  algo_cfg->skip_postproc_filtering = extra_cfg->skip_postproc_filtering;
 1373|   155k|  algo_cfg->mode_ref_delta_enabled = extra_cfg->mode_ref_delta_enabled;
 1374|   155k|  algo_cfg->screen_detection_mode = extra_cfg->screen_detection_mode;
 1375|       |
 1376|       |  // Set two-pass stats configuration.
 1377|   155k|  oxcf->twopass_stats_in = cfg->rc_twopass_stats_in;
 1378|       |
 1379|   155k|  if (extra_cfg->two_pass_output)
  ------------------
  |  Branch (1379:7): [True: 0, False: 155k]
  ------------------
 1380|      0|    oxcf->two_pass_output = extra_cfg->two_pass_output;
 1381|       |
 1382|   155k|  oxcf->second_pass_log = extra_cfg->second_pass_log;
 1383|       |
 1384|       |  // Set Key frame configuration.
 1385|   155k|  kf_cfg->fwd_kf_enabled = cfg->fwd_kf_enabled;
 1386|   155k|  kf_cfg->auto_key =
 1387|   155k|      cfg->kf_mode == AOM_KF_AUTO && cfg->kf_min_dist != cfg->kf_max_dist;
  ------------------
  |  Branch (1387:7): [True: 155k, False: 0]
  |  Branch (1387:38): [True: 155k, False: 0]
  ------------------
 1388|   155k|  kf_cfg->key_freq_min = cfg->kf_min_dist;
 1389|   155k|  kf_cfg->key_freq_max = cfg->kf_max_dist;
 1390|   155k|  kf_cfg->sframe_dist = cfg->sframe_dist;
 1391|   155k|  kf_cfg->sframe_mode = cfg->sframe_mode;
 1392|   155k|  kf_cfg->enable_sframe = extra_cfg->s_frame_mode;
 1393|   155k|  kf_cfg->enable_keyframe_filtering = extra_cfg->enable_keyframe_filtering;
 1394|   155k|  kf_cfg->fwd_kf_dist = extra_cfg->fwd_kf_dist;
 1395|       |  // Disable key frame filtering in all intra mode.
 1396|   155k|  if (cfg->kf_max_dist == 0) {
  ------------------
  |  Branch (1396:7): [True: 0, False: 155k]
  ------------------
 1397|      0|    kf_cfg->enable_keyframe_filtering = 0;
 1398|      0|  }
 1399|   155k|  kf_cfg->enable_intrabc = extra_cfg->enable_intrabc;
 1400|       |
 1401|   155k|  oxcf->speed = extra_cfg->cpu_used;
 1402|   155k|  if (oxcf->mode == REALTIME) {
  ------------------
  |  Branch (1402:7): [True: 47.3k, False: 108k]
  ------------------
 1403|       |#if CONFIG_REALTIME_ONLY
 1404|       |    oxcf->speed = AOMMAX(oxcf->speed, 5);
 1405|       |#endif
 1406|       |    // TODO(yunqingwang, any) In REALTIME mode, 1080p performance at speed 5 & 6
 1407|       |    // is quite bad. Force to use speed 7 for now. Will investigate it when we
 1408|       |    // work on rd path optimization later.
 1409|  47.3k|    if (AOMMIN(cfg->g_w, cfg->g_h) >= 1080 && oxcf->speed < 7) oxcf->speed = 7;
  ------------------
  |  |   34|  47.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.6k, False: 28.6k]
  |  |  ------------------
  ------------------
  |  Branch (1409:9): [True: 0, False: 47.3k]
  |  Branch (1409:47): [True: 0, False: 0]
  ------------------
 1410|  47.3k|  }
 1411|       |
 1412|       |  // Now, low complexity decode mode supports good-quality encoding (speed 1 to
 1413|       |  // 3) for vertical videos (608p to 1080p) and horizontal videos (720p to
 1414|       |  // 1080p) when sharpness is not equal to 3. This can be further modified if
 1415|       |  // needed.
 1416|   155k|  const int is_low_complexity_decode_mode_supported =
 1417|   155k|      (cfg->g_usage == AOM_USAGE_GOOD_QUALITY) &&
  ------------------
  |  | 1027|   155k|#define AOM_USAGE_GOOD_QUALITY 0u
  ------------------
  |  Branch (1417:7): [True: 108k, False: 47.3k]
  ------------------
 1418|   108k|      (oxcf->speed >= 1 && oxcf->speed <= 3) &&
  ------------------
  |  Branch (1418:8): [True: 50.7k, False: 57.7k]
  |  Branch (1418:28): [True: 0, False: 50.7k]
  ------------------
 1419|      0|      (AOMMIN(cfg->g_w, cfg->g_h) >= 608 &&
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1419:8): [True: 0, False: 0]
  ------------------
 1420|      0|       AOMMIN(cfg->g_w, cfg->g_h) <= 1080) &&
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1420:8): [True: 0, False: 0]
  ------------------
 1421|      0|      (extra_cfg->sharpness != 3);
  ------------------
  |  Branch (1421:7): [True: 0, False: 0]
  ------------------
 1422|   155k|  oxcf->enable_low_complexity_decode =
 1423|   155k|      extra_cfg->enable_low_complexity_decode &&
  ------------------
  |  Branch (1423:7): [True: 0, False: 155k]
  ------------------
 1424|      0|      is_low_complexity_decode_mode_supported;
  ------------------
  |  Branch (1424:7): [True: 0, False: 0]
  ------------------
 1425|       |
 1426|       |  // Set Color related configuration.
 1427|   155k|  color_cfg->color_primaries = extra_cfg->color_primaries;
 1428|   155k|  color_cfg->transfer_characteristics = extra_cfg->transfer_characteristics;
 1429|   155k|  color_cfg->matrix_coefficients = extra_cfg->matrix_coefficients;
 1430|   155k|  color_cfg->color_range = extra_cfg->color_range;
 1431|   155k|  color_cfg->chroma_sample_position = extra_cfg->chroma_sample_position;
 1432|       |
 1433|       |  // Set Group of frames configuration.
 1434|       |#if CONFIG_REALTIME_ONLY
 1435|       |  // When CONFIG_REALTIME_ONLY=1 and mode=REALTIME, then force lag_in_frames
 1436|       |  // = 0.
 1437|       |  gf_cfg->lag_in_frames = (oxcf->mode == REALTIME)
 1438|       |                              ? 0
 1439|       |                              : clamp(cfg->g_lag_in_frames, 0, MAX_LAG_BUFFERS);
 1440|       |#else
 1441|   155k|  gf_cfg->lag_in_frames = clamp(cfg->g_lag_in_frames, 0, MAX_LAG_BUFFERS);
  ------------------
  |  |   28|   155k|#define MAX_LAG_BUFFERS 48
  ------------------
 1442|   155k|#endif
 1443|       |
 1444|       |  // Modify lag_in_frames slightly for better coding performance (e.g. better
 1445|       |  // temporal filtering result).
 1446|   155k|  if (oxcf->mode == GOOD && gf_cfg->lag_in_frames >= 32 &&
  ------------------
  |  Branch (1446:7): [True: 108k, False: 47.3k]
  |  Branch (1446:29): [True: 0, False: 108k]
  ------------------
 1447|      0|      gf_cfg->lag_in_frames < 39)
  ------------------
  |  Branch (1447:7): [True: 0, False: 0]
  ------------------
 1448|      0|    gf_cfg->lag_in_frames = AOMMIN(39, MAX_LAG_BUFFERS);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1449|       |
 1450|   155k|  gf_cfg->enable_auto_arf = extra_cfg->enable_auto_alt_ref;
 1451|   155k|  gf_cfg->enable_auto_brf = extra_cfg->enable_auto_bwd_ref;
 1452|   155k|  gf_cfg->min_gf_interval = extra_cfg->min_gf_interval;
 1453|   155k|  gf_cfg->max_gf_interval = extra_cfg->max_gf_interval;
 1454|   155k|  gf_cfg->gf_min_pyr_height = extra_cfg->gf_min_pyr_height;
 1455|   155k|  gf_cfg->gf_max_pyr_height = extra_cfg->gf_max_pyr_height;
 1456|       |
 1457|       |  // Set tune related configuration.
 1458|   155k|  tune_cfg->tuning = extra_cfg->tuning;
 1459|   155k|  tune_cfg->vmaf_model_path = extra_cfg->vmaf_model_path;
 1460|   155k|  tune_cfg->content = extra_cfg->content;
 1461|   155k|  if (cfg->large_scale_tile) {
  ------------------
  |  Branch (1461:7): [True: 0, False: 155k]
  ------------------
 1462|      0|    tune_cfg->film_grain_test_vector = 0;
 1463|      0|    tune_cfg->film_grain_table_filename = NULL;
 1464|   155k|  } else {
 1465|   155k|    tune_cfg->film_grain_test_vector = extra_cfg->film_grain_test_vector;
 1466|   155k|    tune_cfg->film_grain_table_filename = extra_cfg->film_grain_table_filename;
 1467|   155k|  }
 1468|   155k|  tune_cfg->dist_metric = extra_cfg->dist_metric;
 1469|   155k|#if CONFIG_DENOISE
 1470|   155k|  oxcf->noise_level = extra_cfg->noise_level;
 1471|   155k|  oxcf->noise_block_size = extra_cfg->noise_block_size;
 1472|   155k|  oxcf->enable_dnl_denoising = extra_cfg->enable_dnl_denoising;
 1473|   155k|#endif
 1474|       |
 1475|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 1476|       |  // Temporal denoiser is for nonrd pickmode so disable it for speed < 7.
 1477|       |  // Also disable it for speed 7 for now since it needs to be modified for
 1478|       |  // the check_partition_merge_mode feature.
 1479|       |  if (cfg->g_bit_depth == AOM_BITS_8 && oxcf->speed > 7) {
 1480|       |    oxcf->noise_sensitivity = extra_cfg->noise_sensitivity;
 1481|       |  } else {
 1482|       |    oxcf->noise_sensitivity = 0;
 1483|       |  }
 1484|       |#endif
 1485|       |  // Set Tile related configuration.
 1486|   155k|  tile_cfg->num_tile_groups = extra_cfg->num_tg;
 1487|       |  // In large-scale tile encoding mode, num_tile_groups is always 1.
 1488|   155k|  if (cfg->large_scale_tile) tile_cfg->num_tile_groups = 1;
  ------------------
  |  Branch (1488:7): [True: 0, False: 155k]
  ------------------
 1489|   155k|  tile_cfg->mtu = extra_cfg->mtu_size;
 1490|   155k|  tile_cfg->enable_large_scale_tile = cfg->large_scale_tile;
 1491|   155k|  tile_cfg->enable_single_tile_decoding =
 1492|   155k|      (tile_cfg->enable_large_scale_tile) ? extra_cfg->single_tile_decoding : 0;
  ------------------
  |  Branch (1492:7): [True: 0, False: 155k]
  ------------------
 1493|   155k|  if (extra_cfg->auto_tiles) {
  ------------------
  |  Branch (1493:7): [True: 0, False: 155k]
  ------------------
 1494|      0|    set_auto_tiles(tile_cfg, cfg->g_w, cfg->g_h, cfg->g_threads);
 1495|      0|    extra_cfg->tile_columns = tile_cfg->tile_columns;
 1496|      0|    extra_cfg->tile_rows = tile_cfg->tile_rows;
 1497|   155k|  } else {
 1498|   155k|    tile_cfg->tile_columns = extra_cfg->tile_columns;
 1499|   155k|    tile_cfg->tile_rows = extra_cfg->tile_rows;
 1500|   155k|  }
 1501|   155k|  tile_cfg->tile_width_count = AOMMIN(cfg->tile_width_count, MAX_TILE_COLS);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
 1502|   155k|  tile_cfg->tile_height_count = AOMMIN(cfg->tile_height_count, MAX_TILE_ROWS);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
 1503|   155k|  for (int i = 0; i < tile_cfg->tile_width_count; i++) {
  ------------------
  |  Branch (1503:19): [True: 0, False: 155k]
  ------------------
 1504|      0|    tile_cfg->tile_widths[i] = cfg->tile_widths[i];
 1505|      0|  }
 1506|   155k|  for (int i = 0; i < tile_cfg->tile_height_count; i++) {
  ------------------
  |  Branch (1506:19): [True: 0, False: 155k]
  ------------------
 1507|      0|    tile_cfg->tile_heights[i] = cfg->tile_heights[i];
 1508|      0|  }
 1509|   155k|  tile_cfg->enable_ext_tile_debug = extra_cfg->ext_tile_debug;
 1510|       |
 1511|   155k|  if (tile_cfg->enable_large_scale_tile) {
  ------------------
  |  Branch (1511:7): [True: 0, False: 155k]
  ------------------
 1512|       |    // The superblock_size can only be AOM_SUPERBLOCK_SIZE_64X64 or
 1513|       |    // AOM_SUPERBLOCK_SIZE_128X128 while tile_cfg->enable_large_scale_tile = 1.
 1514|       |    // If superblock_size = AOM_SUPERBLOCK_SIZE_DYNAMIC, hard set it to
 1515|       |    // AOM_SUPERBLOCK_SIZE_64X64(default value in large_scale_tile).
 1516|      0|    if (extra_cfg->superblock_size != AOM_SUPERBLOCK_SIZE_64X64 &&
  ------------------
  |  Branch (1516:9): [True: 0, False: 0]
  ------------------
 1517|      0|        extra_cfg->superblock_size != AOM_SUPERBLOCK_SIZE_128X128)
  ------------------
  |  Branch (1517:9): [True: 0, False: 0]
  ------------------
 1518|      0|      tool_cfg->superblock_size = AOM_SUPERBLOCK_SIZE_64X64;
 1519|      0|  }
 1520|       |
 1521|       |  // Set reference frame related configuration.
 1522|   155k|  oxcf->ref_frm_cfg.max_reference_frames = extra_cfg->max_reference_frames;
 1523|   155k|  oxcf->ref_frm_cfg.enable_reduced_reference_set =
 1524|   155k|      extra_cfg->enable_reduced_reference_set;
 1525|   155k|  oxcf->ref_frm_cfg.enable_onesided_comp = extra_cfg->enable_onesided_comp;
 1526|       |
 1527|   155k|  oxcf->row_mt = extra_cfg->row_mt;
 1528|   155k|  oxcf->fp_mt = extra_cfg->fp_mt;
 1529|       |
 1530|       |  // Set motion mode related configuration.
 1531|   155k|  oxcf->motion_mode_cfg.enable_obmc = extra_cfg->enable_obmc;
 1532|   155k|  oxcf->motion_mode_cfg.enable_warped_motion = extra_cfg->enable_warped_motion;
 1533|   155k|#if !CONFIG_REALTIME_ONLY
 1534|   155k|  if (cfg->g_usage == AOM_USAGE_REALTIME && oxcf->speed >= 7 &&
  ------------------
  |  | 1029|   311k|#define AOM_USAGE_REALTIME 1u
  ------------------
  |  Branch (1534:7): [True: 47.3k, False: 108k]
  |  Branch (1534:45): [True: 24.7k, False: 22.5k]
  ------------------
 1535|  24.7k|      oxcf->tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (1535:7): [True: 0, False: 24.7k]
  ------------------
 1536|       |    // TODO(marpan): warped motion is causing a crash for RT mode with screen
 1537|       |    // in nonrd (speed >= 7), for non-realtime build.
 1538|       |    // Re-enable/allow when the issue is fixed.
 1539|      0|    oxcf->motion_mode_cfg.enable_warped_motion = 0;
 1540|      0|    oxcf->motion_mode_cfg.allow_warped_motion = 0;
 1541|   155k|  } else {
 1542|   155k|    oxcf->motion_mode_cfg.allow_warped_motion =
 1543|   155k|        (extra_cfg->allow_warped_motion & extra_cfg->enable_warped_motion);
 1544|   155k|  }
 1545|       |#else
 1546|       |  oxcf->motion_mode_cfg.allow_warped_motion =
 1547|       |      (cfg->g_usage == AOM_USAGE_REALTIME && oxcf->speed >= 7)
 1548|       |          ? false
 1549|       |          : (extra_cfg->allow_warped_motion & extra_cfg->enable_warped_motion);
 1550|       |#endif
 1551|       |
 1552|       |  // Set partition related configuration.
 1553|   155k|  part_cfg->enable_rect_partitions = extra_cfg->enable_rect_partitions;
 1554|   155k|  part_cfg->enable_ab_partitions = extra_cfg->enable_ab_partitions;
 1555|   155k|  part_cfg->enable_1to4_partitions = extra_cfg->enable_1to4_partitions;
 1556|   155k|  part_cfg->min_partition_size = extra_cfg->min_partition_size;
 1557|   155k|  part_cfg->max_partition_size = extra_cfg->max_partition_size;
 1558|       |
 1559|       |  // Set intra mode configuration.
 1560|   155k|  intra_mode_cfg->enable_angle_delta = extra_cfg->enable_angle_delta;
 1561|   155k|  intra_mode_cfg->enable_intra_edge_filter =
 1562|   155k|      extra_cfg->enable_intra_edge_filter;
 1563|   155k|  intra_mode_cfg->enable_filter_intra = extra_cfg->enable_filter_intra;
 1564|   155k|  intra_mode_cfg->enable_smooth_intra = extra_cfg->enable_smooth_intra;
 1565|   155k|  intra_mode_cfg->enable_paeth_intra = extra_cfg->enable_paeth_intra;
 1566|   155k|  intra_mode_cfg->enable_cfl_intra = extra_cfg->enable_cfl_intra;
 1567|   155k|  intra_mode_cfg->enable_directional_intra =
 1568|   155k|      extra_cfg->enable_directional_intra;
 1569|   155k|  intra_mode_cfg->enable_diagonal_intra = extra_cfg->enable_diagonal_intra;
 1570|   155k|  intra_mode_cfg->auto_intra_tools_off = extra_cfg->auto_intra_tools_off;
 1571|       |
 1572|       |  // Set transform size/type configuration.
 1573|   155k|  txfm_cfg->enable_tx64 = extra_cfg->enable_tx64;
 1574|   155k|  txfm_cfg->enable_flip_idtx = extra_cfg->enable_flip_idtx;
 1575|   155k|  txfm_cfg->enable_rect_tx = extra_cfg->enable_rect_tx;
 1576|   155k|  txfm_cfg->reduced_tx_type_set = extra_cfg->reduced_tx_type_set;
 1577|   155k|  txfm_cfg->use_intra_dct_only = extra_cfg->use_intra_dct_only;
 1578|   155k|  txfm_cfg->use_inter_dct_only = extra_cfg->use_inter_dct_only;
 1579|   155k|  txfm_cfg->use_intra_default_tx_only = extra_cfg->use_intra_default_tx_only;
 1580|   155k|  txfm_cfg->enable_tx_size_search = extra_cfg->enable_tx_size_search;
 1581|       |
 1582|       |  // Set compound type configuration.
 1583|   155k|  comp_type_cfg->enable_dist_wtd_comp =
 1584|   155k|      extra_cfg->enable_dist_wtd_comp & extra_cfg->enable_order_hint;
 1585|   155k|  comp_type_cfg->enable_masked_comp = extra_cfg->enable_masked_comp;
 1586|   155k|  comp_type_cfg->enable_diff_wtd_comp =
 1587|   155k|      extra_cfg->enable_masked_comp & extra_cfg->enable_diff_wtd_comp;
 1588|   155k|  comp_type_cfg->enable_interinter_wedge =
 1589|   155k|      extra_cfg->enable_masked_comp & extra_cfg->enable_interinter_wedge;
 1590|   155k|  comp_type_cfg->enable_smooth_interintra =
 1591|   155k|      extra_cfg->enable_interintra_comp && extra_cfg->enable_smooth_interintra;
  ------------------
  |  Branch (1591:7): [True: 155k, False: 0]
  |  Branch (1591:44): [True: 155k, False: 0]
  ------------------
 1592|   155k|  comp_type_cfg->enable_interintra_wedge =
 1593|   155k|      extra_cfg->enable_interintra_comp & extra_cfg->enable_interintra_wedge;
 1594|       |
 1595|       |  // Set Super-resolution mode configuration.
 1596|   155k|  if (extra_cfg->lossless || cfg->large_scale_tile) {
  ------------------
  |  Branch (1596:7): [True: 5.24k, False: 150k]
  |  Branch (1596:30): [True: 0, False: 150k]
  ------------------
 1597|  5.24k|    disable_superres(superres_cfg);
 1598|   150k|  } else {
 1599|   150k|    superres_cfg->superres_mode = cfg->rc_superres_mode;
 1600|   150k|    superres_cfg->superres_scale_denominator =
 1601|   150k|        (uint8_t)cfg->rc_superres_denominator;
 1602|   150k|    superres_cfg->superres_kf_scale_denominator =
 1603|   150k|        (uint8_t)cfg->rc_superres_kf_denominator;
 1604|   150k|    superres_cfg->superres_qthresh =
 1605|   150k|        av1_quantizer_to_qindex(cfg->rc_superres_qthresh);
 1606|   150k|    superres_cfg->superres_kf_qthresh =
 1607|   150k|        av1_quantizer_to_qindex(cfg->rc_superres_kf_qthresh);
 1608|   150k|    if (superres_cfg->superres_mode == AOM_SUPERRES_FIXED &&
  ------------------
  |  Branch (1608:9): [True: 0, False: 150k]
  ------------------
 1609|      0|        superres_cfg->superres_scale_denominator == SCALE_NUMERATOR &&
  ------------------
  |  |   22|   150k|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1609:9): [True: 0, False: 0]
  ------------------
 1610|      0|        superres_cfg->superres_kf_scale_denominator == SCALE_NUMERATOR) {
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1610:9): [True: 0, False: 0]
  ------------------
 1611|      0|      disable_superres(superres_cfg);
 1612|      0|    }
 1613|   150k|    if (superres_cfg->superres_mode == AOM_SUPERRES_QTHRESH &&
  ------------------
  |  Branch (1613:9): [True: 0, False: 150k]
  ------------------
 1614|      0|        superres_cfg->superres_qthresh == 255 &&
  ------------------
  |  Branch (1614:9): [True: 0, False: 0]
  ------------------
 1615|      0|        superres_cfg->superres_kf_qthresh == 255) {
  ------------------
  |  Branch (1615:9): [True: 0, False: 0]
  ------------------
 1616|      0|      disable_superres(superres_cfg);
 1617|      0|    }
 1618|   150k|  }
 1619|       |
 1620|   155k|  superres_cfg->enable_superres =
 1621|   155k|      (superres_cfg->superres_mode != AOM_SUPERRES_NONE) &&
  ------------------
  |  Branch (1621:7): [True: 0, False: 155k]
  ------------------
 1622|      0|      extra_cfg->enable_superres;
  ------------------
  |  Branch (1622:7): [True: 0, False: 0]
  ------------------
 1623|   155k|  if (!superres_cfg->enable_superres) {
  ------------------
  |  Branch (1623:7): [True: 155k, False: 0]
  ------------------
 1624|   155k|    disable_superres(superres_cfg);
 1625|   155k|  }
 1626|       |
 1627|   155k|  if (input_cfg->limit == 1) {
  ------------------
  |  Branch (1627:7): [True: 0, False: 155k]
  ------------------
 1628|       |    // still picture mode, display model and timing is meaningless
 1629|      0|    dec_model_cfg->display_model_info_present_flag = 0;
 1630|      0|    dec_model_cfg->timing_info_present = 0;
 1631|      0|  }
 1632|       |
 1633|   155k|  oxcf->save_as_annexb = cfg->save_as_annexb;
 1634|       |
 1635|       |  // Set unit test related configuration.
 1636|   155k|  oxcf->unit_test_cfg.motion_vector_unit_test =
 1637|   155k|      extra_cfg->motion_vector_unit_test;
 1638|   155k|  oxcf->unit_test_cfg.sb_multipass_unit_test =
 1639|   155k|      extra_cfg->sb_multipass_unit_test;
 1640|       |
 1641|   155k|  oxcf->border_in_pixels =
 1642|   155k|      av1_get_enc_border_size(av1_is_resize_needed(oxcf),
 1643|   155k|                              (oxcf->kf_cfg.key_freq_max == 0), BLOCK_128X128);
 1644|   155k|  memcpy(oxcf->target_seq_level_idx, extra_cfg->target_seq_level_idx,
 1645|   155k|         sizeof(oxcf->target_seq_level_idx));
 1646|   155k|  oxcf->tier_mask = extra_cfg->tier_mask;
 1647|       |
 1648|   155k|  oxcf->partition_info_path = extra_cfg->partition_info_path;
 1649|       |
 1650|   155k|  oxcf->enable_rate_guide_deltaq = extra_cfg->enable_rate_guide_deltaq;
 1651|   155k|  oxcf->rate_distribution_info = extra_cfg->rate_distribution_info;
 1652|       |
 1653|   155k|  oxcf->strict_level_conformance = extra_cfg->strict_level_conformance;
 1654|       |
 1655|   155k|  oxcf->kf_max_pyr_height = extra_cfg->kf_max_pyr_height;
 1656|       |
 1657|   155k|  oxcf->sb_qp_sweep = extra_cfg->sb_qp_sweep;
 1658|   155k|}
av1_cx_iface.c:disable_superres:
 1078|   161k|static void disable_superres(SuperResCfg *const superres_cfg) {
 1079|   161k|  superres_cfg->superres_mode = AOM_SUPERRES_NONE;
 1080|   161k|  superres_cfg->superres_scale_denominator = SCALE_NUMERATOR;
  ------------------
  |  |   22|   161k|#define SCALE_NUMERATOR 8
  ------------------
 1081|   161k|  superres_cfg->superres_kf_scale_denominator = SCALE_NUMERATOR;
  ------------------
  |  |   22|   161k|#define SCALE_NUMERATOR 8
  ------------------
 1082|   161k|  superres_cfg->superres_qthresh = 255;
 1083|   161k|  superres_cfg->superres_kf_qthresh = 255;
 1084|   161k|}
av1_cx_iface.c:encoder_init:
 3074|  18.4k|static aom_codec_err_t encoder_init(aom_codec_ctx_t *ctx) {
 3075|  18.4k|  aom_codec_err_t res = AOM_CODEC_OK;
 3076|       |
 3077|  18.4k|  if (ctx->priv == NULL) {
  ------------------
  |  Branch (3077:7): [True: 18.4k, False: 0]
  ------------------
 3078|  18.4k|    aom_codec_alg_priv_t *const priv = aom_calloc(1, sizeof(*priv));
 3079|  18.4k|    if (priv == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (3079:9): [True: 0, False: 18.4k]
  ------------------
 3080|       |
 3081|  18.4k|    ctx->priv = (aom_codec_priv_t *)priv;
 3082|  18.4k|    ctx->priv->init_flags = ctx->init_flags;
 3083|       |
 3084|       |    // Update the reference to the config structure to an internal copy.
 3085|  18.4k|    assert(ctx->config.enc);
 3086|  18.4k|    priv->cfg = *ctx->config.enc;
 3087|  18.4k|    ctx->config.enc = &priv->cfg;
 3088|       |
 3089|  18.4k|    priv->extra_cfg = default_extra_cfg;
 3090|       |    // Special handling:
 3091|       |    // By default, if omitted: --enable-cdef=1, --screen-detection-mode=1,
 3092|       |    // --qm-min=5, and --qm-max=9.
 3093|       |    // Here we set its default values to --enable-cdef=0,
 3094|       |    // --screen-detection-mode=2, --qm-min=4, and --qm-max=10 when --allintra
 3095|       |    // is turned on.
 3096|       |    // However, if users set --enable-cdef, --screen-detection-mode, --qm-min,
 3097|       |    // or --qm-max, either from the command line or aom_codec_control(), the
 3098|       |    // encoder still respects it.
 3099|  18.4k|    if (priv->cfg.g_usage == AOM_USAGE_ALL_INTRA) {
  ------------------
  |  | 1031|  18.4k|#define AOM_USAGE_ALL_INTRA 2u
  ------------------
  |  Branch (3099:9): [True: 0, False: 18.4k]
  ------------------
 3100|       |      // CDEF has been found to blur images, so it's disabled in all-intra mode
 3101|      0|      priv->extra_cfg.enable_cdef = 0;
 3102|       |      // Enable "anti-aliased text and graphics aware" screen detection mode.
 3103|      0|      priv->extra_cfg.screen_detection_mode =
 3104|      0|          AOM_SCREEN_DETECTION_ANTIALIASING_AWARE;
 3105|       |      // These QM min/max values have been found to be beneficial for images,
 3106|       |      // when used with an alternative QM formula (see
 3107|       |      // aom_get_qmlevel_allintra()).
 3108|       |      // These values could also be beneficial for other usage modes, but
 3109|       |      // further testing is required.
 3110|      0|      priv->extra_cfg.qm_min = DEFAULT_QM_FIRST_ALLINTRA;
  ------------------
  |  |   39|      0|#define DEFAULT_QM_FIRST_ALLINTRA 4
  ------------------
 3111|      0|      priv->extra_cfg.qm_max = DEFAULT_QM_LAST_ALLINTRA;
  ------------------
  |  |   40|      0|#define DEFAULT_QM_LAST_ALLINTRA 10
  ------------------
 3112|      0|    }
 3113|  18.4k|    av1_initialize_enc(priv->cfg.g_usage, priv->cfg.rc_end_usage);
 3114|       |
 3115|  18.4k|    res = validate_config(priv, &priv->cfg, &priv->extra_cfg);
 3116|       |
 3117|  18.4k|    if (res == AOM_CODEC_OK) {
  ------------------
  |  Branch (3117:9): [True: 18.4k, False: 0]
  ------------------
 3118|  18.4k|      int *num_lap_buffers = &priv->num_lap_buffers;
 3119|  18.4k|      int lap_lag_in_frames = 0;
 3120|  18.4k|      *num_lap_buffers = 0;
 3121|  18.4k|      priv->timestamp_ratio.den = priv->cfg.g_timebase.den;
 3122|  18.4k|      priv->timestamp_ratio.num =
 3123|  18.4k|          (int64_t)priv->cfg.g_timebase.num * TICKS_PER_SEC;
  ------------------
  |  | 4051|  18.4k|#define TICKS_PER_SEC 10000000LL
  ------------------
 3124|  18.4k|      reduce_ratio(&priv->timestamp_ratio);
 3125|       |
 3126|  18.4k|      set_encoder_config(&priv->oxcf, &priv->cfg, &priv->extra_cfg);
 3127|  18.4k|      if (priv->oxcf.pass == AOM_RC_ONE_PASS) {
  ------------------
  |  Branch (3127:11): [True: 18.4k, False: 0]
  ------------------
 3128|       |        // Enable look ahead.
 3129|       |#if CONFIG_REALTIME_ONLY
 3130|       |        // When CONFIG_REALTIME_ONLY=1 and mode=REALTIME, then force
 3131|       |        // lag_in_frames = 0.
 3132|       |        const int lag_in_frames =
 3133|       |            (priv->oxcf.mode == REALTIME) ? 0 : (int)priv->cfg.g_lag_in_frames;
 3134|       |#else
 3135|  18.4k|        const int lag_in_frames = (int)priv->cfg.g_lag_in_frames;
 3136|  18.4k|#endif
 3137|  18.4k|        *num_lap_buffers =
 3138|  18.4k|            AOMMIN(lag_in_frames,
  ------------------
  |  |   34|  36.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.4k, False: 0]
  |  |  |  Branch (34:31): [True: 18.4k, False: 0]
  |  |  |  Branch (34:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3139|  18.4k|                   AOMMIN(MAX_LAP_BUFFERS, priv->oxcf.kf_cfg.key_freq_max +
 3140|  18.4k|                                               SCENE_CUT_KEY_TEST_INTERVAL));
 3141|  18.4k|        if ((int)priv->cfg.g_lag_in_frames - (*num_lap_buffers) >=
  ------------------
  |  Branch (3141:13): [True: 0, False: 18.4k]
  ------------------
 3142|  18.4k|            LAP_LAG_IN_FRAMES) {
  ------------------
  |  |   31|  18.4k|#define LAP_LAG_IN_FRAMES 17
  ------------------
 3143|      0|          lap_lag_in_frames = LAP_LAG_IN_FRAMES;
  ------------------
  |  |   31|      0|#define LAP_LAG_IN_FRAMES 17
  ------------------
 3144|      0|        }
 3145|  18.4k|      }
 3146|  18.4k|      priv->oxcf.use_highbitdepth =
 3147|  18.4k|          (ctx->init_flags & AOM_CODEC_USE_HIGHBITDEPTH) ? 1 : 0;
  ------------------
  |  |   80|  18.4k|#define AOM_CODEC_USE_HIGHBITDEPTH 0x40000 /**< Use high bitdepth */
  ------------------
  |  Branch (3147:11): [True: 5.12k, False: 13.2k]
  ------------------
 3148|       |
 3149|  18.4k|      priv->monochrome_on_init = priv->cfg.monochrome;
 3150|       |
 3151|  18.4k|      priv->ppi = av1_create_primary_compressor(&priv->pkt_list.head,
 3152|  18.4k|                                                *num_lap_buffers, &priv->oxcf);
 3153|  18.4k|      if (!priv->ppi) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (3153:11): [True: 0, False: 18.4k]
  ------------------
 3154|       |
 3155|  18.4k|#if !CONFIG_REALTIME_ONLY
 3156|  18.4k|      res = create_stats_buffer(&priv->frame_stats_buffer,
 3157|  18.4k|                                &priv->stats_buf_context, *num_lap_buffers);
 3158|  18.4k|      if (res != AOM_CODEC_OK) return res;
  ------------------
  |  Branch (3158:11): [True: 0, False: 18.4k]
  ------------------
 3159|       |
 3160|  18.4k|      assert(MAX_LAP_BUFFERS >= MAX_LAG_BUFFERS);
 3161|  18.4k|      int size = get_stats_buf_size(*num_lap_buffers, MAX_LAG_BUFFERS);
  ------------------
  |  |   28|  18.4k|#define MAX_LAG_BUFFERS 48
  ------------------
 3162|   901k|      for (int i = 0; i < size; i++)
  ------------------
  |  Branch (3162:23): [True: 883k, False: 18.4k]
  ------------------
 3163|   883k|        priv->ppi->twopass.frame_stats_arr[i] = &priv->frame_stats_buffer[i];
 3164|       |
 3165|  18.4k|      priv->ppi->twopass.stats_buf_ctx = &priv->stats_buf_context;
 3166|  18.4k|#endif
 3167|       |
 3168|  18.4k|      assert(priv->ppi->num_fp_contexts >= 1);
 3169|  18.4k|      res = av1_create_context_and_bufferpool(
 3170|  18.4k|          priv->ppi, &priv->ppi->parallel_cpi[0], &priv->buffer_pool,
 3171|  18.4k|          &priv->oxcf, ENCODE_STAGE, -1);
 3172|  18.4k|      if (res != AOM_CODEC_OK) {
  ------------------
  |  Branch (3172:11): [True: 0, False: 18.4k]
  ------------------
 3173|      0|        priv->base.err_detail = "av1_create_context_and_bufferpool() failed";
 3174|      0|        return res;
 3175|      0|      }
 3176|  18.4k|#if !CONFIG_REALTIME_ONLY
 3177|  18.4k|      priv->ppi->parallel_cpi[0]->twopass_frame.stats_in =
 3178|  18.4k|          priv->ppi->twopass.stats_buf_ctx->stats_in_start;
 3179|  18.4k|#endif
 3180|  18.4k|      priv->ppi->cpi = priv->ppi->parallel_cpi[0];
 3181|       |
 3182|       |      // Create another compressor if look ahead is enabled
 3183|  18.4k|      if (res == AOM_CODEC_OK && *num_lap_buffers) {
  ------------------
  |  Branch (3183:11): [True: 18.4k, False: 0]
  |  Branch (3183:34): [True: 0, False: 18.4k]
  ------------------
 3184|      0|        res = av1_create_context_and_bufferpool(
 3185|      0|            priv->ppi, &priv->ppi->cpi_lap, &priv->buffer_pool_lap, &priv->oxcf,
 3186|      0|            LAP_STAGE, clamp(lap_lag_in_frames, 0, MAX_LAG_BUFFERS));
  ------------------
  |  |   28|      0|#define MAX_LAG_BUFFERS 48
  ------------------
 3187|      0|      }
 3188|  18.4k|    }
 3189|  18.4k|  }
 3190|       |
 3191|  18.4k|  return res;
 3192|  18.4k|}
av1_cx_iface.c:validate_config:
  692|   118k|                                       const struct av1_extracfg *extra_cfg) {
  693|   118k|  RANGE_CHECK(cfg, g_w, 1, 65536);                        // 16 bits available
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  694|   118k|  RANGE_CHECK(cfg, g_h, 1, 65536);                        // 16 bits available
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  695|   118k|  RANGE_CHECK_HI(cfg, g_forced_max_frame_width, 65536);   // 16 bits available
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  696|   118k|  RANGE_CHECK_HI(cfg, g_forced_max_frame_height, 65536);  // 16 bits available
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  697|   118k|  if (cfg->g_forced_max_frame_width) {
  ------------------
  |  Branch (697:7): [True: 0, False: 118k]
  ------------------
  698|      0|    RANGE_CHECK_HI(cfg, g_w, cfg->g_forced_max_frame_width);
  ------------------
  |  |  681|      0|  do {                                                                  \
  |  |  682|      0|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  683|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  699|      0|  }
  700|   118k|  if (cfg->g_forced_max_frame_height) {
  ------------------
  |  Branch (700:7): [True: 0, False: 118k]
  ------------------
  701|      0|    RANGE_CHECK_HI(cfg, g_h, cfg->g_forced_max_frame_height);
  ------------------
  |  |  681|      0|  do {                                                                  \
  |  |  682|      0|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  683|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  702|      0|  }
  703|       |  // To avoid integer overflows when multiplying width by height (or values
  704|       |  // derived from width and height) using the int type, impose a maximum frame
  705|       |  // area (width * height) of 2^30.
  706|   118k|  const unsigned int max_frame_width =
  707|   118k|      cfg->g_forced_max_frame_width ? cfg->g_forced_max_frame_width : cfg->g_w;
  ------------------
  |  Branch (707:7): [True: 0, False: 118k]
  ------------------
  708|   118k|  const unsigned int max_frame_height = cfg->g_forced_max_frame_height
  ------------------
  |  Branch (708:41): [True: 0, False: 118k]
  ------------------
  709|   118k|                                            ? cfg->g_forced_max_frame_height
  710|   118k|                                            : cfg->g_h;
  711|   118k|  const int64_t max_frame_area = (int64_t)max_frame_width * max_frame_height;
  712|   118k|  if (max_frame_area > (1 << 30)) {
  ------------------
  |  Branch (712:7): [True: 0, False: 118k]
  ------------------
  713|      0|    ERROR("max_frame_area out of range [..2^30]");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  714|      0|  }
  715|   118k|  RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  716|   118k|  RANGE_CHECK(cfg, g_timebase.num, 1, 1000000000);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  717|   118k|  RANGE_CHECK_HI(cfg, g_profile, MAX_PROFILES - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  718|       |
  719|   118k|  RANGE_CHECK_HI(cfg, rc_target_bitrate, 2000000);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  720|   118k|  RANGE_CHECK_HI(cfg, rc_max_quantizer, 63);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  721|   118k|  RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  722|   118k|  RANGE_CHECK_BOOL(extra_cfg, lossless);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  723|   118k|  RANGE_CHECK_HI(extra_cfg, aq_mode, AQ_MODE_COUNT - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  724|   118k|  RANGE_CHECK_HI(extra_cfg, deltaq_mode, DELTA_Q_MODE_COUNT - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  725|   118k|  RANGE_CHECK_HI(extra_cfg, deltalf_mode, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  726|   118k|  RANGE_CHECK_HI(extra_cfg, frame_periodic_boost, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  727|       |#if CONFIG_REALTIME_ONLY
  728|       |  RANGE_CHECK(cfg, g_usage, AOM_USAGE_REALTIME, AOM_USAGE_REALTIME);
  729|       |#else
  730|   118k|  RANGE_CHECK_HI(cfg, g_usage, AOM_USAGE_ALL_INTRA);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  731|   118k|#endif
  732|   118k|  RANGE_CHECK_HI(cfg, g_threads, MAX_NUM_THREADS);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  733|   118k|  RANGE_CHECK(cfg, rc_end_usage, AOM_VBR, AOM_Q);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  734|   118k|  RANGE_CHECK_HI(cfg, rc_undershoot_pct, 100);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  735|   118k|  RANGE_CHECK_HI(cfg, rc_overshoot_pct, 100);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  736|   118k|  RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  737|   118k|  RANGE_CHECK(cfg, kf_mode, AOM_KF_DISABLED, AOM_KF_AUTO);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  738|   118k|  RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  739|   118k|  RANGE_CHECK(cfg, g_pass, AOM_RC_ONE_PASS, AOM_RC_THIRD_PASS);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  740|   118k|  RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  741|   118k|  if (cfg->g_usage == AOM_USAGE_ALL_INTRA) {
  ------------------
  |  | 1031|   118k|#define AOM_USAGE_ALL_INTRA 2u
  ------------------
  |  Branch (741:7): [True: 0, False: 118k]
  ------------------
  742|      0|    RANGE_CHECK_HI(cfg, g_lag_in_frames, 0);
  ------------------
  |  |  681|      0|  do {                                                                  \
  |  |  682|      0|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  683|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  743|      0|    RANGE_CHECK_HI(cfg, kf_max_dist, 0);
  ------------------
  |  |  681|      0|  do {                                                                  \
  |  |  682|      0|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  683|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  744|      0|  }
  745|   118k|  RANGE_CHECK_HI(extra_cfg, min_gf_interval, MAX_LAG_BUFFERS - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  746|   118k|  RANGE_CHECK_HI(extra_cfg, max_gf_interval, MAX_LAG_BUFFERS - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  747|   118k|  if (extra_cfg->max_gf_interval > 0) {
  ------------------
  |  Branch (747:7): [True: 0, False: 118k]
  ------------------
  748|      0|    RANGE_CHECK(extra_cfg, max_gf_interval,
  ------------------
  |  |  675|      0|  do {                                                 \
  |  |  676|      0|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 0, False: 0]
  |  |  |  Branch (676:25): [True: 0, False: 0]
  |  |  |  Branch (676:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  677|      0|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  749|      0|                AOMMAX(2, extra_cfg->min_gf_interval), (MAX_LAG_BUFFERS - 1));
  750|      0|  }
  751|   118k|  RANGE_CHECK_HI(extra_cfg, gf_min_pyr_height, 5);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  752|   118k|  RANGE_CHECK_HI(extra_cfg, gf_max_pyr_height, 5);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  753|   118k|  if (extra_cfg->gf_min_pyr_height > extra_cfg->gf_max_pyr_height) {
  ------------------
  |  Branch (753:7): [True: 0, False: 118k]
  ------------------
  754|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  755|      0|        "gf_min_pyr_height must be less than or equal to "
  756|      0|        "gf_max_pyramid_height");
  757|      0|  }
  758|       |
  759|   118k|  RANGE_CHECK_HI(cfg, rc_resize_mode, RESIZE_MODES - 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  760|   118k|  RANGE_CHECK(cfg, rc_resize_denominator, SCALE_NUMERATOR,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  761|   118k|              SCALE_NUMERATOR << 1);
  762|   118k|  RANGE_CHECK(cfg, rc_resize_kf_denominator, SCALE_NUMERATOR,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  763|   118k|              SCALE_NUMERATOR << 1);
  764|   118k|  RANGE_CHECK_HI(cfg, rc_superres_mode, AOM_SUPERRES_AUTO);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  765|   118k|  RANGE_CHECK(cfg, rc_superres_denominator, SCALE_NUMERATOR,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  766|   118k|              SCALE_NUMERATOR << 1);
  767|   118k|  RANGE_CHECK(cfg, rc_superres_kf_denominator, SCALE_NUMERATOR,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  768|   118k|              SCALE_NUMERATOR << 1);
  769|   118k|  RANGE_CHECK(cfg, rc_superres_qthresh, 1, 63);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  770|   118k|  RANGE_CHECK(cfg, rc_superres_kf_qthresh, 1, 63);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  771|   118k|  RANGE_CHECK_HI(extra_cfg, cdf_update_mode, 2);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  772|       |
  773|   118k|  RANGE_CHECK_HI(extra_cfg, motion_vector_unit_test, 2);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  774|       |#if CONFIG_FPMT_TEST
  775|       |  RANGE_CHECK_HI(extra_cfg, fpmt_unit_test, 1);
  776|       |#endif
  777|   118k|  RANGE_CHECK_HI(extra_cfg, sb_multipass_unit_test, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  778|   118k|  RANGE_CHECK_HI(extra_cfg, ext_tile_debug, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  779|   118k|  RANGE_CHECK_HI(extra_cfg, enable_auto_alt_ref, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  780|   118k|  RANGE_CHECK_HI(extra_cfg, enable_auto_bwd_ref, 2);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  781|   118k|  RANGE_CHECK(extra_cfg, cpu_used, 0,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   237k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  |  Branch (676:46): [True: 35.1k, False: 83.8k]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  782|   118k|              (cfg->g_usage == AOM_USAGE_REALTIME) ? 12 : 9);
  783|   118k|  RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  784|   118k|  RANGE_CHECK(extra_cfg, superblock_size, AOM_SUPERBLOCK_SIZE_64X64,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  785|   118k|              AOM_SUPERBLOCK_SIZE_DYNAMIC);
  786|   118k|  RANGE_CHECK_HI(cfg, large_scale_tile, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  787|   118k|  RANGE_CHECK_HI(extra_cfg, single_tile_decoding, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  788|   118k|  RANGE_CHECK_HI(extra_cfg, enable_rate_guide_deltaq, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  789|       |
  790|   118k|  RANGE_CHECK_HI(extra_cfg, row_mt, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  791|   118k|  RANGE_CHECK_HI(extra_cfg, fp_mt, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  792|       |
  793|   118k|  RANGE_CHECK_HI(extra_cfg, tile_columns, 6);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  794|   118k|  RANGE_CHECK_HI(extra_cfg, tile_rows, 6);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  795|   118k|  RANGE_CHECK_HI(extra_cfg, auto_tiles, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  796|       |
  797|   118k|  RANGE_CHECK_HI(cfg, monochrome, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  798|       |
  799|   118k|  if (cfg->large_scale_tile && extra_cfg->aq_mode)
  ------------------
  |  Branch (799:7): [True: 0, False: 118k]
  |  Branch (799:32): [True: 0, False: 0]
  ------------------
  800|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  801|   118k|        "Adaptive quantization are not supported in large scale tile "
  802|   118k|        "coding.");
  803|       |
  804|   118k|  RANGE_CHECK_HI(extra_cfg, sharpness, 7);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  805|   118k|  RANGE_CHECK_HI(extra_cfg, enable_adaptive_sharpness, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  806|   118k|  RANGE_CHECK_HI(extra_cfg, arnr_max_frames, 15);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  807|   118k|  RANGE_CHECK_HI(extra_cfg, arnr_strength, 6);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  808|   118k|  RANGE_CHECK_HI(extra_cfg, cq_level, 63);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  809|   118k|  RANGE_CHECK(cfg, g_bit_depth, AOM_BITS_8, AOM_BITS_12);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  810|   118k|  RANGE_CHECK(cfg, g_input_bit_depth, 8, 12);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  811|   118k|  if (cfg->g_input_bit_depth > (unsigned int)cfg->g_bit_depth)
  ------------------
  |  Branch (811:7): [True: 0, False: 118k]
  ------------------
  812|      0|    ERROR("Input bit-depth must not exceed codec bit-depth");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  813|   118k|  RANGE_CHECK(extra_cfg, content, AOM_CONTENT_DEFAULT, AOM_CONTENT_INVALID - 1);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  814|       |
  815|   118k|  if (cfg->g_pass >= AOM_RC_SECOND_PASS) {
  ------------------
  |  Branch (815:7): [True: 0, False: 118k]
  ------------------
  816|      0|    const size_t packet_sz = sizeof(FIRSTPASS_STATS);
  817|      0|    const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);
  818|      0|    const FIRSTPASS_STATS *stats;
  819|       |
  820|      0|    if (cfg->rc_twopass_stats_in.buf == NULL)
  ------------------
  |  Branch (820:9): [True: 0, False: 0]
  ------------------
  821|      0|      ERROR("rc_twopass_stats_in.buf not set.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  822|       |
  823|      0|    if (cfg->rc_twopass_stats_in.sz % packet_sz)
  ------------------
  |  Branch (823:9): [True: 0, False: 0]
  ------------------
  824|      0|      ERROR("rc_twopass_stats_in.sz indicates truncated packet.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  825|       |
  826|      0|    if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz)
  ------------------
  |  Branch (826:9): [True: 0, False: 0]
  ------------------
  827|      0|      ERROR("rc_twopass_stats_in requires at least two packets.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  828|       |
  829|      0|    stats =
  830|      0|        (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1;
  831|       |
  832|      0|    if ((int)(stats->count + 0.5) != n_packets - 1)
  ------------------
  |  Branch (832:9): [True: 0, False: 0]
  ------------------
  833|      0|      ERROR("rc_twopass_stats_in missing EOS stats packet");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  834|      0|  }
  835|       |
  836|   118k|  if (extra_cfg->passes != -1 && cfg->g_pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (836:7): [True: 0, False: 118k]
  |  Branch (836:34): [True: 0, False: 0]
  ------------------
  837|      0|      extra_cfg->passes != 1) {
  ------------------
  |  Branch (837:7): [True: 0, False: 0]
  ------------------
  838|      0|    ERROR("One pass encoding but passes != 1.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  839|      0|  }
  840|       |
  841|   118k|  if (extra_cfg->passes != -1 && (int)cfg->g_pass > extra_cfg->passes) {
  ------------------
  |  Branch (841:7): [True: 0, False: 118k]
  |  Branch (841:34): [True: 0, False: 0]
  ------------------
  842|      0|    ERROR("Current pass is larger than total number of passes.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  843|      0|  }
  844|       |
  845|   118k|  if (cfg->g_profile == (unsigned int)PROFILE_1 && cfg->monochrome) {
  ------------------
  |  Branch (845:7): [True: 8.12k, False: 110k]
  |  Branch (845:52): [True: 0, False: 8.12k]
  ------------------
  846|      0|    ERROR("Monochrome is not supported in profile 1");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  847|      0|  }
  848|       |
  849|   118k|  if (cfg->g_profile <= (unsigned int)PROFILE_1 &&
  ------------------
  |  Branch (849:7): [True: 89.0k, False: 29.9k]
  ------------------
  850|  89.0k|      cfg->g_bit_depth > AOM_BITS_10) {
  ------------------
  |  Branch (850:7): [True: 0, False: 89.0k]
  ------------------
  851|      0|    ERROR("Codec bit-depth 12 not supported in profile < 2");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  852|      0|  }
  853|       |
  854|   118k|  if (cfg->rc_end_usage == AOM_Q) {
  ------------------
  |  Branch (854:7): [True: 83.8k, False: 35.1k]
  ------------------
  855|  83.8k|    RANGE_CHECK_HI(cfg, use_fixed_qp_offsets, 2);
  ------------------
  |  |  681|  83.8k|  do {                                                                  \
  |  |  682|  83.8k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 83.8k]
  |  |  ------------------
  |  |  683|  83.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 83.8k]
  |  |  ------------------
  ------------------
  856|  83.8k|  } else {
  857|  35.1k|    if (cfg->use_fixed_qp_offsets > 0) {
  ------------------
  |  Branch (857:9): [True: 0, False: 35.1k]
  ------------------
  858|      0|      ERROR("--use_fixed_qp_offsets can only be used with --end-usage=q");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  859|      0|    }
  860|  35.1k|  }
  861|       |
  862|   118k|  RANGE_CHECK(extra_cfg, color_primaries, AOM_CICP_CP_BT_709,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  863|   118k|              AOM_CICP_CP_EBU_3213);  // Need to check range more precisely to
  864|       |                                      // check for reserved values?
  865|   118k|  RANGE_CHECK(extra_cfg, transfer_characteristics, AOM_CICP_TC_BT_709,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  866|   118k|              AOM_CICP_TC_HLG);
  867|   118k|  RANGE_CHECK(extra_cfg, matrix_coefficients, AOM_CICP_MC_IDENTITY,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  868|   118k|              AOM_CICP_MC_YCGCO_RO);
  869|   118k|  RANGE_CHECK(extra_cfg, color_range, 0, 1);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  870|       |
  871|       |  /* Average corpus complexity is supported only in the case of single pass
  872|       |   * VBR*/
  873|   118k|  if (cfg->g_pass == AOM_RC_ONE_PASS && cfg->rc_end_usage == AOM_VBR)
  ------------------
  |  Branch (873:7): [True: 118k, False: 0]
  |  Branch (873:41): [True: 0, False: 118k]
  ------------------
  874|      0|    RANGE_CHECK_HI(extra_cfg, vbr_corpus_complexity_lap,
  ------------------
  |  |  681|      0|  do {                                                                  \
  |  |  682|      0|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  683|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  875|   118k|                   MAX_VBR_CORPUS_COMPLEXITY);
  876|   118k|  else if (extra_cfg->vbr_corpus_complexity_lap != 0)
  ------------------
  |  Branch (876:12): [True: 0, False: 118k]
  ------------------
  877|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  878|   118k|        "VBR corpus complexity is supported only in the case of single pass "
  879|   118k|        "VBR mode.");
  880|       |
  881|   118k|#if !CONFIG_TUNE_BUTTERAUGLI
  882|   118k|  if (extra_cfg->tuning == AOM_TUNE_BUTTERAUGLI) {
  ------------------
  |  Branch (882:7): [True: 0, False: 118k]
  ------------------
  883|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  884|      0|        "This error may be related to the wrong configuration options: try to "
  885|      0|        "set -DCONFIG_TUNE_BUTTERAUGLI=1 at the time CMake is run.");
  886|      0|  }
  887|   118k|#endif
  888|       |
  889|   118k|#if !CONFIG_TUNE_VMAF
  890|   118k|  if (extra_cfg->tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
  ------------------
  |  Branch (890:7): [True: 15.0k, False: 103k]
  ------------------
  891|  15.0k|      extra_cfg->tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
  ------------------
  |  Branch (891:7): [True: 0, False: 15.0k]
  ------------------
  892|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  893|      0|        "This error may be related to the wrong configuration options: try to "
  894|      0|        "set -DCONFIG_TUNE_VMAF=1 at the time CMake is run.");
  895|      0|  }
  896|   118k|#endif
  897|       |
  898|   118k|  RANGE_CHECK(extra_cfg, tuning, AOM_TUNE_PSNR, AOM_TUNE_SSIMULACRA2);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  899|       |
  900|   118k|  RANGE_CHECK(extra_cfg, dist_metric, AOM_DIST_METRIC_PSNR,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  901|   118k|              AOM_DIST_METRIC_QM_PSNR);
  902|       |
  903|   118k|  RANGE_CHECK(extra_cfg, timing_info_type, AOM_TIMING_UNSPECIFIED,
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  904|   118k|              AOM_TIMING_DEC_MODEL);
  905|       |
  906|   118k|  RANGE_CHECK(extra_cfg, film_grain_test_vector, 0, 16);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  907|       |
  908|   118k|  if (extra_cfg->lossless) {
  ------------------
  |  Branch (908:7): [True: 3.66k, False: 115k]
  ------------------
  909|  3.66k|    if (extra_cfg->aq_mode != 0)
  ------------------
  |  Branch (909:9): [True: 0, False: 3.66k]
  ------------------
  910|      0|      ERROR("Only --aq_mode=0 can be used with --lossless=1.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  911|  3.66k|    if (extra_cfg->enable_chroma_deltaq)
  ------------------
  |  Branch (911:9): [True: 0, False: 3.66k]
  ------------------
  912|      0|      ERROR("Only --enable_chroma_deltaq=0 can be used with --lossless=1.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  913|  3.66k|  }
  914|       |
  915|   118k|  RANGE_CHECK(extra_cfg, max_reference_frames, 3, 7);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  916|   118k|  RANGE_CHECK(extra_cfg, enable_reduced_reference_set, 0, 1);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  917|       |
  918|   118k|  RANGE_CHECK_HI(extra_cfg, enable_low_complexity_decode, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  919|   118k|  RANGE_CHECK_HI(extra_cfg, chroma_subsampling_x, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  920|   118k|  RANGE_CHECK_HI(extra_cfg, chroma_subsampling_y, 1);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  921|       |  // 6.4.2 Color config semantics
  922|       |  // If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of
  923|       |  // bitstream conformance that subsampling_x is equal to 0 and subsampling_y
  924|       |  // is equal to 0.
  925|   118k|  if (extra_cfg->matrix_coefficients == AOM_CICP_MC_IDENTITY &&
  ------------------
  |  Branch (925:7): [True: 0, False: 118k]
  ------------------
  926|      0|      (extra_cfg->chroma_subsampling_x != 0 ||
  ------------------
  |  Branch (926:8): [True: 0, False: 0]
  ------------------
  927|      0|       extra_cfg->chroma_subsampling_y != 0)) {
  ------------------
  |  Branch (927:8): [True: 0, False: 0]
  ------------------
  928|      0|    ERROR("Subsampling must be 0 with AOM_CICP_MC_IDENTITY.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  929|      0|  }
  930|       |
  931|   118k|  RANGE_CHECK_HI(extra_cfg, disable_trellis_quant, 3);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  932|   118k|  RANGE_CHECK(extra_cfg, coeff_cost_upd_freq, 0, 3);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  933|   118k|  RANGE_CHECK(extra_cfg, mode_cost_upd_freq, 0, 3);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  934|   118k|  RANGE_CHECK(extra_cfg, mv_cost_upd_freq, 0, 3);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  935|   118k|  RANGE_CHECK(extra_cfg, dv_cost_upd_freq, 0, 3);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  936|       |
  937|   118k|  RANGE_CHECK(extra_cfg, min_partition_size, 4, 128);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  938|   118k|  RANGE_CHECK(extra_cfg, max_partition_size, 4, 128);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  939|   118k|  RANGE_CHECK_HI(extra_cfg, min_partition_size, extra_cfg->max_partition_size);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  940|       |
  941|  3.92M|  for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) {
  ------------------
  |  |   76|  3.92M|  (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   70|  3.92M|#define MAX_NUM_TEMPORAL_LAYERS 8
  |  |  ------------------
  |  |                 (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   71|  3.92M|#define MAX_NUM_SPATIAL_LAYERS 4
  |  |  ------------------
  ------------------
  |  Branch (941:19): [True: 3.80M, False: 118k]
  ------------------
  942|  3.80M|    const int level_idx = extra_cfg->target_seq_level_idx[i];
  943|  3.80M|    if (!is_valid_seq_level_idx(level_idx) &&
  ------------------
  |  Branch (943:9): [True: 0, False: 3.80M]
  ------------------
  944|      0|        level_idx != SEQ_LEVEL_KEEP_STATS) {
  ------------------
  |  Branch (944:9): [True: 0, False: 0]
  ------------------
  945|      0|      ERROR("Target sequence level index is invalid");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  946|      0|    }
  947|  3.80M|  }
  948|       |
  949|   118k|  RANGE_CHECK_HI(extra_cfg, deltaq_strength, 1000);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  950|   118k|  RANGE_CHECK_HI(extra_cfg, loopfilter_control, 3);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  951|   118k|  RANGE_CHECK_BOOL(extra_cfg, skip_postproc_filtering);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  952|   118k|  RANGE_CHECK_BOOL(extra_cfg, mode_ref_delta_enabled);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  953|   118k|  RANGE_CHECK_HI(extra_cfg, enable_cdef, 3);
  ------------------
  |  |  681|   118k|  do {                                                                  \
  |  |  682|   118k|    if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (682:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  683|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (683:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  954|   118k|  RANGE_CHECK_BOOL(extra_cfg, auto_intra_tools_off);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  955|   118k|  RANGE_CHECK_BOOL(extra_cfg, strict_level_conformance);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  956|   118k|  RANGE_CHECK_BOOL(extra_cfg, sb_qp_sweep);
  ------------------
  |  |  686|   118k|  do {                                                                \
  |  |  687|   118k|    if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (687:9): [True: 0, False: 118k]
  |  |  ------------------
  |  |  688|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (688:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  957|       |
  958|   118k|  RANGE_CHECK(extra_cfg, kf_max_pyr_height, -1, 5);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  959|   118k|  if (extra_cfg->kf_max_pyr_height != -1 &&
  ------------------
  |  Branch (959:7): [True: 0, False: 118k]
  ------------------
  960|      0|      extra_cfg->kf_max_pyr_height < (int)extra_cfg->gf_min_pyr_height) {
  ------------------
  |  Branch (960:7): [True: 0, False: 0]
  ------------------
  961|      0|    ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  962|      0|        "The value of kf-max-pyr-height should not be smaller than "
  963|      0|        "gf-min-pyr-height");
  964|      0|  }
  965|       |
  966|   118k|  RANGE_CHECK(extra_cfg, screen_detection_mode, 1, 2);
  ------------------
  |  |  675|   118k|  do {                                                 \
  |  |  676|   118k|    if (!((p)->memb >= (lo) && (p)->memb <= (hi)))     \
  |  |  ------------------
  |  |  |  Branch (676:11): [True: 118k, False: 0]
  |  |  |  Branch (676:32): [True: 118k, False: 0]
  |  |  ------------------
  |  |  677|   118k|      ERROR(#memb " out of range [" #lo ".." #hi "]"); \
  |  |  ------------------
  |  |  |  |  669|      0|  do {                              \
  |  |  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  |  |  672|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  678|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (678:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  967|   118k|  return AOM_CODEC_OK;
  968|   118k|}
av1_cx_iface.c:reduce_ratio:
  612|  18.4k|static void reduce_ratio(aom_rational64_t *ratio) {
  613|  18.4k|  const int denom = gcd(ratio->num, ratio->den);
  614|  18.4k|  ratio->num /= denom;
  615|  18.4k|  ratio->den /= denom;
  616|  18.4k|}
av1_cx_iface.c:gcd:
  601|  18.4k|static inline int gcd(int64_t a, int b) {
  602|  18.4k|  int remainder;
  603|  55.2k|  while (b > 0) {
  ------------------
  |  Branch (603:10): [True: 36.8k, False: 18.4k]
  ------------------
  604|  36.8k|    remainder = (int)(a % b);
  605|  36.8k|    a = b;
  606|  36.8k|    b = remainder;
  607|  36.8k|  }
  608|       |
  609|  18.4k|  return (int)a;
  610|  18.4k|}
av1_cx_iface.c:create_stats_buffer:
 2977|  18.4k|                                           int num_lap_buffers) {
 2978|  18.4k|  aom_codec_err_t res = AOM_CODEC_OK;
 2979|       |
 2980|  18.4k|  int size = get_stats_buf_size(num_lap_buffers, MAX_LAG_BUFFERS);
  ------------------
  |  |   28|  18.4k|#define MAX_LAG_BUFFERS 48
  ------------------
 2981|  18.4k|  *frame_stats_buffer =
 2982|  18.4k|      (FIRSTPASS_STATS *)aom_calloc(size, sizeof(FIRSTPASS_STATS));
 2983|  18.4k|  if (*frame_stats_buffer == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (2983:7): [True: 0, False: 18.4k]
  ------------------
 2984|       |
 2985|  18.4k|  stats_buf_context->stats_in_start = *frame_stats_buffer;
 2986|  18.4k|  stats_buf_context->stats_in_end = stats_buf_context->stats_in_start;
 2987|  18.4k|  stats_buf_context->stats_in_buf_end =
 2988|  18.4k|      stats_buf_context->stats_in_start + size;
 2989|       |
 2990|  18.4k|  stats_buf_context->total_left_stats = aom_calloc(1, sizeof(FIRSTPASS_STATS));
 2991|  18.4k|  if (stats_buf_context->total_left_stats == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (2991:7): [True: 0, False: 18.4k]
  ------------------
 2992|  18.4k|  av1_twopass_zero_stats(stats_buf_context->total_left_stats);
 2993|  18.4k|  stats_buf_context->total_stats = aom_calloc(1, sizeof(FIRSTPASS_STATS));
 2994|  18.4k|  if (stats_buf_context->total_stats == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (2994:7): [True: 0, False: 18.4k]
  ------------------
 2995|  18.4k|  av1_twopass_zero_stats(stats_buf_context->total_stats);
 2996|  18.4k|  return res;
 2997|  18.4k|}
av1_cx_iface.c:encoder_destroy:
 3240|  18.4k|static aom_codec_err_t encoder_destroy(aom_codec_alg_priv_t *ctx) {
 3241|  18.4k|  free(ctx->cx_data);
 3242|  18.4k|  destroy_extra_config(&ctx->extra_cfg);
 3243|       |
 3244|  18.4k|  if (ctx->ppi) {
  ------------------
  |  Branch (3244:7): [True: 18.4k, False: 0]
  ------------------
 3245|  18.4k|    AV1_PRIMARY *ppi = ctx->ppi;
 3246|  18.4k|    if (ppi->cpi) {
  ------------------
  |  Branch (3246:9): [True: 18.4k, False: 0]
  ------------------
 3247|  18.4k|      av1_extrc_delete(&ppi->cpi->ext_ratectrl);
 3248|  18.4k|    }
 3249|  73.6k|    for (int i = 0; i < MAX_PARALLEL_FRAMES - 1; i++) {
  ------------------
  |  | 1652|  73.6k|#define MAX_PARALLEL_FRAMES 4
  ------------------
  |  Branch (3249:21): [True: 55.2k, False: 18.4k]
  ------------------
 3250|  55.2k|      if (ppi->parallel_frames_data[i].cx_data) {
  ------------------
  |  Branch (3250:11): [True: 0, False: 55.2k]
  ------------------
 3251|      0|        free(ppi->parallel_frames_data[i].cx_data);
 3252|      0|      }
 3253|  55.2k|    }
 3254|       |#if CONFIG_ENTROPY_STATS
 3255|       |    print_entropy_stats(ppi);
 3256|       |#endif
 3257|       |#if CONFIG_INTERNAL_STATS
 3258|       |    print_internal_stats(ppi);
 3259|       |#endif
 3260|       |
 3261|  92.0k|    for (int i = 0; i < MAX_PARALLEL_FRAMES; i++) {
  ------------------
  |  | 1652|  92.0k|#define MAX_PARALLEL_FRAMES 4
  ------------------
  |  Branch (3261:21): [True: 73.6k, False: 18.4k]
  ------------------
 3262|  73.6k|      av1_destroy_context_and_bufferpool(ppi->parallel_cpi[i],
 3263|  73.6k|                                         &ctx->buffer_pool);
 3264|  73.6k|    }
 3265|  18.4k|    ppi->cpi = NULL;
 3266|       |
 3267|  18.4k|    if (ppi->cpi_lap) {
  ------------------
  |  Branch (3267:9): [True: 0, False: 18.4k]
  ------------------
 3268|      0|      av1_destroy_context_and_bufferpool(ppi->cpi_lap, &ctx->buffer_pool_lap);
 3269|      0|    }
 3270|  18.4k|    av1_remove_primary_compressor(ppi);
 3271|  18.4k|  }
 3272|  18.4k|  destroy_stats_buffer(&ctx->stats_buf_context, ctx->frame_stats_buffer);
 3273|  18.4k|  aom_free(ctx);
 3274|  18.4k|  return AOM_CODEC_OK;
 3275|  18.4k|}
av1_cx_iface.c:destroy_extra_config:
 3223|  18.4k|static void destroy_extra_config(struct av1_extracfg *extra_cfg) {
 3224|       |#if CONFIG_TUNE_VMAF
 3225|       |  check_and_free_string(default_extra_cfg.vmaf_model_path,
 3226|       |                        &extra_cfg->vmaf_model_path);
 3227|       |#endif
 3228|  18.4k|  check_and_free_string(default_extra_cfg.two_pass_output,
 3229|  18.4k|                        &extra_cfg->two_pass_output);
 3230|  18.4k|  check_and_free_string(default_extra_cfg.two_pass_output,
 3231|  18.4k|                        &extra_cfg->second_pass_log);
 3232|  18.4k|  check_and_free_string(default_extra_cfg.partition_info_path,
 3233|  18.4k|                        &extra_cfg->partition_info_path);
 3234|  18.4k|  check_and_free_string(default_extra_cfg.rate_distribution_info,
 3235|  18.4k|                        &extra_cfg->rate_distribution_info);
 3236|  18.4k|  check_and_free_string(default_extra_cfg.film_grain_table_filename,
 3237|  18.4k|                        &extra_cfg->film_grain_table_filename);
 3238|  18.4k|}
av1_cx_iface.c:check_and_free_string:
 3214|  92.0k|static void check_and_free_string(const char *default_str, const char **ptr) {
 3215|  92.0k|  if (*ptr == default_str) {
  ------------------
  |  Branch (3215:7): [True: 92.0k, False: 0]
  ------------------
 3216|       |    // Default should be a literal. Do not free.
 3217|  92.0k|    return;
 3218|  92.0k|  }
 3219|      0|  aom_free((void *)*ptr);
 3220|       |  *ptr = NULL;
 3221|      0|}
av1_cx_iface.c:destroy_stats_buffer:
 3208|  18.4k|                                 FIRSTPASS_STATS *frame_stats_buffer) {
 3209|  18.4k|  aom_free(stats_buf_context->total_left_stats);
 3210|  18.4k|  aom_free(stats_buf_context->total_stats);
 3211|  18.4k|  aom_free(frame_stats_buffer);
 3212|  18.4k|}
av1_cx_iface.c:ctrl_set_scale_mode:
 4053|  55.2k|                                           va_list args) {
 4054|  55.2k|  aom_scaling_mode_t *const mode = va_arg(args, aom_scaling_mode_t *);
 4055|       |
 4056|  55.2k|  if (mode) {
  ------------------
  |  Branch (4056:7): [True: 55.2k, False: 0]
  ------------------
 4057|  55.2k|    AV1EncoderConfig *const oxcf =
 4058|  55.2k|        ctx->ppi->seq_params_locked ? &ctx->ppi->cpi->oxcf : &ctx->oxcf;
  ------------------
  |  Branch (4058:9): [True: 36.8k, False: 18.4k]
  ------------------
 4059|  55.2k|    const int res =
 4060|  55.2k|        av1_set_internal_size(oxcf, &ctx->ppi->cpi->resize_pending_params,
 4061|  55.2k|                              mode->h_scaling_mode, mode->v_scaling_mode);
 4062|  55.2k|    if (res == 0) {
  ------------------
  |  Branch (4062:9): [True: 55.2k, False: 0]
  ------------------
 4063|       |      // update_encoder_cfg() is somewhat costly and this control may be called
 4064|       |      // multiple times, so update_encoder_cfg() is only called to ensure frame
 4065|       |      // and superblock sizes are updated before they're fixed by the first
 4066|       |      // encode call.
 4067|  55.2k|      if (ctx->ppi->seq_params_locked) {
  ------------------
  |  Branch (4067:11): [True: 36.8k, False: 18.4k]
  ------------------
 4068|  36.8k|        av1_check_fpmt_config(ctx->ppi, &ctx->ppi->cpi->oxcf);
 4069|  36.8k|        return AOM_CODEC_OK;
 4070|  36.8k|      }
 4071|  18.4k|      return update_encoder_cfg(ctx);
 4072|  55.2k|    }
 4073|      0|    return AOM_CODEC_INVALID_PARAM;
 4074|  55.2k|  } else {
 4075|      0|    return AOM_CODEC_INVALID_PARAM;
 4076|      0|  }
 4077|  55.2k|}
av1_cx_iface.c:update_encoder_cfg:
 1786|   137k|static aom_codec_err_t update_encoder_cfg(aom_codec_alg_priv_t *ctx) {
 1787|       |  // Disable denoiser for spatial layers. Bug: 485332522.
 1788|       |  // TODO: bug 485332522 - Disable denoiser for spatial layers until
 1789|       |  // more testing is done
 1790|   137k|  if (ctx->ppi->cpi->svc.number_spatial_layers > 1)
  ------------------
  |  Branch (1790:7): [True: 0, False: 137k]
  ------------------
 1791|      0|    ctx->extra_cfg.noise_sensitivity = 0;
 1792|   137k|  set_encoder_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg);
 1793|   137k|  av1_check_fpmt_config(ctx->ppi, &ctx->oxcf);
 1794|   137k|  bool is_sb_size_changed = false;
 1795|   137k|  av1_change_config_seq(ctx->ppi, &ctx->oxcf, &is_sb_size_changed);
 1796|   274k|  for (int i = 0; i < ctx->ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (1796:19): [True: 137k, False: 137k]
  ------------------
 1797|   137k|    AV1_COMP *const cpi = ctx->ppi->parallel_cpi[i];
 1798|   137k|    ENABLE_SETJMP(cpi);
  ------------------
  |  |   61|   137k|  do {                                                          \
  |  |   62|   137k|    struct aom_internal_error_info *const enable_setjmp_error = \
  |  |   63|   137k|        (CPI)->common.error;                                    \
  |  |   64|   137k|    if (setjmp(enable_setjmp_error->jmp)) {                     \
  |  |   65|      0|      enable_setjmp_error->setjmp = 0;                          \
  |  |   66|      0|      ctx->base.err_detail = enable_setjmp_error->has_detail    \
  |  |  ------------------
  |  |  |  Branch (66:30): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|                                 ? enable_setjmp_error->detail  \
  |  |   68|      0|                                 : NULL;                        \
  |  |   69|      0|      return enable_setjmp_error->error_code;                   \
  |  |   70|      0|    }                                                           \
  |  |   71|   137k|    enable_setjmp_error->setjmp = 1;                            \
  |  |   72|   137k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded, False: 137k]
  |  |  ------------------
  ------------------
  |  Branch (1798:5): [True: 0, False: 137k]
  ------------------
 1799|   137k|    av1_change_config(cpi, &ctx->oxcf, is_sb_size_changed);
 1800|   137k|    DISABLE_SETJMP(cpi);
  ------------------
  |  |   76|   137k|  do {                                                          \
  |  |   77|   137k|    struct aom_internal_error_info *const enable_setjmp_error = \
  |  |   78|   137k|        (CPI)->common.error;                                    \
  |  |   79|   137k|    enable_setjmp_error->setjmp = 0;                            \
  |  |   80|   137k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (80:12): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1801|   137k|  }
 1802|   137k|  if (ctx->ppi->cpi_lap != NULL) {
  ------------------
  |  Branch (1802:7): [True: 0, False: 137k]
  ------------------
 1803|      0|    AV1_COMP *const cpi_lap = ctx->ppi->cpi_lap;
 1804|      0|    ENABLE_SETJMP(cpi_lap);
  ------------------
  |  |   61|      0|  do {                                                          \
  |  |   62|      0|    struct aom_internal_error_info *const enable_setjmp_error = \
  |  |   63|      0|        (CPI)->common.error;                                    \
  |  |   64|      0|    if (setjmp(enable_setjmp_error->jmp)) {                     \
  |  |   65|      0|      enable_setjmp_error->setjmp = 0;                          \
  |  |   66|      0|      ctx->base.err_detail = enable_setjmp_error->has_detail    \
  |  |  ------------------
  |  |  |  Branch (66:30): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|                                 ? enable_setjmp_error->detail  \
  |  |   68|      0|                                 : NULL;                        \
  |  |   69|      0|      return enable_setjmp_error->error_code;                   \
  |  |   70|      0|    }                                                           \
  |  |   71|      0|    enable_setjmp_error->setjmp = 1;                            \
  |  |   72|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1804:5): [True: 0, False: 0]
  ------------------
 1805|      0|    av1_change_config(cpi_lap, &ctx->oxcf, is_sb_size_changed);
 1806|      0|    DISABLE_SETJMP(cpi_lap);
  ------------------
  |  |   76|      0|  do {                                                          \
  |  |   77|      0|    struct aom_internal_error_info *const enable_setjmp_error = \
  |  |   78|      0|        (CPI)->common.error;                                    \
  |  |   79|      0|    enable_setjmp_error->setjmp = 0;                            \
  |  |   80|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (80:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1807|      0|  }
 1808|   137k|  return AOM_CODEC_OK;
 1809|   137k|}
av1_cx_iface.c:ctrl_set_spatial_layer_id:
 4080|  73.6k|                                                 va_list args) {
 4081|  73.6k|  const int spatial_layer_id = va_arg(args, int);
 4082|  73.6k|  if (spatial_layer_id < 0 ||
  ------------------
  |  Branch (4082:7): [True: 0, False: 73.6k]
  ------------------
 4083|  73.6k|      spatial_layer_id >= (int)ctx->ppi->number_spatial_layers)
  ------------------
  |  Branch (4083:7): [True: 0, False: 73.6k]
  ------------------
 4084|      0|    return AOM_CODEC_INVALID_PARAM;
 4085|  73.6k|  ctx->ppi->cpi->common.spatial_layer_id = spatial_layer_id;
 4086|  73.6k|  return AOM_CODEC_OK;
 4087|  73.6k|}
av1_cx_iface.c:ctrl_set_cpuused:
 1836|  18.4k|                                        va_list args) {
 1837|  18.4k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 1838|       |  extra_cfg.cpu_used = CAST(AOME_SET_CPUUSED, args);
  ------------------
  |  |  334|  18.4k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 1839|  18.4k|  return update_extra_cfg(ctx, &extra_cfg);
 1840|  18.4k|}
av1_cx_iface.c:update_extra_cfg:
 1812|   100k|                                        const struct av1_extracfg *extra_cfg) {
 1813|   100k|  const aom_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg);
 1814|   100k|  if (res == AOM_CODEC_OK) {
  ------------------
  |  Branch (1814:7): [True: 100k, False: 0]
  ------------------
 1815|   100k|    ctx->extra_cfg = *extra_cfg;
 1816|   100k|    return update_encoder_cfg(ctx);
 1817|   100k|  }
 1818|      0|  return res;
 1819|   100k|}
av1_cx_iface.c:ctrl_set_tile_columns:
 1895|  15.0k|                                             va_list args) {
 1896|       |  // If the control AUTO_TILES is used (set to 1) then don't override
 1897|       |  // the tile_columns set via the AUTO_TILES control.
 1898|  15.0k|  if (ctx->extra_cfg.auto_tiles) {
  ------------------
  |  Branch (1898:7): [True: 0, False: 15.0k]
  ------------------
 1899|      0|    ERROR("AUTO_TILES is set so AV1E_SET_TILE_COLUMNS should not be called.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1900|      0|  }
 1901|  15.0k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 1902|  15.0k|  unsigned int tile_columns = CAST(AV1E_SET_TILE_COLUMNS, args);
  ------------------
  |  |  334|  15.0k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 1903|  15.0k|  if (tile_columns == extra_cfg.tile_columns) return AOM_CODEC_OK;
  ------------------
  |  Branch (1903:7): [True: 0, False: 15.0k]
  ------------------
 1904|  15.0k|  extra_cfg.tile_columns = tile_columns;
 1905|  15.0k|  return update_extra_cfg(ctx, &extra_cfg);
 1906|  15.0k|}
av1_cx_iface.c:ctrl_set_tile_rows:
 1909|  15.2k|                                          va_list args) {
 1910|       |  // If the control AUTO_TILES is used (set to 1) then don't override
 1911|       |  // the tile_rows set via the AUTO_TILES control.
 1912|  15.2k|  if (ctx->extra_cfg.auto_tiles) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 15.2k]
  ------------------
 1913|      0|    ERROR("AUTO_TILES is set so AV1E_SET_TILE_ROWS should not be called.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1914|      0|  }
 1915|  15.2k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 1916|  15.2k|  unsigned int tile_rows = CAST(AV1E_SET_TILE_ROWS, args);
  ------------------
  |  |  334|  15.2k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 1917|  15.2k|  if (tile_rows == extra_cfg.tile_rows) return AOM_CODEC_OK;
  ------------------
  |  Branch (1917:7): [True: 0, False: 15.2k]
  ------------------
 1918|  15.2k|  extra_cfg.tile_rows = tile_rows;
 1919|  15.2k|  return update_extra_cfg(ctx, &extra_cfg);
 1920|  15.2k|}
av1_cx_iface.c:ctrl_set_tuning:
 2007|  17.6k|                                       va_list args) {
 2008|  17.6k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 2009|  17.6k|  extra_cfg.tuning = CAST(AOME_SET_TUNING, args);
  ------------------
  |  |  334|  17.6k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 2010|  17.6k|  aom_codec_err_t err = handle_tuning(&extra_cfg);
 2011|  17.6k|  if (err != AOM_CODEC_OK) return err;
  ------------------
  |  Branch (2011:7): [True: 0, False: 17.6k]
  ------------------
 2012|  17.6k|  return update_extra_cfg(ctx, &extra_cfg);
 2013|  17.6k|}
av1_cx_iface.c:handle_tuning:
 1964|  17.6k|static aom_codec_err_t handle_tuning(struct av1_extracfg *extra_cfg) {
 1965|  17.6k|  if (extra_cfg->tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (1965:7): [True: 13.0k, False: 4.52k]
  ------------------
 1966|  13.0k|      extra_cfg->tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (1966:7): [True: 0, False: 4.52k]
  ------------------
 1967|       |    // Enable QMs as they've been found to be beneficial for images, when used
 1968|       |    // with alternative QM formulas:
 1969|       |    // - aom_get_qmlevel_allintra()
 1970|       |    // - aom_get_qmlevel_luma_ssimulacra2()
 1971|       |    // - aom_get_qmlevel_444_chroma()
 1972|  13.0k|    extra_cfg->enable_qm = 1;
 1973|  13.0k|    extra_cfg->qm_min = QM_FIRST_IQ_SSIMULACRA2;
  ------------------
  |  |   41|  13.0k|#define QM_FIRST_IQ_SSIMULACRA2 2
  ------------------
 1974|  13.0k|    extra_cfg->qm_max = QM_LAST_IQ_SSIMULACRA2;
  ------------------
  |  |   42|  13.0k|#define QM_LAST_IQ_SSIMULACRA2 10
  ------------------
 1975|       |    // Sharpness has been found to be beneficial for images (better perceptual
 1976|       |    // quality).
 1977|  13.0k|    extra_cfg->sharpness = 7;
 1978|       |    // Using the QM-PSNR metric was found to be beneficial for images (over the
 1979|       |    // default PSNR metric), as it correlates better with subjective image
 1980|       |    // quality consistency and better SSIMULACRA 2 scores.
 1981|  13.0k|    extra_cfg->dist_metric = AOM_DIST_METRIC_QM_PSNR;
 1982|       |    // CDEF_ALL has been found to blur images at medium and high quality
 1983|       |    // qindexes, so let's use a version that adapts CDEF strength on frame
 1984|       |    // qindexes. CDEF_ADAPTIVE strengths look like this for varying qindexes:
 1985|       |    // - CDEF off:          0 -  32
 1986|       |    // - Reduced strength: 33 - 220
 1987|       |    // - Full strength:   221 - 255
 1988|  13.0k|    extra_cfg->enable_cdef = CDEF_ADAPTIVE;
 1989|       |    // Enable chroma deltaq so the encoder can factor in chroma subsampling and
 1990|       |    // adjust chroma quality when necessary.
 1991|  13.0k|    extra_cfg->enable_chroma_deltaq = 1;
 1992|       |    // Enable "Variance Boost" deltaq mode, optimized for images.
 1993|  13.0k|    extra_cfg->deltaq_mode = DELTA_Q_VARIANCE_BOOST;
 1994|       |    // Enable "anti-aliased text and graphics aware" screen detection mode.
 1995|  13.0k|    extra_cfg->screen_detection_mode = AOM_SCREEN_DETECTION_ANTIALIASING_AWARE;
 1996|  13.0k|  }
 1997|  17.6k|  if (extra_cfg->tuning == AOM_TUNE_IQ) {
  ------------------
  |  Branch (1997:7): [True: 13.0k, False: 4.52k]
  ------------------
 1998|       |    // Enable adaptive sharpness to adjust loop filter levels according to QP.
 1999|       |    // Takes a small SSIMULACRA2 hit on the lower quality end, so enable it
 2000|       |    // just for tune IQ.
 2001|  13.0k|    extra_cfg->enable_adaptive_sharpness = 1;
 2002|  13.0k|  }
 2003|  17.6k|  return AOM_CODEC_OK;
 2004|  17.6k|}
av1_cx_iface.c:ctrl_set_cq_level:
 2016|  12.3k|                                         va_list args) {
 2017|  12.3k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 2018|       |  extra_cfg.cq_level = CAST(AOME_SET_CQ_LEVEL, args);
  ------------------
  |  |  334|  12.3k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 2019|  12.3k|  return update_extra_cfg(ctx, &extra_cfg);
 2020|  12.3k|}
av1_cx_iface.c:ctrl_set_number_spatial_layers:
 4090|  18.4k|                                                      va_list args) {
 4091|  18.4k|  const int number_spatial_layers = va_arg(args, int);
 4092|       |  // Note svc.use_flexible_mode is set by AV1E_SET_SVC_REF_FRAME_CONFIG. When
 4093|       |  // it is false (the default) the actual limit is 3 for both spatial and
 4094|       |  // temporal layers. Given the order of these calls are unpredictable the
 4095|       |  // final check is deferred until encoder_encode() (av1_set_svc_fixed_mode()).
 4096|       |  // The condition to return invalid_param when use_svc is set
 4097|       |  // (set in set_svc_params) is to avoid calling this control when
 4098|       |  // set_svc_params is already called (which sets the number of spatial and
 4099|       |  // temporal layers).
 4100|  18.4k|  if (number_spatial_layers <= 0 ||
  ------------------
  |  Branch (4100:7): [True: 0, False: 18.4k]
  ------------------
 4101|  18.4k|      number_spatial_layers > MAX_NUM_SPATIAL_LAYERS || ctx->ppi->use_svc)
  ------------------
  |  |   71|  36.8k|#define MAX_NUM_SPATIAL_LAYERS 4
  ------------------
  |  Branch (4101:7): [True: 0, False: 18.4k]
  |  Branch (4101:57): [True: 0, False: 18.4k]
  ------------------
 4102|      0|    return AOM_CODEC_INVALID_PARAM;
 4103|  18.4k|  ctx->ppi->number_spatial_layers = number_spatial_layers;
 4104|  18.4k|  ctx->ppi->cpi->common.spatial_layer_id = clamp(
 4105|  18.4k|      ctx->ppi->cpi->common.spatial_layer_id, 0, number_spatial_layers - 1);
 4106|       |  // update_encoder_cfg() is somewhat costly and this control may be called
 4107|       |  // multiple times, so update_encoder_cfg() is only called to ensure frame and
 4108|       |  // superblock sizes are updated before they're fixed by the first encode
 4109|       |  // call.
 4110|  18.4k|  if (!ctx->ppi->seq_params_locked) {
  ------------------
  |  Branch (4110:7): [True: 18.4k, False: 0]
  ------------------
 4111|  18.4k|    return update_encoder_cfg(ctx);
 4112|  18.4k|  }
 4113|      0|  return AOM_CODEC_OK;
 4114|  18.4k|}
av1_cx_iface.c:ctrl_set_lossless:
 2046|    788|                                         va_list args) {
 2047|    788|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 2048|       |  extra_cfg.lossless = CAST(AV1E_SET_LOSSLESS, args);
  ------------------
  |  |  334|    788|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 2049|    788|  return update_extra_cfg(ctx, &extra_cfg);
 2050|    788|}
av1_cx_iface.c:ctrl_set_enable_restoration:
 2060|  2.66k|                                                   va_list args) {
 2061|  2.66k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 2062|  2.66k|  const unsigned int restoration_arg = CAST(AV1E_SET_ENABLE_RESTORATION, args);
  ------------------
  |  |  334|  2.66k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 2063|       |#if CONFIG_REALTIME_ONLY
 2064|       |  if (restoration_arg) {
 2065|       |    ERROR("Restoration can't be turned on in realtime only build.");
 2066|       |  }
 2067|       |#endif
 2068|  2.66k|  extra_cfg.enable_restoration = restoration_arg;
 2069|  2.66k|  return update_extra_cfg(ctx, &extra_cfg);
 2070|  2.66k|}
av1_cx_iface.c:ctrl_set_color_range:
 4352|  18.4k|                                            va_list args) {
 4353|  18.4k|  struct av1_extracfg extra_cfg = ctx->extra_cfg;
 4354|       |  extra_cfg.color_range = CAST(AV1E_SET_COLOR_RANGE, args);
  ------------------
  |  |  334|  18.4k|#define CAST(id, arg) va_arg((arg), aom_codec_control_type_##id)
  ------------------
 4355|  18.4k|  return update_extra_cfg(ctx, &extra_cfg);
 4356|  18.4k|}
av1_cx_iface.c:encoder_encode:
 3315|  92.0k|                                      aom_enc_frame_flags_t enc_flags) {
 3316|  92.0k|  const size_t kMinCompressedSize = 8192;
 3317|  92.0k|  volatile aom_codec_err_t res = AOM_CODEC_OK;
 3318|  92.0k|  AV1_PRIMARY *const ppi = ctx->ppi;
 3319|  92.0k|  volatile aom_codec_pts_t ptsvol = pts;
 3320|  92.0k|  AV1_COMP_DATA cpi_data = { 0 };
 3321|       |
 3322|  92.0k|  cpi_data.timestamp_ratio = &ctx->timestamp_ratio;
 3323|  92.0k|  cpi_data.flush = !img;
 3324|       |  // LAP context
 3325|  92.0k|  AV1_COMP *cpi_lap = ppi->cpi_lap;
 3326|  92.0k|  if (ppi->cpi == NULL) return AOM_CODEC_INVALID_PARAM;
  ------------------
  |  Branch (3326:7): [True: 0, False: 92.0k]
  ------------------
 3327|       |
 3328|  92.0k|  ppi->cpi->last_coded_width = ppi->cpi->oxcf.frm_dim_cfg.width;
 3329|  92.0k|  ppi->cpi->last_coded_height = ppi->cpi->oxcf.frm_dim_cfg.height;
 3330|       |
 3331|  92.0k|  if (ppi->lap_enabled && cpi_lap == NULL &&
  ------------------
  |  Branch (3331:7): [True: 0, False: 92.0k]
  |  Branch (3331:27): [True: 0, False: 0]
  ------------------
 3332|      0|      ppi->cpi->oxcf.pass == AOM_RC_ONE_PASS)
  ------------------
  |  Branch (3332:7): [True: 0, False: 0]
  ------------------
 3333|      0|    return AOM_CODEC_INVALID_PARAM;
 3334|       |
 3335|  92.0k|  if (img != NULL) {
  ------------------
  |  Branch (3335:7): [True: 73.6k, False: 18.4k]
  ------------------
 3336|  73.6k|    res = validate_img(ctx, img);
 3337|  73.6k|    if (res == AOM_CODEC_OK) {
  ------------------
  |  Branch (3337:9): [True: 73.6k, False: 0]
  ------------------
 3338|  73.6k|      const uint64_t uncompressed_frame_sz64 =
 3339|  73.6k|          (uint64_t)ALIGN_POWER_OF_TWO_UNSIGNED(ctx->cfg.g_w, 5) *
  ------------------
  |  |   71|  73.6k|  (((value) + ((1u << (n)) - 1)) & ~((1u << (n)) - 1))
  ------------------
 3340|  73.6k|          ALIGN_POWER_OF_TWO_UNSIGNED(ctx->cfg.g_h, 5) * get_image_bps(img) / 8;
  ------------------
  |  |   71|  73.6k|  (((value) + ((1u << (n)) - 1)) & ~((1u << (n)) - 1))
  ------------------
 3341|       |#if UINT64_MAX > SIZE_MAX
 3342|       |      if (uncompressed_frame_sz64 > SIZE_MAX) return AOM_CODEC_MEM_ERROR;
 3343|       |#endif
 3344|  73.6k|      const size_t uncompressed_frame_sz = (size_t)uncompressed_frame_sz64;
 3345|       |
 3346|       |      // Due to the presence of no-show frames, the ctx->cx_data buffer holds
 3347|       |      // compressed data corresponding to multiple frames. As no-show frames are
 3348|       |      // not possible for all intra frame encoding with no forward key frames,
 3349|       |      // the buffer is allocated with a smaller size in this case.
 3350|       |      //
 3351|       |      // For pseudo random input, the compressed frame size is seen to exceed
 3352|       |      // the uncompressed frame size, but is less than 2 times the uncompressed
 3353|       |      // frame size. https://issues.oss-fuzz.com/issues/514006304 further shows
 3354|       |      // that multithreaded bitstream packing may need more than 2 times the
 3355|       |      // uncompressed frame size. Hence the size of the buffer is chosen as 2.5
 3356|       |      // times the uncompressed frame size.
 3357|  73.6k|      aom_rational_t multiplier;
 3358|  73.6k|      multiplier.num = 8;
 3359|  73.6k|      multiplier.den = 1;
 3360|  73.6k|      if (ppi->cpi->oxcf.kf_cfg.key_freq_max == 0 &&
  ------------------
  |  Branch (3360:11): [True: 0, False: 73.6k]
  ------------------
 3361|      0|          !ppi->cpi->oxcf.kf_cfg.fwd_kf_enabled) {
  ------------------
  |  Branch (3361:11): [True: 0, False: 0]
  ------------------
 3362|      0|        multiplier.num = 5;
 3363|      0|        multiplier.den = 2;
 3364|      0|      }
 3365|  73.6k|      if (uncompressed_frame_sz > SIZE_MAX / multiplier.num)
  ------------------
  |  Branch (3365:11): [True: 0, False: 73.6k]
  ------------------
 3366|      0|        return AOM_CODEC_MEM_ERROR;
 3367|  73.6k|      size_t data_sz = uncompressed_frame_sz * multiplier.num / multiplier.den;
 3368|  73.6k|      if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize;
  ------------------
  |  Branch (3368:11): [True: 0, False: 73.6k]
  ------------------
 3369|  73.6k|      if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) {
  ------------------
  |  Branch (3369:11): [True: 18.4k, False: 55.2k]
  |  Branch (3369:35): [True: 0, False: 55.2k]
  ------------------
 3370|  18.4k|        ctx->cx_data_sz = data_sz;
 3371|  18.4k|        free(ctx->cx_data);
 3372|  18.4k|        ctx->cx_data = (unsigned char *)malloc(ctx->cx_data_sz);
 3373|  18.4k|        if (ctx->cx_data == NULL) {
  ------------------
  |  Branch (3373:13): [True: 0, False: 18.4k]
  ------------------
 3374|      0|          ctx->cx_data_sz = 0;
 3375|      0|          return AOM_CODEC_MEM_ERROR;
 3376|      0|        }
 3377|  18.4k|      }
 3378|  73.6k|      for (int i = 0; i < ppi->num_fp_contexts - 1; i++) {
  ------------------
  |  Branch (3378:23): [True: 0, False: 73.6k]
  ------------------
 3379|      0|        if (ppi->parallel_frames_data[i].cx_data == NULL ||
  ------------------
  |  Branch (3379:13): [True: 0, False: 0]
  ------------------
 3380|      0|            ppi->parallel_frames_data[i].cx_data_sz < data_sz) {
  ------------------
  |  Branch (3380:13): [True: 0, False: 0]
  ------------------
 3381|      0|          ppi->parallel_frames_data[i].cx_data_sz = data_sz;
 3382|      0|          free(ppi->parallel_frames_data[i].cx_data);
 3383|      0|          ppi->parallel_frames_data[i].frame_size = 0;
 3384|      0|          ppi->parallel_frames_data[i].cx_data =
 3385|      0|              (unsigned char *)malloc(ppi->parallel_frames_data[i].cx_data_sz);
 3386|      0|          if (ppi->parallel_frames_data[i].cx_data == NULL) {
  ------------------
  |  Branch (3386:15): [True: 0, False: 0]
  ------------------
 3387|      0|            ppi->parallel_frames_data[i].cx_data_sz = 0;
 3388|      0|            return AOM_CODEC_MEM_ERROR;
 3389|      0|          }
 3390|      0|        }
 3391|      0|      }
 3392|  73.6k|    }
 3393|  73.6k|  }
 3394|       |
 3395|  92.0k|  aom_codec_pkt_list_init(&ctx->pkt_list);
  ------------------
  |  |  357|  92.0k|  (m)->alloc.head.cnt = 0,         \
  |  |  358|  92.0k|  (m)->alloc.head.max = sizeof((m)->alloc.pkts) / sizeof((m)->alloc.pkts[0])
  ------------------
 3396|       |
 3397|  92.0k|  volatile aom_enc_frame_flags_t flags = enc_flags;
 3398|       |
 3399|       |  // The jmp_buf is valid only for the duration of the function that calls
 3400|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 3401|       |  // before it returns.
 3402|  92.0k|  if (setjmp(ppi->error.jmp)) {
  ------------------
  |  Branch (3402:7): [True: 0, False: 92.0k]
  ------------------
 3403|      0|    ppi->error.setjmp = 0;
 3404|      0|    res = update_error_state(ctx, &ppi->error);
 3405|      0|    return res;
 3406|      0|  }
 3407|  92.0k|  ppi->error.setjmp = 1;
 3408|       |
 3409|  92.0k|  if (ppi->use_svc && ppi->cpi->svc.use_flexible_mode == 0 && flags == 0)
  ------------------
  |  Branch (3409:7): [True: 0, False: 92.0k]
  |  Branch (3409:23): [True: 0, False: 0]
  |  Branch (3409:63): [True: 0, False: 0]
  ------------------
 3410|      0|    av1_set_svc_fixed_mode(ppi->cpi);
 3411|       |
 3412|       |  // Note(yunqing): While applying encoding flags, always start from enabling
 3413|       |  // all, and then modifying according to the flags. Previous frame's flags are
 3414|       |  // overwritten.
 3415|  92.0k|  av1_apply_encoding_flags(ppi->cpi, flags);
 3416|  92.0k|  if (cpi_lap != NULL) {
  ------------------
  |  Branch (3416:7): [True: 0, False: 92.0k]
  ------------------
 3417|      0|    av1_apply_encoding_flags(cpi_lap, flags);
 3418|      0|  }
 3419|       |
 3420|       |#if CONFIG_TUNE_VMAF
 3421|       |  if (ctx->extra_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
 3422|       |      ctx->extra_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN) {
 3423|       |    aom_init_vmaf_model(&ppi->cpi->vmaf_info.vmaf_model,
 3424|       |                        ppi->cpi->oxcf.tune_cfg.vmaf_model_path);
 3425|       |  }
 3426|       |#endif
 3427|       |
 3428|       |  // Handle fixed keyframe intervals
 3429|  92.0k|  if (is_stat_generation_stage(ppi->cpi) || is_one_pass_rt_params(ppi->cpi)) {
  ------------------
  |  Branch (3429:7): [True: 0, False: 92.0k]
  |  Branch (3429:45): [True: 30.5k, False: 61.5k]
  ------------------
 3430|  30.5k|    if (ctx->cfg.kf_mode == AOM_KF_AUTO &&
  ------------------
  |  Branch (3430:9): [True: 30.5k, False: 0]
  ------------------
 3431|  30.5k|        ctx->cfg.kf_min_dist == ctx->cfg.kf_max_dist) {
  ------------------
  |  Branch (3431:9): [True: 0, False: 30.5k]
  ------------------
 3432|      0|      if (ppi->cpi->common.spatial_layer_id == 0 &&
  ------------------
  |  Branch (3432:11): [True: 0, False: 0]
  ------------------
 3433|      0|          ++ctx->fixed_kf_cntr > ctx->cfg.kf_min_dist) {
  ------------------
  |  Branch (3433:11): [True: 0, False: 0]
  ------------------
 3434|      0|        flags |= AOM_EFLAG_FORCE_KF;
  ------------------
  |  |  379|      0|#define AOM_EFLAG_FORCE_KF (1 << 0)
  ------------------
 3435|      0|        ctx->fixed_kf_cntr = 1;
 3436|      0|      }
 3437|      0|    }
 3438|  30.5k|  }
 3439|       |
 3440|  92.0k|  if (res == AOM_CODEC_OK) {
  ------------------
  |  Branch (3440:7): [True: 92.0k, False: 0]
  ------------------
 3441|  92.0k|    AV1_COMP *cpi = ppi->cpi;
 3442|       |
 3443|       |    // Per-frame PSNR is not supported when g_lag_in_frames is greater than 0.
 3444|  92.0k|    if ((flags & AOM_EFLAG_CALCULATE_PSNR) && ctx->cfg.g_lag_in_frames != 0) {
  ------------------
  |  |  381|  92.0k|#define AOM_EFLAG_CALCULATE_PSNR (1 << 1)
  ------------------
  |  Branch (3444:9): [True: 0, False: 92.0k]
  |  Branch (3444:47): [True: 0, False: 0]
  ------------------
 3445|      0|      aom_internal_error(
 3446|      0|          &ppi->error, AOM_CODEC_INCAPABLE,
 3447|      0|          "Cannot calculate per-frame PSNR when g_lag_in_frames is nonzero");
 3448|      0|    }
 3449|       |
 3450|       |    // Don't attempt to freeze internal state when lag is non-zero in order to
 3451|       |    // minimize risk of state leaking when e.g. multi-pass and b-frames are
 3452|       |    // used.
 3453|  92.0k|    if ((flags & AOM_EFLAG_FREEZE_INTERNAL_STATE) &&
  ------------------
  |  |  384|  92.0k|#define AOM_EFLAG_FREEZE_INTERNAL_STATE (1 << 2)
  ------------------
  |  Branch (3453:9): [True: 0, False: 92.0k]
  ------------------
 3454|      0|        ctx->cfg.g_lag_in_frames != 0) {
  ------------------
  |  Branch (3454:9): [True: 0, False: 0]
  ------------------
 3455|      0|      aom_internal_error(
 3456|      0|          &ppi->error, AOM_CODEC_INCAPABLE,
 3457|      0|          "Cannot freeze internal state when g_lag_in_frames is nonzero");
 3458|      0|    }
 3459|       |
 3460|       |    // Set up internal flags
 3461|       |#if CONFIG_INTERNAL_STATS
 3462|       |    assert(ppi->b_calculate_psnr == 1);
 3463|       |#else
 3464|  92.0k|    ppi->b_calculate_psnr = (ctx->base.init_flags & AOM_CODEC_USE_PSNR) ||
  ------------------
  |  |   79|  92.0k|#define AOM_CODEC_USE_PSNR 0x10000         /**< Calculate PSNR on each frame */
  ------------------
  |  Branch (3464:29): [True: 0, False: 92.0k]
  ------------------
 3465|  92.0k|                            (flags & AOM_EFLAG_CALCULATE_PSNR);
  ------------------
  |  |  381|  92.0k|#define AOM_EFLAG_CALCULATE_PSNR (1 << 1)
  ------------------
  |  Branch (3465:29): [True: 0, False: 92.0k]
  ------------------
 3466|  92.0k|#endif  // CONFIG_INTERNAL_STATS
 3467|       |
 3468|  92.0k|    ppi->b_freeze_internal_state =
 3469|  92.0k|        (flags & AOM_EFLAG_FREEZE_INTERNAL_STATE) != 0;
  ------------------
  |  |  384|  92.0k|#define AOM_EFLAG_FREEZE_INTERNAL_STATE (1 << 2)
  ------------------
 3470|       |
 3471|  92.0k|    if (img != NULL) {
  ------------------
  |  Branch (3471:9): [True: 73.6k, False: 18.4k]
  ------------------
 3472|  73.6k|      if (!ctx->pts_offset_initialized) {
  ------------------
  |  Branch (3472:11): [True: 18.4k, False: 55.2k]
  ------------------
 3473|  18.4k|        ctx->pts_offset = ptsvol;
 3474|  18.4k|        ctx->pts_offset_initialized = 1;
 3475|  18.4k|      }
 3476|  73.6k|      if (ptsvol < ctx->pts_offset) {
  ------------------
  |  Branch (3476:11): [True: 0, False: 73.6k]
  ------------------
 3477|      0|        aom_internal_error(&ppi->error, AOM_CODEC_INVALID_PARAM,
 3478|      0|                           "pts is smaller than initial pts");
 3479|      0|      }
 3480|  73.6k|      ptsvol -= ctx->pts_offset;
 3481|  73.6k|      if (ptsvol > INT64_MAX / cpi_data.timestamp_ratio->num) {
  ------------------
  |  Branch (3481:11): [True: 0, False: 73.6k]
  ------------------
 3482|      0|        aom_internal_error(
 3483|      0|            &ppi->error, AOM_CODEC_INVALID_PARAM,
 3484|      0|            "conversion of relative pts to ticks would overflow");
 3485|      0|      }
 3486|  73.6k|      int64_t src_time_stamp =
 3487|  73.6k|          timebase_units_to_ticks(cpi_data.timestamp_ratio, ptsvol);
 3488|  73.6k|#if ULONG_MAX > INT64_MAX
 3489|  73.6k|      if (duration > INT64_MAX) {
  ------------------
  |  Branch (3489:11): [True: 0, False: 73.6k]
  ------------------
 3490|      0|        aom_internal_error(&ppi->error, AOM_CODEC_INVALID_PARAM,
 3491|      0|                           "duration is too big");
 3492|      0|      }
 3493|  73.6k|#endif
 3494|  73.6k|      if (ptsvol > INT64_MAX - (int64_t)duration) {
  ------------------
  |  Branch (3494:11): [True: 0, False: 73.6k]
  ------------------
 3495|      0|        aom_internal_error(&ppi->error, AOM_CODEC_INVALID_PARAM,
 3496|      0|                           "relative pts + duration is too big");
 3497|      0|      }
 3498|  73.6k|      aom_codec_pts_t pts_end = ptsvol + (int64_t)duration;
 3499|  73.6k|      if (pts_end > INT64_MAX / cpi_data.timestamp_ratio->num) {
  ------------------
  |  Branch (3499:11): [True: 0, False: 73.6k]
  ------------------
 3500|      0|        aom_internal_error(
 3501|      0|            &ppi->error, AOM_CODEC_INVALID_PARAM,
 3502|      0|            "conversion of relative pts + duration to ticks would overflow");
 3503|      0|      }
 3504|  73.6k|      int64_t src_end_time_stamp =
 3505|  73.6k|          timebase_units_to_ticks(cpi_data.timestamp_ratio, pts_end);
 3506|       |
 3507|  73.6k|      YV12_BUFFER_CONFIG sd;
 3508|  73.6k|      res = image2yuvconfig(img, &sd);
 3509|       |      // When generating a monochrome stream, make |sd| a monochrome image.
 3510|  73.6k|      if (ctx->cfg.monochrome) {
  ------------------
  |  Branch (3510:11): [True: 45.6k, False: 27.9k]
  ------------------
 3511|  45.6k|        sd.u_buffer = sd.v_buffer = NULL;
 3512|  45.6k|        sd.uv_stride = 0;
 3513|  45.6k|        sd.monochrome = 1;
 3514|  45.6k|      }
 3515|  73.6k|      int use_highbitdepth = (sd.flags & YV12_FLAG_HIGHBITDEPTH) != 0;
  ------------------
  |  |  142|  73.6k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 3516|  73.6k|      int subsampling_x = sd.subsampling_x;
 3517|  73.6k|      int subsampling_y = sd.subsampling_y;
 3518|       |
 3519|  73.6k|      if (!ppi->lookahead) {
  ------------------
  |  Branch (3519:11): [True: 18.4k, False: 55.2k]
  ------------------
 3520|  18.4k|        int lag_in_frames = cpi_lap != NULL ? cpi_lap->oxcf.gf_cfg.lag_in_frames
  ------------------
  |  Branch (3520:29): [True: 0, False: 18.4k]
  ------------------
 3521|  18.4k|                                            : cpi->oxcf.gf_cfg.lag_in_frames;
 3522|  18.4k|        AV1EncoderConfig *oxcf = &cpi->oxcf;
 3523|  18.4k|        const BLOCK_SIZE sb_size = av1_select_sb_size(
 3524|  18.4k|            oxcf, oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height,
 3525|  18.4k|            ppi->number_spatial_layers);
 3526|  18.4k|        oxcf->border_in_pixels =
 3527|  18.4k|            av1_get_enc_border_size(av1_is_resize_needed(oxcf),
 3528|  18.4k|                                    oxcf->kf_cfg.key_freq_max == 0, sb_size);
 3529|  36.8k|        for (int i = 0; i < ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (3529:25): [True: 18.4k, False: 18.4k]
  ------------------
 3530|  18.4k|          ppi->parallel_cpi[i]->oxcf.border_in_pixels = oxcf->border_in_pixels;
 3531|  18.4k|        }
 3532|       |
 3533|  18.4k|        const int src_border_in_pixels = get_src_border_in_pixels(cpi, sb_size);
 3534|  18.4k|        ppi->lookahead = av1_lookahead_init(
 3535|  18.4k|            cpi->oxcf.frm_dim_cfg.width, cpi->oxcf.frm_dim_cfg.height,
 3536|  18.4k|            subsampling_x, subsampling_y, use_highbitdepth, lag_in_frames,
 3537|  18.4k|            src_border_in_pixels, cpi->common.features.byte_alignment,
 3538|  18.4k|            ctx->num_lap_buffers, (cpi->oxcf.kf_cfg.key_freq_max == 0),
 3539|  18.4k|            cpi->alloc_pyramid);
 3540|  18.4k|      }
 3541|  73.6k|      if (!ppi->lookahead)
  ------------------
  |  Branch (3541:11): [True: 0, False: 73.6k]
  ------------------
 3542|      0|        aom_internal_error(&ppi->error, AOM_CODEC_MEM_ERROR,
 3543|      0|                           "Failed to allocate lag buffers");
 3544|   147k|      for (int i = 0; i < ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (3544:23): [True: 73.6k, False: 73.6k]
  ------------------
 3545|  73.6k|        aom_codec_err_t err =
 3546|  73.6k|            av1_check_initial_width(ppi->parallel_cpi[i], use_highbitdepth,
 3547|  73.6k|                                    subsampling_x, subsampling_y);
 3548|  73.6k|        if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (3548:13): [True: 0, False: 73.6k]
  ------------------
 3549|      0|          aom_internal_error(&ppi->error, err,
 3550|      0|                             "av1_check_initial_width() failed");
 3551|      0|        }
 3552|  73.6k|      }
 3553|  73.6k|      if (cpi_lap != NULL) {
  ------------------
  |  Branch (3553:11): [True: 0, False: 73.6k]
  ------------------
 3554|      0|        aom_codec_err_t err = av1_check_initial_width(
 3555|      0|            cpi_lap, use_highbitdepth, subsampling_x, subsampling_y);
 3556|      0|        if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (3556:13): [True: 0, False: 0]
  ------------------
 3557|      0|          aom_internal_error(&ppi->error, err,
 3558|      0|                             "av1_check_initial_width() failed");
 3559|      0|        }
 3560|      0|      }
 3561|       |
 3562|       |      // Store the original flags in to the frame buffer. Will extract the
 3563|       |      // key frame flag when we actually encode this frame.
 3564|  73.6k|      if (av1_receive_raw_frame(cpi, flags | ctx->next_frame_flags, &sd,
  ------------------
  |  Branch (3564:11): [True: 0, False: 73.6k]
  ------------------
 3565|  73.6k|                                src_time_stamp, src_end_time_stamp)) {
 3566|      0|        res = update_error_state(ctx, cpi->common.error);
 3567|      0|      }
 3568|  73.6k|      ctx->next_frame_flags = 0;
 3569|  73.6k|    }
 3570|       |
 3571|  92.0k|    cpi_data.cx_data = ctx->cx_data;
 3572|  92.0k|    cpi_data.cx_data_sz = ctx->cx_data_sz;
 3573|       |
 3574|       |    /* Any pending invisible frames? */
 3575|  92.0k|    if (ctx->pending_cx_data_sz) {
  ------------------
  |  Branch (3575:9): [True: 0, False: 92.0k]
  ------------------
 3576|      0|      cpi_data.cx_data += ctx->pending_cx_data_sz;
 3577|      0|      cpi_data.cx_data_sz -= ctx->pending_cx_data_sz;
 3578|       |
 3579|       |      /* TODO: this is a minimal check, the underlying codec doesn't respect
 3580|       |       * the buffer size anyway.
 3581|       |       */
 3582|      0|      if (cpi_data.cx_data_sz < ctx->cx_data_sz / 2) {
  ------------------
  |  Branch (3582:11): [True: 0, False: 0]
  ------------------
 3583|      0|        aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3584|      0|                           "Compressed data buffer too small");
 3585|      0|      }
 3586|      0|    }
 3587|       |
 3588|  92.0k|    int is_frame_visible = 0;
 3589|  92.0k|    int has_no_show_keyframe = 0;
 3590|  92.0k|    int num_workers = 0;
 3591|       |
 3592|  92.0k|    if (cpi->oxcf.pass == AOM_RC_FIRST_PASS) {
  ------------------
  |  Branch (3592:9): [True: 0, False: 92.0k]
  ------------------
 3593|      0|#if !CONFIG_REALTIME_ONLY
 3594|      0|      num_workers = ppi->p_mt_info.num_mod_workers[MOD_FP] =
 3595|      0|          av1_fp_compute_num_enc_workers(cpi);
 3596|      0|#endif
 3597|  92.0k|    } else {
 3598|  92.0k|      av1_compute_num_workers_for_mt(cpi);
 3599|  92.0k|      num_workers = av1_get_max_num_workers(cpi);
 3600|  92.0k|    }
 3601|  92.0k|    if (num_workers > 1 && ppi->p_mt_info.num_workers < num_workers) {
  ------------------
  |  Branch (3601:9): [True: 58.7k, False: 33.2k]
  |  Branch (3601:28): [True: 14.0k, False: 44.7k]
  ------------------
 3602|       |      // Obtain the maximum no. of frames that can be supported in a parallel
 3603|       |      // encode set.
 3604|  14.0k|      if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (3604:11): [True: 0, False: 14.0k]
  ------------------
 3605|      0|        ppi->num_fp_contexts = av1_compute_num_fp_contexts(ppi, &cpi->oxcf);
 3606|      0|      }
 3607|  14.0k|      if (ppi->p_mt_info.num_workers > 0) {
  ------------------
  |  Branch (3607:11): [True: 0, False: 14.0k]
  ------------------
 3608|      0|        av1_terminate_workers(ppi);
 3609|      0|        free_thread_data(ppi);
 3610|      0|        aom_free(ppi->p_mt_info.tile_thr_data);
 3611|      0|        ppi->p_mt_info.tile_thr_data = NULL;
 3612|      0|        aom_free(ppi->p_mt_info.workers);
 3613|      0|        ppi->p_mt_info.workers = NULL;
 3614|      0|        ppi->p_mt_info.num_workers = 0;
 3615|      0|        for (int j = 0; j < ppi->num_fp_contexts; j++) {
  ------------------
  |  Branch (3615:25): [True: 0, False: 0]
  ------------------
 3616|      0|          aom_free(ppi->parallel_cpi[j]->td.tctx);
 3617|      0|          ppi->parallel_cpi[j]->td.tctx = NULL;
 3618|      0|        }
 3619|      0|      }
 3620|  14.0k|      av1_create_workers(ppi, num_workers);
 3621|  14.0k|      av1_init_tile_thread_data(ppi, cpi->oxcf.pass == AOM_RC_FIRST_PASS);
 3622|  14.0k|    }
 3623|       |
 3624|       |    // Re-allocate thread data if workers for encoder multi-threading stage
 3625|       |    // exceeds prev_num_enc_workers.
 3626|  92.0k|    const int num_enc_workers =
 3627|  92.0k|        av1_get_num_mod_workers_for_alloc(&ppi->p_mt_info, MOD_ENC);
 3628|  92.0k|    if (ppi->p_mt_info.prev_num_enc_workers < num_enc_workers &&
  ------------------
  |  Branch (3628:9): [True: 21.9k, False: 70.0k]
  ------------------
 3629|  21.9k|        num_enc_workers <= ppi->p_mt_info.num_workers) {
  ------------------
  |  Branch (3629:9): [True: 0, False: 21.9k]
  ------------------
 3630|      0|      free_thread_data(ppi);
 3631|      0|      for (int j = 0; j < ppi->num_fp_contexts; j++) {
  ------------------
  |  Branch (3631:23): [True: 0, False: 0]
  ------------------
 3632|      0|        aom_free(ppi->parallel_cpi[j]->td.tctx);
 3633|      0|        ppi->parallel_cpi[j]->td.tctx = NULL;
 3634|      0|      }
 3635|      0|      av1_init_tile_thread_data(ppi, cpi->oxcf.pass == AOM_RC_FIRST_PASS);
 3636|      0|    }
 3637|       |
 3638|   184k|    for (int i = 0; i < ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (3638:21): [True: 92.0k, False: 92.0k]
  ------------------
 3639|  92.0k|      av1_init_frame_mt(ppi, ppi->parallel_cpi[i]);
 3640|  92.0k|    }
 3641|  92.0k|    if (cpi_lap != NULL) {
  ------------------
  |  Branch (3641:9): [True: 0, False: 92.0k]
  ------------------
 3642|      0|      av1_init_frame_mt(ppi, cpi_lap);
 3643|      0|    }
 3644|  92.0k|#if CONFIG_MULTITHREAD
 3645|  92.0k|    if (ppi->p_mt_info.num_workers > 1) {
  ------------------
  |  Branch (3645:9): [True: 70.0k, False: 21.9k]
  ------------------
 3646|   140k|      for (int i = 0; i < ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (3646:23): [True: 70.0k, False: 70.0k]
  ------------------
 3647|  70.0k|        av1_init_mt_sync(ppi->parallel_cpi[i],
 3648|  70.0k|                         ppi->parallel_cpi[i]->oxcf.pass == AOM_RC_FIRST_PASS);
 3649|  70.0k|      }
 3650|  70.0k|      if (cpi_lap != NULL) {
  ------------------
  |  Branch (3650:11): [True: 0, False: 70.0k]
  ------------------
 3651|      0|        av1_init_mt_sync(cpi_lap, 1);
 3652|      0|      }
 3653|  70.0k|    }
 3654|  92.0k|#endif  // CONFIG_MULTITHREAD
 3655|       |
 3656|       |    // Call for LAP stage
 3657|  92.0k|    if (cpi_lap != NULL && !is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (3657:9): [True: 0, False: 92.0k]
  |  Branch (3657:28): [True: 0, False: 0]
  ------------------
 3658|      0|      if (cpi_lap->ppi->b_freeze_internal_state) {
  ------------------
  |  Branch (3658:11): [True: 0, False: 0]
  ------------------
 3659|      0|        av1_save_all_coding_context(cpi_lap);
 3660|      0|      }
 3661|      0|      AV1_COMP_DATA cpi_lap_data = { 0 };
 3662|      0|      cpi_lap_data.flush = !img;
 3663|      0|      cpi_lap_data.timestamp_ratio = &ctx->timestamp_ratio;
 3664|      0|      const int status = av1_get_compressed_data(cpi_lap, &cpi_lap_data);
 3665|      0|      if (status > AOM_CODEC_OK) {
  ------------------
  |  Branch (3665:11): [True: 0, False: 0]
  ------------------
 3666|      0|        aom_internal_error_copy(&ppi->error, cpi_lap->common.error);
 3667|      0|      }
 3668|      0|      av1_post_encode_updates(cpi_lap, &cpi_lap_data);
 3669|      0|      if (cpi_lap->ppi->b_freeze_internal_state) {
  ------------------
  |  Branch (3669:11): [True: 0, False: 0]
  ------------------
 3670|      0|        restore_all_coding_context(cpi_lap);
 3671|      0|      }
 3672|      0|    }
 3673|       |
 3674|       |    // Recalculate the maximum number of frames that can be encoded in
 3675|       |    // parallel at the beginning of sub gop.
 3676|  92.0k|    if (is_stat_consumption_stage(cpi) && ppi->gf_group.size > 0 &&
  ------------------
  |  Branch (3676:9): [True: 0, False: 92.0k]
  |  Branch (3676:43): [True: 0, False: 0]
  ------------------
 3677|      0|        cpi->gf_frame_index == ppi->gf_group.size) {
  ------------------
  |  Branch (3677:9): [True: 0, False: 0]
  ------------------
 3678|      0|      ppi->num_fp_contexts = av1_compute_num_fp_contexts(ppi, &cpi->oxcf);
 3679|      0|    }
 3680|       |
 3681|       |    // Get the next visible frame. Invisible frames get packed with the next
 3682|       |    // visible frame.
 3683|   165k|    while (cpi_data.cx_data_sz >= ctx->cx_data_sz / 2 && !is_frame_visible) {
  ------------------
  |  Branch (3683:12): [True: 165k, False: 0]
  |  Branch (3683:58): [True: 92.0k, False: 73.6k]
  ------------------
 3684|  92.0k|      int simulate_parallel_frame = 0;
 3685|  92.0k|      int status = -1;
 3686|  92.0k|      cpi->do_frame_data_update = true;
 3687|  92.0k|      cpi->ref_idx_to_skip = INVALID_IDX;
  ------------------
  |  |   15|  92.0k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 3688|  92.0k|      cpi->ref_refresh_index = INVALID_IDX;
  ------------------
  |  |   15|  92.0k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 3689|  92.0k|      cpi->refresh_idx_available = false;
 3690|  92.0k|      if (cpi->ppi->b_freeze_internal_state) {
  ------------------
  |  Branch (3690:11): [True: 0, False: 92.0k]
  ------------------
 3691|      0|        av1_save_all_coding_context(cpi);
 3692|      0|      }
 3693|       |
 3694|       |#if CONFIG_FPMT_TEST
 3695|       |      simulate_parallel_frame =
 3696|       |          cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE ? 1 : 0;
 3697|       |      if (simulate_parallel_frame) {
 3698|       |        if (ppi->num_fp_contexts > 1 && ppi->gf_group.size > 1) {
 3699|       |          if (cpi->gf_frame_index < ppi->gf_group.size) {
 3700|       |            calc_frame_data_update_flag(&ppi->gf_group, cpi->gf_frame_index,
 3701|       |                                        &cpi->do_frame_data_update);
 3702|       |          }
 3703|       |        }
 3704|       |        status = av1_get_compressed_data(cpi, &cpi_data);
 3705|       |      }
 3706|       |
 3707|       |#endif  // CONFIG_FPMT_TEST
 3708|  92.0k|      if (!simulate_parallel_frame) {
  ------------------
  |  Branch (3708:11): [True: 92.0k, False: 0]
  ------------------
 3709|       |        // Add a range check here to give an error for frame_parallel_level
 3710|       |        // array out-of-bounds access.
 3711|  92.0k|        if (cpi->gf_frame_index >= MAX_STATIC_GF_GROUP_LENGTH) {
  ------------------
  |  |   42|  92.0k|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
  |  Branch (3711:13): [True: 0, False: 92.0k]
  ------------------
 3712|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3713|      0|                             "cpi->gf_frame_index is out of range");
 3714|      0|        }
 3715|       |
 3716|       |        // May need a better way for checking the frame's frame_parallel_level,
 3717|       |        // especially for the first frame of the following gop.
 3718|  92.0k|        if (ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
  ------------------
  |  Branch (3718:13): [True: 92.0k, False: 0]
  ------------------
 3719|  92.0k|          status = av1_get_compressed_data(cpi, &cpi_data);
 3720|  92.0k|        } else if (ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] ==
  ------------------
  |  Branch (3720:20): [True: 0, False: 0]
  ------------------
 3721|      0|                   1) {
 3722|       |          // In case of an error, longjmp() would be invoked and hence "status"
 3723|       |          // is set to AOM_CODEC_OK here.
 3724|      0|          av1_compress_parallel_frames(ppi, &cpi_data);
 3725|      0|          status = AOM_CODEC_OK;
 3726|      0|        } else {
 3727|       |          // No possibility of failures from this function and hence "status" is
 3728|       |          // set to AOM_CODEC_OK here.
 3729|      0|          cpi = av1_get_parallel_frame_enc_data(ppi, &cpi_data);
 3730|      0|          status = AOM_CODEC_OK;
 3731|      0|        }
 3732|  92.0k|      }
 3733|  92.0k|      if (status == -1) break;
  ------------------
  |  Branch (3733:11): [True: 18.4k, False: 73.6k]
  ------------------
 3734|  73.6k|      if (status != AOM_CODEC_OK) {
  ------------------
  |  Branch (3734:11): [True: 0, False: 73.6k]
  ------------------
 3735|      0|        aom_internal_error_copy(&ppi->error, cpi->common.error);
 3736|      0|      }
 3737|  73.6k|      if (ppi->num_fp_contexts > 0 && frame_is_intra_only(&cpi->common)) {
  ------------------
  |  Branch (3737:11): [True: 73.6k, False: 0]
  |  Branch (3737:39): [True: 18.4k, False: 55.2k]
  ------------------
 3738|  18.4k|        av1_init_sc_decisions(ppi);
 3739|  18.4k|      }
 3740|       |
 3741|  73.6k|      ppi->seq_params_locked = 1;
 3742|  73.6k|      av1_post_encode_updates(cpi, &cpi_data);
 3743|       |
 3744|  73.6k|      if (cpi->ppi->b_freeze_internal_state) {
  ------------------
  |  Branch (3744:11): [True: 0, False: 73.6k]
  ------------------
 3745|      0|        restore_all_coding_context(cpi);
 3746|      0|      }
 3747|       |
 3748|       |#if CONFIG_ENTROPY_STATS
 3749|       |      if (ppi->cpi->oxcf.pass != 1 && !cpi->common.show_existing_frame)
 3750|       |        av1_accumulate_frame_counts(&ppi->aggregate_fc, &cpi->counts);
 3751|       |#endif
 3752|       |#if CONFIG_INTERNAL_STATS
 3753|       |      if (ppi->cpi->oxcf.pass != 1) {
 3754|       |        ppi->total_time_compress_data += cpi->time_compress_data;
 3755|       |        ppi->total_recode_hits += cpi->frame_recode_hits;
 3756|       |        ppi->total_bytes += (uint64_t)cpi->bytes;
 3757|       |        for (int i = 0; i < MAX_MODES; i++) {
 3758|       |          ppi->total_mode_chosen_counts[i] += cpi->mode_chosen_counts[i];
 3759|       |        }
 3760|       |      }
 3761|       |#endif  // CONFIG_INTERNAL_STATS
 3762|       |
 3763|  73.6k|      if (!cpi_data.frame_size) continue;
  ------------------
  |  Branch (3763:11): [True: 0, False: 73.6k]
  ------------------
 3764|  73.6k|      assert(cpi_data.cx_data != NULL && cpi_data.cx_data_sz != 0);
 3765|  73.6k|      if (cpi_data.frame_size > cpi_data.cx_data_sz) {
  ------------------
  |  Branch (3765:11): [True: 0, False: 73.6k]
  ------------------
 3766|      0|        aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3767|      0|                           "cpi_data.cx_data buffer overflow");
 3768|      0|      }
 3769|  73.6k|      const int write_temporal_delimiter =
 3770|  73.6k|          !cpi->common.spatial_layer_id && !ctx->pending_cx_data_sz;
  ------------------
  |  Branch (3770:11): [True: 18.4k, False: 55.2k]
  |  Branch (3770:44): [True: 18.4k, False: 0]
  ------------------
 3771|       |
 3772|  73.6k|      if (write_temporal_delimiter) {
  ------------------
  |  Branch (3772:11): [True: 18.4k, False: 55.2k]
  ------------------
 3773|  18.4k|        uint32_t obu_header_size = 1;
 3774|  18.4k|        const uint32_t obu_payload_size = 0;
 3775|  18.4k|        const size_t length_field_size =
 3776|  18.4k|            aom_uleb_size_in_bytes(obu_payload_size);
 3777|       |
 3778|  18.4k|        const size_t move_offset = obu_header_size + length_field_size;
 3779|  18.4k|        assert(ctx->cx_data_sz == cpi_data.cx_data_sz);
 3780|  18.4k|        if (move_offset > ctx->cx_data_sz - cpi_data.frame_size) {
  ------------------
  |  Branch (3780:13): [True: 0, False: 18.4k]
  ------------------
 3781|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3782|      0|                             "ctx->cx_data buffer full");
 3783|      0|        }
 3784|  18.4k|        memmove(ctx->cx_data + move_offset, ctx->cx_data, cpi_data.frame_size);
 3785|  18.4k|        obu_header_size = av1_write_obu_header(
 3786|  18.4k|            &ppi->level_params, &cpi->frame_header_count,
 3787|  18.4k|            OBU_TEMPORAL_DELIMITER,
 3788|  18.4k|            ppi->seq_params.has_nonzero_operating_point_idc,
 3789|  18.4k|            /*is_layer_specific_obu=*/false, 0, ctx->cx_data);
 3790|  18.4k|        if (obu_header_size != 1) {
  ------------------
  |  Branch (3790:13): [True: 0, False: 18.4k]
  ------------------
 3791|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3792|      0|        }
 3793|       |
 3794|       |        // OBUs are preceded/succeeded by an unsigned leb128 coded integer.
 3795|  18.4k|        if (av1_write_uleb_obu_size(obu_payload_size,
  ------------------
  |  Branch (3795:13): [True: 0, False: 18.4k]
  ------------------
 3796|  18.4k|                                    ctx->cx_data + obu_header_size,
 3797|  18.4k|                                    length_field_size) != AOM_CODEC_OK) {
 3798|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3799|      0|        }
 3800|       |
 3801|  18.4k|        cpi_data.frame_size += move_offset;
 3802|  18.4k|      }
 3803|       |
 3804|  73.6k|      if (ctx->oxcf.save_as_annexb) {
  ------------------
  |  Branch (3804:11): [True: 0, False: 73.6k]
  ------------------
 3805|      0|        if (av1_convert_sect5obus_to_annexb(
  ------------------
  |  Branch (3805:13): [True: 0, False: 0]
  ------------------
 3806|      0|                cpi_data.cx_data, cpi_data.cx_data_sz, &cpi_data.frame_size) !=
 3807|      0|            AOM_CODEC_OK) {
 3808|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3809|      0|        }
 3810|       |
 3811|       |        // B_PRIME (add frame size)
 3812|      0|        const size_t length_field_size =
 3813|      0|            aom_uleb_size_in_bytes(cpi_data.frame_size);
 3814|      0|        if (length_field_size > cpi_data.cx_data_sz - cpi_data.frame_size) {
  ------------------
  |  Branch (3814:13): [True: 0, False: 0]
  ------------------
 3815|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3816|      0|                             "cpi_data.cx_data buffer full");
 3817|      0|        }
 3818|      0|        memmove(cpi_data.cx_data + length_field_size, cpi_data.cx_data,
 3819|      0|                cpi_data.frame_size);
 3820|      0|        if (av1_write_uleb_obu_size(cpi_data.frame_size, cpi_data.cx_data,
  ------------------
  |  Branch (3820:13): [True: 0, False: 0]
  ------------------
 3821|      0|                                    length_field_size) != AOM_CODEC_OK) {
 3822|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3823|      0|        }
 3824|      0|        cpi_data.frame_size += length_field_size;
 3825|      0|      }
 3826|       |
 3827|  73.6k|      ctx->pending_cx_data_sz += cpi_data.frame_size;
 3828|       |
 3829|  73.6k|      cpi_data.cx_data += cpi_data.frame_size;
 3830|  73.6k|      cpi_data.cx_data_sz -= cpi_data.frame_size;
 3831|       |
 3832|  73.6k|      is_frame_visible = cpi->common.show_frame;
 3833|       |
 3834|  73.6k|      has_no_show_keyframe |=
 3835|  73.6k|          (!is_frame_visible &&
  ------------------
  |  Branch (3835:12): [True: 0, False: 73.6k]
  ------------------
 3836|      0|           cpi->common.current_frame.frame_type == KEY_FRAME);
  ------------------
  |  Branch (3836:12): [True: 0, False: 0]
  ------------------
 3837|  73.6k|    }
 3838|  92.0k|    if (is_frame_visible) {
  ------------------
  |  Branch (3838:9): [True: 73.6k, False: 18.4k]
  ------------------
 3839|       |      // Add the frame packet to the list of returned packets.
 3840|  73.6k|      aom_codec_cx_pkt_t pkt;
 3841|       |
 3842|       |      // decrement frames_left counter
 3843|  73.6k|      ppi->frames_left = AOMMAX(0, ppi->frames_left - 1);
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 73.6k]
  |  |  ------------------
  ------------------
 3844|  73.6k|      if (ctx->oxcf.save_as_annexb) {
  ------------------
  |  Branch (3844:11): [True: 0, False: 73.6k]
  ------------------
 3845|       |        //  B_PRIME (add TU size)
 3846|      0|        size_t tu_size = ctx->pending_cx_data_sz;
 3847|      0|        const size_t length_field_size = aom_uleb_size_in_bytes(tu_size);
 3848|      0|        if (tu_size > ctx->cx_data_sz) {
  ------------------
  |  Branch (3848:13): [True: 0, False: 0]
  ------------------
 3849|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3850|      0|                             "ctx->cx_data buffer overflow");
 3851|      0|        }
 3852|      0|        if (length_field_size > ctx->cx_data_sz - tu_size) {
  ------------------
  |  Branch (3852:13): [True: 0, False: 0]
  ------------------
 3853|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 3854|      0|                             "ctx->cx_data buffer full");
 3855|      0|        }
 3856|      0|        memmove(ctx->cx_data + length_field_size, ctx->cx_data, tu_size);
 3857|      0|        if (av1_write_uleb_obu_size(tu_size, ctx->cx_data, length_field_size) !=
  ------------------
  |  Branch (3857:13): [True: 0, False: 0]
  ------------------
 3858|      0|            AOM_CODEC_OK) {
 3859|      0|          aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3860|      0|        }
 3861|      0|        ctx->pending_cx_data_sz += length_field_size;
 3862|      0|      }
 3863|       |
 3864|  73.6k|      pkt.kind = AOM_CODEC_CX_FRAME_PKT;
 3865|       |
 3866|  73.6k|      pkt.data.frame.buf = ctx->cx_data;
 3867|  73.6k|      pkt.data.frame.sz = ctx->pending_cx_data_sz;
 3868|  73.6k|      pkt.data.frame.partition_id = -1;
 3869|  73.6k|      pkt.data.frame.vis_frame_size = cpi_data.frame_size;
 3870|       |
 3871|  73.6k|      pkt.data.frame.pts = ticks_to_timebase_units(cpi_data.timestamp_ratio,
 3872|  73.6k|                                                   cpi_data.ts_frame_start) +
 3873|  73.6k|                           ctx->pts_offset;
 3874|  73.6k|      pkt.data.frame.flags = get_frame_pkt_flags(cpi, cpi_data.lib_flags);
 3875|  73.6k|      if (has_no_show_keyframe) {
  ------------------
  |  Branch (3875:11): [True: 0, False: 73.6k]
  ------------------
 3876|       |        // If one of the invisible frames in the packet is a keyframe, set
 3877|       |        // the delayed random access point flag.
 3878|      0|        pkt.data.frame.flags |= AOM_FRAME_IS_DELAYED_RANDOM_ACCESS_POINT;
  ------------------
  |  |  299|      0|#define AOM_FRAME_IS_DELAYED_RANDOM_ACCESS_POINT 0x80u
  ------------------
 3879|      0|      }
 3880|  73.6k|      const int64_t duration64 = ticks_to_timebase_units(
 3881|  73.6k|          cpi_data.timestamp_ratio,
 3882|  73.6k|          cpi_data.ts_frame_end - cpi_data.ts_frame_start);
 3883|  73.6k|      if (duration64 > UINT32_MAX) {
  ------------------
  |  Branch (3883:11): [True: 0, False: 73.6k]
  ------------------
 3884|      0|        aom_internal_error(&ppi->error, AOM_CODEC_ERROR, NULL);
 3885|      0|      }
 3886|  73.6k|      pkt.data.frame.duration = (uint32_t)duration64;
 3887|       |
 3888|  73.6k|      aom_codec_pkt_list_add(&ctx->pkt_list.head, &pkt);
 3889|       |
 3890|  73.6k|      ctx->pending_cx_data_sz = 0;
 3891|  73.6k|    }
 3892|  92.0k|  }
 3893|       |
 3894|  92.0k|  ppi->error.setjmp = 0;
 3895|  92.0k|  return res;
 3896|  92.0k|}
av1_cx_iface.c:validate_img:
  971|  73.6k|                                    const aom_image_t *img) {
  972|  73.6k|  switch (img->fmt) {
  973|      0|    case AOM_IMG_FMT_YV12:
  ------------------
  |  Branch (973:5): [True: 0, False: 73.6k]
  ------------------
  974|      0|    case AOM_IMG_FMT_NV12:
  ------------------
  |  Branch (974:5): [True: 0, False: 73.6k]
  ------------------
  975|  43.9k|    case AOM_IMG_FMT_I420:
  ------------------
  |  Branch (975:5): [True: 43.9k, False: 29.6k]
  ------------------
  976|  43.9k|    case AOM_IMG_FMT_YV1216:
  ------------------
  |  Branch (976:5): [True: 0, False: 73.6k]
  ------------------
  977|  60.0k|    case AOM_IMG_FMT_I42016: break;
  ------------------
  |  Branch (977:5): [True: 16.0k, False: 57.5k]
  ------------------
  978|  4.17k|    case AOM_IMG_FMT_I444:
  ------------------
  |  Branch (978:5): [True: 4.17k, False: 69.4k]
  ------------------
  979|  6.20k|    case AOM_IMG_FMT_I44416:
  ------------------
  |  Branch (979:5): [True: 2.02k, False: 71.5k]
  ------------------
  980|  6.20k|      if (ctx->cfg.g_profile == (unsigned int)PROFILE_0 &&
  ------------------
  |  Branch (980:11): [True: 0, False: 6.20k]
  ------------------
  981|      0|          !ctx->cfg.monochrome) {
  ------------------
  |  Branch (981:11): [True: 0, False: 0]
  ------------------
  982|      0|        ERROR("Invalid image format. I444 images not supported in profile.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  983|      0|      }
  984|  6.20k|      break;
  985|  6.20k|    case AOM_IMG_FMT_I422:
  ------------------
  |  Branch (985:5): [True: 4.99k, False: 68.6k]
  ------------------
  986|  7.40k|    case AOM_IMG_FMT_I42216:
  ------------------
  |  Branch (986:5): [True: 2.40k, False: 71.2k]
  ------------------
  987|  7.40k|      if (ctx->cfg.g_profile != (unsigned int)PROFILE_2) {
  ------------------
  |  Branch (987:11): [True: 0, False: 7.40k]
  ------------------
  988|      0|        ERROR("Invalid image format. I422 images not supported in profile.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  989|      0|      }
  990|  7.40k|      break;
  991|  7.40k|    default:
  ------------------
  |  Branch (991:5): [True: 0, False: 73.6k]
  ------------------
  992|      0|      ERROR(
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  993|      0|          "Invalid image format. Only YV12, NV12, I420, I422, I444 images are "
  994|      0|          "supported.");
  995|      0|      break;
  996|  73.6k|  }
  997|       |
  998|  73.6k|  if (img->d_w != ctx->cfg.g_w || img->d_h != ctx->cfg.g_h)
  ------------------
  |  Branch (998:7): [True: 0, False: 73.6k]
  |  Branch (998:35): [True: 0, False: 73.6k]
  ------------------
  999|      0|    ERROR("Image size must match encoder init configuration size");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1000|  73.6k|  assert(img->fmt & AOM_IMG_FMT_PLANAR);
 1001|  73.6k|  if (!ctx->cfg.monochrome && img->fmt != AOM_IMG_FMT_NV12 &&
  ------------------
  |  Branch (1001:7): [True: 27.9k, False: 45.6k]
  |  Branch (1001:31): [True: 27.9k, False: 0]
  ------------------
 1002|  27.9k|      img->stride[AOM_PLANE_U] != img->stride[AOM_PLANE_V])
  ------------------
  |  |  282|  27.9k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                    img->stride[AOM_PLANE_U] != img->stride[AOM_PLANE_V])
  ------------------
  |  |  283|  27.9k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
  |  Branch (1002:7): [True: 0, False: 27.9k]
  ------------------
 1003|      0|    ERROR("Image U/V strides must match");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1004|       |
 1005|       |  // 6.4.2 Color config semantics
 1006|       |  // If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of
 1007|       |  // bitstream conformance that subsampling_x is equal to 0 and subsampling_y
 1008|       |  // is equal to 0.
 1009|  73.6k|  const aom_matrix_coefficients_t matrix_coefficients =
 1010|  73.6k|      ctx->extra_cfg.matrix_coefficients;
 1011|  73.6k|  if (matrix_coefficients == AOM_CICP_MC_IDENTITY &&
  ------------------
  |  Branch (1011:7): [True: 0, False: 73.6k]
  ------------------
 1012|      0|      (img->x_chroma_shift != 0 || img->y_chroma_shift != 0)) {
  ------------------
  |  Branch (1012:8): [True: 0, False: 0]
  |  Branch (1012:36): [True: 0, False: 0]
  ------------------
 1013|      0|    ERROR("Subsampling must be 0 with AOM_CICP_MC_IDENTITY.");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1014|      0|  }
 1015|       |
 1016|       |#if CONFIG_TUNE_BUTTERAUGLI
 1017|       |  if (ctx->extra_cfg.tuning == AOM_TUNE_BUTTERAUGLI) {
 1018|       |    if (img->bit_depth > 8) {
 1019|       |      ERROR("Only 8 bit depth images supported in tune=butteraugli mode.");
 1020|       |    }
 1021|       |    if (matrix_coefficients != AOM_CICP_MC_IDENTITY &&
 1022|       |        matrix_coefficients != AOM_CICP_MC_BT_709 &&
 1023|       |        matrix_coefficients != AOM_CICP_MC_BT_601 &&
 1024|       |        matrix_coefficients != AOM_CICP_MC_BT_470_B_G) {
 1025|       |      ERROR(
 1026|       |          "Only BT.709 and BT.601 matrix coefficients supported in "
 1027|       |          "tune=butteraugli mode. Identity matrix is treated as BT.601.");
 1028|       |    }
 1029|       |  }
 1030|       |#endif
 1031|       |
 1032|  73.6k|#if CONFIG_AV1_HIGHBITDEPTH
 1033|  73.6k|  if (ctx->extra_cfg.validate_hbd_input &&
  ------------------
  |  Branch (1033:7): [True: 73.6k, False: 0]
  ------------------
 1034|  73.6k|      (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH)) {
  ------------------
  |  |   38|  73.6k|#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
  ------------------
  |  Branch (1034:7): [True: 20.4k, False: 53.1k]
  ------------------
 1035|  20.4k|    const unsigned int bit_depth = ctx->cfg.g_bit_depth;
 1036|  20.4k|    const int max_val = 1 << bit_depth;
 1037|       |    // Note there is no high bitdepth version of NV12 defined. If one is
 1038|       |    // added, `num_planes` should be 2 in that case.
 1039|  20.4k|    const int num_planes = ctx->cfg.monochrome ? 1 : 3;
  ------------------
  |  Branch (1039:28): [True: 11.2k, False: 9.28k]
  ------------------
 1040|  59.5k|    for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1040:25): [True: 39.0k, False: 20.4k]
  ------------------
 1041|  39.0k|      const unsigned short *src = (const unsigned short *)img->planes[plane];
 1042|  39.0k|      if (!src) return AOM_CODEC_INVALID_PARAM;
  ------------------
  |  Branch (1042:11): [True: 0, False: 39.0k]
  ------------------
 1043|  39.0k|      const unsigned int stride = img->stride[plane] / 2;
 1044|  39.0k|      const unsigned int ph = aom_img_plane_height(img, plane);
 1045|  39.0k|      const unsigned int pw = aom_img_plane_width(img, plane);
 1046|  1.68M|      for (unsigned int i = 0; i < ph; ++i) {
  ------------------
  |  Branch (1046:32): [True: 1.64M, False: 39.0k]
  ------------------
 1047|  36.7M|        for (unsigned int j = 0; j < pw; ++j) {
  ------------------
  |  Branch (1047:34): [True: 35.1M, False: 1.64M]
  ------------------
 1048|  35.1M|          if (src[j] >= max_val) {
  ------------------
  |  Branch (1048:15): [True: 0, False: 35.1M]
  ------------------
 1049|      0|            ERROR("Input pixel value out of range for encoder bit depth");
  ------------------
  |  |  669|      0|  do {                              \
  |  |  670|      0|    ctx->base.err_detail = str;     \
  |  |  671|      0|    return AOM_CODEC_INVALID_PARAM; \
  |  |  672|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (672:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1050|      0|          }
 1051|  35.1M|        }
 1052|  1.64M|        src += stride;
 1053|  1.64M|      }
 1054|  39.0k|    }
 1055|  20.4k|  }
 1056|  73.6k|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1057|       |
 1058|  73.6k|  return AOM_CODEC_OK;
 1059|  73.6k|}
av1_cx_iface.c:get_image_bps:
 1061|  73.6k|static int get_image_bps(const aom_image_t *img) {
 1062|  73.6k|  switch (img->fmt) {
 1063|      0|    case AOM_IMG_FMT_YV12:
  ------------------
  |  Branch (1063:5): [True: 0, False: 73.6k]
  ------------------
 1064|      0|    case AOM_IMG_FMT_NV12:
  ------------------
  |  Branch (1064:5): [True: 0, False: 73.6k]
  ------------------
 1065|  43.9k|    case AOM_IMG_FMT_I420: return 12;
  ------------------
  |  Branch (1065:5): [True: 43.9k, False: 29.6k]
  ------------------
 1066|  4.99k|    case AOM_IMG_FMT_I422: return 16;
  ------------------
  |  Branch (1066:5): [True: 4.99k, False: 68.6k]
  ------------------
 1067|  4.17k|    case AOM_IMG_FMT_I444: return 24;
  ------------------
  |  Branch (1067:5): [True: 4.17k, False: 69.4k]
  ------------------
 1068|      0|    case AOM_IMG_FMT_YV1216:
  ------------------
  |  Branch (1068:5): [True: 0, False: 73.6k]
  ------------------
 1069|  16.0k|    case AOM_IMG_FMT_I42016: return 24;
  ------------------
  |  Branch (1069:5): [True: 16.0k, False: 57.5k]
  ------------------
 1070|  2.40k|    case AOM_IMG_FMT_I42216: return 32;
  ------------------
  |  Branch (1070:5): [True: 2.40k, False: 71.2k]
  ------------------
 1071|  2.02k|    case AOM_IMG_FMT_I44416: return 48;
  ------------------
  |  Branch (1071:5): [True: 2.02k, False: 71.5k]
  ------------------
 1072|      0|    default: assert(0 && "Invalid image format"); break;
  ------------------
  |  Branch (1072:5): [True: 0, False: 73.6k]
  ------------------
 1073|  73.6k|  }
 1074|      0|  return 0;
 1075|  73.6k|}
av1_cx_iface.c:get_src_border_in_pixels:
 3290|  18.4k|static inline int get_src_border_in_pixels(AV1_COMP *cpi, BLOCK_SIZE sb_size) {
 3291|  18.4k|  if (cpi->oxcf.mode != REALTIME || av1_is_resize_needed(&cpi->oxcf))
  ------------------
  |  Branch (3291:7): [True: 12.3k, False: 6.10k]
  |  Branch (3291:37): [True: 0, False: 6.10k]
  ------------------
 3292|  12.3k|    return cpi->oxcf.border_in_pixels;
 3293|       |
 3294|  6.10k|  const int sb_size_in_pixels_log2 = mi_size_wide_log2[sb_size] + MI_SIZE_LOG2;
  ------------------
  |  |   39|  6.10k|#define MI_SIZE_LOG2 2
  ------------------
 3295|  6.10k|  const int sb_aligned_width =
 3296|  6.10k|      ALIGN_POWER_OF_TWO(cpi->oxcf.frm_dim_cfg.width, sb_size_in_pixels_log2);
  ------------------
  |  |   69|  6.10k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3297|  6.10k|  const int sb_aligned_height =
 3298|  6.10k|      ALIGN_POWER_OF_TWO(cpi->oxcf.frm_dim_cfg.height, sb_size_in_pixels_log2);
  ------------------
  |  |   69|  6.10k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3299|       |  // Align the border pixels to a multiple of 32.
 3300|  6.10k|  const int border_pixels_width =
 3301|  6.10k|      ALIGN_POWER_OF_TWO(sb_aligned_width - cpi->oxcf.frm_dim_cfg.width, 5);
  ------------------
  |  |   69|  6.10k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3302|  6.10k|  const int border_pixels_height =
 3303|  6.10k|      ALIGN_POWER_OF_TWO(sb_aligned_height - cpi->oxcf.frm_dim_cfg.height, 5);
  ------------------
  |  |   69|  6.10k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3304|  6.10k|  const int border_in_pixels =
 3305|  6.10k|      AOMMAX(AOMMAX(border_pixels_width, border_pixels_height), 32);
  ------------------
  |  |   35|  12.2k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 5.69k, False: 401]
  |  |  |  Branch (35:25): [True: 879, False: 5.22k]
  |  |  |  Branch (35:38): [True: 828, False: 4.87k]
  |  |  ------------------
  ------------------
 3306|  6.10k|  return border_in_pixels;
 3307|  18.4k|}
av1_cx_iface.c:get_frame_pkt_flags:
 3278|  73.6k|                                                   unsigned int lib_flags) {
 3279|  73.6k|  aom_codec_frame_flags_t flags = lib_flags << 16;
 3280|  73.6k|  if (lib_flags & FRAMEFLAGS_KEY) flags |= AOM_FRAME_IS_KEY;
  ------------------
  |  |  288|  18.4k|#define AOM_FRAME_IS_KEY 0x1u /**< frame is the start of a GOP */
  ------------------
  |  Branch (3280:7): [True: 18.4k, False: 55.2k]
  ------------------
 3281|  73.6k|  if (lib_flags & FRAMEFLAGS_INTRAONLY) flags |= AOM_FRAME_IS_INTRAONLY;
  ------------------
  |  |  293|  18.4k|#define AOM_FRAME_IS_INTRAONLY 0x10u
  ------------------
  |  Branch (3281:7): [True: 18.4k, False: 55.2k]
  ------------------
 3282|  73.6k|  if (lib_flags & FRAMEFLAGS_SWITCH) flags |= AOM_FRAME_IS_SWITCH;
  ------------------
  |  |  295|      0|#define AOM_FRAME_IS_SWITCH 0x20u
  ------------------
  |  Branch (3282:7): [True: 0, False: 73.6k]
  ------------------
 3283|  73.6k|  if (lib_flags & FRAMEFLAGS_ERROR_RESILIENT)
  ------------------
  |  Branch (3283:7): [True: 0, False: 73.6k]
  ------------------
 3284|      0|    flags |= AOM_FRAME_IS_ERROR_RESILIENT;
  ------------------
  |  |  297|      0|#define AOM_FRAME_IS_ERROR_RESILIENT 0x40u
  ------------------
 3285|  73.6k|  if (cpi->droppable) flags |= AOM_FRAME_IS_DROPPABLE;
  ------------------
  |  |  291|      0|#define AOM_FRAME_IS_DROPPABLE 0x2u
  ------------------
  |  Branch (3285:7): [True: 0, False: 73.6k]
  ------------------
 3286|       |
 3287|  73.6k|  return flags;
 3288|  73.6k|}
av1_cx_iface.c:encoder_get_cxdata:
 3899|   165k|                                                    aom_codec_iter_t *iter) {
 3900|   165k|  return aom_codec_pkt_list_get(&ctx->pkt_list.head, iter);
 3901|   165k|}

aom_codec_av1_dx:
 1813|  17.6k|aom_codec_iface_t *aom_codec_av1_dx(void) { return &aom_codec_av1_dx_algo; }
av1_dx_iface.c:decoder_init:
   87|  7.01k|static aom_codec_err_t decoder_init(aom_codec_ctx_t *ctx) {
   88|       |  // This function only allocates space for the aom_codec_alg_priv_t
   89|       |  // structure. More memory may be required at the time the stream
   90|       |  // information becomes known.
   91|  7.01k|  if (!ctx->priv) {
  ------------------
  |  Branch (91:7): [True: 7.01k, False: 0]
  ------------------
   92|  7.01k|    aom_codec_alg_priv_t *const priv =
   93|  7.01k|        (aom_codec_alg_priv_t *)aom_calloc(1, sizeof(*priv));
   94|  7.01k|    if (priv == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (94:9): [True: 0, False: 7.01k]
  ------------------
   95|       |
   96|  7.01k|    ctx->priv = (aom_codec_priv_t *)priv;
   97|  7.01k|    ctx->priv->init_flags = ctx->init_flags;
   98|  7.01k|    priv->flushed = 0;
   99|       |
  100|       |    // TODO(tdaede): this should not be exposed to the API
  101|  7.01k|    priv->cfg.allow_lowbitdepth = !FORCE_HIGHBITDEPTH_DECODING;
  ------------------
  |  |   78|  7.01k|#define FORCE_HIGHBITDEPTH_DECODING 0
  ------------------
  102|  7.01k|    if (ctx->config.dec) {
  ------------------
  |  Branch (102:9): [True: 7.01k, False: 0]
  ------------------
  103|  7.01k|      priv->cfg = *ctx->config.dec;
  104|  7.01k|      ctx->config.dec = &priv->cfg;
  105|  7.01k|    }
  106|  7.01k|    priv->num_grain_image_frame_buffers = 0;
  107|       |    // Turn row_mt on by default.
  108|  7.01k|    priv->row_mt = 1;
  109|       |
  110|       |    // Turn on normal tile coding mode by default.
  111|       |    // 0 is for normal tile coding mode, and 1 is for large scale tile coding
  112|       |    // mode(refer to lightfield example).
  113|  7.01k|    priv->tile_mode = 0;
  114|  7.01k|    priv->decode_tile_row = -1;
  115|  7.01k|    priv->decode_tile_col = -1;
  116|       |
  117|  7.01k|    priv->frame_size_limit = 0;
  118|  7.01k|  }
  119|       |
  120|  7.01k|  return AOM_CODEC_OK;
  121|  7.01k|}
av1_dx_iface.c:decoder_destroy:
  123|  7.01k|static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) {
  124|  7.01k|  if (ctx->frame_worker != NULL) {
  ------------------
  |  Branch (124:7): [True: 7.01k, False: 0]
  ------------------
  125|  7.01k|    AVxWorker *const worker = ctx->frame_worker;
  126|  7.01k|    aom_get_worker_interface()->end(worker);
  127|  7.01k|    FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
  128|  7.01k|    if (frame_worker_data != NULL && frame_worker_data->pbi != NULL) {
  ------------------
  |  Branch (128:9): [True: 7.01k, False: 0]
  |  Branch (128:38): [True: 7.01k, False: 0]
  ------------------
  129|  7.01k|      AV1Decoder *const pbi = frame_worker_data->pbi;
  130|  7.01k|      aom_free(pbi->common.tpl_mvs);
  131|  7.01k|      pbi->common.tpl_mvs = NULL;
  132|  7.01k|      av1_remove_common(&pbi->common);
  133|  7.01k|      av1_free_cdef_buffers(&pbi->common, &pbi->cdef_worker, &pbi->cdef_sync);
  134|  7.01k|      av1_free_cdef_sync(&pbi->cdef_sync);
  135|  7.01k|      av1_free_restoration_buffers(&pbi->common);
  136|  7.01k|      av1_decoder_remove(pbi);
  137|  7.01k|    }
  138|  7.01k|    aom_free(frame_worker_data);
  139|  7.01k|  }
  140|       |
  141|  7.01k|  if (ctx->buffer_pool) {
  ------------------
  |  Branch (141:7): [True: 7.01k, False: 0]
  ------------------
  142|  7.01k|    for (size_t i = 0; i < ctx->num_grain_image_frame_buffers; i++) {
  ------------------
  |  Branch (142:24): [True: 0, False: 7.01k]
  ------------------
  143|      0|      ctx->buffer_pool->release_fb_cb(ctx->buffer_pool->cb_priv,
  144|      0|                                      &ctx->grain_image_frame_buffers[i]);
  145|      0|    }
  146|  7.01k|    av1_free_ref_frame_buffers(ctx->buffer_pool);
  147|  7.01k|    av1_free_internal_frame_buffers(&ctx->buffer_pool->int_frame_buffers);
  148|  7.01k|#if CONFIG_MULTITHREAD
  149|  7.01k|    pthread_mutex_destroy(&ctx->buffer_pool->pool_mutex);
  150|  7.01k|#endif
  151|  7.01k|  }
  152|       |
  153|  7.01k|  aom_free(ctx->frame_worker);
  154|  7.01k|  aom_free(ctx->buffer_pool);
  155|       |  assert(!ctx->img.self_allocd);
  156|  7.01k|  aom_img_free(&ctx->img);
  157|  7.01k|  aom_free(ctx);
  158|  7.01k|  return AOM_CODEC_OK;
  159|  7.01k|}
av1_dx_iface.c:ctrl_set_operating_point:
 1658|  7.01k|                                                va_list args) {
 1659|       |  ctx->operating_point = va_arg(args, int);
 1660|  7.01k|  return AOM_CODEC_OK;
 1661|  7.01k|}
av1_dx_iface.c:ctrl_set_output_all_layers:
 1664|  7.01k|                                                  va_list args) {
 1665|       |  ctx->output_all_layers = va_arg(args, int);
 1666|  7.01k|  return AOM_CODEC_OK;
 1667|  7.01k|}
av1_dx_iface.c:ctrl_set_frame_size_limit:
 1602|  7.01k|                                                 va_list args) {
 1603|       |  ctx->frame_size_limit = va_arg(args, unsigned int);
 1604|  7.01k|  return AOM_CODEC_OK;
 1605|  7.01k|}
av1_dx_iface.c:decoder_peek_si_internal:
  261|  7.01k|                                                int *is_intra_only) {
  262|  7.01k|  int intra_only_flag = 0;
  263|  7.01k|  int got_sequence_header = 0;
  264|  7.01k|  int found_keyframe = 0;
  265|       |
  266|  7.01k|  if (data + data_sz <= data || data_sz < 1) return AOM_CODEC_INVALID_PARAM;
  ------------------
  |  Branch (266:7): [True: 0, False: 7.01k]
  |  Branch (266:33): [True: 0, False: 7.01k]
  ------------------
  267|       |
  268|  7.01k|  si->w = 0;
  269|  7.01k|  si->h = 0;
  270|  7.01k|  si->is_kf = 0;  // is_kf indicates whether the current packet contains a RAP
  271|       |
  272|  7.01k|  ObuHeader obu_header;
  273|  7.01k|  memset(&obu_header, 0, sizeof(obu_header));
  274|  7.01k|  size_t payload_size = 0;
  275|  7.01k|  size_t bytes_read = 0;
  276|  7.01k|  uint8_t reduced_still_picture_hdr = 0;
  277|  7.01k|  aom_codec_err_t status = aom_read_obu_header_and_size(
  278|  7.01k|      data, data_sz, si->is_annexb, &obu_header, &payload_size, &bytes_read);
  279|  7.01k|  if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (279:7): [True: 0, False: 7.01k]
  ------------------
  280|       |
  281|       |  // If the first OBU is a temporal delimiter, skip over it and look at the next
  282|       |  // OBU in the bitstream
  283|  7.01k|  if (obu_header.type == OBU_TEMPORAL_DELIMITER) {
  ------------------
  |  Branch (283:7): [True: 7.01k, False: 0]
  ------------------
  284|       |    // Skip any associated payload (there shouldn't be one, but just in case)
  285|  7.01k|    if (data_sz < bytes_read + payload_size) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (285:9): [True: 0, False: 7.01k]
  ------------------
  286|  7.01k|    data += bytes_read + payload_size;
  287|  7.01k|    data_sz -= bytes_read + payload_size;
  288|       |
  289|  7.01k|    status = aom_read_obu_header_and_size(
  290|  7.01k|        data, data_sz, si->is_annexb, &obu_header, &payload_size, &bytes_read);
  291|  7.01k|    if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (291:9): [True: 0, False: 7.01k]
  ------------------
  292|  7.01k|  }
  293|  14.0k|  while (1) {
  ------------------
  |  Branch (293:10): [True: 14.0k, Folded]
  ------------------
  294|  14.0k|    data += bytes_read;
  295|  14.0k|    data_sz -= bytes_read;
  296|  14.0k|    if (data_sz < payload_size) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (296:9): [True: 0, False: 14.0k]
  ------------------
  297|       |    // Check that the selected OBU is a sequence header
  298|  14.0k|    if (obu_header.type == OBU_SEQUENCE_HEADER) {
  ------------------
  |  Branch (298:9): [True: 7.01k, False: 7.01k]
  ------------------
  299|       |      // Sanity check on sequence header size
  300|  7.01k|      if (data_sz < 2) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (300:11): [True: 0, False: 7.01k]
  ------------------
  301|       |      // Read a few values from the sequence header payload
  302|  7.01k|      struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
  303|       |
  304|  7.01k|      av1_read_profile(&rb);  // profile
  305|  7.01k|      const uint8_t still_picture = aom_rb_read_bit(&rb);
  306|  7.01k|      reduced_still_picture_hdr = aom_rb_read_bit(&rb);
  307|       |
  308|  7.01k|      if (!still_picture && reduced_still_picture_hdr) {
  ------------------
  |  Branch (308:11): [True: 7.01k, False: 0]
  |  Branch (308:29): [True: 0, False: 7.01k]
  ------------------
  309|      0|        return AOM_CODEC_UNSUP_BITSTREAM;
  310|      0|      }
  311|       |
  312|  7.01k|      status = parse_operating_points(&rb, reduced_still_picture_hdr, si);
  313|  7.01k|      if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (313:11): [True: 0, False: 7.01k]
  ------------------
  314|       |
  315|  7.01k|      int num_bits_width = aom_rb_read_literal(&rb, 4) + 1;
  316|  7.01k|      int num_bits_height = aom_rb_read_literal(&rb, 4) + 1;
  317|  7.01k|      int max_frame_width = aom_rb_read_literal(&rb, num_bits_width) + 1;
  318|  7.01k|      int max_frame_height = aom_rb_read_literal(&rb, num_bits_height) + 1;
  319|  7.01k|      si->w = max_frame_width;
  320|  7.01k|      si->h = max_frame_height;
  321|  7.01k|      got_sequence_header = 1;
  322|  7.01k|    } else if (obu_header.type == OBU_FRAME_HEADER ||
  ------------------
  |  Branch (322:16): [True: 0, False: 7.01k]
  ------------------
  323|  7.01k|               obu_header.type == OBU_FRAME) {
  ------------------
  |  Branch (323:16): [True: 7.01k, False: 0]
  ------------------
  324|  7.01k|      if (got_sequence_header && reduced_still_picture_hdr) {
  ------------------
  |  Branch (324:11): [True: 7.01k, False: 0]
  |  Branch (324:34): [True: 0, False: 7.01k]
  ------------------
  325|      0|        found_keyframe = 1;
  326|      0|        break;
  327|  7.01k|      } else {
  328|       |        // make sure we have enough bits to get the frame type out
  329|  7.01k|        if (data_sz < 1) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (329:13): [True: 0, False: 7.01k]
  ------------------
  330|  7.01k|        struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
  331|  7.01k|        const int show_existing_frame = aom_rb_read_bit(&rb);
  332|  7.01k|        if (!show_existing_frame) {
  ------------------
  |  Branch (332:13): [True: 7.01k, False: 0]
  ------------------
  333|  7.01k|          const FRAME_TYPE frame_type = (FRAME_TYPE)aom_rb_read_literal(&rb, 2);
  334|  7.01k|          if (frame_type == KEY_FRAME) {
  ------------------
  |  Branch (334:15): [True: 7.01k, False: 0]
  ------------------
  335|  7.01k|            found_keyframe = 1;
  336|  7.01k|            break;  // Stop here as no further OBUs will change the outcome.
  337|  7.01k|          } else if (frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (337:22): [True: 0, False: 0]
  ------------------
  338|      0|            intra_only_flag = 1;
  339|      0|          }
  340|  7.01k|        }
  341|  7.01k|      }
  342|  7.01k|    }
  343|       |    // skip past any unread OBU header data
  344|  7.01k|    data += payload_size;
  345|  7.01k|    data_sz -= payload_size;
  346|  7.01k|    if (data_sz == 0) break;  // exit if we're out of OBUs
  ------------------
  |  Branch (346:9): [True: 0, False: 7.01k]
  ------------------
  347|  7.01k|    status = aom_read_obu_header_and_size(
  348|  7.01k|        data, data_sz, si->is_annexb, &obu_header, &payload_size, &bytes_read);
  349|  7.01k|    if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (349:9): [True: 0, False: 7.01k]
  ------------------
  350|  7.01k|  }
  351|  7.01k|  if (got_sequence_header && found_keyframe) si->is_kf = 1;
  ------------------
  |  Branch (351:7): [True: 7.01k, False: 0]
  |  Branch (351:30): [True: 7.01k, False: 0]
  ------------------
  352|  7.01k|  if (is_intra_only != NULL) *is_intra_only = intra_only_flag;
  ------------------
  |  Branch (352:7): [True: 7.01k, False: 0]
  ------------------
  353|  7.01k|  return AOM_CODEC_OK;
  354|  7.01k|}
av1_dx_iface.c:parse_operating_points:
  209|  7.01k|                                              aom_codec_stream_info_t *si) {
  210|  7.01k|  int operating_point_idc0 = 0;
  211|  7.01k|  if (is_reduced_header) {
  ------------------
  |  Branch (211:7): [True: 0, False: 7.01k]
  ------------------
  212|      0|    aom_rb_read_literal(rb, LEVEL_BITS);  // level
  ------------------
  |  |  464|      0|#define LEVEL_BITS 5
  ------------------
  213|  7.01k|  } else {
  214|  7.01k|    uint8_t decoder_model_info_present_flag = 0;
  215|  7.01k|    int buffer_delay_length_minus_1 = 0;
  216|  7.01k|    aom_codec_err_t status;
  217|  7.01k|    const uint8_t timing_info_present_flag = aom_rb_read_bit(rb);
  218|  7.01k|    if (timing_info_present_flag) {
  ------------------
  |  Branch (218:9): [True: 0, False: 7.01k]
  ------------------
  219|      0|      if ((status = parse_timing_info(rb)) != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (219:11): [True: 0, False: 0]
  ------------------
  220|      0|      decoder_model_info_present_flag = aom_rb_read_bit(rb);
  221|      0|      if (decoder_model_info_present_flag) {
  ------------------
  |  Branch (221:11): [True: 0, False: 0]
  ------------------
  222|      0|        if ((status = parse_decoder_model_info(
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|                 rb, &buffer_delay_length_minus_1)) != AOM_CODEC_OK)
  224|      0|          return status;
  225|      0|      }
  226|      0|    }
  227|  7.01k|    const uint8_t initial_display_delay_present_flag = aom_rb_read_bit(rb);
  228|  7.01k|    const uint8_t operating_points_cnt_minus_1 =
  229|  7.01k|        aom_rb_read_literal(rb, OP_POINTS_CNT_MINUS_1_BITS);
  ------------------
  |  |   93|  7.01k|#define OP_POINTS_CNT_MINUS_1_BITS 5
  ------------------
  230|  35.0k|    for (int i = 0; i < operating_points_cnt_minus_1 + 1; i++) {
  ------------------
  |  Branch (230:21): [True: 28.0k, False: 7.01k]
  ------------------
  231|  28.0k|      int operating_point_idc;
  232|  28.0k|      operating_point_idc = aom_rb_read_literal(rb, OP_POINTS_IDC_BITS);
  ------------------
  |  |   94|  28.0k|#define OP_POINTS_IDC_BITS 12
  ------------------
  233|  28.0k|      if (i == 0) operating_point_idc0 = operating_point_idc;
  ------------------
  |  Branch (233:11): [True: 7.01k, False: 21.0k]
  ------------------
  234|  28.0k|      int seq_level_idx = aom_rb_read_literal(rb, LEVEL_BITS);  // level
  ------------------
  |  |  464|  28.0k|#define LEVEL_BITS 5
  ------------------
  235|  28.0k|      if (seq_level_idx > 7) aom_rb_read_bit(rb);               // tier
  ------------------
  |  Branch (235:11): [True: 0, False: 28.0k]
  ------------------
  236|  28.0k|      if (decoder_model_info_present_flag) {
  ------------------
  |  Branch (236:11): [True: 0, False: 28.0k]
  ------------------
  237|      0|        const uint8_t decoder_model_present_for_this_op = aom_rb_read_bit(rb);
  238|      0|        if (decoder_model_present_for_this_op) {
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|          if ((status = parse_op_parameters_info(
  ------------------
  |  Branch (239:15): [True: 0, False: 0]
  ------------------
  240|      0|                   rb, buffer_delay_length_minus_1)) != AOM_CODEC_OK)
  241|      0|            return status;
  242|      0|        }
  243|      0|      }
  244|  28.0k|      if (initial_display_delay_present_flag) {
  ------------------
  |  Branch (244:11): [True: 0, False: 28.0k]
  ------------------
  245|      0|        const uint8_t initial_display_delay_present_for_this_op =
  246|      0|            aom_rb_read_bit(rb);
  247|      0|        if (initial_display_delay_present_for_this_op)
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  ------------------
  248|      0|          aom_rb_read_literal(rb, 4);  // initial_display_delay_minus_1
  249|      0|      }
  250|  28.0k|    }
  251|  7.01k|  }
  252|       |
  253|  7.01k|  return aom_get_num_layers_from_operating_point_idc(
  254|  7.01k|      operating_point_idc0, &si->number_spatial_layers,
  255|  7.01k|      &si->number_temporal_layers);
  256|  7.01k|}
av1_dx_iface.c:decoder_decode:
  677|  17.6k|                                      void *user_priv) {
  678|  17.6k|  aom_codec_err_t res = AOM_CODEC_OK;
  679|       |
  680|       |#if CONFIG_INSPECTION
  681|       |  if (user_priv != 0) {
  682|       |    return decoder_inspect(ctx, data, data_sz, user_priv);
  683|       |  }
  684|       |#endif
  685|       |
  686|  17.6k|  release_pending_output_frames(ctx);
  687|       |
  688|       |  /* Sanity checks */
  689|       |  /* NULL data ptr allowed if data_sz is 0 too */
  690|  17.6k|  if (data == NULL && data_sz == 0) {
  ------------------
  |  Branch (690:7): [True: 0, False: 17.6k]
  |  Branch (690:23): [True: 0, False: 0]
  ------------------
  691|      0|    ctx->flushed = 1;
  692|      0|    return AOM_CODEC_OK;
  693|      0|  }
  694|  17.6k|  if (data == NULL || data_sz == 0) return AOM_CODEC_INVALID_PARAM;
  ------------------
  |  Branch (694:7): [True: 0, False: 17.6k]
  |  Branch (694:23): [True: 0, False: 17.6k]
  ------------------
  695|       |
  696|       |  // Reset flushed when receiving a valid frame.
  697|  17.6k|  ctx->flushed = 0;
  698|       |
  699|       |  // Initialize the decoder worker on the first frame.
  700|  17.6k|  if (ctx->frame_worker == NULL) {
  ------------------
  |  Branch (700:7): [True: 7.01k, False: 10.6k]
  ------------------
  701|  7.01k|    res = init_decoder(ctx);
  702|  7.01k|    if (res != AOM_CODEC_OK) return res;
  ------------------
  |  Branch (702:9): [True: 0, False: 7.01k]
  ------------------
  703|  7.01k|  }
  704|       |
  705|  17.6k|  const uint8_t *data_start = data;
  706|  17.6k|  const uint8_t *data_end = data + data_sz;
  707|       |
  708|  17.6k|  if (ctx->is_annexb) {
  ------------------
  |  Branch (708:7): [True: 0, False: 17.6k]
  ------------------
  709|       |    // read the size of this temporal unit
  710|      0|    size_t length_of_size;
  711|      0|    uint64_t temporal_unit_size;
  712|      0|    if (aom_uleb_decode(data_start, data_sz, &temporal_unit_size,
  ------------------
  |  Branch (712:9): [True: 0, False: 0]
  ------------------
  713|      0|                        &length_of_size) != 0) {
  714|      0|      return AOM_CODEC_CORRUPT_FRAME;
  715|      0|    }
  716|      0|    data_start += length_of_size;
  717|      0|    if (temporal_unit_size > (size_t)(data_end - data_start))
  ------------------
  |  Branch (717:9): [True: 0, False: 0]
  ------------------
  718|      0|      return AOM_CODEC_CORRUPT_FRAME;
  719|      0|    data_end = data_start + temporal_unit_size;
  720|      0|  }
  721|       |
  722|       |  // Decode in serial mode.
  723|  45.7k|  while (data_start < data_end) {
  ------------------
  |  Branch (723:10): [True: 28.0k, False: 17.6k]
  ------------------
  724|  28.0k|    uint64_t frame_size;
  725|  28.0k|    if (ctx->is_annexb) {
  ------------------
  |  Branch (725:9): [True: 0, False: 28.0k]
  ------------------
  726|       |      // read the size of this frame unit
  727|      0|      size_t length_of_size;
  728|      0|      if (aom_uleb_decode(data_start, (size_t)(data_end - data_start),
  ------------------
  |  Branch (728:11): [True: 0, False: 0]
  ------------------
  729|      0|                          &frame_size, &length_of_size) != 0) {
  730|      0|        return AOM_CODEC_CORRUPT_FRAME;
  731|      0|      }
  732|      0|      data_start += length_of_size;
  733|      0|      if (frame_size > (size_t)(data_end - data_start))
  ------------------
  |  Branch (733:11): [True: 0, False: 0]
  ------------------
  734|      0|        return AOM_CODEC_CORRUPT_FRAME;
  735|  28.0k|    } else {
  736|  28.0k|      frame_size = (uint64_t)(data_end - data_start);
  737|  28.0k|    }
  738|       |
  739|  28.0k|    res = decode_one(ctx, &data_start, (size_t)frame_size, user_priv);
  740|  28.0k|    if (res != AOM_CODEC_OK) return res;
  ------------------
  |  Branch (740:9): [True: 0, False: 28.0k]
  ------------------
  741|       |
  742|       |    // Allow extra zero bytes after the frame end
  743|  28.0k|    while (data_start < data_end) {
  ------------------
  |  Branch (743:12): [True: 10.3k, False: 17.6k]
  ------------------
  744|  10.3k|      const uint8_t marker = data_start[0];
  745|  10.3k|      if (marker) break;
  ------------------
  |  Branch (745:11): [True: 10.3k, False: 0]
  ------------------
  746|      0|      ++data_start;
  747|      0|    }
  748|  28.0k|  }
  749|       |
  750|  17.6k|  return res;
  751|  17.6k|}
av1_dx_iface.c:release_pending_output_frames:
  565|  17.6k|static void release_pending_output_frames(aom_codec_alg_priv_t *ctx) {
  566|       |  // Release any pending output frames from the previous decoder_decode or
  567|       |  // decoder_inspect call. We need to do this even if the decoder is being
  568|       |  // flushed or the input arguments are invalid.
  569|  17.6k|  if (ctx->frame_worker) {
  ------------------
  |  Branch (569:7): [True: 10.6k, False: 7.01k]
  ------------------
  570|  10.6k|    BufferPool *const pool = ctx->buffer_pool;
  571|  10.6k|    lock_buffer_pool(pool);
  572|  10.6k|    AVxWorker *const worker = ctx->frame_worker;
  573|  10.6k|    FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
  574|  10.6k|    struct AV1Decoder *pbi = frame_worker_data->pbi;
  575|  21.3k|    for (size_t j = 0; j < pbi->num_output_frames; j++) {
  ------------------
  |  Branch (575:24): [True: 10.6k, False: 10.6k]
  ------------------
  576|  10.6k|      decrease_ref_count(pbi->output_frames[j], pool);
  577|  10.6k|    }
  578|  10.6k|    pbi->num_output_frames = 0;
  579|  10.6k|    unlock_buffer_pool(pool);
  580|  10.6k|    for (size_t j = 0; j < ctx->num_grain_image_frame_buffers; j++) {
  ------------------
  |  Branch (580:24): [True: 0, False: 10.6k]
  ------------------
  581|      0|      pool->release_fb_cb(pool->cb_priv, &ctx->grain_image_frame_buffers[j]);
  582|      0|      ctx->grain_image_frame_buffers[j].data = NULL;
  583|      0|      ctx->grain_image_frame_buffers[j].size = 0;
  584|       |      ctx->grain_image_frame_buffers[j].priv = NULL;
  585|      0|    }
  586|  10.6k|    ctx->num_grain_image_frame_buffers = 0;
  587|  10.6k|  }
  588|  17.6k|}
av1_dx_iface.c:init_decoder:
  425|  7.01k|static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) {
  426|  7.01k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  427|       |
  428|  7.01k|  ctx->last_show_frame = NULL;
  429|  7.01k|  ctx->need_resync = 1;
  430|  7.01k|  ctx->flushed = 0;
  431|       |
  432|  7.01k|  ctx->buffer_pool = (BufferPool *)aom_calloc(1, sizeof(BufferPool));
  433|  7.01k|  if (ctx->buffer_pool == NULL) return AOM_CODEC_MEM_ERROR;
  ------------------
  |  Branch (433:7): [True: 0, False: 7.01k]
  ------------------
  434|  7.01k|  ctx->buffer_pool->num_frame_bufs = FRAME_BUFFERS;
  ------------------
  |  |  561|  7.01k|#define FRAME_BUFFERS (REF_FRAMES + 1 + INTER_REFS_PER_FRAME)
  ------------------
  435|  7.01k|  ctx->buffer_pool->frame_bufs = (RefCntBuffer *)aom_calloc(
  436|  7.01k|      ctx->buffer_pool->num_frame_bufs, sizeof(*ctx->buffer_pool->frame_bufs));
  437|  7.01k|  if (ctx->buffer_pool->frame_bufs == NULL) {
  ------------------
  |  Branch (437:7): [True: 0, False: 7.01k]
  ------------------
  438|      0|    ctx->buffer_pool->num_frame_bufs = 0;
  439|      0|    aom_free(ctx->buffer_pool);
  440|      0|    ctx->buffer_pool = NULL;
  441|      0|    return AOM_CODEC_MEM_ERROR;
  442|      0|  }
  443|       |
  444|  7.01k|#if CONFIG_MULTITHREAD
  445|  7.01k|  if (pthread_mutex_init(&ctx->buffer_pool->pool_mutex, NULL)) {
  ------------------
  |  Branch (445:7): [True: 0, False: 7.01k]
  ------------------
  446|      0|    aom_free(ctx->buffer_pool->frame_bufs);
  447|      0|    ctx->buffer_pool->frame_bufs = NULL;
  448|      0|    ctx->buffer_pool->num_frame_bufs = 0;
  449|      0|    aom_free(ctx->buffer_pool);
  450|      0|    ctx->buffer_pool = NULL;
  451|      0|    set_error_detail(ctx, "Failed to allocate buffer pool mutex");
  452|      0|    return AOM_CODEC_MEM_ERROR;
  453|      0|  }
  454|  7.01k|#endif
  455|       |
  456|  7.01k|  ctx->frame_worker = (AVxWorker *)aom_malloc(sizeof(*ctx->frame_worker));
  457|  7.01k|  if (ctx->frame_worker == NULL) {
  ------------------
  |  Branch (457:7): [True: 0, False: 7.01k]
  ------------------
  458|      0|    set_error_detail(ctx, "Failed to allocate frame_worker");
  459|      0|    return AOM_CODEC_MEM_ERROR;
  460|      0|  }
  461|       |
  462|  7.01k|  AVxWorker *const worker = ctx->frame_worker;
  463|  7.01k|  winterface->init(worker);
  464|  7.01k|  worker->thread_name = "aom frameworker";
  465|  7.01k|  worker->data1 = aom_memalign(32, sizeof(FrameWorkerData));
  466|  7.01k|  if (worker->data1 == NULL) {
  ------------------
  |  Branch (466:7): [True: 0, False: 7.01k]
  ------------------
  467|      0|    winterface->end(worker);
  468|      0|    aom_free(worker);
  469|      0|    ctx->frame_worker = NULL;
  470|      0|    set_error_detail(ctx, "Failed to allocate frame_worker_data");
  471|      0|    return AOM_CODEC_MEM_ERROR;
  472|      0|  }
  473|  7.01k|  FrameWorkerData *frame_worker_data = (FrameWorkerData *)worker->data1;
  474|  7.01k|  frame_worker_data->pbi = av1_decoder_create(ctx->buffer_pool);
  475|  7.01k|  if (frame_worker_data->pbi == NULL) {
  ------------------
  |  Branch (475:7): [True: 0, False: 7.01k]
  ------------------
  476|      0|    winterface->end(worker);
  477|      0|    aom_free(frame_worker_data);
  478|      0|    aom_free(worker);
  479|      0|    ctx->frame_worker = NULL;
  480|      0|    set_error_detail(ctx, "Failed to allocate frame_worker_data->pbi");
  481|      0|    return AOM_CODEC_MEM_ERROR;
  482|      0|  }
  483|  7.01k|  frame_worker_data->frame_context_ready = 0;
  484|  7.01k|  frame_worker_data->received_frame = 0;
  485|  7.01k|  frame_worker_data->pbi->allow_lowbitdepth = ctx->cfg.allow_lowbitdepth;
  486|       |
  487|       |  // If decoding in serial mode, FrameWorker thread could create tile worker
  488|       |  // thread or loopfilter thread.
  489|  7.01k|  frame_worker_data->pbi->max_threads = ctx->cfg.threads;
  490|  7.01k|  frame_worker_data->pbi->inv_tile_order = ctx->invert_tile_order;
  491|  7.01k|  frame_worker_data->pbi->common.tiles.large_scale = ctx->tile_mode;
  492|  7.01k|  frame_worker_data->pbi->is_annexb = ctx->is_annexb;
  493|  7.01k|  frame_worker_data->pbi->dec_tile_row = ctx->decode_tile_row;
  494|  7.01k|  frame_worker_data->pbi->dec_tile_col = ctx->decode_tile_col;
  495|  7.01k|  frame_worker_data->pbi->operating_point = ctx->operating_point;
  496|  7.01k|  frame_worker_data->pbi->output_all_layers = ctx->output_all_layers;
  497|  7.01k|  frame_worker_data->pbi->frame_size_limit = ctx->frame_size_limit;
  498|  7.01k|  frame_worker_data->pbi->ext_tile_debug = ctx->ext_tile_debug;
  499|  7.01k|  frame_worker_data->pbi->row_mt = ctx->row_mt;
  500|  7.01k|  frame_worker_data->pbi->is_fwd_kf_present = 0;
  501|  7.01k|  frame_worker_data->pbi->is_arf_frame_present = 0;
  502|  7.01k|  worker->hook = frame_worker_hook;
  503|       |
  504|  7.01k|  init_buffer_callbacks(ctx);
  505|       |
  506|  7.01k|  return AOM_CODEC_OK;
  507|  7.01k|}
av1_dx_iface.c:frame_worker_hook:
  409|  28.0k|static int frame_worker_hook(void *arg1, void *arg2) {
  410|  28.0k|  FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1;
  411|  28.0k|  const uint8_t *data = frame_worker_data->data;
  412|  28.0k|  (void)arg2;
  413|       |
  414|  28.0k|  int result = av1_receive_compressed_data(frame_worker_data->pbi,
  415|  28.0k|                                           frame_worker_data->data_size, &data);
  416|  28.0k|  frame_worker_data->data_end = data;
  417|       |
  418|  28.0k|  if (result != 0) {
  ------------------
  |  Branch (418:7): [True: 0, False: 28.0k]
  ------------------
  419|       |    // Check decode result in serial decode.
  420|      0|    frame_worker_data->pbi->need_resync = 1;
  421|      0|  }
  422|  28.0k|  return !result;
  423|  28.0k|}
av1_dx_iface.c:init_buffer_callbacks:
  381|  7.01k|static void init_buffer_callbacks(aom_codec_alg_priv_t *ctx) {
  382|  7.01k|  AVxWorker *const worker = ctx->frame_worker;
  383|  7.01k|  FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
  384|  7.01k|  AV1Decoder *const pbi = frame_worker_data->pbi;
  385|  7.01k|  AV1_COMMON *const cm = &pbi->common;
  386|  7.01k|  BufferPool *const pool = cm->buffer_pool;
  387|       |
  388|  7.01k|  cm->cur_frame = NULL;
  389|  7.01k|  cm->features.byte_alignment = ctx->byte_alignment;
  390|  7.01k|  pbi->skip_loop_filter = ctx->skip_loop_filter;
  391|  7.01k|  pbi->skip_film_grain = ctx->skip_film_grain;
  392|       |
  393|  7.01k|  if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) {
  ------------------
  |  Branch (393:7): [True: 0, False: 7.01k]
  |  Branch (393:37): [True: 0, False: 0]
  ------------------
  394|      0|    pool->get_fb_cb = ctx->get_ext_fb_cb;
  395|      0|    pool->release_fb_cb = ctx->release_ext_fb_cb;
  396|      0|    pool->cb_priv = ctx->ext_priv;
  397|  7.01k|  } else {
  398|  7.01k|    pool->get_fb_cb = av1_get_frame_buffer;
  399|  7.01k|    pool->release_fb_cb = av1_release_frame_buffer;
  400|       |
  401|  7.01k|    if (av1_alloc_internal_frame_buffers(&pool->int_frame_buffers))
  ------------------
  |  Branch (401:9): [True: 0, False: 7.01k]
  ------------------
  402|      0|      aom_internal_error(&pbi->error, AOM_CODEC_MEM_ERROR,
  403|      0|                         "Failed to initialize internal frame buffers");
  404|       |
  405|  7.01k|    pool->cb_priv = &pool->int_frame_buffers;
  406|  7.01k|  }
  407|  7.01k|}
av1_dx_iface.c:decode_one:
  519|  28.0k|                                  void *user_priv) {
  520|  28.0k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  521|       |
  522|       |  // Determine the stream parameters. Note that we rely on peek_si to
  523|       |  // validate that we have a buffer that does not wrap around the top
  524|       |  // of the heap.
  525|  28.0k|  if (!ctx->si.h) {
  ------------------
  |  Branch (525:7): [True: 7.01k, False: 21.0k]
  ------------------
  526|  7.01k|    int is_intra_only = 0;
  527|  7.01k|    ctx->si.is_annexb = ctx->is_annexb;
  528|  7.01k|    const aom_codec_err_t res =
  529|  7.01k|        decoder_peek_si_internal(*data, data_sz, &ctx->si, &is_intra_only);
  530|  7.01k|    if (res != AOM_CODEC_OK) return res;
  ------------------
  |  Branch (530:9): [True: 0, False: 7.01k]
  ------------------
  531|       |
  532|  7.01k|    if (!ctx->si.is_kf && !is_intra_only) return AOM_CODEC_ERROR;
  ------------------
  |  Branch (532:9): [True: 0, False: 7.01k]
  |  Branch (532:27): [True: 0, False: 0]
  ------------------
  533|  7.01k|  }
  534|       |
  535|  28.0k|  AVxWorker *const worker = ctx->frame_worker;
  536|  28.0k|  FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
  537|  28.0k|  frame_worker_data->data = *data;
  538|  28.0k|  frame_worker_data->data_size = data_sz;
  539|  28.0k|  frame_worker_data->user_priv = user_priv;
  540|  28.0k|  frame_worker_data->received_frame = 1;
  541|       |
  542|  28.0k|  frame_worker_data->pbi->common.tiles.large_scale = ctx->tile_mode;
  543|  28.0k|  frame_worker_data->pbi->dec_tile_row = ctx->decode_tile_row;
  544|  28.0k|  frame_worker_data->pbi->dec_tile_col = ctx->decode_tile_col;
  545|  28.0k|  frame_worker_data->pbi->ext_tile_debug = ctx->ext_tile_debug;
  546|  28.0k|  frame_worker_data->pbi->row_mt = ctx->row_mt;
  547|  28.0k|  frame_worker_data->pbi->ext_refs = ctx->ext_refs;
  548|       |
  549|  28.0k|  frame_worker_data->pbi->is_annexb = ctx->is_annexb;
  550|       |
  551|  28.0k|  worker->had_error = 0;
  552|  28.0k|  winterface->execute(worker);
  553|       |
  554|       |  // Update data pointer after decode.
  555|  28.0k|  *data = frame_worker_data->data_end;
  556|       |
  557|  28.0k|  if (worker->had_error)
  ------------------
  |  Branch (557:7): [True: 0, False: 28.0k]
  ------------------
  558|      0|    return update_error_state(ctx, &frame_worker_data->pbi->error);
  559|       |
  560|  28.0k|  check_resync(ctx, frame_worker_data->pbi);
  561|       |
  562|  28.0k|  return AOM_CODEC_OK;
  563|  28.0k|}
av1_dx_iface.c:check_resync:
  510|  45.7k|                                const AV1Decoder *const pbi) {
  511|       |  // Clear resync flag if worker got a key frame or intra only frame.
  512|  45.7k|  if (ctx->need_resync == 1 && pbi->need_resync == 0 &&
  ------------------
  |  Branch (512:7): [True: 7.01k, False: 38.7k]
  |  Branch (512:32): [True: 7.01k, False: 0]
  ------------------
  513|  7.01k|      frame_is_intra_only(&pbi->common))
  ------------------
  |  Branch (513:7): [True: 7.01k, False: 0]
  ------------------
  514|  7.01k|    ctx->need_resync = 0;
  515|  45.7k|}
av1_dx_iface.c:decoder_get_frame:
  809|  35.3k|                                      aom_codec_iter_t *iter) {
  810|  35.3k|  aom_image_t *img = NULL;
  811|       |
  812|  35.3k|  if (!iter) {
  ------------------
  |  Branch (812:7): [True: 0, False: 35.3k]
  ------------------
  813|      0|    return NULL;
  814|      0|  }
  815|       |
  816|       |  // To avoid having to allocate any extra storage, treat 'iter' as
  817|       |  // simply a pointer to an integer index
  818|  35.3k|  uintptr_t *index = (uintptr_t *)iter;
  819|       |
  820|  35.3k|  if (ctx->frame_worker == NULL) {
  ------------------
  |  Branch (820:7): [True: 7.01k, False: 28.3k]
  ------------------
  821|  7.01k|    return NULL;
  822|  7.01k|  }
  823|  28.3k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  824|  28.3k|  AVxWorker *const worker = ctx->frame_worker;
  825|  28.3k|  FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
  826|  28.3k|  AV1Decoder *const pbi = frame_worker_data->pbi;
  827|  28.3k|  pbi->error.error_code = AOM_CODEC_OK;
  828|  28.3k|  pbi->error.has_detail = 0;
  829|  28.3k|  AV1_COMMON *const cm = &pbi->common;
  830|  28.3k|  CommonTileParams *const tiles = &cm->tiles;
  831|       |  // Wait for the frame from worker thread.
  832|  28.3k|  if (!winterface->sync(worker)) {
  ------------------
  |  Branch (832:7): [True: 0, False: 28.3k]
  ------------------
  833|       |    // Decoding failed. Release the worker thread.
  834|      0|    frame_worker_data->received_frame = 0;
  835|      0|    ctx->need_resync = 1;
  836|       |    // TODO(aomedia:3519): Set an error code. Check if a different error code
  837|       |    // should be used if ctx->flushed != 1.
  838|      0|    return NULL;
  839|      0|  }
  840|       |  // Check if worker has received any frames.
  841|  28.3k|  if (frame_worker_data->received_frame == 1) {
  ------------------
  |  Branch (841:7): [True: 17.6k, False: 10.6k]
  ------------------
  842|  17.6k|    frame_worker_data->received_frame = 0;
  843|  17.6k|    check_resync(ctx, frame_worker_data->pbi);
  844|  17.6k|  }
  845|  28.3k|  YV12_BUFFER_CONFIG *sd;
  846|  28.3k|  aom_film_grain_t *grain_params;
  847|  28.3k|  if (av1_get_raw_frame(frame_worker_data->pbi, *index, &sd, &grain_params) !=
  ------------------
  |  Branch (847:7): [True: 10.6k, False: 17.6k]
  ------------------
  848|  28.3k|      0) {
  849|  10.6k|    return NULL;
  850|  10.6k|  }
  851|  17.6k|  RefCntBuffer *const output_frame_buf = pbi->output_frames[*index];
  852|  17.6k|  ctx->last_show_frame = output_frame_buf;
  853|  17.6k|  if (ctx->need_resync) return NULL;
  ------------------
  |  Branch (853:7): [True: 0, False: 17.6k]
  ------------------
  854|  17.6k|  aom_img_remove_metadata(&ctx->img);
  855|  17.6k|  yuvconfig2image(&ctx->img, sd, frame_worker_data->user_priv);
  856|  17.6k|  move_decoder_metadata_to_img(pbi, &ctx->img);
  857|       |
  858|  17.6k|  if (!pbi->ext_tile_debug && tiles->large_scale) {
  ------------------
  |  Branch (858:7): [True: 17.6k, False: 0]
  |  Branch (858:31): [True: 0, False: 17.6k]
  ------------------
  859|      0|    *index += 1;  // Advance the iterator to point to the next image
  860|      0|    aom_img_remove_metadata(&ctx->img);
  861|      0|    yuvconfig2image(&ctx->img, &pbi->tile_list_outbuf, NULL);
  862|      0|    move_decoder_metadata_to_img(pbi, &ctx->img);
  863|      0|    img = &ctx->img;
  864|      0|    return img;
  865|      0|  }
  866|       |
  867|  17.6k|  const int num_planes = av1_num_planes(cm);
  868|  17.6k|  if (pbi->ext_tile_debug && tiles->single_tile_decoding &&
  ------------------
  |  Branch (868:7): [True: 0, False: 17.6k]
  |  Branch (868:30): [True: 0, False: 0]
  ------------------
  869|      0|      pbi->dec_tile_row >= 0) {
  ------------------
  |  Branch (869:7): [True: 0, False: 0]
  ------------------
  870|      0|    int tile_width, tile_height;
  871|      0|    if (!av1_get_uniform_tile_size(cm, &tile_width, &tile_height)) {
  ------------------
  |  Branch (871:9): [True: 0, False: 0]
  ------------------
  872|      0|      return NULL;
  873|      0|    }
  874|      0|    const int tile_row = AOMMIN(pbi->dec_tile_row, tiles->rows - 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  875|      0|    const int mi_row = tile_row * tile_height;
  876|      0|    const int ssy = ctx->img.y_chroma_shift;
  877|      0|    int plane;
  878|      0|    ctx->img.planes[0] += mi_row * MI_SIZE * ctx->img.stride[0];
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  879|      0|    if (num_planes > 1) {
  ------------------
  |  Branch (879:9): [True: 0, False: 0]
  ------------------
  880|      0|      for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|      0|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (880:23): [True: 0, False: 0]
  ------------------
  881|      0|        ctx->img.planes[plane] +=
  882|      0|            mi_row * (MI_SIZE >> ssy) * ctx->img.stride[plane];
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  883|      0|      }
  884|      0|    }
  885|      0|    ctx->img.d_h =
  886|      0|        AOMMIN(tile_height, cm->mi_params.mi_rows - mi_row) * MI_SIZE;
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      AOMMIN(tile_height, cm->mi_params.mi_rows - mi_row) * MI_SIZE;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  887|      0|  }
  888|       |
  889|  17.6k|  if (pbi->ext_tile_debug && tiles->single_tile_decoding &&
  ------------------
  |  Branch (889:7): [True: 0, False: 17.6k]
  |  Branch (889:30): [True: 0, False: 0]
  ------------------
  890|      0|      pbi->dec_tile_col >= 0) {
  ------------------
  |  Branch (890:7): [True: 0, False: 0]
  ------------------
  891|      0|    int tile_width, tile_height;
  892|      0|    if (!av1_get_uniform_tile_size(cm, &tile_width, &tile_height)) {
  ------------------
  |  Branch (892:9): [True: 0, False: 0]
  ------------------
  893|      0|      return NULL;
  894|      0|    }
  895|      0|    const int tile_col = AOMMIN(pbi->dec_tile_col, tiles->cols - 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  896|      0|    const int mi_col = tile_col * tile_width;
  897|      0|    const int ssx = ctx->img.x_chroma_shift;
  898|      0|    const int is_hbd = (ctx->img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) ? 1 : 0;
  ------------------
  |  |   38|      0|#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
  ------------------
  |  Branch (898:24): [True: 0, False: 0]
  ------------------
  899|      0|    int plane;
  900|      0|    ctx->img.planes[0] += mi_col * MI_SIZE * (1 + is_hbd);
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  901|      0|    if (num_planes > 1) {
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|      for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|      0|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (902:23): [True: 0, False: 0]
  ------------------
  903|      0|        ctx->img.planes[plane] += mi_col * (MI_SIZE >> ssx) * (1 + is_hbd);
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  904|      0|      }
  905|      0|    }
  906|      0|    ctx->img.d_w = AOMMIN(tile_width, cm->mi_params.mi_cols - mi_col) * MI_SIZE;
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  ctx->img.d_w = AOMMIN(tile_width, cm->mi_params.mi_cols - mi_col) * MI_SIZE;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  907|      0|  }
  908|       |
  909|  17.6k|  ctx->img.fb_priv = output_frame_buf->raw_frame_buffer.priv;
  910|  17.6k|  img = &ctx->img;
  911|  17.6k|  img->temporal_id = output_frame_buf->temporal_id;
  912|  17.6k|  img->spatial_id = output_frame_buf->spatial_id;
  913|  17.6k|  if (pbi->skip_film_grain) grain_params->apply_grain = 0;
  ------------------
  |  Branch (913:7): [True: 0, False: 17.6k]
  ------------------
  914|  17.6k|  aom_image_t *res =
  915|  17.6k|      add_grain_if_needed(ctx, img, &ctx->image_with_grain, grain_params);
  916|  17.6k|  if (!res) {
  ------------------
  |  Branch (916:7): [True: 0, False: 17.6k]
  ------------------
  917|      0|    pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  918|      0|    pbi->error.has_detail = 1;
  919|      0|    snprintf(pbi->error.detail, sizeof(pbi->error.detail),
  920|      0|             "Grain synthesis failed\n");
  921|      0|    return res;
  922|      0|  }
  923|  17.6k|  *index += 1;  // Advance the iterator to point to the next image
  924|  17.6k|  return res;
  925|  17.6k|}
av1_dx_iface.c:move_decoder_metadata_to_img:
  800|  17.6k|static void move_decoder_metadata_to_img(AV1Decoder *pbi, aom_image_t *img) {
  801|  17.6k|  if (pbi->metadata && img) {
  ------------------
  |  Branch (801:7): [True: 0, False: 17.6k]
  |  Branch (801:24): [True: 0, False: 0]
  ------------------
  802|      0|    assert(!img->metadata);
  803|      0|    img->metadata = pbi->metadata;
  804|       |    pbi->metadata = NULL;
  805|      0|  }
  806|  17.6k|}
av1_dx_iface.c:add_grain_if_needed:
  771|  17.6k|                                        aom_film_grain_t *grain_params) {
  772|  17.6k|  if (!grain_params->apply_grain) return img;
  ------------------
  |  Branch (772:7): [True: 17.6k, False: 0]
  ------------------
  773|       |
  774|      0|  const int w_even = ALIGN_POWER_OF_TWO_UNSIGNED(img->d_w, 1);
  ------------------
  |  |   71|      0|  (((value) + ((1u << (n)) - 1)) & ~((1u << (n)) - 1))
  ------------------
  775|      0|  const int h_even = ALIGN_POWER_OF_TWO_UNSIGNED(img->d_h, 1);
  ------------------
  |  |   71|      0|  (((value) + ((1u << (n)) - 1)) & ~((1u << (n)) - 1))
  ------------------
  776|       |
  777|      0|  BufferPool *const pool = ctx->buffer_pool;
  778|      0|  aom_codec_frame_buffer_t *fb =
  779|      0|      &ctx->grain_image_frame_buffers[ctx->num_grain_image_frame_buffers];
  780|      0|  AllocCbParam param;
  781|      0|  param.pool = pool;
  782|      0|  param.fb = fb;
  783|      0|  if (!aom_img_alloc_with_cb(grain_img, img->fmt, w_even, h_even, 16,
  ------------------
  |  Branch (783:7): [True: 0, False: 0]
  ------------------
  784|      0|                             AllocWithGetFrameBufferCb, &param)) {
  785|      0|    return NULL;
  786|      0|  }
  787|       |
  788|      0|  grain_img->user_priv = img->user_priv;
  789|      0|  grain_img->fb_priv = fb->priv;
  790|      0|  if (av1_add_film_grain(grain_params, img, grain_img)) {
  ------------------
  |  Branch (790:7): [True: 0, False: 0]
  ------------------
  791|      0|    pool->release_fb_cb(pool->cb_priv, fb);
  792|      0|    return NULL;
  793|      0|  }
  794|       |
  795|      0|  ctx->num_grain_image_frame_buffers++;
  796|      0|  return grain_img;
  797|      0|}

av1_dx_iface.c:yuvconfig2image:
   23|  17.6k|                                   void *user_priv) {
   24|       |  /* aom_img_wrap() doesn't allow specifying independent strides for
   25|       |   * the Y, U, and V planes, nor other alignment adjustments that
   26|       |   * might be representable by a YV12_BUFFER_CONFIG, so we just
   27|       |   * initialize all the fields.
   28|       |   */
   29|  17.6k|  int bps;
   30|  17.6k|  if (!yv12->subsampling_y) {
  ------------------
  |  Branch (30:7): [True: 3.32k, False: 14.3k]
  ------------------
   31|  3.32k|    if (!yv12->subsampling_x) {
  ------------------
  |  Branch (31:9): [True: 1.57k, False: 1.75k]
  ------------------
   32|  1.57k|      img->fmt = AOM_IMG_FMT_I444;
   33|  1.57k|      bps = 24;
   34|  1.75k|    } else {
   35|  1.75k|      img->fmt = AOM_IMG_FMT_I422;
   36|  1.75k|      bps = 16;
   37|  1.75k|    }
   38|  14.3k|  } else {
   39|  14.3k|    img->fmt = AOM_IMG_FMT_I420;
   40|  14.3k|    bps = 12;
   41|  14.3k|  }
   42|  17.6k|  img->cp = yv12->color_primaries;
   43|  17.6k|  img->tc = yv12->transfer_characteristics;
   44|  17.6k|  img->mc = yv12->matrix_coefficients;
   45|  17.6k|  img->monochrome = yv12->monochrome;
   46|  17.6k|  img->csp = yv12->chroma_sample_position;
   47|  17.6k|  img->range = yv12->color_range;
   48|  17.6k|  img->bit_depth = 8;
   49|  17.6k|  img->w = yv12->y_width;
   50|  17.6k|  img->h = yv12->y_height;
   51|  17.6k|  img->d_w = yv12->y_crop_width;
   52|  17.6k|  img->d_h = yv12->y_crop_height;
   53|  17.6k|  img->r_w = yv12->render_width;
   54|  17.6k|  img->r_h = yv12->render_height;
   55|  17.6k|  img->x_chroma_shift = yv12->subsampling_x;
   56|  17.6k|  img->y_chroma_shift = yv12->subsampling_y;
   57|  17.6k|  img->planes[AOM_PLANE_Y] = yv12->y_buffer;
  ------------------
  |  |  281|  17.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   58|  17.6k|  img->planes[AOM_PLANE_U] = yv12->u_buffer;
  ------------------
  |  |  282|  17.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   59|  17.6k|  img->planes[AOM_PLANE_V] = yv12->v_buffer;
  ------------------
  |  |  283|  17.6k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
   60|  17.6k|  img->stride[AOM_PLANE_Y] = yv12->y_stride;
  ------------------
  |  |  281|  17.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   61|  17.6k|  img->stride[AOM_PLANE_U] = yv12->uv_stride;
  ------------------
  |  |  282|  17.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   62|  17.6k|  img->stride[AOM_PLANE_V] = yv12->uv_stride;
  ------------------
  |  |  283|  17.6k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
   63|  17.6k|  if (yv12->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  17.6k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (63:7): [True: 4.30k, False: 13.3k]
  ------------------
   64|  4.30k|    bps *= 2;
   65|       |    // aom_image_t uses byte strides and a pointer to the first byte
   66|       |    // of the image.
   67|  4.30k|    img->fmt = (aom_img_fmt_t)(img->fmt | AOM_IMG_FMT_HIGHBITDEPTH);
  ------------------
  |  |   38|  4.30k|#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
  ------------------
   68|  4.30k|    img->bit_depth = yv12->bit_depth;
   69|  4.30k|    img->planes[AOM_PLANE_Y] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->y_buffer);
  ------------------
  |  |  281|  4.30k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                  img->planes[AOM_PLANE_Y] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->y_buffer);
  ------------------
  |  |   79|  4.30k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   70|  4.30k|    img->planes[AOM_PLANE_U] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->u_buffer);
  ------------------
  |  |  282|  4.30k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                  img->planes[AOM_PLANE_U] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->u_buffer);
  ------------------
  |  |   79|  4.30k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   71|  4.30k|    img->planes[AOM_PLANE_V] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->v_buffer);
  ------------------
  |  |  283|  4.30k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
                  img->planes[AOM_PLANE_V] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->v_buffer);
  ------------------
  |  |   79|  4.30k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   72|  4.30k|    img->stride[AOM_PLANE_Y] = 2 * yv12->y_stride;
  ------------------
  |  |  281|  4.30k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   73|  4.30k|    img->stride[AOM_PLANE_U] = 2 * yv12->uv_stride;
  ------------------
  |  |  282|  4.30k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   74|  4.30k|    img->stride[AOM_PLANE_V] = 2 * yv12->uv_stride;
  ------------------
  |  |  283|  4.30k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
   75|  4.30k|  }
   76|  17.6k|  img->bps = bps;
   77|  17.6k|  img->user_priv = user_priv;
   78|  17.6k|  img->img_data = yv12->buffer_alloc;
   79|  17.6k|  img->img_data_owner = 0;
   80|  17.6k|  img->self_allocd = 0;
   81|  17.6k|  img->sz = yv12->frame_size;
   82|  17.6k|  assert(!yv12->metadata);
   83|       |  img->metadata = NULL;
   84|  17.6k|}
av1_cx_iface.c:image2yuvconfig:
   87|  73.6k|                                              YV12_BUFFER_CONFIG *yv12) {
   88|  73.6k|  yv12->y_buffer = img->planes[AOM_PLANE_Y];
  ------------------
  |  |  281|  73.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   89|  73.6k|  yv12->u_buffer = img->planes[AOM_PLANE_U];
  ------------------
  |  |  282|  73.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   90|  73.6k|  yv12->v_buffer = img->planes[AOM_PLANE_V];
  ------------------
  |  |  283|  73.6k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
   91|       |
   92|  73.6k|  yv12->y_crop_width = img->d_w;
   93|  73.6k|  yv12->y_crop_height = img->d_h;
   94|  73.6k|  yv12->render_width = img->r_w;
   95|  73.6k|  yv12->render_height = img->r_h;
   96|  73.6k|  yv12->y_width = img->w;
   97|  73.6k|  yv12->y_height = img->h;
   98|       |
   99|  73.6k|  yv12->uv_width = (yv12->y_width + img->x_chroma_shift) >> img->x_chroma_shift;
  100|  73.6k|  yv12->uv_height =
  101|  73.6k|      (yv12->y_height + img->y_chroma_shift) >> img->y_chroma_shift;
  102|  73.6k|  yv12->uv_crop_width =
  103|  73.6k|      (yv12->y_crop_width + img->x_chroma_shift) >> img->x_chroma_shift;
  104|  73.6k|  yv12->uv_crop_height =
  105|  73.6k|      (yv12->y_crop_height + img->y_chroma_shift) >> img->y_chroma_shift;
  106|       |
  107|  73.6k|  yv12->y_stride = img->stride[AOM_PLANE_Y];
  ------------------
  |  |  281|  73.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  108|  73.6k|  yv12->uv_stride = img->stride[AOM_PLANE_U];
  ------------------
  |  |  282|  73.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  109|  73.6k|  yv12->color_primaries = img->cp;
  110|  73.6k|  yv12->transfer_characteristics = img->tc;
  111|  73.6k|  yv12->matrix_coefficients = img->mc;
  112|  73.6k|  yv12->monochrome = img->monochrome;
  113|  73.6k|  yv12->chroma_sample_position = img->csp;
  114|  73.6k|  yv12->color_range = img->range;
  115|       |
  116|  73.6k|  if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
  ------------------
  |  |   38|  73.6k|#define AOM_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */
  ------------------
  |  Branch (116:7): [True: 20.4k, False: 53.1k]
  ------------------
  117|       |    // In aom_image_t
  118|       |    //     planes point to uint8 address of start of data
  119|       |    //     stride counts uint8s to reach next row
  120|       |    // In YV12_BUFFER_CONFIG
  121|       |    //     y_buffer, u_buffer, v_buffer point to uint16 address of data
  122|       |    //     stride and border counts in uint16s
  123|       |    // This means that all the address calculations in the main body of code
  124|       |    // should work correctly.
  125|       |    // However, before we do any pixel operations we need to cast the address
  126|       |    // to a uint16 ponter and double its value.
  127|  20.4k|    yv12->y_buffer = CONVERT_TO_BYTEPTR(yv12->y_buffer);
  ------------------
  |  |   80|  20.4k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  128|  20.4k|    yv12->u_buffer = CONVERT_TO_BYTEPTR(yv12->u_buffer);
  ------------------
  |  |   80|  20.4k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  129|  20.4k|    yv12->v_buffer = CONVERT_TO_BYTEPTR(yv12->v_buffer);
  ------------------
  |  |   80|  20.4k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  130|  20.4k|    yv12->y_stride >>= 1;
  131|  20.4k|    yv12->uv_stride >>= 1;
  132|  20.4k|    yv12->flags = YV12_FLAG_HIGHBITDEPTH;
  ------------------
  |  |  142|  20.4k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  133|  53.1k|  } else {
  134|  53.1k|    yv12->flags = 0;
  135|  53.1k|  }
  136|       |
  137|       |  // Note(yunqing): if img is allocated the same as the frame buffer, y_stride
  138|       |  // is 32-byte aligned. Also, handle the cases while allocating img without a
  139|       |  // border or stride_align is less than 32.
  140|  73.6k|  int border = (yv12->y_stride - (int)((img->w + 31) & ~31u)) / 2;
  141|  73.6k|  yv12->border = (border < 0) ? 0 : border;
  ------------------
  |  Branch (141:18): [True: 71.4k, False: 2.14k]
  ------------------
  142|  73.6k|  yv12->subsampling_x = img->x_chroma_shift;
  143|  73.6k|  yv12->subsampling_y = img->y_chroma_shift;
  144|  73.6k|  yv12->metadata = img->metadata;
  145|  73.6k|  return AOM_CODEC_OK;
  146|  73.6k|}

av1_get_MBs:
   29|   268k|int av1_get_MBs(int width, int height) {
   30|   268k|  const int aligned_width = ALIGN_POWER_OF_TWO(width, 3);
  ------------------
  |  |   69|   268k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
   31|   268k|  const int aligned_height = ALIGN_POWER_OF_TWO(height, 3);
  ------------------
  |  |   69|   268k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
   32|   268k|  const int mi_cols = aligned_width >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   268k|#define MI_SIZE_LOG2 2
  ------------------
   33|   268k|  const int mi_rows = aligned_height >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   268k|#define MI_SIZE_LOG2 2
  ------------------
   34|       |
   35|   268k|  const int mb_cols = ROUND_POWER_OF_TWO(mi_cols, 2);
  ------------------
  |  |   41|   268k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   36|   268k|  const int mb_rows = ROUND_POWER_OF_TWO(mi_rows, 2);
  ------------------
  |  |   41|   268k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   37|   268k|  return mb_rows * mb_cols;
   38|   268k|}
av1_free_ref_frame_buffers:
   40|  25.4k|void av1_free_ref_frame_buffers(BufferPool *pool) {
   41|  25.4k|  int i;
   42|       |
   43|   432k|  for (i = 0; i < pool->num_frame_bufs; ++i) {
  ------------------
  |  Branch (43:15): [True: 406k, False: 25.4k]
  ------------------
   44|   406k|    if (pool->frame_bufs[i].ref_count > 0 &&
  ------------------
  |  Branch (44:9): [True: 69.2k, False: 337k]
  ------------------
   45|  69.2k|        pool->frame_bufs[i].raw_frame_buffer.data != NULL) {
  ------------------
  |  Branch (45:9): [True: 14.0k, False: 55.2k]
  ------------------
   46|  14.0k|      pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer);
   47|  14.0k|      pool->frame_bufs[i].raw_frame_buffer.data = NULL;
   48|  14.0k|      pool->frame_bufs[i].raw_frame_buffer.size = 0;
   49|  14.0k|      pool->frame_bufs[i].raw_frame_buffer.priv = NULL;
   50|  14.0k|      pool->frame_bufs[i].ref_count = 0;
   51|  14.0k|    }
   52|   406k|    aom_free(pool->frame_bufs[i].mvs);
   53|   406k|    pool->frame_bufs[i].mvs = NULL;
   54|   406k|    aom_free(pool->frame_bufs[i].seg_map);
   55|   406k|    pool->frame_bufs[i].seg_map = NULL;
   56|   406k|    aom_free_frame_buffer(&pool->frame_bufs[i].buf);
   57|   406k|  }
   58|  25.4k|  aom_free(pool->frame_bufs);
   59|       |  pool->frame_bufs = NULL;
   60|  25.4k|  pool->num_frame_bufs = 0;
   61|  25.4k|}
av1_free_cdef_buffers:
  124|  25.4k|                           AV1CdefSync *cdef_sync) {
  125|  25.4k|  CdefInfo *cdef_info = &cm->cdef_info;
  126|  25.4k|  const int num_mi_rows = cdef_info->allocated_mi_rows;
  127|       |
  128|   101k|  for (int plane = 0; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|   101k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (128:23): [True: 76.2k, False: 25.4k]
  ------------------
  129|  76.2k|    aom_free(cdef_info->linebuf[plane]);
  130|  76.2k|    cdef_info->linebuf[plane] = NULL;
  131|  76.2k|  }
  132|       |  // De-allocation of column buffer & source buffer (worker_0).
  133|  25.4k|  free_cdef_bufs(cdef_info->colbuf, &cdef_info->srcbuf);
  134|       |
  135|  25.4k|  free_cdef_row_sync(&cdef_sync->cdef_row_mt, num_mi_rows);
  136|       |
  137|  25.4k|  if (cdef_info->allocated_num_workers < 2) return;
  ------------------
  |  Branch (137:7): [True: 14.2k, False: 11.1k]
  ------------------
  138|  11.1k|  if (*cdef_worker != NULL) {
  ------------------
  |  Branch (138:7): [True: 11.1k, False: 0]
  ------------------
  139|   227k|    for (int idx = cdef_info->allocated_num_workers - 1; idx >= 1; idx--) {
  ------------------
  |  Branch (139:58): [True: 216k, False: 11.1k]
  ------------------
  140|       |      // De-allocation of column buffer & source buffer for remaining workers.
  141|   216k|      free_cdef_bufs((*cdef_worker)[idx].colbuf, &(*cdef_worker)[idx].srcbuf);
  142|   216k|    }
  143|  11.1k|    aom_free(*cdef_worker);
  144|       |    *cdef_worker = NULL;
  145|  11.1k|  }
  146|  11.1k|}
av1_alloc_cdef_buffers:
  195|   150k|                            int init_worker) {
  196|   150k|  const int num_planes = av1_num_planes(cm);
  197|   150k|  size_t new_linebuf_size[MAX_MB_PLANE] = { 0 };
  198|   150k|  size_t new_colbuf_size[MAX_MB_PLANE] = { 0 };
  199|   150k|  size_t new_srcbuf_size = 0;
  200|   150k|  CdefInfo *const cdef_info = &cm->cdef_info;
  201|       |  // Check for configuration change
  202|   150k|  const int num_mi_rows =
  203|   150k|      (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   150k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   150k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   150k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   150k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  204|   150k|  const int is_num_workers_changed =
  205|   150k|      cdef_info->allocated_num_workers != num_workers;
  206|   150k|  const int is_cdef_enabled =
  207|   150k|      cm->seq_params->enable_cdef && !cm->tiles.single_tile_decoding;
  ------------------
  |  Branch (207:7): [True: 150k, False: 0]
  |  Branch (207:38): [True: 150k, False: 0]
  ------------------
  208|       |
  209|       |  // num-bufs=3 represents ping-pong buffers for top linebuf,
  210|       |  // followed by bottom linebuf.
  211|       |  // ping-pong is to avoid top linebuf over-write by consecutive row.
  212|   150k|  int num_bufs = 3;
  213|   150k|  if (num_workers > 1)
  ------------------
  |  Branch (213:7): [True: 54.4k, False: 96.4k]
  ------------------
  214|  54.4k|    num_bufs = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  54.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  54.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                  num_bufs = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  54.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  54.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  215|       |
  216|   150k|  if (is_cdef_enabled) {
  ------------------
  |  Branch (216:7): [True: 150k, False: 0]
  ------------------
  217|       |    // Calculate src buffer size
  218|   150k|    new_srcbuf_size = sizeof(*cdef_info->srcbuf) * CDEF_INBUF_SIZE;
  ------------------
  |  |   32|   150k|  (CDEF_BSTRIDE * ((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_VBORDER))
  |  |  ------------------
  |  |  |  |   28|   150k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|   150k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (CDEF_BSTRIDE * ((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_VBORDER))
  |  |  ------------------
  |  |  |  |   31|   150k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |                 (CDEF_BSTRIDE * ((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_VBORDER))
  |  |  ------------------
  |  |  |  |   23|   150k|#define CDEF_VBORDER (2)
  |  |  ------------------
  ------------------
  219|   418k|    for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (219:25): [True: 267k, False: 150k]
  ------------------
  220|   267k|      const int shift =
  221|   267k|          plane == AOM_PLANE_Y ? 0 : cm->seq_params->subsampling_x;
  ------------------
  |  |  281|   267k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (221:11): [True: 150k, False: 116k]
  ------------------
  222|       |      // Calculate top and bottom line buffer size
  223|   267k|      const int luma_stride =
  224|   267k|          ALIGN_POWER_OF_TWO(cm->mi_params.mi_cols << MI_SIZE_LOG2, 4);
  ------------------
  |  |   69|   267k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  225|   267k|      new_linebuf_size[plane] = sizeof(*cdef_info->linebuf) * num_bufs *
  226|   267k|                                (CDEF_VBORDER << 1) * (luma_stride >> shift);
  ------------------
  |  |   23|   267k|#define CDEF_VBORDER (2)
  ------------------
  227|       |      // Calculate column buffer size
  228|   267k|      const int block_height =
  229|   267k|          (CDEF_BLOCKSIZE << (MI_SIZE_LOG2 - shift)) * 2 * CDEF_VBORDER;
  ------------------
  |  |   17|   267k|#define CDEF_BLOCKSIZE 64
  ------------------
                        (CDEF_BLOCKSIZE << (MI_SIZE_LOG2 - shift)) * 2 * CDEF_VBORDER;
  ------------------
  |  |   39|   267k|#define MI_SIZE_LOG2 2
  ------------------
                        (CDEF_BLOCKSIZE << (MI_SIZE_LOG2 - shift)) * 2 * CDEF_VBORDER;
  ------------------
  |  |   23|   267k|#define CDEF_VBORDER (2)
  ------------------
  230|   267k|      new_colbuf_size[plane] =
  231|   267k|          sizeof(*cdef_info->colbuf[plane]) * block_height * CDEF_HBORDER;
  ------------------
  |  |   26|   267k|#define CDEF_HBORDER (8)
  ------------------
  232|   267k|    }
  233|   150k|  }
  234|       |
  235|       |  // Free src, line and column buffers for worker 0 in case of reallocation
  236|   150k|  free_cdef_linebuf_conditional(cm, new_linebuf_size);
  237|   150k|  free_cdef_bufs_conditional(cm, cdef_info->colbuf, &cdef_info->srcbuf,
  238|   150k|                             new_colbuf_size, new_srcbuf_size);
  239|       |
  240|       |  // The flag init_worker indicates if cdef_worker has to be allocated for the
  241|       |  // frame. This is passed as 1 always from decoder. At encoder side, it is 0
  242|       |  // when called for parallel frames during FPMT (where cdef_worker is shared
  243|       |  // across parallel frames) and 1 otherwise.
  244|   150k|  if (*cdef_worker != NULL && init_worker) {
  ------------------
  |  Branch (244:7): [True: 43.2k, False: 107k]
  |  Branch (244:31): [True: 43.2k, False: 0]
  ------------------
  245|  43.2k|    if (is_num_workers_changed) {
  ------------------
  |  Branch (245:9): [True: 6.61k, False: 36.6k]
  ------------------
  246|       |      // Free src and column buffers for remaining workers in case of change in
  247|       |      // num_workers
  248|  25.1k|      for (int idx = cdef_info->allocated_num_workers - 1; idx >= 1; idx--)
  ------------------
  |  Branch (248:60): [True: 18.5k, False: 6.61k]
  ------------------
  249|  18.5k|        free_cdef_bufs((*cdef_worker)[idx].colbuf, &(*cdef_worker)[idx].srcbuf);
  250|       |
  251|  6.61k|      aom_free(*cdef_worker);
  252|  6.61k|      *cdef_worker = NULL;
  253|  36.6k|    } else if (num_workers > 1) {
  ------------------
  |  Branch (253:16): [True: 36.6k, False: 0]
  ------------------
  254|       |      // Free src and column buffers for remaining workers in case of
  255|       |      // reallocation
  256|   689k|      for (int idx = num_workers - 1; idx >= 1; idx--)
  ------------------
  |  Branch (256:39): [True: 652k, False: 36.6k]
  ------------------
  257|   652k|        free_cdef_bufs_conditional(cm, (*cdef_worker)[idx].colbuf,
  258|   652k|                                   &(*cdef_worker)[idx].srcbuf, new_colbuf_size,
  259|   652k|                                   new_srcbuf_size);
  260|  36.6k|    }
  261|  43.2k|  }
  262|       |
  263|   150k|  if (cdef_info->allocated_mi_rows != num_mi_rows)
  ------------------
  |  Branch (263:7): [True: 36.7k, False: 114k]
  ------------------
  264|  36.7k|    free_cdef_row_sync(&cdef_sync->cdef_row_mt, cdef_info->allocated_mi_rows);
  265|       |
  266|       |  // Store allocated sizes for reallocation
  267|   150k|  cdef_info->allocated_srcbuf_size = new_srcbuf_size;
  268|   150k|  av1_copy(cdef_info->allocated_colbuf_size, new_colbuf_size);
  ------------------
  |  |   31|   150k|  do {                                              \
  |  |   32|   150k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|   150k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|   150k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 150k]
  |  |  ------------------
  ------------------
  269|   150k|  av1_copy(cdef_info->allocated_linebuf_size, new_linebuf_size);
  ------------------
  |  |   31|   150k|  do {                                              \
  |  |   32|   150k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|   150k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|   150k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 150k]
  |  |  ------------------
  ------------------
  270|       |  // Store configuration to check change in configuration
  271|   150k|  cdef_info->allocated_mi_rows = num_mi_rows;
  272|   150k|  cdef_info->allocated_num_workers = num_workers;
  273|       |
  274|   150k|  if (!is_cdef_enabled) return;
  ------------------
  |  Branch (274:7): [True: 0, False: 150k]
  ------------------
  275|       |
  276|       |  // Memory allocation of column buffer & source buffer (worker_0).
  277|   150k|  alloc_cdef_bufs(cm, cdef_info->colbuf, &cdef_info->srcbuf, num_planes);
  278|   150k|  alloc_cdef_linebuf(cm, cdef_info->linebuf, num_planes);
  279|       |
  280|   150k|  if (num_workers < 2) return;
  ------------------
  |  Branch (280:7): [True: 96.4k, False: 54.4k]
  ------------------
  281|       |
  282|  54.4k|  if (init_worker) {
  ------------------
  |  Branch (282:7): [True: 54.4k, False: 0]
  ------------------
  283|  54.4k|    if (*cdef_worker == NULL)
  ------------------
  |  Branch (283:9): [True: 17.8k, False: 36.6k]
  ------------------
  284|  54.4k|      CHECK_MEM_ERROR(cm, *cdef_worker,
  ------------------
  |  |   51|  17.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  17.8k|  do {                                                    \
  |  |  |  |   72|  17.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  17.8k|    lval = (expr);                                        \
  |  |  |  |   74|  17.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 17.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  17.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  17.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 17.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  54.4k|                      aom_calloc(num_workers, sizeof(**cdef_worker)));
  286|       |
  287|       |    // Memory allocation of column buffer & source buffer for remaining workers.
  288|   942k|    for (int idx = num_workers - 1; idx >= 1; idx--)
  ------------------
  |  Branch (288:37): [True: 887k, False: 54.4k]
  ------------------
  289|   887k|      alloc_cdef_bufs(cm, (*cdef_worker)[idx].colbuf,
  290|   887k|                      &(*cdef_worker)[idx].srcbuf, num_planes);
  291|  54.4k|  }
  292|       |
  293|  54.4k|  alloc_cdef_row_sync(cm, &cdef_sync->cdef_row_mt,
  294|  54.4k|                      cdef_info->allocated_mi_rows);
  295|  54.4k|}
av1_alloc_restoration_buffers:
  299|  28.5k|void av1_alloc_restoration_buffers(AV1_COMMON *cm, bool is_sgr_enabled) {
  300|  28.5k|  const int num_planes = av1_num_planes(cm);
  301|       |
  302|  28.5k|  if (cm->rst_tmpbuf == NULL && is_sgr_enabled) {
  ------------------
  |  Branch (302:7): [True: 10.4k, False: 18.0k]
  |  Branch (302:33): [True: 10.4k, False: 0]
  ------------------
  303|  10.4k|    CHECK_MEM_ERROR(cm, cm->rst_tmpbuf,
  ------------------
  |  |   51|  10.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  10.4k|  do {                                                    \
  |  |  |  |   72|  10.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  10.4k|    lval = (expr);                                        \
  |  |  |  |   74|  10.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  10.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  10.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  304|  10.4k|                    (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE));
  305|  10.4k|  }
  306|       |
  307|  28.5k|  if (cm->rlbs == NULL) {
  ------------------
  |  Branch (307:7): [True: 10.4k, False: 18.0k]
  ------------------
  308|  10.4k|    CHECK_MEM_ERROR(cm, cm->rlbs, aom_malloc(sizeof(RestorationLineBuffers)));
  ------------------
  |  |   51|  10.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  10.4k|  do {                                                    \
  |  |  |  |   72|  10.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  10.4k|    lval = (expr);                                        \
  |  |  |  |   74|  10.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  10.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  10.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  10.4k|  }
  310|       |
  311|       |  // For striped loop restoration, we divide each plane into "stripes",
  312|       |  // of height 64 luma pixels but with an offset by RESTORATION_UNIT_OFFSET
  313|       |  // luma pixels to match the output from CDEF. We will need to store 2 *
  314|       |  // RESTORATION_CTX_VERT lines of data for each stripe.
  315|  28.5k|  int mi_h = cm->mi_params.mi_rows;
  316|  28.5k|  const int ext_h = RESTORATION_UNIT_OFFSET + (mi_h << MI_SIZE_LOG2);
  ------------------
  |  |   37|  28.5k|#define RESTORATION_UNIT_OFFSET 8
  ------------------
                const int ext_h = RESTORATION_UNIT_OFFSET + (mi_h << MI_SIZE_LOG2);
  ------------------
  |  |   39|  28.5k|#define MI_SIZE_LOG2 2
  ------------------
  317|  28.5k|  const int num_stripes = (ext_h + 63) / 64;
  318|       |
  319|       |  // Now we need to allocate enough space to store the line buffers for the
  320|       |  // stripes
  321|  28.5k|  const int frame_w = cm->superres_upscaled_width;
  322|  28.5k|  const int use_highbd = cm->seq_params->use_highbitdepth;
  323|       |
  324|  78.4k|  for (int p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (324:19): [True: 49.8k, False: 28.5k]
  ------------------
  325|  49.8k|    const int is_uv = p > 0;
  326|  49.8k|    const int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (326:22): [True: 21.3k, False: 28.5k]
  |  Branch (326:31): [True: 16.0k, False: 5.27k]
  ------------------
  327|  49.8k|    const int plane_w = ((frame_w + ss_x) >> ss_x) + 2 * RESTORATION_EXTRA_HORZ;
  ------------------
  |  |   70|  49.8k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
  328|  49.8k|    const int stride = ALIGN_POWER_OF_TWO(plane_w, 5);
  ------------------
  |  |   69|  49.8k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  329|  49.8k|    const int buf_size = num_stripes * stride * RESTORATION_CTX_VERT
  ------------------
  |  |   66|  49.8k|#define RESTORATION_CTX_VERT 2
  ------------------
  330|  49.8k|                         << use_highbd;
  331|  49.8k|    RestorationStripeBoundaries *boundaries = &cm->rst_info[p].boundaries;
  332|       |
  333|  49.8k|    if (buf_size != boundaries->stripe_boundary_size ||
  ------------------
  |  Branch (333:9): [True: 21.9k, False: 27.9k]
  ------------------
  334|  27.9k|        boundaries->stripe_boundary_above == NULL ||
  ------------------
  |  Branch (334:9): [True: 0, False: 27.9k]
  ------------------
  335|  27.9k|        boundaries->stripe_boundary_below == NULL) {
  ------------------
  |  Branch (335:9): [True: 0, False: 27.9k]
  ------------------
  336|  21.9k|      aom_free(boundaries->stripe_boundary_above);
  337|  21.9k|      aom_free(boundaries->stripe_boundary_below);
  338|       |
  339|  21.9k|      CHECK_MEM_ERROR(cm, boundaries->stripe_boundary_above,
  ------------------
  |  |   51|  21.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  21.9k|  do {                                                    \
  |  |  |  |   72|  21.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  21.9k|    lval = (expr);                                        \
  |  |  |  |   74|  21.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 21.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  21.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  21.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  340|  21.9k|                      (uint8_t *)aom_memalign(32, buf_size));
  341|  21.9k|      CHECK_MEM_ERROR(cm, boundaries->stripe_boundary_below,
  ------------------
  |  |   51|  21.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  21.9k|  do {                                                    \
  |  |  |  |   72|  21.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  21.9k|    lval = (expr);                                        \
  |  |  |  |   74|  21.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 21.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  21.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  21.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  342|  21.9k|                      (uint8_t *)aom_memalign(32, buf_size));
  343|       |
  344|  21.9k|      boundaries->stripe_boundary_size = buf_size;
  345|  21.9k|    }
  346|  49.8k|    boundaries->stripe_boundary_stride = stride;
  347|  49.8k|  }
  348|  28.5k|}
av1_free_restoration_buffers:
  350|  25.4k|void av1_free_restoration_buffers(AV1_COMMON *cm) {
  351|  25.4k|  int p;
  352|   101k|  for (p = 0; p < MAX_MB_PLANE; ++p)
  ------------------
  |  |   36|   101k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (352:15): [True: 76.2k, False: 25.4k]
  ------------------
  353|  76.2k|    av1_free_restoration_struct(&cm->rst_info[p]);
  354|  25.4k|  aom_free(cm->rst_tmpbuf);
  355|  25.4k|  cm->rst_tmpbuf = NULL;
  356|  25.4k|  aom_free(cm->rlbs);
  357|  25.4k|  cm->rlbs = NULL;
  358|   101k|  for (p = 0; p < MAX_MB_PLANE; ++p) {
  ------------------
  |  |   36|   101k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (358:15): [True: 76.2k, False: 25.4k]
  ------------------
  359|  76.2k|    RestorationStripeBoundaries *boundaries = &cm->rst_info[p].boundaries;
  360|  76.2k|    aom_free(boundaries->stripe_boundary_above);
  361|  76.2k|    aom_free(boundaries->stripe_boundary_below);
  362|  76.2k|    boundaries->stripe_boundary_above = NULL;
  363|  76.2k|    boundaries->stripe_boundary_below = NULL;
  364|  76.2k|  }
  365|       |
  366|  25.4k|  aom_free_frame_buffer(&cm->rst_frame);
  367|  25.4k|}
av1_free_above_context_buffers:
  370|  93.2k|void av1_free_above_context_buffers(CommonContexts *above_contexts) {
  371|  93.2k|  int i;
  372|  93.2k|  const int num_planes = above_contexts->num_planes;
  373|       |
  374|   135k|  for (int tile_row = 0; tile_row < above_contexts->num_tile_rows; tile_row++) {
  ------------------
  |  Branch (374:26): [True: 42.5k, False: 93.2k]
  ------------------
  375|   117k|    for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (375:17): [True: 75.3k, False: 42.5k]
  ------------------
  376|  75.3k|      if (above_contexts->entropy[i] == NULL) break;
  ------------------
  |  Branch (376:11): [True: 0, False: 75.3k]
  ------------------
  377|  75.3k|      aom_free(above_contexts->entropy[i][tile_row]);
  378|  75.3k|      above_contexts->entropy[i][tile_row] = NULL;
  379|  75.3k|    }
  380|  42.5k|    if (above_contexts->partition != NULL) {
  ------------------
  |  Branch (380:9): [True: 42.5k, False: 0]
  ------------------
  381|  42.5k|      aom_free(above_contexts->partition[tile_row]);
  382|  42.5k|      above_contexts->partition[tile_row] = NULL;
  383|  42.5k|    }
  384|       |
  385|  42.5k|    if (above_contexts->txfm != NULL) {
  ------------------
  |  Branch (385:9): [True: 42.5k, False: 0]
  ------------------
  386|  42.5k|      aom_free(above_contexts->txfm[tile_row]);
  387|  42.5k|      above_contexts->txfm[tile_row] = NULL;
  388|  42.5k|    }
  389|  42.5k|  }
  390|   146k|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (390:15): [True: 53.1k, False: 93.2k]
  ------------------
  391|  53.1k|    aom_free(above_contexts->entropy[i]);
  392|  53.1k|    above_contexts->entropy[i] = NULL;
  393|  53.1k|  }
  394|  93.2k|  aom_free(above_contexts->partition);
  395|  93.2k|  above_contexts->partition = NULL;
  396|       |
  397|  93.2k|  aom_free(above_contexts->txfm);
  398|  93.2k|  above_contexts->txfm = NULL;
  399|       |
  400|  93.2k|  above_contexts->num_tile_rows = 0;
  401|  93.2k|  above_contexts->num_mi_cols = 0;
  402|  93.2k|  above_contexts->num_planes = 0;
  403|  93.2k|}
av1_free_context_buffers:
  405|  63.1k|void av1_free_context_buffers(AV1_COMMON *cm) {
  406|  63.1k|  if (cm->mi_params.free_mi != NULL) cm->mi_params.free_mi(&cm->mi_params);
  ------------------
  |  Branch (406:7): [True: 63.1k, False: 0]
  ------------------
  407|       |
  408|  63.1k|  av1_free_above_context_buffers(&cm->above_contexts);
  409|  63.1k|}
av1_alloc_above_context_buffers:
  413|  30.0k|                                    int num_planes) {
  414|  30.0k|  const int aligned_mi_cols =
  415|  30.0k|      ALIGN_POWER_OF_TWO(num_mi_cols, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|  30.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  416|       |
  417|       |  // Allocate above context buffers
  418|  30.0k|  above_contexts->num_tile_rows = num_tile_rows;
  419|  30.0k|  above_contexts->num_mi_cols = aligned_mi_cols;
  420|  30.0k|  above_contexts->num_planes = num_planes;
  421|  83.1k|  for (int plane_idx = 0; plane_idx < num_planes; plane_idx++) {
  ------------------
  |  Branch (421:27): [True: 53.1k, False: 30.0k]
  ------------------
  422|  53.1k|    above_contexts->entropy[plane_idx] = (ENTROPY_CONTEXT **)aom_calloc(
  423|  53.1k|        num_tile_rows, sizeof(above_contexts->entropy[0]));
  424|  53.1k|    if (!above_contexts->entropy[plane_idx]) return 1;
  ------------------
  |  Branch (424:9): [True: 0, False: 53.1k]
  ------------------
  425|  53.1k|  }
  426|       |
  427|  30.0k|  above_contexts->partition = (PARTITION_CONTEXT **)aom_calloc(
  428|  30.0k|      num_tile_rows, sizeof(above_contexts->partition));
  429|  30.0k|  if (!above_contexts->partition) return 1;
  ------------------
  |  Branch (429:7): [True: 0, False: 30.0k]
  ------------------
  430|       |
  431|  30.0k|  above_contexts->txfm =
  432|  30.0k|      (TXFM_CONTEXT **)aom_calloc(num_tile_rows, sizeof(above_contexts->txfm));
  433|  30.0k|  if (!above_contexts->txfm) return 1;
  ------------------
  |  Branch (433:7): [True: 0, False: 30.0k]
  ------------------
  434|       |
  435|  72.6k|  for (int tile_row = 0; tile_row < num_tile_rows; tile_row++) {
  ------------------
  |  Branch (435:26): [True: 42.5k, False: 30.0k]
  ------------------
  436|   117k|    for (int plane_idx = 0; plane_idx < num_planes; plane_idx++) {
  ------------------
  |  Branch (436:29): [True: 75.3k, False: 42.5k]
  ------------------
  437|  75.3k|      above_contexts->entropy[plane_idx][tile_row] =
  438|  75.3k|          (ENTROPY_CONTEXT *)aom_calloc(
  439|  75.3k|              aligned_mi_cols, sizeof(*above_contexts->entropy[0][tile_row]));
  440|  75.3k|      if (!above_contexts->entropy[plane_idx][tile_row]) return 1;
  ------------------
  |  Branch (440:11): [True: 0, False: 75.3k]
  ------------------
  441|  75.3k|    }
  442|       |
  443|  42.5k|    above_contexts->partition[tile_row] = (PARTITION_CONTEXT *)aom_calloc(
  444|  42.5k|        aligned_mi_cols, sizeof(*above_contexts->partition[tile_row]));
  445|  42.5k|    if (!above_contexts->partition[tile_row]) return 1;
  ------------------
  |  Branch (445:9): [True: 0, False: 42.5k]
  ------------------
  446|       |
  447|  42.5k|    above_contexts->txfm[tile_row] = (TXFM_CONTEXT *)aom_calloc(
  448|  42.5k|        aligned_mi_cols, sizeof(*above_contexts->txfm[tile_row]));
  449|  42.5k|    if (!above_contexts->txfm[tile_row]) return 1;
  ------------------
  |  Branch (449:9): [True: 0, False: 42.5k]
  ------------------
  450|  42.5k|  }
  451|       |
  452|  30.0k|  return 0;
  453|  30.0k|}
av1_alloc_context_buffers:
  488|   155k|                              BLOCK_SIZE min_partition_size) {
  489|   155k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
  490|   155k|  mi_params->set_mb_mi(mi_params, width, height, min_partition_size);
  491|   155k|  if (alloc_mi(mi_params)) goto fail;
  ------------------
  |  Branch (491:7): [True: 0, False: 155k]
  ------------------
  492|   155k|  return 0;
  493|       |
  494|      0|fail:
  495|       |  // clear the mi_* values to force a realloc on resync
  496|      0|  mi_params->set_mb_mi(mi_params, 0, 0, BLOCK_4X4);
  497|      0|  av1_free_context_buffers(cm);
  498|      0|  return 1;
  499|   155k|}
av1_remove_common:
  501|  32.4k|void av1_remove_common(AV1_COMMON *cm) {
  502|  32.4k|  av1_free_context_buffers(cm);
  503|       |
  504|  32.4k|  aom_free(cm->fc);
  505|  32.4k|  cm->fc = NULL;
  506|  32.4k|  aom_free(cm->default_frame_context);
  507|       |  cm->default_frame_context = NULL;
  508|  32.4k|}
av1_init_mi_buffers:
  510|  24.1k|void av1_init_mi_buffers(CommonModeInfoParams *mi_params) {
  511|  24.1k|  mi_params->setup_mi(mi_params);
  512|  24.1k|}
alloccommon.c:free_cdef_bufs:
   92|   260k|static inline void free_cdef_bufs(uint16_t **colbuf, uint16_t **srcbuf) {
   93|   260k|  aom_free(*srcbuf);
   94|   260k|  *srcbuf = NULL;
   95|  1.04M|  for (int plane = 0; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|  1.04M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (95:23): [True: 781k, False: 260k]
  ------------------
   96|   781k|    aom_free(colbuf[plane]);
   97|       |    colbuf[plane] = NULL;
   98|   781k|  }
   99|   260k|}
alloccommon.c:free_cdef_row_sync:
  102|  62.1k|                                      const int num_mi_rows) {
  103|  62.1k|  if (*cdef_row_mt == NULL) return;
  ------------------
  |  Branch (103:7): [True: 41.2k, False: 20.8k]
  ------------------
  104|  20.8k|#if CONFIG_MULTITHREAD
  105|  61.2k|  for (int row_idx = 0; row_idx < num_mi_rows; row_idx++) {
  ------------------
  |  Branch (105:25): [True: 40.3k, False: 20.8k]
  ------------------
  106|  40.3k|    if ((*cdef_row_mt)[row_idx].row_mutex_ != NULL) {
  ------------------
  |  Branch (106:9): [True: 40.3k, False: 0]
  ------------------
  107|  40.3k|      pthread_mutex_destroy((*cdef_row_mt)[row_idx].row_mutex_);
  108|  40.3k|      aom_free((*cdef_row_mt)[row_idx].row_mutex_);
  109|  40.3k|    }
  110|  40.3k|    if ((*cdef_row_mt)[row_idx].row_cond_ != NULL) {
  ------------------
  |  Branch (110:9): [True: 40.3k, False: 0]
  ------------------
  111|  40.3k|      pthread_cond_destroy((*cdef_row_mt)[row_idx].row_cond_);
  112|  40.3k|      aom_free((*cdef_row_mt)[row_idx].row_cond_);
  113|  40.3k|    }
  114|  40.3k|  }
  115|       |#else
  116|       |  (void)num_mi_rows;
  117|       |#endif  // CONFIG_MULTITHREAD
  118|  20.8k|  aom_free(*cdef_row_mt);
  119|       |  *cdef_row_mt = NULL;
  120|  20.8k|}
alloccommon.c:free_cdef_linebuf_conditional:
   64|   150k|    AV1_COMMON *const cm, const size_t *new_linebuf_size) {
   65|   150k|  CdefInfo *cdef_info = &cm->cdef_info;
   66|   603k|  for (int plane = 0; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|   603k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (66:23): [True: 452k, False: 150k]
  ------------------
   67|   452k|    if (new_linebuf_size[plane] != cdef_info->allocated_linebuf_size[plane]) {
  ------------------
  |  Branch (67:9): [True: 99.8k, False: 352k]
  ------------------
   68|  99.8k|      aom_free(cdef_info->linebuf[plane]);
   69|       |      cdef_info->linebuf[plane] = NULL;
   70|  99.8k|    }
   71|   452k|  }
   72|   150k|}
alloccommon.c:free_cdef_bufs_conditional:
   78|   803k|                                              const size_t new_srcbuf_size) {
   79|   803k|  CdefInfo *cdef_info = &cm->cdef_info;
   80|   803k|  if (new_srcbuf_size != cdef_info->allocated_srcbuf_size) {
  ------------------
  |  Branch (80:7): [True: 25.4k, False: 778k]
  ------------------
   81|  25.4k|    aom_free(*srcbuf);
   82|  25.4k|    *srcbuf = NULL;
   83|  25.4k|  }
   84|  3.21M|  for (int plane = 0; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|  3.21M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (84:23): [True: 2.41M, False: 803k]
  ------------------
   85|  2.41M|    if (new_colbuf_size[plane] != cdef_info->allocated_colbuf_size[plane]) {
  ------------------
  |  Branch (85:9): [True: 44.8k, False: 2.36M]
  ------------------
   86|  44.8k|      aom_free(colbuf[plane]);
   87|       |      colbuf[plane] = NULL;
   88|  44.8k|    }
   89|  2.41M|  }
   90|   803k|}
alloccommon.c:alloc_cdef_bufs:
  159|  1.03M|                                   uint16_t **srcbuf, const int num_planes) {
  160|  1.03M|  CdefInfo *cdef_info = &cm->cdef_info;
  161|  1.03M|  if (*srcbuf == NULL)
  ------------------
  |  Branch (161:7): [True: 260k, False: 778k]
  ------------------
  162|  1.03M|    CHECK_MEM_ERROR(cm, *srcbuf,
  ------------------
  |  |   51|   260k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   260k|  do {                                                    \
  |  |  |  |   72|   260k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   260k|    lval = (expr);                                        \
  |  |  |  |   74|   260k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 260k]
  |  |  |  |  ------------------
  |  |  |  |   75|   260k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   260k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 260k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  1.03M|                    aom_memalign(16, cdef_info->allocated_srcbuf_size));
  164|       |
  165|  2.88M|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (165:23): [True: 1.84M, False: 1.03M]
  ------------------
  166|  1.84M|    if (colbuf[plane] == NULL)
  ------------------
  |  Branch (166:9): [True: 462k, False: 1.38M]
  ------------------
  167|       |      CHECK_MEM_ERROR(cm, colbuf[plane],
  ------------------
  |  |   51|   462k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   462k|  do {                                                    \
  |  |  |  |   72|   462k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   462k|    lval = (expr);                                        \
  |  |  |  |   74|   462k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 462k]
  |  |  |  |  ------------------
  |  |  |  |   75|   462k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   462k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 462k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  1.84M|                      aom_malloc(cdef_info->allocated_colbuf_size[plane]));
  169|  1.84M|  }
  170|  1.03M|}
alloccommon.c:alloc_cdef_linebuf:
  149|   150k|                                      const int num_planes) {
  150|   150k|  CdefInfo *cdef_info = &cm->cdef_info;
  151|   418k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (151:23): [True: 267k, False: 150k]
  ------------------
  152|   267k|    if (linebuf[plane] == NULL)
  ------------------
  |  Branch (152:9): [True: 99.8k, False: 167k]
  ------------------
  153|       |      CHECK_MEM_ERROR(cm, linebuf[plane],
  ------------------
  |  |   51|  99.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  99.8k|  do {                                                    \
  |  |  |  |   72|  99.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  99.8k|    lval = (expr);                                        \
  |  |  |  |   74|  99.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 99.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  99.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  99.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 99.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|   267k|                      aom_malloc(cdef_info->allocated_linebuf_size[plane]));
  155|   267k|  }
  156|   150k|}
alloccommon.c:alloc_cdef_row_sync:
  174|  54.4k|                                       const int num_mi_rows) {
  175|  54.4k|  if (*cdef_row_mt != NULL) return;
  ------------------
  |  Branch (175:7): [True: 33.6k, False: 20.8k]
  ------------------
  176|       |
  177|  20.8k|  CHECK_MEM_ERROR(cm, *cdef_row_mt,
  ------------------
  |  |   51|  20.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  20.8k|  do {                                                    \
  |  |  |  |   72|  20.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  20.8k|    lval = (expr);                                        \
  |  |  |  |   74|  20.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 20.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  20.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  20.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 20.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  20.8k|                  aom_calloc(num_mi_rows, sizeof(**cdef_row_mt)));
  179|  20.8k|#if CONFIG_MULTITHREAD
  180|  61.2k|  for (int row_idx = 0; row_idx < num_mi_rows; row_idx++) {
  ------------------
  |  Branch (180:25): [True: 40.3k, False: 20.8k]
  ------------------
  181|  40.3k|    CHECK_MEM_ERROR(cm, (*cdef_row_mt)[row_idx].row_mutex_,
  ------------------
  |  |   51|  40.3k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  40.3k|  do {                                                    \
  |  |  |  |   72|  40.3k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  40.3k|    lval = (expr);                                        \
  |  |  |  |   74|  40.3k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 40.3k]
  |  |  |  |  ------------------
  |  |  |  |   75|  40.3k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  40.3k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 40.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  40.3k|                    aom_malloc(sizeof(*(*cdef_row_mt)[row_idx].row_mutex_)));
  183|  40.3k|    pthread_mutex_init((*cdef_row_mt)[row_idx].row_mutex_, NULL);
  184|       |
  185|  40.3k|    CHECK_MEM_ERROR(cm, (*cdef_row_mt)[row_idx].row_cond_,
  ------------------
  |  |   51|  40.3k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  40.3k|  do {                                                    \
  |  |  |  |   72|  40.3k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  40.3k|    lval = (expr);                                        \
  |  |  |  |   74|  40.3k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 40.3k]
  |  |  |  |  ------------------
  |  |  |  |   75|  40.3k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  40.3k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 40.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  186|  40.3k|                    aom_malloc(sizeof(*(*cdef_row_mt)[row_idx].row_cond_)));
  187|       |    pthread_cond_init((*cdef_row_mt)[row_idx].row_cond_, NULL);
  188|  40.3k|  }
  189|  20.8k|#endif  // CONFIG_MULTITHREAD
  190|  20.8k|}
alloccommon.c:alloc_mi:
  458|   155k|static int alloc_mi(CommonModeInfoParams *mi_params) {
  459|   155k|  const int aligned_mi_rows = calc_mi_size(mi_params->mi_rows);
  460|   155k|  const int mi_grid_size = mi_params->mi_stride * aligned_mi_rows;
  461|   155k|  const int alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
  462|   155k|  const int alloc_mi_size =
  463|   155k|      mi_params->mi_alloc_stride * (aligned_mi_rows / alloc_size_1d);
  464|       |
  465|   155k|  if (mi_params->mi_alloc_size < alloc_mi_size ||
  ------------------
  |  Branch (465:7): [True: 27.0k, False: 128k]
  ------------------
  466|   128k|      mi_params->mi_grid_size < mi_grid_size) {
  ------------------
  |  Branch (466:7): [True: 0, False: 128k]
  ------------------
  467|  27.0k|    mi_params->free_mi(mi_params);
  468|       |
  469|  27.0k|    mi_params->mi_alloc =
  470|  27.0k|        aom_calloc(alloc_mi_size, sizeof(*mi_params->mi_alloc));
  471|  27.0k|    if (!mi_params->mi_alloc) return 1;
  ------------------
  |  Branch (471:9): [True: 0, False: 27.0k]
  ------------------
  472|  27.0k|    mi_params->mi_alloc_size = alloc_mi_size;
  473|       |
  474|  27.0k|    mi_params->mi_grid_base = (MB_MODE_INFO **)aom_calloc(
  475|  27.0k|        mi_grid_size, sizeof(*mi_params->mi_grid_base));
  476|  27.0k|    if (!mi_params->mi_grid_base) return 1;
  ------------------
  |  Branch (476:9): [True: 0, False: 27.0k]
  ------------------
  477|       |
  478|  27.0k|    mi_params->tx_type_map =
  479|  27.0k|        aom_calloc(mi_grid_size, sizeof(*mi_params->tx_type_map));
  480|  27.0k|    if (!mi_params->tx_type_map) return 1;
  ------------------
  |  Branch (480:9): [True: 0, False: 27.0k]
  ------------------
  481|  27.0k|    mi_params->mi_grid_size = mi_grid_size;
  482|  27.0k|  }
  483|       |
  484|   155k|  return 0;
  485|   155k|}

av1_dx_iface.c:lock_buffer_pool:
 1084|  10.6k|static void lock_buffer_pool(BufferPool *const pool) {
 1085|  10.6k|#if CONFIG_MULTITHREAD
 1086|  10.6k|  pthread_mutex_lock(&pool->pool_mutex);
 1087|       |#else
 1088|       |  (void)pool;
 1089|       |#endif
 1090|  10.6k|}
av1_dx_iface.c:unlock_buffer_pool:
 1092|  10.6k|static void unlock_buffer_pool(BufferPool *const pool) {
 1093|  10.6k|#if CONFIG_MULTITHREAD
 1094|  10.6k|  pthread_mutex_unlock(&pool->pool_mutex);
 1095|       |#else
 1096|       |  (void)pool;
 1097|       |#endif
 1098|  10.6k|}
av1_dx_iface.c:frame_is_intra_only:
 1176|  7.01k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  7.01k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 7.01k, False: 0]
  ------------------
 1178|      0|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 0]
  ------------------
 1179|  7.01k|}
av1_dx_iface.c:av1_num_planes:
 1273|  17.6k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  17.6k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  6.76k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 10.9k, False: 6.76k]
  ------------------
 1275|  17.6k|}
decodeframe.c:set_sb_size:
 1853|  7.01k|                               BLOCK_SIZE sb_size) {
 1854|  7.01k|  seq_params->sb_size = sb_size;
 1855|  7.01k|  seq_params->mib_size = mi_size_wide[seq_params->sb_size];
 1856|  7.01k|  seq_params->mib_size_log2 = mi_size_wide_log2[seq_params->sb_size];
 1857|  7.01k|}
decodeframe.c:av1_num_planes:
 1273|  5.63M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  5.63M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  2.21M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 3.42M, False: 2.21M]
  ------------------
 1275|  5.63M|}
decodeframe.c:lock_buffer_pool:
 1084|  28.0k|static void lock_buffer_pool(BufferPool *const pool) {
 1085|  28.0k|#if CONFIG_MULTITHREAD
 1086|  28.0k|  pthread_mutex_lock(&pool->pool_mutex);
 1087|       |#else
 1088|       |  (void)pool;
 1089|       |#endif
 1090|  28.0k|}
decodeframe.c:unlock_buffer_pool:
 1092|  28.0k|static void unlock_buffer_pool(BufferPool *const pool) {
 1093|  28.0k|#if CONFIG_MULTITHREAD
 1094|  28.0k|  pthread_mutex_unlock(&pool->pool_mutex);
 1095|       |#else
 1096|       |  (void)pool;
 1097|       |#endif
 1098|  28.0k|}
decodeframe.c:frame_is_sframe:
 1181|  77.1k|static inline int frame_is_sframe(const AV1_COMMON *cm) {
 1182|  77.1k|  return cm->current_frame.frame_type == S_FRAME;
 1183|  77.1k|}
decodeframe.c:frame_is_intra_only:
 1176|   196k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   196k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 28.0k, False: 168k]
  ------------------
 1178|   168k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 168k]
  ------------------
 1179|   196k|}
decodeframe.c:ensure_mv_buffer:
 1237|  28.0k|static inline void ensure_mv_buffer(RefCntBuffer *buf, AV1_COMMON *cm) {
 1238|  28.0k|  const int buf_rows = buf->mi_rows;
 1239|  28.0k|  const int buf_cols = buf->mi_cols;
 1240|  28.0k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1241|       |
 1242|  28.0k|  if (buf->mvs == NULL || buf_rows != mi_params->mi_rows ||
  ------------------
  |  Branch (1242:7): [True: 21.0k, False: 7.01k]
  |  Branch (1242:27): [True: 4.34k, False: 2.67k]
  ------------------
 1243|  26.6k|      buf_cols != mi_params->mi_cols) {
  ------------------
  |  Branch (1243:7): [True: 1.30k, False: 1.37k]
  ------------------
 1244|  26.6k|    aom_free(buf->mvs);
 1245|  26.6k|    buf->mi_rows = mi_params->mi_rows;
 1246|  26.6k|    buf->mi_cols = mi_params->mi_cols;
 1247|  26.6k|    CHECK_MEM_ERROR(cm, buf->mvs,
  ------------------
  |  |   51|  26.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  26.6k|  do {                                                    \
  |  |  |  |   72|  26.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  26.6k|    lval = (expr);                                        \
  |  |  |  |   74|  26.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 26.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  26.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  26.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 26.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1248|  26.6k|                    (MV_REF *)aom_calloc(((mi_params->mi_rows + 1) >> 1) *
 1249|  26.6k|                                             ((mi_params->mi_cols + 1) >> 1),
 1250|  26.6k|                                         sizeof(*buf->mvs)));
 1251|  26.6k|    aom_free(buf->seg_map);
 1252|  26.6k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  26.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  26.6k|  do {                                                    \
  |  |  |  |   72|  26.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  26.6k|    lval = (expr);                                        \
  |  |  |  |   74|  26.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 26.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  26.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  26.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 26.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1253|  26.6k|        cm, buf->seg_map,
 1254|  26.6k|        (uint8_t *)aom_calloc(mi_params->mi_rows * mi_params->mi_cols,
 1255|  26.6k|                              sizeof(*buf->seg_map)));
 1256|  26.6k|  }
 1257|       |
 1258|  28.0k|  const int mem_size =
 1259|  28.0k|      ((mi_params->mi_rows + MAX_MIB_SIZE) >> 1) * (mi_params->mi_stride >> 1);
  ------------------
  |  |   44|  28.0k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|  28.0k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  28.0k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  28.0k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1260|       |
 1261|  28.0k|  if (cm->tpl_mvs == NULL || cm->tpl_mvs_mem_size < mem_size) {
  ------------------
  |  Branch (1261:7): [True: 7.01k, False: 21.0k]
  |  Branch (1261:30): [True: 7.91k, False: 13.1k]
  ------------------
 1262|  14.9k|    aom_free(cm->tpl_mvs);
 1263|       |    CHECK_MEM_ERROR(cm, cm->tpl_mvs,
  ------------------
  |  |   51|  14.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.9k|  do {                                                    \
  |  |  |  |   72|  14.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.9k|    lval = (expr);                                        \
  |  |  |  |   74|  14.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|  14.9k|                    (TPL_MV_REF *)aom_calloc(mem_size, sizeof(*cm->tpl_mvs)));
 1265|  14.9k|    cm->tpl_mvs_mem_size = mem_size;
 1266|  14.9k|  }
 1267|  28.0k|}
decodeframe.c:frame_might_allow_ref_frame_mvs:
 1224|  42.1k|static inline int frame_might_allow_ref_frame_mvs(const AV1_COMMON *cm) {
 1225|  42.1k|  return !cm->features.error_resilient_mode &&
  ------------------
  |  Branch (1225:10): [True: 42.1k, False: 0]
  ------------------
 1226|  42.1k|         cm->seq_params->order_hint_info.enable_ref_frame_mvs &&
  ------------------
  |  Branch (1226:10): [True: 42.1k, False: 0]
  ------------------
 1227|  42.1k|         cm->seq_params->order_hint_info.enable_order_hint &&
  ------------------
  |  Branch (1227:10): [True: 42.1k, False: 0]
  ------------------
 1228|  42.1k|         !frame_is_intra_only(cm);
  ------------------
  |  Branch (1228:10): [True: 42.1k, False: 0]
  ------------------
 1229|  42.1k|}
decodeframe.c:get_ref_frame_buf:
 1196|   539k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   539k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   539k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   539k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 539k, False: 18.4E]
  ------------------
 1199|   539k|}
decodeframe.c:get_ref_frame_map_idx:
 1189|   913k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   913k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 913k, False: 18.4E]
  |  Branch (1190:38): [True: 913k, False: 18.4E]
  ------------------
 1191|   913k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   913k|}
decodeframe.c:get_ref_scale_factors:
 1210|   147k|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|   147k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|   147k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   147k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 147k, False: 0]
  ------------------
 1213|   147k|}
decodeframe.c:is_coded_lossless:
 1863|  28.0k|                                    const MACROBLOCKD *xd) {
 1864|  28.0k|  int coded_lossless = 1;
 1865|  28.0k|  if (cm->seg.enabled) {
  ------------------
  |  Branch (1865:7): [True: 0, False: 28.0k]
  ------------------
 1866|      0|    for (int i = 0; i < MAX_SEGMENTS; ++i) {
  ------------------
  |  |   23|      0|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (1866:21): [True: 0, False: 0]
  ------------------
 1867|      0|      if (!xd->lossless[i]) {
  ------------------
  |  Branch (1867:11): [True: 0, False: 0]
  ------------------
 1868|      0|        coded_lossless = 0;
 1869|      0|        break;
 1870|      0|      }
 1871|      0|    }
 1872|  28.0k|  } else {
 1873|  28.0k|    coded_lossless = xd->lossless[0];
 1874|  28.0k|  }
 1875|  28.0k|  return coded_lossless;
 1876|  28.0k|}
decodeframe.c:frame_might_allow_warped_motion:
 1232|  28.0k|static inline int frame_might_allow_warped_motion(const AV1_COMMON *cm) {
 1233|  28.0k|  return !cm->features.error_resilient_mode && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (1233:10): [True: 21.0k, False: 7.01k]
  |  Branch (1233:48): [True: 21.0k, False: 0]
  ------------------
 1234|  21.0k|         cm->seq_params->enable_warped_motion;
  ------------------
  |  Branch (1234:10): [True: 21.0k, False: 0]
  ------------------
 1235|  28.0k|}
decodeframe.c:get_primary_ref_frame_buf:
 1216|  44.6k|    const AV1_COMMON *const cm) {
 1217|  44.6k|  const int primary_ref_frame = cm->features.primary_ref_frame;
 1218|  44.6k|  if (primary_ref_frame == PRIMARY_REF_NONE) return NULL;
  ------------------
  |  |   66|  44.6k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1218:7): [True: 9.25k, False: 35.4k]
  ------------------
 1219|  35.4k|  const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame + 1);
 1220|  35.4k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  35.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1220:10): [True: 35.4k, False: 0]
  ------------------
 1221|  44.6k|}
decodeframe.c:get_ref_scale_factors_const:
 1204|   191k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|   191k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|   191k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   191k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 191k, False: 284]
  ------------------
 1207|   191k|}
decodeframe.c:av1_init_above_context:
 1279|  44.8k|                                          MACROBLOCKD *xd) {
 1280|   125k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1280:19): [True: 80.4k, False: 44.8k]
  ------------------
 1281|  80.4k|    xd->above_entropy_context[i] = above_contexts->entropy[i][tile_row];
 1282|  80.4k|  }
 1283|  44.8k|  xd->above_partition_context = above_contexts->partition[tile_row];
 1284|  44.8k|  xd->above_txfm_context = above_contexts->txfm[tile_row];
 1285|  44.8k|}
decodeframe.c:av1_zero_above_context:
 1597|  44.9k|                                          const int tile_row) {
 1598|  44.9k|  const SequenceHeader *const seq_params = cm->seq_params;
 1599|  44.9k|  const int num_planes = av1_num_planes(cm);
 1600|  44.9k|  const int width = mi_col_end - mi_col_start;
 1601|  44.9k|  const int aligned_width =
 1602|  44.9k|      ALIGN_POWER_OF_TWO(width, seq_params->mib_size_log2);
  ------------------
  |  |   69|  44.9k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1603|  44.9k|  const int offset_y = mi_col_start;
 1604|  44.9k|  const int width_y = aligned_width;
 1605|  44.9k|  const int offset_uv = offset_y >> seq_params->subsampling_x;
 1606|  44.9k|  const int width_uv = width_y >> seq_params->subsampling_x;
 1607|  44.9k|  CommonContexts *const above_contexts = &cm->above_contexts;
 1608|       |
 1609|  44.9k|  av1_zero_array(above_contexts->entropy[0][tile_row] + offset_y, width_y);
  ------------------
  |  |   44|  44.9k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1610|  44.9k|  if (num_planes > 1) {
  ------------------
  |  Branch (1610:7): [True: 17.9k, False: 27.0k]
  ------------------
 1611|  17.9k|    if (above_contexts->entropy[1][tile_row] &&
  ------------------
  |  Branch (1611:9): [True: 17.9k, False: 1]
  ------------------
 1612|  17.9k|        above_contexts->entropy[2][tile_row]) {
  ------------------
  |  Branch (1612:9): [True: 17.9k, False: 0]
  ------------------
 1613|  17.9k|      av1_zero_array(above_contexts->entropy[1][tile_row] + offset_uv,
  ------------------
  |  |   44|  17.9k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1614|  17.9k|                     width_uv);
 1615|  17.9k|      av1_zero_array(above_contexts->entropy[2][tile_row] + offset_uv,
  ------------------
  |  |   44|  17.9k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1616|  17.9k|                     width_uv);
 1617|  17.9k|    } else {
 1618|      1|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1619|      1|                         "Invalid value of planes");
 1620|      1|    }
 1621|  17.9k|  }
 1622|       |
 1623|  44.9k|  av1_zero_array(above_contexts->partition[tile_row] + mi_col_start,
  ------------------
  |  |   44|  44.9k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1624|  44.9k|                 aligned_width);
 1625|       |
 1626|  44.9k|  memset(above_contexts->txfm[tile_row] + mi_col_start,
 1627|  44.9k|         tx_size_wide[TX_SIZES_LARGEST], aligned_width * sizeof(TXFM_CONTEXT));
 1628|  44.9k|}
decodeframe.c:av1_zero_left_context:
 1630|  48.1k|static inline void av1_zero_left_context(MACROBLOCKD *const xd) {
 1631|  48.1k|  av1_zero(xd->left_entropy_context);
  ------------------
  |  |   43|  48.1k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1632|  48.1k|  av1_zero(xd->left_partition_context);
  ------------------
  |  |   43|  48.1k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1633|       |
 1634|  48.1k|  memset(xd->left_txfm_context_buffer, tx_size_high[TX_SIZES_LARGEST],
 1635|  48.1k|         sizeof(xd->left_txfm_context_buffer));
 1636|  48.1k|}
decodeframe.c:set_mi_offsets:
 1674|   781k|                                  int mi_col) {
 1675|       |  // 'mi_grid_base' should point to appropriate memory in 'mi'.
 1676|   781k|  const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
 1677|   781k|  const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
 1678|   781k|  mi_params->mi_grid_base[mi_grid_idx] = &mi_params->mi_alloc[mi_alloc_idx];
 1679|       |  // 'xd->mi' should point to an offset in 'mi_grid_base';
 1680|   781k|  xd->mi = mi_params->mi_grid_base + mi_grid_idx;
 1681|       |  // 'xd->tx_type_map' should point to an offset in 'mi_params->tx_type_map'.
 1682|   781k|  xd->tx_type_map = mi_params->tx_type_map + mi_grid_idx;
 1683|   781k|  xd->tx_type_map_stride = mi_params->mi_stride;
 1684|   781k|}
decodeframe.c:get_mi_grid_idx:
 1658|   780k|                                  int mi_row, int mi_col) {
 1659|   780k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|   780k|}
decodeframe.c:get_alloc_mi_idx:
 1663|   780k|                                   int mi_row, int mi_col) {
 1664|   780k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|   780k|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|   780k|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|   780k|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|   780k|}
decodeframe.c:set_plane_n4:
 1347|  1.50M|                                const int num_planes) {
 1348|  1.50M|  int i;
 1349|  4.19M|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (1349:15): [True: 2.69M, False: 1.50M]
  ------------------
 1350|  2.69M|    xd->plane[i].width = (bw * MI_SIZE) >> xd->plane[i].subsampling_x;
  ------------------
  |  |   40|  2.69M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.69M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1351|  2.69M|    xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y;
  ------------------
  |  |   40|  2.69M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.69M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1352|       |
 1353|  2.69M|    xd->plane[i].width = AOMMAX(xd->plane[i].width, 4);
  ------------------
  |  |   35|  2.69M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.75M, False: 942k]
  |  |  ------------------
  ------------------
 1354|  2.69M|    xd->plane[i].height = AOMMAX(xd->plane[i].height, 4);
  ------------------
  |  |   35|  2.69M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.01M, False: 687k]
  |  |  ------------------
  ------------------
 1355|  2.69M|  }
 1356|  1.50M|}
decodeframe.c:set_entropy_context:
 1320|   784k|                                       const int num_planes) {
 1321|   784k|  int i;
 1322|   784k|  int row_offset = mi_row;
 1323|   784k|  int col_offset = mi_col;
 1324|  2.19M|  for (i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1324:15): [True: 1.41M, False: 784k]
  ------------------
 1325|  1.41M|    struct macroblockd_plane *const pd = &xd->plane[i];
 1326|       |    // Offset the buffer pointer
 1327|  1.41M|    const BLOCK_SIZE bsize = xd->mi[0]->bsize;
 1328|  1.41M|    if (pd->subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (1328:9): [True: 349k, False: 1.06M]
  |  Branch (1328:30): [True: 4.29k, False: 344k]
  |  Branch (1328:49): [True: 4.29k, False: 0]
  ------------------
 1329|  4.29k|      row_offset = mi_row - 1;
 1330|  1.41M|    if (pd->subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (1330:9): [True: 513k, False: 900k]
  |  Branch (1330:30): [True: 8.18k, False: 505k]
  |  Branch (1330:49): [True: 8.18k, False: 0]
  ------------------
 1331|  8.18k|      col_offset = mi_col - 1;
 1332|  1.41M|    int above_idx = col_offset;
 1333|  1.41M|    int left_idx = row_offset & MAX_MIB_MASK;
  ------------------
  |  |   50|  1.41M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  1.41M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.41M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.41M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  1.41M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1334|  1.41M|    pd->above_entropy_context =
 1335|  1.41M|        &xd->above_entropy_context[i][above_idx >> pd->subsampling_x];
 1336|  1.41M|    pd->left_entropy_context =
 1337|  1.41M|        &xd->left_entropy_context[i][left_idx >> pd->subsampling_y];
 1338|  1.41M|  }
 1339|   784k|}
decodeframe.c:set_mi_row_col:
 1360|  1.50M|                                  int mi_rows, int mi_cols) {
 1361|  1.50M|  xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE);
  ------------------
  |  |   29|  1.50M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1362|  1.50M|  xd->mb_to_bottom_edge = GET_MV_SUBPEL((mi_rows - bh - mi_row) * MI_SIZE);
  ------------------
  |  |   29|  1.50M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1363|  1.50M|  xd->mb_to_left_edge = -GET_MV_SUBPEL((mi_col * MI_SIZE));
  ------------------
  |  |   29|  1.50M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1364|  1.50M|  xd->mb_to_right_edge = GET_MV_SUBPEL((mi_cols - bw - mi_col) * MI_SIZE);
  ------------------
  |  |   29|  1.50M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1365|       |
 1366|  1.50M|  xd->mi_row = mi_row;
 1367|  1.50M|  xd->mi_col = mi_col;
 1368|       |
 1369|       |  // Are edges available for intra prediction?
 1370|  1.50M|  xd->up_available = (mi_row > tile->mi_row_start);
 1371|       |
 1372|  1.50M|  const int ss_x = xd->plane[1].subsampling_x;
 1373|  1.50M|  const int ss_y = xd->plane[1].subsampling_y;
 1374|       |
 1375|  1.50M|  xd->left_available = (mi_col > tile->mi_col_start);
 1376|  1.50M|  xd->chroma_up_available = xd->up_available;
 1377|  1.50M|  xd->chroma_left_available = xd->left_available;
 1378|  1.50M|  if (ss_x && bw < mi_size_wide[BLOCK_8X8])
  ------------------
  |  Branch (1378:7): [True: 1.39M, False: 109k]
  |  Branch (1378:15): [True: 24.8k, False: 1.36M]
  ------------------
 1379|  24.8k|    xd->chroma_left_available = (mi_col - 1) > tile->mi_col_start;
 1380|  1.50M|  if (ss_y && bh < mi_size_high[BLOCK_8X8])
  ------------------
  |  Branch (1380:7): [True: 1.23M, False: 266k]
  |  Branch (1380:15): [True: 16.4k, False: 1.21M]
  ------------------
 1381|  16.4k|    xd->chroma_up_available = (mi_row - 1) > tile->mi_row_start;
 1382|  1.50M|  if (xd->up_available) {
  ------------------
  |  Branch (1382:7): [True: 1.17M, False: 322k]
  ------------------
 1383|  1.17M|    xd->above_mbmi = xd->mi[-xd->mi_stride];
 1384|  1.17M|  } else {
 1385|   322k|    xd->above_mbmi = NULL;
 1386|   322k|  }
 1387|       |
 1388|  1.50M|  if (xd->left_available) {
  ------------------
  |  Branch (1388:7): [True: 1.18M, False: 316k]
  ------------------
 1389|  1.18M|    xd->left_mbmi = xd->mi[-1];
 1390|  1.18M|  } else {
 1391|   316k|    xd->left_mbmi = NULL;
 1392|   316k|  }
 1393|       |
 1394|  1.50M|  const int chroma_ref = ((mi_row & 0x01) || !(bh & 0x01) || !ss_y) &&
  ------------------
  |  Branch (1394:27): [True: 14.0k, False: 1.48M]
  |  Branch (1394:46): [True: 1.46M, False: 17.7k]
  |  Branch (1394:62): [True: 9.51k, False: 8.24k]
  ------------------
 1395|  1.49M|                         ((mi_col & 0x01) || !(bw & 0x01) || !ss_x);
  ------------------
  |  Branch (1395:27): [True: 13.8k, False: 1.48M]
  |  Branch (1395:46): [True: 1.46M, False: 13.5k]
  |  Branch (1395:62): [True: 4.45k, False: 9.05k]
  ------------------
 1396|  1.50M|  xd->is_chroma_ref = chroma_ref;
 1397|  1.50M|  if (chroma_ref) {
  ------------------
  |  Branch (1397:7): [True: 1.48M, False: 15.4k]
  ------------------
 1398|       |    // To help calculate the "above" and "left" chroma blocks, note that the
 1399|       |    // current block may cover multiple luma blocks (e.g., if partitioned into
 1400|       |    // 4x4 luma blocks).
 1401|       |    // First, find the top-left-most luma block covered by this chroma block
 1402|  1.48M|    MB_MODE_INFO **base_mi =
 1403|  1.48M|        &xd->mi[-(mi_row & ss_y) * xd->mi_stride - (mi_col & ss_x)];
 1404|       |
 1405|       |    // Then, we consider the luma region covered by the left or above 4x4 chroma
 1406|       |    // prediction. We want to point to the chroma reference block in that
 1407|       |    // region, which is the bottom-right-most mi unit.
 1408|       |    // This leads to the following offsets:
 1409|  1.48M|    MB_MODE_INFO *chroma_above_mi =
 1410|  1.48M|        xd->chroma_up_available ? base_mi[-xd->mi_stride + ss_x] : NULL;
  ------------------
  |  Branch (1410:9): [True: 1.16M, False: 321k]
  ------------------
 1411|  1.48M|    xd->chroma_above_mbmi = chroma_above_mi;
 1412|       |
 1413|  1.48M|    MB_MODE_INFO *chroma_left_mi =
 1414|  1.48M|        xd->chroma_left_available ? base_mi[ss_y * xd->mi_stride - 1] : NULL;
  ------------------
  |  Branch (1414:9): [True: 1.16M, False: 317k]
  ------------------
 1415|  1.48M|    xd->chroma_left_mbmi = chroma_left_mi;
 1416|  1.48M|  }
 1417|       |
 1418|  1.50M|  xd->height = bh;
 1419|  1.50M|  xd->width = bw;
 1420|       |
 1421|  1.50M|  xd->is_last_vertical_rect = 0;
 1422|  1.50M|  if (xd->width < xd->height) {
  ------------------
  |  Branch (1422:7): [True: 25.4k, False: 1.47M]
  ------------------
 1423|  25.4k|    if (!((mi_col + xd->width) & (xd->height - 1))) {
  ------------------
  |  Branch (1423:9): [True: 3.62k, False: 21.8k]
  ------------------
 1424|  3.62k|      xd->is_last_vertical_rect = 1;
 1425|  3.62k|    }
 1426|  25.4k|  }
 1427|       |
 1428|  1.50M|  xd->is_first_horizontal_rect = 0;
 1429|  1.50M|  if (xd->width > xd->height)
  ------------------
  |  Branch (1429:7): [True: 23.6k, False: 1.47M]
  ------------------
 1430|  23.6k|    if (!(mi_row & (xd->width - 1))) xd->is_first_horizontal_rect = 1;
  ------------------
  |  Branch (1430:9): [True: 18.5k, False: 5.17k]
  ------------------
 1431|  1.50M|}
decodeframe.c:max_block_high:
 1582|  2.61M|                                 int plane) {
 1583|  2.61M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  2.61M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 25.6k, False: 2.59M]
  ------------------
 1586|  25.6k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  25.6k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  25.6k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  2.61M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.61M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  2.61M|}
decodeframe.c:max_block_wide:
 1568|  2.61M|                                 int plane) {
 1569|  2.61M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  2.61M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  2.61M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 28.2k, False: 2.59M]
  ------------------
 1573|  28.2k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  28.2k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  28.2k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  2.61M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.61M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  2.61M|}
decodeframe.c:txfm_partition_update:
 1688|   213k|                                         TX_SIZE tx_size, TX_SIZE txb_size) {
 1689|   213k|  BLOCK_SIZE bsize = txsize_to_bsize[txb_size];
 1690|   213k|  int bh = mi_size_high[bsize];
 1691|   213k|  int bw = mi_size_wide[bsize];
 1692|   213k|  uint8_t txw = tx_size_wide[tx_size];
 1693|   213k|  uint8_t txh = tx_size_high[tx_size];
 1694|   213k|  int i;
 1695|   645k|  for (i = 0; i < bh; ++i) left_ctx[i] = txh;
  ------------------
  |  Branch (1695:15): [True: 431k, False: 213k]
  ------------------
 1696|   645k|  for (i = 0; i < bw; ++i) above_ctx[i] = txw;
  ------------------
  |  Branch (1696:15): [True: 431k, False: 213k]
  ------------------
 1697|   213k|}
decodeframe.c:txfm_partition_context:
 1751|   207k|                                         BLOCK_SIZE bsize, TX_SIZE tx_size) {
 1752|   207k|  const uint8_t txw = tx_size_wide[tx_size];
 1753|   207k|  const uint8_t txh = tx_size_high[tx_size];
 1754|   207k|  const int above = *above_ctx < txw;
 1755|   207k|  const int left = *left_ctx < txh;
 1756|   207k|  int category = TXFM_PARTITION_CONTEXTS;
  ------------------
  |  |  521|   207k|#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 3)
  ------------------
 1757|       |
 1758|       |  // dummy return, not used by others.
 1759|   207k|  if (tx_size <= TX_4X4) return 0;
  ------------------
  |  Branch (1759:7): [True: 0, False: 207k]
  ------------------
 1760|       |
 1761|   207k|  TX_SIZE max_tx_size =
 1762|   207k|      get_sqr_tx_size(AOMMAX(block_size_wide[bsize], block_size_high[bsize]));
  ------------------
  |  |   35|   207k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 10.0k, False: 197k]
  |  |  ------------------
  ------------------
 1763|       |
 1764|   207k|  if (max_tx_size >= TX_8X8) {
  ------------------
  |  Branch (1764:7): [True: 207k, False: 18.4E]
  ------------------
 1765|   207k|    category =
 1766|   207k|        (txsize_sqr_up_map[tx_size] != max_tx_size && max_tx_size > TX_8X8) +
  ------------------
  |  Branch (1766:10): [True: 92.7k, False: 114k]
  |  Branch (1766:55): [True: 92.7k, False: 2]
  ------------------
 1767|   207k|        (TX_SIZES - 1 - max_tx_size) * 2;
 1768|   207k|  }
 1769|       |  assert(category != TXFM_PARTITION_CONTEXTS);
 1770|   207k|  return category * 3 + above + left;
 1771|   207k|}
decodeframe.c:get_sqr_tx_size:
 1699|   207k|static inline TX_SIZE get_sqr_tx_size(int tx_dim) {
 1700|   207k|  switch (tx_dim) {
 1701|      0|    case 128:
  ------------------
  |  Branch (1701:5): [True: 0, False: 207k]
  ------------------
 1702|    439|    case 64: return TX_64X64; break;
  ------------------
  |  Branch (1702:5): [True: 439, False: 207k]
  ------------------
 1703|  15.0k|    case 32: return TX_32X32; break;
  ------------------
  |  Branch (1703:5): [True: 15.0k, False: 192k]
  ------------------
 1704|   104k|    case 16: return TX_16X16; break;
  ------------------
  |  Branch (1704:5): [True: 104k, False: 103k]
  ------------------
 1705|  88.0k|    case 8: return TX_8X8; break;
  ------------------
  |  Branch (1705:5): [True: 88.0k, False: 119k]
  ------------------
 1706|      0|    default: return TX_4X4;
  ------------------
  |  Branch (1706:5): [True: 0, False: 207k]
  ------------------
 1707|   207k|  }
 1708|   207k|}
decodeframe.c:set_txfm_ctxs:
 1644|   661k|                                 const MACROBLOCKD *xd) {
 1645|   661k|  uint8_t bw = tx_size_wide[tx_size];
 1646|   661k|  uint8_t bh = tx_size_high[tx_size];
 1647|       |
 1648|   661k|  if (skip) {
  ------------------
  |  Branch (1648:7): [True: 16.2k, False: 645k]
  ------------------
 1649|  16.2k|    bw = n4_w * MI_SIZE;
  ------------------
  |  |   40|  16.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  16.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1650|  16.2k|    bh = n4_h * MI_SIZE;
  ------------------
  |  |   40|  16.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  16.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1651|  16.2k|  }
 1652|       |
 1653|   661k|  set_txfm_ctx(xd->above_txfm_context, bw, n4_w);
 1654|   661k|  set_txfm_ctx(xd->left_txfm_context, bh, n4_h);
 1655|   661k|}
decodeframe.c:set_txfm_ctx:
 1638|  1.32M|static inline void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
 1639|  1.32M|  int i;
 1640|  4.15M|  for (i = 0; i < len; ++i) txfm_ctx[i] = txs;
  ------------------
  |  Branch (1640:15): [True: 2.82M, False: 1.32M]
  ------------------
 1641|  1.32M|}
decodeframe.c:partition_plane_context:
 1542|  1.11M|                                          int mi_col, BLOCK_SIZE bsize) {
 1543|  1.11M|  const PARTITION_CONTEXT *above_ctx = xd->above_partition_context + mi_col;
 1544|  1.11M|  const PARTITION_CONTEXT *left_ctx =
 1545|  1.11M|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  1.11M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  1.11M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.11M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.11M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  1.11M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1546|       |  // Minimum partition point is 8x8. Offset the bsl accordingly.
 1547|  1.11M|  const int bsl = mi_size_wide_log2[bsize] - mi_size_wide_log2[BLOCK_8X8];
 1548|  1.11M|  int above = (*above_ctx >> bsl) & 1, left = (*left_ctx >> bsl) & 1;
 1549|       |
 1550|  1.11M|  assert(mi_size_wide_log2[bsize] == mi_size_high_log2[bsize]);
 1551|  1.11M|  assert(bsl >= 0);
 1552|       |
 1553|  1.11M|  return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
  ------------------
  |  |  169|  1.11M|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  ------------------
 1554|  1.11M|}
decodeframe.c:partition_cdf_length:
 1558|   950k|static inline int partition_cdf_length(BLOCK_SIZE bsize) {
 1559|   950k|  if (bsize <= BLOCK_8X8)
  ------------------
  |  Branch (1559:7): [True: 692k, False: 257k]
  ------------------
 1560|   692k|    return PARTITION_TYPES;
 1561|   257k|  else if (bsize == BLOCK_128X128)
  ------------------
  |  Branch (1561:12): [True: 0, False: 257k]
  ------------------
 1562|      0|    return EXT_PARTITION_TYPES - 2;
 1563|   257k|  else
 1564|   257k|    return EXT_PARTITION_TYPES;
 1565|   950k|}
decodeframe.c:partition_gather_vert_alike:
 1489|  60.5k|                                               BLOCK_SIZE bsize) {
 1490|  60.5k|  (void)bsize;
 1491|  60.5k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|  60.5k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  60.5k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1492|  60.5k|  out[0] -= cdf_element_prob(in, PARTITION_VERT);
 1493|  60.5k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1494|  60.5k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1495|  60.5k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1496|  60.5k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_B);
 1497|  60.5k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_VERT_4);
  ------------------
  |  Branch (1497:7): [True: 60.5k, False: 18.4E]
  ------------------
 1498|  60.5k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|  60.5k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|  60.5k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  60.5k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1499|  60.5k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|  60.5k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|  60.5k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  60.5k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1500|  60.5k|}
decodeframe.c:cdf_element_prob:
 1467|   728k|                                            size_t element) {
 1468|   728k|  assert(cdf != NULL);
 1469|  18.4E|  return (element > 0 ? cdf[element - 1] : CDF_PROB_TOP) - cdf[element];
  ------------------
  |  |   33|  18.4E|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  18.4E|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  |  Branch (1469:11): [True: 728k, False: 18.4E]
  ------------------
 1470|   728k|}
decodeframe.c:partition_gather_horz_alike:
 1474|  60.8k|                                               BLOCK_SIZE bsize) {
 1475|  60.8k|  (void)bsize;
 1476|  60.8k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|  60.8k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  60.8k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1477|  60.8k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ);
 1478|  60.8k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1479|  60.8k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1480|  60.8k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_B);
 1481|  60.8k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1482|  60.9k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_HORZ_4);
  ------------------
  |  Branch (1482:7): [True: 60.9k, False: 18.4E]
  ------------------
 1483|  60.8k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|  60.8k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|  60.8k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  60.8k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1484|  60.8k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|  60.8k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|  60.8k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  60.8k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1485|  60.8k|}
decodeframe.c:get_partition:
 1777|  1.04M|                                           BLOCK_SIZE bsize) {
 1778|  1.04M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1779|  1.04M|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols)
  ------------------
  |  Branch (1779:7): [True: 18.4E, False: 1.04M]
  |  Branch (1779:39): [True: 0, False: 1.04M]
  ------------------
 1780|      0|    return PARTITION_INVALID;
 1781|       |
 1782|  1.04M|  const int offset = mi_row * mi_params->mi_stride + mi_col;
 1783|  1.04M|  MB_MODE_INFO **mi = mi_params->mi_grid_base + offset;
 1784|  1.04M|  const BLOCK_SIZE subsize = mi[0]->bsize;
 1785|       |
 1786|  1.04M|  assert(bsize < BLOCK_SIZES_ALL);
 1787|       |
 1788|  1.04M|  if (subsize == bsize) return PARTITION_NONE;
  ------------------
  |  Branch (1788:7): [True: 697k, False: 347k]
  ------------------
 1789|       |
 1790|   347k|  const int bhigh = mi_size_high[bsize];
 1791|   347k|  const int bwide = mi_size_wide[bsize];
 1792|   347k|  const int sshigh = mi_size_high[subsize];
 1793|   347k|  const int sswide = mi_size_wide[subsize];
 1794|       |
 1795|   347k|  if (bsize > BLOCK_8X8 && mi_row + bwide / 2 < mi_params->mi_rows &&
  ------------------
  |  Branch (1795:7): [True: 345k, False: 1.35k]
  |  Branch (1795:28): [True: 246k, False: 99.1k]
  ------------------
 1796|   246k|      mi_col + bhigh / 2 < mi_params->mi_cols) {
  ------------------
  |  Branch (1796:7): [True: 190k, False: 56.4k]
  ------------------
 1797|       |    // In this case, the block might be using an extended partition
 1798|       |    // type.
 1799|   190k|    const MB_MODE_INFO *const mbmi_right = mi[bwide / 2];
 1800|   190k|    const MB_MODE_INFO *const mbmi_below = mi[bhigh / 2 * mi_params->mi_stride];
 1801|       |
 1802|   190k|    if (sswide == bwide) {
  ------------------
  |  Branch (1802:9): [True: 837, False: 189k]
  ------------------
 1803|       |      // Smaller height but same width. Is PARTITION_HORZ_4, PARTITION_HORZ or
 1804|       |      // PARTITION_HORZ_B. To distinguish the latter two, check if the lower
 1805|       |      // half was split.
 1806|    837|      if (sshigh * 4 == bhigh) return PARTITION_HORZ_4;
  ------------------
  |  Branch (1806:11): [True: 0, False: 837]
  ------------------
 1807|    837|      assert(sshigh * 2 == bhigh);
 1808|       |
 1809|    837|      if (mbmi_below->bsize == subsize)
  ------------------
  |  Branch (1809:11): [True: 837, False: 0]
  ------------------
 1810|    837|        return PARTITION_HORZ;
 1811|      0|      else
 1812|      0|        return PARTITION_HORZ_B;
 1813|   189k|    } else if (sshigh == bhigh) {
  ------------------
  |  Branch (1813:16): [True: 513, False: 188k]
  ------------------
 1814|       |      // Smaller width but same height. Is PARTITION_VERT_4, PARTITION_VERT or
 1815|       |      // PARTITION_VERT_B. To distinguish the latter two, check if the right
 1816|       |      // half was split.
 1817|    513|      if (sswide * 4 == bwide) return PARTITION_VERT_4;
  ------------------
  |  Branch (1817:11): [True: 0, False: 513]
  ------------------
 1818|    513|      assert(sswide * 2 == bwide);
 1819|       |
 1820|    513|      if (mbmi_right->bsize == subsize)
  ------------------
  |  Branch (1820:11): [True: 513, False: 0]
  ------------------
 1821|    513|        return PARTITION_VERT;
 1822|      0|      else
 1823|      0|        return PARTITION_VERT_B;
 1824|   188k|    } else {
 1825|       |      // Smaller width and smaller height. Might be PARTITION_SPLIT or could be
 1826|       |      // PARTITION_HORZ_A or PARTITION_VERT_A. If subsize isn't halved in both
 1827|       |      // dimensions, we immediately know this is a split (which will recurse to
 1828|       |      // get to subsize). Otherwise look down and to the right. With
 1829|       |      // PARTITION_VERT_A, the right block will have height bhigh; with
 1830|       |      // PARTITION_HORZ_A, the lower block with have width bwide. Otherwise
 1831|       |      // it's PARTITION_SPLIT.
 1832|   188k|      if (sswide * 2 != bwide || sshigh * 2 != bhigh) return PARTITION_SPLIT;
  ------------------
  |  Branch (1832:11): [True: 39.7k, False: 148k]
  |  Branch (1832:34): [True: 420, False: 148k]
  ------------------
 1833|       |
 1834|   148k|      if (mi_size_wide[mbmi_below->bsize] == bwide) return PARTITION_HORZ_A;
  ------------------
  |  Branch (1834:11): [True: 0, False: 148k]
  ------------------
 1835|   148k|      if (mi_size_high[mbmi_right->bsize] == bhigh) return PARTITION_VERT_A;
  ------------------
  |  Branch (1835:11): [True: 0, False: 148k]
  ------------------
 1836|       |
 1837|   148k|      return PARTITION_SPLIT;
 1838|   148k|    }
 1839|   190k|  }
 1840|   157k|  const int vert_split = sswide < bwide;
 1841|   157k|  const int horz_split = sshigh < bhigh;
 1842|   157k|  const int split_idx = (vert_split << 1) | horz_split;
 1843|   157k|  assert(split_idx != 0);
 1844|       |
 1845|   157k|  static const PARTITION_TYPE base_partitions[4] = {
 1846|   157k|    PARTITION_INVALID, PARTITION_HORZ, PARTITION_VERT, PARTITION_SPLIT
 1847|   157k|  };
 1848|       |
 1849|   157k|  return base_partitions[split_idx];
 1850|   347k|}
decodeframe.c:update_ext_partition_context:
 1505|  1.13M|                                                PARTITION_TYPE partition) {
 1506|  1.13M|  if (bsize >= BLOCK_8X8) {
  ------------------
  |  Branch (1506:7): [True: 1.11M, False: 14.7k]
  ------------------
 1507|  1.11M|    const int hbs = mi_size_wide[bsize] / 2;
 1508|  1.11M|    BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
 1509|  1.11M|    switch (partition) {
 1510|   358k|      case PARTITION_SPLIT:
  ------------------
  |  Branch (1510:7): [True: 358k, False: 759k]
  ------------------
 1511|   358k|        if (bsize != BLOCK_8X8) break;
  ------------------
  |  Branch (1511:13): [True: 355k, False: 3.70k]
  ------------------
 1512|  3.70k|        AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|  3.70k|  do {                           \
  |  |   53|  3.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 3.70k]
  |  |  ------------------
  ------------------
 1513|   743k|      case PARTITION_NONE:
  ------------------
  |  Branch (1513:7): [True: 740k, False: 378k]
  ------------------
 1514|   753k|      case PARTITION_HORZ:
  ------------------
  |  Branch (1514:7): [True: 9.63k, False: 1.10M]
  ------------------
 1515|   764k|      case PARTITION_VERT:
  ------------------
  |  Branch (1515:7): [True: 11.3k, False: 1.10M]
  ------------------
 1516|   764k|      case PARTITION_HORZ_4:
  ------------------
  |  Branch (1516:7): [True: 0, False: 1.11M]
  ------------------
 1517|   764k|      case PARTITION_VERT_4:
  ------------------
  |  Branch (1517:7): [True: 0, False: 1.11M]
  ------------------
 1518|   764k|        update_partition_context(xd, mi_row, mi_col, subsize, bsize);
 1519|   764k|        break;
 1520|      0|      case PARTITION_HORZ_A:
  ------------------
  |  Branch (1520:7): [True: 0, False: 1.11M]
  ------------------
 1521|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1522|      0|        update_partition_context(xd, mi_row + hbs, mi_col, subsize, subsize);
 1523|      0|        break;
 1524|      0|      case PARTITION_HORZ_B:
  ------------------
  |  Branch (1524:7): [True: 0, False: 1.11M]
  ------------------
 1525|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1526|      0|        update_partition_context(xd, mi_row + hbs, mi_col, bsize2, subsize);
 1527|      0|        break;
 1528|      0|      case PARTITION_VERT_A:
  ------------------
  |  Branch (1528:7): [True: 0, False: 1.11M]
  ------------------
 1529|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1530|      0|        update_partition_context(xd, mi_row, mi_col + hbs, subsize, subsize);
 1531|      0|        break;
 1532|      0|      case PARTITION_VERT_B:
  ------------------
  |  Branch (1532:7): [True: 0, False: 1.11M]
  ------------------
 1533|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1534|      0|        update_partition_context(xd, mi_row, mi_col + hbs, bsize2, subsize);
 1535|      0|        break;
 1536|      0|      default: assert(0 && "Invalid partition type");
  ------------------
  |  Branch (1536:7): [True: 0, False: 1.11M]
  ------------------
 1537|  1.11M|    }
 1538|  1.11M|  }
 1539|  1.13M|}
decodeframe.c:update_partition_context:
 1445|   764k|                                            BLOCK_SIZE bsize) {
 1446|   764k|  PARTITION_CONTEXT *const above_ctx = xd->above_partition_context + mi_col;
 1447|   764k|  PARTITION_CONTEXT *const left_ctx =
 1448|   764k|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|   764k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   764k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   764k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   764k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   764k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1449|       |
 1450|   764k|  const int bw = mi_size_wide[bsize];
 1451|   764k|  const int bh = mi_size_high[bsize];
 1452|   764k|  memset(above_ctx, partition_context_lookup[subsize].above, bw);
 1453|   764k|  memset(left_ctx, partition_context_lookup[subsize].left, bh);
 1454|   764k|}
decodeframe.c:av1_init_macroblockd:
 1287|  89.9k|static inline void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd) {
 1288|  89.9k|  const int num_planes = av1_num_planes(cm);
 1289|  89.9k|  const CommonQuantParams *const quant_params = &cm->quant_params;
 1290|       |
 1291|   250k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1291:19): [True: 160k, False: 89.9k]
  ------------------
 1292|   160k|    if (xd->plane[i].plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1292:9): [True: 89.9k, False: 70.6k]
  ------------------
 1293|  89.9k|      memcpy(xd->plane[i].seg_dequant_QTX, quant_params->y_dequant_QTX,
 1294|  89.9k|             sizeof(quant_params->y_dequant_QTX));
 1295|  89.9k|      memcpy(xd->plane[i].seg_iqmatrix, quant_params->y_iqmatrix,
 1296|  89.9k|             sizeof(quant_params->y_iqmatrix));
 1297|       |
 1298|  89.9k|    } else {
 1299|  70.6k|      if (i == AOM_PLANE_U) {
  ------------------
  |  |  282|  70.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (1299:11): [True: 35.6k, False: 35.0k]
  ------------------
 1300|  35.6k|        memcpy(xd->plane[i].seg_dequant_QTX, quant_params->u_dequant_QTX,
 1301|  35.6k|               sizeof(quant_params->u_dequant_QTX));
 1302|  35.6k|        memcpy(xd->plane[i].seg_iqmatrix, quant_params->u_iqmatrix,
 1303|  35.6k|               sizeof(quant_params->u_iqmatrix));
 1304|  35.6k|      } else {
 1305|  35.0k|        memcpy(xd->plane[i].seg_dequant_QTX, quant_params->v_dequant_QTX,
 1306|  35.0k|               sizeof(quant_params->v_dequant_QTX));
 1307|  35.0k|        memcpy(xd->plane[i].seg_iqmatrix, quant_params->v_iqmatrix,
 1308|  35.0k|               sizeof(quant_params->v_iqmatrix));
 1309|  35.0k|      }
 1310|  70.6k|    }
 1311|   160k|  }
 1312|  89.9k|  xd->mi_stride = cm->mi_params.mi_stride;
 1313|  89.9k|  xd->error_info = cm->error;
 1314|  89.9k|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 1315|  89.9k|  cfl_init(&xd->cfl, cm->seq_params);
 1316|  89.9k|#endif
 1317|  89.9k|}
decodemv.c:frame_is_intra_only:
 1176|   842k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   842k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 123k, False: 719k]
  ------------------
 1178|   719k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 719k]
  ------------------
 1179|   842k|}
decodemv.c:get_mi_grid_idx:
 1658|  48.6k|                                  int mi_row, int mi_col) {
 1659|  48.6k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|  48.6k|}
decodemv.c:av1_num_planes:
 1273|  23.0k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  23.0k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  17.6k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 5.39k, False: 17.6k]
  ------------------
 1275|  23.0k|}
decodemv.c:get_y_mode_cdf:
 1435|  61.8k|                                           const MB_MODE_INFO *left_mi) {
 1436|  61.8k|  const PREDICTION_MODE above = av1_above_block_mode(above_mi);
 1437|  61.8k|  const PREDICTION_MODE left = av1_left_block_mode(left_mi);
 1438|  61.8k|  const int above_ctx = intra_mode_context[above];
 1439|  61.8k|  const int left_ctx = intra_mode_context[left];
 1440|  61.8k|  return tile_ctx->kf_y_cdf[above_ctx][left_ctx];
 1441|  61.8k|}
decodemv.c:get_ref_scale_factors_const:
 1204|   191k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|   191k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|   191k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   191k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 191k, False: 18.4E]
  ------------------
 1207|   191k|}
decodemv.c:get_ref_frame_map_idx:
 1189|   191k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   191k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 191k, False: 18.4E]
  |  Branch (1190:38): [True: 191k, False: 18.4E]
  ------------------
 1191|   191k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   191k|}
decoder.c:calc_mi_size:
 1341|  76.4k|static inline int calc_mi_size(int len) {
 1342|       |  // len is in mi units. Align to a multiple of SBs.
 1343|  76.4k|  return ALIGN_POWER_OF_TWO(len, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|  76.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1344|  76.4k|}
decoder.c:av1_num_planes:
 1273|  6.08M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  6.08M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  2.27M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 3.81M, False: 2.27M]
  ------------------
 1275|  6.08M|}
decoder.c:assign_cur_frame_new_fb:
 1140|  28.0k|static inline RefCntBuffer *assign_cur_frame_new_fb(AV1_COMMON *const cm) {
 1141|       |  // Release the previously-used frame-buffer
 1142|  28.0k|  if (cm->cur_frame != NULL) {
  ------------------
  |  Branch (1142:7): [True: 0, False: 28.0k]
  ------------------
 1143|      0|    --cm->cur_frame->ref_count;
 1144|      0|    cm->cur_frame = NULL;
 1145|      0|  }
 1146|       |
 1147|       |  // Assign a new framebuffer
 1148|  28.0k|  const int new_fb_idx = get_free_fb(cm);
 1149|  28.0k|  if (new_fb_idx == INVALID_IDX) return NULL;
  ------------------
  |  |   15|  28.0k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1149:7): [True: 0, False: 28.0k]
  ------------------
 1150|       |
 1151|  28.0k|  cm->cur_frame = &cm->buffer_pool->frame_bufs[new_fb_idx];
 1152|  28.0k|#if CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
 1153|  28.0k|  aom_invalidate_pyramid(cm->cur_frame->buf.y_pyramid);
 1154|  28.0k|  av1_invalidate_corner_list(cm->cur_frame->buf.corners);
 1155|  28.0k|#endif  // CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
 1156|  28.0k|  av1_zero(cm->cur_frame->interp_filter_selected);
  ------------------
  |  |   43|  28.0k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1157|  28.0k|  return cm->cur_frame;
 1158|  28.0k|}
decoder.c:get_free_fb:
 1106|  28.0k|static inline int get_free_fb(AV1_COMMON *cm) {
 1107|  28.0k|  RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
 1108|  28.0k|  int i;
 1109|       |
 1110|  28.0k|  lock_buffer_pool(cm->buffer_pool);
 1111|  28.0k|  const int num_frame_bufs = cm->buffer_pool->num_frame_bufs;
 1112|  56.1k|  for (i = 0; i < num_frame_bufs; ++i)
  ------------------
  |  Branch (1112:15): [True: 56.1k, False: 0]
  ------------------
 1113|  56.1k|    if (frame_bufs[i].ref_count == 0) break;
  ------------------
  |  Branch (1113:9): [True: 28.0k, False: 28.0k]
  ------------------
 1114|       |
 1115|  28.0k|  if (i != num_frame_bufs) {
  ------------------
  |  Branch (1115:7): [True: 28.0k, False: 0]
  ------------------
 1116|  28.0k|    if (frame_bufs[i].buf.use_external_reference_buffers) {
  ------------------
  |  Branch (1116:9): [True: 0, False: 28.0k]
  ------------------
 1117|       |      // If this frame buffer's y_buffer, u_buffer, and v_buffer point to the
 1118|       |      // external reference buffers. Restore the buffer pointers to point to the
 1119|       |      // internally allocated memory.
 1120|      0|      YV12_BUFFER_CONFIG *ybf = &frame_bufs[i].buf;
 1121|      0|      ybf->y_buffer = ybf->store_buf_adr[0];
 1122|      0|      ybf->u_buffer = ybf->store_buf_adr[1];
 1123|      0|      ybf->v_buffer = ybf->store_buf_adr[2];
 1124|      0|      ybf->use_external_reference_buffers = 0;
 1125|      0|    }
 1126|       |
 1127|  28.0k|    frame_bufs[i].ref_count = 1;
 1128|  28.0k|  } else {
 1129|       |    // We should never run out of free buffers. If this assertion fails, there
 1130|       |    // is a reference leak.
 1131|      0|    assert(0 && "Ran out of free frame buffers. Likely a reference leak.");
 1132|       |    // Reset i to be INVALID_IDX to indicate no free buffer found.
 1133|      0|    i = INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1134|      0|  }
 1135|       |
 1136|  28.0k|  unlock_buffer_pool(cm->buffer_pool);
 1137|  28.0k|  return i;
 1138|  28.0k|}
decoder.c:lock_buffer_pool:
 1084|  56.1k|static void lock_buffer_pool(BufferPool *const pool) {
 1085|  56.1k|#if CONFIG_MULTITHREAD
 1086|  56.1k|  pthread_mutex_lock(&pool->pool_mutex);
 1087|       |#else
 1088|       |  (void)pool;
 1089|       |#endif
 1090|  56.1k|}
decoder.c:unlock_buffer_pool:
 1092|  56.1k|static void unlock_buffer_pool(BufferPool *const pool) {
 1093|  56.1k|#if CONFIG_MULTITHREAD
 1094|  56.1k|  pthread_mutex_unlock(&pool->pool_mutex);
 1095|       |#else
 1096|       |  (void)pool;
 1097|       |#endif
 1098|  56.1k|}
obu.c:is_valid_seq_level_idx:
 1878|  28.0k|static inline int is_valid_seq_level_idx(AV1_LEVEL seq_level_idx) {
 1879|  28.0k|  return seq_level_idx == SEQ_LEVEL_MAX ||
  ------------------
  |  Branch (1879:10): [True: 0, False: 28.0k]
  ------------------
 1880|  28.0k|         (seq_level_idx < SEQ_LEVELS &&
  ------------------
  |  Branch (1880:11): [True: 28.0k, False: 0]
  ------------------
 1881|       |          // The following levels are currently undefined.
 1882|  28.0k|          seq_level_idx != SEQ_LEVEL_2_2 && seq_level_idx != SEQ_LEVEL_2_3 &&
  ------------------
  |  Branch (1882:11): [True: 28.0k, False: 0]
  |  Branch (1882:45): [True: 28.0k, False: 0]
  ------------------
 1883|  28.0k|          seq_level_idx != SEQ_LEVEL_3_2 && seq_level_idx != SEQ_LEVEL_3_3 &&
  ------------------
  |  Branch (1883:11): [True: 28.0k, False: 0]
  |  Branch (1883:45): [True: 28.0k, False: 0]
  ------------------
 1884|  28.0k|          seq_level_idx != SEQ_LEVEL_4_2 && seq_level_idx != SEQ_LEVEL_4_3
  ------------------
  |  Branch (1884:11): [True: 28.0k, False: 0]
  |  Branch (1884:45): [True: 28.0k, False: 0]
  ------------------
 1885|  28.0k|#if !CONFIG_CWG_C013
 1886|  28.0k|          && seq_level_idx != SEQ_LEVEL_7_0 && seq_level_idx != SEQ_LEVEL_7_1 &&
  ------------------
  |  Branch (1886:14): [True: 28.0k, False: 0]
  |  Branch (1886:48): [True: 28.0k, False: 0]
  ------------------
 1887|  28.0k|          seq_level_idx != SEQ_LEVEL_7_2 && seq_level_idx != SEQ_LEVEL_7_3 &&
  ------------------
  |  Branch (1887:11): [True: 28.0k, False: 0]
  |  Branch (1887:45): [True: 28.0k, False: 0]
  ------------------
 1888|  28.0k|          seq_level_idx != SEQ_LEVEL_8_0 && seq_level_idx != SEQ_LEVEL_8_1 &&
  ------------------
  |  Branch (1888:11): [True: 28.0k, False: 0]
  |  Branch (1888:45): [True: 28.0k, False: 0]
  ------------------
 1889|  28.0k|          seq_level_idx != SEQ_LEVEL_8_2 && seq_level_idx != SEQ_LEVEL_8_3
  ------------------
  |  Branch (1889:11): [True: 28.0k, False: 0]
  |  Branch (1889:45): [True: 28.0k, False: 0]
  ------------------
 1890|  28.0k|#endif
 1891|  28.0k|         );
 1892|  28.0k|}
av1_cx_iface.c:is_valid_seq_level_idx:
 1878|  3.80M|static inline int is_valid_seq_level_idx(AV1_LEVEL seq_level_idx) {
 1879|  3.80M|  return seq_level_idx == SEQ_LEVEL_MAX ||
  ------------------
  |  Branch (1879:10): [True: 3.80M, False: 0]
  ------------------
 1880|      0|         (seq_level_idx < SEQ_LEVELS &&
  ------------------
  |  Branch (1880:11): [True: 0, False: 0]
  ------------------
 1881|       |          // The following levels are currently undefined.
 1882|      0|          seq_level_idx != SEQ_LEVEL_2_2 && seq_level_idx != SEQ_LEVEL_2_3 &&
  ------------------
  |  Branch (1882:11): [True: 0, False: 0]
  |  Branch (1882:45): [True: 0, False: 0]
  ------------------
 1883|      0|          seq_level_idx != SEQ_LEVEL_3_2 && seq_level_idx != SEQ_LEVEL_3_3 &&
  ------------------
  |  Branch (1883:11): [True: 0, False: 0]
  |  Branch (1883:45): [True: 0, False: 0]
  ------------------
 1884|      0|          seq_level_idx != SEQ_LEVEL_4_2 && seq_level_idx != SEQ_LEVEL_4_3
  ------------------
  |  Branch (1884:11): [True: 0, False: 0]
  |  Branch (1884:45): [True: 0, False: 0]
  ------------------
 1885|      0|#if !CONFIG_CWG_C013
 1886|      0|          && seq_level_idx != SEQ_LEVEL_7_0 && seq_level_idx != SEQ_LEVEL_7_1 &&
  ------------------
  |  Branch (1886:14): [True: 0, False: 0]
  |  Branch (1886:48): [True: 0, False: 0]
  ------------------
 1887|      0|          seq_level_idx != SEQ_LEVEL_7_2 && seq_level_idx != SEQ_LEVEL_7_3 &&
  ------------------
  |  Branch (1887:11): [True: 0, False: 0]
  |  Branch (1887:45): [True: 0, False: 0]
  ------------------
 1888|      0|          seq_level_idx != SEQ_LEVEL_8_0 && seq_level_idx != SEQ_LEVEL_8_1 &&
  ------------------
  |  Branch (1888:11): [True: 0, False: 0]
  |  Branch (1888:45): [True: 0, False: 0]
  ------------------
 1889|      0|          seq_level_idx != SEQ_LEVEL_8_2 && seq_level_idx != SEQ_LEVEL_8_3
  ------------------
  |  Branch (1889:11): [True: 0, False: 0]
  |  Branch (1889:45): [True: 0, False: 0]
  ------------------
 1890|      0|#endif
 1891|      0|         );
 1892|  3.80M|}
av1_cx_iface.c:frame_is_intra_only:
 1176|  73.6k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  73.6k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 18.4k, False: 55.2k]
  ------------------
 1178|  55.2k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 55.2k]
  ------------------
 1179|  73.6k|}
bitstream.c:frame_is_sframe:
 1181|   220k|static inline int frame_is_sframe(const AV1_COMMON *cm) {
 1182|   220k|  return cm->current_frame.frame_type == S_FRAME;
 1183|   220k|}
bitstream.c:frame_is_intra_only:
 1176|  2.62M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  2.62M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 419k, False: 2.20M]
  ------------------
 1178|  2.20M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 2.20M]
  ------------------
 1179|  2.62M|}
bitstream.c:get_ref_frame_buf:
 1196|   196k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   196k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   196k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   196k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 196k, False: 0]
  ------------------
 1199|   196k|}
bitstream.c:get_ref_frame_map_idx:
 1189|  4.32M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  4.32M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 4.32M, False: 18.4E]
  |  Branch (1190:38): [True: 4.32M, False: 18.4E]
  ------------------
 1191|  4.32M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  4.32M|}
bitstream.c:frame_might_allow_ref_frame_mvs:
 1224|  55.2k|static inline int frame_might_allow_ref_frame_mvs(const AV1_COMMON *cm) {
 1225|  55.2k|  return !cm->features.error_resilient_mode &&
  ------------------
  |  Branch (1225:10): [True: 55.2k, False: 0]
  ------------------
 1226|  55.2k|         cm->seq_params->order_hint_info.enable_ref_frame_mvs &&
  ------------------
  |  Branch (1226:10): [True: 55.2k, False: 0]
  ------------------
 1227|  55.2k|         cm->seq_params->order_hint_info.enable_order_hint &&
  ------------------
  |  Branch (1227:10): [True: 55.2k, False: 0]
  ------------------
 1228|  55.2k|         !frame_is_intra_only(cm);
  ------------------
  |  Branch (1228:10): [True: 55.2k, False: 0]
  ------------------
 1229|  55.2k|}
bitstream.c:get_primary_ref_frame_buf:
 1216|  40.8k|    const AV1_COMMON *const cm) {
 1217|  40.8k|  const int primary_ref_frame = cm->features.primary_ref_frame;
 1218|  40.8k|  if (primary_ref_frame == PRIMARY_REF_NONE) return NULL;
  ------------------
  |  |   66|  40.8k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1218:7): [True: 40.8k, False: 0]
  ------------------
 1219|      0|  const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame + 1);
 1220|      0|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1220:10): [True: 0, False: 0]
  ------------------
 1221|  40.8k|}
bitstream.c:frame_might_allow_warped_motion:
 1232|  73.6k|static inline int frame_might_allow_warped_motion(const AV1_COMMON *cm) {
 1233|  73.6k|  return !cm->features.error_resilient_mode && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (1233:10): [True: 73.6k, False: 0]
  |  Branch (1233:48): [True: 55.2k, False: 18.4k]
  ------------------
 1234|  55.2k|         cm->seq_params->enable_warped_motion;
  ------------------
  |  Branch (1234:10): [True: 55.2k, False: 0]
  ------------------
 1235|  73.6k|}
bitstream.c:av1_num_planes:
 1273|  11.3M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  11.3M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  3.92M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 7.38M, False: 3.92M]
  ------------------
 1275|  11.3M|}
bitstream.c:av1_zero_above_context:
 1597|   117k|                                          const int tile_row) {
 1598|   117k|  const SequenceHeader *const seq_params = cm->seq_params;
 1599|   117k|  const int num_planes = av1_num_planes(cm);
 1600|   117k|  const int width = mi_col_end - mi_col_start;
 1601|   117k|  const int aligned_width =
 1602|   117k|      ALIGN_POWER_OF_TWO(width, seq_params->mib_size_log2);
  ------------------
  |  |   69|   117k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1603|   117k|  const int offset_y = mi_col_start;
 1604|   117k|  const int width_y = aligned_width;
 1605|   117k|  const int offset_uv = offset_y >> seq_params->subsampling_x;
 1606|   117k|  const int width_uv = width_y >> seq_params->subsampling_x;
 1607|   117k|  CommonContexts *const above_contexts = &cm->above_contexts;
 1608|       |
 1609|   117k|  av1_zero_array(above_contexts->entropy[0][tile_row] + offset_y, width_y);
  ------------------
  |  |   44|   117k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1610|   117k|  if (num_planes > 1) {
  ------------------
  |  Branch (1610:7): [True: 45.6k, False: 71.8k]
  ------------------
 1611|  45.6k|    if (above_contexts->entropy[1][tile_row] &&
  ------------------
  |  Branch (1611:9): [True: 45.6k, False: 18.4E]
  ------------------
 1612|  45.7k|        above_contexts->entropy[2][tile_row]) {
  ------------------
  |  Branch (1612:9): [True: 45.7k, False: 18.4E]
  ------------------
 1613|  45.7k|      av1_zero_array(above_contexts->entropy[1][tile_row] + offset_uv,
  ------------------
  |  |   44|  45.7k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1614|  45.7k|                     width_uv);
 1615|  45.7k|      av1_zero_array(above_contexts->entropy[2][tile_row] + offset_uv,
  ------------------
  |  |   44|  45.7k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1616|  45.7k|                     width_uv);
 1617|  18.4E|    } else {
 1618|  18.4E|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1619|  18.4E|                         "Invalid value of planes");
 1620|  18.4E|    }
 1621|  45.6k|  }
 1622|       |
 1623|   117k|  av1_zero_array(above_contexts->partition[tile_row] + mi_col_start,
  ------------------
  |  |   44|   117k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1624|   117k|                 aligned_width);
 1625|       |
 1626|   117k|  memset(above_contexts->txfm[tile_row] + mi_col_start,
 1627|   117k|         tx_size_wide[TX_SIZES_LARGEST], aligned_width * sizeof(TXFM_CONTEXT));
 1628|   117k|}
bitstream.c:av1_init_above_context:
 1279|   117k|                                          MACROBLOCKD *xd) {
 1280|   326k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1280:19): [True: 208k, False: 117k]
  ------------------
 1281|   208k|    xd->above_entropy_context[i] = above_contexts->entropy[i][tile_row];
 1282|   208k|  }
 1283|   117k|  xd->above_partition_context = above_contexts->partition[tile_row];
 1284|   117k|  xd->above_txfm_context = above_contexts->txfm[tile_row];
 1285|   117k|}
bitstream.c:av1_zero_left_context:
 1630|   126k|static inline void av1_zero_left_context(MACROBLOCKD *const xd) {
 1631|   126k|  av1_zero(xd->left_entropy_context);
  ------------------
  |  |   43|   126k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1632|   126k|  av1_zero(xd->left_partition_context);
  ------------------
  |  |   43|   126k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1633|       |
 1634|   126k|  memset(xd->left_txfm_context_buffer, tx_size_high[TX_SIZES_LARGEST],
 1635|   126k|         sizeof(xd->left_txfm_context_buffer));
 1636|   126k|}
bitstream.c:get_partition:
 1777|  3.86M|                                           BLOCK_SIZE bsize) {
 1778|  3.86M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1779|  3.86M|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols)
  ------------------
  |  Branch (1779:7): [True: 519k, False: 3.34M]
  |  Branch (1779:39): [True: 391k, False: 2.95M]
  ------------------
 1780|   916k|    return PARTITION_INVALID;
 1781|       |
 1782|  2.94M|  const int offset = mi_row * mi_params->mi_stride + mi_col;
 1783|  2.94M|  MB_MODE_INFO **mi = mi_params->mi_grid_base + offset;
 1784|  2.94M|  const BLOCK_SIZE subsize = mi[0]->bsize;
 1785|       |
 1786|  2.94M|  assert(bsize < BLOCK_SIZES_ALL);
 1787|       |
 1788|  2.94M|  if (subsize == bsize) return PARTITION_NONE;
  ------------------
  |  Branch (1788:7): [True: 1.96M, False: 980k]
  ------------------
 1789|       |
 1790|   980k|  const int bhigh = mi_size_high[bsize];
 1791|   980k|  const int bwide = mi_size_wide[bsize];
 1792|   980k|  const int sshigh = mi_size_high[subsize];
 1793|   980k|  const int sswide = mi_size_wide[subsize];
 1794|       |
 1795|   980k|  if (bsize > BLOCK_8X8 && mi_row + bwide / 2 < mi_params->mi_rows &&
  ------------------
  |  Branch (1795:7): [True: 975k, False: 4.67k]
  |  Branch (1795:28): [True: 694k, False: 280k]
  ------------------
 1796|   694k|      mi_col + bhigh / 2 < mi_params->mi_cols) {
  ------------------
  |  Branch (1796:7): [True: 532k, False: 162k]
  ------------------
 1797|       |    // In this case, the block might be using an extended partition
 1798|       |    // type.
 1799|   532k|    const MB_MODE_INFO *const mbmi_right = mi[bwide / 2];
 1800|   532k|    const MB_MODE_INFO *const mbmi_below = mi[bhigh / 2 * mi_params->mi_stride];
 1801|       |
 1802|   532k|    if (sswide == bwide) {
  ------------------
  |  Branch (1802:9): [True: 2.21k, False: 530k]
  ------------------
 1803|       |      // Smaller height but same width. Is PARTITION_HORZ_4, PARTITION_HORZ or
 1804|       |      // PARTITION_HORZ_B. To distinguish the latter two, check if the lower
 1805|       |      // half was split.
 1806|  2.21k|      if (sshigh * 4 == bhigh) return PARTITION_HORZ_4;
  ------------------
  |  Branch (1806:11): [True: 0, False: 2.21k]
  ------------------
 1807|  2.21k|      assert(sshigh * 2 == bhigh);
 1808|       |
 1809|  2.21k|      if (mbmi_below->bsize == subsize)
  ------------------
  |  Branch (1809:11): [True: 2.21k, False: 0]
  ------------------
 1810|  2.21k|        return PARTITION_HORZ;
 1811|      0|      else
 1812|      0|        return PARTITION_HORZ_B;
 1813|   530k|    } else if (sshigh == bhigh) {
  ------------------
  |  Branch (1813:16): [True: 1.43k, False: 528k]
  ------------------
 1814|       |      // Smaller width but same height. Is PARTITION_VERT_4, PARTITION_VERT or
 1815|       |      // PARTITION_VERT_B. To distinguish the latter two, check if the right
 1816|       |      // half was split.
 1817|  1.43k|      if (sswide * 4 == bwide) return PARTITION_VERT_4;
  ------------------
  |  Branch (1817:11): [True: 0, False: 1.43k]
  ------------------
 1818|  1.43k|      assert(sswide * 2 == bwide);
 1819|       |
 1820|  1.43k|      if (mbmi_right->bsize == subsize)
  ------------------
  |  Branch (1820:11): [True: 1.43k, False: 0]
  ------------------
 1821|  1.43k|        return PARTITION_VERT;
 1822|      0|      else
 1823|      0|        return PARTITION_VERT_B;
 1824|   528k|    } else {
 1825|       |      // Smaller width and smaller height. Might be PARTITION_SPLIT or could be
 1826|       |      // PARTITION_HORZ_A or PARTITION_VERT_A. If subsize isn't halved in both
 1827|       |      // dimensions, we immediately know this is a split (which will recurse to
 1828|       |      // get to subsize). Otherwise look down and to the right. With
 1829|       |      // PARTITION_VERT_A, the right block will have height bhigh; with
 1830|       |      // PARTITION_HORZ_A, the lower block with have width bwide. Otherwise
 1831|       |      // it's PARTITION_SPLIT.
 1832|   528k|      if (sswide * 2 != bwide || sshigh * 2 != bhigh) return PARTITION_SPLIT;
  ------------------
  |  Branch (1832:11): [True: 111k, False: 416k]
  |  Branch (1832:34): [True: 1.17k, False: 415k]
  ------------------
 1833|       |
 1834|   415k|      if (mi_size_wide[mbmi_below->bsize] == bwide) return PARTITION_HORZ_A;
  ------------------
  |  Branch (1834:11): [True: 0, False: 415k]
  ------------------
 1835|   415k|      if (mi_size_high[mbmi_right->bsize] == bhigh) return PARTITION_VERT_A;
  ------------------
  |  Branch (1835:11): [True: 0, False: 415k]
  ------------------
 1836|       |
 1837|   415k|      return PARTITION_SPLIT;
 1838|   415k|    }
 1839|   532k|  }
 1840|   447k|  const int vert_split = sswide < bwide;
 1841|   447k|  const int horz_split = sshigh < bhigh;
 1842|   447k|  const int split_idx = (vert_split << 1) | horz_split;
 1843|   447k|  assert(split_idx != 0);
 1844|       |
 1845|   447k|  static const PARTITION_TYPE base_partitions[4] = {
 1846|   447k|    PARTITION_INVALID, PARTITION_HORZ, PARTITION_VERT, PARTITION_SPLIT
 1847|   447k|  };
 1848|       |
 1849|   447k|  return base_partitions[split_idx];
 1850|   980k|}
bitstream.c:partition_plane_context:
 1542|  2.90M|                                          int mi_col, BLOCK_SIZE bsize) {
 1543|  2.90M|  const PARTITION_CONTEXT *above_ctx = xd->above_partition_context + mi_col;
 1544|  2.90M|  const PARTITION_CONTEXT *left_ctx =
 1545|  2.90M|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  2.90M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  2.90M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.90M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.90M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  2.90M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1546|       |  // Minimum partition point is 8x8. Offset the bsl accordingly.
 1547|  2.90M|  const int bsl = mi_size_wide_log2[bsize] - mi_size_wide_log2[BLOCK_8X8];
 1548|  2.90M|  int above = (*above_ctx >> bsl) & 1, left = (*left_ctx >> bsl) & 1;
 1549|       |
 1550|  2.90M|  assert(mi_size_wide_log2[bsize] == mi_size_high_log2[bsize]);
 1551|  2.90M|  assert(bsl >= 0);
 1552|       |
 1553|  2.90M|  return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
  ------------------
  |  |  169|  2.90M|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  ------------------
 1554|  2.90M|}
bitstream.c:partition_cdf_length:
 1558|  2.46M|static inline int partition_cdf_length(BLOCK_SIZE bsize) {
 1559|  2.46M|  if (bsize <= BLOCK_8X8)
  ------------------
  |  Branch (1559:7): [True: 1.78M, False: 681k]
  ------------------
 1560|  1.78M|    return PARTITION_TYPES;
 1561|   681k|  else if (bsize == BLOCK_128X128)
  ------------------
  |  Branch (1561:12): [True: 0, False: 681k]
  ------------------
 1562|      0|    return EXT_PARTITION_TYPES - 2;
 1563|   681k|  else
 1564|   681k|    return EXT_PARTITION_TYPES;
 1565|  2.46M|}
bitstream.c:partition_gather_vert_alike:
 1489|   159k|                                               BLOCK_SIZE bsize) {
 1490|   159k|  (void)bsize;
 1491|   159k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|   159k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   159k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1492|   159k|  out[0] -= cdf_element_prob(in, PARTITION_VERT);
 1493|   159k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1494|   159k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1495|   159k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1496|   159k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_B);
 1497|   159k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_VERT_4);
  ------------------
  |  Branch (1497:7): [True: 159k, False: 18.4E]
  ------------------
 1498|   159k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|   159k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   159k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   159k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1499|   159k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|   159k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   159k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   159k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1500|   159k|}
bitstream.c:cdf_element_prob:
 1467|  1.93M|                                            size_t element) {
 1468|  1.93M|  assert(cdf != NULL);
 1469|  18.4E|  return (element > 0 ? cdf[element - 1] : CDF_PROB_TOP) - cdf[element];
  ------------------
  |  |   33|  18.4E|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  18.4E|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  |  Branch (1469:11): [True: 1.93M, False: 18.4E]
  ------------------
 1470|  1.93M|}
bitstream.c:partition_gather_horz_alike:
 1474|   162k|                                               BLOCK_SIZE bsize) {
 1475|   162k|  (void)bsize;
 1476|   162k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|   162k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   162k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1477|   162k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ);
 1478|   162k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1479|   162k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1480|   162k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_B);
 1481|   162k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1482|   162k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_HORZ_4);
  ------------------
  |  Branch (1482:7): [True: 162k, False: 18.4E]
  ------------------
 1483|   162k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|   162k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   162k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   162k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1484|   162k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|   162k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   162k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   162k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1485|   162k|}
bitstream.c:set_mi_row_col:
 1360|  2.03M|                                  int mi_rows, int mi_cols) {
 1361|  2.03M|  xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE);
  ------------------
  |  |   29|  2.03M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1362|  2.03M|  xd->mb_to_bottom_edge = GET_MV_SUBPEL((mi_rows - bh - mi_row) * MI_SIZE);
  ------------------
  |  |   29|  2.03M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1363|  2.03M|  xd->mb_to_left_edge = -GET_MV_SUBPEL((mi_col * MI_SIZE));
  ------------------
  |  |   29|  2.03M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1364|  2.03M|  xd->mb_to_right_edge = GET_MV_SUBPEL((mi_cols - bw - mi_col) * MI_SIZE);
  ------------------
  |  |   29|  2.03M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1365|       |
 1366|  2.03M|  xd->mi_row = mi_row;
 1367|  2.03M|  xd->mi_col = mi_col;
 1368|       |
 1369|       |  // Are edges available for intra prediction?
 1370|  2.03M|  xd->up_available = (mi_row > tile->mi_row_start);
 1371|       |
 1372|  2.03M|  const int ss_x = xd->plane[1].subsampling_x;
 1373|  2.03M|  const int ss_y = xd->plane[1].subsampling_y;
 1374|       |
 1375|  2.03M|  xd->left_available = (mi_col > tile->mi_col_start);
 1376|  2.03M|  xd->chroma_up_available = xd->up_available;
 1377|  2.03M|  xd->chroma_left_available = xd->left_available;
 1378|  2.03M|  if (ss_x && bw < mi_size_wide[BLOCK_8X8])
  ------------------
  |  Branch (1378:7): [True: 1.87M, False: 154k]
  |  Branch (1378:15): [True: 30.3k, False: 1.84M]
  ------------------
 1379|  30.3k|    xd->chroma_left_available = (mi_col - 1) > tile->mi_col_start;
 1380|  2.03M|  if (ss_y && bh < mi_size_high[BLOCK_8X8])
  ------------------
  |  Branch (1380:7): [True: 1.66M, False: 366k]
  |  Branch (1380:15): [True: 19.0k, False: 1.64M]
  ------------------
 1381|  19.0k|    xd->chroma_up_available = (mi_row - 1) > tile->mi_row_start;
 1382|  2.03M|  if (xd->up_available) {
  ------------------
  |  Branch (1382:7): [True: 1.59M, False: 433k]
  ------------------
 1383|  1.59M|    xd->above_mbmi = xd->mi[-xd->mi_stride];
 1384|  1.59M|  } else {
 1385|   433k|    xd->above_mbmi = NULL;
 1386|   433k|  }
 1387|       |
 1388|  2.03M|  if (xd->left_available) {
  ------------------
  |  Branch (1388:7): [True: 1.60M, False: 427k]
  ------------------
 1389|  1.60M|    xd->left_mbmi = xd->mi[-1];
 1390|  1.60M|  } else {
 1391|   427k|    xd->left_mbmi = NULL;
 1392|   427k|  }
 1393|       |
 1394|  2.03M|  const int chroma_ref = ((mi_row & 0x01) || !(bh & 0x01) || !ss_y) &&
  ------------------
  |  Branch (1394:27): [True: 18.0k, False: 2.01M]
  |  Branch (1394:46): [True: 1.99M, False: 24.4k]
  |  Branch (1394:62): [True: 14.8k, False: 9.54k]
  ------------------
 1395|  2.02M|                         ((mi_col & 0x01) || !(bw & 0x01) || !ss_x);
  ------------------
  |  Branch (1395:27): [True: 19.3k, False: 2.00M]
  |  Branch (1395:46): [True: 1.99M, False: 19.3k]
  |  Branch (1395:62): [True: 7.88k, False: 11.4k]
  ------------------
 1396|  2.03M|  xd->is_chroma_ref = chroma_ref;
 1397|  2.03M|  if (chroma_ref) {
  ------------------
  |  Branch (1397:7): [True: 2.01M, False: 14.8k]
  ------------------
 1398|       |    // To help calculate the "above" and "left" chroma blocks, note that the
 1399|       |    // current block may cover multiple luma blocks (e.g., if partitioned into
 1400|       |    // 4x4 luma blocks).
 1401|       |    // First, find the top-left-most luma block covered by this chroma block
 1402|  2.01M|    MB_MODE_INFO **base_mi =
 1403|  2.01M|        &xd->mi[-(mi_row & ss_y) * xd->mi_stride - (mi_col & ss_x)];
 1404|       |
 1405|       |    // Then, we consider the luma region covered by the left or above 4x4 chroma
 1406|       |    // prediction. We want to point to the chroma reference block in that
 1407|       |    // region, which is the bottom-right-most mi unit.
 1408|       |    // This leads to the following offsets:
 1409|  2.01M|    MB_MODE_INFO *chroma_above_mi =
 1410|  2.01M|        xd->chroma_up_available ? base_mi[-xd->mi_stride + ss_x] : NULL;
  ------------------
  |  Branch (1410:9): [True: 1.58M, False: 435k]
  ------------------
 1411|  2.01M|    xd->chroma_above_mbmi = chroma_above_mi;
 1412|       |
 1413|  2.01M|    MB_MODE_INFO *chroma_left_mi =
 1414|  2.01M|        xd->chroma_left_available ? base_mi[ss_y * xd->mi_stride - 1] : NULL;
  ------------------
  |  Branch (1414:9): [True: 1.58M, False: 430k]
  ------------------
 1415|  2.01M|    xd->chroma_left_mbmi = chroma_left_mi;
 1416|  2.01M|  }
 1417|       |
 1418|  2.03M|  xd->height = bh;
 1419|  2.03M|  xd->width = bw;
 1420|       |
 1421|  2.03M|  xd->is_last_vertical_rect = 0;
 1422|  2.03M|  if (xd->width < xd->height) {
  ------------------
  |  Branch (1422:7): [True: 35.9k, False: 1.99M]
  ------------------
 1423|  35.9k|    if (!((mi_col + xd->width) & (xd->height - 1))) {
  ------------------
  |  Branch (1423:9): [True: 5.08k, False: 30.8k]
  ------------------
 1424|  5.08k|      xd->is_last_vertical_rect = 1;
 1425|  5.08k|    }
 1426|  35.9k|  }
 1427|       |
 1428|  2.03M|  xd->is_first_horizontal_rect = 0;
 1429|  2.03M|  if (xd->width > xd->height)
  ------------------
  |  Branch (1429:7): [True: 34.6k, False: 1.99M]
  ------------------
 1430|  34.6k|    if (!(mi_row & (xd->width - 1))) xd->is_first_horizontal_rect = 1;
  ------------------
  |  Branch (1430:9): [True: 27.3k, False: 7.22k]
  ------------------
 1431|  2.03M|}
bitstream.c:get_mi_grid_idx:
 1658|   129k|                                  int mi_row, int mi_col) {
 1659|   129k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|   129k|}
bitstream.c:get_y_mode_cdf:
 1435|   163k|                                           const MB_MODE_INFO *left_mi) {
 1436|   163k|  const PREDICTION_MODE above = av1_above_block_mode(above_mi);
 1437|   163k|  const PREDICTION_MODE left = av1_left_block_mode(left_mi);
 1438|   163k|  const int above_ctx = intra_mode_context[above];
 1439|   163k|  const int left_ctx = intra_mode_context[left];
 1440|   163k|  return tile_ctx->kf_y_cdf[above_ctx][left_ctx];
 1441|   163k|}
bitstream.c:get_ref_scale_factors_const:
 1204|  3.74M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  3.74M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  3.74M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  3.74M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 3.74M, False: 271]
  ------------------
 1207|  3.74M|}
bitstream.c:max_block_high:
 1582|  1.99M|                                 int plane) {
 1583|  1.99M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  1.99M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 40.5k, False: 1.95M]
  ------------------
 1586|  40.5k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  40.5k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  40.5k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  1.99M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.99M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  1.99M|}
bitstream.c:max_block_wide:
 1568|  1.99M|                                 int plane) {
 1569|  1.99M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  1.99M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  1.99M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 49.4k, False: 1.94M]
  ------------------
 1573|  49.4k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  49.4k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  49.4k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  1.99M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.99M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  1.99M|}
bitstream.c:txfm_partition_update:
 1688|   598k|                                         TX_SIZE tx_size, TX_SIZE txb_size) {
 1689|   598k|  BLOCK_SIZE bsize = txsize_to_bsize[txb_size];
 1690|   598k|  int bh = mi_size_high[bsize];
 1691|   598k|  int bw = mi_size_wide[bsize];
 1692|   598k|  uint8_t txw = tx_size_wide[tx_size];
 1693|   598k|  uint8_t txh = tx_size_high[tx_size];
 1694|   598k|  int i;
 1695|  1.81M|  for (i = 0; i < bh; ++i) left_ctx[i] = txh;
  ------------------
  |  Branch (1695:15): [True: 1.21M, False: 598k]
  ------------------
 1696|  1.81M|  for (i = 0; i < bw; ++i) above_ctx[i] = txw;
  ------------------
  |  Branch (1696:15): [True: 1.21M, False: 598k]
  ------------------
 1697|   598k|}
bitstream.c:txfm_partition_context:
 1751|   587k|                                         BLOCK_SIZE bsize, TX_SIZE tx_size) {
 1752|   587k|  const uint8_t txw = tx_size_wide[tx_size];
 1753|   587k|  const uint8_t txh = tx_size_high[tx_size];
 1754|   587k|  const int above = *above_ctx < txw;
 1755|   587k|  const int left = *left_ctx < txh;
 1756|   587k|  int category = TXFM_PARTITION_CONTEXTS;
  ------------------
  |  |  521|   587k|#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 3)
  ------------------
 1757|       |
 1758|       |  // dummy return, not used by others.
 1759|   587k|  if (tx_size <= TX_4X4) return 0;
  ------------------
  |  Branch (1759:7): [True: 0, False: 587k]
  ------------------
 1760|       |
 1761|   587k|  TX_SIZE max_tx_size =
 1762|   587k|      get_sqr_tx_size(AOMMAX(block_size_wide[bsize], block_size_high[bsize]));
  ------------------
  |  |   35|   587k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 30.1k, False: 557k]
  |  |  ------------------
  ------------------
 1763|       |
 1764|   587k|  if (max_tx_size >= TX_8X8) {
  ------------------
  |  Branch (1764:7): [True: 587k, False: 18.4E]
  ------------------
 1765|   587k|    category =
 1766|   587k|        (txsize_sqr_up_map[tx_size] != max_tx_size && max_tx_size > TX_8X8) +
  ------------------
  |  Branch (1766:10): [True: 265k, False: 321k]
  |  Branch (1766:55): [True: 265k, False: 18.4E]
  ------------------
 1767|   587k|        (TX_SIZES - 1 - max_tx_size) * 2;
 1768|   587k|  }
 1769|       |  assert(category != TXFM_PARTITION_CONTEXTS);
 1770|   587k|  return category * 3 + above + left;
 1771|   587k|}
bitstream.c:get_sqr_tx_size:
 1699|   587k|static inline TX_SIZE get_sqr_tx_size(int tx_dim) {
 1700|   587k|  switch (tx_dim) {
 1701|      0|    case 128:
  ------------------
  |  Branch (1701:5): [True: 0, False: 587k]
  ------------------
 1702|  1.29k|    case 64: return TX_64X64; break;
  ------------------
  |  Branch (1702:5): [True: 1.29k, False: 586k]
  ------------------
 1703|  40.3k|    case 32: return TX_32X32; break;
  ------------------
  |  Branch (1703:5): [True: 40.3k, False: 547k]
  ------------------
 1704|   301k|    case 16: return TX_16X16; break;
  ------------------
  |  Branch (1704:5): [True: 301k, False: 286k]
  ------------------
 1705|   245k|    case 8: return TX_8X8; break;
  ------------------
  |  Branch (1705:5): [True: 245k, False: 342k]
  ------------------
 1706|      0|    default: return TX_4X4;
  ------------------
  |  Branch (1706:5): [True: 0, False: 587k]
  ------------------
 1707|   587k|  }
 1708|   587k|}
bitstream.c:set_txfm_ctxs:
 1644|  1.70M|                                 const MACROBLOCKD *xd) {
 1645|  1.70M|  uint8_t bw = tx_size_wide[tx_size];
 1646|  1.70M|  uint8_t bh = tx_size_high[tx_size];
 1647|       |
 1648|  1.70M|  if (skip) {
  ------------------
  |  Branch (1648:7): [True: 42.5k, False: 1.66M]
  ------------------
 1649|  42.5k|    bw = n4_w * MI_SIZE;
  ------------------
  |  |   40|  42.5k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.5k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1650|  42.5k|    bh = n4_h * MI_SIZE;
  ------------------
  |  |   40|  42.5k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.5k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1651|  42.5k|  }
 1652|       |
 1653|  1.70M|  set_txfm_ctx(xd->above_txfm_context, bw, n4_w);
 1654|  1.70M|  set_txfm_ctx(xd->left_txfm_context, bh, n4_h);
 1655|  1.70M|}
bitstream.c:set_txfm_ctx:
 1638|  3.40M|static inline void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
 1639|  3.40M|  int i;
 1640|  10.7M|  for (i = 0; i < len; ++i) txfm_ctx[i] = txs;
  ------------------
  |  Branch (1640:15): [True: 7.33M, False: 3.40M]
  ------------------
 1641|  3.40M|}
bitstream.c:update_ext_partition_context:
 1505|  2.94M|                                                PARTITION_TYPE partition) {
 1506|  2.94M|  if (bsize >= BLOCK_8X8) {
  ------------------
  |  Branch (1506:7): [True: 2.90M, False: 38.5k]
  ------------------
 1507|  2.90M|    const int hbs = mi_size_wide[bsize] / 2;
 1508|  2.90M|    BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
 1509|  2.90M|    switch (partition) {
 1510|   935k|      case PARTITION_SPLIT:
  ------------------
  |  Branch (1510:7): [True: 935k, False: 1.97M]
  ------------------
 1511|   935k|        if (bsize != BLOCK_8X8) break;
  ------------------
  |  Branch (1511:13): [True: 926k, False: 9.68k]
  ------------------
 1512|  9.68k|        AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|  9.68k|  do {                           \
  |  |   53|  9.68k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 9.68k]
  |  |  ------------------
  ------------------
 1513|  1.92M|      case PARTITION_NONE:
  ------------------
  |  Branch (1513:7): [True: 1.91M, False: 988k]
  ------------------
 1514|  1.95M|      case PARTITION_HORZ:
  ------------------
  |  Branch (1514:7): [True: 27.3k, False: 2.88M]
  ------------------
 1515|  1.98M|      case PARTITION_VERT:
  ------------------
  |  Branch (1515:7): [True: 30.8k, False: 2.87M]
  ------------------
 1516|  1.98M|      case PARTITION_HORZ_4:
  ------------------
  |  Branch (1516:7): [True: 0, False: 2.90M]
  ------------------
 1517|  1.98M|      case PARTITION_VERT_4:
  ------------------
  |  Branch (1517:7): [True: 0, False: 2.90M]
  ------------------
 1518|  1.98M|        update_partition_context(xd, mi_row, mi_col, subsize, bsize);
 1519|  1.98M|        break;
 1520|      0|      case PARTITION_HORZ_A:
  ------------------
  |  Branch (1520:7): [True: 0, False: 2.90M]
  ------------------
 1521|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1522|      0|        update_partition_context(xd, mi_row + hbs, mi_col, subsize, subsize);
 1523|      0|        break;
 1524|      0|      case PARTITION_HORZ_B:
  ------------------
  |  Branch (1524:7): [True: 0, False: 2.90M]
  ------------------
 1525|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1526|      0|        update_partition_context(xd, mi_row + hbs, mi_col, bsize2, subsize);
 1527|      0|        break;
 1528|      0|      case PARTITION_VERT_A:
  ------------------
  |  Branch (1528:7): [True: 0, False: 2.90M]
  ------------------
 1529|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1530|      0|        update_partition_context(xd, mi_row, mi_col + hbs, subsize, subsize);
 1531|      0|        break;
 1532|      0|      case PARTITION_VERT_B:
  ------------------
  |  Branch (1532:7): [True: 0, False: 2.90M]
  ------------------
 1533|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1534|      0|        update_partition_context(xd, mi_row, mi_col + hbs, bsize2, subsize);
 1535|      0|        break;
 1536|      0|      default: assert(0 && "Invalid partition type");
  ------------------
  |  Branch (1536:7): [True: 0, False: 2.90M]
  ------------------
 1537|  2.90M|    }
 1538|  2.90M|  }
 1539|  2.94M|}
bitstream.c:update_partition_context:
 1445|  1.98M|                                            BLOCK_SIZE bsize) {
 1446|  1.98M|  PARTITION_CONTEXT *const above_ctx = xd->above_partition_context + mi_col;
 1447|  1.98M|  PARTITION_CONTEXT *const left_ctx =
 1448|  1.98M|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  1.98M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  1.98M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.98M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  1.98M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  1.98M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1449|       |
 1450|  1.98M|  const int bw = mi_size_wide[bsize];
 1451|  1.98M|  const int bh = mi_size_high[bsize];
 1452|  1.98M|  memset(above_ctx, partition_context_lookup[subsize].above, bw);
 1453|  1.98M|  memset(left_ctx, partition_context_lookup[subsize].left, bh);
 1454|  1.98M|}
context_tree.c:av1_num_planes:
 1273|  2.83M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  2.83M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  1.30M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 1.52M, False: 1.30M]
  ------------------
 1275|  2.83M|}
encodeframe.c:av1_num_planes:
 1273|   520k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   520k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   222k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 298k, False: 222k]
  ------------------
 1275|   520k|}
encodeframe.c:av1_zero_left_context:
 1630|   126k|static inline void av1_zero_left_context(MACROBLOCKD *const xd) {
 1631|   126k|  av1_zero(xd->left_entropy_context);
  ------------------
  |  |   43|   126k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1632|   126k|  av1_zero(xd->left_partition_context);
  ------------------
  |  |   43|   126k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1633|       |
 1634|   126k|  memset(xd->left_txfm_context_buffer, tx_size_high[TX_SIZES_LARGEST],
 1635|   126k|         sizeof(xd->left_txfm_context_buffer));
 1636|   126k|}
encodeframe.c:get_mi_grid_idx:
 1658|   211k|                                  int mi_row, int mi_col) {
 1659|   211k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|   211k|}
encodeframe.c:get_alloc_mi_idx:
 1663|  73.6k|                                   int mi_row, int mi_col) {
 1664|  73.6k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|  73.6k|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|  73.6k|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|  73.6k|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|  73.6k|}
encodeframe.c:av1_zero_above_context:
 1597|  21.8k|                                          const int tile_row) {
 1598|  21.8k|  const SequenceHeader *const seq_params = cm->seq_params;
 1599|  21.8k|  const int num_planes = av1_num_planes(cm);
 1600|  21.8k|  const int width = mi_col_end - mi_col_start;
 1601|  21.8k|  const int aligned_width =
 1602|  21.8k|      ALIGN_POWER_OF_TWO(width, seq_params->mib_size_log2);
  ------------------
  |  |   69|  21.8k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1603|  21.8k|  const int offset_y = mi_col_start;
 1604|  21.8k|  const int width_y = aligned_width;
 1605|  21.8k|  const int offset_uv = offset_y >> seq_params->subsampling_x;
 1606|  21.8k|  const int width_uv = width_y >> seq_params->subsampling_x;
 1607|  21.8k|  CommonContexts *const above_contexts = &cm->above_contexts;
 1608|       |
 1609|  21.8k|  av1_zero_array(above_contexts->entropy[0][tile_row] + offset_y, width_y);
  ------------------
  |  |   44|  21.8k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1610|  21.8k|  if (num_planes > 1) {
  ------------------
  |  Branch (1610:7): [True: 8.02k, False: 13.8k]
  ------------------
 1611|  8.02k|    if (above_contexts->entropy[1][tile_row] &&
  ------------------
  |  Branch (1611:9): [True: 8.02k, False: 0]
  ------------------
 1612|  8.02k|        above_contexts->entropy[2][tile_row]) {
  ------------------
  |  Branch (1612:9): [True: 8.02k, False: 0]
  ------------------
 1613|  8.02k|      av1_zero_array(above_contexts->entropy[1][tile_row] + offset_uv,
  ------------------
  |  |   44|  8.02k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1614|  8.02k|                     width_uv);
 1615|  8.02k|      av1_zero_array(above_contexts->entropy[2][tile_row] + offset_uv,
  ------------------
  |  |   44|  8.02k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1616|  8.02k|                     width_uv);
 1617|  8.02k|    } else {
 1618|      0|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1619|      0|                         "Invalid value of planes");
 1620|      0|    }
 1621|  8.02k|  }
 1622|       |
 1623|  21.8k|  av1_zero_array(above_contexts->partition[tile_row] + mi_col_start,
  ------------------
  |  |   44|  21.8k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1624|  21.8k|                 aligned_width);
 1625|       |
 1626|  21.8k|  memset(above_contexts->txfm[tile_row] + mi_col_start,
 1627|  21.8k|         tx_size_wide[TX_SIZES_LARGEST], aligned_width * sizeof(TXFM_CONTEXT));
 1628|  21.8k|}
encodeframe.c:av1_init_above_context:
 1279|  21.8k|                                          MACROBLOCKD *xd) {
 1280|  59.7k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1280:19): [True: 37.8k, False: 21.8k]
  ------------------
 1281|  37.8k|    xd->above_entropy_context[i] = above_contexts->entropy[i][tile_row];
 1282|  37.8k|  }
 1283|  21.8k|  xd->above_partition_context = above_contexts->partition[tile_row];
 1284|  21.8k|  xd->above_txfm_context = above_contexts->txfm[tile_row];
 1285|  21.8k|}
encodeframe.c:frame_is_intra_only:
 1176|   626k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   626k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 136k, False: 489k]
  ------------------
 1178|   489k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 489k]
  ------------------
 1179|   626k|}
encodeframe.c:set_mi_offsets:
 1674|  73.6k|                                  int mi_col) {
 1675|       |  // 'mi_grid_base' should point to appropriate memory in 'mi'.
 1676|  73.6k|  const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
 1677|  73.6k|  const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
 1678|  73.6k|  mi_params->mi_grid_base[mi_grid_idx] = &mi_params->mi_alloc[mi_alloc_idx];
 1679|       |  // 'xd->mi' should point to an offset in 'mi_grid_base';
 1680|  73.6k|  xd->mi = mi_params->mi_grid_base + mi_grid_idx;
 1681|       |  // 'xd->tx_type_map' should point to an offset in 'mi_params->tx_type_map'.
 1682|  73.6k|  xd->tx_type_map = mi_params->tx_type_map + mi_grid_idx;
 1683|  73.6k|  xd->tx_type_map_stride = mi_params->mi_stride;
 1684|  73.6k|}
encodeframe.c:is_coded_lossless:
 1863|  73.6k|                                    const MACROBLOCKD *xd) {
 1864|  73.6k|  int coded_lossless = 1;
 1865|  73.6k|  if (cm->seg.enabled) {
  ------------------
  |  Branch (1865:7): [True: 0, False: 73.6k]
  ------------------
 1866|      0|    for (int i = 0; i < MAX_SEGMENTS; ++i) {
  ------------------
  |  |   23|      0|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (1866:21): [True: 0, False: 0]
  ------------------
 1867|      0|      if (!xd->lossless[i]) {
  ------------------
  |  Branch (1867:11): [True: 0, False: 0]
  ------------------
 1868|      0|        coded_lossless = 0;
 1869|      0|        break;
 1870|      0|      }
 1871|      0|    }
 1872|  73.6k|  } else {
 1873|  73.6k|    coded_lossless = xd->lossless[0];
 1874|  73.6k|  }
 1875|  73.6k|  return coded_lossless;
 1876|  73.6k|}
encodeframe.c:get_ref_frame_buf:
 1196|   441k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   441k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   441k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   441k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 441k, False: 0]
  ------------------
 1199|   441k|}
encodeframe.c:get_ref_frame_map_idx:
 1189|   441k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   441k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 441k, False: 0]
  |  Branch (1190:38): [True: 441k, False: 0]
  ------------------
 1191|   441k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|   441k|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   441k|}
encodeframe_utils.c:av1_num_planes:
 1273|  6.63M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  6.63M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  2.84M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 3.79M, False: 2.84M]
  ------------------
 1275|  6.63M|}
encodeframe_utils.c:get_mi_grid_idx:
 1658|  2.04M|                                  int mi_row, int mi_col) {
 1659|  2.04M|  return mi_row * mi_params->mi_stride + mi_col;
 1660|  2.04M|}
encodeframe_utils.c:frame_is_intra_only:
 1176|  4.30M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  4.30M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 369k, False: 3.93M]
  ------------------
 1178|  3.93M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 3.93M]
  ------------------
 1179|  4.30M|}
encodeframe_utils.c:get_y_mode_cdf:
 1435|   164k|                                           const MB_MODE_INFO *left_mi) {
 1436|   164k|  const PREDICTION_MODE above = av1_above_block_mode(above_mi);
 1437|   164k|  const PREDICTION_MODE left = av1_left_block_mode(left_mi);
 1438|   164k|  const int above_ctx = intra_mode_context[above];
 1439|   164k|  const int left_ctx = intra_mode_context[left];
 1440|   164k|  return tile_ctx->kf_y_cdf[above_ctx][left_ctx];
 1441|   164k|}
encodeframe_utils.c:get_partition:
 1777|   299k|                                           BLOCK_SIZE bsize) {
 1778|   299k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1779|   299k|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols)
  ------------------
  |  Branch (1779:7): [True: 18.4E, False: 299k]
  |  Branch (1779:39): [True: 18.4E, False: 299k]
  ------------------
 1780|      0|    return PARTITION_INVALID;
 1781|       |
 1782|   299k|  const int offset = mi_row * mi_params->mi_stride + mi_col;
 1783|   299k|  MB_MODE_INFO **mi = mi_params->mi_grid_base + offset;
 1784|   299k|  const BLOCK_SIZE subsize = mi[0]->bsize;
 1785|       |
 1786|   299k|  assert(bsize < BLOCK_SIZES_ALL);
 1787|       |
 1788|   299k|  if (subsize == bsize) return PARTITION_NONE;
  ------------------
  |  Branch (1788:7): [True: 254k, False: 45.0k]
  ------------------
 1789|       |
 1790|  45.0k|  const int bhigh = mi_size_high[bsize];
 1791|  45.0k|  const int bwide = mi_size_wide[bsize];
 1792|  45.0k|  const int sshigh = mi_size_high[subsize];
 1793|  45.0k|  const int sswide = mi_size_wide[subsize];
 1794|       |
 1795|  45.1k|  if (bsize > BLOCK_8X8 && mi_row + bwide / 2 < mi_params->mi_rows &&
  ------------------
  |  Branch (1795:7): [True: 45.1k, False: 18.4E]
  |  Branch (1795:28): [True: 30.9k, False: 14.2k]
  ------------------
 1796|  30.9k|      mi_col + bhigh / 2 < mi_params->mi_cols) {
  ------------------
  |  Branch (1796:7): [True: 23.5k, False: 7.34k]
  ------------------
 1797|       |    // In this case, the block might be using an extended partition
 1798|       |    // type.
 1799|  23.5k|    const MB_MODE_INFO *const mbmi_right = mi[bwide / 2];
 1800|  23.5k|    const MB_MODE_INFO *const mbmi_below = mi[bhigh / 2 * mi_params->mi_stride];
 1801|       |
 1802|  23.5k|    if (sswide == bwide) {
  ------------------
  |  Branch (1802:9): [True: 11, False: 23.5k]
  ------------------
 1803|       |      // Smaller height but same width. Is PARTITION_HORZ_4, PARTITION_HORZ or
 1804|       |      // PARTITION_HORZ_B. To distinguish the latter two, check if the lower
 1805|       |      // half was split.
 1806|     11|      if (sshigh * 4 == bhigh) return PARTITION_HORZ_4;
  ------------------
  |  Branch (1806:11): [True: 0, False: 11]
  ------------------
 1807|     11|      assert(sshigh * 2 == bhigh);
 1808|       |
 1809|     11|      if (mbmi_below->bsize == subsize)
  ------------------
  |  Branch (1809:11): [True: 11, False: 0]
  ------------------
 1810|     11|        return PARTITION_HORZ;
 1811|      0|      else
 1812|      0|        return PARTITION_HORZ_B;
 1813|  23.5k|    } else if (sshigh == bhigh) {
  ------------------
  |  Branch (1813:16): [True: 10, False: 23.5k]
  ------------------
 1814|       |      // Smaller width but same height. Is PARTITION_VERT_4, PARTITION_VERT or
 1815|       |      // PARTITION_VERT_B. To distinguish the latter two, check if the right
 1816|       |      // half was split.
 1817|     10|      if (sswide * 4 == bwide) return PARTITION_VERT_4;
  ------------------
  |  Branch (1817:11): [True: 0, False: 10]
  ------------------
 1818|     10|      assert(sswide * 2 == bwide);
 1819|       |
 1820|     10|      if (mbmi_right->bsize == subsize)
  ------------------
  |  Branch (1820:11): [True: 10, False: 0]
  ------------------
 1821|     10|        return PARTITION_VERT;
 1822|      0|      else
 1823|      0|        return PARTITION_VERT_B;
 1824|  23.5k|    } else {
 1825|       |      // Smaller width and smaller height. Might be PARTITION_SPLIT or could be
 1826|       |      // PARTITION_HORZ_A or PARTITION_VERT_A. If subsize isn't halved in both
 1827|       |      // dimensions, we immediately know this is a split (which will recurse to
 1828|       |      // get to subsize). Otherwise look down and to the right. With
 1829|       |      // PARTITION_VERT_A, the right block will have height bhigh; with
 1830|       |      // PARTITION_HORZ_A, the lower block with have width bwide. Otherwise
 1831|       |      // it's PARTITION_SPLIT.
 1832|  23.5k|      if (sswide * 2 != bwide || sshigh * 2 != bhigh) return PARTITION_SPLIT;
  ------------------
  |  Branch (1832:11): [True: 3.42k, False: 20.1k]
  |  Branch (1832:34): [True: 2, False: 20.1k]
  ------------------
 1833|       |
 1834|  20.1k|      if (mi_size_wide[mbmi_below->bsize] == bwide) return PARTITION_HORZ_A;
  ------------------
  |  Branch (1834:11): [True: 0, False: 20.1k]
  ------------------
 1835|  20.1k|      if (mi_size_high[mbmi_right->bsize] == bhigh) return PARTITION_VERT_A;
  ------------------
  |  Branch (1835:11): [True: 0, False: 20.1k]
  ------------------
 1836|       |
 1837|  20.1k|      return PARTITION_SPLIT;
 1838|  20.1k|    }
 1839|  23.5k|  }
 1840|  21.4k|  const int vert_split = sswide < bwide;
 1841|  21.4k|  const int horz_split = sshigh < bhigh;
 1842|  21.4k|  const int split_idx = (vert_split << 1) | horz_split;
 1843|  21.4k|  assert(split_idx != 0);
 1844|       |
 1845|  21.4k|  static const PARTITION_TYPE base_partitions[4] = {
 1846|  21.4k|    PARTITION_INVALID, PARTITION_HORZ, PARTITION_VERT, PARTITION_SPLIT
 1847|  21.4k|  };
 1848|       |
 1849|  21.4k|  return base_partitions[split_idx];
 1850|  45.0k|}
encodemb.c:max_block_wide:
 1568|  7.86M|                                 int plane) {
 1569|  7.86M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  7.86M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  7.86M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 59.6k, False: 7.81M]
  ------------------
 1573|  59.6k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  59.6k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  59.6k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  7.86M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  7.86M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  7.86M|}
encodemb.c:max_block_high:
 1582|  7.86M|                                 int plane) {
 1583|  7.86M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  7.86M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 52.3k, False: 7.81M]
  ------------------
 1586|  52.3k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  52.3k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  52.3k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  7.86M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  7.86M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  7.86M|}
encodemb.c:av1_num_planes:
 1273|   940k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   940k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   254k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 686k, False: 254k]
  ------------------
 1275|   940k|}
encoder.c:av1_init_macroblockd:
 1287|   219k|static inline void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd) {
 1288|   219k|  const int num_planes = av1_num_planes(cm);
 1289|   219k|  const CommonQuantParams *const quant_params = &cm->quant_params;
 1290|       |
 1291|   606k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1291:19): [True: 387k, False: 219k]
  ------------------
 1292|   387k|    if (xd->plane[i].plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1292:9): [True: 352k, False: 34.6k]
  ------------------
 1293|   352k|      memcpy(xd->plane[i].seg_dequant_QTX, quant_params->y_dequant_QTX,
 1294|   352k|             sizeof(quant_params->y_dequant_QTX));
 1295|   352k|      memcpy(xd->plane[i].seg_iqmatrix, quant_params->y_iqmatrix,
 1296|   352k|             sizeof(quant_params->y_iqmatrix));
 1297|       |
 1298|   352k|    } else {
 1299|  34.6k|      if (i == AOM_PLANE_U) {
  ------------------
  |  |  282|  34.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (1299:11): [True: 17.3k, False: 17.3k]
  ------------------
 1300|  17.3k|        memcpy(xd->plane[i].seg_dequant_QTX, quant_params->u_dequant_QTX,
 1301|  17.3k|               sizeof(quant_params->u_dequant_QTX));
 1302|  17.3k|        memcpy(xd->plane[i].seg_iqmatrix, quant_params->u_iqmatrix,
 1303|  17.3k|               sizeof(quant_params->u_iqmatrix));
 1304|  17.3k|      } else {
 1305|  17.3k|        memcpy(xd->plane[i].seg_dequant_QTX, quant_params->v_dequant_QTX,
 1306|  17.3k|               sizeof(quant_params->v_dequant_QTX));
 1307|  17.3k|        memcpy(xd->plane[i].seg_iqmatrix, quant_params->v_iqmatrix,
 1308|  17.3k|               sizeof(quant_params->v_iqmatrix));
 1309|  17.3k|      }
 1310|  34.6k|    }
 1311|   387k|  }
 1312|   219k|  xd->mi_stride = cm->mi_params.mi_stride;
 1313|   219k|  xd->error_info = cm->error;
 1314|   219k|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 1315|   219k|  cfl_init(&xd->cfl, cm->seq_params);
 1316|   219k|#endif
 1317|   219k|}
encoder.c:set_sb_size:
 1853|   329k|                               BLOCK_SIZE sb_size) {
 1854|   329k|  seq_params->sb_size = sb_size;
 1855|   329k|  seq_params->mib_size = mi_size_wide[seq_params->sb_size];
 1856|   329k|  seq_params->mib_size_log2 = mi_size_wide_log2[seq_params->sb_size];
 1857|   329k|}
encoder.c:av1_num_planes:
 1273|   811k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   811k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   345k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 465k, False: 345k]
  ------------------
 1275|   811k|}
encoder.c:calc_mi_size:
 1341|   454k|static inline int calc_mi_size(int len) {
 1342|       |  // len is in mi units. Align to a multiple of SBs.
 1343|   454k|  return ALIGN_POWER_OF_TWO(len, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|   454k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1344|   454k|}
encoder.c:frame_is_intra_only:
 1176|  1.14M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  1.14M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 296k, False: 852k]
  ------------------
 1178|   852k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 852k]
  ------------------
 1179|  1.14M|}
encoder.c:ensure_mv_buffer:
 1237|   122k|static inline void ensure_mv_buffer(RefCntBuffer *buf, AV1_COMMON *cm) {
 1238|   122k|  const int buf_rows = buf->mi_rows;
 1239|   122k|  const int buf_cols = buf->mi_cols;
 1240|   122k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1241|       |
 1242|   122k|  if (buf->mvs == NULL || buf_rows != mi_params->mi_rows ||
  ------------------
  |  Branch (1242:7): [True: 41.9k, False: 80.9k]
  |  Branch (1242:27): [True: 29.5k, False: 51.3k]
  ------------------
 1243|  83.2k|      buf_cols != mi_params->mi_cols) {
  ------------------
  |  Branch (1243:7): [True: 11.7k, False: 39.6k]
  ------------------
 1244|  83.2k|    aom_free(buf->mvs);
 1245|  83.2k|    buf->mi_rows = mi_params->mi_rows;
 1246|  83.2k|    buf->mi_cols = mi_params->mi_cols;
 1247|  83.2k|    CHECK_MEM_ERROR(cm, buf->mvs,
  ------------------
  |  |   51|  83.2k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  83.2k|  do {                                                    \
  |  |  |  |   72|  83.2k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  83.2k|    lval = (expr);                                        \
  |  |  |  |   74|  83.2k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 83.2k]
  |  |  |  |  ------------------
  |  |  |  |   75|  83.2k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  83.2k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 83.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1248|  83.2k|                    (MV_REF *)aom_calloc(((mi_params->mi_rows + 1) >> 1) *
 1249|  83.2k|                                             ((mi_params->mi_cols + 1) >> 1),
 1250|  83.2k|                                         sizeof(*buf->mvs)));
 1251|  83.2k|    aom_free(buf->seg_map);
 1252|  83.2k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  83.2k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  83.2k|  do {                                                    \
  |  |  |  |   72|  83.2k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  83.2k|    lval = (expr);                                        \
  |  |  |  |   74|  83.2k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 83.2k]
  |  |  |  |  ------------------
  |  |  |  |   75|  83.2k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  83.2k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 83.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1253|  83.2k|        cm, buf->seg_map,
 1254|  83.2k|        (uint8_t *)aom_calloc(mi_params->mi_rows * mi_params->mi_cols,
 1255|  83.2k|                              sizeof(*buf->seg_map)));
 1256|  83.2k|  }
 1257|       |
 1258|   122k|  const int mem_size =
 1259|   122k|      ((mi_params->mi_rows + MAX_MIB_SIZE) >> 1) * (mi_params->mi_stride >> 1);
  ------------------
  |  |   44|   122k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|   122k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   122k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   122k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1260|       |
 1261|   122k|  if (cm->tpl_mvs == NULL || cm->tpl_mvs_mem_size < mem_size) {
  ------------------
  |  Branch (1261:7): [True: 18.4k, False: 104k]
  |  Branch (1261:30): [True: 7.17k, False: 97.2k]
  ------------------
 1262|  25.5k|    aom_free(cm->tpl_mvs);
 1263|       |    CHECK_MEM_ERROR(cm, cm->tpl_mvs,
  ------------------
  |  |   51|  25.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  25.5k|  do {                                                    \
  |  |  |  |   72|  25.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  25.5k|    lval = (expr);                                        \
  |  |  |  |   74|  25.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  25.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  25.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|  25.5k|                    (TPL_MV_REF *)aom_calloc(mem_size, sizeof(*cm->tpl_mvs)));
 1265|  25.5k|    cm->tpl_mvs_mem_size = mem_size;
 1266|  25.5k|  }
 1267|   122k|}
encoder.c:get_ref_frame_buf:
 1196|   859k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   859k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   859k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   859k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 859k, False: 0]
  ------------------
 1199|   859k|}
encoder.c:get_ref_frame_map_idx:
 1189|  1.79M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  1.79M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 1.79M, False: 0]
  |  Branch (1190:38): [True: 1.79M, False: 0]
  ------------------
 1191|  1.79M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  1.79M|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  1.79M|}
encoder.c:get_ref_scale_factors:
 1210|   644k|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|   644k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|   644k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   644k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 644k, False: 0]
  ------------------
 1213|   644k|}
encoder.c:get_ref_scale_factors_const:
 1204|   245k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|   245k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|   245k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   245k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 245k, False: 0]
  ------------------
 1207|   245k|}
encoder.c:frame_might_allow_ref_frame_mvs:
 1224|  73.6k|static inline int frame_might_allow_ref_frame_mvs(const AV1_COMMON *cm) {
 1225|  73.6k|  return !cm->features.error_resilient_mode &&
  ------------------
  |  Branch (1225:10): [True: 73.6k, False: 0]
  ------------------
 1226|  73.6k|         cm->seq_params->order_hint_info.enable_ref_frame_mvs &&
  ------------------
  |  Branch (1226:10): [True: 73.6k, False: 0]
  ------------------
 1227|  73.6k|         cm->seq_params->order_hint_info.enable_order_hint &&
  ------------------
  |  Branch (1227:10): [True: 73.6k, False: 0]
  ------------------
 1228|  73.6k|         !frame_is_intra_only(cm);
  ------------------
  |  Branch (1228:10): [True: 55.2k, False: 18.4k]
  ------------------
 1229|  73.6k|}
encoder.c:frame_might_allow_warped_motion:
 1232|  73.6k|static inline int frame_might_allow_warped_motion(const AV1_COMMON *cm) {
 1233|  73.6k|  return !cm->features.error_resilient_mode && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (1233:10): [True: 73.6k, False: 0]
  |  Branch (1233:48): [True: 55.2k, False: 18.4k]
  ------------------
 1234|  55.2k|         cm->seq_params->enable_warped_motion;
  ------------------
  |  Branch (1234:10): [True: 55.2k, False: 0]
  ------------------
 1235|  73.6k|}
encoder.c:frame_is_sframe:
 1181|   128k|static inline int frame_is_sframe(const AV1_COMMON *cm) {
 1182|   128k|  return cm->current_frame.frame_type == S_FRAME;
 1183|   128k|}
encoder.c:get_primary_ref_frame_buf:
 1216|  73.6k|    const AV1_COMMON *const cm) {
 1217|  73.6k|  const int primary_ref_frame = cm->features.primary_ref_frame;
 1218|  73.6k|  if (primary_ref_frame == PRIMARY_REF_NONE) return NULL;
  ------------------
  |  |   66|  73.6k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1218:7): [True: 43.0k, False: 30.6k]
  ------------------
 1219|  30.6k|  const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame + 1);
 1220|  30.6k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  30.6k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1220:10): [True: 30.6k, False: 0]
  ------------------
 1221|  73.6k|}
encoder.c:assign_frame_buffer_p:
 1163|   202k|                                         RefCntBuffer *rhs_ptr) {
 1164|   202k|  RefCntBuffer *const old_ptr = *lhs_ptr;
 1165|   202k|  if (old_ptr != NULL) {
  ------------------
  |  Branch (1165:7): [True: 55.2k, False: 147k]
  ------------------
 1166|  55.2k|    assert(old_ptr->ref_count > 0);
 1167|       |    // One less reference to the buffer at 'old_ptr', so decrease ref count.
 1168|  55.2k|    --old_ptr->ref_count;
 1169|  55.2k|  }
 1170|       |
 1171|   202k|  *lhs_ptr = rhs_ptr;
 1172|       |  // One more reference to the buffer at 'rhs_ptr', so increase ref count.
 1173|   202k|  ++rhs_ptr->ref_count;
 1174|   202k|}
encoder.c:assign_cur_frame_new_fb:
 1140|  92.0k|static inline RefCntBuffer *assign_cur_frame_new_fb(AV1_COMMON *const cm) {
 1141|       |  // Release the previously-used frame-buffer
 1142|  92.0k|  if (cm->cur_frame != NULL) {
  ------------------
  |  Branch (1142:7): [True: 73.6k, False: 18.4k]
  ------------------
 1143|  73.6k|    --cm->cur_frame->ref_count;
 1144|  73.6k|    cm->cur_frame = NULL;
 1145|  73.6k|  }
 1146|       |
 1147|       |  // Assign a new framebuffer
 1148|  92.0k|  const int new_fb_idx = get_free_fb(cm);
 1149|  92.0k|  if (new_fb_idx == INVALID_IDX) return NULL;
  ------------------
  |  |   15|  92.0k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1149:7): [True: 0, False: 92.0k]
  ------------------
 1150|       |
 1151|  92.0k|  cm->cur_frame = &cm->buffer_pool->frame_bufs[new_fb_idx];
 1152|  92.0k|#if CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
 1153|  92.0k|  aom_invalidate_pyramid(cm->cur_frame->buf.y_pyramid);
 1154|  92.0k|  av1_invalidate_corner_list(cm->cur_frame->buf.corners);
 1155|  92.0k|#endif  // CONFIG_AV1_ENCODER && !CONFIG_REALTIME_ONLY
 1156|  92.0k|  av1_zero(cm->cur_frame->interp_filter_selected);
  ------------------
  |  |   43|  92.0k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1157|  92.0k|  return cm->cur_frame;
 1158|  92.0k|}
encoder.c:get_free_fb:
 1106|  92.0k|static inline int get_free_fb(AV1_COMMON *cm) {
 1107|  92.0k|  RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
 1108|  92.0k|  int i;
 1109|       |
 1110|  92.0k|  lock_buffer_pool(cm->buffer_pool);
 1111|  92.0k|  const int num_frame_bufs = cm->buffer_pool->num_frame_bufs;
 1112|   202k|  for (i = 0; i < num_frame_bufs; ++i)
  ------------------
  |  Branch (1112:15): [True: 202k, False: 0]
  ------------------
 1113|   202k|    if (frame_bufs[i].ref_count == 0) break;
  ------------------
  |  Branch (1113:9): [True: 92.0k, False: 110k]
  ------------------
 1114|       |
 1115|  92.0k|  if (i != num_frame_bufs) {
  ------------------
  |  Branch (1115:7): [True: 92.0k, False: 0]
  ------------------
 1116|  92.0k|    if (frame_bufs[i].buf.use_external_reference_buffers) {
  ------------------
  |  Branch (1116:9): [True: 0, False: 92.0k]
  ------------------
 1117|       |      // If this frame buffer's y_buffer, u_buffer, and v_buffer point to the
 1118|       |      // external reference buffers. Restore the buffer pointers to point to the
 1119|       |      // internally allocated memory.
 1120|      0|      YV12_BUFFER_CONFIG *ybf = &frame_bufs[i].buf;
 1121|      0|      ybf->y_buffer = ybf->store_buf_adr[0];
 1122|      0|      ybf->u_buffer = ybf->store_buf_adr[1];
 1123|      0|      ybf->v_buffer = ybf->store_buf_adr[2];
 1124|      0|      ybf->use_external_reference_buffers = 0;
 1125|      0|    }
 1126|       |
 1127|  92.0k|    frame_bufs[i].ref_count = 1;
 1128|  92.0k|  } else {
 1129|       |    // We should never run out of free buffers. If this assertion fails, there
 1130|       |    // is a reference leak.
 1131|      0|    assert(0 && "Ran out of free frame buffers. Likely a reference leak.");
 1132|       |    // Reset i to be INVALID_IDX to indicate no free buffer found.
 1133|      0|    i = INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1134|      0|  }
 1135|       |
 1136|  92.0k|  unlock_buffer_pool(cm->buffer_pool);
 1137|  92.0k|  return i;
 1138|  92.0k|}
encoder.c:lock_buffer_pool:
 1084|  92.0k|static void lock_buffer_pool(BufferPool *const pool) {
 1085|  92.0k|#if CONFIG_MULTITHREAD
 1086|  92.0k|  pthread_mutex_lock(&pool->pool_mutex);
 1087|       |#else
 1088|       |  (void)pool;
 1089|       |#endif
 1090|  92.0k|}
encoder.c:unlock_buffer_pool:
 1092|  92.0k|static void unlock_buffer_pool(BufferPool *const pool) {
 1093|  92.0k|#if CONFIG_MULTITHREAD
 1094|  92.0k|  pthread_mutex_unlock(&pool->pool_mutex);
 1095|       |#else
 1096|       |  (void)pool;
 1097|       |#endif
 1098|  92.0k|}
encoder_utils.c:frame_is_intra_only:
 1176|   220k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   220k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 55.2k, False: 165k]
  ------------------
 1178|   165k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 165k]
  ------------------
 1179|   220k|}
encoder_utils.c:av1_num_planes:
 1273|  55.2k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  55.2k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  20.9k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 34.2k, False: 20.9k]
  ------------------
 1275|  55.2k|}
encoder_utils.c:get_ref_frame_buf:
 1196|  65.4k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  65.4k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  65.4k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  65.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 65.4k, False: 0]
  ------------------
 1199|  65.4k|}
encoder_utils.c:get_ref_frame_map_idx:
 1189|   126k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   126k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 126k, False: 0]
  |  Branch (1190:38): [True: 126k, False: 0]
  ------------------
 1191|   126k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|   126k|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   126k|}
encoder_utils.c:get_free_fb:
 1106|  44.9k|static inline int get_free_fb(AV1_COMMON *cm) {
 1107|  44.9k|  RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
 1108|  44.9k|  int i;
 1109|       |
 1110|  44.9k|  lock_buffer_pool(cm->buffer_pool);
 1111|  44.9k|  const int num_frame_bufs = cm->buffer_pool->num_frame_bufs;
 1112|   166k|  for (i = 0; i < num_frame_bufs; ++i)
  ------------------
  |  Branch (1112:15): [True: 166k, False: 0]
  ------------------
 1113|   166k|    if (frame_bufs[i].ref_count == 0) break;
  ------------------
  |  Branch (1113:9): [True: 44.9k, False: 121k]
  ------------------
 1114|       |
 1115|  44.9k|  if (i != num_frame_bufs) {
  ------------------
  |  Branch (1115:7): [True: 44.9k, False: 0]
  ------------------
 1116|  44.9k|    if (frame_bufs[i].buf.use_external_reference_buffers) {
  ------------------
  |  Branch (1116:9): [True: 0, False: 44.9k]
  ------------------
 1117|       |      // If this frame buffer's y_buffer, u_buffer, and v_buffer point to the
 1118|       |      // external reference buffers. Restore the buffer pointers to point to the
 1119|       |      // internally allocated memory.
 1120|      0|      YV12_BUFFER_CONFIG *ybf = &frame_bufs[i].buf;
 1121|      0|      ybf->y_buffer = ybf->store_buf_adr[0];
 1122|      0|      ybf->u_buffer = ybf->store_buf_adr[1];
 1123|      0|      ybf->v_buffer = ybf->store_buf_adr[2];
 1124|      0|      ybf->use_external_reference_buffers = 0;
 1125|      0|    }
 1126|       |
 1127|  44.9k|    frame_bufs[i].ref_count = 1;
 1128|  44.9k|  } else {
 1129|       |    // We should never run out of free buffers. If this assertion fails, there
 1130|       |    // is a reference leak.
 1131|      0|    assert(0 && "Ran out of free frame buffers. Likely a reference leak.");
 1132|       |    // Reset i to be INVALID_IDX to indicate no free buffer found.
 1133|      0|    i = INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1134|      0|  }
 1135|       |
 1136|  44.9k|  unlock_buffer_pool(cm->buffer_pool);
 1137|  44.9k|  return i;
 1138|  44.9k|}
encoder_utils.c:lock_buffer_pool:
 1084|  44.9k|static void lock_buffer_pool(BufferPool *const pool) {
 1085|  44.9k|#if CONFIG_MULTITHREAD
 1086|  44.9k|  pthread_mutex_lock(&pool->pool_mutex);
 1087|       |#else
 1088|       |  (void)pool;
 1089|       |#endif
 1090|  44.9k|}
encoder_utils.c:unlock_buffer_pool:
 1092|  44.9k|static void unlock_buffer_pool(BufferPool *const pool) {
 1093|  44.9k|#if CONFIG_MULTITHREAD
 1094|  44.9k|  pthread_mutex_unlock(&pool->pool_mutex);
 1095|       |#else
 1096|       |  (void)pool;
 1097|       |#endif
 1098|  44.9k|}
encoder_utils.c:ensure_mv_buffer:
 1237|  44.9k|static inline void ensure_mv_buffer(RefCntBuffer *buf, AV1_COMMON *cm) {
 1238|  44.9k|  const int buf_rows = buf->mi_rows;
 1239|  44.9k|  const int buf_cols = buf->mi_cols;
 1240|  44.9k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1241|       |
 1242|  44.9k|  if (buf->mvs == NULL || buf_rows != mi_params->mi_rows ||
  ------------------
  |  Branch (1242:7): [True: 31.6k, False: 13.2k]
  |  Branch (1242:27): [True: 7.84k, False: 5.44k]
  ------------------
 1243|  42.1k|      buf_cols != mi_params->mi_cols) {
  ------------------
  |  Branch (1243:7): [True: 2.66k, False: 2.78k]
  ------------------
 1244|  42.1k|    aom_free(buf->mvs);
 1245|  42.1k|    buf->mi_rows = mi_params->mi_rows;
 1246|  42.1k|    buf->mi_cols = mi_params->mi_cols;
 1247|  42.1k|    CHECK_MEM_ERROR(cm, buf->mvs,
  ------------------
  |  |   51|  42.1k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  42.1k|  do {                                                    \
  |  |  |  |   72|  42.1k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  42.1k|    lval = (expr);                                        \
  |  |  |  |   74|  42.1k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 42.1k]
  |  |  |  |  ------------------
  |  |  |  |   75|  42.1k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  42.1k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1248|  42.1k|                    (MV_REF *)aom_calloc(((mi_params->mi_rows + 1) >> 1) *
 1249|  42.1k|                                             ((mi_params->mi_cols + 1) >> 1),
 1250|  42.1k|                                         sizeof(*buf->mvs)));
 1251|  42.1k|    aom_free(buf->seg_map);
 1252|  42.1k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  42.1k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  42.1k|  do {                                                    \
  |  |  |  |   72|  42.1k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  42.1k|    lval = (expr);                                        \
  |  |  |  |   74|  42.1k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 42.1k]
  |  |  |  |  ------------------
  |  |  |  |   75|  42.1k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  42.1k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1253|  42.1k|        cm, buf->seg_map,
 1254|  42.1k|        (uint8_t *)aom_calloc(mi_params->mi_rows * mi_params->mi_cols,
 1255|  42.1k|                              sizeof(*buf->seg_map)));
 1256|  42.1k|  }
 1257|       |
 1258|  44.9k|  const int mem_size =
 1259|  44.9k|      ((mi_params->mi_rows + MAX_MIB_SIZE) >> 1) * (mi_params->mi_stride >> 1);
  ------------------
  |  |   44|  44.9k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|  44.9k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  44.9k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  44.9k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1260|       |
 1261|  44.9k|  if (cm->tpl_mvs == NULL || cm->tpl_mvs_mem_size < mem_size) {
  ------------------
  |  Branch (1261:7): [True: 0, False: 44.9k]
  |  Branch (1261:30): [True: 0, False: 44.9k]
  ------------------
 1262|      0|    aom_free(cm->tpl_mvs);
 1263|       |    CHECK_MEM_ERROR(cm, cm->tpl_mvs,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|      0|                    (TPL_MV_REF *)aom_calloc(mem_size, sizeof(*cm->tpl_mvs)));
 1265|      0|    cm->tpl_mvs_mem_size = mem_size;
 1266|      0|  }
 1267|  44.9k|}
encoder_utils.c:frame_is_sframe:
 1181|  55.2k|static inline int frame_is_sframe(const AV1_COMMON *cm) {
 1182|  55.2k|  return cm->current_frame.frame_type == S_FRAME;
 1183|  55.2k|}
encoder_utils.c:set_sb_size:
 1853|  18.4k|                               BLOCK_SIZE sb_size) {
 1854|  18.4k|  seq_params->sb_size = sb_size;
 1855|  18.4k|  seq_params->mib_size = mi_size_wide[seq_params->sb_size];
 1856|  18.4k|  seq_params->mib_size_log2 = mi_size_wide_log2[seq_params->sb_size];
 1857|  18.4k|}
encoder_utils.c:get_primary_ref_frame_buf:
 1216|   128k|    const AV1_COMMON *const cm) {
 1217|   128k|  const int primary_ref_frame = cm->features.primary_ref_frame;
 1218|   128k|  if (primary_ref_frame == PRIMARY_REF_NONE) return NULL;
  ------------------
  |  |   66|   128k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1218:7): [True: 67.6k, False: 61.2k]
  ------------------
 1219|  61.2k|  const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame + 1);
 1220|  61.2k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  61.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1220:10): [True: 61.2k, False: 0]
  ------------------
 1221|   128k|}
encodetxb.c:av1_num_planes:
 1273|  6.79M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  6.79M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  3.12M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 3.67M, False: 3.12M]
  ------------------
 1275|  6.79M|}
encodetxb.c:max_block_wide:
 1568|  1.51M|                                 int plane) {
 1569|  1.51M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  1.51M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  1.51M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 2.07k, False: 1.51M]
  ------------------
 1573|  2.07k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  2.07k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  2.07k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  1.51M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.51M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  1.51M|}
encodetxb.c:max_block_high:
 1582|  1.51M|                                 int plane) {
 1583|  1.51M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  1.51M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 1.92k, False: 1.51M]
  ------------------
 1586|  1.92k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  1.92k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  1.92k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  1.51M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.51M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  1.51M|}
ethread.c:av1_num_planes:
 1273|   509k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   509k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   199k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 309k, False: 199k]
  ------------------
 1275|   509k|}
ethread.c:frame_is_intra_only:
 1176|   178k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   178k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 60.6k, False: 118k]
  ------------------
 1178|   118k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 118k]
  ------------------
 1179|   178k|}
ethread.c:av1_zero_above_context:
 1597|  95.8k|                                          const int tile_row) {
 1598|  95.8k|  const SequenceHeader *const seq_params = cm->seq_params;
 1599|  95.8k|  const int num_planes = av1_num_planes(cm);
 1600|  95.8k|  const int width = mi_col_end - mi_col_start;
 1601|  95.8k|  const int aligned_width =
 1602|  95.8k|      ALIGN_POWER_OF_TWO(width, seq_params->mib_size_log2);
  ------------------
  |  |   69|  95.8k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1603|  95.8k|  const int offset_y = mi_col_start;
 1604|  95.8k|  const int width_y = aligned_width;
 1605|  95.8k|  const int offset_uv = offset_y >> seq_params->subsampling_x;
 1606|  95.8k|  const int width_uv = width_y >> seq_params->subsampling_x;
 1607|  95.8k|  CommonContexts *const above_contexts = &cm->above_contexts;
 1608|       |
 1609|  95.8k|  av1_zero_array(above_contexts->entropy[0][tile_row] + offset_y, width_y);
  ------------------
  |  |   44|  95.8k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1610|  95.8k|  if (num_planes > 1) {
  ------------------
  |  Branch (1610:7): [True: 37.7k, False: 58.0k]
  ------------------
 1611|  37.7k|    if (above_contexts->entropy[1][tile_row] &&
  ------------------
  |  Branch (1611:9): [True: 37.7k, False: 0]
  ------------------
 1612|  37.7k|        above_contexts->entropy[2][tile_row]) {
  ------------------
  |  Branch (1612:9): [True: 37.7k, False: 0]
  ------------------
 1613|  37.7k|      av1_zero_array(above_contexts->entropy[1][tile_row] + offset_uv,
  ------------------
  |  |   44|  37.7k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1614|  37.7k|                     width_uv);
 1615|  37.7k|      av1_zero_array(above_contexts->entropy[2][tile_row] + offset_uv,
  ------------------
  |  |   44|  37.7k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1616|  37.7k|                     width_uv);
 1617|  37.7k|    } else {
 1618|      0|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1619|      0|                         "Invalid value of planes");
 1620|      0|    }
 1621|  37.7k|  }
 1622|       |
 1623|  95.8k|  av1_zero_array(above_contexts->partition[tile_row] + mi_col_start,
  ------------------
  |  |   44|  95.8k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1624|  95.8k|                 aligned_width);
 1625|       |
 1626|  95.8k|  memset(above_contexts->txfm[tile_row] + mi_col_start,
 1627|  95.8k|         tx_size_wide[TX_SIZES_LARGEST], aligned_width * sizeof(TXFM_CONTEXT));
 1628|  95.8k|}
ethread.c:av1_init_above_context:
 1279|   103k|                                          MACROBLOCKD *xd) {
 1280|   288k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1280:19): [True: 184k, False: 103k]
  ------------------
 1281|   184k|    xd->above_entropy_context[i] = above_contexts->entropy[i][tile_row];
 1282|   184k|  }
 1283|   103k|  xd->above_partition_context = above_contexts->partition[tile_row];
 1284|   103k|  xd->above_txfm_context = above_contexts->txfm[tile_row];
 1285|   103k|}
global_motion_facade.c:get_ref_frame_buf:
 1196|   258k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   258k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   258k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   258k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 258k, False: 0]
  ------------------
 1199|   258k|}
global_motion_facade.c:get_ref_frame_map_idx:
 1189|   258k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   258k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 258k, False: 0]
  |  Branch (1190:38): [True: 258k, False: 0]
  ------------------
 1191|   258k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|   258k|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   258k|}
mcomp.c:frame_is_intra_only:
 1176|   144k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   144k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 144k, False: 0]
  ------------------
 1178|      0|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 0]
  ------------------
 1179|   144k|}
mcomp.c:av1_num_planes:
 1273|    128|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|    128|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|     94|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 34, False: 94]
  ------------------
 1275|    128|}
palette.c:frame_is_intra_only:
 1176|   493k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   493k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 56.3k, False: 436k]
  ------------------
 1178|   436k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 1, False: 436k]
  ------------------
 1179|   493k|}
partition_search.c:av1_num_planes:
 1273|  28.4M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  28.4M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  12.4M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 16.0M, False: 12.4M]
  ------------------
 1275|  28.4M|}
partition_search.c:set_mi_offsets:
 1674|  12.1M|                                  int mi_col) {
 1675|       |  // 'mi_grid_base' should point to appropriate memory in 'mi'.
 1676|  12.1M|  const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
 1677|  12.1M|  const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
 1678|  12.1M|  mi_params->mi_grid_base[mi_grid_idx] = &mi_params->mi_alloc[mi_alloc_idx];
 1679|       |  // 'xd->mi' should point to an offset in 'mi_grid_base';
 1680|  12.1M|  xd->mi = mi_params->mi_grid_base + mi_grid_idx;
 1681|       |  // 'xd->tx_type_map' should point to an offset in 'mi_params->tx_type_map'.
 1682|  12.1M|  xd->tx_type_map = mi_params->tx_type_map + mi_grid_idx;
 1683|  12.1M|  xd->tx_type_map_stride = mi_params->mi_stride;
 1684|  12.1M|}
partition_search.c:get_mi_grid_idx:
 1658|  12.1M|                                  int mi_row, int mi_col) {
 1659|  12.1M|  return mi_row * mi_params->mi_stride + mi_col;
 1660|  12.1M|}
partition_search.c:get_alloc_mi_idx:
 1663|  12.1M|                                   int mi_row, int mi_col) {
 1664|  12.1M|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|  12.1M|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|  12.1M|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|  12.1M|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|  12.1M|}
partition_search.c:set_entropy_context:
 1320|  12.1M|                                       const int num_planes) {
 1321|  12.1M|  int i;
 1322|  12.1M|  int row_offset = mi_row;
 1323|  12.1M|  int col_offset = mi_col;
 1324|  35.0M|  for (i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1324:15): [True: 22.8M, False: 12.1M]
  ------------------
 1325|  22.8M|    struct macroblockd_plane *const pd = &xd->plane[i];
 1326|       |    // Offset the buffer pointer
 1327|  22.8M|    const BLOCK_SIZE bsize = xd->mi[0]->bsize;
 1328|  22.8M|    if (pd->subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (1328:9): [True: 5.42M, False: 17.4M]
  |  Branch (1328:30): [True: 299k, False: 5.12M]
  |  Branch (1328:49): [True: 299k, False: 0]
  ------------------
 1329|   299k|      row_offset = mi_row - 1;
 1330|  22.8M|    if (pd->subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (1330:9): [True: 8.30M, False: 14.5M]
  |  Branch (1330:30): [True: 529k, False: 7.77M]
  |  Branch (1330:49): [True: 529k, False: 18.4E]
  ------------------
 1331|   529k|      col_offset = mi_col - 1;
 1332|  22.8M|    int above_idx = col_offset;
 1333|  22.8M|    int left_idx = row_offset & MAX_MIB_MASK;
  ------------------
  |  |   50|  22.8M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  22.8M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  22.8M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  22.8M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  22.8M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1334|  22.8M|    pd->above_entropy_context =
 1335|  22.8M|        &xd->above_entropy_context[i][above_idx >> pd->subsampling_x];
 1336|  22.8M|    pd->left_entropy_context =
 1337|  22.8M|        &xd->left_entropy_context[i][left_idx >> pd->subsampling_y];
 1338|  22.8M|  }
 1339|  12.1M|}
partition_search.c:set_plane_n4:
 1347|  12.1M|                                const int num_planes) {
 1348|  12.1M|  int i;
 1349|  35.0M|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (1349:15): [True: 22.8M, False: 12.1M]
  ------------------
 1350|  22.8M|    xd->plane[i].width = (bw * MI_SIZE) >> xd->plane[i].subsampling_x;
  ------------------
  |  |   40|  22.8M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  22.8M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1351|  22.8M|    xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y;
  ------------------
  |  |   40|  22.8M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  22.8M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1352|       |
 1353|  22.8M|    xd->plane[i].width = AOMMAX(xd->plane[i].width, 4);
  ------------------
  |  |   35|  22.8M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 13.9M, False: 8.92M]
  |  |  ------------------
  ------------------
 1354|  22.8M|    xd->plane[i].height = AOMMAX(xd->plane[i].height, 4);
  ------------------
  |  |   35|  22.8M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 15.8M, False: 7.02M]
  |  |  ------------------
  ------------------
 1355|  22.8M|  }
 1356|  12.1M|}
partition_search.c:set_mi_row_col:
 1360|  12.1M|                                  int mi_rows, int mi_cols) {
 1361|  12.1M|  xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE);
  ------------------
  |  |   29|  12.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1362|  12.1M|  xd->mb_to_bottom_edge = GET_MV_SUBPEL((mi_rows - bh - mi_row) * MI_SIZE);
  ------------------
  |  |   29|  12.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1363|  12.1M|  xd->mb_to_left_edge = -GET_MV_SUBPEL((mi_col * MI_SIZE));
  ------------------
  |  |   29|  12.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1364|  12.1M|  xd->mb_to_right_edge = GET_MV_SUBPEL((mi_cols - bw - mi_col) * MI_SIZE);
  ------------------
  |  |   29|  12.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1365|       |
 1366|  12.1M|  xd->mi_row = mi_row;
 1367|  12.1M|  xd->mi_col = mi_col;
 1368|       |
 1369|       |  // Are edges available for intra prediction?
 1370|  12.1M|  xd->up_available = (mi_row > tile->mi_row_start);
 1371|       |
 1372|  12.1M|  const int ss_x = xd->plane[1].subsampling_x;
 1373|  12.1M|  const int ss_y = xd->plane[1].subsampling_y;
 1374|       |
 1375|  12.1M|  xd->left_available = (mi_col > tile->mi_col_start);
 1376|  12.1M|  xd->chroma_up_available = xd->up_available;
 1377|  12.1M|  xd->chroma_left_available = xd->left_available;
 1378|  12.1M|  if (ss_x && bw < mi_size_wide[BLOCK_8X8])
  ------------------
  |  Branch (1378:7): [True: 10.9M, False: 1.18M]
  |  Branch (1378:15): [True: 820k, False: 10.1M]
  ------------------
 1379|   820k|    xd->chroma_left_available = (mi_col - 1) > tile->mi_col_start;
 1380|  12.1M|  if (ss_y && bh < mi_size_high[BLOCK_8X8])
  ------------------
  |  Branch (1380:7): [True: 9.53M, False: 2.62M]
  |  Branch (1380:15): [True: 563k, False: 8.97M]
  ------------------
 1381|   563k|    xd->chroma_up_available = (mi_row - 1) > tile->mi_row_start;
 1382|  12.1M|  if (xd->up_available) {
  ------------------
  |  Branch (1382:7): [True: 8.99M, False: 3.17M]
  ------------------
 1383|  8.99M|    xd->above_mbmi = xd->mi[-xd->mi_stride];
 1384|  8.99M|  } else {
 1385|  3.17M|    xd->above_mbmi = NULL;
 1386|  3.17M|  }
 1387|       |
 1388|  12.1M|  if (xd->left_available) {
  ------------------
  |  Branch (1388:7): [True: 9.04M, False: 3.12M]
  ------------------
 1389|  9.04M|    xd->left_mbmi = xd->mi[-1];
 1390|  9.04M|  } else {
 1391|  3.12M|    xd->left_mbmi = NULL;
 1392|  3.12M|  }
 1393|       |
 1394|  12.1M|  const int chroma_ref = ((mi_row & 0x01) || !(bh & 0x01) || !ss_y) &&
  ------------------
  |  Branch (1394:27): [True: 478k, False: 11.6M]
  |  Branch (1394:46): [True: 11.0M, False: 654k]
  |  Branch (1394:62): [True: 333k, False: 321k]
  ------------------
 1395|  11.8M|                         ((mi_col & 0x01) || !(bw & 0x01) || !ss_x);
  ------------------
  |  Branch (1395:27): [True: 354k, False: 11.4M]
  |  Branch (1395:46): [True: 11.0M, False: 458k]
  |  Branch (1395:62): [True: 159k, False: 299k]
  ------------------
 1396|  12.1M|  xd->is_chroma_ref = chroma_ref;
 1397|  12.1M|  if (chroma_ref) {
  ------------------
  |  Branch (1397:7): [True: 11.5M, False: 615k]
  ------------------
 1398|       |    // To help calculate the "above" and "left" chroma blocks, note that the
 1399|       |    // current block may cover multiple luma blocks (e.g., if partitioned into
 1400|       |    // 4x4 luma blocks).
 1401|       |    // First, find the top-left-most luma block covered by this chroma block
 1402|  11.5M|    MB_MODE_INFO **base_mi =
 1403|  11.5M|        &xd->mi[-(mi_row & ss_y) * xd->mi_stride - (mi_col & ss_x)];
 1404|       |
 1405|       |    // Then, we consider the luma region covered by the left or above 4x4 chroma
 1406|       |    // prediction. We want to point to the chroma reference block in that
 1407|       |    // region, which is the bottom-right-most mi unit.
 1408|       |    // This leads to the following offsets:
 1409|  11.5M|    MB_MODE_INFO *chroma_above_mi =
 1410|  11.5M|        xd->chroma_up_available ? base_mi[-xd->mi_stride + ss_x] : NULL;
  ------------------
  |  Branch (1410:9): [True: 8.49M, False: 3.05M]
  ------------------
 1411|  11.5M|    xd->chroma_above_mbmi = chroma_above_mi;
 1412|       |
 1413|  11.5M|    MB_MODE_INFO *chroma_left_mi =
 1414|  11.5M|        xd->chroma_left_available ? base_mi[ss_y * xd->mi_stride - 1] : NULL;
  ------------------
  |  Branch (1414:9): [True: 8.53M, False: 3.01M]
  ------------------
 1415|  11.5M|    xd->chroma_left_mbmi = chroma_left_mi;
 1416|  11.5M|  }
 1417|       |
 1418|  12.1M|  xd->height = bh;
 1419|  12.1M|  xd->width = bw;
 1420|       |
 1421|  12.1M|  xd->is_last_vertical_rect = 0;
 1422|  12.1M|  if (xd->width < xd->height) {
  ------------------
  |  Branch (1422:7): [True: 224k, False: 11.9M]
  ------------------
 1423|   224k|    if (!((mi_col + xd->width) & (xd->height - 1))) {
  ------------------
  |  Branch (1423:9): [True: 60.6k, False: 164k]
  ------------------
 1424|  60.6k|      xd->is_last_vertical_rect = 1;
 1425|  60.6k|    }
 1426|   224k|  }
 1427|       |
 1428|  12.1M|  xd->is_first_horizontal_rect = 0;
 1429|  12.1M|  if (xd->width > xd->height)
  ------------------
  |  Branch (1429:7): [True: 231k, False: 11.9M]
  ------------------
 1430|   231k|    if (!(mi_row & (xd->width - 1))) xd->is_first_horizontal_rect = 1;
  ------------------
  |  Branch (1430:9): [True: 152k, False: 79.4k]
  ------------------
 1431|  12.1M|}
partition_search.c:partition_plane_context:
 1542|  11.0M|                                          int mi_col, BLOCK_SIZE bsize) {
 1543|  11.0M|  const PARTITION_CONTEXT *above_ctx = xd->above_partition_context + mi_col;
 1544|  11.0M|  const PARTITION_CONTEXT *left_ctx =
 1545|  11.0M|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  11.0M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  11.0M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  11.0M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  11.0M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  11.0M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1546|       |  // Minimum partition point is 8x8. Offset the bsl accordingly.
 1547|  11.0M|  const int bsl = mi_size_wide_log2[bsize] - mi_size_wide_log2[BLOCK_8X8];
 1548|  11.0M|  int above = (*above_ctx >> bsl) & 1, left = (*left_ctx >> bsl) & 1;
 1549|       |
 1550|  11.0M|  assert(mi_size_wide_log2[bsize] == mi_size_high_log2[bsize]);
 1551|  11.0M|  assert(bsl >= 0);
 1552|       |
 1553|  11.0M|  return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
  ------------------
  |  |  169|  11.0M|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  ------------------
 1554|  11.0M|}
partition_search.c:get_partition:
 1777|   702k|                                           BLOCK_SIZE bsize) {
 1778|   702k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1779|   702k|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols)
  ------------------
  |  Branch (1779:7): [True: 18.4E, False: 702k]
  |  Branch (1779:39): [True: 18.4E, False: 702k]
  ------------------
 1780|      0|    return PARTITION_INVALID;
 1781|       |
 1782|   702k|  const int offset = mi_row * mi_params->mi_stride + mi_col;
 1783|   702k|  MB_MODE_INFO **mi = mi_params->mi_grid_base + offset;
 1784|   702k|  const BLOCK_SIZE subsize = mi[0]->bsize;
 1785|       |
 1786|   702k|  assert(bsize < BLOCK_SIZES_ALL);
 1787|       |
 1788|   702k|  if (subsize == bsize) return PARTITION_NONE;
  ------------------
  |  Branch (1788:7): [True: 387k, False: 314k]
  ------------------
 1789|       |
 1790|   314k|  const int bhigh = mi_size_high[bsize];
 1791|   314k|  const int bwide = mi_size_wide[bsize];
 1792|   314k|  const int sshigh = mi_size_high[subsize];
 1793|   314k|  const int sswide = mi_size_wide[subsize];
 1794|       |
 1795|   315k|  if (bsize > BLOCK_8X8 && mi_row + bwide / 2 < mi_params->mi_rows &&
  ------------------
  |  Branch (1795:7): [True: 315k, False: 18.4E]
  |  Branch (1795:28): [True: 220k, False: 94.7k]
  ------------------
 1796|   220k|      mi_col + bhigh / 2 < mi_params->mi_cols) {
  ------------------
  |  Branch (1796:7): [True: 164k, False: 56.3k]
  ------------------
 1797|       |    // In this case, the block might be using an extended partition
 1798|       |    // type.
 1799|   164k|    const MB_MODE_INFO *const mbmi_right = mi[bwide / 2];
 1800|   164k|    const MB_MODE_INFO *const mbmi_below = mi[bhigh / 2 * mi_params->mi_stride];
 1801|       |
 1802|   164k|    if (sswide == bwide) {
  ------------------
  |  Branch (1802:9): [True: 24, False: 164k]
  ------------------
 1803|       |      // Smaller height but same width. Is PARTITION_HORZ_4, PARTITION_HORZ or
 1804|       |      // PARTITION_HORZ_B. To distinguish the latter two, check if the lower
 1805|       |      // half was split.
 1806|     24|      if (sshigh * 4 == bhigh) return PARTITION_HORZ_4;
  ------------------
  |  Branch (1806:11): [True: 0, False: 24]
  ------------------
 1807|     24|      assert(sshigh * 2 == bhigh);
 1808|       |
 1809|     24|      if (mbmi_below->bsize == subsize)
  ------------------
  |  Branch (1809:11): [True: 24, False: 0]
  ------------------
 1810|     24|        return PARTITION_HORZ;
 1811|      0|      else
 1812|      0|        return PARTITION_HORZ_B;
 1813|   164k|    } else if (sshigh == bhigh) {
  ------------------
  |  Branch (1813:16): [True: 18, False: 164k]
  ------------------
 1814|       |      // Smaller width but same height. Is PARTITION_VERT_4, PARTITION_VERT or
 1815|       |      // PARTITION_VERT_B. To distinguish the latter two, check if the right
 1816|       |      // half was split.
 1817|     18|      if (sswide * 4 == bwide) return PARTITION_VERT_4;
  ------------------
  |  Branch (1817:11): [True: 0, False: 18]
  ------------------
 1818|     18|      assert(sswide * 2 == bwide);
 1819|       |
 1820|     18|      if (mbmi_right->bsize == subsize)
  ------------------
  |  Branch (1820:11): [True: 18, False: 0]
  ------------------
 1821|     18|        return PARTITION_VERT;
 1822|      0|      else
 1823|      0|        return PARTITION_VERT_B;
 1824|   164k|    } else {
 1825|       |      // Smaller width and smaller height. Might be PARTITION_SPLIT or could be
 1826|       |      // PARTITION_HORZ_A or PARTITION_VERT_A. If subsize isn't halved in both
 1827|       |      // dimensions, we immediately know this is a split (which will recurse to
 1828|       |      // get to subsize). Otherwise look down and to the right. With
 1829|       |      // PARTITION_VERT_A, the right block will have height bhigh; with
 1830|       |      // PARTITION_HORZ_A, the lower block with have width bwide. Otherwise
 1831|       |      // it's PARTITION_SPLIT.
 1832|   164k|      if (sswide * 2 != bwide || sshigh * 2 != bhigh) return PARTITION_SPLIT;
  ------------------
  |  Branch (1832:11): [True: 33.7k, False: 130k]
  |  Branch (1832:34): [True: 13, False: 130k]
  ------------------
 1833|       |
 1834|   130k|      if (mi_size_wide[mbmi_below->bsize] == bwide) return PARTITION_HORZ_A;
  ------------------
  |  Branch (1834:11): [True: 0, False: 130k]
  ------------------
 1835|   130k|      if (mi_size_high[mbmi_right->bsize] == bhigh) return PARTITION_VERT_A;
  ------------------
  |  Branch (1835:11): [True: 0, False: 130k]
  ------------------
 1836|       |
 1837|   130k|      return PARTITION_SPLIT;
 1838|   130k|    }
 1839|   164k|  }
 1840|   150k|  const int vert_split = sswide < bwide;
 1841|   150k|  const int horz_split = sshigh < bhigh;
 1842|   150k|  const int split_idx = (vert_split << 1) | horz_split;
 1843|   150k|  assert(split_idx != 0);
 1844|       |
 1845|   150k|  static const PARTITION_TYPE base_partitions[4] = {
 1846|   150k|    PARTITION_INVALID, PARTITION_HORZ, PARTITION_VERT, PARTITION_SPLIT
 1847|   150k|  };
 1848|       |
 1849|   150k|  return base_partitions[split_idx];
 1850|   314k|}
partition_search.c:get_ref_scale_factors_const:
 1204|  3.29M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  3.29M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  3.29M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  3.29M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 3.29M, False: 18.4E]
  ------------------
 1207|  3.29M|}
partition_search.c:get_ref_frame_map_idx:
 1189|  4.43M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  4.43M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 4.43M, False: 18.4E]
  |  Branch (1190:38): [True: 4.43M, False: 18.4E]
  ------------------
 1191|  4.43M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  4.43M|}
partition_search.c:get_ref_frame_buf:
 1196|  1.13M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  1.13M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  1.13M|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  1.13M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 1.13M, False: 142]
  ------------------
 1199|  1.13M|}
partition_search.c:max_block_high:
 1582|  1.26M|                                 int plane) {
 1583|  1.26M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  1.26M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 16.7k, False: 1.25M]
  ------------------
 1586|  16.7k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  16.7k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  16.7k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  1.26M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.26M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  1.26M|}
partition_search.c:max_block_wide:
 1568|  1.26M|                                 int plane) {
 1569|  1.26M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  1.26M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  1.26M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 20.4k, False: 1.24M]
  ------------------
 1573|  20.4k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  20.4k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  20.4k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  1.26M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.26M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  1.26M|}
partition_search.c:txfm_partition_context:
 1751|   819k|                                         BLOCK_SIZE bsize, TX_SIZE tx_size) {
 1752|   819k|  const uint8_t txw = tx_size_wide[tx_size];
 1753|   819k|  const uint8_t txh = tx_size_high[tx_size];
 1754|   819k|  const int above = *above_ctx < txw;
 1755|   819k|  const int left = *left_ctx < txh;
 1756|   819k|  int category = TXFM_PARTITION_CONTEXTS;
  ------------------
  |  |  521|   819k|#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 3)
  ------------------
 1757|       |
 1758|       |  // dummy return, not used by others.
 1759|   819k|  if (tx_size <= TX_4X4) return 0;
  ------------------
  |  Branch (1759:7): [True: 0, False: 819k]
  ------------------
 1760|       |
 1761|   819k|  TX_SIZE max_tx_size =
 1762|   819k|      get_sqr_tx_size(AOMMAX(block_size_wide[bsize], block_size_high[bsize]));
  ------------------
  |  |   35|   819k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 37.5k, False: 782k]
  |  |  ------------------
  ------------------
 1763|       |
 1764|   819k|  if (max_tx_size >= TX_8X8) {
  ------------------
  |  Branch (1764:7): [True: 819k, False: 18.4E]
  ------------------
 1765|   819k|    category =
 1766|   819k|        (txsize_sqr_up_map[tx_size] != max_tx_size && max_tx_size > TX_8X8) +
  ------------------
  |  Branch (1766:10): [True: 392k, False: 427k]
  |  Branch (1766:55): [True: 392k, False: 18.4E]
  ------------------
 1767|   819k|        (TX_SIZES - 1 - max_tx_size) * 2;
 1768|   819k|  }
 1769|       |  assert(category != TXFM_PARTITION_CONTEXTS);
 1770|   819k|  return category * 3 + above + left;
 1771|   819k|}
partition_search.c:get_sqr_tx_size:
 1699|   819k|static inline TX_SIZE get_sqr_tx_size(int tx_dim) {
 1700|   819k|  switch (tx_dim) {
 1701|      0|    case 128:
  ------------------
  |  Branch (1701:5): [True: 0, False: 819k]
  ------------------
 1702|  1.71k|    case 64: return TX_64X64; break;
  ------------------
  |  Branch (1702:5): [True: 1.71k, False: 817k]
  ------------------
 1703|   165k|    case 32: return TX_32X32; break;
  ------------------
  |  Branch (1703:5): [True: 165k, False: 653k]
  ------------------
 1704|   303k|    case 16: return TX_16X16; break;
  ------------------
  |  Branch (1704:5): [True: 303k, False: 516k]
  ------------------
 1705|   349k|    case 8: return TX_8X8; break;
  ------------------
  |  Branch (1705:5): [True: 349k, False: 470k]
  ------------------
 1706|      0|    default: return TX_4X4;
  ------------------
  |  Branch (1706:5): [True: 0, False: 819k]
  ------------------
 1707|   819k|  }
 1708|   819k|}
partition_search.c:txfm_partition_update:
 1688|  1.14M|                                         TX_SIZE tx_size, TX_SIZE txb_size) {
 1689|  1.14M|  BLOCK_SIZE bsize = txsize_to_bsize[txb_size];
 1690|  1.14M|  int bh = mi_size_high[bsize];
 1691|  1.14M|  int bw = mi_size_wide[bsize];
 1692|  1.14M|  uint8_t txw = tx_size_wide[tx_size];
 1693|  1.14M|  uint8_t txh = tx_size_high[tx_size];
 1694|  1.14M|  int i;
 1695|  3.44M|  for (i = 0; i < bh; ++i) left_ctx[i] = txh;
  ------------------
  |  Branch (1695:15): [True: 2.30M, False: 1.14M]
  ------------------
 1696|  3.44M|  for (i = 0; i < bw; ++i) above_ctx[i] = txw;
  ------------------
  |  Branch (1696:15): [True: 2.30M, False: 1.14M]
  ------------------
 1697|  1.14M|}
partition_search.c:set_txfm_ctxs:
 1644|  5.56M|                                 const MACROBLOCKD *xd) {
 1645|  5.56M|  uint8_t bw = tx_size_wide[tx_size];
 1646|  5.56M|  uint8_t bh = tx_size_high[tx_size];
 1647|       |
 1648|  5.56M|  if (skip) {
  ------------------
  |  Branch (1648:7): [True: 198k, False: 5.36M]
  ------------------
 1649|   198k|    bw = n4_w * MI_SIZE;
  ------------------
  |  |   40|   198k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   198k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1650|   198k|    bh = n4_h * MI_SIZE;
  ------------------
  |  |   40|   198k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   198k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1651|   198k|  }
 1652|       |
 1653|  5.56M|  set_txfm_ctx(xd->above_txfm_context, bw, n4_w);
 1654|  5.56M|  set_txfm_ctx(xd->left_txfm_context, bh, n4_h);
 1655|  5.56M|}
partition_search.c:set_txfm_ctx:
 1638|  11.1M|static inline void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
 1639|  11.1M|  int i;
 1640|  33.6M|  for (i = 0; i < len; ++i) txfm_ctx[i] = txs;
  ------------------
  |  Branch (1640:15): [True: 22.5M, False: 11.1M]
  ------------------
 1641|  11.1M|}
partition_search.c:partition_cdf_length:
 1558|  1.80M|static inline int partition_cdf_length(BLOCK_SIZE bsize) {
 1559|  1.80M|  if (bsize <= BLOCK_8X8)
  ------------------
  |  Branch (1559:7): [True: 1.37M, False: 425k]
  ------------------
 1560|  1.37M|    return PARTITION_TYPES;
 1561|   425k|  else if (bsize == BLOCK_128X128)
  ------------------
  |  Branch (1561:12): [True: 0, False: 425k]
  ------------------
 1562|      0|    return EXT_PARTITION_TYPES - 2;
 1563|   425k|  else
 1564|   425k|    return EXT_PARTITION_TYPES;
 1565|  1.80M|}
partition_search.c:update_ext_partition_context:
 1505|  7.08M|                                                PARTITION_TYPE partition) {
 1506|  7.08M|  if (bsize >= BLOCK_8X8) {
  ------------------
  |  Branch (1506:7): [True: 6.69M, False: 381k]
  ------------------
 1507|  6.69M|    const int hbs = mi_size_wide[bsize] / 2;
 1508|  6.69M|    BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
 1509|  6.69M|    switch (partition) {
 1510|  1.55M|      case PARTITION_SPLIT:
  ------------------
  |  Branch (1510:7): [True: 1.55M, False: 5.14M]
  ------------------
 1511|  1.55M|        if (bsize != BLOCK_8X8) break;
  ------------------
  |  Branch (1511:13): [True: 1.51M, False: 37.5k]
  ------------------
 1512|  37.5k|        AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|  37.5k|  do {                           \
  |  |   53|  37.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 37.5k]
  |  |  ------------------
  ------------------
 1513|  5.08M|      case PARTITION_NONE:
  ------------------
  |  Branch (1513:7): [True: 5.04M, False: 1.65M]
  ------------------
 1514|  5.12M|      case PARTITION_HORZ:
  ------------------
  |  Branch (1514:7): [True: 43.3k, False: 6.65M]
  ------------------
 1515|  5.18M|      case PARTITION_VERT:
  ------------------
  |  Branch (1515:7): [True: 55.2k, False: 6.64M]
  ------------------
 1516|  5.18M|      case PARTITION_HORZ_4:
  ------------------
  |  Branch (1516:7): [True: 0, False: 6.69M]
  ------------------
 1517|  5.18M|      case PARTITION_VERT_4:
  ------------------
  |  Branch (1517:7): [True: 0, False: 6.69M]
  ------------------
 1518|  5.18M|        update_partition_context(xd, mi_row, mi_col, subsize, bsize);
 1519|  5.18M|        break;
 1520|      0|      case PARTITION_HORZ_A:
  ------------------
  |  Branch (1520:7): [True: 0, False: 6.69M]
  ------------------
 1521|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1522|      0|        update_partition_context(xd, mi_row + hbs, mi_col, subsize, subsize);
 1523|      0|        break;
 1524|      0|      case PARTITION_HORZ_B:
  ------------------
  |  Branch (1524:7): [True: 0, False: 6.69M]
  ------------------
 1525|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1526|      0|        update_partition_context(xd, mi_row + hbs, mi_col, bsize2, subsize);
 1527|      0|        break;
 1528|      0|      case PARTITION_VERT_A:
  ------------------
  |  Branch (1528:7): [True: 0, False: 6.69M]
  ------------------
 1529|      0|        update_partition_context(xd, mi_row, mi_col, bsize2, subsize);
 1530|      0|        update_partition_context(xd, mi_row, mi_col + hbs, subsize, subsize);
 1531|      0|        break;
 1532|      0|      case PARTITION_VERT_B:
  ------------------
  |  Branch (1532:7): [True: 0, False: 6.69M]
  ------------------
 1533|      0|        update_partition_context(xd, mi_row, mi_col, subsize, subsize);
 1534|      0|        update_partition_context(xd, mi_row, mi_col + hbs, bsize2, subsize);
 1535|      0|        break;
 1536|      0|      default: assert(0 && "Invalid partition type");
  ------------------
  |  Branch (1536:7): [True: 0, False: 6.69M]
  ------------------
 1537|  6.69M|    }
 1538|  6.69M|  }
 1539|  7.08M|}
partition_search.c:update_partition_context:
 1445|  5.18M|                                            BLOCK_SIZE bsize) {
 1446|  5.18M|  PARTITION_CONTEXT *const above_ctx = xd->above_partition_context + mi_col;
 1447|  5.18M|  PARTITION_CONTEXT *const left_ctx =
 1448|  5.18M|      xd->left_partition_context + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  5.18M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  5.18M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  5.18M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  5.18M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  5.18M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1449|       |
 1450|  5.18M|  const int bw = mi_size_wide[bsize];
 1451|  5.18M|  const int bh = mi_size_high[bsize];
 1452|  5.18M|  memset(above_ctx, partition_context_lookup[subsize].above, bw);
 1453|  5.18M|  memset(left_ctx, partition_context_lookup[subsize].left, bh);
 1454|  5.18M|}
partition_search.c:frame_is_intra_only:
 1176|  25.2M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  25.2M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 2.79M, False: 22.4M]
  ------------------
 1178|  22.4M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 22.4M]
  ------------------
 1179|  25.2M|}
partition_search.c:partition_gather_vert_alike:
 1489|   110k|                                               BLOCK_SIZE bsize) {
 1490|   110k|  (void)bsize;
 1491|   110k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|   110k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   110k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1492|   110k|  out[0] -= cdf_element_prob(in, PARTITION_VERT);
 1493|   110k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1494|   110k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1495|   110k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1496|   110k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_B);
 1497|   110k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_VERT_4);
  ------------------
  |  Branch (1497:7): [True: 110k, False: 6]
  ------------------
 1498|   110k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|   110k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   110k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   110k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1499|   110k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|   110k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   110k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   110k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1500|   110k|}
partition_search.c:cdf_element_prob:
 1467|  1.33M|                                            size_t element) {
 1468|  1.33M|  assert(cdf != NULL);
 1469|  18.4E|  return (element > 0 ? cdf[element - 1] : CDF_PROB_TOP) - cdf[element];
  ------------------
  |  |   33|  18.4E|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|  18.4E|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
  |  Branch (1469:11): [True: 1.33M, False: 18.4E]
  ------------------
 1470|  1.33M|}
partition_search.c:partition_gather_horz_alike:
 1474|   112k|                                               BLOCK_SIZE bsize) {
 1475|   112k|  (void)bsize;
 1476|   112k|  out[0] = CDF_PROB_TOP;
  ------------------
  |  |   33|   112k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   112k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
 1477|   112k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ);
 1478|   112k|  out[0] -= cdf_element_prob(in, PARTITION_SPLIT);
 1479|   112k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_A);
 1480|   112k|  out[0] -= cdf_element_prob(in, PARTITION_HORZ_B);
 1481|   112k|  out[0] -= cdf_element_prob(in, PARTITION_VERT_A);
 1482|   112k|  if (bsize != BLOCK_128X128) out[0] -= cdf_element_prob(in, PARTITION_HORZ_4);
  ------------------
  |  Branch (1482:7): [True: 112k, False: 5]
  ------------------
 1483|   112k|  out[0] = AOM_ICDF(out[0]);
  ------------------
  |  |   38|   112k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   112k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   112k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1484|   112k|  out[1] = AOM_ICDF(CDF_PROB_TOP);
  ------------------
  |  |   38|   112k|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   112k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   112k|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1485|   112k|}
partition_strategy.c:set_mi_offsets:
 1674|   707k|                                  int mi_col) {
 1675|       |  // 'mi_grid_base' should point to appropriate memory in 'mi'.
 1676|   707k|  const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
 1677|   707k|  const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
 1678|   707k|  mi_params->mi_grid_base[mi_grid_idx] = &mi_params->mi_alloc[mi_alloc_idx];
 1679|       |  // 'xd->mi' should point to an offset in 'mi_grid_base';
 1680|   707k|  xd->mi = mi_params->mi_grid_base + mi_grid_idx;
 1681|       |  // 'xd->tx_type_map' should point to an offset in 'mi_params->tx_type_map'.
 1682|   707k|  xd->tx_type_map = mi_params->tx_type_map + mi_grid_idx;
 1683|   707k|  xd->tx_type_map_stride = mi_params->mi_stride;
 1684|   707k|}
partition_strategy.c:get_mi_grid_idx:
 1658|   707k|                                  int mi_row, int mi_col) {
 1659|   707k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|   707k|}
partition_strategy.c:get_alloc_mi_idx:
 1663|   708k|                                   int mi_row, int mi_col) {
 1664|   708k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|   708k|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|   708k|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|   708k|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|   708k|}
partition_strategy.c:set_plane_n4:
 1347|   707k|                                const int num_planes) {
 1348|   707k|  int i;
 1349|  2.05M|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (1349:15): [True: 1.34M, False: 707k]
  ------------------
 1350|  1.34M|    xd->plane[i].width = (bw * MI_SIZE) >> xd->plane[i].subsampling_x;
  ------------------
  |  |   40|  1.34M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.34M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1351|  1.34M|    xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y;
  ------------------
  |  |   40|  1.34M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.34M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1352|       |
 1353|  1.34M|    xd->plane[i].width = AOMMAX(xd->plane[i].width, 4);
  ------------------
  |  |   35|  1.34M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.26M, False: 82.5k]
  |  |  ------------------
  ------------------
 1354|  1.34M|    xd->plane[i].height = AOMMAX(xd->plane[i].height, 4);
  ------------------
  |  |   35|  1.34M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.30M, False: 44.7k]
  |  |  ------------------
  ------------------
 1355|  1.34M|  }
 1356|   707k|}
partition_strategy.c:frame_is_intra_only:
 1176|  6.18M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  6.18M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 682k, False: 5.49M]
  ------------------
 1178|  5.49M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 5.49M]
  ------------------
 1179|  6.18M|}
partition_strategy.c:av1_num_planes:
 1273|   707k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   707k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   320k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 387k, False: 320k]
  ------------------
 1275|   707k|}
pickcdef.c:frame_is_intra_only:
 1176|  23.2k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  23.2k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 5.62k, False: 17.5k]
  ------------------
 1178|  17.5k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 17.5k]
  ------------------
 1179|  23.2k|}
pickcdef.c:av1_num_planes:
 1273|  84.3k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  84.3k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  32.2k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 52.0k, False: 32.2k]
  ------------------
 1275|  84.3k|}
picklpf.c:av1_num_planes:
 1273|  70.2k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  70.2k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  26.5k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 43.6k, False: 26.5k]
  ------------------
 1275|  70.2k|}
picklpf.c:frame_is_intra_only:
 1176|  47.0k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  47.0k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 11.7k, False: 35.2k]
  ------------------
 1178|  35.2k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 35.2k]
  ------------------
 1179|  47.0k|}
pickrst.c:av1_num_planes:
 1273|  10.1k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  10.1k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  3.73k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 6.42k, False: 3.73k]
  ------------------
 1275|  10.1k|}
ratectrl.c:frame_is_intra_only:
 1176|   103k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   103k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 39.8k, False: 63.5k]
  ------------------
 1178|  63.5k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 63.5k]
  ------------------
 1179|   103k|}
rd.c:frame_is_intra_only:
 1176|   466k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   466k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 110k, False: 356k]
  ------------------
 1178|   356k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 356k]
  ------------------
 1179|   466k|}
rd.c:av1_num_planes:
 1273|  61.4k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  61.4k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  23.7k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 37.6k, False: 23.7k]
  ------------------
 1275|  61.4k|}
rd.c:get_ref_frame_buf:
 1196|  8.26M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  8.26M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  8.26M|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  8.26M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 8.26M, False: 18.4E]
  ------------------
 1199|  8.26M|}
rd.c:get_ref_frame_map_idx:
 1189|  8.26M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  8.26M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 8.26M, False: 18.4E]
  |  Branch (1190:38): [True: 8.26M, False: 18.4E]
  ------------------
 1191|  8.26M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  8.26M|}
rdopt.c:av1_num_planes:
 1273|  31.4M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  31.4M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  15.7M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 15.7M, False: 15.7M]
  ------------------
 1275|  31.4M|}
rdopt.c:frame_is_intra_only:
 1176|   439k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   439k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 439k, False: 0]
  ------------------
 1178|      0|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 0]
  ------------------
 1179|   439k|}
rdopt.c:get_ref_scale_factors_const:
 1204|  26.6M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  26.6M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  26.6M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  26.6M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 26.6M, False: 18.4E]
  ------------------
 1207|  26.6M|}
rdopt.c:get_ref_frame_map_idx:
 1189|  28.5M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  28.5M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 28.5M, False: 18.4E]
  |  Branch (1190:38): [True: 28.5M, False: 18.4E]
  ------------------
 1191|  28.5M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  28.5M|}
rdopt.c:get_ref_frame_buf:
 1196|  1.91M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  1.91M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  1.91M|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  1.91M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 1.91M, False: 18.4E]
  ------------------
 1199|  1.91M|}
rdopt.c:get_ref_scale_factors:
 1210|  1.96k|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|  1.96k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|  1.96k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  1.96k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 1.96k, False: 0]
  ------------------
 1213|  1.96k|}
nonrd_pickmode.c:av1_num_planes:
 1273|   664k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   664k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   207k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 456k, False: 207k]
  ------------------
 1275|   664k|}
nonrd_pickmode.c:get_ref_scale_factors:
 1210|  1.26M|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|  1.26M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|  1.26M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  1.26M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 1.26M, False: 18.4E]
  ------------------
 1213|  1.26M|}
nonrd_pickmode.c:get_ref_frame_map_idx:
 1189|  7.79M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  7.79M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 7.79M, False: 574]
  |  Branch (1190:38): [True: 7.79M, False: 18.4E]
  ------------------
 1191|  7.79M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  7.79M|}
nonrd_pickmode.c:get_ref_frame_buf:
 1196|   598k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   598k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   598k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   598k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 598k, False: 71]
  ------------------
 1199|   598k|}
nonrd_pickmode.c:get_ref_scale_factors_const:
 1204|  5.98M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  5.98M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  5.99M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  5.98M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 5.99M, False: 18.4E]
  ------------------
 1207|  5.98M|}
nonrd_opt.c:max_block_wide:
 1568|  1.28M|                                 int plane) {
 1569|  1.28M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  1.28M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  1.28M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 1.16k, False: 1.28M]
  ------------------
 1573|  1.16k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  1.16k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  1.16k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  1.28M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.28M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  1.28M|}
nonrd_opt.c:max_block_high:
 1582|  1.28M|                                 int plane) {
 1583|  1.28M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  1.28M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 906, False: 1.28M]
  ------------------
 1586|    906|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|    906|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|    906|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  1.28M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  1.28M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  1.28M|}
reconinter_enc.c:get_ref_frame_buf:
 1196|   153k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   153k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   153k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   153k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 153k, False: 1]
  ------------------
 1199|   153k|}
reconinter_enc.c:get_ref_frame_map_idx:
 1189|   307k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   307k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 307k, False: 18.4E]
  |  Branch (1190:38): [True: 307k, False: 18.4E]
  ------------------
 1191|   307k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   307k|}
reconinter_enc.c:get_ref_scale_factors_const:
 1204|   153k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|   153k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|   153k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|   153k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 153k, False: 10]
  ------------------
 1207|   153k|}
speed_features.c:frame_is_intra_only:
 1176|   845k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   845k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 354k, False: 491k]
  ------------------
 1178|   491k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 491k]
  ------------------
 1179|   845k|}
tokenize.c:av1_num_planes:
 1273|  1.13M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  1.13M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   295k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 843k, False: 295k]
  ------------------
 1275|  1.13M|}
tokenize.c:max_block_high:
 1582|  2.29M|                                 int plane) {
 1583|  2.29M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  2.29M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 27.1k, False: 2.26M]
  ------------------
 1586|  27.1k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  27.1k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  27.1k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  2.29M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.29M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  2.29M|}
tokenize.c:max_block_wide:
 1568|  2.29M|                                 int plane) {
 1569|  2.29M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  2.29M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  2.29M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 32.2k, False: 2.25M]
  ------------------
 1573|  32.2k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  32.2k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  32.2k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  2.29M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.29M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  2.29M|}
tx_search.c:txfm_partition_context:
 1751|  4.33M|                                         BLOCK_SIZE bsize, TX_SIZE tx_size) {
 1752|  4.33M|  const uint8_t txw = tx_size_wide[tx_size];
 1753|  4.33M|  const uint8_t txh = tx_size_high[tx_size];
 1754|  4.33M|  const int above = *above_ctx < txw;
 1755|  4.33M|  const int left = *left_ctx < txh;
 1756|  4.33M|  int category = TXFM_PARTITION_CONTEXTS;
  ------------------
  |  |  521|  4.33M|#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 3)
  ------------------
 1757|       |
 1758|       |  // dummy return, not used by others.
 1759|  4.33M|  if (tx_size <= TX_4X4) return 0;
  ------------------
  |  Branch (1759:7): [True: 1.95M, False: 2.38M]
  ------------------
 1760|       |
 1761|  2.38M|  TX_SIZE max_tx_size =
 1762|  2.38M|      get_sqr_tx_size(AOMMAX(block_size_wide[bsize], block_size_high[bsize]));
  ------------------
  |  |   35|  2.38M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 121k, False: 2.26M]
  |  |  ------------------
  ------------------
 1763|       |
 1764|  2.38M|  if (max_tx_size >= TX_8X8) {
  ------------------
  |  Branch (1764:7): [True: 2.38M, False: 18.4E]
  ------------------
 1765|  2.38M|    category =
 1766|  2.38M|        (txsize_sqr_up_map[tx_size] != max_tx_size && max_tx_size > TX_8X8) +
  ------------------
  |  Branch (1766:10): [True: 165k, False: 2.21M]
  |  Branch (1766:55): [True: 165k, False: 0]
  ------------------
 1767|  2.38M|        (TX_SIZES - 1 - max_tx_size) * 2;
 1768|  2.38M|  }
 1769|       |  assert(category != TXFM_PARTITION_CONTEXTS);
 1770|  2.38M|  return category * 3 + above + left;
 1771|  4.33M|}
tx_search.c:get_sqr_tx_size:
 1699|  2.38M|static inline TX_SIZE get_sqr_tx_size(int tx_dim) {
 1700|  2.38M|  switch (tx_dim) {
 1701|      0|    case 128:
  ------------------
  |  Branch (1701:5): [True: 0, False: 2.38M]
  ------------------
 1702|  29.2k|    case 64: return TX_64X64; break;
  ------------------
  |  Branch (1702:5): [True: 29.2k, False: 2.35M]
  ------------------
 1703|  40.8k|    case 32: return TX_32X32; break;
  ------------------
  |  Branch (1703:5): [True: 40.8k, False: 2.34M]
  ------------------
 1704|   251k|    case 16: return TX_16X16; break;
  ------------------
  |  Branch (1704:5): [True: 251k, False: 2.13M]
  ------------------
 1705|  2.06M|    case 8: return TX_8X8; break;
  ------------------
  |  Branch (1705:5): [True: 2.06M, False: 321k]
  ------------------
 1706|      0|    default: return TX_4X4;
  ------------------
  |  Branch (1706:5): [True: 0, False: 2.38M]
  ------------------
 1707|  2.38M|  }
 1708|  2.38M|}
tx_search.c:max_block_wide:
 1568|   321k|                                 int plane) {
 1569|   321k|  assert(bsize < BLOCK_SIZES_ALL);
 1570|   321k|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|   321k|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 15.8k, False: 305k]
  ------------------
 1573|  15.8k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  15.8k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  15.8k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|   321k|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   321k|#define MI_SIZE_LOG2 2
  ------------------
 1579|   321k|}
tx_search.c:max_block_high:
 1582|   321k|                                 int plane) {
 1583|   321k|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|   321k|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 14.3k, False: 306k]
  ------------------
 1586|  14.3k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  14.3k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  14.3k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|   321k|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   321k|#define MI_SIZE_LOG2 2
  ------------------
 1592|   321k|}
tx_search.c:txfm_partition_update:
 1688|   212k|                                         TX_SIZE tx_size, TX_SIZE txb_size) {
 1689|   212k|  BLOCK_SIZE bsize = txsize_to_bsize[txb_size];
 1690|   212k|  int bh = mi_size_high[bsize];
 1691|   212k|  int bw = mi_size_wide[bsize];
 1692|   212k|  uint8_t txw = tx_size_wide[tx_size];
 1693|   212k|  uint8_t txh = tx_size_high[tx_size];
 1694|   212k|  int i;
 1695|   725k|  for (i = 0; i < bh; ++i) left_ctx[i] = txh;
  ------------------
  |  Branch (1695:15): [True: 513k, False: 212k]
  ------------------
 1696|   725k|  for (i = 0; i < bw; ++i) above_ctx[i] = txw;
  ------------------
  |  Branch (1696:15): [True: 512k, False: 212k]
  ------------------
 1697|   212k|}
tx_search.c:av1_num_planes:
 1273|  4.09M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  4.09M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  2.29M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 1.80M, False: 2.29M]
  ------------------
 1275|  4.09M|}
intra_mode_search.c:frame_is_intra_only:
 1176|  16.7M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  16.7M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 2.32M, False: 14.4M]
  ------------------
 1178|  14.4M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 14.4M]
  ------------------
 1179|  16.7M|}
intra_mode_search.c:av1_num_planes:
 1273|  76.3k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  76.3k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  57.9k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 18.3k, False: 57.9k]
  ------------------
 1275|  76.3k|}
intra_mode_search.c:max_block_wide:
 1568|  27.8M|                                 int plane) {
 1569|  27.8M|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  27.8M|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  27.8M|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 73.9k, False: 27.8M]
  ------------------
 1573|  73.9k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|  73.9k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|  73.9k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  27.8M|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  27.8M|#define MI_SIZE_LOG2 2
  ------------------
 1579|  27.8M|}
intra_mode_search.c:max_block_high:
 1582|  27.8M|                                 int plane) {
 1583|  27.8M|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  27.8M|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 83.9k, False: 27.8M]
  ------------------
 1586|  83.9k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  83.9k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  83.9k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  27.8M|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  27.8M|#define MI_SIZE_LOG2 2
  ------------------
 1592|  27.8M|}
var_based_part.c:frame_is_intra_only:
 1176|  1.56M|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  1.56M|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 296k, False: 1.26M]
  ------------------
 1178|  1.26M|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 18.4E, False: 1.26M]
  ------------------
 1179|  1.56M|}
var_based_part.c:get_mi_grid_idx:
 1658|   618k|                                  int mi_row, int mi_col) {
 1659|   618k|  return mi_row * mi_params->mi_stride + mi_col;
 1660|   618k|}
var_based_part.c:get_ref_frame_buf:
 1196|  88.4k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  88.4k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  88.4k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  88.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 88.4k, False: 18.4E]
  ------------------
 1199|  88.4k|}
var_based_part.c:get_ref_frame_map_idx:
 1189|   137k|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|   137k|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 137k, False: 0]
  |  Branch (1190:38): [True: 137k, False: 18.4E]
  ------------------
 1191|   137k|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|   137k|}
var_based_part.c:av1_num_planes:
 1273|  40.5k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  40.5k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  14.1k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 26.3k, False: 14.1k]
  ------------------
 1275|  40.5k|}
var_based_part.c:get_ref_scale_factors:
 1210|  5.42k|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|  5.42k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|  5.42k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  5.42k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 5.42k, False: 0]
  ------------------
 1213|  5.42k|}
var_based_part.c:get_ref_scale_factors_const:
 1204|  44.0k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  44.0k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  44.0k|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  44.0k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 44.0k, False: 2]
  ------------------
 1207|  44.0k|}
var_based_part.c:get_alloc_mi_idx:
 1663|   618k|                                   int mi_row, int mi_col) {
 1664|   618k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|   618k|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|   618k|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|   618k|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|   618k|}
alloccommon.c:av1_num_planes:
 1273|   179k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   179k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  69.0k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 110k, False: 69.0k]
  ------------------
 1275|   179k|}
alloccommon.c:calc_mi_size:
 1341|   155k|static inline int calc_mi_size(int len) {
 1342|       |  // len is in mi units. Align to a multiple of SBs.
 1343|   155k|  return ALIGN_POWER_OF_TWO(len, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|   155k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1344|   155k|}
blockd.c:max_block_wide:
 1568|   108k|                                 int plane) {
 1569|   108k|  assert(bsize < BLOCK_SIZES_ALL);
 1570|   108k|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|   108k|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 108k, False: 0]
  ------------------
 1573|   108k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|   108k|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|   108k|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|   108k|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   108k|#define MI_SIZE_LOG2 2
  ------------------
 1579|   108k|}
blockd.c:max_block_high:
 1582|  94.1k|                                 int plane) {
 1583|  94.1k|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  94.1k|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 94.1k, False: 0]
  ------------------
 1586|  94.1k|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|  94.1k|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|  94.1k|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  94.1k|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  94.1k|#define MI_SIZE_LOG2 2
  ------------------
 1592|  94.1k|}
cdef.c:av1_num_planes:
 1273|   289k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   289k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   110k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 178k, False: 110k]
  ------------------
 1275|   289k|}
cfl.c:max_block_wide:
 1568|  25.4k|                                 int plane) {
 1569|  25.4k|  assert(bsize < BLOCK_SIZES_ALL);
 1570|  25.4k|  int max_blocks_wide = block_size_wide[bsize];
 1571|       |
 1572|  25.4k|  if (xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (1572:7): [True: 0, False: 25.4k]
  ------------------
 1573|      0|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1574|      0|    max_blocks_wide += xd->mb_to_right_edge >> (3 + pd->subsampling_x);
 1575|      0|  }
 1576|       |
 1577|       |  // Scale the width in the transform block unit.
 1578|  25.4k|  return max_blocks_wide >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  25.4k|#define MI_SIZE_LOG2 2
  ------------------
 1579|  25.4k|}
cfl.c:max_block_high:
 1582|  25.4k|                                 int plane) {
 1583|  25.4k|  int max_blocks_high = block_size_high[bsize];
 1584|       |
 1585|  25.4k|  if (xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (1585:7): [True: 0, False: 25.4k]
  ------------------
 1586|      0|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 1587|      0|    max_blocks_high += xd->mb_to_bottom_edge >> (3 + pd->subsampling_y);
 1588|      0|  }
 1589|       |
 1590|       |  // Scale the height in the transform block unit.
 1591|  25.4k|  return max_blocks_high >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  25.4k|#define MI_SIZE_LOG2 2
  ------------------
 1592|  25.4k|}
cfl.c:get_tx_size:
 1710|  25.4k|static inline TX_SIZE get_tx_size(int width, int height) {
 1711|  25.4k|  if (width == height) {
  ------------------
  |  Branch (1711:7): [True: 20.5k, False: 4.91k]
  ------------------
 1712|  20.5k|    return get_sqr_tx_size(width);
 1713|  20.5k|  }
 1714|  4.91k|  if (width < height) {
  ------------------
  |  Branch (1714:7): [True: 2.54k, False: 2.37k]
  ------------------
 1715|  2.54k|    if (width + width == height) {
  ------------------
  |  Branch (1715:9): [True: 2.54k, False: 0]
  ------------------
 1716|  2.54k|      switch (width) {
  ------------------
  |  Branch (1716:15): [True: 2.54k, False: 0]
  ------------------
 1717|  2.54k|        case 4: return TX_4X8; break;
  ------------------
  |  Branch (1717:9): [True: 2.54k, False: 0]
  ------------------
 1718|      0|        case 8: return TX_8X16; break;
  ------------------
  |  Branch (1718:9): [True: 0, False: 2.54k]
  ------------------
 1719|      0|        case 16: return TX_16X32; break;
  ------------------
  |  Branch (1719:9): [True: 0, False: 2.54k]
  ------------------
 1720|      0|        case 32: return TX_32X64; break;
  ------------------
  |  Branch (1720:9): [True: 0, False: 2.54k]
  ------------------
 1721|  2.54k|      }
 1722|  2.54k|    } else {
 1723|      0|      switch (width) {
  ------------------
  |  Branch (1723:15): [True: 0, False: 0]
  ------------------
 1724|      0|        case 4: return TX_4X16; break;
  ------------------
  |  Branch (1724:9): [True: 0, False: 0]
  ------------------
 1725|      0|        case 8: return TX_8X32; break;
  ------------------
  |  Branch (1725:9): [True: 0, False: 0]
  ------------------
 1726|      0|        case 16: return TX_16X64; break;
  ------------------
  |  Branch (1726:9): [True: 0, False: 0]
  ------------------
 1727|      0|      }
 1728|      0|    }
 1729|  2.54k|  } else {
 1730|  2.37k|    if (height + height == width) {
  ------------------
  |  Branch (1730:9): [True: 2.37k, False: 18.4E]
  ------------------
 1731|  2.37k|      switch (height) {
  ------------------
  |  Branch (1731:15): [True: 2.37k, False: 0]
  ------------------
 1732|  2.37k|        case 4: return TX_8X4; break;
  ------------------
  |  Branch (1732:9): [True: 2.37k, False: 0]
  ------------------
 1733|      0|        case 8: return TX_16X8; break;
  ------------------
  |  Branch (1733:9): [True: 0, False: 2.37k]
  ------------------
 1734|      0|        case 16: return TX_32X16; break;
  ------------------
  |  Branch (1734:9): [True: 0, False: 2.37k]
  ------------------
 1735|      0|        case 32: return TX_64X32; break;
  ------------------
  |  Branch (1735:9): [True: 0, False: 2.37k]
  ------------------
 1736|  2.37k|      }
 1737|  18.4E|    } else {
 1738|  18.4E|      switch (height) {
  ------------------
  |  Branch (1738:15): [True: 0, False: 18.4E]
  ------------------
 1739|      0|        case 4: return TX_16X4; break;
  ------------------
  |  Branch (1739:9): [True: 0, False: 18.4E]
  ------------------
 1740|      0|        case 8: return TX_32X8; break;
  ------------------
  |  Branch (1740:9): [True: 0, False: 18.4E]
  ------------------
 1741|      0|        case 16: return TX_64X16; break;
  ------------------
  |  Branch (1741:9): [True: 0, False: 18.4E]
  ------------------
 1742|  18.4E|      }
 1743|  18.4E|    }
 1744|  2.37k|  }
 1745|  4.91k|  assert(0);
 1746|      0|  return TX_4X4;
 1747|  4.91k|}
cfl.c:get_sqr_tx_size:
 1699|  20.5k|static inline TX_SIZE get_sqr_tx_size(int tx_dim) {
 1700|  20.5k|  switch (tx_dim) {
 1701|      0|    case 128:
  ------------------
  |  Branch (1701:5): [True: 0, False: 20.5k]
  ------------------
 1702|      0|    case 64: return TX_64X64; break;
  ------------------
  |  Branch (1702:5): [True: 0, False: 20.5k]
  ------------------
 1703|      0|    case 32: return TX_32X32; break;
  ------------------
  |  Branch (1703:5): [True: 0, False: 20.5k]
  ------------------
 1704|      0|    case 16: return TX_16X16; break;
  ------------------
  |  Branch (1704:5): [True: 0, False: 20.5k]
  ------------------
 1705|      0|    case 8: return TX_8X8; break;
  ------------------
  |  Branch (1705:5): [True: 0, False: 20.5k]
  ------------------
 1706|  20.5k|    default: return TX_4X4;
  ------------------
  |  Branch (1706:5): [True: 20.5k, False: 0]
  ------------------
 1707|  20.5k|  }
 1708|  20.5k|}
mvref_common.c:get_ref_frame_buf:
 1196|  3.74M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  3.74M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  3.74M|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  3.74M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 3.59M, False: 147k]
  ------------------
 1199|  3.74M|}
mvref_common.c:get_ref_frame_map_idx:
 1189|  3.74M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  3.74M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 3.74M, False: 9]
  |  Branch (1190:38): [True: 3.74M, False: 0]
  ------------------
 1191|  3.74M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  3.74M|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  3.74M|}
mvref_common.c:frame_is_intra_only:
 1176|   101k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   101k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 25.4k, False: 76.2k]
  ------------------
 1178|  76.2k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 76.2k]
  ------------------
 1179|   101k|}
reconinter.c:av1_num_planes:
 1273|  3.19M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  3.19M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  1.25M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 1.93M, False: 1.25M]
  ------------------
 1275|  3.19M|}
resize.c:av1_num_planes:
 1273|  92.0k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  92.0k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  34.9k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 57.0k, False: 34.9k]
  ------------------
 1275|  92.0k|}
restoration.c:av1_num_planes:
 1273|  21.6k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  21.6k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  8.15k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 13.4k, False: 8.15k]
  ------------------
 1275|  21.6k|}
thread_common.c:av1_num_planes:
 1273|   805k|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|   805k|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|   322k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 483k, False: 322k]
  ------------------
 1275|   805k|}
thread_common.c:frame_is_intra_only:
 1176|   137k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|   137k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 26.5k, False: 111k]
  ------------------
 1178|   111k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 111k]
  ------------------
 1179|   137k|}
encode_strategy.c:get_ref_frame_map_idx:
 1189|  1.17M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  1.17M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 1.17M, False: 0]
  |  Branch (1190:38): [True: 1.17M, False: 0]
  ------------------
 1191|  1.17M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  1.17M|             : INVALID_IDX;
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  1.17M|}
encode_strategy.c:get_ref_frame_buf:
 1196|   515k|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|   515k|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|   515k|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|   515k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 515k, False: 0]
  ------------------
 1199|   515k|}
encode_strategy.c:frame_is_intra_only:
 1176|  73.6k|static inline int frame_is_intra_only(const AV1_COMMON *const cm) {
 1177|  73.6k|  return cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1177:10): [True: 18.4k, False: 55.2k]
  ------------------
 1178|  55.2k|         cm->current_frame.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1178:10): [True: 0, False: 55.2k]
  ------------------
 1179|  73.6k|}
encode_strategy.c:frame_is_sframe:
 1181|  73.6k|static inline int frame_is_sframe(const AV1_COMMON *cm) {
 1182|  73.6k|  return cm->current_frame.frame_type == S_FRAME;
 1183|  73.6k|}
motion_search_facade.c:av1_num_planes:
 1273|  5.15M|static inline int av1_num_planes(const AV1_COMMON *cm) {
 1274|  5.15M|  return cm->seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  2.34M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1274:10): [True: 2.80M, False: 2.34M]
  ------------------
 1275|  5.15M|}
motion_search_facade.c:set_mi_offsets:
 1674|  3.00M|                                  int mi_col) {
 1675|       |  // 'mi_grid_base' should point to appropriate memory in 'mi'.
 1676|  3.00M|  const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
 1677|  3.00M|  const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
 1678|  3.00M|  mi_params->mi_grid_base[mi_grid_idx] = &mi_params->mi_alloc[mi_alloc_idx];
 1679|       |  // 'xd->mi' should point to an offset in 'mi_grid_base';
 1680|  3.00M|  xd->mi = mi_params->mi_grid_base + mi_grid_idx;
 1681|       |  // 'xd->tx_type_map' should point to an offset in 'mi_params->tx_type_map'.
 1682|  3.00M|  xd->tx_type_map = mi_params->tx_type_map + mi_grid_idx;
 1683|  3.00M|  xd->tx_type_map_stride = mi_params->mi_stride;
 1684|  3.00M|}
motion_search_facade.c:get_mi_grid_idx:
 1658|  3.00M|                                  int mi_row, int mi_col) {
 1659|  3.00M|  return mi_row * mi_params->mi_stride + mi_col;
 1660|  3.00M|}
motion_search_facade.c:get_alloc_mi_idx:
 1663|  3.00M|                                   int mi_row, int mi_col) {
 1664|  3.00M|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
 1665|  3.00M|  const int mi_alloc_row = mi_row / mi_alloc_size_1d;
 1666|  3.00M|  const int mi_alloc_col = mi_col / mi_alloc_size_1d;
 1667|       |
 1668|  3.00M|  return mi_alloc_row * mi_params->mi_alloc_stride + mi_alloc_col;
 1669|  3.00M|}
motion_search_facade.c:set_plane_n4:
 1347|  3.00M|                                const int num_planes) {
 1348|  3.00M|  int i;
 1349|  8.69M|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (1349:15): [True: 5.68M, False: 3.00M]
  ------------------
 1350|  5.68M|    xd->plane[i].width = (bw * MI_SIZE) >> xd->plane[i].subsampling_x;
  ------------------
  |  |   40|  5.68M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  5.68M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1351|  5.68M|    xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y;
  ------------------
  |  |   40|  5.68M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  5.68M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1352|       |
 1353|  5.68M|    xd->plane[i].width = AOMMAX(xd->plane[i].width, 4);
  ------------------
  |  |   35|  5.68M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 3.81M, False: 1.86M]
  |  |  ------------------
  ------------------
 1354|  5.68M|    xd->plane[i].height = AOMMAX(xd->plane[i].height, 4);
  ------------------
  |  |   35|  5.68M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 4.16M, False: 1.51M]
  |  |  ------------------
  ------------------
 1355|  5.68M|  }
 1356|  3.00M|}
motion_search_facade.c:get_ref_frame_buf:
 1196|  3.00M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1197|  3.00M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1198|  3.00M|  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
  ------------------
  |  |   15|  3.00M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1198:10): [True: 3.00M, False: 18.4E]
  ------------------
 1199|  3.00M|}
motion_search_facade.c:get_ref_frame_map_idx:
 1189|  12.0M|                                        const MV_REFERENCE_FRAME ref_frame) {
 1190|  12.0M|  return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
  ------------------
  |  Branch (1190:11): [True: 12.0M, False: 18.4E]
  |  Branch (1190:38): [True: 12.0M, False: 18.4E]
  ------------------
 1191|  12.0M|             ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
 1192|  18.4E|             : INVALID_IDX;
  ------------------
  |  |   15|  18.4E|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1193|  12.0M|}
motion_search_facade.c:get_ref_scale_factors:
 1210|  3.00M|    AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1211|  3.00M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1212|  3.00M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  3.00M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1212:10): [True: 3.00M, False: 18.4E]
  ------------------
 1213|  3.00M|}
motion_search_facade.c:get_ref_scale_factors_const:
 1204|  6.01M|    const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
 1205|  6.01M|  const int map_idx = get_ref_frame_map_idx(cm, ref_frame);
 1206|  6.01M|  return (map_idx != INVALID_IDX) ? &cm->ref_scale_factors[map_idx] : NULL;
  ------------------
  |  |   15|  6.01M|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1206:10): [True: 6.01M, False: 18.4E]
  ------------------
 1207|  6.01M|}

av1_highbd_iwht4x4_1_add_c:
   84|  10.0k|                                int dest_stride, int bd) {
   85|  10.0k|  int i;
   86|  10.0k|  tran_low_t a1, e1;
   87|  10.0k|  tran_low_t tmp[4];
   88|  10.0k|  const tran_low_t *ip = in;
   89|  10.0k|  tran_low_t *op = tmp;
   90|  10.0k|  uint16_t *dest = CONVERT_TO_SHORTPTR(dest8);
  ------------------
  |  |   79|  10.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   91|  10.0k|  (void)bd;
   92|       |
   93|  10.0k|  a1 = ip[0 * 4] >> UNIT_QUANT_SHIFT;
  ------------------
  |  |   21|  10.0k|#define UNIT_QUANT_SHIFT 2
  ------------------
   94|  10.0k|  e1 = a1 >> 1;
   95|  10.0k|  a1 -= e1;
   96|  10.0k|  op[0] = a1;
   97|  10.0k|  op[1] = op[2] = op[3] = e1;
   98|       |
   99|  10.0k|  ip = tmp;
  100|  50.4k|  for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (100:15): [True: 40.3k, False: 10.0k]
  ------------------
  101|  40.3k|    e1 = ip[0] >> 1;
  102|  40.3k|    a1 = ip[0] - e1;
  103|  40.3k|    dest[dest_stride * 0] =
  104|  40.3k|        highbd_clip_pixel_add(dest[dest_stride * 0], a1, bd);
  105|  40.3k|    dest[dest_stride * 1] =
  106|  40.3k|        highbd_clip_pixel_add(dest[dest_stride * 1], e1, bd);
  107|  40.3k|    dest[dest_stride * 2] =
  108|  40.3k|        highbd_clip_pixel_add(dest[dest_stride * 2], e1, bd);
  109|  40.3k|    dest[dest_stride * 3] =
  110|  40.3k|        highbd_clip_pixel_add(dest[dest_stride * 3], e1, bd);
  111|  40.3k|    ip++;
  112|  40.3k|    dest++;
  113|  40.3k|  }
  114|  10.0k|}

av1_loop_filter_init:
  110|  25.4k|void av1_loop_filter_init(AV1_COMMON *cm) {
  111|  25.4k|  assert(MB_MODE_COUNT == NELEMENTS(mode_lf_lut));
  112|  25.4k|  loop_filter_info_n *lfi = &cm->lf_info;
  113|  25.4k|  struct loopfilter *lf = &cm->lf;
  114|  25.4k|  int lvl;
  115|       |
  116|       |  // init limits for given sharpness
  117|  25.4k|  update_sharpness(lfi, lf->sharpness_level);
  118|       |
  119|       |  // init hev threshold const vectors
  120|  1.65M|  for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++)
  ------------------
  |  |   27|  1.65M|#define MAX_LOOP_FILTER 63
  ------------------
  |  Branch (120:17): [True: 1.62M, False: 25.4k]
  ------------------
  121|  1.62M|    memset(lfi->lfthr[lvl].hev_thr, (lvl >> 4), SIMD_WIDTH);
  ------------------
  |  |   30|  1.62M|#define SIMD_WIDTH 16
  ------------------
  122|  25.4k|}
av1_loop_filter_frame_init:
  128|   188k|                                int plane_end) {
  129|   188k|  int filt_lvl[MAX_MB_PLANE], filt_lvl_r[MAX_MB_PLANE];
  130|   188k|  int plane;
  131|   188k|  int seg_id;
  132|       |  // n_shift is the multiplier for lf_deltas
  133|       |  // the multiplier is 1 for when filter_lvl is between 0 and 31;
  134|       |  // 2 when filter_lvl is between 32 and 63
  135|   188k|  loop_filter_info_n *const lfi = &cm->lf_info;
  136|   188k|  struct loopfilter *const lf = &cm->lf;
  137|   188k|  const struct segmentation *const seg = &cm->seg;
  138|       |
  139|       |  // update sharpness limits
  140|   188k|  update_sharpness(lfi, lf->sharpness_level);
  141|       |
  142|   188k|  filt_lvl[0] = cm->lf.filter_level[0];
  143|   188k|  filt_lvl[1] = cm->lf.filter_level_u;
  144|   188k|  filt_lvl[2] = cm->lf.filter_level_v;
  145|       |
  146|   188k|  filt_lvl_r[0] = cm->lf.filter_level[1];
  147|   188k|  filt_lvl_r[1] = cm->lf.filter_level_u;
  148|   188k|  filt_lvl_r[2] = cm->lf.filter_level_v;
  149|       |
  150|   188k|  assert(plane_start >= AOM_PLANE_Y);
  151|   188k|  assert(plane_end <= MAX_MB_PLANE);
  152|       |
  153|   405k|  for (plane = plane_start; plane < plane_end; plane++) {
  ------------------
  |  Branch (153:29): [True: 216k, False: 188k]
  ------------------
  154|   216k|    if (plane == 0 && !filt_lvl[0] && !filt_lvl_r[0])
  ------------------
  |  Branch (154:9): [True: 120k, False: 95.5k]
  |  Branch (154:23): [True: 0, False: 120k]
  |  Branch (154:39): [True: 0, False: 0]
  ------------------
  155|      0|      break;
  156|   216k|    else if (plane == 1 && !filt_lvl[1])
  ------------------
  |  Branch (156:14): [True: 47.8k, False: 168k]
  |  Branch (156:28): [True: 1.84k, False: 46.0k]
  ------------------
  157|  1.84k|      continue;
  158|   214k|    else if (plane == 2 && !filt_lvl[2])
  ------------------
  |  Branch (158:14): [True: 47.7k, False: 166k]
  |  Branch (158:28): [True: 1.84k, False: 45.8k]
  ------------------
  159|  1.84k|      continue;
  160|       |
  161|  1.91M|    for (seg_id = 0; seg_id < MAX_SEGMENTS; seg_id++) {
  ------------------
  |  |   23|  1.91M|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (161:22): [True: 1.70M, False: 212k]
  ------------------
  162|  5.10M|      for (int dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (162:25): [True: 3.40M, False: 1.70M]
  ------------------
  163|  3.40M|        int lvl_seg = (dir == 0) ? filt_lvl[plane] : filt_lvl_r[plane];
  ------------------
  |  Branch (163:23): [True: 1.70M, False: 1.70M]
  ------------------
  164|  3.40M|        const int seg_lf_feature_id = seg_lvl_lf_lut[plane][dir];
  165|  3.40M|        if (segfeature_active(seg, seg_id, seg_lf_feature_id)) {
  ------------------
  |  Branch (165:13): [True: 0, False: 3.40M]
  ------------------
  166|      0|          const int data = get_segdata(&cm->seg, seg_id, seg_lf_feature_id);
  167|      0|          lvl_seg = clamp(lvl_seg + data, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  168|      0|        }
  169|       |
  170|  3.40M|        if (!lf->mode_ref_delta_enabled) {
  ------------------
  |  Branch (170:13): [True: 0, False: 3.40M]
  ------------------
  171|       |          // we could get rid of this if we assume that deltas are set to
  172|       |          // zero when not in use; encoder always uses deltas
  173|      0|          memset(lfi->lvl[plane][seg_id][dir], lvl_seg,
  174|      0|                 sizeof(lfi->lvl[plane][seg_id][dir]));
  175|  3.40M|        } else {
  176|  3.40M|          int ref, mode;
  177|  3.40M|          const int scale = 1 << (lvl_seg >> 5);
  178|  3.40M|          const int intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * scale;
  179|  3.40M|          lfi->lvl[plane][seg_id][dir][INTRA_FRAME][0] =
  180|  3.40M|              clamp(intra_lvl, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|  3.40M|#define MAX_LOOP_FILTER 63
  ------------------
  181|       |
  182|  27.2M|          for (ref = LAST_FRAME; ref < REF_FRAMES; ++ref) {
  ------------------
  |  Branch (182:34): [True: 23.8M, False: 3.40M]
  ------------------
  183|  71.5M|            for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
  ------------------
  |  |   74|  71.5M|#define MAX_MODE_LF_DELTAS 2
  ------------------
  |  Branch (183:28): [True: 47.6M, False: 23.8M]
  ------------------
  184|  47.6M|              const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * scale +
  185|  47.6M|                                    lf->mode_deltas[mode] * scale;
  186|  47.6M|              lfi->lvl[plane][seg_id][dir][ref][mode] =
  187|  47.6M|                  clamp(inter_lvl, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|  47.6M|#define MAX_LOOP_FILTER 63
  ------------------
  188|  47.6M|            }
  189|  23.8M|          }
  190|  3.40M|        }
  191|  3.40M|      }
  192|  1.70M|    }
  193|   212k|  }
  194|   188k|}
av1_filter_block_plane_vert:
 1308|  21.6k|                                 const uint32_t mi_row, const uint32_t mi_col) {
 1309|  21.6k|  const uint32_t scale_horz = plane_ptr->subsampling_x;
 1310|  21.6k|  const uint32_t scale_vert = plane_ptr->subsampling_y;
 1311|  21.6k|  uint8_t *const dst_ptr = plane_ptr->dst.buf;
 1312|  21.6k|  const int dst_stride = plane_ptr->dst.stride;
 1313|  21.6k|  const int plane_mi_rows =
 1314|  21.6k|      ROUND_POWER_OF_TWO(cm->mi_params.mi_rows, scale_vert);
  ------------------
  |  |   41|  21.6k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1315|  21.6k|  const int plane_mi_cols =
 1316|  21.6k|      ROUND_POWER_OF_TWO(cm->mi_params.mi_cols, scale_horz);
  ------------------
  |  |   41|  21.6k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1317|  21.6k|  const int y_range = AOMMIN((int)(plane_mi_rows - (mi_row >> scale_vert)),
  ------------------
  |  |   34|  21.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.8k, False: 2.84k]
  |  |  ------------------
  ------------------
 1318|  21.6k|                             (MAX_MIB_SIZE >> scale_vert));
 1319|  21.6k|  const int x_range = AOMMIN((int)(plane_mi_cols - (mi_col >> scale_horz)),
  ------------------
  |  |   34|  21.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.6k, False: 2.98k]
  |  |  ------------------
  ------------------
 1320|  21.6k|                             (MAX_MIB_SIZE >> scale_horz));
 1321|       |
 1322|   229k|  for (int y = 0; y < y_range; y++) {
  ------------------
  |  Branch (1322:19): [True: 207k, False: 21.6k]
  ------------------
 1323|   207k|    uint8_t *p = dst_ptr + y * MI_SIZE * dst_stride;
  ------------------
  |  |   40|   207k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   207k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1324|  1.21M|    for (int x = 0; x < x_range;) {
  ------------------
  |  Branch (1324:21): [True: 1.00M, False: 207k]
  ------------------
 1325|       |      // inner loop always filter vertical edges in a MI block. If MI size
 1326|       |      // is 8x8, it will filter the vertical edge aligned with a 8x8 block.
 1327|       |      // If 4x4 transform is used, it will then filter the internal edge
 1328|       |      //  aligned with a 4x4 block
 1329|  1.00M|      const uint32_t curr_x = ((mi_col * MI_SIZE) >> scale_horz) + x * MI_SIZE;
  ------------------
  |  |   40|  1.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const uint32_t curr_x = ((mi_col * MI_SIZE) >> scale_horz) + x * MI_SIZE;
  ------------------
  |  |   40|  1.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1330|  1.00M|      const uint32_t curr_y = ((mi_row * MI_SIZE) >> scale_vert) + y * MI_SIZE;
  ------------------
  |  |   40|  1.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const uint32_t curr_y = ((mi_row * MI_SIZE) >> scale_vert) + y * MI_SIZE;
  ------------------
  |  |   40|  1.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1331|  1.00M|      uint32_t advance_units;
 1332|  1.00M|      TX_SIZE tx_size;
 1333|  1.00M|      AV1_DEBLOCKING_PARAMETERS params;
 1334|  1.00M|      memset(&params, 0, sizeof(params));
 1335|       |
 1336|  1.00M|      tx_size =
 1337|  1.00M|          set_lpf_parameters(&params, ((ptrdiff_t)1 << scale_horz), cm, xd,
 1338|  1.00M|                             VERT_EDGE, curr_x, curr_y, plane, plane_ptr);
 1339|  1.00M|      if (tx_size == TX_INVALID) {
  ------------------
  |  Branch (1339:11): [True: 0, False: 1.00M]
  ------------------
 1340|      0|        params.filter_length = 0;
 1341|      0|        tx_size = TX_4X4;
 1342|      0|      }
 1343|       |
 1344|  1.00M|      filter_vert(p, dst_stride, &params, cm->seq_params, USE_SINGLE);
 1345|       |
 1346|       |      // advance the destination pointer
 1347|  1.00M|      advance_units = tx_size_wide_unit[tx_size];
 1348|  1.00M|      x += advance_units;
 1349|  1.00M|      p += advance_units * MI_SIZE;
  ------------------
  |  |   40|  1.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1350|  1.00M|    }
 1351|   207k|  }
 1352|  21.6k|}
av1_filter_block_plane_vert_opt:
 1358|   140k|    TX_SIZE *tx_buf, int num_mis_in_lpf_unit_height_log2) {
 1359|   140k|  uint8_t *const dst_ptr = plane_ptr->dst.buf;
 1360|   140k|  const int dst_stride = plane_ptr->dst.stride;
 1361|       |  // Ensure that mi_cols/mi_rows are calculated based on frame dimension aligned
 1362|       |  // to MI_SIZE.
 1363|   140k|  const int plane_mi_cols =
 1364|   140k|      CEIL_POWER_OF_TWO(plane_ptr->dst.width, MI_SIZE_LOG2);
  ------------------
  |  |   62|   140k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1365|   140k|  const int plane_mi_rows =
 1366|   140k|      CEIL_POWER_OF_TWO(plane_ptr->dst.height, MI_SIZE_LOG2);
  ------------------
  |  |   62|   140k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1367|       |  // Whenever 'pipeline_lpf_mt_with_enc' is enabled, height of the unit to
 1368|       |  // filter (i.e., y_range) is calculated based on the size of the superblock
 1369|       |  // used.
 1370|   140k|  const int y_range = AOMMIN((int)(plane_mi_rows - mi_row),
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 118k, False: 22.2k]
  |  |  ------------------
  ------------------
 1371|   140k|                             (1 << num_mis_in_lpf_unit_height_log2));
 1372|       |  // Width of the unit to filter (i.e., x_range) should always be calculated
 1373|       |  // based on maximum superblock size as this function is called for mi_col = 0,
 1374|       |  // MAX_MIB_SIZE, 2 * MAX_MIB_SIZE etc.
 1375|   140k|  const int x_range = AOMMIN((int)(plane_mi_cols - mi_col), MAX_MIB_SIZE);
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 123k, False: 16.6k]
  |  |  ------------------
  ------------------
 1376|   140k|  const ptrdiff_t mode_step = 1;
 1377|   726k|  for (int y = 0; y < y_range; y++) {
  ------------------
  |  Branch (1377:19): [True: 586k, False: 140k]
  ------------------
 1378|   586k|    const uint32_t curr_y = mi_row + y;
 1379|   586k|    const uint32_t x_start = mi_col;
 1380|   586k|    const uint32_t x_end = mi_col + x_range;
 1381|   586k|    int min_block_height = block_size_high[BLOCK_128X128];
 1382|   586k|    set_lpf_parameters_for_line_luma(params_buf, tx_buf, cm, xd, VERT_EDGE,
 1383|   586k|                                     x_start, curr_y, plane_ptr, x_end,
 1384|   586k|                                     mode_step, &min_block_height);
 1385|       |
 1386|   586k|    AV1_DEBLOCKING_PARAMETERS *params = params_buf;
 1387|   586k|    TX_SIZE *tx_size = tx_buf;
 1388|   586k|    USE_FILTER_TYPE use_filter_type = USE_SINGLE;
 1389|       |
 1390|   586k|    uint8_t *p = dst_ptr + y * MI_SIZE * dst_stride;
  ------------------
  |  |   40|   586k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   586k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1391|       |
 1392|   586k|    if ((y & 3) == 0 && (y + 3) < y_range && min_block_height >= 16) {
  ------------------
  |  Branch (1392:9): [True: 367k, False: 218k]
  |  Branch (1392:25): [True: 264k, False: 102k]
  |  Branch (1392:46): [True: 89.5k, False: 174k]
  ------------------
 1393|       |      // If we are on a row which is a multiple of 4, and the minimum height is
 1394|       |      // 16 pixels, then the current and right 3 cols must contain the same
 1395|       |      // prediction block. This is because dim 16 can only happen every unit of
 1396|       |      // 4 mi's.
 1397|  89.5k|      use_filter_type = USE_QUAD;
 1398|  89.5k|      y += 3;
 1399|   496k|    } else if ((y + 1) < y_range && min_block_height >= 8) {
  ------------------
  |  Branch (1399:16): [True: 426k, False: 70.6k]
  |  Branch (1399:37): [True: 406k, False: 19.4k]
  ------------------
 1400|   406k|      use_filter_type = USE_DUAL;
 1401|   406k|      y += 1;
 1402|   406k|    }
 1403|       |
 1404|  4.04M|    for (int x = 0; x < x_range;) {
  ------------------
  |  Branch (1404:21): [True: 3.46M, False: 586k]
  ------------------
 1405|  3.46M|      if (*tx_size == TX_INVALID) {
  ------------------
  |  Branch (1405:11): [True: 0, False: 3.46M]
  ------------------
 1406|      0|        params->filter_length = 0;
 1407|      0|        *tx_size = TX_4X4;
 1408|      0|      }
 1409|       |
 1410|  3.46M|      filter_vert(p, dst_stride, params, cm->seq_params, use_filter_type);
 1411|       |
 1412|       |      // advance the destination pointer
 1413|  3.46M|      const uint32_t advance_units = tx_size_wide_unit[*tx_size];
 1414|  3.46M|      x += advance_units;
 1415|  3.46M|      p += advance_units * MI_SIZE;
  ------------------
  |  |   40|  3.46M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.46M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1416|  3.46M|      params += advance_units;
 1417|  3.46M|      tx_size += advance_units;
 1418|  3.46M|    }
 1419|   586k|  }
 1420|   140k|}
av1_filter_block_plane_vert_opt_chroma:
 1427|  97.3k|    int num_mis_in_lpf_unit_height_log2) {
 1428|  97.3k|  const uint32_t scale_horz = plane_ptr->subsampling_x;
 1429|  97.3k|  const uint32_t scale_vert = plane_ptr->subsampling_y;
 1430|  97.3k|  const int dst_stride = plane_ptr->dst.stride;
 1431|       |  // Ensure that mi_cols/mi_rows are calculated based on frame dimension aligned
 1432|       |  // to MI_SIZE.
 1433|  97.3k|  const int mi_cols =
 1434|  97.3k|      ((plane_ptr->dst.width << scale_horz) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   40|  97.3k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    ((plane_ptr->dst.width << scale_horz) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  ------------------
 1435|  97.3k|  const int mi_rows =
 1436|  97.3k|      ((plane_ptr->dst.height << scale_vert) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   40|  97.3k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    ((plane_ptr->dst.height << scale_vert) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  ------------------
 1437|  97.3k|  const int plane_mi_rows = ROUND_POWER_OF_TWO(mi_rows, scale_vert);
  ------------------
  |  |   41|  97.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1438|  97.3k|  const int plane_mi_cols = ROUND_POWER_OF_TWO(mi_cols, scale_horz);
  ------------------
  |  |   41|  97.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1439|  97.3k|  const int y_range =
 1440|  97.3k|      AOMMIN((int)(plane_mi_rows - (mi_row >> scale_vert)),
  ------------------
  |  |   34|  97.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 83.9k, False: 13.4k]
  |  |  ------------------
  ------------------
 1441|  97.3k|             ((1 << num_mis_in_lpf_unit_height_log2) >> scale_vert));
 1442|  97.3k|  const int x_range = AOMMIN((int)(plane_mi_cols - (mi_col >> scale_horz)),
  ------------------
  |  |   34|  97.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 84.2k, False: 13.1k]
  |  |  ------------------
  ------------------
 1443|  97.3k|                             (MAX_MIB_SIZE >> scale_horz));
 1444|  97.3k|  const ptrdiff_t mode_step = (ptrdiff_t)1 << scale_horz;
 1445|       |
 1446|   528k|  for (int y = 0; y < y_range; y++) {
  ------------------
  |  Branch (1446:19): [True: 431k, False: 97.3k]
  ------------------
 1447|   431k|    const uint32_t curr_y = mi_row + (y << scale_vert);
 1448|   431k|    const uint32_t x_start = mi_col + (0 << scale_horz);
 1449|   431k|    const uint32_t x_end = mi_col + (x_range << scale_horz);
 1450|   431k|    int min_height = tx_size_high[TX_64X64];
 1451|   431k|    set_lpf_parameters_for_line_chroma(params_buf, tx_buf, cm, xd, VERT_EDGE,
 1452|   431k|                                       x_start, curr_y, plane_ptr, x_end,
 1453|   431k|                                       mode_step, scale_horz, scale_vert,
 1454|   431k|                                       &min_height, plane, joint_filter_chroma);
 1455|       |
 1456|   431k|    AV1_DEBLOCKING_PARAMETERS *params = params_buf;
 1457|   431k|    TX_SIZE *tx_size = tx_buf;
 1458|   431k|    int use_filter_type = USE_SINGLE;
 1459|   431k|    int y_inc = 0;
 1460|       |
 1461|   431k|    if ((y & 3) == 0 && (y + 3) < y_range && min_height >= 16) {
  ------------------
  |  Branch (1461:9): [True: 217k, False: 214k]
  |  Branch (1461:25): [True: 142k, False: 74.3k]
  |  Branch (1461:46): [True: 27.5k, False: 115k]
  ------------------
 1462|       |      // If we are on a row which is a multiple of 4, and the minimum height is
 1463|       |      // 16 pixels, then the current and below 3 rows must contain the same tx
 1464|       |      // block. This is because dim 16 can only happen every unit of 4 mi's.
 1465|  27.5k|      use_filter_type = USE_QUAD;
 1466|  27.5k|      y_inc = 3;
 1467|   403k|    } else if (y % 2 == 0 && (y + 1) < y_range && min_height >= 8) {
  ------------------
  |  Branch (1467:16): [True: 322k, False: 81.8k]
  |  Branch (1467:30): [True: 274k, False: 47.8k]
  |  Branch (1467:51): [True: 192k, False: 81.9k]
  ------------------
 1468|       |      // If we are on an even row, and the minimum height is 8 pixels, then the
 1469|       |      // current and below rows must contain the same tx block. This is because
 1470|       |      // dim 4 can only happen every unit of 2**0, and 8 every unit of 2**1,
 1471|       |      // etc.
 1472|   192k|      use_filter_type = USE_DUAL;
 1473|   192k|      y_inc = 1;
 1474|   192k|    }
 1475|       |
 1476|  2.76M|    for (int x = 0; x < x_range;) {
  ------------------
  |  Branch (1476:21): [True: 2.33M, False: 431k]
  ------------------
 1477|       |      // inner loop always filter vertical edges in a MI block. If MI size
 1478|       |      // is 8x8, it will filter the vertical edge aligned with a 8x8 block.
 1479|       |      // If 4x4 transform is used, it will then filter the internal edge
 1480|       |      //  aligned with a 4x4 block
 1481|  2.33M|      if (*tx_size == TX_INVALID) {
  ------------------
  |  Branch (1481:11): [True: 0, False: 2.33M]
  ------------------
 1482|      0|        params->filter_length = 0;
 1483|      0|        *tx_size = TX_4X4;
 1484|      0|      }
 1485|       |
 1486|  2.33M|      const int offset = y * MI_SIZE * dst_stride + x * MI_SIZE;
  ------------------
  |  |   40|  2.33M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.33M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const int offset = y * MI_SIZE * dst_stride + x * MI_SIZE;
  ------------------
  |  |   40|  2.33M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.33M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1487|  2.33M|      if (joint_filter_chroma) {
  ------------------
  |  Branch (1487:11): [True: 178k, False: 2.15M]
  ------------------
 1488|   178k|        uint8_t *u_dst = plane_ptr[0].dst.buf + offset;
 1489|   178k|        uint8_t *v_dst = plane_ptr[1].dst.buf + offset;
 1490|   178k|        filter_vert_chroma(u_dst, v_dst, dst_stride, params, cm->seq_params,
 1491|   178k|                           use_filter_type);
 1492|  2.15M|      } else {
 1493|  2.15M|        uint8_t *dst_ptr = plane_ptr->dst.buf + offset;
 1494|  2.15M|        filter_vert(dst_ptr, dst_stride, params, cm->seq_params,
 1495|  2.15M|                    use_filter_type);
 1496|  2.15M|      }
 1497|       |
 1498|       |      // advance the destination pointer
 1499|  2.33M|      const uint32_t advance_units = tx_size_wide_unit[*tx_size];
 1500|  2.33M|      x += advance_units;
 1501|  2.33M|      params += advance_units;
 1502|  2.33M|      tx_size += advance_units;
 1503|  2.33M|    }
 1504|   431k|    y += y_inc;
 1505|   431k|  }
 1506|  97.3k|}
av1_filter_block_plane_horz:
 1910|  21.6k|                                 const uint32_t mi_row, const uint32_t mi_col) {
 1911|  21.6k|  const uint32_t scale_horz = plane_ptr->subsampling_x;
 1912|  21.6k|  const uint32_t scale_vert = plane_ptr->subsampling_y;
 1913|  21.6k|  uint8_t *const dst_ptr = plane_ptr->dst.buf;
 1914|  21.6k|  const int dst_stride = plane_ptr->dst.stride;
 1915|  21.6k|  const int plane_mi_rows =
 1916|  21.6k|      ROUND_POWER_OF_TWO(cm->mi_params.mi_rows, scale_vert);
  ------------------
  |  |   41|  21.6k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1917|  21.6k|  const int plane_mi_cols =
 1918|  21.6k|      ROUND_POWER_OF_TWO(cm->mi_params.mi_cols, scale_horz);
  ------------------
  |  |   41|  21.6k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1919|  21.6k|  const int y_range = AOMMIN((int)(plane_mi_rows - (mi_row >> scale_vert)),
  ------------------
  |  |   34|  21.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.7k, False: 2.84k]
  |  |  ------------------
  ------------------
 1920|  21.6k|                             (MAX_MIB_SIZE >> scale_vert));
 1921|  21.6k|  const int x_range = AOMMIN((int)(plane_mi_cols - (mi_col >> scale_horz)),
  ------------------
  |  |   34|  21.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.6k, False: 2.98k]
  |  |  ------------------
  ------------------
 1922|  21.6k|                             (MAX_MIB_SIZE >> scale_horz));
 1923|   217k|  for (int x = 0; x < x_range; x++) {
  ------------------
  |  Branch (1923:19): [True: 195k, False: 21.6k]
  ------------------
 1924|   195k|    uint8_t *p = dst_ptr + x * MI_SIZE;
  ------------------
  |  |   40|   195k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   195k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1925|  1.18M|    for (int y = 0; y < y_range;) {
  ------------------
  |  Branch (1925:21): [True: 991k, False: 195k]
  ------------------
 1926|       |      // inner loop always filter vertical edges in a MI block. If MI size
 1927|       |      // is 8x8, it will first filter the vertical edge aligned with a 8x8
 1928|       |      // block. If 4x4 transform is used, it will then filter the internal
 1929|       |      // edge aligned with a 4x4 block
 1930|   991k|      const uint32_t curr_x = ((mi_col * MI_SIZE) >> scale_horz) + x * MI_SIZE;
  ------------------
  |  |   40|   991k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   991k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const uint32_t curr_x = ((mi_col * MI_SIZE) >> scale_horz) + x * MI_SIZE;
  ------------------
  |  |   40|   991k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   991k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1931|   991k|      const uint32_t curr_y = ((mi_row * MI_SIZE) >> scale_vert) + y * MI_SIZE;
  ------------------
  |  |   40|   991k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   991k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const uint32_t curr_y = ((mi_row * MI_SIZE) >> scale_vert) + y * MI_SIZE;
  ------------------
  |  |   40|   991k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   991k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1932|   991k|      uint32_t advance_units;
 1933|   991k|      TX_SIZE tx_size;
 1934|   991k|      AV1_DEBLOCKING_PARAMETERS params;
 1935|   991k|      memset(&params, 0, sizeof(params));
 1936|       |
 1937|   991k|      tx_size = set_lpf_parameters(
 1938|   991k|          &params, (cm->mi_params.mi_stride << scale_vert), cm, xd, HORZ_EDGE,
 1939|   991k|          curr_x, curr_y, plane, plane_ptr);
 1940|   991k|      if (tx_size == TX_INVALID) {
  ------------------
  |  Branch (1940:11): [True: 0, False: 991k]
  ------------------
 1941|      0|        params.filter_length = 0;
 1942|      0|        tx_size = TX_4X4;
 1943|      0|      }
 1944|       |
 1945|   991k|      filter_horz(p, dst_stride, &params, cm->seq_params, USE_SINGLE);
 1946|       |
 1947|       |      // advance the destination pointer
 1948|   991k|      advance_units = tx_size_high_unit[tx_size];
 1949|   991k|      y += advance_units;
 1950|   991k|      p += advance_units * dst_stride * MI_SIZE;
  ------------------
  |  |   40|   991k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   991k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1951|   991k|    }
 1952|   195k|  }
 1953|  21.6k|}
av1_filter_block_plane_horz_opt:
 1959|   140k|    TX_SIZE *tx_buf, int num_mis_in_lpf_unit_height_log2) {
 1960|   140k|  uint8_t *const dst_ptr = plane_ptr->dst.buf;
 1961|   140k|  const int dst_stride = plane_ptr->dst.stride;
 1962|       |  // Ensure that mi_cols/mi_rows are calculated based on frame dimension aligned
 1963|       |  // to MI_SIZE.
 1964|   140k|  const int plane_mi_cols =
 1965|   140k|      CEIL_POWER_OF_TWO(plane_ptr->dst.width, MI_SIZE_LOG2);
  ------------------
  |  |   62|   140k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1966|   140k|  const int plane_mi_rows =
 1967|   140k|      CEIL_POWER_OF_TWO(plane_ptr->dst.height, MI_SIZE_LOG2);
  ------------------
  |  |   62|   140k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1968|   140k|  const int y_range = AOMMIN((int)(plane_mi_rows - mi_row),
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 118k, False: 22.2k]
  |  |  ------------------
  ------------------
 1969|   140k|                             (1 << num_mis_in_lpf_unit_height_log2));
 1970|   140k|  const int x_range = AOMMIN((int)(plane_mi_cols - mi_col), MAX_MIB_SIZE);
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 123k, False: 16.6k]
  |  |  ------------------
  ------------------
 1971|       |
 1972|   140k|  const ptrdiff_t mode_step = cm->mi_params.mi_stride;
 1973|   777k|  for (int x = 0; x < x_range; x++) {
  ------------------
  |  Branch (1973:19): [True: 637k, False: 140k]
  ------------------
 1974|   637k|    const uint32_t curr_x = mi_col + x;
 1975|   637k|    const uint32_t y_start = mi_row;
 1976|   637k|    const uint32_t y_end = mi_row + y_range;
 1977|   637k|    int min_block_width = block_size_high[BLOCK_128X128];
 1978|   637k|    set_lpf_parameters_for_line_luma(params_buf, tx_buf, cm, xd, HORZ_EDGE,
 1979|   637k|                                     curr_x, y_start, plane_ptr, y_end,
 1980|   637k|                                     mode_step, &min_block_width);
 1981|       |
 1982|   637k|    AV1_DEBLOCKING_PARAMETERS *params = params_buf;
 1983|   637k|    TX_SIZE *tx_size = tx_buf;
 1984|   637k|    USE_FILTER_TYPE filter_type = USE_SINGLE;
 1985|       |
 1986|   637k|    uint8_t *p = dst_ptr + x * MI_SIZE;
  ------------------
  |  |   40|   637k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   637k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1987|       |
 1988|   637k|    if ((x & 3) == 0 && (x + 3) < x_range && min_block_width >= 16) {
  ------------------
  |  Branch (1988:9): [True: 399k, False: 237k]
  |  Branch (1988:25): [True: 291k, False: 108k]
  |  Branch (1988:46): [True: 98.6k, False: 193k]
  ------------------
 1989|       |      // If we are on a col which is a multiple of 4, and the minimum width is
 1990|       |      // 16 pixels, then the current and right 3 cols must contain the same
 1991|       |      // prediction block. This is because dim 16 can only happen every unit of
 1992|       |      // 4 mi's.
 1993|  98.6k|      filter_type = USE_QUAD;
 1994|  98.6k|      x += 3;
 1995|   538k|    } else if ((x + 1) < x_range && min_block_width >= 8) {
  ------------------
  |  Branch (1995:16): [True: 464k, False: 73.7k]
  |  Branch (1995:37): [True: 447k, False: 17.6k]
  ------------------
 1996|   447k|      filter_type = USE_DUAL;
 1997|   447k|      x += 1;
 1998|   447k|    }
 1999|       |
 2000|  4.09M|    for (int y = 0; y < y_range;) {
  ------------------
  |  Branch (2000:21): [True: 3.46M, False: 637k]
  ------------------
 2001|  3.46M|      if (*tx_size == TX_INVALID) {
  ------------------
  |  Branch (2001:11): [True: 0, False: 3.46M]
  ------------------
 2002|      0|        params->filter_length = 0;
 2003|      0|        *tx_size = TX_4X4;
 2004|      0|      }
 2005|       |
 2006|  3.46M|      filter_horz(p, dst_stride, params, cm->seq_params, filter_type);
 2007|       |
 2008|       |      // advance the destination pointer
 2009|  3.46M|      const uint32_t advance_units = tx_size_high_unit[*tx_size];
 2010|  3.46M|      y += advance_units;
 2011|  3.46M|      p += advance_units * dst_stride * MI_SIZE;
  ------------------
  |  |   40|  3.46M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.46M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 2012|  3.46M|      params += advance_units;
 2013|  3.46M|      tx_size += advance_units;
 2014|  3.46M|    }
 2015|   637k|  }
 2016|   140k|}
av1_filter_block_plane_horz_opt_chroma:
 2023|  97.3k|    int num_mis_in_lpf_unit_height_log2) {
 2024|  97.3k|  const uint32_t scale_horz = plane_ptr->subsampling_x;
 2025|  97.3k|  const uint32_t scale_vert = plane_ptr->subsampling_y;
 2026|  97.3k|  const int dst_stride = plane_ptr->dst.stride;
 2027|       |  // Ensure that mi_cols/mi_rows are calculated based on frame dimension aligned
 2028|       |  // to MI_SIZE.
 2029|  97.3k|  const int mi_cols =
 2030|  97.3k|      ((plane_ptr->dst.width << scale_horz) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   40|  97.3k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    ((plane_ptr->dst.width << scale_horz) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  ------------------
 2031|  97.3k|  const int mi_rows =
 2032|  97.3k|      ((plane_ptr->dst.height << scale_vert) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   40|  97.3k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    ((plane_ptr->dst.height << scale_vert) + MI_SIZE - 1) >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  97.3k|#define MI_SIZE_LOG2 2
  ------------------
 2033|  97.3k|  const int plane_mi_rows = ROUND_POWER_OF_TWO(mi_rows, scale_vert);
  ------------------
  |  |   41|  97.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2034|  97.3k|  const int plane_mi_cols = ROUND_POWER_OF_TWO(mi_cols, scale_horz);
  ------------------
  |  |   41|  97.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2035|  97.3k|  const int y_range =
 2036|  97.3k|      AOMMIN((int)(plane_mi_rows - (mi_row >> scale_vert)),
  ------------------
  |  |   34|  97.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 83.9k, False: 13.4k]
  |  |  ------------------
  ------------------
 2037|  97.3k|             ((1 << num_mis_in_lpf_unit_height_log2) >> scale_vert));
 2038|  97.3k|  const int x_range = AOMMIN((int)(plane_mi_cols - (mi_col >> scale_horz)),
  ------------------
  |  |   34|  97.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 84.2k, False: 13.1k]
  |  |  ------------------
  ------------------
 2039|  97.3k|                             (MAX_MIB_SIZE >> scale_horz));
 2040|  97.3k|  const ptrdiff_t mode_step = cm->mi_params.mi_stride << scale_vert;
 2041|   560k|  for (int x = 0; x < x_range; x++) {
  ------------------
  |  Branch (2041:19): [True: 462k, False: 97.3k]
  ------------------
 2042|   462k|    const uint32_t y_start = mi_row + (0 << scale_vert);
 2043|   462k|    const uint32_t curr_x = mi_col + (x << scale_horz);
 2044|   462k|    const uint32_t y_end = mi_row + (y_range << scale_vert);
 2045|   462k|    int min_width = tx_size_wide[TX_64X64];
 2046|   462k|    set_lpf_parameters_for_line_chroma(params_buf, tx_buf, cm, xd, HORZ_EDGE,
 2047|   462k|                                       curr_x, y_start, plane_ptr, y_end,
 2048|   462k|                                       mode_step, scale_horz, scale_vert,
 2049|   462k|                                       &min_width, plane, joint_filter_chroma);
 2050|       |
 2051|   462k|    AV1_DEBLOCKING_PARAMETERS *params = params_buf;
 2052|   462k|    TX_SIZE *tx_size = tx_buf;
 2053|   462k|    USE_FILTER_TYPE use_filter_type = USE_SINGLE;
 2054|   462k|    int x_inc = 0;
 2055|       |
 2056|   462k|    if ((x & 3) == 0 && (x + 3) < x_range && min_width >= 16) {
  ------------------
  |  Branch (2056:9): [True: 205k, False: 257k]
  |  Branch (2056:25): [True: 130k, False: 74.6k]
  |  Branch (2056:46): [True: 22.0k, False: 108k]
  ------------------
 2057|       |      // If we are on a col which is a multiple of 4, and the minimum width is
 2058|       |      // 16 pixels, then the current and right 3 cols must contain the same tx
 2059|       |      // block. This is because dim 16 can only happen every unit of 4 mi's.
 2060|  22.0k|      use_filter_type = USE_QUAD;
 2061|  22.0k|      x_inc = 3;
 2062|   440k|    } else if (x % 2 == 0 && (x + 1) < x_range && min_width >= 8) {
  ------------------
  |  Branch (2062:16): [True: 305k, False: 135k]
  |  Branch (2062:30): [True: 256k, False: 48.7k]
  |  Branch (2062:51): [True: 120k, False: 135k]
  ------------------
 2063|       |      // If we are on an even col, and the minimum width is 8 pixels, then the
 2064|       |      // current and left cols must contain the same tx block. This is because
 2065|       |      // dim 4 can only happen every unit of 2**0, and 8 every unit of 2**1,
 2066|       |      // etc.
 2067|   120k|      use_filter_type = USE_DUAL;
 2068|   120k|      x_inc = 1;
 2069|   120k|    }
 2070|       |
 2071|  2.78M|    for (int y = 0; y < y_range;) {
  ------------------
  |  Branch (2071:21): [True: 2.32M, False: 462k]
  ------------------
 2072|       |      // inner loop always filter vertical edges in a MI block. If MI size
 2073|       |      // is 8x8, it will first filter the vertical edge aligned with a 8x8
 2074|       |      // block. If 4x4 transform is used, it will then filter the internal
 2075|       |      // edge aligned with a 4x4 block
 2076|  2.32M|      if (*tx_size == TX_INVALID) {
  ------------------
  |  Branch (2076:11): [True: 0, False: 2.32M]
  ------------------
 2077|      0|        params->filter_length = 0;
 2078|      0|        *tx_size = TX_4X4;
 2079|      0|      }
 2080|       |
 2081|  2.32M|      const int offset = y * MI_SIZE * dst_stride + x * MI_SIZE;
  ------------------
  |  |   40|  2.32M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.32M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    const int offset = y * MI_SIZE * dst_stride + x * MI_SIZE;
  ------------------
  |  |   40|  2.32M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.32M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 2082|  2.32M|      if (joint_filter_chroma) {
  ------------------
  |  Branch (2082:11): [True: 169k, False: 2.15M]
  ------------------
 2083|   169k|        uint8_t *u_dst = plane_ptr[0].dst.buf + offset;
 2084|   169k|        uint8_t *v_dst = plane_ptr[1].dst.buf + offset;
 2085|   169k|        filter_horz_chroma(u_dst, v_dst, dst_stride, params, cm->seq_params,
 2086|   169k|                           use_filter_type);
 2087|  2.15M|      } else {
 2088|  2.15M|        uint8_t *dst_ptr = plane_ptr->dst.buf + offset;
 2089|  2.15M|        filter_horz(dst_ptr, dst_stride, params, cm->seq_params,
 2090|  2.15M|                    use_filter_type);
 2091|  2.15M|      }
 2092|       |
 2093|       |      // advance the destination pointer
 2094|  2.32M|      const int advance_units = tx_size_high_unit[*tx_size];
 2095|  2.32M|      y += advance_units;
 2096|  2.32M|      params += advance_units;
 2097|  2.32M|      tx_size += advance_units;
 2098|  2.32M|    }
 2099|   462k|    x += x_inc;
 2100|   462k|  }
 2101|  97.3k|}
av1_loopfilter.c:update_sharpness:
   47|   214k|static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
   48|   214k|  int lvl;
   49|       |
   50|       |  // For each possible value for the loop filter fill out limits
   51|  13.9M|  for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++) {
  ------------------
  |  |   27|  13.9M|#define MAX_LOOP_FILTER 63
  ------------------
  |  Branch (51:17): [True: 13.7M, False: 214k]
  ------------------
   52|       |    // Set loop filter parameters that control sharpness.
   53|  13.7M|    int block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4));
   54|       |
   55|  13.7M|    if (sharpness_lvl > 0) {
  ------------------
  |  Branch (55:9): [True: 4.01M, False: 9.70M]
  ------------------
   56|  4.01M|      if (block_inside_limit > (9 - sharpness_lvl))
  ------------------
  |  Branch (56:11): [True: 3.15M, False: 856k]
  ------------------
   57|  3.15M|        block_inside_limit = (9 - sharpness_lvl);
   58|  4.01M|    }
   59|       |
   60|  13.7M|    if (block_inside_limit < 1) block_inside_limit = 1;
  ------------------
  |  Branch (60:9): [True: 367k, False: 13.3M]
  ------------------
   61|       |
   62|  13.7M|    memset(lfi->lfthr[lvl].lim, block_inside_limit, SIMD_WIDTH);
  ------------------
  |  |   30|  13.7M|#define SIMD_WIDTH 16
  ------------------
   63|  13.7M|    memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit),
   64|  13.7M|           SIMD_WIDTH);
  ------------------
  |  |   30|  13.7M|#define SIMD_WIDTH 16
  ------------------
   65|  13.7M|  }
   66|   214k|}
av1_loopfilter.c:set_lpf_parameters:
  228|  1.97M|    const int plane, const struct macroblockd_plane *const plane_ptr) {
  229|       |  // reset to initial values
  230|  1.97M|  params->filter_length = 0;
  231|       |
  232|       |  // no deblocking is required
  233|  1.97M|  const uint32_t width = plane_ptr->dst.width;
  234|  1.97M|  const uint32_t height = plane_ptr->dst.height;
  235|  1.97M|  if ((width <= x) || (height <= y)) {
  ------------------
  |  Branch (235:7): [True: 75.6k, False: 1.89M]
  |  Branch (235:23): [True: 71.7k, False: 1.82M]
  ------------------
  236|       |    // just return the smallest transform unit size
  237|   167k|    return TX_4X4;
  238|   167k|  }
  239|       |
  240|  1.80M|  const uint32_t scale_horz = plane_ptr->subsampling_x;
  241|  1.80M|  const uint32_t scale_vert = plane_ptr->subsampling_y;
  242|       |  // for sub8x8 block, chroma prediction mode is obtained from the bottom/right
  243|       |  // mi structure of the co-located 8x8 luma block. so for chroma plane, mi_row
  244|       |  // and mi_col should map to the bottom/right mi structure, i.e, both mi_row
  245|       |  // and mi_col should be odd number for chroma plane.
  246|  1.80M|  const int mi_row = scale_vert | ((y << scale_vert) >> MI_SIZE_LOG2);
  ------------------
  |  |   39|  1.80M|#define MI_SIZE_LOG2 2
  ------------------
  247|  1.80M|  const int mi_col = scale_horz | ((x << scale_horz) >> MI_SIZE_LOG2);
  ------------------
  |  |   39|  1.80M|#define MI_SIZE_LOG2 2
  ------------------
  248|  1.80M|  MB_MODE_INFO **mi =
  249|  1.80M|      cm->mi_params.mi_grid_base + mi_row * cm->mi_params.mi_stride + mi_col;
  250|  1.80M|  const MB_MODE_INFO *mbmi = mi[0];
  251|       |  // If current mbmi is not correctly setup, return an invalid value to stop
  252|       |  // filtering. One example is that if this tile is not coded, then its mbmi
  253|       |  // it not set up.
  254|  1.80M|  if (mbmi == NULL) return TX_INVALID;
  ------------------
  |  Branch (254:7): [True: 0, False: 1.80M]
  ------------------
  255|       |
  256|  1.80M|  const TX_SIZE ts = get_transform_size(xd, mi[0], mi_row, mi_col, plane,
  257|  1.80M|                                        scale_horz, scale_vert);
  258|       |
  259|  1.80M|  {
  260|  1.80M|    const uint32_t coord = (VERT_EDGE == edge_dir) ? (x) : (y);
  ------------------
  |  Branch (260:28): [True: 925k, False: 877k]
  ------------------
  261|  1.80M|    const uint32_t transform_masks =
  262|  1.80M|        edge_dir == VERT_EDGE ? tx_size_wide[ts] - 1 : tx_size_high[ts] - 1;
  ------------------
  |  Branch (262:9): [True: 925k, False: 877k]
  ------------------
  263|  1.80M|    const int32_t tu_edge = (coord & transform_masks) ? (0) : (1);
  ------------------
  |  Branch (263:29): [True: 0, False: 1.80M]
  ------------------
  264|       |
  265|  1.80M|    if (!tu_edge) return ts;
  ------------------
  |  Branch (265:9): [True: 0, False: 1.80M]
  ------------------
  266|       |
  267|       |    // prepare outer edge parameters. deblock the edge if it's an edge of a TU
  268|  1.80M|    {
  269|  1.80M|      const uint32_t curr_level =
  270|  1.80M|          get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
  271|  1.80M|      const int curr_skipped = mbmi->skip_txfm && is_inter_block(mbmi);
  ------------------
  |  Branch (271:32): [True: 13.4k, False: 1.78M]
  |  Branch (271:51): [True: 13.4k, False: 29]
  ------------------
  272|  1.80M|      uint32_t level = curr_level;
  273|  1.80M|      if (coord) {
  ------------------
  |  Branch (273:11): [True: 1.50M, False: 299k]
  ------------------
  274|  1.50M|        {
  275|  1.50M|          const MB_MODE_INFO *const mi_prev = *(mi - mode_step);
  276|  1.50M|          if (mi_prev == NULL) return TX_INVALID;
  ------------------
  |  Branch (276:15): [True: 0, False: 1.50M]
  ------------------
  277|  1.50M|          const int pv_row =
  278|  1.50M|              (VERT_EDGE == edge_dir) ? (mi_row) : (mi_row - (1 << scale_vert));
  ------------------
  |  Branch (278:15): [True: 770k, False: 733k]
  ------------------
  279|  1.50M|          const int pv_col =
  280|  1.50M|              (VERT_EDGE == edge_dir) ? (mi_col - (1 << scale_horz)) : (mi_col);
  ------------------
  |  Branch (280:15): [True: 770k, False: 733k]
  ------------------
  281|  1.50M|          const TX_SIZE pv_ts = get_transform_size(
  282|  1.50M|              xd, mi_prev, pv_row, pv_col, plane, scale_horz, scale_vert);
  283|       |
  284|  1.50M|          const uint32_t pv_lvl =
  285|  1.50M|              get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
  286|       |
  287|  1.50M|          const int pv_skip_txfm =
  288|  1.50M|              mi_prev->skip_txfm && is_inter_block(mi_prev);
  ------------------
  |  Branch (288:15): [True: 9.28k, False: 1.49M]
  |  Branch (288:37): [True: 9.26k, False: 17]
  ------------------
  289|  1.50M|          const BLOCK_SIZE bsize = get_plane_block_size(
  290|  1.50M|              mbmi->bsize, plane_ptr->subsampling_x, plane_ptr->subsampling_y);
  291|  1.50M|          assert(bsize < BLOCK_SIZES_ALL);
  292|  1.50M|          const int prediction_masks = edge_dir == VERT_EDGE
  ------------------
  |  Branch (292:40): [True: 751k, False: 752k]
  ------------------
  293|  1.50M|                                           ? block_size_wide[bsize] - 1
  294|  1.50M|                                           : block_size_high[bsize] - 1;
  295|  1.50M|          const int32_t pu_edge = !(coord & prediction_masks);
  296|       |          // if the current and the previous blocks are skipped,
  297|       |          // deblock the edge if the edge belongs to a PU's edge only.
  298|  1.50M|          if ((curr_level || pv_lvl) &&
  ------------------
  |  Branch (298:16): [True: 1.50M, False: 0]
  |  Branch (298:30): [True: 0, False: 0]
  ------------------
  299|  1.47M|              (!pv_skip_txfm || !curr_skipped || pu_edge)) {
  ------------------
  |  Branch (299:16): [True: 1.45M, False: 9.26k]
  |  Branch (299:33): [True: 3.70k, False: 5.56k]
  |  Branch (299:50): [True: 5.53k, False: 23]
  ------------------
  300|  1.47M|            const int dim = (VERT_EDGE == edge_dir)
  ------------------
  |  Branch (300:29): [True: 754k, False: 716k]
  ------------------
  301|  1.47M|                                ? AOMMIN(tx_size_wide_unit_log2[ts],
  ------------------
  |  |   34|   754k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 83.5k, False: 671k]
  |  |  ------------------
  ------------------
  302|  1.47M|                                         tx_size_wide_unit_log2[pv_ts])
  303|  1.47M|                                : AOMMIN(tx_size_high_unit_log2[ts],
  ------------------
  |  |   34|   716k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 77.3k, False: 638k]
  |  |  ------------------
  ------------------
  304|  1.47M|                                         tx_size_high_unit_log2[pv_ts]);
  305|  1.47M|            if (plane) {
  ------------------
  |  Branch (305:17): [True: 327k, False: 1.14M]
  ------------------
  306|   327k|              params->filter_length = (dim == 0) ? 4 : 6;
  ------------------
  |  Branch (306:39): [True: 130k, False: 196k]
  ------------------
  307|  1.14M|            } else {
  308|  1.14M|              assert(dim < TX_SIZES);
  309|  1.14M|              assert(dim >= 0);
  310|  1.14M|              params->filter_length = tx_dim_to_filter_length[dim];
  311|  1.14M|            }
  312|       |
  313|       |            // update the level if the current block is skipped,
  314|       |            // but the previous one is not
  315|  1.47M|            level = (curr_level) ? (curr_level) : (pv_lvl);
  ------------------
  |  Branch (315:21): [True: 1.46M, False: 2.70k]
  ------------------
  316|  1.47M|          }
  317|  1.50M|        }
  318|  1.50M|      }
  319|       |      // prepare common parameters
  320|  1.80M|      if (params->filter_length) {
  ------------------
  |  Branch (320:11): [True: 1.46M, False: 333k]
  ------------------
  321|  1.46M|        const loop_filter_thresh *const limits = cm->lf_info.lfthr + level;
  322|  1.46M|        params->lfthr = limits;
  323|  1.46M|      }
  324|  1.80M|    }
  325|  1.80M|  }
  326|       |
  327|      0|  return ts;
  328|  1.80M|}
av1_loopfilter.c:get_transform_size:
  199|  14.9M|                   const int ss_x, const int ss_y) {
  200|  14.9M|  assert(mbmi != NULL);
  201|  14.9M|  if (xd && xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (201:7): [True: 14.9M, False: 18.4E]
  |  Branch (201:13): [True: 0, False: 14.9M]
  ------------------
  202|       |
  203|  14.9M|  TX_SIZE tx_size = (plane == AOM_PLANE_Y)
  ------------------
  |  |  281|  14.9M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (203:21): [True: 9.75M, False: 5.22M]
  ------------------
  204|  14.9M|                        ? mbmi->tx_size
  205|  14.9M|                        : av1_get_max_uv_txsize(mbmi->bsize, ss_x, ss_y);
  206|  14.9M|  assert(tx_size < TX_SIZES_ALL);
  207|  14.9M|  if ((plane == AOM_PLANE_Y) && is_inter_block(mbmi) && !mbmi->skip_txfm) {
  ------------------
  |  |  281|  14.9M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (207:7): [True: 9.74M, False: 5.23M]
  |  Branch (207:33): [True: 2.88M, False: 6.86M]
  |  Branch (207:57): [True: 2.73M, False: 150k]
  ------------------
  208|  2.72M|    const BLOCK_SIZE sb_type = mbmi->bsize;
  209|  2.72M|    const int blk_row = mi_row & (mi_size_high[sb_type] - 1);
  210|  2.72M|    const int blk_col = mi_col & (mi_size_wide[sb_type] - 1);
  211|  2.72M|    const TX_SIZE mb_tx_size =
  212|  2.72M|        mbmi->inter_tx_size[av1_get_txb_size_index(sb_type, blk_row, blk_col)];
  213|  2.72M|    assert(mb_tx_size < TX_SIZES_ALL);
  214|  2.72M|    tx_size = mb_tx_size;
  215|  2.72M|  }
  216|       |
  217|  14.9M|  return tx_size;
  218|  14.9M|}
av1_loopfilter.c:get_filter_level:
   71|  12.8M|                                const MB_MODE_INFO *mbmi) {
   72|  12.8M|  const int segment_id = mbmi->segment_id;
   73|  12.8M|  if (cm->delta_q_info.delta_lf_present_flag) {
  ------------------
  |  Branch (73:7): [True: 0, False: 12.8M]
  ------------------
   74|      0|    int8_t delta_lf;
   75|      0|    if (cm->delta_q_info.delta_lf_multi) {
  ------------------
  |  Branch (75:9): [True: 0, False: 0]
  ------------------
   76|      0|      const int delta_lf_idx = delta_lf_id_lut[plane][dir_idx];
   77|      0|      delta_lf = mbmi->delta_lf[delta_lf_idx];
   78|      0|    } else {
   79|      0|      delta_lf = mbmi->delta_lf_from_base;
   80|      0|    }
   81|      0|    int base_level;
   82|      0|    if (plane == 0)
  ------------------
  |  Branch (82:9): [True: 0, False: 0]
  ------------------
   83|      0|      base_level = cm->lf.filter_level[dir_idx];
   84|      0|    else if (plane == 1)
  ------------------
  |  Branch (84:14): [True: 0, False: 0]
  ------------------
   85|      0|      base_level = cm->lf.filter_level_u;
   86|      0|    else
   87|      0|      base_level = cm->lf.filter_level_v;
   88|      0|    int lvl_seg = clamp(delta_lf + base_level, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
   89|      0|    assert(plane >= 0 && plane <= 2);
   90|      0|    const int seg_lf_feature_id = seg_lvl_lf_lut[plane][dir_idx];
   91|      0|    if (segfeature_active(&cm->seg, segment_id, seg_lf_feature_id)) {
  ------------------
  |  Branch (91:9): [True: 0, False: 0]
  ------------------
   92|      0|      const int data = get_segdata(&cm->seg, segment_id, seg_lf_feature_id);
   93|      0|      lvl_seg = clamp(lvl_seg + data, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
   94|      0|    }
   95|       |
   96|      0|    if (cm->lf.mode_ref_delta_enabled) {
  ------------------
  |  Branch (96:9): [True: 0, False: 0]
  ------------------
   97|      0|      const int scale = 1 << (lvl_seg >> 5);
   98|      0|      lvl_seg += cm->lf.ref_deltas[mbmi->ref_frame[0]] * scale;
   99|      0|      if (mbmi->ref_frame[0] > INTRA_FRAME)
  ------------------
  |  Branch (99:11): [True: 0, False: 0]
  ------------------
  100|      0|        lvl_seg += cm->lf.mode_deltas[mode_lf_lut[mbmi->mode]] * scale;
  101|      0|      lvl_seg = clamp(lvl_seg, 0, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  102|      0|    }
  103|      0|    return lvl_seg;
  104|  12.8M|  } else {
  105|  12.8M|    return lfi_n->lvl[plane][segment_id][dir_idx][mbmi->ref_frame[0]]
  106|  12.8M|                     [mode_lf_lut[mbmi->mode]];
  107|  12.8M|  }
  108|  12.8M|}
av1_loopfilter.c:filter_vert:
  909|  6.60M|                               USE_FILTER_TYPE use_filter_type) {
  910|  6.60M|  const loop_filter_thresh *limits = params->lfthr;
  911|  6.60M|#if CONFIG_AV1_HIGHBITDEPTH
  912|  6.60M|  const int use_highbitdepth = seq_params->use_highbitdepth;
  913|  6.60M|  const aom_bit_depth_t bit_depth = seq_params->bit_depth;
  914|  6.60M|  if (use_highbitdepth) {
  ------------------
  |  Branch (914:7): [True: 1.07M, False: 5.52M]
  ------------------
  915|  1.07M|    uint16_t *dst_shortptr = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  1.07M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  916|  1.07M|    if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (916:9): [True: 26.3k, False: 1.04M]
  ------------------
  917|  26.3k|      switch (params->filter_length) {
  918|       |        // apply 4-tap filtering
  919|      0|        case 4:
  ------------------
  |  Branch (919:9): [True: 0, False: 26.3k]
  ------------------
  920|      0|          aom_highbd_lpf_vertical_4_dual(
  921|      0|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  922|      0|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  923|      0|              bit_depth);
  924|      0|          aom_highbd_lpf_vertical_4_dual(
  925|      0|              dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  926|      0|              limits->mblim, limits->lim, limits->hev_thr, limits->mblim,
  927|      0|              limits->lim, limits->hev_thr, bit_depth);
  928|      0|          break;
  929|    562|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (929:9): [True: 562, False: 25.8k]
  ------------------
  930|    562|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    562|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
  931|    562|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  932|    562|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  933|    562|              bit_depth);
  934|    562|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    562|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
  935|    562|              dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|    562|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    562|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  936|    562|              limits->mblim, limits->lim, limits->hev_thr, limits->mblim,
  937|    562|              limits->lim, limits->hev_thr, bit_depth);
  938|    562|          break;
  939|       |        // apply 8-tap filtering
  940|  4.54k|        case 8:
  ------------------
  |  Branch (940:9): [True: 4.54k, False: 21.8k]
  ------------------
  941|  4.54k|          aom_highbd_lpf_vertical_8_dual(
  942|  4.54k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  943|  4.54k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  944|  4.54k|              bit_depth);
  945|  4.54k|          aom_highbd_lpf_vertical_8_dual(
  946|  4.54k|              dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|  4.54k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  4.54k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  947|  4.54k|              limits->mblim, limits->lim, limits->hev_thr, limits->mblim,
  948|  4.54k|              limits->lim, limits->hev_thr, bit_depth);
  949|  4.54k|          break;
  950|       |        // apply 14-tap filtering
  951|  1.98k|        case 14:
  ------------------
  |  Branch (951:9): [True: 1.98k, False: 24.3k]
  ------------------
  952|  1.98k|          aom_highbd_lpf_vertical_14_dual(
  953|  1.98k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  954|  1.98k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  955|  1.98k|              bit_depth);
  956|  1.98k|          aom_highbd_lpf_vertical_14_dual(
  957|  1.98k|              dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|  1.98k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.98k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  958|  1.98k|              limits->mblim, limits->lim, limits->hev_thr, limits->mblim,
  959|  1.98k|              limits->lim, limits->hev_thr, bit_depth);
  960|  1.98k|          break;
  961|       |        // no filtering
  962|  19.2k|        default: break;
  ------------------
  |  Branch (962:9): [True: 19.2k, False: 7.08k]
  ------------------
  963|  26.3k|      }
  964|  1.04M|    } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (964:16): [True: 471k, False: 577k]
  ------------------
  965|   471k|      switch (params->filter_length) {
  966|       |        // apply 4-tap filtering
  967|   199k|        case 4:
  ------------------
  |  Branch (967:9): [True: 199k, False: 271k]
  ------------------
  968|   199k|          aom_highbd_lpf_vertical_4_dual(
  969|   199k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  970|   199k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  971|   199k|              bit_depth);
  972|   199k|          break;
  973|  28.6k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (973:9): [True: 28.6k, False: 442k]
  ------------------
  974|  28.6k|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|  28.6k|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
  975|  28.6k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  976|  28.6k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  977|  28.6k|              bit_depth);
  978|  28.6k|          break;
  979|       |        // apply 8-tap filtering
  980|  96.4k|        case 8:
  ------------------
  |  Branch (980:9): [True: 96.4k, False: 374k]
  ------------------
  981|  96.4k|          aom_highbd_lpf_vertical_8_dual(
  982|  96.4k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  983|  96.4k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  984|  96.4k|              bit_depth);
  985|  96.4k|          break;
  986|       |        // apply 14-tap filtering
  987|  3.42k|        case 14:
  ------------------
  |  Branch (987:9): [True: 3.42k, False: 467k]
  ------------------
  988|  3.42k|          aom_highbd_lpf_vertical_14_dual(
  989|  3.42k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
  990|  3.42k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
  991|  3.42k|              bit_depth);
  992|  3.42k|          break;
  993|       |        // no filtering
  994|   144k|        default: break;
  ------------------
  |  Branch (994:9): [True: 144k, False: 327k]
  ------------------
  995|   471k|      }
  996|   577k|    } else {
  997|   577k|      assert(use_filter_type == USE_SINGLE);
  998|   577k|      switch (params->filter_length) {
  999|       |        // apply 4-tap filtering
 1000|   310k|        case 4:
  ------------------
  |  Branch (1000:9): [True: 310k, False: 267k]
  ------------------
 1001|   310k|          aom_highbd_lpf_vertical_4(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2592|   310k|#define aom_highbd_lpf_vertical_4 aom_highbd_lpf_vertical_4_sse2
  ------------------
 1002|   310k|                                    limits->lim, limits->hev_thr, bit_depth);
 1003|   310k|          break;
 1004|  41.1k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1004:9): [True: 41.1k, False: 536k]
  ------------------
 1005|  41.1k|          aom_highbd_lpf_vertical_6(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2601|  41.1k|#define aom_highbd_lpf_vertical_6 aom_highbd_lpf_vertical_6_sse2
  ------------------
 1006|  41.1k|                                    limits->lim, limits->hev_thr, bit_depth);
 1007|  41.1k|          break;
 1008|       |        // apply 8-tap filtering
 1009|  70.4k|        case 8:
  ------------------
  |  Branch (1009:9): [True: 70.4k, False: 506k]
  ------------------
 1010|  70.4k|          aom_highbd_lpf_vertical_8(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2609|  70.4k|#define aom_highbd_lpf_vertical_8 aom_highbd_lpf_vertical_8_sse2
  ------------------
 1011|  70.4k|                                    limits->lim, limits->hev_thr, bit_depth);
 1012|  70.4k|          break;
 1013|       |        // apply 14-tap filtering
 1014|  4.49k|        case 14:
  ------------------
  |  Branch (1014:9): [True: 4.49k, False: 572k]
  ------------------
 1015|  4.49k|          aom_highbd_lpf_vertical_14(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2583|  4.49k|#define aom_highbd_lpf_vertical_14 aom_highbd_lpf_vertical_14_sse2
  ------------------
 1016|  4.49k|                                     limits->lim, limits->hev_thr, bit_depth);
 1017|  4.49k|          break;
 1018|       |        // no filtering
 1019|   155k|        default: break;
  ------------------
  |  Branch (1019:9): [True: 155k, False: 422k]
  ------------------
 1020|   577k|      }
 1021|   577k|    }
 1022|  1.07M|    return;
 1023|  1.07M|  }
 1024|  5.52M|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1025|  5.52M|  if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1025:7): [True: 356k, False: 5.17M]
  ------------------
 1026|       |    // Only one set of loop filter parameters (mblim, lim and hev_thr) is
 1027|       |    // passed as argument to quad loop filter because quad loop filter is
 1028|       |    // called for those cases where all the 4 set of loop filter parameters
 1029|       |    // are equal.
 1030|   356k|    switch (params->filter_length) {
 1031|       |      // apply 4-tap filtering
 1032|      0|      case 4:
  ------------------
  |  Branch (1032:7): [True: 0, False: 356k]
  ------------------
 1033|      0|        aom_lpf_vertical_4_quad(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3784|      0|#define aom_lpf_vertical_4_quad aom_lpf_vertical_4_quad_sse2
  ------------------
 1034|      0|                                limits->hev_thr);
 1035|      0|        break;
 1036|  28.7k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1036:7): [True: 28.7k, False: 327k]
  ------------------
 1037|  28.7k|        aom_lpf_vertical_6_quad(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3796|  28.7k|#define aom_lpf_vertical_6_quad aom_lpf_vertical_6_quad_sse2
  ------------------
 1038|  28.7k|                                limits->hev_thr);
 1039|  28.7k|        break;
 1040|       |      // apply 8-tap filtering
 1041|   161k|      case 8:
  ------------------
  |  Branch (1041:7): [True: 161k, False: 195k]
  ------------------
 1042|   161k|        aom_lpf_vertical_8_quad(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3808|   161k|#define aom_lpf_vertical_8_quad aom_lpf_vertical_8_quad_sse2
  ------------------
 1043|   161k|                                limits->hev_thr);
 1044|   161k|        break;
 1045|       |      // apply 14-tap filtering
 1046|  90.7k|      case 14:
  ------------------
  |  Branch (1046:7): [True: 90.7k, False: 265k]
  ------------------
 1047|  90.7k|        aom_lpf_vertical_14_quad(dst, dst_stride, limits->mblim, limits->lim,
 1048|  90.7k|                                 limits->hev_thr);
 1049|  90.7k|        break;
 1050|       |      // no filtering
 1051|  77.6k|      default: break;
  ------------------
  |  Branch (1051:7): [True: 77.6k, False: 279k]
  ------------------
 1052|   356k|    }
 1053|  5.17M|  } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1053:14): [True: 3.15M, False: 2.01M]
  ------------------
 1054|  3.15M|    switch (params->filter_length) {
 1055|       |      // apply 4-tap filtering
 1056|  1.15M|      case 4:
  ------------------
  |  Branch (1056:7): [True: 1.15M, False: 1.99M]
  ------------------
 1057|  1.15M|        aom_lpf_vertical_4_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3780|  1.15M|#define aom_lpf_vertical_4_dual aom_lpf_vertical_4_dual_sse2
  ------------------
 1058|  1.15M|                                limits->hev_thr, limits->mblim, limits->lim,
 1059|  1.15M|                                limits->hev_thr);
 1060|  1.15M|        break;
 1061|   330k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1061:7): [True: 330k, False: 2.82M]
  ------------------
 1062|   330k|        aom_lpf_vertical_6_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3792|   330k|#define aom_lpf_vertical_6_dual aom_lpf_vertical_6_dual_sse2
  ------------------
 1063|   330k|                                limits->hev_thr, limits->mblim, limits->lim,
 1064|   330k|                                limits->hev_thr);
 1065|   330k|        break;
 1066|       |      // apply 8-tap filtering
 1067|  1.30M|      case 8:
  ------------------
  |  Branch (1067:7): [True: 1.30M, False: 1.85M]
  ------------------
 1068|  1.30M|        aom_lpf_vertical_8_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3804|  1.30M|#define aom_lpf_vertical_8_dual aom_lpf_vertical_8_dual_sse2
  ------------------
 1069|  1.30M|                                limits->hev_thr, limits->mblim, limits->lim,
 1070|  1.30M|                                limits->hev_thr);
 1071|  1.30M|        break;
 1072|       |      // apply 14-tap filtering
 1073|  46.6k|      case 14:
  ------------------
  |  Branch (1073:7): [True: 46.6k, False: 3.10M]
  ------------------
 1074|  46.6k|        aom_lpf_vertical_14_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3767|  46.6k|#define aom_lpf_vertical_14_dual aom_lpf_vertical_14_dual_sse2
  ------------------
 1075|  46.6k|                                 limits->hev_thr, limits->mblim, limits->lim,
 1076|  46.6k|                                 limits->hev_thr);
 1077|  46.6k|        break;
 1078|       |      // no filtering
 1079|   354k|      default: break;
  ------------------
  |  Branch (1079:7): [True: 354k, False: 2.80M]
  ------------------
 1080|  3.15M|    }
 1081|  3.15M|  } else {
 1082|  2.01M|    assert(use_filter_type == USE_SINGLE);
 1083|  2.01M|    switch (params->filter_length) {
 1084|       |      // apply 4-tap filtering
 1085|   942k|      case 4:
  ------------------
  |  Branch (1085:7): [True: 942k, False: 1.07M]
  ------------------
 1086|   942k|        aom_lpf_vertical_4(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3776|   942k|#define aom_lpf_vertical_4 aom_lpf_vertical_4_sse2
  ------------------
 1087|   942k|                           limits->hev_thr);
 1088|   942k|        break;
 1089|   143k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1089:7): [True: 143k, False: 1.87M]
  ------------------
 1090|   143k|        aom_lpf_vertical_6(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3788|   143k|#define aom_lpf_vertical_6 aom_lpf_vertical_6_sse2
  ------------------
 1091|   143k|                           limits->hev_thr);
 1092|   143k|        break;
 1093|       |      // apply 8-tap filtering
 1094|   592k|      case 8:
  ------------------
  |  Branch (1094:7): [True: 592k, False: 1.42M]
  ------------------
 1095|   592k|        aom_lpf_vertical_8(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3800|   592k|#define aom_lpf_vertical_8 aom_lpf_vertical_8_sse2
  ------------------
 1096|   592k|                           limits->hev_thr);
 1097|   592k|        break;
 1098|       |      // apply 14-tap filtering
 1099|  78.1k|      case 14:
  ------------------
  |  Branch (1099:7): [True: 78.1k, False: 1.93M]
  ------------------
 1100|  78.1k|        aom_lpf_vertical_14(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3763|  78.1k|#define aom_lpf_vertical_14 aom_lpf_vertical_14_sse2
  ------------------
 1101|  78.1k|                            limits->hev_thr);
 1102|  78.1k|        break;
 1103|       |      // no filtering
 1104|   344k|      default: break;
  ------------------
  |  Branch (1104:7): [True: 344k, False: 1.67M]
  ------------------
 1105|  2.01M|    }
 1106|  2.01M|  }
 1107|       |#if !CONFIG_AV1_HIGHBITDEPTH
 1108|       |  (void)seq_params;
 1109|       |#endif  // !CONFIG_AV1_HIGHBITDEPTH
 1110|  5.52M|}
av1_loopfilter.c:set_lpf_parameters_for_line_luma:
  733|  1.22M|    const ptrdiff_t mode_step, int *min_dim) {
  734|  1.22M|  const int is_vert = edge_dir == VERT_EDGE;
  735|       |
  736|  1.22M|  AV1_DEBLOCKING_PARAMETERS *params = params_buf;
  737|  1.22M|  TX_SIZE *tx_size = tx_buf;
  738|  1.22M|  uint32_t *counter_ptr = is_vert ? &mi_col : &mi_row;
  ------------------
  |  Branch (738:27): [True: 585k, False: 636k]
  ------------------
  739|  1.22M|  TX_SIZE prev_tx_size = TX_INVALID;
  740|       |
  741|       |  // Unroll the first iteration of the loop
  742|  1.22M|  set_one_param_for_line_luma(params, tx_size, cm, xd, edge_dir, mi_col, mi_row,
  743|  1.22M|                              plane_ptr, *counter_ptr, true, prev_tx_size,
  744|  1.22M|                              mode_step, min_dim);
  745|       |
  746|       |  // Advance
  747|  1.22M|  int advance_units =
  748|  1.22M|      is_vert ? tx_size_wide_unit[*tx_size] : tx_size_high_unit[*tx_size];
  ------------------
  |  Branch (748:7): [True: 585k, False: 636k]
  ------------------
  749|  1.22M|  prev_tx_size = *tx_size;
  750|  1.22M|  *counter_ptr += advance_units;
  751|  1.22M|  params += advance_units;
  752|  1.22M|  tx_size += advance_units;
  753|       |
  754|  6.92M|  while (*counter_ptr < mi_range) {
  ------------------
  |  Branch (754:10): [True: 5.70M, False: 1.22M]
  ------------------
  755|  5.70M|    set_one_param_for_line_luma(params, tx_size, cm, xd, edge_dir, mi_col,
  756|  5.70M|                                mi_row, plane_ptr, *counter_ptr, false,
  757|  5.70M|                                prev_tx_size, mode_step, min_dim);
  758|       |
  759|       |    // Advance
  760|  5.70M|    advance_units =
  761|  5.70M|        is_vert ? tx_size_wide_unit[*tx_size] : tx_size_high_unit[*tx_size];
  ------------------
  |  Branch (761:9): [True: 2.88M, False: 2.81M]
  ------------------
  762|  5.70M|    prev_tx_size = *tx_size;
  763|  5.70M|    *counter_ptr += advance_units;
  764|  5.70M|    params += advance_units;
  765|  5.70M|    tx_size += advance_units;
  766|  5.70M|  }
  767|  1.22M|}
av1_loopfilter.c:set_one_param_for_line_luma:
  652|  6.89M|    int *min_dim) {
  653|  6.89M|  (void)plane_ptr;
  654|  6.89M|  assert(mi_col << MI_SIZE_LOG2 < (uint32_t)plane_ptr->dst.width &&
  655|  6.89M|         mi_row << MI_SIZE_LOG2 < (uint32_t)plane_ptr->dst.height);
  656|  6.89M|  const int is_vert = edge_dir == VERT_EDGE;
  657|       |  // reset to initial values
  658|  6.89M|  params->filter_length = 0;
  659|       |
  660|  6.89M|  MB_MODE_INFO **mi =
  661|  6.89M|      cm->mi_params.mi_grid_base + mi_row * cm->mi_params.mi_stride + mi_col;
  662|  6.89M|  const MB_MODE_INFO *mbmi = mi[0];
  663|  6.89M|  assert(mbmi);
  664|       |
  665|  6.89M|  const TX_SIZE ts =
  666|  6.89M|      get_transform_size(xd, mi[0], mi_row, mi_col, AOM_PLANE_Y, 0, 0);
  ------------------
  |  |  281|  6.89M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  667|       |
  668|       |#ifndef NDEBUG
  669|       |  const uint32_t transform_masks =
  670|       |      is_vert ? tx_size_wide[ts] - 1 : tx_size_high[ts] - 1;
  671|       |  const int32_t tu_edge = ((coord * MI_SIZE) & transform_masks) ? (0) : (1);
  672|       |  assert(tu_edge);
  673|       |#endif  // NDEBUG
  674|       |  // If we are not the first block, then coord is always true, so
  675|       |  // !is_first_block is technically redundant. But we are keeping it here so the
  676|       |  // compiler can compile away this conditional if we pass in is_first_block :=
  677|       |  // false
  678|  6.89M|  bool curr_skipped = false;
  679|  6.89M|  if (!is_first_block || coord) {
  ------------------
  |  Branch (679:7): [True: 5.67M, False: 1.22M]
  |  Branch (679:26): [True: 198k, False: 1.02M]
  ------------------
  680|  5.87M|    const MB_MODE_INFO *const mi_prev = *(mi - mode_step);
  681|  5.87M|    const int pv_row = is_vert ? mi_row : (mi_row - 1);
  ------------------
  |  Branch (681:24): [True: 2.96M, False: 2.91M]
  ------------------
  682|  5.87M|    const int pv_col = is_vert ? (mi_col - 1) : mi_col;
  ------------------
  |  Branch (682:24): [True: 2.96M, False: 2.91M]
  ------------------
  683|  5.87M|    const TX_SIZE pv_ts =
  684|  5.87M|        is_first_block
  ------------------
  |  Branch (684:9): [True: 201k, False: 5.67M]
  ------------------
  685|  5.87M|            ? get_transform_size(xd, mi_prev, pv_row, pv_col, AOM_PLANE_Y, 0, 0)
  ------------------
  |  |  281|   201k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  686|  5.87M|            : prev_tx_size;
  687|  5.87M|    if (is_first_block) {
  ------------------
  |  Branch (687:9): [True: 200k, False: 5.67M]
  ------------------
  688|   200k|      *min_dim = is_vert ? block_size_high[mi_prev->bsize]
  ------------------
  |  Branch (688:18): [True: 80.1k, False: 120k]
  ------------------
  689|   200k|                         : block_size_wide[mi_prev->bsize];
  690|   200k|    }
  691|  5.87M|    assert(mi_prev);
  692|  5.87M|    uint8_t level =
  693|  5.87M|        get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y, mbmi);
  ------------------
  |  |  281|  5.87M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  694|  5.87M|    if (!level) {
  ------------------
  |  Branch (694:9): [True: 0, False: 5.87M]
  ------------------
  695|      0|      level =
  696|      0|          get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y, mi_prev);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  697|      0|    }
  698|       |
  699|  5.87M|    const int32_t pu_edge = mi_prev != mbmi;
  700|       |
  701|       |    // The quad loop filter assumes that all the transform blocks within a
  702|       |    // 8x16/16x8/16x16 prediction block are of the same size.
  703|  5.87M|    assert(IMPLIES(
  704|  5.87M|        !pu_edge && (mbmi->bsize >= BLOCK_8X16 && mbmi->bsize <= BLOCK_16X16),
  705|  5.87M|        pv_ts == ts));
  706|       |
  707|  5.87M|    if (!pu_edge) {
  ------------------
  |  Branch (707:9): [True: 1.24M, False: 4.63M]
  ------------------
  708|  1.24M|      curr_skipped = mbmi->skip_txfm && is_inter_block(mbmi);
  ------------------
  |  Branch (708:22): [True: 0, False: 1.24M]
  |  Branch (708:41): [True: 0, False: 0]
  ------------------
  709|  1.24M|    }
  710|  5.87M|    if ((pu_edge || !curr_skipped) && level) {
  ------------------
  |  Branch (710:10): [True: 4.63M, False: 1.24M]
  |  Branch (710:21): [True: 1.24M, False: 0]
  |  Branch (710:39): [True: 5.87M, False: 18.4E]
  ------------------
  711|  5.87M|      params->filter_length = is_vert ? vert_filter_length_luma[ts][pv_ts]
  ------------------
  |  Branch (711:31): [True: 2.96M, False: 2.91M]
  ------------------
  712|  5.87M|                                      : horz_filter_length_luma[ts][pv_ts];
  713|       |
  714|       |      // prepare common parameters
  715|  5.87M|      const loop_filter_thresh *const limits = cm->lf_info.lfthr + level;
  716|  5.87M|      params->lfthr = limits;
  717|  5.87M|    }
  718|  5.87M|  }
  719|  6.89M|  const int block_dim =
  720|  6.89M|      is_vert ? block_size_high[mbmi->bsize] : block_size_wide[mbmi->bsize];
  ------------------
  |  Branch (720:7): [True: 3.46M, False: 3.43M]
  ------------------
  721|  6.89M|  *min_dim = AOMMIN(*min_dim, block_dim);
  ------------------
  |  |   34|  6.89M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 271k, False: 6.62M]
  |  |  ------------------
  ------------------
  722|       |
  723|  6.89M|  *tx_size = ts;
  724|  6.89M|}
av1_loopfilter.c:set_lpf_parameters_for_line_chroma:
  867|   893k|    int *min_dim, int plane, int joint_filter_chroma) {
  868|   893k|  const int is_vert = edge_dir == VERT_EDGE;
  869|       |
  870|   893k|  AV1_DEBLOCKING_PARAMETERS *params = params_buf;
  871|   893k|  TX_SIZE *tx_size = tx_buf;
  872|   893k|  uint32_t *counter_ptr = is_vert ? &mi_col : &mi_row;
  ------------------
  |  Branch (872:27): [True: 431k, False: 462k]
  ------------------
  873|   893k|  const uint32_t scale = is_vert ? scale_horz : scale_vert;
  ------------------
  |  Branch (873:26): [True: 431k, False: 462k]
  ------------------
  874|   893k|  TX_SIZE prev_tx_size = TX_INVALID;
  875|       |
  876|       |  // Unroll the first iteration of the loop
  877|   893k|  set_one_param_for_line_chroma(params, tx_size, cm, xd, edge_dir, mi_col,
  878|   893k|                                mi_row, *counter_ptr, true, prev_tx_size,
  879|   893k|                                plane_ptr, mode_step, scale_horz, scale_vert,
  880|   893k|                                min_dim, plane, joint_filter_chroma);
  881|       |
  882|       |  // Advance
  883|   893k|  int advance_units =
  884|   893k|      is_vert ? tx_size_wide_unit[*tx_size] : tx_size_high_unit[*tx_size];
  ------------------
  |  Branch (884:7): [True: 431k, False: 462k]
  ------------------
  885|   893k|  prev_tx_size = *tx_size;
  886|   893k|  *counter_ptr += advance_units << scale;
  887|   893k|  params += advance_units;
  888|   893k|  tx_size += advance_units;
  889|       |
  890|  4.67M|  while (*counter_ptr < mi_range) {
  ------------------
  |  Branch (890:10): [True: 3.77M, False: 893k]
  ------------------
  891|  3.77M|    set_one_param_for_line_chroma(params, tx_size, cm, xd, edge_dir, mi_col,
  892|  3.77M|                                  mi_row, *counter_ptr, false, prev_tx_size,
  893|  3.77M|                                  plane_ptr, mode_step, scale_horz, scale_vert,
  894|  3.77M|                                  min_dim, plane, joint_filter_chroma);
  895|       |
  896|       |    // Advance
  897|  3.77M|    advance_units =
  898|  3.77M|        is_vert ? tx_size_wide_unit[*tx_size] : tx_size_high_unit[*tx_size];
  ------------------
  |  Branch (898:9): [True: 1.91M, False: 1.86M]
  ------------------
  899|  3.77M|    prev_tx_size = *tx_size;
  900|  3.77M|    *counter_ptr += advance_units << scale;
  901|  3.77M|    params += advance_units;
  902|  3.77M|    tx_size += advance_units;
  903|  3.77M|  }
  904|   893k|}
av1_loopfilter.c:set_one_param_for_line_chroma:
  776|  4.65M|    int joint_filter_chroma) {
  777|  4.65M|  const int is_vert = edge_dir == VERT_EDGE;
  778|  4.65M|  (void)plane_ptr;
  779|  4.65M|  assert((mi_col << MI_SIZE_LOG2) <
  780|  4.65M|             (uint32_t)(plane_ptr->dst.width << scale_horz) &&
  781|  4.65M|         (mi_row << MI_SIZE_LOG2) <
  782|  4.65M|             (uint32_t)(plane_ptr->dst.height << scale_vert));
  783|       |  // reset to initial values
  784|  4.65M|  params->filter_length = 0;
  785|       |
  786|       |  // for sub8x8 block, chroma prediction mode is obtained from the
  787|       |  // bottom/right mi structure of the co-located 8x8 luma block. so for chroma
  788|       |  // plane, mi_row and mi_col should map to the bottom/right mi structure,
  789|       |  // i.e, both mi_row and mi_col should be odd number for chroma plane.
  790|  4.65M|  mi_row |= scale_vert;
  791|  4.65M|  mi_col |= scale_horz;
  792|  4.65M|  MB_MODE_INFO **mi =
  793|  4.65M|      cm->mi_params.mi_grid_base + mi_row * cm->mi_params.mi_stride + mi_col;
  794|  4.65M|  const MB_MODE_INFO *mbmi = mi[0];
  795|  4.65M|  assert(mbmi);
  796|       |
  797|  4.65M|  const TX_SIZE ts = get_transform_size(xd, mi[0], mi_row, mi_col, plane,
  798|  4.65M|                                        scale_horz, scale_vert);
  799|  4.65M|  *tx_size = ts;
  800|       |
  801|       |#ifndef NDEBUG
  802|       |  const uint32_t transform_masks =
  803|       |      is_vert ? tx_size_wide[ts] - 1 : tx_size_high[ts] - 1;
  804|       |  const int32_t tu_edge = ((coord * MI_SIZE) & transform_masks) ? (0) : (1);
  805|       |  assert(tu_edge);
  806|       |#endif  // NDEBUG
  807|       |
  808|       |  // If we are not the first block, then coord is always true, so
  809|       |  // !is_first_block is technically redundant. But we are keeping it here so the
  810|       |  // compiler can compile away this conditional if we pass in is_first_block :=
  811|       |  // false
  812|  4.65M|  bool curr_skipped = false;
  813|  4.65M|  if (!is_first_block || coord) {
  ------------------
  |  Branch (813:7): [True: 3.76M, False: 893k]
  |  Branch (813:26): [True: 131k, False: 762k]
  ------------------
  814|  3.89M|    const MB_MODE_INFO *const mi_prev = *(mi - mode_step);
  815|  3.89M|    assert(mi_prev);
  816|  3.89M|    const int pv_row = is_vert ? (mi_row) : (mi_row - (1 << scale_vert));
  ------------------
  |  Branch (816:24): [True: 1.97M, False: 1.92M]
  ------------------
  817|  3.89M|    const int pv_col = is_vert ? (mi_col - (1 << scale_horz)) : (mi_col);
  ------------------
  |  Branch (817:24): [True: 1.97M, False: 1.92M]
  ------------------
  818|  3.89M|    const TX_SIZE pv_ts =
  819|  3.89M|        is_first_block ? get_transform_size(xd, mi_prev, pv_row, pv_col, plane,
  ------------------
  |  Branch (819:9): [True: 133k, False: 3.76M]
  ------------------
  820|   133k|                                            scale_horz, scale_vert)
  821|  3.89M|                       : prev_tx_size;
  822|  3.89M|    if (is_first_block) {
  ------------------
  |  Branch (822:9): [True: 133k, False: 3.76M]
  ------------------
  823|   133k|      *min_dim = is_vert ? tx_size_high[pv_ts] : tx_size_wide[pv_ts];
  ------------------
  |  Branch (823:18): [True: 61.7k, False: 71.4k]
  ------------------
  824|   133k|    }
  825|       |
  826|  3.89M|    uint8_t level = get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
  827|  3.89M|    if (!level) {
  ------------------
  |  Branch (827:9): [True: 0, False: 3.89M]
  ------------------
  828|      0|      level = get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
  829|      0|    }
  830|       |#ifndef NDEBUG
  831|       |    if (joint_filter_chroma) {
  832|       |      uint8_t v_level =
  833|       |          get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V, mbmi);
  834|       |      if (!v_level) {
  835|       |        v_level =
  836|       |            get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V, mi_prev);
  837|       |      }
  838|       |      assert(level == v_level);
  839|       |    }
  840|       |#else
  841|  3.89M|    (void)joint_filter_chroma;
  842|  3.89M|#endif  // NDEBUG
  843|  3.89M|    const int32_t pu_edge = mi_prev != mbmi;
  844|       |
  845|  3.89M|    if (!pu_edge) {
  ------------------
  |  Branch (845:9): [True: 10.8k, False: 3.88M]
  ------------------
  846|  10.8k|      curr_skipped = mbmi->skip_txfm && is_inter_block(mbmi);
  ------------------
  |  Branch (846:22): [True: 362, False: 10.4k]
  |  Branch (846:41): [True: 362, False: 0]
  ------------------
  847|  10.8k|    }
  848|       |    // For realtime mode, u and v have the same level
  849|  3.89M|    if ((!curr_skipped || pu_edge) && level) {
  ------------------
  |  Branch (849:10): [True: 3.89M, False: 362]
  |  Branch (849:27): [True: 0, False: 362]
  |  Branch (849:39): [True: 3.89M, False: 18.4E]
  ------------------
  850|  3.89M|      params->filter_length = is_vert ? vert_filter_length_chroma[ts][pv_ts]
  ------------------
  |  Branch (850:31): [True: 1.97M, False: 1.92M]
  ------------------
  851|  3.89M|                                      : horz_filter_length_chroma[ts][pv_ts];
  852|       |
  853|  3.89M|      const loop_filter_thresh *const limits = cm->lf_info.lfthr;
  854|  3.89M|      params->lfthr = limits + level;
  855|  3.89M|    }
  856|  3.89M|  }
  857|  4.65M|  const int tx_dim = is_vert ? tx_size_high[ts] : tx_size_wide[ts];
  ------------------
  |  Branch (857:22): [True: 2.33M, False: 2.31M]
  ------------------
  858|  4.65M|  *min_dim = AOMMIN(*min_dim, tx_dim);
  ------------------
  |  |   34|  4.65M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 147k, False: 4.50M]
  |  |  ------------------
  ------------------
  859|  4.65M|}
av1_loopfilter.c:filter_vert_chroma:
 1116|   178k|                                      USE_FILTER_TYPE use_filter_type) {
 1117|   178k|  const loop_filter_thresh *u_limits = params->lfthr;
 1118|   178k|  const loop_filter_thresh *v_limits = params->lfthr;
 1119|   178k|#if CONFIG_AV1_HIGHBITDEPTH
 1120|   178k|  const int use_highbitdepth = seq_params->use_highbitdepth;
 1121|   178k|  const aom_bit_depth_t bit_depth = seq_params->bit_depth;
 1122|   178k|  if (use_highbitdepth) {
  ------------------
  |  Branch (1122:7): [True: 13.2k, False: 165k]
  ------------------
 1123|  13.2k|    uint16_t *u_dst_shortptr = CONVERT_TO_SHORTPTR(u_dst);
  ------------------
  |  |   79|  13.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1124|  13.2k|    uint16_t *v_dst_shortptr = CONVERT_TO_SHORTPTR(v_dst);
  ------------------
  |  |   79|  13.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1125|  13.2k|    if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1125:9): [True: 646, False: 12.5k]
  ------------------
 1126|    646|      switch (params->filter_length) {
 1127|       |        // apply 4-tap filtering
 1128|      0|        case 4:
  ------------------
  |  Branch (1128:9): [True: 0, False: 646]
  ------------------
 1129|      0|          aom_highbd_lpf_vertical_4_dual(
 1130|      0|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1131|      0|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1132|      0|              u_limits->hev_thr, bit_depth);
 1133|      0|          aom_highbd_lpf_vertical_4_dual(
 1134|      0|              u_dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1135|      0|              u_limits->mblim, u_limits->lim, u_limits->hev_thr,
 1136|      0|              u_limits->mblim, u_limits->lim, u_limits->hev_thr, bit_depth);
 1137|      0|          aom_highbd_lpf_vertical_4_dual(
 1138|      0|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1139|      0|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1140|      0|              v_limits->hev_thr, bit_depth);
 1141|      0|          aom_highbd_lpf_vertical_4_dual(
 1142|      0|              v_dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1143|      0|              v_limits->mblim, v_limits->lim, v_limits->hev_thr,
 1144|      0|              v_limits->mblim, v_limits->lim, v_limits->hev_thr, bit_depth);
 1145|      0|          break;
 1146|    274|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1146:9): [True: 274, False: 372]
  ------------------
 1147|    274|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    274|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1148|    274|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1149|    274|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1150|    274|              u_limits->hev_thr, bit_depth);
 1151|    274|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    274|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1152|    274|              u_dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|    274|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    274|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1153|    274|              u_limits->mblim, u_limits->lim, u_limits->hev_thr,
 1154|    274|              u_limits->mblim, u_limits->lim, u_limits->hev_thr, bit_depth);
 1155|    274|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    274|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1156|    274|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1157|    274|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1158|    274|              v_limits->hev_thr, bit_depth);
 1159|    274|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|    274|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1160|    274|              v_dst_shortptr + (2 * MI_SIZE * dst_stride), dst_stride,
  ------------------
  |  |   40|    274|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    274|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1161|    274|              v_limits->mblim, v_limits->lim, v_limits->hev_thr,
 1162|    274|              v_limits->mblim, v_limits->lim, v_limits->hev_thr, bit_depth);
 1163|    274|          break;
 1164|      0|        case 8:
  ------------------
  |  Branch (1164:9): [True: 0, False: 646]
  ------------------
 1165|      0|        case 14: assert(0);
  ------------------
  |  Branch (1165:9): [True: 0, False: 646]
  ------------------
 1166|       |        // no filtering
 1167|    372|        default: break;
  ------------------
  |  Branch (1167:9): [True: 372, False: 274]
  ------------------
 1168|    646|      }
 1169|  12.5k|    } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1169:16): [True: 6.59k, False: 6.00k]
  ------------------
 1170|  6.59k|      switch (params->filter_length) {
 1171|       |        // apply 4-tap filtering
 1172|  1.54k|        case 4:
  ------------------
  |  Branch (1172:9): [True: 1.54k, False: 5.04k]
  ------------------
 1173|  1.54k|          aom_highbd_lpf_vertical_4_dual(
 1174|  1.54k|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1175|  1.54k|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1176|  1.54k|              u_limits->hev_thr, bit_depth);
 1177|  1.54k|          aom_highbd_lpf_vertical_4_dual(
 1178|  1.54k|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1179|  1.54k|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1180|  1.54k|              v_limits->hev_thr, bit_depth);
 1181|  1.54k|          break;
 1182|  1.99k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1182:9): [True: 1.99k, False: 4.59k]
  ------------------
 1183|  1.99k|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|  1.99k|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1184|  1.99k|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1185|  1.99k|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1186|  1.99k|              u_limits->hev_thr, bit_depth);
 1187|  1.99k|          aom_highbd_lpf_vertical_6_dual(
  ------------------
  |  | 2605|  1.99k|#define aom_highbd_lpf_vertical_6_dual aom_highbd_lpf_vertical_6_dual_sse2
  ------------------
 1188|  1.99k|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1189|  1.99k|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1190|  1.99k|              v_limits->hev_thr, bit_depth);
 1191|  1.99k|          break;
 1192|      0|        case 8:
  ------------------
  |  Branch (1192:9): [True: 0, False: 6.59k]
  ------------------
 1193|      0|        case 14: assert(0);
  ------------------
  |  Branch (1193:9): [True: 0, False: 6.59k]
  ------------------
 1194|       |        // no filtering
 1195|  3.05k|        default: break;
  ------------------
  |  Branch (1195:9): [True: 3.05k, False: 3.53k]
  ------------------
 1196|  6.59k|      }
 1197|  6.59k|    } else {
 1198|  6.00k|      assert(use_filter_type == USE_SINGLE);
 1199|  6.00k|      switch (params->filter_length) {
 1200|       |        // apply 4-tap filtering
 1201|  2.62k|        case 4:
  ------------------
  |  Branch (1201:9): [True: 2.62k, False: 3.38k]
  ------------------
 1202|  2.62k|          aom_highbd_lpf_vertical_4(u_dst_shortptr, dst_stride, u_limits->mblim,
  ------------------
  |  | 2592|  2.62k|#define aom_highbd_lpf_vertical_4 aom_highbd_lpf_vertical_4_sse2
  ------------------
 1203|  2.62k|                                    u_limits->lim, u_limits->hev_thr,
 1204|  2.62k|                                    bit_depth);
 1205|  2.62k|          aom_highbd_lpf_vertical_4(v_dst_shortptr, dst_stride, v_limits->mblim,
  ------------------
  |  | 2592|  2.62k|#define aom_highbd_lpf_vertical_4 aom_highbd_lpf_vertical_4_sse2
  ------------------
 1206|  2.62k|                                    v_limits->lim, v_limits->hev_thr,
 1207|  2.62k|                                    bit_depth);
 1208|  2.62k|          break;
 1209|    874|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1209:9): [True: 874, False: 5.12k]
  ------------------
 1210|    874|          aom_highbd_lpf_vertical_6(u_dst_shortptr, dst_stride, u_limits->mblim,
  ------------------
  |  | 2601|    874|#define aom_highbd_lpf_vertical_6 aom_highbd_lpf_vertical_6_sse2
  ------------------
 1211|    874|                                    u_limits->lim, u_limits->hev_thr,
 1212|    874|                                    bit_depth);
 1213|    874|          aom_highbd_lpf_vertical_6(v_dst_shortptr, dst_stride, v_limits->mblim,
  ------------------
  |  | 2601|    874|#define aom_highbd_lpf_vertical_6 aom_highbd_lpf_vertical_6_sse2
  ------------------
 1214|    874|                                    v_limits->lim, v_limits->hev_thr,
 1215|    874|                                    bit_depth);
 1216|    874|          break;
 1217|      0|        case 8:
  ------------------
  |  Branch (1217:9): [True: 0, False: 6.00k]
  ------------------
 1218|      0|        case 14: assert(0); break;
  ------------------
  |  Branch (1218:9): [True: 0, False: 6.00k]
  ------------------
 1219|       |        // no filtering
 1220|  2.50k|        default: break;
  ------------------
  |  Branch (1220:9): [True: 2.50k, False: 3.49k]
  ------------------
 1221|  6.00k|      }
 1222|  6.00k|    }
 1223|  13.2k|    return;
 1224|  13.2k|  }
 1225|   165k|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1226|   165k|  if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1226:7): [True: 21.2k, False: 144k]
  ------------------
 1227|       |    // Only one set of loop filter parameters (mblim, lim and hev_thr) is
 1228|       |    // passed as argument to quad loop filter because quad loop filter is
 1229|       |    // called for those cases where all the 4 set of loop filter parameters
 1230|       |    // are equal.
 1231|  21.2k|    switch (params->filter_length) {
 1232|       |      // apply 4-tap filtering
 1233|      0|      case 4:
  ------------------
  |  Branch (1233:7): [True: 0, False: 21.2k]
  ------------------
 1234|      0|        aom_lpf_vertical_4_quad(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3784|      0|#define aom_lpf_vertical_4_quad aom_lpf_vertical_4_quad_sse2
  ------------------
 1235|      0|                                u_limits->lim, u_limits->hev_thr);
 1236|      0|        aom_lpf_vertical_4_quad(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3784|      0|#define aom_lpf_vertical_4_quad aom_lpf_vertical_4_quad_sse2
  ------------------
 1237|      0|                                v_limits->lim, v_limits->hev_thr);
 1238|      0|        break;
 1239|  16.5k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1239:7): [True: 16.5k, False: 4.68k]
  ------------------
 1240|  16.5k|        aom_lpf_vertical_6_quad(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3796|  16.5k|#define aom_lpf_vertical_6_quad aom_lpf_vertical_6_quad_sse2
  ------------------
 1241|  16.5k|                                u_limits->lim, u_limits->hev_thr);
 1242|  16.5k|        aom_lpf_vertical_6_quad(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3796|  16.5k|#define aom_lpf_vertical_6_quad aom_lpf_vertical_6_quad_sse2
  ------------------
 1243|  16.5k|                                v_limits->lim, v_limits->hev_thr);
 1244|  16.5k|        break;
 1245|      0|      case 8:
  ------------------
  |  Branch (1245:7): [True: 0, False: 21.2k]
  ------------------
 1246|      0|      case 14: assert(0);
  ------------------
  |  Branch (1246:7): [True: 0, False: 21.2k]
  ------------------
 1247|       |      // no filtering
 1248|  4.72k|      default: break;
  ------------------
  |  Branch (1248:7): [True: 4.72k, False: 16.4k]
  ------------------
 1249|  21.2k|    }
 1250|   144k|  } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1250:14): [True: 62.7k, False: 81.5k]
  ------------------
 1251|  62.7k|    switch (params->filter_length) {
 1252|       |      // apply 4-tap filtering
 1253|  19.9k|      case 4:
  ------------------
  |  Branch (1253:7): [True: 19.9k, False: 42.7k]
  ------------------
 1254|  19.9k|        aom_lpf_vertical_4_dual(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3780|  19.9k|#define aom_lpf_vertical_4_dual aom_lpf_vertical_4_dual_sse2
  ------------------
 1255|  19.9k|                                u_limits->lim, u_limits->hev_thr,
 1256|  19.9k|                                u_limits->mblim, u_limits->lim,
 1257|  19.9k|                                u_limits->hev_thr);
 1258|  19.9k|        aom_lpf_vertical_4_dual(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3780|  19.9k|#define aom_lpf_vertical_4_dual aom_lpf_vertical_4_dual_sse2
  ------------------
 1259|  19.9k|                                v_limits->lim, v_limits->hev_thr,
 1260|  19.9k|                                v_limits->mblim, v_limits->lim,
 1261|  19.9k|                                v_limits->hev_thr);
 1262|  19.9k|        break;
 1263|  31.6k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1263:7): [True: 31.6k, False: 31.1k]
  ------------------
 1264|  31.6k|        aom_lpf_vertical_6_dual(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3792|  31.6k|#define aom_lpf_vertical_6_dual aom_lpf_vertical_6_dual_sse2
  ------------------
 1265|  31.6k|                                u_limits->lim, u_limits->hev_thr,
 1266|  31.6k|                                u_limits->mblim, u_limits->lim,
 1267|  31.6k|                                u_limits->hev_thr);
 1268|  31.6k|        aom_lpf_vertical_6_dual(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3792|  31.6k|#define aom_lpf_vertical_6_dual aom_lpf_vertical_6_dual_sse2
  ------------------
 1269|  31.6k|                                v_limits->lim, v_limits->hev_thr,
 1270|  31.6k|                                v_limits->mblim, v_limits->lim,
 1271|  31.6k|                                v_limits->hev_thr);
 1272|  31.6k|        break;
 1273|      0|      case 8:
  ------------------
  |  Branch (1273:7): [True: 0, False: 62.7k]
  ------------------
 1274|      0|      case 14: assert(0);
  ------------------
  |  Branch (1274:7): [True: 0, False: 62.7k]
  ------------------
 1275|       |      // no filtering
 1276|  11.2k|      default: break;
  ------------------
  |  Branch (1276:7): [True: 11.2k, False: 51.4k]
  ------------------
 1277|  62.7k|    }
 1278|  81.5k|  } else {
 1279|  81.5k|    assert(use_filter_type == USE_SINGLE);
 1280|  81.5k|    switch (params->filter_length) {
 1281|       |      // apply 4-tap filtering
 1282|  62.7k|      case 4:
  ------------------
  |  Branch (1282:7): [True: 62.7k, False: 18.8k]
  ------------------
 1283|  62.7k|        aom_lpf_vertical_4(u_dst, dst_stride, u_limits->mblim, u_limits->lim,
  ------------------
  |  | 3776|  62.7k|#define aom_lpf_vertical_4 aom_lpf_vertical_4_sse2
  ------------------
 1284|  62.7k|                           u_limits->hev_thr);
 1285|  62.7k|        aom_lpf_vertical_4(v_dst, dst_stride, v_limits->mblim, v_limits->lim,
  ------------------
  |  | 3776|  62.7k|#define aom_lpf_vertical_4 aom_lpf_vertical_4_sse2
  ------------------
 1286|  62.7k|                           u_limits->hev_thr);
 1287|  62.7k|        break;
 1288|  8.86k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1288:7): [True: 8.86k, False: 72.7k]
  ------------------
 1289|  8.86k|        aom_lpf_vertical_6(u_dst, dst_stride, u_limits->mblim, u_limits->lim,
  ------------------
  |  | 3788|  8.86k|#define aom_lpf_vertical_6 aom_lpf_vertical_6_sse2
  ------------------
 1290|  8.86k|                           u_limits->hev_thr);
 1291|  8.86k|        aom_lpf_vertical_6(v_dst, dst_stride, v_limits->mblim, v_limits->lim,
  ------------------
  |  | 3788|  8.86k|#define aom_lpf_vertical_6 aom_lpf_vertical_6_sse2
  ------------------
 1292|  8.86k|                           v_limits->hev_thr);
 1293|  8.86k|        break;
 1294|      0|      case 8:
  ------------------
  |  Branch (1294:7): [True: 0, False: 81.5k]
  ------------------
 1295|      0|      case 14: assert(0); break;
  ------------------
  |  Branch (1295:7): [True: 0, False: 81.5k]
  ------------------
 1296|       |      // no filtering
 1297|  10.5k|      default: break;
  ------------------
  |  Branch (1297:7): [True: 10.5k, False: 71.0k]
  ------------------
 1298|  81.5k|    }
 1299|  81.5k|  }
 1300|       |#if !CONFIG_AV1_HIGHBITDEPTH
 1301|       |  (void)seq_params;
 1302|       |#endif  // !CONFIG_AV1_HIGHBITDEPTH
 1303|   165k|}
av1_loopfilter.c:filter_horz:
 1511|  6.58M|                               USE_FILTER_TYPE use_filter_type) {
 1512|  6.58M|  const loop_filter_thresh *limits = params->lfthr;
 1513|  6.58M|#if CONFIG_AV1_HIGHBITDEPTH
 1514|  6.58M|  const int use_highbitdepth = seq_params->use_highbitdepth;
 1515|  6.58M|  const aom_bit_depth_t bit_depth = seq_params->bit_depth;
 1516|  6.58M|  if (use_highbitdepth) {
  ------------------
  |  Branch (1516:7): [True: 1.05M, False: 5.52M]
  ------------------
 1517|  1.05M|    uint16_t *dst_shortptr = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  1.05M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1518|  1.05M|    if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1518:9): [True: 28.1k, False: 1.03M]
  ------------------
 1519|  28.1k|      switch (params->filter_length) {
 1520|       |        // apply 4-tap filtering
 1521|      0|        case 4:
  ------------------
  |  Branch (1521:9): [True: 0, False: 28.1k]
  ------------------
 1522|      0|          aom_highbd_lpf_horizontal_4_dual(
 1523|      0|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1524|      0|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1525|      0|              bit_depth);
 1526|      0|          aom_highbd_lpf_horizontal_4_dual(
 1527|      0|              dst_shortptr + (2 * MI_SIZE), dst_stride, limits->mblim,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1528|      0|              limits->lim, limits->hev_thr, limits->mblim, limits->lim,
 1529|      0|              limits->hev_thr, bit_depth);
 1530|      0|          break;
 1531|    554|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1531:9): [True: 554, False: 27.6k]
  ------------------
 1532|    554|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    554|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1533|    554|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1534|    554|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1535|    554|              bit_depth);
 1536|    554|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    554|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1537|    554|              dst_shortptr + (2 * MI_SIZE), dst_stride, limits->mblim,
  ------------------
  |  |   40|    554|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    554|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1538|    554|              limits->lim, limits->hev_thr, limits->mblim, limits->lim,
 1539|    554|              limits->hev_thr, bit_depth);
 1540|    554|          break;
 1541|       |        // apply 8-tap filtering
 1542|  5.15k|        case 8:
  ------------------
  |  Branch (1542:9): [True: 5.15k, False: 23.0k]
  ------------------
 1543|  5.15k|          aom_highbd_lpf_horizontal_8_dual(
 1544|  5.15k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1545|  5.15k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1546|  5.15k|              bit_depth);
 1547|  5.15k|          aom_highbd_lpf_horizontal_8_dual(
 1548|  5.15k|              dst_shortptr + (2 * MI_SIZE), dst_stride, limits->mblim,
  ------------------
  |  |   40|  5.15k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  5.15k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1549|  5.15k|              limits->lim, limits->hev_thr, limits->mblim, limits->lim,
 1550|  5.15k|              limits->hev_thr, bit_depth);
 1551|  5.15k|          break;
 1552|       |        // apply 14-tap filtering
 1553|  1.95k|        case 14:
  ------------------
  |  Branch (1553:9): [True: 1.95k, False: 26.2k]
  ------------------
 1554|  1.95k|          aom_highbd_lpf_horizontal_14_dual(
 1555|  1.95k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1556|  1.95k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1557|  1.95k|              bit_depth);
 1558|  1.95k|          aom_highbd_lpf_horizontal_14_dual(
 1559|  1.95k|              dst_shortptr + (2 * MI_SIZE), dst_stride, limits->mblim,
  ------------------
  |  |   40|  1.95k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.95k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1560|  1.95k|              limits->lim, limits->hev_thr, limits->mblim, limits->lim,
 1561|  1.95k|              limits->hev_thr, bit_depth);
 1562|  1.95k|          break;
 1563|       |        // no filtering
 1564|  20.5k|        default: break;
  ------------------
  |  Branch (1564:9): [True: 20.5k, False: 7.65k]
  ------------------
 1565|  28.1k|      }
 1566|  1.03M|    } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1566:16): [True: 421k, False: 609k]
  ------------------
 1567|   421k|      switch (params->filter_length) {
 1568|       |        // apply 4-tap filtering
 1569|   168k|        case 4:
  ------------------
  |  Branch (1569:9): [True: 168k, False: 252k]
  ------------------
 1570|   168k|          aom_highbd_lpf_horizontal_4_dual(
 1571|   168k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1572|   168k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1573|   168k|              bit_depth);
 1574|   168k|          break;
 1575|  26.6k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1575:9): [True: 26.6k, False: 394k]
  ------------------
 1576|  26.6k|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|  26.6k|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1577|  26.6k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1578|  26.6k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1579|  26.6k|              bit_depth);
 1580|  26.6k|          break;
 1581|       |        // apply 8-tap filtering
 1582|  92.3k|        case 8:
  ------------------
  |  Branch (1582:9): [True: 92.3k, False: 329k]
  ------------------
 1583|  92.3k|          aom_highbd_lpf_horizontal_8_dual(
 1584|  92.3k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1585|  92.3k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1586|  92.3k|              bit_depth);
 1587|  92.3k|          break;
 1588|       |        // apply 14-tap filtering
 1589|  3.70k|        case 14:
  ------------------
  |  Branch (1589:9): [True: 3.70k, False: 417k]
  ------------------
 1590|  3.70k|          aom_highbd_lpf_horizontal_14_dual(
 1591|  3.70k|              dst_shortptr, dst_stride, limits->mblim, limits->lim,
 1592|  3.70k|              limits->hev_thr, limits->mblim, limits->lim, limits->hev_thr,
 1593|  3.70k|              bit_depth);
 1594|  3.70k|          break;
 1595|       |        // no filtering
 1596|   130k|        default: break;
  ------------------
  |  Branch (1596:9): [True: 130k, False: 290k]
  ------------------
 1597|   421k|      }
 1598|   609k|    } else {
 1599|   609k|      assert(use_filter_type == USE_SINGLE);
 1600|   609k|      switch (params->filter_length) {
 1601|       |        // apply 4-tap filtering
 1602|   289k|        case 4:
  ------------------
  |  Branch (1602:9): [True: 289k, False: 319k]
  ------------------
 1603|   289k|          aom_highbd_lpf_horizontal_4(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2557|   289k|#define aom_highbd_lpf_horizontal_4 aom_highbd_lpf_horizontal_4_sse2
  ------------------
 1604|   289k|                                      limits->lim, limits->hev_thr, bit_depth);
 1605|   289k|          break;
 1606|  82.5k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1606:9): [True: 82.5k, False: 527k]
  ------------------
 1607|  82.5k|          aom_highbd_lpf_horizontal_6(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2566|  82.5k|#define aom_highbd_lpf_horizontal_6 aom_highbd_lpf_horizontal_6_sse2
  ------------------
 1608|  82.5k|                                      limits->lim, limits->hev_thr, bit_depth);
 1609|  82.5k|          break;
 1610|       |        // apply 8-tap filtering
 1611|  67.0k|        case 8:
  ------------------
  |  Branch (1611:9): [True: 67.0k, False: 542k]
  ------------------
 1612|  67.0k|          aom_highbd_lpf_horizontal_8(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2574|  67.0k|#define aom_highbd_lpf_horizontal_8 aom_highbd_lpf_horizontal_8_sse2
  ------------------
 1613|  67.0k|                                      limits->lim, limits->hev_thr, bit_depth);
 1614|  67.0k|          break;
 1615|       |        // apply 14-tap filtering
 1616|  4.51k|        case 14:
  ------------------
  |  Branch (1616:9): [True: 4.51k, False: 605k]
  ------------------
 1617|  4.51k|          aom_highbd_lpf_horizontal_14(dst_shortptr, dst_stride, limits->mblim,
  ------------------
  |  | 2548|  4.51k|#define aom_highbd_lpf_horizontal_14 aom_highbd_lpf_horizontal_14_sse2
  ------------------
 1618|  4.51k|                                       limits->lim, limits->hev_thr, bit_depth);
 1619|  4.51k|          break;
 1620|       |        // no filtering
 1621|   172k|        default: break;
  ------------------
  |  Branch (1621:9): [True: 172k, False: 437k]
  ------------------
 1622|   609k|      }
 1623|   609k|    }
 1624|  1.06M|    return;
 1625|  1.05M|  }
 1626|  5.52M|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1627|  5.52M|  if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1627:7): [True: 329k, False: 5.19M]
  ------------------
 1628|       |    // Only one set of loop filter parameters (mblim, lim and hev_thr) is
 1629|       |    // passed as argument to quad loop filter because quad loop filter is
 1630|       |    // called for those cases where all the 4 set of loop filter parameters
 1631|       |    // are equal.
 1632|   329k|    switch (params->filter_length) {
 1633|       |      // apply 4-tap filtering
 1634|      0|      case 4:
  ------------------
  |  Branch (1634:7): [True: 0, False: 329k]
  ------------------
 1635|      0|        aom_lpf_horizontal_4_quad(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3733|      0|#define aom_lpf_horizontal_4_quad aom_lpf_horizontal_4_quad_sse2
  ------------------
 1636|      0|                                  limits->hev_thr);
 1637|      0|        break;
 1638|  11.8k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1638:7): [True: 11.8k, False: 318k]
  ------------------
 1639|  11.8k|        aom_lpf_horizontal_6_quad(dst, dst_stride, limits->mblim, limits->lim,
 1640|  11.8k|                                  limits->hev_thr);
 1641|  11.8k|        break;
 1642|       |      // apply 8-tap filtering
 1643|   164k|      case 8:
  ------------------
  |  Branch (1643:7): [True: 164k, False: 165k]
  ------------------
 1644|   164k|        aom_lpf_horizontal_8_quad(dst, dst_stride, limits->mblim, limits->lim,
 1645|   164k|                                  limits->hev_thr);
 1646|   164k|        break;
 1647|       |      // apply 14-tap filtering
 1648|  90.0k|      case 14:
  ------------------
  |  Branch (1648:7): [True: 90.0k, False: 239k]
  ------------------
 1649|  90.0k|        aom_lpf_horizontal_14_quad(dst, dst_stride, limits->mblim, limits->lim,
 1650|  90.0k|                                   limits->hev_thr);
 1651|  90.0k|        break;
 1652|       |      // no filtering
 1653|  65.8k|      default: break;
  ------------------
  |  Branch (1653:7): [True: 65.8k, False: 264k]
  ------------------
 1654|   329k|    }
 1655|  5.19M|  } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1655:14): [True: 2.73M, False: 2.45M]
  ------------------
 1656|  2.73M|    switch (params->filter_length) {
 1657|       |      // apply 4-tap filtering
 1658|   781k|      case 4:
  ------------------
  |  Branch (1658:7): [True: 781k, False: 1.95M]
  ------------------
 1659|   781k|        aom_lpf_horizontal_4_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3729|   781k|#define aom_lpf_horizontal_4_dual aom_lpf_horizontal_4_dual_sse2
  ------------------
 1660|   781k|                                  limits->hev_thr, limits->mblim, limits->lim,
 1661|   781k|                                  limits->hev_thr);
 1662|   781k|        break;
 1663|   322k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1663:7): [True: 322k, False: 2.41M]
  ------------------
 1664|   322k|        aom_lpf_horizontal_6_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3741|   322k|#define aom_lpf_horizontal_6_dual aom_lpf_horizontal_6_dual_sse2
  ------------------
 1665|   322k|                                  limits->hev_thr, limits->mblim, limits->lim,
 1666|   322k|                                  limits->hev_thr);
 1667|   322k|        break;
 1668|       |      // apply 8-tap filtering
 1669|  1.28M|      case 8:
  ------------------
  |  Branch (1669:7): [True: 1.28M, False: 1.45M]
  ------------------
 1670|  1.28M|        aom_lpf_horizontal_8_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3754|  1.28M|#define aom_lpf_horizontal_8_dual aom_lpf_horizontal_8_dual_sse2
  ------------------
 1671|  1.28M|                                  limits->hev_thr, limits->mblim, limits->lim,
 1672|  1.28M|                                  limits->hev_thr);
 1673|  1.28M|        break;
 1674|       |      // apply 14-tap filtering
 1675|  50.2k|      case 14:
  ------------------
  |  Branch (1675:7): [True: 50.2k, False: 2.68M]
  ------------------
 1676|  50.2k|        aom_lpf_horizontal_14_dual(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3716|  50.2k|#define aom_lpf_horizontal_14_dual aom_lpf_horizontal_14_dual_sse2
  ------------------
 1677|  50.2k|                                   limits->hev_thr, limits->mblim, limits->lim,
 1678|  50.2k|                                   limits->hev_thr);
 1679|  50.2k|        break;
 1680|       |      // no filtering
 1681|   327k|      default: break;
  ------------------
  |  Branch (1681:7): [True: 327k, False: 2.40M]
  ------------------
 1682|  2.73M|    }
 1683|  2.73M|  } else {
 1684|  2.45M|    assert(use_filter_type == USE_SINGLE);
 1685|  2.45M|    switch (params->filter_length) {
 1686|       |      // apply 4-tap filtering
 1687|   871k|      case 4:
  ------------------
  |  Branch (1687:7): [True: 871k, False: 1.58M]
  ------------------
 1688|   871k|        aom_lpf_horizontal_4(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3725|   871k|#define aom_lpf_horizontal_4 aom_lpf_horizontal_4_sse2
  ------------------
 1689|   871k|                             limits->hev_thr);
 1690|   871k|        break;
 1691|   574k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1691:7): [True: 574k, False: 1.88M]
  ------------------
 1692|   574k|        aom_lpf_horizontal_6(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3737|   574k|#define aom_lpf_horizontal_6 aom_lpf_horizontal_6_sse2
  ------------------
 1693|   574k|                             limits->hev_thr);
 1694|   574k|        break;
 1695|       |      // apply 8-tap filtering
 1696|   577k|      case 8:
  ------------------
  |  Branch (1696:7): [True: 577k, False: 1.87M]
  ------------------
 1697|   577k|        aom_lpf_horizontal_8(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3750|   577k|#define aom_lpf_horizontal_8 aom_lpf_horizontal_8_sse2
  ------------------
 1698|   577k|                             limits->hev_thr);
 1699|   577k|        break;
 1700|       |      // apply 14-tap filtering
 1701|  79.8k|      case 14:
  ------------------
  |  Branch (1701:7): [True: 79.8k, False: 2.37M]
  ------------------
 1702|  79.8k|        aom_lpf_horizontal_14(dst, dst_stride, limits->mblim, limits->lim,
  ------------------
  |  | 3712|  79.8k|#define aom_lpf_horizontal_14 aom_lpf_horizontal_14_sse2
  ------------------
 1703|  79.8k|                              limits->hev_thr);
 1704|  79.8k|        break;
 1705|       |      // no filtering
 1706|   401k|      default: break;
  ------------------
  |  Branch (1706:7): [True: 401k, False: 2.05M]
  ------------------
 1707|  2.45M|    }
 1708|  2.45M|  }
 1709|       |#if !CONFIG_AV1_HIGHBITDEPTH
 1710|       |  (void)seq_params;
 1711|       |#endif  // !CONFIG_AV1_HIGHBITDEPTH
 1712|  5.52M|}
av1_loopfilter.c:filter_horz_chroma:
 1718|   169k|                                      USE_FILTER_TYPE use_filter_type) {
 1719|   169k|  const loop_filter_thresh *u_limits = params->lfthr;
 1720|   169k|  const loop_filter_thresh *v_limits = params->lfthr;
 1721|   169k|#if CONFIG_AV1_HIGHBITDEPTH
 1722|   169k|  const int use_highbitdepth = seq_params->use_highbitdepth;
 1723|   169k|  const aom_bit_depth_t bit_depth = seq_params->bit_depth;
 1724|   169k|  if (use_highbitdepth) {
  ------------------
  |  Branch (1724:7): [True: 12.9k, False: 156k]
  ------------------
 1725|  12.9k|    uint16_t *u_dst_shortptr = CONVERT_TO_SHORTPTR(u_dst);
  ------------------
  |  |   79|  12.9k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1726|  12.9k|    uint16_t *v_dst_shortptr = CONVERT_TO_SHORTPTR(v_dst);
  ------------------
  |  |   79|  12.9k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1727|  12.9k|    if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1727:9): [True: 609, False: 12.3k]
  ------------------
 1728|    609|      switch (params->filter_length) {
 1729|       |        // apply 4-tap filtering
 1730|      0|        case 4:
  ------------------
  |  Branch (1730:9): [True: 0, False: 609]
  ------------------
 1731|      0|          aom_highbd_lpf_horizontal_4_dual(
 1732|      0|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1733|      0|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1734|      0|              u_limits->hev_thr, bit_depth);
 1735|      0|          aom_highbd_lpf_horizontal_4_dual(
 1736|      0|              u_dst_shortptr + (2 * MI_SIZE), dst_stride, u_limits->mblim,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1737|      0|              u_limits->lim, u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1738|      0|              u_limits->hev_thr, bit_depth);
 1739|      0|          aom_highbd_lpf_horizontal_4_dual(
 1740|      0|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1741|      0|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1742|      0|              v_limits->hev_thr, bit_depth);
 1743|      0|          aom_highbd_lpf_horizontal_4_dual(
 1744|      0|              v_dst_shortptr + (2 * MI_SIZE), dst_stride, v_limits->mblim,
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1745|      0|              v_limits->lim, v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1746|      0|              v_limits->hev_thr, bit_depth);
 1747|      0|          break;
 1748|    190|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1748:9): [True: 190, False: 419]
  ------------------
 1749|    190|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    190|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1750|    190|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1751|    190|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1752|    190|              u_limits->hev_thr, bit_depth);
 1753|    190|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    190|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1754|    190|              u_dst_shortptr + (2 * MI_SIZE), dst_stride, u_limits->mblim,
  ------------------
  |  |   40|    190|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    190|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1755|    190|              u_limits->lim, u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1756|    190|              u_limits->hev_thr, bit_depth);
 1757|    190|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    190|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1758|    190|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1759|    190|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1760|    190|              v_limits->hev_thr, bit_depth);
 1761|    190|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|    190|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1762|    190|              v_dst_shortptr + (2 * MI_SIZE), dst_stride, v_limits->mblim,
  ------------------
  |  |   40|    190|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    190|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1763|    190|              v_limits->lim, v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1764|    190|              v_limits->hev_thr, bit_depth);
 1765|    190|          break;
 1766|      0|        case 8:
  ------------------
  |  Branch (1766:9): [True: 0, False: 609]
  ------------------
 1767|      0|        case 14: assert(0);
  ------------------
  |  Branch (1767:9): [True: 0, False: 609]
  ------------------
 1768|       |        // no filtering
 1769|    419|        default: break;
  ------------------
  |  Branch (1769:9): [True: 419, False: 190]
  ------------------
 1770|    609|      }
 1771|  12.3k|    } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1771:16): [True: 3.52k, False: 8.84k]
  ------------------
 1772|  3.52k|      switch (params->filter_length) {
 1773|       |        // apply 4-tap filtering
 1774|    132|        case 4:
  ------------------
  |  Branch (1774:9): [True: 132, False: 3.39k]
  ------------------
 1775|    132|          aom_highbd_lpf_horizontal_4_dual(
 1776|    132|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1777|    132|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1778|    132|              u_limits->hev_thr, bit_depth);
 1779|    132|          aom_highbd_lpf_horizontal_4_dual(
 1780|    132|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1781|    132|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1782|    132|              v_limits->hev_thr, bit_depth);
 1783|    132|          break;
 1784|  1.63k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1784:9): [True: 1.63k, False: 1.89k]
  ------------------
 1785|  1.63k|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|  1.63k|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1786|  1.63k|              u_dst_shortptr, dst_stride, u_limits->mblim, u_limits->lim,
 1787|  1.63k|              u_limits->hev_thr, u_limits->mblim, u_limits->lim,
 1788|  1.63k|              u_limits->hev_thr, bit_depth);
 1789|  1.63k|          aom_highbd_lpf_horizontal_6_dual(
  ------------------
  |  | 2570|  1.63k|#define aom_highbd_lpf_horizontal_6_dual aom_highbd_lpf_horizontal_6_dual_sse2
  ------------------
 1790|  1.63k|              v_dst_shortptr, dst_stride, v_limits->mblim, v_limits->lim,
 1791|  1.63k|              v_limits->hev_thr, v_limits->mblim, v_limits->lim,
 1792|  1.63k|              v_limits->hev_thr, bit_depth);
 1793|  1.63k|          break;
 1794|      0|        case 8:
  ------------------
  |  Branch (1794:9): [True: 0, False: 3.52k]
  ------------------
 1795|      0|        case 14: assert(0);
  ------------------
  |  Branch (1795:9): [True: 0, False: 3.52k]
  ------------------
 1796|       |        // no filtering
 1797|  1.75k|        default: break;
  ------------------
  |  Branch (1797:9): [True: 1.75k, False: 1.77k]
  ------------------
 1798|  3.52k|      }
 1799|  8.84k|    } else {
 1800|  8.84k|      assert(use_filter_type == USE_SINGLE);
 1801|  8.84k|      switch (params->filter_length) {
 1802|       |        // apply 4-tap filtering
 1803|  2.42k|        case 4:
  ------------------
  |  Branch (1803:9): [True: 2.42k, False: 6.41k]
  ------------------
 1804|  2.42k|          aom_highbd_lpf_horizontal_4(u_dst_shortptr, dst_stride,
  ------------------
  |  | 2557|  2.42k|#define aom_highbd_lpf_horizontal_4 aom_highbd_lpf_horizontal_4_sse2
  ------------------
 1805|  2.42k|                                      u_limits->mblim, u_limits->lim,
 1806|  2.42k|                                      u_limits->hev_thr, bit_depth);
 1807|  2.42k|          aom_highbd_lpf_horizontal_4(v_dst_shortptr, dst_stride,
  ------------------
  |  | 2557|  2.42k|#define aom_highbd_lpf_horizontal_4 aom_highbd_lpf_horizontal_4_sse2
  ------------------
 1808|  2.42k|                                      v_limits->mblim, v_limits->lim,
 1809|  2.42k|                                      v_limits->hev_thr, bit_depth);
 1810|  2.42k|          break;
 1811|  2.97k|        case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1811:9): [True: 2.97k, False: 5.87k]
  ------------------
 1812|  2.97k|          aom_highbd_lpf_horizontal_6(u_dst_shortptr, dst_stride,
  ------------------
  |  | 2566|  2.97k|#define aom_highbd_lpf_horizontal_6 aom_highbd_lpf_horizontal_6_sse2
  ------------------
 1813|  2.97k|                                      u_limits->mblim, u_limits->lim,
 1814|  2.97k|                                      u_limits->hev_thr, bit_depth);
 1815|  2.97k|          aom_highbd_lpf_horizontal_6(v_dst_shortptr, dst_stride,
  ------------------
  |  | 2566|  2.97k|#define aom_highbd_lpf_horizontal_6 aom_highbd_lpf_horizontal_6_sse2
  ------------------
 1816|  2.97k|                                      v_limits->mblim, v_limits->lim,
 1817|  2.97k|                                      v_limits->hev_thr, bit_depth);
 1818|  2.97k|          break;
 1819|      0|        case 8:
  ------------------
  |  Branch (1819:9): [True: 0, False: 8.84k]
  ------------------
 1820|      0|        case 14: assert(0); break;
  ------------------
  |  Branch (1820:9): [True: 0, False: 8.84k]
  ------------------
 1821|       |        // no filtering
 1822|  3.44k|        default: break;
  ------------------
  |  Branch (1822:9): [True: 3.44k, False: 5.39k]
  ------------------
 1823|  8.84k|      }
 1824|  8.84k|    }
 1825|  12.9k|    return;
 1826|  12.9k|  }
 1827|   156k|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1828|   156k|  if (use_filter_type == USE_QUAD) {
  ------------------
  |  Branch (1828:7): [True: 14.0k, False: 142k]
  ------------------
 1829|       |    // Only one set of loop filter parameters (mblim, lim and hev_thr) is
 1830|       |    // passed as argument to quad loop filter because quad loop filter is
 1831|       |    // called for those cases where all the 4 set of loop filter parameters
 1832|       |    // are equal.
 1833|  14.0k|    switch (params->filter_length) {
 1834|       |      // apply 4-tap filtering
 1835|      0|      case 4:
  ------------------
  |  Branch (1835:7): [True: 0, False: 14.0k]
  ------------------
 1836|      0|        aom_lpf_horizontal_4_quad(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3733|      0|#define aom_lpf_horizontal_4_quad aom_lpf_horizontal_4_quad_sse2
  ------------------
 1837|      0|                                  u_limits->lim, u_limits->hev_thr);
 1838|      0|        aom_lpf_horizontal_4_quad(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3733|      0|#define aom_lpf_horizontal_4_quad aom_lpf_horizontal_4_quad_sse2
  ------------------
 1839|      0|                                  v_limits->lim, v_limits->hev_thr);
 1840|      0|        break;
 1841|  9.91k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1841:7): [True: 9.91k, False: 4.08k]
  ------------------
 1842|  9.91k|        aom_lpf_horizontal_6_quad(u_dst, dst_stride, u_limits->mblim,
 1843|  9.91k|                                  u_limits->lim, u_limits->hev_thr);
 1844|  9.91k|        aom_lpf_horizontal_6_quad(v_dst, dst_stride, v_limits->mblim,
 1845|  9.91k|                                  v_limits->lim, v_limits->hev_thr);
 1846|  9.91k|        break;
 1847|      0|      case 8:
  ------------------
  |  Branch (1847:7): [True: 0, False: 14.0k]
  ------------------
 1848|      0|      case 14: assert(0);
  ------------------
  |  Branch (1848:7): [True: 0, False: 14.0k]
  ------------------
 1849|       |      // no filtering
 1850|  4.11k|      default: break;
  ------------------
  |  Branch (1850:7): [True: 4.11k, False: 9.88k]
  ------------------
 1851|  14.0k|    }
 1852|   142k|  } else if (use_filter_type == USE_DUAL) {
  ------------------
  |  Branch (1852:14): [True: 41.5k, False: 101k]
  ------------------
 1853|  41.5k|    switch (params->filter_length) {
 1854|       |      // apply 4-tap filtering
 1855|  1.01k|      case 4:
  ------------------
  |  Branch (1855:7): [True: 1.01k, False: 40.5k]
  ------------------
 1856|  1.01k|        aom_lpf_horizontal_4_dual(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3729|  1.01k|#define aom_lpf_horizontal_4_dual aom_lpf_horizontal_4_dual_sse2
  ------------------
 1857|  1.01k|                                  u_limits->lim, u_limits->hev_thr,
 1858|  1.01k|                                  u_limits->mblim, u_limits->lim,
 1859|  1.01k|                                  u_limits->hev_thr);
 1860|  1.01k|        aom_lpf_horizontal_4_dual(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3729|  1.01k|#define aom_lpf_horizontal_4_dual aom_lpf_horizontal_4_dual_sse2
  ------------------
 1861|  1.01k|                                  v_limits->lim, v_limits->hev_thr,
 1862|  1.01k|                                  v_limits->mblim, v_limits->lim,
 1863|  1.01k|                                  v_limits->hev_thr);
 1864|  1.01k|        break;
 1865|  32.6k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1865:7): [True: 32.6k, False: 8.86k]
  ------------------
 1866|  32.6k|        aom_lpf_horizontal_6_dual(u_dst, dst_stride, u_limits->mblim,
  ------------------
  |  | 3741|  32.6k|#define aom_lpf_horizontal_6_dual aom_lpf_horizontal_6_dual_sse2
  ------------------
 1867|  32.6k|                                  u_limits->lim, u_limits->hev_thr,
 1868|  32.6k|                                  u_limits->mblim, u_limits->lim,
 1869|  32.6k|                                  u_limits->hev_thr);
 1870|  32.6k|        aom_lpf_horizontal_6_dual(v_dst, dst_stride, v_limits->mblim,
  ------------------
  |  | 3741|  32.6k|#define aom_lpf_horizontal_6_dual aom_lpf_horizontal_6_dual_sse2
  ------------------
 1871|  32.6k|                                  v_limits->lim, v_limits->hev_thr,
 1872|  32.6k|                                  v_limits->mblim, v_limits->lim,
 1873|  32.6k|                                  v_limits->hev_thr);
 1874|  32.6k|        break;
 1875|      0|      case 8:
  ------------------
  |  Branch (1875:7): [True: 0, False: 41.5k]
  ------------------
 1876|      0|      case 14: assert(0);
  ------------------
  |  Branch (1876:7): [True: 0, False: 41.5k]
  ------------------
 1877|       |      // no filtering
 1878|  7.92k|      default: break;
  ------------------
  |  Branch (1878:7): [True: 7.92k, False: 33.5k]
  ------------------
 1879|  41.5k|    }
 1880|   101k|  } else {
 1881|   101k|    assert(use_filter_type == USE_SINGLE);
 1882|   101k|    switch (params->filter_length) {
 1883|       |      // apply 4-tap filtering
 1884|  58.7k|      case 4:
  ------------------
  |  Branch (1884:7): [True: 58.7k, False: 42.2k]
  ------------------
 1885|  58.7k|        aom_lpf_horizontal_4(u_dst, dst_stride, u_limits->mblim, u_limits->lim,
  ------------------
  |  | 3725|  58.7k|#define aom_lpf_horizontal_4 aom_lpf_horizontal_4_sse2
  ------------------
 1886|  58.7k|                             u_limits->hev_thr);
 1887|  58.7k|        aom_lpf_horizontal_4(v_dst, dst_stride, v_limits->mblim, v_limits->lim,
  ------------------
  |  | 3725|  58.7k|#define aom_lpf_horizontal_4 aom_lpf_horizontal_4_sse2
  ------------------
 1888|  58.7k|                             u_limits->hev_thr);
 1889|  58.7k|        break;
 1890|  29.2k|      case 6:  // apply 6-tap filter for chroma plane only
  ------------------
  |  Branch (1890:7): [True: 29.2k, False: 71.7k]
  ------------------
 1891|  29.2k|        aom_lpf_horizontal_6(u_dst, dst_stride, u_limits->mblim, u_limits->lim,
  ------------------
  |  | 3737|  29.2k|#define aom_lpf_horizontal_6 aom_lpf_horizontal_6_sse2
  ------------------
 1892|  29.2k|                             u_limits->hev_thr);
 1893|  29.2k|        aom_lpf_horizontal_6(v_dst, dst_stride, v_limits->mblim, v_limits->lim,
  ------------------
  |  | 3737|  29.2k|#define aom_lpf_horizontal_6 aom_lpf_horizontal_6_sse2
  ------------------
 1894|  29.2k|                             v_limits->hev_thr);
 1895|  29.2k|        break;
 1896|      0|      case 8:
  ------------------
  |  Branch (1896:7): [True: 0, False: 101k]
  ------------------
 1897|      0|      case 14: assert(0); break;
  ------------------
  |  Branch (1897:7): [True: 0, False: 101k]
  ------------------
 1898|       |      // no filtering
 1899|  13.8k|      default: break;
  ------------------
  |  Branch (1899:7): [True: 13.8k, False: 87.2k]
  ------------------
 1900|   101k|    }
 1901|   101k|  }
 1902|       |#if !CONFIG_AV1_HIGHBITDEPTH
 1903|       |  (void)seq_params;
 1904|       |#endif  // !CONFIG_AV1_HIGHBITDEPTH
 1905|   156k|}

av1_rtcd:
   18|  25.4k|void av1_rtcd(void) { aom_once(setup_rtcd_internal); }

av1_inv_txfm2d.c:highbd_clip_pixel_add:
  148|   161k|                                             int bd) {
  149|   161k|  return clip_pixel_highbd(dest + (int)trans, bd);
  150|   161k|}
av1_inv_txfm_ssse3.c:cospi_arr:
   48|  84.4M|static inline const int32_t *cospi_arr(int n) {
   49|  84.4M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  84.4M|}
av1_inv_txfm_ssse3.c:get_txw_idx:
  281|  35.2M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  35.2M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  35.2M|}
av1_inv_txfm_ssse3.c:get_txh_idx:
  284|  35.2M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  35.2M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  35.2M|}
av1_inv_txfm_ssse3.c:get_rect_tx_log_ratio:
  254|  2.62M|static inline int get_rect_tx_log_ratio(int col, int row) {
  255|  2.62M|  if (col == row) return 0;
  ------------------
  |  Branch (255:7): [True: 1.63M, False: 989k]
  ------------------
  256|   989k|  if (col > row) {
  ------------------
  |  Branch (256:7): [True: 391k, False: 598k]
  ------------------
  257|   391k|    if (col == row * 2) return 1;
  ------------------
  |  Branch (257:9): [True: 391k, False: 2]
  ------------------
  258|      2|    if (col == row * 4) return 2;
  ------------------
  |  Branch (258:9): [True: 0, False: 2]
  ------------------
  259|      2|    assert(0 && "Unsupported transform size");
  260|   598k|  } else {
  261|   599k|    if (row == col * 2) return -1;
  ------------------
  |  Branch (261:9): [True: 599k, False: 18.4E]
  ------------------
  262|  18.4E|    if (row == col * 4) return -2;
  ------------------
  |  Branch (262:9): [True: 0, False: 18.4E]
  ------------------
  263|  18.4E|    assert(0 && "Unsupported transform size");
  264|  18.4E|  }
  265|  18.4E|  return 0;  // Invalid
  266|   989k|}
av1_inv_txfm_ssse3.c:sinpi_arr:
   52|  22.0M|static inline const int32_t *sinpi_arr(int n) {
   53|  22.0M|  return av1_sinpi_arr_data[n - cos_bit_min];
   54|  22.0M|}
av1_inv_txfm_ssse3.c:get_flip_cfg:
  208|  35.2M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  35.2M|  switch (tx_type) {
  210|  14.2M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 14.2M, False: 20.9M]
  ------------------
  211|  19.6M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 5.41M, False: 29.8M]
  ------------------
  212|  25.4M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 5.81M, False: 29.4M]
  ------------------
  213|  31.7M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 6.29M, False: 28.9M]
  ------------------
  214|  31.7M|      *ud_flip = 0;
  215|  31.7M|      *lr_flip = 0;
  216|  31.7M|      break;
  217|  14.8k|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 14.8k, False: 35.2M]
  ------------------
  218|   770k|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 755k, False: 34.4M]
  ------------------
  219|  3.46M|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 2.69M, False: 32.5M]
  ------------------
  220|  3.49M|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 27.0k, False: 35.1M]
  ------------------
  221|  3.62M|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 126k, False: 35.0M]
  ------------------
  222|  3.62M|      *ud_flip = 0;
  223|  3.62M|      *lr_flip = 0;
  224|  3.62M|      break;
  225|  20.5k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 20.5k, False: 35.2M]
  ------------------
  226|  25.0k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 4.48k, False: 35.2M]
  ------------------
  227|  46.9k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 21.8k, False: 35.2M]
  ------------------
  228|  46.9k|      *ud_flip = 1;
  229|  46.9k|      *lr_flip = 0;
  230|  46.9k|      break;
  231|  27.6k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 27.6k, False: 35.1M]
  ------------------
  232|  31.6k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 3.91k, False: 35.2M]
  ------------------
  233|   117k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 85.8k, False: 35.1M]
  ------------------
  234|   117k|      *ud_flip = 0;
  235|   117k|      *lr_flip = 1;
  236|   117k|      break;
  237|  3.03k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 3.03k, False: 35.2M]
  ------------------
  238|  3.03k|      *ud_flip = 1;
  239|  3.03k|      *lr_flip = 1;
  240|  3.03k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 35.2M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  35.2M|  }
  246|  35.2M|}
highbd_inv_txfm_sse4.c:cospi_arr:
   48|  29.0M|static inline const int32_t *cospi_arr(int n) {
   49|  29.0M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  29.0M|}
highbd_inv_txfm_sse4.c:get_log_range:
  161|  29.0M|static inline int get_log_range(int bd, int do_cols) {
  162|  29.0M|  const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8));
  ------------------
  |  |   35|  58.0M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 29.0M]
  |  |  |  Branch (35:31): [True: 13.7M, False: 15.2M]
  |  |  |  Branch (35:44): [True: 13.7M, False: 15.2M]
  |  |  ------------------
  ------------------
  163|       |  // bd is limited by the bitstream to 12. This assert is to satisfy static
  164|       |  // analyzers that may assume `log_range - 1` is greater than 31.
  165|       |  assert(log_range <= 20);
  166|  29.0M|  return log_range;
  167|  29.0M|}
highbd_inv_txfm_sse4.c:get_log_range_out:
  153|  22.8M|static inline int get_log_range_out(int bd) {
  154|  22.8M|  const int log_range_out = AOMMAX(16, bd + 6);
  ------------------
  |  |   35|  22.8M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 22.8M]
  |  |  ------------------
  ------------------
  155|       |  // bd is limited by the bitstream to 12. This assert is to satisfy static
  156|       |  // analyzers that may assume `log_range_out - 1` is greater than 31.
  157|       |  assert(log_range_out <= 18);
  158|  22.8M|  return log_range_out;
  159|  22.8M|}
highbd_inv_txfm_sse4.c:sinpi_arr:
   52|  13.4M|static inline const int32_t *sinpi_arr(int n) {
   53|  13.4M|  return av1_sinpi_arr_data[n - cos_bit_min];
   54|  13.4M|}
highbd_inv_txfm_sse4.c:get_txw_idx:
  281|  4.42M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  4.42M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  4.42M|}
highbd_inv_txfm_sse4.c:get_txh_idx:
  284|  4.42M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  4.42M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  4.42M|}
highbd_inv_txfm_sse4.c:get_rect_tx_log_ratio:
  254|   359k|static inline int get_rect_tx_log_ratio(int col, int row) {
  255|   359k|  if (col == row) return 0;
  ------------------
  |  Branch (255:7): [True: 344k, False: 14.9k]
  ------------------
  256|  14.9k|  if (col > row) {
  ------------------
  |  Branch (256:7): [True: 6.83k, False: 8.13k]
  ------------------
  257|  6.83k|    if (col == row * 2) return 1;
  ------------------
  |  Branch (257:9): [True: 6.83k, False: 0]
  ------------------
  258|      0|    if (col == row * 4) return 2;
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|      0|    assert(0 && "Unsupported transform size");
  260|  8.13k|  } else {
  261|  8.14k|    if (row == col * 2) return -1;
  ------------------
  |  Branch (261:9): [True: 8.14k, False: 18.4E]
  ------------------
  262|  18.4E|    if (row == col * 4) return -2;
  ------------------
  |  Branch (262:9): [True: 0, False: 18.4E]
  ------------------
  263|  18.4E|    assert(0 && "Unsupported transform size");
  264|  18.4E|  }
  265|  18.4E|  return 0;  // Invalid
  266|  14.9k|}
highbd_inv_txfm_sse4.c:get_flip_cfg:
  208|  4.41M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  4.41M|  switch (tx_type) {
  210|  2.11M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 2.11M, False: 2.30M]
  ------------------
  211|  2.64M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 534k, False: 3.88M]
  ------------------
  212|  3.20M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 561k, False: 3.85M]
  ------------------
  213|  3.90M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 696k, False: 3.72M]
  ------------------
  214|  3.90M|      *ud_flip = 0;
  215|  3.90M|      *lr_flip = 0;
  216|  3.90M|      break;
  217|  8.95k|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 8.95k, False: 4.40M]
  ------------------
  218|   127k|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 118k, False: 4.30M]
  ------------------
  219|   430k|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 303k, False: 4.11M]
  ------------------
  220|   438k|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 8.33k, False: 4.40M]
  ------------------
  221|   463k|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 25.0k, False: 4.39M]
  ------------------
  222|   463k|      *ud_flip = 0;
  223|   463k|      *lr_flip = 0;
  224|   463k|      break;
  225|  7.02k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 7.02k, False: 4.41M]
  ------------------
  226|  12.3k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 5.31k, False: 4.41M]
  ------------------
  227|  17.8k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 5.46k, False: 4.41M]
  ------------------
  228|  17.8k|      *ud_flip = 1;
  229|  17.8k|      *lr_flip = 0;
  230|  17.8k|      break;
  231|  12.6k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 12.6k, False: 4.40M]
  ------------------
  232|  16.9k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 4.29k, False: 4.41M]
  ------------------
  233|  33.7k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 16.8k, False: 4.40M]
  ------------------
  234|  33.7k|      *ud_flip = 0;
  235|  33.7k|      *lr_flip = 1;
  236|  33.7k|      break;
  237|  2.46k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 2.46k, False: 4.41M]
  ------------------
  238|  2.46k|      *ud_flip = 1;
  239|  2.46k|      *lr_flip = 1;
  240|  2.46k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 4.41M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  4.41M|  }
  246|  4.41M|}
highbd_fwd_txfm_sse4.c:get_txw_idx:
  281|  34.1M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  34.1M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  34.1M|}
highbd_fwd_txfm_sse4.c:get_txh_idx:
  284|  34.2M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  34.2M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  34.2M|}
highbd_fwd_txfm_sse4.c:cospi_arr:
   48|  49.4M|static inline const int32_t *cospi_arr(int n) {
   49|  49.4M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  49.4M|}
highbd_fwd_txfm_sse4.c:sinpi_arr:
   52|  21.1M|static inline const int32_t *sinpi_arr(int n) {
   53|  21.1M|  return av1_sinpi_arr_data[n - cos_bit_min];
   54|  21.1M|}
highbd_fwd_txfm_sse4.c:get_flip_cfg:
  208|  6.78M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  6.78M|  switch (tx_type) {
  210|  3.54M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 3.54M, False: 3.23M]
  ------------------
  211|  4.27M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 727k, False: 6.05M]
  ------------------
  212|  5.05M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 778k, False: 6.00M]
  ------------------
  213|  6.08M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 1.03M, False: 5.74M]
  ------------------
  214|  6.08M|      *ud_flip = 0;
  215|  6.08M|      *lr_flip = 0;
  216|  6.08M|      break;
  217|  40.0k|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 40.0k, False: 6.74M]
  ------------------
  218|   280k|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 240k, False: 6.54M]
  ------------------
  219|   608k|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 327k, False: 6.45M]
  ------------------
  220|   617k|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 9.00k, False: 6.77M]
  ------------------
  221|   640k|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 23.5k, False: 6.75M]
  ------------------
  222|   640k|      *ud_flip = 0;
  223|   640k|      *lr_flip = 0;
  224|   640k|      break;
  225|  9.61k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 9.61k, False: 6.77M]
  ------------------
  226|  16.5k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 6.92k, False: 6.77M]
  ------------------
  227|  22.0k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 5.49k, False: 6.77M]
  ------------------
  228|  22.0k|      *ud_flip = 1;
  229|  22.0k|      *lr_flip = 0;
  230|  22.0k|      break;
  231|  16.0k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 16.0k, False: 6.76M]
  ------------------
  232|  22.0k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 5.93k, False: 6.77M]
  ------------------
  233|  37.3k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 15.3k, False: 6.76M]
  ------------------
  234|  37.3k|      *ud_flip = 0;
  235|  37.3k|      *lr_flip = 1;
  236|  37.3k|      break;
  237|  3.53k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 3.53k, False: 6.77M]
  ------------------
  238|  3.53k|      *ud_flip = 1;
  239|  3.53k|      *lr_flip = 1;
  240|  3.53k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 6.78M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  6.78M|  }
  246|  6.78M|}
av1_inv_txfm_avx2.c:get_flip_cfg:
  208|  20.7M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  20.7M|  switch (tx_type) {
  210|  11.5M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 11.5M, False: 9.20M]
  ------------------
  211|  13.5M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 2.06M, False: 18.6M]
  ------------------
  212|  16.0M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 2.48M, False: 18.2M]
  ------------------
  213|  20.5M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 4.44M, False: 16.2M]
  ------------------
  214|  20.5M|      *ud_flip = 0;
  215|  20.5M|      *lr_flip = 0;
  216|  20.5M|      break;
  217|      0|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 0, False: 20.7M]
  ------------------
  218|    508|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 508, False: 20.7M]
  ------------------
  219|    993|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 485, False: 20.7M]
  ------------------
  220|    993|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 0, False: 20.7M]
  ------------------
  221|    993|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 0, False: 20.7M]
  ------------------
  222|    993|      *ud_flip = 0;
  223|    993|      *lr_flip = 0;
  224|    993|      break;
  225|  89.5k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 89.5k, False: 20.6M]
  ------------------
  226|   122k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 32.5k, False: 20.7M]
  ------------------
  227|   122k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 0, False: 20.7M]
  ------------------
  228|   122k|      *ud_flip = 1;
  229|   122k|      *lr_flip = 0;
  230|   122k|      break;
  231|   108k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 108k, False: 20.6M]
  ------------------
  232|   129k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 20.9k, False: 20.7M]
  ------------------
  233|   129k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 0, False: 20.7M]
  ------------------
  234|   129k|      *ud_flip = 0;
  235|   129k|      *lr_flip = 1;
  236|   129k|      break;
  237|  17.8k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 17.8k, False: 20.7M]
  ------------------
  238|  17.8k|      *ud_flip = 1;
  239|  17.8k|      *lr_flip = 1;
  240|  17.8k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 20.7M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  20.7M|  }
  246|  20.7M|}
av1_inv_txfm_avx2.c:get_txw_idx:
  281|  1.09M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  1.09M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  1.09M|}
av1_inv_txfm_avx2.c:get_txh_idx:
  284|  1.09M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  1.09M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  1.09M|}
av1_inv_txfm_avx2.c:get_rect_tx_log_ratio:
  254|  1.09M|static inline int get_rect_tx_log_ratio(int col, int row) {
  255|  1.09M|  if (col == row) return 0;
  ------------------
  |  Branch (255:7): [True: 1.03M, False: 65.4k]
  ------------------
  256|  65.4k|  if (col > row) {
  ------------------
  |  Branch (256:7): [True: 28.4k, False: 37.0k]
  ------------------
  257|  28.4k|    if (col == row * 2) return 1;
  ------------------
  |  Branch (257:9): [True: 28.4k, False: 0]
  ------------------
  258|      0|    if (col == row * 4) return 2;
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|      0|    assert(0 && "Unsupported transform size");
  260|  37.0k|  } else {
  261|  37.0k|    if (row == col * 2) return -1;
  ------------------
  |  Branch (261:9): [True: 37.0k, False: 18.4E]
  ------------------
  262|  18.4E|    if (row == col * 4) return -2;
  ------------------
  |  Branch (262:9): [True: 0, False: 18.4E]
  ------------------
  263|  18.4E|    assert(0 && "Unsupported transform size");
  264|  18.4E|  }
  265|  18.4E|  return 0;  // Invalid
  266|  65.4k|}
av1_inv_txfm_avx2.c:cospi_arr:
   48|  2.49M|static inline const int32_t *cospi_arr(int n) {
   49|  2.49M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  2.49M|}
highbd_inv_txfm_avx2.c:get_txw_idx:
  281|  4.20M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  4.20M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  4.20M|}
highbd_inv_txfm_avx2.c:get_txh_idx:
  284|  4.20M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  4.20M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  4.20M|}
highbd_inv_txfm_avx2.c:get_rect_tx_log_ratio:
  254|  4.20M|static inline int get_rect_tx_log_ratio(int col, int row) {
  255|  4.20M|  if (col == row) return 0;
  ------------------
  |  Branch (255:7): [True: 3.75M, False: 443k]
  ------------------
  256|   443k|  if (col > row) {
  ------------------
  |  Branch (256:7): [True: 224k, False: 219k]
  ------------------
  257|   224k|    if (col == row * 2) return 1;
  ------------------
  |  Branch (257:9): [True: 224k, False: 0]
  ------------------
  258|      0|    if (col == row * 4) return 2;
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|      0|    assert(0 && "Unsupported transform size");
  260|   219k|  } else {
  261|   219k|    if (row == col * 2) return -1;
  ------------------
  |  Branch (261:9): [True: 219k, False: 18.4E]
  ------------------
  262|  18.4E|    if (row == col * 4) return -2;
  ------------------
  |  Branch (262:9): [True: 0, False: 18.4E]
  ------------------
  263|  18.4E|    assert(0 && "Unsupported transform size");
  264|  18.4E|  }
  265|  18.4E|  return 0;  // Invalid
  266|   443k|}
highbd_inv_txfm_avx2.c:cospi_arr:
   48|  9.13M|static inline const int32_t *cospi_arr(int n) {
   49|  9.13M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  9.13M|}
highbd_inv_txfm_avx2.c:get_log_range:
  161|  9.04M|static inline int get_log_range(int bd, int do_cols) {
  162|  9.04M|  const int log_range = AOMMAX(16, bd + (do_cols ? 6 : 8));
  ------------------
  |  |   35|  18.0M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 9.04M]
  |  |  |  Branch (35:31): [True: 4.57M, False: 4.46M]
  |  |  |  Branch (35:44): [True: 4.57M, False: 4.46M]
  |  |  ------------------
  ------------------
  163|       |  // bd is limited by the bitstream to 12. This assert is to satisfy static
  164|       |  // analyzers that may assume `log_range - 1` is greater than 31.
  165|       |  assert(log_range <= 20);
  166|  9.04M|  return log_range;
  167|  9.04M|}
highbd_inv_txfm_avx2.c:get_log_range_out:
  153|  4.51M|static inline int get_log_range_out(int bd) {
  154|  4.51M|  const int log_range_out = AOMMAX(16, bd + 6);
  ------------------
  |  |   35|  4.51M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 4.51M]
  |  |  ------------------
  ------------------
  155|       |  // bd is limited by the bitstream to 12. This assert is to satisfy static
  156|       |  // analyzers that may assume `log_range_out - 1` is greater than 31.
  157|       |  assert(log_range_out <= 18);
  158|  4.51M|  return log_range_out;
  159|  4.51M|}
highbd_inv_txfm_avx2.c:get_flip_cfg:
  208|  4.20M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  4.20M|  switch (tx_type) {
  210|  2.54M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 2.54M, False: 1.65M]
  ------------------
  211|  2.96M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 420k, False: 3.77M]
  ------------------
  212|  3.44M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 477k, False: 3.72M]
  ------------------
  213|  4.15M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 716k, False: 3.48M]
  ------------------
  214|  4.15M|      *ud_flip = 0;
  215|  4.15M|      *lr_flip = 0;
  216|  4.15M|      break;
  217|      0|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 0, False: 4.20M]
  ------------------
  218|      0|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 0, False: 4.20M]
  ------------------
  219|      0|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 0, False: 4.20M]
  ------------------
  220|      0|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 0, False: 4.20M]
  ------------------
  221|      0|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 0, False: 4.20M]
  ------------------
  222|      0|      *ud_flip = 0;
  223|      0|      *lr_flip = 0;
  224|      0|      break;
  225|  16.3k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 16.3k, False: 4.18M]
  ------------------
  226|  20.1k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 3.73k, False: 4.19M]
  ------------------
  227|  20.1k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 0, False: 4.20M]
  ------------------
  228|  20.1k|      *ud_flip = 1;
  229|  20.1k|      *lr_flip = 0;
  230|  20.1k|      break;
  231|  19.5k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 19.5k, False: 4.18M]
  ------------------
  232|  22.2k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 2.77k, False: 4.19M]
  ------------------
  233|  22.2k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 0, False: 4.20M]
  ------------------
  234|  22.2k|      *ud_flip = 0;
  235|  22.2k|      *lr_flip = 1;
  236|  22.2k|      break;
  237|  2.37k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 2.37k, False: 4.19M]
  ------------------
  238|  2.37k|      *ud_flip = 1;
  239|  2.37k|      *lr_flip = 1;
  240|  2.37k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 4.20M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  4.20M|  }
  246|  4.20M|}
av1_fwd_txfm2d_avx2.c:get_txw_idx:
  281|  46.5M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  46.5M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  46.5M|}
av1_fwd_txfm2d_avx2.c:get_txh_idx:
  284|  46.5M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  46.5M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  46.5M|}
av1_fwd_txfm2d_avx2.c:cospi_arr:
   48|  87.1M|static inline const int32_t *cospi_arr(int n) {
   49|  87.1M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  87.1M|}
av1_fwd_txfm2d_avx2.c:get_flip_cfg:
  208|  46.5M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  46.5M|  switch (tx_type) {
  210|  20.9M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 20.9M, False: 25.6M]
  ------------------
  211|  25.3M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 4.48M, False: 42.0M]
  ------------------
  212|  30.5M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 5.20M, False: 41.3M]
  ------------------
  213|  40.0M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 9.45M, False: 37.1M]
  ------------------
  214|  40.0M|      *ud_flip = 0;
  215|  40.0M|      *lr_flip = 0;
  216|  40.0M|      break;
  217|   338k|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 338k, False: 46.2M]
  ------------------
  218|  2.45M|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 2.12M, False: 44.4M]
  ------------------
  219|  6.30M|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 3.84M, False: 42.7M]
  ------------------
  220|  6.33M|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 31.2k, False: 46.5M]
  ------------------
  221|  6.47M|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 141k, False: 46.4M]
  ------------------
  222|  6.47M|      *ud_flip = 0;
  223|  6.47M|      *lr_flip = 0;
  224|  6.47M|      break;
  225|   126k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 126k, False: 46.4M]
  ------------------
  226|   166k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 40.0k, False: 46.5M]
  ------------------
  227|   192k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 25.9k, False: 46.5M]
  ------------------
  228|   192k|      *ud_flip = 1;
  229|   192k|      *lr_flip = 0;
  230|   192k|      break;
  231|   149k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 149k, False: 46.4M]
  ------------------
  232|   175k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 26.3k, False: 46.5M]
  ------------------
  233|   277k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 101k, False: 46.4M]
  ------------------
  234|   277k|      *ud_flip = 0;
  235|   277k|      *lr_flip = 1;
  236|   277k|      break;
  237|  22.2k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 22.2k, False: 46.5M]
  ------------------
  238|  22.2k|      *ud_flip = 1;
  239|  22.2k|      *lr_flip = 1;
  240|  22.2k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 46.5M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  46.5M|  }
  246|  46.5M|}
highbd_fwd_txfm_avx2.c:get_txw_idx:
  281|  9.90M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  9.90M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  9.90M|}
highbd_fwd_txfm_avx2.c:get_txh_idx:
  284|  9.90M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  9.90M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  9.90M|}
highbd_fwd_txfm_avx2.c:cospi_arr:
   48|  19.2M|static inline const int32_t *cospi_arr(int n) {
   49|  19.2M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  19.2M|}
highbd_fwd_txfm_avx2.c:get_flip_cfg:
  208|   841k|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|   841k|  switch (tx_type) {
  210|   429k|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 429k, False: 412k]
  ------------------
  211|   510k|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 80.8k, False: 760k]
  ------------------
  212|   594k|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 84.2k, False: 757k]
  ------------------
  213|   716k|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 122k, False: 719k]
  ------------------
  214|   716k|      *ud_flip = 0;
  215|   716k|      *lr_flip = 0;
  216|   716k|      break;
  217|    173|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 173, False: 841k]
  ------------------
  218|  52.8k|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 52.6k, False: 789k]
  ------------------
  219|   118k|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 65.3k, False: 776k]
  ------------------
  220|   118k|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 289, False: 841k]
  ------------------
  221|   119k|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 722, False: 841k]
  ------------------
  222|   119k|      *ud_flip = 0;
  223|   119k|      *lr_flip = 0;
  224|   119k|      break;
  225|  2.32k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 2.32k, False: 839k]
  ------------------
  226|  2.38k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 55, False: 841k]
  ------------------
  227|  2.62k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 242, False: 841k]
  ------------------
  228|  2.62k|      *ud_flip = 1;
  229|  2.62k|      *lr_flip = 0;
  230|  2.62k|      break;
  231|  3.14k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 3.14k, False: 838k]
  ------------------
  232|  3.19k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 47, False: 841k]
  ------------------
  233|  3.59k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 399, False: 841k]
  ------------------
  234|  3.59k|      *ud_flip = 0;
  235|  3.59k|      *lr_flip = 1;
  236|  3.59k|      break;
  237|     55|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 55, False: 841k]
  ------------------
  238|     55|      *ud_flip = 1;
  239|     55|      *lr_flip = 1;
  240|     55|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 841k]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|   841k|  }
  246|   841k|}
av1_fwd_txfm_sse2.c:cospi_arr:
   48|  61.9M|static inline const int32_t *cospi_arr(int n) {
   49|  61.9M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  61.9M|}
av1_fwd_txfm_sse2.c:get_txw_idx:
  281|  46.6M|static inline int get_txw_idx(TX_SIZE tx_size) {
  282|  46.6M|  return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
  283|  46.6M|}
av1_fwd_txfm_sse2.c:get_txh_idx:
  284|  46.6M|static inline int get_txh_idx(TX_SIZE tx_size) {
  285|  46.6M|  return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
  286|  46.6M|}
av1_fwd_txfm_sse2.c:sinpi_arr:
   52|  27.6M|static inline const int32_t *sinpi_arr(int n) {
   53|  27.6M|  return av1_sinpi_arr_data[n - cos_bit_min];
   54|  27.6M|}
av1_fwd_txfm_sse2.c:get_flip_cfg:
  208|  46.6M|static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
  209|  46.6M|  switch (tx_type) {
  210|  21.1M|    case DCT_DCT:
  ------------------
  |  Branch (210:5): [True: 21.1M, False: 25.5M]
  ------------------
  211|  28.1M|    case ADST_DCT:
  ------------------
  |  Branch (211:5): [True: 7.00M, False: 39.6M]
  ------------------
  212|  35.3M|    case DCT_ADST:
  ------------------
  |  Branch (212:5): [True: 7.22M, False: 39.4M]
  ------------------
  213|  42.8M|    case ADST_ADST:
  ------------------
  |  Branch (213:5): [True: 7.47M, False: 39.2M]
  ------------------
  214|  42.8M|      *ud_flip = 0;
  215|  42.8M|      *lr_flip = 0;
  216|  42.8M|      break;
  217|  15.8k|    case IDTX:
  ------------------
  |  Branch (217:5): [True: 15.8k, False: 46.6M]
  ------------------
  218|   633k|    case V_DCT:
  ------------------
  |  Branch (218:5): [True: 617k, False: 46.0M]
  ------------------
  219|  4.39M|    case H_DCT:
  ------------------
  |  Branch (219:5): [True: 3.76M, False: 42.9M]
  ------------------
  220|  4.40M|    case V_ADST:
  ------------------
  |  Branch (220:5): [True: 6.79k, False: 46.6M]
  ------------------
  221|  4.43M|    case H_ADST:
  ------------------
  |  Branch (221:5): [True: 31.1k, False: 46.6M]
  ------------------
  222|  4.43M|      *ud_flip = 0;
  223|  4.43M|      *lr_flip = 0;
  224|  4.43M|      break;
  225|  19.9k|    case FLIPADST_DCT:
  ------------------
  |  Branch (225:5): [True: 19.9k, False: 46.6M]
  ------------------
  226|  24.5k|    case FLIPADST_ADST:
  ------------------
  |  Branch (226:5): [True: 4.61k, False: 46.6M]
  ------------------
  227|  29.2k|    case V_FLIPADST:
  ------------------
  |  Branch (227:5): [True: 4.70k, False: 46.6M]
  ------------------
  228|  29.2k|      *ud_flip = 1;
  229|  29.2k|      *lr_flip = 0;
  230|  29.2k|      break;
  231|  27.3k|    case DCT_FLIPADST:
  ------------------
  |  Branch (231:5): [True: 27.3k, False: 46.6M]
  ------------------
  232|  31.3k|    case ADST_FLIPADST:
  ------------------
  |  Branch (232:5): [True: 4.08k, False: 46.6M]
  ------------------
  233|  47.4k|    case H_FLIPADST:
  ------------------
  |  Branch (233:5): [True: 16.0k, False: 46.6M]
  ------------------
  234|  47.4k|      *ud_flip = 0;
  235|  47.4k|      *lr_flip = 1;
  236|  47.4k|      break;
  237|  3.22k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (237:5): [True: 3.22k, False: 46.6M]
  ------------------
  238|  3.22k|      *ud_flip = 1;
  239|  3.22k|      *lr_flip = 1;
  240|  3.22k|      break;
  241|      0|    default:
  ------------------
  |  Branch (241:5): [True: 0, False: 46.6M]
  ------------------
  242|      0|      *ud_flip = 0;
  243|      0|      *lr_flip = 0;
  244|       |      assert(0);
  245|  46.6M|  }
  246|  46.6M|}
av1_fwd_txfm1d_sse4.c:cospi_arr:
   48|  1.45M|static inline const int32_t *cospi_arr(int n) {
   49|  1.45M|  return av1_cospi_arr_data[n - cos_bit_min];
   50|  1.45M|}

av1_left_block_mode:
   17|   834k|PREDICTION_MODE av1_left_block_mode(const MB_MODE_INFO *left_mi) {
   18|   834k|  if (!left_mi) return DC_PRED;
  ------------------
  |  Branch (18:7): [True: 288k, False: 546k]
  ------------------
   19|   834k|  assert(!is_inter_block(left_mi) || is_intrabc_block(left_mi));
   20|   546k|  return left_mi->mode;
   21|   834k|}
av1_above_block_mode:
   23|   834k|PREDICTION_MODE av1_above_block_mode(const MB_MODE_INFO *above_mi) {
   24|   834k|  if (!above_mi) return DC_PRED;
  ------------------
  |  Branch (24:7): [True: 285k, False: 549k]
  ------------------
   25|   834k|  assert(!is_inter_block(above_mi) || is_intrabc_block(above_mi));
   26|   549k|  return above_mi->mode;
   27|   834k|}
av1_set_entropy_contexts:
   32|  18.2M|                              int has_eob, int aoff, int loff) {
   33|  18.2M|  ENTROPY_CONTEXT *const a = pd->above_entropy_context + aoff;
   34|  18.2M|  ENTROPY_CONTEXT *const l = pd->left_entropy_context + loff;
   35|  18.2M|  const int txs_wide = tx_size_wide_unit[tx_size];
   36|  18.2M|  const int txs_high = tx_size_high_unit[tx_size];
   37|       |
   38|       |  // above
   39|  18.2M|  if (has_eob && xd->mb_to_right_edge < 0) {
  ------------------
  |  Branch (39:7): [True: 16.9M, False: 1.29M]
  |  Branch (39:18): [True: 108k, False: 16.8M]
  ------------------
   40|   108k|    const int blocks_wide = max_block_wide(xd, plane_bsize, plane);
   41|   108k|    const int above_contexts = AOMMIN(txs_wide, blocks_wide - aoff);
  ------------------
  |  |   34|   108k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 85.0k, False: 23.6k]
  |  |  ------------------
  ------------------
   42|   108k|    memset(a, has_eob, sizeof(*a) * above_contexts);
   43|   108k|    memset(a + above_contexts, 0, sizeof(*a) * (txs_wide - above_contexts));
   44|  18.1M|  } else {
   45|  18.1M|    memset(a, has_eob, sizeof(*a) * txs_wide);
   46|  18.1M|  }
   47|       |
   48|       |  // left
   49|  18.2M|  if (has_eob && xd->mb_to_bottom_edge < 0) {
  ------------------
  |  Branch (49:7): [True: 16.9M, False: 1.28M]
  |  Branch (49:18): [True: 94.1k, False: 16.8M]
  ------------------
   50|  94.1k|    const int blocks_high = max_block_high(xd, plane_bsize, plane);
   51|  94.1k|    const int left_contexts = AOMMIN(txs_high, blocks_high - loff);
  ------------------
  |  |   34|  94.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 75.1k, False: 18.9k]
  |  |  ------------------
  ------------------
   52|  94.1k|    memset(l, has_eob, sizeof(*l) * left_contexts);
   53|  94.1k|    memset(l + left_contexts, 0, sizeof(*l) * (txs_high - left_contexts));
   54|  18.1M|  } else {
   55|  18.1M|    memset(l, has_eob, sizeof(*l) * txs_high);
   56|  18.1M|  }
   57|  18.2M|}
av1_reset_entropy_context:
   59|   214k|                               const int num_planes) {
   60|   214k|  assert(bsize < BLOCK_SIZES_ALL);
   61|   214k|  const int nplanes = 1 + (num_planes - 1) * xd->is_chroma_ref;
   62|   495k|  for (int i = 0; i < nplanes; i++) {
  ------------------
  |  Branch (62:19): [True: 281k, False: 214k]
  ------------------
   63|   281k|    struct macroblockd_plane *const pd = &xd->plane[i];
   64|   281k|    const BLOCK_SIZE plane_bsize =
   65|   281k|        get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
   66|   281k|    const int txs_wide = mi_size_wide[plane_bsize];
   67|   281k|    const int txs_high = mi_size_high[plane_bsize];
   68|   281k|    memset(pd->above_entropy_context, 0, sizeof(ENTROPY_CONTEXT) * txs_wide);
   69|   281k|    memset(pd->left_entropy_context, 0, sizeof(ENTROPY_CONTEXT) * txs_high);
   70|   281k|  }
   71|   214k|}
av1_reset_loop_filter_delta:
   73|  44.9k|void av1_reset_loop_filter_delta(MACROBLOCKD *xd, int num_planes) {
   74|  44.9k|  xd->delta_lf_from_base = 0;
   75|  44.9k|  const int frame_lf_count =
   76|  44.9k|      num_planes > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|  17.9k|#define FRAME_LF_COUNT 4
  ------------------
                    num_planes > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|  27.0k|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (76:7): [True: 17.9k, False: 27.0k]
  ------------------
   77|   170k|  for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) xd->delta_lf[lf_id] = 0;
  ------------------
  |  Branch (77:23): [True: 125k, False: 44.9k]
  ------------------
   78|  44.9k|}
av1_reset_loop_restoration:
   80|   162k|void av1_reset_loop_restoration(MACROBLOCKD *xd, const int num_planes) {
   81|   452k|  for (int p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (81:19): [True: 289k, False: 162k]
  ------------------
   82|   289k|    set_default_wiener(xd->wiener_info + p);
   83|   289k|    set_default_sgrproj(xd->sgrproj_info + p);
   84|   289k|  }
   85|   162k|}
av1_setup_block_planes:
   88|   101k|                            const int num_planes) {
   89|   101k|  int i;
   90|       |
   91|   280k|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (91:15): [True: 179k, False: 101k]
  ------------------
   92|   179k|    xd->plane[i].plane_type = get_plane_type(i);
   93|   179k|    xd->plane[i].subsampling_x = i ? ss_x : 0;
  ------------------
  |  Branch (93:34): [True: 77.6k, False: 101k]
  ------------------
   94|   179k|    xd->plane[i].subsampling_y = i ? ss_y : 0;
  ------------------
  |  Branch (94:34): [True: 77.6k, False: 101k]
  ------------------
   95|   179k|  }
   96|   227k|  for (i = num_planes; i < MAX_MB_PLANE; i++) {
  ------------------
  |  |   36|   227k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (96:24): [True: 125k, False: 101k]
  ------------------
   97|   125k|    xd->plane[i].subsampling_x = 1;
   98|   125k|    xd->plane[i].subsampling_y = 1;
   99|   125k|  }
  100|   101k|}

decodeframe.c:get_plane_type:
 1597|  2.00M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|  2.00M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 1.37M, False: 630k]
  ------------------
 1599|  2.00M|}
decodeframe.c:av1_get_tx_type:
 1286|  1.92M|                                      int reduced_tx_set) {
 1287|  1.92M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1288|  1.92M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32) {
  ------------------
  |  Branch (1288:7): [True: 192k, False: 1.73M]
  |  Branch (1288:41): [True: 220, False: 1.73M]
  ------------------
 1289|   193k|    return DCT_DCT;
 1290|   193k|  }
 1291|       |
 1292|  1.73M|  TX_TYPE tx_type;
 1293|  1.73M|  if (plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1293:7): [True: 1.19M, False: 540k]
  ------------------
 1294|  1.19M|    tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1295|  1.19M|  } else {
 1296|   540k|    if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1296:9): [True: 92.5k, False: 447k]
  ------------------
 1297|       |      // scale back to y plane's coordinate
 1298|  92.5k|      const struct macroblockd_plane *const pd = &xd->plane[plane_type];
 1299|  92.5k|      blk_row <<= pd->subsampling_y;
 1300|  92.5k|      blk_col <<= pd->subsampling_x;
 1301|  92.5k|      tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1302|   447k|    } else {
 1303|       |      // In intra mode, uv planes don't share the same prediction mode as y
 1304|       |      // plane, so the tx_type should not be shared
 1305|   447k|      tx_type = intra_mode_to_tx_type(mbmi, PLANE_TYPE_UV);
 1306|   447k|    }
 1307|   540k|    const TxSetType tx_set_type =
 1308|   540k|        av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi), reduced_tx_set);
 1309|   540k|    if (!av1_ext_tx_used[tx_set_type][tx_type]) tx_type = DCT_DCT;
  ------------------
  |  Branch (1309:9): [True: 16, False: 540k]
  ------------------
 1310|   540k|  }
 1311|  1.73M|  assert(tx_type < TX_TYPES);
 1312|       |  assert(av1_ext_tx_used[av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi),
 1313|  1.73M|                                                 reduced_tx_set)][tx_type]);
 1314|  1.73M|  return tx_type;
 1315|  1.92M|}
decodeframe.c:is_inter_block:
  372|  4.66M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  4.66M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 4.66M]
  |  Branch (373:36): [True: 877k, False: 3.78M]
  ------------------
  374|  4.66M|}
decodeframe.c:is_intrabc_block:
  345|  5.82M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  5.82M|  return mbmi->use_intrabc;
  347|  5.82M|}
decodeframe.c:intra_mode_to_tx_type:
 1008|   456k|                                     PLANE_TYPE plane_type) {
 1009|   456k|  static const TX_TYPE _intra_mode_to_tx_type[INTRA_MODES] = {
 1010|   456k|    DCT_DCT,    // DC_PRED
 1011|   456k|    ADST_DCT,   // V_PRED
 1012|   456k|    DCT_ADST,   // H_PRED
 1013|   456k|    DCT_DCT,    // D45_PRED
 1014|   456k|    ADST_ADST,  // D135_PRED
 1015|   456k|    ADST_DCT,   // D113_PRED
 1016|   456k|    DCT_ADST,   // D157_PRED
 1017|   456k|    DCT_ADST,   // D203_PRED
 1018|   456k|    ADST_DCT,   // D67_PRED
 1019|   456k|    ADST_ADST,  // SMOOTH_PRED
 1020|   456k|    ADST_DCT,   // SMOOTH_V_PRED
 1021|   456k|    DCT_ADST,   // SMOOTH_H_PRED
 1022|   456k|    ADST_ADST,  // PAETH_PRED
 1023|   456k|  };
 1024|   456k|  const PREDICTION_MODE mode =
 1025|   456k|      (plane_type == PLANE_TYPE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  Branch (1025:7): [True: 0, False: 456k]
  ------------------
 1026|       |  assert(mode < INTRA_MODES);
 1027|   456k|  return _intra_mode_to_tx_type[mode];
 1028|   456k|}
decodeframe.c:get_uv_mode:
  349|   455k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   455k|  static const PREDICTION_MODE uv2y[] = {
  352|   455k|    DC_PRED,        // UV_DC_PRED
  353|   455k|    V_PRED,         // UV_V_PRED
  354|   455k|    H_PRED,         // UV_H_PRED
  355|   455k|    D45_PRED,       // UV_D45_PRED
  356|   455k|    D135_PRED,      // UV_D135_PRED
  357|   455k|    D113_PRED,      // UV_D113_PRED
  358|   455k|    D157_PRED,      // UV_D157_PRED
  359|   455k|    D203_PRED,      // UV_D203_PRED
  360|   455k|    D67_PRED,       // UV_D67_PRED
  361|   455k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   455k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   455k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   455k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   455k|    DC_PRED,        // UV_CFL_PRED
  366|   455k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   455k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   455k|  };
  369|   455k|  return uv2y[mode];
  370|   455k|}
decodeframe.c:av1_get_ext_tx_set_type:
 1103|   545k|                                                int use_reduced_set) {
 1104|   545k|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|   545k|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 0, False: 545k]
  ------------------
 1106|   545k|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 5.05k, False: 539k]
  ------------------
 1107|  5.05k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 2.93k, False: 2.11k]
  ------------------
 1108|   539k|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 539k]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|   539k|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|   539k|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|   539k|}
decodeframe.c:has_second_ref:
  376|   672k|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|   672k|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|   672k|}
decodeframe.c:get_plane_block_size:
 1193|  3.81M|                                              int subsampling_y) {
 1194|  3.81M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  3.81M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  3.81M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  3.81M|}
decodeframe.c:is_cur_buf_hbd:
  937|   294k|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|   294k|#if CONFIG_AV1_HIGHBITDEPTH
  939|   294k|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|   294k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 27.1k, False: 267k]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|   294k|}
decodeframe.c:is_global_mv_block:
  422|   293k|                                     TransformationType type) {
  423|   293k|  const PREDICTION_MODE mode = mbmi->mode;
  424|   293k|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|   293k|  const int block_size_allowed =
  426|   293k|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   293k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.79k, False: 287k]
  |  |  ------------------
  ------------------
  427|   293k|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 8.85k, False: 285k]
  |  Branch (427:31): [True: 18.4E, False: 285k]
  |  Branch (427:59): [True: 0, False: 9.06k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|   293k|}
decodeframe.c:is_masked_compound_type:
  161|   293k|static inline int is_masked_compound_type(COMPOUND_TYPE type) {
  162|   294k|  return (type == COMPOUND_WEDGE || type == COMPOUND_DIFFWTD);
  ------------------
  |  Branch (162:11): [True: 18.4E, False: 294k]
  |  Branch (162:37): [True: 18.4E, False: 294k]
  ------------------
  163|   293k|}
decodeframe.c:is_interintra_pred:
 1447|   291k|static inline int is_interintra_pred(const MB_MODE_INFO *mbmi) {
 1448|   291k|  return mbmi->ref_frame[0] > INTRA_FRAME &&
  ------------------
  |  Branch (1448:10): [True: 291k, False: 18.4E]
  ------------------
 1449|   291k|         mbmi->ref_frame[1] == INTRA_FRAME && is_interintra_allowed(mbmi);
  ------------------
  |  Branch (1449:10): [True: 0, False: 291k]
  |  Branch (1449:47): [True: 0, False: 0]
  ------------------
 1450|   291k|}
decodeframe.c:get_partition_subsize:
  996|  6.08M|                                               PARTITION_TYPE partition) {
  997|  6.08M|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 0, False: 6.08M]
  ------------------
  998|      0|    return BLOCK_INVALID;
  999|  6.08M|  } else {
 1000|  6.08M|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  6.08M|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  6.08M|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 6.08M]
  ------------------
 1002|  6.08M|               ? BLOCK_INVALID
 1003|  6.08M|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  6.08M|  }
 1005|  6.08M|}
decodeframe.c:get_sqr_bsize_idx:
  976|  6.08M|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  6.08M|  switch (bsize) {
  978|  57.0k|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 57.0k, False: 6.02M]
  ------------------
  979|  3.55M|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 3.55M, False: 2.52M]
  ------------------
  980|  1.54M|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 1.54M, False: 4.53M]
  ------------------
  981|   707k|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 707k, False: 5.37M]
  ------------------
  982|   252k|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 252k, False: 5.83M]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 6.08M]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 6.08M]
  ------------------
  985|  6.08M|  }
  986|  6.08M|}
decodeframe.c:block_signals_txsize:
 1032|  1.27M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  1.27M|  return bsize > BLOCK_4X4;
 1034|  1.27M|}
decodeframe.c:bsize_to_tx_size_cat:
 1349|   504k|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|   504k|  assert(bsize < BLOCK_SIZES_ALL);
 1351|   504k|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|   504k|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|   504k|  };
 1354|   504k|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|   504k|  return depth - 1;
 1357|   504k|}
decodeframe.c:bsize_to_max_depth:
 1330|   504k|static inline int bsize_to_max_depth(BLOCK_SIZE bsize) {
 1331|   504k|  static const uint8_t bsize_to_max_depth_table[BLOCK_SIZES_ALL] = {
 1332|   504k|    0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
 1333|   504k|  };
 1334|   504k|  return bsize_to_max_depth_table[bsize];
 1335|   504k|}
decodeframe.c:depth_to_tx_size:
 1359|   502k|static inline TX_SIZE depth_to_tx_size(int depth, BLOCK_SIZE bsize) {
 1360|   502k|  TX_SIZE max_tx_size = max_txsize_rect_lookup[bsize];
 1361|   502k|  TX_SIZE tx_size = max_tx_size;
 1362|   644k|  for (int d = 0; d < depth; ++d) tx_size = sub_tx_size_map[tx_size];
  ------------------
  |  Branch (1362:19): [True: 142k, False: 502k]
  ------------------
 1363|   502k|  return tx_size;
 1364|   502k|}
decodeframe.c:tx_size_from_tx_mode:
 1139|   113k|static inline TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode) {
 1140|   113k|  const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
 1141|   113k|  const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
 1142|   113k|  if (bsize == BLOCK_4X4)
  ------------------
  |  Branch (1142:7): [True: 0, False: 113k]
  ------------------
 1143|      0|    return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1144|   113k|  if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
  ------------------
  |  Branch (1144:7): [True: 114k, False: 18.4E]
  ------------------
 1145|   114k|    return max_rect_tx_size;
 1146|  18.4E|  else
 1147|  18.4E|    return largest_tx_size;
 1148|   113k|}
decodeframe.c:av1_get_tx_size:
 1386|  2.07M|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|  2.07M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|  2.07M|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 54.2k, False: 2.02M]
  ------------------
 1389|  2.02M|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 1.09M, False: 922k]
  ------------------
 1390|   922k|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|   922k|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|   922k|                               pd->subsampling_y);
 1393|  2.02M|}
decodeframe.c:av1_get_max_uv_txsize:
 1378|  1.15M|                                            int subsampling_y) {
 1379|  1.15M|  const BLOCK_SIZE plane_bsize =
 1380|  1.15M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  1.15M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  1.15M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  1.15M|}
decodeframe.c:av1_get_adjusted_tx_size:
 1366|  1.32M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  1.32M|  switch (tx_size) {
 1368|    967|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 967, False: 1.32M]
  ------------------
 1369|    971|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 4, False: 1.32M]
  ------------------
 1370|  2.69k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 1.72k, False: 1.32M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 1.32M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 1.32M]
  ------------------
 1373|  1.32M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 1.32M, False: 2.63k]
  ------------------
 1374|  1.32M|  }
 1375|  1.32M|}
decodeframe.c:get_vartx_max_txsize:
 1453|   528k|                                       int plane) {
 1454|   528k|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1454:7): [True: 46.5k, False: 481k]
  ------------------
 1455|   481k|  const TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
 1456|   481k|  if (plane == 0) return max_txsize;            // luma
  ------------------
  |  Branch (1456:7): [True: 307k, False: 174k]
  ------------------
 1457|   174k|  return av1_get_adjusted_tx_size(max_txsize);  // chroma
 1458|   481k|}
decodeframe.c:av1_get_txb_size_index:
 1212|   707k|                                         int blk_col) {
 1213|   707k|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|   707k|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|   707k|  };
 1216|   707k|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|   707k|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|   707k|  };
 1219|   707k|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|   707k|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|   707k|  };
 1222|   707k|  const int index =
 1223|   707k|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|   707k|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|   707k|  return index;
 1227|   707k|}
decodeframe.c:av1_get_block_dimensions:
 1521|  49.6k|                                            int *cols_within_bounds) {
 1522|  49.6k|  const int block_height = block_size_high[bsize];
 1523|  49.6k|  const int block_width = block_size_wide[bsize];
 1524|  49.6k|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 49.6k, False: 25]
  ------------------
 1525|  49.6k|                             ? block_height
 1526|  49.6k|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|  49.6k|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 49.6k, False: 22]
  ------------------
 1528|  49.6k|                             ? block_width
 1529|  49.6k|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|  49.6k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|  49.6k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|  49.6k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|  49.6k|  assert(block_width >= block_cols);
 1534|  49.6k|  assert(block_height >= block_rows);
 1535|  49.6k|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|  49.6k|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|  49.6k|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 18.2k, False: 31.4k]
  |  Branch (1538:45): [True: 0, False: 18.2k]
  ------------------
 1539|  49.6k|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 18.2k, False: 31.4k]
  |  Branch (1539:45): [True: 0, False: 18.2k]
  ------------------
 1540|  49.6k|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 49.6k, False: 18.4E]
  ------------------
 1541|  49.6k|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|  49.6k|    assert(*width >= 0);
 1543|  49.6k|  }
 1544|  49.6k|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 49.6k, False: 18.4E]
  ------------------
 1545|  49.6k|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|  49.6k|    assert(*height >= 0);
 1547|  49.6k|  }
 1548|  49.6k|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 0, False: 49.6k]
  ------------------
 1549|      0|    *rows_within_bounds =
 1550|      0|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|      0|    assert(*rows_within_bounds >= 0);
 1552|      0|  }
 1553|  49.6k|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 0, False: 49.6k]
  ------------------
 1554|      0|    *cols_within_bounds =
 1555|      0|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|      0|  }
 1558|  49.6k|}
decodemv.c:is_inter_block:
  372|  1.77M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  1.77M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 1.04k, False: 1.77M]
  |  Branch (373:36): [True: 487k, False: 1.28M]
  ------------------
  374|  1.77M|}
decodemv.c:is_intrabc_block:
  345|  1.77M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  1.77M|  return mbmi->use_intrabc;
  347|  1.77M|}
decodemv.c:get_ext_tx_types:
 1130|  1.17M|                                   int use_reduced_set) {
 1131|  1.17M|  const int set_type =
 1132|  1.17M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1133|  1.17M|  return av1_num_ext_tx_set[set_type];
 1134|  1.17M|}
decodemv.c:av1_get_ext_tx_set_type:
 1103|  3.51M|                                                int use_reduced_set) {
 1104|  3.51M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  3.51M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 582, False: 3.51M]
  ------------------
 1106|  3.51M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 2.11k, False: 3.51M]
  ------------------
 1107|  2.11k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 606, False: 1.51k]
  ------------------
 1108|  3.51M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 3.51M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  3.51M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  3.51M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  3.51M|}
decodemv.c:get_ext_tx_set:
 1123|  1.17M|                                 int use_reduced_set) {
 1124|  1.17M|  const TxSetType set_type =
 1125|  1.17M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1126|  1.17M|  return ext_tx_set_index[is_inter][set_type];
 1127|  1.17M|}
decodemv.c:get_plane_block_size:
 1193|  6.81k|                                              int subsampling_y) {
 1194|  6.81k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  6.81k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  6.81k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  6.81k|}
decodemv.c:get_uv_mode:
  349|   256k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   256k|  static const PREDICTION_MODE uv2y[] = {
  352|   256k|    DC_PRED,        // UV_DC_PRED
  353|   256k|    V_PRED,         // UV_V_PRED
  354|   256k|    H_PRED,         // UV_H_PRED
  355|   256k|    D45_PRED,       // UV_D45_PRED
  356|   256k|    D135_PRED,      // UV_D135_PRED
  357|   256k|    D113_PRED,      // UV_D113_PRED
  358|   256k|    D157_PRED,      // UV_D157_PRED
  359|   256k|    D203_PRED,      // UV_D203_PRED
  360|   256k|    D67_PRED,       // UV_D67_PRED
  361|   256k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   256k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   256k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   256k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   256k|    DC_PRED,        // UV_CFL_PRED
  366|   256k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   256k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   256k|  };
  369|   256k|  return uv2y[mode];
  370|   256k|}
decodemv.c:av1_allow_palette:
 1504|   588k|                                    BLOCK_SIZE sb_type) {
 1505|   588k|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|   588k|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 42.0k, False: 546k]
  ------------------
 1507|  42.0k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|   630k|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 42.0k, False: 2]
  ------------------
 1508|  42.0k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|   630k|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 42.0k, False: 18.4E]
  ------------------
 1509|  42.0k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 23.0k, False: 19.0k]
  ------------------
 1510|   588k|}
decodemv.c:is_comp_ref_allowed:
   65|   191k|static inline int is_comp_ref_allowed(BLOCK_SIZE bsize) {
   66|   191k|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   191k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.42k, False: 186k]
  |  |  ------------------
  ------------------
   67|   191k|}
decodemv.c:has_second_ref:
  376|  1.27M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  1.27M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  1.27M|}
decodemv.c:have_nearmv_in_inter_mode:
  151|   148k|static inline int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
  152|   148k|  return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
  ------------------
  |  Branch (152:11): [True: 41.9k, False: 106k]
  |  Branch (152:29): [True: 18.4E, False: 106k]
  |  Branch (152:52): [True: 18.4E, False: 106k]
  ------------------
  153|   106k|          mode == NEW_NEARMV);
  ------------------
  |  Branch (153:11): [True: 18.4E, False: 106k]
  ------------------
  154|   148k|}
decodemv.c:is_inter_compound_mode:
   81|   191k|static inline int is_inter_compound_mode(PREDICTION_MODE mode) {
   82|   191k|  return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END;
  ------------------
  |  Branch (82:10): [True: 0, False: 191k]
  |  Branch (82:43): [True: 0, False: 0]
  ------------------
   83|   191k|}
decodemv.c:is_motion_variation_allowed_bsize:
 1460|   325k|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|   325k|  assert(bsize < BLOCK_SIZES_ALL);
 1462|   325k|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   325k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.11k, False: 318k]
  |  |  ------------------
  ------------------
 1463|   325k|}
decodemv.c:motion_mode_allowed:
 1479|   191k|    const MB_MODE_INFO *mbmi, int allow_warped_motion) {
 1480|   191k|  if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1480:7): [True: 56.3k, False: 135k]
  ------------------
 1481|   135k|  if (xd->cur_frame_force_integer_mv == 0) {
  ------------------
  |  Branch (1481:7): [True: 135k, False: 18.4E]
  ------------------
 1482|   135k|    const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
 1483|   135k|    if (is_global_mv_block(mbmi, gm_type)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1483:9): [True: 0, False: 135k]
  ------------------
 1484|   135k|  }
 1485|   135k|  if (is_motion_variation_allowed_bsize(mbmi->bsize) &&
  ------------------
  |  Branch (1485:7): [True: 135k, False: 18.4E]
  ------------------
 1486|   135k|      is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
  ------------------
  |  Branch (1486:7): [True: 135k, False: 18.4E]
  |  Branch (1486:36): [True: 135k, False: 18.4E]
  ------------------
 1487|   135k|      is_motion_variation_allowed_compound(mbmi)) {
  ------------------
  |  Branch (1487:7): [True: 135k, False: 21]
  ------------------
 1488|   135k|    assert(!has_second_ref(mbmi));
 1489|   135k|    if (mbmi->num_proj_ref >= 1 && allow_warped_motion &&
  ------------------
  |  Branch (1489:9): [True: 135k, False: 18.4E]
  |  Branch (1489:36): [True: 135k, False: 18.4E]
  ------------------
 1490|   135k|        !xd->cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1490:9): [True: 135k, False: 18.4E]
  ------------------
 1491|   135k|        !av1_is_scaled(xd->block_ref_scale_factors[0])) {
  ------------------
  |  Branch (1491:9): [True: 12.5k, False: 122k]
  ------------------
 1492|  12.5k|      return WARPED_CAUSAL;
 1493|  12.5k|    }
 1494|   122k|    return OBMC_CAUSAL;
 1495|   135k|  }
 1496|  18.4E|  return SIMPLE_TRANSLATION;
 1497|   135k|}
decodemv.c:check_num_overlappable_neighbors:
 1473|   191k|static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
 1474|   191k|  return mbmi->overlappable_neighbors != 0;
 1475|   191k|}
decodemv.c:is_global_mv_block:
  422|   135k|                                     TransformationType type) {
  423|   135k|  const PREDICTION_MODE mode = mbmi->mode;
  424|   135k|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|   135k|  const int block_size_allowed =
  426|   135k|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   135k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.68k, False: 132k]
  |  |  ------------------
  ------------------
  427|   135k|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 4.66k, False: 130k]
  |  Branch (427:31): [True: 18.4E, False: 130k]
  |  Branch (427:59): [True: 0, False: 4.68k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|   135k|}
decodemv.c:is_inter_mode:
   69|   135k|static inline int is_inter_mode(PREDICTION_MODE mode) {
   70|   135k|  return mode >= INTER_MODE_START && mode < INTER_MODE_END;
  ------------------
  |  Branch (70:10): [True: 135k, False: 18.4E]
  |  Branch (70:38): [True: 135k, False: 18.4E]
  ------------------
   71|   135k|}
decodemv.c:is_motion_variation_allowed_compound:
 1466|   135k|    const MB_MODE_INFO *mbmi) {
 1467|   135k|  return !has_second_ref(mbmi);
 1468|   135k|}
decodemv.c:is_nontrans_global_motion:
 1581|   189k|                                            const MB_MODE_INFO *mbmi) {
 1582|   189k|  int ref;
 1583|       |
 1584|       |  // First check if all modes are GLOBALMV
 1585|   189k|  if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) return 0;
  ------------------
  |  Branch (1585:7): [True: 184k, False: 5.07k]
  |  Branch (1585:33): [True: 184k, False: 18.4E]
  ------------------
 1586|       |
 1587|  5.05k|  if (AOMMIN(mi_size_wide[mbmi->bsize], mi_size_high[mbmi->bsize]) < 2)
  ------------------
  |  |   34|  5.05k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 97, False: 4.95k]
  |  |  ------------------
  ------------------
  |  Branch (1587:7): [True: 5, False: 5.04k]
  ------------------
 1588|      5|    return 0;
 1589|       |
 1590|       |  // Now check if all global motion is non translational
 1591|  10.1k|  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1591:17): [True: 5.10k, False: 5.04k]
  ------------------
 1592|  5.10k|    if (xd->global_motion[mbmi->ref_frame[ref]].wmtype == TRANSLATION) return 0;
  ------------------
  |  Branch (1592:9): [True: 0, False: 5.10k]
  ------------------
 1593|  5.10k|  }
 1594|  5.04k|  return 1;
 1595|  5.04k|}
decoder.c:is_inter_block:
  372|  2.26M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  2.26M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 213, False: 2.26M]
  |  Branch (373:36): [True: 552k, False: 1.71M]
  ------------------
  374|  2.26M|}
decoder.c:is_intrabc_block:
  345|  2.26M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  2.26M|  return mbmi->use_intrabc;
  347|  2.26M|}
decodetxb.c:get_plane_block_size:
 1193|  2.02M|                                              int subsampling_y) {
 1194|  2.02M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  2.02M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  2.02M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  2.02M|}
decodetxb.c:av1_get_adjusted_tx_size:
 1366|  6.04M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  6.04M|  switch (tx_size) {
 1368|  1.29k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 1.29k, False: 6.04M]
  ------------------
 1369|  1.53k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 240, False: 6.04M]
  ------------------
 1370|  1.80k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 273, False: 6.04M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 6.04M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 6.04M]
  ------------------
 1373|  6.05M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 6.05M, False: 18.4E]
  ------------------
 1374|  6.04M|  }
 1375|  6.04M|}
decodetxb.c:is_inter_block:
  372|  3.25M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  3.25M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 1.19k, False: 3.24M]
  |  Branch (373:36): [True: 789k, False: 2.46M]
  ------------------
  374|  3.25M|}
decodetxb.c:is_intrabc_block:
  345|  3.25M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  3.25M|  return mbmi->use_intrabc;
  347|  3.25M|}
decodetxb.c:get_plane_type:
 1597|  2.45M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|  2.45M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 1.70M, False: 748k]
  ------------------
 1599|  2.45M|}
decodetxb.c:av1_get_tx_type:
 1286|  2.34M|                                      int reduced_tx_set) {
 1287|  2.34M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1288|  2.34M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32) {
  ------------------
  |  Branch (1288:7): [True: 274k, False: 2.06M]
  |  Branch (1288:41): [True: 18.4E, False: 2.07M]
  ------------------
 1289|   276k|    return DCT_DCT;
 1290|   276k|  }
 1291|       |
 1292|  2.06M|  TX_TYPE tx_type;
 1293|  2.06M|  if (plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1293:7): [True: 1.44M, False: 623k]
  ------------------
 1294|  1.44M|    tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1295|  1.44M|  } else {
 1296|   623k|    if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1296:9): [True: 182k, False: 441k]
  ------------------
 1297|       |      // scale back to y plane's coordinate
 1298|   182k|      const struct macroblockd_plane *const pd = &xd->plane[plane_type];
 1299|   182k|      blk_row <<= pd->subsampling_y;
 1300|   182k|      blk_col <<= pd->subsampling_x;
 1301|   182k|      tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1302|   441k|    } else {
 1303|       |      // In intra mode, uv planes don't share the same prediction mode as y
 1304|       |      // plane, so the tx_type should not be shared
 1305|   441k|      tx_type = intra_mode_to_tx_type(mbmi, PLANE_TYPE_UV);
 1306|   441k|    }
 1307|   623k|    const TxSetType tx_set_type =
 1308|   623k|        av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi), reduced_tx_set);
 1309|   623k|    if (!av1_ext_tx_used[tx_set_type][tx_type]) tx_type = DCT_DCT;
  ------------------
  |  Branch (1309:9): [True: 18, False: 623k]
  ------------------
 1310|   623k|  }
 1311|  2.06M|  assert(tx_type < TX_TYPES);
 1312|       |  assert(av1_ext_tx_used[av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi),
 1313|  2.06M|                                                 reduced_tx_set)][tx_type]);
 1314|  2.06M|  return tx_type;
 1315|  2.34M|}
decodetxb.c:intra_mode_to_tx_type:
 1008|   456k|                                     PLANE_TYPE plane_type) {
 1009|   456k|  static const TX_TYPE _intra_mode_to_tx_type[INTRA_MODES] = {
 1010|   456k|    DCT_DCT,    // DC_PRED
 1011|   456k|    ADST_DCT,   // V_PRED
 1012|   456k|    DCT_ADST,   // H_PRED
 1013|   456k|    DCT_DCT,    // D45_PRED
 1014|   456k|    ADST_ADST,  // D135_PRED
 1015|   456k|    ADST_DCT,   // D113_PRED
 1016|   456k|    DCT_ADST,   // D157_PRED
 1017|   456k|    DCT_ADST,   // D203_PRED
 1018|   456k|    ADST_DCT,   // D67_PRED
 1019|   456k|    ADST_ADST,  // SMOOTH_PRED
 1020|   456k|    ADST_DCT,   // SMOOTH_V_PRED
 1021|   456k|    DCT_ADST,   // SMOOTH_H_PRED
 1022|   456k|    ADST_ADST,  // PAETH_PRED
 1023|   456k|  };
 1024|   456k|  const PREDICTION_MODE mode =
 1025|   456k|      (plane_type == PLANE_TYPE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  Branch (1025:7): [True: 0, False: 456k]
  ------------------
 1026|       |  assert(mode < INTRA_MODES);
 1027|   456k|  return _intra_mode_to_tx_type[mode];
 1028|   456k|}
decodetxb.c:get_uv_mode:
  349|   456k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   456k|  static const PREDICTION_MODE uv2y[] = {
  352|   456k|    DC_PRED,        // UV_DC_PRED
  353|   456k|    V_PRED,         // UV_V_PRED
  354|   456k|    H_PRED,         // UV_H_PRED
  355|   456k|    D45_PRED,       // UV_D45_PRED
  356|   456k|    D135_PRED,      // UV_D135_PRED
  357|   456k|    D113_PRED,      // UV_D113_PRED
  358|   456k|    D157_PRED,      // UV_D157_PRED
  359|   456k|    D203_PRED,      // UV_D203_PRED
  360|   456k|    D67_PRED,       // UV_D67_PRED
  361|   456k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   456k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   456k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   456k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   456k|    DC_PRED,        // UV_CFL_PRED
  366|   456k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   456k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   456k|  };
  369|   456k|  return uv2y[mode];
  370|   456k|}
decodetxb.c:av1_get_ext_tx_set_type:
 1103|   635k|                                                int use_reduced_set) {
 1104|   635k|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|   635k|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 0, False: 635k]
  ------------------
 1106|   635k|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 7.76k, False: 627k]
  ------------------
 1107|  7.76k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 5.65k, False: 2.10k]
  ------------------
 1108|   627k|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 627k]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|   627k|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|   627k|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|   627k|}
detokenize.c:av1_get_block_dimensions:
 1521|  25.3k|                                            int *cols_within_bounds) {
 1522|  25.3k|  const int block_height = block_size_high[bsize];
 1523|  25.3k|  const int block_width = block_size_wide[bsize];
 1524|  25.3k|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 25.3k, False: 14]
  ------------------
 1525|  25.3k|                             ? block_height
 1526|  25.3k|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|  25.3k|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 25.3k, False: 13]
  ------------------
 1528|  25.3k|                             ? block_width
 1529|  25.3k|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|  25.3k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|  25.3k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|  25.3k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|  25.3k|  assert(block_width >= block_cols);
 1534|  25.3k|  assert(block_height >= block_rows);
 1535|  25.3k|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|  25.3k|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|  25.3k|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 9.28k, False: 16.0k]
  |  Branch (1538:45): [True: 0, False: 9.28k]
  ------------------
 1539|  25.3k|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 9.28k, False: 16.0k]
  |  Branch (1539:45): [True: 0, False: 9.28k]
  ------------------
 1540|  25.3k|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 25.3k, False: 18.4E]
  ------------------
 1541|  25.3k|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|  25.3k|    assert(*width >= 0);
 1543|  25.3k|  }
 1544|  25.3k|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 25.3k, False: 18.4E]
  ------------------
 1545|  25.3k|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|  25.3k|    assert(*height >= 0);
 1547|  25.3k|  }
 1548|  25.3k|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 25.3k, False: 6]
  ------------------
 1549|  25.3k|    *rows_within_bounds =
 1550|  25.3k|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|  25.3k|    assert(*rows_within_bounds >= 0);
 1552|  25.3k|  }
 1553|  25.3k|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 25.3k, False: 3]
  ------------------
 1554|  25.3k|    *cols_within_bounds =
 1555|  25.3k|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|  25.3k|  }
 1558|  25.3k|}
bitstream.c:is_inter_block:
  372|  12.0M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  12.0M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 12.0M]
  |  Branch (373:36): [True: 2.99M, False: 9.02M]
  ------------------
  374|  12.0M|}
bitstream.c:is_intrabc_block:
  345|  12.0M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  12.0M|  return mbmi->use_intrabc;
  347|  12.0M|}
bitstream.c:get_ext_tx_types:
 1130|  3.43M|                                   int use_reduced_set) {
 1131|  3.43M|  const int set_type =
 1132|  3.43M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1133|  3.43M|  return av1_num_ext_tx_set[set_type];
 1134|  3.43M|}
bitstream.c:av1_get_ext_tx_set_type:
 1103|  9.54M|                                                int use_reduced_set) {
 1104|  9.54M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  9.54M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 1.51k, False: 9.53M]
  ------------------
 1106|  9.53M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 5.86k, False: 9.53M]
  ------------------
 1107|  5.86k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 1.80k, False: 4.06k]
  ------------------
 1108|  9.53M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 9.53M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  9.53M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  9.53M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  9.53M|}
bitstream.c:get_ext_tx_set:
 1123|  3.06M|                                 int use_reduced_set) {
 1124|  3.06M|  const TxSetType set_type =
 1125|  3.06M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1126|  3.06M|  return ext_tx_set_index[is_inter][set_type];
 1127|  3.06M|}
bitstream.c:get_partition_subsize:
  996|  6.75M|                                               PARTITION_TYPE partition) {
  997|  6.75M|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 916k, False: 5.83M]
  ------------------
  998|   916k|    return BLOCK_INVALID;
  999|  5.83M|  } else {
 1000|  5.83M|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  5.83M|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  5.83M|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 5.83M]
  ------------------
 1002|  5.83M|               ? BLOCK_INVALID
 1003|  5.83M|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  5.83M|  }
 1005|  6.75M|}
bitstream.c:get_sqr_bsize_idx:
  976|  5.83M|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  5.83M|  switch (bsize) {
  978|  38.7k|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 38.7k, False: 5.79M]
  ------------------
  979|  3.55M|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 3.55M, False: 2.28M]
  ------------------
  980|  1.42M|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 1.42M, False: 4.41M]
  ------------------
  981|   568k|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 568k, False: 5.26M]
  ------------------
  982|   274k|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 274k, False: 5.56M]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 5.83M]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 5.83M]
  ------------------
  985|  5.83M|  }
  986|  5.83M|}
bitstream.c:get_plane_block_size:
 1193|  1.75M|                                              int subsampling_y) {
 1194|  1.75M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  1.75M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  1.75M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  1.75M|}
bitstream.c:get_uv_mode:
  349|   651k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   651k|  static const PREDICTION_MODE uv2y[] = {
  352|   651k|    DC_PRED,        // UV_DC_PRED
  353|   651k|    V_PRED,         // UV_V_PRED
  354|   651k|    H_PRED,         // UV_H_PRED
  355|   651k|    D45_PRED,       // UV_D45_PRED
  356|   651k|    D135_PRED,      // UV_D135_PRED
  357|   651k|    D113_PRED,      // UV_D113_PRED
  358|   651k|    D157_PRED,      // UV_D157_PRED
  359|   651k|    D203_PRED,      // UV_D203_PRED
  360|   651k|    D67_PRED,       // UV_D67_PRED
  361|   651k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   651k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   651k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   651k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   651k|    DC_PRED,        // UV_CFL_PRED
  366|   651k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   651k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   651k|  };
  369|   651k|  return uv2y[mode];
  370|   651k|}
bitstream.c:av1_allow_palette:
 1504|  1.52M|                                    BLOCK_SIZE sb_type) {
 1505|  1.52M|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|  1.52M|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 112k, False: 1.41M]
  ------------------
 1507|   112k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  1.63M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 112k, False: 18.4E]
  ------------------
 1508|   112k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  1.63M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 112k, False: 18.4E]
  ------------------
 1509|   112k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 61.5k, False: 50.7k]
  ------------------
 1510|  1.52M|}
bitstream.c:has_second_ref:
  376|  3.76M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  3.76M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  3.76M|}
bitstream.c:is_inter_compound_mode:
   81|   509k|static inline int is_inter_compound_mode(PREDICTION_MODE mode) {
   82|   509k|  return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END;
  ------------------
  |  Branch (82:10): [True: 0, False: 509k]
  |  Branch (82:43): [True: 0, False: 0]
  ------------------
   83|   509k|}
bitstream.c:is_inter_singleref_mode:
   78|   509k|static inline int is_inter_singleref_mode(PREDICTION_MODE mode) {
   79|   509k|  return mode >= SINGLE_INTER_MODE_START && mode < SINGLE_INTER_MODE_END;
  ------------------
  |  Branch (79:10): [True: 508k, False: 570]
  |  Branch (79:45): [True: 508k, False: 0]
  ------------------
   80|   509k|}
bitstream.c:have_nearmv_in_inter_mode:
  151|   292k|static inline int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
  152|   292k|  return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
  ------------------
  |  Branch (152:11): [True: 117k, False: 174k]
  |  Branch (152:29): [True: 18.4E, False: 174k]
  |  Branch (152:52): [True: 18.4E, False: 174k]
  ------------------
  153|   174k|          mode == NEW_NEARMV);
  ------------------
  |  Branch (153:11): [True: 18.4E, False: 174k]
  ------------------
  154|   292k|}
bitstream.c:motion_mode_allowed:
 1479|   510k|    const MB_MODE_INFO *mbmi, int allow_warped_motion) {
 1480|   510k|  if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1480:7): [True: 146k, False: 363k]
  ------------------
 1481|   363k|  if (xd->cur_frame_force_integer_mv == 0) {
  ------------------
  |  Branch (1481:7): [True: 363k, False: 18.4E]
  ------------------
 1482|   363k|    const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
 1483|   363k|    if (is_global_mv_block(mbmi, gm_type)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1483:9): [True: 0, False: 363k]
  ------------------
 1484|   363k|  }
 1485|   363k|  if (is_motion_variation_allowed_bsize(mbmi->bsize) &&
  ------------------
  |  Branch (1485:7): [True: 363k, False: 18.4E]
  ------------------
 1486|   363k|      is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
  ------------------
  |  Branch (1486:7): [True: 363k, False: 9]
  |  Branch (1486:36): [True: 363k, False: 18.4E]
  ------------------
 1487|   363k|      is_motion_variation_allowed_compound(mbmi)) {
  ------------------
  |  Branch (1487:7): [True: 363k, False: 14]
  ------------------
 1488|   363k|    assert(!has_second_ref(mbmi));
 1489|   363k|    if (mbmi->num_proj_ref >= 1 && allow_warped_motion &&
  ------------------
  |  Branch (1489:9): [True: 363k, False: 18.4E]
  |  Branch (1489:36): [True: 363k, False: 18.4E]
  ------------------
 1490|   363k|        !xd->cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1490:9): [True: 363k, False: 14]
  ------------------
 1491|   363k|        !av1_is_scaled(xd->block_ref_scale_factors[0])) {
  ------------------
  |  Branch (1491:9): [True: 38.0k, False: 325k]
  ------------------
 1492|  38.0k|      return WARPED_CAUSAL;
 1493|  38.0k|    }
 1494|   325k|    return OBMC_CAUSAL;
 1495|   363k|  }
 1496|  18.4E|  return SIMPLE_TRANSLATION;
 1497|   363k|}
bitstream.c:check_num_overlappable_neighbors:
 1473|   510k|static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
 1474|   510k|  return mbmi->overlappable_neighbors != 0;
 1475|   510k|}
bitstream.c:is_global_mv_block:
  422|   363k|                                     TransformationType type) {
  423|   363k|  const PREDICTION_MODE mode = mbmi->mode;
  424|   363k|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|   363k|  const int block_size_allowed =
  426|   363k|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   363k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.89k, False: 355k]
  |  |  ------------------
  ------------------
  427|   363k|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 12.7k, False: 350k]
  |  Branch (427:31): [True: 18.4E, False: 350k]
  |  Branch (427:59): [True: 0, False: 12.7k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|   363k|}
bitstream.c:is_motion_variation_allowed_bsize:
 1460|   363k|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|   363k|  assert(bsize < BLOCK_SIZES_ALL);
 1462|   363k|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   363k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.89k, False: 355k]
  |  |  ------------------
  ------------------
 1463|   363k|}
bitstream.c:is_inter_mode:
   69|   363k|static inline int is_inter_mode(PREDICTION_MODE mode) {
   70|   363k|  return mode >= INTER_MODE_START && mode < INTER_MODE_END;
  ------------------
  |  Branch (70:10): [True: 363k, False: 18.4E]
  |  Branch (70:38): [True: 363k, False: 5]
  ------------------
   71|   363k|}
bitstream.c:is_motion_variation_allowed_compound:
 1466|   363k|    const MB_MODE_INFO *mbmi) {
 1467|   363k|  return !has_second_ref(mbmi);
 1468|   363k|}
bitstream.c:is_nontrans_global_motion:
 1581|   502k|                                            const MB_MODE_INFO *mbmi) {
 1582|   502k|  int ref;
 1583|       |
 1584|       |  // First check if all modes are GLOBALMV
 1585|   502k|  if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) return 0;
  ------------------
  |  Branch (1585:7): [True: 489k, False: 13.7k]
  |  Branch (1585:33): [True: 489k, False: 18.4E]
  ------------------
 1586|       |
 1587|  13.7k|  if (AOMMIN(mi_size_wide[mbmi->bsize], mi_size_high[mbmi->bsize]) < 2)
  ------------------
  |  |   34|  13.7k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 304, False: 13.4k]
  |  |  ------------------
  ------------------
  |  Branch (1587:7): [True: 14, False: 13.7k]
  ------------------
 1588|     14|    return 0;
 1589|       |
 1590|       |  // Now check if all global motion is non translational
 1591|  27.5k|  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1591:17): [True: 13.8k, False: 13.7k]
  ------------------
 1592|  13.8k|    if (xd->global_motion[mbmi->ref_frame[ref]].wmtype == TRANSLATION) return 0;
  ------------------
  |  Branch (1592:9): [True: 0, False: 13.8k]
  ------------------
 1593|  13.8k|  }
 1594|  13.7k|  return 1;
 1595|  13.7k|}
bitstream.c:av1_get_block_dimensions:
 1521|  66.9k|                                            int *cols_within_bounds) {
 1522|  66.9k|  const int block_height = block_size_high[bsize];
 1523|  66.9k|  const int block_width = block_size_wide[bsize];
 1524|  66.9k|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 66.9k, False: 30]
  ------------------
 1525|  66.9k|                             ? block_height
 1526|  66.9k|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|  66.9k|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 66.9k, False: 30]
  ------------------
 1528|  66.9k|                             ? block_width
 1529|  66.9k|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|  66.9k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|  66.9k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|  66.9k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|  66.9k|  assert(block_width >= block_cols);
 1534|  66.9k|  assert(block_height >= block_rows);
 1535|  66.9k|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|  66.9k|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|  66.9k|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 24.7k, False: 42.2k]
  |  Branch (1538:45): [True: 0, False: 24.7k]
  ------------------
 1539|  66.9k|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 24.7k, False: 42.2k]
  |  Branch (1539:45): [True: 0, False: 24.7k]
  ------------------
 1540|  66.9k|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 0, False: 66.9k]
  ------------------
 1541|      0|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|      0|    assert(*width >= 0);
 1543|      0|  }
 1544|  66.9k|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 0, False: 66.9k]
  ------------------
 1545|      0|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|      0|    assert(*height >= 0);
 1547|      0|  }
 1548|  66.9k|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 66.9k, False: 18.4E]
  ------------------
 1549|  66.9k|    *rows_within_bounds =
 1550|  66.9k|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|  66.9k|    assert(*rows_within_bounds >= 0);
 1552|  66.9k|  }
 1553|  66.9k|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 66.9k, False: 18.4E]
  ------------------
 1554|  66.9k|    *cols_within_bounds =
 1555|  66.9k|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|  66.9k|  }
 1558|  66.9k|}
bitstream.c:block_signals_txsize:
 1032|  2.99M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  2.99M|  return bsize > BLOCK_4X4;
 1034|  2.99M|}
bitstream.c:get_vartx_max_txsize:
 1453|  1.04M|                                       int plane) {
 1454|  1.04M|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1454:7): [True: 58.8k, False: 988k]
  ------------------
 1455|   988k|  const TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
 1456|   988k|  if (plane == 0) return max_txsize;            // luma
  ------------------
  |  Branch (1456:7): [True: 750k, False: 238k]
  ------------------
 1457|   238k|  return av1_get_adjusted_tx_size(max_txsize);  // chroma
 1458|   988k|}
bitstream.c:av1_get_adjusted_tx_size:
 1366|   527k|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   527k|  switch (tx_size) {
 1368|  1.11k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 1.11k, False: 526k]
  ------------------
 1369|  1.11k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 0, False: 527k]
  ------------------
 1370|  4.53k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 3.42k, False: 523k]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 527k]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 527k]
  ------------------
 1373|   522k|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 522k, False: 4.51k]
  ------------------
 1374|   527k|  }
 1375|   527k|}
bitstream.c:av1_get_txb_size_index:
 1212|  1.58M|                                         int blk_col) {
 1213|  1.58M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  1.58M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  1.58M|  };
 1216|  1.58M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  1.58M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  1.58M|  };
 1219|  1.58M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  1.58M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  1.58M|  };
 1222|  1.58M|  const int index =
 1223|  1.58M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  1.58M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  1.58M|  return index;
 1227|  1.58M|}
bitstream.c:bsize_to_max_depth:
 1330|  1.30M|static inline int bsize_to_max_depth(BLOCK_SIZE bsize) {
 1331|  1.30M|  static const uint8_t bsize_to_max_depth_table[BLOCK_SIZES_ALL] = {
 1332|  1.30M|    0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
 1333|  1.30M|  };
 1334|  1.30M|  return bsize_to_max_depth_table[bsize];
 1335|  1.30M|}
bitstream.c:bsize_to_tx_size_cat:
 1349|  1.30M|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|  1.30M|  assert(bsize < BLOCK_SIZES_ALL);
 1351|  1.30M|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|  1.30M|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|  1.30M|  };
 1354|  1.30M|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|  1.30M|  return depth - 1;
 1357|  1.30M|}
bitstream.c:av1_get_max_uv_txsize:
 1378|   288k|                                            int subsampling_y) {
 1379|   288k|  const BLOCK_SIZE plane_bsize =
 1380|   288k|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|   288k|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|   288k|  return av1_get_adjusted_tx_size(uv_tx);
 1384|   288k|}
encodeframe.c:get_plane_block_size:
 1193|  5.89M|                                              int subsampling_y) {
 1194|  5.89M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  5.89M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  5.89M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  5.89M|}
encodeframe.c:is_cur_buf_hbd:
  937|  5.90M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  5.90M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  5.90M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  5.90M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 1.39M, False: 4.51M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  5.90M|}
encodeframe_utils.c:get_plane_block_size:
 1193|  36.8k|                                              int subsampling_y) {
 1194|  36.8k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  36.8k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  36.8k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  36.8k|}
encodeframe_utils.c:is_inter_block:
  372|  3.75M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  3.75M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 437, False: 3.75M]
  |  Branch (373:36): [True: 1.02M, False: 2.73M]
  ------------------
  374|  3.75M|}
encodeframe_utils.c:is_intrabc_block:
  345|  3.75M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  3.75M|  return mbmi->use_intrabc;
  347|  3.75M|}
encodeframe_utils.c:get_uv_mode:
  349|  1.51M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  1.51M|  static const PREDICTION_MODE uv2y[] = {
  352|  1.51M|    DC_PRED,        // UV_DC_PRED
  353|  1.51M|    V_PRED,         // UV_V_PRED
  354|  1.51M|    H_PRED,         // UV_H_PRED
  355|  1.51M|    D45_PRED,       // UV_D45_PRED
  356|  1.51M|    D135_PRED,      // UV_D135_PRED
  357|  1.51M|    D113_PRED,      // UV_D113_PRED
  358|  1.51M|    D157_PRED,      // UV_D157_PRED
  359|  1.51M|    D203_PRED,      // UV_D203_PRED
  360|  1.51M|    D67_PRED,       // UV_D67_PRED
  361|  1.51M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  1.51M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  1.51M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  1.51M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  1.51M|    DC_PRED,        // UV_CFL_PRED
  366|  1.51M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  1.51M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  1.51M|  };
  369|  1.51M|  return uv2y[mode];
  370|  1.51M|}
encodeframe_utils.c:av1_allow_palette:
 1504|  1.51M|                                    BLOCK_SIZE sb_type) {
 1505|  1.51M|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|  1.51M|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 93.3k, False: 1.41M]
  ------------------
 1507|  93.3k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  1.60M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 93.3k, False: 0]
  ------------------
 1508|  93.3k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  1.60M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 93.3k, False: 0]
  ------------------
 1509|  93.3k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 61.6k, False: 31.7k]
  ------------------
 1510|  1.51M|}
encodeframe_utils.c:get_partition_subsize:
  996|  7.60M|                                               PARTITION_TYPE partition) {
  997|  7.60M|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 0, False: 7.60M]
  ------------------
  998|      0|    return BLOCK_INVALID;
  999|  7.60M|  } else {
 1000|  7.60M|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  7.60M|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  7.60M|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 7.60M]
  ------------------
 1002|  7.60M|               ? BLOCK_INVALID
 1003|  7.60M|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  7.60M|  }
 1005|  7.60M|}
encodeframe_utils.c:get_sqr_bsize_idx:
  976|  7.60M|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  7.60M|  switch (bsize) {
  978|      0|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 0, False: 7.60M]
  ------------------
  979|  5.63M|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 5.63M, False: 1.96M]
  ------------------
  980|  1.47M|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 1.47M, False: 6.12M]
  ------------------
  981|   388k|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 388k, False: 7.21M]
  ------------------
  982|   104k|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 104k, False: 7.49M]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 7.60M]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 7.60M]
  ------------------
  985|  7.60M|  }
  986|  7.60M|}
encodemb.c:get_bit_depth_info:
  967|   115M|static inline BitDepthInfo get_bit_depth_info(const MACROBLOCKD *xd) {
  968|   115M|  BitDepthInfo bit_depth_info;
  969|   115M|  bit_depth_info.bit_depth = xd->bd;
  970|   115M|  bit_depth_info.use_highbitdepth_buf = is_cur_buf_hbd(xd);
  971|       |  assert(IMPLIES(!bit_depth_info.use_highbitdepth_buf,
  972|   115M|                 bit_depth_info.bit_depth == 8));
  973|   115M|  return bit_depth_info;
  974|   115M|}
encodemb.c:get_plane_type:
 1597|  17.8M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|  17.8M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 12.3M, False: 5.45M]
  ------------------
 1599|  17.8M|}
encodemb.c:av1_get_max_eob:
 1601|   134M|static inline int av1_get_max_eob(TX_SIZE tx_size) {
 1602|   134M|  if (tx_size == TX_64X64 || tx_size == TX_64X32 || tx_size == TX_32X64) {
  ------------------
  |  Branch (1602:7): [True: 106k, False: 134M]
  |  Branch (1602:30): [True: 18.4E, False: 134M]
  |  Branch (1602:53): [True: 18.4E, False: 134M]
  ------------------
 1603|  35.0k|    return 1024;
 1604|  35.0k|  }
 1605|   134M|  if (tx_size == TX_16X64 || tx_size == TX_64X16) {
  ------------------
  |  Branch (1605:7): [True: 26.6k, False: 134M]
  |  Branch (1605:30): [True: 18.4E, False: 134M]
  ------------------
 1606|      0|    return 512;
 1607|      0|  }
 1608|   134M|  return tx_size_2d[tx_size];
 1609|   134M|}
encodemb.c:av1_get_ext_tx_set_type:
 1103|  85.5M|                                                int use_reduced_set) {
 1104|  85.5M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  85.5M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 35.0k, False: 85.5M]
  ------------------
 1106|  85.5M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 319k, False: 85.2M]
  ------------------
 1107|   319k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 107k, False: 211k]
  ------------------
 1108|  85.2M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 85.2M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  85.2M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  85.2M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  85.2M|}
encodemb.c:is_inter_block:
  372|  90.5M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  90.5M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 29.5k, False: 90.5M]
  |  Branch (373:36): [True: 11.4M, False: 79.0M]
  ------------------
  374|  90.5M|}
encodemb.c:is_intrabc_block:
  345|  90.5M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  90.5M|  return mbmi->use_intrabc;
  347|  90.5M|}
encodemb.c:is_cur_buf_hbd:
  937|   194M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|   194M|#if CONFIG_AV1_HIGHBITDEPTH
  939|   194M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|   194M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 61.3M, False: 132M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|   194M|}
encodemb.c:av1_get_tx_size:
 1386|  78.4M|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|  78.4M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|  78.4M|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 1.25M, False: 77.1M]
  ------------------
 1389|  77.1M|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 37.2M, False: 39.9M]
  ------------------
 1390|  39.9M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|  39.9M|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|  39.9M|                               pd->subsampling_y);
 1393|  77.1M|}
encodemb.c:av1_get_max_uv_txsize:
 1378|  40.7M|                                            int subsampling_y) {
 1379|  40.7M|  const BLOCK_SIZE plane_bsize =
 1380|  40.7M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  40.7M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  40.7M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  40.7M|}
encodemb.c:av1_get_adjusted_tx_size:
 1366|  41.1M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  41.1M|  switch (tx_size) {
 1368|  5.10k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 5.10k, False: 41.1M]
  ------------------
 1369|  5.76k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 666, False: 41.1M]
  ------------------
 1370|  14.7k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 8.96k, False: 41.1M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 41.1M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 41.1M]
  ------------------
 1373|  41.1M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 41.1M, False: 10.2k]
  ------------------
 1374|  41.1M|  }
 1375|  41.1M|}
encodemb.c:get_plane_block_size:
 1193|  59.7M|                                              int subsampling_y) {
 1194|  59.7M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  59.7M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  59.7M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  59.7M|}
encodemb.c:get_vartx_max_txsize:
 1453|  1.42M|                                       int plane) {
 1454|  1.42M|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1454:7): [True: 145k, False: 1.28M]
  ------------------
 1455|  1.28M|  const TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
 1456|  1.28M|  if (plane == 0) return max_txsize;            // luma
  ------------------
  |  Branch (1456:7): [True: 851k, False: 429k]
  ------------------
 1457|   429k|  return av1_get_adjusted_tx_size(max_txsize);  // chroma
 1458|  1.28M|}
encodemb.c:av1_get_txb_size_index:
 1212|  1.74M|                                         int blk_col) {
 1213|  1.74M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  1.74M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  1.74M|  };
 1216|  1.74M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  1.74M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  1.74M|  };
 1219|  1.74M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  1.74M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  1.74M|  };
 1222|  1.74M|  const int index =
 1223|  1.74M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  1.74M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  1.74M|  return index;
 1227|  1.74M|}
encodemb.c:av1_get_tx_type:
 1286|  17.2M|                                      int reduced_tx_set) {
 1287|  17.2M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1288|  17.2M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32) {
  ------------------
  |  Branch (1288:7): [True: 1.21M, False: 16.0M]
  |  Branch (1288:41): [True: 755, False: 16.0M]
  ------------------
 1289|  1.21M|    return DCT_DCT;
 1290|  1.21M|  }
 1291|       |
 1292|  16.0M|  TX_TYPE tx_type;
 1293|  16.0M|  if (plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1293:7): [True: 11.1M, False: 4.91M]
  ------------------
 1294|  11.1M|    tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1295|  11.1M|  } else {
 1296|  4.91M|    if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1296:9): [True: 431k, False: 4.48M]
  ------------------
 1297|       |      // scale back to y plane's coordinate
 1298|   431k|      const struct macroblockd_plane *const pd = &xd->plane[plane_type];
 1299|   431k|      blk_row <<= pd->subsampling_y;
 1300|   431k|      blk_col <<= pd->subsampling_x;
 1301|   431k|      tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1302|  4.48M|    } else {
 1303|       |      // In intra mode, uv planes don't share the same prediction mode as y
 1304|       |      // plane, so the tx_type should not be shared
 1305|  4.48M|      tx_type = intra_mode_to_tx_type(mbmi, PLANE_TYPE_UV);
 1306|  4.48M|    }
 1307|  4.91M|    const TxSetType tx_set_type =
 1308|  4.91M|        av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi), reduced_tx_set);
 1309|  4.91M|    if (!av1_ext_tx_used[tx_set_type][tx_type]) tx_type = DCT_DCT;
  ------------------
  |  Branch (1309:9): [True: 44, False: 4.91M]
  ------------------
 1310|  4.91M|  }
 1311|  16.0M|  assert(tx_type < TX_TYPES);
 1312|       |  assert(av1_ext_tx_used[av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi),
 1313|  16.0M|                                                 reduced_tx_set)][tx_type]);
 1314|  16.0M|  return tx_type;
 1315|  17.2M|}
encodemb.c:intra_mode_to_tx_type:
 1008|  4.49M|                                     PLANE_TYPE plane_type) {
 1009|  4.49M|  static const TX_TYPE _intra_mode_to_tx_type[INTRA_MODES] = {
 1010|  4.49M|    DCT_DCT,    // DC_PRED
 1011|  4.49M|    ADST_DCT,   // V_PRED
 1012|  4.49M|    DCT_ADST,   // H_PRED
 1013|  4.49M|    DCT_DCT,    // D45_PRED
 1014|  4.49M|    ADST_ADST,  // D135_PRED
 1015|  4.49M|    ADST_DCT,   // D113_PRED
 1016|  4.49M|    DCT_ADST,   // D157_PRED
 1017|  4.49M|    DCT_ADST,   // D203_PRED
 1018|  4.49M|    ADST_DCT,   // D67_PRED
 1019|  4.49M|    ADST_ADST,  // SMOOTH_PRED
 1020|  4.49M|    ADST_DCT,   // SMOOTH_V_PRED
 1021|  4.49M|    DCT_ADST,   // SMOOTH_H_PRED
 1022|  4.49M|    ADST_ADST,  // PAETH_PRED
 1023|  4.49M|  };
 1024|  4.49M|  const PREDICTION_MODE mode =
 1025|  4.49M|      (plane_type == PLANE_TYPE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  Branch (1025:7): [True: 0, False: 4.49M]
  ------------------
 1026|       |  assert(mode < INTRA_MODES);
 1027|  4.49M|  return _intra_mode_to_tx_type[mode];
 1028|  4.49M|}
encodemb.c:get_uv_mode:
  349|  4.49M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  4.49M|  static const PREDICTION_MODE uv2y[] = {
  352|  4.49M|    DC_PRED,        // UV_DC_PRED
  353|  4.49M|    V_PRED,         // UV_V_PRED
  354|  4.49M|    H_PRED,         // UV_H_PRED
  355|  4.49M|    D45_PRED,       // UV_D45_PRED
  356|  4.49M|    D135_PRED,      // UV_D135_PRED
  357|  4.49M|    D113_PRED,      // UV_D113_PRED
  358|  4.49M|    D157_PRED,      // UV_D157_PRED
  359|  4.49M|    D203_PRED,      // UV_D203_PRED
  360|  4.49M|    D67_PRED,       // UV_D67_PRED
  361|  4.49M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  4.49M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  4.49M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  4.49M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  4.49M|    DC_PRED,        // UV_CFL_PRED
  366|  4.49M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  4.49M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  4.49M|  };
  369|  4.49M|  return uv2y[mode];
  370|  4.49M|}
encodemb.c:update_txk_array:
 1262|   825k|                                    TX_TYPE tx_type) {
 1263|   825k|  const int stride = xd->tx_type_map_stride;
 1264|   825k|  xd->tx_type_map[blk_row * stride + blk_col] = tx_type;
 1265|       |
 1266|   825k|  const int txw = tx_size_wide_unit[tx_size];
 1267|   825k|  const int txh = tx_size_high_unit[tx_size];
 1268|       |  // The 16x16 unit is due to the constraint from tx_64x64 which sets the
 1269|       |  // maximum tx size for chroma as 32x32. Coupled with 4x1 transform block
 1270|       |  // size, the constraint takes effect in 32x16 / 16x32 size too. To solve
 1271|       |  // the intricacy, cover all the 16x16 units inside a 64 level transform.
 1272|   825k|  if (txw == tx_size_wide_unit[TX_64X64] ||
  ------------------
  |  Branch (1272:7): [True: 31, False: 825k]
  ------------------
 1273|   825k|      txh == tx_size_high_unit[TX_64X64]) {
  ------------------
  |  Branch (1273:7): [True: 23, False: 825k]
  ------------------
 1274|     55|    const int tx_unit = tx_size_wide_unit[TX_16X16];
 1275|    259|    for (int idy = 0; idy < txh; idy += tx_unit) {
  ------------------
  |  Branch (1275:23): [True: 204, False: 55]
  ------------------
 1276|    836|      for (int idx = 0; idx < txw; idx += tx_unit) {
  ------------------
  |  Branch (1276:25): [True: 632, False: 204]
  ------------------
 1277|    632|        xd->tx_type_map[(blk_row + idy) * stride + blk_col + idx] = tx_type;
 1278|    632|      }
 1279|    204|    }
 1280|     55|  }
 1281|   825k|}
encodetxb.c:av1_get_adjusted_tx_size:
 1366|  31.6M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  31.6M|  switch (tx_size) {
 1368|  6.99k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 6.99k, False: 31.6M]
  ------------------
 1369|  8.14k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 1.15k, False: 31.6M]
  ------------------
 1370|  9.39k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 1.24k, False: 31.6M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 31.6M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 31.6M]
  ------------------
 1373|  31.6M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 31.6M, False: 18.4E]
  ------------------
 1374|  31.6M|  }
 1375|  31.6M|}
encodetxb.c:get_plane_type:
 1597|  5.24M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|  5.24M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 3.61M, False: 1.63M]
  ------------------
 1599|  5.24M|}
encodetxb.c:av1_get_tx_type:
 1286|  24.5M|                                      int reduced_tx_set) {
 1287|  24.5M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1288|  24.5M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32) {
  ------------------
  |  Branch (1288:7): [True: 2.03M, False: 22.5M]
  |  Branch (1288:41): [True: 18.4E, False: 22.5M]
  ------------------
 1289|  2.04M|    return DCT_DCT;
 1290|  2.04M|  }
 1291|       |
 1292|  22.5M|  TX_TYPE tx_type;
 1293|  22.5M|  if (plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1293:7): [True: 16.2M, False: 6.28M]
  ------------------
 1294|  16.2M|    tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1295|  16.2M|  } else {
 1296|  6.28M|    if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1296:9): [True: 666k, False: 5.61M]
  ------------------
 1297|       |      // scale back to y plane's coordinate
 1298|   666k|      const struct macroblockd_plane *const pd = &xd->plane[plane_type];
 1299|   666k|      blk_row <<= pd->subsampling_y;
 1300|   666k|      blk_col <<= pd->subsampling_x;
 1301|   666k|      tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1302|  5.61M|    } else {
 1303|       |      // In intra mode, uv planes don't share the same prediction mode as y
 1304|       |      // plane, so the tx_type should not be shared
 1305|  5.61M|      tx_type = intra_mode_to_tx_type(mbmi, PLANE_TYPE_UV);
 1306|  5.61M|    }
 1307|  6.28M|    const TxSetType tx_set_type =
 1308|  6.28M|        av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi), reduced_tx_set);
 1309|  6.28M|    if (!av1_ext_tx_used[tx_set_type][tx_type]) tx_type = DCT_DCT;
  ------------------
  |  Branch (1309:9): [True: 76, False: 6.28M]
  ------------------
 1310|  6.28M|  }
 1311|  22.5M|  assert(tx_type < TX_TYPES);
 1312|       |  assert(av1_ext_tx_used[av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi),
 1313|  22.5M|                                                 reduced_tx_set)][tx_type]);
 1314|  22.5M|  return tx_type;
 1315|  24.5M|}
encodetxb.c:is_inter_block:
  372|  17.6M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  17.6M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 405, False: 17.6M]
  |  Branch (373:36): [True: 2.46M, False: 15.1M]
  ------------------
  374|  17.6M|}
encodetxb.c:is_intrabc_block:
  345|  17.6M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  17.6M|  return mbmi->use_intrabc;
  347|  17.6M|}
encodetxb.c:intra_mode_to_tx_type:
 1008|  5.65M|                                     PLANE_TYPE plane_type) {
 1009|  5.65M|  static const TX_TYPE _intra_mode_to_tx_type[INTRA_MODES] = {
 1010|  5.65M|    DCT_DCT,    // DC_PRED
 1011|  5.65M|    ADST_DCT,   // V_PRED
 1012|  5.65M|    DCT_ADST,   // H_PRED
 1013|  5.65M|    DCT_DCT,    // D45_PRED
 1014|  5.65M|    ADST_ADST,  // D135_PRED
 1015|  5.65M|    ADST_DCT,   // D113_PRED
 1016|  5.65M|    DCT_ADST,   // D157_PRED
 1017|  5.65M|    DCT_ADST,   // D203_PRED
 1018|  5.65M|    ADST_DCT,   // D67_PRED
 1019|  5.65M|    ADST_ADST,  // SMOOTH_PRED
 1020|  5.65M|    ADST_DCT,   // SMOOTH_V_PRED
 1021|  5.65M|    DCT_ADST,   // SMOOTH_H_PRED
 1022|  5.65M|    ADST_ADST,  // PAETH_PRED
 1023|  5.65M|  };
 1024|  5.65M|  const PREDICTION_MODE mode =
 1025|  5.65M|      (plane_type == PLANE_TYPE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  Branch (1025:7): [True: 0, False: 5.65M]
  ------------------
 1026|       |  assert(mode < INTRA_MODES);
 1027|  5.65M|  return _intra_mode_to_tx_type[mode];
 1028|  5.65M|}
encodetxb.c:get_uv_mode:
  349|  5.65M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  5.65M|  static const PREDICTION_MODE uv2y[] = {
  352|  5.65M|    DC_PRED,        // UV_DC_PRED
  353|  5.65M|    V_PRED,         // UV_V_PRED
  354|  5.65M|    H_PRED,         // UV_H_PRED
  355|  5.65M|    D45_PRED,       // UV_D45_PRED
  356|  5.65M|    D135_PRED,      // UV_D135_PRED
  357|  5.65M|    D113_PRED,      // UV_D113_PRED
  358|  5.65M|    D157_PRED,      // UV_D157_PRED
  359|  5.65M|    D203_PRED,      // UV_D203_PRED
  360|  5.65M|    D67_PRED,       // UV_D67_PRED
  361|  5.65M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  5.65M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  5.65M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  5.65M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  5.65M|    DC_PRED,        // UV_CFL_PRED
  366|  5.65M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  5.65M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  5.65M|  };
  369|  5.65M|  return uv2y[mode];
  370|  5.65M|}
encodetxb.c:av1_get_ext_tx_set_type:
 1103|  15.9M|                                                int use_reduced_set) {
 1104|  15.9M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  15.9M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 1.52k, False: 15.9M]
  ------------------
 1106|  15.9M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 29.2k, False: 15.9M]
  ------------------
 1107|  29.2k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 14.1k, False: 15.1k]
  ------------------
 1108|  15.9M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 15.9M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  15.9M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  15.9M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  15.9M|}
encodetxb.c:av1_get_tx_size:
 1386|  2.79M|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|  2.79M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|  2.79M|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 64.4k, False: 2.73M]
  ------------------
 1389|  2.73M|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 1.48M, False: 1.24M]
  ------------------
 1390|  1.24M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|  1.24M|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|  1.24M|                               pd->subsampling_y);
 1393|  2.73M|}
encodetxb.c:av1_get_max_uv_txsize:
 1378|  1.26M|                                            int subsampling_y) {
 1379|  1.26M|  const BLOCK_SIZE plane_bsize =
 1380|  1.26M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  1.26M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  1.26M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  1.26M|}
encodetxb.c:av1_get_max_eob:
 1601|  4.99M|static inline int av1_get_max_eob(TX_SIZE tx_size) {
 1602|  4.99M|  if (tx_size == TX_64X64 || tx_size == TX_64X32 || tx_size == TX_32X64) {
  ------------------
  |  Branch (1602:7): [True: 1.05k, False: 4.99M]
  |  Branch (1602:30): [True: 102, False: 4.99M]
  |  Branch (1602:53): [True: 108, False: 4.99M]
  ------------------
 1603|  1.52k|    return 1024;
 1604|  1.52k|  }
 1605|  4.99M|  if (tx_size == TX_16X64 || tx_size == TX_64X16) {
  ------------------
  |  Branch (1605:7): [True: 18.4E, False: 4.99M]
  |  Branch (1605:30): [True: 18.4E, False: 4.99M]
  ------------------
 1606|      0|    return 512;
 1607|      0|  }
 1608|  4.99M|  return tx_size_2d[tx_size];
 1609|  4.99M|}
encodetxb.c:get_ext_tx_types:
 1130|  3.46M|                                   int use_reduced_set) {
 1131|  3.46M|  const int set_type =
 1132|  3.46M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1133|  3.46M|  return av1_num_ext_tx_set[set_type];
 1134|  3.46M|}
encodetxb.c:get_ext_tx_set:
 1123|  3.09M|                                 int use_reduced_set) {
 1124|  3.09M|  const TxSetType set_type =
 1125|  3.09M|      av1_get_ext_tx_set_type(tx_size, is_inter, use_reduced_set);
 1126|  3.09M|  return ext_tx_set_index[is_inter][set_type];
 1127|  3.09M|}
encodetxb.c:get_plane_block_size:
 1193|  11.0M|                                              int subsampling_y) {
 1194|  11.0M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  11.0M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  11.0M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  11.0M|}
global_motion_facade.c:is_cur_buf_hbd:
  937|    497|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|    497|#if CONFIG_AV1_HIGHBITDEPTH
  939|    497|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|    497|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 28, False: 469]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|    497|}
mcomp.c:is_cur_buf_hbd:
  937|  41.6M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  41.6M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  41.6M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  41.6M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 12.9M, False: 28.7M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  41.6M|}
mcomp.c:is_intrabc_block:
  345|  4.24M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  4.24M|  return mbmi->use_intrabc;
  347|  4.24M|}
palette.c:av1_get_block_dimensions:
 1521|  1.20M|                                            int *cols_within_bounds) {
 1522|  1.20M|  const int block_height = block_size_high[bsize];
 1523|  1.20M|  const int block_width = block_size_wide[bsize];
 1524|  1.20M|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 1.19M, False: 6.85k]
  ------------------
 1525|  1.20M|                             ? block_height
 1526|  1.20M|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|  1.20M|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 1.19M, False: 4.81k]
  ------------------
 1528|  1.20M|                             ? block_width
 1529|  1.20M|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|  1.20M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|  1.20M|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|  1.20M|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|  1.20M|  assert(block_width >= block_cols);
 1534|  1.20M|  assert(block_height >= block_rows);
 1535|  1.20M|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|  1.20M|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|  1.20M|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 104k, False: 1.09M]
  |  Branch (1538:45): [True: 0, False: 104k]
  ------------------
 1539|  1.20M|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 104k, False: 1.09M]
  |  Branch (1539:45): [True: 0, False: 104k]
  ------------------
 1540|  1.20M|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 1.20M, False: 18.4E]
  ------------------
 1541|  1.20M|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|  1.20M|    assert(*width >= 0);
 1543|  1.20M|  }
 1544|  1.20M|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 1.20M, False: 18.4E]
  ------------------
 1545|  1.20M|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|  1.20M|    assert(*height >= 0);
 1547|  1.20M|  }
 1548|  1.20M|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 1.20M, False: 18.4E]
  ------------------
 1549|  1.20M|    *rows_within_bounds =
 1550|  1.20M|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|  1.20M|    assert(*rows_within_bounds >= 0);
 1552|  1.20M|  }
 1553|  1.20M|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 1.20M, False: 18.4E]
  ------------------
 1554|  1.20M|    *cols_within_bounds =
 1555|  1.20M|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|  1.20M|  }
 1558|  1.20M|}
palette.c:av1_allow_palette:
 1504|   831k|                                    BLOCK_SIZE sb_type) {
 1505|   831k|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|   831k|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 831k, False: 0]
  ------------------
 1507|   831k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  1.66M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 831k, False: 18.4E]
  ------------------
 1508|   831k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  1.66M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 831k, False: 18.4E]
  ------------------
 1509|   831k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 831k, False: 18.4E]
  ------------------
 1510|   831k|}
palette.c:block_signals_txsize:
 1032|   930k|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|   930k|  return bsize > BLOCK_4X4;
 1034|   930k|}
palette.c:bsize_to_tx_size_cat:
 1349|   436k|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|   436k|  assert(bsize < BLOCK_SIZES_ALL);
 1351|   436k|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|   436k|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|   436k|  };
 1354|   436k|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|   436k|  return depth - 1;
 1357|   436k|}
palette.c:is_inter_block:
  372|   548k|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|   548k|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 548k]
  |  Branch (373:36): [True: 23.6k, False: 524k]
  ------------------
  374|   548k|}
palette.c:is_intrabc_block:
  345|   548k|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|   548k|  return mbmi->use_intrabc;
  347|   548k|}
palette.c:get_uv_mode:
  349|   338k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   338k|  static const PREDICTION_MODE uv2y[] = {
  352|   338k|    DC_PRED,        // UV_DC_PRED
  353|   338k|    V_PRED,         // UV_V_PRED
  354|   338k|    H_PRED,         // UV_H_PRED
  355|   338k|    D45_PRED,       // UV_D45_PRED
  356|   338k|    D135_PRED,      // UV_D135_PRED
  357|   338k|    D113_PRED,      // UV_D113_PRED
  358|   338k|    D157_PRED,      // UV_D157_PRED
  359|   338k|    D203_PRED,      // UV_D203_PRED
  360|   338k|    D67_PRED,       // UV_D67_PRED
  361|   338k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   338k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   338k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   338k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   338k|    DC_PRED,        // UV_CFL_PRED
  366|   338k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   338k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   338k|  };
  369|   338k|  return uv2y[mode];
  370|   338k|}
partition_search.c:get_partition_subsize:
  996|  44.7M|                                               PARTITION_TYPE partition) {
  997|  44.7M|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 0, False: 44.7M]
  ------------------
  998|      0|    return BLOCK_INVALID;
  999|  44.7M|  } else {
 1000|  44.7M|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  44.7M|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  44.7M|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 44.7M]
  ------------------
 1002|  44.7M|               ? BLOCK_INVALID
 1003|  44.7M|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  44.7M|  }
 1005|  44.7M|}
partition_search.c:get_sqr_bsize_idx:
  976|  44.7M|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  44.7M|  switch (bsize) {
  978|  2.41M|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 2.41M, False: 42.3M]
  ------------------
  979|  29.5M|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 29.5M, False: 15.2M]
  ------------------
  980|  8.77M|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 8.77M, False: 36.0M]
  ------------------
  981|  2.77M|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 2.77M, False: 42.0M]
  ------------------
  982|  1.33M|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 1.33M, False: 43.4M]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 44.7M]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 44.7M]
  ------------------
  985|  44.7M|  }
  986|  44.7M|}
partition_search.c:is_inter_block:
  372|  24.9M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  24.9M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 24.9M]
  |  Branch (373:36): [True: 5.17M, False: 19.8M]
  ------------------
  374|  24.9M|}
partition_search.c:av1_allow_palette:
 1504|  5.25M|                                    BLOCK_SIZE sb_type) {
 1505|  5.25M|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|  5.25M|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 692k, False: 4.55M]
  ------------------
 1507|   692k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  5.94M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 692k, False: 18.4E]
  ------------------
 1508|   692k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  5.94M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 692k, False: 0]
  ------------------
 1509|   692k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 235k, False: 456k]
  ------------------
 1510|  5.25M|}
partition_search.c:has_second_ref:
  376|  7.06M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  7.06M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  7.06M|}
partition_search.c:is_intrabc_block:
  345|  25.0M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  25.0M|  return mbmi->use_intrabc;
  347|  25.0M|}
partition_search.c:get_vartx_max_txsize:
 1453|   828k|                                       int plane) {
 1454|   828k|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1454:7): [True: 0, False: 828k]
  ------------------
 1455|   828k|  const TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
 1456|   828k|  if (plane == 0) return max_txsize;            // luma
  ------------------
  |  Branch (1456:7): [True: 828k, False: 18.4E]
  ------------------
 1457|  18.4E|  return av1_get_adjusted_tx_size(max_txsize);  // chroma
 1458|   828k|}
partition_search.c:av1_get_txb_size_index:
 1212|  1.26M|                                         int blk_col) {
 1213|  1.26M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  1.26M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  1.26M|  };
 1216|  1.26M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  1.26M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  1.26M|  };
 1219|  1.26M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  1.26M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  1.26M|  };
 1222|  1.26M|  const int index =
 1223|  1.26M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  1.26M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  1.26M|  return index;
 1227|  1.26M|}
partition_search.c:block_signals_txsize:
 1032|  7.65M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  7.65M|  return bsize > BLOCK_4X4;
 1034|  7.65M|}
partition_search.c:bsize_to_tx_size_cat:
 1349|  1.45M|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|  1.45M|  assert(bsize < BLOCK_SIZES_ALL);
 1351|  1.45M|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|  1.45M|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|  1.45M|  };
 1354|  1.45M|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|  1.45M|  return depth - 1;
 1357|  1.45M|}
partition_search.c:bsize_to_max_depth:
 1330|  1.45M|static inline int bsize_to_max_depth(BLOCK_SIZE bsize) {
 1331|  1.45M|  static const uint8_t bsize_to_max_depth_table[BLOCK_SIZES_ALL] = {
 1332|  1.45M|    0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
 1333|  1.45M|  };
 1334|  1.45M|  return bsize_to_max_depth_table[bsize];
 1335|  1.45M|}
partition_search.c:tx_size_from_tx_mode:
 1139|   268k|static inline TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode) {
 1140|   268k|  const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
 1141|   268k|  const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
 1142|   268k|  if (bsize == BLOCK_4X4)
  ------------------
  |  Branch (1142:7): [True: 45.0k, False: 223k]
  ------------------
 1143|  45.0k|    return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
  ------------------
  |  |   34|  45.0k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 45.0k, False: 1]
  |  |  ------------------
  ------------------
 1144|   223k|  if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
  ------------------
  |  Branch (1144:7): [True: 223k, False: 18.4E]
  ------------------
 1145|   223k|    return max_rect_tx_size;
 1146|  18.4E|  else
 1147|  18.4E|    return largest_tx_size;
 1148|   223k|}
partition_search.c:get_plane_block_size:
 1193|  6.39M|                                              int subsampling_y) {
 1194|  6.39M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  6.39M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  6.39M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  6.39M|}
partition_search.c:is_comp_ref_allowed:
   65|   469k|static inline int is_comp_ref_allowed(BLOCK_SIZE bsize) {
   66|   469k|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   469k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.46k, False: 462k]
  |  |  ------------------
  ------------------
   67|   469k|}
partition_search.c:is_nontrans_global_motion:
 1581|   503k|                                            const MB_MODE_INFO *mbmi) {
 1582|   503k|  int ref;
 1583|       |
 1584|       |  // First check if all modes are GLOBALMV
 1585|   503k|  if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) return 0;
  ------------------
  |  Branch (1585:7): [True: 490k, False: 13.6k]
  |  Branch (1585:33): [True: 490k, False: 18.4E]
  ------------------
 1586|       |
 1587|  13.5k|  if (AOMMIN(mi_size_wide[mbmi->bsize], mi_size_high[mbmi->bsize]) < 2)
  ------------------
  |  |   34|  13.5k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 304, False: 13.2k]
  |  |  ------------------
  ------------------
  |  Branch (1587:7): [True: 14, False: 13.5k]
  ------------------
 1588|     14|    return 0;
 1589|       |
 1590|       |  // Now check if all global motion is non translational
 1591|  27.3k|  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1591:17): [True: 13.8k, False: 13.5k]
  ------------------
 1592|  13.8k|    if (xd->global_motion[mbmi->ref_frame[ref]].wmtype == TRANSLATION) return 0;
  ------------------
  |  Branch (1592:9): [True: 0, False: 13.8k]
  ------------------
 1593|  13.8k|  }
 1594|  13.5k|  return 1;
 1595|  13.5k|}
partition_search.c:have_nearmv_in_inter_mode:
  151|   510k|static inline int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
  152|   510k|  return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
  ------------------
  |  Branch (152:11): [True: 58.4k, False: 452k]
  |  Branch (152:29): [True: 18.4E, False: 452k]
  |  Branch (152:52): [True: 18.4E, False: 452k]
  ------------------
  153|   452k|          mode == NEW_NEARMV);
  ------------------
  |  Branch (153:11): [True: 18.4E, False: 452k]
  ------------------
  154|   510k|}
partition_search.c:motion_mode_allowed:
 1479|   510k|    const MB_MODE_INFO *mbmi, int allow_warped_motion) {
 1480|   510k|  if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1480:7): [True: 146k, False: 363k]
  ------------------
 1481|   364k|  if (xd->cur_frame_force_integer_mv == 0) {
  ------------------
  |  Branch (1481:7): [True: 364k, False: 18.4E]
  ------------------
 1482|   364k|    const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
 1483|   364k|    if (is_global_mv_block(mbmi, gm_type)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1483:9): [True: 0, False: 364k]
  ------------------
 1484|   364k|  }
 1485|   363k|  if (is_motion_variation_allowed_bsize(mbmi->bsize) &&
  ------------------
  |  Branch (1485:7): [True: 364k, False: 18.4E]
  ------------------
 1486|   364k|      is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
  ------------------
  |  Branch (1486:7): [True: 364k, False: 18.4E]
  |  Branch (1486:36): [True: 364k, False: 18.4E]
  ------------------
 1487|   364k|      is_motion_variation_allowed_compound(mbmi)) {
  ------------------
  |  Branch (1487:7): [True: 364k, False: 12]
  ------------------
 1488|   364k|    assert(!has_second_ref(mbmi));
 1489|   364k|    if (mbmi->num_proj_ref >= 1 && allow_warped_motion &&
  ------------------
  |  Branch (1489:9): [True: 364k, False: 1]
  |  Branch (1489:36): [True: 364k, False: 18.4E]
  ------------------
 1490|   364k|        !xd->cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1490:9): [True: 364k, False: 18.4E]
  ------------------
 1491|   364k|        !av1_is_scaled(xd->block_ref_scale_factors[0])) {
  ------------------
  |  Branch (1491:9): [True: 38.1k, False: 326k]
  ------------------
 1492|  38.1k|      return WARPED_CAUSAL;
 1493|  38.1k|    }
 1494|   326k|    return OBMC_CAUSAL;
 1495|   364k|  }
 1496|  18.4E|  return SIMPLE_TRANSLATION;
 1497|   363k|}
partition_search.c:check_num_overlappable_neighbors:
 1473|   510k|static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
 1474|   510k|  return mbmi->overlappable_neighbors != 0;
 1475|   510k|}
partition_search.c:is_global_mv_block:
  422|   364k|                                     TransformationType type) {
  423|   364k|  const PREDICTION_MODE mode = mbmi->mode;
  424|   364k|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|   364k|  const int block_size_allowed =
  426|   364k|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   364k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.89k, False: 356k]
  |  |  ------------------
  ------------------
  427|   364k|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 12.6k, False: 351k]
  |  Branch (427:31): [True: 18.4E, False: 351k]
  |  Branch (427:59): [True: 0, False: 12.7k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|   364k|}
partition_search.c:is_motion_variation_allowed_bsize:
 1460|   364k|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|   364k|  assert(bsize < BLOCK_SIZES_ALL);
 1462|   364k|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   364k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.89k, False: 356k]
  |  |  ------------------
  ------------------
 1463|   364k|}
partition_search.c:is_motion_variation_allowed_compound:
 1466|   364k|    const MB_MODE_INFO *mbmi) {
 1467|   364k|  return !has_second_ref(mbmi);
 1468|   364k|}
partition_search.c:is_inter_mode:
   69|   364k|static inline int is_inter_mode(PREDICTION_MODE mode) {
   70|   364k|  return mode >= INTER_MODE_START && mode < INTER_MODE_END;
  ------------------
  |  Branch (70:10): [True: 364k, False: 18.4E]
  |  Branch (70:38): [True: 364k, False: 18.4E]
  ------------------
   71|   364k|}
partition_search.c:have_newmv_in_inter_mode:
  156|   510k|static inline int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
  157|   510k|  return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV ||
  ------------------
  |  Branch (157:11): [True: 275k, False: 235k]
  |  Branch (157:28): [True: 18.4E, False: 235k]
  |  Branch (157:49): [True: 18.4E, False: 235k]
  ------------------
  158|   235k|          mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV);
  ------------------
  |  Branch (158:11): [True: 18.4E, False: 235k]
  |  Branch (158:36): [True: 18.4E, False: 235k]
  |  Branch (158:58): [True: 18.4E, False: 235k]
  ------------------
  159|   510k|}
partition_strategy.c:get_partition_subsize:
  996|  1.17M|                                               PARTITION_TYPE partition) {
  997|  1.17M|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 0, False: 1.17M]
  ------------------
  998|      0|    return BLOCK_INVALID;
  999|  1.17M|  } else {
 1000|  1.17M|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  1.17M|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  1.17M|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 1.17M]
  ------------------
 1002|  1.17M|               ? BLOCK_INVALID
 1003|  1.17M|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  1.17M|  }
 1005|  1.17M|}
partition_strategy.c:get_sqr_bsize_idx:
  976|  1.17M|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  1.17M|  switch (bsize) {
  978|      0|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 0, False: 1.17M]
  ------------------
  979|   145k|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 145k, False: 1.03M]
  ------------------
  980|   651k|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 651k, False: 526k]
  ------------------
  981|   265k|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 265k, False: 912k]
  ------------------
  982|   115k|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 115k, False: 1.06M]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 1.17M]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 1.17M]
  ------------------
  985|  1.17M|  }
  986|  1.17M|}
pickcdef.c:get_plane_block_size:
 1193|   536k|                                              int subsampling_y) {
 1194|   536k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|   536k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|   536k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|   536k|}
rdopt.c:get_plane_block_size:
 1193|  9.83M|                                              int subsampling_y) {
 1194|  9.83M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  9.83M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  9.83M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  9.83M|}
rdopt.c:av1_get_tx_size:
 1386|   186k|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|   186k|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|   186k|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 5.90k, False: 180k]
  ------------------
 1389|   180k|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 0, False: 180k]
  ------------------
 1390|   180k|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|   180k|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|   180k|                               pd->subsampling_y);
 1393|   180k|}
rdopt.c:av1_get_max_uv_txsize:
 1378|   180k|                                            int subsampling_y) {
 1379|   180k|  const BLOCK_SIZE plane_bsize =
 1380|   180k|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|   180k|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|   180k|  return av1_get_adjusted_tx_size(uv_tx);
 1384|   180k|}
rdopt.c:av1_get_adjusted_tx_size:
 1366|   180k|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   180k|  switch (tx_size) {
 1368|    104|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 104, False: 180k]
  ------------------
 1369|    327|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 223, False: 180k]
  ------------------
 1370|    641|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 314, False: 180k]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 180k]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 180k]
  ------------------
 1373|   180k|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 180k, False: 640]
  ------------------
 1374|   180k|  }
 1375|   180k|}
rdopt.c:is_cur_buf_hbd:
  937|  1.96M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  1.96M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  1.96M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  1.96M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 600k, False: 1.36M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  1.96M|}
rdopt.c:check_num_overlappable_neighbors:
 1473|  9.26M|static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
 1474|  9.26M|  return mbmi->overlappable_neighbors != 0;
 1475|  9.26M|}
rdopt.c:is_inter_block:
  372|  6.47M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  6.47M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 6.47M]
  |  Branch (373:36): [True: 728k, False: 5.74M]
  ------------------
  374|  6.47M|}
rdopt.c:is_intrabc_block:
  345|  6.47M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  6.47M|  return mbmi->use_intrabc;
  347|  6.47M|}
rdopt.c:compound_ref0_mode:
   85|  14.5M|static inline PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
   86|  14.5M|  static const PREDICTION_MODE lut[] = {
   87|  14.5M|    DC_PRED,        // DC_PRED
   88|  14.5M|    V_PRED,         // V_PRED
   89|  14.5M|    H_PRED,         // H_PRED
   90|  14.5M|    D45_PRED,       // D45_PRED
   91|  14.5M|    D135_PRED,      // D135_PRED
   92|  14.5M|    D113_PRED,      // D113_PRED
   93|  14.5M|    D157_PRED,      // D157_PRED
   94|  14.5M|    D203_PRED,      // D203_PRED
   95|  14.5M|    D67_PRED,       // D67_PRED
   96|  14.5M|    SMOOTH_PRED,    // SMOOTH_PRED
   97|  14.5M|    SMOOTH_V_PRED,  // SMOOTH_V_PRED
   98|  14.5M|    SMOOTH_H_PRED,  // SMOOTH_H_PRED
   99|  14.5M|    PAETH_PRED,     // PAETH_PRED
  100|  14.5M|    NEARESTMV,      // NEARESTMV
  101|  14.5M|    NEARMV,         // NEARMV
  102|  14.5M|    GLOBALMV,       // GLOBALMV
  103|  14.5M|    NEWMV,          // NEWMV
  104|  14.5M|    NEARESTMV,      // NEAREST_NEARESTMV
  105|  14.5M|    NEARMV,         // NEAR_NEARMV
  106|  14.5M|    NEARESTMV,      // NEAREST_NEWMV
  107|  14.5M|    NEWMV,          // NEW_NEARESTMV
  108|  14.5M|    NEARMV,         // NEAR_NEWMV
  109|  14.5M|    NEWMV,          // NEW_NEARMV
  110|  14.5M|    GLOBALMV,       // GLOBAL_GLOBALMV
  111|  14.5M|    NEWMV,          // NEW_NEWMV
  112|  14.5M|  };
  113|  14.5M|  assert(NELEMENTS(lut) == MB_MODE_COUNT);
  114|       |  assert(is_inter_compound_mode(mode) || is_inter_singleref_mode(mode));
  115|  14.5M|  return lut[mode];
  116|  14.5M|}
rdopt.c:get_buf_by_bd:
  946|  1.91M|static inline uint8_t *get_buf_by_bd(const MACROBLOCKD *xd, uint8_t *buf16) {
  947|  1.91M|#if CONFIG_AV1_HIGHBITDEPTH
  948|  1.91M|  return (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
  ------------------
  |  |  142|  1.91M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (948:10): [True: 596k, False: 1.32M]
  ------------------
  949|  1.91M|             ? CONVERT_TO_BYTEPTR(buf16)
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  950|  1.91M|             : buf16;
  951|       |#else
  952|       |  (void)xd;
  953|       |  return buf16;
  954|       |#endif
  955|  1.91M|}
rdopt.c:is_global_mv_block:
  422|  1.38M|                                     TransformationType type) {
  423|  1.38M|  const PREDICTION_MODE mode = mbmi->mode;
  424|  1.38M|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|  1.38M|  const int block_size_allowed =
  426|  1.38M|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  1.38M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 19.3k, False: 1.36M]
  |  |  ------------------
  ------------------
  427|  1.38M|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 85.7k, False: 1.29M]
  |  Branch (427:31): [True: 18.4E, False: 1.29M]
  |  Branch (427:59): [True: 0, False: 86.2k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|  1.38M|}
rdopt.c:is_inter_compound_mode:
   81|  6.99M|static inline int is_inter_compound_mode(PREDICTION_MODE mode) {
   82|  6.99M|  return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END;
  ------------------
  |  Branch (82:10): [True: 0, False: 6.99M]
  |  Branch (82:43): [True: 0, False: 0]
  ------------------
   83|  6.99M|}
rdopt.c:is_comp_ref_allowed:
   65|   253M|static inline int is_comp_ref_allowed(BLOCK_SIZE bsize) {
   66|   253M|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|   253M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 9.06M, False: 244M]
  |  |  ------------------
  ------------------
   67|   253M|}
rdopt.c:have_newmv_in_inter_mode:
  156|  7.71M|static inline int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
  157|  7.71M|  return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV ||
  ------------------
  |  Branch (157:11): [True: 2.41M, False: 5.29M]
  |  Branch (157:28): [True: 18.4E, False: 5.29M]
  |  Branch (157:49): [True: 18.4E, False: 5.29M]
  ------------------
  158|  5.29M|          mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV);
  ------------------
  |  Branch (158:11): [True: 18.4E, False: 5.29M]
  |  Branch (158:36): [True: 18.4E, False: 5.29M]
  |  Branch (158:58): [True: 1, False: 5.29M]
  ------------------
  159|  7.71M|}
rdopt.c:motion_mode_allowed:
 1479|  9.26M|    const MB_MODE_INFO *mbmi, int allow_warped_motion) {
 1480|  9.26M|  if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1480:7): [True: 7.88M, False: 1.38M]
  ------------------
 1481|  1.38M|  if (xd->cur_frame_force_integer_mv == 0) {
  ------------------
  |  Branch (1481:7): [True: 1.38M, False: 18.4E]
  ------------------
 1482|  1.38M|    const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
 1483|  1.38M|    if (is_global_mv_block(mbmi, gm_type)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1483:9): [True: 0, False: 1.38M]
  ------------------
 1484|  1.38M|  }
 1485|  1.38M|  if (is_motion_variation_allowed_bsize(mbmi->bsize) &&
  ------------------
  |  Branch (1485:7): [True: 1.38M, False: 18.4E]
  ------------------
 1486|  1.38M|      is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
  ------------------
  |  Branch (1486:7): [True: 1.38M, False: 18.4E]
  |  Branch (1486:36): [True: 1.38M, False: 18.4E]
  ------------------
 1487|  1.38M|      is_motion_variation_allowed_compound(mbmi)) {
  ------------------
  |  Branch (1487:7): [True: 1.38M, False: 158]
  ------------------
 1488|  1.38M|    assert(!has_second_ref(mbmi));
 1489|  1.38M|    if (mbmi->num_proj_ref >= 1 && allow_warped_motion &&
  ------------------
  |  Branch (1489:9): [True: 1.38M, False: 82]
  |  Branch (1489:36): [True: 1.38M, False: 18.4E]
  ------------------
 1490|  1.38M|        !xd->cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1490:9): [True: 1.38M, False: 18.4E]
  ------------------
 1491|  1.38M|        !av1_is_scaled(xd->block_ref_scale_factors[0])) {
  ------------------
  |  Branch (1491:9): [True: 180k, False: 1.20M]
  ------------------
 1492|   180k|      return WARPED_CAUSAL;
 1493|   180k|    }
 1494|  1.20M|    return OBMC_CAUSAL;
 1495|  1.38M|  }
 1496|  18.4E|  return SIMPLE_TRANSLATION;
 1497|  1.38M|}
rdopt.c:is_motion_variation_allowed_compound:
 1466|  1.38M|    const MB_MODE_INFO *mbmi) {
 1467|  1.38M|  return !has_second_ref(mbmi);
 1468|  1.38M|}
rdopt.c:is_inter_singleref_mode:
   78|  12.7M|static inline int is_inter_singleref_mode(PREDICTION_MODE mode) {
   79|  12.7M|  return mode >= SINGLE_INTER_MODE_START && mode < SINGLE_INTER_MODE_END;
  ------------------
  |  Branch (79:10): [True: 12.7M, False: 43]
  |  Branch (79:45): [True: 12.7M, False: 18.4E]
  ------------------
   80|  12.7M|}
rdopt.c:block_signals_txsize:
 1032|  1.56M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  1.56M|  return bsize > BLOCK_4X4;
 1034|  1.56M|}
rdopt.c:get_uv_mode:
  349|   730k|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|   730k|  static const PREDICTION_MODE uv2y[] = {
  352|   730k|    DC_PRED,        // UV_DC_PRED
  353|   730k|    V_PRED,         // UV_V_PRED
  354|   730k|    H_PRED,         // UV_H_PRED
  355|   730k|    D45_PRED,       // UV_D45_PRED
  356|   730k|    D135_PRED,      // UV_D135_PRED
  357|   730k|    D113_PRED,      // UV_D113_PRED
  358|   730k|    D157_PRED,      // UV_D157_PRED
  359|   730k|    D203_PRED,      // UV_D203_PRED
  360|   730k|    D67_PRED,       // UV_D67_PRED
  361|   730k|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|   730k|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|   730k|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|   730k|    PAETH_PRED,     // UV_PAETH_PRED
  365|   730k|    DC_PRED,        // UV_CFL_PRED
  366|   730k|    INTRA_INVALID,  // UV_INTRA_MODES
  367|   730k|    INTRA_INVALID,  // UV_MODE_INVALID
  368|   730k|  };
  369|   730k|  return uv2y[mode];
  370|   730k|}
rdopt.c:av1_allow_palette:
 1504|  2.64M|                                    BLOCK_SIZE sb_type) {
 1505|  2.64M|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|  2.64M|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 691k, False: 1.95M]
  ------------------
 1507|   691k|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  3.33M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 691k, False: 0]
  ------------------
 1508|   691k|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  3.33M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 691k, False: 0]
  ------------------
 1509|   691k|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 159k, False: 532k]
  ------------------
 1510|  2.64M|}
rdopt.c:is_inter_mode:
   69|  7.48M|static inline int is_inter_mode(PREDICTION_MODE mode) {
   70|  7.48M|  return mode >= INTER_MODE_START && mode < INTER_MODE_END;
  ------------------
  |  Branch (70:10): [True: 2.98M, False: 4.49M]
  |  Branch (70:38): [True: 2.98M, False: 18.4E]
  ------------------
   71|  7.48M|}
rdopt.c:have_nearmv_in_inter_mode:
  151|  12.4M|static inline int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
  152|  12.4M|  return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
  ------------------
  |  Branch (152:11): [True: 2.75M, False: 9.69M]
  |  Branch (152:29): [True: 18.4E, False: 9.69M]
  |  Branch (152:52): [True: 18.4E, False: 9.69M]
  ------------------
  153|  9.69M|          mode == NEW_NEARMV);
  ------------------
  |  Branch (153:11): [True: 18.4E, False: 9.69M]
  ------------------
  154|  12.4M|}
rdopt.c:is_nontrans_global_motion:
 1581|  9.41M|                                            const MB_MODE_INFO *mbmi) {
 1582|  9.41M|  int ref;
 1583|       |
 1584|       |  // First check if all modes are GLOBALMV
 1585|  9.41M|  if (mbmi->mode != GLOBALMV && mbmi->mode != GLOBAL_GLOBALMV) return 0;
  ------------------
  |  Branch (1585:7): [True: 8.85M, False: 557k]
  |  Branch (1585:33): [True: 8.85M, False: 213]
  ------------------
 1586|       |
 1587|   557k|  if (AOMMIN(mi_size_wide[mbmi->bsize], mi_size_high[mbmi->bsize]) < 2)
  ------------------
  |  |   34|   557k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 17.1k, False: 540k]
  |  |  ------------------
  ------------------
  |  Branch (1587:7): [True: 108k, False: 449k]
  ------------------
 1588|   108k|    return 0;
 1589|       |
 1590|       |  // Now check if all global motion is non translational
 1591|   899k|  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1591:17): [True: 450k, False: 449k]
  ------------------
 1592|   450k|    if (xd->global_motion[mbmi->ref_frame[ref]].wmtype == TRANSLATION) return 0;
  ------------------
  |  Branch (1592:9): [True: 0, False: 450k]
  ------------------
 1593|   450k|  }
 1594|   449k|  return 1;
 1595|   449k|}
rdopt.c:is_motion_variation_allowed_bsize:
 1460|  1.38M|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|  1.38M|  assert(bsize < BLOCK_SIZES_ALL);
 1462|  1.38M|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  1.38M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 19.3k, False: 1.36M]
  |  |  ------------------
  ------------------
 1463|  1.38M|}
rdopt.c:has_second_ref:
  376|  33.9M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  33.9M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  33.9M|}
nonrd_pickmode.c:av1_allow_palette:
 1504|   603k|                                    BLOCK_SIZE sb_type) {
 1505|   603k|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|   603k|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 0, False: 603k]
  ------------------
 1507|      0|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|   603k|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 0, False: 0]
  ------------------
 1508|      0|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|   603k|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 0, False: 0]
  ------------------
 1509|      0|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 0, False: 0]
  ------------------
 1510|   603k|}
nonrd_pickmode.c:is_comp_ref_allowed:
   65|  1.04M|static inline int is_comp_ref_allowed(BLOCK_SIZE bsize) {
   66|  1.04M|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  1.04M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.33k, False: 1.03M]
  |  |  ------------------
  ------------------
   67|  1.04M|}
nonrd_pickmode.c:is_inter_compound_mode:
   81|  7.15M|static inline int is_inter_compound_mode(PREDICTION_MODE mode) {
   82|  7.15M|  return mode >= COMP_INTER_MODE_START && mode < COMP_INTER_MODE_END;
  ------------------
  |  Branch (82:10): [True: 0, False: 7.15M]
  |  Branch (82:43): [True: 0, False: 0]
  ------------------
   83|  7.15M|}
nonrd_pickmode.c:is_cur_buf_hbd:
  937|  3.32M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  3.32M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  3.32M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  3.32M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 157k, False: 3.17M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  3.32M|}
nonrd_pickmode.c:get_plane_block_size:
 1193|   622k|                                              int subsampling_y) {
 1194|   622k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|   622k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|   622k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|   622k|}
nonrd_pickmode.c:motion_mode_allowed:
 1479|  2.00M|    const MB_MODE_INFO *mbmi, int allow_warped_motion) {
 1480|  2.00M|  if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1480:7): [True: 420k, False: 1.58M]
  ------------------
 1481|  1.58M|  if (xd->cur_frame_force_integer_mv == 0) {
  ------------------
  |  Branch (1481:7): [True: 1.58M, False: 18.4E]
  ------------------
 1482|  1.58M|    const TransformationType gm_type = gm_params[mbmi->ref_frame[0]].wmtype;
 1483|  1.58M|    if (is_global_mv_block(mbmi, gm_type)) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (1483:9): [True: 0, False: 1.58M]
  ------------------
 1484|  1.58M|  }
 1485|  1.58M|  if (is_motion_variation_allowed_bsize(mbmi->bsize) &&
  ------------------
  |  Branch (1485:7): [True: 1.58M, False: 18.4E]
  ------------------
 1486|  1.58M|      is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
  ------------------
  |  Branch (1486:7): [True: 1.58M, False: 500]
  |  Branch (1486:36): [True: 1.58M, False: 18.4E]
  ------------------
 1487|  1.58M|      is_motion_variation_allowed_compound(mbmi)) {
  ------------------
  |  Branch (1487:7): [True: 1.58M, False: 623]
  ------------------
 1488|  1.58M|    assert(!has_second_ref(mbmi));
 1489|  1.58M|    if (mbmi->num_proj_ref >= 1 && allow_warped_motion &&
  ------------------
  |  Branch (1489:9): [True: 1.58M, False: 184]
  |  Branch (1489:36): [True: 1.58M, False: 18.4E]
  ------------------
 1490|  1.58M|        !xd->cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1490:9): [True: 1.58M, False: 18.4E]
  ------------------
 1491|  1.58M|        !av1_is_scaled(xd->block_ref_scale_factors[0])) {
  ------------------
  |  Branch (1491:9): [True: 1.58M, False: 431]
  ------------------
 1492|  1.58M|      return WARPED_CAUSAL;
 1493|  1.58M|    }
 1494|    546|    return OBMC_CAUSAL;
 1495|  1.58M|  }
 1496|  18.4E|  return SIMPLE_TRANSLATION;
 1497|  1.58M|}
nonrd_pickmode.c:check_num_overlappable_neighbors:
 1473|  2.00M|static inline int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
 1474|  2.00M|  return mbmi->overlappable_neighbors != 0;
 1475|  2.00M|}
nonrd_pickmode.c:is_global_mv_block:
  422|  1.58M|                                     TransformationType type) {
  423|  1.58M|  const PREDICTION_MODE mode = mbmi->mode;
  424|  1.58M|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|  1.58M|  const int block_size_allowed =
  426|  1.58M|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  1.58M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 23.4k, False: 1.56M]
  |  |  ------------------
  ------------------
  427|  1.58M|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 305k, False: 1.28M]
  |  Branch (427:31): [True: 18.4E, False: 1.28M]
  |  Branch (427:59): [True: 0, False: 309k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|  1.58M|}
nonrd_pickmode.c:is_motion_variation_allowed_bsize:
 1460|  1.98M|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|  1.98M|  assert(bsize < BLOCK_SIZES_ALL);
 1462|  1.98M|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  1.98M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.9k, False: 1.95M]
  |  |  ------------------
  ------------------
 1463|  1.98M|}
nonrd_pickmode.c:is_motion_variation_allowed_compound:
 1466|  1.58M|    const MB_MODE_INFO *mbmi) {
 1467|  1.58M|  return !has_second_ref(mbmi);
 1468|  1.58M|}
nonrd_pickmode.c:has_second_ref:
  376|  3.20M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  3.20M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  3.20M|}
nonrd_pickmode.c:is_inter_block:
  372|  1.19M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  1.19M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 220, False: 1.19M]
  |  Branch (373:36): [True: 794k, False: 398k]
  ------------------
  374|  1.19M|}
nonrd_pickmode.c:is_intrabc_block:
  345|  1.19M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  1.19M|  return mbmi->use_intrabc;
  347|  1.19M|}
nonrd_pickmode.c:is_inter_mode:
   69|  1.58M|static inline int is_inter_mode(PREDICTION_MODE mode) {
   70|  1.58M|  return mode >= INTER_MODE_START && mode < INTER_MODE_END;
  ------------------
  |  Branch (70:10): [True: 1.58M, False: 18.4E]
  |  Branch (70:38): [True: 1.58M, False: 18.4E]
  ------------------
   71|  1.58M|}
nonrd_opt.c:is_cur_buf_hbd:
  937|  3.20M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  3.20M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  3.20M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  3.20M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 162k, False: 3.04M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  3.20M|}
nonrd_opt.c:get_plane_block_size:
 1193|  2.56M|                                              int subsampling_y) {
 1194|  2.56M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  2.56M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  2.56M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  2.56M|}
reconinter_enc.c:is_cur_buf_hbd:
  937|  54.9M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  54.9M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  54.9M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  54.9M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 16.7M, False: 38.2M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  54.9M|}
reconinter_enc.c:is_inter_block:
  372|   496k|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|   496k|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 19, False: 496k]
  |  Branch (373:36): [True: 160k, False: 336k]
  ------------------
  374|   496k|}
reconinter_enc.c:has_second_ref:
  376|  13.5M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  13.5M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  13.5M|}
reconinter_enc.c:is_masked_compound_type:
  161|  13.5M|static inline int is_masked_compound_type(COMPOUND_TYPE type) {
  162|  13.5M|  return (type == COMPOUND_WEDGE || type == COMPOUND_DIFFWTD);
  ------------------
  |  Branch (162:11): [True: 18.4E, False: 13.5M]
  |  Branch (162:37): [True: 18.4E, False: 13.5M]
  ------------------
  163|  13.5M|}
reconinter_enc.c:is_interintra_pred:
 1447|  13.5M|static inline int is_interintra_pred(const MB_MODE_INFO *mbmi) {
 1448|  13.5M|  return mbmi->ref_frame[0] > INTRA_FRAME &&
  ------------------
  |  Branch (1448:10): [True: 13.5M, False: 18.4E]
  ------------------
 1449|  13.5M|         mbmi->ref_frame[1] == INTRA_FRAME && is_interintra_allowed(mbmi);
  ------------------
  |  Branch (1449:10): [True: 0, False: 13.5M]
  |  Branch (1449:47): [True: 0, False: 0]
  ------------------
 1450|  13.5M|}
reconinter_enc.c:is_global_mv_block:
  422|  13.4M|                                     TransformationType type) {
  423|  13.4M|  const PREDICTION_MODE mode = mbmi->mode;
  424|  13.4M|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|  13.4M|  const int block_size_allowed =
  426|  13.4M|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  13.4M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 420k, False: 13.0M]
  |  |  ------------------
  ------------------
  427|  13.4M|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 689k, False: 12.7M]
  |  Branch (427:31): [True: 18.4E, False: 12.7M]
  |  Branch (427:59): [True: 0, False: 698k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|  13.4M|}
reconinter_enc.c:get_plane_block_size:
 1193|  64.2k|                                              int subsampling_y) {
 1194|  64.2k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  64.2k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  64.2k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  64.2k|}
reconinter_enc.c:is_intrabc_block:
  345|  69.0M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  69.0M|  return mbmi->use_intrabc;
  347|  69.0M|}
tokenize.c:av1_get_block_dimensions:
 1521|   933k|                                            int *cols_within_bounds) {
 1522|   933k|  const int block_height = block_size_high[bsize];
 1523|   933k|  const int block_width = block_size_wide[bsize];
 1524|   933k|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 928k, False: 4.79k]
  ------------------
 1525|   933k|                             ? block_height
 1526|   933k|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|   933k|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 929k, False: 3.47k]
  ------------------
 1528|   933k|                             ? block_width
 1529|   933k|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|   933k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|   933k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|   933k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|   933k|  assert(block_width >= block_cols);
 1534|   933k|  assert(block_height >= block_rows);
 1535|   933k|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|   933k|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|   933k|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 393k, False: 539k]
  |  Branch (1538:45): [True: 0, False: 393k]
  ------------------
 1539|   933k|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 393k, False: 539k]
  |  Branch (1539:45): [True: 0, False: 393k]
  ------------------
 1540|   933k|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 933k, False: 18.4E]
  ------------------
 1541|   933k|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|   933k|    assert(*width >= 0);
 1543|   933k|  }
 1544|   933k|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 0, False: 933k]
  ------------------
 1545|      0|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|      0|    assert(*height >= 0);
 1547|      0|  }
 1548|   933k|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 933k, False: 18.4E]
  ------------------
 1549|   933k|    *rows_within_bounds =
 1550|   933k|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|   933k|    assert(*rows_within_bounds >= 0);
 1552|   933k|  }
 1553|   933k|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 933k, False: 18.4E]
  ------------------
 1554|   933k|    *cols_within_bounds =
 1555|   933k|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|   933k|  }
 1558|   933k|}
tokenize.c:get_plane_block_size:
 1193|  5.53M|                                              int subsampling_y) {
 1194|  5.53M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  5.53M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  5.53M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  5.53M|}
tokenize.c:get_vartx_max_txsize:
 1453|  1.42M|                                       int plane) {
 1454|  1.42M|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1454:7): [True: 145k, False: 1.28M]
  ------------------
 1455|  1.28M|  const TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
 1456|  1.28M|  if (plane == 0) return max_txsize;            // luma
  ------------------
  |  Branch (1456:7): [True: 851k, False: 430k]
  ------------------
 1457|   430k|  return av1_get_adjusted_tx_size(max_txsize);  // chroma
 1458|  1.28M|}
tokenize.c:av1_get_adjusted_tx_size:
 1366|   974k|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   974k|  switch (tx_size) {
 1368|  1.11k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 1.11k, False: 973k]
  ------------------
 1369|  1.11k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 0, False: 974k]
  ------------------
 1370|  4.53k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 3.42k, False: 971k]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 974k]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 974k]
  ------------------
 1373|   970k|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 970k, False: 4.53k]
  ------------------
 1374|   974k|  }
 1375|   974k|}
tokenize.c:av1_get_max_uv_txsize:
 1378|   544k|                                            int subsampling_y) {
 1379|   544k|  const BLOCK_SIZE plane_bsize =
 1380|   544k|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|   544k|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|   544k|  return av1_get_adjusted_tx_size(uv_tx);
 1384|   544k|}
tokenize.c:av1_get_txb_size_index:
 1212|  1.74M|                                         int blk_col) {
 1213|  1.74M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  1.74M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  1.74M|  };
 1216|  1.74M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  1.74M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  1.74M|  };
 1219|  1.74M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  1.74M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  1.74M|  };
 1222|  1.74M|  const int index =
 1223|  1.74M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  1.74M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  1.74M|  return index;
 1227|  1.74M|}
tx_search.c:is_inter_block:
  372|   422M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|   422M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 57.8k, False: 422M]
  |  Branch (373:36): [True: 55.3M, False: 367M]
  ------------------
  374|   422M|}
tx_search.c:is_intrabc_block:
  345|   422M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|   422M|  return mbmi->use_intrabc;
  347|   422M|}
tx_search.c:block_signals_txsize:
 1032|  8.42M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  8.42M|  return bsize > BLOCK_4X4;
 1034|  8.42M|}
tx_search.c:av1_get_max_eob:
 1601|   106M|static inline int av1_get_max_eob(TX_SIZE tx_size) {
 1602|   106M|  if (tx_size == TX_64X64 || tx_size == TX_64X32 || tx_size == TX_32X64) {
  ------------------
  |  Branch (1602:7): [True: 18.4E, False: 106M]
  |  Branch (1602:30): [True: 10.2k, False: 106M]
  |  Branch (1602:53): [True: 18.4E, False: 106M]
  ------------------
 1603|  29.7k|    return 1024;
 1604|  29.7k|  }
 1605|   106M|  if (tx_size == TX_16X64 || tx_size == TX_64X16) {
  ------------------
  |  Branch (1605:7): [True: 8.14k, False: 106M]
  |  Branch (1605:30): [True: 18.4E, False: 106M]
  ------------------
 1606|      0|    return 512;
 1607|      0|  }
 1608|   106M|  return tx_size_2d[tx_size];
 1609|   106M|}
tx_search.c:is_cur_buf_hbd:
  937|   405M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|   405M|#if CONFIG_AV1_HIGHBITDEPTH
  939|   405M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|   405M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 138M, False: 267M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|   405M|}
tx_search.c:av1_get_ext_tx_set_type:
 1103|   117M|                                                int use_reduced_set) {
 1104|   117M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|   117M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 33.4k, False: 117M]
  ------------------
 1106|   117M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 395k, False: 117M]
  ------------------
 1107|   395k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 186k, False: 209k]
  ------------------
 1108|   117M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 117M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|   117M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|   117M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|   117M|}
tx_search.c:get_plane_type:
 1597|  97.3M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|  97.3M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 38.9M, False: 58.4M]
  ------------------
 1599|  97.3M|}
tx_search.c:get_default_tx_type:
 1178|  1.43M|                                          int use_screen_content_tools) {
 1179|  1.43M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1180|       |
 1181|  1.43M|  if (is_inter_block(mbmi) || plane_type != PLANE_TYPE_Y ||
  ------------------
  |  Branch (1181:7): [True: 3.37k, False: 1.42M]
  |  Branch (1181:31): [True: 0, False: 1.42M]
  ------------------
 1182|  1.42M|      xd->lossless[mbmi->segment_id] || tx_size >= TX_32X32 ||
  ------------------
  |  Branch (1182:7): [True: 321k, False: 1.10M]
  |  Branch (1182:41): [True: 51.2k, False: 1.05M]
  ------------------
 1183|  1.05M|      use_screen_content_tools)
  ------------------
  |  Branch (1183:7): [True: 18.4E, False: 1.05M]
  ------------------
 1184|   373k|    return DEFAULT_INTER_TX_TYPE;
  ------------------
  |  |   42|   373k|#define DEFAULT_INTER_TX_TYPE DCT_DCT
  ------------------
 1185|       |
 1186|  1.05M|  return intra_mode_to_tx_type(mbmi, plane_type);
 1187|  1.43M|}
tx_search.c:intra_mode_to_tx_type:
 1008|  50.7M|                                     PLANE_TYPE plane_type) {
 1009|  50.7M|  static const TX_TYPE _intra_mode_to_tx_type[INTRA_MODES] = {
 1010|  50.7M|    DCT_DCT,    // DC_PRED
 1011|  50.7M|    ADST_DCT,   // V_PRED
 1012|  50.7M|    DCT_ADST,   // H_PRED
 1013|  50.7M|    DCT_DCT,    // D45_PRED
 1014|  50.7M|    ADST_ADST,  // D135_PRED
 1015|  50.7M|    ADST_DCT,   // D113_PRED
 1016|  50.7M|    DCT_ADST,   // D157_PRED
 1017|  50.7M|    DCT_ADST,   // D203_PRED
 1018|  50.7M|    ADST_DCT,   // D67_PRED
 1019|  50.7M|    ADST_ADST,  // SMOOTH_PRED
 1020|  50.7M|    ADST_DCT,   // SMOOTH_V_PRED
 1021|  50.7M|    DCT_ADST,   // SMOOTH_H_PRED
 1022|  50.7M|    ADST_ADST,  // PAETH_PRED
 1023|  50.7M|  };
 1024|  50.7M|  const PREDICTION_MODE mode =
 1025|  50.7M|      (plane_type == PLANE_TYPE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  Branch (1025:7): [True: 1.05M, False: 49.7M]
  ------------------
 1026|       |  assert(mode < INTRA_MODES);
 1027|  50.7M|  return _intra_mode_to_tx_type[mode];
 1028|  50.7M|}
tx_search.c:get_uv_mode:
  349|  49.7M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  49.7M|  static const PREDICTION_MODE uv2y[] = {
  352|  49.7M|    DC_PRED,        // UV_DC_PRED
  353|  49.7M|    V_PRED,         // UV_V_PRED
  354|  49.7M|    H_PRED,         // UV_H_PRED
  355|  49.7M|    D45_PRED,       // UV_D45_PRED
  356|  49.7M|    D135_PRED,      // UV_D135_PRED
  357|  49.7M|    D113_PRED,      // UV_D113_PRED
  358|  49.7M|    D157_PRED,      // UV_D157_PRED
  359|  49.7M|    D203_PRED,      // UV_D203_PRED
  360|  49.7M|    D67_PRED,       // UV_D67_PRED
  361|  49.7M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  49.7M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  49.7M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  49.7M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  49.7M|    DC_PRED,        // UV_CFL_PRED
  366|  49.7M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  49.7M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  49.7M|  };
  369|  49.7M|  return uv2y[mode];
  370|  49.7M|}
tx_search.c:av1_get_tx_type:
 1286|  96.1M|                                      int reduced_tx_set) {
 1287|  96.1M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1288|  96.1M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32) {
  ------------------
  |  Branch (1288:7): [True: 3.02M, False: 93.1M]
  |  Branch (1288:41): [True: 29.3k, False: 93.0M]
  ------------------
 1289|  3.07M|    return DCT_DCT;
 1290|  3.07M|  }
 1291|       |
 1292|  93.0M|  TX_TYPE tx_type;
 1293|  93.0M|  if (plane_type == PLANE_TYPE_Y) {
  ------------------
  |  Branch (1293:7): [True: 36.5M, False: 56.4M]
  ------------------
 1294|  36.5M|    tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1295|  56.4M|  } else {
 1296|  56.4M|    if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1296:9): [True: 7.20M, False: 49.2M]
  ------------------
 1297|       |      // scale back to y plane's coordinate
 1298|  7.20M|      const struct macroblockd_plane *const pd = &xd->plane[plane_type];
 1299|  7.20M|      blk_row <<= pd->subsampling_y;
 1300|  7.20M|      blk_col <<= pd->subsampling_x;
 1301|  7.20M|      tx_type = xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 1302|  49.2M|    } else {
 1303|       |      // In intra mode, uv planes don't share the same prediction mode as y
 1304|       |      // plane, so the tx_type should not be shared
 1305|  49.2M|      tx_type = intra_mode_to_tx_type(mbmi, PLANE_TYPE_UV);
 1306|  49.2M|    }
 1307|  56.4M|    const TxSetType tx_set_type =
 1308|  56.4M|        av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi), reduced_tx_set);
 1309|  56.4M|    if (!av1_ext_tx_used[tx_set_type][tx_type]) tx_type = DCT_DCT;
  ------------------
  |  Branch (1309:9): [True: 992, False: 56.4M]
  ------------------
 1310|  56.4M|  }
 1311|  93.0M|  assert(tx_type < TX_TYPES);
 1312|       |  assert(av1_ext_tx_used[av1_get_ext_tx_set_type(tx_size, is_inter_block(mbmi),
 1313|  93.0M|                                                 reduced_tx_set)][tx_type]);
 1314|  93.0M|  return tx_type;
 1315|  96.1M|}
tx_search.c:av1_get_txb_size_index:
 1212|  2.60M|                                         int blk_col) {
 1213|  2.60M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  2.60M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  2.60M|  };
 1216|  2.60M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  2.60M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  2.60M|  };
 1219|  2.60M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  2.60M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  2.60M|  };
 1222|  2.60M|  const int index =
 1223|  2.60M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  2.60M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  2.60M|  return index;
 1227|  2.60M|}
tx_search.c:update_txk_array:
 1262|  33.5M|                                    TX_TYPE tx_type) {
 1263|  33.5M|  const int stride = xd->tx_type_map_stride;
 1264|  33.5M|  xd->tx_type_map[blk_row * stride + blk_col] = tx_type;
 1265|       |
 1266|  33.5M|  const int txw = tx_size_wide_unit[tx_size];
 1267|  33.5M|  const int txh = tx_size_high_unit[tx_size];
 1268|       |  // The 16x16 unit is due to the constraint from tx_64x64 which sets the
 1269|       |  // maximum tx size for chroma as 32x32. Coupled with 4x1 transform block
 1270|       |  // size, the constraint takes effect in 32x16 / 16x32 size too. To solve
 1271|       |  // the intricacy, cover all the 16x16 units inside a 64 level transform.
 1272|  33.5M|  if (txw == tx_size_wide_unit[TX_64X64] ||
  ------------------
  |  Branch (1272:7): [True: 30.8k, False: 33.5M]
  ------------------
 1273|  33.5M|      txh == tx_size_high_unit[TX_64X64]) {
  ------------------
  |  Branch (1273:7): [True: 1.32k, False: 33.5M]
  ------------------
 1274|  35.2k|    const int tx_unit = tx_size_wide_unit[TX_16X16];
 1275|   168k|    for (int idy = 0; idy < txh; idy += tx_unit) {
  ------------------
  |  Branch (1275:23): [True: 133k, False: 35.2k]
  ------------------
 1276|   634k|      for (int idx = 0; idx < txw; idx += tx_unit) {
  ------------------
  |  Branch (1276:25): [True: 501k, False: 133k]
  ------------------
 1277|   501k|        xd->tx_type_map[(blk_row + idy) * stride + blk_col + idx] = tx_type;
 1278|   501k|      }
 1279|   133k|    }
 1280|  35.2k|  }
 1281|  33.5M|}
tx_search.c:av1_get_adjusted_tx_size:
 1366|  10.9M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  10.9M|  switch (tx_size) {
 1368|  2.55k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 2.55k, False: 10.8M]
  ------------------
 1369|  3.38k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 830, False: 10.9M]
  ------------------
 1370|  6.75k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 3.36k, False: 10.8M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 10.9M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 10.9M]
  ------------------
 1373|  10.8M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 10.8M, False: 6.62k]
  ------------------
 1374|  10.9M|  }
 1375|  10.9M|}
tx_search.c:tx_size_from_tx_mode:
 1139|  21.7M|static inline TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode) {
 1140|  21.7M|  const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
 1141|  21.7M|  const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
 1142|  21.7M|  if (bsize == BLOCK_4X4)
  ------------------
  |  Branch (1142:7): [True: 3.18M, False: 18.5M]
  ------------------
 1143|  3.18M|    return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.18M, False: 18.4E]
  |  |  ------------------
  ------------------
 1144|  18.5M|  if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
  ------------------
  |  Branch (1144:7): [True: 18.5M, False: 18.4E]
  ------------------
 1145|  18.5M|    return max_rect_tx_size;
 1146|  18.4E|  else
 1147|  18.4E|    return largest_tx_size;
 1148|  18.5M|}
tx_search.c:bsize_to_tx_size_cat:
 1349|  4.10M|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|  4.10M|  assert(bsize < BLOCK_SIZES_ALL);
 1351|  4.10M|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|  4.10M|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|  4.10M|  };
 1354|  4.10M|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|  4.10M|  return depth - 1;
 1357|  4.10M|}
tx_search.c:get_plane_block_size:
 1193|  21.9M|                                              int subsampling_y) {
 1194|  21.9M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  21.9M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  21.9M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  21.9M|}
tx_search.c:av1_get_tx_size:
 1386|  17.6M|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|  17.6M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|  17.6M|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 1.97M, False: 15.6M]
  ------------------
 1389|  15.6M|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 4.73M, False: 10.8M]
  ------------------
 1390|  10.8M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|  10.8M|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|  10.8M|                               pd->subsampling_y);
 1393|  15.6M|}
tx_search.c:av1_get_max_uv_txsize:
 1378|  10.9M|                                            int subsampling_y) {
 1379|  10.9M|  const BLOCK_SIZE plane_bsize =
 1380|  10.9M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  10.9M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  10.9M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  10.9M|}
txb_rdopt.c:get_plane_type:
 1597|   127M|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|   127M|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 93.1M, False: 34.2M]
  ------------------
 1599|   127M|}
txb_rdopt.c:av1_get_adjusted_tx_size:
 1366|   372M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   372M|  switch (tx_size) {
 1368|  79.8k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 79.8k, False: 372M]
  ------------------
 1369|  91.9k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 12.1k, False: 372M]
  ------------------
 1370|   103k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 11.3k, False: 372M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 372M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 372M]
  ------------------
 1373|   372M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 372M, False: 18.4E]
  ------------------
 1374|   372M|  }
 1375|   372M|}
txb_rdopt.c:is_inter_block:
  372|   145M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|   145M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 126k, False: 145M]
  |  Branch (373:36): [True: 8.19M, False: 137M]
  ------------------
  374|   145M|}
txb_rdopt.c:is_intrabc_block:
  345|   145M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|   145M|  return mbmi->use_intrabc;
  347|   145M|}
txb_rdopt.c:av1_get_ext_tx_set_type:
 1103|  92.4M|                                                int use_reduced_set) {
 1104|  92.4M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  92.4M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 34.4k, False: 92.4M]
  ------------------
 1106|  92.4M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 250k, False: 92.1M]
  ------------------
 1107|   250k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 74.3k, False: 176k]
  ------------------
 1108|  92.1M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 92.1M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  92.1M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  92.1M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  92.1M|}
intra_mode_search.c:get_plane_block_size:
 1193|  5.48M|                                              int subsampling_y) {
 1194|  5.48M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  5.48M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  5.48M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  5.48M|}
intra_mode_search.c:get_uv_mode:
  349|  16.9M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  16.9M|  static const PREDICTION_MODE uv2y[] = {
  352|  16.9M|    DC_PRED,        // UV_DC_PRED
  353|  16.9M|    V_PRED,         // UV_V_PRED
  354|  16.9M|    H_PRED,         // UV_H_PRED
  355|  16.9M|    D45_PRED,       // UV_D45_PRED
  356|  16.9M|    D135_PRED,      // UV_D135_PRED
  357|  16.9M|    D113_PRED,      // UV_D113_PRED
  358|  16.9M|    D157_PRED,      // UV_D157_PRED
  359|  16.9M|    D203_PRED,      // UV_D203_PRED
  360|  16.9M|    D67_PRED,       // UV_D67_PRED
  361|  16.9M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  16.9M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  16.9M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  16.9M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  16.9M|    DC_PRED,        // UV_CFL_PRED
  366|  16.9M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  16.9M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  16.9M|  };
  369|  16.9M|  return uv2y[mode];
  370|  16.9M|}
intra_mode_search.c:av1_get_tx_size:
 1386|  1.78M|static inline TX_SIZE av1_get_tx_size(int plane, const MACROBLOCKD *xd) {
 1387|  1.78M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1388|  1.78M|  if (xd->lossless[mbmi->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1388:7): [True: 16.4k, False: 1.77M]
  ------------------
 1389|  1.77M|  if (plane == 0) return mbmi->tx_size;
  ------------------
  |  Branch (1389:7): [True: 0, False: 1.77M]
  ------------------
 1390|  1.77M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
 1391|  1.77M|  return av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
 1392|  1.77M|                               pd->subsampling_y);
 1393|  1.77M|}
intra_mode_search.c:av1_get_max_uv_txsize:
 1378|  1.77M|                                            int subsampling_y) {
 1379|  1.77M|  const BLOCK_SIZE plane_bsize =
 1380|  1.77M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  1.77M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  1.77M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  1.77M|}
intra_mode_search.c:av1_get_adjusted_tx_size:
 1366|  1.77M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  1.77M|  switch (tx_size) {
 1368|      0|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 0, False: 1.77M]
  ------------------
 1369|      0|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 0, False: 1.77M]
  ------------------
 1370|      0|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 0, False: 1.77M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 1.77M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 1.77M]
  ------------------
 1373|  1.77M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 1.77M, False: 32]
  ------------------
 1374|  1.77M|  }
 1375|  1.77M|}
intra_mode_search.c:is_cur_buf_hbd:
  937|  29.9M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  29.9M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  29.9M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  29.9M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 10.2M, False: 19.7M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  29.9M|}
intra_mode_search.c:av1_allow_palette:
 1504|  22.1M|                                    BLOCK_SIZE sb_type) {
 1505|  22.1M|  assert(sb_type < BLOCK_SIZES_ALL);
 1506|  22.1M|  return allow_screen_content_tools &&
  ------------------
  |  Branch (1506:10): [True: 6.38M, False: 15.7M]
  ------------------
 1507|  6.38M|         block_size_wide[sb_type] <= MAX_PALETTE_BLOCK_WIDTH &&
  ------------------
  |  |   44|  28.4M|#define MAX_PALETTE_BLOCK_WIDTH 64
  ------------------
  |  Branch (1507:10): [True: 6.38M, False: 18.4E]
  ------------------
 1508|  6.38M|         block_size_high[sb_type] <= MAX_PALETTE_BLOCK_HEIGHT &&
  ------------------
  |  |   46|  28.4M|#define MAX_PALETTE_BLOCK_HEIGHT 64
  ------------------
  |  Branch (1508:10): [True: 6.38M, False: 18.4E]
  ------------------
 1509|  6.38M|         sb_type >= BLOCK_8X8;
  ------------------
  |  Branch (1509:10): [True: 1.40M, False: 4.98M]
  ------------------
 1510|  22.1M|}
intra_mode_search.c:get_bit_depth_info:
  967|  27.8M|static inline BitDepthInfo get_bit_depth_info(const MACROBLOCKD *xd) {
  968|  27.8M|  BitDepthInfo bit_depth_info;
  969|  27.8M|  bit_depth_info.bit_depth = xd->bd;
  970|  27.8M|  bit_depth_info.use_highbitdepth_buf = is_cur_buf_hbd(xd);
  971|       |  assert(IMPLIES(!bit_depth_info.use_highbitdepth_buf,
  972|  27.8M|                 bit_depth_info.bit_depth == 8));
  973|  27.8M|  return bit_depth_info;
  974|  27.8M|}
intra_mode_search.c:block_signals_txsize:
 1032|  1.88M|static inline int block_signals_txsize(BLOCK_SIZE bsize) {
 1033|  1.88M|  return bsize > BLOCK_4X4;
 1034|  1.88M|}
intra_mode_search.c:bsize_to_tx_size_cat:
 1349|   336k|static inline int bsize_to_tx_size_cat(BLOCK_SIZE bsize) {
 1350|   336k|  assert(bsize < BLOCK_SIZES_ALL);
 1351|   336k|  static const uint8_t bsize_to_tx_size_depth_table[BLOCK_SIZES_ALL] = {
 1352|   336k|    0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 4, 4,
 1353|   336k|  };
 1354|   336k|  const int depth = bsize_to_tx_size_depth_table[bsize];
 1355|       |  assert(depth <= MAX_TX_CATS);
 1356|   336k|  return depth - 1;
 1357|   336k|}
intra_mode_search.c:is_inter_block:
  372|   816k|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|   816k|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 816k]
  |  Branch (373:36): [True: 18.4E, False: 816k]
  ------------------
  374|   816k|}
intra_mode_search.c:is_intrabc_block:
  345|   816k|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|   816k|  return mbmi->use_intrabc;
  347|   816k|}
intra_mode_search.c:av1_get_block_dimensions:
 1521|  4.47k|                                            int *cols_within_bounds) {
 1522|  4.47k|  const int block_height = block_size_high[bsize];
 1523|  4.47k|  const int block_width = block_size_wide[bsize];
 1524|  4.47k|  const int block_rows = (xd->mb_to_bottom_edge >= 0)
  ------------------
  |  Branch (1524:26): [True: 4.26k, False: 213]
  ------------------
 1525|  4.47k|                             ? block_height
 1526|  4.47k|                             : (xd->mb_to_bottom_edge >> 3) + block_height;
 1527|  4.47k|  const int block_cols = (xd->mb_to_right_edge >= 0)
  ------------------
  |  Branch (1527:26): [True: 4.30k, False: 170]
  ------------------
 1528|  4.47k|                             ? block_width
 1529|  4.47k|                             : (xd->mb_to_right_edge >> 3) + block_width;
 1530|  4.47k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1531|  4.47k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_x == 0));
 1532|  4.47k|  assert(IMPLIES(plane == PLANE_TYPE_Y, pd->subsampling_y == 0));
 1533|  4.47k|  assert(block_width >= block_cols);
 1534|  4.47k|  assert(block_height >= block_rows);
 1535|  4.47k|  const int plane_block_width = block_width >> pd->subsampling_x;
 1536|  4.47k|  const int plane_block_height = block_height >> pd->subsampling_y;
 1537|       |  // Special handling for chroma sub8x8.
 1538|  4.47k|  const int is_chroma_sub8_x = plane > 0 && plane_block_width < 4;
  ------------------
  |  Branch (1538:32): [True: 0, False: 4.47k]
  |  Branch (1538:45): [True: 0, False: 0]
  ------------------
 1539|  4.47k|  const int is_chroma_sub8_y = plane > 0 && plane_block_height < 4;
  ------------------
  |  Branch (1539:32): [True: 0, False: 4.47k]
  |  Branch (1539:45): [True: 0, False: 0]
  ------------------
 1540|  4.47k|  if (width) {
  ------------------
  |  Branch (1540:7): [True: 4.47k, False: 0]
  ------------------
 1541|  4.47k|    *width = plane_block_width + 2 * is_chroma_sub8_x;
 1542|  4.47k|    assert(*width >= 0);
 1543|  4.47k|  }
 1544|  4.47k|  if (height) {
  ------------------
  |  Branch (1544:7): [True: 4.47k, False: 0]
  ------------------
 1545|  4.47k|    *height = plane_block_height + 2 * is_chroma_sub8_y;
 1546|  4.47k|    assert(*height >= 0);
 1547|  4.47k|  }
 1548|  4.47k|  if (rows_within_bounds) {
  ------------------
  |  Branch (1548:7): [True: 4.47k, False: 0]
  ------------------
 1549|  4.47k|    *rows_within_bounds =
 1550|  4.47k|        (block_rows >> pd->subsampling_y) + 2 * is_chroma_sub8_y;
 1551|  4.47k|    assert(*rows_within_bounds >= 0);
 1552|  4.47k|  }
 1553|  4.47k|  if (cols_within_bounds) {
  ------------------
  |  Branch (1553:7): [True: 4.47k, False: 0]
  ------------------
 1554|  4.47k|    *cols_within_bounds =
 1555|  4.47k|        (block_cols >> pd->subsampling_x) + 2 * is_chroma_sub8_x;
 1556|       |    assert(*cols_within_bounds >= 0);
 1557|  4.47k|  }
 1558|  4.47k|}
var_based_part.c:get_plane_block_size:
 1193|  60.9k|                                              int subsampling_y) {
 1194|  60.9k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  60.9k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  60.9k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  60.9k|}
var_based_part.c:is_cur_buf_hbd:
  937|   646k|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|   646k|#if CONFIG_AV1_HIGHBITDEPTH
  939|   646k|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|   646k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 89.3k, False: 557k]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|   646k|}
var_based_part.c:get_partition_subsize:
  996|  32.5k|                                               PARTITION_TYPE partition) {
  997|  32.5k|  if (partition == PARTITION_INVALID) {
  ------------------
  |  Branch (997:7): [True: 0, False: 32.5k]
  ------------------
  998|      0|    return BLOCK_INVALID;
  999|  32.5k|  } else {
 1000|  32.5k|    const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 1001|  32.5k|    return sqr_bsize_idx >= SQR_BLOCK_SIZES
  ------------------
  |  |  129|  32.5k|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (1001:12): [True: 0, False: 32.5k]
  ------------------
 1002|  32.5k|               ? BLOCK_INVALID
 1003|  32.5k|               : subsize_lookup[partition][sqr_bsize_idx];
 1004|  32.5k|  }
 1005|  32.5k|}
var_based_part.c:get_sqr_bsize_idx:
  976|  32.5k|static inline int get_sqr_bsize_idx(BLOCK_SIZE bsize) {
  977|  32.5k|  switch (bsize) {
  978|      0|    case BLOCK_4X4: return 0;
  ------------------
  |  Branch (978:5): [True: 0, False: 32.5k]
  ------------------
  979|      0|    case BLOCK_8X8: return 1;
  ------------------
  |  Branch (979:5): [True: 0, False: 32.5k]
  ------------------
  980|  29.7k|    case BLOCK_16X16: return 2;
  ------------------
  |  Branch (980:5): [True: 29.7k, False: 2.83k]
  ------------------
  981|  2.82k|    case BLOCK_32X32: return 3;
  ------------------
  |  Branch (981:5): [True: 2.82k, False: 29.7k]
  ------------------
  982|      4|    case BLOCK_64X64: return 4;
  ------------------
  |  Branch (982:5): [True: 4, False: 32.5k]
  ------------------
  983|      0|    case BLOCK_128X128: return 5;
  ------------------
  |  Branch (983:5): [True: 0, False: 32.5k]
  ------------------
  984|      0|    default: return SQR_BLOCK_SIZES;
  ------------------
  |  |  129|      0|#define SQR_BLOCK_SIZES 6
  ------------------
  |  Branch (984:5): [True: 0, False: 32.5k]
  ------------------
  985|  32.5k|  }
  986|  32.5k|}
encodetxb_sse2.c:av1_get_adjusted_tx_size:
 1366|   226M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   226M|  switch (tx_size) {
 1368|  60.6k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 60.6k, False: 226M]
  ------------------
 1369|  67.5k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 6.94k, False: 226M]
  ------------------
 1370|  74.7k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 7.15k, False: 226M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 226M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 226M]
  ------------------
 1373|   226M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 226M, False: 20.2k]
  ------------------
 1374|   226M|  }
 1375|   226M|}
av1_loopfilter.c:av1_get_max_uv_txsize:
 1378|  5.50M|                                            int subsampling_y) {
 1379|  5.50M|  const BLOCK_SIZE plane_bsize =
 1380|  5.50M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
 1381|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1382|  5.50M|  const TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
 1383|  5.50M|  return av1_get_adjusted_tx_size(uv_tx);
 1384|  5.50M|}
av1_loopfilter.c:av1_get_adjusted_tx_size:
 1366|  5.50M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|  5.50M|  switch (tx_size) {
 1368|  15.5k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 15.5k, False: 5.49M]
  ------------------
 1369|  16.3k|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 819, False: 5.50M]
  ------------------
 1370|  34.7k|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 18.3k, False: 5.49M]
  ------------------
 1371|      0|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 0, False: 5.50M]
  ------------------
 1372|      0|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 0, False: 5.50M]
  ------------------
 1373|  5.47M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 5.47M, False: 33.4k]
  ------------------
 1374|  5.50M|  }
 1375|  5.50M|}
av1_loopfilter.c:av1_get_txb_size_index:
 1212|  2.73M|                                         int blk_col) {
 1213|  2.73M|  static const uint8_t tw_w_log2_table[BLOCK_SIZES_ALL] = {
 1214|  2.73M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 1, 1, 2, 2, 3,
 1215|  2.73M|  };
 1216|  2.73M|  static const uint8_t tw_h_log2_table[BLOCK_SIZES_ALL] = {
 1217|  2.73M|    0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 0, 2, 1, 3, 2,
 1218|  2.73M|  };
 1219|  2.73M|  static const uint8_t stride_log2_table[BLOCK_SIZES_ALL] = {
 1220|  2.73M|    0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 0, 1, 0, 1, 0, 1,
 1221|  2.73M|  };
 1222|  2.73M|  const int index =
 1223|  2.73M|      ((blk_row >> tw_h_log2_table[bsize]) << stride_log2_table[bsize]) +
 1224|  2.73M|      (blk_col >> tw_w_log2_table[bsize]);
 1225|       |  assert(index < INTER_TX_SIZE_BUF_LEN);
 1226|  2.73M|  return index;
 1227|  2.73M|}
av1_loopfilter.c:is_inter_block:
  372|  9.77M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  9.77M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 6.09k, False: 9.76M]
  |  Branch (373:36): [True: 2.81M, False: 6.94M]
  ------------------
  374|  9.77M|}
av1_loopfilter.c:is_intrabc_block:
  345|  9.76M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  9.76M|  return mbmi->use_intrabc;
  347|  9.76M|}
av1_loopfilter.c:get_plane_block_size:
 1193|  6.87M|                                              int subsampling_y) {
 1194|  6.87M|  assert(bsize < BLOCK_SIZES_ALL);
 1195|  6.87M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|  6.87M|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|  6.87M|}
blockd.c:get_plane_block_size:
 1193|   281k|                                              int subsampling_y) {
 1194|   281k|  assert(bsize < BLOCK_SIZES_ALL);
 1195|   281k|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1196|       |  assert(subsampling_y >= 0 && subsampling_y < 2);
 1197|   281k|  return av1_ss_size_lookup[bsize][subsampling_x][subsampling_y];
 1198|   281k|}
blockd.c:get_plane_type:
 1597|   179k|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|   179k|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 101k, False: 77.6k]
  ------------------
 1599|   179k|}
cdef.c:get_plane_type:
 1597|   324k|static inline PLANE_TYPE get_plane_type(int plane) {
 1598|   324k|  return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
  ------------------
  |  Branch (1598:10): [True: 131k, False: 192k]
  ------------------
 1599|   324k|}
cfl.c:is_cur_buf_hbd:
  937|  45.5M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  45.5M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  45.5M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  45.5M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 14.3M, False: 31.1M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  45.5M|}
idct.c:is_cur_buf_hbd:
  937|  83.6M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  83.6M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  83.6M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  83.6M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 24.4M, False: 59.1M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  83.6M|}
idct.c:av1_get_ext_tx_set_type:
 1103|  83.6M|                                                int use_reduced_set) {
 1104|  83.6M|  const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
 1105|  83.6M|  if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1105:7): [True: 17.0k, False: 83.6M]
  ------------------
 1106|  83.6M|  if (tx_size_sqr_up == TX_32X32)
  ------------------
  |  Branch (1106:7): [True: 253k, False: 83.3M]
  ------------------
 1107|   253k|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DCTONLY;
  ------------------
  |  Branch (1107:12): [True: 93.5k, False: 160k]
  ------------------
 1108|  83.3M|  if (use_reduced_set)
  ------------------
  |  Branch (1108:7): [True: 0, False: 83.3M]
  ------------------
 1109|      0|    return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
  ------------------
  |  Branch (1109:12): [True: 0, False: 0]
  ------------------
 1110|  83.3M|  const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
 1111|  83.3M|  return av1_ext_tx_set_lookup[is_inter][tx_size_sqr == TX_16X16];
 1112|  83.3M|}
idct.c:is_inter_block:
  372|  83.6M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  83.6M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 83.6M]
  |  Branch (373:36): [True: 9.45M, False: 74.1M]
  ------------------
  374|  83.6M|}
idct.c:is_intrabc_block:
  345|  83.6M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  83.6M|  return mbmi->use_intrabc;
  347|  83.6M|}
mvref_common.c:is_inter_block:
  372|  13.0M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  13.0M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 980, False: 13.0M]
  |  Branch (373:36): [True: 3.59M, False: 9.42M]
  ------------------
  374|  13.0M|}
mvref_common.c:is_intrabc_block:
  345|  13.0M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  13.0M|  return mbmi->use_intrabc;
  347|  13.0M|}
mvref_common.c:is_global_mv_block:
  422|  3.60M|                                     TransformationType type) {
  423|  3.60M|  const PREDICTION_MODE mode = mbmi->mode;
  424|  3.60M|  const BLOCK_SIZE bsize = mbmi->bsize;
  425|  3.60M|  const int block_size_allowed =
  426|  3.60M|      AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  3.60M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 42.0k, False: 3.55M]
  |  |  ------------------
  ------------------
  427|  3.60M|  return (mode == GLOBALMV || mode == GLOBAL_GLOBALMV) && type > TRANSLATION &&
  ------------------
  |  Branch (427:11): [True: 85.3k, False: 3.51M]
  |  Branch (427:31): [True: 18.4E, False: 3.51M]
  |  Branch (427:59): [True: 0, False: 85.9k]
  ------------------
  428|      0|         block_size_allowed;
  ------------------
  |  Branch (428:10): [True: 0, False: 0]
  ------------------
  429|  3.60M|}
mvref_common.c:have_newmv_in_inter_mode:
  156|  3.59M|static inline int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
  157|  3.59M|  return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV ||
  ------------------
  |  Branch (157:11): [True: 1.90M, False: 1.69M]
  |  Branch (157:28): [True: 18.4E, False: 1.69M]
  |  Branch (157:49): [True: 18.4E, False: 1.69M]
  ------------------
  158|  1.69M|          mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV);
  ------------------
  |  Branch (158:11): [True: 18.4E, False: 1.69M]
  |  Branch (158:36): [True: 250, False: 1.69M]
  |  Branch (158:58): [True: 18.4E, False: 1.69M]
  ------------------
  159|  3.59M|}
pred_common.c:is_inter_block:
  372|  14.8M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  14.8M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 14.8M]
  |  Branch (373:36): [True: 3.83M, False: 11.0M]
  ------------------
  374|  14.8M|}
pred_common.c:is_intrabc_block:
  345|  14.8M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  14.8M|  return mbmi->use_intrabc;
  347|  14.8M|}
pred_common.c:has_second_ref:
  376|  4.72M|static inline int has_second_ref(const MB_MODE_INFO *mbmi) {
  377|  4.72M|  return mbmi->ref_frame[1] > INTRA_FRAME;
  378|  4.72M|}
quant_common.c:av1_get_adjusted_tx_size:
 1366|   333M|static inline TX_SIZE av1_get_adjusted_tx_size(TX_SIZE tx_size) {
 1367|   333M|  switch (tx_size) {
 1368|   899k|    case TX_64X64:
  ------------------
  |  Branch (1368:5): [True: 899k, False: 332M]
  ------------------
 1369|  1.76M|    case TX_64X32:
  ------------------
  |  Branch (1369:5): [True: 864k, False: 332M]
  ------------------
 1370|  2.62M|    case TX_32X64: return TX_32X32;
  ------------------
  |  Branch (1370:5): [True: 863k, False: 332M]
  ------------------
 1371|   855k|    case TX_64X16: return TX_32X16;
  ------------------
  |  Branch (1371:5): [True: 855k, False: 332M]
  ------------------
 1372|   855k|    case TX_16X64: return TX_16X32;
  ------------------
  |  Branch (1372:5): [True: 855k, False: 332M]
  ------------------
 1373|   328M|    default: return tx_size;
  ------------------
  |  Branch (1373:5): [True: 328M, False: 4.37M]
  ------------------
 1374|   333M|  }
 1375|   333M|}
reconinter.c:is_motion_variation_allowed_bsize:
 1460|  2.70M|static inline int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
 1461|  2.70M|  assert(bsize < BLOCK_SIZES_ALL);
 1462|  2.70M|  return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
  ------------------
  |  |   34|  2.70M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 85.5k, False: 2.62M]
  |  |  ------------------
  ------------------
 1463|  2.70M|}
reconinter.c:is_neighbor_overlappable:
 1499|  3.26M|static inline int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) {
 1500|  3.26M|  return (is_inter_block(mbmi));
 1501|  3.26M|}
reconinter.c:is_inter_block:
  372|  3.26M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  3.26M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 3.26M]
  |  Branch (373:36): [True: 868k, False: 2.39M]
  ------------------
  374|  3.26M|}
reconinter.c:is_intrabc_block:
  345|  3.26M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  3.26M|  return mbmi->use_intrabc;
  347|  3.26M|}
reconintra.c:is_cur_buf_hbd:
  937|  87.7M|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  87.7M|#if CONFIG_AV1_HIGHBITDEPTH
  939|  87.7M|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  87.7M|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 27.9M, False: 59.7M]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  87.7M|}
reconintra.c:is_inter_block:
  372|  10.3M|static inline int is_inter_block(const MB_MODE_INFO *mbmi) {
  373|  10.3M|  return is_intrabc_block(mbmi) || mbmi->ref_frame[0] > INTRA_FRAME;
  ------------------
  |  Branch (373:10): [True: 18.4E, False: 10.3M]
  |  Branch (373:36): [True: 592k, False: 9.75M]
  ------------------
  374|  10.3M|}
reconintra.c:is_intrabc_block:
  345|  10.3M|static inline int is_intrabc_block(const MB_MODE_INFO *mbmi) {
  346|  10.3M|  return mbmi->use_intrabc;
  347|  10.3M|}
reconintra.c:get_uv_mode:
  349|  44.3M|static inline PREDICTION_MODE get_uv_mode(UV_PREDICTION_MODE mode) {
  350|       |  assert(mode < UV_INTRA_MODES);
  351|  44.3M|  static const PREDICTION_MODE uv2y[] = {
  352|  44.3M|    DC_PRED,        // UV_DC_PRED
  353|  44.3M|    V_PRED,         // UV_V_PRED
  354|  44.3M|    H_PRED,         // UV_H_PRED
  355|  44.3M|    D45_PRED,       // UV_D45_PRED
  356|  44.3M|    D135_PRED,      // UV_D135_PRED
  357|  44.3M|    D113_PRED,      // UV_D113_PRED
  358|  44.3M|    D157_PRED,      // UV_D157_PRED
  359|  44.3M|    D203_PRED,      // UV_D203_PRED
  360|  44.3M|    D67_PRED,       // UV_D67_PRED
  361|  44.3M|    SMOOTH_PRED,    // UV_SMOOTH_PRED
  362|  44.3M|    SMOOTH_V_PRED,  // UV_SMOOTH_V_PRED
  363|  44.3M|    SMOOTH_H_PRED,  // UV_SMOOTH_H_PRED
  364|  44.3M|    PAETH_PRED,     // UV_PAETH_PRED
  365|  44.3M|    DC_PRED,        // UV_CFL_PRED
  366|  44.3M|    INTRA_INVALID,  // UV_INTRA_MODES
  367|  44.3M|    INTRA_INVALID,  // UV_MODE_INVALID
  368|  44.3M|  };
  369|  44.3M|  return uv2y[mode];
  370|  44.3M|}
aq_variance.c:is_cur_buf_hbd:
  937|  93.9k|static inline int is_cur_buf_hbd(const MACROBLOCKD *xd) {
  938|  93.9k|#if CONFIG_AV1_HIGHBITDEPTH
  939|  93.9k|  return xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? 1 : 0;
  ------------------
  |  |  142|  93.9k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (939:10): [True: 22.3k, False: 71.5k]
  ------------------
  940|       |#else
  941|       |  (void)xd;
  942|       |  return 0;
  943|       |#endif
  944|  93.9k|}

av1_cdef_compute_sb_list:
   43|   208k|                             BLOCK_SIZE bs) {
   44|   208k|  MB_MODE_INFO **grid = mi_params->mi_grid_base;
   45|   208k|  int maxc = mi_params->mi_cols - mi_col;
   46|   208k|  int maxr = mi_params->mi_rows - mi_row;
   47|       |
   48|   208k|  if (bs == BLOCK_128X128 || bs == BLOCK_128X64)
  ------------------
  |  Branch (48:7): [True: 18.4E, False: 208k]
  |  Branch (48:30): [True: 18.4E, False: 208k]
  ------------------
   49|      0|    maxc = AOMMIN(maxc, MI_SIZE_128X128);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   50|   208k|  else
   51|   208k|    maxc = AOMMIN(maxc, MI_SIZE_64X64);
  ------------------
  |  |   34|   208k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 139k, False: 68.8k]
  |  |  ------------------
  ------------------
   52|   208k|  if (bs == BLOCK_128X128 || bs == BLOCK_64X128)
  ------------------
  |  Branch (52:7): [True: 18.4E, False: 208k]
  |  Branch (52:30): [True: 15, False: 208k]
  ------------------
   53|      0|    maxr = AOMMIN(maxr, MI_SIZE_128X128);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   54|   208k|  else
   55|   208k|    maxr = AOMMIN(maxr, MI_SIZE_64X64);
  ------------------
  |  |   34|   208k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 138k, False: 69.5k]
  |  |  ------------------
  ------------------
   56|       |
   57|   208k|  const int r_step = 2;  // mi_size_high[BLOCK_8X8]
   58|   208k|  const int c_step = 2;  // mi_size_wide[BLOCK_8X8]
   59|   208k|  const int r_shift = 1;
   60|   208k|  const int c_shift = 1;
   61|   208k|  int count = 0;
   62|  1.09M|  for (int r = 0; r < maxr; r += r_step) {
  ------------------
  |  Branch (62:19): [True: 890k, False: 208k]
  ------------------
   63|  5.12M|    for (int c = 0; c < maxc; c += c_step) {
  ------------------
  |  Branch (63:21): [True: 4.23M, False: 890k]
  ------------------
   64|  4.23M|      if (!is_8x8_block_skip(grid, mi_row + r, mi_col + c,
  ------------------
  |  Branch (64:11): [True: 4.11M, False: 116k]
  ------------------
   65|  4.23M|                             mi_params->mi_stride)) {
   66|  4.11M|        dlist[count].by = r >> r_shift;
   67|  4.11M|        dlist[count].bx = c >> c_shift;
   68|  4.11M|        count++;
   69|  4.11M|      }
   70|  4.23M|    }
   71|   890k|  }
   72|   208k|  return count;
   73|   208k|}
av1_cdef_copy_sb8_16_lowbd:
  100|   341k|                                int hsize) {
  101|   341k|  const uint8_t *base = &src[src_voffset * (ptrdiff_t)sstride + src_hoffset];
  102|   341k|  cdef_copy_rect8_8bit_to_16bit(dst, dstride, base, sstride, hsize, vsize);
  103|   341k|}
av1_cdef_copy_sb8_16_highbd:
  109|   115k|                                 int hsize) {
  110|   115k|  const uint16_t *base =
  111|   115k|      &CONVERT_TO_SHORTPTR(src)[src_voffset * (ptrdiff_t)sstride + src_hoffset];
  ------------------
  |  |   79|   115k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  112|   115k|  cdef_copy_rect8_16bit_to_16bit(dst, dstride, base, sstride, hsize, vsize);
  113|   115k|}
av1_cdef_copy_sb8_16:
  118|   322k|                          int src_hoffset, int sstride, int vsize, int hsize) {
  119|   322k|#if CONFIG_AV1_HIGHBITDEPTH
  120|   322k|  if (cm->seq_params->use_highbitdepth) {
  ------------------
  |  Branch (120:7): [True: 76.7k, False: 245k]
  ------------------
  121|  76.7k|    av1_cdef_copy_sb8_16_highbd(dst, dstride, src, src_voffset, src_hoffset,
  122|  76.7k|                                sstride, vsize, hsize);
  123|  76.7k|    return;
  124|  76.7k|  }
  125|       |#else
  126|       |  (void)cm;
  127|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
  128|   245k|  av1_cdef_copy_sb8_16_lowbd(dst, dstride, src, src_voffset, src_hoffset,
  129|   245k|                             sstride, vsize, hsize);
  130|   245k|}
av1_cdef_init_fb_row:
  373|  62.3k|                          struct AV1CdefSyncData *const cdef_sync, int fbr) {
  374|  62.3k|  (void)cdef_sync;
  375|  62.3k|  const int num_planes = av1_num_planes(cm);
  376|  62.3k|  const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  62.3k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  62.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  62.3k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  62.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  377|  62.3k|  const int luma_stride =
  378|  62.3k|      ALIGN_POWER_OF_TWO(cm->mi_params.mi_cols << MI_SIZE_LOG2, 4);
  ------------------
  |  |   69|  62.3k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  379|  62.3k|  const bool ping_pong = fbr & 1;
  380|       |  // for the current filter block, it's top left corner mi structure (mi_tl)
  381|       |  // is first accessed to check whether the top and left boundaries are
  382|       |  // frame boundaries. Then bottom-left and top-right mi structures are
  383|       |  // accessed to check whether the bottom and right boundaries
  384|       |  // (respectively) are frame boundaries.
  385|       |  //
  386|       |  // Note that we can't just check the bottom-right mi structure - eg. if
  387|       |  // we're at the right-hand edge of the frame but not the bottom, then
  388|       |  // the bottom-right mi is NULL but the bottom-left is not.
  389|  62.3k|  fb_info->frame_boundary[TOP] = (MI_SIZE_64X64 * fbr == 0) ? 1 : 0;
  ------------------
  |  |   58|  62.3k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  62.3k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (389:34): [True: 54.8k, False: 7.49k]
  ------------------
  390|  62.3k|  if (fbr != nvfb - 1)
  ------------------
  |  Branch (390:7): [True: 7.49k, False: 54.8k]
  ------------------
  391|  7.49k|    fb_info->frame_boundary[BOTTOM] =
  392|  7.49k|        (MI_SIZE_64X64 * (fbr + 1) == cm->mi_params.mi_rows) ? 1 : 0;
  ------------------
  |  |   58|  7.49k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  7.49k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (392:9): [True: 0, False: 7.49k]
  ------------------
  393|  54.8k|  else
  394|  54.8k|    fb_info->frame_boundary[BOTTOM] = 1;
  395|       |
  396|  62.3k|  fb_info->src = src;
  397|  62.3k|  fb_info->damping = cm->cdef_info.cdef_damping;
  398|  62.3k|  fb_info->coeff_shift = AOMMAX(cm->seq_params->bit_depth - 8, 0);
  ------------------
  |  |   35|  62.3k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 17.8k, False: 44.5k]
  |  |  ------------------
  ------------------
  399|  62.3k|  av1_zero(fb_info->dir);
  ------------------
  |  |   43|  62.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  400|  62.3k|  av1_zero(fb_info->var);
  ------------------
  |  |   43|  62.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  401|       |
  402|   171k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (402:23): [True: 108k, False: 62.3k]
  ------------------
  403|   108k|    const int mi_high_l2 = MI_SIZE_LOG2 - xd->plane[plane].subsampling_y;
  ------------------
  |  |   39|   108k|#define MI_SIZE_LOG2 2
  ------------------
  404|   108k|    const int offset = MI_SIZE_64X64 * (fbr + 1) << mi_high_l2;
  ------------------
  |  |   58|   108k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   108k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  405|   108k|    const int stride = luma_stride >> xd->plane[plane].subsampling_x;
  406|       |    // here ping-pong buffers are maintained for top linebuf
  407|       |    // to avoid linebuf over-write by consecutive row.
  408|   108k|    uint16_t *const top_linebuf =
  409|   108k|        &linebuf[plane][ping_pong * CDEF_VBORDER * stride];
  ------------------
  |  |   23|   108k|#define CDEF_VBORDER (2)
  ------------------
  410|   108k|    fb_info->bot_linebuf[plane] = &linebuf[plane][(CDEF_VBORDER << 1) * stride];
  ------------------
  |  |   23|   108k|#define CDEF_VBORDER (2)
  ------------------
  411|       |
  412|   108k|    if (fbr != nvfb - 1)  // top line buffer copy
  ------------------
  |  Branch (412:9): [True: 12.9k, False: 95.6k]
  ------------------
  413|  12.9k|      av1_cdef_copy_sb8_16(cm, top_linebuf, stride, xd->plane[plane].dst.buf,
  414|  12.9k|                           offset - CDEF_VBORDER, 0,
  ------------------
  |  |   23|  12.9k|#define CDEF_VBORDER (2)
  ------------------
  415|  12.9k|                           xd->plane[plane].dst.stride, CDEF_VBORDER, stride);
  ------------------
  |  |   23|  12.9k|#define CDEF_VBORDER (2)
  ------------------
  416|   108k|    fb_info->top_linebuf[plane] =
  417|   108k|        &linebuf[plane][(!ping_pong) * CDEF_VBORDER * stride];
  ------------------
  |  |   23|   108k|#define CDEF_VBORDER (2)
  ------------------
  418|       |
  419|   108k|    if (fbr != nvfb - 1)  // bottom line buffer copy
  ------------------
  |  Branch (419:9): [True: 12.9k, False: 95.6k]
  ------------------
  420|  12.9k|      av1_cdef_copy_sb8_16(cm, fb_info->bot_linebuf[plane], stride,
  421|  12.9k|                           xd->plane[plane].dst.buf, offset, 0,
  422|  12.9k|                           xd->plane[plane].dst.stride, CDEF_VBORDER, stride);
  ------------------
  |  |   23|  12.9k|#define CDEF_VBORDER (2)
  ------------------
  423|   108k|  }
  424|  62.3k|}
av1_cdef_fb_row:
  431|   120k|                     struct aom_internal_error_info *error_info) {
  432|       |  // TODO(aomedia:3276): Pass error_info to the low-level functions as required
  433|       |  // in future to handle error propagation.
  434|   120k|  (void)error_info;
  435|   120k|  CdefBlockInfo fb_info;
  436|   120k|  int cdef_left[MAX_MB_PLANE] = { 1, 1, 1 };
  437|   120k|  const int nhfb = (cm->mi_params.mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   120k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   120k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nhfb = (cm->mi_params.mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   120k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   120k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  438|       |
  439|   120k|  cdef_init_fb_row_fn(cm, xd, &fb_info, linebuf, src, cdef_sync, fbr);
  440|   120k|#if CONFIG_MULTITHREAD
  441|   120k|  if (cdef_sync && cm->cdef_info.allocated_num_workers > 1) {
  ------------------
  |  Branch (441:7): [True: 57.7k, False: 62.4k]
  |  Branch (441:20): [True: 57.7k, False: 0]
  ------------------
  442|  57.7k|    pthread_mutex_lock(cdef_sync->mutex_);
  443|  57.7k|    const bool cdef_mt_exit = cdef_sync->cdef_mt_exit;
  444|  57.7k|    pthread_mutex_unlock(cdef_sync->mutex_);
  445|       |    // Exit in case any worker has encountered an error.
  446|  57.7k|    if (cdef_mt_exit) return;
  ------------------
  |  Branch (446:9): [True: 0, False: 57.7k]
  ------------------
  447|  57.7k|  }
  448|   120k|#endif
  449|   292k|  for (int fbc = 0; fbc < nhfb; fbc++) {
  ------------------
  |  Branch (449:21): [True: 171k, False: 120k]
  ------------------
  450|   171k|    fb_info.frame_boundary[LEFT] = (MI_SIZE_64X64 * fbc == 0) ? 1 : 0;
  ------------------
  |  |   58|   171k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   171k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (450:36): [True: 120k, False: 51.7k]
  ------------------
  451|   171k|    if (fbc != nhfb - 1)
  ------------------
  |  Branch (451:9): [True: 51.7k, False: 120k]
  ------------------
  452|  51.7k|      fb_info.frame_boundary[RIGHT] =
  453|  51.7k|          (MI_SIZE_64X64 * (fbc + 1) == cm->mi_params.mi_cols) ? 1 : 0;
  ------------------
  |  |   58|  51.7k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  51.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (453:11): [True: 0, False: 51.7k]
  ------------------
  454|   120k|    else
  455|   120k|      fb_info.frame_boundary[RIGHT] = 1;
  456|   171k|    cdef_fb_col(cm, xd, &fb_info, colbuf, &cdef_left[0], fbc, fbr);
  457|   171k|  }
  458|   120k|}
av1_cdef_frame:
  468|  54.8k|                    MACROBLOCKD *xd, cdef_init_fb_row_t cdef_init_fb_row_fn) {
  469|  54.8k|  const int num_planes = av1_num_planes(cm);
  470|  54.8k|  const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  54.8k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  54.8k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  54.8k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  54.8k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  471|       |
  472|  54.8k|  av1_setup_dst_planes(xd->plane, cm->seq_params->sb_size, frame, 0, 0, 0,
  473|  54.8k|                       num_planes);
  474|       |
  475|   117k|  for (int fbr = 0; fbr < nvfb; fbr++)
  ------------------
  |  Branch (475:21): [True: 62.3k, False: 54.8k]
  ------------------
  476|  62.3k|    av1_cdef_fb_row(cm, xd, cm->cdef_info.linebuf, cm->cdef_info.colbuf,
  477|       |                    cm->cdef_info.srcbuf, fbr, cdef_init_fb_row_fn, NULL,
  478|  62.3k|                    xd->error_info);
  479|  54.8k|}
cdef.c:is_8x8_block_skip:
   30|  4.23M|                             int mi_stride) {
   31|  4.23M|  MB_MODE_INFO **mbmi = grid + mi_row * mi_stride + mi_col;
   32|  4.46M|  for (int r = 0; r < mi_size_high[BLOCK_8X8]; ++r, mbmi += mi_stride) {
  ------------------
  |  Branch (32:19): [True: 4.35M, False: 115k]
  ------------------
   33|  4.82M|    for (int c = 0; c < mi_size_wide[BLOCK_8X8]; ++c) {
  ------------------
  |  Branch (33:21): [True: 4.58M, False: 233k]
  ------------------
   34|  4.58M|      if (!mbmi[c]->skip_txfm) return 0;
  ------------------
  |  Branch (34:11): [True: 4.11M, False: 470k]
  ------------------
   35|  4.58M|    }
   36|  4.35M|  }
   37|       |
   38|   115k|  return 1;
   39|  4.23M|}
cdef.c:cdef_fb_col:
  302|   171k|                        int *cdef_left, int fbc, int fbr) {
  303|   171k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  304|   171k|  const int mbmi_cdef_strength =
  305|   171k|      mi_params
  306|   171k|          ->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
  ------------------
  |  |   58|   171k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   171k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  307|   171k|                         MI_SIZE_64X64 * fbc]
  ------------------
  |  |   58|   171k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   171k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  308|   171k|          ->cdef_strength;
  309|   171k|  const int num_planes = av1_num_planes(cm);
  310|   171k|  int is_zero_level[PLANE_TYPES] = { 1, 1 };
  311|   171k|  int level[PLANE_TYPES] = { 0 };
  312|   171k|  int sec_strength[PLANE_TYPES] = { 0 };
  313|   171k|  const CdefInfo *const cdef_info = &cm->cdef_info;
  314|       |
  315|   171k|  if (mi_params->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
  ------------------
  |  |   58|   171k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   171k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (315:7): [True: 30, False: 171k]
  ------------------
  316|   171k|                              MI_SIZE_64X64 * fbc] == NULL ||
  ------------------
  |  |   58|   171k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   171k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  317|   171k|      mbmi_cdef_strength == -1) {
  ------------------
  |  Branch (317:7): [True: 18.4E, False: 171k]
  ------------------
  318|      0|    av1_zero_array(cdef_left, num_planes);
  ------------------
  |  |   44|      0|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
  319|      0|    return;
  320|      0|  }
  321|       |
  322|       |  // Compute level and secondary strength for planes
  323|   171k|  level[PLANE_TYPE_Y] =
  324|   171k|      cdef_info->cdef_strengths[mbmi_cdef_strength] / CDEF_SEC_STRENGTHS;
  ------------------
  |  |   17|   171k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  325|   171k|  sec_strength[PLANE_TYPE_Y] =
  326|   171k|      cdef_info->cdef_strengths[mbmi_cdef_strength] % CDEF_SEC_STRENGTHS;
  ------------------
  |  |   17|   171k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  327|   171k|  sec_strength[PLANE_TYPE_Y] += sec_strength[PLANE_TYPE_Y] == 3;
  328|   171k|  is_zero_level[PLANE_TYPE_Y] =
  329|   171k|      (level[PLANE_TYPE_Y] == 0) && (sec_strength[PLANE_TYPE_Y] == 0);
  ------------------
  |  Branch (329:7): [True: 55.8k, False: 116k]
  |  Branch (329:37): [True: 41.8k, False: 14.0k]
  ------------------
  330|       |
  331|   171k|  if (num_planes > 1) {
  ------------------
  |  Branch (331:7): [True: 67.2k, False: 104k]
  ------------------
  332|  67.2k|    level[PLANE_TYPE_UV] =
  333|  67.2k|        cdef_info->cdef_uv_strengths[mbmi_cdef_strength] / CDEF_SEC_STRENGTHS;
  ------------------
  |  |   17|  67.2k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  334|  67.2k|    sec_strength[PLANE_TYPE_UV] =
  335|  67.2k|        cdef_info->cdef_uv_strengths[mbmi_cdef_strength] % CDEF_SEC_STRENGTHS;
  ------------------
  |  |   17|  67.2k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  336|  67.2k|    sec_strength[PLANE_TYPE_UV] += sec_strength[PLANE_TYPE_UV] == 3;
  337|  67.2k|    is_zero_level[PLANE_TYPE_UV] =
  338|  67.2k|        (level[PLANE_TYPE_UV] == 0) && (sec_strength[PLANE_TYPE_UV] == 0);
  ------------------
  |  Branch (338:9): [True: 29.2k, False: 37.9k]
  |  Branch (338:40): [True: 23.3k, False: 5.91k]
  ------------------
  339|  67.2k|  }
  340|       |
  341|   171k|  if (is_zero_level[PLANE_TYPE_Y] && is_zero_level[PLANE_TYPE_UV]) {
  ------------------
  |  Branch (341:7): [True: 41.7k, False: 130k]
  |  Branch (341:38): [True: 38.6k, False: 3.17k]
  ------------------
  342|  38.6k|    av1_zero_array(cdef_left, num_planes);
  ------------------
  |  |   44|  38.6k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
  343|  38.6k|    return;
  344|  38.6k|  }
  345|       |
  346|   133k|  fb_info->cdef_count = av1_cdef_compute_sb_list(mi_params, fbr * MI_SIZE_64X64,
  ------------------
  |  |   58|   133k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   133k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  347|   133k|                                                 fbc * MI_SIZE_64X64,
  ------------------
  |  |   58|   133k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   133k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  348|   133k|                                                 fb_info->dlist, BLOCK_64X64);
  349|   133k|  if (!fb_info->cdef_count) {
  ------------------
  |  Branch (349:7): [True: 1.32k, False: 131k]
  ------------------
  350|  1.32k|    av1_zero_array(cdef_left, num_planes);
  ------------------
  |  |   44|  1.32k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
  351|  1.32k|    return;
  352|  1.32k|  }
  353|       |
  354|   368k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (354:23): [True: 236k, False: 131k]
  ------------------
  355|       |    // Do not skip cdef filtering for luma plane as filter direction is
  356|       |    // computed based on luma.
  357|   236k|    if (plane && is_zero_level[get_plane_type(plane)]) {
  ------------------
  |  Branch (357:9): [True: 104k, False: 131k]
  |  Branch (357:18): [True: 17.7k, False: 87.2k]
  ------------------
  358|  17.7k|      cdef_left[plane] = 0;
  359|  17.7k|      continue;
  360|  17.7k|    }
  361|   219k|    cdef_init_fb_col(xd, fb_info, level, sec_strength, fbc, fbr, plane);
  362|   219k|    cdef_prepare_fb(cm, fb_info, colbuf, cdef_left[plane], fbc, fbr, plane);
  363|   219k|    cdef_filter_fb(fb_info, plane, cm->seq_params->use_highbitdepth);
  364|   219k|    cdef_left[plane] = 1;
  365|   219k|  }
  366|   131k|}
cdef.c:cdef_init_fb_col:
  285|   219k|                                    int plane) {
  286|   219k|  const PLANE_TYPE plane_type = get_plane_type(plane);
  287|   219k|  fb_info->level = level[plane_type];
  288|   219k|  fb_info->sec_strength = sec_strength[plane_type];
  289|   219k|  fb_info->dst = xd->plane[plane].dst.buf;
  290|   219k|  fb_info->dst_stride = xd->plane[plane].dst.stride;
  291|       |
  292|   219k|  fb_info->xdec = xd->plane[plane].subsampling_x;
  293|   219k|  fb_info->ydec = xd->plane[plane].subsampling_y;
  294|   219k|  fb_info->mi_wide_l2 = MI_SIZE_LOG2 - xd->plane[plane].subsampling_x;
  ------------------
  |  |   39|   219k|#define MI_SIZE_LOG2 2
  ------------------
  295|   219k|  fb_info->mi_high_l2 = MI_SIZE_LOG2 - xd->plane[plane].subsampling_y;
  ------------------
  |  |   39|   219k|#define MI_SIZE_LOG2 2
  ------------------
  296|   219k|  fb_info->roffset = MI_SIZE_64X64 * fbr << fb_info->mi_high_l2;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  297|   219k|  fb_info->coffset = MI_SIZE_64X64 * fbc << fb_info->mi_wide_l2;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  298|   219k|}
cdef.c:cdef_prepare_fb:
  153|   219k|                            int fbc, int fbr, int plane) {
  154|   219k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  155|   219k|  uint16_t *src = fb_info->src;
  156|   219k|  const int luma_stride =
  157|   219k|      ALIGN_POWER_OF_TWO(mi_params->mi_cols << MI_SIZE_LOG2, 4);
  ------------------
  |  |   69|   219k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  158|   219k|  const int nvfb = (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  159|   219k|  const int nhfb = (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nhfb = (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   219k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   219k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  160|   219k|  int cstart = 0;
  161|   219k|  if (!cdef_left) cstart = -CDEF_HBORDER;
  ------------------
  |  |   26|  3.64k|#define CDEF_HBORDER (8)
  ------------------
  |  Branch (161:7): [True: 3.64k, False: 215k]
  ------------------
  162|   219k|  int rend, cend;
  163|   219k|  const int nhb =
  164|   219k|      AOMMIN(MI_SIZE_64X64, mi_params->mi_cols - MI_SIZE_64X64 * fbc);
  ------------------
  |  |   34|   219k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 65.5k, False: 153k]
  |  |  ------------------
  ------------------
  165|   219k|  const int nvb =
  166|   219k|      AOMMIN(MI_SIZE_64X64, mi_params->mi_rows - MI_SIZE_64X64 * fbr);
  ------------------
  |  |   34|   219k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 63.1k, False: 156k]
  |  |  ------------------
  ------------------
  167|   219k|  const int hsize = nhb << fb_info->mi_wide_l2;
  168|   219k|  const int vsize = nvb << fb_info->mi_high_l2;
  169|   219k|  const uint16_t *top_linebuf = fb_info->top_linebuf[plane];
  170|   219k|  const uint16_t *bot_linebuf = fb_info->bot_linebuf[plane];
  171|   219k|  const int bot_offset = (vsize + CDEF_VBORDER) * CDEF_BSTRIDE;
  ------------------
  |  |   23|   219k|#define CDEF_VBORDER (2)
  ------------------
                const int bot_offset = (vsize + CDEF_VBORDER) * CDEF_BSTRIDE;
  ------------------
  |  |   28|   219k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   219k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  172|   219k|  const int stride =
  173|   219k|      luma_stride >> (plane == AOM_PLANE_Y ? 0 : cm->seq_params->subsampling_x);
  ------------------
  |  |  281|   219k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (173:23): [True: 131k, False: 87.2k]
  ------------------
  174|       |
  175|   219k|  if (fbc == nhfb - 1)
  ------------------
  |  Branch (175:7): [True: 153k, False: 65.5k]
  ------------------
  176|   153k|    cend = hsize;
  177|  65.5k|  else
  178|  65.5k|    cend = hsize + CDEF_HBORDER;
  ------------------
  |  |   26|  65.5k|#define CDEF_HBORDER (8)
  ------------------
  179|       |
  180|   219k|  if (fbr == nvfb - 1)
  ------------------
  |  Branch (180:7): [True: 156k, False: 63.1k]
  ------------------
  181|   156k|    rend = vsize;
  182|  63.1k|  else
  183|  63.1k|    rend = vsize + CDEF_VBORDER;
  ------------------
  |  |   23|  63.1k|#define CDEF_VBORDER (2)
  ------------------
  184|       |
  185|       |  /* Copy in the pixels we need from the current superblock for
  186|       |  deringing.*/
  187|   219k|  av1_cdef_copy_sb8_16(
  188|   219k|      cm, &src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER + cstart],
  ------------------
  |  |   23|   219k|#define CDEF_VBORDER (2)
  ------------------
                    cm, &src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER + cstart],
  ------------------
  |  |   28|   219k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   219k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                    cm, &src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER + cstart],
  ------------------
  |  |   26|   219k|#define CDEF_HBORDER (8)
  ------------------
  189|   219k|      CDEF_BSTRIDE, fb_info->dst, fb_info->roffset, fb_info->coffset + cstart,
  ------------------
  |  |   28|   219k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   219k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  190|   219k|      fb_info->dst_stride, vsize, cend - cstart);
  191|       |
  192|       |  /* Copy in the pixels we need for the current superblock from bottom buffer.*/
  193|   219k|  if (fbr < nvfb - 1) {
  ------------------
  |  Branch (193:7): [True: 63.1k, False: 156k]
  ------------------
  194|  63.1k|    copy_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|  63.1k|#define CDEF_HBORDER (8)
  ------------------
                  copy_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|  63.1k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  63.1k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  195|  63.1k|              &bot_linebuf[fb_info->coffset], stride, CDEF_VBORDER, hsize);
  ------------------
  |  |   23|  63.1k|#define CDEF_VBORDER (2)
  ------------------
  196|   156k|  } else {
  197|   156k|    fill_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   26|   156k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   28|   156k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   156k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   23|   156k|#define CDEF_VBORDER (2)
  ------------------
  198|   156k|              hsize, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   156k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  199|   156k|  }
  200|   219k|  if (fbr < nvfb - 1 && fbc > 0) {
  ------------------
  |  Branch (200:7): [True: 63.2k, False: 155k]
  |  Branch (200:25): [True: 26.8k, False: 36.3k]
  ------------------
  201|  26.8k|    copy_rect(&src[bot_offset], CDEF_BSTRIDE,
  ------------------
  |  |   28|  26.8k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  26.8k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  202|  26.8k|              &bot_linebuf[fb_info->coffset - CDEF_HBORDER], stride,
  ------------------
  |  |   26|  26.8k|#define CDEF_HBORDER (8)
  ------------------
  203|  26.8k|              CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   23|  26.8k|#define CDEF_VBORDER (2)
  ------------------
                            CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   26|  26.8k|#define CDEF_HBORDER (8)
  ------------------
  204|   192k|  } else {
  205|   192k|    fill_rect(&src[bot_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   28|   192k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   192k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&src[bot_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   23|   192k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(&src[bot_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   26|   192k|#define CDEF_HBORDER (8)
  ------------------
  206|   192k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   192k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  207|   192k|  }
  208|   219k|  if (fbr < nvfb - 1 && fbc < nhfb - 1) {
  ------------------
  |  Branch (208:7): [True: 63.2k, False: 155k]
  |  Branch (208:25): [True: 25.3k, False: 37.8k]
  ------------------
  209|  25.3k|    copy_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|  25.3k|#define CDEF_HBORDER (8)
  ------------------
                  copy_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|  25.3k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  25.3k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  210|  25.3k|              &bot_linebuf[fb_info->coffset + hsize], stride, CDEF_VBORDER,
  ------------------
  |  |   23|  25.3k|#define CDEF_VBORDER (2)
  ------------------
  211|  25.3k|              CDEF_HBORDER);
  ------------------
  |  |   26|  25.3k|#define CDEF_HBORDER (8)
  ------------------
  212|   193k|  } else {
  213|   193k|    fill_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|   193k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|   193k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   193k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  214|   193k|              CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   23|   193k|#define CDEF_VBORDER (2)
  ------------------
                            CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|   193k|#define CDEF_HBORDER (8)
  ------------------
                            CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   193k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  215|   193k|  }
  216|       |
  217|       |  /* Copy in the pixels we need from the current superblock from top buffer.*/
  218|   219k|  if (fbr > 0) {
  ------------------
  |  Branch (218:7): [True: 66.0k, False: 153k]
  ------------------
  219|  66.0k|    copy_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, &top_linebuf[fb_info->coffset],
  ------------------
  |  |   26|  66.0k|#define CDEF_HBORDER (8)
  ------------------
                  copy_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, &top_linebuf[fb_info->coffset],
  ------------------
  |  |   28|  66.0k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  66.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  220|  66.0k|              stride, CDEF_VBORDER, hsize);
  ------------------
  |  |   23|  66.0k|#define CDEF_VBORDER (2)
  ------------------
  221|   153k|  } else {
  222|   153k|    fill_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hsize,
  ------------------
  |  |   26|   153k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hsize,
  ------------------
  |  |   28|   153k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   153k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hsize,
  ------------------
  |  |   23|   153k|#define CDEF_VBORDER (2)
  ------------------
  223|   153k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   153k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  224|   153k|  }
  225|   219k|  if (fbr > 0 && fbc > 0) {
  ------------------
  |  Branch (225:7): [True: 66.0k, False: 153k]
  |  Branch (225:18): [True: 28.3k, False: 37.6k]
  ------------------
  226|  28.3k|    copy_rect(src, CDEF_BSTRIDE, &top_linebuf[fb_info->coffset - CDEF_HBORDER],
  ------------------
  |  |   28|  28.3k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  28.3k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  copy_rect(src, CDEF_BSTRIDE, &top_linebuf[fb_info->coffset - CDEF_HBORDER],
  ------------------
  |  |   26|  28.3k|#define CDEF_HBORDER (8)
  ------------------
  227|  28.3k|              stride, CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   23|  28.3k|#define CDEF_VBORDER (2)
  ------------------
                            stride, CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   26|  28.3k|#define CDEF_HBORDER (8)
  ------------------
  228|   190k|  } else {
  229|   190k|    fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   28|   190k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   190k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   23|   190k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|   190k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   190k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  230|   190k|  }
  231|   219k|  if (fbr > 0 && fbc < nhfb - 1) {
  ------------------
  |  Branch (231:7): [True: 66.0k, False: 153k]
  |  Branch (231:18): [True: 27.4k, False: 38.6k]
  ------------------
  232|  27.4k|    copy_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|  27.4k|#define CDEF_HBORDER (8)
  ------------------
                  copy_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|  27.4k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  27.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  233|  27.4k|              &top_linebuf[fb_info->coffset + hsize], stride, CDEF_VBORDER,
  ------------------
  |  |   23|  27.4k|#define CDEF_VBORDER (2)
  ------------------
  234|  27.4k|              CDEF_HBORDER);
  ------------------
  |  |   26|  27.4k|#define CDEF_HBORDER (8)
  ------------------
  235|   191k|  } else {
  236|   191k|    fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   26|   191k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   28|   191k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   191k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
  ------------------
  |  |   23|   191k|#define CDEF_VBORDER (2)
  ------------------
  237|   191k|              CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|   191k|#define CDEF_HBORDER (8)
  ------------------
                            CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   191k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  238|   191k|  }
  239|   219k|  if (cdef_left) {
  ------------------
  |  Branch (239:7): [True: 215k, False: 3.62k]
  ------------------
  240|       |    /* If we deringed the superblock on the left then we need to copy in
  241|       |    saved pixels. */
  242|   215k|    copy_rect(src, CDEF_BSTRIDE, colbuf[plane], CDEF_HBORDER,
  ------------------
  |  |   28|   215k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   215k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  copy_rect(src, CDEF_BSTRIDE, colbuf[plane], CDEF_HBORDER,
  ------------------
  |  |   26|   215k|#define CDEF_HBORDER (8)
  ------------------
  243|   215k|              rend + CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   23|   215k|#define CDEF_VBORDER (2)
  ------------------
                            rend + CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   26|   215k|#define CDEF_HBORDER (8)
  ------------------
  244|   215k|  }
  245|       |  /* Saving pixels in case we need to dering the superblock on the
  246|       |  right. */
  247|   219k|  copy_rect(colbuf[plane], CDEF_HBORDER, src + hsize, CDEF_BSTRIDE,
  ------------------
  |  |   26|   219k|#define CDEF_HBORDER (8)
  ------------------
                copy_rect(colbuf[plane], CDEF_HBORDER, src + hsize, CDEF_BSTRIDE,
  ------------------
  |  |   28|   219k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   219k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  248|   219k|            rend + CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   23|   219k|#define CDEF_VBORDER (2)
  ------------------
                          rend + CDEF_VBORDER, CDEF_HBORDER);
  ------------------
  |  |   26|   219k|#define CDEF_HBORDER (8)
  ------------------
  249|       |
  250|   219k|  if (fb_info->frame_boundary[LEFT]) {
  ------------------
  |  Branch (250:7): [True: 151k, False: 67.7k]
  ------------------
  251|   151k|    fill_rect(src, CDEF_BSTRIDE, vsize + 2 * CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   28|   151k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   151k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(src, CDEF_BSTRIDE, vsize + 2 * CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   23|   151k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(src, CDEF_BSTRIDE, vsize + 2 * CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   26|   151k|#define CDEF_HBORDER (8)
  ------------------
  252|   151k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   151k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  253|   151k|  }
  254|   219k|  if (fb_info->frame_boundary[RIGHT]) {
  ------------------
  |  Branch (254:7): [True: 153k, False: 65.5k]
  ------------------
  255|   153k|    fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|   153k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|   153k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   153k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  256|   153k|              vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   23|   153k|#define CDEF_VBORDER (2)
  ------------------
                            vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|   153k|#define CDEF_HBORDER (8)
  ------------------
                            vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   153k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  257|   153k|  }
  258|   219k|}
cdef.c:copy_rect:
  133|   670k|                             int sstride, int v, int h) {
  134|  15.5M|  for (int i = 0; i < v; i++) {
  ------------------
  |  Branch (134:19): [True: 14.8M, False: 670k]
  ------------------
  135|   138M|    for (int j = 0; j < h; j++) {
  ------------------
  |  Branch (135:21): [True: 123M, False: 14.8M]
  ------------------
  136|   123M|      dst[i * dstride + j] = src[i * sstride + j];
  137|   123M|    }
  138|  14.8M|  }
  139|   670k|}
cdef.c:cdef_filter_fb:
  261|   219k|                                  uint8_t use_highbitdepth) {
  262|   219k|  ptrdiff_t offset =
  263|   219k|      (ptrdiff_t)fb_info->dst_stride * fb_info->roffset + fb_info->coffset;
  264|   219k|  if (use_highbitdepth) {
  ------------------
  |  Branch (264:7): [True: 51.6k, False: 167k]
  ------------------
  265|  51.6k|    av1_cdef_filter_fb(
  266|  51.6k|        NULL, CONVERT_TO_SHORTPTR(fb_info->dst + offset), fb_info->dst_stride,
  ------------------
  |  |   79|  51.6k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  267|  51.6k|        &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   23|  51.6k|#define CDEF_VBORDER (2)
  ------------------
                      &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   28|  51.6k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  51.6k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                      &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   26|  51.6k|#define CDEF_HBORDER (8)
  ------------------
  268|  51.6k|        fb_info->xdec, fb_info->ydec, fb_info->dir, NULL, fb_info->var, plane,
  269|  51.6k|        fb_info->dlist, fb_info->cdef_count, fb_info->level,
  270|  51.6k|        fb_info->sec_strength, fb_info->damping, fb_info->coeff_shift);
  271|   167k|  } else {
  272|   167k|    av1_cdef_filter_fb(
  273|   167k|        fb_info->dst + offset, NULL, fb_info->dst_stride,
  274|   167k|        &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   23|   167k|#define CDEF_VBORDER (2)
  ------------------
                      &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   28|   167k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   167k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                      &fb_info->src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER],
  ------------------
  |  |   26|   167k|#define CDEF_HBORDER (8)
  ------------------
  275|       |        fb_info->xdec, fb_info->ydec, fb_info->dir, NULL, fb_info->var, plane,
  276|   167k|        fb_info->dlist, fb_info->cdef_count, fb_info->level,
  277|   167k|        fb_info->sec_strength, fb_info->damping, fb_info->coeff_shift);
  278|   167k|  }
  279|   219k|}

av1_cdef_filter_fb:
  328|   660k|                        int sec_strength, int damping, int coeff_shift) {
  329|   660k|  int bi;
  330|   660k|  int bx;
  331|   660k|  int by;
  332|   660k|  const int pri_strength = level << coeff_shift;
  333|   660k|  sec_strength <<= coeff_shift;
  334|   660k|  damping += coeff_shift - (pli != AOM_PLANE_Y);
  ------------------
  |  |  281|   660k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  335|   660k|  const int bw_log2 = 3 - xdec;
  336|   660k|  const int bh_log2 = 3 - ydec;
  337|   660k|  if (dirinit && pri_strength == 0 && sec_strength == 0) {
  ------------------
  |  Branch (337:7): [True: 441k, False: 219k]
  |  Branch (337:18): [True: 173k, False: 268k]
  |  Branch (337:39): [True: 38.7k, False: 134k]
  ------------------
  338|       |    // If we're here, both primary and secondary strengths are 0, and
  339|       |    // we still haven't written anything to y[] yet, so we just copy
  340|       |    // the input to y[]. This is necessary only for av1_cdef_search()
  341|       |    // and only av1_cdef_search() sets dirinit.
  342|   356k|    for (bi = 0; bi < cdef_count; bi++) {
  ------------------
  |  Branch (342:18): [True: 317k, False: 38.7k]
  ------------------
  343|   317k|      by = dlist[bi].by;
  344|   317k|      bx = dlist[bi].bx;
  345|       |      // TODO(stemidts/jmvalin): SIMD optimisations
  346|  2.63M|      for (int iy = 0; iy < 1 << bh_log2; iy++) {
  ------------------
  |  Branch (346:24): [True: 2.31M, False: 317k]
  ------------------
  347|  2.31M|        memcpy(&dst16[(bi << (bw_log2 + bh_log2)) + (iy << bw_log2)],
  348|  2.31M|               &in[((by << bh_log2) + iy) * CDEF_BSTRIDE + (bx << bw_log2)],
  ------------------
  |  |   28|  2.31M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  2.31M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  349|  2.31M|               ((size_t)1 << bw_log2) * sizeof(*dst16));
  350|  2.31M|      }
  351|   317k|    }
  352|  38.7k|    return;
  353|  38.7k|  }
  354|       |
  355|   622k|  if (pli == 0) {
  ------------------
  |  Branch (355:7): [True: 357k, False: 264k]
  ------------------
  356|   357k|    if (!dirinit || !*dirinit) {
  ------------------
  |  Branch (356:9): [True: 132k, False: 225k]
  |  Branch (356:21): [True: 74.8k, False: 150k]
  ------------------
  357|   207k|      aom_cdef_find_dir(in, dlist, var, cdef_count, coeff_shift, dir);
  358|   207k|      if (dirinit) *dirinit = 1;
  ------------------
  |  Branch (358:11): [True: 75.0k, False: 131k]
  ------------------
  359|   207k|    }
  360|   357k|  }
  361|   622k|  if (pli == 1 && xdec != ydec) {
  ------------------
  |  Branch (361:7): [True: 132k, False: 489k]
  |  Branch (361:19): [True: 37.9k, False: 94.7k]
  ------------------
  362|   821k|    for (bi = 0; bi < cdef_count; bi++) {
  ------------------
  |  Branch (362:18): [True: 783k, False: 37.9k]
  ------------------
  363|   783k|      static const int conv422[8] = { 7, 0, 2, 4, 5, 6, 6, 6 };
  364|   783k|      static const int conv440[8] = { 1, 2, 2, 2, 3, 4, 6, 0 };
  365|   783k|      by = dlist[bi].by;
  366|   783k|      bx = dlist[bi].bx;
  367|  18.4E|      dir[by][bx] = (xdec ? conv422 : conv440)[dir[by][bx]];
  ------------------
  |  Branch (367:22): [True: 783k, False: 18.4E]
  ------------------
  368|   783k|    }
  369|  37.9k|  }
  370|       |
  371|   622k|  if (dst8) {
  ------------------
  |  Branch (371:7): [True: 454k, False: 167k]
  ------------------
  372|   454k|    const int block_width = 8 >> xdec;
  373|   454k|    const int block_height = 8 >> ydec;
  374|       |    /*
  375|       |     * strength_index == 0 : enable_primary = 1, enable_secondary = 1
  376|       |     * strength_index == 1 : enable_primary = 1, enable_secondary = 0
  377|       |     * strength_index == 2 : enable_primary = 0, enable_secondary = 1
  378|       |     * strength_index == 3 : enable_primary = 0, enable_secondary = 0
  379|       |     */
  380|   454k|    const cdef_filter_block_func cdef_filter_fn[4] = {
  381|   454k|      cdef_filter_8_0, cdef_filter_8_1, cdef_filter_8_2, cdef_filter_8_3
  382|   454k|    };
  383|       |
  384|  10.3M|    for (bi = 0; bi < cdef_count; bi++) {
  ------------------
  |  Branch (384:18): [True: 9.90M, False: 454k]
  ------------------
  385|  9.90M|      by = dlist[bi].by;
  386|  9.90M|      bx = dlist[bi].bx;
  387|  9.90M|      const int t =
  388|  9.90M|          (pli ? pri_strength : adjust_strength(pri_strength, var[by][bx]));
  ------------------
  |  Branch (388:12): [True: 4.28M, False: 5.62M]
  ------------------
  389|  9.90M|      const int strength_index = (sec_strength == 0) | ((t == 0) << 1);
  390|       |
  391|  9.90M|      cdef_filter_fn[strength_index](
  392|  9.90M|          &dst8[(by << bh_log2) * dstride + (bx << bw_log2)], dstride,
  393|  9.90M|          &in[(by * CDEF_BSTRIDE << bh_log2) + (bx << bw_log2)], t,
  ------------------
  |  |   28|  9.90M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  9.90M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  394|  9.90M|          sec_strength, pri_strength ? dir[by][bx] : 0, damping, damping,
  ------------------
  |  Branch (394:25): [True: 7.59M, False: 2.31M]
  ------------------
  395|  9.90M|          coeff_shift, block_width, block_height);
  396|  9.90M|    }
  397|   454k|  } else {
  398|   167k|    const int block_width = 8 >> xdec;
  399|   167k|    const int block_height = 8 >> ydec;
  400|       |    /*
  401|       |     * strength_index == 0 : enable_primary = 1, enable_secondary = 1
  402|       |     * strength_index == 1 : enable_primary = 1, enable_secondary = 0
  403|       |     * strength_index == 2 : enable_primary = 0, enable_secondary = 1
  404|       |     * strength_index == 3 : enable_primary = 0, enable_secondary = 0
  405|       |     */
  406|   167k|    const cdef_filter_block_func cdef_filter_fn[4] = {
  407|   167k|      cdef_filter_16_0, cdef_filter_16_1, cdef_filter_16_2, cdef_filter_16_3
  408|   167k|    };
  409|       |
  410|  1.52M|    for (bi = 0; bi < cdef_count; bi++) {
  ------------------
  |  Branch (410:18): [True: 1.35M, False: 167k]
  ------------------
  411|  1.35M|      by = dlist[bi].by;
  412|  1.35M|      bx = dlist[bi].bx;
  413|  1.35M|      const int t =
  414|  1.35M|          (pli ? pri_strength : adjust_strength(pri_strength, var[by][bx]));
  ------------------
  |  Branch (414:12): [True: 613k, False: 741k]
  ------------------
  415|  1.35M|      const int strength_index = (sec_strength == 0) | ((t == 0) << 1);
  416|       |
  417|  1.35M|      cdef_filter_fn[strength_index](
  418|  1.35M|          &dst16[dirinit ? bi << (bw_log2 + bh_log2)
  ------------------
  |  Branch (418:18): [True: 923k, False: 430k]
  ------------------
  419|  1.35M|                         : (by << bh_log2) * dstride + (bx << bw_log2)],
  420|  1.35M|          dirinit ? 1 << bw_log2 : dstride,
  ------------------
  |  Branch (420:11): [True: 923k, False: 430k]
  ------------------
  421|  1.35M|          &in[(by * CDEF_BSTRIDE << bh_log2) + (bx << bw_log2)], t,
  ------------------
  |  |   28|  1.35M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  1.35M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  422|  1.35M|          sec_strength, pri_strength ? dir[by][bx] : 0, damping, damping,
  ------------------
  |  Branch (422:25): [True: 984k, False: 369k]
  ------------------
  423|  1.35M|          coeff_shift, block_width, block_height);
  424|  1.35M|    }
  425|   167k|  }
  426|   622k|}
cdef_block.c:aom_cdef_find_dir:
  298|   207k|                                     int dir[CDEF_NBLOCKS][CDEF_NBLOCKS]) {
  299|   207k|  int bi;
  300|       |
  301|       |  // Find direction of two 8x8 blocks together.
  302|  2.21M|  for (bi = 0; bi < cdef_count - 1; bi += 2) {
  ------------------
  |  Branch (302:16): [True: 2.00M, False: 207k]
  ------------------
  303|  2.00M|    const int by = dlist[bi].by;
  304|  2.00M|    const int bx = dlist[bi].bx;
  305|  2.00M|    const int by2 = dlist[bi + 1].by;
  306|  2.00M|    const int bx2 = dlist[bi + 1].bx;
  307|  2.00M|    const int pos1 = 8 * by * CDEF_BSTRIDE + 8 * bx;
  ------------------
  |  |   28|  2.00M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  2.00M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  308|  2.00M|    const int pos2 = 8 * by2 * CDEF_BSTRIDE + 8 * bx2;
  ------------------
  |  |   28|  2.00M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  2.00M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  309|  2.00M|    cdef_find_dir_dual(&in[pos1], &in[pos2], CDEF_BSTRIDE, &var[by][bx],
  ------------------
  |  |   28|  2.00M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  2.00M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  310|  2.00M|                       &var[by2][bx2], coeff_shift, &dir[by][bx],
  311|  2.00M|                       &dir[by2][bx2]);
  312|  2.00M|  }
  313|       |
  314|       |  // Process remaining 8x8 blocks here. One 8x8 at a time.
  315|   207k|  if (cdef_count % 2) {
  ------------------
  |  Branch (315:7): [True: 43.4k, False: 163k]
  ------------------
  316|  43.4k|    const int by = dlist[bi].by;
  317|  43.4k|    const int bx = dlist[bi].bx;
  318|  43.4k|    dir[by][bx] = cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx],
  ------------------
  |  |   28|  43.4k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  43.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  319|  43.4k|                                CDEF_BSTRIDE, &var[by][bx], coeff_shift);
  ------------------
  |  |   28|  43.4k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  43.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  320|  43.4k|  }
  321|   207k|}
cdef_block.c:adjust_strength:
  289|  6.53M|static inline int adjust_strength(int strength, int32_t var) {
  290|  6.53M|  const int i = var >> 6 ? AOMMIN(get_msb(var >> 6), 12) : 0;
  ------------------
  |  |   34|  6.22M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.12M, False: 97.6k]
  |  |  ------------------
  ------------------
  |  Branch (290:17): [True: 6.22M, False: 315k]
  ------------------
  291|       |  /* We use the variance of 8x8 blocks to adjust the strength. */
  292|  6.53M|  return var ? (strength * (4 + i) + 8) >> 4 : 0;
  ------------------
  |  Branch (292:10): [True: 6.32M, False: 213k]
  ------------------
  293|  6.53M|}

pickcdef.c:fill_rect:
   58|   860k|                             uint16_t x) {
   59|  7.44M|  for (int i = 0; i < v; i++) {
  ------------------
  |  Branch (59:19): [True: 6.58M, False: 860k]
  ------------------
   60|  66.4M|    for (int j = 0; j < h; j++) {
  ------------------
  |  Branch (60:21): [True: 59.8M, False: 6.58M]
  ------------------
   61|  59.8M|      dst[i * dstride + j] = x;
   62|  59.8M|    }
   63|  6.58M|  }
   64|   860k|}
cdef.c:fill_rect:
   58|  1.38M|                             uint16_t x) {
   59|  13.3M|  for (int i = 0; i < v; i++) {
  ------------------
  |  Branch (59:19): [True: 11.9M, False: 1.38M]
  ------------------
   60|   118M|    for (int j = 0; j < h; j++) {
  ------------------
  |  Branch (60:21): [True: 106M, False: 11.9M]
  ------------------
   61|   106M|      dst[i * dstride + j] = x;
   62|   106M|    }
   63|  11.9M|  }
   64|  1.38M|}

cdef_find_dir_avx2:
  163|  43.4k|                             int coeff_shift) {
  164|  43.4k|  int i;
  165|  43.4k|  int32_t cost[8];
  166|  43.4k|  int32_t best_cost = 0;
  167|  43.4k|  int best_dir = 0;
  168|  43.4k|  v128 lines[8];
  169|   390k|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (169:15): [True: 347k, False: 43.4k]
  ------------------
  170|   347k|    lines[i] = v128_load_unaligned(&img[i * stride]);
  171|   347k|    lines[i] =
  172|   347k|        v128_sub_16(v128_shr_s16(lines[i], coeff_shift), v128_dup_16(128));
  173|   347k|  }
  174|       |
  175|       |  /* Compute "mostly vertical" directions. */
  176|  43.4k|  v128 dir47 = compute_directions(lines, cost + 4);
  177|       |
  178|  43.4k|  array_reverse_transpose_8x8(lines, lines);
  179|       |
  180|       |  /* Compute "mostly horizontal" directions. */
  181|  43.4k|  v128 dir03 = compute_directions(lines, cost);
  182|       |
  183|  43.4k|  v128 max = v128_max_s32(dir03, dir47);
  184|  43.4k|  max = v128_max_s32(max, v128_align(max, max, 8));
  ------------------
  |  |   75|  43.4k|#define v128_align(a, b, c) ((c) ? _mm_alignr_epi8(a, b, (uint8_t)(c)) : (b))
  |  |  ------------------
  |  |  |  Branch (75:30): [True: 43.4k, Folded]
  |  |  ------------------
  ------------------
  185|  43.4k|  max = v128_max_s32(max, v128_align(max, max, 4));
  ------------------
  |  |   75|  43.4k|#define v128_align(a, b, c) ((c) ? _mm_alignr_epi8(a, b, (uint8_t)(c)) : (b))
  |  |  ------------------
  |  |  |  Branch (75:30): [True: 43.4k, Folded]
  |  |  ------------------
  ------------------
  186|  43.4k|  best_cost = v128_low_u32(max);
  187|  43.4k|  v128 t =
  188|  43.4k|      v128_pack_s32_s16(v128_cmpeq_32(max, dir47), v128_cmpeq_32(max, dir03));
  189|  43.4k|  best_dir = v128_movemask_8(v128_pack_s16_s8(t, t));
  190|  43.4k|  best_dir = get_msb(best_dir ^ (best_dir - 1));  // Count trailing zeros
  191|       |
  192|       |  /* Difference between the optimal variance and the variance along the
  193|       |     orthogonal direction. Again, the sum(x^2) terms cancel out. */
  194|  43.4k|  *var = best_cost - cost[(best_dir + 4) & 7];
  195|       |  /* We'd normally divide by 840, but dividing by 1024 is close enough
  196|       |     for what we're going to do with this. */
  197|  43.4k|  *var >>= 10;
  198|  43.4k|  return best_dir;
  199|  43.4k|}
cdef_filter_8_0_avx2:
  687|  4.50M|                                int block_height) {
  688|  4.50M|  if (block_width == 8) {
  ------------------
  |  Branch (688:7): [True: 3.07M, False: 1.43M]
  ------------------
  689|  3.07M|    filter_block_8x8(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  690|  3.07M|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  691|  3.07M|                     block_height, /*enable_primary=*/1,
  692|  3.07M|                     /*enable_secondary=*/1);
  693|  3.07M|  } else {
  694|  1.43M|    filter_block_4x4(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  695|  1.43M|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  696|  1.43M|                     block_height, /*enable_primary=*/1,
  697|  1.43M|                     /*enable_secondary=*/1);
  698|  1.43M|  }
  699|  4.50M|}
cdef_filter_8_1_avx2:
  705|  3.21M|                                int block_height) {
  706|  3.21M|  if (block_width == 8) {
  ------------------
  |  Branch (706:7): [True: 2.03M, False: 1.17M]
  ------------------
  707|  2.03M|    filter_block_8x8(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  708|  2.03M|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  709|  2.03M|                     block_height, /*enable_primary=*/1,
  710|  2.03M|                     /*enable_secondary=*/0);
  711|  2.03M|  } else {
  712|  1.17M|    filter_block_4x4(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  713|  1.17M|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  714|  1.17M|                     block_height, /*enable_primary=*/1,
  715|  1.17M|                     /*enable_secondary=*/0);
  716|  1.17M|  }
  717|  3.21M|}
cdef_filter_8_2_avx2:
  722|  2.74M|                                int block_height) {
  723|  2.74M|  if (block_width == 8) {
  ------------------
  |  Branch (723:7): [True: 1.79M, False: 948k]
  ------------------
  724|  1.79M|    filter_block_8x8(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  725|  1.79M|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  726|  1.79M|                     block_height, /*enable_primary=*/0,
  727|  1.79M|                     /*enable_secondary=*/1);
  728|  1.79M|  } else {
  729|   948k|    filter_block_4x4(/*is_lowbd=*/1, dest, dstride, in, pri_strength,
  730|   948k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  731|   948k|                     block_height, /*enable_primary=*/0,
  732|   948k|                     /*enable_secondary=*/1);
  733|   948k|  }
  734|  2.74M|}
cdef_filter_8_3_avx2:
  740|   110k|                                int block_height) {
  741|   110k|  (void)pri_strength;
  742|   110k|  (void)sec_strength;
  743|   110k|  (void)dir;
  744|   110k|  (void)pri_damping;
  745|   110k|  (void)sec_damping;
  746|   110k|  (void)coeff_shift;
  747|   110k|  (void)block_width;
  748|       |
  749|   110k|  if (block_width == 8) {
  ------------------
  |  Branch (749:7): [True: 110k, False: 18.4E]
  ------------------
  750|   110k|    copy_block_8xh(/*is_lowbd=*/1, dest, dstride, in, block_height);
  751|  18.4E|  } else {
  752|  18.4E|    copy_block_4xh(/*is_lowbd=*/1, dest, dstride, in, block_height);
  753|  18.4E|  }
  754|   110k|}
cdef_filter_16_0_avx2:
  760|   570k|                                 int block_height) {
  761|   570k|  if (block_width == 8) {
  ------------------
  |  Branch (761:7): [True: 390k, False: 179k]
  ------------------
  762|   390k|    filter_block_8x8(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  763|   390k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  764|   390k|                     block_height, /*enable_primary=*/1,
  765|   390k|                     /*enable_secondary=*/1);
  766|   390k|  } else {
  767|   179k|    filter_block_4x4(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  768|   179k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  769|   179k|                     block_height, /*enable_primary=*/1,
  770|   179k|                     /*enable_secondary=*/1);
  771|   179k|  }
  772|   570k|}
cdef_filter_16_1_avx2:
  778|   412k|                                 int block_height) {
  779|   412k|  if (block_width == 8) {
  ------------------
  |  Branch (779:7): [True: 279k, False: 132k]
  ------------------
  780|   279k|    filter_block_8x8(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  781|   279k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  782|   279k|                     block_height, /*enable_primary=*/1,
  783|   279k|                     /*enable_secondary=*/0);
  784|   279k|  } else {
  785|   132k|    filter_block_4x4(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  786|   132k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  787|   132k|                     block_height, /*enable_primary=*/1,
  788|   132k|                     /*enable_secondary=*/0);
  789|   132k|  }
  790|   412k|}
cdef_filter_16_2_avx2:
  795|   384k|                                 int block_height) {
  796|   384k|  if (block_width == 8) {
  ------------------
  |  Branch (796:7): [True: 264k, False: 119k]
  ------------------
  797|   264k|    filter_block_8x8(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  798|   264k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  799|   264k|                     block_height, /*enable_primary=*/0,
  800|   264k|                     /*enable_secondary=*/1);
  801|   264k|  } else {
  802|   119k|    filter_block_4x4(/*is_lowbd=*/0, dest, dstride, in, pri_strength,
  803|   119k|                     sec_strength, dir, pri_damping, sec_damping, coeff_shift,
  804|   119k|                     block_height, /*enable_primary=*/0,
  805|   119k|                     /*enable_secondary=*/1);
  806|   119k|  }
  807|   384k|}
cdef_filter_16_3_avx2:
  813|  14.1k|                                 int block_height) {
  814|  14.1k|  (void)pri_strength;
  815|  14.1k|  (void)sec_strength;
  816|  14.1k|  (void)dir;
  817|  14.1k|  (void)pri_damping;
  818|  14.1k|  (void)sec_damping;
  819|  14.1k|  (void)coeff_shift;
  820|  14.1k|  (void)block_width;
  821|  14.1k|  if (block_width == 8) {
  ------------------
  |  Branch (821:7): [True: 14.1k, False: 0]
  ------------------
  822|  14.1k|    copy_block_8xh(/*is_lowbd=*/0, dest, dstride, in, block_height);
  823|  14.1k|  } else {
  824|      0|    copy_block_4xh(/*is_lowbd=*/0, dest, dstride, in, block_height);
  825|      0|  }
  826|  14.1k|}
cdef_copy_rect8_16bit_to_16bit_avx2:
  831|   115k|                                               int width, int height) {
  832|   115k|  int i, j;
  833|  2.26M|  for (i = 0; i < height; i++) {
  ------------------
  |  Branch (833:15): [True: 2.15M, False: 115k]
  ------------------
  834|  7.43M|    for (j = 0; j < (width & ~0x7); j += 8) {
  ------------------
  |  Branch (834:17): [True: 5.28M, False: 2.15M]
  ------------------
  835|  5.28M|      v128 row = v128_load_unaligned(&src[i * sstride + j]);
  836|  5.28M|      v128_store_unaligned(&dst[i * dstride + j], row);
  837|  5.28M|    }
  838|  3.17M|    for (; j < width; j++) {
  ------------------
  |  Branch (838:12): [True: 1.01M, False: 2.15M]
  ------------------
  839|  1.01M|      dst[i * dstride + j] = src[i * sstride + j];
  840|  1.01M|    }
  841|  2.15M|  }
  842|   115k|}
cdef_block_avx2.c:compute_directions:
   62|  86.8k|static inline v128 compute_directions(v128 lines[8], int32_t tmp_cost1[4]) {
   63|  86.8k|  v128 partial4a, partial4b, partial5a, partial5b, partial7a, partial7b;
   64|  86.8k|  v128 partial6;
   65|  86.8k|  v128 tmp;
   66|       |  /* Partial sums for lines 0 and 1. */
   67|  86.8k|  partial4a = v128_shl_n_byte(lines[0], 14);
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   68|  86.8k|  partial4b = v128_shr_n_byte(lines[0], 2);
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   69|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[1], 12));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   70|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[1], 4));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   71|  86.8k|  tmp = v128_add_16(lines[0], lines[1]);
   72|  86.8k|  partial5a = v128_shl_n_byte(tmp, 10);
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   73|  86.8k|  partial5b = v128_shr_n_byte(tmp, 6);
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   74|  86.8k|  partial7a = v128_shl_n_byte(tmp, 4);
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   75|  86.8k|  partial7b = v128_shr_n_byte(tmp, 12);
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   76|  86.8k|  partial6 = tmp;
   77|       |
   78|       |  /* Partial sums for lines 2 and 3. */
   79|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[2], 10));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   80|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[2], 6));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   81|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[3], 8));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   82|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[3], 8));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   83|  86.8k|  tmp = v128_add_16(lines[2], lines[3]);
   84|  86.8k|  partial5a = v128_add_16(partial5a, v128_shl_n_byte(tmp, 8));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   85|  86.8k|  partial5b = v128_add_16(partial5b, v128_shr_n_byte(tmp, 8));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   86|  86.8k|  partial7a = v128_add_16(partial7a, v128_shl_n_byte(tmp, 6));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   87|  86.8k|  partial7b = v128_add_16(partial7b, v128_shr_n_byte(tmp, 10));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   88|  86.8k|  partial6 = v128_add_16(partial6, tmp);
   89|       |
   90|       |  /* Partial sums for lines 4 and 5. */
   91|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[4], 6));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   92|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[4], 10));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   93|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[5], 4));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   94|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[5], 12));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   95|  86.8k|  tmp = v128_add_16(lines[4], lines[5]);
   96|  86.8k|  partial5a = v128_add_16(partial5a, v128_shl_n_byte(tmp, 6));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   97|  86.8k|  partial5b = v128_add_16(partial5b, v128_shr_n_byte(tmp, 10));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
   98|  86.8k|  partial7a = v128_add_16(partial7a, v128_shl_n_byte(tmp, 8));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
   99|  86.8k|  partial7b = v128_add_16(partial7b, v128_shr_n_byte(tmp, 8));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
  100|  86.8k|  partial6 = v128_add_16(partial6, tmp);
  101|       |
  102|       |  /* Partial sums for lines 6 and 7. */
  103|  86.8k|  partial4a = v128_add_16(partial4a, v128_shl_n_byte(lines[6], 2));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
  104|  86.8k|  partial4b = v128_add_16(partial4b, v128_shr_n_byte(lines[6], 14));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
  105|  86.8k|  partial4a = v128_add_16(partial4a, lines[7]);
  106|  86.8k|  tmp = v128_add_16(lines[6], lines[7]);
  107|  86.8k|  partial5a = v128_add_16(partial5a, v128_shl_n_byte(tmp, 4));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
  108|  86.8k|  partial5b = v128_add_16(partial5b, v128_shr_n_byte(tmp, 12));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
  109|  86.8k|  partial7a = v128_add_16(partial7a, v128_shl_n_byte(tmp, 10));
  ------------------
  |  |  595|  86.8k|#define v128_shl_n_byte(a, c) _mm_slli_si128(a, (c) & 127)
  ------------------
  110|  86.8k|  partial7b = v128_add_16(partial7b, v128_shr_n_byte(tmp, 6));
  ------------------
  |  |  596|  86.8k|#define v128_shr_n_byte(a, c) _mm_srli_si128(a, (c) & 127)
  ------------------
  111|  86.8k|  partial6 = v128_add_16(partial6, tmp);
  112|       |
  113|       |  /* Compute costs in terms of partial sums. */
  114|  86.8k|  partial4a =
  115|  86.8k|      fold_mul_and_sum(partial4a, partial4b, v128_from_32(210, 280, 420, 840),
  116|  86.8k|                       v128_from_32(105, 120, 140, 168));
  117|  86.8k|  partial7a =
  118|  86.8k|      fold_mul_and_sum(partial7a, partial7b, v128_from_32(210, 420, 0, 0),
  119|  86.8k|                       v128_from_32(105, 105, 105, 140));
  120|  86.8k|  partial5a =
  121|  86.8k|      fold_mul_and_sum(partial5a, partial5b, v128_from_32(210, 420, 0, 0),
  122|  86.8k|                       v128_from_32(105, 105, 105, 140));
  123|  86.8k|  partial6 = v128_madd_s16(partial6, partial6);
  124|  86.8k|  partial6 = v128_mullo_s32(partial6, v128_dup_32(105));
  125|       |
  126|  86.8k|  partial4a = hsum4(partial4a, partial5a, partial6, partial7a);
  127|  86.8k|  v128_store_unaligned(tmp_cost1, partial4a);
  128|  86.8k|  return partial4a;
  129|  86.8k|}
cdef_block_avx2.c:fold_mul_and_sum:
   27|   260k|                                    v128 const2) {
   28|   260k|  v128 tmp;
   29|       |  /* Reverse partial B. */
   30|   260k|  partialb = v128_shuffle_8(
   31|   260k|      partialb, v128_from_32(0x0f0e0100, 0x03020504, 0x07060908, 0x0b0a0d0c));
   32|       |  /* Interleave the x and y values of identical indices and pair x8 with 0. */
   33|   260k|  tmp = partiala;
   34|   260k|  partiala = v128_ziplo_16(partialb, partiala);
   35|   260k|  partialb = v128_ziphi_16(partialb, tmp);
   36|       |  /* Square and add the corresponding x and y values. */
   37|   260k|  partiala = v128_madd_s16(partiala, partiala);
   38|   260k|  partialb = v128_madd_s16(partialb, partialb);
   39|       |  /* Multiply by constant. */
   40|   260k|  partiala = v128_mullo_s32(partiala, const1);
   41|   260k|  partialb = v128_mullo_s32(partialb, const2);
   42|       |  /* Sum all results. */
   43|   260k|  partiala = v128_add_32(partiala, partialb);
   44|   260k|  return partiala;
   45|   260k|}
cdef_block_avx2.c:hsum4:
   47|  86.8k|static inline v128 hsum4(v128 x0, v128 x1, v128 x2, v128 x3) {
   48|  86.8k|  v128 t0, t1, t2, t3;
   49|  86.8k|  t0 = v128_ziplo_32(x1, x0);
   50|  86.8k|  t1 = v128_ziplo_32(x3, x2);
   51|  86.8k|  t2 = v128_ziphi_32(x1, x0);
   52|  86.8k|  t3 = v128_ziphi_32(x3, x2);
   53|  86.8k|  x0 = v128_ziplo_64(t1, t0);
   54|  86.8k|  x1 = v128_ziphi_64(t1, t0);
   55|  86.8k|  x2 = v128_ziplo_64(t3, t2);
   56|  86.8k|  x3 = v128_ziphi_64(t3, t2);
   57|  86.8k|  return v128_add_32(v128_add_32(x0, x1), v128_add_32(x2, x3));
   58|  86.8k|}
cdef_block_avx2.c:array_reverse_transpose_8x8:
  133|  43.4k|static inline void array_reverse_transpose_8x8(v128 *in, v128 *res) {
  134|  43.4k|  const v128 tr0_0 = v128_ziplo_16(in[1], in[0]);
  135|  43.4k|  const v128 tr0_1 = v128_ziplo_16(in[3], in[2]);
  136|  43.4k|  const v128 tr0_2 = v128_ziphi_16(in[1], in[0]);
  137|  43.4k|  const v128 tr0_3 = v128_ziphi_16(in[3], in[2]);
  138|  43.4k|  const v128 tr0_4 = v128_ziplo_16(in[5], in[4]);
  139|  43.4k|  const v128 tr0_5 = v128_ziplo_16(in[7], in[6]);
  140|  43.4k|  const v128 tr0_6 = v128_ziphi_16(in[5], in[4]);
  141|  43.4k|  const v128 tr0_7 = v128_ziphi_16(in[7], in[6]);
  142|       |
  143|  43.4k|  const v128 tr1_0 = v128_ziplo_32(tr0_1, tr0_0);
  144|  43.4k|  const v128 tr1_1 = v128_ziplo_32(tr0_5, tr0_4);
  145|  43.4k|  const v128 tr1_2 = v128_ziphi_32(tr0_1, tr0_0);
  146|  43.4k|  const v128 tr1_3 = v128_ziphi_32(tr0_5, tr0_4);
  147|  43.4k|  const v128 tr1_4 = v128_ziplo_32(tr0_3, tr0_2);
  148|  43.4k|  const v128 tr1_5 = v128_ziplo_32(tr0_7, tr0_6);
  149|  43.4k|  const v128 tr1_6 = v128_ziphi_32(tr0_3, tr0_2);
  150|  43.4k|  const v128 tr1_7 = v128_ziphi_32(tr0_7, tr0_6);
  151|       |
  152|  43.4k|  res[7] = v128_ziplo_64(tr1_1, tr1_0);
  153|  43.4k|  res[6] = v128_ziphi_64(tr1_1, tr1_0);
  154|  43.4k|  res[5] = v128_ziplo_64(tr1_3, tr1_2);
  155|  43.4k|  res[4] = v128_ziphi_64(tr1_3, tr1_2);
  156|  43.4k|  res[3] = v128_ziplo_64(tr1_5, tr1_4);
  157|  43.4k|  res[2] = v128_ziphi_64(tr1_5, tr1_4);
  158|  43.4k|  res[1] = v128_ziplo_64(tr1_7, tr1_6);
  159|  43.4k|  res[0] = v128_ziphi_64(tr1_7, tr1_6);
  160|  43.4k|}
cdef_block_avx2.c:filter_block_8x8:
  476|  7.73M|                                  int enable_primary, int enable_secondary) {
  477|  7.73M|  uint8_t *dst8 = (uint8_t *)dest;
  478|  7.73M|  uint16_t *dst16 = (uint16_t *)dest;
  479|  7.73M|  const int clipping_required = enable_primary && enable_secondary;
  ------------------
  |  Branch (479:33): [True: 5.75M, False: 1.98M]
  |  Branch (479:51): [True: 3.48M, False: 2.27M]
  ------------------
  480|  7.73M|  int i;
  481|  7.73M|  v256 sum, p0, p1, p2, p3, row, res;
  482|  7.73M|  const v256 cdef_large_value_mask = v256_dup_16((uint16_t)~CDEF_VERY_LARGE);
  ------------------
  |  |   30|  7.73M|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  483|  7.73M|  v256 max, min;
  484|  7.73M|  const int po1 = cdef_directions[dir][0];
  485|  7.73M|  const int po2 = cdef_directions[dir][1];
  486|  7.73M|  const int s1o1 = cdef_directions[dir + 2][0];
  487|  7.73M|  const int s1o2 = cdef_directions[dir + 2][1];
  488|  7.73M|  const int s2o1 = cdef_directions[dir - 2][0];
  489|  7.73M|  const int s2o2 = cdef_directions[dir - 2][1];
  490|  7.73M|  const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
  491|  7.73M|  const int *sec_taps = cdef_sec_taps;
  492|       |
  493|  7.73M|  if (enable_primary && pri_strength)
  ------------------
  |  Branch (493:7): [True: 5.75M, False: 1.98M]
  |  Branch (493:25): [True: 5.75M, False: 18.4E]
  ------------------
  494|  5.76M|    pri_damping = AOMMAX(0, pri_damping - get_msb(pri_strength));
  ------------------
  |  |   35|  5.76M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 27.8k, False: 5.73M]
  |  |  ------------------
  ------------------
  495|  7.73M|  if (enable_secondary && sec_strength)
  ------------------
  |  Branch (495:7): [True: 5.51M, False: 2.22M]
  |  Branch (495:27): [True: 5.52M, False: 18.4E]
  ------------------
  496|  5.51M|    sec_damping = AOMMAX(0, sec_damping - get_msb(sec_strength));
  ------------------
  |  |   35|  5.51M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 5.51M]
  |  |  ------------------
  ------------------
  497|       |
  498|  35.1M|  for (i = 0; i < height; i += 2) {
  ------------------
  |  Branch (498:15): [True: 27.3M, False: 7.73M]
  ------------------
  499|  27.3M|    v256 tap[8];
  500|  27.3M|    sum = v256_zero();
  501|  27.3M|    row = v256_from_v128(v128_load_aligned(&in[i * CDEF_BSTRIDE]),
  ------------------
  |  |   28|  27.3M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  27.3M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  502|  27.3M|                         v128_load_aligned(&in[(i + 1) * CDEF_BSTRIDE]));
  ------------------
  |  |   28|  27.3M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  27.3M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  503|       |
  504|  27.3M|    min = max = row;
  505|  27.3M|    if (enable_primary) {
  ------------------
  |  Branch (505:9): [True: 20.7M, False: 6.65M]
  ------------------
  506|       |      // Primary near taps
  507|  20.7M|      tap[0] = v256_from_v128(
  508|  20.7M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + po1]),
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  509|  20.7M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + po1]));
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  510|  20.7M|      tap[1] = v256_from_v128(
  511|  20.7M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - po1]),
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  512|  20.7M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - po1]));
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  513|  20.7M|      p0 = constrain16(tap[0], row, pri_strength, pri_damping);
  514|  20.7M|      p1 = constrain16(tap[1], row, pri_strength, pri_damping);
  515|       |
  516|       |      // sum += pri_taps[0] * (p0 + p1)
  517|  20.7M|      sum = v256_add_16(
  518|  20.7M|          sum, v256_mullo_s16(v256_dup_16(pri_taps[0]), v256_add_16(p0, p1)));
  519|       |
  520|       |      // Primary far taps
  521|  20.7M|      tap[2] = v256_from_v128(
  522|  20.7M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + po2]),
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  523|  20.7M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + po2]));
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  524|  20.7M|      tap[3] = v256_from_v128(
  525|  20.7M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - po2]),
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  526|  20.7M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - po2]));
  ------------------
  |  |   28|  20.7M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  20.7M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  527|  20.7M|      p0 = constrain16(tap[2], row, pri_strength, pri_damping);
  528|  20.7M|      p1 = constrain16(tap[3], row, pri_strength, pri_damping);
  529|       |
  530|       |      // sum += pri_taps[1] * (p0 + p1)
  531|  20.7M|      sum = v256_add_16(
  532|  20.7M|          sum, v256_mullo_s16(v256_dup_16(pri_taps[1]), v256_add_16(p0, p1)));
  533|       |
  534|  20.7M|      if (clipping_required) {
  ------------------
  |  Branch (534:11): [True: 12.6M, False: 8.08M]
  ------------------
  535|  12.6M|        max = get_max_primary(is_lowbd, tap, max, cdef_large_value_mask);
  536|       |
  537|  12.6M|        min = v256_min_s16(min, tap[0]);
  538|  12.6M|        min = v256_min_s16(min, tap[1]);
  539|  12.6M|        min = v256_min_s16(min, tap[2]);
  540|  12.6M|        min = v256_min_s16(min, tap[3]);
  541|  12.6M|      }
  542|       |      // End primary
  543|  20.7M|    }
  544|       |
  545|  27.3M|    if (enable_secondary) {
  ------------------
  |  Branch (545:9): [True: 19.6M, False: 7.72M]
  ------------------
  546|       |      // Secondary near taps
  547|  19.6M|      tap[0] = v256_from_v128(
  548|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + s1o1]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  549|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s1o1]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  550|  19.6M|      tap[1] = v256_from_v128(
  551|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - s1o1]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  552|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s1o1]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  553|  19.6M|      tap[2] = v256_from_v128(
  554|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + s2o1]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  555|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s2o1]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  556|  19.6M|      tap[3] = v256_from_v128(
  557|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - s2o1]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  558|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s2o1]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  559|  19.6M|      p0 = constrain16(tap[0], row, sec_strength, sec_damping);
  560|  19.6M|      p1 = constrain16(tap[1], row, sec_strength, sec_damping);
  561|  19.6M|      p2 = constrain16(tap[2], row, sec_strength, sec_damping);
  562|  19.6M|      p3 = constrain16(tap[3], row, sec_strength, sec_damping);
  563|       |
  564|       |      // sum += sec_taps[0] * (p0 + p1 + p2 + p3)
  565|  19.6M|      sum = v256_add_16(sum, v256_mullo_s16(v256_dup_16(sec_taps[0]),
  566|  19.6M|                                            v256_add_16(v256_add_16(p0, p1),
  567|  19.6M|                                                        v256_add_16(p2, p3))));
  568|       |
  569|       |      // Secondary far taps
  570|  19.6M|      tap[4] = v256_from_v128(
  571|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + s1o2]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  572|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s1o2]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  573|  19.6M|      tap[5] = v256_from_v128(
  574|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - s1o2]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  575|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s1o2]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  576|  19.6M|      tap[6] = v256_from_v128(
  577|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE + s2o2]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  578|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s2o2]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  579|  19.6M|      tap[7] = v256_from_v128(
  580|  19.6M|          v128_load_unaligned(&in[i * CDEF_BSTRIDE - s2o2]),
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  581|  19.6M|          v128_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s2o2]));
  ------------------
  |  |   28|  19.6M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  19.6M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  582|  19.6M|      p0 = constrain16(tap[4], row, sec_strength, sec_damping);
  583|  19.6M|      p1 = constrain16(tap[5], row, sec_strength, sec_damping);
  584|  19.6M|      p2 = constrain16(tap[6], row, sec_strength, sec_damping);
  585|  19.6M|      p3 = constrain16(tap[7], row, sec_strength, sec_damping);
  586|       |
  587|       |      // sum += sec_taps[1] * (p0 + p1 + p2 + p3)
  588|  19.6M|      sum = v256_add_16(sum, v256_mullo_s16(v256_dup_16(sec_taps[1]),
  589|  19.6M|                                            v256_add_16(v256_add_16(p0, p1),
  590|  19.6M|                                                        v256_add_16(p2, p3))));
  591|       |
  592|  19.6M|      if (clipping_required) {
  ------------------
  |  Branch (592:11): [True: 12.3M, False: 7.33M]
  ------------------
  593|  12.3M|        max = get_max_secondary(is_lowbd, tap, max, cdef_large_value_mask);
  594|       |
  595|  12.3M|        min = v256_min_s16(min, tap[0]);
  596|  12.3M|        min = v256_min_s16(min, tap[1]);
  597|  12.3M|        min = v256_min_s16(min, tap[2]);
  598|  12.3M|        min = v256_min_s16(min, tap[3]);
  599|  12.3M|        min = v256_min_s16(min, tap[4]);
  600|  12.3M|        min = v256_min_s16(min, tap[5]);
  601|  12.3M|        min = v256_min_s16(min, tap[6]);
  602|  12.3M|        min = v256_min_s16(min, tap[7]);
  603|  12.3M|      }
  604|       |      // End secondary
  605|  19.6M|    }
  606|       |
  607|       |    // res = row + ((sum - (sum < 0) + 8) >> 4)
  608|  27.3M|    sum = v256_add_16(sum, v256_cmplt_s16(sum, v256_zero()));
  609|  27.3M|    res = v256_add_16(sum, v256_dup_16(8));
  610|  27.3M|    res = v256_shr_n_s16(res, 4);
  ------------------
  |  |  695|  27.3M|#define v256_shr_n_s16(a, c) _mm256_srai_epi16(a, c)
  ------------------
  611|  27.3M|    res = v256_add_16(row, res);
  612|  27.3M|    if (clipping_required) {
  ------------------
  |  Branch (612:9): [True: 12.3M, False: 15.0M]
  ------------------
  613|  12.3M|      res = v256_min_s16(v256_max_s16(res, min), max);
  614|  12.3M|    }
  615|       |
  616|  27.3M|    if (is_lowbd) {
  ------------------
  |  Branch (616:9): [True: 23.1M, False: 4.25M]
  ------------------
  617|  23.1M|      const v128 res_128 = v256_low_v128(v256_pack_s16_u8(res, res));
  618|  23.1M|      v64_store_aligned(&dst8[i * dstride], v128_high_v64(res_128));
  619|  23.1M|      v64_store_aligned(&dst8[(i + 1) * dstride], v128_low_v64(res_128));
  620|  23.1M|    } else {
  621|  4.25M|      v128_store_unaligned(&dst16[i * dstride], v256_high_v128(res));
  622|  4.25M|      v128_store_unaligned(&dst16[(i + 1) * dstride], v256_low_v128(res));
  623|  4.25M|    }
  624|  27.3M|  }
  625|  7.73M|}
cdef_block_avx2.c:constrain16:
  211|   241M|                             unsigned int adjdamp) {
  212|   241M|  v256 diff = v256_sub_16(a, b);
  213|   241M|  const v256 sign = v256_shr_n_s16(diff, 15);
  ------------------
  |  |  695|   241M|#define v256_shr_n_s16(a, c) _mm256_srai_epi16(a, c)
  ------------------
  214|   241M|  diff = v256_abs_s16(diff);
  215|   241M|  const v256 s =
  216|   241M|      v256_ssub_u16(v256_dup_16(threshold), v256_shr_u16(diff, adjdamp));
  217|   241M|  return v256_xor(v256_add_16(sign, v256_min_s16(diff, s)), sign);
  218|   241M|}
cdef_block_avx2.c:get_max_primary:
  221|  14.5M|                                 v256 cdef_large_value_mask) {
  222|  14.5M|  if (is_lowbd) {
  ------------------
  |  Branch (222:7): [True: 12.7M, False: 1.78M]
  ------------------
  223|  12.7M|    v256 max_u8;
  224|  12.7M|    max_u8 = tap[0];
  225|  12.7M|    max_u8 = v256_max_u8(max_u8, tap[1]);
  226|  12.7M|    max_u8 = v256_max_u8(max_u8, tap[2]);
  227|  12.7M|    max_u8 = v256_max_u8(max_u8, tap[3]);
  228|       |    /* The source is 16 bits, however, we only really care about the lower
  229|       |    8 bits.  The upper 8 bits contain the "large" flag.  After the final
  230|       |    primary max has been calculated, zero out the upper 8 bits.  Use this
  231|       |    to find the "16 bit" max. */
  232|  12.7M|    max = v256_max_s16(max, v256_and(max_u8, cdef_large_value_mask));
  233|  12.7M|  } else {
  234|       |    /* Convert CDEF_VERY_LARGE to 0 before calculating max. */
  235|  1.78M|    max = v256_max_s16(max, v256_and(tap[0], cdef_large_value_mask));
  236|  1.78M|    max = v256_max_s16(max, v256_and(tap[1], cdef_large_value_mask));
  237|  1.78M|    max = v256_max_s16(max, v256_and(tap[2], cdef_large_value_mask));
  238|  1.78M|    max = v256_max_s16(max, v256_and(tap[3], cdef_large_value_mask));
  239|  1.78M|  }
  240|  14.5M|  return max;
  241|  14.5M|}
cdef_block_avx2.c:get_max_secondary:
  244|  14.7M|                                   v256 cdef_large_value_mask) {
  245|  14.7M|  if (is_lowbd) {
  ------------------
  |  Branch (245:7): [True: 12.9M, False: 1.78M]
  ------------------
  246|  12.9M|    v256 max_u8;
  247|  12.9M|    max_u8 = tap[0];
  248|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[1]);
  249|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[2]);
  250|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[3]);
  251|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[4]);
  252|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[5]);
  253|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[6]);
  254|  12.9M|    max_u8 = v256_max_u8(max_u8, tap[7]);
  255|       |    /* The source is 16 bits, however, we only really care about the lower
  256|       |    8 bits.  The upper 8 bits contain the "large" flag.  After the final
  257|       |    primary max has been calculated, zero out the upper 8 bits.  Use this
  258|       |    to find the "16 bit" max. */
  259|  12.9M|    max = v256_max_s16(max, v256_and(max_u8, cdef_large_value_mask));
  260|  12.9M|  } else {
  261|       |    /* Convert CDEF_VERY_LARGE to 0 before calculating max. */
  262|  1.78M|    max = v256_max_s16(max, v256_and(tap[0], cdef_large_value_mask));
  263|  1.78M|    max = v256_max_s16(max, v256_and(tap[1], cdef_large_value_mask));
  264|  1.78M|    max = v256_max_s16(max, v256_and(tap[2], cdef_large_value_mask));
  265|  1.78M|    max = v256_max_s16(max, v256_and(tap[3], cdef_large_value_mask));
  266|  1.78M|    max = v256_max_s16(max, v256_and(tap[4], cdef_large_value_mask));
  267|  1.78M|    max = v256_max_s16(max, v256_and(tap[5], cdef_large_value_mask));
  268|  1.78M|    max = v256_max_s16(max, v256_and(tap[6], cdef_large_value_mask));
  269|  1.78M|    max = v256_max_s16(max, v256_and(tap[7], cdef_large_value_mask));
  270|  1.78M|  }
  271|  14.7M|  return max;
  272|  14.7M|}
cdef_block_avx2.c:filter_block_4x4:
  284|  3.93M|                                  int enable_primary, int enable_secondary) {
  285|  3.93M|  uint8_t *dst8 = (uint8_t *)dest;
  286|  3.93M|  uint16_t *dst16 = (uint16_t *)dest;
  287|  3.93M|  const int clipping_required = enable_primary && enable_secondary;
  ------------------
  |  Branch (287:33): [True: 2.91M, False: 1.01M]
  |  Branch (287:51): [True: 1.63M, False: 1.28M]
  ------------------
  288|  3.93M|  v256 p0, p1, p2, p3;
  289|  3.93M|  v256 sum, row, res;
  290|  3.93M|  v256 max, min;
  291|  3.93M|  const v256 cdef_large_value_mask = v256_dup_16((uint16_t)~CDEF_VERY_LARGE);
  ------------------
  |  |   30|  3.93M|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  292|  3.93M|  const int po1 = cdef_directions[dir][0];
  293|  3.93M|  const int po2 = cdef_directions[dir][1];
  294|  3.93M|  const int s1o1 = cdef_directions[dir + 2][0];
  295|  3.93M|  const int s1o2 = cdef_directions[dir + 2][1];
  296|  3.93M|  const int s2o1 = cdef_directions[dir - 2][0];
  297|  3.93M|  const int s2o2 = cdef_directions[dir - 2][1];
  298|  3.93M|  const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
  299|  3.93M|  const int *sec_taps = cdef_sec_taps;
  300|  3.93M|  int i;
  301|       |
  302|  3.93M|  if (enable_primary && pri_strength)
  ------------------
  |  Branch (302:7): [True: 2.92M, False: 1.01M]
  |  Branch (302:25): [True: 2.92M, False: 18.4E]
  ------------------
  303|  2.92M|    pri_damping = AOMMAX(0, pri_damping - get_msb(pri_strength));
  ------------------
  |  |   35|  2.92M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 145k, False: 2.77M]
  |  |  ------------------
  ------------------
  304|  3.93M|  if (enable_secondary && sec_strength)
  ------------------
  |  Branch (304:7): [True: 2.69M, False: 1.24M]
  |  Branch (304:27): [True: 2.69M, False: 18.4E]
  ------------------
  305|  2.69M|    sec_damping = AOMMAX(0, sec_damping - get_msb(sec_strength));
  ------------------
  |  |   35|  2.69M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.69M]
  |  |  ------------------
  ------------------
  306|       |
  307|  9.36M|  for (i = 0; i < height; i += 4) {
  ------------------
  |  Branch (307:15): [True: 5.43M, False: 3.93M]
  ------------------
  308|  5.43M|    sum = v256_zero();
  309|  5.43M|    row = v256_from_v64(v64_load_aligned(&in[(i + 0) * CDEF_BSTRIDE]),
  ------------------
  |  |   28|  5.43M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  5.43M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  310|  5.43M|                        v64_load_aligned(&in[(i + 1) * CDEF_BSTRIDE]),
  ------------------
  |  |   28|  5.43M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  5.43M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  311|  5.43M|                        v64_load_aligned(&in[(i + 2) * CDEF_BSTRIDE]),
  ------------------
  |  |   28|  5.43M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  5.43M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  312|  5.43M|                        v64_load_aligned(&in[(i + 3) * CDEF_BSTRIDE]));
  ------------------
  |  |   28|  5.43M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  5.43M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  313|  5.43M|    max = min = row;
  314|       |
  315|  5.43M|    if (enable_primary) {
  ------------------
  |  Branch (315:9): [True: 4.06M, False: 1.36M]
  ------------------
  316|  4.06M|      v256 tap[4];
  317|       |      // Primary near taps
  318|  4.06M|      tap[0] =
  319|  4.06M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  320|  4.06M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  321|  4.06M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  322|  4.06M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + po1]));
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  323|  4.06M|      p0 = constrain16(tap[0], row, pri_strength, pri_damping);
  324|  4.06M|      tap[1] =
  325|  4.06M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  326|  4.06M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  327|  4.06M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - po1]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  328|  4.06M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - po1]));
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  329|  4.06M|      p1 = constrain16(tap[1], row, pri_strength, pri_damping);
  330|       |
  331|       |      // sum += pri_taps[0] * (p0 + p1)
  332|  4.06M|      sum = v256_add_16(
  333|  4.06M|          sum, v256_mullo_s16(v256_dup_16(pri_taps[0]), v256_add_16(p0, p1)));
  334|       |
  335|       |      // Primary far taps
  336|  4.06M|      tap[2] =
  337|  4.06M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  338|  4.06M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  339|  4.06M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  340|  4.06M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + po2]));
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  341|  4.06M|      p0 = constrain16(tap[2], row, pri_strength, pri_damping);
  342|  4.06M|      tap[3] =
  343|  4.06M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  344|  4.06M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  345|  4.06M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - po2]),
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  346|  4.06M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - po2]));
  ------------------
  |  |   28|  4.06M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  4.06M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  347|  4.06M|      p1 = constrain16(tap[3], row, pri_strength, pri_damping);
  348|       |
  349|       |      // sum += pri_taps[1] * (p0 + p1)
  350|  4.06M|      sum = v256_add_16(
  351|  4.06M|          sum, v256_mullo_s16(v256_dup_16(pri_taps[1]), v256_add_16(p0, p1)));
  352|  4.06M|      if (clipping_required) {
  ------------------
  |  Branch (352:11): [True: 2.22M, False: 1.83M]
  ------------------
  353|  2.22M|        max = get_max_primary(is_lowbd, tap, max, cdef_large_value_mask);
  354|       |
  355|  2.22M|        min = v256_min_s16(min, tap[0]);
  356|  2.22M|        min = v256_min_s16(min, tap[1]);
  357|  2.22M|        min = v256_min_s16(min, tap[2]);
  358|  2.22M|        min = v256_min_s16(min, tap[3]);
  359|  2.22M|      }
  360|  4.06M|    }
  361|       |
  362|  5.43M|    if (enable_secondary) {
  ------------------
  |  Branch (362:9): [True: 3.65M, False: 1.77M]
  ------------------
  363|  3.65M|      v256 tap[8];
  364|       |      // Secondary near taps
  365|  3.65M|      tap[0] =
  366|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  367|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  368|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  369|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + s1o1]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  370|  3.65M|      p0 = constrain16(tap[0], row, sec_strength, sec_damping);
  371|  3.65M|      tap[1] =
  372|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  373|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  374|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - s1o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  375|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - s1o1]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  376|  3.65M|      p1 = constrain16(tap[1], row, sec_strength, sec_damping);
  377|  3.65M|      tap[2] =
  378|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  379|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  380|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  381|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + s2o1]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  382|  3.65M|      p2 = constrain16(tap[2], row, sec_strength, sec_damping);
  383|  3.65M|      tap[3] =
  384|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  385|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  386|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - s2o1]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  387|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - s2o1]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  388|  3.65M|      p3 = constrain16(tap[3], row, sec_strength, sec_damping);
  389|       |
  390|       |      // sum += sec_taps[0] * (p0 + p1 + p2 + p3)
  391|  3.65M|      sum = v256_add_16(sum, v256_mullo_s16(v256_dup_16(sec_taps[0]),
  392|  3.65M|                                            v256_add_16(v256_add_16(p0, p1),
  393|  3.65M|                                                        v256_add_16(p2, p3))));
  394|       |
  395|       |      // Secondary far taps
  396|  3.65M|      tap[4] =
  397|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  398|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  399|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  400|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + s1o2]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  401|  3.65M|      p0 = constrain16(tap[4], row, sec_strength, sec_damping);
  402|  3.65M|      tap[5] =
  403|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  404|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  405|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - s1o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  406|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - s1o2]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  407|  3.65M|      p1 = constrain16(tap[5], row, sec_strength, sec_damping);
  408|  3.65M|      tap[6] =
  409|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE + s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  410|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE + s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  411|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE + s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  412|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE + s2o2]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  413|  3.65M|      p2 = constrain16(tap[6], row, sec_strength, sec_damping);
  414|  3.65M|      tap[7] =
  415|  3.65M|          v256_from_v64(v64_load_unaligned(&in[(i + 0) * CDEF_BSTRIDE - s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  416|  3.65M|                        v64_load_unaligned(&in[(i + 1) * CDEF_BSTRIDE - s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  417|  3.65M|                        v64_load_unaligned(&in[(i + 2) * CDEF_BSTRIDE - s2o2]),
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  418|  3.65M|                        v64_load_unaligned(&in[(i + 3) * CDEF_BSTRIDE - s2o2]));
  ------------------
  |  |   28|  3.65M|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  3.65M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  419|  3.65M|      p3 = constrain16(tap[7], row, sec_strength, sec_damping);
  420|       |
  421|       |      // sum += sec_taps[1] * (p0 + p1 + p2 + p3)
  422|  3.65M|      sum = v256_add_16(sum, v256_mullo_s16(v256_dup_16(sec_taps[1]),
  423|  3.65M|                                            v256_add_16(v256_add_16(p0, p1),
  424|  3.65M|                                                        v256_add_16(p2, p3))));
  425|       |
  426|  3.65M|      if (clipping_required) {
  ------------------
  |  Branch (426:11): [True: 2.20M, False: 1.44M]
  ------------------
  427|  2.20M|        max = get_max_secondary(is_lowbd, tap, max, cdef_large_value_mask);
  428|       |
  429|  2.20M|        min = v256_min_s16(min, tap[0]);
  430|  2.20M|        min = v256_min_s16(min, tap[1]);
  431|  2.20M|        min = v256_min_s16(min, tap[2]);
  432|  2.20M|        min = v256_min_s16(min, tap[3]);
  433|  2.20M|        min = v256_min_s16(min, tap[4]);
  434|  2.20M|        min = v256_min_s16(min, tap[5]);
  435|  2.20M|        min = v256_min_s16(min, tap[6]);
  436|  2.20M|        min = v256_min_s16(min, tap[7]);
  437|  2.20M|      }
  438|  3.65M|    }
  439|       |
  440|       |    // res = row + ((sum - (sum < 0) + 8) >> 4)
  441|  5.43M|    sum = v256_add_16(sum, v256_cmplt_s16(sum, v256_zero()));
  442|  5.43M|    res = v256_add_16(sum, v256_dup_16(8));
  443|  5.43M|    res = v256_shr_n_s16(res, 4);
  ------------------
  |  |  695|  5.43M|#define v256_shr_n_s16(a, c) _mm256_srai_epi16(a, c)
  ------------------
  444|  5.43M|    res = v256_add_16(row, res);
  445|  5.43M|    if (clipping_required) {
  ------------------
  |  Branch (445:9): [True: 2.20M, False: 3.22M]
  ------------------
  446|  2.20M|      res = v256_min_s16(v256_max_s16(res, min), max);
  447|  2.20M|    }
  448|       |
  449|  5.43M|    if (is_lowbd) {
  ------------------
  |  Branch (449:9): [True: 4.50M, False: 923k]
  ------------------
  450|  4.50M|      const v128 res_128 = v256_low_v128(v256_pack_s16_u8(res, res));
  451|  4.50M|      u32_store_aligned(&dst8[(i + 0) * dstride],
  452|  4.50M|                        v64_high_u32(v128_high_v64(res_128)));
  453|  4.50M|      u32_store_aligned(&dst8[(i + 1) * dstride],
  454|  4.50M|                        v64_low_u32(v128_high_v64(res_128)));
  455|  4.50M|      u32_store_aligned(&dst8[(i + 2) * dstride],
  456|  4.50M|                        v64_high_u32(v128_low_v64(res_128)));
  457|  4.50M|      u32_store_aligned(&dst8[(i + 3) * dstride],
  458|  4.50M|                        v64_low_u32(v128_low_v64(res_128)));
  459|  4.50M|    } else {
  460|   923k|      v64_store_aligned(&dst16[(i + 0) * dstride],
  461|   923k|                        v128_high_v64(v256_high_v128(res)));
  462|   923k|      v64_store_aligned(&dst16[(i + 1) * dstride],
  463|   923k|                        v128_low_v64(v256_high_v128(res)));
  464|   923k|      v64_store_aligned(&dst16[(i + 2) * dstride],
  465|   923k|                        v128_high_v64(v256_low_v128(res)));
  466|   923k|      v64_store_aligned(&dst16[(i + 3) * dstride],
  467|   923k|                        v128_low_v64(v256_low_v128(res)));
  468|   923k|    }
  469|  5.43M|  }
  470|  3.93M|}
cdef_block_avx2.c:copy_block_8xh:
  664|   125k|                                const uint16_t *in, int height) {
  665|   125k|  uint8_t *dst8 = (uint8_t *)dest;
  666|   125k|  uint16_t *dst16 = (uint16_t *)dest;
  667|   125k|  int i;
  668|   622k|  for (i = 0; i < height; i += 2) {
  ------------------
  |  Branch (668:15): [True: 497k, False: 125k]
  ------------------
  669|   497k|    const v128 row0 = v128_load_aligned(&in[i * CDEF_BSTRIDE]);
  ------------------
  |  |   28|   497k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   497k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  670|   497k|    const v128 row1 = v128_load_aligned(&in[(i + 1) * CDEF_BSTRIDE]);
  ------------------
  |  |   28|   497k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   497k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  671|   497k|    if (is_lowbd) {
  ------------------
  |  Branch (671:9): [True: 440k, False: 56.7k]
  ------------------
  672|       |      /* Note: v128_pack_s16_u8(). The parameter order is swapped internally */
  673|   440k|      const v128 res_128 = v128_pack_s16_u8(row1, row0);
  674|   440k|      v64_store_aligned(&dst8[i * dstride], v128_low_v64(res_128));
  675|   440k|      v64_store_aligned(&dst8[(i + 1) * dstride], v128_high_v64(res_128));
  676|   440k|    } else {
  677|  56.7k|      v128_store_unaligned(&dst16[i * dstride], row0);
  678|  56.7k|      v128_store_unaligned(&dst16[(i + 1) * dstride], row1);
  679|  56.7k|    }
  680|   497k|  }
  681|   125k|}

cfl_init:
   18|   434k|void cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params) {
   19|   434k|  assert(block_size_wide[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
   20|   434k|  assert(block_size_high[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
   21|       |
   22|   434k|  memset(&cfl->recon_buf_q3, 0, sizeof(cfl->recon_buf_q3));
   23|   434k|  memset(&cfl->ac_buf_q3, 0, sizeof(cfl->ac_buf_q3));
   24|   434k|  cfl->subsampling_x = seq_params->subsampling_x;
   25|   434k|  cfl->subsampling_y = seq_params->subsampling_y;
   26|   434k|  cfl->are_parameters_computed = 0;
   27|   434k|  cfl->store_y = 0;
   28|       |  // The DC_PRED cache is disabled by default and is only enabled in
   29|       |  // cfl_rd_pick_alpha
   30|   434k|  clear_cfl_dc_pred_cache_flags(cfl);
   31|   434k|}
cfl_store_dc_pred:
   34|  1.84M|                       CFL_PRED_TYPE pred_plane, int width) {
   35|  1.84M|  assert(pred_plane < CFL_PRED_PLANES);
   36|  1.84M|  assert(width <= CFL_BUF_LINE);
   37|       |
   38|  1.84M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (38:7): [True: 580k, False: 1.26M]
  ------------------
   39|   580k|    uint16_t *const input_16 = CONVERT_TO_SHORTPTR(input);
  ------------------
  |  |   79|   580k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   40|   580k|    memcpy(xd->cfl.dc_pred_cache[pred_plane], input_16, width << 1);
   41|   580k|    return;
   42|   580k|  }
   43|       |
   44|  1.26M|  memcpy(xd->cfl.dc_pred_cache[pred_plane], input, width);
   45|  1.26M|}
cfl_load_dc_pred:
   64|  18.3M|                      TX_SIZE tx_size, CFL_PRED_TYPE pred_plane) {
   65|  18.3M|  const int width = tx_size_wide[tx_size];
   66|  18.3M|  const int height = tx_size_high[tx_size];
   67|  18.3M|  assert(pred_plane < CFL_PRED_PLANES);
   68|  18.3M|  assert(width <= CFL_BUF_LINE);
   69|  18.3M|  assert(height <= CFL_BUF_LINE);
   70|  18.3M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (70:7): [True: 6.09M, False: 12.2M]
  ------------------
   71|  6.09M|    uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  6.09M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   72|  6.09M|    cfl_load_dc_pred_hbd(xd->cfl.dc_pred_cache[pred_plane], dst_16, dst_stride,
   73|  6.09M|                         width, height);
   74|  6.09M|    return;
   75|  6.09M|  }
   76|  12.2M|  cfl_load_dc_pred_lbd(xd->cfl.dc_pred_cache[pred_plane], dst, dst_stride,
   77|  12.2M|                       width, height);
   78|  12.2M|}
av1_cfl_predict_block:
  189|  22.4M|                           TX_SIZE tx_size, int plane) {
  190|  22.4M|  CFL_CTX *const cfl = &xd->cfl;
  191|  22.4M|  MB_MODE_INFO *mbmi = xd->mi[0];
  192|  22.4M|  assert(is_cfl_allowed(xd));
  193|       |
  194|  22.4M|  if (!cfl->are_parameters_computed) cfl_compute_parameters(xd, tx_size);
  ------------------
  |  Branch (194:7): [True: 1.82M, False: 20.6M]
  ------------------
  195|       |
  196|  22.4M|  const int alpha_q3 =
  197|  22.4M|      cfl_idx_to_alpha(mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, plane - 1);
  198|  22.4M|  assert((tx_size_high[tx_size] - 1) * CFL_BUF_LINE + tx_size_wide[tx_size] <=
  199|  22.4M|         CFL_BUF_SQUARE);
  200|  22.4M|#if CONFIG_AV1_HIGHBITDEPTH
  201|  22.4M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (201:7): [True: 7.02M, False: 15.4M]
  ------------------
  202|  7.02M|    uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  7.02M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  203|  7.02M|    cfl_get_predict_hbd_fn(tx_size)(cfl->ac_buf_q3, dst_16, dst_stride,
  204|  7.02M|                                    alpha_q3, xd->bd);
  205|  7.02M|    return;
  206|  7.02M|  }
  207|  15.4M|#endif
  208|  15.4M|  cfl_get_predict_lbd_fn(tx_size)(cfl->ac_buf_q3, dst, dst_stride, alpha_q3);
  209|  15.4M|}
cfl_store_tx:
  391|  2.98M|                  BLOCK_SIZE bsize) {
  392|  2.98M|  CFL_CTX *const cfl = &xd->cfl;
  393|  2.98M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  2.98M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  394|  2.98M|  uint8_t *dst = &pd->dst.buf[(row * pd->dst.stride + col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  2.98M|#define MI_SIZE_LOG2 2
  ------------------
  395|       |
  396|  2.98M|  if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
  ------------------
  |  Branch (396:7): [True: 395k, False: 2.58M]
  |  Branch (396:38): [True: 57.8k, False: 2.52M]
  ------------------
  397|       |    // Only dimensions of size 4 can have an odd offset.
  398|   453k|    assert(!((col & 1) && tx_size_wide[tx_size] != 4));
  399|       |    assert(!((row & 1) && tx_size_high[tx_size] != 4));
  400|   453k|    sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
  401|   453k|  }
  402|  2.98M|  cfl_store(cfl, dst, pd->dst.stride, row, col, tx_size, is_cur_buf_hbd(xd));
  403|  2.98M|}
cfl_store_block:
  421|  25.4k|void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
  422|  25.4k|  CFL_CTX *const cfl = &xd->cfl;
  423|  25.4k|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  25.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  424|  25.4k|  int row = 0;
  425|  25.4k|  int col = 0;
  426|       |
  427|  25.4k|  if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
  ------------------
  |  Branch (427:7): [True: 22.9k, False: 2.54k]
  |  Branch (427:38): [True: 2.54k, False: 0]
  ------------------
  428|  25.4k|    sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
  429|  25.4k|  }
  430|  25.4k|  const int width = max_intra_block_width(xd, bsize, AOM_PLANE_Y, tx_size);
  ------------------
  |  |  281|  25.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  431|  25.4k|  const int height = max_intra_block_height(xd, bsize, AOM_PLANE_Y, tx_size);
  ------------------
  |  |  281|  25.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  432|  25.4k|  tx_size = get_tx_size(width, height);
  433|  25.4k|  cfl_store(cfl, pd->dst.buf, pd->dst.stride, row, col, tx_size,
  434|  25.4k|            is_cur_buf_hbd(xd));
  435|  25.4k|}
cfl.c:cfl_load_dc_pred_hbd:
   56|  6.09M|                                 int dst_stride, int width, int height) {
   57|  6.09M|  const size_t num_bytes = width << 1;
   58|  37.1M|  for (int j = 0; j < height; j++) {
  ------------------
  |  Branch (58:19): [True: 31.0M, False: 6.09M]
  ------------------
   59|  31.0M|    memcpy(dst, dc_pred_cache, num_bytes);
   60|  31.0M|    dst += dst_stride;
   61|  31.0M|  }
   62|  6.09M|}
cfl.c:cfl_load_dc_pred_lbd:
   48|  12.2M|                                 int dst_stride, int width, int height) {
   49|  85.3M|  for (int j = 0; j < height; j++) {
  ------------------
  |  Branch (49:19): [True: 73.0M, False: 12.2M]
  ------------------
   50|  73.0M|    memcpy(dst, dc_pred_cache, width);
   51|  73.0M|    dst += dst_stride;
   52|  73.0M|  }
   53|  12.2M|}
cfl.c:cfl_compute_parameters:
  178|  1.82M|static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
  179|  1.82M|  CFL_CTX *const cfl = &xd->cfl;
  180|       |  // Do not call cfl_compute_parameters multiple time on the same values.
  181|  1.82M|  assert(cfl->are_parameters_computed == 0);
  182|       |
  183|  1.82M|  cfl_pad(cfl, tx_size_wide[tx_size], tx_size_high[tx_size]);
  184|  1.82M|  cfl_get_subtract_average_fn(tx_size)(cfl->recon_buf_q3, cfl->ac_buf_q3);
  185|  1.82M|  cfl->are_parameters_computed = 1;
  186|  1.82M|}
cfl.c:cfl_pad:
   83|  1.82M|static inline void cfl_pad(CFL_CTX *cfl, int width, int height) {
   84|  1.82M|  const int diff_width = width - cfl->buf_width;
   85|  1.82M|  const int diff_height = height - cfl->buf_height;
   86|       |
   87|  1.82M|  if (diff_width > 0) {
  ------------------
  |  Branch (87:7): [True: 0, False: 1.82M]
  ------------------
   88|      0|    const int min_height = height - diff_height;
   89|      0|    uint16_t *recon_buf_q3 = cfl->recon_buf_q3 + (width - diff_width);
   90|      0|    for (int j = 0; j < min_height; j++) {
  ------------------
  |  Branch (90:21): [True: 0, False: 0]
  ------------------
   91|      0|      const uint16_t last_pixel = recon_buf_q3[-1];
   92|      0|      assert(recon_buf_q3 + diff_width <= cfl->recon_buf_q3 + CFL_BUF_SQUARE);
   93|      0|      for (int i = 0; i < diff_width; i++) {
  ------------------
  |  Branch (93:23): [True: 0, False: 0]
  ------------------
   94|      0|        recon_buf_q3[i] = last_pixel;
   95|      0|      }
   96|      0|      recon_buf_q3 += CFL_BUF_LINE;
  ------------------
  |  |  522|      0|#define CFL_BUF_LINE (32)
  ------------------
   97|      0|    }
   98|      0|    cfl->buf_width = width;
   99|      0|  }
  100|  1.82M|  if (diff_height > 0) {
  ------------------
  |  Branch (100:7): [True: 0, False: 1.82M]
  ------------------
  101|      0|    uint16_t *recon_buf_q3 =
  102|      0|        cfl->recon_buf_q3 + ((height - diff_height) * CFL_BUF_LINE);
  ------------------
  |  |  522|      0|#define CFL_BUF_LINE (32)
  ------------------
  103|      0|    for (int j = 0; j < diff_height; j++) {
  ------------------
  |  Branch (103:21): [True: 0, False: 0]
  ------------------
  104|      0|      const uint16_t *last_row_q3 = recon_buf_q3 - CFL_BUF_LINE;
  ------------------
  |  |  522|      0|#define CFL_BUF_LINE (32)
  ------------------
  105|      0|      assert(recon_buf_q3 + width <= cfl->recon_buf_q3 + CFL_BUF_SQUARE);
  106|      0|      for (int i = 0; i < width; i++) {
  ------------------
  |  Branch (106:23): [True: 0, False: 0]
  ------------------
  107|      0|        recon_buf_q3[i] = last_row_q3[i];
  108|      0|      }
  109|      0|      recon_buf_q3 += CFL_BUF_LINE;
  ------------------
  |  |  522|      0|#define CFL_BUF_LINE (32)
  ------------------
  110|      0|    }
  111|      0|    cfl->buf_height = height;
  112|      0|  }
  113|  1.82M|}
cfl.c:cfl_idx_to_alpha:
  138|  22.4M|                                   CFL_PRED_TYPE pred_type) {
  139|  22.4M|  const int alpha_sign = (pred_type == CFL_PRED_U) ? CFL_SIGN_U(joint_sign)
  ------------------
  |  |  281|  11.2M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  ------------------
  |  Branch (139:26): [True: 11.2M, False: 11.1M]
  ------------------
  140|  22.4M|                                                   : CFL_SIGN_V(joint_sign);
  ------------------
  |  |  283|  11.1M|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  ------------------
  |  |  |  |  281|  11.1M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  141|  22.4M|  if (alpha_sign == CFL_SIGN_ZERO) return 0;
  ------------------
  |  Branch (141:7): [True: 3.11M, False: 19.3M]
  ------------------
  142|  19.3M|  const int abs_alpha_q3 =
  143|  19.3M|      (pred_type == CFL_PRED_U) ? CFL_IDX_U(alpha_idx) : CFL_IDX_V(alpha_idx);
  ------------------
  |  |  260|  9.70M|#define CFL_IDX_U(idx) (idx >> CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|  9.70M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
                    (pred_type == CFL_PRED_U) ? CFL_IDX_U(alpha_idx) : CFL_IDX_V(alpha_idx);
  ------------------
  |  |  261|  9.61M|#define CFL_IDX_V(idx) (idx & (CFL_ALPHABET_SIZE - 1))
  |  |  ------------------
  |  |  |  |  257|  9.61M|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|  9.61M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (143:7): [True: 9.70M, False: 9.61M]
  ------------------
  144|  19.3M|  return (alpha_sign == CFL_SIGN_POS) ? abs_alpha_q3 + 1 : -abs_alpha_q3 - 1;
  ------------------
  |  Branch (144:10): [True: 9.62M, False: 9.69M]
  ------------------
  145|  22.4M|}
cfl.c:sub8x8_adjust_offset:
  376|   478k|                                        int *col_out) {
  377|       |  // Increment row index for bottom: 8x4, 16x4 or both bottom 4x4s.
  378|   478k|  if ((mi_row & 0x01) && cfl->subsampling_y) {
  ------------------
  |  Branch (378:7): [True: 173k, False: 305k]
  |  Branch (378:26): [True: 68.9k, False: 104k]
  ------------------
  379|  68.9k|    assert(*row_out == 0);
  380|  68.9k|    (*row_out)++;
  381|  68.9k|  }
  382|       |
  383|       |  // Increment col index for right: 4x8, 4x16 or both right 4x4s.
  384|   478k|  if ((mi_col & 0x01) && cfl->subsampling_x) {
  ------------------
  |  Branch (384:7): [True: 170k, False: 307k]
  |  Branch (384:26): [True: 117k, False: 53.1k]
  ------------------
  385|       |    assert(*col_out == 0);
  386|   117k|    (*col_out)++;
  387|   117k|  }
  388|   478k|}
cfl.c:cfl_store:
  326|  3.00M|                      int row, int col, TX_SIZE tx_size, int use_hbd) {
  327|  3.00M|  const int width = tx_size_wide[tx_size];
  328|  3.00M|  const int height = tx_size_high[tx_size];
  329|  3.00M|  const int tx_off_log2 = MI_SIZE_LOG2;
  ------------------
  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  ------------------
  330|  3.00M|  const int sub_x = cfl->subsampling_x;
  331|  3.00M|  const int sub_y = cfl->subsampling_y;
  332|  3.00M|  const int store_row = row << (tx_off_log2 - sub_y);
  333|  3.00M|  const int store_col = col << (tx_off_log2 - sub_x);
  334|  3.00M|  const int store_height = height >> sub_y;
  335|  3.00M|  const int store_width = width >> sub_x;
  336|       |
  337|       |  // Invalidate current parameters
  338|  3.00M|  cfl->are_parameters_computed = 0;
  339|       |
  340|       |  // Store the surface of the pixel buffer that was written to, this way we
  341|       |  // can manage chroma overrun (e.g. when the chroma surfaces goes beyond the
  342|       |  // frame boundary)
  343|  3.00M|  if (col == 0 && row == 0) {
  ------------------
  |  Branch (343:7): [True: 2.23M, False: 773k]
  |  Branch (343:19): [True: 1.85M, False: 376k]
  ------------------
  344|  1.85M|    cfl->buf_width = store_width;
  345|  1.85M|    cfl->buf_height = store_height;
  346|  1.85M|  } else {
  347|  1.14M|    cfl->buf_width = OD_MAXI(store_col + store_width, cfl->buf_width);
  ------------------
  |  |   45|  1.14M|#define OD_MAXI AOMMAX
  |  |  ------------------
  |  |  |  |   35|  1.14M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:23): [True: 424k, False: 724k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  348|  1.14M|    cfl->buf_height = OD_MAXI(store_row + store_height, cfl->buf_height);
  ------------------
  |  |   45|  1.14M|#define OD_MAXI AOMMAX
  |  |  ------------------
  |  |  |  |   35|  1.14M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:23): [True: 376k, False: 773k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|  1.14M|  }
  350|       |
  351|       |  // Check that we will remain inside the pixel buffer.
  352|  3.00M|  assert(store_row + store_height <= CFL_BUF_LINE);
  353|  3.00M|  assert(store_col + store_width <= CFL_BUF_LINE);
  354|       |
  355|       |  // Store the input into the CfL pixel buffer
  356|  3.00M|  uint16_t *recon_buf_q3 =
  357|  3.00M|      cfl->recon_buf_q3 + (store_row * CFL_BUF_LINE + store_col);
  ------------------
  |  |  522|  3.00M|#define CFL_BUF_LINE (32)
  ------------------
  358|  3.00M|#if CONFIG_AV1_HIGHBITDEPTH
  359|  3.00M|  if (use_hbd) {
  ------------------
  |  Branch (359:7): [True: 702k, False: 2.30M]
  ------------------
  360|   702k|    cfl_subsampling_hbd(tx_size, sub_x, sub_y)(CONVERT_TO_SHORTPTR(input),
  ------------------
  |  |   79|   702k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  361|   702k|                                               input_stride, recon_buf_q3);
  362|  2.30M|  } else {
  363|  2.30M|    cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride,
  364|  2.30M|                                               recon_buf_q3);
  365|  2.30M|  }
  366|       |#else
  367|       |  (void)use_hbd;
  368|       |  cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride, recon_buf_q3);
  369|       |#endif
  370|  3.00M|}
cfl.c:cfl_subsampling_hbd:
  303|   702k|                                                       int sub_x, int sub_y) {
  304|   702k|  if (sub_x == 1) {
  ------------------
  |  Branch (304:7): [True: 492k, False: 210k]
  ------------------
  305|   492k|    if (sub_y == 1) {
  ------------------
  |  Branch (305:9): [True: 293k, False: 199k]
  ------------------
  306|   293k|      return cfl_get_luma_subsampling_420_hbd(tx_size);
  307|   293k|    }
  308|   199k|    return cfl_get_luma_subsampling_422_hbd(tx_size);
  309|   492k|  }
  310|   210k|  return cfl_get_luma_subsampling_444_hbd(tx_size);
  311|   702k|}
cfl.c:cfl_subsampling_lbd:
  315|  2.30M|                                                       int sub_x, int sub_y) {
  316|  2.30M|  if (sub_x == 1) {
  ------------------
  |  Branch (316:7): [True: 1.83M, False: 465k]
  ------------------
  317|  1.83M|    if (sub_y == 1) {
  ------------------
  |  Branch (317:9): [True: 1.24M, False: 599k]
  ------------------
  318|  1.24M|      return cfl_get_luma_subsampling_420_lbd(tx_size);
  319|  1.24M|    }
  320|   599k|    return cfl_get_luma_subsampling_422_lbd(tx_size);
  321|  1.83M|  }
  322|   465k|  return cfl_get_luma_subsampling_444_lbd(tx_size);
  323|  2.30M|}
cfl.c:max_intra_block_width:
  407|  25.4k|                                        TX_SIZE tx_size) {
  408|  25.4k|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane)
  409|  25.4k|                              << MI_SIZE_LOG2;
  ------------------
  |  |   39|  25.4k|#define MI_SIZE_LOG2 2
  ------------------
  410|  25.4k|  return ALIGN_POWER_OF_TWO(max_blocks_wide, tx_size_wide_log2[tx_size]);
  ------------------
  |  |   69|  25.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  411|  25.4k|}
cfl.c:max_intra_block_height:
  415|  25.4k|                                         TX_SIZE tx_size) {
  416|  25.4k|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane)
  417|  25.4k|                              << MI_SIZE_LOG2;
  ------------------
  |  |   39|  25.4k|#define MI_SIZE_LOG2 2
  ------------------
  418|  25.4k|  return ALIGN_POWER_OF_TWO(max_blocks_high, tx_size_high_log2[tx_size]);
  ------------------
  |  |   69|  25.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  419|  25.4k|}

decodeframe.c:store_cfl_required:
   39|  1.24M|                                                  const MACROBLOCKD *xd) {
   40|  1.24M|  const MB_MODE_INFO *mbmi = xd->mi[0];
   41|       |
   42|  1.24M|  if (cm->seq_params->monochrome) return CFL_DISALLOWED;
  ------------------
  |  Branch (42:7): [True: 712k, False: 536k]
  ------------------
   43|       |
   44|   536k|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (44:7): [True: 5.63k, False: 530k]
  ------------------
   45|       |    // For non-chroma-reference blocks, we should always store the luma pixels,
   46|       |    // in case the corresponding chroma-reference block uses CfL.
   47|       |    // Note that this can only happen for block sizes which are <8 on
   48|       |    // their shortest side, as otherwise they would be chroma reference
   49|       |    // blocks.
   50|  5.63k|    return CFL_ALLOWED;
   51|  5.63k|  }
   52|       |
   53|       |  // If this block has chroma information, we know whether we're
   54|       |  // actually going to perform a CfL prediction
   55|   530k|  return (CFL_ALLOWED_TYPE)(!is_inter_block(mbmi) &&
  ------------------
  |  Branch (55:29): [True: 478k, False: 52.6k]
  ------------------
   56|   478k|                            mbmi->uv_mode == UV_CFL_PRED);
  ------------------
  |  Branch (56:29): [True: 182k, False: 295k]
  ------------------
   57|   536k|}
decodemv.c:is_cfl_allowed:
   19|   256k|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|   256k|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|   256k|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|   256k|  assert(bsize < BLOCK_SIZES_ALL);
   23|   256k|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 6.81k, False: 249k]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|  6.81k|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|  6.81k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|  6.81k|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|  6.81k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|  6.81k|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|  6.81k|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|  6.81k|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|   249k|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 249k, False: 18.4E]
  ------------------
   33|   249k|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 249k, False: 44]
  ------------------
   34|   256k|}
decodemv.c:store_cfl_required:
   39|   779k|                                                  const MACROBLOCKD *xd) {
   40|   779k|  const MB_MODE_INFO *mbmi = xd->mi[0];
   41|       |
   42|   779k|  if (cm->seq_params->monochrome) return CFL_DISALLOWED;
  ------------------
  |  Branch (42:7): [True: 465k, False: 314k]
  ------------------
   43|       |
   44|   314k|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (44:7): [True: 5.40k, False: 308k]
  ------------------
   45|       |    // For non-chroma-reference blocks, we should always store the luma pixels,
   46|       |    // in case the corresponding chroma-reference block uses CfL.
   47|       |    // Note that this can only happen for block sizes which are <8 on
   48|       |    // their shortest side, as otherwise they would be chroma reference
   49|       |    // blocks.
   50|  5.40k|    return CFL_ALLOWED;
   51|  5.40k|  }
   52|       |
   53|       |  // If this block has chroma information, we know whether we're
   54|       |  // actually going to perform a CfL prediction
   55|   308k|  return (CFL_ALLOWED_TYPE)(!is_inter_block(mbmi) &&
  ------------------
  |  Branch (55:29): [True: 256k, False: 52.0k]
  ------------------
   56|   256k|                            mbmi->uv_mode == UV_CFL_PRED);
  ------------------
  |  Branch (56:29): [True: 93.1k, False: 163k]
  ------------------
   57|   314k|}
bitstream.c:is_cfl_allowed:
   19|   651k|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|   651k|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|   651k|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|   651k|  assert(bsize < BLOCK_SIZES_ALL);
   23|   651k|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 13.8k, False: 637k]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|  13.8k|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|  13.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|  13.8k|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|  13.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|  13.8k|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|  13.8k|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|  13.8k|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|   637k|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 637k, False: 45]
  ------------------
   33|   637k|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 637k, False: 18.4E]
  ------------------
   34|   651k|}
encodeframe_utils.c:is_cfl_allowed:
   19|  1.51M|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|  1.51M|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|  1.51M|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|  1.51M|  assert(bsize < BLOCK_SIZES_ALL);
   23|  1.51M|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 36.8k, False: 1.47M]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|  36.8k|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|  36.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|  36.8k|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|  36.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|  36.8k|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|  36.8k|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|  36.8k|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|  1.47M|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 1.47M, False: 714]
  ------------------
   33|  1.47M|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 1.47M, False: 191]
  ------------------
   34|  1.51M|}
partition_search.c:store_cfl_required:
   39|  5.25M|                                                  const MACROBLOCKD *xd) {
   40|  5.25M|  const MB_MODE_INFO *mbmi = xd->mi[0];
   41|       |
   42|  5.25M|  if (cm->seq_params->monochrome) return CFL_DISALLOWED;
  ------------------
  |  Branch (42:7): [True: 2.79M, False: 2.45M]
  ------------------
   43|       |
   44|  2.45M|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (44:7): [True: 164k, False: 2.28M]
  ------------------
   45|       |    // For non-chroma-reference blocks, we should always store the luma pixels,
   46|       |    // in case the corresponding chroma-reference block uses CfL.
   47|       |    // Note that this can only happen for block sizes which are <8 on
   48|       |    // their shortest side, as otherwise they would be chroma reference
   49|       |    // blocks.
   50|   164k|    return CFL_ALLOWED;
   51|   164k|  }
   52|       |
   53|       |  // If this block has chroma information, we know whether we're
   54|       |  // actually going to perform a CfL prediction
   55|  2.28M|  return (CFL_ALLOWED_TYPE)(!is_inter_block(mbmi) &&
  ------------------
  |  Branch (55:29): [True: 2.28M, False: 441]
  ------------------
   56|  2.28M|                            mbmi->uv_mode == UV_CFL_PRED);
  ------------------
  |  Branch (56:29): [True: 805k, False: 1.48M]
  ------------------
   57|  2.45M|}
partition_search.c:is_cfl_allowed:
   19|  24.8k|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|  24.8k|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|  24.8k|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|  24.8k|  assert(bsize < BLOCK_SIZES_ALL);
   23|  24.8k|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 0, False: 24.8k]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|      0|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|      0|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|      0|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|      0|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|      0|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|  24.8k|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 24.8k, False: 0]
  ------------------
   33|  24.8k|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 24.8k, False: 0]
  ------------------
   34|  24.8k|}
rdopt.c:is_cfl_allowed:
   19|   902k|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|   902k|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|   902k|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|   902k|  assert(bsize < BLOCK_SIZES_ALL);
   23|   902k|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 15.3k, False: 887k]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|  15.3k|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|  15.3k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|  15.3k|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|  15.3k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|  15.3k|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|  15.3k|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|  15.3k|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|   887k|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 886k, False: 1.09k]
  ------------------
   33|   886k|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 885k, False: 371]
  ------------------
   34|   902k|}
intra_mode_search.c:is_cfl_allowed:
   19|  1.86M|static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) {
   20|  1.86M|  const MB_MODE_INFO *mbmi = xd->mi[0];
   21|  1.86M|  const BLOCK_SIZE bsize = mbmi->bsize;
   22|  1.86M|  assert(bsize < BLOCK_SIZES_ALL);
   23|  1.86M|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (23:7): [True: 30.6k, False: 1.83M]
  ------------------
   24|       |    // In lossless, CfL is available when the partition size is equal to the
   25|       |    // transform size.
   26|  30.6k|    const int ssx = xd->plane[AOM_PLANE_U].subsampling_x;
  ------------------
  |  |  282|  30.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   27|  30.6k|    const int ssy = xd->plane[AOM_PLANE_U].subsampling_y;
  ------------------
  |  |  282|  30.6k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
   28|  30.6k|    const int plane_bsize = get_plane_block_size(bsize, ssx, ssy);
   29|  30.6k|    return (CFL_ALLOWED_TYPE)(plane_bsize == BLOCK_4X4);
   30|  30.6k|  }
   31|       |  // Spec: CfL is available to luma partitions lesser than or equal to 32x32
   32|  1.83M|  return (CFL_ALLOWED_TYPE)(block_size_wide[bsize] <= 32 &&
  ------------------
  |  Branch (32:29): [True: 1.83M, False: 2.12k]
  ------------------
   33|  1.83M|                            block_size_high[bsize] <= 32);
  ------------------
  |  Branch (33:29): [True: 1.83M, False: 706]
  ------------------
   34|  1.86M|}
intra_mode_search.c:get_cfl_pred_type:
   64|  20.2M|static inline CFL_PRED_TYPE get_cfl_pred_type(int plane) {
   65|       |  assert(plane > 0);
   66|  20.2M|  return (CFL_PRED_TYPE)(plane - 1);
   67|  20.2M|}
intra_mode_search.c:clear_cfl_dc_pred_cache_flags:
   69|   922k|static inline void clear_cfl_dc_pred_cache_flags(CFL_CTX *cfl) {
   70|   922k|  cfl->use_dc_pred_cache = false;
   71|   922k|  cfl->dc_pred_is_cached[CFL_PRED_U] = false;
   72|       |  cfl->dc_pred_is_cached[CFL_PRED_V] = false;
   73|   922k|}
cfl.c:clear_cfl_dc_pred_cache_flags:
   69|   434k|static inline void clear_cfl_dc_pred_cache_flags(CFL_CTX *cfl) {
   70|   434k|  cfl->use_dc_pred_cache = false;
   71|   434k|  cfl->dc_pred_is_cached[CFL_PRED_U] = false;
   72|       |  cfl->dc_pred_is_cached[CFL_PRED_V] = false;
   73|   434k|}
reconintra.c:get_cfl_pred_type:
   64|  22.4M|static inline CFL_PRED_TYPE get_cfl_pred_type(int plane) {
   65|       |  assert(plane > 0);
   66|  22.4M|  return (CFL_PRED_TYPE)(plane - 1);
   67|  22.4M|}
cfl_subtract_average_4x4_sse2:
  178|   969k|                                                        int16_t *dst) {      \
  179|   969k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|   969k|                            num_pel_log2);                                   \
  181|   969k|  }
cfl_subtract_average_4x8_sse2:
  178|   431k|                                                        int16_t *dst) {      \
  179|   431k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|   431k|                            num_pel_log2);                                   \
  181|   431k|  }
cfl_subtract_average_8x4_sse2:
  178|  36.4k|                                                        int16_t *dst) {      \
  179|  36.4k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|  36.4k|                            num_pel_log2);                                   \
  181|  36.4k|  }
cfl_subtract_average_8x8_sse2:
  178|   339k|                                                        int16_t *dst) {      \
  179|   339k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|   339k|                            num_pel_log2);                                   \
  181|   339k|  }
cfl_subtract_average_8x16_sse2:
  178|  24.0k|                                                        int16_t *dst) {      \
  179|  24.0k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|  24.0k|                            num_pel_log2);                                   \
  181|  24.0k|  }
cfl_subsample_lbd_420_4x4_ssse3:
  101|   640k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   640k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   640k|                                               output_q3, width, height); \
  104|   640k|  }
cfl_subsample_lbd_420_8x8_ssse3:
  101|   565k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   565k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   565k|                                               output_q3, width, height); \
  104|   565k|  }
cfl_subsample_lbd_420_16x16_ssse3:
  101|  19.0k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  19.0k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  19.0k|                                               output_q3, width, height); \
  104|  19.0k|  }
cfl_subsample_lbd_420_8x16_ssse3:
  101|  7.62k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  7.62k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  7.62k|                                               output_q3, width, height); \
  104|  7.62k|  }
cfl_subsample_lbd_420_16x8_ssse3:
  101|  6.57k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  6.57k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  6.57k|                                               output_q3, width, height); \
  104|  6.57k|  }
cfl_subsample_lbd_420_16x32_ssse3:
  101|    218|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    218|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    218|                                               output_q3, width, height); \
  104|    218|  }
cfl_subsample_lbd_422_4x4_ssse3:
  101|   294k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   294k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   294k|                                               output_q3, width, height); \
  104|   294k|  }
cfl_subsample_lbd_422_8x8_ssse3:
  101|   289k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   289k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   289k|                                               output_q3, width, height); \
  104|   289k|  }
cfl_subsample_lbd_422_16x16_ssse3:
  101|  11.1k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  11.1k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  11.1k|                                               output_q3, width, height); \
  104|  11.1k|  }
cfl_subsample_lbd_422_16x8_ssse3:
  101|  4.49k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  4.49k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  4.49k|                                               output_q3, width, height); \
  104|  4.49k|  }
cfl_subsample_lbd_444_4x4_ssse3:
  101|   213k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   213k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   213k|                                               output_q3, width, height); \
  104|   213k|  }
cfl_subsample_lbd_444_8x8_ssse3:
  101|   233k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   233k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   233k|                                               output_q3, width, height); \
  104|   233k|  }
cfl_subsample_lbd_444_16x16_ssse3:
  101|  6.89k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  6.89k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  6.89k|                                               output_q3, width, height); \
  104|  6.89k|  }
cfl_subsample_lbd_444_8x16_ssse3:
  101|  6.22k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  6.22k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  6.22k|                                               output_q3, width, height); \
  104|  6.22k|  }
cfl_subsample_lbd_444_16x8_ssse3:
  101|  4.48k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  4.48k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  4.48k|                                               output_q3, width, height); \
  104|  4.48k|  }
cfl_subsample_lbd_444_16x32_ssse3:
  101|    127|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    127|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    127|                                               output_q3, width, height); \
  104|    127|  }
cfl_subsample_hbd_420_4x4_ssse3:
  101|   195k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   195k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   195k|                                               output_q3, width, height); \
  104|   195k|  }
cfl_subsample_hbd_420_8x8_ssse3:
  101|  45.6k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  45.6k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  45.6k|                                               output_q3, width, height); \
  104|  45.6k|  }
cfl_subsample_hbd_420_16x16_ssse3:
  101|  1.02k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  1.02k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  1.02k|                                               output_q3, width, height); \
  104|  1.02k|  }
cfl_subsample_hbd_420_4x8_ssse3:
  101|  24.7k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  24.7k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  24.7k|                                               output_q3, width, height); \
  104|  24.7k|  }
cfl_subsample_hbd_420_8x4_ssse3:
  101|  20.8k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  20.8k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  20.8k|                                               output_q3, width, height); \
  104|  20.8k|  }
cfl_subsample_hbd_420_8x16_ssse3:
  101|  3.08k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  3.08k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  3.08k|                                               output_q3, width, height); \
  104|  3.08k|  }
cfl_subsample_hbd_420_16x8_ssse3:
  101|  1.71k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  1.71k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  1.71k|                                               output_q3, width, height); \
  104|  1.71k|  }
cfl_subsample_hbd_420_16x32_ssse3:
  101|    124|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    124|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    124|                                               output_q3, width, height); \
  104|    124|  }
cfl_subsample_hbd_422_4x4_ssse3:
  101|   134k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   134k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   134k|                                               output_q3, width, height); \
  104|   134k|  }
cfl_subsample_hbd_422_8x8_ssse3:
  101|  38.0k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  38.0k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  38.0k|                                               output_q3, width, height); \
  104|  38.0k|  }
cfl_subsample_hbd_422_16x16_ssse3:
  101|    955|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    955|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    955|                                               output_q3, width, height); \
  104|    955|  }
cfl_subsample_hbd_422_8x4_ssse3:
  101|  21.9k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  21.9k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  21.9k|                                               output_q3, width, height); \
  104|  21.9k|  }
cfl_subsample_hbd_422_16x8_ssse3:
  101|  3.30k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  3.30k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  3.30k|                                               output_q3, width, height); \
  104|  3.30k|  }
cfl_subsample_hbd_444_4x4_ssse3:
  101|   127k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|   127k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|   127k|                                               output_q3, width, height); \
  104|   127k|  }
cfl_subsample_hbd_444_8x8_ssse3:
  101|  35.6k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  35.6k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  35.6k|                                               output_q3, width, height); \
  104|  35.6k|  }
cfl_subsample_hbd_444_16x16_ssse3:
  101|  1.16k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  1.16k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  1.16k|                                               output_q3, width, height); \
  104|  1.16k|  }
cfl_subsample_hbd_444_4x8_ssse3:
  101|  19.3k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  19.3k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  19.3k|                                               output_q3, width, height); \
  104|  19.3k|  }
cfl_subsample_hbd_444_8x4_ssse3:
  101|  21.2k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  21.2k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  21.2k|                                               output_q3, width, height); \
  104|  21.2k|  }
cfl_subsample_hbd_444_8x16_ssse3:
  101|  2.79k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  2.79k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  2.79k|                                               output_q3, width, height); \
  104|  2.79k|  }
cfl_subsample_hbd_444_16x8_ssse3:
  101|  2.39k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  2.39k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  2.39k|                                               output_q3, width, height); \
  104|  2.39k|  }
cfl_subsample_hbd_444_16x32_ssse3:
  101|    130|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    130|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    130|                                               output_q3, width, height); \
  104|    130|  }
cfl_predict_lbd_4x4_ssse3:
  232|  8.30M|      int alpha_q3) {                                                          \
  233|  8.30M|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|  8.30M|                           height);                                            \
  235|  8.30M|  }
cfl_predict_lbd_4x8_ssse3:
  232|  3.71M|      int alpha_q3) {                                                          \
  233|  3.71M|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|  3.71M|                           height);                                            \
  235|  3.71M|  }
cfl_predict_lbd_8x4_ssse3:
  232|   162k|      int alpha_q3) {                                                          \
  233|   162k|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|   162k|                           height);                                            \
  235|   162k|  }
cfl_predict_lbd_8x8_ssse3:
  232|  2.74M|      int alpha_q3) {                                                          \
  233|  2.74M|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|  2.74M|                           height);                                            \
  235|  2.74M|  }
cfl_predict_lbd_8x16_ssse3:
  232|   274k|      int alpha_q3) {                                                          \
  233|   274k|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|   274k|                           height);                                            \
  235|   274k|  }
cfl_predict_lbd_16x8_ssse3:
  232|  92.7k|      int alpha_q3) {                                                          \
  233|  92.7k|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|  92.7k|                           height);                                            \
  235|  92.7k|  }
cfl_predict_lbd_16x16_ssse3:
  232|   119k|      int alpha_q3) {                                                          \
  233|   119k|    cfl_predict_lbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, width,      \
  234|   119k|                           height);                                            \
  235|   119k|  }
cfl_predict_hbd_4x4_ssse3:
  244|  4.78M|      int bd) {                                                                \
  245|  4.78M|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|  4.78M|                           height);                                            \
  247|  4.78M|  }
cfl_predict_hbd_4x8_ssse3:
  244|  1.04M|      int bd) {                                                                \
  245|  1.04M|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|  1.04M|                           height);                                            \
  247|  1.04M|  }
cfl_predict_hbd_8x4_ssse3:
  244|   454k|      int bd) {                                                                \
  245|   454k|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|   454k|                           height);                                            \
  247|   454k|  }
cfl_predict_hbd_8x8_ssse3:
  244|   613k|      int bd) {                                                                \
  245|   613k|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|   613k|                           height);                                            \
  247|   613k|  }
cfl_predict_hbd_8x16_ssse3:
  244|  64.9k|      int bd) {                                                                \
  245|  64.9k|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|  64.9k|                           height);                                            \
  247|  64.9k|  }
cfl_subsample_lbd_420_32x32_avx2:
  101|  1.31k|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|  1.31k|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|  1.31k|                                               output_q3, width, height); \
  104|  1.31k|  }
cfl_subsample_lbd_420_32x16_avx2:
  101|    246|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    246|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    246|                                               output_q3, width, height); \
  104|    246|  }
cfl_subsample_lbd_422_32x32_avx2:
  101|    369|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    369|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    369|                                               output_q3, width, height); \
  104|    369|  }
cfl_subsample_lbd_422_32x16_avx2:
  101|    174|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    174|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    174|                                               output_q3, width, height); \
  104|    174|  }
cfl_subsample_lbd_444_32x32_avx2:
  101|    265|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    265|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    265|                                               output_q3, width, height); \
  104|    265|  }
cfl_subsample_lbd_444_32x16_avx2:
  101|    201|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    201|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    201|                                               output_q3, width, height); \
  104|    201|  }
cfl_subsample_hbd_420_32x32_avx2:
  101|     25|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|     25|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|     25|                                               output_q3, width, height); \
  104|     25|  }
cfl_subsample_hbd_420_32x16_avx2:
  101|     81|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|     81|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|     81|                                               output_q3, width, height); \
  104|     81|  }
cfl_subsample_hbd_422_32x32_avx2:
  101|      6|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|      6|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|      6|                                               output_q3, width, height); \
  104|      6|  }
cfl_subsample_hbd_422_32x16_avx2:
  101|    199|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    199|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    199|                                               output_q3, width, height); \
  104|    199|  }
cfl_subsample_hbd_444_32x32_avx2:
  101|      4|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|      4|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|      4|                                               output_q3, width, height); \
  104|      4|  }
cfl_subsample_hbd_444_32x16_avx2:
  101|    168|      const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
  102|    168|    cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
  103|    168|                                               output_q3, width, height); \
  104|    168|  }
cfl_predict_hbd_16x8_avx2:
  244|  50.4k|      int bd) {                                                                \
  245|  50.4k|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|  50.4k|                           height);                                            \
  247|  50.4k|  }
cfl_predict_hbd_16x16_avx2:
  244|  17.3k|      int bd) {                                                                \
  245|  17.3k|    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
  246|  17.3k|                           height);                                            \
  247|  17.3k|  }
cfl_subtract_average_16x8_avx2:
  178|  10.3k|                                                        int16_t *dst) {      \
  179|  10.3k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|  10.3k|                            num_pel_log2);                                   \
  181|  10.3k|  }
cfl_subtract_average_16x16_avx2:
  178|  9.64k|                                                        int16_t *dst) {      \
  179|  9.64k|    subtract_average_##arch(src, dst, width, height, round_offset,           \
  180|  9.64k|                            num_pel_log2);                                   \
  181|  9.64k|  }

detokenize.c:get_unsigned_bits:
   46|  25.3k|static inline int get_unsigned_bits(unsigned int num_values) {
   47|  18.4E|  return num_values > 0 ? get_msb(num_values) + 1 : 0;
  ------------------
  |  Branch (47:10): [True: 25.3k, False: 18.4E]
  ------------------
   48|  25.3k|}
bitstream.c:get_unsigned_bits:
   46|  66.9k|static inline int get_unsigned_bits(unsigned int num_values) {
   47|  66.9k|  return num_values > 0 ? get_msb(num_values) + 1 : 0;
  ------------------
  |  Branch (47:10): [True: 66.9k, False: 0]
  ------------------
   48|  66.9k|}
palette.c:get_unsigned_bits:
   46|   831k|static inline int get_unsigned_bits(unsigned int num_values) {
   47|   831k|  return num_values > 0 ? get_msb(num_values) + 1 : 0;
  ------------------
  |  Branch (47:10): [True: 831k, False: 0]
  ------------------
   48|   831k|}
rdopt.c:get_unsigned_bits:
   46|  30.0k|static inline int get_unsigned_bits(unsigned int num_values) {
   47|  30.0k|  return num_values > 0 ? get_msb(num_values) + 1 : 0;
  ------------------
  |  Branch (47:10): [True: 30.0k, False: 0]
  ------------------
   48|  30.0k|}
intra_mode_search.c:get_unsigned_bits:
   46|  4.47k|static inline int get_unsigned_bits(unsigned int num_values) {
   47|  4.47k|  return num_values > 0 ? get_msb(num_values) + 1 : 0;
  ------------------
  |  Branch (47:10): [True: 4.47k, False: 0]
  ------------------
   48|  4.47k|}

av1_convolve_2d_facade:
  643|  41.8M|                            ConvolveParams *conv_params) {
  644|  41.8M|  (void)x_step_q4;
  645|  41.8M|  (void)y_step_q4;
  646|  41.8M|  (void)dst;
  647|  41.8M|  (void)dst_stride;
  648|       |
  649|  41.8M|  const InterpFilterParams *filter_params_x = interp_filters[0];
  650|  41.8M|  const InterpFilterParams *filter_params_y = interp_filters[1];
  651|       |
  652|       |  // TODO(jingning, yunqing): Add SIMD support to 2-tap filter case.
  653|       |  // 2-tap filter indicates that it is for IntraBC.
  654|  41.8M|  if (filter_params_x->taps == 2 || filter_params_y->taps == 2) {
  ------------------
  |  Branch (654:7): [True: 18.4E, False: 41.8M]
  |  Branch (654:37): [True: 18.4E, False: 41.8M]
  ------------------
  655|      0|    assert(filter_params_x->taps == 2 && filter_params_y->taps == 2);
  656|      0|    assert(!scaled);
  657|      0|    if (subpel_x_qn && subpel_y_qn) {
  ------------------
  |  Branch (657:9): [True: 0, False: 0]
  |  Branch (657:24): [True: 0, False: 0]
  ------------------
  658|      0|      av1_convolve_2d_sr_intrabc(src, src_stride, dst, dst_stride, w, h,
  ------------------
  |  |  221|      0|#define av1_convolve_2d_sr_intrabc av1_convolve_2d_sr_intrabc_c
  ------------------
  659|      0|                                 filter_params_x, filter_params_y, subpel_x_qn,
  660|      0|                                 subpel_y_qn, conv_params);
  661|      0|      return;
  662|      0|    } else if (subpel_x_qn) {
  ------------------
  |  Branch (662:16): [True: 0, False: 0]
  ------------------
  663|      0|      av1_convolve_x_sr_intrabc(src, src_stride, dst, dst_stride, w, h,
  ------------------
  |  |  233|      0|#define av1_convolve_x_sr_intrabc av1_convolve_x_sr_intrabc_c
  ------------------
  664|      0|                                filter_params_x, subpel_x_qn, conv_params);
  665|      0|      return;
  666|      0|    } else if (subpel_y_qn) {
  ------------------
  |  Branch (666:16): [True: 0, False: 0]
  ------------------
  667|      0|      av1_convolve_y_sr_intrabc(src, src_stride, dst, dst_stride, w, h,
  ------------------
  |  |  241|      0|#define av1_convolve_y_sr_intrabc av1_convolve_y_sr_intrabc_c
  ------------------
  668|      0|                                filter_params_y, subpel_y_qn);
  669|      0|      return;
  670|      0|    }
  671|      0|  }
  672|       |
  673|  41.8M|  if (scaled) {
  ------------------
  |  Branch (673:7): [True: 36.2M, False: 5.58M]
  ------------------
  674|  36.2M|    convolve_2d_scale_wrapper(src, src_stride, dst, dst_stride, w, h,
  675|  36.2M|                              filter_params_x, filter_params_y, subpel_x_qn,
  676|  36.2M|                              x_step_q4, subpel_y_qn, y_step_q4, conv_params);
  677|  36.2M|  } else if (conv_params->is_compound) {
  ------------------
  |  Branch (677:14): [True: 0, False: 5.58M]
  ------------------
  678|      0|    convolve_2d_facade_compound(src, src_stride, dst, dst_stride, w, h,
  679|      0|                                filter_params_x, filter_params_y, subpel_x_qn,
  680|      0|                                subpel_y_qn, conv_params);
  681|  5.58M|  } else {
  682|  5.58M|    convolve_2d_facade_single(src, src_stride, dst, dst_stride, w, h,
  683|  5.58M|                              filter_params_x, filter_params_y, subpel_x_qn,
  684|  5.58M|                              subpel_y_qn, conv_params);
  685|  5.58M|  }
  686|  41.8M|}
av1_highbd_convolve_2d_facade:
 1252|  16.8M|                                   int bd) {
 1253|  16.8M|  (void)x_step_q4;
 1254|  16.8M|  (void)y_step_q4;
 1255|  16.8M|  (void)dst_stride;
 1256|  16.8M|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  16.8M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1257|       |
 1258|  16.8M|  const InterpFilterParams *filter_params_x = interp_filters[0];
 1259|  16.8M|  const InterpFilterParams *filter_params_y = interp_filters[1];
 1260|       |
 1261|  16.8M|  uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  16.8M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1262|       |  // 2-tap filter indicates that it is for IntraBC.
 1263|  16.8M|  if (filter_params_x->taps == 2 || filter_params_y->taps == 2) {
  ------------------
  |  Branch (1263:7): [True: 18.4E, False: 16.8M]
  |  Branch (1263:37): [True: 18.4E, False: 16.8M]
  ------------------
 1264|      0|    assert(filter_params_x->taps == 2 && filter_params_y->taps == 2);
 1265|      0|    assert(!scaled);
 1266|      0|    if (subpel_x_qn && subpel_y_qn) {
  ------------------
  |  Branch (1266:9): [True: 0, False: 0]
  |  Branch (1266:24): [True: 0, False: 0]
  ------------------
 1267|      0|      av1_highbd_convolve_2d_sr_intrabc_c(
 1268|      0|          src, src_stride, dst, dst_stride, w, h, filter_params_x,
 1269|      0|          filter_params_y, subpel_x_qn, subpel_y_qn, conv_params, bd);
 1270|      0|      return;
 1271|      0|    } else if (subpel_x_qn) {
  ------------------
  |  Branch (1271:16): [True: 0, False: 0]
  ------------------
 1272|      0|      av1_highbd_convolve_x_sr_intrabc_c(src, src_stride, dst, dst_stride, w, h,
 1273|      0|                                         filter_params_x, subpel_x_qn,
 1274|      0|                                         conv_params, bd);
 1275|      0|      return;
 1276|      0|    } else if (subpel_y_qn) {
  ------------------
  |  Branch (1276:16): [True: 0, False: 0]
  ------------------
 1277|      0|      av1_highbd_convolve_y_sr_intrabc_c(src, src_stride, dst, dst_stride, w, h,
 1278|      0|                                         filter_params_y, subpel_y_qn, bd);
 1279|      0|      return;
 1280|      0|    }
 1281|      0|  }
 1282|       |
 1283|  16.8M|  if (scaled) {
  ------------------
  |  Branch (1283:7): [True: 16.2M, False: 637k]
  ------------------
 1284|  16.2M|    if (conv_params->is_compound) {
  ------------------
  |  Branch (1284:9): [True: 0, False: 16.2M]
  ------------------
 1285|      0|      assert(conv_params->dst != NULL);
 1286|      0|    }
 1287|  16.2M|    av1_highbd_convolve_2d_scale(src, src_stride, dst, dst_stride, w, h,
 1288|  16.2M|                                 filter_params_x, filter_params_y, subpel_x_qn,
 1289|  16.2M|                                 x_step_q4, subpel_y_qn, y_step_q4, conv_params,
 1290|  16.2M|                                 bd);
 1291|  16.2M|  } else if (conv_params->is_compound) {
  ------------------
  |  Branch (1291:14): [True: 0, False: 637k]
  ------------------
 1292|      0|    highbd_convolve_2d_facade_compound(
 1293|      0|        src, src_stride, dst, dst_stride, w, h, filter_params_x,
 1294|      0|        filter_params_y, subpel_x_qn, subpel_y_qn, conv_params, bd);
 1295|   637k|  } else {
 1296|   637k|    highbd_convolve_2d_facade_single(src, src_stride, dst, dst_stride, w, h,
 1297|   637k|                                     filter_params_x, filter_params_y,
 1298|   637k|                                     subpel_x_qn, subpel_y_qn, conv_params, bd);
 1299|   637k|  }
 1300|  16.8M|}
convolve.c:convolve_2d_scale_wrapper:
  583|  36.2M|    ConvolveParams *conv_params) {
  584|  36.2M|  if (conv_params->is_compound) {
  ------------------
  |  Branch (584:7): [True: 0, False: 36.2M]
  ------------------
  585|       |    assert(conv_params->dst != NULL);
  586|      0|  }
  587|  36.2M|  av1_convolve_2d_scale(src, src_stride, dst, dst_stride, w, h, filter_params_x,
  588|  36.2M|                        filter_params_y, subpel_x_qn, x_step_qn, subpel_y_qn,
  589|  36.2M|                        y_step_qn, conv_params);
  590|  36.2M|}
convolve.c:convolve_2d_facade_single:
  620|  5.61M|    const int subpel_y_qn, ConvolveParams *conv_params) {
  621|  5.61M|  const bool need_x = subpel_x_qn != 0;
  622|  5.61M|  const bool need_y = subpel_y_qn != 0;
  623|  5.61M|  if (!need_x && !need_y) {
  ------------------
  |  Branch (623:7): [True: 1.84M, False: 3.77M]
  |  Branch (623:18): [True: 1.47M, False: 373k]
  ------------------
  624|  1.47M|    aom_convolve_copy(src, src_stride, dst, dst_stride, w, h);
  625|  4.14M|  } else if (need_x && !need_y) {
  ------------------
  |  Branch (625:14): [True: 3.79M, False: 354k]
  |  Branch (625:24): [True: 388k, False: 3.40M]
  ------------------
  626|   388k|    av1_convolve_x_sr(src, src_stride, dst, dst_stride, w, h, filter_params_x,
  627|   388k|                      subpel_x_qn, conv_params);
  628|  3.75M|  } else if (!need_x && need_y) {
  ------------------
  |  Branch (628:14): [True: 375k, False: 3.38M]
  |  Branch (628:25): [True: 375k, False: 18.4E]
  ------------------
  629|   375k|    av1_convolve_y_sr(src, src_stride, dst, dst_stride, w, h, filter_params_y,
  630|   375k|                      subpel_y_qn);
  631|  3.38M|  } else {
  632|       |    assert(need_x && need_y);
  633|  3.38M|    av1_convolve_2d_sr(src, src_stride, dst, dst_stride, w, h, filter_params_x,
  634|  3.38M|                       filter_params_y, subpel_x_qn, subpel_y_qn, conv_params);
  635|  3.38M|  }
  636|  5.61M|}
convolve.c:highbd_convolve_2d_facade_single:
 1226|   639k|    const int subpel_y_qn, ConvolveParams *conv_params, int bd) {
 1227|   639k|  const bool need_x = subpel_x_qn != 0;
 1228|   639k|  const bool need_y = subpel_y_qn != 0;
 1229|       |
 1230|   639k|  if (!need_x && !need_y) {
  ------------------
  |  Branch (1230:7): [True: 396k, False: 243k]
  |  Branch (1230:18): [True: 334k, False: 61.6k]
  ------------------
 1231|   334k|    aom_highbd_convolve_copy(src, src_stride, dst, dst_stride, w, h);
 1232|   334k|  } else if (need_x && !need_y) {
  ------------------
  |  Branch (1232:14): [True: 243k, False: 61.1k]
  |  Branch (1232:24): [True: 60.3k, False: 183k]
  ------------------
 1233|  60.3k|    av1_highbd_convolve_x_sr(src, src_stride, dst, dst_stride, w, h,
 1234|  60.3k|                             filter_params_x, subpel_x_qn, conv_params, bd);
 1235|   244k|  } else if (!need_x && need_y) {
  ------------------
  |  Branch (1235:14): [True: 61.6k, False: 183k]
  |  Branch (1235:25): [True: 61.6k, False: 1]
  ------------------
 1236|  61.6k|    av1_highbd_convolve_y_sr(src, src_stride, dst, dst_stride, w, h,
 1237|  61.6k|                             filter_params_y, subpel_y_qn, bd);
 1238|   183k|  } else {
 1239|       |    assert(need_x && need_y);
 1240|   183k|    av1_highbd_convolve_2d_sr(src, src_stride, dst, dst_stride, w, h,
 1241|   183k|                              filter_params_x, filter_params_y, subpel_x_qn,
 1242|   183k|                              subpel_y_qn, conv_params, bd);
 1243|   183k|  }
 1244|   639k|}

decodeframe.c:get_conv_params_no_round:
   71|   294k|                                                      int is_compound, int bd) {
   72|   294k|  ConvolveParams conv_params;
   73|   294k|  assert(IMPLIES(cmp_index, is_compound));
   74|       |
   75|   294k|  conv_params.is_compound = is_compound;
   76|   294k|  conv_params.use_dist_wtd_comp_avg = 0;
   77|   294k|  conv_params.round_0 = ROUND0_BITS;
  ------------------
  |  |   39|   294k|#define ROUND0_BITS 3
  ------------------
   78|   294k|  conv_params.round_1 = is_compound ? COMPOUND_ROUND1_BITS
  ------------------
  |  |   40|      0|#define COMPOUND_ROUND1_BITS 7
  ------------------
  |  Branch (78:25): [True: 0, False: 294k]
  ------------------
   79|   294k|                                    : 2 * FILTER_BITS - conv_params.round_0;
  ------------------
  |  |   21|   294k|#define FILTER_BITS 7
  ------------------
   80|   294k|#if CONFIG_AV1_HIGHBITDEPTH
   81|   294k|  const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
  ------------------
  |  |   21|   294k|#define FILTER_BITS 7
  ------------------
   82|   294k|  assert(IMPLIES(bd < 12, intbufrange <= 16));
   83|   294k|  if (intbufrange > 16) {
  ------------------
  |  Branch (83:7): [True: 15.2k, False: 279k]
  ------------------
   84|  15.2k|    conv_params.round_0 += intbufrange - 16;
   85|  15.2k|    if (!is_compound) conv_params.round_1 -= intbufrange - 16;
  ------------------
  |  Branch (85:9): [True: 15.2k, False: 0]
  ------------------
   86|  15.2k|  }
   87|       |#else
   88|       |  (void)bd;
   89|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
   90|       |  // TODO(yunqing): The following dst should only be valid while
   91|       |  // is_compound = 1;
   92|   294k|  conv_params.dst = dst;
   93|   294k|  conv_params.dst_stride = dst_stride;
   94|   294k|  conv_params.plane = plane;
   95|       |
   96|       |  // By default, set do average to 1 if this is the second single prediction
   97|       |  // in a compound mode.
   98|   294k|  conv_params.do_average = cmp_index;
   99|   294k|  return conv_params;
  100|   294k|}
nonrd_pickmode.c:get_conv_params:
  103|   598k|                                             int bd) {
  104|       |  return get_conv_params_no_round(do_average, plane, NULL, 0, 0, bd);
  105|   598k|}
nonrd_pickmode.c:get_conv_params_no_round:
   71|   598k|                                                      int is_compound, int bd) {
   72|   598k|  ConvolveParams conv_params;
   73|   598k|  assert(IMPLIES(cmp_index, is_compound));
   74|       |
   75|   598k|  conv_params.is_compound = is_compound;
   76|   598k|  conv_params.use_dist_wtd_comp_avg = 0;
   77|   598k|  conv_params.round_0 = ROUND0_BITS;
  ------------------
  |  |   39|   598k|#define ROUND0_BITS 3
  ------------------
   78|   598k|  conv_params.round_1 = is_compound ? COMPOUND_ROUND1_BITS
  ------------------
  |  |   40|      0|#define COMPOUND_ROUND1_BITS 7
  ------------------
  |  Branch (78:25): [True: 0, False: 598k]
  ------------------
   79|   598k|                                    : 2 * FILTER_BITS - conv_params.round_0;
  ------------------
  |  |   21|   598k|#define FILTER_BITS 7
  ------------------
   80|   598k|#if CONFIG_AV1_HIGHBITDEPTH
   81|   598k|  const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
  ------------------
  |  |   21|   598k|#define FILTER_BITS 7
  ------------------
   82|   598k|  assert(IMPLIES(bd < 12, intbufrange <= 16));
   83|   598k|  if (intbufrange > 16) {
  ------------------
  |  Branch (83:7): [True: 19.0k, False: 579k]
  ------------------
   84|  19.0k|    conv_params.round_0 += intbufrange - 16;
   85|  19.0k|    if (!is_compound) conv_params.round_1 -= intbufrange - 16;
  ------------------
  |  Branch (85:9): [True: 19.0k, False: 0]
  ------------------
   86|  19.0k|  }
   87|       |#else
   88|       |  (void)bd;
   89|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
   90|       |  // TODO(yunqing): The following dst should only be valid while
   91|       |  // is_compound = 1;
   92|   598k|  conv_params.dst = dst;
   93|   598k|  conv_params.dst_stride = dst_stride;
   94|   598k|  conv_params.plane = plane;
   95|       |
   96|       |  // By default, set do average to 1 if this is the second single prediction
   97|       |  // in a compound mode.
   98|   598k|  conv_params.do_average = cmp_index;
   99|   598k|  return conv_params;
  100|   598k|}
reconinter_enc.c:get_conv_params_no_round:
   71|  55.0M|                                                      int is_compound, int bd) {
   72|  55.0M|  ConvolveParams conv_params;
   73|  55.0M|  assert(IMPLIES(cmp_index, is_compound));
   74|       |
   75|  55.0M|  conv_params.is_compound = is_compound;
   76|  55.0M|  conv_params.use_dist_wtd_comp_avg = 0;
   77|  55.0M|  conv_params.round_0 = ROUND0_BITS;
  ------------------
  |  |   39|  55.0M|#define ROUND0_BITS 3
  ------------------
   78|  55.0M|  conv_params.round_1 = is_compound ? COMPOUND_ROUND1_BITS
  ------------------
  |  |   40|      0|#define COMPOUND_ROUND1_BITS 7
  ------------------
  |  Branch (78:25): [True: 0, False: 55.0M]
  ------------------
   79|  55.0M|                                    : 2 * FILTER_BITS - conv_params.round_0;
  ------------------
  |  |   21|  55.0M|#define FILTER_BITS 7
  ------------------
   80|  55.0M|#if CONFIG_AV1_HIGHBITDEPTH
   81|  55.0M|  const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
  ------------------
  |  |   21|  55.0M|#define FILTER_BITS 7
  ------------------
   82|  55.0M|  assert(IMPLIES(bd < 12, intbufrange <= 16));
   83|  55.0M|  if (intbufrange > 16) {
  ------------------
  |  Branch (83:7): [True: 8.74M, False: 46.3M]
  ------------------
   84|  8.74M|    conv_params.round_0 += intbufrange - 16;
   85|  8.74M|    if (!is_compound) conv_params.round_1 -= intbufrange - 16;
  ------------------
  |  Branch (85:9): [True: 8.74M, False: 0]
  ------------------
   86|  8.74M|  }
   87|       |#else
   88|       |  (void)bd;
   89|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
   90|       |  // TODO(yunqing): The following dst should only be valid while
   91|       |  // is_compound = 1;
   92|  55.0M|  conv_params.dst = dst;
   93|  55.0M|  conv_params.dst_stride = dst_stride;
   94|  55.0M|  conv_params.plane = plane;
   95|       |
   96|       |  // By default, set do average to 1 if this is the second single prediction
   97|       |  // in a compound mode.
   98|  55.0M|  conv_params.do_average = cmp_index;
   99|  55.0M|  return conv_params;
  100|  55.0M|}
reconinter_enc.c:get_conv_params:
  103|  41.4M|                                             int bd) {
  104|       |  return get_conv_params_no_round(do_average, plane, NULL, 0, 0, bd);
  105|  41.4M|}
restoration.c:get_conv_params_wiener:
  107|  10.3k|static inline WienerConvolveParams get_conv_params_wiener(int bd) {
  108|  10.3k|  WienerConvolveParams conv_params;
  109|  10.3k|  conv_params.round_0 = WIENER_ROUND0_BITS;
  ------------------
  |  |   41|  10.3k|#define WIENER_ROUND0_BITS 3
  ------------------
  110|  10.3k|  conv_params.round_1 = 2 * FILTER_BITS - conv_params.round_0;
  ------------------
  |  |   21|  10.3k|#define FILTER_BITS 7
  ------------------
  111|  10.3k|  const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
  ------------------
  |  |   21|  10.3k|#define FILTER_BITS 7
  ------------------
  112|  10.3k|  assert(IMPLIES(bd < 12, intbufrange <= 16));
  113|  10.3k|  if (intbufrange > 16) {
  ------------------
  |  Branch (113:7): [True: 0, False: 10.3k]
  ------------------
  114|      0|    conv_params.round_0 += intbufrange - 16;
  115|      0|    conv_params.round_1 -= intbufrange - 16;
  116|      0|  }
  117|  10.3k|  return conv_params;
  118|  10.3k|}
global_motion.c:get_conv_params:
  103|    246|                                             int bd) {
  104|       |  return get_conv_params_no_round(do_average, plane, NULL, 0, 0, bd);
  105|    246|}
global_motion.c:get_conv_params_no_round:
   71|    248|                                                      int is_compound, int bd) {
   72|    248|  ConvolveParams conv_params;
   73|    248|  assert(IMPLIES(cmp_index, is_compound));
   74|       |
   75|    248|  conv_params.is_compound = is_compound;
   76|    248|  conv_params.use_dist_wtd_comp_avg = 0;
   77|    248|  conv_params.round_0 = ROUND0_BITS;
  ------------------
  |  |   39|    248|#define ROUND0_BITS 3
  ------------------
   78|    248|  conv_params.round_1 = is_compound ? COMPOUND_ROUND1_BITS
  ------------------
  |  |   40|      0|#define COMPOUND_ROUND1_BITS 7
  ------------------
  |  Branch (78:25): [True: 0, False: 248]
  ------------------
   79|    248|                                    : 2 * FILTER_BITS - conv_params.round_0;
  ------------------
  |  |   21|    248|#define FILTER_BITS 7
  ------------------
   80|    248|#if CONFIG_AV1_HIGHBITDEPTH
   81|    248|  const int intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2;
  ------------------
  |  |   21|    248|#define FILTER_BITS 7
  ------------------
   82|    248|  assert(IMPLIES(bd < 12, intbufrange <= 16));
   83|    248|  if (intbufrange > 16) {
  ------------------
  |  Branch (83:7): [True: 6, False: 242]
  ------------------
   84|      6|    conv_params.round_0 += intbufrange - 16;
   85|      6|    if (!is_compound) conv_params.round_1 -= intbufrange - 16;
  ------------------
  |  Branch (85:9): [True: 6, False: 0]
  ------------------
   86|      6|  }
   87|       |#else
   88|       |  (void)bd;
   89|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
   90|       |  // TODO(yunqing): The following dst should only be valid while
   91|       |  // is_compound = 1;
   92|    248|  conv_params.dst = dst;
   93|    248|  conv_params.dst_stride = dst_stride;
   94|    248|  conv_params.plane = plane;
   95|       |
   96|       |  // By default, set do average to 1 if this is the second single prediction
   97|       |  // in a compound mode.
   98|    248|  conv_params.do_average = cmp_index;
   99|    248|  return conv_params;
  100|    248|}

av1_default_coef_probs:
   31|  59.2k|void av1_default_coef_probs(AV1_COMMON *cm) {
   32|  59.2k|  const int index = get_q_ctx(cm->quant_params.base_qindex);
   33|       |#if CONFIG_ENTROPY_STATS
   34|       |  cm->coef_cdf_category = index;
   35|       |#endif
   36|       |
   37|  59.2k|  av1_copy(cm->fc->txb_skip_cdf, av1_default_txb_skip_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   38|  59.2k|  av1_copy(cm->fc->eob_extra_cdf, av1_default_eob_extra_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   39|  59.2k|  av1_copy(cm->fc->dc_sign_cdf, av1_default_dc_sign_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   40|  59.2k|  av1_copy(cm->fc->coeff_br_cdf, av1_default_coeff_lps_multi_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   41|  59.2k|  av1_copy(cm->fc->coeff_base_cdf, av1_default_coeff_base_multi_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   42|  59.2k|  av1_copy(cm->fc->coeff_base_eob_cdf,
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   43|  59.2k|           av1_default_coeff_base_eob_multi_cdfs[index]);
   44|  59.2k|  av1_copy(cm->fc->eob_flag_cdf16, av1_default_eob_multi16_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   45|  59.2k|  av1_copy(cm->fc->eob_flag_cdf32, av1_default_eob_multi32_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   46|  59.2k|  av1_copy(cm->fc->eob_flag_cdf64, av1_default_eob_multi64_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   47|  59.2k|  av1_copy(cm->fc->eob_flag_cdf128, av1_default_eob_multi128_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   48|  59.2k|  av1_copy(cm->fc->eob_flag_cdf256, av1_default_eob_multi256_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   49|  59.2k|  av1_copy(cm->fc->eob_flag_cdf512, av1_default_eob_multi512_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   50|       |  av1_copy(cm->fc->eob_flag_cdf1024, av1_default_eob_multi1024_cdfs[index]);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
   51|  59.2k|}
av1_reset_cdf_symbol_counters:
   85|   101k|void av1_reset_cdf_symbol_counters(FRAME_CONTEXT *fc) {
   86|   101k|  RESET_CDF_COUNTER(fc->txb_skip_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|   101k|  RESET_CDF_COUNTER(fc->eob_extra_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|   101k|  RESET_CDF_COUNTER(fc->dc_sign_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf16, 5);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf32, 6);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf64, 7);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf128, 8);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf256, 9);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf512, 10);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|   101k|  RESET_CDF_COUNTER(fc->eob_flag_cdf1024, 11);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|   101k|  RESET_CDF_COUNTER(fc->coeff_base_eob_cdf, 3);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|   101k|  RESET_CDF_COUNTER(fc->coeff_base_cdf, 4);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|   101k|  RESET_CDF_COUNTER(fc->coeff_br_cdf, BR_CDF_SIZE);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|   101k|  RESET_CDF_COUNTER(fc->newmv_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|   101k|  RESET_CDF_COUNTER(fc->zeromv_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|   101k|  RESET_CDF_COUNTER(fc->refmv_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|   101k|  RESET_CDF_COUNTER(fc->drl_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|   101k|  RESET_CDF_COUNTER(fc->inter_compound_mode_cdf, INTER_COMPOUND_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|   101k|  RESET_CDF_COUNTER(fc->compound_type_cdf, MASKED_COMPOUND_TYPES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|   101k|  RESET_CDF_COUNTER(fc->wedge_idx_cdf, 16);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|   101k|  RESET_CDF_COUNTER(fc->interintra_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|   101k|  RESET_CDF_COUNTER(fc->wedge_interintra_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|   101k|  RESET_CDF_COUNTER(fc->interintra_mode_cdf, INTERINTRA_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|   101k|  RESET_CDF_COUNTER(fc->motion_mode_cdf, MOTION_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|   101k|  RESET_CDF_COUNTER(fc->obmc_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|   101k|  RESET_CDF_COUNTER(fc->palette_y_size_cdf, PALETTE_SIZES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|   101k|  RESET_CDF_COUNTER(fc->palette_uv_size_cdf, PALETTE_SIZES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|   813k|  for (int j = 0; j < PALETTE_SIZES; j++) {
  ------------------
  |  Branch (113:19): [True: 711k, False: 101k]
  ------------------
  114|   711k|    int nsymbs = j + PALETTE_MIN_SIZE;
  ------------------
  |  |   65|   711k|#define PALETTE_MIN_SIZE 2
  ------------------
  115|   711k|    RESET_CDF_COUNTER_STRIDE(fc->palette_y_color_index_cdf[j], nsymbs,
  ------------------
  |  |   64|   711k|  do {                                                               \
  |  |   65|   711k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   711k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   711k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   711k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   711k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 711k]
  |  |  ------------------
  ------------------
  116|   711k|                             CDF_SIZE(PALETTE_COLORS));
  117|   711k|    RESET_CDF_COUNTER_STRIDE(fc->palette_uv_color_index_cdf[j], nsymbs,
  ------------------
  |  |   64|   711k|  do {                                                               \
  |  |   65|   711k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   711k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   711k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   711k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   711k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 711k]
  |  |  ------------------
  ------------------
  118|   711k|                             CDF_SIZE(PALETTE_COLORS));
  119|   711k|  }
  120|   101k|  RESET_CDF_COUNTER(fc->palette_y_mode_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|   101k|  RESET_CDF_COUNTER(fc->palette_uv_mode_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|   101k|  RESET_CDF_COUNTER(fc->comp_inter_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|   101k|  RESET_CDF_COUNTER(fc->single_ref_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|   101k|  RESET_CDF_COUNTER(fc->comp_ref_type_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  125|   101k|  RESET_CDF_COUNTER(fc->uni_comp_ref_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|   101k|  RESET_CDF_COUNTER(fc->comp_ref_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|   101k|  RESET_CDF_COUNTER(fc->comp_bwdref_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|   101k|  RESET_CDF_COUNTER(fc->txfm_partition_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|   101k|  RESET_CDF_COUNTER(fc->compound_index_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|   101k|  RESET_CDF_COUNTER(fc->comp_group_idx_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|   101k|  RESET_CDF_COUNTER(fc->skip_mode_cdfs, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|   101k|  RESET_CDF_COUNTER(fc->skip_txfm_cdfs, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|   101k|  RESET_CDF_COUNTER(fc->intra_inter_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|   101k|  reset_nmv_counter(&fc->nmvc);
  135|   101k|  reset_nmv_counter(&fc->ndvc);
  136|   101k|  RESET_CDF_COUNTER(fc->intrabc_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|   101k|  RESET_CDF_COUNTER(fc->seg.pred_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|   101k|  RESET_CDF_COUNTER(fc->seg.spatial_pred_seg_cdf, MAX_SEGMENTS);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|   101k|  RESET_CDF_COUNTER(fc->filter_intra_cdfs, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|   101k|  RESET_CDF_COUNTER(fc->filter_intra_mode_cdf, FILTER_INTRA_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|   101k|  RESET_CDF_COUNTER(fc->switchable_restore_cdf, RESTORE_SWITCHABLE_TYPES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|   101k|  RESET_CDF_COUNTER(fc->wiener_restore_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|   101k|  RESET_CDF_COUNTER(fc->sgrproj_restore_cdf, 2);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|   101k|  RESET_CDF_COUNTER(fc->y_mode_cdf, INTRA_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|   101k|  RESET_CDF_COUNTER_STRIDE(fc->uv_mode_cdf[0], UV_INTRA_MODES - 1,
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  146|   101k|                           CDF_SIZE(UV_INTRA_MODES));
  147|   101k|  RESET_CDF_COUNTER(fc->uv_mode_cdf[1], UV_INTRA_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  148|  2.13M|  for (int i = 0; i < PARTITION_CONTEXTS; i++) {
  ------------------
  |  |  171|  2.13M|#define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  170|  2.13M|#define PARTITION_BLOCK_SIZES 5
  |  |  ------------------
  |  |               #define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  169|  2.13M|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  |  |  ------------------
  ------------------
  |  Branch (148:19): [True: 2.03M, False: 101k]
  ------------------
  149|  2.03M|    if (i < 4) {
  ------------------
  |  Branch (149:9): [True: 406k, False: 1.62M]
  ------------------
  150|   406k|      RESET_CDF_COUNTER_STRIDE(fc->partition_cdf[i], 4, CDF_SIZE(10));
  ------------------
  |  |   64|   406k|  do {                                                               \
  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   406k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  ------------------
  ------------------
  151|  1.62M|    } else if (i < 16) {
  ------------------
  |  Branch (151:16): [True: 1.22M, False: 406k]
  ------------------
  152|  1.22M|      RESET_CDF_COUNTER(fc->partition_cdf[i], 10);
  ------------------
  |  |   61|  1.22M|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|  1.22M|  do {                                                               \
  |  |  |  |   65|  1.22M|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|  1.22M|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|  1.22M|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|  1.22M|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|  1.22M|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 1.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  1.22M|    } else {
  154|   406k|      RESET_CDF_COUNTER_STRIDE(fc->partition_cdf[i], 8, CDF_SIZE(10));
  ------------------
  |  |   64|   406k|  do {                                                               \
  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   406k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  ------------------
  ------------------
  155|   406k|    }
  156|  2.03M|  }
  157|   101k|  RESET_CDF_COUNTER(fc->switchable_interp_cdf, SWITCHABLE_FILTERS);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|   101k|  RESET_CDF_COUNTER(fc->kf_y_cdf, INTRA_MODES);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|   101k|  RESET_CDF_COUNTER(fc->angle_delta_cdf, 2 * MAX_ANGLE_DELTA + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|   101k|  RESET_CDF_COUNTER_STRIDE(fc->tx_size_cdf[0], MAX_TX_DEPTH,
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  161|   101k|                           CDF_SIZE(MAX_TX_DEPTH + 1));
  162|   101k|  RESET_CDF_COUNTER(fc->tx_size_cdf[1], MAX_TX_DEPTH + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|   101k|  RESET_CDF_COUNTER(fc->tx_size_cdf[2], MAX_TX_DEPTH + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|   101k|  RESET_CDF_COUNTER(fc->tx_size_cdf[3], MAX_TX_DEPTH + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|   101k|  RESET_CDF_COUNTER(fc->delta_q_cdf, DELTA_Q_PROBS + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|   101k|  RESET_CDF_COUNTER(fc->delta_lf_cdf, DELTA_LF_PROBS + 1);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|   508k|  for (int i = 0; i < FRAME_LF_COUNT; i++) {
  ------------------
  |  |   72|   508k|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (167:19): [True: 406k, False: 101k]
  ------------------
  168|   406k|    RESET_CDF_COUNTER(fc->delta_lf_multi_cdf[i], DELTA_LF_PROBS + 1);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|   406k|  }
  170|   101k|  RESET_CDF_COUNTER_STRIDE(fc->intra_ext_tx_cdf[1], 7, CDF_SIZE(TX_TYPES));
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  171|   101k|  RESET_CDF_COUNTER_STRIDE(fc->intra_ext_tx_cdf[2], 5, CDF_SIZE(TX_TYPES));
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  172|   101k|  RESET_CDF_COUNTER_STRIDE(fc->inter_ext_tx_cdf[1], 16, CDF_SIZE(TX_TYPES));
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  173|   101k|  RESET_CDF_COUNTER_STRIDE(fc->inter_ext_tx_cdf[2], 12, CDF_SIZE(TX_TYPES));
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  174|   101k|  RESET_CDF_COUNTER_STRIDE(fc->inter_ext_tx_cdf[3], 2, CDF_SIZE(TX_TYPES));
  ------------------
  |  |   64|   101k|  do {                                                               \
  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |   69|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
  175|   101k|  RESET_CDF_COUNTER(fc->cfl_sign_cdf, CFL_JOINT_SIGNS);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|   101k|  RESET_CDF_COUNTER(fc->cfl_alpha_cdf, CFL_ALPHABET_SIZE);
  ------------------
  |  |   61|   101k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   101k|  do {                                                               \
  |  |  |  |   65|   101k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   101k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   101k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   101k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   101k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|   101k|}
entropy.c:get_q_ctx:
   24|  59.2k|static int get_q_ctx(int q) {
   25|  59.2k|  if (q <= 20) return 0;
  ------------------
  |  Branch (25:7): [True: 8.61k, False: 50.6k]
  ------------------
   26|  50.6k|  if (q <= 60) return 1;
  ------------------
  |  Branch (26:7): [True: 6.36k, False: 44.2k]
  ------------------
   27|  44.2k|  if (q <= 120) return 2;
  ------------------
  |  Branch (27:7): [True: 8.38k, False: 35.9k]
  ------------------
   28|  35.9k|  return 3;
   29|  44.2k|}
entropy.c:reset_cdf_symbol_counter:
   54|  14.2M|                                            int cdf_stride, int nsymbs) {
   55|   171M|  for (int i = 0; i < num_cdfs; i++) {
  ------------------
  |  Branch (55:19): [True: 157M, False: 14.2M]
  ------------------
   56|   157M|    cdf_ptr[i * cdf_stride + nsymbs] = 0;
   57|   157M|  }
   58|  14.2M|}
entropy.c:reset_nmv_counter:
   71|   203k|static inline void reset_nmv_counter(nmv_context *nmv) {
   72|   203k|  RESET_CDF_COUNTER(nmv->joints_cdf, 4);
  ------------------
  |  |   61|   203k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   203k|  do {                                                               \
  |  |  |  |   65|   203k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   203k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   203k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   203k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   203k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|   610k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (73:19): [True: 406k, False: 203k]
  ------------------
   74|   406k|    RESET_CDF_COUNTER(nmv->comps[i].classes_cdf, MV_CLASSES);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|   406k|    RESET_CDF_COUNTER(nmv->comps[i].class0_fp_cdf, MV_FP_SIZE);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|   406k|    RESET_CDF_COUNTER(nmv->comps[i].fp_cdf, MV_FP_SIZE);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|   406k|    RESET_CDF_COUNTER(nmv->comps[i].sign_cdf, 2);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|   406k|    RESET_CDF_COUNTER(nmv->comps[i].class0_hp_cdf, 2);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|   406k|    RESET_CDF_COUNTER(nmv->comps[i].hp_cdf, 2);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|   406k|    RESET_CDF_COUNTER(nmv->comps[i].class0_cdf, CLASS0_SIZE);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|   406k|    RESET_CDF_COUNTER(nmv->comps[i].bits_cdf, 2);
  ------------------
  |  |   61|   406k|  RESET_CDF_COUNTER_STRIDE(cname, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  |   64|   406k|  do {                                                               \
  |  |  |  |   65|   406k|    aom_cdf_prob *cdf_ptr = (aom_cdf_prob *)cname;                   \
  |  |  |  |   66|   406k|    int array_size = (int)sizeof(cname) / sizeof(aom_cdf_prob);      \
  |  |  |  |   67|   406k|    int num_cdfs = array_size / cdf_stride;                          \
  |  |  |  |   68|   406k|    reset_cdf_symbol_counter(cdf_ptr, num_cdfs, cdf_stride, nsymbs); \
  |  |  |  |   69|   406k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:12): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|   406k|  }
   83|   203k|}

decodetxb.c:get_entropy_context:
   88|   645k|                                      const ENTROPY_CONTEXT *l) {
   89|   645k|  ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
   90|       |
   91|   645k|  switch (tx_size) {
   92|   368k|    case TX_4X4:
  ------------------
  |  Branch (92:5): [True: 368k, False: 277k]
  ------------------
   93|   368k|      above_ec = a[0] != 0;
   94|   368k|      left_ec = l[0] != 0;
   95|   368k|      break;
   96|   131k|    case TX_4X8:
  ------------------
  |  Branch (96:5): [True: 131k, False: 514k]
  ------------------
   97|   131k|      above_ec = a[0] != 0;
   98|   131k|      left_ec = !!*(const uint16_t *)l;
   99|   131k|      break;
  100|  3.92k|    case TX_8X4:
  ------------------
  |  Branch (100:5): [True: 3.92k, False: 642k]
  ------------------
  101|  3.92k|      above_ec = !!*(const uint16_t *)a;
  102|  3.92k|      left_ec = l[0] != 0;
  103|  3.92k|      break;
  104|  16.4k|    case TX_8X16:
  ------------------
  |  Branch (104:5): [True: 16.4k, False: 629k]
  ------------------
  105|  16.4k|      above_ec = !!*(const uint16_t *)a;
  106|  16.4k|      left_ec = !!*(const uint32_t *)l;
  107|  16.4k|      break;
  108|  2.10k|    case TX_16X8:
  ------------------
  |  Branch (108:5): [True: 2.10k, False: 643k]
  ------------------
  109|  2.10k|      above_ec = !!*(const uint32_t *)a;
  110|  2.10k|      left_ec = !!*(const uint16_t *)l;
  111|  2.10k|      break;
  112|  2.63k|    case TX_16X32:
  ------------------
  |  Branch (112:5): [True: 2.63k, False: 643k]
  ------------------
  113|  2.63k|      above_ec = !!*(const uint32_t *)a;
  114|  2.63k|      left_ec = !!*(const uint64_t *)l;
  115|  2.63k|      break;
  116|    191|    case TX_32X16:
  ------------------
  |  Branch (116:5): [True: 191, False: 645k]
  ------------------
  117|    191|      above_ec = !!*(const uint64_t *)a;
  118|    191|      left_ec = !!*(const uint32_t *)l;
  119|    191|      break;
  120|   108k|    case TX_8X8:
  ------------------
  |  Branch (120:5): [True: 108k, False: 537k]
  ------------------
  121|   108k|      above_ec = !!*(const uint16_t *)a;
  122|   108k|      left_ec = !!*(const uint16_t *)l;
  123|   108k|      break;
  124|  10.2k|    case TX_16X16:
  ------------------
  |  Branch (124:5): [True: 10.2k, False: 635k]
  ------------------
  125|  10.2k|      above_ec = !!*(const uint32_t *)a;
  126|  10.2k|      left_ec = !!*(const uint32_t *)l;
  127|  10.2k|      break;
  128|  2.64k|    case TX_32X32:
  ------------------
  |  Branch (128:5): [True: 2.64k, False: 643k]
  ------------------
  129|  2.64k|      above_ec = !!*(const uint64_t *)a;
  130|  2.64k|      left_ec = !!*(const uint64_t *)l;
  131|  2.64k|      break;
  132|      0|    case TX_64X64:
  ------------------
  |  Branch (132:5): [True: 0, False: 645k]
  ------------------
  133|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  134|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  135|      0|      break;
  136|      0|    case TX_32X64:
  ------------------
  |  Branch (136:5): [True: 0, False: 645k]
  ------------------
  137|      0|      above_ec = !!*(const uint64_t *)a;
  138|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  139|      0|      break;
  140|      0|    case TX_64X32:
  ------------------
  |  Branch (140:5): [True: 0, False: 645k]
  ------------------
  141|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  142|      0|      left_ec = !!*(const uint64_t *)l;
  143|      0|      break;
  144|      0|    case TX_4X16:
  ------------------
  |  Branch (144:5): [True: 0, False: 645k]
  ------------------
  145|      0|      above_ec = a[0] != 0;
  146|      0|      left_ec = !!*(const uint32_t *)l;
  147|      0|      break;
  148|      0|    case TX_16X4:
  ------------------
  |  Branch (148:5): [True: 0, False: 645k]
  ------------------
  149|      0|      above_ec = !!*(const uint32_t *)a;
  150|      0|      left_ec = l[0] != 0;
  151|      0|      break;
  152|      0|    case TX_8X32:
  ------------------
  |  Branch (152:5): [True: 0, False: 645k]
  ------------------
  153|      0|      above_ec = !!*(const uint16_t *)a;
  154|      0|      left_ec = !!*(const uint64_t *)l;
  155|      0|      break;
  156|      0|    case TX_32X8:
  ------------------
  |  Branch (156:5): [True: 0, False: 645k]
  ------------------
  157|      0|      above_ec = !!*(const uint64_t *)a;
  158|      0|      left_ec = !!*(const uint16_t *)l;
  159|      0|      break;
  160|      0|    case TX_16X64:
  ------------------
  |  Branch (160:5): [True: 0, False: 645k]
  ------------------
  161|      0|      above_ec = !!*(const uint32_t *)a;
  162|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  163|      0|      break;
  164|      0|    case TX_64X16:
  ------------------
  |  Branch (164:5): [True: 0, False: 645k]
  ------------------
  165|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  166|      0|      left_ec = !!*(const uint32_t *)l;
  167|      0|      break;
  168|      0|    default: assert(0 && "Invalid transform size."); break;
  ------------------
  |  Branch (168:5): [True: 0, False: 645k]
  ------------------
  169|   645k|  }
  170|   646k|  return combine_entropy_contexts(above_ec, left_ec);
  171|   645k|}
decodetxb.c:combine_entropy_contexts:
   83|   646k|                                           ENTROPY_CONTEXT b) {
   84|   646k|  return (a != 0) + (b != 0);
   85|   646k|}
decodetxb.c:get_txsize_entropy_ctx:
  173|  2.02M|static inline TX_SIZE get_txsize_entropy_ctx(TX_SIZE txsize) {
  174|  2.02M|  return (TX_SIZE)((txsize_sqr_map[txsize] + txsize_sqr_up_map[txsize] + 1) >>
  175|  2.02M|                   1);
  176|  2.02M|}
encodemb.c:get_txsize_entropy_ctx:
  173|  2.77M|static inline TX_SIZE get_txsize_entropy_ctx(TX_SIZE txsize) {
  174|  2.77M|  return (TX_SIZE)((txsize_sqr_map[txsize] + txsize_sqr_up_map[txsize] + 1) >>
  175|  2.77M|                   1);
  176|  2.77M|}
encodemb.c:get_entropy_context:
   88|  4.49M|                                      const ENTROPY_CONTEXT *l) {
   89|  4.49M|  ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
   90|       |
   91|  4.49M|  switch (tx_size) {
   92|  2.44M|    case TX_4X4:
  ------------------
  |  Branch (92:5): [True: 2.44M, False: 2.05M]
  ------------------
   93|  2.44M|      above_ec = a[0] != 0;
   94|  2.44M|      left_ec = l[0] != 0;
   95|  2.44M|      break;
   96|  1.07M|    case TX_4X8:
  ------------------
  |  Branch (96:5): [True: 1.07M, False: 3.41M]
  ------------------
   97|  1.07M|      above_ec = a[0] != 0;
   98|  1.07M|      left_ec = !!*(const uint16_t *)l;
   99|  1.07M|      break;
  100|  50.9k|    case TX_8X4:
  ------------------
  |  Branch (100:5): [True: 50.9k, False: 4.44M]
  ------------------
  101|  50.9k|      above_ec = !!*(const uint16_t *)a;
  102|  50.9k|      left_ec = l[0] != 0;
  103|  50.9k|      break;
  104|  45.6k|    case TX_8X16:
  ------------------
  |  Branch (104:5): [True: 45.6k, False: 4.45M]
  ------------------
  105|  45.6k|      above_ec = !!*(const uint16_t *)a;
  106|  45.6k|      left_ec = !!*(const uint32_t *)l;
  107|  45.6k|      break;
  108|  12.3k|    case TX_16X8:
  ------------------
  |  Branch (108:5): [True: 12.3k, False: 4.48M]
  ------------------
  109|  12.3k|      above_ec = !!*(const uint32_t *)a;
  110|  12.3k|      left_ec = !!*(const uint16_t *)l;
  111|  12.3k|      break;
  112|  1.00k|    case TX_16X32:
  ------------------
  |  Branch (112:5): [True: 1.00k, False: 4.49M]
  ------------------
  113|  1.00k|      above_ec = !!*(const uint32_t *)a;
  114|  1.00k|      left_ec = !!*(const uint64_t *)l;
  115|  1.00k|      break;
  116|    298|    case TX_32X16:
  ------------------
  |  Branch (116:5): [True: 298, False: 4.49M]
  ------------------
  117|    298|      above_ec = !!*(const uint64_t *)a;
  118|    298|      left_ec = !!*(const uint32_t *)l;
  119|    298|      break;
  120|   844k|    case TX_8X8:
  ------------------
  |  Branch (120:5): [True: 844k, False: 3.65M]
  ------------------
  121|   844k|      above_ec = !!*(const uint16_t *)a;
  122|   844k|      left_ec = !!*(const uint16_t *)l;
  123|   844k|      break;
  124|  16.8k|    case TX_16X16:
  ------------------
  |  Branch (124:5): [True: 16.8k, False: 4.47M]
  ------------------
  125|  16.8k|      above_ec = !!*(const uint32_t *)a;
  126|  16.8k|      left_ec = !!*(const uint32_t *)l;
  127|  16.8k|      break;
  128|  2.57k|    case TX_32X32:
  ------------------
  |  Branch (128:5): [True: 2.57k, False: 4.49M]
  ------------------
  129|  2.57k|      above_ec = !!*(const uint64_t *)a;
  130|  2.57k|      left_ec = !!*(const uint64_t *)l;
  131|  2.57k|      break;
  132|      0|    case TX_64X64:
  ------------------
  |  Branch (132:5): [True: 0, False: 4.49M]
  ------------------
  133|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  134|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  135|      0|      break;
  136|      0|    case TX_32X64:
  ------------------
  |  Branch (136:5): [True: 0, False: 4.49M]
  ------------------
  137|      0|      above_ec = !!*(const uint64_t *)a;
  138|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  139|      0|      break;
  140|      0|    case TX_64X32:
  ------------------
  |  Branch (140:5): [True: 0, False: 4.49M]
  ------------------
  141|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  142|      0|      left_ec = !!*(const uint64_t *)l;
  143|      0|      break;
  144|      0|    case TX_4X16:
  ------------------
  |  Branch (144:5): [True: 0, False: 4.49M]
  ------------------
  145|      0|      above_ec = a[0] != 0;
  146|      0|      left_ec = !!*(const uint32_t *)l;
  147|      0|      break;
  148|      0|    case TX_16X4:
  ------------------
  |  Branch (148:5): [True: 0, False: 4.49M]
  ------------------
  149|      0|      above_ec = !!*(const uint32_t *)a;
  150|      0|      left_ec = l[0] != 0;
  151|      0|      break;
  152|      0|    case TX_8X32:
  ------------------
  |  Branch (152:5): [True: 0, False: 4.49M]
  ------------------
  153|      0|      above_ec = !!*(const uint16_t *)a;
  154|      0|      left_ec = !!*(const uint64_t *)l;
  155|      0|      break;
  156|      0|    case TX_32X8:
  ------------------
  |  Branch (156:5): [True: 0, False: 4.49M]
  ------------------
  157|      0|      above_ec = !!*(const uint64_t *)a;
  158|      0|      left_ec = !!*(const uint16_t *)l;
  159|      0|      break;
  160|      0|    case TX_16X64:
  ------------------
  |  Branch (160:5): [True: 0, False: 4.49M]
  ------------------
  161|      0|      above_ec = !!*(const uint32_t *)a;
  162|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  163|      0|      break;
  164|      0|    case TX_64X16:
  ------------------
  |  Branch (164:5): [True: 0, False: 4.49M]
  ------------------
  165|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  166|      0|      left_ec = !!*(const uint32_t *)l;
  167|      0|      break;
  168|      0|    default: assert(0 && "Invalid transform size."); break;
  ------------------
  |  Branch (168:5): [True: 0, False: 4.49M]
  ------------------
  169|  4.49M|  }
  170|  4.49M|  return combine_entropy_contexts(above_ec, left_ec);
  171|  4.49M|}
encodemb.c:combine_entropy_contexts:
   83|  4.49M|                                           ENTROPY_CONTEXT b) {
   84|  4.49M|  return (a != 0) + (b != 0);
   85|  4.49M|}
encodetxb.c:get_txsize_entropy_ctx:
  173|  15.5M|static inline TX_SIZE get_txsize_entropy_ctx(TX_SIZE txsize) {
  174|  15.5M|  return (TX_SIZE)((txsize_sqr_map[txsize] + txsize_sqr_up_map[txsize] + 1) >>
  175|  15.5M|                   1);
  176|  15.5M|}
encodetxb.c:get_entropy_context:
   88|  1.65M|                                      const ENTROPY_CONTEXT *l) {
   89|  1.65M|  ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
   90|       |
   91|  1.65M|  switch (tx_size) {
   92|   910k|    case TX_4X4:
  ------------------
  |  Branch (92:5): [True: 910k, False: 744k]
  ------------------
   93|   910k|      above_ec = a[0] != 0;
   94|   910k|      left_ec = l[0] != 0;
   95|   910k|      break;
   96|   349k|    case TX_4X8:
  ------------------
  |  Branch (96:5): [True: 349k, False: 1.30M]
  ------------------
   97|   349k|      above_ec = a[0] != 0;
   98|   349k|      left_ec = !!*(const uint16_t *)l;
   99|   349k|      break;
  100|  12.1k|    case TX_8X4:
  ------------------
  |  Branch (100:5): [True: 12.1k, False: 1.64M]
  ------------------
  101|  12.1k|      above_ec = !!*(const uint16_t *)a;
  102|  12.1k|      left_ec = l[0] != 0;
  103|  12.1k|      break;
  104|  40.0k|    case TX_8X16:
  ------------------
  |  Branch (104:5): [True: 40.0k, False: 1.61M]
  ------------------
  105|  40.0k|      above_ec = !!*(const uint16_t *)a;
  106|  40.0k|      left_ec = !!*(const uint32_t *)l;
  107|  40.0k|      break;
  108|  6.37k|    case TX_16X8:
  ------------------
  |  Branch (108:5): [True: 6.37k, False: 1.64M]
  ------------------
  109|  6.37k|      above_ec = !!*(const uint32_t *)a;
  110|  6.37k|      left_ec = !!*(const uint16_t *)l;
  111|  6.37k|      break;
  112|  5.76k|    case TX_16X32:
  ------------------
  |  Branch (112:5): [True: 5.76k, False: 1.65M]
  ------------------
  113|  5.76k|      above_ec = !!*(const uint32_t *)a;
  114|  5.76k|      left_ec = !!*(const uint64_t *)l;
  115|  5.76k|      break;
  116|    506|    case TX_32X16:
  ------------------
  |  Branch (116:5): [True: 506, False: 1.65M]
  ------------------
  117|    506|      above_ec = !!*(const uint64_t *)a;
  118|    506|      left_ec = !!*(const uint32_t *)l;
  119|    506|      break;
  120|   299k|    case TX_8X8:
  ------------------
  |  Branch (120:5): [True: 299k, False: 1.35M]
  ------------------
  121|   299k|      above_ec = !!*(const uint16_t *)a;
  122|   299k|      left_ec = !!*(const uint16_t *)l;
  123|   299k|      break;
  124|  25.7k|    case TX_16X16:
  ------------------
  |  Branch (124:5): [True: 25.7k, False: 1.63M]
  ------------------
  125|  25.7k|      above_ec = !!*(const uint32_t *)a;
  126|  25.7k|      left_ec = !!*(const uint32_t *)l;
  127|  25.7k|      break;
  128|  5.70k|    case TX_32X32:
  ------------------
  |  Branch (128:5): [True: 5.70k, False: 1.65M]
  ------------------
  129|  5.70k|      above_ec = !!*(const uint64_t *)a;
  130|  5.70k|      left_ec = !!*(const uint64_t *)l;
  131|  5.70k|      break;
  132|      0|    case TX_64X64:
  ------------------
  |  Branch (132:5): [True: 0, False: 1.65M]
  ------------------
  133|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  134|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  135|      0|      break;
  136|      0|    case TX_32X64:
  ------------------
  |  Branch (136:5): [True: 0, False: 1.65M]
  ------------------
  137|      0|      above_ec = !!*(const uint64_t *)a;
  138|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  139|      0|      break;
  140|      0|    case TX_64X32:
  ------------------
  |  Branch (140:5): [True: 0, False: 1.65M]
  ------------------
  141|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  142|      0|      left_ec = !!*(const uint64_t *)l;
  143|      0|      break;
  144|      0|    case TX_4X16:
  ------------------
  |  Branch (144:5): [True: 0, False: 1.65M]
  ------------------
  145|      0|      above_ec = a[0] != 0;
  146|      0|      left_ec = !!*(const uint32_t *)l;
  147|      0|      break;
  148|      0|    case TX_16X4:
  ------------------
  |  Branch (148:5): [True: 0, False: 1.65M]
  ------------------
  149|      0|      above_ec = !!*(const uint32_t *)a;
  150|      0|      left_ec = l[0] != 0;
  151|      0|      break;
  152|      0|    case TX_8X32:
  ------------------
  |  Branch (152:5): [True: 0, False: 1.65M]
  ------------------
  153|      0|      above_ec = !!*(const uint16_t *)a;
  154|      0|      left_ec = !!*(const uint64_t *)l;
  155|      0|      break;
  156|      0|    case TX_32X8:
  ------------------
  |  Branch (156:5): [True: 0, False: 1.65M]
  ------------------
  157|      0|      above_ec = !!*(const uint64_t *)a;
  158|      0|      left_ec = !!*(const uint16_t *)l;
  159|      0|      break;
  160|      0|    case TX_16X64:
  ------------------
  |  Branch (160:5): [True: 0, False: 1.65M]
  ------------------
  161|      0|      above_ec = !!*(const uint32_t *)a;
  162|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  163|      0|      break;
  164|      0|    case TX_64X16:
  ------------------
  |  Branch (164:5): [True: 0, False: 1.65M]
  ------------------
  165|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  166|      0|      left_ec = !!*(const uint32_t *)l;
  167|      0|      break;
  168|      0|    default: assert(0 && "Invalid transform size."); break;
  ------------------
  |  Branch (168:5): [True: 0, False: 1.65M]
  ------------------
  169|  1.65M|  }
  170|  1.65M|  return combine_entropy_contexts(above_ec, left_ec);
  171|  1.65M|}
encodetxb.c:combine_entropy_contexts:
   83|  1.65M|                                           ENTROPY_CONTEXT b) {
   84|  1.65M|  return (a != 0) + (b != 0);
   85|  1.65M|}
tx_search.c:get_entropy_context:
   88|  31.6M|                                      const ENTROPY_CONTEXT *l) {
   89|  31.6M|  ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
   90|       |
   91|  31.6M|  switch (tx_size) {
   92|  18.9M|    case TX_4X4:
  ------------------
  |  Branch (92:5): [True: 18.9M, False: 12.7M]
  ------------------
   93|  18.9M|      above_ec = a[0] != 0;
   94|  18.9M|      left_ec = l[0] != 0;
   95|  18.9M|      break;
   96|  6.50M|    case TX_4X8:
  ------------------
  |  Branch (96:5): [True: 6.50M, False: 25.1M]
  ------------------
   97|  6.50M|      above_ec = a[0] != 0;
   98|  6.50M|      left_ec = !!*(const uint16_t *)l;
   99|  6.50M|      break;
  100|  1.01M|    case TX_8X4:
  ------------------
  |  Branch (100:5): [True: 1.01M, False: 30.6M]
  ------------------
  101|  1.01M|      above_ec = !!*(const uint16_t *)a;
  102|  1.01M|      left_ec = l[0] != 0;
  103|  1.01M|      break;
  104|   341k|    case TX_8X16:
  ------------------
  |  Branch (104:5): [True: 341k, False: 31.3M]
  ------------------
  105|   341k|      above_ec = !!*(const uint16_t *)a;
  106|   341k|      left_ec = !!*(const uint32_t *)l;
  107|   341k|      break;
  108|   151k|    case TX_16X8:
  ------------------
  |  Branch (108:5): [True: 151k, False: 31.5M]
  ------------------
  109|   151k|      above_ec = !!*(const uint32_t *)a;
  110|   151k|      left_ec = !!*(const uint16_t *)l;
  111|   151k|      break;
  112|  11.8k|    case TX_16X32:
  ------------------
  |  Branch (112:5): [True: 11.8k, False: 31.6M]
  ------------------
  113|  11.8k|      above_ec = !!*(const uint32_t *)a;
  114|  11.8k|      left_ec = !!*(const uint64_t *)l;
  115|  11.8k|      break;
  116|  2.90k|    case TX_32X16:
  ------------------
  |  Branch (116:5): [True: 2.90k, False: 31.6M]
  ------------------
  117|  2.90k|      above_ec = !!*(const uint64_t *)a;
  118|  2.90k|      left_ec = !!*(const uint32_t *)l;
  119|  2.90k|      break;
  120|  4.54M|    case TX_8X8:
  ------------------
  |  Branch (120:5): [True: 4.54M, False: 27.1M]
  ------------------
  121|  4.54M|      above_ec = !!*(const uint16_t *)a;
  122|  4.54M|      left_ec = !!*(const uint16_t *)l;
  123|  4.54M|      break;
  124|   147k|    case TX_16X16:
  ------------------
  |  Branch (124:5): [True: 147k, False: 31.5M]
  ------------------
  125|   147k|      above_ec = !!*(const uint32_t *)a;
  126|   147k|      left_ec = !!*(const uint32_t *)l;
  127|   147k|      break;
  128|  44.3k|    case TX_32X32:
  ------------------
  |  Branch (128:5): [True: 44.3k, False: 31.6M]
  ------------------
  129|  44.3k|      above_ec = !!*(const uint64_t *)a;
  130|  44.3k|      left_ec = !!*(const uint64_t *)l;
  131|  44.3k|      break;
  132|      0|    case TX_64X64:
  ------------------
  |  Branch (132:5): [True: 0, False: 31.6M]
  ------------------
  133|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  134|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  135|      0|      break;
  136|      0|    case TX_32X64:
  ------------------
  |  Branch (136:5): [True: 0, False: 31.6M]
  ------------------
  137|      0|      above_ec = !!*(const uint64_t *)a;
  138|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  139|      0|      break;
  140|      0|    case TX_64X32:
  ------------------
  |  Branch (140:5): [True: 0, False: 31.6M]
  ------------------
  141|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  142|      0|      left_ec = !!*(const uint64_t *)l;
  143|      0|      break;
  144|      0|    case TX_4X16:
  ------------------
  |  Branch (144:5): [True: 0, False: 31.6M]
  ------------------
  145|      0|      above_ec = a[0] != 0;
  146|      0|      left_ec = !!*(const uint32_t *)l;
  147|      0|      break;
  148|      0|    case TX_16X4:
  ------------------
  |  Branch (148:5): [True: 0, False: 31.6M]
  ------------------
  149|      0|      above_ec = !!*(const uint32_t *)a;
  150|      0|      left_ec = l[0] != 0;
  151|      0|      break;
  152|      0|    case TX_8X32:
  ------------------
  |  Branch (152:5): [True: 0, False: 31.6M]
  ------------------
  153|      0|      above_ec = !!*(const uint16_t *)a;
  154|      0|      left_ec = !!*(const uint64_t *)l;
  155|      0|      break;
  156|      0|    case TX_32X8:
  ------------------
  |  Branch (156:5): [True: 0, False: 31.6M]
  ------------------
  157|      0|      above_ec = !!*(const uint64_t *)a;
  158|      0|      left_ec = !!*(const uint16_t *)l;
  159|      0|      break;
  160|      0|    case TX_16X64:
  ------------------
  |  Branch (160:5): [True: 0, False: 31.6M]
  ------------------
  161|      0|      above_ec = !!*(const uint32_t *)a;
  162|      0|      left_ec = !!(*(const uint64_t *)l | *(const uint64_t *)(l + 8));
  163|      0|      break;
  164|      0|    case TX_64X16:
  ------------------
  |  Branch (164:5): [True: 0, False: 31.6M]
  ------------------
  165|      0|      above_ec = !!(*(const uint64_t *)a | *(const uint64_t *)(a + 8));
  166|      0|      left_ec = !!*(const uint32_t *)l;
  167|      0|      break;
  168|      0|    default: assert(0 && "Invalid transform size."); break;
  ------------------
  |  Branch (168:5): [True: 0, False: 31.6M]
  ------------------
  169|  31.6M|  }
  170|  31.6M|  return combine_entropy_contexts(above_ec, left_ec);
  171|  31.6M|}
tx_search.c:combine_entropy_contexts:
   83|  31.6M|                                           ENTROPY_CONTEXT b) {
   84|  31.6M|  return (a != 0) + (b != 0);
   85|  31.6M|}
tx_search.c:get_txsize_entropy_ctx:
  173|  1.50M|static inline TX_SIZE get_txsize_entropy_ctx(TX_SIZE txsize) {
  174|  1.50M|  return (TX_SIZE)((txsize_sqr_map[txsize] + txsize_sqr_up_map[txsize] + 1) >>
  175|  1.50M|                   1);
  176|  1.50M|}
txb_rdopt.c:get_txsize_entropy_ctx:
  173|   127M|static inline TX_SIZE get_txsize_entropy_ctx(TX_SIZE txsize) {
  174|   127M|  return (TX_SIZE)((txsize_sqr_map[txsize] + txsize_sqr_up_map[txsize] + 1) >>
  175|   127M|                   1);
  176|   127M|}

av1_get_palette_color_index_context:
  895|  1.24M|                                        uint8_t *color_order, int *color_idx) {
  896|  1.24M|  assert(palette_size <= PALETTE_MAX_SIZE);
  897|  1.24M|  assert(r > 0 || c > 0);
  898|       |
  899|       |  // Get color indices of neighbors.
  900|  1.24M|  int color_neighbors[NUM_PALETTE_NEIGHBORS];
  901|  1.24M|  color_neighbors[0] = (c - 1 >= 0) ? color_map[r * stride + c - 1] : -1;
  ------------------
  |  Branch (901:24): [True: 1.10M, False: 139k]
  ------------------
  902|  1.24M|  color_neighbors[1] =
  903|  1.24M|      (c - 1 >= 0 && r - 1 >= 0) ? color_map[(r - 1) * stride + c - 1] : -1;
  ------------------
  |  Branch (903:8): [True: 1.11M, False: 138k]
  |  Branch (903:22): [True: 973k, False: 137k]
  ------------------
  904|  1.24M|  color_neighbors[2] = (r - 1 >= 0) ? color_map[(r - 1) * stride + c] : -1;
  ------------------
  |  Branch (904:24): [True: 1.10M, False: 144k]
  ------------------
  905|       |
  906|       |  // The +10 below should not be needed. But we get a warning "array subscript
  907|       |  // is above array bounds [-Werror=array-bounds]" without it, possibly due to
  908|       |  // this (or similar) bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
  909|  1.24M|  int scores[PALETTE_MAX_SIZE + 10] = { 0 };
  910|  1.24M|  int i;
  911|  1.24M|  static const int weights[NUM_PALETTE_NEIGHBORS] = { 2, 1, 2 };
  912|  4.95M|  for (i = 0; i < NUM_PALETTE_NEIGHBORS; ++i) {
  ------------------
  |  |   60|  4.95M|#define NUM_PALETTE_NEIGHBORS 3  // left, top-left and top.
  ------------------
  |  Branch (912:15): [True: 3.70M, False: 1.24M]
  ------------------
  913|  3.70M|    if (color_neighbors[i] >= 0) {
  ------------------
  |  Branch (913:9): [True: 3.13M, False: 570k]
  ------------------
  914|  3.13M|      scores[color_neighbors[i]] += weights[i];
  915|  3.13M|    }
  916|  3.70M|  }
  917|       |
  918|  1.24M|  int inverse_color_order[PALETTE_MAX_SIZE];
  919|  11.2M|  for (i = 0; i < PALETTE_MAX_SIZE; ++i) {
  ------------------
  |  |   63|  11.2M|#define PALETTE_MAX_SIZE 8
  ------------------
  |  Branch (919:15): [True: 9.95M, False: 1.24M]
  ------------------
  920|  9.95M|    color_order[i] = i;
  921|  9.95M|    inverse_color_order[i] = i;
  922|  9.95M|  }
  923|       |
  924|       |  // Get the top NUM_PALETTE_NEIGHBORS scores (sorted from large to small).
  925|  4.99M|  for (i = 0; i < NUM_PALETTE_NEIGHBORS; ++i) {
  ------------------
  |  |   60|  4.99M|#define NUM_PALETTE_NEIGHBORS 3  // left, top-left and top.
  ------------------
  |  Branch (925:15): [True: 3.74M, False: 1.24M]
  ------------------
  926|  3.74M|    int max = scores[i];
  927|  3.74M|    int max_idx = i;
  928|  13.9M|    for (int j = i + 1; j < palette_size; ++j) {
  ------------------
  |  Branch (928:25): [True: 10.1M, False: 3.74M]
  ------------------
  929|  10.1M|      if (scores[j] > max) {
  ------------------
  |  Branch (929:11): [True: 1.29M, False: 8.89M]
  ------------------
  930|  1.29M|        max = scores[j];
  931|  1.29M|        max_idx = j;
  932|  1.29M|      }
  933|  10.1M|    }
  934|  3.74M|    if (max_idx != i) {
  ------------------
  |  Branch (934:9): [True: 1.16M, False: 2.57M]
  ------------------
  935|       |      // Move the score at index 'max_idx' to index 'i', and shift the scores
  936|       |      // from 'i' to 'max_idx - 1' by 1.
  937|  1.16M|      const int max_score = scores[max_idx];
  938|  1.16M|      const uint8_t max_color_order = color_order[max_idx];
  939|  4.21M|      for (int k = max_idx; k > i; --k) {
  ------------------
  |  Branch (939:29): [True: 3.04M, False: 1.16M]
  ------------------
  940|  3.04M|        scores[k] = scores[k - 1];
  941|  3.04M|        color_order[k] = color_order[k - 1];
  942|  3.04M|        inverse_color_order[color_order[k]] = k;
  943|  3.04M|      }
  944|  1.16M|      scores[i] = max_score;
  945|  1.16M|      color_order[i] = max_color_order;
  946|  1.16M|      inverse_color_order[color_order[i]] = i;
  947|  1.16M|    }
  948|  3.74M|  }
  949|       |
  950|  1.24M|  if (color_idx != NULL)
  ------------------
  |  Branch (950:7): [True: 0, False: 1.24M]
  ------------------
  951|      0|    *color_idx = inverse_color_order[color_map[r * stride + c]];
  952|       |
  953|       |  // Get hash value of context.
  954|  1.24M|  int color_index_ctx_hash = 0;
  955|  1.24M|  static const int hash_multipliers[NUM_PALETTE_NEIGHBORS] = { 1, 2, 2 };
  956|  5.11M|  for (i = 0; i < NUM_PALETTE_NEIGHBORS; ++i) {
  ------------------
  |  |   60|  5.11M|#define NUM_PALETTE_NEIGHBORS 3  // left, top-left and top.
  ------------------
  |  Branch (956:15): [True: 3.86M, False: 1.24M]
  ------------------
  957|  3.86M|    color_index_ctx_hash += scores[i] * hash_multipliers[i];
  958|  3.86M|  }
  959|  1.24M|  assert(color_index_ctx_hash > 0);
  960|  1.24M|  assert(color_index_ctx_hash <= MAX_COLOR_CONTEXT_HASH);
  961|       |
  962|       |  // Lookup context from hash.
  963|  1.24M|  const int color_index_ctx =
  964|  1.24M|      av1_palette_color_index_context_lookup[color_index_ctx_hash];
  965|  1.24M|  assert(color_index_ctx >= 0);
  966|       |  assert(color_index_ctx < PALETTE_COLOR_INDEX_CONTEXTS);
  967|  1.24M|  return color_index_ctx;
  968|  1.24M|}
av1_init_mode_probs:
  970|  59.2k|void av1_init_mode_probs(FRAME_CONTEXT *fc) {
  971|  59.2k|  av1_copy(fc->palette_y_size_cdf, default_palette_y_size_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  972|  59.2k|  av1_copy(fc->palette_uv_size_cdf, default_palette_uv_size_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  973|  59.2k|  av1_copy(fc->palette_y_color_index_cdf, default_palette_y_color_index_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  974|  59.2k|  av1_copy(fc->palette_uv_color_index_cdf, default_palette_uv_color_index_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  975|  59.2k|  av1_copy(fc->kf_y_cdf, default_kf_y_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  976|  59.2k|  av1_copy(fc->angle_delta_cdf, default_angle_delta_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  977|  59.2k|  av1_copy(fc->comp_inter_cdf, default_comp_inter_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  978|  59.2k|  av1_copy(fc->comp_ref_type_cdf, default_comp_ref_type_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  979|  59.2k|  av1_copy(fc->uni_comp_ref_cdf, default_uni_comp_ref_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  980|  59.2k|  av1_copy(fc->palette_y_mode_cdf, default_palette_y_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  981|  59.2k|  av1_copy(fc->palette_uv_mode_cdf, default_palette_uv_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  982|  59.2k|  av1_copy(fc->comp_ref_cdf, default_comp_ref_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  983|  59.2k|  av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  984|  59.2k|  av1_copy(fc->single_ref_cdf, default_single_ref_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  985|  59.2k|  av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  986|  59.2k|  av1_copy(fc->compound_index_cdf, default_compound_idx_cdfs);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  987|  59.2k|  av1_copy(fc->comp_group_idx_cdf, default_comp_group_idx_cdfs);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  988|  59.2k|  av1_copy(fc->newmv_cdf, default_newmv_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  989|  59.2k|  av1_copy(fc->zeromv_cdf, default_zeromv_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  990|  59.2k|  av1_copy(fc->refmv_cdf, default_refmv_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  991|  59.2k|  av1_copy(fc->drl_cdf, default_drl_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  992|  59.2k|  av1_copy(fc->motion_mode_cdf, default_motion_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  993|  59.2k|  av1_copy(fc->obmc_cdf, default_obmc_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  994|  59.2k|  av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  995|  59.2k|  av1_copy(fc->compound_type_cdf, default_compound_type_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  996|  59.2k|  av1_copy(fc->wedge_idx_cdf, default_wedge_idx_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  997|  59.2k|  av1_copy(fc->interintra_cdf, default_interintra_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  998|  59.2k|  av1_copy(fc->wedge_interintra_cdf, default_wedge_interintra_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
  999|  59.2k|  av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1000|  59.2k|  av1_copy(fc->seg.pred_cdf, default_segment_pred_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1001|  59.2k|  av1_copy(fc->filter_intra_cdfs, default_filter_intra_cdfs);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1002|  59.2k|  av1_copy(fc->filter_intra_mode_cdf, default_filter_intra_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1003|  59.2k|  av1_copy(fc->switchable_restore_cdf, default_switchable_restore_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1004|  59.2k|  av1_copy(fc->wiener_restore_cdf, default_wiener_restore_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1005|  59.2k|  av1_copy(fc->sgrproj_restore_cdf, default_sgrproj_restore_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1006|  59.2k|  av1_copy(fc->y_mode_cdf, default_if_y_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1007|  59.2k|  av1_copy(fc->uv_mode_cdf, default_uv_mode_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1008|  59.2k|  av1_copy(fc->switchable_interp_cdf, default_switchable_interp_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1009|  59.2k|  av1_copy(fc->partition_cdf, default_partition_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1010|  59.2k|  av1_copy(fc->intra_ext_tx_cdf, default_intra_ext_tx_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1011|  59.2k|  av1_copy(fc->inter_ext_tx_cdf, default_inter_ext_tx_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1012|  59.2k|  av1_copy(fc->skip_mode_cdfs, default_skip_mode_cdfs);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1013|  59.2k|  av1_copy(fc->skip_txfm_cdfs, default_skip_txfm_cdfs);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1014|  59.2k|  av1_copy(fc->intra_inter_cdf, default_intra_inter_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1015|   237k|  for (int i = 0; i < SPATIAL_PREDICTION_PROBS; i++)
  ------------------
  |  |   27|   237k|#define SPATIAL_PREDICTION_PROBS 3
  ------------------
  |  Branch (1015:19): [True: 177k, False: 59.2k]
  ------------------
 1016|   177k|    av1_copy(fc->seg.spatial_pred_seg_cdf[i],
  ------------------
  |  |   31|   177k|  do {                                              \
  |  |   32|   177k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|   177k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|   177k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 177k]
  |  |  ------------------
  ------------------
 1017|  59.2k|             default_spatial_pred_seg_tree_cdf[i]);
 1018|  59.2k|  av1_copy(fc->tx_size_cdf, default_tx_size_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1019|  59.2k|  av1_copy(fc->delta_q_cdf, default_delta_q_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1020|  59.2k|  av1_copy(fc->delta_lf_cdf, default_delta_lf_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1021|  59.2k|  av1_copy(fc->delta_lf_multi_cdf, default_delta_lf_multi_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1022|  59.2k|  av1_copy(fc->cfl_sign_cdf, default_cfl_sign_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1023|  59.2k|  av1_copy(fc->cfl_alpha_cdf, default_cfl_alpha_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1024|       |  av1_copy(fc->intrabc_cdf, default_intrabc_cdf);
  ------------------
  |  |   31|  59.2k|  do {                                              \
  |  |   32|  59.2k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  59.2k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  59.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 1025|  59.2k|}
av1_set_default_ref_deltas:
 1027|   181k|void av1_set_default_ref_deltas(int8_t *ref_deltas) {
 1028|   181k|  assert(ref_deltas != NULL);
 1029|       |
 1030|   181k|  ref_deltas[INTRA_FRAME] = 1;
 1031|   181k|  ref_deltas[LAST_FRAME] = 0;
 1032|   181k|  ref_deltas[LAST2_FRAME] = ref_deltas[LAST_FRAME];
 1033|   181k|  ref_deltas[LAST3_FRAME] = ref_deltas[LAST_FRAME];
 1034|   181k|  ref_deltas[BWDREF_FRAME] = ref_deltas[LAST_FRAME];
 1035|   181k|  ref_deltas[GOLDEN_FRAME] = -1;
 1036|   181k|  ref_deltas[ALTREF2_FRAME] = -1;
 1037|   181k|  ref_deltas[ALTREF_FRAME] = -1;
 1038|   181k|}
av1_set_default_mode_deltas:
 1040|   181k|void av1_set_default_mode_deltas(int8_t *mode_deltas) {
 1041|   181k|  assert(mode_deltas != NULL);
 1042|       |
 1043|   181k|  mode_deltas[0] = 0;
 1044|   181k|  mode_deltas[1] = 0;
 1045|   181k|}
av1_setup_frame_contexts:
 1055|  59.2k|void av1_setup_frame_contexts(AV1_COMMON *cm) {
 1056|       |  // Store the frame context into a special slot (not associated with any
 1057|       |  // reference buffer), so that we can set up cm->pre_fc correctly later
 1058|       |  // This function must ONLY be called when cm->fc has been initialized with
 1059|       |  // default probs, either by av1_setup_past_independence or after manually
 1060|       |  // initializing them
 1061|  59.2k|  *cm->default_frame_context = *cm->fc;
 1062|       |  // TODO(jack.haughton@argondesign.com): don't think this should be necessary,
 1063|       |  // but could do with fuller testing
 1064|  59.2k|  if (cm->tiles.large_scale) {
  ------------------
  |  Branch (1064:7): [True: 0, False: 59.2k]
  ------------------
 1065|      0|    for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (1065:30): [True: 0, False: 0]
  ------------------
 1066|      0|      RefCntBuffer *const buf = get_ref_frame_buf(cm, i);
 1067|      0|      if (buf != NULL) buf->frame_context = *cm->fc;
  ------------------
  |  Branch (1067:11): [True: 0, False: 0]
  ------------------
 1068|      0|    }
 1069|      0|    for (int i = 0; i < cm->buffer_pool->num_frame_bufs; ++i)
  ------------------
  |  Branch (1069:21): [True: 0, False: 0]
  ------------------
 1070|      0|      cm->buffer_pool->frame_bufs[i].frame_context = *cm->fc;
 1071|      0|  }
 1072|  59.2k|}
av1_setup_past_independence:
 1074|  59.2k|void av1_setup_past_independence(AV1_COMMON *cm) {
 1075|       |  // Reset the segment feature data to the default stats:
 1076|       |  // Features disabled, 0, with delta coding (Default state).
 1077|  59.2k|  av1_clearall_segfeatures(&cm->seg);
 1078|       |
 1079|  59.2k|  if (cm->cur_frame->seg_map) {
  ------------------
  |  Branch (1079:7): [True: 59.2k, False: 0]
  ------------------
 1080|  59.2k|    memset(cm->cur_frame->seg_map, 0,
 1081|  59.2k|           (cm->cur_frame->mi_rows * cm->cur_frame->mi_cols));
 1082|  59.2k|  }
 1083|       |
 1084|       |  // reset mode ref deltas
 1085|  59.2k|  av1_set_default_ref_deltas(cm->cur_frame->ref_deltas);
 1086|  59.2k|  av1_set_default_mode_deltas(cm->cur_frame->mode_deltas);
 1087|  59.2k|  set_default_lf_deltas(&cm->lf);
 1088|       |
 1089|  59.2k|  av1_default_coef_probs(cm);
 1090|  59.2k|  av1_init_mode_probs(cm->fc);
 1091|  59.2k|  av1_init_mv_probs(cm);
 1092|  59.2k|  cm->fc->initialized = 1;
 1093|  59.2k|  av1_setup_frame_contexts(cm);
 1094|  59.2k|}
entropymode.c:set_default_lf_deltas:
 1047|  59.2k|static void set_default_lf_deltas(struct loopfilter *lf) {
 1048|  59.2k|  lf->mode_ref_delta_enabled = 1;
 1049|  59.2k|  lf->mode_ref_delta_update = 1;
 1050|       |
 1051|  59.2k|  av1_set_default_ref_deltas(lf->ref_deltas);
 1052|  59.2k|  av1_set_default_mode_deltas(lf->mode_deltas);
 1053|  59.2k|}

av1_init_mv_probs:
   63|  59.2k|void av1_init_mv_probs(AV1_COMMON *cm) {
   64|       |  // NB: this sets CDFs too
   65|  59.2k|  cm->fc->nmvc = default_nmv_context;
   66|  59.2k|  cm->fc->ndvc = default_nmv_context;
   67|  59.2k|}

decodemv.c:mv_joint_vertical:
   40|   105k|static inline int mv_joint_vertical(MV_JOINT_TYPE type) {
   41|   105k|  return type == MV_JOINT_HZVNZ || type == MV_JOINT_HNZVNZ;
  ------------------
  |  Branch (41:10): [True: 9.50k, False: 95.5k]
  |  Branch (41:36): [True: 86.0k, False: 9.47k]
  ------------------
   42|   105k|}
decodemv.c:mv_joint_horizontal:
   44|   104k|static inline int mv_joint_horizontal(MV_JOINT_TYPE type) {
   45|   104k|  return type == MV_JOINT_HNZVZ || type == MV_JOINT_HNZVNZ;
  ------------------
  |  Branch (45:10): [True: 9.45k, False: 95.5k]
  |  Branch (45:36): [True: 85.9k, False: 9.53k]
  ------------------
   46|   104k|}
encodemv.c:mv_joint_vertical:
   40|   552k|static inline int mv_joint_vertical(MV_JOINT_TYPE type) {
   41|   552k|  return type == MV_JOINT_HZVNZ || type == MV_JOINT_HNZVNZ;
  ------------------
  |  Branch (41:10): [True: 50.1k, False: 502k]
  |  Branch (41:36): [True: 454k, False: 48.5k]
  ------------------
   42|   552k|}
encodemv.c:mv_joint_horizontal:
   44|   552k|static inline int mv_joint_horizontal(MV_JOINT_TYPE type) {
   45|   552k|  return type == MV_JOINT_HNZVZ || type == MV_JOINT_HNZVNZ;
  ------------------
  |  Branch (45:10): [True: 48.4k, False: 504k]
  |  Branch (45:36): [True: 454k, False: 50.2k]
  ------------------
   46|   552k|}

decodeframe.c:av1_get_interp_filter_params_with_block_size:
  250|   590k|                                             const int w) {
  251|   590k|  if (w <= 4 && interp_filter != MULTITAP_SHARP2)
  ------------------
  |  Branch (251:7): [True: 120k, False: 469k]
  |  Branch (251:17): [True: 120k, False: 18.4E]
  ------------------
  252|   120k|    return &av1_interp_4tap[interp_filter];
  253|   469k|  return &av1_interp_filter_params_list[interp_filter];
  254|   590k|}
decodemv.c:av1_broadcast_interp_filter:
   87|  90.6k|    InterpFilter filter) {
   88|  90.6k|  int_interpfilters filters;
   89|  90.6k|  filters.as_filters.x_filter = filter;
   90|  90.6k|  filters.as_filters.y_filter = filter;
   91|  90.6k|  return filters;
   92|  90.6k|}
decodemv.c:av1_unswitchable_filter:
   94|  7.14k|static inline InterpFilter av1_unswitchable_filter(InterpFilter filter) {
   95|  7.14k|  return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter;
  ------------------
  |  Branch (95:10): [True: 4.52k, False: 2.62k]
  ------------------
   96|  7.14k|}
bitstream.c:av1_broadcast_interp_filter:
   87|  20.9k|    InterpFilter filter) {
   88|  20.9k|  int_interpfilters filters;
   89|  20.9k|  filters.as_filters.x_filter = filter;
   90|  20.9k|  filters.as_filters.y_filter = filter;
   91|  20.9k|  return filters;
   92|  20.9k|}
bitstream.c:av1_unswitchable_filter:
   94|  20.9k|static inline InterpFilter av1_unswitchable_filter(InterpFilter filter) {
   95|  20.9k|  return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter;
  ------------------
  |  Branch (95:10): [True: 12.2k, False: 8.67k]
  ------------------
   96|  20.9k|}
bitstream.c:av1_extract_interp_filter:
   81|   270k|                                                     int dir) {
   82|   270k|  return (InterpFilter)((dir) ? filters.as_filters.x_filter
  ------------------
  |  Branch (82:25): [True: 0, False: 270k]
  ------------------
   83|   270k|                              : filters.as_filters.y_filter);
   84|   270k|}
encodeframe_utils.c:av1_extract_interp_filter:
   81|  1.02M|                                                     int dir) {
   82|  1.02M|  return (InterpFilter)((dir) ? filters.as_filters.x_filter
  ------------------
  |  Branch (82:25): [True: 511k, False: 511k]
  ------------------
   83|  1.02M|                              : filters.as_filters.y_filter);
   84|  1.02M|}
partition_search.c:av1_extract_interp_filter:
   81|   490k|                                                     int dir) {
   82|   490k|  return (InterpFilter)((dir) ? filters.as_filters.x_filter
  ------------------
  |  Branch (82:25): [True: 0, False: 490k]
  ------------------
   83|   490k|                              : filters.as_filters.y_filter);
   84|   490k|}
rd.c:av1_extract_interp_filter:
   81|  11.6M|                                                     int dir) {
   82|  11.6M|  return (InterpFilter)((dir) ? filters.as_filters.x_filter
  ------------------
  |  Branch (82:25): [True: 0, False: 11.6M]
  ------------------
   83|  11.6M|                              : filters.as_filters.y_filter);
   84|  11.6M|}
rdopt.c:av1_broadcast_interp_filter:
   87|  94.4M|    InterpFilter filter) {
   88|  94.4M|  int_interpfilters filters;
   89|  94.4M|  filters.as_filters.x_filter = filter;
   90|  94.4M|  filters.as_filters.y_filter = filter;
   91|  94.4M|  return filters;
   92|  94.4M|}
rdopt.c:av1_unswitchable_filter:
   94|  94.4M|static inline InterpFilter av1_unswitchable_filter(InterpFilter filter) {
   95|  18.4E|  return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter;
  ------------------
  |  Branch (95:10): [True: 94.4M, False: 18.4E]
  ------------------
   96|  94.4M|}
nonrd_pickmode.c:av1_unswitchable_filter:
   94|   602k|static inline InterpFilter av1_unswitchable_filter(InterpFilter filter) {
   95|  18.4E|  return filter == SWITCHABLE ? EIGHTTAP_REGULAR : filter;
  ------------------
  |  Branch (95:10): [True: 602k, False: 18.4E]
  ------------------
   96|   602k|}
nonrd_pickmode.c:av1_broadcast_interp_filter:
   87|  2.02M|    InterpFilter filter) {
   88|  2.02M|  int_interpfilters filters;
   89|  2.02M|  filters.as_filters.x_filter = filter;
   90|  2.02M|  filters.as_filters.y_filter = filter;
   91|  2.02M|  return filters;
   92|  2.02M|}
reconinter_enc.c:av1_get_interp_filter_params_with_block_size:
  250|   117M|                                             const int w) {
  251|   117M|  if (w <= 4 && interp_filter != MULTITAP_SHARP2)
  ------------------
  |  Branch (251:7): [True: 25.3M, False: 92.1M]
  |  Branch (251:17): [True: 25.3M, False: 18.4E]
  ------------------
  252|  25.3M|    return &av1_interp_4tap[interp_filter];
  253|  92.1M|  return &av1_interp_filter_params_list[interp_filter];
  254|   117M|}
reconinter_enc.c:av1_broadcast_interp_filter:
   87|  41.4M|    InterpFilter filter) {
   88|  41.4M|  int_interpfilters filters;
   89|  41.4M|  filters.as_filters.x_filter = filter;
   90|  41.4M|  filters.as_filters.y_filter = filter;
   91|  41.4M|  return filters;
   92|  41.4M|}
var_based_part.c:av1_broadcast_interp_filter:
   87|  40.5k|    InterpFilter filter) {
   88|  40.5k|  int_interpfilters filters;
   89|  40.5k|  filters.as_filters.x_filter = filter;
   90|  40.5k|  filters.as_filters.y_filter = filter;
   91|  40.5k|  return filters;
   92|  40.5k|}
highbd_convolve_avx2.c:av1_get_interp_filter_subpel_kernel:
  267|   121k|    const InterpFilterParams *const filter_params, const int subpel) {
  268|   121k|  return filter_params->filter_ptr + filter_params->taps * subpel;
  269|   121k|}
pred_common.c:av1_extract_interp_filter:
   81|  7.04M|                                                     int dir) {
   82|  7.04M|  return (InterpFilter)((dir) ? filters.as_filters.x_filter
  ------------------
  |  Branch (82:25): [True: 506k, False: 6.53M]
  ------------------
   83|  7.04M|                              : filters.as_filters.y_filter);
   84|  7.04M|}
motion_search_facade.c:av1_broadcast_interp_filter:
   87|  3.00M|    InterpFilter filter) {
   88|  3.00M|  int_interpfilters filters;
   89|  3.00M|  filters.as_filters.x_filter = filter;
   90|  3.00M|  filters.as_filters.y_filter = filter;
   91|  3.00M|  return filters;
   92|  3.00M|}
av1_convolve_scale_sse4.c:av1_get_interp_filter_subpel_kernel:
  267|   764M|    const InterpFilterParams *const filter_params, const int subpel) {
  268|   764M|  return filter_params->filter_ptr + filter_params->taps * subpel;
  269|   764M|}
convolve_2d_avx2.c:get_filter_tap:
  299|  13.5M|                                 int subpel_qn) {
  300|  13.5M|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  301|  13.5M|      filter_params, subpel_qn & SUBPEL_MASK);
  ------------------
  |  |   24|  13.5M|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  13.5M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  302|  13.5M|  if (filter_params->taps == 12) {
  ------------------
  |  Branch (302:7): [True: 0, False: 13.5M]
  ------------------
  303|      0|    return 12;
  304|      0|  }
  305|  13.5M|  if (filter[0] || filter[7]) {
  ------------------
  |  Branch (305:7): [True: 18.4E, False: 13.5M]
  |  Branch (305:20): [True: 18.4E, False: 13.5M]
  ------------------
  306|      0|    return 8;
  307|      0|  }
  308|  13.5M|  if (filter[1] || filter[6]) {
  ------------------
  |  Branch (308:7): [True: 8.49M, False: 5.04M]
  |  Branch (308:20): [True: 29.2k, False: 5.01M]
  ------------------
  309|  8.60M|    return 6;
  310|  8.60M|  }
  311|  5.00M|  if (filter[2] || filter[5]) {
  ------------------
  |  Branch (311:7): [True: 4.93M, False: 3.64k]
  |  Branch (311:20): [True: 0, False: 3.64k]
  ------------------
  312|  5.00M|    return 4;
  313|  5.00M|  }
  314|  18.4E|  return 2;
  315|  4.93M|}
convolve_2d_avx2.c:av1_get_interp_filter_subpel_kernel:
  267|  20.2M|    const InterpFilterParams *const filter_params, const int subpel) {
  268|  20.2M|  return filter_params->filter_ptr + filter_params->taps * subpel;
  269|  20.2M|}
convolve_avx2.c:get_filter_tap:
  299|   763k|                                 int subpel_qn) {
  300|   763k|  const int16_t *const filter = av1_get_interp_filter_subpel_kernel(
  301|   763k|      filter_params, subpel_qn & SUBPEL_MASK);
  ------------------
  |  |   24|   763k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|   763k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  302|   763k|  if (filter_params->taps == 12) {
  ------------------
  |  Branch (302:7): [True: 0, False: 763k]
  ------------------
  303|      0|    return 12;
  304|      0|  }
  305|   763k|  if (filter[0] || filter[7]) {
  ------------------
  |  Branch (305:7): [True: 18, False: 763k]
  |  Branch (305:20): [True: 18.4E, False: 763k]
  ------------------
  306|      0|    return 8;
  307|      0|  }
  308|   763k|  if (filter[1] || filter[6]) {
  ------------------
  |  Branch (308:7): [True: 527k, False: 235k]
  |  Branch (308:20): [True: 4.54k, False: 230k]
  ------------------
  309|   532k|    return 6;
  310|   532k|  }
  311|   230k|  if (filter[2] || filter[5]) {
  ------------------
  |  Branch (311:7): [True: 227k, False: 2.59k]
  |  Branch (311:20): [True: 18.4E, False: 2.59k]
  ------------------
  312|   228k|    return 4;
  313|   228k|  }
  314|  2.25k|  return 2;
  315|   230k|}
convolve_avx2.c:av1_get_interp_filter_subpel_kernel:
  267|  1.52M|    const InterpFilterParams *const filter_params, const int subpel) {
  268|  1.52M|  return filter_params->filter_ptr + filter_params->taps * subpel;
  269|  1.52M|}
highbd_convolve_2d_avx2.c:av1_get_interp_filter_subpel_kernel:
  267|   367k|    const InterpFilterParams *const filter_params, const int subpel) {
  268|   367k|  return filter_params->filter_ptr + filter_params->taps * subpel;
  269|   367k|}

av1_alloc_internal_frame_buffers:
   17|  7.01k|int av1_alloc_internal_frame_buffers(InternalFrameBufferList *list) {
   18|  7.01k|  assert(list != NULL);
   19|  7.01k|  av1_free_internal_frame_buffers(list);
   20|       |
   21|  7.01k|  list->num_internal_frame_buffers =
   22|  7.01k|      AOM_MAXIMUM_REF_BUFFERS + AOM_MAXIMUM_WORK_BUFFERS;
  ------------------
  |  |   34|  7.01k|#define AOM_MAXIMUM_REF_BUFFERS 8
  ------------------
                    AOM_MAXIMUM_REF_BUFFERS + AOM_MAXIMUM_WORK_BUFFERS;
  ------------------
  |  |   30|  7.01k|#define AOM_MAXIMUM_WORK_BUFFERS 8
  ------------------
   23|  7.01k|  list->int_fb = (InternalFrameBuffer *)aom_calloc(
   24|  7.01k|      list->num_internal_frame_buffers, sizeof(*list->int_fb));
   25|  7.01k|  if (list->int_fb == NULL) {
  ------------------
  |  Branch (25:7): [True: 0, False: 7.01k]
  ------------------
   26|      0|    list->num_internal_frame_buffers = 0;
   27|      0|    return 1;
   28|      0|  }
   29|  7.01k|  return 0;
   30|  7.01k|}
av1_free_internal_frame_buffers:
   32|  14.0k|void av1_free_internal_frame_buffers(InternalFrameBufferList *list) {
   33|  14.0k|  int i;
   34|       |
   35|  14.0k|  assert(list != NULL);
   36|       |
   37|   126k|  for (i = 0; i < list->num_internal_frame_buffers; ++i) {
  ------------------
  |  Branch (37:15): [True: 112k, False: 14.0k]
  ------------------
   38|   112k|    aom_free(list->int_fb[i].data);
   39|   112k|    list->int_fb[i].data = NULL;
   40|   112k|  }
   41|  14.0k|  aom_free(list->int_fb);
   42|       |  list->int_fb = NULL;
   43|  14.0k|  list->num_internal_frame_buffers = 0;
   44|  14.0k|}
av1_get_frame_buffer:
   58|  28.0k|                         aom_codec_frame_buffer_t *fb) {
   59|  28.0k|  int i;
   60|  28.0k|  InternalFrameBufferList *const int_fb_list =
   61|  28.0k|      (InternalFrameBufferList *)cb_priv;
   62|  28.0k|  if (int_fb_list == NULL) return -1;
  ------------------
  |  Branch (62:7): [True: 0, False: 28.0k]
  ------------------
   63|       |
   64|       |  // Find a free frame buffer.
   65|  56.1k|  for (i = 0; i < int_fb_list->num_internal_frame_buffers; ++i) {
  ------------------
  |  Branch (65:15): [True: 56.1k, False: 0]
  ------------------
   66|  56.1k|    if (!int_fb_list->int_fb[i].in_use) break;
  ------------------
  |  Branch (66:9): [True: 28.0k, False: 28.0k]
  ------------------
   67|  56.1k|  }
   68|       |
   69|  28.0k|  if (i == int_fb_list->num_internal_frame_buffers) return -1;
  ------------------
  |  Branch (69:7): [True: 0, False: 28.0k]
  ------------------
   70|       |
   71|  28.0k|  if (int_fb_list->int_fb[i].size < min_size) {
  ------------------
  |  Branch (71:7): [True: 25.9k, False: 2.08k]
  ------------------
   72|  25.9k|    aom_free(int_fb_list->int_fb[i].data);
   73|       |    // The data must be zeroed to fix a valgrind error from the C loop filter
   74|       |    // due to access uninitialized memory in frame border. It could be
   75|       |    // skipped if border were totally removed.
   76|  25.9k|    int_fb_list->int_fb[i].data = (uint8_t *)aom_calloc(1, min_size);
   77|  25.9k|    if (!int_fb_list->int_fb[i].data) {
  ------------------
  |  Branch (77:9): [True: 0, False: 25.9k]
  ------------------
   78|      0|      int_fb_list->int_fb[i].size = 0;
   79|      0|      return -1;
   80|      0|    }
   81|  25.9k|    int_fb_list->int_fb[i].size = min_size;
   82|  25.9k|  }
   83|       |
   84|  28.0k|  fb->data = int_fb_list->int_fb[i].data;
   85|  28.0k|  fb->size = int_fb_list->int_fb[i].size;
   86|  28.0k|  int_fb_list->int_fb[i].in_use = 1;
   87|       |
   88|       |  // Set the frame buffer's private data to point at the internal frame buffer.
   89|  28.0k|  fb->priv = &int_fb_list->int_fb[i];
   90|  28.0k|  return 0;
   91|  28.0k|}
av1_release_frame_buffer:
   93|  28.0k|int av1_release_frame_buffer(void *cb_priv, aom_codec_frame_buffer_t *fb) {
   94|  28.0k|  InternalFrameBuffer *const int_fb = (InternalFrameBuffer *)fb->priv;
   95|  28.0k|  (void)cb_priv;
   96|  28.0k|  if (int_fb) int_fb->in_use = 0;
  ------------------
  |  Branch (96:7): [True: 28.0k, False: 0]
  ------------------
   97|  28.0k|  return 0;
   98|  28.0k|}

av1_get_tx_scale:
   24|   245M|int av1_get_tx_scale(const TX_SIZE tx_size) {
   25|   245M|  const int pels = tx_size_2d[tx_size];
   26|       |  // Largest possible pels is 4096 (64x64).
   27|   245M|  return (pels > 256) + (pels > 1024);
   28|   245M|}
av1_highbd_iwht4x4_add:
   35|  3.55M|                            int eob, int bd) {
   36|  3.55M|  if (eob > 1)
  ------------------
  |  Branch (36:7): [True: 3.54M, False: 9.96k]
  ------------------
   37|  3.54M|    av1_highbd_iwht4x4_16_add(input, dest, stride, bd);
   38|  9.96k|  else
   39|  9.96k|    av1_highbd_iwht4x4_1_add(input, dest, stride, bd);
  ------------------
  |  |  501|  9.96k|#define av1_highbd_iwht4x4_1_add av1_highbd_iwht4x4_1_add_c
  ------------------
   40|  3.55M|}
av1_inv_txfm_add_c:
  297|  3.35M|                        const TxfmParam *txfm_param) {
  298|  3.35M|  const TX_SIZE tx_size = txfm_param->tx_size;
  299|  3.35M|  DECLARE_ALIGNED(32, uint16_t, tmp[MAX_TX_SQUARE]);
  ------------------
  |  |   19|  3.35M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  300|  3.35M|  int tmp_stride = MAX_TX_SIZE;
  ------------------
  |  |  183|  3.35M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  182|  3.35M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  ------------------
  ------------------
  301|  3.35M|  int w = tx_size_wide[tx_size];
  302|  3.35M|  int h = tx_size_high[tx_size];
  303|  16.7M|  for (int r = 0; r < h; ++r) {
  ------------------
  |  Branch (303:19): [True: 13.4M, False: 3.35M]
  ------------------
  304|  67.0M|    for (int c = 0; c < w; ++c) {
  ------------------
  |  Branch (304:21): [True: 53.6M, False: 13.4M]
  ------------------
  305|  53.6M|      tmp[r * tmp_stride + c] = dst[r * stride + c];
  306|  53.6M|    }
  307|  13.4M|  }
  308|       |
  309|  3.35M|  av1_highbd_inv_txfm_add(dqcoeff, CONVERT_TO_BYTEPTR(tmp), tmp_stride,
  ------------------
  |  |   80|  3.35M|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  310|  3.35M|                          txfm_param);
  311|       |
  312|  16.8M|  for (int r = 0; r < h; ++r) {
  ------------------
  |  Branch (312:19): [True: 13.4M, False: 3.35M]
  ------------------
  313|  67.2M|    for (int c = 0; c < w; ++c) {
  ------------------
  |  Branch (313:21): [True: 53.7M, False: 13.4M]
  ------------------
  314|  53.7M|      dst[r * stride + c] = (uint8_t)tmp[r * tmp_stride + c];
  315|  53.7M|    }
  316|  13.4M|  }
  317|  3.35M|}
av1_inverse_transform_block:
  322|  83.6M|                                 int stride, int eob, int reduced_tx_set) {
  323|  83.6M|  if (!eob) return;
  ------------------
  |  Branch (323:7): [True: 12.4k, False: 83.6M]
  ------------------
  324|       |
  325|  83.6M|  assert(eob <= av1_get_max_eob(tx_size));
  326|       |
  327|  83.6M|  TxfmParam txfm_param;
  328|  83.6M|  init_txfm_param(xd, plane, tx_size, tx_type, eob, reduced_tx_set,
  329|  83.6M|                  &txfm_param);
  330|  83.6M|  assert(av1_ext_tx_used[txfm_param.tx_set_type][txfm_param.tx_type]);
  331|       |
  332|  83.6M|  if (txfm_param.is_hbd) {
  ------------------
  |  Branch (332:7): [True: 24.4M, False: 59.1M]
  ------------------
  333|  24.4M|    av1_highbd_inv_txfm_add(dqcoeff, dst, stride, &txfm_param);
  334|  59.1M|  } else {
  335|  59.1M|    av1_inv_txfm_add(dqcoeff, dst, stride, &txfm_param);
  336|  59.1M|  }
  337|  83.6M|}
idct.c:init_txfm_param:
  215|  83.6M|                            TxfmParam *txfm_param) {
  216|  83.6M|  (void)plane;
  217|  83.6M|  txfm_param->tx_type = tx_type;
  218|  83.6M|  txfm_param->tx_size = tx_size;
  219|  83.6M|  txfm_param->eob = eob;
  220|  83.6M|  txfm_param->lossless = xd->lossless[xd->mi[0]->segment_id];
  221|  83.6M|  txfm_param->bd = xd->bd;
  222|  83.6M|  txfm_param->is_hbd = is_cur_buf_hbd(xd);
  223|  83.6M|  txfm_param->tx_set_type = av1_get_ext_tx_set_type(
  224|  83.6M|      txfm_param->tx_size, is_inter_block(xd->mi[0]), reduced_tx_set);
  225|  83.6M|}

highbd_inv_txfm_sse4.c:cast_to_int32:
   44|  19.2M|static inline const int32_t *cast_to_int32(const tran_low_t *input) {
   45|       |  static_assert(sizeof(int32_t) == sizeof(tran_low_t), "");
   46|  19.2M|  return (const int32_t *)input;
   47|  19.2M|}

decodeframe.c:clamp_mv:
  323|   294k|static inline void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) {
  324|   294k|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  325|   294k|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  326|   294k|}
decodemv.c:gm_get_motion_vector:
  234|  5.10k|                                          int is_integer) {
  235|  5.10k|  int_mv res;
  236|       |
  237|  5.10k|  if (gm->wmtype == IDENTITY) {
  ------------------
  |  Branch (237:7): [True: 5.10k, False: 0]
  ------------------
  238|  5.10k|    res.as_int = 0;
  239|  5.10k|    return res;
  240|  5.10k|  }
  241|       |
  242|      0|  const int32_t *mat = gm->wmmat;
  243|      0|  int x, y, tx, ty;
  244|       |
  245|      0|  if (gm->wmtype == TRANSLATION) {
  ------------------
  |  Branch (245:7): [True: 0, False: 0]
  ------------------
  246|       |    // All global motion vectors are stored with WARPEDMODEL_PREC_BITS (16)
  247|       |    // bits of fractional precision. The offset for a translation is stored in
  248|       |    // entries 0 and 1. For translations, all but the top three (two if
  249|       |    // cm->features.allow_high_precision_mv is false) fractional bits are always
  250|       |    // zero.
  251|       |    //
  252|       |    // After the right shifts, there are 3 fractional bits of precision. If
  253|       |    // allow_hp is false, the bottom bit is always zero (so we don't need a
  254|       |    // call to convert_to_trans_prec here)
  255|       |    //
  256|       |    // Note: There is an AV1 specification bug here:
  257|       |    //
  258|       |    // gm->wmmat[0] is supposed to be the horizontal translation, and so should
  259|       |    // go into res.as_mv.col, and gm->wmmat[1] is supposed to be the vertical
  260|       |    // translation and so should go into res.as_mv.row
  261|       |    //
  262|       |    // However, in the spec, these assignments are accidentally reversed, and so
  263|       |    // we must keep this incorrect logic to match the spec.
  264|       |    //
  265|       |    // See also: https://crbug.com/aomedia/3328
  266|      0|    res.as_mv.row = gm->wmmat[0] >> GM_TRANS_ONLY_PREC_DIFF;
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  267|      0|    res.as_mv.col = gm->wmmat[1] >> GM_TRANS_ONLY_PREC_DIFF;
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  268|      0|    assert(IMPLIES(1 & (res.as_mv.row | res.as_mv.col), allow_hp));
  269|      0|    if (is_integer) {
  ------------------
  |  Branch (269:9): [True: 0, False: 0]
  ------------------
  270|      0|      integer_mv_precision(&res.as_mv);
  271|      0|    }
  272|      0|    return res;
  273|      0|  }
  274|       |
  275|      0|  x = block_center_x(mi_col, bsize);
  276|      0|  y = block_center_y(mi_row, bsize);
  277|       |
  278|      0|  if (gm->wmtype == ROTZOOM) {
  ------------------
  |  Branch (278:7): [True: 0, False: 0]
  ------------------
  279|      0|    assert(gm->wmmat[5] == gm->wmmat[2]);
  280|      0|    assert(gm->wmmat[4] == -gm->wmmat[3]);
  281|      0|  }
  282|       |
  283|      0|  const int xc =
  284|      0|      (mat[2] - (1 << WARPEDMODEL_PREC_BITS)) * x + mat[3] * y + mat[0];
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  285|      0|  const int yc =
  286|      0|      mat[4] * x + (mat[5] - (1 << WARPEDMODEL_PREC_BITS)) * y + mat[1];
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  287|      0|  tx = convert_to_trans_prec(allow_hp, xc);
  288|      0|  ty = convert_to_trans_prec(allow_hp, yc);
  289|       |
  290|      0|  res.as_mv.row = ty;
  291|      0|  res.as_mv.col = tx;
  292|       |
  293|      0|  if (is_integer) {
  ------------------
  |  Branch (293:7): [True: 0, False: 0]
  ------------------
  294|      0|    integer_mv_precision(&res.as_mv);
  295|      0|  }
  296|      0|  return res;
  297|      0|}
mcomp.c:get_fullmv_from_mv:
   79|  8.42M|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|  8.42M|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|  8.42M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|  8.42M|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|  8.42M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|  8.42M|  return full_mv;
   83|  8.42M|}
mcomp.c:clamp_fullmv:
  328|  7.04M|static inline void clamp_fullmv(FULLPEL_MV *mv, const FullMvLimits *mv_limits) {
  329|  7.04M|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  330|  7.04M|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  331|  7.04M|}
mcomp.c:convert_fullmv_to_mv:
   91|  7.28k|static inline void convert_fullmv_to_mv(int_mv *mv) {
   92|  7.28k|  mv->as_mv = get_mv_from_fullmv(&mv->as_fullmv);
   93|  7.28k|}
mcomp.c:get_mv_from_fullmv:
   85|  15.1M|static inline MV get_mv_from_fullmv(const FULLPEL_MV *full_mv) {
   86|  15.1M|  const MV subpel_mv = { (int16_t)GET_MV_SUBPEL(full_mv->row),
  ------------------
  |  |   29|  15.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   87|  15.1M|                         (int16_t)GET_MV_SUBPEL(full_mv->col) };
  ------------------
  |  |   29|  15.1M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   88|  15.1M|  return subpel_mv;
   89|  15.1M|}
partition_strategy.c:get_fullmv_from_mv:
   79|  71.8k|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|  71.8k|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|  71.8k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|  71.8k|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|  71.8k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|  71.8k|  return full_mv;
   83|  71.8k|}
rd.c:clamp_mv:
  323|  2.36M|static inline void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) {
  324|  2.36M|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  325|  2.36M|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  326|  2.36M|}
rdopt.c:convert_fullmv_to_mv:
   91|  72.2k|static inline void convert_fullmv_to_mv(int_mv *mv) {
   92|  72.2k|  mv->as_mv = get_mv_from_fullmv(&mv->as_fullmv);
   93|  72.2k|}
rdopt.c:get_fullmv_from_mv:
   79|  5.36M|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|  5.36M|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|  5.36M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|  5.36M|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|  5.36M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|  5.36M|  return full_mv;
   83|  5.36M|}
rdopt.c:get_mv_from_fullmv:
   85|   216k|static inline MV get_mv_from_fullmv(const FULLPEL_MV *full_mv) {
   86|   216k|  const MV subpel_mv = { (int16_t)GET_MV_SUBPEL(full_mv->row),
  ------------------
  |  |   29|   216k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   87|   216k|                         (int16_t)GET_MV_SUBPEL(full_mv->col) };
  ------------------
  |  |   29|   216k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   88|   216k|  return subpel_mv;
   89|   216k|}
rdopt.c:clamp_mv:
  323|  5.14M|static inline void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) {
  324|  5.14M|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  325|  5.14M|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  326|  5.14M|}
nonrd_pickmode.c:get_fullmv_from_mv:
   79|   598k|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|   598k|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|   598k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|   598k|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|   598k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|   598k|  return full_mv;
   83|   598k|}
nonrd_pickmode.c:get_mv_from_fullmv:
   85|  1.19M|static inline MV get_mv_from_fullmv(const FULLPEL_MV *full_mv) {
   86|  1.19M|  const MV subpel_mv = { (int16_t)GET_MV_SUBPEL(full_mv->row),
  ------------------
  |  |   29|  1.19M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   87|  1.19M|                         (int16_t)GET_MV_SUBPEL(full_mv->col) };
  ------------------
  |  |   29|  1.19M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   88|  1.19M|  return subpel_mv;
   89|  1.19M|}
var_based_part.c:get_fullmv_from_mv:
   79|  11.4k|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|  11.4k|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|  11.4k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|  11.4k|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|  11.4k|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|  11.4k|  return full_mv;
   83|  11.4k|}
var_based_part.c:clamp_mv:
  323|  5.91k|static inline void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) {
  324|  5.91k|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  325|  5.91k|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  326|  5.91k|}
var_based_part.c:get_mv_from_fullmv:
   85|  1.18k|static inline MV get_mv_from_fullmv(const FULLPEL_MV *full_mv) {
   86|  1.18k|  const MV subpel_mv = { (int16_t)GET_MV_SUBPEL(full_mv->row),
  ------------------
  |  |   29|  1.18k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   87|  1.18k|                         (int16_t)GET_MV_SUBPEL(full_mv->col) };
  ------------------
  |  |   29|  1.18k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   88|  1.18k|  return subpel_mv;
   89|  1.18k|}
mvref_common.c:gm_get_motion_vector:
  234|  2.77M|                                          int is_integer) {
  235|  2.77M|  int_mv res;
  236|       |
  237|  2.77M|  if (gm->wmtype == IDENTITY) {
  ------------------
  |  Branch (237:7): [True: 2.77M, False: 18.4E]
  ------------------
  238|  2.77M|    res.as_int = 0;
  239|  2.77M|    return res;
  240|  2.77M|  }
  241|       |
  242|  18.4E|  const int32_t *mat = gm->wmmat;
  243|  18.4E|  int x, y, tx, ty;
  244|       |
  245|  18.4E|  if (gm->wmtype == TRANSLATION) {
  ------------------
  |  Branch (245:7): [True: 0, False: 18.4E]
  ------------------
  246|       |    // All global motion vectors are stored with WARPEDMODEL_PREC_BITS (16)
  247|       |    // bits of fractional precision. The offset for a translation is stored in
  248|       |    // entries 0 and 1. For translations, all but the top three (two if
  249|       |    // cm->features.allow_high_precision_mv is false) fractional bits are always
  250|       |    // zero.
  251|       |    //
  252|       |    // After the right shifts, there are 3 fractional bits of precision. If
  253|       |    // allow_hp is false, the bottom bit is always zero (so we don't need a
  254|       |    // call to convert_to_trans_prec here)
  255|       |    //
  256|       |    // Note: There is an AV1 specification bug here:
  257|       |    //
  258|       |    // gm->wmmat[0] is supposed to be the horizontal translation, and so should
  259|       |    // go into res.as_mv.col, and gm->wmmat[1] is supposed to be the vertical
  260|       |    // translation and so should go into res.as_mv.row
  261|       |    //
  262|       |    // However, in the spec, these assignments are accidentally reversed, and so
  263|       |    // we must keep this incorrect logic to match the spec.
  264|       |    //
  265|       |    // See also: https://crbug.com/aomedia/3328
  266|      0|    res.as_mv.row = gm->wmmat[0] >> GM_TRANS_ONLY_PREC_DIFF;
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  267|      0|    res.as_mv.col = gm->wmmat[1] >> GM_TRANS_ONLY_PREC_DIFF;
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  268|      0|    assert(IMPLIES(1 & (res.as_mv.row | res.as_mv.col), allow_hp));
  269|      0|    if (is_integer) {
  ------------------
  |  Branch (269:9): [True: 0, False: 0]
  ------------------
  270|      0|      integer_mv_precision(&res.as_mv);
  271|      0|    }
  272|      0|    return res;
  273|      0|  }
  274|       |
  275|  18.4E|  x = block_center_x(mi_col, bsize);
  276|  18.4E|  y = block_center_y(mi_row, bsize);
  277|       |
  278|  18.4E|  if (gm->wmtype == ROTZOOM) {
  ------------------
  |  Branch (278:7): [True: 0, False: 18.4E]
  ------------------
  279|      0|    assert(gm->wmmat[5] == gm->wmmat[2]);
  280|      0|    assert(gm->wmmat[4] == -gm->wmmat[3]);
  281|      0|  }
  282|       |
  283|  18.4E|  const int xc =
  284|  18.4E|      (mat[2] - (1 << WARPEDMODEL_PREC_BITS)) * x + mat[3] * y + mat[0];
  ------------------
  |  |   96|  18.4E|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  285|  18.4E|  const int yc =
  286|  18.4E|      mat[4] * x + (mat[5] - (1 << WARPEDMODEL_PREC_BITS)) * y + mat[1];
  ------------------
  |  |   96|  18.4E|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  287|  18.4E|  tx = convert_to_trans_prec(allow_hp, xc);
  288|  18.4E|  ty = convert_to_trans_prec(allow_hp, yc);
  289|       |
  290|  18.4E|  res.as_mv.row = ty;
  291|  18.4E|  res.as_mv.col = tx;
  292|       |
  293|  18.4E|  if (is_integer) {
  ------------------
  |  Branch (293:7): [True: 0, False: 18.4E]
  ------------------
  294|      0|    integer_mv_precision(&res.as_mv);
  295|      0|  }
  296|  18.4E|  return res;
  297|  18.4E|}
mvref_common.c:clamp_mv:
  323|  2.88M|static inline void clamp_mv(MV *mv, const SubpelMvLimits *mv_limits) {
  324|  2.88M|  mv->col = clamp(mv->col, mv_limits->col_min, mv_limits->col_max);
  325|  2.88M|  mv->row = clamp(mv->row, mv_limits->row_min, mv_limits->row_max);
  326|  2.88M|}
global_motion.c:get_wmtype:
  299|    516|static inline TransformationType get_wmtype(const WarpedMotionParams *gm) {
  300|    516|  if (gm->wmmat[5] == (1 << WARPEDMODEL_PREC_BITS) && !gm->wmmat[4] &&
  ------------------
  |  |   96|    516|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  |  Branch (300:7): [True: 0, False: 516]
  |  Branch (300:55): [True: 0, False: 0]
  ------------------
  301|      0|      gm->wmmat[2] == (1 << WARPEDMODEL_PREC_BITS) && !gm->wmmat[3]) {
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  |  Branch (301:7): [True: 0, False: 0]
  |  Branch (301:55): [True: 0, False: 0]
  ------------------
  302|      0|    return ((!gm->wmmat[1] && !gm->wmmat[0]) ? IDENTITY : TRANSLATION);
  ------------------
  |  Branch (302:14): [True: 0, False: 0]
  |  Branch (302:31): [True: 0, False: 0]
  ------------------
  303|      0|  }
  304|    516|  if (gm->wmmat[2] == gm->wmmat[5] && gm->wmmat[3] == -gm->wmmat[4])
  ------------------
  |  Branch (304:7): [True: 515, False: 1]
  |  Branch (304:39): [True: 518, False: 18.4E]
  ------------------
  305|    520|    return ROTZOOM;
  306|  18.4E|  else
  307|  18.4E|    return AFFINE;
  308|    516|}
motion_search_facade.c:get_fullmv_from_mv:
   79|  2.43M|static inline FULLPEL_MV get_fullmv_from_mv(const MV *subpel_mv) {
   80|  2.43M|  const FULLPEL_MV full_mv = { (int16_t)GET_MV_RAWPEL(subpel_mv->row),
  ------------------
  |  |   28|  2.43M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   81|  2.43M|                               (int16_t)GET_MV_RAWPEL(subpel_mv->col) };
  ------------------
  |  |   28|  2.43M|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   82|  2.43M|  return full_mv;
   83|  2.43M|}
motion_search_facade.c:get_mv_from_fullmv:
   85|  8.77M|static inline MV get_mv_from_fullmv(const FULLPEL_MV *full_mv) {
   86|  8.77M|  const MV subpel_mv = { (int16_t)GET_MV_SUBPEL(full_mv->row),
  ------------------
  |  |   29|  8.77M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   87|  8.77M|                         (int16_t)GET_MV_SUBPEL(full_mv->col) };
  ------------------
  |  |   29|  8.77M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
   88|  8.77M|  return subpel_mv;
   89|  8.77M|}
motion_search_facade.c:convert_fullmv_to_mv:
   91|  3.00M|static inline void convert_fullmv_to_mv(int_mv *mv) {
   92|  3.00M|  mv->as_mv = get_mv_from_fullmv(&mv->as_fullmv);
   93|  3.00M|}

av1_get_mv_projection:
   27|   539k|void av1_get_mv_projection(MV *output, MV ref, int num, int den) {
   28|   539k|  den = AOMMIN(den, MAX_FRAME_DISTANCE);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 539k, False: 18.4E]
  |  |  ------------------
  ------------------
   29|   539k|  num = num > 0 ? AOMMIN(num, MAX_FRAME_DISTANCE)
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 539k, False: 18.4E]
  |  |  ------------------
  ------------------
  |  Branch (29:9): [True: 539k, False: 18.4E]
  ------------------
   30|  18.4E|                : AOMMAX(num, -MAX_FRAME_DISTANCE);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
   31|   539k|  const int mv_row =
   32|   539k|      ROUND_POWER_OF_TWO_SIGNED(ref.row * num * div_mult[den], 14);
  ------------------
  |  |   45|   539k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|   148k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 148k, False: 390k]
  |  |  ------------------
  |  |   46|   539k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   390k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   33|   539k|  const int mv_col =
   34|   539k|      ROUND_POWER_OF_TWO_SIGNED(ref.col * num * div_mult[den], 14);
  ------------------
  |  |   45|   539k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|   153k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 153k, False: 386k]
  |  |  ------------------
  |  |   46|   539k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   386k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   35|   539k|  const int clamp_max = MV_UPP - 1;
  ------------------
  |  |   75|   539k|#define MV_UPP (1 << MV_IN_USE_BITS)
  |  |  ------------------
  |  |  |  |   74|   539k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
   36|   539k|  const int clamp_min = MV_LOW + 1;
  ------------------
  |  |   76|   539k|#define MV_LOW (-(1 << MV_IN_USE_BITS))
  |  |  ------------------
  |  |  |  |   74|   539k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
   37|   539k|  output->row = (int16_t)clamp(mv_row, clamp_min, clamp_max);
   38|   539k|  output->col = (int16_t)clamp(mv_col, clamp_min, clamp_max);
   39|   539k|}
av1_copy_frame_mvs:
   43|  2.75M|                        int x_mis, int y_mis) {
   44|  2.75M|  const int frame_mvs_stride = ROUND_POWER_OF_TWO(cm->mi_params.mi_cols, 1);
  ------------------
  |  |   41|  2.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   45|  2.75M|  MV_REF *frame_mvs =
   46|  2.75M|      cm->cur_frame->mvs + (mi_row >> 1) * frame_mvs_stride + (mi_col >> 1);
   47|  2.75M|  x_mis = ROUND_POWER_OF_TWO(x_mis, 1);
  ------------------
  |  |   41|  2.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   48|  2.75M|  y_mis = ROUND_POWER_OF_TWO(y_mis, 1);
  ------------------
  |  |   41|  2.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   49|  2.75M|  int w, h;
   50|       |
   51|  5.82M|  for (h = 0; h < y_mis; h++) {
  ------------------
  |  Branch (51:15): [True: 3.07M, False: 2.75M]
  ------------------
   52|  3.07M|    MV_REF *mv = frame_mvs;
   53|  6.93M|    for (w = 0; w < x_mis; w++) {
  ------------------
  |  Branch (53:17): [True: 3.85M, False: 3.07M]
  ------------------
   54|  3.85M|      mv->ref_frame = NONE_FRAME;
   55|  3.85M|      mv->mv.as_int = 0;
   56|       |
   57|  11.5M|      for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (57:25): [True: 7.71M, False: 3.85M]
  ------------------
   58|  7.71M|        MV_REFERENCE_FRAME ref_frame = mi->ref_frame[idx];
   59|  7.71M|        if (ref_frame > INTRA_FRAME) {
  ------------------
  |  Branch (59:13): [True: 1.20M, False: 6.51M]
  ------------------
   60|  1.20M|          int8_t ref_idx = cm->ref_frame_side[ref_frame];
   61|  1.20M|          if (ref_idx) continue;
  ------------------
  |  Branch (61:15): [True: 0, False: 1.20M]
  ------------------
   62|  1.20M|          if ((abs(mi->mv[idx].as_mv.row) > REFMVS_LIMIT) ||
  ------------------
  |  |   27|  1.20M|#define REFMVS_LIMIT ((1 << 12) - 1)
  ------------------
  |  Branch (62:15): [True: 77, False: 1.20M]
  ------------------
   63|  1.20M|              (abs(mi->mv[idx].as_mv.col) > REFMVS_LIMIT))
  ------------------
  |  |   27|  1.20M|#define REFMVS_LIMIT ((1 << 12) - 1)
  ------------------
  |  Branch (63:15): [True: 18.4E, False: 1.20M]
  ------------------
   64|      0|            continue;
   65|  1.20M|          mv->ref_frame = ref_frame;
   66|  1.20M|          mv->mv.as_int = mi->mv[idx].as_int;
   67|  1.20M|        }
   68|  7.71M|      }
   69|  3.85M|      mv++;
   70|  3.85M|    }
   71|  3.07M|    frame_mvs += frame_mvs_stride;
   72|  3.07M|  }
   73|  2.75M|}
av1_find_mv_refs:
  794|  2.84M|                      int_mv *global_mvs, int16_t *mode_context) {
  795|  2.84M|  const int mi_row = xd->mi_row;
  796|  2.84M|  const int mi_col = xd->mi_col;
  797|  2.84M|  int_mv gm_mv[2];
  798|       |
  799|  2.84M|  if (ref_frame == INTRA_FRAME) {
  ------------------
  |  Branch (799:7): [True: 72.2k, False: 2.77M]
  ------------------
  800|  72.2k|    gm_mv[0].as_int = gm_mv[1].as_int = 0;
  801|  72.2k|    if (global_mvs != NULL) {
  ------------------
  |  Branch (801:9): [True: 72.2k, False: 18.4E]
  ------------------
  802|  72.2k|      global_mvs[ref_frame].as_int = INVALID_MV;
  ------------------
  |  |   26|  72.2k|#define INVALID_MV 0x80008000
  ------------------
  803|  72.2k|    }
  804|  2.77M|  } else {
  805|  2.77M|    const BLOCK_SIZE bsize = mi->bsize;
  806|  2.77M|    const int allow_high_precision_mv = cm->features.allow_high_precision_mv;
  807|  2.77M|    const int force_integer_mv = cm->features.cur_frame_force_integer_mv;
  808|  2.77M|    if (ref_frame < REF_FRAMES) {
  ------------------
  |  Branch (808:9): [True: 2.77M, False: 18.4E]
  ------------------
  809|  2.77M|      gm_mv[0] = gm_get_motion_vector(&cm->global_motion[ref_frame],
  810|  2.77M|                                      allow_high_precision_mv, bsize, mi_col,
  811|  2.77M|                                      mi_row, force_integer_mv);
  812|  2.77M|      gm_mv[1].as_int = 0;
  813|  2.77M|      if (global_mvs != NULL) global_mvs[ref_frame] = gm_mv[0];
  ------------------
  |  Branch (813:11): [True: 2.58M, False: 191k]
  ------------------
  814|  18.4E|    } else {
  815|  18.4E|      MV_REFERENCE_FRAME rf[2];
  816|  18.4E|      av1_set_ref_frame(rf, ref_frame);
  817|  18.4E|      gm_mv[0] = gm_get_motion_vector(&cm->global_motion[rf[0]],
  818|  18.4E|                                      allow_high_precision_mv, bsize, mi_col,
  819|  18.4E|                                      mi_row, force_integer_mv);
  820|  18.4E|      gm_mv[1] = gm_get_motion_vector(&cm->global_motion[rf[1]],
  821|  18.4E|                                      allow_high_precision_mv, bsize, mi_col,
  822|  18.4E|                                      mi_row, force_integer_mv);
  823|  18.4E|    }
  824|  2.77M|  }
  825|       |
  826|  2.84M|  setup_ref_mv_list(cm, xd, ref_frame, &ref_mv_count[ref_frame],
  827|  2.84M|                    ref_mv_stack[ref_frame], ref_mv_weight[ref_frame],
  828|  2.84M|                    mv_ref_list ? mv_ref_list[ref_frame] : NULL, gm_mv, mi_row,
  ------------------
  |  Branch (828:21): [True: 191k, False: 2.65M]
  ------------------
  829|  2.84M|                    mi_col, mode_context);
  830|  2.84M|}
av1_find_best_ref_mvs:
  833|   186k|                           int_mv *near_mv, int is_integer) {
  834|   186k|  int i;
  835|       |  // Make sure all the candidates are properly clamped etc
  836|   558k|  for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
  ------------------
  |  |  508|   558k|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (836:15): [True: 372k, False: 186k]
  ------------------
  837|   372k|    lower_mv_precision(&mvlist[i].as_mv, allow_hp, is_integer);
  838|   372k|  }
  839|   186k|  *nearest_mv = mvlist[0];
  840|   186k|  *near_mv = mvlist[1];
  841|   186k|}
av1_setup_frame_buf_refs:
  843|   101k|void av1_setup_frame_buf_refs(AV1_COMMON *cm) {
  844|   101k|  cm->cur_frame->order_hint = cm->current_frame.order_hint;
  845|   101k|  cm->cur_frame->display_order_hint = cm->current_frame.display_order_hint;
  846|   101k|  cm->cur_frame->pyramid_level = cm->current_frame.pyramid_level;
  847|   101k|  cm->cur_frame->base_qindex = cm->quant_params.base_qindex;
  848|   101k|  cm->cur_frame->filter_level[0] = -1;
  849|   101k|  cm->cur_frame->filter_level[1] = -1;
  850|   101k|  MV_REFERENCE_FRAME ref_frame;
  851|   813k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (851:32): [True: 711k, False: 101k]
  ------------------
  852|   711k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
  853|   711k|    if (buf != NULL) {
  ------------------
  |  Branch (853:9): [True: 533k, False: 177k]
  ------------------
  854|   533k|      cm->cur_frame->ref_order_hints[ref_frame - LAST_FRAME] = buf->order_hint;
  855|   533k|      cm->cur_frame->ref_display_order_hint[ref_frame - LAST_FRAME] =
  856|   533k|          buf->display_order_hint;
  857|   533k|    }
  858|   711k|  }
  859|   101k|}
av1_setup_frame_sign_bias:
  861|   101k|void av1_setup_frame_sign_bias(AV1_COMMON *cm) {
  862|   101k|  MV_REFERENCE_FRAME ref_frame;
  863|   813k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (863:32): [True: 711k, False: 101k]
  ------------------
  864|   711k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
  865|   711k|    if (cm->seq_params->order_hint_info.enable_order_hint && buf != NULL) {
  ------------------
  |  Branch (865:9): [True: 711k, False: 0]
  |  Branch (865:62): [True: 533k, False: 177k]
  ------------------
  866|   533k|      const int ref_order_hint = buf->order_hint;
  867|   533k|      cm->ref_frame_sign_bias[ref_frame] =
  868|   533k|          (get_relative_dist(&cm->seq_params->order_hint_info, ref_order_hint,
  ------------------
  |  Branch (868:11): [True: 533k, False: 0]
  ------------------
  869|   533k|                             (int)cm->current_frame.order_hint) <= 0)
  870|   533k|              ? 0
  871|   533k|              : 1;
  872|   533k|    } else {
  873|   177k|      cm->ref_frame_sign_bias[ref_frame] = 0;
  874|   177k|    }
  875|   711k|  }
  876|   101k|}
av1_calculate_ref_frame_side:
  994|   101k|void av1_calculate_ref_frame_side(AV1_COMMON *cm) {
  995|   101k|  const OrderHintInfo *const order_hint_info = &cm->seq_params->order_hint_info;
  996|       |
  997|   101k|  memset(cm->ref_frame_side, 0, sizeof(cm->ref_frame_side));
  998|   101k|  if (!order_hint_info->enable_order_hint) return;
  ------------------
  |  Branch (998:7): [True: 0, False: 101k]
  ------------------
  999|       |
 1000|   101k|  const int cur_order_hint = cm->cur_frame->order_hint;
 1001|       |
 1002|   813k|  for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
  ------------------
  |  Branch (1002:36): [True: 711k, False: 101k]
  ------------------
 1003|   711k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 1004|   711k|    int order_hint = 0;
 1005|       |
 1006|   711k|    if (buf != NULL) order_hint = buf->order_hint;
  ------------------
  |  Branch (1006:9): [True: 533k, False: 177k]
  ------------------
 1007|       |
 1008|   711k|    if (get_relative_dist(order_hint_info, order_hint, cur_order_hint) > 0)
  ------------------
  |  Branch (1008:9): [True: 0, False: 711k]
  ------------------
 1009|      0|      cm->ref_frame_side[ref_frame] = 1;
 1010|   711k|    else if (order_hint == cur_order_hint)
  ------------------
  |  Branch (1010:14): [True: 177k, False: 533k]
  ------------------
 1011|   177k|      cm->ref_frame_side[ref_frame] = -1;
 1012|   711k|  }
 1013|   101k|}
av1_setup_motion_field:
 1015|  76.2k|void av1_setup_motion_field(AV1_COMMON *cm) {
 1016|  76.2k|  const OrderHintInfo *const order_hint_info = &cm->seq_params->order_hint_info;
 1017|       |
 1018|  76.2k|  if (!order_hint_info->enable_order_hint) return;
  ------------------
  |  Branch (1018:7): [True: 0, False: 76.2k]
  ------------------
 1019|       |
 1020|  76.2k|  TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
 1021|  76.2k|  int size = ((cm->mi_params.mi_rows + MAX_MIB_SIZE) >> 1) *
  ------------------
  |  |   44|  76.2k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|  76.2k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  76.2k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  76.2k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1022|  76.2k|             (cm->mi_params.mi_stride >> 1);
 1023|  30.1M|  for (int idx = 0; idx < size; ++idx) {
  ------------------
  |  Branch (1023:21): [True: 30.0M, False: 76.2k]
  ------------------
 1024|  30.0M|    tpl_mvs_base[idx].mfmv0.as_int = INVALID_MV;
  ------------------
  |  |   26|  30.0M|#define INVALID_MV 0x80008000
  ------------------
 1025|  30.0M|    tpl_mvs_base[idx].ref_frame_offset = 0;
 1026|  30.0M|  }
 1027|       |
 1028|  76.2k|  const int cur_order_hint = cm->cur_frame->order_hint;
 1029|  76.2k|  const RefCntBuffer *ref_buf[INTER_REFS_PER_FRAME];
 1030|  76.2k|  int ref_order_hint[INTER_REFS_PER_FRAME];
 1031|       |
 1032|   610k|  for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
  ------------------
  |  Branch (1032:36): [True: 533k, False: 76.2k]
  ------------------
 1033|   533k|    const int ref_idx = ref_frame - LAST_FRAME;
 1034|   533k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 1035|   533k|    int order_hint = 0;
 1036|       |
 1037|   533k|    if (buf != NULL) order_hint = buf->order_hint;
  ------------------
  |  Branch (1037:9): [True: 533k, False: 0]
  ------------------
 1038|       |
 1039|   533k|    ref_buf[ref_idx] = buf;
 1040|   533k|    ref_order_hint[ref_idx] = order_hint;
 1041|   533k|  }
 1042|       |
 1043|  76.2k|  int ref_stamp = MFMV_STACK_SIZE - 1;
  ------------------
  |  |  105|  76.2k|#define MFMV_STACK_SIZE 3
  ------------------
 1044|       |
 1045|  76.2k|  if (ref_buf[LAST_FRAME - LAST_FRAME] != NULL) {
  ------------------
  |  Branch (1045:7): [True: 76.2k, False: 0]
  ------------------
 1046|  76.2k|    const int alt_of_lst_order_hint =
 1047|  76.2k|        ref_buf[LAST_FRAME - LAST_FRAME]
 1048|  76.2k|            ->ref_order_hints[ALTREF_FRAME - LAST_FRAME];
 1049|       |
 1050|  76.2k|    const int is_lst_overlay =
 1051|  76.2k|        (alt_of_lst_order_hint == ref_order_hint[GOLDEN_FRAME - LAST_FRAME]);
 1052|  76.2k|    if (!is_lst_overlay) motion_field_projection(cm, LAST_FRAME, 2);
  ------------------
  |  Branch (1052:9): [True: 50.8k, False: 25.4k]
  ------------------
 1053|  76.2k|    --ref_stamp;
 1054|  76.2k|  }
 1055|       |
 1056|  76.2k|  if (get_relative_dist(order_hint_info,
  ------------------
  |  Branch (1056:7): [True: 0, False: 76.2k]
  ------------------
 1057|  76.2k|                        ref_order_hint[BWDREF_FRAME - LAST_FRAME],
 1058|  76.2k|                        cur_order_hint) > 0) {
 1059|      0|    if (motion_field_projection(cm, BWDREF_FRAME, 0)) --ref_stamp;
  ------------------
  |  Branch (1059:9): [True: 0, False: 0]
  ------------------
 1060|      0|  }
 1061|       |
 1062|  76.2k|  if (get_relative_dist(order_hint_info,
  ------------------
  |  Branch (1062:7): [True: 0, False: 76.2k]
  ------------------
 1063|  76.2k|                        ref_order_hint[ALTREF2_FRAME - LAST_FRAME],
 1064|  76.2k|                        cur_order_hint) > 0) {
 1065|      0|    if (motion_field_projection(cm, ALTREF2_FRAME, 0)) --ref_stamp;
  ------------------
  |  Branch (1065:9): [True: 0, False: 0]
  ------------------
 1066|      0|  }
 1067|       |
 1068|  76.2k|  if (get_relative_dist(order_hint_info,
  ------------------
  |  Branch (1068:7): [True: 0, False: 76.2k]
  ------------------
 1069|  76.2k|                        ref_order_hint[ALTREF_FRAME - LAST_FRAME],
 1070|  76.2k|                        cur_order_hint) > 0 &&
 1071|      0|      ref_stamp >= 0)
  ------------------
  |  Branch (1071:7): [True: 0, False: 0]
  ------------------
 1072|      0|    if (motion_field_projection(cm, ALTREF_FRAME, 0)) --ref_stamp;
  ------------------
  |  Branch (1072:9): [True: 0, False: 0]
  ------------------
 1073|       |
 1074|  76.2k|  if (ref_stamp >= 0) motion_field_projection(cm, LAST2_FRAME, 2);
  ------------------
  |  Branch (1074:7): [True: 76.2k, False: 0]
  ------------------
 1075|  76.2k|}
av1_selectSamples:
 1093|  64.4k|                          BLOCK_SIZE bsize) {
 1094|  64.4k|  const int bw = block_size_wide[bsize];
 1095|  64.4k|  const int bh = block_size_high[bsize];
 1096|  64.4k|  const int thresh = clamp(AOMMAX(bw, bh), 16, 112);
  ------------------
  |  |   35|  64.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 15, False: 64.4k]
  |  |  ------------------
  ------------------
 1097|  64.4k|  uint8_t ret = 0;
 1098|  64.4k|  assert(len <= LEAST_SQUARES_SAMPLES_MAX);
 1099|       |
 1100|       |  // Only keep the samples with MV differences within threshold.
 1101|   235k|  for (int i = 0; i < len; ++i) {
  ------------------
  |  Branch (1101:19): [True: 170k, False: 64.4k]
  ------------------
 1102|   170k|    const int diff = abs(pts_inref[2 * i] - pts[2 * i] - mv->col) +
 1103|   170k|                     abs(pts_inref[2 * i + 1] - pts[2 * i + 1] - mv->row);
 1104|   170k|    if (diff > thresh) continue;
  ------------------
  |  Branch (1104:9): [True: 116k, False: 54.2k]
  ------------------
 1105|  54.2k|    if (ret != i) {
  ------------------
  |  Branch (1105:9): [True: 12.7k, False: 41.4k]
  ------------------
 1106|  12.7k|      memcpy(pts + 2 * ret, pts + 2 * i, 2 * sizeof(pts[0]));
 1107|  12.7k|      memcpy(pts_inref + 2 * ret, pts_inref + 2 * i, 2 * sizeof(pts_inref[0]));
 1108|  12.7k|    }
 1109|  54.2k|    ++ret;
 1110|  54.2k|  }
 1111|       |  // Keep at least 1 sample.
 1112|  64.4k|  return AOMMAX(ret, 1);
  ------------------
  |  |   35|  64.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 14.7k, False: 49.6k]
  |  |  ------------------
  ------------------
 1113|  64.4k|}
av1_findSamples:
 1119|  1.06M|                        int *pts_inref) {
 1120|  1.06M|  const MB_MODE_INFO *const mbmi0 = xd->mi[0];
 1121|  1.06M|  const int ref_frame = mbmi0->ref_frame[0];
 1122|  1.06M|  const int up_available = xd->up_available;
 1123|  1.06M|  const int left_available = xd->left_available;
 1124|  1.06M|  uint8_t np = 0;
 1125|  1.06M|  int do_tl = 1;
 1126|  1.06M|  int do_tr = 1;
 1127|  1.06M|  const int mi_stride = xd->mi_stride;
 1128|  1.06M|  const int mi_row = xd->mi_row;
 1129|  1.06M|  const int mi_col = xd->mi_col;
 1130|       |
 1131|       |  // scan the nearest above rows
 1132|  1.06M|  if (up_available) {
  ------------------
  |  Branch (1132:7): [True: 870k, False: 191k]
  ------------------
 1133|   870k|    const int mi_row_offset = -1;
 1134|   870k|    const MB_MODE_INFO *mbmi = xd->mi[mi_row_offset * mi_stride];
 1135|   870k|    uint8_t superblock_width = mi_size_wide[mbmi->bsize];
 1136|       |
 1137|   870k|    if (xd->width <= superblock_width) {
  ------------------
  |  Branch (1137:9): [True: 835k, False: 34.9k]
  ------------------
 1138|       |      // Handle "current block width <= above block width" case.
 1139|   835k|      const int col_offset = -mi_col % superblock_width;
 1140|       |
 1141|   835k|      if (col_offset < 0) do_tl = 0;
  ------------------
  |  Branch (1141:11): [True: 32.6k, False: 803k]
  ------------------
 1142|   835k|      if (col_offset + superblock_width > xd->width) do_tr = 0;
  ------------------
  |  Branch (1142:11): [True: 29.1k, False: 806k]
  ------------------
 1143|       |
 1144|   835k|      if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1144:11): [True: 607k, False: 228k]
  |  Branch (1144:46): [True: 607k, False: 18.4E]
  ------------------
 1145|   607k|        record_samples(mbmi, pts, pts_inref, 0, -1, col_offset, 1);
 1146|   607k|        pts += 2;
 1147|   607k|        pts_inref += 2;
 1148|   607k|        if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|   607k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|   607k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
                      if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      0|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1148:13): [True: 0, False: 607k]
  ------------------
 1149|   607k|      }
 1150|   835k|    } else {
 1151|       |      // Handle "current block width > above block width" case.
 1152|   106k|      for (int i = 0; i < AOMMIN(xd->width, cm->mi_params.mi_cols - mi_col);
  ------------------
  |  |   34|   106k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 89.5k, False: 16.6k]
  |  |  ------------------
  ------------------
  |  Branch (1152:23): [True: 71.2k, False: 34.8k]
  ------------------
 1153|  71.2k|           i += superblock_width) {
 1154|  71.2k|        mbmi = xd->mi[i + mi_row_offset * mi_stride];
 1155|  71.2k|        superblock_width = mi_size_wide[mbmi->bsize];
 1156|       |
 1157|  71.2k|        if (mbmi->ref_frame[0] == ref_frame &&
  ------------------
  |  Branch (1157:13): [True: 53.0k, False: 18.1k]
  ------------------
 1158|  53.0k|            mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1158:13): [True: 53.0k, False: 1]
  ------------------
 1159|  53.0k|          record_samples(mbmi, pts, pts_inref, 0, -1, i, 1);
 1160|  53.0k|          pts += 2;
 1161|  53.0k|          pts_inref += 2;
 1162|  53.0k|          if (++np >= LEAST_SQUARES_SAMPLES_MAX)
  ------------------
  |  |   29|  53.0k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|  53.0k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1162:15): [True: 3, False: 53.0k]
  ------------------
 1163|      3|            return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      3|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      3|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
 1164|  53.0k|        }
 1165|  71.2k|      }
 1166|  34.9k|    }
 1167|   870k|  }
 1168|  1.06M|  assert(np <= LEAST_SQUARES_SAMPLES_MAX);
 1169|       |
 1170|       |  // scan the nearest left columns
 1171|  1.06M|  if (left_available) {
  ------------------
  |  Branch (1171:7): [True: 866k, False: 195k]
  ------------------
 1172|   866k|    const int mi_col_offset = -1;
 1173|   866k|    const MB_MODE_INFO *mbmi = xd->mi[mi_col_offset];
 1174|   866k|    uint8_t superblock_height = mi_size_high[mbmi->bsize];
 1175|       |
 1176|   866k|    if (xd->height <= superblock_height) {
  ------------------
  |  Branch (1176:9): [True: 831k, False: 35.2k]
  ------------------
 1177|       |      // Handle "current block height <= above block height" case.
 1178|   831k|      const int row_offset = -mi_row % superblock_height;
 1179|       |
 1180|   831k|      if (row_offset < 0) do_tl = 0;
  ------------------
  |  Branch (1180:11): [True: 34.6k, False: 796k]
  ------------------
 1181|       |
 1182|   831k|      if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1182:11): [True: 602k, False: 228k]
  |  Branch (1182:46): [True: 602k, False: 18.4E]
  ------------------
 1183|   602k|        record_samples(mbmi, pts, pts_inref, row_offset, 1, 0, -1);
 1184|   602k|        pts += 2;
 1185|   602k|        pts_inref += 2;
 1186|   602k|        np++;
 1187|   602k|        if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|   602k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|   602k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
                      if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      3|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      3|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1187:13): [True: 3, False: 602k]
  ------------------
 1188|   602k|      }
 1189|   831k|    } else {
 1190|       |      // Handle "current block height > above block height" case.
 1191|   107k|      for (int i = 0; i < AOMMIN(xd->height, cm->mi_params.mi_rows - mi_row);
  ------------------
  |  |   34|   107k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 87.8k, False: 19.4k]
  |  |  ------------------
  ------------------
  |  Branch (1191:23): [True: 72.0k, False: 35.2k]
  ------------------
 1192|  72.0k|           i += superblock_height) {
 1193|  72.0k|        mbmi = xd->mi[mi_col_offset + i * mi_stride];
 1194|  72.0k|        superblock_height = mi_size_high[mbmi->bsize];
 1195|       |
 1196|  72.0k|        if (mbmi->ref_frame[0] == ref_frame &&
  ------------------
  |  Branch (1196:13): [True: 53.5k, False: 18.4k]
  ------------------
 1197|  53.5k|            mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1197:13): [True: 53.5k, False: 1]
  ------------------
 1198|  53.5k|          record_samples(mbmi, pts, pts_inref, i, 1, 0, -1);
 1199|  53.5k|          pts += 2;
 1200|  53.5k|          pts_inref += 2;
 1201|  53.5k|          if (++np >= LEAST_SQUARES_SAMPLES_MAX)
  ------------------
  |  |   29|  53.5k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|  53.5k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1201:15): [True: 3, False: 53.5k]
  ------------------
 1202|      3|            return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      3|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      3|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
 1203|  53.5k|        }
 1204|  72.0k|      }
 1205|  35.2k|    }
 1206|   866k|  }
 1207|  1.06M|  assert(np <= LEAST_SQUARES_SAMPLES_MAX);
 1208|       |
 1209|       |  // Top-left block
 1210|  1.06M|  if (do_tl && left_available && up_available) {
  ------------------
  |  Branch (1210:7): [True: 996k, False: 65.8k]
  |  Branch (1210:16): [True: 799k, False: 196k]
  |  Branch (1210:34): [True: 640k, False: 159k]
  ------------------
 1211|   640k|    const int mi_row_offset = -1;
 1212|   640k|    const int mi_col_offset = -1;
 1213|   640k|    MB_MODE_INFO *mbmi = xd->mi[mi_col_offset + mi_row_offset * mi_stride];
 1214|       |
 1215|   640k|    if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1215:9): [True: 425k, False: 215k]
  |  Branch (1215:44): [True: 425k, False: 18.4E]
  ------------------
 1216|   425k|      record_samples(mbmi, pts, pts_inref, 0, -1, 0, -1);
 1217|   425k|      pts += 2;
 1218|   425k|      pts_inref += 2;
 1219|   425k|      if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|   425k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|   425k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
                    if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      5|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      5|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1219:11): [True: 5, False: 425k]
  ------------------
 1220|   425k|    }
 1221|   640k|  }
 1222|  1.06M|  assert(np <= LEAST_SQUARES_SAMPLES_MAX);
 1223|       |
 1224|       |  // Top-right block
 1225|  1.06M|  if (do_tr &&
  ------------------
  |  Branch (1225:7): [True: 1.03M, False: 27.7k]
  ------------------
 1226|  1.03M|      has_top_right(cm, xd, mi_row, mi_col, AOMMAX(xd->width, xd->height))) {
  ------------------
  |  |   35|  1.03M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 20.9k, False: 1.01M]
  |  |  ------------------
  ------------------
  |  Branch (1226:7): [True: 742k, False: 291k]
  ------------------
 1227|   742k|    const POSITION trb_pos = { -1, xd->width };
 1228|   742k|    const TileInfo *const tile = &xd->tile;
 1229|   742k|    if (is_inside(tile, mi_col, mi_row, &trb_pos)) {
  ------------------
  |  Branch (1229:9): [True: 456k, False: 285k]
  ------------------
 1230|   456k|      const int mi_row_offset = -1;
 1231|   456k|      const int mi_col_offset = xd->width;
 1232|   456k|      const MB_MODE_INFO *mbmi =
 1233|   456k|          xd->mi[mi_col_offset + mi_row_offset * mi_stride];
 1234|       |
 1235|   456k|      if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
  ------------------
  |  Branch (1235:11): [True: 309k, False: 147k]
  |  Branch (1235:46): [True: 309k, False: 18.4E]
  ------------------
 1236|   309k|        record_samples(mbmi, pts, pts_inref, 0, -1, xd->width, 1);
 1237|   309k|        if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|   309k|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|   309k|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
                      if (++np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
  ------------------
  |  |   29|      6|#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
  |  |  ------------------
  |  |  |  |   28|      6|#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (1237:13): [True: 6, False: 309k]
  ------------------
 1238|   309k|      }
 1239|   456k|    }
 1240|   742k|  }
 1241|  1.06M|  assert(np <= LEAST_SQUARES_SAMPLES_MAX);
 1242|       |
 1243|  1.06M|  return np;
 1244|  1.06M|}
av1_setup_skip_mode_allowed:
 1246|   101k|void av1_setup_skip_mode_allowed(AV1_COMMON *cm) {
 1247|   101k|  const OrderHintInfo *const order_hint_info = &cm->seq_params->order_hint_info;
 1248|   101k|  SkipModeInfo *const skip_mode_info = &cm->current_frame.skip_mode_info;
 1249|       |
 1250|   101k|  skip_mode_info->skip_mode_allowed = 0;
 1251|   101k|  skip_mode_info->ref_frame_idx_0 = INVALID_IDX;
  ------------------
  |  |   15|   101k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1252|   101k|  skip_mode_info->ref_frame_idx_1 = INVALID_IDX;
  ------------------
  |  |   15|   101k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1253|       |
 1254|   101k|  if (!order_hint_info->enable_order_hint || frame_is_intra_only(cm) ||
  ------------------
  |  Branch (1254:7): [True: 0, False: 101k]
  |  Branch (1254:46): [True: 25.4k, False: 76.2k]
  ------------------
 1255|  76.2k|      cm->current_frame.reference_mode == SINGLE_REFERENCE)
  ------------------
  |  Branch (1255:7): [True: 27.8k, False: 48.4k]
  ------------------
 1256|  53.2k|    return;
 1257|       |
 1258|  48.4k|  const int cur_order_hint = cm->current_frame.order_hint;
 1259|  48.4k|  int ref_order_hints[2] = { -1, INT_MAX };
 1260|  48.4k|  int ref_idx[2] = { INVALID_IDX, INVALID_IDX };
  ------------------
  |  |   15|  48.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
                int ref_idx[2] = { INVALID_IDX, INVALID_IDX };
  ------------------
  |  |   15|  48.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1261|       |
 1262|       |  // Identify the nearest forward and backward references.
 1263|   387k|  for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (1263:19): [True: 339k, False: 48.4k]
  ------------------
 1264|   339k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, LAST_FRAME + i);
 1265|   339k|    if (buf == NULL) continue;
  ------------------
  |  Branch (1265:9): [True: 0, False: 339k]
  ------------------
 1266|       |
 1267|   339k|    const int ref_order_hint = buf->order_hint;
 1268|   339k|    if (get_relative_dist(order_hint_info, ref_order_hint, cur_order_hint) <
  ------------------
  |  Branch (1268:9): [True: 339k, False: 0]
  ------------------
 1269|   339k|        0) {
 1270|       |      // Forward reference
 1271|   339k|      if (ref_order_hints[0] == -1 ||
  ------------------
  |  Branch (1271:11): [True: 48.4k, False: 290k]
  ------------------
 1272|   290k|          get_relative_dist(order_hint_info, ref_order_hint,
  ------------------
  |  Branch (1272:11): [True: 0, False: 290k]
  ------------------
 1273|   290k|                            ref_order_hints[0]) > 0) {
 1274|  48.4k|        ref_order_hints[0] = ref_order_hint;
 1275|  48.4k|        ref_idx[0] = i;
 1276|  48.4k|      }
 1277|   339k|    } else if (get_relative_dist(order_hint_info, ref_order_hint,
  ------------------
  |  Branch (1277:16): [True: 0, False: 0]
  ------------------
 1278|      0|                                 cur_order_hint) > 0) {
 1279|       |      // Backward reference
 1280|      0|      if (ref_order_hints[1] == INT_MAX ||
  ------------------
  |  Branch (1280:11): [True: 0, False: 0]
  ------------------
 1281|      0|          get_relative_dist(order_hint_info, ref_order_hint,
  ------------------
  |  Branch (1281:11): [True: 0, False: 0]
  ------------------
 1282|      0|                            ref_order_hints[1]) < 0) {
 1283|      0|        ref_order_hints[1] = ref_order_hint;
 1284|      0|        ref_idx[1] = i;
 1285|      0|      }
 1286|      0|    }
 1287|   339k|  }
 1288|       |
 1289|  48.4k|  if (ref_idx[0] != INVALID_IDX && ref_idx[1] != INVALID_IDX) {
  ------------------
  |  |   15|  96.9k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
                if (ref_idx[0] != INVALID_IDX && ref_idx[1] != INVALID_IDX) {
  ------------------
  |  |   15|  48.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1289:7): [True: 48.4k, False: 0]
  |  Branch (1289:36): [True: 0, False: 48.4k]
  ------------------
 1290|       |    // == Bi-directional prediction ==
 1291|      0|    skip_mode_info->skip_mode_allowed = 1;
 1292|      0|    skip_mode_info->ref_frame_idx_0 = AOMMIN(ref_idx[0], ref_idx[1]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1293|      0|    skip_mode_info->ref_frame_idx_1 = AOMMAX(ref_idx[0], ref_idx[1]);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1294|  48.4k|  } else if (ref_idx[0] != INVALID_IDX && ref_idx[1] == INVALID_IDX) {
  ------------------
  |  |   15|  96.9k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
                } else if (ref_idx[0] != INVALID_IDX && ref_idx[1] == INVALID_IDX) {
  ------------------
  |  |   15|  48.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1294:14): [True: 48.4k, False: 0]
  |  Branch (1294:43): [True: 48.4k, False: 0]
  ------------------
 1295|       |    // == Forward prediction only ==
 1296|       |    // Identify the second nearest forward reference.
 1297|  48.4k|    ref_order_hints[1] = -1;
 1298|   387k|    for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (1298:21): [True: 339k, False: 48.4k]
  ------------------
 1299|   339k|      const RefCntBuffer *const buf = get_ref_frame_buf(cm, LAST_FRAME + i);
 1300|   339k|      if (buf == NULL) continue;
  ------------------
  |  Branch (1300:11): [True: 0, False: 339k]
  ------------------
 1301|       |
 1302|   339k|      const int ref_order_hint = buf->order_hint;
 1303|   339k|      if ((ref_order_hints[0] != -1 &&
  ------------------
  |  Branch (1303:12): [True: 339k, False: 0]
  ------------------
 1304|   339k|           get_relative_dist(order_hint_info, ref_order_hint,
  ------------------
  |  Branch (1304:12): [True: 0, False: 339k]
  ------------------
 1305|   339k|                             ref_order_hints[0]) < 0) &&
 1306|      0|          (ref_order_hints[1] == -1 ||
  ------------------
  |  Branch (1306:12): [True: 0, False: 0]
  ------------------
 1307|      0|           get_relative_dist(order_hint_info, ref_order_hint,
  ------------------
  |  Branch (1307:12): [True: 0, False: 0]
  ------------------
 1308|      0|                             ref_order_hints[1]) > 0)) {
 1309|       |        // Second closest forward reference
 1310|      0|        ref_order_hints[1] = ref_order_hint;
 1311|      0|        ref_idx[1] = i;
 1312|      0|      }
 1313|   339k|    }
 1314|  48.4k|    if (ref_order_hints[1] != -1) {
  ------------------
  |  Branch (1314:9): [True: 0, False: 48.4k]
  ------------------
 1315|      0|      skip_mode_info->skip_mode_allowed = 1;
 1316|      0|      skip_mode_info->ref_frame_idx_0 = AOMMIN(ref_idx[0], ref_idx[1]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1317|      0|      skip_mode_info->ref_frame_idx_1 = AOMMAX(ref_idx[0], ref_idx[1]);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1318|      0|    }
 1319|  48.4k|  }
 1320|  48.4k|}
mvref_common.c:setup_ref_mv_list:
  485|  2.84M|    int mi_row, int mi_col, int16_t *mode_context) {
  486|  2.84M|  const int bs = AOMMAX(xd->width, xd->height);
  ------------------
  |  |   35|  2.84M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 101k, False: 2.74M]
  |  |  ------------------
  ------------------
  487|  2.84M|  const int has_tr = has_top_right(cm, xd, mi_row, mi_col, bs);
  488|  2.84M|  MV_REFERENCE_FRAME rf[2];
  489|       |
  490|  2.84M|  const TileInfo *const tile = &xd->tile;
  491|  2.84M|  int max_row_offset = 0, max_col_offset = 0;
  492|  2.84M|  const int row_adj = (xd->height < mi_size_high[BLOCK_8X8]) && (mi_row & 0x01);
  ------------------
  |  Branch (492:23): [True: 396k, False: 2.44M]
  |  Branch (492:65): [True: 180k, False: 215k]
  ------------------
  493|  2.84M|  const int col_adj = (xd->width < mi_size_wide[BLOCK_8X8]) && (mi_col & 0x01);
  ------------------
  |  Branch (493:23): [True: 378k, False: 2.46M]
  |  Branch (493:64): [True: 179k, False: 199k]
  ------------------
  494|  2.84M|  int processed_rows = 0;
  495|  2.84M|  int processed_cols = 0;
  496|       |
  497|  2.84M|  av1_set_ref_frame(rf, ref_frame);
  498|  2.84M|  mode_context[ref_frame] = 0;
  499|  2.84M|  *refmv_count = 0;
  500|       |
  501|       |  // Find valid maximum row/col offset.
  502|  2.84M|  if (xd->up_available) {
  ------------------
  |  Branch (502:7): [True: 2.16M, False: 680k]
  ------------------
  503|  2.16M|    max_row_offset = -(MVREF_ROW_COLS << 1) + row_adj;
  ------------------
  |  |   21|  2.16M|#define MVREF_ROW_COLS 3
  ------------------
  504|       |
  505|  2.16M|    if (xd->height < mi_size_high[BLOCK_8X8])
  ------------------
  |  Branch (505:9): [True: 298k, False: 1.86M]
  ------------------
  506|   298k|      max_row_offset = -(2 << 1) + row_adj;
  507|       |
  508|  2.16M|    max_row_offset = find_valid_row_offset(tile, mi_row, max_row_offset);
  509|  2.16M|  }
  510|       |
  511|  2.84M|  if (xd->left_available) {
  ------------------
  |  Branch (511:7): [True: 2.16M, False: 676k]
  ------------------
  512|  2.16M|    max_col_offset = -(MVREF_ROW_COLS << 1) + col_adj;
  ------------------
  |  |   21|  2.16M|#define MVREF_ROW_COLS 3
  ------------------
  513|       |
  514|  2.16M|    if (xd->width < mi_size_wide[BLOCK_8X8])
  ------------------
  |  Branch (514:9): [True: 288k, False: 1.87M]
  ------------------
  515|   288k|      max_col_offset = -(2 << 1) + col_adj;
  516|       |
  517|  2.16M|    max_col_offset = find_valid_col_offset(tile, mi_col, max_col_offset);
  518|  2.16M|  }
  519|       |
  520|  2.84M|  uint8_t col_match_count = 0;
  521|  2.84M|  uint8_t row_match_count = 0;
  522|  2.84M|  uint8_t newmv_count = 0;
  523|       |
  524|       |  // Scan the first above row mode info. row_offset = -1;
  525|  2.84M|  if (abs(max_row_offset) >= 1)
  ------------------
  |  Branch (525:7): [True: 2.16M, False: 680k]
  ------------------
  526|  2.16M|    scan_row_mbmi(cm, xd, mi_col, rf, -1, ref_mv_stack, ref_mv_weight,
  527|  2.16M|                  refmv_count, &row_match_count, &newmv_count, gm_mv_candidates,
  528|  2.16M|                  max_row_offset, &processed_rows);
  529|       |  // Scan the first left column mode info. col_offset = -1;
  530|  2.84M|  if (abs(max_col_offset) >= 1)
  ------------------
  |  Branch (530:7): [True: 2.16M, False: 676k]
  ------------------
  531|  2.16M|    scan_col_mbmi(cm, xd, mi_row, rf, -1, ref_mv_stack, ref_mv_weight,
  532|  2.16M|                  refmv_count, &col_match_count, &newmv_count, gm_mv_candidates,
  533|  2.16M|                  max_col_offset, &processed_cols);
  534|       |  // Check top-right boundary
  535|  2.84M|  if (has_tr)
  ------------------
  |  Branch (535:7): [True: 2.12M, False: 716k]
  ------------------
  536|  2.12M|    scan_blk_mbmi(cm, xd, mi_row, mi_col, rf, -1, xd->width, ref_mv_stack,
  537|  2.12M|                  ref_mv_weight, &row_match_count, &newmv_count,
  538|  2.12M|                  gm_mv_candidates, refmv_count);
  539|       |
  540|  2.84M|  const uint8_t nearest_match = (row_match_count > 0) + (col_match_count > 0);
  541|  2.84M|  const uint8_t nearest_refmv_count = *refmv_count;
  542|       |
  543|       |  // TODO(yunqing): for comp_search, do it for all 3 cases.
  544|  4.23M|  for (int idx = 0; idx < nearest_refmv_count; ++idx)
  ------------------
  |  Branch (544:21): [True: 1.38M, False: 2.84M]
  ------------------
  545|  1.38M|    ref_mv_weight[idx] += REF_CAT_LEVEL;
  ------------------
  |  |  512|  1.38M|#define REF_CAT_LEVEL 640
  ------------------
  546|       |
  547|  2.84M|  if (cm->features.allow_ref_frame_mvs) {
  ------------------
  |  Branch (547:7): [True: 2.77M, False: 71.2k]
  ------------------
  548|  2.77M|    int is_available = 0;
  549|  2.77M|    const int voffset = AOMMAX(mi_size_high[BLOCK_8X8], xd->height);
  ------------------
  |  |   35|  2.77M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 350k, False: 2.42M]
  |  |  ------------------
  ------------------
  550|  2.77M|    const int hoffset = AOMMAX(mi_size_wide[BLOCK_8X8], xd->width);
  ------------------
  |  |   35|  2.77M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 336k, False: 2.43M]
  |  |  ------------------
  ------------------
  551|  2.77M|    const int blk_row_end = AOMMIN(xd->height, mi_size_high[BLOCK_64X64]);
  ------------------
  |  |   34|  2.77M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.69M, False: 79.6k]
  |  |  ------------------
  ------------------
  552|  2.77M|    const int blk_col_end = AOMMIN(xd->width, mi_size_wide[BLOCK_64X64]);
  ------------------
  |  |   34|  2.77M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.69M, False: 79.3k]
  |  |  ------------------
  ------------------
  553|       |
  554|  2.77M|    const int tpl_sample_pos[3][2] = {
  555|  2.77M|      { voffset, -2 },
  556|  2.77M|      { voffset, hoffset },
  557|  2.77M|      { voffset - 2, hoffset },
  558|  2.77M|    };
  559|  2.77M|    const int allow_extension = (xd->height >= mi_size_high[BLOCK_8X8]) &&
  ------------------
  |  Branch (559:33): [True: 2.42M, False: 351k]
  ------------------
  560|  2.42M|                                (xd->height < mi_size_high[BLOCK_64X64]) &&
  ------------------
  |  Branch (560:33): [True: 2.34M, False: 79.5k]
  ------------------
  561|  2.34M|                                (xd->width >= mi_size_wide[BLOCK_8X8]) &&
  ------------------
  |  Branch (561:33): [True: 2.29M, False: 47.6k]
  ------------------
  562|  2.29M|                                (xd->width < mi_size_wide[BLOCK_64X64]);
  ------------------
  |  Branch (562:33): [True: 2.29M, False: 18.4E]
  ------------------
  563|       |
  564|  2.77M|    const int step_h = (xd->height >= mi_size_high[BLOCK_64X64])
  ------------------
  |  Branch (564:24): [True: 79.7k, False: 2.69M]
  ------------------
  565|  2.77M|                           ? mi_size_high[BLOCK_16X16]
  566|  2.77M|                           : mi_size_high[BLOCK_8X8];
  567|  2.77M|    const int step_w = (xd->width >= mi_size_wide[BLOCK_64X64])
  ------------------
  |  Branch (567:24): [True: 79.5k, False: 2.69M]
  ------------------
  568|  2.77M|                           ? mi_size_wide[BLOCK_16X16]
  569|  2.77M|                           : mi_size_wide[BLOCK_8X8];
  570|       |
  571|  6.10M|    for (int blk_row = 0; blk_row < blk_row_end; blk_row += step_h) {
  ------------------
  |  Branch (571:27): [True: 3.33M, False: 2.77M]
  ------------------
  572|  8.43M|      for (int blk_col = 0; blk_col < blk_col_end; blk_col += step_w) {
  ------------------
  |  Branch (572:29): [True: 5.09M, False: 3.33M]
  ------------------
  573|  5.09M|        int ret = add_tpl_ref_mv(cm, xd, mi_row, mi_col, ref_frame, blk_row,
  574|  5.09M|                                 blk_col, gm_mv_candidates, refmv_count,
  575|  5.09M|                                 ref_mv_stack, ref_mv_weight, mode_context);
  576|  5.09M|        if (blk_row == 0 && blk_col == 0) is_available = ret;
  ------------------
  |  Branch (576:13): [True: 3.32M, False: 1.76M]
  |  Branch (576:29): [True: 2.77M, False: 554k]
  ------------------
  577|  5.09M|      }
  578|  3.33M|    }
  579|       |
  580|  2.77M|    if (is_available == 0) mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
  ------------------
  |  |  487|  2.68M|#define GLOBALMV_OFFSET 3
  ------------------
  |  Branch (580:9): [True: 2.68M, False: 90.2k]
  ------------------
  581|       |
  582|  9.65M|    for (int i = 0; i < 3 && allow_extension; ++i) {
  ------------------
  |  Branch (582:21): [True: 7.36M, False: 2.29M]
  |  Branch (582:30): [True: 6.88M, False: 477k]
  ------------------
  583|  6.88M|      const int blk_row = tpl_sample_pos[i][0];
  584|  6.88M|      const int blk_col = tpl_sample_pos[i][1];
  585|       |
  586|  6.88M|      if (!check_sb_border(mi_row, mi_col, blk_row, blk_col)) continue;
  ------------------
  |  Branch (586:11): [True: 1.35M, False: 5.53M]
  ------------------
  587|  5.53M|      add_tpl_ref_mv(cm, xd, mi_row, mi_col, ref_frame, blk_row, blk_col,
  588|  5.53M|                     gm_mv_candidates, refmv_count, ref_mv_stack, ref_mv_weight,
  589|  5.53M|                     mode_context);
  590|  5.53M|    }
  591|  2.77M|  }
  592|       |
  593|  2.84M|  uint8_t dummy_newmv_count = 0;
  594|       |
  595|       |  // Scan the second outer area.
  596|  2.84M|  scan_blk_mbmi(cm, xd, mi_row, mi_col, rf, -1, -1, ref_mv_stack, ref_mv_weight,
  597|  2.84M|                &row_match_count, &dummy_newmv_count, gm_mv_candidates,
  598|  2.84M|                refmv_count);
  599|       |
  600|  8.53M|  for (int idx = 2; idx <= MVREF_ROW_COLS; ++idx) {
  ------------------
  |  |   21|  8.53M|#define MVREF_ROW_COLS 3
  ------------------
  |  Branch (600:21): [True: 5.69M, False: 2.84M]
  ------------------
  601|  5.69M|    const int row_offset = -(idx << 1) + 1 + row_adj;
  602|  5.69M|    const int col_offset = -(idx << 1) + 1 + col_adj;
  603|       |
  604|  5.69M|    if (abs(row_offset) <= abs(max_row_offset) &&
  ------------------
  |  Branch (604:9): [True: 3.01M, False: 2.67M]
  ------------------
  605|  3.01M|        abs(row_offset) > processed_rows)
  ------------------
  |  Branch (605:9): [True: 2.70M, False: 309k]
  ------------------
  606|  2.70M|      scan_row_mbmi(cm, xd, mi_col, rf, row_offset, ref_mv_stack, ref_mv_weight,
  607|  2.70M|                    refmv_count, &row_match_count, &dummy_newmv_count,
  608|  2.70M|                    gm_mv_candidates, max_row_offset, &processed_rows);
  609|       |
  610|  5.69M|    if (abs(col_offset) <= abs(max_col_offset) &&
  ------------------
  |  Branch (610:9): [True: 3.03M, False: 2.65M]
  ------------------
  611|  3.03M|        abs(col_offset) > processed_cols)
  ------------------
  |  Branch (611:9): [True: 2.73M, False: 300k]
  ------------------
  612|  2.73M|      scan_col_mbmi(cm, xd, mi_row, rf, col_offset, ref_mv_stack, ref_mv_weight,
  613|  2.73M|                    refmv_count, &col_match_count, &dummy_newmv_count,
  614|  2.73M|                    gm_mv_candidates, max_col_offset, &processed_cols);
  615|  5.69M|  }
  616|       |
  617|  2.84M|  const uint8_t ref_match_count = (row_match_count > 0) + (col_match_count > 0);
  618|       |
  619|  2.84M|  switch (nearest_match) {
  620|  1.86M|    case 0:
  ------------------
  |  Branch (620:5): [True: 1.86M, False: 975k]
  ------------------
  621|  1.86M|      if (ref_match_count >= 1) mode_context[ref_frame] |= 1;
  ------------------
  |  Branch (621:11): [True: 192k, False: 1.67M]
  ------------------
  622|  1.86M|      if (ref_match_count == 1)
  ------------------
  |  Branch (622:11): [True: 160k, False: 1.70M]
  ------------------
  623|   160k|        mode_context[ref_frame] |= (1 << REFMV_OFFSET);
  ------------------
  |  |  488|   160k|#define REFMV_OFFSET 4
  ------------------
  624|  1.70M|      else if (ref_match_count >= 2)
  ------------------
  |  Branch (624:16): [True: 32.3k, False: 1.67M]
  ------------------
  625|  32.3k|        mode_context[ref_frame] |= (2 << REFMV_OFFSET);
  ------------------
  |  |  488|  32.3k|#define REFMV_OFFSET 4
  ------------------
  626|  1.86M|      break;
  627|   630k|    case 1:
  ------------------
  |  Branch (627:5): [True: 630k, False: 2.21M]
  ------------------
  628|   630k|      mode_context[ref_frame] |= (newmv_count > 0) ? 2 : 3;
  ------------------
  |  Branch (628:34): [True: 362k, False: 268k]
  ------------------
  629|   630k|      if (ref_match_count == 1)
  ------------------
  |  Branch (629:11): [True: 459k, False: 170k]
  ------------------
  630|   459k|        mode_context[ref_frame] |= (3 << REFMV_OFFSET);
  ------------------
  |  |  488|   459k|#define REFMV_OFFSET 4
  ------------------
  631|   170k|      else if (ref_match_count >= 2)
  ------------------
  |  Branch (631:16): [True: 171k, False: 18.4E]
  ------------------
  632|   171k|        mode_context[ref_frame] |= (4 << REFMV_OFFSET);
  ------------------
  |  |  488|   171k|#define REFMV_OFFSET 4
  ------------------
  633|   630k|      break;
  634|   347k|    case 2:
  ------------------
  |  Branch (634:5): [True: 347k, False: 2.49M]
  ------------------
  635|   347k|    default:
  ------------------
  |  Branch (635:5): [True: 0, False: 2.84M]
  ------------------
  636|   347k|      if (newmv_count >= 1)
  ------------------
  |  Branch (636:11): [True: 240k, False: 107k]
  ------------------
  637|   240k|        mode_context[ref_frame] |= 4;
  638|   107k|      else
  639|   107k|        mode_context[ref_frame] |= 5;
  640|       |
  641|   347k|      mode_context[ref_frame] |= (5 << REFMV_OFFSET);
  ------------------
  |  |  488|   347k|#define REFMV_OFFSET 4
  ------------------
  642|   347k|      break;
  643|  2.84M|  }
  644|       |
  645|       |  // Rank the likelihood and assign nearest and near mvs.
  646|  2.84M|  int len = nearest_refmv_count;
  647|  3.88M|  while (len > 0) {
  ------------------
  |  Branch (647:10): [True: 1.04M, False: 2.84M]
  ------------------
  648|  1.04M|    int nr_len = 0;
  649|  1.45M|    for (int idx = 1; idx < len; ++idx) {
  ------------------
  |  Branch (649:23): [True: 417k, False: 1.04M]
  ------------------
  650|   417k|      if (ref_mv_weight[idx - 1] < ref_mv_weight[idx]) {
  ------------------
  |  Branch (650:11): [True: 67.0k, False: 350k]
  ------------------
  651|  67.0k|        const CANDIDATE_MV tmp_mv = ref_mv_stack[idx - 1];
  652|  67.0k|        const uint16_t tmp_ref_mv_weight = ref_mv_weight[idx - 1];
  653|  67.0k|        ref_mv_stack[idx - 1] = ref_mv_stack[idx];
  654|  67.0k|        ref_mv_stack[idx] = tmp_mv;
  655|  67.0k|        ref_mv_weight[idx - 1] = ref_mv_weight[idx];
  656|  67.0k|        ref_mv_weight[idx] = tmp_ref_mv_weight;
  657|  67.0k|        nr_len = idx;
  658|  67.0k|      }
  659|   417k|    }
  660|  1.04M|    len = nr_len;
  661|  1.04M|  }
  662|       |
  663|  2.84M|  len = *refmv_count;
  664|  3.76M|  while (len > nearest_refmv_count) {
  ------------------
  |  Branch (664:10): [True: 914k, False: 2.84M]
  ------------------
  665|   914k|    int nr_len = nearest_refmv_count;
  666|  1.69M|    for (int idx = nearest_refmv_count + 1; idx < len; ++idx) {
  ------------------
  |  Branch (666:45): [True: 782k, False: 914k]
  ------------------
  667|   782k|      if (ref_mv_weight[idx - 1] < ref_mv_weight[idx]) {
  ------------------
  |  Branch (667:11): [True: 149k, False: 632k]
  ------------------
  668|   149k|        const CANDIDATE_MV tmp_mv = ref_mv_stack[idx - 1];
  669|   149k|        const uint16_t tmp_ref_mv_weight = ref_mv_weight[idx - 1];
  670|   149k|        ref_mv_stack[idx - 1] = ref_mv_stack[idx];
  671|   149k|        ref_mv_stack[idx] = tmp_mv;
  672|   149k|        ref_mv_weight[idx - 1] = ref_mv_weight[idx];
  673|   149k|        ref_mv_weight[idx] = tmp_ref_mv_weight;
  674|   149k|        nr_len = idx;
  675|   149k|      }
  676|   782k|    }
  677|   914k|    len = nr_len;
  678|   914k|  }
  679|       |
  680|  2.84M|  int mi_width = AOMMIN(mi_size_wide[BLOCK_64X64], xd->width);
  ------------------
  |  |   34|  2.84M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.84M]
  |  |  ------------------
  ------------------
  681|  2.84M|  mi_width = AOMMIN(mi_width, cm->mi_params.mi_cols - mi_col);
  ------------------
  |  |   34|  2.84M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.35M, False: 491k]
  |  |  ------------------
  ------------------
  682|  2.84M|  int mi_height = AOMMIN(mi_size_high[BLOCK_64X64], xd->height);
  ------------------
  |  |   34|  2.84M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.84M]
  |  |  ------------------
  ------------------
  683|  2.84M|  mi_height = AOMMIN(mi_height, cm->mi_params.mi_rows - mi_row);
  ------------------
  |  |   34|  2.84M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.37M, False: 473k]
  |  |  ------------------
  ------------------
  684|  2.84M|  const int mi_size = AOMMIN(mi_width, mi_height);
  ------------------
  |  |   34|  2.84M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 125k, False: 2.72M]
  |  |  ------------------
  ------------------
  685|  2.84M|  if (rf[1] > NONE_FRAME) {
  ------------------
  |  Branch (685:7): [True: 0, False: 2.84M]
  ------------------
  686|       |    // TODO(jingning, yunqing): Refactor and consolidate the compound and
  687|       |    // single reference frame modes. Reduce unnecessary redundancy.
  688|      0|    if (*refmv_count < MAX_MV_REF_CANDIDATES) {
  ------------------
  |  |  508|      0|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (688:9): [True: 0, False: 0]
  ------------------
  689|      0|      int_mv ref_id[2][2], ref_diff[2][2];
  690|      0|      int ref_id_count[2] = { 0 }, ref_diff_count[2] = { 0 };
  691|       |
  692|      0|      for (int idx = 0; abs(max_row_offset) >= 1 && idx < mi_size;) {
  ------------------
  |  Branch (692:25): [True: 0, False: 0]
  |  Branch (692:53): [True: 0, False: 0]
  ------------------
  693|      0|        const MB_MODE_INFO *const candidate = xd->mi[-xd->mi_stride + idx];
  694|      0|        process_compound_ref_mv_candidate(
  695|      0|            candidate, cm, rf, ref_id, ref_id_count, ref_diff, ref_diff_count);
  696|      0|        idx += mi_size_wide[candidate->bsize];
  697|      0|      }
  698|       |
  699|      0|      for (int idx = 0; abs(max_col_offset) >= 1 && idx < mi_size;) {
  ------------------
  |  Branch (699:25): [True: 0, False: 0]
  |  Branch (699:53): [True: 0, False: 0]
  ------------------
  700|      0|        const MB_MODE_INFO *const candidate = xd->mi[idx * xd->mi_stride - 1];
  701|      0|        process_compound_ref_mv_candidate(
  702|      0|            candidate, cm, rf, ref_id, ref_id_count, ref_diff, ref_diff_count);
  703|      0|        idx += mi_size_high[candidate->bsize];
  704|      0|      }
  705|       |
  706|       |      // Build up the compound mv predictor
  707|      0|      int_mv comp_list[MAX_MV_REF_CANDIDATES][2];
  708|       |
  709|      0|      for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (709:25): [True: 0, False: 0]
  ------------------
  710|      0|        int comp_idx = 0;
  711|      0|        for (int list_idx = 0;
  712|      0|             list_idx < ref_id_count[idx] && comp_idx < MAX_MV_REF_CANDIDATES;
  ------------------
  |  |  508|      0|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (712:14): [True: 0, False: 0]
  |  Branch (712:46): [True: 0, False: 0]
  ------------------
  713|      0|             ++list_idx, ++comp_idx)
  714|      0|          comp_list[comp_idx][idx] = ref_id[idx][list_idx];
  715|      0|        for (int list_idx = 0;
  716|      0|             list_idx < ref_diff_count[idx] && comp_idx < MAX_MV_REF_CANDIDATES;
  ------------------
  |  |  508|      0|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (716:14): [True: 0, False: 0]
  |  Branch (716:48): [True: 0, False: 0]
  ------------------
  717|      0|             ++list_idx, ++comp_idx)
  718|      0|          comp_list[comp_idx][idx] = ref_diff[idx][list_idx];
  719|      0|        for (; comp_idx < MAX_MV_REF_CANDIDATES; ++comp_idx)
  ------------------
  |  |  508|      0|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (719:16): [True: 0, False: 0]
  ------------------
  720|      0|          comp_list[comp_idx][idx] = gm_mv_candidates[idx];
  721|      0|      }
  722|       |
  723|      0|      if (*refmv_count) {
  ------------------
  |  Branch (723:11): [True: 0, False: 0]
  ------------------
  724|      0|        assert(*refmv_count == 1);
  725|      0|        if (comp_list[0][0].as_int == ref_mv_stack[0].this_mv.as_int &&
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|      0|            comp_list[0][1].as_int == ref_mv_stack[0].comp_mv.as_int) {
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|          ref_mv_stack[*refmv_count].this_mv = comp_list[1][0];
  728|      0|          ref_mv_stack[*refmv_count].comp_mv = comp_list[1][1];
  729|      0|        } else {
  730|      0|          ref_mv_stack[*refmv_count].this_mv = comp_list[0][0];
  731|      0|          ref_mv_stack[*refmv_count].comp_mv = comp_list[0][1];
  732|      0|        }
  733|      0|        ref_mv_weight[*refmv_count] = 2;
  734|      0|        ++*refmv_count;
  735|      0|      } else {
  736|      0|        for (int idx = 0; idx < MAX_MV_REF_CANDIDATES; ++idx) {
  ------------------
  |  |  508|      0|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (736:27): [True: 0, False: 0]
  ------------------
  737|      0|          ref_mv_stack[*refmv_count].this_mv = comp_list[idx][0];
  738|      0|          ref_mv_stack[*refmv_count].comp_mv = comp_list[idx][1];
  739|      0|          ref_mv_weight[*refmv_count] = 2;
  740|      0|          ++*refmv_count;
  741|      0|        }
  742|      0|      }
  743|      0|    }
  744|       |
  745|      0|    assert(*refmv_count >= 2);
  746|       |
  747|      0|    for (int idx = 0; idx < *refmv_count; ++idx) {
  ------------------
  |  Branch (747:23): [True: 0, False: 0]
  ------------------
  748|      0|      clamp_mv_ref(&ref_mv_stack[idx].this_mv.as_mv, xd->width << MI_SIZE_LOG2,
  ------------------
  |  |   39|      0|#define MI_SIZE_LOG2 2
  ------------------
  749|      0|                   xd->height << MI_SIZE_LOG2, xd);
  ------------------
  |  |   39|      0|#define MI_SIZE_LOG2 2
  ------------------
  750|      0|      clamp_mv_ref(&ref_mv_stack[idx].comp_mv.as_mv, xd->width << MI_SIZE_LOG2,
  ------------------
  |  |   39|      0|#define MI_SIZE_LOG2 2
  ------------------
  751|      0|                   xd->height << MI_SIZE_LOG2, xd);
  ------------------
  |  |   39|      0|#define MI_SIZE_LOG2 2
  ------------------
  752|      0|    }
  753|  2.84M|  } else {
  754|       |    // Handle single reference frame extension
  755|  4.41M|    for (int idx = 0; abs(max_row_offset) >= 1 && idx < mi_size &&
  ------------------
  |  Branch (755:23): [True: 3.73M, False: 681k]
  |  Branch (755:51): [True: 2.19M, False: 1.53M]
  ------------------
  756|  2.19M|                      *refmv_count < MAX_MV_REF_CANDIDATES;) {
  ------------------
  |  |  508|  2.19M|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (756:23): [True: 1.56M, False: 630k]
  ------------------
  757|  1.56M|      const MB_MODE_INFO *const candidate = xd->mi[-xd->mi_stride + idx];
  758|  1.56M|      process_single_ref_mv_candidate(candidate, cm, ref_frame, refmv_count,
  759|  1.56M|                                      ref_mv_stack, ref_mv_weight);
  760|  1.56M|      idx += mi_size_wide[candidate->bsize];
  761|  1.56M|    }
  762|       |
  763|  4.44M|    for (int idx = 0; abs(max_col_offset) >= 1 && idx < mi_size &&
  ------------------
  |  Branch (763:23): [True: 3.76M, False: 677k]
  |  Branch (763:51): [True: 2.20M, False: 1.55M]
  ------------------
  764|  2.20M|                      *refmv_count < MAX_MV_REF_CANDIDATES;) {
  ------------------
  |  |  508|  2.20M|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (764:23): [True: 1.59M, False: 609k]
  ------------------
  765|  1.59M|      const MB_MODE_INFO *const candidate = xd->mi[idx * xd->mi_stride - 1];
  766|  1.59M|      process_single_ref_mv_candidate(candidate, cm, ref_frame, refmv_count,
  767|  1.59M|                                      ref_mv_stack, ref_mv_weight);
  768|  1.59M|      idx += mi_size_high[candidate->bsize];
  769|  1.59M|    }
  770|       |
  771|  5.73M|    for (int idx = 0; idx < *refmv_count; ++idx) {
  ------------------
  |  Branch (771:23): [True: 2.88M, False: 2.84M]
  ------------------
  772|  2.88M|      clamp_mv_ref(&ref_mv_stack[idx].this_mv.as_mv, xd->width << MI_SIZE_LOG2,
  ------------------
  |  |   39|  2.88M|#define MI_SIZE_LOG2 2
  ------------------
  773|  2.88M|                   xd->height << MI_SIZE_LOG2, xd);
  ------------------
  |  |   39|  2.88M|#define MI_SIZE_LOG2 2
  ------------------
  774|  2.88M|    }
  775|       |
  776|  2.84M|    if (mv_ref_list != NULL) {
  ------------------
  |  Branch (776:9): [True: 191k, False: 2.65M]
  ------------------
  777|   299k|      for (int idx = *refmv_count; idx < MAX_MV_REF_CANDIDATES; ++idx)
  ------------------
  |  |  508|   299k|#define MAX_MV_REF_CANDIDATES 2
  ------------------
  |  Branch (777:36): [True: 108k, False: 191k]
  ------------------
  778|   108k|        mv_ref_list[idx].as_int = gm_mv_candidates[0].as_int;
  779|       |
  780|   467k|      for (int idx = 0; idx < AOMMIN(MAX_MV_REF_CANDIDATES, *refmv_count);
  ------------------
  |  |   34|   467k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 225k, False: 241k]
  |  |  ------------------
  ------------------
  |  Branch (780:25): [True: 275k, False: 191k]
  ------------------
  781|   275k|           ++idx) {
  782|   275k|        mv_ref_list[idx].as_int = ref_mv_stack[idx].this_mv.as_int;
  783|   275k|      }
  784|   191k|    }
  785|  2.84M|  }
  786|  2.84M|}
mvref_common.c:scan_row_mbmi:
  149|  4.86M|                                 int *processed_rows) {
  150|  4.86M|  int end_mi = AOMMIN(xd->width, cm->mi_params.mi_cols - mi_col);
  ------------------
  |  |   34|  4.86M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.17M, False: 698k]
  |  |  ------------------
  ------------------
  151|  4.86M|  end_mi = AOMMIN(end_mi, mi_size_wide[BLOCK_64X64]);
  ------------------
  |  |   34|  4.86M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.86M, False: 7.57k]
  |  |  ------------------
  ------------------
  152|  4.86M|  const int width_8x8 = mi_size_wide[BLOCK_8X8];
  153|  4.86M|  const int width_16x16 = mi_size_wide[BLOCK_16X16];
  154|  4.86M|  int col_offset = 0;
  155|       |  // TODO(jingning): Revisit this part after cb4x4 is stable.
  156|  4.86M|  if (abs(row_offset) > 1) {
  ------------------
  |  Branch (156:7): [True: 2.70M, False: 2.16M]
  ------------------
  157|  2.70M|    col_offset = 1;
  158|  2.70M|    if ((mi_col & 0x01) && xd->width < width_8x8) --col_offset;
  ------------------
  |  Branch (158:9): [True: 92.5k, False: 2.61M]
  |  Branch (158:28): [True: 92.5k, False: 0]
  ------------------
  159|  2.70M|  }
  160|  4.86M|  const int use_step_16 = (xd->width >= 16);
  161|  4.86M|  MB_MODE_INFO **const candidate_mi0 = xd->mi + row_offset * xd->mi_stride;
  162|       |
  163|  9.89M|  for (int i = 0; i < end_mi;) {
  ------------------
  |  Branch (163:19): [True: 5.02M, False: 4.86M]
  ------------------
  164|  5.02M|    const MB_MODE_INFO *const candidate = candidate_mi0[col_offset + i];
  165|  5.02M|    const int candidate_bsize = candidate->bsize;
  166|  5.02M|    const int n4_w = mi_size_wide[candidate_bsize];
  167|  5.02M|    int len = AOMMIN(xd->width, n4_w);
  ------------------
  |  |   34|  5.02M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 471k, False: 4.55M]
  |  |  ------------------
  ------------------
  168|  5.02M|    if (use_step_16)
  ------------------
  |  Branch (168:9): [True: 50.8k, False: 4.97M]
  ------------------
  169|  50.8k|      len = AOMMAX(width_16x16, len);
  ------------------
  |  |   35|  50.8k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 47.0k, False: 3.79k]
  |  |  ------------------
  ------------------
  170|  4.97M|    else if (abs(row_offset) > 1)
  ------------------
  |  Branch (170:14): [True: 2.76M, False: 2.21M]
  ------------------
  171|  2.76M|      len = AOMMAX(len, width_8x8);
  ------------------
  |  |   35|  2.76M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 85.5k, False: 2.67M]
  |  |  ------------------
  ------------------
  172|       |
  173|  5.02M|    uint16_t weight = 2;
  174|  5.02M|    if (xd->width >= width_8x8 && xd->width <= n4_w) {
  ------------------
  |  Branch (174:9): [True: 4.53M, False: 488k]
  |  Branch (174:35): [True: 4.24M, False: 295k]
  ------------------
  175|  4.24M|      uint16_t inc = AOMMIN(-max_row_offset + row_offset + 1,
  ------------------
  |  |   34|  4.24M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 156k, False: 4.08M]
  |  |  ------------------
  ------------------
  176|  4.24M|                            mi_size_high[candidate_bsize]);
  177|       |      // Obtain range used in weight calculation.
  178|  4.24M|      weight = AOMMAX(weight, inc);
  ------------------
  |  |   35|  4.24M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 40.7k, False: 4.20M]
  |  |  ------------------
  ------------------
  179|       |      // Update processed rows.
  180|  4.24M|      *processed_rows = inc - row_offset - 1;
  181|  4.24M|    }
  182|       |
  183|  5.02M|    add_ref_mv_candidate(candidate, rf, refmv_count, ref_match_count,
  184|  5.02M|                         newmv_count, ref_mv_stack, ref_mv_weight,
  185|  5.02M|                         gm_mv_candidates, cm->global_motion, len * weight);
  186|       |
  187|  5.02M|    i += len;
  188|  5.02M|  }
  189|  4.86M|}
mvref_common.c:add_ref_mv_candidate:
   80|  13.0M|    uint16_t weight) {
   81|  13.0M|  if (!is_inter_block(candidate)) return;
  ------------------
  |  Branch (81:7): [True: 9.42M, False: 3.59M]
  ------------------
   82|  13.0M|  assert(weight % 2 == 0);
   83|  3.59M|  int index, ref;
   84|       |
   85|  3.60M|  if (rf[1] == NONE_FRAME) {
  ------------------
  |  Branch (85:7): [True: 3.60M, False: 18.4E]
  ------------------
   86|       |    // single reference frame
   87|  10.7M|    for (ref = 0; ref < 2; ++ref) {
  ------------------
  |  Branch (87:19): [True: 7.18M, False: 3.60M]
  ------------------
   88|  7.18M|      if (candidate->ref_frame[ref] == rf[0]) {
  ------------------
  |  Branch (88:11): [True: 3.60M, False: 3.58M]
  ------------------
   89|  3.60M|        const int is_gm_block =
   90|  3.60M|            is_global_mv_block(candidate, gm_params[rf[0]].wmtype);
   91|  3.60M|        const int_mv this_refmv =
   92|  3.60M|            is_gm_block ? gm_mv_candidates[0] : get_block_mv(candidate, ref);
  ------------------
  |  Branch (92:13): [True: 0, False: 3.60M]
  ------------------
   93|  7.28M|        for (index = 0; index < *refmv_count; ++index) {
  ------------------
  |  Branch (93:25): [True: 4.56M, False: 2.72M]
  ------------------
   94|  4.56M|          if (ref_mv_stack[index].this_mv.as_int == this_refmv.as_int) {
  ------------------
  |  Branch (94:15): [True: 880k, False: 3.68M]
  ------------------
   95|   880k|            ref_mv_weight[index] += weight;
   96|   880k|            break;
   97|   880k|          }
   98|  4.56M|        }
   99|       |
  100|       |        // Add a new item to the list.
  101|  3.60M|        if (index == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
  ------------------
  |  |  510|  2.72M|#define MAX_REF_MV_STACK_SIZE 8
  ------------------
  |  Branch (101:13): [True: 2.72M, False: 877k]
  |  Branch (101:38): [True: 2.71M, False: 5.99k]
  ------------------
  102|  2.71M|          ref_mv_stack[index].this_mv = this_refmv;
  103|  2.71M|          ref_mv_weight[index] = weight;
  104|  2.71M|          ++(*refmv_count);
  105|  2.71M|        }
  106|  3.60M|        if (have_newmv_in_inter_mode(candidate->mode)) ++*newmv_count;
  ------------------
  |  Branch (106:13): [True: 1.90M, False: 1.69M]
  ------------------
  107|  3.60M|        ++*ref_match_count;
  108|  3.60M|      }
  109|  7.18M|    }
  110|  18.4E|  } else {
  111|       |    // compound reference frame
  112|  18.4E|    if (candidate->ref_frame[0] == rf[0] && candidate->ref_frame[1] == rf[1]) {
  ------------------
  |  Branch (112:9): [True: 0, False: 18.4E]
  |  Branch (112:45): [True: 0, False: 0]
  ------------------
  113|      0|      int_mv this_refmv[2];
  114|       |
  115|      0|      for (ref = 0; ref < 2; ++ref) {
  ------------------
  |  Branch (115:21): [True: 0, False: 0]
  ------------------
  116|      0|        if (is_global_mv_block(candidate, gm_params[rf[ref]].wmtype))
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|          this_refmv[ref] = gm_mv_candidates[ref];
  118|      0|        else
  119|      0|          this_refmv[ref] = get_block_mv(candidate, ref);
  120|      0|      }
  121|       |
  122|      0|      for (index = 0; index < *refmv_count; ++index) {
  ------------------
  |  Branch (122:23): [True: 0, False: 0]
  ------------------
  123|      0|        if ((ref_mv_stack[index].this_mv.as_int == this_refmv[0].as_int) &&
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      0|            (ref_mv_stack[index].comp_mv.as_int == this_refmv[1].as_int)) {
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|          ref_mv_weight[index] += weight;
  126|      0|          break;
  127|      0|        }
  128|      0|      }
  129|       |
  130|       |      // Add a new item to the list.
  131|      0|      if (index == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
  ------------------
  |  |  510|      0|#define MAX_REF_MV_STACK_SIZE 8
  ------------------
  |  Branch (131:11): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|      0|        ref_mv_stack[index].this_mv = this_refmv[0];
  133|      0|        ref_mv_stack[index].comp_mv = this_refmv[1];
  134|      0|        ref_mv_weight[index] = weight;
  135|      0|        ++(*refmv_count);
  136|      0|      }
  137|      0|      if (have_newmv_in_inter_mode(candidate->mode)) ++*newmv_count;
  ------------------
  |  Branch (137:11): [True: 0, False: 0]
  ------------------
  138|      0|      ++*ref_match_count;
  139|      0|    }
  140|  18.4E|  }
  141|  3.59M|}
mvref_common.c:scan_col_mbmi:
  197|  4.90M|                                 int *processed_cols) {
  198|  4.90M|  int end_mi = AOMMIN(xd->height, cm->mi_params.mi_rows - mi_row);
  ------------------
  |  |   34|  4.90M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.21M, False: 688k]
  |  |  ------------------
  ------------------
  199|  4.90M|  end_mi = AOMMIN(end_mi, mi_size_high[BLOCK_64X64]);
  ------------------
  |  |   34|  4.90M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.89M, False: 9.47k]
  |  |  ------------------
  ------------------
  200|  4.90M|  const int n8_h_8 = mi_size_high[BLOCK_8X8];
  201|  4.90M|  const int n8_h_16 = mi_size_high[BLOCK_16X16];
  202|  4.90M|  int i;
  203|  4.90M|  int row_offset = 0;
  204|  4.90M|  if (abs(col_offset) > 1) {
  ------------------
  |  Branch (204:7): [True: 2.73M, False: 2.16M]
  ------------------
  205|  2.73M|    row_offset = 1;
  206|  2.73M|    if ((mi_row & 0x01) && xd->height < n8_h_8) --row_offset;
  ------------------
  |  Branch (206:9): [True: 97.7k, False: 2.64M]
  |  Branch (206:28): [True: 97.7k, False: 18.4E]
  ------------------
  207|  2.73M|  }
  208|  4.90M|  const int use_step_16 = (xd->height >= 16);
  209|       |
  210|  9.98M|  for (i = 0; i < end_mi;) {
  ------------------
  |  Branch (210:15): [True: 5.07M, False: 4.90M]
  ------------------
  211|  5.07M|    const MB_MODE_INFO *const candidate =
  212|  5.07M|        xd->mi[(row_offset + i) * xd->mi_stride + col_offset];
  213|  5.07M|    const int candidate_bsize = candidate->bsize;
  214|  5.07M|    const int n4_h = mi_size_high[candidate_bsize];
  215|  5.07M|    int len = AOMMIN(xd->height, n4_h);
  ------------------
  |  |   34|  5.07M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 488k, False: 4.58M]
  |  |  ------------------
  ------------------
  216|  5.07M|    if (use_step_16)
  ------------------
  |  Branch (216:9): [True: 59.9k, False: 5.01M]
  ------------------
  217|  59.9k|      len = AOMMAX(n8_h_16, len);
  ------------------
  |  |   35|  59.9k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 53.3k, False: 6.66k]
  |  |  ------------------
  ------------------
  218|  5.01M|    else if (abs(col_offset) > 1)
  ------------------
  |  Branch (218:14): [True: 2.79M, False: 2.21M]
  ------------------
  219|  2.79M|      len = AOMMAX(len, n8_h_8);
  ------------------
  |  |   35|  2.79M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 86.4k, False: 2.71M]
  |  |  ------------------
  ------------------
  220|       |
  221|  5.07M|    int weight = 2;
  222|  5.07M|    if (xd->height >= n8_h_8 && xd->height <= n4_h) {
  ------------------
  |  Branch (222:9): [True: 4.55M, False: 519k]
  |  Branch (222:33): [True: 4.23M, False: 316k]
  ------------------
  223|  4.23M|      int inc = AOMMIN(-max_col_offset + col_offset + 1,
  ------------------
  |  |   34|  4.23M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 4.08M]
  |  |  ------------------
  ------------------
  224|  4.23M|                       mi_size_wide[candidate_bsize]);
  225|       |      // Obtain range used in weight calculation.
  226|  4.23M|      weight = AOMMAX(weight, inc);
  ------------------
  |  |   35|  4.23M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 30.4k, False: 4.20M]
  |  |  ------------------
  ------------------
  227|       |      // Update processed cols.
  228|  4.23M|      *processed_cols = inc - col_offset - 1;
  229|  4.23M|    }
  230|       |
  231|  5.07M|    add_ref_mv_candidate(candidate, rf, refmv_count, ref_match_count,
  232|  5.07M|                         newmv_count, ref_mv_stack, ref_mv_weight,
  233|  5.07M|                         gm_mv_candidates, cm->global_motion, len * weight);
  234|       |
  235|  5.07M|    i += len;
  236|  5.07M|  }
  237|  4.90M|}
mvref_common.c:scan_blk_mbmi:
  246|  4.97M|                                 uint8_t *refmv_count) {
  247|  4.97M|  const TileInfo *const tile = &xd->tile;
  248|  4.97M|  POSITION mi_pos;
  249|       |
  250|  4.97M|  mi_pos.row = row_offset;
  251|  4.97M|  mi_pos.col = col_offset;
  252|       |
  253|  4.97M|  if (is_inside(tile, mi_col, mi_row, &mi_pos)) {
  ------------------
  |  Branch (253:7): [True: 2.93M, False: 2.03M]
  ------------------
  254|  2.93M|    const MB_MODE_INFO *const candidate =
  255|  2.93M|        xd->mi[mi_pos.row * xd->mi_stride + mi_pos.col];
  256|  2.93M|    const int len = mi_size_wide[BLOCK_8X8];
  257|       |
  258|  2.93M|    add_ref_mv_candidate(candidate, rf, refmv_count, ref_match_count,
  259|  2.93M|                         newmv_count, ref_mv_stack, ref_mv_weight,
  260|  2.93M|                         gm_mv_candidates, cm->global_motion, 2 * len);
  261|  2.93M|  }  // Analyze a single 8x8 block motion information.
  262|  4.97M|}
mvref_common.c:add_tpl_ref_mv:
  335|  10.6M|                          int16_t *mode_context) {
  336|  10.6M|  POSITION mi_pos;
  337|  10.6M|  mi_pos.row = (mi_row & 0x01) ? blk_row : blk_row + 1;
  ------------------
  |  Branch (337:16): [True: 159k, False: 10.4M]
  ------------------
  338|  10.6M|  mi_pos.col = (mi_col & 0x01) ? blk_col : blk_col + 1;
  ------------------
  |  Branch (338:16): [True: 158k, False: 10.4M]
  ------------------
  339|       |
  340|  10.6M|  if (!is_inside(&xd->tile, mi_col, mi_row, &mi_pos)) return 0;
  ------------------
  |  Branch (340:7): [True: 1.84M, False: 8.78M]
  ------------------
  341|       |
  342|  8.78M|  const TPL_MV_REF *prev_frame_mvs =
  343|  8.78M|      cm->tpl_mvs +
  344|  8.78M|      ((mi_row + mi_pos.row) >> 1) * (cm->mi_params.mi_stride >> 1) +
  345|  8.78M|      ((mi_col + mi_pos.col) >> 1);
  346|  8.78M|  if (prev_frame_mvs->mfmv0.as_int == INVALID_MV) return 0;
  ------------------
  |  |   26|  8.78M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (346:7): [True: 8.52M, False: 267k]
  ------------------
  347|       |
  348|   267k|  MV_REFERENCE_FRAME rf[2];
  349|   267k|  av1_set_ref_frame(rf, ref_frame);
  350|       |
  351|   267k|  const uint16_t weight_unit = 1;  // mi_size_wide[BLOCK_8X8];
  352|   267k|  const int cur_frame_index = cm->cur_frame->order_hint;
  353|   267k|  const RefCntBuffer *const buf_0 = get_ref_frame_buf(cm, rf[0]);
  354|   267k|  const int frame0_index = buf_0->order_hint;
  355|   267k|  const int cur_offset_0 = get_relative_dist(&cm->seq_params->order_hint_info,
  356|   267k|                                             cur_frame_index, frame0_index);
  357|   267k|  int idx;
  358|   267k|  const int allow_high_precision_mv = cm->features.allow_high_precision_mv;
  359|   267k|  const int force_integer_mv = cm->features.cur_frame_force_integer_mv;
  360|       |
  361|   267k|  int_mv this_refmv;
  362|   267k|  av1_get_mv_projection(&this_refmv.as_mv, prev_frame_mvs->mfmv0.as_mv,
  363|   267k|                        cur_offset_0, prev_frame_mvs->ref_frame_offset);
  364|   267k|  lower_mv_precision(&this_refmv.as_mv, allow_high_precision_mv,
  365|   267k|                     force_integer_mv);
  366|       |
  367|   271k|  if (rf[1] == NONE_FRAME) {
  ------------------
  |  Branch (367:7): [True: 271k, False: 18.4E]
  ------------------
  368|   271k|    if (blk_row == 0 && blk_col == 0) {
  ------------------
  |  Branch (368:9): [True: 153k, False: 117k]
  |  Branch (368:25): [True: 91.1k, False: 62.7k]
  ------------------
  369|  91.1k|      if (abs(this_refmv.as_mv.row - gm_mv_candidates[0].as_mv.row) >= 16 ||
  ------------------
  |  Branch (369:11): [True: 29.6k, False: 61.4k]
  ------------------
  370|  61.4k|          abs(this_refmv.as_mv.col - gm_mv_candidates[0].as_mv.col) >= 16)
  ------------------
  |  Branch (370:11): [True: 12.7k, False: 48.6k]
  ------------------
  371|  42.4k|        mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
  ------------------
  |  |  487|  42.4k|#define GLOBALMV_OFFSET 3
  ------------------
  372|  91.1k|    }
  373|       |
  374|   517k|    for (idx = 0; idx < *refmv_count; ++idx)
  ------------------
  |  Branch (374:19): [True: 353k, False: 163k]
  ------------------
  375|   353k|      if (this_refmv.as_int == ref_mv_stack[idx].this_mv.as_int) break;
  ------------------
  |  Branch (375:11): [True: 108k, False: 245k]
  ------------------
  376|       |
  377|   271k|    if (idx < *refmv_count) ref_mv_weight[idx] += 2 * weight_unit;
  ------------------
  |  Branch (377:9): [True: 108k, False: 163k]
  ------------------
  378|       |
  379|   271k|    if (idx == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
  ------------------
  |  |  510|   163k|#define MAX_REF_MV_STACK_SIZE 8
  ------------------
  |  Branch (379:9): [True: 163k, False: 108k]
  |  Branch (379:32): [True: 163k, False: 68]
  ------------------
  380|   163k|      ref_mv_stack[idx].this_mv.as_int = this_refmv.as_int;
  381|   163k|      ref_mv_weight[idx] = 2 * weight_unit;
  382|   163k|      ++(*refmv_count);
  383|   163k|    }
  384|  18.4E|  } else {
  385|       |    // Process compound inter mode
  386|  18.4E|    const RefCntBuffer *const buf_1 = get_ref_frame_buf(cm, rf[1]);
  387|  18.4E|    const int frame1_index = buf_1->order_hint;
  388|  18.4E|    const int cur_offset_1 = get_relative_dist(&cm->seq_params->order_hint_info,
  389|  18.4E|                                               cur_frame_index, frame1_index);
  390|  18.4E|    int_mv comp_refmv;
  391|  18.4E|    av1_get_mv_projection(&comp_refmv.as_mv, prev_frame_mvs->mfmv0.as_mv,
  392|  18.4E|                          cur_offset_1, prev_frame_mvs->ref_frame_offset);
  393|  18.4E|    lower_mv_precision(&comp_refmv.as_mv, allow_high_precision_mv,
  394|  18.4E|                       force_integer_mv);
  395|       |
  396|  18.4E|    if (blk_row == 0 && blk_col == 0) {
  ------------------
  |  Branch (396:9): [True: 0, False: 18.4E]
  |  Branch (396:25): [True: 0, False: 0]
  ------------------
  397|      0|      if (abs(this_refmv.as_mv.row - gm_mv_candidates[0].as_mv.row) >= 16 ||
  ------------------
  |  Branch (397:11): [True: 0, False: 0]
  ------------------
  398|      0|          abs(this_refmv.as_mv.col - gm_mv_candidates[0].as_mv.col) >= 16 ||
  ------------------
  |  Branch (398:11): [True: 0, False: 0]
  ------------------
  399|      0|          abs(comp_refmv.as_mv.row - gm_mv_candidates[1].as_mv.row) >= 16 ||
  ------------------
  |  Branch (399:11): [True: 0, False: 0]
  ------------------
  400|      0|          abs(comp_refmv.as_mv.col - gm_mv_candidates[1].as_mv.col) >= 16)
  ------------------
  |  Branch (400:11): [True: 0, False: 0]
  ------------------
  401|      0|        mode_context[ref_frame] |= (1 << GLOBALMV_OFFSET);
  ------------------
  |  |  487|      0|#define GLOBALMV_OFFSET 3
  ------------------
  402|      0|    }
  403|       |
  404|  18.4E|    for (idx = 0; idx < *refmv_count; ++idx) {
  ------------------
  |  Branch (404:19): [True: 0, False: 18.4E]
  ------------------
  405|      0|      if (this_refmv.as_int == ref_mv_stack[idx].this_mv.as_int &&
  ------------------
  |  Branch (405:11): [True: 0, False: 0]
  ------------------
  406|      0|          comp_refmv.as_int == ref_mv_stack[idx].comp_mv.as_int)
  ------------------
  |  Branch (406:11): [True: 0, False: 0]
  ------------------
  407|      0|        break;
  408|      0|    }
  409|       |
  410|  18.4E|    if (idx < *refmv_count) ref_mv_weight[idx] += 2 * weight_unit;
  ------------------
  |  Branch (410:9): [True: 0, False: 18.4E]
  ------------------
  411|       |
  412|  18.4E|    if (idx == *refmv_count && *refmv_count < MAX_REF_MV_STACK_SIZE) {
  ------------------
  |  |  510|      0|#define MAX_REF_MV_STACK_SIZE 8
  ------------------
  |  Branch (412:9): [True: 0, False: 18.4E]
  |  Branch (412:32): [True: 0, False: 0]
  ------------------
  413|      0|      ref_mv_stack[idx].this_mv.as_int = this_refmv.as_int;
  414|      0|      ref_mv_stack[idx].comp_mv.as_int = comp_refmv.as_int;
  415|      0|      ref_mv_weight[idx] = 2 * weight_unit;
  416|      0|      ++(*refmv_count);
  417|      0|    }
  418|  18.4E|  }
  419|       |
  420|   267k|  return 1;
  421|  8.78M|}
mvref_common.c:check_sb_border:
  317|  6.88M|                           const int row_offset, const int col_offset) {
  318|  6.88M|  const int sb_mi_size = mi_size_wide[BLOCK_64X64];
  319|  6.88M|  const int row = mi_row & (sb_mi_size - 1);
  320|  6.88M|  const int col = mi_col & (sb_mi_size - 1);
  321|       |
  322|  6.88M|  if (row + row_offset < 0 || row + row_offset >= sb_mi_size ||
  ------------------
  |  Branch (322:7): [True: 18.4E, False: 6.88M]
  |  Branch (322:31): [True: 458k, False: 6.42M]
  ------------------
  323|  6.42M|      col + col_offset < 0 || col + col_offset >= sb_mi_size)
  ------------------
  |  Branch (323:7): [True: 474k, False: 5.95M]
  |  Branch (323:31): [True: 415k, False: 5.53M]
  ------------------
  324|  1.35M|    return 0;
  325|       |
  326|  5.53M|  return 1;
  327|  6.88M|}
mvref_common.c:process_single_ref_mv_candidate:
  452|  3.16M|    uint16_t ref_mv_weight[MAX_REF_MV_STACK_SIZE]) {
  453|  9.48M|  for (int rf_idx = 0; rf_idx < 2; ++rf_idx) {
  ------------------
  |  Branch (453:24): [True: 6.32M, False: 3.16M]
  ------------------
  454|  6.32M|    if (candidate->ref_frame[rf_idx] > INTRA_FRAME) {
  ------------------
  |  Branch (454:9): [True: 383k, False: 5.94M]
  ------------------
  455|   383k|      int_mv this_mv = candidate->mv[rf_idx];
  456|   383k|      if (cm->ref_frame_sign_bias[candidate->ref_frame[rf_idx]] !=
  ------------------
  |  Branch (456:11): [True: 0, False: 383k]
  ------------------
  457|   383k|          cm->ref_frame_sign_bias[ref_frame]) {
  458|      0|        this_mv.as_mv.row = -this_mv.as_mv.row;
  459|      0|        this_mv.as_mv.col = -this_mv.as_mv.col;
  460|      0|      }
  461|   383k|      int stack_idx;
  462|   383k|      for (stack_idx = 0; stack_idx < *refmv_count; ++stack_idx) {
  ------------------
  |  Branch (462:27): [True: 383k, False: 358]
  ------------------
  463|   383k|        const int_mv stack_mv = ref_mv_stack[stack_idx].this_mv;
  464|   383k|        if (this_mv.as_int == stack_mv.as_int) break;
  ------------------
  |  Branch (464:13): [True: 383k, False: 199]
  ------------------
  465|   383k|      }
  466|       |
  467|   383k|      if (stack_idx == *refmv_count) {
  ------------------
  |  Branch (467:11): [True: 376, False: 383k]
  ------------------
  468|    376|        ref_mv_stack[stack_idx].this_mv = this_mv;
  469|       |
  470|       |        // TODO(jingning): Set an arbitrary small number here. The weight
  471|       |        // doesn't matter as long as it is properly initialized.
  472|    376|        ref_mv_weight[stack_idx] = 2;
  473|    376|        ++(*refmv_count);
  474|    376|      }
  475|   383k|    }
  476|  6.32M|  }
  477|  3.16M|}
mvref_common.c:motion_field_projection:
  920|   127k|                                   MV_REFERENCE_FRAME start_frame, int dir) {
  921|   127k|  TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
  922|   127k|  int ref_offset[REF_FRAMES] = { 0 };
  923|       |
  924|   127k|  const RefCntBuffer *const start_frame_buf =
  925|   127k|      get_ref_frame_buf(cm, start_frame);
  926|   127k|  if (start_frame_buf == NULL) return 0;
  ------------------
  |  Branch (926:7): [True: 0, False: 127k]
  ------------------
  927|       |
  928|   127k|  if (start_frame_buf->frame_type == KEY_FRAME ||
  ------------------
  |  Branch (928:7): [True: 25.4k, False: 101k]
  ------------------
  929|   101k|      start_frame_buf->frame_type == INTRA_ONLY_FRAME)
  ------------------
  |  Branch (929:7): [True: 0, False: 101k]
  ------------------
  930|  25.4k|    return 0;
  931|       |
  932|   101k|  if (start_frame_buf->mi_rows != cm->mi_params.mi_rows ||
  ------------------
  |  Branch (932:7): [True: 40.4k, False: 61.2k]
  ------------------
  933|  61.2k|      start_frame_buf->mi_cols != cm->mi_params.mi_cols)
  ------------------
  |  Branch (933:7): [True: 17.9k, False: 43.3k]
  ------------------
  934|  58.3k|    return 0;
  935|       |
  936|  43.3k|  const int start_frame_order_hint = start_frame_buf->order_hint;
  937|  43.3k|  const unsigned int *const ref_order_hints =
  938|  43.3k|      &start_frame_buf->ref_order_hints[0];
  939|  43.3k|  const int cur_order_hint = cm->cur_frame->order_hint;
  940|  43.3k|  int start_to_current_frame_offset = get_relative_dist(
  941|  43.3k|      &cm->seq_params->order_hint_info, start_frame_order_hint, cur_order_hint);
  942|       |
  943|   346k|  for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
  ------------------
  |  Branch (943:44): [True: 303k, False: 43.3k]
  ------------------
  944|   303k|    ref_offset[rf] = get_relative_dist(&cm->seq_params->order_hint_info,
  945|   303k|                                       start_frame_order_hint,
  946|   303k|                                       ref_order_hints[rf - LAST_FRAME]);
  947|   303k|  }
  948|       |
  949|  43.3k|  if (dir == 2) start_to_current_frame_offset = -start_to_current_frame_offset;
  ------------------
  |  Branch (949:7): [True: 43.3k, False: 0]
  ------------------
  950|       |
  951|  43.3k|  MV_REF *mv_ref_base = start_frame_buf->mvs;
  952|  43.3k|  const int mvs_rows = (cm->mi_params.mi_rows + 1) >> 1;
  953|  43.3k|  const int mvs_cols = (cm->mi_params.mi_cols + 1) >> 1;
  954|       |
  955|   179k|  for (int blk_row = 0; blk_row < mvs_rows; ++blk_row) {
  ------------------
  |  Branch (955:25): [True: 136k, False: 43.3k]
  ------------------
  956|   769k|    for (int blk_col = 0; blk_col < mvs_cols; ++blk_col) {
  ------------------
  |  Branch (956:27): [True: 632k, False: 136k]
  ------------------
  957|   632k|      MV_REF *mv_ref = &mv_ref_base[blk_row * mvs_cols + blk_col];
  958|   632k|      MV fwd_mv = mv_ref->mv.as_mv;
  959|       |
  960|   632k|      if (mv_ref->ref_frame > INTRA_FRAME) {
  ------------------
  |  Branch (960:11): [True: 267k, False: 365k]
  ------------------
  961|   267k|        int_mv this_mv;
  962|   267k|        int mi_r, mi_c;
  963|   267k|        const int ref_frame_offset = ref_offset[mv_ref->ref_frame];
  964|       |
  965|   267k|        int pos_valid =
  966|   267k|            abs(ref_frame_offset) <= MAX_FRAME_DISTANCE &&
  ------------------
  |  |   68|   534k|#define MAX_FRAME_DISTANCE ((1 << FRAME_OFFSET_BITS) - 1)
  |  |  ------------------
  |  |  |  |   67|   267k|#define FRAME_OFFSET_BITS 5
  |  |  ------------------
  ------------------
  |  Branch (966:13): [True: 267k, False: 0]
  ------------------
  967|   267k|            ref_frame_offset > 0 &&
  ------------------
  |  Branch (967:13): [True: 267k, False: 0]
  ------------------
  968|   267k|            abs(start_to_current_frame_offset) <= MAX_FRAME_DISTANCE;
  ------------------
  |  |   68|   267k|#define MAX_FRAME_DISTANCE ((1 << FRAME_OFFSET_BITS) - 1)
  |  |  ------------------
  |  |  |  |   67|   267k|#define FRAME_OFFSET_BITS 5
  |  |  ------------------
  ------------------
  |  Branch (968:13): [True: 267k, False: 0]
  ------------------
  969|       |
  970|   267k|        if (pos_valid) {
  ------------------
  |  Branch (970:13): [True: 267k, False: 0]
  ------------------
  971|   267k|          av1_get_mv_projection(&this_mv.as_mv, fwd_mv,
  972|   267k|                                start_to_current_frame_offset,
  973|   267k|                                ref_frame_offset);
  974|   267k|          pos_valid = get_block_position(cm, &mi_r, &mi_c, blk_row, blk_col,
  975|   267k|                                         this_mv.as_mv, dir >> 1);
  976|   267k|        }
  977|       |
  978|   267k|        if (pos_valid) {
  ------------------
  |  Branch (978:13): [True: 247k, False: 20.1k]
  ------------------
  979|   247k|          const int mi_offset = mi_r * (cm->mi_params.mi_stride >> 1) + mi_c;
  980|       |
  981|   247k|          tpl_mvs_base[mi_offset].mfmv0.as_mv.row = fwd_mv.row;
  982|   247k|          tpl_mvs_base[mi_offset].mfmv0.as_mv.col = fwd_mv.col;
  983|   247k|          tpl_mvs_base[mi_offset].ref_frame_offset = ref_frame_offset;
  984|   247k|        }
  985|   267k|      }
  986|   632k|    }
  987|   136k|  }
  988|       |
  989|  43.3k|  return 1;
  990|   101k|}
mvref_common.c:get_block_position:
  882|   267k|                              int blk_col, MV mv, int sign_bias) {
  883|   267k|  const int base_blk_row = (blk_row >> 3) << 3;
  884|   267k|  const int base_blk_col = (blk_col >> 3) << 3;
  885|       |
  886|   267k|  const int row_offset = (mv.row >= 0) ? (mv.row >> (4 + MI_SIZE_LOG2))
  ------------------
  |  |   39|   189k|#define MI_SIZE_LOG2 2
  ------------------
  |  Branch (886:26): [True: 189k, False: 77.5k]
  ------------------
  887|   267k|                                       : -((-mv.row) >> (4 + MI_SIZE_LOG2));
  ------------------
  |  |   39|  77.5k|#define MI_SIZE_LOG2 2
  ------------------
  888|       |
  889|   267k|  const int col_offset = (mv.col >= 0) ? (mv.col >> (4 + MI_SIZE_LOG2))
  ------------------
  |  |   39|   188k|#define MI_SIZE_LOG2 2
  ------------------
  |  Branch (889:26): [True: 188k, False: 78.7k]
  ------------------
  890|   267k|                                       : -((-mv.col) >> (4 + MI_SIZE_LOG2));
  ------------------
  |  |   39|  78.7k|#define MI_SIZE_LOG2 2
  ------------------
  891|       |
  892|   267k|  const int row =
  893|   267k|      (sign_bias == 1) ? blk_row - row_offset : blk_row + row_offset;
  ------------------
  |  Branch (893:7): [True: 267k, False: 0]
  ------------------
  894|   267k|  const int col =
  895|   267k|      (sign_bias == 1) ? blk_col - col_offset : blk_col + col_offset;
  ------------------
  |  Branch (895:7): [True: 267k, False: 0]
  ------------------
  896|       |
  897|   267k|  if (row < 0 || row >= (cm->mi_params.mi_rows >> 1) || col < 0 ||
  ------------------
  |  Branch (897:7): [True: 4.38k, False: 263k]
  |  Branch (897:18): [True: 4.60k, False: 258k]
  |  Branch (897:57): [True: 3.34k, False: 255k]
  ------------------
  898|   255k|      col >= (cm->mi_params.mi_cols >> 1))
  ------------------
  |  Branch (898:7): [True: 3.52k, False: 251k]
  ------------------
  899|  15.8k|    return 0;
  900|       |
  901|   251k|  if (row < base_blk_row - (MAX_OFFSET_HEIGHT >> 3) ||
  ------------------
  |  |  879|   251k|#define MAX_OFFSET_HEIGHT 0
  ------------------
  |  Branch (901:7): [True: 1.79k, False: 249k]
  ------------------
  902|   249k|      row >= base_blk_row + 8 + (MAX_OFFSET_HEIGHT >> 3) ||
  ------------------
  |  |  879|   249k|#define MAX_OFFSET_HEIGHT 0
  ------------------
  |  Branch (902:7): [True: 2.48k, False: 247k]
  ------------------
  903|   247k|      col < base_blk_col - (MAX_OFFSET_WIDTH >> 3) ||
  ------------------
  |  |  878|   247k|#define MAX_OFFSET_WIDTH 64
  ------------------
  |  Branch (903:7): [True: 4, False: 247k]
  ------------------
  904|   247k|      col >= base_blk_col + 8 + (MAX_OFFSET_WIDTH >> 3))
  ------------------
  |  |  878|   247k|#define MAX_OFFSET_WIDTH 64
  ------------------
  |  Branch (904:7): [True: 6, False: 247k]
  ------------------
  905|  4.28k|    return 0;
  906|       |
  907|   247k|  *mi_r = row;
  908|   247k|  *mi_c = col;
  909|       |
  910|   247k|  return 1;
  911|   251k|}
mvref_common.c:record_samples:
 1079|  2.04M|                                  int col_offset, int sign_c) {
 1080|  2.04M|  const int bw = block_size_wide[mbmi->bsize];
 1081|  2.04M|  const int bh = block_size_high[mbmi->bsize];
 1082|  2.04M|  const int x = col_offset * MI_SIZE + sign_c * bw / 2 - 1;
  ------------------
  |  |   40|  2.04M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.04M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1083|  2.04M|  const int y = row_offset * MI_SIZE + sign_r * bh / 2 - 1;
  ------------------
  |  |   40|  2.04M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.04M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1084|       |
 1085|  2.04M|  pts[0] = GET_MV_SUBPEL(x);
  ------------------
  |  |   29|  2.04M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1086|  2.04M|  pts[1] = GET_MV_SUBPEL(y);
  ------------------
  |  |   29|  2.04M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1087|  2.04M|  pts_inref[0] = pts[0] + mbmi->mv[0].as_mv.col;
 1088|  2.04M|  pts_inref[1] = pts[1] + mbmi->mv[0].as_mv.row;
 1089|  2.04M|}
mvref_common.c:has_top_right:
  265|  3.87M|                         int mi_row, int mi_col, int bs) {
  266|  3.87M|  const int sb_mi_size = mi_size_wide[cm->seq_params->sb_size];
  267|  3.87M|  const int mask_row = mi_row & (sb_mi_size - 1);
  268|  3.87M|  const int mask_col = mi_col & (sb_mi_size - 1);
  269|       |
  270|  3.87M|  if (bs > mi_size_wide[BLOCK_64X64]) return 0;
  ------------------
  |  Branch (270:7): [True: 0, False: 3.87M]
  ------------------
  271|       |
  272|       |  // In a split partition all apart from the bottom right has a top right
  273|  3.87M|  int has_tr = !((mask_row & bs) && (mask_col & bs));
  ------------------
  |  Branch (273:18): [True: 1.74M, False: 2.13M]
  |  Branch (273:37): [True: 794k, False: 950k]
  ------------------
  274|       |
  275|       |  // bs > 0 and bs is a power of 2
  276|  3.87M|  assert(bs > 0 && !(bs & (bs - 1)));
  277|       |
  278|       |  // For each 4x4 group of blocks, when the bottom right is decoded the blocks
  279|       |  // to the right have not been decoded therefore the bottom right does
  280|       |  // not have a top right
  281|  5.78M|  while (bs < sb_mi_size) {
  ------------------
  |  Branch (281:10): [True: 5.53M, False: 254k]
  ------------------
  282|  5.53M|    if (mask_col & bs) {
  ------------------
  |  Branch (282:9): [True: 2.27M, False: 3.25M]
  ------------------
  283|  2.27M|      if ((mask_col & (2 * bs)) && (mask_row & (2 * bs))) {
  ------------------
  |  Branch (283:11): [True: 895k, False: 1.38M]
  |  Branch (283:36): [True: 363k, False: 531k]
  ------------------
  284|   363k|        has_tr = 0;
  285|   363k|        break;
  286|   363k|      }
  287|  3.25M|    } else {
  288|  3.25M|      break;
  289|  3.25M|    }
  290|  1.91M|    bs <<= 1;
  291|  1.91M|  }
  292|       |
  293|       |  // In a VERTICAL or VERTICAL_4 partition, all partition before the last one
  294|       |  // always have a top right (as the block above will have been decoded).
  295|  3.87M|  if (xd->width < xd->height) {
  ------------------
  |  Branch (295:7): [True: 113k, False: 3.76M]
  ------------------
  296|   113k|    if (!xd->is_last_vertical_rect) has_tr = 1;
  ------------------
  |  Branch (296:9): [True: 84.6k, False: 28.6k]
  ------------------
  297|   113k|  }
  298|       |
  299|       |  // In a HORIZONTAL or HORIZONTAL_4 partition, partitions after the first one
  300|       |  // never have a top right (as the block to the right won't have been decoded).
  301|  3.87M|  if (xd->width > xd->height) {
  ------------------
  |  Branch (301:7): [True: 122k, False: 3.75M]
  ------------------
  302|   122k|    if (!xd->is_first_horizontal_rect) has_tr = 0;
  ------------------
  |  Branch (302:9): [True: 37.7k, False: 84.9k]
  ------------------
  303|   122k|  }
  304|       |
  305|       |  // The bottom left square of a Vertical A (in the old format) does
  306|       |  // not have a top right as it is decoded before the right hand
  307|       |  // rectangle of the partition
  308|  3.87M|  if (xd->mi[0]->partition == PARTITION_VERT_A) {
  ------------------
  |  Branch (308:7): [True: 0, False: 3.87M]
  ------------------
  309|      0|    if (xd->width == xd->height)
  ------------------
  |  Branch (309:9): [True: 0, False: 0]
  ------------------
  310|      0|      if (mask_row & bs) has_tr = 0;
  ------------------
  |  Branch (310:11): [True: 0, False: 0]
  ------------------
  311|      0|  }
  312|       |
  313|  3.87M|  return has_tr;
  314|  3.87M|}

decodemv.c:av1_collect_neighbors_ref_counts:
  209|   191k|static inline void av1_collect_neighbors_ref_counts(MACROBLOCKD *const xd) {
  210|   191k|  av1_zero(xd->neighbors_ref_counts);
  ------------------
  |  |   43|   191k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  211|       |
  212|   191k|  uint8_t *const ref_counts = xd->neighbors_ref_counts;
  213|       |
  214|   191k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  215|   191k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  216|   191k|  const int above_in_image = xd->up_available;
  217|   191k|  const int left_in_image = xd->left_available;
  218|       |
  219|       |  // Above neighbor
  220|   191k|  if (above_in_image && is_inter_block(above_mbmi)) {
  ------------------
  |  Branch (220:7): [True: 147k, False: 43.6k]
  |  Branch (220:25): [True: 93.2k, False: 54.7k]
  ------------------
  221|  93.2k|    ref_counts[above_mbmi->ref_frame[0]]++;
  222|  93.2k|    if (has_second_ref(above_mbmi)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 93.2k]
  ------------------
  223|      0|      ref_counts[above_mbmi->ref_frame[1]]++;
  224|      0|    }
  225|  93.2k|  }
  226|       |
  227|       |  // Left neighbor
  228|   191k|  if (left_in_image && is_inter_block(left_mbmi)) {
  ------------------
  |  Branch (228:7): [True: 148k, False: 42.9k]
  |  Branch (228:24): [True: 93.8k, False: 54.8k]
  ------------------
  229|  93.8k|    ref_counts[left_mbmi->ref_frame[0]]++;
  230|  93.8k|    if (has_second_ref(left_mbmi)) {
  ------------------
  |  Branch (230:9): [True: 0, False: 93.8k]
  ------------------
  231|      0|      ref_counts[left_mbmi->ref_frame[1]]++;
  232|      0|    }
  233|  93.8k|  }
  234|   191k|}
decodemv.c:av1_ref_frame_type:
  113|   507k|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|   507k|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 507k]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|   507k|  return rf[0];
  127|   507k|}
decodemv.c:av1_mode_context_analyzer:
  171|   191k|    const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) {
  172|   191k|  const int8_t ref_frame = av1_ref_frame_type(rf);
  173|       |
  174|   191k|  if (rf[1] <= INTRA_FRAME) return mode_context[ref_frame];
  ------------------
  |  Branch (174:7): [True: 191k, False: 112]
  ------------------
  175|       |
  176|    112|  const int16_t newmv_ctx = mode_context[ref_frame] & NEWMV_CTX_MASK;
  ------------------
  |  |  490|    112|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|    112|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  177|    112|  const int16_t refmv_ctx =
  178|    112|      (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|    112|#define REFMV_OFFSET 4
  ------------------
                    (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|    112|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|    112|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  179|       |
  180|    112|  const int16_t comp_ctx = compound_mode_ctx_map[refmv_ctx >> 1][AOMMIN(
  ------------------
  |  |   34|    112|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 112]
  |  |  ------------------
  ------------------
  181|    112|      newmv_ctx, COMP_NEWMV_CTXS - 1)];
  182|    112|  return comp_ctx;
  183|   191k|}
decodemv.c:av1_drl_ctx:
  185|  83.1k|static inline uint8_t av1_drl_ctx(const uint16_t *ref_mv_weight, int ref_idx) {
  186|  83.1k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|   166k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (186:7): [True: 72.8k, False: 10.3k]
  ------------------
  187|  72.8k|      ref_mv_weight[ref_idx + 1] >= REF_CAT_LEVEL)
  ------------------
  |  |  512|  72.8k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (187:7): [True: 36.8k, False: 36.0k]
  ------------------
  188|  36.8k|    return 0;
  189|       |
  190|  46.3k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|  92.7k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (190:7): [True: 36.0k, False: 10.2k]
  ------------------
  191|  36.0k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  36.0k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (191:7): [True: 36.0k, False: 0]
  ------------------
  192|  36.0k|    return 1;
  193|       |
  194|  10.2k|  if (ref_mv_weight[ref_idx] < REF_CAT_LEVEL &&
  ------------------
  |  |  512|  20.5k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (194:7): [True: 10.3k, False: 18.4E]
  ------------------
  195|  10.3k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  10.3k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (195:7): [True: 10.3k, False: 0]
  ------------------
  196|  10.3k|    return 2;
  197|       |
  198|  18.4E|  return 0;
  199|  10.2k|}
bitstream.c:av1_collect_neighbors_ref_counts:
  209|   509k|static inline void av1_collect_neighbors_ref_counts(MACROBLOCKD *const xd) {
  210|   509k|  av1_zero(xd->neighbors_ref_counts);
  ------------------
  |  |   43|   509k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  211|       |
  212|   509k|  uint8_t *const ref_counts = xd->neighbors_ref_counts;
  213|       |
  214|   509k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  215|   509k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  216|   509k|  const int above_in_image = xd->up_available;
  217|   509k|  const int left_in_image = xd->left_available;
  218|       |
  219|       |  // Above neighbor
  220|   509k|  if (above_in_image && is_inter_block(above_mbmi)) {
  ------------------
  |  Branch (220:7): [True: 396k, False: 113k]
  |  Branch (220:25): [True: 251k, False: 144k]
  ------------------
  221|   251k|    ref_counts[above_mbmi->ref_frame[0]]++;
  222|   251k|    if (has_second_ref(above_mbmi)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 251k]
  ------------------
  223|      0|      ref_counts[above_mbmi->ref_frame[1]]++;
  224|      0|    }
  225|   251k|  }
  226|       |
  227|       |  // Left neighbor
  228|   509k|  if (left_in_image && is_inter_block(left_mbmi)) {
  ------------------
  |  Branch (228:7): [True: 398k, False: 111k]
  |  Branch (228:24): [True: 253k, False: 145k]
  ------------------
  229|   253k|    ref_counts[left_mbmi->ref_frame[0]]++;
  230|   253k|    if (has_second_ref(left_mbmi)) {
  ------------------
  |  Branch (230:9): [True: 0, False: 253k]
  ------------------
  231|      0|      ref_counts[left_mbmi->ref_frame[1]]++;
  232|      0|    }
  233|   253k|  }
  234|   509k|}
bitstream.c:av1_drl_ctx:
  185|   222k|static inline uint8_t av1_drl_ctx(const uint16_t *ref_mv_weight, int ref_idx) {
  186|   222k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|   445k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (186:7): [True: 195k, False: 27.5k]
  ------------------
  187|   195k|      ref_mv_weight[ref_idx + 1] >= REF_CAT_LEVEL)
  ------------------
  |  |  512|   195k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (187:7): [True: 99.2k, False: 96.0k]
  ------------------
  188|  99.2k|    return 0;
  189|       |
  190|   123k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|   247k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (190:7): [True: 96.2k, False: 27.2k]
  ------------------
  191|  96.2k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  96.2k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (191:7): [True: 96.2k, False: 18.4E]
  ------------------
  192|  96.2k|    return 1;
  193|       |
  194|  27.2k|  if (ref_mv_weight[ref_idx] < REF_CAT_LEVEL &&
  ------------------
  |  |  512|  54.5k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (194:7): [True: 27.6k, False: 18.4E]
  ------------------
  195|  27.6k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  27.6k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (195:7): [True: 27.6k, False: 18.4E]
  ------------------
  196|  27.6k|    return 2;
  197|       |
  198|  18.4E|  return 0;
  199|  27.2k|}
bitstream.c:av1_ref_frame_type:
  113|   276k|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|   276k|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 276k]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|   276k|  return rf[0];
  127|   276k|}
encodeframe.c:av1_set_ref_frame:
  153|   258k|                                     MV_REFERENCE_FRAME ref_frame_type) {
  154|   258k|  if (ref_frame_type >= REF_FRAMES) {
  ------------------
  |  Branch (154:7): [True: 258k, False: 0]
  ------------------
  155|   258k|    rf[0] = ref_frame_map[ref_frame_type - REF_FRAMES][0];
  156|   258k|    rf[1] = ref_frame_map[ref_frame_type - REF_FRAMES][1];
  157|   258k|  } else {
  158|       |    assert(ref_frame_type > NONE_FRAME);
  159|      0|    rf[0] = ref_frame_type;
  160|      0|    rf[1] = NONE_FRAME;
  161|      0|  }
  162|   258k|}
encodeframe_utils.c:av1_ref_frame_type:
  113|  6.38M|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|  6.38M|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 6.38M]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|  6.38M|  return rf[0];
  127|  6.38M|}
encodemv.c:av1_ref_frame_type:
  113|  12.4M|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|  12.4M|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 12.4M]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|  12.4M|  return rf[0];
  127|  12.4M|}
encodemv.c:lower_mv_precision:
   88|  1.34M|static inline void lower_mv_precision(MV *mv, int allow_hp, int is_integer) {
   89|  1.34M|  if (is_integer) {
  ------------------
  |  Branch (89:7): [True: 0, False: 1.34M]
  ------------------
   90|      0|    integer_mv_precision(mv);
   91|  1.34M|  } else {
   92|  1.34M|    if (!allow_hp) {
  ------------------
  |  Branch (92:9): [True: 728k, False: 614k]
  ------------------
   93|   728k|      if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
  ------------------
  |  Branch (93:11): [True: 0, False: 728k]
  |  Branch (93:36): [True: 0, False: 0]
  ------------------
   94|   728k|      if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
  ------------------
  |  Branch (94:11): [True: 0, False: 728k]
  |  Branch (94:36): [True: 0, False: 0]
  ------------------
   95|   728k|    }
   96|  1.34M|  }
   97|  1.34M|}
mcomp.c:av1_is_dv_valid:
  281|    276|                                  BLOCK_SIZE bsize, int mib_size_log2) {
  282|    276|  const int bw = block_size_wide[bsize];
  283|    276|  const int bh = block_size_high[bsize];
  284|    276|  const int SCALE_PX_TO_MV = 8;
  285|       |  // Disallow subpixel for now
  286|       |  // SUBPEL_MASK is not the correct scale
  287|    276|  if (((dv.row & (SCALE_PX_TO_MV - 1)) || (dv.col & (SCALE_PX_TO_MV - 1))))
  ------------------
  |  Branch (287:8): [True: 0, False: 276]
  |  Branch (287:43): [True: 0, False: 276]
  ------------------
  288|      0|    return 0;
  289|       |
  290|    276|  const TileInfo *const tile = &xd->tile;
  291|       |  // Is the source top-left inside the current tile?
  292|    276|  const int src_top_edge = mi_row * MI_SIZE * SCALE_PX_TO_MV + dv.row;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  293|    276|  const int tile_top_edge = tile->mi_row_start * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  294|    276|  if (src_top_edge < tile_top_edge) return 0;
  ------------------
  |  Branch (294:7): [True: 0, False: 276]
  ------------------
  295|    276|  const int src_left_edge = mi_col * MI_SIZE * SCALE_PX_TO_MV + dv.col;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  296|    276|  const int tile_left_edge = tile->mi_col_start * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  297|    276|  if (src_left_edge < tile_left_edge) return 0;
  ------------------
  |  Branch (297:7): [True: 0, False: 276]
  ------------------
  298|       |  // Is the bottom right inside the current tile?
  299|    276|  const int src_bottom_edge = (mi_row * MI_SIZE + bh) * SCALE_PX_TO_MV + dv.row;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  300|    276|  const int tile_bottom_edge = tile->mi_row_end * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  301|    276|  if (src_bottom_edge > tile_bottom_edge) return 0;
  ------------------
  |  Branch (301:7): [True: 0, False: 276]
  ------------------
  302|    276|  const int src_right_edge = (mi_col * MI_SIZE + bw) * SCALE_PX_TO_MV + dv.col;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  303|    276|  const int tile_right_edge = tile->mi_col_end * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  304|    276|  if (src_right_edge > tile_right_edge) return 0;
  ------------------
  |  Branch (304:7): [True: 0, False: 276]
  ------------------
  305|       |
  306|       |  // Special case for sub 8x8 chroma cases, to prevent referring to chroma
  307|       |  // pixels outside current tile.
  308|    276|  if (xd->is_chroma_ref && av1_num_planes(cm) > 1) {
  ------------------
  |  Branch (308:7): [True: 128, False: 148]
  |  Branch (308:28): [True: 94, False: 34]
  ------------------
  309|     94|    const struct macroblockd_plane *const pd = &xd->plane[1];
  310|     94|    if (bw < 8 && pd->subsampling_x)
  ------------------
  |  Branch (310:9): [True: 60, False: 34]
  |  Branch (310:19): [True: 28, False: 32]
  ------------------
  311|     28|      if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0;
  ------------------
  |  Branch (311:11): [True: 0, False: 28]
  ------------------
  312|     94|    if (bh < 8 && pd->subsampling_y)
  ------------------
  |  Branch (312:9): [True: 60, False: 34]
  |  Branch (312:19): [True: 4, False: 56]
  ------------------
  313|      4|      if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
  ------------------
  |  Branch (313:11): [True: 0, False: 4]
  ------------------
  314|     94|  }
  315|       |
  316|       |  // Is the bottom right within an already coded SB? Also consider additional
  317|       |  // constraints to facilitate HW decoder.
  318|    276|  const int max_mib_size = 1 << mib_size_log2;
  319|    276|  const int active_sb_row = mi_row >> mib_size_log2;
  320|    276|  const int active_sb64_col = (mi_col * MI_SIZE) >> 6;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  321|    276|  const int sb_size = max_mib_size * MI_SIZE;
  ------------------
  |  |   40|    276|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    276|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  322|    276|  const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size;
  323|    276|  const int src_sb64_col = ((src_right_edge >> 3) - 1) >> 6;
  324|    276|  const int total_sb64_per_row =
  325|    276|      ((tile->mi_col_end - tile->mi_col_start - 1) >> 4) + 1;
  326|    276|  const int active_sb64 = active_sb_row * total_sb64_per_row + active_sb64_col;
  327|    276|  const int src_sb64 = src_sb_row * total_sb64_per_row + src_sb64_col;
  328|    276|  if (src_sb64 >= active_sb64 - INTRABC_DELAY_SB64) return 0;
  ------------------
  |  |  265|    276|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|    276|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 276, False: 0]
  ------------------
  329|       |
  330|       |  // Wavefront constraint: use only top left area of frame for reference.
  331|      0|  const int gradient = 1 + INTRABC_DELAY_SB64 + (sb_size > 64);
  ------------------
  |  |  265|      0|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|      0|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  332|      0|  const int wf_offset = gradient * (active_sb_row - src_sb_row);
  333|      0|  if (src_sb_row > active_sb_row ||
  ------------------
  |  Branch (333:7): [True: 0, False: 0]
  ------------------
  334|      0|      src_sb64_col >= active_sb64_col - INTRABC_DELAY_SB64 + wf_offset)
  ------------------
  |  |  265|      0|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|      0|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  |  Branch (334:7): [True: 0, False: 0]
  ------------------
  335|      0|    return 0;
  336|       |
  337|      0|  return 1;
  338|      0|}
partition_search.c:av1_collect_neighbors_ref_counts:
  209|   511k|static inline void av1_collect_neighbors_ref_counts(MACROBLOCKD *const xd) {
  210|   511k|  av1_zero(xd->neighbors_ref_counts);
  ------------------
  |  |   43|   511k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  211|       |
  212|   511k|  uint8_t *const ref_counts = xd->neighbors_ref_counts;
  213|       |
  214|   511k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  215|   511k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  216|   511k|  const int above_in_image = xd->up_available;
  217|   511k|  const int left_in_image = xd->left_available;
  218|       |
  219|       |  // Above neighbor
  220|   511k|  if (above_in_image && is_inter_block(above_mbmi)) {
  ------------------
  |  Branch (220:7): [True: 397k, False: 114k]
  |  Branch (220:25): [True: 252k, False: 144k]
  ------------------
  221|   252k|    ref_counts[above_mbmi->ref_frame[0]]++;
  222|   252k|    if (has_second_ref(above_mbmi)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 252k]
  ------------------
  223|      0|      ref_counts[above_mbmi->ref_frame[1]]++;
  224|      0|    }
  225|   252k|  }
  226|       |
  227|       |  // Left neighbor
  228|   511k|  if (left_in_image && is_inter_block(left_mbmi)) {
  ------------------
  |  Branch (228:7): [True: 399k, False: 112k]
  |  Branch (228:24): [True: 254k, False: 145k]
  ------------------
  229|   254k|    ref_counts[left_mbmi->ref_frame[0]]++;
  230|   254k|    if (has_second_ref(left_mbmi)) {
  ------------------
  |  Branch (230:9): [True: 0, False: 254k]
  ------------------
  231|      0|      ref_counts[left_mbmi->ref_frame[1]]++;
  232|      0|    }
  233|   254k|  }
  234|   511k|}
partition_search.c:av1_mode_context_analyzer:
  171|   511k|    const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) {
  172|   511k|  const int8_t ref_frame = av1_ref_frame_type(rf);
  173|       |
  174|   511k|  if (rf[1] <= INTRA_FRAME) return mode_context[ref_frame];
  ------------------
  |  Branch (174:7): [True: 511k, False: 37]
  ------------------
  175|       |
  176|     37|  const int16_t newmv_ctx = mode_context[ref_frame] & NEWMV_CTX_MASK;
  ------------------
  |  |  490|     37|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|     37|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  177|     37|  const int16_t refmv_ctx =
  178|     37|      (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|     37|#define REFMV_OFFSET 4
  ------------------
                    (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|     37|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|     37|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  179|       |
  180|     37|  const int16_t comp_ctx = compound_mode_ctx_map[refmv_ctx >> 1][AOMMIN(
  ------------------
  |  |   34|     37|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 37]
  |  |  ------------------
  ------------------
  181|     37|      newmv_ctx, COMP_NEWMV_CTXS - 1)];
  182|     37|  return comp_ctx;
  183|   511k|}
partition_search.c:av1_drl_ctx:
  185|   222k|static inline uint8_t av1_drl_ctx(const uint16_t *ref_mv_weight, int ref_idx) {
  186|   222k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|   445k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (186:7): [True: 195k, False: 27.5k]
  ------------------
  187|   195k|      ref_mv_weight[ref_idx + 1] >= REF_CAT_LEVEL)
  ------------------
  |  |  512|   195k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (187:7): [True: 99.2k, False: 96.0k]
  ------------------
  188|  99.2k|    return 0;
  189|       |
  190|   123k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|   247k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (190:7): [True: 96.3k, False: 27.2k]
  ------------------
  191|  96.3k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  96.3k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (191:7): [True: 96.3k, False: 18.4E]
  ------------------
  192|  96.3k|    return 1;
  193|       |
  194|  27.2k|  if (ref_mv_weight[ref_idx] < REF_CAT_LEVEL &&
  ------------------
  |  |  512|  54.5k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (194:7): [True: 27.6k, False: 18.4E]
  ------------------
  195|  27.6k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  27.6k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (195:7): [True: 27.6k, False: 0]
  ------------------
  196|  27.6k|    return 2;
  197|       |
  198|  18.4E|  return 0;
  199|  27.2k|}
partition_search.c:av1_ref_frame_type:
  113|  8.52M|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|  8.52M|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 8.52M]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|  8.52M|  return rf[0];
  127|  8.52M|}
rdopt.c:av1_find_ref_dv:
  268|  72.2k|                                   int mib_size, int mi_row) {
  269|  72.2k|  if (mi_row - mib_size < tile->mi_row_start) {
  ------------------
  |  Branch (269:7): [True: 70.4k, False: 1.75k]
  ------------------
  270|  70.4k|    ref_dv->as_fullmv.row = 0;
  271|  70.4k|    ref_dv->as_fullmv.col = -MI_SIZE * mib_size - INTRABC_DELAY_PIXELS;
  ------------------
  |  |   40|  70.4k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  70.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                  ref_dv->as_fullmv.col = -MI_SIZE * mib_size - INTRABC_DELAY_PIXELS;
  ------------------
  |  |  264|  70.4k|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  ------------------
  272|  70.4k|  } else {
  273|  1.75k|    ref_dv->as_fullmv.row = -MI_SIZE * mib_size;
  ------------------
  |  |   40|  1.75k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  1.75k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  274|  1.75k|    ref_dv->as_fullmv.col = 0;
  275|  1.75k|  }
  276|  72.2k|  convert_fullmv_to_mv(ref_dv);
  277|  72.2k|}
rdopt.c:av1_is_dv_valid:
  281|   144k|                                  BLOCK_SIZE bsize, int mib_size_log2) {
  282|   144k|  const int bw = block_size_wide[bsize];
  283|   144k|  const int bh = block_size_high[bsize];
  284|   144k|  const int SCALE_PX_TO_MV = 8;
  285|       |  // Disallow subpixel for now
  286|       |  // SUBPEL_MASK is not the correct scale
  287|   144k|  if (((dv.row & (SCALE_PX_TO_MV - 1)) || (dv.col & (SCALE_PX_TO_MV - 1))))
  ------------------
  |  Branch (287:8): [True: 0, False: 144k]
  |  Branch (287:43): [True: 0, False: 144k]
  ------------------
  288|      0|    return 0;
  289|       |
  290|   144k|  const TileInfo *const tile = &xd->tile;
  291|       |  // Is the source top-left inside the current tile?
  292|   144k|  const int src_top_edge = mi_row * MI_SIZE * SCALE_PX_TO_MV + dv.row;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  293|   144k|  const int tile_top_edge = tile->mi_row_start * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  294|   144k|  if (src_top_edge < tile_top_edge) return 0;
  ------------------
  |  Branch (294:7): [True: 0, False: 144k]
  ------------------
  295|   144k|  const int src_left_edge = mi_col * MI_SIZE * SCALE_PX_TO_MV + dv.col;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  296|   144k|  const int tile_left_edge = tile->mi_col_start * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  297|   144k|  if (src_left_edge < tile_left_edge) return 0;
  ------------------
  |  Branch (297:7): [True: 0, False: 144k]
  ------------------
  298|       |  // Is the bottom right inside the current tile?
  299|   144k|  const int src_bottom_edge = (mi_row * MI_SIZE + bh) * SCALE_PX_TO_MV + dv.row;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  300|   144k|  const int tile_bottom_edge = tile->mi_row_end * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|   144k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   144k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  301|   144k|  if (src_bottom_edge > tile_bottom_edge) return 0;
  ------------------
  |  Branch (301:7): [True: 2.70k, False: 141k]
  ------------------
  302|   141k|  const int src_right_edge = (mi_col * MI_SIZE + bw) * SCALE_PX_TO_MV + dv.col;
  ------------------
  |  |   40|   141k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   141k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  303|   141k|  const int tile_right_edge = tile->mi_col_end * MI_SIZE * SCALE_PX_TO_MV;
  ------------------
  |  |   40|   141k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   141k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  304|   141k|  if (src_right_edge > tile_right_edge) return 0;
  ------------------
  |  Branch (304:7): [True: 1.25k, False: 140k]
  ------------------
  305|       |
  306|       |  // Special case for sub 8x8 chroma cases, to prevent referring to chroma
  307|       |  // pixels outside current tile.
  308|   140k|  if (xd->is_chroma_ref && av1_num_planes(cm) > 1) {
  ------------------
  |  Branch (308:7): [True: 91.7k, False: 48.7k]
  |  Branch (308:28): [True: 76.1k, False: 15.6k]
  ------------------
  309|  76.1k|    const struct macroblockd_plane *const pd = &xd->plane[1];
  310|  76.1k|    if (bw < 8 && pd->subsampling_x)
  ------------------
  |  Branch (310:9): [True: 37.6k, False: 38.5k]
  |  Branch (310:19): [True: 16.3k, False: 21.3k]
  ------------------
  311|  16.3k|      if (src_left_edge < tile_left_edge + 4 * SCALE_PX_TO_MV) return 0;
  ------------------
  |  Branch (311:11): [True: 12.6k, False: 3.64k]
  ------------------
  312|  63.4k|    if (bh < 8 && pd->subsampling_y)
  ------------------
  |  Branch (312:9): [True: 35.7k, False: 27.7k]
  |  Branch (312:19): [True: 4.22k, False: 31.5k]
  ------------------
  313|  4.22k|      if (src_top_edge < tile_top_edge + 4 * SCALE_PX_TO_MV) return 0;
  ------------------
  |  Branch (313:11): [True: 2.77k, False: 1.45k]
  ------------------
  314|  63.4k|  }
  315|       |
  316|       |  // Is the bottom right within an already coded SB? Also consider additional
  317|       |  // constraints to facilitate HW decoder.
  318|   125k|  const int max_mib_size = 1 << mib_size_log2;
  319|   125k|  const int active_sb_row = mi_row >> mib_size_log2;
  320|   125k|  const int active_sb64_col = (mi_col * MI_SIZE) >> 6;
  ------------------
  |  |   40|   125k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   125k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  321|   125k|  const int sb_size = max_mib_size * MI_SIZE;
  ------------------
  |  |   40|   125k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   125k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  322|   125k|  const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size;
  323|   125k|  const int src_sb64_col = ((src_right_edge >> 3) - 1) >> 6;
  324|   125k|  const int total_sb64_per_row =
  325|   125k|      ((tile->mi_col_end - tile->mi_col_start - 1) >> 4) + 1;
  326|   125k|  const int active_sb64 = active_sb_row * total_sb64_per_row + active_sb64_col;
  327|   125k|  const int src_sb64 = src_sb_row * total_sb64_per_row + src_sb64_col;
  328|   125k|  if (src_sb64 >= active_sb64 - INTRABC_DELAY_SB64) return 0;
  ------------------
  |  |  265|   125k|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|   125k|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 125k, False: 18.4E]
  ------------------
  329|       |
  330|       |  // Wavefront constraint: use only top left area of frame for reference.
  331|  18.4E|  const int gradient = 1 + INTRABC_DELAY_SB64 + (sb_size > 64);
  ------------------
  |  |  265|  18.4E|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|  18.4E|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  332|  18.4E|  const int wf_offset = gradient * (active_sb_row - src_sb_row);
  333|  18.4E|  if (src_sb_row > active_sb_row ||
  ------------------
  |  Branch (333:7): [True: 18.4E, False: 0]
  ------------------
  334|      0|      src_sb64_col >= active_sb64_col - INTRABC_DELAY_SB64 + wf_offset)
  ------------------
  |  |  265|      0|#define INTRABC_DELAY_SB64 (INTRABC_DELAY_PIXELS / 64)
  |  |  ------------------
  |  |  |  |  264|      0|#define INTRABC_DELAY_PIXELS 256  //  Delay of 256 pixels
  |  |  ------------------
  ------------------
  |  Branch (334:7): [True: 0, False: 0]
  ------------------
  335|      0|    return 0;
  336|       |
  337|  18.4E|  return 1;
  338|  18.4E|}
rdopt.c:av1_ref_frame_type:
  113|  49.4M|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|  49.4M|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 49.4M]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|  49.4M|  return rf[0];
  127|  49.4M|}
rdopt.c:av1_set_ref_frame:
  153|  7.66M|                                     MV_REFERENCE_FRAME ref_frame_type) {
  154|  7.66M|  if (ref_frame_type >= REF_FRAMES) {
  ------------------
  |  Branch (154:7): [True: 0, False: 7.66M]
  ------------------
  155|      0|    rf[0] = ref_frame_map[ref_frame_type - REF_FRAMES][0];
  156|      0|    rf[1] = ref_frame_map[ref_frame_type - REF_FRAMES][1];
  157|  7.66M|  } else {
  158|       |    assert(ref_frame_type > NONE_FRAME);
  159|  7.66M|    rf[0] = ref_frame_type;
  160|  7.66M|    rf[1] = NONE_FRAME;
  161|  7.66M|  }
  162|  7.66M|}
rdopt.c:av1_mode_context_analyzer:
  171|  6.99M|    const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) {
  172|  6.99M|  const int8_t ref_frame = av1_ref_frame_type(rf);
  173|       |
  174|  6.99M|  if (rf[1] <= INTRA_FRAME) return mode_context[ref_frame];
  ------------------
  |  Branch (174:7): [True: 6.99M, False: 583]
  ------------------
  175|       |
  176|    583|  const int16_t newmv_ctx = mode_context[ref_frame] & NEWMV_CTX_MASK;
  ------------------
  |  |  490|    583|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|    583|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  177|    583|  const int16_t refmv_ctx =
  178|    583|      (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|    583|#define REFMV_OFFSET 4
  ------------------
                    (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|    583|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|    583|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  179|       |
  180|    583|  const int16_t comp_ctx = compound_mode_ctx_map[refmv_ctx >> 1][AOMMIN(
  ------------------
  |  |   34|    583|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 583]
  |  |  ------------------
  ------------------
  181|    583|      newmv_ctx, COMP_NEWMV_CTXS - 1)];
  182|    583|  return comp_ctx;
  183|  6.99M|}
rdopt.c:av1_drl_ctx:
  185|  1.41M|static inline uint8_t av1_drl_ctx(const uint16_t *ref_mv_weight, int ref_idx) {
  186|  1.41M|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|  2.83M|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (186:7): [True: 1.04M, False: 370k]
  ------------------
  187|  1.04M|      ref_mv_weight[ref_idx + 1] >= REF_CAT_LEVEL)
  ------------------
  |  |  512|  1.04M|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (187:7): [True: 371k, False: 673k]
  ------------------
  188|   371k|    return 0;
  189|       |
  190|  1.04M|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|  2.08M|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (190:7): [True: 673k, False: 370k]
  ------------------
  191|   673k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|   673k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (191:7): [True: 673k, False: 18.4E]
  ------------------
  192|   673k|    return 1;
  193|       |
  194|   370k|  if (ref_mv_weight[ref_idx] < REF_CAT_LEVEL &&
  ------------------
  |  |  512|   740k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (194:7): [True: 371k, False: 18.4E]
  ------------------
  195|   371k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|   371k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (195:7): [True: 371k, False: 18.4E]
  ------------------
  196|   371k|    return 2;
  197|       |
  198|  18.4E|  return 0;
  199|   370k|}
rdopt.c:lower_mv_precision:
   88|  5.14M|static inline void lower_mv_precision(MV *mv, int allow_hp, int is_integer) {
   89|  5.14M|  if (is_integer) {
  ------------------
  |  Branch (89:7): [True: 0, False: 5.14M]
  ------------------
   90|      0|    integer_mv_precision(mv);
   91|  5.14M|  } else {
   92|  5.14M|    if (!allow_hp) {
  ------------------
  |  Branch (92:9): [True: 3.40M, False: 1.73M]
  ------------------
   93|  3.40M|      if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
  ------------------
  |  Branch (93:11): [True: 0, False: 3.40M]
  |  Branch (93:36): [True: 0, False: 0]
  ------------------
   94|  3.40M|      if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
  ------------------
  |  Branch (94:11): [True: 0, False: 3.40M]
  |  Branch (94:36): [True: 0, False: 0]
  ------------------
   95|  3.40M|    }
   96|  5.14M|  }
   97|  5.14M|}
rdopt.c:av1_collect_neighbors_ref_counts:
  209|  1.91M|static inline void av1_collect_neighbors_ref_counts(MACROBLOCKD *const xd) {
  210|  1.91M|  av1_zero(xd->neighbors_ref_counts);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  211|       |
  212|  1.91M|  uint8_t *const ref_counts = xd->neighbors_ref_counts;
  213|       |
  214|  1.91M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  215|  1.91M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  216|  1.91M|  const int above_in_image = xd->up_available;
  217|  1.91M|  const int left_in_image = xd->left_available;
  218|       |
  219|       |  // Above neighbor
  220|  1.91M|  if (above_in_image && is_inter_block(above_mbmi)) {
  ------------------
  |  Branch (220:7): [True: 1.51M, False: 407k]
  |  Branch (220:25): [True: 206k, False: 1.30M]
  ------------------
  221|   206k|    ref_counts[above_mbmi->ref_frame[0]]++;
  222|   206k|    if (has_second_ref(above_mbmi)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 206k]
  ------------------
  223|      0|      ref_counts[above_mbmi->ref_frame[1]]++;
  224|      0|    }
  225|   206k|  }
  226|       |
  227|       |  // Left neighbor
  228|  1.91M|  if (left_in_image && is_inter_block(left_mbmi)) {
  ------------------
  |  Branch (228:7): [True: 1.51M, False: 407k]
  |  Branch (228:24): [True: 208k, False: 1.30M]
  ------------------
  229|   208k|    ref_counts[left_mbmi->ref_frame[0]]++;
  230|   208k|    if (has_second_ref(left_mbmi)) {
  ------------------
  |  Branch (230:9): [True: 0, False: 208k]
  ------------------
  231|      0|      ref_counts[left_mbmi->ref_frame[1]]++;
  232|      0|    }
  233|   208k|  }
  234|  1.91M|}
nonrd_pickmode.c:av1_ref_frame_type:
  113|  2.49M|static inline int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
  114|  2.49M|  if (rf[1] > INTRA_FRAME) {
  ------------------
  |  Branch (114:7): [True: 0, False: 2.49M]
  ------------------
  115|      0|    const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
  116|      0|    if (uni_comp_ref_idx >= 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 0]
  ------------------
  117|      0|      assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
  118|      0|             MODE_CTX_REF_FRAMES);
  119|      0|      return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
  120|      0|    } else {
  121|      0|      return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
  ------------------
  |  |  569|      0|#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
  ------------------
  122|      0|             BWD_RF_OFFSET(rf[1]) * FWD_REFS;
  ------------------
  |  |  570|      0|#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
  ------------------
  123|      0|    }
  124|      0|  }
  125|       |
  126|  2.49M|  return rf[0];
  127|  2.49M|}
nonrd_pickmode.c:av1_mode_context_analyzer:
  171|  1.79M|    const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) {
  172|  1.79M|  const int8_t ref_frame = av1_ref_frame_type(rf);
  173|       |
  174|  1.79M|  if (rf[1] <= INTRA_FRAME) return mode_context[ref_frame];
  ------------------
  |  Branch (174:7): [True: 1.79M, False: 32]
  ------------------
  175|       |
  176|     32|  const int16_t newmv_ctx = mode_context[ref_frame] & NEWMV_CTX_MASK;
  ------------------
  |  |  490|     32|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|     32|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  177|     32|  const int16_t refmv_ctx =
  178|     32|      (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|     32|#define REFMV_OFFSET 4
  ------------------
                    (mode_context[ref_frame] >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|     32|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|     32|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  179|       |
  180|     32|  const int16_t comp_ctx = compound_mode_ctx_map[refmv_ctx >> 1][AOMMIN(
  ------------------
  |  |   34|     32|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 32]
  |  |  ------------------
  ------------------
  181|     32|      newmv_ctx, COMP_NEWMV_CTXS - 1)];
  182|     32|  return comp_ctx;
  183|  1.79M|}
nonrd_pickmode.c:av1_drl_ctx:
  185|  35.6k|static inline uint8_t av1_drl_ctx(const uint16_t *ref_mv_weight, int ref_idx) {
  186|  35.6k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|  71.3k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (186:7): [True: 33.9k, False: 1.73k]
  ------------------
  187|  33.9k|      ref_mv_weight[ref_idx + 1] >= REF_CAT_LEVEL)
  ------------------
  |  |  512|  33.9k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (187:7): [True: 18.1k, False: 15.7k]
  ------------------
  188|  18.1k|    return 0;
  189|       |
  190|  17.5k|  if (ref_mv_weight[ref_idx] >= REF_CAT_LEVEL &&
  ------------------
  |  |  512|  35.0k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (190:7): [True: 15.7k, False: 1.73k]
  ------------------
  191|  15.7k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  15.7k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (191:7): [True: 15.7k, False: 0]
  ------------------
  192|  15.7k|    return 1;
  193|       |
  194|  1.73k|  if (ref_mv_weight[ref_idx] < REF_CAT_LEVEL &&
  ------------------
  |  |  512|  3.46k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (194:7): [True: 1.73k, False: 18.4E]
  ------------------
  195|  1.73k|      ref_mv_weight[ref_idx + 1] < REF_CAT_LEVEL)
  ------------------
  |  |  512|  1.73k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (195:7): [True: 1.73k, False: 0]
  ------------------
  196|  1.73k|    return 2;
  197|       |
  198|  18.4E|  return 0;
  199|  1.73k|}
mvref_common.c:av1_set_ref_frame:
  153|  3.11M|                                     MV_REFERENCE_FRAME ref_frame_type) {
  154|  3.11M|  if (ref_frame_type >= REF_FRAMES) {
  ------------------
  |  Branch (154:7): [True: 0, False: 3.11M]
  ------------------
  155|      0|    rf[0] = ref_frame_map[ref_frame_type - REF_FRAMES][0];
  156|      0|    rf[1] = ref_frame_map[ref_frame_type - REF_FRAMES][1];
  157|  3.11M|  } else {
  158|       |    assert(ref_frame_type > NONE_FRAME);
  159|  3.11M|    rf[0] = ref_frame_type;
  160|  3.11M|    rf[1] = NONE_FRAME;
  161|  3.11M|  }
  162|  3.11M|}
mvref_common.c:find_valid_row_offset:
   77|  2.16M|                                        int row_offset) {
   78|  2.16M|  return clamp(row_offset, tile->mi_row_start - mi_row,
   79|  2.16M|               tile->mi_row_end - mi_row - 1);
   80|  2.16M|}
mvref_common.c:find_valid_col_offset:
   83|  2.16M|                                        int col_offset) {
   84|  2.16M|  return clamp(col_offset, tile->mi_col_start - mi_col,
   85|  2.16M|               tile->mi_col_end - mi_col - 1);
   86|  2.16M|}
mvref_common.c:get_block_mv:
   62|  3.60M|static inline int_mv get_block_mv(const MB_MODE_INFO *candidate, int which_mv) {
   63|  3.60M|  return candidate->mv[which_mv];
   64|  3.60M|}
mvref_common.c:clamp_mv_ref:
   52|  2.88M|static inline void clamp_mv_ref(MV *mv, int bw, int bh, const MACROBLOCKD *xd) {
   53|  2.88M|  const SubpelMvLimits mv_limits = {
   54|  2.88M|    xd->mb_to_left_edge - GET_MV_SUBPEL(bw) - MV_BORDER,
  ------------------
  |  |   29|  2.88M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
                  xd->mb_to_left_edge - GET_MV_SUBPEL(bw) - MV_BORDER,
  ------------------
  |  |   35|  2.88M|#define MV_BORDER (16 << 3)  // Allow 16 pels in 1/8th pel units
  ------------------
   55|  2.88M|    xd->mb_to_right_edge + GET_MV_SUBPEL(bw) + MV_BORDER,
  ------------------
  |  |   29|  2.88M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
                  xd->mb_to_right_edge + GET_MV_SUBPEL(bw) + MV_BORDER,
  ------------------
  |  |   35|  2.88M|#define MV_BORDER (16 << 3)  // Allow 16 pels in 1/8th pel units
  ------------------
   56|  2.88M|    xd->mb_to_top_edge - GET_MV_SUBPEL(bh) - MV_BORDER,
  ------------------
  |  |   29|  2.88M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
                  xd->mb_to_top_edge - GET_MV_SUBPEL(bh) - MV_BORDER,
  ------------------
  |  |   35|  2.88M|#define MV_BORDER (16 << 3)  // Allow 16 pels in 1/8th pel units
  ------------------
   57|  2.88M|    xd->mb_to_bottom_edge + GET_MV_SUBPEL(bh) + MV_BORDER
  ------------------
  |  |   29|  2.88M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
                  xd->mb_to_bottom_edge + GET_MV_SUBPEL(bh) + MV_BORDER
  ------------------
  |  |   35|  2.88M|#define MV_BORDER (16 << 3)  // Allow 16 pels in 1/8th pel units
  ------------------
   58|  2.88M|  };
   59|  2.88M|  clamp_mv(mv, &mv_limits);
   60|  2.88M|}
mvref_common.c:lower_mv_precision:
   88|   644k|static inline void lower_mv_precision(MV *mv, int allow_hp, int is_integer) {
   89|   644k|  if (is_integer) {
  ------------------
  |  Branch (89:7): [True: 0, False: 644k]
  ------------------
   90|      0|    integer_mv_precision(mv);
   91|   644k|  } else {
   92|   644k|    if (!allow_hp) {
  ------------------
  |  Branch (92:9): [True: 370k, False: 273k]
  ------------------
   93|   370k|      if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
  ------------------
  |  Branch (93:11): [True: 0, False: 370k]
  |  Branch (93:36): [True: 0, False: 0]
  ------------------
   94|   370k|      if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
  ------------------
  |  Branch (94:11): [True: 0, False: 370k]
  |  Branch (94:36): [True: 0, False: 0]
  ------------------
   95|   370k|    }
   96|   644k|  }
   97|   644k|}
mvref_common.c:get_relative_dist:
   37|  3.06M|static inline int get_relative_dist(const OrderHintInfo *oh, int a, int b) {
   38|  3.06M|  if (!oh->enable_order_hint) return 0;
  ------------------
  |  Branch (38:7): [True: 0, False: 3.06M]
  ------------------
   39|       |
   40|  3.06M|  const int bits = oh->order_hint_bits_minus_1 + 1;
   41|       |
   42|  3.06M|  assert(bits >= 1);
   43|  3.06M|  assert(a >= 0 && a < (1 << bits));
   44|  3.06M|  assert(b >= 0 && b < (1 << bits));
   45|       |
   46|  3.06M|  int diff = a - b;
   47|  3.06M|  const int m = 1 << (bits - 1);
   48|  3.06M|  diff = (diff & (m - 1)) - (diff & m);
   49|  3.06M|  return diff;
   50|  3.06M|}
mvref_common.c:is_inside:
   69|  16.3M|                            const POSITION *mi_pos) {
   70|  16.3M|  return !(mi_row + mi_pos->row < tile->mi_row_start ||
  ------------------
  |  Branch (70:12): [True: 1.54M, False: 14.7M]
  ------------------
   71|  14.7M|           mi_col + mi_pos->col < tile->mi_col_start ||
  ------------------
  |  Branch (71:12): [True: 455k, False: 14.3M]
  ------------------
   72|  14.3M|           mi_row + mi_pos->row >= tile->mi_row_end ||
  ------------------
  |  Branch (72:12): [True: 1.00M, False: 13.3M]
  ------------------
   73|  13.3M|           mi_col + mi_pos->col >= tile->mi_col_end);
  ------------------
  |  Branch (73:12): [True: 1.14M, False: 12.1M]
  ------------------
   74|  16.3M|}

reconinter.c:foreach_overlappable_nb_above:
   23|  2.31M|                                                 void *fun_ctxt) {
   24|  2.31M|  if (!xd->up_available) return;
  ------------------
  |  Branch (24:7): [True: 488k, False: 1.82M]
  ------------------
   25|       |
   26|  1.82M|  const int num_planes = av1_num_planes(cm);
   27|  1.82M|  int nb_count = 0;
   28|  1.82M|  const int mi_col = xd->mi_col;
   29|       |  // prev_row_mi points into the mi array, starting at the beginning of the
   30|       |  // previous row.
   31|  1.82M|  MB_MODE_INFO **prev_row_mi = xd->mi - mi_col - 1 * xd->mi_stride;
   32|  1.82M|  const int end_col = AOMMIN(mi_col + xd->width, cm->mi_params.mi_cols);
  ------------------
  |  |   34|  1.82M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.56M, False: 252k]
  |  |  ------------------
  ------------------
   33|  1.82M|  uint8_t mi_step;
   34|  3.68M|  for (int above_mi_col = mi_col; above_mi_col < end_col && nb_count < nb_max;
  ------------------
  |  Branch (34:35): [True: 1.86M, False: 1.82M]
  |  Branch (34:61): [True: 1.86M, False: 18.4E]
  ------------------
   35|  1.86M|       above_mi_col += mi_step) {
   36|  1.86M|    MB_MODE_INFO **above_mi = prev_row_mi + above_mi_col;
   37|  1.86M|    mi_step =
   38|  1.86M|        AOMMIN(mi_size_wide[above_mi[0]->bsize], mi_size_wide[BLOCK_64X64]);
  ------------------
  |  |   34|  1.86M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.86M, False: 849]
  |  |  ------------------
  ------------------
   39|       |    // If we're considering a block with width 4, it should be treated as
   40|       |    // half of a pair of blocks with chroma information in the second. Move
   41|       |    // above_mi_col back to the start of the pair if needed, set above_mbmi
   42|       |    // to point at the block with chroma information, and set mi_step to 2 to
   43|       |    // step over the entire pair at the end of the iteration.
   44|  1.86M|    if (mi_step == 1) {
  ------------------
  |  Branch (44:9): [True: 8.60k, False: 1.85M]
  ------------------
   45|  8.60k|      above_mi_col &= ~1;
   46|  8.60k|      above_mi = prev_row_mi + above_mi_col + 1;
   47|  8.60k|      mi_step = 2;
   48|  8.60k|    }
   49|  1.86M|    if (is_neighbor_overlappable(*above_mi)) {
  ------------------
  |  Branch (49:9): [True: 585k, False: 1.27M]
  ------------------
   50|   585k|      ++nb_count;
   51|   585k|      fun(xd, 0, above_mi_col - mi_col, AOMMIN(xd->width, mi_step), 0,
  ------------------
  |  |   34|   585k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 26.1k, False: 558k]
  |  |  ------------------
  ------------------
   52|   585k|          *above_mi, fun_ctxt, num_planes);
   53|   585k|    }
   54|  1.86M|  }
   55|  1.82M|}
reconinter.c:foreach_overlappable_nb_left:
   60|  1.74M|                                                void *fun_ctxt) {
   61|  1.74M|  if (!xd->left_available) return;
  ------------------
  |  Branch (61:7): [True: 370k, False: 1.37M]
  ------------------
   62|       |
   63|  1.37M|  const int num_planes = av1_num_planes(cm);
   64|  1.37M|  int nb_count = 0;
   65|       |  // prev_col_mi points into the mi array, starting at the top of the
   66|       |  // previous column
   67|  1.37M|  const int mi_row = xd->mi_row;
   68|  1.37M|  MB_MODE_INFO **prev_col_mi = xd->mi - 1 - mi_row * xd->mi_stride;
   69|  1.37M|  const int end_row = AOMMIN(mi_row + xd->height, cm->mi_params.mi_rows);
  ------------------
  |  |   34|  1.37M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.17M, False: 195k]
  |  |  ------------------
  ------------------
   70|  1.37M|  uint8_t mi_step;
   71|  2.77M|  for (int left_mi_row = mi_row; left_mi_row < end_row && nb_count < nb_max;
  ------------------
  |  Branch (71:34): [True: 1.40M, False: 1.37M]
  |  Branch (71:59): [True: 1.40M, False: 18.4E]
  ------------------
   72|  1.40M|       left_mi_row += mi_step) {
   73|  1.40M|    MB_MODE_INFO **left_mi = prev_col_mi + left_mi_row * xd->mi_stride;
   74|  1.40M|    mi_step =
   75|  1.40M|        AOMMIN(mi_size_high[left_mi[0]->bsize], mi_size_high[BLOCK_64X64]);
  ------------------
  |  |   34|  1.40M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.40M, False: 937]
  |  |  ------------------
  ------------------
   76|  1.40M|    if (mi_step == 1) {
  ------------------
  |  Branch (76:9): [True: 8.76k, False: 1.39M]
  ------------------
   77|  8.76k|      left_mi_row &= ~1;
   78|  8.76k|      left_mi = prev_col_mi + (left_mi_row + 1) * xd->mi_stride;
   79|  8.76k|      mi_step = 2;
   80|  8.76k|    }
   81|  1.40M|    if (is_neighbor_overlappable(*left_mi)) {
  ------------------
  |  Branch (81:9): [True: 285k, False: 1.11M]
  ------------------
   82|   285k|      ++nb_count;
   83|   285k|      fun(xd, left_mi_row - mi_row, 0, AOMMIN(xd->height, mi_step), 1, *left_mi,
  ------------------
  |  |   34|   285k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 9.46k, False: 276k]
  |  |  ------------------
  ------------------
   84|   285k|          fun_ctxt, num_planes);
   85|   285k|    }
   86|  1.40M|  }
   87|  1.37M|}

aom_read_obu_header_and_size:
   95|  63.1k|                                             size_t *const bytes_read) {
   96|  63.1k|  size_t length_field_size_obu = 0;
   97|  63.1k|  size_t length_field_size_payload = 0;
   98|  63.1k|  size_t obu_size = 0;
   99|  63.1k|  aom_codec_err_t status;
  100|       |
  101|  63.1k|  if (is_annexb) {
  ------------------
  |  Branch (101:7): [True: 0, False: 63.1k]
  ------------------
  102|       |    // Size field comes before the OBU header, and includes the OBU header
  103|      0|    status =
  104|      0|        read_obu_size(data, bytes_available, &obu_size, &length_field_size_obu);
  105|       |
  106|      0|    if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (106:9): [True: 0, False: 0]
  ------------------
  107|      0|  }
  108|       |
  109|  63.1k|  struct aom_read_bit_buffer rb = { data + length_field_size_obu,
  110|  63.1k|                                    data + bytes_available, 0, NULL, NULL };
  111|       |
  112|  63.1k|  status = read_obu_header(&rb, is_annexb, obu_header);
  113|  63.1k|  if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (113:7): [True: 0, False: 63.1k]
  ------------------
  114|       |
  115|  63.1k|  if (!obu_header->has_size_field) {
  ------------------
  |  Branch (115:7): [True: 0, False: 63.1k]
  ------------------
  116|      0|    assert(is_annexb);
  117|       |    // Derive the payload size from the data we've already read
  118|      0|    if (obu_size < obu_header->size) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (118:9): [True: 0, False: 0]
  ------------------
  119|       |
  120|      0|    *payload_size = obu_size - obu_header->size;
  121|  63.1k|  } else {
  122|       |    // Size field comes after the OBU header, and is just the payload size
  123|  63.1k|    status = read_obu_size(
  124|  63.1k|        data + length_field_size_obu + obu_header->size,
  125|  63.1k|        bytes_available - length_field_size_obu - obu_header->size,
  126|  63.1k|        payload_size, &length_field_size_payload);
  127|  63.1k|    if (status != AOM_CODEC_OK) return status;
  ------------------
  |  Branch (127:9): [True: 0, False: 63.1k]
  ------------------
  128|  63.1k|  }
  129|       |
  130|  63.1k|  *bytes_read =
  131|  63.1k|      length_field_size_obu + obu_header->size + length_field_size_payload;
  132|  63.1k|  return AOM_CODEC_OK;
  133|  63.1k|}
obu_util.c:read_obu_header:
   34|  63.1k|                                       int is_annexb, ObuHeader *header) {
   35|  63.1k|  if (!rb || !header) return AOM_CODEC_INVALID_PARAM;
  ------------------
  |  Branch (35:7): [True: 0, False: 63.1k]
  |  Branch (35:14): [True: 0, False: 63.1k]
  ------------------
   36|       |
   37|  63.1k|  const ptrdiff_t bit_buffer_byte_length = rb->bit_buffer_end - rb->bit_buffer;
   38|  63.1k|  if (bit_buffer_byte_length < 1) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (38:7): [True: 0, False: 63.1k]
  ------------------
   39|       |
   40|  63.1k|  header->size = 1;
   41|       |
   42|  63.1k|  if (aom_rb_read_bit(rb) != 0) {
  ------------------
  |  Branch (42:7): [True: 0, False: 63.1k]
  ------------------
   43|       |    // Forbidden bit. Must not be set.
   44|      0|    return AOM_CODEC_CORRUPT_FRAME;
   45|      0|  }
   46|       |
   47|  63.1k|  header->type = (OBU_TYPE)aom_rb_read_literal(rb, 4);
   48|  63.1k|  header->has_extension = aom_rb_read_bit(rb);
   49|  63.1k|  header->has_size_field = aom_rb_read_bit(rb);
   50|       |
   51|  63.1k|  if (!header->has_size_field && !is_annexb) {
  ------------------
  |  Branch (51:7): [True: 0, False: 63.1k]
  |  Branch (51:34): [True: 0, False: 0]
  ------------------
   52|       |    // section 5 obu streams must have obu_size field set.
   53|      0|    return AOM_CODEC_UNSUP_BITSTREAM;
   54|      0|  }
   55|       |
   56|       |  // obu_reserved_1bit must be set to 0. The value is ignored by a decoder.
   57|  63.1k|  aom_rb_read_bit(rb);
   58|       |
   59|  63.1k|  if (header->has_extension) {
  ------------------
  |  Branch (59:7): [True: 35.0k, False: 28.0k]
  ------------------
   60|  35.0k|    if (bit_buffer_byte_length == 1) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (60:9): [True: 0, False: 35.0k]
  ------------------
   61|       |
   62|  35.0k|    header->size += 1;
   63|  35.0k|    header->temporal_layer_id = aom_rb_read_literal(rb, 3);
   64|  35.0k|    header->spatial_layer_id = aom_rb_read_literal(rb, 2);
   65|       |    // extension_header_reserved_3bits must be set to 0. The value is ignored by
   66|       |    // a decoder.
   67|  35.0k|    aom_rb_read_literal(rb, 3);
   68|  35.0k|  } else {
   69|  28.0k|    header->temporal_layer_id = 0;
   70|  28.0k|    header->spatial_layer_id = 0;
   71|  28.0k|  }
   72|       |
   73|  63.1k|  return AOM_CODEC_OK;
   74|  63.1k|}
obu_util.c:read_obu_size:
   20|  63.1k|                                     size_t *const length_field_size) {
   21|  63.1k|  uint64_t u_obu_size = 0;
   22|  63.1k|  if (aom_uleb_decode(data, bytes_available, &u_obu_size, length_field_size) !=
  ------------------
  |  Branch (22:7): [True: 0, False: 63.1k]
  ------------------
   23|  63.1k|      0) {
   24|      0|    return AOM_CODEC_CORRUPT_FRAME;
   25|      0|  }
   26|       |
   27|  63.1k|  if (u_obu_size > UINT32_MAX) return AOM_CODEC_CORRUPT_FRAME;
  ------------------
  |  Branch (27:7): [True: 0, False: 63.1k]
  ------------------
   28|  63.1k|  *obu_size = (size_t)u_obu_size;
   29|  63.1k|  return AOM_CODEC_OK;
   30|  63.1k|}

av1_get_pred_context_switchable_interp:
   30|  13.5M|int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir) {
   31|  13.5M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
   32|  13.5M|  const int ctx_offset =
   33|  13.5M|      (mbmi->ref_frame[1] > INTRA_FRAME) * INTER_FILTER_COMP_OFFSET;
  ------------------
  |  |  102|  13.5M|#define INTER_FILTER_COMP_OFFSET (SWITCHABLE_FILTERS + 1)
  ------------------
   34|  13.5M|  assert(dir == 0 || dir == 1);
   35|  13.5M|  const MV_REFERENCE_FRAME ref_frame = mbmi->ref_frame[0];
   36|       |  // Note:
   37|       |  // The mode info data structure has a one element border above and to the
   38|       |  // left of the entries corresponding to real macroblocks.
   39|       |  // The prediction flags in these dummy entries are initialized to 0.
   40|  13.5M|  int filter_type_ctx = ctx_offset + (dir & 0x01) * INTER_FILTER_DIR_OFFSET;
  ------------------
  |  |  103|  13.5M|#define INTER_FILTER_DIR_OFFSET ((SWITCHABLE_FILTERS + 1) * 2)
  ------------------
   41|  13.5M|  int left_type = SWITCHABLE_FILTERS;
   42|  13.5M|  int above_type = SWITCHABLE_FILTERS;
   43|       |
   44|  13.5M|  if (xd->left_available)
  ------------------
  |  Branch (44:7): [True: 10.6M, False: 2.93M]
  ------------------
   45|  10.6M|    left_type = get_ref_filter_type(xd->mi[-1], xd, dir, ref_frame);
   46|       |
   47|  13.5M|  if (xd->up_available)
  ------------------
  |  Branch (47:7): [True: 10.6M, False: 2.93M]
  ------------------
   48|  10.6M|    above_type =
   49|  10.6M|        get_ref_filter_type(xd->mi[-xd->mi_stride], xd, dir, ref_frame);
   50|       |
   51|  13.5M|  if (left_type == above_type) {
  ------------------
  |  Branch (51:7): [True: 10.0M, False: 3.50M]
  ------------------
   52|  10.0M|    filter_type_ctx += left_type;
   53|  10.0M|  } else if (left_type == SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (53:14): [True: 1.66M, False: 1.84M]
  ------------------
   54|  1.66M|    assert(above_type != SWITCHABLE_FILTERS);
   55|  1.66M|    filter_type_ctx += above_type;
   56|  1.84M|  } else if (above_type == SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (56:14): [True: 1.65M, False: 188k]
  ------------------
   57|  1.65M|    assert(left_type != SWITCHABLE_FILTERS);
   58|  1.65M|    filter_type_ctx += left_type;
   59|  1.65M|  } else {
   60|   188k|    filter_type_ctx += SWITCHABLE_FILTERS;
   61|   188k|  }
   62|       |
   63|  13.5M|  return filter_type_ctx;
   64|  13.5M|}
av1_get_palette_cache:
   74|  1.12M|                          uint16_t *cache) {
   75|  1.12M|  const int row = -xd->mb_to_top_edge >> 3;
   76|       |  // Do not refer to above SB row when on SB boundary.
   77|  1.12M|  const MB_MODE_INFO *const above_mi =
   78|  1.12M|      (row % (1 << MIN_SB_SIZE_LOG2)) ? xd->above_mbmi : NULL;
  ------------------
  |  |   36|  1.12M|#define MIN_SB_SIZE_LOG2 6
  ------------------
  |  Branch (78:7): [True: 652k, False: 468k]
  ------------------
   79|  1.12M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
   80|  1.12M|  int above_n = 0, left_n = 0;
   81|  1.12M|  if (above_mi) above_n = above_mi->palette_mode_info.palette_size[plane != 0];
  ------------------
  |  Branch (81:7): [True: 652k, False: 468k]
  ------------------
   82|  1.12M|  if (left_mi) left_n = left_mi->palette_mode_info.palette_size[plane != 0];
  ------------------
  |  Branch (82:7): [True: 660k, False: 460k]
  ------------------
   83|  1.12M|  if (above_n == 0 && left_n == 0) return 0;
  ------------------
  |  Branch (83:7): [True: 748k, False: 373k]
  |  Branch (83:23): [True: 571k, False: 176k]
  ------------------
   84|   549k|  int above_idx = plane * PALETTE_MAX_SIZE;
  ------------------
  |  |   63|   549k|#define PALETTE_MAX_SIZE 8
  ------------------
   85|   549k|  int left_idx = plane * PALETTE_MAX_SIZE;
  ------------------
  |  |   63|   549k|#define PALETTE_MAX_SIZE 8
  ------------------
   86|   549k|  int n = 0;
   87|   549k|  const uint16_t *above_colors =
   88|   549k|      above_mi ? above_mi->palette_mode_info.palette_colors : NULL;
  ------------------
  |  Branch (88:7): [True: 401k, False: 147k]
  ------------------
   89|   549k|  const uint16_t *left_colors =
   90|   549k|      left_mi ? left_mi->palette_mode_info.palette_colors : NULL;
  ------------------
  |  Branch (90:7): [True: 394k, False: 154k]
  ------------------
   91|       |  // Merge the sorted lists of base colors from above and left to get
   92|       |  // combined sorted color cache.
   93|  1.89M|  while (above_n > 0 && left_n > 0) {
  ------------------
  |  Branch (93:10): [True: 1.58M, False: 315k]
  |  Branch (93:25): [True: 1.34M, False: 234k]
  ------------------
   94|  1.34M|    uint16_t v_above = above_colors[above_idx];
   95|  1.34M|    uint16_t v_left = left_colors[left_idx];
   96|  1.34M|    if (v_left < v_above) {
  ------------------
  |  Branch (96:9): [True: 568k, False: 780k]
  ------------------
   97|   568k|      palette_add_to_cache(cache, &n, v_left);
   98|   568k|      ++left_idx, --left_n;
   99|   780k|    } else {
  100|   780k|      palette_add_to_cache(cache, &n, v_above);
  101|   780k|      ++above_idx, --above_n;
  102|   780k|      if (v_left == v_above) ++left_idx, --left_n;
  ------------------
  |  Branch (102:11): [True: 237k, False: 542k]
  ------------------
  103|   780k|    }
  104|  1.34M|  }
  105|  1.54M|  while (above_n-- > 0) {
  ------------------
  |  Branch (105:10): [True: 997k, False: 549k]
  ------------------
  106|   997k|    uint16_t val = above_colors[above_idx++];
  107|   997k|    palette_add_to_cache(cache, &n, val);
  108|   997k|  }
  109|  1.46M|  while (left_n-- > 0) {
  ------------------
  |  Branch (109:10): [True: 913k, False: 549k]
  ------------------
  110|   913k|    uint16_t val = left_colors[left_idx++];
  111|   913k|    palette_add_to_cache(cache, &n, val);
  112|   913k|  }
  113|       |  assert(n <= 2 * PALETTE_MAX_SIZE);
  114|   549k|  return n;
  115|  1.12M|}
av1_get_intra_inter_context:
  124|  6.97M|int av1_get_intra_inter_context(const MACROBLOCKD *xd) {
  125|  6.97M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  126|  6.97M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  127|  6.97M|  const int has_above = xd->up_available;
  128|  6.97M|  const int has_left = xd->left_available;
  129|       |
  130|  6.97M|  if (has_above && has_left) {  // both edges available
  ------------------
  |  Branch (130:7): [True: 5.51M, False: 1.45M]
  |  Branch (130:20): [True: 4.43M, False: 1.07M]
  ------------------
  131|  4.44M|    const int above_intra = !is_inter_block(above_mbmi);
  132|  4.44M|    const int left_intra = !is_inter_block(left_mbmi);
  133|  4.44M|    return left_intra && above_intra ? 3 : left_intra || above_intra;
  ------------------
  |  Branch (133:12): [True: 3.30M, False: 1.13M]
  |  Branch (133:26): [True: 2.87M, False: 432k]
  |  Branch (133:44): [True: 430k, False: 1.13M]
  |  Branch (133:58): [True: 431k, False: 705k]
  ------------------
  134|  4.44M|  } else if (has_above || has_left) {  // one edge available
  ------------------
  |  Branch (134:14): [True: 1.07M, False: 1.45M]
  |  Branch (134:27): [True: 1.09M, False: 362k]
  ------------------
  135|  2.18M|    return 2 * !is_inter_block(has_above ? above_mbmi : left_mbmi);
  ------------------
  |  Branch (135:32): [True: 1.08M, False: 1.09M]
  ------------------
  136|  2.18M|  } else {
  137|   351k|    return 0;
  138|   351k|  }
  139|  6.97M|}
av1_get_reference_mode_context:
  145|  2.38M|int av1_get_reference_mode_context(const MACROBLOCKD *xd) {
  146|  2.38M|  int ctx;
  147|  2.38M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  148|  2.38M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  149|  2.38M|  const int has_above = xd->up_available;
  150|  2.38M|  const int has_left = xd->left_available;
  151|       |
  152|       |  // Note:
  153|       |  // The mode info data structure has a one element border above and to the
  154|       |  // left of the entries corresponding to real macroblocks.
  155|       |  // The prediction flags in these dummy entries are initialized to 0.
  156|  2.38M|  if (has_above && has_left) {  // both edges available
  ------------------
  |  Branch (156:7): [True: 1.87M, False: 502k]
  |  Branch (156:20): [True: 1.49M, False: 380k]
  ------------------
  157|  1.49M|    if (!has_second_ref(above_mbmi) && !has_second_ref(left_mbmi))
  ------------------
  |  Branch (157:9): [True: 1.49M, False: 27]
  |  Branch (157:40): [True: 1.49M, False: 33]
  ------------------
  158|       |      // neither edge uses comp pred (0/1)
  159|  1.49M|      ctx = IS_BACKWARD_REF_FRAME(above_mbmi->ref_frame[0]) ^
  ------------------
  |  |  143|  1.49M|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|  1.49M|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 1.49M]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|  1.49M|            IS_BACKWARD_REF_FRAME(left_mbmi->ref_frame[0]);
  ------------------
  |  |  143|  1.49M|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|  1.49M|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 1.49M]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|     61|    else if (!has_second_ref(above_mbmi))
  ------------------
  |  Branch (161:14): [True: 0, False: 61]
  ------------------
  162|       |      // one of two edges uses comp pred (2/3)
  163|      0|      ctx = 2 + (IS_BACKWARD_REF_FRAME(above_mbmi->ref_frame[0]) ||
  ------------------
  |  |  143|      0|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|      0|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|      0|                 !is_inter_block(above_mbmi));
  ------------------
  |  Branch (164:18): [True: 0, False: 0]
  ------------------
  165|     61|    else if (!has_second_ref(left_mbmi))
  ------------------
  |  Branch (165:14): [True: 0, False: 61]
  ------------------
  166|       |      // one of two edges uses comp pred (2/3)
  167|      0|      ctx = 2 + (IS_BACKWARD_REF_FRAME(left_mbmi->ref_frame[0]) ||
  ------------------
  |  |  143|      0|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|      0|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|      0|                 !is_inter_block(left_mbmi));
  ------------------
  |  Branch (168:18): [True: 0, False: 0]
  ------------------
  169|     61|    else  // both edges use comp pred (4)
  170|     61|      ctx = 4;
  171|  1.49M|  } else if (has_above || has_left) {  // one edge available
  ------------------
  |  Branch (171:14): [True: 379k, False: 503k]
  |  Branch (171:27): [True: 382k, False: 120k]
  ------------------
  172|   763k|    const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi;
  ------------------
  |  Branch (172:37): [True: 380k, False: 382k]
  ------------------
  173|       |
  174|   763k|    if (!has_second_ref(edge_mbmi))
  ------------------
  |  Branch (174:9): [True: 763k, False: 18.4E]
  ------------------
  175|       |      // edge does not use comp pred (0/1)
  176|   763k|      ctx = IS_BACKWARD_REF_FRAME(edge_mbmi->ref_frame[0]);
  ------------------
  |  |  143|   763k|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|   763k|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 763k]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  18.4E|    else
  178|       |      // edge uses comp pred (3)
  179|  18.4E|      ctx = 3;
  180|   763k|  } else {  // no edges available (1)
  181|   119k|    ctx = 1;
  182|   119k|  }
  183|       |  assert(ctx >= 0 && ctx < COMP_INTER_CONTEXTS);
  184|  2.38M|  return ctx;
  185|  2.38M|}
av1_get_comp_reference_type_context:
  187|  2.44M|int av1_get_comp_reference_type_context(const MACROBLOCKD *xd) {
  188|  2.44M|  int pred_context;
  189|  2.44M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  190|  2.44M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  191|  2.44M|  const int above_in_image = xd->up_available;
  192|  2.44M|  const int left_in_image = xd->left_available;
  193|       |
  194|  2.44M|  if (above_in_image && left_in_image) {  // both edges available
  ------------------
  |  Branch (194:7): [True: 1.92M, False: 511k]
  |  Branch (194:25): [True: 1.53M, False: 389k]
  ------------------
  195|  1.53M|    const int above_intra = !is_inter_block(above_mbmi);
  196|  1.53M|    const int left_intra = !is_inter_block(left_mbmi);
  197|       |
  198|  1.53M|    if (above_intra && left_intra) {  // intra/intra
  ------------------
  |  Branch (198:9): [True: 1.15M, False: 385k]
  |  Branch (198:24): [True: 1.01M, False: 138k]
  ------------------
  199|  1.01M|      pred_context = 2;
  200|  1.01M|    } else if (above_intra || left_intra) {  // intra/inter
  ------------------
  |  Branch (200:16): [True: 138k, False: 385k]
  |  Branch (200:31): [True: 139k, False: 246k]
  ------------------
  201|   278k|      const MB_MODE_INFO *inter_mbmi = above_intra ? left_mbmi : above_mbmi;
  ------------------
  |  Branch (201:40): [True: 138k, False: 139k]
  ------------------
  202|       |
  203|   278k|      if (!has_second_ref(inter_mbmi))  // single pred
  ------------------
  |  Branch (203:11): [True: 278k, False: 8]
  ------------------
  204|   278k|        pred_context = 2;
  205|      8|      else  // comp pred
  206|      8|        pred_context = 1 + 2 * has_uni_comp_refs(inter_mbmi);
  207|   278k|    } else {  // inter/inter
  208|   245k|      const int a_sg = !has_second_ref(above_mbmi);
  209|   245k|      const int l_sg = !has_second_ref(left_mbmi);
  210|   245k|      const MV_REFERENCE_FRAME frfa = above_mbmi->ref_frame[0];
  211|   245k|      const MV_REFERENCE_FRAME frfl = left_mbmi->ref_frame[0];
  212|       |
  213|   246k|      if (a_sg && l_sg) {  // single/single
  ------------------
  |  Branch (213:11): [True: 246k, False: 18.4E]
  |  Branch (213:19): [True: 246k, False: 18.4E]
  ------------------
  214|   246k|        pred_context = 1 + 2 * (!(IS_BACKWARD_REF_FRAME(frfa) ^
  ------------------
  |  |  143|   246k|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|   246k|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 246k]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|   246k|                                  IS_BACKWARD_REF_FRAME(frfl)));
  ------------------
  |  |  143|   246k|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|   246k|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 246k]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  18.4E|      } else if (l_sg || a_sg) {  // single/comp
  ------------------
  |  Branch (216:18): [True: 18.4E, False: 0]
  |  Branch (216:26): [True: 0, False: 0]
  ------------------
  217|      0|        const int uni_rfc =
  218|      0|            a_sg ? has_uni_comp_refs(left_mbmi) : has_uni_comp_refs(above_mbmi);
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|       |
  220|      0|        if (!uni_rfc)  // comp bidir
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|      0|          pred_context = 1;
  222|      0|        else  // comp unidir
  223|      0|          pred_context = 3 + (!(IS_BACKWARD_REF_FRAME(frfa) ^
  ------------------
  |  |  143|      0|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|      0|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|      0|                                IS_BACKWARD_REF_FRAME(frfl)));
  ------------------
  |  |  143|      0|#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
  |  |  ------------------
  |  |  |  |  142|      0|  (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:37): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  18.4E|      } else {  // comp/comp
  226|  18.4E|        const int a_uni_rfc = has_uni_comp_refs(above_mbmi);
  227|  18.4E|        const int l_uni_rfc = has_uni_comp_refs(left_mbmi);
  228|       |
  229|  18.4E|        if (!a_uni_rfc && !l_uni_rfc)  // bidir/bidir
  ------------------
  |  Branch (229:13): [True: 0, False: 18.4E]
  |  Branch (229:27): [True: 0, False: 0]
  ------------------
  230|      0|          pred_context = 0;
  231|  18.4E|        else if (!a_uni_rfc || !l_uni_rfc)  // unidir/bidir
  ------------------
  |  Branch (231:18): [True: 18.4E, False: 0]
  |  Branch (231:32): [True: 0, False: 0]
  ------------------
  232|      0|          pred_context = 2;
  233|  18.4E|        else  // unidir/unidir
  234|  18.4E|          pred_context =
  235|  18.4E|              3 + (!((frfa == BWDREF_FRAME) ^ (frfl == BWDREF_FRAME)));
  236|  18.4E|      }
  237|   245k|    }
  238|  1.53M|  } else if (above_in_image || left_in_image) {  // one edge available
  ------------------
  |  Branch (238:14): [True: 388k, False: 512k]
  |  Branch (238:32): [True: 387k, False: 125k]
  ------------------
  239|   776k|    const MB_MODE_INFO *edge_mbmi = above_in_image ? above_mbmi : left_mbmi;
  ------------------
  |  Branch (239:37): [True: 389k, False: 386k]
  ------------------
  240|       |
  241|   776k|    if (!is_inter_block(edge_mbmi)) {  // intra
  ------------------
  |  Branch (241:9): [True: 573k, False: 202k]
  ------------------
  242|   573k|      pred_context = 2;
  243|   573k|    } else {                           // inter
  244|   202k|      if (!has_second_ref(edge_mbmi))  // single pred
  ------------------
  |  Branch (244:11): [True: 202k, False: 18.4E]
  ------------------
  245|   202k|        pred_context = 2;
  246|  18.4E|      else  // comp pred
  247|  18.4E|        pred_context = 4 * has_uni_comp_refs(edge_mbmi);
  248|   202k|    }
  249|   776k|  } else {  // no edges available
  250|   124k|    pred_context = 2;
  251|   124k|  }
  252|       |
  253|       |  assert(pred_context >= 0 && pred_context < COMP_REF_TYPE_CONTEXTS);
  254|  2.44M|  return pred_context;
  255|  2.44M|}
av1_get_pred_context_uni_comp_ref_p:
  265|  1.91M|int av1_get_pred_context_uni_comp_ref_p(const MACROBLOCKD *xd) {
  266|  1.91M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  267|       |
  268|       |  // Count of forward references (L, L2, L3, or G)
  269|  1.91M|  const int frf_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME] +
  270|  1.91M|                        ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
  271|       |  // Count of backward references (B or A)
  272|  1.91M|  const int brf_count = ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME] +
  273|  1.91M|                        ref_counts[ALTREF_FRAME];
  274|       |
  275|  1.91M|  const int pred_context =
  276|  1.91M|      (frf_count == brf_count) ? 1 : ((frf_count < brf_count) ? 0 : 2);
  ------------------
  |  Branch (276:7): [True: 1.59M, False: 327k]
  |  Branch (276:39): [True: 0, False: 327k]
  ------------------
  277|       |
  278|       |  assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
  279|  1.91M|  return pred_context;
  280|  1.91M|}
av1_get_pred_context_uni_comp_ref_p1:
  290|  1.91M|int av1_get_pred_context_uni_comp_ref_p1(const MACROBLOCKD *xd) {
  291|  1.91M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  292|       |
  293|       |  // Count of LAST2
  294|  1.91M|  const int last2_count = ref_counts[LAST2_FRAME];
  295|       |  // Count of LAST3 or GOLDEN
  296|  1.91M|  const int last3_or_gld_count =
  297|  1.91M|      ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
  298|       |
  299|  1.91M|  const int pred_context = (last2_count == last3_or_gld_count)
  ------------------
  |  Branch (299:28): [True: 1.91M, False: 18.4E]
  ------------------
  300|  1.91M|                               ? 1
  301|  18.4E|                               : ((last2_count < last3_or_gld_count) ? 0 : 2);
  ------------------
  |  Branch (301:35): [True: 0, False: 18.4E]
  ------------------
  302|       |
  303|       |  assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
  304|  1.91M|  return pred_context;
  305|  1.91M|}
av1_get_pred_context_uni_comp_ref_p2:
  315|  1.91M|int av1_get_pred_context_uni_comp_ref_p2(const MACROBLOCKD *xd) {
  316|  1.91M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  317|       |
  318|       |  // Count of LAST3
  319|  1.91M|  const int last3_count = ref_counts[LAST3_FRAME];
  320|       |  // Count of GOLDEN
  321|  1.91M|  const int gld_count = ref_counts[GOLDEN_FRAME];
  322|       |
  323|  1.91M|  const int pred_context =
  324|  18.4E|      (last3_count == gld_count) ? 1 : ((last3_count < gld_count) ? 0 : 2);
  ------------------
  |  Branch (324:7): [True: 1.91M, False: 18.4E]
  |  Branch (324:41): [True: 0, False: 18.4E]
  ------------------
  325|       |
  326|       |  assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
  327|  1.91M|  return pred_context;
  328|  1.91M|}
av1_get_pred_context_comp_ref_p:
  421|  1.91M|int av1_get_pred_context_comp_ref_p(const MACROBLOCKD *xd) {
  422|  1.91M|  return get_pred_context_ll2_or_l3gld(xd);
  423|  1.91M|}
av1_get_pred_context_comp_ref_p1:
  428|  1.91M|int av1_get_pred_context_comp_ref_p1(const MACROBLOCKD *xd) {
  429|  1.91M|  return get_pred_context_last_or_last2(xd);
  430|  1.91M|}
av1_get_pred_context_comp_ref_p2:
  435|  1.91M|int av1_get_pred_context_comp_ref_p2(const MACROBLOCKD *xd) {
  436|  1.91M|  return get_pred_context_last3_or_gld(xd);
  437|  1.91M|}
av1_get_pred_context_comp_bwdref_p:
  441|  1.91M|int av1_get_pred_context_comp_bwdref_p(const MACROBLOCKD *xd) {
  442|  1.91M|  return get_pred_context_brfarf2_or_arf(xd);
  443|  1.91M|}
av1_get_pred_context_comp_bwdref_p1:
  447|  1.91M|int av1_get_pred_context_comp_bwdref_p1(const MACROBLOCKD *xd) {
  448|  1.91M|  return get_pred_context_brf_or_arf2(xd);
  449|  1.91M|}
av1_get_pred_context_single_ref_p1:
  455|  3.12M|int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
  456|  3.12M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  457|       |
  458|       |  // Count of forward reference frames
  459|  3.12M|  const int fwd_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME] +
  460|  3.12M|                        ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
  461|       |  // Count of backward reference frames
  462|  3.12M|  const int bwd_count = ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME] +
  463|  3.12M|                        ref_counts[ALTREF_FRAME];
  464|       |
  465|  3.12M|  const int pred_context =
  466|  3.12M|      (fwd_count == bwd_count) ? 1 : ((fwd_count < bwd_count) ? 0 : 2);
  ------------------
  |  Branch (466:7): [True: 1.93M, False: 1.19M]
  |  Branch (466:39): [True: 0, False: 1.19M]
  ------------------
  467|       |
  468|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  469|  3.12M|  return pred_context;
  470|  3.12M|}
av1_get_pred_context_single_ref_p2:
  475|  1.91M|int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
  476|  1.91M|  return get_pred_context_brfarf2_or_arf(xd);
  477|  1.91M|}
av1_get_pred_context_single_ref_p3:
  481|  3.12M|int av1_get_pred_context_single_ref_p3(const MACROBLOCKD *xd) {
  482|  3.12M|  return get_pred_context_ll2_or_l3gld(xd);
  483|  3.12M|}
av1_get_pred_context_single_ref_p4:
  487|  3.12M|int av1_get_pred_context_single_ref_p4(const MACROBLOCKD *xd) {
  488|  3.12M|  return get_pred_context_last_or_last2(xd);
  489|  3.12M|}
av1_get_pred_context_single_ref_p5:
  493|  1.91M|int av1_get_pred_context_single_ref_p5(const MACROBLOCKD *xd) {
  494|  1.91M|  return get_pred_context_last3_or_gld(xd);
  495|  1.91M|}
av1_get_pred_context_single_ref_p6:
  499|  1.91M|int av1_get_pred_context_single_ref_p6(const MACROBLOCKD *xd) {
  500|  1.91M|  return get_pred_context_brf_or_arf2(xd);
  501|  1.91M|}
pred_common.c:get_ref_filter_type:
   21|  21.1M|                                        MV_REFERENCE_FRAME ref_frame) {
   22|  21.1M|  (void)xd;
   23|       |
   24|  21.1M|  return ((ref_mbmi->ref_frame[0] == ref_frame ||
  ------------------
  |  Branch (24:12): [True: 7.01M, False: 14.1M]
  ------------------
   25|  14.1M|           ref_mbmi->ref_frame[1] == ref_frame)
  ------------------
  |  Branch (25:12): [True: 18.4E, False: 14.1M]
  ------------------
   26|  21.1M|              ? av1_extract_interp_filter(ref_mbmi->interp_filters, dir & 0x01)
   27|  21.1M|              : SWITCHABLE_FILTERS);
   28|  21.1M|}
pred_common.c:palette_add_to_cache:
   66|  3.25M|static void palette_add_to_cache(uint16_t *cache, int *n, uint16_t val) {
   67|       |  // Do not add an already existing value
   68|  3.25M|  if (*n > 0 && val == cache[*n - 1]) return;
  ------------------
  |  Branch (68:7): [True: 2.70M, False: 549k]
  |  Branch (68:17): [True: 150k, False: 2.55M]
  ------------------
   69|       |
   70|  3.10M|  cache[(*n)++] = val;
   71|  3.10M|}
pred_common.c:get_pred_context_ll2_or_l3gld:
  334|  5.04M|static int get_pred_context_ll2_or_l3gld(const MACROBLOCKD *xd) {
  335|  5.04M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  336|       |
  337|       |  // Count of LAST + LAST2
  338|  5.04M|  const int last_last2_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME];
  339|       |  // Count of LAST3 + GOLDEN
  340|  5.04M|  const int last3_gld_count =
  341|  5.04M|      ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
  342|       |
  343|  5.04M|  const int pred_context = (last_last2_count == last3_gld_count)
  ------------------
  |  Branch (343:28): [True: 3.52M, False: 1.52M]
  ------------------
  344|  5.04M|                               ? 1
  345|  5.04M|                               : ((last_last2_count < last3_gld_count) ? 0 : 2);
  ------------------
  |  Branch (345:35): [True: 0, False: 1.52M]
  ------------------
  346|       |
  347|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  348|  5.04M|  return pred_context;
  349|  5.04M|}
pred_common.c:get_pred_context_last_or_last2:
  352|  5.04M|static int get_pred_context_last_or_last2(const MACROBLOCKD *xd) {
  353|  5.04M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  354|       |
  355|       |  // Count of LAST
  356|  5.04M|  const int last_count = ref_counts[LAST_FRAME];
  357|       |  // Count of LAST2
  358|  5.04M|  const int last2_count = ref_counts[LAST2_FRAME];
  359|       |
  360|  5.04M|  const int pred_context =
  361|  5.04M|      (last_count == last2_count) ? 1 : ((last_count < last2_count) ? 0 : 2);
  ------------------
  |  Branch (361:7): [True: 3.52M, False: 1.52M]
  |  Branch (361:42): [True: 0, False: 1.52M]
  ------------------
  362|       |
  363|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  364|  5.04M|  return pred_context;
  365|  5.04M|}
pred_common.c:get_pred_context_last3_or_gld:
  368|  3.83M|static int get_pred_context_last3_or_gld(const MACROBLOCKD *xd) {
  369|  3.83M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  370|       |
  371|       |  // Count of LAST3
  372|  3.83M|  const int last3_count = ref_counts[LAST3_FRAME];
  373|       |  // Count of GOLDEN
  374|  3.83M|  const int gld_count = ref_counts[GOLDEN_FRAME];
  375|       |
  376|  3.83M|  const int pred_context =
  377|  18.4E|      (last3_count == gld_count) ? 1 : ((last3_count < gld_count) ? 0 : 2);
  ------------------
  |  Branch (377:7): [True: 3.83M, False: 18.4E]
  |  Branch (377:41): [True: 0, False: 18.4E]
  ------------------
  378|       |
  379|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  380|  3.83M|  return pred_context;
  381|  3.83M|}
pred_common.c:get_pred_context_brfarf2_or_arf:
  385|  3.83M|static int get_pred_context_brfarf2_or_arf(const MACROBLOCKD *xd) {
  386|  3.83M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  387|       |
  388|       |  // Counts of BWDREF, ALTREF2, or ALTREF frames (B, A2, or A)
  389|  3.83M|  const int brfarf2_count =
  390|  3.83M|      ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME];
  391|  3.83M|  const int arf_count = ref_counts[ALTREF_FRAME];
  392|       |
  393|  3.83M|  const int pred_context =
  394|  18.4E|      (brfarf2_count == arf_count) ? 1 : ((brfarf2_count < arf_count) ? 0 : 2);
  ------------------
  |  Branch (394:7): [True: 3.83M, False: 18.4E]
  |  Branch (394:43): [True: 0, False: 18.4E]
  ------------------
  395|       |
  396|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  397|  3.83M|  return pred_context;
  398|  3.83M|}
pred_common.c:get_pred_context_brf_or_arf2:
  401|  3.83M|static int get_pred_context_brf_or_arf2(const MACROBLOCKD *xd) {
  402|  3.83M|  const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
  403|       |
  404|       |  // Count of BWDREF frames (B)
  405|  3.83M|  const int brf_count = ref_counts[BWDREF_FRAME];
  406|       |  // Count of ALTREF2 frames (A2)
  407|  3.83M|  const int arf2_count = ref_counts[ALTREF2_FRAME];
  408|       |
  409|  3.83M|  const int pred_context =
  410|  18.4E|      (brf_count == arf2_count) ? 1 : ((brf_count < arf2_count) ? 0 : 2);
  ------------------
  |  Branch (410:7): [True: 3.83M, False: 18.4E]
  |  Branch (410:40): [True: 0, False: 18.4E]
  ------------------
  411|       |
  412|       |  assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
  413|  3.83M|  return pred_context;
  414|  3.83M|}

decodeframe.c:get_tx_size_context:
  342|   504k|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|   504k|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|   504k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|   504k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|   504k|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|   504k|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|   504k|  const int max_tx_high = tx_size_high[max_tx_size];
  349|   504k|  const int has_above = xd->up_available;
  350|   504k|  const int has_left = xd->left_available;
  351|       |
  352|   504k|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|   504k|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|   504k|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 404k, False: 99.2k]
  ------------------
  356|   404k|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 37.8k, False: 367k]
  ------------------
  357|  37.8k|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|   504k|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 406k, False: 97.5k]
  ------------------
  360|   406k|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 38.1k, False: 368k]
  ------------------
  361|  38.1k|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|   504k|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 403k, False: 100k]
  |  Branch (363:20): [True: 330k, False: 73.5k]
  ------------------
  364|   330k|    return (above + left);
  365|   173k|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 74.4k, False: 99.4k]
  ------------------
  366|  74.4k|    return above;
  367|  99.4k|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 76.5k, False: 22.9k]
  ------------------
  368|  76.5k|    return left;
  369|  22.9k|  else
  370|  22.9k|    return 0;
  371|   504k|}
decodemv.c:av1_get_skip_txfm_context:
  175|   779k|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|   779k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|   779k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|   779k|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 611k, False: 168k]
  ------------------
  179|   779k|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 614k, False: 165k]
  ------------------
  180|   779k|  return above_skip_txfm + left_skip_txfm;
  181|   779k|}
decodemv.c:av1_get_palette_bsize_ctx:
  192|  23.0k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|  23.0k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|  23.0k|}
decodemv.c:av1_get_palette_mode_ctx:
  197|  22.1k|static inline int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) {
  198|  22.1k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  199|  22.1k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  200|  22.1k|  int ctx = 0;
  201|  22.1k|  if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (201:7): [True: 14.3k, False: 7.80k]
  ------------------
  202|  22.1k|  if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (202:7): [True: 13.7k, False: 8.47k]
  ------------------
  203|  22.1k|  return ctx;
  204|  22.1k|}
decodemv.c:av1_get_pred_cdf_single_ref_p1:
  308|   191k|    const MACROBLOCKD *xd) {
  309|   191k|  return xd->tile_ctx
  310|   191k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0];
  311|   191k|}
decodemv.c:av1_get_pred_cdf_single_ref_p3:
  318|   191k|    const MACROBLOCKD *xd) {
  319|   191k|  return xd->tile_ctx
  320|   191k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2];
  321|   191k|}
decodemv.c:av1_get_pred_cdf_single_ref_p4:
  323|   190k|    const MACROBLOCKD *xd) {
  324|   190k|  return xd->tile_ctx
  325|   190k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3];
  326|   190k|}
bitstream.c:av1_get_skip_txfm_context:
  175|  2.03M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  2.03M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  2.03M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  2.03M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 1.59M, False: 437k]
  ------------------
  179|  2.03M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 1.60M, False: 431k]
  ------------------
  180|  2.03M|  return above_skip_txfm + left_skip_txfm;
  181|  2.03M|}
bitstream.c:av1_get_palette_bsize_ctx:
  192|  61.4k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|  61.4k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|  61.4k|}
bitstream.c:av1_get_palette_mode_ctx:
  197|  59.1k|static inline int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) {
  198|  59.1k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  199|  59.1k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  200|  59.1k|  int ctx = 0;
  201|  59.1k|  if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (201:7): [True: 38.1k, False: 20.9k]
  ------------------
  202|  59.1k|  if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (202:7): [True: 37.0k, False: 22.0k]
  ------------------
  203|  59.1k|  return ctx;
  204|  59.1k|}
bitstream.c:av1_get_pred_cdf_single_ref_p1:
  308|   508k|    const MACROBLOCKD *xd) {
  309|   508k|  return xd->tile_ctx
  310|   508k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0];
  311|   508k|}
bitstream.c:av1_get_pred_cdf_single_ref_p3:
  318|   509k|    const MACROBLOCKD *xd) {
  319|   509k|  return xd->tile_ctx
  320|   509k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2];
  321|   509k|}
bitstream.c:av1_get_pred_cdf_single_ref_p4:
  323|   509k|    const MACROBLOCKD *xd) {
  324|   509k|  return xd->tile_ctx
  325|   509k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3];
  326|   509k|}
bitstream.c:get_tx_size_context:
  342|  1.30M|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|  1.30M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|  1.30M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|  1.30M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|  1.30M|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|  1.30M|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|  1.30M|  const int max_tx_high = tx_size_high[max_tx_size];
  349|  1.30M|  const int has_above = xd->up_available;
  350|  1.30M|  const int has_left = xd->left_available;
  351|       |
  352|  1.30M|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|  1.30M|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|  1.30M|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 1.04M, False: 259k]
  ------------------
  356|  1.04M|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 103k, False: 946k]
  ------------------
  357|   103k|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|  1.30M|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 1.05M, False: 255k]
  ------------------
  360|  1.05M|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 103k, False: 948k]
  ------------------
  361|   103k|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|  1.30M|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 1.04M, False: 261k]
  |  Branch (363:20): [True: 854k, False: 192k]
  ------------------
  364|   854k|    return (above + left);
  365|   453k|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 194k, False: 259k]
  ------------------
  366|   194k|    return above;
  367|   259k|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 199k, False: 60.4k]
  ------------------
  368|   199k|    return left;
  369|  60.4k|  else
  370|  60.4k|    return 0;
  371|  1.30M|}
encodeframe_utils.c:av1_get_palette_bsize_ctx:
  192|  61.6k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|  61.6k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|  61.6k|}
encodeframe_utils.c:av1_get_palette_mode_ctx:
  197|  59.2k|static inline int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) {
  198|  59.2k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  199|  59.2k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  200|  59.2k|  int ctx = 0;
  201|  59.2k|  if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (201:7): [True: 38.2k, False: 21.0k]
  ------------------
  202|  59.2k|  if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (202:7): [True: 37.1k, False: 22.0k]
  ------------------
  203|  59.2k|  return ctx;
  204|  59.2k|}
palette.c:av1_get_palette_bsize_ctx:
  192|   831k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|   831k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|   831k|}
palette.c:av1_get_palette_mode_ctx:
  197|   493k|static inline int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) {
  198|   493k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  199|   493k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  200|   493k|  int ctx = 0;
  201|   493k|  if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (201:7): [True: 300k, False: 193k]
  ------------------
  202|   493k|  if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (202:7): [True: 292k, False: 200k]
  ------------------
  203|   493k|  return ctx;
  204|   493k|}
palette.c:get_tx_size_context:
  342|   436k|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|   436k|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|   436k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|   436k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|   436k|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|   436k|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|   436k|  const int max_tx_high = tx_size_high[max_tx_size];
  349|   436k|  const int has_above = xd->up_available;
  350|   436k|  const int has_left = xd->left_available;
  351|       |
  352|   436k|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|   436k|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|   436k|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 279k, False: 157k]
  ------------------
  356|   279k|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 12.1k, False: 266k]
  ------------------
  357|  12.1k|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|   436k|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 269k, False: 167k]
  ------------------
  360|   269k|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 11.5k, False: 257k]
  ------------------
  361|  11.5k|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|   436k|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 279k, False: 157k]
  |  Branch (363:20): [True: 160k, False: 118k]
  ------------------
  364|   160k|    return (above + left);
  365|   276k|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 118k, False: 157k]
  ------------------
  366|   118k|    return above;
  367|   157k|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 108k, False: 49.4k]
  ------------------
  368|   108k|    return left;
  369|  49.4k|  else
  370|  49.4k|    return 0;
  371|   436k|}
partition_search.c:get_tx_size_context:
  342|  1.45M|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|  1.45M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|  1.45M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|  1.45M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|  1.45M|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|  1.45M|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|  1.45M|  const int max_tx_high = tx_size_high[max_tx_size];
  349|  1.45M|  const int has_above = xd->up_available;
  350|  1.45M|  const int has_left = xd->left_available;
  351|       |
  352|  1.45M|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|  1.45M|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|  1.45M|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 1.14M, False: 310k]
  ------------------
  356|  1.14M|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 126k, False: 1.02M]
  ------------------
  357|   126k|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|  1.45M|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 1.15M, False: 306k]
  ------------------
  360|  1.15M|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 127k, False: 1.02M]
  ------------------
  361|   127k|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|  1.45M|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 1.14M, False: 310k]
  |  Branch (363:20): [True: 926k, False: 222k]
  ------------------
  364|   926k|    return (above + left);
  365|   533k|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 222k, False: 310k]
  ------------------
  366|   222k|    return above;
  367|   310k|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 227k, False: 83.6k]
  ------------------
  368|   227k|    return left;
  369|  83.6k|  else
  370|  83.6k|    return 0;
  371|  1.45M|}
partition_search.c:av1_get_skip_txfm_context:
  175|  2.04M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  2.04M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  2.04M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  2.04M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 1.60M, False: 440k]
  ------------------
  179|  2.04M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 1.60M, False: 434k]
  ------------------
  180|  2.04M|  return above_skip_txfm + left_skip_txfm;
  181|  2.04M|}
partition_search.c:av1_get_reference_mode_cdf:
  210|   463k|static inline aom_cdf_prob *av1_get_reference_mode_cdf(const MACROBLOCKD *xd) {
  211|   463k|  return xd->tile_ctx->comp_inter_cdf[av1_get_reference_mode_context(xd)];
  212|   463k|}
partition_search.c:av1_get_pred_cdf_single_ref_p1:
  308|   510k|    const MACROBLOCKD *xd) {
  309|   510k|  return xd->tile_ctx
  310|   510k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0];
  311|   510k|}
partition_search.c:av1_get_pred_cdf_single_ref_p3:
  318|   510k|    const MACROBLOCKD *xd) {
  319|   510k|  return xd->tile_ctx
  320|   510k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2];
  321|   510k|}
partition_search.c:av1_get_pred_cdf_single_ref_p4:
  323|   510k|    const MACROBLOCKD *xd) {
  324|   510k|  return xd->tile_ctx
  325|   510k|      ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3];
  326|   510k|}
rdopt.c:av1_get_skip_txfm_context:
  175|  11.4M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  11.4M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  11.4M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  11.4M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 8.90M, False: 2.58M]
  ------------------
  179|  11.4M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 8.95M, False: 2.54M]
  ------------------
  180|  11.4M|  return above_skip_txfm + left_skip_txfm;
  181|  11.4M|}
rdopt.c:av1_get_palette_bsize_ctx:
  192|  30.0k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|  30.0k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|  30.0k|}
nonrd_pickmode.c:av1_get_skip_txfm_context:
  175|  1.93M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  1.93M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  1.93M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  1.93M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 1.57M, False: 357k]
  ------------------
  179|  1.93M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 1.55M, False: 384k]
  ------------------
  180|  1.93M|  return above_skip_txfm + left_skip_txfm;
  181|  1.93M|}
tx_search.c:av1_get_skip_txfm_context:
  175|  31.0M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  31.0M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  31.0M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  31.0M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 23.3M, False: 7.69M]
  ------------------
  179|  31.0M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 23.3M, False: 7.66M]
  ------------------
  180|  31.0M|  return above_skip_txfm + left_skip_txfm;
  181|  31.0M|}
tx_search.c:get_tx_size_context:
  342|  4.10M|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|  4.10M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|  4.10M|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|  4.10M|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|  4.10M|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|  4.10M|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|  4.10M|  const int max_tx_high = tx_size_high[max_tx_size];
  349|  4.10M|  const int has_above = xd->up_available;
  350|  4.10M|  const int has_left = xd->left_available;
  351|       |
  352|  4.10M|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|  4.10M|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|  4.10M|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 3.02M, False: 1.07M]
  ------------------
  356|  3.02M|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 155k, False: 2.86M]
  ------------------
  357|   155k|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|  4.10M|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 3.00M, False: 1.09M]
  ------------------
  360|  3.00M|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 155k, False: 2.84M]
  ------------------
  361|   155k|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|  4.10M|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 3.02M, False: 1.07M]
  |  Branch (363:20): [True: 2.24M, False: 779k]
  ------------------
  364|  2.24M|    return (above + left);
  365|  1.85M|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 780k, False: 1.07M]
  ------------------
  366|   780k|    return above;
  367|  1.07M|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 761k, False: 315k]
  ------------------
  368|   761k|    return left;
  369|   315k|  else
  370|   315k|    return 0;
  371|  4.10M|}
intra_mode_search.c:av1_get_palette_bsize_ctx:
  192|   677k|static inline int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) {
  193|       |  assert(bsize < BLOCK_SIZES_ALL);
  194|   677k|  return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8];
  195|   677k|}
intra_mode_search.c:av1_get_skip_txfm_context:
  175|  87.4M|static inline int av1_get_skip_txfm_context(const MACROBLOCKD *xd) {
  176|  87.4M|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  177|  87.4M|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  178|  87.4M|  const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0;
  ------------------
  |  Branch (178:31): [True: 69.9M, False: 17.5M]
  ------------------
  179|  87.4M|  const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0;
  ------------------
  |  Branch (179:30): [True: 70.0M, False: 17.4M]
  ------------------
  180|  87.4M|  return above_skip_txfm + left_skip_txfm;
  181|  87.4M|}
intra_mode_search.c:av1_get_palette_mode_ctx:
  197|   677k|static inline int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) {
  198|   677k|  const MB_MODE_INFO *const above_mi = xd->above_mbmi;
  199|   677k|  const MB_MODE_INFO *const left_mi = xd->left_mbmi;
  200|   677k|  int ctx = 0;
  201|   677k|  if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (201:7): [True: 393k, False: 283k]
  ------------------
  202|   677k|  if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0);
  ------------------
  |  Branch (202:7): [True: 399k, False: 277k]
  ------------------
  203|   677k|  return ctx;
  204|   677k|}
intra_mode_search.c:get_tx_size_context:
  342|   336k|static inline int get_tx_size_context(const MACROBLOCKD *xd) {
  343|   336k|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|   336k|  const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
  345|   336k|  const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
  346|   336k|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize];
  347|   336k|  const int max_tx_wide = tx_size_wide[max_tx_size];
  348|   336k|  const int max_tx_high = tx_size_high[max_tx_size];
  349|   336k|  const int has_above = xd->up_available;
  350|   336k|  const int has_left = xd->left_available;
  351|       |
  352|   336k|  int above = xd->above_txfm_context[0] >= max_tx_wide;
  353|   336k|  int left = xd->left_txfm_context[0] >= max_tx_high;
  354|       |
  355|   336k|  if (has_above)
  ------------------
  |  Branch (355:7): [True: 217k, False: 119k]
  ------------------
  356|   217k|    if (is_inter_block(above_mbmi))
  ------------------
  |  Branch (356:9): [True: 0, False: 217k]
  ------------------
  357|      0|      above = block_size_wide[above_mbmi->bsize] >= max_tx_wide;
  358|       |
  359|   336k|  if (has_left)
  ------------------
  |  Branch (359:7): [True: 218k, False: 118k]
  ------------------
  360|   218k|    if (is_inter_block(left_mbmi))
  ------------------
  |  Branch (360:9): [True: 0, False: 218k]
  ------------------
  361|      0|      left = block_size_high[left_mbmi->bsize] >= max_tx_high;
  362|       |
  363|   336k|  if (has_above && has_left)
  ------------------
  |  Branch (363:7): [True: 217k, False: 119k]
  |  Branch (363:20): [True: 145k, False: 71.6k]
  ------------------
  364|   145k|    return (above + left);
  365|   190k|  else if (has_above)
  ------------------
  |  Branch (365:12): [True: 71.6k, False: 119k]
  ------------------
  366|  71.6k|    return above;
  367|   119k|  else if (has_left)
  ------------------
  |  Branch (367:12): [True: 72.2k, False: 47.0k]
  ------------------
  368|  72.2k|    return left;
  369|  47.0k|  else
  370|  47.0k|    return 0;
  371|   336k|}

av1_dc_quant_QTX:
  198|  49.0M|int16_t av1_dc_quant_QTX(int qindex, int delta, aom_bit_depth_t bit_depth) {
  199|  49.0M|  const int q_clamped = clamp(qindex + delta, 0, MAXQ);
  ------------------
  |  |   26|  49.0M|#define MAXQ 255
  ------------------
  200|  49.0M|  switch (bit_depth) {
  201|  35.5M|    case AOM_BITS_8: return dc_qlookup_QTX[q_clamped];
  ------------------
  |  Branch (201:5): [True: 35.5M, False: 13.4M]
  ------------------
  202|  6.51M|    case AOM_BITS_10: return dc_qlookup_10_QTX[q_clamped];
  ------------------
  |  Branch (202:5): [True: 6.51M, False: 42.4M]
  ------------------
  203|  6.97M|    case AOM_BITS_12: return dc_qlookup_12_QTX[q_clamped];
  ------------------
  |  Branch (203:5): [True: 6.97M, False: 42.0M]
  ------------------
  204|      0|    default:
  ------------------
  |  Branch (204:5): [True: 0, False: 49.0M]
  ------------------
  205|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  206|      0|      return -1;
  207|  49.0M|  }
  208|  49.0M|}
av1_ac_quant_QTX:
  210|  40.8M|int16_t av1_ac_quant_QTX(int qindex, int delta, aom_bit_depth_t bit_depth) {
  211|  40.8M|  const int q_clamped = clamp(qindex + delta, 0, MAXQ);
  ------------------
  |  |   26|  40.8M|#define MAXQ 255
  ------------------
  212|  40.8M|  switch (bit_depth) {
  213|  30.4M|    case AOM_BITS_8: return ac_qlookup_QTX[q_clamped];
  ------------------
  |  Branch (213:5): [True: 30.4M, False: 10.4M]
  ------------------
  214|  5.00M|    case AOM_BITS_10: return ac_qlookup_10_QTX[q_clamped];
  ------------------
  |  Branch (214:5): [True: 5.00M, False: 35.8M]
  ------------------
  215|  5.39M|    case AOM_BITS_12: return ac_qlookup_12_QTX[q_clamped];
  ------------------
  |  Branch (215:5): [True: 5.39M, False: 35.4M]
  ------------------
  216|      0|    default:
  ------------------
  |  Branch (216:5): [True: 0, False: 40.8M]
  ------------------
  217|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  218|      0|      return -1;
  219|  40.8M|  }
  220|  40.8M|}
av1_get_qindex:
  223|  1.93M|                   int base_qindex) {
  224|  1.93M|  if (segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) {
  ------------------
  |  Branch (224:7): [True: 0, False: 1.93M]
  ------------------
  225|      0|    const int data = get_segdata(seg, segment_id, SEG_LVL_ALT_Q);
  226|      0|    const int seg_qindex = base_qindex + data;
  227|      0|    return clamp(seg_qindex, 0, MAXQ);
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
  228|  1.93M|  } else {
  229|  1.93M|    return base_qindex;
  230|  1.93M|  }
  231|  1.93M|}
av1_use_qmatrix:
  234|   115M|                     const struct macroblockd *xd, int segment_id) {
  235|       |  // True if explicit Q matrix levels and this is not a lossless segment.
  236|   115M|  return quant_params->using_qmatrix && !xd->lossless[segment_id];
  ------------------
  |  Branch (236:10): [True: 95.2M, False: 20.4M]
  |  Branch (236:41): [True: 95.2M, False: 33.7k]
  ------------------
  237|   115M|}
av1_get_iqmatrix:
  245|   165M|                                 TX_SIZE tx_size, TX_TYPE tx_type) {
  246|   165M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  247|   165M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  248|   165M|  const int seg_id = mbmi->segment_id;
  249|   165M|  const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size);
  250|       |  // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms
  251|   165M|  return is_2d_transform(tx_type)
  ------------------
  |  Branch (251:10): [True: 143M, False: 22.1M]
  ------------------
  252|   165M|             ? pd->seg_iqmatrix[seg_id][qm_tx_size]
  253|   165M|             : quant_params->giqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size];
  ------------------
  |  |   31|  22.1M|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  22.1M|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  254|   165M|}
av1_get_qmatrix:
  258|   152M|                                TX_SIZE tx_size, TX_TYPE tx_type) {
  259|   152M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  260|   152M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  261|   152M|  const int seg_id = mbmi->segment_id;
  262|   152M|  const TX_SIZE qm_tx_size = av1_get_adjusted_tx_size(tx_size);
  263|       |  // Use a flat matrix (i.e. no weighting) for 1D and Identity transforms
  264|   152M|  return is_2d_transform(tx_type)
  ------------------
  |  Branch (264:10): [True: 132M, False: 19.4M]
  ------------------
  265|   152M|             ? pd->seg_qmatrix[seg_id][qm_tx_size]
  266|   152M|             : quant_params->gqmatrix[NUM_QM_LEVELS - 1][0][qm_tx_size];
  ------------------
  |  |   31|  19.4M|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  19.4M|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  267|   152M|}
av1_qm_init:
  277|  25.4k|void av1_qm_init(CommonQuantParams *quant_params, int num_planes) {
  278|  25.4k|#if CONFIG_QUANT_MATRIX || CONFIG_AV1_DECODER
  279|   432k|  for (int q = 0; q < NUM_QM_LEVELS; ++q) {
  ------------------
  |  |   31|   432k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   432k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (279:19): [True: 406k, False: 25.4k]
  ------------------
  280|  1.26M|    for (int c = 0; c < num_planes; ++c) {
  ------------------
  |  Branch (280:21): [True: 855k, False: 406k]
  ------------------
  281|   855k|      int current = 0;
  282|  17.1M|      for (int t = 0; t < TX_SIZES_ALL; ++t) {
  ------------------
  |  Branch (282:23): [True: 16.2M, False: 855k]
  ------------------
  283|  16.2M|        const int size = tx_size_2d[t];
  284|  16.2M|        const int qm_tx_size = av1_get_adjusted_tx_size(t);
  285|  16.2M|        if (q == NUM_QM_LEVELS - 1) {
  ------------------
  |  |   31|  16.2M|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  16.2M|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (285:13): [True: 1.01M, False: 15.2M]
  ------------------
  286|  1.01M|          quant_params->gqmatrix[q][c][t] = NULL;
  287|  1.01M|          quant_params->giqmatrix[q][c][t] = NULL;
  288|  15.2M|        } else if (t != qm_tx_size) {  // Reuse matrices for 'qm_tx_size'
  ------------------
  |  Branch (288:20): [True: 4.00M, False: 11.2M]
  ------------------
  289|  4.00M|          assert(t > qm_tx_size);
  290|  4.00M|          quant_params->gqmatrix[q][c][t] =
  291|  4.00M|              quant_params->gqmatrix[q][c][qm_tx_size];
  292|  4.00M|          quant_params->giqmatrix[q][c][t] =
  293|  4.00M|              quant_params->giqmatrix[q][c][qm_tx_size];
  294|  11.2M|        } else {
  295|  11.2M|          assert(current + size <= QM_TOTAL_SIZE);
  296|  11.2M|          quant_params->gqmatrix[q][c][t] = &wt_matrix_ref[q][c >= 1][current];
  297|  11.2M|          quant_params->giqmatrix[q][c][t] =
  298|  11.2M|              &iwt_matrix_ref[q][c >= 1][current];
  299|  11.2M|          current += size;
  300|  11.2M|        }
  301|  16.2M|      }
  302|   855k|    }
  303|   406k|  }
  304|       |#else
  305|       |  (void)quant_params;
  306|       |  (void)num_planes;
  307|       |#endif  // CONFIG_QUANT_MATRIX || CONFIG_AV1_DECODER
  308|  25.4k|}
quant_common.c:is_2d_transform:
  241|   316M|static inline bool is_2d_transform(TX_TYPE tx_type) { return (tx_type < IDTX); }

av1_quantize.c:aom_get_qmlevel_allintra:
   77|  98.8k|static inline int aom_get_qmlevel_allintra(int qindex, int first, int last) {
   78|  98.8k|  int qm_level = 0;
   79|       |
   80|  98.8k|  if (qindex <= 40) {
  ------------------
  |  Branch (80:7): [True: 17.0k, False: 81.8k]
  ------------------
   81|  17.0k|    qm_level = 10;
   82|  81.8k|  } else if (qindex <= 100) {
  ------------------
  |  Branch (82:14): [True: 13.9k, False: 67.9k]
  ------------------
   83|  13.9k|    qm_level = 9;
   84|  67.9k|  } else if (qindex <= 160) {
  ------------------
  |  Branch (84:14): [True: 15.6k, False: 52.2k]
  ------------------
   85|  15.6k|    qm_level = 8;
   86|  52.2k|  } else if (qindex <= 200) {
  ------------------
  |  Branch (86:14): [True: 15.2k, False: 36.9k]
  ------------------
   87|  15.2k|    qm_level = 7;
   88|  36.9k|  } else if (qindex <= 220) {
  ------------------
  |  Branch (88:14): [True: 11.3k, False: 25.5k]
  ------------------
   89|  11.3k|    qm_level = 6;
   90|  25.5k|  } else if (qindex <= 240) {
  ------------------
  |  Branch (90:14): [True: 16.4k, False: 9.11k]
  ------------------
   91|  16.4k|    qm_level = 5;
   92|  16.4k|  } else {
   93|  9.11k|    qm_level = 4;
   94|  9.11k|  }
   95|       |
   96|  98.8k|  return clamp(qm_level, first, last);
   97|  98.8k|}
av1_quantize.c:aom_get_qmlevel_444_chroma:
  150|  5.88k|static inline int aom_get_qmlevel_444_chroma(int qindex, int first, int last) {
  151|  5.88k|  int chroma_qm_level = 0;
  152|       |
  153|  5.88k|  if (qindex <= 12) {
  ------------------
  |  Branch (153:7): [True: 146, False: 5.73k]
  ------------------
  154|    146|    chroma_qm_level = 10;
  155|  5.73k|  } else if (qindex <= 24) {
  ------------------
  |  Branch (155:14): [True: 161, False: 5.57k]
  ------------------
  156|    161|    chroma_qm_level = 9;
  157|  5.57k|  } else if (qindex <= 32) {
  ------------------
  |  Branch (157:14): [True: 54, False: 5.51k]
  ------------------
  158|     54|    chroma_qm_level = 8;
  159|  5.51k|  } else if (qindex <= 36) {
  ------------------
  |  Branch (159:14): [True: 79, False: 5.44k]
  ------------------
  160|     79|    chroma_qm_level = 7;
  161|  5.44k|  } else if (qindex <= 44) {
  ------------------
  |  Branch (161:14): [True: 56, False: 5.38k]
  ------------------
  162|     56|    chroma_qm_level = 6;
  163|  5.38k|  } else if (qindex <= 48) {
  ------------------
  |  Branch (163:14): [True: 62, False: 5.32k]
  ------------------
  164|     62|    chroma_qm_level = 5;
  165|  5.32k|  } else if (qindex <= 56) {
  ------------------
  |  Branch (165:14): [True: 83, False: 5.23k]
  ------------------
  166|     83|    chroma_qm_level = 4;
  167|  5.23k|  } else if (qindex <= 88) {
  ------------------
  |  Branch (167:14): [True: 420, False: 4.81k]
  ------------------
  168|    420|    chroma_qm_level = 3;
  169|  4.81k|  } else {
  170|  4.81k|    chroma_qm_level = 2;
  171|  4.81k|  }
  172|       |
  173|  5.88k|  return clamp(chroma_qm_level, first, last);
  174|  5.88k|}
av1_quantize.c:aom_get_qmlevel:
   61|  42.5k|static inline int aom_get_qmlevel(int qindex, int first, int last) {
   62|  42.5k|  return first + (qindex * (last + 1 - first)) / QINDEX_RANGE;
  ------------------
  |  |   27|  42.5k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  42.5k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  42.5k|#define MINQ 0
  |  |  ------------------
  ------------------
   63|  42.5k|}

av1_init_warp_params:
   59|  13.7M|                          const MACROBLOCKD *xd, const MB_MODE_INFO *mi) {
   60|  13.7M|  if (inter_pred_params->block_height < 8 || inter_pred_params->block_width < 8)
  ------------------
  |  Branch (60:7): [True: 4.64M, False: 9.15M]
  |  Branch (60:46): [True: 1.54M, False: 7.60M]
  ------------------
   61|  6.19M|    return;
   62|       |
   63|  7.60M|  if (xd->cur_frame_force_integer_mv) return;
  ------------------
  |  Branch (63:7): [True: 0, False: 7.60M]
  ------------------
   64|       |
   65|  7.60M|  if (allow_warp(mi, warp_types, &xd->global_motion[mi->ref_frame[ref]], 0,
  ------------------
  |  Branch (65:7): [True: 207k, False: 7.39M]
  ------------------
   66|  7.60M|                 inter_pred_params->scale_factors,
   67|  7.60M|                 &inter_pred_params->warp_params)) {
   68|       |#if CONFIG_REALTIME_ONLY && !CONFIG_AV1_DECODER
   69|       |    aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_FEATURE,
   70|       |                       "Warped motion is disabled in realtime only build.");
   71|       |#endif  // CONFIG_REALTIME_ONLY && !CONFIG_AV1_DECODER
   72|   207k|    inter_pred_params->mode = WARP_PRED;
   73|   207k|  }
   74|  7.60M|}
av1_make_inter_predictor:
   79|  58.9M|                              const SubpelParams *subpel_params) {
   80|  58.9M|  assert(IMPLIES(inter_pred_params->conv_params.is_compound,
   81|  58.9M|                 inter_pred_params->conv_params.dst != NULL));
   82|       |
   83|  58.9M|  if (inter_pred_params->mode == TRANSLATION_PRED) {
  ------------------
  |  Branch (83:7): [True: 58.7M, False: 204k]
  ------------------
   84|  58.7M|#if CONFIG_AV1_HIGHBITDEPTH
   85|  58.7M|    if (inter_pred_params->use_hbd_buf) {
  ------------------
  |  Branch (85:9): [True: 16.9M, False: 41.8M]
  ------------------
   86|  16.9M|      highbd_inter_predictor(src, src_stride, dst, dst_stride, subpel_params,
   87|  16.9M|                             inter_pred_params->block_width,
   88|  16.9M|                             inter_pred_params->block_height,
   89|  16.9M|                             &inter_pred_params->conv_params,
   90|  16.9M|                             inter_pred_params->interp_filter_params,
   91|  16.9M|                             inter_pred_params->bit_depth);
   92|  41.8M|    } else {
   93|  41.8M|      inter_predictor(src, src_stride, dst, dst_stride, subpel_params,
   94|  41.8M|                      inter_pred_params->block_width,
   95|  41.8M|                      inter_pred_params->block_height,
   96|  41.8M|                      &inter_pred_params->conv_params,
   97|  41.8M|                      inter_pred_params->interp_filter_params);
   98|  41.8M|    }
   99|       |#else
  100|       |    inter_predictor(src, src_stride, dst, dst_stride, subpel_params,
  101|       |                    inter_pred_params->block_width,
  102|       |                    inter_pred_params->block_height,
  103|       |                    &inter_pred_params->conv_params,
  104|       |                    inter_pred_params->interp_filter_params);
  105|       |#endif
  106|  58.7M|  }
  107|   204k|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
  108|       |  // TODO(jingning): av1_warp_plane() can be further cleaned up.
  109|   207k|  else if (inter_pred_params->mode == WARP_PRED) {
  ------------------
  |  Branch (109:12): [True: 207k, False: 18.4E]
  ------------------
  110|   207k|    av1_warp_plane(
  111|   207k|        &inter_pred_params->warp_params, inter_pred_params->use_hbd_buf,
  112|   207k|        inter_pred_params->bit_depth, inter_pred_params->ref_frame_buf.buf0,
  113|   207k|        inter_pred_params->ref_frame_buf.width,
  114|   207k|        inter_pred_params->ref_frame_buf.height,
  115|   207k|        inter_pred_params->ref_frame_buf.stride, dst,
  116|   207k|        inter_pred_params->pix_col, inter_pred_params->pix_row,
  117|   207k|        inter_pred_params->block_width, inter_pred_params->block_height,
  118|   207k|        dst_stride, inter_pred_params->subsampling_x,
  119|   207k|        inter_pred_params->subsampling_y, &inter_pred_params->conv_params);
  120|   207k|  }
  121|  18.4E|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
  122|  18.4E|  else {
  123|       |    assert(0 && "Unsupported inter_pred_params->mode");
  124|  18.4E|  }
  125|  58.9M|}
av1_init_wedge_masks:
  467|  25.4k|void av1_init_wedge_masks(void) {}
av1_dist_wtd_comp_weight_assign:
  540|  13.8M|                                     int is_compound) {
  541|  13.8M|  assert(fwd_offset != NULL && bck_offset != NULL);
  542|  13.8M|  if (!is_compound || mbmi->compound_idx) {
  ------------------
  |  Branch (542:7): [True: 13.8M, False: 0]
  |  Branch (542:23): [True: 0, False: 0]
  ------------------
  543|  13.8M|    *fwd_offset = 8;
  544|  13.8M|    *bck_offset = 8;
  545|  13.8M|    *use_dist_wtd_comp_avg = 0;
  546|  13.8M|    return;
  547|  13.8M|  }
  548|       |
  549|  18.4E|  *use_dist_wtd_comp_avg = 1;
  550|  18.4E|  const RefCntBuffer *const bck_buf = get_ref_frame_buf(cm, mbmi->ref_frame[0]);
  551|  18.4E|  const RefCntBuffer *const fwd_buf = get_ref_frame_buf(cm, mbmi->ref_frame[1]);
  552|  18.4E|  const int cur_frame_index = cm->cur_frame->order_hint;
  553|  18.4E|  int bck_frame_index = 0, fwd_frame_index = 0;
  554|       |
  555|  18.4E|  if (bck_buf != NULL) bck_frame_index = bck_buf->order_hint;
  ------------------
  |  Branch (555:7): [True: 0, False: 18.4E]
  ------------------
  556|  18.4E|  if (fwd_buf != NULL) fwd_frame_index = fwd_buf->order_hint;
  ------------------
  |  Branch (556:7): [True: 0, False: 18.4E]
  ------------------
  557|       |
  558|  18.4E|  int d0 = clamp(abs(get_relative_dist(&cm->seq_params->order_hint_info,
  559|  18.4E|                                       fwd_frame_index, cur_frame_index)),
  560|  18.4E|                 0, MAX_FRAME_DISTANCE);
  ------------------
  |  |   68|  18.4E|#define MAX_FRAME_DISTANCE ((1 << FRAME_OFFSET_BITS) - 1)
  |  |  ------------------
  |  |  |  |   67|  18.4E|#define FRAME_OFFSET_BITS 5
  |  |  ------------------
  ------------------
  561|  18.4E|  int d1 = clamp(abs(get_relative_dist(&cm->seq_params->order_hint_info,
  562|  18.4E|                                       cur_frame_index, bck_frame_index)),
  563|  18.4E|                 0, MAX_FRAME_DISTANCE);
  ------------------
  |  |   68|  18.4E|#define MAX_FRAME_DISTANCE ((1 << FRAME_OFFSET_BITS) - 1)
  |  |  ------------------
  |  |  |  |   67|  18.4E|#define FRAME_OFFSET_BITS 5
  |  |  ------------------
  ------------------
  564|       |
  565|  18.4E|  const int order = d0 <= d1;
  566|       |
  567|  18.4E|  if (d0 == 0 || d1 == 0) {
  ------------------
  |  Branch (567:7): [True: 18.4E, False: 0]
  |  Branch (567:18): [True: 0, False: 0]
  ------------------
  568|      0|    *fwd_offset = quant_dist_lookup_table[3][order];
  569|      0|    *bck_offset = quant_dist_lookup_table[3][1 - order];
  570|      0|    return;
  571|      0|  }
  572|       |
  573|  18.4E|  int i;
  574|  18.4E|  for (i = 0; i < 3; ++i) {
  ------------------
  |  Branch (574:15): [True: 0, False: 18.4E]
  ------------------
  575|      0|    int c0 = quant_dist_weight[i][order];
  576|      0|    int c1 = quant_dist_weight[i][!order];
  577|      0|    int d0_c0 = d0 * c0;
  578|      0|    int d1_c1 = d1 * c1;
  579|      0|    if ((d0 > d1 && d0_c0 < d1_c1) || (d0 <= d1 && d0_c0 > d1_c1)) break;
  ------------------
  |  Branch (579:10): [True: 0, False: 0]
  |  Branch (579:21): [True: 0, False: 0]
  |  Branch (579:40): [True: 0, False: 0]
  |  Branch (579:52): [True: 0, False: 0]
  ------------------
  580|      0|  }
  581|       |
  582|  18.4E|  *fwd_offset = quant_dist_lookup_table[i][order];
  583|  18.4E|  *bck_offset = quant_dist_lookup_table[i][1 - order];
  584|  18.4E|}
av1_setup_dst_planes:
  588|  18.0M|                          const int plane_start, const int plane_end) {
  589|       |  // We use AOMMIN(num_planes, MAX_MB_PLANE) instead of num_planes to quiet
  590|       |  // the static analysis warnings.
  591|  51.3M|  for (int i = plane_start; i < AOMMIN(plane_end, MAX_MB_PLANE); ++i) {
  ------------------
  |  |   34|  51.3M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 20.4M, False: 30.8M]
  |  |  ------------------
  ------------------
  |  Branch (591:29): [True: 33.3M, False: 18.0M]
  ------------------
  592|  33.3M|    struct macroblockd_plane *const pd = &planes[i];
  593|  33.3M|    const int is_uv = i > 0;
  594|  33.3M|    setup_pred_plane(&pd->dst, bsize, src->buffers[i], src->crop_widths[is_uv],
  595|  33.3M|                     src->crop_heights[is_uv], src->strides[is_uv], mi_row,
  596|       |                     mi_col, NULL, pd->subsampling_x, pd->subsampling_y);
  597|  33.3M|  }
  598|  18.0M|}
av1_setup_pre_planes:
  603|  8.89M|                          const int num_planes) {
  604|  8.89M|  if (src != NULL) {
  ------------------
  |  Branch (604:7): [True: 8.89M, False: 18.4E]
  ------------------
  605|       |    // We use AOMMIN(num_planes, MAX_MB_PLANE) instead of num_planes to quiet
  606|       |    // the static analysis warnings.
  607|  20.3M|    for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); ++i) {
  ------------------
  |  |   34|  20.3M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.2M, False: 5.04M]
  |  |  ------------------
  ------------------
  |  Branch (607:21): [True: 11.4M, False: 8.89M]
  ------------------
  608|  11.4M|      struct macroblockd_plane *const pd = &xd->plane[i];
  609|  11.4M|      const int is_uv = i > 0;
  610|  11.4M|      setup_pred_plane(&pd->pre[idx], xd->mi[0]->bsize, src->buffers[i],
  611|  11.4M|                       src->crop_widths[is_uv], src->crop_heights[is_uv],
  612|  11.4M|                       src->strides[is_uv], mi_row, mi_col, sf,
  613|  11.4M|                       pd->subsampling_x, pd->subsampling_y);
  614|  11.4M|    }
  615|  8.89M|  }
  616|  8.89M|}
av1_count_overlappable_neighbors:
  668|  2.70M|void av1_count_overlappable_neighbors(const AV1_COMMON *cm, MACROBLOCKD *xd) {
  669|  2.70M|  MB_MODE_INFO *mbmi = xd->mi[0];
  670|       |
  671|  2.70M|  mbmi->overlappable_neighbors = 0;
  672|       |
  673|  2.70M|  if (!is_motion_variation_allowed_bsize(mbmi->bsize)) return;
  ------------------
  |  Branch (673:7): [True: 398k, False: 2.31M]
  ------------------
  674|       |
  675|  2.31M|  foreach_overlappable_nb_above(cm, xd, INT_MAX, increment_int_ptr,
  676|  2.31M|                                &mbmi->overlappable_neighbors);
  677|  2.31M|  if (mbmi->overlappable_neighbors) return;
  ------------------
  |  Branch (677:7): [True: 570k, False: 1.73M]
  ------------------
  678|  1.73M|  foreach_overlappable_nb_left(cm, xd, INT_MAX, increment_int_ptr,
  679|  1.73M|                               &mbmi->overlappable_neighbors);
  680|  1.73M|}
reconinter.c:allow_warp:
   36|  7.60M|                      WarpedMotionParams *final_warp_params) {
   37|       |  // Note: As per the spec, we must test the fixed point scales here, which are
   38|       |  // at a higher precision (1 << 14) than the xs and ys in subpel_params (that
   39|       |  // have 1 << 10 precision).
   40|  7.60M|  if (av1_is_scaled(sf)) return 0;
  ------------------
  |  Branch (40:7): [True: 6.07M, False: 1.53M]
  ------------------
   41|       |
   42|  1.53M|  if (final_warp_params != NULL) *final_warp_params = default_warp_params;
  ------------------
  |  Branch (42:7): [True: 1.53M, False: 18.4E]
  ------------------
   43|       |
   44|  1.53M|  if (build_for_obmc) return 0;
  ------------------
  |  Branch (44:7): [True: 0, False: 1.53M]
  ------------------
   45|       |
   46|  1.53M|  if (warp_types->local_warp_allowed && !mbmi->wm_params.invalid) {
  ------------------
  |  Branch (46:7): [True: 207k, False: 1.32M]
  |  Branch (46:41): [True: 207k, False: 90]
  ------------------
   47|   207k|    if (final_warp_params != NULL) *final_warp_params = mbmi->wm_params;
  ------------------
  |  Branch (47:9): [True: 207k, False: 43]
  ------------------
   48|   207k|    return 1;
   49|  1.32M|  } else if (warp_types->global_warp_allowed && !gm_params->invalid) {
  ------------------
  |  Branch (49:14): [True: 0, False: 1.32M]
  |  Branch (49:49): [True: 0, False: 0]
  ------------------
   50|      0|    if (final_warp_params != NULL) *final_warp_params = *gm_params;
  ------------------
  |  Branch (50:9): [True: 0, False: 0]
  ------------------
   51|      0|    return 1;
   52|      0|  }
   53|       |
   54|  1.32M|  return 0;
   55|  1.53M|}
reconinter.c:increment_int_ptr:
  657|   869k|                                     const int num_planes) {
  658|   869k|  (void)xd;
  659|   869k|  (void)rel_mi_row;
  660|   869k|  (void)rel_mi_col;
  661|   869k|  (void)op_mi_size;
  662|   869k|  (void)dir;
  663|   869k|  (void)mi;
  664|   869k|  ++*(uint8_t *)fun_ctxt;
  665|   869k|  (void)num_planes;
  666|   869k|}

decodeframe.c:av1_init_inter_params:
  226|   295k|    int_interpfilters interp_filters) {
  227|   295k|  init_inter_block_params(inter_pred_params, block_width, block_height, pix_row,
  228|   295k|                          pix_col, subsampling_x, subsampling_y, bit_depth,
  229|   295k|                          use_hbd_buf, is_intrabc);
  230|   295k|  init_interp_filter_params(inter_pred_params->interp_filter_params,
  231|   295k|                            &interp_filters.as_filters, block_width,
  232|   295k|                            block_height, is_intrabc);
  233|   295k|  inter_pred_params->scale_factors = sf;
  234|   295k|  inter_pred_params->ref_frame_buf = *ref_buf;
  235|   295k|}
decodeframe.c:init_inter_block_params:
  204|   294k|                                           int is_intrabc) {
  205|   294k|  inter_pred_params->block_width = block_width;
  206|   294k|  inter_pred_params->block_height = block_height;
  207|   294k|  inter_pred_params->pix_row = pix_row;
  208|   294k|  inter_pred_params->pix_col = pix_col;
  209|   294k|  inter_pred_params->subsampling_x = subsampling_x;
  210|   294k|  inter_pred_params->subsampling_y = subsampling_y;
  211|   294k|  inter_pred_params->bit_depth = bit_depth;
  212|   294k|  inter_pred_params->use_hbd_buf = use_hbd_buf;
  213|   294k|  inter_pred_params->is_intrabc = is_intrabc;
  214|   294k|  inter_pred_params->mode = TRANSLATION_PRED;
  215|   294k|  inter_pred_params->comp_mode = UNIFORM_SINGLE;
  216|   294k|  inter_pred_params->top = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_y);
  ------------------
  |  |   32|   294k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   294k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   294k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   294k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   294k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  217|   294k|  inter_pred_params->left = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_x);
  ------------------
  |  |   32|   294k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   294k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   294k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   294k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   294k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  218|   294k|}
decodeframe.c:init_interp_filter_params:
  177|   294k|    int is_intrabc) {
  178|   294k|  if (UNLIKELY(is_intrabc)) {
  ------------------
  |  |   55|   294k|#define UNLIKELY(v) __builtin_expect(v, 0)
  |  |  ------------------
  |  |  |  Branch (55:21): [True: 0, False: 294k]
  |  |  ------------------
  ------------------
  179|      0|    interp_filter_params[0] = &av1_intrabc_filter_params;
  180|      0|    interp_filter_params[1] = &av1_intrabc_filter_params;
  181|   294k|  } else {
  182|   294k|    interp_filter_params[0] = av1_get_interp_filter_params_with_block_size(
  183|   294k|        (InterpFilter)filter->x_filter, block_width);
  184|   294k|    interp_filter_params[1] = av1_get_interp_filter_params_with_block_size(
  185|   294k|        (InterpFilter)filter->y_filter, block_height);
  186|   294k|  }
  187|   294k|}
decodeframe.c:clamp_mv_to_umv_border_sb:
  350|   294k|                                           int ss_x, int ss_y) {
  351|       |  // If the MV points so far into the UMV border that no visible pixels
  352|       |  // are used for reconstruction, the subpel part of the MV can be
  353|       |  // discarded and the MV limited to 16 pixels with equivalent results.
  354|   294k|  const int spel_left = (AOM_INTERP_EXTEND + bw) << SUBPEL_BITS;
  ------------------
  |  |   31|   294k|#define AOM_INTERP_EXTEND 4
  ------------------
                const int spel_left = (AOM_INTERP_EXTEND + bw) << SUBPEL_BITS;
  ------------------
  |  |   23|   294k|#define SUBPEL_BITS 4
  ------------------
  355|   294k|  const int spel_right = spel_left - SUBPEL_SHIFTS;
  ------------------
  |  |   25|   294k|#define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   294k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  356|   294k|  const int spel_top = (AOM_INTERP_EXTEND + bh) << SUBPEL_BITS;
  ------------------
  |  |   31|   294k|#define AOM_INTERP_EXTEND 4
  ------------------
                const int spel_top = (AOM_INTERP_EXTEND + bh) << SUBPEL_BITS;
  ------------------
  |  |   23|   294k|#define SUBPEL_BITS 4
  ------------------
  357|   294k|  const int spel_bottom = spel_top - SUBPEL_SHIFTS;
  ------------------
  |  |   25|   294k|#define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   294k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  358|   294k|  MV clamped_mv = { (int16_t)(src_mv->row * (1 << (1 - ss_y))),
  359|   294k|                    (int16_t)(src_mv->col * (1 << (1 - ss_x))) };
  360|   294k|  assert(ss_x <= 1);
  361|   294k|  assert(ss_y <= 1);
  362|   294k|  const SubpelMvLimits mv_limits = {
  363|   294k|    xd->mb_to_left_edge * (1 << (1 - ss_x)) - spel_left,
  364|   294k|    xd->mb_to_right_edge * (1 << (1 - ss_x)) + spel_right,
  365|   294k|    xd->mb_to_top_edge * (1 << (1 - ss_y)) - spel_top,
  366|   294k|    xd->mb_to_bottom_edge * (1 << (1 - ss_y)) + spel_bottom
  367|   294k|  };
  368|       |
  369|   294k|  clamp_mv(&clamped_mv, &mv_limits);
  370|       |
  371|   294k|  return clamped_mv;
  372|   294k|}
decodemv.c:av1_is_interp_needed:
  425|   191k|static inline int av1_is_interp_needed(const MACROBLOCKD *const xd) {
  426|   191k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  427|   191k|  if (mbmi->skip_mode) return 0;
  ------------------
  |  Branch (427:7): [True: 0, False: 191k]
  ------------------
  428|   191k|  if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
  ------------------
  |  Branch (428:7): [True: 2.04k, False: 189k]
  ------------------
  429|   189k|  if (is_nontrans_global_motion(xd, xd->mi[0])) return 0;
  ------------------
  |  Branch (429:7): [True: 5.10k, False: 184k]
  ------------------
  430|   184k|  return 1;
  431|   189k|}
decodemv.c:set_default_interp_filters:
  420|  7.14k|    MB_MODE_INFO *const mbmi, InterpFilter frame_interp_filter) {
  421|  7.14k|  mbmi->interp_filters =
  422|  7.14k|      av1_broadcast_interp_filter(av1_unswitchable_filter(frame_interp_filter));
  423|  7.14k|}
bitstream.c:av1_is_interp_needed:
  425|   509k|static inline int av1_is_interp_needed(const MACROBLOCKD *const xd) {
  426|   509k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  427|   509k|  if (mbmi->skip_mode) return 0;
  ------------------
  |  Branch (427:7): [True: 0, False: 509k]
  ------------------
  428|   509k|  if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
  ------------------
  |  Branch (428:7): [True: 7.07k, False: 502k]
  ------------------
  429|   502k|  if (is_nontrans_global_motion(xd, xd->mi[0])) return 0;
  ------------------
  |  Branch (429:7): [True: 13.8k, False: 489k]
  ------------------
  430|   489k|  return 1;
  431|   502k|}
encodeframe.c:setup_pred_plane:
  395|  31.6M|                                    int subsampling_x, int subsampling_y) {
  396|       |  // Offset the buffer pointer
  397|  31.6M|  if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (397:7): [True: 7.47M, False: 24.1M]
  |  Branch (397:24): [True: 389k, False: 7.09M]
  |  Branch (397:43): [True: 389k, False: 0]
  ------------------
  398|   389k|    mi_row -= 1;
  399|  31.6M|  if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (399:7): [True: 11.4M, False: 20.1M]
  |  Branch (399:24): [True: 694k, False: 10.7M]
  |  Branch (399:43): [True: 694k, False: 18.4E]
  ------------------
  400|   694k|    mi_col -= 1;
  401|       |
  402|  31.6M|  const int x = (MI_SIZE * mi_col) >> subsampling_x;
  ------------------
  |  |   40|  31.6M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  31.6M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  403|  31.6M|  const int y = (MI_SIZE * mi_row) >> subsampling_y;
  ------------------
  |  |   40|  31.6M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  31.6M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  404|  31.6M|  dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
  405|  31.6M|  dst->buf0 = src;
  406|  31.6M|  dst->width = width;
  407|  31.6M|  dst->height = height;
  408|  31.6M|  dst->stride = stride;
  409|  31.6M|}
encodeframe.c:scaled_buffer_offset:
  376|  31.6M|                                           const struct scale_factors *sf) {
  377|  31.6M|  int x, y;
  378|  31.6M|  if (!sf) {
  ------------------
  |  Branch (378:7): [True: 31.6M, False: 0]
  ------------------
  379|  31.6M|    x = x_offset;
  380|  31.6M|    y = y_offset;
  381|  31.6M|  } else if (av1_is_scaled(sf)) {
  ------------------
  |  Branch (381:14): [True: 0, False: 0]
  ------------------
  382|      0|    x = av1_scaled_x(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  383|      0|    y = av1_scaled_y(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  384|      0|  } else {
  385|      0|    x = av1_unscaled_value(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  386|      0|    y = av1_unscaled_value(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  387|      0|  }
  388|  31.6M|  return (int64_t)y * stride + x;
  389|  31.6M|}
partition_search.c:av1_is_interp_needed:
  425|   510k|static inline int av1_is_interp_needed(const MACROBLOCKD *const xd) {
  426|   510k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  427|   510k|  if (mbmi->skip_mode) return 0;
  ------------------
  |  Branch (427:7): [True: 0, False: 510k]
  ------------------
  428|   510k|  if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
  ------------------
  |  Branch (428:7): [True: 7.10k, False: 503k]
  ------------------
  429|   503k|  if (is_nontrans_global_motion(xd, xd->mi[0])) return 0;
  ------------------
  |  Branch (429:7): [True: 13.8k, False: 490k]
  ------------------
  430|   490k|  return 1;
  431|   503k|}
partition_search.c:setup_pred_plane:
  395|    352|                                    int subsampling_x, int subsampling_y) {
  396|       |  // Offset the buffer pointer
  397|    352|  if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (397:7): [True: 0, False: 352]
  |  Branch (397:24): [True: 0, False: 0]
  |  Branch (397:43): [True: 0, False: 0]
  ------------------
  398|      0|    mi_row -= 1;
  399|    352|  if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (399:7): [True: 0, False: 352]
  |  Branch (399:24): [True: 0, False: 0]
  |  Branch (399:43): [True: 0, False: 0]
  ------------------
  400|      0|    mi_col -= 1;
  401|       |
  402|    352|  const int x = (MI_SIZE * mi_col) >> subsampling_x;
  ------------------
  |  |   40|    352|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    352|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  403|    352|  const int y = (MI_SIZE * mi_row) >> subsampling_y;
  ------------------
  |  |   40|    352|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    352|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  404|    352|  dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
  405|    352|  dst->buf0 = src;
  406|    352|  dst->width = width;
  407|    352|  dst->height = height;
  408|    352|  dst->stride = stride;
  409|    352|}
partition_search.c:scaled_buffer_offset:
  376|    352|                                           const struct scale_factors *sf) {
  377|    352|  int x, y;
  378|    352|  if (!sf) {
  ------------------
  |  Branch (378:7): [True: 352, False: 0]
  ------------------
  379|    352|    x = x_offset;
  380|    352|    y = y_offset;
  381|    352|  } else if (av1_is_scaled(sf)) {
  ------------------
  |  Branch (381:14): [True: 0, False: 0]
  ------------------
  382|      0|    x = av1_scaled_x(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  383|      0|    y = av1_scaled_y(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  384|      0|  } else {
  385|      0|    x = av1_unscaled_value(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  386|      0|    y = av1_unscaled_value(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|      0|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|      0|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|      0|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  387|      0|  }
  388|    352|  return (int64_t)y * stride + x;
  389|    352|}
rd.c:av1_is_wedge_used:
  334|  3.36M|static inline int av1_is_wedge_used(BLOCK_SIZE sb_type) {
  335|  3.36M|  return av1_wedge_params_lookup[sb_type].wedge_types > 0;
  336|  3.36M|}
rd.c:setup_pred_plane:
  395|  8.33M|                                    int subsampling_x, int subsampling_y) {
  396|       |  // Offset the buffer pointer
  397|  8.33M|  if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (397:7): [True: 2.00M, False: 6.32M]
  |  Branch (397:24): [True: 210k, False: 1.79M]
  |  Branch (397:43): [True: 210k, False: 1]
  ------------------
  398|   210k|    mi_row -= 1;
  399|  8.33M|  if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (399:7): [True: 3.09M, False: 5.23M]
  |  Branch (399:24): [True: 352k, False: 2.74M]
  |  Branch (399:43): [True: 352k, False: 18.4E]
  ------------------
  400|   352k|    mi_col -= 1;
  401|       |
  402|  8.33M|  const int x = (MI_SIZE * mi_col) >> subsampling_x;
  ------------------
  |  |   40|  8.33M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  8.33M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  403|  8.33M|  const int y = (MI_SIZE * mi_row) >> subsampling_y;
  ------------------
  |  |   40|  8.33M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  8.33M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  404|  8.33M|  dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
  405|  8.33M|  dst->buf0 = src;
  406|  8.33M|  dst->width = width;
  407|  8.33M|  dst->height = height;
  408|  8.33M|  dst->stride = stride;
  409|  8.33M|}
rd.c:scaled_buffer_offset:
  376|  8.33M|                                           const struct scale_factors *sf) {
  377|  8.33M|  int x, y;
  378|  8.33M|  if (!sf) {
  ------------------
  |  Branch (378:7): [True: 4.41M, False: 3.91M]
  ------------------
  379|  4.41M|    x = x_offset;
  380|  4.41M|    y = y_offset;
  381|  4.41M|  } else if (av1_is_scaled(sf)) {
  ------------------
  |  Branch (381:14): [True: 3.37M, False: 538k]
  ------------------
  382|  3.37M|    x = av1_scaled_x(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  3.37M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  3.37M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  3.37M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  383|  3.37M|    y = av1_scaled_y(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  3.37M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  3.37M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  3.37M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  384|  3.37M|  } else {
  385|   538k|    x = av1_unscaled_value(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   538k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   538k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   538k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  386|   538k|    y = av1_unscaled_value(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   538k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   538k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   538k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  387|   538k|  }
  388|  8.33M|  return (int64_t)y * stride + x;
  389|  8.33M|}
rdopt.c:set_default_interp_filters:
  420|  94.2M|    MB_MODE_INFO *const mbmi, InterpFilter frame_interp_filter) {
  421|  94.2M|  mbmi->interp_filters =
  422|  94.2M|      av1_broadcast_interp_filter(av1_unswitchable_filter(frame_interp_filter));
  423|  94.2M|}
rdopt.c:av1_is_interp_needed:
  425|  9.27M|static inline int av1_is_interp_needed(const MACROBLOCKD *const xd) {
  426|  9.27M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  427|  9.27M|  if (mbmi->skip_mode) return 0;
  ------------------
  |  Branch (427:7): [True: 0, False: 9.27M]
  ------------------
  428|  9.27M|  if (mbmi->motion_mode == WARPED_CAUSAL) return 0;
  ------------------
  |  Branch (428:7): [True: 0, False: 9.27M]
  ------------------
  429|  9.27M|  if (is_nontrans_global_motion(xd, xd->mi[0])) return 0;
  ------------------
  |  Branch (429:7): [True: 332k, False: 8.93M]
  ------------------
  430|  8.93M|  return 1;
  431|  9.27M|}
nonrd_pickmode.c:set_default_interp_filters:
  420|   602k|    MB_MODE_INFO *const mbmi, InterpFilter frame_interp_filter) {
  421|   602k|  mbmi->interp_filters =
  422|   602k|      av1_broadcast_interp_filter(av1_unswitchable_filter(frame_interp_filter));
  423|   602k|}
nonrd_pickmode.c:init_inter_block_params:
  204|   598k|                                           int is_intrabc) {
  205|   598k|  inter_pred_params->block_width = block_width;
  206|   598k|  inter_pred_params->block_height = block_height;
  207|   598k|  inter_pred_params->pix_row = pix_row;
  208|   598k|  inter_pred_params->pix_col = pix_col;
  209|   598k|  inter_pred_params->subsampling_x = subsampling_x;
  210|   598k|  inter_pred_params->subsampling_y = subsampling_y;
  211|   598k|  inter_pred_params->bit_depth = bit_depth;
  212|   598k|  inter_pred_params->use_hbd_buf = use_hbd_buf;
  213|   598k|  inter_pred_params->is_intrabc = is_intrabc;
  214|   598k|  inter_pred_params->mode = TRANSLATION_PRED;
  215|   598k|  inter_pred_params->comp_mode = UNIFORM_SINGLE;
  216|   598k|  inter_pred_params->top = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_y);
  ------------------
  |  |   32|   598k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   598k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   598k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   598k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   598k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  217|   598k|  inter_pred_params->left = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_x);
  ------------------
  |  |   32|   598k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   598k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   598k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   598k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   598k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  218|   598k|}
nonrd_pickmode.c:init_inter_mode_params:
  193|  1.99M|    int height) {
  194|  1.99M|  inter_pred_params->scale_factors = sf;
  195|  1.99M|  init_subpel_params(src_mv, inter_pred_params, subpel_params, width, height);
  196|  1.99M|}
nonrd_pickmode.c:init_subpel_params:
  139|  1.99M|                                      int height) {
  140|  1.99M|  const struct scale_factors *sf = inter_pred_params->scale_factors;
  141|  1.99M|  int ssx = inter_pred_params->subsampling_x;
  142|  1.99M|  int ssy = inter_pred_params->subsampling_y;
  143|  1.99M|  int orig_pos_y = inter_pred_params->pix_row << SUBPEL_BITS;
  ------------------
  |  |   23|  1.99M|#define SUBPEL_BITS 4
  ------------------
  144|  1.99M|  orig_pos_y += src_mv->row * (1 << (1 - ssy));
  145|  1.99M|  int orig_pos_x = inter_pred_params->pix_col << SUBPEL_BITS;
  ------------------
  |  |   23|  1.99M|#define SUBPEL_BITS 4
  ------------------
  146|  1.99M|  orig_pos_x += src_mv->col * (1 << (1 - ssx));
  147|  1.99M|  const int is_scaled = av1_is_scaled(sf);
  148|  1.99M|  int pos_x, pos_y;
  149|  1.99M|  if (LIKELY(!is_scaled)) {
  ------------------
  |  |   54|  1.99M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.99M, False: 124]
  |  |  ------------------
  ------------------
  150|  1.99M|    pos_y = av1_unscaled_value(orig_pos_y, sf);
  151|  1.99M|    pos_x = av1_unscaled_value(orig_pos_x, sf);
  152|  1.99M|  } else {
  153|    124|    pos_y = av1_scaled_y(orig_pos_y, sf);
  154|    124|    pos_x = av1_scaled_x(orig_pos_x, sf);
  155|    124|  }
  156|       |
  157|  1.99M|  pos_x += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|  1.99M|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|  1.99M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.99M|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  1.99M|  pos_y += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|  1.99M|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|  1.99M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.99M|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|       |
  160|  1.99M|  const int bottom = (height + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   31|  1.99M|#define AOM_INTERP_EXTEND 4
  ------------------
                const int bottom = (height + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  ------------------
  161|  1.99M|  const int right = (width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   31|  1.99M|#define AOM_INTERP_EXTEND 4
  ------------------
                const int right = (width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  ------------------
  162|  1.99M|  pos_y = clamp(pos_y, inter_pred_params->top, bottom);
  163|  1.99M|  pos_x = clamp(pos_x, inter_pred_params->left, right);
  164|       |
  165|  1.99M|  subpel_params->pos_x = pos_x;
  166|  1.99M|  subpel_params->pos_y = pos_y;
  167|  1.99M|  subpel_params->subpel_x = pos_x & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|  1.99M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  1.99M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  1.99M|  subpel_params->subpel_y = pos_y & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|  1.99M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  1.99M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.99M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.99M|  subpel_params->xs = sf->x_step_q4;
  170|  1.99M|  subpel_params->ys = sf->y_step_q4;
  171|  1.99M|}
reconinter_enc.c:init_subpel_params:
  139|  55.0M|                                      int height) {
  140|  55.0M|  const struct scale_factors *sf = inter_pred_params->scale_factors;
  141|  55.0M|  int ssx = inter_pred_params->subsampling_x;
  142|  55.0M|  int ssy = inter_pred_params->subsampling_y;
  143|  55.0M|  int orig_pos_y = inter_pred_params->pix_row << SUBPEL_BITS;
  ------------------
  |  |   23|  55.0M|#define SUBPEL_BITS 4
  ------------------
  144|  55.0M|  orig_pos_y += src_mv->row * (1 << (1 - ssy));
  145|  55.0M|  int orig_pos_x = inter_pred_params->pix_col << SUBPEL_BITS;
  ------------------
  |  |   23|  55.0M|#define SUBPEL_BITS 4
  ------------------
  146|  55.0M|  orig_pos_x += src_mv->col * (1 << (1 - ssx));
  147|  55.0M|  const int is_scaled = av1_is_scaled(sf);
  148|  55.0M|  int pos_x, pos_y;
  149|  55.0M|  if (LIKELY(!is_scaled)) {
  ------------------
  |  |   54|  55.0M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 2.82M, False: 52.2M]
  |  |  ------------------
  ------------------
  150|  2.82M|    pos_y = av1_unscaled_value(orig_pos_y, sf);
  151|  2.82M|    pos_x = av1_unscaled_value(orig_pos_x, sf);
  152|  52.2M|  } else {
  153|  52.2M|    pos_y = av1_scaled_y(orig_pos_y, sf);
  154|  52.2M|    pos_x = av1_scaled_x(orig_pos_x, sf);
  155|  52.2M|  }
  156|       |
  157|  55.0M|  pos_x += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|  55.0M|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|  55.0M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  55.0M|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  55.0M|  pos_y += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|  55.0M|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|  55.0M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  55.0M|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|       |
  160|  55.0M|  const int bottom = (height + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   31|  55.0M|#define AOM_INTERP_EXTEND 4
  ------------------
                const int bottom = (height + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  ------------------
  161|  55.0M|  const int right = (width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   31|  55.0M|#define AOM_INTERP_EXTEND 4
  ------------------
                const int right = (width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  ------------------
  162|  55.0M|  pos_y = clamp(pos_y, inter_pred_params->top, bottom);
  163|  55.0M|  pos_x = clamp(pos_x, inter_pred_params->left, right);
  164|       |
  165|  55.0M|  subpel_params->pos_x = pos_x;
  166|  55.0M|  subpel_params->pos_y = pos_y;
  167|  55.0M|  subpel_params->subpel_x = pos_x & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|  55.0M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  55.0M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  55.0M|  subpel_params->subpel_y = pos_y & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|  55.0M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  55.0M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  55.0M|  subpel_params->xs = sf->x_step_q4;
  170|  55.0M|  subpel_params->ys = sf->y_step_q4;
  171|  55.0M|}
reconinter_enc.c:av1_init_inter_params:
  226|  55.0M|    int_interpfilters interp_filters) {
  227|  55.0M|  init_inter_block_params(inter_pred_params, block_width, block_height, pix_row,
  228|  55.0M|                          pix_col, subsampling_x, subsampling_y, bit_depth,
  229|  55.0M|                          use_hbd_buf, is_intrabc);
  230|  55.0M|  init_interp_filter_params(inter_pred_params->interp_filter_params,
  231|  55.0M|                            &interp_filters.as_filters, block_width,
  232|  55.0M|                            block_height, is_intrabc);
  233|  55.0M|  inter_pred_params->scale_factors = sf;
  234|  55.0M|  inter_pred_params->ref_frame_buf = *ref_buf;
  235|  55.0M|}
reconinter_enc.c:init_inter_block_params:
  204|  55.2M|                                           int is_intrabc) {
  205|  55.2M|  inter_pred_params->block_width = block_width;
  206|  55.2M|  inter_pred_params->block_height = block_height;
  207|  55.2M|  inter_pred_params->pix_row = pix_row;
  208|  55.2M|  inter_pred_params->pix_col = pix_col;
  209|  55.2M|  inter_pred_params->subsampling_x = subsampling_x;
  210|  55.2M|  inter_pred_params->subsampling_y = subsampling_y;
  211|  55.2M|  inter_pred_params->bit_depth = bit_depth;
  212|  55.2M|  inter_pred_params->use_hbd_buf = use_hbd_buf;
  213|  55.2M|  inter_pred_params->is_intrabc = is_intrabc;
  214|  55.2M|  inter_pred_params->mode = TRANSLATION_PRED;
  215|  55.2M|  inter_pred_params->comp_mode = UNIFORM_SINGLE;
  216|  55.2M|  inter_pred_params->top = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_y);
  ------------------
  |  |   32|  55.2M|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  55.2M|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  55.2M|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  55.2M|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  55.2M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  217|  55.2M|  inter_pred_params->left = -AOM_LEFT_TOP_MARGIN_SCALED(subsampling_x);
  ------------------
  |  |   32|  55.2M|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  55.2M|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  55.2M|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  55.2M|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  55.2M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  218|  55.2M|}
reconinter_enc.c:init_interp_filter_params:
  177|  58.8M|    int is_intrabc) {
  178|  58.8M|  if (UNLIKELY(is_intrabc)) {
  ------------------
  |  |   55|  58.8M|#define UNLIKELY(v) __builtin_expect(v, 0)
  |  |  ------------------
  |  |  |  Branch (55:21): [True: 0, False: 58.8M]
  |  |  ------------------
  ------------------
  179|      0|    interp_filter_params[0] = &av1_intrabc_filter_params;
  180|      0|    interp_filter_params[1] = &av1_intrabc_filter_params;
  181|  58.8M|  } else {
  182|  58.8M|    interp_filter_params[0] = av1_get_interp_filter_params_with_block_size(
  183|  58.8M|        (InterpFilter)filter->x_filter, block_width);
  184|  58.8M|    interp_filter_params[1] = av1_get_interp_filter_params_with_block_size(
  185|  58.8M|        (InterpFilter)filter->y_filter, block_height);
  186|  58.8M|  }
  187|  58.8M|}
reconinter.c:highbd_inter_predictor:
  284|  16.9M|    int bd) {
  285|  16.9M|  assert(conv_params->do_average == 0 || conv_params->do_average == 1);
  286|  16.9M|  const int is_scaled = has_scale(subpel_params->xs, subpel_params->ys);
  287|  16.9M|  if (is_scaled) {
  ------------------
  |  Branch (287:7): [True: 16.2M, False: 646k]
  ------------------
  288|  16.2M|    av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
  289|  16.2M|                                  interp_filters, subpel_params->subpel_x,
  290|  16.2M|                                  subpel_params->xs, subpel_params->subpel_y,
  291|  16.2M|                                  subpel_params->ys, 1, conv_params, bd);
  292|  16.2M|  } else {
  293|   646k|    SubpelParams sp = *subpel_params;
  294|   646k|    revert_scale_extra_bits(&sp);
  295|   646k|    av1_highbd_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
  296|   646k|                                  interp_filters, sp.subpel_x, sp.xs,
  297|   646k|                                  sp.subpel_y, sp.ys, 0, conv_params, bd);
  298|   646k|  }
  299|  16.9M|}
reconinter.c:has_scale:
  245|  58.7M|static inline int has_scale(int xs, int ys) {
  246|  58.7M|  return xs != SCALE_SUBPEL_SHIFTS || ys != SCALE_SUBPEL_SHIFTS;
  ------------------
  |  |   29|   117M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  58.7M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
                return xs != SCALE_SUBPEL_SHIFTS || ys != SCALE_SUBPEL_SHIFTS;
  ------------------
  |  |   29|  11.9M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  11.9M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  |  Branch (246:10): [True: 46.7M, False: 11.9M]
  |  Branch (246:39): [True: 5.75M, False: 6.24M]
  ------------------
  247|  58.7M|}
reconinter.c:revert_scale_extra_bits:
  249|  6.24M|static inline void revert_scale_extra_bits(SubpelParams *sp) {
  250|  6.24M|  sp->subpel_x >>= SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  6.24M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  6.24M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.24M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  251|  6.24M|  sp->subpel_y >>= SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  6.24M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  6.24M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.24M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  252|  6.24M|  sp->xs >>= SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  6.24M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  6.24M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.24M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  253|  6.24M|  sp->ys >>= SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  6.24M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  6.24M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.24M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  254|  6.24M|  assert(sp->subpel_x < SUBPEL_SHIFTS);
  255|  6.24M|  assert(sp->subpel_y < SUBPEL_SHIFTS);
  256|  6.24M|  assert(sp->xs <= SUBPEL_SHIFTS);
  257|       |  assert(sp->ys <= SUBPEL_SHIFTS);
  258|  6.24M|}
reconinter.c:inter_predictor:
  263|  41.8M|    ConvolveParams *conv_params, const InterpFilterParams *interp_filters[2]) {
  264|  41.8M|  assert(conv_params->do_average == 0 || conv_params->do_average == 1);
  265|  41.8M|  const int is_scaled = has_scale(subpel_params->xs, subpel_params->ys);
  266|  41.8M|  if (is_scaled) {
  ------------------
  |  Branch (266:7): [True: 36.2M, False: 5.60M]
  ------------------
  267|  36.2M|    av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
  268|  36.2M|                           interp_filters, subpel_params->subpel_x,
  269|  36.2M|                           subpel_params->xs, subpel_params->subpel_y,
  270|  36.2M|                           subpel_params->ys, 1, conv_params);
  271|  36.2M|  } else {
  272|  5.60M|    SubpelParams sp = *subpel_params;
  273|  5.60M|    revert_scale_extra_bits(&sp);
  274|  5.60M|    av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
  275|  5.60M|                           interp_filters, sp.subpel_x, sp.xs, sp.subpel_y,
  276|  5.60M|                           sp.ys, 0, conv_params);
  277|  5.60M|  }
  278|  41.8M|}
reconinter.c:setup_pred_plane:
  395|  44.7M|                                    int subsampling_x, int subsampling_y) {
  396|       |  // Offset the buffer pointer
  397|  44.7M|  if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
  ------------------
  |  Branch (397:7): [True: 9.11M, False: 35.5M]
  |  Branch (397:24): [True: 499k, False: 8.61M]
  |  Branch (397:43): [True: 499k, False: 0]
  ------------------
  398|   499k|    mi_row -= 1;
  399|  44.7M|  if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
  ------------------
  |  Branch (399:7): [True: 13.9M, False: 30.7M]
  |  Branch (399:24): [True: 886k, False: 13.0M]
  |  Branch (399:43): [True: 886k, False: 2]
  ------------------
  400|   886k|    mi_col -= 1;
  401|       |
  402|  44.7M|  const int x = (MI_SIZE * mi_col) >> subsampling_x;
  ------------------
  |  |   40|  44.7M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  44.7M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  403|  44.7M|  const int y = (MI_SIZE * mi_row) >> subsampling_y;
  ------------------
  |  |   40|  44.7M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  44.7M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  404|  44.7M|  dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
  405|  44.7M|  dst->buf0 = src;
  406|  44.7M|  dst->width = width;
  407|  44.7M|  dst->height = height;
  408|  44.7M|  dst->stride = stride;
  409|  44.7M|}
reconinter.c:scaled_buffer_offset:
  376|  44.7M|                                           const struct scale_factors *sf) {
  377|  44.7M|  int x, y;
  378|  44.7M|  if (!sf) {
  ------------------
  |  Branch (378:7): [True: 39.6M, False: 5.01M]
  ------------------
  379|  39.6M|    x = x_offset;
  380|  39.6M|    y = y_offset;
  381|  39.6M|  } else if (av1_is_scaled(sf)) {
  ------------------
  |  Branch (381:14): [True: 4.40M, False: 610k]
  ------------------
  382|  4.40M|    x = av1_scaled_x(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  4.40M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  4.40M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  4.40M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  383|  4.40M|    y = av1_scaled_y(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  4.40M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  4.40M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  4.40M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  384|  4.40M|  } else {
  385|   610k|    x = av1_unscaled_value(x_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   610k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   610k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   610k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  386|   610k|    y = av1_unscaled_value(y_offset, sf) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   610k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   610k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   610k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  387|   610k|  }
  388|  44.7M|  return (int64_t)y * stride + x;
  389|  44.7M|}

decodeframe.c:build_inter_predictors:
  246|   294k|                                          uint8_t **mc_buf) {
  247|   294k|  if (is_sub8x8_inter(xd, plane, mi->bsize, is_intrabc_block(mi),
  ------------------
  |  Branch (247:7): [True: 391, False: 293k]
  ------------------
  248|   294k|                      build_for_obmc)) {
  249|    391|    assert(bw < 8 || bh < 8);
  250|    391|    build_inter_predictors_sub8x8(cm, xd, plane, mi, mi_x, mi_y, mc_buf);
  251|   293k|  } else {
  252|   293k|    build_inter_predictors_8x8_and_bigger(cm, xd, plane, mi, build_for_obmc, bw,
  253|   293k|                                          bh, mi_x, mi_y, mc_buf);
  254|   293k|  }
  255|   294k|}
decodeframe.c:is_sub8x8_inter:
   55|   294k|                            int is_intrabc, int build_for_obmc) {
   56|   294k|  if (is_intrabc || build_for_obmc) {
  ------------------
  |  Branch (56:7): [True: 312, False: 294k]
  |  Branch (56:21): [True: 18.4E, False: 294k]
  ------------------
   57|      0|    return false;
   58|      0|  }
   59|       |
   60|   294k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
   61|   294k|  const int ss_x = pd->subsampling_x;
   62|   294k|  const int ss_y = pd->subsampling_y;
   63|   294k|  const int is_sub4_x = (block_size_wide[bsize] == 4) && ss_x;
  ------------------
  |  Branch (63:25): [True: 3.00k, False: 291k]
  |  Branch (63:58): [True: 549, False: 2.45k]
  ------------------
   64|   294k|  const int is_sub4_y = (block_size_high[bsize] == 4) && ss_y;
  ------------------
  |  Branch (64:25): [True: 3.83k, False: 290k]
  |  Branch (64:58): [True: 70, False: 3.76k]
  ------------------
   65|   294k|  if (!is_sub4_x && !is_sub4_y) {
  ------------------
  |  Branch (65:7): [True: 293k, False: 712]
  |  Branch (65:21): [True: 293k, False: 66]
  ------------------
   66|   293k|    return false;
   67|   293k|  }
   68|       |
   69|       |  // For sub8x8 chroma blocks, we may be covering more than one luma block's
   70|       |  // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for
   71|       |  // the top-left corner of the prediction source - the correct top-left corner
   72|       |  // is at (pre_x, pre_y).
   73|    720|  const int row_start = is_sub4_y ? -1 : 0;
  ------------------
  |  Branch (73:25): [True: 70, False: 650]
  ------------------
   74|    720|  const int col_start = is_sub4_x ? -1 : 0;
  ------------------
  |  Branch (74:25): [True: 549, False: 171]
  ------------------
   75|       |
   76|  1.13k|  for (int row = row_start; row <= 0; ++row) {
  ------------------
  |  Branch (76:29): [True: 581, False: 554]
  ------------------
   77|  1.41k|    for (int col = col_start; col <= 0; ++col) {
  ------------------
  |  Branch (77:31): [True: 996, False: 415]
  ------------------
   78|    996|      const MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col];
   79|    996|      if (!is_inter_block(this_mbmi)) return false;
  ------------------
  |  Branch (79:11): [True: 166, False: 830]
  ------------------
   80|    830|      if (is_intrabc_block(this_mbmi)) return false;
  ------------------
  |  Branch (80:11): [True: 0, False: 830]
  ------------------
   81|    830|    }
   82|    581|  }
   83|    554|  return true;
   84|    720|}
decodeframe.c:build_inter_predictors_sub8x8:
   91|    391|                                                 uint8_t **mc_buf) {
   92|       |#else
   93|       |static inline void build_inter_predictors_sub8x8(const AV1_COMMON *cm,
   94|       |                                                 MACROBLOCKD *xd, int plane,
   95|       |                                                 const MB_MODE_INFO *mi,
   96|       |                                                 int mi_x, int mi_y) {
   97|       |#endif  // IS_DEC
   98|    391|  const BLOCK_SIZE bsize = mi->bsize;
   99|    391|  struct macroblockd_plane *const pd = &xd->plane[plane];
  100|    391|  const bool ss_x = pd->subsampling_x;
  101|    391|  const bool ss_y = pd->subsampling_y;
  102|    391|  const int b4_w = block_size_wide[bsize] >> ss_x;
  103|    391|  const int b4_h = block_size_high[bsize] >> ss_y;
  104|    391|  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
  105|    391|  const int b8_w = block_size_wide[plane_bsize];
  106|    391|  const int b8_h = block_size_high[plane_bsize];
  107|    391|  const int is_compound = has_second_ref(mi);
  108|    391|  assert(!is_compound);
  109|    391|  assert(!is_intrabc_block(mi));
  110|       |
  111|       |  // For sub8x8 chroma blocks, we may be covering more than one luma block's
  112|       |  // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for
  113|       |  // the top-left corner of the prediction source - the correct top-left corner
  114|       |  // is at (pre_x, pre_y).
  115|    391|  const int row_start = (block_size_high[bsize] == 4) && ss_y ? -1 : 0;
  ------------------
  |  Branch (115:25): [True: 383, False: 8]
  |  Branch (115:58): [True: 18, False: 365]
  ------------------
  116|    391|  const int col_start = (block_size_wide[bsize] == 4) && ss_x ? -1 : 0;
  ------------------
  |  Branch (116:25): [True: 383, False: 8]
  |  Branch (116:58): [True: 383, False: 0]
  ------------------
  117|    391|  const int pre_x = (mi_x + MI_SIZE * col_start) >> ss_x;
  ------------------
  |  |   40|    391|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    391|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  118|    391|  const int pre_y = (mi_y + MI_SIZE * row_start) >> ss_y;
  ------------------
  |  |   40|    391|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|    391|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  119|       |
  120|    391|  int row = row_start;
  121|    800|  for (int y = 0; y < b8_h; y += b4_h) {
  ------------------
  |  Branch (121:19): [True: 409, False: 391]
  ------------------
  122|    409|    int col = col_start;
  123|  1.21k|    for (int x = 0; x < b8_w; x += b4_w) {
  ------------------
  |  Branch (123:21): [True: 802, False: 409]
  ------------------
  124|    802|      MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col];
  125|    802|      struct buf_2d *const dst_buf = &pd->dst;
  126|    802|      uint8_t *dst = dst_buf->buf + dst_buf->stride * y + x;
  127|    802|      int ref = 0;
  128|    802|      const RefCntBuffer *ref_buf =
  129|    802|          get_ref_frame_buf(cm, this_mbmi->ref_frame[ref]);
  130|    802|      const struct scale_factors *ref_scale_factors =
  131|    802|          get_ref_scale_factors_const(cm, this_mbmi->ref_frame[ref]);
  132|    802|      const struct scale_factors *const sf = ref_scale_factors;
  133|    802|      const struct buf_2d pre_buf = {
  134|    802|        NULL,
  135|    802|        (plane == 1) ? ref_buf->buf.u_buffer : ref_buf->buf.v_buffer,
  ------------------
  |  Branch (135:9): [True: 401, False: 401]
  ------------------
  136|    802|        ref_buf->buf.uv_crop_width,
  137|    802|        ref_buf->buf.uv_crop_height,
  138|    802|        ref_buf->buf.uv_stride,
  139|    802|      };
  140|       |
  141|    802|      const MV mv = this_mbmi->mv[ref].as_mv;
  142|       |
  143|    802|      InterPredParams inter_pred_params;
  144|    802|      av1_init_inter_params(&inter_pred_params, b4_w, b4_h, pre_y + y,
  145|    802|                            pre_x + x, pd->subsampling_x, pd->subsampling_y,
  146|    802|                            xd->bd, is_cur_buf_hbd(xd), mi->use_intrabc, sf,
  147|    802|                            &pre_buf, this_mbmi->interp_filters);
  148|    802|      inter_pred_params.conv_params =
  149|    802|          get_conv_params_no_round(ref, plane, NULL, 0, is_compound, xd->bd);
  150|       |
  151|    802|#if IS_DEC
  152|    802|      build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params,
  153|    802|                                xd, mi_x + x, mi_y + y, ref, mc_buf);
  154|       |#else
  155|       |      build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params);
  156|       |#endif  // IS_DEC
  157|       |
  158|    802|      ++col;
  159|    802|    }
  160|    409|    ++row;
  161|    409|  }
  162|    391|}
decodeframe.c:build_one_inter_predictor:
   22|   294k|                                             uint8_t **mc_buf) {
   23|       |#else
   24|       |static inline void build_one_inter_predictor(
   25|       |    uint8_t *dst, int dst_stride, const MV *src_mv,
   26|       |    InterPredParams *inter_pred_params) {
   27|       |#endif  // IS_DEC
   28|   294k|  SubpelParams subpel_params;
   29|   294k|  uint8_t *src;
   30|   294k|  int src_stride;
   31|   294k|#if IS_DEC
   32|   294k|  dec_calc_subpel_params_and_extend(src_mv, inter_pred_params, xd, mi_x, mi_y,
   33|   294k|                                    ref, mc_buf, &src, &subpel_params,
   34|   294k|                                    &src_stride);
   35|       |#else
   36|       |  enc_calc_subpel_params(src_mv, inter_pred_params, &src, &subpel_params,
   37|       |                         &src_stride);
   38|       |#endif  // IS_DEC
   39|   294k|  if (inter_pred_params->comp_mode == UNIFORM_SINGLE ||
  ------------------
  |  Branch (39:7): [True: 294k, False: 0]
  ------------------
   40|   295k|      inter_pred_params->comp_mode == UNIFORM_COMP) {
  ------------------
  |  Branch (40:7): [True: 0, False: 0]
  ------------------
   41|   295k|    av1_make_inter_predictor(src, src_stride, dst, dst_stride,
   42|   295k|                             inter_pred_params, &subpel_params);
   43|  18.4E|  } else {
   44|  18.4E|    av1_make_masked_inter_predictor(src, src_stride, dst, dst_stride,
   45|  18.4E|                                    inter_pred_params, &subpel_params);
   46|  18.4E|  }
   47|   294k|}
decodeframe.c:build_inter_predictors_8x8_and_bigger:
  167|   294k|    int build_for_obmc, int bw, int bh, int mi_x, int mi_y, uint8_t **mc_buf) {
  168|       |#else
  169|       |static inline void build_inter_predictors_8x8_and_bigger(
  170|       |    const AV1_COMMON *cm, MACROBLOCKD *xd, int plane, const MB_MODE_INFO *mi,
  171|       |    int build_for_obmc, int bw, int bh, int mi_x, int mi_y) {
  172|       |#endif  // IS_DEC
  173|   294k|  const int is_compound = has_second_ref(mi);
  174|   294k|  const int is_intrabc = is_intrabc_block(mi);
  175|   294k|  assert(IMPLIES(is_intrabc, !is_compound));
  176|   294k|  struct macroblockd_plane *const pd = &xd->plane[plane];
  177|   294k|  struct buf_2d *const dst_buf = &pd->dst;
  178|   294k|  uint8_t *const dst = dst_buf->buf;
  179|       |
  180|   294k|  int is_global[2] = { 0, 0 };
  181|   588k|  for (int ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (181:21): [True: 293k, False: 294k]
  ------------------
  182|   293k|    const WarpedMotionParams *const wm = &xd->global_motion[mi->ref_frame[ref]];
  183|   293k|    is_global[ref] = is_global_mv_block(mi, wm->wmtype);
  184|   293k|  }
  185|       |
  186|   294k|  const BLOCK_SIZE bsize = mi->bsize;
  187|   294k|  const int ss_x = pd->subsampling_x;
  188|   294k|  const int ss_y = pd->subsampling_y;
  189|   294k|  const int row_start =
  190|   294k|      (block_size_high[bsize] == 4) && ss_y && !build_for_obmc ? -1 : 0;
  ------------------
  |  Branch (190:7): [True: 3.45k, False: 290k]
  |  Branch (190:40): [True: 52, False: 3.39k]
  |  Branch (190:48): [True: 52, False: 0]
  ------------------
  191|   294k|  const int col_start =
  192|   294k|      (block_size_wide[bsize] == 4) && ss_x && !build_for_obmc ? -1 : 0;
  ------------------
  |  Branch (192:7): [True: 2.62k, False: 291k]
  |  Branch (192:40): [True: 166, False: 2.45k]
  |  Branch (192:48): [True: 166, False: 0]
  ------------------
  193|   294k|  const int pre_x = (mi_x + MI_SIZE * col_start) >> ss_x;
  ------------------
  |  |   40|   294k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   294k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  194|   294k|  const int pre_y = (mi_y + MI_SIZE * row_start) >> ss_y;
  ------------------
  |  |   40|   294k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   294k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  195|       |
  196|   588k|  for (int ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (196:21): [True: 294k, False: 294k]
  ------------------
  197|   294k|    const struct scale_factors *const sf =
  198|   294k|        is_intrabc ? &cm->sf_identity : xd->block_ref_scale_factors[ref];
  ------------------
  |  Branch (198:9): [True: 0, False: 294k]
  ------------------
  199|   294k|    struct buf_2d *const pre_buf = is_intrabc ? dst_buf : &pd->pre[ref];
  ------------------
  |  Branch (199:36): [True: 0, False: 294k]
  ------------------
  200|   294k|    const MV mv = mi->mv[ref].as_mv;
  201|   294k|    const WarpTypesAllowed warp_types = { is_global[ref],
  202|   294k|                                          mi->motion_mode == WARPED_CAUSAL };
  203|       |
  204|   294k|    InterPredParams inter_pred_params;
  205|   294k|    av1_init_inter_params(&inter_pred_params, bw, bh, pre_y, pre_x,
  206|   294k|                          pd->subsampling_x, pd->subsampling_y, xd->bd,
  207|   294k|                          is_cur_buf_hbd(xd), mi->use_intrabc, sf, pre_buf,
  208|   294k|                          mi->interp_filters);
  209|   294k|    if (is_compound) av1_init_comp_mode(&inter_pred_params);
  ------------------
  |  Branch (209:9): [True: 0, False: 294k]
  ------------------
  210|   294k|    inter_pred_params.conv_params = get_conv_params_no_round(
  211|   294k|        ref, plane, xd->tmp_conv_dst, MAX_SB_SIZE, is_compound, xd->bd);
  ------------------
  |  |   32|   294k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   294k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  212|       |
  213|   294k|    av1_dist_wtd_comp_weight_assign(
  214|   294k|        cm, mi, &inter_pred_params.conv_params.fwd_offset,
  215|   294k|        &inter_pred_params.conv_params.bck_offset,
  216|   294k|        &inter_pred_params.conv_params.use_dist_wtd_comp_avg, is_compound);
  217|       |
  218|   294k|    if (!build_for_obmc)
  ------------------
  |  Branch (218:9): [True: 294k, False: 18.4E]
  ------------------
  219|   294k|      av1_init_warp_params(&inter_pred_params, &warp_types, ref, xd, mi);
  220|       |
  221|   294k|    if (is_masked_compound_type(mi->interinter_comp.type)) {
  ------------------
  |  Branch (221:9): [True: 0, False: 294k]
  ------------------
  222|      0|      inter_pred_params.sb_type = mi->bsize;
  223|      0|      inter_pred_params.mask_comp = mi->interinter_comp;
  224|      0|      if (ref == 1) {
  ------------------
  |  Branch (224:11): [True: 0, False: 0]
  ------------------
  225|      0|        inter_pred_params.conv_params.do_average = 0;
  226|      0|        inter_pred_params.comp_mode = MASK_COMP;
  227|      0|      }
  228|       |      // Assign physical buffer.
  229|      0|      inter_pred_params.mask_comp.seg_mask = xd->seg_mask;
  230|      0|    }
  231|       |
  232|   294k|#if IS_DEC
  233|   294k|    build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params, xd,
  234|   294k|                              mi_x, mi_y, ref, mc_buf);
  235|       |#else
  236|       |    build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params);
  237|       |#endif  // IS_DEC
  238|   294k|  }
  239|   294k|}
reconinter_enc.c:build_one_inter_predictor:
   26|  55.1M|    InterPredParams *inter_pred_params) {
   27|  55.1M|#endif  // IS_DEC
   28|  55.1M|  SubpelParams subpel_params;
   29|  55.1M|  uint8_t *src;
   30|  55.1M|  int src_stride;
   31|       |#if IS_DEC
   32|       |  dec_calc_subpel_params_and_extend(src_mv, inter_pred_params, xd, mi_x, mi_y,
   33|       |                                    ref, mc_buf, &src, &subpel_params,
   34|       |                                    &src_stride);
   35|       |#else
   36|  55.1M|  enc_calc_subpel_params(src_mv, inter_pred_params, &src, &subpel_params,
   37|  55.1M|                         &src_stride);
   38|  55.1M|#endif  // IS_DEC
   39|  55.1M|  if (inter_pred_params->comp_mode == UNIFORM_SINGLE ||
  ------------------
  |  Branch (39:7): [True: 55.1M, False: 0]
  ------------------
   40|  55.0M|      inter_pred_params->comp_mode == UNIFORM_COMP) {
  ------------------
  |  Branch (40:7): [True: 0, False: 0]
  ------------------
   41|  55.0M|    av1_make_inter_predictor(src, src_stride, dst, dst_stride,
   42|  55.0M|                             inter_pred_params, &subpel_params);
   43|  55.0M|  } else {
   44|  59.2k|    av1_make_masked_inter_predictor(src, src_stride, dst, dst_stride,
   45|  59.2k|                                    inter_pred_params, &subpel_params);
   46|  59.2k|  }
   47|  55.1M|}
reconinter_enc.c:build_inter_predictors:
  260|  13.5M|                                          int mi_x, int mi_y) {
  261|  13.5M|  if (is_sub8x8_inter(xd, plane, mi->bsize, is_intrabc_block(mi),
  ------------------
  |  Branch (261:7): [True: 64.2k, False: 13.4M]
  ------------------
  262|  13.5M|                      build_for_obmc)) {
  263|  64.2k|    assert(bw < 8 || bh < 8);
  264|  64.2k|    build_inter_predictors_sub8x8(cm, xd, plane, mi, mi_x, mi_y);
  265|  13.4M|  } else {
  266|  13.4M|    build_inter_predictors_8x8_and_bigger(cm, xd, plane, mi, build_for_obmc, bw,
  267|  13.4M|                                          bh, mi_x, mi_y);
  268|  13.4M|  }
  269|  13.5M|}
reconinter_enc.c:is_sub8x8_inter:
   55|  13.5M|                            int is_intrabc, int build_for_obmc) {
   56|  13.5M|  if (is_intrabc || build_for_obmc) {
  ------------------
  |  Branch (56:7): [True: 581, False: 13.5M]
  |  Branch (56:21): [True: 0, False: 13.5M]
  ------------------
   57|      0|    return false;
   58|      0|  }
   59|       |
   60|  13.5M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
   61|  13.5M|  const int ss_x = pd->subsampling_x;
   62|  13.5M|  const int ss_y = pd->subsampling_y;
   63|  13.5M|  const int is_sub4_x = (block_size_wide[bsize] == 4) && ss_x;
  ------------------
  |  Branch (63:25): [True: 1.89M, False: 11.6M]
  |  Branch (63:58): [True: 356k, False: 1.53M]
  ------------------
   64|  13.5M|  const int is_sub4_y = (block_size_high[bsize] == 4) && ss_y;
  ------------------
  |  Branch (64:25): [True: 2.07M, False: 11.4M]
  |  Branch (64:58): [True: 152k, False: 1.92M]
  ------------------
   65|  13.5M|  if (!is_sub4_x && !is_sub4_y) {
  ------------------
  |  Branch (65:7): [True: 13.2M, False: 356k]
  |  Branch (65:21): [True: 13.1M, False: 45.3k]
  ------------------
   66|  13.1M|    return false;
   67|  13.1M|  }
   68|       |
   69|       |  // For sub8x8 chroma blocks, we may be covering more than one luma block's
   70|       |  // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for
   71|       |  // the top-left corner of the prediction source - the correct top-left corner
   72|       |  // is at (pre_x, pre_y).
   73|   401k|  const int row_start = is_sub4_y ? -1 : 0;
  ------------------
  |  Branch (73:25): [True: 152k, False: 249k]
  ------------------
   74|   401k|  const int col_start = is_sub4_x ? -1 : 0;
  ------------------
  |  Branch (74:25): [True: 356k, False: 45.0k]
  ------------------
   75|       |
   76|   487k|  for (int row = row_start; row <= 0; ++row) {
  ------------------
  |  Branch (76:29): [True: 422k, False: 64.4k]
  ------------------
   77|   582k|    for (int col = col_start; col <= 0; ++col) {
  ------------------
  |  Branch (77:31): [True: 496k, False: 86.0k]
  ------------------
   78|   496k|      const MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col];
   79|   496k|      if (!is_inter_block(this_mbmi)) return false;
  ------------------
  |  Branch (79:11): [True: 336k, False: 160k]
  ------------------
   80|   160k|      if (is_intrabc_block(this_mbmi)) return false;
  ------------------
  |  Branch (80:11): [True: 0, False: 160k]
  ------------------
   81|   160k|    }
   82|   422k|  }
   83|  64.4k|  return true;
   84|   401k|}
reconinter_enc.c:build_inter_predictors_sub8x8:
   96|  64.2k|                                                 int mi_x, int mi_y) {
   97|  64.2k|#endif  // IS_DEC
   98|  64.2k|  const BLOCK_SIZE bsize = mi->bsize;
   99|  64.2k|  struct macroblockd_plane *const pd = &xd->plane[plane];
  100|  64.2k|  const bool ss_x = pd->subsampling_x;
  101|  64.2k|  const bool ss_y = pd->subsampling_y;
  102|  64.2k|  const int b4_w = block_size_wide[bsize] >> ss_x;
  103|  64.2k|  const int b4_h = block_size_high[bsize] >> ss_y;
  104|  64.2k|  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
  105|  64.2k|  const int b8_w = block_size_wide[plane_bsize];
  106|  64.2k|  const int b8_h = block_size_high[plane_bsize];
  107|  64.2k|  const int is_compound = has_second_ref(mi);
  108|  64.2k|  assert(!is_compound);
  109|  64.2k|  assert(!is_intrabc_block(mi));
  110|       |
  111|       |  // For sub8x8 chroma blocks, we may be covering more than one luma block's
  112|       |  // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for
  113|       |  // the top-left corner of the prediction source - the correct top-left corner
  114|       |  // is at (pre_x, pre_y).
  115|  64.2k|  const int row_start = (block_size_high[bsize] == 4) && ss_y ? -1 : 0;
  ------------------
  |  Branch (115:25): [True: 54.5k, False: 9.69k]
  |  Branch (115:58): [True: 20.3k, False: 34.1k]
  ------------------
  116|  64.2k|  const int col_start = (block_size_wide[bsize] == 4) && ss_x ? -1 : 0;
  ------------------
  |  Branch (116:25): [True: 56.4k, False: 7.75k]
  |  Branch (116:58): [True: 56.4k, False: 0]
  ------------------
  117|  64.2k|  const int pre_x = (mi_x + MI_SIZE * col_start) >> ss_x;
  ------------------
  |  |   40|  64.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  64.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  118|  64.2k|  const int pre_y = (mi_y + MI_SIZE * row_start) >> ss_y;
  ------------------
  |  |   40|  64.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  64.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  119|       |
  120|  64.2k|  int row = row_start;
  121|   148k|  for (int y = 0; y < b8_h; y += b4_h) {
  ------------------
  |  Branch (121:19): [True: 84.6k, False: 64.2k]
  ------------------
  122|  84.6k|    int col = col_start;
  123|   238k|    for (int x = 0; x < b8_w; x += b4_w) {
  ------------------
  |  Branch (123:21): [True: 153k, False: 84.6k]
  ------------------
  124|   153k|      MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col];
  125|   153k|      struct buf_2d *const dst_buf = &pd->dst;
  126|   153k|      uint8_t *dst = dst_buf->buf + dst_buf->stride * y + x;
  127|   153k|      int ref = 0;
  128|   153k|      const RefCntBuffer *ref_buf =
  129|   153k|          get_ref_frame_buf(cm, this_mbmi->ref_frame[ref]);
  130|   153k|      const struct scale_factors *ref_scale_factors =
  131|   153k|          get_ref_scale_factors_const(cm, this_mbmi->ref_frame[ref]);
  132|   153k|      const struct scale_factors *const sf = ref_scale_factors;
  133|   153k|      const struct buf_2d pre_buf = {
  134|   153k|        NULL,
  135|   153k|        (plane == 1) ? ref_buf->buf.u_buffer : ref_buf->buf.v_buffer,
  ------------------
  |  Branch (135:9): [True: 76.8k, False: 76.8k]
  ------------------
  136|   153k|        ref_buf->buf.uv_crop_width,
  137|   153k|        ref_buf->buf.uv_crop_height,
  138|   153k|        ref_buf->buf.uv_stride,
  139|   153k|      };
  140|       |
  141|   153k|      const MV mv = this_mbmi->mv[ref].as_mv;
  142|       |
  143|   153k|      InterPredParams inter_pred_params;
  144|   153k|      av1_init_inter_params(&inter_pred_params, b4_w, b4_h, pre_y + y,
  145|   153k|                            pre_x + x, pd->subsampling_x, pd->subsampling_y,
  146|   153k|                            xd->bd, is_cur_buf_hbd(xd), mi->use_intrabc, sf,
  147|   153k|                            &pre_buf, this_mbmi->interp_filters);
  148|   153k|      inter_pred_params.conv_params =
  149|   153k|          get_conv_params_no_round(ref, plane, NULL, 0, is_compound, xd->bd);
  150|       |
  151|       |#if IS_DEC
  152|       |      build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params,
  153|       |                                xd, mi_x + x, mi_y + y, ref, mc_buf);
  154|       |#else
  155|   153k|      build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params);
  156|   153k|#endif  // IS_DEC
  157|       |
  158|   153k|      ++col;
  159|   153k|    }
  160|  84.6k|    ++row;
  161|  84.6k|  }
  162|  64.2k|}
reconinter_enc.c:build_inter_predictors_8x8_and_bigger:
  171|  13.4M|    int build_for_obmc, int bw, int bh, int mi_x, int mi_y) {
  172|  13.4M|#endif  // IS_DEC
  173|  13.4M|  const int is_compound = has_second_ref(mi);
  174|  13.4M|  const int is_intrabc = is_intrabc_block(mi);
  175|  13.4M|  assert(IMPLIES(is_intrabc, !is_compound));
  176|  13.4M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  177|  13.4M|  struct buf_2d *const dst_buf = &pd->dst;
  178|  13.4M|  uint8_t *const dst = dst_buf->buf;
  179|       |
  180|  13.4M|  int is_global[2] = { 0, 0 };
  181|  26.9M|  for (int ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (181:21): [True: 13.4M, False: 13.4M]
  ------------------
  182|  13.4M|    const WarpedMotionParams *const wm = &xd->global_motion[mi->ref_frame[ref]];
  183|  13.4M|    is_global[ref] = is_global_mv_block(mi, wm->wmtype);
  184|  13.4M|  }
  185|       |
  186|  13.4M|  const BLOCK_SIZE bsize = mi->bsize;
  187|  13.4M|  const int ss_x = pd->subsampling_x;
  188|  13.4M|  const int ss_y = pd->subsampling_y;
  189|  13.4M|  const int row_start =
  190|  13.4M|      (block_size_high[bsize] == 4) && ss_y && !build_for_obmc ? -1 : 0;
  ------------------
  |  Branch (190:7): [True: 2.02M, False: 11.4M]
  |  Branch (190:40): [True: 131k, False: 1.88M]
  |  Branch (190:48): [True: 131k, False: 0]
  ------------------
  191|  13.4M|  const int col_start =
  192|  13.4M|      (block_size_wide[bsize] == 4) && ss_x && !build_for_obmc ? -1 : 0;
  ------------------
  |  Branch (192:7): [True: 1.83M, False: 11.6M]
  |  Branch (192:40): [True: 299k, False: 1.53M]
  |  Branch (192:48): [True: 299k, False: 0]
  ------------------
  193|  13.4M|  const int pre_x = (mi_x + MI_SIZE * col_start) >> ss_x;
  ------------------
  |  |   40|  13.4M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  13.4M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  194|  13.4M|  const int pre_y = (mi_y + MI_SIZE * row_start) >> ss_y;
  ------------------
  |  |   40|  13.4M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  13.4M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  195|       |
  196|  26.9M|  for (int ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (196:21): [True: 13.4M, False: 13.4M]
  ------------------
  197|  13.4M|    const struct scale_factors *const sf =
  198|  13.4M|        is_intrabc ? &cm->sf_identity : xd->block_ref_scale_factors[ref];
  ------------------
  |  Branch (198:9): [True: 0, False: 13.4M]
  ------------------
  199|  13.4M|    struct buf_2d *const pre_buf = is_intrabc ? dst_buf : &pd->pre[ref];
  ------------------
  |  Branch (199:36): [True: 0, False: 13.4M]
  ------------------
  200|  13.4M|    const MV mv = mi->mv[ref].as_mv;
  201|  13.4M|    const WarpTypesAllowed warp_types = { is_global[ref],
  202|  13.4M|                                          mi->motion_mode == WARPED_CAUSAL };
  203|       |
  204|  13.4M|    InterPredParams inter_pred_params;
  205|  13.4M|    av1_init_inter_params(&inter_pred_params, bw, bh, pre_y, pre_x,
  206|  13.4M|                          pd->subsampling_x, pd->subsampling_y, xd->bd,
  207|  13.4M|                          is_cur_buf_hbd(xd), mi->use_intrabc, sf, pre_buf,
  208|  13.4M|                          mi->interp_filters);
  209|  13.4M|    if (is_compound) av1_init_comp_mode(&inter_pred_params);
  ------------------
  |  Branch (209:9): [True: 0, False: 13.4M]
  ------------------
  210|  13.4M|    inter_pred_params.conv_params = get_conv_params_no_round(
  211|  13.4M|        ref, plane, xd->tmp_conv_dst, MAX_SB_SIZE, is_compound, xd->bd);
  ------------------
  |  |   32|  13.4M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  13.4M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  212|       |
  213|  13.4M|    av1_dist_wtd_comp_weight_assign(
  214|  13.4M|        cm, mi, &inter_pred_params.conv_params.fwd_offset,
  215|  13.4M|        &inter_pred_params.conv_params.bck_offset,
  216|  13.4M|        &inter_pred_params.conv_params.use_dist_wtd_comp_avg, is_compound);
  217|       |
  218|  13.4M|    if (!build_for_obmc)
  ------------------
  |  Branch (218:9): [True: 13.5M, False: 18.4E]
  ------------------
  219|  13.5M|      av1_init_warp_params(&inter_pred_params, &warp_types, ref, xd, mi);
  220|       |
  221|  13.4M|    if (is_masked_compound_type(mi->interinter_comp.type)) {
  ------------------
  |  Branch (221:9): [True: 0, False: 13.4M]
  ------------------
  222|      0|      inter_pred_params.sb_type = mi->bsize;
  223|      0|      inter_pred_params.mask_comp = mi->interinter_comp;
  224|      0|      if (ref == 1) {
  ------------------
  |  Branch (224:11): [True: 0, False: 0]
  ------------------
  225|      0|        inter_pred_params.conv_params.do_average = 0;
  226|      0|        inter_pred_params.comp_mode = MASK_COMP;
  227|      0|      }
  228|       |      // Assign physical buffer.
  229|      0|      inter_pred_params.mask_comp.seg_mask = xd->seg_mask;
  230|      0|    }
  231|       |
  232|       |#if IS_DEC
  233|       |    build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params, xd,
  234|       |                              mi_x, mi_y, ref, mc_buf);
  235|       |#else
  236|  13.4M|    build_one_inter_predictor(dst, dst_buf->stride, &mv, &inter_pred_params);
  237|  13.4M|#endif  // IS_DEC
  238|  13.4M|  }
  239|  13.4M|}

av1_predict_intra_block:
 1695|  87.7M|                             int plane) {
 1696|  87.7M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1697|  87.7M|  const int txwpx = tx_size_wide[tx_size];
 1698|  87.7M|  const int txhpx = tx_size_high[tx_size];
 1699|  87.7M|  const int x = col_off << MI_SIZE_LOG2;
  ------------------
  |  |   39|  87.7M|#define MI_SIZE_LOG2 2
  ------------------
 1700|  87.7M|  const int y = row_off << MI_SIZE_LOG2;
  ------------------
  |  |   39|  87.7M|#define MI_SIZE_LOG2 2
  ------------------
 1701|  87.7M|  const int is_hbd = is_cur_buf_hbd(xd);
 1702|       |
 1703|  87.7M|  assert(mode < INTRA_MODES);
 1704|       |
 1705|  87.7M|  if (use_palette) {
  ------------------
  |  Branch (1705:7): [True: 3.66M, False: 84.0M]
  ------------------
 1706|  3.66M|    int r, c;
 1707|  3.66M|    const uint8_t *const map = xd->plane[plane != 0].color_index_map +
 1708|  3.66M|                               xd->color_index_map_offset[plane != 0];
 1709|  3.66M|    const uint16_t *const palette =
 1710|  3.66M|        mbmi->palette_mode_info.palette_colors + plane * PALETTE_MAX_SIZE;
  ------------------
  |  |   63|  3.66M|#define PALETTE_MAX_SIZE 8
  ------------------
 1711|  3.66M|    if (is_hbd) {
  ------------------
  |  Branch (1711:9): [True: 3.66M, False: 18.4E]
  ------------------
 1712|  3.66M|      uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
  ------------------
  |  |   79|  3.66M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1713|  23.5M|      for (r = 0; r < txhpx; ++r) {
  ------------------
  |  Branch (1713:19): [True: 19.9M, False: 3.66M]
  ------------------
 1714|   135M|        for (c = 0; c < txwpx; ++c) {
  ------------------
  |  Branch (1714:21): [True: 115M, False: 19.9M]
  ------------------
 1715|   115M|          dst16[r * dst_stride + c] = palette[map[(r + y) * wpx + c + x]];
 1716|   115M|        }
 1717|  19.9M|      }
 1718|  18.4E|    } else {
 1719|  18.4E|      for (r = 0; r < txhpx; ++r) {
  ------------------
  |  Branch (1719:19): [True: 0, False: 18.4E]
  ------------------
 1720|      0|        for (c = 0; c < txwpx; ++c) {
  ------------------
  |  Branch (1720:21): [True: 0, False: 0]
  ------------------
 1721|      0|          dst[r * dst_stride + c] =
 1722|      0|              (uint8_t)palette[map[(r + y) * wpx + c + x]];
 1723|      0|        }
 1724|      0|      }
 1725|  18.4E|    }
 1726|  3.66M|    return;
 1727|  3.66M|  }
 1728|       |
 1729|  84.0M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1730|  84.0M|  const int ss_x = pd->subsampling_x;
 1731|  84.0M|  const int ss_y = pd->subsampling_y;
 1732|  84.0M|  const int have_top =
 1733|  84.0M|      row_off || (ss_y ? xd->chroma_up_available : xd->up_available);
  ------------------
  |  Branch (1733:7): [True: 8.56M, False: 75.5M]
  |  Branch (1733:18): [True: 56.1M, False: 19.3M]
  |  Branch (1733:19): [True: 12.2M, False: 63.2M]
  ------------------
 1734|  84.0M|  const int have_left =
 1735|  84.0M|      col_off || (ss_x ? xd->chroma_left_available : xd->left_available);
  ------------------
  |  Branch (1735:7): [True: 8.66M, False: 75.4M]
  |  Branch (1735:18): [True: 56.3M, False: 19.0M]
  |  Branch (1735:19): [True: 18.5M, False: 56.8M]
  ------------------
 1736|       |
 1737|       |  // Distance between the right edge of this prediction block to
 1738|       |  // the frame right edge
 1739|  84.0M|  const int xr = (xd->mb_to_right_edge >> (3 + ss_x)) + wpx - x - txwpx;
 1740|       |  // Distance between the bottom edge of this prediction block to
 1741|       |  // the frame bottom edge
 1742|  84.0M|  const int yd = (xd->mb_to_bottom_edge >> (3 + ss_y)) + hpx - y - txhpx;
 1743|  84.0M|  const int use_filter_intra = filter_intra_mode != FILTER_INTRA_MODES;
 1744|  84.0M|  const int is_dr_mode = av1_is_directional_mode(mode);
 1745|       |
 1746|       |  // The computations in this function, as well as in build_intra_predictors(),
 1747|       |  // are generalized for all intra modes. Some of these operations are not
 1748|       |  // required since non-directional intra modes (i.e., DC, SMOOTH, SMOOTH_H,
 1749|       |  // SMOOTH_V, and PAETH) specifically require left and top neighbors. Hence, a
 1750|       |  // separate function build_non_directional_intra_predictors() is introduced
 1751|       |  // for these modes to avoid redundant computations while generating pred data.
 1752|       |
 1753|  84.0M|  const int n_top_px = have_top ? AOMMIN(txwpx, xr + txwpx) : 0;
  ------------------
  |  |   34|  64.8M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 54.3M, False: 10.4M]
  |  |  ------------------
  ------------------
  |  Branch (1753:24): [True: 64.8M, False: 19.2M]
  ------------------
 1754|  84.0M|  const int n_left_px = have_left ? AOMMIN(txhpx, yd + txhpx) : 0;
  ------------------
  |  |   34|  65.1M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 55.1M, False: 9.98M]
  |  |  ------------------
  ------------------
  |  Branch (1754:25): [True: 65.1M, False: 18.9M]
  ------------------
 1755|  84.0M|  if (!use_filter_intra && !is_dr_mode) {
  ------------------
  |  Branch (1755:7): [True: 62.7M, False: 21.3M]
  |  Branch (1755:28): [True: 36.5M, False: 26.1M]
  ------------------
 1756|  36.5M|#if CONFIG_AV1_HIGHBITDEPTH
 1757|  36.5M|    if (is_hbd) {
  ------------------
  |  Branch (1757:9): [True: 8.22M, False: 28.3M]
  ------------------
 1758|  8.22M|      highbd_build_non_directional_intra_predictors(
 1759|  8.22M|          ref, ref_stride, dst, dst_stride, mode, tx_size, n_top_px, n_left_px,
 1760|  8.22M|          xd->bd);
 1761|  8.22M|      return;
 1762|  8.22M|    }
 1763|  28.3M|#endif  // CONFIG_AV1_HIGHBITDEPTH
 1764|  28.3M|    build_non_directional_intra_predictors(ref, ref_stride, dst, dst_stride,
 1765|  28.3M|                                           mode, tx_size, n_top_px, n_left_px);
 1766|  28.3M|    return;
 1767|  36.5M|  }
 1768|       |
 1769|  47.5M|  const int txw = tx_size_wide_unit[tx_size];
 1770|  47.5M|  const int txh = tx_size_high_unit[tx_size];
 1771|  47.5M|  const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
  ------------------
  |  |   39|  47.5M|#define MI_SIZE_LOG2 2
  ------------------
 1772|  47.5M|  const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2);
  ------------------
  |  |   39|  47.5M|#define MI_SIZE_LOG2 2
  ------------------
 1773|  47.5M|  const int right_available =
 1774|  47.5M|      mi_col + ((col_off + txw) << ss_x) < xd->tile.mi_col_end;
 1775|  47.5M|  const int bottom_available =
 1776|  47.5M|      (yd > 0) && (mi_row + ((row_off + txh) << ss_y) < xd->tile.mi_row_end);
  ------------------
  |  Branch (1776:7): [True: 39.1M, False: 8.36M]
  |  Branch (1776:19): [True: 37.4M, False: 1.72M]
  ------------------
 1777|       |
 1778|  47.5M|  const PARTITION_TYPE partition = mbmi->partition;
 1779|       |
 1780|  47.5M|  BLOCK_SIZE bsize = mbmi->bsize;
 1781|       |  // force 4x4 chroma component block size.
 1782|  47.5M|  if (ss_x || ss_y) {
  ------------------
  |  Branch (1782:7): [True: 5.23M, False: 42.2M]
  |  Branch (1782:15): [True: 18.4E, False: 42.2M]
  ------------------
 1783|  5.48M|    bsize = scale_chroma_bsize(bsize, ss_x, ss_y);
 1784|  5.48M|  }
 1785|       |
 1786|  47.5M|  int p_angle = 0;
 1787|  47.5M|  int need_top_right = extend_modes[mode] & NEED_ABOVERIGHT;
 1788|  47.5M|  int need_bottom_left = extend_modes[mode] & NEED_BOTTOMLEFT;
 1789|       |
 1790|  47.5M|  if (use_filter_intra) {
  ------------------
  |  Branch (1790:7): [True: 21.5M, False: 25.9M]
  ------------------
 1791|  21.5M|    need_top_right = 0;
 1792|  21.5M|    need_bottom_left = 0;
 1793|  21.5M|  }
 1794|  47.5M|  if (is_dr_mode) {
  ------------------
  |  Branch (1794:7): [True: 26.2M, False: 21.2M]
  ------------------
 1795|  26.2M|    p_angle = mode_to_angle_map[mode] + angle_delta;
 1796|  26.2M|    need_top_right = p_angle < 90;
 1797|  26.2M|    need_bottom_left = p_angle > 180;
 1798|  26.2M|  }
 1799|       |
 1800|       |  // Possible states for have_top_right(TR) and have_bottom_left(BL)
 1801|       |  // -1 : TR and BL are not needed
 1802|       |  //  0 : TR and BL are needed but not available
 1803|       |  // > 0 : TR and BL are needed and pixels are available
 1804|  47.5M|  const int have_top_right =
 1805|  47.5M|      need_top_right ? has_top_right(sb_size, bsize, mi_row, mi_col, have_top,
  ------------------
  |  Branch (1805:7): [True: 5.65M, False: 41.8M]
  ------------------
 1806|  5.65M|                                     right_available, partition, tx_size,
 1807|  5.65M|                                     row_off, col_off, ss_x, ss_y)
 1808|  47.5M|                     : -1;
 1809|  47.5M|  const int have_bottom_left =
 1810|  47.5M|      need_bottom_left ? has_bottom_left(sb_size, bsize, mi_row, mi_col,
  ------------------
  |  Branch (1810:7): [True: 5.35M, False: 42.1M]
  ------------------
 1811|  5.35M|                                         bottom_available, have_left, partition,
 1812|  5.35M|                                         tx_size, row_off, col_off, ss_x, ss_y)
 1813|  47.5M|                       : -1;
 1814|       |
 1815|  47.5M|  const int disable_edge_filter = !enable_intra_edge_filter;
 1816|  47.5M|  const int intra_edge_filter_type = get_intra_edge_filter_type(xd, plane);
 1817|  47.5M|  const int n_topright_px =
 1818|  47.5M|      have_top_right > 0 ? AOMMIN(txwpx, xr) : have_top_right;
  ------------------
  |  |   34|  2.31M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.84M, False: 471k]
  |  |  ------------------
  ------------------
  |  Branch (1818:7): [True: 2.31M, False: 45.1M]
  ------------------
 1819|  47.5M|  const int n_bottomleft_px =
 1820|  47.5M|      have_bottom_left > 0 ? AOMMIN(txhpx, yd) : have_bottom_left;
  ------------------
  |  |   34|  1.06M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 860k, False: 204k]
  |  |  ------------------
  ------------------
  |  Branch (1820:7): [True: 1.06M, False: 46.4M]
  ------------------
 1821|  47.5M|#if CONFIG_AV1_HIGHBITDEPTH
 1822|  47.5M|  if (is_hbd) {
  ------------------
  |  Branch (1822:7): [True: 16.1M, False: 31.3M]
  ------------------
 1823|  16.1M|    highbd_build_directional_and_filter_intra_predictors(
 1824|  16.1M|        ref, ref_stride, dst, dst_stride, mode, p_angle, filter_intra_mode,
 1825|  16.1M|        tx_size, disable_edge_filter, n_top_px, n_topright_px, n_left_px,
 1826|  16.1M|        n_bottomleft_px, intra_edge_filter_type, xd->bd);
 1827|  16.1M|    return;
 1828|  16.1M|  }
 1829|  31.3M|#endif
 1830|  31.3M|  build_directional_and_filter_intra_predictors(
 1831|  31.3M|      ref, ref_stride, dst, dst_stride, mode, p_angle, filter_intra_mode,
 1832|  31.3M|      tx_size, disable_edge_filter, n_top_px, n_topright_px, n_left_px,
 1833|  31.3M|      n_bottomleft_px, intra_edge_filter_type);
 1834|  31.3M|}
av1_predict_intra_block_facade:
 1838|   104M|                                    TX_SIZE tx_size) {
 1839|   104M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1840|   104M|  struct macroblockd_plane *const pd = &xd->plane[plane];
 1841|   104M|  const int dst_stride = pd->dst.stride;
 1842|   104M|  uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|   104M|#define MI_SIZE_LOG2 2
  ------------------
 1843|   104M|  const PREDICTION_MODE mode =
 1844|   104M|      (plane == AOM_PLANE_Y) ? mbmi->mode : get_uv_mode(mbmi->uv_mode);
  ------------------
  |  |  281|   104M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (1844:7): [True: 60.3M, False: 44.0M]
  ------------------
 1845|   104M|  const int use_palette = mbmi->palette_mode_info.palette_size[plane != 0] > 0;
 1846|   104M|  const FILTER_INTRA_MODE filter_intra_mode =
 1847|   104M|      (plane == AOM_PLANE_Y && mbmi->filter_intra_mode_info.use_filter_intra)
  ------------------
  |  |  281|   208M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (1847:8): [True: 60.3M, False: 44.0M]
  |  Branch (1847:32): [True: 21.5M, False: 38.8M]
  ------------------
 1848|   104M|          ? mbmi->filter_intra_mode_info.filter_intra_mode
 1849|   104M|          : FILTER_INTRA_MODES;
 1850|   104M|  const int angle_delta = mbmi->angle_delta[plane != AOM_PLANE_Y] * ANGLE_STEP;
  ------------------
  |  |  281|   104M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                const int angle_delta = mbmi->angle_delta[plane != AOM_PLANE_Y] * ANGLE_STEP;
  ------------------
  |  |  468|   104M|#define ANGLE_STEP 3
  ------------------
 1851|   104M|  const SequenceHeader *seq_params = cm->seq_params;
 1852|       |
 1853|   104M|#if !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 1854|   104M|  if (plane != AOM_PLANE_Y && mbmi->uv_mode == UV_CFL_PRED) {
  ------------------
  |  |  281|   208M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (1854:7): [True: 44.3M, False: 60.0M]
  |  Branch (1854:31): [True: 22.4M, False: 21.9M]
  ------------------
 1855|       |#if CONFIG_DEBUG
 1856|       |    assert(is_cfl_allowed(xd));
 1857|       |    const BLOCK_SIZE plane_bsize =
 1858|       |        get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
 1859|       |    (void)plane_bsize;
 1860|       |    assert(plane_bsize < BLOCK_SIZES_ALL);
 1861|       |    if (!xd->lossless[mbmi->segment_id]) {
 1862|       |      assert(blk_col == 0);
 1863|       |      assert(blk_row == 0);
 1864|       |      assert(block_size_wide[plane_bsize] == tx_size_wide[tx_size]);
 1865|       |      assert(block_size_high[plane_bsize] == tx_size_high[tx_size]);
 1866|       |    }
 1867|       |#endif
 1868|  22.4M|    CFL_CTX *const cfl = &xd->cfl;
 1869|  22.4M|    CFL_PRED_TYPE pred_plane = get_cfl_pred_type(plane);
 1870|  22.4M|    if (!cfl->dc_pred_is_cached[pred_plane]) {
  ------------------
  |  Branch (1870:9): [True: 4.08M, False: 18.3M]
  ------------------
 1871|  4.08M|      av1_predict_intra_block(xd, seq_params->sb_size,
 1872|  4.08M|                              seq_params->enable_intra_edge_filter, pd->width,
 1873|  4.08M|                              pd->height, tx_size, mode, angle_delta,
 1874|  4.08M|                              use_palette, filter_intra_mode, dst, dst_stride,
 1875|  4.08M|                              dst, dst_stride, blk_col, blk_row, plane);
 1876|  4.08M|      if (cfl->use_dc_pred_cache) {
  ------------------
  |  Branch (1876:11): [True: 1.84M, False: 2.24M]
  ------------------
 1877|  1.84M|        cfl_store_dc_pred(xd, dst, pred_plane, tx_size_wide[tx_size]);
 1878|  1.84M|        cfl->dc_pred_is_cached[pred_plane] = true;
 1879|  1.84M|      }
 1880|  18.3M|    } else {
 1881|  18.3M|      cfl_load_dc_pred(xd, dst, dst_stride, tx_size, pred_plane);
 1882|  18.3M|    }
 1883|  22.4M|    av1_cfl_predict_block(xd, dst, dst_stride, tx_size, plane);
 1884|  22.4M|    return;
 1885|  22.4M|  }
 1886|  81.9M|#endif  // !CONFIG_REALTIME_ONLY || CONFIG_AV1_DECODER
 1887|  81.9M|  av1_predict_intra_block(
 1888|  81.9M|      xd, seq_params->sb_size, seq_params->enable_intra_edge_filter, pd->width,
 1889|  81.9M|      pd->height, tx_size, mode, angle_delta, use_palette, filter_intra_mode,
 1890|  81.9M|      dst, dst_stride, dst, dst_stride, blk_col, blk_row, plane);
 1891|  81.9M|}
av1_init_intra_predictors:
 1893|  25.4k|void av1_init_intra_predictors(void) {
 1894|  25.4k|  aom_once(init_intra_predictors_internal);
 1895|  25.4k|}
reconintra.c:highbd_build_non_directional_intra_predictors:
 1557|  8.22M|    int bit_depth) {
 1558|  8.22M|  int i = 0;
 1559|  8.22M|  uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  8.22M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1560|  8.22M|  const uint16_t *const ref = CONVERT_TO_SHORTPTR(ref8);
  ------------------
  |  |   79|  8.22M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1561|  8.22M|  const int txwpx = tx_size_wide[tx_size];
 1562|  8.22M|  const int txhpx = tx_size_high[tx_size];
 1563|  8.22M|  int need_left = extend_modes[mode] & NEED_LEFT;
 1564|  8.22M|  int need_above = extend_modes[mode] & NEED_ABOVE;
 1565|  8.22M|  int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
 1566|  8.22M|  const uint16_t *above_ref = ref - ref_stride;
 1567|  8.22M|  const uint16_t *left_ref = ref - 1;
 1568|  8.22M|  const int base = 128 << (bit_depth - 8);
 1569|       |
 1570|  8.22M|  assert(n_top_px >= 0);
 1571|  8.22M|  assert(n_left_px >= 0);
 1572|  8.22M|  assert(mode == DC_PRED || mode == SMOOTH_PRED || mode == SMOOTH_V_PRED ||
 1573|  8.22M|         mode == SMOOTH_H_PRED || mode == PAETH_PRED);
 1574|       |
 1575|  8.22M|  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
  ------------------
  |  Branch (1575:8): [True: 0, False: 8.22M]
  |  Branch (1575:23): [True: 0, False: 0]
  |  Branch (1575:43): [True: 0, False: 8.22M]
  |  Branch (1575:57): [True: 0, False: 0]
  ------------------
 1576|      0|    int val = 0;
 1577|      0|    if (need_left) {
  ------------------
  |  Branch (1577:9): [True: 0, False: 0]
  ------------------
 1578|      0|      val = (n_top_px > 0) ? above_ref[0] : base + 1;
  ------------------
  |  Branch (1578:13): [True: 0, False: 0]
  ------------------
 1579|      0|    } else {
 1580|      0|      val = (n_left_px > 0) ? left_ref[0] : base - 1;
  ------------------
  |  Branch (1580:13): [True: 0, False: 0]
  ------------------
 1581|      0|    }
 1582|      0|    for (i = 0; i < txhpx; ++i) {
  ------------------
  |  Branch (1582:17): [True: 0, False: 0]
  ------------------
 1583|      0|      aom_memset16(dst, val, txwpx);
 1584|      0|      dst += dst_stride;
 1585|      0|    }
 1586|      0|    return;
 1587|      0|  }
 1588|       |
 1589|  8.22M|  DECLARE_ALIGNED(16, uint16_t, left_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  8.22M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1590|  8.22M|  DECLARE_ALIGNED(16, uint16_t, above_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  8.22M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1591|  8.22M|  uint16_t *const above_row = above_data + 16;
 1592|  8.22M|  uint16_t *const left_col = left_data + 16;
 1593|       |
 1594|  8.22M|  if (need_left) {
  ------------------
  |  Branch (1594:7): [True: 8.22M, False: 1.21k]
  ------------------
 1595|  8.22M|    aom_memset16(left_data, base + 1, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  8.22M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  8.22M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  8.22M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1596|  8.22M|    if (n_left_px > 0) {
  ------------------
  |  Branch (1596:9): [True: 5.51M, False: 2.71M]
  ------------------
 1597|  34.0M|      for (i = 0; i < n_left_px; i++) left_col[i] = left_ref[i * ref_stride];
  ------------------
  |  Branch (1597:19): [True: 28.5M, False: 5.51M]
  ------------------
 1598|  5.51M|      if (i < txhpx) aom_memset16(&left_col[i], left_col[i - 1], txhpx - i);
  ------------------
  |  Branch (1598:11): [True: 11.5k, False: 5.50M]
  ------------------
 1599|  5.51M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1599:16): [True: 1.96M, False: 747k]
  ------------------
 1600|  1.96M|      aom_memset16(left_col, above_ref[0], txhpx);
 1601|  1.96M|    }
 1602|  8.22M|  }
 1603|       |
 1604|  8.22M|  if (need_above) {
  ------------------
  |  Branch (1604:7): [True: 8.22M, False: 18.4E]
  ------------------
 1605|  8.22M|    aom_memset16(above_data, base - 1, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  8.22M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  8.22M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  8.22M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|  8.22M|    if (n_top_px > 0) {
  ------------------
  |  Branch (1606:9): [True: 5.49M, False: 2.72M]
  ------------------
 1607|  5.49M|      memcpy(above_row, above_ref, n_top_px * sizeof(above_ref[0]));
 1608|  5.49M|      i = n_top_px;
 1609|  5.49M|      if (i < txwpx) aom_memset16(&above_row[i], above_row[i - 1], (txwpx - i));
  ------------------
  |  Branch (1609:11): [True: 8.97k, False: 5.48M]
  ------------------
 1610|  5.49M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1610:16): [True: 1.98M, False: 747k]
  ------------------
 1611|  1.98M|      aom_memset16(above_row, left_ref[0], txwpx);
 1612|  1.98M|    }
 1613|  8.22M|  }
 1614|       |
 1615|  8.22M|  if (need_above_left) {
  ------------------
  |  Branch (1615:7): [True: 1.93M, False: 6.28M]
  ------------------
 1616|  1.93M|    if (n_top_px > 0 && n_left_px > 0) {
  ------------------
  |  Branch (1616:9): [True: 1.30M, False: 631k]
  |  Branch (1616:25): [True: 855k, False: 449k]
  ------------------
 1617|   855k|      above_row[-1] = above_ref[-1];
 1618|  1.08M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1618:16): [True: 449k, False: 631k]
  ------------------
 1619|   449k|      above_row[-1] = above_ref[0];
 1620|   631k|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1620:16): [True: 450k, False: 181k]
  ------------------
 1621|   450k|      above_row[-1] = left_ref[0];
 1622|   450k|    } else {
 1623|   181k|      above_row[-1] = base;
 1624|   181k|    }
 1625|  1.93M|    left_col[-1] = above_row[-1];
 1626|  1.93M|  }
 1627|       |
 1628|  8.22M|  if (mode == DC_PRED) {
  ------------------
  |  Branch (1628:7): [True: 4.45M, False: 3.76M]
  ------------------
 1629|  4.45M|    dc_pred_high[n_left_px > 0][n_top_px > 0][tx_size](
 1630|  4.45M|        dst, dst_stride, above_row, left_col, bit_depth);
 1631|  4.45M|  } else {
 1632|  3.76M|    pred_high[mode][tx_size](dst, dst_stride, above_row, left_col, bit_depth);
 1633|  3.76M|  }
 1634|  8.22M|}
reconintra.c:build_non_directional_intra_predictors:
 1250|  28.3M|    PREDICTION_MODE mode, TX_SIZE tx_size, int n_top_px, int n_left_px) {
 1251|  28.3M|  const uint8_t *above_ref = ref - ref_stride;
 1252|  28.3M|  const uint8_t *left_ref = ref - 1;
 1253|  28.3M|  const int txwpx = tx_size_wide[tx_size];
 1254|  28.3M|  const int txhpx = tx_size_high[tx_size];
 1255|  28.3M|  const int need_left = extend_modes[mode] & NEED_LEFT;
 1256|  28.3M|  const int need_above = extend_modes[mode] & NEED_ABOVE;
 1257|  28.3M|  const int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
 1258|  28.3M|  int i = 0;
 1259|  28.3M|  assert(n_top_px >= 0);
 1260|  28.3M|  assert(n_left_px >= 0);
 1261|  28.3M|  assert(mode == DC_PRED || mode == SMOOTH_PRED || mode == SMOOTH_V_PRED ||
 1262|  28.3M|         mode == SMOOTH_H_PRED || mode == PAETH_PRED);
 1263|       |
 1264|  28.3M|  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
  ------------------
  |  Branch (1264:8): [True: 0, False: 28.3M]
  |  Branch (1264:23): [True: 0, False: 0]
  |  Branch (1264:43): [True: 0, False: 28.3M]
  |  Branch (1264:57): [True: 0, False: 0]
  ------------------
 1265|      0|    int val = 0;
 1266|      0|    if (need_left) {
  ------------------
  |  Branch (1266:9): [True: 0, False: 0]
  ------------------
 1267|      0|      val = (n_top_px > 0) ? above_ref[0] : 129;
  ------------------
  |  Branch (1267:13): [True: 0, False: 0]
  ------------------
 1268|      0|    } else {
 1269|      0|      val = (n_left_px > 0) ? left_ref[0] : 127;
  ------------------
  |  Branch (1269:13): [True: 0, False: 0]
  ------------------
 1270|      0|    }
 1271|      0|    for (i = 0; i < txhpx; ++i) {
  ------------------
  |  Branch (1271:17): [True: 0, False: 0]
  ------------------
 1272|      0|      memset(dst, val, txwpx);
 1273|      0|      dst += dst_stride;
 1274|      0|    }
 1275|      0|    return;
 1276|      0|  }
 1277|       |
 1278|  28.3M|  DECLARE_ALIGNED(16, uint8_t, left_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  28.3M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1279|  28.3M|  DECLARE_ALIGNED(16, uint8_t, above_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  28.3M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1280|  28.3M|  uint8_t *const above_row = above_data + 16;
 1281|  28.3M|  uint8_t *const left_col = left_data + 16;
 1282|       |
 1283|  28.3M|  if (need_left) {
  ------------------
  |  Branch (1283:7): [True: 28.3M, False: 433]
  ------------------
 1284|  28.3M|    memset(left_data, 129, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  28.3M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  28.3M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  28.3M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1285|  28.3M|    if (n_left_px > 0) {
  ------------------
  |  Branch (1285:9): [True: 23.5M, False: 4.80M]
  ------------------
 1286|   173M|      for (i = 0; i < n_left_px; i++) left_col[i] = left_ref[i * ref_stride];
  ------------------
  |  Branch (1286:19): [True: 150M, False: 23.5M]
  ------------------
 1287|  23.5M|      if (i < txhpx) memset(&left_col[i], left_col[i - 1], txhpx - i);
  ------------------
  |  Branch (1287:11): [True: 27.2k, False: 23.5M]
  ------------------
 1288|  23.5M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1288:16): [True: 3.77M, False: 1.03M]
  ------------------
 1289|  3.77M|      memset(left_col, above_ref[0], txhpx);
 1290|  3.77M|    }
 1291|  28.3M|  }
 1292|       |
 1293|  28.3M|  if (need_above) {
  ------------------
  |  Branch (1293:7): [True: 28.3M, False: 18.4E]
  ------------------
 1294|  28.3M|    memset(above_data, 127, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  28.3M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  28.3M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  28.3M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1295|  28.3M|    if (n_top_px > 0) {
  ------------------
  |  Branch (1295:9): [True: 23.4M, False: 4.94M]
  ------------------
 1296|  23.4M|      memcpy(above_row, above_ref, n_top_px);
 1297|  23.4M|      i = n_top_px;
 1298|  23.4M|      if (i < txwpx) memset(&above_row[i], above_row[i - 1], txwpx - i);
  ------------------
  |  Branch (1298:11): [True: 25.5k, False: 23.4M]
  ------------------
 1299|  23.4M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1299:16): [True: 3.94M, False: 1.00M]
  ------------------
 1300|  3.94M|      memset(above_row, left_ref[0], txwpx);
 1301|  3.94M|    }
 1302|  28.3M|  }
 1303|       |
 1304|  28.3M|  if (need_above_left) {
  ------------------
  |  Branch (1304:7): [True: 4.79M, False: 23.5M]
  ------------------
 1305|  4.79M|    if (n_top_px > 0 && n_left_px > 0) {
  ------------------
  |  Branch (1305:9): [True: 3.86M, False: 931k]
  |  Branch (1305:25): [True: 3.17M, False: 683k]
  ------------------
 1306|  3.17M|      above_row[-1] = above_ref[-1];
 1307|  3.17M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1307:16): [True: 683k, False: 931k]
  ------------------
 1308|   683k|      above_row[-1] = above_ref[0];
 1309|   931k|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1309:16): [True: 708k, False: 222k]
  ------------------
 1310|   708k|      above_row[-1] = left_ref[0];
 1311|   708k|    } else {
 1312|   222k|      above_row[-1] = 128;
 1313|   222k|    }
 1314|  4.79M|    left_col[-1] = above_row[-1];
 1315|  4.79M|  }
 1316|       |
 1317|  28.3M|  if (mode == DC_PRED) {
  ------------------
  |  Branch (1317:7): [True: 18.7M, False: 9.59M]
  ------------------
 1318|  18.7M|    dc_pred[n_left_px > 0][n_top_px > 0][tx_size](dst, dst_stride, above_row,
 1319|  18.7M|                                                  left_col);
 1320|  18.7M|  } else {
 1321|  9.59M|    pred[mode][tx_size](dst, dst_stride, above_row, left_col);
 1322|  9.59M|  }
 1323|  28.3M|}
reconintra.c:scale_chroma_bsize:
 1638|  5.48M|                                            int subsampling_y) {
 1639|  5.48M|  assert(subsampling_x >= 0 && subsampling_x < 2);
 1640|  5.48M|  assert(subsampling_y >= 0 && subsampling_y < 2);
 1641|  5.48M|  BLOCK_SIZE bs = bsize;
 1642|  5.48M|  switch (bsize) {
 1643|   867k|    case BLOCK_4X4:
  ------------------
  |  Branch (1643:5): [True: 867k, False: 4.61M]
  ------------------
 1644|   867k|      if (subsampling_x == 1 && subsampling_y == 1)
  ------------------
  |  Branch (1644:11): [True: 867k, False: 6]
  |  Branch (1644:33): [True: 349k, False: 518k]
  ------------------
 1645|   349k|        bs = BLOCK_8X8;
 1646|   518k|      else if (subsampling_x == 1)
  ------------------
  |  Branch (1646:16): [True: 518k, False: 1]
  ------------------
 1647|   518k|        bs = BLOCK_8X4;
 1648|      1|      else if (subsampling_y == 1)
  ------------------
  |  Branch (1648:16): [True: 0, False: 1]
  ------------------
 1649|      0|        bs = BLOCK_4X8;
 1650|   867k|      break;
 1651|   177k|    case BLOCK_4X8:
  ------------------
  |  Branch (1651:5): [True: 177k, False: 5.30M]
  ------------------
 1652|   177k|      if (subsampling_x == 1 && subsampling_y == 1)
  ------------------
  |  Branch (1652:11): [True: 177k, False: 18.4E]
  |  Branch (1652:33): [True: 177k, False: 0]
  ------------------
 1653|   177k|        bs = BLOCK_8X8;
 1654|  18.4E|      else if (subsampling_x == 1)
  ------------------
  |  Branch (1654:16): [True: 0, False: 18.4E]
  ------------------
 1655|      0|        bs = BLOCK_8X8;
 1656|  18.4E|      else if (subsampling_y == 1)
  ------------------
  |  Branch (1656:16): [True: 0, False: 18.4E]
  ------------------
 1657|      0|        bs = BLOCK_4X8;
 1658|   177k|      break;
 1659|   442k|    case BLOCK_8X4:
  ------------------
  |  Branch (1659:5): [True: 442k, False: 5.04M]
  ------------------
 1660|   442k|      if (subsampling_x == 1 && subsampling_y == 1)
  ------------------
  |  Branch (1660:11): [True: 442k, False: 18.4E]
  |  Branch (1660:33): [True: 148k, False: 293k]
  ------------------
 1661|   148k|        bs = BLOCK_8X8;
 1662|   293k|      else if (subsampling_x == 1)
  ------------------
  |  Branch (1662:16): [True: 293k, False: 18.4E]
  ------------------
 1663|   293k|        bs = BLOCK_8X4;
 1664|  18.4E|      else if (subsampling_y == 1)
  ------------------
  |  Branch (1664:16): [True: 0, False: 18.4E]
  ------------------
 1665|      0|        bs = BLOCK_8X8;
 1666|   442k|      break;
 1667|      0|    case BLOCK_4X16:
  ------------------
  |  Branch (1667:5): [True: 0, False: 5.48M]
  ------------------
 1668|      0|      if (subsampling_x == 1 && subsampling_y == 1)
  ------------------
  |  Branch (1668:11): [True: 0, False: 0]
  |  Branch (1668:33): [True: 0, False: 0]
  ------------------
 1669|      0|        bs = BLOCK_8X16;
 1670|      0|      else if (subsampling_x == 1)
  ------------------
  |  Branch (1670:16): [True: 0, False: 0]
  ------------------
 1671|      0|        bs = BLOCK_8X16;
 1672|      0|      else if (subsampling_y == 1)
  ------------------
  |  Branch (1672:16): [True: 0, False: 0]
  ------------------
 1673|      0|        bs = BLOCK_4X16;
 1674|      0|      break;
 1675|      0|    case BLOCK_16X4:
  ------------------
  |  Branch (1675:5): [True: 0, False: 5.48M]
  ------------------
 1676|      0|      if (subsampling_x == 1 && subsampling_y == 1)
  ------------------
  |  Branch (1676:11): [True: 0, False: 0]
  |  Branch (1676:33): [True: 0, False: 0]
  ------------------
 1677|      0|        bs = BLOCK_16X8;
 1678|      0|      else if (subsampling_x == 1)
  ------------------
  |  Branch (1678:16): [True: 0, False: 0]
  ------------------
 1679|      0|        bs = BLOCK_16X4;
 1680|      0|      else if (subsampling_y == 1)
  ------------------
  |  Branch (1680:16): [True: 0, False: 0]
  ------------------
 1681|      0|        bs = BLOCK_16X8;
 1682|      0|      break;
 1683|  3.99M|    default: break;
  ------------------
  |  Branch (1683:5): [True: 3.99M, False: 1.48M]
  ------------------
 1684|  5.48M|  }
 1685|  5.48M|  return bs;
 1686|  5.48M|}
reconintra.c:has_top_right:
  199|  5.65M|                         int col_off, int ss_x, int ss_y) {
  200|  5.65M|  if (!top_available || !right_available) return 0;
  ------------------
  |  Branch (200:7): [True: 1.61M, False: 4.04M]
  |  Branch (200:25): [True: 719k, False: 3.32M]
  ------------------
  201|       |
  202|  3.31M|  const int bw_unit = mi_size_wide[bsize];
  203|  3.31M|  const int plane_bw_unit = AOMMAX(bw_unit >> ss_x, 1);
  ------------------
  |  |   35|  3.31M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.60M, False: 1.71M]
  |  |  ------------------
  ------------------
  204|  3.31M|  const int top_right_count_unit = tx_size_wide_unit[txsz];
  205|       |
  206|  3.31M|  if (row_off > 0) {  // Just need to check if enough pixels on the right.
  ------------------
  |  Branch (206:7): [True: 192k, False: 3.12M]
  ------------------
  207|   192k|    if (block_size_wide[bsize] > block_size_wide[BLOCK_64X64]) {
  ------------------
  |  Branch (207:9): [True: 0, False: 192k]
  ------------------
  208|       |      // Special case: For 128x128 blocks, the transform unit whose
  209|       |      // top-right corner is at the center of the block does in fact have
  210|       |      // pixels available at its top-right corner.
  211|      0|      if (row_off == mi_size_high[BLOCK_64X64] >> ss_y &&
  ------------------
  |  Branch (211:11): [True: 0, False: 0]
  ------------------
  212|      0|          col_off + top_right_count_unit == mi_size_wide[BLOCK_64X64] >> ss_x) {
  ------------------
  |  Branch (212:11): [True: 0, False: 0]
  ------------------
  213|      0|        return 1;
  214|      0|      }
  215|      0|      const int plane_bw_unit_64 = mi_size_wide[BLOCK_64X64] >> ss_x;
  216|      0|      const int col_off_64 = col_off % plane_bw_unit_64;
  217|      0|      return col_off_64 + top_right_count_unit < plane_bw_unit_64;
  218|      0|    }
  219|   192k|    return col_off + top_right_count_unit < plane_bw_unit;
  220|  3.12M|  } else {
  221|       |    // All top-right pixels are in the block above, which is already available.
  222|  3.12M|    if (col_off + top_right_count_unit < plane_bw_unit) return 1;
  ------------------
  |  Branch (222:9): [True: 146k, False: 2.98M]
  ------------------
  223|       |
  224|  2.98M|    const int bw_in_mi_log2 = mi_size_wide_log2[bsize];
  225|  2.98M|    const int bh_in_mi_log2 = mi_size_high_log2[bsize];
  226|  2.98M|    const int sb_mi_size = mi_size_high[sb_size];
  227|  2.98M|    const int blk_row_in_sb = (mi_row & (sb_mi_size - 1)) >> bh_in_mi_log2;
  228|  2.98M|    const int blk_col_in_sb = (mi_col & (sb_mi_size - 1)) >> bw_in_mi_log2;
  229|       |
  230|       |    // Top row of superblock: so top-right pixels are in the top and/or
  231|       |    // top-right superblocks, both of which are already available.
  232|  2.98M|    if (blk_row_in_sb == 0) return 1;
  ------------------
  |  Branch (232:9): [True: 47.7k, False: 2.93M]
  ------------------
  233|       |
  234|       |    // Rightmost column of superblock (and not the top row): so top-right pixels
  235|       |    // fall in the right superblock, which is not available yet.
  236|  2.93M|    if (((blk_col_in_sb + 1) << bw_in_mi_log2) >= sb_mi_size) {
  ------------------
  |  Branch (236:9): [True: 46.3k, False: 2.88M]
  ------------------
  237|  46.3k|      return 0;
  238|  46.3k|    }
  239|       |
  240|       |    // General case (neither top row nor rightmost column): check if the
  241|       |    // top-right block is coded before the current block.
  242|  2.88M|    const int this_blk_index =
  243|  2.88M|        ((blk_row_in_sb + 0) << (MAX_MIB_SIZE_LOG2 - bw_in_mi_log2)) +
  ------------------
  |  |   43|  2.88M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  2.88M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.88M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  244|  2.88M|        blk_col_in_sb + 0;
  245|  2.88M|    const int idx1 = this_blk_index / 8;
  246|  2.88M|    const int idx2 = this_blk_index % 8;
  247|  2.88M|    const uint8_t *has_tr_table = get_has_tr_table(partition, bsize);
  248|  2.88M|    return (has_tr_table[idx1] >> idx2) & 1;
  249|  2.93M|  }
  250|  3.31M|}
reconintra.c:get_has_tr_table:
  183|  2.89M|                                       BLOCK_SIZE bsize) {
  184|  2.89M|  const uint8_t *ret = NULL;
  185|       |  // If this is a mixed vertical partition, look up bsize in orders_vert.
  186|  2.89M|  if (partition == PARTITION_VERT_A || partition == PARTITION_VERT_B) {
  ------------------
  |  Branch (186:7): [True: 18.4E, False: 2.89M]
  |  Branch (186:40): [True: 18.4E, False: 2.89M]
  ------------------
  187|      0|    assert(bsize < BLOCK_SIZES);
  188|      0|    ret = has_tr_vert_tables[bsize];
  189|  2.89M|  } else {
  190|  2.89M|    ret = has_tr_tables[bsize];
  191|  2.89M|  }
  192|       |  assert(ret);
  193|  2.89M|  return ret;
  194|  2.89M|}
reconintra.c:has_bottom_left:
  384|  5.35M|                           int col_off, int ss_x, int ss_y) {
  385|  5.35M|  if (!bottom_available || !left_available) return 0;
  ------------------
  |  Branch (385:7): [True: 846k, False: 4.50M]
  |  Branch (385:28): [True: 1.22M, False: 3.27M]
  ------------------
  386|       |
  387|       |  // Special case for 128x* blocks, when col_off is half the block width.
  388|       |  // This is needed because 128x* superblocks are divided into 64x* blocks in
  389|       |  // raster order
  390|  3.27M|  if (block_size_wide[bsize] > block_size_wide[BLOCK_64X64] && col_off > 0) {
  ------------------
  |  Branch (390:7): [True: 0, False: 3.27M]
  |  Branch (390:64): [True: 0, False: 0]
  ------------------
  391|      0|    const int plane_bw_unit_64 = mi_size_wide[BLOCK_64X64] >> ss_x;
  392|      0|    const int col_off_64 = col_off % plane_bw_unit_64;
  393|      0|    if (col_off_64 == 0) {
  ------------------
  |  Branch (393:9): [True: 0, False: 0]
  ------------------
  394|       |      // We are at the left edge of top-right or bottom-right 64x* block.
  395|      0|      const int plane_bh_unit_64 = mi_size_high[BLOCK_64X64] >> ss_y;
  396|      0|      const int row_off_64 = row_off % plane_bh_unit_64;
  397|      0|      const int plane_bh_unit =
  398|      0|          AOMMIN(mi_size_high[bsize] >> ss_y, plane_bh_unit_64);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  399|       |      // Check if all bottom-left pixels are in the left 64x* block (which is
  400|       |      // already coded).
  401|      0|      return row_off_64 + tx_size_high_unit[txsz] < plane_bh_unit;
  402|      0|    }
  403|      0|  }
  404|       |
  405|  3.27M|  if (col_off > 0) {
  ------------------
  |  Branch (405:7): [True: 225k, False: 3.05M]
  ------------------
  406|       |    // Bottom-left pixels are in the bottom-left block, which is not available.
  407|   225k|    return 0;
  408|  3.05M|  } else {
  409|  3.05M|    const int bh_unit = mi_size_high[bsize];
  410|  3.05M|    const int plane_bh_unit = AOMMAX(bh_unit >> ss_y, 1);
  ------------------
  |  |   35|  3.05M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.16M, False: 886k]
  |  |  ------------------
  ------------------
  411|  3.05M|    const int bottom_left_count_unit = tx_size_high_unit[txsz];
  412|       |
  413|       |    // All bottom-left pixels are in the left block, which is already available.
  414|  3.05M|    if (row_off + bottom_left_count_unit < plane_bh_unit) return 1;
  ------------------
  |  Branch (414:9): [True: 144k, False: 2.90M]
  ------------------
  415|       |
  416|  2.90M|    const int bw_in_mi_log2 = mi_size_wide_log2[bsize];
  417|  2.90M|    const int bh_in_mi_log2 = mi_size_high_log2[bsize];
  418|  2.90M|    const int sb_mi_size = mi_size_high[sb_size];
  419|  2.90M|    const int blk_row_in_sb = (mi_row & (sb_mi_size - 1)) >> bh_in_mi_log2;
  420|  2.90M|    const int blk_col_in_sb = (mi_col & (sb_mi_size - 1)) >> bw_in_mi_log2;
  421|       |
  422|       |    // Leftmost column of superblock: so bottom-left pixels maybe in the left
  423|       |    // and/or bottom-left superblocks. But only the left superblock is
  424|       |    // available, so check if all required pixels fall in that superblock.
  425|  2.90M|    if (blk_col_in_sb == 0) {
  ------------------
  |  Branch (425:9): [True: 57.7k, False: 2.84M]
  ------------------
  426|  57.7k|      const int blk_start_row_off =
  427|  57.7k|          blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - MI_SIZE_LOG2) >>
  ------------------
  |  |   39|  57.7k|#define MI_SIZE_LOG2 2
  ------------------
                        blk_row_in_sb << (bh_in_mi_log2 + MI_SIZE_LOG2 - MI_SIZE_LOG2) >>
  ------------------
  |  |   39|  57.7k|#define MI_SIZE_LOG2 2
  ------------------
  428|  57.7k|          ss_y;
  429|  57.7k|      const int row_off_in_sb = blk_start_row_off + row_off;
  430|  57.7k|      const int sb_height_unit = sb_mi_size >> ss_y;
  431|  57.7k|      return row_off_in_sb + bottom_left_count_unit < sb_height_unit;
  432|  57.7k|    }
  433|       |
  434|       |    // Bottom row of superblock (and not the leftmost column): so bottom-left
  435|       |    // pixels fall in the bottom superblock, which is not available yet.
  436|  2.84M|    if (((blk_row_in_sb + 1) << bh_in_mi_log2) >= sb_mi_size) return 0;
  ------------------
  |  Branch (436:9): [True: 49.2k, False: 2.80M]
  ------------------
  437|       |
  438|       |    // General case (neither leftmost column nor bottom row): check if the
  439|       |    // bottom-left block is coded before the current block.
  440|  2.80M|    const int this_blk_index =
  441|  2.80M|        ((blk_row_in_sb + 0) << (MAX_MIB_SIZE_LOG2 - bw_in_mi_log2)) +
  ------------------
  |  |   43|  2.80M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  2.80M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  2.80M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  442|  2.80M|        blk_col_in_sb + 0;
  443|  2.80M|    const int idx1 = this_blk_index / 8;
  444|  2.80M|    const int idx2 = this_blk_index % 8;
  445|  2.80M|    const uint8_t *has_bl_table = get_has_bl_table(partition, bsize);
  446|  2.80M|    return (has_bl_table[idx1] >> idx2) & 1;
  447|  2.84M|  }
  448|  3.27M|}
reconintra.c:get_has_bl_table:
  368|  2.80M|                                       BLOCK_SIZE bsize) {
  369|  2.80M|  const uint8_t *ret = NULL;
  370|       |  // If this is a mixed vertical partition, look up bsize in orders_vert.
  371|  2.80M|  if (partition == PARTITION_VERT_A || partition == PARTITION_VERT_B) {
  ------------------
  |  Branch (371:7): [True: 37, False: 2.80M]
  |  Branch (371:40): [True: 18.4E, False: 2.80M]
  ------------------
  372|      0|    assert(bsize < BLOCK_SIZES);
  373|      0|    ret = has_bl_vert_tables[bsize];
  374|  2.80M|  } else {
  375|  2.80M|    ret = has_bl_tables[bsize];
  376|  2.80M|  }
  377|       |  assert(ret);
  378|  2.80M|  return ret;
  379|  2.80M|}
reconintra.c:get_intra_edge_filter_type:
  974|  47.7M|static int get_intra_edge_filter_type(const MACROBLOCKD *xd, int plane) {
  975|  47.7M|  const MB_MODE_INFO *above;
  976|  47.7M|  const MB_MODE_INFO *left;
  977|       |
  978|  47.7M|  if (plane == 0) {
  ------------------
  |  Branch (978:7): [True: 40.1M, False: 7.58M]
  ------------------
  979|  40.1M|    above = xd->above_mbmi;
  980|  40.1M|    left = xd->left_mbmi;
  981|  40.1M|  } else {
  982|  7.58M|    above = xd->chroma_above_mbmi;
  983|  7.58M|    left = xd->chroma_left_mbmi;
  984|  7.58M|  }
  985|       |
  986|  47.7M|  return (above && is_smooth(above, plane)) || (left && is_smooth(left, plane));
  ------------------
  |  Branch (986:11): [True: 34.7M, False: 12.9M]
  |  Branch (986:20): [True: 1.10M, False: 33.6M]
  |  Branch (986:49): [True: 34.0M, False: 12.5M]
  |  Branch (986:57): [True: 924k, False: 33.0M]
  ------------------
  987|  47.7M|}
reconintra.c:is_smooth:
  958|  68.7M|static int is_smooth(const MB_MODE_INFO *mbmi, int plane) {
  959|  68.7M|  if (plane == 0) {
  ------------------
  |  Branch (959:7): [True: 58.4M, False: 10.2M]
  ------------------
  960|  58.4M|    const PREDICTION_MODE mode = mbmi->mode;
  961|  58.4M|    return (mode == SMOOTH_PRED || mode == SMOOTH_V_PRED ||
  ------------------
  |  Branch (961:13): [True: 44.9k, False: 58.3M]
  |  Branch (961:36): [True: 309, False: 58.3M]
  ------------------
  962|  58.3M|            mode == SMOOTH_H_PRED);
  ------------------
  |  Branch (962:13): [True: 18.4E, False: 58.3M]
  ------------------
  963|  58.4M|  } else {
  964|       |    // uv_mode is not set for inter blocks, so need to explicitly
  965|       |    // detect that case.
  966|  10.2M|    if (is_inter_block(mbmi)) return 0;
  ------------------
  |  Branch (966:9): [True: 593k, False: 9.68M]
  ------------------
  967|       |
  968|  9.68M|    const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
  969|  9.68M|    return (uv_mode == UV_SMOOTH_PRED || uv_mode == UV_SMOOTH_V_PRED ||
  ------------------
  |  Branch (969:13): [True: 895k, False: 8.79M]
  |  Branch (969:42): [True: 496k, False: 8.29M]
  ------------------
  970|  8.29M|            uv_mode == UV_SMOOTH_H_PRED);
  ------------------
  |  Branch (970:13): [True: 516k, False: 7.77M]
  ------------------
  971|  10.2M|  }
  972|  68.7M|}
reconintra.c:highbd_build_directional_and_filter_intra_predictors:
 1389|  16.1M|    int bit_depth) {
 1390|  16.1M|  int i;
 1391|  16.1M|  uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  16.1M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1392|  16.1M|  const uint16_t *const ref = CONVERT_TO_SHORTPTR(ref8);
  ------------------
  |  |   79|  16.1M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1393|  16.1M|  DECLARE_ALIGNED(16, uint16_t, left_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  16.1M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1394|  16.1M|  DECLARE_ALIGNED(16, uint16_t, above_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  16.1M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1395|  16.1M|  uint16_t *const above_row = above_data + 16;
 1396|  16.1M|  uint16_t *const left_col = left_data + 16;
 1397|  16.1M|  const int txwpx = tx_size_wide[tx_size];
 1398|  16.1M|  const int txhpx = tx_size_high[tx_size];
 1399|  16.1M|  int need_left = extend_modes[mode] & NEED_LEFT;
 1400|  16.1M|  int need_above = extend_modes[mode] & NEED_ABOVE;
 1401|  16.1M|  int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
 1402|  16.1M|  const uint16_t *above_ref = ref - ref_stride;
 1403|  16.1M|  const uint16_t *left_ref = ref - 1;
 1404|  16.1M|  const int is_dr_mode = av1_is_directional_mode(mode);
 1405|  16.1M|  const int use_filter_intra = filter_intra_mode != FILTER_INTRA_MODES;
 1406|  16.1M|  assert(use_filter_intra || is_dr_mode);
 1407|  16.1M|  const int base = 128 << (bit_depth - 8);
 1408|       |  // The left_data, above_data buffers must be zeroed to fix some intermittent
 1409|       |  // valgrind errors. Uninitialized reads in intra pred modules (e.g. width = 4
 1410|       |  // path in av1_highbd_dr_prediction_z2_avx2()) from left_data, above_data are
 1411|       |  // seen to be the potential reason for this issue.
 1412|  16.1M|  aom_memset16(left_data, base + 1, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  16.1M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  16.1M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  16.1M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1413|  16.1M|  aom_memset16(above_data, base - 1, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  16.1M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  16.1M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  16.1M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1414|       |
 1415|       |  // The default values if ref pixels are not available:
 1416|       |  // base   base-1 base-1 .. base-1 base-1 base-1 base-1 base-1 base-1
 1417|       |  // base+1   A      B  ..     Y      Z
 1418|       |  // base+1   C      D  ..     W      X
 1419|       |  // base+1   E      F  ..     U      V
 1420|       |  // base+1   G      H  ..     S      T      T      T      T      T
 1421|       |
 1422|  16.1M|  if (is_dr_mode) {
  ------------------
  |  Branch (1422:7): [True: 11.2M, False: 4.87M]
  ------------------
 1423|  11.2M|    if (p_angle <= 90)
  ------------------
  |  Branch (1423:9): [True: 4.02M, False: 7.21M]
  ------------------
 1424|  4.02M|      need_above = 1, need_left = 0, need_above_left = 1;
 1425|  7.21M|    else if (p_angle < 180)
  ------------------
  |  Branch (1425:14): [True: 3.86M, False: 3.35M]
  ------------------
 1426|  3.86M|      need_above = 1, need_left = 1, need_above_left = 1;
 1427|  3.35M|    else
 1428|  3.35M|      need_above = 0, need_left = 1, need_above_left = 1;
 1429|  11.2M|  }
 1430|  16.1M|  if (use_filter_intra) need_left = need_above = need_above_left = 1;
  ------------------
  |  Branch (1430:7): [True: 4.89M, False: 11.2M]
  ------------------
 1431|       |
 1432|  16.1M|  assert(n_top_px >= 0);
 1433|  16.1M|  assert(n_topright_px >= -1);
 1434|  16.1M|  assert(n_left_px >= 0);
 1435|  16.1M|  assert(n_bottomleft_px >= -1);
 1436|       |
 1437|  16.1M|  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
  ------------------
  |  Branch (1437:8): [True: 3.36M, False: 12.7M]
  |  Branch (1437:23): [True: 1.09M, False: 2.27M]
  |  Branch (1437:43): [True: 4.02M, False: 11.0M]
  |  Branch (1437:57): [True: 1.29M, False: 2.72M]
  ------------------
 1438|  2.39M|    int val;
 1439|  2.39M|    if (need_left) {
  ------------------
  |  Branch (1439:9): [True: 1.09M, False: 1.29M]
  ------------------
 1440|  1.09M|      val = (n_top_px > 0) ? above_ref[0] : base + 1;
  ------------------
  |  Branch (1440:13): [True: 840k, False: 249k]
  ------------------
 1441|  1.29M|    } else {
 1442|  1.29M|      val = (n_left_px > 0) ? left_ref[0] : base - 1;
  ------------------
  |  Branch (1442:13): [True: 948k, False: 350k]
  ------------------
 1443|  1.29M|    }
 1444|  15.9M|    for (i = 0; i < txhpx; ++i) {
  ------------------
  |  Branch (1444:17): [True: 13.5M, False: 2.39M]
  ------------------
 1445|  13.5M|      aom_memset16(dst, val, txwpx);
 1446|  13.5M|      dst += dst_stride;
 1447|  13.5M|    }
 1448|  2.39M|    return;
 1449|  2.39M|  }
 1450|       |
 1451|       |  // NEED_LEFT
 1452|  13.7M|  if (need_left) {
  ------------------
  |  Branch (1452:7): [True: 11.0M, False: 2.69M]
  ------------------
 1453|  11.0M|    const int num_left_pixels_needed =
 1454|  11.0M|        txhpx + (n_bottomleft_px >= 0 ? txwpx : 0);
  ------------------
  |  Branch (1454:18): [True: 1.06M, False: 9.96M]
  ------------------
 1455|  11.0M|    i = 0;
 1456|  11.0M|    if (n_left_px > 0) {
  ------------------
  |  Branch (1456:9): [True: 8.23M, False: 2.79M]
  ------------------
 1457|  49.7M|      for (; i < n_left_px; i++) left_col[i] = left_ref[i * ref_stride];
  ------------------
  |  Branch (1457:14): [True: 41.5M, False: 8.23M]
  ------------------
 1458|  8.23M|      if (n_bottomleft_px > 0) {
  ------------------
  |  Branch (1458:11): [True: 306k, False: 7.92M]
  ------------------
 1459|   306k|        assert(i == txhpx);
 1460|  1.70M|        for (; i < txhpx + n_bottomleft_px; i++)
  ------------------
  |  Branch (1460:16): [True: 1.40M, False: 306k]
  ------------------
 1461|  1.40M|          left_col[i] = left_ref[i * ref_stride];
 1462|   306k|      }
 1463|  8.23M|      if (i < num_left_pixels_needed)
  ------------------
  |  Branch (1463:11): [True: 805k, False: 7.42M]
  ------------------
 1464|   805k|        aom_memset16(&left_col[i], left_col[i - 1], num_left_pixels_needed - i);
 1465|  8.23M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1465:16): [True: 2.01M, False: 779k]
  ------------------
 1466|  2.01M|      aom_memset16(left_col, above_ref[0], num_left_pixels_needed);
 1467|  2.01M|    }
 1468|  11.0M|  }
 1469|       |
 1470|       |  // NEED_ABOVE
 1471|  13.7M|  if (need_above) {
  ------------------
  |  Branch (1471:7): [True: 11.4M, False: 2.24M]
  ------------------
 1472|  11.4M|    const int num_top_pixels_needed = txwpx + (n_topright_px >= 0 ? txhpx : 0);
  ------------------
  |  Branch (1472:48): [True: 1.69M, False: 9.78M]
  ------------------
 1473|  11.4M|    if (n_top_px > 0) {
  ------------------
  |  Branch (1473:9): [True: 8.64M, False: 2.83M]
  ------------------
 1474|  8.64M|      memcpy(above_row, above_ref, n_top_px * sizeof(above_ref[0]));
 1475|  8.64M|      i = n_top_px;
 1476|  8.64M|      if (n_topright_px > 0) {
  ------------------
  |  Branch (1476:11): [True: 885k, False: 7.75M]
  ------------------
 1477|   885k|        assert(n_top_px == txwpx);
 1478|   885k|        memcpy(above_row + txwpx, above_ref + txwpx,
 1479|   885k|               n_topright_px * sizeof(above_ref[0]));
 1480|   885k|        i += n_topright_px;
 1481|   885k|      }
 1482|  8.64M|      if (i < num_top_pixels_needed)
  ------------------
  |  Branch (1482:11): [True: 876k, False: 7.76M]
  ------------------
 1483|   876k|        aom_memset16(&above_row[i], above_row[i - 1],
 1484|   876k|                     num_top_pixels_needed - i);
 1485|  8.64M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1485:16): [True: 2.05M, False: 778k]
  ------------------
 1486|  2.05M|      aom_memset16(above_row, left_ref[0], num_top_pixels_needed);
 1487|  2.05M|    }
 1488|  11.4M|  }
 1489|       |
 1490|  13.7M|  if (need_above_left) {
  ------------------
  |  Branch (1490:7): [True: 13.7M, False: 18.4E]
  ------------------
 1491|  13.7M|    if (n_top_px > 0 && n_left_px > 0) {
  ------------------
  |  Branch (1491:9): [True: 10.2M, False: 3.52M]
  |  Branch (1491:25): [True: 7.37M, False: 2.84M]
  ------------------
 1492|  7.37M|      above_row[-1] = above_ref[-1];
 1493|  7.37M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1493:16): [True: 2.84M, False: 3.52M]
  ------------------
 1494|  2.84M|      above_row[-1] = above_ref[0];
 1495|  3.52M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1495:16): [True: 2.75M, False: 771k]
  ------------------
 1496|  2.75M|      above_row[-1] = left_ref[0];
 1497|  2.75M|    } else {
 1498|   771k|      above_row[-1] = base;
 1499|   771k|    }
 1500|  13.7M|    left_col[-1] = above_row[-1];
 1501|  13.7M|  }
 1502|       |
 1503|  13.7M|  if (use_filter_intra) {
  ------------------
  |  Branch (1503:7): [True: 4.89M, False: 8.83M]
  ------------------
 1504|  4.89M|    highbd_filter_intra_predictor(dst, dst_stride, tx_size, above_row, left_col,
 1505|  4.89M|                                  filter_intra_mode, bit_depth);
 1506|  4.89M|    return;
 1507|  4.89M|  }
 1508|       |
 1509|  13.7M|  assert(is_dr_mode);
 1510|  8.83M|  int upsample_above = 0;
 1511|  8.83M|  int upsample_left = 0;
 1512|  8.85M|  if (!disable_edge_filter) {
  ------------------
  |  Branch (1512:7): [True: 8.85M, False: 18.4E]
  ------------------
 1513|  8.85M|    const int need_right = p_angle < 90;
 1514|  8.85M|    const int need_bottom = p_angle > 180;
 1515|  8.85M|    if (p_angle != 90 && p_angle != 180) {
  ------------------
  |  Branch (1515:9): [True: 7.82M, False: 1.03M]
  |  Branch (1515:26): [True: 6.61M, False: 1.21M]
  ------------------
 1516|  6.61M|      assert(need_above_left);
 1517|  6.61M|      const int ab_le = 1;
 1518|  6.61M|      if (need_above && need_left && (txwpx + txhpx >= 24)) {
  ------------------
  |  Branch (1518:11): [True: 5.55M, False: 1.05M]
  |  Branch (1518:25): [True: 3.86M, False: 1.68M]
  |  Branch (1518:38): [True: 71.3k, False: 3.79M]
  ------------------
 1519|  71.3k|        highbd_filter_intra_edge_corner(above_row, left_col);
 1520|  71.3k|      }
 1521|  6.61M|      if (need_above && n_top_px > 0) {
  ------------------
  |  Branch (1521:11): [True: 5.55M, False: 1.05M]
  |  Branch (1521:25): [True: 4.35M, False: 1.19M]
  ------------------
 1522|  4.35M|        const int strength = intra_edge_filter_strength(
 1523|  4.35M|            txwpx, txhpx, p_angle - 90, intra_edge_filter_type);
 1524|  4.35M|        const int n_px = n_top_px + ab_le + (need_right ? txhpx : 0);
  ------------------
  |  Branch (1524:46): [True: 1.69M, False: 2.66M]
  ------------------
 1525|  4.35M|        av1_highbd_filter_intra_edge(above_row - ab_le, n_px, strength);
 1526|  4.35M|      }
 1527|  6.61M|      if (need_left && n_left_px > 0) {
  ------------------
  |  Branch (1527:11): [True: 4.92M, False: 1.68M]
  |  Branch (1527:24): [True: 3.71M, False: 1.20M]
  ------------------
 1528|  3.71M|        const int strength = intra_edge_filter_strength(
 1529|  3.71M|            txhpx, txwpx, p_angle - 180, intra_edge_filter_type);
 1530|  3.71M|        const int n_px = n_left_px + ab_le + (need_bottom ? txwpx : 0);
  ------------------
  |  Branch (1530:47): [True: 1.06M, False: 2.65M]
  ------------------
 1531|  3.71M|        av1_highbd_filter_intra_edge(left_col - ab_le, n_px, strength);
 1532|  3.71M|      }
 1533|  6.61M|    }
 1534|  8.85M|    upsample_above = av1_use_intra_edge_upsample(txwpx, txhpx, p_angle - 90,
 1535|  8.85M|                                                 intra_edge_filter_type);
 1536|  8.85M|    if (need_above && upsample_above) {
  ------------------
  |  Branch (1536:9): [True: 6.58M, False: 2.27M]
  |  Branch (1536:23): [True: 2.27M, False: 4.31M]
  ------------------
 1537|  2.27M|      const int n_px = txwpx + (need_right ? txhpx : 0);
  ------------------
  |  Branch (1537:33): [True: 945k, False: 1.32M]
  ------------------
 1538|  2.27M|      av1_highbd_upsample_intra_edge(above_row, n_px, bit_depth);
 1539|  2.27M|    }
 1540|  8.85M|    upsample_left = av1_use_intra_edge_upsample(txhpx, txwpx, p_angle - 180,
 1541|  8.85M|                                                intra_edge_filter_type);
 1542|  8.85M|    if (need_left && upsample_left) {
  ------------------
  |  Branch (1542:9): [True: 6.13M, False: 2.72M]
  |  Branch (1542:22): [True: 2.46M, False: 3.67M]
  ------------------
 1543|  2.46M|      const int n_px = txhpx + (need_bottom ? txwpx : 0);
  ------------------
  |  Branch (1543:33): [True: 1.04M, False: 1.42M]
  ------------------
 1544|  2.46M|      av1_highbd_upsample_intra_edge(left_col, n_px, bit_depth);
 1545|  2.46M|    }
 1546|  8.85M|  }
 1547|  8.83M|  highbd_dr_predictor(dst, dst_stride, tx_size, above_row, left_col,
 1548|  8.83M|                      upsample_above, upsample_left, p_angle, bit_depth);
 1549|  8.83M|}
reconintra.c:highbd_filter_intra_predictor:
  912|  4.89M|                                          int bd) {
  913|  4.89M|  int r, c;
  914|  4.89M|  uint16_t buffer[33][33];
  915|  4.89M|  const int bw = tx_size_wide[tx_size];
  916|  4.89M|  const int bh = tx_size_high[tx_size];
  917|       |
  918|  4.89M|  assert(bw <= 32 && bh <= 32);
  919|       |
  920|  33.0M|  for (r = 0; r < bh; ++r) buffer[r + 1][0] = left[r];
  ------------------
  |  Branch (920:15): [True: 28.1M, False: 4.89M]
  ------------------
  921|  4.89M|  memcpy(buffer[0], &above[-1], (bw + 1) * sizeof(buffer[0][0]));
  922|       |
  923|  18.8M|  for (r = 1; r < bh + 1; r += 2)
  ------------------
  |  Branch (923:15): [True: 14.0M, False: 4.89M]
  ------------------
  924|  37.7M|    for (c = 1; c < bw + 1; c += 4) {
  ------------------
  |  Branch (924:17): [True: 23.7M, False: 14.0M]
  ------------------
  925|  23.7M|      const uint16_t p0 = buffer[r - 1][c - 1];
  926|  23.7M|      const uint16_t p1 = buffer[r - 1][c];
  927|  23.7M|      const uint16_t p2 = buffer[r - 1][c + 1];
  928|  23.7M|      const uint16_t p3 = buffer[r - 1][c + 2];
  929|  23.7M|      const uint16_t p4 = buffer[r - 1][c + 3];
  930|  23.7M|      const uint16_t p5 = buffer[r][c - 1];
  931|  23.7M|      const uint16_t p6 = buffer[r + 1][c - 1];
  932|   214M|      for (int k = 0; k < 8; ++k) {
  ------------------
  |  Branch (932:23): [True: 190M, False: 23.7M]
  ------------------
  933|   190M|        int r_offset = k >> 2;
  934|   190M|        int c_offset = k & 0x03;
  935|   190M|        int pr = av1_filter_intra_taps[mode][k][0] * p0 +
  936|   190M|                 av1_filter_intra_taps[mode][k][1] * p1 +
  937|   190M|                 av1_filter_intra_taps[mode][k][2] * p2 +
  938|   190M|                 av1_filter_intra_taps[mode][k][3] * p3 +
  939|   190M|                 av1_filter_intra_taps[mode][k][4] * p4 +
  940|   190M|                 av1_filter_intra_taps[mode][k][5] * p5 +
  941|   190M|                 av1_filter_intra_taps[mode][k][6] * p6;
  942|       |        // Section 7.11.2.3 specifies the right-hand side of the assignment as
  943|       |        //   Clip1( Round2Signed( pr, INTRA_FILTER_SCALE_BITS ) ).
  944|       |        // Since Clip1() clips a negative value to 0, it is safe to replace
  945|       |        // Round2Signed() with Round2().
  946|   190M|        buffer[r + r_offset][c + c_offset] = clip_pixel_highbd(
  947|   190M|            ROUND_POWER_OF_TWO(pr, FILTER_INTRA_SCALE_BITS), bd);
  ------------------
  |  |   41|   190M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  948|   190M|      }
  949|  23.7M|    }
  950|       |
  951|  33.0M|  for (r = 0; r < bh; ++r) {
  ------------------
  |  Branch (951:15): [True: 28.1M, False: 4.89M]
  ------------------
  952|  28.1M|    memcpy(dst, &buffer[r + 1][1], bw * sizeof(dst[0]));
  953|  28.1M|    dst += stride;
  954|  28.1M|  }
  955|  4.89M|}
reconintra.c:highbd_filter_intra_edge_corner:
 1350|  71.3k|                                            uint16_t *p_left) {
 1351|  71.3k|  const int kernel[3] = { 5, 6, 5 };
 1352|       |
 1353|  71.3k|  int s = (p_left[0] * kernel[0]) + (p_above[-1] * kernel[1]) +
 1354|  71.3k|          (p_above[0] * kernel[2]);
 1355|  71.3k|  s = (s + 8) >> 4;
 1356|  71.3k|  p_above[-1] = s;
 1357|  71.3k|  p_left[-1] = s;
 1358|  71.3k|}
reconintra.c:intra_edge_filter_strength:
  989|  21.4M|static int intra_edge_filter_strength(int bs0, int bs1, int delta, int type) {
  990|  21.4M|  const int d = abs(delta);
  991|  21.4M|  int strength = 0;
  992|       |
  993|  21.4M|  const int blk_wh = bs0 + bs1;
  994|  21.4M|  if (type == 0) {
  ------------------
  |  Branch (994:7): [True: 19.3M, False: 2.11M]
  ------------------
  995|  19.3M|    if (blk_wh <= 8) {
  ------------------
  |  Branch (995:9): [True: 8.28M, False: 11.0M]
  ------------------
  996|  8.28M|      if (d >= 56) strength = 1;
  ------------------
  |  Branch (996:11): [True: 1.93M, False: 6.34M]
  ------------------
  997|  11.0M|    } else if (blk_wh <= 12) {
  ------------------
  |  Branch (997:16): [True: 1.03M, False: 10.0M]
  ------------------
  998|  1.03M|      if (d >= 40) strength = 1;
  ------------------
  |  Branch (998:11): [True: 475k, False: 554k]
  ------------------
  999|  10.0M|    } else if (blk_wh <= 16) {
  ------------------
  |  Branch (999:16): [True: 9.55M, False: 503k]
  ------------------
 1000|  9.55M|      if (d >= 40) strength = 1;
  ------------------
  |  Branch (1000:11): [True: 3.39M, False: 6.15M]
  ------------------
 1001|  9.55M|    } else if (blk_wh <= 24) {
  ------------------
  |  Branch (1001:16): [True: 228k, False: 275k]
  ------------------
 1002|   228k|      if (d >= 8) strength = 1;
  ------------------
  |  Branch (1002:11): [True: 149k, False: 79.1k]
  ------------------
 1003|   228k|      if (d >= 16) strength = 2;
  ------------------
  |  Branch (1003:11): [True: 110k, False: 117k]
  ------------------
 1004|   228k|      if (d >= 32) strength = 3;
  ------------------
  |  Branch (1004:11): [True: 98.5k, False: 129k]
  ------------------
 1005|   275k|    } else if (blk_wh <= 32) {
  ------------------
  |  Branch (1005:16): [True: 273k, False: 1.56k]
  ------------------
 1006|   273k|      if (d >= 1) strength = 1;
  ------------------
  |  Branch (1006:11): [True: 273k, False: 18.4E]
  ------------------
 1007|   273k|      if (d >= 4) strength = 2;
  ------------------
  |  Branch (1007:11): [True: 227k, False: 46.6k]
  ------------------
 1008|   273k|      if (d >= 32) strength = 3;
  ------------------
  |  Branch (1008:11): [True: 111k, False: 161k]
  ------------------
 1009|   273k|    } else {
 1010|  10.7k|      if (d >= 1) strength = 3;
  ------------------
  |  Branch (1010:11): [True: 10.7k, False: 18.4E]
  ------------------
 1011|  1.56k|    }
 1012|  19.3M|  } else {
 1013|  2.11M|    if (blk_wh <= 8) {
  ------------------
  |  Branch (1013:9): [True: 1.57M, False: 543k]
  ------------------
 1014|  1.57M|      if (d >= 40) strength = 1;
  ------------------
  |  Branch (1014:11): [True: 729k, False: 841k]
  ------------------
 1015|  1.57M|      if (d >= 64) strength = 2;
  ------------------
  |  Branch (1015:11): [True: 300k, False: 1.27M]
  ------------------
 1016|  1.57M|    } else if (blk_wh <= 16) {
  ------------------
  |  Branch (1016:16): [True: 535k, False: 8.02k]
  ------------------
 1017|   535k|      if (d >= 20) strength = 1;
  ------------------
  |  Branch (1017:11): [True: 355k, False: 179k]
  ------------------
 1018|   535k|      if (d >= 48) strength = 2;
  ------------------
  |  Branch (1018:11): [True: 158k, False: 376k]
  ------------------
 1019|   535k|    } else if (blk_wh <= 24) {
  ------------------
  |  Branch (1019:16): [True: 11.9k, False: 18.4E]
  ------------------
 1020|  11.9k|      if (d >= 4) strength = 3;
  ------------------
  |  Branch (1020:11): [True: 10.0k, False: 1.89k]
  ------------------
 1021|  18.4E|    } else {
 1022|  18.4E|      if (d >= 1) strength = 3;
  ------------------
  |  Branch (1022:11): [True: 3.21k, False: 18.4E]
  ------------------
 1023|  18.4E|    }
 1024|  2.11M|  }
 1025|  21.4M|  return strength;
 1026|  21.4M|}
reconintra.c:highbd_dr_predictor:
  782|  8.86M|                                int upsample_left, int angle, int bd) {
  783|  8.86M|  const int dx = av1_get_dx(angle);
  784|  8.86M|  const int dy = av1_get_dy(angle);
  785|  8.86M|  const int bw = tx_size_wide[tx_size];
  786|  8.86M|  const int bh = tx_size_high[tx_size];
  787|  8.86M|  assert(angle > 0 && angle < 270);
  788|       |
  789|  8.86M|  if (angle > 0 && angle < 90) {
  ------------------
  |  Branch (789:7): [True: 8.86M, False: 525]
  |  Branch (789:20): [True: 1.69M, False: 7.17M]
  ------------------
  790|  1.69M|    av1_highbd_dr_prediction_z1(dst, stride, bw, bh, above, left,
  791|  1.69M|                                upsample_above, dx, dy, bd);
  792|  7.17M|  } else if (angle > 90 && angle < 180) {
  ------------------
  |  Branch (792:14): [True: 6.13M, False: 1.03M]
  |  Branch (792:28): [True: 3.86M, False: 2.27M]
  ------------------
  793|  3.86M|    av1_highbd_dr_prediction_z2(dst, stride, bw, bh, above, left,
  794|  3.86M|                                upsample_above, upsample_left, dx, dy, bd);
  795|  3.86M|  } else if (angle > 180 && angle < 270) {
  ------------------
  |  Branch (795:14): [True: 1.06M, False: 2.24M]
  |  Branch (795:29): [True: 1.06M, False: 18.4E]
  ------------------
  796|  1.06M|    av1_highbd_dr_prediction_z3(dst, stride, bw, bh, above, left, upsample_left,
  797|  1.06M|                                dx, dy, bd);
  798|  2.24M|  } else if (angle == 90) {
  ------------------
  |  Branch (798:14): [True: 1.03M, False: 1.21M]
  ------------------
  799|  1.03M|    pred_high[V_PRED][tx_size](dst, stride, above, left, bd);
  800|  1.21M|  } else if (angle == 180) {
  ------------------
  |  Branch (800:14): [True: 1.21M, False: 18.4E]
  ------------------
  801|  1.21M|    pred_high[H_PRED][tx_size](dst, stride, above, left, bd);
  802|  1.21M|  }
  803|  8.86M|}
reconintra.c:build_directional_and_filter_intra_predictors:
 1088|  31.5M|    int n_left_px, int n_bottomleft_px, int intra_edge_filter_type) {
 1089|  31.5M|  int i;
 1090|  31.5M|  const uint8_t *above_ref = ref - ref_stride;
 1091|  31.5M|  const uint8_t *left_ref = ref - 1;
 1092|  31.5M|  DECLARE_ALIGNED(16, uint8_t, left_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  31.5M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1093|  31.5M|  DECLARE_ALIGNED(16, uint8_t, above_data[NUM_INTRA_NEIGHBOUR_PIXELS]);
  ------------------
  |  |   19|  31.5M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1094|  31.5M|  uint8_t *const above_row = above_data + 16;
 1095|  31.5M|  uint8_t *const left_col = left_data + 16;
 1096|  31.5M|  const int txwpx = tx_size_wide[tx_size];
 1097|  31.5M|  const int txhpx = tx_size_high[tx_size];
 1098|  31.5M|  int need_left = extend_modes[mode] & NEED_LEFT;
 1099|  31.5M|  int need_above = extend_modes[mode] & NEED_ABOVE;
 1100|  31.5M|  int need_above_left = extend_modes[mode] & NEED_ABOVELEFT;
 1101|  31.5M|  const int is_dr_mode = av1_is_directional_mode(mode);
 1102|  31.5M|  const int use_filter_intra = filter_intra_mode != FILTER_INTRA_MODES;
 1103|  31.5M|  assert(use_filter_intra || is_dr_mode);
 1104|       |  // The left_data, above_data buffers must be zeroed to fix some intermittent
 1105|       |  // valgrind errors. Uninitialized reads in intra pred modules (e.g. width = 4
 1106|       |  // path in av1_dr_prediction_z1_avx2()) from left_data, above_data are seen to
 1107|       |  // be the potential reason for this issue.
 1108|  31.5M|  memset(left_data, 129, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  31.5M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  31.5M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  31.5M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|  31.5M|  memset(above_data, 127, NUM_INTRA_NEIGHBOUR_PIXELS);
  ------------------
  |  |   38|  31.5M|#define NUM_INTRA_NEIGHBOUR_PIXELS (MAX_TX_SIZE * 2 + 32)
  |  |  ------------------
  |  |  |  |  183|  31.5M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  31.5M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1110|       |
 1111|       |  // The default values if ref pixels are not available:
 1112|       |  // 128 127 127 .. 127 127 127 127 127 127
 1113|       |  // 129  A   B  ..  Y   Z
 1114|       |  // 129  C   D  ..  W   X
 1115|       |  // 129  E   F  ..  U   V
 1116|       |  // 129  G   H  ..  S   T   T   T   T   T
 1117|       |  // ..
 1118|       |
 1119|  31.5M|  if (is_dr_mode) {
  ------------------
  |  Branch (1119:7): [True: 15.0M, False: 16.5M]
  ------------------
 1120|  15.0M|    if (p_angle <= 90)
  ------------------
  |  Branch (1120:9): [True: 4.40M, False: 10.6M]
  ------------------
 1121|  4.40M|      need_above = 1, need_left = 0, need_above_left = 1;
 1122|  10.6M|    else if (p_angle < 180)
  ------------------
  |  Branch (1122:14): [True: 5.35M, False: 5.28M]
  ------------------
 1123|  5.35M|      need_above = 1, need_left = 1, need_above_left = 1;
 1124|  5.28M|    else
 1125|  5.28M|      need_above = 0, need_left = 1, need_above_left = 1;
 1126|  15.0M|  }
 1127|  31.5M|  if (use_filter_intra) need_left = need_above = need_above_left = 1;
  ------------------
  |  Branch (1127:7): [True: 16.6M, False: 14.9M]
  ------------------
 1128|       |
 1129|  31.5M|  assert(n_top_px >= 0);
 1130|  31.5M|  assert(n_topright_px >= -1);
 1131|  31.5M|  assert(n_left_px >= 0);
 1132|  31.5M|  assert(n_bottomleft_px >= -1);
 1133|       |
 1134|  31.5M|  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
  ------------------
  |  Branch (1134:8): [True: 5.33M, False: 26.2M]
  |  Branch (1134:23): [True: 1.28M, False: 4.05M]
  |  Branch (1134:43): [True: 4.40M, False: 25.9M]
  |  Branch (1134:57): [True: 1.07M, False: 3.32M]
  ------------------
 1135|  2.35M|    int val;
 1136|  2.35M|    if (need_left) {
  ------------------
  |  Branch (1136:9): [True: 1.28M, False: 1.07M]
  ------------------
 1137|  1.28M|      val = (n_top_px > 0) ? above_ref[0] : 129;
  ------------------
  |  Branch (1137:13): [True: 968k, False: 313k]
  ------------------
 1138|  1.28M|    } else {
 1139|  1.07M|      val = (n_left_px > 0) ? left_ref[0] : 127;
  ------------------
  |  Branch (1139:13): [True: 789k, False: 283k]
  ------------------
 1140|  1.07M|    }
 1141|  21.7M|    for (i = 0; i < txhpx; ++i) {
  ------------------
  |  Branch (1141:17): [True: 19.4M, False: 2.35M]
  ------------------
 1142|  19.4M|      memset(dst, val, txwpx);
 1143|  19.4M|      dst += dst_stride;
 1144|  19.4M|    }
 1145|  2.35M|    return;
 1146|  2.35M|  }
 1147|       |
 1148|       |  // NEED_LEFT
 1149|  29.1M|  if (need_left) {
  ------------------
  |  Branch (1149:7): [True: 25.9M, False: 3.21M]
  ------------------
 1150|  25.9M|    const int num_left_pixels_needed =
 1151|  25.9M|        txhpx + (n_bottomleft_px >= 0 ? txwpx : 0);
  ------------------
  |  Branch (1151:18): [True: 2.79M, False: 23.1M]
  ------------------
 1152|  25.9M|    i = 0;
 1153|  25.9M|    if (n_left_px > 0) {
  ------------------
  |  Branch (1153:9): [True: 21.7M, False: 4.23M]
  ------------------
 1154|   174M|      for (; i < n_left_px; i++) left_col[i] = left_ref[i * ref_stride];
  ------------------
  |  Branch (1154:14): [True: 152M, False: 21.7M]
  ------------------
 1155|  21.7M|      if (n_bottomleft_px > 0) {
  ------------------
  |  Branch (1155:11): [True: 757k, False: 20.9M]
  ------------------
 1156|   757k|        assert(i == txhpx);
 1157|  6.30M|        for (; i < txhpx + n_bottomleft_px; i++)
  ------------------
  |  Branch (1157:16): [True: 5.54M, False: 757k]
  ------------------
 1158|  5.54M|          left_col[i] = left_ref[i * ref_stride];
 1159|   757k|      }
 1160|  21.7M|      if (i < num_left_pixels_needed)
  ------------------
  |  Branch (1160:11): [True: 2.08M, False: 19.6M]
  ------------------
 1161|  2.08M|        memset(&left_col[i], left_col[i - 1], num_left_pixels_needed - i);
 1162|  21.7M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1162:16): [True: 3.15M, False: 1.07M]
  ------------------
 1163|  3.15M|      memset(left_col, above_ref[0], num_left_pixels_needed);
 1164|  3.15M|    }
 1165|  25.9M|  }
 1166|       |
 1167|       |  // NEED_ABOVE
 1168|  29.1M|  if (need_above) {
  ------------------
  |  Branch (1168:7): [True: 25.2M, False: 3.93M]
  ------------------
 1169|  25.2M|    const int num_top_pixels_needed = txwpx + (n_topright_px >= 0 ? txhpx : 0);
  ------------------
  |  Branch (1169:48): [True: 2.34M, False: 22.9M]
  ------------------
 1170|  25.2M|    if (n_top_px > 0) {
  ------------------
  |  Branch (1170:9): [True: 20.9M, False: 4.33M]
  ------------------
 1171|  20.9M|      memcpy(above_row, above_ref, n_top_px);
 1172|  20.9M|      i = n_top_px;
 1173|  20.9M|      if (n_topright_px > 0) {
  ------------------
  |  Branch (1173:11): [True: 1.43M, False: 19.4M]
  ------------------
 1174|  1.43M|        assert(n_top_px == txwpx);
 1175|  1.43M|        memcpy(above_row + txwpx, above_ref + txwpx, n_topright_px);
 1176|  1.43M|        i += n_topright_px;
 1177|  1.43M|      }
 1178|  20.9M|      if (i < num_top_pixels_needed)
  ------------------
  |  Branch (1178:11): [True: 1.05M, False: 19.8M]
  ------------------
 1179|  1.05M|        memset(&above_row[i], above_row[i - 1], num_top_pixels_needed - i);
 1180|  20.9M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1180:16): [True: 3.24M, False: 1.08M]
  ------------------
 1181|  3.24M|      memset(above_row, left_ref[0], num_top_pixels_needed);
 1182|  3.24M|    }
 1183|  25.2M|  }
 1184|       |
 1185|  29.2M|  if (need_above_left) {
  ------------------
  |  Branch (1185:7): [True: 29.2M, False: 18.4E]
  ------------------
 1186|  29.2M|    if (n_top_px > 0 && n_left_px > 0) {
  ------------------
  |  Branch (1186:9): [True: 24.1M, False: 5.13M]
  |  Branch (1186:25): [True: 20.4M, False: 3.76M]
  ------------------
 1187|  20.4M|      above_row[-1] = above_ref[-1];
 1188|  20.4M|    } else if (n_top_px > 0) {
  ------------------
  |  Branch (1188:16): [True: 3.79M, False: 5.10M]
  ------------------
 1189|  3.79M|      above_row[-1] = above_ref[0];
 1190|  5.10M|    } else if (n_left_px > 0) {
  ------------------
  |  Branch (1190:16): [True: 4.04M, False: 1.05M]
  ------------------
 1191|  4.04M|      above_row[-1] = left_ref[0];
 1192|  4.04M|    } else {
 1193|  1.05M|      above_row[-1] = 128;
 1194|  1.05M|    }
 1195|  29.2M|    left_col[-1] = above_row[-1];
 1196|  29.2M|  }
 1197|       |
 1198|  29.1M|  if (use_filter_intra) {
  ------------------
  |  Branch (1198:7): [True: 16.6M, False: 12.5M]
  ------------------
 1199|  16.6M|    av1_filter_intra_predictor(dst, dst_stride, tx_size, above_row, left_col,
 1200|  16.6M|                               filter_intra_mode);
 1201|  16.6M|    return;
 1202|  16.6M|  }
 1203|       |
 1204|  29.1M|  assert(is_dr_mode);
 1205|  12.5M|  int upsample_above = 0;
 1206|  12.5M|  int upsample_left = 0;
 1207|  12.7M|  if (!disable_edge_filter) {
  ------------------
  |  Branch (1207:7): [True: 12.7M, False: 18.4E]
  ------------------
 1208|  12.7M|    const int need_right = p_angle < 90;
 1209|  12.7M|    const int need_bottom = p_angle > 180;
 1210|  12.7M|    if (p_angle != 90 && p_angle != 180) {
  ------------------
  |  Branch (1210:9): [True: 11.7M, False: 975k]
  |  Branch (1210:26): [True: 10.4M, False: 1.26M]
  ------------------
 1211|  10.4M|      assert(need_above_left);
 1212|  10.4M|      const int ab_le = 1;
 1213|  10.4M|      if (need_above && need_left && (txwpx + txhpx >= 24)) {
  ------------------
  |  Branch (1213:11): [True: 7.69M, False: 2.77M]
  |  Branch (1213:25): [True: 5.35M, False: 2.33M]
  |  Branch (1213:38): [True: 264k, False: 5.09M]
  ------------------
 1214|   264k|        filter_intra_edge_corner(above_row, left_col);
 1215|   264k|      }
 1216|  10.4M|      if (need_above && n_top_px > 0) {
  ------------------
  |  Branch (1216:11): [True: 7.69M, False: 2.77M]
  |  Branch (1216:25): [True: 6.48M, False: 1.21M]
  ------------------
 1217|  6.48M|        const int strength = intra_edge_filter_strength(
 1218|  6.48M|            txwpx, txhpx, p_angle - 90, intra_edge_filter_type);
 1219|  6.48M|        const int n_px = n_top_px + ab_le + (need_right ? txhpx : 0);
  ------------------
  |  Branch (1219:46): [True: 2.35M, False: 4.13M]
  ------------------
 1220|  6.48M|        av1_filter_intra_edge(above_row - ab_le, n_px, strength);
 1221|  6.48M|      }
 1222|  10.4M|      if (need_left && n_left_px > 0) {
  ------------------
  |  Branch (1222:11): [True: 8.14M, False: 2.32M]
  |  Branch (1222:24): [True: 6.96M, False: 1.18M]
  ------------------
 1223|  6.96M|        const int strength = intra_edge_filter_strength(
 1224|  6.96M|            txhpx, txwpx, p_angle - 180, intra_edge_filter_type);
 1225|  6.96M|        const int n_px = n_left_px + ab_le + (need_bottom ? txwpx : 0);
  ------------------
  |  Branch (1225:47): [True: 2.79M, False: 4.16M]
  ------------------
 1226|  6.96M|        av1_filter_intra_edge(left_col - ab_le, n_px, strength);
 1227|  6.96M|      }
 1228|  10.4M|    }
 1229|  12.7M|    upsample_above = av1_use_intra_edge_upsample(txwpx, txhpx, p_angle - 90,
 1230|  12.7M|                                                 intra_edge_filter_type);
 1231|  12.7M|    if (need_above && upsample_above) {
  ------------------
  |  Branch (1231:9): [True: 8.68M, False: 4.02M]
  |  Branch (1231:23): [True: 3.72M, False: 4.95M]
  ------------------
 1232|  3.72M|      const int n_px = txwpx + (need_right ? txhpx : 0);
  ------------------
  |  Branch (1232:33): [True: 1.76M, False: 1.96M]
  ------------------
 1233|  3.72M|      av1_upsample_intra_edge(above_row, n_px);
 1234|  3.72M|    }
 1235|  12.7M|    upsample_left = av1_use_intra_edge_upsample(txhpx, txwpx, p_angle - 180,
 1236|  12.7M|                                                intra_edge_filter_type);
 1237|  12.7M|    if (need_left && upsample_left) {
  ------------------
  |  Branch (1237:9): [True: 9.41M, False: 3.29M]
  |  Branch (1237:22): [True: 5.26M, False: 4.15M]
  ------------------
 1238|  5.26M|      const int n_px = txhpx + (need_bottom ? txwpx : 0);
  ------------------
  |  Branch (1238:33): [True: 2.59M, False: 2.67M]
  ------------------
 1239|  5.26M|      av1_upsample_intra_edge(left_col, n_px);
 1240|  5.26M|    }
 1241|  12.7M|  }
 1242|  12.5M|  dr_predictor(dst, dst_stride, tx_size, above_row, left_col, upsample_above,
 1243|  12.5M|               upsample_left, p_angle);
 1244|  12.5M|}
reconintra.c:filter_intra_edge_corner:
 1051|   264k|static void filter_intra_edge_corner(uint8_t *p_above, uint8_t *p_left) {
 1052|   264k|  const int kernel[3] = { 5, 6, 5 };
 1053|       |
 1054|   264k|  int s = (p_left[0] * kernel[0]) + (p_above[-1] * kernel[1]) +
 1055|   264k|          (p_above[0] * kernel[2]);
 1056|   264k|  s = (s + 8) >> 4;
 1057|   264k|  p_above[-1] = s;
 1058|   264k|  p_left[-1] = s;
 1059|   264k|}
reconintra.c:dr_predictor:
  642|  12.7M|                         int upsample_above, int upsample_left, int angle) {
  643|  12.7M|  const int dx = av1_get_dx(angle);
  644|  12.7M|  const int dy = av1_get_dy(angle);
  645|  12.7M|  const int bw = tx_size_wide[tx_size];
  646|  12.7M|  const int bh = tx_size_high[tx_size];
  647|  12.7M|  assert(angle > 0 && angle < 270);
  648|       |
  649|  12.7M|  if (angle > 0 && angle < 90) {
  ------------------
  |  Branch (649:7): [True: 12.7M, False: 5.93k]
  |  Branch (649:20): [True: 2.35M, False: 10.3M]
  ------------------
  650|  2.35M|    av1_dr_prediction_z1(dst, stride, bw, bh, above, left, upsample_above, dx,
  651|  2.35M|                         dy);
  652|  10.3M|  } else if (angle > 90 && angle < 180) {
  ------------------
  |  Branch (652:14): [True: 9.41M, False: 971k]
  |  Branch (652:28): [True: 5.36M, False: 4.05M]
  ------------------
  653|  5.36M|    av1_dr_prediction_z2(dst, stride, bw, bh, above, left, upsample_above,
  654|  5.36M|                         upsample_left, dx, dy);
  655|  5.36M|  } else if (angle > 180 && angle < 270) {
  ------------------
  |  Branch (655:14): [True: 2.79M, False: 2.23M]
  |  Branch (655:29): [True: 2.79M, False: 18.4E]
  ------------------
  656|  2.79M|    av1_dr_prediction_z3(dst, stride, bw, bh, above, left, upsample_left, dx,
  657|  2.79M|                         dy);
  658|  2.79M|  } else if (angle == 90) {
  ------------------
  |  Branch (658:14): [True: 981k, False: 1.25M]
  ------------------
  659|   981k|    pred[V_PRED][tx_size](dst, stride, above, left);
  660|  1.26M|  } else if (angle == 180) {
  ------------------
  |  Branch (660:14): [True: 1.26M, False: 18.4E]
  ------------------
  661|  1.26M|    pred[H_PRED][tx_size](dst, stride, above, left);
  662|  1.26M|  }
  663|  12.7M|}
reconintra.c:init_intra_predictors_internal:
  464|      1|static void init_intra_predictors_internal(void) {
  465|      1|  assert(NELEMENTS(mode_to_angle_map) == INTRA_MODES);
  466|       |
  467|       |#if CONFIG_REALTIME_ONLY && !CONFIG_AV1_DECODER
  468|       |#define INIT_RECTANGULAR(p, type)             \
  469|       |  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  470|       |  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  471|       |  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  472|       |  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  473|       |  p[TX_16X32] = aom_##type##_predictor_16x32; \
  474|       |  p[TX_32X16] = aom_##type##_predictor_32x16; \
  475|       |  p[TX_32X64] = aom_##type##_predictor_32x64; \
  476|       |  p[TX_64X32] = aom_##type##_predictor_64x32;
  477|       |#else
  478|      1|#define INIT_RECTANGULAR(p, type)             \
  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  493|      1|#endif  // CONFIG_REALTIME_ONLY && !CONFIG_AV1_DECODER
  494|       |
  495|      1|#define INIT_NO_4X4(p, type)                  \
  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  500|      1|  INIT_RECTANGULAR(p, type)
  501|       |
  502|      1|#define INIT_ALL_SIZES(p, type)           \
  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  504|      1|  INIT_NO_4X4(p, type)
  505|       |
  506|      1|  INIT_ALL_SIZES(pred[V_PRED], v)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 5477|      1|#define aom_v_predictor_4x4 aom_v_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 5512|      1|#define aom_v_predictor_8x8 aom_v_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 5434|      1|#define aom_v_predictor_16x16 aom_v_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5481|      1|#define aom_v_predictor_4x8 aom_v_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5508|      1|#define aom_v_predictor_8x4 aom_v_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5500|      1|#define aom_v_predictor_8x16 aom_v_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5450|      1|#define aom_v_predictor_16x8 aom_v_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5438|      1|#define aom_v_predictor_16x32 aom_v_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5473|      1|#define aom_v_predictor_4x16 aom_v_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5442|      1|#define aom_v_predictor_16x4 aom_v_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      1|#define aom_v_predictor_8x32 aom_v_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5469|      1|#define aom_v_predictor_32x8 aom_v_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5446|      1|#define aom_v_predictor_16x64 aom_v_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  507|      1|  INIT_ALL_SIZES(pred[H_PRED], h)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  |  525|      1|#define aom_h_predictor_4x4 aom_h_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  557|      1|#define aom_h_predictor_8x8 aom_h_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|#define aom_h_predictor_16x16 aom_h_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|      1|#define aom_h_predictor_64x64 aom_h_predictor_64x64_sse2
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  529|      1|#define aom_h_predictor_4x8 aom_h_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  553|      1|#define aom_h_predictor_8x4 aom_h_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  545|      1|#define aom_h_predictor_8x16 aom_h_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  500|      1|#define aom_h_predictor_16x8 aom_h_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  488|      1|#define aom_h_predictor_16x32 aom_h_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  504|      1|#define aom_h_predictor_32x16 aom_h_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  513|      1|#define aom_h_predictor_32x64 aom_h_predictor_32x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      1|#define aom_h_predictor_64x32 aom_h_predictor_64x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  521|      1|#define aom_h_predictor_4x16 aom_h_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  492|      1|#define aom_h_predictor_16x4 aom_h_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  549|      1|#define aom_h_predictor_8x32 aom_h_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  517|      1|#define aom_h_predictor_32x8 aom_h_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  496|      1|#define aom_h_predictor_16x64 aom_h_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|      1|#define aom_h_predictor_64x16 aom_h_predictor_64x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|      1|  INIT_ALL_SIZES(pred[PAETH_PRED], paeth)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|      1|  INIT_ALL_SIZES(pred[SMOOTH_PRED], smooth)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  510|      1|  INIT_ALL_SIZES(pred[SMOOTH_V_PRED], smooth_v)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|      1|  INIT_ALL_SIZES(pred[SMOOTH_H_PRED], smooth_h)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|      1|  INIT_ALL_SIZES(dc_pred[0][0], dc_128)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  |  150|      1|#define aom_dc_128_predictor_4x4 aom_dc_128_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|      1|#define aom_dc_128_predictor_8x8 aom_dc_128_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      1|#define aom_dc_128_predictor_16x16 aom_dc_128_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|      1|#define aom_dc_128_predictor_4x8 aom_dc_128_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|      1|#define aom_dc_128_predictor_8x4 aom_dc_128_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  173|      1|#define aom_dc_128_predictor_8x16 aom_dc_128_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      1|#define aom_dc_128_predictor_16x8 aom_dc_128_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      1|#define aom_dc_128_predictor_16x32 aom_dc_128_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      1|#define aom_dc_128_predictor_4x16 aom_dc_128_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      1|#define aom_dc_128_predictor_16x4 aom_dc_128_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  177|      1|#define aom_dc_128_predictor_8x32 aom_dc_128_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  142|      1|#define aom_dc_128_predictor_32x8 aom_dc_128_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  119|      1|#define aom_dc_128_predictor_16x64 aom_dc_128_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|      1|  INIT_ALL_SIZES(dc_pred[0][1], dc_top)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  |  396|      1|#define aom_dc_top_predictor_4x4 aom_dc_top_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  431|      1|#define aom_dc_top_predictor_8x8 aom_dc_top_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      1|#define aom_dc_top_predictor_16x16 aom_dc_top_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  400|      1|#define aom_dc_top_predictor_4x8 aom_dc_top_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  427|      1|#define aom_dc_top_predictor_8x4 aom_dc_top_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  419|      1|#define aom_dc_top_predictor_8x16 aom_dc_top_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  369|      1|#define aom_dc_top_predictor_16x8 aom_dc_top_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      1|#define aom_dc_top_predictor_16x32 aom_dc_top_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  392|      1|#define aom_dc_top_predictor_4x16 aom_dc_top_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  361|      1|#define aom_dc_top_predictor_16x4 aom_dc_top_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  423|      1|#define aom_dc_top_predictor_8x32 aom_dc_top_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  388|      1|#define aom_dc_top_predictor_32x8 aom_dc_top_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  365|      1|#define aom_dc_top_predictor_16x64 aom_dc_top_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|      1|  INIT_ALL_SIZES(dc_pred[1][0], dc_left)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  |  232|      1|#define aom_dc_left_predictor_4x4 aom_dc_left_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      1|#define aom_dc_left_predictor_8x8 aom_dc_left_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      1|#define aom_dc_left_predictor_16x16 aom_dc_left_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  236|      1|#define aom_dc_left_predictor_4x8 aom_dc_left_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  263|      1|#define aom_dc_left_predictor_8x4 aom_dc_left_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  255|      1|#define aom_dc_left_predictor_8x16 aom_dc_left_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      1|#define aom_dc_left_predictor_16x8 aom_dc_left_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  193|      1|#define aom_dc_left_predictor_16x32 aom_dc_left_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      1|#define aom_dc_left_predictor_4x16 aom_dc_left_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  197|      1|#define aom_dc_left_predictor_16x4 aom_dc_left_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  259|      1|#define aom_dc_left_predictor_8x32 aom_dc_left_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  224|      1|#define aom_dc_left_predictor_32x8 aom_dc_left_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|      1|#define aom_dc_left_predictor_16x64 aom_dc_left_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  515|      1|  INIT_ALL_SIZES(dc_pred[1][1], dc)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  |  314|      1|#define aom_dc_predictor_4x4 aom_dc_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  349|      1|#define aom_dc_predictor_8x8 aom_dc_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  271|      1|#define aom_dc_predictor_16x16 aom_dc_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  318|      1|#define aom_dc_predictor_4x8 aom_dc_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  345|      1|#define aom_dc_predictor_8x4 aom_dc_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  337|      1|#define aom_dc_predictor_8x16 aom_dc_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  287|      1|#define aom_dc_predictor_16x8 aom_dc_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  275|      1|#define aom_dc_predictor_16x32 aom_dc_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  310|      1|#define aom_dc_predictor_4x16 aom_dc_predictor_4x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      1|#define aom_dc_predictor_16x4 aom_dc_predictor_16x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  341|      1|#define aom_dc_predictor_8x32 aom_dc_predictor_8x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  306|      1|#define aom_dc_predictor_32x8 aom_dc_predictor_32x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      1|#define aom_dc_predictor_16x64 aom_dc_predictor_16x64_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  516|      1|#if CONFIG_AV1_HIGHBITDEPTH
  517|      1|  INIT_ALL_SIZES(pred_high[V_PRED], highbd_v)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 3643|      1|#define aom_highbd_v_predictor_4x4 aom_highbd_v_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3671|      1|#define aom_highbd_v_predictor_8x8 aom_highbd_v_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3608|      1|#define aom_highbd_v_predictor_16x16 aom_highbd_v_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3630|      1|#define aom_highbd_v_predictor_32x32 aom_highbd_v_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3656|      1|#define aom_highbd_v_predictor_64x64 aom_highbd_v_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3647|      1|#define aom_highbd_v_predictor_4x8 aom_highbd_v_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3667|      1|#define aom_highbd_v_predictor_8x4 aom_highbd_v_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3660|      1|#define aom_highbd_v_predictor_8x16 aom_highbd_v_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3622|      1|#define aom_highbd_v_predictor_16x8 aom_highbd_v_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3612|      1|#define aom_highbd_v_predictor_16x32 aom_highbd_v_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3626|      1|#define aom_highbd_v_predictor_32x16 aom_highbd_v_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3633|      1|#define aom_highbd_v_predictor_32x64 aom_highbd_v_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3653|      1|#define aom_highbd_v_predictor_64x32 aom_highbd_v_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3639|      1|#define aom_highbd_v_predictor_4x16 aom_highbd_v_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3615|      1|#define aom_highbd_v_predictor_16x4 aom_highbd_v_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3663|      1|#define aom_highbd_v_predictor_8x32 aom_highbd_v_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3636|      1|#define aom_highbd_v_predictor_32x8 aom_highbd_v_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3618|      1|#define aom_highbd_v_predictor_16x64 aom_highbd_v_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3650|      1|#define aom_highbd_v_predictor_64x16 aom_highbd_v_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|      1|  INIT_ALL_SIZES(pred_high[H_PRED], highbd_h)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2504|      1|#define aom_highbd_h_predictor_4x4 aom_highbd_h_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2532|      1|#define aom_highbd_h_predictor_8x8 aom_highbd_h_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2469|      1|#define aom_highbd_h_predictor_16x16 aom_highbd_h_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2491|      1|#define aom_highbd_h_predictor_32x32 aom_highbd_h_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2517|      1|#define aom_highbd_h_predictor_64x64 aom_highbd_h_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2508|      1|#define aom_highbd_h_predictor_4x8 aom_highbd_h_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2528|      1|#define aom_highbd_h_predictor_8x4 aom_highbd_h_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2521|      1|#define aom_highbd_h_predictor_8x16 aom_highbd_h_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2483|      1|#define aom_highbd_h_predictor_16x8 aom_highbd_h_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2473|      1|#define aom_highbd_h_predictor_16x32 aom_highbd_h_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2487|      1|#define aom_highbd_h_predictor_32x16 aom_highbd_h_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2494|      1|#define aom_highbd_h_predictor_32x64 aom_highbd_h_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2514|      1|#define aom_highbd_h_predictor_64x32 aom_highbd_h_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2500|      1|#define aom_highbd_h_predictor_4x16 aom_highbd_h_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2476|      1|#define aom_highbd_h_predictor_16x4 aom_highbd_h_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2524|      1|#define aom_highbd_h_predictor_8x32 aom_highbd_h_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2497|      1|#define aom_highbd_h_predictor_32x8 aom_highbd_h_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2479|      1|#define aom_highbd_h_predictor_16x64 aom_highbd_h_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2511|      1|#define aom_highbd_h_predictor_64x16 aom_highbd_h_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  519|      1|  INIT_ALL_SIZES(pred_high[PAETH_PRED], highbd_paeth)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2870|      1|#define aom_highbd_paeth_predictor_4x4 aom_highbd_paeth_predictor_4x4_c
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2894|      1|#define aom_highbd_paeth_predictor_8x8 aom_highbd_paeth_predictor_8x8_c
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2840|      1|#define aom_highbd_paeth_predictor_16x16 aom_highbd_paeth_predictor_16x16_c
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2858|      1|#define aom_highbd_paeth_predictor_32x32 aom_highbd_paeth_predictor_32x32_c
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2882|      1|#define aom_highbd_paeth_predictor_64x64 aom_highbd_paeth_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2873|      1|#define aom_highbd_paeth_predictor_4x8 aom_highbd_paeth_predictor_4x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2891|      1|#define aom_highbd_paeth_predictor_8x4 aom_highbd_paeth_predictor_8x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2885|      1|#define aom_highbd_paeth_predictor_8x16 aom_highbd_paeth_predictor_8x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2852|      1|#define aom_highbd_paeth_predictor_16x8 aom_highbd_paeth_predictor_16x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2843|      1|#define aom_highbd_paeth_predictor_16x32 aom_highbd_paeth_predictor_16x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2855|      1|#define aom_highbd_paeth_predictor_32x16 aom_highbd_paeth_predictor_32x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2861|      1|#define aom_highbd_paeth_predictor_32x64 aom_highbd_paeth_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2879|      1|#define aom_highbd_paeth_predictor_64x32 aom_highbd_paeth_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2867|      1|#define aom_highbd_paeth_predictor_4x16 aom_highbd_paeth_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2846|      1|#define aom_highbd_paeth_predictor_16x4 aom_highbd_paeth_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2888|      1|#define aom_highbd_paeth_predictor_8x32 aom_highbd_paeth_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2864|      1|#define aom_highbd_paeth_predictor_32x8 aom_highbd_paeth_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2849|      1|#define aom_highbd_paeth_predictor_16x64 aom_highbd_paeth_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2876|      1|#define aom_highbd_paeth_predictor_64x16 aom_highbd_paeth_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|      1|  INIT_ALL_SIZES(pred_high[SMOOTH_PRED], highbd_smooth)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 3511|      1|#define aom_highbd_smooth_predictor_4x4 aom_highbd_smooth_predictor_4x4_c
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3535|      1|#define aom_highbd_smooth_predictor_8x8 aom_highbd_smooth_predictor_8x8_c
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3481|      1|#define aom_highbd_smooth_predictor_16x16 aom_highbd_smooth_predictor_16x16_c
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3499|      1|#define aom_highbd_smooth_predictor_32x32 aom_highbd_smooth_predictor_32x32_c
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3523|      1|#define aom_highbd_smooth_predictor_64x64 aom_highbd_smooth_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3514|      1|#define aom_highbd_smooth_predictor_4x8 aom_highbd_smooth_predictor_4x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3532|      1|#define aom_highbd_smooth_predictor_8x4 aom_highbd_smooth_predictor_8x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3526|      1|#define aom_highbd_smooth_predictor_8x16 aom_highbd_smooth_predictor_8x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3493|      1|#define aom_highbd_smooth_predictor_16x8 aom_highbd_smooth_predictor_16x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3484|      1|#define aom_highbd_smooth_predictor_16x32 aom_highbd_smooth_predictor_16x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3496|      1|#define aom_highbd_smooth_predictor_32x16 aom_highbd_smooth_predictor_32x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3502|      1|#define aom_highbd_smooth_predictor_32x64 aom_highbd_smooth_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3520|      1|#define aom_highbd_smooth_predictor_64x32 aom_highbd_smooth_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3508|      1|#define aom_highbd_smooth_predictor_4x16 aom_highbd_smooth_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3487|      1|#define aom_highbd_smooth_predictor_16x4 aom_highbd_smooth_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3529|      1|#define aom_highbd_smooth_predictor_8x32 aom_highbd_smooth_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3505|      1|#define aom_highbd_smooth_predictor_32x8 aom_highbd_smooth_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3490|      1|#define aom_highbd_smooth_predictor_16x64 aom_highbd_smooth_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3517|      1|#define aom_highbd_smooth_predictor_64x16 aom_highbd_smooth_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  521|      1|  INIT_ALL_SIZES(pred_high[SMOOTH_V_PRED], highbd_smooth_v)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 3568|      1|#define aom_highbd_smooth_v_predictor_4x4 aom_highbd_smooth_v_predictor_4x4_c
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3592|      1|#define aom_highbd_smooth_v_predictor_8x8 aom_highbd_smooth_v_predictor_8x8_c
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3538|      1|#define aom_highbd_smooth_v_predictor_16x16 aom_highbd_smooth_v_predictor_16x16_c
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3556|      1|#define aom_highbd_smooth_v_predictor_32x32 aom_highbd_smooth_v_predictor_32x32_c
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3580|      1|#define aom_highbd_smooth_v_predictor_64x64 aom_highbd_smooth_v_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3571|      1|#define aom_highbd_smooth_v_predictor_4x8 aom_highbd_smooth_v_predictor_4x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3589|      1|#define aom_highbd_smooth_v_predictor_8x4 aom_highbd_smooth_v_predictor_8x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3583|      1|#define aom_highbd_smooth_v_predictor_8x16 aom_highbd_smooth_v_predictor_8x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3550|      1|#define aom_highbd_smooth_v_predictor_16x8 aom_highbd_smooth_v_predictor_16x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3541|      1|#define aom_highbd_smooth_v_predictor_16x32 aom_highbd_smooth_v_predictor_16x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3553|      1|#define aom_highbd_smooth_v_predictor_32x16 aom_highbd_smooth_v_predictor_32x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3559|      1|#define aom_highbd_smooth_v_predictor_32x64 aom_highbd_smooth_v_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3577|      1|#define aom_highbd_smooth_v_predictor_64x32 aom_highbd_smooth_v_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3565|      1|#define aom_highbd_smooth_v_predictor_4x16 aom_highbd_smooth_v_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3544|      1|#define aom_highbd_smooth_v_predictor_16x4 aom_highbd_smooth_v_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3586|      1|#define aom_highbd_smooth_v_predictor_8x32 aom_highbd_smooth_v_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3562|      1|#define aom_highbd_smooth_v_predictor_32x8 aom_highbd_smooth_v_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3547|      1|#define aom_highbd_smooth_v_predictor_16x64 aom_highbd_smooth_v_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3574|      1|#define aom_highbd_smooth_v_predictor_64x16 aom_highbd_smooth_v_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|      1|  INIT_ALL_SIZES(pred_high[SMOOTH_H_PRED], highbd_smooth_h)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 3454|      1|#define aom_highbd_smooth_h_predictor_4x4 aom_highbd_smooth_h_predictor_4x4_c
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3478|      1|#define aom_highbd_smooth_h_predictor_8x8 aom_highbd_smooth_h_predictor_8x8_c
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3424|      1|#define aom_highbd_smooth_h_predictor_16x16 aom_highbd_smooth_h_predictor_16x16_c
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3442|      1|#define aom_highbd_smooth_h_predictor_32x32 aom_highbd_smooth_h_predictor_32x32_c
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 3466|      1|#define aom_highbd_smooth_h_predictor_64x64 aom_highbd_smooth_h_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3457|      1|#define aom_highbd_smooth_h_predictor_4x8 aom_highbd_smooth_h_predictor_4x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3475|      1|#define aom_highbd_smooth_h_predictor_8x4 aom_highbd_smooth_h_predictor_8x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3469|      1|#define aom_highbd_smooth_h_predictor_8x16 aom_highbd_smooth_h_predictor_8x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3436|      1|#define aom_highbd_smooth_h_predictor_16x8 aom_highbd_smooth_h_predictor_16x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3427|      1|#define aom_highbd_smooth_h_predictor_16x32 aom_highbd_smooth_h_predictor_16x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3439|      1|#define aom_highbd_smooth_h_predictor_32x16 aom_highbd_smooth_h_predictor_32x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3445|      1|#define aom_highbd_smooth_h_predictor_32x64 aom_highbd_smooth_h_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3463|      1|#define aom_highbd_smooth_h_predictor_64x32 aom_highbd_smooth_h_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3451|      1|#define aom_highbd_smooth_h_predictor_4x16 aom_highbd_smooth_h_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3430|      1|#define aom_highbd_smooth_h_predictor_16x4 aom_highbd_smooth_h_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3472|      1|#define aom_highbd_smooth_h_predictor_8x32 aom_highbd_smooth_h_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3448|      1|#define aom_highbd_smooth_h_predictor_32x8 aom_highbd_smooth_h_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3433|      1|#define aom_highbd_smooth_h_predictor_16x64 aom_highbd_smooth_h_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3460|      1|#define aom_highbd_smooth_h_predictor_64x16 aom_highbd_smooth_h_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|      1|  INIT_ALL_SIZES(dc_pred_high[0][0], highbd_dc_128)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2236|      1|#define aom_highbd_dc_128_predictor_4x4 aom_highbd_dc_128_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2264|      1|#define aom_highbd_dc_128_predictor_8x8 aom_highbd_dc_128_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2201|      1|#define aom_highbd_dc_128_predictor_16x16 aom_highbd_dc_128_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2223|      1|#define aom_highbd_dc_128_predictor_32x32 aom_highbd_dc_128_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2249|      1|#define aom_highbd_dc_128_predictor_64x64 aom_highbd_dc_128_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2240|      1|#define aom_highbd_dc_128_predictor_4x8 aom_highbd_dc_128_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2260|      1|#define aom_highbd_dc_128_predictor_8x4 aom_highbd_dc_128_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2253|      1|#define aom_highbd_dc_128_predictor_8x16 aom_highbd_dc_128_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2215|      1|#define aom_highbd_dc_128_predictor_16x8 aom_highbd_dc_128_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2205|      1|#define aom_highbd_dc_128_predictor_16x32 aom_highbd_dc_128_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2219|      1|#define aom_highbd_dc_128_predictor_32x16 aom_highbd_dc_128_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2226|      1|#define aom_highbd_dc_128_predictor_32x64 aom_highbd_dc_128_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2246|      1|#define aom_highbd_dc_128_predictor_64x32 aom_highbd_dc_128_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2232|      1|#define aom_highbd_dc_128_predictor_4x16 aom_highbd_dc_128_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2208|      1|#define aom_highbd_dc_128_predictor_16x4 aom_highbd_dc_128_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2256|      1|#define aom_highbd_dc_128_predictor_8x32 aom_highbd_dc_128_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2229|      1|#define aom_highbd_dc_128_predictor_32x8 aom_highbd_dc_128_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2211|      1|#define aom_highbd_dc_128_predictor_16x64 aom_highbd_dc_128_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2243|      1|#define aom_highbd_dc_128_predictor_64x16 aom_highbd_dc_128_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  524|      1|  INIT_ALL_SIZES(dc_pred_high[0][1], highbd_dc_top)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2437|      1|#define aom_highbd_dc_top_predictor_4x4 aom_highbd_dc_top_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2465|      1|#define aom_highbd_dc_top_predictor_8x8 aom_highbd_dc_top_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2402|      1|#define aom_highbd_dc_top_predictor_16x16 aom_highbd_dc_top_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2424|      1|#define aom_highbd_dc_top_predictor_32x32 aom_highbd_dc_top_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2450|      1|#define aom_highbd_dc_top_predictor_64x64 aom_highbd_dc_top_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2441|      1|#define aom_highbd_dc_top_predictor_4x8 aom_highbd_dc_top_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2461|      1|#define aom_highbd_dc_top_predictor_8x4 aom_highbd_dc_top_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2454|      1|#define aom_highbd_dc_top_predictor_8x16 aom_highbd_dc_top_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2416|      1|#define aom_highbd_dc_top_predictor_16x8 aom_highbd_dc_top_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2406|      1|#define aom_highbd_dc_top_predictor_16x32 aom_highbd_dc_top_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2420|      1|#define aom_highbd_dc_top_predictor_32x16 aom_highbd_dc_top_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2427|      1|#define aom_highbd_dc_top_predictor_32x64 aom_highbd_dc_top_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2447|      1|#define aom_highbd_dc_top_predictor_64x32 aom_highbd_dc_top_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2433|      1|#define aom_highbd_dc_top_predictor_4x16 aom_highbd_dc_top_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2409|      1|#define aom_highbd_dc_top_predictor_16x4 aom_highbd_dc_top_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2457|      1|#define aom_highbd_dc_top_predictor_8x32 aom_highbd_dc_top_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2430|      1|#define aom_highbd_dc_top_predictor_32x8 aom_highbd_dc_top_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2412|      1|#define aom_highbd_dc_top_predictor_16x64 aom_highbd_dc_top_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2444|      1|#define aom_highbd_dc_top_predictor_64x16 aom_highbd_dc_top_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  525|      1|  INIT_ALL_SIZES(dc_pred_high[1][0], highbd_dc_left)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2303|      1|#define aom_highbd_dc_left_predictor_4x4 aom_highbd_dc_left_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2331|      1|#define aom_highbd_dc_left_predictor_8x8 aom_highbd_dc_left_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|      1|#define aom_highbd_dc_left_predictor_16x16 aom_highbd_dc_left_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2290|      1|#define aom_highbd_dc_left_predictor_32x32 aom_highbd_dc_left_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2316|      1|#define aom_highbd_dc_left_predictor_64x64 aom_highbd_dc_left_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2307|      1|#define aom_highbd_dc_left_predictor_4x8 aom_highbd_dc_left_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2327|      1|#define aom_highbd_dc_left_predictor_8x4 aom_highbd_dc_left_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2320|      1|#define aom_highbd_dc_left_predictor_8x16 aom_highbd_dc_left_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2282|      1|#define aom_highbd_dc_left_predictor_16x8 aom_highbd_dc_left_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2272|      1|#define aom_highbd_dc_left_predictor_16x32 aom_highbd_dc_left_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2286|      1|#define aom_highbd_dc_left_predictor_32x16 aom_highbd_dc_left_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2293|      1|#define aom_highbd_dc_left_predictor_32x64 aom_highbd_dc_left_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2313|      1|#define aom_highbd_dc_left_predictor_64x32 aom_highbd_dc_left_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2299|      1|#define aom_highbd_dc_left_predictor_4x16 aom_highbd_dc_left_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2275|      1|#define aom_highbd_dc_left_predictor_16x4 aom_highbd_dc_left_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2323|      1|#define aom_highbd_dc_left_predictor_8x32 aom_highbd_dc_left_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2296|      1|#define aom_highbd_dc_left_predictor_32x8 aom_highbd_dc_left_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2278|      1|#define aom_highbd_dc_left_predictor_16x64 aom_highbd_dc_left_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2310|      1|#define aom_highbd_dc_left_predictor_64x16 aom_highbd_dc_left_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|      1|  INIT_ALL_SIZES(dc_pred_high[1][1], highbd_dc)
  ------------------
  |  |  503|      1|  p[TX_4X4] = aom_##type##_predictor_4x4; \
  |  |  ------------------
  |  |  |  | 2370|      1|#define aom_highbd_dc_predictor_4x4 aom_highbd_dc_predictor_4x4_sse2
  |  |  ------------------
  |  |  504|      1|  INIT_NO_4X4(p, type)
  |  |  ------------------
  |  |  |  |  496|      1|  p[TX_8X8] = aom_##type##_predictor_8x8;     \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2398|      1|#define aom_highbd_dc_predictor_8x8 aom_highbd_dc_predictor_8x8_sse2
  |  |  |  |  ------------------
  |  |  |  |  497|      1|  p[TX_16X16] = aom_##type##_predictor_16x16; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2335|      1|#define aom_highbd_dc_predictor_16x16 aom_highbd_dc_predictor_16x16_sse2
  |  |  |  |  ------------------
  |  |  |  |  498|      1|  p[TX_32X32] = aom_##type##_predictor_32x32; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2357|      1|#define aom_highbd_dc_predictor_32x32 aom_highbd_dc_predictor_32x32_sse2
  |  |  |  |  ------------------
  |  |  |  |  499|      1|  p[TX_64X64] = aom_##type##_predictor_64x64; \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2383|      1|#define aom_highbd_dc_predictor_64x64 aom_highbd_dc_predictor_64x64_c
  |  |  |  |  ------------------
  |  |  |  |  500|      1|  INIT_RECTANGULAR(p, type)
  |  |  |  |  ------------------
  |  |  |  |  |  |  479|      1|  p[TX_4X8] = aom_##type##_predictor_4x8;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2374|      1|#define aom_highbd_dc_predictor_4x8 aom_highbd_dc_predictor_4x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|  p[TX_8X4] = aom_##type##_predictor_8x4;     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2394|      1|#define aom_highbd_dc_predictor_8x4 aom_highbd_dc_predictor_8x4_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  481|      1|  p[TX_8X16] = aom_##type##_predictor_8x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2387|      1|#define aom_highbd_dc_predictor_8x16 aom_highbd_dc_predictor_8x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  482|      1|  p[TX_16X8] = aom_##type##_predictor_16x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2349|      1|#define aom_highbd_dc_predictor_16x8 aom_highbd_dc_predictor_16x8_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|  p[TX_16X32] = aom_##type##_predictor_16x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2339|      1|#define aom_highbd_dc_predictor_16x32 aom_highbd_dc_predictor_16x32_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  484|      1|  p[TX_32X16] = aom_##type##_predictor_32x16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2353|      1|#define aom_highbd_dc_predictor_32x16 aom_highbd_dc_predictor_32x16_sse2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  485|      1|  p[TX_32X64] = aom_##type##_predictor_32x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2360|      1|#define aom_highbd_dc_predictor_32x64 aom_highbd_dc_predictor_32x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  486|      1|  p[TX_64X32] = aom_##type##_predictor_64x32; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2380|      1|#define aom_highbd_dc_predictor_64x32 aom_highbd_dc_predictor_64x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  487|      1|  p[TX_4X16] = aom_##type##_predictor_4x16;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2366|      1|#define aom_highbd_dc_predictor_4x16 aom_highbd_dc_predictor_4x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  488|      1|  p[TX_16X4] = aom_##type##_predictor_16x4;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2342|      1|#define aom_highbd_dc_predictor_16x4 aom_highbd_dc_predictor_16x4_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  489|      1|  p[TX_8X32] = aom_##type##_predictor_8x32;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2390|      1|#define aom_highbd_dc_predictor_8x32 aom_highbd_dc_predictor_8x32_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|  p[TX_32X8] = aom_##type##_predictor_32x8;   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2363|      1|#define aom_highbd_dc_predictor_32x8 aom_highbd_dc_predictor_32x8_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  491|      1|  p[TX_16X64] = aom_##type##_predictor_16x64; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2345|      1|#define aom_highbd_dc_predictor_16x64 aom_highbd_dc_predictor_16x64_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|  p[TX_64X16] = aom_##type##_predictor_64x16;
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2377|      1|#define aom_highbd_dc_predictor_64x16 aom_highbd_dc_predictor_64x16_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  527|      1|#endif
  528|      1|#undef intra_pred_allsizes
  529|      1|}

decodeframe.c:av1_allow_intrabc:
   63|  28.0k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  28.0k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 7.01k, False: 21.0k]
  |  Branch (64:37): [True: 755, False: 6.26k]
  ------------------
   65|    755|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 0, False: 755]
  ------------------
   66|  28.0k|}
decodemv.c:av1_allow_intrabc:
   63|  61.8k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  61.8k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 61.8k, False: 6]
  |  Branch (64:37): [True: 4.81k, False: 57.0k]
  ------------------
   65|  4.81k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 0, False: 4.81k]
  ------------------
   66|  61.8k|}
decodemv.c:av1_use_angle_delta:
   59|   587k|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|   587k|  return bsize >= BLOCK_8X8;
   61|   587k|}
decodemv.c:av1_is_directional_mode:
   51|   815k|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|   815k|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 127k, False: 687k]
  |  Branch (52:28): [True: 61.9k, False: 65.6k]
  ------------------
   53|   815k|}
decodemv.c:av1_filter_intra_allowed:
   76|   588k|                                           const MB_MODE_INFO *mbmi) {
   77|   588k|  return mbmi->mode == DC_PRED &&
  ------------------
  |  Branch (77:10): [True: 529k, False: 59.0k]
  ------------------
   78|   529k|         mbmi->palette_mode_info.palette_size[0] == 0 &&
  ------------------
  |  Branch (78:10): [True: 513k, False: 16.0k]
  ------------------
   79|   513k|         av1_filter_intra_allowed_bsize(cm, mbmi->bsize);
  ------------------
  |  Branch (79:10): [True: 513k, False: 67]
  ------------------
   80|   588k|}
decodemv.c:av1_filter_intra_allowed_bsize:
   69|   514k|                                                 BLOCK_SIZE bs) {
   70|   514k|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 3, False: 514k]
  |  Branch (70:47): [True: 18.4E, False: 514k]
  ------------------
   71|       |
   72|   514k|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 513k, False: 318]
  |  Branch (72:39): [True: 513k, False: 60]
  ------------------
   73|   514k|}
bitstream.c:av1_allow_intrabc:
   63|   163k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|   163k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 163k, False: 25]
  |  Branch (64:37): [True: 13.0k, False: 150k]
  ------------------
   65|  13.0k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 0, False: 13.0k]
  ------------------
   66|   163k|}
bitstream.c:av1_use_angle_delta:
   59|  1.52M|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|  1.52M|  return bsize >= BLOCK_8X8;
   61|  1.52M|}
bitstream.c:av1_is_directional_mode:
   51|  2.09M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|  2.09M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 323k, False: 1.76M]
  |  Branch (52:28): [True: 156k, False: 166k]
  ------------------
   53|  2.09M|}
bitstream.c:av1_filter_intra_allowed:
   76|  1.52M|                                           const MB_MODE_INFO *mbmi) {
   77|  1.52M|  return mbmi->mode == DC_PRED &&
  ------------------
  |  Branch (77:10): [True: 1.37M, False: 150k]
  ------------------
   78|  1.37M|         mbmi->palette_mode_info.palette_size[0] == 0 &&
  ------------------
  |  Branch (78:10): [True: 1.33M, False: 42.0k]
  ------------------
   79|  1.33M|         av1_filter_intra_allowed_bsize(cm, mbmi->bsize);
  ------------------
  |  Branch (79:10): [True: 1.32M, False: 1.00k]
  ------------------
   80|  1.52M|}
bitstream.c:av1_filter_intra_allowed_bsize:
   69|  1.33M|                                                 BLOCK_SIZE bs) {
   70|  1.33M|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 18.4E, False: 1.33M]
  |  Branch (70:47): [True: 62, False: 1.33M]
  ------------------
   71|       |
   72|  1.33M|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 1.33M, False: 727]
  |  Branch (72:39): [True: 1.33M, False: 252]
  ------------------
   73|  1.33M|}
encodeframe_utils.c:av1_filter_intra_allowed:
   76|  1.53M|                                           const MB_MODE_INFO *mbmi) {
   77|  1.53M|  return mbmi->mode == DC_PRED &&
  ------------------
  |  Branch (77:10): [True: 1.37M, False: 151k]
  ------------------
   78|  1.37M|         mbmi->palette_mode_info.palette_size[0] == 0 &&
  ------------------
  |  Branch (78:10): [True: 1.33M, False: 42.2k]
  ------------------
   79|  1.33M|         av1_filter_intra_allowed_bsize(cm, mbmi->bsize);
  ------------------
  |  Branch (79:10): [True: 1.33M, False: 1.26k]
  ------------------
   80|  1.53M|}
encodeframe_utils.c:av1_filter_intra_allowed_bsize:
   69|  1.33M|                                                 BLOCK_SIZE bs) {
   70|  1.33M|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 18.4E, False: 1.33M]
  |  Branch (70:47): [True: 18.4E, False: 1.33M]
  ------------------
   71|       |
   72|  1.33M|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 1.33M, False: 758]
  |  Branch (72:39): [True: 1.33M, False: 343]
  ------------------
   73|  1.33M|}
encodeframe_utils.c:av1_is_directional_mode:
   51|  3.04M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|  3.04M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 361k, False: 2.68M]
  |  Branch (52:28): [True: 184k, False: 176k]
  ------------------
   53|  3.04M|}
encodeframe_utils.c:av1_use_angle_delta:
   59|   184k|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|   184k|  return bsize >= BLOCK_8X8;
   61|   184k|}
encodeframe_utils.c:av1_allow_intrabc:
   63|  88.3k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  88.3k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 16.3k, False: 71.9k]
  |  Branch (64:37): [True: 2.32k, False: 14.0k]
  ------------------
   65|  2.32k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 2.32k, False: 0]
  ------------------
   66|  88.3k|}
ethread.c:av1_allow_intrabc:
   63|  23.4k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  23.4k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 10.2k, False: 13.2k]
  |  Branch (64:37): [True: 1.23k, False: 8.98k]
  ------------------
   65|  1.23k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 1.23k, False: 0]
  ------------------
   66|  23.4k|}
palette.c:av1_filter_intra_allowed:
   76|   493k|                                           const MB_MODE_INFO *mbmi) {
   77|   493k|  return mbmi->mode == DC_PRED &&
  ------------------
  |  Branch (77:10): [True: 493k, False: 0]
  ------------------
   78|   493k|         mbmi->palette_mode_info.palette_size[0] == 0 &&
  ------------------
  |  Branch (78:10): [True: 0, False: 493k]
  ------------------
   79|      0|         av1_filter_intra_allowed_bsize(cm, mbmi->bsize);
  ------------------
  |  Branch (79:10): [True: 0, False: 0]
  ------------------
   80|   493k|}
palette.c:av1_is_directional_mode:
   51|   831k|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|   831k|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 0, False: 831k]
  |  Branch (52:28): [True: 0, False: 0]
  ------------------
   53|   831k|}
palette.c:av1_allow_intrabc:
   63|   493k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|   493k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 56.3k, False: 436k]
  |  Branch (64:37): [True: 56.3k, False: 0]
  ------------------
   65|  56.3k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 56.3k, False: 0]
  ------------------
   66|   493k|}
partition_search.c:av1_allow_intrabc:
   63|  4.08M|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  4.08M|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 328k, False: 3.75M]
  |  Branch (64:37): [True: 26.1k, False: 302k]
  ------------------
   65|  26.1k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 26.1k, False: 0]
  ------------------
   66|  4.08M|}
rd.c:av1_filter_intra_allowed_bsize:
   69|  4.30M|                                                 BLOCK_SIZE bs) {
   70|  4.30M|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 18.4E, False: 4.30M]
  |  Branch (70:47): [True: 0, False: 4.30M]
  ------------------
   71|       |
   72|  4.30M|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 3.13M, False: 1.17M]
  |  Branch (72:39): [True: 2.74M, False: 390k]
  ------------------
   73|  4.30M|}
rd.c:av1_allow_intrabc:
   63|  49.2k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  49.2k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 12.3k, False: 36.9k]
  |  Branch (64:37): [True: 1.98k, False: 10.3k]
  ------------------
   65|  1.98k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 1.98k, False: 0]
  ------------------
   66|  49.2k|}
rdopt.c:av1_allow_intrabc:
   63|   439k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|   439k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 439k, False: 4]
  |  Branch (64:37): [True: 72.2k, False: 367k]
  ------------------
   65|  72.2k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 72.2k, False: 0]
  ------------------
   66|   439k|}
rdopt.c:av1_is_directional_mode:
   51|   107M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|   107M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 104M, False: 2.30M]
  |  Branch (52:28): [True: 102M, False: 2.00M]
  ------------------
   53|   107M|}
rdopt.c:av1_use_angle_delta:
   59|   102M|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|   102M|  return bsize >= BLOCK_8X8;
   61|   102M|}
nonrd_opt.c:av1_is_directional_mode:
   51|  1.28M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|  1.28M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 691k, False: 596k]
  |  Branch (52:28): [True: 691k, False: 20]
  ------------------
   53|  1.28M|}
nonrd_opt.c:av1_use_angle_delta:
   59|   691k|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|   691k|  return bsize >= BLOCK_8X8;
   61|   691k|}
nonrd_opt.c:av1_filter_intra_allowed_bsize:
   69|   597k|                                                 BLOCK_SIZE bs) {
   70|   597k|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 18.4E, False: 597k]
  |  Branch (70:47): [True: 18.4E, False: 597k]
  ------------------
   71|       |
   72|   597k|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 597k, False: 18.4E]
  |  Branch (72:39): [True: 597k, False: 18.4E]
  ------------------
   73|   597k|}
intra_mode_search.c:av1_is_diagonal_mode:
   55|  39.7M|static inline int av1_is_diagonal_mode(PREDICTION_MODE mode) {
   56|  39.7M|  return mode >= D45_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (56:10): [True: 29.5M, False: 10.2M]
  |  Branch (56:30): [True: 24.0M, False: 5.48M]
  ------------------
   57|  39.7M|}
intra_mode_search.c:av1_is_directional_mode:
   51|   172M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|   172M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 154M, False: 17.8M]
  |  Branch (52:28): [True: 144M, False: 9.53M]
  ------------------
   53|   172M|}
intra_mode_search.c:av1_use_angle_delta:
   59|   100M|static inline int av1_use_angle_delta(BLOCK_SIZE bsize) {
   60|   100M|  return bsize >= BLOCK_8X8;
   61|   100M|}
intra_mode_search.c:av1_filter_intra_allowed_bsize:
   69|  14.2M|                                                 BLOCK_SIZE bs) {
   70|  14.2M|  if (!cm->seq_params->enable_filter_intra || bs == BLOCK_INVALID) return 0;
  ------------------
  |  Branch (70:7): [True: 18.4E, False: 14.2M]
  |  Branch (70:47): [True: 18.4E, False: 14.2M]
  ------------------
   71|       |
   72|  14.2M|  return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32;
  ------------------
  |  Branch (72:10): [True: 14.2M, False: 10.1k]
  |  Branch (72:39): [True: 14.1M, False: 1.81k]
  ------------------
   73|  14.2M|}
intra_mode_search.c:av1_filter_intra_allowed:
   76|  16.0M|                                           const MB_MODE_INFO *mbmi) {
   77|  16.0M|  return mbmi->mode == DC_PRED &&
  ------------------
  |  Branch (77:10): [True: 11.9M, False: 4.02M]
  ------------------
   78|  11.9M|         mbmi->palette_mode_info.palette_size[0] == 0 &&
  ------------------
  |  Branch (78:10): [True: 11.9M, False: 4.59k]
  ------------------
   79|  11.9M|         av1_filter_intra_allowed_bsize(cm, mbmi->bsize);
  ------------------
  |  Branch (79:10): [True: 11.9M, False: 7.04k]
  ------------------
   80|  16.0M|}
intra_mode_search.c:av1_allow_intrabc:
   63|  16.0M|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|  16.0M|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 2.19M, False: 13.8M]
  |  Branch (64:37): [True: 372k, False: 1.82M]
  ------------------
   65|   372k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 372k, False: 18.4E]
  ------------------
   66|  16.0M|}
reconintra.c:av1_is_directional_mode:
   51|   131M|static inline int av1_is_directional_mode(PREDICTION_MODE mode) {
   52|   131M|  return mode >= V_PRED && mode <= D67_PRED;
  ------------------
  |  Branch (52:10): [True: 65.7M, False: 65.3M]
  |  Branch (52:28): [True: 52.4M, False: 13.3M]
  ------------------
   53|   131M|}
reconintra.c:av1_use_intra_edge_upsample:
  149|  43.1M|                                              int type) {
  150|  43.1M|  const int d = abs(delta);
  151|  43.1M|  const int blk_wh = bs0 + bs1;
  152|  43.1M|  if (d == 0 || d >= 40) return 0;
  ------------------
  |  Branch (152:7): [True: 4.48M, False: 38.6M]
  |  Branch (152:17): [True: 24.0M, False: 14.5M]
  ------------------
  153|  14.5M|  return type ? (blk_wh <= 8) : (blk_wh <= 16);
  ------------------
  |  Branch (153:10): [True: 1.27M, False: 13.2M]
  ------------------
  154|  43.1M|}
reconintra.c:av1_get_dx:
  122|  21.6M|static inline int av1_get_dx(int angle) {
  123|  21.6M|  if (angle > 0 && angle < 90) {
  ------------------
  |  Branch (123:7): [True: 21.6M, False: 18.4E]
  |  Branch (123:20): [True: 4.04M, False: 17.5M]
  ------------------
  124|  4.04M|    return dr_intra_derivative[angle];
  125|  17.5M|  } else if (angle > 90 && angle < 180) {
  ------------------
  |  Branch (125:14): [True: 15.5M, False: 1.99M]
  |  Branch (125:28): [True: 9.22M, False: 6.33M]
  ------------------
  126|  9.22M|    return dr_intra_derivative[180 - angle];
  127|  9.22M|  } else {
  128|       |    // In this case, we are not really going to use dx. We may return any value.
  129|  8.33M|    return 1;
  130|  8.33M|  }
  131|  21.6M|}
reconintra.c:av1_get_dy:
  137|  21.6M|static inline int av1_get_dy(int angle) {
  138|  21.6M|  if (angle > 90 && angle < 180) {
  ------------------
  |  Branch (138:7): [True: 15.5M, False: 6.04M]
  |  Branch (138:21): [True: 9.22M, False: 6.33M]
  ------------------
  139|  9.22M|    return dr_intra_derivative[angle - 90];
  140|  12.3M|  } else if (angle > 180 && angle < 270) {
  ------------------
  |  Branch (140:14): [True: 3.85M, False: 8.51M]
  |  Branch (140:29): [True: 3.85M, False: 18.4E]
  ------------------
  141|  3.85M|    return dr_intra_derivative[270 - angle];
  142|  8.51M|  } else {
  143|       |    // In this case, we are not really going to use dy. We may return any value.
  144|  8.51M|    return 1;
  145|  8.51M|  }
  146|  21.6M|}
thread_common.c:av1_allow_intrabc:
   63|   137k|static inline int av1_allow_intrabc(const AV1_COMMON *const cm) {
   64|   137k|  return frame_is_intra_only(cm) && cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (64:10): [True: 26.5k, False: 111k]
  |  Branch (64:37): [True: 2.98k, False: 23.5k]
  ------------------
   65|  2.98k|         cm->features.allow_intrabc;
  ------------------
  |  Branch (65:10): [True: 2.14k, False: 838]
  ------------------
   66|   137k|}

down2_symeven:
  340|  3.28M|                   int start_offset) {
  341|       |  // Actual filter len = 2 * filter_len_half.
  342|  3.28M|  const int16_t *filter = av1_down2_symeven_half_filter;
  343|  3.28M|  const int filter_len_half = sizeof(av1_down2_symeven_half_filter) / 2;
  344|  3.28M|  int i, j;
  345|  3.28M|  uint8_t *optr = output;
  346|  3.28M|  int l1 = filter_len_half;
  347|  3.28M|  int l2 = (length - filter_len_half);
  348|  3.28M|  l1 += (l1 & 1);
  349|  3.28M|  l2 += (l2 & 1);
  350|  3.28M|  if (l1 > l2) {
  ------------------
  |  Branch (350:7): [True: 904k, False: 2.37M]
  ------------------
  351|       |    // Short input length.
  352|  2.55M|    for (i = start_offset; i < length; i += 2) {
  ------------------
  |  Branch (352:28): [True: 1.65M, False: 904k]
  ------------------
  353|  1.65M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  1.65M|#define FILTER_BITS 7
  ------------------
  354|  8.25M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (354:19): [True: 6.60M, False: 1.65M]
  ------------------
  355|  6.60M|        sum +=
  356|  6.60M|            (input[AOMMAX(i - j, 0)] + input[AOMMIN(i + 1 + j, length - 1)]) *
  ------------------
  |  |   35|  6.60M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.78M, False: 4.81M]
  |  |  ------------------
  ------------------
                          (input[AOMMAX(i - j, 0)] + input[AOMMIN(i + 1 + j, length - 1)]) *
  ------------------
  |  |   34|  6.60M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.78M, False: 4.81M]
  |  |  ------------------
  ------------------
  357|  6.60M|            filter[j];
  358|  6.60M|      }
  359|  1.65M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.65M|#define FILTER_BITS 7
  ------------------
  360|  1.65M|      *optr++ = clip_pixel(sum);
  361|  1.65M|    }
  362|  2.37M|  } else {
  363|       |    // Initial part.
  364|  7.02M|    for (i = start_offset; i < l1; i += 2) {
  ------------------
  |  Branch (364:28): [True: 4.64M, False: 2.37M]
  ------------------
  365|  4.64M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  4.64M|#define FILTER_BITS 7
  ------------------
  366|  23.2M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (366:19): [True: 18.5M, False: 4.64M]
  ------------------
  367|  18.5M|        sum += (input[AOMMAX(i - j, 0)] + input[i + 1 + j]) * filter[j];
  ------------------
  |  |   35|  18.5M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 4.64M, False: 13.9M]
  |  |  ------------------
  ------------------
  368|  18.5M|      }
  369|  4.64M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  4.64M|#define FILTER_BITS 7
  ------------------
  370|  4.64M|      *optr++ = clip_pixel(sum);
  371|  4.64M|    }
  372|       |    // Middle part.
  373|  72.4M|    for (; i < l2; i += 2) {
  ------------------
  |  Branch (373:12): [True: 70.0M, False: 2.37M]
  ------------------
  374|  70.0M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  70.0M|#define FILTER_BITS 7
  ------------------
  375|   350M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (375:19): [True: 280M, False: 70.0M]
  ------------------
  376|   280M|        sum += (input[i - j] + input[i + 1 + j]) * filter[j];
  377|   280M|      }
  378|  70.0M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  70.0M|#define FILTER_BITS 7
  ------------------
  379|  70.0M|      *optr++ = clip_pixel(sum);
  380|  70.0M|    }
  381|       |    // End part.
  382|  7.13M|    for (; i < length; i += 2) {
  ------------------
  |  Branch (382:12): [True: 4.75M, False: 2.37M]
  ------------------
  383|  4.75M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  4.75M|#define FILTER_BITS 7
  ------------------
  384|  23.7M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (384:19): [True: 19.0M, False: 4.75M]
  ------------------
  385|  19.0M|        sum +=
  386|  19.0M|            (input[i - j] + input[AOMMIN(i + 1 + j, length - 1)]) * filter[j];
  ------------------
  |  |   34|  19.0M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.75M, False: 14.2M]
  |  |  ------------------
  ------------------
  387|  19.0M|      }
  388|  4.75M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  4.75M|#define FILTER_BITS 7
  ------------------
  389|  4.75M|      *optr++ = clip_pixel(sum);
  390|  4.75M|    }
  391|  2.37M|  }
  392|  3.28M|}
av1_resize_vert_dir_c:
  524|    686|                           int height, int height2, int width2, int start_col) {
  525|    686|  bool mem_status = true;
  526|    686|  uint8_t *arrbuf = (uint8_t *)aom_malloc(sizeof(*arrbuf) * height);
  527|    686|  uint8_t *arrbuf2 = (uint8_t *)aom_malloc(sizeof(*arrbuf2) * height2);
  528|    686|  if (arrbuf == NULL || arrbuf2 == NULL) {
  ------------------
  |  Branch (528:7): [True: 0, False: 686]
  |  Branch (528:25): [True: 0, False: 686]
  ------------------
  529|      0|    mem_status = false;
  530|      0|    goto Error;
  531|      0|  }
  532|       |
  533|  3.06k|  for (int i = start_col; i < width2; ++i) {
  ------------------
  |  Branch (533:27): [True: 2.38k, False: 686]
  ------------------
  534|  2.38k|    fill_col_to_arr(intbuf + i, width2, height, arrbuf);
  535|  2.38k|    down2_symeven(arrbuf, height, arrbuf2, 0);
  536|  2.38k|    fill_arr_to_col(output + i, out_stride, height2, arrbuf2);
  537|  2.38k|  }
  538|       |
  539|    686|Error:
  540|    686|  aom_free(arrbuf);
  541|    686|  aom_free(arrbuf2);
  542|    686|  return mem_status;
  543|    686|}
av1_resize_plane_to_half:
  555|    850|                              int width2, int out_stride) {
  556|    850|  uint8_t *intbuf = (uint8_t *)aom_malloc(sizeof(*intbuf) * width2 * height);
  557|    850|  if (intbuf == NULL) {
  ------------------
  |  Branch (557:7): [True: 0, False: 850]
  ------------------
  558|      0|    return false;
  559|      0|  }
  560|       |
  561|       |  // Resize in the horizontal direction
  562|    850|  av1_resize_horz_dir(input, in_stride, intbuf, height, width, width2);
  563|       |  // Resize in the vertical direction
  564|       |  bool mem_status = av1_resize_vert_dir(intbuf, output, out_stride, height,
  565|    850|                                        height2, width2, 0 /*start_col*/);
  566|    850|  aom_free(intbuf);
  567|    850|  return mem_status;
  568|    850|}
should_resize_by_half:
  572|    850|bool should_resize_by_half(int height, int width, int height2, int width2) {
  573|    850|  const bool is_width_by_2 = get_down2_length(width, 1) == width2;
  574|    850|  const bool is_height_by_2 = get_down2_length(height, 1) == height2;
  575|    850|  return (is_width_by_2 && is_height_by_2);
  ------------------
  |  Branch (575:11): [True: 850, False: 0]
  |  Branch (575:28): [True: 850, False: 0]
  ------------------
  576|    850|}
av1_resize_plane:
  580|   160k|                      int out_stride) {
  581|   160k|  int i;
  582|   160k|  bool mem_status = true;
  583|   160k|  uint8_t *intbuf = (uint8_t *)aom_malloc(sizeof(uint8_t) * width2 * height);
  584|   160k|  uint8_t *tmpbuf =
  585|   160k|      (uint8_t *)aom_malloc(sizeof(uint8_t) * AOMMAX(width, height));
  ------------------
  |  |   35|   160k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 67.4k, False: 93.4k]
  |  |  ------------------
  ------------------
  586|   160k|  uint8_t *arrbuf = (uint8_t *)aom_malloc(sizeof(uint8_t) * height);
  587|   160k|  uint8_t *arrbuf2 = (uint8_t *)aom_malloc(sizeof(uint8_t) * height2);
  588|   160k|  if (intbuf == NULL || tmpbuf == NULL || arrbuf == NULL || arrbuf2 == NULL) {
  ------------------
  |  Branch (588:7): [True: 0, False: 160k]
  |  Branch (588:25): [True: 0, False: 160k]
  |  Branch (588:43): [True: 0, False: 160k]
  |  Branch (588:61): [True: 0, False: 160k]
  ------------------
  589|      0|    mem_status = false;
  590|      0|    goto Error;
  591|      0|  }
  592|   160k|  assert(width > 0);
  593|   160k|  assert(height > 0);
  594|   160k|  assert(width2 > 0);
  595|   160k|  assert(height2 > 0);
  596|  7.30M|  for (i = 0; i < height; ++i)
  ------------------
  |  Branch (596:15): [True: 7.14M, False: 160k]
  ------------------
  597|  7.14M|    resize_multistep(input + in_stride * i, width, intbuf + width2 * i, width2,
  598|  7.14M|                     tmpbuf);
  599|  5.67M|  for (i = 0; i < width2; ++i) {
  ------------------
  |  Branch (599:15): [True: 5.51M, False: 160k]
  ------------------
  600|  5.51M|    fill_col_to_arr(intbuf + i, width2, height, arrbuf);
  601|  5.51M|    resize_multistep(arrbuf, height, arrbuf2, height2, tmpbuf);
  602|  5.51M|    fill_arr_to_col(output + i, out_stride, height2, arrbuf2);
  603|  5.51M|  }
  604|       |
  605|   160k|Error:
  606|   160k|  aom_free(intbuf);
  607|   160k|  aom_free(tmpbuf);
  608|   160k|  aom_free(arrbuf);
  609|   160k|  aom_free(arrbuf2);
  610|   160k|  return mem_status;
  611|   160k|}
av1_resize_and_extend_frame_c:
 1038|  2.39k|                                   const int num_planes) {
 1039|  2.39k|  assert(filter == BILINEAR || filter == EIGHTTAP_SMOOTH ||
 1040|  2.39k|         filter == EIGHTTAP_REGULAR);
 1041|  2.39k|  const InterpKernel *const kernel =
 1042|  2.39k|      (const InterpKernel *)av1_interp_filter_params_list[filter].filter_ptr;
 1043|       |
 1044|  6.34k|  for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); ++i) {
  ------------------
  |  |   34|  6.34k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.23k, False: 3.10k]
  |  |  ------------------
  ------------------
  |  Branch (1044:19): [True: 3.94k, False: 2.39k]
  ------------------
 1045|  3.94k|    const int is_uv = i > 0;
 1046|  3.94k|    const int src_w = src->crop_widths[is_uv];
 1047|  3.94k|    const int src_h = src->crop_heights[is_uv];
 1048|  3.94k|    const uint8_t *src_buffer = src->buffers[i];
 1049|  3.94k|    const int src_stride = src->strides[is_uv];
 1050|  3.94k|    const int dst_w = dst->crop_widths[is_uv];
 1051|  3.94k|    const int dst_h = dst->crop_heights[is_uv];
 1052|  3.94k|    uint8_t *dst_buffer = dst->buffers[i];
 1053|  3.94k|    const int dst_stride = dst->strides[is_uv];
 1054|  11.3k|    for (int y = 0; y < dst_h; y += 16) {
  ------------------
  |  Branch (1054:21): [True: 7.42k, False: 3.94k]
  ------------------
 1055|  7.42k|      const int y_q4 =
 1056|  7.42k|          src_h == dst_h ? 0 : y * 16 * src_h / dst_h + phase_scaler;
  ------------------
  |  Branch (1056:11): [True: 2.24k, False: 5.17k]
  ------------------
 1057|  25.5k|      for (int x = 0; x < dst_w; x += 16) {
  ------------------
  |  Branch (1057:23): [True: 18.1k, False: 7.42k]
  ------------------
 1058|  18.1k|        const int x_q4 =
 1059|  18.1k|            src_w == dst_w ? 0 : x * 16 * src_w / dst_w + phase_scaler;
  ------------------
  |  Branch (1059:13): [True: 6.09k, False: 12.0k]
  ------------------
 1060|  18.1k|        const uint8_t *src_ptr =
 1061|  18.1k|            src_buffer + y * src_h / dst_h * src_stride + x * src_w / dst_w;
 1062|  18.1k|        uint8_t *dst_ptr = dst_buffer + y * dst_stride + x;
 1063|       |
 1064|       |        // Width and height of the actual working area.
 1065|  18.1k|        const int work_w = AOMMIN(16, dst_w - x);
  ------------------
  |  |   34|  18.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.7k, False: 7.42k]
  |  |  ------------------
  ------------------
 1066|  18.1k|        const int work_h = AOMMIN(16, dst_h - y);
  ------------------
  |  |   34|  18.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.9k, False: 7.19k]
  |  |  ------------------
  ------------------
 1067|       |        // SIMD versions of aom_scaled_2d() have some trouble handling
 1068|       |        // nonstandard sizes, so fall back on the C version to handle borders.
 1069|  18.1k|        if (work_w != 16 || work_h != 16) {
  ------------------
  |  Branch (1069:13): [True: 6.87k, False: 11.2k]
  |  Branch (1069:29): [True: 3.08k, False: 8.20k]
  ------------------
 1070|  9.95k|          aom_scaled_2d_c(src_ptr, src_stride, dst_ptr, dst_stride, kernel,
 1071|  9.95k|                          x_q4 & 0xf, 16 * src_w / dst_w, y_q4 & 0xf,
 1072|  9.95k|                          16 * src_h / dst_h, work_w, work_h);
 1073|  9.95k|        } else {
 1074|  8.20k|          aom_scaled_2d(src_ptr, src_stride, dst_ptr, dst_stride, kernel,
 1075|  8.20k|                        x_q4 & 0xf, 16 * src_w / dst_w, y_q4 & 0xf,
 1076|  8.20k|                        16 * src_h / dst_h, 16, 16);
 1077|  8.20k|        }
 1078|  18.1k|      }
 1079|  7.42k|    }
 1080|  3.94k|  }
 1081|  2.39k|  aom_extend_frame_borders(dst, num_planes);
  ------------------
  |  |   31|  2.39k|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
 1082|  2.39k|}
av1_resize_and_extend_frame_nonnormative:
 1086|   132k|                                              int num_planes) {
 1087|       |  // TODO(dkovalev): replace YV12_BUFFER_CONFIG with aom_image_t
 1088|       |
 1089|       |  // We use AOMMIN(num_planes, MAX_MB_PLANE) instead of num_planes to quiet
 1090|       |  // the static analysis warnings.
 1091|   367k|  for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); ++i) {
  ------------------
  |  |   34|   367k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 163k, False: 204k]
  |  |  ------------------
  ------------------
  |  Branch (1091:19): [True: 234k, False: 132k]
  ------------------
 1092|   234k|    const int is_uv = i > 0;
 1093|   234k|#if CONFIG_AV1_HIGHBITDEPTH
 1094|   234k|    if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   234k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (1094:9): [True: 74.0k, False: 160k]
  ------------------
 1095|  74.0k|      highbd_resize_plane(src->buffers[i], src->crop_heights[is_uv],
 1096|  74.0k|                          src->crop_widths[is_uv], src->strides[is_uv],
 1097|  74.0k|                          dst->buffers[i], dst->crop_heights[is_uv],
 1098|  74.0k|                          dst->crop_widths[is_uv], dst->strides[is_uv], bd);
 1099|   160k|    } else if (!av1_resize_plane(src->buffers[i], src->crop_heights[is_uv],
  ------------------
  |  Branch (1099:16): [True: 0, False: 160k]
  ------------------
 1100|   160k|                                 src->crop_widths[is_uv], src->strides[is_uv],
 1101|   160k|                                 dst->buffers[i], dst->crop_heights[is_uv],
 1102|   160k|                                 dst->crop_widths[is_uv],
 1103|   160k|                                 dst->strides[is_uv])) {
 1104|      0|      return false;
 1105|      0|    }
 1106|       |#else
 1107|       |    (void)bd;
 1108|       |    if (!av1_resize_plane(src->buffers[i], src->crop_heights[is_uv],
 1109|       |                          src->crop_widths[is_uv], src->strides[is_uv],
 1110|       |                          dst->buffers[i], dst->crop_heights[is_uv],
 1111|       |                          dst->crop_widths[is_uv], dst->strides[is_uv]))
 1112|       |      return false;
 1113|       |#endif
 1114|   234k|  }
 1115|   132k|  aom_extend_frame_borders(dst, num_planes);
  ------------------
  |  |   31|   132k|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
 1116|       |  return true;
 1117|   132k|}
av1_realloc_and_scale_if_required:
 1206|   110k|    const bool for_psnr, const int border_in_pixels, const bool alloc_pyramid) {
 1207|       |  // If scaling is performed for the sole purpose of calculating PSNR, then our
 1208|       |  // target dimensions are superres upscaled width/height. Otherwise our target
 1209|       |  // dimensions are coded width/height.
 1210|   110k|  const int scaled_width = for_psnr ? cm->superres_upscaled_width : cm->width;
  ------------------
  |  Branch (1210:28): [True: 0, False: 110k]
  ------------------
 1211|   110k|  const int scaled_height =
 1212|   110k|      for_psnr ? cm->superres_upscaled_height : cm->height;
  ------------------
  |  Branch (1212:7): [True: 0, False: 110k]
  ------------------
 1213|   110k|  const bool scaling_required = (scaled_width != unscaled->y_crop_width) ||
  ------------------
  |  Branch (1213:33): [True: 92.0k, False: 18.4k]
  ------------------
 1214|  18.4k|                                (scaled_height != unscaled->y_crop_height);
  ------------------
  |  Branch (1214:33): [True: 0, False: 18.4k]
  ------------------
 1215|       |
 1216|   110k|  if (scaling_required) {
  ------------------
  |  Branch (1216:7): [True: 92.0k, False: 18.4k]
  ------------------
 1217|  92.0k|    const int num_planes = av1_num_planes(cm);
 1218|  92.0k|    const SequenceHeader *seq_params = cm->seq_params;
 1219|       |
 1220|       |    // Reallocate the frame buffer based on the target dimensions when scaling
 1221|       |    // is required.
 1222|  92.0k|    if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (1222:9): [True: 0, False: 92.0k]
  ------------------
 1223|  92.0k|            scaled, scaled_width, scaled_height, seq_params->subsampling_x,
 1224|  92.0k|            seq_params->subsampling_y, seq_params->use_highbitdepth,
 1225|  92.0k|            border_in_pixels, cm->features.byte_alignment, NULL, NULL, NULL,
 1226|  92.0k|            alloc_pyramid, 0))
 1227|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1228|      0|                         "Failed to allocate scaled buffer");
 1229|       |
 1230|  92.0k|    bool has_optimized_scaler = av1_has_optimized_scaler(
 1231|  92.0k|        unscaled->y_crop_width, unscaled->y_crop_height, scaled_width,
 1232|  92.0k|        scaled_height);
 1233|  92.0k|    if (num_planes > 1) {
  ------------------
  |  Branch (1233:9): [True: 34.9k, False: 57.0k]
  ------------------
 1234|  34.9k|      has_optimized_scaler = has_optimized_scaler &&
  ------------------
  |  Branch (1234:30): [True: 1.24k, False: 33.7k]
  ------------------
 1235|  1.24k|                             av1_has_optimized_scaler(unscaled->uv_crop_width,
  ------------------
  |  Branch (1235:30): [True: 1.00k, False: 233]
  ------------------
 1236|  1.24k|                                                      unscaled->uv_crop_height,
 1237|  1.24k|                                                      scaled->uv_crop_width,
 1238|  1.24k|                                                      scaled->uv_crop_height);
 1239|  34.9k|    }
 1240|       |
 1241|  92.0k|#if CONFIG_AV1_HIGHBITDEPTH
 1242|  92.0k|    if (use_optimized_scaler && has_optimized_scaler &&
  ------------------
  |  Branch (1242:9): [True: 92.0k, False: 0]
  |  Branch (1242:33): [True: 3.44k, False: 88.5k]
  ------------------
 1243|  3.44k|        cm->seq_params->bit_depth == AOM_BITS_8) {
  ------------------
  |  Branch (1243:9): [True: 2.53k, False: 910]
  ------------------
 1244|  2.53k|      av1_resize_and_extend_frame(unscaled, scaled, filter, phase, num_planes);
 1245|  89.4k|    } else {
 1246|  89.4k|      if (!av1_resize_and_extend_frame_nonnormative(
  ------------------
  |  Branch (1246:11): [True: 0, False: 89.4k]
  ------------------
 1247|  89.4k|              unscaled, scaled, (int)cm->seq_params->bit_depth, num_planes))
 1248|      0|        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1249|      0|                           "Failed to allocate buffers during resize");
 1250|  89.4k|    }
 1251|       |#else
 1252|       |    if (use_optimized_scaler && has_optimized_scaler) {
 1253|       |      av1_resize_and_extend_frame(unscaled, scaled, filter, phase, num_planes);
 1254|       |    } else {
 1255|       |      if (!av1_resize_and_extend_frame_nonnormative(
 1256|       |              unscaled, scaled, (int)cm->seq_params->bit_depth, num_planes))
 1257|       |        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1258|       |                           "Failed to allocate buffers during resize");
 1259|       |    }
 1260|       |#endif
 1261|  92.0k|    if (unscaled->metadata &&
  ------------------
  |  Branch (1261:9): [True: 0, False: 92.0k]
  ------------------
 1262|      0|        aom_copy_metadata_to_frame_buffer(scaled, unscaled->metadata)) {
  ------------------
  |  Branch (1262:9): [True: 0, False: 0]
  ------------------
 1263|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1264|      0|                         "Failed to copy source metadata to scaled frame");
 1265|      0|    }
 1266|  92.0k|    return scaled;
 1267|  92.0k|  }
 1268|  18.4k|  return unscaled;
 1269|   110k|}
av1_calculate_scaled_size:
 1291|  18.4k|void av1_calculate_scaled_size(int *width, int *height, int resize_denom) {
 1292|  18.4k|  calculate_scaled_size_helper(width, resize_denom);
 1293|  18.4k|  calculate_scaled_size_helper(height, resize_denom);
 1294|  18.4k|}
av1_calculate_scaled_superres_size:
 1297|  73.6k|                                        int superres_denom) {
 1298|  73.6k|  (void)height;
 1299|  73.6k|  calculate_scaled_size_helper(width, superres_denom);
 1300|  73.6k|}
resize.c:fill_col_to_arr:
  505|  5.51M|static void fill_col_to_arr(uint8_t *img, int stride, int len, uint8_t *arr) {
  506|  5.51M|  int i;
  507|  5.51M|  uint8_t *iptr = img;
  508|  5.51M|  uint8_t *aptr = arr;
  509|   411M|  for (i = 0; i < len; ++i, iptr += stride) {
  ------------------
  |  Branch (509:15): [True: 405M, False: 5.51M]
  ------------------
  510|   405M|    *aptr++ = *iptr;
  511|   405M|  }
  512|  5.51M|}
resize.c:fill_arr_to_col:
  514|  5.51M|static void fill_arr_to_col(uint8_t *img, int stride, int len, uint8_t *arr) {
  515|  5.51M|  int i;
  516|  5.51M|  uint8_t *iptr = img;
  517|  5.51M|  uint8_t *aptr = arr;
  518|   352M|  for (i = 0; i < len; ++i, iptr += stride) {
  ------------------
  |  Branch (518:15): [True: 347M, False: 5.51M]
  ------------------
  519|   347M|    *iptr = *aptr++;
  520|   347M|  }
  521|  5.51M|}
resize.c:get_down2_length:
  449|  36.1M|static int get_down2_length(int length, int steps) {
  450|  72.2M|  for (int s = 0; s < steps; ++s) length = (length + 1) >> 1;
  ------------------
  |  Branch (450:19): [True: 36.1M, False: 36.1M]
  ------------------
  451|  36.1M|  return length;
  452|  36.1M|}
resize.c:resize_multistep:
  471|  12.6M|                             uint8_t *output, int olength, uint8_t *otmp) {
  472|  12.6M|  if (length == olength) {
  ------------------
  |  Branch (472:7): [True: 576k, False: 12.0M]
  ------------------
  473|   576k|    memcpy(output, input, sizeof(output[0]) * length);
  474|   576k|    return;
  475|   576k|  }
  476|  12.0M|  const int steps = get_down2_steps(length, olength);
  477|       |
  478|  12.0M|  if (steps > 0) {
  ------------------
  |  Branch (478:7): [True: 2.90M, False: 9.17M]
  ------------------
  479|  2.90M|    uint8_t *out = NULL;
  480|  2.90M|    int filteredlength = length;
  481|       |
  482|  2.90M|    assert(otmp != NULL);
  483|  2.90M|    uint8_t *otmp2 = otmp + get_down2_length(length, 1);
  484|  8.44M|    for (int s = 0; s < steps; ++s) {
  ------------------
  |  Branch (484:21): [True: 5.54M, False: 2.90M]
  ------------------
  485|  5.54M|      const int proj_filteredlength = get_down2_length(filteredlength, 1);
  486|  5.54M|      const uint8_t *const in = (s == 0 ? input : out);
  ------------------
  |  Branch (486:34): [True: 2.90M, False: 2.63M]
  ------------------
  487|  5.54M|      if (s == steps - 1 && proj_filteredlength == olength)
  ------------------
  |  Branch (487:11): [True: 2.90M, False: 2.63M]
  |  Branch (487:29): [True: 2.90M, False: 0]
  ------------------
  488|  2.90M|        out = output;
  489|  2.63M|      else
  490|  2.63M|        out = (s & 1 ? otmp2 : otmp);
  ------------------
  |  Branch (490:16): [True: 870k, False: 1.76M]
  ------------------
  491|  5.54M|      if (filteredlength & 1)
  ------------------
  |  Branch (491:11): [True: 2.31M, False: 3.22M]
  ------------------
  492|  2.31M|        down2_symodd(in, filteredlength, out);
  493|  3.22M|      else
  494|  3.22M|        down2_symeven(in, filteredlength, out, 0);
  495|  5.54M|      filteredlength = proj_filteredlength;
  496|  5.54M|    }
  497|  2.90M|    if (filteredlength != olength) {
  ------------------
  |  Branch (497:9): [True: 0, False: 2.90M]
  ------------------
  498|      0|      interpolate(out, filteredlength, output, olength);
  499|      0|    }
  500|  9.17M|  } else {
  501|  9.17M|    interpolate(input, length, output, olength);
  502|  9.17M|  }
  503|  12.0M|}
resize.c:get_down2_steps:
  454|  16.4M|static int get_down2_steps(int in_length, int out_length) {
  455|  16.4M|  int steps = 0;
  456|  16.4M|  int proj_in_length;
  457|  23.9M|  while ((proj_in_length = get_down2_length(in_length, 1)) >= out_length) {
  ------------------
  |  Branch (457:10): [True: 7.99M, False: 15.9M]
  ------------------
  458|  7.99M|    ++steps;
  459|  7.99M|    in_length = proj_in_length;
  460|  7.99M|    if (in_length == 1) {
  ------------------
  |  Branch (460:9): [True: 503k, False: 7.49M]
  ------------------
  461|       |      // Special case: we break because any further calls to get_down2_length()
  462|       |      // with be with length == 1, which return 1, resulting in an infinite
  463|       |      // loop.
  464|   503k|      break;
  465|   503k|    }
  466|  7.99M|  }
  467|  16.4M|  return steps;
  468|  16.4M|}
resize.c:down2_symodd:
  395|  2.31M|                         uint8_t *output) {
  396|       |  // Actual filter len = 2 * filter_len_half - 1.
  397|  2.31M|  const int16_t *filter = av1_down2_symodd_half_filter;
  398|  2.31M|  const int filter_len_half = sizeof(av1_down2_symodd_half_filter) / 2;
  399|  2.31M|  int i, j;
  400|  2.31M|  uint8_t *optr = output;
  401|  2.31M|  int l1 = filter_len_half - 1;
  402|  2.31M|  int l2 = (length - filter_len_half + 1);
  403|  2.31M|  l1 += (l1 & 1);
  404|  2.31M|  l2 += (l2 & 1);
  405|  2.31M|  if (l1 > l2) {
  ------------------
  |  Branch (405:7): [True: 460k, False: 1.85M]
  ------------------
  406|       |    // Short input length.
  407|  1.64M|    for (i = 0; i < length; i += 2) {
  ------------------
  |  Branch (407:17): [True: 1.18M, False: 460k]
  ------------------
  408|  1.18M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  1.18M|#define FILTER_BITS 7
  ------------------
  409|  4.74M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (409:19): [True: 3.56M, False: 1.18M]
  ------------------
  410|  3.56M|        sum += (input[(i - j < 0 ? 0 : i - j)] +
  ------------------
  |  Branch (410:24): [True: 1.84M, False: 1.72M]
  ------------------
  411|  3.56M|                input[(i + j >= length ? length - 1 : i + j)]) *
  ------------------
  |  Branch (411:24): [True: 1.84M, False: 1.72M]
  ------------------
  412|  3.56M|               filter[j];
  413|  3.56M|      }
  414|  1.18M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.18M|#define FILTER_BITS 7
  ------------------
  415|  1.18M|      *optr++ = clip_pixel(sum);
  416|  1.18M|    }
  417|  1.85M|  } else {
  418|       |    // Initial part.
  419|  5.57M|    for (i = 0; i < l1; i += 2) {
  ------------------
  |  Branch (419:17): [True: 3.71M, False: 1.85M]
  ------------------
  420|  3.71M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  3.71M|#define FILTER_BITS 7
  ------------------
  421|  14.8M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (421:19): [True: 11.1M, False: 3.71M]
  ------------------
  422|  11.1M|        sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + j]) * filter[j];
  ------------------
  |  Branch (422:24): [True: 7.43M, False: 3.71M]
  ------------------
  423|  11.1M|      }
  424|  3.71M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  3.71M|#define FILTER_BITS 7
  ------------------
  425|  3.71M|      *optr++ = clip_pixel(sum);
  426|  3.71M|    }
  427|       |    // Middle part.
  428|  63.6M|    for (; i < l2; i += 2) {
  ------------------
  |  Branch (428:12): [True: 61.8M, False: 1.85M]
  ------------------
  429|  61.8M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  61.8M|#define FILTER_BITS 7
  ------------------
  430|   247M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (430:19): [True: 185M, False: 61.8M]
  ------------------
  431|   185M|        sum += (input[i - j] + input[i + j]) * filter[j];
  432|   185M|      }
  433|  61.8M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  61.8M|#define FILTER_BITS 7
  ------------------
  434|  61.8M|      *optr++ = clip_pixel(sum);
  435|  61.8M|    }
  436|       |    // End part.
  437|  5.57M|    for (; i < length; i += 2) {
  ------------------
  |  Branch (437:12): [True: 3.71M, False: 1.85M]
  ------------------
  438|  3.71M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  3.71M|#define FILTER_BITS 7
  ------------------
  439|  14.8M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (439:19): [True: 11.1M, False: 3.71M]
  ------------------
  440|  11.1M|        sum += (input[i - j] + input[(i + j >= length ? length - 1 : i + j)]) *
  ------------------
  |  Branch (440:39): [True: 7.43M, False: 3.71M]
  ------------------
  441|  11.1M|               filter[j];
  442|  11.1M|      }
  443|  3.71M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  3.71M|#define FILTER_BITS 7
  ------------------
  444|  3.71M|      *optr++ = clip_pixel(sum);
  445|  3.71M|    }
  446|  1.85M|  }
  447|  2.31M|}
resize.c:interpolate:
  316|  9.17M|                        uint8_t *output, int out_length) {
  317|  9.17M|  const InterpKernel *interp_filters =
  318|  9.17M|      choose_interp_filter(in_length, out_length);
  319|       |
  320|  9.17M|  interpolate_core(input, in_length, output, out_length, &interp_filters[0][0],
  321|  9.17M|                   SUBPEL_TAPS);
  ------------------
  |  |   26|  9.17M|#define SUBPEL_TAPS 8
  ------------------
  322|  9.17M|}
resize.c:choose_interp_filter:
  219|  12.1M|static const InterpKernel *choose_interp_filter(int in_length, int out_length) {
  220|  12.1M|  int out_length16 = out_length * 16;
  221|  12.1M|  if (out_length16 >= in_length * 16)
  ------------------
  |  Branch (221:7): [True: 4.35M, False: 7.83M]
  ------------------
  222|  4.35M|    return filteredinterp_filters1000;
  ------------------
  |  |  217|  4.35M|#define filteredinterp_filters1000 av1_resize_filter_normative
  ------------------
  223|  7.83M|  else if (out_length16 >= in_length * 13)
  ------------------
  |  Branch (223:12): [True: 1.62M, False: 6.21M]
  ------------------
  224|  1.62M|    return filteredinterp_filters875;
  225|  6.21M|  else if (out_length16 >= in_length * 11)
  ------------------
  |  Branch (225:12): [True: 4.35M, False: 1.85M]
  ------------------
  226|  4.35M|    return filteredinterp_filters750;
  227|  1.85M|  else if (out_length16 >= in_length * 9)
  ------------------
  |  Branch (227:12): [True: 1.85M, False: 0]
  ------------------
  228|  1.85M|    return filteredinterp_filters625;
  229|      0|  else
  230|      0|    return filteredinterp_filters500;
  231|  12.1M|}
resize.c:interpolate_core:
  235|  9.17M|                             const int16_t *interp_filters, int interp_taps) {
  236|  9.17M|  const int32_t delta =
  237|  9.17M|      (((uint32_t)in_length << RS_SCALE_SUBPEL_BITS) + out_length / 2) /
  ------------------
  |  |   36|  9.17M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  238|  9.17M|      out_length;
  239|  9.17M|  const int32_t offset =
  240|  9.17M|      in_length > out_length
  ------------------
  |  Branch (240:7): [True: 5.96M, False: 3.20M]
  ------------------
  241|  9.17M|          ? (((int32_t)(in_length - out_length) << (RS_SCALE_SUBPEL_BITS - 1)) +
  ------------------
  |  |   36|  5.96M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  242|  5.96M|             out_length / 2) /
  243|  5.96M|                out_length
  244|  9.17M|          : -(((int32_t)(out_length - in_length)
  245|  3.20M|               << (RS_SCALE_SUBPEL_BITS - 1)) +
  ------------------
  |  |   36|  3.20M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  246|  3.20M|              out_length / 2) /
  247|  3.20M|                out_length;
  248|  9.17M|  uint8_t *optr = output;
  249|  9.17M|  int x, x1, x2, sum, k, int_pel, sub_pel;
  250|  9.17M|  int32_t y;
  251|       |
  252|  9.17M|  x = 0;
  253|  9.17M|  y = offset + RS_SCALE_EXTRA_OFF;
  ------------------
  |  |   39|  9.17M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  9.17M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  9.17M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  9.17M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  46.0M|  while ((y >> RS_SCALE_SUBPEL_BITS) < (interp_taps / 2 - 1)) {
  ------------------
  |  |   36|  46.0M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  |  Branch (254:10): [True: 36.8M, False: 9.17M]
  ------------------
  255|  36.8M|    x++;
  256|  36.8M|    y += delta;
  257|  36.8M|  }
  258|  9.17M|  x1 = x;
  259|  9.17M|  x = out_length - 1;
  260|  9.17M|  y = delta * x + offset + RS_SCALE_EXTRA_OFF;
  ------------------
  |  |   39|  9.17M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  9.17M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  9.17M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  9.17M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|  46.2M|  while ((y >> RS_SCALE_SUBPEL_BITS) + (int32_t)(interp_taps / 2) >=
  ------------------
  |  |   36|  46.2M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  |  Branch (261:10): [True: 37.0M, False: 9.17M]
  ------------------
  262|  46.2M|         in_length) {
  263|  37.0M|    x--;
  264|  37.0M|    y -= delta;
  265|  37.0M|  }
  266|  9.17M|  x2 = x;
  267|  9.17M|  if (x1 > x2) {
  ------------------
  |  Branch (267:7): [True: 1.22M, False: 7.95M]
  ------------------
  268|  9.75M|    for (x = 0, y = offset + RS_SCALE_EXTRA_OFF; x < out_length;
  ------------------
  |  |   39|  1.22M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  1.22M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.22M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.22M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (268:50): [True: 8.53M, False: 1.22M]
  ------------------
  269|  8.53M|         ++x, y += delta) {
  270|  8.53M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  8.53M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  271|  8.53M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  8.53M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  8.53M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  8.53M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  8.53M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  8.53M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  272|  8.53M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  273|  8.53M|      sum = 0;
  274|  76.8M|      for (k = 0; k < interp_taps; ++k) {
  ------------------
  |  Branch (274:19): [True: 68.2M, False: 8.53M]
  ------------------
  275|  68.2M|        const int pk = int_pel - interp_taps / 2 + 1 + k;
  276|  68.2M|        sum += filter[k] * input[clamp(pk, 0, in_length - 1)];
  277|  68.2M|      }
  278|  8.53M|      *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|  8.53M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  279|  8.53M|    }
  280|  7.95M|  } else {
  281|       |    // Initial part.
  282|  37.0M|    for (x = 0, y = offset + RS_SCALE_EXTRA_OFF; x < x1; ++x, y += delta) {
  ------------------
  |  |   39|  7.95M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  7.95M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  7.95M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  7.95M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (282:50): [True: 29.1M, False: 7.95M]
  ------------------
  283|  29.1M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  29.1M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  284|  29.1M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  29.1M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  29.1M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  29.1M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  29.1M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  29.1M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  285|  29.1M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  286|  29.1M|      sum = 0;
  287|   261M|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (287:19): [True: 232M, False: 29.1M]
  ------------------
  288|   232M|        sum += filter[k] * input[AOMMAX(int_pel - interp_taps / 2 + 1 + k, 0)];
  ------------------
  |  |   35|   232M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 139M, False: 92.8M]
  |  |  ------------------
  ------------------
  289|  29.1M|      *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|  29.1M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  290|  29.1M|    }
  291|       |    // Middle part.
  292|   593M|    for (; x <= x2; ++x, y += delta) {
  ------------------
  |  Branch (292:12): [True: 585M, False: 7.95M]
  ------------------
  293|   585M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|   585M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  294|   585M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|   585M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|   585M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|   585M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|   585M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|   585M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  295|   585M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  296|   585M|      sum = 0;
  297|  5.27G|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (297:19): [True: 4.68G, False: 585M]
  ------------------
  298|  4.68G|        sum += filter[k] * input[int_pel - interp_taps / 2 + 1 + k];
  299|   585M|      *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|   585M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  300|   585M|    }
  301|       |    // End part.
  302|  37.0M|    for (; x < out_length; ++x, y += delta) {
  ------------------
  |  Branch (302:12): [True: 29.1M, False: 7.95M]
  ------------------
  303|  29.1M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  29.1M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  304|  29.1M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  29.1M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  29.1M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  29.1M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  29.1M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  29.1M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  305|  29.1M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  306|  29.1M|      sum = 0;
  307|   262M|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (307:19): [True: 233M, False: 29.1M]
  ------------------
  308|   233M|        sum += filter[k] *
  309|   233M|               input[AOMMIN(int_pel - interp_taps / 2 + 1 + k, in_length - 1)];
  ------------------
  |  |   34|   233M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 139M, False: 93.5M]
  |  |  ------------------
  ------------------
  310|  29.1M|      *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
  ------------------
  |  |   41|  29.1M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  311|  29.1M|    }
  312|  7.95M|  }
  313|  9.17M|}
resize.c:highbd_resize_plane:
  937|  74.0k|                                int width2, int out_stride, int bd) {
  938|  74.0k|  int i;
  939|  74.0k|  uint16_t *intbuf = (uint16_t *)aom_malloc(sizeof(uint16_t) * width2 * height);
  940|  74.0k|  uint16_t *tmpbuf =
  941|  74.0k|      (uint16_t *)aom_malloc(sizeof(uint16_t) * AOMMAX(width, height));
  ------------------
  |  |   35|  74.0k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 27.3k, False: 46.6k]
  |  |  ------------------
  ------------------
  942|  74.0k|  uint16_t *arrbuf = (uint16_t *)aom_malloc(sizeof(uint16_t) * height);
  943|  74.0k|  uint16_t *arrbuf2 = (uint16_t *)aom_malloc(sizeof(uint16_t) * height2);
  944|  74.0k|  if (intbuf == NULL || tmpbuf == NULL || arrbuf == NULL || arrbuf2 == NULL)
  ------------------
  |  Branch (944:7): [True: 0, False: 74.0k]
  |  Branch (944:25): [True: 0, False: 74.0k]
  |  Branch (944:43): [True: 0, False: 74.0k]
  |  Branch (944:61): [True: 0, False: 74.0k]
  ------------------
  945|      0|    goto Error;
  946|  2.70M|  for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (946:15): [True: 2.63M, False: 74.0k]
  ------------------
  947|  2.63M|    highbd_resize_multistep(CONVERT_TO_SHORTPTR(input + in_stride * i), width,
  ------------------
  |  |   79|  2.63M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  948|  2.63M|                            intbuf + width2 * i, width2, tmpbuf, bd);
  949|  2.63M|  }
  950|  2.01M|  for (i = 0; i < width2; ++i) {
  ------------------
  |  Branch (950:15): [True: 1.93M, False: 74.0k]
  ------------------
  951|  1.93M|    highbd_fill_col_to_arr(intbuf + i, width2, height, arrbuf);
  952|  1.93M|    highbd_resize_multistep(arrbuf, height, arrbuf2, height2, tmpbuf, bd);
  953|  1.93M|    highbd_fill_arr_to_col(CONVERT_TO_SHORTPTR(output + i), out_stride, height2,
  ------------------
  |  |   79|  1.93M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  954|  1.93M|                           arrbuf2);
  955|  1.93M|  }
  956|       |
  957|  74.0k|Error:
  958|  74.0k|  aom_free(intbuf);
  959|  74.0k|  aom_free(tmpbuf);
  960|  74.0k|  aom_free(arrbuf);
  961|  74.0k|  aom_free(arrbuf2);
  962|  74.0k|}
resize.c:highbd_resize_multistep:
  881|  4.57M|                                    uint16_t *otmp, int bd) {
  882|  4.57M|  if (length == olength) {
  ------------------
  |  Branch (882:7): [True: 234k, False: 4.33M]
  ------------------
  883|   234k|    memcpy(output, input, sizeof(output[0]) * length);
  884|   234k|    return;
  885|   234k|  }
  886|  4.33M|  const int steps = get_down2_steps(length, olength);
  887|       |
  888|  4.33M|  if (steps > 0) {
  ------------------
  |  Branch (888:7): [True: 1.31M, False: 3.01M]
  ------------------
  889|  1.31M|    uint16_t *out = NULL;
  890|  1.31M|    int filteredlength = length;
  891|       |
  892|  1.31M|    assert(otmp != NULL);
  893|  1.31M|    uint16_t *otmp2 = otmp + get_down2_length(length, 1);
  894|  3.76M|    for (int s = 0; s < steps; ++s) {
  ------------------
  |  Branch (894:21): [True: 2.45M, False: 1.31M]
  ------------------
  895|  2.45M|      const int proj_filteredlength = get_down2_length(filteredlength, 1);
  896|  2.45M|      const uint16_t *const in = (s == 0 ? input : out);
  ------------------
  |  Branch (896:35): [True: 1.31M, False: 1.13M]
  ------------------
  897|  2.45M|      if (s == steps - 1 && proj_filteredlength == olength)
  ------------------
  |  Branch (897:11): [True: 1.31M, False: 1.13M]
  |  Branch (897:29): [True: 1.31M, False: 0]
  ------------------
  898|  1.31M|        out = output;
  899|  1.13M|      else
  900|  1.13M|        out = (s & 1 ? otmp2 : otmp);
  ------------------
  |  Branch (900:16): [True: 373k, False: 761k]
  ------------------
  901|  2.45M|      if (filteredlength & 1)
  ------------------
  |  Branch (901:11): [True: 1.16M, False: 1.28M]
  ------------------
  902|  1.16M|        highbd_down2_symodd(in, filteredlength, out, bd);
  903|  1.28M|      else
  904|  1.28M|        highbd_down2_symeven(in, filteredlength, out, bd);
  905|  2.45M|      filteredlength = proj_filteredlength;
  906|  2.45M|    }
  907|  1.31M|    if (filteredlength != olength) {
  ------------------
  |  Branch (907:9): [True: 0, False: 1.31M]
  ------------------
  908|      0|      highbd_interpolate(out, filteredlength, output, olength, bd);
  909|      0|    }
  910|  3.01M|  } else {
  911|  3.01M|    highbd_interpolate(input, length, output, olength, bd);
  912|  3.01M|  }
  913|  4.33M|}
resize.c:highbd_down2_symodd:
  827|  1.16M|                                uint16_t *output, int bd) {
  828|       |  // Actual filter len = 2 * filter_len_half - 1.
  829|  1.16M|  static const int16_t *filter = av1_down2_symodd_half_filter;
  830|  1.16M|  const int filter_len_half = sizeof(av1_down2_symodd_half_filter) / 2;
  831|  1.16M|  int i, j;
  832|  1.16M|  uint16_t *optr = output;
  833|  1.16M|  int l1 = filter_len_half - 1;
  834|  1.16M|  int l2 = (length - filter_len_half + 1);
  835|  1.16M|  l1 += (l1 & 1);
  836|  1.16M|  l2 += (l2 & 1);
  837|  1.16M|  if (l1 > l2) {
  ------------------
  |  Branch (837:7): [True: 551k, False: 614k]
  ------------------
  838|       |    // Short input length.
  839|  1.96M|    for (i = 0; i < length; i += 2) {
  ------------------
  |  Branch (839:17): [True: 1.41M, False: 551k]
  ------------------
  840|  1.41M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  1.41M|#define FILTER_BITS 7
  ------------------
  841|  5.66M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (841:19): [True: 4.24M, False: 1.41M]
  ------------------
  842|  4.24M|        sum += (input[AOMMAX(i - j, 0)] + input[AOMMIN(i + j, length - 1)]) *
  ------------------
  |  |   35|  4.24M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.48M, False: 2.75M]
  |  |  ------------------
  ------------------
                      sum += (input[AOMMAX(i - j, 0)] + input[AOMMIN(i + j, length - 1)]) *
  ------------------
  |  |   34|  4.24M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.48M, False: 2.75M]
  |  |  ------------------
  ------------------
  843|  4.24M|               filter[j];
  844|  4.24M|      }
  845|  1.41M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.41M|#define FILTER_BITS 7
  ------------------
  846|  1.41M|      *optr++ = clip_pixel_highbd(sum, bd);
  847|  1.41M|    }
  848|   614k|  } else {
  849|       |    // Initial part.
  850|  1.84M|    for (i = 0; i < l1; i += 2) {
  ------------------
  |  Branch (850:17): [True: 1.22M, False: 614k]
  ------------------
  851|  1.22M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  1.22M|#define FILTER_BITS 7
  ------------------
  852|  4.91M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (852:19): [True: 3.68M, False: 1.22M]
  ------------------
  853|  3.68M|        sum += (input[AOMMAX(i - j, 0)] + input[i + j]) * filter[j];
  ------------------
  |  |   35|  3.68M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 614k, False: 3.07M]
  |  |  ------------------
  ------------------
  854|  3.68M|      }
  855|  1.22M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.22M|#define FILTER_BITS 7
  ------------------
  856|  1.22M|      *optr++ = clip_pixel_highbd(sum, bd);
  857|  1.22M|    }
  858|       |    // Middle part.
  859|  5.45M|    for (; i < l2; i += 2) {
  ------------------
  |  Branch (859:12): [True: 4.84M, False: 614k]
  ------------------
  860|  4.84M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  4.84M|#define FILTER_BITS 7
  ------------------
  861|  19.3M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (861:19): [True: 14.5M, False: 4.84M]
  ------------------
  862|  14.5M|        sum += (input[i - j] + input[i + j]) * filter[j];
  863|  14.5M|      }
  864|  4.84M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  4.84M|#define FILTER_BITS 7
  ------------------
  865|  4.84M|      *optr++ = clip_pixel_highbd(sum, bd);
  866|  4.84M|    }
  867|       |    // End part.
  868|  1.84M|    for (; i < length; i += 2) {
  ------------------
  |  Branch (868:12): [True: 1.22M, False: 614k]
  ------------------
  869|  1.22M|      int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
  ------------------
  |  |   21|  1.22M|#define FILTER_BITS 7
  ------------------
  870|  4.91M|      for (j = 1; j < filter_len_half; ++j) {
  ------------------
  |  Branch (870:19): [True: 3.68M, False: 1.22M]
  ------------------
  871|  3.68M|        sum += (input[i - j] + input[AOMMIN(i + j, length - 1)]) * filter[j];
  ------------------
  |  |   34|  3.68M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 614k, False: 3.07M]
  |  |  ------------------
  ------------------
  872|  3.68M|      }
  873|  1.22M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.22M|#define FILTER_BITS 7
  ------------------
  874|  1.22M|      *optr++ = clip_pixel_highbd(sum, bd);
  875|  1.22M|    }
  876|   614k|  }
  877|  1.16M|}
resize.c:highbd_down2_symeven:
  772|  1.28M|                                 uint16_t *output, int bd) {
  773|       |  // Actual filter len = 2 * filter_len_half.
  774|  1.28M|  static const int16_t *filter = av1_down2_symeven_half_filter;
  775|  1.28M|  const int filter_len_half = sizeof(av1_down2_symeven_half_filter) / 2;
  776|  1.28M|  int i, j;
  777|  1.28M|  uint16_t *optr = output;
  778|  1.28M|  int l1 = filter_len_half;
  779|  1.28M|  int l2 = (length - filter_len_half);
  780|  1.28M|  l1 += (l1 & 1);
  781|  1.28M|  l2 += (l2 & 1);
  782|  1.28M|  if (l1 > l2) {
  ------------------
  |  Branch (782:7): [True: 635k, False: 650k]
  ------------------
  783|       |    // Short input length.
  784|  1.89M|    for (i = 0; i < length; i += 2) {
  ------------------
  |  Branch (784:17): [True: 1.25M, False: 635k]
  ------------------
  785|  1.25M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  1.25M|#define FILTER_BITS 7
  ------------------
  786|  6.28M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (786:19): [True: 5.03M, False: 1.25M]
  ------------------
  787|  5.03M|        sum +=
  788|  5.03M|            (input[AOMMAX(0, i - j)] + input[AOMMIN(i + 1 + j, length - 1)]) *
  ------------------
  |  |   35|  5.03M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.34M, False: 2.68M]
  |  |  ------------------
  ------------------
                          (input[AOMMAX(0, i - j)] + input[AOMMIN(i + 1 + j, length - 1)]) *
  ------------------
  |  |   34|  5.03M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.60M, False: 3.42M]
  |  |  ------------------
  ------------------
  789|  5.03M|            filter[j];
  790|  5.03M|      }
  791|  1.25M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.25M|#define FILTER_BITS 7
  ------------------
  792|  1.25M|      *optr++ = clip_pixel_highbd(sum, bd);
  793|  1.25M|    }
  794|   650k|  } else {
  795|       |    // Initial part.
  796|  1.95M|    for (i = 0; i < l1; i += 2) {
  ------------------
  |  Branch (796:17): [True: 1.30M, False: 650k]
  ------------------
  797|  1.30M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  1.30M|#define FILTER_BITS 7
  ------------------
  798|  6.50M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (798:19): [True: 5.20M, False: 1.30M]
  ------------------
  799|  5.20M|        sum += (input[AOMMAX(0, i - j)] + input[i + 1 + j]) * filter[j];
  ------------------
  |  |   35|  5.20M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.60M, False: 2.60M]
  |  |  ------------------
  ------------------
  800|  5.20M|      }
  801|  1.30M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.30M|#define FILTER_BITS 7
  ------------------
  802|  1.30M|      *optr++ = clip_pixel_highbd(sum, bd);
  803|  1.30M|    }
  804|       |    // Middle part.
  805|  5.34M|    for (; i < l2; i += 2) {
  ------------------
  |  Branch (805:12): [True: 4.68M, False: 650k]
  ------------------
  806|  4.68M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  4.68M|#define FILTER_BITS 7
  ------------------
  807|  23.4M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (807:19): [True: 18.7M, False: 4.68M]
  ------------------
  808|  18.7M|        sum += (input[i - j] + input[i + 1 + j]) * filter[j];
  809|  18.7M|      }
  810|  4.68M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  4.68M|#define FILTER_BITS 7
  ------------------
  811|  4.68M|      *optr++ = clip_pixel_highbd(sum, bd);
  812|  4.68M|    }
  813|       |    // End part.
  814|  1.95M|    for (; i < length; i += 2) {
  ------------------
  |  Branch (814:12): [True: 1.30M, False: 650k]
  ------------------
  815|  1.30M|      int sum = (1 << (FILTER_BITS - 1));
  ------------------
  |  |   21|  1.30M|#define FILTER_BITS 7
  ------------------
  816|  6.50M|      for (j = 0; j < filter_len_half; ++j) {
  ------------------
  |  Branch (816:19): [True: 5.20M, False: 1.30M]
  ------------------
  817|  5.20M|        sum +=
  818|  5.20M|            (input[i - j] + input[AOMMIN(i + 1 + j, length - 1)]) * filter[j];
  ------------------
  |  |   34|  5.20M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.30M, False: 3.90M]
  |  |  ------------------
  ------------------
  819|  5.20M|      }
  820|  1.30M|      sum >>= FILTER_BITS;
  ------------------
  |  |   21|  1.30M|#define FILTER_BITS 7
  ------------------
  821|  1.30M|      *optr++ = clip_pixel_highbd(sum, bd);
  822|  1.30M|    }
  823|   650k|  }
  824|  1.28M|}
resize.c:highbd_interpolate:
  763|  3.01M|                               uint16_t *output, int out_length, int bd) {
  764|  3.01M|  const InterpKernel *interp_filters =
  765|  3.01M|      choose_interp_filter(in_length, out_length);
  766|       |
  767|  3.01M|  highbd_interpolate_core(input, in_length, output, out_length, bd,
  768|  3.01M|                          &interp_filters[0][0], SUBPEL_TAPS);
  ------------------
  |  |   26|  3.01M|#define SUBPEL_TAPS 8
  ------------------
  769|  3.01M|}
resize.c:highbd_interpolate_core:
  682|  3.01M|                                    int interp_taps) {
  683|  3.01M|  const int32_t delta =
  684|  3.01M|      (((uint32_t)in_length << RS_SCALE_SUBPEL_BITS) + out_length / 2) /
  ------------------
  |  |   36|  3.01M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  685|  3.01M|      out_length;
  686|  3.01M|  const int32_t offset =
  687|  3.01M|      in_length > out_length
  ------------------
  |  Branch (687:7): [True: 1.86M, False: 1.15M]
  ------------------
  688|  3.01M|          ? (((int32_t)(in_length - out_length) << (RS_SCALE_SUBPEL_BITS - 1)) +
  ------------------
  |  |   36|  1.86M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  689|  1.86M|             out_length / 2) /
  690|  1.86M|                out_length
  691|  3.01M|          : -(((int32_t)(out_length - in_length)
  692|  1.15M|               << (RS_SCALE_SUBPEL_BITS - 1)) +
  ------------------
  |  |   36|  1.15M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  693|  1.15M|              out_length / 2) /
  694|  1.15M|                out_length;
  695|  3.01M|  uint16_t *optr = output;
  696|  3.01M|  int x, x1, x2, sum, k, int_pel, sub_pel;
  697|  3.01M|  int32_t y;
  698|       |
  699|  3.01M|  x = 0;
  700|  3.01M|  y = offset + RS_SCALE_EXTRA_OFF;
  ------------------
  |  |   39|  3.01M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  3.01M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  3.01M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.01M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  15.5M|  while ((y >> RS_SCALE_SUBPEL_BITS) < (interp_taps / 2 - 1)) {
  ------------------
  |  |   36|  15.5M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  |  Branch (701:10): [True: 12.5M, False: 3.01M]
  ------------------
  702|  12.5M|    x++;
  703|  12.5M|    y += delta;
  704|  12.5M|  }
  705|  3.01M|  x1 = x;
  706|  3.01M|  x = out_length - 1;
  707|  3.01M|  y = delta * x + offset + RS_SCALE_EXTRA_OFF;
  ------------------
  |  |   39|  3.01M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  3.01M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  3.01M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.01M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|  15.7M|  while ((y >> RS_SCALE_SUBPEL_BITS) + (int32_t)(interp_taps / 2) >=
  ------------------
  |  |   36|  15.7M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  |  Branch (708:10): [True: 12.6M, False: 3.01M]
  ------------------
  709|  15.7M|         in_length) {
  710|  12.6M|    x--;
  711|  12.6M|    y -= delta;
  712|  12.6M|  }
  713|  3.01M|  x2 = x;
  714|  3.01M|  if (x1 > x2) {
  ------------------
  |  Branch (714:7): [True: 964k, False: 2.05M]
  ------------------
  715|  7.36M|    for (x = 0, y = offset + RS_SCALE_EXTRA_OFF; x < out_length;
  ------------------
  |  |   39|   964k|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|   964k|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   964k|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   964k|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (715:50): [True: 6.40M, False: 964k]
  ------------------
  716|  6.40M|         ++x, y += delta) {
  717|  6.40M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  6.40M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  718|  6.40M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  6.40M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  6.40M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  6.40M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  6.40M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  6.40M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  719|  6.40M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  720|  6.40M|      sum = 0;
  721|  57.6M|      for (k = 0; k < interp_taps; ++k) {
  ------------------
  |  Branch (721:19): [True: 51.2M, False: 6.40M]
  ------------------
  722|  51.2M|        const int pk = int_pel - interp_taps / 2 + 1 + k;
  723|  51.2M|        sum += filter[k] * input[clamp(pk, 0, in_length - 1)];
  724|  51.2M|      }
  725|  6.40M|      *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd);
  ------------------
  |  |   41|  6.40M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  726|  6.40M|    }
  727|  2.05M|  } else {
  728|       |    // Initial part.
  729|  8.64M|    for (x = 0, y = offset + RS_SCALE_EXTRA_OFF; x < x1; ++x, y += delta) {
  ------------------
  |  |   39|  2.05M|#define RS_SCALE_EXTRA_OFF (1 << (RS_SCALE_EXTRA_BITS - 1))
  |  |  ------------------
  |  |  |  |   38|  2.05M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  2.05M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  |  |  ------------------
  |  |  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.05M|#define RS_SUBPEL_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (729:50): [True: 6.58M, False: 2.05M]
  ------------------
  730|  6.58M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  6.58M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  731|  6.58M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  6.58M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  6.58M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  6.58M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  6.58M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  6.58M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  732|  6.58M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  733|  6.58M|      sum = 0;
  734|  59.2M|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (734:19): [True: 52.6M, False: 6.58M]
  ------------------
  735|  52.6M|        sum += filter[k] * input[AOMMAX(int_pel - interp_taps / 2 + 1 + k, 0)];
  ------------------
  |  |   35|  52.6M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 31.6M, False: 20.9M]
  |  |  ------------------
  ------------------
  736|  6.58M|      *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd);
  ------------------
  |  |   41|  6.58M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  737|  6.58M|    }
  738|       |    // Middle part.
  739|  38.7M|    for (; x <= x2; ++x, y += delta) {
  ------------------
  |  Branch (739:12): [True: 36.6M, False: 2.05M]
  ------------------
  740|  36.6M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  36.6M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  741|  36.6M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  36.6M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  36.6M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  36.6M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  36.6M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  36.6M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  742|  36.6M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  743|  36.6M|      sum = 0;
  744|   330M|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (744:19): [True: 293M, False: 36.6M]
  ------------------
  745|   293M|        sum += filter[k] * input[int_pel - interp_taps / 2 + 1 + k];
  746|  36.6M|      *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd);
  ------------------
  |  |   41|  36.6M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  747|  36.6M|    }
  748|       |    // End part.
  749|  8.65M|    for (; x < out_length; ++x, y += delta) {
  ------------------
  |  Branch (749:12): [True: 6.59M, False: 2.05M]
  ------------------
  750|  6.59M|      int_pel = y >> RS_SCALE_SUBPEL_BITS;
  ------------------
  |  |   36|  6.59M|#define RS_SCALE_SUBPEL_BITS 14
  ------------------
  751|  6.59M|      sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   38|  6.59M|#define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   36|  6.59M|#define RS_SCALE_SUBPEL_BITS 14
  |  |  ------------------
  |  |               #define RS_SCALE_EXTRA_BITS (RS_SCALE_SUBPEL_BITS - RS_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   34|  6.59M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
                    sub_pel = (y >> RS_SCALE_EXTRA_BITS) & RS_SUBPEL_MASK;
  ------------------
  |  |   35|  6.59M|#define RS_SUBPEL_MASK ((1 << RS_SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   34|  6.59M|#define RS_SUBPEL_BITS 6
  |  |  ------------------
  ------------------
  752|  6.59M|      const int16_t *filter = &interp_filters[sub_pel * interp_taps];
  753|  6.59M|      sum = 0;
  754|  59.3M|      for (k = 0; k < interp_taps; ++k)
  ------------------
  |  Branch (754:19): [True: 52.7M, False: 6.59M]
  ------------------
  755|  52.7M|        sum += filter[k] *
  756|  52.7M|               input[AOMMIN(int_pel - interp_taps / 2 + 1 + k, in_length - 1)];
  ------------------
  |  |   34|  52.7M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 31.6M, False: 21.1M]
  |  |  ------------------
  ------------------
  757|  6.59M|      *optr++ = clip_pixel_highbd(ROUND_POWER_OF_TWO(sum, FILTER_BITS), bd);
  ------------------
  |  |   41|  6.59M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  758|  6.59M|    }
  759|  2.05M|  }
  760|  3.01M|}
resize.c:highbd_fill_col_to_arr:
  916|  1.93M|                                   uint16_t *arr) {
  917|  1.93M|  int i;
  918|  1.93M|  uint16_t *iptr = img;
  919|  1.93M|  uint16_t *aptr = arr;
  920|  38.4M|  for (i = 0; i < len; ++i, iptr += stride) {
  ------------------
  |  Branch (920:15): [True: 36.5M, False: 1.93M]
  ------------------
  921|  36.5M|    *aptr++ = *iptr;
  922|  36.5M|  }
  923|  1.93M|}
resize.c:highbd_fill_arr_to_col:
  926|  1.93M|                                   uint16_t *arr) {
  927|  1.93M|  int i;
  928|  1.93M|  uint16_t *iptr = img;
  929|  1.93M|  uint16_t *aptr = arr;
  930|  32.8M|  for (i = 0; i < len; ++i, iptr += stride) {
  ------------------
  |  Branch (930:15): [True: 30.8M, False: 1.93M]
  ------------------
  931|  30.8M|    *iptr = *aptr++;
  932|  30.8M|  }
  933|  1.93M|}
resize.c:calculate_scaled_size_helper:
 1273|   110k|static void calculate_scaled_size_helper(int *dim, int denom) {
 1274|   110k|  if (denom != SCALE_NUMERATOR) {
  ------------------
  |  |   22|   110k|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1274:7): [True: 0, False: 110k]
  ------------------
 1275|       |    // We need to ensure the constraint in "Appendix A" of the spec:
 1276|       |    // * FrameWidth is greater than or equal to 16
 1277|       |    // * FrameHeight is greater than or equal to 16
 1278|       |    // For this, we clamp the downscaled dimension to at least 16. One
 1279|       |    // exception: if original dimension itself was < 16, then we keep the
 1280|       |    // downscaled dimension to be same as the original, to ensure that resizing
 1281|       |    // is valid.
 1282|      0|    const int min_dim = AOMMIN(16, *dim);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1283|       |    // Use this version if we need *dim to be even
 1284|       |    // *width = (*width * SCALE_NUMERATOR + denom) / (2 * denom);
 1285|       |    // *width <<= 1;
 1286|      0|    *dim = (*dim * SCALE_NUMERATOR + denom / 2) / (denom);
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
 1287|      0|    *dim = AOMMAX(*dim, min_dim);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1288|      0|  }
 1289|   110k|}

decodeframe.c:av1_superres_scaled:
   66|  50.7k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  50.7k|  return (cm->width != cm->superres_upscaled_width);
   71|  50.7k|}
bitstream.c:av1_superres_scaled:
   66|  1.98k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  1.98k|  return (cm->width != cm->superres_upscaled_width);
   71|  1.98k|}
encodeframe.c:av1_superres_scaled:
   66|  77.0k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  77.0k|  return (cm->width != cm->superres_upscaled_width);
   71|  77.0k|}
encoder.c:av1_superres_scaled:
   66|   245k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|   245k|  return (cm->width != cm->superres_upscaled_width);
   71|   245k|}
encoder_utils.c:av1_has_optimized_scaler:
   86|  45.9k|                                            const int dst_height) {
   87|  45.9k|  bool has_optimized_scaler =
   88|  45.9k|      (dst_width * 4 >= src_width && dst_height * 4 >= src_height) &&
  ------------------
  |  Branch (88:8): [True: 45.9k, False: 0]
  |  Branch (88:38): [True: 45.9k, False: 0]
  ------------------
   89|  45.9k|      (dst_width <= src_width * 16 && dst_height <= src_height * 16) &&
  ------------------
  |  Branch (89:8): [True: 45.9k, False: 0]
  |  Branch (89:39): [True: 45.9k, False: 0]
  ------------------
   90|  45.9k|      (16 * dst_width % src_width == 0) && (16 * src_width % dst_width == 0) &&
  ------------------
  |  Branch (90:7): [True: 21.1k, False: 24.8k]
  |  Branch (90:44): [True: 12.6k, False: 8.46k]
  ------------------
   91|  12.6k|      (16 * dst_height % src_height == 0) &&
  ------------------
  |  Branch (91:7): [True: 6.34k, False: 6.31k]
  ------------------
   92|  6.34k|      (16 * src_height % dst_height == 0);
  ------------------
  |  Branch (92:7): [True: 3.28k, False: 3.06k]
  ------------------
   93|  45.9k|#if HAVE_SSSE3 || HAVE_NEON
   94|  45.9k|  has_optimized_scaler =
   95|  45.9k|      has_optimized_scaler ||
  ------------------
  |  Branch (95:7): [True: 3.28k, False: 42.6k]
  ------------------
   96|  42.6k|      (4 * dst_width == 3 * src_width && 4 * dst_height == 3 * src_height);
  ------------------
  |  Branch (96:8): [True: 0, False: 42.6k]
  |  Branch (96:42): [True: 0, False: 0]
  ------------------
   97|  45.9k|#endif
   98|  45.9k|  return has_optimized_scaler;
   99|  45.9k|}
ethread.c:av1_superres_scaled:
   66|  56.0k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  56.0k|  return (cm->width != cm->superres_upscaled_width);
   71|  56.0k|}
partition_strategy.c:av1_superres_scaled:
   66|   920k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|   920k|  return (cm->width != cm->superres_upscaled_width);
   71|   920k|}
ratectrl.c:av1_superres_scaled:
   66|   184k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|   184k|  return (cm->width != cm->superres_upscaled_width);
   71|   184k|}
resize.c:av1_has_optimized_scaler:
   86|  93.2k|                                            const int dst_height) {
   87|  93.2k|  bool has_optimized_scaler =
   88|  93.2k|      (dst_width * 4 >= src_width && dst_height * 4 >= src_height) &&
  ------------------
  |  Branch (88:8): [True: 83.5k, False: 9.68k]
  |  Branch (88:38): [True: 76.5k, False: 6.99k]
  ------------------
   89|  76.5k|      (dst_width <= src_width * 16 && dst_height <= src_height * 16) &&
  ------------------
  |  Branch (89:8): [True: 76.5k, False: 0]
  |  Branch (89:39): [True: 76.5k, False: 0]
  ------------------
   90|  76.5k|      (16 * dst_width % src_width == 0) && (16 * src_width % dst_width == 0) &&
  ------------------
  |  Branch (90:7): [True: 25.0k, False: 51.5k]
  |  Branch (90:44): [True: 10.4k, False: 14.5k]
  ------------------
   91|  10.4k|      (16 * dst_height % src_height == 0) &&
  ------------------
  |  Branch (91:7): [True: 5.39k, False: 5.10k]
  ------------------
   92|  5.39k|      (16 * src_height % dst_height == 0);
  ------------------
  |  Branch (92:7): [True: 3.18k, False: 2.20k]
  ------------------
   93|  93.2k|#if HAVE_SSSE3 || HAVE_NEON
   94|  93.2k|  has_optimized_scaler =
   95|  93.2k|      has_optimized_scaler ||
  ------------------
  |  Branch (95:7): [True: 3.18k, False: 90.0k]
  ------------------
   96|  90.0k|      (4 * dst_width == 3 * src_width && 4 * dst_height == 3 * src_height);
  ------------------
  |  Branch (96:8): [True: 8.61k, False: 81.4k]
  |  Branch (96:42): [True: 1.50k, False: 7.10k]
  ------------------
   97|  93.2k|#endif
   98|  93.2k|  return has_optimized_scaler;
   99|  93.2k|}
restoration.c:av1_superres_scaled:
   66|  88.8k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  88.8k|  return (cm->width != cm->superres_upscaled_width);
   71|  88.8k|}
tile_common.c:av1_superres_scaled:
   66|  4.06k|static inline int av1_superres_scaled(const AV1_COMMON *cm) {
   67|       |  // Note: for some corner cases (e.g. cm->width of 1), there may be no scaling
   68|       |  // required even though cm->superres_scale_denominator != SCALE_NUMERATOR.
   69|       |  // So, the following check is more accurate.
   70|  4.06k|  return (cm->width != cm->superres_upscaled_width);
   71|  4.06k|}

av1_get_upsampled_plane_size:
   48|   122k|                                  int *plane_h) {
   49|   122k|  int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (49:14): [True: 38.5k, False: 83.6k]
  |  Branch (49:23): [True: 28.2k, False: 10.3k]
  ------------------
   50|   122k|  int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (50:14): [True: 38.5k, False: 83.6k]
  |  Branch (50:23): [True: 17.6k, False: 20.9k]
  ------------------
   51|   122k|  *plane_w = ROUND_POWER_OF_TWO(cm->superres_upscaled_width, ss_x);
  ------------------
  |  |   41|   122k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   52|   122k|  *plane_h = ROUND_POWER_OF_TWO(cm->height, ss_y);
  ------------------
  |  |   41|   122k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   53|   122k|}
av1_lr_count_units:
   63|   103k|int av1_lr_count_units(int unit_size, int plane_size) {
   64|   103k|  return AOMMAX((plane_size + (unit_size >> 1)) / unit_size, 1);
  ------------------
  |  |   35|   103k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.29k, False: 101k]
  |  |  ------------------
  ------------------
   65|   103k|}
av1_alloc_restoration_struct:
   68|    604|                                  int is_uv) {
   69|    604|  int plane_w, plane_h;
   70|    604|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
   71|       |
   72|    604|  const int unit_size = rsi->restoration_unit_size;
   73|    604|  const int horz_units = av1_lr_count_units(unit_size, plane_w);
   74|    604|  const int vert_units = av1_lr_count_units(unit_size, plane_h);
   75|       |
   76|    604|  rsi->num_rest_units = horz_units * vert_units;
   77|    604|  rsi->horz_units = horz_units;
   78|    604|  rsi->vert_units = vert_units;
   79|       |
   80|    604|  aom_free(rsi->unit_info);
   81|       |  CHECK_MEM_ERROR(cm, rsi->unit_info,
  ------------------
  |  |   51|    604|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|    604|  do {                                                    \
  |  |  |  |   72|    604|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|    604|    lval = (expr);                                        \
  |  |  |  |   74|    604|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 604]
  |  |  |  |  ------------------
  |  |  |  |   75|    604|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|    604|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 604]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|    604|                  (RestorationUnitInfo *)aom_memalign(
   83|    604|                      16, sizeof(*rsi->unit_info) * rsi->num_rest_units));
   84|    604|}
av1_free_restoration_struct:
   86|  76.2k|void av1_free_restoration_struct(RestorationInfo *rst_info) {
   87|  76.2k|  aom_free(rst_info->unit_info);
   88|       |  rst_info->unit_info = NULL;
   89|  76.2k|}
av1_loop_restoration_precal:
  116|  25.4k|void av1_loop_restoration_precal(void) {
  117|       |#if 0
  118|       |  GenSgrprojVtable();
  119|       |#endif
  120|  25.4k|}
av1_extend_frame:
  173|  13.1k|                      int border_horz, int border_vert, int highbd) {
  174|  13.1k|#if CONFIG_AV1_HIGHBITDEPTH
  175|  13.1k|  if (highbd) {
  ------------------
  |  Branch (175:7): [True: 2.74k, False: 10.3k]
  ------------------
  176|  2.74k|    extend_frame_highbd(CONVERT_TO_SHORTPTR(data), width, height, stride,
  ------------------
  |  |   79|  2.74k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  177|  2.74k|                        border_horz, border_vert);
  178|  2.74k|    return;
  179|  2.74k|  }
  180|  10.3k|#endif
  181|  10.3k|  (void)highbd;
  182|  10.3k|  extend_frame_lowbd(data, width, height, stride, border_horz, border_vert);
  183|  10.3k|}
av1_decode_xq:
  584|  69.7k|void av1_decode_xq(const int *xqd, int *xq, const sgr_params_type *params) {
  585|  69.7k|  if (params->r[0] == 0) {
  ------------------
  |  Branch (585:7): [True: 0, False: 69.7k]
  ------------------
  586|      0|    xq[0] = 0;
  587|      0|    xq[1] = (1 << SGRPROJ_PRJ_BITS) - xqd[1];
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
  588|  69.7k|  } else if (params->r[1] == 0) {
  ------------------
  |  Branch (588:14): [True: 0, False: 69.7k]
  ------------------
  589|      0|    xq[0] = xqd[0];
  590|      0|    xq[1] = 0;
  591|  69.7k|  } else {
  592|  69.7k|    xq[0] = xqd[0];
  593|  69.7k|    xq[1] = (1 << SGRPROJ_PRJ_BITS) - xq[0] - xqd[1];
  ------------------
  |  |   99|  69.7k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  594|  69.7k|  }
  595|  69.7k|}
av1_loop_restoration_filter_unit:
  992|  8.72k|    int optimized_lr, struct aom_internal_error_info *error_info) {
  993|  8.72k|  RestorationType unit_rtype = rui->restoration_type;
  994|       |
  995|  8.72k|  int unit_h = limits->v_end - limits->v_start;
  996|  8.72k|  int unit_w = limits->h_end - limits->h_start;
  997|  8.72k|  uint8_t *data8_tl =
  998|  8.72k|      data8 + limits->v_start * (ptrdiff_t)stride + limits->h_start;
  999|  8.72k|  uint8_t *dst8_tl =
 1000|  8.72k|      dst8 + limits->v_start * (ptrdiff_t)dst_stride + limits->h_start;
 1001|       |
 1002|  8.72k|  if (unit_rtype == RESTORE_NONE) {
  ------------------
  |  Branch (1002:7): [True: 74, False: 8.64k]
  ------------------
 1003|     74|    copy_rest_unit(unit_w, unit_h, data8_tl, stride, dst8_tl, dst_stride,
 1004|     74|                   highbd);
 1005|     74|    return;
 1006|     74|  }
 1007|       |
 1008|  8.64k|  const int filter_idx = 2 * highbd + (unit_rtype == RESTORE_SGRPROJ);
 1009|  8.64k|  assert(filter_idx < NUM_STRIPE_FILTERS);
 1010|  8.64k|  const stripe_filter_fun stripe_filter = stripe_filters[filter_idx];
 1011|       |
 1012|  8.64k|  const int procunit_width = RESTORATION_PROC_UNIT_SIZE >> ss_x;
  ------------------
  |  |   34|  8.64k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
 1013|       |
 1014|       |  // Filter the whole image one stripe at a time
 1015|  8.64k|  RestorationTileLimits remaining_stripes = *limits;
 1016|  8.64k|  int i = 0;
 1017|  20.3k|  while (i < unit_h) {
  ------------------
  |  Branch (1017:10): [True: 11.7k, False: 8.64k]
  ------------------
 1018|  11.7k|    int copy_above, copy_below;
 1019|  11.7k|    remaining_stripes.v_start = limits->v_start + i;
 1020|       |
 1021|  11.7k|    get_stripe_boundary_info(&remaining_stripes, plane_w, plane_h, ss_y,
 1022|  11.7k|                             &copy_above, &copy_below);
 1023|       |
 1024|  11.7k|    const int full_stripe_height = RESTORATION_PROC_UNIT_SIZE >> ss_y;
  ------------------
  |  |   34|  11.7k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
 1025|  11.7k|    const int runit_offset = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|  11.7k|#define RESTORATION_UNIT_OFFSET 8
  ------------------
 1026|       |
 1027|       |    // Work out where this stripe's boundaries are within
 1028|       |    // rsb->stripe_boundary_{above,below}
 1029|  11.7k|    const int frame_stripe =
 1030|  11.7k|        (remaining_stripes.v_start + runit_offset) / full_stripe_height;
 1031|  11.7k|    const int rsb_row = RESTORATION_CTX_VERT * frame_stripe;
  ------------------
  |  |   66|  11.7k|#define RESTORATION_CTX_VERT 2
  ------------------
 1032|       |
 1033|       |    // Calculate this stripe's height, based on two rules:
 1034|       |    // * The topmost stripe in the frame is 8 luma pixels shorter than usual.
 1035|       |    // * We can't extend past the end of the current restoration unit
 1036|  11.7k|    const int nominal_stripe_height =
 1037|  11.7k|        full_stripe_height - ((frame_stripe == 0) ? runit_offset : 0);
  ------------------
  |  Branch (1037:31): [True: 8.54k, False: 3.15k]
  ------------------
 1038|  11.7k|    const int h = AOMMIN(nominal_stripe_height,
  ------------------
  |  |   34|  11.7k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.05k, False: 8.64k]
  |  |  ------------------
  ------------------
 1039|  11.7k|                         remaining_stripes.v_end - remaining_stripes.v_start);
 1040|       |
 1041|  11.7k|    setup_processing_stripe_boundary(&remaining_stripes, rsb, rsb_row, highbd,
 1042|  11.7k|                                     h, data8, stride, rlbs, copy_above,
 1043|  11.7k|                                     copy_below, optimized_lr);
 1044|       |
 1045|  11.7k|    stripe_filter(rui, unit_w, h, procunit_width, data8_tl + i * stride, stride,
 1046|  11.7k|                  dst8_tl + i * dst_stride, dst_stride, tmpbuf, bit_depth,
 1047|  11.7k|                  error_info);
 1048|       |
 1049|  11.7k|    restore_processing_stripe_boundary(&remaining_stripes, rlbs, highbd, h,
 1050|  11.7k|                                       data8, stride, copy_above, copy_below,
 1051|  11.7k|                                       optimized_lr);
 1052|       |
 1053|  11.7k|    i += h;
 1054|  11.7k|  }
 1055|  8.64k|}
av1_loop_restoration_filter_frame_init:
 1074|  1.02k|                                            int num_planes) {
 1075|  1.02k|  const SequenceHeader *const seq_params = cm->seq_params;
 1076|  1.02k|  const int bit_depth = seq_params->bit_depth;
 1077|  1.02k|  const int highbd = seq_params->use_highbitdepth;
 1078|  1.02k|  lr_ctxt->dst = &cm->rst_frame;
 1079|       |
 1080|  1.02k|  const int frame_width = frame->crop_widths[0];
 1081|  1.02k|  const int frame_height = frame->crop_heights[0];
 1082|  1.02k|  if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (1082:7): [True: 0, False: 1.02k]
  ------------------
 1083|  1.02k|          lr_ctxt->dst, frame_width, frame_height, seq_params->subsampling_x,
 1084|  1.02k|          seq_params->subsampling_y, highbd, AOM_RESTORATION_FRAME_BORDER,
  ------------------
  |  |   30|  1.02k|#define AOM_RESTORATION_FRAME_BORDER 32
  ------------------
 1085|  1.02k|          cm->features.byte_alignment, NULL, NULL, NULL, false,
 1086|  1.02k|          0) != AOM_CODEC_OK)
 1087|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1088|      0|                       "Failed to allocate restoration dst buffer");
 1089|       |
 1090|  1.02k|  lr_ctxt->on_rest_unit = filter_frame_on_unit;
 1091|  1.02k|  lr_ctxt->frame = frame;
 1092|  3.15k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1092:23): [True: 2.13k, False: 1.02k]
  ------------------
 1093|  2.13k|    RestorationInfo *rsi = &cm->rst_info[plane];
 1094|  2.13k|    RestorationType rtype = rsi->frame_restoration_type;
 1095|  2.13k|    rsi->optimized_lr = optimized_lr;
 1096|  2.13k|    lr_ctxt->ctxt[plane].rsi = rsi;
 1097|       |
 1098|  2.13k|    if (rtype == RESTORE_NONE) {
  ------------------
  |  Branch (1098:9): [True: 1.03k, False: 1.10k]
  ------------------
 1099|  1.03k|      continue;
 1100|  1.03k|    }
 1101|       |
 1102|  1.10k|    const int is_uv = plane > 0;
 1103|  1.10k|    int plane_w, plane_h;
 1104|  1.10k|    av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 1105|  1.10k|    assert(plane_w == frame->crop_widths[is_uv]);
 1106|  1.10k|    assert(plane_h == frame->crop_heights[is_uv]);
 1107|       |
 1108|  1.10k|    av1_extend_frame(frame->buffers[plane], plane_w, plane_h,
 1109|  1.10k|                     frame->strides[is_uv], RESTORATION_BORDER,
  ------------------
  |  |   62|  1.10k|#define RESTORATION_BORDER 3
  ------------------
 1110|  1.10k|                     RESTORATION_BORDER, highbd);
  ------------------
  |  |   62|  1.10k|#define RESTORATION_BORDER 3
  ------------------
 1111|       |
 1112|  1.10k|    FilterFrameCtxt *lr_plane_ctxt = &lr_ctxt->ctxt[plane];
 1113|  1.10k|    lr_plane_ctxt->ss_x = is_uv && seq_params->subsampling_x;
  ------------------
  |  Branch (1113:27): [True: 223, False: 880]
  |  Branch (1113:36): [True: 50, False: 173]
  ------------------
 1114|  1.10k|    lr_plane_ctxt->ss_y = is_uv && seq_params->subsampling_y;
  ------------------
  |  Branch (1114:27): [True: 223, False: 880]
  |  Branch (1114:36): [True: 28, False: 195]
  ------------------
 1115|  1.10k|    lr_plane_ctxt->plane_w = plane_w;
 1116|  1.10k|    lr_plane_ctxt->plane_h = plane_h;
 1117|  1.10k|    lr_plane_ctxt->highbd = highbd;
 1118|  1.10k|    lr_plane_ctxt->bit_depth = bit_depth;
 1119|  1.10k|    lr_plane_ctxt->data8 = frame->buffers[plane];
 1120|  1.10k|    lr_plane_ctxt->dst8 = lr_ctxt->dst->buffers[plane];
 1121|  1.10k|    lr_plane_ctxt->data_stride = frame->strides[is_uv];
 1122|  1.10k|    lr_plane_ctxt->dst_stride = lr_ctxt->dst->strides[is_uv];
 1123|  1.10k|  }
 1124|  1.02k|}
av1_loop_restoration_filter_frame:
 1199|    769|                                       void *lr_ctxt) {
 1200|    769|  assert(!cm->features.all_lossless);
 1201|    769|  const int num_planes = av1_num_planes(cm);
 1202|       |
 1203|    769|  AV1LrStruct *loop_rest_ctxt = (AV1LrStruct *)lr_ctxt;
 1204|       |
 1205|    769|  av1_loop_restoration_filter_frame_init(loop_rest_ctxt, frame, cm,
 1206|    769|                                         optimized_lr, num_planes);
 1207|       |
 1208|    769|  foreach_rest_unit_in_planes(loop_rest_ctxt, cm, num_planes);
 1209|       |
 1210|    769|  loop_restoration_copy_planes(loop_rest_ctxt, cm, num_planes);
 1211|    769|}
av1_foreach_rest_unit_in_row:
 1219|  1.18k|    struct aom_internal_error_info *error_info) {
 1220|  1.18k|  const int ext_size = unit_size * 3 / 2;
 1221|  1.18k|  int x0 = 0, j = 0;
 1222|  2.42k|  while (x0 < plane_w) {
  ------------------
  |  Branch (1222:10): [True: 1.23k, False: 1.18k]
  ------------------
 1223|  1.23k|    int remaining_w = plane_w - x0;
 1224|  1.23k|    int w = (remaining_w < ext_size) ? remaining_w : unit_size;
  ------------------
  |  Branch (1224:13): [True: 1.18k, False: 46]
  ------------------
 1225|       |
 1226|  1.23k|    limits->h_start = x0;
 1227|  1.23k|    limits->h_end = x0 + w;
 1228|  1.23k|    assert(limits->h_end <= plane_w);
 1229|       |
 1230|  1.23k|    const int unit_idx = row_number * hnum_rest_units + j;
 1231|       |
 1232|       |    // No sync for even numbered rows
 1233|       |    // For odd numbered rows, Loop Restoration of current block requires the LR
 1234|       |    // of top-right and bottom-right blocks to be completed
 1235|       |
 1236|       |    // top-right sync
 1237|  1.23k|    on_sync_read(lr_sync, row_number, j, plane);
 1238|  1.23k|    if ((row_number + 1) < vnum_rest_units)
  ------------------
  |  Branch (1238:9): [True: 100, False: 1.13k]
  ------------------
 1239|       |      // bottom-right sync
 1240|    100|      on_sync_read(lr_sync, row_number + 2, j, plane);
 1241|       |
 1242|  1.23k|#if CONFIG_MULTITHREAD
 1243|  1.23k|    if (lr_sync && lr_sync->num_workers > 1) {
  ------------------
  |  Branch (1243:9): [True: 320, False: 915]
  |  Branch (1243:20): [True: 320, False: 0]
  ------------------
 1244|    320|      pthread_mutex_lock(lr_sync->job_mutex);
 1245|    320|      const bool lr_mt_exit = lr_sync->lr_mt_exit;
 1246|    320|      pthread_mutex_unlock(lr_sync->job_mutex);
 1247|       |      // Exit in case any worker has encountered an error.
 1248|    320|      if (lr_mt_exit) return;
  ------------------
  |  Branch (1248:11): [True: 0, False: 320]
  ------------------
 1249|    320|    }
 1250|  1.23k|#endif
 1251|       |
 1252|  1.23k|    on_rest_unit(limits, unit_idx, priv, tmpbuf, rlbs, error_info);
 1253|       |
 1254|  1.23k|    on_sync_write(lr_sync, row_number, j, hnum_rest_units, plane);
 1255|       |
 1256|  1.23k|    x0 += w;
 1257|  1.23k|    ++j;
 1258|  1.23k|  }
 1259|  1.18k|}
av1_lr_sync_read_dummy:
 1261|  1.30k|void av1_lr_sync_read_dummy(void *const lr_sync, int r, int c, int plane) {
 1262|  1.30k|  (void)lr_sync;
 1263|  1.30k|  (void)r;
 1264|  1.30k|  (void)c;
 1265|  1.30k|  (void)plane;
 1266|  1.30k|}
av1_lr_sync_write_dummy:
 1269|    947|                             const int sb_cols, int plane) {
 1270|    947|  (void)lr_sync;
 1271|    947|  (void)r;
 1272|    947|  (void)c;
 1273|    947|  (void)sb_cols;
 1274|    947|  (void)plane;
 1275|    947|}
av1_loop_restoration_corners_in_sb:
 1280|   194k|                                       int *rrow1) {
 1281|   194k|  assert(rcol0 && rcol1 && rrow0 && rrow1);
 1282|       |
 1283|   194k|  if (bsize != cm->seq_params->sb_size) return 0;
  ------------------
  |  Branch (1283:7): [True: 172k, False: 21.9k]
  ------------------
 1284|       |
 1285|   194k|  assert(!cm->features.all_lossless);
 1286|       |
 1287|  21.9k|  const int is_uv = plane > 0;
 1288|       |
 1289|       |  // Compute the mi-unit corners of the superblock
 1290|  21.9k|  const int mi_row0 = mi_row;
 1291|  21.9k|  const int mi_col0 = mi_col;
 1292|  21.9k|  const int mi_row1 = mi_row0 + mi_size_high[bsize];
 1293|  21.9k|  const int mi_col1 = mi_col0 + mi_size_wide[bsize];
 1294|       |
 1295|  21.9k|  const RestorationInfo *rsi = &cm->rst_info[plane];
 1296|  21.9k|  const int size = rsi->restoration_unit_size;
 1297|  21.9k|  const int horz_units = rsi->horz_units;
 1298|  21.9k|  const int vert_units = rsi->vert_units;
 1299|       |
 1300|       |  // The size of an MI-unit on this plane of the image
 1301|  21.9k|  const int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (1301:20): [True: 2.67k, False: 19.2k]
  |  Branch (1301:29): [True: 1.86k, False: 812]
  ------------------
 1302|  21.9k|  const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (1302:20): [True: 2.67k, False: 19.2k]
  |  Branch (1302:29): [True: 1.20k, False: 1.47k]
  ------------------
 1303|  21.9k|  const int mi_size_x = MI_SIZE >> ss_x;
  ------------------
  |  |   40|  21.9k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  21.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1304|  21.9k|  const int mi_size_y = MI_SIZE >> ss_y;
  ------------------
  |  |   40|  21.9k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  21.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1305|       |
 1306|       |  // Write m for the relative mi column or row, D for the superres denominator
 1307|       |  // and N for the superres numerator. If u is the upscaled pixel offset then
 1308|       |  // we can write the downscaled pixel offset in two ways as:
 1309|       |  //
 1310|       |  //   MI_SIZE * m = N / D u
 1311|       |  //
 1312|       |  // from which we get u = D * MI_SIZE * m / N
 1313|  21.9k|  const int mi_to_num_x = av1_superres_scaled(cm)
  ------------------
  |  Branch (1313:27): [True: 0, False: 21.9k]
  ------------------
 1314|  21.9k|                              ? mi_size_x * cm->superres_scale_denominator
 1315|  21.9k|                              : mi_size_x;
 1316|  21.9k|  const int mi_to_num_y = mi_size_y;
 1317|  21.9k|  const int denom_x = av1_superres_scaled(cm) ? size * SCALE_NUMERATOR : size;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (1317:23): [True: 0, False: 21.9k]
  ------------------
 1318|  21.9k|  const int denom_y = size;
 1319|       |
 1320|  21.9k|  const int rnd_x = denom_x - 1;
 1321|  21.9k|  const int rnd_y = denom_y - 1;
 1322|       |
 1323|       |  // rcol0/rrow0 should be the first column/row of restoration units that
 1324|       |  // doesn't start left/below of mi_col/mi_row. For this calculation, we need
 1325|       |  // to round up the division (if the sb starts at runit column 10.1, the first
 1326|       |  // matching runit has column index 11)
 1327|  21.9k|  *rcol0 = (mi_col0 * mi_to_num_x + rnd_x) / denom_x;
 1328|  21.9k|  *rrow0 = (mi_row0 * mi_to_num_y + rnd_y) / denom_y;
 1329|       |
 1330|       |  // rel_col1/rel_row1 is the equivalent calculation, but for the superblock
 1331|       |  // below-right. If we're at the bottom or right of the frame, this restoration
 1332|       |  // unit might not exist, in which case we'll clamp accordingly.
 1333|  21.9k|  *rcol1 = AOMMIN((mi_col1 * mi_to_num_x + rnd_x) / denom_x, horz_units);
  ------------------
  |  |   34|  21.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 484, False: 21.4k]
  |  |  ------------------
  ------------------
 1334|  21.9k|  *rrow1 = AOMMIN((mi_row1 * mi_to_num_y + rnd_y) / denom_y, vert_units);
  ------------------
  |  |   34|  21.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 639, False: 21.3k]
  |  |  ------------------
  ------------------
 1335|       |
 1336|  21.9k|  return *rcol0 < *rcol1 && *rrow0 < *rrow1;
  ------------------
  |  Branch (1336:10): [True: 16.4k, False: 5.56k]
  |  Branch (1336:29): [True: 13.4k, False: 2.92k]
  ------------------
 1337|   194k|}
av1_loop_restoration_save_boundary_lines:
 1498|  20.8k|                                              AV1_COMMON *cm, int after_cdef) {
 1499|  20.8k|  const int num_planes = av1_num_planes(cm);
 1500|  20.8k|  const int use_highbd = cm->seq_params->use_highbitdepth;
 1501|  57.1k|  for (int p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (1501:19): [True: 36.3k, False: 20.8k]
  ------------------
 1502|  36.3k|    save_boundary_lines(frame, use_highbd, p, cm, after_cdef);
 1503|  36.3k|  }
 1504|  20.8k|}
restoration.c:extend_frame_highbd:
  145|  2.74k|                                int border_vert) {
  146|  2.74k|  uint16_t *data_p;
  147|  2.74k|  int i, j;
  148|  90.1k|  for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (148:15): [True: 87.4k, False: 2.74k]
  ------------------
  149|  87.4k|    data_p = data + i * stride;
  150|   349k|    for (j = -border_horz; j < 0; ++j) data_p[j] = data_p[0];
  ------------------
  |  Branch (150:28): [True: 262k, False: 87.4k]
  ------------------
  151|   349k|    for (j = width; j < width + border_horz; ++j) data_p[j] = data_p[width - 1];
  ------------------
  |  Branch (151:21): [True: 262k, False: 87.4k]
  ------------------
  152|  87.4k|  }
  153|  2.74k|  data_p = data - border_horz;
  154|  10.9k|  for (i = -border_vert; i < 0; ++i) {
  ------------------
  |  Branch (154:26): [True: 8.22k, False: 2.74k]
  ------------------
  155|  8.22k|    memcpy(data_p + i * stride, data_p,
  156|  8.22k|           (width + 2 * border_horz) * sizeof(uint16_t));
  157|  8.22k|  }
  158|  10.9k|  for (i = height; i < height + border_vert; ++i) {
  ------------------
  |  Branch (158:20): [True: 8.22k, False: 2.74k]
  ------------------
  159|  8.22k|    memcpy(data_p + i * stride, data_p + (height - 1) * stride,
  160|  8.22k|           (width + 2 * border_horz) * sizeof(uint16_t));
  161|  8.22k|  }
  162|  2.74k|}
restoration.c:extend_frame_lowbd:
  124|  10.3k|                               int border_vert) {
  125|  10.3k|  uint8_t *data_p;
  126|  10.3k|  int i;
  127|   263k|  for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (127:15): [True: 253k, False: 10.3k]
  ------------------
  128|   253k|    data_p = data + i * stride;
  129|   253k|    memset(data_p - border_horz, data_p[0], border_horz);
  130|   253k|    memset(data_p + width, data_p[width - 1], border_horz);
  131|   253k|  }
  132|  10.3k|  data_p = data - border_horz;
  133|  41.5k|  for (i = -border_vert; i < 0; ++i) {
  ------------------
  |  Branch (133:26): [True: 31.1k, False: 10.3k]
  ------------------
  134|  31.1k|    memcpy(data_p + i * stride, data_p, width + 2 * border_horz);
  135|  31.1k|  }
  136|  41.5k|  for (i = height; i < height + border_vert; ++i) {
  ------------------
  |  Branch (136:20): [True: 31.1k, False: 10.3k]
  ------------------
  137|  31.1k|    memcpy(data_p + i * stride, data_p + (height - 1) * stride,
  138|  31.1k|           width + 2 * border_horz);
  139|  31.1k|  }
  140|  10.3k|}
restoration.c:copy_rest_unit:
  193|     74|                           int highbd) {
  194|     74|#if CONFIG_AV1_HIGHBITDEPTH
  195|     74|  if (highbd) {
  ------------------
  |  Branch (195:7): [True: 45, False: 29]
  ------------------
  196|     45|    copy_rest_unit_highbd(width, height, CONVERT_TO_SHORTPTR(src), src_stride,
  ------------------
  |  |   79|     45|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  197|     45|                          CONVERT_TO_SHORTPTR(dst), dst_stride);
  ------------------
  |  |   79|     45|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  198|     45|    return;
  199|     45|  }
  200|     29|#endif
  201|     29|  (void)highbd;
  202|     29|  copy_rest_unit_lowbd(width, height, src, src_stride, dst, dst_stride);
  203|     29|}
restoration.c:copy_rest_unit_highbd:
  166|     45|                                  int dst_stride) {
  167|  5.06k|  for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (167:19): [True: 5.01k, False: 45]
  ------------------
  168|  5.01k|    memcpy(dst + i * dst_stride, src + i * src_stride, width * sizeof(*dst));
  169|     45|}
restoration.c:copy_rest_unit_lowbd:
  186|     29|                                 int src_stride, uint8_t *dst, int dst_stride) {
  187|  2.25k|  for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (187:19): [True: 2.22k, False: 29]
  ------------------
  188|  2.22k|    memcpy(dst + i * dst_stride, src + i * src_stride, width);
  189|     29|}
restoration.c:wiener_filter_stripe:
  394|  8.11k|                                 struct aom_internal_error_info *error_info) {
  395|  8.11k|  (void)tmpbuf;
  396|  8.11k|  (void)bit_depth;
  397|  8.11k|  (void)error_info;
  398|  8.11k|  assert(bit_depth == 8);
  399|  8.11k|  const WienerConvolveParams conv_params = get_conv_params_wiener(8);
  400|       |
  401|  20.3k|  for (int j = 0; j < stripe_width; j += procunit_width) {
  ------------------
  |  Branch (401:19): [True: 12.2k, False: 8.11k]
  ------------------
  402|  12.2k|    int w = AOMMIN(procunit_width, (stripe_width - j + 15) & ~15);
  ------------------
  |  |   34|  12.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.09k, False: 8.11k]
  |  |  ------------------
  ------------------
  403|  12.2k|    const uint8_t *src_p = src + j;
  404|  12.2k|    uint8_t *dst_p = dst + j;
  405|  12.2k|    av1_wiener_convolve_add_src(
  406|  12.2k|        src_p, src_stride, dst_p, dst_stride, rui->wiener_info.hfilter, 16,
  407|  12.2k|        rui->wiener_info.vfilter, 16, w, stripe_height, &conv_params);
  408|  12.2k|  }
  409|  8.11k|}
restoration.c:sgrproj_filter_stripe:
  909|    885|                                  struct aom_internal_error_info *error_info) {
  910|    885|  (void)bit_depth;
  911|    885|  assert(bit_depth == 8);
  912|       |
  913|  2.66k|  for (int j = 0; j < stripe_width; j += procunit_width) {
  ------------------
  |  Branch (913:19): [True: 1.78k, False: 885]
  ------------------
  914|  1.78k|    int w = AOMMIN(procunit_width, stripe_width - j);
  ------------------
  |  |   34|  1.78k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 897, False: 885]
  |  |  ------------------
  ------------------
  915|  1.78k|    if (av1_apply_selfguided_restoration(
  ------------------
  |  Branch (915:9): [True: 0, False: 1.78k]
  ------------------
  916|  1.78k|            src + j, w, stripe_height, src_stride, rui->sgrproj_info.ep,
  917|  1.78k|            rui->sgrproj_info.xqd, dst + j, dst_stride, tmpbuf, bit_depth,
  918|  1.78k|            0) != 0) {
  919|      0|      aom_internal_error(
  920|      0|          error_info, AOM_CODEC_MEM_ERROR,
  921|      0|          "Error allocating buffer in av1_apply_selfguided_restoration");
  922|      0|    }
  923|  1.78k|  }
  924|    885|}
restoration.c:wiener_filter_stripe_highbd:
  931|  2.28k|    struct aom_internal_error_info *error_info) {
  932|  2.28k|  (void)tmpbuf;
  933|  2.28k|  (void)error_info;
  934|  2.28k|  const WienerConvolveParams conv_params = get_conv_params_wiener(bit_depth);
  935|       |
  936|  5.05k|  for (int j = 0; j < stripe_width; j += procunit_width) {
  ------------------
  |  Branch (936:19): [True: 2.76k, False: 2.28k]
  ------------------
  937|  2.76k|    int w = AOMMIN(procunit_width, (stripe_width - j + 15) & ~15);
  ------------------
  |  |   34|  2.76k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 478, False: 2.28k]
  |  |  ------------------
  ------------------
  938|  2.76k|    const uint8_t *src8_p = src8 + j;
  939|  2.76k|    uint8_t *dst8_p = dst8 + j;
  940|  2.76k|    av1_highbd_wiener_convolve_add_src(src8_p, src_stride, dst8_p, dst_stride,
  941|  2.76k|                                       rui->wiener_info.hfilter, 16,
  942|  2.76k|                                       rui->wiener_info.vfilter, 16, w,
  943|  2.76k|                                       stripe_height, &conv_params, bit_depth);
  944|  2.76k|  }
  945|  2.28k|}
restoration.c:sgrproj_filter_stripe_highbd:
  951|    419|    struct aom_internal_error_info *error_info) {
  952|    949|  for (int j = 0; j < stripe_width; j += procunit_width) {
  ------------------
  |  Branch (952:19): [True: 530, False: 419]
  ------------------
  953|    530|    int w = AOMMIN(procunit_width, stripe_width - j);
  ------------------
  |  |   34|    530|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 111, False: 419]
  |  |  ------------------
  ------------------
  954|    530|    if (av1_apply_selfguided_restoration(
  ------------------
  |  Branch (954:9): [True: 0, False: 530]
  ------------------
  955|    530|            src8 + j, w, stripe_height, src_stride, rui->sgrproj_info.ep,
  956|    530|            rui->sgrproj_info.xqd, dst8 + j, dst_stride, tmpbuf, bit_depth,
  957|    530|            1) != 0) {
  958|      0|      aom_internal_error(
  959|      0|          error_info, AOM_CODEC_MEM_ERROR,
  960|      0|          "Error allocating buffer in av1_apply_selfguided_restoration");
  961|      0|    }
  962|    530|  }
  963|    419|}
restoration.c:get_stripe_boundary_info:
  221|  11.7k|                                     int *copy_above, int *copy_below) {
  222|  11.7k|  (void)plane_w;
  223|       |
  224|  11.7k|  *copy_above = 1;
  225|  11.7k|  *copy_below = 1;
  226|       |
  227|  11.7k|  const int full_stripe_height = RESTORATION_PROC_UNIT_SIZE >> ss_y;
  ------------------
  |  |   34|  11.7k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
  228|  11.7k|  const int runit_offset = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|  11.7k|#define RESTORATION_UNIT_OFFSET 8
  ------------------
  229|       |
  230|  11.7k|  const int first_stripe_in_plane = (limits->v_start == 0);
  231|  11.7k|  const int this_stripe_height =
  232|  11.7k|      full_stripe_height - (first_stripe_in_plane ? runit_offset : 0);
  ------------------
  |  Branch (232:29): [True: 8.54k, False: 3.15k]
  ------------------
  233|  11.7k|  const int last_stripe_in_plane =
  234|  11.7k|      (limits->v_start + this_stripe_height >= plane_h);
  235|       |
  236|  11.7k|  if (first_stripe_in_plane) *copy_above = 0;
  ------------------
  |  Branch (236:7): [True: 8.54k, False: 3.15k]
  ------------------
  237|  11.7k|  if (last_stripe_in_plane) *copy_below = 0;
  ------------------
  |  Branch (237:7): [True: 8.48k, False: 3.21k]
  ------------------
  238|  11.7k|}
restoration.c:setup_processing_stripe_boundary:
  252|  11.7k|    RestorationLineBuffers *rlbs, int copy_above, int copy_below, int opt) {
  253|       |  // Offsets within the line buffers. The buffer logically starts at column
  254|       |  // -RESTORATION_EXTRA_HORZ so the 1st column (at x0 - RESTORATION_EXTRA_HORZ)
  255|       |  // has column x0 in the buffer.
  256|  11.7k|  const int buf_stride = rsb->stripe_boundary_stride;
  257|  11.7k|  const int buf_x0_off = limits->h_start;
  258|  11.7k|  const int line_width =
  259|  11.7k|      (limits->h_end - limits->h_start) + 2 * RESTORATION_EXTRA_HORZ;
  ------------------
  |  |   70|  11.7k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
  260|  11.7k|  const int line_size = line_width << use_highbd;
  261|       |
  262|  11.7k|  const int data_x0 = limits->h_start - RESTORATION_EXTRA_HORZ;
  ------------------
  |  |   70|  11.7k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
  263|       |
  264|       |  // Replace RESTORATION_BORDER pixels above the top of the stripe
  265|       |  // We expand RESTORATION_CTX_VERT=2 lines from rsb->stripe_boundary_above
  266|       |  // to fill RESTORATION_BORDER=3 lines of above pixels. This is done by
  267|       |  // duplicating the topmost of the 2 lines (see the AOMMAX call when
  268|       |  // calculating src_row, which gets the values 0, 0, 1 for i = -3, -2, -1).
  269|  11.7k|  if (!opt) {
  ------------------
  |  Branch (269:7): [True: 11.6k, False: 53]
  ------------------
  270|  11.6k|    if (copy_above) {
  ------------------
  |  Branch (270:9): [True: 3.12k, False: 8.52k]
  ------------------
  271|  3.12k|      uint8_t *data8_tl = data8 + data_x0 + limits->v_start * data_stride;
  272|       |
  273|  12.5k|      for (int i = -RESTORATION_BORDER; i < 0; ++i) {
  ------------------
  |  |   62|  3.12k|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (273:41): [True: 9.38k, False: 3.12k]
  ------------------
  274|  9.38k|        const int buf_row = rsb_row + AOMMAX(i + RESTORATION_CTX_VERT, 0);
  ------------------
  |  |   35|  9.38k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 3.12k, False: 6.25k]
  |  |  ------------------
  ------------------
  275|  9.38k|        const int buf_off = buf_x0_off + buf_row * buf_stride;
  276|  9.38k|        const uint8_t *buf =
  277|  9.38k|            rsb->stripe_boundary_above + (buf_off << use_highbd);
  278|  9.38k|        uint8_t *dst8 = data8_tl + i * data_stride;
  279|       |        // Save old pixels, then replace with data from stripe_boundary_above
  280|  9.38k|        memcpy(rlbs->tmp_save_above[i + RESTORATION_BORDER],
  ------------------
  |  |   62|  9.38k|#define RESTORATION_BORDER 3
  ------------------
  281|  9.38k|               REAL_PTR(use_highbd, dst8), line_size);
  ------------------
  |  |  205|  9.38k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.32k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.32k, False: 7.05k]
  |  |  ------------------
  ------------------
  282|  9.38k|        memcpy(REAL_PTR(use_highbd, dst8), buf, line_size);
  ------------------
  |  |  205|  9.38k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.32k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.32k, False: 7.05k]
  |  |  ------------------
  ------------------
  283|  9.38k|      }
  284|  3.12k|    }
  285|       |
  286|       |    // Replace RESTORATION_BORDER pixels below the bottom of the stripe.
  287|       |    // The second buffer row is repeated, so src_row gets the values 0, 1, 1
  288|       |    // for i = 0, 1, 2.
  289|  11.6k|    if (copy_below) {
  ------------------
  |  Branch (289:9): [True: 3.18k, False: 8.46k]
  ------------------
  290|  3.18k|      const int stripe_end = limits->v_start + h;
  291|  3.18k|      uint8_t *data8_bl = data8 + data_x0 + stripe_end * data_stride;
  292|       |
  293|  12.7k|      for (int i = 0; i < RESTORATION_BORDER; ++i) {
  ------------------
  |  |   62|  12.7k|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (293:23): [True: 9.55k, False: 3.18k]
  ------------------
  294|  9.55k|        const int buf_row = rsb_row + AOMMIN(i, RESTORATION_CTX_VERT - 1);
  ------------------
  |  |   34|  9.55k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.18k, False: 6.37k]
  |  |  ------------------
  ------------------
  295|  9.55k|        const int buf_off = buf_x0_off + buf_row * buf_stride;
  296|  9.55k|        const uint8_t *src =
  297|  9.55k|            rsb->stripe_boundary_below + (buf_off << use_highbd);
  298|       |
  299|  9.55k|        uint8_t *dst8 = data8_bl + i * data_stride;
  300|       |        // Save old pixels, then replace with data from stripe_boundary_below
  301|  9.55k|        memcpy(rlbs->tmp_save_below[i], REAL_PTR(use_highbd, dst8), line_size);
  ------------------
  |  |  205|  9.55k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.51k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.51k, False: 7.04k]
  |  |  ------------------
  ------------------
  302|  9.55k|        memcpy(REAL_PTR(use_highbd, dst8), src, line_size);
  ------------------
  |  |  205|  9.55k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.51k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.51k, False: 7.04k]
  |  |  ------------------
  ------------------
  303|  9.55k|      }
  304|  3.18k|    }
  305|  11.6k|  } else {
  306|     53|    if (copy_above) {
  ------------------
  |  Branch (306:9): [True: 29, False: 24]
  ------------------
  307|     29|      uint8_t *data8_tl = data8 + data_x0 + limits->v_start * data_stride;
  308|       |
  309|       |      // Only save and overwrite i=-RESTORATION_BORDER line.
  310|     29|      uint8_t *dst8 = data8_tl + (-RESTORATION_BORDER) * data_stride;
  ------------------
  |  |   62|     29|#define RESTORATION_BORDER 3
  ------------------
  311|       |      // Save old pixels, then replace with data from stripe_boundary_above
  312|     29|      memcpy(rlbs->tmp_save_above[0], REAL_PTR(use_highbd, dst8), line_size);
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  313|     29|      memcpy(REAL_PTR(use_highbd, dst8),
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  314|     29|             REAL_PTR(use_highbd,
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  315|     29|                      data8_tl + (-RESTORATION_BORDER + 1) * data_stride),
  316|     29|             line_size);
  317|     29|    }
  318|       |
  319|     53|    if (copy_below) {
  ------------------
  |  Branch (319:9): [True: 29, False: 24]
  ------------------
  320|     29|      const int stripe_end = limits->v_start + h;
  321|     29|      uint8_t *data8_bl = data8 + data_x0 + stripe_end * data_stride;
  322|       |
  323|       |      // Only save and overwrite i=2 line.
  324|     29|      uint8_t *dst8 = data8_bl + 2 * data_stride;
  325|       |      // Save old pixels, then replace with data from stripe_boundary_below
  326|     29|      memcpy(rlbs->tmp_save_below[2], REAL_PTR(use_highbd, dst8), line_size);
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  327|     29|      memcpy(REAL_PTR(use_highbd, dst8),
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  328|     29|             REAL_PTR(use_highbd, data8_bl + (2 - 1) * data_stride), line_size);
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  329|     29|    }
  330|     53|  }
  331|  11.7k|}
restoration.c:restore_processing_stripe_boundary:
  339|  11.7k|    int copy_below, int opt) {
  340|  11.7k|  const int line_width =
  341|  11.7k|      (limits->h_end - limits->h_start) + 2 * RESTORATION_EXTRA_HORZ;
  ------------------
  |  |   70|  11.7k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
  342|  11.7k|  const int line_size = line_width << use_highbd;
  343|       |
  344|  11.7k|  const int data_x0 = limits->h_start - RESTORATION_EXTRA_HORZ;
  ------------------
  |  |   70|  11.7k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
  345|       |
  346|  11.7k|  if (!opt) {
  ------------------
  |  Branch (346:7): [True: 11.6k, False: 53]
  ------------------
  347|  11.6k|    if (copy_above) {
  ------------------
  |  Branch (347:9): [True: 3.12k, False: 8.52k]
  ------------------
  348|  3.12k|      uint8_t *data8_tl = data8 + data_x0 + limits->v_start * data_stride;
  349|  12.5k|      for (int i = -RESTORATION_BORDER; i < 0; ++i) {
  ------------------
  |  |   62|  3.12k|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (349:41): [True: 9.38k, False: 3.12k]
  ------------------
  350|  9.38k|        uint8_t *dst8 = data8_tl + i * data_stride;
  351|  9.38k|        memcpy(REAL_PTR(use_highbd, dst8),
  ------------------
  |  |  205|  9.38k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.32k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.32k, False: 7.05k]
  |  |  ------------------
  ------------------
  352|  9.38k|               rlbs->tmp_save_above[i + RESTORATION_BORDER], line_size);
  ------------------
  |  |   62|  9.38k|#define RESTORATION_BORDER 3
  ------------------
  353|  9.38k|      }
  354|  3.12k|    }
  355|       |
  356|  11.6k|    if (copy_below) {
  ------------------
  |  Branch (356:9): [True: 3.18k, False: 8.46k]
  ------------------
  357|  3.18k|      const int stripe_bottom = limits->v_start + h;
  358|  3.18k|      uint8_t *data8_bl = data8 + data_x0 + stripe_bottom * data_stride;
  359|       |
  360|  12.7k|      for (int i = 0; i < RESTORATION_BORDER; ++i) {
  ------------------
  |  |   62|  12.7k|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (360:23): [True: 9.56k, False: 3.18k]
  ------------------
  361|  9.56k|        if (stripe_bottom + i >= limits->v_end + RESTORATION_BORDER) break;
  ------------------
  |  |   62|  9.56k|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (361:13): [True: 0, False: 9.56k]
  ------------------
  362|       |
  363|  9.56k|        uint8_t *dst8 = data8_bl + i * data_stride;
  364|  9.56k|        memcpy(REAL_PTR(use_highbd, dst8), rlbs->tmp_save_below[i], line_size);
  ------------------
  |  |  205|  9.56k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  2.51k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 2.51k, False: 7.04k]
  |  |  ------------------
  ------------------
  365|  9.56k|      }
  366|  3.18k|    }
  367|  11.6k|  } else {
  368|     53|    if (copy_above) {
  ------------------
  |  Branch (368:9): [True: 29, False: 24]
  ------------------
  369|     29|      uint8_t *data8_tl = data8 + data_x0 + limits->v_start * data_stride;
  370|       |
  371|       |      // Only restore i=-RESTORATION_BORDER line.
  372|     29|      uint8_t *dst8 = data8_tl + (-RESTORATION_BORDER) * data_stride;
  ------------------
  |  |   62|     29|#define RESTORATION_BORDER 3
  ------------------
  373|     29|      memcpy(REAL_PTR(use_highbd, dst8), rlbs->tmp_save_above[0], line_size);
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  374|     29|    }
  375|       |
  376|     53|    if (copy_below) {
  ------------------
  |  Branch (376:9): [True: 29, False: 24]
  ------------------
  377|     29|      const int stripe_bottom = limits->v_start + h;
  378|     29|      uint8_t *data8_bl = data8 + data_x0 + stripe_bottom * data_stride;
  379|       |
  380|       |      // Only restore i=2 line.
  381|     29|      if (stripe_bottom + 2 < limits->v_end + RESTORATION_BORDER) {
  ------------------
  |  |   62|     29|#define RESTORATION_BORDER 3
  ------------------
  |  Branch (381:11): [True: 29, False: 0]
  ------------------
  382|     29|        uint8_t *dst8 = data8_bl + 2 * data_stride;
  383|     29|        memcpy(REAL_PTR(use_highbd, dst8), rlbs->tmp_save_below[2], line_size);
  ------------------
  |  |  205|     29|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  384|     29|      }
  385|     29|    }
  386|     53|  }
  387|  11.7k|}
restoration.c:filter_frame_on_unit:
 1060|  1.23k|                                 struct aom_internal_error_info *error_info) {
 1061|  1.23k|  FilterFrameCtxt *ctxt = (FilterFrameCtxt *)priv;
 1062|  1.23k|  const RestorationInfo *rsi = ctxt->rsi;
 1063|       |
 1064|  1.23k|  av1_loop_restoration_filter_unit(
 1065|  1.23k|      limits, &rsi->unit_info[rest_unit_idx], &rsi->boundaries, rlbs,
 1066|  1.23k|      ctxt->plane_w, ctxt->plane_h, ctxt->ss_x, ctxt->ss_y, ctxt->highbd,
 1067|  1.23k|      ctxt->bit_depth, ctxt->data8, ctxt->data_stride, ctxt->dst8,
 1068|  1.23k|      ctxt->dst_stride, tmpbuf, rsi->optimized_lr, error_info);
 1069|  1.23k|}
restoration.c:foreach_rest_unit_in_planes:
 1184|    769|                                        int num_planes) {
 1185|    769|  FilterFrameCtxt *ctxt = lr_ctxt->ctxt;
 1186|       |
 1187|  2.35k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1187:23): [True: 1.58k, False: 769]
  ------------------
 1188|  1.58k|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) {
  ------------------
  |  Branch (1188:9): [True: 758, False: 827]
  ------------------
 1189|    758|      continue;
 1190|    758|    }
 1191|       |
 1192|    827|    foreach_rest_unit_in_plane(cm, plane, lr_ctxt->on_rest_unit, &ctxt[plane],
 1193|    827|                               cm->rst_tmpbuf, cm->rlbs);
 1194|    827|  }
 1195|    769|}
restoration.c:foreach_rest_unit_in_plane:
 1147|    827|                                       RestorationLineBuffers *rlbs) {
 1148|    827|  const RestorationInfo *rsi = &cm->rst_info[plane];
 1149|    827|  const int hnum_rest_units = rsi->horz_units;
 1150|    827|  const int vnum_rest_units = rsi->vert_units;
 1151|    827|  const int unit_size = rsi->restoration_unit_size;
 1152|       |
 1153|    827|  const int is_uv = plane > 0;
 1154|    827|  const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (1154:20): [True: 163, False: 664]
  |  Branch (1154:29): [True: 19, False: 144]
  ------------------
 1155|    827|  const int ext_size = unit_size * 3 / 2;
 1156|    827|  int plane_w, plane_h;
 1157|    827|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 1158|       |
 1159|    827|  int y0 = 0, i = 0;
 1160|  1.71k|  while (y0 < plane_h) {
  ------------------
  |  Branch (1160:10): [True: 887, False: 827]
  ------------------
 1161|    887|    int remaining_h = plane_h - y0;
 1162|    887|    int h = (remaining_h < ext_size) ? remaining_h : unit_size;
  ------------------
  |  Branch (1162:13): [True: 827, False: 60]
  ------------------
 1163|       |
 1164|    887|    RestorationTileLimits limits;
 1165|    887|    limits.v_start = y0;
 1166|    887|    limits.v_end = y0 + h;
 1167|    887|    assert(limits.v_end <= plane_h);
 1168|       |    // Offset upwards to align with the restoration processing stripe
 1169|    887|    const int voffset = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|    887|#define RESTORATION_UNIT_OFFSET 8
  ------------------
 1170|    887|    limits.v_start = AOMMAX(0, limits.v_start - voffset);
  ------------------
  |  |   35|    887|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 827, False: 60]
  |  |  ------------------
  ------------------
 1171|    887|    if (limits.v_end < plane_h) limits.v_end -= voffset;
  ------------------
  |  Branch (1171:9): [True: 60, False: 827]
  ------------------
 1172|       |
 1173|    887|    av1_foreach_rest_unit_in_row(&limits, plane_w, on_rest_unit, i, unit_size,
 1174|    887|                                 hnum_rest_units, vnum_rest_units, plane, priv,
 1175|    887|                                 tmpbuf, rlbs, av1_lr_sync_read_dummy,
 1176|    887|                                 av1_lr_sync_write_dummy, NULL, cm->error);
 1177|       |
 1178|    887|    y0 += h;
 1179|    887|    ++i;
 1180|    887|  }
 1181|    827|}
restoration.c:loop_restoration_copy_planes:
 1127|    769|                                         AV1_COMMON *cm, int num_planes) {
 1128|    769|  typedef void (*copy_fun)(const YV12_BUFFER_CONFIG *src_ybc,
 1129|    769|                           YV12_BUFFER_CONFIG *dst_ybc, int hstart, int hend,
 1130|    769|                           int vstart, int vend);
 1131|    769|  static const copy_fun copy_funs[3] = { aom_yv12_partial_coloc_copy_y,
  ------------------
  |  |   55|    769|#define aom_yv12_partial_coloc_copy_y aom_yv12_partial_coloc_copy_y_c
  ------------------
 1132|    769|                                         aom_yv12_partial_coloc_copy_u,
  ------------------
  |  |   49|    769|#define aom_yv12_partial_coloc_copy_u aom_yv12_partial_coloc_copy_u_c
  ------------------
 1133|    769|                                         aom_yv12_partial_coloc_copy_v };
  ------------------
  |  |   52|    769|#define aom_yv12_partial_coloc_copy_v aom_yv12_partial_coloc_copy_v_c
  ------------------
 1134|    769|  assert(num_planes <= 3);
 1135|  2.35k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1135:23): [True: 1.58k, False: 769]
  ------------------
 1136|  1.58k|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (1136:9): [True: 758, False: 827]
  ------------------
 1137|    827|    FilterFrameCtxt *lr_plane_ctxt = &loop_rest_ctxt->ctxt[plane];
 1138|    827|    copy_funs[plane](loop_rest_ctxt->dst, loop_rest_ctxt->frame, 0,
 1139|    827|                     lr_plane_ctxt->plane_w, 0, lr_plane_ctxt->plane_h);
 1140|    827|  }
 1141|    769|}
restoration.c:save_boundary_lines:
 1443|  36.3k|                                int plane, AV1_COMMON *cm, int after_cdef) {
 1444|  36.3k|  const int is_uv = plane > 0;
 1445|  36.3k|  const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (1445:20): [True: 15.5k, False: 20.8k]
  |  Branch (1445:29): [True: 7.12k, False: 8.37k]
  ------------------
 1446|  36.3k|  const int stripe_height = RESTORATION_PROC_UNIT_SIZE >> ss_y;
  ------------------
  |  |   34|  36.3k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
 1447|  36.3k|  const int stripe_off = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|  36.3k|#define RESTORATION_UNIT_OFFSET 8
  ------------------
 1448|       |
 1449|  36.3k|  int plane_w, plane_h;
 1450|  36.3k|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 1451|       |
 1452|  36.3k|  RestorationStripeBoundaries *boundaries = &cm->rst_info[plane].boundaries;
 1453|       |
 1454|  36.3k|  const int plane_height = ROUND_POWER_OF_TWO(cm->height, ss_y);
  ------------------
  |  |   41|  36.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1455|       |
 1456|  36.3k|  int stripe_idx;
 1457|  81.1k|  for (stripe_idx = 0;; ++stripe_idx) {
 1458|  81.1k|    const int rel_y0 = AOMMAX(0, stripe_idx * stripe_height - stripe_off);
  ------------------
  |  |   35|  81.1k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 36.3k, False: 44.8k]
  |  |  ------------------
  ------------------
 1459|  81.1k|    const int y0 = rel_y0;
 1460|  81.1k|    if (y0 >= plane_h) break;
  ------------------
  |  Branch (1460:9): [True: 36.3k, False: 44.8k]
  ------------------
 1461|       |
 1462|  44.8k|    const int rel_y1 = (stripe_idx + 1) * stripe_height - stripe_off;
 1463|  44.8k|    const int y1 = AOMMIN(rel_y1, plane_h);
  ------------------
  |  |   34|  44.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.47k, False: 36.3k]
  |  |  ------------------
  ------------------
 1464|       |
 1465|       |    // Extend using CDEF pixels at the top and bottom of the frame,
 1466|       |    // and deblocked pixels at internal stripe boundaries
 1467|  44.8k|    const int use_deblock_above = (stripe_idx > 0);
 1468|  44.8k|    const int use_deblock_below = (y1 < plane_height);
 1469|       |
 1470|  44.8k|    if (!after_cdef) {
  ------------------
  |  Branch (1470:9): [True: 22.4k, False: 22.4k]
  ------------------
 1471|       |      // Save deblocked context at internal stripe boundaries
 1472|  22.4k|      if (use_deblock_above) {
  ------------------
  |  Branch (1472:11): [True: 4.23k, False: 18.1k]
  ------------------
 1473|  4.23k|        save_deblock_boundary_lines(frame, cm, plane, y0 - RESTORATION_CTX_VERT,
  ------------------
  |  |   66|  4.23k|#define RESTORATION_CTX_VERT 2
  ------------------
 1474|  4.23k|                                    stripe_idx, use_highbd, 1, boundaries);
 1475|  4.23k|      }
 1476|  22.4k|      if (use_deblock_below) {
  ------------------
  |  Branch (1476:11): [True: 4.23k, False: 18.1k]
  ------------------
 1477|  4.23k|        save_deblock_boundary_lines(frame, cm, plane, y1, stripe_idx,
 1478|  4.23k|                                    use_highbd, 0, boundaries);
 1479|  4.23k|      }
 1480|  22.4k|    } else {
 1481|       |      // Save CDEF context at frame boundaries
 1482|  22.4k|      if (!use_deblock_above) {
  ------------------
  |  Branch (1482:11): [True: 18.1k, False: 4.23k]
  ------------------
 1483|  18.1k|        save_cdef_boundary_lines(frame, cm, plane, y0, stripe_idx, use_highbd,
 1484|  18.1k|                                 1, boundaries);
 1485|  18.1k|      }
 1486|  22.4k|      if (!use_deblock_below) {
  ------------------
  |  Branch (1486:11): [True: 18.1k, False: 4.23k]
  ------------------
 1487|  18.1k|        save_cdef_boundary_lines(frame, cm, plane, y1 - 1, stripe_idx,
 1488|  18.1k|                                 use_highbd, 0, boundaries);
 1489|  18.1k|      }
 1490|  22.4k|    }
 1491|  44.8k|  }
 1492|  36.3k|}
restoration.c:save_deblock_boundary_lines:
 1358|  8.47k|    RestorationStripeBoundaries *boundaries) {
 1359|  8.47k|  const int is_uv = plane > 0;
 1360|  8.47k|  const uint8_t *src_buf = REAL_PTR(use_highbd, frame->buffers[plane]);
  ------------------
  |  |  205|  8.47k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  1.89k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 1.89k, False: 6.57k]
  |  |  ------------------
  ------------------
 1361|  8.47k|  const int src_stride = frame->strides[is_uv] << use_highbd;
 1362|  8.47k|  const uint8_t *src_rows = src_buf + row * (ptrdiff_t)src_stride;
 1363|       |
 1364|  8.47k|  uint8_t *bdry_buf = is_above ? boundaries->stripe_boundary_above
  ------------------
  |  Branch (1364:23): [True: 4.23k, False: 4.23k]
  ------------------
 1365|  8.47k|                               : boundaries->stripe_boundary_below;
 1366|  8.47k|  uint8_t *bdry_start = bdry_buf + (RESTORATION_EXTRA_HORZ << use_highbd);
  ------------------
  |  |   70|  8.47k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
 1367|  8.47k|  const int bdry_stride = boundaries->stripe_boundary_stride << use_highbd;
 1368|  8.47k|  uint8_t *bdry_rows = bdry_start + RESTORATION_CTX_VERT * stripe * bdry_stride;
  ------------------
  |  |   66|  8.47k|#define RESTORATION_CTX_VERT 2
  ------------------
 1369|       |
 1370|       |  // There is a rare case in which a processing stripe can end 1px above the
 1371|       |  // crop border. In this case, we do want to use deblocked pixels from below
 1372|       |  // the stripe (hence why we ended up in this function), but instead of
 1373|       |  // fetching 2 "below" rows we need to fetch one and duplicate it.
 1374|       |  // This is equivalent to clamping the sample locations against the crop border
 1375|  8.47k|  const int lines_to_save =
 1376|  8.47k|      AOMMIN(RESTORATION_CTX_VERT, frame->crop_heights[is_uv] - row);
  ------------------
  |  |   34|  8.47k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.41k, False: 56]
  |  |  ------------------
  ------------------
 1377|  8.47k|  assert(lines_to_save == 1 || lines_to_save == 2);
 1378|       |
 1379|  8.47k|  int upscaled_width;
 1380|  8.47k|  int line_bytes;
 1381|  8.47k|  if (av1_superres_scaled(cm)) {
  ------------------
  |  Branch (1381:7): [True: 0, False: 8.47k]
  ------------------
 1382|      0|    const int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (1382:22): [True: 0, False: 0]
  |  Branch (1382:31): [True: 0, False: 0]
  ------------------
 1383|      0|    upscaled_width = (cm->superres_upscaled_width + ss_x) >> ss_x;
 1384|      0|    line_bytes = upscaled_width << use_highbd;
 1385|      0|    if (use_highbd)
  ------------------
  |  Branch (1385:9): [True: 0, False: 0]
  ------------------
 1386|      0|      av1_upscale_normative_rows(
 1387|      0|          cm, CONVERT_TO_BYTEPTR(src_rows), frame->strides[is_uv],
  ------------------
  |  |   80|      0|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 1388|      0|          CONVERT_TO_BYTEPTR(bdry_rows), boundaries->stripe_boundary_stride,
  ------------------
  |  |   80|      0|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 1389|      0|          plane, lines_to_save);
 1390|      0|    else
 1391|      0|      av1_upscale_normative_rows(cm, src_rows, frame->strides[is_uv], bdry_rows,
 1392|      0|                                 boundaries->stripe_boundary_stride, plane,
 1393|      0|                                 lines_to_save);
 1394|  8.47k|  } else {
 1395|  8.47k|    upscaled_width = frame->crop_widths[is_uv];
 1396|  8.47k|    line_bytes = upscaled_width << use_highbd;
 1397|  25.3k|    for (int i = 0; i < lines_to_save; i++) {
  ------------------
  |  Branch (1397:21): [True: 16.9k, False: 8.47k]
  ------------------
 1398|  16.9k|      memcpy(bdry_rows + i * bdry_stride, src_rows + i * src_stride,
 1399|  16.9k|             line_bytes);
 1400|  16.9k|    }
 1401|  8.47k|  }
 1402|       |  // If we only saved one line, then copy it into the second line buffer
 1403|  8.47k|  if (lines_to_save == 1)
  ------------------
  |  Branch (1403:7): [True: 29, False: 8.44k]
  ------------------
 1404|     29|    memcpy(bdry_rows + bdry_stride, bdry_rows, line_bytes);
 1405|       |
 1406|  8.47k|  extend_lines(bdry_rows, upscaled_width, RESTORATION_CTX_VERT, bdry_stride,
  ------------------
  |  |   66|  8.47k|#define RESTORATION_CTX_VERT 2
  ------------------
 1407|  8.47k|               RESTORATION_EXTRA_HORZ, use_highbd);
  ------------------
  |  |   70|  8.47k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
 1408|  8.47k|}
restoration.c:extend_lines:
 1341|  44.8k|                         int extend, int use_highbitdepth) {
 1342|   134k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (1342:19): [True: 89.6k, False: 44.8k]
  ------------------
 1343|  89.6k|    if (use_highbitdepth) {
  ------------------
  |  Branch (1343:9): [True: 18.8k, False: 70.7k]
  ------------------
 1344|  18.8k|      uint16_t *buf16 = (uint16_t *)buf;
 1345|  18.8k|      aom_memset16(buf16 - extend, buf16[0], extend);
 1346|  18.8k|      aom_memset16(buf16 + width, buf16[width - 1], extend);
 1347|  70.7k|    } else {
 1348|  70.7k|      memset(buf - extend, buf[0], extend);
 1349|  70.7k|      memset(buf + width, buf[width - 1], extend);
 1350|  70.7k|    }
 1351|  89.6k|    buf += stride;
 1352|  89.6k|  }
 1353|  44.8k|}
restoration.c:save_cdef_boundary_lines:
 1413|  36.3k|                                     RestorationStripeBoundaries *boundaries) {
 1414|  36.3k|  const int is_uv = plane > 0;
 1415|  36.3k|  const uint8_t *src_buf = REAL_PTR(use_highbd, frame->buffers[plane]);
  ------------------
  |  |  205|  36.3k|#define REAL_PTR(hbd, d) ((hbd) ? (uint8_t *)CONVERT_TO_SHORTPTR(d) : (d))
  |  |  ------------------
  |  |  |  |   79|  7.53k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  |  |  ------------------
  |  |  |  Branch (205:27): [True: 7.53k, False: 28.8k]
  |  |  ------------------
  ------------------
 1416|  36.3k|  const int src_stride = frame->strides[is_uv] << use_highbd;
 1417|  36.3k|  const uint8_t *src_rows = src_buf + row * (ptrdiff_t)src_stride;
 1418|       |
 1419|  36.3k|  uint8_t *bdry_buf = is_above ? boundaries->stripe_boundary_above
  ------------------
  |  Branch (1419:23): [True: 18.1k, False: 18.1k]
  ------------------
 1420|  36.3k|                               : boundaries->stripe_boundary_below;
 1421|  36.3k|  uint8_t *bdry_start = bdry_buf + (RESTORATION_EXTRA_HORZ << use_highbd);
  ------------------
  |  |   70|  36.3k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
 1422|  36.3k|  const int bdry_stride = boundaries->stripe_boundary_stride << use_highbd;
 1423|  36.3k|  uint8_t *bdry_rows = bdry_start + RESTORATION_CTX_VERT * stripe * bdry_stride;
  ------------------
  |  |   66|  36.3k|#define RESTORATION_CTX_VERT 2
  ------------------
 1424|  36.3k|  const int src_width = frame->crop_widths[is_uv];
 1425|       |
 1426|       |  // At the point where this function is called, we've already applied
 1427|       |  // superres. So we don't need to extend the lines here, we can just
 1428|       |  // pull directly from the topmost row of the upscaled frame.
 1429|  36.3k|  const int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (1429:20): [True: 15.5k, False: 20.8k]
  |  Branch (1429:29): [True: 11.3k, False: 4.14k]
  ------------------
 1430|  36.3k|  const int upscaled_width = av1_superres_scaled(cm)
  ------------------
  |  Branch (1430:30): [True: 0, False: 36.3k]
  ------------------
 1431|  36.3k|                                 ? (cm->superres_upscaled_width + ss_x) >> ss_x
 1432|  36.3k|                                 : src_width;
 1433|  36.3k|  const int line_bytes = upscaled_width << use_highbd;
 1434|   109k|  for (int i = 0; i < RESTORATION_CTX_VERT; i++) {
  ------------------
  |  |   66|   109k|#define RESTORATION_CTX_VERT 2
  ------------------
  |  Branch (1434:19): [True: 72.6k, False: 36.3k]
  ------------------
 1435|       |    // Copy the line at 'src_rows' into both context lines
 1436|  72.6k|    memcpy(bdry_rows + i * bdry_stride, src_rows, line_bytes);
 1437|  72.6k|  }
 1438|  36.3k|  extend_lines(bdry_rows, upscaled_width, RESTORATION_CTX_VERT, bdry_stride,
  ------------------
  |  |   66|  36.3k|#define RESTORATION_CTX_VERT 2
  ------------------
 1439|  36.3k|               RESTORATION_EXTRA_HORZ, use_highbd);
  ------------------
  |  |   70|  36.3k|#define RESTORATION_EXTRA_HORZ 4
  ------------------
 1440|  36.3k|}

pickrst.c:set_default_wiener:
  302|  31.0k|static inline void set_default_wiener(WienerInfo *wiener_info) {
  303|  31.0k|  wiener_info->vfilter[0] = wiener_info->hfilter[0] = WIENER_FILT_TAP0_MIDV;
  ------------------
  |  |  137|  31.0k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  304|  31.0k|  wiener_info->vfilter[1] = wiener_info->hfilter[1] = WIENER_FILT_TAP1_MIDV;
  ------------------
  |  |  138|  31.0k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
  305|  31.0k|  wiener_info->vfilter[2] = wiener_info->hfilter[2] = WIENER_FILT_TAP2_MIDV;
  ------------------
  |  |  139|  31.0k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
  306|  31.0k|  wiener_info->vfilter[WIENER_HALFWIN] = wiener_info->hfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|  31.0k|#define WIENER_HALFWIN 3
  ------------------
                wiener_info->vfilter[WIENER_HALFWIN] = wiener_info->hfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|  31.0k|#define WIENER_HALFWIN 3
  ------------------
  307|  31.0k|      -2 *
  308|  31.0k|      (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  139|  31.0k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
                    (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  138|  31.0k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
                    (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  137|  31.0k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  309|  31.0k|  wiener_info->vfilter[4] = wiener_info->hfilter[4] = WIENER_FILT_TAP2_MIDV;
  ------------------
  |  |  139|  31.0k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
  310|  31.0k|  wiener_info->vfilter[5] = wiener_info->hfilter[5] = WIENER_FILT_TAP1_MIDV;
  ------------------
  |  |  138|  31.0k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
  311|  31.0k|  wiener_info->vfilter[6] = wiener_info->hfilter[6] = WIENER_FILT_TAP0_MIDV;
  ------------------
  |  |  137|  31.0k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  312|  31.0k|}
pickrst.c:set_default_sgrproj:
  297|  31.0k|static inline void set_default_sgrproj(SgrprojInfo *sgrproj_info) {
  298|  31.0k|  sgrproj_info->xqd[0] = (SGRPROJ_PRJ_MIN0 + SGRPROJ_PRJ_MAX0) / 2;
  ------------------
  |  |  106|  31.0k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                sgrproj_info->xqd[0] = (SGRPROJ_PRJ_MIN0 + SGRPROJ_PRJ_MAX0) / 2;
  ------------------
  |  |  107|  31.0k|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|  31.0k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  299|  31.0k|  sgrproj_info->xqd[1] = (SGRPROJ_PRJ_MIN1 + SGRPROJ_PRJ_MAX1) / 2;
  ------------------
  |  |  108|  31.0k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                sgrproj_info->xqd[1] = (SGRPROJ_PRJ_MIN1 + SGRPROJ_PRJ_MAX1) / 2;
  ------------------
  |  |  109|  31.0k|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|  31.0k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  31.0k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  300|  31.0k|}
blockd.c:set_default_wiener:
  302|   289k|static inline void set_default_wiener(WienerInfo *wiener_info) {
  303|   289k|  wiener_info->vfilter[0] = wiener_info->hfilter[0] = WIENER_FILT_TAP0_MIDV;
  ------------------
  |  |  137|   289k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  304|   289k|  wiener_info->vfilter[1] = wiener_info->hfilter[1] = WIENER_FILT_TAP1_MIDV;
  ------------------
  |  |  138|   289k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
  305|   289k|  wiener_info->vfilter[2] = wiener_info->hfilter[2] = WIENER_FILT_TAP2_MIDV;
  ------------------
  |  |  139|   289k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
  306|   289k|  wiener_info->vfilter[WIENER_HALFWIN] = wiener_info->hfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|   289k|#define WIENER_HALFWIN 3
  ------------------
                wiener_info->vfilter[WIENER_HALFWIN] = wiener_info->hfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|   289k|#define WIENER_HALFWIN 3
  ------------------
  307|   289k|      -2 *
  308|   289k|      (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  139|   289k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
                    (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  138|   289k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
                    (WIENER_FILT_TAP2_MIDV + WIENER_FILT_TAP1_MIDV + WIENER_FILT_TAP0_MIDV);
  ------------------
  |  |  137|   289k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  309|   289k|  wiener_info->vfilter[4] = wiener_info->hfilter[4] = WIENER_FILT_TAP2_MIDV;
  ------------------
  |  |  139|   289k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
  310|   289k|  wiener_info->vfilter[5] = wiener_info->hfilter[5] = WIENER_FILT_TAP1_MIDV;
  ------------------
  |  |  138|   289k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
  311|   289k|  wiener_info->vfilter[6] = wiener_info->hfilter[6] = WIENER_FILT_TAP0_MIDV;
  ------------------
  |  |  137|   289k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
  312|   289k|}
blockd.c:set_default_sgrproj:
  297|   289k|static inline void set_default_sgrproj(SgrprojInfo *sgrproj_info) {
  298|   289k|  sgrproj_info->xqd[0] = (SGRPROJ_PRJ_MIN0 + SGRPROJ_PRJ_MAX0) / 2;
  ------------------
  |  |  106|   289k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                sgrproj_info->xqd[0] = (SGRPROJ_PRJ_MIN0 + SGRPROJ_PRJ_MAX0) / 2;
  ------------------
  |  |  107|   289k|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|   289k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  299|   289k|  sgrproj_info->xqd[1] = (SGRPROJ_PRJ_MIN1 + SGRPROJ_PRJ_MAX1) / 2;
  ------------------
  |  |  108|   289k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                sgrproj_info->xqd[1] = (SGRPROJ_PRJ_MIN1 + SGRPROJ_PRJ_MAX1) / 2;
  ------------------
  |  |  109|   289k|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|   289k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|   289k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  300|   289k|}

av1_scale_mv:
   34|   261k|                  const struct scale_factors *sf) {
   35|   261k|  const int x_off_q4 = av1_scaled_x(x << SUBPEL_BITS, sf);
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   36|   261k|  const int y_off_q4 = av1_scaled_y(y << SUBPEL_BITS, sf);
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   37|   261k|  const MV32 res = {
   38|   261k|    av1_scaled_y((y << SUBPEL_BITS) + mvq4->row, sf) - y_off_q4,
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   39|   261k|    av1_scaled_x((x << SUBPEL_BITS) + mvq4->col, sf) - x_off_q4
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   40|   261k|  };
   41|   261k|  return res;
   42|   261k|}
av1_setup_scale_factors_for_frame:
   45|  1.58M|                                       int other_h, int this_w, int this_h) {
   46|  1.58M|  if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) {
  ------------------
  |  Branch (46:7): [True: 0, False: 1.58M]
  ------------------
   47|      0|    sf->x_scale_fp = REF_INVALID_SCALE;
  ------------------
  |  |   26|      0|#define REF_INVALID_SCALE -1
  ------------------
   48|      0|    sf->y_scale_fp = REF_INVALID_SCALE;
  ------------------
  |  |   26|      0|#define REF_INVALID_SCALE -1
  ------------------
   49|      0|    return;
   50|      0|  }
   51|       |
   52|  1.58M|  sf->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w);
   53|  1.58M|  sf->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h);
   54|       |
   55|  1.58M|  sf->x_step_q4 = fixed_point_scale_to_coarse_point_scale(sf->x_scale_fp);
   56|  1.58M|  sf->y_step_q4 = fixed_point_scale_to_coarse_point_scale(sf->y_scale_fp);
   57|  1.58M|}
scale.c:get_fixed_point_scale_factor:
   19|  3.16M|static int get_fixed_point_scale_factor(int other_size, int this_size) {
   20|       |  // Calculate scaling factor once for each reference frame
   21|       |  // and use fixed point scaling factors in decoding and encoding routines.
   22|       |  // Hardware implementations can calculate scale factor in device driver
   23|       |  // and use multiplication and shifting on hardware instead of division.
   24|  3.16M|  return ((other_size << REF_SCALE_SHIFT) + this_size / 2) / this_size;
  ------------------
  |  |   24|  3.16M|#define REF_SCALE_SHIFT 14
  ------------------
   25|  3.16M|}
scale.c:fixed_point_scale_to_coarse_point_scale:
   28|  3.16M|static int fixed_point_scale_to_coarse_point_scale(int scale_fp) {
   29|  3.16M|  return ROUND_POWER_OF_TWO(scale_fp, REF_SCALE_SHIFT - SCALE_SUBPEL_BITS);
  ------------------
  |  |   41|  3.16M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   30|  3.16M|}

decodeframe.c:valid_ref_frame_size:
   78|  98.2k|                                       int this_width, int this_height) {
   79|  98.2k|  return 2 * this_width >= ref_width && 2 * this_height >= ref_height &&
  ------------------
  |  Branch (79:10): [True: 98.2k, False: 0]
  |  Branch (79:41): [True: 98.2k, False: 0]
  ------------------
   80|  98.2k|         this_width <= 16 * ref_width && this_height <= 16 * ref_height;
  ------------------
  |  Branch (80:10): [True: 98.2k, False: 0]
  |  Branch (80:42): [True: 98.2k, False: 0]
  ------------------
   81|  98.2k|}
decodeframe.c:av1_is_valid_scale:
   64|   734k|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|   734k|  assert(sf != NULL);
   66|   734k|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  1.46M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 734k, False: 18.4E]
  ------------------
   67|   734k|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|   734k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 734k, False: 18.4E]
  ------------------
   68|   734k|}
decodeframe.c:av1_is_scaled:
   70|   587k|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|   587k|  assert(sf != NULL);
   72|   587k|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 587k, False: 18.4E]
  ------------------
   73|   587k|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  1.17M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   587k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   126k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   126k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 460k, False: 126k]
  |  Branch (73:45): [True: 60.4k, False: 66.3k]
  ------------------
   74|   587k|}
decodeframe.c:av1_scaled_y:
   45|   261k|static inline int av1_scaled_y(int val, const struct scale_factors *sf) {
   46|   261k|  const int off =
   47|   261k|      (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|   261k|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   48|   261k|  const int64_t tval = (int64_t)val * sf->y_scale_fp + off;
   49|   261k|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|   261k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  26.0k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 26.0k, False: 235k]
  |  |  ------------------
  |  |   59|   261k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   235k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   50|   261k|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   51|   261k|}
decodeframe.c:av1_scaled_x:
   36|   261k|static inline int av1_scaled_x(int val, const struct scale_factors *sf) {
   37|   261k|  const int off =
   38|   261k|      (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|   261k|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
   39|   261k|  const int64_t tval = (int64_t)val * sf->x_scale_fp + off;
   40|   261k|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|   261k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  24.7k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 24.7k, False: 236k]
  |  |  ------------------
  |  |   59|   261k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   236k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   41|   261k|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   42|   261k|}
decodemv.c:av1_is_scaled:
   70|   135k|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|   135k|  assert(sf != NULL);
   72|   135k|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 135k, False: 4]
  ------------------
   73|   135k|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   270k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   135k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  25.8k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  25.8k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 109k, False: 25.8k]
  |  Branch (73:45): [True: 13.2k, False: 12.5k]
  ------------------
   74|   135k|}
decodemv.c:av1_is_valid_scale:
   64|   135k|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|   135k|  assert(sf != NULL);
   66|   135k|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|   270k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 135k, False: 18.4E]
  ------------------
   67|   135k|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|   135k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 135k, False: 18.4E]
  ------------------
   68|   135k|}
bitstream.c:av1_is_scaled:
   70|   363k|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|   363k|  assert(sf != NULL);
   72|   363k|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 363k, False: 18.4E]
  ------------------
   73|   363k|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   727k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   363k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  72.2k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  72.2k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 291k, False: 72.2k]
  |  Branch (73:45): [True: 34.1k, False: 38.0k]
  ------------------
   74|   363k|}
bitstream.c:av1_is_valid_scale:
   64|   363k|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|   363k|  assert(sf != NULL);
   66|   363k|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|   727k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 363k, False: 18.4E]
  ------------------
   67|   363k|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|   363k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 363k, False: 2]
  ------------------
   68|   363k|}
encoder.c:av1_is_valid_scale:
   64|  1.28M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  1.28M|  assert(sf != NULL);
   66|  1.28M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  2.57M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 1.28M, False: 0]
  ------------------
   67|  1.28M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  1.28M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 1.28M, False: 0]
  ------------------
   68|  1.28M|}
encoder.c:av1_is_scaled:
   70|   644k|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|   644k|  assert(sf != NULL);
   72|   644k|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 644k, False: 0]
  ------------------
   73|   644k|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  1.28M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   644k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   385k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   385k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 258k, False: 385k]
  |  Branch (73:45): [True: 55.8k, False: 330k]
  ------------------
   74|   644k|}
mcomp.c:av1_is_scaled:
   70|  4.24M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  4.24M|  assert(sf != NULL);
   72|  4.24M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 4.24M, False: 37]
  ------------------
   73|  4.24M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  8.48M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  4.24M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  1.38M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  1.38M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 2.85M, False: 1.38M]
  |  Branch (73:45): [True: 344k, False: 1.03M]
  ------------------
   74|  4.24M|}
mcomp.c:av1_is_valid_scale:
   64|  4.24M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  4.24M|  assert(sf != NULL);
   66|  4.24M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  8.48M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 4.24M, False: 18.4E]
  ------------------
   67|  4.24M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  4.24M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 4.24M, False: 18.4E]
  ------------------
   68|  4.24M|}
partition_search.c:av1_is_scaled:
   70|   364k|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|   364k|  assert(sf != NULL);
   72|   364k|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 364k, False: 18.4E]
  ------------------
   73|   364k|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   728k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   364k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  72.3k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  72.3k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 292k, False: 72.3k]
  |  Branch (73:45): [True: 34.2k, False: 38.1k]
  ------------------
   74|   364k|}
partition_search.c:av1_is_valid_scale:
   64|   364k|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|   364k|  assert(sf != NULL);
   66|   364k|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|   728k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 364k, False: 18.4E]
  ------------------
   67|   364k|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|   364k|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 364k, False: 18.4E]
  ------------------
   68|   364k|}
rd.c:av1_is_scaled:
   70|  3.91M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  3.91M|  assert(sf != NULL);
   72|  3.91M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 3.91M, False: 18.4E]
  ------------------
   73|  3.91M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  7.83M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  3.91M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   913k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   913k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 3.00M, False: 913k]
  |  Branch (73:45): [True: 372k, False: 541k]
  ------------------
   74|  3.91M|}
rd.c:av1_is_valid_scale:
   64|  3.91M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  3.91M|  assert(sf != NULL);
   66|  3.91M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  7.83M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 3.91M, False: 18.4E]
  ------------------
   67|  3.91M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  3.91M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 3.91M, False: 18.4E]
  ------------------
   68|  3.91M|}
rd.c:av1_scaled_x:
   36|  3.37M|static inline int av1_scaled_x(int val, const struct scale_factors *sf) {
   37|  3.37M|  const int off =
   38|  3.37M|      (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  3.37M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  3.37M|#define SUBPEL_BITS 4
  ------------------
   39|  3.37M|  const int64_t tval = (int64_t)val * sf->x_scale_fp + off;
   40|  3.37M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  3.37M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|   648k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 648k, False: 2.72M]
  |  |  ------------------
  |  |   59|  3.37M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  2.72M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   41|  3.37M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   42|  3.37M|}
rd.c:av1_scaled_y:
   45|  3.37M|static inline int av1_scaled_y(int val, const struct scale_factors *sf) {
   46|  3.37M|  const int off =
   47|  3.37M|      (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  3.37M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  3.37M|#define SUBPEL_BITS 4
  ------------------
   48|  3.37M|  const int64_t tval = (int64_t)val * sf->y_scale_fp + off;
   49|  3.37M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  3.37M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|   657k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 657k, False: 2.71M]
  |  |  ------------------
  |  |   59|  3.37M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  2.71M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   50|  3.37M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   51|  3.37M|}
rd.c:av1_unscaled_value:
   54|  1.08M|static inline int av1_unscaled_value(int val, const struct scale_factors *sf) {
   55|  1.08M|  (void)sf;
   56|  1.08M|  return val * (1 << SCALE_EXTRA_BITS);
  ------------------
  |  |   31|  1.08M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  1.08M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  1.08M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   57|  1.08M|}
rdopt.c:av1_is_scaled:
   70|  1.38M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  1.38M|  assert(sf != NULL);
   72|  1.38M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 1.38M, False: 18]
  ------------------
   73|  1.38M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  2.77M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  1.38M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   313k|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|   313k|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 1.07M, False: 313k]
  |  Branch (73:45): [True: 132k, False: 181k]
  ------------------
   74|  1.38M|}
rdopt.c:av1_is_valid_scale:
   64|  1.38M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  1.38M|  assert(sf != NULL);
   66|  1.38M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  2.77M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 1.38M, False: 18.4E]
  ------------------
   67|  1.38M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  1.38M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 1.38M, False: 18.4E]
  ------------------
   68|  1.38M|}
nonrd_pickmode.c:av1_is_scaled:
   70|  4.14M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  4.14M|  assert(sf != NULL);
   72|  4.14M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 4.14M, False: 225]
  ------------------
   73|  4.14M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  8.28M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  4.14M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  3.68M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  3.68M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 455k, False: 3.68M]
  |  Branch (73:45): [True: 60.6k, False: 3.62M]
  ------------------
   74|  4.14M|}
nonrd_pickmode.c:av1_is_valid_scale:
   64|  4.14M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  4.14M|  assert(sf != NULL);
   66|  4.14M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  8.28M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 4.14M, False: 18.4E]
  ------------------
   67|  4.14M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  4.14M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 4.14M, False: 18.4E]
  ------------------
   68|  4.14M|}
nonrd_pickmode.c:av1_unscaled_value:
   54|  3.98M|static inline int av1_unscaled_value(int val, const struct scale_factors *sf) {
   55|  3.98M|  (void)sf;
   56|  3.98M|  return val * (1 << SCALE_EXTRA_BITS);
  ------------------
  |  |   31|  3.98M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  3.98M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  3.98M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   57|  3.98M|}
reconinter_enc.c:av1_unscaled_value:
   54|  5.65M|static inline int av1_unscaled_value(int val, const struct scale_factors *sf) {
   55|  5.65M|  (void)sf;
   56|  5.65M|  return val * (1 << SCALE_EXTRA_BITS);
  ------------------
  |  |   31|  5.65M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  5.65M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  5.65M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   57|  5.65M|}
reconinter_enc.c:av1_scaled_y:
   45|  52.2M|static inline int av1_scaled_y(int val, const struct scale_factors *sf) {
   46|  52.2M|  const int off =
   47|  52.2M|      (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  52.2M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  52.2M|#define SUBPEL_BITS 4
  ------------------
   48|  52.2M|  const int64_t tval = (int64_t)val * sf->y_scale_fp + off;
   49|  52.2M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  52.2M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  5.84M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 5.84M, False: 46.3M]
  |  |  ------------------
  |  |   59|  52.2M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  46.3M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   50|  52.2M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   51|  52.2M|}
reconinter_enc.c:av1_scaled_x:
   36|  52.2M|static inline int av1_scaled_x(int val, const struct scale_factors *sf) {
   37|  52.2M|  const int off =
   38|  52.2M|      (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  52.2M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  52.2M|#define SUBPEL_BITS 4
  ------------------
   39|  52.2M|  const int64_t tval = (int64_t)val * sf->x_scale_fp + off;
   40|  52.2M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  52.2M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  5.79M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 5.79M, False: 46.4M]
  |  |  ------------------
  |  |   59|  52.2M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  46.4M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   41|  52.2M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   42|  52.2M|}
reconinter_enc.c:av1_is_valid_scale:
   64|  96.2M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  96.2M|  assert(sf != NULL);
   66|  96.2M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|   192M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 96.2M, False: 18.4E]
  ------------------
   67|  96.2M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  96.2M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 96.2M, False: 18.4E]
  ------------------
   68|  96.2M|}
reconinter_enc.c:av1_is_scaled:
   70|  96.2M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  96.2M|  assert(sf != NULL);
   72|  96.2M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 96.2M, False: 638]
  ------------------
   73|  96.2M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|   192M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  96.2M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  13.0M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  13.0M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 83.2M, False: 13.0M]
  |  Branch (73:45): [True: 10.1M, False: 2.82M]
  ------------------
   74|  96.2M|}
reconinter.c:av1_is_scaled:
   70|  12.6M|static inline int av1_is_scaled(const struct scale_factors *sf) {
   71|  12.6M|  assert(sf != NULL);
   72|  12.6M|  return av1_is_valid_scale(sf) &&
  ------------------
  |  Branch (72:10): [True: 12.6M, False: 1.30k]
  ------------------
   73|  12.6M|         (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  25.2M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  12.6M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
                       (sf->x_scale_fp != REF_NO_SCALE || sf->y_scale_fp != REF_NO_SCALE);
  ------------------
  |  |   25|  3.35M|#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
  |  |  ------------------
  |  |  |  |   24|  3.35M|#define REF_SCALE_SHIFT 14
  |  |  ------------------
  ------------------
  |  Branch (73:11): [True: 9.27M, False: 3.35M]
  |  Branch (73:45): [True: 1.18M, False: 2.17M]
  ------------------
   74|  12.6M|}
reconinter.c:av1_scaled_x:
   36|  4.40M|static inline int av1_scaled_x(int val, const struct scale_factors *sf) {
   37|  4.40M|  const int off =
   38|  4.40M|      (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  4.40M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  4.40M|#define SUBPEL_BITS 4
  ------------------
   39|  4.40M|  const int64_t tval = (int64_t)val * sf->x_scale_fp + off;
   40|  4.40M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  4.40M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|   854k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 854k, False: 3.54M]
  |  |  ------------------
  |  |   59|  4.40M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  3.54M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   41|  4.40M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   42|  4.40M|}
reconinter.c:av1_scaled_y:
   45|  4.40M|static inline int av1_scaled_y(int val, const struct scale_factors *sf) {
   46|  4.40M|  const int off =
   47|  4.40M|      (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|  4.40M|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|  4.40M|#define SUBPEL_BITS 4
  ------------------
   48|  4.40M|  const int64_t tval = (int64_t)val * sf->y_scale_fp + off;
   49|  4.40M|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|  4.40M|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|   895k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 895k, False: 3.50M]
  |  |  ------------------
  |  |   59|  4.40M|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|  3.50M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   50|  4.40M|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   51|  4.40M|}
reconinter.c:av1_unscaled_value:
   54|  1.27M|static inline int av1_unscaled_value(int val, const struct scale_factors *sf) {
   55|  1.27M|  (void)sf;
   56|  1.27M|  return val * (1 << SCALE_EXTRA_BITS);
  ------------------
  |  |   31|  1.27M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  1.27M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  1.27M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   57|  1.27M|}
reconinter.c:av1_is_valid_scale:
   64|  12.6M|static inline int av1_is_valid_scale(const struct scale_factors *sf) {
   65|  12.6M|  assert(sf != NULL);
   66|  12.6M|  return sf->x_scale_fp != REF_INVALID_SCALE &&
  ------------------
  |  |   26|  25.2M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (66:10): [True: 12.6M, False: 137]
  ------------------
   67|  12.6M|         sf->y_scale_fp != REF_INVALID_SCALE;
  ------------------
  |  |   26|  12.6M|#define REF_INVALID_SCALE -1
  ------------------
  |  Branch (67:10): [True: 12.6M, False: 18.4E]
  ------------------
   68|  12.6M|}
scale.c:av1_scaled_x:
   36|   522k|static inline int av1_scaled_x(int val, const struct scale_factors *sf) {
   37|   522k|  const int off =
   38|   522k|      (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|   522k|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->x_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|   522k|#define SUBPEL_BITS 4
  ------------------
   39|   522k|  const int64_t tval = (int64_t)val * sf->x_scale_fp + off;
   40|   522k|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|   522k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  56.9k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 56.9k, False: 465k]
  |  |  ------------------
  |  |   59|   522k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   465k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   41|   522k|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   42|   522k|}
scale.c:av1_scaled_y:
   45|   522k|static inline int av1_scaled_y(int val, const struct scale_factors *sf) {
   46|   522k|  const int off =
   47|   522k|      (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   24|   522k|#define REF_SCALE_SHIFT 14
  ------------------
                    (sf->y_scale_fp - (1 << REF_SCALE_SHIFT)) * (1 << (SUBPEL_BITS - 1));
  ------------------
  |  |   23|   522k|#define SUBPEL_BITS 4
  ------------------
   48|   522k|  const int64_t tval = (int64_t)val * sf->y_scale_fp + off;
   49|   522k|  return (int)ROUND_POWER_OF_TWO_SIGNED_64(tval,
  ------------------
  |  |   58|   522k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  60.3k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 60.3k, False: 462k]
  |  |  ------------------
  |  |   59|   522k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   462k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
   50|   522k|                                           REF_SCALE_SHIFT - SCALE_EXTRA_BITS);
   51|   522k|}
scale.c:valid_ref_frame_size:
   78|  1.58M|                                       int this_width, int this_height) {
   79|  1.58M|  return 2 * this_width >= ref_width && 2 * this_height >= ref_height &&
  ------------------
  |  Branch (79:10): [True: 1.58M, False: 6]
  |  Branch (79:41): [True: 1.58M, False: 18.4E]
  ------------------
   80|  1.58M|         this_width <= 16 * ref_width && this_height <= 16 * ref_height;
  ------------------
  |  Branch (80:10): [True: 1.58M, False: 18.4E]
  |  Branch (80:42): [True: 1.58M, False: 18.4E]
  ------------------
   81|  1.58M|}

decodetxb.c:get_scan:
   46|  1.91M|static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
   47|  1.91M|  return get_default_scan(tx_size, tx_type);
   48|  1.91M|}
decodetxb.c:get_default_scan:
   42|  1.91M|                                                 TX_TYPE tx_type) {
   43|  1.91M|  return &av1_scan_orders[tx_size][tx_type];
   44|  1.91M|}
encodemb.c:get_scan:
   46|   132M|static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
   47|   132M|  return get_default_scan(tx_size, tx_type);
   48|   132M|}
encodemb.c:get_default_scan:
   42|   132M|                                                 TX_TYPE tx_type) {
   43|   132M|  return &av1_scan_orders[tx_size][tx_type];
   44|   132M|}
encodetxb.c:get_scan:
   46|  21.1M|static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
   47|  21.1M|  return get_default_scan(tx_size, tx_type);
   48|  21.1M|}
encodetxb.c:get_default_scan:
   42|  21.1M|                                                 TX_TYPE tx_type) {
   43|  21.1M|  return &av1_scan_orders[tx_size][tx_type];
   44|  21.1M|}
tx_search.c:get_scan:
   46|   100M|static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
   47|   100M|  return get_default_scan(tx_size, tx_type);
   48|   100M|}
tx_search.c:get_default_scan:
   42|   100M|                                                 TX_TYPE tx_type) {
   43|   100M|  return &av1_scan_orders[tx_size][tx_type];
   44|   100M|}
txb_rdopt.c:get_scan:
   46|   124M|static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
   47|   124M|  return get_default_scan(tx_size, tx_type);
   48|   124M|}
txb_rdopt.c:get_default_scan:
   42|   124M|                                                 TX_TYPE tx_type) {
   43|   124M|  return &av1_scan_orders[tx_size][tx_type];
   44|   124M|}

av1_clearall_segfeatures:
   37|   233k|void av1_clearall_segfeatures(struct segmentation *seg) {
   38|   233k|  av1_zero(seg->feature_data);
  ------------------
  |  |   43|   233k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   39|   233k|  av1_zero(seg->feature_mask);
  ------------------
  |  |   43|   233k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   40|   233k|}

decodeframe.c:segfeatures_copy:
   70|  28.0k|                                    const struct segmentation *src) {
   71|  28.0k|  int i, j;
   72|   252k|  for (i = 0; i < MAX_SEGMENTS; i++) {
  ------------------
  |  |   23|   252k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (72:15): [True: 224k, False: 28.0k]
  ------------------
   73|   224k|    dst->feature_mask[i] = src->feature_mask[i];
   74|  2.02M|    for (j = 0; j < SEG_LVL_MAX; j++) {
  ------------------
  |  Branch (74:17): [True: 1.79M, False: 224k]
  ------------------
   75|  1.79M|      dst->feature_data[i][j] = src->feature_data[i][j];
   76|  1.79M|    }
   77|   224k|  }
   78|  28.0k|  dst->segid_preskip = src->segid_preskip;
   79|  28.0k|  dst->last_active_segid = src->last_active_segid;
   80|  28.0k|}
decodemv.c:segfeature_active:
   65|  4.42M|                                    SEG_LVL_FEATURES feature_id) {
   66|  4.42M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 4.42M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  4.42M|}
av1_quantize.c:segfeature_active:
   65|   167k|                                    SEG_LVL_FEATURES feature_id) {
   66|   167k|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 167k]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|   167k|}
bitstream.c:segfeature_active:
   65|  10.7M|                                    SEG_LVL_FEATURES feature_id) {
   66|  10.7M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 10.7M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  10.7M|}
encoder.c:segfeatures_copy:
   70|  73.6k|                                    const struct segmentation *src) {
   71|  73.6k|  int i, j;
   72|   662k|  for (i = 0; i < MAX_SEGMENTS; i++) {
  ------------------
  |  |   23|   662k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (72:15): [True: 588k, False: 73.6k]
  ------------------
   73|   588k|    dst->feature_mask[i] = src->feature_mask[i];
   74|  5.30M|    for (j = 0; j < SEG_LVL_MAX; j++) {
  ------------------
  |  Branch (74:17): [True: 4.71M, False: 588k]
  ------------------
   75|  4.71M|      dst->feature_data[i][j] = src->feature_data[i][j];
   76|  4.71M|    }
   77|   588k|  }
   78|  73.6k|  dst->segid_preskip = src->segid_preskip;
   79|  73.6k|  dst->last_active_segid = src->last_active_segid;
   80|  73.6k|}
encodetxb.c:segfeature_active:
   65|  8.08M|                                    SEG_LVL_FEATURES feature_id) {
   66|  8.08M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 8.08M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  8.08M|}
partition_search.c:segfeature_active:
   65|  13.5M|                                    SEG_LVL_FEATURES feature_id) {
   66|  13.5M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 13.5M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  13.5M|}
rdopt.c:segfeature_active:
   65|  17.2M|                                    SEG_LVL_FEATURES feature_id) {
   66|  17.2M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 17.2M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  17.2M|}
nonrd_pickmode.c:segfeature_active:
   65|  14.9M|                                    SEG_LVL_FEATURES feature_id) {
   66|  14.9M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 14.9M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  14.9M|}
av1_loopfilter.c:segfeature_active:
   65|  3.40M|                                    SEG_LVL_FEATURES feature_id) {
   66|  3.40M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 3.40M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  3.40M|}
quant_common.c:segfeature_active:
   65|  1.93M|                                    SEG_LVL_FEATURES feature_id) {
   66|  1.93M|  return seg->enabled && (seg->feature_mask[segment_id] & (1 << feature_id));
  ------------------
  |  Branch (66:10): [True: 0, False: 1.93M]
  |  Branch (66:26): [True: 0, False: 0]
  ------------------
   67|  1.93M|}

av1_loop_filter_alloc:
   69|  38.9k|                           int width, int num_workers) {
   70|  38.9k|  lf_sync->rows = rows;
   71|  38.9k|#if CONFIG_MULTITHREAD
   72|  38.9k|  {
   73|  38.9k|    int i, j;
   74|       |
   75|   155k|    for (j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   155k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (75:17): [True: 116k, False: 38.9k]
  ------------------
   76|   116k|      CHECK_MEM_ERROR(cm, lf_sync->mutex_[j],
  ------------------
  |  |   51|   116k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   116k|  do {                                                    \
  |  |  |  |   72|   116k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   116k|    lval = (expr);                                        \
  |  |  |  |   74|   116k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  |  |   75|   116k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   116k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|   116k|                      aom_malloc(sizeof(*(lf_sync->mutex_[j])) * rows));
   78|   116k|      if (lf_sync->mutex_[j]) {
  ------------------
  |  Branch (78:11): [True: 116k, False: 0]
  ------------------
   79|   266k|        for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (79:21): [True: 149k, False: 116k]
  ------------------
   80|   149k|          pthread_mutex_init(&lf_sync->mutex_[j][i], NULL);
   81|   149k|        }
   82|   116k|      }
   83|       |
   84|   116k|      CHECK_MEM_ERROR(cm, lf_sync->cond_[j],
  ------------------
  |  |   51|   116k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   116k|  do {                                                    \
  |  |  |  |   72|   116k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   116k|    lval = (expr);                                        \
  |  |  |  |   74|   116k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  |  |   75|   116k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   116k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|   116k|                      aom_malloc(sizeof(*(lf_sync->cond_[j])) * rows));
   86|   116k|      if (lf_sync->cond_[j]) {
  ------------------
  |  Branch (86:11): [True: 116k, False: 0]
  ------------------
   87|   266k|        for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (87:21): [True: 149k, False: 116k]
  ------------------
   88|   149k|          pthread_cond_init(&lf_sync->cond_[j][i], NULL);
   89|   149k|        }
   90|   116k|      }
   91|   116k|    }
   92|       |
   93|  38.9k|    CHECK_MEM_ERROR(cm, lf_sync->job_mutex,
  ------------------
  |  |   51|  38.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  38.9k|  do {                                                    \
  |  |  |  |   72|  38.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  38.9k|    lval = (expr);                                        \
  |  |  |  |   74|  38.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  38.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  38.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  38.9k|                    aom_malloc(sizeof(*(lf_sync->job_mutex))));
   95|  38.9k|    if (lf_sync->job_mutex) {
  ------------------
  |  Branch (95:9): [True: 38.9k, False: 0]
  ------------------
   96|  38.9k|      pthread_mutex_init(lf_sync->job_mutex, NULL);
   97|  38.9k|    }
   98|  38.9k|  }
   99|  38.9k|#endif  // CONFIG_MULTITHREAD
  100|  38.9k|  CHECK_MEM_ERROR(cm, lf_sync->lfdata,
  ------------------
  |  |   51|  38.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  38.9k|  do {                                                    \
  |  |  |  |   72|  38.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  38.9k|    lval = (expr);                                        \
  |  |  |  |   74|  38.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  38.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  38.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  38.9k|                  aom_malloc(num_workers * sizeof(*(lf_sync->lfdata))));
  102|  38.9k|  lf_sync->num_workers = num_workers;
  103|       |
  104|   155k|  for (int j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   155k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (104:19): [True: 116k, False: 38.9k]
  ------------------
  105|   116k|    CHECK_MEM_ERROR(cm, lf_sync->cur_sb_col[j],
  ------------------
  |  |   51|   116k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   116k|  do {                                                    \
  |  |  |  |   72|   116k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   116k|    lval = (expr);                                        \
  |  |  |  |   74|   116k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 116k]
  |  |  |  |  ------------------
  |  |  |  |   75|   116k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   116k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 116k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|   116k|                    aom_malloc(sizeof(*(lf_sync->cur_sb_col[j])) * rows));
  107|   116k|  }
  108|  38.9k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  38.9k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  38.9k|  do {                                                    \
  |  |  |  |   72|  38.9k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  38.9k|    lval = (expr);                                        \
  |  |  |  |   74|  38.9k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  |  |   75|  38.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  38.9k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|  38.9k|      cm, lf_sync->job_queue,
  110|  38.9k|      aom_malloc(sizeof(*(lf_sync->job_queue)) * rows * MAX_MB_PLANE * 2));
  111|       |  // Set up nsync.
  112|  38.9k|  lf_sync->sync_range = get_sync_range(width);
  113|  38.9k|}
av1_loop_filter_dealloc:
  116|  59.4k|void av1_loop_filter_dealloc(AV1LfSync *lf_sync) {
  117|  59.4k|  if (lf_sync != NULL) {
  ------------------
  |  Branch (117:7): [True: 59.4k, False: 0]
  ------------------
  118|  59.4k|    int j;
  119|  59.4k|#if CONFIG_MULTITHREAD
  120|  59.4k|    int i;
  121|   237k|    for (j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   237k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (121:17): [True: 178k, False: 59.4k]
  ------------------
  122|   178k|      if (lf_sync->mutex_[j] != NULL) {
  ------------------
  |  Branch (122:11): [True: 116k, False: 61.7k]
  ------------------
  123|   266k|        for (i = 0; i < lf_sync->rows; ++i) {
  ------------------
  |  Branch (123:21): [True: 149k, False: 116k]
  ------------------
  124|   149k|          pthread_mutex_destroy(&lf_sync->mutex_[j][i]);
  125|   149k|        }
  126|   116k|        aom_free(lf_sync->mutex_[j]);
  127|   116k|      }
  128|   178k|      if (lf_sync->cond_[j] != NULL) {
  ------------------
  |  Branch (128:11): [True: 116k, False: 61.7k]
  ------------------
  129|   266k|        for (i = 0; i < lf_sync->rows; ++i) {
  ------------------
  |  Branch (129:21): [True: 149k, False: 116k]
  ------------------
  130|   149k|          pthread_cond_destroy(&lf_sync->cond_[j][i]);
  131|   149k|        }
  132|   116k|        aom_free(lf_sync->cond_[j]);
  133|   116k|      }
  134|   178k|    }
  135|  59.4k|    if (lf_sync->job_mutex != NULL) {
  ------------------
  |  Branch (135:9): [True: 38.9k, False: 20.5k]
  ------------------
  136|  38.9k|      pthread_mutex_destroy(lf_sync->job_mutex);
  137|  38.9k|      aom_free(lf_sync->job_mutex);
  138|  38.9k|    }
  139|  59.4k|#endif  // CONFIG_MULTITHREAD
  140|  59.4k|    aom_free(lf_sync->lfdata);
  141|   237k|    for (j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   237k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (141:17): [True: 178k, False: 59.4k]
  ------------------
  142|   178k|      aom_free(lf_sync->cur_sb_col[j]);
  143|   178k|    }
  144|       |
  145|  59.4k|    aom_free(lf_sync->job_queue);
  146|       |    // clear the structure as the source of this call may be a resize in which
  147|       |    // case this call will be followed by an _alloc() which may fail.
  148|  59.4k|    av1_zero(*lf_sync);
  ------------------
  |  |   43|  59.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  149|  59.4k|  }
  150|  59.4k|}
av1_alloc_cdef_sync:
  153|  28.0k|                         int num_workers) {
  154|  28.0k|  if (num_workers < 1) return;
  ------------------
  |  Branch (154:7): [True: 1.82k, False: 26.2k]
  ------------------
  155|  26.2k|#if CONFIG_MULTITHREAD
  156|  26.2k|  if (cdef_sync->mutex_ == NULL) {
  ------------------
  |  Branch (156:7): [True: 6.56k, False: 19.6k]
  ------------------
  157|  6.56k|    CHECK_MEM_ERROR(cm, cdef_sync->mutex_,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  6.56k|                    aom_malloc(sizeof(*(cdef_sync->mutex_))));
  159|  6.56k|    if (cdef_sync->mutex_) pthread_mutex_init(cdef_sync->mutex_, NULL);
  ------------------
  |  Branch (159:9): [True: 6.56k, False: 0]
  ------------------
  160|  6.56k|  }
  161|       |#else
  162|       |  (void)cm;
  163|       |  (void)cdef_sync;
  164|       |#endif  // CONFIG_MULTITHREAD
  165|  26.2k|}
av1_free_cdef_sync:
  167|  7.01k|void av1_free_cdef_sync(AV1CdefSync *cdef_sync) {
  168|  7.01k|  if (cdef_sync == NULL) return;
  ------------------
  |  Branch (168:7): [True: 0, False: 7.01k]
  ------------------
  169|  7.01k|#if CONFIG_MULTITHREAD
  170|  7.01k|  if (cdef_sync->mutex_ != NULL) {
  ------------------
  |  Branch (170:7): [True: 6.56k, False: 455]
  ------------------
  171|  6.56k|    pthread_mutex_destroy(cdef_sync->mutex_);
  172|  6.56k|    aom_free(cdef_sync->mutex_);
  173|  6.56k|  }
  174|  7.01k|#endif  // CONFIG_MULTITHREAD
  175|  7.01k|}
av1_thread_loop_filter_rows:
  273|   463k|    int num_mis_in_lpf_unit_height_log2) {
  274|       |  // TODO(aomedia:3276): Pass error_info to the low-level functions as required
  275|       |  // in future to handle error propagation.
  276|   463k|  (void)error_info;
  277|   463k|  const int sb_cols =
  278|   463k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   62|   463k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  279|   463k|  const int r = mi_row >> num_mis_in_lpf_unit_height_log2;
  280|   463k|  int mi_col, c;
  281|       |
  282|   463k|  const bool joint_filter_chroma = (lpf_opt_level == 2) && plane > AOM_PLANE_Y;
  ------------------
  |  |  281|   546k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (282:36): [True: 82.4k, False: 381k]
  |  Branch (282:60): [True: 21.1k, False: 61.2k]
  ------------------
  283|   463k|  const int num_planes = joint_filter_chroma ? 2 : 1;
  ------------------
  |  Branch (283:26): [True: 21.1k, False: 442k]
  ------------------
  284|   463k|  assert(IMPLIES(joint_filter_chroma, plane == AOM_PLANE_U));
  285|       |
  286|   463k|  if (dir == 0) {
  ------------------
  |  Branch (286:7): [True: 231k, False: 231k]
  ------------------
  287|   491k|    for (mi_col = 0; mi_col < cm->mi_params.mi_cols; mi_col += MAX_MIB_SIZE) {
  ------------------
  |  |   44|   259k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|   259k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   259k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   259k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (287:22): [True: 259k, False: 231k]
  ------------------
  288|   259k|      c = mi_col >> MAX_MIB_SIZE_LOG2;
  ------------------
  |  |   43|   259k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   259k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   259k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  289|       |
  290|   259k|      av1_setup_dst_planes(planes, cm->seq_params->sb_size, frame_buffer,
  291|   259k|                           mi_row, mi_col, plane, plane + num_planes);
  292|   259k|      if (lpf_opt_level) {
  ------------------
  |  Branch (292:11): [True: 237k, False: 21.7k]
  ------------------
  293|   237k|        if (plane == AOM_PLANE_Y) {
  ------------------
  |  |  281|   237k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (293:13): [True: 140k, False: 97.3k]
  ------------------
  294|   140k|          av1_filter_block_plane_vert_opt(cm, xd, &planes[plane], mi_row,
  295|   140k|                                          mi_col, params_buf, tx_buf,
  296|   140k|                                          num_mis_in_lpf_unit_height_log2);
  297|   140k|        } else {
  298|  97.3k|          av1_filter_block_plane_vert_opt_chroma(
  299|  97.3k|              cm, xd, &planes[plane], mi_row, mi_col, params_buf, tx_buf, plane,
  300|  97.3k|              joint_filter_chroma, num_mis_in_lpf_unit_height_log2);
  301|  97.3k|        }
  302|   237k|      } else {
  303|  21.7k|        av1_filter_block_plane_vert(cm, xd, plane, &planes[plane], mi_row,
  304|  21.7k|                                    mi_col);
  305|  21.7k|      }
  306|   259k|      if (lf_sync != NULL) {
  ------------------
  |  Branch (306:11): [True: 133k, False: 125k]
  ------------------
  307|   133k|        sync_write(lf_sync, r, c, sb_cols, plane);
  308|   133k|      }
  309|   259k|    }
  310|   231k|  } else if (dir == 1) {
  ------------------
  |  Branch (310:14): [True: 231k, False: 18.4E]
  ------------------
  311|   491k|    for (mi_col = 0; mi_col < cm->mi_params.mi_cols; mi_col += MAX_MIB_SIZE) {
  ------------------
  |  |   44|   259k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|   259k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   259k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   259k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (311:22): [True: 259k, False: 231k]
  ------------------
  312|   259k|      c = mi_col >> MAX_MIB_SIZE_LOG2;
  ------------------
  |  |   43|   259k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   259k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   259k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  313|       |
  314|   259k|      if (lf_sync != NULL) {
  ------------------
  |  Branch (314:11): [True: 133k, False: 125k]
  ------------------
  315|       |        // Wait for vertical edge filtering of the top-right block to be
  316|       |        // completed
  317|   133k|        sync_read(lf_sync, r, c, plane);
  318|       |
  319|       |        // Wait for vertical edge filtering of the right block to be completed
  320|   133k|        sync_read(lf_sync, r + 1, c, plane);
  321|   133k|      }
  322|       |
  323|   259k|#if CONFIG_MULTITHREAD
  324|   259k|      if (lf_sync && lf_sync->num_workers > 1) {
  ------------------
  |  Branch (324:11): [True: 133k, False: 125k]
  |  Branch (324:22): [True: 115k, False: 18.1k]
  ------------------
  325|   115k|        pthread_mutex_lock(lf_sync->job_mutex);
  326|   115k|        const bool lf_mt_exit = lf_sync->lf_mt_exit;
  327|   115k|        pthread_mutex_unlock(lf_sync->job_mutex);
  328|       |        // Exit in case any worker has encountered an error.
  329|   115k|        if (lf_mt_exit) return;
  ------------------
  |  Branch (329:13): [True: 0, False: 115k]
  ------------------
  330|   115k|      }
  331|   259k|#endif
  332|       |
  333|   259k|      av1_setup_dst_planes(planes, cm->seq_params->sb_size, frame_buffer,
  334|   259k|                           mi_row, mi_col, plane, plane + num_planes);
  335|   259k|      if (lpf_opt_level) {
  ------------------
  |  Branch (335:11): [True: 237k, False: 21.6k]
  ------------------
  336|   237k|        if (plane == AOM_PLANE_Y) {
  ------------------
  |  |  281|   237k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (336:13): [True: 140k, False: 97.3k]
  ------------------
  337|   140k|          av1_filter_block_plane_horz_opt(cm, xd, &planes[plane], mi_row,
  338|   140k|                                          mi_col, params_buf, tx_buf,
  339|   140k|                                          num_mis_in_lpf_unit_height_log2);
  340|   140k|        } else {
  341|  97.3k|          av1_filter_block_plane_horz_opt_chroma(
  342|  97.3k|              cm, xd, &planes[plane], mi_row, mi_col, params_buf, tx_buf, plane,
  343|  97.3k|              joint_filter_chroma, num_mis_in_lpf_unit_height_log2);
  344|  97.3k|        }
  345|   237k|      } else {
  346|  21.6k|        av1_filter_block_plane_horz(cm, xd, plane, &planes[plane], mi_row,
  347|  21.6k|                                    mi_col);
  348|  21.6k|      }
  349|   259k|    }
  350|   231k|  }
  351|   463k|}
av1_loop_filter_frame_mt:
  497|   253k|                              int lpf_opt_level) {
  498|   253k|  int start_mi_row, end_mi_row, mi_rows_to_filter;
  499|   253k|  int planes_to_lf[MAX_MB_PLANE];
  500|       |
  501|   253k|  if (!check_planes_to_loop_filter(&cm->lf, planes_to_lf, plane_start,
  ------------------
  |  Branch (501:7): [True: 82.8k, False: 171k]
  ------------------
  502|   253k|                                   plane_end))
  503|  82.8k|    return;
  504|       |
  505|   171k|  start_mi_row = 0;
  506|   171k|  mi_rows_to_filter = cm->mi_params.mi_rows;
  507|   171k|  if (partial_frame && cm->mi_params.mi_rows > 8) {
  ------------------
  |  Branch (507:7): [True: 0, False: 171k]
  |  Branch (507:24): [True: 0, False: 0]
  ------------------
  508|      0|    start_mi_row = cm->mi_params.mi_rows >> 1;
  509|      0|    start_mi_row &= 0xfffffff8;
  510|      0|    mi_rows_to_filter = AOMMAX(cm->mi_params.mi_rows / 8, 8);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  511|      0|  }
  512|   171k|  end_mi_row = start_mi_row + mi_rows_to_filter;
  513|   171k|  av1_loop_filter_frame_init(cm, plane_start, plane_end);
  514|       |
  515|   171k|  if (num_workers > 1) {
  ------------------
  |  Branch (515:7): [True: 57.5k, False: 113k]
  ------------------
  516|       |    // Enqueue and execute loopfiltering jobs.
  517|  57.5k|    loop_filter_rows_mt(frame, cm, xd, start_mi_row, end_mi_row, planes_to_lf,
  518|  57.5k|                        workers, num_workers, lf_sync, lpf_opt_level);
  519|   113k|  } else {
  520|       |    // Directly filter in the main thread.
  521|   113k|    loop_filter_rows(frame, cm, xd, start_mi_row, end_mi_row, planes_to_lf,
  522|   113k|                     lpf_opt_level);
  523|   113k|  }
  524|   171k|}
av1_loop_restoration_alloc:
  591|  7.67k|                                int num_planes, int width) {
  592|  7.67k|  lr_sync->rows = num_rows_lr;
  593|  7.67k|  lr_sync->num_planes = num_planes;
  594|  7.67k|#if CONFIG_MULTITHREAD
  595|  7.67k|  {
  596|  7.67k|    int i, j;
  597|       |
  598|  21.2k|    for (j = 0; j < num_planes; j++) {
  ------------------
  |  Branch (598:17): [True: 13.6k, False: 7.67k]
  ------------------
  599|  13.6k|      CHECK_MEM_ERROR(cm, lr_sync->mutex_[j],
  ------------------
  |  |   51|  13.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  13.6k|  do {                                                    \
  |  |  |  |   72|  13.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  13.6k|    lval = (expr);                                        \
  |  |  |  |   74|  13.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 13.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  13.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  13.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 13.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|  13.6k|                      aom_malloc(sizeof(*(lr_sync->mutex_[j])) * num_rows_lr));
  601|  13.6k|      if (lr_sync->mutex_[j]) {
  ------------------
  |  Branch (601:11): [True: 13.6k, False: 0]
  ------------------
  602|  32.8k|        for (i = 0; i < num_rows_lr; ++i) {
  ------------------
  |  Branch (602:21): [True: 19.1k, False: 13.6k]
  ------------------
  603|  19.1k|          pthread_mutex_init(&lr_sync->mutex_[j][i], NULL);
  604|  19.1k|        }
  605|  13.6k|      }
  606|       |
  607|  13.6k|      CHECK_MEM_ERROR(cm, lr_sync->cond_[j],
  ------------------
  |  |   51|  13.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  13.6k|  do {                                                    \
  |  |  |  |   72|  13.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  13.6k|    lval = (expr);                                        \
  |  |  |  |   74|  13.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 13.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  13.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  13.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 13.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  608|  13.6k|                      aom_malloc(sizeof(*(lr_sync->cond_[j])) * num_rows_lr));
  609|  13.6k|      if (lr_sync->cond_[j]) {
  ------------------
  |  Branch (609:11): [True: 13.6k, False: 0]
  ------------------
  610|  32.8k|        for (i = 0; i < num_rows_lr; ++i) {
  ------------------
  |  Branch (610:21): [True: 19.1k, False: 13.6k]
  ------------------
  611|  19.1k|          pthread_cond_init(&lr_sync->cond_[j][i], NULL);
  612|  19.1k|        }
  613|  13.6k|      }
  614|  13.6k|    }
  615|       |
  616|  7.67k|    CHECK_MEM_ERROR(cm, lr_sync->job_mutex,
  ------------------
  |  |   51|  7.67k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  7.67k|  do {                                                    \
  |  |  |  |   72|  7.67k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  7.67k|    lval = (expr);                                        \
  |  |  |  |   74|  7.67k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |   75|  7.67k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  7.67k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 7.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  617|  7.67k|                    aom_malloc(sizeof(*(lr_sync->job_mutex))));
  618|  7.67k|    if (lr_sync->job_mutex) {
  ------------------
  |  Branch (618:9): [True: 7.67k, False: 0]
  ------------------
  619|  7.67k|      pthread_mutex_init(lr_sync->job_mutex, NULL);
  620|  7.67k|    }
  621|  7.67k|  }
  622|  7.67k|#endif  // CONFIG_MULTITHREAD
  623|  7.67k|  CHECK_MEM_ERROR(cm, lr_sync->lrworkerdata,
  ------------------
  |  |   51|  7.67k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  7.67k|  do {                                                    \
  |  |  |  |   72|  7.67k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  7.67k|    lval = (expr);                                        \
  |  |  |  |   74|  7.67k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |   75|  7.67k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  7.67k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 7.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  624|  7.67k|                  aom_calloc(num_workers, sizeof(*(lr_sync->lrworkerdata))));
  625|  7.67k|  lr_sync->num_workers = num_workers;
  626|       |
  627|  29.1k|  for (int worker_idx = 0; worker_idx < num_workers; ++worker_idx) {
  ------------------
  |  Branch (627:28): [True: 21.5k, False: 7.67k]
  ------------------
  628|  21.5k|    if (worker_idx < num_workers - 1) {
  ------------------
  |  Branch (628:9): [True: 13.8k, False: 7.67k]
  ------------------
  629|  13.8k|      CHECK_MEM_ERROR(cm, lr_sync->lrworkerdata[worker_idx].rst_tmpbuf,
  ------------------
  |  |   51|  13.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  13.8k|  do {                                                    \
  |  |  |  |   72|  13.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  13.8k|    lval = (expr);                                        \
  |  |  |  |   74|  13.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  13.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  13.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|  13.8k|                      (int32_t *)aom_memalign(16, RESTORATION_TMPBUF_SIZE));
  631|  13.8k|      CHECK_MEM_ERROR(cm, lr_sync->lrworkerdata[worker_idx].rlbs,
  ------------------
  |  |   51|  13.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  13.8k|  do {                                                    \
  |  |  |  |   72|  13.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  13.8k|    lval = (expr);                                        \
  |  |  |  |   74|  13.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  13.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  13.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|  13.8k|                      aom_malloc(sizeof(RestorationLineBuffers)));
  633|       |
  634|  13.8k|    } else {
  635|  7.67k|      lr_sync->lrworkerdata[worker_idx].rst_tmpbuf = cm->rst_tmpbuf;
  636|  7.67k|      lr_sync->lrworkerdata[worker_idx].rlbs = cm->rlbs;
  637|  7.67k|    }
  638|  21.5k|  }
  639|       |
  640|  21.2k|  for (int j = 0; j < num_planes; j++) {
  ------------------
  |  Branch (640:19): [True: 13.6k, False: 7.67k]
  ------------------
  641|  13.6k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  13.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  13.6k|  do {                                                    \
  |  |  |  |   72|  13.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  13.6k|    lval = (expr);                                        \
  |  |  |  |   74|  13.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 13.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  13.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  13.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 13.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  642|  13.6k|        cm, lr_sync->cur_sb_col[j],
  643|  13.6k|        aom_malloc(sizeof(*(lr_sync->cur_sb_col[j])) * num_rows_lr));
  644|  13.6k|  }
  645|  7.67k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  7.67k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  7.67k|  do {                                                    \
  |  |  |  |   72|  7.67k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  7.67k|    lval = (expr);                                        \
  |  |  |  |   74|  7.67k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |   75|  7.67k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  7.67k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 7.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  646|  7.67k|      cm, lr_sync->job_queue,
  647|  7.67k|      aom_malloc(sizeof(*(lr_sync->job_queue)) * num_rows_lr * num_planes));
  648|       |  // Set up nsync.
  649|  7.67k|  lr_sync->sync_range = get_lr_sync_range(width);
  650|  7.67k|}
av1_loop_restoration_dealloc:
  653|  28.2k|void av1_loop_restoration_dealloc(AV1LrSync *lr_sync) {
  654|  28.2k|  if (lr_sync != NULL) {
  ------------------
  |  Branch (654:7): [True: 28.2k, False: 0]
  ------------------
  655|  28.2k|    int j;
  656|  28.2k|#if CONFIG_MULTITHREAD
  657|  28.2k|    int i;
  658|   112k|    for (j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   112k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (658:17): [True: 84.7k, False: 28.2k]
  ------------------
  659|  84.7k|      if (lr_sync->mutex_[j] != NULL) {
  ------------------
  |  Branch (659:11): [True: 13.6k, False: 71.1k]
  ------------------
  660|  32.8k|        for (i = 0; i < lr_sync->rows; ++i) {
  ------------------
  |  Branch (660:21): [True: 19.1k, False: 13.6k]
  ------------------
  661|  19.1k|          pthread_mutex_destroy(&lr_sync->mutex_[j][i]);
  662|  19.1k|        }
  663|  13.6k|        aom_free(lr_sync->mutex_[j]);
  664|  13.6k|      }
  665|  84.7k|      if (lr_sync->cond_[j] != NULL) {
  ------------------
  |  Branch (665:11): [True: 13.6k, False: 71.1k]
  ------------------
  666|  32.8k|        for (i = 0; i < lr_sync->rows; ++i) {
  ------------------
  |  Branch (666:21): [True: 19.1k, False: 13.6k]
  ------------------
  667|  19.1k|          pthread_cond_destroy(&lr_sync->cond_[j][i]);
  668|  19.1k|        }
  669|  13.6k|        aom_free(lr_sync->cond_[j]);
  670|  13.6k|      }
  671|  84.7k|    }
  672|  28.2k|    if (lr_sync->job_mutex != NULL) {
  ------------------
  |  Branch (672:9): [True: 7.67k, False: 20.5k]
  ------------------
  673|  7.67k|      pthread_mutex_destroy(lr_sync->job_mutex);
  674|  7.67k|      aom_free(lr_sync->job_mutex);
  675|  7.67k|    }
  676|  28.2k|#endif  // CONFIG_MULTITHREAD
  677|   112k|    for (j = 0; j < MAX_MB_PLANE; j++) {
  ------------------
  |  |   36|   112k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (677:17): [True: 84.7k, False: 28.2k]
  ------------------
  678|  84.7k|      aom_free(lr_sync->cur_sb_col[j]);
  679|  84.7k|    }
  680|       |
  681|  28.2k|    aom_free(lr_sync->job_queue);
  682|       |
  683|  28.2k|    if (lr_sync->lrworkerdata) {
  ------------------
  |  Branch (683:9): [True: 7.67k, False: 20.5k]
  ------------------
  684|  21.5k|      for (int worker_idx = 0; worker_idx < lr_sync->num_workers - 1;
  ------------------
  |  Branch (684:32): [True: 13.8k, False: 7.67k]
  ------------------
  685|  13.8k|           worker_idx++) {
  686|  13.8k|        LRWorkerData *const workerdata_data =
  687|  13.8k|            lr_sync->lrworkerdata + worker_idx;
  688|       |
  689|  13.8k|        aom_free(workerdata_data->rst_tmpbuf);
  690|  13.8k|        aom_free(workerdata_data->rlbs);
  691|  13.8k|      }
  692|  7.67k|      aom_free(lr_sync->lrworkerdata);
  693|  7.67k|    }
  694|       |
  695|       |    // clear the structure as the source of this call may be a resize in which
  696|       |    // case this call will be followed by an _alloc() which may fail.
  697|  28.2k|    av1_zero(*lr_sync);
  ------------------
  |  |   43|  28.2k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  698|  28.2k|  }
  699|  28.2k|}
av1_loop_restoration_filter_frame_mt:
  986|    256|                                          int do_extend_border) {
  987|    256|  assert(!cm->features.all_lossless);
  988|       |
  989|    256|  const int num_planes = av1_num_planes(cm);
  990|       |
  991|    256|  AV1LrStruct *loop_rest_ctxt = (AV1LrStruct *)lr_ctxt;
  992|       |
  993|    256|  av1_loop_restoration_filter_frame_init(loop_rest_ctxt, frame, cm,
  994|    256|                                         optimized_lr, num_planes);
  995|       |
  996|    256|  foreach_rest_unit_in_planes_mt(loop_rest_ctxt, workers, num_workers, lr_sync,
  997|    256|                                 cm, do_extend_border);
  998|    256|}
av1_cdef_init_fb_row_mt:
 1167|  57.7k|                             struct AV1CdefSyncData *const cdef_sync, int fbr) {
 1168|  57.7k|  const int num_planes = av1_num_planes(cm);
 1169|  57.7k|  const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  57.7k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  57.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  57.7k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  57.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1170|  57.7k|  const int luma_stride =
 1171|  57.7k|      ALIGN_POWER_OF_TWO(cm->mi_params.mi_cols << MI_SIZE_LOG2, 4);
  ------------------
  |  |   69|  57.7k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 1172|       |
 1173|       |  // for the current filter block, it's top left corner mi structure (mi_tl)
 1174|       |  // is first accessed to check whether the top and left boundaries are
 1175|       |  // frame boundaries. Then bottom-left and top-right mi structures are
 1176|       |  // accessed to check whether the bottom and right boundaries
 1177|       |  // (respectively) are frame boundaries.
 1178|       |  //
 1179|       |  // Note that we can't just check the bottom-right mi structure - eg. if
 1180|       |  // we're at the right-hand edge of the frame but not the bottom, then
 1181|       |  // the bottom-right mi is NULL but the bottom-left is not.
 1182|  57.7k|  fb_info->frame_boundary[TOP] = (MI_SIZE_64X64 * fbr == 0) ? 1 : 0;
  ------------------
  |  |   58|  57.7k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  57.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (1182:34): [True: 35.9k, False: 21.8k]
  ------------------
 1183|  57.7k|  if (fbr != nvfb - 1)
  ------------------
  |  Branch (1183:7): [True: 21.8k, False: 35.9k]
  ------------------
 1184|  21.8k|    fb_info->frame_boundary[BOTTOM] =
 1185|  21.8k|        (MI_SIZE_64X64 * (fbr + 1) == cm->mi_params.mi_rows) ? 1 : 0;
  ------------------
  |  |   58|  21.8k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  21.8k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (1185:9): [True: 0, False: 21.8k]
  ------------------
 1186|  35.9k|  else
 1187|  35.9k|    fb_info->frame_boundary[BOTTOM] = 1;
 1188|       |
 1189|  57.7k|  fb_info->src = src;
 1190|  57.7k|  fb_info->damping = cm->cdef_info.cdef_damping;
 1191|  57.7k|  fb_info->coeff_shift = AOMMAX(cm->seq_params->bit_depth - 8, 0);
  ------------------
  |  |   35|  57.7k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 14.3k, False: 43.4k]
  |  |  ------------------
  ------------------
 1192|  57.7k|  av1_zero(fb_info->dir);
  ------------------
  |  |   43|  57.7k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1193|  57.7k|  av1_zero(fb_info->var);
  ------------------
  |  |   43|  57.7k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1194|       |
 1195|   161k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (1195:23): [True: 103k, False: 57.7k]
  ------------------
 1196|   103k|    const int stride = luma_stride >> xd->plane[plane].subsampling_x;
 1197|   103k|    uint16_t *top_linebuf = &linebuf[plane][0];
 1198|   103k|    uint16_t *bot_linebuf = &linebuf[plane][nvfb * CDEF_VBORDER * stride];
  ------------------
  |  |   23|   103k|#define CDEF_VBORDER (2)
  ------------------
 1199|   103k|    {
 1200|   103k|      const int mi_high_l2 = MI_SIZE_LOG2 - xd->plane[plane].subsampling_y;
  ------------------
  |  |   39|   103k|#define MI_SIZE_LOG2 2
  ------------------
 1201|   103k|      const int top_offset = MI_SIZE_64X64 * (fbr + 1) << mi_high_l2;
  ------------------
  |  |   58|   103k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   103k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1202|   103k|      const int bot_offset = MI_SIZE_64X64 * (fbr + 1) << mi_high_l2;
  ------------------
  |  |   58|   103k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   103k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1203|       |
 1204|   103k|      if (fbr != nvfb - 1)  // if (fbr != 0)  // top line buffer copy
  ------------------
  |  Branch (1204:11): [True: 38.7k, False: 64.5k]
  ------------------
 1205|  38.7k|        av1_cdef_copy_sb8_16(
 1206|  38.7k|            cm, &top_linebuf[(fbr + 1) * CDEF_VBORDER * stride], stride,
  ------------------
  |  |   23|  38.7k|#define CDEF_VBORDER (2)
  ------------------
 1207|  38.7k|            xd->plane[plane].dst.buf, top_offset - CDEF_VBORDER, 0,
  ------------------
  |  |   23|  38.7k|#define CDEF_VBORDER (2)
  ------------------
 1208|  38.7k|            xd->plane[plane].dst.stride, CDEF_VBORDER, stride);
  ------------------
  |  |   23|  38.7k|#define CDEF_VBORDER (2)
  ------------------
 1209|   103k|      if (fbr != nvfb - 1)  // bottom line buffer copy
  ------------------
  |  Branch (1209:11): [True: 38.6k, False: 64.6k]
  ------------------
 1210|  38.6k|        av1_cdef_copy_sb8_16(cm, &bot_linebuf[fbr * CDEF_VBORDER * stride],
  ------------------
  |  |   23|  38.6k|#define CDEF_VBORDER (2)
  ------------------
 1211|  38.6k|                             stride, xd->plane[plane].dst.buf, bot_offset, 0,
 1212|  38.6k|                             xd->plane[plane].dst.stride, CDEF_VBORDER, stride);
  ------------------
  |  |   23|  38.6k|#define CDEF_VBORDER (2)
  ------------------
 1213|   103k|    }
 1214|       |
 1215|   103k|    fb_info->top_linebuf[plane] = &linebuf[plane][fbr * CDEF_VBORDER * stride];
  ------------------
  |  |   23|   103k|#define CDEF_VBORDER (2)
  ------------------
 1216|   103k|    fb_info->bot_linebuf[plane] =
 1217|   103k|        &linebuf[plane]
 1218|   103k|                [nvfb * CDEF_VBORDER * stride + (fbr * CDEF_VBORDER * stride)];
  ------------------
  |  |   23|   103k|#define CDEF_VBORDER (2)
  ------------------
                              [nvfb * CDEF_VBORDER * stride + (fbr * CDEF_VBORDER * stride)];
  ------------------
  |  |   23|   103k|#define CDEF_VBORDER (2)
  ------------------
 1219|   103k|  }
 1220|       |
 1221|  57.7k|  cdef_row_mt_sync_write(cdef_sync, fbr);
 1222|  57.7k|  cdef_row_mt_sync_read(cdef_sync, fbr);
 1223|  57.7k|}
av1_cdef_frame_mt:
 1237|  35.9k|                       int do_extend_border) {
 1238|  35.9k|  YV12_BUFFER_CONFIG *frame = &cm->cur_frame->buf;
 1239|  35.9k|  const int num_planes = av1_num_planes(cm);
 1240|       |
 1241|  35.9k|  av1_setup_dst_planes(xd->plane, cm->seq_params->sb_size, frame, 0, 0, 0,
 1242|  35.9k|                       num_planes);
 1243|       |
 1244|  35.9k|  reset_cdef_job_info(cdef_sync);
 1245|  35.9k|  prepare_cdef_frame_workers(cm, xd, cdef_worker, cdef_sb_row_worker_hook,
 1246|  35.9k|                             workers, cdef_sync, num_workers,
 1247|  35.9k|                             cdef_init_fb_row_fn, do_extend_border);
 1248|  35.9k|  launch_cdef_workers(workers, num_workers);
 1249|  35.9k|  sync_cdef_workers(workers, cm, num_workers);
 1250|  35.9k|}
av1_get_intrabc_extra_top_right_sb_delay:
 1252|   137k|int av1_get_intrabc_extra_top_right_sb_delay(const AV1_COMMON *cm) {
 1253|       |  // No additional top-right delay when intraBC tool is not enabled.
 1254|   137k|  if (!av1_allow_intrabc(cm)) return 0;
  ------------------
  |  Branch (1254:7): [True: 135k, False: 2.14k]
  ------------------
 1255|       |  // Due to the hardware constraints on processing the intraBC tool with row
 1256|       |  // multithreading, a top-right delay of 3 superblocks of size 128x128 or 5
 1257|       |  // superblocks of size 64x64 is mandated. However, a minimum top-right delay
 1258|       |  // of 1 superblock is assured with 'sync_range'. Hence return only the
 1259|       |  // additional superblock delay when the intraBC tool is enabled.
 1260|  2.14k|  return cm->seq_params->sb_size == BLOCK_128X128 ? 2 : 4;
  ------------------
  |  Branch (1260:10): [True: 0, False: 2.14k]
  ------------------
 1261|   137k|}
thread_common.c:get_sync_range:
   34|  38.9k|static inline int get_sync_range(int width) {
   35|       |  // nsync numbers are picked by testing. For example, for 4k
   36|       |  // video, using 4 gives best performance.
   37|  38.9k|  if (width < 640)
  ------------------
  |  Branch (37:7): [True: 38.9k, False: 0]
  ------------------
   38|  38.9k|    return 1;
   39|      0|  else if (width <= 1280)
  ------------------
  |  Branch (39:12): [True: 0, False: 0]
  ------------------
   40|      0|    return 2;
   41|      0|  else if (width <= 4096)
  ------------------
  |  Branch (41:12): [True: 0, False: 0]
  ------------------
   42|      0|    return 4;
   43|      0|  else
   44|      0|    return 8;
   45|  38.9k|}
thread_common.c:sync_write:
  230|   133k|                              const int sb_cols, int plane) {
  231|   133k|#if CONFIG_MULTITHREAD
  232|   133k|  const int nsync = lf_sync->sync_range;
  233|   133k|  int cur;
  234|       |  // Only signal when there are enough filtered SB for next row to run.
  235|   133k|  int sig = 1;
  236|       |
  237|   133k|  if (c < sb_cols - 1) {
  ------------------
  |  Branch (237:7): [True: 22.1k, False: 111k]
  ------------------
  238|  22.1k|    cur = c;
  239|  22.1k|    if (c % nsync) sig = 0;
  ------------------
  |  Branch (239:9): [True: 0, False: 22.1k]
  ------------------
  240|   111k|  } else {
  241|   111k|    cur = sb_cols + nsync;
  242|   111k|  }
  243|       |
  244|   133k|  if (sig) {
  ------------------
  |  Branch (244:7): [True: 133k, False: 18.4E]
  ------------------
  245|   133k|    pthread_mutex_lock(&lf_sync->mutex_[plane][r]);
  246|       |
  247|       |    // When a thread encounters an error, cur_sb_col[plane][r] is set to maximum
  248|       |    // column number. In this case, the AOMMAX operation here ensures that
  249|       |    // cur_sb_col[plane][r] is not overwritten with a smaller value thus
  250|       |    // preventing the infinite waiting of threads in the relevant sync_read()
  251|       |    // function.
  252|   133k|    lf_sync->cur_sb_col[plane][r] = AOMMAX(lf_sync->cur_sb_col[plane][r], cur);
  ------------------
  |  |   35|   133k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 133k]
  |  |  ------------------
  ------------------
  253|       |
  254|   133k|    pthread_cond_broadcast(&lf_sync->cond_[plane][r]);
  255|   133k|    pthread_mutex_unlock(&lf_sync->mutex_[plane][r]);
  256|   133k|  }
  257|       |#else
  258|       |  (void)lf_sync;
  259|       |  (void)r;
  260|       |  (void)c;
  261|       |  (void)sb_cols;
  262|       |  (void)plane;
  263|       |#endif  // CONFIG_MULTITHREAD
  264|   133k|}
thread_common.c:sync_read:
  208|   267k|                             int plane) {
  209|   267k|#if CONFIG_MULTITHREAD
  210|   267k|  const int nsync = lf_sync->sync_range;
  211|       |
  212|   267k|  if (r && !(c & (nsync - 1))) {
  ------------------
  |  Branch (212:7): [True: 162k, False: 104k]
  |  Branch (212:12): [True: 162k, False: 18.4E]
  ------------------
  213|   162k|    pthread_mutex_t *const mutex = &lf_sync->mutex_[plane][r - 1];
  214|   162k|    pthread_mutex_lock(mutex);
  215|       |
  216|   190k|    while (c > lf_sync->cur_sb_col[plane][r - 1] - nsync) {
  ------------------
  |  Branch (216:12): [True: 27.3k, False: 162k]
  ------------------
  217|  27.3k|      pthread_cond_wait(&lf_sync->cond_[plane][r - 1], mutex);
  218|  27.3k|    }
  219|   162k|    pthread_mutex_unlock(mutex);
  220|   162k|  }
  221|       |#else
  222|       |  (void)lf_sync;
  223|       |  (void)r;
  224|       |  (void)c;
  225|       |  (void)plane;
  226|       |#endif  // CONFIG_MULTITHREAD
  227|   267k|}
thread_common.c:loop_filter_rows_mt:
  437|  57.5k|                                AV1LfSync *lf_sync, int lpf_opt_level) {
  438|  57.5k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  439|  57.5k|  int i;
  440|  57.5k|  loop_filter_frame_mt_init(cm, start, stop, planes_to_lf, num_workers, lf_sync,
  441|  57.5k|                            lpf_opt_level, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   43|  57.5k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  57.5k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  57.5k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  442|       |
  443|       |  // Set up loopfilter thread data.
  444|   538k|  for (i = num_workers - 1; i >= 0; --i) {
  ------------------
  |  Branch (444:29): [True: 481k, False: 57.5k]
  ------------------
  445|   481k|    AVxWorker *const worker = &workers[i];
  446|   481k|    LFWorkerData *const lf_data = &lf_sync->lfdata[i];
  447|       |
  448|   481k|    worker->hook = loop_filter_row_worker;
  449|   481k|    worker->data1 = lf_sync;
  450|   481k|    worker->data2 = lf_data;
  451|       |
  452|       |    // Loopfilter data
  453|   481k|    loop_filter_data_reset(lf_data, frame, cm, xd);
  454|       |
  455|       |    // Start loopfiltering
  456|   481k|    worker->had_error = 0;
  457|   481k|    if (i == 0) {
  ------------------
  |  Branch (457:9): [True: 57.5k, False: 423k]
  ------------------
  458|  57.5k|      winterface->execute(worker);
  459|   423k|    } else {
  460|   423k|      winterface->launch(worker);
  461|   423k|    }
  462|   481k|  }
  463|       |
  464|  57.5k|  sync_lf_workers(workers, cm, num_workers);
  465|  57.5k|}
thread_common.c:loop_filter_row_worker:
  395|   478k|static int loop_filter_row_worker(void *arg1, void *arg2) {
  396|   478k|  AV1LfSync *const lf_sync = (AV1LfSync *)arg1;
  397|   478k|  LFWorkerData *const lf_data = (LFWorkerData *)arg2;
  398|   478k|  AV1LfMTInfo *cur_job_info;
  399|       |
  400|   478k|#if CONFIG_MULTITHREAD
  401|   478k|  pthread_mutex_t *job_mutex_ = lf_sync->job_mutex;
  402|   478k|#endif
  403|       |
  404|   478k|  struct aom_internal_error_info *const error_info = &lf_data->error_info;
  405|       |
  406|       |  // The jmp_buf is valid only for the duration of the function that calls
  407|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
  408|       |  // before it returns.
  409|   478k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (409:7): [True: 0, False: 478k]
  ------------------
  410|      0|    error_info->setjmp = 0;
  411|      0|#if CONFIG_MULTITHREAD
  412|      0|    pthread_mutex_lock(job_mutex_);
  413|      0|    lf_sync->lf_mt_exit = true;
  414|      0|    pthread_mutex_unlock(job_mutex_);
  415|      0|#endif
  416|      0|    av1_set_vert_loop_filter_done(lf_data->cm, lf_sync, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   43|      0|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  417|      0|    return 0;
  418|      0|  }
  419|   478k|  error_info->setjmp = 1;
  420|       |
  421|   633k|  while ((cur_job_info = get_lf_job_info(lf_sync)) != NULL) {
  ------------------
  |  Branch (421:10): [True: 154k, False: 478k]
  ------------------
  422|   154k|    const int lpf_opt_level = cur_job_info->lpf_opt_level;
  423|   154k|    av1_thread_loop_filter_rows(
  424|   154k|        lf_data->frame_buffer, lf_data->cm, lf_data->planes, lf_data->xd,
  425|   154k|        cur_job_info->mi_row, cur_job_info->plane, cur_job_info->dir,
  426|   154k|        lpf_opt_level, lf_sync, error_info, lf_data->params_buf,
  427|   154k|        lf_data->tx_buf, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   43|   154k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   154k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   154k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  428|   154k|  }
  429|   478k|  error_info->setjmp = 0;
  430|   478k|  return 1;
  431|   478k|}
thread_common.c:sync_lf_workers:
  372|  57.5k|                                   AV1_COMMON *const cm, int num_workers) {
  373|  57.5k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  374|  57.5k|  int had_error = workers[0].had_error;
  375|  57.5k|  struct aom_internal_error_info error_info;
  376|       |
  377|       |  // Read the error_info of main thread.
  378|  57.5k|  if (had_error) {
  ------------------
  |  Branch (378:7): [True: 0, False: 57.5k]
  ------------------
  379|      0|    AVxWorker *const worker = &workers[0];
  380|      0|    error_info = ((LFWorkerData *)worker->data2)->error_info;
  381|      0|  }
  382|       |
  383|       |  // Wait till all rows are finished.
  384|   481k|  for (int i = num_workers - 1; i > 0; --i) {
  ------------------
  |  Branch (384:33): [True: 423k, False: 57.5k]
  ------------------
  385|   423k|    AVxWorker *const worker = &workers[i];
  386|   423k|    if (!winterface->sync(worker)) {
  ------------------
  |  Branch (386:9): [True: 0, False: 423k]
  ------------------
  387|      0|      had_error = 1;
  388|      0|      error_info = ((LFWorkerData *)worker->data2)->error_info;
  389|      0|    }
  390|   423k|  }
  391|  57.5k|  if (had_error) aom_internal_error_copy(cm->error, &error_info);
  ------------------
  |  Branch (391:7): [True: 0, False: 57.5k]
  ------------------
  392|  57.5k|}
thread_common.c:loop_filter_rows:
  470|   113k|                             int lpf_opt_level) {
  471|       |  // Filter top rows of all planes first, in case the output can be partially
  472|       |  // reconstructed row by row.
  473|   113k|  int mi_row, plane, dir;
  474|       |
  475|   113k|  AV1_DEBLOCKING_PARAMETERS params_buf[MAX_MIB_SIZE];
  476|   113k|  TX_SIZE tx_buf[MAX_MIB_SIZE];
  477|   230k|  for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
  ------------------
  |  |   44|   117k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   43|   117k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   117k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   117k|#define MI_SIZE_LOG2 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (477:24): [True: 117k, False: 113k]
  ------------------
  478|   469k|    for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|   469k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (478:21): [True: 351k, False: 117k]
  ------------------
  479|   351k|      if (skip_loop_filter_plane(planes_to_lf, plane, lpf_opt_level)) {
  ------------------
  |  Branch (479:11): [True: 231k, False: 120k]
  ------------------
  480|   231k|        continue;
  481|   231k|      }
  482|       |
  483|   360k|      for (dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (483:21): [True: 240k, False: 120k]
  ------------------
  484|   240k|        av1_thread_loop_filter_rows(frame, cm, xd->plane, xd, mi_row, plane,
  485|   240k|                                    dir, lpf_opt_level, /*lf_sync=*/NULL,
  486|   240k|                                    xd->error_info, params_buf, tx_buf,
  487|   240k|                                    MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   43|   240k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   240k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   240k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  488|   240k|      }
  489|   120k|    }
  490|   117k|  }
  491|   113k|}
thread_common.c:get_lr_sync_range:
   48|  7.67k|static inline int get_lr_sync_range(int width) {
   49|       |#if 0
   50|       |  // nsync numbers are picked by testing. For example, for 4k
   51|       |  // video, using 4 gives best performance.
   52|       |  if (width < 640)
   53|       |    return 1;
   54|       |  else if (width <= 1280)
   55|       |    return 2;
   56|       |  else if (width <= 4096)
   57|       |    return 4;
   58|       |  else
   59|       |    return 8;
   60|       |#else
   61|  7.67k|  (void)width;
   62|  7.67k|  return 1;
   63|  7.67k|#endif
   64|  7.67k|}
thread_common.c:foreach_rest_unit_in_planes_mt:
  925|    256|                                           int do_extend_border) {
  926|    256|  FilterFrameCtxt *ctxt = lr_ctxt->ctxt;
  927|       |
  928|    256|  const int num_planes = av1_num_planes(cm);
  929|       |
  930|    256|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  931|    256|  int num_rows_lr = 0;
  932|       |
  933|    804|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (933:23): [True: 548, False: 256]
  ------------------
  934|    548|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (934:9): [True: 272, False: 276]
  ------------------
  935|       |
  936|    276|    const int plane_h = ctxt[plane].plane_h;
  937|    276|    const int unit_size = cm->rst_info[plane].restoration_unit_size;
  938|       |
  939|    276|    num_rows_lr = AOMMAX(num_rows_lr, av1_lr_count_units(unit_size, plane_h));
  ------------------
  |  |   35|    276|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2, False: 274]
  |  |  ------------------
  ------------------
  940|    276|  }
  941|       |
  942|    256|  int i;
  943|    256|  static_assert(MAX_MB_PLANE == 3, "");
  944|       |
  945|    256|  if (!lr_sync->sync_range || num_rows_lr > lr_sync->rows ||
  ------------------
  |  Branch (945:7): [True: 161, False: 95]
  |  Branch (945:31): [True: 3, False: 92]
  ------------------
  946|    164|      num_workers > lr_sync->num_workers || num_planes > lr_sync->num_planes) {
  ------------------
  |  Branch (946:7): [True: 0, False: 92]
  |  Branch (946:45): [True: 0, False: 92]
  ------------------
  947|    164|    av1_loop_restoration_dealloc(lr_sync);
  948|    164|    av1_loop_restoration_alloc(lr_sync, cm, num_workers, num_rows_lr,
  949|    164|                               num_planes, cm->width);
  950|    164|  }
  951|    256|  lr_sync->lr_mt_exit = false;
  952|       |
  953|       |  // Initialize cur_sb_col to -1 for all SB rows.
  954|    804|  for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (954:15): [True: 548, False: 256]
  ------------------
  955|    548|    memset(lr_sync->cur_sb_col[i], -1,
  956|    548|           sizeof(*(lr_sync->cur_sb_col[i])) * num_rows_lr);
  957|    548|  }
  958|       |
  959|    256|  enqueue_lr_jobs(lr_sync, lr_ctxt, cm);
  960|       |
  961|       |  // Set up looprestoration thread data.
  962|  8.56k|  for (i = num_workers - 1; i >= 0; --i) {
  ------------------
  |  Branch (962:29): [True: 8.30k, False: 256]
  ------------------
  963|  8.30k|    AVxWorker *const worker = &workers[i];
  964|  8.30k|    lr_sync->lrworkerdata[i].lr_ctxt = (void *)lr_ctxt;
  965|  8.30k|    lr_sync->lrworkerdata[i].do_extend_border = do_extend_border;
  966|  8.30k|    worker->hook = loop_restoration_row_worker;
  967|  8.30k|    worker->data1 = lr_sync;
  968|  8.30k|    worker->data2 = &lr_sync->lrworkerdata[i];
  969|       |
  970|       |    // Start loop restoration
  971|  8.30k|    worker->had_error = 0;
  972|  8.30k|    if (i == 0) {
  ------------------
  |  Branch (972:9): [True: 256, False: 8.05k]
  ------------------
  973|    256|      winterface->execute(worker);
  974|  8.05k|    } else {
  975|  8.05k|      winterface->launch(worker);
  976|  8.05k|    }
  977|  8.30k|  }
  978|       |
  979|    256|  sync_lr_workers(workers, cm, num_workers);
  980|    256|}
thread_common.c:enqueue_lr_jobs:
  702|    256|                            AV1_COMMON *cm) {
  703|    256|  FilterFrameCtxt *ctxt = lr_ctxt->ctxt;
  704|       |
  705|    256|  const int num_planes = av1_num_planes(cm);
  706|    256|  AV1LrMTInfo *lr_job_queue = lr_sync->job_queue;
  707|    256|  int32_t lr_job_counter[2], num_even_lr_jobs = 0;
  708|    256|  lr_sync->jobs_enqueued = 0;
  709|    256|  lr_sync->jobs_dequeued = 0;
  710|       |
  711|    804|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (711:23): [True: 548, False: 256]
  ------------------
  712|    548|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (712:9): [True: 272, False: 276]
  ------------------
  713|    276|    num_even_lr_jobs =
  714|    276|        num_even_lr_jobs + ((ctxt[plane].rsi->vert_units + 1) >> 1);
  715|    276|  }
  716|    256|  lr_job_counter[0] = 0;
  717|    256|  lr_job_counter[1] = num_even_lr_jobs;
  718|       |
  719|    804|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (719:23): [True: 548, False: 256]
  ------------------
  720|    548|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (720:9): [True: 272, False: 276]
  ------------------
  721|    276|    const int is_uv = plane > 0;
  722|    276|    const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (722:22): [True: 60, False: 216]
  |  Branch (722:31): [True: 9, False: 51]
  ------------------
  723|    276|    const int unit_size = ctxt[plane].rsi->restoration_unit_size;
  724|    276|    const int plane_h = ctxt[plane].plane_h;
  725|    276|    const int ext_size = unit_size * 3 / 2;
  726|       |
  727|    276|    int y0 = 0, i = 0;
  728|    578|    while (y0 < plane_h) {
  ------------------
  |  Branch (728:12): [True: 302, False: 276]
  ------------------
  729|    302|      int remaining_h = plane_h - y0;
  730|    302|      int h = (remaining_h < ext_size) ? remaining_h : unit_size;
  ------------------
  |  Branch (730:15): [True: 276, False: 26]
  ------------------
  731|       |
  732|    302|      RestorationTileLimits limits;
  733|    302|      limits.v_start = y0;
  734|    302|      limits.v_end = y0 + h;
  735|    302|      assert(limits.v_end <= plane_h);
  736|       |      // Offset upwards to align with the restoration processing stripe
  737|    302|      const int voffset = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|    302|#define RESTORATION_UNIT_OFFSET 8
  ------------------
  738|    302|      limits.v_start = AOMMAX(0, limits.v_start - voffset);
  ------------------
  |  |   35|    302|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 276, False: 26]
  |  |  ------------------
  ------------------
  739|    302|      if (limits.v_end < plane_h) limits.v_end -= voffset;
  ------------------
  |  Branch (739:11): [True: 26, False: 276]
  ------------------
  740|       |
  741|    302|      assert(lr_job_counter[0] <= num_even_lr_jobs);
  742|       |
  743|    302|      lr_job_queue[lr_job_counter[i & 1]].lr_unit_row = i;
  744|    302|      lr_job_queue[lr_job_counter[i & 1]].plane = plane;
  745|    302|      lr_job_queue[lr_job_counter[i & 1]].v_start = limits.v_start;
  746|    302|      lr_job_queue[lr_job_counter[i & 1]].v_end = limits.v_end;
  747|    302|      lr_job_queue[lr_job_counter[i & 1]].sync_mode = i & 1;
  748|    302|      if ((i & 1) == 0) {
  ------------------
  |  Branch (748:11): [True: 276, False: 26]
  ------------------
  749|    276|        lr_job_queue[lr_job_counter[i & 1]].v_copy_start =
  750|    276|            limits.v_start + RESTORATION_BORDER;
  ------------------
  |  |   62|    276|#define RESTORATION_BORDER 3
  ------------------
  751|    276|        lr_job_queue[lr_job_counter[i & 1]].v_copy_end =
  752|    276|            limits.v_end - RESTORATION_BORDER;
  ------------------
  |  |   62|    276|#define RESTORATION_BORDER 3
  ------------------
  753|    276|        if (i == 0) {
  ------------------
  |  Branch (753:13): [True: 276, False: 0]
  ------------------
  754|    276|          assert(limits.v_start == 0);
  755|    276|          lr_job_queue[lr_job_counter[i & 1]].v_copy_start = 0;
  756|    276|        }
  757|    276|        if (i == (ctxt[plane].rsi->vert_units - 1)) {
  ------------------
  |  Branch (757:13): [True: 250, False: 26]
  ------------------
  758|    250|          assert(limits.v_end == plane_h);
  759|    250|          lr_job_queue[lr_job_counter[i & 1]].v_copy_end = plane_h;
  760|    250|        }
  761|    276|      } else {
  762|     26|        lr_job_queue[lr_job_counter[i & 1]].v_copy_start =
  763|     26|            AOMMAX(limits.v_start - RESTORATION_BORDER, 0);
  ------------------
  |  |   35|     26|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 26, False: 0]
  |  |  ------------------
  ------------------
  764|     26|        lr_job_queue[lr_job_counter[i & 1]].v_copy_end =
  765|     26|            AOMMIN(limits.v_end + RESTORATION_BORDER, plane_h);
  ------------------
  |  |   34|     26|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 26]
  |  |  ------------------
  ------------------
  766|     26|      }
  767|    302|      lr_job_counter[i & 1]++;
  768|    302|      lr_sync->jobs_enqueued++;
  769|       |
  770|    302|      y0 += h;
  771|    302|      ++i;
  772|    302|    }
  773|    276|  }
  774|    256|}
thread_common.c:loop_restoration_row_worker:
  816|  8.26k|static int loop_restoration_row_worker(void *arg1, void *arg2) {
  817|  8.26k|  AV1LrSync *const lr_sync = (AV1LrSync *)arg1;
  818|  8.26k|  LRWorkerData *lrworkerdata = (LRWorkerData *)arg2;
  819|  8.26k|  AV1LrStruct *lr_ctxt = (AV1LrStruct *)lrworkerdata->lr_ctxt;
  820|  8.26k|  FilterFrameCtxt *ctxt = lr_ctxt->ctxt;
  821|  8.26k|  int lr_unit_row;
  822|  8.26k|  int plane;
  823|  8.26k|  int plane_w;
  824|  8.26k|#if CONFIG_MULTITHREAD
  825|  8.26k|  pthread_mutex_t *job_mutex_ = lr_sync->job_mutex;
  826|  8.26k|#endif
  827|  8.26k|  struct aom_internal_error_info *const error_info = &lrworkerdata->error_info;
  828|       |
  829|       |  // The jmp_buf is valid only for the duration of the function that calls
  830|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
  831|       |  // before it returns.
  832|  8.26k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (832:7): [True: 0, False: 8.26k]
  ------------------
  833|      0|    error_info->setjmp = 0;
  834|      0|#if CONFIG_MULTITHREAD
  835|      0|    pthread_mutex_lock(job_mutex_);
  836|      0|    lr_sync->lr_mt_exit = true;
  837|      0|    pthread_mutex_unlock(job_mutex_);
  838|      0|#endif
  839|       |    // In case of loop restoration multithreading, the worker on an even lr
  840|       |    // block row waits for the completion of the filtering of the top-right and
  841|       |    // bottom-right blocks. Hence, in case a thread (main/worker) encounters an
  842|       |    // error, update that filtering of every row in the frame is complete in
  843|       |    // order to avoid the dependent workers from waiting indefinitely.
  844|      0|    set_loop_restoration_done(lr_sync, lr_ctxt->ctxt);
  845|      0|    return 0;
  846|      0|  }
  847|  8.26k|  error_info->setjmp = 1;
  848|       |
  849|  8.26k|  typedef void (*copy_fun)(const YV12_BUFFER_CONFIG *src_ybc,
  850|  8.26k|                           YV12_BUFFER_CONFIG *dst_ybc, int hstart, int hend,
  851|  8.26k|                           int vstart, int vend);
  852|  8.26k|  static const copy_fun copy_funs[MAX_MB_PLANE] = {
  853|  8.26k|    aom_yv12_partial_coloc_copy_y, aom_yv12_partial_coloc_copy_u,
  ------------------
  |  |   55|  8.26k|#define aom_yv12_partial_coloc_copy_y aom_yv12_partial_coloc_copy_y_c
  ------------------
                  aom_yv12_partial_coloc_copy_y, aom_yv12_partial_coloc_copy_u,
  ------------------
  |  |   49|  8.26k|#define aom_yv12_partial_coloc_copy_u aom_yv12_partial_coloc_copy_u_c
  ------------------
  854|  8.26k|    aom_yv12_partial_coloc_copy_v
  ------------------
  |  |   52|  8.26k|#define aom_yv12_partial_coloc_copy_v aom_yv12_partial_coloc_copy_v_c
  ------------------
  855|  8.26k|  };
  856|       |
  857|  8.56k|  while (1) {
  ------------------
  |  Branch (857:10): [True: 8.56k, Folded]
  ------------------
  858|  8.56k|    AV1LrMTInfo *cur_job_info = get_lr_job_info(lr_sync);
  859|  8.56k|    if (cur_job_info != NULL) {
  ------------------
  |  Branch (859:9): [True: 302, False: 8.26k]
  ------------------
  860|    302|      RestorationTileLimits limits;
  861|    302|      sync_read_fn_t on_sync_read;
  862|    302|      sync_write_fn_t on_sync_write;
  863|    302|      limits.v_start = cur_job_info->v_start;
  864|    302|      limits.v_end = cur_job_info->v_end;
  865|    302|      lr_unit_row = cur_job_info->lr_unit_row;
  866|    302|      plane = cur_job_info->plane;
  867|    302|      plane_w = ctxt[plane].plane_w;
  868|       |
  869|       |      // sync_mode == 1 implies only sync read is required in LR Multi-threading
  870|       |      // sync_mode == 0 implies only sync write is required.
  871|    302|      on_sync_read =
  872|    302|          cur_job_info->sync_mode == 1 ? lr_sync_read : av1_lr_sync_read_dummy;
  ------------------
  |  Branch (872:11): [True: 26, False: 276]
  ------------------
  873|    302|      on_sync_write = cur_job_info->sync_mode == 0 ? lr_sync_write
  ------------------
  |  Branch (873:23): [True: 276, False: 26]
  ------------------
  874|    302|                                                   : av1_lr_sync_write_dummy;
  875|       |
  876|    302|      av1_foreach_rest_unit_in_row(
  877|    302|          &limits, plane_w, lr_ctxt->on_rest_unit, lr_unit_row,
  878|    302|          ctxt[plane].rsi->restoration_unit_size, ctxt[plane].rsi->horz_units,
  879|    302|          ctxt[plane].rsi->vert_units, plane, &ctxt[plane],
  880|    302|          lrworkerdata->rst_tmpbuf, lrworkerdata->rlbs, on_sync_read,
  881|    302|          on_sync_write, lr_sync, error_info);
  882|       |
  883|    302|      copy_funs[plane](lr_ctxt->dst, lr_ctxt->frame, 0, plane_w,
  884|    302|                       cur_job_info->v_copy_start, cur_job_info->v_copy_end);
  885|       |
  886|    302|      if (lrworkerdata->do_extend_border) {
  ------------------
  |  Branch (886:11): [True: 0, False: 302]
  ------------------
  887|      0|        aom_extend_frame_borders_plane_row(lr_ctxt->frame, plane,
  ------------------
  |  |   34|      0|#define aom_extend_frame_borders_plane_row aom_extend_frame_borders_plane_row_c
  ------------------
  888|      0|                                           cur_job_info->v_copy_start,
  889|      0|                                           cur_job_info->v_copy_end);
  890|      0|      }
  891|  8.26k|    } else {
  892|  8.26k|      break;
  893|  8.26k|    }
  894|  8.56k|  }
  895|  8.26k|  error_info->setjmp = 0;
  896|  8.26k|  return 1;
  897|  8.26k|}
thread_common.c:get_lr_job_info:
  776|  8.55k|static AV1LrMTInfo *get_lr_job_info(AV1LrSync *lr_sync) {
  777|  8.55k|  AV1LrMTInfo *cur_job_info = NULL;
  778|       |
  779|  8.55k|#if CONFIG_MULTITHREAD
  780|  8.55k|  pthread_mutex_lock(lr_sync->job_mutex);
  781|       |
  782|  8.60k|  if (!lr_sync->lr_mt_exit && lr_sync->jobs_dequeued < lr_sync->jobs_enqueued) {
  ------------------
  |  Branch (782:7): [True: 8.60k, False: 18.4E]
  |  Branch (782:31): [True: 302, False: 8.30k]
  ------------------
  783|    302|    cur_job_info = lr_sync->job_queue + lr_sync->jobs_dequeued;
  784|    302|    lr_sync->jobs_dequeued++;
  785|    302|  }
  786|       |
  787|  8.55k|  pthread_mutex_unlock(lr_sync->job_mutex);
  788|       |#else
  789|       |  (void)lr_sync;
  790|       |#endif
  791|       |
  792|  8.55k|  return cur_job_info;
  793|  8.55k|}
thread_common.c:lr_sync_read:
  527|     32|static inline void lr_sync_read(void *const lr_sync, int r, int c, int plane) {
  528|     32|#if CONFIG_MULTITHREAD
  529|     32|  AV1LrSync *const loop_res_sync = (AV1LrSync *)lr_sync;
  530|     32|  const int nsync = loop_res_sync->sync_range;
  531|       |
  532|     32|  if (r && !(c & (nsync - 1))) {
  ------------------
  |  Branch (532:7): [True: 32, False: 0]
  |  Branch (532:12): [True: 32, False: 0]
  ------------------
  533|     32|    pthread_mutex_t *const mutex = &loop_res_sync->mutex_[plane][r - 1];
  534|     32|    pthread_mutex_lock(mutex);
  535|       |
  536|     52|    while (c > loop_res_sync->cur_sb_col[plane][r - 1] - nsync) {
  ------------------
  |  Branch (536:12): [True: 20, False: 32]
  ------------------
  537|     20|      pthread_cond_wait(&loop_res_sync->cond_[plane][r - 1], mutex);
  538|     20|    }
  539|     32|    pthread_mutex_unlock(mutex);
  540|     32|  }
  541|       |#else
  542|       |  (void)lr_sync;
  543|       |  (void)r;
  544|       |  (void)c;
  545|       |  (void)plane;
  546|       |#endif  // CONFIG_MULTITHREAD
  547|     32|}
thread_common.c:lr_sync_write:
  550|    288|                                 const int sb_cols, int plane) {
  551|    288|#if CONFIG_MULTITHREAD
  552|    288|  AV1LrSync *const loop_res_sync = (AV1LrSync *)lr_sync;
  553|    288|  const int nsync = loop_res_sync->sync_range;
  554|    288|  int cur;
  555|       |  // Only signal when there are enough filtered SB for next row to run.
  556|    288|  int sig = 1;
  557|       |
  558|    288|  if (c < sb_cols - 1) {
  ------------------
  |  Branch (558:7): [True: 12, False: 276]
  ------------------
  559|     12|    cur = c;
  560|     12|    if (c % nsync) sig = 0;
  ------------------
  |  Branch (560:9): [True: 0, False: 12]
  ------------------
  561|    276|  } else {
  562|    276|    cur = sb_cols + nsync;
  563|    276|  }
  564|       |
  565|    288|  if (sig) {
  ------------------
  |  Branch (565:7): [True: 288, False: 0]
  ------------------
  566|    288|    pthread_mutex_lock(&loop_res_sync->mutex_[plane][r]);
  567|       |
  568|       |    // When a thread encounters an error, cur_sb_col[plane][r] is set to maximum
  569|       |    // column number. In this case, the AOMMAX operation here ensures that
  570|       |    // cur_sb_col[plane][r] is not overwritten with a smaller value thus
  571|       |    // preventing the infinite waiting of threads in the relevant sync_read()
  572|       |    // function.
  573|    288|    loop_res_sync->cur_sb_col[plane][r] =
  574|    288|        AOMMAX(loop_res_sync->cur_sb_col[plane][r], cur);
  ------------------
  |  |   35|    288|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 288]
  |  |  ------------------
  ------------------
  575|       |
  576|    288|    pthread_cond_broadcast(&loop_res_sync->cond_[plane][r]);
  577|    288|    pthread_mutex_unlock(&loop_res_sync->mutex_[plane][r]);
  578|    288|  }
  579|       |#else
  580|       |  (void)lr_sync;
  581|       |  (void)r;
  582|       |  (void)c;
  583|       |  (void)sb_cols;
  584|       |  (void)plane;
  585|       |#endif  // CONFIG_MULTITHREAD
  586|    288|}
thread_common.c:sync_lr_workers:
  900|    256|                                   AV1_COMMON *const cm, int num_workers) {
  901|    256|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  902|    256|  int had_error = workers[0].had_error;
  903|    256|  struct aom_internal_error_info error_info;
  904|       |
  905|       |  // Read the error_info of main thread.
  906|    256|  if (had_error) {
  ------------------
  |  Branch (906:7): [True: 0, False: 256]
  ------------------
  907|      0|    AVxWorker *const worker = &workers[0];
  908|      0|    error_info = ((LRWorkerData *)worker->data2)->error_info;
  909|      0|  }
  910|       |
  911|       |  // Wait till all rows are finished.
  912|  8.30k|  for (int i = num_workers - 1; i > 0; --i) {
  ------------------
  |  Branch (912:33): [True: 8.05k, False: 256]
  ------------------
  913|  8.05k|    AVxWorker *const worker = &workers[i];
  914|  8.05k|    if (!winterface->sync(worker)) {
  ------------------
  |  Branch (914:9): [True: 0, False: 8.05k]
  ------------------
  915|      0|      had_error = 1;
  916|      0|      error_info = ((LRWorkerData *)worker->data2)->error_info;
  917|      0|    }
  918|  8.05k|  }
  919|    256|  if (had_error) aom_internal_error_copy(cm->error, &error_info);
  ------------------
  |  Branch (919:7): [True: 0, False: 256]
  ------------------
  920|    256|}
thread_common.c:cdef_row_mt_sync_write:
  194|  57.5k|                                          int row) {
  195|  57.5k|#if CONFIG_MULTITHREAD
  196|  57.5k|  AV1CdefRowSync *const cdef_row_mt = cdef_sync->cdef_row_mt;
  197|  57.5k|  pthread_mutex_lock(cdef_row_mt[row].row_mutex_);
  198|  57.5k|  pthread_cond_signal(cdef_row_mt[row].row_cond_);
  199|  57.5k|  cdef_row_mt[row].is_row_done = 1;
  200|  57.5k|  pthread_mutex_unlock(cdef_row_mt[row].row_mutex_);
  201|       |#else
  202|       |  (void)cdef_sync;
  203|       |  (void)row;
  204|       |#endif  // CONFIG_MULTITHREAD
  205|  57.5k|}
thread_common.c:cdef_row_mt_sync_read:
  178|  57.7k|                                         int row) {
  179|  57.7k|  if (!row) return;
  ------------------
  |  Branch (179:7): [True: 35.9k, False: 21.7k]
  ------------------
  180|  21.7k|#if CONFIG_MULTITHREAD
  181|  21.7k|  AV1CdefRowSync *const cdef_row_mt = cdef_sync->cdef_row_mt;
  182|  21.7k|  pthread_mutex_lock(cdef_row_mt[row - 1].row_mutex_);
  183|  22.3k|  while (cdef_row_mt[row - 1].is_row_done != 1)
  ------------------
  |  Branch (183:10): [True: 508, False: 21.7k]
  ------------------
  184|    508|    pthread_cond_wait(cdef_row_mt[row - 1].row_cond_,
  185|    508|                      cdef_row_mt[row - 1].row_mutex_);
  186|  21.7k|  cdef_row_mt[row - 1].is_row_done = 0;
  187|  21.7k|  pthread_mutex_unlock(cdef_row_mt[row - 1].row_mutex_);
  188|       |#else
  189|       |  (void)cdef_sync;
  190|       |#endif  // CONFIG_MULTITHREAD
  191|  21.7k|}
thread_common.c:reset_cdef_job_info:
 1002|  35.9k|static inline void reset_cdef_job_info(AV1CdefSync *const cdef_sync) {
 1003|  35.9k|  cdef_sync->end_of_frame = 0;
 1004|  35.9k|  cdef_sync->fbr = 0;
 1005|  35.9k|  cdef_sync->fbc = 0;
 1006|       |  cdef_sync->cdef_mt_exit = false;
 1007|  35.9k|}
thread_common.c:prepare_cdef_frame_workers:
 1141|  35.9k|    int do_extend_border) {
 1142|  35.9k|  const int num_planes = av1_num_planes(cm);
 1143|       |
 1144|  35.9k|  cdef_worker[0].srcbuf = cm->cdef_info.srcbuf;
 1145|   100k|  for (int plane = 0; plane < num_planes; plane++)
  ------------------
  |  Branch (1145:23): [True: 64.8k, False: 35.9k]
  ------------------
 1146|  64.8k|    cdef_worker[0].colbuf[plane] = cm->cdef_info.colbuf[plane];
 1147|   716k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1147:33): [True: 680k, False: 35.9k]
  ------------------
 1148|   680k|    AVxWorker *const worker = &workers[i];
 1149|   680k|    cdef_worker[i].cm = cm;
 1150|   680k|    cdef_worker[i].xd = xd;
 1151|   680k|    cdef_worker[i].cdef_init_fb_row_fn = cdef_init_fb_row_fn;
 1152|   680k|    cdef_worker[i].do_extend_border = do_extend_border;
 1153|  1.90M|    for (int plane = 0; plane < num_planes; plane++)
  ------------------
  |  Branch (1153:25): [True: 1.22M, False: 680k]
  ------------------
 1154|  1.22M|      cdef_worker[i].linebuf[plane] = cm->cdef_info.linebuf[plane];
 1155|       |
 1156|   680k|    worker->hook = hook;
 1157|   680k|    worker->data1 = cdef_sync;
 1158|   680k|    worker->data2 = &cdef_worker[i];
 1159|   680k|  }
 1160|  35.9k|}
thread_common.c:cdef_sb_row_worker_hook:
 1081|   675k|static int cdef_sb_row_worker_hook(void *arg1, void *arg2) {
 1082|   675k|  AV1CdefSync *const cdef_sync = (AV1CdefSync *)arg1;
 1083|   675k|  AV1CdefWorkerData *const cdef_worker = (AV1CdefWorkerData *)arg2;
 1084|   675k|  AV1_COMMON *cm = cdef_worker->cm;
 1085|   675k|  const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   675k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   675k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|   675k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   675k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1086|       |
 1087|   675k|#if CONFIG_MULTITHREAD
 1088|   675k|  pthread_mutex_t *job_mutex_ = cdef_sync->mutex_;
 1089|   675k|#endif
 1090|   675k|  struct aom_internal_error_info *const error_info = &cdef_worker->error_info;
 1091|       |
 1092|       |  // The jmp_buf is valid only for the duration of the function that calls
 1093|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 1094|       |  // before it returns.
 1095|   675k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (1095:7): [True: 0, False: 675k]
  ------------------
 1096|      0|    error_info->setjmp = 0;
 1097|      0|#if CONFIG_MULTITHREAD
 1098|      0|    pthread_mutex_lock(job_mutex_);
 1099|      0|    cdef_sync->cdef_mt_exit = true;
 1100|      0|    pthread_mutex_unlock(job_mutex_);
 1101|      0|#endif
 1102|       |    // In case of cdef row-multithreading, the worker on a filter block row
 1103|       |    // (fbr) waits for the line buffers (top and bottom) copy of the above row.
 1104|       |    // Hence, in case a thread (main/worker) encounters an error before copying
 1105|       |    // of the line buffers, update that line buffer copy is complete in order to
 1106|       |    // avoid dependent workers waiting indefinitely.
 1107|      0|    set_cdef_init_fb_row_done(cdef_sync, nvfb);
 1108|      0|    return 0;
 1109|      0|  }
 1110|   675k|  error_info->setjmp = 1;
 1111|       |
 1112|   675k|  volatile int cur_fbr;
 1113|   675k|  const int num_planes = av1_num_planes(cm);
 1114|   733k|  while (get_cdef_row_next_job(cdef_sync, &cur_fbr, nvfb)) {
  ------------------
  |  Branch (1114:10): [True: 57.7k, False: 675k]
  ------------------
 1115|  57.7k|    MACROBLOCKD *xd = cdef_worker->xd;
 1116|  57.7k|    av1_cdef_fb_row(cm, xd, cdef_worker->linebuf, cdef_worker->colbuf,
 1117|  57.7k|                    cdef_worker->srcbuf, cur_fbr,
 1118|  57.7k|                    cdef_worker->cdef_init_fb_row_fn, cdef_sync, error_info);
 1119|  57.7k|    if (cdef_worker->do_extend_border) {
  ------------------
  |  Branch (1119:9): [True: 32.0k, False: 25.6k]
  ------------------
 1120|  89.6k|      for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1120:27): [True: 57.6k, False: 32.0k]
  ------------------
 1121|  57.6k|        const YV12_BUFFER_CONFIG *ybf = &cm->cur_frame->buf;
 1122|  57.6k|        const int is_uv = plane > 0;
 1123|  57.6k|        const int mi_high = MI_SIZE_LOG2 - xd->plane[plane].subsampling_y;
  ------------------
  |  |   39|  57.6k|#define MI_SIZE_LOG2 2
  ------------------
 1124|  57.6k|        const int unit_height = MI_SIZE_64X64 << mi_high;
  ------------------
  |  |   58|  57.6k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  57.6k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1125|  57.6k|        const int v_start = cur_fbr * unit_height;
 1126|  57.6k|        const int v_end =
 1127|  57.6k|            AOMMIN(v_start + unit_height, ybf->crop_heights[is_uv]);
  ------------------
  |  |   34|  57.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 27.4k, False: 30.1k]
  |  |  ------------------
  ------------------
 1128|  57.6k|        aom_extend_frame_borders_plane_row(ybf, plane, v_start, v_end);
  ------------------
  |  |   34|  57.6k|#define aom_extend_frame_borders_plane_row aom_extend_frame_borders_plane_row_c
  ------------------
 1129|  57.6k|      }
 1130|  32.0k|    }
 1131|  57.7k|  }
 1132|   675k|  error_info->setjmp = 0;
 1133|   675k|  return 1;
 1134|   675k|}
thread_common.c:get_cdef_row_next_job:
 1058|   733k|                                        volatile int *cur_fbr, const int nvfb) {
 1059|   733k|#if CONFIG_MULTITHREAD
 1060|   733k|  pthread_mutex_lock(cdef_sync->mutex_);
 1061|   733k|#endif  // CONFIG_MULTITHREAD
 1062|   733k|  int do_next_row = 0;
 1063|       |  // Populates information needed for current job and update the row
 1064|       |  // index of the next row to be processed.
 1065|   738k|  if (!cdef_sync->cdef_mt_exit && cdef_sync->end_of_frame == 0) {
  ------------------
  |  Branch (1065:7): [True: 738k, False: 18.4E]
  |  Branch (1065:35): [True: 57.7k, False: 680k]
  ------------------
 1066|  57.7k|    do_next_row = 1;
 1067|  57.7k|    *cur_fbr = cdef_sync->fbr;
 1068|  57.7k|    update_cdef_row_next_job_info(cdef_sync, nvfb);
 1069|  57.7k|  }
 1070|   733k|#if CONFIG_MULTITHREAD
 1071|   733k|  pthread_mutex_unlock(cdef_sync->mutex_);
 1072|   733k|#endif  // CONFIG_MULTITHREAD
 1073|   733k|  return do_next_row;
 1074|   733k|}
thread_common.c:update_cdef_row_next_job_info:
 1048|  57.7k|                                          const int nvfb) {
 1049|  57.7k|  cdef_sync->fbr++;
 1050|  57.7k|  if (cdef_sync->fbr == nvfb) {
  ------------------
  |  Branch (1050:7): [True: 35.9k, False: 21.8k]
  ------------------
 1051|  35.9k|    cdef_sync->end_of_frame = 1;
 1052|  35.9k|  }
 1053|  57.7k|}
thread_common.c:launch_cdef_workers:
 1010|  35.9k|                                       int num_workers) {
 1011|  35.9k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 1012|   716k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1012:33): [True: 680k, False: 35.9k]
  ------------------
 1013|   680k|    AVxWorker *const worker = &workers[i];
 1014|   680k|    worker->had_error = 0;
 1015|   680k|    if (i == 0)
  ------------------
  |  Branch (1015:9): [True: 35.9k, False: 644k]
  ------------------
 1016|  35.9k|      winterface->execute(worker);
 1017|   644k|    else
 1018|   644k|      winterface->launch(worker);
 1019|   680k|  }
 1020|  35.9k|}
thread_common.c:sync_cdef_workers:
 1023|  35.9k|                                     AV1_COMMON *const cm, int num_workers) {
 1024|  35.9k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 1025|  35.9k|  int had_error = workers[0].had_error;
 1026|  35.9k|  struct aom_internal_error_info error_info;
 1027|       |
 1028|       |  // Read the error_info of main thread.
 1029|  35.9k|  if (had_error) {
  ------------------
  |  Branch (1029:7): [True: 0, False: 35.9k]
  ------------------
 1030|      0|    AVxWorker *const worker = &workers[0];
 1031|      0|    error_info = ((AV1CdefWorkerData *)worker->data2)->error_info;
 1032|      0|  }
 1033|       |
 1034|       |  // Wait till all rows are finished.
 1035|   680k|  for (int i = num_workers - 1; i > 0; --i) {
  ------------------
  |  Branch (1035:33): [True: 644k, False: 35.9k]
  ------------------
 1036|   644k|    AVxWorker *const worker = &workers[i];
 1037|   644k|    if (!winterface->sync(worker)) {
  ------------------
  |  Branch (1037:9): [True: 0, False: 644k]
  ------------------
 1038|      0|      had_error = 1;
 1039|      0|      error_info = ((AV1CdefWorkerData *)worker->data2)->error_info;
 1040|      0|    }
 1041|   644k|  }
 1042|  35.9k|  if (had_error) aom_internal_error_copy(cm->error, &error_info);
  ------------------
  |  Branch (1042:7): [True: 0, False: 35.9k]
  ------------------
 1043|  35.9k|}

ethread.c:set_planes_to_loop_filter:
  326|  17.8k|                                             int plane_start, int plane_end) {
  327|       |  // For each luma and chroma plane, whether to filter it or not.
  328|  17.8k|  planes_to_lf[0] = (lf->filter_level[0] || lf->filter_level[1]) &&
  ------------------
  |  Branch (328:22): [True: 17.8k, False: 0]
  |  Branch (328:45): [True: 0, False: 0]
  ------------------
  329|  17.8k|                    plane_start <= 0 && 0 < plane_end;
  ------------------
  |  Branch (329:21): [True: 17.8k, False: 0]
  |  Branch (329:41): [True: 17.8k, False: 0]
  ------------------
  330|  17.8k|  planes_to_lf[1] = lf->filter_level_u && plane_start <= 1 && 1 < plane_end;
  ------------------
  |  Branch (330:21): [True: 17.8k, False: 0]
  |  Branch (330:43): [True: 17.8k, False: 0]
  |  Branch (330:63): [True: 6.15k, False: 11.6k]
  ------------------
  331|  17.8k|  planes_to_lf[2] = lf->filter_level_v && plane_start <= 2 && 2 < plane_end;
  ------------------
  |  Branch (331:21): [True: 17.8k, False: 0]
  |  Branch (331:43): [True: 17.8k, False: 0]
  |  Branch (331:63): [True: 6.15k, False: 11.6k]
  ------------------
  332|  17.8k|}
ethread.c:loop_filter_frame_mt_init:
  268|  17.8k|    int lpf_opt_level, int num_mis_in_lpf_unit_height_log2) {
  269|       |  // Number of superblock rows
  270|  17.8k|  const int sb_rows =
  271|  17.8k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, num_mis_in_lpf_unit_height_log2);
  ------------------
  |  |   62|  17.8k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  272|       |
  273|  17.8k|  if (!lf_sync->sync_range || sb_rows != lf_sync->rows ||
  ------------------
  |  Branch (273:7): [True: 0, False: 17.8k]
  |  Branch (273:31): [True: 6.28k, False: 11.5k]
  ------------------
  274|  11.5k|      num_workers > lf_sync->num_workers) {
  ------------------
  |  Branch (274:7): [True: 0, False: 11.5k]
  ------------------
  275|  6.28k|    av1_loop_filter_dealloc(lf_sync);
  276|  6.28k|    av1_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_workers);
  277|  6.28k|  }
  278|  17.8k|  lf_sync->lf_mt_exit = false;
  279|       |
  280|       |  // Initialize cur_sb_col to -1 for all SB rows.
  281|  71.2k|  for (int i = 0; i < MAX_MB_PLANE; i++) {
  ------------------
  |  |   36|  71.2k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (281:19): [True: 53.4k, False: 17.8k]
  ------------------
  282|  53.4k|    memset(lf_sync->cur_sb_col[i], -1,
  283|  53.4k|           sizeof(*(lf_sync->cur_sb_col[i])) * sb_rows);
  284|  53.4k|  }
  285|       |
  286|  17.8k|  enqueue_lf_jobs(lf_sync, start_mi_row, end_mi_row, planes_to_lf,
  287|  17.8k|                  lpf_opt_level, (1 << num_mis_in_lpf_unit_height_log2));
  288|  17.8k|}
ethread.c:enqueue_lf_jobs:
  238|  17.8k|                                   int num_mis_in_lpf_unit_height) {
  239|  17.8k|  int mi_row, plane, dir;
  240|  17.8k|  AV1LfMTInfo *lf_job_queue = lf_sync->job_queue;
  241|  17.8k|  lf_sync->jobs_enqueued = 0;
  242|  17.8k|  lf_sync->jobs_dequeued = 0;
  243|       |
  244|       |  // Launch all vertical jobs first, as they are blocking the horizontal ones.
  245|       |  // Launch top row jobs for all planes first, in case the output can be
  246|       |  // partially reconstructed row by row.
  247|  53.4k|  for (dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (247:17): [True: 35.6k, False: 17.8k]
  ------------------
  248|  86.8k|    for (mi_row = start; mi_row < stop; mi_row += num_mis_in_lpf_unit_height) {
  ------------------
  |  Branch (248:26): [True: 51.2k, False: 35.6k]
  ------------------
  249|   204k|      for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|   204k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (249:23): [True: 153k, False: 51.2k]
  ------------------
  250|   153k|        if (skip_loop_filter_plane(planes_to_lf, plane, lpf_opt_level)) {
  ------------------
  |  Branch (250:13): [True: 84.6k, False: 69.0k]
  ------------------
  251|  84.6k|          continue;
  252|  84.6k|        }
  253|  69.0k|        if (!planes_to_lf[plane]) continue;
  ------------------
  |  Branch (253:13): [True: 0, False: 69.0k]
  ------------------
  254|  69.0k|        lf_job_queue->mi_row = mi_row;
  255|  69.0k|        lf_job_queue->plane = plane;
  256|  69.0k|        lf_job_queue->dir = dir;
  257|  69.0k|        lf_job_queue->lpf_opt_level = lpf_opt_level;
  258|  69.0k|        lf_job_queue++;
  259|  69.0k|        lf_sync->jobs_enqueued++;
  260|  69.0k|      }
  261|  51.2k|    }
  262|  35.6k|  }
  263|  17.8k|}
ethread.c:skip_loop_filter_plane:
  213|   153k|    const int planes_to_lf[MAX_MB_PLANE], int plane, int lpf_opt_level) {
  214|       |  // If LPF_PICK_METHOD is LPF_PICK_FROM_Q, we have the option to filter both
  215|       |  // chroma planes together
  216|   153k|  if (lpf_opt_level == 2) {
  ------------------
  |  Branch (216:7): [True: 153k, False: 0]
  ------------------
  217|   153k|    if (plane == AOM_PLANE_Y) {
  ------------------
  |  |  281|   153k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (217:9): [True: 51.2k, False: 102k]
  ------------------
  218|  51.2k|      return !planes_to_lf[plane];
  219|  51.2k|    }
  220|   102k|    if (plane == AOM_PLANE_U) {
  ------------------
  |  |  282|   102k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (220:9): [True: 51.2k, False: 51.2k]
  ------------------
  221|       |      // U and V are handled together
  222|  51.2k|      return !planes_to_lf[1] && !planes_to_lf[2];
  ------------------
  |  Branch (222:14): [True: 33.4k, False: 17.7k]
  |  Branch (222:34): [True: 33.4k, False: 0]
  ------------------
  223|  51.2k|    }
  224|   102k|    assert(plane == AOM_PLANE_V);
  225|  51.2k|    if (plane == AOM_PLANE_V) {
  ------------------
  |  |  283|  51.2k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
  |  Branch (225:9): [True: 51.2k, False: 0]
  ------------------
  226|       |      // V is handled when u is filtered
  227|  51.2k|      return true;
  228|  51.2k|    }
  229|  51.2k|  }
  230|       |
  231|       |  // Normal operation mode
  232|      0|  return !planes_to_lf[plane];
  233|   153k|}
ethread.c:loop_filter_data_reset:
  312|  32.0k|                                          MACROBLOCKD *xd) {
  313|  32.0k|  struct macroblockd_plane *pd = xd->plane;
  314|  32.0k|  lf_data->frame_buffer = frame_buffer;
  315|  32.0k|  lf_data->cm = cm;
  316|  32.0k|  lf_data->xd = xd;
  317|   128k|  for (int i = 0; i < MAX_MB_PLANE; i++) {
  ------------------
  |  |   36|   128k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (317:19): [True: 96.2k, False: 32.0k]
  ------------------
  318|  96.2k|    lf_data->planes[i].dst = pd[i].dst;
  319|  96.2k|    lf_data->planes[i].subsampling_x = pd[i].subsampling_x;
  320|  96.2k|    lf_data->planes[i].subsampling_y = pd[i].subsampling_y;
  321|  96.2k|  }
  322|  32.0k|}
ethread.c:get_lf_job_info:
  290|   101k|static inline AV1LfMTInfo *get_lf_job_info(AV1LfSync *lf_sync) {
  291|   101k|  AV1LfMTInfo *cur_job_info = NULL;
  292|       |
  293|   101k|#if CONFIG_MULTITHREAD
  294|   101k|  pthread_mutex_lock(lf_sync->job_mutex);
  295|       |
  296|   101k|  if (!lf_sync->lf_mt_exit && lf_sync->jobs_dequeued < lf_sync->jobs_enqueued) {
  ------------------
  |  Branch (296:7): [True: 101k, False: 18.4E]
  |  Branch (296:31): [True: 69.0k, False: 32.0k]
  ------------------
  297|  69.0k|    cur_job_info = lf_sync->job_queue + lf_sync->jobs_dequeued;
  298|  69.0k|    lf_sync->jobs_dequeued++;
  299|  69.0k|  }
  300|       |
  301|   101k|  pthread_mutex_unlock(lf_sync->job_mutex);
  302|       |#else
  303|       |  (void)lf_sync;
  304|       |#endif
  305|       |
  306|   101k|  return cur_job_info;
  307|   101k|}
thread_common.c:check_planes_to_loop_filter:
  336|   253k|                                              int plane_start, int plane_end) {
  337|   253k|  set_planes_to_loop_filter(lf, planes_to_lf, plane_start, plane_end);
  338|       |  // If the luma plane is purposely not filtered, neither are the chroma
  339|       |  // planes.
  340|   253k|  if (!planes_to_lf[0] && plane_start <= 0 && 0 < plane_end) return 0;
  ------------------
  |  Branch (340:7): [True: 150k, False: 103k]
  |  Branch (340:27): [True: 46.4k, False: 104k]
  |  Branch (340:47): [True: 46.4k, False: 0]
  ------------------
  341|       |  // Early exit.
  342|   207k|  if (!planes_to_lf[0] && !planes_to_lf[1] && !planes_to_lf[2]) return 0;
  ------------------
  |  Branch (342:7): [True: 104k, False: 103k]
  |  Branch (342:27): [True: 70.3k, False: 34.0k]
  |  Branch (342:47): [True: 36.4k, False: 33.8k]
  ------------------
  343|   171k|  return 1;
  344|   207k|}
thread_common.c:set_planes_to_loop_filter:
  326|   253k|                                             int plane_start, int plane_end) {
  327|       |  // For each luma and chroma plane, whether to filter it or not.
  328|   253k|  planes_to_lf[0] = (lf->filter_level[0] || lf->filter_level[1]) &&
  ------------------
  |  Branch (328:22): [True: 117k, False: 136k]
  |  Branch (328:45): [True: 0, False: 136k]
  ------------------
  329|   117k|                    plane_start <= 0 && 0 < plane_end;
  ------------------
  |  Branch (329:21): [True: 103k, False: 14.4k]
  |  Branch (329:41): [True: 103k, False: 0]
  ------------------
  330|   253k|  planes_to_lf[1] = lf->filter_level_u && plane_start <= 1 && 1 < plane_end;
  ------------------
  |  Branch (330:21): [True: 55.2k, False: 198k]
  |  Branch (330:43): [True: 47.4k, False: 7.80k]
  |  Branch (330:63): [True: 39.8k, False: 7.56k]
  ------------------
  331|   253k|  planes_to_lf[2] = lf->filter_level_v && plane_start <= 2 && 2 < plane_end;
  ------------------
  |  Branch (331:21): [True: 51.7k, False: 202k]
  |  Branch (331:43): [True: 51.7k, False: 0]
  |  Branch (331:63): [True: 39.7k, False: 12.0k]
  ------------------
  332|   253k|}
thread_common.c:loop_filter_frame_mt_init:
  268|  57.5k|    int lpf_opt_level, int num_mis_in_lpf_unit_height_log2) {
  269|       |  // Number of superblock rows
  270|  57.5k|  const int sb_rows =
  271|  57.5k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, num_mis_in_lpf_unit_height_log2);
  ------------------
  |  |   62|  57.5k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  272|       |
  273|  57.5k|  if (!lf_sync->sync_range || sb_rows != lf_sync->rows ||
  ------------------
  |  Branch (273:7): [True: 3.32k, False: 54.2k]
  |  Branch (273:31): [True: 2.56k, False: 51.6k]
  ------------------
  274|  51.6k|      num_workers > lf_sync->num_workers) {
  ------------------
  |  Branch (274:7): [True: 0, False: 51.6k]
  ------------------
  275|  5.89k|    av1_loop_filter_dealloc(lf_sync);
  276|  5.89k|    av1_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_workers);
  277|  5.89k|  }
  278|  57.5k|  lf_sync->lf_mt_exit = false;
  279|       |
  280|       |  // Initialize cur_sb_col to -1 for all SB rows.
  281|   230k|  for (int i = 0; i < MAX_MB_PLANE; i++) {
  ------------------
  |  |   36|   230k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (281:19): [True: 172k, False: 57.5k]
  ------------------
  282|   172k|    memset(lf_sync->cur_sb_col[i], -1,
  283|   172k|           sizeof(*(lf_sync->cur_sb_col[i])) * sb_rows);
  284|   172k|  }
  285|       |
  286|  57.5k|  enqueue_lf_jobs(lf_sync, start_mi_row, end_mi_row, planes_to_lf,
  287|  57.5k|                  lpf_opt_level, (1 << num_mis_in_lpf_unit_height_log2));
  288|  57.5k|}
thread_common.c:enqueue_lf_jobs:
  238|  57.5k|                                   int num_mis_in_lpf_unit_height) {
  239|  57.5k|  int mi_row, plane, dir;
  240|  57.5k|  AV1LfMTInfo *lf_job_queue = lf_sync->job_queue;
  241|  57.5k|  lf_sync->jobs_enqueued = 0;
  242|  57.5k|  lf_sync->jobs_dequeued = 0;
  243|       |
  244|       |  // Launch all vertical jobs first, as they are blocking the horizontal ones.
  245|       |  // Launch top row jobs for all planes first, in case the output can be
  246|       |  // partially reconstructed row by row.
  247|   172k|  for (dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (247:17): [True: 115k, False: 57.5k]
  ------------------
  248|   253k|    for (mi_row = start; mi_row < stop; mi_row += num_mis_in_lpf_unit_height) {
  ------------------
  |  Branch (248:26): [True: 138k, False: 115k]
  ------------------
  249|   553k|      for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|   553k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (249:23): [True: 414k, False: 138k]
  ------------------
  250|   414k|        if (skip_loop_filter_plane(planes_to_lf, plane, lpf_opt_level)) {
  ------------------
  |  Branch (250:13): [True: 260k, False: 154k]
  ------------------
  251|   260k|          continue;
  252|   260k|        }
  253|   154k|        if (!planes_to_lf[plane]) continue;
  ------------------
  |  Branch (253:13): [True: 0, False: 154k]
  ------------------
  254|   154k|        lf_job_queue->mi_row = mi_row;
  255|   154k|        lf_job_queue->plane = plane;
  256|   154k|        lf_job_queue->dir = dir;
  257|   154k|        lf_job_queue->lpf_opt_level = lpf_opt_level;
  258|   154k|        lf_job_queue++;
  259|   154k|        lf_sync->jobs_enqueued++;
  260|   154k|      }
  261|   138k|    }
  262|   115k|  }
  263|  57.5k|}
thread_common.c:skip_loop_filter_plane:
  213|   766k|    const int planes_to_lf[MAX_MB_PLANE], int plane, int lpf_opt_level) {
  214|       |  // If LPF_PICK_METHOD is LPF_PICK_FROM_Q, we have the option to filter both
  215|       |  // chroma planes together
  216|   766k|  if (lpf_opt_level == 2) {
  ------------------
  |  Branch (216:7): [True: 15.1k, False: 751k]
  ------------------
  217|  15.1k|    if (plane == AOM_PLANE_Y) {
  ------------------
  |  |  281|  15.1k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (217:9): [True: 5.03k, False: 10.0k]
  ------------------
  218|  5.03k|      return !planes_to_lf[plane];
  219|  5.03k|    }
  220|  10.0k|    if (plane == AOM_PLANE_U) {
  ------------------
  |  |  282|  10.0k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (220:9): [True: 5.03k, False: 5.03k]
  ------------------
  221|       |      // U and V are handled together
  222|  5.03k|      return !planes_to_lf[1] && !planes_to_lf[2];
  ------------------
  |  Branch (222:14): [True: 3.36k, False: 1.67k]
  |  Branch (222:34): [True: 3.36k, False: 0]
  ------------------
  223|  5.03k|    }
  224|  10.0k|    assert(plane == AOM_PLANE_V);
  225|  5.03k|    if (plane == AOM_PLANE_V) {
  ------------------
  |  |  283|  5.03k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
  |  Branch (225:9): [True: 5.03k, False: 0]
  ------------------
  226|       |      // V is handled when u is filtered
  227|  5.03k|      return true;
  228|  5.03k|    }
  229|  5.03k|  }
  230|       |
  231|       |  // Normal operation mode
  232|   751k|  return !planes_to_lf[plane];
  233|   766k|}
thread_common.c:get_lf_job_info:
  290|   631k|static inline AV1LfMTInfo *get_lf_job_info(AV1LfSync *lf_sync) {
  291|   631k|  AV1LfMTInfo *cur_job_info = NULL;
  292|       |
  293|   631k|#if CONFIG_MULTITHREAD
  294|   631k|  pthread_mutex_lock(lf_sync->job_mutex);
  295|       |
  296|   635k|  if (!lf_sync->lf_mt_exit && lf_sync->jobs_dequeued < lf_sync->jobs_enqueued) {
  ------------------
  |  Branch (296:7): [True: 635k, False: 18.4E]
  |  Branch (296:31): [True: 154k, False: 481k]
  ------------------
  297|   154k|    cur_job_info = lf_sync->job_queue + lf_sync->jobs_dequeued;
  298|   154k|    lf_sync->jobs_dequeued++;
  299|   154k|  }
  300|       |
  301|   631k|  pthread_mutex_unlock(lf_sync->job_mutex);
  302|       |#else
  303|       |  (void)lf_sync;
  304|       |#endif
  305|       |
  306|   631k|  return cur_job_info;
  307|   631k|}
thread_common.c:loop_filter_data_reset:
  312|   481k|                                          MACROBLOCKD *xd) {
  313|   481k|  struct macroblockd_plane *pd = xd->plane;
  314|   481k|  lf_data->frame_buffer = frame_buffer;
  315|   481k|  lf_data->cm = cm;
  316|   481k|  lf_data->xd = xd;
  317|  1.92M|  for (int i = 0; i < MAX_MB_PLANE; i++) {
  ------------------
  |  |   36|  1.92M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (317:19): [True: 1.44M, False: 481k]
  ------------------
  318|  1.44M|    lf_data->planes[i].dst = pd[i].dst;
  319|  1.44M|    lf_data->planes[i].subsampling_x = pd[i].subsampling_x;
  320|  1.44M|    lf_data->planes[i].subsampling_y = pd[i].subsampling_y;
  321|  1.44M|  }
  322|   481k|}

av1_tile_init:
   19|  1.39M|void av1_tile_init(TileInfo *tile, const AV1_COMMON *cm, int row, int col) {
   20|  1.39M|  av1_tile_set_row(tile, cm, row);
   21|  1.39M|  av1_tile_set_col(tile, cm, col);
   22|  1.39M|}
av1_get_tile_limits:
   32|   247k|void av1_get_tile_limits(AV1_COMMON *const cm) {
   33|   247k|  const SequenceHeader *const seq_params = cm->seq_params;
   34|   247k|  CommonTileParams *const tiles = &cm->tiles;
   35|   247k|  const int sb_cols =
   36|   247k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, seq_params->mib_size_log2);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   37|   247k|  const int sb_rows =
   38|   247k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, seq_params->mib_size_log2);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   39|       |
   40|   247k|  const int sb_size_log2 = seq_params->mib_size_log2 + MI_SIZE_LOG2;
  ------------------
  |  |   39|   247k|#define MI_SIZE_LOG2 2
  ------------------
   41|   247k|  tiles->max_width_sb = MAX_TILE_WIDTH >> sb_size_log2;
  ------------------
  |  |   50|   247k|#define MAX_TILE_WIDTH (4096)        // Max Tile width in pixels
  ------------------
   42|       |
   43|   247k|  const int max_tile_area_sb = MAX_TILE_AREA >> (2 * sb_size_log2);
  ------------------
  |  |   51|   247k|#define MAX_TILE_AREA (4096 * 2304)  // Maximum tile area in pixels
  ------------------
   44|       |
   45|   247k|  tiles->min_log2_cols = tile_log2(tiles->max_width_sb, sb_cols);
   46|   247k|  tiles->max_log2_cols = tile_log2(1, AOMMIN(sb_cols, MAX_TILE_COLS));
  ------------------
  |  |   34|   247k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 247k, False: 0]
  |  |  ------------------
  ------------------
   47|   247k|  tiles->max_log2_rows = tile_log2(1, AOMMIN(sb_rows, MAX_TILE_ROWS));
  ------------------
  |  |   34|   247k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 247k, False: 0]
  |  |  ------------------
  ------------------
   48|   247k|  tiles->min_log2 = tile_log2(max_tile_area_sb, sb_cols * sb_rows);
   49|   247k|  tiles->min_log2 = AOMMAX(tiles->min_log2, tiles->min_log2_cols);
  ------------------
  |  |   35|   247k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 247k]
  |  |  ------------------
  ------------------
   50|   247k|}
av1_calculate_tile_cols:
   54|   247k|                             CommonTileParams *const tiles) {
   55|   247k|  int sb_cols = CEIL_POWER_OF_TWO(cm_mi_cols, seq_params->mib_size_log2);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   56|   247k|  int sb_rows = CEIL_POWER_OF_TWO(cm_mi_rows, seq_params->mib_size_log2);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   57|   247k|  int i;
   58|       |
   59|       |  // This will be overridden if there is at least two columns of tiles
   60|       |  // (otherwise there is no inner tile width)
   61|   247k|  tiles->min_inner_width = -1;
   62|       |
   63|   247k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (63:7): [True: 247k, False: 0]
  ------------------
   64|   247k|    int start_sb;
   65|   247k|    int size_sb = CEIL_POWER_OF_TWO(sb_cols, tiles->log2_cols);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   66|   247k|    assert(size_sb > 0);
   67|   555k|    for (i = 0, start_sb = 0; start_sb < sb_cols; i++) {
  ------------------
  |  Branch (67:31): [True: 308k, False: 247k]
  ------------------
   68|   308k|      tiles->col_start_sb[i] = start_sb;
   69|   308k|      start_sb += size_sb;
   70|   308k|    }
   71|   247k|    tiles->cols = i;
   72|   247k|    tiles->col_start_sb[i] = sb_cols;
   73|   247k|    tiles->min_log2_rows = AOMMAX(tiles->min_log2 - tiles->log2_cols, 0);
  ------------------
  |  |   35|   247k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 247k]
  |  |  ------------------
  ------------------
   74|   247k|    tiles->max_height_sb = sb_rows >> tiles->min_log2_rows;
   75|       |
   76|   247k|    tiles->width = size_sb << seq_params->mib_size_log2;
   77|   247k|    tiles->width = AOMMIN(tiles->width, cm_mi_cols);
  ------------------
  |  |   34|   247k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 35.5k, False: 211k]
  |  |  ------------------
  ------------------
   78|   247k|    if (tiles->cols > 1) {
  ------------------
  |  Branch (78:9): [True: 35.5k, False: 211k]
  ------------------
   79|  35.5k|      tiles->min_inner_width = tiles->width;
   80|  35.5k|    }
   81|   247k|  } else {
   82|      0|    int max_tile_area_sb = (sb_rows * sb_cols);
   83|      0|    int widest_tile_sb = 1;
   84|      0|    int narrowest_inner_tile_sb = 65536;
   85|      0|    tiles->log2_cols = tile_log2(1, tiles->cols);
   86|      0|    for (i = 0; i < tiles->cols; i++) {
  ------------------
  |  Branch (86:17): [True: 0, False: 0]
  ------------------
   87|      0|      int size_sb = tiles->col_start_sb[i + 1] - tiles->col_start_sb[i];
   88|      0|      widest_tile_sb = AOMMAX(widest_tile_sb, size_sb);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   89|       |      // ignore the rightmost tile in frame for determining the narrowest
   90|      0|      if (i < tiles->cols - 1)
  ------------------
  |  Branch (90:11): [True: 0, False: 0]
  ------------------
   91|      0|        narrowest_inner_tile_sb = AOMMIN(narrowest_inner_tile_sb, size_sb);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   92|      0|    }
   93|      0|    if (tiles->min_log2) {
  ------------------
  |  Branch (93:9): [True: 0, False: 0]
  ------------------
   94|      0|      max_tile_area_sb >>= (tiles->min_log2 + 1);
   95|      0|    }
   96|      0|    tiles->max_height_sb = AOMMAX(max_tile_area_sb / widest_tile_sb, 1);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   97|      0|    if (tiles->cols > 1) {
  ------------------
  |  Branch (97:9): [True: 0, False: 0]
  ------------------
   98|      0|      tiles->min_inner_width = narrowest_inner_tile_sb
   99|      0|                               << seq_params->mib_size_log2;
  100|      0|    }
  101|      0|  }
  102|   247k|}
av1_calculate_tile_rows:
  105|   247k|                             int cm_mi_rows, CommonTileParams *const tiles) {
  106|   247k|  int sb_rows = CEIL_POWER_OF_TWO(cm_mi_rows, seq_params->mib_size_log2);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  107|   247k|  int start_sb, size_sb, i;
  108|       |
  109|   247k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (109:7): [True: 247k, False: 0]
  ------------------
  110|   247k|    size_sb = CEIL_POWER_OF_TWO(sb_rows, tiles->log2_rows);
  ------------------
  |  |   62|   247k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  111|   247k|    assert(size_sb > 0);
  112|   560k|    for (i = 0, start_sb = 0; start_sb < sb_rows; i++) {
  ------------------
  |  Branch (112:31): [True: 313k, False: 247k]
  ------------------
  113|   313k|      tiles->row_start_sb[i] = start_sb;
  114|   313k|      start_sb += size_sb;
  115|   313k|    }
  116|   247k|    tiles->rows = i;
  117|   247k|    tiles->row_start_sb[i] = sb_rows;
  118|       |
  119|   247k|    tiles->height = size_sb << seq_params->mib_size_log2;
  120|   247k|    tiles->height = AOMMIN(tiles->height, cm_mi_rows);
  ------------------
  |  |   34|   247k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 40.3k, False: 206k]
  |  |  ------------------
  ------------------
  121|   247k|  } else {
  122|      0|    tiles->log2_rows = tile_log2(1, tiles->rows);
  123|      0|  }
  124|   247k|}
av1_tile_set_row:
  126|  1.51M|void av1_tile_set_row(TileInfo *tile, const AV1_COMMON *cm, int row) {
  127|  1.51M|  assert(row < cm->tiles.rows);
  128|  1.51M|  int mi_row_start = cm->tiles.row_start_sb[row]
  129|  1.51M|                     << cm->seq_params->mib_size_log2;
  130|  1.51M|  int mi_row_end = cm->tiles.row_start_sb[row + 1]
  131|  1.51M|                   << cm->seq_params->mib_size_log2;
  132|  1.51M|  tile->tile_row = row;
  133|  1.51M|  tile->mi_row_start = mi_row_start;
  134|  1.51M|  tile->mi_row_end = AOMMIN(mi_row_end, cm->mi_params.mi_rows);
  ------------------
  |  |   34|  1.51M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 373k, False: 1.13M]
  |  |  ------------------
  ------------------
  135|       |  assert(tile->mi_row_end > tile->mi_row_start);
  136|  1.51M|}
av1_tile_set_col:
  138|  1.51M|void av1_tile_set_col(TileInfo *tile, const AV1_COMMON *cm, int col) {
  139|  1.51M|  assert(col < cm->tiles.cols);
  140|  1.51M|  int mi_col_start = cm->tiles.col_start_sb[col]
  141|  1.51M|                     << cm->seq_params->mib_size_log2;
  142|  1.51M|  int mi_col_end = cm->tiles.col_start_sb[col + 1]
  143|  1.51M|                   << cm->seq_params->mib_size_log2;
  144|  1.51M|  tile->tile_col = col;
  145|  1.51M|  tile->mi_col_start = mi_col_start;
  146|  1.51M|  tile->mi_col_end = AOMMIN(mi_col_end, cm->mi_params.mi_cols);
  ------------------
  |  |   34|  1.51M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 365k, False: 1.14M]
  |  |  ------------------
  ------------------
  147|       |  assert(tile->mi_col_end > tile->mi_col_start);
  148|  1.51M|}
av1_get_sb_rows_in_tile:
  150|  1.69M|int av1_get_sb_rows_in_tile(const AV1_COMMON *cm, const TileInfo *tile) {
  151|  1.69M|  return CEIL_POWER_OF_TWO(tile->mi_row_end - tile->mi_row_start,
  ------------------
  |  |   62|  1.69M|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  152|  1.69M|                           cm->seq_params->mib_size_log2);
  153|  1.69M|}
av1_get_sb_cols_in_tile:
  155|  1.68M|int av1_get_sb_cols_in_tile(const AV1_COMMON *cm, const TileInfo *tile) {
  156|  1.68M|  return CEIL_POWER_OF_TWO(tile->mi_col_end - tile->mi_col_start,
  ------------------
  |  |   62|  1.68M|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  157|  1.68M|                           cm->seq_params->mib_size_log2);
  158|  1.68M|}
av1_is_min_tile_width_satisfied:
  200|  28.0k|int av1_is_min_tile_width_satisfied(const AV1_COMMON *cm) {
  201|       |  // Disable check if there is a single tile col in the frame
  202|  28.0k|  if (cm->tiles.cols == 1) return 1;
  ------------------
  |  Branch (202:7): [True: 24.0k, False: 4.06k]
  ------------------
  203|       |
  204|  4.06k|  return ((cm->tiles.min_inner_width << MI_SIZE_LOG2) >=
  ------------------
  |  |   39|  4.06k|#define MI_SIZE_LOG2 2
  ------------------
  205|  4.06k|          (64 << av1_superres_scaled(cm)));
  206|  28.0k|}
tile_common.c:tile_log2:
   25|   988k|static int tile_log2(int blk_size, int target) {
   26|   988k|  int k;
   27|  1.15M|  for (k = 0; (blk_size << k) < target; k++) {
  ------------------
  |  Branch (27:15): [True: 161k, False: 988k]
  ------------------
   28|   161k|  }
   29|   988k|  return k;
   30|   988k|}

av1_max_level_bitrate:
   54|  4.98M|                              int seq_tier) {
   55|  4.98M|  int64_t bitrate;
   56|       |
   57|  4.98M|  if (seq_tier) {
  ------------------
  |  Branch (57:7): [True: 0, False: 4.98M]
  ------------------
   58|      0|    bitrate = high_kbps[seq_level_idx] * bitrate_profile_factor[seq_profile];
   59|  4.98M|  } else {
   60|  4.98M|    bitrate = main_kbps[seq_level_idx] * bitrate_profile_factor[seq_profile];
   61|  4.98M|  }
   62|       |
   63|  4.98M|  return bitrate * 1000;
   64|  4.98M|}

decodetxb.c:get_txb_ctx:
  442|  2.02M|                               TXB_CTX *const txb_ctx) {
  443|  2.02M|  switch (tx_size) {
  444|  1.06M|    case TX_4X4: get_txb_ctx_4x4(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (444:5): [True: 1.06M, False: 966k]
  ------------------
  445|   757k|    case TX_8X8: get_txb_ctx_8x8(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (445:5): [True: 757k, False: 1.27M]
  ------------------
  446|  47.7k|    case TX_16X16: get_txb_ctx_16x16(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (446:5): [True: 47.7k, False: 1.98M]
  ------------------
  447|  4.56k|    case TX_32X32: get_txb_ctx_32x32(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (447:5): [True: 4.56k, False: 2.02M]
  ------------------
  448|   169k|    default:
  ------------------
  |  Branch (448:5): [True: 169k, False: 1.85M]
  ------------------
  449|   169k|      get_txb_ctx_general(plane_bsize, tx_size, plane, a, l, txb_ctx);
  450|   169k|      break;
  451|  2.02M|  }
  452|  2.02M|}
decodetxb.c:get_txb_ctx_general:
  312|   169k|                                TXB_CTX *const txb_ctx) {
  313|   169k|  const int txb_w_unit = tx_size_wide_unit[tx_size];
  314|   169k|  const int txb_h_unit = tx_size_high_unit[tx_size];
  315|   169k|  int dc_sign = 0;
  316|   169k|  int k = 0;
  317|       |
  318|   229k|  do {
  319|   229k|    const unsigned int sign = ((uint8_t)a[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|   229k|#define COEFF_CONTEXT_BITS 3
  ------------------
  320|   229k|    assert(sign <= 2);
  321|   229k|    dc_sign += kTxbCtxSigns[sign];
  322|   229k|  } while (++k < txb_w_unit);
  ------------------
  |  Branch (322:12): [True: 60.2k, False: 169k]
  ------------------
  323|       |
  324|   169k|  k = 0;
  325|   397k|  do {
  326|   397k|    const unsigned int sign = ((uint8_t)l[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|   397k|#define COEFF_CONTEXT_BITS 3
  ------------------
  327|   397k|    assert(sign <= 2);
  328|   397k|    dc_sign += kTxbCtxSigns[sign];
  329|   397k|  } while (++k < txb_h_unit);
  ------------------
  |  Branch (329:12): [True: 227k, False: 169k]
  ------------------
  330|       |
  331|   169k|  txb_ctx->dc_sign_ctx = kTxbCtxDcSignContexts[dc_sign + 2 * MAX_TX_SIZE_UNIT];
  ------------------
  |  |  281|   169k|#define MAX_TX_SIZE_UNIT 16
  ------------------
  332|       |
  333|   169k|  if (plane == 0) {
  ------------------
  |  Branch (333:7): [True: 12.4k, False: 156k]
  ------------------
  334|  12.4k|    if (plane_bsize == txsize_to_bsize[tx_size]) {
  ------------------
  |  Branch (334:9): [True: 12.4k, False: 0]
  ------------------
  335|  12.4k|      txb_ctx->txb_skip_ctx = 0;
  336|  12.4k|    } else {
  337|       |      // For top and left, we only care about which of the following three
  338|       |      // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The
  339|       |      // spec calculates top and left with the Max() function. We can calculate
  340|       |      // an approximate max with bitwise OR because the real max and the
  341|       |      // approximate max belong to the same category.
  342|      0|      int top = 0;
  343|      0|      int left = 0;
  344|       |
  345|      0|      k = 0;
  346|      0|      do {
  347|      0|        top |= a[k];
  348|      0|      } while (++k < txb_w_unit);
  ------------------
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|      top &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  350|      0|      top = AOMMIN(top, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  351|       |
  352|      0|      k = 0;
  353|      0|      do {
  354|      0|        left |= l[k];
  355|      0|      } while (++k < txb_h_unit);
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|      left &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  357|      0|      left = AOMMIN(left, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  358|       |
  359|      0|      txb_ctx->txb_skip_ctx = kTxbCtxSkipContexts[top][left];
  360|      0|    }
  361|   156k|  } else {
  362|   156k|    const int ctx_base = get_entropy_context(tx_size, a, l);
  363|   156k|    const int ctx_offset = (num_pels_log2_lookup[plane_bsize] >
  ------------------
  |  Branch (363:28): [True: 0, False: 156k]
  ------------------
  364|   156k|                            num_pels_log2_lookup[txsize_to_bsize[tx_size]])
  365|   156k|                               ? 10
  366|   156k|                               : 7;
  367|   156k|    txb_ctx->txb_skip_ctx = ctx_base + ctx_offset;
  368|   156k|  }
  369|   169k|}
decodetxb.c:get_txb_bhl:
   50|  2.02M|static inline int get_txb_bhl(TX_SIZE tx_size) {
   51|  2.02M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   52|  2.02M|  return tx_size_high_log2[tx_size];
   53|  2.02M|}
decodetxb.c:get_txb_wide:
   55|  2.02M|static inline int get_txb_wide(TX_SIZE tx_size) {
   56|  2.02M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   57|  2.02M|  return tx_size_wide[tx_size];
   58|  2.02M|}
decodetxb.c:get_txb_high:
   60|  2.02M|static inline int get_txb_high(TX_SIZE tx_size) {
   61|  2.02M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   62|  2.02M|  return tx_size_high[tx_size];
   63|  2.02M|}
decodetxb.c:set_levels:
   65|  2.01M|static inline uint8_t *set_levels(uint8_t *const levels_buf, const int height) {
   66|  2.01M|  return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  193|  2.01M|#define TX_PAD_TOP 0
  ------------------
                return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  190|  2.01M|#define TX_PAD_HOR 4
  ------------------
   67|  2.01M|}
decodetxb.c:get_lower_levels_ctx_eob:
  229|  1.90M|static inline int get_lower_levels_ctx_eob(int bhl, int width, int scan_idx) {
  230|  1.90M|  if (scan_idx == 0) return 0;
  ------------------
  |  Branch (230:7): [True: 89.3k, False: 1.81M]
  ------------------
  231|  1.81M|  if (scan_idx <= (width << bhl) / 8) return 1;
  ------------------
  |  Branch (231:7): [True: 121k, False: 1.68M]
  ------------------
  232|  1.68M|  if (scan_idx <= (width << bhl) / 4) return 2;
  ------------------
  |  Branch (232:7): [True: 95.0k, False: 1.59M]
  ------------------
  233|  1.59M|  return 3;
  234|  1.68M|}
decodetxb.c:get_br_ctx_eob:
   92|   618k|                                           const TX_CLASS tx_class) {
   93|   618k|  const int col = c >> bhl;
   94|   618k|  const int row = c - (col << bhl);
   95|   618k|  if (c == 0) return 0;
  ------------------
  |  Branch (95:7): [True: 14.3k, False: 603k]
  ------------------
   96|   603k|  if ((tx_class == TX_CLASS_2D && row < 2 && col < 2) ||
  ------------------
  |  Branch (96:8): [True: 543k, False: 60.5k]
  |  Branch (96:35): [True: 27.7k, False: 515k]
  |  Branch (96:46): [True: 731, False: 27.0k]
  ------------------
   97|   603k|      (tx_class == TX_CLASS_HORIZ && col == 0) ||
  ------------------
  |  Branch (97:8): [True: 42.1k, False: 561k]
  |  Branch (97:38): [True: 5.02k, False: 37.1k]
  ------------------
   98|   598k|      (tx_class == TX_CLASS_VERT && row == 0))
  ------------------
  |  Branch (98:8): [True: 18.9k, False: 579k]
  |  Branch (98:37): [True: 2.45k, False: 16.4k]
  ------------------
   99|  8.21k|    return 7;
  100|   595k|  return 14;
  101|   603k|}
decodetxb.c:get_padded_idx:
   69|   111M|static inline int get_padded_idx(const int idx, const int bhl) {
   70|   111M|  return idx + ((idx >> bhl) << TX_PAD_HOR_LOG2);
  ------------------
  |  |  189|   111M|#define TX_PAD_HOR_LOG2 2
  ------------------
   71|   111M|}
decodetxb.c:get_lower_levels_ctx_2d:
  237|  37.6M|                                          int bhl, TX_SIZE tx_size) {
  238|  37.6M|  assert(coeff_idx > 0);
  239|  37.6M|  int mag;
  240|       |  // Note: AOMMIN(level, 3) is useless for decoder since level < 3.
  241|  37.6M|  levels = levels + get_padded_idx(coeff_idx, bhl);
  242|  37.6M|  mag = AOMMIN(levels[(1 << bhl) + TX_PAD_HOR], 3);               // { 0, 1 }
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 26.9M, False: 10.6M]
  |  |  ------------------
  ------------------
  243|  37.6M|  mag += AOMMIN(levels[1], 3);                                    // { 1, 0 }
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 26.9M, False: 10.6M]
  |  |  ------------------
  ------------------
  244|  37.6M|  mag += AOMMIN(levels[(1 << bhl) + TX_PAD_HOR + 1], 3);          // { 1, 1 }
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 29.0M, False: 8.53M]
  |  |  ------------------
  ------------------
  245|  37.6M|  mag += AOMMIN(levels[(2 << bhl) + (2 << TX_PAD_HOR_LOG2)], 3);  // { 0, 2 }
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 29.7M, False: 7.91M]
  |  |  ------------------
  ------------------
  246|  37.6M|  mag += AOMMIN(levels[2], 3);                                    // { 2, 0 }
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 29.6M, False: 7.97M]
  |  |  ------------------
  ------------------
  247|       |
  248|  37.6M|  const int ctx = AOMMIN((mag + 1) >> 1, 4);
  ------------------
  |  |   34|  37.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 25.5M, False: 12.0M]
  |  |  ------------------
  ------------------
  249|  37.6M|  return ctx + av1_nz_map_ctx_offset[tx_size][coeff_idx];
  250|  37.6M|}
decodetxb.c:get_br_ctx_2d:
   75|  14.2M|                                const int bhl) {
   76|  14.2M|  assert(c > 0);
   77|  14.2M|  const int col = c >> bhl;
   78|  14.2M|  const int row = c - (col << bhl);
   79|  14.2M|  const int stride = (1 << bhl) + TX_PAD_HOR;
  ------------------
  |  |  190|  14.2M|#define TX_PAD_HOR 4
  ------------------
   80|  14.2M|  const int pos = col * stride + row;
   81|  14.2M|  int mag = AOMMIN(levels[pos + 1], MAX_BASE_BR_RANGE) +
  ------------------
  |  |   34|  14.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.6M, False: 2.61M]
  |  |  ------------------
  ------------------
   82|  14.2M|            AOMMIN(levels[pos + stride], MAX_BASE_BR_RANGE) +
  ------------------
  |  |   34|  14.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.8M, False: 2.45M]
  |  |  ------------------
  ------------------
   83|  14.2M|            AOMMIN(levels[pos + 1 + stride], MAX_BASE_BR_RANGE);
  ------------------
  |  |   34|  14.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.6M, False: 1.68M]
  |  |  ------------------
  ------------------
   84|  14.2M|  mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  14.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.48M, False: 7.81M]
  |  |  ------------------
  ------------------
   85|       |  //((row | col) < 2) is equivalent to ((row < 2) && (col < 2))
   86|  14.2M|  if ((row | col) < 2) return mag + 7;
  ------------------
  |  Branch (86:7): [True: 2.07M, False: 12.2M]
  ------------------
   87|  12.2M|  return mag + 14;
   88|  14.2M|}
decodetxb.c:get_lower_levels_ctx:
  254|  5.28M|                                                 TX_CLASS tx_class) {
  255|  5.28M|  const int stats =
  256|  5.28M|      get_nz_mag(levels + get_padded_idx(coeff_idx, bhl), bhl, tx_class);
  257|  5.28M|  return get_nz_map_ctx_from_stats(stats, coeff_idx, bhl, tx_size, tx_class);
  258|  5.28M|}
decodetxb.c:get_nz_mag:
  151|  5.26M|                                       const int bhl, const TX_CLASS tx_class) {
  152|  5.26M|  int mag;
  153|       |
  154|       |  // Note: AOMMIN(level, 3) is useless for decoder since level < 3.
  155|  5.26M|  mag = clip_max3[levels[(1 << bhl) + TX_PAD_HOR]];  // { 0, 1 }
  ------------------
  |  |  190|  5.26M|#define TX_PAD_HOR 4
  ------------------
  156|  5.26M|  mag += clip_max3[levels[1]];                       // { 1, 0 }
  157|       |
  158|  5.26M|  if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (158:7): [True: 1.68M, False: 3.58M]
  ------------------
  159|  1.68M|    mag += clip_max3[levels[(1 << bhl) + TX_PAD_HOR + 1]];          // { 1, 1 }
  ------------------
  |  |  190|  1.68M|#define TX_PAD_HOR 4
  ------------------
  160|  1.68M|    mag += clip_max3[levels[(2 << bhl) + (2 << TX_PAD_HOR_LOG2)]];  // { 0, 2 }
  ------------------
  |  |  189|  1.68M|#define TX_PAD_HOR_LOG2 2
  ------------------
  161|  1.68M|    mag += clip_max3[levels[2]];                                    // { 2, 0 }
  162|  3.58M|  } else if (tx_class == TX_CLASS_VERT) {
  ------------------
  |  Branch (162:14): [True: 1.14M, False: 2.43M]
  ------------------
  163|  1.14M|    mag += clip_max3[levels[2]];  // { 2, 0 }
  164|  1.14M|    mag += clip_max3[levels[3]];  // { 3, 0 }
  165|  1.14M|    mag += clip_max3[levels[4]];  // { 4, 0 }
  166|  2.43M|  } else {
  167|  2.43M|    mag += clip_max3[levels[(2 << bhl) + (2 << TX_PAD_HOR_LOG2)]];  // { 0, 2 }
  ------------------
  |  |  189|  2.43M|#define TX_PAD_HOR_LOG2 2
  ------------------
  168|  2.43M|    mag += clip_max3[levels[(3 << bhl) + (3 << TX_PAD_HOR_LOG2)]];  // { 0, 3 }
  ------------------
  |  |  189|  2.43M|#define TX_PAD_HOR_LOG2 2
  ------------------
  169|  2.43M|    mag += clip_max3[levels[(4 << bhl) + (4 << TX_PAD_HOR_LOG2)]];  // { 0, 4 }
  ------------------
  |  |  189|  2.43M|#define TX_PAD_HOR_LOG2 2
  ------------------
  170|  2.43M|  }
  171|       |
  172|  5.26M|  return mag;
  173|  5.26M|}
decodetxb.c:get_nz_map_ctx_from_stats:
  192|  5.27M|    const int bhl, const TX_SIZE tx_size, const TX_CLASS tx_class) {
  193|       |  // tx_class == 0(TX_CLASS_2D)
  194|  5.27M|  if ((tx_class | coeff_idx) == 0) return 0;
  ------------------
  |  Branch (194:7): [True: 1.68M, False: 3.58M]
  ------------------
  195|  3.58M|  int ctx = (stats + 1) >> 1;
  196|  3.58M|  ctx = AOMMIN(ctx, 4);
  ------------------
  |  |   34|  3.58M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.29M, False: 1.29M]
  |  |  ------------------
  ------------------
  197|  3.58M|  switch (tx_class) {
  198|      0|    case TX_CLASS_2D: {
  ------------------
  |  Branch (198:5): [True: 0, False: 3.58M]
  ------------------
  199|       |      // This is the algorithm to generate av1_nz_map_ctx_offset[][]
  200|       |      //   const int width = tx_size_wide[tx_size];
  201|       |      //   const int height = tx_size_high[tx_size];
  202|       |      //   if (width < height) {
  203|       |      //     if (row < 2) return 11 + ctx;
  204|       |      //   } else if (width > height) {
  205|       |      //     if (col < 2) return 16 + ctx;
  206|       |      //   }
  207|       |      //   if (row + col < 2) return ctx + 1;
  208|       |      //   if (row + col < 4) return 5 + ctx + 1;
  209|       |      //   return 21 + ctx;
  210|      0|      return ctx + av1_nz_map_ctx_offset[tx_size][coeff_idx];
  211|      0|    }
  212|  2.62M|    case TX_CLASS_HORIZ: {
  ------------------
  |  Branch (212:5): [True: 2.62M, False: 962k]
  ------------------
  213|  2.62M|      const int col = coeff_idx >> bhl;
  214|  2.62M|      return ctx + nz_map_ctx_offset_1d[col];
  215|      0|    }
  216|  1.14M|    case TX_CLASS_VERT: {
  ------------------
  |  Branch (216:5): [True: 1.14M, False: 2.44M]
  ------------------
  217|  1.14M|      const int col = coeff_idx >> bhl;
  218|  1.14M|      const int row = coeff_idx - (col << bhl);
  219|  1.14M|      return ctx + nz_map_ctx_offset_1d[row];
  220|      0|    }
  221|      0|    default: break;
  ------------------
  |  Branch (221:5): [True: 0, False: 3.58M]
  ------------------
  222|  3.58M|  }
  223|      0|  return 0;
  224|  3.58M|}
decodetxb.c:get_br_ctx:
  105|  2.87M|                                       const int bhl, const TX_CLASS tx_class) {
  106|  2.87M|  const int col = c >> bhl;
  107|  2.87M|  const int row = c - (col << bhl);
  108|  2.87M|  const int stride = (1 << bhl) + TX_PAD_HOR;
  ------------------
  |  |  190|  2.87M|#define TX_PAD_HOR 4
  ------------------
  109|  2.87M|  const int pos = col * stride + row;
  110|  2.87M|  int mag = levels[pos + 1];
  111|  2.87M|  mag += levels[pos + stride];
  112|  2.87M|  switch (tx_class) {
  113|  1.05M|    case TX_CLASS_2D:
  ------------------
  |  Branch (113:5): [True: 1.05M, False: 1.81M]
  ------------------
  114|  1.05M|      mag += levels[pos + stride + 1];
  115|  1.05M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  1.05M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 442k, False: 611k]
  |  |  ------------------
  ------------------
  116|  1.05M|      if (c == 0) return mag;
  ------------------
  |  Branch (116:11): [True: 1.05M, False: 18.4E]
  ------------------
  117|  18.4E|      if ((row < 2) && (col < 2)) return mag + 7;
  ------------------
  |  Branch (117:11): [True: 0, False: 18.4E]
  |  Branch (117:24): [True: 0, False: 0]
  ------------------
  118|  18.4E|      break;
  119|  18.4E|    case TX_CLASS_HORIZ:
  ------------------
  |  Branch (119:5): [True: 1.23M, False: 1.63M]
  ------------------
  120|  1.23M|      mag += levels[pos + (stride << 1)];
  121|  1.23M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  1.23M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 308k, False: 926k]
  |  |  ------------------
  ------------------
  122|  1.23M|      if (c == 0) return mag;
  ------------------
  |  Branch (122:11): [True: 49.8k, False: 1.18M]
  ------------------
  123|  1.18M|      if (col == 0) return mag + 7;
  ------------------
  |  Branch (123:11): [True: 212k, False: 972k]
  ------------------
  124|   972k|      break;
  125|   972k|    case TX_CLASS_VERT:
  ------------------
  |  Branch (125:5): [True: 672k, False: 2.19M]
  ------------------
  126|   672k|      mag += levels[pos + 2];
  127|   672k|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|   672k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 121k, False: 551k]
  |  |  ------------------
  ------------------
  128|   672k|      if (c == 0) return mag;
  ------------------
  |  Branch (128:11): [True: 22.9k, False: 649k]
  ------------------
  129|   649k|      if (row == 0) return mag + 7;
  ------------------
  |  Branch (129:11): [True: 110k, False: 538k]
  ------------------
  130|   538k|      break;
  131|   538k|    default: break;
  ------------------
  |  Branch (131:5): [True: 0, False: 2.87M]
  ------------------
  132|  2.87M|  }
  133|       |
  134|  1.49M|  return mag + 14;
  135|  2.87M|}
decodetxb.c:set_dc_sign:
  274|  1.88M|static inline void set_dc_sign(int *cul_level, int dc_val) {
  275|  1.88M|  if (dc_val < 0)
  ------------------
  |  Branch (275:7): [True: 854k, False: 1.03M]
  ------------------
  276|   854k|    *cul_level |= 1 << COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|   854k|#define COEFF_CONTEXT_BITS 3
  ------------------
  277|  1.03M|  else if (dc_val > 0)
  ------------------
  |  Branch (277:12): [True: 838k, False: 192k]
  ------------------
  278|   838k|    *cul_level += 2 << COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|   838k|#define COEFF_CONTEXT_BITS 3
  ------------------
  279|  1.88M|}
encodemb.c:get_txb_ctx:
  442|  14.5M|                               TXB_CTX *const txb_ctx) {
  443|  14.5M|  switch (tx_size) {
  444|  7.92M|    case TX_4X4: get_txb_ctx_4x4(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (444:5): [True: 7.92M, False: 6.63M]
  ------------------
  445|  5.05M|    case TX_8X8: get_txb_ctx_8x8(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (445:5): [True: 5.05M, False: 9.50M]
  ------------------
  446|   130k|    case TX_16X16: get_txb_ctx_16x16(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (446:5): [True: 130k, False: 14.4M]
  ------------------
  447|  9.12k|    case TX_32X32: get_txb_ctx_32x32(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (447:5): [True: 9.12k, False: 14.5M]
  ------------------
  448|  1.45M|    default:
  ------------------
  |  Branch (448:5): [True: 1.45M, False: 13.1M]
  ------------------
  449|  1.45M|      get_txb_ctx_general(plane_bsize, tx_size, plane, a, l, txb_ctx);
  450|  1.45M|      break;
  451|  14.5M|  }
  452|  14.5M|}
encodemb.c:get_txb_ctx_general:
  312|  1.45M|                                TXB_CTX *const txb_ctx) {
  313|  1.45M|  const int txb_w_unit = tx_size_wide_unit[tx_size];
  314|  1.45M|  const int txb_h_unit = tx_size_high_unit[tx_size];
  315|  1.45M|  int dc_sign = 0;
  316|  1.45M|  int k = 0;
  317|       |
  318|  1.92M|  do {
  319|  1.92M|    const unsigned int sign = ((uint8_t)a[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  1.92M|#define COEFF_CONTEXT_BITS 3
  ------------------
  320|  1.92M|    assert(sign <= 2);
  321|  1.92M|    dc_sign += kTxbCtxSigns[sign];
  322|  1.92M|  } while (++k < txb_w_unit);
  ------------------
  |  Branch (322:12): [True: 465k, False: 1.45M]
  ------------------
  323|       |
  324|  1.45M|  k = 0;
  325|  3.00M|  do {
  326|  3.00M|    const unsigned int sign = ((uint8_t)l[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  3.00M|#define COEFF_CONTEXT_BITS 3
  ------------------
  327|  3.00M|    assert(sign <= 2);
  328|  3.00M|    dc_sign += kTxbCtxSigns[sign];
  329|  3.00M|  } while (++k < txb_h_unit);
  ------------------
  |  Branch (329:12): [True: 1.54M, False: 1.45M]
  ------------------
  330|       |
  331|  1.45M|  txb_ctx->dc_sign_ctx = kTxbCtxDcSignContexts[dc_sign + 2 * MAX_TX_SIZE_UNIT];
  ------------------
  |  |  281|  1.45M|#define MAX_TX_SIZE_UNIT 16
  ------------------
  332|       |
  333|  1.45M|  if (plane == 0) {
  ------------------
  |  Branch (333:7): [True: 268k, False: 1.19M]
  ------------------
  334|   268k|    if (plane_bsize == txsize_to_bsize[tx_size]) {
  ------------------
  |  Branch (334:9): [True: 268k, False: 0]
  ------------------
  335|   268k|      txb_ctx->txb_skip_ctx = 0;
  336|   268k|    } else {
  337|       |      // For top and left, we only care about which of the following three
  338|       |      // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The
  339|       |      // spec calculates top and left with the Max() function. We can calculate
  340|       |      // an approximate max with bitwise OR because the real max and the
  341|       |      // approximate max belong to the same category.
  342|      0|      int top = 0;
  343|      0|      int left = 0;
  344|       |
  345|      0|      k = 0;
  346|      0|      do {
  347|      0|        top |= a[k];
  348|      0|      } while (++k < txb_w_unit);
  ------------------
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|      top &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  350|      0|      top = AOMMIN(top, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  351|       |
  352|      0|      k = 0;
  353|      0|      do {
  354|      0|        left |= l[k];
  355|      0|      } while (++k < txb_h_unit);
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|      left &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  357|      0|      left = AOMMIN(left, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  358|       |
  359|      0|      txb_ctx->txb_skip_ctx = kTxbCtxSkipContexts[top][left];
  360|      0|    }
  361|  1.19M|  } else {
  362|  1.19M|    const int ctx_base = get_entropy_context(tx_size, a, l);
  363|  1.19M|    const int ctx_offset = (num_pels_log2_lookup[plane_bsize] >
  ------------------
  |  Branch (363:28): [True: 0, False: 1.19M]
  ------------------
  364|  1.19M|                            num_pels_log2_lookup[txsize_to_bsize[tx_size]])
  365|  1.19M|                               ? 10
  366|  1.19M|                               : 7;
  367|  1.19M|    txb_ctx->txb_skip_ctx = ctx_base + ctx_offset;
  368|  1.19M|  }
  369|  1.45M|}
encodetxb.c:get_txb_bhl:
   50|  10.2M|static inline int get_txb_bhl(TX_SIZE tx_size) {
   51|  10.2M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   52|  10.2M|  return tx_size_high_log2[tx_size];
   53|  10.2M|}
encodetxb.c:get_txb_wide:
   55|  10.1M|static inline int get_txb_wide(TX_SIZE tx_size) {
   56|  10.1M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   57|  10.1M|  return tx_size_wide[tx_size];
   58|  10.1M|}
encodetxb.c:get_txb_high:
   60|  10.2M|static inline int get_txb_high(TX_SIZE tx_size) {
   61|  10.2M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   62|  10.2M|  return tx_size_high[tx_size];
   63|  10.2M|}
encodetxb.c:set_levels:
   65|  9.89M|static inline uint8_t *set_levels(uint8_t *const levels_buf, const int height) {
   66|  9.89M|  return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  193|  9.89M|#define TX_PAD_TOP 0
  ------------------
                return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  190|  9.89M|#define TX_PAD_HOR 4
  ------------------
   67|  9.89M|}
encodetxb.c:get_br_ctx:
  105|  98.5M|                                       const int bhl, const TX_CLASS tx_class) {
  106|  98.5M|  const int col = c >> bhl;
  107|  98.5M|  const int row = c - (col << bhl);
  108|  98.5M|  const int stride = (1 << bhl) + TX_PAD_HOR;
  ------------------
  |  |  190|  98.5M|#define TX_PAD_HOR 4
  ------------------
  109|  98.5M|  const int pos = col * stride + row;
  110|  98.5M|  int mag = levels[pos + 1];
  111|  98.5M|  mag += levels[pos + stride];
  112|  98.5M|  switch (tx_class) {
  113|  88.8M|    case TX_CLASS_2D:
  ------------------
  |  Branch (113:5): [True: 88.8M, False: 9.69M]
  ------------------
  114|  88.8M|      mag += levels[pos + stride + 1];
  115|  88.8M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  88.8M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 40.7M, False: 48.1M]
  |  |  ------------------
  ------------------
  116|  88.8M|      if (c == 0) return mag;
  ------------------
  |  Branch (116:11): [True: 5.50M, False: 83.3M]
  ------------------
  117|  83.3M|      if ((row < 2) && (col < 2)) return mag + 7;
  ------------------
  |  Branch (117:11): [True: 29.9M, False: 53.3M]
  |  Branch (117:24): [True: 10.7M, False: 19.1M]
  ------------------
  118|  72.5M|      break;
  119|  72.5M|    case TX_CLASS_HORIZ:
  ------------------
  |  Branch (119:5): [True: 6.90M, False: 91.5M]
  ------------------
  120|  6.90M|      mag += levels[pos + (stride << 1)];
  121|  6.90M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  6.90M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.88M, False: 5.02M]
  |  |  ------------------
  ------------------
  122|  6.90M|      if (c == 0) return mag;
  ------------------
  |  Branch (122:11): [True: 264k, False: 6.64M]
  ------------------
  123|  6.64M|      if (col == 0) return mag + 7;
  ------------------
  |  Branch (123:11): [True: 1.15M, False: 5.48M]
  ------------------
  124|  5.48M|      break;
  125|  5.48M|    case TX_CLASS_VERT:
  ------------------
  |  Branch (125:5): [True: 3.72M, False: 94.7M]
  ------------------
  126|  3.72M|      mag += levels[pos + 2];
  127|  3.72M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  3.72M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 749k, False: 2.97M]
  |  |  ------------------
  ------------------
  128|  3.72M|      if (c == 0) return mag;
  ------------------
  |  Branch (128:11): [True: 121k, False: 3.60M]
  ------------------
  129|  3.60M|      if (row == 0) return mag + 7;
  ------------------
  |  Branch (129:11): [True: 594k, False: 3.01M]
  ------------------
  130|  3.01M|      break;
  131|  3.01M|    default: break;
  ------------------
  |  Branch (131:5): [True: 0, False: 98.5M]
  ------------------
  132|  98.5M|  }
  133|       |
  134|  82.2M|  return mag + 14;
  135|  98.5M|}
encodetxb.c:set_dc_sign:
  274|   142M|static inline void set_dc_sign(int *cul_level, int dc_val) {
  275|   142M|  if (dc_val < 0)
  ------------------
  |  Branch (275:7): [True: 63.1M, False: 78.8M]
  ------------------
  276|  63.1M|    *cul_level |= 1 << COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  63.1M|#define COEFF_CONTEXT_BITS 3
  ------------------
  277|  78.8M|  else if (dc_val > 0)
  ------------------
  |  Branch (277:12): [True: 62.6M, False: 16.2M]
  ------------------
  278|  62.6M|    *cul_level += 2 << COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  62.6M|#define COEFF_CONTEXT_BITS 3
  ------------------
  279|   142M|}
encodetxb.c:get_txb_ctx:
  442|  5.30M|                               TXB_CTX *const txb_ctx) {
  443|  5.30M|  switch (tx_size) {
  444|  2.68M|    case TX_4X4: get_txb_ctx_4x4(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (444:5): [True: 2.68M, False: 2.61M]
  ------------------
  445|  2.02M|    case TX_8X8: get_txb_ctx_8x8(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (445:5): [True: 2.02M, False: 3.27M]
  ------------------
  446|   132k|    case TX_16X16: get_txb_ctx_16x16(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (446:5): [True: 132k, False: 5.17M]
  ------------------
  447|  10.8k|    case TX_32X32: get_txb_ctx_32x32(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (447:5): [True: 10.8k, False: 5.29M]
  ------------------
  448|   448k|    default:
  ------------------
  |  Branch (448:5): [True: 448k, False: 4.85M]
  ------------------
  449|   448k|      get_txb_ctx_general(plane_bsize, tx_size, plane, a, l, txb_ctx);
  450|   448k|      break;
  451|  5.30M|  }
  452|  5.30M|}
encodetxb.c:get_txb_ctx_general:
  312|   448k|                                TXB_CTX *const txb_ctx) {
  313|   448k|  const int txb_w_unit = tx_size_wide_unit[tx_size];
  314|   448k|  const int txb_h_unit = tx_size_high_unit[tx_size];
  315|   448k|  int dc_sign = 0;
  316|   448k|  int k = 0;
  317|       |
  318|   605k|  do {
  319|   605k|    const unsigned int sign = ((uint8_t)a[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|   605k|#define COEFF_CONTEXT_BITS 3
  ------------------
  320|   605k|    assert(sign <= 2);
  321|   605k|    dc_sign += kTxbCtxSigns[sign];
  322|   605k|  } while (++k < txb_w_unit);
  ------------------
  |  Branch (322:12): [True: 157k, False: 448k]
  ------------------
  323|       |
  324|   448k|  k = 0;
  325|  1.03M|  do {
  326|  1.03M|    const unsigned int sign = ((uint8_t)l[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  1.03M|#define COEFF_CONTEXT_BITS 3
  ------------------
  327|  1.03M|    assert(sign <= 2);
  328|  1.03M|    dc_sign += kTxbCtxSigns[sign];
  329|  1.03M|  } while (++k < txb_h_unit);
  ------------------
  |  Branch (329:12): [True: 586k, False: 448k]
  ------------------
  330|       |
  331|   448k|  txb_ctx->dc_sign_ctx = kTxbCtxDcSignContexts[dc_sign + 2 * MAX_TX_SIZE_UNIT];
  ------------------
  |  |  281|   448k|#define MAX_TX_SIZE_UNIT 16
  ------------------
  332|       |
  333|   448k|  if (plane == 0) {
  ------------------
  |  Branch (333:7): [True: 34.1k, False: 413k]
  ------------------
  334|  34.1k|    if (plane_bsize == txsize_to_bsize[tx_size]) {
  ------------------
  |  Branch (334:9): [True: 34.1k, False: 0]
  ------------------
  335|  34.1k|      txb_ctx->txb_skip_ctx = 0;
  336|  34.1k|    } else {
  337|       |      // For top and left, we only care about which of the following three
  338|       |      // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The
  339|       |      // spec calculates top and left with the Max() function. We can calculate
  340|       |      // an approximate max with bitwise OR because the real max and the
  341|       |      // approximate max belong to the same category.
  342|      0|      int top = 0;
  343|      0|      int left = 0;
  344|       |
  345|      0|      k = 0;
  346|      0|      do {
  347|      0|        top |= a[k];
  348|      0|      } while (++k < txb_w_unit);
  ------------------
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|      top &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  350|      0|      top = AOMMIN(top, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  351|       |
  352|      0|      k = 0;
  353|      0|      do {
  354|      0|        left |= l[k];
  355|      0|      } while (++k < txb_h_unit);
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|      left &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|      0|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|      0|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  357|      0|      left = AOMMIN(left, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  358|       |
  359|      0|      txb_ctx->txb_skip_ctx = kTxbCtxSkipContexts[top][left];
  360|      0|    }
  361|   413k|  } else {
  362|   413k|    const int ctx_base = get_entropy_context(tx_size, a, l);
  363|   413k|    const int ctx_offset = (num_pels_log2_lookup[plane_bsize] >
  ------------------
  |  Branch (363:28): [True: 0, False: 413k]
  ------------------
  364|   413k|                            num_pels_log2_lookup[txsize_to_bsize[tx_size]])
  365|   413k|                               ? 10
  366|   413k|                               : 7;
  367|   413k|    txb_ctx->txb_skip_ctx = ctx_base + ctx_offset;
  368|   413k|  }
  369|   448k|}
tx_search.c:get_txb_ctx:
  442|  66.7M|                               TXB_CTX *const txb_ctx) {
  443|  66.7M|  switch (tx_size) {
  444|  32.6M|    case TX_4X4: get_txb_ctx_4x4(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (444:5): [True: 32.6M, False: 34.0M]
  ------------------
  445|  22.6M|    case TX_8X8: get_txb_ctx_8x8(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (445:5): [True: 22.6M, False: 44.0M]
  ------------------
  446|   773k|    case TX_16X16: get_txb_ctx_16x16(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (446:5): [True: 773k, False: 65.9M]
  ------------------
  447|   179k|    case TX_32X32: get_txb_ctx_32x32(plane_bsize, plane, a, l, txb_ctx); break;
  ------------------
  |  Branch (447:5): [True: 179k, False: 66.5M]
  ------------------
  448|  10.5M|    default:
  ------------------
  |  Branch (448:5): [True: 10.5M, False: 56.1M]
  ------------------
  449|  10.5M|      get_txb_ctx_general(plane_bsize, tx_size, plane, a, l, txb_ctx);
  450|  10.5M|      break;
  451|  66.7M|  }
  452|  66.7M|}
tx_search.c:get_txb_ctx_general:
  312|  10.5M|                                TXB_CTX *const txb_ctx) {
  313|  10.5M|  const int txb_w_unit = tx_size_wide_unit[tx_size];
  314|  10.5M|  const int txb_h_unit = tx_size_high_unit[tx_size];
  315|  10.5M|  int dc_sign = 0;
  316|  10.5M|  int k = 0;
  317|       |
  318|  16.1M|  do {
  319|  16.1M|    const unsigned int sign = ((uint8_t)a[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  16.1M|#define COEFF_CONTEXT_BITS 3
  ------------------
  320|  16.1M|    assert(sign <= 2);
  321|  16.1M|    dc_sign += kTxbCtxSigns[sign];
  322|  16.1M|  } while (++k < txb_w_unit);
  ------------------
  |  Branch (322:12): [True: 5.59M, False: 10.5M]
  ------------------
  323|       |
  324|  10.5M|  k = 0;
  325|  21.9M|  do {
  326|  21.9M|    const unsigned int sign = ((uint8_t)l[k]) >> COEFF_CONTEXT_BITS;
  ------------------
  |  |   51|  21.9M|#define COEFF_CONTEXT_BITS 3
  ------------------
  327|  21.9M|    assert(sign <= 2);
  328|  21.9M|    dc_sign += kTxbCtxSigns[sign];
  329|  21.9M|  } while (++k < txb_h_unit);
  ------------------
  |  Branch (329:12): [True: 11.3M, False: 10.5M]
  ------------------
  330|       |
  331|  10.5M|  txb_ctx->dc_sign_ctx = kTxbCtxDcSignContexts[dc_sign + 2 * MAX_TX_SIZE_UNIT];
  ------------------
  |  |  281|  10.5M|#define MAX_TX_SIZE_UNIT 16
  ------------------
  332|       |
  333|  10.5M|  if (plane == 0) {
  ------------------
  |  Branch (333:7): [True: 2.55M, False: 8.02M]
  ------------------
  334|  2.55M|    if (plane_bsize == txsize_to_bsize[tx_size]) {
  ------------------
  |  Branch (334:9): [True: 2.55M, False: 18.4E]
  ------------------
  335|  2.55M|      txb_ctx->txb_skip_ctx = 0;
  336|  18.4E|    } else {
  337|       |      // For top and left, we only care about which of the following three
  338|       |      // categories they belong to: { 0 }, { 1, 2, 3 }, or { 4, 5, ... }. The
  339|       |      // spec calculates top and left with the Max() function. We can calculate
  340|       |      // an approximate max with bitwise OR because the real max and the
  341|       |      // approximate max belong to the same category.
  342|  18.4E|      int top = 0;
  343|  18.4E|      int left = 0;
  344|       |
  345|  18.4E|      k = 0;
  346|  18.4E|      do {
  347|  18.4E|        top |= a[k];
  348|  18.4E|      } while (++k < txb_w_unit);
  ------------------
  |  Branch (348:16): [True: 0, False: 18.4E]
  ------------------
  349|  18.4E|      top &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|  18.4E|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|  18.4E|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  350|  18.4E|      top = AOMMIN(top, 4);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  351|       |
  352|  18.4E|      k = 0;
  353|  18.4E|      do {
  354|  18.4E|        left |= l[k];
  355|  18.4E|      } while (++k < txb_h_unit);
  ------------------
  |  Branch (355:16): [True: 0, False: 18.4E]
  ------------------
  356|  18.4E|      left &= COEFF_CONTEXT_MASK;
  ------------------
  |  |   52|  18.4E|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|  18.4E|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  357|  18.4E|      left = AOMMIN(left, 4);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  358|       |
  359|  18.4E|      txb_ctx->txb_skip_ctx = kTxbCtxSkipContexts[top][left];
  360|  18.4E|    }
  361|  8.02M|  } else {
  362|  8.02M|    const int ctx_base = get_entropy_context(tx_size, a, l);
  363|  8.02M|    const int ctx_offset = (num_pels_log2_lookup[plane_bsize] >
  ------------------
  |  Branch (363:28): [True: 0, False: 8.02M]
  ------------------
  364|  8.02M|                            num_pels_log2_lookup[txsize_to_bsize[tx_size]])
  365|  8.02M|                               ? 10
  366|  8.02M|                               : 7;
  367|  8.02M|    txb_ctx->txb_skip_ctx = ctx_base + ctx_offset;
  368|  8.02M|  }
  369|  10.5M|}
txb_rdopt.c:get_txb_bhl:
   50|   124M|static inline int get_txb_bhl(TX_SIZE tx_size) {
   51|   124M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   52|   124M|  return tx_size_high_log2[tx_size];
   53|   124M|}
txb_rdopt.c:get_txb_wide:
   55|   124M|static inline int get_txb_wide(TX_SIZE tx_size) {
   56|   124M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   57|   124M|  return tx_size_wide[tx_size];
   58|   124M|}
txb_rdopt.c:get_txb_high:
   60|   124M|static inline int get_txb_high(TX_SIZE tx_size) {
   61|   124M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   62|   124M|  return tx_size_high[tx_size];
   63|   124M|}
txb_rdopt.c:set_levels:
   65|   123M|static inline uint8_t *set_levels(uint8_t *const levels_buf, const int height) {
   66|   123M|  return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  193|   123M|#define TX_PAD_TOP 0
  ------------------
                return levels_buf + TX_PAD_TOP * (height + TX_PAD_HOR);
  ------------------
  |  |  190|   123M|#define TX_PAD_HOR 4
  ------------------
   67|   123M|}
txb_rdopt.c:get_lower_levels_ctx_general:
  264|  61.2M|                                               TX_CLASS tx_class) {
  265|  61.2M|  if (is_last) {
  ------------------
  |  Branch (265:7): [True: 18.3M, False: 42.9M]
  ------------------
  266|  18.3M|    if (scan_idx == 0) return 0;
  ------------------
  |  Branch (266:9): [True: 1.02M, False: 17.3M]
  ------------------
  267|  17.3M|    if (scan_idx <= (width << bhl) >> 3) return 1;
  ------------------
  |  Branch (267:9): [True: 304k, False: 17.0M]
  ------------------
  268|  17.0M|    if (scan_idx <= (width << bhl) >> 2) return 2;
  ------------------
  |  Branch (268:9): [True: 272k, False: 16.7M]
  ------------------
  269|  16.7M|    return 3;
  270|  17.0M|  }
  271|  42.9M|  return get_lower_levels_ctx(levels, coeff_idx, bhl, tx_size, tx_class);
  272|  61.2M|}
txb_rdopt.c:get_lower_levels_ctx:
  254|  1.27G|                                                 TX_CLASS tx_class) {
  255|  1.27G|  const int stats =
  256|  1.27G|      get_nz_mag(levels + get_padded_idx(coeff_idx, bhl), bhl, tx_class);
  257|  1.27G|  return get_nz_map_ctx_from_stats(stats, coeff_idx, bhl, tx_size, tx_class);
  258|  1.27G|}
txb_rdopt.c:get_nz_mag:
  151|  1.27G|                                       const int bhl, const TX_CLASS tx_class) {
  152|  1.27G|  int mag;
  153|       |
  154|       |  // Note: AOMMIN(level, 3) is useless for decoder since level < 3.
  155|  1.27G|  mag = clip_max3[levels[(1 << bhl) + TX_PAD_HOR]];  // { 0, 1 }
  ------------------
  |  |  190|  1.27G|#define TX_PAD_HOR 4
  ------------------
  156|  1.27G|  mag += clip_max3[levels[1]];                       // { 1, 0 }
  157|       |
  158|  1.27G|  if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (158:7): [True: 1.06G, False: 204M]
  ------------------
  159|  1.06G|    mag += clip_max3[levels[(1 << bhl) + TX_PAD_HOR + 1]];          // { 1, 1 }
  ------------------
  |  |  190|  1.06G|#define TX_PAD_HOR 4
  ------------------
  160|  1.06G|    mag += clip_max3[levels[(2 << bhl) + (2 << TX_PAD_HOR_LOG2)]];  // { 0, 2 }
  ------------------
  |  |  189|  1.06G|#define TX_PAD_HOR_LOG2 2
  ------------------
  161|  1.06G|    mag += clip_max3[levels[2]];                                    // { 2, 0 }
  162|  1.06G|  } else if (tx_class == TX_CLASS_VERT) {
  ------------------
  |  Branch (162:14): [True: 42.3M, False: 162M]
  ------------------
  163|  42.3M|    mag += clip_max3[levels[2]];  // { 2, 0 }
  164|  42.3M|    mag += clip_max3[levels[3]];  // { 3, 0 }
  165|  42.3M|    mag += clip_max3[levels[4]];  // { 4, 0 }
  166|   162M|  } else {
  167|   162M|    mag += clip_max3[levels[(2 << bhl) + (2 << TX_PAD_HOR_LOG2)]];  // { 0, 2 }
  ------------------
  |  |  189|   162M|#define TX_PAD_HOR_LOG2 2
  ------------------
  168|   162M|    mag += clip_max3[levels[(3 << bhl) + (3 << TX_PAD_HOR_LOG2)]];  // { 0, 3 }
  ------------------
  |  |  189|   162M|#define TX_PAD_HOR_LOG2 2
  ------------------
  169|   162M|    mag += clip_max3[levels[(4 << bhl) + (4 << TX_PAD_HOR_LOG2)]];  // { 0, 4 }
  ------------------
  |  |  189|   162M|#define TX_PAD_HOR_LOG2 2
  ------------------
  170|   162M|  }
  171|       |
  172|  1.27G|  return mag;
  173|  1.27G|}
txb_rdopt.c:get_nz_map_ctx_from_stats:
  192|  1.27G|    const int bhl, const TX_SIZE tx_size, const TX_CLASS tx_class) {
  193|       |  // tx_class == 0(TX_CLASS_2D)
  194|  1.27G|  if ((tx_class | coeff_idx) == 0) return 0;
  ------------------
  |  Branch (194:7): [True: 41.9M, False: 1.23G]
  ------------------
  195|  1.23G|  int ctx = (stats + 1) >> 1;
  196|  1.23G|  ctx = AOMMIN(ctx, 4);
  ------------------
  |  |   34|  1.23G|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 912M, False: 320M]
  |  |  ------------------
  ------------------
  197|  1.23G|  switch (tx_class) {
  198|  1.03G|    case TX_CLASS_2D: {
  ------------------
  |  Branch (198:5): [True: 1.03G, False: 199M]
  ------------------
  199|       |      // This is the algorithm to generate av1_nz_map_ctx_offset[][]
  200|       |      //   const int width = tx_size_wide[tx_size];
  201|       |      //   const int height = tx_size_high[tx_size];
  202|       |      //   if (width < height) {
  203|       |      //     if (row < 2) return 11 + ctx;
  204|       |      //   } else if (width > height) {
  205|       |      //     if (col < 2) return 16 + ctx;
  206|       |      //   }
  207|       |      //   if (row + col < 2) return ctx + 1;
  208|       |      //   if (row + col < 4) return 5 + ctx + 1;
  209|       |      //   return 21 + ctx;
  210|  1.03G|      return ctx + av1_nz_map_ctx_offset[tx_size][coeff_idx];
  211|      0|    }
  212|   191M|    case TX_CLASS_HORIZ: {
  ------------------
  |  Branch (212:5): [True: 191M, False: 1.04G]
  ------------------
  213|   191M|      const int col = coeff_idx >> bhl;
  214|   191M|      return ctx + nz_map_ctx_offset_1d[col];
  215|      0|    }
  216|  42.3M|    case TX_CLASS_VERT: {
  ------------------
  |  Branch (216:5): [True: 42.3M, False: 1.19G]
  ------------------
  217|  42.3M|      const int col = coeff_idx >> bhl;
  218|  42.3M|      const int row = coeff_idx - (col << bhl);
  219|  42.3M|      return ctx + nz_map_ctx_offset_1d[row];
  220|      0|    }
  221|      0|    default: break;
  ------------------
  |  Branch (221:5): [True: 0, False: 1.23G]
  ------------------
  222|  1.23G|  }
  223|      0|  return 0;
  224|  1.23G|}
txb_rdopt.c:get_br_ctx_eob:
   92|  90.2M|                                           const TX_CLASS tx_class) {
   93|  90.2M|  const int col = c >> bhl;
   94|  90.2M|  const int row = c - (col << bhl);
   95|  90.2M|  if (c == 0) return 0;
  ------------------
  |  Branch (95:7): [True: 3.13M, False: 87.1M]
  ------------------
   96|  87.1M|  if ((tx_class == TX_CLASS_2D && row < 2 && col < 2) ||
  ------------------
  |  Branch (96:8): [True: 68.9M, False: 18.2M]
  |  Branch (96:35): [True: 7.19M, False: 61.7M]
  |  Branch (96:46): [True: 1.29M, False: 5.90M]
  ------------------
   97|  85.8M|      (tx_class == TX_CLASS_HORIZ && col == 0) ||
  ------------------
  |  Branch (97:8): [True: 14.9M, False: 70.8M]
  |  Branch (97:38): [True: 973k, False: 13.9M]
  ------------------
   98|  84.9M|      (tx_class == TX_CLASS_VERT && row == 0))
  ------------------
  |  Branch (98:8): [True: 4.00M, False: 80.9M]
  |  Branch (98:37): [True: 410k, False: 3.59M]
  ------------------
   99|  2.67M|    return 7;
  100|  84.4M|  return 14;
  101|  87.1M|}
txb_rdopt.c:get_br_ctx:
  105|  1.19G|                                       const int bhl, const TX_CLASS tx_class) {
  106|  1.19G|  const int col = c >> bhl;
  107|  1.19G|  const int row = c - (col << bhl);
  108|  1.19G|  const int stride = (1 << bhl) + TX_PAD_HOR;
  ------------------
  |  |  190|  1.19G|#define TX_PAD_HOR 4
  ------------------
  109|  1.19G|  const int pos = col * stride + row;
  110|  1.19G|  int mag = levels[pos + 1];
  111|  1.19G|  mag += levels[pos + stride];
  112|  1.19G|  switch (tx_class) {
  113|  1.03G|    case TX_CLASS_2D:
  ------------------
  |  Branch (113:5): [True: 1.03G, False: 162M]
  ------------------
  114|  1.03G|      mag += levels[pos + stride + 1];
  115|  1.03G|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  1.03G|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 461M, False: 569M]
  |  |  ------------------
  ------------------
  116|  1.03G|      if (c == 0) return mag;
  ------------------
  |  Branch (116:11): [True: 83.0M, False: 948M]
  ------------------
  117|   948M|      if ((row < 2) && (col < 2)) return mag + 7;
  ------------------
  |  Branch (117:11): [True: 320M, False: 627M]
  |  Branch (117:24): [True: 108M, False: 212M]
  ------------------
  118|   839M|      break;
  119|   839M|    case TX_CLASS_HORIZ:
  ------------------
  |  Branch (119:5): [True: 136M, False: 1.05G]
  ------------------
  120|   136M|      mag += levels[pos + (stride << 1)];
  121|   136M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|   136M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 55.8M, False: 81.1M]
  |  |  ------------------
  ------------------
  122|   136M|      if (c == 0) return mag;
  ------------------
  |  Branch (122:11): [True: 8.73M, False: 128M]
  ------------------
  123|   128M|      if (col == 0) return mag + 7;
  ------------------
  |  Branch (123:11): [True: 24.1M, False: 104M]
  ------------------
  124|   104M|      break;
  125|   104M|    case TX_CLASS_VERT:
  ------------------
  |  Branch (125:5): [True: 63.3M, False: 1.13G]
  ------------------
  126|  63.3M|      mag += levels[pos + 2];
  127|  63.3M|      mag = AOMMIN((mag + 1) >> 1, 6);
  ------------------
  |  |   34|  63.3M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 23.1M, False: 40.1M]
  |  |  ------------------
  ------------------
  128|  63.3M|      if (c == 0) return mag;
  ------------------
  |  Branch (128:11): [True: 3.09M, False: 60.2M]
  ------------------
  129|  60.2M|      if (row == 0) return mag + 7;
  ------------------
  |  Branch (129:11): [True: 11.6M, False: 48.5M]
  ------------------
  130|  48.5M|      break;
  131|  48.5M|    default: break;
  ------------------
  |  Branch (131:5): [True: 0, False: 1.19G]
  ------------------
  132|  1.19G|  }
  133|       |
  134|   981M|  return mag + 14;
  135|  1.19G|}
txb_rdopt.c:get_padded_idx:
   69|  1.26G|static inline int get_padded_idx(const int idx, const int bhl) {
   70|  1.26G|  return idx + ((idx >> bhl) << TX_PAD_HOR_LOG2);
  ------------------
  |  |  189|  1.26G|#define TX_PAD_HOR_LOG2 2
  ------------------
   71|  1.26G|}
txb_rdopt.c:get_lower_levels_ctx_eob:
  229|   134M|static inline int get_lower_levels_ctx_eob(int bhl, int width, int scan_idx) {
  230|   134M|  if (scan_idx == 0) return 0;
  ------------------
  |  Branch (230:7): [True: 7.61M, False: 126M]
  ------------------
  231|   126M|  if (scan_idx <= (width << bhl) / 8) return 1;
  ------------------
  |  Branch (231:7): [True: 12.2M, False: 114M]
  ------------------
  232|   114M|  if (scan_idx <= (width << bhl) / 4) return 2;
  ------------------
  |  Branch (232:7): [True: 8.13M, False: 106M]
  ------------------
  233|   106M|  return 3;
  234|   114M|}
encodetxb_sse2.c:get_txb_wide:
   55|  75.7M|static inline int get_txb_wide(TX_SIZE tx_size) {
   56|  75.7M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   57|  75.7M|  return tx_size_wide[tx_size];
   58|  75.7M|}
encodetxb_sse2.c:get_txb_high:
   60|  75.6M|static inline int get_txb_high(TX_SIZE tx_size) {
   61|  75.6M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   62|  75.6M|  return tx_size_high[tx_size];
   63|  75.6M|}
encodetxb_sse2.c:get_txb_bhl:
   50|  75.9M|static inline int get_txb_bhl(TX_SIZE tx_size) {
   51|  75.9M|  tx_size = av1_get_adjusted_tx_size(tx_size);
   52|  75.9M|  return tx_size_high_log2[tx_size];
   53|  75.9M|}

av1_get_shear_params:
  243|   291k|int av1_get_shear_params(WarpedMotionParams *wm) {
  244|       |#ifndef NDEBUG
  245|       |  // Check that models have been constructed sensibly
  246|       |  // This is a good place to check, because this function does not need to
  247|       |  // be called until after model construction is complete, but must be called
  248|       |  // before the model can be used for prediction.
  249|       |  check_model_consistency(wm);
  250|       |#endif  // NDEBUG
  251|       |
  252|   291k|  const int32_t *mat = wm->wmmat;
  253|   291k|  if (!is_affine_valid(wm)) return 0;
  ------------------
  |  Branch (253:7): [True: 0, False: 291k]
  ------------------
  254|       |
  255|   291k|  wm->alpha =
  256|   291k|      clamp(mat[2] - (1 << WARPEDMODEL_PREC_BITS), INT16_MIN, INT16_MAX);
  ------------------
  |  |   96|   291k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  257|   291k|  wm->beta = clamp(mat[3], INT16_MIN, INT16_MAX);
  258|   291k|  int16_t shift;
  259|   291k|  int16_t y = resolve_divisor_32(abs(mat[2]), &shift) * (mat[2] < 0 ? -1 : 1);
  ------------------
  |  Branch (259:58): [True: 0, False: 291k]
  ------------------
  260|   291k|  int64_t v = ((int64_t)mat[4] * (1 << WARPEDMODEL_PREC_BITS)) * y;
  ------------------
  |  |   96|   291k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  261|   291k|  wm->gamma =
  262|   291k|      clamp((int)ROUND_POWER_OF_TWO_SIGNED_64(v, shift), INT16_MIN, INT16_MAX);
  ------------------
  |  |   58|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  44.7k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 44.7k, False: 246k]
  |  |  ------------------
  |  |   59|   291k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   246k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  263|   291k|  v = ((int64_t)mat[3] * mat[4]) * y;
  264|   291k|  wm->delta = clamp(mat[5] - (int)ROUND_POWER_OF_TWO_SIGNED_64(v, shift) -
  ------------------
  |  |   58|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  44.4k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 44.4k, False: 246k]
  |  |  ------------------
  |  |   59|   291k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   246k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  265|   291k|                        (1 << WARPEDMODEL_PREC_BITS),
  ------------------
  |  |   96|   291k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  266|   291k|                    INT16_MIN, INT16_MAX);
  267|       |
  268|   291k|  wm->alpha = ROUND_POWER_OF_TWO_SIGNED(wm->alpha, WARP_PARAM_REDUCE_BITS) *
  ------------------
  |  |   45|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|  59.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 59.5k, False: 231k]
  |  |  ------------------
  |  |   46|   291k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   231k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  269|   291k|              (1 << WARP_PARAM_REDUCE_BITS);
  ------------------
  |  |  105|   291k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
  270|   291k|  wm->beta = ROUND_POWER_OF_TWO_SIGNED(wm->beta, WARP_PARAM_REDUCE_BITS) *
  ------------------
  |  |   45|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|  47.8k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 47.8k, False: 243k]
  |  |  ------------------
  |  |   46|   291k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   243k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  271|   291k|             (1 << WARP_PARAM_REDUCE_BITS);
  ------------------
  |  |  105|   291k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
  272|   291k|  wm->gamma = ROUND_POWER_OF_TWO_SIGNED(wm->gamma, WARP_PARAM_REDUCE_BITS) *
  ------------------
  |  |   45|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|  44.7k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 44.7k, False: 246k]
  |  |  ------------------
  |  |   46|   291k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   246k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  273|   291k|              (1 << WARP_PARAM_REDUCE_BITS);
  ------------------
  |  |  105|   291k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
  274|   291k|  wm->delta = ROUND_POWER_OF_TWO_SIGNED(wm->delta, WARP_PARAM_REDUCE_BITS) *
  ------------------
  |  |   45|   291k|  (((value) < 0) ? -ROUND_POWER_OF_TWO(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   41|  64.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 64.5k, False: 226k]
  |  |  ------------------
  |  |   46|   291k|                 : ROUND_POWER_OF_TWO((value), (n)))
  |  |  ------------------
  |  |  |  |   41|   226k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  275|   291k|              (1 << WARP_PARAM_REDUCE_BITS);
  ------------------
  |  |  105|   291k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
  276|       |
  277|   291k|  if (!is_affine_shear_allowed(wm->alpha, wm->beta, wm->gamma, wm->delta))
  ------------------
  |  Branch (277:7): [True: 8.76k, False: 282k]
  ------------------
  278|  8.76k|    return 0;
  279|       |
  280|   282k|  return 1;
  281|   291k|}
highbd_warp_plane:
  419|  28.4k|                       int bd, ConvolveParams *conv_params) {
  420|  28.4k|  const int32_t *const mat = wm->wmmat;
  421|  28.4k|  const int16_t alpha = wm->alpha;
  422|  28.4k|  const int16_t beta = wm->beta;
  423|  28.4k|  const int16_t gamma = wm->gamma;
  424|  28.4k|  const int16_t delta = wm->delta;
  425|       |
  426|  28.4k|  av1_highbd_warp_affine(mat, ref, width, height, stride, pred, p_col, p_row,
  427|  28.4k|                         p_width, p_height, p_stride, subsampling_x,
  428|  28.4k|                         subsampling_y, bd, conv_params, alpha, beta, gamma,
  429|  28.4k|                         delta);
  430|  28.4k|}
warp_plane:
  651|   180k|                int subsampling_y, ConvolveParams *conv_params) {
  652|   180k|  const int32_t *const mat = wm->wmmat;
  653|   180k|  const int16_t alpha = wm->alpha;
  654|   180k|  const int16_t beta = wm->beta;
  655|   180k|  const int16_t gamma = wm->gamma;
  656|   180k|  const int16_t delta = wm->delta;
  657|   180k|  av1_warp_affine(mat, ref, width, height, stride, pred, p_col, p_row, p_width,
  658|   180k|                  p_height, p_stride, subsampling_x, subsampling_y, conv_params,
  659|   180k|                  alpha, beta, gamma, delta);
  660|   180k|}
av1_warp_plane:
  666|   207k|                    int subsampling_y, ConvolveParams *conv_params) {
  667|   207k|#if CONFIG_AV1_HIGHBITDEPTH
  668|   207k|  if (use_hbd)
  ------------------
  |  Branch (668:7): [True: 28.3k, False: 178k]
  ------------------
  669|  28.3k|    highbd_warp_plane(wm, CONVERT_TO_SHORTPTR(ref), width, height, stride,
  ------------------
  |  |   79|  28.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  670|  28.3k|                      CONVERT_TO_SHORTPTR(pred), p_col, p_row, p_width,
  ------------------
  |  |   79|  28.3k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  671|  28.3k|                      p_height, p_stride, subsampling_x, subsampling_y, bd,
  672|  28.3k|                      conv_params);
  673|   178k|  else
  674|   178k|    warp_plane(wm, ref, width, height, stride, pred, p_col, p_row, p_width,
  675|   178k|               p_height, p_stride, subsampling_x, subsampling_y, conv_params);
  676|       |#else
  677|       |  (void)use_hbd;
  678|       |  (void)bd;
  679|       |  warp_plane(wm, ref, width, height, stride, pred, p_col, p_row, p_width,
  680|       |             p_height, p_stride, subsampling_x, subsampling_y, conv_params);
  681|       |#endif
  682|   207k|}
av1_find_projection:
  908|   146k|                        WarpedMotionParams *wm_params, int mi_row, int mi_col) {
  909|   146k|  assert(wm_params->wmtype == AFFINE);
  910|       |
  911|   146k|  if (find_affine_int(np, pts1, pts2, bsize, mvy, mvx, wm_params, mi_row,
  ------------------
  |  Branch (911:7): [True: 3.71k, False: 143k]
  ------------------
  912|   146k|                      mi_col))
  913|  3.71k|    return 1;
  914|       |
  915|       |  // check compatibility with the fast warp filter
  916|   143k|  if (!av1_get_shear_params(wm_params)) return 1;
  ------------------
  |  Branch (916:7): [True: 8.75k, False: 134k]
  ------------------
  917|       |
  918|   134k|  return 0;
  919|   143k|}
warped_motion.c:is_affine_valid:
  205|   291k|static int is_affine_valid(const WarpedMotionParams *const wm) {
  206|   291k|  const int32_t *mat = wm->wmmat;
  207|   291k|  return (mat[2] > 0);
  208|   291k|}
warped_motion.c:resolve_divisor_32:
  189|   291k|static int16_t resolve_divisor_32(uint32_t D, int16_t *shift) {
  190|   291k|  int32_t f;
  191|   291k|  *shift = get_msb(D);
  192|       |  // e is obtained from D after resetting the most significant 1 bit.
  193|   291k|  const int32_t e = D - ((uint32_t)1 << *shift);
  194|       |  // Get the most significant DIV_LUT_BITS (8) bits of e into f
  195|   291k|  if (*shift > DIV_LUT_BITS)
  ------------------
  |  |  140|   291k|#define DIV_LUT_BITS 8
  ------------------
  |  Branch (195:7): [True: 291k, False: 10]
  ------------------
  196|   291k|    f = ROUND_POWER_OF_TWO(e, *shift - DIV_LUT_BITS);
  ------------------
  |  |   41|   291k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  197|     10|  else
  198|     10|    f = e << (DIV_LUT_BITS - *shift);
  ------------------
  |  |  140|     10|#define DIV_LUT_BITS 8
  ------------------
  199|   291k|  assert(f <= DIV_LUT_NUM);
  200|   291k|  *shift += DIV_LUT_PREC_BITS;
  ------------------
  |  |  139|   291k|#define DIV_LUT_PREC_BITS 14
  ------------------
  201|       |  // Use f as lookup into the precomputed table of multipliers
  202|   291k|  return div_lut[f];
  203|   291k|}
warped_motion.c:is_affine_shear_allowed:
  211|   291k|                                   int16_t delta) {
  212|   291k|  if ((4 * abs(alpha) + 7 * abs(beta) >= (1 << WARPEDMODEL_PREC_BITS)) ||
  ------------------
  |  |   96|   291k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  |  Branch (212:7): [True: 7.47k, False: 283k]
  ------------------
  213|   283k|      (4 * abs(gamma) + 4 * abs(delta) >= (1 << WARPEDMODEL_PREC_BITS)))
  ------------------
  |  |   96|   283k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  |  Branch (213:7): [True: 1.27k, False: 282k]
  ------------------
  214|  8.76k|    return 0;
  215|   282k|  else
  216|   282k|    return 1;
  217|   291k|}
warped_motion.c:find_affine_int:
  798|   146k|                           WarpedMotionParams *wm, int mi_row, int mi_col) {
  799|   146k|  int32_t A[2][2] = { { 0, 0 }, { 0, 0 } };
  800|   146k|  int32_t Bx[2] = { 0, 0 };
  801|   146k|  int32_t By[2] = { 0, 0 };
  802|       |
  803|   146k|  const int bw = block_size_wide[bsize];
  804|   146k|  const int bh = block_size_high[bsize];
  805|   146k|  const int rsuy = bh / 2 - 1;
  806|   146k|  const int rsux = bw / 2 - 1;
  807|   146k|  const int suy = rsuy * 8;
  808|   146k|  const int sux = rsux * 8;
  809|   146k|  const int duy = suy + mvy;
  810|   146k|  const int dux = sux + mvx;
  811|       |
  812|       |  // Assume the center pixel of the block has exactly the same motion vector
  813|       |  // as transmitted for the block. First shift the origin of the source
  814|       |  // points to the block center, and the origin of the destination points to
  815|       |  // the block center added to the motion vector transmitted.
  816|       |  // Let (xi, yi) denote the source points and (xi', yi') denote destination
  817|       |  // points after origin shfifting, for i = 0, 1, 2, .... n-1.
  818|       |  // Then if  P = [x0, y0,
  819|       |  //               x1, y1
  820|       |  //               x2, y1,
  821|       |  //                ....
  822|       |  //              ]
  823|       |  //          q = [x0', x1', x2', ... ]'
  824|       |  //          r = [y0', y1', y2', ... ]'
  825|       |  // the least squares problems that need to be solved are:
  826|       |  //          [h1, h2]' = inv(P'P)P'q and
  827|       |  //          [h3, h4]' = inv(P'P)P'r
  828|       |  // where the affine transformation is given by:
  829|       |  //          x' = h1.x + h2.y
  830|       |  //          y' = h3.x + h4.y
  831|       |  //
  832|       |  // The loop below computes: A = P'P, Bx = P'q, By = P'r
  833|       |  // We need to just compute inv(A).Bx and inv(A).By for the solutions.
  834|       |  // Contribution from neighbor block
  835|   314k|  for (int i = 0; i < np; i++) {
  ------------------
  |  Branch (835:19): [True: 167k, False: 146k]
  ------------------
  836|   167k|    const int dx = pts2[i * 2] - dux;
  837|   167k|    const int dy = pts2[i * 2 + 1] - duy;
  838|   167k|    const int sx = pts1[i * 2] - sux;
  839|   167k|    const int sy = pts1[i * 2 + 1] - suy;
  840|       |    // (TODO)yunqing: This comparison wouldn't be necessary if the sample
  841|       |    // selection is done in find_samples(). Also, global offset can be removed
  842|       |    // while collecting samples.
  843|   167k|    if (abs(sx - dx) < LS_MV_MAX && abs(sy - dy) < LS_MV_MAX) {
  ------------------
  |  |  684|   335k|#define LS_MV_MAX 256  // max mv in 1/8-pel
  ------------------
                  if (abs(sx - dx) < LS_MV_MAX && abs(sy - dy) < LS_MV_MAX) {
  ------------------
  |  |  684|   165k|#define LS_MV_MAX 256  // max mv in 1/8-pel
  ------------------
  |  Branch (843:9): [True: 165k, False: 2.09k]
  |  Branch (843:37): [True: 163k, False: 1.67k]
  ------------------
  844|   163k|      A[0][0] += LS_SQUARE(sx);
  ------------------
  |  |  710|   163k|  (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  711|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  845|   163k|      A[0][1] += LS_PRODUCT1(sx, sy);
  ------------------
  |  |  713|   163k|  (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  714|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  846|   163k|      A[1][1] += LS_SQUARE(sy);
  ------------------
  |  |  710|   163k|  (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (a) * 4 + (a) * 4 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  711|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  847|   163k|      Bx[0] += LS_PRODUCT2(sx, dx);
  ------------------
  |  |  716|   163k|  (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  717|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  848|   163k|      Bx[1] += LS_PRODUCT1(sy, dx);
  ------------------
  |  |  713|   163k|  (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  714|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  849|   163k|      By[0] += LS_PRODUCT1(sx, dy);
  ------------------
  |  |  713|   163k|  (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  714|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  850|   163k|      By[1] += LS_PRODUCT2(sy, dy);
  ------------------
  |  |  716|   163k|  (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |                 (((a) * (b) * 4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> \
  |  |  ------------------
  |  |  |  |  686|   163k|#define LS_STEP 8
  |  |  ------------------
  |  |  717|   163k|   (2 + LS_MAT_DOWN_BITS))
  |  |  ------------------
  |  |  |  |  700|   163k|#define LS_MAT_DOWN_BITS 2
  |  |  ------------------
  ------------------
  851|   163k|    }
  852|   167k|  }
  853|       |
  854|       |  // Just for debugging, and can be removed later.
  855|   146k|  assert(A[0][0] >= LS_MAT_MIN && A[0][0] <= LS_MAT_MAX);
  856|   146k|  assert(A[0][1] >= LS_MAT_MIN && A[0][1] <= LS_MAT_MAX);
  857|   146k|  assert(A[1][1] >= LS_MAT_MIN && A[1][1] <= LS_MAT_MAX);
  858|   146k|  assert(Bx[0] >= LS_MAT_MIN && Bx[0] <= LS_MAT_MAX);
  859|   146k|  assert(Bx[1] >= LS_MAT_MIN && Bx[1] <= LS_MAT_MAX);
  860|   146k|  assert(By[0] >= LS_MAT_MIN && By[0] <= LS_MAT_MAX);
  861|   146k|  assert(By[1] >= LS_MAT_MIN && By[1] <= LS_MAT_MAX);
  862|       |
  863|       |  // Compute Determinant of A
  864|   146k|  const int64_t Det = (int64_t)A[0][0] * A[1][1] - (int64_t)A[0][1] * A[0][1];
  865|   146k|  if (Det == 0) return 1;
  ------------------
  |  Branch (865:7): [True: 3.71k, False: 143k]
  ------------------
  866|       |
  867|   143k|  int16_t shift;
  868|   143k|  int16_t iDet = resolve_divisor_64(llabs(Det), &shift) * (Det < 0 ? -1 : 1);
  ------------------
  |  Branch (868:60): [True: 0, False: 143k]
  ------------------
  869|   143k|  shift -= WARPEDMODEL_PREC_BITS;
  ------------------
  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  870|   143k|  if (shift < 0) {
  ------------------
  |  Branch (870:7): [True: 0, False: 143k]
  ------------------
  871|      0|    iDet <<= (-shift);
  872|      0|    shift = 0;
  873|      0|  }
  874|       |
  875|   143k|  int64_t Px[2], Py[2];
  876|       |  // These divided by the Det, are the least squares solutions
  877|   143k|  Px[0] = (int64_t)A[1][1] * Bx[0] - (int64_t)A[0][1] * Bx[1];
  878|   143k|  Px[1] = -(int64_t)A[0][1] * Bx[0] + (int64_t)A[0][0] * Bx[1];
  879|   143k|  Py[0] = (int64_t)A[1][1] * By[0] - (int64_t)A[0][1] * By[1];
  880|   143k|  Py[1] = -(int64_t)A[0][1] * By[0] + (int64_t)A[0][0] * By[1];
  881|       |
  882|   143k|  wm->wmmat[2] = get_mult_shift_diag(Px[0], iDet, shift);
  883|   143k|  wm->wmmat[3] = get_mult_shift_ndiag(Px[1], iDet, shift);
  884|   143k|  wm->wmmat[4] = get_mult_shift_ndiag(Py[0], iDet, shift);
  885|   143k|  wm->wmmat[5] = get_mult_shift_diag(Py[1], iDet, shift);
  886|       |
  887|   143k|  const int isuy = (mi_row * MI_SIZE + rsuy);
  ------------------
  |  |   40|   143k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   143k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  888|   143k|  const int isux = (mi_col * MI_SIZE + rsux);
  ------------------
  |  |   40|   143k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   143k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  889|       |  // Note: In the vx, vy expressions below, the max value of each of the
  890|       |  // 2nd and 3rd terms are (2^16 - 1) * (2^13 - 1). That leaves enough room
  891|       |  // for the first term so that the overall sum in the worst case fits
  892|       |  // within 32 bits overall.
  893|   143k|  const int32_t vx = mvx * (1 << (WARPEDMODEL_PREC_BITS - 3)) -
  ------------------
  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  894|   143k|                     (isux * (wm->wmmat[2] - (1 << WARPEDMODEL_PREC_BITS)) +
  ------------------
  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  895|   143k|                      isuy * wm->wmmat[3]);
  896|   143k|  const int32_t vy = mvy * (1 << (WARPEDMODEL_PREC_BITS - 3)) -
  ------------------
  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  897|   143k|                     (isux * wm->wmmat[4] +
  898|   143k|                      isuy * (wm->wmmat[5] - (1 << WARPEDMODEL_PREC_BITS)));
  ------------------
  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  899|   143k|  wm->wmmat[0] =
  900|   143k|      clamp(vx, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1);
  ------------------
  |  |   98|   143k|#define WARPEDMODEL_TRANS_CLAMP (128 << WARPEDMODEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
                    clamp(vx, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1);
  ------------------
  |  |   98|   143k|#define WARPEDMODEL_TRANS_CLAMP (128 << WARPEDMODEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  901|   143k|  wm->wmmat[1] =
  902|   143k|      clamp(vy, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1);
  ------------------
  |  |   98|   143k|#define WARPEDMODEL_TRANS_CLAMP (128 << WARPEDMODEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
                    clamp(vy, -WARPEDMODEL_TRANS_CLAMP, WARPEDMODEL_TRANS_CLAMP - 1);
  ------------------
  |  |   98|   143k|#define WARPEDMODEL_TRANS_CLAMP (128 << WARPEDMODEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   143k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  903|   143k|  return 0;
  904|   146k|}
warped_motion.c:resolve_divisor_64:
  172|   143k|static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) {
  173|   143k|  int64_t f;
  174|   143k|  *shift = (int16_t)((D >> 32) ? get_msb((unsigned int)(D >> 32)) + 32
  ------------------
  |  Branch (174:22): [True: 3, False: 143k]
  ------------------
  175|   143k|                               : get_msb((unsigned int)D));
  176|       |  // e is obtained from D after resetting the most significant 1 bit.
  177|   143k|  const int64_t e = D - ((uint64_t)1 << *shift);
  178|       |  // Get the most significant DIV_LUT_BITS (8) bits of e into f
  179|   143k|  if (*shift > DIV_LUT_BITS)
  ------------------
  |  |  140|   143k|#define DIV_LUT_BITS 8
  ------------------
  |  Branch (179:7): [True: 143k, False: 18.4E]
  ------------------
  180|   143k|    f = ROUND_POWER_OF_TWO_64(e, *shift - DIV_LUT_BITS);
  ------------------
  |  |   53|   143k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  ------------------
  181|  18.4E|  else
  182|  18.4E|    f = e << (DIV_LUT_BITS - *shift);
  ------------------
  |  |  140|  18.4E|#define DIV_LUT_BITS 8
  ------------------
  183|   143k|  assert(f <= DIV_LUT_NUM);
  184|   143k|  *shift += DIV_LUT_PREC_BITS;
  ------------------
  |  |  139|   143k|#define DIV_LUT_PREC_BITS 14
  ------------------
  185|       |  // Use f as lookup into the precomputed table of multipliers
  186|   143k|  return div_lut[f];
  187|   143k|}
warped_motion.c:get_mult_shift_diag:
  787|   286k|static int32_t get_mult_shift_diag(int64_t Px, int16_t iDet, int shift) {
  788|   286k|  int64_t v = Px * (int64_t)iDet;
  789|   286k|  return (int32_t)clamp64(
  790|   286k|      ROUND_POWER_OF_TWO_SIGNED_64(v, shift),
  ------------------
  |  |   58|   286k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  14.6k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 14.6k, False: 271k]
  |  |  ------------------
  |  |   59|   286k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   271k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  791|   286k|      (1 << WARPEDMODEL_PREC_BITS) - WARPEDMODEL_NONDIAGAFFINE_CLAMP + 1,
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
                    (1 << WARPEDMODEL_PREC_BITS) - WARPEDMODEL_NONDIAGAFFINE_CLAMP + 1,
  ------------------
  |  |   99|   286k|#define WARPEDMODEL_NONDIAGAFFINE_CLAMP (1 << (WARPEDMODEL_PREC_BITS - 3))
  |  |  ------------------
  |  |  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  792|   286k|      (1 << WARPEDMODEL_PREC_BITS) + WARPEDMODEL_NONDIAGAFFINE_CLAMP - 1);
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
                    (1 << WARPEDMODEL_PREC_BITS) + WARPEDMODEL_NONDIAGAFFINE_CLAMP - 1);
  ------------------
  |  |   99|   286k|#define WARPEDMODEL_NONDIAGAFFINE_CLAMP (1 << (WARPEDMODEL_PREC_BITS - 3))
  |  |  ------------------
  |  |  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  793|   286k|}
warped_motion.c:get_mult_shift_ndiag:
  780|   286k|static int32_t get_mult_shift_ndiag(int64_t Px, int16_t iDet, int shift) {
  781|   286k|  int64_t v = Px * (int64_t)iDet;
  782|   286k|  return (int32_t)clamp64(ROUND_POWER_OF_TWO_SIGNED_64(v, shift),
  ------------------
  |  |   58|   286k|  (((value) < 0) ? -ROUND_POWER_OF_TWO_64(-(value), (n)) \
  |  |  ------------------
  |  |  |  |   53|  92.0k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (58:4): [True: 92.0k, False: 194k]
  |  |  ------------------
  |  |   59|   286k|                 : ROUND_POWER_OF_TWO_64((value), (n)))
  |  |  ------------------
  |  |  |  |   53|   194k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  783|   286k|                          -WARPEDMODEL_NONDIAGAFFINE_CLAMP + 1,
  ------------------
  |  |   99|   286k|#define WARPEDMODEL_NONDIAGAFFINE_CLAMP (1 << (WARPEDMODEL_PREC_BITS - 3))
  |  |  ------------------
  |  |  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  784|   286k|                          WARPEDMODEL_NONDIAGAFFINE_CLAMP - 1);
  ------------------
  |  |   99|   286k|#define WARPEDMODEL_NONDIAGAFFINE_CLAMP (1 << (WARPEDMODEL_PREC_BITS - 3))
  |  |  ------------------
  |  |  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
  785|   286k|}

av1_convolve_2d_scale_sse4_1:
  238|  36.2M|                                  ConvolveParams *conv_params) {
  239|  36.2M|  int16_t tmp[(2 * MAX_SB_SIZE + MAX_FILTER_TAP) * MAX_SB_SIZE];
  240|  36.2M|  int im_h = (((h - 1) * y_step_qn + subpel_y_qn) >> SCALE_SUBPEL_BITS) +
  ------------------
  |  |   28|  36.2M|#define SCALE_SUBPEL_BITS 10
  ------------------
  241|  36.2M|             filter_params_y->taps;
  242|       |
  243|  36.2M|  const int xtaps = filter_params_x->taps;
  244|  36.2M|  const int ytaps = filter_params_y->taps;
  245|  36.2M|  const int fo_vert = ytaps / 2 - 1;
  246|  36.2M|  assert((xtaps == 8) && (ytaps == 8));
  247|  36.2M|  (void)xtaps;
  248|       |
  249|       |  // horizontal filter
  250|  36.2M|  hfilter8(src - fo_vert * src_stride, src_stride, tmp, w, im_h, subpel_x_qn,
  251|  36.2M|           x_step_qn, filter_params_x, conv_params->round_0);
  252|       |
  253|       |  // vertical filter (input is transposed)
  254|  36.2M|  vfilter8(tmp, im_h, dst8, dst8_stride, w, h, subpel_y_qn, y_step_qn,
  255|  36.2M|           filter_params_y, conv_params, 8);
  256|  36.2M|}
av1_highbd_convolve_2d_scale_sse4_1:
  477|  16.2M|    ConvolveParams *conv_params, int bd) {
  478|       |  // TODO(yaowu): Move this out of stack
  479|  16.2M|  DECLARE_ALIGNED(16, int16_t,
  ------------------
  |  |   19|  16.2M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  480|  16.2M|                  tmp[(2 * MAX_SB_SIZE + MAX_FILTER_TAP) * MAX_SB_SIZE]);
  481|  16.2M|  int im_h = (((h - 1) * y_step_qn + subpel_y_qn) >> SCALE_SUBPEL_BITS) +
  ------------------
  |  |   28|  16.2M|#define SCALE_SUBPEL_BITS 10
  ------------------
  482|  16.2M|             filter_params_y->taps;
  483|  16.2M|  const int xtaps = filter_params_x->taps;
  484|  16.2M|  const int ytaps = filter_params_y->taps;
  485|  16.2M|  const int fo_vert = ytaps / 2 - 1;
  486|       |
  487|  16.2M|  memset(tmp, 0, sizeof(tmp));
  488|  16.2M|  assert((xtaps == 8) && (ytaps == 8));
  489|  16.2M|  (void)xtaps;
  490|       |
  491|       |  // horizontal filter
  492|  16.2M|  highbd_hfilter8(src - fo_vert * src_stride, src_stride, tmp, w, im_h,
  493|  16.2M|                  subpel_x_qn, x_step_qn, filter_params_x, conv_params->round_0,
  494|  16.2M|                  bd);
  495|       |
  496|       |  // vertical filter (input is transposed)
  497|  16.2M|  highbd_vfilter8(tmp, im_h, dst, dst_stride, w, h, subpel_y_qn, y_step_qn,
  498|  16.2M|                  filter_params_y, conv_params, bd);
  499|  16.2M|}
av1_convolve_scale_sse4.c:hfilter8:
   25|  36.2M|                     const InterpFilterParams *filter_params, int round) {
   26|  36.2M|  const int bd = 8;
   27|  36.2M|  const int ntaps = 8;
   28|       |
   29|  36.2M|  src -= ntaps / 2 - 1;
   30|       |
   31|  36.2M|  int32_t round_add32 = (1 << round) / 2 + (1 << (bd + FILTER_BITS - 1));
  ------------------
  |  |   21|  36.2M|#define FILTER_BITS 7
  ------------------
   32|  36.2M|  const __m128i round_add = _mm_set1_epi32(round_add32);
   33|  36.2M|  const __m128i round_shift = _mm_cvtsi32_si128(round);
   34|       |
   35|  36.2M|  int x_qn = subpel_x_qn;
   36|   326M|  for (int x = 0; x < w; ++x, x_qn += x_step_qn) {
  ------------------
  |  Branch (36:19): [True: 290M, False: 36.2M]
  ------------------
   37|   290M|    const uint8_t *const src_col = src + (x_qn >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|   290M|#define SCALE_SUBPEL_BITS 10
  ------------------
   38|   290M|    const int filter_idx = (x_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   30|   290M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   290M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   290M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const int filter_idx = (x_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   290M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   290M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   290M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
   39|   290M|    assert(filter_idx < SUBPEL_SHIFTS);
   40|   290M|    const int16_t *filter =
   41|   290M|        av1_get_interp_filter_subpel_kernel(filter_params, filter_idx);
   42|       |
   43|       |    // Load the filter coefficients
   44|   290M|    const __m128i coefflo = _mm_loadu_si128((__m128i *)filter);
   45|   290M|    const __m128i zero = _mm_castps_si128(_mm_setzero_ps());
   46|       |
   47|   290M|    int y;
   48|  1.24G|    for (y = 0; y <= h - 4; y += 4) {
  ------------------
  |  Branch (48:17): [True: 950M, False: 290M]
  ------------------
   49|   950M|      const uint8_t *const src0 = src_col + y * src_stride;
   50|   950M|      const uint8_t *const src1 = src0 + 1 * src_stride;
   51|   950M|      const uint8_t *const src2 = src0 + 2 * src_stride;
   52|   950M|      const uint8_t *const src3 = src0 + 3 * src_stride;
   53|       |
   54|       |      // Load up source data. This is 8-bit input data; each load is just
   55|       |      // loading the lower half of the register and gets 8 pixels
   56|   950M|      const __m128i data08 = _mm_loadl_epi64((__m128i *)src0);
   57|   950M|      const __m128i data18 = _mm_loadl_epi64((__m128i *)src1);
   58|   950M|      const __m128i data28 = _mm_loadl_epi64((__m128i *)src2);
   59|   950M|      const __m128i data38 = _mm_loadl_epi64((__m128i *)src3);
   60|       |
   61|       |      // Now zero-extend up to 16-bit precision by interleaving with
   62|       |      // zeros. Drop the upper half of each register (which just had zeros)
   63|   950M|      const __m128i data0lo = _mm_unpacklo_epi8(data08, zero);
   64|   950M|      const __m128i data1lo = _mm_unpacklo_epi8(data18, zero);
   65|   950M|      const __m128i data2lo = _mm_unpacklo_epi8(data28, zero);
   66|   950M|      const __m128i data3lo = _mm_unpacklo_epi8(data38, zero);
   67|       |
   68|       |      // Multiply by coefficients
   69|   950M|      const __m128i conv0lo = _mm_madd_epi16(data0lo, coefflo);
   70|   950M|      const __m128i conv1lo = _mm_madd_epi16(data1lo, coefflo);
   71|   950M|      const __m128i conv2lo = _mm_madd_epi16(data2lo, coefflo);
   72|   950M|      const __m128i conv3lo = _mm_madd_epi16(data3lo, coefflo);
   73|       |
   74|       |      // Reduce horizontally and add
   75|   950M|      const __m128i conv01lo = _mm_hadd_epi32(conv0lo, conv1lo);
   76|   950M|      const __m128i conv23lo = _mm_hadd_epi32(conv2lo, conv3lo);
   77|   950M|      const __m128i conv = _mm_hadd_epi32(conv01lo, conv23lo);
   78|       |
   79|       |      // Divide down by (1 << round), rounding to nearest.
   80|   950M|      __m128i shifted =
   81|   950M|          _mm_sra_epi32(_mm_add_epi32(conv, round_add), round_shift);
   82|       |
   83|   950M|      shifted = _mm_packus_epi32(shifted, shifted);
   84|       |      // Write transposed to the output
   85|   950M|      _mm_storel_epi64((__m128i *)(dst + y + x * h), shifted);
   86|   950M|    }
   87|   769M|    for (; y < h; ++y) {
  ------------------
  |  Branch (87:12): [True: 479M, False: 290M]
  ------------------
   88|   479M|      const uint8_t *const src_row = src_col + y * src_stride;
   89|       |
   90|   479M|      int32_t sum = (1 << (bd + FILTER_BITS - 1));
  ------------------
  |  |   21|   479M|#define FILTER_BITS 7
  ------------------
   91|  4.30G|      for (int k = 0; k < ntaps; ++k) {
  ------------------
  |  Branch (91:23): [True: 3.82G, False: 479M]
  ------------------
   92|  3.82G|        sum += filter[k] * src_row[k];
   93|  3.82G|      }
   94|       |
   95|   479M|      dst[y + x * h] = ROUND_POWER_OF_TWO(sum, round);
  ------------------
  |  |   41|   479M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   96|   479M|    }
   97|   290M|  }
   98|  36.2M|}
av1_convolve_scale_sse4.c:vfilter8:
  110|  36.3M|                     const ConvolveParams *conv_params, int bd) {
  111|  36.3M|  const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|  36.3M|#define FILTER_BITS 7
  ------------------
  112|  36.3M|  const int ntaps = 8;
  113|       |
  114|  36.3M|  const __m128i round_shift = _mm_cvtsi32_si128(conv_params->round_1);
  115|       |
  116|  36.3M|  const int32_t sub32 = ((1 << (offset_bits - conv_params->round_1)) +
  117|  36.3M|                         (1 << (offset_bits - conv_params->round_1 - 1)));
  118|  36.3M|  const __m128i sub = _mm_set1_epi16(sub32);
  119|       |
  120|  36.3M|  CONV_BUF_TYPE *dst16 = conv_params->dst;
  121|  36.3M|  const int dst16_stride = conv_params->dst_stride;
  122|  36.3M|  const int bits =
  123|  36.3M|      FILTER_BITS * 2 - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|  36.3M|#define FILTER_BITS 7
  ------------------
  124|  36.3M|  const __m128i bits_shift = _mm_cvtsi32_si128(bits);
  125|  36.3M|  const __m128i bits_const = _mm_set1_epi16(((1 << bits) >> 1));
  126|  36.3M|  const __m128i round_shift_add =
  127|  36.3M|      _mm_set1_epi32(((1 << conv_params->round_1) >> 1));
  128|  36.3M|  const __m128i res_add_const = _mm_set1_epi32(1 << offset_bits);
  129|       |
  130|  36.3M|  const int w0 = conv_params->fwd_offset;
  131|  36.3M|  const int w1 = conv_params->bck_offset;
  132|  36.3M|  const __m128i wt0 = _mm_set1_epi16((short)w0);
  133|  36.3M|  const __m128i wt1 = _mm_set1_epi16((short)w1);
  134|  36.3M|  const __m128i wt = _mm_unpacklo_epi16(wt0, wt1);
  135|       |
  136|  36.3M|  int y_qn = subpel_y_qn;
  137|   331M|  for (int y = 0; y < h; ++y, y_qn += y_step_qn) {
  ------------------
  |  Branch (137:19): [True: 295M, False: 36.3M]
  ------------------
  138|   295M|    const int16_t *src_y = src + (y_qn >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|   295M|#define SCALE_SUBPEL_BITS 10
  ------------------
  139|   295M|    const int filter_idx = (y_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   30|   295M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   295M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   295M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const int filter_idx = (y_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|   295M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   295M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|   295M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  140|   295M|    assert(filter_idx < SUBPEL_SHIFTS);
  141|   295M|    const int16_t *filter =
  142|   295M|        av1_get_interp_filter_subpel_kernel(filter_params, filter_idx);
  143|       |
  144|   295M|    const __m128i coeff0716 = _mm_loadu_si128((__m128i *)filter);
  145|   295M|    int x;
  146|  1.03G|    for (x = 0; x <= w - 4; x += 4) {
  ------------------
  |  Branch (146:17): [True: 742M, False: 295M]
  ------------------
  147|   742M|      const int16_t *const src0 = src_y + x * src_stride;
  148|   742M|      const int16_t *const src1 = src0 + 1 * src_stride;
  149|   742M|      const int16_t *const src2 = src0 + 2 * src_stride;
  150|   742M|      const int16_t *const src3 = src0 + 3 * src_stride;
  151|       |
  152|       |      // Load the source data for the three rows, adding the three registers of
  153|       |      // convolved products to one as we go (conv0..conv3) to avoid the
  154|       |      // register pressure getting too high.
  155|   742M|      const __m128i conv0 = convolve_16_8(src0, coeff0716);
  156|   742M|      const __m128i conv1 = convolve_16_8(src1, coeff0716);
  157|   742M|      const __m128i conv2 = convolve_16_8(src2, coeff0716);
  158|   742M|      const __m128i conv3 = convolve_16_8(src3, coeff0716);
  159|       |
  160|       |      // Now reduce horizontally to get one lane for each result
  161|   742M|      const __m128i conv01 = _mm_hadd_epi32(conv0, conv1);
  162|   742M|      const __m128i conv23 = _mm_hadd_epi32(conv2, conv3);
  163|   742M|      __m128i conv = _mm_hadd_epi32(conv01, conv23);
  164|       |
  165|   742M|      conv = _mm_add_epi32(conv, res_add_const);
  166|       |      // Divide down by (1 << round_1), rounding to nearest and subtract sub32.
  167|   742M|      __m128i shifted =
  168|   742M|          _mm_sra_epi32(_mm_add_epi32(conv, round_shift_add), round_shift);
  169|       |
  170|   742M|      uint8_t *dst_x = dst + y * dst_stride + x;
  171|   742M|      __m128i result;
  172|   742M|      __m128i shifted_16 = _mm_packus_epi32(shifted, shifted);
  173|       |
  174|   742M|      if (conv_params->is_compound) {
  ------------------
  |  Branch (174:11): [True: 0, False: 742M]
  ------------------
  175|      0|        CONV_BUF_TYPE *dst_16_x = dst16 + y * dst16_stride + x;
  176|      0|        if (conv_params->do_average) {
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|          const __m128i p_16 = _mm_loadl_epi64((__m128i *)dst_16_x);
  178|      0|          if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (178:15): [True: 0, False: 0]
  ------------------
  179|      0|            const __m128i p_16_lo = _mm_unpacklo_epi16(p_16, shifted_16);
  180|      0|            const __m128i wt_res_lo = _mm_madd_epi16(p_16_lo, wt);
  181|      0|            const __m128i shifted_32 =
  182|      0|                _mm_srai_epi32(wt_res_lo, DIST_PRECISION_BITS);
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  183|      0|            shifted_16 = _mm_packus_epi32(shifted_32, shifted_32);
  184|      0|          } else {
  185|      0|            shifted_16 = _mm_srai_epi16(_mm_add_epi16(p_16, shifted_16), 1);
  186|      0|          }
  187|      0|          const __m128i subbed = _mm_sub_epi16(shifted_16, sub);
  188|      0|          result = _mm_sra_epi16(_mm_add_epi16(subbed, bits_const), bits_shift);
  189|      0|          const __m128i result_8 = _mm_packus_epi16(result, result);
  190|      0|          *(int *)dst_x = _mm_cvtsi128_si32(result_8);
  191|      0|        } else {
  192|      0|          _mm_storel_epi64((__m128i *)dst_16_x, shifted_16);
  193|      0|        }
  194|   742M|      } else {
  195|   742M|        const __m128i subbed = _mm_sub_epi16(shifted_16, sub);
  196|   742M|        result = _mm_sra_epi16(_mm_add_epi16(subbed, bits_const), bits_shift);
  197|   742M|        const __m128i result_8 = _mm_packus_epi16(result, result);
  198|   742M|        *(int *)dst_x = _mm_cvtsi128_si32(result_8);
  199|   742M|      }
  200|   742M|    }
  201|   295M|    for (; x < w; ++x) {
  ------------------
  |  Branch (201:12): [True: 0, False: 295M]
  ------------------
  202|      0|      const int16_t *src_x = src_y + x * src_stride;
  203|      0|      int32_t sum = 1 << offset_bits;
  204|      0|      for (int k = 0; k < ntaps; ++k) sum += filter[k] * src_x[k];
  ------------------
  |  Branch (204:23): [True: 0, False: 0]
  ------------------
  205|      0|      CONV_BUF_TYPE res = ROUND_POWER_OF_TWO(sum, conv_params->round_1);
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  206|       |
  207|      0|      if (conv_params->is_compound) {
  ------------------
  |  Branch (207:11): [True: 0, False: 0]
  ------------------
  208|      0|        if (conv_params->do_average) {
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|          int32_t tmp = dst16[y * dst16_stride + x];
  210|      0|          if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (210:15): [True: 0, False: 0]
  ------------------
  211|      0|            tmp = tmp * conv_params->fwd_offset + res * conv_params->bck_offset;
  212|      0|            tmp = tmp >> DIST_PRECISION_BITS;
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  213|      0|          } else {
  214|      0|            tmp += res;
  215|      0|            tmp = tmp >> 1;
  216|      0|          }
  217|       |          /* Subtract round offset and convolve round */
  218|      0|          tmp = tmp - sub32;
  219|      0|          dst[y * dst_stride + x] = clip_pixel(ROUND_POWER_OF_TWO(tmp, bits));
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  220|      0|        } else {
  221|      0|          dst16[y * dst16_stride + x] = res;
  222|      0|        }
  223|      0|      } else {
  224|       |        /* Subtract round offset and convolve round */
  225|      0|        int32_t tmp = res - ((1 << (offset_bits - conv_params->round_1)) +
  226|      0|                             (1 << (offset_bits - conv_params->round_1 - 1)));
  227|      0|        dst[y * dst_stride + x] = clip_pixel(ROUND_POWER_OF_TWO(tmp, bits));
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  228|      0|      }
  229|      0|    }
  230|   295M|  }
  231|  36.3M|}
av1_convolve_scale_sse4.c:convolve_16_8:
  100|  3.63G|static __m128i convolve_16_8(const int16_t *src, __m128i coeff) {
  101|  3.63G|  __m128i data = _mm_loadu_si128((__m128i *)src);
  102|  3.63G|  return _mm_madd_epi16(data, coeff);
  103|  3.63G|}
av1_convolve_scale_sse4.c:highbd_hfilter8:
  265|  16.2M|                            int bd) {
  266|  16.2M|  const int ntaps = 8;
  267|       |
  268|  16.2M|  src -= ntaps / 2 - 1;
  269|       |
  270|  16.2M|  int32_t round_add32 = (1 << round) / 2 + (1 << (bd + FILTER_BITS - 1));
  ------------------
  |  |   21|  16.2M|#define FILTER_BITS 7
  ------------------
  271|  16.2M|  const __m128i round_add = _mm_set1_epi32(round_add32);
  272|  16.2M|  const __m128i round_shift = _mm_cvtsi32_si128(round);
  273|       |
  274|  16.2M|  int x_qn = subpel_x_qn;
  275|   110M|  for (int x = 0; x < w; ++x, x_qn += x_step_qn) {
  ------------------
  |  Branch (275:19): [True: 94.5M, False: 16.2M]
  ------------------
  276|  94.5M|    const uint16_t *const src_col = src + (x_qn >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|  94.5M|#define SCALE_SUBPEL_BITS 10
  ------------------
  277|  94.5M|    const int filter_idx = (x_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   30|  94.5M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  94.5M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  94.5M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const int filter_idx = (x_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  94.5M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  94.5M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  94.5M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  278|  94.5M|    assert(filter_idx < SUBPEL_SHIFTS);
  279|  94.5M|    const int16_t *filter =
  280|  94.5M|        av1_get_interp_filter_subpel_kernel(filter_params, filter_idx);
  281|       |
  282|       |    // Load the filter coefficients
  283|  94.5M|    const __m128i coefflo = _mm_loadu_si128((__m128i *)filter);
  284|       |
  285|  94.5M|    int y;
  286|   340M|    for (y = 0; y <= h - 4; y += 4) {
  ------------------
  |  Branch (286:17): [True: 245M, False: 94.5M]
  ------------------
  287|   245M|      const uint16_t *const src0 = src_col + y * src_stride;
  288|   245M|      const uint16_t *const src1 = src0 + 1 * src_stride;
  289|   245M|      const uint16_t *const src2 = src0 + 2 * src_stride;
  290|   245M|      const uint16_t *const src3 = src0 + 3 * src_stride;
  291|       |
  292|       |      // Load up source data. This is 16-bit input data, so each load gets the 8
  293|       |      // pixels we need.
  294|   245M|      const __m128i data0lo = _mm_loadu_si128((__m128i *)src0);
  295|   245M|      const __m128i data1lo = _mm_loadu_si128((__m128i *)src1);
  296|   245M|      const __m128i data2lo = _mm_loadu_si128((__m128i *)src2);
  297|   245M|      const __m128i data3lo = _mm_loadu_si128((__m128i *)src3);
  298|       |
  299|       |      // Multiply by coefficients
  300|   245M|      const __m128i conv0lo = _mm_madd_epi16(data0lo, coefflo);
  301|   245M|      const __m128i conv1lo = _mm_madd_epi16(data1lo, coefflo);
  302|   245M|      const __m128i conv2lo = _mm_madd_epi16(data2lo, coefflo);
  303|   245M|      const __m128i conv3lo = _mm_madd_epi16(data3lo, coefflo);
  304|       |
  305|       |      // Reduce horizontally and add
  306|   245M|      const __m128i conv01lo = _mm_hadd_epi32(conv0lo, conv1lo);
  307|   245M|      const __m128i conv23lo = _mm_hadd_epi32(conv2lo, conv3lo);
  308|   245M|      const __m128i conv = _mm_hadd_epi32(conv01lo, conv23lo);
  309|       |
  310|       |      // Divide down by (1 << round), rounding to nearest.
  311|   245M|      __m128i shifted =
  312|   245M|          _mm_sra_epi32(_mm_add_epi32(conv, round_add), round_shift);
  313|       |
  314|   245M|      shifted = _mm_packus_epi32(shifted, shifted);
  315|       |      // Write transposed to the output
  316|   245M|      _mm_storel_epi64((__m128i *)(dst + y + x * h), shifted);
  317|   245M|    }
  318|   273M|    for (; y < h; ++y) {
  ------------------
  |  Branch (318:12): [True: 178M, False: 94.5M]
  ------------------
  319|   178M|      const uint16_t *const src_row = src_col + y * src_stride;
  320|       |
  321|   178M|      int32_t sum = (1 << (bd + FILTER_BITS - 1));
  ------------------
  |  |   21|   178M|#define FILTER_BITS 7
  ------------------
  322|  1.60G|      for (int k = 0; k < ntaps; ++k) {
  ------------------
  |  Branch (322:23): [True: 1.42G, False: 178M]
  ------------------
  323|  1.42G|        sum += filter[k] * src_row[k];
  324|  1.42G|      }
  325|       |
  326|   178M|      dst[y + x * h] = ROUND_POWER_OF_TWO(sum, round);
  ------------------
  |  |   41|   178M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  327|   178M|    }
  328|  94.5M|  }
  329|  16.2M|}
av1_convolve_scale_sse4.c:highbd_vfilter8:
  337|  16.2M|                            const ConvolveParams *conv_params, int bd) {
  338|  16.2M|  const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|  16.2M|#define FILTER_BITS 7
  ------------------
  339|  16.2M|  const int ntaps = 8;
  340|       |
  341|  16.2M|  const __m128i round_shift = _mm_cvtsi32_si128(conv_params->round_1);
  342|       |
  343|  16.2M|  const int32_t sub32 = ((1 << (offset_bits - conv_params->round_1)) +
  344|  16.2M|                         (1 << (offset_bits - conv_params->round_1 - 1)));
  345|  16.2M|  const __m128i sub = _mm_set1_epi32(sub32);
  346|       |
  347|  16.2M|  CONV_BUF_TYPE *dst16 = conv_params->dst;
  348|  16.2M|  const int dst16_stride = conv_params->dst_stride;
  349|  16.2M|  const __m128i clip_pixel_ =
  350|  16.2M|      _mm_set1_epi16(bd == 10 ? 1023 : (bd == 12 ? 4095 : 255));
  ------------------
  |  Branch (350:22): [True: 7.79M, False: 8.49M]
  |  Branch (350:41): [True: 8.49M, False: 3.20k]
  ------------------
  351|  16.2M|  const int bits =
  352|  16.2M|      FILTER_BITS * 2 - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|  16.2M|#define FILTER_BITS 7
  ------------------
  353|  16.2M|  const __m128i bits_shift = _mm_cvtsi32_si128(bits);
  354|  16.2M|  const __m128i bits_const = _mm_set1_epi32(((1 << bits) >> 1));
  355|  16.2M|  const __m128i round_shift_add =
  356|  16.2M|      _mm_set1_epi32(((1 << conv_params->round_1) >> 1));
  357|  16.2M|  const __m128i res_add_const = _mm_set1_epi32(1 << offset_bits);
  358|  16.2M|  const int round_bits =
  359|  16.2M|      2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|  16.2M|#define FILTER_BITS 7
  ------------------
  360|  16.2M|  __m128i round_bits_shift = _mm_cvtsi32_si128(round_bits);
  361|  16.2M|  __m128i round_bits_const = _mm_set1_epi32(((1 << round_bits) >> 1));
  362|       |
  363|  16.2M|  const int w0 = conv_params->fwd_offset;
  364|  16.2M|  const int w1 = conv_params->bck_offset;
  365|  16.2M|  const __m128i wt0 = _mm_set1_epi32(w0);
  366|  16.2M|  const __m128i wt1 = _mm_set1_epi32(w1);
  367|       |
  368|  16.2M|  int y_qn = subpel_y_qn;
  369|   110M|  for (int y = 0; y < h; ++y, y_qn += y_step_qn) {
  ------------------
  |  Branch (369:19): [True: 94.4M, False: 16.2M]
  ------------------
  370|  94.4M|    const int16_t *src_y = src + (y_qn >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|  94.4M|#define SCALE_SUBPEL_BITS 10
  ------------------
  371|  94.4M|    const int filter_idx = (y_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   30|  94.4M|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|  94.4M|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  94.4M|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const int filter_idx = (y_qn & SCALE_SUBPEL_MASK) >> SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  94.4M|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  94.4M|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  94.4M|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  372|  94.4M|    assert(filter_idx < SUBPEL_SHIFTS);
  373|  94.4M|    const int16_t *filter =
  374|  94.4M|        av1_get_interp_filter_subpel_kernel(filter_params, filter_idx);
  375|       |
  376|  94.4M|    const __m128i coeff0716 = _mm_loadu_si128((__m128i *)filter);
  377|  94.4M|    int x;
  378|   260M|    for (x = 0; x <= w - 4; x += 4) {
  ------------------
  |  Branch (378:17): [True: 166M, False: 94.4M]
  ------------------
  379|   166M|      const int16_t *const src0 = src_y + x * src_stride;
  380|   166M|      const int16_t *const src1 = src0 + 1 * src_stride;
  381|   166M|      const int16_t *const src2 = src0 + 2 * src_stride;
  382|   166M|      const int16_t *const src3 = src0 + 3 * src_stride;
  383|       |
  384|       |      // Load the source data for the three rows, adding the three registers of
  385|       |      // convolved products to one as we go (conv0..conv3) to avoid the
  386|       |      // register pressure getting too high.
  387|   166M|      const __m128i conv0 = convolve_16_8(src0, coeff0716);
  388|   166M|      const __m128i conv1 = convolve_16_8(src1, coeff0716);
  389|   166M|      const __m128i conv2 = convolve_16_8(src2, coeff0716);
  390|   166M|      const __m128i conv3 = convolve_16_8(src3, coeff0716);
  391|       |
  392|       |      // Now reduce horizontally to get one lane for each result
  393|   166M|      const __m128i conv01 = _mm_hadd_epi32(conv0, conv1);
  394|   166M|      const __m128i conv23 = _mm_hadd_epi32(conv2, conv3);
  395|   166M|      __m128i conv = _mm_hadd_epi32(conv01, conv23);
  396|   166M|      conv = _mm_add_epi32(conv, res_add_const);
  397|       |
  398|       |      // Divide down by (1 << round_1), rounding to nearest and subtract sub32.
  399|   166M|      __m128i shifted =
  400|   166M|          _mm_sra_epi32(_mm_add_epi32(conv, round_shift_add), round_shift);
  401|       |
  402|   166M|      uint16_t *dst_x = dst + y * dst_stride + x;
  403|       |
  404|   166M|      __m128i result;
  405|   166M|      if (conv_params->is_compound) {
  ------------------
  |  Branch (405:11): [True: 0, False: 166M]
  ------------------
  406|      0|        CONV_BUF_TYPE *dst_16_x = dst16 + y * dst16_stride + x;
  407|      0|        if (conv_params->do_average) {
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|          __m128i p_32 =
  409|      0|              _mm_cvtepu16_epi32(_mm_loadl_epi64((__m128i *)dst_16_x));
  410|       |
  411|      0|          if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (411:15): [True: 0, False: 0]
  ------------------
  412|      0|            shifted = _mm_add_epi32(_mm_mullo_epi32(p_32, wt0),
  413|      0|                                    _mm_mullo_epi32(shifted, wt1));
  414|      0|            shifted = _mm_srai_epi32(shifted, DIST_PRECISION_BITS);
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  415|      0|          } else {
  416|      0|            shifted = _mm_srai_epi32(_mm_add_epi32(p_32, shifted), 1);
  417|      0|          }
  418|      0|          result = _mm_sub_epi32(shifted, sub);
  419|      0|          result = _mm_sra_epi32(_mm_add_epi32(result, round_bits_const),
  420|      0|                                 round_bits_shift);
  421|       |
  422|      0|          result = _mm_packus_epi32(result, result);
  423|      0|          result = _mm_min_epi16(result, clip_pixel_);
  424|      0|          _mm_storel_epi64((__m128i *)dst_x, result);
  425|      0|        } else {
  426|      0|          __m128i shifted_16 = _mm_packus_epi32(shifted, shifted);
  427|      0|          _mm_storel_epi64((__m128i *)dst_16_x, shifted_16);
  428|      0|        }
  429|   166M|      } else {
  430|   166M|        result = _mm_sub_epi32(shifted, sub);
  431|   166M|        result = _mm_sra_epi16(_mm_add_epi32(result, bits_const), bits_shift);
  432|   166M|        result = _mm_packus_epi32(result, result);
  433|   166M|        result = _mm_min_epi16(result, clip_pixel_);
  434|   166M|        _mm_storel_epi64((__m128i *)dst_x, result);
  435|   166M|      }
  436|   166M|    }
  437|       |
  438|  95.2M|    for (; x < w; ++x) {
  ------------------
  |  Branch (438:12): [True: 827k, False: 94.4M]
  ------------------
  439|   827k|      const int16_t *src_x = src_y + x * src_stride;
  440|   827k|      int32_t sum = 1 << offset_bits;
  441|  7.44M|      for (int k = 0; k < ntaps; ++k) sum += filter[k] * src_x[k];
  ------------------
  |  Branch (441:23): [True: 6.61M, False: 827k]
  ------------------
  442|   827k|      CONV_BUF_TYPE res = ROUND_POWER_OF_TWO(sum, conv_params->round_1);
  ------------------
  |  |   41|   827k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  443|   827k|      if (conv_params->is_compound) {
  ------------------
  |  Branch (443:11): [True: 0, False: 827k]
  ------------------
  444|      0|        if (conv_params->do_average) {
  ------------------
  |  Branch (444:13): [True: 0, False: 0]
  ------------------
  445|      0|          int32_t tmp = dst16[y * dst16_stride + x];
  446|      0|          if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (446:15): [True: 0, False: 0]
  ------------------
  447|      0|            tmp = tmp * conv_params->fwd_offset + res * conv_params->bck_offset;
  448|      0|            tmp = tmp >> DIST_PRECISION_BITS;
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  449|      0|          } else {
  450|      0|            tmp += res;
  451|      0|            tmp = tmp >> 1;
  452|      0|          }
  453|       |          /* Subtract round offset and convolve round */
  454|      0|          tmp = tmp - ((1 << (offset_bits - conv_params->round_1)) +
  455|      0|                       (1 << (offset_bits - conv_params->round_1 - 1)));
  456|      0|          dst[y * dst_stride + x] =
  457|      0|              clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, bits), bd);
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  458|      0|        } else {
  459|      0|          dst16[y * dst16_stride + x] = res;
  460|      0|        }
  461|   827k|      } else {
  462|       |        /* Subtract round offset and convolve round */
  463|   827k|        int32_t tmp = res - ((1 << (offset_bits - conv_params->round_1)) +
  464|   827k|                             (1 << (offset_bits - conv_params->round_1 - 1)));
  465|   827k|        dst[y * dst_stride + x] =
  466|   827k|            clip_pixel_highbd(ROUND_POWER_OF_TWO(tmp, bits), bd);
  ------------------
  |  |   41|   827k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  467|   827k|      }
  468|   827k|    }
  469|  94.4M|  }
  470|  16.2M|}

av1_lowbd_inv_txfm2d_add_avx2:
 2215|  55.8M|                                   int eob) {
 2216|  55.8M|  switch (tx_size) {
 2217|  27.7M|    case TX_4X4:
  ------------------
  |  Branch (2217:5): [True: 27.7M, False: 28.0M]
  ------------------
 2218|  32.5M|    case TX_4X8:
  ------------------
  |  Branch (2218:5): [True: 4.73M, False: 51.0M]
  ------------------
 2219|  32.7M|    case TX_8X4:
  ------------------
  |  Branch (2219:5): [True: 204k, False: 55.6M]
  ------------------
 2220|  33.3M|    case TX_8X16:
  ------------------
  |  Branch (2220:5): [True: 599k, False: 55.2M]
  ------------------
 2221|  33.7M|    case TX_16X8:
  ------------------
  |  Branch (2221:5): [True: 391k, False: 55.4M]
  ------------------
 2222|  33.7M|    case TX_4X16:
  ------------------
  |  Branch (2222:5): [True: 0, False: 55.8M]
  ------------------
 2223|  33.7M|    case TX_16X4:
  ------------------
  |  Branch (2223:5): [True: 0, False: 55.8M]
  ------------------
 2224|  33.7M|    case TX_8X32:
  ------------------
  |  Branch (2224:5): [True: 0, False: 55.8M]
  ------------------
 2225|  33.7M|    case TX_32X8:
  ------------------
  |  Branch (2225:5): [True: 0, False: 55.8M]
  ------------------
 2226|  33.7M|      av1_lowbd_inv_txfm2d_add_ssse3(input, output, stride, tx_type, tx_size,
 2227|  33.7M|                                     eob);
 2228|  33.7M|      break;
 2229|  21.3M|    case TX_8X8:
  ------------------
  |  Branch (2229:5): [True: 21.3M, False: 34.5M]
  ------------------
 2230|  21.3M|      lowbd_inv_txfm2d_add_8x8_avx2(input, output, stride, tx_type, tx_size,
 2231|  21.3M|                                    eob);
 2232|  21.3M|      break;
 2233|  1.09M|    default:
  ------------------
  |  Branch (2233:5): [True: 1.09M, False: 54.7M]
  ------------------
 2234|       |      assert(tx_size < TX_SIZES_ALL);
 2235|  1.09M|      lowbd_inv_txfm2d_add_universe_avx2(input, output, stride, tx_type,
 2236|  1.09M|                                         tx_size, eob);
 2237|  1.09M|      break;
 2238|  55.8M|  }
 2239|  55.8M|}
av1_inv_txfm_add_avx2:
 2242|  59.1M|                           const TxfmParam *txfm_param) {
 2243|  59.1M|  const TX_TYPE tx_type = txfm_param->tx_type;
 2244|  59.1M|  if (!txfm_param->lossless) {
  ------------------
  |  Branch (2244:7): [True: 55.8M, False: 3.33M]
  ------------------
 2245|  55.8M|    av1_lowbd_inv_txfm2d_add_avx2(dqcoeff, dst, stride, tx_type,
 2246|  55.8M|                                  txfm_param->tx_size, txfm_param->eob);
 2247|  55.8M|  } else {
 2248|  3.33M|    av1_inv_txfm_add_c(dqcoeff, dst, stride, txfm_param);
 2249|  3.33M|  }
 2250|  59.1M|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_8x8_avx2:
 2149|  21.3M|                                          TX_SIZE tx_size, int eob) {
 2150|  21.3M|  switch (tx_type) {
 2151|  42.4k|    case IDTX:
  ------------------
  |  Branch (2151:5): [True: 42.4k, False: 21.2M]
  ------------------
 2152|  42.4k|      av1_lowbd_inv_txfm2d_add_idtx_ssse3(input, output, stride, tx_size);
 2153|       |
 2154|  42.4k|      break;
 2155|   406k|    case V_DCT:
  ------------------
  |  Branch (2155:5): [True: 406k, False: 20.9M]
  ------------------
 2156|   427k|    case V_ADST:
  ------------------
  |  Branch (2156:5): [True: 20.4k, False: 21.2M]
  ------------------
 2157|   444k|    case V_FLIPADST:
  ------------------
  |  Branch (2157:5): [True: 17.3k, False: 21.2M]
  ------------------
 2158|   444k|      av1_lowbd_inv_txfm2d_add_h_identity_ssse3(input, output, stride, tx_type,
 2159|   444k|                                                tx_size, eob);
 2160|   444k|      break;
 2161|   986k|    case H_DCT:
  ------------------
  |  Branch (2161:5): [True: 986k, False: 20.3M]
  ------------------
 2162|  1.08M|    case H_ADST:
  ------------------
  |  Branch (2162:5): [True: 93.3k, False: 21.2M]
  ------------------
 2163|  1.14M|    case H_FLIPADST:
  ------------------
  |  Branch (2163:5): [True: 69.4k, False: 21.2M]
  ------------------
 2164|  1.14M|      av1_lowbd_inv_txfm2d_add_v_identity_ssse3(input, output, stride, tx_type,
 2165|  1.14M|                                                tx_size, eob);
 2166|  1.14M|      break;
 2167|  19.6M|    default:
  ------------------
  |  Branch (2167:5): [True: 19.6M, False: 1.62M]
  ------------------
 2168|  19.6M|      lowbd_inv_txfm2d_8x8_no_identity_avx2(input, output, stride, tx_type,
 2169|  19.6M|                                            tx_size, eob);
 2170|  21.3M|  }
 2171|  21.3M|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_8x8_no_identity_avx2:
 2116|  19.6M|    TX_SIZE tx_size, int eob) {
 2117|  19.6M|  __m128i buf1[8];
 2118|  19.6M|  const int input_stride = 8;
 2119|  19.6M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2120|  19.6M|  assert(hitx_1d_tab[tx_type] < 2);
 2121|  19.6M|  assert(vitx_1d_tab[tx_type] < 2);
 2122|  19.6M|  const transform_1d_ssse3 row_txfm =
 2123|  19.6M|      lowbd_txfm_all_1d_zeros_8x8_arr[hitx_1d_tab[tx_type]][eob != 1];
 2124|  19.6M|  const transform_1d_ssse3 col_txfm =
 2125|  19.6M|      lowbd_txfm_all_1d_zeros_8x8_arr[vitx_1d_tab[tx_type]][eob != 1];
 2126|       |
 2127|  19.6M|  assert(col_txfm != NULL);
 2128|  19.6M|  assert(row_txfm != NULL);
 2129|  19.6M|  int ud_flip, lr_flip;
 2130|  19.6M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2131|       |
 2132|  19.6M|  __m128i buf0[8];
 2133|  19.6M|  __m128i *buf0_cur = buf0;
 2134|  19.6M|  load_buffer_avx2(input, input_stride, buf0_cur);
 2135|  19.6M|  row_txfm(buf0, buf0);
 2136|       |
 2137|  19.6M|  assert(shift[0] < 0);
 2138|  19.6M|  __m128i *_buf1 = buf1;
 2139|  19.6M|  round_and_transpose_avx2(buf0, _buf1, shift[0], &lr_flip);
 2140|       |  assert(shift[1] < 0);
 2141|  19.6M|  col_txfm(buf1, buf1);
 2142|  19.6M|  round_shift_lowbd_write_buffer_avx2(buf1, shift[1], output, stride, ud_flip);
 2143|  19.6M|}
av1_inv_txfm_avx2.c:load_buffer_avx2:
 1900|  19.6M|                                    __m128i *out) {
 1901|  19.6M|  const __m256i a = _mm256_load_si256((const __m256i *)in);
 1902|  19.6M|  const __m256i b = _mm256_load_si256((const __m256i *)(in + stride * 1));
 1903|  19.6M|  const __m256i c = _mm256_load_si256((const __m256i *)(in + stride * 2));
 1904|  19.6M|  const __m256i d = _mm256_load_si256((const __m256i *)(in + stride * 3));
 1905|  19.6M|  const __m256i e = _mm256_load_si256((const __m256i *)(in + stride * 4));
 1906|  19.6M|  const __m256i f = _mm256_load_si256((const __m256i *)(in + stride * 5));
 1907|  19.6M|  const __m256i g = _mm256_load_si256((const __m256i *)(in + stride * 6));
 1908|  19.6M|  const __m256i h = _mm256_load_si256((const __m256i *)(in + stride * 7));
 1909|       |
 1910|       |  // a0 a1 a2 a3 b0 b1 b2 b3 a4 a5 a6 a7 b4 b5 b6 b7
 1911|  19.6M|  const __m256i ab_16bit = _mm256_packs_epi32(a, b);
 1912|       |  // c0 c1 c2 c3 d0 d1 d2 d3 c4 c5 c6 c7 d4 d5 d6 d7
 1913|  19.6M|  const __m256i cd_16bit = _mm256_packs_epi32(c, d);
 1914|       |  // e0 e1 e2 e3 f0 f1 f2 f3 e4 e5 e6 e7 f4 f5 f6 f7
 1915|  19.6M|  const __m256i ef_16bit = _mm256_packs_epi32(e, f);
 1916|       |  // g0 g1 g2 g3 h0 h1 h2 h3 g4 g5 g6 g7 h4 h5 h6 h7
 1917|  19.6M|  const __m256i gh_16bit = _mm256_packs_epi32(g, h);
 1918|       |
 1919|       |  // a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
 1920|  19.6M|  const __m256i ab = _mm256_permute4x64_epi64(ab_16bit, 0xd8);
 1921|       |  // c0 c1 c2 c3 c4 c5 c6 c7 d0 d1 d2 d3 d4 d5 d6 d7
 1922|  19.6M|  const __m256i cd = _mm256_permute4x64_epi64(cd_16bit, 0xd8);
 1923|       |  // e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7
 1924|  19.6M|  const __m256i ef = _mm256_permute4x64_epi64(ef_16bit, 0xd8);
 1925|       |  // g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
 1926|  19.6M|  const __m256i gh = _mm256_permute4x64_epi64(gh_16bit, 0xd8);
 1927|       |
 1928|  19.6M|  out[0] = _mm256_castsi256_si128(ab);
 1929|  19.6M|  out[1] = _mm256_extractf128_si256(ab, 1);
 1930|  19.6M|  out[2] = _mm256_castsi256_si128(cd);
 1931|  19.6M|  out[3] = _mm256_extractf128_si256(cd, 1);
 1932|  19.6M|  out[4] = _mm256_castsi256_si128(ef);
 1933|  19.6M|  out[5] = _mm256_extractf128_si256(ef, 1);
 1934|  19.6M|  out[6] = _mm256_castsi256_si128(gh);
 1935|       |  out[7] = _mm256_extractf128_si256(gh, 1);
 1936|  19.6M|}
av1_inv_txfm_avx2.c:round_and_transpose_avx2:
 1940|  19.6M|                                            int *lr_flip) {
 1941|  19.6M|  __m256i buf_temp[4];
 1942|  19.6M|  const __m256i scale = _mm256_set1_epi16(1 << (15 + bit));
 1943|  19.6M|  int j = *lr_flip ? 7 : 0;
  ------------------
  |  Branch (1943:11): [True: 145k, False: 19.5M]
  ------------------
 1944|  19.6M|  const int step = *lr_flip ? -1 : 1;
  ------------------
  |  Branch (1944:20): [True: 145k, False: 19.5M]
  ------------------
 1945|       |
 1946|       |  // 70 71 72 73 74 75 76 77 | 30 31 32 33 34 35 36 37
 1947|  19.6M|  buf_temp[0] = _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]),
 1948|  19.6M|                                        in[j + 4 * step], 1);
 1949|  19.6M|  j += step;
 1950|       |  // 60 61 62 63 64 65 66 67 | 20 21 22 23 24 25 26 27
 1951|  19.6M|  buf_temp[1] = _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]),
 1952|  19.6M|                                        in[j + 4 * step], 1);
 1953|  19.6M|  j += step;
 1954|       |  // 50 51 52 53 54 55 56 57 | 10 11 12 13 14 15 16 17
 1955|  19.6M|  buf_temp[2] = _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]),
 1956|  19.6M|                                        in[j + 4 * step], 1);
 1957|  19.6M|  j += step;
 1958|       |  // 40 41 42 43 44 45 46 47 | 00 01 02 03 04 05 06 07
 1959|  19.6M|  buf_temp[3] = _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]),
 1960|  19.6M|                                        in[j + 4 * step], 1);
 1961|       |
 1962|       |  // 70 71 72 73 74 75 76 77 | 30 31 32 33 34 35 36 37
 1963|  19.6M|  buf_temp[0] = _mm256_mulhrs_epi16(buf_temp[0], scale);
 1964|       |  // 60 61 62 63 64 65 66 67 | 20 21 22 23 24 25 26 27
 1965|  19.6M|  buf_temp[1] = _mm256_mulhrs_epi16(buf_temp[1], scale);
 1966|       |  // 50 51 52 53 54 55 56 57 | 10 11 12 13 14 15 16 17
 1967|  19.6M|  buf_temp[2] = _mm256_mulhrs_epi16(buf_temp[2], scale);
 1968|       |  // 40 41 42 43 44 45 46 47 | 00 01 02 03 04 05 06 07
 1969|  19.6M|  buf_temp[3] = _mm256_mulhrs_epi16(buf_temp[3], scale);
 1970|       |
 1971|       |  // 70 60 71 61 72 62 73 63 | 30 20 31 21 32 22 33 23
 1972|  19.6M|  const __m256i unpcklo0 = _mm256_unpacklo_epi16(buf_temp[0], buf_temp[1]);
 1973|       |  // 74 64 75 65 76 66 77 67 | 34 24 35 25 36 26 37 27
 1974|  19.6M|  const __m256i unpckhi0 = _mm256_unpackhi_epi16(buf_temp[0], buf_temp[1]);
 1975|       |  // 50 40 51 41 52 42 53 43 | 10 00 11 01 12 02 13 03
 1976|  19.6M|  const __m256i unpcklo1 = _mm256_unpacklo_epi16(buf_temp[2], buf_temp[3]);
 1977|       |  // 54 44 55 45 56 46 57 47 | 14 04 15 05 16 06 17 07
 1978|  19.6M|  const __m256i unpckhi1 = _mm256_unpackhi_epi16(buf_temp[2], buf_temp[3]);
 1979|       |
 1980|       |  // 70 60 50 40 71 61 51 41 | 30 20 10 00 31 21 11 01
 1981|  19.6M|  const __m256i unpcklo00 = _mm256_unpacklo_epi32(unpcklo0, unpcklo1);
 1982|       |  // 72 62 52 42 73 63 53 43 | 32 22 12 02 33 23 13 03
 1983|  19.6M|  const __m256i unpckhi00 = _mm256_unpackhi_epi32(unpcklo0, unpcklo1);
 1984|       |  // 74 64 54 44 75 65 55 45 | 34 24 14 04 35 25 15 05
 1985|  19.6M|  const __m256i unpcklo01 = _mm256_unpacklo_epi32(unpckhi0, unpckhi1);
 1986|       |  // 76 66 56 46 77 67 57 47 | 36 26 16 06 37 27 17 07
 1987|  19.6M|  const __m256i unpckhi01 = _mm256_unpackhi_epi32(unpckhi0, unpckhi1);
 1988|       |
 1989|       |  // 70 60 50 40 30 20 10 00 | 71 61 51 41 31 21 11 01
 1990|  19.6M|  const __m256i reg_00 = _mm256_permute4x64_epi64(unpcklo00, 0xd8);
 1991|       |  // 72 62 52 42 32 22 12 02 | 73 63 53 43 33 23 13 03
 1992|  19.6M|  const __m256i reg_01 = _mm256_permute4x64_epi64(unpckhi00, 0xd8);
 1993|       |  // 74 64 54 44 34 24 14 04 | 75 65 55 45 35 25 15 05
 1994|  19.6M|  const __m256i reg_10 = _mm256_permute4x64_epi64(unpcklo01, 0xd8);
 1995|       |  // 76 66 56 46 36 26 16 06 | 77 67 57 47 37 27 17 07
 1996|  19.6M|  const __m256i reg_11 = _mm256_permute4x64_epi64(unpckhi01, 0xd8);
 1997|       |
 1998|       |  // 70 60 50 40 30 20 10 00
 1999|  19.6M|  out[0] = _mm256_castsi256_si128(reg_00);
 2000|       |  // 71 61 51 41 31 21 11 01
 2001|  19.6M|  out[1] = _mm256_extracti128_si256(reg_00, 1);
 2002|       |  // 72 62 52 42 32 22 12 02
 2003|  19.6M|  out[2] = _mm256_castsi256_si128(reg_01);
 2004|       |  // 73 63 53 43 33 23 13 03
 2005|  19.6M|  out[3] = _mm256_extracti128_si256(reg_01, 1);
 2006|       |  // 74 64 54 44 34 24 14 04
 2007|  19.6M|  out[4] = _mm256_castsi256_si128(reg_10);
 2008|       |  // 75 65 55 45 35 25 15 05
 2009|  19.6M|  out[5] = _mm256_extracti128_si256(reg_10, 1);
 2010|       |  // 76 66 56 46 36 26 16 06
 2011|  19.6M|  out[6] = _mm256_castsi256_si128(reg_11);
 2012|       |  // 77 67 57 47 37 27 17 07
 2013|       |  out[7] = _mm256_extracti128_si256(reg_11, 1);
 2014|  19.6M|}
av1_inv_txfm_avx2.c:round_shift_lowbd_write_buffer_avx2:
 2018|  19.7M|                                                       int stride, int flipud) {
 2019|  19.7M|  __m256i in_256[4], v_256[4];
 2020|  19.7M|  int j = flipud ? 7 : 0;
  ------------------
  |  Branch (2020:11): [True: 138k, False: 19.5M]
  ------------------
 2021|  19.7M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (2021:20): [True: 138k, False: 19.5M]
  ------------------
 2022|  19.7M|  const __m256i scale = _mm256_set1_epi16(1 << (15 + bit));
 2023|  19.7M|  const __m256i zero = _mm256_setzero_si256();
 2024|       |  // in[0], in[1]
 2025|  19.7M|  in_256[0] =
 2026|  19.7M|      _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]), in[j + step], 1);
 2027|  19.7M|  j += 2 * step;
 2028|       |  // in[2], in[3]
 2029|  19.7M|  in_256[1] =
 2030|  19.7M|      _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]), in[j + step], 1);
 2031|  19.7M|  j += 2 * step;
 2032|       |  // in[4], in[5]
 2033|  19.7M|  in_256[2] =
 2034|  19.7M|      _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]), in[j + step], 1);
 2035|  19.7M|  j += 2 * step;
 2036|       |  // in[6], in[7]
 2037|  19.7M|  in_256[3] =
 2038|  19.7M|      _mm256_inserti128_si256(_mm256_castsi128_si256(in[j]), in[j + step], 1);
 2039|       |
 2040|       |  // i00 i01 i02 i03 i04 i05 i06 i07 i10 i11 i12 i13 i14 i15 i16 i17
 2041|  19.7M|  in_256[0] = _mm256_mulhrs_epi16(in_256[0], scale);
 2042|       |  // i20 i21 i22 i23 i24 i25 i26 i27 i30 i31 i32 i33 i34 i35 i36 i37
 2043|  19.7M|  in_256[1] = _mm256_mulhrs_epi16(in_256[1], scale);
 2044|       |  // i40 i41 i42 i43 i44 i45 i46 i47 i50 i51 i52 i53 i54 i55 i56 i57
 2045|  19.7M|  in_256[2] = _mm256_mulhrs_epi16(in_256[2], scale);
 2046|       |  // i60 i61 i62 i63 i64 i65 i66 i67 i70 i71 i72 i73 i74 i75 i76 i77
 2047|  19.7M|  in_256[3] = _mm256_mulhrs_epi16(in_256[3], scale);
 2048|       |
 2049|  19.7M|  const __m128i v0 = _mm_loadl_epi64((__m128i const *)(output));
 2050|  19.7M|  const __m128i v1 = _mm_loadl_epi64((__m128i const *)(output + stride));
 2051|  19.7M|  const __m128i v2 = _mm_loadl_epi64((__m128i const *)(output + 2 * stride));
 2052|  19.7M|  const __m128i v3 = _mm_loadl_epi64((__m128i const *)(output + 3 * stride));
 2053|  19.7M|  const __m128i v4 = _mm_loadl_epi64((__m128i const *)(output + 4 * stride));
 2054|  19.7M|  const __m128i v5 = _mm_loadl_epi64((__m128i const *)(output + 5 * stride));
 2055|  19.7M|  const __m128i v6 = _mm_loadl_epi64((__m128i const *)(output + 6 * stride));
 2056|  19.7M|  const __m128i v7 = _mm_loadl_epi64((__m128i const *)(output + 7 * stride));
 2057|       |
 2058|  19.7M|  v_256[0] = _mm256_inserti128_si256(_mm256_castsi128_si256(v0), v1, 1);
 2059|  19.7M|  v_256[1] = _mm256_inserti128_si256(_mm256_castsi128_si256(v2), v3, 1);
 2060|  19.7M|  v_256[2] = _mm256_inserti128_si256(_mm256_castsi128_si256(v4), v5, 1);
 2061|  19.7M|  v_256[3] = _mm256_inserti128_si256(_mm256_castsi128_si256(v6), v7, 1);
 2062|       |
 2063|  19.7M|  const __m256i unpcklo0 = _mm256_unpacklo_epi8(v_256[0], zero);
 2064|  19.7M|  const __m256i unpcklo1 = _mm256_unpacklo_epi8(v_256[1], zero);
 2065|  19.7M|  const __m256i unpcklo2 = _mm256_unpacklo_epi8(v_256[2], zero);
 2066|  19.7M|  const __m256i unpcklo3 = _mm256_unpacklo_epi8(v_256[3], zero);
 2067|       |  // 00 01 10 11
 2068|  19.7M|  const __m256i x0 = _mm256_adds_epi16(in_256[0], unpcklo0);
 2069|       |  // 20 21 30 31
 2070|  19.7M|  const __m256i x1 = _mm256_adds_epi16(in_256[1], unpcklo1);
 2071|       |  // 40 41 50 51
 2072|  19.7M|  const __m256i x2 = _mm256_adds_epi16(in_256[2], unpcklo2);
 2073|       |  // 60 61 70 71
 2074|  19.7M|  const __m256i x3 = _mm256_adds_epi16(in_256[3], unpcklo3);
 2075|       |
 2076|       |  // 00 01 20 21 10 11 30 31
 2077|  19.7M|  const __m256i res_0123 = _mm256_packus_epi16(x0, x1);
 2078|       |  // 40 41 60 61 50 51 70 71
 2079|  19.7M|  const __m256i res_4567 = _mm256_packus_epi16(x2, x3);
 2080|       |
 2081|       |  // 00 01 20 21
 2082|  19.7M|  const __m128i res_02 = _mm256_castsi256_si128(res_0123);
 2083|       |  // 10 11 30 31
 2084|  19.7M|  const __m128i res_13 = _mm256_extracti128_si256(res_0123, 1);
 2085|       |  // 40 41 60 61
 2086|  19.7M|  const __m128i res_46 = _mm256_castsi256_si128(res_4567);
 2087|       |  // 50 51 70 71
 2088|  19.7M|  const __m128i res_57 = _mm256_extracti128_si256(res_4567, 1);
 2089|       |
 2090|       |  // 00 01
 2091|  19.7M|  _mm_storel_epi64((__m128i *)(output), res_02);
 2092|       |  // 10 11
 2093|  19.7M|  _mm_storel_epi64((__m128i *)(output + stride), res_13);
 2094|       |  // 20 21
 2095|  19.7M|  _mm_storel_epi64((__m128i *)(output + 2 * stride),
 2096|  19.7M|                   _mm_unpackhi_epi64(res_02, res_02));
 2097|       |  // 30 31
 2098|  19.7M|  _mm_storel_epi64((__m128i *)(output + 3 * stride),
 2099|  19.7M|                   _mm_unpackhi_epi64(res_13, res_13));
 2100|       |  // 40 41
 2101|  19.7M|  _mm_storel_epi64((__m128i *)(output + 4 * stride), res_46);
 2102|       |  // 50 51
 2103|  19.7M|  _mm_storel_epi64((__m128i *)(output + 5 * stride), res_57);
 2104|       |  // 60 61
 2105|  19.7M|  _mm_storel_epi64((__m128i *)(output + 6 * stride),
 2106|  19.7M|                   _mm_unpackhi_epi64(res_46, res_46));
 2107|       |  // 70 71
 2108|  19.7M|  _mm_storel_epi64((__m128i *)(output + 7 * stride),
 2109|  19.7M|                   _mm_unpackhi_epi64(res_57, res_57));
 2110|  19.7M|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_universe_avx2:
 2176|  1.09M|    TX_SIZE tx_size, int eob) {
 2177|  1.09M|  (void)eob;
 2178|  1.09M|  switch (tx_type) {
 2179|   735k|    case DCT_DCT:
  ------------------
  |  Branch (2179:5): [True: 735k, False: 363k]
  ------------------
 2180|   821k|    case ADST_DCT:   // ADST in vertical, DCT in horizontal
  ------------------
  |  Branch (2180:5): [True: 85.9k, False: 1.01M]
  ------------------
 2181|   931k|    case DCT_ADST:   // DCT  in vertical, ADST in horizontal
  ------------------
  |  Branch (2181:5): [True: 110k, False: 988k]
  ------------------
 2182|  1.06M|    case ADST_ADST:  // ADST in both directions
  ------------------
  |  Branch (2182:5): [True: 129k, False: 968k]
  ------------------
 2183|  1.06M|    case FLIPADST_DCT:
  ------------------
  |  Branch (2183:5): [True: 1.06k, False: 1.09M]
  ------------------
 2184|  1.06M|    case DCT_FLIPADST:
  ------------------
  |  Branch (2184:5): [True: 1.16k, False: 1.09M]
  ------------------
 2185|  1.06M|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (2185:5): [True: 114, False: 1.09M]
  ------------------
 2186|  1.06M|    case ADST_FLIPADST:
  ------------------
  |  Branch (2186:5): [True: 183, False: 1.09M]
  ------------------
 2187|  1.06M|    case FLIPADST_ADST:
  ------------------
  |  Branch (2187:5): [True: 166, False: 1.09M]
  ------------------
 2188|  1.06M|      lowbd_inv_txfm2d_add_no_identity_avx2(input, output, stride, tx_type,
 2189|  1.06M|                                            tx_size, eob);
 2190|  1.06M|      break;
 2191|  34.1k|    case IDTX:
  ------------------
  |  Branch (2191:5): [True: 34.1k, False: 1.06M]
  ------------------
 2192|  34.1k|      lowbd_inv_txfm2d_add_idtx_avx2(input, output, stride, tx_size, eob);
 2193|  34.1k|      break;
 2194|    508|    case V_DCT:
  ------------------
  |  Branch (2194:5): [True: 508, False: 1.09M]
  ------------------
 2195|    508|    case V_ADST:
  ------------------
  |  Branch (2195:5): [True: 0, False: 1.09M]
  ------------------
 2196|    508|    case V_FLIPADST:
  ------------------
  |  Branch (2196:5): [True: 0, False: 1.09M]
  ------------------
 2197|    508|      lowbd_inv_txfm2d_add_h_identity_avx2(input, output, stride, tx_type,
 2198|    508|                                           tx_size, eob);
 2199|    508|      break;
 2200|    485|    case H_DCT:
  ------------------
  |  Branch (2200:5): [True: 485, False: 1.09M]
  ------------------
 2201|    485|    case H_ADST:
  ------------------
  |  Branch (2201:5): [True: 0, False: 1.09M]
  ------------------
 2202|    485|    case H_FLIPADST:
  ------------------
  |  Branch (2202:5): [True: 0, False: 1.09M]
  ------------------
 2203|    485|      lowbd_inv_txfm2d_add_v_identity_avx2(input, output, stride, tx_type,
 2204|    485|                                           tx_size, eob);
 2205|    485|      break;
 2206|      0|    default:
  ------------------
  |  Branch (2206:5): [True: 0, False: 1.09M]
  ------------------
 2207|      0|      av1_lowbd_inv_txfm2d_add_ssse3(input, output, stride, tx_type, tx_size,
 2208|      0|                                     eob);
 2209|      0|      break;
 2210|  1.09M|  }
 2211|  1.09M|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_no_identity_avx2:
 1638|  1.06M|    TX_SIZE tx_size, int eob) {
 1639|  1.06M|  __m256i buf1[64 * 16];
 1640|  1.06M|  int eobx, eoby;
 1641|  1.06M|  get_eobx_eoby_scan_default(&eobx, &eoby, tx_size, eob);
 1642|  1.06M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 1643|  1.06M|  const int txw_idx = get_txw_idx(tx_size);
 1644|  1.06M|  const int txh_idx = get_txh_idx(tx_size);
 1645|  1.06M|  const int txfm_size_col = tx_size_wide[tx_size];
 1646|  1.06M|  const int txfm_size_row = tx_size_high[tx_size];
 1647|  1.06M|  const int buf_size_w_div16 = txfm_size_col >> 4;
 1648|  1.06M|  const int buf_size_nonzero_w = ((eobx + 16) >> 4) << 4;
 1649|  1.06M|  const int buf_size_nonzero_h_div16 = (eoby + 16) >> 4;
 1650|  1.06M|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  1.06M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.9k, False: 1.05M]
  |  |  ------------------
  ------------------
 1651|  1.06M|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 1652|       |
 1653|  1.06M|  const int fun_idx_x = lowbd_txfm_all_1d_zeros_idx[eobx];
 1654|  1.06M|  const int fun_idx_y = lowbd_txfm_all_1d_zeros_idx[eoby];
 1655|  1.06M|  const transform_1d_avx2 row_txfm =
 1656|  1.06M|      lowbd_txfm_all_1d_zeros_w16_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx_x];
 1657|  1.06M|  const transform_1d_avx2 col_txfm =
 1658|  1.06M|      lowbd_txfm_all_1d_zeros_w16_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx_y];
 1659|       |
 1660|  1.06M|  assert(col_txfm != NULL);
 1661|  1.06M|  assert(row_txfm != NULL);
 1662|  1.06M|  int ud_flip, lr_flip;
 1663|  1.06M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1664|  1.06M|  const __m256i scale0 = _mm256_set1_epi16(1 << (15 + shift[0]));
 1665|  2.28M|  for (int i = 0; i < buf_size_nonzero_h_div16; i++) {
  ------------------
  |  Branch (1665:19): [True: 1.22M, False: 1.06M]
  ------------------
 1666|  1.22M|    __m256i buf0[64];
 1667|  1.22M|    load_buffer_32bit_to_16bit_w16_avx2(input + 16 * i, input_stride, buf0,
 1668|  1.22M|                                        buf_size_nonzero_w);
 1669|  1.22M|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (1669:9): [True: 30.7k, False: 1.19M]
  |  Branch (1669:27): [True: 64.6k, False: 1.13M]
  ------------------
 1670|  95.1k|      round_shift_avx2(buf0, buf0, buf_size_nonzero_w);  // rect special code
 1671|  95.1k|    }
 1672|  1.22M|    row_txfm(buf0, buf0);
 1673|  26.6M|    for (int j = 0; j < txfm_size_col; ++j) {
  ------------------
  |  Branch (1673:21): [True: 25.4M, False: 1.22M]
  ------------------
 1674|  25.4M|      buf0[j] = _mm256_mulhrs_epi16(buf0[j], scale0);
 1675|  25.4M|    }
 1676|       |
 1677|  1.22M|    __m256i *buf1_cur = buf1 + (i << 4);
 1678|  1.22M|    if (lr_flip) {
  ------------------
  |  Branch (1678:9): [True: 1.45k, False: 1.22M]
  ------------------
 1679|  2.91k|      for (int j = 0; j < buf_size_w_div16; ++j) {
  ------------------
  |  Branch (1679:23): [True: 1.45k, False: 1.45k]
  ------------------
 1680|  1.45k|        __m256i temp[16];
 1681|  1.45k|        flip_buf_avx2(buf0 + 16 * j, temp, 16);
 1682|  1.45k|        int offset = txfm_size_row * (buf_size_w_div16 - 1 - j);
 1683|  1.45k|        transpose_16bit_16x16_avx2(temp, buf1_cur + offset);
 1684|  1.45k|      }
 1685|  1.22M|    } else {
 1686|  2.80M|      for (int j = 0; j < buf_size_w_div16; ++j) {
  ------------------
  |  Branch (1686:23): [True: 1.58M, False: 1.22M]
  ------------------
 1687|  1.58M|        transpose_16bit_16x16_avx2(buf0 + 16 * j, buf1_cur + txfm_size_row * j);
 1688|  1.58M|      }
 1689|  1.22M|    }
 1690|  1.22M|  }
 1691|  1.06M|  const __m256i scale1 = _mm256_set1_epi16(1 << (15 + shift[1]));
 1692|  2.33M|  for (int i = 0; i < buf_size_w_div16; i++) {
  ------------------
  |  Branch (1692:19): [True: 1.26M, False: 1.06M]
  ------------------
 1693|  1.26M|    __m256i *buf1_cur = buf1 + i * txfm_size_row;
 1694|  1.26M|    col_txfm(buf1_cur, buf1_cur);
 1695|  28.6M|    for (int j = 0; j < txfm_size_row; ++j) {
  ------------------
  |  Branch (1695:21): [True: 27.4M, False: 1.26M]
  ------------------
 1696|  27.4M|      buf1_cur[j] = _mm256_mulhrs_epi16(buf1_cur[j], scale1);
 1697|  27.4M|    }
 1698|  1.26M|  }
 1699|  2.33M|  for (int i = 0; i < buf_size_w_div16; i++) {
  ------------------
  |  Branch (1699:19): [True: 1.26M, False: 1.06M]
  ------------------
 1700|  1.26M|    lowbd_write_buffer_16xn_avx2(buf1 + i * txfm_size_row, output + 16 * i,
 1701|  1.26M|                                 stride, ud_flip, txfm_size_row);
 1702|  1.26M|  }
 1703|  1.06M|}
av1_inv_txfm_avx2.c:idct16_low1_avx2:
  196|   120k|static void idct16_low1_avx2(const __m256i *input, __m256i *output) {
  197|   120k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   120k|#define INV_COS_BIT 12
  ------------------
  198|       |
  199|       |  // stage 1
  200|   120k|  __m256i x1[2];
  201|   120k|  x1[0] = input[0];
  202|       |
  203|       |  // stage 2
  204|       |  // stage 3
  205|       |  // stage 4
  206|   120k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x1[0], x1[0], x1[1]);
  ------------------
  |  |   30|   120k|  do {                                             \
  |  |   31|   120k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   120k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   120k|    const __m256i _in = in;                        \
  |  |   34|   120k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   120k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   120k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 120k]
  |  |  ------------------
  ------------------
  207|       |
  208|       |  // stage 5
  209|       |  // stage 6
  210|   120k|  output[0] = x1[0];
  211|   120k|  output[1] = x1[1];
  212|   120k|  output[2] = x1[1];
  213|   120k|  output[3] = x1[0];
  214|   120k|  output[4] = x1[0];
  215|   120k|  output[5] = x1[1];
  216|   120k|  output[6] = x1[1];
  217|   120k|  output[7] = x1[0];
  218|   120k|  output[8] = x1[0];
  219|   120k|  output[9] = x1[1];
  220|   120k|  output[10] = x1[1];
  221|   120k|  output[11] = x1[0];
  222|   120k|  output[12] = x1[0];
  223|   120k|  output[13] = x1[1];
  224|   120k|  output[14] = x1[1];
  225|   120k|  output[15] = x1[0];
  226|   120k|}
av1_inv_txfm_avx2.c:idct16_low8_avx2:
  148|   261k|static void idct16_low8_avx2(const __m256i *input, __m256i *output) {
  149|   261k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  150|   261k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  151|       |
  152|   261k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  153|   261k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  154|   261k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  155|       |
  156|       |  // stage 1
  157|   261k|  __m256i x1[16];
  158|   261k|  x1[0] = input[0];
  159|   261k|  x1[2] = input[4];
  160|   261k|  x1[4] = input[2];
  161|   261k|  x1[6] = input[6];
  162|   261k|  x1[8] = input[1];
  163|   261k|  x1[10] = input[5];
  164|   261k|  x1[12] = input[3];
  165|   261k|  x1[14] = input[7];
  166|       |
  167|       |  // stage 2
  168|   261k|  btf_16_w16_0_avx2(cospi[60], cospi[4], x1[8], x1[8], x1[15]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  169|   261k|  btf_16_w16_0_avx2(-cospi[36], cospi[28], x1[14], x1[9], x1[14]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  170|   261k|  btf_16_w16_0_avx2(cospi[44], cospi[20], x1[10], x1[10], x1[13]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  171|   261k|  btf_16_w16_0_avx2(-cospi[52], cospi[12], x1[12], x1[11], x1[12]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  172|       |
  173|       |  // stage 3
  174|   261k|  btf_16_w16_0_avx2(cospi[56], cospi[8], x1[4], x1[4], x1[7]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  175|   261k|  btf_16_w16_0_avx2(-cospi[40], cospi[24], x1[6], x1[5], x1[6]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  176|   261k|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
  177|   261k|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
  178|   261k|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
  179|   261k|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
  180|       |
  181|       |  // stage 4
  182|   261k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x1[0], x1[0], x1[1]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  183|   261k|  btf_16_w16_0_avx2(cospi[48], cospi[16], x1[2], x1[2], x1[3]);
  ------------------
  |  |   30|   261k|  do {                                             \
  |  |   31|   261k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   261k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   261k|    const __m256i _in = in;                        \
  |  |   34|   261k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   261k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   261k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 261k]
  |  |  ------------------
  ------------------
  184|   261k|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
  185|   261k|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
  186|   261k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[9], &x1[14], _r,
  187|   261k|                  INV_COS_BIT);
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  188|   261k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[10], &x1[13], _r,
  189|   261k|                  INV_COS_BIT);
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  190|       |
  191|   261k|  idct16_stage5_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  192|   261k|  idct16_stage6_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   261k|#define INV_COS_BIT 12
  ------------------
  193|   261k|  idct16_stage7_avx2(output, x1);
  194|   261k|}
av1_inv_txfm_avx2.c:idct16_stage5_avx2:
   32|  1.22M|                                      const __m256i _r, int8_t cos_bit) {
   33|  1.22M|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
   34|  1.22M|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
   35|  1.22M|  btf_16_adds_subs_avx2(&x1[0], &x1[3]);
   36|  1.22M|  btf_16_adds_subs_avx2(&x1[1], &x1[2]);
   37|  1.22M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[5], &x1[6], _r, cos_bit);
   38|       |
   39|  1.22M|  btf_16_adds_subs_avx2(&x1[8], &x1[11]);
   40|  1.22M|  btf_16_adds_subs_avx2(&x1[9], &x1[10]);
   41|  1.22M|  btf_16_adds_subs_avx2(&x1[15], &x1[12]);
   42|  1.22M|  btf_16_adds_subs_avx2(&x1[14], &x1[13]);
   43|  1.22M|}
av1_inv_txfm_avx2.c:idct16_stage6_avx2:
   46|  1.22M|                                      const __m256i _r, int8_t cos_bit) {
   47|  1.22M|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
   48|  1.22M|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
   49|  1.22M|  btf_16_adds_subs_avx2(&x[0], &x[7]);
   50|  1.22M|  btf_16_adds_subs_avx2(&x[1], &x[6]);
   51|  1.22M|  btf_16_adds_subs_avx2(&x[2], &x[5]);
   52|  1.22M|  btf_16_adds_subs_avx2(&x[3], &x[4]);
   53|  1.22M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[10], &x[13], _r, cos_bit);
   54|  1.22M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[11], &x[12], _r, cos_bit);
   55|  1.22M|}
av1_inv_txfm_avx2.c:idct16_stage7_avx2:
   57|  1.22M|static inline void idct16_stage7_avx2(__m256i *output, __m256i *x1) {
   58|  1.22M|  btf_16_adds_subs_out_avx2(&output[0], &output[15], x1[0], x1[15]);
   59|  1.22M|  btf_16_adds_subs_out_avx2(&output[1], &output[14], x1[1], x1[14]);
   60|  1.22M|  btf_16_adds_subs_out_avx2(&output[2], &output[13], x1[2], x1[13]);
   61|  1.22M|  btf_16_adds_subs_out_avx2(&output[3], &output[12], x1[3], x1[12]);
   62|  1.22M|  btf_16_adds_subs_out_avx2(&output[4], &output[11], x1[4], x1[11]);
   63|  1.22M|  btf_16_adds_subs_out_avx2(&output[5], &output[10], x1[5], x1[10]);
   64|  1.22M|  btf_16_adds_subs_out_avx2(&output[6], &output[9], x1[6], x1[9]);
   65|  1.22M|  btf_16_adds_subs_out_avx2(&output[7], &output[8], x1[7], x1[8]);
   66|  1.22M|}
av1_inv_txfm_avx2.c:idct16_avx2:
   68|   966k|static void idct16_avx2(const __m256i *input, __m256i *output) {
   69|   966k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
   70|   966k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
   71|       |
   72|   966k|  __m256i cospi_p60_m04 = pair_set_w16_epi16(cospi[60], -cospi[4]);
   73|   966k|  __m256i cospi_p04_p60 = pair_set_w16_epi16(cospi[4], cospi[60]);
   74|   966k|  __m256i cospi_p28_m36 = pair_set_w16_epi16(cospi[28], -cospi[36]);
   75|   966k|  __m256i cospi_p36_p28 = pair_set_w16_epi16(cospi[36], cospi[28]);
   76|   966k|  __m256i cospi_p44_m20 = pair_set_w16_epi16(cospi[44], -cospi[20]);
   77|   966k|  __m256i cospi_p20_p44 = pair_set_w16_epi16(cospi[20], cospi[44]);
   78|   966k|  __m256i cospi_p12_m52 = pair_set_w16_epi16(cospi[12], -cospi[52]);
   79|   966k|  __m256i cospi_p52_p12 = pair_set_w16_epi16(cospi[52], cospi[12]);
   80|   966k|  __m256i cospi_p56_m08 = pair_set_w16_epi16(cospi[56], -cospi[8]);
   81|   966k|  __m256i cospi_p08_p56 = pair_set_w16_epi16(cospi[8], cospi[56]);
   82|   966k|  __m256i cospi_p24_m40 = pair_set_w16_epi16(cospi[24], -cospi[40]);
   83|   966k|  __m256i cospi_p40_p24 = pair_set_w16_epi16(cospi[40], cospi[24]);
   84|   966k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
   85|   966k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
   86|   966k|  __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
   87|   966k|  __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
   88|   966k|  __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
   89|   966k|  __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
   90|   966k|  __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
   91|       |
   92|       |  // stage 1
   93|   966k|  __m256i x1[16];
   94|   966k|  x1[0] = input[0];
   95|   966k|  x1[1] = input[8];
   96|   966k|  x1[2] = input[4];
   97|   966k|  x1[3] = input[12];
   98|   966k|  x1[4] = input[2];
   99|   966k|  x1[5] = input[10];
  100|   966k|  x1[6] = input[6];
  101|   966k|  x1[7] = input[14];
  102|   966k|  x1[8] = input[1];
  103|   966k|  x1[9] = input[9];
  104|   966k|  x1[10] = input[5];
  105|   966k|  x1[11] = input[13];
  106|   966k|  x1[12] = input[3];
  107|   966k|  x1[13] = input[11];
  108|   966k|  x1[14] = input[7];
  109|   966k|  x1[15] = input[15];
  110|       |
  111|       |  // stage 2
  112|   966k|  btf_16_w16_avx2(cospi_p60_m04, cospi_p04_p60, &x1[8], &x1[15], _r,
  113|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  114|   966k|  btf_16_w16_avx2(cospi_p28_m36, cospi_p36_p28, &x1[9], &x1[14], _r,
  115|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  116|   966k|  btf_16_w16_avx2(cospi_p44_m20, cospi_p20_p44, &x1[10], &x1[13], _r,
  117|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  118|   966k|  btf_16_w16_avx2(cospi_p12_m52, cospi_p52_p12, &x1[11], &x1[12], _r,
  119|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  120|       |
  121|       |  // stage 3
  122|   966k|  btf_16_w16_avx2(cospi_p56_m08, cospi_p08_p56, &x1[4], &x1[7], _r,
  123|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  124|   966k|  btf_16_w16_avx2(cospi_p24_m40, cospi_p40_p24, &x1[5], &x1[6], _r,
  125|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  126|   966k|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
  127|   966k|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
  128|   966k|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
  129|   966k|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
  130|       |
  131|       |  // stage 4
  132|   966k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[0], &x1[1], _r,
  133|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  134|   966k|  btf_16_w16_avx2(cospi_p48_m16, cospi_p16_p48, &x1[2], &x1[3], _r,
  135|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  136|   966k|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
  137|   966k|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
  138|   966k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[9], &x1[14], _r,
  139|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  140|   966k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[10], &x1[13], _r,
  141|   966k|                  INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  142|       |
  143|   966k|  idct16_stage5_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  144|   966k|  idct16_stage6_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   966k|#define INV_COS_BIT 12
  ------------------
  145|   966k|  idct16_stage7_avx2(output, x1);
  146|   966k|}
av1_inv_txfm_avx2.c:iadst16_low1_avx2:
  418|  31.6k|static void iadst16_low1_avx2(const __m256i *input, __m256i *output) {
  419|  31.6k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  420|  31.6k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  421|       |
  422|  31.6k|  const __m256i cospi_p08_p56 = pair_set_w16_epi16(cospi[8], cospi[56]);
  423|  31.6k|  const __m256i cospi_p56_m08 = pair_set_w16_epi16(cospi[56], -cospi[8]);
  424|  31.6k|  const __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
  425|  31.6k|  const __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
  426|       |
  427|       |  // stage 1
  428|  31.6k|  __m256i x1[16];
  429|  31.6k|  x1[1] = input[0];
  430|       |
  431|       |  // stage 2
  432|  31.6k|  btf_16_w16_0_avx2(cospi[62], -cospi[2], x1[1], x1[0], x1[1]);
  ------------------
  |  |   30|  31.6k|  do {                                             \
  |  |   31|  31.6k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  31.6k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  31.6k|    const __m256i _in = in;                        \
  |  |   34|  31.6k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  31.6k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  31.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 31.6k]
  |  |  ------------------
  ------------------
  433|       |
  434|       |  // stage 3
  435|  31.6k|  x1[8] = x1[0];
  436|  31.6k|  x1[9] = x1[1];
  437|       |
  438|       |  // stage 4
  439|  31.6k|  btf_16_w16_avx2(cospi_p08_p56, cospi_p56_m08, &x1[8], &x1[9], _r,
  440|  31.6k|                  INV_COS_BIT);
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  441|       |
  442|       |  // stage 5
  443|  31.6k|  x1[4] = x1[0];
  444|  31.6k|  x1[5] = x1[1];
  445|       |
  446|  31.6k|  x1[12] = x1[8];
  447|  31.6k|  x1[13] = x1[9];
  448|       |
  449|       |  // stage 6
  450|  31.6k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x1[4], &x1[5], _r,
  451|  31.6k|                  INV_COS_BIT);
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  452|  31.6k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x1[12], &x1[13], _r,
  453|  31.6k|                  INV_COS_BIT);
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  454|       |
  455|       |  // stage 7
  456|  31.6k|  x1[2] = x1[0];
  457|  31.6k|  x1[3] = x1[1];
  458|  31.6k|  x1[6] = x1[4];
  459|  31.6k|  x1[7] = x1[5];
  460|  31.6k|  x1[10] = x1[8];
  461|  31.6k|  x1[11] = x1[9];
  462|  31.6k|  x1[14] = x1[12];
  463|  31.6k|  x1[15] = x1[13];
  464|       |
  465|  31.6k|  iadst16_stage8_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  31.6k|#define INV_COS_BIT 12
  ------------------
  466|  31.6k|  iadst16_stage9_avx2(output, x1);
  467|  31.6k|}
av1_inv_txfm_avx2.c:iadst16_stage8_avx2:
  287|   458k|                                       const __m256i _r, int8_t cos_bit) {
  288|   458k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  289|   458k|  const __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
  290|   458k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[2], &x1[3], _r, cos_bit);
  291|   458k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[6], &x1[7], _r, cos_bit);
  292|   458k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[10], &x1[11], _r, cos_bit);
  293|   458k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[14], &x1[15], _r, cos_bit);
  294|   458k|}
av1_inv_txfm_avx2.c:iadst16_stage9_avx2:
  296|   458k|static inline void iadst16_stage9_avx2(__m256i *output, __m256i *x1) {
  297|   458k|  const __m256i __zero = _mm256_setzero_si256();
  298|   458k|  output[0] = x1[0];
  299|   458k|  output[1] = _mm256_subs_epi16(__zero, x1[8]);
  300|   458k|  output[2] = x1[12];
  301|   458k|  output[3] = _mm256_subs_epi16(__zero, x1[4]);
  302|   458k|  output[4] = x1[6];
  303|   458k|  output[5] = _mm256_subs_epi16(__zero, x1[14]);
  304|   458k|  output[6] = x1[10];
  305|   458k|  output[7] = _mm256_subs_epi16(__zero, x1[2]);
  306|   458k|  output[8] = x1[3];
  307|   458k|  output[9] = _mm256_subs_epi16(__zero, x1[11]);
  308|   458k|  output[10] = x1[15];
  309|   458k|  output[11] = _mm256_subs_epi16(__zero, x1[7]);
  310|   458k|  output[12] = x1[5];
  311|   458k|  output[13] = _mm256_subs_epi16(__zero, x1[13]);
  312|   458k|  output[14] = x1[9];
  313|   458k|  output[15] = _mm256_subs_epi16(__zero, x1[1]);
  314|   458k|}
av1_inv_txfm_avx2.c:iadst16_low8_avx2:
  384|   105k|static void iadst16_low8_avx2(const __m256i *input, __m256i *output) {
  385|   105k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   105k|#define INV_COS_BIT 12
  ------------------
  386|   105k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   105k|#define INV_COS_BIT 12
  ------------------
  387|       |
  388|       |  // stage 1
  389|   105k|  __m256i x1[16];
  390|   105k|  x1[1] = input[0];
  391|   105k|  x1[3] = input[2];
  392|   105k|  x1[5] = input[4];
  393|   105k|  x1[7] = input[6];
  394|   105k|  x1[8] = input[7];
  395|   105k|  x1[10] = input[5];
  396|   105k|  x1[12] = input[3];
  397|   105k|  x1[14] = input[1];
  398|       |
  399|       |  // stage 2
  400|   105k|  btf_16_w16_0_avx2(cospi[62], -cospi[2], x1[1], x1[0], x1[1]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  401|   105k|  btf_16_w16_0_avx2(cospi[54], -cospi[10], x1[3], x1[2], x1[3]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  402|   105k|  btf_16_w16_0_avx2(cospi[46], -cospi[18], x1[5], x1[4], x1[5]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  403|   105k|  btf_16_w16_0_avx2(cospi[38], -cospi[26], x1[7], x1[6], x1[7]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  404|   105k|  btf_16_w16_0_avx2(cospi[34], cospi[30], x1[8], x1[8], x1[9]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  405|   105k|  btf_16_w16_0_avx2(cospi[42], cospi[22], x1[10], x1[10], x1[11]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  406|   105k|  btf_16_w16_0_avx2(cospi[50], cospi[14], x1[12], x1[12], x1[13]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  407|   105k|  btf_16_w16_0_avx2(cospi[58], cospi[06], x1[14], x1[14], x1[15]);
  ------------------
  |  |   30|   105k|  do {                                             \
  |  |   31|   105k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|   105k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|   105k|    const __m256i _in = in;                        \
  |  |   34|   105k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|   105k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  408|       |
  409|   105k|  iadst16_stage3_avx2(x1);
  410|   105k|  iadst16_stage4_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   105k|#define INV_COS_BIT 12
  ------------------
  411|   105k|  iadst16_stage5_avx2(x1);
  412|   105k|  iadst16_stage6_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   105k|#define INV_COS_BIT 12
  ------------------
  413|   105k|  iadst16_stage7_avx2(x1);
  414|   105k|  iadst16_stage8_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   105k|#define INV_COS_BIT 12
  ------------------
  415|   105k|  iadst16_stage9_avx2(output, x1);
  416|   105k|}
av1_inv_txfm_avx2.c:iadst16_stage3_avx2:
  228|   427k|static inline void iadst16_stage3_avx2(__m256i *x) {
  229|   427k|  btf_16_adds_subs_avx2(&x[0], &x[8]);
  230|   427k|  btf_16_adds_subs_avx2(&x[1], &x[9]);
  231|   427k|  btf_16_adds_subs_avx2(&x[2], &x[10]);
  232|   427k|  btf_16_adds_subs_avx2(&x[3], &x[11]);
  233|   427k|  btf_16_adds_subs_avx2(&x[4], &x[12]);
  234|   427k|  btf_16_adds_subs_avx2(&x[5], &x[13]);
  235|   427k|  btf_16_adds_subs_avx2(&x[6], &x[14]);
  236|   427k|  btf_16_adds_subs_avx2(&x[7], &x[15]);
  237|   427k|}
av1_inv_txfm_avx2.c:iadst16_stage4_avx2:
  240|   427k|                                       const __m256i _r, int8_t cos_bit) {
  241|   427k|  const __m256i cospi_p08_p56 = pair_set_w16_epi16(cospi[8], cospi[56]);
  242|   427k|  const __m256i cospi_p56_m08 = pair_set_w16_epi16(cospi[56], -cospi[8]);
  243|   427k|  const __m256i cospi_p40_p24 = pair_set_w16_epi16(cospi[40], cospi[24]);
  244|   427k|  const __m256i cospi_p24_m40 = pair_set_w16_epi16(cospi[24], -cospi[40]);
  245|   427k|  const __m256i cospi_m56_p08 = pair_set_w16_epi16(-cospi[56], cospi[8]);
  246|   427k|  const __m256i cospi_m24_p40 = pair_set_w16_epi16(-cospi[24], cospi[40]);
  247|   427k|  btf_16_w16_avx2(cospi_p08_p56, cospi_p56_m08, &x[8], &x[9], _r, cos_bit);
  248|   427k|  btf_16_w16_avx2(cospi_p40_p24, cospi_p24_m40, &x[10], &x[11], _r, cos_bit);
  249|   427k|  btf_16_w16_avx2(cospi_m56_p08, cospi_p08_p56, &x[12], &x[13], _r, cos_bit);
  250|   427k|  btf_16_w16_avx2(cospi_m24_p40, cospi_p40_p24, &x[14], &x[15], _r, cos_bit);
  251|   427k|}
av1_inv_txfm_avx2.c:iadst16_stage5_avx2:
  253|   427k|static inline void iadst16_stage5_avx2(__m256i *x) {
  254|   427k|  btf_16_adds_subs_avx2(&x[0], &x[4]);
  255|   427k|  btf_16_adds_subs_avx2(&x[1], &x[5]);
  256|   427k|  btf_16_adds_subs_avx2(&x[2], &x[6]);
  257|   427k|  btf_16_adds_subs_avx2(&x[3], &x[7]);
  258|   427k|  btf_16_adds_subs_avx2(&x[8], &x[12]);
  259|   427k|  btf_16_adds_subs_avx2(&x[9], &x[13]);
  260|   427k|  btf_16_adds_subs_avx2(&x[10], &x[14]);
  261|   427k|  btf_16_adds_subs_avx2(&x[11], &x[15]);
  262|   427k|}
av1_inv_txfm_avx2.c:iadst16_stage6_avx2:
  265|   427k|                                       const __m256i _r, int8_t cos_bit) {
  266|   427k|  const __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
  267|   427k|  const __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
  268|   427k|  const __m256i cospi_m48_p16 = pair_set_w16_epi16(-cospi[48], cospi[16]);
  269|   427k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x[4], &x[5], _r, cos_bit);
  270|   427k|  btf_16_w16_avx2(cospi_m48_p16, cospi_p16_p48, &x[6], &x[7], _r, cos_bit);
  271|   427k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x[12], &x[13], _r, cos_bit);
  272|   427k|  btf_16_w16_avx2(cospi_m48_p16, cospi_p16_p48, &x[14], &x[15], _r, cos_bit);
  273|   427k|}
av1_inv_txfm_avx2.c:iadst16_stage7_avx2:
  275|   427k|static inline void iadst16_stage7_avx2(__m256i *x) {
  276|   427k|  btf_16_adds_subs_avx2(&x[0], &x[2]);
  277|   427k|  btf_16_adds_subs_avx2(&x[1], &x[3]);
  278|   427k|  btf_16_adds_subs_avx2(&x[4], &x[6]);
  279|   427k|  btf_16_adds_subs_avx2(&x[5], &x[7]);
  280|   427k|  btf_16_adds_subs_avx2(&x[8], &x[10]);
  281|   427k|  btf_16_adds_subs_avx2(&x[9], &x[11]);
  282|   427k|  btf_16_adds_subs_avx2(&x[12], &x[14]);
  283|   427k|  btf_16_adds_subs_avx2(&x[13], &x[15]);
  284|   427k|}
av1_inv_txfm_avx2.c:iadst16_avx2:
  316|   321k|static void iadst16_avx2(const __m256i *input, __m256i *output) {
  317|   321k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  318|       |
  319|   321k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  320|       |
  321|   321k|  __m256i cospi_p02_p62 = pair_set_w16_epi16(cospi[2], cospi[62]);
  322|   321k|  __m256i cospi_p62_m02 = pair_set_w16_epi16(cospi[62], -cospi[2]);
  323|   321k|  __m256i cospi_p10_p54 = pair_set_w16_epi16(cospi[10], cospi[54]);
  324|   321k|  __m256i cospi_p54_m10 = pair_set_w16_epi16(cospi[54], -cospi[10]);
  325|   321k|  __m256i cospi_p18_p46 = pair_set_w16_epi16(cospi[18], cospi[46]);
  326|   321k|  __m256i cospi_p46_m18 = pair_set_w16_epi16(cospi[46], -cospi[18]);
  327|   321k|  __m256i cospi_p26_p38 = pair_set_w16_epi16(cospi[26], cospi[38]);
  328|   321k|  __m256i cospi_p38_m26 = pair_set_w16_epi16(cospi[38], -cospi[26]);
  329|   321k|  __m256i cospi_p34_p30 = pair_set_w16_epi16(cospi[34], cospi[30]);
  330|   321k|  __m256i cospi_p30_m34 = pair_set_w16_epi16(cospi[30], -cospi[34]);
  331|   321k|  __m256i cospi_p42_p22 = pair_set_w16_epi16(cospi[42], cospi[22]);
  332|   321k|  __m256i cospi_p22_m42 = pair_set_w16_epi16(cospi[22], -cospi[42]);
  333|   321k|  __m256i cospi_p50_p14 = pair_set_w16_epi16(cospi[50], cospi[14]);
  334|   321k|  __m256i cospi_p14_m50 = pair_set_w16_epi16(cospi[14], -cospi[50]);
  335|   321k|  __m256i cospi_p58_p06 = pair_set_w16_epi16(cospi[58], cospi[6]);
  336|   321k|  __m256i cospi_p06_m58 = pair_set_w16_epi16(cospi[6], -cospi[58]);
  337|       |
  338|       |  // stage 1
  339|   321k|  __m256i x1[16];
  340|   321k|  x1[0] = input[15];
  341|   321k|  x1[1] = input[0];
  342|   321k|  x1[2] = input[13];
  343|   321k|  x1[3] = input[2];
  344|   321k|  x1[4] = input[11];
  345|   321k|  x1[5] = input[4];
  346|   321k|  x1[6] = input[9];
  347|   321k|  x1[7] = input[6];
  348|   321k|  x1[8] = input[7];
  349|   321k|  x1[9] = input[8];
  350|   321k|  x1[10] = input[5];
  351|   321k|  x1[11] = input[10];
  352|   321k|  x1[12] = input[3];
  353|   321k|  x1[13] = input[12];
  354|   321k|  x1[14] = input[1];
  355|   321k|  x1[15] = input[14];
  356|       |
  357|       |  // stage 2
  358|   321k|  btf_16_w16_avx2(cospi_p02_p62, cospi_p62_m02, &x1[0], &x1[1], _r,
  359|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  360|   321k|  btf_16_w16_avx2(cospi_p10_p54, cospi_p54_m10, &x1[2], &x1[3], _r,
  361|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  362|   321k|  btf_16_w16_avx2(cospi_p18_p46, cospi_p46_m18, &x1[4], &x1[5], _r,
  363|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  364|   321k|  btf_16_w16_avx2(cospi_p26_p38, cospi_p38_m26, &x1[6], &x1[7], _r,
  365|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  366|   321k|  btf_16_w16_avx2(cospi_p34_p30, cospi_p30_m34, &x1[8], &x1[9], _r,
  367|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  368|   321k|  btf_16_w16_avx2(cospi_p42_p22, cospi_p22_m42, &x1[10], &x1[11], _r,
  369|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  370|   321k|  btf_16_w16_avx2(cospi_p50_p14, cospi_p14_m50, &x1[12], &x1[13], _r,
  371|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  372|   321k|  btf_16_w16_avx2(cospi_p58_p06, cospi_p06_m58, &x1[14], &x1[15], _r,
  373|   321k|                  INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  374|       |
  375|   321k|  iadst16_stage3_avx2(x1);
  376|   321k|  iadst16_stage4_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  377|   321k|  iadst16_stage5_avx2(x1);
  378|   321k|  iadst16_stage6_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  379|   321k|  iadst16_stage7_avx2(x1);
  380|   321k|  iadst16_stage8_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   321k|#define INV_COS_BIT 12
  ------------------
  381|   321k|  iadst16_stage9_avx2(output, x1);
  382|   321k|}
av1_inv_txfm_avx2.c:idct32_low1_avx2:
  586|  13.0k|static void idct32_low1_avx2(const __m256i *input, __m256i *output) {
  587|  13.0k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  13.0k|#define INV_COS_BIT 12
  ------------------
  588|       |
  589|       |  // stage 1
  590|  13.0k|  __m256i x[2];
  591|  13.0k|  x[0] = input[0];
  592|       |
  593|       |  // stage 2
  594|       |  // stage 3
  595|       |  // stage 4
  596|       |  // stage 5
  597|  13.0k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  13.0k|  do {                                             \
  |  |   31|  13.0k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  13.0k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  13.0k|    const __m256i _in = in;                        \
  |  |   34|  13.0k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  13.0k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  13.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
  598|       |
  599|       |  // stage 6
  600|       |  // stage 7
  601|       |  // stage 8
  602|       |  // stage 9
  603|  13.0k|  output[0] = x[0];
  604|  13.0k|  output[31] = x[0];
  605|  13.0k|  output[1] = x[1];
  606|  13.0k|  output[30] = x[1];
  607|  13.0k|  output[2] = x[1];
  608|  13.0k|  output[29] = x[1];
  609|  13.0k|  output[3] = x[0];
  610|  13.0k|  output[28] = x[0];
  611|  13.0k|  output[4] = x[0];
  612|  13.0k|  output[27] = x[0];
  613|  13.0k|  output[5] = x[1];
  614|  13.0k|  output[26] = x[1];
  615|  13.0k|  output[6] = x[1];
  616|  13.0k|  output[25] = x[1];
  617|  13.0k|  output[7] = x[0];
  618|  13.0k|  output[24] = x[0];
  619|  13.0k|  output[8] = x[0];
  620|  13.0k|  output[23] = x[0];
  621|  13.0k|  output[9] = x[1];
  622|  13.0k|  output[22] = x[1];
  623|  13.0k|  output[10] = x[1];
  624|  13.0k|  output[21] = x[1];
  625|  13.0k|  output[11] = x[0];
  626|  13.0k|  output[20] = x[0];
  627|  13.0k|  output[12] = x[0];
  628|  13.0k|  output[19] = x[0];
  629|  13.0k|  output[13] = x[1];
  630|  13.0k|  output[18] = x[1];
  631|  13.0k|  output[14] = x[1];
  632|  13.0k|  output[17] = x[1];
  633|  13.0k|  output[15] = x[0];
  634|  13.0k|  output[16] = x[0];
  635|  13.0k|}
av1_inv_txfm_avx2.c:idct32_low8_avx2:
  637|  18.4k|static void idct32_low8_avx2(const __m256i *input, __m256i *output) {
  638|  18.4k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  639|  18.4k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  640|       |
  641|       |  // stage 1
  642|  18.4k|  __m256i x[32];
  643|  18.4k|  x[0] = input[0];
  644|  18.4k|  x[4] = input[4];
  645|  18.4k|  x[8] = input[2];
  646|  18.4k|  x[12] = input[6];
  647|  18.4k|  x[16] = input[1];
  648|  18.4k|  x[20] = input[5];
  649|  18.4k|  x[24] = input[3];
  650|  18.4k|  x[28] = input[7];
  651|       |
  652|       |  // stage 2
  653|  18.4k|  btf_16_w16_0_avx2(cospi[62], cospi[2], x[16], x[16], x[31]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  654|  18.4k|  btf_16_w16_0_avx2(-cospi[50], cospi[14], x[28], x[19], x[28]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  655|  18.4k|  btf_16_w16_0_avx2(cospi[54], cospi[10], x[20], x[20], x[27]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  656|  18.4k|  btf_16_w16_0_avx2(-cospi[58], cospi[6], x[24], x[23], x[24]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  657|       |
  658|       |  // stage 3
  659|  18.4k|  btf_16_w16_0_avx2(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  660|  18.4k|  btf_16_w16_0_avx2(-cospi[52], cospi[12], x[12], x[11], x[12]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  661|  18.4k|  x[17] = x[16];
  662|  18.4k|  x[18] = x[19];
  663|  18.4k|  x[21] = x[20];
  664|  18.4k|  x[22] = x[23];
  665|  18.4k|  x[25] = x[24];
  666|  18.4k|  x[26] = x[27];
  667|  18.4k|  x[29] = x[28];
  668|  18.4k|  x[30] = x[31];
  669|       |
  670|       |  // stage 4
  671|  18.4k|  btf_16_w16_0_avx2(cospi[56], cospi[8], x[4], x[4], x[7]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  672|  18.4k|  x[9] = x[8];
  673|  18.4k|  x[10] = x[11];
  674|  18.4k|  x[13] = x[12];
  675|  18.4k|  x[14] = x[15];
  676|  18.4k|  idct32_high16_stage4_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  677|       |
  678|       |  // stage 5
  679|  18.4k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  18.4k|  do {                                             \
  |  |   31|  18.4k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  18.4k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  18.4k|    const __m256i _in = in;                        \
  |  |   34|  18.4k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  18.4k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  680|  18.4k|  x[5] = x[4];
  681|  18.4k|  x[6] = x[7];
  682|  18.4k|  idct32_high24_stage5_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  683|       |  // stage 6
  684|  18.4k|  x[3] = x[0];
  685|  18.4k|  x[2] = x[1];
  686|  18.4k|  idct32_high28_stage6_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  687|       |
  688|  18.4k|  idct32_stage7_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  689|  18.4k|  idct32_stage8_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  18.4k|#define INV_COS_BIT 12
  ------------------
  690|  18.4k|  idct32_stage9_avx2(output, x);
  691|  18.4k|}
av1_inv_txfm_avx2.c:idct32_high16_stage4_avx2:
  481|   613k|                                             const __m256i _r, int8_t cos_bit) {
  482|   613k|  const __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
  483|   613k|  const __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
  484|   613k|  const __m256i cospi_m56_m08 = pair_set_w16_epi16(-cospi[56], -cospi[8]);
  485|   613k|  const __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
  486|   613k|  const __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
  487|   613k|  const __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
  488|   613k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x[17], &x[30], _r, cos_bit);
  489|   613k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x[18], &x[29], _r, cos_bit);
  490|   613k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x[21], &x[26], _r, cos_bit);
  491|   613k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x[22], &x[25], _r, cos_bit);
  492|   613k|}
av1_inv_txfm_avx2.c:idct32_high24_stage5_avx2:
  495|   613k|                                             const __m256i _r, int8_t cos_bit) {
  496|   613k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  497|   613k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  498|   613k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  499|   613k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[9], &x[14], _r, cos_bit);
  500|   613k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[10], &x[13], _r, cos_bit);
  501|   613k|  btf_16_adds_subs_avx2(&x[16], &x[19]);
  502|   613k|  btf_16_adds_subs_avx2(&x[17], &x[18]);
  503|   613k|  btf_16_adds_subs_avx2(&x[23], &x[20]);
  504|   613k|  btf_16_adds_subs_avx2(&x[22], &x[21]);
  505|   613k|  btf_16_adds_subs_avx2(&x[24], &x[27]);
  506|   613k|  btf_16_adds_subs_avx2(&x[25], &x[26]);
  507|   613k|  btf_16_adds_subs_avx2(&x[31], &x[28]);
  508|   613k|  btf_16_adds_subs_avx2(&x[30], &x[29]);
  509|   613k|}
av1_inv_txfm_avx2.c:idct32_high28_stage6_avx2:
  512|   613k|                                             const __m256i _r, int8_t cos_bit) {
  513|   613k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
  514|   613k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  515|   613k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  516|   613k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  517|   613k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  518|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[5], &x[6], _r, cos_bit);
  519|   613k|  btf_16_adds_subs_avx2(&x[8], &x[11]);
  520|   613k|  btf_16_adds_subs_avx2(&x[9], &x[10]);
  521|   613k|  btf_16_adds_subs_avx2(&x[15], &x[12]);
  522|   613k|  btf_16_adds_subs_avx2(&x[14], &x[13]);
  523|   613k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[18], &x[29], _r, cos_bit);
  524|   613k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[19], &x[28], _r, cos_bit);
  525|   613k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[20], &x[27], _r, cos_bit);
  526|   613k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[21], &x[26], _r, cos_bit);
  527|   613k|}
av1_inv_txfm_avx2.c:idct32_stage7_avx2:
  530|   613k|                                      const __m256i _r, int8_t cos_bit) {
  531|   613k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
  532|   613k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  533|   613k|  btf_16_adds_subs_avx2(&x[0], &x[7]);
  534|   613k|  btf_16_adds_subs_avx2(&x[1], &x[6]);
  535|   613k|  btf_16_adds_subs_avx2(&x[2], &x[5]);
  536|   613k|  btf_16_adds_subs_avx2(&x[3], &x[4]);
  537|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[10], &x[13], _r, cos_bit);
  538|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[11], &x[12], _r, cos_bit);
  539|   613k|  btf_16_adds_subs_avx2(&x[16], &x[23]);
  540|   613k|  btf_16_adds_subs_avx2(&x[17], &x[22]);
  541|   613k|  btf_16_adds_subs_avx2(&x[18], &x[21]);
  542|   613k|  btf_16_adds_subs_avx2(&x[19], &x[20]);
  543|   613k|  btf_16_adds_subs_avx2(&x[31], &x[24]);
  544|   613k|  btf_16_adds_subs_avx2(&x[30], &x[25]);
  545|   613k|  btf_16_adds_subs_avx2(&x[29], &x[26]);
  546|   613k|  btf_16_adds_subs_avx2(&x[28], &x[27]);
  547|   613k|}
av1_inv_txfm_avx2.c:idct32_stage8_avx2:
  550|   613k|                                      const __m256i _r, int8_t cos_bit) {
  551|   613k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
  552|   613k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  553|   613k|  btf_16_adds_subs_avx2(&x[0], &x[15]);
  554|   613k|  btf_16_adds_subs_avx2(&x[1], &x[14]);
  555|   613k|  btf_16_adds_subs_avx2(&x[2], &x[13]);
  556|   613k|  btf_16_adds_subs_avx2(&x[3], &x[12]);
  557|   613k|  btf_16_adds_subs_avx2(&x[4], &x[11]);
  558|   613k|  btf_16_adds_subs_avx2(&x[5], &x[10]);
  559|   613k|  btf_16_adds_subs_avx2(&x[6], &x[9]);
  560|   613k|  btf_16_adds_subs_avx2(&x[7], &x[8]);
  561|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[20], &x[27], _r, cos_bit);
  562|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[21], &x[26], _r, cos_bit);
  563|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[22], &x[25], _r, cos_bit);
  564|   613k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[23], &x[24], _r, cos_bit);
  565|   613k|}
av1_inv_txfm_avx2.c:idct32_stage9_avx2:
  567|   613k|static inline void idct32_stage9_avx2(__m256i *output, __m256i *x) {
  568|   613k|  btf_16_adds_subs_out_avx2(&output[0], &output[31], x[0], x[31]);
  569|   613k|  btf_16_adds_subs_out_avx2(&output[1], &output[30], x[1], x[30]);
  570|   613k|  btf_16_adds_subs_out_avx2(&output[2], &output[29], x[2], x[29]);
  571|   613k|  btf_16_adds_subs_out_avx2(&output[3], &output[28], x[3], x[28]);
  572|   613k|  btf_16_adds_subs_out_avx2(&output[4], &output[27], x[4], x[27]);
  573|   613k|  btf_16_adds_subs_out_avx2(&output[5], &output[26], x[5], x[26]);
  574|   613k|  btf_16_adds_subs_out_avx2(&output[6], &output[25], x[6], x[25]);
  575|   613k|  btf_16_adds_subs_out_avx2(&output[7], &output[24], x[7], x[24]);
  576|   613k|  btf_16_adds_subs_out_avx2(&output[8], &output[23], x[8], x[23]);
  577|   613k|  btf_16_adds_subs_out_avx2(&output[9], &output[22], x[9], x[22]);
  578|   613k|  btf_16_adds_subs_out_avx2(&output[10], &output[21], x[10], x[21]);
  579|   613k|  btf_16_adds_subs_out_avx2(&output[11], &output[20], x[11], x[20]);
  580|   613k|  btf_16_adds_subs_out_avx2(&output[12], &output[19], x[12], x[19]);
  581|   613k|  btf_16_adds_subs_out_avx2(&output[13], &output[18], x[13], x[18]);
  582|   613k|  btf_16_adds_subs_out_avx2(&output[14], &output[17], x[14], x[17]);
  583|   613k|  btf_16_adds_subs_out_avx2(&output[15], &output[16], x[15], x[16]);
  584|   613k|}
av1_inv_txfm_avx2.c:idct32_low16_avx2:
  693|  32.3k|static void idct32_low16_avx2(const __m256i *input, __m256i *output) {
  694|  32.3k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  695|  32.3k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  696|       |
  697|       |  // stage 1
  698|  32.3k|  __m256i x[32];
  699|  32.3k|  x[0] = input[0];
  700|  32.3k|  x[2] = input[8];
  701|  32.3k|  x[4] = input[4];
  702|  32.3k|  x[6] = input[12];
  703|  32.3k|  x[8] = input[2];
  704|  32.3k|  x[10] = input[10];
  705|  32.3k|  x[12] = input[6];
  706|  32.3k|  x[14] = input[14];
  707|  32.3k|  x[16] = input[1];
  708|  32.3k|  x[18] = input[9];
  709|  32.3k|  x[20] = input[5];
  710|  32.3k|  x[22] = input[13];
  711|  32.3k|  x[24] = input[3];
  712|  32.3k|  x[26] = input[11];
  713|  32.3k|  x[28] = input[7];
  714|  32.3k|  x[30] = input[15];
  715|       |
  716|       |  // stage 2
  717|  32.3k|  btf_16_w16_0_avx2(cospi[62], cospi[2], x[16], x[16], x[31]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  718|  32.3k|  btf_16_w16_0_avx2(-cospi[34], cospi[30], x[30], x[17], x[30]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  719|  32.3k|  btf_16_w16_0_avx2(cospi[46], cospi[18], x[18], x[18], x[29]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  720|  32.3k|  btf_16_w16_0_avx2(-cospi[50], cospi[14], x[28], x[19], x[28]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  721|  32.3k|  btf_16_w16_0_avx2(cospi[54], cospi[10], x[20], x[20], x[27]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  722|  32.3k|  btf_16_w16_0_avx2(-cospi[42], cospi[22], x[26], x[21], x[26]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  723|  32.3k|  btf_16_w16_0_avx2(cospi[38], cospi[26], x[22], x[22], x[25]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  724|  32.3k|  btf_16_w16_0_avx2(-cospi[58], cospi[6], x[24], x[23], x[24]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  725|       |
  726|       |  // stage 3
  727|  32.3k|  btf_16_w16_0_avx2(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  728|  32.3k|  btf_16_w16_0_avx2(-cospi[36], cospi[28], x[14], x[9], x[14]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  729|  32.3k|  btf_16_w16_0_avx2(cospi[44], cospi[20], x[10], x[10], x[13]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  730|  32.3k|  btf_16_w16_0_avx2(-cospi[52], cospi[12], x[12], x[11], x[12]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  731|  32.3k|  idct32_high16_stage3_avx2(x);
  732|       |
  733|       |  // stage 4
  734|  32.3k|  btf_16_w16_0_avx2(cospi[56], cospi[8], x[4], x[4], x[7]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  735|  32.3k|  btf_16_w16_0_avx2(-cospi[40], cospi[24], x[6], x[5], x[6]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  736|  32.3k|  btf_16_adds_subs_avx2(&x[8], &x[9]);
  737|  32.3k|  btf_16_adds_subs_avx2(&x[11], &x[10]);
  738|  32.3k|  btf_16_adds_subs_avx2(&x[12], &x[13]);
  739|  32.3k|  btf_16_adds_subs_avx2(&x[15], &x[14]);
  740|  32.3k|  idct32_high16_stage4_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  741|       |
  742|       |  // stage 5
  743|  32.3k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  744|  32.3k|  btf_16_w16_0_avx2(cospi[48], cospi[16], x[2], x[2], x[3]);
  ------------------
  |  |   30|  32.3k|  do {                                             \
  |  |   31|  32.3k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  32.3k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  32.3k|    const __m256i _in = in;                        \
  |  |   34|  32.3k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  32.3k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  32.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  745|  32.3k|  btf_16_adds_subs_avx2(&x[4], &x[5]);
  746|  32.3k|  btf_16_adds_subs_avx2(&x[7], &x[6]);
  747|  32.3k|  idct32_high24_stage5_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  748|       |
  749|  32.3k|  btf_16_adds_subs_avx2(&x[0], &x[3]);
  750|  32.3k|  btf_16_adds_subs_avx2(&x[1], &x[2]);
  751|  32.3k|  idct32_high28_stage6_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  752|       |
  753|  32.3k|  idct32_stage7_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  754|  32.3k|  idct32_stage8_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  32.3k|#define INV_COS_BIT 12
  ------------------
  755|  32.3k|  idct32_stage9_avx2(output, x);
  756|  32.3k|}
av1_inv_txfm_avx2.c:idct32_high16_stage3_avx2:
  469|   595k|static inline void idct32_high16_stage3_avx2(__m256i *x) {
  470|   595k|  btf_16_adds_subs_avx2(&x[16], &x[17]);
  471|   595k|  btf_16_adds_subs_avx2(&x[19], &x[18]);
  472|   595k|  btf_16_adds_subs_avx2(&x[20], &x[21]);
  473|   595k|  btf_16_adds_subs_avx2(&x[23], &x[22]);
  474|   595k|  btf_16_adds_subs_avx2(&x[24], &x[25]);
  475|   595k|  btf_16_adds_subs_avx2(&x[27], &x[26]);
  476|   595k|  btf_16_adds_subs_avx2(&x[28], &x[29]);
  477|   595k|  btf_16_adds_subs_avx2(&x[31], &x[30]);
  478|   595k|}
av1_inv_txfm_avx2.c:idct32_avx2:
  758|   562k|static void idct32_avx2(const __m256i *input, __m256i *output) {
  759|   562k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  760|   562k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  761|       |
  762|   562k|  __m256i cospi_p62_m02 = pair_set_w16_epi16(cospi[62], -cospi[2]);
  763|   562k|  __m256i cospi_p02_p62 = pair_set_w16_epi16(cospi[2], cospi[62]);
  764|   562k|  __m256i cospi_p30_m34 = pair_set_w16_epi16(cospi[30], -cospi[34]);
  765|   562k|  __m256i cospi_p34_p30 = pair_set_w16_epi16(cospi[34], cospi[30]);
  766|   562k|  __m256i cospi_p46_m18 = pair_set_w16_epi16(cospi[46], -cospi[18]);
  767|   562k|  __m256i cospi_p18_p46 = pair_set_w16_epi16(cospi[18], cospi[46]);
  768|   562k|  __m256i cospi_p14_m50 = pair_set_w16_epi16(cospi[14], -cospi[50]);
  769|   562k|  __m256i cospi_p50_p14 = pair_set_w16_epi16(cospi[50], cospi[14]);
  770|   562k|  __m256i cospi_p54_m10 = pair_set_w16_epi16(cospi[54], -cospi[10]);
  771|   562k|  __m256i cospi_p10_p54 = pair_set_w16_epi16(cospi[10], cospi[54]);
  772|   562k|  __m256i cospi_p22_m42 = pair_set_w16_epi16(cospi[22], -cospi[42]);
  773|   562k|  __m256i cospi_p42_p22 = pair_set_w16_epi16(cospi[42], cospi[22]);
  774|   562k|  __m256i cospi_p38_m26 = pair_set_w16_epi16(cospi[38], -cospi[26]);
  775|   562k|  __m256i cospi_p26_p38 = pair_set_w16_epi16(cospi[26], cospi[38]);
  776|   562k|  __m256i cospi_p06_m58 = pair_set_w16_epi16(cospi[6], -cospi[58]);
  777|   562k|  __m256i cospi_p58_p06 = pair_set_w16_epi16(cospi[58], cospi[6]);
  778|   562k|  __m256i cospi_p60_m04 = pair_set_w16_epi16(cospi[60], -cospi[4]);
  779|   562k|  __m256i cospi_p04_p60 = pair_set_w16_epi16(cospi[4], cospi[60]);
  780|   562k|  __m256i cospi_p28_m36 = pair_set_w16_epi16(cospi[28], -cospi[36]);
  781|   562k|  __m256i cospi_p36_p28 = pair_set_w16_epi16(cospi[36], cospi[28]);
  782|   562k|  __m256i cospi_p44_m20 = pair_set_w16_epi16(cospi[44], -cospi[20]);
  783|   562k|  __m256i cospi_p20_p44 = pair_set_w16_epi16(cospi[20], cospi[44]);
  784|   562k|  __m256i cospi_p12_m52 = pair_set_w16_epi16(cospi[12], -cospi[52]);
  785|   562k|  __m256i cospi_p52_p12 = pair_set_w16_epi16(cospi[52], cospi[12]);
  786|   562k|  __m256i cospi_p56_m08 = pair_set_w16_epi16(cospi[56], -cospi[8]);
  787|   562k|  __m256i cospi_p08_p56 = pair_set_w16_epi16(cospi[8], cospi[56]);
  788|   562k|  __m256i cospi_p24_m40 = pair_set_w16_epi16(cospi[24], -cospi[40]);
  789|   562k|  __m256i cospi_p40_p24 = pair_set_w16_epi16(cospi[40], cospi[24]);
  790|   562k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  791|   562k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
  792|   562k|  __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
  793|   562k|  __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
  794|       |
  795|       |  // stage 1
  796|   562k|  __m256i x1[32];
  797|   562k|  x1[0] = input[0];
  798|   562k|  x1[1] = input[16];
  799|   562k|  x1[2] = input[8];
  800|   562k|  x1[3] = input[24];
  801|   562k|  x1[4] = input[4];
  802|   562k|  x1[5] = input[20];
  803|   562k|  x1[6] = input[12];
  804|   562k|  x1[7] = input[28];
  805|   562k|  x1[8] = input[2];
  806|   562k|  x1[9] = input[18];
  807|   562k|  x1[10] = input[10];
  808|   562k|  x1[11] = input[26];
  809|   562k|  x1[12] = input[6];
  810|   562k|  x1[13] = input[22];
  811|   562k|  x1[14] = input[14];
  812|   562k|  x1[15] = input[30];
  813|   562k|  x1[16] = input[1];
  814|   562k|  x1[17] = input[17];
  815|   562k|  x1[18] = input[9];
  816|   562k|  x1[19] = input[25];
  817|   562k|  x1[20] = input[5];
  818|   562k|  x1[21] = input[21];
  819|   562k|  x1[22] = input[13];
  820|   562k|  x1[23] = input[29];
  821|   562k|  x1[24] = input[3];
  822|   562k|  x1[25] = input[19];
  823|   562k|  x1[26] = input[11];
  824|   562k|  x1[27] = input[27];
  825|   562k|  x1[28] = input[7];
  826|   562k|  x1[29] = input[23];
  827|   562k|  x1[30] = input[15];
  828|   562k|  x1[31] = input[31];
  829|       |
  830|       |  // stage 2
  831|   562k|  btf_16_w16_avx2(cospi_p62_m02, cospi_p02_p62, &x1[16], &x1[31], _r,
  832|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  833|   562k|  btf_16_w16_avx2(cospi_p30_m34, cospi_p34_p30, &x1[17], &x1[30], _r,
  834|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  835|   562k|  btf_16_w16_avx2(cospi_p46_m18, cospi_p18_p46, &x1[18], &x1[29], _r,
  836|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  837|   562k|  btf_16_w16_avx2(cospi_p14_m50, cospi_p50_p14, &x1[19], &x1[28], _r,
  838|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  839|   562k|  btf_16_w16_avx2(cospi_p54_m10, cospi_p10_p54, &x1[20], &x1[27], _r,
  840|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  841|   562k|  btf_16_w16_avx2(cospi_p22_m42, cospi_p42_p22, &x1[21], &x1[26], _r,
  842|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  843|   562k|  btf_16_w16_avx2(cospi_p38_m26, cospi_p26_p38, &x1[22], &x1[25], _r,
  844|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  845|   562k|  btf_16_w16_avx2(cospi_p06_m58, cospi_p58_p06, &x1[23], &x1[24], _r,
  846|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  847|       |
  848|       |  // stage 3
  849|   562k|  btf_16_w16_avx2(cospi_p60_m04, cospi_p04_p60, &x1[8], &x1[15], _r,
  850|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  851|   562k|  btf_16_w16_avx2(cospi_p28_m36, cospi_p36_p28, &x1[9], &x1[14], _r,
  852|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  853|   562k|  btf_16_w16_avx2(cospi_p44_m20, cospi_p20_p44, &x1[10], &x1[13], _r,
  854|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  855|   562k|  btf_16_w16_avx2(cospi_p12_m52, cospi_p52_p12, &x1[11], &x1[12], _r,
  856|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  857|   562k|  idct32_high16_stage3_avx2(x1);
  858|       |
  859|       |  // stage 4
  860|   562k|  btf_16_w16_avx2(cospi_p56_m08, cospi_p08_p56, &x1[4], &x1[7], _r,
  861|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  862|   562k|  btf_16_w16_avx2(cospi_p24_m40, cospi_p40_p24, &x1[5], &x1[6], _r,
  863|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  864|   562k|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
  865|   562k|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
  866|   562k|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
  867|   562k|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
  868|   562k|  idct32_high16_stage4_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  869|       |
  870|       |  // stage 5
  871|   562k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[0], &x1[1], _r,
  872|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  873|   562k|  btf_16_w16_avx2(cospi_p48_m16, cospi_p16_p48, &x1[2], &x1[3], _r,
  874|   562k|                  INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  875|   562k|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
  876|   562k|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
  877|   562k|  idct32_high24_stage5_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  878|       |
  879|       |  // stage 6
  880|   562k|  btf_16_adds_subs_avx2(&x1[0], &x1[3]);
  881|   562k|  btf_16_adds_subs_avx2(&x1[1], &x1[2]);
  882|   562k|  idct32_high28_stage6_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  883|       |
  884|   562k|  idct32_stage7_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  885|   562k|  idct32_stage8_avx2(x1, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|   562k|#define INV_COS_BIT 12
  ------------------
  886|   562k|  idct32_stage9_avx2(output, x1);
  887|   562k|}
av1_inv_txfm_avx2.c:idct64_low1_avx2:
 1130|  1.32k|static void idct64_low1_avx2(const __m256i *input, __m256i *output) {
 1131|  1.32k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  1.32k|#define INV_COS_BIT 12
  ------------------
 1132|       |
 1133|       |  // stage 1
 1134|  1.32k|  __m256i x[32];
 1135|  1.32k|  x[0] = input[0];
 1136|       |
 1137|       |  // stage 2
 1138|       |  // stage 3
 1139|       |  // stage 4
 1140|       |  // stage 5
 1141|       |  // stage 6
 1142|  1.32k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  1.32k|  do {                                             \
  |  |   31|  1.32k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.32k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.32k|    const __m256i _in = in;                        \
  |  |   34|  1.32k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.32k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.32k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
 1143|       |
 1144|       |  // stage 7
 1145|       |  // stage 8
 1146|       |  // stage 9
 1147|       |  // stage 10
 1148|       |  // stage 11
 1149|  1.32k|  output[0] = x[0];
 1150|  1.32k|  output[63] = x[0];
 1151|  1.32k|  output[1] = x[1];
 1152|  1.32k|  output[62] = x[1];
 1153|  1.32k|  output[2] = x[1];
 1154|  1.32k|  output[61] = x[1];
 1155|  1.32k|  output[3] = x[0];
 1156|  1.32k|  output[60] = x[0];
 1157|  1.32k|  output[4] = x[0];
 1158|  1.32k|  output[59] = x[0];
 1159|  1.32k|  output[5] = x[1];
 1160|  1.32k|  output[58] = x[1];
 1161|  1.32k|  output[6] = x[1];
 1162|  1.32k|  output[57] = x[1];
 1163|  1.32k|  output[7] = x[0];
 1164|  1.32k|  output[56] = x[0];
 1165|  1.32k|  output[8] = x[0];
 1166|  1.32k|  output[55] = x[0];
 1167|  1.32k|  output[9] = x[1];
 1168|  1.32k|  output[54] = x[1];
 1169|  1.32k|  output[10] = x[1];
 1170|  1.32k|  output[53] = x[1];
 1171|  1.32k|  output[11] = x[0];
 1172|  1.32k|  output[52] = x[0];
 1173|  1.32k|  output[12] = x[0];
 1174|  1.32k|  output[51] = x[0];
 1175|  1.32k|  output[13] = x[1];
 1176|  1.32k|  output[50] = x[1];
 1177|  1.32k|  output[14] = x[1];
 1178|  1.32k|  output[49] = x[1];
 1179|  1.32k|  output[15] = x[0];
 1180|  1.32k|  output[48] = x[0];
 1181|  1.32k|  output[16] = x[0];
 1182|  1.32k|  output[47] = x[0];
 1183|  1.32k|  output[17] = x[1];
 1184|  1.32k|  output[46] = x[1];
 1185|  1.32k|  output[18] = x[1];
 1186|  1.32k|  output[45] = x[1];
 1187|  1.32k|  output[19] = x[0];
 1188|  1.32k|  output[44] = x[0];
 1189|  1.32k|  output[20] = x[0];
 1190|  1.32k|  output[43] = x[0];
 1191|  1.32k|  output[21] = x[1];
 1192|  1.32k|  output[42] = x[1];
 1193|  1.32k|  output[22] = x[1];
 1194|  1.32k|  output[41] = x[1];
 1195|  1.32k|  output[23] = x[0];
 1196|  1.32k|  output[40] = x[0];
 1197|  1.32k|  output[24] = x[0];
 1198|  1.32k|  output[39] = x[0];
 1199|  1.32k|  output[25] = x[1];
 1200|  1.32k|  output[38] = x[1];
 1201|  1.32k|  output[26] = x[1];
 1202|  1.32k|  output[37] = x[1];
 1203|  1.32k|  output[27] = x[0];
 1204|  1.32k|  output[36] = x[0];
 1205|  1.32k|  output[28] = x[0];
 1206|  1.32k|  output[35] = x[0];
 1207|  1.32k|  output[29] = x[1];
 1208|  1.32k|  output[34] = x[1];
 1209|  1.32k|  output[30] = x[1];
 1210|  1.32k|  output[33] = x[1];
 1211|  1.32k|  output[31] = x[0];
 1212|  1.32k|  output[32] = x[0];
 1213|  1.32k|}
av1_inv_txfm_avx2.c:idct64_low8_avx2:
 1215|    278|static void idct64_low8_avx2(const __m256i *input, __m256i *output) {
 1216|    278|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1217|    278|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1218|    278|  const __m256i cospi_m04_p60 = pair_set_w16_epi16(-cospi[4], cospi[60]);
 1219|    278|  const __m256i cospi_p60_p04 = pair_set_w16_epi16(cospi[60], cospi[4]);
 1220|    278|  const __m256i cospi_m36_p28 = pair_set_w16_epi16(-cospi[36], cospi[28]);
 1221|    278|  const __m256i cospi_m28_m36 = pair_set_w16_epi16(-cospi[28], -cospi[36]);
 1222|    278|  const __m256i cospi_m20_p44 = pair_set_w16_epi16(-cospi[20], cospi[44]);
 1223|    278|  const __m256i cospi_p44_p20 = pair_set_w16_epi16(cospi[44], cospi[20]);
 1224|    278|  const __m256i cospi_m52_p12 = pair_set_w16_epi16(-cospi[52], cospi[12]);
 1225|    278|  const __m256i cospi_m12_m52 = pair_set_w16_epi16(-cospi[12], -cospi[52]);
 1226|    278|  const __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
 1227|    278|  const __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
 1228|    278|  const __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
 1229|    278|  const __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
 1230|    278|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1231|    278|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
 1232|    278|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
 1233|    278|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 1234|       |
 1235|       |  // stage 1
 1236|    278|  __m256i x[64];
 1237|    278|  x[0] = input[0];
 1238|    278|  x[8] = input[4];
 1239|    278|  x[16] = input[2];
 1240|    278|  x[24] = input[6];
 1241|    278|  x[32] = input[1];
 1242|    278|  x[40] = input[5];
 1243|    278|  x[48] = input[3];
 1244|    278|  x[56] = input[7];
 1245|       |
 1246|       |  // stage 2
 1247|    278|  btf_16_w16_0_avx2(cospi[63], cospi[1], x[32], x[32], x[63]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1248|    278|  btf_16_w16_0_avx2(-cospi[57], cospi[7], x[56], x[39], x[56]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1249|    278|  btf_16_w16_0_avx2(cospi[59], cospi[5], x[40], x[40], x[55]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1250|    278|  btf_16_w16_0_avx2(-cospi[61], cospi[3], x[48], x[47], x[48]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |  // stage 3
 1253|    278|  btf_16_w16_0_avx2(cospi[62], cospi[2], x[16], x[16], x[31]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1254|    278|  btf_16_w16_0_avx2(-cospi[58], cospi[6], x[24], x[23], x[24]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1255|    278|  x[33] = x[32];
 1256|    278|  x[38] = x[39];
 1257|    278|  x[41] = x[40];
 1258|    278|  x[46] = x[47];
 1259|    278|  x[49] = x[48];
 1260|    278|  x[54] = x[55];
 1261|    278|  x[57] = x[56];
 1262|    278|  x[62] = x[63];
 1263|       |
 1264|       |  // stage 4
 1265|    278|  btf_16_w16_0_avx2(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1266|    278|  x[17] = x[16];
 1267|    278|  x[22] = x[23];
 1268|    278|  x[25] = x[24];
 1269|    278|  x[30] = x[31];
 1270|    278|  btf_16_w16_avx2(cospi_m04_p60, cospi_p60_p04, &x[33], &x[62], _r,
 1271|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1272|    278|  btf_16_w16_avx2(cospi_m28_m36, cospi_m36_p28, &x[38], &x[57], _r,
 1273|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1274|    278|  btf_16_w16_avx2(cospi_m20_p44, cospi_p44_p20, &x[41], &x[54], _r,
 1275|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1276|    278|  btf_16_w16_avx2(cospi_m12_m52, cospi_m52_p12, &x[46], &x[49], _r,
 1277|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1278|       |
 1279|       |  // stage 5
 1280|    278|  x[9] = x[8];
 1281|    278|  x[14] = x[15];
 1282|    278|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x[17], &x[30], _r,
 1283|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1284|    278|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x[22], &x[25], _r,
 1285|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1286|    278|  x[35] = x[32];
 1287|    278|  x[34] = x[33];
 1288|    278|  x[36] = x[39];
 1289|    278|  x[37] = x[38];
 1290|    278|  x[43] = x[40];
 1291|    278|  x[42] = x[41];
 1292|    278|  x[44] = x[47];
 1293|    278|  x[45] = x[46];
 1294|    278|  x[51] = x[48];
 1295|    278|  x[50] = x[49];
 1296|    278|  x[52] = x[55];
 1297|    278|  x[53] = x[54];
 1298|    278|  x[59] = x[56];
 1299|    278|  x[58] = x[57];
 1300|    278|  x[60] = x[63];
 1301|    278|  x[61] = x[62];
 1302|       |
 1303|       |  // stage 6
 1304|    278|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|    278|  do {                                             \
  |  |   31|    278|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|    278|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|    278|    const __m256i _in = in;                        \
  |  |   34|    278|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|    278|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
 1305|    278|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[9], &x[14], _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1306|    278|  x[19] = x[16];
 1307|    278|  x[18] = x[17];
 1308|    278|  x[20] = x[23];
 1309|    278|  x[21] = x[22];
 1310|    278|  x[27] = x[24];
 1311|    278|  x[26] = x[25];
 1312|    278|  x[28] = x[31];
 1313|    278|  x[29] = x[30];
 1314|    278|  idct64_stage6_high32_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1315|       |
 1316|       |  // stage 7
 1317|    278|  x[3] = x[0];
 1318|    278|  x[2] = x[1];
 1319|    278|  x[11] = x[8];
 1320|    278|  x[10] = x[9];
 1321|    278|  x[12] = x[15];
 1322|    278|  x[13] = x[14];
 1323|    278|  idct64_stage7_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1324|       |
 1325|       |  // stage 8
 1326|    278|  x[7] = x[0];
 1327|    278|  x[6] = x[1];
 1328|    278|  x[5] = x[2];
 1329|    278|  x[4] = x[3];
 1330|    278|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[10], &x[13], _r,
 1331|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1332|    278|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[11], &x[12], _r,
 1333|    278|                  INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1334|    278|  idct64_stage8_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1335|       |
 1336|    278|  idct64_stage9_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1337|    278|  idct64_stage10_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|    278|#define INV_COS_BIT 12
  ------------------
 1338|    278|  idct64_stage11_avx2(output, x);
 1339|    278|}
av1_inv_txfm_avx2.c:idct64_stage6_high32_avx2:
  946|  59.2k|                                             const __m256i _r, int8_t cos_bit) {
  947|  59.2k|  (void)cos_bit;
  948|  59.2k|  const __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
  949|  59.2k|  const __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
  950|  59.2k|  const __m256i cospi_m56_m08 = pair_set_w16_epi16(-cospi[56], -cospi[8]);
  951|  59.2k|  const __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
  952|  59.2k|  const __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
  953|  59.2k|  const __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
  954|  59.2k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x[34], &x[61], _r, cos_bit);
  955|  59.2k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x[35], &x[60], _r, cos_bit);
  956|  59.2k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x[36], &x[59], _r, cos_bit);
  957|  59.2k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x[37], &x[58], _r, cos_bit);
  958|  59.2k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x[42], &x[53], _r, cos_bit);
  959|  59.2k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x[43], &x[52], _r, cos_bit);
  960|  59.2k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x[44], &x[51], _r, cos_bit);
  961|  59.2k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x[45], &x[50], _r, cos_bit);
  962|  59.2k|}
av1_inv_txfm_avx2.c:idct64_stage7_high48_avx2:
  978|  59.2k|                                             const __m256i _r, int8_t cos_bit) {
  979|  59.2k|  (void)cos_bit;
  980|  59.2k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  981|  59.2k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  982|  59.2k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  983|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[18], &x[29], _r, cos_bit);
  984|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[19], &x[28], _r, cos_bit);
  985|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[20], &x[27], _r, cos_bit);
  986|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[21], &x[26], _r, cos_bit);
  987|  59.2k|  btf_16_adds_subs_avx2(&x[32], &x[39]);
  988|  59.2k|  btf_16_adds_subs_avx2(&x[33], &x[38]);
  989|  59.2k|  btf_16_adds_subs_avx2(&x[34], &x[37]);
  990|  59.2k|  btf_16_adds_subs_avx2(&x[35], &x[36]);
  991|  59.2k|  btf_16_adds_subs_avx2(&x[47], &x[40]);
  992|  59.2k|  btf_16_adds_subs_avx2(&x[46], &x[41]);
  993|  59.2k|  btf_16_adds_subs_avx2(&x[45], &x[42]);
  994|  59.2k|  btf_16_adds_subs_avx2(&x[44], &x[43]);
  995|  59.2k|  btf_16_adds_subs_avx2(&x[48], &x[55]);
  996|  59.2k|  btf_16_adds_subs_avx2(&x[49], &x[54]);
  997|  59.2k|  btf_16_adds_subs_avx2(&x[50], &x[53]);
  998|  59.2k|  btf_16_adds_subs_avx2(&x[51], &x[52]);
  999|  59.2k|  btf_16_adds_subs_avx2(&x[63], &x[56]);
 1000|  59.2k|  btf_16_adds_subs_avx2(&x[62], &x[57]);
 1001|  59.2k|  btf_16_adds_subs_avx2(&x[61], &x[58]);
 1002|  59.2k|  btf_16_adds_subs_avx2(&x[60], &x[59]);
 1003|  59.2k|}
av1_inv_txfm_avx2.c:idct64_stage8_high48_avx2:
 1006|  59.2k|                                             const __m256i _r, int8_t cos_bit) {
 1007|  59.2k|  (void)cos_bit;
 1008|  59.2k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
 1009|  59.2k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
 1010|  59.2k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
 1011|  59.2k|  btf_16_adds_subs_avx2(&x[16], &x[23]);
 1012|  59.2k|  btf_16_adds_subs_avx2(&x[17], &x[22]);
 1013|  59.2k|  btf_16_adds_subs_avx2(&x[18], &x[21]);
 1014|  59.2k|  btf_16_adds_subs_avx2(&x[19], &x[20]);
 1015|  59.2k|  btf_16_adds_subs_avx2(&x[31], &x[24]);
 1016|  59.2k|  btf_16_adds_subs_avx2(&x[30], &x[25]);
 1017|  59.2k|  btf_16_adds_subs_avx2(&x[29], &x[26]);
 1018|  59.2k|  btf_16_adds_subs_avx2(&x[28], &x[27]);
 1019|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[36], &x[59], _r, cos_bit);
 1020|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[37], &x[58], _r, cos_bit);
 1021|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[38], &x[57], _r, cos_bit);
 1022|  59.2k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[39], &x[56], _r, cos_bit);
 1023|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[40], &x[55], _r, cos_bit);
 1024|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[41], &x[54], _r, cos_bit);
 1025|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[42], &x[53], _r, cos_bit);
 1026|  59.2k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[43], &x[52], _r, cos_bit);
 1027|  59.2k|}
av1_inv_txfm_avx2.c:idct64_stage9_avx2:
 1030|  59.2k|                                      const __m256i _r, int8_t cos_bit) {
 1031|  59.2k|  (void)cos_bit;
 1032|  59.2k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 1033|  59.2k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1034|  59.2k|  btf_16_adds_subs_avx2(&x[0], &x[15]);
 1035|  59.2k|  btf_16_adds_subs_avx2(&x[1], &x[14]);
 1036|  59.2k|  btf_16_adds_subs_avx2(&x[2], &x[13]);
 1037|  59.2k|  btf_16_adds_subs_avx2(&x[3], &x[12]);
 1038|  59.2k|  btf_16_adds_subs_avx2(&x[4], &x[11]);
 1039|  59.2k|  btf_16_adds_subs_avx2(&x[5], &x[10]);
 1040|  59.2k|  btf_16_adds_subs_avx2(&x[6], &x[9]);
 1041|  59.2k|  btf_16_adds_subs_avx2(&x[7], &x[8]);
 1042|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[20], &x[27], _r, cos_bit);
 1043|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[21], &x[26], _r, cos_bit);
 1044|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[22], &x[25], _r, cos_bit);
 1045|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[23], &x[24], _r, cos_bit);
 1046|  59.2k|  btf_16_adds_subs_avx2(&x[32], &x[47]);
 1047|  59.2k|  btf_16_adds_subs_avx2(&x[33], &x[46]);
 1048|  59.2k|  btf_16_adds_subs_avx2(&x[34], &x[45]);
 1049|  59.2k|  btf_16_adds_subs_avx2(&x[35], &x[44]);
 1050|  59.2k|  btf_16_adds_subs_avx2(&x[36], &x[43]);
 1051|  59.2k|  btf_16_adds_subs_avx2(&x[37], &x[42]);
 1052|  59.2k|  btf_16_adds_subs_avx2(&x[38], &x[41]);
 1053|  59.2k|  btf_16_adds_subs_avx2(&x[39], &x[40]);
 1054|  59.2k|  btf_16_adds_subs_avx2(&x[63], &x[48]);
 1055|  59.2k|  btf_16_adds_subs_avx2(&x[62], &x[49]);
 1056|  59.2k|  btf_16_adds_subs_avx2(&x[61], &x[50]);
 1057|  59.2k|  btf_16_adds_subs_avx2(&x[60], &x[51]);
 1058|  59.2k|  btf_16_adds_subs_avx2(&x[59], &x[52]);
 1059|  59.2k|  btf_16_adds_subs_avx2(&x[58], &x[53]);
 1060|  59.2k|  btf_16_adds_subs_avx2(&x[57], &x[54]);
 1061|  59.2k|  btf_16_adds_subs_avx2(&x[56], &x[55]);
 1062|  59.2k|}
av1_inv_txfm_avx2.c:idct64_stage10_avx2:
 1065|  59.2k|                                       const __m256i _r, int8_t cos_bit) {
 1066|  59.2k|  (void)cos_bit;
 1067|  59.2k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 1068|  59.2k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1069|  59.2k|  btf_16_adds_subs_avx2(&x[0], &x[31]);
 1070|  59.2k|  btf_16_adds_subs_avx2(&x[1], &x[30]);
 1071|  59.2k|  btf_16_adds_subs_avx2(&x[2], &x[29]);
 1072|  59.2k|  btf_16_adds_subs_avx2(&x[3], &x[28]);
 1073|  59.2k|  btf_16_adds_subs_avx2(&x[4], &x[27]);
 1074|  59.2k|  btf_16_adds_subs_avx2(&x[5], &x[26]);
 1075|  59.2k|  btf_16_adds_subs_avx2(&x[6], &x[25]);
 1076|  59.2k|  btf_16_adds_subs_avx2(&x[7], &x[24]);
 1077|  59.2k|  btf_16_adds_subs_avx2(&x[8], &x[23]);
 1078|  59.2k|  btf_16_adds_subs_avx2(&x[9], &x[22]);
 1079|  59.2k|  btf_16_adds_subs_avx2(&x[10], &x[21]);
 1080|  59.2k|  btf_16_adds_subs_avx2(&x[11], &x[20]);
 1081|  59.2k|  btf_16_adds_subs_avx2(&x[12], &x[19]);
 1082|  59.2k|  btf_16_adds_subs_avx2(&x[13], &x[18]);
 1083|  59.2k|  btf_16_adds_subs_avx2(&x[14], &x[17]);
 1084|  59.2k|  btf_16_adds_subs_avx2(&x[15], &x[16]);
 1085|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[40], &x[55], _r, cos_bit);
 1086|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[41], &x[54], _r, cos_bit);
 1087|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[42], &x[53], _r, cos_bit);
 1088|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[43], &x[52], _r, cos_bit);
 1089|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[44], &x[51], _r, cos_bit);
 1090|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[45], &x[50], _r, cos_bit);
 1091|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[46], &x[49], _r, cos_bit);
 1092|  59.2k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[47], &x[48], _r, cos_bit);
 1093|  59.2k|}
av1_inv_txfm_avx2.c:idct64_stage11_avx2:
 1095|  59.2k|static inline void idct64_stage11_avx2(__m256i *output, __m256i *x) {
 1096|  59.2k|  btf_16_adds_subs_out_avx2(&output[0], &output[63], x[0], x[63]);
 1097|  59.2k|  btf_16_adds_subs_out_avx2(&output[1], &output[62], x[1], x[62]);
 1098|  59.2k|  btf_16_adds_subs_out_avx2(&output[2], &output[61], x[2], x[61]);
 1099|  59.2k|  btf_16_adds_subs_out_avx2(&output[3], &output[60], x[3], x[60]);
 1100|  59.2k|  btf_16_adds_subs_out_avx2(&output[4], &output[59], x[4], x[59]);
 1101|  59.2k|  btf_16_adds_subs_out_avx2(&output[5], &output[58], x[5], x[58]);
 1102|  59.2k|  btf_16_adds_subs_out_avx2(&output[6], &output[57], x[6], x[57]);
 1103|  59.2k|  btf_16_adds_subs_out_avx2(&output[7], &output[56], x[7], x[56]);
 1104|  59.2k|  btf_16_adds_subs_out_avx2(&output[8], &output[55], x[8], x[55]);
 1105|  59.2k|  btf_16_adds_subs_out_avx2(&output[9], &output[54], x[9], x[54]);
 1106|  59.2k|  btf_16_adds_subs_out_avx2(&output[10], &output[53], x[10], x[53]);
 1107|  59.2k|  btf_16_adds_subs_out_avx2(&output[11], &output[52], x[11], x[52]);
 1108|  59.2k|  btf_16_adds_subs_out_avx2(&output[12], &output[51], x[12], x[51]);
 1109|  59.2k|  btf_16_adds_subs_out_avx2(&output[13], &output[50], x[13], x[50]);
 1110|  59.2k|  btf_16_adds_subs_out_avx2(&output[14], &output[49], x[14], x[49]);
 1111|  59.2k|  btf_16_adds_subs_out_avx2(&output[15], &output[48], x[15], x[48]);
 1112|  59.2k|  btf_16_adds_subs_out_avx2(&output[16], &output[47], x[16], x[47]);
 1113|  59.2k|  btf_16_adds_subs_out_avx2(&output[17], &output[46], x[17], x[46]);
 1114|  59.2k|  btf_16_adds_subs_out_avx2(&output[18], &output[45], x[18], x[45]);
 1115|  59.2k|  btf_16_adds_subs_out_avx2(&output[19], &output[44], x[19], x[44]);
 1116|  59.2k|  btf_16_adds_subs_out_avx2(&output[20], &output[43], x[20], x[43]);
 1117|  59.2k|  btf_16_adds_subs_out_avx2(&output[21], &output[42], x[21], x[42]);
 1118|  59.2k|  btf_16_adds_subs_out_avx2(&output[22], &output[41], x[22], x[41]);
 1119|  59.2k|  btf_16_adds_subs_out_avx2(&output[23], &output[40], x[23], x[40]);
 1120|  59.2k|  btf_16_adds_subs_out_avx2(&output[24], &output[39], x[24], x[39]);
 1121|  59.2k|  btf_16_adds_subs_out_avx2(&output[25], &output[38], x[25], x[38]);
 1122|  59.2k|  btf_16_adds_subs_out_avx2(&output[26], &output[37], x[26], x[37]);
 1123|  59.2k|  btf_16_adds_subs_out_avx2(&output[27], &output[36], x[27], x[36]);
 1124|  59.2k|  btf_16_adds_subs_out_avx2(&output[28], &output[35], x[28], x[35]);
 1125|  59.2k|  btf_16_adds_subs_out_avx2(&output[29], &output[34], x[29], x[34]);
 1126|  59.2k|  btf_16_adds_subs_out_avx2(&output[30], &output[33], x[30], x[33]);
 1127|  59.2k|  btf_16_adds_subs_out_avx2(&output[31], &output[32], x[31], x[32]);
 1128|  59.2k|}
av1_inv_txfm_avx2.c:idct64_low16_avx2:
 1341|  1.45k|static void idct64_low16_avx2(const __m256i *input, __m256i *output) {
 1342|  1.45k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1343|  1.45k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1344|       |
 1345|  1.45k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1346|  1.45k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
 1347|  1.45k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
 1348|  1.45k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
 1349|  1.45k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 1350|       |
 1351|       |  // stage 1
 1352|  1.45k|  __m256i x[64];
 1353|  1.45k|  x[0] = input[0];
 1354|  1.45k|  x[4] = input[8];
 1355|  1.45k|  x[8] = input[4];
 1356|  1.45k|  x[12] = input[12];
 1357|  1.45k|  x[16] = input[2];
 1358|  1.45k|  x[20] = input[10];
 1359|  1.45k|  x[24] = input[6];
 1360|  1.45k|  x[28] = input[14];
 1361|  1.45k|  x[32] = input[1];
 1362|  1.45k|  x[36] = input[9];
 1363|  1.45k|  x[40] = input[5];
 1364|  1.45k|  x[44] = input[13];
 1365|  1.45k|  x[48] = input[3];
 1366|  1.45k|  x[52] = input[11];
 1367|  1.45k|  x[56] = input[7];
 1368|  1.45k|  x[60] = input[15];
 1369|       |
 1370|       |  // stage 2
 1371|  1.45k|  btf_16_w16_0_avx2(cospi[63], cospi[1], x[32], x[32], x[63]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1372|  1.45k|  btf_16_w16_0_avx2(-cospi[49], cospi[15], x[60], x[35], x[60]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1373|  1.45k|  btf_16_w16_0_avx2(cospi[55], cospi[9], x[36], x[36], x[59]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1374|  1.45k|  btf_16_w16_0_avx2(-cospi[57], cospi[7], x[56], x[39], x[56]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1375|  1.45k|  btf_16_w16_0_avx2(cospi[59], cospi[5], x[40], x[40], x[55]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1376|  1.45k|  btf_16_w16_0_avx2(-cospi[53], cospi[11], x[52], x[43], x[52]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1377|  1.45k|  btf_16_w16_0_avx2(cospi[51], cospi[13], x[44], x[44], x[51]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1378|  1.45k|  btf_16_w16_0_avx2(-cospi[61], cospi[3], x[48], x[47], x[48]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1379|       |
 1380|       |  // stage 3
 1381|  1.45k|  btf_16_w16_0_avx2(cospi[62], cospi[2], x[16], x[16], x[31]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1382|  1.45k|  btf_16_w16_0_avx2(-cospi[50], cospi[14], x[28], x[19], x[28]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1383|  1.45k|  btf_16_w16_0_avx2(cospi[54], cospi[10], x[20], x[20], x[27]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1384|  1.45k|  btf_16_w16_0_avx2(-cospi[58], cospi[6], x[24], x[23], x[24]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1385|  1.45k|  x[33] = x[32];
 1386|  1.45k|  x[34] = x[35];
 1387|  1.45k|  x[37] = x[36];
 1388|  1.45k|  x[38] = x[39];
 1389|  1.45k|  x[41] = x[40];
 1390|  1.45k|  x[42] = x[43];
 1391|  1.45k|  x[45] = x[44];
 1392|  1.45k|  x[46] = x[47];
 1393|  1.45k|  x[49] = x[48];
 1394|  1.45k|  x[50] = x[51];
 1395|  1.45k|  x[53] = x[52];
 1396|  1.45k|  x[54] = x[55];
 1397|  1.45k|  x[57] = x[56];
 1398|  1.45k|  x[58] = x[59];
 1399|  1.45k|  x[61] = x[60];
 1400|  1.45k|  x[62] = x[63];
 1401|       |
 1402|       |  // stage 4
 1403|  1.45k|  btf_16_w16_0_avx2(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1404|  1.45k|  btf_16_w16_0_avx2(-cospi[52], cospi[12], x[12], x[11], x[12]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1405|  1.45k|  x[17] = x[16];
 1406|  1.45k|  x[18] = x[19];
 1407|  1.45k|  x[21] = x[20];
 1408|  1.45k|  x[22] = x[23];
 1409|  1.45k|  x[25] = x[24];
 1410|  1.45k|  x[26] = x[27];
 1411|  1.45k|  x[29] = x[28];
 1412|  1.45k|  x[30] = x[31];
 1413|  1.45k|  idct64_stage4_high32_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1414|       |
 1415|       |  // stage 5
 1416|  1.45k|  btf_16_w16_0_avx2(cospi[56], cospi[8], x[4], x[4], x[7]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1417|  1.45k|  x[9] = x[8];
 1418|  1.45k|  x[10] = x[11];
 1419|  1.45k|  x[13] = x[12];
 1420|  1.45k|  x[14] = x[15];
 1421|  1.45k|  idct64_stage5_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1422|       |
 1423|       |  // stage 6
 1424|  1.45k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  1.45k|  do {                                             \
  |  |   31|  1.45k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  1.45k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  1.45k|    const __m256i _in = in;                        \
  |  |   34|  1.45k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  1.45k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1425|  1.45k|  x[5] = x[4];
 1426|  1.45k|  x[6] = x[7];
 1427|  1.45k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[9], &x[14], _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1428|  1.45k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[10], &x[13], _r,
 1429|  1.45k|                  INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1430|  1.45k|  idct64_stage6_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1431|       |
 1432|       |  // stage 7
 1433|  1.45k|  x[3] = x[0];
 1434|  1.45k|  x[2] = x[1];
 1435|  1.45k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[5], &x[6], _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1436|  1.45k|  btf_16_adds_subs_avx2(&x[8], &x[11]);
 1437|  1.45k|  btf_16_adds_subs_avx2(&x[9], &x[10]);
 1438|  1.45k|  btf_16_adds_subs_avx2(&x[15], &x[12]);
 1439|  1.45k|  btf_16_adds_subs_avx2(&x[14], &x[13]);
 1440|  1.45k|  idct64_stage7_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1441|       |
 1442|       |  // stage 8
 1443|  1.45k|  btf_16_adds_subs_avx2(&x[0], &x[7]);
 1444|  1.45k|  btf_16_adds_subs_avx2(&x[1], &x[6]);
 1445|  1.45k|  btf_16_adds_subs_avx2(&x[2], &x[5]);
 1446|  1.45k|  btf_16_adds_subs_avx2(&x[3], &x[4]);
 1447|  1.45k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[10], &x[13], _r,
 1448|  1.45k|                  INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1449|  1.45k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[11], &x[12], _r,
 1450|  1.45k|                  INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1451|  1.45k|  idct64_stage8_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1452|       |
 1453|  1.45k|  idct64_stage9_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1454|  1.45k|  idct64_stage10_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  1.45k|#define INV_COS_BIT 12
  ------------------
 1455|  1.45k|  idct64_stage11_avx2(output, x);
 1456|  1.45k|}
av1_inv_txfm_avx2.c:idct64_stage4_high32_avx2:
  890|  58.9k|                                             const __m256i _r, int8_t cos_bit) {
  891|  58.9k|  (void)cos_bit;
  892|  58.9k|  const __m256i cospi_m04_p60 = pair_set_w16_epi16(-cospi[4], cospi[60]);
  893|  58.9k|  const __m256i cospi_p60_p04 = pair_set_w16_epi16(cospi[60], cospi[4]);
  894|  58.9k|  const __m256i cospi_m60_m04 = pair_set_w16_epi16(-cospi[60], -cospi[4]);
  895|  58.9k|  const __m256i cospi_m36_p28 = pair_set_w16_epi16(-cospi[36], cospi[28]);
  896|  58.9k|  const __m256i cospi_p28_p36 = pair_set_w16_epi16(cospi[28], cospi[36]);
  897|  58.9k|  const __m256i cospi_m28_m36 = pair_set_w16_epi16(-cospi[28], -cospi[36]);
  898|  58.9k|  const __m256i cospi_m20_p44 = pair_set_w16_epi16(-cospi[20], cospi[44]);
  899|  58.9k|  const __m256i cospi_p44_p20 = pair_set_w16_epi16(cospi[44], cospi[20]);
  900|  58.9k|  const __m256i cospi_m44_m20 = pair_set_w16_epi16(-cospi[44], -cospi[20]);
  901|  58.9k|  const __m256i cospi_m52_p12 = pair_set_w16_epi16(-cospi[52], cospi[12]);
  902|  58.9k|  const __m256i cospi_p12_p52 = pair_set_w16_epi16(cospi[12], cospi[52]);
  903|  58.9k|  const __m256i cospi_m12_m52 = pair_set_w16_epi16(-cospi[12], -cospi[52]);
  904|  58.9k|  btf_16_w16_avx2(cospi_m04_p60, cospi_p60_p04, &x[33], &x[62], _r, cos_bit);
  905|  58.9k|  btf_16_w16_avx2(cospi_m60_m04, cospi_m04_p60, &x[34], &x[61], _r, cos_bit);
  906|  58.9k|  btf_16_w16_avx2(cospi_m36_p28, cospi_p28_p36, &x[37], &x[58], _r, cos_bit);
  907|  58.9k|  btf_16_w16_avx2(cospi_m28_m36, cospi_m36_p28, &x[38], &x[57], _r, cos_bit);
  908|  58.9k|  btf_16_w16_avx2(cospi_m20_p44, cospi_p44_p20, &x[41], &x[54], _r, cos_bit);
  909|  58.9k|  btf_16_w16_avx2(cospi_m44_m20, cospi_m20_p44, &x[42], &x[53], _r, cos_bit);
  910|  58.9k|  btf_16_w16_avx2(cospi_m52_p12, cospi_p12_p52, &x[45], &x[50], _r, cos_bit);
  911|  58.9k|  btf_16_w16_avx2(cospi_m12_m52, cospi_m52_p12, &x[46], &x[49], _r, cos_bit);
  912|  58.9k|}
av1_inv_txfm_avx2.c:idct64_stage5_high48_avx2:
  915|  58.9k|                                             const __m256i _r, int8_t cos_bit) {
  916|  58.9k|  (void)cos_bit;
  917|  58.9k|  const __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
  918|  58.9k|  const __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
  919|  58.9k|  const __m256i cospi_m56_m08 = pair_set_w16_epi16(-cospi[56], -cospi[8]);
  920|  58.9k|  const __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
  921|  58.9k|  const __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
  922|  58.9k|  const __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
  923|  58.9k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x[17], &x[30], _r, cos_bit);
  924|  58.9k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x[18], &x[29], _r, cos_bit);
  925|  58.9k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x[21], &x[26], _r, cos_bit);
  926|  58.9k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x[22], &x[25], _r, cos_bit);
  927|  58.9k|  btf_16_adds_subs_avx2(&x[32], &x[35]);
  928|  58.9k|  btf_16_adds_subs_avx2(&x[33], &x[34]);
  929|  58.9k|  btf_16_adds_subs_avx2(&x[39], &x[36]);
  930|  58.9k|  btf_16_adds_subs_avx2(&x[38], &x[37]);
  931|  58.9k|  btf_16_adds_subs_avx2(&x[40], &x[43]);
  932|  58.9k|  btf_16_adds_subs_avx2(&x[41], &x[42]);
  933|  58.9k|  btf_16_adds_subs_avx2(&x[47], &x[44]);
  934|  58.9k|  btf_16_adds_subs_avx2(&x[46], &x[45]);
  935|  58.9k|  btf_16_adds_subs_avx2(&x[48], &x[51]);
  936|  58.9k|  btf_16_adds_subs_avx2(&x[49], &x[50]);
  937|  58.9k|  btf_16_adds_subs_avx2(&x[55], &x[52]);
  938|  58.9k|  btf_16_adds_subs_avx2(&x[54], &x[53]);
  939|  58.9k|  btf_16_adds_subs_avx2(&x[56], &x[59]);
  940|  58.9k|  btf_16_adds_subs_avx2(&x[57], &x[58]);
  941|  58.9k|  btf_16_adds_subs_avx2(&x[63], &x[60]);
  942|  58.9k|  btf_16_adds_subs_avx2(&x[62], &x[61]);
  943|  58.9k|}
av1_inv_txfm_avx2.c:idct64_stage6_high48_avx2:
  965|  58.9k|                                             const __m256i _r, int8_t cos_bit) {
  966|  58.9k|  btf_16_adds_subs_avx2(&x[16], &x[19]);
  967|  58.9k|  btf_16_adds_subs_avx2(&x[17], &x[18]);
  968|  58.9k|  btf_16_adds_subs_avx2(&x[23], &x[20]);
  969|  58.9k|  btf_16_adds_subs_avx2(&x[22], &x[21]);
  970|  58.9k|  btf_16_adds_subs_avx2(&x[24], &x[27]);
  971|  58.9k|  btf_16_adds_subs_avx2(&x[25], &x[26]);
  972|  58.9k|  btf_16_adds_subs_avx2(&x[31], &x[28]);
  973|  58.9k|  btf_16_adds_subs_avx2(&x[30], &x[29]);
  974|  58.9k|  idct64_stage6_high32_avx2(x, cospi, _r, cos_bit);
  975|  58.9k|}
av1_inv_txfm_avx2.c:idct64_low32_avx2:
 1458|  57.5k|static void idct64_low32_avx2(const __m256i *input, __m256i *output) {
 1459|  57.5k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1460|  57.5k|  const __m256i _r = _mm256_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1461|       |
 1462|  57.5k|  const __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1463|  57.5k|  const __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
 1464|  57.5k|  const __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
 1465|  57.5k|  const __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
 1466|  57.5k|  const __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 1467|       |
 1468|       |  // stage 1
 1469|  57.5k|  __m256i x[64];
 1470|  57.5k|  x[0] = input[0];
 1471|  57.5k|  x[2] = input[16];
 1472|  57.5k|  x[4] = input[8];
 1473|  57.5k|  x[6] = input[24];
 1474|  57.5k|  x[8] = input[4];
 1475|  57.5k|  x[10] = input[20];
 1476|  57.5k|  x[12] = input[12];
 1477|  57.5k|  x[14] = input[28];
 1478|  57.5k|  x[16] = input[2];
 1479|  57.5k|  x[18] = input[18];
 1480|  57.5k|  x[20] = input[10];
 1481|  57.5k|  x[22] = input[26];
 1482|  57.5k|  x[24] = input[6];
 1483|  57.5k|  x[26] = input[22];
 1484|  57.5k|  x[28] = input[14];
 1485|  57.5k|  x[30] = input[30];
 1486|  57.5k|  x[32] = input[1];
 1487|  57.5k|  x[34] = input[17];
 1488|  57.5k|  x[36] = input[9];
 1489|  57.5k|  x[38] = input[25];
 1490|  57.5k|  x[40] = input[5];
 1491|  57.5k|  x[42] = input[21];
 1492|  57.5k|  x[44] = input[13];
 1493|  57.5k|  x[46] = input[29];
 1494|  57.5k|  x[48] = input[3];
 1495|  57.5k|  x[50] = input[19];
 1496|  57.5k|  x[52] = input[11];
 1497|  57.5k|  x[54] = input[27];
 1498|  57.5k|  x[56] = input[7];
 1499|  57.5k|  x[58] = input[23];
 1500|  57.5k|  x[60] = input[15];
 1501|  57.5k|  x[62] = input[31];
 1502|       |
 1503|       |  // stage 2
 1504|  57.5k|  btf_16_w16_0_avx2(cospi[63], cospi[1], x[32], x[32], x[63]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1505|  57.5k|  btf_16_w16_0_avx2(-cospi[33], cospi[31], x[62], x[33], x[62]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1506|  57.5k|  btf_16_w16_0_avx2(cospi[47], cospi[17], x[34], x[34], x[61]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1507|  57.5k|  btf_16_w16_0_avx2(-cospi[49], cospi[15], x[60], x[35], x[60]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1508|  57.5k|  btf_16_w16_0_avx2(cospi[55], cospi[9], x[36], x[36], x[59]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1509|  57.5k|  btf_16_w16_0_avx2(-cospi[41], cospi[23], x[58], x[37], x[58]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1510|  57.5k|  btf_16_w16_0_avx2(cospi[39], cospi[25], x[38], x[38], x[57]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1511|  57.5k|  btf_16_w16_0_avx2(-cospi[57], cospi[7], x[56], x[39], x[56]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1512|  57.5k|  btf_16_w16_0_avx2(cospi[59], cospi[5], x[40], x[40], x[55]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1513|  57.5k|  btf_16_w16_0_avx2(-cospi[37], cospi[27], x[54], x[41], x[54]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1514|  57.5k|  btf_16_w16_0_avx2(cospi[43], cospi[21], x[42], x[42], x[53]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1515|  57.5k|  btf_16_w16_0_avx2(-cospi[53], cospi[11], x[52], x[43], x[52]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1516|  57.5k|  btf_16_w16_0_avx2(cospi[51], cospi[13], x[44], x[44], x[51]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1517|  57.5k|  btf_16_w16_0_avx2(-cospi[45], cospi[19], x[50], x[45], x[50]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1518|  57.5k|  btf_16_w16_0_avx2(cospi[35], cospi[29], x[46], x[46], x[49]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1519|  57.5k|  btf_16_w16_0_avx2(-cospi[61], cospi[3], x[48], x[47], x[48]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1520|       |
 1521|       |  // stage 3
 1522|  57.5k|  btf_16_w16_0_avx2(cospi[62], cospi[2], x[16], x[16], x[31]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1523|  57.5k|  btf_16_w16_0_avx2(-cospi[34], cospi[30], x[30], x[17], x[30]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1524|  57.5k|  btf_16_w16_0_avx2(cospi[46], cospi[18], x[18], x[18], x[29]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1525|  57.5k|  btf_16_w16_0_avx2(-cospi[50], cospi[14], x[28], x[19], x[28]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1526|  57.5k|  btf_16_w16_0_avx2(cospi[54], cospi[10], x[20], x[20], x[27]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1527|  57.5k|  btf_16_w16_0_avx2(-cospi[42], cospi[22], x[26], x[21], x[26]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1528|  57.5k|  btf_16_w16_0_avx2(cospi[38], cospi[26], x[22], x[22], x[25]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1529|  57.5k|  btf_16_w16_0_avx2(-cospi[58], cospi[6], x[24], x[23], x[24]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1530|  57.5k|  btf_16_adds_subs_avx2(&x[32], &x[33]);
 1531|  57.5k|  btf_16_adds_subs_avx2(&x[35], &x[34]);
 1532|  57.5k|  btf_16_adds_subs_avx2(&x[36], &x[37]);
 1533|  57.5k|  btf_16_adds_subs_avx2(&x[39], &x[38]);
 1534|  57.5k|  btf_16_adds_subs_avx2(&x[40], &x[41]);
 1535|  57.5k|  btf_16_adds_subs_avx2(&x[43], &x[42]);
 1536|  57.5k|  btf_16_adds_subs_avx2(&x[44], &x[45]);
 1537|  57.5k|  btf_16_adds_subs_avx2(&x[47], &x[46]);
 1538|  57.5k|  btf_16_adds_subs_avx2(&x[48], &x[49]);
 1539|  57.5k|  btf_16_adds_subs_avx2(&x[51], &x[50]);
 1540|  57.5k|  btf_16_adds_subs_avx2(&x[52], &x[53]);
 1541|  57.5k|  btf_16_adds_subs_avx2(&x[55], &x[54]);
 1542|  57.5k|  btf_16_adds_subs_avx2(&x[56], &x[57]);
 1543|  57.5k|  btf_16_adds_subs_avx2(&x[59], &x[58]);
 1544|  57.5k|  btf_16_adds_subs_avx2(&x[60], &x[61]);
 1545|  57.5k|  btf_16_adds_subs_avx2(&x[63], &x[62]);
 1546|       |
 1547|       |  // stage 4
 1548|  57.5k|  btf_16_w16_0_avx2(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1549|  57.5k|  btf_16_w16_0_avx2(-cospi[36], cospi[28], x[14], x[9], x[14]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1550|  57.5k|  btf_16_w16_0_avx2(cospi[44], cospi[20], x[10], x[10], x[13]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1551|  57.5k|  btf_16_w16_0_avx2(-cospi[52], cospi[12], x[12], x[11], x[12]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1552|  57.5k|  btf_16_adds_subs_avx2(&x[16], &x[17]);
 1553|  57.5k|  btf_16_adds_subs_avx2(&x[19], &x[18]);
 1554|  57.5k|  btf_16_adds_subs_avx2(&x[20], &x[21]);
 1555|  57.5k|  btf_16_adds_subs_avx2(&x[23], &x[22]);
 1556|  57.5k|  btf_16_adds_subs_avx2(&x[24], &x[25]);
 1557|  57.5k|  btf_16_adds_subs_avx2(&x[27], &x[26]);
 1558|  57.5k|  btf_16_adds_subs_avx2(&x[28], &x[29]);
 1559|  57.5k|  btf_16_adds_subs_avx2(&x[31], &x[30]);
 1560|  57.5k|  idct64_stage4_high32_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1561|       |
 1562|       |  // stage 5
 1563|  57.5k|  btf_16_w16_0_avx2(cospi[56], cospi[8], x[4], x[4], x[7]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1564|  57.5k|  btf_16_w16_0_avx2(-cospi[40], cospi[24], x[6], x[5], x[6]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1565|  57.5k|  btf_16_adds_subs_avx2(&x[8], &x[9]);
 1566|  57.5k|  btf_16_adds_subs_avx2(&x[11], &x[10]);
 1567|  57.5k|  btf_16_adds_subs_avx2(&x[12], &x[13]);
 1568|  57.5k|  btf_16_adds_subs_avx2(&x[15], &x[14]);
 1569|  57.5k|  idct64_stage5_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1570|       |
 1571|       |  // stage 6
 1572|  57.5k|  btf_16_w16_0_avx2(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1573|  57.5k|  btf_16_w16_0_avx2(cospi[48], cospi[16], x[2], x[2], x[3]);
  ------------------
  |  |   30|  57.5k|  do {                                             \
  |  |   31|  57.5k|    const __m256i _w0 = _mm256_set1_epi16(w0 * 8); \
  |  |   32|  57.5k|    const __m256i _w1 = _mm256_set1_epi16(w1 * 8); \
  |  |   33|  57.5k|    const __m256i _in = in;                        \
  |  |   34|  57.5k|    out0 = _mm256_mulhrs_epi16(_in, _w0);          \
  |  |   35|  57.5k|    out1 = _mm256_mulhrs_epi16(_in, _w1);          \
  |  |   36|  57.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 57.5k]
  |  |  ------------------
  ------------------
 1574|  57.5k|  btf_16_adds_subs_avx2(&x[4], &x[5]);
 1575|  57.5k|  btf_16_adds_subs_avx2(&x[7], &x[6]);
 1576|  57.5k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x[9], &x[14], _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1577|  57.5k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x[10], &x[13], _r,
 1578|  57.5k|                  INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1579|  57.5k|  idct64_stage6_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1580|       |
 1581|       |  // stage 7
 1582|  57.5k|  btf_16_adds_subs_avx2(&x[0], &x[3]);
 1583|  57.5k|  btf_16_adds_subs_avx2(&x[1], &x[2]);
 1584|  57.5k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[5], &x[6], _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1585|  57.5k|  btf_16_adds_subs_avx2(&x[8], &x[11]);
 1586|  57.5k|  btf_16_adds_subs_avx2(&x[9], &x[10]);
 1587|  57.5k|  btf_16_adds_subs_avx2(&x[15], &x[12]);
 1588|  57.5k|  btf_16_adds_subs_avx2(&x[14], &x[13]);
 1589|  57.5k|  idct64_stage7_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1590|       |
 1591|       |  // stage 8
 1592|  57.5k|  btf_16_adds_subs_avx2(&x[0], &x[7]);
 1593|  57.5k|  btf_16_adds_subs_avx2(&x[1], &x[6]);
 1594|  57.5k|  btf_16_adds_subs_avx2(&x[2], &x[5]);
 1595|  57.5k|  btf_16_adds_subs_avx2(&x[3], &x[4]);
 1596|  57.5k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[10], &x[13], _r,
 1597|  57.5k|                  INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1598|  57.5k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x[11], &x[12], _r,
 1599|  57.5k|                  INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1600|  57.5k|  idct64_stage8_high48_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1601|       |
 1602|       |  // stage 9~11
 1603|  57.5k|  idct64_stage9_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1604|  57.5k|  idct64_stage10_avx2(x, cospi, _r, INV_COS_BIT);
  ------------------
  |  |   43|  57.5k|#define INV_COS_BIT 12
  ------------------
 1605|  57.5k|  idct64_stage11_avx2(output, x);
 1606|  57.5k|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_idtx_avx2:
 1772|  34.1k|                                                  int32_t eob) {
 1773|  34.1k|  (void)eob;
 1774|  34.1k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 1775|  34.1k|  const int txw_idx = get_txw_idx(tx_size);
 1776|  34.1k|  const int txh_idx = get_txh_idx(tx_size);
 1777|  34.1k|  const int txfm_size_col = tx_size_wide[tx_size];
 1778|  34.1k|  const int txfm_size_row = tx_size_high[tx_size];
 1779|  34.1k|  const int col_max = AOMMIN(32, txfm_size_col);
  ------------------
  |  |   34|  34.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 34.1k]
  |  |  ------------------
  ------------------
 1780|  34.1k|  const int row_max = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  34.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 34.1k]
  |  |  ------------------
  ------------------
 1781|  34.1k|  const int input_stride = row_max;
 1782|  34.1k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 1783|  34.1k|  __m256i buf[32];
 1784|       |
 1785|  71.6k|  for (int i = 0; i < (col_max >> 4); ++i) {
  ------------------
  |  Branch (1785:19): [True: 37.5k, False: 34.1k]
  ------------------
 1786|  81.8k|    for (int j = 0; j < (row_max >> 4); j++) {
  ------------------
  |  Branch (1786:21): [True: 44.3k, False: 37.5k]
  ------------------
 1787|  44.3k|      iidentity_row_16xn_avx2(buf, input + j * 16 + i * 16 * input_stride,
 1788|  44.3k|                              row_max, shift[0], 16, txw_idx, rect_type);
 1789|  44.3k|      transpose_16bit_16x16_avx2(buf, buf);
 1790|  44.3k|      iidentity_col_16xn_avx2(output + i * 16 + j * 16 * stride, stride, buf,
 1791|  44.3k|                              shift[1], 16, txh_idx);
 1792|  44.3k|    }
 1793|  37.5k|  }
 1794|  34.1k|}
av1_inv_txfm_avx2.c:iidentity_row_16xn_avx2:
 1707|  44.8k|                                           int txw_idx, int rect_type) {
 1708|  44.8k|  const int32_t *input_row = input;
 1709|  44.8k|  const __m256i scale = _mm256_set1_epi16(NewSqrt2list[txw_idx]);
 1710|  44.8k|  const __m256i _r = _mm256_set1_epi16((1 << (NewSqrt2Bits - 1)) +
  ------------------
  |  |   42|  44.8k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1711|  44.8k|                                       (1 << (NewSqrt2Bits - shift - 1)));
  ------------------
  |  |   42|  44.8k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1712|  44.8k|  const __m256i one = _mm256_set1_epi16(1);
 1713|  44.8k|  const __m256i scale__r = _mm256_unpacklo_epi16(scale, _r);
 1714|  44.8k|  if (rect_type != 1 && rect_type != -1) {
  ------------------
  |  Branch (1714:7): [True: 44.8k, False: 18.4E]
  |  Branch (1714:25): [True: 44.7k, False: 141]
  ------------------
 1715|   760k|    for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (1715:21): [True: 715k, False: 44.7k]
  ------------------
 1716|   715k|      const __m256i src = load_32bit_to_16bit_w16_avx2(input_row);
 1717|   715k|      input_row += stride;
 1718|   715k|      __m256i lo = _mm256_unpacklo_epi16(src, one);
 1719|   715k|      __m256i hi = _mm256_unpackhi_epi16(src, one);
 1720|   715k|      lo = _mm256_madd_epi16(lo, scale__r);
 1721|   715k|      hi = _mm256_madd_epi16(hi, scale__r);
 1722|   715k|      lo = _mm256_srai_epi32(lo, NewSqrt2Bits - shift);
  ------------------
  |  |   42|   715k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1723|   715k|      hi = _mm256_srai_epi32(hi, NewSqrt2Bits - shift);
  ------------------
  |  |   42|   715k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1724|   715k|      out[i] = _mm256_packs_epi32(lo, hi);
 1725|   715k|    }
 1726|  44.7k|  } else {
 1727|    140|    const __m256i rect_scale =
 1728|    140|        _mm256_set1_epi16(NewInvSqrt2 << (15 - NewSqrt2Bits));
  ------------------
  |  |   42|    140|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1729|  2.38k|    for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (1729:21): [True: 2.24k, False: 140]
  ------------------
 1730|  2.24k|      __m256i src = load_32bit_to_16bit_w16_avx2(input_row);
 1731|  2.24k|      src = _mm256_mulhrs_epi16(src, rect_scale);
 1732|  2.24k|      input_row += stride;
 1733|  2.24k|      __m256i lo = _mm256_unpacklo_epi16(src, one);
 1734|  2.24k|      __m256i hi = _mm256_unpackhi_epi16(src, one);
 1735|  2.24k|      lo = _mm256_madd_epi16(lo, scale__r);
 1736|  2.24k|      hi = _mm256_madd_epi16(hi, scale__r);
 1737|  2.24k|      lo = _mm256_srai_epi32(lo, NewSqrt2Bits - shift);
  ------------------
  |  |   42|  2.24k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1738|  2.24k|      hi = _mm256_srai_epi32(hi, NewSqrt2Bits - shift);
  ------------------
  |  |   42|  2.24k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1739|  2.24k|      out[i] = _mm256_packs_epi32(lo, hi);
 1740|  2.24k|    }
 1741|    140|  }
 1742|  44.8k|}
av1_inv_txfm_avx2.c:iidentity_col_16xn_avx2:
 1746|  44.8k|                                           int txh_idx) {
 1747|  44.8k|  const __m256i scale = _mm256_set1_epi16(NewSqrt2list[txh_idx]);
 1748|  44.8k|  const __m256i scale__r = _mm256_set1_epi16(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  44.8k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1749|  44.8k|  const __m256i shift__r = _mm256_set1_epi32(1 << (-shift - 1));
 1750|  44.8k|  const __m256i one = _mm256_set1_epi16(1);
 1751|  44.8k|  const __m256i scale_coeff = _mm256_unpacklo_epi16(scale, scale__r);
 1752|   762k|  for (int h = 0; h < height; ++h) {
  ------------------
  |  Branch (1752:19): [True: 717k, False: 44.8k]
  ------------------
 1753|   717k|    __m256i lo = _mm256_unpacklo_epi16(buf[h], one);
 1754|   717k|    __m256i hi = _mm256_unpackhi_epi16(buf[h], one);
 1755|   717k|    lo = _mm256_madd_epi16(lo, scale_coeff);
 1756|   717k|    hi = _mm256_madd_epi16(hi, scale_coeff);
 1757|   717k|    lo = _mm256_srai_epi32(lo, NewSqrt2Bits);
  ------------------
  |  |   42|   717k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1758|   717k|    hi = _mm256_srai_epi32(hi, NewSqrt2Bits);
  ------------------
  |  |   42|   717k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1759|   717k|    lo = _mm256_add_epi32(lo, shift__r);
 1760|   717k|    hi = _mm256_add_epi32(hi, shift__r);
 1761|   717k|    lo = _mm256_srai_epi32(lo, -shift);
 1762|   717k|    hi = _mm256_srai_epi32(hi, -shift);
 1763|   717k|    const __m256i x = _mm256_packs_epi32(lo, hi);
 1764|   717k|    write_recon_w16_avx2(x, output);
 1765|   717k|    output += stride;
 1766|   717k|  }
 1767|  44.8k|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_h_identity_avx2:
 1798|    508|    TX_SIZE tx_size, int eob) {
 1799|    508|  int eobx, eoby;
 1800|    508|  get_eobx_eoby_scan_h_identity(&eobx, &eoby, tx_size, eob);
 1801|    508|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 1802|    508|  const int txw_idx = get_txw_idx(tx_size);
 1803|    508|  const int txh_idx = get_txh_idx(tx_size);
 1804|    508|  const int txfm_size_col = tx_size_wide[tx_size];
 1805|    508|  const int txfm_size_row = tx_size_high[tx_size];
 1806|    508|  const int txfm_size_row_notzero = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|    508|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 508]
  |  |  ------------------
  ------------------
 1807|    508|  const int input_stride = txfm_size_row_notzero;
 1808|    508|  const int buf_size_w_div16 = (eobx + 16) >> 4;
 1809|    508|  const int buf_size_h_div16 = (eoby + 16) >> 4;
 1810|    508|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 1811|       |
 1812|    508|  const int fun_idx_y = lowbd_txfm_all_1d_zeros_idx[eoby];
 1813|    508|  const transform_1d_avx2 col_txfm =
 1814|    508|      lowbd_txfm_all_1d_zeros_w16_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx_y];
 1815|       |
 1816|    508|  assert(col_txfm != NULL);
 1817|       |
 1818|    508|  int ud_flip, lr_flip;
 1819|    508|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1820|  1.01k|  for (int i = 0; i < buf_size_w_div16; i++) {
  ------------------
  |  Branch (1820:19): [True: 508, False: 508]
  ------------------
 1821|    508|    __m256i buf0[64];
 1822|  1.01k|    for (int j = 0; j < buf_size_h_div16; j++) {
  ------------------
  |  Branch (1822:21): [True: 508, False: 508]
  ------------------
 1823|    508|      __m256i *buf0_cur = buf0 + j * 16;
 1824|    508|      const int32_t *input_cur = input + i * 16 * input_stride + j * 16;
 1825|    508|      iidentity_row_16xn_avx2(buf0_cur, input_cur, input_stride, shift[0], 16,
 1826|    508|                              txw_idx, rect_type);
 1827|    508|      transpose_16bit_16x16_avx2(buf0_cur, buf0_cur);
 1828|    508|    }
 1829|    508|    col_txfm(buf0, buf0);
 1830|    508|    __m256i mshift = _mm256_set1_epi16(1 << (15 + shift[1]));
 1831|    508|    int k = ud_flip ? (txfm_size_row - 1) : 0;
  ------------------
  |  Branch (1831:13): [True: 0, False: 508]
  ------------------
 1832|    508|    const int step = ud_flip ? -1 : 1;
  ------------------
  |  Branch (1832:22): [True: 0, False: 508]
  ------------------
 1833|  8.63k|    for (int j = 0; j < txfm_size_row; ++j, k += step) {
  ------------------
  |  Branch (1833:21): [True: 8.12k, False: 508]
  ------------------
 1834|  8.12k|      __m256i res = _mm256_mulhrs_epi16(buf0[k], mshift);
 1835|  8.12k|      write_recon_w16_avx2(res, output + (i << 4) + j * stride);
 1836|  8.12k|    }
 1837|    508|  }
 1838|    508|}
av1_inv_txfm_avx2.c:lowbd_inv_txfm2d_add_v_identity_avx2:
 1842|    485|    TX_SIZE tx_size, int eob) {
 1843|    485|  __m256i buf1[64];
 1844|    485|  int eobx, eoby;
 1845|    485|  get_eobx_eoby_scan_v_identity(&eobx, &eoby, tx_size, eob);
 1846|    485|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 1847|    485|  const int txw_idx = get_txw_idx(tx_size);
 1848|    485|  const int txh_idx = get_txh_idx(tx_size);
 1849|    485|  const int txfm_size_col = tx_size_wide[tx_size];
 1850|    485|  const int txfm_size_row = tx_size_high[tx_size];
 1851|    485|  const int buf_size_w_div16 = txfm_size_col >> 4;
 1852|    485|  const int buf_size_h_div16 = (eoby + 16) >> 4;
 1853|    485|  const int buf_size_nonzero_w = ((eobx + 8) >> 3) << 3;
 1854|    485|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|    485|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 485]
  |  |  ------------------
  ------------------
 1855|    485|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 1856|       |
 1857|    485|  const int fun_idx_x = lowbd_txfm_all_1d_zeros_idx[eobx];
 1858|    485|  const transform_1d_avx2 row_txfm =
 1859|    485|      lowbd_txfm_all_1d_zeros_w16_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx_x];
 1860|       |
 1861|    485|  assert(row_txfm != NULL);
 1862|       |
 1863|    485|  int ud_flip, lr_flip;
 1864|    485|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1865|    970|  for (int i = 0; i < buf_size_h_div16; i++) {
  ------------------
  |  Branch (1865:19): [True: 485, False: 485]
  ------------------
 1866|    485|    __m256i buf0[64];
 1867|    485|    load_buffer_32bit_to_16bit_w16_avx2(input + i * 16, input_stride, buf0,
 1868|    485|                                        buf_size_nonzero_w);
 1869|    485|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 485]
  |  Branch (1869:27): [True: 0, False: 485]
  ------------------
 1870|      0|      round_shift_avx2(buf0, buf0, buf_size_nonzero_w);  // rect special code
 1871|      0|    }
 1872|    485|    row_txfm(buf0, buf0);
 1873|    485|    round_shift_16bit_w16_avx2(buf0, txfm_size_col, shift[0]);
 1874|    485|    __m256i *_buf1 = buf1;
 1875|    485|    if (lr_flip) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 485]
  ------------------
 1876|      0|      for (int j = 0; j < buf_size_w_div16; ++j) {
  ------------------
  |  Branch (1876:23): [True: 0, False: 0]
  ------------------
 1877|      0|        __m256i temp[16];
 1878|      0|        flip_buf_avx2(buf0 + 16 * j, temp, 16);
 1879|      0|        transpose_16bit_16x16_avx2(temp,
 1880|      0|                                   _buf1 + 16 * (buf_size_w_div16 - 1 - j));
 1881|      0|      }
 1882|    485|    } else {
 1883|    970|      for (int j = 0; j < buf_size_w_div16; ++j) {
  ------------------
  |  Branch (1883:23): [True: 485, False: 485]
  ------------------
 1884|    485|        transpose_16bit_16x16_avx2(buf0 + 16 * j, _buf1 + 16 * j);
 1885|    485|      }
 1886|    485|    }
 1887|    970|    for (int j = 0; j < buf_size_w_div16; ++j) {
  ------------------
  |  Branch (1887:21): [True: 485, False: 485]
  ------------------
 1888|    485|      iidentity_col_16xn_avx2(output + i * 16 * stride + j * 16, stride,
 1889|    485|                              buf1 + j * 16, shift[1], 16, txh_idx);
 1890|    485|    }
 1891|    485|  }
 1892|    485|}

av1_inv_txfm_avx2.c:round_shift_avx2:
   39|  95.1k|                                    int size) {
   40|  95.1k|  const __m256i scale = _mm256_set1_epi16(NewInvSqrt2 * 8);
   41|  2.11M|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (41:19): [True: 2.01M, False: 95.1k]
  ------------------
   42|  2.01M|    output[i] = _mm256_mulhrs_epi16(input[i], scale);
   43|  2.01M|  }
   44|  95.1k|}
av1_inv_txfm_avx2.c:lowbd_write_buffer_16xn_avx2:
   56|  1.26M|                                                int height) {
   57|  1.26M|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (57:11): [True: 1.34k, False: 1.26M]
  ------------------
   58|  1.26M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (58:20): [True: 1.34k, False: 1.26M]
  ------------------
   59|  28.6M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (59:19): [True: 27.4M, False: 1.26M]
  ------------------
   60|  27.4M|    write_recon_w16_avx2(in[j], output + i * stride);
   61|  27.4M|  }
   62|  1.26M|}
av1_inv_txfm_avx2.c:write_recon_w16_avx2:
   46|  28.1M|static inline void write_recon_w16_avx2(__m256i res, uint8_t *output) {
   47|  28.1M|  __m128i pred = _mm_loadu_si128((__m128i const *)(output));
   48|  28.1M|  __m256i u = _mm256_adds_epi16(_mm256_cvtepu8_epi16(pred), res);
   49|  28.1M|  __m128i y = _mm256_castsi256_si128(
   50|       |      _mm256_permute4x64_epi64(_mm256_packus_epi16(u, u), 168));
   51|  28.1M|  _mm_storeu_si128((__m128i *)(output), y);
   52|  28.1M|}

av1_idct8_low1_ssse3:
   81|  2.81M|void av1_idct8_low1_ssse3(const __m128i *input, __m128i *output) {
   82|  2.81M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  2.81M|#define INV_COS_BIT 12
  ------------------
   83|       |
   84|       |  // stage 1
   85|  2.81M|  __m128i x[2];
   86|  2.81M|  x[0] = input[0];
   87|       |
   88|       |  // stage 2
   89|       |  // stage 3
   90|  2.81M|  btf_16_ssse3(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   28|  2.81M|  do {                                          \
  |  |   29|  2.81M|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  2.81M|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  2.81M|    const __m128i _in = in;                     \
  |  |   32|  2.81M|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  2.81M|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  2.81M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 2.81M]
  |  |  ------------------
  ------------------
   91|       |
   92|       |  // stage 4
   93|       |  // stage 5
   94|  2.81M|  output[0] = x[0];
   95|  2.81M|  output[7] = x[0];
   96|  2.81M|  output[1] = x[1];
   97|  2.81M|  output[6] = x[1];
   98|  2.81M|  output[2] = x[1];
   99|  2.81M|  output[5] = x[1];
  100|  2.81M|  output[3] = x[0];
  101|  2.81M|  output[4] = x[0];
  102|  2.81M|}
av1_idct8_sse2:
  104|  25.9M|void av1_idct8_sse2(const __m128i *input, __m128i *output) {
  105|  25.9M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  25.9M|#define INV_COS_BIT 12
  ------------------
  106|  25.9M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  25.9M|#define INV_COS_BIT 12
  ------------------
  107|  25.9M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  25.9M|#define INV_COS_BIT 12
  ------------------
  108|       |
  109|  25.9M|  const __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  110|  25.9M|  const __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  111|  25.9M|  const __m128i cospi_p24_m40 = pair_set_epi16(cospi[24], -cospi[40]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  112|  25.9M|  const __m128i cospi_p40_p24 = pair_set_epi16(cospi[40], cospi[24]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  113|  25.9M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  114|  25.9M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  115|  25.9M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  116|  25.9M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  117|  25.9M|  const __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|  25.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  118|       |
  119|       |  // stage 1
  120|  25.9M|  __m128i x[8];
  121|  25.9M|  x[0] = input[0];
  122|  25.9M|  x[1] = input[4];
  123|  25.9M|  x[2] = input[2];
  124|  25.9M|  x[3] = input[6];
  125|  25.9M|  x[4] = input[1];
  126|  25.9M|  x[5] = input[5];
  127|  25.9M|  x[6] = input[3];
  128|  25.9M|  x[7] = input[7];
  129|       |
  130|       |  // stage 2
  131|  25.9M|  btf_16_sse2(cospi_p56_m08, cospi_p08_p56, x[4], x[7], x[4], x[7]);
  ------------------
  |  |   61|  25.9M|  do {                                            \
  |  |   62|  25.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  25.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  25.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  25.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  25.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  25.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  25.9M|                                                  \
  |  |   69|  25.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  25.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  25.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  25.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  25.9M|                                                  \
  |  |   74|  25.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  25.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  25.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  25.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  25.9M|                                                  \
  |  |   79|  25.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  25.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  132|  25.9M|  btf_16_sse2(cospi_p24_m40, cospi_p40_p24, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   61|  25.9M|  do {                                            \
  |  |   62|  25.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  25.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  25.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  25.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  25.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  25.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  25.9M|                                                  \
  |  |   69|  25.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  25.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  25.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  25.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  25.9M|                                                  \
  |  |   74|  25.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  25.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  25.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  25.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  25.9M|                                                  \
  |  |   79|  25.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  25.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  133|       |
  134|       |  // stage 3
  135|  25.9M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   61|  25.9M|  do {                                            \
  |  |   62|  25.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  25.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  25.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  25.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  25.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  25.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  25.9M|                                                  \
  |  |   69|  25.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  25.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  25.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  25.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  25.9M|                                                  \
  |  |   74|  25.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  25.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  25.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  25.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  25.9M|                                                  \
  |  |   79|  25.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  25.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  136|  25.9M|  btf_16_sse2(cospi_p48_m16, cospi_p16_p48, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|  25.9M|  do {                                            \
  |  |   62|  25.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  25.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  25.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  25.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  25.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  25.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  25.9M|                                                  \
  |  |   69|  25.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  25.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  25.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  25.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  25.9M|                                                  \
  |  |   74|  25.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  25.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  25.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  25.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  25.9M|                                                  \
  |  |   79|  25.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  25.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  137|  25.9M|  btf_16_adds_subs_sse2(x[4], x[5]);
  ------------------
  |  |   37|  25.9M|  do {                                  \
  |  |   38|  25.9M|    const __m128i _in0 = in0;           \
  |  |   39|  25.9M|    const __m128i _in1 = in1;           \
  |  |   40|  25.9M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  25.9M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  138|  25.9M|  btf_16_subs_adds_sse2(x[7], x[6]);
  ------------------
  |  |   45|  25.9M|  do {                                  \
  |  |   46|  25.9M|    const __m128i _in0 = in0;           \
  |  |   47|  25.9M|    const __m128i _in1 = in1;           \
  |  |   48|  25.9M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|  25.9M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  139|       |
  140|       |  // stage 4
  141|  25.9M|  btf_16_adds_subs_sse2(x[0], x[3]);
  ------------------
  |  |   37|  25.9M|  do {                                  \
  |  |   38|  25.9M|    const __m128i _in0 = in0;           \
  |  |   39|  25.9M|    const __m128i _in1 = in1;           \
  |  |   40|  25.9M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  25.9M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  142|  25.9M|  btf_16_adds_subs_sse2(x[1], x[2]);
  ------------------
  |  |   37|  25.9M|  do {                                  \
  |  |   38|  25.9M|    const __m128i _in0 = in0;           \
  |  |   39|  25.9M|    const __m128i _in1 = in1;           \
  |  |   40|  25.9M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  25.9M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  143|  25.9M|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   61|  25.9M|  do {                                            \
  |  |   62|  25.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  25.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  25.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  25.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  25.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  25.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  25.9M|                                                  \
  |  |   69|  25.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  25.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  25.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  25.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  25.9M|                                                  \
  |  |   74|  25.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  25.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  25.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  25.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  25.9M|                                                  \
  |  |   79|  25.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  25.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  144|       |
  145|       |  // stage 5
  146|  25.9M|  btf_16_adds_subs_out_sse2(output[0], output[7], x[0], x[7]);
  ------------------
  |  |   53|  25.9M|  do {                                                  \
  |  |   54|  25.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  25.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  25.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  25.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  147|  25.9M|  btf_16_adds_subs_out_sse2(output[1], output[6], x[1], x[6]);
  ------------------
  |  |   53|  25.9M|  do {                                                  \
  |  |   54|  25.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  25.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  25.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  25.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  148|  25.9M|  btf_16_adds_subs_out_sse2(output[2], output[5], x[2], x[5]);
  ------------------
  |  |   53|  25.9M|  do {                                                  \
  |  |   54|  25.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  25.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  25.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  25.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  149|  25.9M|  btf_16_adds_subs_out_sse2(output[3], output[4], x[3], x[4]);
  ------------------
  |  |   53|  25.9M|  do {                                                  \
  |  |   54|  25.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  25.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  25.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  25.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  25.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 25.9M]
  |  |  ------------------
  ------------------
  150|  25.9M|}
av1_iadst8_low1_ssse3:
 1703|   812k|void av1_iadst8_low1_ssse3(const __m128i *input, __m128i *output) {
 1704|   812k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|   812k|#define INV_COS_BIT 12
  ------------------
 1705|   812k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   812k|#define INV_COS_BIT 12
  ------------------
 1706|   812k|  const __m128i __zero = _mm_setzero_si128();
 1707|   812k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   812k|#define INV_COS_BIT 12
  ------------------
 1708|       |
 1709|   812k|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|   812k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1710|   812k|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|   812k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1711|   812k|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   812k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1712|   812k|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|   812k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1713|       |
 1714|       |  // stage 1
 1715|   812k|  __m128i x[8];
 1716|   812k|  x[1] = input[0];
 1717|       |
 1718|       |  // stage 2
 1719|   812k|  btf_16_ssse3(cospi[60], -cospi[4], x[1], x[0], x[1]);
  ------------------
  |  |   28|   812k|  do {                                          \
  |  |   29|   812k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   812k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   812k|    const __m128i _in = in;                     \
  |  |   32|   812k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   812k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   812k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 812k]
  |  |  ------------------
  ------------------
 1720|       |
 1721|       |  // stage 3
 1722|   812k|  x[4] = x[0];
 1723|   812k|  x[5] = x[1];
 1724|       |
 1725|       |  // stage 4
 1726|   812k|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|   812k|  do {                                            \
  |  |   62|   812k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   812k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   812k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   812k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   812k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   812k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   812k|                                                  \
  |  |   69|   812k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   812k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   812k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   812k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   812k|                                                  \
  |  |   74|   812k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   812k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   812k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   812k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   812k|                                                  \
  |  |   79|   812k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   812k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   812k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 812k]
  |  |  ------------------
  ------------------
 1727|       |
 1728|       |  // stage 5
 1729|   812k|  x[2] = x[0];
 1730|   812k|  x[3] = x[1];
 1731|   812k|  x[6] = x[4];
 1732|   812k|  x[7] = x[5];
 1733|       |
 1734|       |  // stage 6
 1735|   812k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|   812k|  do {                                            \
  |  |   62|   812k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   812k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   812k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   812k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   812k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   812k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   812k|                                                  \
  |  |   69|   812k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   812k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   812k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   812k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   812k|                                                  \
  |  |   74|   812k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   812k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   812k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   812k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   812k|                                                  \
  |  |   79|   812k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   812k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   812k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 812k]
  |  |  ------------------
  ------------------
 1736|   812k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|   812k|  do {                                            \
  |  |   62|   812k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   812k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   812k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   812k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   812k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   812k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   812k|                                                  \
  |  |   69|   812k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   812k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   812k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   812k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   812k|                                                  \
  |  |   74|   812k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   812k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   812k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   812k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   812k|                                                  \
  |  |   79|   812k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   812k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   812k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 812k]
  |  |  ------------------
  ------------------
 1737|       |
 1738|       |  // stage 7
 1739|   812k|  output[0] = x[0];
 1740|   812k|  output[1] = _mm_subs_epi16(__zero, x[4]);
 1741|   812k|  output[2] = x[6];
 1742|   812k|  output[3] = _mm_subs_epi16(__zero, x[2]);
 1743|   812k|  output[4] = x[3];
 1744|   812k|  output[5] = _mm_subs_epi16(__zero, x[7]);
 1745|   812k|  output[6] = x[5];
 1746|   812k|  output[7] = _mm_subs_epi16(__zero, x[1]);
 1747|   812k|}
av1_iadst8_sse2:
 1749|  13.1M|void av1_iadst8_sse2(const __m128i *input, __m128i *output) {
 1750|  13.1M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  13.1M|#define INV_COS_BIT 12
  ------------------
 1751|  13.1M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  13.1M|#define INV_COS_BIT 12
  ------------------
 1752|  13.1M|  const __m128i __zero = _mm_setzero_si128();
 1753|  13.1M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  13.1M|#define INV_COS_BIT 12
  ------------------
 1754|       |
 1755|  13.1M|  const __m128i cospi_p04_p60 = pair_set_epi16(cospi[4], cospi[60]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1756|  13.1M|  const __m128i cospi_p60_m04 = pair_set_epi16(cospi[60], -cospi[4]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1757|  13.1M|  const __m128i cospi_p20_p44 = pair_set_epi16(cospi[20], cospi[44]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1758|  13.1M|  const __m128i cospi_p44_m20 = pair_set_epi16(cospi[44], -cospi[20]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1759|  13.1M|  const __m128i cospi_p36_p28 = pair_set_epi16(cospi[36], cospi[28]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1760|  13.1M|  const __m128i cospi_p28_m36 = pair_set_epi16(cospi[28], -cospi[36]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1761|  13.1M|  const __m128i cospi_p52_p12 = pair_set_epi16(cospi[52], cospi[12]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1762|  13.1M|  const __m128i cospi_p12_m52 = pair_set_epi16(cospi[12], -cospi[52]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1763|  13.1M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1764|  13.1M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1765|  13.1M|  const __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1766|  13.1M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1767|  13.1M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  13.1M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1768|       |
 1769|       |  // stage 1
 1770|  13.1M|  __m128i x[8];
 1771|  13.1M|  x[0] = input[7];
 1772|  13.1M|  x[1] = input[0];
 1773|  13.1M|  x[2] = input[5];
 1774|  13.1M|  x[3] = input[2];
 1775|  13.1M|  x[4] = input[3];
 1776|  13.1M|  x[5] = input[4];
 1777|  13.1M|  x[6] = input[1];
 1778|  13.1M|  x[7] = input[6];
 1779|       |
 1780|       |  // stage 2
 1781|  13.1M|  btf_16_sse2(cospi_p04_p60, cospi_p60_m04, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1782|  13.1M|  btf_16_sse2(cospi_p20_p44, cospi_p44_m20, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1783|  13.1M|  btf_16_sse2(cospi_p36_p28, cospi_p28_m36, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1784|  13.1M|  btf_16_sse2(cospi_p52_p12, cospi_p12_m52, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1785|       |
 1786|       |  // stage 3
 1787|  13.1M|  btf_16_adds_subs_sse2(x[0], x[4]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1788|  13.1M|  btf_16_adds_subs_sse2(x[1], x[5]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1789|  13.1M|  btf_16_adds_subs_sse2(x[2], x[6]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1790|  13.1M|  btf_16_adds_subs_sse2(x[3], x[7]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1791|       |
 1792|       |  // stage 4
 1793|  13.1M|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1794|  13.1M|  btf_16_sse2(cospi_m48_p16, cospi_p16_p48, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1795|       |
 1796|       |  // stage 5
 1797|  13.1M|  btf_16_adds_subs_sse2(x[0], x[2]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1798|  13.1M|  btf_16_adds_subs_sse2(x[1], x[3]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1799|  13.1M|  btf_16_adds_subs_sse2(x[4], x[6]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1800|  13.1M|  btf_16_adds_subs_sse2(x[5], x[7]);
  ------------------
  |  |   37|  13.1M|  do {                                  \
  |  |   38|  13.1M|    const __m128i _in0 = in0;           \
  |  |   39|  13.1M|    const __m128i _in1 = in1;           \
  |  |   40|  13.1M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  13.1M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1801|       |
 1802|       |  // stage 6
 1803|  13.1M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1804|  13.1M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|  13.1M|  do {                                            \
  |  |   62|  13.1M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  13.1M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  13.1M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  13.1M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  13.1M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  13.1M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  13.1M|                                                  \
  |  |   69|  13.1M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  13.1M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  13.1M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  13.1M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  13.1M|                                                  \
  |  |   74|  13.1M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  13.1M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  13.1M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  13.1M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  13.1M|                                                  \
  |  |   79|  13.1M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  13.1M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  13.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 13.1M]
  |  |  ------------------
  ------------------
 1805|       |
 1806|       |  // stage 7
 1807|  13.1M|  output[0] = x[0];
 1808|  13.1M|  output[1] = _mm_subs_epi16(__zero, x[4]);
 1809|  13.1M|  output[2] = x[6];
 1810|  13.1M|  output[3] = _mm_subs_epi16(__zero, x[2]);
 1811|  13.1M|  output[4] = x[3];
 1812|  13.1M|  output[5] = _mm_subs_epi16(__zero, x[7]);
 1813|  13.1M|  output[6] = x[5];
 1814|  13.1M|  output[7] = _mm_subs_epi16(__zero, x[1]);
 1815|  13.1M|}
av1_lowbd_inv_txfm2d_add_idtx_ssse3:
 2388|  42.5k|                                         int stride, TX_SIZE tx_size) {
 2389|  42.5k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2390|  42.5k|  const int txw_idx = get_txw_idx(tx_size);
 2391|  42.5k|  const int txh_idx = get_txh_idx(tx_size);
 2392|  42.5k|  const int txfm_size_col = tx_size_wide[tx_size];
 2393|  42.5k|  const int txfm_size_row = tx_size_high[tx_size];
 2394|  42.5k|  const int col_max = AOMMIN(32, txfm_size_col);
  ------------------
  |  |   34|  42.5k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 42.5k]
  |  |  ------------------
  ------------------
 2395|  42.5k|  const int row_max = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  42.5k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 42.5k]
  |  |  ------------------
  ------------------
 2396|  42.5k|  const int input_stride = row_max;
 2397|  42.5k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 2398|       |
 2399|  85.1k|  for (int i = 0; i < (col_max >> 3); ++i) {
  ------------------
  |  Branch (2399:19): [True: 42.5k, False: 42.5k]
  ------------------
 2400|  85.1k|    for (int j = 0; j < (row_max >> 3); j++) {
  ------------------
  |  Branch (2400:21): [True: 42.5k, False: 42.5k]
  ------------------
 2401|  42.5k|      __m128i buf[8];
 2402|  42.5k|      iidentity_row_8xn_ssse3(buf, input + j * 8 + i * 8 * input_stride,
 2403|  42.5k|                              row_max, shift[0], 8, txw_idx, rect_type);
 2404|  42.5k|      transpose_16bit_8x8(buf, buf);
 2405|  42.5k|      iidentity_col_8xn_ssse3(output + i * 8 + j * 8 * stride, stride, buf,
 2406|  42.5k|                              shift[1], 8, txh_idx);
 2407|  42.5k|    }
 2408|  42.5k|  }
 2409|  42.5k|}
av1_lowbd_inv_txfm2d_add_h_identity_ssse3:
 2546|   462k|                                               int eob) {
 2547|   462k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2548|   462k|  int eobx, eoby;
 2549|   462k|  get_eobx_eoby_scan_h_identity(&eobx, &eoby, tx_size, eob);
 2550|   462k|  const int txw_idx = get_txw_idx(tx_size);
 2551|   462k|  const int txh_idx = get_txh_idx(tx_size);
 2552|   462k|  const int txfm_size_col = tx_size_wide[tx_size];
 2553|   462k|  const int txfm_size_row = tx_size_high[tx_size];
 2554|   462k|  const int buf_size_w_div8 = (eobx + 8) >> 3;
 2555|   462k|  const int buf_size_h_div8 = (eoby + 8) >> 3;
 2556|   462k|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|   462k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 462k]
  |  |  ------------------
  ------------------
 2557|   462k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 2558|       |
 2559|   462k|  const int fun_idx = lowbd_txfm_all_1d_zeros_idx[eoby];
 2560|   462k|  assert(fun_idx < 5);
 2561|   462k|  const transform_1d_ssse3 col_txfm =
 2562|   462k|      lowbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx];
 2563|       |
 2564|   462k|  assert(col_txfm != NULL);
 2565|       |
 2566|   462k|  int ud_flip, lr_flip;
 2567|   462k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2568|   936k|  for (int i = 0; i < buf_size_w_div8; i++) {
  ------------------
  |  Branch (2568:19): [True: 474k, False: 462k]
  ------------------
 2569|   474k|    __m128i buf0[64];
 2570|   952k|    for (int j = 0; j < buf_size_h_div8; j++) {
  ------------------
  |  Branch (2570:21): [True: 478k, False: 474k]
  ------------------
 2571|   478k|      __m128i *buf0_cur = buf0 + j * 8;
 2572|   478k|      const int32_t *input_cur = input + i * 8 * input_stride + j * 8;
 2573|   478k|      iidentity_row_8xn_ssse3(buf0_cur, input_cur, input_stride, shift[0], 8,
 2574|   478k|                              txw_idx, rect_type);
 2575|   478k|      transpose_16bit_8x8(buf0_cur, buf0_cur);
 2576|   478k|    }
 2577|   474k|    col_txfm(buf0, buf0);
 2578|   474k|    __m128i mshift = _mm_set1_epi16(1 << (15 + shift[1]));
 2579|   474k|    int k = ud_flip ? (txfm_size_row - 1) : 0;
  ------------------
  |  Branch (2579:13): [True: 17.3k, False: 456k]
  ------------------
 2580|   474k|    const int step = ud_flip ? -1 : 1;
  ------------------
  |  Branch (2580:22): [True: 17.3k, False: 456k]
  ------------------
 2581|   474k|    uint8_t *out = output + 8 * i;
 2582|  4.30M|    for (int j = 0; j < txfm_size_row; ++j, k += step) {
  ------------------
  |  Branch (2582:21): [True: 3.83M, False: 474k]
  ------------------
 2583|  3.83M|      const __m128i v = _mm_loadl_epi64((__m128i const *)(out));
 2584|  3.83M|      __m128i res = _mm_mulhrs_epi16(buf0[k], mshift);
 2585|  3.83M|      const __m128i u = lowbd_get_recon_8x8_sse2(v, res);
 2586|  3.83M|      _mm_storel_epi64((__m128i *)(out), u);
 2587|  3.83M|      out += stride;
 2588|  3.83M|    }
 2589|   474k|  }
 2590|   462k|}
av1_lowbd_inv_txfm2d_add_v_identity_ssse3:
 2595|  1.18M|                                               int eob) {
 2596|  1.18M|  __m128i buf1[64];
 2597|  1.18M|  int eobx, eoby;
 2598|  1.18M|  get_eobx_eoby_scan_v_identity(&eobx, &eoby, tx_size, eob);
 2599|  1.18M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2600|  1.18M|  const int txw_idx = get_txw_idx(tx_size);
 2601|  1.18M|  const int txh_idx = get_txh_idx(tx_size);
 2602|  1.18M|  const int txfm_size_col = tx_size_wide[tx_size];
 2603|  1.18M|  const int txfm_size_row = tx_size_high[tx_size];
 2604|  1.18M|  const int buf_size_w_div8 = txfm_size_col >> 3;
 2605|  1.18M|  const int buf_size_nonzero_w = ((eobx + 8) >> 3) << 3;
 2606|  1.18M|  const int buf_size_h_div8 = (eoby + 8) >> 3;
 2607|  1.18M|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  1.18M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.18M]
  |  |  ------------------
  ------------------
 2608|  1.18M|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 2609|       |
 2610|  1.18M|  const int fun_idx = lowbd_txfm_all_1d_zeros_idx[eobx];
 2611|  1.18M|  const transform_1d_ssse3 row_txfm =
 2612|  1.18M|      lowbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx];
 2613|       |
 2614|  1.18M|  assert(row_txfm != NULL);
 2615|  1.18M|  int ud_flip, lr_flip;
 2616|  1.18M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2617|  2.39M|  for (int i = 0; i < buf_size_h_div8; i++) {
  ------------------
  |  Branch (2617:19): [True: 1.20M, False: 1.18M]
  ------------------
 2618|  1.20M|    __m128i buf0[64];
 2619|  1.20M|    load_buffer_32bit_to_16bit(input + i * 8, input_stride, buf0,
 2620|  1.20M|                               buf_size_nonzero_w);
 2621|  1.20M|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (2621:9): [True: 10.6k, False: 1.19M]
  |  Branch (2621:27): [True: 46.9k, False: 1.14M]
  ------------------
 2622|  57.4k|      round_shift_ssse3(buf0, buf0, buf_size_nonzero_w);  // rect special code
 2623|  57.4k|    }
 2624|  1.20M|    row_txfm(buf0, buf0);
 2625|  1.20M|    round_shift_16bit_ssse3(buf0, txfm_size_col, shift[0]);
 2626|  1.20M|    __m128i *_buf1 = buf1;
 2627|  1.20M|    if (lr_flip) {
  ------------------
  |  Branch (2627:9): [True: 69.9k, False: 1.13M]
  ------------------
 2628|   139k|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (2628:23): [True: 69.8k, False: 69.9k]
  ------------------
 2629|  69.8k|        __m128i temp[8];
 2630|  69.8k|        flip_buf_sse2(buf0 + 8 * j, temp, 8);
 2631|  69.8k|        transpose_16bit_8x8(temp, _buf1 + 8 * (buf_size_w_div8 - 1 - j));
 2632|  69.8k|      }
 2633|  1.13M|    } else {
 2634|  2.28M|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (2634:23): [True: 1.14M, False: 1.13M]
  ------------------
 2635|  1.14M|        transpose_16bit_8x8(buf0 + 8 * j, _buf1 + 8 * j);
 2636|  1.14M|      }
 2637|  1.13M|    }
 2638|       |
 2639|  2.42M|    for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (2639:21): [True: 1.21M, False: 1.20M]
  ------------------
 2640|  1.21M|      iidentity_col_8xn_ssse3(output + i * 8 * stride + j * 8, stride,
 2641|  1.21M|                              buf1 + j * 8, shift[1], 8, txh_idx);
 2642|  1.21M|    }
 2643|  1.20M|  }
 2644|  1.18M|}
av1_lowbd_inv_txfm2d_add_ssse3:
 2867|  33.6M|                                    TX_SIZE tx_size, int eob) {
 2868|  33.6M|  switch (tx_size) {
 2869|  27.7M|    case TX_4X4:
  ------------------
  |  Branch (2869:5): [True: 27.7M, False: 5.91M]
  ------------------
 2870|  27.7M|      lowbd_inv_txfm2d_add_4x4_ssse3(input, output, stride, tx_type, tx_size,
 2871|  27.7M|                                     eob);
 2872|  27.7M|      break;
 2873|  4.73M|    case TX_4X8:
  ------------------
  |  Branch (2873:5): [True: 4.73M, False: 28.9M]
  ------------------
 2874|  4.73M|      lowbd_inv_txfm2d_add_4x8_ssse3(input, output, stride, tx_type, tx_size,
 2875|  4.73M|                                     eob);
 2876|  4.73M|      break;
 2877|   204k|    case TX_8X4:
  ------------------
  |  Branch (2877:5): [True: 204k, False: 33.4M]
  ------------------
 2878|   204k|      lowbd_inv_txfm2d_add_8x4_ssse3(input, output, stride, tx_type, tx_size,
 2879|   204k|                                     eob);
 2880|   204k|      break;
 2881|      0|    case TX_4X16:
  ------------------
  |  Branch (2881:5): [True: 0, False: 33.6M]
  ------------------
 2882|      0|      lowbd_inv_txfm2d_add_4x16_ssse3(input, output, stride, tx_type, tx_size,
 2883|      0|                                      eob);
 2884|      0|      break;
 2885|      0|    case TX_16X4:
  ------------------
  |  Branch (2885:5): [True: 0, False: 33.6M]
  ------------------
 2886|      0|      lowbd_inv_txfm2d_add_16x4_ssse3(input, output, stride, tx_type, tx_size,
 2887|      0|                                      eob);
 2888|      0|      break;
 2889|   990k|    default:
  ------------------
  |  Branch (2889:5): [True: 990k, False: 32.6M]
  ------------------
 2890|   990k|      lowbd_inv_txfm2d_add_universe_ssse3(input, output, stride, tx_type,
 2891|   990k|                                          tx_size, eob);
 2892|   990k|      break;
 2893|  33.6M|  }
 2894|  33.6M|}
av1_inv_txfm_ssse3.c:iidentity_row_8xn_ssse3:
 2320|   520k|                                           int txw_idx, int rect_type) {
 2321|   520k|  const int32_t *input_row = input;
 2322|   520k|  const __m128i scale = _mm_set1_epi16(NewSqrt2list[txw_idx]);
 2323|   520k|  const __m128i rounding = _mm_set1_epi16((1 << (NewSqrt2Bits - 1)) +
  ------------------
  |  |   42|   520k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2324|   520k|                                          (1 << (NewSqrt2Bits - shift - 1)));
  ------------------
  |  |   42|   520k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2325|   520k|  const __m128i one = _mm_set1_epi16(1);
 2326|   520k|  const __m128i scale_rounding = _mm_unpacklo_epi16(scale, rounding);
 2327|   520k|  if (rect_type != 1 && rect_type != -1) {
  ------------------
  |  Branch (2327:7): [True: 496k, False: 24.3k]
  |  Branch (2327:25): [True: 487k, False: 9.28k]
  ------------------
 2328|  4.38M|    for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (2328:21): [True: 3.89M, False: 487k]
  ------------------
 2329|  3.89M|      const __m128i src = load_32bit_to_16bit(input_row);
 2330|  3.89M|      input_row += stride;
 2331|  3.89M|      __m128i lo = _mm_unpacklo_epi16(src, one);
 2332|  3.89M|      __m128i hi = _mm_unpackhi_epi16(src, one);
 2333|  3.89M|      lo = _mm_madd_epi16(lo, scale_rounding);
 2334|  3.89M|      hi = _mm_madd_epi16(hi, scale_rounding);
 2335|  3.89M|      lo = _mm_srai_epi32(lo, NewSqrt2Bits - shift);
  ------------------
  |  |   42|  3.89M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2336|  3.89M|      hi = _mm_srai_epi32(hi, NewSqrt2Bits - shift);
  ------------------
  |  |   42|  3.89M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2337|  3.89M|      out[i] = _mm_packs_epi32(lo, hi);
 2338|  3.89M|    }
 2339|   487k|  } else {
 2340|  33.6k|    const __m128i rect_scale =
 2341|  33.6k|        _mm_set1_epi16(NewInvSqrt2 << (15 - NewSqrt2Bits));
  ------------------
  |  |   42|  33.6k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2342|   303k|    for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (2342:21): [True: 269k, False: 33.6k]
  ------------------
 2343|   269k|      __m128i src = load_32bit_to_16bit(input_row);
 2344|   269k|      src = _mm_mulhrs_epi16(src, rect_scale);
 2345|   269k|      input_row += stride;
 2346|   269k|      __m128i lo = _mm_unpacklo_epi16(src, one);
 2347|   269k|      __m128i hi = _mm_unpackhi_epi16(src, one);
 2348|   269k|      lo = _mm_madd_epi16(lo, scale_rounding);
 2349|   269k|      hi = _mm_madd_epi16(hi, scale_rounding);
 2350|   269k|      lo = _mm_srai_epi32(lo, NewSqrt2Bits - shift);
  ------------------
  |  |   42|   269k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2351|   269k|      hi = _mm_srai_epi32(hi, NewSqrt2Bits - shift);
  ------------------
  |  |   42|   269k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2352|   269k|      out[i] = _mm_packs_epi32(lo, hi);
 2353|   269k|    }
 2354|  33.6k|  }
 2355|   520k|}
av1_inv_txfm_ssse3.c:iidentity_col_8xn_ssse3:
 2359|  1.25M|                                           int txh_idx) {
 2360|  1.25M|  const __m128i scale = _mm_set1_epi16(NewSqrt2list[txh_idx]);
 2361|  1.25M|  const __m128i scale_rounding = _mm_set1_epi16(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  1.25M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2362|  1.25M|  const __m128i shift_rounding = _mm_set1_epi32(1 << (-shift - 1));
 2363|  1.25M|  const __m128i one = _mm_set1_epi16(1);
 2364|  1.25M|  const __m128i scale_coeff = _mm_unpacklo_epi16(scale, scale_rounding);
 2365|  1.25M|  const __m128i zero = _mm_setzero_si128();
 2366|  11.3M|  for (int h = 0; h < height; ++h) {
  ------------------
  |  Branch (2366:19): [True: 10.0M, False: 1.25M]
  ------------------
 2367|  10.0M|    __m128i lo = _mm_unpacklo_epi16(buf[h], one);
 2368|  10.0M|    __m128i hi = _mm_unpackhi_epi16(buf[h], one);
 2369|  10.0M|    lo = _mm_madd_epi16(lo, scale_coeff);
 2370|  10.0M|    hi = _mm_madd_epi16(hi, scale_coeff);
 2371|  10.0M|    lo = _mm_srai_epi32(lo, NewSqrt2Bits);
  ------------------
  |  |   42|  10.0M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2372|  10.0M|    hi = _mm_srai_epi32(hi, NewSqrt2Bits);
  ------------------
  |  |   42|  10.0M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2373|  10.0M|    lo = _mm_add_epi32(lo, shift_rounding);
 2374|  10.0M|    hi = _mm_add_epi32(hi, shift_rounding);
 2375|  10.0M|    lo = _mm_srai_epi32(lo, -shift);
 2376|  10.0M|    hi = _mm_srai_epi32(hi, -shift);
 2377|  10.0M|    __m128i x = _mm_packs_epi32(lo, hi);
 2378|       |
 2379|  10.0M|    const __m128i pred = _mm_loadl_epi64((__m128i const *)(output));
 2380|  10.0M|    x = _mm_adds_epi16(x, _mm_unpacklo_epi8(pred, zero));
 2381|  10.0M|    const __m128i u = _mm_packus_epi16(x, x);
 2382|  10.0M|    _mm_storel_epi64((__m128i *)(output), u);
 2383|  10.0M|    output += stride;
 2384|  10.0M|  }
 2385|  1.25M|}
av1_inv_txfm_ssse3.c:idct4_sse2:
   29|  3.56M|static void idct4_sse2(const __m128i *input, __m128i *output) {
   30|  3.56M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  3.56M|#define INV_COS_BIT 12
  ------------------
   31|  3.56M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  3.56M|#define INV_COS_BIT 12
  ------------------
   32|  3.56M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  3.56M|#define INV_COS_BIT 12
  ------------------
   33|       |
   34|  3.56M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  3.56M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   35|  3.56M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  3.56M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   36|  3.56M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  3.56M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   37|  3.56M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  3.56M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   38|       |
   39|       |  // stage 1
   40|  3.56M|  __m128i x[4];
   41|  3.56M|  x[0] = input[0];
   42|  3.56M|  x[1] = input[2];
   43|  3.56M|  x[2] = input[1];
   44|  3.56M|  x[3] = input[3];
   45|       |
   46|       |  // stage 2
   47|  3.56M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   61|  3.56M|  do {                                            \
  |  |   62|  3.56M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  3.56M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  3.56M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  3.56M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  3.56M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  3.56M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  3.56M|                                                  \
  |  |   69|  3.56M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  3.56M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  3.56M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  3.56M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  3.56M|                                                  \
  |  |   74|  3.56M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  3.56M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  3.56M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  3.56M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  3.56M|                                                  \
  |  |   79|  3.56M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  3.56M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  3.56M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
   48|  3.56M|  btf_16_sse2(cospi_p48_m16, cospi_p16_p48, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|  3.56M|  do {                                            \
  |  |   62|  3.56M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  3.56M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  3.56M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  3.56M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  3.56M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  3.56M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  3.56M|                                                  \
  |  |   69|  3.56M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  3.56M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  3.56M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  3.56M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  3.56M|                                                  \
  |  |   74|  3.56M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  3.56M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  3.56M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  3.56M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  3.56M|                                                  \
  |  |   79|  3.56M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  3.56M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  3.56M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
   49|       |
   50|       |  // stage 3
   51|  3.56M|  btf_16_adds_subs_out_sse2(output[0], output[3], x[0], x[3]);
  ------------------
  |  |   53|  3.56M|  do {                                                  \
  |  |   54|  3.56M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.56M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.56M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.56M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.56M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
   52|  3.56M|  btf_16_adds_subs_out_sse2(output[1], output[2], x[1], x[2]);
  ------------------
  |  |   53|  3.56M|  do {                                                  \
  |  |   54|  3.56M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.56M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.56M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.56M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.56M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
   53|  3.56M|}
av1_inv_txfm_ssse3.c:iadst4_sse2:
 1599|  1.37M|static void iadst4_sse2(const __m128i *input, __m128i *output) {
 1600|  1.37M|  const int32_t *sinpi = sinpi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  1.37M|#define INV_COS_BIT 12
  ------------------
 1601|  1.37M|  const __m128i sinpi_p01_p04 = pair_set_epi16(sinpi[1], sinpi[4]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1602|  1.37M|  const __m128i sinpi_p02_m01 = pair_set_epi16(sinpi[2], -sinpi[1]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1603|  1.37M|  const __m128i sinpi_p03_p02 = pair_set_epi16(sinpi[3], sinpi[2]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1604|  1.37M|  const __m128i sinpi_p03_m04 = pair_set_epi16(sinpi[3], -sinpi[4]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1605|  1.37M|  const __m128i sinpi_p03_m03 = pair_set_epi16(sinpi[3], -sinpi[3]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1606|  1.37M|  const __m128i sinpi_0_p03 = pair_set_epi16(0, sinpi[3]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1607|  1.37M|  const __m128i sinpi_p04_p02 = pair_set_epi16(sinpi[4], sinpi[2]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1608|  1.37M|  const __m128i sinpi_m03_m01 = pair_set_epi16(-sinpi[3], -sinpi[1]);
  ------------------
  |  |   20|  1.37M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1609|  1.37M|  __m128i x0[4];
 1610|  1.37M|  x0[0] = input[0];
 1611|  1.37M|  x0[1] = input[1];
 1612|  1.37M|  x0[2] = input[2];
 1613|  1.37M|  x0[3] = input[3];
 1614|       |
 1615|  1.37M|  __m128i u[4];
 1616|  1.37M|  u[0] = _mm_unpacklo_epi16(x0[0], x0[2]);
 1617|  1.37M|  u[1] = _mm_unpackhi_epi16(x0[0], x0[2]);
 1618|  1.37M|  u[2] = _mm_unpacklo_epi16(x0[1], x0[3]);
 1619|  1.37M|  u[3] = _mm_unpackhi_epi16(x0[1], x0[3]);
 1620|       |
 1621|  1.37M|  __m128i x1[16];
 1622|  1.37M|  x1[0] = _mm_madd_epi16(u[0], sinpi_p01_p04);  // x0*sin1 + x2*sin4
 1623|  1.37M|  x1[1] = _mm_madd_epi16(u[1], sinpi_p01_p04);
 1624|  1.37M|  x1[2] = _mm_madd_epi16(u[0], sinpi_p02_m01);  // x0*sin2 - x2*sin1
 1625|  1.37M|  x1[3] = _mm_madd_epi16(u[1], sinpi_p02_m01);
 1626|  1.37M|  x1[4] = _mm_madd_epi16(u[2], sinpi_p03_p02);  // x1*sin3 + x3*sin2
 1627|  1.37M|  x1[5] = _mm_madd_epi16(u[3], sinpi_p03_p02);
 1628|  1.37M|  x1[6] = _mm_madd_epi16(u[2], sinpi_p03_m04);  // x1*sin3 - x3*sin4
 1629|  1.37M|  x1[7] = _mm_madd_epi16(u[3], sinpi_p03_m04);
 1630|  1.37M|  x1[8] = _mm_madd_epi16(u[0], sinpi_p03_m03);  // x0*sin3 - x2*sin3
 1631|  1.37M|  x1[9] = _mm_madd_epi16(u[1], sinpi_p03_m03);
 1632|  1.37M|  x1[10] = _mm_madd_epi16(u[2], sinpi_0_p03);  // x2*sin3
 1633|  1.37M|  x1[11] = _mm_madd_epi16(u[3], sinpi_0_p03);
 1634|  1.37M|  x1[12] = _mm_madd_epi16(u[0], sinpi_p04_p02);  // x0*sin4 + x2*sin2
 1635|  1.37M|  x1[13] = _mm_madd_epi16(u[1], sinpi_p04_p02);
 1636|  1.37M|  x1[14] = _mm_madd_epi16(u[2], sinpi_m03_m01);  // -x1*sin3 - x3*sin1
 1637|  1.37M|  x1[15] = _mm_madd_epi16(u[3], sinpi_m03_m01);
 1638|       |
 1639|  1.37M|  __m128i x2[8];
 1640|  1.37M|  x2[0] = _mm_add_epi32(x1[0], x1[4]);  // x0*sin1 +x2*sin4 +x1*sin3 +x3*sin2
 1641|  1.37M|  x2[1] = _mm_add_epi32(x1[1], x1[5]);
 1642|  1.37M|  x2[2] = _mm_add_epi32(x1[2], x1[6]);  // x0*sin2 -x2*sin1 +x1*sin3 -x3*sin4
 1643|  1.37M|  x2[3] = _mm_add_epi32(x1[3], x1[7]);
 1644|  1.37M|  x2[4] = _mm_add_epi32(x1[8], x1[10]);  // x0*sin3 -x2*sin3 +x3*sin3
 1645|  1.37M|  x2[5] = _mm_add_epi32(x1[9], x1[11]);
 1646|  1.37M|  x2[6] = _mm_add_epi32(x1[12], x1[14]);  // x0*sin1 +x2*sin4 +x0*sin2 -x2*sin1
 1647|  1.37M|  x2[7] = _mm_add_epi32(x1[13], x1[15]);
 1648|       |
 1649|  1.37M|  const __m128i rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  1.37M|#define INV_COS_BIT 12
  ------------------
 1650|  6.88M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1650:19): [True: 5.50M, False: 1.37M]
  ------------------
 1651|  5.50M|    __m128i out0 = _mm_add_epi32(x2[2 * i], rounding);
 1652|  5.50M|    __m128i out1 = _mm_add_epi32(x2[2 * i + 1], rounding);
 1653|  5.50M|    out0 = _mm_srai_epi32(out0, INV_COS_BIT);
  ------------------
  |  |   43|  5.50M|#define INV_COS_BIT 12
  ------------------
 1654|  5.50M|    out1 = _mm_srai_epi32(out1, INV_COS_BIT);
  ------------------
  |  |   43|  5.50M|#define INV_COS_BIT 12
  ------------------
 1655|  5.50M|    output[i] = _mm_packs_epi32(out0, out1);
 1656|  5.50M|  }
 1657|  1.37M|}
av1_inv_txfm_ssse3.c:iidentity4_ssse3:
 2212|  2.05M|static void iidentity4_ssse3(const __m128i *input, __m128i *output) {
 2213|  2.05M|  const int16_t scale_fractional = (NewSqrt2 - (1 << NewSqrt2Bits));
  ------------------
  |  |   42|  2.05M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2214|  2.05M|  const __m128i scale = _mm_set1_epi16(scale_fractional << (15 - NewSqrt2Bits));
  ------------------
  |  |   42|  2.05M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 2215|  10.2M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (2215:19): [True: 8.20M, False: 2.05M]
  ------------------
 2216|  8.20M|    __m128i x = _mm_mulhrs_epi16(input[i], scale);
 2217|  8.20M|    output[i] = _mm_adds_epi16(x, input[i]);
 2218|  8.20M|  }
 2219|  2.05M|}
av1_inv_txfm_ssse3.c:iidentity8_sse2:
 2221|  47.6k|static void iidentity8_sse2(const __m128i *input, __m128i *output) {
 2222|   429k|  for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (2222:19): [True: 381k, False: 47.6k]
  ------------------
 2223|   381k|    output[i] = _mm_adds_epi16(input[i], input[i]);
 2224|   381k|  }
 2225|  47.6k|}
av1_inv_txfm_ssse3.c:idct16_low1_ssse3:
  238|  78.7k|static void idct16_low1_ssse3(const __m128i *input, __m128i *output) {
  239|  78.7k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  78.7k|#define INV_COS_BIT 12
  ------------------
  240|       |
  241|       |  // stage 1
  242|  78.7k|  __m128i x[2];
  243|  78.7k|  x[0] = input[0];
  244|       |
  245|       |  // stage 2
  246|       |  // stage 3
  247|       |  // stage 4
  248|  78.7k|  btf_16_ssse3(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   28|  78.7k|  do {                                          \
  |  |   29|  78.7k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  78.7k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  78.7k|    const __m128i _in = in;                     \
  |  |   32|  78.7k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  78.7k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  78.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 78.7k]
  |  |  ------------------
  ------------------
  249|       |
  250|       |  // stage 5
  251|       |  // stage 6
  252|       |  // stage 7
  253|  78.7k|  output[0] = x[0];
  254|  78.7k|  output[15] = x[0];
  255|  78.7k|  output[1] = x[1];
  256|  78.7k|  output[14] = x[1];
  257|  78.7k|  output[2] = x[1];
  258|  78.7k|  output[13] = x[1];
  259|  78.7k|  output[3] = x[0];
  260|  78.7k|  output[12] = x[0];
  261|  78.7k|  output[4] = x[0];
  262|  78.7k|  output[11] = x[0];
  263|  78.7k|  output[5] = x[1];
  264|  78.7k|  output[10] = x[1];
  265|  78.7k|  output[6] = x[1];
  266|  78.7k|  output[9] = x[1];
  267|  78.7k|  output[7] = x[0];
  268|  78.7k|  output[8] = x[0];
  269|  78.7k|}
av1_inv_txfm_ssse3.c:idct16_low8_ssse3:
  271|   124k|static void idct16_low8_ssse3(const __m128i *input, __m128i *output) {
  272|   124k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|   124k|#define INV_COS_BIT 12
  ------------------
  273|   124k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   124k|#define INV_COS_BIT 12
  ------------------
  274|   124k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   124k|#define INV_COS_BIT 12
  ------------------
  275|   124k|  const __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|   124k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  276|   124k|  const __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|   124k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  277|   124k|  const __m128i cospi_m48_m16 = pair_set_epi16(-cospi[48], -cospi[16]);
  ------------------
  |  |   20|   124k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  278|       |
  279|       |  // stage 1
  280|   124k|  __m128i x[16];
  281|   124k|  x[0] = input[0];
  282|   124k|  x[2] = input[4];
  283|   124k|  x[4] = input[2];
  284|   124k|  x[6] = input[6];
  285|   124k|  x[8] = input[1];
  286|   124k|  x[10] = input[5];
  287|   124k|  x[12] = input[3];
  288|   124k|  x[14] = input[7];
  289|       |
  290|       |  // stage 2
  291|   124k|  btf_16_ssse3(cospi[60], cospi[4], x[8], x[8], x[15]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  292|   124k|  btf_16_ssse3(-cospi[36], cospi[28], x[14], x[9], x[14]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  293|   124k|  btf_16_ssse3(cospi[44], cospi[20], x[10], x[10], x[13]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  294|   124k|  btf_16_ssse3(-cospi[52], cospi[12], x[12], x[11], x[12]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  295|       |
  296|       |  // stage 3
  297|   124k|  btf_16_ssse3(cospi[56], cospi[8], x[4], x[4], x[7]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  298|   124k|  btf_16_ssse3(-cospi[40], cospi[24], x[6], x[5], x[6]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  299|   124k|  btf_16_adds_subs_sse2(x[8], x[9]);
  ------------------
  |  |   37|   124k|  do {                                  \
  |  |   38|   124k|    const __m128i _in0 = in0;           \
  |  |   39|   124k|    const __m128i _in1 = in1;           \
  |  |   40|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  300|   124k|  btf_16_subs_adds_sse2(x[11], x[10]);
  ------------------
  |  |   45|   124k|  do {                                  \
  |  |   46|   124k|    const __m128i _in0 = in0;           \
  |  |   47|   124k|    const __m128i _in1 = in1;           \
  |  |   48|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  301|   124k|  btf_16_adds_subs_sse2(x[12], x[13]);
  ------------------
  |  |   37|   124k|  do {                                  \
  |  |   38|   124k|    const __m128i _in0 = in0;           \
  |  |   39|   124k|    const __m128i _in1 = in1;           \
  |  |   40|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  302|   124k|  btf_16_subs_adds_sse2(x[15], x[14]);
  ------------------
  |  |   45|   124k|  do {                                  \
  |  |   46|   124k|    const __m128i _in0 = in0;           \
  |  |   47|   124k|    const __m128i _in1 = in1;           \
  |  |   48|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  303|       |
  304|       |  // stage 4
  305|   124k|  btf_16_ssse3(cospi[32], cospi[32], x[0], x[0], x[1]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  306|   124k|  btf_16_ssse3(cospi[48], cospi[16], x[2], x[2], x[3]);
  ------------------
  |  |   28|   124k|  do {                                          \
  |  |   29|   124k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|   124k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|   124k|    const __m128i _in = in;                     \
  |  |   32|   124k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|   124k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  307|   124k|  btf_16_adds_subs_sse2(x[4], x[5]);
  ------------------
  |  |   37|   124k|  do {                                  \
  |  |   38|   124k|    const __m128i _in0 = in0;           \
  |  |   39|   124k|    const __m128i _in1 = in1;           \
  |  |   40|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  308|   124k|  btf_16_subs_adds_sse2(x[7], x[6]);
  ------------------
  |  |   45|   124k|  do {                                  \
  |  |   46|   124k|    const __m128i _in0 = in0;           \
  |  |   47|   124k|    const __m128i _in1 = in1;           \
  |  |   48|   124k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   124k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  309|   124k|  btf_16_sse2(cospi_m16_p48, cospi_p48_p16, x[9], x[14], x[9], x[14]);
  ------------------
  |  |   61|   124k|  do {                                            \
  |  |   62|   124k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   124k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   124k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   124k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   124k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   124k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   124k|                                                  \
  |  |   69|   124k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   124k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   124k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   124k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   124k|                                                  \
  |  |   74|   124k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   124k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   124k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   124k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   124k|                                                  \
  |  |   79|   124k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   124k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  310|   124k|  btf_16_sse2(cospi_m48_m16, cospi_m16_p48, x[10], x[13], x[10], x[13]);
  ------------------
  |  |   61|   124k|  do {                                            \
  |  |   62|   124k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   124k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   124k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   124k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   124k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   124k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   124k|                                                  \
  |  |   69|   124k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   124k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   124k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   124k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   124k|                                                  \
  |  |   74|   124k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   124k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   124k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   124k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   124k|                                                  \
  |  |   79|   124k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   124k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   124k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 124k]
  |  |  ------------------
  ------------------
  311|       |
  312|   124k|  idct16_stage5_sse2(x, cospi, __rounding, cos_bit);
  313|   124k|  idct16_stage6_sse2(x, cospi, __rounding, cos_bit);
  314|   124k|  idct16_stage7_sse2(output, x);
  315|   124k|}
av1_inv_txfm_ssse3.c:idct16_stage5_sse2:
  202|   642k|                                      int8_t cos_bit) {
  203|   642k|  const __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|   642k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  204|   642k|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   642k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  205|   642k|  btf_16_adds_subs_sse2(x[0], x[3]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  206|   642k|  btf_16_adds_subs_sse2(x[1], x[2]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  207|   642k|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   61|   642k|  do {                                            \
  |  |   62|   642k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   642k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   642k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   642k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   642k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   642k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   642k|                                                  \
  |  |   69|   642k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   642k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   642k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   642k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   642k|                                                  \
  |  |   74|   642k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   642k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   642k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   642k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   642k|                                                  \
  |  |   79|   642k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   642k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  208|   642k|  btf_16_adds_subs_sse2(x[8], x[11]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  209|   642k|  btf_16_adds_subs_sse2(x[9], x[10]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  210|   642k|  btf_16_subs_adds_sse2(x[15], x[12]);
  ------------------
  |  |   45|   642k|  do {                                  \
  |  |   46|   642k|    const __m128i _in0 = in0;           \
  |  |   47|   642k|    const __m128i _in1 = in1;           \
  |  |   48|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  211|   642k|  btf_16_subs_adds_sse2(x[14], x[13]);
  ------------------
  |  |   45|   642k|  do {                                  \
  |  |   46|   642k|    const __m128i _in0 = in0;           \
  |  |   47|   642k|    const __m128i _in1 = in1;           \
  |  |   48|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  212|   642k|}
av1_inv_txfm_ssse3.c:idct16_stage6_sse2:
  216|   642k|                                      int8_t cos_bit) {
  217|   642k|  const __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|   642k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  218|   642k|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   642k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  219|   642k|  btf_16_adds_subs_sse2(x[0], x[7]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  220|   642k|  btf_16_adds_subs_sse2(x[1], x[6]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  221|   642k|  btf_16_adds_subs_sse2(x[2], x[5]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  222|   642k|  btf_16_adds_subs_sse2(x[3], x[4]);
  ------------------
  |  |   37|   642k|  do {                                  \
  |  |   38|   642k|    const __m128i _in0 = in0;           \
  |  |   39|   642k|    const __m128i _in1 = in1;           \
  |  |   40|   642k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   642k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  223|   642k|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, x[10], x[13], x[10], x[13]);
  ------------------
  |  |   61|   642k|  do {                                            \
  |  |   62|   642k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   642k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   642k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   642k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   642k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   642k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   642k|                                                  \
  |  |   69|   642k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   642k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   642k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   642k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   642k|                                                  \
  |  |   74|   642k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   642k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   642k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   642k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   642k|                                                  \
  |  |   79|   642k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   642k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  224|   642k|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, x[11], x[12], x[11], x[12]);
  ------------------
  |  |   61|   642k|  do {                                            \
  |  |   62|   642k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   642k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   642k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   642k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   642k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   642k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   642k|                                                  \
  |  |   69|   642k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   642k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   642k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   642k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   642k|                                                  \
  |  |   74|   642k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   642k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   642k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   642k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   642k|                                                  \
  |  |   79|   642k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   642k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  225|   642k|}
av1_inv_txfm_ssse3.c:idct16_stage7_sse2:
  227|   642k|static inline void idct16_stage7_sse2(__m128i *output, __m128i *x) {
  228|   642k|  btf_16_adds_subs_out_sse2(output[0], output[15], x[0], x[15]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  229|   642k|  btf_16_adds_subs_out_sse2(output[1], output[14], x[1], x[14]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  230|   642k|  btf_16_adds_subs_out_sse2(output[2], output[13], x[2], x[13]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  231|   642k|  btf_16_adds_subs_out_sse2(output[3], output[12], x[3], x[12]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  232|   642k|  btf_16_adds_subs_out_sse2(output[4], output[11], x[4], x[11]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  233|   642k|  btf_16_adds_subs_out_sse2(output[5], output[10], x[5], x[10]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  234|   642k|  btf_16_adds_subs_out_sse2(output[6], output[9], x[6], x[9]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  235|   642k|  btf_16_adds_subs_out_sse2(output[7], output[8], x[7], x[8]);
  ------------------
  |  |   53|   642k|  do {                                                  \
  |  |   54|   642k|    const __m128i _in0 = in0;                           \
  |  |   55|   642k|    const __m128i _in1 = in1;                           \
  |  |   56|   642k|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|   642k|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|   642k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 642k]
  |  |  ------------------
  ------------------
  236|   642k|}
av1_inv_txfm_ssse3.c:idct16_sse2:
  317|   517k|static void idct16_sse2(const __m128i *input, __m128i *output) {
  318|   517k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|   517k|#define INV_COS_BIT 12
  ------------------
  319|   517k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   517k|#define INV_COS_BIT 12
  ------------------
  320|   517k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   517k|#define INV_COS_BIT 12
  ------------------
  321|       |
  322|   517k|  const __m128i cospi_p60_m04 = pair_set_epi16(cospi[60], -cospi[4]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  323|   517k|  const __m128i cospi_p04_p60 = pair_set_epi16(cospi[4], cospi[60]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  324|   517k|  const __m128i cospi_p28_m36 = pair_set_epi16(cospi[28], -cospi[36]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  325|   517k|  const __m128i cospi_p36_p28 = pair_set_epi16(cospi[36], cospi[28]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  326|   517k|  const __m128i cospi_p44_m20 = pair_set_epi16(cospi[44], -cospi[20]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  327|   517k|  const __m128i cospi_p20_p44 = pair_set_epi16(cospi[20], cospi[44]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  328|   517k|  const __m128i cospi_p12_m52 = pair_set_epi16(cospi[12], -cospi[52]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  329|   517k|  const __m128i cospi_p52_p12 = pair_set_epi16(cospi[52], cospi[12]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  330|   517k|  const __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  331|   517k|  const __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  332|   517k|  const __m128i cospi_p24_m40 = pair_set_epi16(cospi[24], -cospi[40]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  333|   517k|  const __m128i cospi_p40_p24 = pair_set_epi16(cospi[40], cospi[24]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  334|   517k|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  335|   517k|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  336|   517k|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  337|   517k|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  338|   517k|  const __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  339|   517k|  const __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  340|   517k|  const __m128i cospi_m48_m16 = pair_set_epi16(-cospi[48], -cospi[16]);
  ------------------
  |  |   20|   517k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  341|       |
  342|       |  // stage 1
  343|   517k|  __m128i x[16];
  344|   517k|  x[0] = input[0];
  345|   517k|  x[1] = input[8];
  346|   517k|  x[2] = input[4];
  347|   517k|  x[3] = input[12];
  348|   517k|  x[4] = input[2];
  349|   517k|  x[5] = input[10];
  350|   517k|  x[6] = input[6];
  351|   517k|  x[7] = input[14];
  352|   517k|  x[8] = input[1];
  353|   517k|  x[9] = input[9];
  354|   517k|  x[10] = input[5];
  355|   517k|  x[11] = input[13];
  356|   517k|  x[12] = input[3];
  357|   517k|  x[13] = input[11];
  358|   517k|  x[14] = input[7];
  359|   517k|  x[15] = input[15];
  360|       |
  361|       |  // stage 2
  362|   517k|  btf_16_sse2(cospi_p60_m04, cospi_p04_p60, x[8], x[15], x[8], x[15]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  363|   517k|  btf_16_sse2(cospi_p28_m36, cospi_p36_p28, x[9], x[14], x[9], x[14]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  364|   517k|  btf_16_sse2(cospi_p44_m20, cospi_p20_p44, x[10], x[13], x[10], x[13]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  365|   517k|  btf_16_sse2(cospi_p12_m52, cospi_p52_p12, x[11], x[12], x[11], x[12]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  366|       |
  367|       |  // stage 3
  368|   517k|  btf_16_sse2(cospi_p56_m08, cospi_p08_p56, x[4], x[7], x[4], x[7]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  369|   517k|  btf_16_sse2(cospi_p24_m40, cospi_p40_p24, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  370|   517k|  btf_16_adds_subs_sse2(x[8], x[9]);
  ------------------
  |  |   37|   517k|  do {                                  \
  |  |   38|   517k|    const __m128i _in0 = in0;           \
  |  |   39|   517k|    const __m128i _in1 = in1;           \
  |  |   40|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  371|   517k|  btf_16_subs_adds_sse2(x[11], x[10]);
  ------------------
  |  |   45|   517k|  do {                                  \
  |  |   46|   517k|    const __m128i _in0 = in0;           \
  |  |   47|   517k|    const __m128i _in1 = in1;           \
  |  |   48|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  372|   517k|  btf_16_adds_subs_sse2(x[12], x[13]);
  ------------------
  |  |   37|   517k|  do {                                  \
  |  |   38|   517k|    const __m128i _in0 = in0;           \
  |  |   39|   517k|    const __m128i _in1 = in1;           \
  |  |   40|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  373|   517k|  btf_16_subs_adds_sse2(x[15], x[14]);
  ------------------
  |  |   45|   517k|  do {                                  \
  |  |   46|   517k|    const __m128i _in0 = in0;           \
  |  |   47|   517k|    const __m128i _in1 = in1;           \
  |  |   48|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  374|       |
  375|       |  // stage 4
  376|   517k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  377|   517k|  btf_16_sse2(cospi_p48_m16, cospi_p16_p48, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  378|   517k|  btf_16_adds_subs_sse2(x[4], x[5]);
  ------------------
  |  |   37|   517k|  do {                                  \
  |  |   38|   517k|    const __m128i _in0 = in0;           \
  |  |   39|   517k|    const __m128i _in1 = in1;           \
  |  |   40|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  379|   517k|  btf_16_subs_adds_sse2(x[7], x[6]);
  ------------------
  |  |   45|   517k|  do {                                  \
  |  |   46|   517k|    const __m128i _in0 = in0;           \
  |  |   47|   517k|    const __m128i _in1 = in1;           \
  |  |   48|   517k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|   517k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  380|   517k|  btf_16_sse2(cospi_m16_p48, cospi_p48_p16, x[9], x[14], x[9], x[14]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  381|   517k|  btf_16_sse2(cospi_m48_m16, cospi_m16_p48, x[10], x[13], x[10], x[13]);
  ------------------
  |  |   61|   517k|  do {                                            \
  |  |   62|   517k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   517k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   517k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   517k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   517k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   517k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   517k|                                                  \
  |  |   69|   517k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   517k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   517k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   517k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   517k|                                                  \
  |  |   74|   517k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   517k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   517k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   517k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   517k|                                                  \
  |  |   79|   517k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   517k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   517k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 517k]
  |  |  ------------------
  ------------------
  382|       |
  383|       |  // stage 5~7
  384|   517k|  idct16_stage5_sse2(x, cospi, __rounding, cos_bit);
  385|   517k|  idct16_stage6_sse2(x, cospi, __rounding, cos_bit);
  386|   517k|  idct16_stage7_sse2(output, x);
  387|   517k|}
av1_inv_txfm_ssse3.c:iadst16_low1_ssse3:
 1976|  8.20k|static void iadst16_low1_ssse3(const __m128i *input, __m128i *output) {
 1977|  8.20k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  8.20k|#define INV_COS_BIT 12
  ------------------
 1978|  8.20k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  8.20k|#define INV_COS_BIT 12
  ------------------
 1979|  8.20k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  8.20k|#define INV_COS_BIT 12
  ------------------
 1980|       |
 1981|  8.20k|  const __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|  8.20k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1982|  8.20k|  const __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|  8.20k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1983|  8.20k|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  8.20k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1984|  8.20k|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  8.20k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1985|       |
 1986|       |  // stage 1
 1987|  8.20k|  __m128i x[16];
 1988|  8.20k|  x[1] = input[0];
 1989|       |
 1990|       |  // stage 2
 1991|  8.20k|  btf_16_ssse3(cospi[62], -cospi[2], x[1], x[0], x[1]);
  ------------------
  |  |   28|  8.20k|  do {                                          \
  |  |   29|  8.20k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  8.20k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  8.20k|    const __m128i _in = in;                     \
  |  |   32|  8.20k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  8.20k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  8.20k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 8.20k]
  |  |  ------------------
  ------------------
 1992|       |
 1993|       |  // stage 3
 1994|  8.20k|  x[8] = x[0];
 1995|  8.20k|  x[9] = x[1];
 1996|       |
 1997|       |  // stage 4
 1998|  8.20k|  btf_16_sse2(cospi_p08_p56, cospi_p56_m08, x[8], x[9], x[8], x[9]);
  ------------------
  |  |   61|  8.20k|  do {                                            \
  |  |   62|  8.20k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  8.20k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  8.20k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  8.20k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  8.20k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  8.20k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  8.20k|                                                  \
  |  |   69|  8.20k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  8.20k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  8.20k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  8.20k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  8.20k|                                                  \
  |  |   74|  8.20k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  8.20k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  8.20k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  8.20k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  8.20k|                                                  \
  |  |   79|  8.20k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  8.20k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  8.20k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 8.20k]
  |  |  ------------------
  ------------------
 1999|       |
 2000|       |  // stage 5
 2001|  8.20k|  x[4] = x[0];
 2002|  8.20k|  x[5] = x[1];
 2003|  8.20k|  x[12] = x[8];
 2004|  8.20k|  x[13] = x[9];
 2005|       |
 2006|       |  // stage 6
 2007|  8.20k|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|  8.20k|  do {                                            \
  |  |   62|  8.20k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  8.20k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  8.20k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  8.20k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  8.20k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  8.20k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  8.20k|                                                  \
  |  |   69|  8.20k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  8.20k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  8.20k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  8.20k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  8.20k|                                                  \
  |  |   74|  8.20k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  8.20k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  8.20k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  8.20k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  8.20k|                                                  \
  |  |   79|  8.20k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  8.20k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  8.20k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 8.20k]
  |  |  ------------------
  ------------------
 2008|  8.20k|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[12], x[13], x[12], x[13]);
  ------------------
  |  |   61|  8.20k|  do {                                            \
  |  |   62|  8.20k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  8.20k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  8.20k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  8.20k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  8.20k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  8.20k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  8.20k|                                                  \
  |  |   69|  8.20k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  8.20k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  8.20k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  8.20k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  8.20k|                                                  \
  |  |   74|  8.20k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  8.20k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  8.20k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  8.20k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  8.20k|                                                  \
  |  |   79|  8.20k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  8.20k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  8.20k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 8.20k]
  |  |  ------------------
  ------------------
 2009|       |
 2010|       |  // stage 7
 2011|  8.20k|  x[2] = x[0];
 2012|  8.20k|  x[3] = x[1];
 2013|  8.20k|  x[6] = x[4];
 2014|  8.20k|  x[7] = x[5];
 2015|  8.20k|  x[10] = x[8];
 2016|  8.20k|  x[11] = x[9];
 2017|  8.20k|  x[14] = x[12];
 2018|  8.20k|  x[15] = x[13];
 2019|       |
 2020|  8.20k|  iadst16_stage8_ssse3(x, cospi, __rounding, cos_bit);
 2021|  8.20k|  iadst16_stage9_ssse3(output, x);
 2022|  8.20k|}
av1_inv_txfm_ssse3.c:iadst16_stage8_ssse3:
 1947|   232k|                                        int8_t cos_bit) {
 1948|   232k|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   232k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1949|   232k|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|   232k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1950|   232k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|   232k|  do {                                            \
  |  |   62|   232k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   232k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   232k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   232k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   232k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   232k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   232k|                                                  \
  |  |   69|   232k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   232k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   232k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   232k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   232k|                                                  \
  |  |   74|   232k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   232k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   232k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   232k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   232k|                                                  \
  |  |   79|   232k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   232k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   232k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 232k]
  |  |  ------------------
  ------------------
 1951|   232k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|   232k|  do {                                            \
  |  |   62|   232k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   232k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   232k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   232k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   232k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   232k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   232k|                                                  \
  |  |   69|   232k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   232k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   232k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   232k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   232k|                                                  \
  |  |   74|   232k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   232k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   232k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   232k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   232k|                                                  \
  |  |   79|   232k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   232k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   232k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 232k]
  |  |  ------------------
  ------------------
 1952|   232k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[10], x[11], x[10], x[11]);
  ------------------
  |  |   61|   232k|  do {                                            \
  |  |   62|   232k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   232k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   232k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   232k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   232k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   232k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   232k|                                                  \
  |  |   69|   232k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   232k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   232k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   232k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   232k|                                                  \
  |  |   74|   232k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   232k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   232k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   232k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   232k|                                                  \
  |  |   79|   232k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   232k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   232k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 232k]
  |  |  ------------------
  ------------------
 1953|   232k|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x[14], x[15], x[14], x[15]);
  ------------------
  |  |   61|   232k|  do {                                            \
  |  |   62|   232k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   232k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   232k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   232k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   232k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   232k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   232k|                                                  \
  |  |   69|   232k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   232k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   232k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   232k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   232k|                                                  \
  |  |   74|   232k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   232k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   232k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   232k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   232k|                                                  \
  |  |   79|   232k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   232k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   232k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 232k]
  |  |  ------------------
  ------------------
 1954|   232k|}
av1_inv_txfm_ssse3.c:iadst16_stage9_ssse3:
 1956|   232k|static inline void iadst16_stage9_ssse3(__m128i *output, __m128i *x) {
 1957|   232k|  const __m128i __zero = _mm_setzero_si128();
 1958|   232k|  output[0] = x[0];
 1959|   232k|  output[1] = _mm_subs_epi16(__zero, x[8]);
 1960|   232k|  output[2] = x[12];
 1961|   232k|  output[3] = _mm_subs_epi16(__zero, x[4]);
 1962|   232k|  output[4] = x[6];
 1963|   232k|  output[5] = _mm_subs_epi16(__zero, x[14]);
 1964|   232k|  output[6] = x[10];
 1965|   232k|  output[7] = _mm_subs_epi16(__zero, x[2]);
 1966|   232k|  output[8] = x[3];
 1967|   232k|  output[9] = _mm_subs_epi16(__zero, x[11]);
 1968|   232k|  output[10] = x[15];
 1969|   232k|  output[11] = _mm_subs_epi16(__zero, x[7]);
 1970|   232k|  output[12] = x[5];
 1971|   232k|  output[13] = _mm_subs_epi16(__zero, x[13]);
 1972|   232k|  output[14] = x[9];
 1973|   232k|  output[15] = _mm_subs_epi16(__zero, x[1]);
 1974|   232k|}
av1_inv_txfm_ssse3.c:iadst16_low8_ssse3:
 2024|  38.9k|static void iadst16_low8_ssse3(const __m128i *input, __m128i *output) {
 2025|  38.9k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  38.9k|#define INV_COS_BIT 12
  ------------------
 2026|  38.9k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  38.9k|#define INV_COS_BIT 12
  ------------------
 2027|  38.9k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  38.9k|#define INV_COS_BIT 12
  ------------------
 2028|       |
 2029|       |  // stage 1
 2030|  38.9k|  __m128i x[16];
 2031|  38.9k|  x[1] = input[0];
 2032|  38.9k|  x[3] = input[2];
 2033|  38.9k|  x[5] = input[4];
 2034|  38.9k|  x[7] = input[6];
 2035|  38.9k|  x[8] = input[7];
 2036|  38.9k|  x[10] = input[5];
 2037|  38.9k|  x[12] = input[3];
 2038|  38.9k|  x[14] = input[1];
 2039|       |
 2040|       |  // stage 2
 2041|  38.9k|  btf_16_ssse3(cospi[62], -cospi[2], x[1], x[0], x[1]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2042|  38.9k|  btf_16_ssse3(cospi[54], -cospi[10], x[3], x[2], x[3]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2043|  38.9k|  btf_16_ssse3(cospi[46], -cospi[18], x[5], x[4], x[5]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2044|  38.9k|  btf_16_ssse3(cospi[38], -cospi[26], x[7], x[6], x[7]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2045|  38.9k|  btf_16_ssse3(cospi[34], cospi[30], x[8], x[8], x[9]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2046|  38.9k|  btf_16_ssse3(cospi[42], cospi[22], x[10], x[10], x[11]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2047|  38.9k|  btf_16_ssse3(cospi[50], cospi[14], x[12], x[12], x[13]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2048|  38.9k|  btf_16_ssse3(cospi[58], cospi[6], x[14], x[14], x[15]);
  ------------------
  |  |   28|  38.9k|  do {                                          \
  |  |   29|  38.9k|    const __m128i _w0 = _mm_set1_epi16(w0 * 8); \
  |  |   30|  38.9k|    const __m128i _w1 = _mm_set1_epi16(w1 * 8); \
  |  |   31|  38.9k|    const __m128i _in = in;                     \
  |  |   32|  38.9k|    out0 = _mm_mulhrs_epi16(_in, _w0);          \
  |  |   33|  38.9k|    out1 = _mm_mulhrs_epi16(_in, _w1);          \
  |  |   34|  38.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
 2049|       |
 2050|       |  // stage 3
 2051|  38.9k|  iadst16_stage3_ssse3(x);
 2052|  38.9k|  iadst16_stage4_ssse3(x, cospi, __rounding, cos_bit);
 2053|  38.9k|  iadst16_stage5_ssse3(x);
 2054|  38.9k|  iadst16_stage6_ssse3(x, cospi, __rounding, cos_bit);
 2055|  38.9k|  iadst16_stage7_ssse3(x);
 2056|  38.9k|  iadst16_stage8_ssse3(x, cospi, __rounding, cos_bit);
 2057|  38.9k|  iadst16_stage9_ssse3(output, x);
 2058|  38.9k|}
av1_inv_txfm_ssse3.c:iadst16_stage3_ssse3:
 1885|   224k|static inline void iadst16_stage3_ssse3(__m128i *x) {
 1886|   224k|  btf_16_adds_subs_sse2(x[0], x[8]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1887|   224k|  btf_16_adds_subs_sse2(x[1], x[9]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1888|   224k|  btf_16_adds_subs_sse2(x[2], x[10]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1889|   224k|  btf_16_adds_subs_sse2(x[3], x[11]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1890|   224k|  btf_16_adds_subs_sse2(x[4], x[12]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1891|   224k|  btf_16_adds_subs_sse2(x[5], x[13]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1892|   224k|  btf_16_adds_subs_sse2(x[6], x[14]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1893|   224k|  btf_16_adds_subs_sse2(x[7], x[15]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1894|   224k|}
av1_inv_txfm_ssse3.c:iadst16_stage4_ssse3:
 1898|   224k|                                        int8_t cos_bit) {
 1899|   224k|  const __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1900|   224k|  const __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1901|   224k|  const __m128i cospi_p40_p24 = pair_set_epi16(cospi[40], cospi[24]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1902|   224k|  const __m128i cospi_p24_m40 = pair_set_epi16(cospi[24], -cospi[40]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1903|   224k|  const __m128i cospi_m56_p08 = pair_set_epi16(-cospi[56], cospi[8]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1904|   224k|  const __m128i cospi_m24_p40 = pair_set_epi16(-cospi[24], cospi[40]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1905|   224k|  btf_16_sse2(cospi_p08_p56, cospi_p56_m08, x[8], x[9], x[8], x[9]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1906|   224k|  btf_16_sse2(cospi_p40_p24, cospi_p24_m40, x[10], x[11], x[10], x[11]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1907|   224k|  btf_16_sse2(cospi_m56_p08, cospi_p08_p56, x[12], x[13], x[12], x[13]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1908|   224k|  btf_16_sse2(cospi_m24_p40, cospi_p40_p24, x[14], x[15], x[14], x[15]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1909|   224k|}
av1_inv_txfm_ssse3.c:iadst16_stage5_ssse3:
 1911|   224k|static inline void iadst16_stage5_ssse3(__m128i *x) {
 1912|   224k|  btf_16_adds_subs_sse2(x[0], x[4]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1913|   224k|  btf_16_adds_subs_sse2(x[1], x[5]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1914|   224k|  btf_16_adds_subs_sse2(x[2], x[6]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1915|   224k|  btf_16_adds_subs_sse2(x[3], x[7]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1916|   224k|  btf_16_adds_subs_sse2(x[8], x[12]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1917|   224k|  btf_16_adds_subs_sse2(x[9], x[13]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1918|   224k|  btf_16_adds_subs_sse2(x[10], x[14]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1919|   224k|  btf_16_adds_subs_sse2(x[11], x[15]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1920|   224k|}
av1_inv_txfm_ssse3.c:iadst16_stage6_ssse3:
 1924|   224k|                                        int8_t cos_bit) {
 1925|   224k|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1926|   224k|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1927|   224k|  const __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|   224k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1928|   224k|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1929|   224k|  btf_16_sse2(cospi_m48_p16, cospi_p16_p48, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1930|   224k|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x[12], x[13], x[12], x[13]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1931|   224k|  btf_16_sse2(cospi_m48_p16, cospi_p16_p48, x[14], x[15], x[14], x[15]);
  ------------------
  |  |   61|   224k|  do {                                            \
  |  |   62|   224k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   224k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   224k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   224k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   224k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   224k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   224k|                                                  \
  |  |   69|   224k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   224k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   224k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   224k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   224k|                                                  \
  |  |   74|   224k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   224k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   224k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   224k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   224k|                                                  \
  |  |   79|   224k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   224k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1932|   224k|}
av1_inv_txfm_ssse3.c:iadst16_stage7_ssse3:
 1934|   224k|static inline void iadst16_stage7_ssse3(__m128i *x) {
 1935|   224k|  btf_16_adds_subs_sse2(x[0], x[2]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1936|   224k|  btf_16_adds_subs_sse2(x[1], x[3]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1937|   224k|  btf_16_adds_subs_sse2(x[4], x[6]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1938|   224k|  btf_16_adds_subs_sse2(x[5], x[7]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1939|   224k|  btf_16_adds_subs_sse2(x[8], x[10]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1940|   224k|  btf_16_adds_subs_sse2(x[9], x[11]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1941|   224k|  btf_16_adds_subs_sse2(x[12], x[14]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1942|   224k|  btf_16_adds_subs_sse2(x[13], x[15]);
  ------------------
  |  |   37|   224k|  do {                                  \
  |  |   38|   224k|    const __m128i _in0 = in0;           \
  |  |   39|   224k|    const __m128i _in1 = in1;           \
  |  |   40|   224k|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|   224k|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1943|   224k|}
av1_inv_txfm_ssse3.c:iadst16_sse2:
 2059|   185k|static void iadst16_sse2(const __m128i *input, __m128i *output) {
 2060|   185k|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|   185k|#define INV_COS_BIT 12
  ------------------
 2061|   185k|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|   185k|#define INV_COS_BIT 12
  ------------------
 2062|   185k|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|   185k|#define INV_COS_BIT 12
  ------------------
 2063|   185k|  const __m128i cospi_p02_p62 = pair_set_epi16(cospi[2], cospi[62]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2064|   185k|  const __m128i cospi_p62_m02 = pair_set_epi16(cospi[62], -cospi[2]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2065|   185k|  const __m128i cospi_p10_p54 = pair_set_epi16(cospi[10], cospi[54]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2066|   185k|  const __m128i cospi_p54_m10 = pair_set_epi16(cospi[54], -cospi[10]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2067|   185k|  const __m128i cospi_p18_p46 = pair_set_epi16(cospi[18], cospi[46]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2068|   185k|  const __m128i cospi_p46_m18 = pair_set_epi16(cospi[46], -cospi[18]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2069|   185k|  const __m128i cospi_p26_p38 = pair_set_epi16(cospi[26], cospi[38]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2070|   185k|  const __m128i cospi_p38_m26 = pair_set_epi16(cospi[38], -cospi[26]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2071|   185k|  const __m128i cospi_p34_p30 = pair_set_epi16(cospi[34], cospi[30]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2072|   185k|  const __m128i cospi_p30_m34 = pair_set_epi16(cospi[30], -cospi[34]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2073|   185k|  const __m128i cospi_p42_p22 = pair_set_epi16(cospi[42], cospi[22]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2074|   185k|  const __m128i cospi_p22_m42 = pair_set_epi16(cospi[22], -cospi[42]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2075|   185k|  const __m128i cospi_p50_p14 = pair_set_epi16(cospi[50], cospi[14]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2076|   185k|  const __m128i cospi_p14_m50 = pair_set_epi16(cospi[14], -cospi[50]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2077|   185k|  const __m128i cospi_p58_p06 = pair_set_epi16(cospi[58], cospi[6]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2078|   185k|  const __m128i cospi_p06_m58 = pair_set_epi16(cospi[6], -cospi[58]);
  ------------------
  |  |   20|   185k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2079|       |
 2080|       |  // stage 1
 2081|   185k|  __m128i x[16];
 2082|   185k|  x[0] = input[15];
 2083|   185k|  x[1] = input[0];
 2084|   185k|  x[2] = input[13];
 2085|   185k|  x[3] = input[2];
 2086|   185k|  x[4] = input[11];
 2087|   185k|  x[5] = input[4];
 2088|   185k|  x[6] = input[9];
 2089|   185k|  x[7] = input[6];
 2090|   185k|  x[8] = input[7];
 2091|   185k|  x[9] = input[8];
 2092|   185k|  x[10] = input[5];
 2093|   185k|  x[11] = input[10];
 2094|   185k|  x[12] = input[3];
 2095|   185k|  x[13] = input[12];
 2096|   185k|  x[14] = input[1];
 2097|   185k|  x[15] = input[14];
 2098|       |
 2099|       |  // stage 2
 2100|   185k|  btf_16_sse2(cospi_p02_p62, cospi_p62_m02, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2101|   185k|  btf_16_sse2(cospi_p10_p54, cospi_p54_m10, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2102|   185k|  btf_16_sse2(cospi_p18_p46, cospi_p46_m18, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2103|   185k|  btf_16_sse2(cospi_p26_p38, cospi_p38_m26, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2104|   185k|  btf_16_sse2(cospi_p34_p30, cospi_p30_m34, x[8], x[9], x[8], x[9]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2105|   185k|  btf_16_sse2(cospi_p42_p22, cospi_p22_m42, x[10], x[11], x[10], x[11]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2106|   185k|  btf_16_sse2(cospi_p50_p14, cospi_p14_m50, x[12], x[13], x[12], x[13]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2107|   185k|  btf_16_sse2(cospi_p58_p06, cospi_p06_m58, x[14], x[15], x[14], x[15]);
  ------------------
  |  |   61|   185k|  do {                                            \
  |  |   62|   185k|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|   185k|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|   185k|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|   185k|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|   185k|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|   185k|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|   185k|                                                  \
  |  |   69|   185k|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|   185k|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|   185k|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|   185k|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|   185k|                                                  \
  |  |   74|   185k|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|   185k|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|   185k|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|   185k|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|   185k|                                                  \
  |  |   79|   185k|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|   185k|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|   185k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 185k]
  |  |  ------------------
  ------------------
 2108|       |
 2109|       |  // stage 3~9
 2110|   185k|  iadst16_stage3_ssse3(x);
 2111|   185k|  iadst16_stage4_ssse3(x, cospi, __rounding, cos_bit);
 2112|   185k|  iadst16_stage5_ssse3(x);
 2113|   185k|  iadst16_stage6_ssse3(x, cospi, __rounding, cos_bit);
 2114|   185k|  iadst16_stage7_ssse3(x);
 2115|   185k|  iadst16_stage8_ssse3(x, cospi, __rounding, cos_bit);
 2116|   185k|  iadst16_stage9_ssse3(output, x);
 2117|   185k|}
av1_inv_txfm_ssse3.c:lowbd_get_recon_8x8_sse2:
 2238|  13.7M|                                               __m128i res) {
 2239|  13.7M|  const __m128i zero = _mm_setzero_si128();
 2240|  13.7M|  __m128i x0 = _mm_adds_epi16(res, _mm_unpacklo_epi8(pred, zero));
 2241|  13.7M|  return _mm_packus_epi16(x0, x0);
 2242|  13.7M|}
av1_inv_txfm_ssse3.c:round_shift_ssse3:
 2469|  6.29M|                                     int size) {
 2470|  6.29M|  const __m128i scale = _mm_set1_epi16(NewInvSqrt2 * 8);
 2471|  40.3M|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (2471:19): [True: 34.0M, False: 6.29M]
  ------------------
 2472|  34.0M|    output[i] = _mm_mulhrs_epi16(input[i], scale);
 2473|  34.0M|  }
 2474|  6.29M|}
av1_inv_txfm_ssse3.c:lowbd_inv_txfm2d_add_4x4_ssse3:
 2414|  27.7M|                                           int eob) {
 2415|  27.7M|  (void)tx_size_;
 2416|  27.7M|  (void)eob;
 2417|  27.7M|  __m128i buf[4];
 2418|  27.7M|  const TX_SIZE tx_size = TX_4X4;
 2419|  27.7M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2420|  27.7M|  const int txw_idx = get_txw_idx(tx_size);
 2421|  27.7M|  const int txh_idx = get_txh_idx(tx_size);
 2422|  27.7M|  const int txfm_size_col = tx_size_wide[tx_size];
 2423|  27.7M|  const int txfm_size_row = tx_size_high[tx_size];
 2424|       |
 2425|  27.7M|  const transform_1d_ssse3 row_txfm =
 2426|  27.7M|      lowbd_txfm_all_1d_w4_arr[txw_idx][hitx_1d_tab[tx_type]];
 2427|  27.7M|  const transform_1d_ssse3 col_txfm =
 2428|  27.7M|      lowbd_txfm_all_1d_w4_arr[txh_idx][vitx_1d_tab[tx_type]];
 2429|       |
 2430|  27.7M|  int ud_flip, lr_flip;
 2431|  27.7M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2432|  27.7M|  load_buffer_32bit_to_16bit_w4(input, txfm_size_row, buf, txfm_size_col);
 2433|  27.7M|  row_txfm(buf, buf);
 2434|  27.7M|  if (lr_flip) {
  ------------------
  |  Branch (2434:7): [True: 34.9k, False: 27.7M]
  ------------------
 2435|  34.9k|    __m128i temp[4];
 2436|  34.9k|    flip_buf_sse2(buf, temp, txfm_size_col);
 2437|  34.9k|    transpose_16bit_4x4(temp, buf);
 2438|  27.7M|  } else {
 2439|  27.7M|    transpose_16bit_4x4(buf, buf);
 2440|  27.7M|  }
 2441|  27.7M|  col_txfm(buf, buf);
 2442|  27.7M|  round_shift_16bit_ssse3(buf, txfm_size_row, shift[1]);
 2443|  27.7M|  lowbd_write_buffer_4xn_sse2(buf, output, stride, ud_flip, txfm_size_row);
 2444|  27.7M|}
av1_inv_txfm_ssse3.c:idct4_w4_sse2:
   55|  32.9M|static void idct4_w4_sse2(const __m128i *input, __m128i *output) {
   56|  32.9M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  32.9M|#define INV_COS_BIT 12
  ------------------
   57|  32.9M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  32.9M|#define INV_COS_BIT 12
  ------------------
   58|  32.9M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  32.9M|#define INV_COS_BIT 12
  ------------------
   59|       |
   60|  32.9M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  32.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   61|  32.9M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  32.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   62|  32.9M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  32.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   63|  32.9M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  32.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   64|       |
   65|       |  // stage 1
   66|  32.9M|  __m128i x[4];
   67|  32.9M|  x[0] = input[0];
   68|  32.9M|  x[1] = input[2];
   69|  32.9M|  x[2] = input[1];
   70|  32.9M|  x[3] = input[3];
   71|       |
   72|       |  // stage 2
   73|  32.9M|  btf_16_4p_sse2(cospi_p32_p32, cospi_p32_m32, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   45|  32.9M|  do {                                               \
  |  |   46|  32.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  32.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  32.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  32.9M|                                                     \
  |  |   50|  32.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  32.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  32.9M|                                                     \
  |  |   53|  32.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  32.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  32.9M|                                                     \
  |  |   56|  32.9M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  32.9M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  32.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 32.9M]
  |  |  ------------------
  ------------------
   74|  32.9M|  btf_16_4p_sse2(cospi_p48_m16, cospi_p16_p48, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   45|  32.9M|  do {                                               \
  |  |   46|  32.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  32.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  32.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  32.9M|                                                     \
  |  |   50|  32.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  32.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  32.9M|                                                     \
  |  |   53|  32.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  32.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  32.9M|                                                     \
  |  |   56|  32.9M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  32.9M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  32.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 32.9M]
  |  |  ------------------
  ------------------
   75|       |
   76|       |  // stage 3
   77|  32.9M|  btf_16_adds_subs_out_sse2(output[0], output[3], x[0], x[3]);
  ------------------
  |  |   53|  32.9M|  do {                                                  \
  |  |   54|  32.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  32.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  32.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  32.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  32.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 32.9M]
  |  |  ------------------
  ------------------
   78|  32.9M|  btf_16_adds_subs_out_sse2(output[1], output[2], x[1], x[2]);
  ------------------
  |  |   53|  32.9M|  do {                                                  \
  |  |   54|  32.9M|    const __m128i _in0 = in0;                           \
  |  |   55|  32.9M|    const __m128i _in1 = in1;                           \
  |  |   56|  32.9M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  32.9M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  32.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 32.9M]
  |  |  ------------------
  ------------------
   79|  32.9M|}
av1_inv_txfm_ssse3.c:iadst4_w4_sse2:
 1659|  20.6M|static void iadst4_w4_sse2(const __m128i *input, __m128i *output) {
 1660|  20.6M|  const int32_t *sinpi = sinpi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  20.6M|#define INV_COS_BIT 12
  ------------------
 1661|  20.6M|  const __m128i sinpi_p01_p04 = pair_set_epi16(sinpi[1], sinpi[4]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1662|  20.6M|  const __m128i sinpi_p02_m01 = pair_set_epi16(sinpi[2], -sinpi[1]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1663|  20.6M|  const __m128i sinpi_p03_p02 = pair_set_epi16(sinpi[3], sinpi[2]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1664|  20.6M|  const __m128i sinpi_p03_m04 = pair_set_epi16(sinpi[3], -sinpi[4]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1665|  20.6M|  const __m128i sinpi_p03_m03 = pair_set_epi16(sinpi[3], -sinpi[3]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1666|  20.6M|  const __m128i sinpi_0_p03 = pair_set_epi16(0, sinpi[3]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1667|  20.6M|  const __m128i sinpi_p04_p02 = pair_set_epi16(sinpi[4], sinpi[2]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1668|  20.6M|  const __m128i sinpi_m03_m01 = pair_set_epi16(-sinpi[3], -sinpi[1]);
  ------------------
  |  |   20|  20.6M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1669|  20.6M|  __m128i x0[4];
 1670|  20.6M|  x0[0] = input[0];
 1671|  20.6M|  x0[1] = input[1];
 1672|  20.6M|  x0[2] = input[2];
 1673|  20.6M|  x0[3] = input[3];
 1674|       |
 1675|  20.6M|  __m128i u[2];
 1676|  20.6M|  u[0] = _mm_unpacklo_epi16(x0[0], x0[2]);
 1677|  20.6M|  u[1] = _mm_unpacklo_epi16(x0[1], x0[3]);
 1678|       |
 1679|  20.6M|  __m128i x1[8];
 1680|  20.6M|  x1[0] = _mm_madd_epi16(u[0], sinpi_p01_p04);  // x0*sin1 + x2*sin4
 1681|  20.6M|  x1[1] = _mm_madd_epi16(u[0], sinpi_p02_m01);  // x0*sin2 - x2*sin1
 1682|  20.6M|  x1[2] = _mm_madd_epi16(u[1], sinpi_p03_p02);  // x1*sin3 + x3*sin2
 1683|  20.6M|  x1[3] = _mm_madd_epi16(u[1], sinpi_p03_m04);  // x1*sin3 - x3*sin4
 1684|  20.6M|  x1[4] = _mm_madd_epi16(u[0], sinpi_p03_m03);  // x0*sin3 - x2*sin3
 1685|  20.6M|  x1[5] = _mm_madd_epi16(u[1], sinpi_0_p03);    // x2*sin3
 1686|  20.6M|  x1[6] = _mm_madd_epi16(u[0], sinpi_p04_p02);  // x0*sin4 + x2*sin2
 1687|  20.6M|  x1[7] = _mm_madd_epi16(u[1], sinpi_m03_m01);  // -x1*sin3 - x3*sin1
 1688|       |
 1689|  20.6M|  __m128i x2[4];
 1690|  20.6M|  x2[0] = _mm_add_epi32(x1[0], x1[2]);  // x0*sin1 + x2*sin4 + x1*sin3 + x3*sin2
 1691|  20.6M|  x2[1] = _mm_add_epi32(x1[1], x1[3]);  // x0*sin2 - x2*sin1 + x1*sin3 - x3*sin4
 1692|  20.6M|  x2[2] = _mm_add_epi32(x1[4], x1[5]);  // x0*sin3 - x2*sin3 + x3*sin3
 1693|  20.6M|  x2[3] = _mm_add_epi32(x1[6], x1[7]);  // x0*sin4 + x2*sin2 - x1*sin3 - x3*sin1
 1694|       |
 1695|  20.6M|  const __m128i rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  20.6M|#define INV_COS_BIT 12
  ------------------
 1696|   103M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1696:19): [True: 82.6M, False: 20.6M]
  ------------------
 1697|  82.6M|    __m128i out0 = _mm_add_epi32(x2[i], rounding);
 1698|  82.6M|    out0 = _mm_srai_epi32(out0, INV_COS_BIT);
  ------------------
  |  |   43|  82.6M|#define INV_COS_BIT 12
  ------------------
 1699|  82.6M|    output[i] = _mm_packs_epi32(out0, out0);
 1700|  82.6M|  }
 1701|  20.6M|}
av1_inv_txfm_ssse3.c:idct8_w4_sse2:
  152|  3.58M|static void idct8_w4_sse2(const __m128i *input, __m128i *output) {
  153|  3.58M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  3.58M|#define INV_COS_BIT 12
  ------------------
  154|  3.58M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  3.58M|#define INV_COS_BIT 12
  ------------------
  155|  3.58M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  3.58M|#define INV_COS_BIT 12
  ------------------
  156|       |
  157|  3.58M|  const __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  158|  3.58M|  const __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  159|  3.58M|  const __m128i cospi_p24_m40 = pair_set_epi16(cospi[24], -cospi[40]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  160|  3.58M|  const __m128i cospi_p40_p24 = pair_set_epi16(cospi[40], cospi[24]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  161|  3.58M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  162|  3.58M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  163|  3.58M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  164|  3.58M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  165|  3.58M|  const __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|  3.58M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  166|       |
  167|       |  // stage 1
  168|  3.58M|  __m128i x[8];
  169|  3.58M|  x[0] = input[0];
  170|  3.58M|  x[1] = input[4];
  171|  3.58M|  x[2] = input[2];
  172|  3.58M|  x[3] = input[6];
  173|  3.58M|  x[4] = input[1];
  174|  3.58M|  x[5] = input[5];
  175|  3.58M|  x[6] = input[3];
  176|  3.58M|  x[7] = input[7];
  177|       |
  178|       |  // stage 2
  179|  3.58M|  btf_16_4p_sse2(cospi_p56_m08, cospi_p08_p56, x[4], x[7], x[4], x[7]);
  ------------------
  |  |   45|  3.58M|  do {                                               \
  |  |   46|  3.58M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  3.58M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  3.58M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  3.58M|                                                     \
  |  |   50|  3.58M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  3.58M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  3.58M|                                                     \
  |  |   53|  3.58M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  3.58M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  3.58M|                                                     \
  |  |   56|  3.58M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  3.58M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  180|  3.58M|  btf_16_4p_sse2(cospi_p24_m40, cospi_p40_p24, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   45|  3.58M|  do {                                               \
  |  |   46|  3.58M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  3.58M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  3.58M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  3.58M|                                                     \
  |  |   50|  3.58M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  3.58M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  3.58M|                                                     \
  |  |   53|  3.58M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  3.58M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  3.58M|                                                     \
  |  |   56|  3.58M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  3.58M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  181|       |
  182|       |  // stage 3
  183|  3.58M|  btf_16_4p_sse2(cospi_p32_p32, cospi_p32_m32, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   45|  3.58M|  do {                                               \
  |  |   46|  3.58M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  3.58M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  3.58M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  3.58M|                                                     \
  |  |   50|  3.58M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  3.58M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  3.58M|                                                     \
  |  |   53|  3.58M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  3.58M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  3.58M|                                                     \
  |  |   56|  3.58M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  3.58M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  184|  3.58M|  btf_16_4p_sse2(cospi_p48_m16, cospi_p16_p48, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   45|  3.58M|  do {                                               \
  |  |   46|  3.58M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  3.58M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  3.58M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  3.58M|                                                     \
  |  |   50|  3.58M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  3.58M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  3.58M|                                                     \
  |  |   53|  3.58M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  3.58M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  3.58M|                                                     \
  |  |   56|  3.58M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  3.58M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  185|  3.58M|  btf_16_adds_subs_sse2(x[4], x[5]);
  ------------------
  |  |   37|  3.58M|  do {                                  \
  |  |   38|  3.58M|    const __m128i _in0 = in0;           \
  |  |   39|  3.58M|    const __m128i _in1 = in1;           \
  |  |   40|  3.58M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  3.58M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  186|  3.58M|  btf_16_subs_adds_sse2(x[7], x[6]);
  ------------------
  |  |   45|  3.58M|  do {                                  \
  |  |   46|  3.58M|    const __m128i _in0 = in0;           \
  |  |   47|  3.58M|    const __m128i _in1 = in1;           \
  |  |   48|  3.58M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   49|  3.58M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   50|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (50:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  187|       |
  188|       |  // stage 4
  189|  3.58M|  btf_16_adds_subs_sse2(x[0], x[3]);
  ------------------
  |  |   37|  3.58M|  do {                                  \
  |  |   38|  3.58M|    const __m128i _in0 = in0;           \
  |  |   39|  3.58M|    const __m128i _in1 = in1;           \
  |  |   40|  3.58M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  3.58M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  190|  3.58M|  btf_16_adds_subs_sse2(x[1], x[2]);
  ------------------
  |  |   37|  3.58M|  do {                                  \
  |  |   38|  3.58M|    const __m128i _in0 = in0;           \
  |  |   39|  3.58M|    const __m128i _in1 = in1;           \
  |  |   40|  3.58M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  3.58M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  191|  3.58M|  btf_16_4p_sse2(cospi_m32_p32, cospi_p32_p32, x[5], x[6], x[5], x[6]);
  ------------------
  |  |   45|  3.58M|  do {                                               \
  |  |   46|  3.58M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  3.58M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  3.58M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  3.58M|                                                     \
  |  |   50|  3.58M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  3.58M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  3.58M|                                                     \
  |  |   53|  3.58M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  3.58M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  3.58M|                                                     \
  |  |   56|  3.58M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  3.58M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  192|       |
  193|       |  // stage 5
  194|  3.58M|  btf_16_adds_subs_out_sse2(output[0], output[7], x[0], x[7]);
  ------------------
  |  |   53|  3.58M|  do {                                                  \
  |  |   54|  3.58M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.58M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.58M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.58M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  195|  3.58M|  btf_16_adds_subs_out_sse2(output[1], output[6], x[1], x[6]);
  ------------------
  |  |   53|  3.58M|  do {                                                  \
  |  |   54|  3.58M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.58M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.58M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.58M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  196|  3.58M|  btf_16_adds_subs_out_sse2(output[2], output[5], x[2], x[5]);
  ------------------
  |  |   53|  3.58M|  do {                                                  \
  |  |   54|  3.58M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.58M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.58M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.58M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  197|  3.58M|  btf_16_adds_subs_out_sse2(output[3], output[4], x[3], x[4]);
  ------------------
  |  |   53|  3.58M|  do {                                                  \
  |  |   54|  3.58M|    const __m128i _in0 = in0;                           \
  |  |   55|  3.58M|    const __m128i _in1 = in1;                           \
  |  |   56|  3.58M|    out0 = _mm_adds_epi16(_in0, _in1);                  \
  |  |   57|  3.58M|    out1 = _mm_subs_epi16(_in0, _in1);                  \
  |  |   58|  3.58M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 3.58M]
  |  |  ------------------
  ------------------
  198|  3.58M|}
av1_inv_txfm_ssse3.c:iadst8_w4_sse2:
 1817|  1.32M|static void iadst8_w4_sse2(const __m128i *input, __m128i *output) {
 1818|  1.32M|  const int8_t cos_bit = INV_COS_BIT;
  ------------------
  |  |   43|  1.32M|#define INV_COS_BIT 12
  ------------------
 1819|  1.32M|  const int32_t *cospi = cospi_arr(INV_COS_BIT);
  ------------------
  |  |   43|  1.32M|#define INV_COS_BIT 12
  ------------------
 1820|  1.32M|  const __m128i __zero = _mm_setzero_si128();
 1821|  1.32M|  const __m128i __rounding = _mm_set1_epi32(1 << (INV_COS_BIT - 1));
  ------------------
  |  |   43|  1.32M|#define INV_COS_BIT 12
  ------------------
 1822|       |
 1823|  1.32M|  const __m128i cospi_p04_p60 = pair_set_epi16(cospi[4], cospi[60]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1824|  1.32M|  const __m128i cospi_p60_m04 = pair_set_epi16(cospi[60], -cospi[4]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1825|  1.32M|  const __m128i cospi_p20_p44 = pair_set_epi16(cospi[20], cospi[44]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1826|  1.32M|  const __m128i cospi_p44_m20 = pair_set_epi16(cospi[44], -cospi[20]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1827|  1.32M|  const __m128i cospi_p36_p28 = pair_set_epi16(cospi[36], cospi[28]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1828|  1.32M|  const __m128i cospi_p28_m36 = pair_set_epi16(cospi[28], -cospi[36]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1829|  1.32M|  const __m128i cospi_p52_p12 = pair_set_epi16(cospi[52], cospi[12]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1830|  1.32M|  const __m128i cospi_p12_m52 = pair_set_epi16(cospi[12], -cospi[52]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1831|  1.32M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1832|  1.32M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1833|  1.32M|  const __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1834|  1.32M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1835|  1.32M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  1.32M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1836|       |
 1837|       |  // stage 1
 1838|  1.32M|  __m128i x[8];
 1839|  1.32M|  x[0] = input[7];
 1840|  1.32M|  x[1] = input[0];
 1841|  1.32M|  x[2] = input[5];
 1842|  1.32M|  x[3] = input[2];
 1843|  1.32M|  x[4] = input[3];
 1844|  1.32M|  x[5] = input[4];
 1845|  1.32M|  x[6] = input[1];
 1846|  1.32M|  x[7] = input[6];
 1847|       |
 1848|       |  // stage 2
 1849|  1.32M|  btf_16_4p_sse2(cospi_p04_p60, cospi_p60_m04, x[0], x[1], x[0], x[1]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1850|  1.32M|  btf_16_4p_sse2(cospi_p20_p44, cospi_p44_m20, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1851|  1.32M|  btf_16_4p_sse2(cospi_p36_p28, cospi_p28_m36, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1852|  1.32M|  btf_16_4p_sse2(cospi_p52_p12, cospi_p12_m52, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1853|       |
 1854|       |  // stage 3
 1855|  1.32M|  btf_16_adds_subs_sse2(x[0], x[4]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1856|  1.32M|  btf_16_adds_subs_sse2(x[1], x[5]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1857|  1.32M|  btf_16_adds_subs_sse2(x[2], x[6]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1858|  1.32M|  btf_16_adds_subs_sse2(x[3], x[7]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1859|       |
 1860|       |  // stage 4
 1861|  1.32M|  btf_16_4p_sse2(cospi_p16_p48, cospi_p48_m16, x[4], x[5], x[4], x[5]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1862|  1.32M|  btf_16_4p_sse2(cospi_m48_p16, cospi_p16_p48, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1863|       |
 1864|       |  // stage 5
 1865|  1.32M|  btf_16_adds_subs_sse2(x[0], x[2]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1866|  1.32M|  btf_16_adds_subs_sse2(x[1], x[3]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1867|  1.32M|  btf_16_adds_subs_sse2(x[4], x[6]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1868|  1.32M|  btf_16_adds_subs_sse2(x[5], x[7]);
  ------------------
  |  |   37|  1.32M|  do {                                  \
  |  |   38|  1.32M|    const __m128i _in0 = in0;           \
  |  |   39|  1.32M|    const __m128i _in1 = in1;           \
  |  |   40|  1.32M|    in0 = _mm_adds_epi16(_in0, _in1);   \
  |  |   41|  1.32M|    in1 = _mm_subs_epi16(_in0, _in1);   \
  |  |   42|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (42:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1869|       |
 1870|       |  // stage 6
 1871|  1.32M|  btf_16_4p_sse2(cospi_p32_p32, cospi_p32_m32, x[2], x[3], x[2], x[3]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1872|  1.32M|  btf_16_4p_sse2(cospi_p32_p32, cospi_p32_m32, x[6], x[7], x[6], x[7]);
  ------------------
  |  |   45|  1.32M|  do {                                               \
  |  |   46|  1.32M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);       \
  |  |   47|  1.32M|    __m128i u0 = _mm_madd_epi16(t0, w0);             \
  |  |   48|  1.32M|    __m128i v0 = _mm_madd_epi16(t0, w1);             \
  |  |   49|  1.32M|                                                     \
  |  |   50|  1.32M|    __m128i a0 = _mm_add_epi32(u0, __rounding);      \
  |  |   51|  1.32M|    __m128i b0 = _mm_add_epi32(v0, __rounding);      \
  |  |   52|  1.32M|                                                     \
  |  |   53|  1.32M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);        \
  |  |   54|  1.32M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);        \
  |  |   55|  1.32M|                                                     \
  |  |   56|  1.32M|    out0 = _mm_packs_epi32(c0, c0);                  \
  |  |   57|  1.32M|    out1 = _mm_packs_epi32(d0, d0);                  \
  |  |   58|  1.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 1.32M]
  |  |  ------------------
  ------------------
 1873|       |
 1874|       |  // stage 7
 1875|  1.32M|  output[0] = x[0];
 1876|  1.32M|  output[1] = _mm_subs_epi16(__zero, x[4]);
 1877|  1.32M|  output[2] = x[6];
 1878|  1.32M|  output[3] = _mm_subs_epi16(__zero, x[2]);
 1879|  1.32M|  output[4] = x[3];
 1880|  1.32M|  output[5] = _mm_subs_epi16(__zero, x[7]);
 1881|  1.32M|  output[6] = x[5];
 1882|  1.32M|  output[7] = _mm_subs_epi16(__zero, x[1]);
 1883|  1.32M|}
av1_inv_txfm_ssse3.c:lowbd_write_buffer_4xn_sse2:
 2246|  32.4M|                                               const int height) {
 2247|  32.4M|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (2247:11): [True: 31.4k, False: 32.4M]
  ------------------
 2248|  32.4M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (2248:20): [True: 31.2k, False: 32.4M]
  ------------------
 2249|  32.4M|  const __m128i zero = _mm_setzero_si128();
 2250|   181M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (2250:19): [True: 148M, False: 32.4M]
  ------------------
 2251|   148M|    const __m128i v = _mm_cvtsi32_si128(*((int *)(output + i * stride)));
 2252|   148M|    __m128i u = _mm_adds_epi16(in[j], _mm_unpacklo_epi8(v, zero));
 2253|   148M|    u = _mm_packus_epi16(u, zero);
 2254|   148M|    *((int *)(output + i * stride)) = _mm_cvtsi128_si32(u);
 2255|   148M|  }
 2256|  32.4M|}
av1_inv_txfm_ssse3.c:lowbd_inv_txfm2d_add_4x8_ssse3:
 2680|  4.73M|                                           int eob) {
 2681|  4.73M|  (void)tx_size_;
 2682|  4.73M|  (void)eob;
 2683|  4.73M|  __m128i buf[8];
 2684|  4.73M|  const TX_SIZE tx_size = TX_4X8;
 2685|  4.73M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2686|  4.73M|  const int txw_idx = get_txw_idx(tx_size);
 2687|  4.73M|  const int txh_idx = get_txh_idx(tx_size);
 2688|  4.73M|  const int txfm_size_col = tx_size_wide[tx_size];
 2689|  4.73M|  const int txfm_size_row = tx_size_high[tx_size];
 2690|       |
 2691|  4.73M|  const transform_1d_ssse3 row_txfm =
 2692|  4.73M|      lowbd_txfm_all_1d_w8_arr[txw_idx][hitx_1d_tab[tx_type]];
 2693|  4.73M|  const transform_1d_ssse3 col_txfm =
 2694|  4.73M|      lowbd_txfm_all_1d_w4_arr[txh_idx][vitx_1d_tab[tx_type]];
 2695|       |
 2696|  4.73M|  int ud_flip, lr_flip;
 2697|  4.73M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2698|  4.73M|  load_buffer_32bit_to_16bit(input, txfm_size_row, buf, txfm_size_col);
 2699|  4.73M|  round_shift_ssse3(buf, buf, txfm_size_col);  // rect special code
 2700|  4.73M|  row_txfm(buf, buf);
 2701|       |  // round_shift_16bit_ssse3(buf, txfm_size_col, shift[0]);// shift[0] is 0
 2702|  4.73M|  if (lr_flip) {
  ------------------
  |  Branch (2702:7): [True: 15.4k, False: 4.71M]
  ------------------
 2703|  15.4k|    __m128i temp[4];
 2704|  15.4k|    flip_buf_sse2(buf, temp, txfm_size_col);
 2705|  15.4k|    transpose_16bit_8x4(temp, buf);
 2706|  4.71M|  } else {
 2707|  4.71M|    transpose_16bit_8x4(buf, buf);
 2708|  4.71M|  }
 2709|  4.73M|  col_txfm(buf, buf);
 2710|  4.73M|  round_shift_16bit_ssse3(buf, txfm_size_row, shift[1]);
 2711|  4.73M|  lowbd_write_buffer_4xn_sse2(buf, output, stride, ud_flip, txfm_size_row);
 2712|  4.73M|}
av1_inv_txfm_ssse3.c:lowbd_inv_txfm2d_add_8x4_ssse3:
 2717|   204k|                                           int eob) {
 2718|   204k|  (void)tx_size_;
 2719|   204k|  (void)eob;
 2720|   204k|  __m128i buf[8];
 2721|   204k|  const TX_SIZE tx_size = TX_8X4;
 2722|   204k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2723|   204k|  const int txw_idx = get_txw_idx(tx_size);
 2724|   204k|  const int txh_idx = get_txh_idx(tx_size);
 2725|   204k|  const int txfm_size_col = tx_size_wide[tx_size];
 2726|   204k|  const int txfm_size_row = tx_size_high[tx_size];
 2727|       |
 2728|   204k|  const transform_1d_ssse3 row_txfm =
 2729|   204k|      lowbd_txfm_all_1d_w4_arr[txw_idx][hitx_1d_tab[tx_type]];
 2730|   204k|  const transform_1d_ssse3 col_txfm =
 2731|   204k|      lowbd_txfm_all_1d_w8_arr[txh_idx][vitx_1d_tab[tx_type]];
 2732|       |
 2733|   204k|  int ud_flip, lr_flip;
 2734|   204k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2735|   204k|  load_buffer_32bit_to_16bit_w4(input, txfm_size_row, buf, txfm_size_col);
 2736|   204k|  round_shift_ssse3(buf, buf, txfm_size_col);  // rect special code
 2737|   204k|  row_txfm(buf, buf);
 2738|       |  // round_shift_16bit_ssse3(buf, txfm_size_col, shift[0]); // shift[0] is 0
 2739|   204k|  if (lr_flip) {
  ------------------
  |  Branch (2739:7): [True: 0, False: 204k]
  ------------------
 2740|      0|    __m128i temp[8];
 2741|      0|    flip_buf_sse2(buf, temp, txfm_size_col);
 2742|      0|    transpose_16bit_4x8(temp, buf);
 2743|   204k|  } else {
 2744|   204k|    transpose_16bit_4x8(buf, buf);
 2745|   204k|  }
 2746|   204k|  col_txfm(buf, buf);
 2747|   204k|  round_shift_16bit_ssse3(buf, txfm_size_row, shift[1]);
 2748|   204k|  lowbd_write_buffer_8xn_sse2(buf, output, stride, ud_flip, txfm_size_row);
 2749|   204k|}
av1_inv_txfm_ssse3.c:lowbd_write_buffer_8xn_sse2:
 2260|   774k|                                               const int height) {
 2261|   774k|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (2261:11): [True: 1.10k, False: 773k]
  ------------------
 2262|   774k|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (2262:20): [True: 1.10k, False: 773k]
  ------------------
 2263|  10.7M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (2263:19): [True: 9.93M, False: 774k]
  ------------------
 2264|  9.93M|    const __m128i v = _mm_loadl_epi64((__m128i const *)(output + i * stride));
 2265|  9.93M|    const __m128i u = lowbd_get_recon_8x8_sse2(v, in[j]);
 2266|  9.93M|    _mm_storel_epi64((__m128i *)(output + i * stride), u);
 2267|  9.93M|  }
 2268|   774k|}
av1_inv_txfm_ssse3.c:lowbd_inv_txfm2d_add_universe_ssse3:
 2649|   990k|    TX_SIZE tx_size, int eob) {
 2650|   990k|  switch (tx_type) {
 2651|   592k|    case DCT_DCT:
  ------------------
  |  Branch (2651:5): [True: 592k, False: 397k]
  ------------------
 2652|   592k|      lowbd_inv_txfm2d_add_no_identity_ssse3(input, output, stride, tx_type,
 2653|   592k|                                             tx_size, eob);
 2654|   592k|      break;
 2655|     54|    case IDTX:
  ------------------
  |  Branch (2655:5): [True: 54, False: 989k]
  ------------------
 2656|     54|      av1_lowbd_inv_txfm2d_add_idtx_ssse3(input, output, stride, tx_size);
 2657|     54|      break;
 2658|  17.6k|    case V_DCT:
  ------------------
  |  Branch (2658:5): [True: 17.6k, False: 972k]
  ------------------
 2659|  17.6k|    case V_ADST:
  ------------------
  |  Branch (2659:5): [True: 37, False: 989k]
  ------------------
 2660|  17.7k|    case V_FLIPADST:
  ------------------
  |  Branch (2660:5): [True: 63, False: 989k]
  ------------------
 2661|  17.7k|      av1_lowbd_inv_txfm2d_add_h_identity_ssse3(input, output, stride, tx_type,
 2662|  17.7k|                                                tx_size, eob);
 2663|  17.7k|      break;
 2664|  33.9k|    case H_DCT:
  ------------------
  |  Branch (2664:5): [True: 33.9k, False: 956k]
  ------------------
 2665|  34.5k|    case H_ADST:
  ------------------
  |  Branch (2665:5): [True: 547, False: 989k]
  ------------------
 2666|  34.7k|    case H_FLIPADST:
  ------------------
  |  Branch (2666:5): [True: 218, False: 989k]
  ------------------
 2667|  34.7k|      av1_lowbd_inv_txfm2d_add_v_identity_ssse3(input, output, stride, tx_type,
 2668|  34.7k|                                                tx_size, eob);
 2669|  34.7k|      break;
 2670|   345k|    default:
  ------------------
  |  Branch (2670:5): [True: 345k, False: 644k]
  ------------------
 2671|   345k|      lowbd_inv_txfm2d_add_no_identity_ssse3(input, output, stride, tx_type,
 2672|   345k|                                             tx_size, eob);
 2673|   345k|      break;
 2674|   990k|  }
 2675|   990k|}
av1_inv_txfm_ssse3.c:lowbd_inv_txfm2d_add_no_identity_ssse3:
 2478|   937k|    TX_SIZE tx_size, int eob) {
 2479|   937k|  __m128i buf1[64 * 8];
 2480|   937k|  int eobx, eoby;
 2481|   937k|  get_eobx_eoby_scan_default(&eobx, &eoby, tx_size, eob);
 2482|   937k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 2483|   937k|  const int txw_idx = get_txw_idx(tx_size);
 2484|   937k|  const int txh_idx = get_txh_idx(tx_size);
 2485|   937k|  const int txfm_size_col = tx_size_wide[tx_size];
 2486|   937k|  const int txfm_size_row = tx_size_high[tx_size];
 2487|   937k|  const int buf_size_w_div8 = txfm_size_col >> 3;
 2488|   937k|  const int buf_size_nonzero_w = ((eobx + 8) >> 3) << 3;
 2489|   937k|  const int buf_size_nonzero_h_div8 = (eoby + 8) >> 3;
 2490|   937k|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|   937k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 937k]
  |  |  ------------------
  ------------------
 2491|   937k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 2492|       |
 2493|   937k|  const int fun_idx_x = lowbd_txfm_all_1d_zeros_idx[eobx];
 2494|   937k|  const int fun_idx_y = lowbd_txfm_all_1d_zeros_idx[eoby];
 2495|   937k|  const transform_1d_ssse3 row_txfm =
 2496|   937k|      lowbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx_x];
 2497|   937k|  const transform_1d_ssse3 col_txfm =
 2498|   937k|      lowbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx_y];
 2499|       |
 2500|   937k|  assert(col_txfm != NULL);
 2501|   937k|  assert(row_txfm != NULL);
 2502|   937k|  int ud_flip, lr_flip;
 2503|   937k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2504|  2.24M|  for (int i = 0; i < buf_size_nonzero_h_div8; i++) {
  ------------------
  |  Branch (2504:19): [True: 1.30M, False: 937k]
  ------------------
 2505|  1.30M|    __m128i buf0[64];
 2506|  1.30M|    load_buffer_32bit_to_16bit(input + 8 * i, input_stride, buf0,
 2507|  1.30M|                               buf_size_nonzero_w);
 2508|  1.30M|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (2508:9): [True: 367k, False: 940k]
  |  Branch (2508:27): [True: 940k, False: 0]
  ------------------
 2509|  1.30M|      round_shift_ssse3(buf0, buf0, buf_size_nonzero_w);  // rect special code
 2510|  1.30M|    }
 2511|  1.30M|    row_txfm(buf0, buf0);
 2512|  1.30M|    round_shift_16bit_ssse3(buf0, txfm_size_col, shift[0]);
 2513|  1.30M|    __m128i *_buf1 = buf1 + i * 8;
 2514|  1.30M|    if (lr_flip) {
  ------------------
  |  Branch (2514:9): [True: 562, False: 1.30M]
  ------------------
 2515|  1.12k|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (2515:23): [True: 562, False: 562]
  ------------------
 2516|    562|        __m128i temp[8];
 2517|    562|        flip_buf_sse2(buf0 + 8 * j, temp, 8);
 2518|    562|        transpose_16bit_8x8(temp,
 2519|    562|                            _buf1 + txfm_size_row * (buf_size_w_div8 - 1 - j));
 2520|    562|      }
 2521|  1.30M|    } else {
 2522|  2.98M|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (2522:23): [True: 1.67M, False: 1.30M]
  ------------------
 2523|  1.67M|        transpose_16bit_8x8(buf0 + 8 * j, _buf1 + txfm_size_row * j);
 2524|  1.67M|      }
 2525|  1.30M|    }
 2526|  1.30M|  }
 2527|  2.24M|  for (int i = 0; i < buf_size_w_div8; i++) {
  ------------------
  |  Branch (2527:19): [True: 1.30M, False: 937k]
  ------------------
 2528|  1.30M|    col_txfm(buf1 + i * txfm_size_row, buf1 + i * txfm_size_row);
 2529|  1.30M|    round_shift_16bit_ssse3(buf1 + i * txfm_size_row, txfm_size_row, shift[1]);
 2530|  1.30M|  }
 2531|       |
 2532|   937k|  if (txfm_size_col >= 16) {
  ------------------
  |  Branch (2532:7): [True: 368k, False: 569k]
  ------------------
 2533|   736k|    for (int i = 0; i < (txfm_size_col >> 4); i++) {
  ------------------
  |  Branch (2533:21): [True: 368k, False: 368k]
  ------------------
 2534|   368k|      lowbd_write_buffer_16xn_sse2(buf1 + i * txfm_size_row * 2,
 2535|   368k|                                   output + 16 * i, stride, ud_flip,
 2536|   368k|                                   txfm_size_row);
 2537|   368k|    }
 2538|   570k|  } else if (txfm_size_col == 8) {
  ------------------
  |  Branch (2538:14): [True: 570k, False: 18.4E]
  ------------------
 2539|   570k|    lowbd_write_buffer_8xn_sse2(buf1, output, stride, ud_flip, txfm_size_row);
 2540|   570k|  }
 2541|   937k|}
av1_inv_txfm_ssse3.c:lowbd_write_buffer_16xn_sse2:
 2458|   368k|                                                int height) {
 2459|   368k|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (2459:11): [True: 0, False: 368k]
  ------------------
 2460|   368k|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (2460:20): [True: 0, False: 368k]
  ------------------
 2461|  3.31M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (2461:19): [True: 2.94M, False: 368k]
  ------------------
 2462|  2.94M|    __m128i v = _mm_loadu_si128((__m128i const *)(output + i * stride));
 2463|  2.94M|    __m128i u = lowbd_get_recon_16x16_sse2(v, in[j], in[j + height]);
 2464|  2.94M|    _mm_storeu_si128((__m128i *)(output + i * stride), u);
 2465|  2.94M|  }
 2466|   368k|}
av1_inv_txfm_ssse3.c:lowbd_get_recon_16x16_sse2:
 2447|  2.94M|                                                 __m128i res0, __m128i res1) {
 2448|  2.94M|  const __m128i zero = _mm_setzero_si128();
 2449|  2.94M|  __m128i x0 = _mm_unpacklo_epi8(pred, zero);
 2450|  2.94M|  __m128i x1 = _mm_unpackhi_epi8(pred, zero);
 2451|  2.94M|  x0 = _mm_adds_epi16(res0, x0);
 2452|  2.94M|  x1 = _mm_adds_epi16(res1, x1);
 2453|  2.94M|  return _mm_packus_epi16(x0, x1);
 2454|  2.94M|}

av1_inv_txfm_ssse3.c:get_eobx_eoby_scan_h_identity:
  202|   462k|                                                 TX_SIZE tx_size, int eob) {
  203|   462k|  eob -= 1;
  204|   462k|  const int txfm_size_col = tx_size_wide[tx_size];
  205|   462k|  const int eobx_max = AOMMIN(32, txfm_size_col) - 1;
  ------------------
  |  |   34|   462k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 462k]
  |  |  ------------------
  ------------------
  206|   462k|  *eobx = (eob >= eobx_max) ? eobx_max : eob_fill[eob];
  ------------------
  |  Branch (206:11): [True: 439k, False: 22.4k]
  ------------------
  207|   462k|  const int temp_eoby = eob / (eobx_max + 1);
  208|       |  assert(temp_eoby < 32);
  209|   462k|  *eoby = eob_fill[temp_eoby];
  210|   462k|}
av1_inv_txfm_ssse3.c:get_eobx_eoby_scan_v_identity:
  213|  1.18M|                                                 TX_SIZE tx_size, int eob) {
  214|  1.18M|  eob -= 1;
  215|  1.18M|  const int txfm_size_row = tx_size_high[tx_size];
  216|  1.18M|  const int eoby_max = AOMMIN(32, txfm_size_row) - 1;
  ------------------
  |  |   34|  1.18M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.18M]
  |  |  ------------------
  ------------------
  217|  1.18M|  *eobx = eob_fill[eob / (eoby_max + 1)];
  218|  1.18M|  *eoby = (eob >= eoby_max) ? eoby_max : eob_fill[eob];
  ------------------
  |  Branch (218:11): [True: 1.13M, False: 53.5k]
  ------------------
  219|  1.18M|}
av1_inv_txfm_ssse3.c:round_shift_16bit_ssse3:
   60|  36.4M|static inline void round_shift_16bit_ssse3(__m128i *in, int size, int bit) {
   61|  36.4M|  if (bit < 0) {
  ------------------
  |  Branch (61:7): [True: 36.4M, False: 18.4E]
  ------------------
   62|  36.4M|    const __m128i scale = _mm_set1_epi16(1 << (15 + bit));
   63|   224M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (63:21): [True: 187M, False: 36.4M]
  ------------------
   64|   187M|      in[i] = _mm_mulhrs_epi16(in[i], scale);
   65|   187M|    }
   66|  18.4E|  } else if (bit > 0) {
  ------------------
  |  Branch (66:14): [True: 0, False: 18.4E]
  ------------------
   67|      0|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (67:21): [True: 0, False: 0]
  ------------------
   68|      0|      in[i] = _mm_slli_epi16(in[i], bit);
   69|      0|    }
   70|      0|  }
   71|  36.4M|}
av1_inv_txfm_ssse3.c:get_eobx_eoby_scan_default:
  182|   937k|                                              TX_SIZE tx_size, int eob) {
  183|   937k|  if (eob == 1) {
  ------------------
  |  Branch (183:7): [True: 86.2k, False: 851k]
  ------------------
  184|  86.2k|    *eobx = 0;
  185|  86.2k|    *eoby = 0;
  186|  86.2k|    return;
  187|  86.2k|  }
  188|       |
  189|   851k|  const int tx_w_log2 = tx_size_wide_log2_eob[tx_size];
  190|   851k|  const int eob_row = (eob - 1) >> tx_w_log2;
  191|   851k|  const int eobxy = av1_eob_to_eobxy_default[tx_size][eob_row];
  192|   851k|  *eobx = eobxy & 0xFF;
  193|   851k|  *eoby = eobxy >> 8;
  194|   851k|}
highbd_inv_txfm_sse4.c:get_eobx_eoby_scan_v_identity:
  213|  84.8k|                                                 TX_SIZE tx_size, int eob) {
  214|  84.8k|  eob -= 1;
  215|  84.8k|  const int txfm_size_row = tx_size_high[tx_size];
  216|  84.8k|  const int eoby_max = AOMMIN(32, txfm_size_row) - 1;
  ------------------
  |  |   34|  84.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 84.8k]
  |  |  ------------------
  ------------------
  217|  84.8k|  *eobx = eob_fill[eob / (eoby_max + 1)];
  218|  84.8k|  *eoby = (eob >= eoby_max) ? eoby_max : eob_fill[eob];
  ------------------
  |  Branch (218:11): [True: 75.0k, False: 9.87k]
  ------------------
  219|  84.8k|}
highbd_inv_txfm_sse4.c:get_eobx_eoby_scan_h_identity:
  202|   267k|                                                 TX_SIZE tx_size, int eob) {
  203|   267k|  eob -= 1;
  204|   267k|  const int txfm_size_col = tx_size_wide[tx_size];
  205|   267k|  const int eobx_max = AOMMIN(32, txfm_size_col) - 1;
  ------------------
  |  |   34|   267k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 267k]
  |  |  ------------------
  ------------------
  206|   267k|  *eobx = (eob >= eobx_max) ? eobx_max : eob_fill[eob];
  ------------------
  |  Branch (206:11): [True: 241k, False: 25.7k]
  ------------------
  207|   267k|  const int temp_eoby = eob / (eobx_max + 1);
  208|       |  assert(temp_eoby < 32);
  209|   267k|  *eoby = eob_fill[temp_eoby];
  210|   267k|}
av1_inv_txfm_avx2.c:get_eobx_eoby_scan_default:
  182|  1.06M|                                              TX_SIZE tx_size, int eob) {
  183|  1.06M|  if (eob == 1) {
  ------------------
  |  Branch (183:7): [True: 80.5k, False: 982k]
  ------------------
  184|  80.5k|    *eobx = 0;
  185|  80.5k|    *eoby = 0;
  186|  80.5k|    return;
  187|  80.5k|  }
  188|       |
  189|   982k|  const int tx_w_log2 = tx_size_wide_log2_eob[tx_size];
  190|   982k|  const int eob_row = (eob - 1) >> tx_w_log2;
  191|   982k|  const int eobxy = av1_eob_to_eobxy_default[tx_size][eob_row];
  192|   982k|  *eobx = eobxy & 0xFF;
  193|   982k|  *eoby = eobxy >> 8;
  194|   982k|}
av1_inv_txfm_avx2.c:get_eobx_eoby_scan_h_identity:
  202|    508|                                                 TX_SIZE tx_size, int eob) {
  203|    508|  eob -= 1;
  204|    508|  const int txfm_size_col = tx_size_wide[tx_size];
  205|    508|  const int eobx_max = AOMMIN(32, txfm_size_col) - 1;
  ------------------
  |  |   34|    508|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 508]
  |  |  ------------------
  ------------------
  206|    508|  *eobx = (eob >= eobx_max) ? eobx_max : eob_fill[eob];
  ------------------
  |  Branch (206:11): [True: 419, False: 89]
  ------------------
  207|    508|  const int temp_eoby = eob / (eobx_max + 1);
  208|       |  assert(temp_eoby < 32);
  209|    508|  *eoby = eob_fill[temp_eoby];
  210|    508|}
av1_inv_txfm_avx2.c:get_eobx_eoby_scan_v_identity:
  213|    485|                                                 TX_SIZE tx_size, int eob) {
  214|    485|  eob -= 1;
  215|    485|  const int txfm_size_row = tx_size_high[tx_size];
  216|    485|  const int eoby_max = AOMMIN(32, txfm_size_row) - 1;
  ------------------
  |  |   34|    485|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 485]
  |  |  ------------------
  ------------------
  217|    485|  *eobx = eob_fill[eob / (eoby_max + 1)];
  218|    485|  *eoby = (eob >= eoby_max) ? eoby_max : eob_fill[eob];
  ------------------
  |  Branch (218:11): [True: 414, False: 71]
  ------------------
  219|    485|}
highbd_inv_txfm_avx2.c:get_eobx_eoby_scan_default:
  182|  4.20M|                                              TX_SIZE tx_size, int eob) {
  183|  4.20M|  if (eob == 1) {
  ------------------
  |  Branch (183:7): [True: 230k, False: 3.96M]
  ------------------
  184|   230k|    *eobx = 0;
  185|   230k|    *eoby = 0;
  186|   230k|    return;
  187|   230k|  }
  188|       |
  189|  3.96M|  const int tx_w_log2 = tx_size_wide_log2_eob[tx_size];
  190|  3.96M|  const int eob_row = (eob - 1) >> tx_w_log2;
  191|  3.96M|  const int eobxy = av1_eob_to_eobxy_default[tx_size][eob_row];
  192|  3.96M|  *eobx = eobxy & 0xFF;
  193|  3.96M|  *eoby = eobxy >> 8;
  194|  3.96M|}

av1_inv_txfm_ssse3.c:load_32bit_to_16bit:
   87|  45.8M|static inline __m128i load_32bit_to_16bit(const int32_t *a) {
   88|  45.8M|  const __m128i a_low = _mm_load_si128((const __m128i *)a);
   89|  45.8M|  return _mm_packs_epi32(a_low, *(const __m128i *)(a + 4));
   90|  45.8M|}
av1_inv_txfm_ssse3.c:load_buffer_32bit_to_16bit:
  173|  7.24M|                                              __m128i *out, int out_size) {
  174|  48.8M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (174:19): [True: 41.6M, False: 7.24M]
  ------------------
  175|  41.6M|    out[i] = load_32bit_to_16bit(in + i * stride);
  176|  41.6M|  }
  177|  7.24M|}
av1_inv_txfm_ssse3.c:flip_buf_sse2:
  253|   120k|static inline void flip_buf_sse2(__m128i *in, __m128i *out, int size) {
  254|   886k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (254:19): [True: 765k, False: 120k]
  ------------------
  255|   765k|    out[size - i - 1] = in[i];
  256|   765k|  }
  257|   120k|}
av1_inv_txfm_ssse3.c:load_buffer_32bit_to_16bit_w4:
  180|  27.9M|                                                 __m128i *out, int out_size) {
  181|   140M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (181:19): [True: 112M, False: 27.9M]
  ------------------
  182|   112M|    out[i] = load_32bit_to_16bit_w4(in + i * stride);
  183|   112M|  }
  184|  27.9M|}
av1_inv_txfm_ssse3.c:load_32bit_to_16bit_w4:
   92|   112M|static inline __m128i load_32bit_to_16bit_w4(const int32_t *a) {
   93|   112M|  const __m128i a_low = _mm_load_si128((const __m128i *)a);
   94|   112M|  return _mm_packs_epi32(a_low, a_low);
   95|   112M|}
highbd_inv_txfm_sse4.c:flip_buf_sse2:
  253|  13.6k|static inline void flip_buf_sse2(__m128i *in, __m128i *out, int size) {
  254|   122k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (254:19): [True: 108k, False: 13.6k]
  ------------------
  255|   108k|    out[size - i - 1] = in[i];
  256|   108k|  }
  257|  13.6k|}
av1_fwd_txfm2d_avx2.c:load_16bit_to_16bit:
   83|  37.4M|static inline __m128i load_16bit_to_16bit(const int16_t *a) {
   84|  37.4M|  return _mm_load_si128((const __m128i *)a);
   85|  37.4M|}
av1_fwd_txfm2d_avx2.c:load_buffer_16bit_to_16bit_flip:
  166|  2.12k|                                                   int out_size) {
  167|  36.0k|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (167:19): [True: 33.9k, False: 2.12k]
  ------------------
  168|  33.9k|    out[out_size - i - 1] = load_16bit_to_16bit(in + i * stride);
  169|  33.9k|  }
  170|  2.12k|}
av1_fwd_txfm2d_avx2.c:load_buffer_16bit_to_16bit:
  158|  3.13M|                                              __m128i *out, int out_size) {
  159|  38.8M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (159:19): [True: 35.7M, False: 3.13M]
  ------------------
  160|  35.7M|    out[i] = load_16bit_to_16bit(in + i * stride);
  161|  35.7M|  }
  162|  3.13M|}
av1_fwd_txfm2d_avx2.c:round_shift_16bit:
  238|  3.57M|static inline void round_shift_16bit(__m128i *in, int size, int bit) {
  239|  3.57M|  if (bit < 0) {
  ------------------
  |  Branch (239:7): [True: 1.34M, False: 2.23M]
  ------------------
  240|  1.34M|    bit = -bit;
  241|  1.34M|    __m128i rounding = _mm_set1_epi16(1 << (bit - 1));
  242|  22.8M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (242:21): [True: 21.4M, False: 1.34M]
  ------------------
  243|  21.4M|      in[i] = _mm_adds_epi16(in[i], rounding);
  244|  21.4M|      in[i] = _mm_srai_epi16(in[i], bit);
  245|  21.4M|    }
  246|  2.23M|  } else if (bit > 0) {
  ------------------
  |  Branch (246:14): [True: 1.34M, False: 895k]
  ------------------
  247|  22.8M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (247:21): [True: 21.4M, False: 1.34M]
  ------------------
  248|  21.4M|      in[i] = _mm_slli_epi16(in[i], bit);
  249|  21.4M|    }
  250|  1.34M|  }
  251|  3.57M|}
av1_fwd_txfm2d_avx2.c:flip_buf_sse2:
  253|  2.22k|static inline void flip_buf_sse2(__m128i *in, __m128i *out, int size) {
  254|  20.0k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (254:19): [True: 17.7k, False: 2.22k]
  ------------------
  255|  17.7k|    out[size - i - 1] = in[i];
  256|  17.7k|  }
  257|  2.22k|}
av1_fwd_txfm2d_avx2.c:store_rect_buffer_16bit_to_32bit_w8:
  224|   898k|                                                       const int out_size) {
  225|  15.2M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (225:19): [True: 14.3M, False: 898k]
  ------------------
  226|  14.3M|    store_rect_16bit_to_32bit(in[i], out + i * stride);
  227|  14.3M|  }
  228|   898k|}
av1_fwd_txfm2d_avx2.c:store_rect_16bit_to_32bit:
  129|  14.3M|                                             int32_t *const b) {
  130|  14.3M|  const __m128i one = _mm_set1_epi16(1);
  131|  14.3M|  const __m128i a_lo = _mm_unpacklo_epi16(a, one);
  132|  14.3M|  const __m128i a_hi = _mm_unpackhi_epi16(a, one);
  133|  14.3M|  const __m128i b_lo = scale_round_sse2(a_lo, NewSqrt2);
  134|  14.3M|  const __m128i b_hi = scale_round_sse2(a_hi, NewSqrt2);
  135|  14.3M|  _mm_store_si128((__m128i *)b, b_lo);
  136|  14.3M|  _mm_store_si128((__m128i *)(b + 4), b_hi);
  137|  14.3M|}
av1_fwd_txfm2d_avx2.c:scale_round_sse2:
  114|  28.7M|static inline __m128i scale_round_sse2(const __m128i a, const int scale) {
  115|  28.7M|  const __m128i scale_rounding = pair_set_epi16(scale, 1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   20|  28.7M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  116|  28.7M|  const __m128i b = _mm_madd_epi16(a, scale_rounding);
  117|  28.7M|  return _mm_srai_epi32(b, NewSqrt2Bits);
  ------------------
  |  |   42|  28.7M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  118|  28.7M|}
av1_fwd_txfm_sse2.c:scale_round_sse2:
  114|  76.0M|static inline __m128i scale_round_sse2(const __m128i a, const int scale) {
  115|  76.0M|  const __m128i scale_rounding = pair_set_epi16(scale, 1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   20|  76.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  116|  76.0M|  const __m128i b = _mm_madd_epi16(a, scale_rounding);
  117|  76.0M|  return _mm_srai_epi32(b, NewSqrt2Bits);
  ------------------
  |  |   42|  76.0M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  118|  76.0M|}
av1_fwd_txfm_sse2.c:load_buffer_16bit_to_16bit_w4_flip:
  151|  32.4k|                                                      const int out_size) {
  152|   201k|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (152:19): [True: 168k, False: 32.4k]
  ------------------
  153|   168k|    out[out_size - i - 1] = _mm_loadl_epi64((const __m128i *)(in + i * stride));
  154|   168k|  }
  155|  32.4k|}
av1_fwd_txfm_sse2.c:load_buffer_16bit_to_16bit_w4:
  142|  46.3M|                                                 const int out_size) {
  143|   259M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (143:19): [True: 212M, False: 46.3M]
  ------------------
  144|   212M|    out[i] = _mm_loadl_epi64((const __m128i *)(in + i * stride));
  145|   212M|  }
  146|  46.3M|}
av1_fwd_txfm_sse2.c:round_shift_16bit:
  238|   139M|static inline void round_shift_16bit(__m128i *in, int size, int bit) {
  239|   139M|  if (bit < 0) {
  ------------------
  |  Branch (239:7): [True: 7.33M, False: 132M]
  ------------------
  240|  7.33M|    bit = -bit;
  241|  7.33M|    __m128i rounding = _mm_set1_epi16(1 << (bit - 1));
  242|  64.8M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (242:21): [True: 57.5M, False: 7.33M]
  ------------------
  243|  57.5M|      in[i] = _mm_adds_epi16(in[i], rounding);
  244|  57.5M|      in[i] = _mm_srai_epi16(in[i], bit);
  245|  57.5M|    }
  246|   132M|  } else if (bit > 0) {
  ------------------
  |  Branch (246:14): [True: 46.8M, False: 85.2M]
  ------------------
  247|   262M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (247:21): [True: 215M, False: 46.8M]
  ------------------
  248|   215M|      in[i] = _mm_slli_epi16(in[i], bit);
  249|   215M|    }
  250|  46.8M|  }
  251|   139M|}
av1_fwd_txfm_sse2.c:flip_buf_sse2:
  253|  50.6k|static inline void flip_buf_sse2(__m128i *in, __m128i *out, int size) {
  254|   253k|  for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (254:19): [True: 202k, False: 50.6k]
  ------------------
  255|   202k|    out[size - i - 1] = in[i];
  256|   202k|  }
  257|  50.6k|}
av1_fwd_txfm_sse2.c:store_buffer_16bit_to_32bit_w4:
  197|  39.6M|                                                  const int out_size) {
  198|   198M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (198:19): [True: 158M, False: 39.6M]
  ------------------
  199|   158M|    store_16bit_to_32bit_w4(in[i], out + i * stride);
  200|   158M|  }
  201|  39.6M|}
av1_fwd_txfm_sse2.c:store_16bit_to_32bit_w4:
   98|   157M|static inline void store_16bit_to_32bit_w4(const __m128i a, int32_t *const b) {
   99|   157M|  const __m128i a_lo = _mm_unpacklo_epi16(a, a);
  100|   157M|  const __m128i a_1 = _mm_srai_epi32(a_lo, 16);
  101|   157M|  _mm_store_si128((__m128i *)b, a_1);
  102|   157M|}
av1_fwd_txfm_sse2.c:btf_16_w4_sse2:
   31|  40.8M|    __m128i *const out0, __m128i *const out1) {
   32|  40.8M|  const __m128i t0 = _mm_unpacklo_epi16(*in0, *in1);
   33|  40.8M|  const __m128i u0 = _mm_madd_epi16(t0, *w0);
   34|  40.8M|  const __m128i v0 = _mm_madd_epi16(t0, *w1);
   35|  40.8M|  const __m128i a0 = _mm_add_epi32(u0, __rounding);
   36|  40.8M|  const __m128i b0 = _mm_add_epi32(v0, __rounding);
   37|  40.8M|  const __m128i c0 = _mm_srai_epi32(a0, cos_bit);
   38|  40.8M|  const __m128i d0 = _mm_srai_epi32(b0, cos_bit);
   39|       |
   40|  40.8M|  *out0 = _mm_packs_epi32(c0, c0);
   41|  40.8M|  *out1 = _mm_packs_epi32(d0, c0);
   42|  40.8M|}
av1_fwd_txfm_sse2.c:store_rect_buffer_16bit_to_32bit_w8:
  224|  7.04M|                                                       const int out_size) {
  225|  35.2M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (225:19): [True: 28.1M, False: 7.04M]
  ------------------
  226|  28.1M|    store_rect_16bit_to_32bit(in[i], out + i * stride);
  227|  28.1M|  }
  228|  7.04M|}
av1_fwd_txfm_sse2.c:store_rect_16bit_to_32bit:
  129|  28.0M|                                             int32_t *const b) {
  130|  28.0M|  const __m128i one = _mm_set1_epi16(1);
  131|  28.0M|  const __m128i a_lo = _mm_unpacklo_epi16(a, one);
  132|  28.0M|  const __m128i a_hi = _mm_unpackhi_epi16(a, one);
  133|  28.0M|  const __m128i b_lo = scale_round_sse2(a_lo, NewSqrt2);
  134|  28.0M|  const __m128i b_hi = scale_round_sse2(a_hi, NewSqrt2);
  135|  28.0M|  _mm_store_si128((__m128i *)b, b_lo);
  136|  28.0M|  _mm_store_si128((__m128i *)(b + 4), b_hi);
  137|  28.0M|}
av1_fwd_txfm_sse2.c:load_16bit_to_16bit:
   83|  1.15M|static inline __m128i load_16bit_to_16bit(const int16_t *a) {
   84|  1.15M|  return _mm_load_si128((const __m128i *)a);
   85|  1.15M|}
av1_fwd_txfm_sse2.c:load_buffer_16bit_to_16bit:
  158|   289k|                                              __m128i *out, int out_size) {
  159|  1.44M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (159:19): [True: 1.15M, False: 289k]
  ------------------
  160|  1.15M|    out[i] = load_16bit_to_16bit(in + i * stride);
  161|  1.15M|  }
  162|   289k|}
av1_fwd_txfm_sse2.c:store_rect_buffer_16bit_to_32bit_w4:
  215|   289k|                                                       const int out_size) {
  216|  2.60M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (216:19): [True: 2.31M, False: 289k]
  ------------------
  217|  2.31M|    store_rect_16bit_to_32bit_w4(in[i], out + i * stride);
  218|  2.31M|  }
  219|   289k|}
av1_fwd_txfm_sse2.c:store_rect_16bit_to_32bit_w4:
  121|  2.31M|                                                int32_t *const b) {
  122|  2.31M|  const __m128i one = _mm_set1_epi16(1);
  123|  2.31M|  const __m128i a_lo = _mm_unpacklo_epi16(a, one);
  124|  2.31M|  const __m128i b_lo = scale_round_sse2(a_lo, NewSqrt2);
  125|  2.31M|  _mm_store_si128((__m128i *)b, b_lo);
  126|  2.31M|}

highbd_inv_txfm_sse4.c:av1_round_shift_rect_array_32_sse4_1:
   49|  4.11M|                                                        const int val) {
   50|  4.11M|  const __m128i sqrt2 = _mm_set1_epi32(val);
   51|  4.11M|  if (bit > 0) {
  ------------------
  |  Branch (51:7): [True: 0, False: 4.11M]
  ------------------
   52|      0|    int i;
   53|      0|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (53:17): [True: 0, False: 0]
  ------------------
   54|      0|      const __m128i r0 = av1_round_shift_32_sse4_1(input[i], bit);
   55|      0|      const __m128i r1 = _mm_mullo_epi32(sqrt2, r0);
   56|      0|      output[i] = av1_round_shift_32_sse4_1(r1, NewSqrt2Bits);
  ------------------
  |  |   42|      0|#define NewSqrt2Bits ((int32_t)12)
  ------------------
   57|      0|    }
   58|  4.11M|  } else {
   59|  4.11M|    int i;
   60|  37.1M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (60:17): [True: 33.0M, False: 4.11M]
  ------------------
   61|  33.0M|      const __m128i r0 = _mm_slli_epi32(input[i], -bit);
   62|  33.0M|      const __m128i r1 = _mm_mullo_epi32(sqrt2, r0);
   63|  33.0M|      output[i] = av1_round_shift_32_sse4_1(r1, NewSqrt2Bits);
  ------------------
  |  |   42|  33.0M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
   64|  33.0M|    }
   65|  4.11M|  }
   66|  4.11M|}
highbd_inv_txfm_sse4.c:av1_round_shift_32_sse4_1:
   21|  71.9M|static inline __m128i av1_round_shift_32_sse4_1(__m128i vec, int bit) {
   22|  71.9M|  __m128i tmp, round;
   23|  71.9M|  round = _mm_set1_epi32(1 << (bit - 1));
   24|  71.9M|  tmp = _mm_add_epi32(vec, round);
   25|  71.9M|  return _mm_srai_epi32(tmp, bit);
   26|  71.9M|}
highbd_inv_txfm_sse4.c:av1_round_shift_array_32_sse4_1:
   31|  4.81M|                                                   const int bit) {
   32|  4.81M|  if (bit > 0) {
  ------------------
  |  Branch (32:7): [True: 4.81M, False: 18.4E]
  ------------------
   33|  4.81M|    int i;
   34|  43.7M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (34:17): [True: 38.9M, False: 4.81M]
  ------------------
   35|  38.9M|      output[i] = av1_round_shift_32_sse4_1(input[i], bit);
   36|  38.9M|    }
   37|  18.4E|  } else {
   38|  18.4E|    int i;
   39|  18.4E|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (39:17): [True: 0, False: 18.4E]
  ------------------
   40|      0|      output[i] = _mm_slli_epi32(input[i], -bit);
   41|      0|    }
   42|  18.4E|  }
   43|  4.81M|}
highbd_fwd_txfm_sse4.c:av1_round_shift_rect_array_32_sse4_1:
   49|  10.6M|                                                        const int val) {
   50|  10.6M|  const __m128i sqrt2 = _mm_set1_epi32(val);
   51|  10.6M|  if (bit > 0) {
  ------------------
  |  Branch (51:7): [True: 48.7k, False: 10.6M]
  ------------------
   52|  48.7k|    int i;
   53|  1.27M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (53:17): [True: 1.22M, False: 48.7k]
  ------------------
   54|  1.22M|      const __m128i r0 = av1_round_shift_32_sse4_1(input[i], bit);
   55|  1.22M|      const __m128i r1 = _mm_mullo_epi32(sqrt2, r0);
   56|  1.22M|      output[i] = av1_round_shift_32_sse4_1(r1, NewSqrt2Bits);
  ------------------
  |  |   42|  1.22M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
   57|  1.22M|    }
   58|  10.6M|  } else {
   59|  10.6M|    int i;
   60|  69.8M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (60:17): [True: 59.2M, False: 10.6M]
  ------------------
   61|  59.2M|      const __m128i r0 = _mm_slli_epi32(input[i], -bit);
   62|  59.2M|      const __m128i r1 = _mm_mullo_epi32(sqrt2, r0);
   63|  59.2M|      output[i] = av1_round_shift_32_sse4_1(r1, NewSqrt2Bits);
  ------------------
  |  |   42|  59.2M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
   64|  59.2M|    }
   65|  10.6M|  }
   66|  10.6M|}
highbd_fwd_txfm_sse4.c:av1_round_shift_32_sse4_1:
   21|  61.6M|static inline __m128i av1_round_shift_32_sse4_1(__m128i vec, int bit) {
   22|  61.6M|  __m128i tmp, round;
   23|  61.6M|  round = _mm_set1_epi32(1 << (bit - 1));
   24|  61.6M|  tmp = _mm_add_epi32(vec, round);
   25|  61.6M|  return _mm_srai_epi32(tmp, bit);
   26|  61.6M|}
av1_fwd_txfm1d_sse4.c:av1_round_shift_32_sse4_1:
   21|  13.4M|static inline __m128i av1_round_shift_32_sse4_1(__m128i vec, int bit) {
   22|  13.4M|  __m128i tmp, round;
   23|  13.4M|  round = _mm_set1_epi32(1 << (bit - 1));
   24|  13.4M|  tmp = _mm_add_epi32(vec, round);
   25|  13.4M|  return _mm_srai_epi32(tmp, bit);
   26|  13.4M|}

cdef_find_dir_dual_avx2:
  182|  2.00M|                             int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
  183|  2.00M|  int32_t cost_first_8x8[8];
  184|  2.00M|  int32_t cost_second_8x8[8];
  185|       |  // Used to store the best cost for 2 8x8's.
  186|  2.00M|  int32_t best_cost[2] = { 0 };
  187|       |  // Best direction for 2 8x8's.
  188|  2.00M|  int best_dir[2] = { 0 };
  189|       |
  190|  2.00M|  const __m128i const_coeff_shift_reg = _mm_cvtsi32_si128(coeff_shift);
  191|  2.00M|  const __m256i const_128_reg = _mm256_set1_epi16(128);
  192|  2.00M|  __m256i lines[8];
  193|  18.0M|  for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (193:19): [True: 16.0M, False: 2.00M]
  ------------------
  194|  16.0M|    const __m128i src_1 = _mm_loadu_si128((const __m128i *)&img1[i * stride]);
  195|  16.0M|    const __m128i src_2 = _mm_loadu_si128((const __m128i *)&img2[i * stride]);
  196|       |
  197|  16.0M|    lines[i] = _mm256_insertf128_si256(_mm256_castsi128_si256(src_1), src_2, 1);
  198|  16.0M|    lines[i] = _mm256_sub_epi16(
  199|  16.0M|        _mm256_sra_epi16(lines[i], const_coeff_shift_reg), const_128_reg);
  200|  16.0M|  }
  201|       |
  202|       |  /* Compute "mostly vertical" directions. */
  203|  2.00M|  const __m256i dir47 =
  204|  2.00M|      compute_directions_avx2(lines, cost_first_8x8 + 4, cost_second_8x8 + 4);
  205|       |
  206|       |  /* Transpose and reverse the order of the lines. */
  207|  2.00M|  array_reverse_transpose_8x8_avx2(lines, lines);
  208|       |
  209|       |  /* Compute "mostly horizontal" directions. */
  210|  2.00M|  const __m256i dir03 =
  211|  2.00M|      compute_directions_avx2(lines, cost_first_8x8, cost_second_8x8);
  212|       |
  213|  2.00M|  __m256i max = _mm256_max_epi32(dir03, dir47);
  214|  2.00M|  max =
  215|  2.00M|      _mm256_max_epi32(max, _mm256_or_si256(_mm256_srli_si256(max, 8),
  216|  2.00M|                                            _mm256_slli_si256(max, 16 - (8))));
  217|  2.00M|  max =
  218|  2.00M|      _mm256_max_epi32(max, _mm256_or_si256(_mm256_srli_si256(max, 4),
  219|  2.00M|                                            _mm256_slli_si256(max, 16 - (4))));
  220|       |
  221|  2.00M|  const __m128i first_8x8_output = _mm256_castsi256_si128(max);
  222|  2.00M|  const __m128i second_8x8_output = _mm256_extractf128_si256(max, 1);
  223|  2.00M|  const __m128i cmpeg_res_00 =
  224|  2.00M|      _mm_cmpeq_epi32(first_8x8_output, _mm256_castsi256_si128(dir47));
  225|  2.00M|  const __m128i cmpeg_res_01 =
  226|  2.00M|      _mm_cmpeq_epi32(first_8x8_output, _mm256_castsi256_si128(dir03));
  227|  2.00M|  const __m128i cmpeg_res_10 =
  228|  2.00M|      _mm_cmpeq_epi32(second_8x8_output, _mm256_extractf128_si256(dir47, 1));
  229|  2.00M|  const __m128i cmpeg_res_11 =
  230|  2.00M|      _mm_cmpeq_epi32(second_8x8_output, _mm256_extractf128_si256(dir03, 1));
  231|  2.00M|  const __m128i t_first_8x8 = _mm_packs_epi32(cmpeg_res_01, cmpeg_res_00);
  232|  2.00M|  const __m128i t_second_8x8 = _mm_packs_epi32(cmpeg_res_11, cmpeg_res_10);
  233|       |
  234|  2.00M|  best_cost[0] = _mm_cvtsi128_si32(_mm256_castsi256_si128(max));
  235|  2.00M|  best_cost[1] = _mm_cvtsi128_si32(second_8x8_output);
  236|  2.00M|  best_dir[0] = _mm_movemask_epi8(_mm_packs_epi16(t_first_8x8, t_first_8x8));
  237|  2.00M|  best_dir[0] =
  238|  2.00M|      get_msb(best_dir[0] ^ (best_dir[0] - 1));  // Count trailing zeros
  239|  2.00M|  best_dir[1] = _mm_movemask_epi8(_mm_packs_epi16(t_second_8x8, t_second_8x8));
  240|  2.00M|  best_dir[1] =
  241|  2.00M|      get_msb(best_dir[1] ^ (best_dir[1] - 1));  // Count trailing zeros
  242|       |
  243|       |  /* Difference between the optimal variance and the variance along the
  244|       |     orthogonal direction. Again, the sum(x^2) terms cancel out. */
  245|  2.00M|  *var_out_1st = best_cost[0] - cost_first_8x8[(best_dir[0] + 4) & 7];
  246|  2.00M|  *var_out_2nd = best_cost[1] - cost_second_8x8[(best_dir[1] + 4) & 7];
  247|       |
  248|       |  /* We'd normally divide by 840, but dividing by 1024 is close enough
  249|       |  for what we're going to do with this. */
  250|  2.00M|  *var_out_1st >>= 10;
  251|  2.00M|  *var_out_2nd >>= 10;
  252|  2.00M|  *out_dir_1st_8x8 = best_dir[0];
  253|  2.00M|  *out_dir_2nd_8x8 = best_dir[1];
  254|  2.00M|}
cdef_copy_rect8_8bit_to_16bit_avx2:
  258|   341k|                                        int width, int height) {
  259|   341k|  int j = 0;
  260|   341k|  int remaining_width = width;
  261|   341k|  assert(height % 2 == 0);
  262|   341k|  assert(height > 0);
  263|   341k|  assert(width > 0);
  264|       |
  265|       |  // Process multiple 32 pixels at a time.
  266|   341k|  if (remaining_width > 31) {
  ------------------
  |  Branch (266:7): [True: 188k, False: 153k]
  ------------------
  267|   188k|    int i = 0;
  268|  2.75M|    do {
  269|  2.75M|      j = 0;
  270|  4.37M|      do {
  271|  4.37M|        __m128i row00 =
  272|  4.37M|            _mm_loadu_si128((const __m128i *)&src[(i + 0) * sstride + (j + 0)]);
  273|  4.37M|        __m128i row01 = _mm_loadu_si128(
  274|  4.37M|            (const __m128i *)&src[(i + 0) * sstride + (j + 16)]);
  275|  4.37M|        __m128i row10 =
  276|  4.37M|            _mm_loadu_si128((const __m128i *)&src[(i + 1) * sstride + (j + 0)]);
  277|  4.37M|        __m128i row11 = _mm_loadu_si128(
  278|  4.37M|            (const __m128i *)&src[(i + 1) * sstride + (j + 16)]);
  279|  4.37M|        _mm256_storeu_si256((__m256i *)&dst[(i + 0) * dstride + (j + 0)],
  280|  4.37M|                            _mm256_cvtepu8_epi16(row00));
  281|  4.37M|        _mm256_storeu_si256((__m256i *)&dst[(i + 0) * dstride + (j + 16)],
  282|  4.37M|                            _mm256_cvtepu8_epi16(row01));
  283|  4.37M|        _mm256_storeu_si256((__m256i *)&dst[(i + 1) * dstride + (j + 0)],
  284|  4.37M|                            _mm256_cvtepu8_epi16(row10));
  285|  4.37M|        _mm256_storeu_si256((__m256i *)&dst[(i + 1) * dstride + (j + 16)],
  286|  4.37M|                            _mm256_cvtepu8_epi16(row11));
  287|  4.37M|        j += 32;
  288|  4.37M|      } while (j <= width - 32);
  ------------------
  |  Branch (288:16): [True: 1.61M, False: 2.75M]
  ------------------
  289|  2.75M|      i += 2;
  290|  2.75M|    } while (i < height);
  ------------------
  |  Branch (290:14): [True: 2.56M, False: 188k]
  ------------------
  291|   188k|    remaining_width = width & 31;
  292|   188k|  }
  293|       |
  294|       |  // Process 16 pixels at a time.
  295|   341k|  if (remaining_width > 15) {
  ------------------
  |  Branch (295:7): [True: 129k, False: 211k]
  ------------------
  296|   129k|    int i = 0;
  297|  1.53M|    do {
  298|  1.53M|      __m128i row0 =
  299|  1.53M|          _mm_loadu_si128((const __m128i *)&src[(i + 0) * sstride + j]);
  300|  1.53M|      __m128i row1 =
  301|  1.53M|          _mm_loadu_si128((const __m128i *)&src[(i + 1) * sstride + j]);
  302|  1.53M|      _mm256_storeu_si256((__m256i *)&dst[(i + 0) * dstride + j],
  303|  1.53M|                          _mm256_cvtepu8_epi16(row0));
  304|  1.53M|      _mm256_storeu_si256((__m256i *)&dst[(i + 1) * dstride + j],
  305|  1.53M|                          _mm256_cvtepu8_epi16(row1));
  306|  1.53M|      i += 2;
  307|  1.53M|    } while (i < height);
  ------------------
  |  Branch (307:14): [True: 1.40M, False: 129k]
  ------------------
  308|   129k|    remaining_width = width & 15;
  309|   129k|    j += 16;
  310|   129k|  }
  311|       |
  312|       |  // Process 8 pixels at a time.
  313|   341k|  if (remaining_width > 7) {
  ------------------
  |  Branch (313:7): [True: 184k, False: 156k]
  ------------------
  314|   184k|    int i = 0;
  315|  2.93M|    do {
  316|  2.93M|      __m128i row0 =
  317|  2.93M|          _mm_loadl_epi64((const __m128i *)&src[(i + 0) * sstride + j]);
  318|  2.93M|      __m128i row1 =
  319|  2.93M|          _mm_loadl_epi64((const __m128i *)&src[(i + 1) * sstride + j]);
  320|  2.93M|      _mm_storeu_si128((__m128i *)&dst[(i + 0) * dstride + j],
  321|  2.93M|                       _mm_unpacklo_epi8(row0, _mm_setzero_si128()));
  322|  2.93M|      _mm_storeu_si128((__m128i *)&dst[(i + 1) * dstride + j],
  323|  2.93M|                       _mm_unpacklo_epi8(row1, _mm_setzero_si128()));
  324|  2.93M|      i += 2;
  325|  2.93M|    } while (i < height);
  ------------------
  |  Branch (325:14): [True: 2.75M, False: 184k]
  ------------------
  326|   184k|    remaining_width = width & 7;
  327|   184k|    j += 8;
  328|   184k|  }
  329|       |
  330|       |  // Process 4 pixels at a time.
  331|   341k|  if (remaining_width > 3) {
  ------------------
  |  Branch (331:7): [True: 27.7k, False: 313k]
  ------------------
  332|  27.7k|    int i = 0;
  333|   308k|    do {
  334|   308k|      __m128i row0 =
  335|   308k|          _mm_cvtsi32_si128(*((const int32_t *)&src[(i + 0) * sstride + j]));
  336|   308k|      __m128i row1 =
  337|   308k|          _mm_cvtsi32_si128(*((const int32_t *)&src[(i + 1) * sstride + j]));
  338|   308k|      _mm_storel_epi64((__m128i *)&dst[(i + 0) * dstride + j],
  339|   308k|                       _mm_unpacklo_epi8(row0, _mm_setzero_si128()));
  340|   308k|      _mm_storel_epi64((__m128i *)&dst[(i + 1) * dstride + j],
  341|   308k|                       _mm_unpacklo_epi8(row1, _mm_setzero_si128()));
  342|   308k|      i += 2;
  343|   308k|    } while (i < height);
  ------------------
  |  Branch (343:14): [True: 280k, False: 27.7k]
  ------------------
  344|  27.7k|    remaining_width = width & 3;
  345|  27.7k|    j += 4;
  346|  27.7k|  }
  347|       |
  348|       |  // Process the remaining pixels.
  349|   341k|  if (remaining_width) {
  ------------------
  |  Branch (349:7): [True: 0, False: 341k]
  ------------------
  350|      0|    for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (350:21): [True: 0, False: 0]
  ------------------
  351|      0|      for (int k = j; k < width; k++) {
  ------------------
  |  Branch (351:23): [True: 0, False: 0]
  ------------------
  352|      0|        dst[i * dstride + k] = src[i * sstride + k];
  353|      0|      }
  354|      0|    }
  355|      0|  }
  356|   341k|}
cdef_block_avx2.c:compute_directions_avx2:
   70|  4.03M|                                              int32_t cost_second_8x8[4]) {
   71|  4.03M|  __m256i partial4a, partial4b, partial5a, partial5b, partial7a, partial7b;
   72|  4.03M|  __m256i partial6;
   73|  4.03M|  __m256i tmp;
   74|       |  /* Partial sums for lines 0 and 1. */
   75|  4.03M|  partial4a = _mm256_slli_si256(lines[0], 14);
   76|  4.03M|  partial4b = _mm256_srli_si256(lines[0], 2);
   77|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[1], 12));
   78|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[1], 4));
   79|  4.03M|  tmp = _mm256_add_epi16(lines[0], lines[1]);
   80|  4.03M|  partial5a = _mm256_slli_si256(tmp, 10);
   81|  4.03M|  partial5b = _mm256_srli_si256(tmp, 6);
   82|  4.03M|  partial7a = _mm256_slli_si256(tmp, 4);
   83|  4.03M|  partial7b = _mm256_srli_si256(tmp, 12);
   84|  4.03M|  partial6 = tmp;
   85|       |
   86|       |  /* Partial sums for lines 2 and 3. */
   87|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[2], 10));
   88|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[2], 6));
   89|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[3], 8));
   90|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[3], 8));
   91|  4.03M|  tmp = _mm256_add_epi16(lines[2], lines[3]);
   92|  4.03M|  partial5a = _mm256_add_epi16(partial5a, _mm256_slli_si256(tmp, 8));
   93|  4.03M|  partial5b = _mm256_add_epi16(partial5b, _mm256_srli_si256(tmp, 8));
   94|  4.03M|  partial7a = _mm256_add_epi16(partial7a, _mm256_slli_si256(tmp, 6));
   95|  4.03M|  partial7b = _mm256_add_epi16(partial7b, _mm256_srli_si256(tmp, 10));
   96|  4.03M|  partial6 = _mm256_add_epi16(partial6, tmp);
   97|       |
   98|       |  /* Partial sums for lines 4 and 5. */
   99|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[4], 6));
  100|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[4], 10));
  101|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[5], 4));
  102|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[5], 12));
  103|  4.03M|  tmp = _mm256_add_epi16(lines[4], lines[5]);
  104|  4.03M|  partial5a = _mm256_add_epi16(partial5a, _mm256_slli_si256(tmp, 6));
  105|  4.03M|  partial5b = _mm256_add_epi16(partial5b, _mm256_srli_si256(tmp, 10));
  106|  4.03M|  partial7a = _mm256_add_epi16(partial7a, _mm256_slli_si256(tmp, 8));
  107|  4.03M|  partial7b = _mm256_add_epi16(partial7b, _mm256_srli_si256(tmp, 8));
  108|  4.03M|  partial6 = _mm256_add_epi16(partial6, tmp);
  109|       |
  110|       |  /* Partial sums for lines 6 and 7. */
  111|  4.03M|  partial4a = _mm256_add_epi16(partial4a, _mm256_slli_si256(lines[6], 2));
  112|  4.03M|  partial4b = _mm256_add_epi16(partial4b, _mm256_srli_si256(lines[6], 14));
  113|  4.03M|  partial4a = _mm256_add_epi16(partial4a, lines[7]);
  114|  4.03M|  tmp = _mm256_add_epi16(lines[6], lines[7]);
  115|  4.03M|  partial5a = _mm256_add_epi16(partial5a, _mm256_slli_si256(tmp, 4));
  116|  4.03M|  partial5b = _mm256_add_epi16(partial5b, _mm256_srli_si256(tmp, 12));
  117|  4.03M|  partial7a = _mm256_add_epi16(partial7a, _mm256_slli_si256(tmp, 10));
  118|  4.03M|  partial7b = _mm256_add_epi16(partial7b, _mm256_srli_si256(tmp, 6));
  119|  4.03M|  partial6 = _mm256_add_epi16(partial6, tmp);
  120|       |
  121|  4.03M|  const __m256i const_reg_1 =
  122|  4.03M|      _mm256_set_epi32(210, 280, 420, 840, 210, 280, 420, 840);
  123|  4.03M|  const __m256i const_reg_2 =
  124|  4.03M|      _mm256_set_epi32(105, 120, 140, 168, 105, 120, 140, 168);
  125|  4.03M|  const __m256i const_reg_3 = _mm256_set_epi32(210, 420, 0, 0, 210, 420, 0, 0);
  126|  4.03M|  const __m256i const_reg_4 =
  127|  4.03M|      _mm256_set_epi32(105, 105, 105, 140, 105, 105, 105, 140);
  128|       |
  129|       |  /* Compute costs in terms of partial sums. */
  130|  4.03M|  partial4a =
  131|  4.03M|      fold_mul_and_sum_avx2(&partial4a, &partial4b, &const_reg_1, &const_reg_2);
  132|  4.03M|  partial7a =
  133|  4.03M|      fold_mul_and_sum_avx2(&partial7a, &partial7b, &const_reg_3, &const_reg_4);
  134|  4.03M|  partial5a =
  135|  4.03M|      fold_mul_and_sum_avx2(&partial5a, &partial5b, &const_reg_3, &const_reg_4);
  136|  4.03M|  partial6 = _mm256_madd_epi16(partial6, partial6);
  137|  4.03M|  partial6 = _mm256_mullo_epi32(partial6, _mm256_set1_epi32(105));
  138|       |
  139|  4.03M|  partial4a = hsum4_avx2(&partial4a, &partial5a, &partial6, &partial7a);
  140|  4.03M|  _mm_storeu_si128((__m128i *)cost_frist_8x8,
  141|  4.03M|                   _mm256_castsi256_si128(partial4a));
  142|  4.03M|  _mm_storeu_si128((__m128i *)cost_second_8x8,
  143|  4.03M|                   _mm256_extractf128_si256(partial4a, 1));
  144|       |
  145|  4.03M|  return partial4a;
  146|  4.03M|}
cdef_block_avx2.c:fold_mul_and_sum_avx2:
   25|  12.0M|                                            const __m256i *const2) {
   26|       |  // Mask used to shuffle the elements present in 256bit register.
   27|  12.0M|  static const int shuffle_reg_256bit[8] = { 0x0b0a0d0c, 0x07060908, 0x03020504,
   28|  12.0M|                                             0x0f0e0100, 0x0b0a0d0c, 0x07060908,
   29|  12.0M|                                             0x03020504, 0x0f0e0100 };
   30|  12.0M|  __m256i tmp;
   31|       |  /* Reverse partial B. */
   32|  12.0M|  *partialb = _mm256_shuffle_epi8(
   33|  12.0M|      *partialb, _mm256_loadu_si256((const __m256i *)shuffle_reg_256bit));
   34|       |
   35|       |  /* Interleave the x and y values of identical indices and pair x8 with 0. */
   36|  12.0M|  tmp = *partiala;
   37|  12.0M|  *partiala = _mm256_unpacklo_epi16(*partiala, *partialb);
   38|  12.0M|  *partialb = _mm256_unpackhi_epi16(tmp, *partialb);
   39|       |
   40|       |  /* Square and add the corresponding x and y values. */
   41|  12.0M|  *partiala = _mm256_madd_epi16(*partiala, *partiala);
   42|  12.0M|  *partialb = _mm256_madd_epi16(*partialb, *partialb);
   43|       |  /* Multiply by constant. */
   44|  12.0M|  *partiala = _mm256_mullo_epi32(*partiala, *const1);
   45|  12.0M|  *partialb = _mm256_mullo_epi32(*partialb, *const2);
   46|       |  /* Sum all results. */
   47|  12.0M|  *partiala = _mm256_add_epi32(*partiala, *partialb);
   48|  12.0M|  return *partiala;
   49|  12.0M|}
cdef_block_avx2.c:hsum4_avx2:
   52|  4.02M|                                 __m256i *x3) {
   53|  4.02M|  const __m256i t0 = _mm256_unpacklo_epi32(*x0, *x1);
   54|  4.02M|  const __m256i t1 = _mm256_unpacklo_epi32(*x2, *x3);
   55|  4.02M|  const __m256i t2 = _mm256_unpackhi_epi32(*x0, *x1);
   56|  4.02M|  const __m256i t3 = _mm256_unpackhi_epi32(*x2, *x3);
   57|       |
   58|  4.02M|  *x0 = _mm256_unpacklo_epi64(t0, t1);
   59|  4.02M|  *x1 = _mm256_unpackhi_epi64(t0, t1);
   60|  4.02M|  *x2 = _mm256_unpacklo_epi64(t2, t3);
   61|  4.02M|  *x3 = _mm256_unpackhi_epi64(t2, t3);
   62|  4.02M|  return _mm256_add_epi32(_mm256_add_epi32(*x0, *x1),
   63|  4.02M|                          _mm256_add_epi32(*x2, *x3));
   64|  4.02M|}
cdef_block_avx2.c:array_reverse_transpose_8x8_avx2:
  150|  2.01M|static inline void array_reverse_transpose_8x8_avx2(__m256i *in, __m256i *res) {
  151|  2.01M|  const __m256i tr0_0 = _mm256_unpacklo_epi16(in[0], in[1]);
  152|  2.01M|  const __m256i tr0_1 = _mm256_unpacklo_epi16(in[2], in[3]);
  153|  2.01M|  const __m256i tr0_2 = _mm256_unpackhi_epi16(in[0], in[1]);
  154|  2.01M|  const __m256i tr0_3 = _mm256_unpackhi_epi16(in[2], in[3]);
  155|  2.01M|  const __m256i tr0_4 = _mm256_unpacklo_epi16(in[4], in[5]);
  156|  2.01M|  const __m256i tr0_5 = _mm256_unpacklo_epi16(in[6], in[7]);
  157|  2.01M|  const __m256i tr0_6 = _mm256_unpackhi_epi16(in[4], in[5]);
  158|  2.01M|  const __m256i tr0_7 = _mm256_unpackhi_epi16(in[6], in[7]);
  159|       |
  160|  2.01M|  const __m256i tr1_0 = _mm256_unpacklo_epi32(tr0_0, tr0_1);
  161|  2.01M|  const __m256i tr1_1 = _mm256_unpacklo_epi32(tr0_4, tr0_5);
  162|  2.01M|  const __m256i tr1_2 = _mm256_unpackhi_epi32(tr0_0, tr0_1);
  163|  2.01M|  const __m256i tr1_3 = _mm256_unpackhi_epi32(tr0_4, tr0_5);
  164|  2.01M|  const __m256i tr1_4 = _mm256_unpacklo_epi32(tr0_2, tr0_3);
  165|  2.01M|  const __m256i tr1_5 = _mm256_unpacklo_epi32(tr0_6, tr0_7);
  166|  2.01M|  const __m256i tr1_6 = _mm256_unpackhi_epi32(tr0_2, tr0_3);
  167|  2.01M|  const __m256i tr1_7 = _mm256_unpackhi_epi32(tr0_6, tr0_7);
  168|       |
  169|  2.01M|  res[7] = _mm256_unpacklo_epi64(tr1_0, tr1_1);
  170|  2.01M|  res[6] = _mm256_unpackhi_epi64(tr1_0, tr1_1);
  171|  2.01M|  res[5] = _mm256_unpacklo_epi64(tr1_2, tr1_3);
  172|  2.01M|  res[4] = _mm256_unpackhi_epi64(tr1_2, tr1_3);
  173|  2.01M|  res[3] = _mm256_unpacklo_epi64(tr1_4, tr1_5);
  174|  2.01M|  res[2] = _mm256_unpackhi_epi64(tr1_4, tr1_5);
  175|  2.01M|  res[1] = _mm256_unpacklo_epi64(tr1_6, tr1_7);
  176|  2.01M|  res[0] = _mm256_unpackhi_epi64(tr1_6, tr1_7);
  177|  2.01M|}

cfl_get_predict_lbd_fn_avx2:
  278|  15.4M|cfl_predict_lbd_fn cfl_get_predict_lbd_fn_avx2(TX_SIZE tx_size) {
  279|  15.4M|  static const cfl_predict_lbd_fn pred[TX_SIZES_ALL] = {
  280|  15.4M|    cfl_predict_lbd_4x4_ssse3,   /* 4x4 */
  281|  15.4M|    cfl_predict_lbd_8x8_ssse3,   /* 8x8 */
  282|  15.4M|    cfl_predict_lbd_16x16_ssse3, /* 16x16 */
  283|  15.4M|    cfl_predict_lbd_32x32_avx2,  /* 32x32 */
  284|  15.4M|    NULL,                        /* 64x64 (invalid CFL size) */
  285|  15.4M|    cfl_predict_lbd_4x8_ssse3,   /* 4x8 */
  286|  15.4M|    cfl_predict_lbd_8x4_ssse3,   /* 8x4 */
  287|  15.4M|    cfl_predict_lbd_8x16_ssse3,  /* 8x16 */
  288|  15.4M|    cfl_predict_lbd_16x8_ssse3,  /* 16x8 */
  289|  15.4M|    cfl_predict_lbd_16x32_ssse3, /* 16x32 */
  290|  15.4M|    cfl_predict_lbd_32x16_avx2,  /* 32x16 */
  291|  15.4M|    NULL,                        /* 32x64 (invalid CFL size) */
  292|  15.4M|    NULL,                        /* 64x32 (invalid CFL size) */
  293|  15.4M|    cfl_predict_lbd_4x16_ssse3,  /* 4x16  */
  294|  15.4M|    cfl_predict_lbd_16x4_ssse3,  /* 16x4  */
  295|  15.4M|    cfl_predict_lbd_8x32_ssse3,  /* 8x32  */
  296|  15.4M|    cfl_predict_lbd_32x8_avx2,   /* 32x8  */
  297|  15.4M|    NULL,                        /* 16x64 (invalid CFL size) */
  298|  15.4M|    NULL,                        /* 64x16 (invalid CFL size) */
  299|  15.4M|  };
  300|       |  // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to index the
  301|       |  // function pointer array out of bounds.
  302|  15.4M|  return pred[tx_size % TX_SIZES_ALL];
  303|  15.4M|}
cfl_get_predict_hbd_fn_avx2:
  352|  7.02M|cfl_predict_hbd_fn cfl_get_predict_hbd_fn_avx2(TX_SIZE tx_size) {
  353|  7.02M|  static const cfl_predict_hbd_fn pred[TX_SIZES_ALL] = {
  354|  7.02M|    cfl_predict_hbd_4x4_ssse3,  /* 4x4 */
  355|  7.02M|    cfl_predict_hbd_8x8_ssse3,  /* 8x8 */
  356|  7.02M|    cfl_predict_hbd_16x16_avx2, /* 16x16 */
  357|  7.02M|    cfl_predict_hbd_32x32_avx2, /* 32x32 */
  358|  7.02M|    NULL,                       /* 64x64 (invalid CFL size) */
  359|  7.02M|    cfl_predict_hbd_4x8_ssse3,  /* 4x8 */
  360|  7.02M|    cfl_predict_hbd_8x4_ssse3,  /* 8x4 */
  361|  7.02M|    cfl_predict_hbd_8x16_ssse3, /* 8x16 */
  362|  7.02M|    cfl_predict_hbd_16x8_avx2,  /* 16x8 */
  363|  7.02M|    cfl_predict_hbd_16x32_avx2, /* 16x32 */
  364|  7.02M|    cfl_predict_hbd_32x16_avx2, /* 32x16 */
  365|  7.02M|    NULL,                       /* 32x64 (invalid CFL size) */
  366|  7.02M|    NULL,                       /* 64x32 (invalid CFL size) */
  367|  7.02M|    cfl_predict_hbd_4x16_ssse3, /* 4x16  */
  368|  7.02M|    cfl_predict_hbd_16x4_avx2,  /* 16x4  */
  369|  7.02M|    cfl_predict_hbd_8x32_ssse3, /* 8x32  */
  370|  7.02M|    cfl_predict_hbd_32x8_avx2,  /* 32x8  */
  371|  7.02M|    NULL,                       /* 16x64 (invalid CFL size) */
  372|  7.02M|    NULL,                       /* 64x16 (invalid CFL size) */
  373|  7.02M|  };
  374|       |  // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to index the
  375|       |  // function pointer array out of bounds.
  376|  7.02M|  return pred[tx_size % TX_SIZES_ALL];
  377|  7.02M|}
cfl_get_subtract_average_fn_avx2:
  470|  1.82M|cfl_subtract_average_fn cfl_get_subtract_average_fn_avx2(TX_SIZE tx_size) {
  471|  1.82M|  static const cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {
  472|  1.82M|    cfl_subtract_average_4x4_sse2,   /* 4x4 */
  473|  1.82M|    cfl_subtract_average_8x8_sse2,   /* 8x8 */
  474|  1.82M|    cfl_subtract_average_16x16_avx2, /* 16x16 */
  475|  1.82M|    cfl_subtract_average_32x32_avx2, /* 32x32 */
  476|  1.82M|    NULL,                            /* 64x64 (invalid CFL size) */
  477|  1.82M|    cfl_subtract_average_4x8_sse2,   /* 4x8 */
  478|  1.82M|    cfl_subtract_average_8x4_sse2,   /* 8x4 */
  479|  1.82M|    cfl_subtract_average_8x16_sse2,  /* 8x16 */
  480|  1.82M|    cfl_subtract_average_16x8_avx2,  /* 16x8 */
  481|  1.82M|    cfl_subtract_average_16x32_avx2, /* 16x32 */
  482|  1.82M|    cfl_subtract_average_32x16_avx2, /* 32x16 */
  483|  1.82M|    NULL,                            /* 32x64 (invalid CFL size) */
  484|  1.82M|    NULL,                            /* 64x32 (invalid CFL size) */
  485|  1.82M|    cfl_subtract_average_4x16_sse2,  /* 4x16 */
  486|  1.82M|    cfl_subtract_average_16x4_avx2,  /* 16x4 */
  487|  1.82M|    cfl_subtract_average_8x32_sse2,  /* 8x32 */
  488|  1.82M|    cfl_subtract_average_32x8_avx2,  /* 32x8 */
  489|  1.82M|    NULL,                            /* 16x64 (invalid CFL size) */
  490|  1.82M|    NULL,                            /* 64x16 (invalid CFL size) */
  491|  1.82M|  };
  492|       |  // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to
  493|       |  // index the function pointer array out of bounds.
  494|  1.82M|  return sub_avg[tx_size % TX_SIZES_ALL];
  495|  1.82M|}
cfl_avx2.c:cfl_luma_subsampling_420_lbd_avx2:
   64|  1.55k|                                              int height) {
   65|  1.55k|  (void)width;                               // Forever 32
   66|  1.55k|  const __m256i twos = _mm256_set1_epi8(2);  // Thirty two twos
   67|  1.55k|  const int luma_stride = input_stride << 1;
   68|  1.55k|  __m256i *row = (__m256i *)pred_buf_q3;
   69|  1.55k|  const __m256i *row_end = row + (height >> 1) * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|  1.55k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  1.55k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   70|  22.9k|  do {
   71|  22.9k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
   72|  22.9k|    __m256i bot = _mm256_loadu_si256((__m256i *)(input + input_stride));
   73|       |
   74|  22.9k|    __m256i top_16x16 = _mm256_maddubs_epi16(top, twos);
   75|  22.9k|    __m256i bot_16x16 = _mm256_maddubs_epi16(bot, twos);
   76|  22.9k|    __m256i sum_16x16 = _mm256_add_epi16(top_16x16, bot_16x16);
   77|       |
   78|  22.9k|    _mm256_storeu_si256(row, sum_16x16);
   79|       |
   80|  22.9k|    input += luma_stride;
   81|  22.9k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  22.9k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  22.9k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (81:12): [True: 21.4k, False: 1.55k]
  ------------------
   82|  1.55k|}
cfl_avx2.c:cfl_luma_subsampling_422_lbd_avx2:
   99|    543|                                              int height) {
  100|    543|  (void)width;                                // Forever 32
  101|    543|  const __m256i fours = _mm256_set1_epi8(4);  // Thirty two fours
  102|    543|  __m256i *row = (__m256i *)pred_buf_q3;
  103|    543|  const __m256i *row_end = row + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|    543|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|    543|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  104|  14.5k|  do {
  105|  14.5k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
  106|  14.5k|    __m256i top_16x16 = _mm256_maddubs_epi16(top, fours);
  107|  14.5k|    _mm256_storeu_si256(row, top_16x16);
  108|  14.5k|    input += input_stride;
  109|  14.5k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  14.5k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  14.5k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (109:12): [True: 14.0k, False: 543]
  ------------------
  110|    543|}
cfl_avx2.c:cfl_luma_subsampling_444_lbd_avx2:
  127|    466|                                              int height) {
  128|    466|  (void)width;  // Forever 32
  129|    466|  __m256i *row = (__m256i *)pred_buf_q3;
  130|    466|  const __m256i *row_end = row + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|    466|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|    466|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  131|    466|  const __m256i zeros = _mm256_setzero_si256();
  132|  11.6k|  do {
  133|  11.6k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
  134|  11.6k|    top = _mm256_permute4x64_epi64(top, _MM_SHUFFLE(3, 1, 2, 0));
  135|       |
  136|  11.6k|    __m256i row_lo = _mm256_unpacklo_epi8(top, zeros);
  137|  11.6k|    row_lo = _mm256_slli_epi16(row_lo, 3);
  138|  11.6k|    __m256i row_hi = _mm256_unpackhi_epi8(top, zeros);
  139|  11.6k|    row_hi = _mm256_slli_epi16(row_hi, 3);
  140|       |
  141|  11.6k|    _mm256_storeu_si256(row, row_lo);
  142|  11.6k|    _mm256_storeu_si256(row + 1, row_hi);
  143|       |
  144|  11.6k|    input += input_stride;
  145|  11.6k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  11.6k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  11.6k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (145:12): [True: 11.2k, False: 466]
  ------------------
  146|    466|}
cfl_avx2.c:cfl_luma_subsampling_420_hbd_avx2:
  166|    106|                                              int height) {
  167|    106|  (void)width;  // Forever 32
  168|    106|  const int luma_stride = input_stride << 1;
  169|    106|  __m256i *row = (__m256i *)pred_buf_q3;
  170|    106|  const __m256i *row_end = row + (height >> 1) * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|    106|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|    106|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  171|  1.04k|  do {
  172|  1.04k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
  173|  1.04k|    __m256i bot = _mm256_loadu_si256((__m256i *)(input + input_stride));
  174|  1.04k|    __m256i sum = _mm256_add_epi16(top, bot);
  175|       |
  176|  1.04k|    __m256i top_1 = _mm256_loadu_si256((__m256i *)(input + 16));
  177|  1.04k|    __m256i bot_1 = _mm256_loadu_si256((__m256i *)(input + 16 + input_stride));
  178|  1.04k|    __m256i sum_1 = _mm256_add_epi16(top_1, bot_1);
  179|       |
  180|  1.04k|    __m256i hsum = _mm256_hadd_epi16(sum, sum_1);
  181|  1.04k|    hsum = _mm256_permute4x64_epi64(hsum, _MM_SHUFFLE(3, 1, 2, 0));
  182|  1.04k|    hsum = _mm256_add_epi16(hsum, hsum);
  183|       |
  184|  1.04k|    _mm256_storeu_si256(row, hsum);
  185|       |
  186|  1.04k|    input += luma_stride;
  187|  1.04k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  1.04k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  1.04k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (187:12): [True: 942, False: 106]
  ------------------
  188|    106|}
cfl_avx2.c:cfl_luma_subsampling_422_hbd_avx2:
  206|    205|                                              int height) {
  207|    205|  (void)width;  // Forever 32
  208|    205|  __m256i *row = (__m256i *)pred_buf_q3;
  209|    205|  const __m256i *row_end = row + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|    205|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|    205|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  210|  3.37k|  do {
  211|  3.37k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
  212|  3.37k|    __m256i top_1 = _mm256_loadu_si256((__m256i *)(input + 16));
  213|  3.37k|    __m256i hsum = _mm256_hadd_epi16(top, top_1);
  214|  3.37k|    hsum = _mm256_permute4x64_epi64(hsum, _MM_SHUFFLE(3, 1, 2, 0));
  215|  3.37k|    hsum = _mm256_slli_epi16(hsum, 2);
  216|       |
  217|  3.37k|    _mm256_storeu_si256(row, hsum);
  218|       |
  219|  3.37k|    input += input_stride;
  220|  3.37k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  3.37k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  3.37k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (220:12): [True: 3.17k, False: 205]
  ------------------
  221|    205|}
cfl_avx2.c:cfl_luma_subsampling_444_hbd_avx2:
  228|    172|                                              int height) {
  229|    172|  (void)width;  // Forever 32
  230|    172|  __m256i *row = (__m256i *)pred_buf_q3;
  231|    172|  const __m256i *row_end = row + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|    172|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|    172|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  232|  2.81k|  do {
  233|  2.81k|    __m256i top = _mm256_loadu_si256((__m256i *)input);
  234|  2.81k|    __m256i top_1 = _mm256_loadu_si256((__m256i *)(input + 16));
  235|  2.81k|    _mm256_storeu_si256(row, _mm256_slli_epi16(top, 3));
  236|  2.81k|    _mm256_storeu_si256(row + 1, _mm256_slli_epi16(top_1, 3));
  237|  2.81k|    input += input_stride;
  238|  2.81k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|  2.81k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  2.81k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (238:12): [True: 2.64k, False: 172]
  ------------------
  239|    172|}
cfl_avx2.c:predict_unclipped:
  245|   680k|                                        __m256i alpha_sign, __m256i dc_q0) {
  246|   680k|  __m256i ac_q3 = _mm256_loadu_si256(input);
  247|   680k|  __m256i ac_sign = _mm256_sign_epi16(alpha_sign, ac_q3);
  248|   680k|  __m256i scaled_luma_q0 =
  249|   680k|      _mm256_mulhrs_epi16(_mm256_abs_epi16(ac_q3), alpha_q12);
  250|   680k|  scaled_luma_q0 = _mm256_sign_epi16(scaled_luma_q0, ac_sign);
  251|   680k|  return _mm256_add_epi16(scaled_luma_q0, dc_q0);
  252|   680k|}
cfl_avx2.c:cfl_predict_hbd_avx2:
  319|  67.7k|                                        int height) {
  320|       |  // Use SSSE3 version for smaller widths
  321|  67.7k|  assert(width == 16 || width == 32);
  322|  67.7k|  const __m256i alpha_sign = _mm256_set1_epi16(alpha_q3);
  323|  67.7k|  const __m256i alpha_q12 = _mm256_slli_epi16(_mm256_abs_epi16(alpha_sign), 9);
  324|  67.7k|  const __m256i dc_q0 = _mm256_loadu_si256((__m256i *)dst);
  325|  67.7k|  const __m256i max = highbd_max_epi16(bd);
  326|       |
  327|  67.7k|  __m256i *row = (__m256i *)pred_buf_q3;
  328|  67.7k|  const __m256i *row_end = row + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|  67.7k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  67.7k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  329|   680k|  do {
  330|   680k|    const __m256i res = predict_unclipped(row, alpha_q12, alpha_sign, dc_q0);
  331|   680k|    _mm256_storeu_si256((__m256i *)dst,
  332|   680k|                        highbd_clamp_epi16(res, _mm256_setzero_si256(), max));
  333|   680k|    if (width == 32) {
  ------------------
  |  Branch (333:9): [True: 0, False: 680k]
  ------------------
  334|      0|      const __m256i res_1 =
  335|      0|          predict_unclipped(row + 1, alpha_q12, alpha_sign, dc_q0);
  336|      0|      _mm256_storeu_si256(
  337|      0|          (__m256i *)(dst + 16),
  338|      0|          highbd_clamp_epi16(res_1, _mm256_setzero_si256(), max));
  339|      0|    }
  340|   680k|    dst += dst_stride;
  341|   680k|  } while ((row += CFL_BUF_LINE_I256) < row_end);
  ------------------
  |  |  524|   680k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|   680k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (341:12): [True: 612k, False: 67.7k]
  ------------------
  342|  67.7k|}
cfl_avx2.c:highbd_max_epi16:
  306|  67.7k|static __m256i highbd_max_epi16(int bd) {
  307|  67.7k|  const __m256i neg_one = _mm256_set1_epi16(-1);
  308|       |  // (1 << bd) - 1 => -(-1 << bd) -1 => -1 - (-1 << bd) => -1 ^ (-1 << bd)
  309|  67.7k|  return _mm256_xor_si256(_mm256_slli_epi16(neg_one, bd), neg_one);
  310|  67.7k|}
cfl_avx2.c:highbd_clamp_epi16:
  312|   680k|static __m256i highbd_clamp_epi16(__m256i u, __m256i zero, __m256i max) {
  313|   680k|  return _mm256_max_epi16(_mm256_min_epi16(u, max), zero);
  314|   680k|}
cfl_avx2.c:subtract_average_avx2:
  405|  20.0k|                                         int num_pel_log2) {
  406|       |  // Use SSE2 version for smaller widths
  407|  20.0k|  assert(width == 16 || width == 32);
  408|       |
  409|  20.0k|  const __m256i *src = (__m256i *)src_ptr;
  410|  20.0k|  const __m256i *const end = src + height * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|  20.0k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  20.0k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  411|       |  // To maximize usage of the AVX2 registers, we sum two rows per loop
  412|       |  // iteration
  413|  20.0k|  const int step = 2 * CFL_BUF_LINE_I256;
  ------------------
  |  |  524|  20.0k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|  20.0k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  414|       |
  415|  20.0k|  __m256i sum = _mm256_setzero_si256();
  416|       |  // For width 32, we use a second sum accumulator to reduce accumulator
  417|       |  // dependencies in the loop.
  418|  20.0k|  __m256i sum2;
  419|  20.0k|  if (width == 32) sum2 = _mm256_setzero_si256();
  ------------------
  |  Branch (419:7): [True: 0, False: 20.0k]
  ------------------
  420|       |
  421|   118k|  do {
  422|       |    // Add top row to the bottom row
  423|   118k|    __m256i l0 = _mm256_add_epi16(_mm256_loadu_si256(src),
  424|   118k|                                  _mm256_loadu_si256(src + CFL_BUF_LINE_I256));
  ------------------
  |  |  524|   118k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|   118k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  425|   118k|    sum = _mm256_add_epi32(sum, _mm256_addl_epi16(l0));
  426|   118k|    if (width == 32) { /* Don't worry, this if it gets optimized out. */
  ------------------
  |  Branch (426:9): [True: 0, False: 118k]
  ------------------
  427|       |      // Add the second part of the top row to the second part of the bottom row
  428|      0|      __m256i l1 =
  429|      0|          _mm256_add_epi16(_mm256_loadu_si256(src + 1),
  430|      0|                           _mm256_loadu_si256(src + 1 + CFL_BUF_LINE_I256));
  ------------------
  |  |  524|      0|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|      0|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  431|      0|      sum2 = _mm256_add_epi32(sum2, _mm256_addl_epi16(l1));
  432|      0|    }
  433|   118k|    src += step;
  434|   118k|  } while (src < end);
  ------------------
  |  Branch (434:12): [True: 98.6k, False: 20.0k]
  ------------------
  435|       |  // Combine both sum accumulators
  436|  20.0k|  if (width == 32) sum = _mm256_add_epi32(sum, sum2);
  ------------------
  |  Branch (436:7): [True: 0, False: 20.0k]
  ------------------
  437|       |
  438|  20.0k|  __m256i fill = fill_sum_epi32(sum);
  439|       |
  440|  20.0k|  __m256i avg_epi16 = _mm256_srli_epi32(
  441|  20.0k|      _mm256_add_epi32(fill, _mm256_set1_epi32(round_offset)), num_pel_log2);
  442|  20.0k|  avg_epi16 = _mm256_packs_epi32(avg_epi16, avg_epi16);
  443|       |
  444|       |  // Store and subtract loop
  445|  20.0k|  src = (__m256i *)src_ptr;
  446|  20.0k|  __m256i *dst = (__m256i *)dst_ptr;
  447|   237k|  do {
  448|   237k|    _mm256_storeu_si256(dst,
  449|   237k|                        _mm256_sub_epi16(_mm256_loadu_si256(src), avg_epi16));
  450|   237k|    if (width == 32) {
  ------------------
  |  Branch (450:9): [True: 0, False: 237k]
  ------------------
  451|      0|      _mm256_storeu_si256(
  452|      0|          dst + 1, _mm256_sub_epi16(_mm256_loadu_si256(src + 1), avg_epi16));
  453|      0|    }
  454|   237k|    src += CFL_BUF_LINE_I256;
  ------------------
  |  |  524|   237k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|   237k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  455|   237k|    dst += CFL_BUF_LINE_I256;
  ------------------
  |  |  524|   237k|#define CFL_BUF_LINE_I256 (CFL_BUF_LINE >> 4)
  |  |  ------------------
  |  |  |  |  522|   237k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  456|   237k|  } while (src < end);
  ------------------
  |  Branch (456:12): [True: 217k, False: 20.0k]
  ------------------
  457|  20.0k|}
cfl_avx2.c:_mm256_addl_epi16:
  397|   118k|static inline __m256i _mm256_addl_epi16(__m256i a) {
  398|   118k|  return _mm256_add_epi32(_mm256_unpacklo_epi16(a, _mm256_setzero_si256()),
  399|   118k|                          _mm256_unpackhi_epi16(a, _mm256_setzero_si256()));
  400|   118k|}
cfl_avx2.c:fill_sum_epi32:
  382|  20.0k|static inline __m256i fill_sum_epi32(__m256i a) {
  383|       |  // Given that a == [A, B, C, D, E, F, G, H]
  384|  20.0k|  a = _mm256_hadd_epi32(a, a);
  385|       |  // Given that A' == A + B, C' == C + D, E' == E + F, G' == G + H
  386|       |  // a == [A', C', A', C', E', G', E', G']
  387|  20.0k|  a = _mm256_permute4x64_epi64(a, _MM_SHUFFLE(3, 1, 2, 0));
  388|       |  // a == [A', C', E', G', A', C', E', G']
  389|  20.0k|  a = _mm256_hadd_epi32(a, a);
  390|       |  // Given that A'' == A' + C' and E'' == E' + G'
  391|       |  // a == [A'', E'', A'', E'', A'', E'', A'', E'']
  392|  20.0k|  return _mm256_hadd_epi32(a, a);
  393|       |  // Given that A''' == A'' + E''
  394|       |  // a == [A''', A''', A''', A''', A''', A''', A''', A''']
  395|  20.0k|}

cfl_sse2.c:subtract_average_sse2:
   25|  1.80M|                                         int num_pel_log2) {
   26|  1.80M|  const __m128i zeros = _mm_setzero_si128();
   27|  1.80M|  const __m128i round_offset_epi32 = _mm_set1_epi32(round_offset);
   28|  1.80M|  const __m128i *src = (__m128i *)src_ptr;
   29|  1.80M|  const __m128i *const end = src + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  1.80M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.80M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   30|  1.80M|  const int step = CFL_BUF_LINE_I128 * (1 + (width == 8) + 3 * (width == 4));
  ------------------
  |  |  523|  1.80M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.80M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   31|       |
   32|  1.80M|  __m128i sum = zeros;
   33|  3.45M|  do {
   34|  3.45M|    __m128i l0;
   35|  3.45M|    if (width == 4) {
  ------------------
  |  Branch (35:9): [True: 1.83M, False: 1.62M]
  ------------------
   36|  1.83M|      l0 = _mm_add_epi16(_mm_loadl_epi64(src),
   37|  1.83M|                         _mm_loadl_epi64(src + CFL_BUF_LINE_I128));
  ------------------
  |  |  523|  1.83M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.83M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   38|  1.83M|      __m128i l1 = _mm_add_epi16(_mm_loadl_epi64(src + 2 * CFL_BUF_LINE_I128),
  ------------------
  |  |  523|  1.83M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.83M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   39|  1.83M|                                 _mm_loadl_epi64(src + 3 * CFL_BUF_LINE_I128));
  ------------------
  |  |  523|  1.83M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.83M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   40|  1.83M|      sum = _mm_add_epi32(sum, _mm_add_epi32(_mm_unpacklo_epi16(l0, zeros),
   41|  1.83M|                                             _mm_unpacklo_epi16(l1, zeros)));
   42|  1.83M|    } else {
   43|  1.62M|      if (width == 8) {
  ------------------
  |  Branch (43:11): [True: 1.62M, False: 18.4E]
  ------------------
   44|  1.62M|        l0 = _mm_add_epi16(_mm_loadu_si128(src),
   45|  1.62M|                           _mm_loadu_si128(src + CFL_BUF_LINE_I128));
  ------------------
  |  |  523|  1.62M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.62M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   46|  18.4E|      } else {
   47|  18.4E|        l0 = _mm_add_epi16(_mm_loadu_si128(src), _mm_loadu_si128(src + 1));
   48|  18.4E|      }
   49|  1.62M|      sum = _mm_add_epi32(sum, _mm_add_epi32(_mm_unpacklo_epi16(l0, zeros),
   50|  1.62M|                                             _mm_unpackhi_epi16(l0, zeros)));
   51|  1.62M|      if (width == 32) {
  ------------------
  |  Branch (51:11): [True: 0, False: 1.62M]
  ------------------
   52|      0|        l0 = _mm_add_epi16(_mm_loadu_si128(src + 2), _mm_loadu_si128(src + 3));
   53|      0|        sum = _mm_add_epi32(sum, _mm_add_epi32(_mm_unpacklo_epi16(l0, zeros),
   54|      0|                                               _mm_unpackhi_epi16(l0, zeros)));
   55|      0|      }
   56|  1.62M|    }
   57|  3.45M|    src += step;
   58|  3.45M|  } while (src < end);
  ------------------
  |  Branch (58:12): [True: 1.65M, False: 1.80M]
  ------------------
   59|       |
   60|  1.80M|  sum = fill_sum_epi32(sum);
   61|       |
   62|  1.80M|  __m128i avg_epi16 =
   63|  1.80M|      _mm_srli_epi32(_mm_add_epi32(sum, round_offset_epi32), num_pel_log2);
   64|  1.80M|  avg_epi16 = _mm_packs_epi32(avg_epi16, avg_epi16);
   65|       |
   66|  1.80M|  src = (__m128i *)src_ptr;
   67|  1.80M|  __m128i *dst = (__m128i *)dst_ptr;
   68|  10.5M|  do {
   69|  10.5M|    if (width == 4) {
  ------------------
  |  Branch (69:9): [True: 7.32M, False: 3.24M]
  ------------------
   70|  7.32M|      _mm_storel_epi64(dst, _mm_sub_epi16(_mm_loadl_epi64(src), avg_epi16));
   71|  7.32M|    } else {
   72|  3.24M|      _mm_storeu_si128(dst, _mm_sub_epi16(_mm_loadu_si128(src), avg_epi16));
   73|  3.24M|      if (width > 8) {
  ------------------
  |  Branch (73:11): [True: 0, False: 3.24M]
  ------------------
   74|      0|        _mm_storeu_si128(dst + 1,
   75|      0|                         _mm_sub_epi16(_mm_loadu_si128(src + 1), avg_epi16));
   76|      0|        if (width == 32) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|          _mm_storeu_si128(dst + 2,
   78|      0|                           _mm_sub_epi16(_mm_loadu_si128(src + 2), avg_epi16));
   79|      0|          _mm_storeu_si128(dst + 3,
   80|      0|                           _mm_sub_epi16(_mm_loadu_si128(src + 3), avg_epi16));
   81|      0|        }
   82|      0|      }
   83|  3.24M|    }
   84|  10.5M|    src += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  10.5M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  10.5M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   85|  10.5M|    dst += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  10.5M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  10.5M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   86|  10.5M|  } while (src < end);
  ------------------
  |  Branch (86:12): [True: 8.77M, False: 1.80M]
  ------------------
   87|  1.80M|}
cfl_sse2.c:fill_sum_epi32:
   17|  1.80M|static inline __m128i fill_sum_epi32(__m128i l0) {
   18|  1.80M|  l0 = _mm_add_epi32(l0, _mm_shuffle_epi32(l0, _MM_SHUFFLE(1, 0, 3, 2)));
   19|       |  return _mm_add_epi32(l0, _mm_shuffle_epi32(l0, _MM_SHUFFLE(2, 3, 0, 1)));
   20|  1.80M|}

cfl_ssse3.c:cfl_luma_subsampling_420_lbd_ssse3:
   43|  1.23M|                                                      int width, int height) {
   44|  1.23M|  const __m128i twos = _mm_set1_epi8(2);
   45|  1.23M|  __m128i *pred_buf_m128i = (__m128i *)pred_buf_q3;
   46|  1.23M|  const __m128i *end = pred_buf_m128i + (height >> 1) * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  1.23M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  1.23M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   47|  1.23M|  const int luma_stride = input_stride << 1;
   48|  3.78M|  do {
   49|  3.78M|    if (width == 4) {
  ------------------
  |  Branch (49:9): [True: 1.28M, False: 2.50M]
  ------------------
   50|  1.28M|      __m128i top = _mm_loadh_epi32((__m128i *)input);
   51|  1.28M|      top = _mm_maddubs_epi16(top, twos);
   52|  1.28M|      __m128i bot = _mm_loadh_epi32((__m128i *)(input + input_stride));
   53|  1.28M|      bot = _mm_maddubs_epi16(bot, twos);
   54|  1.28M|      const __m128i sum = _mm_add_epi16(top, bot);
   55|  1.28M|      _mm_storeh_epi32(pred_buf_m128i, sum);
   56|  2.50M|    } else if (width == 8) {
  ------------------
  |  Branch (56:16): [True: 2.32M, False: 182k]
  ------------------
   57|  2.32M|      __m128i top = _mm_loadl_epi64((__m128i *)input);
   58|  2.32M|      top = _mm_maddubs_epi16(top, twos);
   59|  2.32M|      __m128i bot = _mm_loadl_epi64((__m128i *)(input + input_stride));
   60|  2.32M|      bot = _mm_maddubs_epi16(bot, twos);
   61|  2.32M|      const __m128i sum = _mm_add_epi16(top, bot);
   62|  2.32M|      _mm_storel_epi64(pred_buf_m128i, sum);
   63|  2.32M|    } else {
   64|   182k|      __m128i top = _mm_loadu_si128((__m128i *)input);
   65|   182k|      top = _mm_maddubs_epi16(top, twos);
   66|   182k|      __m128i bot = _mm_loadu_si128((__m128i *)(input + input_stride));
   67|   182k|      bot = _mm_maddubs_epi16(bot, twos);
   68|   182k|      const __m128i sum = _mm_add_epi16(top, bot);
   69|   182k|      _mm_storeu_si128(pred_buf_m128i, sum);
   70|   182k|      if (width == 32) {
  ------------------
  |  Branch (70:11): [True: 0, False: 182k]
  ------------------
   71|      0|        __m128i top_1 = _mm_loadu_si128(((__m128i *)input) + 1);
   72|      0|        __m128i bot_1 =
   73|      0|            _mm_loadu_si128(((__m128i *)(input + input_stride)) + 1);
   74|      0|        top_1 = _mm_maddubs_epi16(top_1, twos);
   75|      0|        bot_1 = _mm_maddubs_epi16(bot_1, twos);
   76|      0|        __m128i sum_1 = _mm_add_epi16(top_1, bot_1);
   77|      0|        _mm_storeu_si128(pred_buf_m128i + 1, sum_1);
   78|      0|      }
   79|   182k|    }
   80|  3.78M|    input += luma_stride;
   81|  3.78M|    pred_buf_m128i += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  3.78M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  3.78M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
   82|  3.78M|  } while (pred_buf_m128i < end);
  ------------------
  |  Branch (82:12): [True: 2.54M, False: 1.23M]
  ------------------
   83|  1.23M|}
cfl_ssse3.c:_mm_loadh_epi32:
   21|  4.59M|static inline __m128i _mm_loadh_epi32(__m128i const *mem_addr) {
   22|  4.59M|  return _mm_cvtsi32_si128(*((int *)mem_addr));
   23|  4.59M|}
cfl_ssse3.c:_mm_storeh_epi32:
   26|  65.7M|static inline void _mm_storeh_epi32(__m128i const *mem_addr, __m128i a) {
   27|  65.7M|  *((int *)mem_addr) = _mm_cvtsi128_si32(a);
   28|  65.7M|}
cfl_ssse3.c:cfl_luma_subsampling_422_lbd_ssse3:
   98|   599k|                                                      int width, int height) {
   99|   599k|  const __m128i fours = _mm_set1_epi8(4);
  100|   599k|  __m128i *pred_buf_m128i = (__m128i *)pred_buf_q3;
  101|   599k|  const __m128i *end = pred_buf_m128i + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|   599k|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|   599k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  102|  3.70M|  do {
  103|  3.70M|    if (width == 4) {
  ------------------
  |  Branch (103:9): [True: 1.17M, False: 2.52M]
  ------------------
  104|  1.17M|      __m128i top = _mm_loadh_epi32((__m128i *)input);
  105|  1.17M|      top = _mm_maddubs_epi16(top, fours);
  106|  1.17M|      _mm_storeh_epi32(pred_buf_m128i, top);
  107|  2.52M|    } else if (width == 8) {
  ------------------
  |  Branch (107:16): [True: 2.31M, False: 212k]
  ------------------
  108|  2.31M|      __m128i top = _mm_loadl_epi64((__m128i *)input);
  109|  2.31M|      top = _mm_maddubs_epi16(top, fours);
  110|  2.31M|      _mm_storel_epi64(pred_buf_m128i, top);
  111|  2.31M|    } else {
  112|   212k|      __m128i top = _mm_loadu_si128((__m128i *)input);
  113|   212k|      top = _mm_maddubs_epi16(top, fours);
  114|   212k|      _mm_storeu_si128(pred_buf_m128i, top);
  115|   212k|      if (width == 32) {
  ------------------
  |  Branch (115:11): [True: 0, False: 212k]
  ------------------
  116|      0|        __m128i top_1 = _mm_loadu_si128(((__m128i *)input) + 1);
  117|      0|        top_1 = _mm_maddubs_epi16(top_1, fours);
  118|      0|        _mm_storeu_si128(pred_buf_m128i + 1, top_1);
  119|      0|      }
  120|   212k|    }
  121|  3.70M|    input += input_stride;
  122|  3.70M|    pred_buf_m128i += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  3.70M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  3.70M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  123|  3.70M|  } while (pred_buf_m128i < end);
  ------------------
  |  Branch (123:12): [True: 3.10M, False: 599k]
  ------------------
  124|   599k|}
cfl_ssse3.c:cfl_luma_subsampling_444_lbd_ssse3:
  138|   464k|                                                      int width, int height) {
  139|   464k|  const __m128i zeros = _mm_setzero_si128();
  140|   464k|  const int luma_stride = input_stride;
  141|   464k|  __m128i *pred_buf_m128i = (__m128i *)pred_buf_q3;
  142|   464k|  const __m128i *end = pred_buf_m128i + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|   464k|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|   464k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  143|  2.96M|  do {
  144|  2.96M|    if (width == 4) {
  ------------------
  |  Branch (144:9): [True: 855k, False: 2.11M]
  ------------------
  145|   855k|      __m128i row = _mm_loadh_epi32((__m128i *)input);
  146|   855k|      row = _mm_unpacklo_epi8(row, zeros);
  147|   855k|      _mm_storel_epi64(pred_buf_m128i, _mm_slli_epi16(row, 3));
  148|  2.11M|    } else if (width == 8) {
  ------------------
  |  Branch (148:16): [True: 1.96M, False: 148k]
  ------------------
  149|  1.96M|      __m128i row = _mm_loadl_epi64((__m128i *)input);
  150|  1.96M|      row = _mm_unpacklo_epi8(row, zeros);
  151|  1.96M|      _mm_storeu_si128(pred_buf_m128i, _mm_slli_epi16(row, 3));
  152|  1.96M|    } else {
  153|   148k|      __m128i row = _mm_loadu_si128((__m128i *)input);
  154|   148k|      const __m128i row_lo = _mm_unpacklo_epi8(row, zeros);
  155|   148k|      const __m128i row_hi = _mm_unpackhi_epi8(row, zeros);
  156|   148k|      _mm_storeu_si128(pred_buf_m128i, _mm_slli_epi16(row_lo, 3));
  157|   148k|      _mm_storeu_si128(pred_buf_m128i + 1, _mm_slli_epi16(row_hi, 3));
  158|   148k|      if (width == 32) {
  ------------------
  |  Branch (158:11): [True: 0, False: 148k]
  ------------------
  159|      0|        __m128i row_1 = _mm_loadu_si128(((__m128i *)input) + 1);
  160|      0|        const __m128i row_1_lo = _mm_unpacklo_epi8(row_1, zeros);
  161|      0|        const __m128i row_1_hi = _mm_unpackhi_epi8(row_1, zeros);
  162|      0|        _mm_storeu_si128(pred_buf_m128i + 2, _mm_slli_epi16(row_1_lo, 3));
  163|      0|        _mm_storeu_si128(pred_buf_m128i + 3, _mm_slli_epi16(row_1_hi, 3));
  164|      0|      }
  165|   148k|    }
  166|  2.96M|    input += luma_stride;
  167|  2.96M|    pred_buf_m128i += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  2.96M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  2.96M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  168|  2.96M|  } while (pred_buf_m128i < end);
  ------------------
  |  Branch (168:12): [True: 2.50M, False: 464k]
  ------------------
  169|   464k|}
cfl_ssse3.c:cfl_luma_subsampling_420_hbd_ssse3:
  185|   293k|                                                      int width, int height) {
  186|   293k|  const uint16_t *end = pred_buf_q3 + (height >> 1) * CFL_BUF_LINE;
  ------------------
  |  |  522|   293k|#define CFL_BUF_LINE (32)
  ------------------
  187|   293k|  const int luma_stride = input_stride << 1;
  188|   756k|  do {
  189|   756k|    if (width == 4) {
  ------------------
  |  Branch (189:9): [True: 490k, False: 266k]
  ------------------
  190|   490k|      const __m128i top = _mm_loadl_epi64((__m128i *)input);
  191|   490k|      const __m128i bot = _mm_loadl_epi64((__m128i *)(input + input_stride));
  192|   490k|      __m128i sum = _mm_add_epi16(top, bot);
  193|   490k|      sum = _mm_hadd_epi16(sum, sum);
  194|   490k|      *((int *)pred_buf_q3) = _mm_cvtsi128_si32(_mm_add_epi16(sum, sum));
  195|   490k|    } else {
  196|   266k|      const __m128i top = _mm_loadu_si128((__m128i *)input);
  197|   266k|      const __m128i bot = _mm_loadu_si128((__m128i *)(input + input_stride));
  198|   266k|      __m128i sum = _mm_add_epi16(top, bot);
  199|   266k|      if (width == 8) {
  ------------------
  |  Branch (199:11): [True: 249k, False: 17.0k]
  ------------------
  200|   249k|        sum = _mm_hadd_epi16(sum, sum);
  201|   249k|        _mm_storel_epi64((__m128i *)pred_buf_q3, _mm_add_epi16(sum, sum));
  202|   249k|      } else {
  203|  17.0k|        const __m128i top_1 = _mm_loadu_si128(((__m128i *)input) + 1);
  204|  17.0k|        const __m128i bot_1 =
  205|  17.0k|            _mm_loadu_si128(((__m128i *)(input + input_stride)) + 1);
  206|  17.0k|        sum = _mm_hadd_epi16(sum, _mm_add_epi16(top_1, bot_1));
  207|  17.0k|        _mm_storeu_si128((__m128i *)pred_buf_q3, _mm_add_epi16(sum, sum));
  208|  17.0k|        if (width == 32) {
  ------------------
  |  Branch (208:13): [True: 0, False: 17.0k]
  ------------------
  209|      0|          const __m128i top_2 = _mm_loadu_si128(((__m128i *)input) + 2);
  210|      0|          const __m128i bot_2 =
  211|      0|              _mm_loadu_si128(((__m128i *)(input + input_stride)) + 2);
  212|      0|          const __m128i top_3 = _mm_loadu_si128(((__m128i *)input) + 3);
  213|      0|          const __m128i bot_3 =
  214|      0|              _mm_loadu_si128(((__m128i *)(input + input_stride)) + 3);
  215|      0|          const __m128i sum_2 = _mm_add_epi16(top_2, bot_2);
  216|      0|          const __m128i sum_3 = _mm_add_epi16(top_3, bot_3);
  217|      0|          __m128i next_sum = _mm_hadd_epi16(sum_2, sum_3);
  218|      0|          _mm_storeu_si128(((__m128i *)pred_buf_q3) + 1,
  219|      0|                           _mm_add_epi16(next_sum, next_sum));
  220|      0|        }
  221|  17.0k|      }
  222|   266k|    }
  223|   756k|    input += luma_stride;
  224|   756k|  } while ((pred_buf_q3 += CFL_BUF_LINE) < end);
  ------------------
  |  |  522|   756k|#define CFL_BUF_LINE (32)
  ------------------
  |  Branch (224:12): [True: 463k, False: 293k]
  ------------------
  225|   293k|}
cfl_ssse3.c:cfl_luma_subsampling_422_hbd_ssse3:
  240|   199k|                                                      int width, int height) {
  241|   199k|  __m128i *pred_buf_m128i = (__m128i *)pred_buf_q3;
  242|   199k|  const __m128i *end = pred_buf_m128i + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|   199k|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|   199k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  243|   972k|  do {
  244|   972k|    if (width == 4) {
  ------------------
  |  Branch (244:9): [True: 539k, False: 433k]
  ------------------
  245|   539k|      const __m128i top = _mm_loadl_epi64((__m128i *)input);
  246|   539k|      const __m128i sum = _mm_slli_epi16(_mm_hadd_epi16(top, top), 2);
  247|   539k|      _mm_storeh_epi32(pred_buf_m128i, sum);
  248|   539k|    } else {
  249|   433k|      const __m128i top = _mm_loadu_si128((__m128i *)input);
  250|   433k|      if (width == 8) {
  ------------------
  |  Branch (250:11): [True: 391k, False: 41.5k]
  ------------------
  251|   391k|        const __m128i sum = _mm_slli_epi16(_mm_hadd_epi16(top, top), 2);
  252|   391k|        _mm_storel_epi64(pred_buf_m128i, sum);
  253|   391k|      } else {
  254|  41.5k|        const __m128i top_1 = _mm_loadu_si128(((__m128i *)input) + 1);
  255|  41.5k|        const __m128i sum = _mm_slli_epi16(_mm_hadd_epi16(top, top_1), 2);
  256|  41.5k|        _mm_storeu_si128(pred_buf_m128i, sum);
  257|  41.5k|        if (width == 32) {
  ------------------
  |  Branch (257:13): [True: 0, False: 41.5k]
  ------------------
  258|      0|          const __m128i top_2 = _mm_loadu_si128(((__m128i *)input) + 2);
  259|      0|          const __m128i top_3 = _mm_loadu_si128(((__m128i *)input) + 3);
  260|      0|          const __m128i sum_1 = _mm_slli_epi16(_mm_hadd_epi16(top_2, top_3), 2);
  261|      0|          _mm_storeu_si128(pred_buf_m128i + 1, sum_1);
  262|      0|        }
  263|  41.5k|      }
  264|   433k|    }
  265|   972k|    pred_buf_m128i += CFL_BUF_LINE_I128;
  ------------------
  |  |  523|   972k|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|   972k|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  266|   972k|    input += input_stride;
  267|   972k|  } while (pred_buf_m128i < end);
  ------------------
  |  Branch (267:12): [True: 773k, False: 199k]
  ------------------
  268|   199k|}
cfl_ssse3.c:cfl_luma_subsampling_444_hbd_ssse3:
  273|   209k|                                                      int width, int height) {
  274|   209k|  const uint16_t *end = pred_buf_q3 + height * CFL_BUF_LINE;
  ------------------
  |  |  522|   209k|#define CFL_BUF_LINE (32)
  ------------------
  275|  1.12M|  do {
  276|  1.12M|    if (width == 4) {
  ------------------
  |  Branch (276:9): [True: 663k, False: 456k]
  ------------------
  277|   663k|      const __m128i row = _mm_slli_epi16(_mm_loadl_epi64((__m128i *)input), 3);
  278|   663k|      _mm_storel_epi64((__m128i *)pred_buf_q3, row);
  279|   663k|    } else {
  280|   456k|      const __m128i row = _mm_slli_epi16(_mm_loadu_si128((__m128i *)input), 3);
  281|   456k|      _mm_storeu_si128((__m128i *)pred_buf_q3, row);
  282|   456k|      if (width >= 16) {
  ------------------
  |  Branch (282:11): [True: 42.0k, False: 414k]
  ------------------
  283|  42.0k|        __m128i row_1 = _mm_loadu_si128(((__m128i *)input) + 1);
  284|  42.0k|        row_1 = _mm_slli_epi16(row_1, 3);
  285|  42.0k|        _mm_storeu_si128(((__m128i *)pred_buf_q3) + 1, row_1);
  286|  42.0k|        if (width == 32) {
  ------------------
  |  Branch (286:13): [True: 0, False: 42.0k]
  ------------------
  287|      0|          __m128i row_2 = _mm_loadu_si128(((__m128i *)input) + 2);
  288|      0|          row_2 = _mm_slli_epi16(row_2, 3);
  289|      0|          _mm_storeu_si128(((__m128i *)pred_buf_q3) + 2, row_2);
  290|      0|          __m128i row_3 = _mm_loadu_si128(((__m128i *)input) + 3);
  291|      0|          row_3 = _mm_slli_epi16(row_3, 3);
  292|      0|          _mm_storeu_si128(((__m128i *)pred_buf_q3) + 3, row_3);
  293|      0|        }
  294|  42.0k|      }
  295|   456k|    }
  296|  1.12M|    input += input_stride;
  297|  1.12M|    pred_buf_q3 += CFL_BUF_LINE;
  ------------------
  |  |  522|  1.12M|#define CFL_BUF_LINE (32)
  ------------------
  298|  1.12M|  } while (pred_buf_q3 < end);
  ------------------
  |  Branch (298:12): [True: 910k, False: 209k]
  ------------------
  299|   209k|}
cfl_ssse3.c:cfl_predict_lbd_ssse3:
  315|  15.4M|                                         int alpha_q3, int width, int height) {
  316|  15.4M|  const __m128i alpha_sign = _mm_set1_epi16(alpha_q3);
  317|  15.4M|  const __m128i alpha_q12 = _mm_slli_epi16(_mm_abs_epi16(alpha_sign), 9);
  318|  15.4M|  const __m128i dc_q0 = _mm_set1_epi16(*dst);
  319|  15.4M|  __m128i *row = (__m128i *)pred_buf_q3;
  320|  15.4M|  const __m128i *row_end = row + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  15.4M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  15.4M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  321|  92.5M|  do {
  322|  92.5M|    __m128i res = predict_unclipped(row, alpha_q12, alpha_sign, dc_q0);
  323|  92.5M|    if (width < 16) {
  ------------------
  |  Branch (323:9): [True: 89.6M, False: 2.83M]
  ------------------
  324|  89.6M|      res = _mm_packus_epi16(res, res);
  325|  89.6M|      if (width == 4)
  ------------------
  |  Branch (325:11): [True: 62.7M, False: 26.9M]
  ------------------
  326|  62.7M|        _mm_storeh_epi32((__m128i *)dst, res);
  327|  26.9M|      else
  328|  26.9M|        _mm_storel_epi64((__m128i *)dst, res);
  329|  89.6M|    } else {
  330|  2.83M|      __m128i next = predict_unclipped(row + 1, alpha_q12, alpha_sign, dc_q0);
  331|  2.83M|      res = _mm_packus_epi16(res, next);
  332|  2.83M|      _mm_storeu_si128((__m128i *)dst, res);
  333|  2.83M|      if (width == 32) {
  ------------------
  |  Branch (333:11): [True: 0, False: 2.83M]
  ------------------
  334|      0|        res = predict_unclipped(row + 2, alpha_q12, alpha_sign, dc_q0);
  335|      0|        next = predict_unclipped(row + 3, alpha_q12, alpha_sign, dc_q0);
  336|      0|        res = _mm_packus_epi16(res, next);
  337|      0|        _mm_storeu_si128((__m128i *)(dst + 16), res);
  338|      0|      }
  339|  2.83M|    }
  340|  92.5M|    dst += dst_stride;
  341|  92.5M|  } while ((row += CFL_BUF_LINE_I128) < row_end);
  ------------------
  |  |  523|  92.5M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  92.5M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (341:12): [True: 77.1M, False: 15.4M]
  ------------------
  342|  15.4M|}
cfl_ssse3.c:predict_unclipped:
  305|   130M|                                        __m128i alpha_sign, __m128i dc_q0) {
  306|   130M|  __m128i ac_q3 = _mm_loadu_si128(input);
  307|   130M|  __m128i ac_sign = _mm_sign_epi16(alpha_sign, ac_q3);
  308|   130M|  __m128i scaled_luma_q0 = _mm_mulhrs_epi16(_mm_abs_epi16(ac_q3), alpha_q12);
  309|   130M|  scaled_luma_q0 = _mm_sign_epi16(scaled_luma_q0, ac_sign);
  310|   130M|  return _mm_add_epi16(scaled_luma_q0, dc_q0);
  311|   130M|}
cfl_ssse3.c:cfl_predict_hbd_ssse3:
  360|  6.95M|                                         int height) {
  361|  6.95M|  const __m128i alpha_sign = _mm_set1_epi16(alpha_q3);
  362|  6.95M|  const __m128i alpha_q12 = _mm_slli_epi16(_mm_abs_epi16(alpha_sign), 9);
  363|  6.95M|  const __m128i dc_q0 = _mm_set1_epi16(*dst);
  364|  6.95M|  const __m128i max = highbd_max_epi16(bd);
  365|  6.95M|  const __m128i zeros = _mm_setzero_si128();
  366|  6.95M|  __m128i *row = (__m128i *)pred_buf_q3;
  367|  6.95M|  const __m128i *row_end = row + height * CFL_BUF_LINE_I128;
  ------------------
  |  |  523|  6.95M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  6.95M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  368|  35.2M|  do {
  369|  35.2M|    __m128i res = predict_unclipped(row, alpha_q12, alpha_sign, dc_q0);
  370|  35.2M|    res = highbd_clamp_epi16(res, zeros, max);
  371|  35.2M|    if (width == 4) {
  ------------------
  |  Branch (371:9): [True: 27.4M, False: 7.77M]
  ------------------
  372|  27.4M|      _mm_storel_epi64((__m128i *)dst, res);
  373|  27.4M|    } else {
  374|  7.77M|      _mm_storeu_si128((__m128i *)dst, res);
  375|  7.77M|    }
  376|  35.2M|    if (width >= 16) {
  ------------------
  |  Branch (376:9): [True: 0, False: 35.2M]
  ------------------
  377|      0|      const __m128i res_1 =
  378|      0|          predict_unclipped(row + 1, alpha_q12, alpha_sign, dc_q0);
  379|      0|      _mm_storeu_si128(((__m128i *)dst) + 1,
  380|      0|                       highbd_clamp_epi16(res_1, zeros, max));
  381|      0|    }
  382|  35.2M|    if (width == 32) {
  ------------------
  |  Branch (382:9): [True: 0, False: 35.2M]
  ------------------
  383|      0|      const __m128i res_2 =
  384|      0|          predict_unclipped(row + 2, alpha_q12, alpha_sign, dc_q0);
  385|      0|      _mm_storeu_si128((__m128i *)(dst + 16),
  386|      0|                       highbd_clamp_epi16(res_2, zeros, max));
  387|      0|      const __m128i res_3 =
  388|      0|          predict_unclipped(row + 3, alpha_q12, alpha_sign, dc_q0);
  389|      0|      _mm_storeu_si128((__m128i *)(dst + 24),
  390|      0|                       highbd_clamp_epi16(res_3, zeros, max));
  391|      0|    }
  392|  35.2M|    dst += dst_stride;
  393|  35.2M|  } while ((row += CFL_BUF_LINE_I128) < row_end);
  ------------------
  |  |  523|  35.2M|#define CFL_BUF_LINE_I128 (CFL_BUF_LINE >> 3)
  |  |  ------------------
  |  |  |  |  522|  35.2M|#define CFL_BUF_LINE (32)
  |  |  ------------------
  ------------------
  |  Branch (393:12): [True: 28.2M, False: 6.95M]
  ------------------
  394|  6.95M|}
cfl_ssse3.c:highbd_max_epi16:
  347|  6.95M|static inline __m128i highbd_max_epi16(int bd) {
  348|  6.95M|  const __m128i neg_one = _mm_set1_epi16(-1);
  349|       |  // (1 << bd) - 1 => -(-1 << bd) -1 => -1 - (-1 << bd) => -1 ^ (-1 << bd)
  350|  6.95M|  return _mm_xor_si128(_mm_slli_epi16(neg_one, bd), neg_one);
  351|  6.95M|}
cfl_ssse3.c:highbd_clamp_epi16:
  353|  35.2M|static inline __m128i highbd_clamp_epi16(__m128i u, __m128i zero, __m128i max) {
  354|  35.2M|  return _mm_max_epi16(_mm_min_epi16(u, max), zero);
  355|  35.2M|}

av1_convolve_2d_sr_avx2:
  342|  3.40M|    const int32_t subpel_y_qn, ConvolveParams *conv_params) {
  343|  3.40M|  const int32_t tap_x = get_filter_tap(filter_params_x, subpel_x_qn);
  344|  3.40M|  const int32_t tap_y = get_filter_tap(filter_params_y, subpel_y_qn);
  345|       |
  346|  3.40M|  const bool use_12tap = (tap_x == 12 || tap_y == 12);
  ------------------
  |  Branch (346:27): [True: 8.88k, False: 3.40M]
  |  Branch (346:42): [True: 0, False: 3.40M]
  ------------------
  347|  3.40M|  if (w <= 4 && !use_12tap) {
  ------------------
  |  Branch (347:7): [True: 556k, False: 2.85M]
  |  Branch (347:17): [True: 556k, False: 18.4E]
  ------------------
  348|   556k|    convolve_2d_sr_w4_avx2(src, src_stride, dst, dst_stride, w, h,
  349|   556k|                           filter_params_x, filter_params_y, subpel_x_qn,
  350|   556k|                           subpel_y_qn, conv_params);
  351|  2.85M|  } else {
  352|  2.85M|    convolve_2d_sr_avx2(src, src_stride, dst, dst_stride, w, h, filter_params_x,
  353|  2.85M|                        filter_params_y, subpel_x_qn, subpel_y_qn, conv_params);
  354|  2.85M|  }
  355|  3.40M|}
convolve_2d_avx2.c:convolve_2d_sr_w4_avx2:
   27|   556k|    const int32_t subpel_y_qn, ConvolveParams *conv_params) {
   28|   556k|  int i;
   29|   556k|  DECLARE_ALIGNED(32, int16_t, im_block[(MAX_SB_SIZE + MAX_FILTER_TAP) * 4]);
  ------------------
  |  |   19|   556k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   30|   556k|  uint8_t *dst_ptr = dst;
   31|   556k|  assert(conv_params->round_0 == 3);
   32|   556k|  assert(conv_params->round_1 == 11);
   33|       |
   34|   556k|  const __m128i round_const_h = _mm_set1_epi16(1 << (conv_params->round_0 - 2));
   35|   556k|  const __m256i round_const_v =
   36|   556k|      _mm256_set1_epi32(1 << (conv_params->round_1 - 1));
   37|       |
   38|   556k|  __m128i filt[2], coeffs_h[2] = { 0 };
   39|   556k|  __m256i coeffs_v[4] = { 0 };
   40|       |
   41|   556k|  const int horiz_tap = get_filter_tap(filter_params_x, subpel_x_qn);
   42|   556k|  const int vert_tap = get_filter_tap(filter_params_y, subpel_y_qn);
   43|       |
   44|   556k|  assert(horiz_tap == 2 || horiz_tap == 4);
   45|   556k|  assert(vert_tap == 2 || vert_tap == 4 || vert_tap == 6 || vert_tap == 8);
   46|       |
   47|   556k|  if (horiz_tap == 2)
  ------------------
  |  Branch (47:7): [True: 0, False: 556k]
  ------------------
   48|      0|    prepare_coeffs_2t_ssse3(filter_params_x, subpel_x_qn, coeffs_h);
   49|   556k|  else
   50|   556k|    prepare_coeffs_4t_ssse3(filter_params_x, subpel_x_qn, coeffs_h);
   51|       |
   52|   556k|  if (vert_tap == 2)
  ------------------
  |  Branch (52:7): [True: 0, False: 556k]
  ------------------
   53|      0|    prepare_coeffs_2t(filter_params_y, subpel_y_qn, coeffs_v);
   54|   556k|  else if (vert_tap == 4)
  ------------------
  |  Branch (54:12): [True: 457k, False: 99.2k]
  ------------------
   55|   457k|    prepare_coeffs_4t(filter_params_y, subpel_y_qn, coeffs_v);
   56|  99.2k|  else if (vert_tap == 6)
  ------------------
  |  Branch (56:12): [True: 99.0k, False: 222]
  ------------------
   57|  99.0k|    prepare_coeffs_6t(filter_params_y, subpel_y_qn, coeffs_v);
   58|    222|  else
   59|    222|    prepare_coeffs(filter_params_y, subpel_y_qn, coeffs_v);
   60|       |
   61|   556k|  int im_h = h + vert_tap - 1;
   62|   556k|  const int fo_vert = vert_tap / 2 - 1;
   63|   556k|  const int fo_horiz = horiz_tap / 2 - 1;
   64|   556k|  const uint8_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
   65|       |
   66|   556k|  filt[0] = _mm_load_si128((__m128i const *)filt1_global_sse2);
   67|   556k|  filt[1] = _mm_load_si128((__m128i const *)filt2_global_sse2);
   68|       |
   69|   556k|  if (horiz_tap == 2) {
  ------------------
  |  Branch (69:7): [True: 0, False: 556k]
  ------------------
   70|      0|    CONVOLVE_SR_HOR_FILTER_2TAP_W4
  ------------------
  |  |  110|      0|  CONVOLVE_SR_HOR_FILTER_W4(convolve_lowbd_x_2tap_ssse3)
  |  |  ------------------
  |  |  |  |   97|      0|  for (i = 0; i < (im_h - 2); i += 2) {                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    __m128i data =                                                           \
  |  |  |  |   99|      0|        load_8bit_8x2_to_1_reg_sse2(&src_ptr[(i * src_stride)], src_stride); \
  |  |  |  |  100|      0|    __m128i res = CONVOLVE_LOWBD(data, coeffs_h, filt);                      \
  |  |  |  |  101|      0|    res = _mm_srai_epi16(_mm_add_epi16(res, round_const_h), 2);              \
  |  |  |  |  102|      0|    _mm_store_si128((__m128i *)&im_block[i * 4], res);                       \
  |  |  |  |  103|      0|  }                                                                          \
  |  |  |  |  104|      0|  __m128i data_1 = _mm_loadl_epi64((__m128i *)&src_ptr[(i * src_stride)]);   \
  |  |  |  |  105|      0|  __m128i res = CONVOLVE_LOWBD(data_1, coeffs_h, filt);                      \
  |  |  |  |  106|      0|  res = _mm_srai_epi16(_mm_add_epi16(res, round_const_h), 2);                \
  |  |  |  |  107|      0|  _mm_storel_epi64((__m128i *)&im_block[i * 4], res);
  |  |  ------------------
  ------------------
   71|   556k|  } else {
   72|   556k|    CONVOLVE_SR_HOR_FILTER_4TAP_W4
  ------------------
  |  |  113|   556k|  CONVOLVE_SR_HOR_FILTER_W4(convolve_lowbd_x_4tap_ssse3)
  |  |  ------------------
  |  |  |  |   97|  2.62M|  for (i = 0; i < (im_h - 2); i += 2) {                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:15): [True: 2.06M, False: 556k]
  |  |  |  |  ------------------
  |  |  |  |   98|  2.06M|    __m128i data =                                                           \
  |  |  |  |   99|  2.06M|        load_8bit_8x2_to_1_reg_sse2(&src_ptr[(i * src_stride)], src_stride); \
  |  |  |  |  100|  2.06M|    __m128i res = CONVOLVE_LOWBD(data, coeffs_h, filt);                      \
  |  |  |  |  101|  2.06M|    res = _mm_srai_epi16(_mm_add_epi16(res, round_const_h), 2);              \
  |  |  |  |  102|  2.06M|    _mm_store_si128((__m128i *)&im_block[i * 4], res);                       \
  |  |  |  |  103|  2.06M|  }                                                                          \
  |  |  |  |  104|   556k|  __m128i data_1 = _mm_loadl_epi64((__m128i *)&src_ptr[(i * src_stride)]);   \
  |  |  |  |  105|   556k|  __m128i res = CONVOLVE_LOWBD(data_1, coeffs_h, filt);                      \
  |  |  |  |  106|   556k|  res = _mm_srai_epi16(_mm_add_epi16(res, round_const_h), 2);                \
  |  |  |  |  107|   556k|  _mm_storel_epi64((__m128i *)&im_block[i * 4], res);
  |  |  ------------------
  ------------------
   73|   556k|  }
   74|       |
   75|   556k|  if (vert_tap == 2) {
  ------------------
  |  Branch (75:7): [True: 0, False: 556k]
  ------------------
   76|      0|    CONVOLVE_SR_VER_FILTER_2TAP_W4
  ------------------
  |  |  141|      0|  __m128i s[2];                                                               \
  |  |  142|      0|  s[0] = _mm_loadl_epi64((__m128i *)(im_block + 0 * 4));                      \
  |  |  143|      0|                                                                              \
  |  |  144|      0|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (144:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  145|      0|    const int16_t *data = &im_block[i * 4];                                   \
  |  |  146|      0|    s[1] = _mm_loadl_epi64((__m128i *)(data + 1 * 4));                        \
  |  |  147|      0|    const __m256i src_0 = _mm256_setr_m128i(s[0], s[1]);                      \
  |  |  148|      0|    s[0] = _mm_loadl_epi64((__m128i *)(data + 2 * 4));                        \
  |  |  149|      0|    const __m256i src_1 = _mm256_setr_m128i(s[1], s[0]);                      \
  |  |  150|      0|    const __m256i ss = _mm256_unpacklo_epi16(src_0, src_1);                   \
  |  |  151|      0|                                                                              \
  |  |  152|      0|    const __m256i res = _mm256_madd_epi16(ss, coeffs_v[0]);                   \
  |  |  153|      0|                                                                              \
  |  |  154|      0|    sr_2d_ver_round_and_store_w4(w, res, dst_ptr, dst_stride, round_const_v); \
  |  |  155|      0|    dst_ptr += 2 * dst_stride;                                                \
  |  |  156|      0|  }
  ------------------
   77|   556k|  } else if (vert_tap == 4) {
  ------------------
  |  Branch (77:14): [True: 456k, False: 99.7k]
  ------------------
   78|   456k|    CONVOLVE_SR_VER_FILTER_4TAP_W4
  ------------------
  |  |  159|   456k|  __m128i s[4];                                                               \
  |  |  160|   456k|  __m256i ss[2];                                                              \
  |  |  161|   456k|  s[0] = _mm_loadl_epi64((__m128i *)(im_block + 0 * 4));                      \
  |  |  162|   456k|  s[1] = _mm_loadl_epi64((__m128i *)(im_block + 1 * 4));                      \
  |  |  163|   456k|  s[2] = _mm_loadl_epi64((__m128i *)(im_block + 2 * 4));                      \
  |  |  164|   456k|                                                                              \
  |  |  165|   456k|  const __m256i src_0 = _mm256_setr_m128i(s[0], s[1]);                        \
  |  |  166|   456k|  const __m256i src_1 = _mm256_setr_m128i(s[1], s[2]);                        \
  |  |  167|   456k|                                                                              \
  |  |  168|   456k|  ss[0] = _mm256_unpacklo_epi16(src_0, src_1);                                \
  |  |  169|   456k|                                                                              \
  |  |  170|  1.47M|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (170:15): [True: 1.02M, False: 456k]
  |  |  ------------------
  |  |  171|  1.02M|    const int16_t *data = &im_block[i * 4];                                   \
  |  |  172|  1.02M|    s[3] = _mm_loadl_epi64((__m128i *)(data + 3 * 4));                        \
  |  |  173|  1.02M|    const __m256i src_2 = _mm256_setr_m128i(s[2], s[3]);                      \
  |  |  174|  1.02M|    s[2] = _mm_loadl_epi64((__m128i *)(data + 4 * 4));                        \
  |  |  175|  1.02M|    const __m256i src_3 = _mm256_setr_m128i(s[3], s[2]);                      \
  |  |  176|  1.02M|    ss[1] = _mm256_unpacklo_epi16(src_2, src_3);                              \
  |  |  177|  1.02M|                                                                              \
  |  |  178|  1.02M|    const __m256i res = convolve_4tap(ss, coeffs_v);                          \
  |  |  179|  1.02M|                                                                              \
  |  |  180|  1.02M|    sr_2d_ver_round_and_store_w4(w, res, dst_ptr, dst_stride, round_const_v); \
  |  |  181|  1.02M|    dst_ptr += 2 * dst_stride;                                                \
  |  |  182|  1.02M|                                                                              \
  |  |  183|  1.02M|    ss[0] = ss[1];                                                            \
  |  |  184|  1.02M|  }
  ------------------
   79|   456k|  } else if (vert_tap == 6) {
  ------------------
  |  Branch (79:14): [True: 98.9k, False: 753]
  ------------------
   80|  98.9k|    CONVOLVE_SR_VER_FILTER_6TAP_W4
  ------------------
  |  |  187|  98.9k|  __m128i s[6];                                                               \
  |  |  188|  98.9k|  __m256i ss[3];                                                              \
  |  |  189|  98.9k|  s[0] = _mm_loadl_epi64((__m128i *)(im_block + 0 * 4));                      \
  |  |  190|  98.9k|  s[1] = _mm_loadl_epi64((__m128i *)(im_block + 1 * 4));                      \
  |  |  191|  98.9k|  s[2] = _mm_loadl_epi64((__m128i *)(im_block + 2 * 4));                      \
  |  |  192|  98.9k|  s[3] = _mm_loadl_epi64((__m128i *)(im_block + 3 * 4));                      \
  |  |  193|  98.9k|  s[4] = _mm_loadl_epi64((__m128i *)(im_block + 4 * 4));                      \
  |  |  194|  98.9k|                                                                              \
  |  |  195|  98.9k|  const __m256i src_0 = _mm256_setr_m128i(s[0], s[1]);                        \
  |  |  196|  98.9k|  const __m256i src_1 = _mm256_setr_m128i(s[1], s[2]);                        \
  |  |  197|  98.9k|  const __m256i src_2 = _mm256_setr_m128i(s[2], s[3]);                        \
  |  |  198|  98.9k|  const __m256i src_3 = _mm256_setr_m128i(s[3], s[4]);                        \
  |  |  199|  98.9k|                                                                              \
  |  |  200|  98.9k|  ss[0] = _mm256_unpacklo_epi16(src_0, src_1);                                \
  |  |  201|  98.9k|  ss[1] = _mm256_unpacklo_epi16(src_2, src_3);                                \
  |  |  202|  98.9k|                                                                              \
  |  |  203|   494k|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (203:15): [True: 395k, False: 98.9k]
  |  |  ------------------
  |  |  204|   395k|    const int16_t *data = &im_block[i * 4];                                   \
  |  |  205|   395k|    s[5] = _mm_loadl_epi64((__m128i *)(data + 5 * 4));                        \
  |  |  206|   395k|    const __m256i src_4 = _mm256_setr_m128i(s[4], s[5]);                      \
  |  |  207|   395k|    s[4] = _mm_loadl_epi64((__m128i *)(data + 6 * 4));                        \
  |  |  208|   395k|    const __m256i src_5 = _mm256_setr_m128i(s[5], s[4]);                      \
  |  |  209|   395k|    ss[2] = _mm256_unpacklo_epi16(src_4, src_5);                              \
  |  |  210|   395k|                                                                              \
  |  |  211|   395k|    const __m256i res = convolve_6tap(ss, coeffs_v);                          \
  |  |  212|   395k|                                                                              \
  |  |  213|   395k|    sr_2d_ver_round_and_store_w4(w, res, dst_ptr, dst_stride, round_const_v); \
  |  |  214|   395k|    dst_ptr += 2 * dst_stride;                                                \
  |  |  215|   395k|                                                                              \
  |  |  216|   395k|    ss[0] = ss[1];                                                            \
  |  |  217|   395k|    ss[1] = ss[2];                                                            \
  |  |  218|   395k|  }
  ------------------
   81|  98.9k|  } else {
   82|    753|    CONVOLVE_SR_VER_FILTER_8TAP_W4
  ------------------
  |  |  221|    753|  __m128i s[8];                                                               \
  |  |  222|    753|  __m256i ss[4];                                                              \
  |  |  223|    753|  s[0] = _mm_loadl_epi64((__m128i *)(im_block + 0 * 4));                      \
  |  |  224|    753|  s[1] = _mm_loadl_epi64((__m128i *)(im_block + 1 * 4));                      \
  |  |  225|    753|  s[2] = _mm_loadl_epi64((__m128i *)(im_block + 2 * 4));                      \
  |  |  226|    753|  s[3] = _mm_loadl_epi64((__m128i *)(im_block + 3 * 4));                      \
  |  |  227|    753|  s[4] = _mm_loadl_epi64((__m128i *)(im_block + 4 * 4));                      \
  |  |  228|    753|  s[5] = _mm_loadl_epi64((__m128i *)(im_block + 5 * 4));                      \
  |  |  229|    753|  s[6] = _mm_loadl_epi64((__m128i *)(im_block + 6 * 4));                      \
  |  |  230|    753|                                                                              \
  |  |  231|    753|  const __m256i src_0 = _mm256_setr_m128i(s[0], s[1]);                        \
  |  |  232|    753|  const __m256i src_1 = _mm256_setr_m128i(s[1], s[2]);                        \
  |  |  233|    753|  const __m256i src_2 = _mm256_setr_m128i(s[2], s[3]);                        \
  |  |  234|    753|  const __m256i src_3 = _mm256_setr_m128i(s[3], s[4]);                        \
  |  |  235|    753|  const __m256i src_4 = _mm256_setr_m128i(s[4], s[5]);                        \
  |  |  236|    753|  const __m256i src_5 = _mm256_setr_m128i(s[5], s[6]);                        \
  |  |  237|    753|                                                                              \
  |  |  238|    753|  ss[0] = _mm256_unpacklo_epi16(src_0, src_1);                                \
  |  |  239|    753|  ss[1] = _mm256_unpacklo_epi16(src_2, src_3);                                \
  |  |  240|    753|  ss[2] = _mm256_unpacklo_epi16(src_4, src_5);                                \
  |  |  241|    753|                                                                              \
  |  |  242|    753|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (242:15): [True: 0, False: 753]
  |  |  ------------------
  |  |  243|      0|    const int16_t *data = &im_block[i * 4];                                   \
  |  |  244|      0|    s[7] = _mm_loadl_epi64((__m128i *)(data + 7 * 4));                        \
  |  |  245|      0|    const __m256i src_6 = _mm256_setr_m128i(s[6], s[7]);                      \
  |  |  246|      0|    s[6] = _mm_loadl_epi64((__m128i *)(data + 8 * 4));                        \
  |  |  247|      0|    const __m256i src_7 = _mm256_setr_m128i(s[7], s[6]);                      \
  |  |  248|      0|    ss[3] = _mm256_unpacklo_epi16(src_6, src_7);                              \
  |  |  249|      0|                                                                              \
  |  |  250|      0|    const __m256i res = convolve(ss, coeffs_v);                               \
  |  |  251|      0|                                                                              \
  |  |  252|      0|    sr_2d_ver_round_and_store_w4(w, res, dst_ptr, dst_stride, round_const_v); \
  |  |  253|      0|    dst_ptr += 2 * dst_stride;                                                \
  |  |  254|      0|                                                                              \
  |  |  255|      0|    ss[0] = ss[1];                                                            \
  |  |  256|      0|    ss[1] = ss[2];                                                            \
  |  |  257|      0|    ss[2] = ss[3];                                                            \
  |  |  258|      0|  }
  ------------------
   83|    753|  }
   84|   556k|}
convolve_2d_avx2.c:convolve_2d_sr_avx2:
   91|  2.84M|                                ConvolveParams *conv_params) {
   92|  2.84M|  if (filter_params_x->taps > 8) {
  ------------------
  |  Branch (92:7): [True: 0, False: 2.84M]
  ------------------
   93|      0|    const int bd = 8;
   94|      0|    int im_stride = 8, i;
   95|      0|    const int strip_stride = (MAX_SB_SIZE + MAX_FILTER_TAP) * 8;
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                  const int strip_stride = (MAX_SB_SIZE + MAX_FILTER_TAP) * 8;
  ------------------
  |  |   28|      0|#define MAX_FILTER_TAP 12
  ------------------
   96|      0|    DECLARE_ALIGNED(
  ------------------
  |  |   19|      0|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   97|      0|        32, int16_t,
   98|      0|        im_block_buf[(MAX_SB_SIZE / 8) * (MAX_SB_SIZE + MAX_FILTER_TAP) * 8]);
   99|      0|    const int bits =
  100|      0|        FILTER_BITS * 2 - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|      0|#define FILTER_BITS 7
  ------------------
  101|      0|    const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|      0|#define FILTER_BITS 7
  ------------------
  102|       |
  103|      0|    assert(conv_params->round_0 > 0);
  104|       |
  105|      0|    const __m256i round_const_h12 = _mm256_set1_epi32(
  106|      0|        ((1 << (conv_params->round_0)) >> 1) + (1 << (bd + FILTER_BITS - 1)));
  ------------------
  |  |   21|      0|#define FILTER_BITS 7
  ------------------
  107|      0|    const __m128i round_shift_h12 = _mm_cvtsi32_si128(conv_params->round_0);
  108|       |
  109|      0|    const __m256i sum_round_v = _mm256_set1_epi32(
  110|      0|        (1 << offset_bits) + ((1 << conv_params->round_1) >> 1));
  111|      0|    const __m128i sum_shift_v = _mm_cvtsi32_si128(conv_params->round_1);
  112|       |
  113|      0|    const __m256i round_const_v = _mm256_set1_epi32(
  114|      0|        ((1 << bits) >> 1) - (1 << (offset_bits - conv_params->round_1)) -
  115|      0|        ((1 << (offset_bits - conv_params->round_1)) >> 1));
  116|      0|    const __m128i round_shift_v = _mm_cvtsi32_si128(bits);
  117|       |
  118|      0|    __m256i coeffs_h[6] = { 0 }, coeffs_v[6] = { 0 };
  119|       |
  120|      0|    int horiz_tap = 12;
  121|      0|    int vert_tap = 12;
  122|       |
  123|      0|    prepare_coeffs_12taps(filter_params_x, subpel_x_qn, coeffs_h);
  124|      0|    prepare_coeffs_12taps(filter_params_y, subpel_y_qn, coeffs_v);
  125|       |
  126|      0|    int im_h = h + vert_tap - 1;
  127|      0|    const int fo_vert = vert_tap / 2 - 1;
  128|      0|    const int fo_horiz = horiz_tap / 2 - 1;
  129|      0|    const uint8_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
  130|       |
  131|      0|    const __m256i v_zero = _mm256_setzero_si256();
  132|      0|    __m256i s[12];
  133|      0|    if (w <= 4) {
  ------------------
  |  Branch (133:9): [True: 0, False: 0]
  ------------------
  134|      0|      for (i = 0; i < im_h; i += 2) {
  ------------------
  |  Branch (134:19): [True: 0, False: 0]
  ------------------
  135|      0|        for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (135:25): [True: 0, False: 0]
  ------------------
  136|      0|          int16_t *strip_im_block = &im_block_buf[(j / 8) * strip_stride];
  137|      0|          const __m256i data = _mm256_permute2x128_si256(
  138|      0|              _mm256_castsi128_si256(
  139|      0|                  _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride + j]))),
  140|      0|              _mm256_castsi128_si256(_mm_loadu_si128(
  141|      0|                  (__m128i *)(&src_ptr[i * src_stride + src_stride + j]))),
  142|      0|              0x20);
  143|      0|          const __m256i s_16lo = _mm256_unpacklo_epi8(data, v_zero);
  144|      0|          const __m256i s_16hi = _mm256_unpackhi_epi8(data, v_zero);
  145|      0|          const __m256i s_lolo = _mm256_unpacklo_epi16(s_16lo, s_16lo);
  146|      0|          const __m256i s_lohi = _mm256_unpackhi_epi16(s_16lo, s_16lo);
  147|       |
  148|      0|          const __m256i s_hilo = _mm256_unpacklo_epi16(s_16hi, s_16hi);
  149|      0|          const __m256i s_hihi = _mm256_unpackhi_epi16(s_16hi, s_16hi);
  150|       |
  151|      0|          s[0] = _mm256_alignr_epi8(s_lohi, s_lolo, 2);
  152|      0|          s[1] = _mm256_alignr_epi8(s_lohi, s_lolo, 10);
  153|      0|          s[2] = _mm256_alignr_epi8(s_hilo, s_lohi, 2);
  154|      0|          s[3] = _mm256_alignr_epi8(s_hilo, s_lohi, 10);
  155|      0|          s[4] = _mm256_alignr_epi8(s_hihi, s_hilo, 2);
  156|      0|          s[5] = _mm256_alignr_epi8(s_hihi, s_hilo, 10);
  157|       |
  158|      0|          const __m256i res_lo = convolve_12taps(s, coeffs_h);
  159|       |
  160|      0|          __m256i res_32b_lo = _mm256_sra_epi32(
  161|      0|              _mm256_add_epi32(res_lo, round_const_h12), round_shift_h12);
  162|      0|          __m256i res_16b_lo = _mm256_packs_epi32(res_32b_lo, res_32b_lo);
  163|      0|          const __m128i res_0 = _mm256_extracti128_si256(res_16b_lo, 0);
  164|      0|          const __m128i res_1 = _mm256_extracti128_si256(res_16b_lo, 1);
  165|      0|          if (w > 2) {
  ------------------
  |  Branch (165:15): [True: 0, False: 0]
  ------------------
  166|      0|            _mm_storel_epi64((__m128i *)&strip_im_block[i * im_stride], res_0);
  167|      0|            _mm_storel_epi64(
  168|      0|                (__m128i *)&strip_im_block[i * im_stride + im_stride], res_1);
  169|      0|          } else {
  170|      0|            uint32_t horiz_2;
  171|      0|            horiz_2 = (uint32_t)_mm_cvtsi128_si32(res_0);
  172|      0|            strip_im_block[i * im_stride] = (uint16_t)horiz_2;
  173|      0|            strip_im_block[i * im_stride + 1] = (uint16_t)(horiz_2 >> 16);
  174|      0|            horiz_2 = (uint32_t)_mm_cvtsi128_si32(res_1);
  175|      0|            strip_im_block[i * im_stride + im_stride] = (uint16_t)horiz_2;
  176|      0|            strip_im_block[i * im_stride + im_stride + 1] =
  177|      0|                (uint16_t)(horiz_2 >> 16);
  178|      0|          }
  179|      0|        }
  180|      0|      }
  181|      0|    } else {
  182|      0|      for (i = 0; i < im_h; i++) {
  ------------------
  |  Branch (182:19): [True: 0, False: 0]
  ------------------
  183|      0|        for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (183:25): [True: 0, False: 0]
  ------------------
  184|      0|          int16_t *strip_im_block = &im_block_buf[(j / 8) * strip_stride];
  185|      0|          const __m256i data = _mm256_permute2x128_si256(
  186|      0|              _mm256_castsi128_si256(
  187|      0|                  _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride + j]))),
  188|      0|              _mm256_castsi128_si256(_mm_loadu_si128(
  189|      0|                  (__m128i *)(&src_ptr[i * src_stride + j + 4]))),
  190|      0|              0x20);
  191|      0|          const __m256i s_16lo = _mm256_unpacklo_epi8(data, v_zero);
  192|      0|          const __m256i s_16hi = _mm256_unpackhi_epi8(data, v_zero);
  193|       |
  194|      0|          const __m256i s_lolo = _mm256_unpacklo_epi16(s_16lo, s_16lo);
  195|      0|          const __m256i s_lohi = _mm256_unpackhi_epi16(s_16lo, s_16lo);
  196|       |
  197|      0|          const __m256i s_hilo = _mm256_unpacklo_epi16(s_16hi, s_16hi);
  198|      0|          const __m256i s_hihi = _mm256_unpackhi_epi16(s_16hi, s_16hi);
  199|       |
  200|      0|          s[0] = _mm256_alignr_epi8(s_lohi, s_lolo, 2);
  201|      0|          s[1] = _mm256_alignr_epi8(s_lohi, s_lolo, 10);
  202|      0|          s[2] = _mm256_alignr_epi8(s_hilo, s_lohi, 2);
  203|      0|          s[3] = _mm256_alignr_epi8(s_hilo, s_lohi, 10);
  204|      0|          s[4] = _mm256_alignr_epi8(s_hihi, s_hilo, 2);
  205|      0|          s[5] = _mm256_alignr_epi8(s_hihi, s_hilo, 10);
  206|       |
  207|      0|          const __m256i res_lo = convolve_12taps(s, coeffs_h);
  208|       |
  209|      0|          __m256i res_32b_lo = _mm256_sra_epi32(
  210|      0|              _mm256_add_epi32(res_lo, round_const_h12), round_shift_h12);
  211|       |
  212|      0|          __m256i res_16b_lo = _mm256_packs_epi32(res_32b_lo, res_32b_lo);
  213|      0|          _mm_store_si128((__m128i *)&strip_im_block[i * im_stride],
  214|      0|                          _mm256_extracti128_si256(
  215|      0|                              _mm256_permute4x64_epi64(res_16b_lo, 0x88), 0));
  216|      0|        }
  217|      0|      }
  218|      0|    }
  219|       |
  220|      0|    for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (220:21): [True: 0, False: 0]
  ------------------
  221|      0|      const int16_t *im_block = &im_block_buf[(j / 8) * strip_stride];
  222|      0|      CONVOLVE_SR_VERTICAL_FILTER_12TAP
  ------------------
  |  |  428|      0|  __m256i src_0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));   \
  |  |  429|      0|  __m256i src_1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));   \
  |  |  430|      0|  __m256i src_2 = _mm256_loadu_si256((__m256i *)(im_block + 2 * im_stride));   \
  |  |  431|      0|  __m256i src_3 = _mm256_loadu_si256((__m256i *)(im_block + 3 * im_stride));   \
  |  |  432|      0|  __m256i src_4 = _mm256_loadu_si256((__m256i *)(im_block + 4 * im_stride));   \
  |  |  433|      0|  __m256i src_5 = _mm256_loadu_si256((__m256i *)(im_block + 5 * im_stride));   \
  |  |  434|      0|  __m256i src_6 = _mm256_loadu_si256((__m256i *)(im_block + 6 * im_stride));   \
  |  |  435|      0|  __m256i src_7 = _mm256_loadu_si256((__m256i *)(im_block + 7 * im_stride));   \
  |  |  436|      0|  __m256i src_8 = _mm256_loadu_si256((__m256i *)(im_block + 8 * im_stride));   \
  |  |  437|      0|  __m256i src_9 = _mm256_loadu_si256((__m256i *)(im_block + 9 * im_stride));   \
  |  |  438|      0|                                                                               \
  |  |  439|      0|  s[0] = _mm256_unpacklo_epi16(src_0, src_1);                                  \
  |  |  440|      0|  s[1] = _mm256_unpacklo_epi16(src_2, src_3);                                  \
  |  |  441|      0|  s[2] = _mm256_unpacklo_epi16(src_4, src_5);                                  \
  |  |  442|      0|  s[3] = _mm256_unpacklo_epi16(src_6, src_7);                                  \
  |  |  443|      0|  s[4] = _mm256_unpacklo_epi16(src_8, src_9);                                  \
  |  |  444|      0|                                                                               \
  |  |  445|      0|  s[6] = _mm256_unpackhi_epi16(src_0, src_1);                                  \
  |  |  446|      0|  s[7] = _mm256_unpackhi_epi16(src_2, src_3);                                  \
  |  |  447|      0|  s[8] = _mm256_unpackhi_epi16(src_4, src_5);                                  \
  |  |  448|      0|  s[9] = _mm256_unpackhi_epi16(src_6, src_7);                                  \
  |  |  449|      0|  s[10] = _mm256_unpackhi_epi16(src_8, src_9);                                 \
  |  |  450|      0|                                                                               \
  |  |  451|      0|  for (i = 0; i < h; i += 2) {                                                 \
  |  |  ------------------
  |  |  |  Branch (451:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  452|      0|    const int16_t *data = &im_block[i * im_stride];                            \
  |  |  453|      0|                                                                               \
  |  |  454|      0|    const __m256i s6 = _mm256_loadu_si256((__m256i *)(data + 10 * im_stride)); \
  |  |  455|      0|    const __m256i s7 = _mm256_loadu_si256((__m256i *)(data + 11 * im_stride)); \
  |  |  456|      0|                                                                               \
  |  |  457|      0|    s[5] = _mm256_unpacklo_epi16(s6, s7);                                      \
  |  |  458|      0|    s[11] = _mm256_unpackhi_epi16(s6, s7);                                     \
  |  |  459|      0|                                                                               \
  |  |  460|      0|    __m256i res_a = convolve_12taps(s, coeffs_v);                              \
  |  |  461|      0|    __m256i res_b = convolve_12taps(s + 6, coeffs_v);                          \
  |  |  462|      0|                                                                               \
  |  |  463|      0|    res_a =                                                                    \
  |  |  464|      0|        _mm256_sra_epi32(_mm256_add_epi32(res_a, sum_round_v), sum_shift_v);   \
  |  |  465|      0|    res_b =                                                                    \
  |  |  466|      0|        _mm256_sra_epi32(_mm256_add_epi32(res_b, sum_round_v), sum_shift_v);   \
  |  |  467|      0|                                                                               \
  |  |  468|      0|    const __m256i res_a_round = _mm256_sra_epi32(                              \
  |  |  469|      0|        _mm256_add_epi32(res_a, round_const_v), round_shift_v);                \
  |  |  470|      0|    const __m256i res_b_round = _mm256_sra_epi32(                              \
  |  |  471|      0|        _mm256_add_epi32(res_b, round_const_v), round_shift_v);                \
  |  |  472|      0|                                                                               \
  |  |  473|      0|    const __m256i res_16bit = _mm256_packs_epi32(res_a_round, res_b_round);    \
  |  |  474|      0|    const __m256i res_8b = _mm256_packus_epi16(res_16bit, res_16bit);          \
  |  |  475|      0|                                                                               \
  |  |  476|      0|    const __m128i res_0 = _mm256_castsi256_si128(res_8b);                      \
  |  |  477|      0|    const __m128i res_1 = _mm256_extracti128_si256(res_8b, 1);                 \
  |  |  478|      0|                                                                               \
  |  |  479|      0|    __m128i *const p_0 = (__m128i *)&dst[i * dst_stride + j];                  \
  |  |  480|      0|    __m128i *const p_1 = (__m128i *)&dst[i * dst_stride + j + dst_stride];     \
  |  |  481|      0|    if (w - j > 4) {                                                           \
  |  |  ------------------
  |  |  |  Branch (481:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  482|      0|      _mm_storel_epi64(p_0, res_0);                                            \
  |  |  483|      0|      _mm_storel_epi64(p_1, res_1);                                            \
  |  |  484|      0|    } else if (w == 4) {                                                       \
  |  |  ------------------
  |  |  |  Branch (484:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  485|      0|      xx_storel_32(p_0, res_0);                                                \
  |  |  486|      0|      xx_storel_32(p_1, res_1);                                                \
  |  |  487|      0|    } else {                                                                   \
  |  |  488|      0|      *(uint16_t *)p_0 = (uint16_t)_mm_cvtsi128_si32(res_0);                   \
  |  |  489|      0|      *(uint16_t *)p_1 = (uint16_t)_mm_cvtsi128_si32(res_1);                   \
  |  |  490|      0|    }                                                                          \
  |  |  491|      0|                                                                               \
  |  |  492|      0|    s[0] = s[1];                                                               \
  |  |  493|      0|    s[1] = s[2];                                                               \
  |  |  494|      0|    s[2] = s[3];                                                               \
  |  |  495|      0|    s[3] = s[4];                                                               \
  |  |  496|      0|    s[4] = s[5];                                                               \
  |  |  497|      0|                                                                               \
  |  |  498|      0|    s[6] = s[7];                                                               \
  |  |  499|      0|    s[7] = s[8];                                                               \
  |  |  500|      0|    s[8] = s[9];                                                               \
  |  |  501|      0|    s[9] = s[10];                                                              \
  |  |  502|      0|    s[10] = s[11];                                                             \
  |  |  503|      0|  }
  ------------------
  223|      0|    }
  224|  2.84M|  } else {
  225|  2.84M|    int im_stride = 8, i;
  226|  2.84M|    const int strip_stride = (MAX_SB_SIZE + MAX_FILTER_TAP) * 8;
  ------------------
  |  |   32|  2.84M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  2.84M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                  const int strip_stride = (MAX_SB_SIZE + MAX_FILTER_TAP) * 8;
  ------------------
  |  |   28|  2.84M|#define MAX_FILTER_TAP 12
  ------------------
  227|  2.84M|    DECLARE_ALIGNED(
  ------------------
  |  |   19|  2.84M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  228|  2.84M|        32, int16_t,
  229|  2.84M|        im_block_buf[(MAX_SB_SIZE / 8) * (MAX_SB_SIZE + MAX_FILTER_TAP) * 8]);
  230|       |
  231|  2.84M|    assert(conv_params->round_0 == 3);
  232|  2.84M|    assert(conv_params->round_1 == 11);
  233|       |
  234|  2.84M|    const __m256i round_const_h =
  235|  2.84M|        _mm256_set1_epi16(1 << (conv_params->round_0 - 2));
  236|  2.84M|    const __m256i round_const_v =
  237|  2.84M|        _mm256_set1_epi32(1 << (conv_params->round_1 - 1));
  238|       |
  239|  2.84M|    __m256i filt[4], coeffs_h[4] = { 0 }, coeffs_v[4] = { 0 };
  240|       |
  241|  2.84M|    int horiz_tap = get_filter_tap(filter_params_x, subpel_x_qn);
  242|  2.84M|    int vert_tap = get_filter_tap(filter_params_y, subpel_y_qn);
  243|       |
  244|  2.84M|    assert(horiz_tap == 2 || horiz_tap == 4 || horiz_tap == 6 ||
  245|  2.84M|           horiz_tap == 8);
  246|  2.84M|    assert(vert_tap == 2 || vert_tap == 4 || vert_tap == 6 || vert_tap == 8);
  247|       |
  248|  2.84M|    if (horiz_tap == 2)
  ------------------
  |  Branch (248:9): [True: 911, False: 2.84M]
  ------------------
  249|    911|      prepare_coeffs_2t_lowbd(filter_params_x, subpel_x_qn, coeffs_h);
  250|  2.84M|    else if (horiz_tap == 4)
  ------------------
  |  Branch (250:14): [True: 767k, False: 2.08M]
  ------------------
  251|   767k|      prepare_coeffs_4t_lowbd(filter_params_x, subpel_x_qn, coeffs_h);
  252|  2.08M|    else if (horiz_tap == 6)
  ------------------
  |  Branch (252:14): [True: 2.08M, False: 18.4E]
  ------------------
  253|  2.08M|      prepare_coeffs_6t_lowbd(filter_params_x, subpel_x_qn, coeffs_h);
  254|  18.4E|    else
  255|  18.4E|      prepare_coeffs_lowbd(filter_params_x, subpel_x_qn, coeffs_h);
  256|       |
  257|  2.84M|    if (vert_tap == 2)
  ------------------
  |  Branch (257:9): [True: 911, False: 2.84M]
  ------------------
  258|    911|      prepare_coeffs_2t(filter_params_y, subpel_y_qn, coeffs_v);
  259|  2.84M|    else if (vert_tap == 4)
  ------------------
  |  Branch (259:14): [True: 730k, False: 2.11M]
  ------------------
  260|   730k|      prepare_coeffs_4t(filter_params_y, subpel_y_qn, coeffs_v);
  261|  2.11M|    else if (vert_tap == 6)
  ------------------
  |  Branch (261:14): [True: 2.11M, False: 18.4E]
  ------------------
  262|  2.11M|      prepare_coeffs_6t(filter_params_y, subpel_y_qn, coeffs_v);
  263|  18.4E|    else
  264|  18.4E|      prepare_coeffs(filter_params_y, subpel_y_qn, coeffs_v);
  265|       |
  266|  2.84M|    int im_h = h + vert_tap - 1;
  267|  2.84M|    const int fo_vert = vert_tap / 2 - 1;
  268|  2.84M|    const int fo_horiz = horiz_tap / 2 - 1;
  269|  2.84M|    const uint8_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
  270|       |
  271|  2.84M|    filt[0] = _mm256_load_si256((__m256i const *)filt1_global_avx2);
  272|  2.84M|    filt[1] = _mm256_load_si256((__m256i const *)filt2_global_avx2);
  273|  2.84M|    filt[2] = _mm256_load_si256((__m256i const *)filt3_global_avx2);
  274|  2.84M|    filt[3] = _mm256_load_si256((__m256i const *)filt4_global_avx2);
  275|       |
  276|  22.1M|    for (i = 0; i < (im_h - 1); i += 2) {
  ------------------
  |  Branch (276:17): [True: 19.3M, False: 2.84M]
  ------------------
  277|  19.3M|      const uint8_t *src_row0 = &src_ptr[i * src_stride];
  278|  19.3M|      const uint8_t *src_row1 = &src_ptr[(i + 1) * src_stride];
  279|  47.5M|      for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (279:23): [True: 28.2M, False: 19.3M]
  ------------------
  280|  28.2M|        int16_t *strip_im_block = &im_block_buf[(j / 8) * strip_stride];
  281|  28.2M|        __m256i data =
  282|  28.2M|            _mm256_castsi128_si256(_mm_loadu_si128((__m128i *)&src_row0[j]));
  283|  28.2M|        data = _mm256_inserti128_si256(
  284|  28.2M|            data, _mm_loadu_si128((__m128i *)&src_row1[j]), 1);
  285|       |
  286|  28.2M|        __m256i res;
  287|  28.2M|        if (horiz_tap == 2)
  ------------------
  |  Branch (287:13): [True: 58.0k, False: 28.1M]
  ------------------
  288|  58.0k|          res = convolve_lowbd_x_2tap(data, coeffs_h, filt);
  289|  28.1M|        else if (horiz_tap == 4)
  ------------------
  |  Branch (289:18): [True: 6.77M, False: 21.4M]
  ------------------
  290|  6.77M|          res = convolve_lowbd_x_4tap(data, coeffs_h, filt);
  291|  21.4M|        else if (horiz_tap == 6)
  ------------------
  |  Branch (291:18): [True: 21.6M, False: 18.4E]
  ------------------
  292|  21.6M|          res = convolve_lowbd_x_6tap(data, coeffs_h, filt);
  293|  18.4E|        else
  294|  18.4E|          res = convolve_lowbd_x(data, coeffs_h, filt);
  295|       |
  296|  28.2M|        res = _mm256_srai_epi16(_mm256_add_epi16(res, round_const_h), 2);
  297|  28.2M|        _mm256_store_si256((__m256i *)&strip_im_block[i * 8], res);
  298|  28.2M|      }
  299|  19.3M|    }
  300|  2.84M|    {
  301|  2.84M|      const uint8_t *src_row0 = &src_ptr[i * src_stride];
  302|  6.44M|      for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (302:23): [True: 3.59M, False: 2.84M]
  ------------------
  303|  3.59M|        int16_t *strip_im_block = &im_block_buf[(j / 8) * strip_stride];
  304|  3.59M|        __m256i data_1 =
  305|  3.59M|            _mm256_castsi128_si256(_mm_loadu_si128((__m128i *)&src_row0[j]));
  306|  3.59M|        __m256i res;
  307|  3.59M|        if (horiz_tap == 2)
  ------------------
  |  Branch (307:13): [True: 3.64k, False: 3.59M]
  ------------------
  308|  3.64k|          res = convolve_lowbd_x_2tap(data_1, coeffs_h, filt);
  309|  3.59M|        else if (horiz_tap == 4)
  ------------------
  |  Branch (309:18): [True: 926k, False: 2.66M]
  ------------------
  310|   926k|          res = convolve_lowbd_x_4tap(data_1, coeffs_h, filt);
  311|  2.66M|        else if (horiz_tap == 6)
  ------------------
  |  Branch (311:18): [True: 2.68M, False: 18.4E]
  ------------------
  312|  2.68M|          res = convolve_lowbd_x_6tap(data_1, coeffs_h, filt);
  313|  18.4E|        else
  314|  18.4E|          res = convolve_lowbd_x(data_1, coeffs_h, filt);
  315|       |
  316|  3.59M|        res = _mm256_srai_epi16(_mm256_add_epi16(res, round_const_h), 2);
  317|  3.59M|        _mm_store_si128((__m128i *)&strip_im_block[i * 8],
  318|  3.59M|                        _mm256_castsi256_si128(res));
  319|  3.59M|      }
  320|  2.84M|    }
  321|       |
  322|  6.44M|    for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (322:21): [True: 3.59M, False: 2.84M]
  ------------------
  323|  3.59M|      const int16_t *im_block = &im_block_buf[(j / 8) * strip_stride];
  324|  3.59M|      uint8_t *dst_ptr = dst + j;
  325|  3.59M|      if (vert_tap == 2) {
  ------------------
  |  Branch (325:11): [True: 3.64k, False: 3.59M]
  ------------------
  326|  3.64k|        CONVOLVE_SR_VERTICAL_FILTER_2TAP
  ------------------
  |  |  307|  61.9k|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (307:15): [True: 58.3k, False: 3.64k]
  |  |  ------------------
  |  |  308|  58.3k|    __m256i s[2];                                                             \
  |  |  309|  58.3k|    const int16_t *data = &im_block[i * im_stride];                           \
  |  |  310|  58.3k|    const __m256i s1 = _mm256_loadu_si256((__m256i *)(data + 0 * im_stride)); \
  |  |  311|  58.3k|    const __m256i s2 = _mm256_loadu_si256((__m256i *)(data + 1 * im_stride)); \
  |  |  312|  58.3k|    s[0] = _mm256_unpacklo_epi16(s1, s2);                                     \
  |  |  313|  58.3k|    s[1] = _mm256_unpackhi_epi16(s1, s2);                                     \
  |  |  314|  58.3k|                                                                              \
  |  |  315|  58.3k|    __m256i res_a = _mm256_madd_epi16(s[0], coeffs_v[0]);                     \
  |  |  316|  58.3k|    __m256i res_b = _mm256_madd_epi16(s[1], coeffs_v[0]);                     \
  |  |  317|  58.3k|                                                                              \
  |  |  318|  58.3k|    sr_2d_ver_round_and_store(res_a, res_b, dst_ptr, dst_stride,              \
  |  |  319|  58.3k|                              round_const_v);                                 \
  |  |  320|  58.3k|    dst_ptr += 2 * dst_stride;                                                \
  |  |  321|  58.3k|  }
  ------------------
  327|  3.59M|      } else if (vert_tap == 4) {
  ------------------
  |  Branch (327:18): [True: 884k, False: 2.70M]
  ------------------
  328|   884k|        CONVOLVE_SR_VERTICAL_FILTER_4TAP
  ------------------
  |  |  324|   884k|  __m256i s[6];                                                               \
  |  |  325|   884k|  __m256i src_0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));  \
  |  |  326|   884k|  __m256i src_1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));  \
  |  |  327|   884k|                                                                              \
  |  |  328|   884k|  s[0] = _mm256_unpacklo_epi16(src_0, src_1);                                 \
  |  |  329|   884k|  s[2] = _mm256_unpackhi_epi16(src_0, src_1);                                 \
  |  |  330|   884k|                                                                              \
  |  |  331|  5.92M|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (331:15): [True: 5.04M, False: 884k]
  |  |  ------------------
  |  |  332|  5.04M|    const int16_t *data = &im_block[i * im_stride];                           \
  |  |  333|  5.04M|    const __m256i s4 = _mm256_loadu_si256((__m256i *)(data + 2 * im_stride)); \
  |  |  334|  5.04M|    const __m256i s5 = _mm256_loadu_si256((__m256i *)(data + 3 * im_stride)); \
  |  |  335|  5.04M|    s[1] = _mm256_unpacklo_epi16(s4, s5);                                     \
  |  |  336|  5.04M|    s[3] = _mm256_unpackhi_epi16(s4, s5);                                     \
  |  |  337|  5.04M|                                                                              \
  |  |  338|  5.04M|    __m256i res_a = convolve_4tap(s, coeffs_v);                               \
  |  |  339|  5.04M|    __m256i res_b = convolve_4tap(s + 2, coeffs_v);                           \
  |  |  340|  5.04M|                                                                              \
  |  |  341|  5.04M|    sr_2d_ver_round_and_store(res_a, res_b, dst_ptr, dst_stride,              \
  |  |  342|  5.04M|                              round_const_v);                                 \
  |  |  343|  5.04M|    dst_ptr += 2 * dst_stride;                                                \
  |  |  344|  5.04M|                                                                              \
  |  |  345|  5.04M|    s[0] = s[1];                                                              \
  |  |  346|  5.04M|    s[2] = s[3];                                                              \
  |  |  347|  5.04M|  }
  ------------------
  329|  2.72M|      } else if (vert_tap == 6) {
  ------------------
  |  Branch (329:18): [True: 2.72M, False: 18.4E]
  ------------------
  330|  2.72M|        CONVOLVE_SR_VERTICAL_FILTER_6TAP
  ------------------
  |  |  350|  2.72M|  __m256i src_0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));  \
  |  |  351|  2.72M|  __m256i src_1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));  \
  |  |  352|  2.72M|  __m256i src_2 = _mm256_loadu_si256((__m256i *)(im_block + 2 * im_stride));  \
  |  |  353|  2.72M|  __m256i src_3 = _mm256_loadu_si256((__m256i *)(im_block + 3 * im_stride));  \
  |  |  354|  2.72M|                                                                              \
  |  |  355|  2.72M|  __m256i s[8];                                                               \
  |  |  356|  2.72M|  s[0] = _mm256_unpacklo_epi16(src_0, src_1);                                 \
  |  |  357|  2.72M|  s[1] = _mm256_unpacklo_epi16(src_2, src_3);                                 \
  |  |  358|  2.72M|                                                                              \
  |  |  359|  2.72M|  s[3] = _mm256_unpackhi_epi16(src_0, src_1);                                 \
  |  |  360|  2.72M|  s[4] = _mm256_unpackhi_epi16(src_2, src_3);                                 \
  |  |  361|  2.72M|                                                                              \
  |  |  362|  19.9M|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (362:15): [True: 17.2M, False: 2.72M]
  |  |  ------------------
  |  |  363|  17.2M|    const int16_t *data = &im_block[i * im_stride];                           \
  |  |  364|  17.2M|                                                                              \
  |  |  365|  17.2M|    const __m256i s6 = _mm256_loadu_si256((__m256i *)(data + 4 * im_stride)); \
  |  |  366|  17.2M|    const __m256i s7 = _mm256_loadu_si256((__m256i *)(data + 5 * im_stride)); \
  |  |  367|  17.2M|                                                                              \
  |  |  368|  17.2M|    s[2] = _mm256_unpacklo_epi16(s6, s7);                                     \
  |  |  369|  17.2M|    s[5] = _mm256_unpackhi_epi16(s6, s7);                                     \
  |  |  370|  17.2M|                                                                              \
  |  |  371|  17.2M|    __m256i res_a = convolve_6tap(s, coeffs_v);                               \
  |  |  372|  17.2M|    __m256i res_b = convolve_6tap(s + 3, coeffs_v);                           \
  |  |  373|  17.2M|                                                                              \
  |  |  374|  17.2M|    sr_2d_ver_round_and_store(res_a, res_b, dst_ptr, dst_stride,              \
  |  |  375|  17.2M|                              round_const_v);                                 \
  |  |  376|  17.2M|    dst_ptr += 2 * dst_stride;                                                \
  |  |  377|  17.2M|                                                                              \
  |  |  378|  17.2M|    s[0] = s[1];                                                              \
  |  |  379|  17.2M|    s[1] = s[2];                                                              \
  |  |  380|  17.2M|                                                                              \
  |  |  381|  17.2M|    s[3] = s[4];                                                              \
  |  |  382|  17.2M|    s[4] = s[5];                                                              \
  |  |  383|  17.2M|  }
  ------------------
  331|  18.4E|      } else {
  332|  18.4E|        CONVOLVE_SR_VERTICAL_FILTER_8TAP
  ------------------
  |  |  386|  18.4E|  __m256i src_0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));  \
  |  |  387|  18.4E|  __m256i src_1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));  \
  |  |  388|  18.4E|  __m256i src_2 = _mm256_loadu_si256((__m256i *)(im_block + 2 * im_stride));  \
  |  |  389|  18.4E|  __m256i src_3 = _mm256_loadu_si256((__m256i *)(im_block + 3 * im_stride));  \
  |  |  390|  18.4E|  __m256i src_4 = _mm256_loadu_si256((__m256i *)(im_block + 4 * im_stride));  \
  |  |  391|  18.4E|  __m256i src_5 = _mm256_loadu_si256((__m256i *)(im_block + 5 * im_stride));  \
  |  |  392|  18.4E|                                                                              \
  |  |  393|  18.4E|  __m256i s[8];                                                               \
  |  |  394|  18.4E|  s[0] = _mm256_unpacklo_epi16(src_0, src_1);                                 \
  |  |  395|  18.4E|  s[1] = _mm256_unpacklo_epi16(src_2, src_3);                                 \
  |  |  396|  18.4E|  s[2] = _mm256_unpacklo_epi16(src_4, src_5);                                 \
  |  |  397|  18.4E|                                                                              \
  |  |  398|  18.4E|  s[4] = _mm256_unpackhi_epi16(src_0, src_1);                                 \
  |  |  399|  18.4E|  s[5] = _mm256_unpackhi_epi16(src_2, src_3);                                 \
  |  |  400|  18.4E|  s[6] = _mm256_unpackhi_epi16(src_4, src_5);                                 \
  |  |  401|  18.4E|                                                                              \
  |  |  402|  18.4E|  for (i = 0; i < h; i += 2) {                                                \
  |  |  ------------------
  |  |  |  Branch (402:15): [True: 0, False: 18.4E]
  |  |  ------------------
  |  |  403|      0|    const int16_t *data = &im_block[i * im_stride];                           \
  |  |  404|      0|                                                                              \
  |  |  405|      0|    const __m256i s6 = _mm256_loadu_si256((__m256i *)(data + 6 * im_stride)); \
  |  |  406|      0|    const __m256i s7 = _mm256_loadu_si256((__m256i *)(data + 7 * im_stride)); \
  |  |  407|      0|                                                                              \
  |  |  408|      0|    s[3] = _mm256_unpacklo_epi16(s6, s7);                                     \
  |  |  409|      0|    s[7] = _mm256_unpackhi_epi16(s6, s7);                                     \
  |  |  410|      0|                                                                              \
  |  |  411|      0|    __m256i res_a = convolve(s, coeffs_v);                                    \
  |  |  412|      0|    __m256i res_b = convolve(s + 4, coeffs_v);                                \
  |  |  413|      0|                                                                              \
  |  |  414|      0|    sr_2d_ver_round_and_store(res_a, res_b, dst_ptr, dst_stride,              \
  |  |  415|      0|                              round_const_v);                                 \
  |  |  416|      0|    dst_ptr += 2 * dst_stride;                                                \
  |  |  417|      0|                                                                              \
  |  |  418|      0|    s[0] = s[1];                                                              \
  |  |  419|      0|    s[1] = s[2];                                                              \
  |  |  420|      0|    s[2] = s[3];                                                              \
  |  |  421|      0|                                                                              \
  |  |  422|      0|    s[4] = s[5];                                                              \
  |  |  423|      0|    s[5] = s[6];                                                              \
  |  |  424|      0|    s[6] = s[7];                                                              \
  |  |  425|      0|  }
  ------------------
  333|  18.4E|      }
  334|  3.59M|    }
  335|  2.84M|  }
  336|  2.84M|}

av1_convolve_y_sr_avx2:
   25|   375k|                            const int32_t subpel_y_qn) {
   26|   375k|  __m128i coeffs_128[4];
   27|   375k|  __m256i coeffs[6];
   28|   375k|  int x = 0, y = h;
   29|       |
   30|   375k|  int i, vert_tap = get_filter_tap(filter_params_y, subpel_y_qn);
   31|   375k|  assert(vert_tap == 2 || vert_tap == 4 || vert_tap == 6 || vert_tap == 8 ||
   32|   375k|         vert_tap == 12);
   33|   375k|  assert(!(w % 2));
   34|   375k|  assert(!(h % 2));
   35|       |
   36|   375k|  const int fo_vert = vert_tap / 2 - 1;
   37|   375k|  const uint8_t *const src_ptr = src - fo_vert * src_stride;
   38|   375k|  const uint8_t *data = src_ptr;
   39|   375k|  uint8_t *dst_ptr = dst;
   40|       |
   41|   375k|  if (vert_tap == 2) {
  ------------------
  |  Branch (41:7): [True: 824, False: 374k]
  ------------------
   42|    824|    if (subpel_y_qn != 8) {
  ------------------
  |  Branch (42:9): [True: 0, False: 824]
  ------------------
   43|      0|      if (w <= 4) {
  ------------------
  |  Branch (43:11): [True: 0, False: 0]
  ------------------
   44|      0|        prepare_coeffs_2t_ssse3(filter_params_y, subpel_y_qn, coeffs_128);
   45|      0|        __m128i d[2], res;
   46|      0|        if (w == 2) {
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|          d[0] = _mm_cvtsi32_si128(loadu_int16(data));
   48|       |
   49|      0|          do {
   50|      0|            convolve_y_2tap_2x2_ssse3(data, src_stride, coeffs_128, d, &res);
   51|      0|            res = round_sr_y_ssse3(res);
   52|      0|            pack_store_u8_2x2_sse2(res, dst_ptr, dst_stride);
   53|       |
   54|      0|            dst_ptr += 2 * dst_stride;
   55|      0|            data += 2 * src_stride;
   56|      0|            y -= 2;
   57|      0|          } while (y > 0);
  ------------------
  |  Branch (57:20): [True: 0, False: 0]
  ------------------
   58|      0|        } else {
   59|      0|          assert(w == 4);
   60|      0|          d[0] = _mm_cvtsi32_si128(loadu_int32(data));
   61|       |
   62|      0|          do {
   63|      0|            convolve_y_2tap_4x2_ssse3(data, src_stride, coeffs_128, d, &res);
   64|      0|            res = round_sr_y_ssse3(res);
   65|      0|            pack_store_u8_4x2_sse2(res, dst_ptr, dst_stride);
   66|       |
   67|      0|            dst_ptr += 2 * dst_stride;
   68|      0|            data += 2 * src_stride;
   69|      0|            y -= 2;
   70|      0|          } while (y > 0);
  ------------------
  |  Branch (70:20): [True: 0, False: 0]
  ------------------
   71|      0|        }
   72|      0|      } else {
   73|      0|        prepare_coeffs_2t_lowbd(filter_params_y, subpel_y_qn, coeffs);
   74|       |
   75|      0|        if (w == 8) {
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  ------------------
   76|      0|          __m128i d[2];
   77|      0|          d[0] = _mm_loadl_epi64((__m128i *)data);
   78|       |
   79|      0|          do {
   80|      0|            __m256i res;
   81|      0|            convolve_y_2tap_8x2_avx2(data, src_stride, coeffs, d, &res);
   82|      0|            round_pack_store_y_8x2_avx2(res, dst_ptr, dst_stride);
   83|       |
   84|      0|            dst_ptr += 2 * dst_stride;
   85|      0|            data += 2 * src_stride;
   86|      0|            y -= 2;
   87|       |
   88|      0|          } while (y > 0);
  ------------------
  |  Branch (88:20): [True: 0, False: 0]
  ------------------
   89|       |
   90|      0|        } else if (w == 16) {
  ------------------
  |  Branch (90:20): [True: 0, False: 0]
  ------------------
   91|      0|          __m128i d[2];
   92|      0|          d[0] = _mm_loadu_si128((__m128i *)data);
   93|       |
   94|      0|          do {
   95|      0|            __m256i res[2];
   96|      0|            convolve_y_2tap_16x2_avx2(data, src_stride, coeffs, d, res);
   97|      0|            round_pack_store_y_16x2_avx2(res, dst_ptr, dst_stride);
   98|       |
   99|      0|            dst_ptr += 2 * dst_stride;
  100|      0|            data += 2 * src_stride;
  101|      0|            y -= 2;
  102|      0|          } while (y > 0);
  ------------------
  |  Branch (102:20): [True: 0, False: 0]
  ------------------
  103|       |
  104|      0|        } else {
  105|      0|          assert(!(w % 32));
  106|       |
  107|      0|          __m256i d[2];
  108|      0|          do {
  109|      0|            data = src_ptr + x;
  110|      0|            dst_ptr = dst + x;
  111|      0|            y = h;
  112|       |
  113|      0|            d[0] = _mm256_loadu_si256((__m256i *)data);
  114|       |
  115|      0|            do {
  116|      0|              __m256i res[4];
  117|      0|              convolve_y_2tap_32x2_avx2(data, src_stride, coeffs, d, res);
  118|      0|              round_pack_store_y_32x2_avx2(res, dst_ptr, dst_stride);
  119|       |
  120|      0|              dst_ptr += 2 * dst_stride;
  121|      0|              data += 2 * src_stride;
  122|      0|              y -= 2;
  123|      0|            } while (y > 0);
  ------------------
  |  Branch (123:22): [True: 0, False: 0]
  ------------------
  124|       |
  125|      0|            x += 32;
  126|      0|          } while (x < w);
  ------------------
  |  Branch (126:20): [True: 0, False: 0]
  ------------------
  127|      0|        }
  128|      0|      }
  129|    824|    } else {
  130|    824|      if (w <= 16) {
  ------------------
  |  Branch (130:11): [True: 0, False: 824]
  ------------------
  131|      0|        __m128i s[2], res;
  132|       |
  133|      0|        if (w == 2) {
  ------------------
  |  Branch (133:13): [True: 0, False: 0]
  ------------------
  134|      0|          s[0] = _mm_cvtsi32_si128(loadu_int16(data));
  135|       |
  136|      0|          do {
  137|      0|            s[1] = _mm_cvtsi32_si128(loadu_int16(data + src_stride));
  138|      0|            res = _mm_avg_epu8(s[0], s[1]);
  139|      0|            xx_storel_16(dst_ptr, res);
  140|      0|            s[0] = _mm_cvtsi32_si128(loadu_int16(data + 2 * src_stride));
  141|      0|            res = _mm_avg_epu8(s[1], s[0]);
  142|      0|            xx_storel_16(dst_ptr + dst_stride, res);
  143|       |
  144|      0|            data += 2 * src_stride;
  145|      0|            dst_ptr += 2 * dst_stride;
  146|      0|            y -= 2;
  147|      0|          } while (y > 0);
  ------------------
  |  Branch (147:20): [True: 0, False: 0]
  ------------------
  148|      0|        } else if (w == 4) {
  ------------------
  |  Branch (148:20): [True: 0, False: 0]
  ------------------
  149|      0|          s[0] = _mm_cvtsi32_si128(loadu_int32(data));
  150|       |
  151|      0|          do {
  152|      0|            s[1] = _mm_cvtsi32_si128(loadu_int32(data + src_stride));
  153|      0|            res = _mm_avg_epu8(s[0], s[1]);
  154|      0|            xx_storel_32(dst_ptr, res);
  155|      0|            s[0] = _mm_cvtsi32_si128(loadu_int32(data + 2 * src_stride));
  156|      0|            res = _mm_avg_epu8(s[1], s[0]);
  157|      0|            xx_storel_32(dst_ptr + dst_stride, res);
  158|       |
  159|      0|            data += 2 * src_stride;
  160|      0|            dst_ptr += 2 * dst_stride;
  161|      0|            y -= 2;
  162|      0|          } while (y > 0);
  ------------------
  |  Branch (162:20): [True: 0, False: 0]
  ------------------
  163|      0|        } else if (w == 8) {
  ------------------
  |  Branch (163:20): [True: 0, False: 0]
  ------------------
  164|      0|          s[0] = _mm_loadl_epi64((__m128i *)data);
  165|       |
  166|      0|          do {
  167|      0|            s[1] = _mm_loadl_epi64((__m128i *)(data + src_stride));
  168|      0|            res = _mm_avg_epu8(s[0], s[1]);
  169|      0|            _mm_storel_epi64((__m128i *)dst_ptr, res);
  170|      0|            s[0] = _mm_loadl_epi64((__m128i *)(data + 2 * src_stride));
  171|      0|            res = _mm_avg_epu8(s[1], s[0]);
  172|      0|            _mm_storel_epi64((__m128i *)(dst_ptr + dst_stride), res);
  173|       |
  174|      0|            data += 2 * src_stride;
  175|      0|            dst_ptr += 2 * dst_stride;
  176|      0|            y -= 2;
  177|      0|          } while (y > 0);
  ------------------
  |  Branch (177:20): [True: 0, False: 0]
  ------------------
  178|      0|        } else {
  179|      0|          assert(w == 16);
  180|       |
  181|      0|          s[0] = _mm_loadu_si128((__m128i *)data);
  182|       |
  183|      0|          do {
  184|      0|            s[1] = _mm_loadu_si128((__m128i *)(data + src_stride));
  185|      0|            res = _mm_avg_epu8(s[0], s[1]);
  186|      0|            _mm_storeu_si128((__m128i *)dst_ptr, res);
  187|      0|            s[0] = _mm_loadu_si128((__m128i *)(data + 2 * src_stride));
  188|      0|            res = _mm_avg_epu8(s[1], s[0]);
  189|      0|            _mm_storeu_si128((__m128i *)(dst_ptr + dst_stride), res);
  190|       |
  191|      0|            data += 2 * src_stride;
  192|      0|            dst_ptr += 2 * dst_stride;
  193|      0|            y -= 2;
  194|      0|          } while (y > 0);
  ------------------
  |  Branch (194:20): [True: 0, False: 0]
  ------------------
  195|      0|        }
  196|    824|      } else {
  197|    824|        assert(!(w % 32));
  198|       |
  199|    824|        __m256i s[2], res;
  200|    824|        do {
  201|    824|          data = src_ptr + x;
  202|    824|          dst_ptr = dst + x;
  203|    824|          y = h;
  204|       |
  205|    824|          s[0] = _mm256_loadu_si256((__m256i *)data);
  206|       |
  207|  13.1k|          do {
  208|  13.1k|            s[1] = _mm256_loadu_si256((__m256i *)(data + src_stride));
  209|  13.1k|            res = _mm256_avg_epu8(s[0], s[1]);
  210|  13.1k|            _mm256_storeu_si256((__m256i *)dst_ptr, res);
  211|  13.1k|            s[0] = _mm256_loadu_si256((__m256i *)(data + 2 * src_stride));
  212|  13.1k|            res = _mm256_avg_epu8(s[1], s[0]);
  213|  13.1k|            _mm256_storeu_si256((__m256i *)(dst_ptr + dst_stride), res);
  214|       |
  215|  13.1k|            data += 2 * src_stride;
  216|  13.1k|            dst_ptr += 2 * dst_stride;
  217|  13.1k|            y -= 2;
  218|  13.1k|          } while (y > 0);
  ------------------
  |  Branch (218:20): [True: 12.3k, False: 824]
  ------------------
  219|       |
  220|    824|          x += 32;
  221|    824|        } while (x < w);
  ------------------
  |  Branch (221:18): [True: 0, False: 824]
  ------------------
  222|    824|      }
  223|    824|    }
  224|   374k|  } else if (vert_tap == 4) {
  ------------------
  |  Branch (224:14): [True: 101k, False: 273k]
  ------------------
  225|   101k|    if (w <= 4) {
  ------------------
  |  Branch (225:9): [True: 31.5k, False: 69.7k]
  ------------------
  226|  31.5k|      prepare_coeffs_4t_ssse3(filter_params_y, subpel_y_qn, coeffs_128);
  227|  31.5k|      __m128i d[4], s[2];
  228|       |
  229|  31.5k|      if (w == 2) {
  ------------------
  |  Branch (229:11): [True: 0, False: 31.5k]
  ------------------
  230|      0|        d[0] = _mm_cvtsi32_si128(loadu_int16(data + 0 * src_stride));
  231|      0|        d[1] = _mm_cvtsi32_si128(loadu_int16(data + 1 * src_stride));
  232|      0|        d[2] = _mm_cvtsi32_si128(loadu_int16(data + 2 * src_stride));
  233|       |
  234|      0|        const __m128i src_01a = _mm_unpacklo_epi16(d[0], d[1]);
  235|      0|        const __m128i src_12a = _mm_unpacklo_epi16(d[1], d[2]);
  236|       |
  237|      0|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  238|      0|        do {
  239|      0|          __m128i res;
  240|      0|          convolve_y_4tap_2x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  241|      0|          res = round_sr_y_ssse3(res);
  242|      0|          pack_store_u8_2x2_sse2(res, dst_ptr, dst_stride);
  243|       |
  244|      0|          dst_ptr += 2 * dst_stride;
  245|      0|          data += 2 * src_stride;
  246|      0|          y -= 2;
  247|       |
  248|      0|          s[0] = s[1];
  249|      0|        } while (y > 0);
  ------------------
  |  Branch (249:18): [True: 0, False: 0]
  ------------------
  250|       |
  251|  31.5k|      } else {
  252|  31.5k|        assert(w == 4);
  253|       |
  254|  31.5k|        d[0] = _mm_cvtsi32_si128(loadu_int32(data + 0 * src_stride));
  255|  31.5k|        d[1] = _mm_cvtsi32_si128(loadu_int32(data + 1 * src_stride));
  256|  31.5k|        d[2] = _mm_cvtsi32_si128(loadu_int32(data + 2 * src_stride));
  257|       |
  258|  31.5k|        const __m128i src_01a = _mm_unpacklo_epi32(d[0], d[1]);
  259|  31.5k|        const __m128i src_12a = _mm_unpacklo_epi32(d[1], d[2]);
  260|       |
  261|  31.5k|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  262|  68.0k|        do {
  263|  68.0k|          __m128i res;
  264|  68.0k|          convolve_y_4tap_4x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  265|  68.0k|          res = round_sr_y_ssse3(res);
  266|  68.0k|          pack_store_u8_4x2_sse2(res, dst_ptr, dst_stride);
  267|       |
  268|  68.0k|          dst_ptr += 2 * dst_stride;
  269|  68.0k|          data += 2 * src_stride;
  270|  68.0k|          y -= 2;
  271|       |
  272|  68.0k|          s[0] = s[1];
  273|  68.0k|        } while (y > 0);
  ------------------
  |  Branch (273:18): [True: 36.5k, False: 31.5k]
  ------------------
  274|  31.5k|      }
  275|  69.7k|    } else {
  276|  69.7k|      prepare_coeffs_4t_lowbd(filter_params_y, subpel_y_qn, coeffs);
  277|       |
  278|  69.7k|      if (w == 8) {
  ------------------
  |  Branch (278:11): [True: 57.4k, False: 12.2k]
  ------------------
  279|  57.4k|        __m128i d[4];
  280|  57.4k|        __m256i s[2];
  281|       |
  282|  57.4k|        d[0] = _mm_loadl_epi64((__m128i *)(data + 0 * src_stride));
  283|  57.4k|        d[1] = _mm_loadl_epi64((__m128i *)(data + 1 * src_stride));
  284|  57.4k|        d[2] = _mm_loadl_epi64((__m128i *)(data + 2 * src_stride));
  285|       |
  286|  57.4k|        const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  287|  57.4k|        const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  288|       |
  289|  57.4k|        s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  290|   241k|        do {
  291|   241k|          __m256i res;
  292|   241k|          convolve_y_4tap_8x2_avx2(data, src_stride, coeffs, d, s, &res);
  293|   241k|          round_pack_store_y_8x2_avx2(res, dst_ptr, dst_stride);
  294|       |
  295|   241k|          dst_ptr += 2 * dst_stride;
  296|   241k|          data += 2 * src_stride;
  297|   241k|          y -= 2;
  298|       |
  299|   241k|          s[0] = s[1];
  300|   241k|        } while (y > 0);
  ------------------
  |  Branch (300:18): [True: 183k, False: 57.4k]
  ------------------
  301|  57.4k|      } else if (w == 16) {
  ------------------
  |  Branch (301:18): [True: 10.7k, False: 1.52k]
  ------------------
  302|  10.7k|        __m128i d[4];
  303|  10.7k|        __m256i s[4];
  304|       |
  305|  10.7k|        d[0] = _mm_loadu_si128((__m128i *)(data + 0 * src_stride));
  306|  10.7k|        d[1] = _mm_loadu_si128((__m128i *)(data + 1 * src_stride));
  307|  10.7k|        d[2] = _mm_loadu_si128((__m128i *)(data + 2 * src_stride));
  308|       |
  309|  10.7k|        const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  310|  10.7k|        const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  311|       |
  312|  10.7k|        s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  313|  10.7k|        s[2] = _mm256_unpackhi_epi8(src_01a, src_12a);
  314|       |
  315|  84.1k|        do {
  316|  84.1k|          __m256i res[2];
  317|  84.1k|          convolve_y_4tap_16x2_avx2(data, src_stride, coeffs, d, s, res);
  318|  84.1k|          round_pack_store_y_16x2_avx2(res, dst_ptr, dst_stride);
  319|       |
  320|  84.1k|          dst_ptr += 2 * dst_stride;
  321|  84.1k|          data += 2 * src_stride;
  322|  84.1k|          y -= 2;
  323|       |
  324|  84.1k|          s[0] = s[1];
  325|  84.1k|          s[2] = s[3];
  326|  84.1k|        } while (y > 0);
  ------------------
  |  Branch (326:18): [True: 73.3k, False: 10.7k]
  ------------------
  327|  10.7k|      } else {
  328|  1.52k|        assert(!(w % 32));
  329|       |
  330|  1.52k|        __m256i d[4], s1[4], s2[4];
  331|  1.53k|        do {
  332|  1.53k|          data = src_ptr + x;
  333|  1.53k|          dst_ptr = dst + x;
  334|  1.53k|          y = h;
  335|       |
  336|  1.53k|          d[0] = _mm256_loadu_si256((__m256i *)(data + 0 * src_stride));
  337|  1.53k|          d[1] = _mm256_loadu_si256((__m256i *)(data + 1 * src_stride));
  338|  1.53k|          d[2] = _mm256_loadu_si256((__m256i *)(data + 2 * src_stride));
  339|       |
  340|  1.53k|          s1[0] = _mm256_unpacklo_epi8(d[0], d[1]);
  341|  1.53k|          s1[2] = _mm256_unpackhi_epi8(d[0], d[1]);
  342|       |
  343|  1.53k|          s2[0] = _mm256_unpacklo_epi8(d[1], d[2]);
  344|  1.53k|          s2[2] = _mm256_unpackhi_epi8(d[1], d[2]);
  345|       |
  346|  23.9k|          do {
  347|  23.9k|            __m256i res[4];
  348|  23.9k|            convolve_y_4tap_32x2_avx2(data, src_stride, coeffs, d, s1, s2, res);
  349|  23.9k|            round_pack_store_y_32x2_avx2(res, dst_ptr, dst_stride);
  350|       |
  351|  23.9k|            dst_ptr += 2 * dst_stride;
  352|  23.9k|            data += 2 * src_stride;
  353|  23.9k|            y -= 2;
  354|       |
  355|  23.9k|            s1[0] = s1[1];
  356|  23.9k|            s1[2] = s1[3];
  357|       |
  358|  23.9k|            s2[0] = s2[1];
  359|  23.9k|            s2[2] = s2[3];
  360|  23.9k|          } while (y > 0);
  ------------------
  |  Branch (360:20): [True: 22.3k, False: 1.53k]
  ------------------
  361|       |
  362|  1.53k|          x += 32;
  363|  1.53k|        } while (x < w);
  ------------------
  |  Branch (363:18): [True: 7, False: 1.52k]
  ------------------
  364|  1.52k|      }
  365|  69.7k|    }
  366|   273k|  } else if (vert_tap == 6) {
  ------------------
  |  Branch (366:14): [True: 273k, False: 18.4E]
  ------------------
  367|   273k|    if (w <= 4) {
  ------------------
  |  Branch (367:9): [True: 12.5k, False: 260k]
  ------------------
  368|  12.5k|      prepare_coeffs_6t_ssse3(filter_params_y, subpel_y_qn, coeffs_128);
  369|       |
  370|  12.5k|      __m128i d[6], s[3];
  371|  12.5k|      if (w == 2) {
  ------------------
  |  Branch (371:11): [True: 0, False: 12.5k]
  ------------------
  372|      0|        d[0] = _mm_cvtsi32_si128(loadu_int16(data + 0 * src_stride));
  373|      0|        d[1] = _mm_cvtsi32_si128(loadu_int16(data + 1 * src_stride));
  374|      0|        d[2] = _mm_cvtsi32_si128(loadu_int16(data + 2 * src_stride));
  375|      0|        d[3] = _mm_cvtsi32_si128(loadu_int16(data + 3 * src_stride));
  376|      0|        d[4] = _mm_cvtsi32_si128(loadu_int16(data + 4 * src_stride));
  377|       |
  378|      0|        const __m128i src_01a = _mm_unpacklo_epi16(d[0], d[1]);
  379|      0|        const __m128i src_12a = _mm_unpacklo_epi16(d[1], d[2]);
  380|      0|        const __m128i src_23a = _mm_unpacklo_epi16(d[2], d[3]);
  381|      0|        const __m128i src_34a = _mm_unpacklo_epi16(d[3], d[4]);
  382|       |
  383|      0|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  384|      0|        s[1] = _mm_unpacklo_epi8(src_23a, src_34a);
  385|       |
  386|      0|        do {
  387|      0|          __m128i res;
  388|      0|          convolve_y_6tap_2x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  389|      0|          res = round_sr_y_ssse3(res);
  390|      0|          pack_store_u8_2x2_sse2(res, dst_ptr, dst_stride);
  391|       |
  392|      0|          dst_ptr += 2 * dst_stride;
  393|      0|          data += 2 * src_stride;
  394|      0|          y -= 2;
  395|       |
  396|      0|          s[0] = s[1];
  397|      0|          s[1] = s[2];
  398|      0|        } while (y > 0);
  ------------------
  |  Branch (398:18): [True: 0, False: 0]
  ------------------
  399|       |
  400|  12.5k|      } else {
  401|  12.5k|        assert(w == 4);
  402|  12.5k|        d[0] = _mm_cvtsi32_si128(loadu_int32(data + 0 * src_stride));
  403|  12.5k|        d[1] = _mm_cvtsi32_si128(loadu_int32(data + 1 * src_stride));
  404|  12.5k|        d[2] = _mm_cvtsi32_si128(loadu_int32(data + 2 * src_stride));
  405|  12.5k|        d[3] = _mm_cvtsi32_si128(loadu_int32(data + 3 * src_stride));
  406|  12.5k|        d[4] = _mm_cvtsi32_si128(loadu_int32(data + 4 * src_stride));
  407|       |
  408|  12.5k|        const __m128i src_01a = _mm_unpacklo_epi32(d[0], d[1]);
  409|  12.5k|        const __m128i src_12a = _mm_unpacklo_epi32(d[1], d[2]);
  410|  12.5k|        const __m128i src_23a = _mm_unpacklo_epi32(d[2], d[3]);
  411|  12.5k|        const __m128i src_34a = _mm_unpacklo_epi32(d[3], d[4]);
  412|       |
  413|  12.5k|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  414|  12.5k|        s[1] = _mm_unpacklo_epi8(src_23a, src_34a);
  415|       |
  416|  50.2k|        do {
  417|  50.2k|          __m128i res;
  418|  50.2k|          convolve_y_6tap_4x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  419|  50.2k|          res = round_sr_y_ssse3(res);
  420|  50.2k|          pack_store_u8_4x2_sse2(res, dst_ptr, dst_stride);
  421|       |
  422|  50.2k|          dst_ptr += 2 * dst_stride;
  423|  50.2k|          data += 2 * src_stride;
  424|  50.2k|          y -= 2;
  425|       |
  426|  50.2k|          s[0] = s[1];
  427|  50.2k|          s[1] = s[2];
  428|  50.2k|        } while (y > 0);
  ------------------
  |  Branch (428:18): [True: 37.6k, False: 12.5k]
  ------------------
  429|  12.5k|      }
  430|   260k|    } else {
  431|   260k|      prepare_coeffs_6t_lowbd(filter_params_y, subpel_y_qn, coeffs);
  432|       |
  433|   260k|      if (w == 8) {
  ------------------
  |  Branch (433:11): [True: 217k, False: 42.9k]
  ------------------
  434|   217k|        __m128i d[6];
  435|   217k|        __m256i s[3];
  436|       |
  437|   217k|        d[0] = _mm_loadl_epi64((__m128i *)(data + 0 * src_stride));
  438|   217k|        d[1] = _mm_loadl_epi64((__m128i *)(data + 1 * src_stride));
  439|   217k|        d[2] = _mm_loadl_epi64((__m128i *)(data + 2 * src_stride));
  440|   217k|        d[3] = _mm_loadl_epi64((__m128i *)(data + 3 * src_stride));
  441|   217k|        d[4] = _mm_loadl_epi64((__m128i *)(data + 4 * src_stride));
  442|       |
  443|   217k|        const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  444|   217k|        const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  445|   217k|        const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
  446|   217k|        const __m256i src_34a = _mm256_setr_m128i(d[3], d[4]);
  447|       |
  448|   217k|        s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  449|   217k|        s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
  450|       |
  451|   915k|        do {
  452|   915k|          __m256i res;
  453|   915k|          convolve_y_6tap_8x2_avx2(data, src_stride, coeffs, d, s, &res);
  454|   915k|          round_pack_store_y_8x2_avx2(res, dst_ptr, dst_stride);
  455|       |
  456|   915k|          dst_ptr += 2 * dst_stride;
  457|   915k|          data += 2 * src_stride;
  458|   915k|          y -= 2;
  459|       |
  460|   915k|          s[0] = s[1];
  461|   915k|          s[1] = s[2];
  462|   915k|        } while (y > 0);
  ------------------
  |  Branch (462:18): [True: 697k, False: 217k]
  ------------------
  463|       |
  464|   217k|      } else {
  465|  42.9k|        assert(!(w % 16));
  466|       |
  467|  42.9k|        __m128i d[6];
  468|  42.9k|        __m256i s[6];
  469|  50.6k|        do {
  470|  50.6k|          data = src_ptr + x;
  471|  50.6k|          dst_ptr = dst + x;
  472|  50.6k|          y = h;
  473|       |
  474|  50.6k|          d[0] = _mm_loadu_si128((__m128i *)(data + 0 * src_stride));
  475|  50.6k|          d[1] = _mm_loadu_si128((__m128i *)(data + 1 * src_stride));
  476|  50.6k|          d[2] = _mm_loadu_si128((__m128i *)(data + 2 * src_stride));
  477|  50.6k|          d[3] = _mm_loadu_si128((__m128i *)(data + 3 * src_stride));
  478|  50.6k|          d[4] = _mm_loadu_si128((__m128i *)(data + 4 * src_stride));
  479|       |
  480|  50.6k|          const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  481|  50.6k|          const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  482|  50.6k|          const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
  483|  50.6k|          const __m256i src_34a = _mm256_setr_m128i(d[3], d[4]);
  484|       |
  485|  50.6k|          s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  486|  50.6k|          s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
  487|       |
  488|  50.6k|          s[3] = _mm256_unpackhi_epi8(src_01a, src_12a);
  489|  50.6k|          s[4] = _mm256_unpackhi_epi8(src_23a, src_34a);
  490|       |
  491|   542k|          do {
  492|   542k|            __m256i res[2];
  493|   542k|            convolve_y_6tap_16x2_avx2(data, src_stride, coeffs, d, s, res);
  494|   542k|            round_pack_store_y_16x2_avx2(res, dst_ptr, dst_stride);
  495|       |
  496|   542k|            dst_ptr += 2 * dst_stride;
  497|   542k|            data += 2 * src_stride;
  498|   542k|            y -= 2;
  499|       |
  500|   542k|            s[0] = s[1];
  501|   542k|            s[1] = s[2];
  502|       |
  503|   542k|            s[3] = s[4];
  504|   542k|            s[4] = s[5];
  505|   542k|          } while (y > 0);
  ------------------
  |  Branch (505:20): [True: 491k, False: 50.6k]
  ------------------
  506|       |
  507|  50.6k|          x += 16;
  508|  50.6k|        } while (x < w);
  ------------------
  |  Branch (508:18): [True: 7.71k, False: 42.9k]
  ------------------
  509|  42.9k|      }
  510|   260k|    }
  511|  18.4E|  } else if (vert_tap == 12) {  // vert_tap == 12
  ------------------
  |  Branch (511:14): [True: 0, False: 18.4E]
  ------------------
  512|      0|    __m128i d[12];
  513|      0|    __m256i s[12];
  514|      0|    prepare_coeffs_12taps(filter_params_y, subpel_y_qn, coeffs);
  515|      0|    const __m256i v_zero = _mm256_setzero_si256();
  516|      0|    __m128i right_shift = _mm_cvtsi32_si128(FILTER_BITS);
  ------------------
  |  |   21|      0|#define FILTER_BITS 7
  ------------------
  517|      0|    __m256i right_shift_const = _mm256_set1_epi32((1 << FILTER_BITS) >> 1);
  ------------------
  |  |   21|      0|#define FILTER_BITS 7
  ------------------
  518|       |
  519|      0|    for (int j = 0; j < w; j += 8) {
  ------------------
  |  Branch (519:21): [True: 0, False: 0]
  ------------------
  520|      0|      data = &src_ptr[j];
  521|      0|      __m256i src10;
  522|       |
  523|      0|      d[0] = _mm_loadl_epi64((__m128i *)(data + 0 * src_stride));
  524|      0|      d[1] = _mm_loadl_epi64((__m128i *)(data + 1 * src_stride));
  525|      0|      d[2] = _mm_loadl_epi64((__m128i *)(data + 2 * src_stride));
  526|      0|      d[3] = _mm_loadl_epi64((__m128i *)(data + 3 * src_stride));
  527|      0|      d[4] = _mm_loadl_epi64((__m128i *)(data + 4 * src_stride));
  528|      0|      d[5] = _mm_loadl_epi64((__m128i *)(data + 5 * src_stride));
  529|      0|      d[6] = _mm_loadl_epi64((__m128i *)(data + 6 * src_stride));
  530|      0|      d[7] = _mm_loadl_epi64((__m128i *)(data + 7 * src_stride));
  531|      0|      d[8] = _mm_loadl_epi64((__m128i *)(data + 8 * src_stride));
  532|      0|      d[9] = _mm_loadl_epi64((__m128i *)(data + 9 * src_stride));
  533|       |      // Load lines a and b. Line a to lower 128, line b to upper 128
  534|      0|      const __m256i src_01a = _mm256_permute2x128_si256(
  535|      0|          _mm256_castsi128_si256(d[0]), _mm256_castsi128_si256(d[1]), 0x20);
  536|       |
  537|      0|      const __m256i src_12a = _mm256_permute2x128_si256(
  538|      0|          _mm256_castsi128_si256(d[1]), _mm256_castsi128_si256(d[2]), 0x20);
  539|       |
  540|      0|      const __m256i src_23a = _mm256_permute2x128_si256(
  541|      0|          _mm256_castsi128_si256(d[2]), _mm256_castsi128_si256(d[3]), 0x20);
  542|       |
  543|      0|      const __m256i src_34a = _mm256_permute2x128_si256(
  544|      0|          _mm256_castsi128_si256(d[3]), _mm256_castsi128_si256(d[4]), 0x20);
  545|       |
  546|      0|      const __m256i src_45a = _mm256_permute2x128_si256(
  547|      0|          _mm256_castsi128_si256(d[4]), _mm256_castsi128_si256(d[5]), 0x20);
  548|       |
  549|      0|      const __m256i src_56a = _mm256_permute2x128_si256(
  550|      0|          _mm256_castsi128_si256(d[5]), _mm256_castsi128_si256(d[6]), 0x20);
  551|       |
  552|      0|      const __m256i src_67a = _mm256_permute2x128_si256(
  553|      0|          _mm256_castsi128_si256(d[6]), _mm256_castsi128_si256(d[7]), 0x20);
  554|       |
  555|      0|      const __m256i src_78a = _mm256_permute2x128_si256(
  556|      0|          _mm256_castsi128_si256(d[7]), _mm256_castsi128_si256(d[8]), 0x20);
  557|       |
  558|      0|      const __m256i src_89a = _mm256_permute2x128_si256(
  559|      0|          _mm256_castsi128_si256(d[8]), _mm256_castsi128_si256(d[9]), 0x20);
  560|       |
  561|      0|      src10 = _mm256_castsi128_si256(
  562|      0|          _mm_loadl_epi64((__m128i *)(data + 10 * src_stride)));
  563|      0|      const __m256i src_910a =
  564|      0|          _mm256_permute2x128_si256(_mm256_castsi128_si256(d[9]), src10, 0x20);
  565|       |
  566|      0|      const __m256i src_01 = _mm256_unpacklo_epi8(src_01a, v_zero);
  567|      0|      const __m256i src_12 = _mm256_unpacklo_epi8(src_12a, v_zero);
  568|      0|      const __m256i src_23 = _mm256_unpacklo_epi8(src_23a, v_zero);
  569|      0|      const __m256i src_34 = _mm256_unpacklo_epi8(src_34a, v_zero);
  570|      0|      const __m256i src_45 = _mm256_unpacklo_epi8(src_45a, v_zero);
  571|      0|      const __m256i src_56 = _mm256_unpacklo_epi8(src_56a, v_zero);
  572|      0|      const __m256i src_67 = _mm256_unpacklo_epi8(src_67a, v_zero);
  573|      0|      const __m256i src_78 = _mm256_unpacklo_epi8(src_78a, v_zero);
  574|      0|      const __m256i src_89 = _mm256_unpacklo_epi8(src_89a, v_zero);
  575|      0|      const __m256i src_910 = _mm256_unpacklo_epi8(src_910a, v_zero);
  576|       |
  577|      0|      s[0] = _mm256_unpacklo_epi16(src_01, src_12);
  578|      0|      s[1] = _mm256_unpacklo_epi16(src_23, src_34);
  579|      0|      s[2] = _mm256_unpacklo_epi16(src_45, src_56);
  580|      0|      s[3] = _mm256_unpacklo_epi16(src_67, src_78);
  581|      0|      s[4] = _mm256_unpacklo_epi16(src_89, src_910);
  582|       |
  583|      0|      s[6] = _mm256_unpackhi_epi16(src_01, src_12);
  584|      0|      s[7] = _mm256_unpackhi_epi16(src_23, src_34);
  585|      0|      s[8] = _mm256_unpackhi_epi16(src_45, src_56);
  586|      0|      s[9] = _mm256_unpackhi_epi16(src_67, src_78);
  587|      0|      s[10] = _mm256_unpackhi_epi16(src_89, src_910);
  588|       |
  589|      0|      for (i = 0; i < h; i += 2) {
  ------------------
  |  Branch (589:19): [True: 0, False: 0]
  ------------------
  590|      0|        data = &src_ptr[i * src_stride + j];
  591|      0|        const __m256i src_1011a = _mm256_permute2x128_si256(
  592|      0|            src10,
  593|      0|            _mm256_castsi128_si256(
  594|      0|                _mm_loadl_epi64((__m128i *)(data + 11 * src_stride))),
  595|      0|            0x20);
  596|       |
  597|      0|        src10 = _mm256_castsi128_si256(
  598|      0|            _mm_loadl_epi64((__m128i *)(data + 12 * src_stride)));
  599|       |
  600|      0|        const __m256i src_1112a = _mm256_permute2x128_si256(
  601|      0|            _mm256_castsi128_si256(
  602|      0|                _mm_loadl_epi64((__m128i *)(data + 11 * src_stride))),
  603|      0|            src10, 0x20);
  604|       |
  605|      0|        const __m256i src_1011 = _mm256_unpacklo_epi8(src_1011a, v_zero);
  606|      0|        const __m256i src_1112 = _mm256_unpacklo_epi8(src_1112a, v_zero);
  607|       |
  608|      0|        s[5] = _mm256_unpacklo_epi16(src_1011, src_1112);
  609|      0|        s[11] = _mm256_unpackhi_epi16(src_1011, src_1112);
  610|       |
  611|      0|        const __m256i res_lo = convolve_12taps(s, coeffs);
  612|       |
  613|      0|        const __m256i res_32b_lo = _mm256_sra_epi32(
  614|      0|            _mm256_add_epi32(res_lo, right_shift_const), right_shift);
  615|       |        // 8 bit conversion and saturation to uint8
  616|      0|        __m256i res_16b_lo = _mm256_packs_epi32(res_32b_lo, res_32b_lo);
  617|      0|        __m256i res_8b_lo = _mm256_packus_epi16(res_16b_lo, res_16b_lo);
  618|       |
  619|      0|        if (w - j > 4) {
  ------------------
  |  Branch (619:13): [True: 0, False: 0]
  ------------------
  620|      0|          const __m256i res_hi = convolve_12taps(s + 6, coeffs);
  621|       |
  622|      0|          const __m256i res_32b_hi = _mm256_sra_epi32(
  623|      0|              _mm256_add_epi32(res_hi, right_shift_const), right_shift);
  624|      0|          __m256i res_16b_hi = _mm256_packs_epi32(res_32b_hi, res_32b_hi);
  625|       |          // 8 bit conversion and saturation to uint8
  626|      0|          __m256i res_8b_hi = _mm256_packus_epi16(res_16b_hi, res_16b_hi);
  627|       |
  628|      0|          __m256i res_a = _mm256_unpacklo_epi32(res_8b_lo, res_8b_hi);
  629|       |
  630|      0|          const __m128i res_0 = _mm256_extracti128_si256(res_a, 0);
  631|      0|          const __m128i res_1 = _mm256_extracti128_si256(res_a, 1);
  632|       |
  633|      0|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j], res_0);
  634|      0|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j + dst_stride],
  635|      0|                           res_1);
  636|      0|        } else {
  637|      0|          const __m128i res_0 = _mm256_extracti128_si256(res_8b_lo, 0);
  638|      0|          const __m128i res_1 = _mm256_extracti128_si256(res_8b_lo, 1);
  639|      0|          if (w - j > 2) {
  ------------------
  |  Branch (639:15): [True: 0, False: 0]
  ------------------
  640|      0|            xx_storel_32(&dst[i * dst_stride + j], res_0);
  641|      0|            xx_storel_32(&dst[i * dst_stride + j + dst_stride], res_1);
  642|      0|          } else {
  643|      0|            xx_storel_16(&dst[i * dst_stride + j], res_0);
  644|      0|            xx_storel_16(&dst[i * dst_stride + j + dst_stride], res_1);
  645|      0|          }
  646|      0|        }
  647|      0|        s[0] = s[1];
  648|      0|        s[1] = s[2];
  649|      0|        s[2] = s[3];
  650|      0|        s[3] = s[4];
  651|      0|        s[4] = s[5];
  652|       |
  653|      0|        s[6] = s[7];
  654|      0|        s[7] = s[8];
  655|      0|        s[8] = s[9];
  656|      0|        s[9] = s[10];
  657|      0|        s[10] = s[11];
  658|      0|      }
  659|      0|    }
  660|  18.4E|  } else {
  661|  18.4E|    assert(vert_tap == 8);
  662|       |
  663|  18.4E|    if (w <= 4) {
  ------------------
  |  Branch (663:9): [True: 0, False: 18.4E]
  ------------------
  664|      0|      prepare_coeffs_ssse3(filter_params_y, subpel_y_qn, coeffs_128);
  665|       |
  666|      0|      __m128i d[8], s[4], res;
  667|      0|      if (w == 2) {
  ------------------
  |  Branch (667:11): [True: 0, False: 0]
  ------------------
  668|      0|        d[0] = _mm_cvtsi32_si128(loadu_int16(data + 0 * src_stride));
  669|      0|        d[1] = _mm_cvtsi32_si128(loadu_int16(data + 1 * src_stride));
  670|      0|        d[2] = _mm_cvtsi32_si128(loadu_int16(data + 2 * src_stride));
  671|      0|        d[3] = _mm_cvtsi32_si128(loadu_int16(data + 3 * src_stride));
  672|      0|        d[4] = _mm_cvtsi32_si128(loadu_int16(data + 4 * src_stride));
  673|      0|        d[5] = _mm_cvtsi32_si128(loadu_int16(data + 5 * src_stride));
  674|      0|        d[6] = _mm_cvtsi32_si128(loadu_int16(data + 6 * src_stride));
  675|       |
  676|      0|        const __m128i src_01a = _mm_unpacklo_epi16(d[0], d[1]);
  677|      0|        const __m128i src_12a = _mm_unpacklo_epi16(d[1], d[2]);
  678|      0|        const __m128i src_23a = _mm_unpacklo_epi16(d[2], d[3]);
  679|      0|        const __m128i src_34a = _mm_unpacklo_epi16(d[3], d[4]);
  680|      0|        const __m128i src_45a = _mm_unpacklo_epi16(d[4], d[5]);
  681|      0|        const __m128i src_56a = _mm_unpacklo_epi16(d[5], d[6]);
  682|       |
  683|      0|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  684|      0|        s[1] = _mm_unpacklo_epi8(src_23a, src_34a);
  685|      0|        s[2] = _mm_unpacklo_epi8(src_45a, src_56a);
  686|       |
  687|      0|        do {
  688|      0|          convolve_y_8tap_2x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  689|      0|          res = round_sr_y_ssse3(res);
  690|      0|          pack_store_u8_2x2_sse2(res, dst_ptr, dst_stride);
  691|       |
  692|      0|          dst_ptr += 2 * dst_stride;
  693|      0|          data += 2 * src_stride;
  694|      0|          y -= 2;
  695|       |
  696|      0|          s[0] = s[1];
  697|      0|          s[1] = s[2];
  698|      0|          s[2] = s[3];
  699|      0|        } while (y > 0);
  ------------------
  |  Branch (699:18): [True: 0, False: 0]
  ------------------
  700|       |
  701|      0|      } else {
  702|      0|        assert(w == 4);
  703|       |
  704|      0|        d[0] = _mm_cvtsi32_si128(loadu_int32(data + 0 * src_stride));
  705|      0|        d[1] = _mm_cvtsi32_si128(loadu_int32(data + 1 * src_stride));
  706|      0|        d[2] = _mm_cvtsi32_si128(loadu_int32(data + 2 * src_stride));
  707|      0|        d[3] = _mm_cvtsi32_si128(loadu_int32(data + 3 * src_stride));
  708|      0|        d[4] = _mm_cvtsi32_si128(loadu_int32(data + 4 * src_stride));
  709|      0|        d[5] = _mm_cvtsi32_si128(loadu_int32(data + 5 * src_stride));
  710|      0|        d[6] = _mm_cvtsi32_si128(loadu_int32(data + 6 * src_stride));
  711|       |
  712|      0|        const __m128i src_01a = _mm_unpacklo_epi32(d[0], d[1]);
  713|      0|        const __m128i src_12a = _mm_unpacklo_epi32(d[1], d[2]);
  714|      0|        const __m128i src_23a = _mm_unpacklo_epi32(d[2], d[3]);
  715|      0|        const __m128i src_34a = _mm_unpacklo_epi32(d[3], d[4]);
  716|      0|        const __m128i src_45a = _mm_unpacklo_epi32(d[4], d[5]);
  717|      0|        const __m128i src_56a = _mm_unpacklo_epi32(d[5], d[6]);
  718|       |
  719|      0|        s[0] = _mm_unpacklo_epi8(src_01a, src_12a);
  720|      0|        s[1] = _mm_unpacklo_epi8(src_23a, src_34a);
  721|      0|        s[2] = _mm_unpacklo_epi8(src_45a, src_56a);
  722|       |
  723|      0|        do {
  724|      0|          convolve_y_8tap_4x2_ssse3(data, src_stride, coeffs_128, d, s, &res);
  725|      0|          res = round_sr_y_ssse3(res);
  726|      0|          pack_store_u8_4x2_sse2(res, dst_ptr, dst_stride);
  727|       |
  728|      0|          dst_ptr += 2 * dst_stride;
  729|      0|          data += 2 * src_stride;
  730|      0|          y -= 2;
  731|       |
  732|      0|          s[0] = s[1];
  733|      0|          s[1] = s[2];
  734|      0|          s[2] = s[3];
  735|      0|        } while (y > 0);
  ------------------
  |  Branch (735:18): [True: 0, False: 0]
  ------------------
  736|      0|      }
  737|  18.4E|    } else {
  738|  18.4E|      prepare_coeffs_lowbd(filter_params_y, subpel_y_qn, coeffs);
  739|       |
  740|  18.4E|      if (w == 8) {
  ------------------
  |  Branch (740:11): [True: 0, False: 18.4E]
  ------------------
  741|      0|        __m128i d[8];
  742|      0|        __m256i s[4];
  743|       |
  744|      0|        d[0] = _mm_loadl_epi64((__m128i *)(data + 0 * src_stride));
  745|      0|        d[1] = _mm_loadl_epi64((__m128i *)(data + 1 * src_stride));
  746|      0|        d[2] = _mm_loadl_epi64((__m128i *)(data + 2 * src_stride));
  747|      0|        d[3] = _mm_loadl_epi64((__m128i *)(data + 3 * src_stride));
  748|      0|        d[4] = _mm_loadl_epi64((__m128i *)(data + 4 * src_stride));
  749|      0|        d[5] = _mm_loadl_epi64((__m128i *)(data + 5 * src_stride));
  750|      0|        d[6] = _mm_loadl_epi64((__m128i *)(data + 6 * src_stride));
  751|       |
  752|      0|        const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  753|      0|        const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  754|      0|        const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
  755|      0|        const __m256i src_34a = _mm256_setr_m128i(d[3], d[4]);
  756|      0|        const __m256i src_45a = _mm256_setr_m128i(d[4], d[5]);
  757|      0|        const __m256i src_56a = _mm256_setr_m128i(d[5], d[6]);
  758|       |
  759|      0|        s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  760|      0|        s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
  761|      0|        s[2] = _mm256_unpacklo_epi8(src_45a, src_56a);
  762|       |
  763|      0|        do {
  764|      0|          __m256i res;
  765|      0|          convolve_y_8tap_8x2_avx2(data, src_stride, coeffs, d, s, &res);
  766|      0|          round_pack_store_y_8x2_avx2(res, dst_ptr, dst_stride);
  767|       |
  768|      0|          dst_ptr += 2 * dst_stride;
  769|      0|          data += 2 * src_stride;
  770|      0|          y -= 2;
  771|       |
  772|      0|          s[0] = s[1];
  773|      0|          s[1] = s[2];
  774|      0|          s[2] = s[3];
  775|      0|        } while (y > 0);
  ------------------
  |  Branch (775:18): [True: 0, False: 0]
  ------------------
  776|       |
  777|  18.4E|      } else {
  778|  18.4E|        assert(!(w % 16));
  779|       |
  780|  18.4E|        __m128i d[8];
  781|  18.4E|        __m256i s[8];
  782|  18.4E|        do {
  783|  18.4E|          data = src_ptr + x;
  784|  18.4E|          dst_ptr = dst + x;
  785|  18.4E|          y = h;
  786|       |
  787|  18.4E|          d[0] = _mm_loadu_si128((__m128i *)(data + 0 * src_stride));
  788|  18.4E|          d[1] = _mm_loadu_si128((__m128i *)(data + 1 * src_stride));
  789|  18.4E|          d[2] = _mm_loadu_si128((__m128i *)(data + 2 * src_stride));
  790|  18.4E|          d[3] = _mm_loadu_si128((__m128i *)(data + 3 * src_stride));
  791|  18.4E|          d[4] = _mm_loadu_si128((__m128i *)(data + 4 * src_stride));
  792|  18.4E|          d[5] = _mm_loadu_si128((__m128i *)(data + 5 * src_stride));
  793|  18.4E|          d[6] = _mm_loadu_si128((__m128i *)(data + 6 * src_stride));
  794|       |
  795|  18.4E|          const __m256i src_01a = _mm256_setr_m128i(d[0], d[1]);
  796|  18.4E|          const __m256i src_12a = _mm256_setr_m128i(d[1], d[2]);
  797|  18.4E|          const __m256i src_23a = _mm256_setr_m128i(d[2], d[3]);
  798|  18.4E|          const __m256i src_34a = _mm256_setr_m128i(d[3], d[4]);
  799|  18.4E|          const __m256i src_45a = _mm256_setr_m128i(d[4], d[5]);
  800|  18.4E|          const __m256i src_56a = _mm256_setr_m128i(d[5], d[6]);
  801|       |
  802|  18.4E|          s[0] = _mm256_unpacklo_epi8(src_01a, src_12a);
  803|  18.4E|          s[1] = _mm256_unpacklo_epi8(src_23a, src_34a);
  804|  18.4E|          s[2] = _mm256_unpacklo_epi8(src_45a, src_56a);
  805|       |
  806|  18.4E|          s[4] = _mm256_unpackhi_epi8(src_01a, src_12a);
  807|  18.4E|          s[5] = _mm256_unpackhi_epi8(src_23a, src_34a);
  808|  18.4E|          s[6] = _mm256_unpackhi_epi8(src_45a, src_56a);
  809|       |
  810|  18.4E|          do {
  811|  18.4E|            __m256i res[2];
  812|  18.4E|            convolve_y_8tap_16x2_avx2(data, src_stride, coeffs, d, s, res);
  813|  18.4E|            round_pack_store_y_16x2_avx2(res, dst_ptr, dst_stride);
  814|       |
  815|  18.4E|            dst_ptr += 2 * dst_stride;
  816|  18.4E|            data += 2 * src_stride;
  817|  18.4E|            y -= 2;
  818|       |
  819|  18.4E|            s[0] = s[1];
  820|  18.4E|            s[1] = s[2];
  821|  18.4E|            s[2] = s[3];
  822|       |
  823|  18.4E|            s[4] = s[5];
  824|  18.4E|            s[5] = s[6];
  825|  18.4E|            s[6] = s[7];
  826|  18.4E|          } while (y > 0);
  ------------------
  |  Branch (826:20): [True: 0, False: 18.4E]
  ------------------
  827|       |
  828|  18.4E|          x += 16;
  829|  18.4E|        } while (x < w);
  ------------------
  |  Branch (829:18): [True: 0, False: 18.4E]
  ------------------
  830|  18.4E|      }
  831|  18.4E|    }
  832|  18.4E|  }
  833|   375k|}
av1_convolve_x_sr_avx2:
  840|   388k|                            ConvolveParams *conv_params) {
  841|   388k|  const int bits = FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|   388k|#define FILTER_BITS 7
  ------------------
  842|   388k|  int i, j, horiz_tap = get_filter_tap(filter_params_x, subpel_x_qn);
  843|       |
  844|   388k|  assert(bits >= 0);
  845|   388k|  assert((FILTER_BITS - conv_params->round_1) >= 0 ||
  846|   388k|         ((conv_params->round_0 + conv_params->round_1) == 2 * FILTER_BITS));
  847|   388k|  assert(conv_params->round_0 > 0);
  848|       |
  849|   388k|  assert(horiz_tap == 2 || horiz_tap == 4 || horiz_tap == 6 || horiz_tap == 8 ||
  850|   388k|         horiz_tap == 12);
  851|   388k|  assert((!(w % 2)) || (w <= 128));
  852|   388k|  assert((h % 2) == 0);
  853|       |
  854|   388k|  __m256i coeffs[6] = { 0 }, filt[4] = { 0 };
  855|   388k|  __m128i coeffs_128[4] = { 0 };
  856|       |
  857|   388k|  i = 0;
  858|       |  // horz_filt as 4 tap
  859|   388k|  if (horiz_tap == 4) {
  ------------------
  |  Branch (859:7): [True: 127k, False: 261k]
  ------------------
  860|       |    // since fo_horiz = 1
  861|   127k|    const uint8_t *src_ptr = src - 1;
  862|   127k|    if (w == 2) {
  ------------------
  |  Branch (862:9): [True: 0, False: 127k]
  ------------------
  863|      0|      prepare_coeffs_4t_ssse3(filter_params_x, subpel_x_qn, coeffs_128);
  864|      0|      do {
  865|      0|        const __m128i res =
  866|      0|            convolve_x_4tap_2x2_ssse3(src_ptr, src_stride, coeffs_128);
  867|      0|        const __m128i reg = round_sr_x_ssse3(res);
  868|      0|        pack_store_u8_2x2_sse2(reg, dst, dst_stride);
  869|      0|        src_ptr += 2 * src_stride;
  870|      0|        dst += 2 * dst_stride;
  871|      0|        h -= 2;
  872|      0|      } while (h);
  ------------------
  |  Branch (872:16): [True: 0, False: 0]
  ------------------
  873|   127k|    } else if (w == 4) {
  ------------------
  |  Branch (873:16): [True: 53.5k, False: 73.5k]
  ------------------
  874|  53.5k|      prepare_coeffs_4t_ssse3(filter_params_x, subpel_x_qn, coeffs_128);
  875|   158k|      do {
  876|   158k|        const __m128i reg =
  877|   158k|            convolve_x_4tap_4x2_ssse3(src_ptr, src_stride, coeffs_128);
  878|   158k|        const __m128i res = round_sr_x_ssse3(reg);
  879|   158k|        pack_store_u8_4x2_sse2(res, dst, dst_stride);
  880|   158k|        src_ptr += 2 * src_stride;
  881|   158k|        dst += 2 * dst_stride;
  882|   158k|        h -= 2;
  883|   158k|      } while (h);
  ------------------
  |  Branch (883:16): [True: 105k, False: 53.5k]
  ------------------
  884|  73.5k|    } else if (w == 8) {
  ------------------
  |  Branch (884:16): [True: 60.9k, False: 12.6k]
  ------------------
  885|  60.9k|      prepare_coeffs_lowbd(filter_params_x, subpel_x_qn, coeffs);
  886|  60.9k|      filt[0] = _mm256_load_si256((__m256i const *)(filt_global_avx2));
  887|  60.9k|      filt[1] = _mm256_load_si256((__m256i const *)(filt_global_avx2 + 32));
  888|   250k|      do {
  889|   250k|        const __m256i data = _mm256_setr_m128i(
  890|   250k|            _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride])),
  891|   250k|            _mm_loadu_si128(
  892|   250k|                (__m128i *)(&src_ptr[i * src_stride + src_stride])));
  893|       |
  894|   250k|        __m256i res_16b = convolve_lowbd_x_4tap(data, coeffs + 1, filt);
  895|       |
  896|   250k|        res_16b = round_sr_x_avx2(res_16b);
  897|       |
  898|       |        /* rounding code */
  899|       |        // 8 bit conversion and saturation to uint8
  900|   250k|        __m256i res_8b = _mm256_packus_epi16(res_16b, res_16b);
  901|       |
  902|   250k|        const __m128i res_0 = _mm256_castsi256_si128(res_8b);
  903|   250k|        const __m128i res_1 = _mm256_extracti128_si256(res_8b, 1);
  904|       |
  905|   250k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride], res_0);
  906|   250k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride + dst_stride], res_1);
  907|   250k|        i += 2;
  908|   250k|      } while (i < h);
  ------------------
  |  Branch (908:16): [True: 189k, False: 60.9k]
  ------------------
  909|  60.9k|    } else {
  910|  12.6k|      assert(!(w % 16));
  911|  12.6k|      prepare_coeffs_lowbd(filter_params_x, subpel_x_qn, coeffs);
  912|  12.6k|      filt[0] = _mm256_load_si256((__m256i const *)(filt_global_avx2));
  913|  12.6k|      filt[1] = _mm256_load_si256((__m256i const *)(filt_global_avx2 + 32));
  914|   201k|      do {
  915|   201k|        j = 0;
  916|   237k|        do {
  917|       |          // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 16 17
  918|       |          // 18 19 20 21 22 23
  919|   237k|          const __m256i data = _mm256_inserti128_si256(
  920|   237k|              _mm256_loadu_si256((__m256i *)&src_ptr[(i * src_stride) + j]),
  921|   237k|              _mm_loadu_si128((__m128i *)&src_ptr[(i * src_stride) + (j + 8)]),
  922|   237k|              1);
  923|       |
  924|   237k|          __m256i res_16b = convolve_lowbd_x_4tap(data, coeffs + 1, filt);
  925|       |
  926|   237k|          res_16b = round_sr_x_avx2(res_16b);
  927|       |
  928|       |          /* rounding code */
  929|       |          // 8 bit conversion and saturation to uint8
  930|   237k|          __m256i res_8b = _mm256_packus_epi16(res_16b, res_16b);
  931|       |
  932|       |          // Store values into the destination buffer
  933|       |          // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  934|   237k|          res_8b = _mm256_permute4x64_epi64(res_8b, 216);
  935|   237k|          __m128i res = _mm256_castsi256_si128(res_8b);
  936|   237k|          _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j], res);
  937|   237k|          j += 16;
  938|   237k|        } while (j < w);
  ------------------
  |  Branch (938:18): [True: 35.1k, False: 201k]
  ------------------
  939|   201k|        i++;
  940|   201k|      } while (i < h);
  ------------------
  |  Branch (940:16): [True: 189k, False: 12.6k]
  ------------------
  941|  12.6k|    }
  942|   261k|  } else if (horiz_tap == 6) {
  ------------------
  |  Branch (942:14): [True: 259k, False: 1.66k]
  ------------------
  943|       |    // since (horiz_tap/2 - 1 == 2)
  944|   259k|    const uint8_t *src_ptr = src - 2;
  945|   259k|    prepare_coeffs_6t_lowbd(filter_params_x, subpel_x_qn, coeffs);
  946|   259k|    filt[0] = _mm256_load_si256((__m256i const *)(filt_global_avx2));
  947|   259k|    filt[1] = _mm256_load_si256((__m256i const *)(filt_global_avx2 + 32));
  948|   259k|    filt[2] = _mm256_load_si256((__m256i const *)(filt_global_avx2 + 32 * 2));
  949|   259k|    if (w == 8) {
  ------------------
  |  Branch (949:9): [True: 217k, False: 42.4k]
  ------------------
  950|   886k|      do {
  951|   886k|        const __m256i data = _mm256_setr_m128i(
  952|   886k|            _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride])),
  953|   886k|            _mm_loadu_si128(
  954|   886k|                (__m128i *)(&src_ptr[i * src_stride + src_stride])));
  955|       |
  956|   886k|        __m256i res_16b = convolve_lowbd_x_6tap(data, coeffs, filt);
  957|       |
  958|   886k|        res_16b = round_sr_x_avx2(res_16b);
  959|       |
  960|       |        /* rounding code */
  961|       |        // 8 bit conversion and saturation to uint8
  962|   886k|        __m256i res_8b = _mm256_packus_epi16(res_16b, res_16b);
  963|       |
  964|   886k|        const __m128i res_0 = _mm256_castsi256_si128(res_8b);
  965|   886k|        const __m128i res_1 = _mm256_extracti128_si256(res_8b, 1);
  966|   886k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride], res_0);
  967|   886k|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride + dst_stride], res_1);
  968|   886k|        i += 2;
  969|   886k|      } while (i < h);
  ------------------
  |  Branch (969:16): [True: 669k, False: 217k]
  ------------------
  970|   217k|    } else if (w == 16) {
  ------------------
  |  Branch (970:16): [True: 36.9k, False: 5.55k]
  ------------------
  971|   268k|      do {
  972|   268k|        __m256i data[2] = { 0 };
  973|       |
  974|   268k|        load_convolve_6tap_16x2_avx2(src_ptr, src_stride, coeffs, filt, data);
  975|   268k|        round_pack_store_16x2_avx2(data, dst, dst_stride);
  976|   268k|        src_ptr += 2 * src_stride;
  977|   268k|        dst += 2 * dst_stride;
  978|   268k|        h -= 2;
  979|   268k|      } while (h);
  ------------------
  |  Branch (979:16): [True: 231k, False: 36.9k]
  ------------------
  980|  36.9k|    } else if (w == 32) {
  ------------------
  |  Branch (980:16): [True: 5.15k, False: 404]
  ------------------
  981|   159k|      do {
  982|   159k|        convolve_sr_store_6tap_32_avx2(src_ptr, coeffs, filt, dst);
  983|   159k|        src_ptr += src_stride;
  984|   159k|        dst += dst_stride;
  985|   159k|      } while ((--h) > 0);
  ------------------
  |  Branch (985:16): [True: 153k, False: 5.15k]
  ------------------
  986|  5.15k|    } else if (w == 64) {
  ------------------
  |  Branch (986:16): [True: 387, False: 17]
  ------------------
  987|  24.7k|      do {
  988|  24.7k|        convolve_sr_store_6tap_32_avx2(src_ptr, coeffs, filt, dst);
  989|  24.7k|        convolve_sr_store_6tap_32_avx2(src_ptr + 32, coeffs, filt, dst + 32);
  990|  24.7k|        src_ptr += src_stride;
  991|  24.7k|        dst += dst_stride;
  992|  24.7k|      } while ((--h) > 0);
  ------------------
  |  Branch (992:16): [True: 24.3k, False: 387]
  ------------------
  993|    387|    } else {
  994|     17|      assert(w == 128);
  995|       |
  996|     17|      do {
  997|     17|        convolve_sr_store_6tap_32_avx2(src_ptr, coeffs, filt, dst);
  998|     17|        convolve_sr_store_6tap_32_avx2(src_ptr + SECOND_32_BLK, coeffs, filt,
  ------------------
  |  |   25|     17|#define SECOND_32_BLK (32)
  ------------------
  999|     17|                                       dst + SECOND_32_BLK);
  ------------------
  |  |   25|     17|#define SECOND_32_BLK (32)
  ------------------
 1000|     17|        convolve_sr_store_6tap_32_avx2(src_ptr + THIRD_32_BLK, coeffs, filt,
  ------------------
  |  |   26|     17|#define THIRD_32_BLK (32 << 1)
  ------------------
 1001|     17|                                       dst + THIRD_32_BLK);
  ------------------
  |  |   26|     17|#define THIRD_32_BLK (32 << 1)
  ------------------
 1002|     17|        convolve_sr_store_6tap_32_avx2(src_ptr + FOURTH_32_BLK, coeffs, filt,
  ------------------
  |  |   27|     17|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|     17|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|     17|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1003|     17|                                       dst + FOURTH_32_BLK);
  ------------------
  |  |   27|     17|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|     17|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|     17|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1004|     17|        src_ptr += src_stride;
 1005|     17|        dst += dst_stride;
 1006|     17|      } while ((--h) > 0);
  ------------------
  |  Branch (1006:16): [True: 0, False: 17]
  ------------------
 1007|     17|    }
 1008|   259k|  } else if (horiz_tap == 8) {
  ------------------
  |  Branch (1008:14): [True: 0, False: 1.66k]
  ------------------
 1009|       |    // since (horiz_tap / 2 - 1) == 3
 1010|      0|    const uint8_t *src_ptr = src - 3;
 1011|      0|    prepare_coeffs_lowbd(filter_params_x, subpel_x_qn, coeffs);
 1012|      0|    filt[0] = _mm256_load_si256((__m256i const *)(filt_global_avx2));
 1013|      0|    filt[1] =
 1014|      0|        _mm256_load_si256((__m256i const *)(filt_global_avx2 + SECOND_32_BLK));
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1015|      0|    filt[2] =
 1016|      0|        _mm256_load_si256((__m256i const *)(filt_global_avx2 + THIRD_32_BLK));
  ------------------
  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  ------------------
 1017|      0|    filt[3] =
 1018|      0|        _mm256_load_si256((__m256i const *)(filt_global_avx2 + FOURTH_32_BLK));
  ------------------
  |  |   27|      0|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|      0|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1019|       |
 1020|      0|    if (w == 8) {
  ------------------
  |  Branch (1020:9): [True: 0, False: 0]
  ------------------
 1021|      0|      do {
 1022|      0|        const __m256i data = _mm256_setr_m128i(
 1023|      0|            _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride])),
 1024|      0|            _mm_loadu_si128(
 1025|      0|                (__m128i *)(&src_ptr[i * src_stride + src_stride])));
 1026|       |
 1027|      0|        __m256i res_16b = convolve_lowbd_x(data, coeffs, filt);
 1028|       |
 1029|      0|        res_16b = round_sr_x_avx2(res_16b);
 1030|       |
 1031|       |        /* rounding code */
 1032|       |        // 8 bit conversion and saturation to uint8
 1033|      0|        __m256i res_8b = _mm256_packus_epi16(res_16b, res_16b);
 1034|       |
 1035|      0|        const __m128i res_0 = _mm256_castsi256_si128(res_8b);
 1036|      0|        const __m128i res_1 = _mm256_extracti128_si256(res_8b, 1);
 1037|      0|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride], res_0);
 1038|      0|        _mm_storel_epi64((__m128i *)&dst[i * dst_stride + dst_stride], res_1);
 1039|      0|        i += 2;
 1040|      0|      } while (i < h);
  ------------------
  |  Branch (1040:16): [True: 0, False: 0]
  ------------------
 1041|      0|    } else if (w == 16) {
  ------------------
  |  Branch (1041:16): [True: 0, False: 0]
  ------------------
 1042|      0|      do {
 1043|      0|        __m256i data[2] = { 0 };
 1044|       |
 1045|      0|        load_convolve_8tap_16x2_avx2(src_ptr, src_stride, coeffs, filt, data);
 1046|      0|        round_pack_store_16x2_avx2(data, dst, dst_stride);
 1047|      0|        src_ptr += 2 * src_stride;
 1048|      0|        dst += 2 * dst_stride;
 1049|      0|        h -= 2;
 1050|      0|      } while (h);
  ------------------
  |  Branch (1050:16): [True: 0, False: 0]
  ------------------
 1051|      0|    } else if (w == 32) {
  ------------------
  |  Branch (1051:16): [True: 0, False: 0]
  ------------------
 1052|      0|      do {
 1053|      0|        load_convolve_round_8tap_32_avx2(src_ptr, coeffs, filt, dst);
 1054|      0|        src_ptr += src_stride;
 1055|      0|        dst += dst_stride;
 1056|      0|      } while ((--h) > 0);
  ------------------
  |  Branch (1056:16): [True: 0, False: 0]
  ------------------
 1057|      0|    } else if (w == 64) {
  ------------------
  |  Branch (1057:16): [True: 0, False: 0]
  ------------------
 1058|      0|      do {
 1059|      0|        load_convolve_round_8tap_32_avx2(src_ptr, coeffs, filt, dst);
 1060|      0|        load_convolve_round_8tap_32_avx2(src_ptr + 32, coeffs, filt, dst + 32);
 1061|      0|        src_ptr += src_stride;
 1062|      0|        dst += dst_stride;
 1063|      0|      } while ((--h) > 0);
  ------------------
  |  Branch (1063:16): [True: 0, False: 0]
  ------------------
 1064|      0|    } else {
 1065|      0|      assert(w == 128);
 1066|      0|      do {
 1067|      0|        load_convolve_round_8tap_32_avx2(src_ptr, coeffs, filt, dst);
 1068|      0|        load_convolve_round_8tap_32_avx2(src_ptr + SECOND_32_BLK, coeffs, filt,
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1069|      0|                                         dst + SECOND_32_BLK);
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1070|      0|        load_convolve_round_8tap_32_avx2(src_ptr + THIRD_32_BLK, coeffs, filt,
  ------------------
  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  ------------------
 1071|      0|                                         dst + THIRD_32_BLK);
  ------------------
  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  ------------------
 1072|      0|        load_convolve_round_8tap_32_avx2(src_ptr + FOURTH_32_BLK, coeffs, filt,
  ------------------
  |  |   27|      0|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|      0|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1073|      0|                                         dst + FOURTH_32_BLK);
  ------------------
  |  |   27|      0|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|      0|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1074|      0|        src_ptr += src_stride;
 1075|      0|        dst += dst_stride;
 1076|      0|      } while ((--h) > 0);
  ------------------
  |  Branch (1076:16): [True: 0, False: 0]
  ------------------
 1077|      0|    }
 1078|  1.66k|  } else if (horiz_tap == 12) {  // horiz_tap == 12
  ------------------
  |  Branch (1078:14): [True: 0, False: 1.66k]
  ------------------
 1079|      0|    const int fo_horiz = filter_params_x->taps / 2 - 1;
 1080|      0|    prepare_coeffs_12taps(filter_params_x, subpel_x_qn, coeffs);
 1081|      0|    const __m128i round_shift = _mm_cvtsi32_si128(bits);
 1082|      0|    const uint8_t *const src_ptr = src - fo_horiz;
 1083|      0|    const __m256i v_zero = _mm256_setzero_si256();
 1084|      0|    __m256i round_0_const =
 1085|      0|        _mm256_set1_epi32((1 << (conv_params->round_0)) >> 1);
 1086|      0|    __m256i round_const = _mm256_set1_epi32((1 << bits) >> 1);
 1087|      0|    __m128i round_0_shift = _mm_cvtsi32_si128(conv_params->round_0);
 1088|      0|    __m256i s[6] = { 0 };
 1089|       |
 1090|      0|    if (w <= 4) {
  ------------------
  |  Branch (1090:9): [True: 0, False: 0]
  ------------------
 1091|      0|      do {
 1092|      0|        const __m256i data = _mm256_permute2x128_si256(
 1093|      0|            _mm256_castsi128_si256(
 1094|      0|                _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride]))),
 1095|      0|            _mm256_castsi128_si256(_mm_loadu_si128(
 1096|      0|                (__m128i *)(&src_ptr[i * src_stride + src_stride]))),
 1097|      0|            0x20);
 1098|       |        // row0 0..7 row1 0..7
 1099|      0|        const __m256i s_16lo = _mm256_unpacklo_epi8(data, v_zero);
 1100|       |        // row0 8..F row1 8..F
 1101|      0|        const __m256i s_16hi = _mm256_unpackhi_epi8(data, v_zero);
 1102|       |
 1103|       |        // row0 00 00 01 01 .. 03 03 row1 00 00 01 01 .. 03 03
 1104|      0|        const __m256i s_lolo = _mm256_unpacklo_epi16(s_16lo, s_16lo);
 1105|       |        // row0 04 04 .. 07 07 row1 04 04 .. 07 07
 1106|      0|        const __m256i s_lohi = _mm256_unpackhi_epi16(s_16lo, s_16lo);
 1107|       |
 1108|       |        // row0 08 08 09 09 .. 0B 0B row1 08 08 09 09 .. 0B 0B
 1109|      0|        const __m256i s_hilo = _mm256_unpacklo_epi16(s_16hi, s_16hi);
 1110|       |        // row0 0C 0C .. 0F 0F row1 0C 0C .. 0F 0F
 1111|      0|        const __m256i s_hihi = _mm256_unpackhi_epi16(s_16hi, s_16hi);
 1112|       |
 1113|       |        // 00 01 01 02 02 03 03 04 10 11 11 12 12 13 13 14
 1114|      0|        s[0] = _mm256_alignr_epi8(s_lohi, s_lolo, 2);
 1115|       |        // 02 03 03 04 04 05 05 06 12 13 13 14 14 15 15 16
 1116|      0|        s[1] = _mm256_alignr_epi8(s_lohi, s_lolo, 10);
 1117|       |        // 04 05 05 06 06 07 07 08 14 15 15 16 16 17 17 18
 1118|      0|        s[2] = _mm256_alignr_epi8(s_hilo, s_lohi, 2);
 1119|       |        // 06 07 07 08 08 09 09 0A 16 17 17 18 18 19 19 1A
 1120|      0|        s[3] = _mm256_alignr_epi8(s_hilo, s_lohi, 10);
 1121|       |        // 08 09 09 0A 0A 0B 0B 0C 18 19 19 1A 1A 1B 1B 1C
 1122|      0|        s[4] = _mm256_alignr_epi8(s_hihi, s_hilo, 2);
 1123|       |        // 0A 0B 0B 0C 0C 0D 0D 0E 1A 1B 1B 1C 1C 1D 1D 1E
 1124|      0|        s[5] = _mm256_alignr_epi8(s_hihi, s_hilo, 10);
 1125|       |
 1126|      0|        const __m256i res_lo = convolve_12taps(s, coeffs);
 1127|       |
 1128|      0|        __m256i res_32b_lo = _mm256_sra_epi32(
 1129|      0|            _mm256_add_epi32(res_lo, round_0_const), round_0_shift);
 1130|       |
 1131|       |        // 00 01 02 03 10 12 13 14
 1132|      0|        res_32b_lo = _mm256_sra_epi32(_mm256_add_epi32(res_32b_lo, round_const),
 1133|      0|                                      round_shift);
 1134|       |        // 8 bit conversion and saturation to uint8
 1135|       |        // 00 01 02 03 00 01 02 03 10 11 12 13 10 11 12 13
 1136|      0|        __m256i res_16b_lo = _mm256_packs_epi32(res_32b_lo, res_32b_lo);
 1137|       |        // 00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
 1138|       |        // 10 11 12 13 10 11 12 13 10 11 12 13 10 11 12 13
 1139|      0|        __m256i res_8b_lo = _mm256_packus_epi16(res_16b_lo, res_16b_lo);
 1140|       |
 1141|       |        // 00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
 1142|      0|        const __m128i res_0 = _mm256_extracti128_si256(res_8b_lo, 0);
 1143|       |        // 10 11 12 13 10 11 12 13 10 11 12 13 10 11 12 13
 1144|      0|        const __m128i res_1 = _mm256_extracti128_si256(res_8b_lo, 1);
 1145|      0|        if (w > 2) {
  ------------------
  |  Branch (1145:13): [True: 0, False: 0]
  ------------------
 1146|       |          // 00 01 02 03
 1147|      0|          xx_storel_32(&dst[i * dst_stride], res_0);
 1148|       |          // 10 11 12 13
 1149|      0|          xx_storel_32(&dst[i * dst_stride + dst_stride], res_1);
 1150|      0|        } else {
 1151|       |          // 00 01
 1152|      0|          xx_storel_16(&dst[i * dst_stride], res_0);
 1153|       |          // 10 11
 1154|      0|          xx_storel_16(&dst[i * dst_stride + dst_stride], res_1);
 1155|      0|        }
 1156|      0|        i += 2;
 1157|      0|      } while (i < h);
  ------------------
  |  Branch (1157:16): [True: 0, False: 0]
  ------------------
 1158|      0|    } else {
 1159|      0|      assert(!(w % 8));
 1160|      0|      do {
 1161|      0|        j = 0;
 1162|      0|        do {
 1163|      0|          const __m256i data = _mm256_permute2x128_si256(
 1164|      0|              _mm256_castsi128_si256(
 1165|      0|                  _mm_loadu_si128((__m128i *)(&src_ptr[i * src_stride + j]))),
 1166|      0|              _mm256_castsi128_si256(_mm_loadu_si128(
 1167|      0|                  (__m128i *)(&src_ptr[i * src_stride + j + 4]))),
 1168|      0|              0x20);
 1169|       |          // row0 0..7 4..B
 1170|      0|          const __m256i s_16lo = _mm256_unpacklo_epi8(data, v_zero);
 1171|       |          // row0 8..F C..13
 1172|      0|          const __m256i s_16hi = _mm256_unpackhi_epi8(data, v_zero);
 1173|       |
 1174|       |          // row0 00 00 01 01 .. 03 03 04 04 05 05 .. 07 07
 1175|      0|          const __m256i s_lolo = _mm256_unpacklo_epi16(s_16lo, s_16lo);
 1176|       |          // row0 04 04 .. 07 07 08 08 .. 0B 0B
 1177|      0|          const __m256i s_lohi = _mm256_unpackhi_epi16(s_16lo, s_16lo);
 1178|       |
 1179|       |          // row0 08 08 09 09 .. 0B 0B 0C 0C 0D 0D .. 0F 0F
 1180|      0|          const __m256i s_hilo = _mm256_unpacklo_epi16(s_16hi, s_16hi);
 1181|       |          // row0 0C 0C 0D 0D .. 0F 0F 10 10 11 11 .. 13 13
 1182|      0|          const __m256i s_hihi = _mm256_unpackhi_epi16(s_16hi, s_16hi);
 1183|       |
 1184|      0|          s[0] = _mm256_alignr_epi8(s_lohi, s_lolo, 2);
 1185|      0|          s[1] = _mm256_alignr_epi8(s_lohi, s_lolo, 10);
 1186|      0|          s[2] = _mm256_alignr_epi8(s_hilo, s_lohi, 2);
 1187|      0|          s[3] = _mm256_alignr_epi8(s_hilo, s_lohi, 10);
 1188|      0|          s[4] = _mm256_alignr_epi8(s_hihi, s_hilo, 2);
 1189|      0|          s[5] = _mm256_alignr_epi8(s_hihi, s_hilo, 10);
 1190|       |
 1191|      0|          const __m256i res_lo = convolve_12taps(s, coeffs);
 1192|       |
 1193|      0|          __m256i res_32b_lo = _mm256_sra_epi32(
 1194|      0|              _mm256_add_epi32(res_lo, round_0_const), round_0_shift);
 1195|       |
 1196|      0|          res_32b_lo = _mm256_sra_epi32(
 1197|      0|              _mm256_add_epi32(res_32b_lo, round_const), round_shift);
 1198|       |          // 8 bit conversion and saturation to uint8
 1199|      0|          __m256i res_16b_lo = _mm256_packs_epi32(res_32b_lo, res_32b_lo);
 1200|      0|          __m256i res_8b_lo = _mm256_packus_epi16(res_16b_lo, res_16b_lo);
 1201|      0|          const __m128i res_0 = _mm256_extracti128_si256(res_8b_lo, 0);
 1202|      0|          const __m128i res_1 = _mm256_extracti128_si256(res_8b_lo, 1);
 1203|      0|          xx_storel_32(&dst[i * dst_stride + j], res_0);
 1204|      0|          xx_storel_32(&dst[i * dst_stride + j + 4], res_1);
 1205|       |
 1206|      0|          j += 8;
 1207|      0|        } while (j < w);
  ------------------
  |  Branch (1207:18): [True: 0, False: 0]
  ------------------
 1208|      0|        i++;
 1209|      0|      } while (i < h);
  ------------------
  |  Branch (1209:16): [True: 0, False: 0]
  ------------------
 1210|      0|    }
 1211|  1.66k|  } else {
 1212|  1.66k|    assert(horiz_tap == 2);
 1213|       |    // since (filter_params_x->taps / 2 - 1) == 0
 1214|  1.66k|    const uint8_t *src_ptr = src;
 1215|  1.66k|    if (subpel_x_qn != 8) {
  ------------------
  |  Branch (1215:9): [True: 0, False: 1.66k]
  ------------------
 1216|      0|      if (w <= 8) {
  ------------------
  |  Branch (1216:11): [True: 0, False: 0]
  ------------------
 1217|      0|        prepare_coeffs_2t_ssse3(filter_params_x, subpel_x_qn, coeffs_128);
 1218|       |
 1219|      0|        if (w == 2) {
  ------------------
  |  Branch (1219:13): [True: 0, False: 0]
  ------------------
 1220|      0|          do {
 1221|      0|            const __m128i data =
 1222|      0|                convolve_x_2tap_2x2_ssse3(src_ptr, src_stride, coeffs_128);
 1223|      0|            const __m128i reg = round_sr_x_ssse3(data);
 1224|      0|            pack_store_u8_2x2_sse2(reg, dst, dst_stride);
 1225|      0|            src_ptr += 2 * src_stride;
 1226|      0|            dst += 2 * dst_stride;
 1227|      0|            h -= 2;
 1228|      0|          } while (h);
  ------------------
  |  Branch (1228:20): [True: 0, False: 0]
  ------------------
 1229|      0|        } else if (w == 4) {
  ------------------
  |  Branch (1229:20): [True: 0, False: 0]
  ------------------
 1230|      0|          do {
 1231|      0|            const __m128i data =
 1232|      0|                convolve_x_2tap_4x2_ssse3(src_ptr, src_stride, coeffs_128);
 1233|      0|            const __m128i reg = round_sr_x_ssse3(data);
 1234|      0|            pack_store_u8_4x2_sse2(reg, dst, dst_stride);
 1235|      0|            src_ptr += 2 * src_stride;
 1236|      0|            dst += 2 * dst_stride;
 1237|      0|            h -= 2;
 1238|      0|          } while (h);
  ------------------
  |  Branch (1238:20): [True: 0, False: 0]
  ------------------
 1239|      0|        } else {
 1240|      0|          assert(w == 8);
 1241|       |
 1242|      0|          do {
 1243|      0|            __m128i data[2] = { 0 };
 1244|       |
 1245|      0|            convolve_x_2tap_8x2_ssse3(src_ptr, src_stride, coeffs_128, data);
 1246|      0|            data[0] = round_sr_x_ssse3(data[0]);
 1247|      0|            data[1] = round_sr_x_ssse3(data[1]);
 1248|      0|            const __m128i reg = _mm_packus_epi16(data[0], data[1]);
 1249|      0|            _mm_storel_epi64((__m128i *)dst, reg);
 1250|      0|            _mm_storeh_epi64((__m128i *)(dst + dst_stride), reg);
 1251|       |
 1252|      0|            src_ptr += 2 * src_stride;
 1253|      0|            dst += 2 * dst_stride;
 1254|      0|            h -= 2;
 1255|      0|          } while (h);
  ------------------
  |  Branch (1255:20): [True: 0, False: 0]
  ------------------
 1256|      0|        }
 1257|      0|      } else {
 1258|      0|        prepare_coeffs_2t_lowbd(filter_params_x, subpel_x_qn, coeffs);
 1259|       |
 1260|      0|        if (w == 16) {
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|      0|          do {
 1262|      0|            __m256i data[2] = { 0 };
 1263|       |
 1264|      0|            convolve_x_2tap_16x2_avx2(src_ptr, src_stride, coeffs, data);
 1265|      0|            round_pack_store_16x2_avx2(data, dst, dst_stride);
 1266|      0|            src_ptr += 2 * src_stride;
 1267|      0|            dst += 2 * dst_stride;
 1268|      0|            h -= 2;
 1269|      0|          } while (h);
  ------------------
  |  Branch (1269:20): [True: 0, False: 0]
  ------------------
 1270|      0|        } else if (w == 32) {
  ------------------
  |  Branch (1270:20): [True: 0, False: 0]
  ------------------
 1271|      0|          do {
 1272|      0|            convolve_round_2tap_32_avx2(src_ptr, coeffs, dst);
 1273|      0|            src_ptr += src_stride;
 1274|      0|            dst += dst_stride;
 1275|      0|          } while ((--h) > 0);
  ------------------
  |  Branch (1275:20): [True: 0, False: 0]
  ------------------
 1276|      0|        } else if (w == 64) {
  ------------------
  |  Branch (1276:20): [True: 0, False: 0]
  ------------------
 1277|      0|          do {
 1278|      0|            convolve_round_2tap_32_avx2(src_ptr, coeffs, dst);
 1279|      0|            convolve_round_2tap_32_avx2(src_ptr + SECOND_32_BLK, coeffs,
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1280|      0|                                        dst + SECOND_32_BLK);
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1281|      0|            src_ptr += src_stride;
 1282|      0|            dst += dst_stride;
 1283|      0|          } while ((--h) > 0);
  ------------------
  |  Branch (1283:20): [True: 0, False: 0]
  ------------------
 1284|      0|        } else {
 1285|      0|          assert(w == 128);
 1286|       |
 1287|      0|          do {
 1288|      0|            convolve_round_2tap_32_avx2(src_ptr, coeffs, dst);
 1289|      0|            convolve_round_2tap_32_avx2(src_ptr + (SECOND_32_BLK), coeffs,
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1290|      0|                                        dst + (SECOND_32_BLK));
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1291|      0|            convolve_round_2tap_32_avx2(src_ptr + (THIRD_32_BLK), coeffs,
  ------------------
  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  ------------------
 1292|      0|                                        dst + (THIRD_32_BLK));
  ------------------
  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  ------------------
 1293|      0|            convolve_round_2tap_32_avx2(src_ptr + (FOURTH_32_BLK), coeffs,
  ------------------
  |  |   27|      0|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|      0|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1294|      0|                                        dst + (FOURTH_32_BLK));
  ------------------
  |  |   27|      0|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|      0|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|      0|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1295|      0|            src_ptr += src_stride;
 1296|      0|            dst += dst_stride;
 1297|      0|          } while ((--h) > 0);
  ------------------
  |  Branch (1297:20): [True: 0, False: 0]
  ------------------
 1298|      0|        }
 1299|      0|      }
 1300|  1.66k|    } else {
 1301|  1.66k|      if (w == 2) {
  ------------------
  |  Branch (1301:11): [True: 0, False: 1.66k]
  ------------------
 1302|      0|        do {
 1303|      0|          __m128i data = load_x_u8_4x2_sse4(src_ptr, src_stride);
 1304|      0|          const __m128i reg1 = _mm_srli_si128(data, 1);
 1305|      0|          const __m128i reg2 = _mm_avg_epu8(data, reg1);
 1306|      0|          xx_storel_16(dst, reg2);
 1307|      0|          {
 1308|      0|            uint16_t val = (uint16_t)_mm_extract_epi16(reg2, 2);
 1309|      0|            memcpy(dst + dst_stride, &val, sizeof(val));
 1310|      0|          }
 1311|      0|          src_ptr += 2 * src_stride;
 1312|      0|          dst += 2 * dst_stride;
 1313|      0|          h -= 2;
 1314|      0|        } while (h);
  ------------------
  |  Branch (1314:18): [True: 0, False: 0]
  ------------------
 1315|  1.66k|      } else if (w == 4) {
  ------------------
  |  Branch (1315:18): [True: 0, False: 1.66k]
  ------------------
 1316|      0|        do {
 1317|      0|          __m128i data = load_8bit_8x2_to_1_reg_sse2(
 1318|      0|              src_ptr, (int)(sizeof(*src_ptr) * src_stride));
 1319|      0|          const __m128i reg1 = _mm_srli_si128(data, 1);
 1320|      0|          const __m128i reg2 = _mm_avg_epu8(data, reg1);
 1321|      0|          xx_storel_32(dst, reg2);
 1322|      0|          {
 1323|      0|            int32_t val = _mm_extract_epi32(reg2, 2);
 1324|      0|            memcpy(dst + dst_stride, &val, sizeof(val));
 1325|      0|          }
 1326|       |
 1327|      0|          src_ptr += 2 * src_stride;
 1328|      0|          dst += 2 * dst_stride;
 1329|      0|          h -= 2;
 1330|      0|        } while (h);
  ------------------
  |  Branch (1330:18): [True: 0, False: 0]
  ------------------
 1331|  1.66k|      } else if (w == 8) {
  ------------------
  |  Branch (1331:18): [True: 0, False: 1.66k]
  ------------------
 1332|      0|        do {
 1333|      0|          const __m128i data00 = _mm_loadu_si128((__m128i *)src_ptr);
 1334|      0|          const __m128i data10 =
 1335|      0|              _mm_loadu_si128((__m128i *)(src_ptr + src_stride));
 1336|      0|          const __m128i data01 = _mm_srli_si128(data00, 1);
 1337|      0|          const __m128i data11 = _mm_srli_si128(data10, 1);
 1338|      0|          const __m128i reg0 = _mm_avg_epu8(data00, data01);
 1339|      0|          const __m128i reg1 = _mm_avg_epu8(data10, data11);
 1340|      0|          _mm_storel_epi64((__m128i *)dst, reg0);
 1341|      0|          _mm_storel_epi64((__m128i *)(dst + dst_stride), reg1);
 1342|       |
 1343|      0|          src_ptr += 2 * src_stride;
 1344|      0|          dst += 2 * dst_stride;
 1345|      0|          h -= 2;
 1346|      0|        } while (h);
  ------------------
  |  Branch (1346:18): [True: 0, False: 0]
  ------------------
 1347|  1.66k|      } else if (w == 16) {
  ------------------
  |  Branch (1347:18): [True: 0, False: 1.66k]
  ------------------
 1348|      0|        do {
 1349|      0|          const __m128i data00 = _mm_loadu_si128((__m128i *)src_ptr);
 1350|      0|          const __m128i data01 = _mm_loadu_si128((__m128i *)(src_ptr + 1));
 1351|      0|          const __m128i data10 =
 1352|      0|              _mm_loadu_si128((__m128i *)(src_ptr + src_stride));
 1353|      0|          const __m128i data11 =
 1354|      0|              _mm_loadu_si128((__m128i *)(src_ptr + src_stride + 1));
 1355|      0|          const __m128i reg0 = _mm_avg_epu8(data00, data01);
 1356|      0|          const __m128i reg1 = _mm_avg_epu8(data10, data11);
 1357|      0|          _mm_storeu_si128((__m128i *)dst, reg0);
 1358|      0|          _mm_storeu_si128((__m128i *)(dst + dst_stride), reg1);
 1359|       |
 1360|      0|          src_ptr += 2 * src_stride;
 1361|      0|          dst += 2 * dst_stride;
 1362|      0|          h -= 2;
 1363|      0|        } while (h);
  ------------------
  |  Branch (1363:18): [True: 0, False: 0]
  ------------------
 1364|  1.77k|      } else if (w == 32) {
  ------------------
  |  Branch (1364:18): [True: 1.77k, False: 18.4E]
  ------------------
 1365|  87.2k|        do {
 1366|  87.2k|          load_avg_store_2tap_32_avx2(src_ptr, dst);
 1367|  87.2k|          src_ptr += src_stride;
 1368|  87.2k|          dst += dst_stride;
 1369|  87.2k|        } while ((--h) > 0);
  ------------------
  |  Branch (1369:18): [True: 85.4k, False: 1.77k]
  ------------------
 1370|  18.4E|      } else if (w == 64) {
  ------------------
  |  Branch (1370:18): [True: 0, False: 18.4E]
  ------------------
 1371|      0|        do {
 1372|      0|          load_avg_store_2tap_32_avx2(src_ptr, dst);
 1373|      0|          load_avg_store_2tap_32_avx2(src_ptr + (SECOND_32_BLK),
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1374|      0|                                      dst + (SECOND_32_BLK));
  ------------------
  |  |   25|      0|#define SECOND_32_BLK (32)
  ------------------
 1375|      0|          src_ptr += src_stride;
 1376|      0|          dst += dst_stride;
 1377|      0|        } while ((--h) > 0);
  ------------------
  |  Branch (1377:18): [True: 0, False: 0]
  ------------------
 1378|  18.4E|      } else {
 1379|  18.4E|        assert(w == 128);
 1380|       |
 1381|  18.4E|        do {
 1382|  18.4E|          load_avg_store_2tap_32_avx2(src_ptr, dst);
 1383|  18.4E|          load_avg_store_2tap_32_avx2(src_ptr + (SECOND_32_BLK),
  ------------------
  |  |   25|  18.4E|#define SECOND_32_BLK (32)
  ------------------
 1384|  18.4E|                                      dst + (SECOND_32_BLK));
  ------------------
  |  |   25|  18.4E|#define SECOND_32_BLK (32)
  ------------------
 1385|  18.4E|          load_avg_store_2tap_32_avx2(src_ptr + (THIRD_32_BLK),
  ------------------
  |  |   26|  18.4E|#define THIRD_32_BLK (32 << 1)
  ------------------
 1386|  18.4E|                                      dst + (THIRD_32_BLK));
  ------------------
  |  |   26|  18.4E|#define THIRD_32_BLK (32 << 1)
  ------------------
 1387|  18.4E|          load_avg_store_2tap_32_avx2(src_ptr + (FOURTH_32_BLK),
  ------------------
  |  |   27|  18.4E|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|  18.4E|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|  18.4E|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1388|  18.4E|                                      dst + (FOURTH_32_BLK));
  ------------------
  |  |   27|  18.4E|#define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   25|  18.4E|#define SECOND_32_BLK (32)
  |  |  ------------------
  |  |               #define FOURTH_32_BLK (SECOND_32_BLK + THIRD_32_BLK)
  |  |  ------------------
  |  |  |  |   26|  18.4E|#define THIRD_32_BLK (32 << 1)
  |  |  ------------------
  ------------------
 1389|  18.4E|          src_ptr += src_stride;
 1390|  18.4E|          dst += dst_stride;
 1391|  18.4E|        } while ((--h) > 0);
  ------------------
  |  Branch (1391:18): [True: 0, False: 18.4E]
  ------------------
 1392|  18.4E|      }
 1393|  1.66k|    }
 1394|  1.66k|  }
 1395|   388k|}

av1_filter_intra_predictor_sse4_1:
  346|  16.6M|                                       const uint8_t *left, int mode) {
  347|  16.6M|  const int bw = tx_size_wide[tx_size];
  348|  16.6M|  const int bh = tx_size_high[tx_size];
  349|  16.6M|  filter_intra_predictor_sse4_1(dst, stride, above, left, mode, bw, bh);
  350|  16.6M|}
filterintra_sse4.c:filter_intra_predictor_sse4_1:
  216|  16.6M|                                                 const int height) {
  217|  16.6M|  const uint8_t *const top_ptr = (const uint8_t *)top_row;
  218|  16.6M|  const uint8_t *const left_ptr = (const uint8_t *)left_column;
  219|  16.6M|  uint8_t *dst = (uint8_t *)dest;
  220|  16.6M|  if (width == 4) {
  ------------------
  |  Branch (220:7): [True: 5.38M, False: 11.2M]
  ------------------
  221|  5.38M|    filter_4xh(dst, stride, top_ptr, left_ptr, mode, height);
  222|  5.38M|    return;
  223|  5.38M|  }
  224|       |
  225|       |  // There is one set of 7 taps for each of the 4x2 output pixels.
  226|  11.2M|  const __m128i taps_0_1 = xx_load_128(av1_filter_intra_taps[mode][0]);
  227|  11.2M|  const __m128i taps_2_3 = xx_load_128(av1_filter_intra_taps[mode][2]);
  228|  11.2M|  const __m128i taps_4_5 = xx_load_128(av1_filter_intra_taps[mode][4]);
  229|  11.2M|  const __m128i taps_6_7 = xx_load_128(av1_filter_intra_taps[mode][6]);
  230|       |
  231|       |  // This mask rearranges bytes in the order: 0, 1, 2, 3, 4, 8, 9, 15. The 15 at
  232|       |  // the end is an unused value, which shall be multiplied by 0 when we apply
  233|       |  // the filter.
  234|  11.2M|  const int64_t kCondenseLeftMask = 0x0F09080403020100;
  235|       |
  236|       |  // Takes the "left section" and puts it right after p0-p4.
  237|  11.2M|  const __m128i pixel_order1 = _mm_set1_epi64x(kCondenseLeftMask);
  238|       |
  239|       |  // This mask rearranges bytes in the order: 8, 0, 1, 2, 3, 9, 10, 15. The last
  240|       |  // byte is unused as above.
  241|  11.2M|  const int64_t kInsertTopLeftMask = 0x0F0A090302010008;
  242|       |
  243|       |  // Shuffles the "top left" from the left section, to the front. Used when
  244|       |  // grabbing data from left_column and not top_row.
  245|  11.2M|  const __m128i pixel_order2 = _mm_set1_epi64x(kInsertTopLeftMask);
  246|       |
  247|       |  // This first pass takes care of the cases where the top left pixel comes from
  248|       |  // top_row.
  249|  11.2M|  __m128i pixels = xx_loadl_64(top_ptr - 1);
  250|  11.2M|  __m128i left = _mm_slli_si128(xx_loadl_32(left_column), 8);
  251|  11.2M|  pixels = _mm_or_si128(pixels, left);
  252|       |
  253|       |  // Two sets of the same pixels to multiply with two sets of taps.
  254|  11.2M|  pixels = _mm_shuffle_epi8(pixels, pixel_order1);
  255|  11.2M|  filter_4x2_sse4_1(dst, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  256|  11.2M|                    &taps_6_7);
  257|  11.2M|  left = _mm_srli_si128(left, 1);
  258|       |
  259|       |  // Load
  260|  11.2M|  pixels = xx_loadl_32(dst + stride);
  261|       |
  262|       |  // Because of the above shift, this OR 'invades' the final of the first 8
  263|       |  // bytes of |pixels|. This is acceptable because the 8th filter tap is always
  264|       |  // a padded 0.
  265|  11.2M|  pixels = _mm_or_si128(pixels, left);
  266|  11.2M|  pixels = _mm_shuffle_epi8(pixels, pixel_order2);
  267|  11.2M|  const ptrdiff_t stride2 = stride << 1;
  268|  11.2M|  const ptrdiff_t stride4 = stride << 2;
  269|  11.2M|  filter_4x2_sse4_1(dst + stride2, stride, &pixels, &taps_0_1, &taps_2_3,
  270|  11.2M|                    &taps_4_5, &taps_6_7);
  271|  11.2M|  dst += 4;
  272|  24.3M|  for (int x = 3; x < width - 4; x += 4) {
  ------------------
  |  Branch (272:19): [True: 13.1M, False: 11.2M]
  ------------------
  273|  13.1M|    pixels = xx_loadl_32(top_ptr + x);
  274|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)top_ptr[x + 4], 4);
  275|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)dst[-1], 5);
  276|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride - 1], 6);
  277|       |
  278|       |    // Duplicate bottom half into upper half.
  279|  13.1M|    pixels = _mm_shuffle_epi32(pixels, DUPLICATE_FIRST_HALF);
  280|  13.1M|    filter_4x2_sse4_1(dst, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  281|  13.1M|                      &taps_6_7);
  282|  13.1M|    pixels = xx_loadl_32(dst + stride - 1);
  283|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride + 3], 4);
  284|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride2 - 1], 5);
  285|  13.1M|    pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride + stride2 - 1], 6);
  286|       |
  287|       |    // Duplicate bottom half into upper half.
  288|  13.1M|    pixels = _mm_shuffle_epi32(pixels, DUPLICATE_FIRST_HALF);
  289|  13.1M|    filter_4x2_sse4_1(dst + stride2, stride, &pixels, &taps_0_1, &taps_2_3,
  290|  13.1M|                      &taps_4_5, &taps_6_7);
  291|  13.1M|    dst += 4;
  292|  13.1M|  }
  293|       |
  294|       |  // Now we handle heights that reference previous blocks rather than top_row.
  295|  24.3M|  for (int y = 4; y < height; y += 4) {
  ------------------
  |  Branch (295:19): [True: 13.1M, False: 11.2M]
  ------------------
  296|       |    // Leftmost 4x4 block for this height.
  297|  13.1M|    dst -= width;
  298|  13.1M|    dst += stride4;
  299|       |
  300|       |    // Top Left is not available by offset in these leftmost blocks.
  301|  13.1M|    pixels = xx_loadl_32(dst - stride);
  302|  13.1M|    left = _mm_slli_si128(xx_loadl_32(left_ptr + y - 1), 8);
  303|  13.1M|    left = _mm_insert_epi8(left, (int8_t)left_ptr[y + 3], 12);
  304|  13.1M|    pixels = _mm_or_si128(pixels, left);
  305|  13.1M|    pixels = _mm_shuffle_epi8(pixels, pixel_order2);
  306|  13.1M|    filter_4x2_sse4_1(dst, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  307|  13.1M|                      &taps_6_7);
  308|       |
  309|       |    // The bytes shifted into positions 6 and 7 will be ignored by the shuffle.
  310|  13.1M|    left = _mm_srli_si128(left, 2);
  311|  13.1M|    pixels = xx_loadl_32(dst + stride);
  312|  13.1M|    pixels = _mm_or_si128(pixels, left);
  313|  13.1M|    pixels = _mm_shuffle_epi8(pixels, pixel_order2);
  314|  13.1M|    filter_4x2_sse4_1(dst + stride2, stride, &pixels, &taps_0_1, &taps_2_3,
  315|  13.1M|                      &taps_4_5, &taps_6_7);
  316|       |
  317|  13.1M|    dst += 4;
  318|       |
  319|       |    // Remaining 4x4 blocks for this height.
  320|  33.3M|    for (int x = 4; x < width; x += 4) {
  ------------------
  |  Branch (320:21): [True: 20.2M, False: 13.1M]
  ------------------
  321|  20.2M|      pixels = xx_loadl_32(dst - stride - 1);
  322|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[-stride + 3], 4);
  323|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[-1], 5);
  324|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride - 1], 6);
  325|       |
  326|       |      // Duplicate bottom half into upper half.
  327|  20.2M|      pixels = _mm_shuffle_epi32(pixels, DUPLICATE_FIRST_HALF);
  328|  20.2M|      filter_4x2_sse4_1(dst, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  329|  20.2M|                        &taps_6_7);
  330|  20.2M|      pixels = xx_loadl_32(dst + stride - 1);
  331|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride + 3], 4);
  332|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride2 - 1], 5);
  333|  20.2M|      pixels = _mm_insert_epi8(pixels, (int8_t)dst[stride2 + stride - 1], 6);
  334|       |
  335|       |      // Duplicate bottom half into upper half.
  336|       |      pixels = _mm_shuffle_epi32(pixels, DUPLICATE_FIRST_HALF);
  337|  20.2M|      filter_4x2_sse4_1(dst + stride2, stride, &pixels, &taps_0_1, &taps_2_3,
  338|  20.2M|                        &taps_4_5, &taps_6_7);
  339|  20.2M|      dst += 4;
  340|  20.2M|    }
  341|  13.1M|  }
  342|  11.2M|}
filterintra_sse4.c:filter_4xh:
   62|  5.38M|                              const int height) {
   63|  5.38M|  const __m128i taps_0_1 = xx_load_128(av1_filter_intra_taps[mode][0]);
   64|  5.38M|  const __m128i taps_2_3 = xx_load_128(av1_filter_intra_taps[mode][2]);
   65|  5.38M|  const __m128i taps_4_5 = xx_load_128(av1_filter_intra_taps[mode][4]);
   66|  5.38M|  const __m128i taps_6_7 = xx_load_128(av1_filter_intra_taps[mode][6]);
   67|  5.38M|  __m128i top = xx_loadl_32(top_ptr - 1);
   68|  5.38M|  __m128i pixels = _mm_insert_epi8(top, (int8_t)top_ptr[3], 4);
   69|  18.4E|  __m128i left = (height == 4 ? xx_loadl_32(left_ptr) : xx_loadl_64(left_ptr));
  ------------------
  |  Branch (69:19): [True: 5.39M, False: 18.4E]
  ------------------
   70|  5.38M|  left = _mm_slli_si128(left, 5);
   71|       |
   72|       |  // Relative pixels: top[-1], top[0], top[1], top[2], top[3], left[0], left[1],
   73|       |  // left[2], left[3], left[4], left[5], left[6], left[7]
   74|  5.38M|  pixels = _mm_or_si128(left, pixels);
   75|       |
   76|       |  // Duplicate first 8 bytes.
   77|  5.38M|  pixels = _mm_shuffle_epi32(pixels, DUPLICATE_FIRST_HALF);
   78|  5.38M|  filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
   79|  5.38M|                    &taps_6_7);
   80|  5.38M|  dest += stride;  // Move to y = 1.
   81|  5.38M|  pixels = xx_loadl_32(dest);
   82|       |
   83|       |  // Relative pixels: top[0], top[1], top[2], top[3], empty, left[-2], left[-1],
   84|       |  // left[0], left[1], ...
   85|  5.38M|  pixels = _mm_or_si128(left, pixels);
   86|       |
   87|       |  // This mask rearranges bytes in the order: 6, 0, 1, 2, 3, 7, 8, 15. The last
   88|       |  // byte is an unused value, which shall be multiplied by 0 when we apply the
   89|       |  // filter.
   90|  5.38M|  const int64_t kInsertTopLeftFirstMask = 0x0F08070302010006;
   91|       |
   92|       |  // Insert left[-1] in front as TL and put left[0] and left[1] at the end.
   93|  5.38M|  const __m128i pixel_order1 = _mm_set1_epi64x(kInsertTopLeftFirstMask);
   94|  5.38M|  pixels = _mm_shuffle_epi8(pixels, pixel_order1);
   95|  5.38M|  dest += stride;  // Move to y = 2.
   96|  5.38M|  filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
   97|  5.38M|                    &taps_6_7);
   98|  5.38M|  dest += stride;  // Move to y = 3.
   99|       |
  100|       |  // Compute the middle 8 rows before using common code for the final 4 rows.
  101|       |  // Because the common code below this block assumes that
  102|  5.38M|  if (height == 16) {
  ------------------
  |  Branch (102:7): [True: 0, False: 5.38M]
  ------------------
  103|       |    // This shift allows us to use pixel_order2 twice after shifting by 2 later.
  104|      0|    left = _mm_slli_si128(left, 1);
  105|      0|    pixels = xx_loadl_32(dest);
  106|       |
  107|       |    // Relative pixels: top[0], top[1], top[2], top[3], empty, empty, left[-4],
  108|       |    // left[-3], left[-2], left[-1], left[0], left[1], left[2], left[3]
  109|      0|    pixels = _mm_or_si128(left, pixels);
  110|       |
  111|       |    // This mask rearranges bytes in the order: 9, 0, 1, 2, 3, 7, 8, 15. The
  112|       |    // last byte is an unused value, as above. The top-left was shifted to
  113|       |    // position nine to keep two empty spaces after the top pixels.
  114|      0|    const int64_t kInsertTopLeftSecondMask = 0x0F0B0A0302010009;
  115|       |
  116|       |    // Insert (relative) left[-1] in front as TL and put left[0] and left[1] at
  117|       |    // the end.
  118|      0|    const __m128i pixel_order2 = _mm_set1_epi64x(kInsertTopLeftSecondMask);
  119|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order2);
  120|      0|    dest += stride;  // Move to y = 4.
  121|       |
  122|       |    // First 4x2 in the if body.
  123|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  124|      0|                      &taps_6_7);
  125|       |
  126|       |    // Clear all but final pixel in the first 8 of left column.
  127|      0|    __m128i keep_top_left = _mm_srli_si128(left, 13);
  128|      0|    dest += stride;  // Move to y = 5.
  129|      0|    pixels = xx_loadl_32(dest);
  130|      0|    left = _mm_srli_si128(left, 2);
  131|       |
  132|       |    // Relative pixels: top[0], top[1], top[2], top[3], left[-6],
  133|       |    // left[-5], left[-4], left[-3], left[-2], left[-1], left[0], left[1]
  134|      0|    pixels = _mm_or_si128(left, pixels);
  135|      0|    left = xx_loadl_64(left_ptr + 8);
  136|       |
  137|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order2);
  138|      0|    dest += stride;  // Move to y = 6.
  139|       |
  140|       |    // Second 4x2 in the if body.
  141|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  142|      0|                      &taps_6_7);
  143|       |
  144|       |    // Position TL value so we can use pixel_order1.
  145|      0|    keep_top_left = _mm_slli_si128(keep_top_left, 6);
  146|      0|    dest += stride;  // Move to y = 7.
  147|      0|    pixels = xx_loadl_32(dest);
  148|      0|    left = _mm_slli_si128(left, 7);
  149|      0|    left = _mm_or_si128(left, keep_top_left);
  150|       |
  151|       |    // Relative pixels: top[0], top[1], top[2], top[3], empty, empty,
  152|       |    // left[-1], left[0], left[1], left[2], left[3], ...
  153|      0|    pixels = _mm_or_si128(left, pixels);
  154|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order1);
  155|      0|    dest += stride;  // Move to y = 8.
  156|       |
  157|       |    // Third 4x2 in the if body.
  158|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  159|      0|                      &taps_6_7);
  160|      0|    dest += stride;  // Move to y = 9.
  161|       |
  162|       |    // Prepare final inputs.
  163|      0|    pixels = xx_loadl_32(dest);
  164|      0|    left = _mm_srli_si128(left, 2);
  165|       |
  166|       |    // Relative pixels: top[0], top[1], top[2], top[3], left[-3], left[-2]
  167|       |    // left[-1], left[0], left[1], left[2], left[3], ...
  168|      0|    pixels = _mm_or_si128(left, pixels);
  169|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order1);
  170|      0|    dest += stride;  // Move to y = 10.
  171|       |
  172|       |    // Fourth 4x2 in the if body.
  173|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  174|      0|                      &taps_6_7);
  175|      0|    dest += stride;  // Move to y = 11.
  176|      0|  }
  177|       |
  178|       |  // In both the 8 and 16 case, we assume that the left vector has the next TL
  179|       |  // at position 8.
  180|  5.38M|  if (height > 4) {
  ------------------
  |  Branch (180:7): [True: 0, False: 5.38M]
  ------------------
  181|       |    // Erase prior left pixels by shifting TL to position 0.
  182|      0|    left = _mm_srli_si128(left, 8);
  183|      0|    left = _mm_slli_si128(left, 6);
  184|      0|    pixels = xx_loadl_32(dest);
  185|       |
  186|       |    // Relative pixels: top[0], top[1], top[2], top[3], empty, empty,
  187|       |    // left[-1], left[0], left[1], left[2], left[3], ...
  188|      0|    pixels = _mm_or_si128(left, pixels);
  189|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order1);
  190|      0|    dest += stride;  // Move to y = 12 or 4.
  191|       |
  192|       |    // First of final two 4x2 blocks.
  193|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  194|      0|                      &taps_6_7);
  195|      0|    dest += stride;  // Move to y = 13 or 5.
  196|      0|    pixels = xx_loadl_32(dest);
  197|      0|    left = _mm_srli_si128(left, 2);
  198|       |
  199|       |    // Relative pixels: top[0], top[1], top[2], top[3], left[-3], left[-2]
  200|       |    // left[-1], left[0], left[1], left[2], left[3], ...
  201|      0|    pixels = _mm_or_si128(left, pixels);
  202|      0|    pixels = _mm_shuffle_epi8(pixels, pixel_order1);
  203|      0|    dest += stride;  // Move to y = 14 or 6.
  204|       |
  205|       |    // Last of final two 4x2 blocks.
  206|      0|    filter_4x2_sse4_1(dest, stride, &pixels, &taps_0_1, &taps_2_3, &taps_4_5,
  207|      0|                      &taps_6_7);
  208|      0|  }
  209|  5.38M|}
filterintra_sse4.c:filter_4x2_sse4_1:
   36|   126M|                                     const __m128i *taps_6_7) {
   37|   126M|  const __m128i mul_0_01 = _mm_maddubs_epi16(*pixels, *taps_0_1);
   38|   126M|  const __m128i mul_0_23 = _mm_maddubs_epi16(*pixels, *taps_2_3);
   39|       |  // |output_half| contains 8 partial sums.
   40|   126M|  __m128i output_half = _mm_hadd_epi16(mul_0_01, mul_0_23);
   41|   126M|  __m128i output = _mm_hadd_epi16(output_half, output_half);
   42|   126M|  const __m128i output_row0 =
   43|   126M|      _mm_packus_epi16(xx_roundn_epi16_unsigned(output, 4),
   44|   126M|                       /* arbitrary pack arg */ output);
   45|   126M|  xx_storel_32(dst, output_row0);
   46|   126M|  const __m128i mul_1_01 = _mm_maddubs_epi16(*pixels, *taps_4_5);
   47|   126M|  const __m128i mul_1_23 = _mm_maddubs_epi16(*pixels, *taps_6_7);
   48|   126M|  output_half = _mm_hadd_epi16(mul_1_01, mul_1_23);
   49|   126M|  output = _mm_hadd_epi16(output_half, output_half);
   50|   126M|  const __m128i output_row1 =
   51|   126M|      _mm_packus_epi16(xx_roundn_epi16_unsigned(output, 4),
   52|   126M|                       /* arbitrary pack arg */ output);
   53|   126M|  xx_storel_32(dst + stride, output_row1);
   54|   126M|}

av1_highbd_convolve_2d_sr_avx2:
   35|   183k|                                    ConvolveParams *conv_params, int bd) {
   36|   183k|  if (filter_params_x->taps == 12) {
  ------------------
  |  Branch (36:7): [True: 0, False: 183k]
  ------------------
   37|      0|    av1_highbd_convolve_2d_sr_ssse3(src, src_stride, dst, dst_stride, w, h,
   38|      0|                                    filter_params_x, filter_params_y,
   39|      0|                                    subpel_x_qn, subpel_y_qn, conv_params, bd);
   40|      0|    return;
   41|      0|  }
   42|       |
   43|   183k|  DECLARE_ALIGNED(32, int16_t, im_block[(MAX_SB_SIZE + MAX_FILTER_TAP) * 8]);
  ------------------
  |  |   19|   183k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   44|   183k|  int im_h = h + filter_params_y->taps - 1;
   45|   183k|  int im_stride = 8;
   46|   183k|  int i, j;
   47|   183k|  const int fo_vert = filter_params_y->taps / 2 - 1;
   48|   183k|  const int fo_horiz = filter_params_x->taps / 2 - 1;
   49|   183k|  const uint16_t *const src_ptr = src - fo_vert * src_stride - fo_horiz;
   50|       |
   51|       |  // Check that, even with 12-bit input, the intermediate values will fit
   52|       |  // into an unsigned 16-bit intermediate array.
   53|   183k|  assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
   54|       |
   55|   183k|  __m256i s[8], coeffs_y[4], coeffs_x[4];
   56|       |
   57|   183k|  const __m256i round_const_x = _mm256_set1_epi32(
   58|   183k|      ((1 << conv_params->round_0) >> 1) + (1 << (bd + FILTER_BITS - 1)));
  ------------------
  |  |   21|   183k|#define FILTER_BITS 7
  ------------------
   59|   183k|  const __m128i round_shift_x = _mm_cvtsi32_si128(conv_params->round_0);
   60|       |
   61|   183k|  const __m256i round_const_y = _mm256_set1_epi32(
   62|   183k|      ((1 << conv_params->round_1) >> 1) -
   63|   183k|      (1 << (bd + 2 * FILTER_BITS - conv_params->round_0 - 1)));
  ------------------
  |  |   21|   183k|#define FILTER_BITS 7
  ------------------
   64|   183k|  const __m128i round_shift_y = _mm_cvtsi32_si128(conv_params->round_1);
   65|       |
   66|   183k|  const int bits =
   67|   183k|      FILTER_BITS * 2 - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|   183k|#define FILTER_BITS 7
  ------------------
   68|   183k|  const __m128i round_shift_bits = _mm_cvtsi32_si128(bits);
   69|   183k|  const __m256i round_const_bits = _mm256_set1_epi32((1 << bits) >> 1);
   70|   183k|  const __m256i clip_pixel =
   71|   183k|      _mm256_set1_epi16(bd == 10 ? 1023 : (bd == 12 ? 4095 : 255));
  ------------------
  |  Branch (71:25): [True: 97.8k, False: 85.9k]
  |  Branch (71:44): [True: 85.9k, False: 22]
  ------------------
   72|   183k|  const __m256i zero = _mm256_setzero_si256();
   73|       |
   74|   183k|  prepare_coeffs(filter_params_x, subpel_x_qn, coeffs_x);
   75|   183k|  prepare_coeffs(filter_params_y, subpel_y_qn, coeffs_y);
   76|       |
   77|   395k|  for (j = 0; j < w; j += 8) {
  ------------------
  |  Branch (77:15): [True: 211k, False: 183k]
  ------------------
   78|       |    /* Horizontal filter */
   79|   211k|    {
   80|  2.06M|      for (i = 0; i < im_h; i += 2) {
  ------------------
  |  Branch (80:19): [True: 1.85M, False: 211k]
  ------------------
   81|  1.85M|        const __m256i row0 =
   82|  1.85M|            _mm256_loadu_si256((__m256i *)&src_ptr[i * src_stride + j]);
   83|  1.85M|        __m256i row1 = _mm256_setzero_si256();
   84|  1.85M|        if (i + 1 < im_h)
  ------------------
  |  Branch (84:13): [True: 1.63M, False: 211k]
  ------------------
   85|  1.63M|          row1 =
   86|  1.63M|              _mm256_loadu_si256((__m256i *)&src_ptr[(i + 1) * src_stride + j]);
   87|       |
   88|  1.85M|        const __m256i r0 = _mm256_permute2x128_si256(row0, row1, 0x20);
   89|  1.85M|        const __m256i r1 = _mm256_permute2x128_si256(row0, row1, 0x31);
   90|       |
   91|       |        // even pixels
   92|  1.85M|        s[0] = _mm256_alignr_epi8(r1, r0, 0);
   93|  1.85M|        s[1] = _mm256_alignr_epi8(r1, r0, 4);
   94|  1.85M|        s[2] = _mm256_alignr_epi8(r1, r0, 8);
   95|  1.85M|        s[3] = _mm256_alignr_epi8(r1, r0, 12);
   96|       |
   97|  1.85M|        __m256i res_even = convolve(s, coeffs_x);
   98|  1.85M|        res_even = _mm256_sra_epi32(_mm256_add_epi32(res_even, round_const_x),
   99|  1.85M|                                    round_shift_x);
  100|       |
  101|       |        // odd pixels
  102|  1.85M|        s[0] = _mm256_alignr_epi8(r1, r0, 2);
  103|  1.85M|        s[1] = _mm256_alignr_epi8(r1, r0, 6);
  104|  1.85M|        s[2] = _mm256_alignr_epi8(r1, r0, 10);
  105|  1.85M|        s[3] = _mm256_alignr_epi8(r1, r0, 14);
  106|       |
  107|  1.85M|        __m256i res_odd = convolve(s, coeffs_x);
  108|  1.85M|        res_odd = _mm256_sra_epi32(_mm256_add_epi32(res_odd, round_const_x),
  109|  1.85M|                                   round_shift_x);
  110|       |
  111|  1.85M|        __m256i res_even1 = _mm256_packs_epi32(res_even, res_even);
  112|  1.85M|        __m256i res_odd1 = _mm256_packs_epi32(res_odd, res_odd);
  113|  1.85M|        __m256i res = _mm256_unpacklo_epi16(res_even1, res_odd1);
  114|       |
  115|  1.85M|        _mm256_store_si256((__m256i *)&im_block[i * im_stride], res);
  116|  1.85M|      }
  117|   211k|    }
  118|       |
  119|       |    /* Vertical filter */
  120|   211k|    {
  121|   211k|      __m256i s0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));
  122|   211k|      __m256i s1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));
  123|   211k|      __m256i s2 = _mm256_loadu_si256((__m256i *)(im_block + 2 * im_stride));
  124|   211k|      __m256i s3 = _mm256_loadu_si256((__m256i *)(im_block + 3 * im_stride));
  125|   211k|      __m256i s4 = _mm256_loadu_si256((__m256i *)(im_block + 4 * im_stride));
  126|   211k|      __m256i s5 = _mm256_loadu_si256((__m256i *)(im_block + 5 * im_stride));
  127|       |
  128|   211k|      s[0] = _mm256_unpacklo_epi16(s0, s1);
  129|   211k|      s[1] = _mm256_unpacklo_epi16(s2, s3);
  130|   211k|      s[2] = _mm256_unpacklo_epi16(s4, s5);
  131|       |
  132|   211k|      s[4] = _mm256_unpackhi_epi16(s0, s1);
  133|   211k|      s[5] = _mm256_unpackhi_epi16(s2, s3);
  134|   211k|      s[6] = _mm256_unpackhi_epi16(s4, s5);
  135|       |
  136|  1.21M|      for (i = 0; i < h; i += 2) {
  ------------------
  |  Branch (136:19): [True: 1.00M, False: 211k]
  ------------------
  137|  1.00M|        const int16_t *data = &im_block[i * im_stride];
  138|       |
  139|  1.00M|        const __m256i s6 =
  140|  1.00M|            _mm256_loadu_si256((__m256i *)(data + 6 * im_stride));
  141|  1.00M|        const __m256i s7 =
  142|  1.00M|            _mm256_loadu_si256((__m256i *)(data + 7 * im_stride));
  143|       |
  144|  1.00M|        s[3] = _mm256_unpacklo_epi16(s6, s7);
  145|  1.00M|        s[7] = _mm256_unpackhi_epi16(s6, s7);
  146|       |
  147|  1.00M|        const __m256i res_a = convolve(s, coeffs_y);
  148|  1.00M|        __m256i res_a_round = _mm256_sra_epi32(
  149|  1.00M|            _mm256_add_epi32(res_a, round_const_y), round_shift_y);
  150|       |
  151|  1.00M|        res_a_round = _mm256_sra_epi32(
  152|  1.00M|            _mm256_add_epi32(res_a_round, round_const_bits), round_shift_bits);
  153|       |
  154|  1.00M|        if (w - j > 4) {
  ------------------
  |  Branch (154:13): [True: 873k, False: 131k]
  ------------------
  155|   873k|          const __m256i res_b = convolve(s + 4, coeffs_y);
  156|   873k|          __m256i res_b_round = _mm256_sra_epi32(
  157|   873k|              _mm256_add_epi32(res_b, round_const_y), round_shift_y);
  158|   873k|          res_b_round =
  159|   873k|              _mm256_sra_epi32(_mm256_add_epi32(res_b_round, round_const_bits),
  160|   873k|                               round_shift_bits);
  161|       |
  162|   873k|          __m256i res_16bit = _mm256_packs_epi32(res_a_round, res_b_round);
  163|   873k|          res_16bit = _mm256_min_epi16(res_16bit, clip_pixel);
  164|   873k|          res_16bit = _mm256_max_epi16(res_16bit, zero);
  165|       |
  166|   873k|          _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j],
  167|   873k|                           _mm256_castsi256_si128(res_16bit));
  168|   873k|          _mm_storeu_si128((__m128i *)&dst[i * dst_stride + j + dst_stride],
  169|   873k|                           _mm256_extracti128_si256(res_16bit, 1));
  170|   873k|        } else if (w == 4) {
  ------------------
  |  Branch (170:20): [True: 128k, False: 2.39k]
  ------------------
  171|   128k|          res_a_round = _mm256_packs_epi32(res_a_round, res_a_round);
  172|   128k|          res_a_round = _mm256_min_epi16(res_a_round, clip_pixel);
  173|   128k|          res_a_round = _mm256_max_epi16(res_a_round, zero);
  174|       |
  175|   128k|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j],
  176|   128k|                           _mm256_castsi256_si128(res_a_round));
  177|   128k|          _mm_storel_epi64((__m128i *)&dst[i * dst_stride + j + dst_stride],
  178|   128k|                           _mm256_extracti128_si256(res_a_round, 1));
  179|   128k|        } else {
  180|  2.39k|          res_a_round = _mm256_packs_epi32(res_a_round, res_a_round);
  181|  2.39k|          res_a_round = _mm256_min_epi16(res_a_round, clip_pixel);
  182|  2.39k|          res_a_round = _mm256_max_epi16(res_a_round, zero);
  183|       |
  184|  2.39k|          xx_storel_32(&dst[i * dst_stride + j],
  185|  2.39k|                       _mm256_castsi256_si128(res_a_round));
  186|  2.39k|          xx_storel_32(&dst[i * dst_stride + j + dst_stride],
  187|  2.39k|                       _mm256_extracti128_si256(res_a_round, 1));
  188|  2.39k|        }
  189|       |
  190|  1.00M|        s[0] = s[1];
  191|  1.00M|        s[1] = s[2];
  192|  1.00M|        s[2] = s[3];
  193|       |
  194|  1.00M|        s[4] = s[5];
  195|  1.00M|        s[5] = s[6];
  196|  1.00M|        s[6] = s[7];
  197|  1.00M|      }
  198|   211k|    }
  199|   211k|  }
  200|   183k|}

av1_highbd_inv_txfm_add_avx2:
 4215|  27.8M|                                  int stride, const TxfmParam *txfm_param) {
 4216|  27.8M|  assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]);
 4217|  27.8M|  const TX_SIZE tx_size = txfm_param->tx_size;
 4218|  27.8M|  switch (tx_size) {
 4219|  2.41M|    case TX_4X8:
  ------------------
  |  Branch (4219:5): [True: 2.41M, False: 25.4M]
  ------------------
 4220|  4.06M|    case TX_8X4:
  ------------------
  |  Branch (4220:5): [True: 1.65M, False: 26.1M]
  ------------------
 4221|  23.3M|    case TX_4X4:
  ------------------
  |  Branch (4221:5): [True: 19.2M, False: 8.57M]
  ------------------
 4222|  23.3M|    case TX_16X4:
  ------------------
  |  Branch (4222:5): [True: 0, False: 27.8M]
  ------------------
 4223|  23.3M|    case TX_4X16:
  ------------------
  |  Branch (4223:5): [True: 0, False: 27.8M]
  ------------------
 4224|  23.3M|      av1_highbd_inv_txfm_add_sse4_1(input, dest, stride, txfm_param);
 4225|  23.3M|      break;
 4226|  4.55M|    default:
  ------------------
  |  Branch (4226:5): [True: 4.55M, False: 23.2M]
  ------------------
 4227|  4.55M|      av1_highbd_inv_txfm2d_add_universe_avx2(
 4228|  4.55M|          input, dest, stride, txfm_param->tx_type, txfm_param->tx_size,
 4229|  4.55M|          txfm_param->eob, txfm_param->bd);
 4230|  4.55M|      break;
 4231|  27.8M|  }
 4232|  27.8M|}
highbd_inv_txfm_avx2.c:av1_highbd_inv_txfm2d_add_universe_avx2:
 4187|  4.55M|                                                    const int bd) {
 4188|  4.55M|  switch (tx_type) {
 4189|  2.54M|    case DCT_DCT:
  ------------------
  |  Branch (4189:5): [True: 2.54M, False: 2.01M]
  ------------------
 4190|  2.96M|    case ADST_DCT:
  ------------------
  |  Branch (4190:5): [True: 420k, False: 4.13M]
  ------------------
 4191|  3.44M|    case DCT_ADST:
  ------------------
  |  Branch (4191:5): [True: 477k, False: 4.08M]
  ------------------
 4192|  4.15M|    case ADST_ADST:
  ------------------
  |  Branch (4192:5): [True: 716k, False: 3.84M]
  ------------------
 4193|  4.17M|    case FLIPADST_DCT:
  ------------------
  |  Branch (4193:5): [True: 16.3k, False: 4.54M]
  ------------------
 4194|  4.19M|    case DCT_FLIPADST:
  ------------------
  |  Branch (4194:5): [True: 19.5k, False: 4.53M]
  ------------------
 4195|  4.19M|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (4195:5): [True: 2.37k, False: 4.55M]
  ------------------
 4196|  4.19M|    case ADST_FLIPADST:
  ------------------
  |  Branch (4196:5): [True: 2.77k, False: 4.55M]
  ------------------
 4197|  4.20M|    case FLIPADST_ADST:
  ------------------
  |  Branch (4197:5): [True: 3.73k, False: 4.55M]
  ------------------
 4198|  4.20M|      highbd_inv_txfm2d_add_no_identity_avx2(input, CONVERT_TO_SHORTPTR(output),
  ------------------
  |  |   79|  4.20M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 4199|  4.20M|                                             stride, tx_type, tx_size, eob, bd);
 4200|  4.20M|      break;
 4201|  7.30k|    case IDTX:
  ------------------
  |  Branch (4201:5): [True: 7.30k, False: 4.55M]
  ------------------
 4202|   257k|    case H_DCT:
  ------------------
  |  Branch (4202:5): [True: 250k, False: 4.30M]
  ------------------
 4203|   267k|    case H_ADST:
  ------------------
  |  Branch (4203:5): [True: 9.77k, False: 4.54M]
  ------------------
 4204|   274k|    case H_FLIPADST:
  ------------------
  |  Branch (4204:5): [True: 7.05k, False: 4.55M]
  ------------------
 4205|   354k|    case V_DCT:
  ------------------
  |  Branch (4205:5): [True: 80.0k, False: 4.47M]
  ------------------
 4206|   357k|    case V_ADST:
  ------------------
  |  Branch (4206:5): [True: 2.72k, False: 4.55M]
  ------------------
 4207|   359k|    case V_FLIPADST:
  ------------------
  |  Branch (4207:5): [True: 2.14k, False: 4.55M]
  ------------------
 4208|   359k|      av1_highbd_inv_txfm2d_add_universe_sse4_1(input, output, stride, tx_type,
 4209|   359k|                                                tx_size, eob, bd);
 4210|   359k|      break;
 4211|      0|    default: assert(0); break;
  ------------------
  |  Branch (4211:5): [True: 0, False: 4.55M]
  ------------------
 4212|  4.55M|  }
 4213|  4.55M|}
highbd_inv_txfm_avx2.c:highbd_inv_txfm2d_add_no_identity_avx2:
 4111|  4.20M|                                                   const int bd) {
 4112|  4.20M|  __m256i buf1[64 * 8];
 4113|  4.20M|  int eobx, eoby;
 4114|  4.20M|  get_eobx_eoby_scan_default(&eobx, &eoby, tx_size, eob);
 4115|  4.20M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 4116|  4.20M|  const int txw_idx = get_txw_idx(tx_size);
 4117|  4.20M|  const int txh_idx = get_txh_idx(tx_size);
 4118|  4.20M|  const int txfm_size_col = tx_size_wide[tx_size];
 4119|  4.20M|  const int txfm_size_row = tx_size_high[tx_size];
 4120|  4.20M|  const int buf_size_w_div8 = txfm_size_col >> 3;
 4121|  4.20M|  const int buf_size_nonzero_w = (eobx + 8) >> 3 << 3;
 4122|  4.20M|  const int buf_size_nonzero_h_div8 = (eoby + 8) >> 3;
 4123|  4.20M|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  4.20M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.95k, False: 4.19M]
  |  |  ------------------
  ------------------
 4124|  4.20M|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 4125|  4.20M|  const int fun_idx_x = lowbd_txfm_all_1d_zeros_idx[eobx];
 4126|  4.20M|  const int fun_idx_y = lowbd_txfm_all_1d_zeros_idx[eoby];
 4127|  4.20M|  const transform_1d_avx2 row_txfm =
 4128|  4.20M|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx_x];
 4129|  4.20M|  const transform_1d_avx2 col_txfm =
 4130|  4.20M|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx_y];
 4131|       |
 4132|  4.20M|  assert(col_txfm != NULL);
 4133|  4.20M|  assert(row_txfm != NULL);
 4134|  4.20M|  int ud_flip, lr_flip;
 4135|  4.20M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 4136|       |
 4137|       |  // 1st stage: column transform
 4138|  8.71M|  for (int i = 0; i < buf_size_nonzero_h_div8; i++) {
  ------------------
  |  Branch (4138:19): [True: 4.51M, False: 4.20M]
  ------------------
 4139|  4.51M|    __m256i buf0[64];
 4140|  4.51M|    load_buffer_32bit_input(input + i * 8, input_stride, buf0,
 4141|  4.51M|                            buf_size_nonzero_w);
 4142|  4.51M|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (4142:9): [True: 246k, False: 4.26M]
  |  Branch (4142:27): [True: 400k, False: 3.86M]
  ------------------
 4143|   646k|      round_shift_rect_array_32_avx2(buf0, buf0, buf_size_nonzero_w, 0,
 4144|   646k|                                     NewInvSqrt2);
 4145|   646k|    }
 4146|  4.51M|    row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|  4.51M|#define INV_COS_BIT 12
  ------------------
 4147|       |
 4148|  4.51M|    __m256i *_buf1 = buf1 + i * 8;
 4149|  4.51M|    if (lr_flip) {
  ------------------
  |  Branch (4149:9): [True: 26.2k, False: 4.48M]
  ------------------
 4150|  56.1k|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (4150:23): [True: 29.9k, False: 26.2k]
  ------------------
 4151|  29.9k|        transpose_8x8_flip_avx2(
 4152|  29.9k|            &buf0[j * 8], &_buf1[(buf_size_w_div8 - 1 - j) * txfm_size_row]);
 4153|  29.9k|      }
 4154|  4.48M|    } else {
 4155|  9.71M|      for (int j = 0; j < buf_size_w_div8; ++j) {
  ------------------
  |  Branch (4155:23): [True: 5.22M, False: 4.48M]
  ------------------
 4156|  5.22M|        transpose_8x8_avx2(&buf0[j * 8], &_buf1[j * txfm_size_row]);
 4157|  5.22M|      }
 4158|  4.48M|    }
 4159|  4.51M|  }
 4160|       |  // 2nd stage: column transform
 4161|  8.82M|  for (int i = 0; i < buf_size_w_div8; i++) {
  ------------------
  |  Branch (4161:19): [True: 4.62M, False: 4.20M]
  ------------------
 4162|  4.62M|    col_txfm(buf1 + i * txfm_size_row, buf1 + i * txfm_size_row, INV_COS_BIT, 1,
  ------------------
  |  |   43|  4.62M|#define INV_COS_BIT 12
  ------------------
 4163|  4.62M|             bd, 0);
 4164|       |
 4165|  4.62M|    round_shift_array_32_avx2(buf1 + i * txfm_size_row,
 4166|  4.62M|                              buf1 + i * txfm_size_row, txfm_size_row,
 4167|  4.62M|                              -shift[1]);
 4168|  4.62M|  }
 4169|       |
 4170|       |  // write to buffer
 4171|  4.20M|  if (txfm_size_col >= 16) {
  ------------------
  |  Branch (4171:7): [True: 341k, False: 3.85M]
  ------------------
 4172|   723k|    for (int i = 0; i < (txfm_size_col >> 4); i++) {
  ------------------
  |  Branch (4172:21): [True: 382k, False: 341k]
  ------------------
 4173|   382k|      highbd_write_buffer_16xn_avx2(buf1 + i * txfm_size_row * 2,
 4174|   382k|                                    output + 16 * i, stride, ud_flip,
 4175|   382k|                                    txfm_size_row, bd);
 4176|   382k|    }
 4177|  3.86M|  } else if (txfm_size_col == 8) {
  ------------------
  |  Branch (4177:14): [True: 3.86M, False: 18.4E]
  ------------------
 4178|  3.86M|    highbd_write_buffer_8xn_avx2(buf1, output, stride, ud_flip, txfm_size_row,
 4179|  3.86M|                                 bd);
 4180|  3.86M|  }
 4181|  4.20M|}
highbd_inv_txfm_avx2.c:idct8x8_low1_avx2:
 2414|   350k|                              int bd, int out_shift) {
 2415|   350k|  const int32_t *cospi = cospi_arr(bit);
 2416|   350k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2417|   350k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2418|   350k|  const int log_range = get_log_range(bd, do_cols);
 2419|   350k|  __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 2420|   350k|  __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 2421|   350k|  __m256i x;
 2422|       |
 2423|       |  // stage 0
 2424|       |  // stage 1
 2425|       |  // stage 2
 2426|       |  // stage 3
 2427|   350k|  x = _mm256_mullo_epi32(in[0], cospi32);
 2428|   350k|  x = _mm256_add_epi32(x, rnding);
 2429|   350k|  x = _mm256_srai_epi32(x, bit);
 2430|       |
 2431|       |  // stage 4
 2432|       |  // stage 5
 2433|   350k|  if (!do_cols) {
  ------------------
  |  Branch (2433:7): [True: 165k, False: 185k]
  ------------------
 2434|   165k|    const int log_range_out = get_log_range_out(bd);
 2435|   165k|    __m256i offset = _mm256_set1_epi32((1 << out_shift) >> 1);
 2436|   165k|    clamp_lo = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2437|   165k|    clamp_hi = _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2438|   165k|    x = _mm256_add_epi32(x, offset);
 2439|   165k|    x = _mm256_sra_epi32(x, _mm_cvtsi32_si128(out_shift));
 2440|   165k|  }
 2441|   350k|  x = _mm256_max_epi32(x, clamp_lo);
 2442|   350k|  x = _mm256_min_epi32(x, clamp_hi);
 2443|   350k|  out[0] = x;
 2444|   350k|  out[1] = x;
 2445|   350k|  out[2] = x;
 2446|   350k|  out[3] = x;
 2447|   350k|  out[4] = x;
 2448|   350k|  out[5] = x;
 2449|   350k|  out[6] = x;
 2450|   350k|  out[7] = x;
 2451|   350k|}
highbd_inv_txfm_avx2.c:idct8x8_avx2:
 2453|  5.38M|                         int bd, int out_shift) {
 2454|  5.38M|  const int32_t *cospi = cospi_arr(bit);
 2455|  5.38M|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 2456|  5.38M|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 2457|  5.38M|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 2458|  5.38M|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 2459|  5.38M|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 2460|  5.38M|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 2461|  5.38M|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2462|  5.38M|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 2463|  5.38M|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 2464|  5.38M|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 2465|  5.38M|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2466|  5.38M|  const int log_range = get_log_range(bd, do_cols);
 2467|  5.38M|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 2468|  5.38M|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 2469|  5.38M|  __m256i u0, u1, u2, u3, u4, u5, u6, u7;
 2470|  5.38M|  __m256i v0, v1, v2, v3, v4, v5, v6, v7;
 2471|  5.38M|  __m256i x, y;
 2472|       |
 2473|       |  // stage 0
 2474|       |  // stage 1
 2475|       |  // stage 2
 2476|  5.38M|  u0 = in[0];
 2477|  5.38M|  u1 = in[4];
 2478|  5.38M|  u2 = in[2];
 2479|  5.38M|  u3 = in[6];
 2480|       |
 2481|  5.38M|  x = _mm256_mullo_epi32(in[1], cospi56);
 2482|  5.38M|  y = _mm256_mullo_epi32(in[7], cospim8);
 2483|  5.38M|  u4 = _mm256_add_epi32(x, y);
 2484|  5.38M|  u4 = _mm256_add_epi32(u4, rnding);
 2485|  5.38M|  u4 = _mm256_srai_epi32(u4, bit);
 2486|       |
 2487|  5.38M|  x = _mm256_mullo_epi32(in[1], cospi8);
 2488|  5.38M|  y = _mm256_mullo_epi32(in[7], cospi56);
 2489|  5.38M|  u7 = _mm256_add_epi32(x, y);
 2490|  5.38M|  u7 = _mm256_add_epi32(u7, rnding);
 2491|  5.38M|  u7 = _mm256_srai_epi32(u7, bit);
 2492|       |
 2493|  5.38M|  x = _mm256_mullo_epi32(in[5], cospi24);
 2494|  5.38M|  y = _mm256_mullo_epi32(in[3], cospim40);
 2495|  5.38M|  u5 = _mm256_add_epi32(x, y);
 2496|  5.38M|  u5 = _mm256_add_epi32(u5, rnding);
 2497|  5.38M|  u5 = _mm256_srai_epi32(u5, bit);
 2498|       |
 2499|  5.38M|  x = _mm256_mullo_epi32(in[5], cospi40);
 2500|  5.38M|  y = _mm256_mullo_epi32(in[3], cospi24);
 2501|  5.38M|  u6 = _mm256_add_epi32(x, y);
 2502|  5.38M|  u6 = _mm256_add_epi32(u6, rnding);
 2503|  5.38M|  u6 = _mm256_srai_epi32(u6, bit);
 2504|       |
 2505|       |  // stage 3
 2506|  5.38M|  x = _mm256_mullo_epi32(u0, cospi32);
 2507|  5.38M|  y = _mm256_mullo_epi32(u1, cospi32);
 2508|  5.38M|  v0 = _mm256_add_epi32(x, y);
 2509|  5.38M|  v0 = _mm256_add_epi32(v0, rnding);
 2510|  5.38M|  v0 = _mm256_srai_epi32(v0, bit);
 2511|       |
 2512|  5.38M|  v1 = _mm256_sub_epi32(x, y);
 2513|  5.38M|  v1 = _mm256_add_epi32(v1, rnding);
 2514|  5.38M|  v1 = _mm256_srai_epi32(v1, bit);
 2515|       |
 2516|  5.38M|  x = _mm256_mullo_epi32(u2, cospi48);
 2517|  5.38M|  y = _mm256_mullo_epi32(u3, cospim16);
 2518|  5.38M|  v2 = _mm256_add_epi32(x, y);
 2519|  5.38M|  v2 = _mm256_add_epi32(v2, rnding);
 2520|  5.38M|  v2 = _mm256_srai_epi32(v2, bit);
 2521|       |
 2522|  5.38M|  x = _mm256_mullo_epi32(u2, cospi16);
 2523|  5.38M|  y = _mm256_mullo_epi32(u3, cospi48);
 2524|  5.38M|  v3 = _mm256_add_epi32(x, y);
 2525|  5.38M|  v3 = _mm256_add_epi32(v3, rnding);
 2526|  5.38M|  v3 = _mm256_srai_epi32(v3, bit);
 2527|       |
 2528|  5.38M|  addsub_avx2(u4, u5, &v4, &v5, &clamp_lo, &clamp_hi);
 2529|  5.38M|  addsub_avx2(u7, u6, &v7, &v6, &clamp_lo, &clamp_hi);
 2530|       |
 2531|       |  // stage 4
 2532|  5.38M|  addsub_avx2(v0, v3, &u0, &u3, &clamp_lo, &clamp_hi);
 2533|  5.38M|  addsub_avx2(v1, v2, &u1, &u2, &clamp_lo, &clamp_hi);
 2534|  5.38M|  u4 = v4;
 2535|  5.38M|  u7 = v7;
 2536|       |
 2537|  5.38M|  x = _mm256_mullo_epi32(v5, cospi32);
 2538|  5.38M|  y = _mm256_mullo_epi32(v6, cospi32);
 2539|  5.38M|  u6 = _mm256_add_epi32(y, x);
 2540|  5.38M|  u6 = _mm256_add_epi32(u6, rnding);
 2541|  5.38M|  u6 = _mm256_srai_epi32(u6, bit);
 2542|       |
 2543|  5.38M|  u5 = _mm256_sub_epi32(y, x);
 2544|  5.38M|  u5 = _mm256_add_epi32(u5, rnding);
 2545|  5.38M|  u5 = _mm256_srai_epi32(u5, bit);
 2546|       |
 2547|  5.38M|  addsub_avx2(u0, u7, out + 0, out + 7, &clamp_lo, &clamp_hi);
 2548|  5.38M|  addsub_avx2(u1, u6, out + 1, out + 6, &clamp_lo, &clamp_hi);
 2549|  5.38M|  addsub_avx2(u2, u5, out + 2, out + 5, &clamp_lo, &clamp_hi);
 2550|  5.38M|  addsub_avx2(u3, u4, out + 3, out + 4, &clamp_lo, &clamp_hi);
 2551|       |  // stage 5
 2552|  5.38M|  if (!do_cols) {
  ------------------
  |  Branch (2552:7): [True: 2.64M, False: 2.73M]
  ------------------
 2553|  2.64M|    const int log_range_out = get_log_range_out(bd);
 2554|  2.64M|    const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2555|  2.64M|    const __m256i clamp_hi_out =
 2556|  2.64M|        _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2557|       |
 2558|  2.64M|    round_shift_4x4_avx2(out, out_shift);
 2559|  2.64M|    round_shift_4x4_avx2(out + 4, out_shift);
 2560|  2.64M|    highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 8);
 2561|  2.64M|  }
 2562|  5.38M|}
highbd_inv_txfm_avx2.c:addsub_avx2:
  265|  94.6M|                        const __m256i *clamp_hi) {
  266|  94.6M|  __m256i a0 = _mm256_add_epi32(in0, in1);
  267|  94.6M|  __m256i a1 = _mm256_sub_epi32(in0, in1);
  268|       |
  269|  94.6M|  a0 = _mm256_max_epi32(a0, *clamp_lo);
  270|  94.6M|  a0 = _mm256_min_epi32(a0, *clamp_hi);
  271|  94.6M|  a1 = _mm256_max_epi32(a1, *clamp_lo);
  272|  94.6M|  a1 = _mm256_min_epi32(a1, *clamp_hi);
  273|       |
  274|  94.6M|  *out0 = a0;
  275|  94.6M|  *out1 = a1;
  276|  94.6M|}
highbd_inv_txfm_avx2.c:round_shift_4x4_avx2:
   50|  7.36M|static inline void round_shift_4x4_avx2(__m256i *in, int shift) {
   51|  7.36M|  if (shift != 0) {
  ------------------
  |  Branch (51:7): [True: 7.36M, False: 18.4E]
  ------------------
   52|  7.36M|    __m256i rnding = _mm256_set1_epi32(1 << (shift - 1));
   53|  7.36M|    in[0] = _mm256_add_epi32(in[0], rnding);
   54|  7.36M|    in[1] = _mm256_add_epi32(in[1], rnding);
   55|  7.36M|    in[2] = _mm256_add_epi32(in[2], rnding);
   56|  7.36M|    in[3] = _mm256_add_epi32(in[3], rnding);
   57|       |
   58|  7.36M|    in[0] = _mm256_srai_epi32(in[0], shift);
   59|  7.36M|    in[1] = _mm256_srai_epi32(in[1], shift);
   60|  7.36M|    in[2] = _mm256_srai_epi32(in[2], shift);
   61|  7.36M|    in[3] = _mm256_srai_epi32(in[3], shift);
   62|  7.36M|  }
   63|  7.36M|}
highbd_inv_txfm_avx2.c:highbd_clamp_epi32_avx2:
   74|  3.05M|                                    const __m256i *clamp_hi, int size) {
   75|  3.05M|  __m256i a0, a1;
   76|  10.4M|  for (int i = 0; i < size; i += 4) {
  ------------------
  |  Branch (76:19): [True: 7.36M, False: 3.05M]
  ------------------
   77|  7.36M|    a0 = _mm256_max_epi32(in[i], *clamp_lo);
   78|  7.36M|    out[i] = _mm256_min_epi32(a0, *clamp_hi);
   79|       |
   80|  7.36M|    a1 = _mm256_max_epi32(in[i + 1], *clamp_lo);
   81|  7.36M|    out[i + 1] = _mm256_min_epi32(a1, *clamp_hi);
   82|       |
   83|  7.36M|    a0 = _mm256_max_epi32(in[i + 2], *clamp_lo);
   84|  7.36M|    out[i + 2] = _mm256_min_epi32(a0, *clamp_hi);
   85|       |
   86|  7.36M|    a1 = _mm256_max_epi32(in[i + 3], *clamp_lo);
   87|  7.36M|    out[i + 3] = _mm256_min_epi32(a1, *clamp_hi);
   88|  7.36M|  }
   89|  3.05M|}
highbd_inv_txfm_avx2.c:iadst8x8_low1_avx2:
 2564|  83.6k|                               int bd, int out_shift) {
 2565|  83.6k|  const int32_t *cospi = cospi_arr(bit);
 2566|  83.6k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 2567|  83.6k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 2568|  83.6k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 2569|  83.6k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 2570|  83.6k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2571|  83.6k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2572|  83.6k|  const __m256i kZero = _mm256_setzero_si256();
 2573|  83.6k|  __m256i u[8], x;
 2574|       |
 2575|       |  // stage 0
 2576|       |  // stage 1
 2577|       |  // stage 2
 2578|       |
 2579|  83.6k|  x = _mm256_mullo_epi32(in[0], cospi60);
 2580|  83.6k|  u[0] = _mm256_add_epi32(x, rnding);
 2581|  83.6k|  u[0] = _mm256_srai_epi32(u[0], bit);
 2582|       |
 2583|  83.6k|  x = _mm256_mullo_epi32(in[0], cospi4);
 2584|  83.6k|  u[1] = _mm256_sub_epi32(kZero, x);
 2585|  83.6k|  u[1] = _mm256_add_epi32(u[1], rnding);
 2586|  83.6k|  u[1] = _mm256_srai_epi32(u[1], bit);
 2587|       |
 2588|       |  // stage 3
 2589|       |  // stage 4
 2590|  83.6k|  __m256i temp1, temp2;
 2591|  83.6k|  temp1 = _mm256_mullo_epi32(u[0], cospi16);
 2592|  83.6k|  x = _mm256_mullo_epi32(u[1], cospi48);
 2593|  83.6k|  temp1 = _mm256_add_epi32(temp1, x);
 2594|  83.6k|  temp1 = _mm256_add_epi32(temp1, rnding);
 2595|  83.6k|  temp1 = _mm256_srai_epi32(temp1, bit);
 2596|  83.6k|  u[4] = temp1;
 2597|       |
 2598|  83.6k|  temp2 = _mm256_mullo_epi32(u[0], cospi48);
 2599|  83.6k|  x = _mm256_mullo_epi32(u[1], cospi16);
 2600|  83.6k|  u[5] = _mm256_sub_epi32(temp2, x);
 2601|  83.6k|  u[5] = _mm256_add_epi32(u[5], rnding);
 2602|  83.6k|  u[5] = _mm256_srai_epi32(u[5], bit);
 2603|       |
 2604|       |  // stage 5
 2605|       |  // stage 6
 2606|  83.6k|  temp1 = _mm256_mullo_epi32(u[0], cospi32);
 2607|  83.6k|  x = _mm256_mullo_epi32(u[1], cospi32);
 2608|  83.6k|  u[2] = _mm256_add_epi32(temp1, x);
 2609|  83.6k|  u[2] = _mm256_add_epi32(u[2], rnding);
 2610|  83.6k|  u[2] = _mm256_srai_epi32(u[2], bit);
 2611|       |
 2612|  83.6k|  u[3] = _mm256_sub_epi32(temp1, x);
 2613|  83.6k|  u[3] = _mm256_add_epi32(u[3], rnding);
 2614|  83.6k|  u[3] = _mm256_srai_epi32(u[3], bit);
 2615|       |
 2616|  83.6k|  temp1 = _mm256_mullo_epi32(u[4], cospi32);
 2617|  83.6k|  x = _mm256_mullo_epi32(u[5], cospi32);
 2618|  83.6k|  u[6] = _mm256_add_epi32(temp1, x);
 2619|  83.6k|  u[6] = _mm256_add_epi32(u[6], rnding);
 2620|  83.6k|  u[6] = _mm256_srai_epi32(u[6], bit);
 2621|       |
 2622|  83.6k|  u[7] = _mm256_sub_epi32(temp1, x);
 2623|  83.6k|  u[7] = _mm256_add_epi32(u[7], rnding);
 2624|  83.6k|  u[7] = _mm256_srai_epi32(u[7], bit);
 2625|       |
 2626|       |  // stage 7
 2627|  83.6k|  if (do_cols) {
  ------------------
  |  Branch (2627:7): [True: 41.4k, False: 42.2k]
  ------------------
 2628|  41.4k|    out[0] = u[0];
 2629|  41.4k|    out[1] = _mm256_sub_epi32(kZero, u[4]);
 2630|  41.4k|    out[2] = u[6];
 2631|  41.4k|    out[3] = _mm256_sub_epi32(kZero, u[2]);
 2632|  41.4k|    out[4] = u[3];
 2633|  41.4k|    out[5] = _mm256_sub_epi32(kZero, u[7]);
 2634|  41.4k|    out[6] = u[5];
 2635|  41.4k|    out[7] = _mm256_sub_epi32(kZero, u[1]);
 2636|  42.2k|  } else {
 2637|  42.2k|    const int log_range_out = get_log_range_out(bd);
 2638|  42.2k|    const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2639|  42.2k|    const __m256i clamp_hi_out =
 2640|  42.2k|        _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2641|       |
 2642|  42.2k|    neg_shift_avx2(u[0], u[4], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2643|  42.2k|                   out_shift);
 2644|  42.2k|    neg_shift_avx2(u[6], u[2], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out,
 2645|  42.2k|                   out_shift);
 2646|  42.2k|    neg_shift_avx2(u[3], u[7], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out,
 2647|  42.2k|                   out_shift);
 2648|  42.2k|    neg_shift_avx2(u[5], u[1], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out,
 2649|  42.2k|                   out_shift);
 2650|  42.2k|  }
 2651|  83.6k|}
highbd_inv_txfm_avx2.c:neg_shift_avx2:
  143|  5.46M|                           const __m256i *clamp_hi, int shift) {
  144|  5.46M|  __m256i offset = _mm256_set1_epi32((1 << shift) >> 1);
  145|  5.46M|  __m256i a0 = _mm256_add_epi32(offset, in0);
  146|  5.46M|  __m256i a1 = _mm256_sub_epi32(offset, in1);
  147|       |
  148|  5.46M|  a0 = _mm256_sra_epi32(a0, _mm_cvtsi32_si128(shift));
  149|  5.46M|  a1 = _mm256_sra_epi32(a1, _mm_cvtsi32_si128(shift));
  150|       |
  151|  5.46M|  a0 = _mm256_max_epi32(a0, *clamp_lo);
  152|  5.46M|  a0 = _mm256_min_epi32(a0, *clamp_hi);
  153|  5.46M|  a1 = _mm256_max_epi32(a1, *clamp_lo);
  154|  5.46M|  a1 = _mm256_min_epi32(a1, *clamp_hi);
  155|       |
  156|  5.46M|  *out0 = a0;
  157|  5.46M|  *out1 = a1;
  158|  5.46M|}
highbd_inv_txfm_avx2.c:iadst8x8_avx2:
 2654|  2.24M|                          int bd, int out_shift) {
 2655|  2.24M|  const int32_t *cospi = cospi_arr(bit);
 2656|  2.24M|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 2657|  2.24M|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 2658|  2.24M|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 2659|  2.24M|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 2660|  2.24M|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
 2661|  2.24M|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 2662|  2.24M|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
 2663|  2.24M|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 2664|  2.24M|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 2665|  2.24M|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 2666|  2.24M|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 2667|  2.24M|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2668|  2.24M|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2669|  2.24M|  const __m256i kZero = _mm256_setzero_si256();
 2670|  2.24M|  const int log_range = get_log_range(bd, do_cols);
 2671|  2.24M|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 2672|  2.24M|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 2673|  2.24M|  __m256i u[8], v[8], x;
 2674|       |
 2675|       |  // stage 0
 2676|       |  // stage 1
 2677|       |  // stage 2
 2678|       |
 2679|  2.24M|  u[0] = _mm256_mullo_epi32(in[7], cospi4);
 2680|  2.24M|  x = _mm256_mullo_epi32(in[0], cospi60);
 2681|  2.24M|  u[0] = _mm256_add_epi32(u[0], x);
 2682|  2.24M|  u[0] = _mm256_add_epi32(u[0], rnding);
 2683|  2.24M|  u[0] = _mm256_srai_epi32(u[0], bit);
 2684|       |
 2685|  2.24M|  u[1] = _mm256_mullo_epi32(in[7], cospi60);
 2686|  2.24M|  x = _mm256_mullo_epi32(in[0], cospi4);
 2687|  2.24M|  u[1] = _mm256_sub_epi32(u[1], x);
 2688|  2.24M|  u[1] = _mm256_add_epi32(u[1], rnding);
 2689|  2.24M|  u[1] = _mm256_srai_epi32(u[1], bit);
 2690|       |
 2691|  2.24M|  u[2] = _mm256_mullo_epi32(in[5], cospi20);
 2692|  2.24M|  x = _mm256_mullo_epi32(in[2], cospi44);
 2693|  2.24M|  u[2] = _mm256_add_epi32(u[2], x);
 2694|  2.24M|  u[2] = _mm256_add_epi32(u[2], rnding);
 2695|  2.24M|  u[2] = _mm256_srai_epi32(u[2], bit);
 2696|       |
 2697|  2.24M|  u[3] = _mm256_mullo_epi32(in[5], cospi44);
 2698|  2.24M|  x = _mm256_mullo_epi32(in[2], cospi20);
 2699|  2.24M|  u[3] = _mm256_sub_epi32(u[3], x);
 2700|  2.24M|  u[3] = _mm256_add_epi32(u[3], rnding);
 2701|  2.24M|  u[3] = _mm256_srai_epi32(u[3], bit);
 2702|       |
 2703|  2.24M|  u[4] = _mm256_mullo_epi32(in[3], cospi36);
 2704|  2.24M|  x = _mm256_mullo_epi32(in[4], cospi28);
 2705|  2.24M|  u[4] = _mm256_add_epi32(u[4], x);
 2706|  2.24M|  u[4] = _mm256_add_epi32(u[4], rnding);
 2707|  2.24M|  u[4] = _mm256_srai_epi32(u[4], bit);
 2708|       |
 2709|  2.24M|  u[5] = _mm256_mullo_epi32(in[3], cospi28);
 2710|  2.24M|  x = _mm256_mullo_epi32(in[4], cospi36);
 2711|  2.24M|  u[5] = _mm256_sub_epi32(u[5], x);
 2712|  2.24M|  u[5] = _mm256_add_epi32(u[5], rnding);
 2713|  2.24M|  u[5] = _mm256_srai_epi32(u[5], bit);
 2714|       |
 2715|  2.24M|  u[6] = _mm256_mullo_epi32(in[1], cospi52);
 2716|  2.24M|  x = _mm256_mullo_epi32(in[6], cospi12);
 2717|  2.24M|  u[6] = _mm256_add_epi32(u[6], x);
 2718|  2.24M|  u[6] = _mm256_add_epi32(u[6], rnding);
 2719|  2.24M|  u[6] = _mm256_srai_epi32(u[6], bit);
 2720|       |
 2721|  2.24M|  u[7] = _mm256_mullo_epi32(in[1], cospi12);
 2722|  2.24M|  x = _mm256_mullo_epi32(in[6], cospi52);
 2723|  2.24M|  u[7] = _mm256_sub_epi32(u[7], x);
 2724|  2.24M|  u[7] = _mm256_add_epi32(u[7], rnding);
 2725|  2.24M|  u[7] = _mm256_srai_epi32(u[7], bit);
 2726|       |
 2727|       |  // stage 3
 2728|  2.24M|  addsub_avx2(u[0], u[4], &v[0], &v[4], &clamp_lo, &clamp_hi);
 2729|  2.24M|  addsub_avx2(u[1], u[5], &v[1], &v[5], &clamp_lo, &clamp_hi);
 2730|  2.24M|  addsub_avx2(u[2], u[6], &v[2], &v[6], &clamp_lo, &clamp_hi);
 2731|  2.24M|  addsub_avx2(u[3], u[7], &v[3], &v[7], &clamp_lo, &clamp_hi);
 2732|       |
 2733|       |  // stage 4
 2734|  2.24M|  u[0] = v[0];
 2735|  2.24M|  u[1] = v[1];
 2736|  2.24M|  u[2] = v[2];
 2737|  2.24M|  u[3] = v[3];
 2738|       |
 2739|  2.24M|  u[4] = _mm256_mullo_epi32(v[4], cospi16);
 2740|  2.24M|  x = _mm256_mullo_epi32(v[5], cospi48);
 2741|  2.24M|  u[4] = _mm256_add_epi32(u[4], x);
 2742|  2.24M|  u[4] = _mm256_add_epi32(u[4], rnding);
 2743|  2.24M|  u[4] = _mm256_srai_epi32(u[4], bit);
 2744|       |
 2745|  2.24M|  u[5] = _mm256_mullo_epi32(v[4], cospi48);
 2746|  2.24M|  x = _mm256_mullo_epi32(v[5], cospi16);
 2747|  2.24M|  u[5] = _mm256_sub_epi32(u[5], x);
 2748|  2.24M|  u[5] = _mm256_add_epi32(u[5], rnding);
 2749|  2.24M|  u[5] = _mm256_srai_epi32(u[5], bit);
 2750|       |
 2751|  2.24M|  u[6] = _mm256_mullo_epi32(v[6], cospim48);
 2752|  2.24M|  x = _mm256_mullo_epi32(v[7], cospi16);
 2753|  2.24M|  u[6] = _mm256_add_epi32(u[6], x);
 2754|  2.24M|  u[6] = _mm256_add_epi32(u[6], rnding);
 2755|  2.24M|  u[6] = _mm256_srai_epi32(u[6], bit);
 2756|       |
 2757|  2.24M|  u[7] = _mm256_mullo_epi32(v[6], cospi16);
 2758|  2.24M|  x = _mm256_mullo_epi32(v[7], cospim48);
 2759|  2.24M|  u[7] = _mm256_sub_epi32(u[7], x);
 2760|  2.24M|  u[7] = _mm256_add_epi32(u[7], rnding);
 2761|  2.24M|  u[7] = _mm256_srai_epi32(u[7], bit);
 2762|       |
 2763|       |  // stage 5
 2764|  2.24M|  addsub_avx2(u[0], u[2], &v[0], &v[2], &clamp_lo, &clamp_hi);
 2765|  2.24M|  addsub_avx2(u[1], u[3], &v[1], &v[3], &clamp_lo, &clamp_hi);
 2766|  2.24M|  addsub_avx2(u[4], u[6], &v[4], &v[6], &clamp_lo, &clamp_hi);
 2767|  2.24M|  addsub_avx2(u[5], u[7], &v[5], &v[7], &clamp_lo, &clamp_hi);
 2768|       |
 2769|       |  // stage 6
 2770|  2.24M|  u[0] = v[0];
 2771|  2.24M|  u[1] = v[1];
 2772|  2.24M|  u[4] = v[4];
 2773|  2.24M|  u[5] = v[5];
 2774|       |
 2775|  2.24M|  v[0] = _mm256_mullo_epi32(v[2], cospi32);
 2776|  2.24M|  x = _mm256_mullo_epi32(v[3], cospi32);
 2777|  2.24M|  u[2] = _mm256_add_epi32(v[0], x);
 2778|  2.24M|  u[2] = _mm256_add_epi32(u[2], rnding);
 2779|  2.24M|  u[2] = _mm256_srai_epi32(u[2], bit);
 2780|       |
 2781|  2.24M|  u[3] = _mm256_sub_epi32(v[0], x);
 2782|  2.24M|  u[3] = _mm256_add_epi32(u[3], rnding);
 2783|  2.24M|  u[3] = _mm256_srai_epi32(u[3], bit);
 2784|       |
 2785|  2.24M|  v[0] = _mm256_mullo_epi32(v[6], cospi32);
 2786|  2.24M|  x = _mm256_mullo_epi32(v[7], cospi32);
 2787|  2.24M|  u[6] = _mm256_add_epi32(v[0], x);
 2788|  2.24M|  u[6] = _mm256_add_epi32(u[6], rnding);
 2789|  2.24M|  u[6] = _mm256_srai_epi32(u[6], bit);
 2790|       |
 2791|  2.24M|  u[7] = _mm256_sub_epi32(v[0], x);
 2792|  2.24M|  u[7] = _mm256_add_epi32(u[7], rnding);
 2793|  2.24M|  u[7] = _mm256_srai_epi32(u[7], bit);
 2794|       |
 2795|       |  // stage 7
 2796|  2.24M|  if (do_cols) {
  ------------------
  |  Branch (2796:7): [True: 1.09M, False: 1.14M]
  ------------------
 2797|  1.09M|    out[0] = u[0];
 2798|  1.09M|    out[1] = _mm256_sub_epi32(kZero, u[4]);
 2799|  1.09M|    out[2] = u[6];
 2800|  1.09M|    out[3] = _mm256_sub_epi32(kZero, u[2]);
 2801|  1.09M|    out[4] = u[3];
 2802|  1.09M|    out[5] = _mm256_sub_epi32(kZero, u[7]);
 2803|  1.09M|    out[6] = u[5];
 2804|  1.09M|    out[7] = _mm256_sub_epi32(kZero, u[1]);
 2805|  1.14M|  } else {
 2806|  1.14M|    const int log_range_out = get_log_range_out(bd);
 2807|  1.14M|    const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2808|  1.14M|    const __m256i clamp_hi_out =
 2809|  1.14M|        _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2810|       |
 2811|  1.14M|    neg_shift_avx2(u[0], u[4], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2812|  1.14M|                   out_shift);
 2813|  1.14M|    neg_shift_avx2(u[6], u[2], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out,
 2814|  1.14M|                   out_shift);
 2815|  1.14M|    neg_shift_avx2(u[3], u[7], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out,
 2816|  1.14M|                   out_shift);
 2817|  1.14M|    neg_shift_avx2(u[5], u[1], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out,
 2818|  1.14M|                   out_shift);
 2819|  1.14M|  }
 2820|  2.24M|}
highbd_inv_txfm_avx2.c:idct16_low1_avx2:
 1155|  40.3k|                             int bd, int out_shift) {
 1156|  40.3k|  const int32_t *cospi = cospi_arr(bit);
 1157|  40.3k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1158|  40.3k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1159|  40.3k|  const int log_range = get_log_range(bd, do_cols);
 1160|  40.3k|  __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 1161|  40.3k|  __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 1162|       |
 1163|  40.3k|  {
 1164|       |    // stage 0
 1165|       |    // stage 1
 1166|       |    // stage 2
 1167|       |    // stage 3
 1168|       |    // stage 4
 1169|  40.3k|    in[0] = _mm256_mullo_epi32(in[0], cospi32);
 1170|  40.3k|    in[0] = _mm256_add_epi32(in[0], rnding);
 1171|  40.3k|    in[0] = _mm256_srai_epi32(in[0], bit);
 1172|       |
 1173|       |    // stage 5
 1174|       |    // stage 6
 1175|       |    // stage 7
 1176|  40.3k|    if (!do_cols) {
  ------------------
  |  Branch (1176:9): [True: 17.6k, False: 22.6k]
  ------------------
 1177|  17.6k|      const int log_range_out = get_log_range_out(bd);
 1178|  17.6k|      clamp_lo = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 1179|  17.6k|      clamp_hi = _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 1180|  17.6k|      __m256i offset = _mm256_set1_epi32((1 << out_shift) >> 1);
 1181|  17.6k|      in[0] = _mm256_add_epi32(in[0], offset);
 1182|  17.6k|      in[0] = _mm256_sra_epi32(in[0], _mm_cvtsi32_si128(out_shift));
 1183|  17.6k|    }
 1184|  40.3k|    in[0] = _mm256_max_epi32(in[0], clamp_lo);
 1185|  40.3k|    in[0] = _mm256_min_epi32(in[0], clamp_hi);
 1186|  40.3k|    out[0] = in[0];
 1187|  40.3k|    out[1] = in[0];
 1188|  40.3k|    out[2] = in[0];
 1189|  40.3k|    out[3] = in[0];
 1190|  40.3k|    out[4] = in[0];
 1191|  40.3k|    out[5] = in[0];
 1192|  40.3k|    out[6] = in[0];
 1193|  40.3k|    out[7] = in[0];
 1194|  40.3k|    out[8] = in[0];
 1195|  40.3k|    out[9] = in[0];
 1196|  40.3k|    out[10] = in[0];
 1197|  40.3k|    out[11] = in[0];
 1198|  40.3k|    out[12] = in[0];
 1199|  40.3k|    out[13] = in[0];
 1200|  40.3k|    out[14] = in[0];
 1201|  40.3k|    out[15] = in[0];
 1202|  40.3k|  }
 1203|  40.3k|}
highbd_inv_txfm_avx2.c:idct16_low8_avx2:
 1206|  97.2k|                             int bd, int out_shift) {
 1207|  97.2k|  const int32_t *cospi = cospi_arr(bit);
 1208|  97.2k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 1209|  97.2k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 1210|  97.2k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 1211|  97.2k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 1212|  97.2k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 1213|  97.2k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 1214|  97.2k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 1215|  97.2k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 1216|  97.2k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 1217|  97.2k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 1218|  97.2k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1219|  97.2k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 1220|  97.2k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 1221|  97.2k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 1222|  97.2k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 1223|  97.2k|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
 1224|  97.2k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
 1225|  97.2k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1226|  97.2k|  const int log_range = get_log_range(bd, do_cols);
 1227|  97.2k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 1228|  97.2k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 1229|  97.2k|  __m256i u[16], x, y;
 1230|       |
 1231|  97.2k|  {
 1232|       |    // stage 0
 1233|       |    // stage 1
 1234|  97.2k|    u[0] = in[0];
 1235|  97.2k|    u[2] = in[4];
 1236|  97.2k|    u[4] = in[2];
 1237|  97.2k|    u[6] = in[6];
 1238|  97.2k|    u[8] = in[1];
 1239|  97.2k|    u[10] = in[5];
 1240|  97.2k|    u[12] = in[3];
 1241|  97.2k|    u[14] = in[7];
 1242|       |
 1243|       |    // stage 2
 1244|  97.2k|    u[15] = half_btf_0_avx2(&cospi4, &u[8], &rnding, bit);
 1245|  97.2k|    u[8] = half_btf_0_avx2(&cospi60, &u[8], &rnding, bit);
 1246|       |
 1247|  97.2k|    u[9] = half_btf_0_avx2(&cospim36, &u[14], &rnding, bit);
 1248|  97.2k|    u[14] = half_btf_0_avx2(&cospi28, &u[14], &rnding, bit);
 1249|       |
 1250|  97.2k|    u[13] = half_btf_0_avx2(&cospi20, &u[10], &rnding, bit);
 1251|  97.2k|    u[10] = half_btf_0_avx2(&cospi44, &u[10], &rnding, bit);
 1252|       |
 1253|  97.2k|    u[11] = half_btf_0_avx2(&cospim52, &u[12], &rnding, bit);
 1254|  97.2k|    u[12] = half_btf_0_avx2(&cospi12, &u[12], &rnding, bit);
 1255|       |
 1256|       |    // stage 3
 1257|  97.2k|    u[7] = half_btf_0_avx2(&cospi8, &u[4], &rnding, bit);
 1258|  97.2k|    u[4] = half_btf_0_avx2(&cospi56, &u[4], &rnding, bit);
 1259|  97.2k|    u[5] = half_btf_0_avx2(&cospim40, &u[6], &rnding, bit);
 1260|  97.2k|    u[6] = half_btf_0_avx2(&cospi24, &u[6], &rnding, bit);
 1261|       |
 1262|  97.2k|    addsub_avx2(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi);
 1263|  97.2k|    addsub_avx2(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi);
 1264|  97.2k|    addsub_avx2(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi);
 1265|  97.2k|    addsub_avx2(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi);
 1266|       |
 1267|       |    // stage 4
 1268|  97.2k|    x = _mm256_mullo_epi32(u[0], cospi32);
 1269|  97.2k|    u[0] = _mm256_add_epi32(x, rnding);
 1270|  97.2k|    u[0] = _mm256_srai_epi32(u[0], bit);
 1271|  97.2k|    u[1] = u[0];
 1272|       |
 1273|  97.2k|    u[3] = half_btf_0_avx2(&cospi16, &u[2], &rnding, bit);
 1274|  97.2k|    u[2] = half_btf_0_avx2(&cospi48, &u[2], &rnding, bit);
 1275|       |
 1276|  97.2k|    addsub_avx2(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi);
 1277|  97.2k|    addsub_avx2(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi);
 1278|       |
 1279|  97.2k|    x = half_btf_avx2(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 1280|  97.2k|    u[14] = half_btf_avx2(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 1281|  97.2k|    u[9] = x;
 1282|  97.2k|    y = half_btf_avx2(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 1283|  97.2k|    u[13] = half_btf_avx2(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 1284|  97.2k|    u[10] = y;
 1285|       |
 1286|       |    // stage 5
 1287|  97.2k|    addsub_avx2(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi);
 1288|  97.2k|    addsub_avx2(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi);
 1289|       |
 1290|  97.2k|    x = _mm256_mullo_epi32(u[5], cospi32);
 1291|  97.2k|    y = _mm256_mullo_epi32(u[6], cospi32);
 1292|  97.2k|    u[5] = _mm256_sub_epi32(y, x);
 1293|  97.2k|    u[5] = _mm256_add_epi32(u[5], rnding);
 1294|  97.2k|    u[5] = _mm256_srai_epi32(u[5], bit);
 1295|       |
 1296|  97.2k|    u[6] = _mm256_add_epi32(y, x);
 1297|  97.2k|    u[6] = _mm256_add_epi32(u[6], rnding);
 1298|  97.2k|    u[6] = _mm256_srai_epi32(u[6], bit);
 1299|       |
 1300|  97.2k|    addsub_avx2(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 1301|  97.2k|    addsub_avx2(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 1302|  97.2k|    addsub_avx2(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 1303|  97.2k|    addsub_avx2(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 1304|       |
 1305|       |    // stage 6
 1306|  97.2k|    addsub_avx2(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi);
 1307|  97.2k|    addsub_avx2(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi);
 1308|  97.2k|    addsub_avx2(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi);
 1309|  97.2k|    addsub_avx2(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi);
 1310|       |
 1311|  97.2k|    x = _mm256_mullo_epi32(u[10], cospi32);
 1312|  97.2k|    y = _mm256_mullo_epi32(u[13], cospi32);
 1313|  97.2k|    u[10] = _mm256_sub_epi32(y, x);
 1314|  97.2k|    u[10] = _mm256_add_epi32(u[10], rnding);
 1315|  97.2k|    u[10] = _mm256_srai_epi32(u[10], bit);
 1316|       |
 1317|  97.2k|    u[13] = _mm256_add_epi32(x, y);
 1318|  97.2k|    u[13] = _mm256_add_epi32(u[13], rnding);
 1319|  97.2k|    u[13] = _mm256_srai_epi32(u[13], bit);
 1320|       |
 1321|  97.2k|    x = _mm256_mullo_epi32(u[11], cospi32);
 1322|  97.2k|    y = _mm256_mullo_epi32(u[12], cospi32);
 1323|  97.2k|    u[11] = _mm256_sub_epi32(y, x);
 1324|  97.2k|    u[11] = _mm256_add_epi32(u[11], rnding);
 1325|  97.2k|    u[11] = _mm256_srai_epi32(u[11], bit);
 1326|       |
 1327|  97.2k|    u[12] = _mm256_add_epi32(x, y);
 1328|  97.2k|    u[12] = _mm256_add_epi32(u[12], rnding);
 1329|  97.2k|    u[12] = _mm256_srai_epi32(u[12], bit);
 1330|       |    // stage 7
 1331|  97.2k|    addsub_avx2(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi);
 1332|  97.2k|    addsub_avx2(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi);
 1333|  97.2k|    addsub_avx2(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi);
 1334|  97.2k|    addsub_avx2(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi);
 1335|  97.2k|    addsub_avx2(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi);
 1336|  97.2k|    addsub_avx2(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi);
 1337|  97.2k|    addsub_avx2(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi);
 1338|  97.2k|    addsub_avx2(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi);
 1339|       |
 1340|  97.2k|    if (!do_cols) {
  ------------------
  |  Branch (1340:9): [True: 40.7k, False: 56.4k]
  ------------------
 1341|  40.7k|      const int log_range_out = get_log_range_out(bd);
 1342|  40.7k|      const __m256i clamp_lo_out =
 1343|  40.7k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 1344|  40.7k|      const __m256i clamp_hi_out =
 1345|  40.7k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 1346|  40.7k|      round_shift_8x8_avx2(out, out_shift);
 1347|  40.7k|      highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
 1348|  40.7k|    }
 1349|  97.2k|  }
 1350|  97.2k|}
highbd_inv_txfm_avx2.c:half_btf_0_avx2:
  242|  2.52M|                                      const __m256i *rounding, int bit) {
  243|  2.52M|  __m256i x;
  244|  2.52M|  x = _mm256_mullo_epi32(*w0, *n0);
  245|  2.52M|  x = _mm256_add_epi32(x, *rounding);
  246|  2.52M|  x = _mm256_srai_epi32(x, bit);
  247|  2.52M|  return x;
  248|  2.52M|}
highbd_inv_txfm_avx2.c:half_btf_avx2:
  252|  23.4M|                                    const __m256i *rounding, int bit) {
  253|  23.4M|  __m256i x, y;
  254|       |
  255|  23.4M|  x = _mm256_mullo_epi32(*w0, *n0);
  256|  23.4M|  y = _mm256_mullo_epi32(*w1, *n1);
  257|  23.4M|  x = _mm256_add_epi32(x, y);
  258|  23.4M|  x = _mm256_add_epi32(x, *rounding);
  259|  23.4M|  x = _mm256_srai_epi32(x, bit);
  260|  23.4M|  return x;
  261|  23.4M|}
highbd_inv_txfm_avx2.c:round_shift_8x8_avx2:
   65|   517k|static inline void round_shift_8x8_avx2(__m256i *in, int shift) {
   66|   517k|  round_shift_4x4_avx2(in, shift);
   67|   517k|  round_shift_4x4_avx2(in + 4, shift);
   68|   517k|  round_shift_4x4_avx2(in + 8, shift);
   69|   517k|  round_shift_4x4_avx2(in + 12, shift);
   70|   517k|}
highbd_inv_txfm_avx2.c:idct16_avx2:
 1353|   552k|                        int out_shift) {
 1354|   552k|  const int32_t *cospi = cospi_arr(bit);
 1355|   552k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 1356|   552k|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
 1357|   552k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 1358|   552k|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
 1359|   552k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 1360|   552k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 1361|   552k|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
 1362|   552k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 1363|   552k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
 1364|   552k|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
 1365|   552k|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
 1366|   552k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 1367|   552k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 1368|   552k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 1369|   552k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 1370|   552k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 1371|   552k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 1372|   552k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 1373|   552k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1374|   552k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 1375|   552k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 1376|   552k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 1377|   552k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 1378|   552k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1379|   552k|  const int log_range = get_log_range(bd, do_cols);
 1380|   552k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 1381|   552k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 1382|   552k|  __m256i u[16], v[16], x, y;
 1383|       |
 1384|   552k|  {
 1385|       |    // stage 0
 1386|       |    // stage 1
 1387|   552k|    u[0] = in[0];
 1388|   552k|    u[1] = in[8];
 1389|   552k|    u[2] = in[4];
 1390|   552k|    u[3] = in[12];
 1391|   552k|    u[4] = in[2];
 1392|   552k|    u[5] = in[10];
 1393|   552k|    u[6] = in[6];
 1394|   552k|    u[7] = in[14];
 1395|   552k|    u[8] = in[1];
 1396|   552k|    u[9] = in[9];
 1397|   552k|    u[10] = in[5];
 1398|   552k|    u[11] = in[13];
 1399|   552k|    u[12] = in[3];
 1400|   552k|    u[13] = in[11];
 1401|   552k|    u[14] = in[7];
 1402|   552k|    u[15] = in[15];
 1403|       |
 1404|       |    // stage 2
 1405|   552k|    v[0] = u[0];
 1406|   552k|    v[1] = u[1];
 1407|   552k|    v[2] = u[2];
 1408|   552k|    v[3] = u[3];
 1409|   552k|    v[4] = u[4];
 1410|   552k|    v[5] = u[5];
 1411|   552k|    v[6] = u[6];
 1412|   552k|    v[7] = u[7];
 1413|       |
 1414|   552k|    v[8] = half_btf_avx2(&cospi60, &u[8], &cospim4, &u[15], &rnding, bit);
 1415|   552k|    v[9] = half_btf_avx2(&cospi28, &u[9], &cospim36, &u[14], &rnding, bit);
 1416|   552k|    v[10] = half_btf_avx2(&cospi44, &u[10], &cospim20, &u[13], &rnding, bit);
 1417|   552k|    v[11] = half_btf_avx2(&cospi12, &u[11], &cospim52, &u[12], &rnding, bit);
 1418|   552k|    v[12] = half_btf_avx2(&cospi52, &u[11], &cospi12, &u[12], &rnding, bit);
 1419|   552k|    v[13] = half_btf_avx2(&cospi20, &u[10], &cospi44, &u[13], &rnding, bit);
 1420|   552k|    v[14] = half_btf_avx2(&cospi36, &u[9], &cospi28, &u[14], &rnding, bit);
 1421|   552k|    v[15] = half_btf_avx2(&cospi4, &u[8], &cospi60, &u[15], &rnding, bit);
 1422|       |
 1423|       |    // stage 3
 1424|   552k|    u[0] = v[0];
 1425|   552k|    u[1] = v[1];
 1426|   552k|    u[2] = v[2];
 1427|   552k|    u[3] = v[3];
 1428|   552k|    u[4] = half_btf_avx2(&cospi56, &v[4], &cospim8, &v[7], &rnding, bit);
 1429|   552k|    u[5] = half_btf_avx2(&cospi24, &v[5], &cospim40, &v[6], &rnding, bit);
 1430|   552k|    u[6] = half_btf_avx2(&cospi40, &v[5], &cospi24, &v[6], &rnding, bit);
 1431|   552k|    u[7] = half_btf_avx2(&cospi8, &v[4], &cospi56, &v[7], &rnding, bit);
 1432|   552k|    addsub_avx2(v[8], v[9], &u[8], &u[9], &clamp_lo, &clamp_hi);
 1433|   552k|    addsub_avx2(v[11], v[10], &u[11], &u[10], &clamp_lo, &clamp_hi);
 1434|   552k|    addsub_avx2(v[12], v[13], &u[12], &u[13], &clamp_lo, &clamp_hi);
 1435|   552k|    addsub_avx2(v[15], v[14], &u[15], &u[14], &clamp_lo, &clamp_hi);
 1436|       |
 1437|       |    // stage 4
 1438|   552k|    x = _mm256_mullo_epi32(u[0], cospi32);
 1439|   552k|    y = _mm256_mullo_epi32(u[1], cospi32);
 1440|   552k|    v[0] = _mm256_add_epi32(x, y);
 1441|   552k|    v[0] = _mm256_add_epi32(v[0], rnding);
 1442|   552k|    v[0] = _mm256_srai_epi32(v[0], bit);
 1443|       |
 1444|   552k|    v[1] = _mm256_sub_epi32(x, y);
 1445|   552k|    v[1] = _mm256_add_epi32(v[1], rnding);
 1446|   552k|    v[1] = _mm256_srai_epi32(v[1], bit);
 1447|       |
 1448|   552k|    v[2] = half_btf_avx2(&cospi48, &u[2], &cospim16, &u[3], &rnding, bit);
 1449|   552k|    v[3] = half_btf_avx2(&cospi16, &u[2], &cospi48, &u[3], &rnding, bit);
 1450|   552k|    addsub_avx2(u[4], u[5], &v[4], &v[5], &clamp_lo, &clamp_hi);
 1451|   552k|    addsub_avx2(u[7], u[6], &v[7], &v[6], &clamp_lo, &clamp_hi);
 1452|   552k|    v[8] = u[8];
 1453|   552k|    v[9] = half_btf_avx2(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 1454|   552k|    v[10] = half_btf_avx2(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 1455|   552k|    v[11] = u[11];
 1456|   552k|    v[12] = u[12];
 1457|   552k|    v[13] = half_btf_avx2(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 1458|   552k|    v[14] = half_btf_avx2(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 1459|   552k|    v[15] = u[15];
 1460|       |
 1461|       |    // stage 5
 1462|   552k|    addsub_avx2(v[0], v[3], &u[0], &u[3], &clamp_lo, &clamp_hi);
 1463|   552k|    addsub_avx2(v[1], v[2], &u[1], &u[2], &clamp_lo, &clamp_hi);
 1464|   552k|    u[4] = v[4];
 1465|       |
 1466|   552k|    x = _mm256_mullo_epi32(v[5], cospi32);
 1467|   552k|    y = _mm256_mullo_epi32(v[6], cospi32);
 1468|   552k|    u[5] = _mm256_sub_epi32(y, x);
 1469|   552k|    u[5] = _mm256_add_epi32(u[5], rnding);
 1470|   552k|    u[5] = _mm256_srai_epi32(u[5], bit);
 1471|       |
 1472|   552k|    u[6] = _mm256_add_epi32(y, x);
 1473|   552k|    u[6] = _mm256_add_epi32(u[6], rnding);
 1474|   552k|    u[6] = _mm256_srai_epi32(u[6], bit);
 1475|       |
 1476|   552k|    u[7] = v[7];
 1477|   552k|    addsub_avx2(v[8], v[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 1478|   552k|    addsub_avx2(v[9], v[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 1479|   552k|    addsub_avx2(v[15], v[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 1480|   552k|    addsub_avx2(v[14], v[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 1481|       |
 1482|       |    // stage 6
 1483|   552k|    addsub_avx2(u[0], u[7], &v[0], &v[7], &clamp_lo, &clamp_hi);
 1484|   552k|    addsub_avx2(u[1], u[6], &v[1], &v[6], &clamp_lo, &clamp_hi);
 1485|   552k|    addsub_avx2(u[2], u[5], &v[2], &v[5], &clamp_lo, &clamp_hi);
 1486|   552k|    addsub_avx2(u[3], u[4], &v[3], &v[4], &clamp_lo, &clamp_hi);
 1487|   552k|    v[8] = u[8];
 1488|   552k|    v[9] = u[9];
 1489|       |
 1490|   552k|    x = _mm256_mullo_epi32(u[10], cospi32);
 1491|   552k|    y = _mm256_mullo_epi32(u[13], cospi32);
 1492|   552k|    v[10] = _mm256_sub_epi32(y, x);
 1493|   552k|    v[10] = _mm256_add_epi32(v[10], rnding);
 1494|   552k|    v[10] = _mm256_srai_epi32(v[10], bit);
 1495|       |
 1496|   552k|    v[13] = _mm256_add_epi32(x, y);
 1497|   552k|    v[13] = _mm256_add_epi32(v[13], rnding);
 1498|   552k|    v[13] = _mm256_srai_epi32(v[13], bit);
 1499|       |
 1500|   552k|    x = _mm256_mullo_epi32(u[11], cospi32);
 1501|   552k|    y = _mm256_mullo_epi32(u[12], cospi32);
 1502|   552k|    v[11] = _mm256_sub_epi32(y, x);
 1503|   552k|    v[11] = _mm256_add_epi32(v[11], rnding);
 1504|   552k|    v[11] = _mm256_srai_epi32(v[11], bit);
 1505|       |
 1506|   552k|    v[12] = _mm256_add_epi32(x, y);
 1507|   552k|    v[12] = _mm256_add_epi32(v[12], rnding);
 1508|   552k|    v[12] = _mm256_srai_epi32(v[12], bit);
 1509|       |
 1510|   552k|    v[14] = u[14];
 1511|   552k|    v[15] = u[15];
 1512|       |
 1513|       |    // stage 7
 1514|   552k|    addsub_avx2(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi);
 1515|   552k|    addsub_avx2(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi);
 1516|   552k|    addsub_avx2(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi);
 1517|   552k|    addsub_avx2(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi);
 1518|   552k|    addsub_avx2(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi);
 1519|   552k|    addsub_avx2(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi);
 1520|   552k|    addsub_avx2(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi);
 1521|   552k|    addsub_avx2(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi);
 1522|       |
 1523|   552k|    if (!do_cols) {
  ------------------
  |  Branch (1523:9): [True: 264k, False: 287k]
  ------------------
 1524|   264k|      const int log_range_out = get_log_range_out(bd);
 1525|   264k|      const __m256i clamp_lo_out =
 1526|   264k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 1527|   264k|      const __m256i clamp_hi_out =
 1528|   264k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 1529|   264k|      round_shift_8x8_avx2(out, out_shift);
 1530|   264k|      highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 16);
 1531|   264k|    }
 1532|   552k|  }
 1533|   552k|}
highbd_inv_txfm_avx2.c:iadst16_low1_avx2:
 1536|  4.85k|                              int bd, int out_shift) {
 1537|  4.85k|  const int32_t *cospi = cospi_arr(bit);
 1538|  4.85k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 1539|  4.85k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 1540|  4.85k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 1541|  4.85k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 1542|  4.85k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 1543|  4.85k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 1544|  4.85k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1545|  4.85k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1546|  4.85k|  const __m256i zero = _mm256_setzero_si256();
 1547|  4.85k|  __m256i v[16], x, y, temp1, temp2;
 1548|       |
 1549|       |  // Calculate the column 0, 1, 2, 3
 1550|  4.85k|  {
 1551|       |    // stage 0
 1552|       |    // stage 1
 1553|       |    // stage 2
 1554|  4.85k|    x = _mm256_mullo_epi32(in[0], cospi62);
 1555|  4.85k|    v[0] = _mm256_add_epi32(x, rnding);
 1556|  4.85k|    v[0] = _mm256_srai_epi32(v[0], bit);
 1557|       |
 1558|  4.85k|    x = _mm256_mullo_epi32(in[0], cospi2);
 1559|  4.85k|    v[1] = _mm256_sub_epi32(zero, x);
 1560|  4.85k|    v[1] = _mm256_add_epi32(v[1], rnding);
 1561|  4.85k|    v[1] = _mm256_srai_epi32(v[1], bit);
 1562|       |
 1563|       |    // stage 3
 1564|  4.85k|    v[8] = v[0];
 1565|  4.85k|    v[9] = v[1];
 1566|       |
 1567|       |    // stage 4
 1568|  4.85k|    temp1 = _mm256_mullo_epi32(v[8], cospi8);
 1569|  4.85k|    x = _mm256_mullo_epi32(v[9], cospi56);
 1570|  4.85k|    temp1 = _mm256_add_epi32(temp1, x);
 1571|  4.85k|    temp1 = _mm256_add_epi32(temp1, rnding);
 1572|  4.85k|    temp1 = _mm256_srai_epi32(temp1, bit);
 1573|       |
 1574|  4.85k|    temp2 = _mm256_mullo_epi32(v[8], cospi56);
 1575|  4.85k|    x = _mm256_mullo_epi32(v[9], cospi8);
 1576|  4.85k|    temp2 = _mm256_sub_epi32(temp2, x);
 1577|  4.85k|    temp2 = _mm256_add_epi32(temp2, rnding);
 1578|  4.85k|    temp2 = _mm256_srai_epi32(temp2, bit);
 1579|  4.85k|    v[8] = temp1;
 1580|  4.85k|    v[9] = temp2;
 1581|       |
 1582|       |    // stage 5
 1583|  4.85k|    v[4] = v[0];
 1584|  4.85k|    v[5] = v[1];
 1585|  4.85k|    v[12] = v[8];
 1586|  4.85k|    v[13] = v[9];
 1587|       |
 1588|       |    // stage 6
 1589|  4.85k|    temp1 = _mm256_mullo_epi32(v[4], cospi16);
 1590|  4.85k|    x = _mm256_mullo_epi32(v[5], cospi48);
 1591|  4.85k|    temp1 = _mm256_add_epi32(temp1, x);
 1592|  4.85k|    temp1 = _mm256_add_epi32(temp1, rnding);
 1593|  4.85k|    temp1 = _mm256_srai_epi32(temp1, bit);
 1594|       |
 1595|  4.85k|    temp2 = _mm256_mullo_epi32(v[4], cospi48);
 1596|  4.85k|    x = _mm256_mullo_epi32(v[5], cospi16);
 1597|  4.85k|    temp2 = _mm256_sub_epi32(temp2, x);
 1598|  4.85k|    temp2 = _mm256_add_epi32(temp2, rnding);
 1599|  4.85k|    temp2 = _mm256_srai_epi32(temp2, bit);
 1600|  4.85k|    v[4] = temp1;
 1601|  4.85k|    v[5] = temp2;
 1602|       |
 1603|  4.85k|    temp1 = _mm256_mullo_epi32(v[12], cospi16);
 1604|  4.85k|    x = _mm256_mullo_epi32(v[13], cospi48);
 1605|  4.85k|    temp1 = _mm256_add_epi32(temp1, x);
 1606|  4.85k|    temp1 = _mm256_add_epi32(temp1, rnding);
 1607|  4.85k|    temp1 = _mm256_srai_epi32(temp1, bit);
 1608|       |
 1609|  4.85k|    temp2 = _mm256_mullo_epi32(v[12], cospi48);
 1610|  4.85k|    x = _mm256_mullo_epi32(v[13], cospi16);
 1611|  4.85k|    temp2 = _mm256_sub_epi32(temp2, x);
 1612|  4.85k|    temp2 = _mm256_add_epi32(temp2, rnding);
 1613|  4.85k|    temp2 = _mm256_srai_epi32(temp2, bit);
 1614|  4.85k|    v[12] = temp1;
 1615|  4.85k|    v[13] = temp2;
 1616|       |
 1617|       |    // stage 7
 1618|  4.85k|    v[2] = v[0];
 1619|  4.85k|    v[3] = v[1];
 1620|  4.85k|    v[6] = v[4];
 1621|  4.85k|    v[7] = v[5];
 1622|  4.85k|    v[10] = v[8];
 1623|  4.85k|    v[11] = v[9];
 1624|  4.85k|    v[14] = v[12];
 1625|  4.85k|    v[15] = v[13];
 1626|       |
 1627|       |    // stage 8
 1628|  4.85k|    y = _mm256_mullo_epi32(v[2], cospi32);
 1629|  4.85k|    x = _mm256_mullo_epi32(v[3], cospi32);
 1630|  4.85k|    v[2] = _mm256_add_epi32(y, x);
 1631|  4.85k|    v[2] = _mm256_add_epi32(v[2], rnding);
 1632|  4.85k|    v[2] = _mm256_srai_epi32(v[2], bit);
 1633|       |
 1634|  4.85k|    v[3] = _mm256_sub_epi32(y, x);
 1635|  4.85k|    v[3] = _mm256_add_epi32(v[3], rnding);
 1636|  4.85k|    v[3] = _mm256_srai_epi32(v[3], bit);
 1637|       |
 1638|  4.85k|    y = _mm256_mullo_epi32(v[6], cospi32);
 1639|  4.85k|    x = _mm256_mullo_epi32(v[7], cospi32);
 1640|  4.85k|    v[6] = _mm256_add_epi32(y, x);
 1641|  4.85k|    v[6] = _mm256_add_epi32(v[6], rnding);
 1642|  4.85k|    v[6] = _mm256_srai_epi32(v[6], bit);
 1643|       |
 1644|  4.85k|    v[7] = _mm256_sub_epi32(y, x);
 1645|  4.85k|    v[7] = _mm256_add_epi32(v[7], rnding);
 1646|  4.85k|    v[7] = _mm256_srai_epi32(v[7], bit);
 1647|       |
 1648|  4.85k|    y = _mm256_mullo_epi32(v[10], cospi32);
 1649|  4.85k|    x = _mm256_mullo_epi32(v[11], cospi32);
 1650|  4.85k|    v[10] = _mm256_add_epi32(y, x);
 1651|  4.85k|    v[10] = _mm256_add_epi32(v[10], rnding);
 1652|  4.85k|    v[10] = _mm256_srai_epi32(v[10], bit);
 1653|       |
 1654|  4.85k|    v[11] = _mm256_sub_epi32(y, x);
 1655|  4.85k|    v[11] = _mm256_add_epi32(v[11], rnding);
 1656|  4.85k|    v[11] = _mm256_srai_epi32(v[11], bit);
 1657|       |
 1658|  4.85k|    y = _mm256_mullo_epi32(v[14], cospi32);
 1659|  4.85k|    x = _mm256_mullo_epi32(v[15], cospi32);
 1660|  4.85k|    v[14] = _mm256_add_epi32(y, x);
 1661|  4.85k|    v[14] = _mm256_add_epi32(v[14], rnding);
 1662|  4.85k|    v[14] = _mm256_srai_epi32(v[14], bit);
 1663|       |
 1664|  4.85k|    v[15] = _mm256_sub_epi32(y, x);
 1665|  4.85k|    v[15] = _mm256_add_epi32(v[15], rnding);
 1666|  4.85k|    v[15] = _mm256_srai_epi32(v[15], bit);
 1667|       |
 1668|       |    // stage 9
 1669|  4.85k|    if (do_cols) {
  ------------------
  |  Branch (1669:9): [True: 2.54k, False: 2.31k]
  ------------------
 1670|  2.54k|      out[0] = v[0];
 1671|  2.54k|      out[1] = _mm256_sub_epi32(_mm256_setzero_si256(), v[8]);
 1672|  2.54k|      out[2] = v[12];
 1673|  2.54k|      out[3] = _mm256_sub_epi32(_mm256_setzero_si256(), v[4]);
 1674|  2.54k|      out[4] = v[6];
 1675|  2.54k|      out[5] = _mm256_sub_epi32(_mm256_setzero_si256(), v[14]);
 1676|  2.54k|      out[6] = v[10];
 1677|  2.54k|      out[7] = _mm256_sub_epi32(_mm256_setzero_si256(), v[2]);
 1678|  2.54k|      out[8] = v[3];
 1679|  2.54k|      out[9] = _mm256_sub_epi32(_mm256_setzero_si256(), v[11]);
 1680|  2.54k|      out[10] = v[15];
 1681|  2.54k|      out[11] = _mm256_sub_epi32(_mm256_setzero_si256(), v[7]);
 1682|  2.54k|      out[12] = v[5];
 1683|  2.54k|      out[13] = _mm256_sub_epi32(_mm256_setzero_si256(), v[13]);
 1684|  2.54k|      out[14] = v[9];
 1685|  2.54k|      out[15] = _mm256_sub_epi32(_mm256_setzero_si256(), v[1]);
 1686|  2.54k|    } else {
 1687|  2.31k|      const int log_range_out = get_log_range_out(bd);
 1688|  2.31k|      const __m256i clamp_lo_out =
 1689|  2.31k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 1690|  2.31k|      const __m256i clamp_hi_out =
 1691|  2.31k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 1692|       |
 1693|  2.31k|      neg_shift_avx2(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 1694|  2.31k|                     out_shift);
 1695|  2.31k|      neg_shift_avx2(v[12], v[4], out + 2, out + 3, &clamp_lo_out,
 1696|  2.31k|                     &clamp_hi_out, out_shift);
 1697|  2.31k|      neg_shift_avx2(v[6], v[14], out + 4, out + 5, &clamp_lo_out,
 1698|  2.31k|                     &clamp_hi_out, out_shift);
 1699|  2.31k|      neg_shift_avx2(v[10], v[2], out + 6, out + 7, &clamp_lo_out,
 1700|  2.31k|                     &clamp_hi_out, out_shift);
 1701|  2.31k|      neg_shift_avx2(v[3], v[11], out + 8, out + 9, &clamp_lo_out,
 1702|  2.31k|                     &clamp_hi_out, out_shift);
 1703|  2.31k|      neg_shift_avx2(v[15], v[7], out + 10, out + 11, &clamp_lo_out,
 1704|  2.31k|                     &clamp_hi_out, out_shift);
 1705|  2.31k|      neg_shift_avx2(v[5], v[13], out + 12, out + 13, &clamp_lo_out,
 1706|  2.31k|                     &clamp_hi_out, out_shift);
 1707|  2.31k|      neg_shift_avx2(v[9], v[1], out + 14, out + 15, &clamp_lo_out,
 1708|  2.31k|                     &clamp_hi_out, out_shift);
 1709|  2.31k|    }
 1710|  4.85k|  }
 1711|  4.85k|}
highbd_inv_txfm_avx2.c:iadst16_low8_avx2:
 1714|  36.7k|                              int bd, int out_shift) {
 1715|  36.7k|  const int32_t *cospi = cospi_arr(bit);
 1716|  36.7k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 1717|  36.7k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 1718|  36.7k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
 1719|  36.7k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
 1720|  36.7k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
 1721|  36.7k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
 1722|  36.7k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
 1723|  36.7k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
 1724|  36.7k|  const __m256i cospi34 = _mm256_set1_epi32(cospi[34]);
 1725|  36.7k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
 1726|  36.7k|  const __m256i cospi42 = _mm256_set1_epi32(cospi[42]);
 1727|  36.7k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
 1728|  36.7k|  const __m256i cospi50 = _mm256_set1_epi32(cospi[50]);
 1729|  36.7k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
 1730|  36.7k|  const __m256i cospi58 = _mm256_set1_epi32(cospi[58]);
 1731|  36.7k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 1732|  36.7k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 1733|  36.7k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 1734|  36.7k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 1735|  36.7k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 1736|  36.7k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 1737|  36.7k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 1738|  36.7k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 1739|  36.7k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 1740|  36.7k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 1741|  36.7k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1742|  36.7k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1743|  36.7k|  const int log_range = get_log_range(bd, do_cols);
 1744|  36.7k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 1745|  36.7k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 1746|  36.7k|  __m256i u[16], x, y;
 1747|       |
 1748|  36.7k|  {
 1749|       |    // stage 0
 1750|       |    // stage 1
 1751|       |    // stage 2
 1752|  36.7k|    __m256i zero = _mm256_setzero_si256();
 1753|  36.7k|    x = _mm256_mullo_epi32(in[0], cospi62);
 1754|  36.7k|    u[0] = _mm256_add_epi32(x, rnding);
 1755|  36.7k|    u[0] = _mm256_srai_epi32(u[0], bit);
 1756|       |
 1757|  36.7k|    x = _mm256_mullo_epi32(in[0], cospi2);
 1758|  36.7k|    u[1] = _mm256_sub_epi32(zero, x);
 1759|  36.7k|    u[1] = _mm256_add_epi32(u[1], rnding);
 1760|  36.7k|    u[1] = _mm256_srai_epi32(u[1], bit);
 1761|       |
 1762|  36.7k|    x = _mm256_mullo_epi32(in[2], cospi54);
 1763|  36.7k|    u[2] = _mm256_add_epi32(x, rnding);
 1764|  36.7k|    u[2] = _mm256_srai_epi32(u[2], bit);
 1765|       |
 1766|  36.7k|    x = _mm256_mullo_epi32(in[2], cospi10);
 1767|  36.7k|    u[3] = _mm256_sub_epi32(zero, x);
 1768|  36.7k|    u[3] = _mm256_add_epi32(u[3], rnding);
 1769|  36.7k|    u[3] = _mm256_srai_epi32(u[3], bit);
 1770|       |
 1771|  36.7k|    x = _mm256_mullo_epi32(in[4], cospi46);
 1772|  36.7k|    u[4] = _mm256_add_epi32(x, rnding);
 1773|  36.7k|    u[4] = _mm256_srai_epi32(u[4], bit);
 1774|       |
 1775|  36.7k|    x = _mm256_mullo_epi32(in[4], cospi18);
 1776|  36.7k|    u[5] = _mm256_sub_epi32(zero, x);
 1777|  36.7k|    u[5] = _mm256_add_epi32(u[5], rnding);
 1778|  36.7k|    u[5] = _mm256_srai_epi32(u[5], bit);
 1779|       |
 1780|  36.7k|    x = _mm256_mullo_epi32(in[6], cospi38);
 1781|  36.7k|    u[6] = _mm256_add_epi32(x, rnding);
 1782|  36.7k|    u[6] = _mm256_srai_epi32(u[6], bit);
 1783|       |
 1784|  36.7k|    x = _mm256_mullo_epi32(in[6], cospi26);
 1785|  36.7k|    u[7] = _mm256_sub_epi32(zero, x);
 1786|  36.7k|    u[7] = _mm256_add_epi32(u[7], rnding);
 1787|  36.7k|    u[7] = _mm256_srai_epi32(u[7], bit);
 1788|       |
 1789|  36.7k|    u[8] = _mm256_mullo_epi32(in[7], cospi34);
 1790|  36.7k|    u[8] = _mm256_add_epi32(u[8], rnding);
 1791|  36.7k|    u[8] = _mm256_srai_epi32(u[8], bit);
 1792|       |
 1793|  36.7k|    u[9] = _mm256_mullo_epi32(in[7], cospi30);
 1794|  36.7k|    u[9] = _mm256_add_epi32(u[9], rnding);
 1795|  36.7k|    u[9] = _mm256_srai_epi32(u[9], bit);
 1796|       |
 1797|  36.7k|    u[10] = _mm256_mullo_epi32(in[5], cospi42);
 1798|  36.7k|    u[10] = _mm256_add_epi32(u[10], rnding);
 1799|  36.7k|    u[10] = _mm256_srai_epi32(u[10], bit);
 1800|       |
 1801|  36.7k|    u[11] = _mm256_mullo_epi32(in[5], cospi22);
 1802|  36.7k|    u[11] = _mm256_add_epi32(u[11], rnding);
 1803|  36.7k|    u[11] = _mm256_srai_epi32(u[11], bit);
 1804|       |
 1805|  36.7k|    u[12] = _mm256_mullo_epi32(in[3], cospi50);
 1806|  36.7k|    u[12] = _mm256_add_epi32(u[12], rnding);
 1807|  36.7k|    u[12] = _mm256_srai_epi32(u[12], bit);
 1808|       |
 1809|  36.7k|    u[13] = _mm256_mullo_epi32(in[3], cospi14);
 1810|  36.7k|    u[13] = _mm256_add_epi32(u[13], rnding);
 1811|  36.7k|    u[13] = _mm256_srai_epi32(u[13], bit);
 1812|       |
 1813|  36.7k|    u[14] = _mm256_mullo_epi32(in[1], cospi58);
 1814|  36.7k|    u[14] = _mm256_add_epi32(u[14], rnding);
 1815|  36.7k|    u[14] = _mm256_srai_epi32(u[14], bit);
 1816|       |
 1817|  36.7k|    u[15] = _mm256_mullo_epi32(in[1], cospi6);
 1818|  36.7k|    u[15] = _mm256_add_epi32(u[15], rnding);
 1819|  36.7k|    u[15] = _mm256_srai_epi32(u[15], bit);
 1820|       |
 1821|       |    // stage 3
 1822|  36.7k|    addsub_avx2(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi);
 1823|  36.7k|    addsub_avx2(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi);
 1824|  36.7k|    addsub_avx2(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi);
 1825|  36.7k|    addsub_avx2(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi);
 1826|  36.7k|    addsub_avx2(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi);
 1827|  36.7k|    addsub_avx2(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi);
 1828|  36.7k|    addsub_avx2(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi);
 1829|  36.7k|    addsub_avx2(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi);
 1830|       |
 1831|       |    // stage 4
 1832|  36.7k|    y = _mm256_mullo_epi32(u[8], cospi56);
 1833|  36.7k|    x = _mm256_mullo_epi32(u[9], cospi56);
 1834|  36.7k|    u[8] = _mm256_mullo_epi32(u[8], cospi8);
 1835|  36.7k|    u[8] = _mm256_add_epi32(u[8], x);
 1836|  36.7k|    u[8] = _mm256_add_epi32(u[8], rnding);
 1837|  36.7k|    u[8] = _mm256_srai_epi32(u[8], bit);
 1838|       |
 1839|  36.7k|    x = _mm256_mullo_epi32(u[9], cospi8);
 1840|  36.7k|    u[9] = _mm256_sub_epi32(y, x);
 1841|  36.7k|    u[9] = _mm256_add_epi32(u[9], rnding);
 1842|  36.7k|    u[9] = _mm256_srai_epi32(u[9], bit);
 1843|       |
 1844|  36.7k|    x = _mm256_mullo_epi32(u[11], cospi24);
 1845|  36.7k|    y = _mm256_mullo_epi32(u[10], cospi24);
 1846|  36.7k|    u[10] = _mm256_mullo_epi32(u[10], cospi40);
 1847|  36.7k|    u[10] = _mm256_add_epi32(u[10], x);
 1848|  36.7k|    u[10] = _mm256_add_epi32(u[10], rnding);
 1849|  36.7k|    u[10] = _mm256_srai_epi32(u[10], bit);
 1850|       |
 1851|  36.7k|    x = _mm256_mullo_epi32(u[11], cospi40);
 1852|  36.7k|    u[11] = _mm256_sub_epi32(y, x);
 1853|  36.7k|    u[11] = _mm256_add_epi32(u[11], rnding);
 1854|  36.7k|    u[11] = _mm256_srai_epi32(u[11], bit);
 1855|       |
 1856|  36.7k|    x = _mm256_mullo_epi32(u[13], cospi8);
 1857|  36.7k|    y = _mm256_mullo_epi32(u[12], cospi8);
 1858|  36.7k|    u[12] = _mm256_mullo_epi32(u[12], cospim56);
 1859|  36.7k|    u[12] = _mm256_add_epi32(u[12], x);
 1860|  36.7k|    u[12] = _mm256_add_epi32(u[12], rnding);
 1861|  36.7k|    u[12] = _mm256_srai_epi32(u[12], bit);
 1862|       |
 1863|  36.7k|    x = _mm256_mullo_epi32(u[13], cospim56);
 1864|  36.7k|    u[13] = _mm256_sub_epi32(y, x);
 1865|  36.7k|    u[13] = _mm256_add_epi32(u[13], rnding);
 1866|  36.7k|    u[13] = _mm256_srai_epi32(u[13], bit);
 1867|       |
 1868|  36.7k|    x = _mm256_mullo_epi32(u[15], cospi40);
 1869|  36.7k|    y = _mm256_mullo_epi32(u[14], cospi40);
 1870|  36.7k|    u[14] = _mm256_mullo_epi32(u[14], cospim24);
 1871|  36.7k|    u[14] = _mm256_add_epi32(u[14], x);
 1872|  36.7k|    u[14] = _mm256_add_epi32(u[14], rnding);
 1873|  36.7k|    u[14] = _mm256_srai_epi32(u[14], bit);
 1874|       |
 1875|  36.7k|    x = _mm256_mullo_epi32(u[15], cospim24);
 1876|  36.7k|    u[15] = _mm256_sub_epi32(y, x);
 1877|  36.7k|    u[15] = _mm256_add_epi32(u[15], rnding);
 1878|  36.7k|    u[15] = _mm256_srai_epi32(u[15], bit);
 1879|       |
 1880|       |    // stage 5
 1881|  36.7k|    addsub_avx2(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi);
 1882|  36.7k|    addsub_avx2(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi);
 1883|  36.7k|    addsub_avx2(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi);
 1884|  36.7k|    addsub_avx2(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi);
 1885|  36.7k|    addsub_avx2(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi);
 1886|  36.7k|    addsub_avx2(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi);
 1887|  36.7k|    addsub_avx2(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi);
 1888|  36.7k|    addsub_avx2(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi);
 1889|       |
 1890|       |    // stage 6
 1891|  36.7k|    x = _mm256_mullo_epi32(u[5], cospi48);
 1892|  36.7k|    y = _mm256_mullo_epi32(u[4], cospi48);
 1893|  36.7k|    u[4] = _mm256_mullo_epi32(u[4], cospi16);
 1894|  36.7k|    u[4] = _mm256_add_epi32(u[4], x);
 1895|  36.7k|    u[4] = _mm256_add_epi32(u[4], rnding);
 1896|  36.7k|    u[4] = _mm256_srai_epi32(u[4], bit);
 1897|       |
 1898|  36.7k|    x = _mm256_mullo_epi32(u[5], cospi16);
 1899|  36.7k|    u[5] = _mm256_sub_epi32(y, x);
 1900|  36.7k|    u[5] = _mm256_add_epi32(u[5], rnding);
 1901|  36.7k|    u[5] = _mm256_srai_epi32(u[5], bit);
 1902|       |
 1903|  36.7k|    x = _mm256_mullo_epi32(u[7], cospi16);
 1904|  36.7k|    y = _mm256_mullo_epi32(u[6], cospi16);
 1905|  36.7k|    u[6] = _mm256_mullo_epi32(u[6], cospim48);
 1906|  36.7k|    u[6] = _mm256_add_epi32(u[6], x);
 1907|  36.7k|    u[6] = _mm256_add_epi32(u[6], rnding);
 1908|  36.7k|    u[6] = _mm256_srai_epi32(u[6], bit);
 1909|       |
 1910|  36.7k|    x = _mm256_mullo_epi32(u[7], cospim48);
 1911|  36.7k|    u[7] = _mm256_sub_epi32(y, x);
 1912|  36.7k|    u[7] = _mm256_add_epi32(u[7], rnding);
 1913|  36.7k|    u[7] = _mm256_srai_epi32(u[7], bit);
 1914|       |
 1915|  36.7k|    x = _mm256_mullo_epi32(u[13], cospi48);
 1916|  36.7k|    y = _mm256_mullo_epi32(u[12], cospi48);
 1917|  36.7k|    u[12] = _mm256_mullo_epi32(u[12], cospi16);
 1918|  36.7k|    u[12] = _mm256_add_epi32(u[12], x);
 1919|  36.7k|    u[12] = _mm256_add_epi32(u[12], rnding);
 1920|  36.7k|    u[12] = _mm256_srai_epi32(u[12], bit);
 1921|       |
 1922|  36.7k|    x = _mm256_mullo_epi32(u[13], cospi16);
 1923|  36.7k|    u[13] = _mm256_sub_epi32(y, x);
 1924|  36.7k|    u[13] = _mm256_add_epi32(u[13], rnding);
 1925|  36.7k|    u[13] = _mm256_srai_epi32(u[13], bit);
 1926|       |
 1927|  36.7k|    x = _mm256_mullo_epi32(u[15], cospi16);
 1928|  36.7k|    y = _mm256_mullo_epi32(u[14], cospi16);
 1929|  36.7k|    u[14] = _mm256_mullo_epi32(u[14], cospim48);
 1930|  36.7k|    u[14] = _mm256_add_epi32(u[14], x);
 1931|  36.7k|    u[14] = _mm256_add_epi32(u[14], rnding);
 1932|  36.7k|    u[14] = _mm256_srai_epi32(u[14], bit);
 1933|       |
 1934|  36.7k|    x = _mm256_mullo_epi32(u[15], cospim48);
 1935|  36.7k|    u[15] = _mm256_sub_epi32(y, x);
 1936|  36.7k|    u[15] = _mm256_add_epi32(u[15], rnding);
 1937|  36.7k|    u[15] = _mm256_srai_epi32(u[15], bit);
 1938|       |
 1939|       |    // stage 7
 1940|  36.7k|    addsub_avx2(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi);
 1941|  36.7k|    addsub_avx2(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi);
 1942|  36.7k|    addsub_avx2(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi);
 1943|  36.7k|    addsub_avx2(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi);
 1944|  36.7k|    addsub_avx2(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi);
 1945|  36.7k|    addsub_avx2(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi);
 1946|  36.7k|    addsub_avx2(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi);
 1947|  36.7k|    addsub_avx2(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi);
 1948|       |
 1949|       |    // stage 8
 1950|  36.7k|    y = _mm256_mullo_epi32(u[2], cospi32);
 1951|  36.7k|    x = _mm256_mullo_epi32(u[3], cospi32);
 1952|  36.7k|    u[2] = _mm256_add_epi32(y, x);
 1953|  36.7k|    u[2] = _mm256_add_epi32(u[2], rnding);
 1954|  36.7k|    u[2] = _mm256_srai_epi32(u[2], bit);
 1955|       |
 1956|  36.7k|    u[3] = _mm256_sub_epi32(y, x);
 1957|  36.7k|    u[3] = _mm256_add_epi32(u[3], rnding);
 1958|  36.7k|    u[3] = _mm256_srai_epi32(u[3], bit);
 1959|  36.7k|    y = _mm256_mullo_epi32(u[6], cospi32);
 1960|  36.7k|    x = _mm256_mullo_epi32(u[7], cospi32);
 1961|  36.7k|    u[6] = _mm256_add_epi32(y, x);
 1962|  36.7k|    u[6] = _mm256_add_epi32(u[6], rnding);
 1963|  36.7k|    u[6] = _mm256_srai_epi32(u[6], bit);
 1964|       |
 1965|  36.7k|    u[7] = _mm256_sub_epi32(y, x);
 1966|  36.7k|    u[7] = _mm256_add_epi32(u[7], rnding);
 1967|  36.7k|    u[7] = _mm256_srai_epi32(u[7], bit);
 1968|       |
 1969|  36.7k|    y = _mm256_mullo_epi32(u[10], cospi32);
 1970|  36.7k|    x = _mm256_mullo_epi32(u[11], cospi32);
 1971|  36.7k|    u[10] = _mm256_add_epi32(y, x);
 1972|  36.7k|    u[10] = _mm256_add_epi32(u[10], rnding);
 1973|  36.7k|    u[10] = _mm256_srai_epi32(u[10], bit);
 1974|       |
 1975|  36.7k|    u[11] = _mm256_sub_epi32(y, x);
 1976|  36.7k|    u[11] = _mm256_add_epi32(u[11], rnding);
 1977|  36.7k|    u[11] = _mm256_srai_epi32(u[11], bit);
 1978|       |
 1979|  36.7k|    y = _mm256_mullo_epi32(u[14], cospi32);
 1980|  36.7k|    x = _mm256_mullo_epi32(u[15], cospi32);
 1981|  36.7k|    u[14] = _mm256_add_epi32(y, x);
 1982|  36.7k|    u[14] = _mm256_add_epi32(u[14], rnding);
 1983|  36.7k|    u[14] = _mm256_srai_epi32(u[14], bit);
 1984|       |
 1985|  36.7k|    u[15] = _mm256_sub_epi32(y, x);
 1986|  36.7k|    u[15] = _mm256_add_epi32(u[15], rnding);
 1987|  36.7k|    u[15] = _mm256_srai_epi32(u[15], bit);
 1988|       |
 1989|       |    // stage 9
 1990|  36.7k|    if (do_cols) {
  ------------------
  |  Branch (1990:9): [True: 22.4k, False: 14.2k]
  ------------------
 1991|  22.4k|      out[0] = u[0];
 1992|  22.4k|      out[1] = _mm256_sub_epi32(_mm256_setzero_si256(), u[8]);
 1993|  22.4k|      out[2] = u[12];
 1994|  22.4k|      out[3] = _mm256_sub_epi32(_mm256_setzero_si256(), u[4]);
 1995|  22.4k|      out[4] = u[6];
 1996|  22.4k|      out[5] = _mm256_sub_epi32(_mm256_setzero_si256(), u[14]);
 1997|  22.4k|      out[6] = u[10];
 1998|  22.4k|      out[7] = _mm256_sub_epi32(_mm256_setzero_si256(), u[2]);
 1999|  22.4k|      out[8] = u[3];
 2000|  22.4k|      out[9] = _mm256_sub_epi32(_mm256_setzero_si256(), u[11]);
 2001|  22.4k|      out[10] = u[15];
 2002|  22.4k|      out[11] = _mm256_sub_epi32(_mm256_setzero_si256(), u[7]);
 2003|  22.4k|      out[12] = u[5];
 2004|  22.4k|      out[13] = _mm256_sub_epi32(_mm256_setzero_si256(), u[13]);
 2005|  22.4k|      out[14] = u[9];
 2006|  22.4k|      out[15] = _mm256_sub_epi32(_mm256_setzero_si256(), u[1]);
 2007|  22.4k|    } else {
 2008|  14.2k|      const int log_range_out = get_log_range_out(bd);
 2009|  14.2k|      const __m256i clamp_lo_out =
 2010|  14.2k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2011|  14.2k|      const __m256i clamp_hi_out =
 2012|  14.2k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2013|       |
 2014|  14.2k|      neg_shift_avx2(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2015|  14.2k|                     out_shift);
 2016|  14.2k|      neg_shift_avx2(u[12], u[4], out + 2, out + 3, &clamp_lo_out,
 2017|  14.2k|                     &clamp_hi_out, out_shift);
 2018|  14.2k|      neg_shift_avx2(u[6], u[14], out + 4, out + 5, &clamp_lo_out,
 2019|  14.2k|                     &clamp_hi_out, out_shift);
 2020|  14.2k|      neg_shift_avx2(u[10], u[2], out + 6, out + 7, &clamp_lo_out,
 2021|  14.2k|                     &clamp_hi_out, out_shift);
 2022|  14.2k|      neg_shift_avx2(u[3], u[11], out + 8, out + 9, &clamp_lo_out,
 2023|  14.2k|                     &clamp_hi_out, out_shift);
 2024|  14.2k|      neg_shift_avx2(u[15], u[7], out + 10, out + 11, &clamp_lo_out,
 2025|  14.2k|                     &clamp_hi_out, out_shift);
 2026|  14.2k|      neg_shift_avx2(u[5], u[13], out + 12, out + 13, &clamp_lo_out,
 2027|  14.2k|                     &clamp_hi_out, out_shift);
 2028|  14.2k|      neg_shift_avx2(u[9], u[1], out + 14, out + 15, &clamp_lo_out,
 2029|  14.2k|                     &clamp_hi_out, out_shift);
 2030|  14.2k|    }
 2031|  36.7k|  }
 2032|  36.7k|}
highbd_inv_txfm_avx2.c:iadst16_avx2:
 2035|   141k|                         int bd, int out_shift) {
 2036|   141k|  const int32_t *cospi = cospi_arr(bit);
 2037|   141k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 2038|   141k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 2039|   141k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
 2040|   141k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
 2041|   141k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
 2042|   141k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
 2043|   141k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
 2044|   141k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
 2045|   141k|  const __m256i cospi34 = _mm256_set1_epi32(cospi[34]);
 2046|   141k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
 2047|   141k|  const __m256i cospi42 = _mm256_set1_epi32(cospi[42]);
 2048|   141k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
 2049|   141k|  const __m256i cospi50 = _mm256_set1_epi32(cospi[50]);
 2050|   141k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
 2051|   141k|  const __m256i cospi58 = _mm256_set1_epi32(cospi[58]);
 2052|   141k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 2053|   141k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 2054|   141k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 2055|   141k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 2056|   141k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 2057|   141k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 2058|   141k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 2059|   141k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 2060|   141k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 2061|   141k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 2062|   141k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2063|   141k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2064|   141k|  const int log_range = get_log_range(bd, do_cols);
 2065|   141k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 2066|   141k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 2067|   141k|  __m256i u[16], v[16], x, y;
 2068|       |
 2069|   141k|  {
 2070|       |    // stage 0
 2071|       |    // stage 1
 2072|       |    // stage 2
 2073|   141k|    v[0] = _mm256_mullo_epi32(in[15], cospi2);
 2074|   141k|    x = _mm256_mullo_epi32(in[0], cospi62);
 2075|   141k|    v[0] = _mm256_add_epi32(v[0], x);
 2076|   141k|    v[0] = _mm256_add_epi32(v[0], rnding);
 2077|   141k|    v[0] = _mm256_srai_epi32(v[0], bit);
 2078|       |
 2079|   141k|    v[1] = _mm256_mullo_epi32(in[15], cospi62);
 2080|   141k|    x = _mm256_mullo_epi32(in[0], cospi2);
 2081|   141k|    v[1] = _mm256_sub_epi32(v[1], x);
 2082|   141k|    v[1] = _mm256_add_epi32(v[1], rnding);
 2083|   141k|    v[1] = _mm256_srai_epi32(v[1], bit);
 2084|       |
 2085|   141k|    v[2] = _mm256_mullo_epi32(in[13], cospi10);
 2086|   141k|    x = _mm256_mullo_epi32(in[2], cospi54);
 2087|   141k|    v[2] = _mm256_add_epi32(v[2], x);
 2088|   141k|    v[2] = _mm256_add_epi32(v[2], rnding);
 2089|   141k|    v[2] = _mm256_srai_epi32(v[2], bit);
 2090|       |
 2091|   141k|    v[3] = _mm256_mullo_epi32(in[13], cospi54);
 2092|   141k|    x = _mm256_mullo_epi32(in[2], cospi10);
 2093|   141k|    v[3] = _mm256_sub_epi32(v[3], x);
 2094|   141k|    v[3] = _mm256_add_epi32(v[3], rnding);
 2095|   141k|    v[3] = _mm256_srai_epi32(v[3], bit);
 2096|       |
 2097|   141k|    v[4] = _mm256_mullo_epi32(in[11], cospi18);
 2098|   141k|    x = _mm256_mullo_epi32(in[4], cospi46);
 2099|   141k|    v[4] = _mm256_add_epi32(v[4], x);
 2100|   141k|    v[4] = _mm256_add_epi32(v[4], rnding);
 2101|   141k|    v[4] = _mm256_srai_epi32(v[4], bit);
 2102|       |
 2103|   141k|    v[5] = _mm256_mullo_epi32(in[11], cospi46);
 2104|   141k|    x = _mm256_mullo_epi32(in[4], cospi18);
 2105|   141k|    v[5] = _mm256_sub_epi32(v[5], x);
 2106|   141k|    v[5] = _mm256_add_epi32(v[5], rnding);
 2107|   141k|    v[5] = _mm256_srai_epi32(v[5], bit);
 2108|       |
 2109|   141k|    v[6] = _mm256_mullo_epi32(in[9], cospi26);
 2110|   141k|    x = _mm256_mullo_epi32(in[6], cospi38);
 2111|   141k|    v[6] = _mm256_add_epi32(v[6], x);
 2112|   141k|    v[6] = _mm256_add_epi32(v[6], rnding);
 2113|   141k|    v[6] = _mm256_srai_epi32(v[6], bit);
 2114|       |
 2115|   141k|    v[7] = _mm256_mullo_epi32(in[9], cospi38);
 2116|   141k|    x = _mm256_mullo_epi32(in[6], cospi26);
 2117|   141k|    v[7] = _mm256_sub_epi32(v[7], x);
 2118|   141k|    v[7] = _mm256_add_epi32(v[7], rnding);
 2119|   141k|    v[7] = _mm256_srai_epi32(v[7], bit);
 2120|       |
 2121|   141k|    v[8] = _mm256_mullo_epi32(in[7], cospi34);
 2122|   141k|    x = _mm256_mullo_epi32(in[8], cospi30);
 2123|   141k|    v[8] = _mm256_add_epi32(v[8], x);
 2124|   141k|    v[8] = _mm256_add_epi32(v[8], rnding);
 2125|   141k|    v[8] = _mm256_srai_epi32(v[8], bit);
 2126|       |
 2127|   141k|    v[9] = _mm256_mullo_epi32(in[7], cospi30);
 2128|   141k|    x = _mm256_mullo_epi32(in[8], cospi34);
 2129|   141k|    v[9] = _mm256_sub_epi32(v[9], x);
 2130|   141k|    v[9] = _mm256_add_epi32(v[9], rnding);
 2131|   141k|    v[9] = _mm256_srai_epi32(v[9], bit);
 2132|       |
 2133|   141k|    v[10] = _mm256_mullo_epi32(in[5], cospi42);
 2134|   141k|    x = _mm256_mullo_epi32(in[10], cospi22);
 2135|   141k|    v[10] = _mm256_add_epi32(v[10], x);
 2136|   141k|    v[10] = _mm256_add_epi32(v[10], rnding);
 2137|   141k|    v[10] = _mm256_srai_epi32(v[10], bit);
 2138|       |
 2139|   141k|    v[11] = _mm256_mullo_epi32(in[5], cospi22);
 2140|   141k|    x = _mm256_mullo_epi32(in[10], cospi42);
 2141|   141k|    v[11] = _mm256_sub_epi32(v[11], x);
 2142|   141k|    v[11] = _mm256_add_epi32(v[11], rnding);
 2143|   141k|    v[11] = _mm256_srai_epi32(v[11], bit);
 2144|       |
 2145|   141k|    v[12] = _mm256_mullo_epi32(in[3], cospi50);
 2146|   141k|    x = _mm256_mullo_epi32(in[12], cospi14);
 2147|   141k|    v[12] = _mm256_add_epi32(v[12], x);
 2148|   141k|    v[12] = _mm256_add_epi32(v[12], rnding);
 2149|   141k|    v[12] = _mm256_srai_epi32(v[12], bit);
 2150|       |
 2151|   141k|    v[13] = _mm256_mullo_epi32(in[3], cospi14);
 2152|   141k|    x = _mm256_mullo_epi32(in[12], cospi50);
 2153|   141k|    v[13] = _mm256_sub_epi32(v[13], x);
 2154|   141k|    v[13] = _mm256_add_epi32(v[13], rnding);
 2155|   141k|    v[13] = _mm256_srai_epi32(v[13], bit);
 2156|       |
 2157|   141k|    v[14] = _mm256_mullo_epi32(in[1], cospi58);
 2158|   141k|    x = _mm256_mullo_epi32(in[14], cospi6);
 2159|   141k|    v[14] = _mm256_add_epi32(v[14], x);
 2160|   141k|    v[14] = _mm256_add_epi32(v[14], rnding);
 2161|   141k|    v[14] = _mm256_srai_epi32(v[14], bit);
 2162|       |
 2163|   141k|    v[15] = _mm256_mullo_epi32(in[1], cospi6);
 2164|   141k|    x = _mm256_mullo_epi32(in[14], cospi58);
 2165|   141k|    v[15] = _mm256_sub_epi32(v[15], x);
 2166|   141k|    v[15] = _mm256_add_epi32(v[15], rnding);
 2167|   141k|    v[15] = _mm256_srai_epi32(v[15], bit);
 2168|       |
 2169|       |    // stage 3
 2170|   141k|    addsub_avx2(v[0], v[8], &u[0], &u[8], &clamp_lo, &clamp_hi);
 2171|   141k|    addsub_avx2(v[1], v[9], &u[1], &u[9], &clamp_lo, &clamp_hi);
 2172|   141k|    addsub_avx2(v[2], v[10], &u[2], &u[10], &clamp_lo, &clamp_hi);
 2173|   141k|    addsub_avx2(v[3], v[11], &u[3], &u[11], &clamp_lo, &clamp_hi);
 2174|   141k|    addsub_avx2(v[4], v[12], &u[4], &u[12], &clamp_lo, &clamp_hi);
 2175|   141k|    addsub_avx2(v[5], v[13], &u[5], &u[13], &clamp_lo, &clamp_hi);
 2176|   141k|    addsub_avx2(v[6], v[14], &u[6], &u[14], &clamp_lo, &clamp_hi);
 2177|   141k|    addsub_avx2(v[7], v[15], &u[7], &u[15], &clamp_lo, &clamp_hi);
 2178|       |
 2179|       |    // stage 4
 2180|   141k|    v[0] = u[0];
 2181|   141k|    v[1] = u[1];
 2182|   141k|    v[2] = u[2];
 2183|   141k|    v[3] = u[3];
 2184|   141k|    v[4] = u[4];
 2185|   141k|    v[5] = u[5];
 2186|   141k|    v[6] = u[6];
 2187|   141k|    v[7] = u[7];
 2188|       |
 2189|   141k|    v[8] = _mm256_mullo_epi32(u[8], cospi8);
 2190|   141k|    x = _mm256_mullo_epi32(u[9], cospi56);
 2191|   141k|    v[8] = _mm256_add_epi32(v[8], x);
 2192|   141k|    v[8] = _mm256_add_epi32(v[8], rnding);
 2193|   141k|    v[8] = _mm256_srai_epi32(v[8], bit);
 2194|       |
 2195|   141k|    v[9] = _mm256_mullo_epi32(u[8], cospi56);
 2196|   141k|    x = _mm256_mullo_epi32(u[9], cospi8);
 2197|   141k|    v[9] = _mm256_sub_epi32(v[9], x);
 2198|   141k|    v[9] = _mm256_add_epi32(v[9], rnding);
 2199|   141k|    v[9] = _mm256_srai_epi32(v[9], bit);
 2200|       |
 2201|   141k|    v[10] = _mm256_mullo_epi32(u[10], cospi40);
 2202|   141k|    x = _mm256_mullo_epi32(u[11], cospi24);
 2203|   141k|    v[10] = _mm256_add_epi32(v[10], x);
 2204|   141k|    v[10] = _mm256_add_epi32(v[10], rnding);
 2205|   141k|    v[10] = _mm256_srai_epi32(v[10], bit);
 2206|       |
 2207|   141k|    v[11] = _mm256_mullo_epi32(u[10], cospi24);
 2208|   141k|    x = _mm256_mullo_epi32(u[11], cospi40);
 2209|   141k|    v[11] = _mm256_sub_epi32(v[11], x);
 2210|   141k|    v[11] = _mm256_add_epi32(v[11], rnding);
 2211|   141k|    v[11] = _mm256_srai_epi32(v[11], bit);
 2212|       |
 2213|   141k|    v[12] = _mm256_mullo_epi32(u[12], cospim56);
 2214|   141k|    x = _mm256_mullo_epi32(u[13], cospi8);
 2215|   141k|    v[12] = _mm256_add_epi32(v[12], x);
 2216|   141k|    v[12] = _mm256_add_epi32(v[12], rnding);
 2217|   141k|    v[12] = _mm256_srai_epi32(v[12], bit);
 2218|       |
 2219|   141k|    v[13] = _mm256_mullo_epi32(u[12], cospi8);
 2220|   141k|    x = _mm256_mullo_epi32(u[13], cospim56);
 2221|   141k|    v[13] = _mm256_sub_epi32(v[13], x);
 2222|   141k|    v[13] = _mm256_add_epi32(v[13], rnding);
 2223|   141k|    v[13] = _mm256_srai_epi32(v[13], bit);
 2224|       |
 2225|   141k|    v[14] = _mm256_mullo_epi32(u[14], cospim24);
 2226|   141k|    x = _mm256_mullo_epi32(u[15], cospi40);
 2227|   141k|    v[14] = _mm256_add_epi32(v[14], x);
 2228|   141k|    v[14] = _mm256_add_epi32(v[14], rnding);
 2229|   141k|    v[14] = _mm256_srai_epi32(v[14], bit);
 2230|       |
 2231|   141k|    v[15] = _mm256_mullo_epi32(u[14], cospi40);
 2232|   141k|    x = _mm256_mullo_epi32(u[15], cospim24);
 2233|   141k|    v[15] = _mm256_sub_epi32(v[15], x);
 2234|   141k|    v[15] = _mm256_add_epi32(v[15], rnding);
 2235|   141k|    v[15] = _mm256_srai_epi32(v[15], bit);
 2236|       |
 2237|       |    // stage 5
 2238|   141k|    addsub_avx2(v[0], v[4], &u[0], &u[4], &clamp_lo, &clamp_hi);
 2239|   141k|    addsub_avx2(v[1], v[5], &u[1], &u[5], &clamp_lo, &clamp_hi);
 2240|   141k|    addsub_avx2(v[2], v[6], &u[2], &u[6], &clamp_lo, &clamp_hi);
 2241|   141k|    addsub_avx2(v[3], v[7], &u[3], &u[7], &clamp_lo, &clamp_hi);
 2242|   141k|    addsub_avx2(v[8], v[12], &u[8], &u[12], &clamp_lo, &clamp_hi);
 2243|   141k|    addsub_avx2(v[9], v[13], &u[9], &u[13], &clamp_lo, &clamp_hi);
 2244|   141k|    addsub_avx2(v[10], v[14], &u[10], &u[14], &clamp_lo, &clamp_hi);
 2245|   141k|    addsub_avx2(v[11], v[15], &u[11], &u[15], &clamp_lo, &clamp_hi);
 2246|       |
 2247|       |    // stage 6
 2248|   141k|    v[0] = u[0];
 2249|   141k|    v[1] = u[1];
 2250|   141k|    v[2] = u[2];
 2251|   141k|    v[3] = u[3];
 2252|       |
 2253|   141k|    v[4] = _mm256_mullo_epi32(u[4], cospi16);
 2254|   141k|    x = _mm256_mullo_epi32(u[5], cospi48);
 2255|   141k|    v[4] = _mm256_add_epi32(v[4], x);
 2256|   141k|    v[4] = _mm256_add_epi32(v[4], rnding);
 2257|   141k|    v[4] = _mm256_srai_epi32(v[4], bit);
 2258|       |
 2259|   141k|    v[5] = _mm256_mullo_epi32(u[4], cospi48);
 2260|   141k|    x = _mm256_mullo_epi32(u[5], cospi16);
 2261|   141k|    v[5] = _mm256_sub_epi32(v[5], x);
 2262|   141k|    v[5] = _mm256_add_epi32(v[5], rnding);
 2263|   141k|    v[5] = _mm256_srai_epi32(v[5], bit);
 2264|       |
 2265|   141k|    v[6] = _mm256_mullo_epi32(u[6], cospim48);
 2266|   141k|    x = _mm256_mullo_epi32(u[7], cospi16);
 2267|   141k|    v[6] = _mm256_add_epi32(v[6], x);
 2268|   141k|    v[6] = _mm256_add_epi32(v[6], rnding);
 2269|   141k|    v[6] = _mm256_srai_epi32(v[6], bit);
 2270|       |
 2271|   141k|    v[7] = _mm256_mullo_epi32(u[6], cospi16);
 2272|   141k|    x = _mm256_mullo_epi32(u[7], cospim48);
 2273|   141k|    v[7] = _mm256_sub_epi32(v[7], x);
 2274|   141k|    v[7] = _mm256_add_epi32(v[7], rnding);
 2275|   141k|    v[7] = _mm256_srai_epi32(v[7], bit);
 2276|       |
 2277|   141k|    v[8] = u[8];
 2278|   141k|    v[9] = u[9];
 2279|   141k|    v[10] = u[10];
 2280|   141k|    v[11] = u[11];
 2281|       |
 2282|   141k|    v[12] = _mm256_mullo_epi32(u[12], cospi16);
 2283|   141k|    x = _mm256_mullo_epi32(u[13], cospi48);
 2284|   141k|    v[12] = _mm256_add_epi32(v[12], x);
 2285|   141k|    v[12] = _mm256_add_epi32(v[12], rnding);
 2286|   141k|    v[12] = _mm256_srai_epi32(v[12], bit);
 2287|       |
 2288|   141k|    v[13] = _mm256_mullo_epi32(u[12], cospi48);
 2289|   141k|    x = _mm256_mullo_epi32(u[13], cospi16);
 2290|   141k|    v[13] = _mm256_sub_epi32(v[13], x);
 2291|   141k|    v[13] = _mm256_add_epi32(v[13], rnding);
 2292|   141k|    v[13] = _mm256_srai_epi32(v[13], bit);
 2293|       |
 2294|   141k|    v[14] = _mm256_mullo_epi32(u[14], cospim48);
 2295|   141k|    x = _mm256_mullo_epi32(u[15], cospi16);
 2296|   141k|    v[14] = _mm256_add_epi32(v[14], x);
 2297|   141k|    v[14] = _mm256_add_epi32(v[14], rnding);
 2298|   141k|    v[14] = _mm256_srai_epi32(v[14], bit);
 2299|       |
 2300|   141k|    v[15] = _mm256_mullo_epi32(u[14], cospi16);
 2301|   141k|    x = _mm256_mullo_epi32(u[15], cospim48);
 2302|   141k|    v[15] = _mm256_sub_epi32(v[15], x);
 2303|   141k|    v[15] = _mm256_add_epi32(v[15], rnding);
 2304|   141k|    v[15] = _mm256_srai_epi32(v[15], bit);
 2305|       |
 2306|       |    // stage 7
 2307|   141k|    addsub_avx2(v[0], v[2], &u[0], &u[2], &clamp_lo, &clamp_hi);
 2308|   141k|    addsub_avx2(v[1], v[3], &u[1], &u[3], &clamp_lo, &clamp_hi);
 2309|   141k|    addsub_avx2(v[4], v[6], &u[4], &u[6], &clamp_lo, &clamp_hi);
 2310|   141k|    addsub_avx2(v[5], v[7], &u[5], &u[7], &clamp_lo, &clamp_hi);
 2311|   141k|    addsub_avx2(v[8], v[10], &u[8], &u[10], &clamp_lo, &clamp_hi);
 2312|   141k|    addsub_avx2(v[9], v[11], &u[9], &u[11], &clamp_lo, &clamp_hi);
 2313|   141k|    addsub_avx2(v[12], v[14], &u[12], &u[14], &clamp_lo, &clamp_hi);
 2314|   141k|    addsub_avx2(v[13], v[15], &u[13], &u[15], &clamp_lo, &clamp_hi);
 2315|       |
 2316|       |    // stage 8
 2317|   141k|    v[0] = u[0];
 2318|   141k|    v[1] = u[1];
 2319|       |
 2320|   141k|    y = _mm256_mullo_epi32(u[2], cospi32);
 2321|   141k|    x = _mm256_mullo_epi32(u[3], cospi32);
 2322|   141k|    v[2] = _mm256_add_epi32(y, x);
 2323|   141k|    v[2] = _mm256_add_epi32(v[2], rnding);
 2324|   141k|    v[2] = _mm256_srai_epi32(v[2], bit);
 2325|       |
 2326|   141k|    v[3] = _mm256_sub_epi32(y, x);
 2327|   141k|    v[3] = _mm256_add_epi32(v[3], rnding);
 2328|   141k|    v[3] = _mm256_srai_epi32(v[3], bit);
 2329|       |
 2330|   141k|    v[4] = u[4];
 2331|   141k|    v[5] = u[5];
 2332|       |
 2333|   141k|    y = _mm256_mullo_epi32(u[6], cospi32);
 2334|   141k|    x = _mm256_mullo_epi32(u[7], cospi32);
 2335|   141k|    v[6] = _mm256_add_epi32(y, x);
 2336|   141k|    v[6] = _mm256_add_epi32(v[6], rnding);
 2337|   141k|    v[6] = _mm256_srai_epi32(v[6], bit);
 2338|       |
 2339|   141k|    v[7] = _mm256_sub_epi32(y, x);
 2340|   141k|    v[7] = _mm256_add_epi32(v[7], rnding);
 2341|   141k|    v[7] = _mm256_srai_epi32(v[7], bit);
 2342|       |
 2343|   141k|    v[8] = u[8];
 2344|   141k|    v[9] = u[9];
 2345|       |
 2346|   141k|    y = _mm256_mullo_epi32(u[10], cospi32);
 2347|   141k|    x = _mm256_mullo_epi32(u[11], cospi32);
 2348|   141k|    v[10] = _mm256_add_epi32(y, x);
 2349|   141k|    v[10] = _mm256_add_epi32(v[10], rnding);
 2350|   141k|    v[10] = _mm256_srai_epi32(v[10], bit);
 2351|       |
 2352|   141k|    v[11] = _mm256_sub_epi32(y, x);
 2353|   141k|    v[11] = _mm256_add_epi32(v[11], rnding);
 2354|   141k|    v[11] = _mm256_srai_epi32(v[11], bit);
 2355|       |
 2356|   141k|    v[12] = u[12];
 2357|   141k|    v[13] = u[13];
 2358|       |
 2359|   141k|    y = _mm256_mullo_epi32(u[14], cospi32);
 2360|   141k|    x = _mm256_mullo_epi32(u[15], cospi32);
 2361|   141k|    v[14] = _mm256_add_epi32(y, x);
 2362|   141k|    v[14] = _mm256_add_epi32(v[14], rnding);
 2363|   141k|    v[14] = _mm256_srai_epi32(v[14], bit);
 2364|       |
 2365|   141k|    v[15] = _mm256_sub_epi32(y, x);
 2366|   141k|    v[15] = _mm256_add_epi32(v[15], rnding);
 2367|   141k|    v[15] = _mm256_srai_epi32(v[15], bit);
 2368|       |
 2369|       |    // stage 9
 2370|   141k|    if (do_cols) {
  ------------------
  |  Branch (2370:9): [True: 69.7k, False: 71.3k]
  ------------------
 2371|  69.7k|      out[0] = v[0];
 2372|  69.7k|      out[1] = _mm256_sub_epi32(_mm256_setzero_si256(), v[8]);
 2373|  69.7k|      out[2] = v[12];
 2374|  69.7k|      out[3] = _mm256_sub_epi32(_mm256_setzero_si256(), v[4]);
 2375|  69.7k|      out[4] = v[6];
 2376|  69.7k|      out[5] = _mm256_sub_epi32(_mm256_setzero_si256(), v[14]);
 2377|  69.7k|      out[6] = v[10];
 2378|  69.7k|      out[7] = _mm256_sub_epi32(_mm256_setzero_si256(), v[2]);
 2379|  69.7k|      out[8] = v[3];
 2380|  69.7k|      out[9] = _mm256_sub_epi32(_mm256_setzero_si256(), v[11]);
 2381|  69.7k|      out[10] = v[15];
 2382|  69.7k|      out[11] = _mm256_sub_epi32(_mm256_setzero_si256(), v[7]);
 2383|  69.7k|      out[12] = v[5];
 2384|  69.7k|      out[13] = _mm256_sub_epi32(_mm256_setzero_si256(), v[13]);
 2385|  69.7k|      out[14] = v[9];
 2386|  69.7k|      out[15] = _mm256_sub_epi32(_mm256_setzero_si256(), v[1]);
 2387|  71.3k|    } else {
 2388|  71.3k|      const int log_range_out = get_log_range_out(bd);
 2389|  71.3k|      const __m256i clamp_lo_out =
 2390|  71.3k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2391|  71.3k|      const __m256i clamp_hi_out =
 2392|  71.3k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2393|       |
 2394|  71.3k|      neg_shift_avx2(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2395|  71.3k|                     out_shift);
 2396|  71.3k|      neg_shift_avx2(v[12], v[4], out + 2, out + 3, &clamp_lo_out,
 2397|  71.3k|                     &clamp_hi_out, out_shift);
 2398|  71.3k|      neg_shift_avx2(v[6], v[14], out + 4, out + 5, &clamp_lo_out,
 2399|  71.3k|                     &clamp_hi_out, out_shift);
 2400|  71.3k|      neg_shift_avx2(v[10], v[2], out + 6, out + 7, &clamp_lo_out,
 2401|  71.3k|                     &clamp_hi_out, out_shift);
 2402|  71.3k|      neg_shift_avx2(v[3], v[11], out + 8, out + 9, &clamp_lo_out,
 2403|  71.3k|                     &clamp_hi_out, out_shift);
 2404|  71.3k|      neg_shift_avx2(v[15], v[7], out + 10, out + 11, &clamp_lo_out,
 2405|  71.3k|                     &clamp_hi_out, out_shift);
 2406|  71.3k|      neg_shift_avx2(v[5], v[13], out + 12, out + 13, &clamp_lo_out,
 2407|  71.3k|                     &clamp_hi_out, out_shift);
 2408|  71.3k|      neg_shift_avx2(v[9], v[1], out + 14, out + 15, &clamp_lo_out,
 2409|  71.3k|                     &clamp_hi_out, out_shift);
 2410|  71.3k|    }
 2411|   141k|  }
 2412|   141k|}
highbd_inv_txfm_avx2.c:idct32_low1_avx2:
  443|  9.38k|                             int bd, int out_shift) {
  444|  9.38k|  const int32_t *cospi = cospi_arr(bit);
  445|  9.38k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  446|  9.38k|  const __m256i rounding = _mm256_set1_epi32(1 << (bit - 1));
  447|  9.38k|  const int log_range = get_log_range(bd, do_cols);
  448|  9.38k|  __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
  449|  9.38k|  __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
  450|  9.38k|  __m256i x;
  451|       |  // stage 0
  452|       |  // stage 1
  453|       |  // stage 2
  454|       |  // stage 3
  455|       |  // stage 4
  456|       |  // stage 5
  457|  9.38k|  x = _mm256_mullo_epi32(in[0], cospi32);
  458|  9.38k|  x = _mm256_add_epi32(x, rounding);
  459|  9.38k|  x = _mm256_srai_epi32(x, bit);
  460|       |
  461|       |  // stage 6
  462|       |  // stage 7
  463|       |  // stage 8
  464|       |  // stage 9
  465|  9.38k|  if (!do_cols) {
  ------------------
  |  Branch (465:7): [True: 2.42k, False: 6.96k]
  ------------------
  466|  2.42k|    const int log_range_out = get_log_range_out(bd);
  467|  2.42k|    __m256i offset = _mm256_set1_epi32((1 << out_shift) >> 1);
  468|  2.42k|    clamp_lo = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
  469|  2.42k|    clamp_hi = _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
  470|  2.42k|    x = _mm256_add_epi32(offset, x);
  471|  2.42k|    x = _mm256_sra_epi32(x, _mm_cvtsi32_si128(out_shift));
  472|  2.42k|  }
  473|  9.38k|  x = _mm256_max_epi32(x, clamp_lo);
  474|  9.38k|  x = _mm256_min_epi32(x, clamp_hi);
  475|  9.38k|  out[0] = x;
  476|  9.38k|  out[1] = x;
  477|  9.38k|  out[2] = x;
  478|  9.38k|  out[3] = x;
  479|  9.38k|  out[4] = x;
  480|  9.38k|  out[5] = x;
  481|  9.38k|  out[6] = x;
  482|  9.38k|  out[7] = x;
  483|  9.38k|  out[8] = x;
  484|  9.38k|  out[9] = x;
  485|  9.38k|  out[10] = x;
  486|  9.38k|  out[11] = x;
  487|  9.38k|  out[12] = x;
  488|  9.38k|  out[13] = x;
  489|  9.38k|  out[14] = x;
  490|  9.38k|  out[15] = x;
  491|  9.38k|  out[16] = x;
  492|  9.38k|  out[17] = x;
  493|  9.38k|  out[18] = x;
  494|  9.38k|  out[19] = x;
  495|  9.38k|  out[20] = x;
  496|  9.38k|  out[21] = x;
  497|  9.38k|  out[22] = x;
  498|  9.38k|  out[23] = x;
  499|  9.38k|  out[24] = x;
  500|  9.38k|  out[25] = x;
  501|  9.38k|  out[26] = x;
  502|  9.38k|  out[27] = x;
  503|  9.38k|  out[28] = x;
  504|  9.38k|  out[29] = x;
  505|  9.38k|  out[30] = x;
  506|  9.38k|  out[31] = x;
  507|  9.38k|}
highbd_inv_txfm_avx2.c:idct32_low8_avx2:
  510|  1.07k|                             int bd, int out_shift) {
  511|  1.07k|  const int32_t *cospi = cospi_arr(bit);
  512|  1.07k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
  513|  1.07k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
  514|  1.07k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
  515|  1.07k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
  516|  1.07k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
  517|  1.07k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
  518|  1.07k|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
  519|  1.07k|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
  520|  1.07k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
  521|  1.07k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
  522|  1.07k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
  523|  1.07k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
  524|  1.07k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
  525|  1.07k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
  526|  1.07k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
  527|  1.07k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
  528|  1.07k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
  529|  1.07k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
  530|  1.07k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
  531|  1.07k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
  532|  1.07k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  533|  1.07k|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
  534|  1.07k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  535|  1.07k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
  536|  1.07k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  537|  1.07k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
  538|  1.07k|  const __m256i rounding = _mm256_set1_epi32(1 << (bit - 1));
  539|  1.07k|  const int log_range = get_log_range(bd, do_cols);
  540|  1.07k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
  541|  1.07k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
  542|  1.07k|  __m256i bf1[32];
  543|       |
  544|  1.07k|  {
  545|       |    // stage 0
  546|       |    // stage 1
  547|  1.07k|    bf1[0] = in[0];
  548|  1.07k|    bf1[4] = in[4];
  549|  1.07k|    bf1[8] = in[2];
  550|  1.07k|    bf1[12] = in[6];
  551|  1.07k|    bf1[16] = in[1];
  552|  1.07k|    bf1[20] = in[5];
  553|  1.07k|    bf1[24] = in[3];
  554|  1.07k|    bf1[28] = in[7];
  555|       |
  556|       |    // stage 2
  557|  1.07k|    bf1[31] = half_btf_0_avx2(&cospi2, &bf1[16], &rounding, bit);
  558|  1.07k|    bf1[16] = half_btf_0_avx2(&cospi62, &bf1[16], &rounding, bit);
  559|  1.07k|    bf1[19] = half_btf_0_avx2(&cospim50, &bf1[28], &rounding, bit);
  560|  1.07k|    bf1[28] = half_btf_0_avx2(&cospi14, &bf1[28], &rounding, bit);
  561|  1.07k|    bf1[27] = half_btf_0_avx2(&cospi10, &bf1[20], &rounding, bit);
  562|  1.07k|    bf1[20] = half_btf_0_avx2(&cospi54, &bf1[20], &rounding, bit);
  563|  1.07k|    bf1[23] = half_btf_0_avx2(&cospim58, &bf1[24], &rounding, bit);
  564|  1.07k|    bf1[24] = half_btf_0_avx2(&cospi6, &bf1[24], &rounding, bit);
  565|       |
  566|       |    // stage 3
  567|  1.07k|    bf1[15] = half_btf_0_avx2(&cospi4, &bf1[8], &rounding, bit);
  568|  1.07k|    bf1[8] = half_btf_0_avx2(&cospi60, &bf1[8], &rounding, bit);
  569|       |
  570|  1.07k|    bf1[11] = half_btf_0_avx2(&cospim52, &bf1[12], &rounding, bit);
  571|  1.07k|    bf1[12] = half_btf_0_avx2(&cospi12, &bf1[12], &rounding, bit);
  572|  1.07k|    bf1[17] = bf1[16];
  573|  1.07k|    bf1[18] = bf1[19];
  574|  1.07k|    bf1[21] = bf1[20];
  575|  1.07k|    bf1[22] = bf1[23];
  576|  1.07k|    bf1[25] = bf1[24];
  577|  1.07k|    bf1[26] = bf1[27];
  578|  1.07k|    bf1[29] = bf1[28];
  579|  1.07k|    bf1[30] = bf1[31];
  580|       |
  581|       |    // stage 4
  582|  1.07k|    bf1[7] = half_btf_0_avx2(&cospi8, &bf1[4], &rounding, bit);
  583|  1.07k|    bf1[4] = half_btf_0_avx2(&cospi56, &bf1[4], &rounding, bit);
  584|       |
  585|  1.07k|    bf1[9] = bf1[8];
  586|  1.07k|    bf1[10] = bf1[11];
  587|  1.07k|    bf1[13] = bf1[12];
  588|  1.07k|    bf1[14] = bf1[15];
  589|       |
  590|  1.07k|    idct32_stage4_avx2(bf1, &cospim8, &cospi56, &cospi8, &cospim56, &cospim40,
  591|  1.07k|                       &cospi24, &cospi40, &cospim24, &rounding, bit);
  592|       |
  593|       |    // stage 5
  594|  1.07k|    bf1[0] = half_btf_0_avx2(&cospi32, &bf1[0], &rounding, bit);
  595|  1.07k|    bf1[1] = bf1[0];
  596|  1.07k|    bf1[5] = bf1[4];
  597|  1.07k|    bf1[6] = bf1[7];
  598|       |
  599|  1.07k|    idct32_stage5_avx2(bf1, &cospim16, &cospi48, &cospi16, &cospim48, &clamp_lo,
  600|  1.07k|                       &clamp_hi, &rounding, bit);
  601|       |
  602|       |    // stage 6
  603|  1.07k|    bf1[3] = bf1[0];
  604|  1.07k|    bf1[2] = bf1[1];
  605|       |
  606|  1.07k|    idct32_stage6_avx2(bf1, &cospim32, &cospi32, &cospim16, &cospi48, &cospi16,
  607|  1.07k|                       &cospim48, &clamp_lo, &clamp_hi, &rounding, bit);
  608|       |
  609|       |    // stage 7
  610|  1.07k|    idct32_stage7_avx2(bf1, &cospim32, &cospi32, &clamp_lo, &clamp_hi,
  611|  1.07k|                       &rounding, bit);
  612|       |
  613|       |    // stage 8
  614|  1.07k|    idct32_stage8_avx2(bf1, &cospim32, &cospi32, &clamp_lo, &clamp_hi,
  615|  1.07k|                       &rounding, bit);
  616|       |
  617|       |    // stage 9
  618|  1.07k|    idct32_stage9_avx2(bf1, out, do_cols, bd, out_shift, &clamp_lo, &clamp_hi);
  619|  1.07k|  }
  620|  1.07k|}
highbd_inv_txfm_avx2.c:idct32_stage4_avx2:
  282|  6.91k|    const __m256i *rounding, int bit) {
  283|  6.91k|  __m256i temp1, temp2;
  284|  6.91k|  temp1 = half_btf_avx2(cospim8, &bf1[17], cospi56, &bf1[30], rounding, bit);
  285|  6.91k|  bf1[30] = half_btf_avx2(cospi56, &bf1[17], cospi8, &bf1[30], rounding, bit);
  286|  6.91k|  bf1[17] = temp1;
  287|       |
  288|  6.91k|  temp2 = half_btf_avx2(cospim56, &bf1[18], cospim8, &bf1[29], rounding, bit);
  289|  6.91k|  bf1[29] = half_btf_avx2(cospim8, &bf1[18], cospi56, &bf1[29], rounding, bit);
  290|  6.91k|  bf1[18] = temp2;
  291|       |
  292|  6.91k|  temp1 = half_btf_avx2(cospim40, &bf1[21], cospi24, &bf1[26], rounding, bit);
  293|  6.91k|  bf1[26] = half_btf_avx2(cospi24, &bf1[21], cospi40, &bf1[26], rounding, bit);
  294|  6.91k|  bf1[21] = temp1;
  295|       |
  296|  6.91k|  temp2 = half_btf_avx2(cospim24, &bf1[22], cospim40, &bf1[25], rounding, bit);
  297|  6.91k|  bf1[25] = half_btf_avx2(cospim40, &bf1[22], cospi24, &bf1[25], rounding, bit);
  298|  6.91k|  bf1[22] = temp2;
  299|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_stage5_avx2:
  304|  6.91k|    const __m256i *clamp_hi, const __m256i *rounding, int bit) {
  305|  6.91k|  __m256i temp1, temp2;
  306|  6.91k|  temp1 = half_btf_avx2(cospim16, &bf1[9], cospi48, &bf1[14], rounding, bit);
  307|  6.91k|  bf1[14] = half_btf_avx2(cospi48, &bf1[9], cospi16, &bf1[14], rounding, bit);
  308|  6.91k|  bf1[9] = temp1;
  309|       |
  310|  6.91k|  temp2 = half_btf_avx2(cospim48, &bf1[10], cospim16, &bf1[13], rounding, bit);
  311|  6.91k|  bf1[13] = half_btf_avx2(cospim16, &bf1[10], cospi48, &bf1[13], rounding, bit);
  312|  6.91k|  bf1[10] = temp2;
  313|       |
  314|  6.91k|  addsub_avx2(bf1[16], bf1[19], bf1 + 16, bf1 + 19, clamp_lo, clamp_hi);
  315|  6.91k|  addsub_avx2(bf1[17], bf1[18], bf1 + 17, bf1 + 18, clamp_lo, clamp_hi);
  316|  6.91k|  addsub_avx2(bf1[23], bf1[20], bf1 + 23, bf1 + 20, clamp_lo, clamp_hi);
  317|  6.91k|  addsub_avx2(bf1[22], bf1[21], bf1 + 22, bf1 + 21, clamp_lo, clamp_hi);
  318|  6.91k|  addsub_avx2(bf1[24], bf1[27], bf1 + 24, bf1 + 27, clamp_lo, clamp_hi);
  319|  6.91k|  addsub_avx2(bf1[25], bf1[26], bf1 + 25, bf1 + 26, clamp_lo, clamp_hi);
  320|  6.91k|  addsub_avx2(bf1[31], bf1[28], bf1 + 31, bf1 + 28, clamp_lo, clamp_hi);
  321|  6.91k|  addsub_avx2(bf1[30], bf1[29], bf1 + 30, bf1 + 29, clamp_lo, clamp_hi);
  322|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_stage6_avx2:
  328|  6.91k|    const __m256i *rounding, int bit) {
  329|  6.91k|  __m256i temp1, temp2;
  330|  6.91k|  temp1 = half_btf_avx2(cospim32, &bf1[5], cospi32, &bf1[6], rounding, bit);
  331|  6.91k|  bf1[6] = half_btf_avx2(cospi32, &bf1[5], cospi32, &bf1[6], rounding, bit);
  332|  6.91k|  bf1[5] = temp1;
  333|       |
  334|  6.91k|  addsub_avx2(bf1[8], bf1[11], bf1 + 8, bf1 + 11, clamp_lo, clamp_hi);
  335|  6.91k|  addsub_avx2(bf1[9], bf1[10], bf1 + 9, bf1 + 10, clamp_lo, clamp_hi);
  336|  6.91k|  addsub_avx2(bf1[15], bf1[12], bf1 + 15, bf1 + 12, clamp_lo, clamp_hi);
  337|  6.91k|  addsub_avx2(bf1[14], bf1[13], bf1 + 14, bf1 + 13, clamp_lo, clamp_hi);
  338|       |
  339|  6.91k|  temp1 = half_btf_avx2(cospim16, &bf1[18], cospi48, &bf1[29], rounding, bit);
  340|  6.91k|  bf1[29] = half_btf_avx2(cospi48, &bf1[18], cospi16, &bf1[29], rounding, bit);
  341|  6.91k|  bf1[18] = temp1;
  342|  6.91k|  temp2 = half_btf_avx2(cospim16, &bf1[19], cospi48, &bf1[28], rounding, bit);
  343|  6.91k|  bf1[28] = half_btf_avx2(cospi48, &bf1[19], cospi16, &bf1[28], rounding, bit);
  344|  6.91k|  bf1[19] = temp2;
  345|  6.91k|  temp1 = half_btf_avx2(cospim48, &bf1[20], cospim16, &bf1[27], rounding, bit);
  346|  6.91k|  bf1[27] = half_btf_avx2(cospim16, &bf1[20], cospi48, &bf1[27], rounding, bit);
  347|  6.91k|  bf1[20] = temp1;
  348|  6.91k|  temp2 = half_btf_avx2(cospim48, &bf1[21], cospim16, &bf1[26], rounding, bit);
  349|  6.91k|  bf1[26] = half_btf_avx2(cospim16, &bf1[21], cospi48, &bf1[26], rounding, bit);
  350|  6.91k|  bf1[21] = temp2;
  351|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_stage7_avx2:
  357|  6.91k|                                      const __m256i *rounding, int bit) {
  358|  6.91k|  __m256i temp1, temp2;
  359|  6.91k|  addsub_avx2(bf1[0], bf1[7], bf1 + 0, bf1 + 7, clamp_lo, clamp_hi);
  360|  6.91k|  addsub_avx2(bf1[1], bf1[6], bf1 + 1, bf1 + 6, clamp_lo, clamp_hi);
  361|  6.91k|  addsub_avx2(bf1[2], bf1[5], bf1 + 2, bf1 + 5, clamp_lo, clamp_hi);
  362|  6.91k|  addsub_avx2(bf1[3], bf1[4], bf1 + 3, bf1 + 4, clamp_lo, clamp_hi);
  363|       |
  364|  6.91k|  temp1 = half_btf_avx2(cospim32, &bf1[10], cospi32, &bf1[13], rounding, bit);
  365|  6.91k|  bf1[13] = half_btf_avx2(cospi32, &bf1[10], cospi32, &bf1[13], rounding, bit);
  366|  6.91k|  bf1[10] = temp1;
  367|  6.91k|  temp2 = half_btf_avx2(cospim32, &bf1[11], cospi32, &bf1[12], rounding, bit);
  368|  6.91k|  bf1[12] = half_btf_avx2(cospi32, &bf1[11], cospi32, &bf1[12], rounding, bit);
  369|  6.91k|  bf1[11] = temp2;
  370|       |
  371|  6.91k|  addsub_avx2(bf1[16], bf1[23], bf1 + 16, bf1 + 23, clamp_lo, clamp_hi);
  372|  6.91k|  addsub_avx2(bf1[17], bf1[22], bf1 + 17, bf1 + 22, clamp_lo, clamp_hi);
  373|  6.91k|  addsub_avx2(bf1[18], bf1[21], bf1 + 18, bf1 + 21, clamp_lo, clamp_hi);
  374|  6.91k|  addsub_avx2(bf1[19], bf1[20], bf1 + 19, bf1 + 20, clamp_lo, clamp_hi);
  375|  6.91k|  addsub_avx2(bf1[31], bf1[24], bf1 + 31, bf1 + 24, clamp_lo, clamp_hi);
  376|  6.91k|  addsub_avx2(bf1[30], bf1[25], bf1 + 30, bf1 + 25, clamp_lo, clamp_hi);
  377|  6.91k|  addsub_avx2(bf1[29], bf1[26], bf1 + 29, bf1 + 26, clamp_lo, clamp_hi);
  378|  6.91k|  addsub_avx2(bf1[28], bf1[27], bf1 + 28, bf1 + 27, clamp_lo, clamp_hi);
  379|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_stage8_avx2:
  385|  6.91k|                                      const __m256i *rounding, int bit) {
  386|  6.91k|  __m256i temp1, temp2;
  387|  6.91k|  addsub_avx2(bf1[0], bf1[15], bf1 + 0, bf1 + 15, clamp_lo, clamp_hi);
  388|  6.91k|  addsub_avx2(bf1[1], bf1[14], bf1 + 1, bf1 + 14, clamp_lo, clamp_hi);
  389|  6.91k|  addsub_avx2(bf1[2], bf1[13], bf1 + 2, bf1 + 13, clamp_lo, clamp_hi);
  390|  6.91k|  addsub_avx2(bf1[3], bf1[12], bf1 + 3, bf1 + 12, clamp_lo, clamp_hi);
  391|  6.91k|  addsub_avx2(bf1[4], bf1[11], bf1 + 4, bf1 + 11, clamp_lo, clamp_hi);
  392|  6.91k|  addsub_avx2(bf1[5], bf1[10], bf1 + 5, bf1 + 10, clamp_lo, clamp_hi);
  393|  6.91k|  addsub_avx2(bf1[6], bf1[9], bf1 + 6, bf1 + 9, clamp_lo, clamp_hi);
  394|  6.91k|  addsub_avx2(bf1[7], bf1[8], bf1 + 7, bf1 + 8, clamp_lo, clamp_hi);
  395|       |
  396|  6.91k|  temp1 = half_btf_avx2(cospim32, &bf1[20], cospi32, &bf1[27], rounding, bit);
  397|  6.91k|  bf1[27] = half_btf_avx2(cospi32, &bf1[20], cospi32, &bf1[27], rounding, bit);
  398|  6.91k|  bf1[20] = temp1;
  399|  6.91k|  temp2 = half_btf_avx2(cospim32, &bf1[21], cospi32, &bf1[26], rounding, bit);
  400|  6.91k|  bf1[26] = half_btf_avx2(cospi32, &bf1[21], cospi32, &bf1[26], rounding, bit);
  401|  6.91k|  bf1[21] = temp2;
  402|  6.91k|  temp1 = half_btf_avx2(cospim32, &bf1[22], cospi32, &bf1[25], rounding, bit);
  403|  6.91k|  bf1[25] = half_btf_avx2(cospi32, &bf1[22], cospi32, &bf1[25], rounding, bit);
  404|  6.91k|  bf1[22] = temp1;
  405|  6.91k|  temp2 = half_btf_avx2(cospim32, &bf1[23], cospi32, &bf1[24], rounding, bit);
  406|  6.91k|  bf1[24] = half_btf_avx2(cospi32, &bf1[23], cospi32, &bf1[24], rounding, bit);
  407|  6.91k|  bf1[23] = temp2;
  408|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_stage9_avx2:
  414|  6.91k|                                      const __m256i *clamp_hi) {
  415|  6.91k|  addsub_avx2(bf1[0], bf1[31], out + 0, out + 31, clamp_lo, clamp_hi);
  416|  6.91k|  addsub_avx2(bf1[1], bf1[30], out + 1, out + 30, clamp_lo, clamp_hi);
  417|  6.91k|  addsub_avx2(bf1[2], bf1[29], out + 2, out + 29, clamp_lo, clamp_hi);
  418|  6.91k|  addsub_avx2(bf1[3], bf1[28], out + 3, out + 28, clamp_lo, clamp_hi);
  419|  6.91k|  addsub_avx2(bf1[4], bf1[27], out + 4, out + 27, clamp_lo, clamp_hi);
  420|  6.91k|  addsub_avx2(bf1[5], bf1[26], out + 5, out + 26, clamp_lo, clamp_hi);
  421|  6.91k|  addsub_avx2(bf1[6], bf1[25], out + 6, out + 25, clamp_lo, clamp_hi);
  422|  6.91k|  addsub_avx2(bf1[7], bf1[24], out + 7, out + 24, clamp_lo, clamp_hi);
  423|  6.91k|  addsub_avx2(bf1[8], bf1[23], out + 8, out + 23, clamp_lo, clamp_hi);
  424|  6.91k|  addsub_avx2(bf1[9], bf1[22], out + 9, out + 22, clamp_lo, clamp_hi);
  425|  6.91k|  addsub_avx2(bf1[10], bf1[21], out + 10, out + 21, clamp_lo, clamp_hi);
  426|  6.91k|  addsub_avx2(bf1[11], bf1[20], out + 11, out + 20, clamp_lo, clamp_hi);
  427|  6.91k|  addsub_avx2(bf1[12], bf1[19], out + 12, out + 19, clamp_lo, clamp_hi);
  428|  6.91k|  addsub_avx2(bf1[13], bf1[18], out + 13, out + 18, clamp_lo, clamp_hi);
  429|  6.91k|  addsub_avx2(bf1[14], bf1[17], out + 14, out + 17, clamp_lo, clamp_hi);
  430|  6.91k|  addsub_avx2(bf1[15], bf1[16], out + 15, out + 16, clamp_lo, clamp_hi);
  431|  6.91k|  if (!do_cols) {
  ------------------
  |  Branch (431:7): [True: 2.94k, False: 3.97k]
  ------------------
  432|  2.94k|    const int log_range_out = get_log_range_out(bd);
  433|  2.94k|    const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
  434|  2.94k|    const __m256i clamp_hi_out =
  435|  2.94k|        _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
  436|  2.94k|    round_shift_8x8_avx2(out, out_shift);
  437|  2.94k|    round_shift_8x8_avx2(out + 16, out_shift);
  438|  2.94k|    highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 32);
  439|  2.94k|  }
  440|  6.91k|}
highbd_inv_txfm_avx2.c:idct32_low16_avx2:
  623|  5.84k|                              int bd, int out_shift) {
  624|  5.84k|  const int32_t *cospi = cospi_arr(bit);
  625|  5.84k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
  626|  5.84k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
  627|  5.84k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
  628|  5.84k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
  629|  5.84k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
  630|  5.84k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
  631|  5.84k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
  632|  5.84k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
  633|  5.84k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
  634|  5.84k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
  635|  5.84k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
  636|  5.84k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
  637|  5.84k|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
  638|  5.84k|  const __m256i cospim42 = _mm256_set1_epi32(-cospi[42]);
  639|  5.84k|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
  640|  5.84k|  const __m256i cospim34 = _mm256_set1_epi32(-cospi[34]);
  641|  5.84k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
  642|  5.84k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
  643|  5.84k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
  644|  5.84k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
  645|  5.84k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
  646|  5.84k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
  647|  5.84k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
  648|  5.84k|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
  649|  5.84k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
  650|  5.84k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
  651|  5.84k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
  652|  5.84k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
  653|  5.84k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
  654|  5.84k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
  655|  5.84k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
  656|  5.84k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
  657|  5.84k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  658|  5.84k|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
  659|  5.84k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  660|  5.84k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
  661|  5.84k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  662|  5.84k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
  663|  5.84k|  const __m256i rounding = _mm256_set1_epi32(1 << (bit - 1));
  664|  5.84k|  const int log_range = get_log_range(bd, do_cols);
  665|  5.84k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
  666|  5.84k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
  667|  5.84k|  __m256i bf1[32];
  668|       |
  669|  5.84k|  {
  670|       |    // stage 0
  671|       |    // stage 1
  672|  5.84k|    bf1[0] = in[0];
  673|  5.84k|    bf1[2] = in[8];
  674|  5.84k|    bf1[4] = in[4];
  675|  5.84k|    bf1[6] = in[12];
  676|  5.84k|    bf1[8] = in[2];
  677|  5.84k|    bf1[10] = in[10];
  678|  5.84k|    bf1[12] = in[6];
  679|  5.84k|    bf1[14] = in[14];
  680|  5.84k|    bf1[16] = in[1];
  681|  5.84k|    bf1[18] = in[9];
  682|  5.84k|    bf1[20] = in[5];
  683|  5.84k|    bf1[22] = in[13];
  684|  5.84k|    bf1[24] = in[3];
  685|  5.84k|    bf1[26] = in[11];
  686|  5.84k|    bf1[28] = in[7];
  687|  5.84k|    bf1[30] = in[15];
  688|       |
  689|       |    // stage 2
  690|  5.84k|    bf1[31] = half_btf_0_avx2(&cospi2, &bf1[16], &rounding, bit);
  691|  5.84k|    bf1[16] = half_btf_0_avx2(&cospi62, &bf1[16], &rounding, bit);
  692|  5.84k|    bf1[17] = half_btf_0_avx2(&cospim34, &bf1[30], &rounding, bit);
  693|  5.84k|    bf1[30] = half_btf_0_avx2(&cospi30, &bf1[30], &rounding, bit);
  694|  5.84k|    bf1[29] = half_btf_0_avx2(&cospi18, &bf1[18], &rounding, bit);
  695|  5.84k|    bf1[18] = half_btf_0_avx2(&cospi46, &bf1[18], &rounding, bit);
  696|  5.84k|    bf1[19] = half_btf_0_avx2(&cospim50, &bf1[28], &rounding, bit);
  697|  5.84k|    bf1[28] = half_btf_0_avx2(&cospi14, &bf1[28], &rounding, bit);
  698|  5.84k|    bf1[27] = half_btf_0_avx2(&cospi10, &bf1[20], &rounding, bit);
  699|  5.84k|    bf1[20] = half_btf_0_avx2(&cospi54, &bf1[20], &rounding, bit);
  700|  5.84k|    bf1[21] = half_btf_0_avx2(&cospim42, &bf1[26], &rounding, bit);
  701|  5.84k|    bf1[26] = half_btf_0_avx2(&cospi22, &bf1[26], &rounding, bit);
  702|  5.84k|    bf1[25] = half_btf_0_avx2(&cospi26, &bf1[22], &rounding, bit);
  703|  5.84k|    bf1[22] = half_btf_0_avx2(&cospi38, &bf1[22], &rounding, bit);
  704|  5.84k|    bf1[23] = half_btf_0_avx2(&cospim58, &bf1[24], &rounding, bit);
  705|  5.84k|    bf1[24] = half_btf_0_avx2(&cospi6, &bf1[24], &rounding, bit);
  706|       |
  707|       |    // stage 3
  708|  5.84k|    bf1[15] = half_btf_0_avx2(&cospi4, &bf1[8], &rounding, bit);
  709|  5.84k|    bf1[8] = half_btf_0_avx2(&cospi60, &bf1[8], &rounding, bit);
  710|  5.84k|    bf1[9] = half_btf_0_avx2(&cospim36, &bf1[14], &rounding, bit);
  711|  5.84k|    bf1[14] = half_btf_0_avx2(&cospi28, &bf1[14], &rounding, bit);
  712|  5.84k|    bf1[13] = half_btf_0_avx2(&cospi20, &bf1[10], &rounding, bit);
  713|  5.84k|    bf1[10] = half_btf_0_avx2(&cospi44, &bf1[10], &rounding, bit);
  714|  5.84k|    bf1[11] = half_btf_0_avx2(&cospim52, &bf1[12], &rounding, bit);
  715|  5.84k|    bf1[12] = half_btf_0_avx2(&cospi12, &bf1[12], &rounding, bit);
  716|       |
  717|  5.84k|    addsub_avx2(bf1[16], bf1[17], bf1 + 16, bf1 + 17, &clamp_lo, &clamp_hi);
  718|  5.84k|    addsub_avx2(bf1[19], bf1[18], bf1 + 19, bf1 + 18, &clamp_lo, &clamp_hi);
  719|  5.84k|    addsub_avx2(bf1[20], bf1[21], bf1 + 20, bf1 + 21, &clamp_lo, &clamp_hi);
  720|  5.84k|    addsub_avx2(bf1[23], bf1[22], bf1 + 23, bf1 + 22, &clamp_lo, &clamp_hi);
  721|  5.84k|    addsub_avx2(bf1[24], bf1[25], bf1 + 24, bf1 + 25, &clamp_lo, &clamp_hi);
  722|  5.84k|    addsub_avx2(bf1[27], bf1[26], bf1 + 27, bf1 + 26, &clamp_lo, &clamp_hi);
  723|  5.84k|    addsub_avx2(bf1[28], bf1[29], bf1 + 28, bf1 + 29, &clamp_lo, &clamp_hi);
  724|  5.84k|    addsub_avx2(bf1[31], bf1[30], bf1 + 31, bf1 + 30, &clamp_lo, &clamp_hi);
  725|       |
  726|       |    // stage 4
  727|  5.84k|    bf1[7] = half_btf_0_avx2(&cospi8, &bf1[4], &rounding, bit);
  728|  5.84k|    bf1[4] = half_btf_0_avx2(&cospi56, &bf1[4], &rounding, bit);
  729|  5.84k|    bf1[5] = half_btf_0_avx2(&cospim40, &bf1[6], &rounding, bit);
  730|  5.84k|    bf1[6] = half_btf_0_avx2(&cospi24, &bf1[6], &rounding, bit);
  731|       |
  732|  5.84k|    addsub_avx2(bf1[8], bf1[9], bf1 + 8, bf1 + 9, &clamp_lo, &clamp_hi);
  733|  5.84k|    addsub_avx2(bf1[11], bf1[10], bf1 + 11, bf1 + 10, &clamp_lo, &clamp_hi);
  734|  5.84k|    addsub_avx2(bf1[12], bf1[13], bf1 + 12, bf1 + 13, &clamp_lo, &clamp_hi);
  735|  5.84k|    addsub_avx2(bf1[15], bf1[14], bf1 + 15, bf1 + 14, &clamp_lo, &clamp_hi);
  736|       |
  737|  5.84k|    idct32_stage4_avx2(bf1, &cospim8, &cospi56, &cospi8, &cospim56, &cospim40,
  738|  5.84k|                       &cospi24, &cospi40, &cospim24, &rounding, bit);
  739|       |
  740|       |    // stage 5
  741|  5.84k|    bf1[0] = half_btf_0_avx2(&cospi32, &bf1[0], &rounding, bit);
  742|  5.84k|    bf1[1] = bf1[0];
  743|  5.84k|    bf1[3] = half_btf_0_avx2(&cospi16, &bf1[2], &rounding, bit);
  744|  5.84k|    bf1[2] = half_btf_0_avx2(&cospi48, &bf1[2], &rounding, bit);
  745|       |
  746|  5.84k|    addsub_avx2(bf1[4], bf1[5], bf1 + 4, bf1 + 5, &clamp_lo, &clamp_hi);
  747|  5.84k|    addsub_avx2(bf1[7], bf1[6], bf1 + 7, bf1 + 6, &clamp_lo, &clamp_hi);
  748|       |
  749|  5.84k|    idct32_stage5_avx2(bf1, &cospim16, &cospi48, &cospi16, &cospim48, &clamp_lo,
  750|  5.84k|                       &clamp_hi, &rounding, bit);
  751|       |
  752|       |    // stage 6
  753|  5.84k|    addsub_avx2(bf1[0], bf1[3], bf1 + 0, bf1 + 3, &clamp_lo, &clamp_hi);
  754|  5.84k|    addsub_avx2(bf1[1], bf1[2], bf1 + 1, bf1 + 2, &clamp_lo, &clamp_hi);
  755|       |
  756|  5.84k|    idct32_stage6_avx2(bf1, &cospim32, &cospi32, &cospim16, &cospi48, &cospi16,
  757|  5.84k|                       &cospim48, &clamp_lo, &clamp_hi, &rounding, bit);
  758|       |
  759|       |    // stage 7
  760|  5.84k|    idct32_stage7_avx2(bf1, &cospim32, &cospi32, &clamp_lo, &clamp_hi,
  761|  5.84k|                       &rounding, bit);
  762|       |
  763|       |    // stage 8
  764|  5.84k|    idct32_stage8_avx2(bf1, &cospim32, &cospi32, &clamp_lo, &clamp_hi,
  765|  5.84k|                       &rounding, bit);
  766|       |
  767|       |    // stage 9
  768|  5.84k|    idct32_stage9_avx2(bf1, out, do_cols, bd, out_shift, &clamp_lo, &clamp_hi);
  769|  5.84k|  }
  770|  5.84k|}
highbd_inv_txfm_avx2.c:idct32_avx2:
  773|   172k|                        int out_shift) {
  774|   172k|  const int32_t *cospi = cospi_arr(bit);
  775|   172k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
  776|   172k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
  777|   172k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
  778|   172k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
  779|   172k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
  780|   172k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
  781|   172k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
  782|   172k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
  783|   172k|  const __m256i cospi58 = _mm256_set1_epi32(cospi[58]);
  784|   172k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
  785|   172k|  const __m256i cospi42 = _mm256_set1_epi32(cospi[42]);
  786|   172k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
  787|   172k|  const __m256i cospi50 = _mm256_set1_epi32(cospi[50]);
  788|   172k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
  789|   172k|  const __m256i cospi34 = _mm256_set1_epi32(cospi[34]);
  790|   172k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
  791|   172k|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
  792|   172k|  const __m256i cospim26 = _mm256_set1_epi32(-cospi[26]);
  793|   172k|  const __m256i cospim42 = _mm256_set1_epi32(-cospi[42]);
  794|   172k|  const __m256i cospim10 = _mm256_set1_epi32(-cospi[10]);
  795|   172k|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
  796|   172k|  const __m256i cospim18 = _mm256_set1_epi32(-cospi[18]);
  797|   172k|  const __m256i cospim34 = _mm256_set1_epi32(-cospi[34]);
  798|   172k|  const __m256i cospim2 = _mm256_set1_epi32(-cospi[2]);
  799|   172k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
  800|   172k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
  801|   172k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
  802|   172k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
  803|   172k|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
  804|   172k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
  805|   172k|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
  806|   172k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
  807|   172k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
  808|   172k|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
  809|   172k|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
  810|   172k|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
  811|   172k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
  812|   172k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
  813|   172k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
  814|   172k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
  815|   172k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
  816|   172k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
  817|   172k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
  818|   172k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
  819|   172k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  820|   172k|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
  821|   172k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  822|   172k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
  823|   172k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  824|   172k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
  825|   172k|  const __m256i rounding = _mm256_set1_epi32(1 << (bit - 1));
  826|   172k|  const int log_range = get_log_range(bd, do_cols);
  827|   172k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
  828|   172k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
  829|   172k|  __m256i bf1[32], bf0[32];
  830|       |
  831|   172k|  {
  832|       |    // stage 0
  833|       |    // stage 1
  834|   172k|    bf1[0] = in[0];
  835|   172k|    bf1[1] = in[16];
  836|   172k|    bf1[2] = in[8];
  837|   172k|    bf1[3] = in[24];
  838|   172k|    bf1[4] = in[4];
  839|   172k|    bf1[5] = in[20];
  840|   172k|    bf1[6] = in[12];
  841|   172k|    bf1[7] = in[28];
  842|   172k|    bf1[8] = in[2];
  843|   172k|    bf1[9] = in[18];
  844|   172k|    bf1[10] = in[10];
  845|   172k|    bf1[11] = in[26];
  846|   172k|    bf1[12] = in[6];
  847|   172k|    bf1[13] = in[22];
  848|   172k|    bf1[14] = in[14];
  849|   172k|    bf1[15] = in[30];
  850|   172k|    bf1[16] = in[1];
  851|   172k|    bf1[17] = in[17];
  852|   172k|    bf1[18] = in[9];
  853|   172k|    bf1[19] = in[25];
  854|   172k|    bf1[20] = in[5];
  855|   172k|    bf1[21] = in[21];
  856|   172k|    bf1[22] = in[13];
  857|   172k|    bf1[23] = in[29];
  858|   172k|    bf1[24] = in[3];
  859|   172k|    bf1[25] = in[19];
  860|   172k|    bf1[26] = in[11];
  861|   172k|    bf1[27] = in[27];
  862|   172k|    bf1[28] = in[7];
  863|   172k|    bf1[29] = in[23];
  864|   172k|    bf1[30] = in[15];
  865|   172k|    bf1[31] = in[31];
  866|       |
  867|       |    // stage 2
  868|   172k|    bf0[0] = bf1[0];
  869|   172k|    bf0[1] = bf1[1];
  870|   172k|    bf0[2] = bf1[2];
  871|   172k|    bf0[3] = bf1[3];
  872|   172k|    bf0[4] = bf1[4];
  873|   172k|    bf0[5] = bf1[5];
  874|   172k|    bf0[6] = bf1[6];
  875|   172k|    bf0[7] = bf1[7];
  876|   172k|    bf0[8] = bf1[8];
  877|   172k|    bf0[9] = bf1[9];
  878|   172k|    bf0[10] = bf1[10];
  879|   172k|    bf0[11] = bf1[11];
  880|   172k|    bf0[12] = bf1[12];
  881|   172k|    bf0[13] = bf1[13];
  882|   172k|    bf0[14] = bf1[14];
  883|   172k|    bf0[15] = bf1[15];
  884|   172k|    bf0[16] =
  885|   172k|        half_btf_avx2(&cospi62, &bf1[16], &cospim2, &bf1[31], &rounding, bit);
  886|   172k|    bf0[17] =
  887|   172k|        half_btf_avx2(&cospi30, &bf1[17], &cospim34, &bf1[30], &rounding, bit);
  888|   172k|    bf0[18] =
  889|   172k|        half_btf_avx2(&cospi46, &bf1[18], &cospim18, &bf1[29], &rounding, bit);
  890|   172k|    bf0[19] =
  891|   172k|        half_btf_avx2(&cospi14, &bf1[19], &cospim50, &bf1[28], &rounding, bit);
  892|   172k|    bf0[20] =
  893|   172k|        half_btf_avx2(&cospi54, &bf1[20], &cospim10, &bf1[27], &rounding, bit);
  894|   172k|    bf0[21] =
  895|   172k|        half_btf_avx2(&cospi22, &bf1[21], &cospim42, &bf1[26], &rounding, bit);
  896|   172k|    bf0[22] =
  897|   172k|        half_btf_avx2(&cospi38, &bf1[22], &cospim26, &bf1[25], &rounding, bit);
  898|   172k|    bf0[23] =
  899|   172k|        half_btf_avx2(&cospi6, &bf1[23], &cospim58, &bf1[24], &rounding, bit);
  900|   172k|    bf0[24] =
  901|   172k|        half_btf_avx2(&cospi58, &bf1[23], &cospi6, &bf1[24], &rounding, bit);
  902|   172k|    bf0[25] =
  903|   172k|        half_btf_avx2(&cospi26, &bf1[22], &cospi38, &bf1[25], &rounding, bit);
  904|   172k|    bf0[26] =
  905|   172k|        half_btf_avx2(&cospi42, &bf1[21], &cospi22, &bf1[26], &rounding, bit);
  906|   172k|    bf0[27] =
  907|   172k|        half_btf_avx2(&cospi10, &bf1[20], &cospi54, &bf1[27], &rounding, bit);
  908|   172k|    bf0[28] =
  909|   172k|        half_btf_avx2(&cospi50, &bf1[19], &cospi14, &bf1[28], &rounding, bit);
  910|   172k|    bf0[29] =
  911|   172k|        half_btf_avx2(&cospi18, &bf1[18], &cospi46, &bf1[29], &rounding, bit);
  912|   172k|    bf0[30] =
  913|   172k|        half_btf_avx2(&cospi34, &bf1[17], &cospi30, &bf1[30], &rounding, bit);
  914|   172k|    bf0[31] =
  915|   172k|        half_btf_avx2(&cospi2, &bf1[16], &cospi62, &bf1[31], &rounding, bit);
  916|       |
  917|       |    // stage 3
  918|   172k|    bf1[0] = bf0[0];
  919|   172k|    bf1[1] = bf0[1];
  920|   172k|    bf1[2] = bf0[2];
  921|   172k|    bf1[3] = bf0[3];
  922|   172k|    bf1[4] = bf0[4];
  923|   172k|    bf1[5] = bf0[5];
  924|   172k|    bf1[6] = bf0[6];
  925|   172k|    bf1[7] = bf0[7];
  926|   172k|    bf1[8] =
  927|   172k|        half_btf_avx2(&cospi60, &bf0[8], &cospim4, &bf0[15], &rounding, bit);
  928|   172k|    bf1[9] =
  929|   172k|        half_btf_avx2(&cospi28, &bf0[9], &cospim36, &bf0[14], &rounding, bit);
  930|   172k|    bf1[10] =
  931|   172k|        half_btf_avx2(&cospi44, &bf0[10], &cospim20, &bf0[13], &rounding, bit);
  932|   172k|    bf1[11] =
  933|   172k|        half_btf_avx2(&cospi12, &bf0[11], &cospim52, &bf0[12], &rounding, bit);
  934|   172k|    bf1[12] =
  935|   172k|        half_btf_avx2(&cospi52, &bf0[11], &cospi12, &bf0[12], &rounding, bit);
  936|   172k|    bf1[13] =
  937|   172k|        half_btf_avx2(&cospi20, &bf0[10], &cospi44, &bf0[13], &rounding, bit);
  938|   172k|    bf1[14] =
  939|   172k|        half_btf_avx2(&cospi36, &bf0[9], &cospi28, &bf0[14], &rounding, bit);
  940|   172k|    bf1[15] =
  941|   172k|        half_btf_avx2(&cospi4, &bf0[8], &cospi60, &bf0[15], &rounding, bit);
  942|       |
  943|   172k|    addsub_avx2(bf0[16], bf0[17], bf1 + 16, bf1 + 17, &clamp_lo, &clamp_hi);
  944|   172k|    addsub_avx2(bf0[19], bf0[18], bf1 + 19, bf1 + 18, &clamp_lo, &clamp_hi);
  945|   172k|    addsub_avx2(bf0[20], bf0[21], bf1 + 20, bf1 + 21, &clamp_lo, &clamp_hi);
  946|   172k|    addsub_avx2(bf0[23], bf0[22], bf1 + 23, bf1 + 22, &clamp_lo, &clamp_hi);
  947|   172k|    addsub_avx2(bf0[24], bf0[25], bf1 + 24, bf1 + 25, &clamp_lo, &clamp_hi);
  948|   172k|    addsub_avx2(bf0[27], bf0[26], bf1 + 27, bf1 + 26, &clamp_lo, &clamp_hi);
  949|   172k|    addsub_avx2(bf0[28], bf0[29], bf1 + 28, bf1 + 29, &clamp_lo, &clamp_hi);
  950|   172k|    addsub_avx2(bf0[31], bf0[30], bf1 + 31, bf1 + 30, &clamp_lo, &clamp_hi);
  951|       |
  952|       |    // stage 4
  953|   172k|    bf0[0] = bf1[0];
  954|   172k|    bf0[1] = bf1[1];
  955|   172k|    bf0[2] = bf1[2];
  956|   172k|    bf0[3] = bf1[3];
  957|   172k|    bf0[4] =
  958|   172k|        half_btf_avx2(&cospi56, &bf1[4], &cospim8, &bf1[7], &rounding, bit);
  959|   172k|    bf0[5] =
  960|   172k|        half_btf_avx2(&cospi24, &bf1[5], &cospim40, &bf1[6], &rounding, bit);
  961|   172k|    bf0[6] =
  962|   172k|        half_btf_avx2(&cospi40, &bf1[5], &cospi24, &bf1[6], &rounding, bit);
  963|   172k|    bf0[7] = half_btf_avx2(&cospi8, &bf1[4], &cospi56, &bf1[7], &rounding, bit);
  964|       |
  965|   172k|    addsub_avx2(bf1[8], bf1[9], bf0 + 8, bf0 + 9, &clamp_lo, &clamp_hi);
  966|   172k|    addsub_avx2(bf1[11], bf1[10], bf0 + 11, bf0 + 10, &clamp_lo, &clamp_hi);
  967|   172k|    addsub_avx2(bf1[12], bf1[13], bf0 + 12, bf0 + 13, &clamp_lo, &clamp_hi);
  968|   172k|    addsub_avx2(bf1[15], bf1[14], bf0 + 15, bf0 + 14, &clamp_lo, &clamp_hi);
  969|       |
  970|   172k|    bf0[16] = bf1[16];
  971|   172k|    bf0[17] =
  972|   172k|        half_btf_avx2(&cospim8, &bf1[17], &cospi56, &bf1[30], &rounding, bit);
  973|   172k|    bf0[18] =
  974|   172k|        half_btf_avx2(&cospim56, &bf1[18], &cospim8, &bf1[29], &rounding, bit);
  975|   172k|    bf0[19] = bf1[19];
  976|   172k|    bf0[20] = bf1[20];
  977|   172k|    bf0[21] =
  978|   172k|        half_btf_avx2(&cospim40, &bf1[21], &cospi24, &bf1[26], &rounding, bit);
  979|   172k|    bf0[22] =
  980|   172k|        half_btf_avx2(&cospim24, &bf1[22], &cospim40, &bf1[25], &rounding, bit);
  981|   172k|    bf0[23] = bf1[23];
  982|   172k|    bf0[24] = bf1[24];
  983|   172k|    bf0[25] =
  984|   172k|        half_btf_avx2(&cospim40, &bf1[22], &cospi24, &bf1[25], &rounding, bit);
  985|   172k|    bf0[26] =
  986|   172k|        half_btf_avx2(&cospi24, &bf1[21], &cospi40, &bf1[26], &rounding, bit);
  987|   172k|    bf0[27] = bf1[27];
  988|   172k|    bf0[28] = bf1[28];
  989|   172k|    bf0[29] =
  990|   172k|        half_btf_avx2(&cospim8, &bf1[18], &cospi56, &bf1[29], &rounding, bit);
  991|   172k|    bf0[30] =
  992|   172k|        half_btf_avx2(&cospi56, &bf1[17], &cospi8, &bf1[30], &rounding, bit);
  993|   172k|    bf0[31] = bf1[31];
  994|       |
  995|       |    // stage 5
  996|   172k|    bf1[0] =
  997|   172k|        half_btf_avx2(&cospi32, &bf0[0], &cospi32, &bf0[1], &rounding, bit);
  998|   172k|    bf1[1] =
  999|   172k|        half_btf_avx2(&cospi32, &bf0[0], &cospim32, &bf0[1], &rounding, bit);
 1000|   172k|    bf1[2] =
 1001|   172k|        half_btf_avx2(&cospi48, &bf0[2], &cospim16, &bf0[3], &rounding, bit);
 1002|   172k|    bf1[3] =
 1003|   172k|        half_btf_avx2(&cospi16, &bf0[2], &cospi48, &bf0[3], &rounding, bit);
 1004|   172k|    addsub_avx2(bf0[4], bf0[5], bf1 + 4, bf1 + 5, &clamp_lo, &clamp_hi);
 1005|   172k|    addsub_avx2(bf0[7], bf0[6], bf1 + 7, bf1 + 6, &clamp_lo, &clamp_hi);
 1006|   172k|    bf1[8] = bf0[8];
 1007|   172k|    bf1[9] =
 1008|   172k|        half_btf_avx2(&cospim16, &bf0[9], &cospi48, &bf0[14], &rounding, bit);
 1009|   172k|    bf1[10] =
 1010|   172k|        half_btf_avx2(&cospim48, &bf0[10], &cospim16, &bf0[13], &rounding, bit);
 1011|   172k|    bf1[11] = bf0[11];
 1012|   172k|    bf1[12] = bf0[12];
 1013|   172k|    bf1[13] =
 1014|   172k|        half_btf_avx2(&cospim16, &bf0[10], &cospi48, &bf0[13], &rounding, bit);
 1015|   172k|    bf1[14] =
 1016|   172k|        half_btf_avx2(&cospi48, &bf0[9], &cospi16, &bf0[14], &rounding, bit);
 1017|   172k|    bf1[15] = bf0[15];
 1018|   172k|    addsub_avx2(bf0[16], bf0[19], bf1 + 16, bf1 + 19, &clamp_lo, &clamp_hi);
 1019|   172k|    addsub_avx2(bf0[17], bf0[18], bf1 + 17, bf1 + 18, &clamp_lo, &clamp_hi);
 1020|   172k|    addsub_avx2(bf0[23], bf0[20], bf1 + 23, bf1 + 20, &clamp_lo, &clamp_hi);
 1021|   172k|    addsub_avx2(bf0[22], bf0[21], bf1 + 22, bf1 + 21, &clamp_lo, &clamp_hi);
 1022|   172k|    addsub_avx2(bf0[24], bf0[27], bf1 + 24, bf1 + 27, &clamp_lo, &clamp_hi);
 1023|   172k|    addsub_avx2(bf0[25], bf0[26], bf1 + 25, bf1 + 26, &clamp_lo, &clamp_hi);
 1024|   172k|    addsub_avx2(bf0[31], bf0[28], bf1 + 31, bf1 + 28, &clamp_lo, &clamp_hi);
 1025|   172k|    addsub_avx2(bf0[30], bf0[29], bf1 + 30, bf1 + 29, &clamp_lo, &clamp_hi);
 1026|       |
 1027|       |    // stage 6
 1028|   172k|    addsub_avx2(bf1[0], bf1[3], bf0 + 0, bf0 + 3, &clamp_lo, &clamp_hi);
 1029|   172k|    addsub_avx2(bf1[1], bf1[2], bf0 + 1, bf0 + 2, &clamp_lo, &clamp_hi);
 1030|   172k|    bf0[4] = bf1[4];
 1031|   172k|    bf0[5] =
 1032|   172k|        half_btf_avx2(&cospim32, &bf1[5], &cospi32, &bf1[6], &rounding, bit);
 1033|   172k|    bf0[6] =
 1034|   172k|        half_btf_avx2(&cospi32, &bf1[5], &cospi32, &bf1[6], &rounding, bit);
 1035|   172k|    bf0[7] = bf1[7];
 1036|   172k|    addsub_avx2(bf1[8], bf1[11], bf0 + 8, bf0 + 11, &clamp_lo, &clamp_hi);
 1037|   172k|    addsub_avx2(bf1[9], bf1[10], bf0 + 9, bf0 + 10, &clamp_lo, &clamp_hi);
 1038|   172k|    addsub_avx2(bf1[15], bf1[12], bf0 + 15, bf0 + 12, &clamp_lo, &clamp_hi);
 1039|   172k|    addsub_avx2(bf1[14], bf1[13], bf0 + 14, bf0 + 13, &clamp_lo, &clamp_hi);
 1040|   172k|    bf0[16] = bf1[16];
 1041|   172k|    bf0[17] = bf1[17];
 1042|   172k|    bf0[18] =
 1043|   172k|        half_btf_avx2(&cospim16, &bf1[18], &cospi48, &bf1[29], &rounding, bit);
 1044|   172k|    bf0[19] =
 1045|   172k|        half_btf_avx2(&cospim16, &bf1[19], &cospi48, &bf1[28], &rounding, bit);
 1046|   172k|    bf0[20] =
 1047|   172k|        half_btf_avx2(&cospim48, &bf1[20], &cospim16, &bf1[27], &rounding, bit);
 1048|   172k|    bf0[21] =
 1049|   172k|        half_btf_avx2(&cospim48, &bf1[21], &cospim16, &bf1[26], &rounding, bit);
 1050|   172k|    bf0[22] = bf1[22];
 1051|   172k|    bf0[23] = bf1[23];
 1052|   172k|    bf0[24] = bf1[24];
 1053|   172k|    bf0[25] = bf1[25];
 1054|   172k|    bf0[26] =
 1055|   172k|        half_btf_avx2(&cospim16, &bf1[21], &cospi48, &bf1[26], &rounding, bit);
 1056|   172k|    bf0[27] =
 1057|   172k|        half_btf_avx2(&cospim16, &bf1[20], &cospi48, &bf1[27], &rounding, bit);
 1058|   172k|    bf0[28] =
 1059|   172k|        half_btf_avx2(&cospi48, &bf1[19], &cospi16, &bf1[28], &rounding, bit);
 1060|   172k|    bf0[29] =
 1061|   172k|        half_btf_avx2(&cospi48, &bf1[18], &cospi16, &bf1[29], &rounding, bit);
 1062|   172k|    bf0[30] = bf1[30];
 1063|   172k|    bf0[31] = bf1[31];
 1064|       |
 1065|       |    // stage 7
 1066|   172k|    addsub_avx2(bf0[0], bf0[7], bf1 + 0, bf1 + 7, &clamp_lo, &clamp_hi);
 1067|   172k|    addsub_avx2(bf0[1], bf0[6], bf1 + 1, bf1 + 6, &clamp_lo, &clamp_hi);
 1068|   172k|    addsub_avx2(bf0[2], bf0[5], bf1 + 2, bf1 + 5, &clamp_lo, &clamp_hi);
 1069|   172k|    addsub_avx2(bf0[3], bf0[4], bf1 + 3, bf1 + 4, &clamp_lo, &clamp_hi);
 1070|   172k|    bf1[8] = bf0[8];
 1071|   172k|    bf1[9] = bf0[9];
 1072|   172k|    bf1[10] =
 1073|   172k|        half_btf_avx2(&cospim32, &bf0[10], &cospi32, &bf0[13], &rounding, bit);
 1074|   172k|    bf1[11] =
 1075|   172k|        half_btf_avx2(&cospim32, &bf0[11], &cospi32, &bf0[12], &rounding, bit);
 1076|   172k|    bf1[12] =
 1077|   172k|        half_btf_avx2(&cospi32, &bf0[11], &cospi32, &bf0[12], &rounding, bit);
 1078|   172k|    bf1[13] =
 1079|   172k|        half_btf_avx2(&cospi32, &bf0[10], &cospi32, &bf0[13], &rounding, bit);
 1080|   172k|    bf1[14] = bf0[14];
 1081|   172k|    bf1[15] = bf0[15];
 1082|   172k|    addsub_avx2(bf0[16], bf0[23], bf1 + 16, bf1 + 23, &clamp_lo, &clamp_hi);
 1083|   172k|    addsub_avx2(bf0[17], bf0[22], bf1 + 17, bf1 + 22, &clamp_lo, &clamp_hi);
 1084|   172k|    addsub_avx2(bf0[18], bf0[21], bf1 + 18, bf1 + 21, &clamp_lo, &clamp_hi);
 1085|   172k|    addsub_avx2(bf0[19], bf0[20], bf1 + 19, bf1 + 20, &clamp_lo, &clamp_hi);
 1086|   172k|    addsub_avx2(bf0[31], bf0[24], bf1 + 31, bf1 + 24, &clamp_lo, &clamp_hi);
 1087|   172k|    addsub_avx2(bf0[30], bf0[25], bf1 + 30, bf1 + 25, &clamp_lo, &clamp_hi);
 1088|   172k|    addsub_avx2(bf0[29], bf0[26], bf1 + 29, bf1 + 26, &clamp_lo, &clamp_hi);
 1089|   172k|    addsub_avx2(bf0[28], bf0[27], bf1 + 28, bf1 + 27, &clamp_lo, &clamp_hi);
 1090|       |
 1091|       |    // stage 8
 1092|   172k|    addsub_avx2(bf1[0], bf1[15], bf0 + 0, bf0 + 15, &clamp_lo, &clamp_hi);
 1093|   172k|    addsub_avx2(bf1[1], bf1[14], bf0 + 1, bf0 + 14, &clamp_lo, &clamp_hi);
 1094|   172k|    addsub_avx2(bf1[2], bf1[13], bf0 + 2, bf0 + 13, &clamp_lo, &clamp_hi);
 1095|   172k|    addsub_avx2(bf1[3], bf1[12], bf0 + 3, bf0 + 12, &clamp_lo, &clamp_hi);
 1096|   172k|    addsub_avx2(bf1[4], bf1[11], bf0 + 4, bf0 + 11, &clamp_lo, &clamp_hi);
 1097|   172k|    addsub_avx2(bf1[5], bf1[10], bf0 + 5, bf0 + 10, &clamp_lo, &clamp_hi);
 1098|   172k|    addsub_avx2(bf1[6], bf1[9], bf0 + 6, bf0 + 9, &clamp_lo, &clamp_hi);
 1099|   172k|    addsub_avx2(bf1[7], bf1[8], bf0 + 7, bf0 + 8, &clamp_lo, &clamp_hi);
 1100|   172k|    bf0[16] = bf1[16];
 1101|   172k|    bf0[17] = bf1[17];
 1102|   172k|    bf0[18] = bf1[18];
 1103|   172k|    bf0[19] = bf1[19];
 1104|   172k|    bf0[20] =
 1105|   172k|        half_btf_avx2(&cospim32, &bf1[20], &cospi32, &bf1[27], &rounding, bit);
 1106|   172k|    bf0[21] =
 1107|   172k|        half_btf_avx2(&cospim32, &bf1[21], &cospi32, &bf1[26], &rounding, bit);
 1108|   172k|    bf0[22] =
 1109|   172k|        half_btf_avx2(&cospim32, &bf1[22], &cospi32, &bf1[25], &rounding, bit);
 1110|   172k|    bf0[23] =
 1111|   172k|        half_btf_avx2(&cospim32, &bf1[23], &cospi32, &bf1[24], &rounding, bit);
 1112|   172k|    bf0[24] =
 1113|   172k|        half_btf_avx2(&cospi32, &bf1[23], &cospi32, &bf1[24], &rounding, bit);
 1114|   172k|    bf0[25] =
 1115|   172k|        half_btf_avx2(&cospi32, &bf1[22], &cospi32, &bf1[25], &rounding, bit);
 1116|   172k|    bf0[26] =
 1117|   172k|        half_btf_avx2(&cospi32, &bf1[21], &cospi32, &bf1[26], &rounding, bit);
 1118|   172k|    bf0[27] =
 1119|   172k|        half_btf_avx2(&cospi32, &bf1[20], &cospi32, &bf1[27], &rounding, bit);
 1120|   172k|    bf0[28] = bf1[28];
 1121|   172k|    bf0[29] = bf1[29];
 1122|   172k|    bf0[30] = bf1[30];
 1123|   172k|    bf0[31] = bf1[31];
 1124|       |
 1125|       |    // stage 9
 1126|   172k|    addsub_avx2(bf0[0], bf0[31], out + 0, out + 31, &clamp_lo, &clamp_hi);
 1127|   172k|    addsub_avx2(bf0[1], bf0[30], out + 1, out + 30, &clamp_lo, &clamp_hi);
 1128|   172k|    addsub_avx2(bf0[2], bf0[29], out + 2, out + 29, &clamp_lo, &clamp_hi);
 1129|   172k|    addsub_avx2(bf0[3], bf0[28], out + 3, out + 28, &clamp_lo, &clamp_hi);
 1130|   172k|    addsub_avx2(bf0[4], bf0[27], out + 4, out + 27, &clamp_lo, &clamp_hi);
 1131|   172k|    addsub_avx2(bf0[5], bf0[26], out + 5, out + 26, &clamp_lo, &clamp_hi);
 1132|   172k|    addsub_avx2(bf0[6], bf0[25], out + 6, out + 25, &clamp_lo, &clamp_hi);
 1133|   172k|    addsub_avx2(bf0[7], bf0[24], out + 7, out + 24, &clamp_lo, &clamp_hi);
 1134|   172k|    addsub_avx2(bf0[8], bf0[23], out + 8, out + 23, &clamp_lo, &clamp_hi);
 1135|   172k|    addsub_avx2(bf0[9], bf0[22], out + 9, out + 22, &clamp_lo, &clamp_hi);
 1136|   172k|    addsub_avx2(bf0[10], bf0[21], out + 10, out + 21, &clamp_lo, &clamp_hi);
 1137|   172k|    addsub_avx2(bf0[11], bf0[20], out + 11, out + 20, &clamp_lo, &clamp_hi);
 1138|   172k|    addsub_avx2(bf0[12], bf0[19], out + 12, out + 19, &clamp_lo, &clamp_hi);
 1139|   172k|    addsub_avx2(bf0[13], bf0[18], out + 13, out + 18, &clamp_lo, &clamp_hi);
 1140|   172k|    addsub_avx2(bf0[14], bf0[17], out + 14, out + 17, &clamp_lo, &clamp_hi);
 1141|   172k|    addsub_avx2(bf0[15], bf0[16], out + 15, out + 16, &clamp_lo, &clamp_hi);
 1142|   172k|    if (!do_cols) {
  ------------------
  |  Branch (1142:9): [True: 88.8k, False: 83.2k]
  ------------------
 1143|  88.8k|      const int log_range_out = get_log_range_out(bd);
 1144|  88.8k|      const __m256i clamp_lo_out =
 1145|  88.8k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 1146|  88.8k|      const __m256i clamp_hi_out =
 1147|  88.8k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 1148|  88.8k|      round_shift_8x8_avx2(out, out_shift);
 1149|  88.8k|      round_shift_8x8_avx2(out + 16, out_shift);
 1150|  88.8k|      highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 32);
 1151|  88.8k|    }
 1152|   172k|  }
 1153|   172k|}
highbd_inv_txfm_avx2.c:idct64_low1_avx2:
 2959|  1.82k|                             int bd, int out_shift) {
 2960|  1.82k|  const int32_t *cospi = cospi_arr(bit);
 2961|  1.82k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 2962|  1.82k|  const int log_range = get_log_range(bd, do_cols);
 2963|  1.82k|  __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 2964|  1.82k|  __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 2965|       |
 2966|  1.82k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 2967|       |
 2968|  1.82k|  {
 2969|  1.82k|    __m256i x;
 2970|       |
 2971|       |    // stage 1
 2972|       |    // stage 2
 2973|       |    // stage 3
 2974|       |    // stage 4
 2975|       |    // stage 5
 2976|       |    // stage 6
 2977|  1.82k|    x = half_btf_0_avx2(&cospi32, &in[0], &rnding, bit);
 2978|       |
 2979|       |    // stage 8
 2980|       |    // stage 9
 2981|       |    // stage 10
 2982|       |    // stage 11
 2983|  1.82k|    if (!do_cols) {
  ------------------
  |  Branch (2983:9): [True: 318, False: 1.50k]
  ------------------
 2984|    318|      const int log_range_out = get_log_range_out(bd);
 2985|    318|      clamp_lo = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2986|    318|      clamp_hi = _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2987|    318|      if (out_shift != 0) {
  ------------------
  |  Branch (2987:11): [True: 318, False: 0]
  ------------------
 2988|    318|        __m256i offset = _mm256_set1_epi32((1 << out_shift) >> 1);
 2989|    318|        x = _mm256_add_epi32(x, offset);
 2990|    318|        x = _mm256_sra_epi32(x, _mm_cvtsi32_si128(out_shift));
 2991|    318|      }
 2992|    318|    }
 2993|  1.82k|    x = _mm256_max_epi32(x, clamp_lo);
 2994|  1.82k|    x = _mm256_min_epi32(x, clamp_hi);
 2995|  1.82k|    out[0] = x;
 2996|  1.82k|    out[1] = x;
 2997|  1.82k|    out[2] = x;
 2998|  1.82k|    out[3] = x;
 2999|  1.82k|    out[4] = x;
 3000|  1.82k|    out[5] = x;
 3001|  1.82k|    out[6] = x;
 3002|  1.82k|    out[7] = x;
 3003|  1.82k|    out[8] = x;
 3004|  1.82k|    out[9] = x;
 3005|  1.82k|    out[10] = x;
 3006|  1.82k|    out[11] = x;
 3007|  1.82k|    out[12] = x;
 3008|  1.82k|    out[13] = x;
 3009|  1.82k|    out[14] = x;
 3010|  1.82k|    out[15] = x;
 3011|  1.82k|    out[16] = x;
 3012|  1.82k|    out[17] = x;
 3013|  1.82k|    out[18] = x;
 3014|  1.82k|    out[19] = x;
 3015|  1.82k|    out[20] = x;
 3016|  1.82k|    out[21] = x;
 3017|  1.82k|    out[22] = x;
 3018|  1.82k|    out[23] = x;
 3019|  1.82k|    out[24] = x;
 3020|  1.82k|    out[25] = x;
 3021|  1.82k|    out[26] = x;
 3022|  1.82k|    out[27] = x;
 3023|  1.82k|    out[28] = x;
 3024|  1.82k|    out[29] = x;
 3025|  1.82k|    out[30] = x;
 3026|  1.82k|    out[31] = x;
 3027|  1.82k|    out[32] = x;
 3028|  1.82k|    out[33] = x;
 3029|  1.82k|    out[34] = x;
 3030|  1.82k|    out[35] = x;
 3031|  1.82k|    out[36] = x;
 3032|  1.82k|    out[37] = x;
 3033|  1.82k|    out[38] = x;
 3034|  1.82k|    out[39] = x;
 3035|  1.82k|    out[40] = x;
 3036|  1.82k|    out[41] = x;
 3037|  1.82k|    out[42] = x;
 3038|  1.82k|    out[43] = x;
 3039|  1.82k|    out[44] = x;
 3040|  1.82k|    out[45] = x;
 3041|  1.82k|    out[46] = x;
 3042|  1.82k|    out[47] = x;
 3043|  1.82k|    out[48] = x;
 3044|  1.82k|    out[49] = x;
 3045|  1.82k|    out[50] = x;
 3046|  1.82k|    out[51] = x;
 3047|  1.82k|    out[52] = x;
 3048|  1.82k|    out[53] = x;
 3049|  1.82k|    out[54] = x;
 3050|  1.82k|    out[55] = x;
 3051|  1.82k|    out[56] = x;
 3052|  1.82k|    out[57] = x;
 3053|  1.82k|    out[58] = x;
 3054|  1.82k|    out[59] = x;
 3055|  1.82k|    out[60] = x;
 3056|  1.82k|    out[61] = x;
 3057|  1.82k|    out[62] = x;
 3058|  1.82k|    out[63] = x;
 3059|  1.82k|  }
 3060|  1.82k|}
highbd_inv_txfm_avx2.c:idct64_low8_avx2:
 3062|     20|                             int bd, int out_shift) {
 3063|     20|  int i, j;
 3064|     20|  const int32_t *cospi = cospi_arr(bit);
 3065|     20|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 3066|     20|  const int log_range = get_log_range(bd, do_cols);
 3067|     20|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 3068|     20|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 3069|       |
 3070|     20|  const __m256i cospi1 = _mm256_set1_epi32(cospi[1]);
 3071|     20|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 3072|     20|  const __m256i cospi3 = _mm256_set1_epi32(cospi[3]);
 3073|     20|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 3074|     20|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 3075|     20|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 3076|     20|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 3077|     20|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 3078|     20|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 3079|     20|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 3080|     20|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 3081|     20|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 3082|     20|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 3083|     20|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 3084|     20|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 3085|     20|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 3086|     20|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 3087|     20|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
 3088|     20|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 3089|     20|  const __m256i cospim12 = _mm256_set1_epi32(-cospi[12]);
 3090|     20|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 3091|     20|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
 3092|     20|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 3093|     20|  const __m256i cospim28 = _mm256_set1_epi32(-cospi[28]);
 3094|     20|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
 3095|     20|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
 3096|     20|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 3097|     20|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 3098|     20|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
 3099|     20|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 3100|     20|  const __m256i cospi63 = _mm256_set1_epi32(cospi[63]);
 3101|     20|  const __m256i cospim57 = _mm256_set1_epi32(-cospi[57]);
 3102|     20|  const __m256i cospi7 = _mm256_set1_epi32(cospi[7]);
 3103|     20|  const __m256i cospi5 = _mm256_set1_epi32(cospi[5]);
 3104|     20|  const __m256i cospi59 = _mm256_set1_epi32(cospi[59]);
 3105|     20|  const __m256i cospim61 = _mm256_set1_epi32(-cospi[61]);
 3106|     20|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
 3107|     20|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 3108|       |
 3109|     20|  {
 3110|     20|    __m256i u[64];
 3111|       |
 3112|       |    // stage 1
 3113|     20|    u[0] = in[0];
 3114|     20|    u[8] = in[4];
 3115|     20|    u[16] = in[2];
 3116|     20|    u[24] = in[6];
 3117|     20|    u[32] = in[1];
 3118|     20|    u[40] = in[5];
 3119|     20|    u[48] = in[3];
 3120|     20|    u[56] = in[7];
 3121|       |
 3122|       |    // stage 2
 3123|     20|    u[63] = half_btf_0_avx2(&cospi1, &u[32], &rnding, bit);
 3124|     20|    u[32] = half_btf_0_avx2(&cospi63, &u[32], &rnding, bit);
 3125|     20|    u[39] = half_btf_0_avx2(&cospim57, &u[56], &rnding, bit);
 3126|     20|    u[56] = half_btf_0_avx2(&cospi7, &u[56], &rnding, bit);
 3127|     20|    u[55] = half_btf_0_avx2(&cospi5, &u[40], &rnding, bit);
 3128|     20|    u[40] = half_btf_0_avx2(&cospi59, &u[40], &rnding, bit);
 3129|     20|    u[47] = half_btf_0_avx2(&cospim61, &u[48], &rnding, bit);
 3130|     20|    u[48] = half_btf_0_avx2(&cospi3, &u[48], &rnding, bit);
 3131|       |
 3132|       |    // stage 3
 3133|     20|    u[31] = half_btf_0_avx2(&cospi2, &u[16], &rnding, bit);
 3134|     20|    u[16] = half_btf_0_avx2(&cospi62, &u[16], &rnding, bit);
 3135|     20|    u[23] = half_btf_0_avx2(&cospim58, &u[24], &rnding, bit);
 3136|     20|    u[24] = half_btf_0_avx2(&cospi6, &u[24], &rnding, bit);
 3137|     20|    u[33] = u[32];
 3138|     20|    u[38] = u[39];
 3139|     20|    u[41] = u[40];
 3140|     20|    u[46] = u[47];
 3141|     20|    u[49] = u[48];
 3142|     20|    u[54] = u[55];
 3143|     20|    u[57] = u[56];
 3144|     20|    u[62] = u[63];
 3145|       |
 3146|       |    // stage 4
 3147|     20|    __m256i temp1, temp2;
 3148|     20|    u[15] = half_btf_0_avx2(&cospi4, &u[8], &rnding, bit);
 3149|     20|    u[8] = half_btf_0_avx2(&cospi60, &u[8], &rnding, bit);
 3150|     20|    u[17] = u[16];
 3151|     20|    u[22] = u[23];
 3152|     20|    u[25] = u[24];
 3153|     20|    u[30] = u[31];
 3154|       |
 3155|     20|    temp1 = half_btf_avx2(&cospim4, &u[33], &cospi60, &u[62], &rnding, bit);
 3156|     20|    u[62] = half_btf_avx2(&cospi60, &u[33], &cospi4, &u[62], &rnding, bit);
 3157|     20|    u[33] = temp1;
 3158|       |
 3159|     20|    temp2 = half_btf_avx2(&cospim36, &u[38], &cospi28, &u[57], &rnding, bit);
 3160|     20|    u[38] = half_btf_avx2(&cospim28, &u[38], &cospim36, &u[57], &rnding, bit);
 3161|     20|    u[57] = temp2;
 3162|       |
 3163|     20|    temp1 = half_btf_avx2(&cospim20, &u[41], &cospi44, &u[54], &rnding, bit);
 3164|     20|    u[54] = half_btf_avx2(&cospi44, &u[41], &cospi20, &u[54], &rnding, bit);
 3165|     20|    u[41] = temp1;
 3166|       |
 3167|     20|    temp2 = half_btf_avx2(&cospim12, &u[46], &cospim52, &u[49], &rnding, bit);
 3168|     20|    u[49] = half_btf_avx2(&cospim52, &u[46], &cospi12, &u[49], &rnding, bit);
 3169|     20|    u[46] = temp2;
 3170|       |
 3171|       |    // stage 5
 3172|     20|    u[9] = u[8];
 3173|     20|    u[14] = u[15];
 3174|       |
 3175|     20|    temp1 = half_btf_avx2(&cospim8, &u[17], &cospi56, &u[30], &rnding, bit);
 3176|     20|    u[30] = half_btf_avx2(&cospi56, &u[17], &cospi8, &u[30], &rnding, bit);
 3177|     20|    u[17] = temp1;
 3178|       |
 3179|     20|    temp2 = half_btf_avx2(&cospim24, &u[22], &cospim40, &u[25], &rnding, bit);
 3180|     20|    u[25] = half_btf_avx2(&cospim40, &u[22], &cospi24, &u[25], &rnding, bit);
 3181|     20|    u[22] = temp2;
 3182|       |
 3183|     20|    u[35] = u[32];
 3184|     20|    u[34] = u[33];
 3185|     20|    u[36] = u[39];
 3186|     20|    u[37] = u[38];
 3187|     20|    u[43] = u[40];
 3188|     20|    u[42] = u[41];
 3189|     20|    u[44] = u[47];
 3190|     20|    u[45] = u[46];
 3191|     20|    u[51] = u[48];
 3192|     20|    u[50] = u[49];
 3193|     20|    u[52] = u[55];
 3194|     20|    u[53] = u[54];
 3195|     20|    u[59] = u[56];
 3196|     20|    u[58] = u[57];
 3197|     20|    u[60] = u[63];
 3198|     20|    u[61] = u[62];
 3199|       |
 3200|       |    // stage 6
 3201|     20|    temp1 = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3202|     20|    u[1] = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3203|     20|    u[0] = temp1;
 3204|       |
 3205|     20|    temp2 = half_btf_avx2(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 3206|     20|    u[14] = half_btf_avx2(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 3207|     20|    u[9] = temp2;
 3208|     20|    u[19] = u[16];
 3209|     20|    u[18] = u[17];
 3210|     20|    u[20] = u[23];
 3211|     20|    u[21] = u[22];
 3212|     20|    u[27] = u[24];
 3213|     20|    u[26] = u[25];
 3214|     20|    u[28] = u[31];
 3215|     20|    u[29] = u[30];
 3216|       |
 3217|     20|    temp1 = half_btf_avx2(&cospim8, &u[34], &cospi56, &u[61], &rnding, bit);
 3218|     20|    u[61] = half_btf_avx2(&cospi56, &u[34], &cospi8, &u[61], &rnding, bit);
 3219|     20|    u[34] = temp1;
 3220|     20|    temp2 = half_btf_avx2(&cospim8, &u[35], &cospi56, &u[60], &rnding, bit);
 3221|     20|    u[60] = half_btf_avx2(&cospi56, &u[35], &cospi8, &u[60], &rnding, bit);
 3222|     20|    u[35] = temp2;
 3223|     20|    temp1 = half_btf_avx2(&cospim56, &u[36], &cospim8, &u[59], &rnding, bit);
 3224|     20|    u[59] = half_btf_avx2(&cospim8, &u[36], &cospi56, &u[59], &rnding, bit);
 3225|     20|    u[36] = temp1;
 3226|     20|    temp2 = half_btf_avx2(&cospim56, &u[37], &cospim8, &u[58], &rnding, bit);
 3227|     20|    u[58] = half_btf_avx2(&cospim8, &u[37], &cospi56, &u[58], &rnding, bit);
 3228|     20|    u[37] = temp2;
 3229|     20|    temp1 = half_btf_avx2(&cospim40, &u[42], &cospi24, &u[53], &rnding, bit);
 3230|     20|    u[53] = half_btf_avx2(&cospi24, &u[42], &cospi40, &u[53], &rnding, bit);
 3231|     20|    u[42] = temp1;
 3232|     20|    temp2 = half_btf_avx2(&cospim40, &u[43], &cospi24, &u[52], &rnding, bit);
 3233|     20|    u[52] = half_btf_avx2(&cospi24, &u[43], &cospi40, &u[52], &rnding, bit);
 3234|     20|    u[43] = temp2;
 3235|     20|    temp1 = half_btf_avx2(&cospim24, &u[44], &cospim40, &u[51], &rnding, bit);
 3236|     20|    u[51] = half_btf_avx2(&cospim40, &u[44], &cospi24, &u[51], &rnding, bit);
 3237|     20|    u[44] = temp1;
 3238|     20|    temp2 = half_btf_avx2(&cospim24, &u[45], &cospim40, &u[50], &rnding, bit);
 3239|     20|    u[50] = half_btf_avx2(&cospim40, &u[45], &cospi24, &u[50], &rnding, bit);
 3240|     20|    u[45] = temp2;
 3241|       |
 3242|       |    // stage 7
 3243|     20|    u[3] = u[0];
 3244|     20|    u[2] = u[1];
 3245|     20|    u[11] = u[8];
 3246|     20|    u[10] = u[9];
 3247|     20|    u[12] = u[15];
 3248|     20|    u[13] = u[14];
 3249|       |
 3250|     20|    temp1 = half_btf_avx2(&cospim16, &u[18], &cospi48, &u[29], &rnding, bit);
 3251|     20|    u[29] = half_btf_avx2(&cospi48, &u[18], &cospi16, &u[29], &rnding, bit);
 3252|     20|    u[18] = temp1;
 3253|     20|    temp2 = half_btf_avx2(&cospim16, &u[19], &cospi48, &u[28], &rnding, bit);
 3254|     20|    u[28] = half_btf_avx2(&cospi48, &u[19], &cospi16, &u[28], &rnding, bit);
 3255|     20|    u[19] = temp2;
 3256|     20|    temp1 = half_btf_avx2(&cospim48, &u[20], &cospim16, &u[27], &rnding, bit);
 3257|     20|    u[27] = half_btf_avx2(&cospim16, &u[20], &cospi48, &u[27], &rnding, bit);
 3258|     20|    u[20] = temp1;
 3259|     20|    temp2 = half_btf_avx2(&cospim48, &u[21], &cospim16, &u[26], &rnding, bit);
 3260|     20|    u[26] = half_btf_avx2(&cospim16, &u[21], &cospi48, &u[26], &rnding, bit);
 3261|     20|    u[21] = temp2;
 3262|     60|    for (i = 32; i < 64; i += 16) {
  ------------------
  |  Branch (3262:18): [True: 40, False: 20]
  ------------------
 3263|    200|      for (j = i; j < i + 4; j++) {
  ------------------
  |  Branch (3263:19): [True: 160, False: 40]
  ------------------
 3264|    160|        addsub_avx2(u[j], u[j ^ 7], &u[j], &u[j ^ 7], &clamp_lo, &clamp_hi);
 3265|    160|        addsub_avx2(u[j ^ 15], u[j ^ 8], &u[j ^ 15], &u[j ^ 8], &clamp_lo,
 3266|    160|                    &clamp_hi);
 3267|    160|      }
 3268|     40|    }
 3269|       |
 3270|       |    // stage 8
 3271|     20|    u[7] = u[0];
 3272|     20|    u[6] = u[1];
 3273|     20|    u[5] = u[2];
 3274|     20|    u[4] = u[3];
 3275|       |
 3276|     20|    idct64_stage8_avx2(u, &cospim32, &cospi32, &cospim16, &cospi48, &cospi16,
 3277|     20|                       &cospim48, &clamp_lo, &clamp_hi, &rnding, bit);
 3278|       |
 3279|       |    // stage 9
 3280|     20|    idct64_stage9_avx2(u, &cospim32, &cospi32, &clamp_lo, &clamp_hi, &rnding,
 3281|     20|                       bit);
 3282|       |
 3283|       |    // stage 10
 3284|     20|    idct64_stage10_avx2(u, &cospim32, &cospi32, &clamp_lo, &clamp_hi, &rnding,
 3285|     20|                        bit);
 3286|       |
 3287|       |    // stage 11
 3288|     20|    idct64_stage11_avx2(u, out, do_cols, bd, out_shift, &clamp_lo, &clamp_hi);
 3289|     20|  }
 3290|     20|}
highbd_inv_txfm_avx2.c:idct64_stage8_avx2:
 2825|    270|    const __m256i *rnding, int bit) {
 2826|    270|  int i;
 2827|    270|  __m256i temp1, temp2, temp3, temp4;
 2828|    270|  temp1 = half_btf_avx2(cospim32, &u[10], cospi32, &u[13], rnding, bit);
 2829|    270|  u[13] = half_btf_avx2(cospi32, &u[10], cospi32, &u[13], rnding, bit);
 2830|    270|  u[10] = temp1;
 2831|    270|  temp2 = half_btf_avx2(cospim32, &u[11], cospi32, &u[12], rnding, bit);
 2832|    270|  u[12] = half_btf_avx2(cospi32, &u[11], cospi32, &u[12], rnding, bit);
 2833|    270|  u[11] = temp2;
 2834|       |
 2835|  1.35k|  for (i = 16; i < 20; ++i) {
  ------------------
  |  Branch (2835:16): [True: 1.08k, False: 270]
  ------------------
 2836|  1.08k|    addsub_avx2(u[i], u[i ^ 7], &u[i], &u[i ^ 7], clamp_lo, clamp_hi);
 2837|  1.08k|    addsub_avx2(u[i ^ 15], u[i ^ 8], &u[i ^ 15], &u[i ^ 8], clamp_lo, clamp_hi);
 2838|  1.08k|  }
 2839|       |
 2840|    270|  temp1 = half_btf_avx2(cospim16, &u[36], cospi48, &u[59], rnding, bit);
 2841|    270|  temp2 = half_btf_avx2(cospim16, &u[37], cospi48, &u[58], rnding, bit);
 2842|    270|  temp3 = half_btf_avx2(cospim16, &u[38], cospi48, &u[57], rnding, bit);
 2843|    270|  temp4 = half_btf_avx2(cospim16, &u[39], cospi48, &u[56], rnding, bit);
 2844|    270|  u[56] = half_btf_avx2(cospi48, &u[39], cospi16, &u[56], rnding, bit);
 2845|    270|  u[57] = half_btf_avx2(cospi48, &u[38], cospi16, &u[57], rnding, bit);
 2846|    270|  u[58] = half_btf_avx2(cospi48, &u[37], cospi16, &u[58], rnding, bit);
 2847|    270|  u[59] = half_btf_avx2(cospi48, &u[36], cospi16, &u[59], rnding, bit);
 2848|    270|  u[36] = temp1;
 2849|    270|  u[37] = temp2;
 2850|    270|  u[38] = temp3;
 2851|    270|  u[39] = temp4;
 2852|       |
 2853|    270|  temp1 = half_btf_avx2(cospim48, &u[40], cospim16, &u[55], rnding, bit);
 2854|    270|  temp2 = half_btf_avx2(cospim48, &u[41], cospim16, &u[54], rnding, bit);
 2855|    270|  temp3 = half_btf_avx2(cospim48, &u[42], cospim16, &u[53], rnding, bit);
 2856|    270|  temp4 = half_btf_avx2(cospim48, &u[43], cospim16, &u[52], rnding, bit);
 2857|    270|  u[52] = half_btf_avx2(cospim16, &u[43], cospi48, &u[52], rnding, bit);
 2858|    270|  u[53] = half_btf_avx2(cospim16, &u[42], cospi48, &u[53], rnding, bit);
 2859|    270|  u[54] = half_btf_avx2(cospim16, &u[41], cospi48, &u[54], rnding, bit);
 2860|    270|  u[55] = half_btf_avx2(cospim16, &u[40], cospi48, &u[55], rnding, bit);
 2861|    270|  u[40] = temp1;
 2862|    270|  u[41] = temp2;
 2863|    270|  u[42] = temp3;
 2864|    270|  u[43] = temp4;
 2865|    270|}
highbd_inv_txfm_avx2.c:idct64_stage9_avx2:
 2871|    270|                                      const __m256i *rnding, int bit) {
 2872|    270|  int i;
 2873|    270|  __m256i temp1, temp2, temp3, temp4;
 2874|  2.43k|  for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (2874:15): [True: 2.16k, False: 270]
  ------------------
 2875|  2.16k|    addsub_avx2(u[i], u[15 - i], &u[i], &u[15 - i], clamp_lo, clamp_hi);
 2876|  2.16k|  }
 2877|       |
 2878|    270|  temp1 = half_btf_avx2(cospim32, &u[20], cospi32, &u[27], rnding, bit);
 2879|    270|  temp2 = half_btf_avx2(cospim32, &u[21], cospi32, &u[26], rnding, bit);
 2880|    270|  temp3 = half_btf_avx2(cospim32, &u[22], cospi32, &u[25], rnding, bit);
 2881|    270|  temp4 = half_btf_avx2(cospim32, &u[23], cospi32, &u[24], rnding, bit);
 2882|    270|  u[24] = half_btf_avx2(cospi32, &u[23], cospi32, &u[24], rnding, bit);
 2883|    270|  u[25] = half_btf_avx2(cospi32, &u[22], cospi32, &u[25], rnding, bit);
 2884|    270|  u[26] = half_btf_avx2(cospi32, &u[21], cospi32, &u[26], rnding, bit);
 2885|    270|  u[27] = half_btf_avx2(cospi32, &u[20], cospi32, &u[27], rnding, bit);
 2886|    270|  u[20] = temp1;
 2887|    270|  u[21] = temp2;
 2888|    270|  u[22] = temp3;
 2889|    270|  u[23] = temp4;
 2890|  2.43k|  for (i = 32; i < 40; i++) {
  ------------------
  |  Branch (2890:16): [True: 2.16k, False: 270]
  ------------------
 2891|  2.16k|    addsub_avx2(u[i], u[i ^ 15], &u[i], &u[i ^ 15], clamp_lo, clamp_hi);
 2892|  2.16k|  }
 2893|       |
 2894|  2.43k|  for (i = 48; i < 56; i++) {
  ------------------
  |  Branch (2894:16): [True: 2.16k, False: 270]
  ------------------
 2895|  2.16k|    addsub_avx2(u[i ^ 15], u[i], &u[i ^ 15], &u[i], clamp_lo, clamp_hi);
 2896|  2.16k|  }
 2897|    270|}
highbd_inv_txfm_avx2.c:idct64_stage10_avx2:
 2903|    270|                                       const __m256i *rnding, int bit) {
 2904|    270|  __m256i temp1, temp2, temp3, temp4;
 2905|  4.59k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (2905:19): [True: 4.32k, False: 270]
  ------------------
 2906|  4.32k|    addsub_avx2(u[i], u[31 - i], &u[i], &u[31 - i], clamp_lo, clamp_hi);
 2907|  4.32k|  }
 2908|       |
 2909|    270|  temp1 = half_btf_avx2(cospim32, &u[40], cospi32, &u[55], rnding, bit);
 2910|    270|  temp2 = half_btf_avx2(cospim32, &u[41], cospi32, &u[54], rnding, bit);
 2911|    270|  temp3 = half_btf_avx2(cospim32, &u[42], cospi32, &u[53], rnding, bit);
 2912|    270|  temp4 = half_btf_avx2(cospim32, &u[43], cospi32, &u[52], rnding, bit);
 2913|    270|  u[52] = half_btf_avx2(cospi32, &u[43], cospi32, &u[52], rnding, bit);
 2914|    270|  u[53] = half_btf_avx2(cospi32, &u[42], cospi32, &u[53], rnding, bit);
 2915|    270|  u[54] = half_btf_avx2(cospi32, &u[41], cospi32, &u[54], rnding, bit);
 2916|    270|  u[55] = half_btf_avx2(cospi32, &u[40], cospi32, &u[55], rnding, bit);
 2917|    270|  u[40] = temp1;
 2918|    270|  u[41] = temp2;
 2919|    270|  u[42] = temp3;
 2920|    270|  u[43] = temp4;
 2921|       |
 2922|    270|  temp1 = half_btf_avx2(cospim32, &u[44], cospi32, &u[51], rnding, bit);
 2923|    270|  temp2 = half_btf_avx2(cospim32, &u[45], cospi32, &u[50], rnding, bit);
 2924|    270|  temp3 = half_btf_avx2(cospim32, &u[46], cospi32, &u[49], rnding, bit);
 2925|    270|  temp4 = half_btf_avx2(cospim32, &u[47], cospi32, &u[48], rnding, bit);
 2926|    270|  u[48] = half_btf_avx2(cospi32, &u[47], cospi32, &u[48], rnding, bit);
 2927|    270|  u[49] = half_btf_avx2(cospi32, &u[46], cospi32, &u[49], rnding, bit);
 2928|    270|  u[50] = half_btf_avx2(cospi32, &u[45], cospi32, &u[50], rnding, bit);
 2929|    270|  u[51] = half_btf_avx2(cospi32, &u[44], cospi32, &u[51], rnding, bit);
 2930|    270|  u[44] = temp1;
 2931|    270|  u[45] = temp2;
 2932|    270|  u[46] = temp3;
 2933|    270|  u[47] = temp4;
 2934|    270|}
highbd_inv_txfm_avx2.c:idct64_stage11_avx2:
 2939|    270|                                       const __m256i *clamp_hi) {
 2940|  8.91k|  for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (2940:19): [True: 8.64k, False: 270]
  ------------------
 2941|  8.64k|    addsub_avx2(u[i], u[63 - i], &out[(i)], &out[(63 - i)], clamp_lo, clamp_hi);
 2942|  8.64k|  }
 2943|       |
 2944|    270|  if (!do_cols) {
  ------------------
  |  Branch (2944:7): [True: 154, False: 116]
  ------------------
 2945|    154|    const int log_range_out = get_log_range_out(bd);
 2946|    154|    const __m256i clamp_lo_out = _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 2947|    154|    const __m256i clamp_hi_out =
 2948|    154|        _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 2949|       |
 2950|    154|    round_shift_8x8_avx2(out, out_shift);
 2951|    154|    round_shift_8x8_avx2(out + 16, out_shift);
 2952|    154|    round_shift_8x8_avx2(out + 32, out_shift);
 2953|    154|    round_shift_8x8_avx2(out + 48, out_shift);
 2954|    154|    highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 64);
 2955|    154|  }
 2956|    270|}
highbd_inv_txfm_avx2.c:idct64_low16_avx2:
 3292|    250|                              int bd, int out_shift) {
 3293|    250|  int i, j;
 3294|    250|  const int32_t *cospi = cospi_arr(bit);
 3295|    250|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 3296|    250|  const int log_range = get_log_range(bd, do_cols);
 3297|    250|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 3298|    250|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 3299|       |
 3300|    250|  const __m256i cospi1 = _mm256_set1_epi32(cospi[1]);
 3301|    250|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 3302|    250|  const __m256i cospi3 = _mm256_set1_epi32(cospi[3]);
 3303|    250|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 3304|    250|  const __m256i cospi5 = _mm256_set1_epi32(cospi[5]);
 3305|    250|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 3306|    250|  const __m256i cospi7 = _mm256_set1_epi32(cospi[7]);
 3307|    250|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 3308|    250|  const __m256i cospi9 = _mm256_set1_epi32(cospi[9]);
 3309|    250|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
 3310|    250|  const __m256i cospi11 = _mm256_set1_epi32(cospi[11]);
 3311|    250|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 3312|    250|  const __m256i cospi13 = _mm256_set1_epi32(cospi[13]);
 3313|    250|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
 3314|    250|  const __m256i cospi15 = _mm256_set1_epi32(cospi[15]);
 3315|    250|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 3316|    250|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 3317|    250|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 3318|    250|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 3319|    250|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 3320|    250|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
 3321|    250|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 3322|    250|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 3323|    250|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 3324|    250|  const __m256i cospi51 = _mm256_set1_epi32(cospi[51]);
 3325|    250|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
 3326|    250|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
 3327|    250|  const __m256i cospi55 = _mm256_set1_epi32(cospi[55]);
 3328|    250|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 3329|    250|  const __m256i cospi59 = _mm256_set1_epi32(cospi[59]);
 3330|    250|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 3331|    250|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 3332|    250|  const __m256i cospi63 = _mm256_set1_epi32(cospi[63]);
 3333|       |
 3334|    250|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
 3335|    250|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 3336|    250|  const __m256i cospim12 = _mm256_set1_epi32(-cospi[12]);
 3337|    250|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 3338|    250|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
 3339|    250|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 3340|    250|  const __m256i cospim28 = _mm256_set1_epi32(-cospi[28]);
 3341|    250|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
 3342|    250|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
 3343|    250|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 3344|    250|  const __m256i cospim44 = _mm256_set1_epi32(-cospi[44]);
 3345|    250|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 3346|    250|  const __m256i cospim49 = _mm256_set1_epi32(-cospi[49]);
 3347|    250|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
 3348|    250|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
 3349|    250|  const __m256i cospim53 = _mm256_set1_epi32(-cospi[53]);
 3350|    250|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 3351|    250|  const __m256i cospim57 = _mm256_set1_epi32(-cospi[57]);
 3352|    250|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
 3353|    250|  const __m256i cospim60 = _mm256_set1_epi32(-cospi[60]);
 3354|    250|  const __m256i cospim61 = _mm256_set1_epi32(-cospi[61]);
 3355|       |
 3356|    250|  {
 3357|    250|    __m256i u[64];
 3358|    250|    __m256i tmp1, tmp2, tmp3, tmp4;
 3359|       |    // stage 1
 3360|    250|    u[0] = in[0];
 3361|    250|    u[32] = in[1];
 3362|    250|    u[36] = in[9];
 3363|    250|    u[40] = in[5];
 3364|    250|    u[44] = in[13];
 3365|    250|    u[48] = in[3];
 3366|    250|    u[52] = in[11];
 3367|    250|    u[56] = in[7];
 3368|    250|    u[60] = in[15];
 3369|    250|    u[16] = in[2];
 3370|    250|    u[20] = in[10];
 3371|    250|    u[24] = in[6];
 3372|    250|    u[28] = in[14];
 3373|    250|    u[4] = in[8];
 3374|    250|    u[8] = in[4];
 3375|    250|    u[12] = in[12];
 3376|       |
 3377|       |    // stage 2
 3378|    250|    u[63] = half_btf_0_avx2(&cospi1, &u[32], &rnding, bit);
 3379|    250|    u[32] = half_btf_0_avx2(&cospi63, &u[32], &rnding, bit);
 3380|    250|    u[35] = half_btf_0_avx2(&cospim49, &u[60], &rnding, bit);
 3381|    250|    u[60] = half_btf_0_avx2(&cospi15, &u[60], &rnding, bit);
 3382|    250|    u[59] = half_btf_0_avx2(&cospi9, &u[36], &rnding, bit);
 3383|    250|    u[36] = half_btf_0_avx2(&cospi55, &u[36], &rnding, bit);
 3384|    250|    u[39] = half_btf_0_avx2(&cospim57, &u[56], &rnding, bit);
 3385|    250|    u[56] = half_btf_0_avx2(&cospi7, &u[56], &rnding, bit);
 3386|    250|    u[55] = half_btf_0_avx2(&cospi5, &u[40], &rnding, bit);
 3387|    250|    u[40] = half_btf_0_avx2(&cospi59, &u[40], &rnding, bit);
 3388|    250|    u[43] = half_btf_0_avx2(&cospim53, &u[52], &rnding, bit);
 3389|    250|    u[52] = half_btf_0_avx2(&cospi11, &u[52], &rnding, bit);
 3390|    250|    u[47] = half_btf_0_avx2(&cospim61, &u[48], &rnding, bit);
 3391|    250|    u[48] = half_btf_0_avx2(&cospi3, &u[48], &rnding, bit);
 3392|    250|    u[51] = half_btf_0_avx2(&cospi13, &u[44], &rnding, bit);
 3393|    250|    u[44] = half_btf_0_avx2(&cospi51, &u[44], &rnding, bit);
 3394|       |
 3395|       |    // stage 3
 3396|    250|    u[31] = half_btf_0_avx2(&cospi2, &u[16], &rnding, bit);
 3397|    250|    u[16] = half_btf_0_avx2(&cospi62, &u[16], &rnding, bit);
 3398|    250|    u[19] = half_btf_0_avx2(&cospim50, &u[28], &rnding, bit);
 3399|    250|    u[28] = half_btf_0_avx2(&cospi14, &u[28], &rnding, bit);
 3400|    250|    u[27] = half_btf_0_avx2(&cospi10, &u[20], &rnding, bit);
 3401|    250|    u[20] = half_btf_0_avx2(&cospi54, &u[20], &rnding, bit);
 3402|    250|    u[23] = half_btf_0_avx2(&cospim58, &u[24], &rnding, bit);
 3403|    250|    u[24] = half_btf_0_avx2(&cospi6, &u[24], &rnding, bit);
 3404|    250|    u[33] = u[32];
 3405|    250|    u[34] = u[35];
 3406|    250|    u[37] = u[36];
 3407|    250|    u[38] = u[39];
 3408|    250|    u[41] = u[40];
 3409|    250|    u[42] = u[43];
 3410|    250|    u[45] = u[44];
 3411|    250|    u[46] = u[47];
 3412|    250|    u[49] = u[48];
 3413|    250|    u[50] = u[51];
 3414|    250|    u[53] = u[52];
 3415|    250|    u[54] = u[55];
 3416|    250|    u[57] = u[56];
 3417|    250|    u[58] = u[59];
 3418|    250|    u[61] = u[60];
 3419|    250|    u[62] = u[63];
 3420|       |
 3421|       |    // stage 4
 3422|    250|    u[15] = half_btf_0_avx2(&cospi4, &u[8], &rnding, bit);
 3423|    250|    u[8] = half_btf_0_avx2(&cospi60, &u[8], &rnding, bit);
 3424|    250|    u[11] = half_btf_0_avx2(&cospim52, &u[12], &rnding, bit);
 3425|    250|    u[12] = half_btf_0_avx2(&cospi12, &u[12], &rnding, bit);
 3426|       |
 3427|    250|    u[17] = u[16];
 3428|    250|    u[18] = u[19];
 3429|    250|    u[21] = u[20];
 3430|    250|    u[22] = u[23];
 3431|    250|    u[25] = u[24];
 3432|    250|    u[26] = u[27];
 3433|    250|    u[29] = u[28];
 3434|    250|    u[30] = u[31];
 3435|       |
 3436|    250|    tmp1 = half_btf_avx2(&cospim4, &u[33], &cospi60, &u[62], &rnding, bit);
 3437|    250|    tmp2 = half_btf_avx2(&cospim60, &u[34], &cospim4, &u[61], &rnding, bit);
 3438|    250|    tmp3 = half_btf_avx2(&cospim36, &u[37], &cospi28, &u[58], &rnding, bit);
 3439|    250|    tmp4 = half_btf_avx2(&cospim28, &u[38], &cospim36, &u[57], &rnding, bit);
 3440|    250|    u[57] = half_btf_avx2(&cospim36, &u[38], &cospi28, &u[57], &rnding, bit);
 3441|    250|    u[58] = half_btf_avx2(&cospi28, &u[37], &cospi36, &u[58], &rnding, bit);
 3442|    250|    u[61] = half_btf_avx2(&cospim4, &u[34], &cospi60, &u[61], &rnding, bit);
 3443|    250|    u[62] = half_btf_avx2(&cospi60, &u[33], &cospi4, &u[62], &rnding, bit);
 3444|    250|    u[33] = tmp1;
 3445|    250|    u[34] = tmp2;
 3446|    250|    u[37] = tmp3;
 3447|    250|    u[38] = tmp4;
 3448|       |
 3449|    250|    tmp1 = half_btf_avx2(&cospim20, &u[41], &cospi44, &u[54], &rnding, bit);
 3450|    250|    tmp2 = half_btf_avx2(&cospim44, &u[42], &cospim20, &u[53], &rnding, bit);
 3451|    250|    tmp3 = half_btf_avx2(&cospim52, &u[45], &cospi12, &u[50], &rnding, bit);
 3452|    250|    tmp4 = half_btf_avx2(&cospim12, &u[46], &cospim52, &u[49], &rnding, bit);
 3453|    250|    u[49] = half_btf_avx2(&cospim52, &u[46], &cospi12, &u[49], &rnding, bit);
 3454|    250|    u[50] = half_btf_avx2(&cospi12, &u[45], &cospi52, &u[50], &rnding, bit);
 3455|    250|    u[53] = half_btf_avx2(&cospim20, &u[42], &cospi44, &u[53], &rnding, bit);
 3456|    250|    u[54] = half_btf_avx2(&cospi44, &u[41], &cospi20, &u[54], &rnding, bit);
 3457|    250|    u[41] = tmp1;
 3458|    250|    u[42] = tmp2;
 3459|    250|    u[45] = tmp3;
 3460|    250|    u[46] = tmp4;
 3461|       |
 3462|       |    // stage 5
 3463|    250|    u[7] = half_btf_0_avx2(&cospi8, &u[4], &rnding, bit);
 3464|    250|    u[4] = half_btf_0_avx2(&cospi56, &u[4], &rnding, bit);
 3465|       |
 3466|    250|    u[9] = u[8];
 3467|    250|    u[10] = u[11];
 3468|    250|    u[13] = u[12];
 3469|    250|    u[14] = u[15];
 3470|       |
 3471|    250|    tmp1 = half_btf_avx2(&cospim8, &u[17], &cospi56, &u[30], &rnding, bit);
 3472|    250|    tmp2 = half_btf_avx2(&cospim56, &u[18], &cospim8, &u[29], &rnding, bit);
 3473|    250|    tmp3 = half_btf_avx2(&cospim40, &u[21], &cospi24, &u[26], &rnding, bit);
 3474|    250|    tmp4 = half_btf_avx2(&cospim24, &u[22], &cospim40, &u[25], &rnding, bit);
 3475|    250|    u[25] = half_btf_avx2(&cospim40, &u[22], &cospi24, &u[25], &rnding, bit);
 3476|    250|    u[26] = half_btf_avx2(&cospi24, &u[21], &cospi40, &u[26], &rnding, bit);
 3477|    250|    u[29] = half_btf_avx2(&cospim8, &u[18], &cospi56, &u[29], &rnding, bit);
 3478|    250|    u[30] = half_btf_avx2(&cospi56, &u[17], &cospi8, &u[30], &rnding, bit);
 3479|    250|    u[17] = tmp1;
 3480|    250|    u[18] = tmp2;
 3481|    250|    u[21] = tmp3;
 3482|    250|    u[22] = tmp4;
 3483|       |
 3484|  1.25k|    for (i = 32; i < 64; i += 8) {
  ------------------
  |  Branch (3484:18): [True: 1.00k, False: 250]
  ------------------
 3485|  1.00k|      addsub_avx2(u[i + 0], u[i + 3], &u[i + 0], &u[i + 3], &clamp_lo,
 3486|  1.00k|                  &clamp_hi);
 3487|  1.00k|      addsub_avx2(u[i + 1], u[i + 2], &u[i + 1], &u[i + 2], &clamp_lo,
 3488|  1.00k|                  &clamp_hi);
 3489|       |
 3490|  1.00k|      addsub_avx2(u[i + 7], u[i + 4], &u[i + 7], &u[i + 4], &clamp_lo,
 3491|  1.00k|                  &clamp_hi);
 3492|  1.00k|      addsub_avx2(u[i + 6], u[i + 5], &u[i + 6], &u[i + 5], &clamp_lo,
 3493|  1.00k|                  &clamp_hi);
 3494|  1.00k|    }
 3495|       |
 3496|       |    // stage 6
 3497|    250|    tmp1 = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3498|    250|    u[1] = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3499|    250|    u[0] = tmp1;
 3500|    250|    u[5] = u[4];
 3501|    250|    u[6] = u[7];
 3502|       |
 3503|    250|    tmp1 = half_btf_avx2(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 3504|    250|    u[14] = half_btf_avx2(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 3505|    250|    u[9] = tmp1;
 3506|    250|    tmp2 = half_btf_avx2(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 3507|    250|    u[13] = half_btf_avx2(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 3508|    250|    u[10] = tmp2;
 3509|       |
 3510|    750|    for (i = 16; i < 32; i += 8) {
  ------------------
  |  Branch (3510:18): [True: 500, False: 250]
  ------------------
 3511|    500|      addsub_avx2(u[i + 0], u[i + 3], &u[i + 0], &u[i + 3], &clamp_lo,
 3512|    500|                  &clamp_hi);
 3513|    500|      addsub_avx2(u[i + 1], u[i + 2], &u[i + 1], &u[i + 2], &clamp_lo,
 3514|    500|                  &clamp_hi);
 3515|       |
 3516|    500|      addsub_avx2(u[i + 7], u[i + 4], &u[i + 7], &u[i + 4], &clamp_lo,
 3517|    500|                  &clamp_hi);
 3518|    500|      addsub_avx2(u[i + 6], u[i + 5], &u[i + 6], &u[i + 5], &clamp_lo,
 3519|    500|                  &clamp_hi);
 3520|    500|    }
 3521|       |
 3522|    250|    tmp1 = half_btf_avx2(&cospim8, &u[34], &cospi56, &u[61], &rnding, bit);
 3523|    250|    tmp2 = half_btf_avx2(&cospim8, &u[35], &cospi56, &u[60], &rnding, bit);
 3524|    250|    tmp3 = half_btf_avx2(&cospim56, &u[36], &cospim8, &u[59], &rnding, bit);
 3525|    250|    tmp4 = half_btf_avx2(&cospim56, &u[37], &cospim8, &u[58], &rnding, bit);
 3526|    250|    u[58] = half_btf_avx2(&cospim8, &u[37], &cospi56, &u[58], &rnding, bit);
 3527|    250|    u[59] = half_btf_avx2(&cospim8, &u[36], &cospi56, &u[59], &rnding, bit);
 3528|    250|    u[60] = half_btf_avx2(&cospi56, &u[35], &cospi8, &u[60], &rnding, bit);
 3529|    250|    u[61] = half_btf_avx2(&cospi56, &u[34], &cospi8, &u[61], &rnding, bit);
 3530|    250|    u[34] = tmp1;
 3531|    250|    u[35] = tmp2;
 3532|    250|    u[36] = tmp3;
 3533|    250|    u[37] = tmp4;
 3534|       |
 3535|    250|    tmp1 = half_btf_avx2(&cospim40, &u[42], &cospi24, &u[53], &rnding, bit);
 3536|    250|    tmp2 = half_btf_avx2(&cospim40, &u[43], &cospi24, &u[52], &rnding, bit);
 3537|    250|    tmp3 = half_btf_avx2(&cospim24, &u[44], &cospim40, &u[51], &rnding, bit);
 3538|    250|    tmp4 = half_btf_avx2(&cospim24, &u[45], &cospim40, &u[50], &rnding, bit);
 3539|    250|    u[50] = half_btf_avx2(&cospim40, &u[45], &cospi24, &u[50], &rnding, bit);
 3540|    250|    u[51] = half_btf_avx2(&cospim40, &u[44], &cospi24, &u[51], &rnding, bit);
 3541|    250|    u[52] = half_btf_avx2(&cospi24, &u[43], &cospi40, &u[52], &rnding, bit);
 3542|    250|    u[53] = half_btf_avx2(&cospi24, &u[42], &cospi40, &u[53], &rnding, bit);
 3543|    250|    u[42] = tmp1;
 3544|    250|    u[43] = tmp2;
 3545|    250|    u[44] = tmp3;
 3546|    250|    u[45] = tmp4;
 3547|       |
 3548|       |    // stage 7
 3549|    250|    u[3] = u[0];
 3550|    250|    u[2] = u[1];
 3551|    250|    tmp1 = half_btf_avx2(&cospim32, &u[5], &cospi32, &u[6], &rnding, bit);
 3552|    250|    u[6] = half_btf_avx2(&cospi32, &u[5], &cospi32, &u[6], &rnding, bit);
 3553|    250|    u[5] = tmp1;
 3554|    250|    addsub_avx2(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 3555|    250|    addsub_avx2(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 3556|    250|    addsub_avx2(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 3557|    250|    addsub_avx2(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 3558|       |
 3559|    250|    tmp1 = half_btf_avx2(&cospim16, &u[18], &cospi48, &u[29], &rnding, bit);
 3560|    250|    tmp2 = half_btf_avx2(&cospim16, &u[19], &cospi48, &u[28], &rnding, bit);
 3561|    250|    tmp3 = half_btf_avx2(&cospim48, &u[20], &cospim16, &u[27], &rnding, bit);
 3562|    250|    tmp4 = half_btf_avx2(&cospim48, &u[21], &cospim16, &u[26], &rnding, bit);
 3563|    250|    u[26] = half_btf_avx2(&cospim16, &u[21], &cospi48, &u[26], &rnding, bit);
 3564|    250|    u[27] = half_btf_avx2(&cospim16, &u[20], &cospi48, &u[27], &rnding, bit);
 3565|    250|    u[28] = half_btf_avx2(&cospi48, &u[19], &cospi16, &u[28], &rnding, bit);
 3566|    250|    u[29] = half_btf_avx2(&cospi48, &u[18], &cospi16, &u[29], &rnding, bit);
 3567|    250|    u[18] = tmp1;
 3568|    250|    u[19] = tmp2;
 3569|    250|    u[20] = tmp3;
 3570|    250|    u[21] = tmp4;
 3571|       |
 3572|    750|    for (i = 32; i < 64; i += 16) {
  ------------------
  |  Branch (3572:18): [True: 500, False: 250]
  ------------------
 3573|  2.50k|      for (j = i; j < i + 4; j++) {
  ------------------
  |  Branch (3573:19): [True: 2.00k, False: 500]
  ------------------
 3574|  2.00k|        addsub_avx2(u[j], u[j ^ 7], &u[j], &u[j ^ 7], &clamp_lo, &clamp_hi);
 3575|  2.00k|        addsub_avx2(u[j ^ 15], u[j ^ 8], &u[j ^ 15], &u[j ^ 8], &clamp_lo,
 3576|  2.00k|                    &clamp_hi);
 3577|  2.00k|      }
 3578|    500|    }
 3579|       |
 3580|       |    // stage 8
 3581|  1.25k|    for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (3581:17): [True: 1.00k, False: 250]
  ------------------
 3582|  1.00k|      addsub_avx2(u[i], u[7 - i], &u[i], &u[7 - i], &clamp_lo, &clamp_hi);
 3583|  1.00k|    }
 3584|       |
 3585|    250|    idct64_stage8_avx2(u, &cospim32, &cospi32, &cospim16, &cospi48, &cospi16,
 3586|    250|                       &cospim48, &clamp_lo, &clamp_hi, &rnding, bit);
 3587|       |
 3588|       |    // stage 9
 3589|    250|    idct64_stage9_avx2(u, &cospim32, &cospi32, &clamp_lo, &clamp_hi, &rnding,
 3590|    250|                       bit);
 3591|       |
 3592|       |    // stage 10
 3593|    250|    idct64_stage10_avx2(u, &cospim32, &cospi32, &clamp_lo, &clamp_hi, &rnding,
 3594|    250|                        bit);
 3595|       |
 3596|       |    // stage 11
 3597|    250|    idct64_stage11_avx2(u, out, do_cols, bd, out_shift, &clamp_lo, &clamp_hi);
 3598|    250|  }
 3599|    250|}
highbd_inv_txfm_avx2.c:idct64_avx2:
 3601|  14.9k|                        int out_shift) {
 3602|  14.9k|  int i, j;
 3603|  14.9k|  const int32_t *cospi = cospi_arr(bit);
 3604|  14.9k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 3605|  14.9k|  const int log_range = get_log_range(bd, do_cols);
 3606|  14.9k|  const __m256i clamp_lo = _mm256_set1_epi32(-(1 << (log_range - 1)));
 3607|  14.9k|  const __m256i clamp_hi = _mm256_set1_epi32((1 << (log_range - 1)) - 1);
 3608|       |
 3609|  14.9k|  const __m256i cospi1 = _mm256_set1_epi32(cospi[1]);
 3610|  14.9k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 3611|  14.9k|  const __m256i cospi3 = _mm256_set1_epi32(cospi[3]);
 3612|  14.9k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
 3613|  14.9k|  const __m256i cospi5 = _mm256_set1_epi32(cospi[5]);
 3614|  14.9k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 3615|  14.9k|  const __m256i cospi7 = _mm256_set1_epi32(cospi[7]);
 3616|  14.9k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 3617|  14.9k|  const __m256i cospi9 = _mm256_set1_epi32(cospi[9]);
 3618|  14.9k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
 3619|  14.9k|  const __m256i cospi11 = _mm256_set1_epi32(cospi[11]);
 3620|  14.9k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
 3621|  14.9k|  const __m256i cospi13 = _mm256_set1_epi32(cospi[13]);
 3622|  14.9k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
 3623|  14.9k|  const __m256i cospi15 = _mm256_set1_epi32(cospi[15]);
 3624|  14.9k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 3625|  14.9k|  const __m256i cospi17 = _mm256_set1_epi32(cospi[17]);
 3626|  14.9k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
 3627|  14.9k|  const __m256i cospi19 = _mm256_set1_epi32(cospi[19]);
 3628|  14.9k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
 3629|  14.9k|  const __m256i cospi21 = _mm256_set1_epi32(cospi[21]);
 3630|  14.9k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
 3631|  14.9k|  const __m256i cospi23 = _mm256_set1_epi32(cospi[23]);
 3632|  14.9k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 3633|  14.9k|  const __m256i cospi25 = _mm256_set1_epi32(cospi[25]);
 3634|  14.9k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
 3635|  14.9k|  const __m256i cospi27 = _mm256_set1_epi32(cospi[27]);
 3636|  14.9k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
 3637|  14.9k|  const __m256i cospi29 = _mm256_set1_epi32(cospi[29]);
 3638|  14.9k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
 3639|  14.9k|  const __m256i cospi31 = _mm256_set1_epi32(cospi[31]);
 3640|  14.9k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 3641|  14.9k|  const __m256i cospi35 = _mm256_set1_epi32(cospi[35]);
 3642|  14.9k|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
 3643|  14.9k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
 3644|  14.9k|  const __m256i cospi39 = _mm256_set1_epi32(cospi[39]);
 3645|  14.9k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 3646|  14.9k|  const __m256i cospi43 = _mm256_set1_epi32(cospi[43]);
 3647|  14.9k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
 3648|  14.9k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
 3649|  14.9k|  const __m256i cospi47 = _mm256_set1_epi32(cospi[47]);
 3650|  14.9k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 3651|  14.9k|  const __m256i cospi51 = _mm256_set1_epi32(cospi[51]);
 3652|  14.9k|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
 3653|  14.9k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
 3654|  14.9k|  const __m256i cospi55 = _mm256_set1_epi32(cospi[55]);
 3655|  14.9k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 3656|  14.9k|  const __m256i cospi59 = _mm256_set1_epi32(cospi[59]);
 3657|  14.9k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
 3658|  14.9k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 3659|  14.9k|  const __m256i cospi63 = _mm256_set1_epi32(cospi[63]);
 3660|       |
 3661|  14.9k|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
 3662|  14.9k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 3663|  14.9k|  const __m256i cospim12 = _mm256_set1_epi32(-cospi[12]);
 3664|  14.9k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 3665|  14.9k|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
 3666|  14.9k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 3667|  14.9k|  const __m256i cospim28 = _mm256_set1_epi32(-cospi[28]);
 3668|  14.9k|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
 3669|  14.9k|  const __m256i cospim33 = _mm256_set1_epi32(-cospi[33]);
 3670|  14.9k|  const __m256i cospim34 = _mm256_set1_epi32(-cospi[34]);
 3671|  14.9k|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
 3672|  14.9k|  const __m256i cospim37 = _mm256_set1_epi32(-cospi[37]);
 3673|  14.9k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 3674|  14.9k|  const __m256i cospim41 = _mm256_set1_epi32(-cospi[41]);
 3675|  14.9k|  const __m256i cospim42 = _mm256_set1_epi32(-cospi[42]);
 3676|  14.9k|  const __m256i cospim44 = _mm256_set1_epi32(-cospi[44]);
 3677|  14.9k|  const __m256i cospim45 = _mm256_set1_epi32(-cospi[45]);
 3678|  14.9k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 3679|  14.9k|  const __m256i cospim49 = _mm256_set1_epi32(-cospi[49]);
 3680|  14.9k|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
 3681|  14.9k|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
 3682|  14.9k|  const __m256i cospim53 = _mm256_set1_epi32(-cospi[53]);
 3683|  14.9k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 3684|  14.9k|  const __m256i cospim57 = _mm256_set1_epi32(-cospi[57]);
 3685|  14.9k|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
 3686|  14.9k|  const __m256i cospim60 = _mm256_set1_epi32(-cospi[60]);
 3687|  14.9k|  const __m256i cospim61 = _mm256_set1_epi32(-cospi[61]);
 3688|       |
 3689|  14.9k|  {
 3690|  14.9k|    __m256i u[64], v[64];
 3691|       |
 3692|       |    // stage 1
 3693|  14.9k|    u[32] = in[1];
 3694|  14.9k|    u[34] = in[17];
 3695|  14.9k|    u[36] = in[9];
 3696|  14.9k|    u[38] = in[25];
 3697|  14.9k|    u[40] = in[5];
 3698|  14.9k|    u[42] = in[21];
 3699|  14.9k|    u[44] = in[13];
 3700|  14.9k|    u[46] = in[29];
 3701|  14.9k|    u[48] = in[3];
 3702|  14.9k|    u[50] = in[19];
 3703|  14.9k|    u[52] = in[11];
 3704|  14.9k|    u[54] = in[27];
 3705|  14.9k|    u[56] = in[7];
 3706|  14.9k|    u[58] = in[23];
 3707|  14.9k|    u[60] = in[15];
 3708|  14.9k|    u[62] = in[31];
 3709|       |
 3710|  14.9k|    v[16] = in[2];
 3711|  14.9k|    v[18] = in[18];
 3712|  14.9k|    v[20] = in[10];
 3713|  14.9k|    v[22] = in[26];
 3714|  14.9k|    v[24] = in[6];
 3715|  14.9k|    v[26] = in[22];
 3716|  14.9k|    v[28] = in[14];
 3717|  14.9k|    v[30] = in[30];
 3718|       |
 3719|  14.9k|    u[8] = in[4];
 3720|  14.9k|    u[10] = in[20];
 3721|  14.9k|    u[12] = in[12];
 3722|  14.9k|    u[14] = in[28];
 3723|       |
 3724|  14.9k|    v[4] = in[8];
 3725|  14.9k|    v[6] = in[24];
 3726|       |
 3727|  14.9k|    u[0] = in[0];
 3728|  14.9k|    u[2] = in[16];
 3729|       |
 3730|       |    // stage 2
 3731|  14.9k|    v[32] = half_btf_0_avx2(&cospi63, &u[32], &rnding, bit);
 3732|  14.9k|    v[33] = half_btf_0_avx2(&cospim33, &u[62], &rnding, bit);
 3733|  14.9k|    v[34] = half_btf_0_avx2(&cospi47, &u[34], &rnding, bit);
 3734|  14.9k|    v[35] = half_btf_0_avx2(&cospim49, &u[60], &rnding, bit);
 3735|  14.9k|    v[36] = half_btf_0_avx2(&cospi55, &u[36], &rnding, bit);
 3736|  14.9k|    v[37] = half_btf_0_avx2(&cospim41, &u[58], &rnding, bit);
 3737|  14.9k|    v[38] = half_btf_0_avx2(&cospi39, &u[38], &rnding, bit);
 3738|  14.9k|    v[39] = half_btf_0_avx2(&cospim57, &u[56], &rnding, bit);
 3739|  14.9k|    v[40] = half_btf_0_avx2(&cospi59, &u[40], &rnding, bit);
 3740|  14.9k|    v[41] = half_btf_0_avx2(&cospim37, &u[54], &rnding, bit);
 3741|  14.9k|    v[42] = half_btf_0_avx2(&cospi43, &u[42], &rnding, bit);
 3742|  14.9k|    v[43] = half_btf_0_avx2(&cospim53, &u[52], &rnding, bit);
 3743|  14.9k|    v[44] = half_btf_0_avx2(&cospi51, &u[44], &rnding, bit);
 3744|  14.9k|    v[45] = half_btf_0_avx2(&cospim45, &u[50], &rnding, bit);
 3745|  14.9k|    v[46] = half_btf_0_avx2(&cospi35, &u[46], &rnding, bit);
 3746|  14.9k|    v[47] = half_btf_0_avx2(&cospim61, &u[48], &rnding, bit);
 3747|  14.9k|    v[48] = half_btf_0_avx2(&cospi3, &u[48], &rnding, bit);
 3748|  14.9k|    v[49] = half_btf_0_avx2(&cospi29, &u[46], &rnding, bit);
 3749|  14.9k|    v[50] = half_btf_0_avx2(&cospi19, &u[50], &rnding, bit);
 3750|  14.9k|    v[51] = half_btf_0_avx2(&cospi13, &u[44], &rnding, bit);
 3751|  14.9k|    v[52] = half_btf_0_avx2(&cospi11, &u[52], &rnding, bit);
 3752|  14.9k|    v[53] = half_btf_0_avx2(&cospi21, &u[42], &rnding, bit);
 3753|  14.9k|    v[54] = half_btf_0_avx2(&cospi27, &u[54], &rnding, bit);
 3754|  14.9k|    v[55] = half_btf_0_avx2(&cospi5, &u[40], &rnding, bit);
 3755|  14.9k|    v[56] = half_btf_0_avx2(&cospi7, &u[56], &rnding, bit);
 3756|  14.9k|    v[57] = half_btf_0_avx2(&cospi25, &u[38], &rnding, bit);
 3757|  14.9k|    v[58] = half_btf_0_avx2(&cospi23, &u[58], &rnding, bit);
 3758|  14.9k|    v[59] = half_btf_0_avx2(&cospi9, &u[36], &rnding, bit);
 3759|  14.9k|    v[60] = half_btf_0_avx2(&cospi15, &u[60], &rnding, bit);
 3760|  14.9k|    v[61] = half_btf_0_avx2(&cospi17, &u[34], &rnding, bit);
 3761|  14.9k|    v[62] = half_btf_0_avx2(&cospi31, &u[62], &rnding, bit);
 3762|  14.9k|    v[63] = half_btf_0_avx2(&cospi1, &u[32], &rnding, bit);
 3763|       |
 3764|       |    // stage 3
 3765|  14.9k|    u[16] = half_btf_0_avx2(&cospi62, &v[16], &rnding, bit);
 3766|  14.9k|    u[17] = half_btf_0_avx2(&cospim34, &v[30], &rnding, bit);
 3767|  14.9k|    u[18] = half_btf_0_avx2(&cospi46, &v[18], &rnding, bit);
 3768|  14.9k|    u[19] = half_btf_0_avx2(&cospim50, &v[28], &rnding, bit);
 3769|  14.9k|    u[20] = half_btf_0_avx2(&cospi54, &v[20], &rnding, bit);
 3770|  14.9k|    u[21] = half_btf_0_avx2(&cospim42, &v[26], &rnding, bit);
 3771|  14.9k|    u[22] = half_btf_0_avx2(&cospi38, &v[22], &rnding, bit);
 3772|  14.9k|    u[23] = half_btf_0_avx2(&cospim58, &v[24], &rnding, bit);
 3773|  14.9k|    u[24] = half_btf_0_avx2(&cospi6, &v[24], &rnding, bit);
 3774|  14.9k|    u[25] = half_btf_0_avx2(&cospi26, &v[22], &rnding, bit);
 3775|  14.9k|    u[26] = half_btf_0_avx2(&cospi22, &v[26], &rnding, bit);
 3776|  14.9k|    u[27] = half_btf_0_avx2(&cospi10, &v[20], &rnding, bit);
 3777|  14.9k|    u[28] = half_btf_0_avx2(&cospi14, &v[28], &rnding, bit);
 3778|  14.9k|    u[29] = half_btf_0_avx2(&cospi18, &v[18], &rnding, bit);
 3779|  14.9k|    u[30] = half_btf_0_avx2(&cospi30, &v[30], &rnding, bit);
 3780|  14.9k|    u[31] = half_btf_0_avx2(&cospi2, &v[16], &rnding, bit);
 3781|       |
 3782|   134k|    for (i = 32; i < 64; i += 4) {
  ------------------
  |  Branch (3782:18): [True: 119k, False: 14.9k]
  ------------------
 3783|   119k|      addsub_avx2(v[i + 0], v[i + 1], &u[i + 0], &u[i + 1], &clamp_lo,
 3784|   119k|                  &clamp_hi);
 3785|   119k|      addsub_avx2(v[i + 3], v[i + 2], &u[i + 3], &u[i + 2], &clamp_lo,
 3786|   119k|                  &clamp_hi);
 3787|   119k|    }
 3788|       |
 3789|       |    // stage 4
 3790|  14.9k|    v[8] = half_btf_0_avx2(&cospi60, &u[8], &rnding, bit);
 3791|  14.9k|    v[9] = half_btf_0_avx2(&cospim36, &u[14], &rnding, bit);
 3792|  14.9k|    v[10] = half_btf_0_avx2(&cospi44, &u[10], &rnding, bit);
 3793|  14.9k|    v[11] = half_btf_0_avx2(&cospim52, &u[12], &rnding, bit);
 3794|  14.9k|    v[12] = half_btf_0_avx2(&cospi12, &u[12], &rnding, bit);
 3795|  14.9k|    v[13] = half_btf_0_avx2(&cospi20, &u[10], &rnding, bit);
 3796|  14.9k|    v[14] = half_btf_0_avx2(&cospi28, &u[14], &rnding, bit);
 3797|  14.9k|    v[15] = half_btf_0_avx2(&cospi4, &u[8], &rnding, bit);
 3798|       |
 3799|  74.6k|    for (i = 16; i < 32; i += 4) {
  ------------------
  |  Branch (3799:18): [True: 59.7k, False: 14.9k]
  ------------------
 3800|  59.7k|      addsub_avx2(u[i + 0], u[i + 1], &v[i + 0], &v[i + 1], &clamp_lo,
 3801|  59.7k|                  &clamp_hi);
 3802|  59.7k|      addsub_avx2(u[i + 3], u[i + 2], &v[i + 3], &v[i + 2], &clamp_lo,
 3803|  59.7k|                  &clamp_hi);
 3804|  59.7k|    }
 3805|       |
 3806|   134k|    for (i = 32; i < 64; i += 4) {
  ------------------
  |  Branch (3806:18): [True: 119k, False: 14.9k]
  ------------------
 3807|   119k|      v[i + 0] = u[i + 0];
 3808|   119k|      v[i + 3] = u[i + 3];
 3809|   119k|    }
 3810|       |
 3811|  14.9k|    v[33] = half_btf_avx2(&cospim4, &u[33], &cospi60, &u[62], &rnding, bit);
 3812|  14.9k|    v[34] = half_btf_avx2(&cospim60, &u[34], &cospim4, &u[61], &rnding, bit);
 3813|  14.9k|    v[37] = half_btf_avx2(&cospim36, &u[37], &cospi28, &u[58], &rnding, bit);
 3814|  14.9k|    v[38] = half_btf_avx2(&cospim28, &u[38], &cospim36, &u[57], &rnding, bit);
 3815|  14.9k|    v[41] = half_btf_avx2(&cospim20, &u[41], &cospi44, &u[54], &rnding, bit);
 3816|  14.9k|    v[42] = half_btf_avx2(&cospim44, &u[42], &cospim20, &u[53], &rnding, bit);
 3817|  14.9k|    v[45] = half_btf_avx2(&cospim52, &u[45], &cospi12, &u[50], &rnding, bit);
 3818|  14.9k|    v[46] = half_btf_avx2(&cospim12, &u[46], &cospim52, &u[49], &rnding, bit);
 3819|  14.9k|    v[49] = half_btf_avx2(&cospim52, &u[46], &cospi12, &u[49], &rnding, bit);
 3820|  14.9k|    v[50] = half_btf_avx2(&cospi12, &u[45], &cospi52, &u[50], &rnding, bit);
 3821|  14.9k|    v[53] = half_btf_avx2(&cospim20, &u[42], &cospi44, &u[53], &rnding, bit);
 3822|  14.9k|    v[54] = half_btf_avx2(&cospi44, &u[41], &cospi20, &u[54], &rnding, bit);
 3823|  14.9k|    v[57] = half_btf_avx2(&cospim36, &u[38], &cospi28, &u[57], &rnding, bit);
 3824|  14.9k|    v[58] = half_btf_avx2(&cospi28, &u[37], &cospi36, &u[58], &rnding, bit);
 3825|  14.9k|    v[61] = half_btf_avx2(&cospim4, &u[34], &cospi60, &u[61], &rnding, bit);
 3826|  14.9k|    v[62] = half_btf_avx2(&cospi60, &u[33], &cospi4, &u[62], &rnding, bit);
 3827|       |
 3828|       |    // stage 5
 3829|  14.9k|    u[4] = half_btf_0_avx2(&cospi56, &v[4], &rnding, bit);
 3830|  14.9k|    u[5] = half_btf_0_avx2(&cospim40, &v[6], &rnding, bit);
 3831|  14.9k|    u[6] = half_btf_0_avx2(&cospi24, &v[6], &rnding, bit);
 3832|  14.9k|    u[7] = half_btf_0_avx2(&cospi8, &v[4], &rnding, bit);
 3833|       |
 3834|  44.8k|    for (i = 8; i < 16; i += 4) {
  ------------------
  |  Branch (3834:17): [True: 29.8k, False: 14.9k]
  ------------------
 3835|  29.8k|      addsub_avx2(v[i + 0], v[i + 1], &u[i + 0], &u[i + 1], &clamp_lo,
 3836|  29.8k|                  &clamp_hi);
 3837|  29.8k|      addsub_avx2(v[i + 3], v[i + 2], &u[i + 3], &u[i + 2], &clamp_lo,
 3838|  29.8k|                  &clamp_hi);
 3839|  29.8k|    }
 3840|       |
 3841|  74.6k|    for (i = 16; i < 32; i += 4) {
  ------------------
  |  Branch (3841:18): [True: 59.7k, False: 14.9k]
  ------------------
 3842|  59.7k|      u[i + 0] = v[i + 0];
 3843|  59.7k|      u[i + 3] = v[i + 3];
 3844|  59.7k|    }
 3845|       |
 3846|  14.9k|    u[17] = half_btf_avx2(&cospim8, &v[17], &cospi56, &v[30], &rnding, bit);
 3847|  14.9k|    u[18] = half_btf_avx2(&cospim56, &v[18], &cospim8, &v[29], &rnding, bit);
 3848|  14.9k|    u[21] = half_btf_avx2(&cospim40, &v[21], &cospi24, &v[26], &rnding, bit);
 3849|  14.9k|    u[22] = half_btf_avx2(&cospim24, &v[22], &cospim40, &v[25], &rnding, bit);
 3850|  14.9k|    u[25] = half_btf_avx2(&cospim40, &v[22], &cospi24, &v[25], &rnding, bit);
 3851|  14.9k|    u[26] = half_btf_avx2(&cospi24, &v[21], &cospi40, &v[26], &rnding, bit);
 3852|  14.9k|    u[29] = half_btf_avx2(&cospim8, &v[18], &cospi56, &v[29], &rnding, bit);
 3853|  14.9k|    u[30] = half_btf_avx2(&cospi56, &v[17], &cospi8, &v[30], &rnding, bit);
 3854|       |
 3855|  74.6k|    for (i = 32; i < 64; i += 8) {
  ------------------
  |  Branch (3855:18): [True: 59.7k, False: 14.9k]
  ------------------
 3856|  59.7k|      addsub_avx2(v[i + 0], v[i + 3], &u[i + 0], &u[i + 3], &clamp_lo,
 3857|  59.7k|                  &clamp_hi);
 3858|  59.7k|      addsub_avx2(v[i + 1], v[i + 2], &u[i + 1], &u[i + 2], &clamp_lo,
 3859|  59.7k|                  &clamp_hi);
 3860|       |
 3861|  59.7k|      addsub_avx2(v[i + 7], v[i + 4], &u[i + 7], &u[i + 4], &clamp_lo,
 3862|  59.7k|                  &clamp_hi);
 3863|  59.7k|      addsub_avx2(v[i + 6], v[i + 5], &u[i + 6], &u[i + 5], &clamp_lo,
 3864|  59.7k|                  &clamp_hi);
 3865|  59.7k|    }
 3866|       |
 3867|       |    // stage 6
 3868|  14.9k|    v[0] = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3869|  14.9k|    v[1] = half_btf_0_avx2(&cospi32, &u[0], &rnding, bit);
 3870|  14.9k|    v[2] = half_btf_0_avx2(&cospi48, &u[2], &rnding, bit);
 3871|  14.9k|    v[3] = half_btf_0_avx2(&cospi16, &u[2], &rnding, bit);
 3872|       |
 3873|  14.9k|    addsub_avx2(u[4], u[5], &v[4], &v[5], &clamp_lo, &clamp_hi);
 3874|  14.9k|    addsub_avx2(u[7], u[6], &v[7], &v[6], &clamp_lo, &clamp_hi);
 3875|       |
 3876|  44.8k|    for (i = 8; i < 16; i += 4) {
  ------------------
  |  Branch (3876:17): [True: 29.8k, False: 14.9k]
  ------------------
 3877|  29.8k|      v[i + 0] = u[i + 0];
 3878|  29.8k|      v[i + 3] = u[i + 3];
 3879|  29.8k|    }
 3880|       |
 3881|  14.9k|    v[9] = half_btf_avx2(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 3882|  14.9k|    v[10] = half_btf_avx2(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 3883|  14.9k|    v[13] = half_btf_avx2(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 3884|  14.9k|    v[14] = half_btf_avx2(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 3885|       |
 3886|  44.8k|    for (i = 16; i < 32; i += 8) {
  ------------------
  |  Branch (3886:18): [True: 29.8k, False: 14.9k]
  ------------------
 3887|  29.8k|      addsub_avx2(u[i + 0], u[i + 3], &v[i + 0], &v[i + 3], &clamp_lo,
 3888|  29.8k|                  &clamp_hi);
 3889|  29.8k|      addsub_avx2(u[i + 1], u[i + 2], &v[i + 1], &v[i + 2], &clamp_lo,
 3890|  29.8k|                  &clamp_hi);
 3891|       |
 3892|  29.8k|      addsub_avx2(u[i + 7], u[i + 4], &v[i + 7], &v[i + 4], &clamp_lo,
 3893|  29.8k|                  &clamp_hi);
 3894|  29.8k|      addsub_avx2(u[i + 6], u[i + 5], &v[i + 6], &v[i + 5], &clamp_lo,
 3895|  29.8k|                  &clamp_hi);
 3896|  29.8k|    }
 3897|       |
 3898|  74.6k|    for (i = 32; i < 64; i += 8) {
  ------------------
  |  Branch (3898:18): [True: 59.7k, False: 14.9k]
  ------------------
 3899|  59.7k|      v[i + 0] = u[i + 0];
 3900|  59.7k|      v[i + 1] = u[i + 1];
 3901|  59.7k|      v[i + 6] = u[i + 6];
 3902|  59.7k|      v[i + 7] = u[i + 7];
 3903|  59.7k|    }
 3904|       |
 3905|  14.9k|    v[34] = half_btf_avx2(&cospim8, &u[34], &cospi56, &u[61], &rnding, bit);
 3906|  14.9k|    v[35] = half_btf_avx2(&cospim8, &u[35], &cospi56, &u[60], &rnding, bit);
 3907|  14.9k|    v[36] = half_btf_avx2(&cospim56, &u[36], &cospim8, &u[59], &rnding, bit);
 3908|  14.9k|    v[37] = half_btf_avx2(&cospim56, &u[37], &cospim8, &u[58], &rnding, bit);
 3909|  14.9k|    v[42] = half_btf_avx2(&cospim40, &u[42], &cospi24, &u[53], &rnding, bit);
 3910|  14.9k|    v[43] = half_btf_avx2(&cospim40, &u[43], &cospi24, &u[52], &rnding, bit);
 3911|  14.9k|    v[44] = half_btf_avx2(&cospim24, &u[44], &cospim40, &u[51], &rnding, bit);
 3912|  14.9k|    v[45] = half_btf_avx2(&cospim24, &u[45], &cospim40, &u[50], &rnding, bit);
 3913|  14.9k|    v[50] = half_btf_avx2(&cospim40, &u[45], &cospi24, &u[50], &rnding, bit);
 3914|  14.9k|    v[51] = half_btf_avx2(&cospim40, &u[44], &cospi24, &u[51], &rnding, bit);
 3915|  14.9k|    v[52] = half_btf_avx2(&cospi24, &u[43], &cospi40, &u[52], &rnding, bit);
 3916|  14.9k|    v[53] = half_btf_avx2(&cospi24, &u[42], &cospi40, &u[53], &rnding, bit);
 3917|  14.9k|    v[58] = half_btf_avx2(&cospim8, &u[37], &cospi56, &u[58], &rnding, bit);
 3918|  14.9k|    v[59] = half_btf_avx2(&cospim8, &u[36], &cospi56, &u[59], &rnding, bit);
 3919|  14.9k|    v[60] = half_btf_avx2(&cospi56, &u[35], &cospi8, &u[60], &rnding, bit);
 3920|  14.9k|    v[61] = half_btf_avx2(&cospi56, &u[34], &cospi8, &u[61], &rnding, bit);
 3921|       |
 3922|       |    // stage 7
 3923|  14.9k|    addsub_avx2(v[0], v[3], &u[0], &u[3], &clamp_lo, &clamp_hi);
 3924|  14.9k|    addsub_avx2(v[1], v[2], &u[1], &u[2], &clamp_lo, &clamp_hi);
 3925|       |
 3926|  14.9k|    u[4] = v[4];
 3927|  14.9k|    u[7] = v[7];
 3928|  14.9k|    u[5] = half_btf_avx2(&cospim32, &v[5], &cospi32, &v[6], &rnding, bit);
 3929|  14.9k|    u[6] = half_btf_avx2(&cospi32, &v[5], &cospi32, &v[6], &rnding, bit);
 3930|       |
 3931|  14.9k|    addsub_avx2(v[8], v[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 3932|  14.9k|    addsub_avx2(v[9], v[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 3933|  14.9k|    addsub_avx2(v[15], v[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 3934|  14.9k|    addsub_avx2(v[14], v[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 3935|       |
 3936|  44.8k|    for (i = 16; i < 32; i += 8) {
  ------------------
  |  Branch (3936:18): [True: 29.8k, False: 14.9k]
  ------------------
 3937|  29.8k|      u[i + 0] = v[i + 0];
 3938|  29.8k|      u[i + 1] = v[i + 1];
 3939|  29.8k|      u[i + 6] = v[i + 6];
 3940|  29.8k|      u[i + 7] = v[i + 7];
 3941|  29.8k|    }
 3942|       |
 3943|  14.9k|    u[18] = half_btf_avx2(&cospim16, &v[18], &cospi48, &v[29], &rnding, bit);
 3944|  14.9k|    u[19] = half_btf_avx2(&cospim16, &v[19], &cospi48, &v[28], &rnding, bit);
 3945|  14.9k|    u[20] = half_btf_avx2(&cospim48, &v[20], &cospim16, &v[27], &rnding, bit);
 3946|  14.9k|    u[21] = half_btf_avx2(&cospim48, &v[21], &cospim16, &v[26], &rnding, bit);
 3947|  14.9k|    u[26] = half_btf_avx2(&cospim16, &v[21], &cospi48, &v[26], &rnding, bit);
 3948|  14.9k|    u[27] = half_btf_avx2(&cospim16, &v[20], &cospi48, &v[27], &rnding, bit);
 3949|  14.9k|    u[28] = half_btf_avx2(&cospi48, &v[19], &cospi16, &v[28], &rnding, bit);
 3950|  14.9k|    u[29] = half_btf_avx2(&cospi48, &v[18], &cospi16, &v[29], &rnding, bit);
 3951|       |
 3952|  44.8k|    for (i = 32; i < 64; i += 16) {
  ------------------
  |  Branch (3952:18): [True: 29.8k, False: 14.9k]
  ------------------
 3953|   149k|      for (j = i; j < i + 4; j++) {
  ------------------
  |  Branch (3953:19): [True: 119k, False: 29.8k]
  ------------------
 3954|   119k|        addsub_avx2(v[j], v[j ^ 7], &u[j], &u[j ^ 7], &clamp_lo, &clamp_hi);
 3955|   119k|        addsub_avx2(v[j ^ 15], v[j ^ 8], &u[j ^ 15], &u[j ^ 8], &clamp_lo,
 3956|   119k|                    &clamp_hi);
 3957|   119k|      }
 3958|  29.8k|    }
 3959|       |
 3960|       |    // stage 8
 3961|  74.6k|    for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (3961:17): [True: 59.7k, False: 14.9k]
  ------------------
 3962|  59.7k|      addsub_avx2(u[i], u[7 - i], &v[i], &v[7 - i], &clamp_lo, &clamp_hi);
 3963|  59.7k|    }
 3964|       |
 3965|  14.9k|    v[8] = u[8];
 3966|  14.9k|    v[9] = u[9];
 3967|  14.9k|    v[14] = u[14];
 3968|  14.9k|    v[15] = u[15];
 3969|       |
 3970|  14.9k|    v[10] = half_btf_avx2(&cospim32, &u[10], &cospi32, &u[13], &rnding, bit);
 3971|  14.9k|    v[11] = half_btf_avx2(&cospim32, &u[11], &cospi32, &u[12], &rnding, bit);
 3972|  14.9k|    v[12] = half_btf_avx2(&cospi32, &u[11], &cospi32, &u[12], &rnding, bit);
 3973|  14.9k|    v[13] = half_btf_avx2(&cospi32, &u[10], &cospi32, &u[13], &rnding, bit);
 3974|       |
 3975|  74.6k|    for (i = 16; i < 20; ++i) {
  ------------------
  |  Branch (3975:18): [True: 59.7k, False: 14.9k]
  ------------------
 3976|  59.7k|      addsub_avx2(u[i], u[i ^ 7], &v[i], &v[i ^ 7], &clamp_lo, &clamp_hi);
 3977|  59.7k|      addsub_avx2(u[i ^ 15], u[i ^ 8], &v[i ^ 15], &v[i ^ 8], &clamp_lo,
 3978|  59.7k|                  &clamp_hi);
 3979|  59.7k|    }
 3980|       |
 3981|  74.6k|    for (i = 32; i < 36; ++i) {
  ------------------
  |  Branch (3981:18): [True: 59.7k, False: 14.9k]
  ------------------
 3982|  59.7k|      v[i] = u[i];
 3983|  59.7k|      v[i + 12] = u[i + 12];
 3984|  59.7k|      v[i + 16] = u[i + 16];
 3985|  59.7k|      v[i + 28] = u[i + 28];
 3986|  59.7k|    }
 3987|       |
 3988|  14.9k|    v[36] = half_btf_avx2(&cospim16, &u[36], &cospi48, &u[59], &rnding, bit);
 3989|  14.9k|    v[37] = half_btf_avx2(&cospim16, &u[37], &cospi48, &u[58], &rnding, bit);
 3990|  14.9k|    v[38] = half_btf_avx2(&cospim16, &u[38], &cospi48, &u[57], &rnding, bit);
 3991|  14.9k|    v[39] = half_btf_avx2(&cospim16, &u[39], &cospi48, &u[56], &rnding, bit);
 3992|  14.9k|    v[40] = half_btf_avx2(&cospim48, &u[40], &cospim16, &u[55], &rnding, bit);
 3993|  14.9k|    v[41] = half_btf_avx2(&cospim48, &u[41], &cospim16, &u[54], &rnding, bit);
 3994|  14.9k|    v[42] = half_btf_avx2(&cospim48, &u[42], &cospim16, &u[53], &rnding, bit);
 3995|  14.9k|    v[43] = half_btf_avx2(&cospim48, &u[43], &cospim16, &u[52], &rnding, bit);
 3996|  14.9k|    v[52] = half_btf_avx2(&cospim16, &u[43], &cospi48, &u[52], &rnding, bit);
 3997|  14.9k|    v[53] = half_btf_avx2(&cospim16, &u[42], &cospi48, &u[53], &rnding, bit);
 3998|  14.9k|    v[54] = half_btf_avx2(&cospim16, &u[41], &cospi48, &u[54], &rnding, bit);
 3999|  14.9k|    v[55] = half_btf_avx2(&cospim16, &u[40], &cospi48, &u[55], &rnding, bit);
 4000|  14.9k|    v[56] = half_btf_avx2(&cospi48, &u[39], &cospi16, &u[56], &rnding, bit);
 4001|  14.9k|    v[57] = half_btf_avx2(&cospi48, &u[38], &cospi16, &u[57], &rnding, bit);
 4002|  14.9k|    v[58] = half_btf_avx2(&cospi48, &u[37], &cospi16, &u[58], &rnding, bit);
 4003|  14.9k|    v[59] = half_btf_avx2(&cospi48, &u[36], &cospi16, &u[59], &rnding, bit);
 4004|       |
 4005|       |    // stage 9
 4006|   134k|    for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (4006:17): [True: 119k, False: 14.9k]
  ------------------
 4007|   119k|      addsub_avx2(v[i], v[15 - i], &u[i], &u[15 - i], &clamp_lo, &clamp_hi);
 4008|   119k|    }
 4009|       |
 4010|  74.6k|    for (i = 16; i < 20; ++i) {
  ------------------
  |  Branch (4010:18): [True: 59.7k, False: 14.9k]
  ------------------
 4011|  59.7k|      u[i] = v[i];
 4012|  59.7k|      u[i + 12] = v[i + 12];
 4013|  59.7k|    }
 4014|       |
 4015|  14.9k|    u[20] = half_btf_avx2(&cospim32, &v[20], &cospi32, &v[27], &rnding, bit);
 4016|  14.9k|    u[21] = half_btf_avx2(&cospim32, &v[21], &cospi32, &v[26], &rnding, bit);
 4017|  14.9k|    u[22] = half_btf_avx2(&cospim32, &v[22], &cospi32, &v[25], &rnding, bit);
 4018|  14.9k|    u[23] = half_btf_avx2(&cospim32, &v[23], &cospi32, &v[24], &rnding, bit);
 4019|  14.9k|    u[24] = half_btf_avx2(&cospi32, &v[23], &cospi32, &v[24], &rnding, bit);
 4020|  14.9k|    u[25] = half_btf_avx2(&cospi32, &v[22], &cospi32, &v[25], &rnding, bit);
 4021|  14.9k|    u[26] = half_btf_avx2(&cospi32, &v[21], &cospi32, &v[26], &rnding, bit);
 4022|  14.9k|    u[27] = half_btf_avx2(&cospi32, &v[20], &cospi32, &v[27], &rnding, bit);
 4023|       |
 4024|   134k|    for (i = 32; i < 40; i++) {
  ------------------
  |  Branch (4024:18): [True: 119k, False: 14.9k]
  ------------------
 4025|   119k|      addsub_avx2(v[i], v[i ^ 15], &u[i], &u[i ^ 15], &clamp_lo, &clamp_hi);
 4026|   119k|    }
 4027|       |
 4028|   134k|    for (i = 48; i < 56; i++) {
  ------------------
  |  Branch (4028:18): [True: 119k, False: 14.9k]
  ------------------
 4029|   119k|      addsub_avx2(v[i ^ 15], v[i], &u[i ^ 15], &u[i], &clamp_lo, &clamp_hi);
 4030|   119k|    }
 4031|       |
 4032|       |    // stage 10
 4033|   253k|    for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (4033:17): [True: 239k, False: 14.9k]
  ------------------
 4034|   239k|      addsub_avx2(u[i], u[31 - i], &v[i], &v[31 - i], &clamp_lo, &clamp_hi);
 4035|   239k|    }
 4036|       |
 4037|   134k|    for (i = 32; i < 40; i++) v[i] = u[i];
  ------------------
  |  Branch (4037:18): [True: 119k, False: 14.9k]
  ------------------
 4038|       |
 4039|  14.9k|    v[40] = half_btf_avx2(&cospim32, &u[40], &cospi32, &u[55], &rnding, bit);
 4040|  14.9k|    v[41] = half_btf_avx2(&cospim32, &u[41], &cospi32, &u[54], &rnding, bit);
 4041|  14.9k|    v[42] = half_btf_avx2(&cospim32, &u[42], &cospi32, &u[53], &rnding, bit);
 4042|  14.9k|    v[43] = half_btf_avx2(&cospim32, &u[43], &cospi32, &u[52], &rnding, bit);
 4043|  14.9k|    v[44] = half_btf_avx2(&cospim32, &u[44], &cospi32, &u[51], &rnding, bit);
 4044|  14.9k|    v[45] = half_btf_avx2(&cospim32, &u[45], &cospi32, &u[50], &rnding, bit);
 4045|  14.9k|    v[46] = half_btf_avx2(&cospim32, &u[46], &cospi32, &u[49], &rnding, bit);
 4046|  14.9k|    v[47] = half_btf_avx2(&cospim32, &u[47], &cospi32, &u[48], &rnding, bit);
 4047|  14.9k|    v[48] = half_btf_avx2(&cospi32, &u[47], &cospi32, &u[48], &rnding, bit);
 4048|  14.9k|    v[49] = half_btf_avx2(&cospi32, &u[46], &cospi32, &u[49], &rnding, bit);
 4049|  14.9k|    v[50] = half_btf_avx2(&cospi32, &u[45], &cospi32, &u[50], &rnding, bit);
 4050|  14.9k|    v[51] = half_btf_avx2(&cospi32, &u[44], &cospi32, &u[51], &rnding, bit);
 4051|  14.9k|    v[52] = half_btf_avx2(&cospi32, &u[43], &cospi32, &u[52], &rnding, bit);
 4052|  14.9k|    v[53] = half_btf_avx2(&cospi32, &u[42], &cospi32, &u[53], &rnding, bit);
 4053|  14.9k|    v[54] = half_btf_avx2(&cospi32, &u[41], &cospi32, &u[54], &rnding, bit);
 4054|  14.9k|    v[55] = half_btf_avx2(&cospi32, &u[40], &cospi32, &u[55], &rnding, bit);
 4055|       |
 4056|   134k|    for (i = 56; i < 64; i++) v[i] = u[i];
  ------------------
  |  Branch (4056:18): [True: 119k, False: 14.9k]
  ------------------
 4057|       |
 4058|       |    // stage 11
 4059|   492k|    for (i = 0; i < 32; i++) {
  ------------------
  |  Branch (4059:17): [True: 478k, False: 14.9k]
  ------------------
 4060|   478k|      addsub_avx2(v[i], v[63 - i], &out[(i)], &out[(63 - i)], &clamp_lo,
 4061|   478k|                  &clamp_hi);
 4062|   478k|    }
 4063|  14.9k|    if (!do_cols) {
  ------------------
  |  Branch (4063:9): [True: 6.93k, False: 8.00k]
  ------------------
 4064|  6.93k|      const int log_range_out = get_log_range_out(bd);
 4065|  6.93k|      const __m256i clamp_lo_out =
 4066|  6.93k|          _mm256_set1_epi32(-(1 << (log_range_out - 1)));
 4067|  6.93k|      const __m256i clamp_hi_out =
 4068|  6.93k|          _mm256_set1_epi32((1 << (log_range_out - 1)) - 1);
 4069|       |
 4070|  6.93k|      round_shift_8x8_avx2(out, out_shift);
 4071|  6.93k|      round_shift_8x8_avx2(out + 16, out_shift);
 4072|  6.93k|      round_shift_8x8_avx2(out + 32, out_shift);
 4073|  6.93k|      round_shift_8x8_avx2(out + 48, out_shift);
 4074|  6.93k|      highbd_clamp_epi32_avx2(out, out, &clamp_lo_out, &clamp_hi_out, 64);
 4075|  6.93k|    }
 4076|  14.9k|  }
 4077|  14.9k|}
highbd_inv_txfm_avx2.c:load_buffer_32bit_input:
  235|  4.51M|                                           __m256i *out, int out_size) {
  236|  45.6M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (236:19): [True: 41.1M, False: 4.51M]
  ------------------
  237|  41.1M|    out[i] = _mm256_loadu_si256((const __m256i *)(in + i * stride));
  238|  41.1M|  }
  239|  4.51M|}
highbd_inv_txfm_avx2.c:transpose_8x8_flip_avx2:
  197|  29.9k|static void transpose_8x8_flip_avx2(const __m256i *in, __m256i *out) {
  198|  29.9k|  __m256i u0, u1, u2, u3, u4, u5, u6, u7;
  199|  29.9k|  __m256i x0, x1;
  200|       |
  201|  29.9k|  u0 = _mm256_unpacklo_epi32(in[7], in[6]);
  202|  29.9k|  u1 = _mm256_unpackhi_epi32(in[7], in[6]);
  203|       |
  204|  29.9k|  u2 = _mm256_unpacklo_epi32(in[5], in[4]);
  205|  29.9k|  u3 = _mm256_unpackhi_epi32(in[5], in[4]);
  206|       |
  207|  29.9k|  u4 = _mm256_unpacklo_epi32(in[3], in[2]);
  208|  29.9k|  u5 = _mm256_unpackhi_epi32(in[3], in[2]);
  209|       |
  210|  29.9k|  u6 = _mm256_unpacklo_epi32(in[1], in[0]);
  211|  29.9k|  u7 = _mm256_unpackhi_epi32(in[1], in[0]);
  212|       |
  213|  29.9k|  x0 = _mm256_unpacklo_epi64(u0, u2);
  214|  29.9k|  x1 = _mm256_unpacklo_epi64(u4, u6);
  215|  29.9k|  out[0] = _mm256_permute2f128_si256(x0, x1, 0x20);
  216|  29.9k|  out[4] = _mm256_permute2f128_si256(x0, x1, 0x31);
  217|       |
  218|  29.9k|  x0 = _mm256_unpackhi_epi64(u0, u2);
  219|  29.9k|  x1 = _mm256_unpackhi_epi64(u4, u6);
  220|  29.9k|  out[1] = _mm256_permute2f128_si256(x0, x1, 0x20);
  221|  29.9k|  out[5] = _mm256_permute2f128_si256(x0, x1, 0x31);
  222|       |
  223|  29.9k|  x0 = _mm256_unpacklo_epi64(u1, u3);
  224|  29.9k|  x1 = _mm256_unpacklo_epi64(u5, u7);
  225|  29.9k|  out[2] = _mm256_permute2f128_si256(x0, x1, 0x20);
  226|  29.9k|  out[6] = _mm256_permute2f128_si256(x0, x1, 0x31);
  227|       |
  228|  29.9k|  x0 = _mm256_unpackhi_epi64(u1, u3);
  229|  29.9k|  x1 = _mm256_unpackhi_epi64(u5, u7);
  230|  29.9k|  out[3] = _mm256_permute2f128_si256(x0, x1, 0x20);
  231|       |  out[7] = _mm256_permute2f128_si256(x0, x1, 0x31);
  232|  29.9k|}
highbd_inv_txfm_avx2.c:transpose_8x8_avx2:
  160|  5.22M|static void transpose_8x8_avx2(const __m256i *in, __m256i *out) {
  161|  5.22M|  __m256i u0, u1, u2, u3, u4, u5, u6, u7;
  162|  5.22M|  __m256i x0, x1;
  163|       |
  164|  5.22M|  u0 = _mm256_unpacklo_epi32(in[0], in[1]);
  165|  5.22M|  u1 = _mm256_unpackhi_epi32(in[0], in[1]);
  166|       |
  167|  5.22M|  u2 = _mm256_unpacklo_epi32(in[2], in[3]);
  168|  5.22M|  u3 = _mm256_unpackhi_epi32(in[2], in[3]);
  169|       |
  170|  5.22M|  u4 = _mm256_unpacklo_epi32(in[4], in[5]);
  171|  5.22M|  u5 = _mm256_unpackhi_epi32(in[4], in[5]);
  172|       |
  173|  5.22M|  u6 = _mm256_unpacklo_epi32(in[6], in[7]);
  174|  5.22M|  u7 = _mm256_unpackhi_epi32(in[6], in[7]);
  175|       |
  176|  5.22M|  x0 = _mm256_unpacklo_epi64(u0, u2);
  177|  5.22M|  x1 = _mm256_unpacklo_epi64(u4, u6);
  178|  5.22M|  out[0] = _mm256_permute2f128_si256(x0, x1, 0x20);
  179|  5.22M|  out[4] = _mm256_permute2f128_si256(x0, x1, 0x31);
  180|       |
  181|  5.22M|  x0 = _mm256_unpackhi_epi64(u0, u2);
  182|  5.22M|  x1 = _mm256_unpackhi_epi64(u4, u6);
  183|  5.22M|  out[1] = _mm256_permute2f128_si256(x0, x1, 0x20);
  184|  5.22M|  out[5] = _mm256_permute2f128_si256(x0, x1, 0x31);
  185|       |
  186|  5.22M|  x0 = _mm256_unpacklo_epi64(u1, u3);
  187|  5.22M|  x1 = _mm256_unpacklo_epi64(u5, u7);
  188|  5.22M|  out[2] = _mm256_permute2f128_si256(x0, x1, 0x20);
  189|  5.22M|  out[6] = _mm256_permute2f128_si256(x0, x1, 0x31);
  190|       |
  191|  5.22M|  x0 = _mm256_unpackhi_epi64(u1, u3);
  192|  5.22M|  x1 = _mm256_unpackhi_epi64(u5, u7);
  193|  5.22M|  out[3] = _mm256_permute2f128_si256(x0, x1, 0x20);
  194|       |  out[7] = _mm256_permute2f128_si256(x0, x1, 0x31);
  195|  5.22M|}
highbd_inv_txfm_avx2.c:highbd_write_buffer_16xn_avx2:
  107|   382k|                                                 int height, const int bd) {
  108|   382k|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (108:11): [True: 1.54k, False: 381k]
  ------------------
  109|   382k|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (109:20): [True: 1.54k, False: 381k]
  ------------------
  110|  5.86M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (110:19): [True: 5.48M, False: 382k]
  ------------------
  111|  5.48M|    __m256i v = _mm256_loadu_si256((__m256i const *)(output + i * stride));
  112|  5.48M|    __m256i u = highbd_get_recon_16x8_avx2(v, in[j], in[j + height], bd);
  113|       |
  114|  5.48M|    _mm256_storeu_si256((__m256i *)(output + i * stride), u);
  115|  5.48M|  }
  116|   382k|}
highbd_inv_txfm_avx2.c:highbd_get_recon_16x8_avx2:
   93|  5.48M|                                                 const int bd) {
   94|  5.48M|  __m256i x0 = _mm256_cvtepi16_epi32(_mm256_castsi256_si128(pred));
   95|  5.48M|  __m256i x1 = _mm256_cvtepi16_epi32(_mm256_extractf128_si256(pred, 1));
   96|       |
   97|  5.48M|  x0 = _mm256_add_epi32(res0, x0);
   98|  5.48M|  x1 = _mm256_add_epi32(res1, x1);
   99|  5.48M|  x0 = _mm256_packus_epi32(x0, x1);
  100|       |  x0 = _mm256_permute4x64_epi64(x0, 0xd8);
  101|  5.48M|  x0 = highbd_clamp_epi16_avx2(x0, bd);
  102|  5.48M|  return x0;
  103|  5.48M|}
highbd_inv_txfm_avx2.c:highbd_clamp_epi16_avx2:
   34|  37.9M|static inline __m256i highbd_clamp_epi16_avx2(__m256i u, int bd) {
   35|  37.9M|  const __m256i zero = _mm256_setzero_si256();
   36|  37.9M|  const __m256i one = _mm256_set1_epi16(1);
   37|  37.9M|  const __m256i max = _mm256_sub_epi16(_mm256_slli_epi16(one, bd), one);
   38|  37.9M|  __m256i clamped, mask;
   39|       |
   40|  37.9M|  mask = _mm256_cmpgt_epi16(u, max);
   41|  37.9M|  clamped = _mm256_andnot_si256(mask, u);
   42|  37.9M|  mask = _mm256_and_si256(mask, max);
   43|  37.9M|  clamped = _mm256_or_si256(mask, clamped);
   44|  37.9M|  mask = _mm256_cmpgt_epi16(clamped, zero);
   45|  37.9M|  clamped = _mm256_and_si256(clamped, mask);
   46|       |
   47|  37.9M|  return clamped;
   48|  37.9M|}
highbd_inv_txfm_avx2.c:highbd_write_buffer_8xn_avx2:
  129|  3.86M|                                                int height, const int bd) {
  130|  3.86M|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (130:11): [True: 20.9k, False: 3.83M]
  ------------------
  131|  3.86M|  __m128i temp;
  132|  3.86M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (132:20): [True: 20.9k, False: 3.83M]
  ------------------
  133|  36.3M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (133:19): [True: 32.5M, False: 3.86M]
  ------------------
  134|  32.5M|    temp = _mm_loadu_si128((__m128i const *)(output + i * stride));
  135|  32.5M|    __m256i v = _mm256_cvtepi16_epi32(temp);
  136|  32.5M|    __m256i u = highbd_get_recon_8x8_avx2(v, in[j], bd);
  137|  32.5M|    __m128i u1 = _mm256_castsi256_si128(u);
  138|  32.5M|    _mm_storeu_si128((__m128i *)(output + i * stride), u1);
  139|  32.5M|  }
  140|  3.86M|}
highbd_inv_txfm_avx2.c:highbd_get_recon_8x8_avx2:
  118|  32.5M|                                                const int bd) {
  119|  32.5M|  __m256i x0 = pred;
  120|  32.5M|  x0 = _mm256_add_epi32(res, x0);
  121|  32.5M|  x0 = _mm256_packus_epi32(x0, x0);
  122|       |  x0 = _mm256_permute4x64_epi64(x0, 0xd8);
  123|  32.5M|  x0 = highbd_clamp_epi16_avx2(x0, bd);
  124|  32.5M|  return x0;
  125|  32.5M|}

av1_highbd_iwht4x4_16_add_sse4_1:
  149|  3.54M|                                      int stride, int bd) {
  150|       |  /* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
  151|       |     0.5 shifts per pixel. */
  152|  3.54M|  __m128i op[4];
  153|  3.54M|  uint16_t *dest = CONVERT_TO_SHORTPTR(dest8);
  ------------------
  |  |   79|  3.54M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  154|       |
  155|  3.54M|  load_buffer_4x4(input, op);
  156|       |
  157|       |  // Shift before-hand.
  158|  3.54M|  op[0] = _mm_srai_epi32(op[0], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  3.54M|#define UNIT_QUANT_SHIFT 2
  ------------------
  159|  3.54M|  op[1] = _mm_srai_epi32(op[1], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  3.54M|#define UNIT_QUANT_SHIFT 2
  ------------------
  160|  3.54M|  op[2] = _mm_srai_epi32(op[2], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  3.54M|#define UNIT_QUANT_SHIFT 2
  ------------------
  161|  3.54M|  op[3] = _mm_srai_epi32(op[3], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  3.54M|#define UNIT_QUANT_SHIFT 2
  ------------------
  162|       |
  163|  10.6M|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (163:19): [True: 7.09M, False: 3.54M]
  ------------------
  164|  7.09M|    __m128i a1 = op[0];
  165|  7.09M|    __m128i c1 = op[1];
  166|  7.09M|    __m128i d1 = op[2];
  167|  7.09M|    __m128i b1 = op[3];
  168|  7.09M|    a1 = _mm_add_epi32(a1, c1);          // a1 += c1
  169|  7.09M|    d1 = _mm_sub_epi32(d1, b1);          // d1 -= b1
  170|  7.09M|    __m128i e1 = _mm_sub_epi32(a1, d1);  // e1 = (a1 - d1) >> 1
  171|  7.09M|    e1 = _mm_srai_epi32(e1, 1);
  172|  7.09M|    b1 = _mm_sub_epi32(e1, b1);  // b1 = e1 - b1
  173|  7.09M|    c1 = _mm_sub_epi32(e1, c1);  // c1 = e1 - c1
  174|  7.09M|    a1 = _mm_sub_epi32(a1, b1);  // a1 -= b1
  175|  7.09M|    d1 = _mm_add_epi32(d1, c1);  // d1 += c1
  176|       |
  177|  7.09M|    op[0] = a1;
  178|  7.09M|    op[1] = b1;
  179|  7.09M|    op[2] = c1;
  180|  7.09M|    op[3] = d1;
  181|  7.09M|    if (i == 0) {
  ------------------
  |  Branch (181:9): [True: 3.54M, False: 3.54M]
  ------------------
  182|  3.54M|      transpose_32bit_4x4(op, op);
  183|  3.54M|    }
  184|  7.09M|  }
  185|       |
  186|       |  // Convert to int16_t. The C code checks that we are in range.
  187|  3.54M|  op[0] = _mm_packs_epi32(op[0], op[1]);
  188|  3.54M|  op[1] = _mm_packs_epi32(op[2], op[3]);
  189|       |
  190|       |  // Load uint16_t.
  191|  3.54M|  __m128i dst[2];
  192|  3.54M|  __m128i tmp[4];
  193|  3.54M|  tmp[0] = _mm_loadl_epi64((const __m128i *)(dest + 0 * stride));
  194|  3.54M|  tmp[1] = _mm_loadl_epi64((const __m128i *)(dest + 1 * stride));
  195|  3.54M|  dst[0] = _mm_unpacklo_epi64(tmp[0], tmp[1]);
  196|  3.54M|  tmp[2] = _mm_loadl_epi64((const __m128i *)(dest + 2 * stride));
  197|  3.54M|  tmp[3] = _mm_loadl_epi64((const __m128i *)(dest + 3 * stride));
  198|  3.54M|  dst[1] = _mm_unpacklo_epi64(tmp[2], tmp[3]);
  199|       |
  200|       |  // Add to the previous results.
  201|  3.54M|  dst[0] = _mm_add_epi16(dst[0], op[0]);
  202|  3.54M|  dst[1] = _mm_add_epi16(dst[1], op[1]);
  203|       |
  204|       |  // Clamp.
  205|  3.54M|  dst[0] = highbd_clamp_epi16(dst[0], bd);
  206|  3.54M|  dst[1] = highbd_clamp_epi16(dst[1], bd);
  207|       |
  208|       |  // Store.
  209|  3.54M|  _mm_storel_epi64((__m128i *)(dest + 0 * stride), dst[0]);
  210|  3.54M|  dst[0] = _mm_srli_si128(dst[0], 8);
  211|  3.54M|  _mm_storel_epi64((__m128i *)(dest + 1 * stride), dst[0]);
  212|  3.54M|  _mm_storel_epi64((__m128i *)(dest + 2 * stride), dst[1]);
  213|       |  dst[1] = _mm_srli_si128(dst[1], 8);
  214|  3.54M|  _mm_storel_epi64((__m128i *)(dest + 3 * stride), dst[1]);
  215|  3.54M|}
av1_inv_txfm2d_add_4x4_sse4_1:
  722|  15.6M|                                   int stride, TX_TYPE tx_type, int bd) {
  723|  15.6M|  __m128i in[4];
  724|  15.6M|  const int8_t *shift = av1_inv_txfm_shift_ls[TX_4X4];
  725|       |
  726|  15.6M|  switch (tx_type) {
  727|  6.46M|    case DCT_DCT:
  ------------------
  |  Branch (727:5): [True: 6.46M, False: 9.19M]
  ------------------
  728|  6.46M|      load_buffer_4x4(input, in);
  729|  6.46M|      idct4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  6.46M|#define INV_COS_BIT 12
  ------------------
  730|  6.46M|      transpose_32bit_4x4(in, in);
  731|  6.46M|      idct4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  6.46M|#define INV_COS_BIT 12
  ------------------
  732|  6.46M|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  733|  6.46M|      break;
  734|  2.31M|    case ADST_DCT:
  ------------------
  |  Branch (734:5): [True: 2.31M, False: 13.3M]
  ------------------
  735|  2.31M|      load_buffer_4x4(input, in);
  736|  2.31M|      idct4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  2.31M|#define INV_COS_BIT 12
  ------------------
  737|  2.31M|      transpose_32bit_4x4(in, in);
  738|  2.31M|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  2.31M|#define INV_COS_BIT 12
  ------------------
  739|  2.31M|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  740|  2.31M|      break;
  741|  2.47M|    case DCT_ADST:
  ------------------
  |  Branch (741:5): [True: 2.47M, False: 13.1M]
  ------------------
  742|  2.47M|      load_buffer_4x4(input, in);
  743|  2.47M|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  2.47M|#define INV_COS_BIT 12
  ------------------
  744|  2.47M|      transpose_32bit_4x4(in, in);
  745|  2.47M|      idct4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  2.47M|#define INV_COS_BIT 12
  ------------------
  746|  2.47M|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  747|  2.47M|      break;
  748|  2.84M|    case ADST_ADST:
  ------------------
  |  Branch (748:5): [True: 2.84M, False: 12.8M]
  ------------------
  749|  2.84M|      load_buffer_4x4(input, in);
  750|  2.84M|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  2.84M|#define INV_COS_BIT 12
  ------------------
  751|  2.84M|      transpose_32bit_4x4(in, in);
  752|  2.84M|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  2.84M|#define INV_COS_BIT 12
  ------------------
  753|  2.84M|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  754|  2.84M|      break;
  755|  19.4k|    case FLIPADST_DCT:
  ------------------
  |  Branch (755:5): [True: 19.4k, False: 15.6M]
  ------------------
  756|  19.4k|      load_buffer_4x4(input, in);
  757|  19.4k|      idct4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  19.4k|#define INV_COS_BIT 12
  ------------------
  758|  19.4k|      transpose_32bit_4x4(in, in);
  759|  19.4k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  19.4k|#define INV_COS_BIT 12
  ------------------
  760|  19.4k|      write_buffer_4x4(in, output, stride, 0, 1, -shift[1], bd);
  761|  19.4k|      break;
  762|  24.9k|    case DCT_FLIPADST:
  ------------------
  |  Branch (762:5): [True: 24.9k, False: 15.6M]
  ------------------
  763|  24.9k|      load_buffer_4x4(input, in);
  764|  24.9k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  24.9k|#define INV_COS_BIT 12
  ------------------
  765|  24.9k|      transpose_32bit_4x4(in, in);
  766|  24.9k|      idct4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  24.9k|#define INV_COS_BIT 12
  ------------------
  767|  24.9k|      write_buffer_4x4(in, output, stride, 1, 0, -shift[1], bd);
  768|  24.9k|      break;
  769|  15.2k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (769:5): [True: 15.2k, False: 15.6M]
  ------------------
  770|  15.2k|      load_buffer_4x4(input, in);
  771|  15.2k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  15.2k|#define INV_COS_BIT 12
  ------------------
  772|  15.2k|      transpose_32bit_4x4(in, in);
  773|  15.2k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  15.2k|#define INV_COS_BIT 12
  ------------------
  774|  15.2k|      write_buffer_4x4(in, output, stride, 1, 1, -shift[1], bd);
  775|  15.2k|      break;
  776|  24.4k|    case ADST_FLIPADST:
  ------------------
  |  Branch (776:5): [True: 24.4k, False: 15.6M]
  ------------------
  777|  24.4k|      load_buffer_4x4(input, in);
  778|  24.4k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  24.4k|#define INV_COS_BIT 12
  ------------------
  779|  24.4k|      transpose_32bit_4x4(in, in);
  780|  24.4k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  24.4k|#define INV_COS_BIT 12
  ------------------
  781|  24.4k|      write_buffer_4x4(in, output, stride, 1, 0, -shift[1], bd);
  782|  24.4k|      break;
  783|  33.2k|    case FLIPADST_ADST:
  ------------------
  |  Branch (783:5): [True: 33.2k, False: 15.6M]
  ------------------
  784|  33.2k|      load_buffer_4x4(input, in);
  785|  33.2k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  33.2k|#define INV_COS_BIT 12
  ------------------
  786|  33.2k|      transpose_32bit_4x4(in, in);
  787|  33.2k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  33.2k|#define INV_COS_BIT 12
  ------------------
  788|  33.2k|      write_buffer_4x4(in, output, stride, 0, 1, -shift[1], bd);
  789|  33.2k|      break;
  790|  62.7k|    case IDTX:
  ------------------
  |  Branch (790:5): [True: 62.7k, False: 15.6M]
  ------------------
  791|  62.7k|      load_buffer_4x4(input, in);
  792|  62.7k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  62.7k|#define INV_COS_BIT 12
  ------------------
  793|  62.7k|      transpose_32bit_4x4(in, in);
  794|  62.7k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  62.7k|#define INV_COS_BIT 12
  ------------------
  795|  62.7k|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  796|  62.7k|      break;
  797|   186k|    case V_DCT:
  ------------------
  |  Branch (797:5): [True: 186k, False: 15.4M]
  ------------------
  798|   186k|      load_buffer_4x4(input, in);
  799|   186k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|   186k|#define INV_COS_BIT 12
  ------------------
  800|   186k|      transpose_32bit_4x4(in, in);
  801|   186k|      idct4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|   186k|#define INV_COS_BIT 12
  ------------------
  802|   186k|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  803|   186k|      break;
  804|  1.03M|    case H_DCT:
  ------------------
  |  Branch (804:5): [True: 1.03M, False: 14.6M]
  ------------------
  805|  1.03M|      load_buffer_4x4(input, in);
  806|  1.03M|      idct4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  1.03M|#define INV_COS_BIT 12
  ------------------
  807|  1.03M|      transpose_32bit_4x4(in, in);
  808|  1.03M|      iidentity4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  1.03M|#define INV_COS_BIT 12
  ------------------
  809|  1.03M|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  810|  1.03M|      break;
  811|  31.0k|    case V_ADST:
  ------------------
  |  Branch (811:5): [True: 31.0k, False: 15.6M]
  ------------------
  812|  31.0k|      load_buffer_4x4(input, in);
  813|  31.0k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  31.0k|#define INV_COS_BIT 12
  ------------------
  814|  31.0k|      transpose_32bit_4x4(in, in);
  815|  31.0k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  31.0k|#define INV_COS_BIT 12
  ------------------
  816|  31.0k|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  817|  31.0k|      break;
  818|  86.3k|    case H_ADST:
  ------------------
  |  Branch (818:5): [True: 86.3k, False: 15.5M]
  ------------------
  819|  86.3k|      load_buffer_4x4(input, in);
  820|  86.3k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  86.3k|#define INV_COS_BIT 12
  ------------------
  821|  86.3k|      transpose_32bit_4x4(in, in);
  822|  86.3k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  86.3k|#define INV_COS_BIT 12
  ------------------
  823|  86.3k|      write_buffer_4x4(in, output, stride, 0, 0, -shift[1], bd);
  824|  86.3k|      break;
  825|  22.6k|    case V_FLIPADST:
  ------------------
  |  Branch (825:5): [True: 22.6k, False: 15.6M]
  ------------------
  826|  22.6k|      load_buffer_4x4(input, in);
  827|  22.6k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  22.6k|#define INV_COS_BIT 12
  ------------------
  828|  22.6k|      transpose_32bit_4x4(in, in);
  829|  22.6k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  22.6k|#define INV_COS_BIT 12
  ------------------
  830|  22.6k|      write_buffer_4x4(in, output, stride, 0, 1, -shift[1], bd);
  831|  22.6k|      break;
  832|  64.9k|    case H_FLIPADST:
  ------------------
  |  Branch (832:5): [True: 64.9k, False: 15.6M]
  ------------------
  833|  64.9k|      load_buffer_4x4(input, in);
  834|  64.9k|      iadst4x4_sse4_1(in, in, INV_COS_BIT, 0, bd, 0);
  ------------------
  |  |   43|  64.9k|#define INV_COS_BIT 12
  ------------------
  835|  64.9k|      transpose_32bit_4x4(in, in);
  836|  64.9k|      iidentity4_sse4_1(in, in, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  64.9k|#define INV_COS_BIT 12
  ------------------
  837|  64.9k|      write_buffer_4x4(in, output, stride, 1, 0, -shift[1], bd);
  838|  64.9k|      break;
  839|      0|    default: assert(0);
  ------------------
  |  Branch (839:5): [True: 0, False: 15.6M]
  ------------------
  840|  15.6M|  }
  841|  15.6M|}
av1_highbd_inv_txfm2d_add_universe_sse4_1:
 5720|   359k|                                               int eob, const int bd) {
 5721|   359k|  switch (tx_type) {
 5722|      0|    case DCT_DCT:
  ------------------
  |  Branch (5722:5): [True: 0, False: 359k]
  ------------------
 5723|      0|    case ADST_DCT:
  ------------------
  |  Branch (5723:5): [True: 0, False: 359k]
  ------------------
 5724|      0|    case DCT_ADST:
  ------------------
  |  Branch (5724:5): [True: 0, False: 359k]
  ------------------
 5725|      0|    case ADST_ADST:
  ------------------
  |  Branch (5725:5): [True: 0, False: 359k]
  ------------------
 5726|      0|    case FLIPADST_DCT:
  ------------------
  |  Branch (5726:5): [True: 0, False: 359k]
  ------------------
 5727|      0|    case DCT_FLIPADST:
  ------------------
  |  Branch (5727:5): [True: 0, False: 359k]
  ------------------
 5728|      0|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (5728:5): [True: 0, False: 359k]
  ------------------
 5729|      0|    case ADST_FLIPADST:
  ------------------
  |  Branch (5729:5): [True: 0, False: 359k]
  ------------------
 5730|      0|    case FLIPADST_ADST:
  ------------------
  |  Branch (5730:5): [True: 0, False: 359k]
  ------------------
 5731|      0|      highbd_inv_txfm2d_add_no_identity_sse41(
 5732|      0|          input, CONVERT_TO_SHORTPTR(output), stride, tx_type, tx_size, eob,
  ------------------
  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5733|      0|          bd);
 5734|      0|      break;
 5735|  80.0k|    case V_DCT:
  ------------------
  |  Branch (5735:5): [True: 80.0k, False: 279k]
  ------------------
 5736|  82.7k|    case V_ADST:
  ------------------
  |  Branch (5736:5): [True: 2.72k, False: 356k]
  ------------------
 5737|  84.8k|    case V_FLIPADST:
  ------------------
  |  Branch (5737:5): [True: 2.14k, False: 357k]
  ------------------
 5738|  84.8k|      highbd_inv_txfm2d_add_h_identity_ssse41(
 5739|  84.8k|          input, CONVERT_TO_SHORTPTR(output), stride, tx_type, tx_size, eob,
  ------------------
  |  |   79|  84.8k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5740|  84.8k|          bd);
 5741|  84.8k|      break;
 5742|   250k|    case H_DCT:
  ------------------
  |  Branch (5742:5): [True: 250k, False: 108k]
  ------------------
 5743|   260k|    case H_ADST:
  ------------------
  |  Branch (5743:5): [True: 9.77k, False: 349k]
  ------------------
 5744|   267k|    case H_FLIPADST:
  ------------------
  |  Branch (5744:5): [True: 7.05k, False: 352k]
  ------------------
 5745|   267k|      highbd_inv_txfm2d_add_v_identity_ssse41(
 5746|   267k|          input, CONVERT_TO_SHORTPTR(output), stride, tx_type, tx_size, eob,
  ------------------
  |  |   79|   267k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5747|   267k|          bd);
 5748|   267k|      break;
 5749|  7.30k|    case IDTX:
  ------------------
  |  Branch (5749:5): [True: 7.30k, False: 352k]
  ------------------
 5750|  7.30k|      highbd_inv_txfm2d_add_idtx_ssse41(input, CONVERT_TO_SHORTPTR(output),
  ------------------
  |  |   79|  7.30k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5751|  7.30k|                                        stride, tx_type, tx_size, eob, bd);
 5752|  7.30k|      break;
 5753|      0|    default: assert(0); break;
  ------------------
  |  Branch (5753:5): [True: 0, False: 359k]
  ------------------
 5754|   359k|  }
 5755|   359k|}
av1_highbd_inv_txfm_add_sse4_1:
 5802|  23.2M|                                    int stride, const TxfmParam *txfm_param) {
 5803|  23.2M|  assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]);
 5804|  23.2M|  const TX_SIZE tx_size = txfm_param->tx_size;
 5805|  23.2M|  switch (tx_size) {
 5806|      0|    case TX_8X8:
  ------------------
  |  Branch (5806:5): [True: 0, False: 23.2M]
  ------------------
 5807|      0|      av1_highbd_inv_txfm_add_8x8_sse4_1(input, dest, stride, txfm_param);
 5808|      0|      break;
 5809|  2.41M|    case TX_4X8:
  ------------------
  |  Branch (5809:5): [True: 2.41M, False: 20.8M]
  ------------------
 5810|  2.41M|      av1_highbd_inv_txfm_add_4x8_sse4_1(input, dest, stride, txfm_param);
 5811|  2.41M|      break;
 5812|  1.65M|    case TX_8X4:
  ------------------
  |  Branch (5812:5): [True: 1.65M, False: 21.6M]
  ------------------
 5813|  1.65M|      av1_highbd_inv_txfm_add_8x4_sse4_1(input, dest, stride, txfm_param);
 5814|  1.65M|      break;
 5815|  19.2M|    case TX_4X4:
  ------------------
  |  Branch (5815:5): [True: 19.2M, False: 4.04M]
  ------------------
 5816|  19.2M|      av1_highbd_inv_txfm_add_4x4_sse4_1(input, dest, stride, txfm_param);
 5817|  19.2M|      break;
 5818|      0|    case TX_16X4:
  ------------------
  |  Branch (5818:5): [True: 0, False: 23.2M]
  ------------------
 5819|      0|      av1_highbd_inv_txfm_add_16x4_sse4_1(input, dest, stride, txfm_param);
 5820|      0|      break;
 5821|      0|    case TX_4X16:
  ------------------
  |  Branch (5821:5): [True: 0, False: 23.2M]
  ------------------
 5822|      0|      av1_highbd_inv_txfm_add_4x16_sse4_1(input, dest, stride, txfm_param);
 5823|      0|      break;
 5824|      0|    default:
  ------------------
  |  Branch (5824:5): [True: 0, False: 23.2M]
  ------------------
 5825|      0|      av1_highbd_inv_txfm2d_add_universe_sse4_1(
 5826|      0|          input, dest, stride, txfm_param->tx_type, tx_size, txfm_param->eob,
 5827|      0|          txfm_param->bd);
 5828|      0|      break;
 5829|  23.2M|  }
 5830|  23.2M|}
highbd_inv_txfm_sse4.c:load_buffer_4x4:
  141|  19.2M|static inline void load_buffer_4x4(const int32_t *coeff, __m128i *in) {
  142|  19.2M|  in[0] = _mm_load_si128((const __m128i *)(coeff + 0));
  143|  19.2M|  in[1] = _mm_load_si128((const __m128i *)(coeff + 4));
  144|  19.2M|  in[2] = _mm_load_si128((const __m128i *)(coeff + 8));
  145|  19.2M|  in[3] = _mm_load_si128((const __m128i *)(coeff + 12));
  146|  19.2M|}
highbd_inv_txfm_sse4.c:highbd_clamp_epi16:
   24|  57.7M|static inline __m128i highbd_clamp_epi16(__m128i u, int bd) {
   25|  57.7M|  const __m128i zero = _mm_setzero_si128();
   26|  57.7M|  const __m128i one = _mm_set1_epi16(1);
   27|  57.7M|  const __m128i max = _mm_sub_epi16(_mm_slli_epi16(one, bd), one);
   28|  57.7M|  __m128i clamped, mask;
   29|       |
   30|  57.7M|  mask = _mm_cmpgt_epi16(u, max);
   31|  57.7M|  clamped = _mm_andnot_si128(mask, u);
   32|  57.7M|  mask = _mm_and_si128(mask, max);
   33|  57.7M|  clamped = _mm_or_si128(mask, clamped);
   34|  57.7M|  mask = _mm_cmpgt_epi16(clamped, zero);
   35|  57.7M|  clamped = _mm_and_si128(clamped, mask);
   36|       |
   37|  57.7M|  return clamped;
   38|  57.7M|}
highbd_inv_txfm_sse4.c:idct4x4_sse4_1:
  456|  24.3M|                           int bd, int out_shift) {
  457|  24.3M|  const int32_t *cospi = cospi_arr(bit);
  458|  24.3M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
  459|  24.3M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
  460|  24.3M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
  461|  24.3M|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
  462|  24.3M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
  463|  24.3M|  int log_range = get_log_range(bd, do_cols);
  464|  24.3M|  __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
  465|  24.3M|  __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
  466|  24.3M|  __m128i u0, u1, u2, u3;
  467|  24.3M|  __m128i v0, v1, v2, v3, x, y;
  468|       |
  469|       |  // Stage 0
  470|       |  // Stage 1
  471|       |  // Stage 2
  472|  24.3M|  u0 = in[0];
  473|  24.3M|  u1 = in[1];
  474|  24.3M|  u2 = in[2];
  475|  24.3M|  u3 = in[3];
  476|       |
  477|  24.3M|  x = _mm_mullo_epi32(u0, cospi32);
  478|  24.3M|  y = _mm_mullo_epi32(u2, cospi32);
  479|  24.3M|  v0 = _mm_add_epi32(x, y);
  480|  24.3M|  v0 = _mm_add_epi32(v0, rnding);
  481|  24.3M|  v0 = _mm_srai_epi32(v0, bit);
  482|       |
  483|  24.3M|  v1 = _mm_sub_epi32(x, y);
  484|  24.3M|  v1 = _mm_add_epi32(v1, rnding);
  485|  24.3M|  v1 = _mm_srai_epi32(v1, bit);
  486|       |
  487|  24.3M|  x = _mm_mullo_epi32(u1, cospi48);
  488|  24.3M|  y = _mm_mullo_epi32(u3, cospim16);
  489|  24.3M|  v2 = _mm_add_epi32(x, y);
  490|  24.3M|  v2 = _mm_add_epi32(v2, rnding);
  491|  24.3M|  v2 = _mm_srai_epi32(v2, bit);
  492|       |
  493|  24.3M|  x = _mm_mullo_epi32(u1, cospi16);
  494|  24.3M|  y = _mm_mullo_epi32(u3, cospi48);
  495|  24.3M|  v3 = _mm_add_epi32(x, y);
  496|  24.3M|  v3 = _mm_add_epi32(v3, rnding);
  497|  24.3M|  v3 = _mm_srai_epi32(v3, bit);
  498|       |
  499|       |  // Stage 3
  500|  24.3M|  addsub_sse4_1(v0, v3, out + 0, out + 3, &clamp_lo, &clamp_hi);
  501|  24.3M|  addsub_sse4_1(v1, v2, out + 1, out + 2, &clamp_lo, &clamp_hi);
  502|       |
  503|  24.3M|  if (!do_cols) {
  ------------------
  |  Branch (503:7): [True: 13.1M, False: 11.1M]
  ------------------
  504|  13.1M|    log_range = get_log_range_out(bd);
  505|  13.1M|    clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
  506|  13.1M|    clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
  507|       |
  508|  13.1M|    shift_and_clamp_sse4_1(out + 0, out + 3, &clamp_lo, &clamp_hi, out_shift);
  509|  13.1M|    shift_and_clamp_sse4_1(out + 1, out + 2, &clamp_lo, &clamp_hi, out_shift);
  510|  13.1M|  }
  511|  24.3M|}
highbd_inv_txfm_sse4.c:addsub_sse4_1:
  219|  86.4M|                          const __m128i *clamp_hi) {
  220|  86.4M|  __m128i a0 = _mm_add_epi32(in0, in1);
  221|  86.4M|  __m128i a1 = _mm_sub_epi32(in0, in1);
  222|       |
  223|  86.4M|  a0 = _mm_max_epi32(a0, *clamp_lo);
  224|  86.4M|  a0 = _mm_min_epi32(a0, *clamp_hi);
  225|  86.4M|  a1 = _mm_max_epi32(a1, *clamp_lo);
  226|  86.4M|  a1 = _mm_min_epi32(a1, *clamp_hi);
  227|       |
  228|  86.4M|  *out0 = a0;
  229|  86.4M|  *out1 = a1;
  230|  86.4M|}
highbd_inv_txfm_sse4.c:shift_and_clamp_sse4_1:
  234|  26.2M|                                   const __m128i *clamp_hi, int shift) {
  235|  26.2M|  __m128i offset = _mm_set1_epi32((1 << shift) >> 1);
  236|  26.2M|  __m128i in0_w_offset = _mm_add_epi32(*in0, offset);
  237|  26.2M|  __m128i in1_w_offset = _mm_add_epi32(*in1, offset);
  238|       |
  239|  26.2M|  in0_w_offset = _mm_sra_epi32(in0_w_offset, _mm_cvtsi32_si128(shift));
  240|  26.2M|  in1_w_offset = _mm_sra_epi32(in1_w_offset, _mm_cvtsi32_si128(shift));
  241|       |
  242|  26.2M|  in0_w_offset = _mm_max_epi32(in0_w_offset, *clamp_lo);
  243|  26.2M|  in0_w_offset = _mm_min_epi32(in0_w_offset, *clamp_hi);
  244|  26.2M|  in1_w_offset = _mm_max_epi32(in1_w_offset, *clamp_lo);
  245|  26.2M|  in1_w_offset = _mm_min_epi32(in1_w_offset, *clamp_hi);
  246|       |
  247|  26.2M|  *in0 = in0_w_offset;
  248|  26.2M|  *in1 = in1_w_offset;
  249|  26.2M|}
highbd_inv_txfm_sse4.c:write_buffer_4x4:
  634|  15.6M|                             int fliplr, int flipud, int shift, int bd) {
  635|  15.6M|  const __m128i zero = _mm_setzero_si128();
  636|  15.6M|  __m128i u0, u1, u2, u3;
  637|  15.6M|  __m128i v0, v1, v2, v3;
  638|       |
  639|  15.6M|  round_shift_4x4(in, shift);
  640|       |
  641|  15.6M|  v0 = _mm_loadl_epi64((__m128i const *)(output + 0 * stride));
  642|  15.6M|  v1 = _mm_loadl_epi64((__m128i const *)(output + 1 * stride));
  643|  15.6M|  v2 = _mm_loadl_epi64((__m128i const *)(output + 2 * stride));
  644|  15.6M|  v3 = _mm_loadl_epi64((__m128i const *)(output + 3 * stride));
  645|       |
  646|  15.6M|  v0 = _mm_unpacklo_epi16(v0, zero);
  647|  15.6M|  v1 = _mm_unpacklo_epi16(v1, zero);
  648|  15.6M|  v2 = _mm_unpacklo_epi16(v2, zero);
  649|  15.6M|  v3 = _mm_unpacklo_epi16(v3, zero);
  650|       |
  651|  15.6M|  if (fliplr) {
  ------------------
  |  Branch (651:7): [True: 129k, False: 15.5M]
  ------------------
  652|   129k|    in[0] = _mm_shuffle_epi32(in[0], 0x1B);
  653|   129k|    in[1] = _mm_shuffle_epi32(in[1], 0x1B);
  654|   129k|    in[2] = _mm_shuffle_epi32(in[2], 0x1B);
  655|   129k|    in[3] = _mm_shuffle_epi32(in[3], 0x1B);
  656|   129k|  }
  657|       |
  658|  15.6M|  if (flipud) {
  ------------------
  |  Branch (658:7): [True: 90.6k, False: 15.5M]
  ------------------
  659|  90.6k|    u0 = _mm_add_epi32(in[3], v0);
  660|  90.6k|    u1 = _mm_add_epi32(in[2], v1);
  661|  90.6k|    u2 = _mm_add_epi32(in[1], v2);
  662|  90.6k|    u3 = _mm_add_epi32(in[0], v3);
  663|  15.5M|  } else {
  664|  15.5M|    u0 = _mm_add_epi32(in[0], v0);
  665|  15.5M|    u1 = _mm_add_epi32(in[1], v1);
  666|  15.5M|    u2 = _mm_add_epi32(in[2], v2);
  667|  15.5M|    u3 = _mm_add_epi32(in[3], v3);
  668|  15.5M|  }
  669|       |
  670|  15.6M|  v0 = _mm_packus_epi32(u0, u1);
  671|  15.6M|  v2 = _mm_packus_epi32(u2, u3);
  672|       |
  673|  15.6M|  u0 = highbd_clamp_epi16(v0, bd);
  674|  15.6M|  u2 = highbd_clamp_epi16(v2, bd);
  675|       |
  676|  15.6M|  v0 = _mm_unpacklo_epi64(u0, u0);
  677|  15.6M|  v1 = _mm_unpackhi_epi64(u0, u0);
  678|  15.6M|  v2 = _mm_unpacklo_epi64(u2, u2);
  679|  15.6M|  v3 = _mm_unpackhi_epi64(u2, u2);
  680|       |
  681|  15.6M|  _mm_storel_epi64((__m128i *)(output + 0 * stride), v0);
  682|  15.6M|  _mm_storel_epi64((__m128i *)(output + 1 * stride), v1);
  683|  15.6M|  _mm_storel_epi64((__m128i *)(output + 2 * stride), v2);
  684|  15.6M|  _mm_storel_epi64((__m128i *)(output + 3 * stride), v3);
  685|  15.6M|}
highbd_inv_txfm_sse4.c:round_shift_4x4:
   40|  26.6M|static inline void round_shift_4x4(__m128i *in, int shift) {
   41|  26.6M|  if (shift != 0) {
  ------------------
  |  Branch (41:7): [True: 17.1M, False: 9.47M]
  ------------------
   42|  17.1M|    __m128i rnding = _mm_set1_epi32(1 << (shift - 1));
   43|  17.1M|    in[0] = _mm_add_epi32(in[0], rnding);
   44|  17.1M|    in[1] = _mm_add_epi32(in[1], rnding);
   45|  17.1M|    in[2] = _mm_add_epi32(in[2], rnding);
   46|  17.1M|    in[3] = _mm_add_epi32(in[3], rnding);
   47|       |
   48|  17.1M|    in[0] = _mm_srai_epi32(in[0], shift);
   49|  17.1M|    in[1] = _mm_srai_epi32(in[1], shift);
   50|  17.1M|    in[2] = _mm_srai_epi32(in[2], shift);
   51|  17.1M|    in[3] = _mm_srai_epi32(in[3], shift);
   52|  17.1M|  }
   53|  26.6M|}
highbd_inv_txfm_sse4.c:iadst4x4_sse4_1:
  514|  13.4M|                            int bd, int out_shift) {
  515|  13.4M|  const int32_t *sinpi = sinpi_arr(bit);
  516|  13.4M|  const __m128i zero = _mm_setzero_si128();
  517|  13.4M|  __m128i rnding = _mm_set1_epi32(1 << (bit + 4 - 1));
  518|  13.4M|  rnding = _mm_unpacklo_epi32(rnding, zero);
  519|  13.4M|  const __m128i mul = _mm_set1_epi32(1 << 4);
  520|  13.4M|  const __m128i sinpi1 = _mm_set1_epi32((int)sinpi[1]);
  521|  13.4M|  const __m128i sinpi2 = _mm_set1_epi32((int)sinpi[2]);
  522|  13.4M|  const __m128i sinpi3 = _mm_set1_epi32((int)sinpi[3]);
  523|  13.4M|  const __m128i sinpi4 = _mm_set1_epi32((int)sinpi[4]);
  524|  13.4M|  __m128i t;
  525|  13.4M|  __m128i s0, s1, s2, s3, s4, s5, s6, s7;
  526|  13.4M|  __m128i x0, x1, x2, x3;
  527|  13.4M|  __m128i u0, u1, u2, u3;
  528|  13.4M|  __m128i u0_low, u1_low, u2_low, u3_low;
  529|  13.4M|  __m128i u0_high, u1_high, u2_high, u3_high;
  530|       |
  531|  13.4M|  x0 = in[0];
  532|  13.4M|  x1 = in[1];
  533|  13.4M|  x2 = in[2];
  534|  13.4M|  x3 = in[3];
  535|       |
  536|  13.4M|  s0 = _mm_mullo_epi32(x0, sinpi1);
  537|  13.4M|  s1 = _mm_mullo_epi32(x0, sinpi2);
  538|  13.4M|  s2 = _mm_mullo_epi32(x1, sinpi3);
  539|  13.4M|  s3 = _mm_mullo_epi32(x2, sinpi4);
  540|  13.4M|  s4 = _mm_mullo_epi32(x2, sinpi1);
  541|  13.4M|  s5 = _mm_mullo_epi32(x3, sinpi2);
  542|  13.4M|  s6 = _mm_mullo_epi32(x3, sinpi4);
  543|  13.4M|  t = _mm_sub_epi32(x0, x2);
  544|  13.4M|  s7 = _mm_add_epi32(t, x3);
  545|       |
  546|  13.4M|  t = _mm_add_epi32(s0, s3);
  547|  13.4M|  s0 = _mm_add_epi32(t, s5);
  548|  13.4M|  t = _mm_sub_epi32(s1, s4);
  549|  13.4M|  s1 = _mm_sub_epi32(t, s6);
  550|  13.4M|  s3 = s2;
  551|  13.4M|  s2 = _mm_mullo_epi32(s7, sinpi3);
  552|       |
  553|  13.4M|  u0 = _mm_add_epi32(s0, s3);
  554|  13.4M|  u1 = _mm_add_epi32(s1, s3);
  555|  13.4M|  u2 = s2;
  556|  13.4M|  t = _mm_add_epi32(s0, s1);
  557|  13.4M|  u3 = _mm_sub_epi32(t, s3);
  558|       |
  559|       |  // u0
  560|  13.4M|  u0_low = _mm_mul_epi32(u0, mul);
  561|  13.4M|  u0_low = _mm_add_epi64(u0_low, rnding);
  562|       |
  563|  13.4M|  u0 = _mm_srli_si128(u0, 4);
  564|  13.4M|  u0_high = _mm_mul_epi32(u0, mul);
  565|  13.4M|  u0_high = _mm_add_epi64(u0_high, rnding);
  566|       |
  567|  13.4M|  u0_low = _mm_srli_si128(u0_low, 2);
  568|  13.4M|  u0_high = _mm_srli_si128(u0_high, 2);
  569|       |
  570|  13.4M|  u0 = _mm_unpacklo_epi32(u0_low, u0_high);
  571|  13.4M|  u0_high = _mm_unpackhi_epi32(u0_low, u0_high);
  572|  13.4M|  u0 = _mm_unpacklo_epi64(u0, u0_high);
  573|       |
  574|       |  // u1
  575|  13.4M|  u1_low = _mm_mul_epi32(u1, mul);
  576|  13.4M|  u1_low = _mm_add_epi64(u1_low, rnding);
  577|       |
  578|  13.4M|  u1 = _mm_srli_si128(u1, 4);
  579|  13.4M|  u1_high = _mm_mul_epi32(u1, mul);
  580|  13.4M|  u1_high = _mm_add_epi64(u1_high, rnding);
  581|       |
  582|  13.4M|  u1_low = _mm_srli_si128(u1_low, 2);
  583|  13.4M|  u1_high = _mm_srli_si128(u1_high, 2);
  584|       |
  585|  13.4M|  u1 = _mm_unpacklo_epi32(u1_low, u1_high);
  586|  13.4M|  u1_high = _mm_unpackhi_epi32(u1_low, u1_high);
  587|  13.4M|  u1 = _mm_unpacklo_epi64(u1, u1_high);
  588|       |
  589|       |  // u2
  590|  13.4M|  u2_low = _mm_mul_epi32(u2, mul);
  591|  13.4M|  u2_low = _mm_add_epi64(u2_low, rnding);
  592|       |
  593|  13.4M|  u2 = _mm_srli_si128(u2, 4);
  594|  13.4M|  u2_high = _mm_mul_epi32(u2, mul);
  595|  13.4M|  u2_high = _mm_add_epi64(u2_high, rnding);
  596|       |
  597|  13.4M|  u2_low = _mm_srli_si128(u2_low, 2);
  598|  13.4M|  u2_high = _mm_srli_si128(u2_high, 2);
  599|       |
  600|  13.4M|  u2 = _mm_unpacklo_epi32(u2_low, u2_high);
  601|  13.4M|  u2_high = _mm_unpackhi_epi32(u2_low, u2_high);
  602|  13.4M|  u2 = _mm_unpacklo_epi64(u2, u2_high);
  603|       |
  604|       |  // u3
  605|  13.4M|  u3_low = _mm_mul_epi32(u3, mul);
  606|  13.4M|  u3_low = _mm_add_epi64(u3_low, rnding);
  607|       |
  608|  13.4M|  u3 = _mm_srli_si128(u3, 4);
  609|  13.4M|  u3_high = _mm_mul_epi32(u3, mul);
  610|  13.4M|  u3_high = _mm_add_epi64(u3_high, rnding);
  611|       |
  612|  13.4M|  u3_low = _mm_srli_si128(u3_low, 2);
  613|  13.4M|  u3_high = _mm_srli_si128(u3_high, 2);
  614|       |
  615|  13.4M|  u3 = _mm_unpacklo_epi32(u3_low, u3_high);
  616|  13.4M|  u3_high = _mm_unpackhi_epi32(u3_low, u3_high);
  617|  13.4M|  u3 = _mm_unpacklo_epi64(u3, u3_high);
  618|       |
  619|  13.4M|  out[0] = u0;
  620|  13.4M|  out[1] = u1;
  621|  13.4M|  out[2] = u2;
  622|  13.4M|  out[3] = u3;
  623|       |
  624|  13.4M|  if (!do_cols) {
  ------------------
  |  Branch (624:7): [True: 7.02M, False: 6.43M]
  ------------------
  625|  7.02M|    const int log_range = get_log_range_out(bd);
  626|  7.02M|    const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
  627|  7.02M|    const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
  628|  7.02M|    round_shift_4x4(out, out_shift);
  629|  7.02M|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo, &clamp_hi, 4);
  630|  7.02M|  }
  631|  13.4M|}
highbd_inv_txfm_sse4.c:highbd_clamp_epi32_sse4_1:
   64|  9.15M|                                      const __m128i *clamp_hi, int size) {
   65|  9.15M|  __m128i a0, a1;
   66|  20.1M|  for (int i = 0; i < size; i += 4) {
  ------------------
  |  Branch (66:19): [True: 11.0M, False: 9.15M]
  ------------------
   67|  11.0M|    a0 = _mm_max_epi32(in[i], *clamp_lo);
   68|  11.0M|    out[i] = _mm_min_epi32(a0, *clamp_hi);
   69|       |
   70|  11.0M|    a1 = _mm_max_epi32(in[i + 1], *clamp_lo);
   71|  11.0M|    out[i + 1] = _mm_min_epi32(a1, *clamp_hi);
   72|       |
   73|  11.0M|    a0 = _mm_max_epi32(in[i + 2], *clamp_lo);
   74|  11.0M|    out[i + 2] = _mm_min_epi32(a0, *clamp_hi);
   75|       |
   76|  11.0M|    a1 = _mm_max_epi32(in[i + 3], *clamp_lo);
   77|  11.0M|    out[i + 3] = _mm_min_epi32(a1, *clamp_hi);
   78|  11.0M|  }
   79|  9.15M|}
highbd_inv_txfm_sse4.c:iidentity4_sse4_1:
  688|  1.69M|                              int bd, int out_shift) {
  689|  1.69M|  (void)bit;
  690|  1.69M|  __m128i zero = _mm_setzero_si128();
  691|  1.69M|  __m128i fact = _mm_set1_epi32(NewSqrt2);
  692|  1.69M|  __m128i offset = _mm_set1_epi32(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  1.69M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  693|  1.69M|  __m128i a0_low, a1_low;
  694|  1.69M|  __m128i a0_high, a1_high;
  695|       |
  696|  1.69M|  offset = _mm_unpacklo_epi32(offset, zero);
  697|       |
  698|  8.48M|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (698:19): [True: 6.79M, False: 1.69M]
  ------------------
  699|  6.79M|    a0_low = _mm_mul_epi32(in[i], fact);
  700|  6.79M|    a0_low = _mm_add_epi32(a0_low, offset);
  701|  6.79M|    a0_low = _mm_srli_epi64(a0_low, NewSqrt2Bits);
  ------------------
  |  |   42|  6.79M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  702|       |
  703|  6.79M|    a0_high = _mm_srli_si128(in[i], 4);
  704|  6.79M|    a0_high = _mm_mul_epi32(a0_high, fact);
  705|  6.79M|    a0_high = _mm_add_epi32(a0_high, offset);
  706|  6.79M|    a0_high = _mm_srli_epi64(a0_high, NewSqrt2Bits);
  ------------------
  |  |   42|  6.79M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  707|       |
  708|  6.79M|    a1_low = _mm_unpacklo_epi32(a0_low, a0_high);
  709|  6.79M|    a1_high = _mm_unpackhi_epi32(a0_low, a0_high);
  710|  6.79M|    out[i] = _mm_unpacklo_epi64(a1_low, a1_high);
  711|  6.79M|  }
  712|       |
  713|  1.69M|  if (!do_cols) {
  ------------------
  |  Branch (713:7): [True: 354k, False: 1.34M]
  ------------------
  714|   354k|    const int log_range = get_log_range_out(bd);
  715|   354k|    const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
  716|   354k|    const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
  717|   354k|    round_shift_4x4(out, out_shift);
  718|   354k|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo, &clamp_hi, 4);
  719|   354k|  }
  720|  1.69M|}
highbd_inv_txfm_sse4.c:round_shift_8x8:
   55|  45.3k|static void round_shift_8x8(__m128i *in, int shift) {
   56|  45.3k|  round_shift_4x4(&in[0], shift);
   57|  45.3k|  round_shift_4x4(&in[4], shift);
   58|  45.3k|  round_shift_4x4(&in[8], shift);
   59|  45.3k|  round_shift_4x4(&in[12], shift);
   60|  45.3k|}
highbd_inv_txfm_sse4.c:neg_shift_sse4_1:
  438|  2.46M|                             int shift) {
  439|  2.46M|  __m128i offset = _mm_set1_epi32((1 << shift) >> 1);
  440|  2.46M|  __m128i a0 = _mm_add_epi32(offset, in0);
  441|  2.46M|  __m128i a1 = _mm_sub_epi32(offset, in1);
  442|       |
  443|  2.46M|  a0 = _mm_sra_epi32(a0, _mm_cvtsi32_si128(shift));
  444|  2.46M|  a1 = _mm_sra_epi32(a1, _mm_cvtsi32_si128(shift));
  445|       |
  446|  2.46M|  a0 = _mm_max_epi32(a0, *clamp_lo);
  447|  2.46M|  a0 = _mm_min_epi32(a0, *clamp_hi);
  448|  2.46M|  a1 = _mm_max_epi32(a1, *clamp_lo);
  449|  2.46M|  a1 = _mm_min_epi32(a1, *clamp_hi);
  450|       |
  451|  2.46M|  *out0 = a0;
  452|  2.46M|  *out1 = a1;
  453|  2.46M|}
highbd_inv_txfm_sse4.c:idct8x8_low1_sse4_1:
 1471|  5.95k|                                int bd, int out_shift) {
 1472|  5.95k|  const int32_t *cospi = cospi_arr(bit);
 1473|  5.95k|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1474|  5.95k|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1475|  5.95k|  const int log_range = get_log_range(bd, do_cols);
 1476|  5.95k|  __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1477|  5.95k|  __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1478|  5.95k|  __m128i x;
 1479|       |
 1480|       |  // stage 0
 1481|       |  // stage 1
 1482|       |  // stage 2
 1483|       |  // stage 3
 1484|  5.95k|  x = _mm_mullo_epi32(in[0], cospi32);
 1485|  5.95k|  x = _mm_add_epi32(x, rnding);
 1486|  5.95k|  x = _mm_srai_epi32(x, bit);
 1487|       |
 1488|       |  // stage 4
 1489|       |  // stage 5
 1490|  5.95k|  if (!do_cols) {
  ------------------
  |  Branch (1490:7): [True: 4.26k, False: 1.69k]
  ------------------
 1491|  4.26k|    const int log_range_out = get_log_range_out(bd);
 1492|  4.26k|    clamp_lo = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 1493|  4.26k|    clamp_hi = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 1494|       |
 1495|  4.26k|    __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1);
 1496|  4.26k|    x = _mm_add_epi32(x, offset);
 1497|  4.26k|    x = _mm_sra_epi32(x, _mm_cvtsi32_si128(out_shift));
 1498|  4.26k|  }
 1499|       |
 1500|  5.95k|  x = _mm_max_epi32(x, clamp_lo);
 1501|  5.95k|  x = _mm_min_epi32(x, clamp_hi);
 1502|  5.95k|  out[0] = x;
 1503|  5.95k|  out[1] = x;
 1504|  5.95k|  out[2] = x;
 1505|  5.95k|  out[3] = x;
 1506|  5.95k|  out[4] = x;
 1507|  5.95k|  out[5] = x;
 1508|  5.95k|  out[6] = x;
 1509|  5.95k|  out[7] = x;
 1510|  5.95k|}
highbd_inv_txfm_sse4.c:idct8x8_new_sse4_1:
 1513|  3.40M|                               int bd, int out_shift) {
 1514|  3.40M|  const int32_t *cospi = cospi_arr(bit);
 1515|  3.40M|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 1516|  3.40M|  const __m128i cospim8 = _mm_set1_epi32(-cospi[8]);
 1517|  3.40M|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 1518|  3.40M|  const __m128i cospim40 = _mm_set1_epi32(-cospi[40]);
 1519|  3.40M|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
 1520|  3.40M|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 1521|  3.40M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1522|  3.40M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 1523|  3.40M|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
 1524|  3.40M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 1525|  3.40M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1526|  3.40M|  const int log_range = get_log_range(bd, do_cols);
 1527|  3.40M|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1528|  3.40M|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1529|  3.40M|  __m128i u0, u1, u2, u3, u4, u5, u6, u7;
 1530|  3.40M|  __m128i v0, v1, v2, v3, v4, v5, v6, v7;
 1531|  3.40M|  __m128i x, y;
 1532|       |
 1533|       |  // stage 0
 1534|       |  // stage 1
 1535|       |  // stage 2
 1536|  3.40M|  u0 = in[0];
 1537|  3.40M|  u1 = in[4];
 1538|  3.40M|  u2 = in[2];
 1539|  3.40M|  u3 = in[6];
 1540|       |
 1541|  3.40M|  x = _mm_mullo_epi32(in[1], cospi56);
 1542|  3.40M|  y = _mm_mullo_epi32(in[7], cospim8);
 1543|  3.40M|  u4 = _mm_add_epi32(x, y);
 1544|  3.40M|  u4 = _mm_add_epi32(u4, rnding);
 1545|  3.40M|  u4 = _mm_srai_epi32(u4, bit);
 1546|       |
 1547|  3.40M|  x = _mm_mullo_epi32(in[1], cospi8);
 1548|  3.40M|  y = _mm_mullo_epi32(in[7], cospi56);
 1549|  3.40M|  u7 = _mm_add_epi32(x, y);
 1550|  3.40M|  u7 = _mm_add_epi32(u7, rnding);
 1551|  3.40M|  u7 = _mm_srai_epi32(u7, bit);
 1552|       |
 1553|  3.40M|  x = _mm_mullo_epi32(in[5], cospi24);
 1554|  3.40M|  y = _mm_mullo_epi32(in[3], cospim40);
 1555|  3.40M|  u5 = _mm_add_epi32(x, y);
 1556|  3.40M|  u5 = _mm_add_epi32(u5, rnding);
 1557|  3.40M|  u5 = _mm_srai_epi32(u5, bit);
 1558|       |
 1559|  3.40M|  x = _mm_mullo_epi32(in[5], cospi40);
 1560|  3.40M|  y = _mm_mullo_epi32(in[3], cospi24);
 1561|  3.40M|  u6 = _mm_add_epi32(x, y);
 1562|  3.40M|  u6 = _mm_add_epi32(u6, rnding);
 1563|  3.40M|  u6 = _mm_srai_epi32(u6, bit);
 1564|       |
 1565|       |  // stage 3
 1566|  3.40M|  x = _mm_mullo_epi32(u0, cospi32);
 1567|  3.40M|  y = _mm_mullo_epi32(u1, cospi32);
 1568|  3.40M|  v0 = _mm_add_epi32(x, y);
 1569|  3.40M|  v0 = _mm_add_epi32(v0, rnding);
 1570|  3.40M|  v0 = _mm_srai_epi32(v0, bit);
 1571|       |
 1572|  3.40M|  v1 = _mm_sub_epi32(x, y);
 1573|  3.40M|  v1 = _mm_add_epi32(v1, rnding);
 1574|  3.40M|  v1 = _mm_srai_epi32(v1, bit);
 1575|       |
 1576|  3.40M|  x = _mm_mullo_epi32(u2, cospi48);
 1577|  3.40M|  y = _mm_mullo_epi32(u3, cospim16);
 1578|  3.40M|  v2 = _mm_add_epi32(x, y);
 1579|  3.40M|  v2 = _mm_add_epi32(v2, rnding);
 1580|  3.40M|  v2 = _mm_srai_epi32(v2, bit);
 1581|       |
 1582|  3.40M|  x = _mm_mullo_epi32(u2, cospi16);
 1583|  3.40M|  y = _mm_mullo_epi32(u3, cospi48);
 1584|  3.40M|  v3 = _mm_add_epi32(x, y);
 1585|  3.40M|  v3 = _mm_add_epi32(v3, rnding);
 1586|  3.40M|  v3 = _mm_srai_epi32(v3, bit);
 1587|       |
 1588|  3.40M|  addsub_sse4_1(u4, u5, &v4, &v5, &clamp_lo, &clamp_hi);
 1589|  3.40M|  addsub_sse4_1(u7, u6, &v7, &v6, &clamp_lo, &clamp_hi);
 1590|       |
 1591|       |  // stage 4
 1592|  3.40M|  addsub_sse4_1(v0, v3, &u0, &u3, &clamp_lo, &clamp_hi);
 1593|  3.40M|  addsub_sse4_1(v1, v2, &u1, &u2, &clamp_lo, &clamp_hi);
 1594|  3.40M|  u4 = v4;
 1595|  3.40M|  u7 = v7;
 1596|       |
 1597|  3.40M|  x = _mm_mullo_epi32(v5, cospi32);
 1598|  3.40M|  y = _mm_mullo_epi32(v6, cospi32);
 1599|  3.40M|  u6 = _mm_add_epi32(y, x);
 1600|  3.40M|  u6 = _mm_add_epi32(u6, rnding);
 1601|  3.40M|  u6 = _mm_srai_epi32(u6, bit);
 1602|       |
 1603|  3.40M|  u5 = _mm_sub_epi32(y, x);
 1604|  3.40M|  u5 = _mm_add_epi32(u5, rnding);
 1605|  3.40M|  u5 = _mm_srai_epi32(u5, bit);
 1606|       |
 1607|       |  // stage 5
 1608|  3.40M|  addsub_sse4_1(u0, u7, out + 0, out + 7, &clamp_lo, &clamp_hi);
 1609|  3.40M|  addsub_sse4_1(u1, u6, out + 1, out + 6, &clamp_lo, &clamp_hi);
 1610|  3.40M|  addsub_sse4_1(u2, u5, out + 2, out + 5, &clamp_lo, &clamp_hi);
 1611|  3.40M|  addsub_sse4_1(u3, u4, out + 3, out + 4, &clamp_lo, &clamp_hi);
 1612|       |
 1613|  3.40M|  if (!do_cols) {
  ------------------
  |  Branch (1613:7): [True: 1.54M, False: 1.85M]
  ------------------
 1614|  1.54M|    const int log_range_out = get_log_range_out(bd);
 1615|  1.54M|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 1616|  1.54M|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 1617|       |
 1618|  1.54M|    round_shift_4x4(out, out_shift);
 1619|  1.54M|    round_shift_4x4(out + 4, out_shift);
 1620|  1.54M|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 8);
 1621|  1.54M|  }
 1622|  3.40M|}
highbd_inv_txfm_sse4.c:iadst8x8_low1_sse4_1:
 1625|    356|                                 int do_cols, int bd, int out_shift) {
 1626|    356|  const int32_t *cospi = cospi_arr(bit);
 1627|    356|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
 1628|    356|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
 1629|    356|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 1630|    356|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 1631|    356|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1632|    356|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1633|    356|  const __m128i kZero = _mm_setzero_si128();
 1634|    356|  __m128i u[8], x;
 1635|       |
 1636|       |  // stage 0
 1637|       |  // stage 1
 1638|       |  // stage 2
 1639|       |
 1640|    356|  x = _mm_mullo_epi32(in[0], cospi60);
 1641|    356|  u[0] = _mm_add_epi32(x, rnding);
 1642|    356|  u[0] = _mm_srai_epi32(u[0], bit);
 1643|       |
 1644|    356|  x = _mm_mullo_epi32(in[0], cospi4);
 1645|    356|  u[1] = _mm_sub_epi32(kZero, x);
 1646|    356|  u[1] = _mm_add_epi32(u[1], rnding);
 1647|    356|  u[1] = _mm_srai_epi32(u[1], bit);
 1648|       |
 1649|       |  // stage 3
 1650|       |  // stage 4
 1651|    356|  __m128i temp1, temp2;
 1652|    356|  temp1 = _mm_mullo_epi32(u[0], cospi16);
 1653|    356|  x = _mm_mullo_epi32(u[1], cospi48);
 1654|    356|  temp1 = _mm_add_epi32(temp1, x);
 1655|    356|  temp1 = _mm_add_epi32(temp1, rnding);
 1656|    356|  temp1 = _mm_srai_epi32(temp1, bit);
 1657|    356|  u[4] = temp1;
 1658|       |
 1659|    356|  temp2 = _mm_mullo_epi32(u[0], cospi48);
 1660|    356|  x = _mm_mullo_epi32(u[1], cospi16);
 1661|    356|  u[5] = _mm_sub_epi32(temp2, x);
 1662|    356|  u[5] = _mm_add_epi32(u[5], rnding);
 1663|    356|  u[5] = _mm_srai_epi32(u[5], bit);
 1664|       |
 1665|       |  // stage 5
 1666|       |  // stage 6
 1667|    356|  temp1 = _mm_mullo_epi32(u[0], cospi32);
 1668|    356|  x = _mm_mullo_epi32(u[1], cospi32);
 1669|    356|  u[2] = _mm_add_epi32(temp1, x);
 1670|    356|  u[2] = _mm_add_epi32(u[2], rnding);
 1671|    356|  u[2] = _mm_srai_epi32(u[2], bit);
 1672|       |
 1673|    356|  u[3] = _mm_sub_epi32(temp1, x);
 1674|    356|  u[3] = _mm_add_epi32(u[3], rnding);
 1675|    356|  u[3] = _mm_srai_epi32(u[3], bit);
 1676|       |
 1677|    356|  temp1 = _mm_mullo_epi32(u[4], cospi32);
 1678|    356|  x = _mm_mullo_epi32(u[5], cospi32);
 1679|    356|  u[6] = _mm_add_epi32(temp1, x);
 1680|    356|  u[6] = _mm_add_epi32(u[6], rnding);
 1681|    356|  u[6] = _mm_srai_epi32(u[6], bit);
 1682|       |
 1683|    356|  u[7] = _mm_sub_epi32(temp1, x);
 1684|    356|  u[7] = _mm_add_epi32(u[7], rnding);
 1685|    356|  u[7] = _mm_srai_epi32(u[7], bit);
 1686|       |
 1687|       |  // stage 7
 1688|    356|  if (do_cols) {
  ------------------
  |  Branch (1688:7): [True: 184, False: 172]
  ------------------
 1689|    184|    out[0] = u[0];
 1690|    184|    out[1] = _mm_sub_epi32(kZero, u[4]);
 1691|    184|    out[2] = u[6];
 1692|    184|    out[3] = _mm_sub_epi32(kZero, u[2]);
 1693|    184|    out[4] = u[3];
 1694|    184|    out[5] = _mm_sub_epi32(kZero, u[7]);
 1695|    184|    out[6] = u[5];
 1696|    184|    out[7] = _mm_sub_epi32(kZero, u[1]);
 1697|    184|  } else {
 1698|    172|    const int log_range_out = get_log_range_out(bd);
 1699|    172|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 1700|    172|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 1701|       |
 1702|    172|    neg_shift_sse4_1(u[0], u[4], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 1703|    172|                     out_shift);
 1704|    172|    neg_shift_sse4_1(u[6], u[2], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out,
 1705|    172|                     out_shift);
 1706|    172|    neg_shift_sse4_1(u[3], u[7], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out,
 1707|    172|                     out_shift);
 1708|    172|    neg_shift_sse4_1(u[5], u[1], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out,
 1709|    172|                     out_shift);
 1710|    172|  }
 1711|    356|}
highbd_inv_txfm_sse4.c:iadst8x8_new_sse4_1:
 1714|  1.31M|                                int bd, int out_shift) {
 1715|  1.31M|  const int32_t *cospi = cospi_arr(bit);
 1716|  1.31M|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
 1717|  1.31M|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
 1718|  1.31M|  const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
 1719|  1.31M|  const __m128i cospi44 = _mm_set1_epi32(cospi[44]);
 1720|  1.31M|  const __m128i cospi36 = _mm_set1_epi32(cospi[36]);
 1721|  1.31M|  const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
 1722|  1.31M|  const __m128i cospi52 = _mm_set1_epi32(cospi[52]);
 1723|  1.31M|  const __m128i cospi12 = _mm_set1_epi32(cospi[12]);
 1724|  1.31M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 1725|  1.31M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 1726|  1.31M|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 1727|  1.31M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1728|  1.31M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1729|  1.31M|  const __m128i kZero = _mm_setzero_si128();
 1730|  1.31M|  const int log_range = get_log_range(bd, do_cols);
 1731|  1.31M|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1732|  1.31M|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1733|  1.31M|  __m128i u[8], v[8], x;
 1734|       |
 1735|       |  // stage 0
 1736|       |  // stage 1
 1737|       |  // stage 2
 1738|       |
 1739|  1.31M|  u[0] = _mm_mullo_epi32(in[7], cospi4);
 1740|  1.31M|  x = _mm_mullo_epi32(in[0], cospi60);
 1741|  1.31M|  u[0] = _mm_add_epi32(u[0], x);
 1742|  1.31M|  u[0] = _mm_add_epi32(u[0], rnding);
 1743|  1.31M|  u[0] = _mm_srai_epi32(u[0], bit);
 1744|       |
 1745|  1.31M|  u[1] = _mm_mullo_epi32(in[7], cospi60);
 1746|  1.31M|  x = _mm_mullo_epi32(in[0], cospi4);
 1747|  1.31M|  u[1] = _mm_sub_epi32(u[1], x);
 1748|  1.31M|  u[1] = _mm_add_epi32(u[1], rnding);
 1749|  1.31M|  u[1] = _mm_srai_epi32(u[1], bit);
 1750|       |
 1751|       |  // (2)
 1752|  1.31M|  u[2] = _mm_mullo_epi32(in[5], cospi20);
 1753|  1.31M|  x = _mm_mullo_epi32(in[2], cospi44);
 1754|  1.31M|  u[2] = _mm_add_epi32(u[2], x);
 1755|  1.31M|  u[2] = _mm_add_epi32(u[2], rnding);
 1756|  1.31M|  u[2] = _mm_srai_epi32(u[2], bit);
 1757|       |
 1758|  1.31M|  u[3] = _mm_mullo_epi32(in[5], cospi44);
 1759|  1.31M|  x = _mm_mullo_epi32(in[2], cospi20);
 1760|  1.31M|  u[3] = _mm_sub_epi32(u[3], x);
 1761|  1.31M|  u[3] = _mm_add_epi32(u[3], rnding);
 1762|  1.31M|  u[3] = _mm_srai_epi32(u[3], bit);
 1763|       |
 1764|       |  // (3)
 1765|  1.31M|  u[4] = _mm_mullo_epi32(in[3], cospi36);
 1766|  1.31M|  x = _mm_mullo_epi32(in[4], cospi28);
 1767|  1.31M|  u[4] = _mm_add_epi32(u[4], x);
 1768|  1.31M|  u[4] = _mm_add_epi32(u[4], rnding);
 1769|  1.31M|  u[4] = _mm_srai_epi32(u[4], bit);
 1770|       |
 1771|  1.31M|  u[5] = _mm_mullo_epi32(in[3], cospi28);
 1772|  1.31M|  x = _mm_mullo_epi32(in[4], cospi36);
 1773|  1.31M|  u[5] = _mm_sub_epi32(u[5], x);
 1774|  1.31M|  u[5] = _mm_add_epi32(u[5], rnding);
 1775|  1.31M|  u[5] = _mm_srai_epi32(u[5], bit);
 1776|       |
 1777|       |  // (4)
 1778|  1.31M|  u[6] = _mm_mullo_epi32(in[1], cospi52);
 1779|  1.31M|  x = _mm_mullo_epi32(in[6], cospi12);
 1780|  1.31M|  u[6] = _mm_add_epi32(u[6], x);
 1781|  1.31M|  u[6] = _mm_add_epi32(u[6], rnding);
 1782|  1.31M|  u[6] = _mm_srai_epi32(u[6], bit);
 1783|       |
 1784|  1.31M|  u[7] = _mm_mullo_epi32(in[1], cospi12);
 1785|  1.31M|  x = _mm_mullo_epi32(in[6], cospi52);
 1786|  1.31M|  u[7] = _mm_sub_epi32(u[7], x);
 1787|  1.31M|  u[7] = _mm_add_epi32(u[7], rnding);
 1788|  1.31M|  u[7] = _mm_srai_epi32(u[7], bit);
 1789|       |
 1790|       |  // stage 3
 1791|  1.31M|  addsub_sse4_1(u[0], u[4], &v[0], &v[4], &clamp_lo, &clamp_hi);
 1792|  1.31M|  addsub_sse4_1(u[1], u[5], &v[1], &v[5], &clamp_lo, &clamp_hi);
 1793|  1.31M|  addsub_sse4_1(u[2], u[6], &v[2], &v[6], &clamp_lo, &clamp_hi);
 1794|  1.31M|  addsub_sse4_1(u[3], u[7], &v[3], &v[7], &clamp_lo, &clamp_hi);
 1795|       |
 1796|       |  // stage 4
 1797|  1.31M|  u[0] = v[0];
 1798|  1.31M|  u[1] = v[1];
 1799|  1.31M|  u[2] = v[2];
 1800|  1.31M|  u[3] = v[3];
 1801|       |
 1802|  1.31M|  u[4] = _mm_mullo_epi32(v[4], cospi16);
 1803|  1.31M|  x = _mm_mullo_epi32(v[5], cospi48);
 1804|  1.31M|  u[4] = _mm_add_epi32(u[4], x);
 1805|  1.31M|  u[4] = _mm_add_epi32(u[4], rnding);
 1806|  1.31M|  u[4] = _mm_srai_epi32(u[4], bit);
 1807|       |
 1808|  1.31M|  u[5] = _mm_mullo_epi32(v[4], cospi48);
 1809|  1.31M|  x = _mm_mullo_epi32(v[5], cospi16);
 1810|  1.31M|  u[5] = _mm_sub_epi32(u[5], x);
 1811|  1.31M|  u[5] = _mm_add_epi32(u[5], rnding);
 1812|  1.31M|  u[5] = _mm_srai_epi32(u[5], bit);
 1813|       |
 1814|  1.31M|  u[6] = _mm_mullo_epi32(v[6], cospim48);
 1815|  1.31M|  x = _mm_mullo_epi32(v[7], cospi16);
 1816|  1.31M|  u[6] = _mm_add_epi32(u[6], x);
 1817|  1.31M|  u[6] = _mm_add_epi32(u[6], rnding);
 1818|  1.31M|  u[6] = _mm_srai_epi32(u[6], bit);
 1819|       |
 1820|  1.31M|  u[7] = _mm_mullo_epi32(v[6], cospi16);
 1821|  1.31M|  x = _mm_mullo_epi32(v[7], cospim48);
 1822|  1.31M|  u[7] = _mm_sub_epi32(u[7], x);
 1823|  1.31M|  u[7] = _mm_add_epi32(u[7], rnding);
 1824|  1.31M|  u[7] = _mm_srai_epi32(u[7], bit);
 1825|       |
 1826|       |  // stage 5
 1827|  1.31M|  addsub_sse4_1(u[0], u[2], &v[0], &v[2], &clamp_lo, &clamp_hi);
 1828|  1.31M|  addsub_sse4_1(u[1], u[3], &v[1], &v[3], &clamp_lo, &clamp_hi);
 1829|  1.31M|  addsub_sse4_1(u[4], u[6], &v[4], &v[6], &clamp_lo, &clamp_hi);
 1830|  1.31M|  addsub_sse4_1(u[5], u[7], &v[5], &v[7], &clamp_lo, &clamp_hi);
 1831|       |
 1832|       |  // stage 6
 1833|  1.31M|  u[0] = v[0];
 1834|  1.31M|  u[1] = v[1];
 1835|  1.31M|  u[4] = v[4];
 1836|  1.31M|  u[5] = v[5];
 1837|       |
 1838|  1.31M|  v[0] = _mm_mullo_epi32(v[2], cospi32);
 1839|  1.31M|  x = _mm_mullo_epi32(v[3], cospi32);
 1840|  1.31M|  u[2] = _mm_add_epi32(v[0], x);
 1841|  1.31M|  u[2] = _mm_add_epi32(u[2], rnding);
 1842|  1.31M|  u[2] = _mm_srai_epi32(u[2], bit);
 1843|       |
 1844|  1.31M|  u[3] = _mm_sub_epi32(v[0], x);
 1845|  1.31M|  u[3] = _mm_add_epi32(u[3], rnding);
 1846|  1.31M|  u[3] = _mm_srai_epi32(u[3], bit);
 1847|       |
 1848|  1.31M|  v[0] = _mm_mullo_epi32(v[6], cospi32);
 1849|  1.31M|  x = _mm_mullo_epi32(v[7], cospi32);
 1850|  1.31M|  u[6] = _mm_add_epi32(v[0], x);
 1851|  1.31M|  u[6] = _mm_add_epi32(u[6], rnding);
 1852|  1.31M|  u[6] = _mm_srai_epi32(u[6], bit);
 1853|       |
 1854|  1.31M|  u[7] = _mm_sub_epi32(v[0], x);
 1855|  1.31M|  u[7] = _mm_add_epi32(u[7], rnding);
 1856|  1.31M|  u[7] = _mm_srai_epi32(u[7], bit);
 1857|       |
 1858|       |  // stage 7
 1859|  1.31M|  if (do_cols) {
  ------------------
  |  Branch (1859:7): [True: 696k, False: 614k]
  ------------------
 1860|   696k|    out[0] = u[0];
 1861|   696k|    out[1] = _mm_sub_epi32(kZero, u[4]);
 1862|   696k|    out[2] = u[6];
 1863|   696k|    out[3] = _mm_sub_epi32(kZero, u[2]);
 1864|   696k|    out[4] = u[3];
 1865|   696k|    out[5] = _mm_sub_epi32(kZero, u[7]);
 1866|   696k|    out[6] = u[5];
 1867|   696k|    out[7] = _mm_sub_epi32(kZero, u[1]);
 1868|   696k|  } else {
 1869|   614k|    const int log_range_out = get_log_range_out(bd);
 1870|   614k|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 1871|   614k|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 1872|       |
 1873|   614k|    neg_shift_sse4_1(u[0], u[4], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 1874|   614k|                     out_shift);
 1875|   614k|    neg_shift_sse4_1(u[6], u[2], out + 2, out + 3, &clamp_lo_out, &clamp_hi_out,
 1876|   614k|                     out_shift);
 1877|   614k|    neg_shift_sse4_1(u[3], u[7], out + 4, out + 5, &clamp_lo_out, &clamp_hi_out,
 1878|   614k|                     out_shift);
 1879|   614k|    neg_shift_sse4_1(u[5], u[1], out + 6, out + 7, &clamp_lo_out, &clamp_hi_out,
 1880|   614k|                     out_shift);
 1881|   614k|  }
 1882|  1.31M|}
highbd_inv_txfm_sse4.c:iidentity8_sse4_1:
 1307|   766k|                              int bd, int out_shift) {
 1308|   766k|  (void)bit;
 1309|   766k|  out[0] = _mm_add_epi32(in[0], in[0]);
 1310|   766k|  out[1] = _mm_add_epi32(in[1], in[1]);
 1311|   766k|  out[2] = _mm_add_epi32(in[2], in[2]);
 1312|   766k|  out[3] = _mm_add_epi32(in[3], in[3]);
 1313|   766k|  out[4] = _mm_add_epi32(in[4], in[4]);
 1314|   766k|  out[5] = _mm_add_epi32(in[5], in[5]);
 1315|   766k|  out[6] = _mm_add_epi32(in[6], in[6]);
 1316|   766k|  out[7] = _mm_add_epi32(in[7], in[7]);
 1317|       |
 1318|   766k|  if (!do_cols) {
  ------------------
  |  Branch (1318:7): [True: 197k, False: 569k]
  ------------------
 1319|   197k|    const int log_range = get_log_range_out(bd);
 1320|   197k|    const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1321|   197k|    const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1322|   197k|    round_shift_4x4(out, out_shift);
 1323|   197k|    round_shift_4x4(out + 4, out_shift);
 1324|   197k|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo, &clamp_hi, 8);
 1325|   197k|  }
 1326|   766k|}
highbd_inv_txfm_sse4.c:idct16x16_low1_sse4_1:
 1885|    390|                                  int do_cols, int bd, int out_shift) {
 1886|    390|  const int32_t *cospi = cospi_arr(bit);
 1887|    390|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1888|    390|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1889|    390|  int log_range = get_log_range(bd, do_cols);
 1890|    390|  __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1891|    390|  __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1892|       |  // stage 0
 1893|       |  // stage 1
 1894|       |  // stage 2
 1895|       |  // stage 3
 1896|       |  // stage 4
 1897|    390|  in[0] = _mm_mullo_epi32(in[0], cospi32);
 1898|    390|  in[0] = _mm_add_epi32(in[0], rnding);
 1899|    390|  in[0] = _mm_srai_epi32(in[0], bit);
 1900|       |
 1901|       |  // stage 5
 1902|       |  // stage 6
 1903|       |  // stage 7
 1904|    390|  if (!do_cols) {
  ------------------
  |  Branch (1904:7): [True: 286, False: 104]
  ------------------
 1905|    286|    log_range = get_log_range_out(bd);
 1906|    286|    clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1907|    286|    clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1908|    286|    if (out_shift != 0) {
  ------------------
  |  Branch (1908:9): [True: 286, False: 0]
  ------------------
 1909|    286|      __m128i offset = _mm_set1_epi32((1 << out_shift) >> 1);
 1910|    286|      in[0] = _mm_add_epi32(in[0], offset);
 1911|    286|      in[0] = _mm_sra_epi32(in[0], _mm_cvtsi32_si128(out_shift));
 1912|    286|    }
 1913|    286|  }
 1914|       |
 1915|    390|  in[0] = _mm_max_epi32(in[0], clamp_lo);
 1916|    390|  in[0] = _mm_min_epi32(in[0], clamp_hi);
 1917|    390|  out[0] = in[0];
 1918|    390|  out[1] = in[0];
 1919|    390|  out[2] = in[0];
 1920|    390|  out[3] = in[0];
 1921|    390|  out[4] = in[0];
 1922|    390|  out[5] = in[0];
 1923|    390|  out[6] = in[0];
 1924|    390|  out[7] = in[0];
 1925|    390|  out[8] = in[0];
 1926|    390|  out[9] = in[0];
 1927|    390|  out[10] = in[0];
 1928|    390|  out[11] = in[0];
 1929|    390|  out[12] = in[0];
 1930|    390|  out[13] = in[0];
 1931|    390|  out[14] = in[0];
 1932|    390|  out[15] = in[0];
 1933|    390|}
highbd_inv_txfm_sse4.c:idct16x16_low8_sse4_1:
 1936|    466|                                  int do_cols, int bd, int out_shift) {
 1937|    466|  const int32_t *cospi = cospi_arr(bit);
 1938|    466|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
 1939|    466|  const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
 1940|    466|  const __m128i cospi44 = _mm_set1_epi32(cospi[44]);
 1941|    466|  const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
 1942|    466|  const __m128i cospi12 = _mm_set1_epi32(cospi[12]);
 1943|    466|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
 1944|    466|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 1945|    466|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 1946|    466|  const __m128i cospim40 = _mm_set1_epi32(-cospi[40]);
 1947|    466|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 1948|    466|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1949|    466|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 1950|    466|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 1951|    466|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
 1952|    466|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 1953|    466|  const __m128i cospim36 = _mm_set1_epi32(-cospi[36]);
 1954|    466|  const __m128i cospim52 = _mm_set1_epi32(-cospi[52]);
 1955|    466|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1956|    466|  const int log_range = get_log_range(bd, do_cols);
 1957|    466|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 1958|    466|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 1959|    466|  __m128i u[16], x, y;
 1960|       |  // stage 0
 1961|       |  // stage 1
 1962|    466|  u[0] = in[0];
 1963|    466|  u[2] = in[4];
 1964|    466|  u[4] = in[2];
 1965|    466|  u[6] = in[6];
 1966|    466|  u[8] = in[1];
 1967|    466|  u[10] = in[5];
 1968|    466|  u[12] = in[3];
 1969|    466|  u[14] = in[7];
 1970|       |
 1971|       |  // stage 2
 1972|    466|  u[15] = half_btf_0_sse4_1(&cospi4, &u[8], &rnding, bit);
 1973|    466|  u[8] = half_btf_0_sse4_1(&cospi60, &u[8], &rnding, bit);
 1974|       |
 1975|    466|  u[9] = half_btf_0_sse4_1(&cospim36, &u[14], &rnding, bit);
 1976|    466|  u[14] = half_btf_0_sse4_1(&cospi28, &u[14], &rnding, bit);
 1977|       |
 1978|    466|  u[13] = half_btf_0_sse4_1(&cospi20, &u[10], &rnding, bit);
 1979|    466|  u[10] = half_btf_0_sse4_1(&cospi44, &u[10], &rnding, bit);
 1980|       |
 1981|    466|  u[11] = half_btf_0_sse4_1(&cospim52, &u[12], &rnding, bit);
 1982|    466|  u[12] = half_btf_0_sse4_1(&cospi12, &u[12], &rnding, bit);
 1983|       |
 1984|       |  // stage 3
 1985|    466|  u[7] = half_btf_0_sse4_1(&cospi8, &u[4], &rnding, bit);
 1986|    466|  u[4] = half_btf_0_sse4_1(&cospi56, &u[4], &rnding, bit);
 1987|    466|  u[5] = half_btf_0_sse4_1(&cospim40, &u[6], &rnding, bit);
 1988|    466|  u[6] = half_btf_0_sse4_1(&cospi24, &u[6], &rnding, bit);
 1989|       |
 1990|    466|  addsub_sse4_1(u[8], u[9], &u[8], &u[9], &clamp_lo, &clamp_hi);
 1991|    466|  addsub_sse4_1(u[11], u[10], &u[11], &u[10], &clamp_lo, &clamp_hi);
 1992|    466|  addsub_sse4_1(u[12], u[13], &u[12], &u[13], &clamp_lo, &clamp_hi);
 1993|    466|  addsub_sse4_1(u[15], u[14], &u[15], &u[14], &clamp_lo, &clamp_hi);
 1994|       |
 1995|       |  // stage 4
 1996|    466|  x = _mm_mullo_epi32(u[0], cospi32);
 1997|    466|  u[0] = _mm_add_epi32(x, rnding);
 1998|    466|  u[0] = _mm_srai_epi32(u[0], bit);
 1999|    466|  u[1] = u[0];
 2000|       |
 2001|    466|  u[3] = half_btf_0_sse4_1(&cospi16, &u[2], &rnding, bit);
 2002|    466|  u[2] = half_btf_0_sse4_1(&cospi48, &u[2], &rnding, bit);
 2003|       |
 2004|    466|  addsub_sse4_1(u[4], u[5], &u[4], &u[5], &clamp_lo, &clamp_hi);
 2005|    466|  addsub_sse4_1(u[7], u[6], &u[7], &u[6], &clamp_lo, &clamp_hi);
 2006|       |
 2007|    466|  x = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 2008|    466|  u[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 2009|    466|  u[9] = x;
 2010|    466|  y = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 2011|    466|  u[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 2012|    466|  u[10] = y;
 2013|       |
 2014|       |  // stage 5
 2015|    466|  addsub_sse4_1(u[0], u[3], &u[0], &u[3], &clamp_lo, &clamp_hi);
 2016|    466|  addsub_sse4_1(u[1], u[2], &u[1], &u[2], &clamp_lo, &clamp_hi);
 2017|       |
 2018|    466|  x = _mm_mullo_epi32(u[5], cospi32);
 2019|    466|  y = _mm_mullo_epi32(u[6], cospi32);
 2020|    466|  u[5] = _mm_sub_epi32(y, x);
 2021|    466|  u[5] = _mm_add_epi32(u[5], rnding);
 2022|    466|  u[5] = _mm_srai_epi32(u[5], bit);
 2023|       |
 2024|    466|  u[6] = _mm_add_epi32(y, x);
 2025|    466|  u[6] = _mm_add_epi32(u[6], rnding);
 2026|    466|  u[6] = _mm_srai_epi32(u[6], bit);
 2027|       |
 2028|    466|  addsub_sse4_1(u[8], u[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 2029|    466|  addsub_sse4_1(u[9], u[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 2030|    466|  addsub_sse4_1(u[15], u[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 2031|    466|  addsub_sse4_1(u[14], u[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 2032|       |
 2033|       |  // stage 6
 2034|    466|  addsub_sse4_1(u[0], u[7], &u[0], &u[7], &clamp_lo, &clamp_hi);
 2035|    466|  addsub_sse4_1(u[1], u[6], &u[1], &u[6], &clamp_lo, &clamp_hi);
 2036|    466|  addsub_sse4_1(u[2], u[5], &u[2], &u[5], &clamp_lo, &clamp_hi);
 2037|    466|  addsub_sse4_1(u[3], u[4], &u[3], &u[4], &clamp_lo, &clamp_hi);
 2038|       |
 2039|    466|  x = _mm_mullo_epi32(u[10], cospi32);
 2040|    466|  y = _mm_mullo_epi32(u[13], cospi32);
 2041|    466|  u[10] = _mm_sub_epi32(y, x);
 2042|    466|  u[10] = _mm_add_epi32(u[10], rnding);
 2043|    466|  u[10] = _mm_srai_epi32(u[10], bit);
 2044|       |
 2045|    466|  u[13] = _mm_add_epi32(x, y);
 2046|    466|  u[13] = _mm_add_epi32(u[13], rnding);
 2047|    466|  u[13] = _mm_srai_epi32(u[13], bit);
 2048|       |
 2049|    466|  x = _mm_mullo_epi32(u[11], cospi32);
 2050|    466|  y = _mm_mullo_epi32(u[12], cospi32);
 2051|    466|  u[11] = _mm_sub_epi32(y, x);
 2052|    466|  u[11] = _mm_add_epi32(u[11], rnding);
 2053|    466|  u[11] = _mm_srai_epi32(u[11], bit);
 2054|       |
 2055|    466|  u[12] = _mm_add_epi32(x, y);
 2056|    466|  u[12] = _mm_add_epi32(u[12], rnding);
 2057|    466|  u[12] = _mm_srai_epi32(u[12], bit);
 2058|       |  // stage 7
 2059|    466|  addsub_sse4_1(u[0], u[15], out + 0, out + 15, &clamp_lo, &clamp_hi);
 2060|    466|  addsub_sse4_1(u[1], u[14], out + 1, out + 14, &clamp_lo, &clamp_hi);
 2061|    466|  addsub_sse4_1(u[2], u[13], out + 2, out + 13, &clamp_lo, &clamp_hi);
 2062|    466|  addsub_sse4_1(u[3], u[12], out + 3, out + 12, &clamp_lo, &clamp_hi);
 2063|    466|  addsub_sse4_1(u[4], u[11], out + 4, out + 11, &clamp_lo, &clamp_hi);
 2064|    466|  addsub_sse4_1(u[5], u[10], out + 5, out + 10, &clamp_lo, &clamp_hi);
 2065|    466|  addsub_sse4_1(u[6], u[9], out + 6, out + 9, &clamp_lo, &clamp_hi);
 2066|    466|  addsub_sse4_1(u[7], u[8], out + 7, out + 8, &clamp_lo, &clamp_hi);
 2067|       |
 2068|    466|  if (!do_cols) {
  ------------------
  |  Branch (2068:7): [True: 361, False: 105]
  ------------------
 2069|    361|    const int log_range_out = get_log_range_out(bd);
 2070|    361|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 2071|    361|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 2072|    361|    round_shift_8x8(out, out_shift);
 2073|    361|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
 2074|    361|  }
 2075|    466|}
highbd_inv_txfm_sse4.c:idct16x16_sse4_1:
 2567|  9.41k|                             int bd, int out_shift) {
 2568|  9.41k|  const int32_t *cospi = cospi_arr(bit);
 2569|  9.41k|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
 2570|  9.41k|  const __m128i cospim4 = _mm_set1_epi32(-cospi[4]);
 2571|  9.41k|  const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
 2572|  9.41k|  const __m128i cospim36 = _mm_set1_epi32(-cospi[36]);
 2573|  9.41k|  const __m128i cospi44 = _mm_set1_epi32(cospi[44]);
 2574|  9.41k|  const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
 2575|  9.41k|  const __m128i cospim20 = _mm_set1_epi32(-cospi[20]);
 2576|  9.41k|  const __m128i cospi12 = _mm_set1_epi32(cospi[12]);
 2577|  9.41k|  const __m128i cospim52 = _mm_set1_epi32(-cospi[52]);
 2578|  9.41k|  const __m128i cospi52 = _mm_set1_epi32(cospi[52]);
 2579|  9.41k|  const __m128i cospi36 = _mm_set1_epi32(cospi[36]);
 2580|  9.41k|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
 2581|  9.41k|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 2582|  9.41k|  const __m128i cospim8 = _mm_set1_epi32(-cospi[8]);
 2583|  9.41k|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 2584|  9.41k|  const __m128i cospim40 = _mm_set1_epi32(-cospi[40]);
 2585|  9.41k|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
 2586|  9.41k|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 2587|  9.41k|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 2588|  9.41k|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 2589|  9.41k|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 2590|  9.41k|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
 2591|  9.41k|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 2592|  9.41k|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 2593|  9.41k|  const int log_range = get_log_range(bd, do_cols);
 2594|  9.41k|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 2595|  9.41k|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 2596|  9.41k|  __m128i u[16], v[16], x, y;
 2597|       |
 2598|  9.41k|  {
 2599|       |    // stage 0
 2600|       |    // stage 1
 2601|  9.41k|    u[0] = in[0];
 2602|  9.41k|    u[1] = in[8];
 2603|  9.41k|    u[2] = in[4];
 2604|  9.41k|    u[3] = in[12];
 2605|  9.41k|    u[4] = in[2];
 2606|  9.41k|    u[5] = in[10];
 2607|  9.41k|    u[6] = in[6];
 2608|  9.41k|    u[7] = in[14];
 2609|  9.41k|    u[8] = in[1];
 2610|  9.41k|    u[9] = in[9];
 2611|  9.41k|    u[10] = in[5];
 2612|  9.41k|    u[11] = in[13];
 2613|  9.41k|    u[12] = in[3];
 2614|  9.41k|    u[13] = in[11];
 2615|  9.41k|    u[14] = in[7];
 2616|  9.41k|    u[15] = in[15];
 2617|       |
 2618|       |    // stage 2
 2619|  9.41k|    v[0] = u[0];
 2620|  9.41k|    v[1] = u[1];
 2621|  9.41k|    v[2] = u[2];
 2622|  9.41k|    v[3] = u[3];
 2623|  9.41k|    v[4] = u[4];
 2624|  9.41k|    v[5] = u[5];
 2625|  9.41k|    v[6] = u[6];
 2626|  9.41k|    v[7] = u[7];
 2627|       |
 2628|  9.41k|    v[8] = half_btf_sse4_1(&cospi60, &u[8], &cospim4, &u[15], &rnding, bit);
 2629|  9.41k|    v[9] = half_btf_sse4_1(&cospi28, &u[9], &cospim36, &u[14], &rnding, bit);
 2630|  9.41k|    v[10] = half_btf_sse4_1(&cospi44, &u[10], &cospim20, &u[13], &rnding, bit);
 2631|  9.41k|    v[11] = half_btf_sse4_1(&cospi12, &u[11], &cospim52, &u[12], &rnding, bit);
 2632|  9.41k|    v[12] = half_btf_sse4_1(&cospi52, &u[11], &cospi12, &u[12], &rnding, bit);
 2633|  9.41k|    v[13] = half_btf_sse4_1(&cospi20, &u[10], &cospi44, &u[13], &rnding, bit);
 2634|  9.41k|    v[14] = half_btf_sse4_1(&cospi36, &u[9], &cospi28, &u[14], &rnding, bit);
 2635|  9.41k|    v[15] = half_btf_sse4_1(&cospi4, &u[8], &cospi60, &u[15], &rnding, bit);
 2636|       |
 2637|       |    // stage 3
 2638|  9.41k|    u[0] = v[0];
 2639|  9.41k|    u[1] = v[1];
 2640|  9.41k|    u[2] = v[2];
 2641|  9.41k|    u[3] = v[3];
 2642|  9.41k|    u[4] = half_btf_sse4_1(&cospi56, &v[4], &cospim8, &v[7], &rnding, bit);
 2643|  9.41k|    u[5] = half_btf_sse4_1(&cospi24, &v[5], &cospim40, &v[6], &rnding, bit);
 2644|  9.41k|    u[6] = half_btf_sse4_1(&cospi40, &v[5], &cospi24, &v[6], &rnding, bit);
 2645|  9.41k|    u[7] = half_btf_sse4_1(&cospi8, &v[4], &cospi56, &v[7], &rnding, bit);
 2646|  9.41k|    addsub_sse4_1(v[8], v[9], &u[8], &u[9], &clamp_lo, &clamp_hi);
 2647|  9.41k|    addsub_sse4_1(v[11], v[10], &u[11], &u[10], &clamp_lo, &clamp_hi);
 2648|  9.41k|    addsub_sse4_1(v[12], v[13], &u[12], &u[13], &clamp_lo, &clamp_hi);
 2649|  9.41k|    addsub_sse4_1(v[15], v[14], &u[15], &u[14], &clamp_lo, &clamp_hi);
 2650|       |
 2651|       |    // stage 4
 2652|  9.41k|    x = _mm_mullo_epi32(u[0], cospi32);
 2653|  9.41k|    y = _mm_mullo_epi32(u[1], cospi32);
 2654|  9.41k|    v[0] = _mm_add_epi32(x, y);
 2655|  9.41k|    v[0] = _mm_add_epi32(v[0], rnding);
 2656|  9.41k|    v[0] = _mm_srai_epi32(v[0], bit);
 2657|       |
 2658|  9.41k|    v[1] = _mm_sub_epi32(x, y);
 2659|  9.41k|    v[1] = _mm_add_epi32(v[1], rnding);
 2660|  9.41k|    v[1] = _mm_srai_epi32(v[1], bit);
 2661|       |
 2662|  9.41k|    v[2] = half_btf_sse4_1(&cospi48, &u[2], &cospim16, &u[3], &rnding, bit);
 2663|  9.41k|    v[3] = half_btf_sse4_1(&cospi16, &u[2], &cospi48, &u[3], &rnding, bit);
 2664|  9.41k|    addsub_sse4_1(u[4], u[5], &v[4], &v[5], &clamp_lo, &clamp_hi);
 2665|  9.41k|    addsub_sse4_1(u[7], u[6], &v[7], &v[6], &clamp_lo, &clamp_hi);
 2666|  9.41k|    v[8] = u[8];
 2667|  9.41k|    v[9] = half_btf_sse4_1(&cospim16, &u[9], &cospi48, &u[14], &rnding, bit);
 2668|  9.41k|    v[10] = half_btf_sse4_1(&cospim48, &u[10], &cospim16, &u[13], &rnding, bit);
 2669|  9.41k|    v[11] = u[11];
 2670|  9.41k|    v[12] = u[12];
 2671|  9.41k|    v[13] = half_btf_sse4_1(&cospim16, &u[10], &cospi48, &u[13], &rnding, bit);
 2672|  9.41k|    v[14] = half_btf_sse4_1(&cospi48, &u[9], &cospi16, &u[14], &rnding, bit);
 2673|  9.41k|    v[15] = u[15];
 2674|       |
 2675|       |    // stage 5
 2676|  9.41k|    addsub_sse4_1(v[0], v[3], &u[0], &u[3], &clamp_lo, &clamp_hi);
 2677|  9.41k|    addsub_sse4_1(v[1], v[2], &u[1], &u[2], &clamp_lo, &clamp_hi);
 2678|  9.41k|    u[4] = v[4];
 2679|       |
 2680|  9.41k|    x = _mm_mullo_epi32(v[5], cospi32);
 2681|  9.41k|    y = _mm_mullo_epi32(v[6], cospi32);
 2682|  9.41k|    u[5] = _mm_sub_epi32(y, x);
 2683|  9.41k|    u[5] = _mm_add_epi32(u[5], rnding);
 2684|  9.41k|    u[5] = _mm_srai_epi32(u[5], bit);
 2685|       |
 2686|  9.41k|    u[6] = _mm_add_epi32(y, x);
 2687|  9.41k|    u[6] = _mm_add_epi32(u[6], rnding);
 2688|  9.41k|    u[6] = _mm_srai_epi32(u[6], bit);
 2689|       |
 2690|  9.41k|    u[7] = v[7];
 2691|  9.41k|    addsub_sse4_1(v[8], v[11], &u[8], &u[11], &clamp_lo, &clamp_hi);
 2692|  9.41k|    addsub_sse4_1(v[9], v[10], &u[9], &u[10], &clamp_lo, &clamp_hi);
 2693|  9.41k|    addsub_sse4_1(v[15], v[12], &u[15], &u[12], &clamp_lo, &clamp_hi);
 2694|  9.41k|    addsub_sse4_1(v[14], v[13], &u[14], &u[13], &clamp_lo, &clamp_hi);
 2695|       |
 2696|       |    // stage 6
 2697|  9.41k|    addsub_sse4_1(u[0], u[7], &v[0], &v[7], &clamp_lo, &clamp_hi);
 2698|  9.41k|    addsub_sse4_1(u[1], u[6], &v[1], &v[6], &clamp_lo, &clamp_hi);
 2699|  9.41k|    addsub_sse4_1(u[2], u[5], &v[2], &v[5], &clamp_lo, &clamp_hi);
 2700|  9.41k|    addsub_sse4_1(u[3], u[4], &v[3], &v[4], &clamp_lo, &clamp_hi);
 2701|  9.41k|    v[8] = u[8];
 2702|  9.41k|    v[9] = u[9];
 2703|       |
 2704|  9.41k|    x = _mm_mullo_epi32(u[10], cospi32);
 2705|  9.41k|    y = _mm_mullo_epi32(u[13], cospi32);
 2706|  9.41k|    v[10] = _mm_sub_epi32(y, x);
 2707|  9.41k|    v[10] = _mm_add_epi32(v[10], rnding);
 2708|  9.41k|    v[10] = _mm_srai_epi32(v[10], bit);
 2709|       |
 2710|  9.41k|    v[13] = _mm_add_epi32(x, y);
 2711|  9.41k|    v[13] = _mm_add_epi32(v[13], rnding);
 2712|  9.41k|    v[13] = _mm_srai_epi32(v[13], bit);
 2713|       |
 2714|  9.41k|    x = _mm_mullo_epi32(u[11], cospi32);
 2715|  9.41k|    y = _mm_mullo_epi32(u[12], cospi32);
 2716|  9.41k|    v[11] = _mm_sub_epi32(y, x);
 2717|  9.41k|    v[11] = _mm_add_epi32(v[11], rnding);
 2718|  9.41k|    v[11] = _mm_srai_epi32(v[11], bit);
 2719|       |
 2720|  9.41k|    v[12] = _mm_add_epi32(x, y);
 2721|  9.41k|    v[12] = _mm_add_epi32(v[12], rnding);
 2722|  9.41k|    v[12] = _mm_srai_epi32(v[12], bit);
 2723|       |
 2724|  9.41k|    v[14] = u[14];
 2725|  9.41k|    v[15] = u[15];
 2726|       |
 2727|       |    // stage 7
 2728|  9.41k|    addsub_sse4_1(v[0], v[15], out + 0, out + 15, &clamp_lo, &clamp_hi);
 2729|  9.41k|    addsub_sse4_1(v[1], v[14], out + 1, out + 14, &clamp_lo, &clamp_hi);
 2730|  9.41k|    addsub_sse4_1(v[2], v[13], out + 2, out + 13, &clamp_lo, &clamp_hi);
 2731|  9.41k|    addsub_sse4_1(v[3], v[12], out + 3, out + 12, &clamp_lo, &clamp_hi);
 2732|  9.41k|    addsub_sse4_1(v[4], v[11], out + 4, out + 11, &clamp_lo, &clamp_hi);
 2733|  9.41k|    addsub_sse4_1(v[5], v[10], out + 5, out + 10, &clamp_lo, &clamp_hi);
 2734|  9.41k|    addsub_sse4_1(v[6], v[9], out + 6, out + 9, &clamp_lo, &clamp_hi);
 2735|  9.41k|    addsub_sse4_1(v[7], v[8], out + 7, out + 8, &clamp_lo, &clamp_hi);
 2736|       |
 2737|  9.41k|    if (!do_cols) {
  ------------------
  |  Branch (2737:9): [True: 5.49k, False: 3.92k]
  ------------------
 2738|  5.49k|      const int log_range_out = get_log_range_out(bd);
 2739|  5.49k|      const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 2740|  5.49k|      const __m128i clamp_hi_out =
 2741|  5.49k|          _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 2742|  5.49k|      round_shift_8x8(out, out_shift);
 2743|  5.49k|      highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 16);
 2744|  5.49k|    }
 2745|  9.41k|  }
 2746|  9.41k|}
highbd_inv_txfm_sse4.c:iadst16x16_low1_sse4_1:
 2078|      6|                                   int do_cols, int bd, int out_shift) {
 2079|      6|  const int32_t *cospi = cospi_arr(bit);
 2080|      6|  const __m128i cospi2 = _mm_set1_epi32(cospi[2]);
 2081|      6|  const __m128i cospi62 = _mm_set1_epi32(cospi[62]);
 2082|      6|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 2083|      6|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 2084|      6|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 2085|      6|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 2086|      6|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 2087|      6|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 2088|      6|  const __m128i zero = _mm_setzero_si128();
 2089|      6|  __m128i v[16], x, y, temp1, temp2;
 2090|       |  // stage 0
 2091|       |  // stage 1
 2092|       |  // stage 2
 2093|      6|  x = _mm_mullo_epi32(in[0], cospi62);
 2094|      6|  v[0] = _mm_add_epi32(x, rnding);
 2095|      6|  v[0] = _mm_srai_epi32(v[0], bit);
 2096|       |
 2097|      6|  x = _mm_mullo_epi32(in[0], cospi2);
 2098|      6|  v[1] = _mm_sub_epi32(zero, x);
 2099|      6|  v[1] = _mm_add_epi32(v[1], rnding);
 2100|      6|  v[1] = _mm_srai_epi32(v[1], bit);
 2101|       |
 2102|       |  // stage 3
 2103|      6|  v[8] = v[0];
 2104|      6|  v[9] = v[1];
 2105|       |
 2106|       |  // stage 4
 2107|      6|  temp1 = _mm_mullo_epi32(v[8], cospi8);
 2108|      6|  x = _mm_mullo_epi32(v[9], cospi56);
 2109|      6|  temp1 = _mm_add_epi32(temp1, x);
 2110|      6|  temp1 = _mm_add_epi32(temp1, rnding);
 2111|      6|  temp1 = _mm_srai_epi32(temp1, bit);
 2112|       |
 2113|      6|  temp2 = _mm_mullo_epi32(v[8], cospi56);
 2114|      6|  x = _mm_mullo_epi32(v[9], cospi8);
 2115|      6|  temp2 = _mm_sub_epi32(temp2, x);
 2116|      6|  temp2 = _mm_add_epi32(temp2, rnding);
 2117|      6|  temp2 = _mm_srai_epi32(temp2, bit);
 2118|      6|  v[8] = temp1;
 2119|      6|  v[9] = temp2;
 2120|       |
 2121|       |  // stage 5
 2122|      6|  v[4] = v[0];
 2123|      6|  v[5] = v[1];
 2124|      6|  v[12] = v[8];
 2125|      6|  v[13] = v[9];
 2126|       |
 2127|       |  // stage 6
 2128|      6|  temp1 = _mm_mullo_epi32(v[4], cospi16);
 2129|      6|  x = _mm_mullo_epi32(v[5], cospi48);
 2130|      6|  temp1 = _mm_add_epi32(temp1, x);
 2131|      6|  temp1 = _mm_add_epi32(temp1, rnding);
 2132|      6|  temp1 = _mm_srai_epi32(temp1, bit);
 2133|       |
 2134|      6|  temp2 = _mm_mullo_epi32(v[4], cospi48);
 2135|      6|  x = _mm_mullo_epi32(v[5], cospi16);
 2136|      6|  temp2 = _mm_sub_epi32(temp2, x);
 2137|      6|  temp2 = _mm_add_epi32(temp2, rnding);
 2138|      6|  temp2 = _mm_srai_epi32(temp2, bit);
 2139|      6|  v[4] = temp1;
 2140|      6|  v[5] = temp2;
 2141|       |
 2142|      6|  temp1 = _mm_mullo_epi32(v[12], cospi16);
 2143|      6|  x = _mm_mullo_epi32(v[13], cospi48);
 2144|      6|  temp1 = _mm_add_epi32(temp1, x);
 2145|      6|  temp1 = _mm_add_epi32(temp1, rnding);
 2146|      6|  temp1 = _mm_srai_epi32(temp1, bit);
 2147|       |
 2148|      6|  temp2 = _mm_mullo_epi32(v[12], cospi48);
 2149|      6|  x = _mm_mullo_epi32(v[13], cospi16);
 2150|      6|  temp2 = _mm_sub_epi32(temp2, x);
 2151|      6|  temp2 = _mm_add_epi32(temp2, rnding);
 2152|      6|  temp2 = _mm_srai_epi32(temp2, bit);
 2153|      6|  v[12] = temp1;
 2154|      6|  v[13] = temp2;
 2155|       |
 2156|       |  // stage 7
 2157|      6|  v[2] = v[0];
 2158|      6|  v[3] = v[1];
 2159|      6|  v[6] = v[4];
 2160|      6|  v[7] = v[5];
 2161|      6|  v[10] = v[8];
 2162|      6|  v[11] = v[9];
 2163|      6|  v[14] = v[12];
 2164|      6|  v[15] = v[13];
 2165|       |
 2166|       |  // stage 8
 2167|      6|  y = _mm_mullo_epi32(v[2], cospi32);
 2168|      6|  x = _mm_mullo_epi32(v[3], cospi32);
 2169|      6|  v[2] = _mm_add_epi32(y, x);
 2170|      6|  v[2] = _mm_add_epi32(v[2], rnding);
 2171|      6|  v[2] = _mm_srai_epi32(v[2], bit);
 2172|       |
 2173|      6|  v[3] = _mm_sub_epi32(y, x);
 2174|      6|  v[3] = _mm_add_epi32(v[3], rnding);
 2175|      6|  v[3] = _mm_srai_epi32(v[3], bit);
 2176|       |
 2177|      6|  y = _mm_mullo_epi32(v[6], cospi32);
 2178|      6|  x = _mm_mullo_epi32(v[7], cospi32);
 2179|      6|  v[6] = _mm_add_epi32(y, x);
 2180|      6|  v[6] = _mm_add_epi32(v[6], rnding);
 2181|      6|  v[6] = _mm_srai_epi32(v[6], bit);
 2182|       |
 2183|      6|  v[7] = _mm_sub_epi32(y, x);
 2184|      6|  v[7] = _mm_add_epi32(v[7], rnding);
 2185|      6|  v[7] = _mm_srai_epi32(v[7], bit);
 2186|       |
 2187|      6|  y = _mm_mullo_epi32(v[10], cospi32);
 2188|      6|  x = _mm_mullo_epi32(v[11], cospi32);
 2189|      6|  v[10] = _mm_add_epi32(y, x);
 2190|      6|  v[10] = _mm_add_epi32(v[10], rnding);
 2191|      6|  v[10] = _mm_srai_epi32(v[10], bit);
 2192|       |
 2193|      6|  v[11] = _mm_sub_epi32(y, x);
 2194|      6|  v[11] = _mm_add_epi32(v[11], rnding);
 2195|      6|  v[11] = _mm_srai_epi32(v[11], bit);
 2196|       |
 2197|      6|  y = _mm_mullo_epi32(v[14], cospi32);
 2198|      6|  x = _mm_mullo_epi32(v[15], cospi32);
 2199|      6|  v[14] = _mm_add_epi32(y, x);
 2200|      6|  v[14] = _mm_add_epi32(v[14], rnding);
 2201|      6|  v[14] = _mm_srai_epi32(v[14], bit);
 2202|       |
 2203|      6|  v[15] = _mm_sub_epi32(y, x);
 2204|      6|  v[15] = _mm_add_epi32(v[15], rnding);
 2205|      6|  v[15] = _mm_srai_epi32(v[15], bit);
 2206|       |
 2207|       |  // stage 9
 2208|      6|  if (do_cols) {
  ------------------
  |  Branch (2208:7): [True: 4, False: 2]
  ------------------
 2209|      4|    out[0] = v[0];
 2210|      4|    out[1] = _mm_sub_epi32(zero, v[8]);
 2211|      4|    out[2] = v[12];
 2212|      4|    out[3] = _mm_sub_epi32(zero, v[4]);
 2213|      4|    out[4] = v[6];
 2214|      4|    out[5] = _mm_sub_epi32(zero, v[14]);
 2215|      4|    out[6] = v[10];
 2216|      4|    out[7] = _mm_sub_epi32(zero, v[2]);
 2217|      4|    out[8] = v[3];
 2218|      4|    out[9] = _mm_sub_epi32(zero, v[11]);
 2219|      4|    out[10] = v[15];
 2220|      4|    out[11] = _mm_sub_epi32(zero, v[7]);
 2221|      4|    out[12] = v[5];
 2222|      4|    out[13] = _mm_sub_epi32(zero, v[13]);
 2223|      4|    out[14] = v[9];
 2224|      4|    out[15] = _mm_sub_epi32(zero, v[1]);
 2225|      4|  } else {
 2226|      2|    const int log_range_out = get_log_range_out(bd);
 2227|      2|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 2228|      2|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 2229|       |
 2230|      2|    neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2231|      2|                     out_shift);
 2232|      2|    neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out,
 2233|      2|                     &clamp_hi_out, out_shift);
 2234|      2|    neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out,
 2235|      2|                     &clamp_hi_out, out_shift);
 2236|      2|    neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out,
 2237|      2|                     &clamp_hi_out, out_shift);
 2238|      2|    neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out,
 2239|      2|                     &clamp_hi_out, out_shift);
 2240|      2|    neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out,
 2241|      2|                     &clamp_hi_out, out_shift);
 2242|      2|    neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out,
 2243|      2|                     &clamp_hi_out, out_shift);
 2244|      2|    neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out,
 2245|      2|                     &clamp_hi_out, out_shift);
 2246|      2|  }
 2247|      6|}
highbd_inv_txfm_sse4.c:iadst16x16_low8_sse4_1:
 2250|     42|                                   int do_cols, int bd, int out_shift) {
 2251|     42|  const int32_t *cospi = cospi_arr(bit);
 2252|     42|  const __m128i cospi2 = _mm_set1_epi32(cospi[2]);
 2253|     42|  const __m128i cospi62 = _mm_set1_epi32(cospi[62]);
 2254|     42|  const __m128i cospi10 = _mm_set1_epi32(cospi[10]);
 2255|     42|  const __m128i cospi54 = _mm_set1_epi32(cospi[54]);
 2256|     42|  const __m128i cospi18 = _mm_set1_epi32(cospi[18]);
 2257|     42|  const __m128i cospi46 = _mm_set1_epi32(cospi[46]);
 2258|     42|  const __m128i cospi26 = _mm_set1_epi32(cospi[26]);
 2259|     42|  const __m128i cospi38 = _mm_set1_epi32(cospi[38]);
 2260|     42|  const __m128i cospi34 = _mm_set1_epi32(cospi[34]);
 2261|     42|  const __m128i cospi30 = _mm_set1_epi32(cospi[30]);
 2262|     42|  const __m128i cospi42 = _mm_set1_epi32(cospi[42]);
 2263|     42|  const __m128i cospi22 = _mm_set1_epi32(cospi[22]);
 2264|     42|  const __m128i cospi50 = _mm_set1_epi32(cospi[50]);
 2265|     42|  const __m128i cospi14 = _mm_set1_epi32(cospi[14]);
 2266|     42|  const __m128i cospi58 = _mm_set1_epi32(cospi[58]);
 2267|     42|  const __m128i cospi6 = _mm_set1_epi32(cospi[6]);
 2268|     42|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 2269|     42|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 2270|     42|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
 2271|     42|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 2272|     42|  const __m128i cospim56 = _mm_set1_epi32(-cospi[56]);
 2273|     42|  const __m128i cospim24 = _mm_set1_epi32(-cospi[24]);
 2274|     42|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 2275|     42|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 2276|     42|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 2277|     42|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 2278|     42|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 2279|     42|  const int log_range = get_log_range(bd, do_cols);
 2280|     42|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 2281|     42|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 2282|     42|  __m128i zero = _mm_setzero_si128();
 2283|     42|  __m128i u[16], x, y;
 2284|       |
 2285|       |  // stage 0
 2286|       |  // stage 1
 2287|       |  // stage 2
 2288|     42|  x = _mm_mullo_epi32(in[0], cospi62);
 2289|     42|  u[0] = _mm_add_epi32(x, rnding);
 2290|     42|  u[0] = _mm_srai_epi32(u[0], bit);
 2291|       |
 2292|     42|  x = _mm_mullo_epi32(in[0], cospi2);
 2293|     42|  u[1] = _mm_sub_epi32(zero, x);
 2294|     42|  u[1] = _mm_add_epi32(u[1], rnding);
 2295|     42|  u[1] = _mm_srai_epi32(u[1], bit);
 2296|       |
 2297|     42|  x = _mm_mullo_epi32(in[2], cospi54);
 2298|     42|  u[2] = _mm_add_epi32(x, rnding);
 2299|     42|  u[2] = _mm_srai_epi32(u[2], bit);
 2300|       |
 2301|     42|  x = _mm_mullo_epi32(in[2], cospi10);
 2302|     42|  u[3] = _mm_sub_epi32(zero, x);
 2303|     42|  u[3] = _mm_add_epi32(u[3], rnding);
 2304|     42|  u[3] = _mm_srai_epi32(u[3], bit);
 2305|       |
 2306|     42|  x = _mm_mullo_epi32(in[4], cospi46);
 2307|     42|  u[4] = _mm_add_epi32(x, rnding);
 2308|     42|  u[4] = _mm_srai_epi32(u[4], bit);
 2309|       |
 2310|     42|  x = _mm_mullo_epi32(in[4], cospi18);
 2311|     42|  u[5] = _mm_sub_epi32(zero, x);
 2312|     42|  u[5] = _mm_add_epi32(u[5], rnding);
 2313|     42|  u[5] = _mm_srai_epi32(u[5], bit);
 2314|       |
 2315|     42|  x = _mm_mullo_epi32(in[6], cospi38);
 2316|     42|  u[6] = _mm_add_epi32(x, rnding);
 2317|     42|  u[6] = _mm_srai_epi32(u[6], bit);
 2318|       |
 2319|     42|  x = _mm_mullo_epi32(in[6], cospi26);
 2320|     42|  u[7] = _mm_sub_epi32(zero, x);
 2321|     42|  u[7] = _mm_add_epi32(u[7], rnding);
 2322|     42|  u[7] = _mm_srai_epi32(u[7], bit);
 2323|       |
 2324|     42|  u[8] = _mm_mullo_epi32(in[7], cospi34);
 2325|     42|  u[8] = _mm_add_epi32(u[8], rnding);
 2326|     42|  u[8] = _mm_srai_epi32(u[8], bit);
 2327|       |
 2328|     42|  u[9] = _mm_mullo_epi32(in[7], cospi30);
 2329|     42|  u[9] = _mm_add_epi32(u[9], rnding);
 2330|     42|  u[9] = _mm_srai_epi32(u[9], bit);
 2331|       |
 2332|     42|  u[10] = _mm_mullo_epi32(in[5], cospi42);
 2333|     42|  u[10] = _mm_add_epi32(u[10], rnding);
 2334|     42|  u[10] = _mm_srai_epi32(u[10], bit);
 2335|       |
 2336|     42|  u[11] = _mm_mullo_epi32(in[5], cospi22);
 2337|     42|  u[11] = _mm_add_epi32(u[11], rnding);
 2338|     42|  u[11] = _mm_srai_epi32(u[11], bit);
 2339|       |
 2340|     42|  u[12] = _mm_mullo_epi32(in[3], cospi50);
 2341|     42|  u[12] = _mm_add_epi32(u[12], rnding);
 2342|     42|  u[12] = _mm_srai_epi32(u[12], bit);
 2343|       |
 2344|     42|  u[13] = _mm_mullo_epi32(in[3], cospi14);
 2345|     42|  u[13] = _mm_add_epi32(u[13], rnding);
 2346|     42|  u[13] = _mm_srai_epi32(u[13], bit);
 2347|       |
 2348|     42|  u[14] = _mm_mullo_epi32(in[1], cospi58);
 2349|     42|  u[14] = _mm_add_epi32(u[14], rnding);
 2350|     42|  u[14] = _mm_srai_epi32(u[14], bit);
 2351|       |
 2352|     42|  u[15] = _mm_mullo_epi32(in[1], cospi6);
 2353|     42|  u[15] = _mm_add_epi32(u[15], rnding);
 2354|     42|  u[15] = _mm_srai_epi32(u[15], bit);
 2355|       |
 2356|       |  // stage 3
 2357|     42|  addsub_sse4_1(u[0], u[8], &u[0], &u[8], &clamp_lo, &clamp_hi);
 2358|     42|  addsub_sse4_1(u[1], u[9], &u[1], &u[9], &clamp_lo, &clamp_hi);
 2359|     42|  addsub_sse4_1(u[2], u[10], &u[2], &u[10], &clamp_lo, &clamp_hi);
 2360|     42|  addsub_sse4_1(u[3], u[11], &u[3], &u[11], &clamp_lo, &clamp_hi);
 2361|     42|  addsub_sse4_1(u[4], u[12], &u[4], &u[12], &clamp_lo, &clamp_hi);
 2362|     42|  addsub_sse4_1(u[5], u[13], &u[5], &u[13], &clamp_lo, &clamp_hi);
 2363|     42|  addsub_sse4_1(u[6], u[14], &u[6], &u[14], &clamp_lo, &clamp_hi);
 2364|     42|  addsub_sse4_1(u[7], u[15], &u[7], &u[15], &clamp_lo, &clamp_hi);
 2365|       |
 2366|       |  // stage 4
 2367|     42|  y = _mm_mullo_epi32(u[8], cospi56);
 2368|     42|  x = _mm_mullo_epi32(u[9], cospi56);
 2369|     42|  u[8] = _mm_mullo_epi32(u[8], cospi8);
 2370|     42|  u[8] = _mm_add_epi32(u[8], x);
 2371|     42|  u[8] = _mm_add_epi32(u[8], rnding);
 2372|     42|  u[8] = _mm_srai_epi32(u[8], bit);
 2373|       |
 2374|     42|  x = _mm_mullo_epi32(u[9], cospi8);
 2375|     42|  u[9] = _mm_sub_epi32(y, x);
 2376|     42|  u[9] = _mm_add_epi32(u[9], rnding);
 2377|     42|  u[9] = _mm_srai_epi32(u[9], bit);
 2378|       |
 2379|     42|  x = _mm_mullo_epi32(u[11], cospi24);
 2380|     42|  y = _mm_mullo_epi32(u[10], cospi24);
 2381|     42|  u[10] = _mm_mullo_epi32(u[10], cospi40);
 2382|     42|  u[10] = _mm_add_epi32(u[10], x);
 2383|     42|  u[10] = _mm_add_epi32(u[10], rnding);
 2384|     42|  u[10] = _mm_srai_epi32(u[10], bit);
 2385|       |
 2386|     42|  x = _mm_mullo_epi32(u[11], cospi40);
 2387|     42|  u[11] = _mm_sub_epi32(y, x);
 2388|     42|  u[11] = _mm_add_epi32(u[11], rnding);
 2389|     42|  u[11] = _mm_srai_epi32(u[11], bit);
 2390|       |
 2391|     42|  x = _mm_mullo_epi32(u[13], cospi8);
 2392|     42|  y = _mm_mullo_epi32(u[12], cospi8);
 2393|     42|  u[12] = _mm_mullo_epi32(u[12], cospim56);
 2394|     42|  u[12] = _mm_add_epi32(u[12], x);
 2395|     42|  u[12] = _mm_add_epi32(u[12], rnding);
 2396|     42|  u[12] = _mm_srai_epi32(u[12], bit);
 2397|       |
 2398|     42|  x = _mm_mullo_epi32(u[13], cospim56);
 2399|     42|  u[13] = _mm_sub_epi32(y, x);
 2400|     42|  u[13] = _mm_add_epi32(u[13], rnding);
 2401|     42|  u[13] = _mm_srai_epi32(u[13], bit);
 2402|       |
 2403|     42|  x = _mm_mullo_epi32(u[15], cospi40);
 2404|     42|  y = _mm_mullo_epi32(u[14], cospi40);
 2405|     42|  u[14] = _mm_mullo_epi32(u[14], cospim24);
 2406|     42|  u[14] = _mm_add_epi32(u[14], x);
 2407|     42|  u[14] = _mm_add_epi32(u[14], rnding);
 2408|     42|  u[14] = _mm_srai_epi32(u[14], bit);
 2409|       |
 2410|     42|  x = _mm_mullo_epi32(u[15], cospim24);
 2411|     42|  u[15] = _mm_sub_epi32(y, x);
 2412|     42|  u[15] = _mm_add_epi32(u[15], rnding);
 2413|     42|  u[15] = _mm_srai_epi32(u[15], bit);
 2414|       |
 2415|       |  // stage 5
 2416|     42|  addsub_sse4_1(u[0], u[4], &u[0], &u[4], &clamp_lo, &clamp_hi);
 2417|     42|  addsub_sse4_1(u[1], u[5], &u[1], &u[5], &clamp_lo, &clamp_hi);
 2418|     42|  addsub_sse4_1(u[2], u[6], &u[2], &u[6], &clamp_lo, &clamp_hi);
 2419|     42|  addsub_sse4_1(u[3], u[7], &u[3], &u[7], &clamp_lo, &clamp_hi);
 2420|     42|  addsub_sse4_1(u[8], u[12], &u[8], &u[12], &clamp_lo, &clamp_hi);
 2421|     42|  addsub_sse4_1(u[9], u[13], &u[9], &u[13], &clamp_lo, &clamp_hi);
 2422|     42|  addsub_sse4_1(u[10], u[14], &u[10], &u[14], &clamp_lo, &clamp_hi);
 2423|     42|  addsub_sse4_1(u[11], u[15], &u[11], &u[15], &clamp_lo, &clamp_hi);
 2424|       |
 2425|       |  // stage 6
 2426|     42|  x = _mm_mullo_epi32(u[5], cospi48);
 2427|     42|  y = _mm_mullo_epi32(u[4], cospi48);
 2428|     42|  u[4] = _mm_mullo_epi32(u[4], cospi16);
 2429|     42|  u[4] = _mm_add_epi32(u[4], x);
 2430|     42|  u[4] = _mm_add_epi32(u[4], rnding);
 2431|     42|  u[4] = _mm_srai_epi32(u[4], bit);
 2432|       |
 2433|     42|  x = _mm_mullo_epi32(u[5], cospi16);
 2434|     42|  u[5] = _mm_sub_epi32(y, x);
 2435|     42|  u[5] = _mm_add_epi32(u[5], rnding);
 2436|     42|  u[5] = _mm_srai_epi32(u[5], bit);
 2437|       |
 2438|     42|  x = _mm_mullo_epi32(u[7], cospi16);
 2439|     42|  y = _mm_mullo_epi32(u[6], cospi16);
 2440|     42|  u[6] = _mm_mullo_epi32(u[6], cospim48);
 2441|     42|  u[6] = _mm_add_epi32(u[6], x);
 2442|     42|  u[6] = _mm_add_epi32(u[6], rnding);
 2443|     42|  u[6] = _mm_srai_epi32(u[6], bit);
 2444|       |
 2445|     42|  x = _mm_mullo_epi32(u[7], cospim48);
 2446|     42|  u[7] = _mm_sub_epi32(y, x);
 2447|     42|  u[7] = _mm_add_epi32(u[7], rnding);
 2448|     42|  u[7] = _mm_srai_epi32(u[7], bit);
 2449|       |
 2450|     42|  x = _mm_mullo_epi32(u[13], cospi48);
 2451|     42|  y = _mm_mullo_epi32(u[12], cospi48);
 2452|     42|  u[12] = _mm_mullo_epi32(u[12], cospi16);
 2453|     42|  u[12] = _mm_add_epi32(u[12], x);
 2454|     42|  u[12] = _mm_add_epi32(u[12], rnding);
 2455|     42|  u[12] = _mm_srai_epi32(u[12], bit);
 2456|       |
 2457|     42|  x = _mm_mullo_epi32(u[13], cospi16);
 2458|     42|  u[13] = _mm_sub_epi32(y, x);
 2459|     42|  u[13] = _mm_add_epi32(u[13], rnding);
 2460|     42|  u[13] = _mm_srai_epi32(u[13], bit);
 2461|       |
 2462|     42|  x = _mm_mullo_epi32(u[15], cospi16);
 2463|     42|  y = _mm_mullo_epi32(u[14], cospi16);
 2464|     42|  u[14] = _mm_mullo_epi32(u[14], cospim48);
 2465|     42|  u[14] = _mm_add_epi32(u[14], x);
 2466|     42|  u[14] = _mm_add_epi32(u[14], rnding);
 2467|     42|  u[14] = _mm_srai_epi32(u[14], bit);
 2468|       |
 2469|     42|  x = _mm_mullo_epi32(u[15], cospim48);
 2470|     42|  u[15] = _mm_sub_epi32(y, x);
 2471|     42|  u[15] = _mm_add_epi32(u[15], rnding);
 2472|     42|  u[15] = _mm_srai_epi32(u[15], bit);
 2473|       |
 2474|       |  // stage 7
 2475|     42|  addsub_sse4_1(u[0], u[2], &u[0], &u[2], &clamp_lo, &clamp_hi);
 2476|     42|  addsub_sse4_1(u[1], u[3], &u[1], &u[3], &clamp_lo, &clamp_hi);
 2477|     42|  addsub_sse4_1(u[4], u[6], &u[4], &u[6], &clamp_lo, &clamp_hi);
 2478|     42|  addsub_sse4_1(u[5], u[7], &u[5], &u[7], &clamp_lo, &clamp_hi);
 2479|     42|  addsub_sse4_1(u[8], u[10], &u[8], &u[10], &clamp_lo, &clamp_hi);
 2480|     42|  addsub_sse4_1(u[9], u[11], &u[9], &u[11], &clamp_lo, &clamp_hi);
 2481|     42|  addsub_sse4_1(u[12], u[14], &u[12], &u[14], &clamp_lo, &clamp_hi);
 2482|     42|  addsub_sse4_1(u[13], u[15], &u[13], &u[15], &clamp_lo, &clamp_hi);
 2483|       |
 2484|       |  // stage 8
 2485|     42|  y = _mm_mullo_epi32(u[2], cospi32);
 2486|     42|  x = _mm_mullo_epi32(u[3], cospi32);
 2487|     42|  u[2] = _mm_add_epi32(y, x);
 2488|     42|  u[2] = _mm_add_epi32(u[2], rnding);
 2489|     42|  u[2] = _mm_srai_epi32(u[2], bit);
 2490|       |
 2491|     42|  u[3] = _mm_sub_epi32(y, x);
 2492|     42|  u[3] = _mm_add_epi32(u[3], rnding);
 2493|     42|  u[3] = _mm_srai_epi32(u[3], bit);
 2494|     42|  y = _mm_mullo_epi32(u[6], cospi32);
 2495|     42|  x = _mm_mullo_epi32(u[7], cospi32);
 2496|     42|  u[6] = _mm_add_epi32(y, x);
 2497|     42|  u[6] = _mm_add_epi32(u[6], rnding);
 2498|     42|  u[6] = _mm_srai_epi32(u[6], bit);
 2499|       |
 2500|     42|  u[7] = _mm_sub_epi32(y, x);
 2501|     42|  u[7] = _mm_add_epi32(u[7], rnding);
 2502|     42|  u[7] = _mm_srai_epi32(u[7], bit);
 2503|       |
 2504|     42|  y = _mm_mullo_epi32(u[10], cospi32);
 2505|     42|  x = _mm_mullo_epi32(u[11], cospi32);
 2506|     42|  u[10] = _mm_add_epi32(y, x);
 2507|     42|  u[10] = _mm_add_epi32(u[10], rnding);
 2508|     42|  u[10] = _mm_srai_epi32(u[10], bit);
 2509|       |
 2510|     42|  u[11] = _mm_sub_epi32(y, x);
 2511|     42|  u[11] = _mm_add_epi32(u[11], rnding);
 2512|     42|  u[11] = _mm_srai_epi32(u[11], bit);
 2513|       |
 2514|     42|  y = _mm_mullo_epi32(u[14], cospi32);
 2515|     42|  x = _mm_mullo_epi32(u[15], cospi32);
 2516|     42|  u[14] = _mm_add_epi32(y, x);
 2517|     42|  u[14] = _mm_add_epi32(u[14], rnding);
 2518|     42|  u[14] = _mm_srai_epi32(u[14], bit);
 2519|       |
 2520|     42|  u[15] = _mm_sub_epi32(y, x);
 2521|     42|  u[15] = _mm_add_epi32(u[15], rnding);
 2522|     42|  u[15] = _mm_srai_epi32(u[15], bit);
 2523|       |
 2524|       |  // stage 9
 2525|     42|  if (do_cols) {
  ------------------
  |  Branch (2525:7): [True: 24, False: 18]
  ------------------
 2526|     24|    out[0] = u[0];
 2527|     24|    out[1] = _mm_sub_epi32(zero, u[8]);
 2528|     24|    out[2] = u[12];
 2529|     24|    out[3] = _mm_sub_epi32(zero, u[4]);
 2530|     24|    out[4] = u[6];
 2531|     24|    out[5] = _mm_sub_epi32(zero, u[14]);
 2532|     24|    out[6] = u[10];
 2533|     24|    out[7] = _mm_sub_epi32(zero, u[2]);
 2534|     24|    out[8] = u[3];
 2535|     24|    out[9] = _mm_sub_epi32(zero, u[11]);
 2536|     24|    out[10] = u[15];
 2537|     24|    out[11] = _mm_sub_epi32(zero, u[7]);
 2538|     24|    out[12] = u[5];
 2539|     24|    out[13] = _mm_sub_epi32(zero, u[13]);
 2540|     24|    out[14] = u[9];
 2541|     24|    out[15] = _mm_sub_epi32(zero, u[1]);
 2542|     24|  } else {
 2543|     18|    const int log_range_out = get_log_range_out(bd);
 2544|     18|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 2545|     18|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 2546|       |
 2547|     18|    neg_shift_sse4_1(u[0], u[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 2548|     18|                     out_shift);
 2549|     18|    neg_shift_sse4_1(u[12], u[4], out + 2, out + 3, &clamp_lo_out,
 2550|     18|                     &clamp_hi_out, out_shift);
 2551|     18|    neg_shift_sse4_1(u[6], u[14], out + 4, out + 5, &clamp_lo_out,
 2552|     18|                     &clamp_hi_out, out_shift);
 2553|     18|    neg_shift_sse4_1(u[10], u[2], out + 6, out + 7, &clamp_lo_out,
 2554|     18|                     &clamp_hi_out, out_shift);
 2555|     18|    neg_shift_sse4_1(u[3], u[11], out + 8, out + 9, &clamp_lo_out,
 2556|     18|                     &clamp_hi_out, out_shift);
 2557|     18|    neg_shift_sse4_1(u[15], u[7], out + 10, out + 11, &clamp_lo_out,
 2558|     18|                     &clamp_hi_out, out_shift);
 2559|     18|    neg_shift_sse4_1(u[5], u[13], out + 12, out + 13, &clamp_lo_out,
 2560|     18|                     &clamp_hi_out, out_shift);
 2561|     18|    neg_shift_sse4_1(u[9], u[1], out + 14, out + 15, &clamp_lo_out,
 2562|     18|                     &clamp_hi_out, out_shift);
 2563|     18|  }
 2564|     42|}
highbd_inv_txfm_sse4.c:iadst16x16_sse4_1:
 2749|    484|                              int bd, int out_shift) {
 2750|    484|  const int32_t *cospi = cospi_arr(bit);
 2751|    484|  const __m128i cospi2 = _mm_set1_epi32(cospi[2]);
 2752|    484|  const __m128i cospi62 = _mm_set1_epi32(cospi[62]);
 2753|    484|  const __m128i cospi10 = _mm_set1_epi32(cospi[10]);
 2754|    484|  const __m128i cospi54 = _mm_set1_epi32(cospi[54]);
 2755|    484|  const __m128i cospi18 = _mm_set1_epi32(cospi[18]);
 2756|    484|  const __m128i cospi46 = _mm_set1_epi32(cospi[46]);
 2757|    484|  const __m128i cospi26 = _mm_set1_epi32(cospi[26]);
 2758|    484|  const __m128i cospi38 = _mm_set1_epi32(cospi[38]);
 2759|    484|  const __m128i cospi34 = _mm_set1_epi32(cospi[34]);
 2760|    484|  const __m128i cospi30 = _mm_set1_epi32(cospi[30]);
 2761|    484|  const __m128i cospi42 = _mm_set1_epi32(cospi[42]);
 2762|    484|  const __m128i cospi22 = _mm_set1_epi32(cospi[22]);
 2763|    484|  const __m128i cospi50 = _mm_set1_epi32(cospi[50]);
 2764|    484|  const __m128i cospi14 = _mm_set1_epi32(cospi[14]);
 2765|    484|  const __m128i cospi58 = _mm_set1_epi32(cospi[58]);
 2766|    484|  const __m128i cospi6 = _mm_set1_epi32(cospi[6]);
 2767|    484|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 2768|    484|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 2769|    484|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
 2770|    484|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 2771|    484|  const __m128i cospim56 = _mm_set1_epi32(-cospi[56]);
 2772|    484|  const __m128i cospim24 = _mm_set1_epi32(-cospi[24]);
 2773|    484|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 2774|    484|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 2775|    484|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 2776|    484|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 2777|    484|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 2778|    484|  const int log_range = get_log_range(bd, do_cols);
 2779|    484|  const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 2780|    484|  const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 2781|    484|  const __m128i zero = _mm_setzero_si128();
 2782|    484|  __m128i u[16], v[16], x, y;
 2783|       |  // Calculate the column 0, 1, 2, 3
 2784|       |  // stage 0
 2785|       |  // stage 1
 2786|       |  // stage 2
 2787|    484|  v[0] = _mm_mullo_epi32(in[15], cospi2);
 2788|    484|  x = _mm_mullo_epi32(in[0], cospi62);
 2789|    484|  v[0] = _mm_add_epi32(v[0], x);
 2790|    484|  v[0] = _mm_add_epi32(v[0], rnding);
 2791|    484|  v[0] = _mm_srai_epi32(v[0], bit);
 2792|       |
 2793|    484|  v[1] = _mm_mullo_epi32(in[15], cospi62);
 2794|    484|  x = _mm_mullo_epi32(in[0], cospi2);
 2795|    484|  v[1] = _mm_sub_epi32(v[1], x);
 2796|    484|  v[1] = _mm_add_epi32(v[1], rnding);
 2797|    484|  v[1] = _mm_srai_epi32(v[1], bit);
 2798|       |
 2799|    484|  v[2] = _mm_mullo_epi32(in[13], cospi10);
 2800|    484|  x = _mm_mullo_epi32(in[2], cospi54);
 2801|    484|  v[2] = _mm_add_epi32(v[2], x);
 2802|    484|  v[2] = _mm_add_epi32(v[2], rnding);
 2803|    484|  v[2] = _mm_srai_epi32(v[2], bit);
 2804|       |
 2805|    484|  v[3] = _mm_mullo_epi32(in[13], cospi54);
 2806|    484|  x = _mm_mullo_epi32(in[2], cospi10);
 2807|    484|  v[3] = _mm_sub_epi32(v[3], x);
 2808|    484|  v[3] = _mm_add_epi32(v[3], rnding);
 2809|    484|  v[3] = _mm_srai_epi32(v[3], bit);
 2810|       |
 2811|    484|  v[4] = _mm_mullo_epi32(in[11], cospi18);
 2812|    484|  x = _mm_mullo_epi32(in[4], cospi46);
 2813|    484|  v[4] = _mm_add_epi32(v[4], x);
 2814|    484|  v[4] = _mm_add_epi32(v[4], rnding);
 2815|    484|  v[4] = _mm_srai_epi32(v[4], bit);
 2816|       |
 2817|    484|  v[5] = _mm_mullo_epi32(in[11], cospi46);
 2818|    484|  x = _mm_mullo_epi32(in[4], cospi18);
 2819|    484|  v[5] = _mm_sub_epi32(v[5], x);
 2820|    484|  v[5] = _mm_add_epi32(v[5], rnding);
 2821|    484|  v[5] = _mm_srai_epi32(v[5], bit);
 2822|       |
 2823|    484|  v[6] = _mm_mullo_epi32(in[9], cospi26);
 2824|    484|  x = _mm_mullo_epi32(in[6], cospi38);
 2825|    484|  v[6] = _mm_add_epi32(v[6], x);
 2826|    484|  v[6] = _mm_add_epi32(v[6], rnding);
 2827|    484|  v[6] = _mm_srai_epi32(v[6], bit);
 2828|       |
 2829|    484|  v[7] = _mm_mullo_epi32(in[9], cospi38);
 2830|    484|  x = _mm_mullo_epi32(in[6], cospi26);
 2831|    484|  v[7] = _mm_sub_epi32(v[7], x);
 2832|    484|  v[7] = _mm_add_epi32(v[7], rnding);
 2833|    484|  v[7] = _mm_srai_epi32(v[7], bit);
 2834|       |
 2835|    484|  v[8] = _mm_mullo_epi32(in[7], cospi34);
 2836|    484|  x = _mm_mullo_epi32(in[8], cospi30);
 2837|    484|  v[8] = _mm_add_epi32(v[8], x);
 2838|    484|  v[8] = _mm_add_epi32(v[8], rnding);
 2839|    484|  v[8] = _mm_srai_epi32(v[8], bit);
 2840|       |
 2841|    484|  v[9] = _mm_mullo_epi32(in[7], cospi30);
 2842|    484|  x = _mm_mullo_epi32(in[8], cospi34);
 2843|    484|  v[9] = _mm_sub_epi32(v[9], x);
 2844|    484|  v[9] = _mm_add_epi32(v[9], rnding);
 2845|    484|  v[9] = _mm_srai_epi32(v[9], bit);
 2846|       |
 2847|    484|  v[10] = _mm_mullo_epi32(in[5], cospi42);
 2848|    484|  x = _mm_mullo_epi32(in[10], cospi22);
 2849|    484|  v[10] = _mm_add_epi32(v[10], x);
 2850|    484|  v[10] = _mm_add_epi32(v[10], rnding);
 2851|    484|  v[10] = _mm_srai_epi32(v[10], bit);
 2852|       |
 2853|    484|  v[11] = _mm_mullo_epi32(in[5], cospi22);
 2854|    484|  x = _mm_mullo_epi32(in[10], cospi42);
 2855|    484|  v[11] = _mm_sub_epi32(v[11], x);
 2856|    484|  v[11] = _mm_add_epi32(v[11], rnding);
 2857|    484|  v[11] = _mm_srai_epi32(v[11], bit);
 2858|       |
 2859|    484|  v[12] = _mm_mullo_epi32(in[3], cospi50);
 2860|    484|  x = _mm_mullo_epi32(in[12], cospi14);
 2861|    484|  v[12] = _mm_add_epi32(v[12], x);
 2862|    484|  v[12] = _mm_add_epi32(v[12], rnding);
 2863|    484|  v[12] = _mm_srai_epi32(v[12], bit);
 2864|       |
 2865|    484|  v[13] = _mm_mullo_epi32(in[3], cospi14);
 2866|    484|  x = _mm_mullo_epi32(in[12], cospi50);
 2867|    484|  v[13] = _mm_sub_epi32(v[13], x);
 2868|    484|  v[13] = _mm_add_epi32(v[13], rnding);
 2869|    484|  v[13] = _mm_srai_epi32(v[13], bit);
 2870|       |
 2871|    484|  v[14] = _mm_mullo_epi32(in[1], cospi58);
 2872|    484|  x = _mm_mullo_epi32(in[14], cospi6);
 2873|    484|  v[14] = _mm_add_epi32(v[14], x);
 2874|    484|  v[14] = _mm_add_epi32(v[14], rnding);
 2875|    484|  v[14] = _mm_srai_epi32(v[14], bit);
 2876|       |
 2877|    484|  v[15] = _mm_mullo_epi32(in[1], cospi6);
 2878|    484|  x = _mm_mullo_epi32(in[14], cospi58);
 2879|    484|  v[15] = _mm_sub_epi32(v[15], x);
 2880|    484|  v[15] = _mm_add_epi32(v[15], rnding);
 2881|    484|  v[15] = _mm_srai_epi32(v[15], bit);
 2882|       |
 2883|       |  // stage 3
 2884|    484|  addsub_sse4_1(v[0], v[8], &u[0], &u[8], &clamp_lo, &clamp_hi);
 2885|    484|  addsub_sse4_1(v[1], v[9], &u[1], &u[9], &clamp_lo, &clamp_hi);
 2886|    484|  addsub_sse4_1(v[2], v[10], &u[2], &u[10], &clamp_lo, &clamp_hi);
 2887|    484|  addsub_sse4_1(v[3], v[11], &u[3], &u[11], &clamp_lo, &clamp_hi);
 2888|    484|  addsub_sse4_1(v[4], v[12], &u[4], &u[12], &clamp_lo, &clamp_hi);
 2889|    484|  addsub_sse4_1(v[5], v[13], &u[5], &u[13], &clamp_lo, &clamp_hi);
 2890|    484|  addsub_sse4_1(v[6], v[14], &u[6], &u[14], &clamp_lo, &clamp_hi);
 2891|    484|  addsub_sse4_1(v[7], v[15], &u[7], &u[15], &clamp_lo, &clamp_hi);
 2892|       |
 2893|       |  // stage 4
 2894|    484|  v[0] = u[0];
 2895|    484|  v[1] = u[1];
 2896|    484|  v[2] = u[2];
 2897|    484|  v[3] = u[3];
 2898|    484|  v[4] = u[4];
 2899|    484|  v[5] = u[5];
 2900|    484|  v[6] = u[6];
 2901|    484|  v[7] = u[7];
 2902|       |
 2903|    484|  v[8] = _mm_mullo_epi32(u[8], cospi8);
 2904|    484|  x = _mm_mullo_epi32(u[9], cospi56);
 2905|    484|  v[8] = _mm_add_epi32(v[8], x);
 2906|    484|  v[8] = _mm_add_epi32(v[8], rnding);
 2907|    484|  v[8] = _mm_srai_epi32(v[8], bit);
 2908|       |
 2909|    484|  v[9] = _mm_mullo_epi32(u[8], cospi56);
 2910|    484|  x = _mm_mullo_epi32(u[9], cospi8);
 2911|    484|  v[9] = _mm_sub_epi32(v[9], x);
 2912|    484|  v[9] = _mm_add_epi32(v[9], rnding);
 2913|    484|  v[9] = _mm_srai_epi32(v[9], bit);
 2914|       |
 2915|    484|  v[10] = _mm_mullo_epi32(u[10], cospi40);
 2916|    484|  x = _mm_mullo_epi32(u[11], cospi24);
 2917|    484|  v[10] = _mm_add_epi32(v[10], x);
 2918|    484|  v[10] = _mm_add_epi32(v[10], rnding);
 2919|    484|  v[10] = _mm_srai_epi32(v[10], bit);
 2920|       |
 2921|    484|  v[11] = _mm_mullo_epi32(u[10], cospi24);
 2922|    484|  x = _mm_mullo_epi32(u[11], cospi40);
 2923|    484|  v[11] = _mm_sub_epi32(v[11], x);
 2924|    484|  v[11] = _mm_add_epi32(v[11], rnding);
 2925|    484|  v[11] = _mm_srai_epi32(v[11], bit);
 2926|       |
 2927|    484|  v[12] = _mm_mullo_epi32(u[12], cospim56);
 2928|    484|  x = _mm_mullo_epi32(u[13], cospi8);
 2929|    484|  v[12] = _mm_add_epi32(v[12], x);
 2930|    484|  v[12] = _mm_add_epi32(v[12], rnding);
 2931|    484|  v[12] = _mm_srai_epi32(v[12], bit);
 2932|       |
 2933|    484|  v[13] = _mm_mullo_epi32(u[12], cospi8);
 2934|    484|  x = _mm_mullo_epi32(u[13], cospim56);
 2935|    484|  v[13] = _mm_sub_epi32(v[13], x);
 2936|    484|  v[13] = _mm_add_epi32(v[13], rnding);
 2937|    484|  v[13] = _mm_srai_epi32(v[13], bit);
 2938|       |
 2939|    484|  v[14] = _mm_mullo_epi32(u[14], cospim24);
 2940|    484|  x = _mm_mullo_epi32(u[15], cospi40);
 2941|    484|  v[14] = _mm_add_epi32(v[14], x);
 2942|    484|  v[14] = _mm_add_epi32(v[14], rnding);
 2943|    484|  v[14] = _mm_srai_epi32(v[14], bit);
 2944|       |
 2945|    484|  v[15] = _mm_mullo_epi32(u[14], cospi40);
 2946|    484|  x = _mm_mullo_epi32(u[15], cospim24);
 2947|    484|  v[15] = _mm_sub_epi32(v[15], x);
 2948|    484|  v[15] = _mm_add_epi32(v[15], rnding);
 2949|    484|  v[15] = _mm_srai_epi32(v[15], bit);
 2950|       |
 2951|       |  // stage 5
 2952|    484|  addsub_sse4_1(v[0], v[4], &u[0], &u[4], &clamp_lo, &clamp_hi);
 2953|    484|  addsub_sse4_1(v[1], v[5], &u[1], &u[5], &clamp_lo, &clamp_hi);
 2954|    484|  addsub_sse4_1(v[2], v[6], &u[2], &u[6], &clamp_lo, &clamp_hi);
 2955|    484|  addsub_sse4_1(v[3], v[7], &u[3], &u[7], &clamp_lo, &clamp_hi);
 2956|    484|  addsub_sse4_1(v[8], v[12], &u[8], &u[12], &clamp_lo, &clamp_hi);
 2957|    484|  addsub_sse4_1(v[9], v[13], &u[9], &u[13], &clamp_lo, &clamp_hi);
 2958|    484|  addsub_sse4_1(v[10], v[14], &u[10], &u[14], &clamp_lo, &clamp_hi);
 2959|    484|  addsub_sse4_1(v[11], v[15], &u[11], &u[15], &clamp_lo, &clamp_hi);
 2960|       |
 2961|       |  // stage 6
 2962|    484|  v[0] = u[0];
 2963|    484|  v[1] = u[1];
 2964|    484|  v[2] = u[2];
 2965|    484|  v[3] = u[3];
 2966|       |
 2967|    484|  v[4] = _mm_mullo_epi32(u[4], cospi16);
 2968|    484|  x = _mm_mullo_epi32(u[5], cospi48);
 2969|    484|  v[4] = _mm_add_epi32(v[4], x);
 2970|    484|  v[4] = _mm_add_epi32(v[4], rnding);
 2971|    484|  v[4] = _mm_srai_epi32(v[4], bit);
 2972|       |
 2973|    484|  v[5] = _mm_mullo_epi32(u[4], cospi48);
 2974|    484|  x = _mm_mullo_epi32(u[5], cospi16);
 2975|    484|  v[5] = _mm_sub_epi32(v[5], x);
 2976|    484|  v[5] = _mm_add_epi32(v[5], rnding);
 2977|    484|  v[5] = _mm_srai_epi32(v[5], bit);
 2978|       |
 2979|    484|  v[6] = _mm_mullo_epi32(u[6], cospim48);
 2980|    484|  x = _mm_mullo_epi32(u[7], cospi16);
 2981|    484|  v[6] = _mm_add_epi32(v[6], x);
 2982|    484|  v[6] = _mm_add_epi32(v[6], rnding);
 2983|    484|  v[6] = _mm_srai_epi32(v[6], bit);
 2984|       |
 2985|    484|  v[7] = _mm_mullo_epi32(u[6], cospi16);
 2986|    484|  x = _mm_mullo_epi32(u[7], cospim48);
 2987|    484|  v[7] = _mm_sub_epi32(v[7], x);
 2988|    484|  v[7] = _mm_add_epi32(v[7], rnding);
 2989|    484|  v[7] = _mm_srai_epi32(v[7], bit);
 2990|       |
 2991|    484|  v[8] = u[8];
 2992|    484|  v[9] = u[9];
 2993|    484|  v[10] = u[10];
 2994|    484|  v[11] = u[11];
 2995|       |
 2996|    484|  v[12] = _mm_mullo_epi32(u[12], cospi16);
 2997|    484|  x = _mm_mullo_epi32(u[13], cospi48);
 2998|    484|  v[12] = _mm_add_epi32(v[12], x);
 2999|    484|  v[12] = _mm_add_epi32(v[12], rnding);
 3000|    484|  v[12] = _mm_srai_epi32(v[12], bit);
 3001|       |
 3002|    484|  v[13] = _mm_mullo_epi32(u[12], cospi48);
 3003|    484|  x = _mm_mullo_epi32(u[13], cospi16);
 3004|    484|  v[13] = _mm_sub_epi32(v[13], x);
 3005|    484|  v[13] = _mm_add_epi32(v[13], rnding);
 3006|    484|  v[13] = _mm_srai_epi32(v[13], bit);
 3007|       |
 3008|    484|  v[14] = _mm_mullo_epi32(u[14], cospim48);
 3009|    484|  x = _mm_mullo_epi32(u[15], cospi16);
 3010|    484|  v[14] = _mm_add_epi32(v[14], x);
 3011|    484|  v[14] = _mm_add_epi32(v[14], rnding);
 3012|    484|  v[14] = _mm_srai_epi32(v[14], bit);
 3013|       |
 3014|    484|  v[15] = _mm_mullo_epi32(u[14], cospi16);
 3015|    484|  x = _mm_mullo_epi32(u[15], cospim48);
 3016|    484|  v[15] = _mm_sub_epi32(v[15], x);
 3017|    484|  v[15] = _mm_add_epi32(v[15], rnding);
 3018|    484|  v[15] = _mm_srai_epi32(v[15], bit);
 3019|       |
 3020|       |  // stage 7
 3021|    484|  addsub_sse4_1(v[0], v[2], &u[0], &u[2], &clamp_lo, &clamp_hi);
 3022|    484|  addsub_sse4_1(v[1], v[3], &u[1], &u[3], &clamp_lo, &clamp_hi);
 3023|    484|  addsub_sse4_1(v[4], v[6], &u[4], &u[6], &clamp_lo, &clamp_hi);
 3024|    484|  addsub_sse4_1(v[5], v[7], &u[5], &u[7], &clamp_lo, &clamp_hi);
 3025|    484|  addsub_sse4_1(v[8], v[10], &u[8], &u[10], &clamp_lo, &clamp_hi);
 3026|    484|  addsub_sse4_1(v[9], v[11], &u[9], &u[11], &clamp_lo, &clamp_hi);
 3027|    484|  addsub_sse4_1(v[12], v[14], &u[12], &u[14], &clamp_lo, &clamp_hi);
 3028|    484|  addsub_sse4_1(v[13], v[15], &u[13], &u[15], &clamp_lo, &clamp_hi);
 3029|       |
 3030|       |  // stage 8
 3031|    484|  v[0] = u[0];
 3032|    484|  v[1] = u[1];
 3033|       |
 3034|    484|  y = _mm_mullo_epi32(u[2], cospi32);
 3035|    484|  x = _mm_mullo_epi32(u[3], cospi32);
 3036|    484|  v[2] = _mm_add_epi32(y, x);
 3037|    484|  v[2] = _mm_add_epi32(v[2], rnding);
 3038|    484|  v[2] = _mm_srai_epi32(v[2], bit);
 3039|       |
 3040|    484|  v[3] = _mm_sub_epi32(y, x);
 3041|    484|  v[3] = _mm_add_epi32(v[3], rnding);
 3042|    484|  v[3] = _mm_srai_epi32(v[3], bit);
 3043|       |
 3044|    484|  v[4] = u[4];
 3045|    484|  v[5] = u[5];
 3046|       |
 3047|    484|  y = _mm_mullo_epi32(u[6], cospi32);
 3048|    484|  x = _mm_mullo_epi32(u[7], cospi32);
 3049|    484|  v[6] = _mm_add_epi32(y, x);
 3050|    484|  v[6] = _mm_add_epi32(v[6], rnding);
 3051|    484|  v[6] = _mm_srai_epi32(v[6], bit);
 3052|       |
 3053|    484|  v[7] = _mm_sub_epi32(y, x);
 3054|    484|  v[7] = _mm_add_epi32(v[7], rnding);
 3055|    484|  v[7] = _mm_srai_epi32(v[7], bit);
 3056|       |
 3057|    484|  v[8] = u[8];
 3058|    484|  v[9] = u[9];
 3059|       |
 3060|    484|  y = _mm_mullo_epi32(u[10], cospi32);
 3061|    484|  x = _mm_mullo_epi32(u[11], cospi32);
 3062|    484|  v[10] = _mm_add_epi32(y, x);
 3063|    484|  v[10] = _mm_add_epi32(v[10], rnding);
 3064|    484|  v[10] = _mm_srai_epi32(v[10], bit);
 3065|       |
 3066|    484|  v[11] = _mm_sub_epi32(y, x);
 3067|    484|  v[11] = _mm_add_epi32(v[11], rnding);
 3068|    484|  v[11] = _mm_srai_epi32(v[11], bit);
 3069|       |
 3070|    484|  v[12] = u[12];
 3071|    484|  v[13] = u[13];
 3072|       |
 3073|    484|  y = _mm_mullo_epi32(u[14], cospi32);
 3074|    484|  x = _mm_mullo_epi32(u[15], cospi32);
 3075|    484|  v[14] = _mm_add_epi32(y, x);
 3076|    484|  v[14] = _mm_add_epi32(v[14], rnding);
 3077|    484|  v[14] = _mm_srai_epi32(v[14], bit);
 3078|       |
 3079|    484|  v[15] = _mm_sub_epi32(y, x);
 3080|    484|  v[15] = _mm_add_epi32(v[15], rnding);
 3081|    484|  v[15] = _mm_srai_epi32(v[15], bit);
 3082|       |
 3083|       |  // stage 9
 3084|    484|  if (do_cols) {
  ------------------
  |  Branch (3084:7): [True: 126, False: 358]
  ------------------
 3085|    126|    out[0] = v[0];
 3086|    126|    out[1] = _mm_sub_epi32(zero, v[8]);
 3087|    126|    out[2] = v[12];
 3088|    126|    out[3] = _mm_sub_epi32(zero, v[4]);
 3089|    126|    out[4] = v[6];
 3090|    126|    out[5] = _mm_sub_epi32(zero, v[14]);
 3091|    126|    out[6] = v[10];
 3092|    126|    out[7] = _mm_sub_epi32(zero, v[2]);
 3093|    126|    out[8] = v[3];
 3094|    126|    out[9] = _mm_sub_epi32(zero, v[11]);
 3095|    126|    out[10] = v[15];
 3096|    126|    out[11] = _mm_sub_epi32(zero, v[7]);
 3097|    126|    out[12] = v[5];
 3098|    126|    out[13] = _mm_sub_epi32(zero, v[13]);
 3099|    126|    out[14] = v[9];
 3100|    126|    out[15] = _mm_sub_epi32(zero, v[1]);
 3101|    358|  } else {
 3102|    358|    const int log_range_out = get_log_range_out(bd);
 3103|    358|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 3104|    358|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 3105|       |
 3106|    358|    neg_shift_sse4_1(v[0], v[8], out + 0, out + 1, &clamp_lo_out, &clamp_hi_out,
 3107|    358|                     out_shift);
 3108|    358|    neg_shift_sse4_1(v[12], v[4], out + 2, out + 3, &clamp_lo_out,
 3109|    358|                     &clamp_hi_out, out_shift);
 3110|    358|    neg_shift_sse4_1(v[6], v[14], out + 4, out + 5, &clamp_lo_out,
 3111|    358|                     &clamp_hi_out, out_shift);
 3112|    358|    neg_shift_sse4_1(v[10], v[2], out + 6, out + 7, &clamp_lo_out,
 3113|    358|                     &clamp_hi_out, out_shift);
 3114|    358|    neg_shift_sse4_1(v[3], v[11], out + 8, out + 9, &clamp_lo_out,
 3115|    358|                     &clamp_hi_out, out_shift);
 3116|    358|    neg_shift_sse4_1(v[15], v[7], out + 10, out + 11, &clamp_lo_out,
 3117|    358|                     &clamp_hi_out, out_shift);
 3118|    358|    neg_shift_sse4_1(v[5], v[13], out + 12, out + 13, &clamp_lo_out,
 3119|    358|                     &clamp_hi_out, out_shift);
 3120|    358|    neg_shift_sse4_1(v[9], v[1], out + 14, out + 15, &clamp_lo_out,
 3121|    358|                     &clamp_hi_out, out_shift);
 3122|    358|  }
 3123|    484|}
highbd_inv_txfm_sse4.c:iidentity16_sse4_1:
 3125|  54.4k|                               int bd, int out_shift) {
 3126|  54.4k|  (void)bit;
 3127|  54.4k|  __m128i fact = _mm_set1_epi32(2 * NewSqrt2);
 3128|  54.4k|  __m128i offset = _mm_set1_epi32(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  54.4k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 3129|  54.4k|  __m128i a0_low, a0_high, a1_low, a1_high;
 3130|  54.4k|  __m128i zero = _mm_setzero_si128();
 3131|  54.4k|  offset = _mm_unpacklo_epi32(offset, zero);
 3132|       |
 3133|   925k|  for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3133:19): [True: 871k, False: 54.4k]
  ------------------
 3134|   871k|    a0_low = _mm_mul_epi32(in[i], fact);
 3135|   871k|    a0_low = _mm_add_epi32(a0_low, offset);
 3136|   871k|    a0_low = _mm_srli_epi64(a0_low, NewSqrt2Bits);
  ------------------
  |  |   42|   871k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 3137|       |
 3138|   871k|    a0_high = _mm_srli_si128(in[i], 4);
 3139|   871k|    a0_high = _mm_mul_epi32(a0_high, fact);
 3140|   871k|    a0_high = _mm_add_epi32(a0_high, offset);
 3141|   871k|    a0_high = _mm_srli_epi64(a0_high, NewSqrt2Bits);
  ------------------
  |  |   42|   871k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 3142|       |
 3143|   871k|    a1_low = _mm_unpacklo_epi32(a0_low, a0_high);
 3144|   871k|    a1_high = _mm_unpackhi_epi32(a0_low, a0_high);
 3145|   871k|    out[i] = _mm_unpacklo_epi64(a1_low, a1_high);
 3146|   871k|  }
 3147|       |
 3148|  54.4k|  if (!do_cols) {
  ------------------
  |  Branch (3148:7): [True: 24.7k, False: 29.6k]
  ------------------
 3149|  24.7k|    const int log_range = get_log_range_out(bd);
 3150|  24.7k|    const __m128i clamp_lo = _mm_set1_epi32(-(1 << (log_range - 1)));
 3151|  24.7k|    const __m128i clamp_hi = _mm_set1_epi32((1 << (log_range - 1)) - 1);
 3152|  24.7k|    round_shift_8x8(out, out_shift);
 3153|  24.7k|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo, &clamp_hi, 16);
 3154|  24.7k|  }
 3155|  54.4k|}
highbd_inv_txfm_sse4.c:iidentity32_sse4_1:
 5170|  14.7k|                               int bd, int out_shift) {
 5171|  14.7k|  (void)bit;
 5172|  44.1k|  for (int i = 0; i < 32; i += 16) {
  ------------------
  |  Branch (5172:19): [True: 29.4k, False: 14.7k]
  ------------------
 5173|  29.4k|    out[i] = _mm_slli_epi32(in[i], 2);
 5174|  29.4k|    out[i + 1] = _mm_slli_epi32(in[i + 1], 2);
 5175|  29.4k|    out[i + 2] = _mm_slli_epi32(in[i + 2], 2);
 5176|  29.4k|    out[i + 3] = _mm_slli_epi32(in[i + 3], 2);
 5177|  29.4k|    out[i + 4] = _mm_slli_epi32(in[i + 4], 2);
 5178|  29.4k|    out[i + 5] = _mm_slli_epi32(in[i + 5], 2);
 5179|  29.4k|    out[i + 6] = _mm_slli_epi32(in[i + 6], 2);
 5180|  29.4k|    out[i + 7] = _mm_slli_epi32(in[i + 7], 2);
 5181|  29.4k|    out[i + 8] = _mm_slli_epi32(in[i + 8], 2);
 5182|  29.4k|    out[i + 9] = _mm_slli_epi32(in[i + 9], 2);
 5183|  29.4k|    out[i + 10] = _mm_slli_epi32(in[i + 10], 2);
 5184|  29.4k|    out[i + 11] = _mm_slli_epi32(in[i + 11], 2);
 5185|  29.4k|    out[i + 12] = _mm_slli_epi32(in[i + 12], 2);
 5186|  29.4k|    out[i + 13] = _mm_slli_epi32(in[i + 13], 2);
 5187|  29.4k|    out[i + 14] = _mm_slli_epi32(in[i + 14], 2);
 5188|  29.4k|    out[i + 15] = _mm_slli_epi32(in[i + 15], 2);
 5189|  29.4k|  }
 5190|       |
 5191|  14.7k|  if (!do_cols) {
  ------------------
  |  Branch (5191:7): [True: 7.36k, False: 7.35k]
  ------------------
 5192|  7.36k|    const int log_range_out = get_log_range_out(bd);
 5193|  7.36k|    const __m128i clamp_lo_out = _mm_set1_epi32(-(1 << (log_range_out - 1)));
 5194|  7.36k|    const __m128i clamp_hi_out = _mm_set1_epi32((1 << (log_range_out - 1)) - 1);
 5195|  7.36k|    round_shift_8x8(out, out_shift);
 5196|  7.36k|    round_shift_8x8(out + 16, out_shift);
 5197|  7.36k|    highbd_clamp_epi32_sse4_1(out, out, &clamp_lo_out, &clamp_hi_out, 32);
 5198|  7.36k|  }
 5199|  14.7k|}
highbd_inv_txfm_sse4.c:load_buffer_32bit_input:
  135|  7.23M|                                           __m128i *out, int out_size) {
  136|  46.1M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (136:19): [True: 38.9M, False: 7.23M]
  ------------------
  137|  38.9M|    out[i] = _mm_loadu_si128((const __m128i *)(in + i * stride));
  138|  38.9M|  }
  139|  7.23M|}
highbd_inv_txfm_sse4.c:highbd_write_buffer_8xn_sse4_1:
  123|  2.02M|                                                  int height, const int bd) {
  124|  2.02M|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (124:11): [True: 10.5k, False: 2.01M]
  ------------------
  125|  2.02M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (125:20): [True: 10.5k, False: 2.01M]
  ------------------
  126|  11.8M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (126:19): [True: 9.81M, False: 2.02M]
  ------------------
  127|  9.81M|    __m128i v = _mm_loadu_si128((__m128i const *)(output + i * stride));
  128|  9.81M|    __m128i u = highbd_get_recon_8x8_sse4_1(v, in[j], in[j + height], bd);
  129|       |
  130|  9.81M|    _mm_storeu_si128((__m128i *)(output + i * stride), u);
  131|  9.81M|  }
  132|  2.02M|}
highbd_inv_txfm_sse4.c:highbd_get_recon_8x8_sse4_1:
   83|  9.81M|                                                  const int bd) {
   84|  9.81M|  __m128i x0 = _mm_cvtepi16_epi32(pred);
   85|       |  __m128i x1 = _mm_cvtepi16_epi32(_mm_srli_si128(pred, 8));
   86|  9.81M|  __m128i min_clip_val = _mm_setzero_si128();
   87|  9.81M|  __m128i max_clip_val = _mm_set1_epi32((1 << bd) - 1);
   88|  9.81M|  x0 = _mm_add_epi32(res0, x0);
   89|  9.81M|  x1 = _mm_add_epi32(res1, x1);
   90|  9.81M|  x0 = _mm_max_epi32(x0, min_clip_val);
   91|  9.81M|  x0 = _mm_min_epi32(x0, max_clip_val);
   92|  9.81M|  x1 = _mm_max_epi32(x1, min_clip_val);
   93|  9.81M|  x1 = _mm_min_epi32(x1, max_clip_val);
   94|  9.81M|  x0 = _mm_packus_epi32(x0, x1);
   95|  9.81M|  return x0;
   96|  9.81M|}
highbd_inv_txfm_sse4.c:highbd_inv_txfm2d_add_h_identity_ssse41:
 5230|  84.8k|                                                    const int bd) {
 5231|  84.8k|  __m128i buf1[64];
 5232|  84.8k|  int eobx, eoby;
 5233|  84.8k|  get_eobx_eoby_scan_v_identity(&eobx, &eoby, tx_size, eob);
 5234|  84.8k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 5235|  84.8k|  const int txw_idx = get_txw_idx(tx_size);
 5236|  84.8k|  const int txh_idx = get_txh_idx(tx_size);
 5237|  84.8k|  const int txfm_size_col = tx_size_wide[tx_size];
 5238|  84.8k|  const int txfm_size_row = tx_size_high[tx_size];
 5239|  84.8k|  const int buf_size_w = AOMMIN(32, txfm_size_col);
  ------------------
  |  |   34|  84.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 84.8k]
  |  |  ------------------
  ------------------
 5240|  84.8k|  const int buf_size_w_div4 = buf_size_w >> 2;
 5241|  84.8k|  const int buf_size_h_div8 = (eoby + 8) >> 3;
 5242|  84.8k|  const int row_max = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  84.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 84.8k]
  |  |  ------------------
  ------------------
 5243|  84.8k|  const int input_stride = row_max;
 5244|  84.8k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 5245|  84.8k|  const int fun_idx = lowbd_txfm_all_1d_zeros_idx[eoby];
 5246|  84.8k|  const transform_1d_sse4_1 row_txfm =
 5247|  84.8k|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][0];
 5248|  84.8k|  const transform_1d_sse4_1 col_txfm =
 5249|  84.8k|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][fun_idx];
 5250|  84.8k|  int ud_flip, lr_flip;
 5251|  84.8k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 5252|       |
 5253|   257k|  for (int i = 0; i < (buf_size_h_div8 << 1); ++i) {
  ------------------
  |  Branch (5253:19): [True: 172k, False: 84.8k]
  ------------------
 5254|   172k|    __m128i buf0[16];
 5255|   172k|    load_buffer_32bit_input(input + i * 4, input_stride, buf0, buf_size_w);
 5256|   172k|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (5256:9): [True: 9.31k, False: 163k]
  |  Branch (5256:27): [True: 4.69k, False: 158k]
  ------------------
 5257|  14.0k|      av1_round_shift_rect_array_32_sse4_1(buf0, buf0, buf_size_w, 0,
 5258|  14.0k|                                           NewInvSqrt2);
 5259|  14.0k|    }
 5260|   172k|    row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|   172k|#define INV_COS_BIT 12
  ------------------
 5261|       |
 5262|   172k|    __m128i *_buf1 = buf1 + i * 4;
 5263|       |
 5264|   540k|    for (int j = 0; j < buf_size_w_div4; ++j) {
  ------------------
  |  Branch (5264:21): [True: 368k, False: 172k]
  ------------------
 5265|   368k|      __m128i *buf0_cur = buf0 + j * 4;
 5266|   368k|      TRANSPOSE_4X4(buf0_cur[0], buf0_cur[1], buf0_cur[2], buf0_cur[3],
  ------------------
  |  |   18|   368k|  do {                                                \
  |  |   19|   368k|    __m128i u0, u1, u2, u3;                           \
  |  |   20|   368k|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|   368k|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|   368k|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|   368k|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|   368k|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|   368k|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|   368k|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|   368k|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|   368k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 368k]
  |  |  ------------------
  ------------------
 5267|   368k|                    buf0_cur[0], buf0_cur[1], buf0_cur[2], buf0_cur[3]);
 5268|   368k|      _buf1[j * txfm_size_row + 0] = buf0_cur[0];
 5269|   368k|      _buf1[j * txfm_size_row + 1] = buf0_cur[1];
 5270|   368k|      _buf1[j * txfm_size_row + 2] = buf0_cur[2];
 5271|   368k|      _buf1[j * txfm_size_row + 3] = buf0_cur[3];
 5272|   368k|    }
 5273|   172k|  }
 5274|   264k|  for (int i = 0; i < buf_size_w_div4; i++) {
  ------------------
  |  Branch (5274:19): [True: 179k, False: 84.8k]
  ------------------
 5275|   179k|    col_txfm(buf1 + i * txfm_size_row, buf1 + i * txfm_size_row, INV_COS_BIT, 1,
  ------------------
  |  |   43|   179k|#define INV_COS_BIT 12
  ------------------
 5276|   179k|             bd, 0);
 5277|       |
 5278|   179k|    av1_round_shift_array_32_sse4_1(buf1 + i * txfm_size_row,
 5279|   179k|                                    buf1 + i * txfm_size_row, txfm_size_row,
 5280|   179k|                                    -shift[1]);
 5281|   179k|  }
 5282|       |
 5283|       |  // write to buffer
 5284|   174k|  for (int i = 0; i < (txfm_size_col >> 3); i++) {
  ------------------
  |  Branch (5284:19): [True: 89.9k, False: 84.8k]
  ------------------
 5285|  89.9k|    highbd_write_buffer_8xn_sse4_1(buf1 + i * txfm_size_row * 2, output + 8 * i,
 5286|  89.9k|                                   stride, ud_flip, txfm_size_row, bd);
 5287|  89.9k|  }
 5288|  84.8k|}
highbd_inv_txfm_sse4.c:highbd_inv_txfm2d_add_v_identity_ssse41:
 5293|   267k|                                                    const int bd) {
 5294|   267k|  __m128i buf1[64];
 5295|   267k|  int eobx, eoby;
 5296|   267k|  get_eobx_eoby_scan_h_identity(&eobx, &eoby, tx_size, eob);
 5297|   267k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 5298|   267k|  const int txw_idx = get_txw_idx(tx_size);
 5299|   267k|  const int txh_idx = get_txh_idx(tx_size);
 5300|   267k|  const int txfm_size_col = tx_size_wide[tx_size];
 5301|   267k|  const int txfm_size_row = tx_size_high[tx_size];
 5302|   267k|  const int buf_size_w_div4 = AOMMIN(32, txfm_size_col) >> 2;
  ------------------
  |  |   34|   267k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 267k]
  |  |  ------------------
  ------------------
 5303|   267k|  const int row_max = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|   267k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 267k]
  |  |  ------------------
  ------------------
 5304|   267k|  const int input_stride = row_max;
 5305|   267k|  const int buf_size_nonzero_w_div8 = (eobx + 8) >> 3;
 5306|   267k|  const int buf_size_nonzero_w = buf_size_nonzero_w_div8 << 3;
 5307|   267k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 5308|   267k|  const int fun_idx = lowbd_txfm_all_1d_zeros_idx[eobx];
 5309|   267k|  const transform_1d_sse4_1 row_txfm =
 5310|   267k|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][fun_idx];
 5311|   267k|  const transform_1d_sse4_1 col_txfm =
 5312|   267k|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][0];
 5313|   267k|  int ud_flip, lr_flip;
 5314|   267k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 5315|       |
 5316|   816k|  for (int i = 0; i < (row_max >> 2); ++i) {
  ------------------
  |  Branch (5316:19): [True: 549k, False: 267k]
  ------------------
 5317|   549k|    __m128i buf0[16];
 5318|   549k|    load_buffer_32bit_input(input + i * 4, input_stride, buf0,
 5319|   549k|                            buf_size_nonzero_w);
 5320|   549k|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (5320:9): [True: 4.21k, False: 544k]
  |  Branch (5320:27): [True: 27.3k, False: 517k]
  ------------------
 5321|  31.5k|      av1_round_shift_rect_array_32_sse4_1(buf0, buf0, buf_size_nonzero_w, 0,
 5322|  31.5k|                                           NewInvSqrt2);
 5323|  31.5k|    }
 5324|   549k|    row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|   549k|#define INV_COS_BIT 12
  ------------------
 5325|       |
 5326|   549k|    __m128i *_buf1 = buf1 + i * 4;
 5327|   549k|    if (lr_flip) {
  ------------------
  |  Branch (5327:9): [True: 14.3k, False: 534k]
  ------------------
 5328|  43.3k|      for (int j = 0; j < buf_size_w_div4; ++j) {
  ------------------
  |  Branch (5328:23): [True: 29.0k, False: 14.3k]
  ------------------
 5329|  29.0k|        TRANSPOSE_4X4(buf0[4 * j + 3], buf0[4 * j + 2], buf0[4 * j + 1],
  ------------------
  |  |   18|  29.0k|  do {                                                \
  |  |   19|  29.0k|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  29.0k|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  29.0k|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  29.0k|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  29.0k|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  29.0k|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  29.0k|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  29.0k|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  29.0k|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  29.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 29.0k]
  |  |  ------------------
  ------------------
 5330|  29.0k|                      buf0[4 * j],
 5331|  29.0k|                      _buf1[txfm_size_row * (buf_size_w_div4 - 1 - j) + 0],
 5332|  29.0k|                      _buf1[txfm_size_row * (buf_size_w_div4 - 1 - j) + 1],
 5333|  29.0k|                      _buf1[txfm_size_row * (buf_size_w_div4 - 1 - j) + 2],
 5334|  29.0k|                      _buf1[txfm_size_row * (buf_size_w_div4 - 1 - j) + 3]);
 5335|  29.0k|      }
 5336|   534k|    } else {
 5337|  1.61M|      for (int j = 0; j < buf_size_w_div4; ++j) {
  ------------------
  |  Branch (5337:23): [True: 1.08M, False: 534k]
  ------------------
 5338|  1.08M|        TRANSPOSE_4X4(
  ------------------
  |  |   18|  1.08M|  do {                                                \
  |  |   19|  1.08M|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  1.08M|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  1.08M|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  1.08M|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  1.08M|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  1.08M|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  1.08M|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  1.08M|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  1.08M|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  1.08M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 1.08M]
  |  |  ------------------
  ------------------
 5339|  1.08M|            buf0[j * 4 + 0], buf0[j * 4 + 1], buf0[j * 4 + 2], buf0[j * 4 + 3],
 5340|  1.08M|            _buf1[j * txfm_size_row + 0], _buf1[j * txfm_size_row + 1],
 5341|  1.08M|            _buf1[j * txfm_size_row + 2], _buf1[j * txfm_size_row + 3]);
 5342|  1.08M|      }
 5343|   534k|    }
 5344|   549k|  }
 5345|   806k|  for (int i = 0; i < buf_size_w_div4; i++) {
  ------------------
  |  Branch (5345:19): [True: 539k, False: 267k]
  ------------------
 5346|   539k|    col_txfm(buf1 + i * txfm_size_row, buf1 + i * txfm_size_row, INV_COS_BIT, 1,
  ------------------
  |  |   43|   539k|#define INV_COS_BIT 12
  ------------------
 5347|   539k|             bd, 0);
 5348|       |
 5349|   539k|    av1_round_shift_array_32_sse4_1(buf1 + i * txfm_size_row,
 5350|   539k|                                    buf1 + i * txfm_size_row, txfm_size_row,
 5351|   539k|                                    -shift[1]);
 5352|   539k|  }
 5353|       |
 5354|       |  // write to buffer
 5355|   267k|  {
 5356|   536k|    for (int i = 0; i < (txfm_size_col >> 3); i++) {
  ------------------
  |  Branch (5356:21): [True: 269k, False: 267k]
  ------------------
 5357|   269k|      highbd_write_buffer_8xn_sse4_1(buf1 + i * txfm_size_row * 2,
 5358|   269k|                                     output + 8 * i, stride, ud_flip,
 5359|   269k|                                     txfm_size_row, bd);
 5360|   269k|    }
 5361|   267k|  }
 5362|   267k|}
highbd_inv_txfm_sse4.c:highbd_inv_txfm2d_add_idtx_ssse41:
 5366|  7.30k|                                              int eob, const int bd) {
 5367|  7.30k|  (void)eob;
 5368|  7.30k|  __m128i buf1[64 * 4];
 5369|  7.30k|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 5370|  7.30k|  const int txw_idx = get_txw_idx(tx_size);
 5371|  7.30k|  const int txh_idx = get_txh_idx(tx_size);
 5372|  7.30k|  const int txfm_size_col = tx_size_wide[tx_size];
 5373|  7.30k|  const int txfm_size_row = tx_size_high[tx_size];
 5374|  7.30k|  const int row_max = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  7.30k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 7.30k]
  |  |  ------------------
  ------------------
 5375|  7.30k|  const int input_stride = row_max;
 5376|  7.30k|  const int buf_size_w = AOMMIN(32, txfm_size_col);
  ------------------
  |  |   34|  7.30k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 7.30k]
  |  |  ------------------
  ------------------
 5377|  7.30k|  const int buf_size_w_div4 = buf_size_w >> 2;
 5378|  7.30k|  const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
 5379|  7.30k|  const transform_1d_sse4_1 row_txfm =
 5380|  7.30k|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][0];
 5381|  7.30k|  const transform_1d_sse4_1 col_txfm =
 5382|  7.30k|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][0];
 5383|       |
 5384|  34.3k|  for (int i = 0; i < (row_max >> 2); ++i) {
  ------------------
  |  Branch (5384:19): [True: 27.0k, False: 7.30k]
  ------------------
 5385|  27.0k|    __m128i buf0[32];
 5386|  27.0k|    load_buffer_32bit_input(input + i * 4, input_stride, buf0, buf_size_w);
 5387|  27.0k|    if (rect_type == 1 || rect_type == -1) {
  ------------------
  |  Branch (5387:9): [True: 126, False: 26.9k]
  |  Branch (5387:27): [True: 332, False: 26.5k]
  ------------------
 5388|    458|      av1_round_shift_rect_array_32_sse4_1(buf0, buf0, buf_size_w, 0,
 5389|    458|                                           NewInvSqrt2);
 5390|    458|    }
 5391|  27.0k|    row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|  27.0k|#define INV_COS_BIT 12
  ------------------
 5392|       |
 5393|  27.0k|    __m128i *_buf1 = buf1 + i * 4;
 5394|   152k|    for (int j = 0; j < buf_size_w_div4; ++j) {
  ------------------
  |  Branch (5394:21): [True: 125k, False: 27.0k]
  ------------------
 5395|   125k|      __m128i *buf0_cur = buf0 + j * 4;
 5396|   125k|      TRANSPOSE_4X4(buf0_cur[0], buf0_cur[1], buf0_cur[2], buf0_cur[3],
  ------------------
  |  |   18|   125k|  do {                                                \
  |  |   19|   125k|    __m128i u0, u1, u2, u3;                           \
  |  |   20|   125k|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|   125k|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|   125k|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|   125k|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|   125k|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|   125k|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|   125k|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|   125k|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|   125k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 5397|   125k|                    buf0_cur[0], buf0_cur[1], buf0_cur[2], buf0_cur[3]);
 5398|   125k|      _buf1[j * txfm_size_row + 0] = buf0_cur[0];
 5399|   125k|      _buf1[j * txfm_size_row + 1] = buf0_cur[1];
 5400|   125k|      _buf1[j * txfm_size_row + 2] = buf0_cur[2];
 5401|   125k|      _buf1[j * txfm_size_row + 3] = buf0_cur[3];
 5402|   125k|    }
 5403|  27.0k|  }
 5404|  34.3k|  for (int i = 0; i < buf_size_w_div4; i++) {
  ------------------
  |  Branch (5404:19): [True: 27.0k, False: 7.30k]
  ------------------
 5405|  27.0k|    col_txfm(buf1 + i * txfm_size_row, buf1 + i * txfm_size_row, INV_COS_BIT, 1,
  ------------------
  |  |   43|  27.0k|#define INV_COS_BIT 12
  ------------------
 5406|  27.0k|             bd, 0);
 5407|       |
 5408|  27.0k|    av1_round_shift_array_32_sse4_1(buf1 + i * txfm_size_row,
 5409|  27.0k|                                    buf1 + i * txfm_size_row, txfm_size_row,
 5410|  27.0k|                                    -shift[1]);
 5411|  27.0k|  }
 5412|       |
 5413|       |  // write to buffer
 5414|  7.30k|  {
 5415|  20.8k|    for (int i = 0; i < (txfm_size_col >> 3); i++) {
  ------------------
  |  Branch (5415:21): [True: 13.5k, False: 7.30k]
  ------------------
 5416|  13.5k|      highbd_write_buffer_8xn_sse4_1(buf1 + i * txfm_size_row * 2,
 5417|  13.5k|                                     output + 8 * i, stride, 0, txfm_size_row,
 5418|  13.5k|                                     bd);
 5419|  13.5k|    }
 5420|  7.30k|  }
 5421|  7.30k|}
highbd_inv_txfm_sse4.c:av1_highbd_inv_txfm_add_4x8_sse4_1:
 5759|  2.41M|                                               const TxfmParam *txfm_param) {
 5760|  2.41M|  int bd = txfm_param->bd;
 5761|  2.41M|  const TX_TYPE tx_type = txfm_param->tx_type;
 5762|  2.41M|  const TX_SIZE tx_size = txfm_param->tx_size;
 5763|  2.41M|  int eob = txfm_param->eob;
 5764|  2.41M|  highbd_inv_txfm2d_add_4x8_sse41(input, CONVERT_TO_SHORTPTR(dest), stride,
  ------------------
  |  |   79|  2.41M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5765|  2.41M|                                  tx_type, tx_size, eob, bd);
 5766|  2.41M|}
highbd_inv_txfm_sse4.c:highbd_inv_txfm2d_add_4x8_sse41:
 5506|  2.41M|                                            int eob, const int bd) {
 5507|  2.41M|  (void)eob;
 5508|  2.41M|  __m128i buf1[8];
 5509|  2.41M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 5510|  2.41M|  const int txw_idx = get_txw_idx(tx_size);
 5511|  2.41M|  const int txh_idx = get_txh_idx(tx_size);
 5512|  2.41M|  const int txfm_size_col = tx_size_wide[tx_size];
 5513|  2.41M|  const int txfm_size_row = tx_size_high[tx_size];
 5514|  2.41M|  const transform_1d_sse4_1 row_txfm =
 5515|  2.41M|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][0];
 5516|  2.41M|  const transform_1d_sse4_1 col_txfm =
 5517|  2.41M|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][1];
 5518|  2.41M|  const int input_stride = AOMMIN(32, txfm_size_row);
  ------------------
  |  |   34|  2.41M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.41M]
  |  |  ------------------
  ------------------
 5519|       |
 5520|  2.41M|  assert(col_txfm != NULL);
 5521|  2.41M|  assert(row_txfm != NULL);
 5522|  2.41M|  int ud_flip, lr_flip;
 5523|  2.41M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 5524|       |
 5525|       |  // 1st stage: column transform
 5526|  2.41M|  __m128i buf0[8];
 5527|  2.41M|  load_buffer_32bit_input(input, input_stride, buf0, txfm_size_col);
 5528|  2.41M|  load_buffer_32bit_input(input + 4, input_stride, buf0 + 4, txfm_size_col);
 5529|  2.41M|  av1_round_shift_rect_array_32_sse4_1(buf0, buf0, txfm_size_row, 0,
 5530|  2.41M|                                       NewInvSqrt2);
 5531|  2.41M|  row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|  2.41M|#define INV_COS_BIT 12
  ------------------
 5532|  2.41M|  row_txfm(buf0 + 4, buf0 + 4, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|  2.41M|#define INV_COS_BIT 12
  ------------------
 5533|       |
 5534|  2.41M|  if (lr_flip) {
  ------------------
  |  Branch (5534:7): [True: 15.5k, False: 2.40M]
  ------------------
 5535|  15.5k|    TRANSPOSE_4X4(buf0[3], buf0[2], buf0[1], buf0[0], buf1[0], buf1[1], buf1[2],
  ------------------
  |  |   18|  15.5k|  do {                                                \
  |  |   19|  15.5k|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  15.5k|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  15.5k|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  15.5k|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  15.5k|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  15.5k|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  15.5k|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  15.5k|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  15.5k|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  15.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 5536|  15.5k|                  buf1[3]);
 5537|       |
 5538|  15.5k|    TRANSPOSE_4X4(buf0[7], buf0[6], buf0[5], buf0[4], buf1[4], buf1[5], buf1[6],
  ------------------
  |  |   18|  15.5k|  do {                                                \
  |  |   19|  15.5k|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  15.5k|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  15.5k|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  15.5k|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  15.5k|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  15.5k|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  15.5k|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  15.5k|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  15.5k|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  15.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 5539|  15.5k|                  buf1[7]);
 5540|  2.40M|  } else {
 5541|  2.40M|    TRANSPOSE_4X4(buf0[0], buf0[1], buf0[2], buf0[3], buf1[0], buf1[1], buf1[2],
  ------------------
  |  |   18|  2.40M|  do {                                                \
  |  |   19|  2.40M|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  2.40M|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  2.40M|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  2.40M|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  2.40M|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  2.40M|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  2.40M|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  2.40M|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  2.40M|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  2.40M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 2.40M]
  |  |  ------------------
  ------------------
 5542|  2.40M|                  buf1[3]);
 5543|       |
 5544|  2.40M|    TRANSPOSE_4X4(buf0[4], buf0[5], buf0[6], buf0[7], buf1[4], buf1[5], buf1[6],
  ------------------
  |  |   18|  2.40M|  do {                                                \
  |  |   19|  2.40M|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  2.40M|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  2.40M|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  2.40M|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  2.40M|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  2.40M|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  2.40M|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  2.40M|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  2.40M|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  2.40M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 2.40M]
  |  |  ------------------
  ------------------
 5545|  2.40M|                  buf1[7]);
 5546|  2.40M|  }
 5547|       |
 5548|       |  // 2nd stage: column transform
 5549|  2.41M|  col_txfm(buf1, buf1, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  2.41M|#define INV_COS_BIT 12
  ------------------
 5550|       |
 5551|  2.41M|  av1_round_shift_array_32_sse4_1(buf1, buf1, txfm_size_row, -shift[1]);
 5552|       |
 5553|       |  // write to buffer
 5554|  2.41M|  highbd_write_buffer_4xn_sse4_1(buf1, output, stride, ud_flip, txfm_size_row,
 5555|  2.41M|                                 bd);
 5556|  2.41M|}
highbd_inv_txfm_sse4.c:highbd_write_buffer_4xn_sse4_1:
  110|  2.41M|                                                  int height, const int bd) {
  111|  2.41M|  int j = flipud ? (height - 1) : 0;
  ------------------
  |  Branch (111:11): [True: 9.77k, False: 2.40M]
  ------------------
  112|  2.41M|  const int step = flipud ? -1 : 1;
  ------------------
  |  Branch (112:20): [True: 9.77k, False: 2.40M]
  ------------------
  113|  21.7M|  for (int i = 0; i < height; ++i, j += step) {
  ------------------
  |  Branch (113:19): [True: 19.3M, False: 2.41M]
  ------------------
  114|  19.3M|    __m128i v = _mm_loadl_epi64((__m128i const *)(output + i * stride));
  115|  19.3M|    __m128i u = highbd_get_recon_4xn_sse4_1(v, in[j], bd);
  116|       |
  117|  19.3M|    _mm_storel_epi64((__m128i *)(output + i * stride), u);
  118|  19.3M|  }
  119|  2.41M|}
highbd_inv_txfm_sse4.c:highbd_get_recon_4xn_sse4_1:
   99|  19.3M|                                                  __m128i res0, const int bd) {
  100|  19.3M|  __m128i x0 = _mm_cvtepi16_epi32(pred);
  101|       |
  102|  19.3M|  x0 = _mm_add_epi32(res0, x0);
  103|  19.3M|  x0 = _mm_packus_epi32(x0, x0);
  104|  19.3M|  x0 = highbd_clamp_epi16(x0, bd);
  105|  19.3M|  return x0;
  106|  19.3M|}
highbd_inv_txfm_sse4.c:av1_highbd_inv_txfm_add_8x4_sse4_1:
 5770|  1.65M|                                               const TxfmParam *txfm_param) {
 5771|  1.65M|  int bd = txfm_param->bd;
 5772|  1.65M|  const TX_TYPE tx_type = txfm_param->tx_type;
 5773|  1.65M|  const TX_SIZE tx_size = txfm_param->tx_size;
 5774|  1.65M|  int eob = txfm_param->eob;
 5775|  1.65M|  highbd_inv_txfm2d_add_8x4_sse41(input, CONVERT_TO_SHORTPTR(dest), stride,
  ------------------
  |  |   79|  1.65M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5776|  1.65M|                                  tx_type, tx_size, eob, bd);
 5777|  1.65M|}
highbd_inv_txfm_sse4.c:highbd_inv_txfm2d_add_8x4_sse41:
 5561|  1.65M|                                            int eob, const int bd) {
 5562|  1.65M|  (void)eob;
 5563|  1.65M|  __m128i buf1[8];
 5564|  1.65M|  const int8_t *shift = av1_inv_txfm_shift_ls[tx_size];
 5565|  1.65M|  const int txw_idx = get_txw_idx(tx_size);
 5566|  1.65M|  const int txh_idx = get_txh_idx(tx_size);
 5567|  1.65M|  const int txfm_size_col = tx_size_wide[tx_size];
 5568|  1.65M|  const int txfm_size_row = tx_size_high[tx_size];
 5569|  1.65M|  const transform_1d_sse4_1 row_txfm =
 5570|  1.65M|      highbd_txfm_all_1d_zeros_w8_arr[txw_idx][hitx_1d_tab[tx_type]][1];
 5571|  1.65M|  const transform_1d_sse4_1 col_txfm =
 5572|  1.65M|      highbd_txfm_all_1d_zeros_w8_arr[txh_idx][vitx_1d_tab[tx_type]][0];
 5573|       |
 5574|  1.65M|  assert(col_txfm != NULL);
 5575|  1.65M|  assert(row_txfm != NULL);
 5576|  1.65M|  int ud_flip, lr_flip;
 5577|  1.65M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 5578|       |
 5579|       |  // 1st stage: column transform
 5580|  1.65M|  __m128i buf0[8];
 5581|  1.65M|  const int32_t *input_row = input;
 5582|  1.65M|  load_buffer_32bit_input(input_row, 4, buf0, txfm_size_col);
 5583|       |
 5584|  1.65M|  av1_round_shift_rect_array_32_sse4_1(buf0, buf0, txfm_size_col, 0,
 5585|  1.65M|                                       NewInvSqrt2);
 5586|  1.65M|  row_txfm(buf0, buf0, INV_COS_BIT, 0, bd, -shift[0]);
  ------------------
  |  |   43|  1.65M|#define INV_COS_BIT 12
  ------------------
 5587|       |
 5588|  1.65M|  __m128i *buf1_ptr;
 5589|  1.65M|  if (lr_flip) {
  ------------------
  |  Branch (5589:7): [True: 13.6k, False: 1.63M]
  ------------------
 5590|  13.6k|    flip_buf_sse2(buf0, buf1, txfm_size_col);
 5591|  13.6k|    buf1_ptr = buf1;
 5592|  1.63M|  } else {
 5593|  1.63M|    buf1_ptr = buf0;
 5594|  1.63M|  }
 5595|       |
 5596|       |  // 2nd stage: column transform
 5597|  4.95M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (5597:19): [True: 3.30M, False: 1.65M]
  ------------------
 5598|  3.30M|    __m128i *buf1_cur = buf1_ptr + i * txfm_size_row;
 5599|  3.30M|    transpose_32bit_4x4(buf1_cur, buf1_cur);
 5600|  3.30M|    col_txfm(buf1_cur, buf1_cur, INV_COS_BIT, 1, bd, 0);
  ------------------
  |  |   43|  3.30M|#define INV_COS_BIT 12
  ------------------
 5601|  3.30M|  }
 5602|  1.65M|  av1_round_shift_array_32_sse4_1(buf1_ptr, buf1_ptr, txfm_size_col, -shift[1]);
 5603|       |  // write to buffer
 5604|  1.65M|  highbd_write_buffer_8xn_sse4_1(buf1_ptr, output, stride, ud_flip,
 5605|  1.65M|                                 txfm_size_row, bd);
 5606|  1.65M|}
highbd_inv_txfm_sse4.c:av1_highbd_inv_txfm_add_4x4_sse4_1:
 5154|  19.2M|                                               const TxfmParam *txfm_param) {
 5155|  19.2M|  assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]);
 5156|  19.2M|  int eob = txfm_param->eob;
 5157|  19.2M|  int bd = txfm_param->bd;
 5158|  19.2M|  int lossless = txfm_param->lossless;
 5159|  19.2M|  const int32_t *src = cast_to_int32(input);
 5160|  19.2M|  const TX_TYPE tx_type = txfm_param->tx_type;
 5161|  19.2M|  if (lossless) {
  ------------------
  |  Branch (5161:7): [True: 3.55M, False: 15.6M]
  ------------------
 5162|  3.55M|    assert(tx_type == DCT_DCT);
 5163|  3.55M|    av1_highbd_iwht4x4_add(input, dest, stride, eob, bd);
 5164|  3.55M|    return;
 5165|  3.55M|  }
 5166|  15.6M|  av1_inv_txfm2d_add_4x4_sse4_1(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type,
  ------------------
  |  |   79|  15.6M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 5167|  15.6M|                                bd);
 5168|  15.6M|}

highbd_inv_txfm_sse4.c:half_btf_0_sse4_1:
  112|  6.53k|                                        const __m128i *rounding, int bit) {
  113|  6.53k|  __m128i x;
  114|       |
  115|  6.53k|  x = _mm_mullo_epi32(*w0, *n0);
  116|  6.53k|  x = _mm_add_epi32(x, *rounding);
  117|  6.53k|  x = _mm_srai_epi32(x, bit);
  118|  6.53k|  return x;
  119|  6.53k|}
highbd_inv_txfm_sse4.c:half_btf_sse4_1:
  100|   171k|                                      const __m128i *rounding, int bit) {
  101|   171k|  __m128i x, y;
  102|       |
  103|   171k|  x = _mm_mullo_epi32(*w0, *n0);
  104|   171k|  y = _mm_mullo_epi32(*w1, *n1);
  105|   171k|  x = _mm_add_epi32(x, y);
  106|   171k|  x = _mm_add_epi32(x, *rounding);
  107|   171k|  x = _mm_srai_epi32(x, bit);
  108|   171k|  return x;
  109|   171k|}
highbd_fwd_txfm_sse4.c:transpose_8nx8n:
   79|  41.9k|                                   const int width, const int height) {
   80|  41.9k|  const int numcol = height >> 2;
   81|  41.9k|  const int numrow = width >> 2;
   82|   325k|  for (int j = 0; j < numrow; j++) {
  ------------------
  |  Branch (82:19): [True: 283k, False: 41.9k]
  ------------------
   83|  1.92M|    for (int i = 0; i < numcol; i++) {
  ------------------
  |  Branch (83:21): [True: 1.64M, False: 283k]
  ------------------
   84|  1.64M|      TRANSPOSE_4X4(input[i * width + j + (numrow * 0)],
  ------------------
  |  |   18|  1.64M|  do {                                                \
  |  |   19|  1.64M|    __m128i u0, u1, u2, u3;                           \
  |  |   20|  1.64M|    u0 = _mm_unpacklo_epi32(x0, x1);                  \
  |  |   21|  1.64M|    u1 = _mm_unpackhi_epi32(x0, x1);                  \
  |  |   22|  1.64M|    u2 = _mm_unpacklo_epi32(x2, x3);                  \
  |  |   23|  1.64M|    u3 = _mm_unpackhi_epi32(x2, x3);                  \
  |  |   24|  1.64M|    y0 = _mm_unpacklo_epi64(u0, u2);                  \
  |  |   25|  1.64M|    y1 = _mm_unpackhi_epi64(u0, u2);                  \
  |  |   26|  1.64M|    y2 = _mm_unpacklo_epi64(u1, u3);                  \
  |  |   27|  1.64M|    y3 = _mm_unpackhi_epi64(u1, u3);                  \
  |  |   28|  1.64M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (28:12): [Folded, False: 1.64M]
  |  |  ------------------
  ------------------
   85|  1.64M|                    input[i * width + j + (numrow * 1)],
   86|  1.64M|                    input[i * width + j + (numrow * 2)],
   87|  1.64M|                    input[i * width + j + (numrow * 3)],
   88|  1.64M|                    output[j * height + i + (numcol * 0)],
   89|  1.64M|                    output[j * height + i + (numcol * 1)],
   90|  1.64M|                    output[j * height + i + (numcol * 2)],
   91|  1.64M|                    output[j * height + i + (numcol * 3)]);
   92|  1.64M|    }
   93|   283k|  }
   94|  41.9k|}

av1_highbd_warp_affine_avx2:
   23|  28.4k|                                 int16_t beta, int16_t gamma, int16_t delta) {
   24|  28.4k|  __m256i tmp[15];
   25|  28.4k|  const int reduce_bits_horiz = conv_params->round_0;
   26|  28.4k|  const int reduce_bits_vert = conv_params->is_compound
  ------------------
  |  Branch (26:32): [True: 0, False: 28.4k]
  ------------------
   27|  28.4k|                                   ? conv_params->round_1
   28|  28.4k|                                   : 2 * FILTER_BITS - reduce_bits_horiz;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   29|  28.4k|  const int max_bits_horiz = bd + FILTER_BITS + 1 - reduce_bits_horiz;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   30|  28.4k|  const int offset_bits_horiz = bd + FILTER_BITS - 1;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   31|  28.4k|  const int offset_bits_vert = bd + 2 * FILTER_BITS - reduce_bits_horiz;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   32|  28.4k|  const int round_bits =
   33|  28.4k|      2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   34|  28.4k|  const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|  28.4k|#define FILTER_BITS 7
  ------------------
   35|  28.4k|  (void)max_bits_horiz;
   36|  28.4k|  assert(IMPLIES(conv_params->is_compound, conv_params->dst != NULL));
   37|       |
   38|       |  // Check that, even with 12-bit input, the intermediate values will fit
   39|       |  // into an unsigned 16-bit intermediate array.
   40|  28.4k|  assert(bd + FILTER_BITS + 2 - conv_params->round_0 <= 16);
   41|       |
   42|  28.4k|  const __m256i clip_pixel =
   43|  18.4E|      _mm256_set1_epi16(bd == 10 ? 1023 : (bd == 12 ? 4095 : 255));
  ------------------
  |  Branch (43:25): [True: 8.93k, False: 19.4k]
  |  Branch (43:44): [True: 19.4k, False: 18.4E]
  ------------------
   44|  28.4k|  const __m128i reduce_bits_vert_shift = _mm_cvtsi32_si128(reduce_bits_vert);
   45|  28.4k|  const __m256i reduce_bits_vert_const =
   46|  28.4k|      _mm256_set1_epi32(((1 << reduce_bits_vert) >> 1));
   47|  28.4k|  const __m256i res_add_const = _mm256_set1_epi32(1 << offset_bits_vert);
   48|  28.4k|  const __m256i res_sub_const =
   49|  28.4k|      _mm256_set1_epi32(-(1 << (offset_bits - conv_params->round_1)) -
   50|  28.4k|                        (1 << (offset_bits - conv_params->round_1 - 1)));
   51|  28.4k|  __m128i round_bits_shift = _mm_cvtsi32_si128(round_bits);
   52|  28.4k|  __m256i round_bits_const = _mm256_set1_epi32(((1 << round_bits) >> 1));
   53|       |
   54|  28.4k|  const int w0 = conv_params->fwd_offset;
   55|  28.4k|  const int w1 = conv_params->bck_offset;
   56|  28.4k|  const __m256i wt0 = _mm256_set1_epi32(w0);
   57|  28.4k|  const __m256i wt1 = _mm256_set1_epi32(w1);
   58|       |
   59|  28.4k|  __m256i v_rbhoriz = _mm256_set1_epi32(1 << (reduce_bits_horiz - 1));
   60|  28.4k|  __m256i v_zeros = _mm256_setzero_si256();
   61|  28.4k|  int ohoriz = 1 << offset_bits_horiz;
   62|  28.4k|  int mhoriz = 1 << max_bits_horiz;
   63|  28.4k|  (void)mhoriz;
   64|  28.4k|  int sx;
   65|       |
   66|  59.7k|  for (int i = 0; i < p_height; i += 8) {
  ------------------
  |  Branch (66:19): [True: 31.3k, False: 28.4k]
  ------------------
   67|  68.9k|    for (int j = 0; j < p_width; j += 8) {
  ------------------
  |  Branch (67:21): [True: 37.5k, False: 31.3k]
  ------------------
   68|       |      // Calculate the center of this 8x8 block,
   69|       |      // project to luma coordinates (if in a subsampled chroma plane),
   70|       |      // apply the affine transformation,
   71|       |      // then convert back to the original coordinates (if necessary)
   72|  37.5k|      const int32_t src_x = (p_col + j + 4) << subsampling_x;
   73|  37.5k|      const int32_t src_y = (p_row + i + 4) << subsampling_y;
   74|  37.5k|      const int64_t dst_x =
   75|  37.5k|          (int64_t)mat[2] * src_x + (int64_t)mat[3] * src_y + (int64_t)mat[0];
   76|  37.5k|      const int64_t dst_y =
   77|  37.5k|          (int64_t)mat[4] * src_x + (int64_t)mat[5] * src_y + (int64_t)mat[1];
   78|  37.5k|      const int64_t x4 = dst_x >> subsampling_x;
   79|  37.5k|      const int64_t y4 = dst_y >> subsampling_y;
   80|       |
   81|  37.5k|      const int16_t ix4 = (int32_t)(x4 >> WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
   82|  37.5k|      int32_t sx4 = x4 & ((1 << WARPEDMODEL_PREC_BITS) - 1);
  ------------------
  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
   83|  37.5k|      const int16_t iy4 = (int32_t)(y4 >> WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
   84|  37.5k|      int32_t sy4 = y4 & ((1 << WARPEDMODEL_PREC_BITS) - 1);
  ------------------
  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
   85|       |
   86|  37.5k|      sx4 += alpha * (-4) + beta * (-4) + (1 << (WARPEDDIFF_PREC_BITS - 1)) +
  ------------------
  |  |  107|  37.5k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
   87|  37.5k|             (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  103|  37.5k|#define WARPEDPIXEL_PREC_SHIFTS (1 << WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
                           (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  107|  37.5k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
   88|  37.5k|      sy4 += gamma * (-4) + delta * (-4) + (1 << (WARPEDDIFF_PREC_BITS - 1)) +
  ------------------
  |  |  107|  37.5k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
   89|  37.5k|             (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  103|  37.5k|#define WARPEDPIXEL_PREC_SHIFTS (1 << WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
                           (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  107|  37.5k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  37.5k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  37.5k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
   90|       |
   91|  37.5k|      sx4 &= ~((1 << WARP_PARAM_REDUCE_BITS) - 1);
  ------------------
  |  |  105|  37.5k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
   92|  37.5k|      sy4 &= ~((1 << WARP_PARAM_REDUCE_BITS) - 1);
  ------------------
  |  |  105|  37.5k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
   93|       |
   94|       |      // Horizontal filter
   95|  37.5k|      if (ix4 <= -7) {
  ------------------
  |  Branch (95:11): [True: 162, False: 37.4k]
  ------------------
   96|  2.59k|        for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|  2.59k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.59k]
  |  |  ------------------
  ------------------
  |  Branch (96:26): [True: 2.43k, False: 162]
  ------------------
   97|  2.43k|          int iy = iy4 + k;
   98|  2.43k|          if (iy < 0)
  ------------------
  |  Branch (98:15): [True: 808, False: 1.62k]
  ------------------
   99|    808|            iy = 0;
  100|  1.62k|          else if (iy > height - 1)
  ------------------
  |  Branch (100:20): [True: 0, False: 1.62k]
  ------------------
  101|      0|            iy = height - 1;
  102|  2.43k|          tmp[k + 7] = _mm256_cvtepi16_epi32(_mm_set1_epi16(
  103|  2.43k|              (1 << (bd + FILTER_BITS - reduce_bits_horiz - 1)) +
  ------------------
  |  |   21|  2.43k|#define FILTER_BITS 7
  ------------------
  104|  2.43k|              ref[iy * stride] * (1 << (FILTER_BITS - reduce_bits_horiz))));
  ------------------
  |  |   21|  2.43k|#define FILTER_BITS 7
  ------------------
  105|  2.43k|        }
  106|  37.4k|      } else if (ix4 >= width + 6) {
  ------------------
  |  Branch (106:18): [True: 1.10k, False: 36.3k]
  ------------------
  107|  17.6k|        for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|  17.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 9.31k, False: 8.36k]
  |  |  ------------------
  ------------------
  |  Branch (107:26): [True: 16.5k, False: 1.10k]
  ------------------
  108|  16.5k|          int iy = iy4 + k;
  109|  16.5k|          if (iy < 0)
  ------------------
  |  Branch (109:15): [True: 1.97k, False: 14.6k]
  ------------------
  110|  1.97k|            iy = 0;
  111|  14.6k|          else if (iy > height - 1)
  ------------------
  |  Branch (111:20): [True: 4.68k, False: 9.91k]
  ------------------
  112|  4.68k|            iy = height - 1;
  113|  16.5k|          tmp[k + 7] = _mm256_cvtepi16_epi32(
  114|  16.5k|              _mm_set1_epi16((1 << (bd + FILTER_BITS - reduce_bits_horiz - 1)) +
  ------------------
  |  |   21|  16.5k|#define FILTER_BITS 7
  ------------------
  115|  16.5k|                             ref[iy * stride + (width - 1)] *
  116|  16.5k|                                 (1 << (FILTER_BITS - reduce_bits_horiz))));
  ------------------
  |  |   21|  16.5k|#define FILTER_BITS 7
  ------------------
  117|  16.5k|        }
  118|  36.3k|      } else if (((ix4 - 7) < 0) || ((ix4 + 9) > width)) {
  ------------------
  |  Branch (118:18): [True: 12.0k, False: 24.3k]
  |  Branch (118:37): [True: 6.43k, False: 17.8k]
  ------------------
  119|  18.4k|        int32_t tmp1[8];
  120|   286k|        for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|   286k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 52.0k, False: 234k]
  |  |  ------------------
  ------------------
  |  Branch (120:26): [True: 268k, False: 18.4k]
  ------------------
  121|   268k|          const int iy = clamp(iy4 + k, 0, height - 1);
  122|       |
  123|   268k|          sx = sx4 + beta * (k + 4);
  124|  2.41M|          for (int l = -4; l < 4; ++l) {
  ------------------
  |  Branch (124:28): [True: 2.14M, False: 268k]
  ------------------
  125|  2.14M|            int ix = ix4 + l - 3;
  126|  2.14M|            const int offs = sx >> WARPEDDIFF_PREC_BITS;
  ------------------
  |  |  107|  2.14M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.14M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.14M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  127|  2.14M|            const int16_t *coeffs = av1_warped_filter[offs];
  128|       |
  129|  2.14M|            int32_t sum = 1 << offset_bits_horiz;
  130|  19.2M|            for (int m = 0; m < 8; ++m) {
  ------------------
  |  Branch (130:29): [True: 17.1M, False: 2.14M]
  ------------------
  131|  17.1M|              const int sample_x = clamp(ix + m, 0, width - 1);
  132|  17.1M|              sum += ref[iy * stride + sample_x] * coeffs[m];
  133|  17.1M|            }
  134|  2.14M|            sum = ROUND_POWER_OF_TWO(sum, reduce_bits_horiz);
  ------------------
  |  |   41|  2.14M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  135|  2.14M|            tmp1[(l + 4) / 2 + ((l + 4) % 2) * 4] = sum;
  136|  2.14M|            sx += alpha;
  137|  2.14M|          }
  138|   268k|          tmp[k + 7] = _mm256_loadu_si256((__m256i *)tmp1);
  139|   268k|        }
  140|  18.4k|      } else {
  141|  17.8k|        if (beta == 0 && alpha == 0) {
  ------------------
  |  Branch (141:13): [True: 11.9k, False: 5.95k]
  |  Branch (141:26): [True: 6.76k, False: 5.16k]
  ------------------
  142|  6.76k|          sx = sx4;
  143|  6.76k|          __m128i v_01 = _mm_loadu_si128(
  144|  6.76k|              (__m128i *)
  145|  6.76k|                  av1_warped_filter[sx >>
  146|  6.76k|                                    WARPEDDIFF_PREC_BITS]);  // A7A6A5A4A3A2A1A0
  ------------------
  |  |  107|  6.76k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  6.76k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  6.76k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  147|  6.76k|          __m256i v_c01 = _mm256_broadcastd_epi32(v_01);     // A1A0A1A0A1A0A1A0
  148|  6.76k|          __m256i v_c23 = _mm256_broadcastd_epi32(
  149|  6.76k|              _mm_shuffle_epi32(v_01, 1));  // A3A2A3A2A3A2A3A2
  150|  6.76k|          __m256i v_c45 = _mm256_broadcastd_epi32(
  151|  6.76k|              _mm_shuffle_epi32(v_01, 2));  // A5A4A5A4A5A4A5A4
  152|  6.76k|          __m256i v_c67 = _mm256_broadcastd_epi32(
  153|  6.76k|              _mm_shuffle_epi32(v_01, 3));  // A7A6A7A6A7A6A7A6
  154|   108k|          for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|   108k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.84k, False: 103k]
  |  |  ------------------
  ------------------
  |  Branch (154:28): [True: 101k, False: 6.76k]
  ------------------
  155|   101k|            int iy = iy4 + k;
  156|   101k|            if (iy < 0)
  ------------------
  |  Branch (156:17): [True: 18.2k, False: 83.2k]
  ------------------
  157|  18.2k|              iy = 0;
  158|  83.2k|            else if (iy > height - 1)
  ------------------
  |  Branch (158:22): [True: 42.0k, False: 41.1k]
  ------------------
  159|  42.0k|              iy = height - 1;
  160|   101k|            iy = iy * stride;
  161|       |
  162|   101k|            __m256i v_refl = _mm256_inserti128_si256(
  163|   101k|                _mm256_setzero_si256(),
  164|   101k|                _mm_loadu_si128((__m128i *)&ref[iy + ix4 - 7]), 0);
  165|   101k|            v_refl = _mm256_inserti128_si256(
  166|   101k|                v_refl, _mm_loadu_si128((__m128i *)&ref[iy + ix4 + 1]),
  167|   101k|                1);  // R15 .. R0
  168|       |
  169|   101k|            __m256i v_ref = _mm256_permute4x64_epi64(v_refl, 0xEE);
  170|       |
  171|   101k|            __m256i v_refu =
  172|   101k|                _mm256_alignr_epi8(v_ref, v_refl, 2);  // R8R15R14...R2R1
  173|   101k|            v_refl = _mm256_inserti128_si256(
  174|   101k|                v_refl, _mm256_extracti128_si256(v_refu, 0), 1);
  175|   101k|            v_refu = _mm256_inserti128_si256(
  176|   101k|                v_refu, _mm256_extracti128_si256(v_ref, 0), 0);
  177|       |
  178|   101k|            __m256i v_sum = _mm256_set1_epi32(ohoriz);
  179|   101k|            __m256i parsum = _mm256_madd_epi16(
  180|   101k|                v_c01, _mm256_alignr_epi8(v_refu, v_refl,
  181|   101k|                                          0));  // R8R7R6..R1R7R6R5..R1R0
  182|   101k|            __m256i v_sum1 = _mm256_add_epi32(v_sum, parsum);
  183|       |
  184|   101k|            parsum = _mm256_madd_epi16(
  185|   101k|                v_c23,
  186|   101k|                _mm256_alignr_epi8(v_refu, v_refl, 4));  // R10R9..R3R9R8..R3R2
  187|   101k|            __m256i v_sum2 = _mm256_add_epi32(v_sum1, parsum);
  188|   101k|            parsum = _mm256_madd_epi16(
  189|   101k|                v_c45, _mm256_alignr_epi8(v_refu, v_refl,
  190|   101k|                                          8));  // R12R11..R5R11R10..R5R4
  191|   101k|            __m256i v_sum3 = _mm256_add_epi32(v_sum2, parsum);
  192|   101k|            parsum = _mm256_madd_epi16(
  193|   101k|                v_c67, _mm256_alignr_epi8(v_refu, v_refl,
  194|   101k|                                          12));  // R14R13..R7R13R12..R7R6
  195|   101k|            __m256i v_sum4 = _mm256_add_epi32(v_sum3, parsum);
  196|       |
  197|   101k|            tmp[k + 7] = _mm256_srai_epi32(_mm256_add_epi32(v_sum4, v_rbhoriz),
  198|   101k|                                           reduce_bits_horiz);
  199|   101k|          }
  200|  11.1k|        } else if (alpha == 0) {
  ------------------
  |  Branch (200:20): [True: 44, False: 11.0k]
  ------------------
  201|    704|          for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|    704|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 704]
  |  |  ------------------
  ------------------
  |  Branch (201:28): [True: 660, False: 44]
  ------------------
  202|    660|            int iy = iy4 + k;
  203|    660|            if (iy < 0)
  ------------------
  |  Branch (203:17): [True: 0, False: 660]
  ------------------
  204|      0|              iy = 0;
  205|    660|            else if (iy > height - 1)
  ------------------
  |  Branch (205:22): [True: 428, False: 232]
  ------------------
  206|    428|              iy = height - 1;
  207|    660|            iy = iy * stride;
  208|       |
  209|    660|            sx = sx4 + beta * (k + 4);
  210|       |
  211|    660|            __m128i v_01 = _mm_loadu_si128(
  212|    660|                (__m128i *)av1_warped_filter
  213|    660|                    [sx >> WARPEDDIFF_PREC_BITS]);          // A7A6A5A4A3A2A1A0
  ------------------
  |  |  107|    660|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    660|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|    660|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  214|    660|            __m256i v_c01 = _mm256_broadcastd_epi32(v_01);  // A1A0A1A0A1A0A1A0
  215|    660|            __m256i v_c23 = _mm256_broadcastd_epi32(
  216|    660|                _mm_shuffle_epi32(v_01, 1));  // A3A2A3A2A3A2A3A2
  217|    660|            __m256i v_c45 = _mm256_broadcastd_epi32(
  218|    660|                _mm_shuffle_epi32(v_01, 2));  // A5A4A5A4A5A4A5A4
  219|    660|            __m256i v_c67 = _mm256_broadcastd_epi32(
  220|    660|                _mm_shuffle_epi32(v_01, 3));  // A7A6A7A6A7A6A7A6
  221|       |
  222|    660|            __m256i v_refl = _mm256_inserti128_si256(
  223|    660|                _mm256_setzero_si256(),
  224|    660|                _mm_loadu_si128((__m128i *)&ref[iy + ix4 - 7]), 0);
  225|    660|            v_refl = _mm256_inserti128_si256(
  226|    660|                v_refl, _mm_loadu_si128((__m128i *)&ref[iy + ix4 + 1]),
  227|    660|                1);  // R15 .. R0
  228|       |
  229|    660|            __m256i v_ref = _mm256_permute4x64_epi64(v_refl, 0xEE);
  230|       |
  231|    660|            __m256i v_refu =
  232|    660|                _mm256_alignr_epi8(v_ref, v_refl, 2);  // R8R15R14...R2R1
  233|       |
  234|    660|            v_refl = _mm256_inserti128_si256(
  235|    660|                v_refl, _mm256_extracti128_si256(v_refu, 0), 1);
  236|    660|            v_refu = _mm256_inserti128_si256(
  237|    660|                v_refu, _mm256_extracti128_si256(v_ref, 0), 0);
  238|       |
  239|    660|            __m256i v_sum = _mm256_set1_epi32(ohoriz);
  240|    660|            __m256i parsum =
  241|    660|                _mm256_madd_epi16(v_c01, _mm256_alignr_epi8(v_refu, v_refl, 0));
  242|    660|            __m256i v_sum1 = _mm256_add_epi32(v_sum, parsum);
  243|       |
  244|    660|            parsum =
  245|    660|                _mm256_madd_epi16(v_c23, _mm256_alignr_epi8(v_refu, v_refl, 4));
  246|    660|            __m256i v_sum2 = _mm256_add_epi32(v_sum1, parsum);
  247|    660|            parsum =
  248|    660|                _mm256_madd_epi16(v_c45, _mm256_alignr_epi8(v_refu, v_refl, 8));
  249|    660|            __m256i v_sum3 = _mm256_add_epi32(v_sum2, parsum);
  250|    660|            parsum = _mm256_madd_epi16(v_c67,
  251|    660|                                       _mm256_alignr_epi8(v_refu, v_refl, 12));
  252|    660|            __m256i v_sum4 = _mm256_add_epi32(v_sum3, parsum);
  253|       |
  254|    660|            tmp[k + 7] = _mm256_srai_epi32(_mm256_add_epi32(v_sum4, v_rbhoriz),
  255|    660|                                           reduce_bits_horiz);
  256|    660|          }
  257|  11.0k|        } else if (beta == 0) {
  ------------------
  |  Branch (257:20): [True: 5.16k, False: 5.91k]
  ------------------
  258|  5.16k|          sx = sx4;
  259|  5.16k|          __m256i v_coeff01 = _mm256_inserti128_si256(
  260|  5.16k|              v_zeros,
  261|  5.16k|              _mm_loadu_si128(
  262|  5.16k|                  (__m128i *)av1_warped_filter[(sx) >> WARPEDDIFF_PREC_BITS]),
  263|  5.16k|              0);
  264|  5.16k|          v_coeff01 = _mm256_inserti128_si256(
  265|  5.16k|              v_coeff01,
  266|  5.16k|              _mm_loadu_si128(
  267|  5.16k|                  (__m128i *)
  268|  5.16k|                      av1_warped_filter[(sx + alpha) >> WARPEDDIFF_PREC_BITS]),
  269|  5.16k|              1);  // B7B6..B1B0A7A6..A1A0
  270|  5.16k|          __m256i v_coeff23 = _mm256_inserti128_si256(
  271|  5.16k|              v_zeros,
  272|  5.16k|              _mm_loadu_si128(
  273|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 2 * alpha) >>
  274|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  275|  5.16k|              0);
  276|  5.16k|          v_coeff23 = _mm256_inserti128_si256(
  277|  5.16k|              v_coeff23,
  278|  5.16k|              _mm_loadu_si128(
  279|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 3 * alpha) >>
  280|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  281|  5.16k|              1);  // D7D6..D1D0C7C6..C1C0
  282|  5.16k|          __m256i v_coeff45 = _mm256_inserti128_si256(
  283|  5.16k|              v_zeros,
  284|  5.16k|              _mm_loadu_si128(
  285|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 4 * alpha) >>
  286|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  287|  5.16k|              0);
  288|  5.16k|          v_coeff45 = _mm256_inserti128_si256(
  289|  5.16k|              v_coeff45,
  290|  5.16k|              _mm_loadu_si128(
  291|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 5 * alpha) >>
  292|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  293|  5.16k|              1);  // F7F6..F1F0E7E6..E1E0
  294|  5.16k|          __m256i v_coeff67 = _mm256_inserti128_si256(
  295|  5.16k|              v_zeros,
  296|  5.16k|              _mm_loadu_si128(
  297|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 6 * alpha) >>
  298|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  299|  5.16k|              0);
  300|  5.16k|          v_coeff67 = _mm256_inserti128_si256(
  301|  5.16k|              v_coeff67,
  302|  5.16k|              _mm_loadu_si128(
  303|  5.16k|                  (__m128i *)av1_warped_filter[(sx + 7 * alpha) >>
  304|  5.16k|                                               WARPEDDIFF_PREC_BITS]),
  305|  5.16k|              1);  // H7H6..H1H0G7G6..G1G0
  306|       |
  307|  5.16k|          __m256i v_c0123 = _mm256_unpacklo_epi32(
  308|  5.16k|              v_coeff01,
  309|  5.16k|              v_coeff23);  // D3D2B3B2D1D0B1B0C3C2A3A2C1C0A1A0
  310|  5.16k|          __m256i v_c0123u = _mm256_unpackhi_epi32(
  311|  5.16k|              v_coeff01,
  312|  5.16k|              v_coeff23);  // D7D6B7B6D5D4B5B4C7C6A7A6C5C4A5A4
  313|  5.16k|          __m256i v_c4567 = _mm256_unpacklo_epi32(
  314|  5.16k|              v_coeff45,
  315|  5.16k|              v_coeff67);  // H3H2F3F2H1H0F1F0G3G2E3E2G1G0E1E0
  316|  5.16k|          __m256i v_c4567u = _mm256_unpackhi_epi32(
  317|  5.16k|              v_coeff45,
  318|  5.16k|              v_coeff67);  // H7H6F7F6H5H4F5F4G7G6E7E6G5G4E5E4
  319|       |
  320|  5.16k|          __m256i v_c01 = _mm256_unpacklo_epi64(
  321|  5.16k|              v_c0123, v_c4567);  // H1H0F1F0D1D0B1B0G1G0E1E0C1C0A1A0
  322|  5.16k|          __m256i v_c23 =
  323|  5.16k|              _mm256_unpackhi_epi64(v_c0123, v_c4567);  // H3H2 ... A3A2
  324|  5.16k|          __m256i v_c45 =
  325|  5.16k|              _mm256_unpacklo_epi64(v_c0123u, v_c4567u);  // H5H4 ... A5A4
  326|  5.16k|          __m256i v_c67 =
  327|  5.16k|              _mm256_unpackhi_epi64(v_c0123u, v_c4567u);  // H7H6 ... A7A6
  328|       |
  329|  82.6k|          for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|  82.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.56k, False: 74.0k]
  |  |  ------------------
  ------------------
  |  Branch (329:28): [True: 77.4k, False: 5.16k]
  ------------------
  330|  77.4k|            int iy = iy4 + k;
  331|  77.4k|            if (iy < 0)
  ------------------
  |  Branch (331:17): [True: 9.48k, False: 68.0k]
  ------------------
  332|  9.48k|              iy = 0;
  333|  68.0k|            else if (iy > height - 1)
  ------------------
  |  Branch (333:22): [True: 27.9k, False: 40.0k]
  ------------------
  334|  27.9k|              iy = height - 1;
  335|  77.4k|            iy = iy * stride;
  336|       |
  337|  77.4k|            __m256i v_refl = _mm256_inserti128_si256(
  338|  77.4k|                _mm256_setzero_si256(),
  339|  77.4k|                _mm_loadu_si128((__m128i *)&ref[iy + ix4 - 7]), 0);
  340|  77.4k|            v_refl = _mm256_inserti128_si256(
  341|  77.4k|                v_refl, _mm_loadu_si128((__m128i *)&ref[iy + ix4 + 1]),
  342|  77.4k|                1);  // R15 .. R0
  343|       |
  344|  77.4k|            __m256i v_ref = _mm256_permute4x64_epi64(v_refl, 0xEE);
  345|       |
  346|  77.4k|            __m256i v_refu =
  347|  77.4k|                _mm256_alignr_epi8(v_ref, v_refl, 2);  // R8R15R14...R2R1
  348|       |
  349|  77.4k|            v_refl = _mm256_inserti128_si256(
  350|  77.4k|                v_refl, _mm256_extracti128_si256(v_refu, 0), 1);
  351|  77.4k|            v_refu = _mm256_inserti128_si256(
  352|  77.4k|                v_refu, _mm256_extracti128_si256(v_ref, 0), 0);
  353|       |
  354|  77.4k|            __m256i v_sum = _mm256_set1_epi32(ohoriz);
  355|  77.4k|            __m256i parsum = _mm256_madd_epi16(
  356|  77.4k|                v_c01, _mm256_alignr_epi8(v_refu, v_refl,
  357|  77.4k|                                          0));  // R8R7R6..R1R7R6R5..R1R0
  358|  77.4k|            __m256i v_sum1 = _mm256_add_epi32(v_sum, parsum);
  359|       |
  360|  77.4k|            parsum = _mm256_madd_epi16(
  361|  77.4k|                v_c23,
  362|  77.4k|                _mm256_alignr_epi8(v_refu, v_refl, 4));  // R10R9..R3R9R8..R3R2
  363|  77.4k|            __m256i v_sum2 = _mm256_add_epi32(v_sum1, parsum);
  364|  77.4k|            parsum = _mm256_madd_epi16(
  365|  77.4k|                v_c45, _mm256_alignr_epi8(v_refu, v_refl,
  366|  77.4k|                                          8));  // R12R11..R5R11R10..R5R4
  367|  77.4k|            __m256i v_sum3 = _mm256_add_epi32(v_sum2, parsum);
  368|  77.4k|            parsum = _mm256_madd_epi16(
  369|  77.4k|                v_c67, _mm256_alignr_epi8(v_refu, v_refl,
  370|  77.4k|                                          12));  // R14R13..R7R13R12..R7R6
  371|  77.4k|            __m256i v_sum4 = _mm256_add_epi32(v_sum3, parsum);
  372|       |
  373|  77.4k|            tmp[k + 7] = _mm256_srai_epi32(_mm256_add_epi32(v_sum4, v_rbhoriz),
  374|  77.4k|                                           reduce_bits_horiz);
  375|  77.4k|          }
  376|       |
  377|  5.91k|        } else {
  378|  94.4k|          for (int k = -7; k < AOMMIN(8, p_height - i); ++k) {
  ------------------
  |  |   34|  94.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 34.5k, False: 59.8k]
  |  |  ------------------
  ------------------
  |  Branch (378:28): [True: 88.5k, False: 5.91k]
  ------------------
  379|  88.5k|            int iy = iy4 + k;
  380|  88.5k|            if (iy < 0)
  ------------------
  |  Branch (380:17): [True: 10.3k, False: 78.1k]
  ------------------
  381|  10.3k|              iy = 0;
  382|  78.1k|            else if (iy > height - 1)
  ------------------
  |  Branch (382:22): [True: 36.0k, False: 42.1k]
  ------------------
  383|  36.0k|              iy = height - 1;
  384|  88.5k|            iy = iy * stride;
  385|       |
  386|  88.5k|            sx = sx4 + beta * (k + 4);
  387|       |
  388|  88.5k|            __m256i v_coeff01 = _mm256_inserti128_si256(
  389|  88.5k|                v_zeros,
  390|  88.5k|                _mm_loadu_si128(
  391|  88.5k|                    (__m128i *)av1_warped_filter[(sx) >> WARPEDDIFF_PREC_BITS]),
  392|  88.5k|                0);
  393|  88.5k|            v_coeff01 = _mm256_inserti128_si256(
  394|  88.5k|                v_coeff01,
  395|  88.5k|                _mm_loadu_si128(
  396|  88.5k|                    (__m128i *)av1_warped_filter[(sx + alpha) >>
  397|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  398|  88.5k|                1);  // B7B6..B1B0A7A6..A1A0
  399|  88.5k|            __m256i v_coeff23 = _mm256_inserti128_si256(
  400|  88.5k|                v_zeros,
  401|  88.5k|                _mm_loadu_si128(
  402|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 2 * alpha) >>
  403|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  404|  88.5k|                0);
  405|  88.5k|            v_coeff23 = _mm256_inserti128_si256(
  406|  88.5k|                v_coeff23,
  407|  88.5k|                _mm_loadu_si128(
  408|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 3 * alpha) >>
  409|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  410|  88.5k|                1);  // D7D6..D1D0C7C6..C1C0
  411|  88.5k|            __m256i v_coeff45 = _mm256_inserti128_si256(
  412|  88.5k|                v_zeros,
  413|  88.5k|                _mm_loadu_si128(
  414|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 4 * alpha) >>
  415|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  416|  88.5k|                0);
  417|  88.5k|            v_coeff45 = _mm256_inserti128_si256(
  418|  88.5k|                v_coeff45,
  419|  88.5k|                _mm_loadu_si128(
  420|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 5 * alpha) >>
  421|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  422|  88.5k|                1);  // F7F6..F1F0E7E6..E1E0
  423|  88.5k|            __m256i v_coeff67 = _mm256_inserti128_si256(
  424|  88.5k|                v_zeros,
  425|  88.5k|                _mm_loadu_si128(
  426|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 6 * alpha) >>
  427|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  428|  88.5k|                0);
  429|  88.5k|            v_coeff67 = _mm256_inserti128_si256(
  430|  88.5k|                v_coeff67,
  431|  88.5k|                _mm_loadu_si128(
  432|  88.5k|                    (__m128i *)av1_warped_filter[(sx + 7 * alpha) >>
  433|  88.5k|                                                 WARPEDDIFF_PREC_BITS]),
  434|  88.5k|                1);  // H7H6..H1H0G7G6..G1G0
  435|       |
  436|  88.5k|            __m256i v_c0123 = _mm256_unpacklo_epi32(
  437|  88.5k|                v_coeff01,
  438|  88.5k|                v_coeff23);  // D3D2B3B2D1D0B1B0C3C2A3A2C1C0A1A0
  439|  88.5k|            __m256i v_c0123u = _mm256_unpackhi_epi32(
  440|  88.5k|                v_coeff01,
  441|  88.5k|                v_coeff23);  // D7D6B7B6D5D4B5B4C7C6A7A6C5C4A5A4
  442|  88.5k|            __m256i v_c4567 = _mm256_unpacklo_epi32(
  443|  88.5k|                v_coeff45,
  444|  88.5k|                v_coeff67);  // H3H2F3F2H1H0F1F0G3G2E3E2G1G0E1E0
  445|  88.5k|            __m256i v_c4567u = _mm256_unpackhi_epi32(
  446|  88.5k|                v_coeff45,
  447|  88.5k|                v_coeff67);  // H7H6F7F6H5H4F5F4G7G6E7E6G5G4E5E4
  448|       |
  449|  88.5k|            __m256i v_c01 = _mm256_unpacklo_epi64(
  450|  88.5k|                v_c0123, v_c4567);  // H1H0F1F0D1D0B1B0G1G0E1E0C1C0A1A0
  451|  88.5k|            __m256i v_c23 =
  452|  88.5k|                _mm256_unpackhi_epi64(v_c0123, v_c4567);  // H3H2 ... A3A2
  453|  88.5k|            __m256i v_c45 =
  454|  88.5k|                _mm256_unpacklo_epi64(v_c0123u, v_c4567u);  // H5H4 ... A5A4
  455|  88.5k|            __m256i v_c67 =
  456|  88.5k|                _mm256_unpackhi_epi64(v_c0123u, v_c4567u);  // H7H6 ... A7A6
  457|       |
  458|  88.5k|            __m256i v_refl = _mm256_inserti128_si256(
  459|  88.5k|                _mm256_setzero_si256(),
  460|  88.5k|                _mm_loadu_si128((__m128i *)&ref[iy + ix4 - 7]), 0);
  461|  88.5k|            v_refl = _mm256_inserti128_si256(
  462|  88.5k|                v_refl, _mm_loadu_si128((__m128i *)&ref[iy + ix4 + 1]),
  463|  88.5k|                1);  // R15 .. R0
  464|       |
  465|  88.5k|            __m256i v_ref = _mm256_permute4x64_epi64(v_refl, 0xEE);
  466|       |
  467|  88.5k|            __m256i v_refu =
  468|  88.5k|                _mm256_alignr_epi8(v_ref, v_refl, 2);  // R8R15R14...R2R1
  469|       |
  470|  88.5k|            v_refl = _mm256_inserti128_si256(
  471|  88.5k|                v_refl, _mm256_extracti128_si256(v_refu, 0), 1);
  472|  88.5k|            v_refu = _mm256_inserti128_si256(
  473|  88.5k|                v_refu, _mm256_extracti128_si256(v_ref, 0), 0);
  474|       |
  475|  88.5k|            __m256i v_sum = _mm256_set1_epi32(ohoriz);
  476|  88.5k|            __m256i parsum =
  477|  88.5k|                _mm256_madd_epi16(v_c01, _mm256_alignr_epi8(v_refu, v_refl, 0));
  478|  88.5k|            __m256i v_sum1 = _mm256_add_epi32(v_sum, parsum);
  479|       |
  480|  88.5k|            parsum =
  481|  88.5k|                _mm256_madd_epi16(v_c23, _mm256_alignr_epi8(v_refu, v_refl, 4));
  482|  88.5k|            __m256i v_sum2 = _mm256_add_epi32(v_sum1, parsum);
  483|  88.5k|            parsum =
  484|  88.5k|                _mm256_madd_epi16(v_c45, _mm256_alignr_epi8(v_refu, v_refl, 8));
  485|  88.5k|            __m256i v_sum3 = _mm256_add_epi32(v_sum2, parsum);
  486|  88.5k|            parsum = _mm256_madd_epi16(v_c67,
  487|  88.5k|                                       _mm256_alignr_epi8(v_refu, v_refl, 12));
  488|  88.5k|            __m256i v_sum4 = _mm256_add_epi32(v_sum3, parsum);
  489|       |
  490|  88.5k|            tmp[k + 7] = _mm256_srai_epi32(_mm256_add_epi32(v_sum4, v_rbhoriz),
  491|  88.5k|                                           reduce_bits_horiz);
  492|  88.5k|          }
  493|  5.91k|        }
  494|  17.8k|      }
  495|       |
  496|       |      // Vertical filter
  497|   338k|      for (int k = -4; k < AOMMIN(4, p_height - i - 4); ++k) {
  ------------------
  |  |   34|   338k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 62.3k, False: 275k]
  |  |  ------------------
  ------------------
  |  Branch (497:24): [True: 300k, False: 37.5k]
  ------------------
  498|   300k|        int sy = sy4 + delta * (k + 4);
  499|   300k|        const __m256i *src = tmp + (k + 4);
  500|       |
  501|   300k|        __m256i v_coeff01 = _mm256_inserti128_si256(
  502|   300k|            v_zeros,
  503|   300k|            _mm_loadu_si128(
  504|   300k|                (__m128i *)av1_warped_filter[(sy) >> WARPEDDIFF_PREC_BITS]),
  505|   300k|            0);
  506|   300k|        v_coeff01 = _mm256_inserti128_si256(
  507|   300k|            v_coeff01,
  508|   300k|            _mm_loadu_si128(
  509|   300k|                (__m128i *)
  510|   300k|                    av1_warped_filter[(sy + gamma) >> WARPEDDIFF_PREC_BITS]),
  511|   300k|            1);
  512|   300k|        __m256i v_coeff23 = _mm256_inserti128_si256(
  513|   300k|            v_zeros,
  514|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 2 * gamma) >>
  515|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  516|   300k|            0);
  517|   300k|        v_coeff23 = _mm256_inserti128_si256(
  518|   300k|            v_coeff23,
  519|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 3 * gamma) >>
  520|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  521|   300k|            1);
  522|   300k|        __m256i v_coeff45 = _mm256_inserti128_si256(
  523|   300k|            v_zeros,
  524|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 4 * gamma) >>
  525|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  526|   300k|            0);
  527|   300k|        v_coeff45 = _mm256_inserti128_si256(
  528|   300k|            v_coeff45,
  529|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 5 * gamma) >>
  530|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  531|   300k|            1);
  532|   300k|        __m256i v_coeff67 = _mm256_inserti128_si256(
  533|   300k|            v_zeros,
  534|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 6 * gamma) >>
  535|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  536|   300k|            0);
  537|   300k|        v_coeff67 = _mm256_inserti128_si256(
  538|   300k|            v_coeff67,
  539|   300k|            _mm_loadu_si128((__m128i *)av1_warped_filter[(sy + 7 * gamma) >>
  540|   300k|                                                         WARPEDDIFF_PREC_BITS]),
  541|   300k|            1);
  542|       |
  543|   300k|        __m256i v_c0123 = _mm256_unpacklo_epi32(
  544|   300k|            v_coeff01,
  545|   300k|            v_coeff23);  // D3D2B3B2D1D0B1B0C3C2A3A2C1C0A1A0
  546|   300k|        __m256i v_c0123u = _mm256_unpackhi_epi32(
  547|   300k|            v_coeff01,
  548|   300k|            v_coeff23);  // D7D6B7B6D5D4B5B4C7C6A7A6C5C4A5A4
  549|   300k|        __m256i v_c4567 = _mm256_unpacklo_epi32(
  550|   300k|            v_coeff45,
  551|   300k|            v_coeff67);  // H3H2F3F2H1H0F1F0G3G2E3E2G1G0E1E0
  552|   300k|        __m256i v_c4567u = _mm256_unpackhi_epi32(
  553|   300k|            v_coeff45,
  554|   300k|            v_coeff67);  // H7H6F7F6H5H4F5F4G7G6E7E6G5G4E5E4
  555|       |
  556|   300k|        __m256i v_c01 = _mm256_unpacklo_epi64(
  557|   300k|            v_c0123, v_c4567);  // H1H0F1F0D1D0B1B0G1G0E1E0C1C0A1A0
  558|   300k|        __m256i v_c23 =
  559|   300k|            _mm256_unpackhi_epi64(v_c0123, v_c4567);  // H3H2 ... A3A2
  560|   300k|        __m256i v_c45 =
  561|   300k|            _mm256_unpacklo_epi64(v_c0123u, v_c4567u);  // H5H4 ... A5A4
  562|   300k|        __m256i v_c67 =
  563|   300k|            _mm256_unpackhi_epi64(v_c0123u, v_c4567u);  // H7H6 ... A7A6
  564|       |
  565|   300k|        __m256i v_src01l =
  566|   300k|            _mm256_unpacklo_epi32(src[0], src[1]);  // T13T03T11T01T12T02T10T00
  567|   300k|        __m256i v_src01u =
  568|   300k|            _mm256_unpackhi_epi32(src[0], src[1]);  // T17T07T15T05T16T06T14T04
  569|   300k|        __m256i v_sum =
  570|   300k|            _mm256_madd_epi16(_mm256_packus_epi32(v_src01l, v_src01u),
  571|   300k|                              v_c01);  // S7S5S3S1S6S4S2S0
  572|       |
  573|   300k|        __m256i v_src23l = _mm256_unpacklo_epi32(src[2], src[3]);
  574|   300k|        __m256i v_src23u = _mm256_unpackhi_epi32(src[2], src[3]);
  575|   300k|        v_sum = _mm256_add_epi32(
  576|   300k|            v_sum,
  577|   300k|            _mm256_madd_epi16(_mm256_packus_epi32(v_src23l, v_src23u), v_c23));
  578|       |
  579|   300k|        __m256i v_src45l = _mm256_unpacklo_epi32(src[4], src[5]);
  580|   300k|        __m256i v_src45u = _mm256_unpackhi_epi32(src[4], src[5]);
  581|   300k|        v_sum = _mm256_add_epi32(
  582|   300k|            v_sum,
  583|   300k|            _mm256_madd_epi16(_mm256_packus_epi32(v_src45l, v_src45u), v_c45));
  584|       |
  585|   300k|        __m256i v_src67l = _mm256_unpacklo_epi32(src[6], src[7]);
  586|   300k|        __m256i v_src67u = _mm256_unpackhi_epi32(src[6], src[7]);
  587|   300k|        v_sum = _mm256_add_epi32(
  588|   300k|            v_sum,
  589|   300k|            _mm256_madd_epi16(_mm256_packus_epi32(v_src67l, v_src67u), v_c67));
  590|       |
  591|       |        // unpack S7S5S3S1S6S4S2S0 to S7S6S5S4S3S2S1S0
  592|       |
  593|   300k|        __m256i v_suml =
  594|   300k|            _mm256_permute4x64_epi64(v_sum, 0xD8);  // S7S5S6S4S3S1S2S0
  595|   300k|        __m256i v_sumh =
  596|   300k|            _mm256_permute4x64_epi64(v_sum, 0x32);      // S2S0S7S5S2S0S3S1
  597|   300k|        v_sum = _mm256_unpacklo_epi32(v_suml, v_sumh);  // S7S6S5S4S3S2S1S0
  598|       |
  599|   300k|        if (conv_params->is_compound) {
  ------------------
  |  Branch (599:13): [True: 0, False: 300k]
  ------------------
  600|      0|          __m128i *const p =
  601|      0|              (__m128i *)&conv_params
  602|      0|                  ->dst[(i + k + 4) * conv_params->dst_stride + j];
  603|       |
  604|      0|          v_sum = _mm256_add_epi32(v_sum, res_add_const);
  605|      0|          v_sum =
  606|      0|              _mm256_sra_epi32(_mm256_add_epi32(v_sum, reduce_bits_vert_const),
  607|      0|                               reduce_bits_vert_shift);
  608|      0|          if (conv_params->do_average) {
  ------------------
  |  Branch (608:15): [True: 0, False: 0]
  ------------------
  609|      0|            __m128i *const dst16 = (__m128i *)&pred[(i + k + 4) * p_stride + j];
  610|      0|            __m256i p_32 = _mm256_cvtepu16_epi32(_mm_loadu_si128(p));
  611|       |
  612|      0|            if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (612:17): [True: 0, False: 0]
  ------------------
  613|      0|              v_sum = _mm256_add_epi32(_mm256_mullo_epi32(p_32, wt0),
  614|      0|                                       _mm256_mullo_epi32(v_sum, wt1));
  615|      0|              v_sum = _mm256_srai_epi32(v_sum, DIST_PRECISION_BITS);
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  616|      0|            } else {
  617|      0|              v_sum = _mm256_srai_epi32(_mm256_add_epi32(p_32, v_sum), 1);
  618|      0|            }
  619|       |
  620|      0|            __m256i v_sum1 = _mm256_add_epi32(v_sum, res_sub_const);
  621|      0|            v_sum1 = _mm256_sra_epi32(
  622|      0|                _mm256_add_epi32(v_sum1, round_bits_const), round_bits_shift);
  623|       |
  624|      0|            __m256i v_sum16 = _mm256_packus_epi32(v_sum1, v_sum1);
  625|      0|            v_sum16 = _mm256_permute4x64_epi64(v_sum16, 0xD8);
  626|      0|            v_sum16 = _mm256_min_epi16(v_sum16, clip_pixel);
  627|      0|            _mm_storeu_si128(dst16, _mm256_extracti128_si256(v_sum16, 0));
  628|      0|          } else {
  629|      0|            v_sum = _mm256_packus_epi32(v_sum, v_sum);
  630|      0|            __m256i v_sum16 = _mm256_permute4x64_epi64(v_sum, 0xD8);
  631|      0|            _mm_storeu_si128(p, _mm256_extracti128_si256(v_sum16, 0));
  632|      0|          }
  633|   300k|        } else {
  634|       |          // Round and pack into 8 bits
  635|   300k|          const __m256i round_const =
  636|   300k|              _mm256_set1_epi32(-(1 << (bd + reduce_bits_vert - 1)) +
  637|   300k|                                ((1 << reduce_bits_vert) >> 1));
  638|       |
  639|   300k|          __m256i v_sum1 = _mm256_srai_epi32(
  640|   300k|              _mm256_add_epi32(v_sum, round_const), reduce_bits_vert);
  641|       |
  642|   300k|          v_sum1 = _mm256_packus_epi32(v_sum1, v_sum1);
  643|   300k|          __m256i v_sum16 = _mm256_permute4x64_epi64(v_sum1, 0xD8);
  644|       |          // Clamp res_16bit to the range [0, 2^bd - 1]
  645|   300k|          const __m256i max_val = _mm256_set1_epi16((1 << bd) - 1);
  646|   300k|          const __m256i zero = _mm256_setzero_si256();
  647|   300k|          v_sum16 = _mm256_max_epi16(_mm256_min_epi16(v_sum16, max_val), zero);
  648|       |
  649|   300k|          __m128i *const p = (__m128i *)&pred[(i + k + 4) * p_stride + j];
  650|       |
  651|       |          _mm_storeu_si128(p, _mm256_extracti128_si256(v_sum16, 0));
  652|   300k|        }
  653|   300k|      }
  654|  37.5k|    }
  655|  31.3k|  }
  656|  28.4k|}

av1_highbd_wiener_convolve_add_src_avx2:
   32|  2.76k|    const WienerConvolveParams *conv_params, int bd) {
   33|  2.76k|  assert(x_step_q4 == 16 && y_step_q4 == 16);
   34|  2.76k|  assert(!(w & 7));
   35|  2.76k|  assert(bd + FILTER_BITS - conv_params->round_0 + 2 <= 16);
   36|  2.76k|  (void)x_step_q4;
   37|  2.76k|  (void)y_step_q4;
   38|       |
   39|  2.76k|  const uint16_t *const src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  2.76k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   40|  2.76k|  uint16_t *const dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  2.76k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   41|       |
   42|  2.76k|  DECLARE_ALIGNED(32, uint16_t,
  ------------------
  |  |   19|  2.76k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   43|  2.76k|                  temp[(MAX_SB_SIZE + SUBPEL_TAPS - 1) * MAX_SB_SIZE]);
   44|  2.76k|  int intermediate_height = h + SUBPEL_TAPS - 1;
  ------------------
  |  |   26|  2.76k|#define SUBPEL_TAPS 8
  ------------------
   45|  2.76k|  const int center_tap = ((SUBPEL_TAPS - 1) / 2);
  ------------------
  |  |   26|  2.76k|#define SUBPEL_TAPS 8
  ------------------
   46|  2.76k|  const uint16_t *const src_ptr = src - center_tap * src_stride - center_tap;
   47|       |
   48|  2.76k|  const __m128i zero_128 = _mm_setzero_si128();
   49|  2.76k|  const __m256i zero_256 = _mm256_setzero_si256();
   50|       |
   51|       |  // Add an offset to account for the "add_src" part of the convolve function.
   52|  2.76k|  const __m128i offset = _mm_insert_epi16(zero_128, 1 << FILTER_BITS, 3);
   53|       |
   54|  2.76k|  const __m256i clamp_low = zero_256;
   55|       |
   56|       |  /* Horizontal filter */
   57|  2.76k|  {
   58|  2.76k|    const __m256i clamp_high_ep =
   59|  2.76k|        _mm256_set1_epi16(WIENER_CLAMP_LIMIT(conv_params->round_0, bd) - 1);
  ------------------
  |  |   43|  2.76k|#define WIENER_CLAMP_LIMIT(r0, bd) (1 << ((bd) + 1 + FILTER_BITS - r0))
  |  |  ------------------
  |  |  |  |   21|  2.76k|#define FILTER_BITS 7
  |  |  ------------------
  ------------------
   60|       |
   61|       |    // coeffs [ f7 f6 f5 f4 f3 f2 f1 f0 ]
   62|  2.76k|    const __m128i coeffs_x = _mm_add_epi16(xx_loadu_128(filter_x), offset);
   63|       |
   64|       |    // coeffs [ f3 f2 f3 f2 f1 f0 f1 f0 ]
   65|  2.76k|    const __m128i coeffs_0123 = _mm_unpacklo_epi32(coeffs_x, coeffs_x);
   66|       |    // coeffs [ f7 f6 f7 f6 f5 f4 f5 f4 ]
   67|  2.76k|    const __m128i coeffs_4567 = _mm_unpackhi_epi32(coeffs_x, coeffs_x);
   68|       |
   69|       |    // coeffs [ f1 f0 f1 f0 f1 f0 f1 f0 ]
   70|  2.76k|    const __m128i coeffs_01_128 = _mm_unpacklo_epi64(coeffs_0123, coeffs_0123);
   71|       |    // coeffs [ f3 f2 f3 f2 f3 f2 f3 f2 ]
   72|  2.76k|    const __m128i coeffs_23_128 = _mm_unpackhi_epi64(coeffs_0123, coeffs_0123);
   73|       |    // coeffs [ f5 f4 f5 f4 f5 f4 f5 f4 ]
   74|  2.76k|    const __m128i coeffs_45_128 = _mm_unpacklo_epi64(coeffs_4567, coeffs_4567);
   75|       |    // coeffs [ f7 f6 f7 f6 f7 f6 f7 f6 ]
   76|  2.76k|    const __m128i coeffs_67_128 = _mm_unpackhi_epi64(coeffs_4567, coeffs_4567);
   77|       |
   78|       |    // coeffs [ f1 f0 f1 f0 f1 f0 f1 f0 ][ f1 f0 f1 f0 f1 f0 f1 f0 ]
   79|  2.76k|    const __m256i coeffs_01 = yy_set_m128i(coeffs_01_128, coeffs_01_128);
   80|       |    // coeffs [ f3 f2 f3 f2 f3 f2 f3 f2 ][ f3 f2 f3 f2 f3 f2 f3 f2 ]
   81|  2.76k|    const __m256i coeffs_23 = yy_set_m128i(coeffs_23_128, coeffs_23_128);
   82|       |    // coeffs [ f5 f4 f5 f4 f5 f4 f5 f4 ][ f5 f4 f5 f4 f5 f4 f5 f4 ]
   83|  2.76k|    const __m256i coeffs_45 = yy_set_m128i(coeffs_45_128, coeffs_45_128);
   84|       |    // coeffs [ f7 f6 f7 f6 f7 f6 f7 f6 ][ f7 f6 f7 f6 f7 f6 f7 f6 ]
   85|  2.76k|    const __m256i coeffs_67 = yy_set_m128i(coeffs_67_128, coeffs_67_128);
   86|       |
   87|  2.76k|    const __m256i round_const = _mm256_set1_epi32(
   88|  2.76k|        (1 << (conv_params->round_0 - 1)) + (1 << (bd + FILTER_BITS - 1)));
  ------------------
  |  |   21|  2.76k|#define FILTER_BITS 7
  ------------------
   89|       |
   90|  86.6k|    for (int i = 0; i < intermediate_height; ++i) {
  ------------------
  |  Branch (90:21): [True: 83.9k, False: 2.76k]
  ------------------
   91|   205k|      for (int j = 0; j < w; j += 16) {
  ------------------
  |  Branch (91:23): [True: 121k, False: 83.9k]
  ------------------
   92|   121k|        const uint16_t *src_ij = src_ptr + i * src_stride + j;
   93|       |
   94|       |        // Load 16-bit src data
   95|   121k|        const __m256i src_0 = yy_loadu_256(src_ij + 0);
   96|   121k|        const __m256i src_1 = yy_loadu_256(src_ij + 1);
   97|   121k|        const __m256i src_2 = yy_loadu_256(src_ij + 2);
   98|   121k|        const __m256i src_3 = yy_loadu_256(src_ij + 3);
   99|   121k|        const __m256i src_4 = yy_loadu_256(src_ij + 4);
  100|   121k|        const __m256i src_5 = yy_loadu_256(src_ij + 5);
  101|   121k|        const __m256i src_6 = yy_loadu_256(src_ij + 6);
  102|   121k|        const __m256i src_7 = yy_loadu_256(src_ij + 7);
  103|       |
  104|       |        // Multiply src data by filter coeffs and sum pairs
  105|   121k|        const __m256i res_0 = _mm256_madd_epi16(src_0, coeffs_01);
  106|   121k|        const __m256i res_1 = _mm256_madd_epi16(src_1, coeffs_01);
  107|   121k|        const __m256i res_2 = _mm256_madd_epi16(src_2, coeffs_23);
  108|   121k|        const __m256i res_3 = _mm256_madd_epi16(src_3, coeffs_23);
  109|   121k|        const __m256i res_4 = _mm256_madd_epi16(src_4, coeffs_45);
  110|   121k|        const __m256i res_5 = _mm256_madd_epi16(src_5, coeffs_45);
  111|   121k|        const __m256i res_6 = _mm256_madd_epi16(src_6, coeffs_67);
  112|   121k|        const __m256i res_7 = _mm256_madd_epi16(src_7, coeffs_67);
  113|       |
  114|       |        // Calculate scalar product for even- and odd-indices separately,
  115|       |        // increasing to 32-bit precision
  116|   121k|        const __m256i res_even_sum = _mm256_add_epi32(
  117|   121k|            _mm256_add_epi32(res_0, res_4), _mm256_add_epi32(res_2, res_6));
  118|   121k|        const __m256i res_even = _mm256_srai_epi32(
  119|   121k|            _mm256_add_epi32(res_even_sum, round_const), conv_params->round_0);
  120|       |
  121|   121k|        const __m256i res_odd_sum = _mm256_add_epi32(
  122|   121k|            _mm256_add_epi32(res_1, res_5), _mm256_add_epi32(res_3, res_7));
  123|   121k|        const __m256i res_odd = _mm256_srai_epi32(
  124|   121k|            _mm256_add_epi32(res_odd_sum, round_const), conv_params->round_0);
  125|       |
  126|       |        // Reduce to 16-bit precision and pack even- and odd-index results
  127|       |        // back into one register. The _mm256_packs_epi32 intrinsic returns
  128|       |        // a register with the pixels ordered as follows:
  129|       |        // [ 15 13 11 9 14 12 10 8 ] [ 7 5 3 1 6 4 2 0 ]
  130|   121k|        const __m256i res = _mm256_packs_epi32(res_even, res_odd);
  131|   121k|        const __m256i res_clamped =
  132|   121k|            _mm256_min_epi16(_mm256_max_epi16(res, clamp_low), clamp_high_ep);
  133|       |
  134|       |        // Store in a temporary array
  135|   121k|        yy_storeu_256(temp + i * MAX_SB_SIZE + j, res_clamped);
  ------------------
  |  |   32|   121k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   121k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  136|   121k|      }
  137|  83.9k|    }
  138|  2.76k|  }
  139|       |
  140|       |  /* Vertical filter */
  141|  2.76k|  {
  142|  2.76k|    const __m256i clamp_high = _mm256_set1_epi16((1 << bd) - 1);
  143|       |
  144|       |    // coeffs [ f7 f6 f5 f4 f3 f2 f1 f0 ]
  145|  2.76k|    const __m128i coeffs_y = _mm_add_epi16(xx_loadu_128(filter_y), offset);
  146|       |
  147|       |    // coeffs [ f3 f2 f3 f2 f1 f0 f1 f0 ]
  148|  2.76k|    const __m128i coeffs_0123 = _mm_unpacklo_epi32(coeffs_y, coeffs_y);
  149|       |    // coeffs [ f7 f6 f7 f6 f5 f4 f5 f4 ]
  150|  2.76k|    const __m128i coeffs_4567 = _mm_unpackhi_epi32(coeffs_y, coeffs_y);
  151|       |
  152|       |    // coeffs [ f1 f0 f1 f0 f1 f0 f1 f0 ]
  153|  2.76k|    const __m128i coeffs_01_128 = _mm_unpacklo_epi64(coeffs_0123, coeffs_0123);
  154|       |    // coeffs [ f3 f2 f3 f2 f3 f2 f3 f2 ]
  155|  2.76k|    const __m128i coeffs_23_128 = _mm_unpackhi_epi64(coeffs_0123, coeffs_0123);
  156|       |    // coeffs [ f5 f4 f5 f4 f5 f4 f5 f4 ]
  157|  2.76k|    const __m128i coeffs_45_128 = _mm_unpacklo_epi64(coeffs_4567, coeffs_4567);
  158|       |    // coeffs [ f7 f6 f7 f6 f7 f6 f7 f6 ]
  159|  2.76k|    const __m128i coeffs_67_128 = _mm_unpackhi_epi64(coeffs_4567, coeffs_4567);
  160|       |
  161|       |    // coeffs [ f1 f0 f1 f0 f1 f0 f1 f0 ][ f1 f0 f1 f0 f1 f0 f1 f0 ]
  162|  2.76k|    const __m256i coeffs_01 = yy_set_m128i(coeffs_01_128, coeffs_01_128);
  163|       |    // coeffs [ f3 f2 f3 f2 f3 f2 f3 f2 ][ f3 f2 f3 f2 f3 f2 f3 f2 ]
  164|  2.76k|    const __m256i coeffs_23 = yy_set_m128i(coeffs_23_128, coeffs_23_128);
  165|       |    // coeffs [ f5 f4 f5 f4 f5 f4 f5 f4 ][ f5 f4 f5 f4 f5 f4 f5 f4 ]
  166|  2.76k|    const __m256i coeffs_45 = yy_set_m128i(coeffs_45_128, coeffs_45_128);
  167|       |    // coeffs [ f7 f6 f7 f6 f7 f6 f7 f6 ][ f7 f6 f7 f6 f7 f6 f7 f6 ]
  168|  2.76k|    const __m256i coeffs_67 = yy_set_m128i(coeffs_67_128, coeffs_67_128);
  169|       |
  170|  2.76k|    const __m256i round_const =
  171|  2.76k|        _mm256_set1_epi32((1 << (conv_params->round_1 - 1)) -
  172|  2.76k|                          (1 << (bd + conv_params->round_1 - 1)));
  173|       |
  174|  67.3k|    for (int i = 0; i < h; ++i) {
  ------------------
  |  Branch (174:21): [True: 64.5k, False: 2.76k]
  ------------------
  175|   151k|      for (int j = 0; j < w; j += 16) {
  ------------------
  |  Branch (175:23): [True: 86.7k, False: 64.5k]
  ------------------
  176|  86.7k|        const uint16_t *temp_ij = temp + i * MAX_SB_SIZE + j;
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  177|       |
  178|       |        // Load 16-bit data from the output of the horizontal filter in
  179|       |        // which the pixels are ordered as follows:
  180|       |        // [ 15 13 11 9 14 12 10 8 ] [ 7 5 3 1 6 4 2 0 ]
  181|  86.7k|        const __m256i data_0 = yy_loadu_256(temp_ij + 0 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  182|  86.7k|        const __m256i data_1 = yy_loadu_256(temp_ij + 1 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  183|  86.7k|        const __m256i data_2 = yy_loadu_256(temp_ij + 2 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  184|  86.7k|        const __m256i data_3 = yy_loadu_256(temp_ij + 3 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  185|  86.7k|        const __m256i data_4 = yy_loadu_256(temp_ij + 4 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  186|  86.7k|        const __m256i data_5 = yy_loadu_256(temp_ij + 5 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  187|  86.7k|        const __m256i data_6 = yy_loadu_256(temp_ij + 6 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  188|  86.7k|        const __m256i data_7 = yy_loadu_256(temp_ij + 7 * MAX_SB_SIZE);
  ------------------
  |  |   32|  86.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  86.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  189|       |
  190|       |        // Filter the even-indices, increasing to 32-bit precision
  191|  86.7k|        const __m256i src_0 = _mm256_unpacklo_epi16(data_0, data_1);
  192|  86.7k|        const __m256i src_2 = _mm256_unpacklo_epi16(data_2, data_3);
  193|  86.7k|        const __m256i src_4 = _mm256_unpacklo_epi16(data_4, data_5);
  194|  86.7k|        const __m256i src_6 = _mm256_unpacklo_epi16(data_6, data_7);
  195|       |
  196|  86.7k|        const __m256i res_0 = _mm256_madd_epi16(src_0, coeffs_01);
  197|  86.7k|        const __m256i res_2 = _mm256_madd_epi16(src_2, coeffs_23);
  198|  86.7k|        const __m256i res_4 = _mm256_madd_epi16(src_4, coeffs_45);
  199|  86.7k|        const __m256i res_6 = _mm256_madd_epi16(src_6, coeffs_67);
  200|       |
  201|  86.7k|        const __m256i res_even = _mm256_add_epi32(
  202|  86.7k|            _mm256_add_epi32(res_0, res_2), _mm256_add_epi32(res_4, res_6));
  203|       |
  204|       |        // Filter the odd-indices, increasing to 32-bit precision
  205|  86.7k|        const __m256i src_1 = _mm256_unpackhi_epi16(data_0, data_1);
  206|  86.7k|        const __m256i src_3 = _mm256_unpackhi_epi16(data_2, data_3);
  207|  86.7k|        const __m256i src_5 = _mm256_unpackhi_epi16(data_4, data_5);
  208|  86.7k|        const __m256i src_7 = _mm256_unpackhi_epi16(data_6, data_7);
  209|       |
  210|  86.7k|        const __m256i res_1 = _mm256_madd_epi16(src_1, coeffs_01);
  211|  86.7k|        const __m256i res_3 = _mm256_madd_epi16(src_3, coeffs_23);
  212|  86.7k|        const __m256i res_5 = _mm256_madd_epi16(src_5, coeffs_45);
  213|  86.7k|        const __m256i res_7 = _mm256_madd_epi16(src_7, coeffs_67);
  214|       |
  215|  86.7k|        const __m256i res_odd = _mm256_add_epi32(
  216|  86.7k|            _mm256_add_epi32(res_1, res_3), _mm256_add_epi32(res_5, res_7));
  217|       |
  218|       |        // Pixels are currently in the following order:
  219|       |        // res_even order: [ 14 12 10 8 ] [ 6 4 2 0 ]
  220|       |        // res_odd order:  [ 15 13 11 9 ] [ 7 5 3 1 ]
  221|       |        //
  222|       |        // Rearrange the pixels into the following order:
  223|       |        // res_lo order: [ 11 10  9  8 ] [ 3 2 1 0 ]
  224|       |        // res_hi order: [ 15 14 13 12 ] [ 7 6 5 4 ]
  225|  86.7k|        const __m256i res_lo = _mm256_unpacklo_epi32(res_even, res_odd);
  226|  86.7k|        const __m256i res_hi = _mm256_unpackhi_epi32(res_even, res_odd);
  227|       |
  228|  86.7k|        const __m256i res_lo_round = _mm256_srai_epi32(
  229|  86.7k|            _mm256_add_epi32(res_lo, round_const), conv_params->round_1);
  230|  86.7k|        const __m256i res_hi_round = _mm256_srai_epi32(
  231|  86.7k|            _mm256_add_epi32(res_hi, round_const), conv_params->round_1);
  232|       |
  233|       |        // Reduce to 16-bit precision and pack into the correct order:
  234|       |        // [ 15 14 13 12 11 10 9 8 ][ 7 6 5 4 3 2 1 0 ]
  235|  86.7k|        const __m256i res_16bit =
  236|  86.7k|            _mm256_packs_epi32(res_lo_round, res_hi_round);
  237|  86.7k|        const __m256i res_16bit_clamped = _mm256_min_epi16(
  238|  86.7k|            _mm256_max_epi16(res_16bit, clamp_low), clamp_high);
  239|       |
  240|       |        // Store in the dst array
  241|  86.7k|        yy_storeu_256(dst + i * dst_stride + j, res_16bit_clamped);
  242|  86.7k|      }
  243|  64.5k|    }
  244|  2.76k|  }
  245|  2.76k|}

av1_filter_intra_edge_sse4_1:
   18|  13.4M|void av1_filter_intra_edge_sse4_1(uint8_t *p, int sz, int strength) {
   19|  13.4M|  if (!strength) return;
  ------------------
  |  Branch (19:7): [True: 8.51M, False: 4.88M]
  ------------------
   20|       |
   21|  4.88M|  DECLARE_ALIGNED(16, static const int8_t, kern[3][16]) = {
  ------------------
  |  |   19|  4.88M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   22|  4.88M|    { 4, 8, 4, 0, 4, 8, 4, 0, 4, 8, 4, 0, 4, 8, 4, 0 },  // strength 1: 4,8,4
   23|  4.88M|    { 5, 6, 5, 0, 5, 6, 5, 0, 5, 6, 5, 0, 5, 6, 5, 0 },  // strength 2: 5,6,5
   24|  4.88M|    { 2, 4, 4, 4, 2, 0, 0, 0, 2, 4, 4, 4, 2, 0, 0, 0 }  // strength 3: 2,4,4,4,2
   25|  4.88M|  };
   26|       |
   27|  4.88M|  DECLARE_ALIGNED(16, static const int8_t, v_const[5][16]) = {
  ------------------
  |  |   19|  4.88M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   28|  4.88M|    { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 },
   29|  4.88M|    { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 },
   30|  4.88M|    { 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8 },
   31|  4.88M|    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
   32|  4.88M|  };
   33|       |
   34|       |  // Extend the first and last samples to simplify the loop for the 5-tap case
   35|  4.88M|  p[-1] = p[0];
   36|  4.88M|  __m128i last = _mm_set1_epi8((char)p[sz - 1]);
   37|  4.88M|  _mm_storeu_si128((__m128i *)&p[sz], last);
   38|       |
   39|       |  // Adjust input pointer for filter support area
   40|  4.88M|  uint8_t *in = (strength == 3) ? p - 1 : p;
  ------------------
  |  Branch (40:17): [True: 185k, False: 4.70M]
  ------------------
   41|       |
   42|       |  // Avoid modifying first sample
   43|  4.88M|  uint8_t *out = p + 1;
   44|  4.88M|  int len = sz - 1;
   45|       |
   46|  4.88M|  const int use_3tap_filter = (strength < 3);
   47|       |
   48|  4.88M|  if (use_3tap_filter) {
  ------------------
  |  Branch (48:7): [True: 4.73M, False: 151k]
  ------------------
   49|  4.73M|    __m128i coef0 = _mm_lddqu_si128((__m128i const *)kern[strength - 1]);
   50|  4.73M|    __m128i shuf0 = _mm_lddqu_si128((__m128i const *)v_const[0]);
   51|  4.73M|    __m128i shuf1 = _mm_lddqu_si128((__m128i const *)v_const[1]);
   52|  4.73M|    __m128i iden = _mm_lddqu_si128((__m128i *)v_const[3]);
   53|  4.73M|    __m128i in0 = _mm_lddqu_si128((__m128i *)in);
   54|  10.1M|    while (len > 0) {
  ------------------
  |  Branch (54:12): [True: 5.44M, False: 4.73M]
  ------------------
   55|  5.44M|      int n_out = (len < 8) ? len : 8;
  ------------------
  |  Branch (55:19): [True: 1.31M, False: 4.12M]
  ------------------
   56|  5.44M|      __m128i d0 = _mm_shuffle_epi8(in0, shuf0);
   57|  5.44M|      __m128i d1 = _mm_shuffle_epi8(in0, shuf1);
   58|  5.44M|      d0 = _mm_maddubs_epi16(d0, coef0);
   59|  5.44M|      d1 = _mm_maddubs_epi16(d1, coef0);
   60|  5.44M|      d0 = _mm_hadd_epi16(d0, d1);
   61|  5.44M|      __m128i eight = _mm_set1_epi16(8);
   62|  5.44M|      d0 = _mm_add_epi16(d0, eight);
   63|  5.44M|      d0 = _mm_srai_epi16(d0, 4);
   64|  5.44M|      d0 = _mm_packus_epi16(d0, d0);
   65|  5.44M|      __m128i out0 = _mm_lddqu_si128((__m128i *)out);
   66|  5.44M|      __m128i n0 = _mm_set1_epi8(n_out);
   67|  5.44M|      __m128i mask = _mm_cmpgt_epi8(n0, iden);
   68|  5.44M|      out0 = _mm_blendv_epi8(out0, d0, mask);
   69|  5.44M|      _mm_storel_epi64((__m128i *)out, out0);
   70|  5.44M|      __m128i in1 = _mm_lddqu_si128((__m128i *)(in + 16));
   71|  5.44M|      in0 = _mm_alignr_epi8(in1, in0, 8);
   72|  5.44M|      in += 8;
   73|  5.44M|      out += 8;
   74|  5.44M|      len -= n_out;
   75|  5.44M|    }
   76|  4.73M|  } else {  // 5-tap filter
   77|   151k|    __m128i coef0 = _mm_lddqu_si128((__m128i const *)kern[strength - 1]);
   78|   151k|    __m128i two = _mm_set1_epi8(2);
   79|   151k|    __m128i shuf_a = _mm_lddqu_si128((__m128i const *)v_const[2]);
   80|   151k|    __m128i shuf_b = _mm_add_epi8(shuf_a, two);
   81|   151k|    __m128i shuf_c = _mm_add_epi8(shuf_b, two);
   82|   151k|    __m128i shuf_d = _mm_add_epi8(shuf_c, two);
   83|   151k|    __m128i iden = _mm_lddqu_si128((__m128i *)v_const[3]);
   84|   151k|    __m128i in0 = _mm_lddqu_si128((__m128i *)in);
   85|   473k|    while (len > 0) {
  ------------------
  |  Branch (85:12): [True: 321k, False: 151k]
  ------------------
   86|   321k|      int n_out = (len < 8) ? len : 8;
  ------------------
  |  Branch (86:19): [True: 220, False: 321k]
  ------------------
   87|   321k|      __m128i d0 = _mm_shuffle_epi8(in0, shuf_a);
   88|   321k|      __m128i d1 = _mm_shuffle_epi8(in0, shuf_b);
   89|   321k|      __m128i d2 = _mm_shuffle_epi8(in0, shuf_c);
   90|   321k|      __m128i d3 = _mm_shuffle_epi8(in0, shuf_d);
   91|   321k|      d0 = _mm_maddubs_epi16(d0, coef0);
   92|   321k|      d1 = _mm_maddubs_epi16(d1, coef0);
   93|   321k|      d2 = _mm_maddubs_epi16(d2, coef0);
   94|   321k|      d3 = _mm_maddubs_epi16(d3, coef0);
   95|   321k|      d0 = _mm_hadd_epi16(d0, d1);
   96|   321k|      d2 = _mm_hadd_epi16(d2, d3);
   97|   321k|      d0 = _mm_hadd_epi16(d0, d2);
   98|   321k|      __m128i eight = _mm_set1_epi16(8);
   99|   321k|      d0 = _mm_add_epi16(d0, eight);
  100|   321k|      d0 = _mm_srai_epi16(d0, 4);
  101|   321k|      d0 = _mm_packus_epi16(d0, d0);
  102|   321k|      __m128i out0 = _mm_lddqu_si128((__m128i *)out);
  103|   321k|      __m128i n0 = _mm_set1_epi8(n_out);
  104|   321k|      __m128i mask = _mm_cmpgt_epi8(n0, iden);
  105|   321k|      out0 = _mm_blendv_epi8(out0, d0, mask);
  106|   321k|      _mm_storel_epi64((__m128i *)out, out0);
  107|   321k|      __m128i in1 = _mm_lddqu_si128((__m128i *)(in + 16));
  108|       |      in0 = _mm_alignr_epi8(in1, in0, 8);
  109|   321k|      in += 8;
  110|   321k|      out += 8;
  111|   321k|      len -= n_out;
  112|   321k|    }
  113|   151k|  }
  114|  4.88M|}
av1_upsample_intra_edge_sse4_1:
  116|  8.97M|void av1_upsample_intra_edge_sse4_1(uint8_t *p, int sz) {
  117|       |  // interpolate half-sample positions
  118|  8.97M|  assert(sz <= 24);
  119|       |
  120|  8.97M|  DECLARE_ALIGNED(16, static const int8_t, kernel[1][16]) = {
  ------------------
  |  |   19|  8.97M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  121|  8.97M|    { -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1, -1, 9, 9, -1 }
  122|  8.97M|  };
  123|       |
  124|  8.97M|  DECLARE_ALIGNED(
  ------------------
  |  |   19|  8.97M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  125|  8.97M|      16, static const int8_t,
  126|  8.97M|      v_const[2][16]) = { { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 },
  127|  8.97M|                          { 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 } };
  128|       |
  129|       |  // Extend first/last samples (upper-left p[-1], last p[sz-1])
  130|       |  // to support 4-tap filter
  131|  8.97M|  p[-2] = p[-1];
  132|  8.97M|  p[sz] = p[sz - 1];
  133|       |
  134|  8.97M|  uint8_t *in = &p[-2];
  135|  8.97M|  uint8_t *out = &p[-2];
  136|       |
  137|  8.97M|  int n = sz + 1;  // Input length including upper-left sample
  138|       |
  139|  8.97M|  __m128i in0 = _mm_lddqu_si128((__m128i *)&in[0]);
  140|  8.97M|  __m128i in16 = _mm_lddqu_si128((__m128i *)&in[16]);
  141|       |
  142|  8.97M|  __m128i coef0 = _mm_lddqu_si128((__m128i *)kernel[0]);
  143|  8.97M|  __m128i shuf0 = _mm_lddqu_si128((__m128i *)v_const[0]);
  144|  8.97M|  __m128i shuf1 = _mm_lddqu_si128((__m128i *)v_const[1]);
  145|       |
  146|  21.0M|  while (n > 0) {
  ------------------
  |  Branch (146:10): [True: 12.0M, False: 8.97M]
  ------------------
  147|  12.0M|    __m128i in8 = _mm_alignr_epi8(in16, in0, 8);
  148|  12.0M|    __m128i d0 = _mm_shuffle_epi8(in0, shuf0);
  149|  12.0M|    __m128i d1 = _mm_shuffle_epi8(in0, shuf1);
  150|  12.0M|    __m128i d2 = _mm_shuffle_epi8(in8, shuf0);
  151|  12.0M|    __m128i d3 = _mm_shuffle_epi8(in8, shuf1);
  152|  12.0M|    d0 = _mm_maddubs_epi16(d0, coef0);
  153|  12.0M|    d1 = _mm_maddubs_epi16(d1, coef0);
  154|  12.0M|    d2 = _mm_maddubs_epi16(d2, coef0);
  155|  12.0M|    d3 = _mm_maddubs_epi16(d3, coef0);
  156|  12.0M|    d0 = _mm_hadd_epi16(d0, d1);
  157|  12.0M|    d2 = _mm_hadd_epi16(d2, d3);
  158|  12.0M|    __m128i eight = _mm_set1_epi16(8);
  159|  12.0M|    d0 = _mm_add_epi16(d0, eight);
  160|  12.0M|    d2 = _mm_add_epi16(d2, eight);
  161|  12.0M|    d0 = _mm_srai_epi16(d0, 4);
  162|  12.0M|    d2 = _mm_srai_epi16(d2, 4);
  163|  12.0M|    d0 = _mm_packus_epi16(d0, d2);
  164|       |    __m128i in1 = _mm_alignr_epi8(in16, in0, 1);
  165|  12.0M|    __m128i out0 = _mm_unpacklo_epi8(in1, d0);
  166|  12.0M|    __m128i out1 = _mm_unpackhi_epi8(in1, d0);
  167|  12.0M|    _mm_storeu_si128((__m128i *)&out[0], out0);
  168|  12.0M|    _mm_storeu_si128((__m128i *)&out[16], out1);
  169|  12.0M|    in0 = in16;
  170|  12.0M|    in16 = _mm_setzero_si128();
  171|  12.0M|    out += 32;
  172|  12.0M|    n -= 16;
  173|  12.0M|  }
  174|  8.97M|}
av1_highbd_filter_intra_edge_sse4_1:
  178|  8.06M|void av1_highbd_filter_intra_edge_sse4_1(uint16_t *p, int sz, int strength) {
  179|  8.06M|  if (!strength) return;
  ------------------
  |  Branch (179:7): [True: 5.66M, False: 2.40M]
  ------------------
  180|       |
  181|  2.40M|  DECLARE_ALIGNED(16, static const int16_t, kern[3][8]) = {
  ------------------
  |  |   19|  2.40M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  182|  2.40M|    { 4, 8, 4, 8, 4, 8, 4, 8 },  // strength 1: 4,8,4
  183|  2.40M|    { 5, 6, 5, 6, 5, 6, 5, 6 },  // strength 2: 5,6,5
  184|  2.40M|    { 2, 4, 2, 4, 2, 4, 2, 4 }   // strength 3: 2,4,4,4,2
  185|  2.40M|  };
  186|       |
  187|  2.40M|  DECLARE_ALIGNED(16, static const int16_t,
  ------------------
  |  |   19|  2.40M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  188|  2.40M|                  v_const[1][8]) = { { 0, 1, 2, 3, 4, 5, 6, 7 } };
  189|       |
  190|       |  // Extend the first and last samples to simplify the loop for the 5-tap case
  191|  2.40M|  p[-1] = p[0];
  192|  2.40M|  __m128i last = _mm_set1_epi16(p[sz - 1]);
  193|  2.40M|  _mm_storeu_si128((__m128i *)&p[sz], last);
  194|       |
  195|       |  // Adjust input pointer for filter support area
  196|  2.40M|  uint16_t *in = (strength == 3) ? p - 1 : p;
  ------------------
  |  Branch (196:18): [True: 48.5k, False: 2.35M]
  ------------------
  197|       |
  198|       |  // Avoid modifying first sample
  199|  2.40M|  uint16_t *out = p + 1;
  200|  2.40M|  int len = sz - 1;
  201|       |
  202|  2.40M|  const int use_3tap_filter = (strength < 3);
  203|       |
  204|  2.40M|  if (use_3tap_filter) {
  ------------------
  |  Branch (204:7): [True: 2.36M, False: 45.0k]
  ------------------
  205|  2.36M|    __m128i coef0 = _mm_lddqu_si128((__m128i const *)kern[strength - 1]);
  206|  2.36M|    __m128i iden = _mm_lddqu_si128((__m128i *)v_const[0]);
  207|  2.36M|    __m128i in0 = _mm_lddqu_si128((__m128i *)&in[0]);
  208|  2.36M|    __m128i in8 = _mm_lddqu_si128((__m128i *)&in[8]);
  209|  4.83M|    while (len > 0) {
  ------------------
  |  Branch (209:12): [True: 2.47M, False: 2.36M]
  ------------------
  210|  2.47M|      int n_out = (len < 8) ? len : 8;
  ------------------
  |  Branch (210:19): [True: 1.68M, False: 793k]
  ------------------
  211|  2.47M|      __m128i in1 = _mm_alignr_epi8(in8, in0, 2);
  212|  2.47M|      __m128i in2 = _mm_alignr_epi8(in8, in0, 4);
  213|  2.47M|      __m128i in02 = _mm_add_epi16(in0, in2);
  214|  2.47M|      __m128i d0 = _mm_unpacklo_epi16(in02, in1);
  215|  2.47M|      __m128i d1 = _mm_unpackhi_epi16(in02, in1);
  216|  2.47M|      d0 = _mm_mullo_epi16(d0, coef0);
  217|  2.47M|      d1 = _mm_mullo_epi16(d1, coef0);
  218|  2.47M|      d0 = _mm_hadd_epi16(d0, d1);
  219|  2.47M|      __m128i eight = _mm_set1_epi16(8);
  220|  2.47M|      d0 = _mm_add_epi16(d0, eight);
  221|  2.47M|      d0 = _mm_srli_epi16(d0, 4);
  222|  2.47M|      __m128i out0 = _mm_lddqu_si128((__m128i *)out);
  223|  2.47M|      __m128i n0 = _mm_set1_epi16(n_out);
  224|  2.47M|      __m128i mask = _mm_cmpgt_epi16(n0, iden);
  225|  2.47M|      out0 = _mm_blendv_epi8(out0, d0, mask);
  226|  2.47M|      _mm_storeu_si128((__m128i *)out, out0);
  227|  2.47M|      in += 8;
  228|  2.47M|      in0 = in8;
  229|  2.47M|      in8 = _mm_lddqu_si128((__m128i *)&in[8]);
  230|  2.47M|      out += 8;
  231|  2.47M|      len -= n_out;
  232|  2.47M|    }
  233|  2.36M|  } else {  // 5-tap filter
  234|  45.0k|    __m128i coef0 = _mm_lddqu_si128((__m128i const *)kern[strength - 1]);
  235|  45.0k|    __m128i iden = _mm_lddqu_si128((__m128i *)v_const[0]);
  236|  45.0k|    __m128i in0 = _mm_lddqu_si128((__m128i *)&in[0]);
  237|  45.0k|    __m128i in8 = _mm_lddqu_si128((__m128i *)&in[8]);
  238|   108k|    while (len > 0) {
  ------------------
  |  Branch (238:12): [True: 63.9k, False: 45.0k]
  ------------------
  239|  63.9k|      int n_out = (len < 8) ? len : 8;
  ------------------
  |  Branch (239:19): [True: 116, False: 63.7k]
  ------------------
  240|  63.9k|      __m128i in1 = _mm_alignr_epi8(in8, in0, 2);
  241|  63.9k|      __m128i in2 = _mm_alignr_epi8(in8, in0, 4);
  242|  63.9k|      __m128i in3 = _mm_alignr_epi8(in8, in0, 6);
  243|       |      __m128i in4 = _mm_alignr_epi8(in8, in0, 8);
  244|  63.9k|      __m128i in04 = _mm_add_epi16(in0, in4);
  245|  63.9k|      __m128i in123 = _mm_add_epi16(in1, in2);
  246|  63.9k|      in123 = _mm_add_epi16(in123, in3);
  247|  63.9k|      __m128i d0 = _mm_unpacklo_epi16(in04, in123);
  248|  63.9k|      __m128i d1 = _mm_unpackhi_epi16(in04, in123);
  249|  63.9k|      d0 = _mm_mullo_epi16(d0, coef0);
  250|  63.9k|      d1 = _mm_mullo_epi16(d1, coef0);
  251|  63.9k|      d0 = _mm_hadd_epi16(d0, d1);
  252|  63.9k|      __m128i eight = _mm_set1_epi16(8);
  253|  63.9k|      d0 = _mm_add_epi16(d0, eight);
  254|  63.9k|      d0 = _mm_srli_epi16(d0, 4);
  255|  63.9k|      __m128i out0 = _mm_lddqu_si128((__m128i *)out);
  256|  63.9k|      __m128i n0 = _mm_set1_epi16(n_out);
  257|  63.9k|      __m128i mask = _mm_cmpgt_epi16(n0, iden);
  258|  63.9k|      out0 = _mm_blendv_epi8(out0, d0, mask);
  259|  63.9k|      _mm_storeu_si128((__m128i *)out, out0);
  260|  63.9k|      in += 8;
  261|  63.9k|      in0 = in8;
  262|  63.9k|      in8 = _mm_lddqu_si128((__m128i *)&in[8]);
  263|  63.9k|      out += 8;
  264|  63.9k|      len -= n_out;
  265|  63.9k|    }
  266|  45.0k|  }
  267|  2.40M|}
av1_highbd_upsample_intra_edge_sse4_1:
  269|  4.73M|void av1_highbd_upsample_intra_edge_sse4_1(uint16_t *p, int sz, int bd) {
  270|       |  // interpolate half-sample positions
  271|  4.73M|  assert(sz <= 24);
  272|       |
  273|  4.73M|  DECLARE_ALIGNED(16, static const int16_t,
  ------------------
  |  |   19|  4.73M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  274|  4.73M|                  kernel[1][8]) = { { -1, 9, -1, 9, -1, 9, -1, 9 } };
  275|       |
  276|       |  // Extend first/last samples (upper-left p[-1], last p[sz-1])
  277|       |  // to support 4-tap filter
  278|  4.73M|  p[-2] = p[-1];
  279|  4.73M|  p[sz] = p[sz - 1];
  280|       |
  281|  4.73M|  uint16_t *in = &p[-2];
  282|  4.73M|  uint16_t *out = in;
  283|  4.73M|  int n = sz + 1;
  284|       |
  285|  4.73M|  __m128i in0 = _mm_lddqu_si128((__m128i *)&in[0]);
  286|  4.73M|  __m128i in8 = _mm_lddqu_si128((__m128i *)&in[8]);
  287|  4.73M|  __m128i in16 = _mm_lddqu_si128((__m128i *)&in[16]);
  288|  4.73M|  __m128i in24 = _mm_lddqu_si128((__m128i *)&in[24]);
  289|       |
  290|  12.6M|  while (n > 0) {
  ------------------
  |  Branch (290:10): [True: 7.88M, False: 4.73M]
  ------------------
  291|  7.88M|    __m128i in1 = _mm_alignr_epi8(in8, in0, 2);
  292|  7.88M|    __m128i in2 = _mm_alignr_epi8(in8, in0, 4);
  293|       |    __m128i in3 = _mm_alignr_epi8(in8, in0, 6);
  294|  7.88M|    __m128i sum0 = _mm_add_epi16(in0, in3);
  295|  7.88M|    __m128i sum1 = _mm_add_epi16(in1, in2);
  296|  7.88M|    __m128i d0 = _mm_unpacklo_epi16(sum0, sum1);
  297|  7.88M|    __m128i d1 = _mm_unpackhi_epi16(sum0, sum1);
  298|  7.88M|    __m128i coef0 = _mm_lddqu_si128((__m128i *)kernel[0]);
  299|  7.88M|    d0 = _mm_madd_epi16(d0, coef0);
  300|  7.88M|    d1 = _mm_madd_epi16(d1, coef0);
  301|  7.88M|    __m128i eight = _mm_set1_epi32(8);
  302|  7.88M|    d0 = _mm_add_epi32(d0, eight);
  303|  7.88M|    d1 = _mm_add_epi32(d1, eight);
  304|  7.88M|    d0 = _mm_srai_epi32(d0, 4);
  305|  7.88M|    d1 = _mm_srai_epi32(d1, 4);
  306|  7.88M|    d0 = _mm_packus_epi32(d0, d1);
  307|  7.88M|    __m128i max0 = _mm_set1_epi16((1 << bd) - 1);
  308|  7.88M|    d0 = _mm_min_epi16(d0, max0);
  309|  7.88M|    __m128i out0 = _mm_unpacklo_epi16(in1, d0);
  310|  7.88M|    __m128i out1 = _mm_unpackhi_epi16(in1, d0);
  311|  7.88M|    _mm_storeu_si128((__m128i *)&out[0], out0);
  312|  7.88M|    _mm_storeu_si128((__m128i *)&out[8], out1);
  313|  7.88M|    in0 = in8;
  314|  7.88M|    in8 = in16;
  315|  7.88M|    in16 = in24;
  316|  7.88M|    in24 = _mm_setzero_si128();
  317|  7.88M|    out += 16;
  318|  7.88M|    n -= 8;
  319|  7.88M|  }
  320|  4.73M|}

av1_resize_vert_dir_avx2:
  260|    850|                              int start_col) {
  261|    850|  assert(start_col <= stride);
  262|       |  // For the GM tool, the input layer height or width is assured to be an even
  263|       |  // number. Hence the function 'down2_symodd()' is not invoked and SIMD
  264|       |  // optimization of the same is not implemented.
  265|       |  // When the input height is less than 8 and even, the potential input
  266|       |  // heights are limited to 2, 4, or 6. These scenarios require seperate
  267|       |  // handling due to padding requirements. Invoking the C function here will
  268|       |  // eliminate the need for conditional statements within the subsequent SIMD
  269|       |  // code to manage these cases.
  270|    850|  if (height & 1 || height < 8) {
  ------------------
  |  Branch (270:7): [True: 0, False: 850]
  |  Branch (270:21): [True: 0, False: 850]
  ------------------
  271|      0|    return av1_resize_vert_dir_c(intbuf, output, out_stride, height, height2,
  272|      0|                                 stride, start_col);
  273|      0|  }
  274|       |
  275|    850|  __m256i s[10], coeffs_y[4];
  276|    850|  const int bits = FILTER_BITS;
  ------------------
  |  |   21|    850|#define FILTER_BITS 7
  ------------------
  277|       |
  278|    850|  const __m128i round_shift_bits = _mm_cvtsi32_si128(bits);
  279|    850|  const __m256i round_const_bits = _mm256_set1_epi32((1 << bits) >> 1);
  280|    850|  const uint8_t max_pixel = 255;
  281|    850|  const __m256i clip_pixel = _mm256_set1_epi8((char)max_pixel);
  282|    850|  const __m256i zero = _mm256_setzero_si256();
  283|       |
  284|    850|  prepare_filter_coeffs(av1_down2_symeven_half_filter, coeffs_y);
  285|       |
  286|    850|  const int num_col16 = stride / 16;
  287|    850|  int remain_col = stride % 16;
  288|       |  // The core vertical SIMD processes 4 input rows simultaneously to generate
  289|       |  // output corresponding to 2 rows. To streamline the core loop and eliminate
  290|       |  // the need for conditional checks, the remaining rows (4 or 6) are processed
  291|       |  // separately.
  292|    850|  const int remain_row = (height % 4 == 0) ? 4 : 6;
  ------------------
  |  Branch (292:26): [True: 418, False: 432]
  ------------------
  293|       |
  294|  2.59k|  for (int j = start_col; j < stride - remain_col; j += 16) {
  ------------------
  |  Branch (294:27): [True: 1.74k, False: 850]
  ------------------
  295|  1.74k|    const uint8_t *data = &intbuf[j];
  296|  1.74k|    const __m128i l3 = _mm_loadu_si128((__m128i *)(data + 0 * stride));
  297|       |    // Padding top 3 rows with the last available row at the top.
  298|  1.74k|    const __m128i l0 = l3;
  299|  1.74k|    const __m128i l1 = l3;
  300|  1.74k|    const __m128i l2 = l3;
  301|  1.74k|    const __m128i l4 = _mm_loadu_si128((__m128i *)(data + 1 * stride));
  302|       |
  303|  1.74k|    __m128i l6, l7, l8, l9;
  304|  1.74k|    __m128i l5 = _mm_loadu_si128((__m128i *)(data + 2 * stride));
  305|  1.74k|    __m128i l10 = _mm_loadu_si128((__m128i *)(data + 3 * stride));
  306|  1.74k|    __m128i l11 = _mm_loadu_si128((__m128i *)(data + 4 * stride));
  307|       |
  308|       |    // a0...a15 | c0...c15
  309|  1.74k|    const __m256i s02 =
  310|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l0), CAST_HI(l2), 0x20);
  311|       |    // b0...b15 | d0...d15
  312|  1.74k|    const __m256i s13 =
  313|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l1), CAST_HI(l3), 0x20);
  314|       |    // c0...c15 | e0...e15
  315|  1.74k|    const __m256i s24 =
  316|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l2), CAST_HI(l4), 0x20);
  317|       |    // d0...d15 | f0...f15
  318|  1.74k|    const __m256i s35 =
  319|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l3), CAST_HI(l5), 0x20);
  320|       |    // e0...e15 | g0...g15
  321|  1.74k|    const __m256i s46 =
  322|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l4), CAST_HI(l10), 0x20);
  323|       |    // f0...f15 | h0...h15
  324|  1.74k|    const __m256i s57 =
  325|  1.74k|        _mm256_permute2x128_si256(CAST_HI(l5), CAST_HI(l11), 0x20);
  326|       |
  327|       |    // a0b0...a7b7 | c0d0...c7d7
  328|  1.74k|    s[0] = _mm256_unpacklo_epi8(s02, s13);
  329|       |    // c0d0...c7d7 | e0f0...e7f7
  330|  1.74k|    s[1] = _mm256_unpacklo_epi8(s24, s35);
  331|       |    // e0f0...e7f7 | g0h0...g7h7
  332|  1.74k|    s[2] = _mm256_unpacklo_epi8(s46, s57);
  333|       |
  334|       |    // a8b8...a15b15 | c8d8...c15d15
  335|  1.74k|    s[5] = _mm256_unpackhi_epi8(s02, s13);
  336|       |    // c8d8...c15d15 | e8f8...e15f15
  337|  1.74k|    s[6] = _mm256_unpackhi_epi8(s24, s35);
  338|       |    // e8f8...e15f15 | g8h8...g15h15
  339|  1.74k|    s[7] = _mm256_unpackhi_epi8(s46, s57);
  340|       |
  341|       |    // height to be processed here
  342|  1.74k|    const int process_ht = height - remain_row;
  343|  39.9k|    for (int i = 0; i < process_ht; i += 4) {
  ------------------
  |  Branch (343:21): [True: 38.1k, False: 1.74k]
  ------------------
  344|  38.1k|      PROCESS_RESIZE_Y_WD16
  ------------------
  |  |   25|  38.1k|  const int idx1 = AOMMIN(height - 1, i + 5);                               \
  |  |  ------------------
  |  |  |  |   34|  38.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 0, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|  38.1k|  const int idx2 = AOMMIN(height - 1, i + 6);                               \
  |  |  ------------------
  |  |  |  |   34|  38.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 0, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|  38.1k|  l6 = l10;                                                                 \
  |  |   28|  38.1k|  l7 = l11;                                                                 \
  |  |   29|  38.1k|  l8 = _mm_loadu_si128((__m128i *)(data + idx1 * stride));                  \
  |  |   30|  38.1k|  l9 = _mm_loadu_si128((__m128i *)(data + idx2 * stride));                  \
  |  |   31|  38.1k|                                                                            \
  |  |   32|  38.1k|  /* g0... g15 | i0... i15 */                                               \
  |  |   33|  38.1k|  const __m256i s68 =                                                       \
  |  |   34|  38.1k|      _mm256_permute2x128_si256(CAST_HI(l6), CAST_HI(l8), 0x20);            \
  |  |   35|  38.1k|  /* h0... h15 | j0... j15 */                                               \
  |  |   36|  38.1k|  const __m256i s79 =                                                       \
  |  |   37|  38.1k|      _mm256_permute2x128_si256(CAST_HI(l7), CAST_HI(l9), 0x20);            \
  |  |   38|  38.1k|                                                                            \
  |  |   39|  38.1k|  /* g0h0... g7g7 | i0j0... i7j */                                          \
  |  |   40|  38.1k|  s[3] = _mm256_unpacklo_epi8(s68, s79);                                    \
  |  |   41|  38.1k|  /* g8h8... g15g15 | i8j8... i15j15 */                                     \
  |  |   42|  38.1k|  s[8] = _mm256_unpackhi_epi8(s68, s79);                                    \
  |  |   43|  38.1k|                                                                            \
  |  |   44|  38.1k|  __m256i res_out[2] = { 0 };                                               \
  |  |   45|  38.1k|  resize_convolve(s, coeffs_y, res_out);                                    \
  |  |   46|  38.1k|                                                                            \
  |  |   47|  38.1k|  /* r00... r07 */                                                          \
  |  |   48|  38.1k|  __m256i res_a_round_1 = _mm256_add_epi32(res_out[0], round_const_bits);   \
  |  |   49|  38.1k|  /* r20... r27 */                                                          \
  |  |   50|  38.1k|  __m256i res_a_round_2 = _mm256_add_epi32(res_out[1], round_const_bits);   \
  |  |   51|  38.1k|                                                                            \
  |  |   52|  38.1k|  res_a_round_1 = _mm256_sra_epi32(res_a_round_1, round_shift_bits);        \
  |  |   53|  38.1k|  res_a_round_2 = _mm256_sra_epi32(res_a_round_2, round_shift_bits);        \
  |  |   54|  38.1k|                                                                            \
  |  |   55|  38.1k|  __m256i res_out_b[2] = { 0 };                                             \
  |  |   56|  38.1k|  resize_convolve(s + 5, coeffs_y, res_out_b);                              \
  |  |   57|  38.1k|                                                                            \
  |  |   58|  38.1k|  /* r08... r015 */                                                         \
  |  |   59|  38.1k|  __m256i res_b_round_1 = _mm256_add_epi32(res_out_b[0], round_const_bits); \
  |  |   60|  38.1k|  /* r28... r215 */                                                         \
  |  |   61|  38.1k|  __m256i res_b_round_2 = _mm256_add_epi32(res_out_b[1], round_const_bits); \
  |  |   62|  38.1k|  res_b_round_1 = _mm256_sra_epi32(res_b_round_1, round_shift_bits);        \
  |  |   63|  38.1k|  res_b_round_2 = _mm256_sra_epi32(res_b_round_2, round_shift_bits);        \
  |  |   64|  38.1k|                                                                            \
  |  |   65|  38.1k|  /* r00... r03 r20... r23 | r04... r07 r24... r27 */                       \
  |  |   66|  38.1k|  __m256i res_8bit0 = _mm256_packus_epi32(res_a_round_1, res_a_round_2);    \
  |  |   67|  38.1k|  /* r08... r012 r28... r212 | r013... r015 r213... r215 */                 \
  |  |   68|  38.1k|  __m256i res_8bit1 = _mm256_packus_epi32(res_b_round_1, res_b_round_2);    \
  |  |   69|  38.1k|  /* r00... r07 | r20... r27 */                                             \
  |  |   70|  38.1k|  res_8bit0 = _mm256_permute4x64_epi64(res_8bit0, 0xd8);                    \
  |  |   71|  38.1k|  /* r08... r015 | r28... r215 */                                           \
  |  |   72|  38.1k|  res_8bit1 = _mm256_permute4x64_epi64(res_8bit1, 0xd8);                    \
  |  |   73|  38.1k|  /* r00... r015 | r20... r215 */                                           \
  |  |   74|  38.1k|  res_8bit1 = _mm256_packus_epi16(res_8bit0, res_8bit1);                    \
  |  |   75|  38.1k|  res_8bit0 = _mm256_min_epu8(res_8bit1, clip_pixel);                       \
  |  |   76|  38.1k|  res_8bit0 = _mm256_max_epu8(res_8bit0, zero);
  ------------------
  345|       |
  346|  38.1k|      _mm_storeu_si128((__m128i *)&output[(i / 2) * out_stride + j],
  347|  38.1k|                       CAST_LOW(res_8bit0));
  ------------------
  |  |   22|  38.1k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  348|       |
  349|  38.1k|      _mm_storeu_si128(
  350|  38.1k|          (__m128i *)&output[(i / 2) * out_stride + j + out_stride],
  351|  38.1k|          _mm256_extracti128_si256(res_8bit0, 1));
  352|       |
  353|       |      // Load the required data for processing of next 4 input rows.
  354|  38.1k|      const int idx7 = AOMMIN(height - 1, i + 7);
  ------------------
  |  |   34|  38.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 38.1k]
  |  |  ------------------
  ------------------
  355|  38.1k|      const int idx8 = AOMMIN(height - 1, i + 8);
  ------------------
  |  |   34|  38.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 948, False: 37.2k]
  |  |  ------------------
  ------------------
  356|  38.1k|      l10 = _mm_loadu_si128((__m128i *)(data + idx7 * stride));
  357|  38.1k|      l11 = _mm_loadu_si128((__m128i *)(data + idx8 * stride));
  358|       |
  359|  38.1k|      const __m256i s810 =
  360|  38.1k|          _mm256_permute2x128_si256(CAST_HI(l8), CAST_HI(l10), 0x20);
  361|  38.1k|      const __m256i s911 =
  362|  38.1k|          _mm256_permute2x128_si256(CAST_HI(l9), CAST_HI(l11), 0x20);
  363|       |      // i0j0... i7j7 | k0l0... k7l7
  364|  38.1k|      s[4] = _mm256_unpacklo_epi8(s810, s911);
  365|       |      // i8j8... i15j15 | k8l8... k15l15
  366|  38.1k|      s[9] = _mm256_unpackhi_epi8(s810, s911);
  367|       |
  368|  38.1k|      s[0] = s[2];
  369|  38.1k|      s[1] = s[3];
  370|  38.1k|      s[2] = s[4];
  371|       |
  372|  38.1k|      s[5] = s[7];
  373|  38.1k|      s[6] = s[8];
  374|  38.1k|      s[7] = s[9];
  375|  38.1k|    }
  376|       |
  377|       |    // Process the remaining last 4 or 6 rows here.
  378|  1.74k|    int i = process_ht;
  379|  4.27k|    while (i < height - 1) {
  ------------------
  |  Branch (379:12): [True: 2.53k, False: 1.74k]
  ------------------
  380|  2.53k|      PROCESS_RESIZE_Y_WD16
  ------------------
  |  |   25|  2.53k|  const int idx1 = AOMMIN(height - 1, i + 5);                               \
  |  |  ------------------
  |  |  |  |   34|  2.53k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 1.74k, False: 794]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|  2.53k|  const int idx2 = AOMMIN(height - 1, i + 6);                               \
  |  |  ------------------
  |  |  |  |   34|  2.53k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 2.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|  2.53k|  l6 = l10;                                                                 \
  |  |   28|  2.53k|  l7 = l11;                                                                 \
  |  |   29|  2.53k|  l8 = _mm_loadu_si128((__m128i *)(data + idx1 * stride));                  \
  |  |   30|  2.53k|  l9 = _mm_loadu_si128((__m128i *)(data + idx2 * stride));                  \
  |  |   31|  2.53k|                                                                            \
  |  |   32|  2.53k|  /* g0... g15 | i0... i15 */                                               \
  |  |   33|  2.53k|  const __m256i s68 =                                                       \
  |  |   34|  2.53k|      _mm256_permute2x128_si256(CAST_HI(l6), CAST_HI(l8), 0x20);            \
  |  |   35|  2.53k|  /* h0... h15 | j0... j15 */                                               \
  |  |   36|  2.53k|  const __m256i s79 =                                                       \
  |  |   37|  2.53k|      _mm256_permute2x128_si256(CAST_HI(l7), CAST_HI(l9), 0x20);            \
  |  |   38|  2.53k|                                                                            \
  |  |   39|  2.53k|  /* g0h0... g7g7 | i0j0... i7j */                                          \
  |  |   40|  2.53k|  s[3] = _mm256_unpacklo_epi8(s68, s79);                                    \
  |  |   41|  2.53k|  /* g8h8... g15g15 | i8j8... i15j15 */                                     \
  |  |   42|  2.53k|  s[8] = _mm256_unpackhi_epi8(s68, s79);                                    \
  |  |   43|  2.53k|                                                                            \
  |  |   44|  2.53k|  __m256i res_out[2] = { 0 };                                               \
  |  |   45|  2.53k|  resize_convolve(s, coeffs_y, res_out);                                    \
  |  |   46|  2.53k|                                                                            \
  |  |   47|  2.53k|  /* r00... r07 */                                                          \
  |  |   48|  2.53k|  __m256i res_a_round_1 = _mm256_add_epi32(res_out[0], round_const_bits);   \
  |  |   49|  2.53k|  /* r20... r27 */                                                          \
  |  |   50|  2.53k|  __m256i res_a_round_2 = _mm256_add_epi32(res_out[1], round_const_bits);   \
  |  |   51|  2.53k|                                                                            \
  |  |   52|  2.53k|  res_a_round_1 = _mm256_sra_epi32(res_a_round_1, round_shift_bits);        \
  |  |   53|  2.53k|  res_a_round_2 = _mm256_sra_epi32(res_a_round_2, round_shift_bits);        \
  |  |   54|  2.53k|                                                                            \
  |  |   55|  2.53k|  __m256i res_out_b[2] = { 0 };                                             \
  |  |   56|  2.53k|  resize_convolve(s + 5, coeffs_y, res_out_b);                              \
  |  |   57|  2.53k|                                                                            \
  |  |   58|  2.53k|  /* r08... r015 */                                                         \
  |  |   59|  2.53k|  __m256i res_b_round_1 = _mm256_add_epi32(res_out_b[0], round_const_bits); \
  |  |   60|  2.53k|  /* r28... r215 */                                                         \
  |  |   61|  2.53k|  __m256i res_b_round_2 = _mm256_add_epi32(res_out_b[1], round_const_bits); \
  |  |   62|  2.53k|  res_b_round_1 = _mm256_sra_epi32(res_b_round_1, round_shift_bits);        \
  |  |   63|  2.53k|  res_b_round_2 = _mm256_sra_epi32(res_b_round_2, round_shift_bits);        \
  |  |   64|  2.53k|                                                                            \
  |  |   65|  2.53k|  /* r00... r03 r20... r23 | r04... r07 r24... r27 */                       \
  |  |   66|  2.53k|  __m256i res_8bit0 = _mm256_packus_epi32(res_a_round_1, res_a_round_2);    \
  |  |   67|  2.53k|  /* r08... r012 r28... r212 | r013... r015 r213... r215 */                 \
  |  |   68|  2.53k|  __m256i res_8bit1 = _mm256_packus_epi32(res_b_round_1, res_b_round_2);    \
  |  |   69|  2.53k|  /* r00... r07 | r20... r27 */                                             \
  |  |   70|  2.53k|  res_8bit0 = _mm256_permute4x64_epi64(res_8bit0, 0xd8);                    \
  |  |   71|  2.53k|  /* r08... r015 | r28... r215 */                                           \
  |  |   72|  2.53k|  res_8bit1 = _mm256_permute4x64_epi64(res_8bit1, 0xd8);                    \
  |  |   73|  2.53k|  /* r00... r015 | r20... r215 */                                           \
  |  |   74|  2.53k|  res_8bit1 = _mm256_packus_epi16(res_8bit0, res_8bit1);                    \
  |  |   75|  2.53k|  res_8bit0 = _mm256_min_epu8(res_8bit1, clip_pixel);                       \
  |  |   76|  2.53k|  res_8bit0 = _mm256_max_epu8(res_8bit0, zero);
  ------------------
  381|       |
  382|  2.53k|      _mm_storeu_si128((__m128i *)&output[(i / 2) * out_stride + j],
  383|  2.53k|                       CAST_LOW(res_8bit0));
  ------------------
  |  |   22|  2.53k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  384|  2.53k|      i += 2;
  385|       |
  386|  2.53k|      const int is_store_valid = (i < height - 1);
  387|  2.53k|      if (is_store_valid)
  ------------------
  |  Branch (387:11): [True: 1.74k, False: 794]
  ------------------
  388|  1.74k|        _mm_storeu_si128((__m128i *)&output[(i / 2) * out_stride + j],
  389|  1.74k|                         _mm256_extracti128_si256(res_8bit0, 1));
  390|  2.53k|      i += 2;
  391|       |
  392|       |      // Check if there is any remaining height to process. If so, perform the
  393|       |      // necessary data loading for processing the next row.
  394|  2.53k|      if (i < height - 1) {
  ------------------
  |  Branch (394:11): [True: 794, False: 1.74k]
  ------------------
  395|    794|        l10 = l11 = l9;
  396|    794|        const __m256i s810 =
  397|    794|            _mm256_permute2x128_si256(CAST_HI(l8), CAST_HI(l10), 0x20);
  398|    794|        const __m256i s911 =
  399|    794|            _mm256_permute2x128_si256(CAST_HI(l9), CAST_HI(l11), 0x20);
  400|       |        // i0j0... i7j7 | k0l0... k7l7
  401|    794|        s[4] = _mm256_unpacklo_epi8(s810, s911);
  402|       |        // i8j8... i15j15 | k8l8... k15l15
  403|    794|        s[9] = _mm256_unpackhi_epi8(s810, s911);
  404|       |
  405|    794|        s[0] = s[2];
  406|    794|        s[1] = s[3];
  407|    794|        s[2] = s[4];
  408|       |
  409|    794|        s[5] = s[7];
  410|    794|        s[6] = s[8];
  411|    794|        s[7] = s[9];
  412|    794|      }
  413|  2.53k|    }
  414|  1.74k|  }
  415|       |
  416|    850|  if (remain_col > 7) {
  ------------------
  |  Branch (416:7): [True: 354, False: 496]
  ------------------
  417|    354|    const int processed_wd = num_col16 * 16;
  418|    354|    remain_col = stride % 8;
  419|       |
  420|    354|    const uint8_t *data = &intbuf[processed_wd];
  421|       |
  422|    354|    const __m128i l3 = _mm_loadl_epi64((__m128i *)(data + 0 * stride));
  423|       |    // Padding top 3 rows with available top-most row.
  424|    354|    const __m128i l0 = l3;
  425|    354|    const __m128i l1 = l3;
  426|    354|    const __m128i l2 = l3;
  427|    354|    const __m128i l4 = _mm_loadl_epi64((__m128i *)(data + 1 * stride));
  428|       |
  429|    354|    __m128i l6, l7, l8, l9;
  430|    354|    __m128i l5 = _mm_loadl_epi64((__m128i *)(data + 2 * stride));
  431|    354|    __m128i l10 = _mm_loadl_epi64((__m128i *)(data + 3 * stride));
  432|    354|    __m128i l11 = _mm_loadl_epi64((__m128i *)(data + 4 * stride));
  433|       |
  434|       |    // a0b0...a7b7
  435|    354|    const __m128i s01 = _mm_unpacklo_epi8(l0, l1);
  436|       |    // c0d0...c7d7
  437|    354|    const __m128i s23 = _mm_unpacklo_epi8(l2, l3);
  438|       |    // e0f0...e7f7
  439|    354|    const __m128i s45 = _mm_unpacklo_epi8(l4, l5);
  440|       |    // g0h0...g7h7
  441|    354|    __m128i s67 = _mm_unpacklo_epi8(l10, l11);
  442|       |
  443|       |    // a0b0...a7b7 | c0d0...c7d7
  444|    354|    s[0] = _mm256_permute2x128_si256(CAST_HI(s01), CAST_HI(s23), 0x20);
  445|       |    // c0d0...c7d7 | e0f0...e7f7
  446|    354|    s[1] = _mm256_permute2x128_si256(CAST_HI(s23), CAST_HI(s45), 0x20);
  447|       |    // e0f0...e7f7 | g0h0...g7h7
  448|    354|    s[2] = _mm256_permute2x128_si256(CAST_HI(s45), CAST_HI(s67), 0x20);
  449|       |
  450|       |    // height to be processed here
  451|    354|    const int process_ht = height - remain_row;
  452|  6.74k|    for (int i = 0; i < process_ht; i += 4) {
  ------------------
  |  Branch (452:21): [True: 6.39k, False: 354]
  ------------------
  453|  6.39k|      PROCESS_RESIZE_Y_WD8
  ------------------
  |  |   79|  6.39k|  const int idx1 = AOMMIN(height - 1, i + 5);                             \
  |  |  ------------------
  |  |  |  |   34|  6.39k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 0, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|  6.39k|  const int idx2 = AOMMIN(height - 1, i + 6);                             \
  |  |  ------------------
  |  |  |  |   34|  6.39k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 0, False: 6.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  6.39k|  l6 = l10;                                                               \
  |  |   82|  6.39k|  l7 = l11;                                                               \
  |  |   83|  6.39k|  l8 = _mm_loadl_epi64((__m128i *)(data + idx1 * stride));                \
  |  |   84|  6.39k|  l9 = _mm_loadl_epi64((__m128i *)(data + idx2 * stride));                \
  |  |   85|  6.39k|                                                                          \
  |  |   86|  6.39k|  /* g0h0... g7h7 */                                                      \
  |  |   87|  6.39k|  s67 = _mm_unpacklo_epi8(l6, l7);                                        \
  |  |   88|  6.39k|  /* i0j0...i7j7 */                                                       \
  |  |   89|  6.39k|  __m128i s89 = _mm_unpacklo_epi8(l8, l9);                                \
  |  |   90|  6.39k|                                                                          \
  |  |   91|  6.39k|  /* g0h0...g7g7 | i0j0...i7j7 */                                         \
  |  |   92|  6.39k|  s[3] = _mm256_permute2x128_si256(CAST_HI(s67), CAST_HI(s89), 0x20);     \
  |  |   93|  6.39k|                                                                          \
  |  |   94|  6.39k|  __m256i res_out[2] = { 0 };                                             \
  |  |   95|  6.39k|  resize_convolve(s, coeffs_y, res_out);                                  \
  |  |   96|  6.39k|                                                                          \
  |  |   97|  6.39k|  /* r00... r07 */                                                        \
  |  |   98|  6.39k|  __m256i res_a_round_1 = _mm256_add_epi32(res_out[0], round_const_bits); \
  |  |   99|  6.39k|  /* r20...r27 */                                                         \
  |  |  100|  6.39k|  __m256i res_a_round_2 = _mm256_add_epi32(res_out[1], round_const_bits); \
  |  |  101|  6.39k|  res_a_round_1 = _mm256_sra_epi32(res_a_round_1, round_shift_bits);      \
  |  |  102|  6.39k|  res_a_round_2 = _mm256_sra_epi32(res_a_round_2, round_shift_bits);      \
  |  |  103|  6.39k|                                                                          \
  |  |  104|  6.39k|  /* r00...r03 r20...r23 | r04...r07 r24...r27 */                         \
  |  |  105|  6.39k|  res_a_round_1 = _mm256_packus_epi32(res_a_round_1, res_a_round_2);      \
  |  |  106|  6.39k|  /* r00...r07 | r20...r27 */                                             \
  |  |  107|  6.39k|  res_a_round_1 = _mm256_permute4x64_epi64(res_a_round_1, 0xd8);          \
  |  |  108|  6.39k|  res_a_round_1 = _mm256_packus_epi16(res_a_round_1, res_a_round_1);      \
  |  |  109|  6.39k|  res_a_round_1 = _mm256_min_epu8(res_a_round_1, clip_pixel);             \
  |  |  110|  6.39k|  res_a_round_1 = _mm256_max_epu8(res_a_round_1, zero);
  ------------------
  454|       |
  455|  6.39k|      _mm_storel_epi64((__m128i *)&output[(i / 2) * out_stride + processed_wd],
  456|  6.39k|                       CAST_LOW(res_a_round_1));
  ------------------
  |  |   22|  6.39k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  457|       |
  458|  6.39k|      _mm_storel_epi64(
  459|  6.39k|          (__m128i *)&output[(i / 2) * out_stride + processed_wd + out_stride],
  460|  6.39k|          _mm256_extracti128_si256(res_a_round_1, 1));
  461|       |
  462|  6.39k|      const int idx7 = AOMMIN(height - 1, i + 7);
  ------------------
  |  |   34|  6.39k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 6.39k]
  |  |  ------------------
  ------------------
  463|  6.39k|      const int idx8 = AOMMIN(height - 1, i + 8);
  ------------------
  |  |   34|  6.39k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 146, False: 6.24k]
  |  |  ------------------
  ------------------
  464|  6.39k|      l10 = _mm_loadl_epi64((__m128i *)(data + idx7 * stride));
  465|  6.39k|      l11 = _mm_loadl_epi64((__m128i *)(data + idx8 * stride));
  466|       |
  467|       |      // k0l0... k7l7
  468|  6.39k|      const __m128i s10s11 = _mm_unpacklo_epi8(l10, l11);
  469|       |      // i0j0... i7j7 | k0l0... k7l7
  470|  6.39k|      s[4] = _mm256_permute2x128_si256(CAST_HI(s89), CAST_HI(s10s11), 0x20);
  471|       |
  472|  6.39k|      s[0] = s[2];
  473|  6.39k|      s[1] = s[3];
  474|  6.39k|      s[2] = s[4];
  475|  6.39k|    }
  476|       |
  477|       |    // Process the remaining last 4 or 6 rows here.
  478|    354|    int i = process_ht;
  479|    916|    while (i < height - 1) {
  ------------------
  |  Branch (479:12): [True: 562, False: 354]
  ------------------
  480|    562|      PROCESS_RESIZE_Y_WD8
  ------------------
  |  |   79|    562|  const int idx1 = AOMMIN(height - 1, i + 5);                             \
  |  |  ------------------
  |  |  |  |   34|    562|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 354, False: 208]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|    562|  const int idx2 = AOMMIN(height - 1, i + 6);                             \
  |  |  ------------------
  |  |  |  |   34|    562|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:23): [True: 562, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|    562|  l6 = l10;                                                               \
  |  |   82|    562|  l7 = l11;                                                               \
  |  |   83|    562|  l8 = _mm_loadl_epi64((__m128i *)(data + idx1 * stride));                \
  |  |   84|    562|  l9 = _mm_loadl_epi64((__m128i *)(data + idx2 * stride));                \
  |  |   85|    562|                                                                          \
  |  |   86|    562|  /* g0h0... g7h7 */                                                      \
  |  |   87|    562|  s67 = _mm_unpacklo_epi8(l6, l7);                                        \
  |  |   88|    562|  /* i0j0...i7j7 */                                                       \
  |  |   89|    562|  __m128i s89 = _mm_unpacklo_epi8(l8, l9);                                \
  |  |   90|    562|                                                                          \
  |  |   91|    562|  /* g0h0...g7g7 | i0j0...i7j7 */                                         \
  |  |   92|    562|  s[3] = _mm256_permute2x128_si256(CAST_HI(s67), CAST_HI(s89), 0x20);     \
  |  |   93|    562|                                                                          \
  |  |   94|    562|  __m256i res_out[2] = { 0 };                                             \
  |  |   95|    562|  resize_convolve(s, coeffs_y, res_out);                                  \
  |  |   96|    562|                                                                          \
  |  |   97|    562|  /* r00... r07 */                                                        \
  |  |   98|    562|  __m256i res_a_round_1 = _mm256_add_epi32(res_out[0], round_const_bits); \
  |  |   99|    562|  /* r20...r27 */                                                         \
  |  |  100|    562|  __m256i res_a_round_2 = _mm256_add_epi32(res_out[1], round_const_bits); \
  |  |  101|    562|  res_a_round_1 = _mm256_sra_epi32(res_a_round_1, round_shift_bits);      \
  |  |  102|    562|  res_a_round_2 = _mm256_sra_epi32(res_a_round_2, round_shift_bits);      \
  |  |  103|    562|                                                                          \
  |  |  104|    562|  /* r00...r03 r20...r23 | r04...r07 r24...r27 */                         \
  |  |  105|    562|  res_a_round_1 = _mm256_packus_epi32(res_a_round_1, res_a_round_2);      \
  |  |  106|    562|  /* r00...r07 | r20...r27 */                                             \
  |  |  107|    562|  res_a_round_1 = _mm256_permute4x64_epi64(res_a_round_1, 0xd8);          \
  |  |  108|    562|  res_a_round_1 = _mm256_packus_epi16(res_a_round_1, res_a_round_1);      \
  |  |  109|    562|  res_a_round_1 = _mm256_min_epu8(res_a_round_1, clip_pixel);             \
  |  |  110|    562|  res_a_round_1 = _mm256_max_epu8(res_a_round_1, zero);
  ------------------
  481|       |
  482|    562|      _mm_storel_epi64((__m128i *)&output[(i / 2) * out_stride + processed_wd],
  483|    562|                       CAST_LOW(res_a_round_1));
  ------------------
  |  |   22|    562|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  484|       |
  485|    562|      i += 2;
  486|       |
  487|    562|      const int is_store_valid = (i < height - 1);
  488|    562|      if (is_store_valid)
  ------------------
  |  Branch (488:11): [True: 354, False: 208]
  ------------------
  489|    354|        _mm_storel_epi64(
  490|    354|            (__m128i *)&output[(i / 2) * out_stride + processed_wd],
  491|    354|            _mm256_extracti128_si256(res_a_round_1, 1));
  492|    562|      i += 2;
  493|       |
  494|       |      // Check rows are still remaining for processing. If yes do the required
  495|       |      // load of data for the next iteration.
  496|    562|      if (i < height - 1) {
  ------------------
  |  Branch (496:11): [True: 208, False: 354]
  ------------------
  497|    208|        l10 = l11 = l9;
  498|       |        // k0l0... k7l7
  499|    208|        const __m128i s10s11 = _mm_unpacklo_epi8(l10, l11);
  500|       |        // i0j0... i7j7 | k0l0... k7l7
  501|    208|        s[4] = _mm256_permute2x128_si256(CAST_HI(s89), CAST_HI(s10s11), 0x20);
  502|       |
  503|    208|        s[0] = s[2];
  504|    208|        s[1] = s[3];
  505|    208|        s[2] = s[4];
  506|    208|      }
  507|    562|    }
  508|    354|  }
  509|       |
  510|    850|  if (remain_col)
  ------------------
  |  Branch (510:7): [True: 686, False: 164]
  ------------------
  511|    686|    return av1_resize_vert_dir_c(intbuf, output, out_stride, height, height2,
  512|    686|                                 stride, stride - remain_col);
  513|       |
  514|    164|  return true;
  515|    850|}
av1_resize_horz_dir_avx2:
  536|    850|                              int width2) {
  537|    850|  assert(height % 2 == 0);
  538|       |  // Invoke SSE2 for width less than 32.
  539|    850|  if (filtered_length < 32) {
  ------------------
  |  Branch (539:7): [True: 0, False: 850]
  ------------------
  540|      0|    av1_resize_horz_dir_sse2(input, in_stride, intbuf, height, filtered_length,
  541|      0|                             width2);
  542|      0|    return;
  543|      0|  }
  544|       |
  545|    850|  const int filt_length = sizeof(av1_down2_symeven_half_filter);
  546|    850|  assert(filt_length % 2 == 0);
  547|    850|  (void)filt_length;
  548|       |
  549|    850|  __m256i s0[4], s1[4], coeffs_x[4];
  550|       |
  551|    850|  const int bits = FILTER_BITS;
  ------------------
  |  |   21|    850|#define FILTER_BITS 7
  ------------------
  552|    850|  const int dst_stride = width2;
  553|    850|  const __m128i round_shift_bits = _mm_cvtsi32_si128(bits);
  554|    850|  const __m256i round_const_bits = _mm256_set1_epi32((1 << bits) >> 1);
  555|       |
  556|    850|  const uint8_t max_pixel = 255;
  557|    850|  const __m256i clip_pixel = _mm256_set1_epi8((char)max_pixel);
  558|    850|  const __m256i zero = _mm256_setzero_si256();
  559|       |
  560|    850|  const __m256i wd32_start_pad_mask =
  561|    850|      _mm256_loadu_si256((__m256i *)wd32_left_padding_mask);
  562|    850|  const __m256i wd32_end_pad_mask =
  563|    850|      _mm256_loadu_si256((__m256i *)wd32_right_padding_mask);
  564|    850|  const __m256i wd8_end_pad_mask =
  565|    850|      _mm256_loadu_si256((__m256i *)wd8_right_padding_mask);
  566|    850|  prepare_filter_coeffs(av1_down2_symeven_half_filter, coeffs_x);
  567|       |
  568|       |  // The core horizontal SIMD processes 32 input pixels of 2 rows simultaneously
  569|       |  // to generate output corresponding to 2 rows. To streamline the core loop and
  570|       |  // eliminate the need for conditional checks, the remaining columns (16 or 8)
  571|       |  // are processed separately.
  572|    850|  if (filtered_length % 32 == 0) {
  ------------------
  |  Branch (572:7): [True: 110, False: 740]
  ------------------
  573|  4.46k|    for (int i = 0; i < height; i += 2) {
  ------------------
  |  Branch (573:21): [True: 4.35k, False: 110]
  ------------------
  574|  4.35k|      int filter_offset = 0;
  575|  4.35k|      int row_offset = 0;
  576|  12.0k|      for (int j = 0; j < filtered_length; j += 32) {
  ------------------
  |  Branch (576:23): [True: 7.67k, False: 4.35k]
  ------------------
  577|  7.67k|        PROCESS_RESIZE_X_WD32
  ------------------
  |  |  114|  7.67k|  __m256i row0 = _mm256_loadu_si256(                                           \
  |  |  115|  7.67k|      (__m256i *)&input[i * in_stride + j - filter_offset]);                   \
  |  |  116|  7.67k|  /* b0 b1 ..... b30 b31 */                                                    \
  |  |  117|  7.67k|  __m256i row1 = _mm256_loadu_si256(                                           \
  |  |  118|  7.67k|      (__m256i *)&input[(i + 1) * in_stride + j - filter_offset]);             \
  |  |  119|  7.67k|  /* a0 .... a15 || b0.... b15 */                                              \
  |  |  120|  7.67k|  __m256i r0 = _mm256_permute2x128_si256(row0, row1, 0x20);                    \
  |  |  121|  7.67k|  /* a16 .... a31 || b16 .... b31 */                                           \
  |  |  122|  7.67k|  __m256i r1 = _mm256_permute2x128_si256(row0, row1, 0x31);                    \
  |  |  123|  7.67k|  filter_offset = 3;                                                           \
  |  |  124|  7.67k|                                                                               \
  |  |  125|  7.67k|  /* Pad start pixels to the left, while processing the first pixels in the    \
  |  |  126|  7.67k|   * row. */                                                                   \
  |  |  127|  7.67k|  if (j == 0) {                                                                \
  |  |  ------------------
  |  |  |  Branch (127:7): [True: 4.35k, False: 3.32k]
  |  |  ------------------
  |  |  128|  4.35k|    /* a0 a0 a0 a0 .... a12 || b0 b0 b0 b0 .... b12 */                         \
  |  |  129|  4.35k|    row0 = _mm256_shuffle_epi8(r0, wd32_start_pad_mask);                       \
  |  |  130|  4.35k|    /* a13 a14 a15 a16.....a28 || b13 b14 b15 b16.....b28 */                   \
  |  |  131|  4.35k|    row1 = _mm256_alignr_epi8(r1, r0, 13);                                     \
  |  |  132|  4.35k|    r0 = row0;                                                                 \
  |  |  133|  4.35k|    r1 = row1;                                                                 \
  |  |  134|  4.35k|  }                                                                            \
  |  |  135|  7.67k|  const int is_last_cols32 = (j + 32 == filtered_length);                      \
  |  |  136|  7.67k|  /* Avoid loading extra pixels at frame boundary.*/                           \
  |  |  137|  7.67k|  if (is_last_cols32) row_offset = ROW_OFFSET;                                 \
  |  |  ------------------
  |  |  |  |   20|  4.35k|#define ROW_OFFSET 5
  |  |  ------------------
  |  |  |  Branch (137:7): [True: 4.35k, False: 3.32k]
  |  |  ------------------
  |  |  138|  7.67k|  /* a29 a30 a31 a32 a33 a34 a35 a36 0 0 ....*/                                \
  |  |  139|  7.67k|  __m128i row0_0 = _mm_loadl_epi64(                                            \
  |  |  140|  7.67k|      (__m128i *)&input[i * in_stride + 32 + j - filter_offset - row_offset]); \
  |  |  141|  7.67k|  /* b29 b30 b31 b32 b33 b34 b35 b36 0 0 .... */                               \
  |  |  142|  7.67k|  __m128i row1_0 =                                                             \
  |  |  143|  7.67k|      _mm_loadl_epi64((__m128i *)&input[(i + 1) * in_stride + 32 + j -         \
  |  |  144|  7.67k|                                        filter_offset - row_offset]);          \
  |  |  145|  7.67k|  __m256i r2 = _mm256_permute2x128_si256(                                      \
  |  |  146|  7.67k|      _mm256_castsi128_si256(row0_0), _mm256_castsi128_si256(row1_0), 0x20);   \
  |  |  147|  7.67k|                                                                               \
  |  |  148|  7.67k|  /* Pad end pixels to the right, while processing the last pixels in the      \
  |  |  149|  7.67k|   * row. */                                                                   \
  |  |  150|  7.67k|  if (is_last_cols32) {                                                        \
  |  |  ------------------
  |  |  |  Branch (150:7): [True: 4.35k, False: 3.32k]
  |  |  ------------------
  |  |  151|  4.35k|    r2 = _mm256_shuffle_epi8(_mm256_srli_si256(r2, ROW_OFFSET),                \
  |  |  152|  4.35k|                             wd32_end_pad_mask);                               \
  |  |  153|  4.35k|  }                                                                            \
  |  |  154|  7.67k|                                                                               \
  |  |  155|  7.67k|  /* Process even pixels of the first row  */                                  \
  |  |  156|  7.67k|  /* a0 a0 a0 a0 a1 a2 .... a12 | b0 b0 b0 b0 b1 b2 .... b12 */                \
  |  |  157|  7.67k|  s0[0] = _mm256_alignr_epi8(r1, r0, 0);                                       \
  |  |  158|  7.67k|  /* a0 a0 a1 a2 a3 a4 .... a14 | b0 b0 b1 b2 b3 b4 .... b14 */                \
  |  |  159|  7.67k|  s0[1] = _mm256_alignr_epi8(r1, r0, 2);                                       \
  |  |  160|  7.67k|  /* a1 a2 a3 a4 a5 a6 .... a16 | b1 b2 b3 b4 b5 b6 .... b16 */                \
  |  |  161|  7.67k|  s0[2] = _mm256_alignr_epi8(r1, r0, 4);                                       \
  |  |  162|  7.67k|  /* a3 a4 a5 a6 a7 a8 .... a18 | b3 b4 b5 b6 b7 b8 .... b18 */                \
  |  |  163|  7.67k|  s0[3] = _mm256_alignr_epi8(r1, r0, 6);                                       \
  |  |  164|  7.67k|                                                                               \
  |  |  165|  7.67k|  /* Process even pixels of the second row  */                                 \
  |  |  166|  7.67k|  /* a13 a14 a15 a16  ..... a28 | b13 b14 b15 b16 ..... b28 */                 \
  |  |  167|  7.67k|  s1[0] = _mm256_alignr_epi8(r2, r1, 0);                                       \
  |  |  168|  7.67k|  /* a15 a16 a17 a18  ..... a30 | b15 b16 b17 b18 ..... b30 */                 \
  |  |  169|  7.67k|  s1[1] = _mm256_alignr_epi8(r2, r1, 2);                                       \
  |  |  170|  7.67k|  /* a17 a18 a19 a20  ..... a32 | b17 b18 b19 b20 ..... b32 */                 \
  |  |  171|  7.67k|  s1[2] = _mm256_alignr_epi8(r2, r1, 4);                                       \
  |  |  172|  7.67k|  /* a19 a20 a21 a22  ..... a34 | b19 b20 b21 b22 ..... b34 */                 \
  |  |  173|  7.67k|  s1[3] = _mm256_alignr_epi8(r2, r1, 6);                                       \
  |  |  174|  7.67k|                                                                               \
  |  |  175|  7.67k|  /* The register res_out_0 stores the result of start-16 pixels corresponding \
  |  |  176|  7.67k|   * to the first and second rows whereas res_out_1 stores the end-16          \
  |  |  177|  7.67k|   * pixels. */                                                                \
  |  |  178|  7.67k|  __m256i res_out_0[2], res_out_1[2];                                          \
  |  |  179|  7.67k|  res_out_1[0] = res_out_1[1] = zero;                                          \
  |  |  180|  7.67k|  res_out_0[0] = res_out_0[1] = zero;                                          \
  |  |  181|  7.67k|  resize_convolve(s0, coeffs_x, res_out_0);                                    \
  |  |  182|  7.67k|  resize_convolve(s1, coeffs_x, res_out_1);                                    \
  |  |  183|  7.67k|                                                                               \
  |  |  184|  7.67k|  /* Result of 32 pixels of row0 (a0 to a32) */                                \
  |  |  185|  7.67k|  res_out_0[0] = _mm256_sra_epi32(                                             \
  |  |  186|  7.67k|      _mm256_add_epi32(res_out_0[0], round_const_bits), round_shift_bits);     \
  |  |  187|  7.67k|  res_out_1[0] = _mm256_sra_epi32(                                             \
  |  |  188|  7.67k|      _mm256_add_epi32(res_out_1[0], round_const_bits), round_shift_bits);     \
  |  |  189|  7.67k|  /* r00-r03 r08-r011 | r04-r07 r012-r015 */                                   \
  |  |  190|  7.67k|  __m256i res_out_r0 = _mm256_packus_epi32(res_out_0[0], res_out_1[0]);        \
  |  |  191|  7.67k|                                                                               \
  |  |  192|  7.67k|  /* Result of 32 pixels of row1 (b0 to b32) */                                \
  |  |  193|  7.67k|  res_out_0[1] = _mm256_sra_epi32(                                             \
  |  |  194|  7.67k|      _mm256_add_epi32(res_out_0[1], round_const_bits), round_shift_bits);     \
  |  |  195|  7.67k|  res_out_1[1] = _mm256_sra_epi32(                                             \
  |  |  196|  7.67k|      _mm256_add_epi32(res_out_1[1], round_const_bits), round_shift_bits);     \
  |  |  197|  7.67k|  /* r10-r13 r18-r111 | r14-r17 r112-r115 */                                   \
  |  |  198|  7.67k|  __m256i res_out_r1 = _mm256_packus_epi32(res_out_0[1], res_out_1[1]);        \
  |  |  199|  7.67k|                                                                               \
  |  |  200|  7.67k|  /* Convert the result from 16bit to 8bit */                                  \
  |  |  201|  7.67k|  /* r00-r03 r08-r011 r10-r13 r18-r111 | r04-r07 r012-r015 r14-r17 r112-r115   \
  |  |  202|  7.67k|   */                                                                          \
  |  |  203|  7.67k|  __m256i res_out_r01 = _mm256_packus_epi16(res_out_r0, res_out_r1);           \
  |  |  204|  7.67k|  __m256i res_out_row01 = _mm256_min_epu8(res_out_r01, clip_pixel);            \
  |  |  205|  7.67k|  res_out_row01 = _mm256_max_epu8(res_out_r01, zero);                          \
  |  |  206|  7.67k|  __m128i low_128 = CAST_LOW(res_out_row01);                                   \
  |  |  ------------------
  |  |  |  |   22|  7.67k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  |  |  ------------------
  |  |  207|  7.67k|  __m128i high_128 = _mm256_extracti128_si256(res_out_row01, 1);               \
  |  |  208|  7.67k|                                                                               \
  |  |  209|  7.67k|  _mm_storeu_si128((__m128i *)&intbuf[i * dst_stride + j / 2],                 \
  |  |  210|  7.67k|                   _mm_unpacklo_epi32(low_128, high_128));                     \
  |  |  211|  7.67k|  _mm_storeu_si128((__m128i *)&intbuf[(i + 1) * dst_stride + j / 2],           \
  |  |  212|  7.67k|                   _mm_unpackhi_epi32(low_128, high_128));
  ------------------
  578|  7.67k|      }
  579|  4.35k|    }
  580|    740|  } else {
  581|  34.6k|    for (int i = 0; i < height; i += 2) {
  ------------------
  |  Branch (581:21): [True: 33.9k, False: 740]
  ------------------
  582|  33.9k|      int filter_offset = 0;
  583|  33.9k|      int remain_col = filtered_length;
  584|  33.9k|      int row_offset = 0;
  585|       |      // To avoid pixel over-read at frame boundary, processing of 32 pixels
  586|       |      // is done using the core loop only if sufficient number of pixels
  587|       |      // required for the load are present. The remaining pixels are processed
  588|       |      // separately.
  589|  97.8k|      for (int j = 0; j <= filtered_length - 32; j += 32) {
  ------------------
  |  Branch (589:23): [True: 72.9k, False: 24.8k]
  ------------------
  590|  72.9k|        if (remain_col == 34 || remain_col == 36) {
  ------------------
  |  Branch (590:13): [True: 5.66k, False: 67.3k]
  |  Branch (590:33): [True: 3.41k, False: 63.9k]
  ------------------
  591|  9.08k|          break;
  592|  9.08k|        }
  593|  63.9k|        PROCESS_RESIZE_X_WD32
  ------------------
  |  |  114|  63.9k|  __m256i row0 = _mm256_loadu_si256(                                           \
  |  |  115|  63.9k|      (__m256i *)&input[i * in_stride + j - filter_offset]);                   \
  |  |  116|  63.9k|  /* b0 b1 ..... b30 b31 */                                                    \
  |  |  117|  63.9k|  __m256i row1 = _mm256_loadu_si256(                                           \
  |  |  118|  63.9k|      (__m256i *)&input[(i + 1) * in_stride + j - filter_offset]);             \
  |  |  119|  63.9k|  /* a0 .... a15 || b0.... b15 */                                              \
  |  |  120|  63.9k|  __m256i r0 = _mm256_permute2x128_si256(row0, row1, 0x20);                    \
  |  |  121|  63.9k|  /* a16 .... a31 || b16 .... b31 */                                           \
  |  |  122|  63.9k|  __m256i r1 = _mm256_permute2x128_si256(row0, row1, 0x31);                    \
  |  |  123|  63.9k|  filter_offset = 3;                                                           \
  |  |  124|  63.9k|                                                                               \
  |  |  125|  63.9k|  /* Pad start pixels to the left, while processing the first pixels in the    \
  |  |  126|  63.9k|   * row. */                                                                   \
  |  |  127|  63.9k|  if (j == 0) {                                                                \
  |  |  ------------------
  |  |  |  Branch (127:7): [True: 29.9k, False: 33.9k]
  |  |  ------------------
  |  |  128|  29.9k|    /* a0 a0 a0 a0 .... a12 || b0 b0 b0 b0 .... b12 */                         \
  |  |  129|  29.9k|    row0 = _mm256_shuffle_epi8(r0, wd32_start_pad_mask);                       \
  |  |  130|  29.9k|    /* a13 a14 a15 a16.....a28 || b13 b14 b15 b16.....b28 */                   \
  |  |  131|  29.9k|    row1 = _mm256_alignr_epi8(r1, r0, 13);                                     \
  |  |  132|  29.9k|    r0 = row0;                                                                 \
  |  |  133|  29.9k|    r1 = row1;                                                                 \
  |  |  134|  29.9k|  }                                                                            \
  |  |  135|  63.9k|  const int is_last_cols32 = (j + 32 == filtered_length);                      \
  |  |  136|  63.9k|  /* Avoid loading extra pixels at frame boundary.*/                           \
  |  |  137|  63.9k|  if (is_last_cols32) row_offset = ROW_OFFSET;                                 \
  |  |  ------------------
  |  |  |  |   20|      0|#define ROW_OFFSET 5
  |  |  ------------------
  |  |  |  Branch (137:7): [True: 0, False: 63.9k]
  |  |  ------------------
  |  |  138|  63.9k|  /* a29 a30 a31 a32 a33 a34 a35 a36 0 0 ....*/                                \
  |  |  139|  63.9k|  __m128i row0_0 = _mm_loadl_epi64(                                            \
  |  |  140|  63.9k|      (__m128i *)&input[i * in_stride + 32 + j - filter_offset - row_offset]); \
  |  |  141|  63.9k|  /* b29 b30 b31 b32 b33 b34 b35 b36 0 0 .... */                               \
  |  |  142|  63.9k|  __m128i row1_0 =                                                             \
  |  |  143|  63.9k|      _mm_loadl_epi64((__m128i *)&input[(i + 1) * in_stride + 32 + j -         \
  |  |  144|  63.9k|                                        filter_offset - row_offset]);          \
  |  |  145|  63.9k|  __m256i r2 = _mm256_permute2x128_si256(                                      \
  |  |  146|  63.9k|      _mm256_castsi128_si256(row0_0), _mm256_castsi128_si256(row1_0), 0x20);   \
  |  |  147|  63.9k|                                                                               \
  |  |  148|  63.9k|  /* Pad end pixels to the right, while processing the last pixels in the      \
  |  |  149|  63.9k|   * row. */                                                                   \
  |  |  150|  63.9k|  if (is_last_cols32) {                                                        \
  |  |  ------------------
  |  |  |  Branch (150:7): [True: 0, False: 63.9k]
  |  |  ------------------
  |  |  151|      0|    r2 = _mm256_shuffle_epi8(_mm256_srli_si256(r2, ROW_OFFSET),                \
  |  |  152|      0|                             wd32_end_pad_mask);                               \
  |  |  153|      0|  }                                                                            \
  |  |  154|  63.9k|                                                                               \
  |  |  155|  63.9k|  /* Process even pixels of the first row  */                                  \
  |  |  156|  63.9k|  /* a0 a0 a0 a0 a1 a2 .... a12 | b0 b0 b0 b0 b1 b2 .... b12 */                \
  |  |  157|  63.9k|  s0[0] = _mm256_alignr_epi8(r1, r0, 0);                                       \
  |  |  158|  63.9k|  /* a0 a0 a1 a2 a3 a4 .... a14 | b0 b0 b1 b2 b3 b4 .... b14 */                \
  |  |  159|  63.9k|  s0[1] = _mm256_alignr_epi8(r1, r0, 2);                                       \
  |  |  160|  63.9k|  /* a1 a2 a3 a4 a5 a6 .... a16 | b1 b2 b3 b4 b5 b6 .... b16 */                \
  |  |  161|  63.9k|  s0[2] = _mm256_alignr_epi8(r1, r0, 4);                                       \
  |  |  162|  63.9k|  /* a3 a4 a5 a6 a7 a8 .... a18 | b3 b4 b5 b6 b7 b8 .... b18 */                \
  |  |  163|  63.9k|  s0[3] = _mm256_alignr_epi8(r1, r0, 6);                                       \
  |  |  164|  63.9k|                                                                               \
  |  |  165|  63.9k|  /* Process even pixels of the second row  */                                 \
  |  |  166|  63.9k|  /* a13 a14 a15 a16  ..... a28 | b13 b14 b15 b16 ..... b28 */                 \
  |  |  167|  63.9k|  s1[0] = _mm256_alignr_epi8(r2, r1, 0);                                       \
  |  |  168|  63.9k|  /* a15 a16 a17 a18  ..... a30 | b15 b16 b17 b18 ..... b30 */                 \
  |  |  169|  63.9k|  s1[1] = _mm256_alignr_epi8(r2, r1, 2);                                       \
  |  |  170|  63.9k|  /* a17 a18 a19 a20  ..... a32 | b17 b18 b19 b20 ..... b32 */                 \
  |  |  171|  63.9k|  s1[2] = _mm256_alignr_epi8(r2, r1, 4);                                       \
  |  |  172|  63.9k|  /* a19 a20 a21 a22  ..... a34 | b19 b20 b21 b22 ..... b34 */                 \
  |  |  173|  63.9k|  s1[3] = _mm256_alignr_epi8(r2, r1, 6);                                       \
  |  |  174|  63.9k|                                                                               \
  |  |  175|  63.9k|  /* The register res_out_0 stores the result of start-16 pixels corresponding \
  |  |  176|  63.9k|   * to the first and second rows whereas res_out_1 stores the end-16          \
  |  |  177|  63.9k|   * pixels. */                                                                \
  |  |  178|  63.9k|  __m256i res_out_0[2], res_out_1[2];                                          \
  |  |  179|  63.9k|  res_out_1[0] = res_out_1[1] = zero;                                          \
  |  |  180|  63.9k|  res_out_0[0] = res_out_0[1] = zero;                                          \
  |  |  181|  63.9k|  resize_convolve(s0, coeffs_x, res_out_0);                                    \
  |  |  182|  63.9k|  resize_convolve(s1, coeffs_x, res_out_1);                                    \
  |  |  183|  63.9k|                                                                               \
  |  |  184|  63.9k|  /* Result of 32 pixels of row0 (a0 to a32) */                                \
  |  |  185|  63.9k|  res_out_0[0] = _mm256_sra_epi32(                                             \
  |  |  186|  63.9k|      _mm256_add_epi32(res_out_0[0], round_const_bits), round_shift_bits);     \
  |  |  187|  63.9k|  res_out_1[0] = _mm256_sra_epi32(                                             \
  |  |  188|  63.9k|      _mm256_add_epi32(res_out_1[0], round_const_bits), round_shift_bits);     \
  |  |  189|  63.9k|  /* r00-r03 r08-r011 | r04-r07 r012-r015 */                                   \
  |  |  190|  63.9k|  __m256i res_out_r0 = _mm256_packus_epi32(res_out_0[0], res_out_1[0]);        \
  |  |  191|  63.9k|                                                                               \
  |  |  192|  63.9k|  /* Result of 32 pixels of row1 (b0 to b32) */                                \
  |  |  193|  63.9k|  res_out_0[1] = _mm256_sra_epi32(                                             \
  |  |  194|  63.9k|      _mm256_add_epi32(res_out_0[1], round_const_bits), round_shift_bits);     \
  |  |  195|  63.9k|  res_out_1[1] = _mm256_sra_epi32(                                             \
  |  |  196|  63.9k|      _mm256_add_epi32(res_out_1[1], round_const_bits), round_shift_bits);     \
  |  |  197|  63.9k|  /* r10-r13 r18-r111 | r14-r17 r112-r115 */                                   \
  |  |  198|  63.9k|  __m256i res_out_r1 = _mm256_packus_epi32(res_out_0[1], res_out_1[1]);        \
  |  |  199|  63.9k|                                                                               \
  |  |  200|  63.9k|  /* Convert the result from 16bit to 8bit */                                  \
  |  |  201|  63.9k|  /* r00-r03 r08-r011 r10-r13 r18-r111 | r04-r07 r012-r015 r14-r17 r112-r115   \
  |  |  202|  63.9k|   */                                                                          \
  |  |  203|  63.9k|  __m256i res_out_r01 = _mm256_packus_epi16(res_out_r0, res_out_r1);           \
  |  |  204|  63.9k|  __m256i res_out_row01 = _mm256_min_epu8(res_out_r01, clip_pixel);            \
  |  |  205|  63.9k|  res_out_row01 = _mm256_max_epu8(res_out_r01, zero);                          \
  |  |  206|  63.9k|  __m128i low_128 = CAST_LOW(res_out_row01);                                   \
  |  |  ------------------
  |  |  |  |   22|  63.9k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  |  |  ------------------
  |  |  207|  63.9k|  __m128i high_128 = _mm256_extracti128_si256(res_out_row01, 1);               \
  |  |  208|  63.9k|                                                                               \
  |  |  209|  63.9k|  _mm_storeu_si128((__m128i *)&intbuf[i * dst_stride + j / 2],                 \
  |  |  210|  63.9k|                   _mm_unpacklo_epi32(low_128, high_128));                     \
  |  |  211|  63.9k|  _mm_storeu_si128((__m128i *)&intbuf[(i + 1) * dst_stride + j / 2],           \
  |  |  212|  63.9k|                   _mm_unpackhi_epi32(low_128, high_128));
  ------------------
  594|  63.9k|        remain_col -= 32;
  595|  63.9k|      }
  596|       |
  597|  33.9k|      int wd_processed = filtered_length - remain_col;
  598|       |      // To avoid pixel over-read at frame boundary, processing of 16 pixels
  599|       |      // is done only if sufficient number of pixels required for the
  600|       |      // load are present. The remaining pixels are processed separately.
  601|  33.9k|      if (remain_col > 15 && remain_col != 18 && remain_col != 20) {
  ------------------
  |  Branch (601:11): [True: 22.7k, False: 11.1k]
  |  Branch (601:30): [True: 20.4k, False: 2.38k]
  |  Branch (601:50): [True: 18.6k, False: 1.78k]
  ------------------
  602|  18.6k|        remain_col = filtered_length - wd_processed - 16;
  603|  18.6k|        const int in_idx = i * in_stride + wd_processed;
  604|  18.6k|        const int out_idx = (i * dst_stride) + wd_processed / 2;
  605|       |        // a0 a1 --- a15
  606|  18.6k|        __m128i row0 =
  607|  18.6k|            _mm_loadu_si128((__m128i *)&input[in_idx - filter_offset]);
  608|       |        // b0 b1 --- b15
  609|  18.6k|        __m128i row1 = _mm_loadu_si128(
  610|  18.6k|            (__m128i *)&input[in_idx + in_stride - filter_offset]);
  611|       |        // a0 a1 --- a15 || b0 b1 --- b15
  612|  18.6k|        __m256i r0 =
  613|  18.6k|            _mm256_permute2x128_si256(CAST_HI(row0), CAST_HI(row1), 0x20);
  614|  18.6k|        if (filter_offset == 0) {
  ------------------
  |  Branch (614:13): [True: 3.96k, False: 14.6k]
  ------------------
  615|  3.96k|          r0 = _mm256_shuffle_epi8(r0, wd32_start_pad_mask);
  616|  3.96k|        }
  617|  18.6k|        filter_offset = 3;
  618|  18.6k|        const int is_last_cols16 = wd_processed + 16 == filtered_length;
  619|  18.6k|        if (is_last_cols16) row_offset = ROW_OFFSET;
  ------------------
  |  |   20|  2.17k|#define ROW_OFFSET 5
  ------------------
  |  Branch (619:13): [True: 2.17k, False: 16.4k]
  ------------------
  620|       |
  621|       |        // a16 a17 --- a23
  622|  18.6k|        row0 = _mm_loadl_epi64(
  623|  18.6k|            (__m128i *)&input[in_idx + 16 - row_offset - filter_offset]);
  624|       |        // b16 b17 --- b23
  625|  18.6k|        row1 = _mm_loadl_epi64((__m128i *)&input[in_idx + 16 + in_stride -
  626|  18.6k|                                                 row_offset - filter_offset]);
  627|       |
  628|       |        // a16-a23 x x x x| b16-b23 x x x x
  629|  18.6k|        __m256i r1 =
  630|  18.6k|            _mm256_permute2x128_si256(CAST_HI(row0), CAST_HI(row1), 0x20);
  631|       |
  632|       |        // Pad end pixels to the right, while processing the last pixels in the
  633|       |        // row.
  634|  18.6k|        if (is_last_cols16) {
  ------------------
  |  Branch (634:13): [True: 2.17k, False: 16.4k]
  ------------------
  635|  2.17k|          r1 = _mm256_shuffle_epi8(_mm256_srli_si256(r1, ROW_OFFSET),
  636|  2.17k|                                   wd32_end_pad_mask);
  637|  2.17k|        }
  638|       |
  639|       |        // a0 a1 --- a15 || b0 b1 --- b15
  640|  18.6k|        s0[0] = r0;
  641|       |        // a2 a3 --- a17 || b2 b3 --- b17
  642|  18.6k|        s0[1] = _mm256_alignr_epi8(r1, r0, 2);
  643|       |        // a4 a5 --- a19 || b4 b5 --- b19
  644|  18.6k|        s0[2] = _mm256_alignr_epi8(r1, r0, 4);
  645|       |        // a6 a7 --- a21 || b6 b7 --- b21
  646|  18.6k|        s0[3] = _mm256_alignr_epi8(r1, r0, 6);
  647|       |
  648|       |        // result for 16 pixels (a0 to a15) of row0 and row1
  649|  18.6k|        __m256i res_out_0[2];
  650|  18.6k|        res_out_0[0] = res_out_0[1] = zero;
  651|  18.6k|        resize_convolve(s0, coeffs_x, res_out_0);
  652|       |
  653|       |        // r00-r07
  654|  18.6k|        res_out_0[0] = _mm256_sra_epi32(
  655|  18.6k|            _mm256_add_epi32(res_out_0[0], round_const_bits), round_shift_bits);
  656|       |        // r10-r17
  657|  18.6k|        res_out_0[1] = _mm256_sra_epi32(
  658|  18.6k|            _mm256_add_epi32(res_out_0[1], round_const_bits), round_shift_bits);
  659|       |        // r00-r03 r10-r13 r04-r07 r14-r17
  660|  18.6k|        __m256i res_out_row01 = _mm256_packus_epi32(res_out_0[0], res_out_0[1]);
  661|       |        // r00-r03 r10-r13 r00-r03 r10-r13 | r04-r07 r14-r17 r04-r07 r14-r17
  662|  18.6k|        res_out_row01 = _mm256_packus_epi16(res_out_row01, res_out_row01);
  663|  18.6k|        res_out_row01 = _mm256_min_epu8(res_out_row01, clip_pixel);
  664|  18.6k|        res_out_row01 = _mm256_max_epu8(res_out_row01, zero);
  665|       |        // r00-r03 r10-r13 r04-r07 r14-r17
  666|  18.6k|        __m128i low_result =
  667|  18.6k|            CAST_LOW(_mm256_permute4x64_epi64(res_out_row01, 0xd8));
  ------------------
  |  |   22|  18.6k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  668|       |        // r00-r03 r04-r07 r10-r13 r14-r17
  669|  18.6k|        low_result = _mm_shuffle_epi32(low_result, 0xd8);
  670|       |
  671|  18.6k|        _mm_storel_epi64((__m128i *)&intbuf[out_idx], low_result);
  672|  18.6k|        _mm_storel_epi64((__m128i *)&intbuf[out_idx + dst_stride],
  673|  18.6k|                         _mm_unpackhi_epi64(low_result, low_result));
  674|  18.6k|      }
  675|       |
  676|       |      // To avoid pixel over-read at frame boundary, processing of 8 pixels
  677|       |      // is done only if sufficient number of pixels required for the
  678|       |      // load are present. The remaining pixels are processed by C function.
  679|  33.9k|      wd_processed = filtered_length - remain_col;
  680|  33.9k|      if (remain_col > 7 && remain_col != 10 && remain_col != 12) {
  ------------------
  |  Branch (680:11): [True: 26.6k, False: 7.29k]
  |  Branch (680:29): [True: 23.5k, False: 3.02k]
  |  Branch (680:49): [True: 20.1k, False: 3.40k]
  ------------------
  681|  20.1k|        remain_col = filtered_length - wd_processed - 8;
  682|  20.1k|        const int in_idx = i * in_stride + wd_processed - filter_offset;
  683|  20.1k|        const int out_idx = (i * dst_stride) + wd_processed / 2;
  684|  20.1k|        const int is_last_cols_8 = wd_processed + 8 == filtered_length;
  685|  20.1k|        if (is_last_cols_8) row_offset = ROW_OFFSET;
  ------------------
  |  |   20|  3.93k|#define ROW_OFFSET 5
  ------------------
  |  Branch (685:13): [True: 3.93k, False: 16.2k]
  ------------------
  686|       |        // a0 a1 --- a15
  687|  20.1k|        __m128i row0 = _mm_loadu_si128((__m128i *)&input[in_idx - row_offset]);
  688|       |        // b0 b1 --- b15
  689|  20.1k|        __m128i row1 =
  690|  20.1k|            _mm_loadu_si128((__m128i *)&input[in_idx + in_stride - row_offset]);
  691|       |        // a0 a1 --- a15 || b0 b1 --- b15
  692|  20.1k|        __m256i r0 =
  693|  20.1k|            _mm256_permute2x128_si256(CAST_HI(row0), CAST_HI(row1), 0x20);
  694|       |
  695|       |        // Pad end pixels to the right, while processing the last pixels in the
  696|       |        // row.
  697|  20.1k|        if (is_last_cols_8)
  ------------------
  |  Branch (697:13): [True: 3.93k, False: 16.2k]
  ------------------
  698|  3.93k|          r0 = _mm256_shuffle_epi8(_mm256_srli_si256(r0, ROW_OFFSET),
  699|  3.93k|                                   wd8_end_pad_mask);
  700|       |
  701|       |        // a0 a1 a2 a3 a4 a5 a6 a7 | b0 b1 b2 b3 b4 b5 b6 b7
  702|  20.1k|        s0[0] = r0;
  703|       |        // a2 a3 a4 a5 a6 a7 a8 a9 | b2 b3 b4 b5 b6 b7 b8 b9
  704|  20.1k|        s0[1] = _mm256_bsrli_epi128(r0, 2);
  705|       |        // a4 a5 a6 a7 a8 a9 a10 a10 |  b4 b5 b6 b7 b8 b9 b10 b10
  706|  20.1k|        s0[2] = _mm256_bsrli_epi128(r0, 4);
  707|       |        // a6 a7 a8 a9 a10 a10 a10 a10 | b6 b7 b8 b9 b10 b10 b10 b10
  708|  20.1k|        s0[3] = _mm256_bsrli_epi128(r0, 6);
  709|       |
  710|  20.1k|        __m256i res_out_0[2];
  711|  20.1k|        res_out_0[0] = res_out_0[1] = zero;
  712|  20.1k|        resize_convolve(s0, coeffs_x, res_out_0);
  713|       |
  714|       |        // r00 - r03 | r10 - r13
  715|  20.1k|        __m256i res_out =
  716|  20.1k|            _mm256_permute2x128_si256(res_out_0[0], res_out_0[1], 0x20);
  717|       |        // r00 - r03 | r10 - r13
  718|  20.1k|        res_out = _mm256_sra_epi32(_mm256_add_epi32(res_out, round_const_bits),
  719|  20.1k|                                   round_shift_bits);
  720|       |        // r00-r03 r00-r03 r10-r13 r10-r13
  721|  20.1k|        __m256i res_out_row01 = _mm256_packus_epi32(res_out, res_out);
  722|       |        // r00-r03 r00-r03 r00-r03 r00-r03 r10-r13 r10-r13 r10-r13 r10-r13
  723|  20.1k|        res_out_row01 = _mm256_packus_epi16(res_out_row01, res_out_row01);
  724|  20.1k|        res_out_row01 = _mm256_min_epu8(res_out_row01, clip_pixel);
  725|  20.1k|        res_out_row01 = _mm256_max_epu8(res_out_row01, zero);
  726|       |
  727|  20.1k|        xx_storel_32(intbuf + out_idx, CAST_LOW(res_out_row01));
  ------------------
  |  |   22|  20.1k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  728|  20.1k|        xx_storel_32(intbuf + out_idx + dst_stride,
  729|  20.1k|                     _mm256_extracti128_si256(res_out_row01, 1));
  730|  20.1k|      }
  731|       |
  732|  33.9k|      wd_processed = filtered_length - remain_col;
  733|  33.9k|      if (remain_col) {
  ------------------
  |  Branch (733:11): [True: 27.8k, False: 6.10k]
  ------------------
  734|  27.8k|        const int in_idx = (in_stride * i);
  735|  27.8k|        const int out_idx = (wd_processed / 2) + width2 * i;
  736|       |
  737|  27.8k|        down2_symeven(input + in_idx, filtered_length, intbuf + out_idx,
  738|  27.8k|                      wd_processed);
  739|  27.8k|        down2_symeven(input + in_idx + in_stride, filtered_length,
  740|  27.8k|                      intbuf + out_idx + width2, wd_processed);
  741|  27.8k|      }
  742|  33.9k|    }
  743|    740|  }
  744|    850|}
resize_avx2.c:prepare_filter_coeffs:
  238|  1.70k|                                         __m256i *const coeffs /* [4] */) {
  239|       |  // f0 f1 f2 f3 x x x x
  240|  1.70k|  const __m128i sym_even_filter = _mm_loadl_epi64((__m128i *)filter);
  241|       |  // f0 f1 f2 f3 f0 f1 f2 f3
  242|  1.70k|  const __m128i tmp0 = _mm_shuffle_epi32(sym_even_filter, 0x44);
  243|       |  // f0 f1 f2 f3 f1 f0 f3 f2
  244|  1.70k|  const __m128i tmp1 = _mm_shufflehi_epi16(tmp0, 0xb1);
  245|       |
  246|  1.70k|  const __m128i filter_8bit = _mm_packs_epi16(tmp1, tmp1);
  247|       |
  248|       |  // f0 f1 f0 f1 ..
  249|  1.70k|  coeffs[2] = _mm256_broadcastw_epi16(filter_8bit);
  250|       |  // f2 f3 f2 f3 ..
  251|  1.70k|  coeffs[3] = _mm256_broadcastw_epi16(_mm_bsrli_si128(filter_8bit, 2));
  252|       |  // f3 f2 f3 f2 ..
  253|  1.70k|  coeffs[0] = _mm256_broadcastw_epi16(_mm_bsrli_si128(filter_8bit, 6));
  254|       |  // f1 f0 f1 f0 ..
  255|       |  coeffs[1] = _mm256_broadcastw_epi16(_mm_bsrli_si128(filter_8bit, 4));
  256|  1.70k|}
resize_avx2.c:resize_convolve:
  216|   270k|                                   __m256i *res_out) {
  217|   270k|  const __m256i res_0 = _mm256_maddubs_epi16(s[0], coeffs[0]);
  218|   270k|  const __m256i res_1 = _mm256_maddubs_epi16(s[1], coeffs[1]);
  219|   270k|  const __m256i res_2 = _mm256_maddubs_epi16(s[2], coeffs[2]);
  220|   270k|  const __m256i res_3 = _mm256_maddubs_epi16(s[3], coeffs[3]);
  221|       |
  222|   270k|  const __m256i dst_0 = _mm256_add_epi16(res_0, res_1);
  223|   270k|  const __m256i dst_1 = _mm256_add_epi16(res_2, res_3);
  224|       |  // The sum of convolve operation crosses signed 16bit. Hence, the addition
  225|       |  // should happen in 32bit.
  226|   270k|  const __m256i dst_00 = _mm256_cvtepi16_epi32(CAST_LOW(dst_0));
  ------------------
  |  |   22|   270k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  227|   270k|  const __m256i dst_01 =
  228|   270k|      _mm256_cvtepi16_epi32(_mm256_extracti128_si256(dst_0, 1));
  229|   270k|  const __m256i dst_10 = _mm256_cvtepi16_epi32(CAST_LOW(dst_1));
  ------------------
  |  |   22|   270k|#define CAST_LOW(x) _mm256_castsi256_si128(x)
  ------------------
  230|   270k|  const __m256i dst_11 =
  231|   270k|      _mm256_cvtepi16_epi32(_mm256_extracti128_si256(dst_1, 1));
  232|       |
  233|   270k|  res_out[0] = _mm256_add_epi32(dst_00, dst_10);
  234|   270k|  res_out[1] = _mm256_add_epi32(dst_01, dst_11);
  235|   270k|}

av1_resize_and_extend_frame_ssse3:
  834|  4.21k|                                       const int phase, const int num_planes) {
  835|  4.21k|  bool has_normative_scaler =
  836|  4.21k|      has_normative_scaler_ssse3(src->y_crop_width, src->y_crop_height,
  837|  4.21k|                                 dst->y_crop_width, dst->y_crop_height, phase);
  838|       |
  839|  4.21k|  if (num_planes > 1) {
  ------------------
  |  Branch (839:7): [True: 1.27k, False: 2.93k]
  ------------------
  840|  1.27k|    has_normative_scaler = has_normative_scaler &&
  ------------------
  |  Branch (840:28): [True: 501, False: 776]
  ------------------
  841|    501|                           has_normative_scaler_ssse3(
  ------------------
  |  Branch (841:28): [True: 501, False: 0]
  ------------------
  842|    501|                               src->uv_crop_width, src->uv_crop_height,
  843|    501|                               dst->uv_crop_width, dst->uv_crop_height, phase);
  844|  1.27k|  }
  845|       |
  846|  4.21k|  if (!has_normative_scaler) {
  ------------------
  |  Branch (846:7): [True: 2.39k, False: 1.82k]
  ------------------
  847|  2.39k|    av1_resize_and_extend_frame_c(src, dst, filter, phase, num_planes);
  848|  2.39k|    return;
  849|  2.39k|  }
  850|       |
  851|       |  // We use AOMMIN(num_planes, MAX_MB_PLANE) instead of num_planes to quiet
  852|       |  // the static analysis warnings.
  853|  1.82k|  int malloc_failed = 0;
  854|  4.64k|  for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); ++i) {
  ------------------
  |  |   34|  4.64k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.63k, False: 2.00k]
  |  |  ------------------
  ------------------
  |  Branch (854:19): [True: 2.82k, False: 1.82k]
  ------------------
  855|  2.82k|    const int is_uv = i > 0;
  856|  2.82k|    const int src_w = src->crop_widths[is_uv];
  857|  2.82k|    const int src_h = src->crop_heights[is_uv];
  858|  2.82k|    const int src_y_w = (src->crop_widths[0] + 1) & ~1;
  859|  2.82k|    const int dst_w = dst->crop_widths[is_uv];
  860|  2.82k|    const int dst_h = dst->crop_heights[is_uv];
  861|  2.82k|    const int dst_y_w = (dst->crop_widths[0] + 1) & ~1;
  862|  2.82k|    const int dst_y_h = (dst->crop_heights[0] + 1) & ~1;
  863|       |
  864|  2.82k|    if (2 * dst_w == src_w && 2 * dst_h == src_h) {
  ------------------
  |  Branch (864:9): [True: 904, False: 1.91k]
  |  Branch (864:31): [True: 904, False: 0]
  ------------------
  865|       |      // 2 to 1
  866|    904|      if (phase == 0) {
  ------------------
  |  Branch (866:11): [True: 0, False: 904]
  ------------------
  867|      0|        scale_plane_2_to_1_phase_0(src->buffers[i], src->strides[is_uv],
  868|      0|                                   dst->buffers[i], dst->strides[is_uv], dst_w,
  869|      0|                                   dst_h);
  870|    904|      } else if (filter == BILINEAR) {
  ------------------
  |  Branch (870:18): [True: 0, False: 904]
  ------------------
  871|      0|        const int16_t c0 = av1_bilinear_filters[phase][3];
  872|      0|        const int16_t c1 = av1_bilinear_filters[phase][4];
  873|      0|        const __m128i c0c1 = _mm_set1_epi16(c0 | (c1 << 8));  // c0 and c1 >= 0
  874|      0|        scale_plane_2_to_1_bilinear(src->buffers[i], src->strides[is_uv],
  875|      0|                                    dst->buffers[i], dst->strides[is_uv], dst_w,
  876|      0|                                    dst_h, c0c1);
  877|    904|      } else {
  878|    904|        const int buffer_stride = (dst_y_w + 3) & ~3;
  879|    904|        const int buffer_height = (2 * dst_y_h + SUBPEL_TAPS - 2 + 7) & ~7;
  ------------------
  |  |   26|    904|#define SUBPEL_TAPS 8
  ------------------
  880|    904|        uint8_t *const temp_buffer =
  881|    904|            (uint8_t *)malloc(buffer_stride * buffer_height);
  882|    904|        if (!temp_buffer) {
  ------------------
  |  Branch (882:13): [True: 0, False: 904]
  ------------------
  883|      0|          malloc_failed = 1;
  884|      0|          break;
  885|      0|        }
  886|    904|        const InterpKernel *interp_kernel =
  887|    904|            (const InterpKernel *)av1_interp_filter_params_list[filter]
  888|    904|                .filter_ptr;
  889|    904|        scale_plane_2_to_1_general(src->buffers[i], src->strides[is_uv],
  890|    904|                                   dst->buffers[i], dst->strides[is_uv], dst_w,
  891|    904|                                   dst_h, interp_kernel[phase], temp_buffer);
  892|    904|        free(temp_buffer);
  893|    904|      }
  894|  1.91k|    } else if (4 * dst_w == src_w && 4 * dst_h == src_h) {
  ------------------
  |  Branch (894:16): [True: 604, False: 1.31k]
  |  Branch (894:38): [True: 604, False: 0]
  ------------------
  895|       |      // 4 to 1
  896|    604|      if (phase == 0) {
  ------------------
  |  Branch (896:11): [True: 0, False: 604]
  ------------------
  897|      0|        scale_plane_4_to_1_phase_0(src->buffers[i], src->strides[is_uv],
  898|      0|                                   dst->buffers[i], dst->strides[is_uv], dst_w,
  899|      0|                                   dst_h);
  900|    604|      } else if (filter == BILINEAR) {
  ------------------
  |  Branch (900:18): [True: 0, False: 604]
  ------------------
  901|      0|        const int16_t c0 = av1_bilinear_filters[phase][3];
  902|      0|        const int16_t c1 = av1_bilinear_filters[phase][4];
  903|      0|        const __m128i c0c1 = _mm_set1_epi16(c0 | (c1 << 8));  // c0 and c1 >= 0
  904|      0|        scale_plane_4_to_1_bilinear(src->buffers[i], src->strides[is_uv],
  905|      0|                                    dst->buffers[i], dst->strides[is_uv], dst_w,
  906|      0|                                    dst_h, c0c1);
  907|    604|      } else {
  908|    604|        const int buffer_stride = (dst_y_w + 1) & ~1;
  909|    604|        const int buffer_height = (4 * dst_y_h + SUBPEL_TAPS - 2 + 7) & ~7;
  ------------------
  |  |   26|    604|#define SUBPEL_TAPS 8
  ------------------
  910|       |        // When dst_w is 1 or 2, we need extra padding to avoid heap read
  911|       |        // overflow
  912|    604|        const int extra_padding = 16;
  913|    604|        uint8_t *const temp_buffer =
  914|    604|            (uint8_t *)malloc(buffer_stride * buffer_height + extra_padding);
  915|    604|        if (!temp_buffer) {
  ------------------
  |  Branch (915:13): [True: 0, False: 604]
  ------------------
  916|      0|          malloc_failed = 1;
  917|      0|          break;
  918|      0|        }
  919|    604|        const InterpKernel *interp_kernel =
  920|    604|            (const InterpKernel *)av1_interp_filter_params_list[filter]
  921|    604|                .filter_ptr;
  922|    604|        scale_plane_4_to_1_general(src->buffers[i], src->strides[is_uv],
  923|    604|                                   dst->buffers[i], dst->strides[is_uv], dst_w,
  924|    604|                                   dst_h, interp_kernel[phase], temp_buffer);
  925|    604|        free(temp_buffer);
  926|    604|      }
  927|  1.31k|    } else if (4 * dst_w == 3 * src_w && 4 * dst_h == 3 * src_h) {
  ------------------
  |  Branch (927:16): [True: 1.31k, False: 0]
  |  Branch (927:42): [True: 1.31k, False: 0]
  ------------------
  928|       |      // 4 to 3
  929|  1.31k|      const int buffer_stride_hor = (dst_y_w + 5) - ((dst_y_w + 5) % 6) + 2;
  930|  1.31k|      const int buffer_stride_ver = (dst_y_w + 7) & ~7;
  931|  1.31k|      const int buffer_height = (4 * dst_y_h / 3 + SUBPEL_TAPS - 1 + 7) & ~7;
  ------------------
  |  |   26|  1.31k|#define SUBPEL_TAPS 8
  ------------------
  932|       |      // When the vertical filter reads more pixels than the horizontal filter
  933|       |      // generated in each row, we need extra padding to avoid heap read
  934|       |      // overflow. For example, the horizontal filter generates 18 pixels but
  935|       |      // the vertical filter reads 24 pixels in a row. The difference is
  936|       |      // multiplied by 2 since two rows are interlaced together in the
  937|       |      // optimization.
  938|  1.31k|      const int extra_padding =
  939|  1.31k|          (buffer_stride_ver > buffer_stride_hor)
  ------------------
  |  Branch (939:11): [True: 480, False: 834]
  ------------------
  940|  1.31k|              ? 2 * (buffer_stride_ver - buffer_stride_hor)
  941|  1.31k|              : 0;
  942|  1.31k|      const int buffer_size = buffer_stride_hor * buffer_height + extra_padding;
  943|  1.31k|      uint8_t *const temp_buffer = (uint8_t *)malloc(buffer_size);
  944|  1.31k|      if (!temp_buffer) {
  ------------------
  |  Branch (944:11): [True: 0, False: 1.31k]
  ------------------
  945|      0|        malloc_failed = 1;
  946|      0|        break;
  947|      0|      }
  948|  1.31k|      const InterpKernel *interp_kernel =
  949|  1.31k|          (const InterpKernel *)av1_interp_filter_params_list[filter]
  950|  1.31k|              .filter_ptr;
  951|  1.31k|      scale_plane_4_to_3_general(src->buffers[i], src->strides[is_uv],
  952|  1.31k|                                 dst->buffers[i], dst->strides[is_uv], dst_w,
  953|  1.31k|                                 dst_h, interp_kernel, phase, temp_buffer);
  954|  1.31k|      free(temp_buffer);
  955|  1.31k|    } else {
  956|      0|      assert(dst_w == src_w * 2 && dst_h == src_h * 2 && phase == 0 &&
  957|      0|             src_w % 8 == 0);
  958|       |      // 1 to 2, phase 0, src_w a multiple of 8
  959|      0|      uint8_t *const temp_buffer = (uint8_t *)malloc(8 * ((src_y_w + 7) & ~7));
  960|      0|      if (!temp_buffer) {
  ------------------
  |  Branch (960:11): [True: 0, False: 0]
  ------------------
  961|      0|        malloc_failed = 1;
  962|      0|        break;
  963|      0|      }
  964|      0|      const InterpKernel *interp_kernel =
  965|      0|          (const InterpKernel *)av1_interp_filter_params_list[filter]
  966|      0|              .filter_ptr;
  967|      0|      scale_plane_1_to_2_phase_0(src->buffers[i], src->strides[is_uv],
  968|      0|                                 dst->buffers[i], dst->strides[is_uv], src_w,
  969|      0|                                 src_h, interp_kernel[8], temp_buffer);
  970|      0|      free(temp_buffer);
  971|      0|    }
  972|  2.82k|  }
  973|       |
  974|  1.82k|  if (malloc_failed) {
  ------------------
  |  Branch (974:7): [True: 0, False: 1.82k]
  ------------------
  975|      0|    av1_resize_and_extend_frame_c(src, dst, filter, phase, num_planes);
  976|  1.82k|  } else {
  977|  1.82k|    aom_extend_frame_borders(dst, num_planes);
  ------------------
  |  |   31|  1.82k|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
  978|  1.82k|  }
  979|  1.82k|}
resize_ssse3.c:has_normative_scaler_ssse3:
  820|  4.71k|                                              const int phase) {
  821|  4.71k|  const bool has_normative_scaler =
  822|  4.71k|      (2 * dst_width == src_width && 2 * dst_height == src_height) ||
  ------------------
  |  Branch (822:8): [True: 1.04k, False: 3.66k]
  |  Branch (822:38): [True: 731, False: 317]
  ------------------
  823|  3.98k|      (4 * dst_width == src_width && 4 * dst_height == src_height) ||
  ------------------
  |  Branch (823:8): [True: 883, False: 3.10k]
  |  Branch (823:38): [True: 483, False: 400]
  ------------------
  824|  3.50k|      (4 * dst_width == 3 * src_width && 4 * dst_height == 3 * src_height) ||
  ------------------
  |  Branch (824:8): [True: 1.10k, False: 2.39k]
  |  Branch (824:42): [True: 1.10k, False: 0]
  ------------------
  825|  2.39k|      (dst_width == src_width * 2 && dst_height == src_height * 2 &&
  ------------------
  |  Branch (825:8): [True: 630, False: 1.76k]
  |  Branch (825:38): [True: 159, False: 471]
  ------------------
  826|    159|       phase == 0 && src_width % 8 == 0);
  ------------------
  |  Branch (826:8): [True: 0, False: 159]
  |  Branch (826:22): [True: 0, False: 0]
  ------------------
  827|       |
  828|  4.71k|  return has_normative_scaler;
  829|  4.71k|}
resize_ssse3.c:scale_plane_2_to_1_general:
  391|    904|                                       uint8_t *const temp_buffer) {
  392|    904|  const int width_hor = (w + 3) & ~3;
  393|    904|  const int width_ver = (w + 7) & ~7;
  394|    904|  const int height_hor = (2 * h + SUBPEL_TAPS - 2 + 7) & ~7;
  ------------------
  |  |   26|    904|#define SUBPEL_TAPS 8
  ------------------
  395|    904|  const int height_ver = (h + 3) & ~3;
  396|    904|  int x, y = height_hor;
  397|    904|  uint8_t *t = temp_buffer;
  398|    904|  __m128i s[11], d[4];
  399|    904|  __m128i f[4];
  400|       |
  401|    904|  assert(w && h);
  402|       |
  403|    904|  shuffle_filter_ssse3(coef, f);
  404|    904|  src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 + 1;
  ------------------
  |  |   26|    904|#define SUBPEL_TAPS 8
  ------------------
                src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 + 1;
  ------------------
  |  |   26|    904|#define SUBPEL_TAPS 8
  ------------------
  405|       |
  406|       |  // horizontal 4x8
  407|  5.58k|  do {
  408|  5.58k|    load_8bit_8x8(src + 2, src_stride, s);
  409|       |    // 00 01 10 11 20 21 30 31  40 41 50 51 60 61 70 71
  410|       |    // 02 03 12 13 22 23 32 33  42 43 52 53 62 63 72 73
  411|       |    // 04 05 14 15 24 25 34 35  44 45 54 55 64 65 74 75
  412|       |    // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77 (overlapped)
  413|  5.58k|    transpose_16bit_4x8(s, s);
  414|  5.58k|    x = width_hor;
  415|       |
  416|  71.7k|    do {
  417|  71.7k|      src += 8;
  418|  71.7k|      load_8bit_8x8(src, src_stride, &s[3]);
  419|       |      // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77
  420|       |      // 08 09 18 19 28 29 38 39  48 49 58 59 68 69 78 79
  421|       |      // 0A 0B 1A 1B 2A 2B 3A 3B  4A 4B 5A 5B 6A 6B 7A 7B
  422|       |      // 0C 0D 1C 1D 2C 2D 3C 3D  4C 4D 5C 5D 6C 6D 7C 7D
  423|  71.7k|      transpose_16bit_4x8(&s[3], &s[3]);
  424|       |
  425|  71.7k|      d[0] = convolve8_8_ssse3(&s[0], f);  // 00 10 20 30 40 50 60 70
  426|  71.7k|      d[1] = convolve8_8_ssse3(&s[1], f);  // 01 11 21 31 41 51 61 71
  427|  71.7k|      d[2] = convolve8_8_ssse3(&s[2], f);  // 02 12 22 32 42 52 62 72
  428|  71.7k|      d[3] = convolve8_8_ssse3(&s[3], f);  // 03 13 23 33 43 53 63 73
  429|       |
  430|       |      // 00 10 20 30 40 50 60 70  02 12 22 32 42 52 62 72
  431|       |      // 01 11 21 31 41 51 61 71  03 13 23 33 43 53 63 73
  432|  71.7k|      d[0] = _mm_packus_epi16(d[0], d[2]);
  433|  71.7k|      d[1] = _mm_packus_epi16(d[1], d[3]);
  434|       |      // 00 10 01 11 20 30 21 31  40 50 41 51 60 70 61 71
  435|       |      // 02 12 03 13 22 32 23 33  42 52 43 53 62 72 63 73
  436|  71.7k|      d[2] = _mm_unpacklo_epi16(d[0], d[1]);
  437|  71.7k|      d[3] = _mm_unpackhi_epi16(d[0], d[1]);
  438|       |      // 00 10 01 11 02 12 03 13  20 30 21 31 22 32 23 33
  439|       |      // 40 50 41 51 42 52 43 53  60 70 61 71 62 72 63 73
  440|  71.7k|      d[0] = _mm_unpacklo_epi32(d[2], d[3]);
  441|  71.7k|      d[1] = _mm_unpackhi_epi32(d[2], d[3]);
  442|  71.7k|      store_8bit_8x4_from_16x2(d, t, 2 * width_hor);
  443|       |
  444|  71.7k|      s[0] = s[4];
  445|  71.7k|      s[1] = s[5];
  446|  71.7k|      s[2] = s[6];
  447|       |
  448|  71.7k|      t += 8;
  449|  71.7k|      x -= 4;
  450|  71.7k|    } while (x);
  ------------------
  |  Branch (450:14): [True: 66.1k, False: 5.58k]
  ------------------
  451|  5.58k|    src += 8 * src_stride - 2 * width_hor;
  452|  5.58k|    t += 6 * width_hor;
  453|  5.58k|    y -= 8;
  454|  5.58k|  } while (y);
  ------------------
  |  Branch (454:12): [True: 4.68k, False: 904]
  ------------------
  455|       |
  456|       |  // vertical 8x4
  457|    904|  x = width_ver;
  458|    904|  t = temp_buffer;
  459|  3.16k|  do {
  460|       |    // 00 10 01 11 02 12 03 13  04 14 05 15 06 16 07 17
  461|       |    // 20 30 21 31 22 32 23 33  24 34 25 35 26 36 27 37
  462|       |    // 40 50 41 51 42 52 43 53  44 54 45 55 46 56 47 57
  463|  3.16k|    s[0] = _mm_loadu_si128((const __m128i *)(t + 0 * width_hor));
  464|  3.16k|    s[1] = _mm_loadu_si128((const __m128i *)(t + 2 * width_hor));
  465|  3.16k|    s[2] = _mm_loadu_si128((const __m128i *)(t + 4 * width_hor));
  466|  3.16k|    t += 6 * width_hor;
  467|  3.16k|    y = height_ver;
  468|       |
  469|  34.6k|    do {
  470|       |      // 60 70 61 71 62 72 63 73  64 74 65 75 66 76 67 77
  471|       |      // 80 90 81 91 82 92 83 93  84 94 85 95 86 96 87 77
  472|       |      // A0 B0 A1 B1 A2 B2 A3 B3  A4 B4 A5 B5 A6 B6 A7 77
  473|       |      // C0 D0 C1 D1 C2 D2 C3 D3  C4 D4 C5 D5 C6 D6 C7 77
  474|  34.6k|      loadu_8bit_16x4(t, 2 * width_hor, &s[3]);
  475|  34.6k|      t += 8 * width_hor;
  476|       |
  477|  34.6k|      d[0] = convolve8_8_ssse3(&s[0], f);  // 00 01 02 03 04 05 06 07
  478|  34.6k|      d[1] = convolve8_8_ssse3(&s[1], f);  // 10 11 12 13 14 15 16 17
  479|  34.6k|      d[2] = convolve8_8_ssse3(&s[2], f);  // 20 21 22 23 24 25 26 27
  480|  34.6k|      d[3] = convolve8_8_ssse3(&s[3], f);  // 30 31 32 33 34 35 36 37
  481|       |
  482|       |      // 00 01 02 03 04 05 06 07  10 11 12 13 14 15 16 17
  483|       |      // 20 21 22 23 24 25 26 27  30 31 32 33 34 35 36 37
  484|  34.6k|      d[0] = _mm_packus_epi16(d[0], d[1]);
  485|  34.6k|      d[1] = _mm_packus_epi16(d[2], d[3]);
  486|  34.6k|      store_8bit_8x4_from_16x2(d, dst, dst_stride);
  487|       |
  488|  34.6k|      s[0] = s[4];
  489|  34.6k|      s[1] = s[5];
  490|  34.6k|      s[2] = s[6];
  491|       |
  492|  34.6k|      dst += 4 * dst_stride;
  493|  34.6k|      y -= 4;
  494|  34.6k|    } while (y);
  ------------------
  |  Branch (494:14): [True: 31.5k, False: 3.16k]
  ------------------
  495|  3.16k|    t -= width_hor * (2 * height_ver + 6);
  496|  3.16k|    t += 16;
  497|  3.16k|    dst -= height_ver * dst_stride;
  498|  3.16k|    dst += 8;
  499|  3.16k|    x -= 8;
  500|  3.16k|  } while (x);
  ------------------
  |  Branch (500:12): [True: 2.26k, False: 904]
  ------------------
  501|    904|}
resize_ssse3.c:scale_plane_4_to_1_general:
  290|    604|                                       uint8_t *const temp_buffer) {
  291|    604|  const int width_hor = (w + 1) & ~1;
  292|    604|  const int width_ver = (w + 7) & ~7;
  293|    604|  const int height_hor = (4 * h + SUBPEL_TAPS - 2 + 7) & ~7;
  ------------------
  |  |   26|    604|#define SUBPEL_TAPS 8
  ------------------
  294|    604|  const int height_ver = (h + 1) & ~1;
  295|    604|  int x, y = height_hor;
  296|    604|  uint8_t *t = temp_buffer;
  297|    604|  __m128i s[11], d[4];
  298|    604|  __m128i f[4];
  299|       |
  300|    604|  assert(w && h);
  301|       |
  302|    604|  shuffle_filter_ssse3(coef, f);
  303|    604|  src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 + 3;
  ------------------
  |  |   26|    604|#define SUBPEL_TAPS 8
  ------------------
                src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 + 3;
  ------------------
  |  |   26|    604|#define SUBPEL_TAPS 8
  ------------------
  304|       |
  305|       |  // horizontal 2x8
  306|  3.18k|  do {
  307|  3.18k|    load_8bit_8x8(src + 4, src_stride, s);
  308|       |    // 00 01 10 11 20 21 30 31  40 41 50 51 60 61 70 71
  309|       |    // 02 03 12 13 22 23 32 33  42 43 52 53 62 63 72 73
  310|       |    // 04 05 14 15 24 25 34 35  44 45 54 55 64 65 74 75 (overlapped)
  311|       |    // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77 (overlapped)
  312|  3.18k|    transpose_16bit_4x8(s, s);
  313|  3.18k|    x = width_hor;
  314|       |
  315|  26.5k|    do {
  316|  26.5k|      src += 8;
  317|  26.5k|      load_8bit_8x8(src, src_stride, &s[2]);
  318|       |      // 04 05 14 15 24 25 34 35  44 45 54 55 64 65 74 75
  319|       |      // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77
  320|       |      // 08 09 18 19 28 29 38 39  48 49 58 59 68 69 78 79
  321|       |      // 0A 0B 1A 1B 2A 2B 3A 3B  4A 4B 5A 5B 6A 6B 7A 7B
  322|  26.5k|      transpose_16bit_4x8(&s[2], &s[2]);
  323|       |
  324|  26.5k|      d[0] = convolve8_8_ssse3(&s[0], f);  // 00 10 20 30 40 50 60 70
  325|  26.5k|      d[1] = convolve8_8_ssse3(&s[2], f);  // 01 11 21 31 41 51 61 71
  326|       |
  327|       |      // 00 10 20 30 40 50 60 70  xx xx xx xx xx xx xx xx
  328|       |      // 01 11 21 31 41 51 61 71  xx xx xx xx xx xx xx xx
  329|  26.5k|      d[0] = _mm_packus_epi16(d[0], d[0]);
  330|  26.5k|      d[1] = _mm_packus_epi16(d[1], d[1]);
  331|       |      // 00 10 01 11 20 30 21 31  40 50 41 51 60 70 61 71
  332|  26.5k|      d[0] = _mm_unpacklo_epi16(d[0], d[1]);
  333|  26.5k|      store_8bit_4x4_sse2(d[0], t, 2 * width_hor);
  334|       |
  335|  26.5k|      s[0] = s[4];
  336|  26.5k|      s[1] = s[5];
  337|       |
  338|  26.5k|      t += 4;
  339|  26.5k|      x -= 2;
  340|  26.5k|    } while (x);
  ------------------
  |  Branch (340:14): [True: 23.3k, False: 3.18k]
  ------------------
  341|  3.18k|    src += 8 * src_stride - 4 * width_hor;
  342|  3.18k|    t += 6 * width_hor;
  343|  3.18k|    y -= 8;
  344|  3.18k|  } while (y);
  ------------------
  |  Branch (344:12): [True: 2.58k, False: 604]
  ------------------
  345|       |
  346|       |  // vertical 8x2
  347|    604|  x = width_ver;
  348|    604|  t = temp_buffer;
  349|    948|  do {
  350|       |    // 00 10 01 11 02 12 03 13  04 14 05 15 06 16 07 17
  351|       |    // 20 30 21 31 22 32 23 33  24 34 25 35 26 36 27 37
  352|    948|    s[0] = _mm_loadu_si128((const __m128i *)(t + 0 * width_hor));
  353|    948|    s[1] = _mm_loadu_si128((const __m128i *)(t + 2 * width_hor));
  354|    948|    t += 4 * width_hor;
  355|    948|    y = height_ver;
  356|       |
  357|  7.38k|    do {
  358|       |      // 40 50 41 51 42 52 43 53  44 54 45 55 46 56 47 57
  359|       |      // 60 70 61 71 62 72 63 73  64 74 65 75 66 76 67 77
  360|       |      // 80 90 81 91 82 92 83 93  84 94 85 95 86 96 87 77
  361|       |      // A0 B0 A1 B1 A2 B2 A3 B3  A4 B4 A5 B5 A6 B6 A7 77
  362|  7.38k|      loadu_8bit_16x4(t, 2 * width_hor, &s[2]);
  363|  7.38k|      t += 8 * width_hor;
  364|       |
  365|  7.38k|      d[0] = convolve8_8_ssse3(&s[0], f);  // 00 01 02 03 04 05 06 07
  366|  7.38k|      d[1] = convolve8_8_ssse3(&s[2], f);  // 10 11 12 13 14 15 16 17
  367|       |
  368|       |      // 00 01 02 03 04 05 06 07  10 11 12 13 14 15 16 17
  369|  7.38k|      d[0] = _mm_packus_epi16(d[0], d[1]);
  370|  7.38k|      _mm_storel_epi64((__m128i *)(dst + 0 * dst_stride), d[0]);
  371|  7.38k|      _mm_storeh_epi64((__m128i *)(dst + 1 * dst_stride), d[0]);
  372|       |
  373|  7.38k|      s[0] = s[4];
  374|  7.38k|      s[1] = s[5];
  375|       |
  376|  7.38k|      dst += 2 * dst_stride;
  377|  7.38k|      y -= 2;
  378|  7.38k|    } while (y);
  ------------------
  |  Branch (378:14): [True: 6.43k, False: 948]
  ------------------
  379|    948|    t -= width_hor * (4 * height_ver + 4);
  380|    948|    t += 16;
  381|    948|    dst -= height_ver * dst_stride;
  382|    948|    dst += 8;
  383|    948|    x -= 8;
  384|    948|  } while (x);
  ------------------
  |  Branch (384:12): [True: 344, False: 604]
  ------------------
  385|    604|}
resize_ssse3.c:scale_plane_4_to_3_general:
  514|  1.31k|                                       uint8_t *const temp_buffer) {
  515|  1.31k|  static const int step_q4 = 16 * 4 / 3;
  516|  1.31k|  const int width_hor = (w + 5) - ((w + 5) % 6);
  517|  1.31k|  const int stride_hor = 2 * width_hor + 4;  // store 4 extra pixels
  518|  1.31k|  const int width_ver = (w + 7) & ~7;
  519|       |  // We need (SUBPEL_TAPS - 1) extra rows: (SUBPEL_TAPS / 2 - 1) extra rows
  520|       |  // above and (SUBPEL_TAPS / 2) extra rows below.
  521|  1.31k|  const int height_hor = (4 * h / 3 + SUBPEL_TAPS - 1 + 7) & ~7;
  ------------------
  |  |   26|  1.31k|#define SUBPEL_TAPS 8
  ------------------
  522|  1.31k|  const int height_ver = (h + 5) - ((h + 5) % 6);
  523|  1.31k|  int x, y = height_hor;
  524|  1.31k|  uint8_t *t = temp_buffer;
  525|  1.31k|  __m128i s[12], d[6], dd[4];
  526|  1.31k|  __m128i f0[4], f1[5], f2[5];
  527|       |  // The offset of the first row is always less than 1 pixel.
  528|  1.31k|  const int offset1_q4 = phase + 1 * step_q4;
  529|  1.31k|  const int offset2_q4 = phase + 2 * step_q4;
  530|       |  // offset_idxx indicates the pixel offset is even (0) or odd (1).
  531|       |  // It's used to choose the src offset and filter coefficient offset.
  532|  1.31k|  const int offset_idx1 = (offset1_q4 >> 4) & 1;
  533|  1.31k|  const int offset_idx2 = (offset2_q4 >> 4) & 1;
  534|  1.31k|  static const shuffle_filter_funcs shuffle_filter_func_list[2] = {
  535|  1.31k|    shuffle_filter_ssse3, shuffle_filter_odd_ssse3
  536|  1.31k|  };
  537|  1.31k|  static const convolve8_funcs convolve8_func_list[2] = {
  538|  1.31k|    convolve8_8_even_offset_ssse3, convolve8_8_odd_offset_ssse3
  539|  1.31k|  };
  540|       |
  541|  1.31k|  assert(w && h);
  542|       |
  543|  1.31k|  shuffle_filter_ssse3(coef[(phase + 0 * step_q4) & SUBPEL_MASK], f0);
  ------------------
  |  |   24|  1.31k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  1.31k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  544|  1.31k|  shuffle_filter_func_list[offset_idx1](coef[offset1_q4 & SUBPEL_MASK], f1);
  ------------------
  |  |   24|  1.31k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  1.31k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  545|  1.31k|  shuffle_filter_func_list[offset_idx2](coef[offset2_q4 & SUBPEL_MASK], f2);
  ------------------
  |  |   24|  1.31k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  1.31k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  546|       |
  547|       |  // Sub 64 to avoid overflow.
  548|       |  // Coef 128 would be treated as -128 in PMADDUBSW. Sub 64 here.
  549|       |  // Coef 128 is in either fx[1] or fx[2] depending on the phase idx.
  550|       |  // When filter phase idx is 1, the two biggest coefficients are shuffled
  551|       |  // together, and the sum of them are always no less than 128. Sub 64 here.
  552|       |  // After the subtraction, when the sum of all positive coefficients are no
  553|       |  // larger than 128, and the sum of all negative coefficients are no
  554|       |  // less than -128, there will be no overflow in the convolve8 functions.
  555|  1.31k|  f0[1] = _mm_sub_epi8(f0[1], _mm_set1_epi8(64));
  556|  1.31k|  f1[1 + offset_idx1] = _mm_sub_epi8(f1[1 + offset_idx1], _mm_set1_epi8(64));
  557|  1.31k|  f2[1 + offset_idx2] = _mm_sub_epi8(f2[1 + offset_idx2], _mm_set1_epi8(64));
  558|       |
  559|  1.31k|  src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 - 1;
  ------------------
  |  |   26|  1.31k|#define SUBPEL_TAPS 8
  ------------------
                src -= (SUBPEL_TAPS / 2 - 1) * src_stride + SUBPEL_TAPS / 2 - 1;
  ------------------
  |  |   26|  1.31k|#define SUBPEL_TAPS 8
  ------------------
  560|       |
  561|       |  // horizontal 6x8
  562|  9.79k|  do {
  563|  9.79k|    load_8bit_8x8(src, src_stride, s);
  564|       |    // 00 01 10 11 20 21 30 31  40 41 50 51 60 61 70 71
  565|       |    // 02 03 12 13 22 23 32 33  42 43 52 53 62 63 72 73
  566|       |    // 04 05 14 15 24 25 34 35  44 45 54 55 64 65 74 75
  567|       |    // 06 07 16 17 26 27 36 37  46 47 56 57 66 67 76 77
  568|  9.79k|    transpose_16bit_4x8(s, s);
  569|  9.79k|    x = width_hor;
  570|       |
  571|   119k|    do {
  572|   119k|      src += 8;
  573|   119k|      load_8bit_8x8(src, src_stride, &s[4]);
  574|       |      // 08 09 18 19 28 29 38 39  48 49 58 59 68 69 78 79
  575|       |      // 0A 0B 1A 1B 2A 2B 3A 3B  4A 4B 5A 5B 6A 6B 7A 7B
  576|       |      // OC 0D 1C 1D 2C 2D 3C 3D  4C 4D 5C 5D 6C 6D 7C 7D
  577|       |      // 0E 0F 1E 1F 2E 2F 3E 3F  4E 4F 5E 5F 6E 6F 7E 7F
  578|   119k|      transpose_16bit_4x8(&s[4], &s[4]);
  579|       |
  580|       |      // 00 10 20 30 40 50 60 70
  581|       |      // 01 11 21 31 41 51 61 71
  582|       |      // 02 12 22 32 42 52 62 72
  583|       |      // 03 13 23 33 43 53 63 73
  584|       |      // 04 14 24 34 44 54 64 74
  585|       |      // 05 15 25 35 45 55 65 75
  586|   119k|      d[0] = convolve8_8_even_offset_ssse3(&s[0], f0);
  587|   119k|      d[1] = convolve8_func_list[offset_idx1](&s[offset1_q4 >> 5], f1);
  588|   119k|      d[2] = convolve8_func_list[offset_idx2](&s[offset2_q4 >> 5], f2);
  589|   119k|      d[3] = convolve8_8_even_offset_ssse3(&s[2], f0);
  590|   119k|      d[4] = convolve8_func_list[offset_idx1](&s[2 + (offset1_q4 >> 5)], f1);
  591|   119k|      d[5] = convolve8_func_list[offset_idx2](&s[2 + (offset2_q4 >> 5)], f2);
  592|       |
  593|       |      // 00 10 20 30 40 50 60 70  02 12 22 32 42 52 62 72
  594|       |      // 01 11 21 31 41 51 61 71  03 13 23 33 43 53 63 73
  595|       |      // 04 14 24 34 44 54 64 74  xx xx xx xx xx xx xx xx
  596|       |      // 05 15 25 35 45 55 65 75  xx xx xx xx xx xx xx xx
  597|   119k|      dd[0] = _mm_packus_epi16(d[0], d[2]);
  598|   119k|      dd[1] = _mm_packus_epi16(d[1], d[3]);
  599|   119k|      dd[2] = _mm_packus_epi16(d[4], d[4]);
  600|   119k|      dd[3] = _mm_packus_epi16(d[5], d[5]);
  601|       |
  602|       |      // 00 10 01 11 20 30 21 31  40 50 41 51 60 70 61 71
  603|       |      // 02 12 03 13 22 32 23 33  42 52 43 53 62 72 63 73
  604|       |      // 04 14 05 15 24 34 25 35  44 54 45 55 64 74 65 75
  605|   119k|      d[0] = _mm_unpacklo_epi16(dd[0], dd[1]);
  606|   119k|      d[1] = _mm_unpackhi_epi16(dd[0], dd[1]);
  607|   119k|      d[2] = _mm_unpacklo_epi16(dd[2], dd[3]);
  608|       |
  609|       |      // 00 10 01 11 02 12 03 13  20 30 21 31 22 32 23 33
  610|       |      // 40 50 41 51 42 52 43 53  60 70 61 71 62 72 63 73
  611|       |      // 04 14 05 15 xx xx xx xx  24 34 25 35 xx xx xx xx
  612|       |      // 44 54 45 55 xx xx xx xx  64 74 65 75 xx xx xx xx
  613|   119k|      dd[0] = _mm_unpacklo_epi32(d[0], d[1]);
  614|   119k|      dd[1] = _mm_unpackhi_epi32(d[0], d[1]);
  615|   119k|      dd[2] = _mm_unpacklo_epi32(d[2], d[2]);
  616|   119k|      dd[3] = _mm_unpackhi_epi32(d[2], d[2]);
  617|       |
  618|       |      // 00 10 01 11 02 12 03 13  04 14 05 15 xx xx xx xx
  619|       |      // 20 30 21 31 22 32 23 33  24 34 25 35 xx xx xx xx
  620|       |      // 40 50 41 51 42 52 43 53  44 54 45 55 xx xx xx xx
  621|       |      // 60 70 61 71 62 72 63 73  64 74 65 75 xx xx xx xx
  622|   119k|      d[0] = _mm_unpacklo_epi64(dd[0], dd[2]);
  623|   119k|      d[1] = _mm_unpackhi_epi64(dd[0], dd[2]);
  624|   119k|      d[2] = _mm_unpacklo_epi64(dd[1], dd[3]);
  625|   119k|      d[3] = _mm_unpackhi_epi64(dd[1], dd[3]);
  626|       |
  627|       |      // store 4 extra pixels
  628|   119k|      storeu_8bit_16x4(d, t, stride_hor);
  629|       |
  630|   119k|      s[0] = s[4];
  631|   119k|      s[1] = s[5];
  632|   119k|      s[2] = s[6];
  633|   119k|      s[3] = s[7];
  634|       |
  635|   119k|      t += 12;
  636|   119k|      x -= 6;
  637|   119k|    } while (x);
  ------------------
  |  Branch (637:14): [True: 109k, False: 9.79k]
  ------------------
  638|  9.79k|    src += 8 * src_stride - 4 * width_hor / 3;
  639|  9.79k|    t += 3 * stride_hor + 4;
  640|  9.79k|    y -= 8;
  641|  9.79k|  } while (y);
  ------------------
  |  Branch (641:12): [True: 8.48k, False: 1.31k]
  ------------------
  642|       |
  643|       |  // vertical 8x6
  644|  1.31k|  x = width_ver;
  645|  1.31k|  t = temp_buffer;
  646|  7.03k|  do {
  647|       |    // 00 10 01 11 02 12 03 13  04 14 05 15 06 16 07 17
  648|       |    // 20 30 21 31 22 32 23 33  24 34 25 35 26 36 27 37
  649|       |    // 40 50 41 51 42 52 43 53  44 54 45 55 46 56 47 57
  650|       |    // 60 70 61 71 62 72 63 73  64 74 65 75 66 76 67 77
  651|  7.03k|    loadu_8bit_16x4(t, stride_hor, s);
  652|  7.03k|    y = height_ver;
  653|       |
  654|  85.1k|    do {
  655|       |      // 80 90 81 91 82 92 83 93  84 94 85 95 86 96 87 97
  656|       |      // A0 B0 A1 B1 A2 B2 A3 B3  A4 B4 A5 B5 A6 B6 A7 B7
  657|       |      // C0 D0 C1 D1 C2 D2 C3 D3  C4 D4 C5 D5 C6 D6 C7 D7
  658|       |      // E0 F0 E1 F1 E2 F2 E3 F3  E4 F4 E5 F5 E6 F6 E7 F7
  659|  85.1k|      t += 4 * stride_hor;
  660|  85.1k|      loadu_8bit_16x4(t, stride_hor, &s[4]);
  661|       |
  662|  85.1k|      d[0] = convolve8_8_even_offset_ssse3(&s[0], f0);
  663|  85.1k|      d[1] = convolve8_func_list[offset_idx1](&s[offset1_q4 >> 5], f1);
  664|  85.1k|      d[2] = convolve8_func_list[offset_idx2](&s[offset2_q4 >> 5], f2);
  665|  85.1k|      d[3] = convolve8_8_even_offset_ssse3(&s[2], f0);
  666|  85.1k|      d[4] = convolve8_func_list[offset_idx1](&s[2 + (offset1_q4 >> 5)], f1);
  667|  85.1k|      d[5] = convolve8_func_list[offset_idx2](&s[2 + (offset2_q4 >> 5)], f2);
  668|       |
  669|       |      // 00 01 02 03 04 05 06 07  10 11 12 13 14 15 16 17
  670|       |      // 20 21 22 23 24 25 26 27  30 31 32 33 34 35 36 37
  671|       |      // 40 41 42 43 44 45 46 47  50 51 52 53 54 55 56 57
  672|  85.1k|      d[0] = _mm_packus_epi16(d[0], d[1]);
  673|  85.1k|      d[2] = _mm_packus_epi16(d[2], d[3]);
  674|  85.1k|      d[4] = _mm_packus_epi16(d[4], d[5]);
  675|       |
  676|  85.1k|      _mm_storel_epi64((__m128i *)(dst + 0 * dst_stride), d[0]);
  677|  85.1k|      _mm_storeh_epi64((__m128i *)(dst + 1 * dst_stride), d[0]);
  678|  85.1k|      _mm_storel_epi64((__m128i *)(dst + 2 * dst_stride), d[2]);
  679|  85.1k|      _mm_storeh_epi64((__m128i *)(dst + 3 * dst_stride), d[2]);
  680|  85.1k|      _mm_storel_epi64((__m128i *)(dst + 4 * dst_stride), d[4]);
  681|  85.1k|      _mm_storeh_epi64((__m128i *)(dst + 5 * dst_stride), d[4]);
  682|       |
  683|  85.1k|      s[0] = s[4];
  684|  85.1k|      s[1] = s[5];
  685|  85.1k|      s[2] = s[6];
  686|  85.1k|      s[3] = s[7];
  687|       |
  688|  85.1k|      dst += 6 * dst_stride;
  689|  85.1k|      y -= 6;
  690|  85.1k|    } while (y);
  ------------------
  |  Branch (690:14): [True: 78.1k, False: 7.03k]
  ------------------
  691|  7.03k|    t -= stride_hor * 2 * height_ver / 3;
  692|  7.03k|    t += 16;
  693|  7.03k|    dst -= height_ver * dst_stride;
  694|  7.03k|    dst += 8;
  695|  7.03k|    x -= 8;
  696|  7.03k|  } while (x);
  ------------------
  |  Branch (696:12): [True: 5.72k, False: 1.31k]
  ------------------
  697|  1.31k|}
resize_ssse3.c:shuffle_filter_odd_ssse3:
   33|  2.62k|                                            __m128i *const f) {
   34|  2.62k|  const __m128i f_values = _mm_load_si128((const __m128i *)filter);
   35|       |  // pack and duplicate the filter values
   36|       |  // It utilizes the fact that the high byte of filter[3] is always 0 to clean
   37|       |  // half of f[0] and f[4].
   38|       |  assert(filter[3] >= 0 && filter[3] < 256);
   39|  2.62k|  f[0] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0007u));
   40|  2.62k|  f[1] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0402u));
   41|  2.62k|  f[2] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0806u));
   42|  2.62k|  f[3] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x0c0au));
   43|  2.62k|  f[4] = _mm_shuffle_epi8(f_values, _mm_set1_epi16(0x070eu));
   44|  2.62k|}
resize_ssse3.c:convolve8_8_even_offset_ssse3:
   47|   408k|                                                    const __m128i *const f) {
   48|       |  // multiply 2 adjacent elements with the filter and add the result
   49|   408k|  const __m128i k_64 = _mm_set1_epi16(1 << 6);
   50|   408k|  const __m128i x0 = _mm_maddubs_epi16(s[0], f[0]);
   51|   408k|  const __m128i x1 = _mm_maddubs_epi16(s[1], f[1]);
   52|   408k|  const __m128i x2 = _mm_maddubs_epi16(s[2], f[2]);
   53|   408k|  const __m128i x3 = _mm_maddubs_epi16(s[3], f[3]);
   54|       |  // compensate the subtracted 64 in f[1]. x4 is always non negative.
   55|   408k|  const __m128i x4 = _mm_maddubs_epi16(s[1], _mm_set1_epi8(64));
   56|       |  // add and saturate the results together
   57|   408k|  __m128i temp = _mm_adds_epi16(x0, x3);
   58|   408k|  temp = _mm_adds_epi16(temp, x1);
   59|   408k|  temp = _mm_adds_epi16(temp, x2);
   60|   408k|  temp = _mm_adds_epi16(temp, x4);
   61|       |  // round and shift by 7 bit each 16 bit
   62|   408k|  temp = _mm_adds_epi16(temp, k_64);
   63|   408k|  temp = _mm_srai_epi16(temp, 7);
   64|   408k|  return temp;
   65|   408k|}
resize_ssse3.c:convolve8_8_odd_offset_ssse3:
   68|   817k|                                                   const __m128i *const f) {
   69|       |  // multiply 2 adjacent elements with the filter and add the result
   70|   817k|  const __m128i k_64 = _mm_set1_epi16(1 << 6);
   71|   817k|  const __m128i x0 = _mm_maddubs_epi16(s[0], f[0]);
   72|   817k|  const __m128i x1 = _mm_maddubs_epi16(s[1], f[1]);
   73|   817k|  const __m128i x2 = _mm_maddubs_epi16(s[2], f[2]);
   74|   817k|  const __m128i x3 = _mm_maddubs_epi16(s[3], f[3]);
   75|   817k|  const __m128i x4 = _mm_maddubs_epi16(s[4], f[4]);
   76|       |  // compensate the subtracted 64 in f[2]. x5 is always non negative.
   77|   817k|  const __m128i x5 = _mm_maddubs_epi16(s[2], _mm_set1_epi8(64));
   78|   817k|  __m128i temp;
   79|       |
   80|       |  // add and saturate the results together
   81|   817k|  temp = _mm_adds_epi16(x0, x1);
   82|   817k|  temp = _mm_adds_epi16(temp, x2);
   83|   817k|  temp = _mm_adds_epi16(temp, x3);
   84|   817k|  temp = _mm_adds_epi16(temp, x4);
   85|   817k|  temp = _mm_adds_epi16(temp, x5);
   86|       |  // round and shift by 7 bit each 16 bit
   87|   817k|  temp = _mm_adds_epi16(temp, k_64);
   88|   817k|  temp = _mm_srai_epi16(temp, 7);
   89|   817k|  return temp;
   90|   817k|}

av1_selfguided_restoration_avx2:
  553|  10.0k|                                    int highbd) {
  554|       |  // The ALIGN_POWER_OF_TWO macro here ensures that column 1 of Atl, Btl,
  555|       |  // Ctl and Dtl is 32-byte aligned.
  556|  10.0k|  const int buf_elts = ALIGN_POWER_OF_TWO(RESTORATION_PROC_UNIT_PELS, 3);
  ------------------
  |  |   69|  10.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  557|       |
  558|  10.0k|  int32_t *buf = aom_memalign(
  559|  10.0k|      32, 4 * sizeof(*buf) * ALIGN_POWER_OF_TWO(RESTORATION_PROC_UNIT_PELS, 3));
  ------------------
  |  |   69|  10.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  560|  10.0k|  if (!buf) return -1;
  ------------------
  |  Branch (560:7): [True: 0, False: 10.0k]
  ------------------
  561|       |
  562|  10.0k|  const int width_ext = width + 2 * SGRPROJ_BORDER_HORZ;
  ------------------
  |  |   40|  10.0k|#define SGRPROJ_BORDER_HORZ 3  // Horizontal border used for Sgr
  ------------------
  563|  10.0k|  const int height_ext = height + 2 * SGRPROJ_BORDER_VERT;
  ------------------
  |  |   39|  10.0k|#define SGRPROJ_BORDER_VERT 3  // Vertical border used for Sgr
  ------------------
  564|       |
  565|       |  // Adjusting the stride of A and B here appears to avoid bad cache effects,
  566|       |  // leading to a significant speed improvement.
  567|       |  // We also align the stride to a multiple of 32 bytes for efficiency.
  568|  10.0k|  int buf_stride = ALIGN_POWER_OF_TWO(width_ext + 16, 3);
  ------------------
  |  |   69|  10.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  569|       |
  570|       |  // The "tl" pointers point at the top-left of the initialised data for the
  571|       |  // array.
  572|  10.0k|  int32_t *Atl = buf + 0 * buf_elts + 7;
  573|  10.0k|  int32_t *Btl = buf + 1 * buf_elts + 7;
  574|  10.0k|  int32_t *Ctl = buf + 2 * buf_elts + 7;
  575|  10.0k|  int32_t *Dtl = buf + 3 * buf_elts + 7;
  576|       |
  577|       |  // The "0" pointers are (- SGRPROJ_BORDER_VERT, -SGRPROJ_BORDER_HORZ). Note
  578|       |  // there's a zero row and column in A, B (integral images), so we move down
  579|       |  // and right one for them.
  580|  10.0k|  const int buf_diag_border =
  581|  10.0k|      SGRPROJ_BORDER_HORZ + buf_stride * SGRPROJ_BORDER_VERT;
  ------------------
  |  |   40|  10.0k|#define SGRPROJ_BORDER_HORZ 3  // Horizontal border used for Sgr
  ------------------
                    SGRPROJ_BORDER_HORZ + buf_stride * SGRPROJ_BORDER_VERT;
  ------------------
  |  |   39|  10.0k|#define SGRPROJ_BORDER_VERT 3  // Vertical border used for Sgr
  ------------------
  582|       |
  583|  10.0k|  int32_t *A0 = Atl + 1 + buf_stride;
  584|  10.0k|  int32_t *B0 = Btl + 1 + buf_stride;
  585|  10.0k|  int32_t *C0 = Ctl + 1 + buf_stride;
  586|  10.0k|  int32_t *D0 = Dtl + 1 + buf_stride;
  587|       |
  588|       |  // Finally, A, B, C, D point at position (0, 0).
  589|  10.0k|  int32_t *A = A0 + buf_diag_border;
  590|  10.0k|  int32_t *B = B0 + buf_diag_border;
  591|  10.0k|  int32_t *C = C0 + buf_diag_border;
  592|  10.0k|  int32_t *D = D0 + buf_diag_border;
  593|       |
  594|  10.0k|  const int dgd_diag_border =
  595|  10.0k|      SGRPROJ_BORDER_HORZ + dgd_stride * SGRPROJ_BORDER_VERT;
  ------------------
  |  |   40|  10.0k|#define SGRPROJ_BORDER_HORZ 3  // Horizontal border used for Sgr
  ------------------
                    SGRPROJ_BORDER_HORZ + dgd_stride * SGRPROJ_BORDER_VERT;
  ------------------
  |  |   39|  10.0k|#define SGRPROJ_BORDER_VERT 3  // Vertical border used for Sgr
  ------------------
  596|  10.0k|  const uint8_t *dgd0 = dgd8 - dgd_diag_border;
  597|       |
  598|       |  // Generate integral images from the input. C will contain sums of squares; D
  599|       |  // will contain just sums
  600|  10.0k|  if (highbd)
  ------------------
  |  Branch (600:7): [True: 2.57k, False: 7.49k]
  ------------------
  601|  2.57k|    integral_images_highbd(CONVERT_TO_SHORTPTR(dgd0), dgd_stride, width_ext,
  ------------------
  |  |   79|  2.57k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  602|  2.57k|                           height_ext, Ctl, Dtl, buf_stride);
  603|  7.49k|  else
  604|  7.49k|    integral_images(dgd0, dgd_stride, width_ext, height_ext, Ctl, Dtl,
  605|  7.49k|                    buf_stride);
  606|       |
  607|  10.0k|  const sgr_params_type *const params = &av1_sgr_params[sgr_params_idx];
  608|       |  // Write to flt0 and flt1
  609|       |  // If params->r == 0 we skip the corresponding filter. We only allow one of
  610|       |  // the radii to be 0, as having both equal to 0 would be equivalent to
  611|       |  // skipping SGR entirely.
  612|  10.0k|  assert(!(params->r[0] == 0 && params->r[1] == 0));
  613|  10.0k|  assert(params->r[0] < AOMMIN(SGRPROJ_BORDER_VERT, SGRPROJ_BORDER_HORZ));
  614|  10.0k|  assert(params->r[1] < AOMMIN(SGRPROJ_BORDER_VERT, SGRPROJ_BORDER_HORZ));
  615|       |
  616|  10.0k|  if (params->r[0] > 0) {
  ------------------
  |  Branch (616:7): [True: 10.0k, False: 0]
  ------------------
  617|  10.0k|    calc_ab_fast(A, B, C, D, width, height, buf_stride, bit_depth,
  618|  10.0k|                 sgr_params_idx, 0);
  619|  10.0k|    final_filter_fast(flt0, flt_stride, A, B, buf_stride, dgd8, dgd_stride,
  620|  10.0k|                      width, height, highbd);
  621|  10.0k|  }
  622|       |
  623|  10.0k|  if (params->r[1] > 0) {
  ------------------
  |  Branch (623:7): [True: 10.0k, False: 0]
  ------------------
  624|  10.0k|    calc_ab(A, B, C, D, width, height, buf_stride, bit_depth, sgr_params_idx,
  625|  10.0k|            1);
  626|  10.0k|    final_filter(flt1, flt_stride, A, B, buf_stride, dgd8, dgd_stride, width,
  627|  10.0k|                 height, highbd);
  628|  10.0k|  }
  629|  10.0k|  aom_free(buf);
  630|  10.0k|  return 0;
  631|  10.0k|}
av1_apply_selfguided_restoration_avx2:
  637|  2.31k|                                          int bit_depth, int highbd) {
  638|  2.31k|  int32_t *flt0 = tmpbuf;
  639|  2.31k|  int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX;
  ------------------
  |  |   87|  2.31k|  (RESTORATION_UNITPELS_HORZ_MAX * RESTORATION_UNITPELS_VERT_MAX)
  |  |  ------------------
  |  |  |  |   82|  2.31k|  (RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_HORZ + 16)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.31k|#define RESTORATION_UNITSIZE_MAX 256
  |  |  |  |  ------------------
  |  |  |  |                 (RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_HORZ + 16)
  |  |  |  |  ------------------
  |  |  |  |  |  |   56|  2.31k|#define RESTORATION_BORDER_HORZ (SGRPROJ_BORDER_HORZ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|  2.31k|#define SGRPROJ_BORDER_HORZ 3  // Horizontal border used for Sgr
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (RESTORATION_UNITPELS_HORZ_MAX * RESTORATION_UNITPELS_VERT_MAX)
  |  |  ------------------
  |  |  |  |   84|  2.31k|  ((RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_VERT + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  2.31k|#define RESTORATION_UNITSIZE_MAX 256
  |  |  |  |  ------------------
  |  |  |  |                 ((RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_VERT + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|  2.31k|#define RESTORATION_BORDER_VERT (SGRPROJ_BORDER_VERT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  2.31k|#define SGRPROJ_BORDER_VERT 3  // Vertical border used for Sgr
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|  2.31k|    RESTORATION_UNIT_OFFSET))
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  2.31k|#define RESTORATION_UNIT_OFFSET 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|  2.31k|  assert(width * height <= RESTORATION_UNITPELS_MAX);
  641|  2.31k|  const int ret = av1_selfguided_restoration_avx2(
  642|  2.31k|      dat8, width, height, stride, flt0, flt1, width, eps, bit_depth, highbd);
  643|  2.31k|  if (ret != 0) return ret;
  ------------------
  |  Branch (643:7): [True: 0, False: 2.31k]
  ------------------
  644|  2.31k|  const sgr_params_type *const params = &av1_sgr_params[eps];
  645|  2.31k|  int xq[2];
  646|  2.31k|  av1_decode_xq(xqd, xq, params);
  647|       |
  648|  2.31k|  __m256i xq0 = _mm256_set1_epi32(xq[0]);
  649|  2.31k|  __m256i xq1 = _mm256_set1_epi32(xq[1]);
  650|       |
  651|  77.8k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (651:19): [True: 75.5k, False: 2.31k]
  ------------------
  652|       |    // Calculate output in batches of 16 pixels
  653|   288k|    for (int j = 0; j < width; j += 16) {
  ------------------
  |  Branch (653:21): [True: 213k, False: 75.5k]
  ------------------
  654|   213k|      const int k = i * width + j;
  655|   213k|      const int m = i * dst_stride + j;
  656|       |
  657|   213k|      const uint8_t *dat8ij = dat8 + i * stride + j;
  658|   213k|      __m256i ep_0, ep_1;
  659|   213k|      __m128i src_0, src_1;
  660|   213k|      if (highbd) {
  ------------------
  |  Branch (660:11): [True: 15.5k, False: 197k]
  ------------------
  661|  15.5k|        src_0 = xx_loadu_128(CONVERT_TO_SHORTPTR(dat8ij));
  ------------------
  |  |   79|  15.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  662|  15.5k|        src_1 = xx_loadu_128(CONVERT_TO_SHORTPTR(dat8ij + 8));
  ------------------
  |  |   79|  15.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  663|  15.5k|        ep_0 = _mm256_cvtepu16_epi32(src_0);
  664|  15.5k|        ep_1 = _mm256_cvtepu16_epi32(src_1);
  665|   197k|      } else {
  666|   197k|        src_0 = xx_loadu_128(dat8ij);
  667|   197k|        ep_0 = _mm256_cvtepu8_epi32(src_0);
  668|   197k|        ep_1 = _mm256_cvtepu8_epi32(_mm_srli_si128(src_0, 8));
  669|   197k|      }
  670|       |
  671|   213k|      const __m256i u_0 = _mm256_slli_epi32(ep_0, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   213k|#define SGRPROJ_RST_BITS 4
  ------------------
  672|   213k|      const __m256i u_1 = _mm256_slli_epi32(ep_1, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   213k|#define SGRPROJ_RST_BITS 4
  ------------------
  673|       |
  674|   213k|      __m256i v_0 = _mm256_slli_epi32(u_0, SGRPROJ_PRJ_BITS);
  ------------------
  |  |   99|   213k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  675|   213k|      __m256i v_1 = _mm256_slli_epi32(u_1, SGRPROJ_PRJ_BITS);
  ------------------
  |  |   99|   213k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  676|       |
  677|   213k|      if (params->r[0] > 0) {
  ------------------
  |  Branch (677:11): [True: 213k, False: 0]
  ------------------
  678|   213k|        const __m256i f1_0 = _mm256_sub_epi32(yy_loadu_256(&flt0[k]), u_0);
  679|   213k|        v_0 = _mm256_add_epi32(v_0, _mm256_mullo_epi32(xq0, f1_0));
  680|       |
  681|   213k|        const __m256i f1_1 = _mm256_sub_epi32(yy_loadu_256(&flt0[k + 8]), u_1);
  682|   213k|        v_1 = _mm256_add_epi32(v_1, _mm256_mullo_epi32(xq0, f1_1));
  683|   213k|      }
  684|       |
  685|   213k|      if (params->r[1] > 0) {
  ------------------
  |  Branch (685:11): [True: 213k, False: 1]
  ------------------
  686|   213k|        const __m256i f2_0 = _mm256_sub_epi32(yy_loadu_256(&flt1[k]), u_0);
  687|   213k|        v_0 = _mm256_add_epi32(v_0, _mm256_mullo_epi32(xq1, f2_0));
  688|       |
  689|   213k|        const __m256i f2_1 = _mm256_sub_epi32(yy_loadu_256(&flt1[k + 8]), u_1);
  690|   213k|        v_1 = _mm256_add_epi32(v_1, _mm256_mullo_epi32(xq1, f2_1));
  691|   213k|      }
  692|       |
  693|   213k|      const __m256i rounding =
  694|   213k|          round_for_shift(SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |   99|   213k|#define SGRPROJ_PRJ_BITS 7
  ------------------
                        round_for_shift(SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   213k|#define SGRPROJ_RST_BITS 4
  ------------------
  695|   213k|      const __m256i w_0 = _mm256_srai_epi32(
  696|   213k|          _mm256_add_epi32(v_0, rounding), SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |   99|   213k|#define SGRPROJ_PRJ_BITS 7
  ------------------
                        _mm256_add_epi32(v_0, rounding), SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   213k|#define SGRPROJ_RST_BITS 4
  ------------------
  697|   213k|      const __m256i w_1 = _mm256_srai_epi32(
  698|   213k|          _mm256_add_epi32(v_1, rounding), SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |   99|   213k|#define SGRPROJ_PRJ_BITS 7
  ------------------
                        _mm256_add_epi32(v_1, rounding), SGRPROJ_PRJ_BITS + SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   213k|#define SGRPROJ_RST_BITS 4
  ------------------
  699|       |
  700|   213k|      if (highbd) {
  ------------------
  |  Branch (700:11): [True: 15.5k, False: 197k]
  ------------------
  701|       |        // Pack into 16 bits and clamp to [0, 2^bit_depth)
  702|       |        // Note that packing into 16 bits messes up the order of the bits,
  703|       |        // so we use a permute function to correct this
  704|  15.5k|        const __m256i tmp = _mm256_packus_epi32(w_0, w_1);
  705|  15.5k|        const __m256i tmp2 = _mm256_permute4x64_epi64(tmp, 0xd8);
  706|  15.5k|        const __m256i max = _mm256_set1_epi16((1 << bit_depth) - 1);
  707|  15.5k|        const __m256i res = _mm256_min_epi16(tmp2, max);
  708|  15.5k|        yy_storeu_256(CONVERT_TO_SHORTPTR(dst8 + m), res);
  ------------------
  |  |   79|  15.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  709|   197k|      } else {
  710|       |        // Pack into 8 bits and clamp to [0, 256)
  711|       |        // Note that each pack messes up the order of the bits,
  712|       |        // so we use a permute function to correct this
  713|   197k|        const __m256i tmp = _mm256_packs_epi32(w_0, w_1);
  714|   197k|        const __m256i tmp2 = _mm256_permute4x64_epi64(tmp, 0xd8);
  715|   197k|        const __m256i res =
  716|   197k|            _mm256_packus_epi16(tmp2, tmp2 /* "don't care" value */);
  717|   197k|        const __m128i res2 =
  718|       |            _mm256_castsi256_si128(_mm256_permute4x64_epi64(res, 0xd8));
  719|   197k|        xx_storeu_128(dst8 + m, res2);
  720|   197k|      }
  721|   213k|    }
  722|  75.5k|  }
  723|  2.31k|  return 0;
  724|  2.31k|}
selfguided_avx2.c:integral_images_highbd:
  135|  2.57k|                                   int32_t *B, int buf_stride) {
  136|  2.57k|  const __m256i zero = _mm256_setzero_si256();
  137|       |  // Write out the zero top row
  138|  2.57k|  memset_zero_avx(A, &zero, (width + 8));
  139|  2.57k|  memset_zero_avx(B, &zero, (width + 8));
  140|       |
  141|  66.4k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (141:19): [True: 63.9k, False: 2.57k]
  ------------------
  142|       |    // Zero the left column.
  143|  63.9k|    A[(i + 1) * buf_stride] = B[(i + 1) * buf_stride] = 0;
  144|       |
  145|       |    // ldiff is the difference H - D where H is the output sample immediately
  146|       |    // to the left and D is the output sample above it. These are scalars,
  147|       |    // replicated across the eight lanes.
  148|  63.9k|    __m256i ldiff1 = zero, ldiff2 = zero;
  149|   286k|    for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (149:21): [True: 222k, False: 63.9k]
  ------------------
  150|   222k|      const int ABj = 1 + j;
  151|       |
  152|   222k|      const __m256i above1 = yy_load_256(B + ABj + i * buf_stride);
  153|   222k|      const __m256i above2 = yy_load_256(A + ABj + i * buf_stride);
  154|       |
  155|   222k|      const __m256i x1 = yy256_load_extend_16_32(src + j + i * src_stride);
  156|   222k|      const __m256i x2 = _mm256_madd_epi16(x1, x1);
  157|       |
  158|   222k|      const __m256i sc1 = scan_32(x1);
  159|   222k|      const __m256i sc2 = scan_32(x2);
  160|       |
  161|   222k|      const __m256i row1 =
  162|   222k|          _mm256_add_epi32(_mm256_add_epi32(sc1, above1), ldiff1);
  163|   222k|      const __m256i row2 =
  164|   222k|          _mm256_add_epi32(_mm256_add_epi32(sc2, above2), ldiff2);
  165|       |
  166|   222k|      yy_store_256(B + ABj + (i + 1) * buf_stride, row1);
  167|   222k|      yy_store_256(A + ABj + (i + 1) * buf_stride, row2);
  168|       |
  169|       |      // Calculate the new H - D.
  170|   222k|      ldiff1 = _mm256_set1_epi32(
  171|   222k|          _mm256_extract_epi32(_mm256_sub_epi32(row1, above1), 7));
  172|   222k|      ldiff2 = _mm256_set1_epi32(
  173|       |          _mm256_extract_epi32(_mm256_sub_epi32(row2, above2), 7));
  174|   222k|    }
  175|  63.9k|  }
  176|  2.57k|}
selfguided_avx2.c:memset_zero_avx:
   69|  20.1k|static void *memset_zero_avx(int32_t *dest, const __m256i *zero, size_t count) {
   70|  20.1k|  unsigned int i = 0;
   71|  43.1k|  for (i = 0; i < (count & 0xffffffe0); i += 32) {
  ------------------
  |  Branch (71:15): [True: 22.9k, False: 20.1k]
  ------------------
   72|  22.9k|    _mm256_storeu_si256((__m256i *)(dest + i), *zero);
   73|  22.9k|    _mm256_storeu_si256((__m256i *)(dest + i + 8), *zero);
   74|  22.9k|    _mm256_storeu_si256((__m256i *)(dest + i + 16), *zero);
   75|  22.9k|    _mm256_storeu_si256((__m256i *)(dest + i + 24), *zero);
   76|  22.9k|  }
   77|  49.1k|  for (; i < (count & 0xfffffff8); i += 8) {
  ------------------
  |  Branch (77:10): [True: 29.0k, False: 20.1k]
  ------------------
   78|  29.0k|    _mm256_storeu_si256((__m256i *)(dest + i), *zero);
   79|  29.0k|  }
   80|   115k|  for (; i < count; i++) {
  ------------------
  |  Branch (80:10): [True: 95.2k, False: 20.1k]
  ------------------
   81|  95.2k|    dest[i] = 0;
   82|  95.2k|  }
   83|  20.1k|  return dest;
   84|  20.1k|}
selfguided_avx2.c:yy256_load_extend_16_32:
   29|   222k|static __m256i yy256_load_extend_16_32(const void *p) {
   30|   222k|  return _mm256_cvtepu16_epi32(xx_loadu_128(p));
   31|   222k|}
selfguided_avx2.c:scan_32:
   51|  5.17M|static __m256i scan_32(__m256i x) {
   52|  5.17M|  const __m256i x01 = _mm256_slli_si256(x, 4);
   53|  5.17M|  const __m256i x02 = _mm256_add_epi32(x, x01);
   54|  5.17M|  const __m256i x03 = _mm256_slli_si256(x02, 8);
   55|  5.17M|  const __m256i x04 = _mm256_add_epi32(x02, x03);
   56|  5.17M|  const int32_t s = _mm256_extract_epi32(x04, 3);
   57|  5.17M|  const __m128i s01 = _mm_set1_epi32(s);
   58|       |  const __m256i s02 = _mm256_insertf128_si256(_mm256_setzero_si256(), s01, 1);
   59|  5.17M|  return _mm256_add_epi32(x04, s02);
   60|  5.17M|}
selfguided_avx2.c:integral_images:
   88|  7.49k|                            int buf_stride) {
   89|  7.49k|  const __m256i zero = _mm256_setzero_si256();
   90|       |  // Write out the zero top row
   91|  7.49k|  memset_zero_avx(A, &zero, (width + 8));
   92|  7.49k|  memset_zero_avx(B, &zero, (width + 8));
   93|   358k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (93:19): [True: 350k, False: 7.49k]
  ------------------
   94|       |    // Zero the left column.
   95|   350k|    A[(i + 1) * buf_stride] = B[(i + 1) * buf_stride] = 0;
   96|       |
   97|       |    // ldiff is the difference H - D where H is the output sample immediately
   98|       |    // to the left and D is the output sample above it. These are scalars,
   99|       |    // replicated across the eight lanes.
  100|   350k|    __m256i ldiff1 = zero, ldiff2 = zero;
  101|  2.71M|    for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (101:21): [True: 2.36M, False: 350k]
  ------------------
  102|  2.36M|      const int ABj = 1 + j;
  103|       |
  104|  2.36M|      const __m256i above1 = yy_load_256(B + ABj + i * buf_stride);
  105|  2.36M|      const __m256i above2 = yy_load_256(A + ABj + i * buf_stride);
  106|       |
  107|  2.36M|      const __m256i x1 = yy256_load_extend_8_32(src + j + i * src_stride);
  108|  2.36M|      const __m256i x2 = _mm256_madd_epi16(x1, x1);
  109|       |
  110|  2.36M|      const __m256i sc1 = scan_32(x1);
  111|  2.36M|      const __m256i sc2 = scan_32(x2);
  112|       |
  113|  2.36M|      const __m256i row1 =
  114|  2.36M|          _mm256_add_epi32(_mm256_add_epi32(sc1, above1), ldiff1);
  115|  2.36M|      const __m256i row2 =
  116|  2.36M|          _mm256_add_epi32(_mm256_add_epi32(sc2, above2), ldiff2);
  117|       |
  118|  2.36M|      yy_store_256(B + ABj + (i + 1) * buf_stride, row1);
  119|  2.36M|      yy_store_256(A + ABj + (i + 1) * buf_stride, row2);
  120|       |
  121|       |      // Calculate the new H - D.
  122|  2.36M|      ldiff1 = _mm256_set1_epi32(
  123|  2.36M|          _mm256_extract_epi32(_mm256_sub_epi32(row1, above1), 7));
  124|  2.36M|      ldiff2 = _mm256_set1_epi32(
  125|       |          _mm256_extract_epi32(_mm256_sub_epi32(row2, above2), 7));
  126|  2.36M|    }
  127|   350k|  }
  128|  7.49k|}
selfguided_avx2.c:yy256_load_extend_8_32:
   23|  2.36M|static __m256i yy256_load_extend_8_32(const void *p) {
   24|  2.36M|  return _mm256_cvtepu8_epi32(xx_loadl_64(p));
   25|  2.36M|}
selfguided_avx2.c:calc_ab_fast:
  358|  10.0k|                         int radius_idx) {
  359|  10.0k|  const sgr_params_type *const params = &av1_sgr_params[sgr_params_idx];
  360|  10.0k|  const int r = params->r[radius_idx];
  361|  10.0k|  const int n = (2 * r + 1) * (2 * r + 1);
  362|  10.0k|  const __m256i s = _mm256_set1_epi32(params->s[radius_idx]);
  363|       |  // one_over_n[n-1] is 2^12/n, so easily fits in an int16
  364|  10.0k|  const __m256i one_over_n = _mm256_set1_epi32(av1_one_by_x[n - 1]);
  365|       |
  366|  10.0k|  const __m256i rnd_z = round_for_shift(SGRPROJ_MTABLE_BITS);
  ------------------
  |  |  117|  10.0k|#define SGRPROJ_MTABLE_BITS 20
  ------------------
  367|  10.0k|  const __m256i rnd_res = round_for_shift(SGRPROJ_RECIP_BITS);
  ------------------
  |  |  118|  10.0k|#define SGRPROJ_RECIP_BITS 12
  ------------------
  368|       |
  369|       |  // Set up masks
  370|  10.0k|  const __m128i ones32 = _mm_set_epi32(0, 0, ~0, ~0);
  371|  10.0k|  __m256i mask[8];
  372|  90.6k|  for (int idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (372:21): [True: 80.6k, False: 10.0k]
  ------------------
  373|  80.6k|    const __m128i shift = _mm_cvtsi32_si128(8 * (8 - idx));
  374|  80.6k|    mask[idx] = _mm256_cvtepi8_epi32(_mm_srl_epi64(ones32, shift));
  375|  80.6k|  }
  376|       |
  377|   198k|  for (int i = -1; i < height + 1; i += 2) {
  ------------------
  |  Branch (377:20): [True: 188k, False: 10.0k]
  ------------------
  378|  1.33M|    for (int j = -1; j < width + 1; j += 8) {
  ------------------
  |  Branch (378:22): [True: 1.14M, False: 188k]
  ------------------
  379|  1.14M|      const int32_t *Cij = C + i * buf_stride + j;
  380|  1.14M|      const int32_t *Dij = D + i * buf_stride + j;
  381|       |
  382|  1.14M|      __m256i sum1 = boxsum_from_ii(Dij, buf_stride, r);
  383|  1.14M|      __m256i sum2 = boxsum_from_ii(Cij, buf_stride, r);
  384|       |
  385|       |      // When width + 2 isn't a multiple of 8, sum1 and sum2 will contain
  386|       |      // some uninitialised data in their upper words. We use a mask to
  387|       |      // ensure that these bits are set to 0.
  388|  1.14M|      int idx = AOMMIN(8, width + 1 - j);
  ------------------
  |  |   34|  1.14M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 953k, False: 188k]
  |  |  ------------------
  ------------------
  389|  1.14M|      assert(idx >= 1);
  390|       |
  391|  1.14M|      if (idx < 8) {
  ------------------
  |  Branch (391:11): [True: 174k, False: 966k]
  ------------------
  392|   174k|        sum1 = _mm256_and_si256(mask[idx], sum1);
  393|   174k|        sum2 = _mm256_and_si256(mask[idx], sum2);
  394|   174k|      }
  395|       |
  396|  1.14M|      const __m256i p = compute_p(sum1, sum2, bit_depth, n);
  397|       |
  398|  1.14M|      const __m256i z = _mm256_min_epi32(
  399|  1.14M|          _mm256_srli_epi32(_mm256_add_epi32(_mm256_mullo_epi32(p, s), rnd_z),
  400|  1.14M|                            SGRPROJ_MTABLE_BITS),
  ------------------
  |  |  117|  1.14M|#define SGRPROJ_MTABLE_BITS 20
  ------------------
  401|  1.14M|          _mm256_set1_epi32(255));
  402|       |
  403|  1.14M|      const __m256i a_res = _mm256_i32gather_epi32(av1_x_by_xplus1, z, 4);
  404|       |
  405|  1.14M|      yy_storeu_256(A + i * buf_stride + j, a_res);
  406|       |
  407|  1.14M|      const __m256i a_complement =
  408|  1.14M|          _mm256_sub_epi32(_mm256_set1_epi32(SGRPROJ_SGR), a_res);
  ------------------
  |  |  104|  1.14M|#define SGRPROJ_SGR (1 << SGRPROJ_SGR_BITS)
  |  |  ------------------
  |  |  |  |  103|  1.14M|#define SGRPROJ_SGR_BITS 8
  |  |  ------------------
  ------------------
  409|       |
  410|       |      // sum1 might have lanes greater than 2^15, so we can't use madd to do
  411|       |      // multiplication involving sum1. However, a_complement and one_over_n
  412|       |      // are both less than 256, so we can multiply them first.
  413|  1.14M|      const __m256i a_comp_over_n = _mm256_madd_epi16(a_complement, one_over_n);
  414|  1.14M|      const __m256i b_int = _mm256_mullo_epi32(a_comp_over_n, sum1);
  415|  1.14M|      const __m256i b_res = _mm256_srli_epi32(_mm256_add_epi32(b_int, rnd_res),
  416|  1.14M|                                              SGRPROJ_RECIP_BITS);
  ------------------
  |  |  118|  1.14M|#define SGRPROJ_RECIP_BITS 12
  ------------------
  417|       |
  418|  1.14M|      yy_storeu_256(B + i * buf_stride + j, b_res);
  419|  1.14M|    }
  420|   188k|  }
  421|  10.0k|}
selfguided_avx2.c:boxsum_from_ii:
  180|  6.81M|static inline __m256i boxsum_from_ii(const int32_t *ii, int stride, int r) {
  181|  6.81M|  const __m256i tl = yy_loadu_256(ii - (r + 1) - (r + 1) * stride);
  182|  6.81M|  const __m256i tr = yy_loadu_256(ii + (r + 0) - (r + 1) * stride);
  183|  6.81M|  const __m256i bl = yy_loadu_256(ii - (r + 1) + r * stride);
  184|  6.81M|  const __m256i br = yy_loadu_256(ii + (r + 0) + r * stride);
  185|  6.81M|  const __m256i u = _mm256_sub_epi32(tr, tl);
  186|  6.81M|  const __m256i v = _mm256_sub_epi32(br, bl);
  187|  6.81M|  return _mm256_sub_epi32(v, u);
  188|  6.81M|}
selfguided_avx2.c:compute_p:
  194|  3.40M|static __m256i compute_p(__m256i sum1, __m256i sum2, int bit_depth, int n) {
  195|  3.40M|  __m256i an, bb;
  196|  3.40M|  if (bit_depth > 8) {
  ------------------
  |  Branch (196:7): [True: 253k, False: 3.15M]
  ------------------
  197|   253k|    const __m256i rounding_a = round_for_shift(2 * (bit_depth - 8));
  198|   253k|    const __m256i rounding_b = round_for_shift(bit_depth - 8);
  199|   253k|    const __m128i shift_a = _mm_cvtsi32_si128(2 * (bit_depth - 8));
  200|   253k|    const __m128i shift_b = _mm_cvtsi32_si128(bit_depth - 8);
  201|   253k|    const __m256i a =
  202|   253k|        _mm256_srl_epi32(_mm256_add_epi32(sum2, rounding_a), shift_a);
  203|   253k|    const __m256i b =
  204|   253k|        _mm256_srl_epi32(_mm256_add_epi32(sum1, rounding_b), shift_b);
  205|       |    // b < 2^14, so we can use a 16-bit madd rather than a 32-bit
  206|       |    // mullo to square it
  207|   253k|    bb = _mm256_madd_epi16(b, b);
  208|   253k|    an = _mm256_max_epi32(_mm256_mullo_epi32(a, _mm256_set1_epi32(n)), bb);
  209|  3.15M|  } else {
  210|  3.15M|    bb = _mm256_madd_epi16(sum1, sum1);
  211|  3.15M|    an = _mm256_mullo_epi32(sum2, _mm256_set1_epi32(n));
  212|  3.15M|  }
  213|  3.40M|  return _mm256_sub_epi32(an, bb);
  214|  3.40M|}
selfguided_avx2.c:final_filter_fast:
  496|  10.0k|                              int height, int highbd) {
  497|  10.0k|  const int nb0 = 5;
  498|  10.0k|  const int nb1 = 4;
  499|       |
  500|  10.0k|  const __m256i rounding0 =
  501|  10.0k|      round_for_shift(SGRPROJ_SGR_BITS + nb0 - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|  10.0k|#define SGRPROJ_SGR_BITS 8
  ------------------
                    round_for_shift(SGRPROJ_SGR_BITS + nb0 - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  10.0k|#define SGRPROJ_RST_BITS 4
  ------------------
  502|  10.0k|  const __m256i rounding1 =
  503|  10.0k|      round_for_shift(SGRPROJ_SGR_BITS + nb1 - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|  10.0k|#define SGRPROJ_SGR_BITS 8
  ------------------
                    round_for_shift(SGRPROJ_SGR_BITS + nb1 - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  10.0k|#define SGRPROJ_RST_BITS 4
  ------------------
  504|       |
  505|  10.0k|  const uint8_t *dgd_real =
  506|  10.0k|      highbd ? (const uint8_t *)CONVERT_TO_SHORTPTR(dgd8) : dgd8;
  ------------------
  |  |   79|  2.57k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  |  Branch (506:7): [True: 2.57k, False: 7.49k]
  ------------------
  507|       |
  508|   364k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (508:19): [True: 354k, False: 10.0k]
  ------------------
  509|   354k|    if (!(i & 1)) {  // even row
  ------------------
  |  Branch (509:9): [True: 178k, False: 175k]
  ------------------
  510|  1.13M|      for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (510:23): [True: 961k, False: 178k]
  ------------------
  511|   961k|        const __m256i a =
  512|   961k|            cross_sum_fast_even_row(A + i * buf_stride + j, buf_stride);
  513|   961k|        const __m256i b =
  514|   961k|            cross_sum_fast_even_row(B + i * buf_stride + j, buf_stride);
  515|       |
  516|   961k|        const __m128i raw =
  517|   961k|            xx_loadu_128(dgd_real + ((i * dgd_stride + j) << highbd));
  518|   961k|        const __m256i src =
  519|   961k|            highbd ? _mm256_cvtepu16_epi32(raw) : _mm256_cvtepu8_epi32(raw);
  ------------------
  |  Branch (519:13): [True: 62.2k, False: 898k]
  ------------------
  520|       |
  521|   961k|        __m256i v = _mm256_add_epi32(_mm256_madd_epi16(a, src), b);
  522|   961k|        __m256i w =
  523|   961k|            _mm256_srai_epi32(_mm256_add_epi32(v, rounding0),
  524|   961k|                              SGRPROJ_SGR_BITS + nb0 - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|   961k|#define SGRPROJ_SGR_BITS 8
  ------------------
                                            SGRPROJ_SGR_BITS + nb0 - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   961k|#define SGRPROJ_RST_BITS 4
  ------------------
  525|       |
  526|   961k|        yy_storeu_256(dst + i * dst_stride + j, w);
  527|   961k|      }
  528|   178k|    } else {  // odd row
  529|  1.12M|      for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (529:23): [True: 948k, False: 175k]
  ------------------
  530|   948k|        const __m256i a = cross_sum_fast_odd_row(A + i * buf_stride + j);
  531|   948k|        const __m256i b = cross_sum_fast_odd_row(B + i * buf_stride + j);
  532|       |
  533|   948k|        const __m128i raw =
  534|   948k|            xx_loadu_128(dgd_real + ((i * dgd_stride + j) << highbd));
  535|   948k|        const __m256i src =
  536|   948k|            highbd ? _mm256_cvtepu16_epi32(raw) : _mm256_cvtepu8_epi32(raw);
  ------------------
  |  Branch (536:13): [True: 58.7k, False: 890k]
  ------------------
  537|       |
  538|   948k|        __m256i v = _mm256_add_epi32(_mm256_madd_epi16(a, src), b);
  539|   948k|        __m256i w =
  540|   948k|            _mm256_srai_epi32(_mm256_add_epi32(v, rounding1),
  541|   948k|                              SGRPROJ_SGR_BITS + nb1 - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|   948k|#define SGRPROJ_SGR_BITS 8
  ------------------
                                            SGRPROJ_SGR_BITS + nb1 - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   948k|#define SGRPROJ_RST_BITS 4
  ------------------
  542|       |
  543|   948k|        yy_storeu_256(dst + i * dst_stride + j, w);
  544|   948k|      }
  545|   175k|    }
  546|   354k|  }
  547|  10.0k|}
selfguided_avx2.c:cross_sum_fast_even_row:
  440|  1.92M|static inline __m256i cross_sum_fast_even_row(const int32_t *buf, int stride) {
  441|  1.92M|  const __m256i xtl = yy_loadu_256(buf - 1 - stride);
  442|  1.92M|  const __m256i xt = yy_loadu_256(buf - stride);
  443|  1.92M|  const __m256i xtr = yy_loadu_256(buf + 1 - stride);
  444|  1.92M|  const __m256i xbl = yy_loadu_256(buf - 1 + stride);
  445|  1.92M|  const __m256i xb = yy_loadu_256(buf + stride);
  446|  1.92M|  const __m256i xbr = yy_loadu_256(buf + 1 + stride);
  447|       |
  448|  1.92M|  const __m256i fives =
  449|  1.92M|      _mm256_add_epi32(xtl, _mm256_add_epi32(xtr, _mm256_add_epi32(xbr, xbl)));
  450|  1.92M|  const __m256i sixes = _mm256_add_epi32(xt, xb);
  451|  1.92M|  const __m256i fives_plus_sixes = _mm256_add_epi32(fives, sixes);
  452|       |
  453|  1.92M|  return _mm256_add_epi32(
  454|  1.92M|      _mm256_add_epi32(_mm256_slli_epi32(fives_plus_sixes, 2),
  455|  1.92M|                       fives_plus_sixes),
  456|  1.92M|      sixes);
  457|  1.92M|}
selfguided_avx2.c:cross_sum_fast_odd_row:
  474|  1.89M|static inline __m256i cross_sum_fast_odd_row(const int32_t *buf) {
  475|  1.89M|  const __m256i xl = yy_loadu_256(buf - 1);
  476|  1.89M|  const __m256i x = yy_loadu_256(buf);
  477|  1.89M|  const __m256i xr = yy_loadu_256(buf + 1);
  478|       |
  479|  1.89M|  const __m256i fives = _mm256_add_epi32(xl, xr);
  480|  1.89M|  const __m256i sixes = x;
  481|       |
  482|  1.89M|  const __m256i fives_plus_sixes = _mm256_add_epi32(fives, sixes);
  483|       |
  484|  1.89M|  return _mm256_add_epi32(
  485|  1.89M|      _mm256_add_epi32(_mm256_slli_epi32(fives_plus_sixes, 2),
  486|  1.89M|                       fives_plus_sixes),
  487|  1.89M|      sixes);
  488|  1.89M|}
selfguided_avx2.c:calc_ab:
  221|  10.0k|                    int sgr_params_idx, int radius_idx) {
  222|  10.0k|  const sgr_params_type *const params = &av1_sgr_params[sgr_params_idx];
  223|  10.0k|  const int r = params->r[radius_idx];
  224|  10.0k|  const int n = (2 * r + 1) * (2 * r + 1);
  225|  10.0k|  const __m256i s = _mm256_set1_epi32(params->s[radius_idx]);
  226|       |  // one_over_n[n-1] is 2^12/n, so easily fits in an int16
  227|  10.0k|  const __m256i one_over_n = _mm256_set1_epi32(av1_one_by_x[n - 1]);
  228|       |
  229|  10.0k|  const __m256i rnd_z = round_for_shift(SGRPROJ_MTABLE_BITS);
  ------------------
  |  |  117|  10.0k|#define SGRPROJ_MTABLE_BITS 20
  ------------------
  230|  10.0k|  const __m256i rnd_res = round_for_shift(SGRPROJ_RECIP_BITS);
  ------------------
  |  |  118|  10.0k|#define SGRPROJ_RECIP_BITS 12
  ------------------
  231|       |
  232|       |  // Set up masks
  233|  10.0k|  const __m128i ones32 = _mm_set_epi32(0, 0, ~0, ~0);
  234|  10.0k|  __m256i mask[8];
  235|  90.6k|  for (int idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (235:21): [True: 80.6k, False: 10.0k]
  ------------------
  236|  80.6k|    const __m128i shift = _mm_cvtsi32_si128(8 * (8 - idx));
  237|  80.6k|    mask[idx] = _mm256_cvtepi8_epi32(_mm_srl_epi64(ones32, shift));
  238|  80.6k|  }
  239|       |
  240|   384k|  for (int i = -1; i < height + 1; ++i) {
  ------------------
  |  Branch (240:20): [True: 374k, False: 10.0k]
  ------------------
  241|  2.64M|    for (int j = -1; j < width + 1; j += 8) {
  ------------------
  |  Branch (241:22): [True: 2.26M, False: 374k]
  ------------------
  242|  2.26M|      const int32_t *Cij = C + i * buf_stride + j;
  243|  2.26M|      const int32_t *Dij = D + i * buf_stride + j;
  244|       |
  245|  2.26M|      __m256i sum1 = boxsum_from_ii(Dij, buf_stride, r);
  246|  2.26M|      __m256i sum2 = boxsum_from_ii(Cij, buf_stride, r);
  247|       |
  248|       |      // When width + 2 isn't a multiple of 8, sum1 and sum2 will contain
  249|       |      // some uninitialised data in their upper words. We use a mask to
  250|       |      // ensure that these bits are set to 0.
  251|  2.26M|      int idx = AOMMIN(8, width + 1 - j);
  ------------------
  |  |   34|  2.26M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.89M, False: 374k]
  |  |  ------------------
  ------------------
  252|  2.26M|      assert(idx >= 1);
  253|       |
  254|  2.26M|      if (idx < 8) {
  ------------------
  |  Branch (254:11): [True: 347k, False: 1.92M]
  ------------------
  255|   347k|        sum1 = _mm256_and_si256(mask[idx], sum1);
  256|   347k|        sum2 = _mm256_and_si256(mask[idx], sum2);
  257|   347k|      }
  258|       |
  259|  2.26M|      const __m256i p = compute_p(sum1, sum2, bit_depth, n);
  260|       |
  261|  2.26M|      const __m256i z = _mm256_min_epi32(
  262|  2.26M|          _mm256_srli_epi32(_mm256_add_epi32(_mm256_mullo_epi32(p, s), rnd_z),
  263|  2.26M|                            SGRPROJ_MTABLE_BITS),
  ------------------
  |  |  117|  2.26M|#define SGRPROJ_MTABLE_BITS 20
  ------------------
  264|  2.26M|          _mm256_set1_epi32(255));
  265|       |
  266|  2.26M|      const __m256i a_res = _mm256_i32gather_epi32(av1_x_by_xplus1, z, 4);
  267|       |
  268|  2.26M|      yy_storeu_256(A + i * buf_stride + j, a_res);
  269|       |
  270|  2.26M|      const __m256i a_complement =
  271|  2.26M|          _mm256_sub_epi32(_mm256_set1_epi32(SGRPROJ_SGR), a_res);
  ------------------
  |  |  104|  2.26M|#define SGRPROJ_SGR (1 << SGRPROJ_SGR_BITS)
  |  |  ------------------
  |  |  |  |  103|  2.26M|#define SGRPROJ_SGR_BITS 8
  |  |  ------------------
  ------------------
  272|       |
  273|       |      // sum1 might have lanes greater than 2^15, so we can't use madd to do
  274|       |      // multiplication involving sum1. However, a_complement and one_over_n
  275|       |      // are both less than 256, so we can multiply them first.
  276|  2.26M|      const __m256i a_comp_over_n = _mm256_madd_epi16(a_complement, one_over_n);
  277|  2.26M|      const __m256i b_int = _mm256_mullo_epi32(a_comp_over_n, sum1);
  278|  2.26M|      const __m256i b_res = _mm256_srli_epi32(_mm256_add_epi32(b_int, rnd_res),
  279|  2.26M|                                              SGRPROJ_RECIP_BITS);
  ------------------
  |  |  118|  2.26M|#define SGRPROJ_RECIP_BITS 12
  ------------------
  280|       |
  281|  2.26M|      yy_storeu_256(B + i * buf_stride + j, b_res);
  282|  2.26M|    }
  283|   374k|  }
  284|  10.0k|}
selfguided_avx2.c:final_filter:
  326|  10.0k|                         int dgd_stride, int width, int height, int highbd) {
  327|  10.0k|  const int nb = 5;
  328|  10.0k|  const __m256i rounding =
  329|  10.0k|      round_for_shift(SGRPROJ_SGR_BITS + nb - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|  10.0k|#define SGRPROJ_SGR_BITS 8
  ------------------
                    round_for_shift(SGRPROJ_SGR_BITS + nb - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  10.0k|#define SGRPROJ_RST_BITS 4
  ------------------
  330|  10.0k|  const uint8_t *dgd_real =
  331|  10.0k|      highbd ? (const uint8_t *)CONVERT_TO_SHORTPTR(dgd8) : dgd8;
  ------------------
  |  |   79|  2.57k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  |  Branch (331:7): [True: 2.57k, False: 7.49k]
  ------------------
  332|       |
  333|   364k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (333:19): [True: 354k, False: 10.0k]
  ------------------
  334|  2.26M|    for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (334:21): [True: 1.90M, False: 354k]
  ------------------
  335|  1.90M|      const __m256i a = cross_sum(A + i * buf_stride + j, buf_stride);
  336|  1.90M|      const __m256i b = cross_sum(B + i * buf_stride + j, buf_stride);
  337|       |
  338|  1.90M|      const __m128i raw =
  339|  1.90M|          xx_loadu_128(dgd_real + ((i * dgd_stride + j) << highbd));
  340|  1.90M|      const __m256i src =
  341|  1.90M|          highbd ? _mm256_cvtepu16_epi32(raw) : _mm256_cvtepu8_epi32(raw);
  ------------------
  |  Branch (341:11): [True: 121k, False: 1.78M]
  ------------------
  342|       |
  343|  1.90M|      __m256i v = _mm256_add_epi32(_mm256_madd_epi16(a, src), b);
  344|  1.90M|      __m256i w = _mm256_srai_epi32(_mm256_add_epi32(v, rounding),
  345|  1.90M|                                    SGRPROJ_SGR_BITS + nb - SGRPROJ_RST_BITS);
  ------------------
  |  |  103|  1.90M|#define SGRPROJ_SGR_BITS 8
  ------------------
                                                  SGRPROJ_SGR_BITS + nb - SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  1.90M|#define SGRPROJ_RST_BITS 4
  ------------------
  346|       |
  347|  1.90M|      yy_storeu_256(dst + i * dst_stride + j, w);
  348|  1.90M|    }
  349|   354k|  }
  350|  10.0k|}
selfguided_avx2.c:cross_sum:
  302|  3.81M|static inline __m256i cross_sum(const int32_t *buf, int stride) {
  303|  3.81M|  const __m256i xtl = yy_loadu_256(buf - 1 - stride);
  304|  3.81M|  const __m256i xt = yy_loadu_256(buf - stride);
  305|  3.81M|  const __m256i xtr = yy_loadu_256(buf + 1 - stride);
  306|  3.81M|  const __m256i xl = yy_loadu_256(buf - 1);
  307|  3.81M|  const __m256i x = yy_loadu_256(buf);
  308|  3.81M|  const __m256i xr = yy_loadu_256(buf + 1);
  309|  3.81M|  const __m256i xbl = yy_loadu_256(buf - 1 + stride);
  310|  3.81M|  const __m256i xb = yy_loadu_256(buf + stride);
  311|  3.81M|  const __m256i xbr = yy_loadu_256(buf + 1 + stride);
  312|       |
  313|  3.81M|  const __m256i fours = _mm256_add_epi32(
  314|  3.81M|      xl, _mm256_add_epi32(xt, _mm256_add_epi32(xr, _mm256_add_epi32(xb, x))));
  315|  3.81M|  const __m256i threes =
  316|  3.81M|      _mm256_add_epi32(xtl, _mm256_add_epi32(xtr, _mm256_add_epi32(xbr, xbl)));
  317|       |
  318|  3.81M|  return _mm256_sub_epi32(_mm256_slli_epi32(_mm256_add_epi32(fours, threes), 2),
  319|  3.81M|                          threes);
  320|  3.81M|}
selfguided_avx2.c:round_for_shift:
  190|   789k|static __m256i round_for_shift(unsigned shift) {
  191|   789k|  return _mm256_set1_epi32((1 << shift) >> 1);
  192|   789k|}

av1_warp_affine_avx2:
 1032|   180k|                          int16_t beta, int16_t gamma, int16_t delta) {
 1033|   180k|  __m256i horz_out[8];
 1034|   180k|  int i, j, k;
 1035|   180k|  const int bd = 8;
 1036|   180k|  const int reduce_bits_horiz = conv_params->round_0;
 1037|   180k|  const int reduce_bits_vert = conv_params->is_compound
  ------------------
  |  Branch (1037:32): [True: 0, False: 180k]
  ------------------
 1038|   180k|                                   ? conv_params->round_1
 1039|   180k|                                   : 2 * FILTER_BITS - reduce_bits_horiz;
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1040|   180k|  const int offset_bits_horiz = bd + FILTER_BITS - 1;
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1041|   180k|  assert(IMPLIES(conv_params->is_compound, conv_params->dst != NULL));
 1042|       |
 1043|   180k|  const int offset_bits_vert = bd + 2 * FILTER_BITS - reduce_bits_horiz;
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1044|   180k|  const __m256i reduce_bits_vert_const =
 1045|   180k|      _mm256_set1_epi32(((1 << reduce_bits_vert) >> 1));
 1046|   180k|  const __m256i res_add_const = _mm256_set1_epi32(1 << offset_bits_vert);
 1047|   180k|  const int round_bits =
 1048|   180k|      2 * FILTER_BITS - conv_params->round_0 - conv_params->round_1;
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1049|   180k|  const int offset_bits = bd + 2 * FILTER_BITS - conv_params->round_0;
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1050|   180k|  assert(IMPLIES(conv_params->do_average, conv_params->is_compound));
 1051|       |
 1052|   180k|  const __m256i round_const = _mm256_set1_epi16(
 1053|   180k|      (1 << offset_bits_horiz) + ((1 << reduce_bits_horiz) >> 1));
 1054|   180k|  const __m128i shift = _mm_cvtsi32_si128(reduce_bits_horiz);
 1055|       |
 1056|   180k|  __m256i res_sub_const, round_bits_const, wt;
 1057|   180k|  unpack_weights_and_set_round_const_avx2(conv_params, round_bits, offset_bits,
 1058|   180k|                                          &res_sub_const, &round_bits_const,
 1059|   180k|                                          &wt);
 1060|       |
 1061|   180k|  __m256i res_add_const_1;
 1062|   180k|  if (conv_params->is_compound == 1) {
  ------------------
  |  Branch (1062:7): [True: 0, False: 180k]
  ------------------
 1063|      0|    res_add_const_1 = _mm256_add_epi32(reduce_bits_vert_const, res_add_const);
 1064|   180k|  } else {
 1065|   180k|    res_add_const_1 = _mm256_set1_epi32(-(1 << (bd + reduce_bits_vert - 1)) +
 1066|   180k|                                        ((1 << reduce_bits_vert) >> 1));
 1067|   180k|  }
 1068|   180k|  const int32_t const1 = alpha * (-4) + beta * (-4) +
 1069|   180k|                         (1 << (WARPEDDIFF_PREC_BITS - 1)) +
  ------------------
  |  |  107|   180k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   180k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
 1070|   180k|                         (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  103|   180k|#define WARPEDPIXEL_PREC_SHIFTS (1 << WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
                                       (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  107|   180k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   180k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
 1071|   180k|  const int32_t const2 = gamma * (-4) + delta * (-4) +
 1072|   180k|                         (1 << (WARPEDDIFF_PREC_BITS - 1)) +
  ------------------
  |  |  107|   180k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   180k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
 1073|   180k|                         (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  103|   180k|#define WARPEDPIXEL_PREC_SHIFTS (1 << WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
                                       (WARPEDPIXEL_PREC_SHIFTS << WARPEDDIFF_PREC_BITS);
  ------------------
  |  |  107|   180k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   180k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   180k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
 1074|   180k|  const int32_t const3 = ((1 << WARP_PARAM_REDUCE_BITS) - 1);
  ------------------
  |  |  105|   180k|#define WARP_PARAM_REDUCE_BITS 6
  ------------------
 1075|   180k|  const int16_t const4 = (1 << (bd + FILTER_BITS - reduce_bits_horiz - 1));
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1076|   180k|  const int16_t const5 = (1 << (FILTER_BITS - reduce_bits_horiz));
  ------------------
  |  |   21|   180k|#define FILTER_BITS 7
  ------------------
 1077|       |
 1078|   180k|  __m256i shuffle_src[4];
 1079|   180k|  shuffle_src[0] = _mm256_load_si256((__m256i *)shuffle_src0);
 1080|   180k|  shuffle_src[1] = _mm256_load_si256((__m256i *)shuffle_src1);
 1081|   180k|  shuffle_src[2] = _mm256_load_si256((__m256i *)shuffle_src2);
 1082|   180k|  shuffle_src[3] = _mm256_load_si256((__m256i *)shuffle_src3);
 1083|       |
 1084|   384k|  for (i = 0; i < p_height; i += 8) {
  ------------------
  |  Branch (1084:15): [True: 203k, False: 180k]
  ------------------
 1085|   489k|    for (j = 0; j < p_width; j += 8) {
  ------------------
  |  Branch (1085:17): [True: 286k, False: 203k]
  ------------------
 1086|   286k|      const int32_t src_x = (p_col + j + 4) << subsampling_x;
 1087|   286k|      const int32_t src_y = (p_row + i + 4) << subsampling_y;
 1088|   286k|      const int64_t dst_x =
 1089|   286k|          (int64_t)mat[2] * src_x + (int64_t)mat[3] * src_y + (int64_t)mat[0];
 1090|   286k|      const int64_t dst_y =
 1091|   286k|          (int64_t)mat[4] * src_x + (int64_t)mat[5] * src_y + (int64_t)mat[1];
 1092|   286k|      const int64_t x4 = dst_x >> subsampling_x;
 1093|   286k|      const int64_t y4 = dst_y >> subsampling_y;
 1094|       |
 1095|   286k|      int32_t ix4 = (int32_t)(x4 >> WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 1096|   286k|      int32_t sx4 = x4 & ((1 << WARPEDMODEL_PREC_BITS) - 1);
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 1097|   286k|      int32_t iy4 = (int32_t)(y4 >> WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 1098|   286k|      int32_t sy4 = y4 & ((1 << WARPEDMODEL_PREC_BITS) - 1);
  ------------------
  |  |   96|   286k|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 1099|       |
 1100|       |      // Add in all the constant terms, including rounding and offset
 1101|   286k|      sx4 += const1;
 1102|   286k|      sy4 += const2;
 1103|       |
 1104|   286k|      sx4 &= ~const3;
 1105|   286k|      sy4 &= ~const3;
 1106|       |
 1107|       |      // Horizontal filter
 1108|       |      // If the block is aligned such that, after clamping, every sample
 1109|       |      // would be taken from the leftmost/rightmost column, then we can
 1110|       |      // skip the expensive horizontal filter.
 1111|       |
 1112|   286k|      if (ix4 <= -7) {
  ------------------
  |  Branch (1112:11): [True: 2.55k, False: 283k]
  ------------------
 1113|  2.55k|        int iy, row = 0;
 1114|  20.4k|        for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|  20.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.33k, False: 16.0k]
  |  |  ------------------
  ------------------
  |  Branch (1114:22): [True: 17.8k, False: 2.55k]
  ------------------
 1115|  17.8k|          iy = iy4 + k;
 1116|  17.8k|          iy = clamp(iy, 0, height - 1);
 1117|  17.8k|          const __m256i temp_0 =
 1118|  17.8k|              _mm256_set1_epi16(const4 + ref[iy * stride] * const5);
 1119|  17.8k|          iy = iy4 + k + 1;
 1120|  17.8k|          iy = clamp(iy, 0, height - 1);
 1121|  17.8k|          const __m256i temp_1 =
 1122|  17.8k|              _mm256_set1_epi16(const4 + ref[iy * stride] * const5);
 1123|  17.8k|          horz_out[row] = _mm256_blend_epi32(temp_0, temp_1, 0xf0);
 1124|  17.8k|          row += 1;
 1125|  17.8k|        }
 1126|  2.55k|        iy = iy4 + k;
 1127|  2.55k|        iy = clamp(iy, 0, height - 1);
 1128|  2.55k|        horz_out[row] = _mm256_set1_epi16(const4 + ref[iy * stride] * const5);
 1129|   283k|      } else if (ix4 >= width + 6) {
  ------------------
  |  Branch (1129:18): [True: 21.8k, False: 261k]
  ------------------
 1130|  21.8k|        int iy, row = 0;
 1131|   174k|        for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|   174k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 88.5k, False: 86.3k]
  |  |  ------------------
  ------------------
  |  Branch (1131:22): [True: 153k, False: 21.8k]
  ------------------
 1132|   153k|          iy = iy4 + k;
 1133|   153k|          iy = clamp(iy, 0, height - 1);
 1134|   153k|          const __m256i temp_0 = _mm256_set1_epi16(
 1135|   153k|              const4 + ref[iy * stride + (width - 1)] * const5);
 1136|   153k|          iy = iy4 + k + 1;
 1137|   153k|          iy = clamp(iy, 0, height - 1);
 1138|   153k|          const __m256i temp_1 = _mm256_set1_epi16(
 1139|   153k|              const4 + ref[iy * stride + (width - 1)] * const5);
 1140|   153k|          horz_out[row] = _mm256_blend_epi32(temp_0, temp_1, 0xf0);
 1141|   153k|          row += 1;
 1142|   153k|        }
 1143|  21.8k|        iy = iy4 + k;
 1144|  21.8k|        iy = clamp(iy, 0, height - 1);
 1145|  21.8k|        horz_out[row] =
 1146|  21.8k|            _mm256_set1_epi16(const4 + ref[iy * stride + (width - 1)] * const5);
 1147|   261k|      } else if (((ix4 - 7) < 0) || ((ix4 + 9) > width)) {
  ------------------
  |  Branch (1147:18): [True: 35.8k, False: 225k]
  |  Branch (1147:37): [True: 52.5k, False: 173k]
  ------------------
 1148|  88.8k|        const int out_of_boundary_left = -(ix4 - 6);
 1149|  88.8k|        const int out_of_boundary_right = (ix4 + 8) - width;
 1150|  88.8k|        int iy, sx, row = 0;
 1151|   708k|        for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|   708k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 162k, False: 545k]
  |  |  ------------------
  ------------------
  |  Branch (1151:22): [True: 619k, False: 88.8k]
  ------------------
 1152|   619k|          iy = iy4 + k;
 1153|   619k|          iy = clamp(iy, 0, height - 1);
 1154|   619k|          __m128i src0 =
 1155|   619k|              _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
 1156|   619k|          iy = iy4 + k + 1;
 1157|   619k|          iy = clamp(iy, 0, height - 1);
 1158|   619k|          __m128i src1 =
 1159|   619k|              _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
 1160|       |
 1161|   619k|          if (out_of_boundary_left >= 0) {
  ------------------
  |  Branch (1161:15): [True: 251k, False: 368k]
  ------------------
 1162|   251k|            const __m128i shuffle_reg_left =
 1163|   251k|                _mm_loadu_si128((__m128i *)warp_pad_left[out_of_boundary_left]);
 1164|   251k|            src0 = _mm_shuffle_epi8(src0, shuffle_reg_left);
 1165|   251k|            src1 = _mm_shuffle_epi8(src1, shuffle_reg_left);
 1166|   251k|          }
 1167|   619k|          if (out_of_boundary_right >= 0) {
  ------------------
  |  Branch (1167:15): [True: 424k, False: 195k]
  ------------------
 1168|   424k|            const __m128i shuffle_reg_right = _mm_loadu_si128(
 1169|   424k|                (__m128i *)warp_pad_right[out_of_boundary_right]);
 1170|   424k|            src0 = _mm_shuffle_epi8(src0, shuffle_reg_right);
 1171|   424k|            src1 = _mm_shuffle_epi8(src1, shuffle_reg_right);
 1172|   424k|          }
 1173|   619k|          sx = sx4 + beta * (k + 4);
 1174|   619k|          const __m256i src_01 =
 1175|   619k|              _mm256_inserti128_si256(_mm256_castsi128_si256(src0), src1, 0x1);
 1176|   619k|          horizontal_filter_avx2(src_01, horz_out, sx, alpha, beta, row,
 1177|   619k|                                 shuffle_src, &round_const, &shift);
 1178|   619k|          row += 1;
 1179|   619k|        }
 1180|  88.8k|        iy = iy4 + k;
 1181|  88.8k|        iy = clamp(iy, 0, height - 1);
 1182|  88.8k|        __m128i src = _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
 1183|  88.8k|        if (out_of_boundary_left >= 0) {
  ------------------
  |  Branch (1183:13): [True: 36.0k, False: 52.8k]
  ------------------
 1184|  36.0k|          const __m128i shuffle_reg_left =
 1185|  36.0k|              _mm_loadu_si128((__m128i *)warp_pad_left[out_of_boundary_left]);
 1186|  36.0k|          src = _mm_shuffle_epi8(src, shuffle_reg_left);
 1187|  36.0k|        }
 1188|  88.8k|        if (out_of_boundary_right >= 0) {
  ------------------
  |  Branch (1188:13): [True: 60.7k, False: 28.1k]
  ------------------
 1189|  60.7k|          const __m128i shuffle_reg_right =
 1190|  60.7k|              _mm_loadu_si128((__m128i *)warp_pad_right[out_of_boundary_right]);
 1191|  60.7k|          src = _mm_shuffle_epi8(src, shuffle_reg_right);
 1192|  60.7k|        }
 1193|  88.8k|        sx = sx4 + beta * (k + 4);
 1194|  88.8k|        const __m256i src_01 = _mm256_castsi128_si256(src);
 1195|  88.8k|        __m256i coeff[4];
 1196|  88.8k|        prepare_horizontal_filter_coeff(alpha, sx, coeff);
 1197|  88.8k|        filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src,
 1198|  88.8k|                               &round_const, &shift, row);
 1199|   172k|      } else {
 1200|   172k|        prepare_warp_horizontal_filter_avx2(
 1201|   172k|            ref, horz_out, stride, ix4, iy4, sx4, alpha, beta, p_height, height,
 1202|   172k|            i, &round_const, &shift, shuffle_src);
 1203|   172k|      }
 1204|       |
 1205|       |      // Vertical filter
 1206|   286k|      prepare_warp_vertical_filter_avx2(
 1207|   286k|          pred, horz_out, conv_params, gamma, delta, p_height, p_stride,
 1208|   286k|          p_width, i, j, sy4, reduce_bits_vert, &res_add_const_1, round_bits,
 1209|   286k|          &res_sub_const, &round_bits_const, &wt);
 1210|   286k|    }
 1211|   203k|  }
 1212|   180k|}
warp_plane_avx2.c:unpack_weights_and_set_round_const_avx2:
  435|   180k|    __m256i *res_sub_const, __m256i *round_bits_const, __m256i *wt) {
  436|   180k|  *res_sub_const =
  437|   180k|      _mm256_set1_epi16(-(1 << (offset_bits - conv_params->round_1)) -
  438|   180k|                        (1 << (offset_bits - conv_params->round_1 - 1)));
  439|   180k|  *round_bits_const = _mm256_set1_epi16(((1 << round_bits) >> 1));
  440|       |
  441|   180k|  const int w0 = conv_params->fwd_offset;
  442|   180k|  const int w1 = conv_params->bck_offset;
  443|   180k|  const __m256i wt0 = _mm256_set1_epi16((short)w0);
  444|   180k|  const __m256i wt1 = _mm256_set1_epi16((short)w1);
  445|   180k|  *wt = _mm256_unpacklo_epi16(wt0, wt1);
  446|   180k|}
warp_plane_avx2.c:horizontal_filter_avx2:
  260|  1.33M|                                          const __m128i *shift) {
  261|  1.33M|  __m256i coeff[4];
  262|  1.33M|  prepare_horizontal_filter_coeff_avx2(alpha, beta, sx, coeff);
  263|  1.33M|  filter_src_pixels_avx2(src, horz_out, coeff, shuffle_src, round_const, shift,
  264|  1.33M|                         row);
  265|  1.33M|}
warp_plane_avx2.c:prepare_horizontal_filter_coeff_avx2:
  103|  1.33M|                                                        __m256i *coeff) {
  104|  1.33M|  __m128i tmp_0 = _mm_loadl_epi64(
  105|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 0 * alpha)) >>
  106|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  107|  1.33M|  __m128i tmp_1 = _mm_loadl_epi64(
  108|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 1 * alpha)) >>
  109|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  110|  1.33M|  __m128i tmp_2 = _mm_loadl_epi64(
  111|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 2 * alpha)) >>
  112|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  113|  1.33M|  __m128i tmp_3 = _mm_loadl_epi64(
  114|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 3 * alpha)) >>
  115|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  116|       |
  117|  1.33M|  __m128i tmp_4 = _mm_loadl_epi64(
  118|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 4 * alpha)) >>
  119|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  120|  1.33M|  __m128i tmp_5 = _mm_loadl_epi64(
  121|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 5 * alpha)) >>
  122|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  123|  1.33M|  __m128i tmp_6 = _mm_loadl_epi64(
  124|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 6 * alpha)) >>
  125|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  126|  1.33M|  __m128i tmp_7 = _mm_loadl_epi64(
  127|  1.33M|      (__m128i *)&av1_filter_8bit[((unsigned)(sx + 7 * alpha)) >>
  128|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  129|       |
  130|  1.33M|  __m256i tmp0_256 = _mm256_castsi128_si256(tmp_0);
  131|  1.33M|  __m256i tmp2_256 = _mm256_castsi128_si256(tmp_2);
  132|  1.33M|  __m256i tmp1_256 = _mm256_castsi128_si256(tmp_1);
  133|  1.33M|  __m256i tmp3_256 = _mm256_castsi128_si256(tmp_3);
  134|       |
  135|  1.33M|  __m256i tmp4_256 = _mm256_castsi128_si256(tmp_4);
  136|  1.33M|  __m256i tmp6_256 = _mm256_castsi128_si256(tmp_6);
  137|  1.33M|  __m256i tmp5_256 = _mm256_castsi128_si256(tmp_5);
  138|  1.33M|  __m256i tmp7_256 = _mm256_castsi128_si256(tmp_7);
  139|       |
  140|  1.33M|  __m128i tmp_8 = _mm_loadl_epi64(
  141|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 0 * alpha) >>
  142|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  143|  1.33M|  tmp0_256 = _mm256_inserti128_si256(tmp0_256, tmp_8, 1);
  144|       |
  145|  1.33M|  __m128i tmp_9 = _mm_loadl_epi64(
  146|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 1 * alpha) >>
  147|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  148|  1.33M|  tmp1_256 = _mm256_inserti128_si256(tmp1_256, tmp_9, 1);
  149|       |
  150|  1.33M|  __m128i tmp_10 = _mm_loadl_epi64(
  151|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 2 * alpha) >>
  152|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  153|  1.33M|  tmp2_256 = _mm256_inserti128_si256(tmp2_256, tmp_10, 1);
  154|       |
  155|  1.33M|  __m128i tmp_11 = _mm_loadl_epi64(
  156|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 3 * alpha) >>
  157|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  158|  1.33M|  tmp3_256 = _mm256_inserti128_si256(tmp3_256, tmp_11, 1);
  159|       |
  160|  1.33M|  tmp_2 = _mm_loadl_epi64(
  161|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 4 * alpha) >>
  162|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  163|  1.33M|  tmp4_256 = _mm256_inserti128_si256(tmp4_256, tmp_2, 1);
  164|       |
  165|  1.33M|  tmp_3 = _mm_loadl_epi64(
  166|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 5 * alpha) >>
  167|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  168|  1.33M|  tmp5_256 = _mm256_inserti128_si256(tmp5_256, tmp_3, 1);
  169|       |
  170|  1.33M|  tmp_6 = _mm_loadl_epi64(
  171|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 6 * alpha) >>
  172|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  173|  1.33M|  tmp6_256 = _mm256_inserti128_si256(tmp6_256, tmp_6, 1);
  174|       |
  175|  1.33M|  tmp_7 = _mm_loadl_epi64(
  176|  1.33M|      (__m128i *)&av1_filter_8bit[(unsigned)((sx + beta) + 7 * alpha) >>
  177|  1.33M|                                  WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  1.33M|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  1.33M|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  1.33M|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  178|  1.33M|  tmp7_256 = _mm256_inserti128_si256(tmp7_256, tmp_7, 1);
  179|       |
  180|  1.33M|  const __m256i tmp_12 = _mm256_unpacklo_epi16(tmp0_256, tmp2_256);
  181|  1.33M|  const __m256i tmp_13 = _mm256_unpacklo_epi16(tmp1_256, tmp3_256);
  182|  1.33M|  const __m256i tmp_14 = _mm256_unpacklo_epi16(tmp4_256, tmp6_256);
  183|  1.33M|  const __m256i tmp_15 = _mm256_unpacklo_epi16(tmp5_256, tmp7_256);
  184|       |
  185|  1.33M|  const __m256i res_0 = _mm256_unpacklo_epi32(tmp_12, tmp_14);
  186|  1.33M|  const __m256i res_1 = _mm256_unpackhi_epi32(tmp_12, tmp_14);
  187|  1.33M|  const __m256i res_2 = _mm256_unpacklo_epi32(tmp_13, tmp_15);
  188|  1.33M|  const __m256i res_3 = _mm256_unpackhi_epi32(tmp_13, tmp_15);
  189|       |
  190|  1.33M|  coeff[0] = _mm256_unpacklo_epi64(res_0, res_2);
  191|  1.33M|  coeff[1] = _mm256_unpackhi_epi64(res_0, res_2);
  192|  1.33M|  coeff[2] = _mm256_unpacklo_epi64(res_1, res_3);
  193|  1.33M|  coeff[3] = _mm256_unpackhi_epi64(res_1, res_3);
  194|  1.33M|}
warp_plane_avx2.c:prepare_horizontal_filter_coeff:
  267|   193k|                                                   __m256i *coeff) {
  268|   193k|  const __m128i tmp_0 = _mm_loadl_epi64(
  269|   193k|      (__m128i *)&av1_filter_8bit[(sx + 0 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  270|   193k|  const __m128i tmp_1 = _mm_loadl_epi64(
  271|   193k|      (__m128i *)&av1_filter_8bit[(sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  272|   193k|  const __m128i tmp_2 = _mm_loadl_epi64(
  273|   193k|      (__m128i *)&av1_filter_8bit[(sx + 2 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  274|   193k|  const __m128i tmp_3 = _mm_loadl_epi64(
  275|   193k|      (__m128i *)&av1_filter_8bit[(sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  276|   193k|  const __m128i tmp_4 = _mm_loadl_epi64(
  277|   193k|      (__m128i *)&av1_filter_8bit[(sx + 4 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  278|   193k|  const __m128i tmp_5 = _mm_loadl_epi64(
  279|   193k|      (__m128i *)&av1_filter_8bit[(sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  280|   193k|  const __m128i tmp_6 = _mm_loadl_epi64(
  281|   193k|      (__m128i *)&av1_filter_8bit[(sx + 6 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  282|   193k|  const __m128i tmp_7 = _mm_loadl_epi64(
  283|   193k|      (__m128i *)&av1_filter_8bit[(sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|   193k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   193k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   193k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  284|       |
  285|   193k|  const __m128i tmp_8 = _mm_unpacklo_epi16(tmp_0, tmp_2);
  286|   193k|  const __m128i tmp_9 = _mm_unpacklo_epi16(tmp_1, tmp_3);
  287|   193k|  const __m128i tmp_10 = _mm_unpacklo_epi16(tmp_4, tmp_6);
  288|   193k|  const __m128i tmp_11 = _mm_unpacklo_epi16(tmp_5, tmp_7);
  289|       |
  290|   193k|  const __m128i tmp_12 = _mm_unpacklo_epi32(tmp_8, tmp_10);
  291|   193k|  const __m128i tmp_13 = _mm_unpackhi_epi32(tmp_8, tmp_10);
  292|   193k|  const __m128i tmp_14 = _mm_unpacklo_epi32(tmp_9, tmp_11);
  293|   193k|  const __m128i tmp_15 = _mm_unpackhi_epi32(tmp_9, tmp_11);
  294|       |
  295|   193k|  coeff[0] = _mm256_castsi128_si256(_mm_unpacklo_epi64(tmp_12, tmp_14));
  296|   193k|  coeff[1] = _mm256_castsi128_si256(_mm_unpackhi_epi64(tmp_12, tmp_14));
  297|   193k|  coeff[2] = _mm256_castsi128_si256(_mm_unpacklo_epi64(tmp_13, tmp_15));
  298|   193k|  coeff[3] = _mm256_castsi128_si256(_mm_unpackhi_epi64(tmp_13, tmp_15));
  299|   193k|}
warp_plane_avx2.c:filter_src_pixels_avx2:
   83|  2.05M|                                          const __m128i *shift, int row) {
   84|  2.05M|  const __m256i src_0 = _mm256_shuffle_epi8(src, shuffle_src[0]);
   85|  2.05M|  const __m256i src_1 = _mm256_shuffle_epi8(src, shuffle_src[1]);
   86|  2.05M|  const __m256i src_2 = _mm256_shuffle_epi8(src, shuffle_src[2]);
   87|  2.05M|  const __m256i src_3 = _mm256_shuffle_epi8(src, shuffle_src[3]);
   88|       |
   89|  2.05M|  const __m256i res_02 = _mm256_maddubs_epi16(src_0, coeff[0]);
   90|  2.05M|  const __m256i res_46 = _mm256_maddubs_epi16(src_1, coeff[1]);
   91|  2.05M|  const __m256i res_13 = _mm256_maddubs_epi16(src_2, coeff[2]);
   92|  2.05M|  const __m256i res_57 = _mm256_maddubs_epi16(src_3, coeff[3]);
   93|       |
   94|  2.05M|  const __m256i res_even = _mm256_add_epi16(res_02, res_46);
   95|  2.05M|  const __m256i res_odd = _mm256_add_epi16(res_13, res_57);
   96|  2.05M|  const __m256i res =
   97|  2.05M|      _mm256_add_epi16(_mm256_add_epi16(res_even, res_odd), *round_const);
   98|  2.05M|  horz_out[row] = _mm256_srl_epi16(res, *shift);
   99|  2.05M|}
warp_plane_avx2.c:prepare_warp_horizontal_filter_avx2:
 1008|   173k|    const __m256i *shuffle_src) {
 1009|   173k|  if (alpha == 0 && beta == 0)
  ------------------
  |  Branch (1009:7): [True: 37.1k, False: 136k]
  |  Branch (1009:21): [True: 34.8k, False: 2.26k]
  ------------------
 1010|  34.8k|    warp_horizontal_filter_alpha0_beta0_avx2(
 1011|  34.8k|        ref, horz_out, stride, ix4, iy4, sx4, alpha, beta, p_height, height, i,
 1012|  34.8k|        round_const, shift, shuffle_src);
 1013|   138k|  else if (alpha == 0 && beta != 0)
  ------------------
  |  Branch (1013:12): [True: 2.27k, False: 136k]
  |  Branch (1013:26): [True: 2.27k, False: 0]
  ------------------
 1014|  2.27k|    warp_horizontal_filter_alpha0_avx2(ref, horz_out, stride, ix4, iy4, sx4,
 1015|  2.27k|                                       alpha, beta, p_height, height, i,
 1016|  2.27k|                                       round_const, shift, shuffle_src);
 1017|   136k|  else if (alpha != 0 && beta == 0)
  ------------------
  |  Branch (1017:12): [True: 136k, False: 18.4E]
  |  Branch (1017:26): [True: 31.3k, False: 104k]
  ------------------
 1018|  31.3k|    warp_horizontal_filter_beta0_avx2(ref, horz_out, stride, ix4, iy4, sx4,
 1019|  31.3k|                                      alpha, beta, p_height, height, i,
 1020|  31.3k|                                      round_const, shift, shuffle_src);
 1021|   104k|  else
 1022|   104k|    warp_horizontal_filter_avx2(ref, horz_out, stride, ix4, iy4, sx4, alpha,
 1023|   104k|                                beta, p_height, height, i, round_const, shift,
 1024|   104k|                                shuffle_src);
 1025|   173k|}
warp_plane_avx2.c:warp_horizontal_filter_alpha0_beta0_avx2:
  405|  34.8k|    const __m256i *shuffle_src) {
  406|  34.8k|  (void)alpha;
  407|  34.8k|  int k, iy, row = 0;
  408|  34.8k|  __m256i coeff[4];
  409|  34.8k|  prepare_horizontal_filter_coeff_alpha0_avx2(beta, sx4, coeff);
  410|   278k|  for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|   278k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 42.5k, False: 236k]
  |  |  ------------------
  ------------------
  |  Branch (410:16): [True: 243k, False: 34.8k]
  ------------------
  411|   243k|    iy = iy4 + k;
  412|   243k|    iy = clamp(iy, 0, height - 1);
  413|   243k|    const __m128i src0 =
  414|   243k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  415|   243k|    iy = iy4 + k + 1;
  416|   243k|    iy = clamp(iy, 0, height - 1);
  417|   243k|    const __m128i src1 =
  418|   243k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  419|   243k|    const __m256i src_01 =
  420|       |        _mm256_inserti128_si256(_mm256_castsi128_si256(src0), src1, 0x1);
  421|   243k|    filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  422|   243k|                           shift, row);
  423|   243k|    row += 1;
  424|   243k|  }
  425|  34.8k|  iy = iy4 + k;
  426|  34.8k|  iy = clamp(iy, 0, height - 1);
  427|  34.8k|  const __m256i src_01 = _mm256_castsi128_si256(
  428|  34.8k|      _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7)));
  429|  34.8k|  filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  430|  34.8k|                         shift, row);
  431|  34.8k|}
warp_plane_avx2.c:prepare_horizontal_filter_coeff_alpha0_avx2:
  237|  53.0k|                                                               __m256i *coeff) {
  238|  53.0k|  const __m128i tmp_0 =
  239|  53.0k|      _mm_loadl_epi64((__m128i *)&av1_filter_8bit[sx >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  53.0k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  53.0k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  53.0k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  240|  53.0k|  const __m128i tmp_1 = _mm_loadl_epi64(
  241|  53.0k|      (__m128i *)&av1_filter_8bit[(sx + beta) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  53.0k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  53.0k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  53.0k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  242|       |
  243|  53.0k|  const __m256i res_0 =
  244|  53.0k|      _mm256_inserti128_si256(_mm256_castsi128_si256(tmp_0), tmp_1, 0x1);
  245|       |
  246|  53.0k|  coeff[0] = _mm256_shuffle_epi8(
  247|  53.0k|      res_0, _mm256_load_si256((__m256i *)shuffle_alpha0_mask01_avx2));
  248|  53.0k|  coeff[1] = _mm256_shuffle_epi8(
  249|  53.0k|      res_0, _mm256_load_si256((__m256i *)shuffle_alpha0_mask23_avx2));
  250|  53.0k|  coeff[2] = _mm256_shuffle_epi8(
  251|  53.0k|      res_0, _mm256_load_si256((__m256i *)shuffle_alpha0_mask45_avx2));
  252|  53.0k|  coeff[3] = _mm256_shuffle_epi8(
  253|  53.0k|      res_0, _mm256_load_si256((__m256i *)shuffle_alpha0_mask67_avx2));
  254|  53.0k|}
warp_plane_avx2.c:warp_horizontal_filter_alpha0_avx2:
  338|  2.27k|    const __m256i *shuffle_src) {
  339|  2.27k|  (void)alpha;
  340|  2.27k|  int k, iy, sx, row = 0;
  341|  2.27k|  __m256i coeff[4];
  342|  18.1k|  for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|  18.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.7k, False: 6.36k]
  |  |  ------------------
  ------------------
  |  Branch (342:16): [True: 15.8k, False: 2.27k]
  ------------------
  343|  15.8k|    iy = iy4 + k;
  344|  15.8k|    iy = clamp(iy, 0, height - 1);
  345|  15.8k|    const __m128i src_0 =
  346|  15.8k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  347|  15.8k|    iy = iy4 + k + 1;
  348|  15.8k|    iy = clamp(iy, 0, height - 1);
  349|  15.8k|    const __m128i src_1 =
  350|  15.8k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  351|  15.8k|    const __m256i src_01 =
  352|       |        _mm256_inserti128_si256(_mm256_castsi128_si256(src_0), src_1, 0x1);
  353|  15.8k|    sx = sx4 + beta * (k + 4);
  354|  15.8k|    prepare_horizontal_filter_coeff_alpha0_avx2(beta, sx, coeff);
  355|  15.8k|    filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  356|  15.8k|                           shift, row);
  357|  15.8k|    row += 1;
  358|  15.8k|  }
  359|  2.27k|  iy = iy4 + k;
  360|  2.27k|  iy = clamp(iy, 0, height - 1);
  361|  2.27k|  const __m256i src_01 = _mm256_castsi128_si256(
  362|  2.27k|      _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7)));
  363|  2.27k|  sx = sx4 + beta * (k + 4);
  364|  2.27k|  prepare_horizontal_filter_coeff_alpha0_avx2(beta, sx, coeff);
  365|  2.27k|  filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  366|  2.27k|                         shift, row);
  367|  2.27k|}
warp_plane_avx2.c:warp_horizontal_filter_beta0_avx2:
  373|  31.3k|    const __m256i *shuffle_src) {
  374|  31.3k|  (void)beta;
  375|  31.3k|  int k, iy, row = 0;
  376|  31.3k|  __m256i coeff[4];
  377|  31.3k|  prepare_horizontal_filter_coeff_beta0_avx2(alpha, sx4, coeff);
  378|   250k|  for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|   250k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 103k, False: 147k]
  |  |  ------------------
  ------------------
  |  Branch (378:16): [True: 219k, False: 31.3k]
  ------------------
  379|   219k|    iy = iy4 + k;
  380|   219k|    iy = clamp(iy, 0, height - 1);
  381|   219k|    const __m128i src_0 =
  382|   219k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  383|   219k|    iy = iy4 + k + 1;
  384|   219k|    iy = clamp(iy, 0, height - 1);
  385|   219k|    const __m128i src_1 =
  386|   219k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  387|   219k|    const __m256i src_01 =
  388|       |        _mm256_inserti128_si256(_mm256_castsi128_si256(src_0), src_1, 0x1);
  389|   219k|    filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  390|   219k|                           shift, row);
  391|   219k|    row += 1;
  392|   219k|  }
  393|  31.3k|  iy = iy4 + k;
  394|  31.3k|  iy = clamp(iy, 0, height - 1);
  395|  31.3k|  const __m256i src_01 = _mm256_castsi128_si256(
  396|  31.3k|      _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7)));
  397|  31.3k|  filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  398|  31.3k|                         shift, row);
  399|  31.3k|}
warp_plane_avx2.c:prepare_horizontal_filter_coeff_beta0_avx2:
  197|  31.3k|                                                              __m256i *coeff) {
  198|  31.3k|  __m128i tmp_0 = _mm_loadl_epi64(
  199|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 0 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  200|  31.3k|  __m128i tmp_1 = _mm_loadl_epi64(
  201|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 1 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  202|  31.3k|  __m128i tmp_2 = _mm_loadl_epi64(
  203|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 2 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  204|  31.3k|  __m128i tmp_3 = _mm_loadl_epi64(
  205|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 3 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  206|  31.3k|  __m128i tmp_4 = _mm_loadl_epi64(
  207|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 4 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  208|  31.3k|  __m128i tmp_5 = _mm_loadl_epi64(
  209|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 5 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  210|  31.3k|  __m128i tmp_6 = _mm_loadl_epi64(
  211|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 6 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  212|  31.3k|  __m128i tmp_7 = _mm_loadl_epi64(
  213|  31.3k|      (__m128i *)&av1_filter_8bit[(sx + 7 * alpha) >> WARPEDDIFF_PREC_BITS]);
  ------------------
  |  |  107|  31.3k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  31.3k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  31.3k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  214|       |
  215|  31.3k|  tmp_0 = _mm_unpacklo_epi16(tmp_0, tmp_2);
  216|  31.3k|  tmp_1 = _mm_unpacklo_epi16(tmp_1, tmp_3);
  217|  31.3k|  tmp_4 = _mm_unpacklo_epi16(tmp_4, tmp_6);
  218|  31.3k|  tmp_5 = _mm_unpacklo_epi16(tmp_5, tmp_7);
  219|       |
  220|  31.3k|  const __m256i tmp_12 = _mm256_broadcastsi128_si256(tmp_0);
  221|  31.3k|  const __m256i tmp_13 = _mm256_broadcastsi128_si256(tmp_1);
  222|  31.3k|  const __m256i tmp_14 = _mm256_broadcastsi128_si256(tmp_4);
  223|  31.3k|  const __m256i tmp_15 = _mm256_broadcastsi128_si256(tmp_5);
  224|       |
  225|  31.3k|  const __m256i res_0 = _mm256_unpacklo_epi32(tmp_12, tmp_14);
  226|  31.3k|  const __m256i res_1 = _mm256_unpackhi_epi32(tmp_12, tmp_14);
  227|  31.3k|  const __m256i res_2 = _mm256_unpacklo_epi32(tmp_13, tmp_15);
  228|  31.3k|  const __m256i res_3 = _mm256_unpackhi_epi32(tmp_13, tmp_15);
  229|       |
  230|  31.3k|  coeff[0] = _mm256_unpacklo_epi64(res_0, res_2);
  231|  31.3k|  coeff[1] = _mm256_unpackhi_epi64(res_0, res_2);
  232|  31.3k|  coeff[2] = _mm256_unpacklo_epi64(res_1, res_3);
  233|  31.3k|  coeff[3] = _mm256_unpackhi_epi64(res_1, res_3);
  234|  31.3k|}
warp_plane_avx2.c:warp_horizontal_filter_avx2:
  305|   104k|    const __m256i *shuffle_src) {
  306|   104k|  int k, iy, sx, row = 0;
  307|   104k|  __m256i coeff[4];
  308|   831k|  for (k = -7; k <= (AOMMIN(8, p_height - i) - 2); k += 2) {
  ------------------
  |  |   34|   831k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 271k, False: 560k]
  |  |  ------------------
  ------------------
  |  Branch (308:16): [True: 726k, False: 104k]
  ------------------
  309|   726k|    iy = iy4 + k;
  310|   726k|    iy = clamp(iy, 0, height - 1);
  311|   726k|    const __m128i src_0 =
  312|   726k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  313|   726k|    iy = iy4 + k + 1;
  314|   726k|    iy = clamp(iy, 0, height - 1);
  315|   726k|    const __m128i src_1 =
  316|   726k|        _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7));
  317|   726k|    const __m256i src_01 =
  318|       |        _mm256_inserti128_si256(_mm256_castsi128_si256(src_0), src_1, 0x1);
  319|   726k|    sx = sx4 + beta * (k + 4);
  320|   726k|    horizontal_filter_avx2(src_01, horz_out, sx, alpha, beta, row, shuffle_src,
  321|   726k|                           round_const, shift);
  322|   726k|    row += 1;
  323|   726k|  }
  324|   104k|  iy = iy4 + k;
  325|   104k|  iy = clamp(iy, 0, height - 1);
  326|   104k|  const __m256i src_01 = _mm256_castsi128_si256(
  327|   104k|      _mm_loadu_si128((__m128i *)(ref + iy * stride + ix4 - 7)));
  328|   104k|  sx = sx4 + beta * (k + 4);
  329|   104k|  prepare_horizontal_filter_coeff(alpha, sx, coeff);
  330|   104k|  filter_src_pixels_avx2(src_01, horz_out, coeff, shuffle_src, round_const,
  331|   104k|                         shift, row);
  332|   104k|}
warp_plane_avx2.c:prepare_warp_vertical_filter_avx2:
  981|   285k|    const __m256i *wt) {
  982|   285k|  if (gamma == 0 && delta == 0)
  ------------------
  |  Branch (982:7): [True: 110k, False: 175k]
  |  Branch (982:21): [True: 58.6k, False: 51.5k]
  ------------------
  983|  58.6k|    warp_vertical_filter_gamma0_delta0_avx2(
  984|  58.6k|        pred, horz_out, conv_params, gamma, delta, p_height, p_stride, p_width,
  985|  58.6k|        i, j, sy4, reduce_bits_vert, res_add_const, round_bits, res_sub_const,
  986|  58.6k|        round_bits_const, wt);
  987|   227k|  else if (gamma == 0 && delta != 0)
  ------------------
  |  Branch (987:12): [True: 51.6k, False: 175k]
  |  Branch (987:26): [True: 51.6k, False: 1]
  ------------------
  988|  51.6k|    warp_vertical_filter_gamma0_avx2(
  989|  51.6k|        pred, horz_out, conv_params, gamma, delta, p_height, p_stride, p_width,
  990|  51.6k|        i, j, sy4, reduce_bits_vert, res_add_const, round_bits, res_sub_const,
  991|  51.6k|        round_bits_const, wt);
  992|   176k|  else if (gamma != 0 && delta == 0)
  ------------------
  |  Branch (992:12): [True: 176k, False: 18.4E]
  |  Branch (992:26): [True: 2.86k, False: 173k]
  ------------------
  993|  2.86k|    warp_vertical_filter_delta0_avx2(
  994|  2.86k|        pred, horz_out, conv_params, gamma, delta, p_height, p_stride, p_width,
  995|  2.86k|        i, j, sy4, reduce_bits_vert, res_add_const, round_bits, res_sub_const,
  996|  2.86k|        round_bits_const, wt);
  997|   172k|  else
  998|   172k|    warp_vertical_filter_avx2(pred, horz_out, conv_params, gamma, delta,
  999|   172k|                              p_height, p_stride, p_width, i, j, sy4,
 1000|   172k|                              reduce_bits_vert, res_add_const, round_bits,
 1001|   172k|                              res_sub_const, round_bits_const, wt);
 1002|   285k|}
warp_plane_avx2.c:warp_vertical_filter_gamma0_delta0_avx2:
  933|  58.6k|    const __m256i *wt) {
  934|  58.6k|  (void)gamma;
  935|  58.6k|  int k, row = 0;
  936|  58.6k|  __m256i src[8], coeffs[8];
  937|  58.6k|  const __m256i src_0 = horz_out[0];
  938|  58.6k|  const __m256i src_1 =
  939|  58.6k|      _mm256_permute2x128_si256(horz_out[0], horz_out[1], 0x21);
  940|  58.6k|  const __m256i src_2 = horz_out[1];
  941|  58.6k|  const __m256i src_3 =
  942|  58.6k|      _mm256_permute2x128_si256(horz_out[1], horz_out[2], 0x21);
  943|  58.6k|  const __m256i src_4 = horz_out[2];
  944|  58.6k|  const __m256i src_5 =
  945|  58.6k|      _mm256_permute2x128_si256(horz_out[2], horz_out[3], 0x21);
  946|       |
  947|  58.6k|  src[0] = _mm256_unpacklo_epi16(src_0, src_1);
  948|  58.6k|  src[2] = _mm256_unpacklo_epi16(src_2, src_3);
  949|  58.6k|  src[4] = _mm256_unpacklo_epi16(src_4, src_5);
  950|       |
  951|  58.6k|  src[1] = _mm256_unpackhi_epi16(src_0, src_1);
  952|  58.6k|  src[3] = _mm256_unpackhi_epi16(src_2, src_3);
  953|  58.6k|  src[5] = _mm256_unpackhi_epi16(src_4, src_5);
  954|       |
  955|  58.6k|  prepare_vertical_filter_coeffs_gamma0_avx2(delta, sy4, coeffs);
  956|       |
  957|   293k|  for (k = -4; k < AOMMIN(4, p_height - i - 4); k += 2) {
  ------------------
  |  |   34|   293k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 42.9k, False: 250k]
  |  |  ------------------
  ------------------
  |  Branch (957:16): [True: 234k, False: 58.6k]
  ------------------
  958|   234k|    __m256i res_lo, res_hi;
  959|   234k|    filter_src_pixels_vertical_avx2(horz_out, src, coeffs, &res_lo, &res_hi,
  960|   234k|                                    row);
  961|   234k|    store_vertical_filter_output_avx2(&res_lo, &res_hi, res_add_const, wt,
  962|   234k|                                      res_sub_const, round_bits_const, pred,
  963|   234k|                                      conv_params, i, j, k, reduce_bits_vert,
  964|   234k|                                      p_stride, p_width, round_bits);
  965|   234k|    src[0] = src[2];
  966|   234k|    src[2] = src[4];
  967|   234k|    src[4] = src[6];
  968|   234k|    src[1] = src[3];
  969|   234k|    src[3] = src[5];
  970|   234k|    src[5] = src[7];
  971|   234k|    row += 1;
  972|   234k|  }
  973|  58.6k|}
warp_plane_avx2.c:prepare_vertical_filter_coeffs_gamma0_avx2:
  602|   265k|                                                              __m256i *coeffs) {
  603|   265k|  const __m128i filt_0 = _mm_loadu_si128(
  604|   265k|      (__m128i *)(av1_warped_filter + (sy >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   265k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   265k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   265k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  605|   265k|  const __m128i filt_1 = _mm_loadu_si128(
  606|   265k|      (__m128i *)(av1_warped_filter + ((sy + delta) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   265k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   265k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   265k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  607|       |
  608|   265k|  __m256i res_0 =
  609|   265k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_0), filt_1, 0x1);
  610|       |
  611|   265k|  coeffs[0] = _mm256_shuffle_epi8(
  612|   265k|      res_0, _mm256_load_si256((__m256i *)shuffle_gamma0_mask0_avx2));
  613|   265k|  coeffs[1] = _mm256_shuffle_epi8(
  614|   265k|      res_0, _mm256_load_si256((__m256i *)shuffle_gamma0_mask1_avx2));
  615|   265k|  coeffs[2] = _mm256_shuffle_epi8(
  616|   265k|      res_0, _mm256_load_si256((__m256i *)shuffle_gamma0_mask2_avx2));
  617|   265k|  coeffs[3] = _mm256_shuffle_epi8(
  618|   265k|      res_0, _mm256_load_si256((__m256i *)shuffle_gamma0_mask3_avx2));
  619|       |
  620|   265k|  coeffs[4] = coeffs[0];
  621|   265k|  coeffs[5] = coeffs[1];
  622|   265k|  coeffs[6] = coeffs[2];
  623|   265k|  coeffs[7] = coeffs[3];
  624|   265k|}
warp_plane_avx2.c:filter_src_pixels_vertical_avx2:
  630|  1.14M|                                                   __m256i *res_hi, int row) {
  631|  1.14M|  const __m256i src_6 = horz_out[row + 3];
  632|  1.14M|  const __m256i src_7 =
  633|  1.14M|      _mm256_permute2x128_si256(horz_out[row + 3], horz_out[row + 4], 0x21);
  634|       |
  635|  1.14M|  src[6] = _mm256_unpacklo_epi16(src_6, src_7);
  636|       |
  637|  1.14M|  const __m256i res_0 = _mm256_madd_epi16(src[0], coeffs[0]);
  638|  1.14M|  const __m256i res_2 = _mm256_madd_epi16(src[2], coeffs[1]);
  639|  1.14M|  const __m256i res_4 = _mm256_madd_epi16(src[4], coeffs[2]);
  640|  1.14M|  const __m256i res_6 = _mm256_madd_epi16(src[6], coeffs[3]);
  641|       |
  642|  1.14M|  const __m256i res_even = _mm256_add_epi32(_mm256_add_epi32(res_0, res_2),
  643|  1.14M|                                            _mm256_add_epi32(res_4, res_6));
  644|       |
  645|  1.14M|  src[7] = _mm256_unpackhi_epi16(src_6, src_7);
  646|       |
  647|  1.14M|  const __m256i res_1 = _mm256_madd_epi16(src[1], coeffs[4]);
  648|  1.14M|  const __m256i res_3 = _mm256_madd_epi16(src[3], coeffs[5]);
  649|  1.14M|  const __m256i res_5 = _mm256_madd_epi16(src[5], coeffs[6]);
  650|  1.14M|  const __m256i res_7 = _mm256_madd_epi16(src[7], coeffs[7]);
  651|       |
  652|  1.14M|  const __m256i res_odd = _mm256_add_epi32(_mm256_add_epi32(res_1, res_3),
  653|  1.14M|                                           _mm256_add_epi32(res_5, res_7));
  654|       |
  655|       |  // Rearrange pixels back into the order 0 ... 7
  656|  1.14M|  *res_lo = _mm256_unpacklo_epi32(res_even, res_odd);
  657|  1.14M|  *res_hi = _mm256_unpackhi_epi32(res_even, res_odd);
  658|  1.14M|}
warp_plane_avx2.c:store_vertical_filter_output_avx2:
  665|  1.14M|    const int round_bits) {
  666|  1.14M|  __m256i res_lo_1 = *res_lo;
  667|  1.14M|  __m256i res_hi_1 = *res_hi;
  668|       |
  669|  1.14M|  if (conv_params->is_compound) {
  ------------------
  |  Branch (669:7): [True: 0, False: 1.14M]
  ------------------
  670|      0|    __m128i *const p_0 =
  671|      0|        (__m128i *)&conv_params->dst[(i + k + 4) * conv_params->dst_stride + j];
  672|      0|    __m128i *const p_1 =
  673|      0|        (__m128i *)&conv_params
  674|      0|            ->dst[(i + (k + 1) + 4) * conv_params->dst_stride + j];
  675|       |
  676|      0|    res_lo_1 = _mm256_srai_epi32(_mm256_add_epi32(res_lo_1, *res_add_const),
  677|      0|                                 reduce_bits_vert);
  678|       |
  679|      0|    const __m256i temp_lo_16 = _mm256_packus_epi32(res_lo_1, res_lo_1);
  680|      0|    __m256i res_lo_16;
  681|      0|    if (conv_params->do_average) {
  ------------------
  |  Branch (681:9): [True: 0, False: 0]
  ------------------
  682|      0|      __m128i *const dst8_0 = (__m128i *)&pred[(i + k + 4) * p_stride + j];
  683|      0|      __m128i *const dst8_1 =
  684|      0|          (__m128i *)&pred[(i + (k + 1) + 4) * p_stride + j];
  685|      0|      const __m128i p_16_0 = _mm_loadl_epi64(p_0);
  686|      0|      const __m128i p_16_1 = _mm_loadl_epi64(p_1);
  687|      0|      const __m256i p_16 =
  688|      0|          _mm256_inserti128_si256(_mm256_castsi128_si256(p_16_0), p_16_1, 1);
  689|      0|      if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (689:11): [True: 0, False: 0]
  ------------------
  690|      0|        const __m256i p_16_lo = _mm256_unpacklo_epi16(p_16, temp_lo_16);
  691|      0|        const __m256i wt_res_lo = _mm256_madd_epi16(p_16_lo, *wt);
  692|      0|        const __m256i shifted_32 =
  693|      0|            _mm256_srai_epi32(wt_res_lo, DIST_PRECISION_BITS);
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  694|      0|        res_lo_16 = _mm256_packus_epi32(shifted_32, shifted_32);
  695|      0|      } else {
  696|      0|        res_lo_16 = _mm256_srai_epi16(_mm256_add_epi16(p_16, temp_lo_16), 1);
  697|      0|      }
  698|      0|      res_lo_16 = _mm256_add_epi16(res_lo_16, *res_sub_const);
  699|      0|      res_lo_16 = _mm256_srai_epi16(
  700|      0|          _mm256_add_epi16(res_lo_16, *round_bits_const), round_bits);
  701|      0|      const __m256i res_8_lo = _mm256_packus_epi16(res_lo_16, res_lo_16);
  702|      0|      const __m128i res_8_lo_0 = _mm256_castsi256_si128(res_8_lo);
  703|      0|      const __m128i res_8_lo_1 = _mm256_extracti128_si256(res_8_lo, 1);
  704|      0|      *(int *)dst8_0 = _mm_cvtsi128_si32(res_8_lo_0);
  705|      0|      *(int *)dst8_1 = _mm_cvtsi128_si32(res_8_lo_1);
  706|      0|    } else {
  707|      0|      const __m128i temp_lo_16_0 = _mm256_castsi256_si128(temp_lo_16);
  708|      0|      const __m128i temp_lo_16_1 = _mm256_extracti128_si256(temp_lo_16, 1);
  709|      0|      _mm_storel_epi64(p_0, temp_lo_16_0);
  710|      0|      _mm_storel_epi64(p_1, temp_lo_16_1);
  711|      0|    }
  712|      0|    if (p_width > 4) {
  ------------------
  |  Branch (712:9): [True: 0, False: 0]
  ------------------
  713|      0|      __m128i *const p4_0 =
  714|      0|          (__m128i *)&conv_params
  715|      0|              ->dst[(i + k + 4) * conv_params->dst_stride + j + 4];
  716|      0|      __m128i *const p4_1 =
  717|      0|          (__m128i *)&conv_params
  718|      0|              ->dst[(i + (k + 1) + 4) * conv_params->dst_stride + j + 4];
  719|      0|      res_hi_1 = _mm256_srai_epi32(_mm256_add_epi32(res_hi_1, *res_add_const),
  720|      0|                                   reduce_bits_vert);
  721|      0|      const __m256i temp_hi_16 = _mm256_packus_epi32(res_hi_1, res_hi_1);
  722|      0|      __m256i res_hi_16;
  723|      0|      if (conv_params->do_average) {
  ------------------
  |  Branch (723:11): [True: 0, False: 0]
  ------------------
  724|      0|        __m128i *const dst8_4_0 =
  725|      0|            (__m128i *)&pred[(i + k + 4) * p_stride + j + 4];
  726|      0|        __m128i *const dst8_4_1 =
  727|      0|            (__m128i *)&pred[(i + (k + 1) + 4) * p_stride + j + 4];
  728|      0|        const __m128i p4_16_0 = _mm_loadl_epi64(p4_0);
  729|      0|        const __m128i p4_16_1 = _mm_loadl_epi64(p4_1);
  730|      0|        const __m256i p4_16 = _mm256_inserti128_si256(
  731|      0|            _mm256_castsi128_si256(p4_16_0), p4_16_1, 1);
  732|      0|        if (conv_params->use_dist_wtd_comp_avg) {
  ------------------
  |  Branch (732:13): [True: 0, False: 0]
  ------------------
  733|      0|          const __m256i p_16_hi = _mm256_unpacklo_epi16(p4_16, temp_hi_16);
  734|      0|          const __m256i wt_res_hi = _mm256_madd_epi16(p_16_hi, *wt);
  735|      0|          const __m256i shifted_32 =
  736|      0|              _mm256_srai_epi32(wt_res_hi, DIST_PRECISION_BITS);
  ------------------
  |  |   76|      0|#define DIST_PRECISION_BITS 4
  ------------------
  737|      0|          res_hi_16 = _mm256_packus_epi32(shifted_32, shifted_32);
  738|      0|        } else {
  739|      0|          res_hi_16 = _mm256_srai_epi16(_mm256_add_epi16(p4_16, temp_hi_16), 1);
  740|      0|        }
  741|      0|        res_hi_16 = _mm256_add_epi16(res_hi_16, *res_sub_const);
  742|      0|        res_hi_16 = _mm256_srai_epi16(
  743|      0|            _mm256_add_epi16(res_hi_16, *round_bits_const), round_bits);
  744|      0|        __m256i res_8_hi = _mm256_packus_epi16(res_hi_16, res_hi_16);
  745|      0|        const __m128i res_8_hi_0 = _mm256_castsi256_si128(res_8_hi);
  746|      0|        const __m128i res_8_hi_1 = _mm256_extracti128_si256(res_8_hi, 1);
  747|      0|        *(int *)dst8_4_0 = _mm_cvtsi128_si32(res_8_hi_0);
  748|      0|        *(int *)dst8_4_1 = _mm_cvtsi128_si32(res_8_hi_1);
  749|      0|      } else {
  750|      0|        const __m128i temp_hi_16_0 = _mm256_castsi256_si128(temp_hi_16);
  751|      0|        const __m128i temp_hi_16_1 = _mm256_extracti128_si256(temp_hi_16, 1);
  752|      0|        _mm_storel_epi64(p4_0, temp_hi_16_0);
  753|      0|        _mm_storel_epi64(p4_1, temp_hi_16_1);
  754|      0|      }
  755|      0|    }
  756|  1.14M|  } else {
  757|  1.14M|    const __m256i res_lo_round = _mm256_srai_epi32(
  758|  1.14M|        _mm256_add_epi32(res_lo_1, *res_add_const), reduce_bits_vert);
  759|  1.14M|    const __m256i res_hi_round = _mm256_srai_epi32(
  760|  1.14M|        _mm256_add_epi32(res_hi_1, *res_add_const), reduce_bits_vert);
  761|       |
  762|  1.14M|    const __m256i res_16bit = _mm256_packs_epi32(res_lo_round, res_hi_round);
  763|  1.14M|    const __m256i res_8bit = _mm256_packus_epi16(res_16bit, res_16bit);
  764|  1.14M|    const __m128i res_8bit0 = _mm256_castsi256_si128(res_8bit);
  765|  1.14M|    const __m128i res_8bit1 = _mm256_extracti128_si256(res_8bit, 1);
  766|       |
  767|       |    // Store, blending with 'pred' if needed
  768|  1.14M|    __m128i *const p = (__m128i *)&pred[(i + k + 4) * p_stride + j];
  769|  1.14M|    __m128i *const p1 = (__m128i *)&pred[(i + (k + 1) + 4) * p_stride + j];
  770|       |
  771|  1.14M|    if (p_width == 4) {
  ------------------
  |  Branch (771:9): [True: 288, False: 1.14M]
  ------------------
  772|    288|      *(int *)p = _mm_cvtsi128_si32(res_8bit0);
  773|    288|      *(int *)p1 = _mm_cvtsi128_si32(res_8bit1);
  774|  1.14M|    } else {
  775|  1.14M|      _mm_storel_epi64(p, res_8bit0);
  776|  1.14M|      _mm_storel_epi64(p1, res_8bit1);
  777|  1.14M|    }
  778|  1.14M|  }
  779|  1.14M|}
warp_plane_avx2.c:warp_vertical_filter_gamma0_avx2:
  836|  51.6k|    const __m256i *wt) {
  837|  51.6k|  (void)gamma;
  838|  51.6k|  int k, row = 0;
  839|  51.6k|  __m256i src[8];
  840|  51.6k|  const __m256i src_0 = horz_out[0];
  841|  51.6k|  const __m256i src_1 =
  842|  51.6k|      _mm256_permute2x128_si256(horz_out[0], horz_out[1], 0x21);
  843|  51.6k|  const __m256i src_2 = horz_out[1];
  844|  51.6k|  const __m256i src_3 =
  845|  51.6k|      _mm256_permute2x128_si256(horz_out[1], horz_out[2], 0x21);
  846|  51.6k|  const __m256i src_4 = horz_out[2];
  847|  51.6k|  const __m256i src_5 =
  848|  51.6k|      _mm256_permute2x128_si256(horz_out[2], horz_out[3], 0x21);
  849|       |
  850|  51.6k|  src[0] = _mm256_unpacklo_epi16(src_0, src_1);
  851|  51.6k|  src[2] = _mm256_unpacklo_epi16(src_2, src_3);
  852|  51.6k|  src[4] = _mm256_unpacklo_epi16(src_4, src_5);
  853|       |
  854|  51.6k|  src[1] = _mm256_unpackhi_epi16(src_0, src_1);
  855|  51.6k|  src[3] = _mm256_unpackhi_epi16(src_2, src_3);
  856|  51.6k|  src[5] = _mm256_unpackhi_epi16(src_4, src_5);
  857|       |
  858|   258k|  for (k = -4; k < AOMMIN(4, p_height - i - 4); k += 2) {
  ------------------
  |  |   34|   258k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 110k, False: 147k]
  |  |  ------------------
  ------------------
  |  Branch (858:16): [True: 206k, False: 51.6k]
  ------------------
  859|   206k|    int sy = sy4 + delta * (k + 4);
  860|   206k|    __m256i coeffs[8];
  861|   206k|    prepare_vertical_filter_coeffs_gamma0_avx2(delta, sy, coeffs);
  862|   206k|    __m256i res_lo, res_hi;
  863|   206k|    filter_src_pixels_vertical_avx2(horz_out, src, coeffs, &res_lo, &res_hi,
  864|   206k|                                    row);
  865|   206k|    store_vertical_filter_output_avx2(&res_lo, &res_hi, res_add_const, wt,
  866|   206k|                                      res_sub_const, round_bits_const, pred,
  867|   206k|                                      conv_params, i, j, k, reduce_bits_vert,
  868|   206k|                                      p_stride, p_width, round_bits);
  869|   206k|    src[0] = src[2];
  870|   206k|    src[2] = src[4];
  871|   206k|    src[4] = src[6];
  872|   206k|    src[1] = src[3];
  873|   206k|    src[3] = src[5];
  874|   206k|    src[5] = src[7];
  875|   206k|    row += 1;
  876|   206k|  }
  877|  51.6k|}
warp_plane_avx2.c:warp_vertical_filter_delta0_avx2:
  885|  2.86k|    const __m256i *wt) {
  886|  2.86k|  (void)delta;
  887|  2.86k|  int k, row = 0;
  888|  2.86k|  __m256i src[8], coeffs[8];
  889|  2.86k|  const __m256i src_0 = horz_out[0];
  890|  2.86k|  const __m256i src_1 =
  891|  2.86k|      _mm256_permute2x128_si256(horz_out[0], horz_out[1], 0x21);
  892|  2.86k|  const __m256i src_2 = horz_out[1];
  893|  2.86k|  const __m256i src_3 =
  894|  2.86k|      _mm256_permute2x128_si256(horz_out[1], horz_out[2], 0x21);
  895|  2.86k|  const __m256i src_4 = horz_out[2];
  896|  2.86k|  const __m256i src_5 =
  897|  2.86k|      _mm256_permute2x128_si256(horz_out[2], horz_out[3], 0x21);
  898|       |
  899|  2.86k|  src[0] = _mm256_unpacklo_epi16(src_0, src_1);
  900|  2.86k|  src[2] = _mm256_unpacklo_epi16(src_2, src_3);
  901|  2.86k|  src[4] = _mm256_unpacklo_epi16(src_4, src_5);
  902|       |
  903|  2.86k|  src[1] = _mm256_unpackhi_epi16(src_0, src_1);
  904|  2.86k|  src[3] = _mm256_unpackhi_epi16(src_2, src_3);
  905|  2.86k|  src[5] = _mm256_unpackhi_epi16(src_4, src_5);
  906|       |
  907|  2.86k|  prepare_vertical_filter_coeffs_delta0_avx2(gamma, sy4, coeffs);
  908|       |
  909|  14.2k|  for (k = -4; k < AOMMIN(4, p_height - i - 4); k += 2) {
  ------------------
  |  |   34|  14.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.63k, False: 5.65k]
  |  |  ------------------
  ------------------
  |  Branch (909:16): [True: 11.4k, False: 2.86k]
  ------------------
  910|  11.4k|    __m256i res_lo, res_hi;
  911|  11.4k|    filter_src_pixels_vertical_avx2(horz_out, src, coeffs, &res_lo, &res_hi,
  912|  11.4k|                                    row);
  913|  11.4k|    store_vertical_filter_output_avx2(&res_lo, &res_hi, res_add_const, wt,
  914|  11.4k|                                      res_sub_const, round_bits_const, pred,
  915|  11.4k|                                      conv_params, i, j, k, reduce_bits_vert,
  916|  11.4k|                                      p_stride, p_width, round_bits);
  917|  11.4k|    src[0] = src[2];
  918|  11.4k|    src[2] = src[4];
  919|  11.4k|    src[4] = src[6];
  920|  11.4k|    src[1] = src[3];
  921|  11.4k|    src[3] = src[5];
  922|  11.4k|    src[5] = src[7];
  923|  11.4k|    row += 1;
  924|  11.4k|  }
  925|  2.86k|}
warp_plane_avx2.c:prepare_vertical_filter_coeffs_delta0_avx2:
  543|  2.86k|                                                              __m256i *coeffs) {
  544|  2.86k|  __m128i filt_00 =
  545|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  546|  2.86k|                                  ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  547|  2.86k|  __m128i filt_01 =
  548|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  549|  2.86k|                                  ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  550|  2.86k|  __m128i filt_02 =
  551|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  552|  2.86k|                                  ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  553|  2.86k|  __m128i filt_03 =
  554|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  555|  2.86k|                                  ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  556|       |
  557|  2.86k|  __m256i filt_0 = _mm256_broadcastsi128_si256(filt_00);
  558|  2.86k|  __m256i filt_1 = _mm256_broadcastsi128_si256(filt_01);
  559|  2.86k|  __m256i filt_2 = _mm256_broadcastsi128_si256(filt_02);
  560|  2.86k|  __m256i filt_3 = _mm256_broadcastsi128_si256(filt_03);
  561|       |
  562|  2.86k|  __m256i res_0 = _mm256_unpacklo_epi32(filt_0, filt_1);
  563|  2.86k|  __m256i res_1 = _mm256_unpacklo_epi32(filt_2, filt_3);
  564|  2.86k|  __m256i res_2 = _mm256_unpackhi_epi32(filt_0, filt_1);
  565|  2.86k|  __m256i res_3 = _mm256_unpackhi_epi32(filt_2, filt_3);
  566|       |
  567|  2.86k|  coeffs[0] = _mm256_unpacklo_epi64(res_0, res_1);
  568|  2.86k|  coeffs[1] = _mm256_unpackhi_epi64(res_0, res_1);
  569|  2.86k|  coeffs[2] = _mm256_unpacklo_epi64(res_2, res_3);
  570|  2.86k|  coeffs[3] = _mm256_unpackhi_epi64(res_2, res_3);
  571|       |
  572|  2.86k|  filt_00 =
  573|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  574|  2.86k|                                  ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  575|  2.86k|  filt_01 =
  576|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  577|  2.86k|                                  ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  578|  2.86k|  filt_02 =
  579|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  580|  2.86k|                                  ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  581|  2.86k|  filt_03 =
  582|  2.86k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  583|  2.86k|                                  ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|  2.86k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|  2.86k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|  2.86k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  584|       |
  585|  2.86k|  filt_0 = _mm256_broadcastsi128_si256(filt_00);
  586|  2.86k|  filt_1 = _mm256_broadcastsi128_si256(filt_01);
  587|  2.86k|  filt_2 = _mm256_broadcastsi128_si256(filt_02);
  588|  2.86k|  filt_3 = _mm256_broadcastsi128_si256(filt_03);
  589|       |
  590|  2.86k|  res_0 = _mm256_unpacklo_epi32(filt_0, filt_1);
  591|  2.86k|  res_1 = _mm256_unpacklo_epi32(filt_2, filt_3);
  592|  2.86k|  res_2 = _mm256_unpackhi_epi32(filt_0, filt_1);
  593|  2.86k|  res_3 = _mm256_unpackhi_epi32(filt_2, filt_3);
  594|       |
  595|  2.86k|  coeffs[4] = _mm256_unpacklo_epi64(res_0, res_1);
  596|  2.86k|  coeffs[5] = _mm256_unpackhi_epi64(res_0, res_1);
  597|  2.86k|  coeffs[6] = _mm256_unpacklo_epi64(res_2, res_3);
  598|  2.86k|  coeffs[7] = _mm256_unpackhi_epi64(res_2, res_3);
  599|  2.86k|}
warp_plane_avx2.c:warp_vertical_filter_avx2:
  787|   173k|    const __m256i *wt) {
  788|   173k|  int k, row = 0;
  789|   173k|  __m256i src[8];
  790|   173k|  const __m256i src_0 = horz_out[0];
  791|   173k|  const __m256i src_1 =
  792|   173k|      _mm256_permute2x128_si256(horz_out[0], horz_out[1], 0x21);
  793|   173k|  const __m256i src_2 = horz_out[1];
  794|   173k|  const __m256i src_3 =
  795|   173k|      _mm256_permute2x128_si256(horz_out[1], horz_out[2], 0x21);
  796|   173k|  const __m256i src_4 = horz_out[2];
  797|   173k|  const __m256i src_5 =
  798|   173k|      _mm256_permute2x128_si256(horz_out[2], horz_out[3], 0x21);
  799|       |
  800|   173k|  src[0] = _mm256_unpacklo_epi16(src_0, src_1);
  801|   173k|  src[2] = _mm256_unpacklo_epi16(src_2, src_3);
  802|   173k|  src[4] = _mm256_unpacklo_epi16(src_4, src_5);
  803|       |
  804|   173k|  src[1] = _mm256_unpackhi_epi16(src_0, src_1);
  805|   173k|  src[3] = _mm256_unpackhi_epi16(src_2, src_3);
  806|   173k|  src[5] = _mm256_unpackhi_epi16(src_4, src_5);
  807|       |
  808|   864k|  for (k = -4; k < AOMMIN(4, p_height - i - 4); k += 2) {
  ------------------
  |  |   34|   864k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 268k, False: 595k]
  |  |  ------------------
  ------------------
  |  Branch (808:16): [True: 691k, False: 173k]
  ------------------
  809|   691k|    int sy = sy4 + delta * (k + 4);
  810|   691k|    __m256i coeffs[8];
  811|   691k|    prepare_vertical_filter_coeffs_avx2(gamma, delta, sy, coeffs);
  812|   691k|    __m256i res_lo, res_hi;
  813|   691k|    filter_src_pixels_vertical_avx2(horz_out, src, coeffs, &res_lo, &res_hi,
  814|   691k|                                    row);
  815|   691k|    store_vertical_filter_output_avx2(&res_lo, &res_hi, res_add_const, wt,
  816|   691k|                                      res_sub_const, round_bits_const, pred,
  817|   691k|                                      conv_params, i, j, k, reduce_bits_vert,
  818|   691k|                                      p_stride, p_width, round_bits);
  819|   691k|    src[0] = src[2];
  820|   691k|    src[2] = src[4];
  821|   691k|    src[4] = src[6];
  822|   691k|    src[1] = src[3];
  823|   691k|    src[3] = src[5];
  824|   691k|    src[5] = src[7];
  825|       |
  826|   691k|    row += 1;
  827|   691k|  }
  828|   173k|}
warp_plane_avx2.c:prepare_vertical_filter_coeffs_avx2:
  450|   690k|                                                       __m256i *coeffs) {
  451|   690k|  __m128i filt_00 =
  452|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  453|   690k|                                  ((sy + 0 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  454|   690k|  __m128i filt_01 =
  455|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  456|   690k|                                  ((sy + 2 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  457|   690k|  __m128i filt_02 =
  458|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  459|   690k|                                  ((sy + 4 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  460|   690k|  __m128i filt_03 =
  461|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  462|   690k|                                  ((sy + 6 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  463|       |
  464|   690k|  __m128i filt_10 = _mm_loadu_si128(
  465|   690k|      (__m128i *)(av1_warped_filter +
  466|   690k|                  (((sy + delta) + 0 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  467|   690k|  __m128i filt_11 = _mm_loadu_si128(
  468|   690k|      (__m128i *)(av1_warped_filter +
  469|   690k|                  (((sy + delta) + 2 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  470|   690k|  __m128i filt_12 = _mm_loadu_si128(
  471|   690k|      (__m128i *)(av1_warped_filter +
  472|   690k|                  (((sy + delta) + 4 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  473|   690k|  __m128i filt_13 = _mm_loadu_si128(
  474|   690k|      (__m128i *)(av1_warped_filter +
  475|   690k|                  (((sy + delta) + 6 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  476|       |
  477|   690k|  __m256i filt_0 =
  478|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_00), filt_10, 0x1);
  479|   690k|  __m256i filt_1 =
  480|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_01), filt_11, 0x1);
  481|   690k|  __m256i filt_2 =
  482|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_02), filt_12, 0x1);
  483|   690k|  __m256i filt_3 =
  484|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_03), filt_13, 0x1);
  485|       |
  486|   690k|  __m256i res_0 = _mm256_unpacklo_epi32(filt_0, filt_1);
  487|   690k|  __m256i res_1 = _mm256_unpacklo_epi32(filt_2, filt_3);
  488|   690k|  __m256i res_2 = _mm256_unpackhi_epi32(filt_0, filt_1);
  489|   690k|  __m256i res_3 = _mm256_unpackhi_epi32(filt_2, filt_3);
  490|       |
  491|   690k|  coeffs[0] = _mm256_unpacklo_epi64(res_0, res_1);
  492|   690k|  coeffs[1] = _mm256_unpackhi_epi64(res_0, res_1);
  493|   690k|  coeffs[2] = _mm256_unpacklo_epi64(res_2, res_3);
  494|   690k|  coeffs[3] = _mm256_unpackhi_epi64(res_2, res_3);
  495|       |
  496|   690k|  filt_00 =
  497|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  498|   690k|                                  ((sy + 1 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  499|   690k|  filt_01 =
  500|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  501|   690k|                                  ((sy + 3 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  502|   690k|  filt_02 =
  503|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  504|   690k|                                  ((sy + 5 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  505|   690k|  filt_03 =
  506|   690k|      _mm_loadu_si128((__m128i *)(av1_warped_filter +
  507|   690k|                                  ((sy + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  508|       |
  509|   690k|  filt_10 = _mm_loadu_si128(
  510|   690k|      (__m128i *)(av1_warped_filter +
  511|   690k|                  (((sy + delta) + 1 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  512|   690k|  filt_11 = _mm_loadu_si128(
  513|   690k|      (__m128i *)(av1_warped_filter +
  514|   690k|                  (((sy + delta) + 3 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  515|   690k|  filt_12 = _mm_loadu_si128(
  516|   690k|      (__m128i *)(av1_warped_filter +
  517|   690k|                  (((sy + delta) + 5 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  518|   690k|  filt_13 = _mm_loadu_si128(
  519|   690k|      (__m128i *)(av1_warped_filter +
  520|   690k|                  (((sy + delta) + 7 * gamma) >> WARPEDDIFF_PREC_BITS)));
  ------------------
  |  |  107|   690k|#define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|   690k|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS)
  |  |  ------------------
  |  |  |  |  102|   690k|#define WARPEDPIXEL_PREC_BITS 6
  |  |  ------------------
  ------------------
  521|       |
  522|   690k|  filt_0 =
  523|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_00), filt_10, 0x1);
  524|   690k|  filt_1 =
  525|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_01), filt_11, 0x1);
  526|   690k|  filt_2 =
  527|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_02), filt_12, 0x1);
  528|   690k|  filt_3 =
  529|   690k|      _mm256_inserti128_si256(_mm256_castsi128_si256(filt_03), filt_13, 0x1);
  530|       |
  531|   690k|  res_0 = _mm256_unpacklo_epi32(filt_0, filt_1);
  532|   690k|  res_1 = _mm256_unpacklo_epi32(filt_2, filt_3);
  533|   690k|  res_2 = _mm256_unpackhi_epi32(filt_0, filt_1);
  534|   690k|  res_3 = _mm256_unpackhi_epi32(filt_2, filt_3);
  535|       |
  536|   690k|  coeffs[4] = _mm256_unpacklo_epi64(res_0, res_1);
  537|   690k|  coeffs[5] = _mm256_unpackhi_epi64(res_0, res_1);
  538|   690k|  coeffs[6] = _mm256_unpacklo_epi64(res_2, res_3);
  539|   690k|  coeffs[7] = _mm256_unpackhi_epi64(res_2, res_3);
  540|   690k|}

av1_wiener_convolve_add_src_avx2:
   48|  12.2k|                                      const WienerConvolveParams *conv_params) {
   49|  12.2k|  const int bd = 8;
   50|  12.2k|  assert(x_step_q4 == 16 && y_step_q4 == 16);
   51|  12.2k|  assert(!(w & 7));
   52|  12.2k|  (void)x_step_q4;
   53|  12.2k|  (void)y_step_q4;
   54|       |
   55|  12.2k|  DECLARE_ALIGNED(32, int16_t, im_block[(MAX_SB_SIZE + SUBPEL_TAPS) * 8]);
  ------------------
  |  |   19|  12.2k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
   56|  12.2k|  int im_h = h + SUBPEL_TAPS - 2;
  ------------------
  |  |   26|  12.2k|#define SUBPEL_TAPS 8
  ------------------
   57|  12.2k|  int im_stride = 8;
   58|  12.2k|  memset(im_block + (im_h * im_stride), 0, MAX_SB_SIZE);
  ------------------
  |  |   32|  12.2k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  12.2k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
   59|  12.2k|  int i, j;
   60|  12.2k|  const int center_tap = (SUBPEL_TAPS - 1) / 2;
  ------------------
  |  |   26|  12.2k|#define SUBPEL_TAPS 8
  ------------------
   61|  12.2k|  const uint8_t *const src_ptr = src - center_tap * src_stride - center_tap;
   62|       |
   63|  12.2k|  __m256i filt[4], coeffs_h[4], coeffs_v[4], filt_center;
   64|       |
   65|  12.2k|  assert(conv_params->round_0 > 0);
   66|       |
   67|  12.2k|  filt[0] = _mm256_load_si256((__m256i const *)filt1_global_avx2);
   68|  12.2k|  filt[1] = _mm256_load_si256((__m256i const *)filt2_global_avx2);
   69|  12.2k|  filt[2] = _mm256_load_si256((__m256i const *)filt3_global_avx2);
   70|  12.2k|  filt[3] = _mm256_load_si256((__m256i const *)filt4_global_avx2);
   71|       |
   72|  12.2k|  filt_center = _mm256_load_si256((__m256i const *)filt_center_global_avx2);
   73|       |
   74|  12.2k|  const __m128i coeffs_x = _mm_loadu_si128((__m128i *)filter_x);
   75|  12.2k|  const __m256i filter_coeffs_x = _mm256_broadcastsi128_si256(coeffs_x);
   76|       |
   77|       |  // coeffs 0 1 0 1 0 1 0 1
   78|  12.2k|  coeffs_h[0] =
   79|  12.2k|      _mm256_shuffle_epi8(filter_coeffs_x, _mm256_set1_epi16(0x0200u));
   80|       |  // coeffs 2 3 2 3 2 3 2 3
   81|  12.2k|  coeffs_h[1] =
   82|  12.2k|      _mm256_shuffle_epi8(filter_coeffs_x, _mm256_set1_epi16(0x0604u));
   83|       |  // coeffs 4 5 4 5 4 5 4 5
   84|  12.2k|  coeffs_h[2] =
   85|  12.2k|      _mm256_shuffle_epi8(filter_coeffs_x, _mm256_set1_epi16(0x0a08u));
   86|       |  // coeffs 6 7 6 7 6 7 6 7
   87|  12.2k|  coeffs_h[3] =
   88|  12.2k|      _mm256_shuffle_epi8(filter_coeffs_x, _mm256_set1_epi16(0x0e0cu));
   89|       |
   90|  12.2k|  const __m256i round_const_h =
   91|  12.2k|      _mm256_set1_epi16((1 << (conv_params->round_0 - 1)));
   92|  12.2k|  const __m256i round_const_horz =
   93|  12.2k|      _mm256_set1_epi16((1 << (bd + FILTER_BITS - conv_params->round_0 - 1)));
  ------------------
  |  |   21|  12.2k|#define FILTER_BITS 7
  ------------------
   94|  12.2k|  const __m256i clamp_low = _mm256_setzero_si256();
   95|  12.2k|  const __m256i clamp_high =
   96|  12.2k|      _mm256_set1_epi16(WIENER_CLAMP_LIMIT(conv_params->round_0, bd) - 1);
  ------------------
  |  |   43|  12.2k|#define WIENER_CLAMP_LIMIT(r0, bd) (1 << ((bd) + 1 + FILTER_BITS - r0))
  |  |  ------------------
  |  |  |  |   21|  12.2k|#define FILTER_BITS 7
  |  |  ------------------
  ------------------
   97|  12.2k|  const __m128i round_shift_h = _mm_cvtsi32_si128(conv_params->round_0);
   98|       |
   99|       |  // Add an offset to account for the "add_src" part of the convolve function.
  100|  12.2k|  const __m128i zero_128 = _mm_setzero_si128();
  101|  12.2k|  const __m128i offset_0 = _mm_insert_epi16(zero_128, 1 << FILTER_BITS, 3);
  102|  12.2k|  const __m128i coeffs_y = _mm_add_epi16(xx_loadu_128(filter_y), offset_0);
  103|       |
  104|  12.2k|  const __m256i filter_coeffs_y = _mm256_broadcastsi128_si256(coeffs_y);
  105|       |
  106|       |  // coeffs 0 1 0 1 0 1 0 1
  107|  12.2k|  coeffs_v[0] = _mm256_shuffle_epi32(filter_coeffs_y, 0x00);
  108|       |  // coeffs 2 3 2 3 2 3 2 3
  109|  12.2k|  coeffs_v[1] = _mm256_shuffle_epi32(filter_coeffs_y, 0x55);
  110|       |  // coeffs 4 5 4 5 4 5 4 5
  111|  12.2k|  coeffs_v[2] = _mm256_shuffle_epi32(filter_coeffs_y, 0xaa);
  112|       |  // coeffs 6 7 6 7 6 7 6 7
  113|  12.2k|  coeffs_v[3] = _mm256_shuffle_epi32(filter_coeffs_y, 0xff);
  114|       |
  115|  12.2k|  const __m256i round_const_v =
  116|  12.2k|      _mm256_set1_epi32((1 << (conv_params->round_1 - 1)) -
  117|  12.2k|                        (1 << (bd + conv_params->round_1 - 1)));
  118|  12.2k|  const __m128i round_shift_v = _mm_cvtsi32_si128(conv_params->round_1);
  119|       |
  120|  73.1k|  for (j = 0; j < w; j += 8) {
  ------------------
  |  Branch (120:15): [True: 60.9k, False: 12.2k]
  ------------------
  121|  1.28M|    for (i = 0; i < im_h; i += 2) {
  ------------------
  |  Branch (121:17): [True: 1.22M, False: 60.9k]
  ------------------
  122|  1.22M|      __m256i data = _mm256_castsi128_si256(
  123|  1.22M|          _mm_loadu_si128((__m128i *)&src_ptr[(i * src_stride) + j]));
  124|       |
  125|       |      // Load the next line
  126|  1.22M|      if (i + 1 < im_h)
  ------------------
  |  Branch (126:11): [True: 1.21M, False: 14.5k]
  ------------------
  127|  1.21M|        data = _mm256_inserti128_si256(
  128|  1.22M|            data,
  129|  1.22M|            _mm_loadu_si128(
  130|  1.22M|                (__m128i *)&src_ptr[(i * src_stride) + j + src_stride]),
  131|  1.22M|            1);
  132|       |
  133|  1.22M|      __m256i res = convolve_lowbd_x(data, coeffs_h, filt);
  134|       |
  135|  1.22M|      res =
  136|  1.22M|          _mm256_sra_epi16(_mm256_add_epi16(res, round_const_h), round_shift_h);
  137|       |
  138|  1.22M|      __m256i data_0 = _mm256_shuffle_epi8(data, filt_center);
  139|       |
  140|       |      // multiply the center pixel by 2^(FILTER_BITS - round_0) and add it to
  141|       |      // the result
  142|  1.22M|      data_0 = _mm256_slli_epi16(data_0, FILTER_BITS - conv_params->round_0);
  ------------------
  |  |   21|  1.22M|#define FILTER_BITS 7
  ------------------
  143|  1.22M|      res = _mm256_add_epi16(res, data_0);
  144|  1.22M|      res = _mm256_add_epi16(res, round_const_horz);
  145|  1.22M|      const __m256i res_clamped =
  146|  1.22M|          _mm256_min_epi16(_mm256_max_epi16(res, clamp_low), clamp_high);
  147|  1.22M|      _mm256_store_si256((__m256i *)&im_block[i * im_stride], res_clamped);
  148|  1.22M|    }
  149|       |
  150|       |    /* Vertical filter */
  151|  60.9k|    {
  152|  60.9k|      __m256i src_0 = _mm256_loadu_si256((__m256i *)(im_block + 0 * im_stride));
  153|  60.9k|      __m256i src_1 = _mm256_loadu_si256((__m256i *)(im_block + 1 * im_stride));
  154|  60.9k|      __m256i src_2 = _mm256_loadu_si256((__m256i *)(im_block + 2 * im_stride));
  155|  60.9k|      __m256i src_3 = _mm256_loadu_si256((__m256i *)(im_block + 3 * im_stride));
  156|  60.9k|      __m256i src_4 = _mm256_loadu_si256((__m256i *)(im_block + 4 * im_stride));
  157|  60.9k|      __m256i src_5 = _mm256_loadu_si256((__m256i *)(im_block + 5 * im_stride));
  158|       |
  159|  60.9k|      __m256i s[8];
  160|  60.9k|      s[0] = _mm256_unpacklo_epi16(src_0, src_1);
  161|  60.9k|      s[1] = _mm256_unpacklo_epi16(src_2, src_3);
  162|  60.9k|      s[2] = _mm256_unpacklo_epi16(src_4, src_5);
  163|       |
  164|  60.9k|      s[4] = _mm256_unpackhi_epi16(src_0, src_1);
  165|  60.9k|      s[5] = _mm256_unpackhi_epi16(src_2, src_3);
  166|  60.9k|      s[6] = _mm256_unpackhi_epi16(src_4, src_5);
  167|       |
  168|  1.09M|      for (i = 0; i < h - 1; i += 2) {
  ------------------
  |  Branch (168:19): [True: 1.02M, False: 60.9k]
  ------------------
  169|  1.02M|        const int16_t *data = &im_block[i * im_stride];
  170|       |
  171|  1.02M|        const __m256i s6 =
  172|  1.02M|            _mm256_loadu_si256((__m256i *)(data + 6 * im_stride));
  173|  1.02M|        const __m256i s7 =
  174|  1.02M|            _mm256_loadu_si256((__m256i *)(data + 7 * im_stride));
  175|       |
  176|  1.02M|        s[3] = _mm256_unpacklo_epi16(s6, s7);
  177|  1.02M|        s[7] = _mm256_unpackhi_epi16(s6, s7);
  178|       |
  179|  1.02M|        __m256i res_a = convolve(s, coeffs_v);
  180|  1.02M|        __m256i res_b = convolve(s + 4, coeffs_v);
  181|       |
  182|  1.02M|        const __m256i res_a_round = _mm256_sra_epi32(
  183|  1.02M|            _mm256_add_epi32(res_a, round_const_v), round_shift_v);
  184|  1.02M|        const __m256i res_b_round = _mm256_sra_epi32(
  185|  1.02M|            _mm256_add_epi32(res_b, round_const_v), round_shift_v);
  186|       |
  187|       |        /* rounding code */
  188|       |        // 16 bit conversion
  189|  1.02M|        const __m256i res_16bit = _mm256_packs_epi32(res_a_round, res_b_round);
  190|       |        // 8 bit conversion and saturation to uint8
  191|  1.02M|        const __m256i res_8b = _mm256_packus_epi16(res_16bit, res_16bit);
  192|       |
  193|  1.02M|        const __m128i res_0 = _mm256_castsi256_si128(res_8b);
  194|  1.02M|        const __m128i res_1 = _mm256_extracti128_si256(res_8b, 1);
  195|       |
  196|       |        // Store values into the destination buffer
  197|  1.02M|        __m128i *const p_0 = (__m128i *)&dst[i * dst_stride + j];
  198|  1.02M|        __m128i *const p_1 = (__m128i *)&dst[i * dst_stride + j + dst_stride];
  199|       |
  200|  1.02M|        _mm_storel_epi64(p_0, res_0);
  201|  1.02M|        _mm_storel_epi64(p_1, res_1);
  202|       |
  203|  1.02M|        s[0] = s[1];
  204|  1.02M|        s[1] = s[2];
  205|  1.02M|        s[2] = s[3];
  206|       |
  207|  1.02M|        s[4] = s[5];
  208|  1.02M|        s[5] = s[6];
  209|  1.02M|        s[6] = s[7];
  210|  1.02M|      }
  211|  60.9k|      if (h - i) {
  ------------------
  |  Branch (211:11): [True: 14.6k, False: 46.3k]
  ------------------
  212|  14.6k|        s[0] = _mm256_permute2x128_si256(s[0], s[4], 0x20);
  213|  14.6k|        s[1] = _mm256_permute2x128_si256(s[1], s[5], 0x20);
  214|  14.6k|        s[2] = _mm256_permute2x128_si256(s[2], s[6], 0x20);
  215|       |
  216|  14.6k|        const int16_t *data = &im_block[i * im_stride];
  217|  14.6k|        const __m128i s6_ = _mm_loadu_si128((__m128i *)(data + 6 * im_stride));
  218|  14.6k|        const __m128i s7_ = _mm_loadu_si128((__m128i *)(data + 7 * im_stride));
  219|       |
  220|  14.6k|        __m128i s3 = _mm_unpacklo_epi16(s6_, s7_);
  221|  14.6k|        __m128i s7 = _mm_unpackhi_epi16(s6_, s7_);
  222|       |
  223|  14.6k|        s[3] = _mm256_inserti128_si256(_mm256_castsi128_si256(s3), s7, 1);
  224|  14.6k|        __m256i convolveres = convolve(s, coeffs_v);
  225|       |
  226|  14.6k|        const __m256i res_round = _mm256_sra_epi32(
  227|  14.6k|            _mm256_add_epi32(convolveres, round_const_v), round_shift_v);
  228|       |
  229|       |        /* rounding code */
  230|       |        // 16 bit conversion
  231|  14.6k|        __m128i reslo = _mm256_castsi256_si128(res_round);
  232|  14.6k|        __m128i reshi = _mm256_extracti128_si256(res_round, 1);
  233|  14.6k|        const __m128i res_16bit = _mm_packus_epi32(reslo, reshi);
  234|       |
  235|       |        // 8 bit conversion and saturation to uint8
  236|  14.6k|        const __m128i res_8b = _mm_packus_epi16(res_16bit, res_16bit);
  237|  14.6k|        __m128i *const p_0 = (__m128i *)&dst[i * dst_stride + j];
  238|  14.6k|        _mm_storel_epi64(p_0, res_8b);
  239|  14.6k|      }
  240|  60.9k|    }
  241|  60.9k|  }
  242|  12.2k|}

av1_check_trailing_bits:
   89|  7.01k|int av1_check_trailing_bits(AV1Decoder *pbi, struct aom_read_bit_buffer *rb) {
   90|       |  // bit_offset is set to 0 (mod 8) when the reader is already byte aligned
   91|  7.01k|  int bits_before_alignment = 8 - rb->bit_offset % 8;
   92|  7.01k|  int trailing = aom_rb_read_literal(rb, bits_before_alignment);
   93|  7.01k|  if (trailing != (1 << (bits_before_alignment - 1))) {
  ------------------
  |  Branch (93:7): [True: 0, False: 7.01k]
  ------------------
   94|      0|    pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
   95|      0|    return -1;
   96|      0|  }
   97|  7.01k|  return 0;
   98|  7.01k|}
av1_dec_row_mt_dealloc:
 2591|  41.5k|void av1_dec_row_mt_dealloc(AV1DecRowMTSync *dec_row_mt_sync) {
 2592|  41.5k|  if (dec_row_mt_sync != NULL) {
  ------------------
  |  Branch (2592:7): [True: 41.5k, False: 0]
  ------------------
 2593|  41.5k|#if CONFIG_MULTITHREAD
 2594|  41.5k|    int i;
 2595|  41.5k|    if (dec_row_mt_sync->mutex_ != NULL) {
  ------------------
  |  Branch (2595:9): [True: 20.5k, False: 20.9k]
  ------------------
 2596|  43.4k|      for (i = 0; i < dec_row_mt_sync->allocated_sb_rows; ++i) {
  ------------------
  |  Branch (2596:19): [True: 22.8k, False: 20.5k]
  ------------------
 2597|  22.8k|        pthread_mutex_destroy(&dec_row_mt_sync->mutex_[i]);
 2598|  22.8k|      }
 2599|  20.5k|      aom_free(dec_row_mt_sync->mutex_);
 2600|  20.5k|    }
 2601|  41.5k|    if (dec_row_mt_sync->cond_ != NULL) {
  ------------------
  |  Branch (2601:9): [True: 20.5k, False: 20.9k]
  ------------------
 2602|  43.4k|      for (i = 0; i < dec_row_mt_sync->allocated_sb_rows; ++i) {
  ------------------
  |  Branch (2602:19): [True: 22.8k, False: 20.5k]
  ------------------
 2603|  22.8k|        pthread_cond_destroy(&dec_row_mt_sync->cond_[i]);
 2604|  22.8k|      }
 2605|  20.5k|      aom_free(dec_row_mt_sync->cond_);
 2606|  20.5k|    }
 2607|  41.5k|#endif  // CONFIG_MULTITHREAD
 2608|  41.5k|    aom_free(dec_row_mt_sync->cur_sb_col);
 2609|       |
 2610|       |    // clear the structure as the source of this call may be a resize in which
 2611|       |    // case this call will be followed by an _alloc() which may fail.
 2612|  41.5k|    av1_zero(*dec_row_mt_sync);
  ------------------
  |  |   43|  41.5k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2613|  41.5k|  }
 2614|  41.5k|}
av1_free_mc_tmp_buf:
 3461|   426k|void av1_free_mc_tmp_buf(ThreadData *thread_data) {
 3462|   426k|  int ref;
 3463|  1.28M|  for (ref = 0; ref < 2; ref++) {
  ------------------
  |  Branch (3463:17): [True: 853k, False: 426k]
  ------------------
 3464|   853k|    if (thread_data->mc_buf_use_highbd)
  ------------------
  |  Branch (3464:9): [True: 108k, False: 744k]
  ------------------
 3465|   108k|      aom_free(CONVERT_TO_SHORTPTR(thread_data->mc_buf[ref]));
  ------------------
  |  |   79|   108k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 3466|   744k|    else
 3467|   744k|      aom_free(thread_data->mc_buf[ref]);
 3468|   853k|    thread_data->mc_buf[ref] = NULL;
 3469|   853k|  }
 3470|   426k|  thread_data->mc_buf_size = 0;
 3471|   426k|  thread_data->mc_buf_use_highbd = 0;
 3472|       |
 3473|   426k|  aom_free(thread_data->tmp_conv_dst);
 3474|   426k|  thread_data->tmp_conv_dst = NULL;
 3475|   426k|  aom_free(thread_data->seg_mask);
 3476|   426k|  thread_data->seg_mask = NULL;
 3477|  1.28M|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (3477:19): [True: 853k, False: 426k]
  ------------------
 3478|   853k|    aom_free(thread_data->tmp_obmc_bufs[i]);
 3479|       |    thread_data->tmp_obmc_bufs[i] = NULL;
 3480|   853k|  }
 3481|   426k|}
av1_read_color_config:
 4169|  7.01k|                           struct aom_internal_error_info *error_info) {
 4170|  7.01k|  read_bitdepth(rb, seq_params, error_info);
 4171|       |
 4172|  7.01k|  seq_params->use_highbitdepth =
 4173|  7.01k|      seq_params->bit_depth > AOM_BITS_8 || !allow_lowbitdepth;
  ------------------
  |  Branch (4173:7): [True: 1.77k, False: 5.24k]
  |  Branch (4173:45): [True: 0, False: 5.24k]
  ------------------
 4174|       |  // monochrome bit (not needed for PROFILE_1)
 4175|  7.01k|  const int is_monochrome =
 4176|  7.01k|      seq_params->profile != PROFILE_1 ? aom_rb_read_bit(rb) : 0;
  ------------------
  |  Branch (4176:7): [True: 6.47k, False: 546]
  ------------------
 4177|  7.01k|  seq_params->monochrome = is_monochrome;
 4178|  7.01k|  int color_description_present_flag = aom_rb_read_bit(rb);
 4179|  7.01k|  if (color_description_present_flag) {
  ------------------
  |  Branch (4179:7): [True: 0, False: 7.01k]
  ------------------
 4180|      0|    seq_params->color_primaries = aom_rb_read_literal(rb, 8);
 4181|      0|    seq_params->transfer_characteristics = aom_rb_read_literal(rb, 8);
 4182|      0|    seq_params->matrix_coefficients = aom_rb_read_literal(rb, 8);
 4183|  7.01k|  } else {
 4184|  7.01k|    seq_params->color_primaries = AOM_CICP_CP_UNSPECIFIED;
 4185|  7.01k|    seq_params->transfer_characteristics = AOM_CICP_TC_UNSPECIFIED;
 4186|  7.01k|    seq_params->matrix_coefficients = AOM_CICP_MC_UNSPECIFIED;
 4187|  7.01k|  }
 4188|  7.01k|  if (is_monochrome) {
  ------------------
  |  Branch (4188:7): [True: 4.31k, False: 2.70k]
  ------------------
 4189|       |    // [16,235] (including xvycc) vs [0,255] range
 4190|  4.31k|    seq_params->color_range = aom_rb_read_bit(rb);
 4191|  4.31k|    seq_params->subsampling_y = seq_params->subsampling_x = 1;
 4192|  4.31k|    seq_params->chroma_sample_position = AOM_CSP_UNKNOWN;
 4193|  4.31k|    seq_params->separate_uv_delta_q = 0;
 4194|  4.31k|    return;
 4195|  4.31k|  }
 4196|  2.70k|  if (seq_params->color_primaries == AOM_CICP_CP_BT_709 &&
  ------------------
  |  Branch (4196:7): [True: 0, False: 2.70k]
  ------------------
 4197|      0|      seq_params->transfer_characteristics == AOM_CICP_TC_SRGB &&
  ------------------
  |  Branch (4197:7): [True: 0, False: 0]
  ------------------
 4198|      0|      seq_params->matrix_coefficients == AOM_CICP_MC_IDENTITY) {
  ------------------
  |  Branch (4198:7): [True: 0, False: 0]
  ------------------
 4199|      0|    seq_params->subsampling_y = seq_params->subsampling_x = 0;
 4200|      0|    seq_params->color_range = 1;  // assume full color-range
 4201|      0|    if (!(seq_params->profile == PROFILE_1 ||
  ------------------
  |  Branch (4201:11): [True: 0, False: 0]
  ------------------
 4202|      0|          (seq_params->profile == PROFILE_2 &&
  ------------------
  |  Branch (4202:12): [True: 0, False: 0]
  ------------------
 4203|      0|           seq_params->bit_depth == AOM_BITS_12))) {
  ------------------
  |  Branch (4203:12): [True: 0, False: 0]
  ------------------
 4204|      0|      aom_internal_error(
 4205|      0|          error_info, AOM_CODEC_UNSUP_BITSTREAM,
 4206|      0|          "sRGB colorspace not compatible with specified profile");
 4207|      0|    }
 4208|  2.70k|  } else {
 4209|       |    // [16,235] (including xvycc) vs [0,255] range
 4210|  2.70k|    seq_params->color_range = aom_rb_read_bit(rb);
 4211|  2.70k|    if (seq_params->profile == PROFILE_0) {
  ------------------
  |  Branch (4211:9): [True: 1.12k, False: 1.57k]
  ------------------
 4212|       |      // 420 only
 4213|  1.12k|      seq_params->subsampling_x = seq_params->subsampling_y = 1;
 4214|  1.57k|    } else if (seq_params->profile == PROFILE_1) {
  ------------------
  |  Branch (4214:16): [True: 546, False: 1.03k]
  ------------------
 4215|       |      // 444 only
 4216|    546|      seq_params->subsampling_x = seq_params->subsampling_y = 0;
 4217|  1.03k|    } else {
 4218|  1.03k|      assert(seq_params->profile == PROFILE_2);
 4219|  1.03k|      if (seq_params->bit_depth == AOM_BITS_12) {
  ------------------
  |  Branch (4219:11): [True: 420, False: 611]
  ------------------
 4220|    420|        seq_params->subsampling_x = aom_rb_read_bit(rb);
 4221|    420|        if (seq_params->subsampling_x)
  ------------------
  |  Branch (4221:13): [True: 332, False: 88]
  ------------------
 4222|    332|          seq_params->subsampling_y = aom_rb_read_bit(rb);  // 422 or 420
 4223|     88|        else
 4224|     88|          seq_params->subsampling_y = 0;  // 444
 4225|    611|      } else {
 4226|       |        // 422
 4227|    611|        seq_params->subsampling_x = 1;
 4228|    611|        seq_params->subsampling_y = 0;
 4229|    611|      }
 4230|  1.03k|    }
 4231|  2.70k|    if (seq_params->matrix_coefficients == AOM_CICP_MC_IDENTITY &&
  ------------------
  |  Branch (4231:9): [True: 0, False: 2.70k]
  ------------------
 4232|      0|        (seq_params->subsampling_x || seq_params->subsampling_y)) {
  ------------------
  |  Branch (4232:10): [True: 0, False: 0]
  |  Branch (4232:39): [True: 0, False: 0]
  ------------------
 4233|      0|      aom_internal_error(
 4234|      0|          error_info, AOM_CODEC_UNSUP_BITSTREAM,
 4235|      0|          "Identity CICP Matrix incompatible with non 4:4:4 color sampling");
 4236|      0|    }
 4237|  2.70k|    if (seq_params->subsampling_x && seq_params->subsampling_y) {
  ------------------
  |  Branch (4237:9): [True: 2.06k, False: 634]
  |  Branch (4237:38): [True: 1.38k, False: 681]
  ------------------
 4238|  1.38k|      seq_params->chroma_sample_position = aom_rb_read_literal(rb, 2);
 4239|  1.38k|    }
 4240|  2.70k|  }
 4241|  2.70k|  seq_params->separate_uv_delta_q = aom_rb_read_bit(rb);
 4242|  2.70k|}
av1_read_sequence_header:
 4300|  7.01k|                              SequenceHeader *seq_params) {
 4301|  7.01k|  const int num_bits_width = aom_rb_read_literal(rb, 4) + 1;
 4302|  7.01k|  const int num_bits_height = aom_rb_read_literal(rb, 4) + 1;
 4303|  7.01k|  const int max_frame_width = aom_rb_read_literal(rb, num_bits_width) + 1;
 4304|  7.01k|  const int max_frame_height = aom_rb_read_literal(rb, num_bits_height) + 1;
 4305|       |
 4306|  7.01k|  seq_params->num_bits_width = num_bits_width;
 4307|  7.01k|  seq_params->num_bits_height = num_bits_height;
 4308|  7.01k|  seq_params->max_frame_width = max_frame_width;
 4309|  7.01k|  seq_params->max_frame_height = max_frame_height;
 4310|       |
 4311|  7.01k|  if (seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (4311:7): [True: 0, False: 7.01k]
  ------------------
 4312|      0|    seq_params->frame_id_numbers_present_flag = 0;
 4313|  7.01k|  } else {
 4314|  7.01k|    seq_params->frame_id_numbers_present_flag = aom_rb_read_bit(rb);
 4315|  7.01k|  }
 4316|  7.01k|  if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (4316:7): [True: 0, False: 7.01k]
  ------------------
 4317|       |    // We must always have delta_frame_id_length < frame_id_length,
 4318|       |    // in order for a frame to be referenced with a unique delta.
 4319|       |    // Avoid wasting bits by using a coding that enforces this restriction.
 4320|      0|    seq_params->delta_frame_id_length = aom_rb_read_literal(rb, 4) + 2;
 4321|      0|    seq_params->frame_id_length =
 4322|      0|        aom_rb_read_literal(rb, 3) + seq_params->delta_frame_id_length + 1;
 4323|      0|    if (seq_params->frame_id_length > 16)
  ------------------
  |  Branch (4323:9): [True: 0, False: 0]
  ------------------
 4324|      0|      aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 4325|      0|                         "Invalid frame_id_length");
 4326|      0|  }
 4327|       |
 4328|  7.01k|  setup_sb_size(seq_params, rb);
 4329|       |
 4330|  7.01k|  seq_params->enable_filter_intra = aom_rb_read_bit(rb);
 4331|  7.01k|  seq_params->enable_intra_edge_filter = aom_rb_read_bit(rb);
 4332|       |
 4333|  7.01k|  if (seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (4333:7): [True: 0, False: 7.01k]
  ------------------
 4334|      0|    seq_params->enable_interintra_compound = 0;
 4335|      0|    seq_params->enable_masked_compound = 0;
 4336|      0|    seq_params->enable_warped_motion = 0;
 4337|      0|    seq_params->enable_dual_filter = 0;
 4338|      0|    seq_params->order_hint_info.enable_order_hint = 0;
 4339|      0|    seq_params->order_hint_info.enable_dist_wtd_comp = 0;
 4340|      0|    seq_params->order_hint_info.enable_ref_frame_mvs = 0;
 4341|      0|    seq_params->force_screen_content_tools = 2;  // SELECT_SCREEN_CONTENT_TOOLS
 4342|      0|    seq_params->force_integer_mv = 2;            // SELECT_INTEGER_MV
 4343|      0|    seq_params->order_hint_info.order_hint_bits_minus_1 = -1;
 4344|  7.01k|  } else {
 4345|  7.01k|    seq_params->enable_interintra_compound = aom_rb_read_bit(rb);
 4346|  7.01k|    seq_params->enable_masked_compound = aom_rb_read_bit(rb);
 4347|  7.01k|    seq_params->enable_warped_motion = aom_rb_read_bit(rb);
 4348|  7.01k|    seq_params->enable_dual_filter = aom_rb_read_bit(rb);
 4349|       |
 4350|  7.01k|    seq_params->order_hint_info.enable_order_hint = aom_rb_read_bit(rb);
 4351|  7.01k|    seq_params->order_hint_info.enable_dist_wtd_comp =
 4352|  7.01k|        seq_params->order_hint_info.enable_order_hint ? aom_rb_read_bit(rb) : 0;
  ------------------
  |  Branch (4352:9): [True: 7.01k, False: 0]
  ------------------
 4353|  7.01k|    seq_params->order_hint_info.enable_ref_frame_mvs =
 4354|  7.01k|        seq_params->order_hint_info.enable_order_hint ? aom_rb_read_bit(rb) : 0;
  ------------------
  |  Branch (4354:9): [True: 7.01k, False: 0]
  ------------------
 4355|       |
 4356|  7.01k|    if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (4356:9): [True: 7.01k, False: 0]
  ------------------
 4357|  7.01k|      seq_params->force_screen_content_tools =
 4358|  7.01k|          2;  // SELECT_SCREEN_CONTENT_TOOLS
 4359|  7.01k|    } else {
 4360|      0|      seq_params->force_screen_content_tools = aom_rb_read_bit(rb);
 4361|      0|    }
 4362|       |
 4363|  7.01k|    if (seq_params->force_screen_content_tools > 0) {
  ------------------
  |  Branch (4363:9): [True: 7.01k, False: 0]
  ------------------
 4364|  7.01k|      if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (4364:11): [True: 7.01k, False: 0]
  ------------------
 4365|  7.01k|        seq_params->force_integer_mv = 2;  // SELECT_INTEGER_MV
 4366|  7.01k|      } else {
 4367|      0|        seq_params->force_integer_mv = aom_rb_read_bit(rb);
 4368|      0|      }
 4369|  7.01k|    } else {
 4370|      0|      seq_params->force_integer_mv = 2;  // SELECT_INTEGER_MV
 4371|      0|    }
 4372|  7.01k|    seq_params->order_hint_info.order_hint_bits_minus_1 =
 4373|  7.01k|        seq_params->order_hint_info.enable_order_hint
  ------------------
  |  Branch (4373:9): [True: 7.01k, False: 0]
  ------------------
 4374|  7.01k|            ? aom_rb_read_literal(rb, 3)
 4375|  7.01k|            : -1;
 4376|  7.01k|  }
 4377|       |
 4378|  7.01k|  seq_params->enable_superres = aom_rb_read_bit(rb);
 4379|  7.01k|  seq_params->enable_cdef = aom_rb_read_bit(rb);
 4380|  7.01k|  seq_params->enable_restoration = aom_rb_read_bit(rb);
 4381|  7.01k|}
av1_init_read_bit_buffer:
 5234|  42.1k|    const uint8_t *data_end) {
 5235|  42.1k|  rb->bit_offset = 0;
 5236|  42.1k|  rb->error_handler = error_handler;
 5237|  42.1k|  rb->error_handler_data = &pbi->common;
 5238|  42.1k|  rb->bit_buffer = data;
 5239|  42.1k|  rb->bit_buffer_end = data_end;
 5240|  42.1k|  return rb;
 5241|  42.1k|}
av1_read_profile:
 5243|  14.0k|BITSTREAM_PROFILE av1_read_profile(struct aom_read_bit_buffer *rb) {
 5244|  14.0k|  int profile = aom_rb_read_literal(rb, PROFILE_BITS);
  ------------------
  |  |   79|  14.0k|#define PROFILE_BITS 3
  ------------------
 5245|  14.0k|  return (BITSTREAM_PROFILE)profile;
 5246|  14.0k|}
av1_decode_frame_headers_and_setup:
 5260|  28.0k|                                            int trailing_bits_present) {
 5261|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 5262|  28.0k|  const int num_planes = av1_num_planes(cm);
 5263|  28.0k|  MACROBLOCKD *const xd = &pbi->dcb.xd;
 5264|       |
 5265|       |#if CONFIG_BITSTREAM_DEBUG
 5266|       |  if (cm->seq_params->order_hint_info.enable_order_hint) {
 5267|       |    aom_bitstream_queue_set_frame_read(cm->current_frame.order_hint * 2 +
 5268|       |                                       cm->show_frame);
 5269|       |  } else {
 5270|       |    // This is currently used in RTC encoding. cm->show_frame is always 1.
 5271|       |    assert(cm->show_frame);
 5272|       |    aom_bitstream_queue_set_frame_read(cm->current_frame.frame_number);
 5273|       |  }
 5274|       |#endif
 5275|       |#if CONFIG_MISMATCH_DEBUG
 5276|       |  mismatch_move_frame_idx_r();
 5277|       |#endif
 5278|       |
 5279|   224k|  for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (5279:28): [True: 196k, False: 28.0k]
  ------------------
 5280|   196k|    cm->global_motion[i] = default_warp_params;
 5281|   196k|    cm->cur_frame->global_motion[i] = default_warp_params;
 5282|   196k|  }
 5283|  28.0k|  xd->global_motion = cm->global_motion;
 5284|       |
 5285|  28.0k|  read_uncompressed_header(pbi, rb);
 5286|       |
 5287|  28.0k|  if (trailing_bits_present) av1_check_trailing_bits(pbi, rb);
  ------------------
  |  Branch (5287:7): [True: 0, False: 28.0k]
  ------------------
 5288|       |
 5289|  28.0k|  if (!cm->tiles.single_tile_decoding &&
  ------------------
  |  Branch (5289:7): [True: 28.0k, False: 0]
  ------------------
 5290|  28.0k|      (pbi->dec_tile_row >= 0 || pbi->dec_tile_col >= 0)) {
  ------------------
  |  Branch (5290:8): [True: 0, False: 28.0k]
  |  Branch (5290:34): [True: 0, False: 28.0k]
  ------------------
 5291|      0|    pbi->dec_tile_row = -1;
 5292|      0|    pbi->dec_tile_col = -1;
 5293|      0|  }
 5294|       |
 5295|  28.0k|  const uint32_t uncomp_hdr_size =
 5296|  28.0k|      (uint32_t)aom_rb_bytes_read(rb);  // Size of the uncompressed header
 5297|  28.0k|  YV12_BUFFER_CONFIG *new_fb = &cm->cur_frame->buf;
 5298|  28.0k|  xd->cur_buf = new_fb;
 5299|  28.0k|  if (av1_allow_intrabc(cm)) {
  ------------------
  |  Branch (5299:7): [True: 0, False: 28.0k]
  ------------------
 5300|      0|    av1_setup_scale_factors_for_frame(
 5301|      0|        &cm->sf_identity, xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
 5302|      0|        xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height);
 5303|      0|  }
 5304|       |
 5305|       |  // Showing a frame directly.
 5306|  28.0k|  if (cm->show_existing_frame) {
  ------------------
  |  Branch (5306:7): [True: 0, False: 28.0k]
  ------------------
 5307|      0|    if (pbi->reset_decoder_state) {
  ------------------
  |  Branch (5307:9): [True: 0, False: 0]
  ------------------
 5308|       |      // Use the default frame context values.
 5309|      0|      *cm->fc = *cm->default_frame_context;
 5310|      0|      if (!cm->fc->initialized)
  ------------------
  |  Branch (5310:11): [True: 0, False: 0]
  ------------------
 5311|      0|        aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5312|      0|                           "Uninitialized entropy context.");
 5313|      0|    }
 5314|      0|    return uncomp_hdr_size;
 5315|      0|  }
 5316|       |
 5317|  28.0k|  cm->mi_params.setup_mi(&cm->mi_params);
 5318|       |
 5319|  28.0k|  av1_calculate_ref_frame_side(cm);
 5320|  28.0k|  if (cm->features.allow_ref_frame_mvs) av1_setup_motion_field(cm);
  ------------------
  |  Branch (5320:7): [True: 21.0k, False: 7.01k]
  ------------------
 5321|       |
 5322|  28.0k|  av1_setup_block_planes(xd, cm->seq_params->subsampling_x,
 5323|  28.0k|                         cm->seq_params->subsampling_y, num_planes);
 5324|  28.0k|  if (cm->features.primary_ref_frame == PRIMARY_REF_NONE) {
  ------------------
  |  |   66|  28.0k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (5324:7): [True: 16.2k, False: 11.8k]
  ------------------
 5325|       |    // use the default frame context values
 5326|  16.2k|    *cm->fc = *cm->default_frame_context;
 5327|  16.2k|  } else {
 5328|  11.8k|    *cm->fc = get_primary_ref_frame_buf(cm)->frame_context;
 5329|  11.8k|  }
 5330|  28.0k|  if (!cm->fc->initialized)
  ------------------
  |  Branch (5330:7): [True: 0, False: 28.0k]
  ------------------
 5331|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5332|      0|                       "Uninitialized entropy context.");
 5333|       |
 5334|  28.0k|  pbi->dcb.corrupted = 0;
 5335|  28.0k|  return uncomp_hdr_size;
 5336|  28.0k|}
av1_decode_tg_tiles_and_wrapup:
 5362|  28.0k|                                    int end_tile, int initialize_flag) {
 5363|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5364|       |  start_timing(pbi, av1_decode_tg_tiles_and_wrapup_time);
 5365|       |#endif
 5366|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 5367|  28.0k|  CommonTileParams *const tiles = &cm->tiles;
 5368|  28.0k|  MACROBLOCKD *const xd = &pbi->dcb.xd;
 5369|  28.0k|  const int tile_count_tg = end_tile - start_tile + 1;
 5370|       |
 5371|  28.0k|  xd->error_info = cm->error;
 5372|  28.0k|  if (initialize_flag) setup_frame_info(pbi);
  ------------------
  |  Branch (5372:7): [True: 28.0k, False: 0]
  ------------------
 5373|  28.0k|  const int num_planes = av1_num_planes(cm);
 5374|       |
 5375|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5376|       |  start_timing(pbi, decode_tiles_time);
 5377|       |#endif
 5378|  28.0k|  if (pbi->max_threads > 1 && !(tiles->large_scale && !pbi->ext_tile_debug) &&
  ------------------
  |  Branch (5378:7): [True: 26.2k, False: 1.82k]
  |  Branch (5378:33): [True: 0, False: 26.2k]
  |  Branch (5378:55): [True: 0, False: 0]
  ------------------
 5379|  26.2k|      pbi->row_mt)
  ------------------
  |  Branch (5379:7): [True: 26.2k, False: 0]
  ------------------
 5380|  26.2k|    *p_data_end =
 5381|  26.2k|        decode_tiles_row_mt(pbi, data, data_end, start_tile, end_tile);
 5382|  1.82k|  else if (pbi->max_threads > 1 && tile_count_tg > 1 &&
  ------------------
  |  Branch (5382:12): [True: 0, False: 1.82k]
  |  Branch (5382:36): [True: 0, False: 0]
  ------------------
 5383|      0|           !(tiles->large_scale && !pbi->ext_tile_debug))
  ------------------
  |  Branch (5383:14): [True: 0, False: 0]
  |  Branch (5383:36): [True: 0, False: 0]
  ------------------
 5384|      0|    *p_data_end = decode_tiles_mt(pbi, data, data_end, start_tile, end_tile);
 5385|  1.82k|  else
 5386|  1.82k|    *p_data_end = decode_tiles(pbi, data, data_end, start_tile, end_tile);
 5387|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5388|       |  end_timing(pbi, decode_tiles_time);
 5389|       |#endif
 5390|       |
 5391|       |  // If the bit stream is monochrome, set the U and V buffers to a constant.
 5392|  28.0k|  if (num_planes < 3) {
  ------------------
  |  Branch (5392:7): [True: 17.2k, False: 10.8k]
  ------------------
 5393|  17.2k|    set_planes_to_neutral_grey(cm->seq_params, xd->cur_buf, 1);
 5394|  17.2k|  }
 5395|       |
 5396|  28.0k|  if (end_tile != tiles->rows * tiles->cols - 1) {
  ------------------
  |  Branch (5396:7): [True: 0, False: 28.0k]
  ------------------
 5397|      0|    return;
 5398|      0|  }
 5399|       |
 5400|  28.0k|  av1_alloc_cdef_buffers(cm, &pbi->cdef_worker, &pbi->cdef_sync,
 5401|  28.0k|                         pbi->num_workers, 1);
 5402|  28.0k|  av1_alloc_cdef_sync(cm, &pbi->cdef_sync, pbi->num_workers);
 5403|       |
 5404|  28.0k|  if (!cm->features.allow_intrabc && !tiles->single_tile_decoding) {
  ------------------
  |  Branch (5404:7): [True: 28.0k, False: 0]
  |  Branch (5404:38): [True: 28.0k, False: 0]
  ------------------
 5405|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5406|       |    start_timing(pbi, av1_loop_filter_frame_time);
 5407|       |#endif
 5408|  28.0k|    if (cm->lf.filter_level[0] || cm->lf.filter_level[1]) {
  ------------------
  |  Branch (5408:9): [True: 10.6k, False: 17.3k]
  |  Branch (5408:35): [True: 0, False: 17.3k]
  ------------------
 5409|  10.6k|      av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, &pbi->dcb.xd, 0,
 5410|  10.6k|                               num_planes, 0, pbi->tile_workers,
 5411|  10.6k|                               pbi->num_workers, &pbi->lf_row_sync, 0);
 5412|  10.6k|    }
 5413|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5414|       |    end_timing(pbi, av1_loop_filter_frame_time);
 5415|       |#endif
 5416|       |
 5417|  28.0k|    const int do_cdef =
 5418|  28.0k|        !pbi->skip_loop_filter && !cm->features.coded_lossless &&
  ------------------
  |  Branch (5418:9): [True: 28.0k, False: 0]
  |  Branch (5418:35): [True: 26.8k, False: 1.26k]
  ------------------
 5419|  26.8k|        (cm->cdef_info.cdef_bits || cm->cdef_info.cdef_strengths[0] ||
  ------------------
  |  Branch (5419:10): [True: 3.72k, False: 23.0k]
  |  Branch (5419:37): [True: 16.3k, False: 6.68k]
  ------------------
 5420|  6.68k|         cm->cdef_info.cdef_uv_strengths[0]);
  ------------------
  |  Branch (5420:10): [True: 491, False: 6.19k]
  ------------------
 5421|  28.0k|    const int do_superres = av1_superres_scaled(cm);
 5422|  28.0k|    const int optimized_loop_restoration = !do_cdef && !do_superres;
  ------------------
  |  Branch (5422:44): [True: 7.46k, False: 20.6k]
  |  Branch (5422:56): [True: 7.46k, False: 0]
  ------------------
 5423|  28.0k|    const int do_loop_restoration =
 5424|  28.0k|        cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (5424:9): [True: 244, False: 27.8k]
  ------------------
 5425|  27.8k|        cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (5425:9): [True: 24, False: 27.8k]
  ------------------
 5426|  27.8k|        cm->rst_info[2].frame_restoration_type != RESTORE_NONE;
  ------------------
  |  Branch (5426:9): [True: 18, False: 27.7k]
  ------------------
 5427|       |    // Frame border extension is not required in the decoder
 5428|       |    // as it happens in extend_mc_border().
 5429|  28.0k|    int do_extend_border_mt = 0;
 5430|       |
 5431|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5432|       |    start_timing(pbi, cdef_and_lr_time);
 5433|       |#endif
 5434|  28.0k|    if (!optimized_loop_restoration) {
  ------------------
  |  Branch (5434:9): [True: 20.6k, False: 7.46k]
  ------------------
 5435|  20.6k|      if (do_loop_restoration)
  ------------------
  |  Branch (5435:11): [True: 263, False: 20.3k]
  ------------------
 5436|    263|        av1_loop_restoration_save_boundary_lines(&pbi->common.cur_frame->buf,
 5437|    263|                                                 cm, 0);
 5438|       |
 5439|  20.6k|      if (do_cdef) {
  ------------------
  |  Branch (5439:11): [True: 20.6k, False: 0]
  ------------------
 5440|  20.6k|        if (pbi->num_workers > 1) {
  ------------------
  |  Branch (5440:13): [True: 19.3k, False: 1.29k]
  ------------------
 5441|  19.3k|          av1_cdef_frame_mt(cm, &pbi->dcb.xd, pbi->cdef_worker,
 5442|  19.3k|                            pbi->tile_workers, &pbi->cdef_sync,
 5443|  19.3k|                            pbi->num_workers, av1_cdef_init_fb_row_mt,
 5444|  19.3k|                            do_extend_border_mt);
 5445|  19.3k|        } else {
 5446|  1.29k|          av1_cdef_frame(&pbi->common.cur_frame->buf, cm, &pbi->dcb.xd,
 5447|  1.29k|                         av1_cdef_init_fb_row);
 5448|  1.29k|        }
 5449|  20.6k|      }
 5450|       |
 5451|  20.6k|      superres_post_decode(pbi);
 5452|       |
 5453|  20.6k|      if (do_loop_restoration) {
  ------------------
  |  Branch (5453:11): [True: 263, False: 20.3k]
  ------------------
 5454|    263|        av1_loop_restoration_save_boundary_lines(&pbi->common.cur_frame->buf,
 5455|    263|                                                 cm, 1);
 5456|    263|        if (pbi->num_workers > 1) {
  ------------------
  |  Branch (5456:13): [True: 235, False: 28]
  ------------------
 5457|    235|          av1_loop_restoration_filter_frame_mt(
 5458|    235|              (YV12_BUFFER_CONFIG *)xd->cur_buf, cm, optimized_loop_restoration,
 5459|    235|              pbi->tile_workers, pbi->num_workers, &pbi->lr_row_sync,
 5460|    235|              &pbi->lr_ctxt, do_extend_border_mt);
 5461|    235|        } else {
 5462|     28|          av1_loop_restoration_filter_frame((YV12_BUFFER_CONFIG *)xd->cur_buf,
 5463|     28|                                            cm, optimized_loop_restoration,
 5464|     28|                                            &pbi->lr_ctxt);
 5465|     28|        }
 5466|    263|      }
 5467|  20.6k|    } else {
 5468|       |      // In no cdef and no superres case. Provide an optimized version of
 5469|       |      // loop_restoration_filter.
 5470|  7.46k|      if (do_loop_restoration) {
  ------------------
  |  Branch (5470:11): [True: 23, False: 7.43k]
  ------------------
 5471|     23|        if (pbi->num_workers > 1) {
  ------------------
  |  Branch (5471:13): [True: 21, False: 2]
  ------------------
 5472|     21|          av1_loop_restoration_filter_frame_mt(
 5473|     21|              (YV12_BUFFER_CONFIG *)xd->cur_buf, cm, optimized_loop_restoration,
 5474|     21|              pbi->tile_workers, pbi->num_workers, &pbi->lr_row_sync,
 5475|     21|              &pbi->lr_ctxt, do_extend_border_mt);
 5476|     21|        } else {
 5477|      2|          av1_loop_restoration_filter_frame((YV12_BUFFER_CONFIG *)xd->cur_buf,
 5478|      2|                                            cm, optimized_loop_restoration,
 5479|      2|                                            &pbi->lr_ctxt);
 5480|      2|        }
 5481|     23|      }
 5482|  7.46k|    }
 5483|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5484|       |    end_timing(pbi, cdef_and_lr_time);
 5485|       |#endif
 5486|  28.0k|  }
 5487|       |
 5488|  28.0k|  if (!pbi->dcb.corrupted) {
  ------------------
  |  Branch (5488:7): [True: 28.0k, False: 0]
  ------------------
 5489|  28.0k|    if (cm->features.refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
  ------------------
  |  Branch (5489:9): [True: 28.0k, False: 0]
  ------------------
 5490|  28.0k|      assert(pbi->context_update_tile_id < pbi->allocated_tiles);
 5491|  28.0k|      *cm->fc = pbi->tile_data[pbi->context_update_tile_id].tctx;
 5492|  28.0k|      av1_reset_cdf_symbol_counters(cm->fc);
 5493|  28.0k|    }
 5494|  28.0k|  } else {
 5495|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5496|      0|                       "Decode failed. Frame data is corrupted.");
 5497|      0|  }
 5498|       |
 5499|       |#if CONFIG_INSPECTION
 5500|       |  if (pbi->inspect_cb != NULL) {
 5501|       |    (*pbi->inspect_cb)(pbi, pbi->inspect_ctx);
 5502|       |  }
 5503|       |#endif
 5504|       |
 5505|       |  // Non frame parallel update frame context here.
 5506|  28.0k|  if (!tiles->large_scale) {
  ------------------
  |  Branch (5506:7): [True: 28.0k, False: 0]
  ------------------
 5507|  28.0k|    cm->cur_frame->frame_context = *cm->fc;
 5508|  28.0k|  }
 5509|       |
 5510|  28.0k|  if (cm->show_frame && !cm->seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (5510:7): [True: 28.0k, False: 0]
  |  Branch (5510:25): [True: 0, False: 28.0k]
  ------------------
 5511|      0|    ++cm->current_frame.frame_number;
 5512|      0|  }
 5513|       |
 5514|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5515|       |  end_timing(pbi, av1_decode_tg_tiles_and_wrapup_time);
 5516|       |#endif
 5517|  28.0k|}
decodeframe.c:read_bitdepth:
 3971|  7.01k|                                 struct aom_internal_error_info *error_info) {
 3972|  7.01k|  const int high_bitdepth = aom_rb_read_bit(rb);
 3973|  7.01k|  if (seq_params->profile == PROFILE_2 && high_bitdepth) {
  ------------------
  |  Branch (3973:7): [True: 1.54k, False: 5.47k]
  |  Branch (3973:43): [True: 1.05k, False: 486]
  ------------------
 3974|  1.05k|    const int twelve_bit = aom_rb_read_bit(rb);
 3975|  1.05k|    seq_params->bit_depth = twelve_bit ? AOM_BITS_12 : AOM_BITS_10;
  ------------------
  |  Branch (3975:29): [True: 929, False: 125]
  ------------------
 3976|  5.96k|  } else if (seq_params->profile <= PROFILE_2) {
  ------------------
  |  Branch (3976:14): [True: 5.96k, False: 0]
  ------------------
 3977|  5.96k|    seq_params->bit_depth = high_bitdepth ? AOM_BITS_10 : AOM_BITS_8;
  ------------------
  |  Branch (3977:29): [True: 718, False: 5.24k]
  ------------------
 3978|  5.96k|  } else {
 3979|      0|    aom_internal_error(error_info, AOM_CODEC_UNSUP_BITSTREAM,
 3980|      0|                       "Unsupported profile/bit-depth combination");
 3981|      0|  }
 3982|       |#if !CONFIG_AV1_HIGHBITDEPTH
 3983|       |  if (seq_params->bit_depth > AOM_BITS_8) {
 3984|       |    aom_internal_error(error_info, AOM_CODEC_UNSUP_BITSTREAM,
 3985|       |                       "Bit-depth %d not supported", seq_params->bit_depth);
 3986|       |  }
 3987|       |#endif
 3988|  7.01k|}
decodeframe.c:setup_sb_size:
 2053|  7.01k|                                 struct aom_read_bit_buffer *rb) {
 2054|  7.01k|  set_sb_size(seq_params, aom_rb_read_bit(rb) ? BLOCK_128X128 : BLOCK_64X64);
  ------------------
  |  Branch (2054:27): [True: 0, False: 7.01k]
  ------------------
 2055|  7.01k|}
decodeframe.c:read_uncompressed_header:
 4570|  28.0k|                                    struct aom_read_bit_buffer *rb) {
 4571|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 4572|  28.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 4573|  28.0k|  CurrentFrame *const current_frame = &cm->current_frame;
 4574|  28.0k|  FeatureFlags *const features = &cm->features;
 4575|  28.0k|  MACROBLOCKD *const xd = &pbi->dcb.xd;
 4576|  28.0k|  BufferPool *const pool = cm->buffer_pool;
 4577|  28.0k|  RefCntBuffer *const frame_bufs = pool->frame_bufs;
 4578|  28.0k|  aom_s_frame_info *sframe_info = &pbi->sframe_info;
 4579|  28.0k|  sframe_info->is_s_frame = 0;
 4580|  28.0k|  sframe_info->is_s_frame_at_altref = 0;
 4581|       |
 4582|  28.0k|  if (!pbi->sequence_header_ready) {
  ------------------
  |  Branch (4582:7): [True: 0, False: 28.0k]
  ------------------
 4583|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4584|      0|                       "No sequence header");
 4585|      0|  }
 4586|       |
 4587|  28.0k|  if (seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (4587:7): [True: 0, False: 28.0k]
  ------------------
 4588|      0|    cm->show_existing_frame = 0;
 4589|      0|    cm->show_frame = 1;
 4590|      0|    current_frame->frame_type = KEY_FRAME;
 4591|      0|    if (pbi->sequence_header_changed) {
  ------------------
  |  Branch (4591:9): [True: 0, False: 0]
  ------------------
 4592|       |      // This is the start of a new coded video sequence.
 4593|      0|      pbi->sequence_header_changed = 0;
 4594|      0|      pbi->decoding_first_frame = 1;
 4595|      0|      reset_frame_buffers(cm);
 4596|      0|    }
 4597|      0|    features->error_resilient_mode = 1;
 4598|  28.0k|  } else {
 4599|  28.0k|    cm->show_existing_frame = aom_rb_read_bit(rb);
 4600|  28.0k|    pbi->reset_decoder_state = 0;
 4601|       |
 4602|  28.0k|    if (cm->show_existing_frame) {
  ------------------
  |  Branch (4602:9): [True: 0, False: 28.0k]
  ------------------
 4603|      0|      if (pbi->sequence_header_changed) {
  ------------------
  |  Branch (4603:11): [True: 0, False: 0]
  ------------------
 4604|      0|        aom_internal_error(
 4605|      0|            &pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4606|      0|            "New sequence header starts with a show_existing_frame.");
 4607|      0|      }
 4608|       |      // Show an existing frame directly.
 4609|      0|      const int existing_frame_idx = aom_rb_read_literal(rb, 3);
 4610|      0|      RefCntBuffer *const frame_to_show = cm->ref_frame_map[existing_frame_idx];
 4611|      0|      if (frame_to_show == NULL) {
  ------------------
  |  Branch (4611:11): [True: 0, False: 0]
  ------------------
 4612|      0|        aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
 4613|      0|                           "Buffer does not contain a decoded frame");
 4614|      0|      }
 4615|      0|      if (seq_params->decoder_model_info_present_flag &&
  ------------------
  |  Branch (4615:11): [True: 0, False: 0]
  ------------------
 4616|      0|          seq_params->timing_info.equal_picture_interval == 0) {
  ------------------
  |  Branch (4616:11): [True: 0, False: 0]
  ------------------
 4617|      0|        read_temporal_point_info(cm, rb);
 4618|      0|      }
 4619|      0|      if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (4619:11): [True: 0, False: 0]
  ------------------
 4620|      0|        int frame_id_length = seq_params->frame_id_length;
 4621|      0|        int display_frame_id = aom_rb_read_literal(rb, frame_id_length);
 4622|       |        /* Compare display_frame_id with ref_frame_id and check valid for
 4623|       |         * referencing */
 4624|      0|        if (display_frame_id != cm->ref_frame_id[existing_frame_idx] ||
  ------------------
  |  Branch (4624:13): [True: 0, False: 0]
  ------------------
 4625|      0|            pbi->valid_for_referencing[existing_frame_idx] == 0)
  ------------------
  |  Branch (4625:13): [True: 0, False: 0]
  ------------------
 4626|      0|          aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4627|      0|                             "Reference buffer frame ID mismatch");
 4628|      0|      }
 4629|      0|      lock_buffer_pool(pool);
 4630|      0|      assert(frame_to_show->ref_count > 0);
 4631|       |      // cm->cur_frame should be the buffer referenced by the return value
 4632|       |      // of the get_free_fb() call in assign_cur_frame_new_fb() (called by
 4633|       |      // av1_receive_compressed_data()), so the ref_count should be 1.
 4634|      0|      assert(cm->cur_frame->ref_count == 1);
 4635|       |      // assign_frame_buffer_p() decrements ref_count directly rather than
 4636|       |      // call decrease_ref_count(). If cm->cur_frame->raw_frame_buffer has
 4637|       |      // already been allocated, it will not be released by
 4638|       |      // assign_frame_buffer_p()!
 4639|      0|      assert(!cm->cur_frame->raw_frame_buffer.data);
 4640|      0|      assign_frame_buffer_p(&cm->cur_frame, frame_to_show);
 4641|      0|      pbi->reset_decoder_state = frame_to_show->frame_type == KEY_FRAME;
 4642|      0|      unlock_buffer_pool(pool);
 4643|       |
 4644|      0|      cm->lf.filter_level[0] = 0;
 4645|      0|      cm->lf.filter_level[1] = 0;
 4646|      0|      cm->show_frame = 1;
 4647|      0|      current_frame->order_hint = frame_to_show->order_hint;
 4648|       |
 4649|       |      // Section 6.8.2: It is a requirement of bitstream conformance that when
 4650|       |      // show_existing_frame is used to show a previous frame, that the value
 4651|       |      // of showable_frame for the previous frame was equal to 1.
 4652|      0|      if (!frame_to_show->showable_frame) {
  ------------------
  |  Branch (4652:11): [True: 0, False: 0]
  ------------------
 4653|      0|        aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
 4654|      0|                           "Buffer does not contain a showable frame");
 4655|      0|      }
 4656|       |      // Section 6.8.2: It is a requirement of bitstream conformance that when
 4657|       |      // show_existing_frame is used to show a previous frame with
 4658|       |      // RefFrameType[ frame_to_show_map_idx ] equal to KEY_FRAME, that the
 4659|       |      // frame is output via the show_existing_frame mechanism at most once.
 4660|      0|      if (pbi->reset_decoder_state) frame_to_show->showable_frame = 0;
  ------------------
  |  Branch (4660:11): [True: 0, False: 0]
  ------------------
 4661|       |
 4662|      0|      cm->film_grain_params = frame_to_show->film_grain_params;
 4663|       |
 4664|      0|      if (pbi->reset_decoder_state) {
  ------------------
  |  Branch (4664:11): [True: 0, False: 0]
  ------------------
 4665|      0|        show_existing_frame_reset(pbi, existing_frame_idx);
 4666|      0|      } else {
 4667|      0|        current_frame->refresh_frame_flags = 0;
 4668|      0|      }
 4669|       |
 4670|      0|      return 0;
 4671|      0|    }
 4672|       |
 4673|  28.0k|    current_frame->frame_type = (FRAME_TYPE)aom_rb_read_literal(rb, 2);
 4674|  28.0k|    if (pbi->sequence_header_changed) {
  ------------------
  |  Branch (4674:9): [True: 0, False: 28.0k]
  ------------------
 4675|      0|      if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (4675:11): [True: 0, False: 0]
  ------------------
 4676|       |        // This is the start of a new coded video sequence.
 4677|      0|        pbi->sequence_header_changed = 0;
 4678|      0|        pbi->decoding_first_frame = 1;
 4679|      0|        reset_frame_buffers(cm);
 4680|      0|      } else {
 4681|      0|        aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4682|      0|                           "Sequence header has changed without a keyframe.");
 4683|      0|      }
 4684|      0|    }
 4685|       |
 4686|  28.0k|    cm->show_frame = aom_rb_read_bit(rb);
 4687|  28.0k|    if (cm->show_frame == 0) pbi->is_arf_frame_present = 1;
  ------------------
  |  Branch (4687:9): [True: 0, False: 28.0k]
  ------------------
 4688|  28.0k|    if (cm->show_frame == 0 && cm->current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (4688:9): [True: 0, False: 28.0k]
  |  Branch (4688:32): [True: 0, False: 0]
  ------------------
 4689|      0|      pbi->is_fwd_kf_present = 1;
 4690|  28.0k|    if (cm->current_frame.frame_type == S_FRAME) {
  ------------------
  |  Branch (4690:9): [True: 0, False: 28.0k]
  ------------------
 4691|      0|      sframe_info->is_s_frame = 1;
 4692|      0|      sframe_info->is_s_frame_at_altref = cm->show_frame ? 0 : 1;
  ------------------
  |  Branch (4692:43): [True: 0, False: 0]
  ------------------
 4693|      0|    }
 4694|  28.0k|    if (seq_params->still_picture &&
  ------------------
  |  Branch (4694:9): [True: 0, False: 28.0k]
  ------------------
 4695|      0|        (current_frame->frame_type != KEY_FRAME || !cm->show_frame)) {
  ------------------
  |  Branch (4695:10): [True: 0, False: 0]
  |  Branch (4695:52): [True: 0, False: 0]
  ------------------
 4696|      0|      aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4697|      0|                         "Still pictures must be coded as shown keyframes");
 4698|      0|    }
 4699|  28.0k|    cm->showable_frame = current_frame->frame_type != KEY_FRAME;
 4700|  28.0k|    if (cm->show_frame) {
  ------------------
  |  Branch (4700:9): [True: 28.0k, False: 0]
  ------------------
 4701|  28.0k|      if (seq_params->decoder_model_info_present_flag &&
  ------------------
  |  Branch (4701:11): [True: 0, False: 28.0k]
  ------------------
 4702|      0|          seq_params->timing_info.equal_picture_interval == 0)
  ------------------
  |  Branch (4702:11): [True: 0, False: 0]
  ------------------
 4703|      0|        read_temporal_point_info(cm, rb);
 4704|  28.0k|    } else {
 4705|       |      // See if this frame can be used as show_existing_frame in future
 4706|      0|      cm->showable_frame = aom_rb_read_bit(rb);
 4707|      0|    }
 4708|  28.0k|    cm->cur_frame->showable_frame = cm->showable_frame;
 4709|  28.0k|    features->error_resilient_mode =
 4710|  28.0k|        frame_is_sframe(cm) ||
  ------------------
  |  Branch (4710:9): [True: 0, False: 28.0k]
  ------------------
 4711|  28.0k|                (current_frame->frame_type == KEY_FRAME && cm->show_frame)
  ------------------
  |  Branch (4711:18): [True: 7.01k, False: 21.0k]
  |  Branch (4711:60): [True: 7.01k, False: 0]
  ------------------
 4712|  28.0k|            ? 1
 4713|  28.0k|            : aom_rb_read_bit(rb);
 4714|  28.0k|  }
 4715|       |
 4716|  28.0k|  if (current_frame->frame_type == KEY_FRAME && cm->show_frame) {
  ------------------
  |  Branch (4716:7): [True: 7.01k, False: 21.0k]
  |  Branch (4716:49): [True: 7.01k, False: 0]
  ------------------
 4717|       |    /* All frames need to be marked as not valid for referencing */
 4718|  63.1k|    for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (4718:21): [True: 56.1k, False: 7.01k]
  ------------------
 4719|  56.1k|      pbi->valid_for_referencing[i] = 0;
 4720|  56.1k|    }
 4721|  7.01k|  }
 4722|  28.0k|  features->disable_cdf_update = aom_rb_read_bit(rb);
 4723|  28.0k|  if (seq_params->force_screen_content_tools == 2) {
  ------------------
  |  Branch (4723:7): [True: 28.0k, False: 0]
  ------------------
 4724|  28.0k|    features->allow_screen_content_tools = aom_rb_read_bit(rb);
 4725|  28.0k|  } else {
 4726|      0|    features->allow_screen_content_tools =
 4727|      0|        seq_params->force_screen_content_tools;
 4728|      0|  }
 4729|       |
 4730|  28.0k|  if (features->allow_screen_content_tools) {
  ------------------
  |  Branch (4730:7): [True: 3.02k, False: 25.0k]
  ------------------
 4731|  3.02k|    if (seq_params->force_integer_mv == 2) {
  ------------------
  |  Branch (4731:9): [True: 3.02k, False: 0]
  ------------------
 4732|  3.02k|      features->cur_frame_force_integer_mv = aom_rb_read_bit(rb);
 4733|  3.02k|    } else {
 4734|      0|      features->cur_frame_force_integer_mv = seq_params->force_integer_mv;
 4735|      0|    }
 4736|  25.0k|  } else {
 4737|  25.0k|    features->cur_frame_force_integer_mv = 0;
 4738|  25.0k|  }
 4739|       |
 4740|  28.0k|  int frame_size_override_flag = 0;
 4741|  28.0k|  features->allow_intrabc = 0;
 4742|  28.0k|  features->primary_ref_frame = PRIMARY_REF_NONE;
  ------------------
  |  |   66|  28.0k|#define PRIMARY_REF_NONE 7
  ------------------
 4743|       |
 4744|  28.0k|  if (!seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (4744:7): [True: 28.0k, False: 0]
  ------------------
 4745|  28.0k|    if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (4745:9): [True: 0, False: 28.0k]
  ------------------
 4746|      0|      int frame_id_length = seq_params->frame_id_length;
 4747|      0|      int diff_len = seq_params->delta_frame_id_length;
 4748|      0|      int prev_frame_id = 0;
 4749|      0|      int have_prev_frame_id =
 4750|      0|          !pbi->decoding_first_frame &&
  ------------------
  |  Branch (4750:11): [True: 0, False: 0]
  ------------------
 4751|      0|          !(current_frame->frame_type == KEY_FRAME && cm->show_frame);
  ------------------
  |  Branch (4751:13): [True: 0, False: 0]
  |  Branch (4751:55): [True: 0, False: 0]
  ------------------
 4752|      0|      if (have_prev_frame_id) {
  ------------------
  |  Branch (4752:11): [True: 0, False: 0]
  ------------------
 4753|      0|        prev_frame_id = cm->current_frame_id;
 4754|      0|      }
 4755|      0|      cm->current_frame_id = aom_rb_read_literal(rb, frame_id_length);
 4756|       |
 4757|      0|      if (have_prev_frame_id) {
  ------------------
  |  Branch (4757:11): [True: 0, False: 0]
  ------------------
 4758|      0|        int diff_frame_id;
 4759|      0|        if (cm->current_frame_id > prev_frame_id) {
  ------------------
  |  Branch (4759:13): [True: 0, False: 0]
  ------------------
 4760|      0|          diff_frame_id = cm->current_frame_id - prev_frame_id;
 4761|      0|        } else {
 4762|      0|          diff_frame_id =
 4763|      0|              (1 << frame_id_length) + cm->current_frame_id - prev_frame_id;
 4764|      0|        }
 4765|       |        /* Check current_frame_id for conformance */
 4766|      0|        if (prev_frame_id == cm->current_frame_id ||
  ------------------
  |  Branch (4766:13): [True: 0, False: 0]
  ------------------
 4767|      0|            diff_frame_id >= (1 << (frame_id_length - 1))) {
  ------------------
  |  Branch (4767:13): [True: 0, False: 0]
  ------------------
 4768|      0|          aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4769|      0|                             "Invalid value of current_frame_id");
 4770|      0|        }
 4771|      0|      }
 4772|       |      /* Check if some frames need to be marked as not valid for referencing */
 4773|      0|      for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (4773:23): [True: 0, False: 0]
  ------------------
 4774|      0|        if (cm->current_frame_id - (1 << diff_len) > 0) {
  ------------------
  |  Branch (4774:13): [True: 0, False: 0]
  ------------------
 4775|      0|          if (cm->ref_frame_id[i] > cm->current_frame_id ||
  ------------------
  |  Branch (4775:15): [True: 0, False: 0]
  ------------------
 4776|      0|              cm->ref_frame_id[i] < cm->current_frame_id - (1 << diff_len))
  ------------------
  |  Branch (4776:15): [True: 0, False: 0]
  ------------------
 4777|      0|            pbi->valid_for_referencing[i] = 0;
 4778|      0|        } else {
 4779|      0|          if (cm->ref_frame_id[i] > cm->current_frame_id &&
  ------------------
  |  Branch (4779:15): [True: 0, False: 0]
  ------------------
 4780|      0|              cm->ref_frame_id[i] < (1 << frame_id_length) +
  ------------------
  |  Branch (4780:15): [True: 0, False: 0]
  ------------------
 4781|      0|                                        cm->current_frame_id - (1 << diff_len))
 4782|      0|            pbi->valid_for_referencing[i] = 0;
 4783|      0|        }
 4784|      0|      }
 4785|      0|    }
 4786|       |
 4787|  28.0k|    frame_size_override_flag = frame_is_sframe(cm) ? 1 : aom_rb_read_bit(rb);
  ------------------
  |  Branch (4787:32): [True: 0, False: 28.0k]
  ------------------
 4788|       |
 4789|  28.0k|    current_frame->order_hint = aom_rb_read_literal(
 4790|  28.0k|        rb, seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
 4791|       |
 4792|  28.0k|    if (seq_params->order_hint_info.enable_order_hint)
  ------------------
  |  Branch (4792:9): [True: 28.0k, False: 0]
  ------------------
 4793|  28.0k|      current_frame->frame_number = current_frame->order_hint;
 4794|       |
 4795|  28.0k|    if (!features->error_resilient_mode && !frame_is_intra_only(cm)) {
  ------------------
  |  Branch (4795:9): [True: 21.0k, False: 7.01k]
  |  Branch (4795:44): [True: 21.0k, False: 0]
  ------------------
 4796|  21.0k|      features->primary_ref_frame = aom_rb_read_literal(rb, PRIMARY_REF_BITS);
  ------------------
  |  |   65|  21.0k|#define PRIMARY_REF_BITS 3
  ------------------
 4797|  21.0k|    }
 4798|  28.0k|  }
 4799|       |
 4800|  28.0k|  if (seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (4800:7): [True: 0, False: 28.0k]
  ------------------
 4801|      0|    pbi->buffer_removal_time_present = aom_rb_read_bit(rb);
 4802|      0|    if (pbi->buffer_removal_time_present) {
  ------------------
  |  Branch (4802:9): [True: 0, False: 0]
  ------------------
 4803|      0|      for (int op_num = 0;
 4804|      0|           op_num < seq_params->operating_points_cnt_minus_1 + 1; op_num++) {
  ------------------
  |  Branch (4804:12): [True: 0, False: 0]
  ------------------
 4805|      0|        if (seq_params->op_params[op_num].decoder_model_param_present_flag) {
  ------------------
  |  Branch (4805:13): [True: 0, False: 0]
  ------------------
 4806|      0|          if (seq_params->operating_point_idc[op_num] == 0 ||
  ------------------
  |  Branch (4806:15): [True: 0, False: 0]
  ------------------
 4807|      0|              (((seq_params->operating_point_idc[op_num] >>
  ------------------
  |  Branch (4807:16): [True: 0, False: 0]
  ------------------
 4808|      0|                 cm->temporal_layer_id) &
 4809|      0|                0x1) &&
 4810|      0|               ((seq_params->operating_point_idc[op_num] >>
  ------------------
  |  Branch (4810:16): [True: 0, False: 0]
  ------------------
 4811|      0|                 (cm->spatial_layer_id + 8)) &
 4812|      0|                0x1))) {
 4813|      0|            cm->buffer_removal_times[op_num] = aom_rb_read_unsigned_literal(
 4814|      0|                rb, seq_params->decoder_model_info.buffer_removal_time_length);
 4815|      0|          } else {
 4816|      0|            cm->buffer_removal_times[op_num] = 0;
 4817|      0|          }
 4818|      0|        } else {
 4819|      0|          cm->buffer_removal_times[op_num] = 0;
 4820|      0|        }
 4821|      0|      }
 4822|      0|    }
 4823|      0|  }
 4824|  28.0k|  if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (4824:7): [True: 7.01k, False: 21.0k]
  ------------------
 4825|  7.01k|    if (!cm->show_frame) {  // unshown keyframe (forward keyframe)
  ------------------
  |  Branch (4825:9): [True: 0, False: 7.01k]
  ------------------
 4826|      0|      current_frame->refresh_frame_flags = aom_rb_read_literal(rb, REF_FRAMES);
 4827|  7.01k|    } else {  // shown keyframe
 4828|  7.01k|      current_frame->refresh_frame_flags = (1 << REF_FRAMES) - 1;
 4829|  7.01k|    }
 4830|       |
 4831|  56.1k|    for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (4831:21): [True: 49.1k, False: 7.01k]
  ------------------
 4832|  49.1k|      cm->remapped_ref_idx[i] = INVALID_IDX;
  ------------------
  |  |   15|  49.1k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 4833|  49.1k|    }
 4834|  7.01k|    if (pbi->need_resync) {
  ------------------
  |  Branch (4834:9): [True: 7.01k, False: 0]
  ------------------
 4835|  7.01k|      reset_ref_frame_map(cm);
 4836|  7.01k|      pbi->need_resync = 0;
 4837|  7.01k|    }
 4838|  21.0k|  } else {
 4839|  21.0k|    if (current_frame->frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (4839:9): [True: 0, False: 21.0k]
  ------------------
 4840|      0|      current_frame->refresh_frame_flags = aom_rb_read_literal(rb, REF_FRAMES);
 4841|      0|      if (current_frame->refresh_frame_flags == 0xFF) {
  ------------------
  |  Branch (4841:11): [True: 0, False: 0]
  ------------------
 4842|      0|        aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
 4843|      0|                           "Intra only frames cannot have refresh flags 0xFF");
 4844|      0|      }
 4845|      0|      if (pbi->need_resync) {
  ------------------
  |  Branch (4845:11): [True: 0, False: 0]
  ------------------
 4846|      0|        reset_ref_frame_map(cm);
 4847|      0|        pbi->need_resync = 0;
 4848|      0|      }
 4849|  21.0k|    } else if (pbi->need_resync != 1) { /* Skip if need resync */
  ------------------
  |  Branch (4849:16): [True: 21.0k, False: 0]
  ------------------
 4850|  21.0k|      current_frame->refresh_frame_flags =
 4851|  21.0k|          frame_is_sframe(cm) ? 0xFF : aom_rb_read_literal(rb, REF_FRAMES);
  ------------------
  |  Branch (4851:11): [True: 0, False: 21.0k]
  ------------------
 4852|  21.0k|    }
 4853|  21.0k|  }
 4854|       |
 4855|  28.0k|  if (!frame_is_intra_only(cm) || current_frame->refresh_frame_flags != 0xFF) {
  ------------------
  |  Branch (4855:7): [True: 21.0k, False: 7.01k]
  |  Branch (4855:35): [True: 0, False: 7.01k]
  ------------------
 4856|       |    // Read all ref frame order hints if error_resilient_mode == 1
 4857|  21.0k|    if (features->error_resilient_mode &&
  ------------------
  |  Branch (4857:9): [True: 0, False: 21.0k]
  ------------------
 4858|      0|        seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (4858:9): [True: 0, False: 0]
  ------------------
 4859|      0|      for (int ref_idx = 0; ref_idx < REF_FRAMES; ref_idx++) {
  ------------------
  |  Branch (4859:29): [True: 0, False: 0]
  ------------------
 4860|       |        // Read order hint from bit stream
 4861|      0|        unsigned int order_hint = aom_rb_read_literal(
 4862|      0|            rb, seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
 4863|       |        // Get buffer
 4864|      0|        RefCntBuffer *buf = cm->ref_frame_map[ref_idx];
 4865|      0|        if (buf == NULL || order_hint != buf->order_hint) {
  ------------------
  |  Branch (4865:13): [True: 0, False: 0]
  |  Branch (4865:28): [True: 0, False: 0]
  ------------------
 4866|      0|          if (buf != NULL) {
  ------------------
  |  Branch (4866:15): [True: 0, False: 0]
  ------------------
 4867|      0|            lock_buffer_pool(pool);
 4868|      0|            decrease_ref_count(buf, pool);
 4869|      0|            unlock_buffer_pool(pool);
 4870|      0|            cm->ref_frame_map[ref_idx] = NULL;
 4871|      0|          }
 4872|       |          // If no corresponding buffer exists, allocate a new buffer with all
 4873|       |          // pixels set to neutral grey.
 4874|      0|          int buf_idx = get_free_fb(cm);
 4875|      0|          if (buf_idx == INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (4875:15): [True: 0, False: 0]
  ------------------
 4876|      0|            aom_internal_error(&pbi->error, AOM_CODEC_MEM_ERROR,
 4877|      0|                               "Unable to find free frame buffer");
 4878|      0|          }
 4879|      0|          buf = &frame_bufs[buf_idx];
 4880|      0|          lock_buffer_pool(pool);
 4881|       |#if CONFIG_SIZE_LIMIT
 4882|       |          if (seq_params->max_frame_width > DECODE_WIDTH_LIMIT ||
 4883|       |              seq_params->max_frame_height > DECODE_HEIGHT_LIMIT) {
 4884|       |            decrease_ref_count(buf, pool);
 4885|       |            unlock_buffer_pool(pool);
 4886|       |            aom_internal_error(
 4887|       |                cm->error, AOM_CODEC_CORRUPT_FRAME,
 4888|       |                "Dimensions of %dx%d beyond allowed size of %dx%d.",
 4889|       |                seq_params->max_frame_width, seq_params->max_frame_height,
 4890|       |                DECODE_WIDTH_LIMIT, DECODE_HEIGHT_LIMIT);
 4891|       |          }
 4892|       |#endif
 4893|      0|          if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (4893:15): [True: 0, False: 0]
  ------------------
 4894|      0|                  &buf->buf, seq_params->max_frame_width,
 4895|      0|                  seq_params->max_frame_height, seq_params->subsampling_x,
 4896|      0|                  seq_params->subsampling_y, seq_params->use_highbitdepth,
 4897|      0|                  AOM_BORDER_IN_PIXELS, features->byte_alignment,
  ------------------
  |  |   32|      0|#define AOM_BORDER_IN_PIXELS 288
  ------------------
 4898|      0|                  &buf->raw_frame_buffer, pool->get_fb_cb, pool->cb_priv, false,
 4899|      0|                  0)) {
 4900|      0|            decrease_ref_count(buf, pool);
 4901|      0|            unlock_buffer_pool(pool);
 4902|      0|            aom_internal_error(&pbi->error, AOM_CODEC_MEM_ERROR,
 4903|      0|                               "Failed to allocate frame buffer");
 4904|      0|          }
 4905|      0|          unlock_buffer_pool(pool);
 4906|       |          // According to the specification, valid bitstreams are required to
 4907|       |          // never use missing reference frames so the filling process for
 4908|       |          // missing frames is not normatively defined and RefValid for missing
 4909|       |          // frames is set to 0.
 4910|       |
 4911|       |          // To make libaom more robust when the bitstream has been corrupted
 4912|       |          // by the loss of some frames of data, this code adds a neutral grey
 4913|       |          // buffer in place of missing frames, i.e.
 4914|       |          //
 4915|      0|          set_planes_to_neutral_grey(seq_params, &buf->buf, 0);
 4916|       |          //
 4917|       |          // and allows the frames to be used for referencing, i.e.
 4918|       |          //
 4919|      0|          pbi->valid_for_referencing[ref_idx] = 1;
 4920|       |          //
 4921|       |          // Please note such behavior is not normative and other decoders may
 4922|       |          // use a different approach.
 4923|      0|          cm->ref_frame_map[ref_idx] = buf;
 4924|      0|          buf->order_hint = order_hint;
 4925|      0|        }
 4926|      0|      }
 4927|      0|    }
 4928|  21.0k|  }
 4929|       |
 4930|  28.0k|  if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (4930:7): [True: 7.01k, False: 21.0k]
  ------------------
 4931|  7.01k|    setup_frame_size(cm, frame_size_override_flag, pbi->frame_size_limit, rb);
 4932|       |
 4933|  7.01k|    if (features->allow_screen_content_tools && !av1_superres_scaled(cm))
  ------------------
  |  Branch (4933:9): [True: 755, False: 6.26k]
  |  Branch (4933:49): [True: 755, False: 0]
  ------------------
 4934|    755|      features->allow_intrabc = aom_rb_read_bit(rb);
 4935|  7.01k|    features->allow_ref_frame_mvs = 0;
 4936|  7.01k|    cm->prev_frame = NULL;
 4937|  21.0k|  } else {
 4938|  21.0k|    features->allow_ref_frame_mvs = 0;
 4939|       |
 4940|  21.0k|    if (current_frame->frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (4940:9): [True: 0, False: 21.0k]
  ------------------
 4941|      0|      cm->cur_frame->film_grain_params_present =
 4942|      0|          seq_params->film_grain_params_present;
 4943|      0|      setup_frame_size(cm, frame_size_override_flag, pbi->frame_size_limit, rb);
 4944|      0|      if (features->allow_screen_content_tools && !av1_superres_scaled(cm))
  ------------------
  |  Branch (4944:11): [True: 0, False: 0]
  |  Branch (4944:51): [True: 0, False: 0]
  ------------------
 4945|      0|        features->allow_intrabc = aom_rb_read_bit(rb);
 4946|       |
 4947|  21.0k|    } else if (pbi->need_resync != 1) { /* Skip if need resync */
  ------------------
  |  Branch (4947:16): [True: 21.0k, False: 0]
  ------------------
 4948|  21.0k|      int frame_refs_short_signaling = 0;
 4949|       |      // Frame refs short signaling is off when error resilient mode is on.
 4950|  21.0k|      if (seq_params->order_hint_info.enable_order_hint)
  ------------------
  |  Branch (4950:11): [True: 21.0k, False: 0]
  ------------------
 4951|  21.0k|        frame_refs_short_signaling = aom_rb_read_bit(rb);
 4952|       |
 4953|  21.0k|      if (frame_refs_short_signaling) {
  ------------------
  |  Branch (4953:11): [True: 0, False: 21.0k]
  ------------------
 4954|       |        // == LAST_FRAME ==
 4955|      0|        const int lst_ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
  ------------------
  |  |  554|      0|#define REF_FRAMES_LOG2 3
  ------------------
 4956|      0|        const RefCntBuffer *const lst_buf = cm->ref_frame_map[lst_ref];
 4957|       |
 4958|       |        // == GOLDEN_FRAME ==
 4959|      0|        const int gld_ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
  ------------------
  |  |  554|      0|#define REF_FRAMES_LOG2 3
  ------------------
 4960|      0|        const RefCntBuffer *const gld_buf = cm->ref_frame_map[gld_ref];
 4961|       |
 4962|       |        // Most of the time, streams start with a keyframe. In that case,
 4963|       |        // ref_frame_map will have been filled in at that point and will not
 4964|       |        // contain any NULLs. However, streams are explicitly allowed to start
 4965|       |        // with an intra-only frame, so long as they don't then signal a
 4966|       |        // reference to a slot that hasn't been set yet. That's what we are
 4967|       |        // checking here.
 4968|      0|        if (lst_buf == NULL)
  ------------------
  |  Branch (4968:13): [True: 0, False: 0]
  ------------------
 4969|      0|          aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4970|      0|                             "Inter frame requests nonexistent reference");
 4971|      0|        if (gld_buf == NULL)
  ------------------
  |  Branch (4971:13): [True: 0, False: 0]
  ------------------
 4972|      0|          aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4973|      0|                             "Inter frame requests nonexistent reference");
 4974|       |
 4975|      0|        av1_set_frame_refs(cm, cm->remapped_ref_idx, lst_ref, gld_ref);
 4976|      0|      }
 4977|       |
 4978|   168k|      for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (4978:23): [True: 147k, False: 21.0k]
  ------------------
 4979|   147k|        int ref = 0;
 4980|   147k|        if (!frame_refs_short_signaling) {
  ------------------
  |  Branch (4980:13): [True: 147k, False: 0]
  ------------------
 4981|   147k|          ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
  ------------------
  |  |  554|   147k|#define REF_FRAMES_LOG2 3
  ------------------
 4982|       |
 4983|       |          // Most of the time, streams start with a keyframe. In that case,
 4984|       |          // ref_frame_map will have been filled in at that point and will not
 4985|       |          // contain any NULLs. However, streams are explicitly allowed to start
 4986|       |          // with an intra-only frame, so long as they don't then signal a
 4987|       |          // reference to a slot that hasn't been set yet. That's what we are
 4988|       |          // checking here.
 4989|   147k|          if (cm->ref_frame_map[ref] == NULL)
  ------------------
  |  Branch (4989:15): [True: 0, False: 147k]
  ------------------
 4990|      0|            aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4991|      0|                               "Inter frame requests nonexistent reference");
 4992|   147k|          cm->remapped_ref_idx[i] = ref;
 4993|   147k|        } else {
 4994|      0|          ref = cm->remapped_ref_idx[i];
 4995|      0|        }
 4996|       |        // Check valid for referencing
 4997|   147k|        if (pbi->valid_for_referencing[ref] == 0)
  ------------------
  |  Branch (4997:13): [True: 0, False: 147k]
  ------------------
 4998|      0|          aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 4999|      0|                             "Reference frame not valid for referencing");
 5000|       |
 5001|   147k|        cm->ref_frame_sign_bias[LAST_FRAME + i] = 0;
 5002|       |
 5003|   147k|        if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (5003:13): [True: 0, False: 147k]
  ------------------
 5004|      0|          int frame_id_length = seq_params->frame_id_length;
 5005|      0|          int diff_len = seq_params->delta_frame_id_length;
 5006|      0|          int delta_frame_id_minus_1 = aom_rb_read_literal(rb, diff_len);
 5007|      0|          int ref_frame_id =
 5008|      0|              ((cm->current_frame_id - (delta_frame_id_minus_1 + 1) +
 5009|      0|                (1 << frame_id_length)) %
 5010|      0|               (1 << frame_id_length));
 5011|       |          // Compare values derived from delta_frame_id_minus_1 and
 5012|       |          // refresh_frame_flags.
 5013|      0|          if (ref_frame_id != cm->ref_frame_id[ref])
  ------------------
  |  Branch (5013:15): [True: 0, False: 0]
  ------------------
 5014|      0|            aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5015|      0|                               "Reference buffer frame ID mismatch");
 5016|      0|        }
 5017|   147k|      }
 5018|       |
 5019|  21.0k|      if (!features->error_resilient_mode && frame_size_override_flag) {
  ------------------
  |  Branch (5019:11): [True: 21.0k, False: 0]
  |  Branch (5019:46): [True: 14.0k, False: 7.01k]
  ------------------
 5020|  14.0k|        setup_frame_size_with_refs(cm, pbi->frame_size_limit, rb);
 5021|  14.0k|      } else {
 5022|  7.01k|        setup_frame_size(cm, frame_size_override_flag, pbi->frame_size_limit,
 5023|  7.01k|                         rb);
 5024|  7.01k|      }
 5025|       |
 5026|  21.0k|      if (features->cur_frame_force_integer_mv) {
  ------------------
  |  Branch (5026:11): [True: 0, False: 21.0k]
  ------------------
 5027|      0|        features->allow_high_precision_mv = 0;
 5028|  21.0k|      } else {
 5029|  21.0k|        features->allow_high_precision_mv = aom_rb_read_bit(rb);
 5030|  21.0k|      }
 5031|  21.0k|      features->interp_filter = read_frame_interp_filter(rb);
 5032|  21.0k|      features->switchable_motion_mode = aom_rb_read_bit(rb);
 5033|  21.0k|    }
 5034|       |
 5035|  21.0k|    cm->prev_frame = get_primary_ref_frame_buf(cm);
 5036|  21.0k|    if (features->primary_ref_frame != PRIMARY_REF_NONE &&
  ------------------
  |  |   66|  42.1k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (5036:9): [True: 11.8k, False: 9.25k]
  ------------------
 5037|  11.8k|        get_primary_ref_frame_buf(cm) == NULL) {
  ------------------
  |  Branch (5037:9): [True: 0, False: 11.8k]
  ------------------
 5038|      0|      aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5039|      0|                         "Reference frame containing this frame's initial "
 5040|      0|                         "frame context is unavailable.");
 5041|      0|    }
 5042|       |
 5043|  21.0k|    if (!(current_frame->frame_type == INTRA_ONLY_FRAME) &&
  ------------------
  |  Branch (5043:9): [True: 21.0k, False: 0]
  ------------------
 5044|  21.0k|        pbi->need_resync != 1) {
  ------------------
  |  Branch (5044:9): [True: 21.0k, False: 0]
  ------------------
 5045|  21.0k|      if (frame_might_allow_ref_frame_mvs(cm))
  ------------------
  |  Branch (5045:11): [True: 21.0k, False: 0]
  ------------------
 5046|  21.0k|        features->allow_ref_frame_mvs = aom_rb_read_bit(rb);
 5047|      0|      else
 5048|      0|        features->allow_ref_frame_mvs = 0;
 5049|       |
 5050|   168k|      for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (5050:32): [True: 147k, False: 21.0k]
  ------------------
 5051|   147k|        const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);
 5052|   147k|        struct scale_factors *const ref_scale_factors =
 5053|   147k|            get_ref_scale_factors(cm, i);
 5054|   147k|        av1_setup_scale_factors_for_frame(
 5055|   147k|            ref_scale_factors, ref_buf->buf.y_crop_width,
 5056|   147k|            ref_buf->buf.y_crop_height, cm->width, cm->height);
 5057|   147k|        if ((!av1_is_valid_scale(ref_scale_factors)))
  ------------------
  |  Branch (5057:13): [True: 0, False: 147k]
  ------------------
 5058|      0|          aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
 5059|      0|                             "Reference frame has invalid dimensions");
 5060|   147k|      }
 5061|  21.0k|    }
 5062|  21.0k|  }
 5063|       |
 5064|  28.0k|  av1_setup_frame_buf_refs(cm);
 5065|       |
 5066|  28.0k|  av1_setup_frame_sign_bias(cm);
 5067|       |
 5068|  28.0k|  cm->cur_frame->frame_type = current_frame->frame_type;
 5069|       |
 5070|  28.0k|  update_ref_frame_id(pbi);
 5071|       |
 5072|  28.0k|  const int might_bwd_adapt = !(seq_params->reduced_still_picture_hdr) &&
  ------------------
  |  Branch (5072:31): [True: 28.0k, False: 0]
  ------------------
 5073|  28.0k|                              !(features->disable_cdf_update);
  ------------------
  |  Branch (5073:31): [True: 28.0k, False: 0]
  ------------------
 5074|  28.0k|  if (might_bwd_adapt) {
  ------------------
  |  Branch (5074:7): [True: 28.0k, False: 0]
  ------------------
 5075|  28.0k|    features->refresh_frame_context = aom_rb_read_bit(rb)
  ------------------
  |  Branch (5075:39): [True: 0, False: 28.0k]
  ------------------
 5076|  28.0k|                                          ? REFRESH_FRAME_CONTEXT_DISABLED
 5077|  28.0k|                                          : REFRESH_FRAME_CONTEXT_BACKWARD;
 5078|  28.0k|  } else {
 5079|      0|    features->refresh_frame_context = REFRESH_FRAME_CONTEXT_DISABLED;
 5080|      0|  }
 5081|       |
 5082|  28.0k|  cm->cur_frame->buf.bit_depth = seq_params->bit_depth;
 5083|  28.0k|  cm->cur_frame->buf.color_primaries = seq_params->color_primaries;
 5084|  28.0k|  cm->cur_frame->buf.transfer_characteristics =
 5085|  28.0k|      seq_params->transfer_characteristics;
 5086|  28.0k|  cm->cur_frame->buf.matrix_coefficients = seq_params->matrix_coefficients;
 5087|  28.0k|  cm->cur_frame->buf.monochrome = seq_params->monochrome;
 5088|  28.0k|  cm->cur_frame->buf.chroma_sample_position =
 5089|  28.0k|      seq_params->chroma_sample_position;
 5090|  28.0k|  cm->cur_frame->buf.color_range = seq_params->color_range;
 5091|  28.0k|  cm->cur_frame->buf.render_width = cm->render_width;
 5092|  28.0k|  cm->cur_frame->buf.render_height = cm->render_height;
 5093|       |
 5094|  28.0k|  if (pbi->need_resync) {
  ------------------
  |  Branch (5094:7): [True: 0, False: 28.0k]
  ------------------
 5095|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5096|      0|                       "Keyframe / intra-only frame required to reset decoder"
 5097|      0|                       " state");
 5098|      0|  }
 5099|       |
 5100|  28.0k|  if (features->allow_intrabc) {
  ------------------
  |  Branch (5100:7): [True: 0, False: 28.0k]
  ------------------
 5101|       |    // Set parameters corresponding to no filtering.
 5102|      0|    struct loopfilter *lf = &cm->lf;
 5103|      0|    lf->filter_level[0] = 0;
 5104|      0|    lf->filter_level[1] = 0;
 5105|      0|    cm->cdef_info.cdef_bits = 0;
 5106|      0|    cm->cdef_info.cdef_strengths[0] = 0;
 5107|      0|    cm->cdef_info.nb_cdef_strengths = 1;
 5108|      0|    cm->cdef_info.cdef_uv_strengths[0] = 0;
 5109|      0|    cm->rst_info[0].frame_restoration_type = RESTORE_NONE;
 5110|      0|    cm->rst_info[1].frame_restoration_type = RESTORE_NONE;
 5111|      0|    cm->rst_info[2].frame_restoration_type = RESTORE_NONE;
 5112|      0|  }
 5113|       |
 5114|  28.0k|  read_tile_info(pbi, rb);
 5115|  28.0k|  if (!av1_is_min_tile_width_satisfied(cm)) {
  ------------------
  |  Branch (5115:7): [True: 0, False: 28.0k]
  ------------------
 5116|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5117|      0|                       "Minimum tile width requirement not satisfied");
 5118|      0|  }
 5119|       |
 5120|  28.0k|  CommonQuantParams *const quant_params = &cm->quant_params;
 5121|  28.0k|  setup_quantization(quant_params, av1_num_planes(cm),
 5122|  28.0k|                     cm->seq_params->separate_uv_delta_q, rb);
 5123|  28.0k|  xd->bd = (int)seq_params->bit_depth;
 5124|       |
 5125|  28.0k|  CommonContexts *const above_contexts = &cm->above_contexts;
 5126|  28.0k|  if (above_contexts->num_planes < av1_num_planes(cm) ||
  ------------------
  |  Branch (5126:7): [True: 7.01k, False: 21.0k]
  ------------------
 5127|  21.0k|      above_contexts->num_mi_cols < cm->mi_params.mi_cols ||
  ------------------
  |  Branch (5127:7): [True: 926, False: 20.1k]
  ------------------
 5128|  20.1k|      above_contexts->num_tile_rows < cm->tiles.rows) {
  ------------------
  |  Branch (5128:7): [True: 1.46k, False: 18.6k]
  ------------------
 5129|  9.41k|    av1_free_above_context_buffers(above_contexts);
 5130|  9.41k|    if (av1_alloc_above_context_buffers(above_contexts, cm->tiles.rows,
  ------------------
  |  Branch (5130:9): [True: 0, False: 9.41k]
  ------------------
 5131|  9.41k|                                        cm->mi_params.mi_cols,
 5132|  9.41k|                                        av1_num_planes(cm))) {
 5133|      0|      aom_internal_error(&pbi->error, AOM_CODEC_MEM_ERROR,
 5134|      0|                         "Failed to allocate context buffers");
 5135|      0|    }
 5136|  9.41k|  }
 5137|       |
 5138|  28.0k|  if (features->primary_ref_frame == PRIMARY_REF_NONE) {
  ------------------
  |  |   66|  28.0k|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (5138:7): [True: 16.2k, False: 11.8k]
  ------------------
 5139|  16.2k|    av1_setup_past_independence(cm);
 5140|  16.2k|  }
 5141|       |
 5142|  28.0k|  setup_segmentation(cm, rb);
 5143|       |
 5144|  28.0k|  cm->delta_q_info.delta_q_res = 1;
 5145|  28.0k|  cm->delta_q_info.delta_lf_res = 1;
 5146|  28.0k|  cm->delta_q_info.delta_lf_present_flag = 0;
 5147|  28.0k|  cm->delta_q_info.delta_lf_multi = 0;
 5148|  28.0k|  cm->delta_q_info.delta_q_present_flag =
 5149|  28.0k|      quant_params->base_qindex > 0 ? aom_rb_read_bit(rb) : 0;
  ------------------
  |  Branch (5149:7): [True: 26.8k, False: 1.26k]
  ------------------
 5150|  28.0k|  if (cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (5150:7): [True: 11.9k, False: 16.0k]
  ------------------
 5151|  11.9k|    xd->current_base_qindex = quant_params->base_qindex;
 5152|  11.9k|    cm->delta_q_info.delta_q_res = 1 << aom_rb_read_literal(rb, 2);
 5153|  11.9k|    if (!features->allow_intrabc)
  ------------------
  |  Branch (5153:9): [True: 11.9k, False: 0]
  ------------------
 5154|  11.9k|      cm->delta_q_info.delta_lf_present_flag = aom_rb_read_bit(rb);
 5155|  11.9k|    if (cm->delta_q_info.delta_lf_present_flag) {
  ------------------
  |  Branch (5155:9): [True: 0, False: 11.9k]
  ------------------
 5156|      0|      cm->delta_q_info.delta_lf_res = 1 << aom_rb_read_literal(rb, 2);
 5157|      0|      cm->delta_q_info.delta_lf_multi = aom_rb_read_bit(rb);
 5158|      0|      av1_reset_loop_filter_delta(xd, av1_num_planes(cm));
 5159|      0|    }
 5160|  11.9k|  }
 5161|       |
 5162|  28.0k|  xd->cur_frame_force_integer_mv = features->cur_frame_force_integer_mv;
 5163|       |
 5164|   252k|  for (int i = 0; i < MAX_SEGMENTS; ++i) {
  ------------------
  |  |   23|   252k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (5164:19): [True: 224k, False: 28.0k]
  ------------------
 5165|   224k|    const int qindex = av1_get_qindex(&cm->seg, i, quant_params->base_qindex);
 5166|   224k|    xd->lossless[i] =
 5167|   224k|        qindex == 0 && quant_params->y_dc_delta_q == 0 &&
  ------------------
  |  Branch (5167:9): [True: 10.1k, False: 214k]
  |  Branch (5167:24): [True: 10.1k, False: 0]
  ------------------
 5168|  10.1k|        quant_params->u_dc_delta_q == 0 && quant_params->u_ac_delta_q == 0 &&
  ------------------
  |  Branch (5168:9): [True: 10.1k, False: 0]
  |  Branch (5168:44): [True: 10.1k, False: 0]
  ------------------
 5169|  10.1k|        quant_params->v_dc_delta_q == 0 && quant_params->v_ac_delta_q == 0;
  ------------------
  |  Branch (5169:9): [True: 10.1k, False: 0]
  |  Branch (5169:44): [True: 10.1k, False: 0]
  ------------------
 5170|   224k|    xd->qindex[i] = qindex;
 5171|   224k|  }
 5172|  28.0k|  features->coded_lossless = is_coded_lossless(cm, xd);
 5173|  28.0k|  features->all_lossless = features->coded_lossless && !av1_superres_scaled(cm);
  ------------------
  |  Branch (5173:28): [True: 1.26k, False: 26.8k]
  |  Branch (5173:56): [True: 1.26k, False: 0]
  ------------------
 5174|  28.0k|  setup_segmentation_dequant(cm, xd);
 5175|  28.0k|  if (features->coded_lossless) {
  ------------------
  |  Branch (5175:7): [True: 1.26k, False: 26.8k]
  ------------------
 5176|  1.26k|    cm->lf.filter_level[0] = 0;
 5177|  1.26k|    cm->lf.filter_level[1] = 0;
 5178|  1.26k|  }
 5179|  28.0k|  if (features->coded_lossless || !seq_params->enable_cdef) {
  ------------------
  |  Branch (5179:7): [True: 1.26k, False: 26.8k]
  |  Branch (5179:35): [True: 0, False: 26.8k]
  ------------------
 5180|  1.26k|    cm->cdef_info.cdef_bits = 0;
 5181|  1.26k|    cm->cdef_info.cdef_strengths[0] = 0;
 5182|  1.26k|    cm->cdef_info.cdef_uv_strengths[0] = 0;
 5183|  1.26k|  }
 5184|  28.0k|  if (features->all_lossless || !seq_params->enable_restoration) {
  ------------------
  |  Branch (5184:7): [True: 1.26k, False: 26.8k]
  |  Branch (5184:33): [True: 23.0k, False: 3.76k]
  ------------------
 5185|  24.3k|    cm->rst_info[0].frame_restoration_type = RESTORE_NONE;
 5186|  24.3k|    cm->rst_info[1].frame_restoration_type = RESTORE_NONE;
 5187|  24.3k|    cm->rst_info[2].frame_restoration_type = RESTORE_NONE;
 5188|  24.3k|  }
 5189|  28.0k|  setup_loopfilter(cm, rb);
 5190|       |
 5191|  28.0k|  if (!features->coded_lossless && seq_params->enable_cdef) {
  ------------------
  |  Branch (5191:7): [True: 26.8k, False: 1.26k]
  |  Branch (5191:36): [True: 26.8k, False: 0]
  ------------------
 5192|  26.8k|    setup_cdef(cm, rb);
 5193|  26.8k|  }
 5194|  28.0k|  if (!features->all_lossless && seq_params->enable_restoration) {
  ------------------
  |  Branch (5194:7): [True: 26.8k, False: 1.26k]
  |  Branch (5194:34): [True: 3.76k, False: 23.0k]
  ------------------
 5195|  3.76k|    decode_restoration_mode(cm, rb);
 5196|  3.76k|  }
 5197|       |
 5198|  28.0k|  features->tx_mode = read_tx_mode(rb, features->coded_lossless);
 5199|  28.0k|  current_frame->reference_mode = read_frame_reference_mode(cm, rb);
 5200|       |
 5201|  28.0k|  av1_setup_skip_mode_allowed(cm);
 5202|  28.0k|  current_frame->skip_mode_info.skip_mode_flag =
 5203|  28.0k|      current_frame->skip_mode_info.skip_mode_allowed ? aom_rb_read_bit(rb) : 0;
  ------------------
  |  Branch (5203:7): [True: 0, False: 28.0k]
  ------------------
 5204|       |
 5205|  28.0k|  if (frame_might_allow_warped_motion(cm))
  ------------------
  |  Branch (5205:7): [True: 21.0k, False: 7.01k]
  ------------------
 5206|  21.0k|    features->allow_warped_motion = aom_rb_read_bit(rb);
 5207|  7.01k|  else
 5208|  7.01k|    features->allow_warped_motion = 0;
 5209|       |
 5210|  28.0k|  features->reduced_tx_set_used = aom_rb_read_bit(rb);
 5211|       |
 5212|  28.0k|  if (features->allow_ref_frame_mvs && !frame_might_allow_ref_frame_mvs(cm)) {
  ------------------
  |  Branch (5212:7): [True: 21.0k, False: 7.01k]
  |  Branch (5212:40): [True: 0, False: 21.0k]
  ------------------
 5213|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 5214|      0|                       "Frame wrongly requests reference frame MVs");
 5215|      0|  }
 5216|       |
 5217|  28.0k|  if (!frame_is_intra_only(cm)) read_global_motion(cm, rb);
  ------------------
  |  Branch (5217:7): [True: 21.0k, False: 7.01k]
  ------------------
 5218|       |
 5219|  28.0k|  cm->cur_frame->film_grain_params_present =
 5220|  28.0k|      seq_params->film_grain_params_present;
 5221|  28.0k|  read_film_grain(cm, rb);
 5222|       |
 5223|  28.0k|#if EXT_TILE_DEBUG
 5224|  28.0k|  if (pbi->ext_tile_debug && cm->tiles.large_scale) {
  ------------------
  |  Branch (5224:7): [True: 0, False: 28.0k]
  |  Branch (5224:30): [True: 0, False: 0]
  ------------------
 5225|      0|    read_ext_tile_info(pbi, rb);
 5226|      0|    av1_set_single_tile_decoding_mode(cm);
 5227|      0|  }
 5228|  28.0k|#endif  // EXT_TILE_DEBUG
 5229|  28.0k|  return 0;
 5230|  28.0k|}
decodeframe.c:reset_ref_frame_map:
 4498|  7.01k|static inline void reset_ref_frame_map(AV1_COMMON *const cm) {
 4499|  7.01k|  BufferPool *const pool = cm->buffer_pool;
 4500|       |
 4501|  63.1k|  for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (4501:19): [True: 56.1k, False: 7.01k]
  ------------------
 4502|  56.1k|    decrease_ref_count(cm->ref_frame_map[i], pool);
 4503|       |    cm->ref_frame_map[i] = NULL;
 4504|  56.1k|  }
 4505|  7.01k|}
decodeframe.c:setup_frame_size:
 2028|  14.0k|                                    struct aom_read_bit_buffer *rb) {
 2029|  14.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 2030|  14.0k|  int width, height;
 2031|       |
 2032|  14.0k|  if (frame_size_override_flag) {
  ------------------
  |  Branch (2032:7): [True: 7.01k, False: 7.01k]
  ------------------
 2033|  7.01k|    int num_bits_width = seq_params->num_bits_width;
 2034|  7.01k|    int num_bits_height = seq_params->num_bits_height;
 2035|  7.01k|    read_frame_size(rb, num_bits_width, num_bits_height, &width, &height);
 2036|  7.01k|    if (width > seq_params->max_frame_width ||
  ------------------
  |  Branch (2036:9): [True: 0, False: 7.01k]
  ------------------
 2037|  7.01k|        height > seq_params->max_frame_height) {
  ------------------
  |  Branch (2037:9): [True: 0, False: 7.01k]
  ------------------
 2038|      0|      aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 2039|      0|                         "Frame dimensions are larger than the maximum values");
 2040|      0|    }
 2041|  7.01k|  } else {
 2042|  7.01k|    width = seq_params->max_frame_width;
 2043|  7.01k|    height = seq_params->max_frame_height;
 2044|  7.01k|  }
 2045|       |
 2046|  14.0k|  setup_superres(cm, rb, &width, &height);
 2047|  14.0k|  resize_context_buffers(cm, width, height, frame_size_limit);
 2048|  14.0k|  setup_render_size(cm, rb);
 2049|  14.0k|  setup_buffer_pool(cm);
 2050|  14.0k|}
decodeframe.c:read_frame_size:
 1915|  34.3k|                            int num_bits_height, int *width, int *height) {
 1916|  34.3k|  *width = aom_rb_read_literal(rb, num_bits_width) + 1;
 1917|  34.3k|  *height = aom_rb_read_literal(rb, num_bits_height) + 1;
 1918|  34.3k|}
decodeframe.c:setup_superres:
 1931|  28.0k|                                  int *height) {
 1932|  28.0k|  cm->superres_upscaled_width = *width;
 1933|  28.0k|  cm->superres_upscaled_height = *height;
 1934|       |
 1935|  28.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 1936|  28.0k|  if (!seq_params->enable_superres) return;
  ------------------
  |  Branch (1936:7): [True: 28.0k, False: 0]
  ------------------
 1937|       |
 1938|      0|  if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (1938:7): [True: 0, False: 0]
  ------------------
 1939|      0|    cm->superres_scale_denominator =
 1940|      0|        (uint8_t)aom_rb_read_literal(rb, SUPERRES_SCALE_BITS);
  ------------------
  |  |  638|      0|#define SUPERRES_SCALE_BITS 3
  ------------------
 1941|      0|    cm->superres_scale_denominator += SUPERRES_SCALE_DENOMINATOR_MIN;
  ------------------
  |  |  639|      0|#define SUPERRES_SCALE_DENOMINATOR_MIN (SCALE_NUMERATOR + 1)
  |  |  ------------------
  |  |  |  |   22|      0|#define SCALE_NUMERATOR 8
  |  |  ------------------
  ------------------
 1942|       |    // Don't edit cm->width or cm->height directly, or the buffers won't get
 1943|       |    // resized correctly
 1944|      0|    av1_calculate_scaled_superres_size(width, height,
 1945|      0|                                       cm->superres_scale_denominator);
 1946|      0|  } else {
 1947|       |    // 1:1 scaling - ie. no scaling, scale not provided
 1948|      0|    cm->superres_scale_denominator = SCALE_NUMERATOR;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
 1949|      0|  }
 1950|      0|}
decodeframe.c:resize_context_buffers:
 1953|  28.0k|                                          unsigned int frame_size_limit) {
 1954|       |#if CONFIG_SIZE_LIMIT
 1955|       |  if (width > DECODE_WIDTH_LIMIT || height > DECODE_HEIGHT_LIMIT)
 1956|       |    aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 1957|       |                       "Dimensions of %dx%d beyond allowed size of %dx%d.",
 1958|       |                       width, height, DECODE_WIDTH_LIMIT, DECODE_HEIGHT_LIMIT);
 1959|       |#endif
 1960|  28.0k|  if (frame_size_limit && (uint64_t)width * height > frame_size_limit) {
  ------------------
  |  Branch (1960:7): [True: 28.0k, False: 0]
  |  Branch (1960:27): [True: 0, False: 28.0k]
  ------------------
 1961|      0|    aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 1962|      0|                       "Dimensions of %dx%d beyond allowed size of %u.", width,
 1963|      0|                       height, frame_size_limit);
 1964|      0|  }
 1965|  28.0k|  if (cm->width != width || cm->height != height) {
  ------------------
  |  Branch (1965:7): [True: 21.1k, False: 6.89k]
  |  Branch (1965:29): [True: 3.01k, False: 3.87k]
  ------------------
 1966|  24.1k|    const int new_mi_rows = CEIL_POWER_OF_TWO(height, MI_SIZE_LOG2);
  ------------------
  |  |   62|  24.1k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1967|  24.1k|    const int new_mi_cols = CEIL_POWER_OF_TWO(width, MI_SIZE_LOG2);
  ------------------
  |  |   62|  24.1k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1968|       |
 1969|       |    // Allocations in av1_alloc_context_buffers() depend on individual
 1970|       |    // dimensions as well as the overall size.
 1971|  24.1k|    if (new_mi_cols > cm->mi_params.mi_cols ||
  ------------------
  |  Branch (1971:9): [True: 14.7k, False: 9.49k]
  ------------------
 1972|  18.2k|        new_mi_rows > cm->mi_params.mi_rows) {
  ------------------
  |  Branch (1972:9): [True: 3.53k, False: 5.95k]
  ------------------
 1973|  18.2k|      if (av1_alloc_context_buffers(cm, width, height, BLOCK_4X4)) {
  ------------------
  |  Branch (1973:11): [True: 0, False: 18.2k]
  ------------------
 1974|       |        // The cm->mi_* values have been cleared and any existing context
 1975|       |        // buffers have been freed. Clear cm->width and cm->height to be
 1976|       |        // consistent and to force a realloc next time.
 1977|      0|        cm->width = 0;
 1978|      0|        cm->height = 0;
 1979|      0|        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 1980|      0|                           "Failed to allocate context buffers");
 1981|      0|      }
 1982|  18.2k|    } else {
 1983|  5.95k|      cm->mi_params.set_mb_mi(&cm->mi_params, width, height, BLOCK_4X4);
 1984|  5.95k|    }
 1985|  24.1k|    av1_init_mi_buffers(&cm->mi_params);
 1986|  24.1k|    cm->width = width;
 1987|  24.1k|    cm->height = height;
 1988|  24.1k|  }
 1989|       |
 1990|  28.0k|  ensure_mv_buffer(cm->cur_frame, cm);
 1991|  28.0k|  cm->cur_frame->width = cm->width;
 1992|  28.0k|  cm->cur_frame->height = cm->height;
 1993|  28.0k|}
decodeframe.c:setup_render_size:
 1921|  24.1k|                                     struct aom_read_bit_buffer *rb) {
 1922|  24.1k|  cm->render_width = cm->superres_upscaled_width;
 1923|  24.1k|  cm->render_height = cm->superres_upscaled_height;
 1924|  24.1k|  if (aom_rb_read_bit(rb))
  ------------------
  |  Branch (1924:7): [True: 17.1k, False: 7.01k]
  ------------------
 1925|  17.1k|    read_frame_size(rb, 16, 16, &cm->render_width, &cm->render_height);
 1926|  24.1k|}
decodeframe.c:setup_buffer_pool:
 1995|  28.0k|static inline void setup_buffer_pool(AV1_COMMON *cm) {
 1996|  28.0k|  BufferPool *const pool = cm->buffer_pool;
 1997|  28.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 1998|       |
 1999|  28.0k|  lock_buffer_pool(pool);
 2000|  28.0k|  if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (2000:7): [True: 0, False: 28.0k]
  ------------------
 2001|  28.0k|          &cm->cur_frame->buf, cm->width, cm->height, seq_params->subsampling_x,
 2002|  28.0k|          seq_params->subsampling_y, seq_params->use_highbitdepth,
 2003|  28.0k|          AOM_DEC_BORDER_IN_PIXELS, cm->features.byte_alignment,
  ------------------
  |  |   35|  28.0k|#define AOM_DEC_BORDER_IN_PIXELS 64
  ------------------
 2004|  28.0k|          &cm->cur_frame->raw_frame_buffer, pool->get_fb_cb, pool->cb_priv,
 2005|  28.0k|          false, 0)) {
 2006|      0|    unlock_buffer_pool(pool);
 2007|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2008|      0|                       "Failed to allocate frame buffer");
 2009|      0|  }
 2010|  28.0k|  unlock_buffer_pool(pool);
 2011|       |
 2012|  28.0k|  cm->cur_frame->buf.bit_depth = (unsigned int)seq_params->bit_depth;
 2013|  28.0k|  cm->cur_frame->buf.color_primaries = seq_params->color_primaries;
 2014|  28.0k|  cm->cur_frame->buf.transfer_characteristics =
 2015|  28.0k|      seq_params->transfer_characteristics;
 2016|  28.0k|  cm->cur_frame->buf.matrix_coefficients = seq_params->matrix_coefficients;
 2017|  28.0k|  cm->cur_frame->buf.monochrome = seq_params->monochrome;
 2018|  28.0k|  cm->cur_frame->buf.chroma_sample_position =
 2019|  28.0k|      seq_params->chroma_sample_position;
 2020|  28.0k|  cm->cur_frame->buf.color_range = seq_params->color_range;
 2021|  28.0k|  cm->cur_frame->buf.render_width = cm->render_width;
 2022|  28.0k|  cm->cur_frame->buf.render_height = cm->render_height;
 2023|  28.0k|}
decodeframe.c:setup_frame_size_with_refs:
 2067|  14.0k|                                              struct aom_read_bit_buffer *rb) {
 2068|  14.0k|  int width, height;
 2069|  14.0k|  int found = 0;
 2070|  14.0k|  int has_valid_ref_frame = 0;
 2071|  85.1k|  for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (2071:28): [True: 74.9k, False: 10.1k]
  ------------------
 2072|  74.9k|    if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (2072:9): [True: 3.87k, False: 71.0k]
  ------------------
 2073|  3.87k|      const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);
 2074|       |      // This will never be NULL in a normal stream, as streams are required to
 2075|       |      // have a shown keyframe before any inter frames, which would refresh all
 2076|       |      // the reference buffers. However, it might be null if we're starting in
 2077|       |      // the middle of a stream, and static analysis will error if we don't do
 2078|       |      // a null check here.
 2079|  3.87k|      if (ref_buf == NULL) {
  ------------------
  |  Branch (2079:11): [True: 0, False: 3.87k]
  ------------------
 2080|      0|        aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 2081|      0|                           "Invalid condition: invalid reference buffer");
 2082|  3.87k|      } else {
 2083|  3.87k|        const YV12_BUFFER_CONFIG *const buf = &ref_buf->buf;
 2084|  3.87k|        width = buf->y_crop_width;
 2085|  3.87k|        height = buf->y_crop_height;
 2086|  3.87k|        cm->render_width = buf->render_width;
 2087|  3.87k|        cm->render_height = buf->render_height;
 2088|  3.87k|        setup_superres(cm, rb, &width, &height);
 2089|  3.87k|        resize_context_buffers(cm, width, height, frame_size_limit);
 2090|  3.87k|        found = 1;
 2091|  3.87k|        break;
 2092|  3.87k|      }
 2093|  3.87k|    }
 2094|  74.9k|  }
 2095|       |
 2096|  14.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 2097|  14.0k|  if (!found) {
  ------------------
  |  Branch (2097:7): [True: 10.1k, False: 3.87k]
  ------------------
 2098|  10.1k|    int num_bits_width = seq_params->num_bits_width;
 2099|  10.1k|    int num_bits_height = seq_params->num_bits_height;
 2100|       |
 2101|  10.1k|    read_frame_size(rb, num_bits_width, num_bits_height, &width, &height);
 2102|  10.1k|    setup_superres(cm, rb, &width, &height);
 2103|  10.1k|    resize_context_buffers(cm, width, height, frame_size_limit);
 2104|  10.1k|    setup_render_size(cm, rb);
 2105|  10.1k|  }
 2106|       |
 2107|  14.0k|  if (width <= 0 || height <= 0)
  ------------------
  |  Branch (2107:7): [True: 0, False: 14.0k]
  |  Branch (2107:21): [True: 0, False: 14.0k]
  ------------------
 2108|      0|    aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 2109|      0|                       "Invalid frame size");
 2110|       |
 2111|       |  // Check to make sure at least one of frames that this frame references
 2112|       |  // has valid dimensions.
 2113|   112k|  for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (2113:28): [True: 98.2k, False: 14.0k]
  ------------------
 2114|  98.2k|    const RefCntBuffer *const ref_frame = get_ref_frame_buf(cm, i);
 2115|  98.2k|    has_valid_ref_frame |=
 2116|  98.2k|        valid_ref_frame_size(ref_frame->buf.y_crop_width,
 2117|  98.2k|                             ref_frame->buf.y_crop_height, width, height);
 2118|  98.2k|  }
 2119|  14.0k|  if (!has_valid_ref_frame)
  ------------------
  |  Branch (2119:7): [True: 0, False: 14.0k]
  ------------------
 2120|      0|    aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 2121|      0|                       "Referenced frame has invalid size");
 2122|   112k|  for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (2122:28): [True: 98.2k, False: 14.0k]
  ------------------
 2123|  98.2k|    const RefCntBuffer *const ref_frame = get_ref_frame_buf(cm, i);
 2124|  98.2k|    if (!valid_ref_frame_img_fmt(
  ------------------
  |  Branch (2124:9): [True: 0, False: 98.2k]
  ------------------
 2125|  98.2k|            ref_frame->buf.bit_depth, ref_frame->buf.subsampling_x,
 2126|  98.2k|            ref_frame->buf.subsampling_y, seq_params->bit_depth,
 2127|  98.2k|            seq_params->subsampling_x, seq_params->subsampling_y))
 2128|      0|      aom_internal_error(cm->error, AOM_CODEC_CORRUPT_FRAME,
 2129|      0|                         "Referenced frame has incompatible color format");
 2130|  98.2k|  }
 2131|  14.0k|  setup_buffer_pool(cm);
 2132|  14.0k|}
decodeframe.c:valid_ref_frame_img_fmt:
 2060|  98.2k|                                          int this_xss, int this_yss) {
 2061|  98.2k|  return ref_bit_depth == this_bit_depth && ref_xss == this_xss &&
  ------------------
  |  Branch (2061:10): [True: 98.2k, False: 0]
  |  Branch (2061:45): [True: 98.2k, False: 0]
  ------------------
 2062|  98.2k|         ref_yss == this_yss;
  ------------------
  |  Branch (2062:10): [True: 98.2k, False: 0]
  ------------------
 2063|  98.2k|}
decodeframe.c:read_frame_interp_filter:
 1909|  21.0k|static InterpFilter read_frame_interp_filter(struct aom_read_bit_buffer *rb) {
 1910|  21.0k|  return aom_rb_read_bit(rb) ? SWITCHABLE
  ------------------
  |  Branch (1910:10): [True: 11.1k, False: 9.88k]
  ------------------
 1911|  21.0k|                             : aom_rb_read_literal(rb, LOG_SWITCHABLE_FILTERS);
  ------------------
  |  |   99|  9.88k|#define LOG_SWITCHABLE_FILTERS 2
  ------------------
 1912|  21.0k|}
decodeframe.c:update_ref_frame_id:
 4509|  28.0k|static inline void update_ref_frame_id(AV1Decoder *const pbi) {
 4510|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 4511|  28.0k|  int refresh_frame_flags = cm->current_frame.refresh_frame_flags;
 4512|   252k|  for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (4512:19): [True: 224k, False: 28.0k]
  ------------------
 4513|   224k|    if ((refresh_frame_flags >> i) & 1) {
  ------------------
  |  Branch (4513:9): [True: 77.1k, False: 147k]
  ------------------
 4514|  77.1k|      cm->ref_frame_id[i] = cm->current_frame_id;
 4515|  77.1k|      pbi->valid_for_referencing[i] = 1;
 4516|  77.1k|    }
 4517|   224k|  }
 4518|  28.0k|}
decodeframe.c:read_tile_info:
 2231|  28.0k|                                  struct aom_read_bit_buffer *const rb) {
 2232|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 2233|       |
 2234|  28.0k|  read_tile_info_max_tile(cm, rb);
 2235|       |
 2236|  28.0k|  pbi->context_update_tile_id = 0;
 2237|  28.0k|  if (cm->tiles.rows * cm->tiles.cols > 1) {
  ------------------
  |  Branch (2237:7): [True: 7.10k, False: 20.9k]
  ------------------
 2238|       |    // tile to use for cdf update
 2239|  7.10k|    pbi->context_update_tile_id =
 2240|  7.10k|        aom_rb_read_literal(rb, cm->tiles.log2_rows + cm->tiles.log2_cols);
 2241|  7.10k|    if (pbi->context_update_tile_id >= cm->tiles.rows * cm->tiles.cols) {
  ------------------
  |  Branch (2241:9): [True: 0, False: 7.10k]
  ------------------
 2242|      0|      aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 2243|      0|                         "Invalid context_update_tile_id");
 2244|      0|    }
 2245|       |    // tile size magnitude
 2246|  7.10k|    pbi->tile_size_bytes = aom_rb_read_literal(rb, 2) + 1;
 2247|  7.10k|  }
 2248|  28.0k|}
decodeframe.c:read_tile_info_max_tile:
 2147|  28.0k|    AV1_COMMON *const cm, struct aom_read_bit_buffer *const rb) {
 2148|  28.0k|  const SequenceHeader *const seq_params = cm->seq_params;
 2149|  28.0k|  CommonTileParams *const tiles = &cm->tiles;
 2150|  28.0k|  int width_sb =
 2151|  28.0k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, seq_params->mib_size_log2);
  ------------------
  |  |   62|  28.0k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 2152|  28.0k|  int height_sb =
 2153|  28.0k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, seq_params->mib_size_log2);
  ------------------
  |  |   62|  28.0k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 2154|       |
 2155|  28.0k|  av1_get_tile_limits(cm);
 2156|  28.0k|  tiles->uniform_spacing = aom_rb_read_bit(rb);
 2157|       |
 2158|       |  // Read tile columns
 2159|  28.0k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (2159:7): [True: 28.0k, False: 0]
  ------------------
 2160|  28.0k|    tiles->log2_cols = tiles->min_log2_cols;
 2161|  33.8k|    while (tiles->log2_cols < tiles->max_log2_cols) {
  ------------------
  |  Branch (2161:12): [True: 7.22k, False: 26.6k]
  ------------------
 2162|  7.22k|      if (!aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (2162:11): [True: 1.41k, False: 5.81k]
  ------------------
 2163|  1.41k|        break;
 2164|  1.41k|      }
 2165|  5.81k|      tiles->log2_cols++;
 2166|  5.81k|    }
 2167|  28.0k|  } else {
 2168|      0|    int i;
 2169|      0|    int start_sb;
 2170|      0|    for (i = 0, start_sb = 0; width_sb > 0 && i < MAX_TILE_COLS; i++) {
  ------------------
  |  |   54|      0|#define MAX_TILE_COLS 64
  ------------------
  |  Branch (2170:31): [True: 0, False: 0]
  |  Branch (2170:47): [True: 0, False: 0]
  ------------------
 2171|      0|      const int size_sb =
 2172|      0|          1 + rb_read_uniform(rb, AOMMIN(width_sb, tiles->max_width_sb));
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2173|      0|      tiles->col_start_sb[i] = start_sb;
 2174|      0|      start_sb += size_sb;
 2175|      0|      width_sb -= size_sb;
 2176|      0|    }
 2177|      0|    tiles->cols = i;
 2178|      0|    tiles->col_start_sb[i] = start_sb + width_sb;
 2179|      0|  }
 2180|  28.0k|  av1_calculate_tile_cols(seq_params, cm->mi_params.mi_rows,
 2181|  28.0k|                          cm->mi_params.mi_cols, tiles);
 2182|       |
 2183|       |  // Read tile rows
 2184|  28.0k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (2184:7): [True: 28.0k, False: 0]
  ------------------
 2185|  28.0k|    tiles->log2_rows = tiles->min_log2_rows;
 2186|  34.1k|    while (tiles->log2_rows < tiles->max_log2_rows) {
  ------------------
  |  Branch (2186:12): [True: 7.37k, False: 26.7k]
  ------------------
 2187|  7.37k|      if (!aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (2187:11): [True: 1.32k, False: 6.04k]
  ------------------
 2188|  1.32k|        break;
 2189|  1.32k|      }
 2190|  6.04k|      tiles->log2_rows++;
 2191|  6.04k|    }
 2192|  28.0k|  } else {
 2193|      0|    int i;
 2194|      0|    int start_sb;
 2195|      0|    for (i = 0, start_sb = 0; height_sb > 0 && i < MAX_TILE_ROWS; i++) {
  ------------------
  |  |   53|      0|#define MAX_TILE_ROWS 64
  ------------------
  |  Branch (2195:31): [True: 0, False: 0]
  |  Branch (2195:48): [True: 0, False: 0]
  ------------------
 2196|      0|      const int size_sb =
 2197|      0|          1 + rb_read_uniform(rb, AOMMIN(height_sb, tiles->max_height_sb));
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2198|      0|      tiles->row_start_sb[i] = start_sb;
 2199|      0|      start_sb += size_sb;
 2200|      0|      height_sb -= size_sb;
 2201|      0|    }
 2202|      0|    tiles->rows = i;
 2203|      0|    tiles->row_start_sb[i] = start_sb + height_sb;
 2204|      0|  }
 2205|  28.0k|  av1_calculate_tile_rows(seq_params, cm->mi_params.mi_rows, tiles);
 2206|  28.0k|}
decodeframe.c:setup_quantization:
 1820|  28.0k|                                      struct aom_read_bit_buffer *rb) {
 1821|  28.0k|  quant_params->base_qindex = aom_rb_read_literal(rb, QINDEX_BITS);
  ------------------
  |  |   28|  28.0k|#define QINDEX_BITS 8
  ------------------
 1822|  28.0k|  quant_params->y_dc_delta_q = read_delta_q(rb);
 1823|  28.0k|  if (num_planes > 1) {
  ------------------
  |  Branch (1823:7): [True: 10.8k, False: 17.2k]
  ------------------
 1824|  10.8k|    int diff_uv_delta = 0;
 1825|  10.8k|    if (separate_uv_delta_q) diff_uv_delta = aom_rb_read_bit(rb);
  ------------------
  |  Branch (1825:9): [True: 0, False: 10.8k]
  ------------------
 1826|  10.8k|    quant_params->u_dc_delta_q = read_delta_q(rb);
 1827|  10.8k|    quant_params->u_ac_delta_q = read_delta_q(rb);
 1828|  10.8k|    if (diff_uv_delta) {
  ------------------
  |  Branch (1828:9): [True: 0, False: 10.8k]
  ------------------
 1829|      0|      quant_params->v_dc_delta_q = read_delta_q(rb);
 1830|      0|      quant_params->v_ac_delta_q = read_delta_q(rb);
 1831|  10.8k|    } else {
 1832|  10.8k|      quant_params->v_dc_delta_q = quant_params->u_dc_delta_q;
 1833|  10.8k|      quant_params->v_ac_delta_q = quant_params->u_ac_delta_q;
 1834|  10.8k|    }
 1835|  17.2k|  } else {
 1836|  17.2k|    quant_params->u_dc_delta_q = 0;
 1837|  17.2k|    quant_params->u_ac_delta_q = 0;
 1838|  17.2k|    quant_params->v_dc_delta_q = 0;
 1839|  17.2k|    quant_params->v_ac_delta_q = 0;
 1840|  17.2k|  }
 1841|  28.0k|  quant_params->using_qmatrix = aom_rb_read_bit(rb);
 1842|  28.0k|  if (quant_params->using_qmatrix) {
  ------------------
  |  Branch (1842:7): [True: 20.0k, False: 8.06k]
  ------------------
 1843|  20.0k|    quant_params->qmatrix_level_y = aom_rb_read_literal(rb, QM_LEVEL_BITS);
  ------------------
  |  |   30|  20.0k|#define QM_LEVEL_BITS 4
  ------------------
 1844|  20.0k|    quant_params->qmatrix_level_u = aom_rb_read_literal(rb, QM_LEVEL_BITS);
  ------------------
  |  |   30|  20.0k|#define QM_LEVEL_BITS 4
  ------------------
 1845|  20.0k|    if (!separate_uv_delta_q)
  ------------------
  |  Branch (1845:9): [True: 20.0k, False: 0]
  ------------------
 1846|  20.0k|      quant_params->qmatrix_level_v = quant_params->qmatrix_level_u;
 1847|      0|    else
 1848|      0|      quant_params->qmatrix_level_v = aom_rb_read_literal(rb, QM_LEVEL_BITS);
  ------------------
  |  |   30|      0|#define QM_LEVEL_BITS 4
  ------------------
 1849|  20.0k|  } else {
 1850|  8.06k|    quant_params->qmatrix_level_y = 0;
 1851|  8.06k|    quant_params->qmatrix_level_u = 0;
 1852|  8.06k|    quant_params->qmatrix_level_v = 0;
 1853|  8.06k|  }
 1854|  28.0k|}
decodeframe.c:read_delta_q:
 1814|  49.6k|static inline int read_delta_q(struct aom_read_bit_buffer *rb) {
 1815|  49.6k|  return aom_rb_read_bit(rb) ? aom_rb_read_inv_signed_literal(rb, 6) : 0;
  ------------------
  |  Branch (1815:10): [True: 13.7k, False: 35.9k]
  ------------------
 1816|  49.6k|}
decodeframe.c:setup_segmentation:
 1474|  28.0k|                                      struct aom_read_bit_buffer *rb) {
 1475|  28.0k|  struct segmentation *const seg = &cm->seg;
 1476|       |
 1477|  28.0k|  seg->update_map = 0;
 1478|  28.0k|  seg->update_data = 0;
 1479|  28.0k|  seg->temporal_update = 0;
 1480|       |
 1481|  28.0k|  seg->enabled = aom_rb_read_bit(rb);
 1482|  28.0k|  if (!seg->enabled) {
  ------------------
  |  Branch (1482:7): [True: 28.0k, False: 0]
  ------------------
 1483|  28.0k|    if (cm->cur_frame->seg_map) {
  ------------------
  |  Branch (1483:9): [True: 28.0k, False: 0]
  ------------------
 1484|  28.0k|      memset(cm->cur_frame->seg_map, 0,
 1485|  28.0k|             (cm->cur_frame->mi_rows * cm->cur_frame->mi_cols));
 1486|  28.0k|    }
 1487|       |
 1488|  28.0k|    memset(seg, 0, sizeof(*seg));
 1489|  28.0k|    segfeatures_copy(&cm->cur_frame->seg, seg);
 1490|  28.0k|    return;
 1491|  28.0k|  }
 1492|      0|  if (cm->seg.enabled && cm->prev_frame &&
  ------------------
  |  Branch (1492:7): [True: 0, False: 0]
  |  Branch (1492:26): [True: 0, False: 0]
  ------------------
 1493|      0|      (cm->mi_params.mi_rows == cm->prev_frame->mi_rows) &&
  ------------------
  |  Branch (1493:7): [True: 0, False: 0]
  ------------------
 1494|      0|      (cm->mi_params.mi_cols == cm->prev_frame->mi_cols)) {
  ------------------
  |  Branch (1494:7): [True: 0, False: 0]
  ------------------
 1495|      0|    cm->last_frame_seg_map = cm->prev_frame->seg_map;
 1496|      0|  } else {
 1497|      0|    cm->last_frame_seg_map = NULL;
 1498|      0|  }
 1499|       |  // Read update flags
 1500|      0|  if (cm->features.primary_ref_frame == PRIMARY_REF_NONE) {
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1500:7): [True: 0, False: 0]
  ------------------
 1501|       |    // These frames can't use previous frames, so must signal map + features
 1502|      0|    seg->update_map = 1;
 1503|      0|    seg->temporal_update = 0;
 1504|      0|    seg->update_data = 1;
 1505|      0|  } else {
 1506|      0|    seg->update_map = aom_rb_read_bit(rb);
 1507|      0|    if (seg->update_map) {
  ------------------
  |  Branch (1507:9): [True: 0, False: 0]
  ------------------
 1508|      0|      seg->temporal_update = aom_rb_read_bit(rb);
 1509|      0|    } else {
 1510|      0|      seg->temporal_update = 0;
 1511|      0|    }
 1512|      0|    seg->update_data = aom_rb_read_bit(rb);
 1513|      0|  }
 1514|       |
 1515|       |  // Segmentation data update
 1516|      0|  if (seg->update_data) {
  ------------------
  |  Branch (1516:7): [True: 0, False: 0]
  ------------------
 1517|      0|    av1_clearall_segfeatures(seg);
 1518|       |
 1519|      0|    for (int i = 0; i < MAX_SEGMENTS; i++) {
  ------------------
  |  |   23|      0|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (1519:21): [True: 0, False: 0]
  ------------------
 1520|      0|      for (int j = 0; j < SEG_LVL_MAX; j++) {
  ------------------
  |  Branch (1520:23): [True: 0, False: 0]
  ------------------
 1521|      0|        int data = 0;
 1522|      0|        const int feature_enabled = aom_rb_read_bit(rb);
 1523|      0|        if (feature_enabled) {
  ------------------
  |  Branch (1523:13): [True: 0, False: 0]
  ------------------
 1524|      0|          av1_enable_segfeature(seg, i, j);
 1525|       |
 1526|      0|          const int data_max = av1_seg_feature_data_max(j);
 1527|      0|          const int data_min = -data_max;
 1528|      0|          const int ubits = get_unsigned_bits(data_max);
 1529|       |
 1530|      0|          if (av1_is_segfeature_signed(j)) {
  ------------------
  |  Branch (1530:15): [True: 0, False: 0]
  ------------------
 1531|      0|            data = aom_rb_read_inv_signed_literal(rb, ubits);
 1532|      0|          } else {
 1533|      0|            data = aom_rb_read_literal(rb, ubits);
 1534|      0|          }
 1535|       |
 1536|      0|          data = clamp(data, data_min, data_max);
 1537|      0|        }
 1538|      0|        av1_set_segdata(seg, i, j, data);
 1539|      0|      }
 1540|      0|    }
 1541|      0|    av1_calculate_segdata(seg);
 1542|      0|  } else if (cm->prev_frame) {
  ------------------
  |  Branch (1542:14): [True: 0, False: 0]
  ------------------
 1543|      0|    segfeatures_copy(seg, &cm->prev_frame->seg);
 1544|      0|  }
 1545|      0|  segfeatures_copy(&cm->cur_frame->seg, seg);
 1546|      0|}
decodeframe.c:setup_segmentation_dequant:
 1866|  28.0k|                                              MACROBLOCKD *const xd) {
 1867|  28.0k|  const int bit_depth = cm->seq_params->bit_depth;
 1868|       |  // When segmentation is disabled, only the first value is used.  The
 1869|       |  // remaining are don't cares.
 1870|  28.0k|  const int max_segments = cm->seg.enabled ? MAX_SEGMENTS : 1;
  ------------------
  |  |   23|      0|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (1870:28): [True: 0, False: 28.0k]
  ------------------
 1871|  28.0k|  CommonQuantParams *const quant_params = &cm->quant_params;
 1872|  56.1k|  for (int i = 0; i < max_segments; ++i) {
  ------------------
  |  Branch (1872:19): [True: 28.0k, False: 28.0k]
  ------------------
 1873|  28.0k|    const int qindex = xd->qindex[i];
 1874|  28.0k|    quant_params->y_dequant_QTX[i][0] =
 1875|  28.0k|        av1_dc_quant_QTX(qindex, quant_params->y_dc_delta_q, bit_depth);
 1876|  28.0k|    quant_params->y_dequant_QTX[i][1] = av1_ac_quant_QTX(qindex, 0, bit_depth);
 1877|  28.0k|    quant_params->u_dequant_QTX[i][0] =
 1878|  28.0k|        av1_dc_quant_QTX(qindex, quant_params->u_dc_delta_q, bit_depth);
 1879|  28.0k|    quant_params->u_dequant_QTX[i][1] =
 1880|  28.0k|        av1_ac_quant_QTX(qindex, quant_params->u_ac_delta_q, bit_depth);
 1881|  28.0k|    quant_params->v_dequant_QTX[i][0] =
 1882|  28.0k|        av1_dc_quant_QTX(qindex, quant_params->v_dc_delta_q, bit_depth);
 1883|  28.0k|    quant_params->v_dequant_QTX[i][1] =
 1884|  28.0k|        av1_ac_quant_QTX(qindex, quant_params->v_ac_delta_q, bit_depth);
 1885|  28.0k|    const int use_qmatrix = av1_use_qmatrix(quant_params, xd, i);
 1886|       |    // NB: depends on base index so there is only 1 set per frame
 1887|       |    // No quant weighting when lossless or signalled not using QM
 1888|  28.0k|    const int qmlevel_y =
 1889|  28.0k|        use_qmatrix ? quant_params->qmatrix_level_y : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  8.13k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  8.13k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (1889:9): [True: 19.9k, False: 8.13k]
  ------------------
 1890|   561k|    for (int j = 0; j < TX_SIZES_ALL; ++j) {
  ------------------
  |  Branch (1890:21): [True: 533k, False: 28.0k]
  ------------------
 1891|   533k|      quant_params->y_iqmatrix[i][j] =
 1892|   533k|          get_iqmatrix(quant_params, qmlevel_y, AOM_PLANE_Y, j);
  ------------------
  |  |  281|   533k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1893|   533k|    }
 1894|  28.0k|    const int qmlevel_u =
 1895|  28.0k|        use_qmatrix ? quant_params->qmatrix_level_u : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  8.13k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  8.13k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (1895:9): [True: 19.9k, False: 8.13k]
  ------------------
 1896|   561k|    for (int j = 0; j < TX_SIZES_ALL; ++j) {
  ------------------
  |  Branch (1896:21): [True: 533k, False: 28.0k]
  ------------------
 1897|   533k|      quant_params->u_iqmatrix[i][j] =
 1898|   533k|          get_iqmatrix(quant_params, qmlevel_u, AOM_PLANE_U, j);
  ------------------
  |  |  282|   533k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 1899|   533k|    }
 1900|  28.0k|    const int qmlevel_v =
 1901|  28.0k|        use_qmatrix ? quant_params->qmatrix_level_v : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  8.13k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  8.13k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (1901:9): [True: 19.9k, False: 8.13k]
  ------------------
 1902|   561k|    for (int j = 0; j < TX_SIZES_ALL; ++j) {
  ------------------
  |  Branch (1902:21): [True: 533k, False: 28.0k]
  ------------------
 1903|   533k|      quant_params->v_iqmatrix[i][j] =
 1904|   533k|          get_iqmatrix(quant_params, qmlevel_v, AOM_PLANE_V, j);
  ------------------
  |  |  283|   533k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 1905|   533k|    }
 1906|  28.0k|  }
 1907|  28.0k|}
decodeframe.c:get_iqmatrix:
 1858|  1.60M|                                    int qmlevel, int plane, TX_SIZE tx_size) {
 1859|       |  assert(quant_params->giqmatrix[qmlevel][plane][tx_size] != NULL ||
 1860|  1.60M|         qmlevel == NUM_QM_LEVELS - 1);
 1861|  1.60M|  return quant_params->giqmatrix[qmlevel][plane][tx_size];
 1862|  1.60M|}
decodeframe.c:setup_loopfilter:
 1747|  28.0k|                                    struct aom_read_bit_buffer *rb) {
 1748|  28.0k|  const int num_planes = av1_num_planes(cm);
 1749|  28.0k|  struct loopfilter *lf = &cm->lf;
 1750|       |
 1751|  28.0k|  if (cm->features.allow_intrabc || cm->features.coded_lossless) {
  ------------------
  |  Branch (1751:7): [True: 0, False: 28.0k]
  |  Branch (1751:37): [True: 1.26k, False: 26.8k]
  ------------------
 1752|       |    // write default deltas to frame buffer
 1753|  1.26k|    av1_set_default_ref_deltas(cm->cur_frame->ref_deltas);
 1754|  1.26k|    av1_set_default_mode_deltas(cm->cur_frame->mode_deltas);
 1755|  1.26k|    return;
 1756|  1.26k|  }
 1757|  28.0k|  assert(!cm->features.coded_lossless);
 1758|  26.8k|  if (cm->prev_frame) {
  ------------------
  |  Branch (1758:7): [True: 11.3k, False: 15.4k]
  ------------------
 1759|       |    // write deltas to frame buffer
 1760|  11.3k|    memcpy(lf->ref_deltas, cm->prev_frame->ref_deltas, REF_FRAMES);
 1761|  11.3k|    memcpy(lf->mode_deltas, cm->prev_frame->mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|  11.3k|#define MAX_MODE_LF_DELTAS 2
  ------------------
 1762|  15.4k|  } else {
 1763|  15.4k|    av1_set_default_ref_deltas(lf->ref_deltas);
 1764|  15.4k|    av1_set_default_mode_deltas(lf->mode_deltas);
 1765|  15.4k|  }
 1766|  26.8k|  lf->filter_level[0] = aom_rb_read_literal(rb, 6);
 1767|  26.8k|  lf->filter_level[1] = aom_rb_read_literal(rb, 6);
 1768|  26.8k|  if (num_planes > 1) {
  ------------------
  |  Branch (1768:7): [True: 10.2k, False: 16.5k]
  ------------------
 1769|  10.2k|    if (lf->filter_level[0] || lf->filter_level[1]) {
  ------------------
  |  Branch (1769:9): [True: 3.80k, False: 6.46k]
  |  Branch (1769:32): [True: 0, False: 6.46k]
  ------------------
 1770|  3.80k|      lf->filter_level_u = aom_rb_read_literal(rb, 6);
 1771|  3.80k|      lf->filter_level_v = aom_rb_read_literal(rb, 6);
 1772|  3.80k|    }
 1773|  10.2k|  }
 1774|  26.8k|  lf->sharpness_level = aom_rb_read_literal(rb, 3);
 1775|       |
 1776|       |  // Read in loop filter deltas applied at the MB level based on mode or ref
 1777|       |  // frame.
 1778|  26.8k|  lf->mode_ref_delta_update = 0;
 1779|       |
 1780|  26.8k|  lf->mode_ref_delta_enabled = aom_rb_read_bit(rb);
 1781|  26.8k|  if (lf->mode_ref_delta_enabled) {
  ------------------
  |  Branch (1781:7): [True: 26.8k, False: 0]
  ------------------
 1782|  26.8k|    lf->mode_ref_delta_update = aom_rb_read_bit(rb);
 1783|  26.8k|    if (lf->mode_ref_delta_update) {
  ------------------
  |  Branch (1783:9): [True: 0, False: 26.8k]
  ------------------
 1784|      0|      for (int i = 0; i < REF_FRAMES; i++)
  ------------------
  |  Branch (1784:23): [True: 0, False: 0]
  ------------------
 1785|      0|        if (aom_rb_read_bit(rb))
  ------------------
  |  Branch (1785:13): [True: 0, False: 0]
  ------------------
 1786|      0|          lf->ref_deltas[i] = aom_rb_read_inv_signed_literal(rb, 6);
 1787|       |
 1788|      0|      for (int i = 0; i < MAX_MODE_LF_DELTAS; i++)
  ------------------
  |  |   74|      0|#define MAX_MODE_LF_DELTAS 2
  ------------------
  |  Branch (1788:23): [True: 0, False: 0]
  ------------------
 1789|      0|        if (aom_rb_read_bit(rb))
  ------------------
  |  Branch (1789:13): [True: 0, False: 0]
  ------------------
 1790|      0|          lf->mode_deltas[i] = aom_rb_read_inv_signed_literal(rb, 6);
 1791|      0|    }
 1792|  26.8k|  }
 1793|       |
 1794|       |  // write deltas to frame buffer
 1795|  26.8k|  memcpy(cm->cur_frame->ref_deltas, lf->ref_deltas, REF_FRAMES);
 1796|  26.8k|  memcpy(cm->cur_frame->mode_deltas, lf->mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|  26.8k|#define MAX_MODE_LF_DELTAS 2
  ------------------
 1797|  26.8k|}
decodeframe.c:setup_cdef:
 1799|  26.8k|static inline void setup_cdef(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
 1800|  26.8k|  const int num_planes = av1_num_planes(cm);
 1801|  26.8k|  CdefInfo *const cdef_info = &cm->cdef_info;
 1802|       |
 1803|  26.8k|  if (cm->features.allow_intrabc) return;
  ------------------
  |  Branch (1803:7): [True: 0, False: 26.8k]
  ------------------
 1804|  26.8k|  cdef_info->cdef_damping = aom_rb_read_literal(rb, 2) + 3;
 1805|  26.8k|  cdef_info->cdef_bits = aom_rb_read_literal(rb, 2);
 1806|  26.8k|  cdef_info->nb_cdef_strengths = 1 << cdef_info->cdef_bits;
 1807|  57.4k|  for (int i = 0; i < cdef_info->nb_cdef_strengths; i++) {
  ------------------
  |  Branch (1807:19): [True: 30.6k, False: 26.8k]
  ------------------
 1808|  30.6k|    cdef_info->cdef_strengths[i] = aom_rb_read_literal(rb, CDEF_STRENGTH_BITS);
  ------------------
  |  |   14|  30.6k|#define CDEF_STRENGTH_BITS 6
  ------------------
 1809|  30.6k|    cdef_info->cdef_uv_strengths[i] =
 1810|  30.6k|        num_planes > 1 ? aom_rb_read_literal(rb, CDEF_STRENGTH_BITS) : 0;
  ------------------
  |  |   14|  12.2k|#define CDEF_STRENGTH_BITS 6
  ------------------
  |  Branch (1810:9): [True: 12.2k, False: 18.3k]
  ------------------
 1811|  30.6k|  }
 1812|  26.8k|}
decodeframe.c:decode_restoration_mode:
 1549|  3.76k|                                           struct aom_read_bit_buffer *rb) {
 1550|  3.76k|  assert(!cm->features.all_lossless);
 1551|  3.76k|  const int num_planes = av1_num_planes(cm);
 1552|  3.76k|  if (cm->features.allow_intrabc) return;
  ------------------
  |  Branch (1552:7): [True: 0, False: 3.76k]
  ------------------
 1553|  3.76k|  int all_none = 1, chroma_none = 1;
 1554|  10.4k|  for (int p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (1554:19): [True: 6.63k, False: 3.76k]
  ------------------
 1555|  6.63k|    RestorationInfo *rsi = &cm->rst_info[p];
 1556|  6.63k|    if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (1556:9): [True: 308, False: 6.32k]
  ------------------
 1557|    308|      rsi->frame_restoration_type =
 1558|    308|          aom_rb_read_bit(rb) ? RESTORE_SGRPROJ : RESTORE_WIENER;
  ------------------
  |  Branch (1558:11): [True: 10, False: 298]
  ------------------
 1559|  6.32k|    } else {
 1560|  6.32k|      rsi->frame_restoration_type =
 1561|  6.32k|          aom_rb_read_bit(rb) ? RESTORE_SWITCHABLE : RESTORE_NONE;
  ------------------
  |  Branch (1561:11): [True: 1, False: 6.32k]
  ------------------
 1562|  6.32k|    }
 1563|  6.63k|    if (rsi->frame_restoration_type != RESTORE_NONE) {
  ------------------
  |  Branch (1563:9): [True: 309, False: 6.32k]
  ------------------
 1564|    309|      all_none = 0;
 1565|    309|      chroma_none &= p == 0;
 1566|    309|    }
 1567|  6.63k|  }
 1568|  3.76k|  if (!all_none) {
  ------------------
  |  Branch (1568:7): [True: 286, False: 3.47k]
  ------------------
 1569|    286|    assert(cm->seq_params->sb_size == BLOCK_64X64 ||
 1570|    286|           cm->seq_params->sb_size == BLOCK_128X128);
 1571|    286|    const int sb_size = cm->seq_params->sb_size == BLOCK_128X128 ? 128 : 64;
  ------------------
  |  Branch (1571:25): [True: 0, False: 286]
  ------------------
 1572|       |
 1573|    890|    for (int p = 0; p < num_planes; ++p)
  ------------------
  |  Branch (1573:21): [True: 604, False: 286]
  ------------------
 1574|    604|      cm->rst_info[p].restoration_unit_size = sb_size;
 1575|       |
 1576|    286|    RestorationInfo *rsi = &cm->rst_info[0];
 1577|       |
 1578|    286|    if (sb_size == 64) {
  ------------------
  |  Branch (1578:9): [True: 286, False: 0]
  ------------------
 1579|    286|      rsi->restoration_unit_size <<= aom_rb_read_bit(rb);
 1580|    286|    }
 1581|    286|    if (rsi->restoration_unit_size > 64) {
  ------------------
  |  Branch (1581:9): [True: 286, False: 0]
  ------------------
 1582|    286|      rsi->restoration_unit_size <<= aom_rb_read_bit(rb);
 1583|    286|    }
 1584|  3.47k|  } else {
 1585|  3.47k|    const int size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  3.47k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 1586|  9.51k|    for (int p = 0; p < num_planes; ++p)
  ------------------
  |  Branch (1586:21): [True: 6.03k, False: 3.47k]
  ------------------
 1587|  6.03k|      cm->rst_info[p].restoration_unit_size = size;
 1588|  3.47k|  }
 1589|       |
 1590|  3.76k|  if (num_planes > 1) {
  ------------------
  |  Branch (1590:7): [True: 1.43k, False: 2.32k]
  ------------------
 1591|  1.43k|    int s =
 1592|  1.43k|        AOMMIN(cm->seq_params->subsampling_x, cm->seq_params->subsampling_y);
  ------------------
  |  |   34|  1.43k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.43k]
  |  |  ------------------
  ------------------
 1593|  1.43k|    if (s && !chroma_none) {
  ------------------
  |  Branch (1593:9): [True: 664, False: 772]
  |  Branch (1593:14): [True: 7, False: 657]
  ------------------
 1594|      7|      cm->rst_info[1].restoration_unit_size =
 1595|      7|          cm->rst_info[0].restoration_unit_size >> (aom_rb_read_bit(rb) * s);
 1596|  1.42k|    } else {
 1597|  1.42k|      cm->rst_info[1].restoration_unit_size =
 1598|  1.42k|          cm->rst_info[0].restoration_unit_size;
 1599|  1.42k|    }
 1600|  1.43k|    cm->rst_info[2].restoration_unit_size =
 1601|  1.43k|        cm->rst_info[1].restoration_unit_size;
 1602|  1.43k|  }
 1603|  3.76k|}
decodeframe.c:read_tx_mode:
  140|  28.0k|                            int coded_lossless) {
  141|  28.0k|  if (coded_lossless) return ONLY_4X4;
  ------------------
  |  Branch (141:7): [True: 1.26k, False: 26.8k]
  ------------------
  142|  26.8k|  return aom_rb_read_bit(rb) ? TX_MODE_SELECT : TX_MODE_LARGEST;
  ------------------
  |  Branch (142:10): [True: 16.5k, False: 10.2k]
  ------------------
  143|  28.0k|}
decodeframe.c:read_frame_reference_mode:
  146|  28.0k|    const AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
  147|  28.0k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (147:7): [True: 7.01k, False: 21.0k]
  ------------------
  148|  7.01k|    return SINGLE_REFERENCE;
  149|  21.0k|  } else {
  150|  21.0k|    return aom_rb_read_bit(rb) ? REFERENCE_MODE_SELECT : SINGLE_REFERENCE;
  ------------------
  |  Branch (150:12): [True: 0, False: 21.0k]
  ------------------
  151|  21.0k|  }
  152|  28.0k|}
decodeframe.c:read_global_motion:
 4454|  21.0k|                                      struct aom_read_bit_buffer *rb) {
 4455|   168k|  for (int frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
  ------------------
  |  Branch (4455:32): [True: 147k, False: 21.0k]
  ------------------
 4456|   147k|    const WarpedMotionParams *ref_params =
 4457|   147k|        cm->prev_frame ? &cm->prev_frame->global_motion[frame]
  ------------------
  |  Branch (4457:9): [True: 82.6k, False: 64.7k]
  ------------------
 4458|   147k|                       : &default_warp_params;
 4459|   147k|    int good_params =
 4460|   147k|        read_global_motion_params(&cm->global_motion[frame], ref_params, rb,
 4461|   147k|                                  cm->features.allow_high_precision_mv);
 4462|   147k|    if (!good_params) {
  ------------------
  |  Branch (4462:9): [True: 0, False: 147k]
  ------------------
 4463|       |#if WARPED_MOTION_DEBUG
 4464|       |      printf("Warning: unexpected global motion shear params from aomenc\n");
 4465|       |#endif
 4466|      0|      cm->global_motion[frame].invalid = 1;
 4467|      0|    }
 4468|       |
 4469|       |    // TODO(sarahparker, debargha): The logic in the commented out code below
 4470|       |    // does not work currently and causes mismatches when resize is on. Fix it
 4471|       |    // before turning the optimization back on.
 4472|       |    /*
 4473|       |    YV12_BUFFER_CONFIG *ref_buf = get_ref_frame(cm, frame);
 4474|       |    if (cm->width == ref_buf->y_crop_width &&
 4475|       |        cm->height == ref_buf->y_crop_height) {
 4476|       |      read_global_motion_params(&cm->global_motion[frame],
 4477|       |                                &cm->prev_frame->global_motion[frame], rb,
 4478|       |                                cm->features.allow_high_precision_mv);
 4479|       |    } else {
 4480|       |      cm->global_motion[frame] = default_warp_params;
 4481|       |    }
 4482|       |    */
 4483|       |    /*
 4484|       |    printf("Dec Ref %d [%d/%d]: %d %d %d %d\n",
 4485|       |           frame, cm->current_frame.frame_number, cm->show_frame,
 4486|       |           cm->global_motion[frame].wmmat[0],
 4487|       |           cm->global_motion[frame].wmmat[1],
 4488|       |           cm->global_motion[frame].wmmat[2],
 4489|       |           cm->global_motion[frame].wmmat[3]);
 4490|       |           */
 4491|   147k|  }
 4492|  21.0k|  memcpy(cm->cur_frame->global_motion, cm->global_motion,
 4493|  21.0k|         REF_FRAMES * sizeof(WarpedMotionParams));
 4494|  21.0k|}
decodeframe.c:read_global_motion_params:
 4386|   147k|                                     int allow_hp) {
 4387|   147k|  TransformationType type = aom_rb_read_bit(rb);
 4388|   147k|  if (type != IDENTITY) {
  ------------------
  |  Branch (4388:7): [True: 0, False: 147k]
  ------------------
 4389|      0|    if (aom_rb_read_bit(rb))
  ------------------
  |  Branch (4389:9): [True: 0, False: 0]
  ------------------
 4390|      0|      type = ROTZOOM;
 4391|      0|    else
 4392|      0|      type = aom_rb_read_bit(rb) ? TRANSLATION : AFFINE;
  ------------------
  |  Branch (4392:14): [True: 0, False: 0]
  ------------------
 4393|      0|  }
 4394|       |
 4395|   147k|  *params = default_warp_params;
 4396|   147k|  params->wmtype = type;
 4397|       |
 4398|   147k|  if (type >= ROTZOOM) {
  ------------------
  |  Branch (4398:7): [True: 0, False: 147k]
  ------------------
 4399|      0|    params->wmmat[2] = aom_rb_read_signed_primitive_refsubexpfin(
 4400|      0|                           rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                                         rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4401|      0|                           (ref_params->wmmat[2] >> GM_ALPHA_PREC_DIFF) -
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 4402|      0|                               (1 << GM_ALPHA_PREC_BITS)) *
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 4403|      0|                           GM_ALPHA_DECODE_FACTOR +
  ------------------
  |  |  175|      0|#define GM_ALPHA_DECODE_FACTOR (1 << GM_ALPHA_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4404|      0|                       (1 << WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 4405|      0|    params->wmmat[3] = aom_rb_read_signed_primitive_refsubexpfin(
 4406|      0|                           rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                                         rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4407|      0|                           (ref_params->wmmat[3] >> GM_ALPHA_PREC_DIFF)) *
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 4408|      0|                       GM_ALPHA_DECODE_FACTOR;
  ------------------
  |  |  175|      0|#define GM_ALPHA_DECODE_FACTOR (1 << GM_ALPHA_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4409|      0|  }
 4410|       |
 4411|   147k|  if (type >= AFFINE) {
  ------------------
  |  Branch (4411:7): [True: 0, False: 147k]
  ------------------
 4412|      0|    params->wmmat[4] = aom_rb_read_signed_primitive_refsubexpfin(
 4413|      0|                           rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                                         rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4414|      0|                           (ref_params->wmmat[4] >> GM_ALPHA_PREC_DIFF)) *
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 4415|      0|                       GM_ALPHA_DECODE_FACTOR;
  ------------------
  |  |  175|      0|#define GM_ALPHA_DECODE_FACTOR (1 << GM_ALPHA_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4416|      0|    params->wmmat[5] = aom_rb_read_signed_primitive_refsubexpfin(
 4417|      0|                           rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                                         rb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4418|      0|                           (ref_params->wmmat[5] >> GM_ALPHA_PREC_DIFF) -
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 4419|      0|                               (1 << GM_ALPHA_PREC_BITS)) *
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 4420|      0|                           GM_ALPHA_DECODE_FACTOR +
  ------------------
  |  |  175|      0|#define GM_ALPHA_DECODE_FACTOR (1 << GM_ALPHA_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4421|      0|                       (1 << WARPEDMODEL_PREC_BITS);
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
 4422|   147k|  } else {
 4423|   147k|    params->wmmat[4] = -params->wmmat[3];
 4424|   147k|    params->wmmat[5] = params->wmmat[2];
 4425|   147k|  }
 4426|       |
 4427|   147k|  if (type >= TRANSLATION) {
  ------------------
  |  Branch (4427:7): [True: 0, False: 147k]
  ------------------
 4428|      0|    const int trans_bits = (type == TRANSLATION)
  ------------------
  |  Branch (4428:28): [True: 0, False: 0]
  ------------------
 4429|      0|                               ? GM_ABS_TRANS_ONLY_BITS - !allow_hp
  ------------------
  |  |  166|      0|#define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  165|      0|#define GM_ABS_TRANS_BITS 12
  |  |  ------------------
  |  |               #define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
 4430|      0|                               : GM_ABS_TRANS_BITS;
  ------------------
  |  |  165|      0|#define GM_ABS_TRANS_BITS 12
  ------------------
 4431|      0|    const int trans_dec_factor =
 4432|      0|        (type == TRANSLATION) ? GM_TRANS_ONLY_DECODE_FACTOR * (1 << !allow_hp)
  ------------------
  |  |  170|      0|#define GM_TRANS_ONLY_DECODE_FACTOR (1 << GM_TRANS_ONLY_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4432:9): [True: 0, False: 0]
  ------------------
 4433|      0|                              : GM_TRANS_DECODE_FACTOR;
  ------------------
  |  |  169|      0|#define GM_TRANS_DECODE_FACTOR (1 << GM_TRANS_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  167|      0|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4434|      0|    const int trans_prec_diff = (type == TRANSLATION)
  ------------------
  |  Branch (4434:33): [True: 0, False: 0]
  ------------------
 4435|      0|                                    ? GM_TRANS_ONLY_PREC_DIFF + !allow_hp
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
 4436|      0|                                    : GM_TRANS_PREC_DIFF;
  ------------------
  |  |  167|      0|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
 4437|      0|    params->wmmat[0] = aom_rb_read_signed_primitive_refsubexpfin(
 4438|      0|                           rb, (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4439|      0|                           (ref_params->wmmat[0] >> trans_prec_diff)) *
 4440|      0|                       trans_dec_factor;
 4441|      0|    params->wmmat[1] = aom_rb_read_signed_primitive_refsubexpfin(
 4442|      0|                           rb, (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 4443|      0|                           (ref_params->wmmat[1] >> trans_prec_diff)) *
 4444|      0|                       trans_dec_factor;
 4445|      0|  }
 4446|       |
 4447|   147k|  int good_shear_params = av1_get_shear_params(params);
 4448|   147k|  if (!good_shear_params) return 0;
  ------------------
  |  Branch (4448:7): [True: 0, False: 147k]
  ------------------
 4449|       |
 4450|   147k|  return 1;
 4451|   147k|}
decodeframe.c:read_film_grain:
 4156|  28.0k|                                   struct aom_read_bit_buffer *rb) {
 4157|  28.0k|  if (cm->seq_params->film_grain_params_present &&
  ------------------
  |  Branch (4157:7): [True: 0, False: 28.0k]
  ------------------
 4158|      0|      (cm->show_frame || cm->showable_frame)) {
  ------------------
  |  Branch (4158:8): [True: 0, False: 0]
  |  Branch (4158:26): [True: 0, False: 0]
  ------------------
 4159|      0|    read_film_grain_params(cm, rb);
 4160|  28.0k|  } else {
 4161|  28.0k|    memset(&cm->film_grain_params, 0, sizeof(cm->film_grain_params));
 4162|  28.0k|  }
 4163|  28.0k|  cm->film_grain_params.bit_depth = cm->seq_params->bit_depth;
 4164|  28.0k|  cm->cur_frame->film_grain_params = cm->film_grain_params;
 4165|  28.0k|}
decodeframe.c:setup_frame_info:
 5339|  28.0k|static inline void setup_frame_info(AV1Decoder *pbi) {
 5340|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 5341|       |
 5342|  28.0k|  if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (5342:7): [True: 244, False: 27.8k]
  ------------------
 5343|  27.8k|      cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (5343:7): [True: 24, False: 27.8k]
  ------------------
 5344|  27.8k|      cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
  ------------------
  |  Branch (5344:7): [True: 18, False: 27.7k]
  ------------------
 5345|    286|    av1_alloc_restoration_buffers(cm, /*is_sgr_enabled =*/true);
 5346|    890|    for (int p = 0; p < av1_num_planes(cm); p++) {
  ------------------
  |  Branch (5346:21): [True: 604, False: 286]
  ------------------
 5347|    604|      av1_alloc_restoration_struct(cm, &cm->rst_info[p], p > 0);
 5348|    604|    }
 5349|    286|  }
 5350|       |
 5351|  28.0k|  const int use_highbd = cm->seq_params->use_highbitdepth;
 5352|  28.0k|  const int buf_size = MC_TEMP_BUF_PELS << use_highbd;
  ------------------
  |  |   84|  28.0k|  (((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2) * \
  |  |  ------------------
  |  |  |  |   32|  28.0k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  28.0k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2) * \
  |  |  ------------------
  |  |  |  |   31|  28.0k|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  |  |   85|  28.0k|   ((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2))
  |  |  ------------------
  |  |  |  |   32|  28.0k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  28.0k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                  ((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2))
  |  |  ------------------
  |  |  |  |   31|  28.0k|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 5353|  28.0k|  if (pbi->td.mc_buf_size != buf_size) {
  ------------------
  |  Branch (5353:7): [True: 7.01k, False: 21.0k]
  ------------------
 5354|  7.01k|    av1_free_mc_tmp_buf(&pbi->td);
 5355|  7.01k|    allocate_mc_tmp_buf(cm, &pbi->td, buf_size, use_highbd);
 5356|  7.01k|  }
 5357|  28.0k|}
decodeframe.c:allocate_mc_tmp_buf:
 3485|   213k|                                       int use_highbd) {
 3486|   640k|  for (int ref = 0; ref < 2; ref++) {
  ------------------
  |  Branch (3486:21): [True: 426k, False: 213k]
  ------------------
 3487|       |    // The mc_buf/hbd_mc_buf must be zeroed to fix a intermittent valgrind error
 3488|       |    // 'Conditional jump or move depends on uninitialised value' from the loop
 3489|       |    // filter. Uninitialized reads in convolve function (e.g. horiz_4tap path in
 3490|       |    // av1_convolve_2d_sr_avx2()) from mc_buf/hbd_mc_buf are seen to be the
 3491|       |    // potential reason for this issue.
 3492|   426k|    if (use_highbd) {
  ------------------
  |  Branch (3492:9): [True: 108k, False: 318k]
  ------------------
 3493|   108k|      uint16_t *hbd_mc_buf;
 3494|   108k|      CHECK_MEM_ERROR(cm, hbd_mc_buf, (uint16_t *)aom_memalign(16, buf_size));
  ------------------
  |  |   51|   108k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   108k|  do {                                                    \
  |  |  |  |   72|   108k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   108k|    lval = (expr);                                        \
  |  |  |  |   74|   108k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 108k]
  |  |  |  |  ------------------
  |  |  |  |   75|   108k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   108k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 108k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3495|   108k|      memset(hbd_mc_buf, 0, buf_size);
 3496|   108k|      thread_data->mc_buf[ref] = CONVERT_TO_BYTEPTR(hbd_mc_buf);
  ------------------
  |  |   80|   108k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 3497|   318k|    } else {
 3498|   318k|      CHECK_MEM_ERROR(cm, thread_data->mc_buf[ref],
  ------------------
  |  |   51|   318k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   318k|  do {                                                    \
  |  |  |  |   72|   318k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   318k|    lval = (expr);                                        \
  |  |  |  |   74|   318k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 318k]
  |  |  |  |  ------------------
  |  |  |  |   75|   318k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   318k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 318k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3499|   318k|                      (uint8_t *)aom_memalign(16, buf_size));
 3500|   318k|      memset(thread_data->mc_buf[ref], 0, buf_size);
 3501|   318k|    }
 3502|   426k|  }
 3503|   213k|  thread_data->mc_buf_size = buf_size;
 3504|   213k|  thread_data->mc_buf_use_highbd = use_highbd;
 3505|       |
 3506|   213k|  CHECK_MEM_ERROR(cm, thread_data->tmp_conv_dst,
  ------------------
  |  |   51|   213k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   213k|  do {                                                    \
  |  |  |  |   72|   213k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   213k|    lval = (expr);                                        \
  |  |  |  |   74|   213k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  |  |   75|   213k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   213k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3507|   213k|                  aom_memalign(32, MAX_SB_SIZE * MAX_SB_SIZE *
 3508|   213k|                                       sizeof(*thread_data->tmp_conv_dst)));
 3509|   213k|  CHECK_MEM_ERROR(cm, thread_data->seg_mask,
  ------------------
  |  |   51|   213k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   213k|  do {                                                    \
  |  |  |  |   72|   213k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   213k|    lval = (expr);                                        \
  |  |  |  |   74|   213k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  |  |   75|   213k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   213k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3510|   213k|                  (uint8_t *)aom_memalign(
 3511|   213k|                      16, 2 * MAX_SB_SQUARE * sizeof(*thread_data->seg_mask)));
 3512|       |
 3513|   640k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (3513:19): [True: 426k, False: 213k]
  ------------------
 3514|       |    CHECK_MEM_ERROR(
  ------------------
  |  |   51|   426k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   426k|  do {                                                    \
  |  |  |  |   72|   426k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   426k|    lval = (expr);                                        \
  |  |  |  |   74|   426k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 426k]
  |  |  |  |  ------------------
  |  |  |  |   75|   426k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   426k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 426k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3515|   426k|        cm, thread_data->tmp_obmc_bufs[i],
 3516|   426k|        aom_memalign(16, 2 * MAX_MB_PLANE * MAX_SB_SQUARE *
 3517|   426k|                             sizeof(*thread_data->tmp_obmc_bufs[i])));
 3518|   426k|  }
 3519|   213k|}
decodeframe.c:decode_tiles_row_mt:
 3833|  26.2k|                                          int start_tile, int end_tile) {
 3834|  26.2k|  AV1_COMMON *const cm = &pbi->common;
 3835|  26.2k|  CommonTileParams *const tiles = &cm->tiles;
 3836|  26.2k|  const int tile_cols = tiles->cols;
 3837|  26.2k|  const int tile_rows = tiles->rows;
 3838|  26.2k|  const int n_tiles = tile_cols * tile_rows;
 3839|  26.2k|  TileBufferDec(*const tile_buffers)[MAX_TILE_COLS] = pbi->tile_buffers;
 3840|  26.2k|  const int dec_tile_row = AOMMIN(pbi->dec_tile_row, tile_rows);
  ------------------
  |  |   34|  26.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 26.2k, False: 0]
  |  |  ------------------
  ------------------
 3841|  26.2k|  const int single_row = pbi->dec_tile_row >= 0;
 3842|  26.2k|  const int dec_tile_col = AOMMIN(pbi->dec_tile_col, tile_cols);
  ------------------
  |  |   34|  26.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 26.2k, False: 0]
  |  |  ------------------
  ------------------
 3843|  26.2k|  const int single_col = pbi->dec_tile_col >= 0;
 3844|  26.2k|  int tile_rows_start;
 3845|  26.2k|  int tile_rows_end;
 3846|  26.2k|  int tile_cols_start;
 3847|  26.2k|  int tile_cols_end;
 3848|  26.2k|  int tile_count_tg;
 3849|  26.2k|  int num_workers = 0;
 3850|  26.2k|  int max_threads;
 3851|  26.2k|  const uint8_t *raw_data_end = NULL;
 3852|  26.2k|  int max_sb_rows = 0;
 3853|       |
 3854|  26.2k|  if (tiles->large_scale) {
  ------------------
  |  Branch (3854:7): [True: 0, False: 26.2k]
  ------------------
 3855|      0|    tile_rows_start = single_row ? dec_tile_row : 0;
  ------------------
  |  Branch (3855:23): [True: 0, False: 0]
  ------------------
 3856|      0|    tile_rows_end = single_row ? dec_tile_row + 1 : tile_rows;
  ------------------
  |  Branch (3856:21): [True: 0, False: 0]
  ------------------
 3857|      0|    tile_cols_start = single_col ? dec_tile_col : 0;
  ------------------
  |  Branch (3857:23): [True: 0, False: 0]
  ------------------
 3858|      0|    tile_cols_end = single_col ? tile_cols_start + 1 : tile_cols;
  ------------------
  |  Branch (3858:21): [True: 0, False: 0]
  ------------------
 3859|  26.2k|  } else {
 3860|  26.2k|    tile_rows_start = 0;
 3861|  26.2k|    tile_rows_end = tile_rows;
 3862|  26.2k|    tile_cols_start = 0;
 3863|  26.2k|    tile_cols_end = tile_cols;
 3864|  26.2k|  }
 3865|  26.2k|  tile_count_tg = end_tile - start_tile + 1;
 3866|  26.2k|  max_threads = pbi->max_threads;
 3867|       |
 3868|       |  // No tiles to decode.
 3869|  26.2k|  if (tile_rows_end <= tile_rows_start || tile_cols_end <= tile_cols_start ||
  ------------------
  |  Branch (3869:7): [True: 0, False: 26.2k]
  |  Branch (3869:43): [True: 0, False: 26.2k]
  ------------------
 3870|       |      // First tile is larger than end_tile.
 3871|  26.2k|      tile_rows_start * tile_cols + tile_cols_start > end_tile ||
  ------------------
  |  Branch (3871:7): [True: 0, False: 26.2k]
  ------------------
 3872|       |      // Last tile is smaller than start_tile.
 3873|  26.2k|      (tile_rows_end - 1) * tile_cols + tile_cols_end - 1 < start_tile)
  ------------------
  |  Branch (3873:7): [True: 0, False: 26.2k]
  ------------------
 3874|      0|    return data;
 3875|       |
 3876|  26.2k|  assert(tile_rows <= MAX_TILE_ROWS);
 3877|  26.2k|  assert(tile_cols <= MAX_TILE_COLS);
 3878|  26.2k|  assert(tile_count_tg > 0);
 3879|  26.2k|  assert(max_threads > 0);
 3880|  26.2k|  assert(start_tile <= end_tile);
 3881|  26.2k|  assert(start_tile >= 0 && end_tile < n_tiles);
 3882|       |
 3883|  26.2k|  (void)tile_count_tg;
 3884|       |
 3885|  26.2k|  decode_mt_init(pbi);
 3886|       |
 3887|       |  // get tile size in tile group
 3888|  26.2k|#if EXT_TILE_DEBUG
 3889|  26.2k|  if (tiles->large_scale) assert(pbi->ext_tile_debug == 1);
  ------------------
  |  Branch (3889:7): [True: 0, False: 26.2k]
  ------------------
 3890|  26.2k|  if (tiles->large_scale)
  ------------------
  |  Branch (3890:7): [True: 0, False: 26.2k]
  ------------------
 3891|      0|    raw_data_end = get_ls_tile_buffers(pbi, data, data_end, tile_buffers);
 3892|  26.2k|  else
 3893|  26.2k|#endif  // EXT_TILE_DEBUG
 3894|  26.2k|    get_tile_buffers(pbi, data, data_end, tile_buffers, start_tile, end_tile);
 3895|       |
 3896|  26.2k|  if (pbi->tile_data == NULL || n_tiles != pbi->allocated_tiles) {
  ------------------
  |  Branch (3896:7): [True: 6.56k, False: 19.6k]
  |  Branch (3896:33): [True: 2.77k, False: 16.9k]
  ------------------
 3897|  9.34k|    if (pbi->tile_data != NULL) {
  ------------------
  |  Branch (3897:9): [True: 2.77k, False: 6.56k]
  ------------------
 3898|  9.19k|      for (int i = 0; i < pbi->allocated_tiles; i++) {
  ------------------
  |  Branch (3898:23): [True: 6.41k, False: 2.77k]
  ------------------
 3899|  6.41k|        TileDataDec *const tile_data = pbi->tile_data + i;
 3900|  6.41k|        av1_dec_row_mt_dealloc(&tile_data->dec_row_mt_sync);
 3901|  6.41k|      }
 3902|  2.77k|    }
 3903|  9.34k|    decoder_alloc_tile_data(pbi, n_tiles);
 3904|  9.34k|  }
 3905|  26.2k|  if (pbi->dcb.xd.seg_mask == NULL)
  ------------------
  |  Branch (3905:7): [True: 6.56k, False: 19.6k]
  ------------------
 3906|  26.2k|    CHECK_MEM_ERROR(cm, pbi->dcb.xd.seg_mask,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3907|  26.2k|                    (uint8_t *)aom_memalign(
 3908|  26.2k|                        16, 2 * MAX_SB_SQUARE * sizeof(*pbi->dcb.xd.seg_mask)));
 3909|       |
 3910|  58.7k|  for (int row = 0; row < tile_rows; row++) {
  ------------------
  |  Branch (3910:21): [True: 32.4k, False: 26.2k]
  ------------------
 3911|  74.4k|    for (int col = 0; col < tile_cols; col++) {
  ------------------
  |  Branch (3911:23): [True: 42.0k, False: 32.4k]
  ------------------
 3912|  42.0k|      TileDataDec *tile_data = pbi->tile_data + row * tiles->cols + col;
 3913|  42.0k|      av1_tile_init(&tile_data->tile_info, cm, row, col);
 3914|       |
 3915|  42.0k|      max_sb_rows = AOMMAX(max_sb_rows,
  ------------------
  |  |   35|  42.0k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 357, False: 41.6k]
  |  |  ------------------
  ------------------
 3916|  42.0k|                           av1_get_sb_rows_in_tile(cm, &tile_data->tile_info));
 3917|  42.0k|      num_workers += get_max_row_mt_workers_per_tile(cm, &tile_data->tile_info);
 3918|  42.0k|    }
 3919|  32.4k|  }
 3920|  26.2k|  num_workers = AOMMIN(num_workers, max_threads);
  ------------------
  |  |   34|  26.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 25.9k, False: 307]
  |  |  ------------------
  ------------------
 3921|       |
 3922|  26.2k|  if (pbi->allocated_row_mt_sync_rows != max_sb_rows) {
  ------------------
  |  Branch (3922:7): [True: 9.74k, False: 16.5k]
  ------------------
 3923|  30.3k|    for (int i = 0; i < n_tiles; ++i) {
  ------------------
  |  Branch (3923:21): [True: 20.5k, False: 9.74k]
  ------------------
 3924|  20.5k|      TileDataDec *const tile_data = pbi->tile_data + i;
 3925|  20.5k|      av1_dec_row_mt_dealloc(&tile_data->dec_row_mt_sync);
 3926|  20.5k|      dec_row_mt_alloc(&tile_data->dec_row_mt_sync, cm, max_sb_rows);
 3927|  20.5k|    }
 3928|  9.74k|    pbi->allocated_row_mt_sync_rows = max_sb_rows;
 3929|  9.74k|  }
 3930|       |
 3931|  26.2k|  tile_mt_queue(pbi, tile_cols, tile_rows, tile_rows_start, tile_rows_end,
 3932|  26.2k|                tile_cols_start, tile_cols_end, start_tile, end_tile);
 3933|       |
 3934|  26.2k|  dec_alloc_cb_buf(pbi);
 3935|       |
 3936|  26.2k|  row_mt_frame_init(pbi, tile_rows_start, tile_rows_end, tile_cols_start,
 3937|  26.2k|                    tile_cols_end, start_tile, end_tile, max_sb_rows);
 3938|       |
 3939|  26.2k|  reset_dec_workers(pbi, row_mt_worker_hook, num_workers);
 3940|  26.2k|  launch_dec_workers(pbi, data_end, num_workers);
 3941|  26.2k|  sync_dec_workers(pbi, num_workers);
 3942|       |
 3943|  26.2k|  if (pbi->dcb.corrupted)
  ------------------
  |  Branch (3943:7): [True: 0, False: 26.2k]
  ------------------
 3944|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 3945|      0|                       "Failed to decode tile data");
 3946|       |
 3947|  26.2k|  if (tiles->large_scale) {
  ------------------
  |  Branch (3947:7): [True: 0, False: 26.2k]
  ------------------
 3948|      0|    if (n_tiles == 1) {
  ------------------
  |  Branch (3948:9): [True: 0, False: 0]
  ------------------
 3949|       |      // Find the end of the single tile buffer
 3950|      0|      return aom_reader_find_end(&pbi->tile_data->bit_reader);
 3951|      0|    }
 3952|       |    // Return the end of the last tile buffer
 3953|      0|    return raw_data_end;
 3954|      0|  }
 3955|  26.2k|  TileDataDec *const tile_data = pbi->tile_data + end_tile;
 3956|       |
 3957|  26.2k|  return aom_reader_find_end(&tile_data->bit_reader);
 3958|  26.2k|}
decodeframe.c:decode_mt_init:
 3584|  26.2k|static inline void decode_mt_init(AV1Decoder *pbi) {
 3585|  26.2k|  AV1_COMMON *const cm = &pbi->common;
 3586|  26.2k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 3587|  26.2k|  int worker_idx;
 3588|       |
 3589|       |  // Create workers and thread_data
 3590|  26.2k|  if (pbi->num_workers == 0) {
  ------------------
  |  Branch (3590:7): [True: 6.56k, False: 19.6k]
  ------------------
 3591|  6.56k|    const int num_threads = pbi->max_threads;
 3592|  6.56k|    CHECK_MEM_ERROR(cm, pbi->tile_workers,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3593|  6.56k|                    aom_malloc(num_threads * sizeof(*pbi->tile_workers)));
 3594|  6.56k|    CHECK_MEM_ERROR(cm, pbi->thread_data,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3595|  6.56k|                    aom_calloc(num_threads, sizeof(*pbi->thread_data)));
 3596|       |
 3597|   219k|    for (worker_idx = 0; worker_idx < num_threads; ++worker_idx) {
  ------------------
  |  Branch (3597:26): [True: 212k, False: 6.56k]
  ------------------
 3598|   212k|      AVxWorker *const worker = &pbi->tile_workers[worker_idx];
 3599|   212k|      DecWorkerData *const thread_data = pbi->thread_data + worker_idx;
 3600|       |
 3601|   212k|      winterface->init(worker);
 3602|   212k|      worker->thread_name = "aom tile worker";
 3603|   212k|      if (worker_idx != 0 && !winterface->reset(worker)) {
  ------------------
  |  Branch (3603:11): [True: 206k, False: 6.56k]
  |  Branch (3603:30): [True: 0, False: 206k]
  ------------------
 3604|      0|        aom_internal_error(&pbi->error, AOM_CODEC_ERROR,
 3605|      0|                           "Tile decoder thread creation failed");
 3606|      0|      }
 3607|   212k|      ++pbi->num_workers;
 3608|       |
 3609|   212k|      if (worker_idx != 0) {
  ------------------
  |  Branch (3609:11): [True: 206k, False: 6.56k]
  ------------------
 3610|       |        // Allocate thread data.
 3611|   206k|        CHECK_MEM_ERROR(cm, thread_data->td,
  ------------------
  |  |   51|   206k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   206k|  do {                                                    \
  |  |  |  |   72|   206k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   206k|    lval = (expr);                                        \
  |  |  |  |   74|   206k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 206k]
  |  |  |  |  ------------------
  |  |  |  |   75|   206k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   206k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 206k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3612|   206k|                        aom_memalign(32, sizeof(*thread_data->td)));
 3613|   206k|        av1_zero(*thread_data->td);
  ------------------
  |  |   43|   206k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3614|   206k|      } else {
 3615|       |        // Main thread acts as a worker and uses the thread data in pbi
 3616|  6.56k|        thread_data->td = &pbi->td;
 3617|  6.56k|      }
 3618|   212k|      thread_data->error_info.error_code = AOM_CODEC_OK;
 3619|   212k|      thread_data->error_info.setjmp = 0;
 3620|   212k|    }
 3621|  6.56k|  }
 3622|  26.2k|  const int use_highbd = cm->seq_params->use_highbitdepth;
 3623|  26.2k|  const int buf_size = MC_TEMP_BUF_PELS << use_highbd;
  ------------------
  |  |   84|  26.2k|  (((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2) * \
  |  |  ------------------
  |  |  |  |   32|  26.2k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  26.2k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2) * \
  |  |  ------------------
  |  |  |  |   31|  26.2k|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  |  |   85|  26.2k|   ((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2))
  |  |  ------------------
  |  |  |  |   32|  26.2k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  26.2k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                  ((MAX_SB_SIZE) * 2 + (AOM_INTERP_EXTEND) * 2))
  |  |  ------------------
  |  |  |  |   31|  26.2k|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 3624|   851k|  for (worker_idx = 1; worker_idx < pbi->max_threads; ++worker_idx) {
  ------------------
  |  Branch (3624:24): [True: 825k, False: 26.2k]
  ------------------
 3625|   825k|    DecWorkerData *const thread_data = pbi->thread_data + worker_idx;
 3626|   825k|    if (thread_data->td->mc_buf_size != buf_size) {
  ------------------
  |  Branch (3626:9): [True: 206k, False: 619k]
  ------------------
 3627|   206k|      av1_free_mc_tmp_buf(thread_data->td);
 3628|   206k|      allocate_mc_tmp_buf(cm, thread_data->td, buf_size, use_highbd);
 3629|   206k|    }
 3630|   825k|  }
 3631|  26.2k|}
decodeframe.c:mem_get_varsize:
 2268|  16.9k|static size_t mem_get_varsize(const uint8_t *src, int sz) {
 2269|  16.9k|  switch (sz) {
 2270|  5.36k|    case 1: return src[0];
  ------------------
  |  Branch (2270:5): [True: 5.36k, False: 11.5k]
  ------------------
 2271|  11.5k|    case 2: return mem_get_le16(src);
  ------------------
  |  |  101|  11.5k|#define mem_get_le16 mem_ops_wrap_symbol(mem_get_le16)
  |  |  ------------------
  |  |  |  |   51|  11.5k|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  11.5k|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  11.5k|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2271:5): [True: 11.5k, False: 5.36k]
  ------------------
 2272|      1|    case 3: return mem_get_le24(src);
  ------------------
  |  |  112|      1|#define mem_get_le24 mem_ops_wrap_symbol(mem_get_le24)
  |  |  ------------------
  |  |  |  |   51|      1|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      1|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      1|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2272:5): [True: 1, False: 16.9k]
  ------------------
 2273|      0|    case 4: return mem_get_le32(src);
  ------------------
  |  |  124|      0|#define mem_get_le32 mem_ops_wrap_symbol(mem_get_le32)
  |  |  ------------------
  |  |  |  |   51|      0|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2273:5): [True: 0, False: 16.9k]
  ------------------
 2274|      0|    default: assert(0 && "Invalid size"); return -1;
  ------------------
  |  Branch (2274:5): [True: 0, False: 16.9k]
  ------------------
 2275|  16.9k|  }
 2276|  16.9k|}
decodeframe.c:read_is_valid:
  135|  61.8k|static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) {
  136|  61.8k|  return len != 0 && len <= (size_t)(end - start);
  ------------------
  |  Branch (136:10): [True: 61.8k, False: 18.4E]
  |  Branch (136:22): [True: 61.8k, False: 18.4E]
  ------------------
  137|  61.8k|}
decodeframe.c:get_tile_buffers:
 2478|  28.0k|    int end_tile) {
 2479|  28.0k|  AV1_COMMON *const cm = &pbi->common;
 2480|  28.0k|  const int tile_cols = cm->tiles.cols;
 2481|  28.0k|  const int tile_rows = cm->tiles.rows;
 2482|  28.0k|  int tc = 0;
 2483|       |
 2484|  62.8k|  for (int r = 0; r < tile_rows; ++r) {
  ------------------
  |  Branch (2484:19): [True: 34.7k, False: 28.0k]
  ------------------
 2485|  79.7k|    for (int c = 0; c < tile_cols; ++c, ++tc) {
  ------------------
  |  Branch (2485:21): [True: 45.0k, False: 34.7k]
  ------------------
 2486|  45.0k|      TileBufferDec *const buf = &tile_buffers[r][c];
 2487|       |
 2488|  45.0k|      const int is_last = (tc == end_tile);
 2489|  45.0k|      const size_t hdr_offset = 0;
 2490|       |
 2491|  45.0k|      if (tc < start_tile || tc > end_tile) continue;
  ------------------
  |  Branch (2491:11): [True: 0, False: 45.0k]
  |  Branch (2491:30): [True: 0, False: 45.0k]
  ------------------
 2492|       |
 2493|  45.0k|      if (data + hdr_offset >= data_end)
  ------------------
  |  Branch (2493:11): [True: 0, False: 45.0k]
  ------------------
 2494|      0|        aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 2495|      0|                           "Data ended before all tiles were read.");
 2496|  45.0k|      data += hdr_offset;
 2497|  45.0k|      get_tile_buffer(data_end, pbi->tile_size_bytes, is_last, &pbi->error,
 2498|  45.0k|                      &data, buf);
 2499|  45.0k|    }
 2500|  34.7k|  }
 2501|  28.0k|}
decodeframe.c:get_tile_buffer:
 2451|  45.0k|                                   TileBufferDec *const buf) {
 2452|  45.0k|  size_t size;
 2453|       |
 2454|  45.0k|  if (!is_last) {
  ------------------
  |  Branch (2454:7): [True: 16.9k, False: 28.0k]
  ------------------
 2455|  16.9k|    if (!read_is_valid(*data, tile_size_bytes, data_end))
  ------------------
  |  Branch (2455:9): [True: 0, False: 16.9k]
  ------------------
 2456|      0|      aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME,
 2457|      0|                         "Not enough data to read tile size");
 2458|       |
 2459|  16.9k|    size = mem_get_varsize(*data, tile_size_bytes) + AV1_MIN_TILE_SIZE_BYTES;
  ------------------
  |  |   55|  16.9k|#define AV1_MIN_TILE_SIZE_BYTES 1
  ------------------
 2460|  16.9k|    *data += tile_size_bytes;
 2461|       |
 2462|  16.9k|    if (size > (size_t)(data_end - *data))
  ------------------
  |  Branch (2462:9): [True: 0, False: 16.9k]
  ------------------
 2463|      0|      aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME,
 2464|      0|                         "Truncated packet or corrupt tile size");
 2465|  28.0k|  } else {
 2466|  28.0k|    size = data_end - *data;
 2467|  28.0k|  }
 2468|       |
 2469|  45.0k|  buf->data = *data;
 2470|  45.0k|  buf->size = size;
 2471|       |
 2472|  45.0k|  *data += size;
 2473|  45.0k|}
decodeframe.c:decoder_alloc_tile_data:
 2525|  9.99k|static inline void decoder_alloc_tile_data(AV1Decoder *pbi, const int n_tiles) {
 2526|  9.99k|  AV1_COMMON *const cm = &pbi->common;
 2527|  9.99k|  aom_free(pbi->tile_data);
 2528|  9.99k|  pbi->allocated_tiles = 0;
 2529|  9.99k|  CHECK_MEM_ERROR(cm, pbi->tile_data,
  ------------------
  |  |   51|  9.99k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  9.99k|  do {                                                    \
  |  |  |  |   72|  9.99k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  9.99k|    lval = (expr);                                        \
  |  |  |  |   74|  9.99k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 9.99k]
  |  |  |  |  ------------------
  |  |  |  |   75|  9.99k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  9.99k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 9.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2530|  9.99k|                  aom_memalign(32, n_tiles * sizeof(*pbi->tile_data)));
 2531|  9.99k|  pbi->allocated_tiles = n_tiles;
 2532|  31.4k|  for (int i = 0; i < n_tiles; i++) {
  ------------------
  |  Branch (2532:19): [True: 21.4k, False: 9.99k]
  ------------------
 2533|  21.4k|    TileDataDec *const tile_data = pbi->tile_data + i;
 2534|  21.4k|    av1_zero(tile_data->dec_row_mt_sync);
  ------------------
  |  |   43|  21.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2535|  21.4k|  }
 2536|  9.99k|  pbi->allocated_row_mt_sync_rows = 0;
 2537|  9.99k|}
decodeframe.c:get_max_row_mt_workers_per_tile:
 3096|  89.2k|                                                  const TileInfo *tile) {
 3097|       |  // NOTE: Currently value of max workers is calculated based
 3098|       |  // on the parse and decode time. As per the theoretical estimate
 3099|       |  // when percentage of parse time is equal to percentage of decode
 3100|       |  // time, number of workers needed to parse + decode a tile can not
 3101|       |  // exceed more than 2.
 3102|       |  // TODO(any): Modify this value if parsing is optimized in future.
 3103|  89.2k|  int sb_rows = av1_get_sb_rows_in_tile(cm, tile);
 3104|  89.2k|  int max_workers =
 3105|  89.2k|      sb_rows == 1 ? AOM_MIN_THREADS_PER_TILE : AOM_MAX_THREADS_PER_TILE;
  ------------------
  |  |   78|  81.6k|#define AOM_MIN_THREADS_PER_TILE 1
  ------------------
                    sb_rows == 1 ? AOM_MIN_THREADS_PER_TILE : AOM_MAX_THREADS_PER_TILE;
  ------------------
  |  |   79|  7.61k|#define AOM_MAX_THREADS_PER_TILE 2
  ------------------
  |  Branch (3105:7): [True: 81.6k, False: 7.61k]
  ------------------
 3106|  89.2k|  return max_workers;
 3107|  89.2k|}
decodeframe.c:dec_row_mt_alloc:
 2559|  20.5k|                                    AV1_COMMON *cm, int rows) {
 2560|  20.5k|  dec_row_mt_sync->allocated_sb_rows = rows;
 2561|  20.5k|#if CONFIG_MULTITHREAD
 2562|  20.5k|  {
 2563|  20.5k|    int i;
 2564|       |
 2565|  20.5k|    CHECK_MEM_ERROR(cm, dec_row_mt_sync->mutex_,
  ------------------
  |  |   51|  20.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  20.5k|  do {                                                    \
  |  |  |  |   72|  20.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  20.5k|    lval = (expr);                                        \
  |  |  |  |   74|  20.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  20.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  20.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2566|  20.5k|                    aom_malloc(sizeof(*(dec_row_mt_sync->mutex_)) * rows));
 2567|  20.5k|    if (dec_row_mt_sync->mutex_) {
  ------------------
  |  Branch (2567:9): [True: 20.5k, False: 0]
  ------------------
 2568|  43.4k|      for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (2568:19): [True: 22.8k, False: 20.5k]
  ------------------
 2569|  22.8k|        pthread_mutex_init(&dec_row_mt_sync->mutex_[i], NULL);
 2570|  22.8k|      }
 2571|  20.5k|    }
 2572|       |
 2573|  20.5k|    CHECK_MEM_ERROR(cm, dec_row_mt_sync->cond_,
  ------------------
  |  |   51|  20.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  20.5k|  do {                                                    \
  |  |  |  |   72|  20.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  20.5k|    lval = (expr);                                        \
  |  |  |  |   74|  20.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  20.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  20.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2574|  20.5k|                    aom_malloc(sizeof(*(dec_row_mt_sync->cond_)) * rows));
 2575|  20.5k|    if (dec_row_mt_sync->cond_) {
  ------------------
  |  Branch (2575:9): [True: 20.5k, False: 0]
  ------------------
 2576|  43.4k|      for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (2576:19): [True: 22.8k, False: 20.5k]
  ------------------
 2577|  22.8k|        pthread_cond_init(&dec_row_mt_sync->cond_[i], NULL);
 2578|  22.8k|      }
 2579|  20.5k|    }
 2580|  20.5k|  }
 2581|  20.5k|#endif  // CONFIG_MULTITHREAD
 2582|       |
 2583|  20.5k|  CHECK_MEM_ERROR(cm, dec_row_mt_sync->cur_sb_col,
  ------------------
  |  |   51|  20.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  20.5k|  do {                                                    \
  |  |  |  |   72|  20.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  20.5k|    lval = (expr);                                        \
  |  |  |  |   74|  20.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  20.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  20.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|  20.5k|                  aom_malloc(sizeof(*(dec_row_mt_sync->cur_sb_col)) * rows));
 2585|       |
 2586|       |  // Set up nsync.
 2587|  20.5k|  dec_row_mt_sync->sync_range = get_sync_range(cm->width);
 2588|  20.5k|}
decodeframe.c:get_sync_range:
 2540|  20.5k|static inline int get_sync_range(int width) {
 2541|       |// nsync numbers are picked by testing.
 2542|       |#if 0
 2543|       |  if (width < 640)
 2544|       |    return 1;
 2545|       |  else if (width <= 1280)
 2546|       |    return 2;
 2547|       |  else if (width <= 4096)
 2548|       |    return 4;
 2549|       |  else
 2550|       |    return 8;
 2551|       |#else
 2552|  20.5k|  (void)width;
 2553|  20.5k|#endif
 2554|  20.5k|  return 1;
 2555|  20.5k|}
decodeframe.c:tile_mt_queue:
 3636|  26.2k|                                 int start_tile, int end_tile) {
 3637|  26.2k|  AV1_COMMON *const cm = &pbi->common;
 3638|  26.2k|  if (pbi->tile_mt_info.alloc_tile_cols != tile_cols ||
  ------------------
  |  Branch (3638:7): [True: 8.08k, False: 18.1k]
  ------------------
 3639|  18.1k|      pbi->tile_mt_info.alloc_tile_rows != tile_rows) {
  ------------------
  |  Branch (3639:7): [True: 1.26k, False: 16.9k]
  ------------------
 3640|  9.34k|    av1_dealloc_dec_jobs(&pbi->tile_mt_info);
 3641|  9.34k|    alloc_dec_jobs(&pbi->tile_mt_info, cm, tile_rows, tile_cols);
 3642|  9.34k|  }
 3643|  26.2k|  enqueue_tile_jobs(pbi, cm, tile_rows_start, tile_rows_end, tile_cols_start,
 3644|  26.2k|                    tile_cols_end, start_tile, end_tile);
 3645|  26.2k|  qsort(pbi->tile_mt_info.job_queue, pbi->tile_mt_info.jobs_enqueued,
 3646|  26.2k|        sizeof(pbi->tile_mt_info.job_queue[0]), compare_tile_buffers);
 3647|  26.2k|}
decodeframe.c:alloc_dec_jobs:
 3443|  9.34k|                                  int tile_rows, int tile_cols) {
 3444|  9.34k|  tile_mt_info->alloc_tile_rows = tile_rows;
 3445|  9.34k|  tile_mt_info->alloc_tile_cols = tile_cols;
 3446|  9.34k|  int num_tiles = tile_rows * tile_cols;
 3447|  9.34k|#if CONFIG_MULTITHREAD
 3448|  9.34k|  {
 3449|  9.34k|    CHECK_MEM_ERROR(cm, tile_mt_info->job_mutex,
  ------------------
  |  |   51|  9.34k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  9.34k|  do {                                                    \
  |  |  |  |   72|  9.34k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  9.34k|    lval = (expr);                                        \
  |  |  |  |   74|  9.34k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 9.34k]
  |  |  |  |  ------------------
  |  |  |  |   75|  9.34k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  9.34k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 9.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3450|  9.34k|                    aom_malloc(sizeof(*tile_mt_info->job_mutex) * num_tiles));
 3451|       |
 3452|  29.3k|    for (int i = 0; i < num_tiles; i++) {
  ------------------
  |  Branch (3452:21): [True: 19.9k, False: 9.34k]
  ------------------
 3453|  19.9k|      pthread_mutex_init(&tile_mt_info->job_mutex[i], NULL);
 3454|  19.9k|    }
 3455|  9.34k|  }
 3456|  9.34k|#endif
 3457|       |  CHECK_MEM_ERROR(cm, tile_mt_info->job_queue,
  ------------------
  |  |   51|  9.34k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  9.34k|  do {                                                    \
  |  |  |  |   72|  9.34k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  9.34k|    lval = (expr);                                        \
  |  |  |  |   74|  9.34k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 9.34k]
  |  |  |  |  ------------------
  |  |  |  |   75|  9.34k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  9.34k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 9.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3458|  9.34k|                  aom_malloc(sizeof(*tile_mt_info->job_queue) * num_tiles));
 3459|  9.34k|}
decodeframe.c:enqueue_tile_jobs:
 3423|  26.2k|                                     int start_tile, int end_tile) {
 3424|  26.2k|  AV1DecTileMT *tile_mt_info = &pbi->tile_mt_info;
 3425|  26.2k|  TileJobsDec *tile_job_queue = tile_mt_info->job_queue;
 3426|  26.2k|  tile_mt_info->jobs_enqueued = 0;
 3427|  26.2k|  tile_mt_info->jobs_dequeued = 0;
 3428|       |
 3429|  58.7k|  for (int row = tile_rows_start; row < tile_rows_end; row++) {
  ------------------
  |  Branch (3429:35): [True: 32.4k, False: 26.2k]
  ------------------
 3430|  74.4k|    for (int col = tile_cols_start; col < tile_cols_end; col++) {
  ------------------
  |  Branch (3430:37): [True: 42.0k, False: 32.4k]
  ------------------
 3431|  42.0k|      if (row * cm->tiles.cols + col < start_tile ||
  ------------------
  |  Branch (3431:11): [True: 0, False: 42.0k]
  ------------------
 3432|  42.0k|          row * cm->tiles.cols + col > end_tile)
  ------------------
  |  Branch (3432:11): [True: 0, False: 42.0k]
  ------------------
 3433|      0|        continue;
 3434|  42.0k|      tile_job_queue->tile_buffer = &pbi->tile_buffers[row][col];
 3435|  42.0k|      tile_job_queue->tile_data = pbi->tile_data + row * cm->tiles.cols + col;
 3436|  42.0k|      tile_job_queue++;
 3437|  42.0k|      tile_mt_info->jobs_enqueued++;
 3438|  42.0k|    }
 3439|  32.4k|  }
 3440|  26.2k|}
decodeframe.c:compare_tile_buffers:
 3414|  26.5k|static int compare_tile_buffers(const void *a, const void *b) {
 3415|  26.5k|  const TileJobsDec *const buf1 = (const TileJobsDec *)a;
 3416|  26.5k|  const TileJobsDec *const buf2 = (const TileJobsDec *)b;
 3417|  26.5k|  return (((int)buf2->tile_buffer->size) - ((int)buf1->tile_buffer->size));
 3418|  26.5k|}
decodeframe.c:dec_alloc_cb_buf:
 3749|  26.2k|static inline void dec_alloc_cb_buf(AV1Decoder *pbi) {
 3750|  26.2k|  AV1_COMMON *const cm = &pbi->common;
 3751|  26.2k|  int size = ((cm->mi_params.mi_rows >> cm->seq_params->mib_size_log2) + 1) *
 3752|  26.2k|             ((cm->mi_params.mi_cols >> cm->seq_params->mib_size_log2) + 1);
 3753|       |
 3754|  26.2k|  if (pbi->cb_buffer_alloc_size < size) {
  ------------------
  |  Branch (3754:7): [True: 10.3k, False: 15.8k]
  ------------------
 3755|  10.3k|    av1_dec_free_cb_buf(pbi);
 3756|       |    CHECK_MEM_ERROR(cm, pbi->cb_buffer_base,
  ------------------
  |  |   51|  10.3k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  10.3k|  do {                                                    \
  |  |  |  |   72|  10.3k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  10.3k|    lval = (expr);                                        \
  |  |  |  |   74|  10.3k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 10.3k]
  |  |  |  |  ------------------
  |  |  |  |   75|  10.3k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  10.3k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 10.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3757|  10.3k|                    aom_memalign(32, sizeof(*pbi->cb_buffer_base) * size));
 3758|  10.3k|    memset(pbi->cb_buffer_base, 0, sizeof(*pbi->cb_buffer_base) * size);
 3759|  10.3k|    pbi->cb_buffer_alloc_size = size;
 3760|  10.3k|  }
 3761|  26.2k|}
decodeframe.c:row_mt_frame_init:
 3766|  26.2k|                                     int end_tile, int max_sb_rows) {
 3767|  26.2k|  AV1_COMMON *const cm = &pbi->common;
 3768|  26.2k|  AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info;
 3769|       |
 3770|  26.2k|  frame_row_mt_info->tile_rows_start = tile_rows_start;
 3771|  26.2k|  frame_row_mt_info->tile_rows_end = tile_rows_end;
 3772|  26.2k|  frame_row_mt_info->tile_cols_start = tile_cols_start;
 3773|  26.2k|  frame_row_mt_info->tile_cols_end = tile_cols_end;
 3774|  26.2k|  frame_row_mt_info->start_tile = start_tile;
 3775|  26.2k|  frame_row_mt_info->end_tile = end_tile;
 3776|  26.2k|  frame_row_mt_info->mi_rows_to_decode = 0;
 3777|  26.2k|  frame_row_mt_info->mi_rows_parse_done = 0;
 3778|  26.2k|  frame_row_mt_info->mi_rows_decode_started = 0;
 3779|  26.2k|  frame_row_mt_info->row_mt_exit = 0;
 3780|       |
 3781|  58.7k|  for (int tile_row = tile_rows_start; tile_row < tile_rows_end; ++tile_row) {
  ------------------
  |  Branch (3781:40): [True: 32.4k, False: 26.2k]
  ------------------
 3782|  74.4k|    for (int tile_col = tile_cols_start; tile_col < tile_cols_end; ++tile_col) {
  ------------------
  |  Branch (3782:42): [True: 42.0k, False: 32.4k]
  ------------------
 3783|  42.0k|      if (tile_row * cm->tiles.cols + tile_col < start_tile ||
  ------------------
  |  Branch (3783:11): [True: 0, False: 42.0k]
  ------------------
 3784|  42.0k|          tile_row * cm->tiles.cols + tile_col > end_tile)
  ------------------
  |  Branch (3784:11): [True: 0, False: 42.0k]
  ------------------
 3785|      0|        continue;
 3786|       |
 3787|  42.0k|      TileDataDec *const tile_data =
 3788|  42.0k|          pbi->tile_data + tile_row * cm->tiles.cols + tile_col;
 3789|  42.0k|      const TileInfo *const tile_info = &tile_data->tile_info;
 3790|       |
 3791|  42.0k|      tile_data->dec_row_mt_sync.mi_rows_parse_done = 0;
 3792|  42.0k|      tile_data->dec_row_mt_sync.mi_rows_decode_started = 0;
 3793|  42.0k|      tile_data->dec_row_mt_sync.num_threads_working = 0;
 3794|  42.0k|      tile_data->dec_row_mt_sync.mi_rows =
 3795|  42.0k|          ALIGN_POWER_OF_TWO(tile_info->mi_row_end - tile_info->mi_row_start,
  ------------------
  |  |   69|  42.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3796|  42.0k|                             cm->seq_params->mib_size_log2);
 3797|  42.0k|      tile_data->dec_row_mt_sync.mi_cols =
 3798|  42.0k|          ALIGN_POWER_OF_TWO(tile_info->mi_col_end - tile_info->mi_col_start,
  ------------------
  |  |   69|  42.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
 3799|  42.0k|                             cm->seq_params->mib_size_log2);
 3800|  42.0k|      tile_data->dec_row_mt_sync.intrabc_extra_top_right_sb_delay =
 3801|  42.0k|          av1_get_intrabc_extra_top_right_sb_delay(cm);
 3802|       |
 3803|  42.0k|      frame_row_mt_info->mi_rows_to_decode +=
 3804|  42.0k|          tile_data->dec_row_mt_sync.mi_rows;
 3805|       |
 3806|       |      // Initialize cur_sb_col to -1 for all SB rows.
 3807|  42.0k|      memset(tile_data->dec_row_mt_sync.cur_sb_col, -1,
 3808|  42.0k|             sizeof(*tile_data->dec_row_mt_sync.cur_sb_col) * max_sb_rows);
 3809|  42.0k|    }
 3810|  32.4k|  }
 3811|       |
 3812|  26.2k|#if CONFIG_MULTITHREAD
 3813|  26.2k|  if (pbi->row_mt_mutex_ == NULL) {
  ------------------
  |  Branch (3813:7): [True: 6.56k, False: 19.6k]
  ------------------
 3814|  6.56k|    CHECK_MEM_ERROR(cm, pbi->row_mt_mutex_,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3815|  6.56k|                    aom_malloc(sizeof(*(pbi->row_mt_mutex_))));
 3816|  6.56k|    if (pbi->row_mt_mutex_) {
  ------------------
  |  Branch (3816:9): [True: 6.56k, False: 0]
  ------------------
 3817|  6.56k|      pthread_mutex_init(pbi->row_mt_mutex_, NULL);
 3818|  6.56k|    }
 3819|  6.56k|  }
 3820|       |
 3821|  26.2k|  if (pbi->row_mt_cond_ == NULL) {
  ------------------
  |  Branch (3821:7): [True: 6.56k, False: 19.6k]
  ------------------
 3822|  6.56k|    CHECK_MEM_ERROR(cm, pbi->row_mt_cond_,
  ------------------
  |  |   51|  6.56k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.56k|  do {                                                    \
  |  |  |  |   72|  6.56k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.56k|    lval = (expr);                                        \
  |  |  |  |   74|  6.56k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.56k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.56k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.56k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3823|  6.56k|                    aom_malloc(sizeof(*(pbi->row_mt_cond_))));
 3824|  6.56k|    if (pbi->row_mt_cond_) {
  ------------------
  |  Branch (3824:9): [True: 6.56k, False: 0]
  ------------------
 3825|       |      pthread_cond_init(pbi->row_mt_cond_, NULL);
 3826|  6.56k|    }
 3827|  6.56k|  }
 3828|  26.2k|#endif
 3829|  26.2k|}
decodeframe.c:reset_dec_workers:
 3522|  26.2k|                                     int num_workers) {
 3523|  26.2k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 3524|       |
 3525|       |  // Reset tile decoding hook
 3526|  69.8k|  for (int worker_idx = 0; worker_idx < num_workers; ++worker_idx) {
  ------------------
  |  Branch (3526:28): [True: 43.6k, False: 26.2k]
  ------------------
 3527|  43.6k|    AVxWorker *const worker = &pbi->tile_workers[worker_idx];
 3528|  43.6k|    DecWorkerData *const thread_data = pbi->thread_data + worker_idx;
 3529|  43.6k|    thread_data->td->dcb = pbi->dcb;
 3530|  43.6k|    thread_data->td->dcb.corrupted = 0;
 3531|  43.6k|    thread_data->td->dcb.mc_buf[0] = thread_data->td->mc_buf[0];
 3532|  43.6k|    thread_data->td->dcb.mc_buf[1] = thread_data->td->mc_buf[1];
 3533|  43.6k|    thread_data->td->dcb.xd.tmp_conv_dst = thread_data->td->tmp_conv_dst;
 3534|  43.6k|    if (worker_idx)
  ------------------
  |  Branch (3534:9): [True: 17.3k, False: 26.2k]
  ------------------
 3535|  17.3k|      thread_data->td->dcb.xd.seg_mask = thread_data->td->seg_mask;
 3536|   130k|    for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (3536:21): [True: 87.2k, False: 43.6k]
  ------------------
 3537|  87.2k|      thread_data->td->dcb.xd.tmp_obmc_bufs[j] =
 3538|  87.2k|          thread_data->td->tmp_obmc_bufs[j];
 3539|  87.2k|    }
 3540|  43.6k|    winterface->sync(worker);
 3541|       |
 3542|  43.6k|    worker->hook = worker_hook;
 3543|  43.6k|    worker->data1 = thread_data;
 3544|  43.6k|    worker->data2 = pbi;
 3545|  43.6k|  }
 3546|       |#if CONFIG_ACCOUNTING
 3547|       |  if (pbi->acct_enabled) {
 3548|       |    aom_accounting_reset(&pbi->accounting);
 3549|       |  }
 3550|       |#endif
 3551|  26.2k|}
decodeframe.c:row_mt_worker_hook:
 3286|  43.5k|static int row_mt_worker_hook(void *arg1, void *arg2) {
 3287|  43.5k|  DecWorkerData *const thread_data = (DecWorkerData *)arg1;
 3288|  43.5k|  AV1Decoder *const pbi = (AV1Decoder *)arg2;
 3289|  43.5k|  ThreadData *const td = thread_data->td;
 3290|  43.5k|  uint8_t allow_update_cdf;
 3291|  43.5k|  AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info;
 3292|  43.5k|  td->dcb.corrupted = 0;
 3293|       |
 3294|       |  // The jmp_buf is valid only for the duration of the function that calls
 3295|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 3296|       |  // before it returns.
 3297|  43.5k|  if (setjmp(thread_data->error_info.jmp)) {
  ------------------
  |  Branch (3297:7): [True: 0, False: 43.5k]
  ------------------
 3298|      0|    thread_data->error_info.setjmp = 0;
 3299|      0|    thread_data->td->dcb.corrupted = 1;
 3300|      0|#if CONFIG_MULTITHREAD
 3301|      0|    pthread_mutex_lock(pbi->row_mt_mutex_);
 3302|      0|#endif
 3303|      0|    frame_row_mt_info->row_mt_exit = 1;
 3304|      0|#if CONFIG_MULTITHREAD
 3305|      0|    pthread_cond_broadcast(pbi->row_mt_cond_);
 3306|      0|    pthread_mutex_unlock(pbi->row_mt_mutex_);
 3307|      0|#endif
 3308|       |    // If any SB row (erroneous row) processed by a thread encounters an
 3309|       |    // internal error, there is a need to indicate other threads that decoding
 3310|       |    // of the erroneous row is complete. This ensures that other threads which
 3311|       |    // wait upon the completion of SB's present in erroneous row are not waiting
 3312|       |    // indefinitely.
 3313|      0|    signal_decoding_done_for_erroneous_row(pbi, &thread_data->td->dcb.xd);
 3314|      0|    return 0;
 3315|      0|  }
 3316|  43.5k|  thread_data->error_info.setjmp = 1;
 3317|       |
 3318|  43.5k|  AV1_COMMON *cm = &pbi->common;
 3319|  43.5k|  allow_update_cdf = cm->tiles.large_scale ? 0 : 1;
  ------------------
  |  Branch (3319:22): [True: 0, False: 43.5k]
  ------------------
 3320|  43.5k|  allow_update_cdf = allow_update_cdf && !cm->features.disable_cdf_update;
  ------------------
  |  Branch (3320:22): [True: 43.5k, False: 18.4E]
  |  Branch (3320:42): [True: 43.5k, False: 1]
  ------------------
 3321|       |
 3322|  43.5k|  set_decode_func_pointers(td, 0x1);
 3323|       |
 3324|  43.5k|  assert(cm->tiles.cols > 0);
 3325|  85.5k|  while (!td->dcb.corrupted) {
  ------------------
  |  Branch (3325:10): [True: 85.5k, False: 16]
  ------------------
 3326|  85.5k|    TileJobsDec *cur_job_info = get_dec_job_info(&pbi->tile_mt_info);
 3327|       |
 3328|  85.5k|    if (cur_job_info != NULL) {
  ------------------
  |  Branch (3328:9): [True: 42.0k, False: 43.5k]
  ------------------
 3329|  42.0k|      const TileBufferDec *const tile_buffer = cur_job_info->tile_buffer;
 3330|  42.0k|      TileDataDec *const tile_data = cur_job_info->tile_data;
 3331|  42.0k|      tile_worker_hook_init(pbi, thread_data, tile_buffer, tile_data,
 3332|  42.0k|                            allow_update_cdf);
 3333|  42.0k|#if CONFIG_MULTITHREAD
 3334|  42.0k|      pthread_mutex_lock(pbi->row_mt_mutex_);
 3335|  42.0k|#endif
 3336|  42.0k|      tile_data->dec_row_mt_sync.num_threads_working++;
 3337|  42.0k|#if CONFIG_MULTITHREAD
 3338|  42.0k|      pthread_mutex_unlock(pbi->row_mt_mutex_);
 3339|  42.0k|#endif
 3340|       |      // decode tile
 3341|  42.0k|      parse_tile_row_mt(pbi, td, tile_data);
 3342|  42.0k|#if CONFIG_MULTITHREAD
 3343|  42.0k|      pthread_mutex_lock(pbi->row_mt_mutex_);
 3344|  42.0k|#endif
 3345|  42.0k|      tile_data->dec_row_mt_sync.num_threads_working--;
 3346|  42.0k|#if CONFIG_MULTITHREAD
 3347|  42.0k|      pthread_mutex_unlock(pbi->row_mt_mutex_);
 3348|  42.0k|#endif
 3349|  43.5k|    } else {
 3350|  43.5k|      break;
 3351|  43.5k|    }
 3352|  85.5k|  }
 3353|       |
 3354|  43.5k|  if (td->dcb.corrupted) {
  ------------------
  |  Branch (3354:7): [True: 0, False: 43.5k]
  ------------------
 3355|      0|    thread_data->error_info.setjmp = 0;
 3356|      0|#if CONFIG_MULTITHREAD
 3357|      0|    pthread_mutex_lock(pbi->row_mt_mutex_);
 3358|      0|#endif
 3359|      0|    frame_row_mt_info->row_mt_exit = 1;
 3360|      0|#if CONFIG_MULTITHREAD
 3361|      0|    pthread_cond_broadcast(pbi->row_mt_cond_);
 3362|      0|    pthread_mutex_unlock(pbi->row_mt_mutex_);
 3363|      0|#endif
 3364|      0|    return 0;
 3365|      0|  }
 3366|       |
 3367|  43.5k|  set_decode_func_pointers(td, 0x2);
 3368|       |
 3369|  88.6k|  while (1) {
  ------------------
  |  Branch (3369:10): [True: 88.6k, Folded]
  ------------------
 3370|  88.6k|    AV1DecRowMTJobInfo next_job_info;
 3371|  88.6k|    int end_of_frame = 0;
 3372|       |
 3373|  88.6k|#if CONFIG_MULTITHREAD
 3374|  88.6k|    pthread_mutex_lock(pbi->row_mt_mutex_);
 3375|  88.6k|#endif
 3376|   107k|    while (!get_next_job_info(pbi, &next_job_info, &end_of_frame)) {
  ------------------
  |  Branch (3376:12): [True: 18.9k, False: 88.6k]
  ------------------
 3377|  18.9k|#if CONFIG_MULTITHREAD
 3378|  18.9k|      pthread_cond_wait(pbi->row_mt_cond_, pbi->row_mt_mutex_);
 3379|  18.9k|#endif
 3380|  18.9k|    }
 3381|  88.6k|#if CONFIG_MULTITHREAD
 3382|  88.6k|    pthread_mutex_unlock(pbi->row_mt_mutex_);
 3383|  88.6k|#endif
 3384|       |
 3385|  88.6k|    if (end_of_frame) break;
  ------------------
  |  Branch (3385:9): [True: 43.6k, False: 45.0k]
  ------------------
 3386|       |
 3387|  45.0k|    int tile_row = next_job_info.tile_row;
 3388|  45.0k|    int tile_col = next_job_info.tile_col;
 3389|  45.0k|    int mi_row = next_job_info.mi_row;
 3390|       |
 3391|  45.0k|    TileDataDec *tile_data =
 3392|  45.0k|        pbi->tile_data + tile_row * cm->tiles.cols + tile_col;
 3393|  45.0k|    AV1DecRowMTSync *dec_row_mt_sync = &tile_data->dec_row_mt_sync;
 3394|       |
 3395|  45.0k|    av1_tile_init(&td->dcb.xd.tile, cm, tile_row, tile_col);
 3396|  45.0k|    av1_init_macroblockd(cm, &td->dcb.xd);
 3397|  45.0k|    td->dcb.xd.error_info = &thread_data->error_info;
 3398|       |
 3399|  45.0k|    decode_tile_sb_row(pbi, td, &tile_data->tile_info, mi_row);
 3400|       |
 3401|  45.0k|#if CONFIG_MULTITHREAD
 3402|  45.0k|    pthread_mutex_lock(pbi->row_mt_mutex_);
 3403|  45.0k|#endif
 3404|  45.0k|    dec_row_mt_sync->num_threads_working--;
 3405|  45.0k|#if CONFIG_MULTITHREAD
 3406|  45.0k|    pthread_mutex_unlock(pbi->row_mt_mutex_);
 3407|  45.0k|#endif
 3408|  45.0k|  }
 3409|  43.5k|  thread_data->error_info.setjmp = 0;
 3410|  43.5k|  return !td->dcb.corrupted;
 3411|  43.5k|}
decodeframe.c:sync_write:
 2639|  48.4k|                              int c, const int sb_cols) {
 2640|  48.4k|#if CONFIG_MULTITHREAD
 2641|  48.4k|  const int nsync = dec_row_mt_sync->sync_range;
 2642|  48.4k|  int cur;
 2643|  48.4k|  int sig = 1;
 2644|       |
 2645|  48.4k|  if (c < sb_cols - 1) {
  ------------------
  |  Branch (2645:7): [True: 3.37k, False: 45.0k]
  ------------------
 2646|  3.37k|    cur = c;
 2647|  3.37k|    if (c % nsync) sig = 0;
  ------------------
  |  Branch (2647:9): [True: 0, False: 3.37k]
  ------------------
 2648|  45.0k|  } else {
 2649|  45.0k|    cur = sb_cols + nsync + dec_row_mt_sync->intrabc_extra_top_right_sb_delay;
 2650|  45.0k|  }
 2651|       |
 2652|  48.4k|  if (sig) {
  ------------------
  |  Branch (2652:7): [True: 48.4k, False: 18.4E]
  ------------------
 2653|  48.4k|    pthread_mutex_lock(&dec_row_mt_sync->mutex_[r]);
 2654|       |
 2655|  48.4k|    dec_row_mt_sync->cur_sb_col[r] = cur;
 2656|       |
 2657|  48.4k|    pthread_cond_signal(&dec_row_mt_sync->cond_[r]);
 2658|  48.4k|    pthread_mutex_unlock(&dec_row_mt_sync->mutex_[r]);
 2659|  48.4k|  }
 2660|       |#else
 2661|       |  (void)dec_row_mt_sync;
 2662|       |  (void)r;
 2663|       |  (void)c;
 2664|       |  (void)sb_cols;
 2665|       |#endif  // CONFIG_MULTITHREAD
 2666|  48.4k|}
decodeframe.c:set_decode_func_pointers:
 2747|  88.9k|                                            int parse_decode_flag) {
 2748|  88.9k|  td->read_coeffs_tx_intra_block_visit = decode_block_void;
 2749|  88.9k|  td->predict_and_recon_intra_block_visit = decode_block_void;
 2750|  88.9k|  td->read_coeffs_tx_inter_block_visit = decode_block_void;
 2751|  88.9k|  td->inverse_tx_inter_block_visit = decode_block_void;
 2752|  88.9k|  td->predict_inter_block_visit = predict_inter_block_void;
 2753|  88.9k|  td->cfl_store_inter_block_visit = cfl_store_inter_block_void;
 2754|       |
 2755|  88.9k|  if (parse_decode_flag & 0x1) {
  ------------------
  |  Branch (2755:7): [True: 45.3k, False: 43.6k]
  ------------------
 2756|  45.3k|    td->read_coeffs_tx_intra_block_visit = read_coeffs_tx_intra_block;
 2757|  45.3k|    td->read_coeffs_tx_inter_block_visit = av1_read_coeffs_txb;
 2758|  45.3k|  }
 2759|  88.9k|  if (parse_decode_flag & 0x2) {
  ------------------
  |  Branch (2759:7): [True: 45.4k, False: 43.5k]
  ------------------
 2760|  45.4k|    td->predict_and_recon_intra_block_visit =
 2761|  45.4k|        predict_and_reconstruct_intra_block;
 2762|  45.4k|    td->inverse_tx_inter_block_visit = inverse_transform_inter_block;
 2763|  45.4k|    td->predict_inter_block_visit = predict_inter_block;
 2764|  45.4k|    td->cfl_store_inter_block_visit = cfl_store_inter_block;
 2765|  45.4k|  }
 2766|  88.9k|}
decodeframe.c:decode_block_void:
  190|  3.67M|                                     const TX_SIZE tx_size) {
  191|  3.67M|  (void)cm;
  192|  3.67M|  (void)dcb;
  193|  3.67M|  (void)r;
  194|  3.67M|  (void)plane;
  195|  3.67M|  (void)row;
  196|  3.67M|  (void)col;
  197|  3.67M|  (void)tx_size;
  198|  3.67M|}
decodeframe.c:predict_inter_block_void:
  202|   176k|                                            BLOCK_SIZE bsize) {
  203|   176k|  (void)cm;
  204|   176k|  (void)dcb;
  205|   176k|  (void)bsize;
  206|   176k|}
decodeframe.c:cfl_store_inter_block_void:
  209|   176k|                                              MACROBLOCKD *const xd) {
  210|   176k|  (void)cm;
  211|   176k|  (void)xd;
  212|   176k|}
decodeframe.c:read_coeffs_tx_intra_block:
  169|  1.59M|    const int plane, const int row, const int col, const TX_SIZE tx_size) {
  170|  1.59M|  MB_MODE_INFO *mbmi = dcb->xd.mi[0];
  171|  1.59M|  if (!mbmi->skip_txfm) {
  ------------------
  |  Branch (171:7): [True: 1.59M, False: 18.4E]
  ------------------
  172|       |#if TXCOEFF_TIMER
  173|       |    struct aom_usec_timer timer;
  174|       |    aom_usec_timer_start(&timer);
  175|       |#endif
  176|  1.59M|    av1_read_coeffs_txb(cm, dcb, r, plane, row, col, tx_size);
  177|       |#if TXCOEFF_TIMER
  178|       |    aom_usec_timer_mark(&timer);
  179|       |    const int64_t elapsed_time = aom_usec_timer_elapsed(&timer);
  180|       |    cm->txcoeff_timer += elapsed_time;
  181|       |    ++cm->txb_count;
  182|       |#endif
  183|  1.59M|  }
  184|  1.59M|}
decodeframe.c:predict_and_reconstruct_intra_block:
  216|  1.56M|    const int plane, const int row, const int col, const TX_SIZE tx_size) {
  217|  1.56M|  (void)r;
  218|  1.56M|  MACROBLOCKD *const xd = &dcb->xd;
  219|  1.56M|  MB_MODE_INFO *mbmi = xd->mi[0];
  220|  1.56M|  PLANE_TYPE plane_type = get_plane_type(plane);
  221|       |
  222|  1.56M|  av1_predict_intra_block_facade(cm, xd, plane, col, row, tx_size);
  223|       |
  224|  1.59M|  if (!mbmi->skip_txfm) {
  ------------------
  |  Branch (224:7): [True: 1.59M, False: 18.4E]
  ------------------
  225|  1.59M|    eob_info *eob_data = dcb->eob_data[plane] + dcb->txb_offset[plane];
  226|  1.59M|    if (eob_data->eob) {
  ------------------
  |  Branch (226:9): [True: 1.49M, False: 98.5k]
  ------------------
  227|  1.49M|      const bool reduced_tx_set_used = cm->features.reduced_tx_set_used;
  228|       |      // tx_type was read out in av1_read_coeffs_txb.
  229|  1.49M|      const TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, row, col, tx_size,
  230|  1.49M|                                              reduced_tx_set_used);
  231|  1.49M|      struct macroblockd_plane *const pd = &xd->plane[plane];
  232|  1.49M|      uint8_t *dst = &pd->dst.buf[(row * pd->dst.stride + col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  1.49M|#define MI_SIZE_LOG2 2
  ------------------
  233|  1.49M|      inverse_transform_block(dcb, plane, tx_type, tx_size, dst, pd->dst.stride,
  234|  1.49M|                              reduced_tx_set_used);
  235|  1.49M|    }
  236|  1.59M|  }
  237|  1.56M|  if (plane == AOM_PLANE_Y && store_cfl_required(cm, xd)) {
  ------------------
  |  |  281|  3.13M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (237:7): [True: 1.06M, False: 509k]
  |  Branch (237:31): [True: 187k, False: 872k]
  ------------------
  238|   187k|    cfl_store_tx(xd, row, col, tx_size, mbmi->bsize);
  239|   187k|  }
  240|  1.56M|}
decodeframe.c:inverse_transform_block:
  157|  1.91M|                                           int stride, int reduced_tx_set) {
  158|  1.91M|  tran_low_t *const dqcoeff = dcb->dqcoeff_block[plane] + dcb->cb_offset[plane];
  159|  1.91M|  eob_info *eob_data = dcb->eob_data[plane] + dcb->txb_offset[plane];
  160|  1.91M|  uint16_t scan_line = eob_data->max_scan_line;
  161|  1.91M|  uint16_t eob = eob_data->eob;
  162|  1.91M|  av1_inverse_transform_block(&dcb->xd, dqcoeff, plane, tx_type, tx_size, dst,
  163|  1.91M|                              stride, eob, reduced_tx_set);
  164|  1.91M|  memset(dqcoeff, 0, (scan_line + 1) * sizeof(dqcoeff[0]));
  165|  1.91M|}
decodeframe.c:inverse_transform_inter_block:
  245|   437k|    const TX_SIZE tx_size) {
  246|   437k|  (void)r;
  247|   437k|  MACROBLOCKD *const xd = &dcb->xd;
  248|   437k|  PLANE_TYPE plane_type = get_plane_type(plane);
  249|   437k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  250|   437k|  const bool reduced_tx_set_used = cm->features.reduced_tx_set_used;
  251|       |  // tx_type was read out in av1_read_coeffs_txb.
  252|   437k|  const TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, blk_row, blk_col,
  253|   437k|                                          tx_size, reduced_tx_set_used);
  254|       |
  255|   437k|  uint8_t *dst =
  256|   437k|      &pd->dst.buf[(blk_row * pd->dst.stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|   437k|#define MI_SIZE_LOG2 2
  ------------------
  257|   437k|  inverse_transform_block(dcb, plane, tx_type, tx_size, dst, pd->dst.stride,
  258|   437k|                          reduced_tx_set_used);
  259|       |#if CONFIG_MISMATCH_DEBUG
  260|       |  int pixel_c, pixel_r;
  261|       |  BLOCK_SIZE bsize = txsize_to_bsize[tx_size];
  262|       |  int blk_w = block_size_wide[bsize];
  263|       |  int blk_h = block_size_high[bsize];
  264|       |  const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
  265|       |  const int mi_col = -xd->mb_to_left_edge >> (3 + MI_SIZE_LOG2);
  266|       |  mi_to_pixel_loc(&pixel_c, &pixel_r, mi_col, mi_row, blk_col, blk_row,
  267|       |                  pd->subsampling_x, pd->subsampling_y);
  268|       |  mismatch_check_block_tx(dst, pd->dst.stride, cm->current_frame.order_hint,
  269|       |                          plane, pixel_c, pixel_r, blk_w, blk_h,
  270|       |                          xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH);
  271|       |#endif
  272|   437k|}
decodeframe.c:predict_inter_block:
  854|   191k|                                       BLOCK_SIZE bsize) {
  855|   191k|  MACROBLOCKD *const xd = &dcb->xd;
  856|   191k|  MB_MODE_INFO *mbmi = xd->mi[0];
  857|   191k|  const int num_planes = av1_num_planes(cm);
  858|   191k|  const int mi_row = xd->mi_row;
  859|   191k|  const int mi_col = xd->mi_col;
  860|   382k|  for (int ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (860:21): [True: 190k, False: 191k]
  ------------------
  861|   190k|    const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
  862|   190k|    if (frame < LAST_FRAME) {
  ------------------
  |  Branch (862:9): [True: 0, False: 190k]
  ------------------
  863|      0|      assert(is_intrabc_block(mbmi));
  864|      0|      assert(frame == INTRA_FRAME);
  865|      0|      assert(ref == 0);
  866|   190k|    } else {
  867|   190k|      const RefCntBuffer *ref_buf = get_ref_frame_buf(cm, frame);
  868|   190k|      const struct scale_factors *ref_scale_factors =
  869|   190k|          get_ref_scale_factors_const(cm, frame);
  870|       |
  871|   190k|      xd->block_ref_scale_factors[ref] = ref_scale_factors;
  872|   190k|      av1_setup_pre_planes(xd, ref, &ref_buf->buf, mi_row, mi_col,
  873|   190k|                           ref_scale_factors, num_planes);
  874|   190k|    }
  875|   190k|  }
  876|       |
  877|   191k|  dec_build_inter_predictor(cm, dcb, mi_row, mi_col, bsize);
  878|   191k|  if (mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (878:7): [True: 0, False: 191k]
  ------------------
  879|      0|    dec_build_obmc_inter_predictors_sb(cm, dcb);
  880|      0|  }
  881|       |#if CONFIG_MISMATCH_DEBUG
  882|       |  for (int plane = 0; plane < num_planes; ++plane) {
  883|       |    const struct macroblockd_plane *pd = &xd->plane[plane];
  884|       |    int pixel_c, pixel_r;
  885|       |    mi_to_pixel_loc(&pixel_c, &pixel_r, mi_col, mi_row, 0, 0, pd->subsampling_x,
  886|       |                    pd->subsampling_y);
  887|       |    if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x,
  888|       |                             pd->subsampling_y))
  889|       |      continue;
  890|       |    mismatch_check_block_pre(pd->dst.buf, pd->dst.stride,
  891|       |                             cm->current_frame.order_hint, plane, pixel_c,
  892|       |                             pixel_r, pd->width, pd->height,
  893|       |                             xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH);
  894|       |  }
  895|       |#endif
  896|   191k|}
decodeframe.c:dec_build_inter_predictor:
  684|   191k|                                             BLOCK_SIZE bsize) {
  685|   191k|  MACROBLOCKD *const xd = &dcb->xd;
  686|   191k|  const int num_planes = av1_num_planes(cm);
  687|   485k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (687:23): [True: 294k, False: 190k]
  ------------------
  688|   294k|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (688:9): [True: 103k, False: 190k]
  |  Branch (688:18): [True: 601, False: 103k]
  ------------------
  689|   293k|    const int mi_x = mi_col * MI_SIZE;
  ------------------
  |  |   40|   293k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   293k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  690|   293k|    const int mi_y = mi_row * MI_SIZE;
  ------------------
  |  |   40|   293k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   293k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  691|   293k|    dec_build_inter_predictors(cm, dcb, plane, xd->mi[0], 0,
  692|   293k|                               xd->plane[plane].width, xd->plane[plane].height,
  693|   293k|                               mi_x, mi_y);
  694|   293k|    if (is_interintra_pred(xd->mi[0])) {
  ------------------
  |  Branch (694:9): [True: 0, False: 293k]
  ------------------
  695|      0|      BUFFER_SET ctx = { { xd->plane[0].dst.buf, xd->plane[1].dst.buf,
  696|      0|                           xd->plane[2].dst.buf },
  697|      0|                         { xd->plane[0].dst.stride, xd->plane[1].dst.stride,
  698|      0|                           xd->plane[2].dst.stride } };
  699|      0|      av1_build_interintra_predictor(cm, xd, xd->plane[plane].dst.buf,
  700|      0|                                     xd->plane[plane].dst.stride, &ctx, plane,
  701|      0|                                     bsize);
  702|      0|    }
  703|   293k|  }
  704|   191k|}
decodeframe.c:dec_build_inter_predictors:
  676|   294k|                                       int mi_x, int mi_y) {
  677|   294k|  build_inter_predictors(cm, &dcb->xd, plane, mi, build_for_obmc, bw, bh, mi_x,
  678|   294k|                         mi_y, dcb->mc_buf);
  679|   294k|}
decodeframe.c:dec_calc_subpel_params_and_extend:
  654|   294k|    uint8_t **pre, SubpelParams *subpel_params, int *src_stride) {
  655|   294k|  PadBlock block;
  656|   294k|  MV32 scaled_mv;
  657|   294k|  int subpel_x_mv, subpel_y_mv;
  658|   294k|  dec_calc_subpel_params(src_mv, inter_pred_params, xd, mi_x, mi_y, pre,
  659|   294k|                         subpel_params, src_stride, &block, &scaled_mv,
  660|   294k|                         &subpel_x_mv, &subpel_y_mv);
  661|   294k|  extend_mc_border(
  662|   294k|      inter_pred_params->scale_factors, &inter_pred_params->ref_frame_buf,
  663|   294k|      scaled_mv, block, subpel_x_mv, subpel_y_mv,
  664|   294k|      inter_pred_params->mode == WARP_PRED, inter_pred_params->is_intrabc,
  665|   294k|      inter_pred_params->use_hbd_buf, mc_buf[ref], pre, src_stride);
  666|   294k|}
decodeframe.c:dec_calc_subpel_params:
  569|   294k|    MV32 *scaled_mv, int *subpel_x_mv, int *subpel_y_mv) {
  570|   294k|  const struct scale_factors *sf = inter_pred_params->scale_factors;
  571|   294k|  struct buf_2d *pre_buf = &inter_pred_params->ref_frame_buf;
  572|   294k|  const int bw = inter_pred_params->block_width;
  573|   294k|  const int bh = inter_pred_params->block_height;
  574|   294k|  const int is_scaled = av1_is_scaled(sf);
  575|   294k|  if (is_scaled) {
  ------------------
  |  Branch (575:7): [True: 261k, False: 33.1k]
  ------------------
  576|   261k|    int ssx = inter_pred_params->subsampling_x;
  577|   261k|    int ssy = inter_pred_params->subsampling_y;
  578|   261k|    int orig_pos_y = inter_pred_params->pix_row << SUBPEL_BITS;
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
  579|   261k|    orig_pos_y += src_mv->row * (1 << (1 - ssy));
  580|   261k|    int orig_pos_x = inter_pred_params->pix_col << SUBPEL_BITS;
  ------------------
  |  |   23|   261k|#define SUBPEL_BITS 4
  ------------------
  581|   261k|    orig_pos_x += src_mv->col * (1 << (1 - ssx));
  582|   261k|    int pos_y = av1_scaled_y(orig_pos_y, sf);
  583|   261k|    int pos_x = av1_scaled_x(orig_pos_x, sf);
  584|   261k|    pos_x += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|   261k|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|   261k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   261k|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  585|   261k|    pos_y += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|   261k|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|   261k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   261k|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|       |
  587|   261k|    const int top = -AOM_LEFT_TOP_MARGIN_SCALED(ssy);
  ------------------
  |  |   32|   261k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   261k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   261k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   261k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  588|   261k|    const int left = -AOM_LEFT_TOP_MARGIN_SCALED(ssx);
  ------------------
  |  |   32|   261k|  (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   30|   261k|  ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   261k|#define AOM_BORDER_IN_PIXELS 288
  |  |  |  |  ------------------
  |  |  |  |                 ((AOM_BORDER_IN_PIXELS >> subsampling) - AOM_INTERP_EXTEND)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   261k|#define AOM_INTERP_EXTEND 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (AOM_LEFT_TOP_MARGIN_PX(subsampling) << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  589|   261k|    const int bottom = (pre_buf->height + AOM_INTERP_EXTEND)
  ------------------
  |  |   31|   261k|#define AOM_INTERP_EXTEND 4
  ------------------
  590|   261k|                       << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  591|   261k|    const int right = (pre_buf->width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   31|   261k|#define AOM_INTERP_EXTEND 4
  ------------------
                  const int right = (pre_buf->width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  592|   261k|    pos_y = clamp(pos_y, top, bottom);
  593|   261k|    pos_x = clamp(pos_x, left, right);
  594|       |
  595|   261k|    subpel_params->subpel_x = pos_x & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|   261k|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   261k|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|   261k|    subpel_params->subpel_y = pos_y & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|   261k|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   261k|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|   261k|    subpel_params->xs = sf->x_step_q4;
  598|   261k|    subpel_params->ys = sf->y_step_q4;
  599|       |
  600|       |    // Get reference block top left coordinate.
  601|   261k|    block->x0 = pos_x >> SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  602|   261k|    block->y0 = pos_y >> SCALE_SUBPEL_BITS;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  603|       |
  604|       |    // Get reference block bottom right coordinate.
  605|   261k|    block->x1 =
  606|   261k|        ((pos_x + (bw - 1) * subpel_params->xs) >> SCALE_SUBPEL_BITS) + 1;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  607|   261k|    block->y1 =
  608|   261k|        ((pos_y + (bh - 1) * subpel_params->ys) >> SCALE_SUBPEL_BITS) + 1;
  ------------------
  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  ------------------
  609|       |
  610|   261k|    MV temp_mv;
  611|   261k|    temp_mv = clamp_mv_to_umv_border_sb(xd, src_mv, bw, bh,
  612|   261k|                                        inter_pred_params->subsampling_x,
  613|   261k|                                        inter_pred_params->subsampling_y);
  614|   261k|    *scaled_mv = av1_scale_mv(&temp_mv, mi_x, mi_y, sf);
  615|   261k|    scaled_mv->row += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|   261k|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|   261k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   261k|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  616|   261k|    scaled_mv->col += SCALE_EXTRA_OFF;
  ------------------
  |  |   32|   261k|#define SCALE_EXTRA_OFF ((1 << SCALE_EXTRA_BITS) / 2)
  |  |  ------------------
  |  |  |  |   31|   261k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   261k|#define SUBPEL_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  617|       |
  618|   261k|    *subpel_x_mv = scaled_mv->col & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|   261k|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   261k|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  619|   261k|    *subpel_y_mv = scaled_mv->row & SCALE_SUBPEL_MASK;
  ------------------
  |  |   30|   261k|#define SCALE_SUBPEL_MASK (SCALE_SUBPEL_SHIFTS - 1)
  |  |  ------------------
  |  |  |  |   29|   261k|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   261k|#define SCALE_SUBPEL_BITS 10
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|   261k|  } else {
  621|       |    // Get block position in current frame.
  622|  33.1k|    int pos_x = inter_pred_params->pix_col << SUBPEL_BITS;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  623|  33.1k|    int pos_y = inter_pred_params->pix_row << SUBPEL_BITS;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  624|       |
  625|  33.1k|    const MV mv_q4 = clamp_mv_to_umv_border_sb(
  626|  33.1k|        xd, src_mv, bw, bh, inter_pred_params->subsampling_x,
  627|  33.1k|        inter_pred_params->subsampling_y);
  628|  33.1k|    subpel_params->xs = subpel_params->ys = SCALE_SUBPEL_SHIFTS;
  ------------------
  |  |   29|  33.1k|#define SCALE_SUBPEL_SHIFTS (1 << SCALE_SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  33.1k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  ------------------
  629|  33.1k|    subpel_params->subpel_x = (mv_q4.col & SUBPEL_MASK) << SCALE_EXTRA_BITS;
  ------------------
  |  |   24|  33.1k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
                  subpel_params->subpel_x = (mv_q4.col & SUBPEL_MASK) << SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  33.1k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  33.1k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  630|  33.1k|    subpel_params->subpel_y = (mv_q4.row & SUBPEL_MASK) << SCALE_EXTRA_BITS;
  ------------------
  |  |   24|  33.1k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
                  subpel_params->subpel_y = (mv_q4.row & SUBPEL_MASK) << SCALE_EXTRA_BITS;
  ------------------
  |  |   31|  33.1k|#define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   28|  33.1k|#define SCALE_SUBPEL_BITS 10
  |  |  ------------------
  |  |               #define SCALE_EXTRA_BITS (SCALE_SUBPEL_BITS - SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  631|       |
  632|       |    // Get reference block top left coordinate.
  633|  33.1k|    pos_x += mv_q4.col;
  634|  33.1k|    pos_y += mv_q4.row;
  635|  33.1k|    block->x0 = pos_x >> SUBPEL_BITS;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  636|  33.1k|    block->y0 = pos_y >> SUBPEL_BITS;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  637|       |
  638|       |    // Get reference block bottom right coordinate.
  639|  33.1k|    block->x1 = (pos_x >> SUBPEL_BITS) + (bw - 1) + 1;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  640|  33.1k|    block->y1 = (pos_y >> SUBPEL_BITS) + (bh - 1) + 1;
  ------------------
  |  |   23|  33.1k|#define SUBPEL_BITS 4
  ------------------
  641|       |
  642|  33.1k|    scaled_mv->row = mv_q4.row;
  643|  33.1k|    scaled_mv->col = mv_q4.col;
  644|  33.1k|    *subpel_x_mv = scaled_mv->col & SUBPEL_MASK;
  ------------------
  |  |   24|  33.1k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  645|  33.1k|    *subpel_y_mv = scaled_mv->row & SUBPEL_MASK;
  ------------------
  |  |   24|  33.1k|#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
  |  |  ------------------
  |  |  |  |   23|  33.1k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  646|  33.1k|  }
  647|   294k|  *pre = pre_buf->buf0 + block->y0 * pre_buf->stride + block->x0;
  648|   294k|  *src_stride = pre_buf->stride;
  649|   294k|}
decodeframe.c:extend_mc_border:
  532|   294k|                                    int *src_stride) {
  533|   294k|  int x_pad = 0, y_pad = 0;
  534|   294k|  if (update_extend_mc_border_params(sf, pre_buf, scaled_mv, &block,
  ------------------
  |  Branch (534:7): [True: 164k, False: 130k]
  ------------------
  535|   294k|                                     subpel_x_mv, subpel_y_mv, do_warp,
  536|   294k|                                     is_intrabc, &x_pad, &y_pad)) {
  537|       |    // Get reference block pointer.
  538|   164k|    const uint8_t *const buf_ptr =
  539|   164k|        pre_buf->buf0 + block.y0 * pre_buf->stride + block.x0;
  540|   164k|    int buf_stride = pre_buf->stride;
  541|   164k|    const int b_w = block.x1 - block.x0;
  542|   164k|    const int b_h = block.y1 - block.y0;
  543|       |
  544|   164k|#if CONFIG_AV1_HIGHBITDEPTH
  545|       |    // Extend the border.
  546|   164k|    if (highbd) {
  ------------------
  |  Branch (546:9): [True: 25.5k, False: 138k]
  ------------------
  547|  25.5k|      highbd_build_mc_border(buf_ptr, buf_stride, mc_buf, b_w, block.x0,
  548|  25.5k|                             block.y0, b_w, b_h, pre_buf->width,
  549|  25.5k|                             pre_buf->height);
  550|   138k|    } else {
  551|   138k|      build_mc_border(buf_ptr, buf_stride, mc_buf, b_w, block.x0, block.y0, b_w,
  552|   138k|                      b_h, pre_buf->width, pre_buf->height);
  553|   138k|    }
  554|       |#else
  555|       |    (void)highbd;
  556|       |    build_mc_border(buf_ptr, buf_stride, mc_buf, b_w, block.x0, block.y0, b_w,
  557|       |                    b_h, pre_buf->width, pre_buf->height);
  558|       |#endif
  559|   164k|    *src_stride = b_w;
  560|   164k|    *pre = mc_buf + y_pad * (AOM_INTERP_EXTEND - 1) * b_w +
  ------------------
  |  |   31|   164k|#define AOM_INTERP_EXTEND 4
  ------------------
  561|   164k|           x_pad * (AOM_INTERP_EXTEND - 1);
  ------------------
  |  |   31|   164k|#define AOM_INTERP_EXTEND 4
  ------------------
  562|   164k|  }
  563|   294k|}
decodeframe.c:update_extend_mc_border_params:
  494|   294k|    int do_warp, int is_intrabc, int *x_pad, int *y_pad) {
  495|   294k|  const int is_scaled = av1_is_scaled(sf);
  496|       |  // Get reference width and height.
  497|   294k|  int frame_width = pre_buf->width;
  498|   294k|  int frame_height = pre_buf->height;
  499|       |
  500|       |  // Do border extension if there is motion or
  501|       |  // width/height is not a multiple of 8 pixels.
  502|   294k|  if ((!is_intrabc) && (!do_warp) &&
  ------------------
  |  Branch (502:7): [True: 294k, False: 104]
  |  Branch (502:24): [True: 291k, False: 2.93k]
  ------------------
  503|   291k|      (is_scaled || scaled_mv.col || scaled_mv.row || (frame_width & 0x7) ||
  ------------------
  |  Branch (503:8): [True: 261k, False: 30.2k]
  |  Branch (503:21): [True: 25.5k, False: 4.70k]
  |  Branch (503:38): [True: 1.23k, False: 3.46k]
  |  Branch (503:55): [True: 3.02k, False: 444]
  ------------------
  504|   291k|       (frame_height & 0x7))) {
  ------------------
  |  Branch (504:8): [True: 373, False: 71]
  ------------------
  505|   291k|    if (subpel_x_mv || (sf->x_step_q4 != SUBPEL_SHIFTS)) {
  ------------------
  |  |   25|  6.79k|#define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.79k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (505:9): [True: 284k, False: 6.79k]
  |  Branch (505:24): [True: 6.79k, False: 0]
  ------------------
  506|   291k|      block->x0 -= AOM_INTERP_EXTEND - 1;
  ------------------
  |  |   31|   291k|#define AOM_INTERP_EXTEND 4
  ------------------
  507|   291k|      block->x1 += AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   291k|#define AOM_INTERP_EXTEND 4
  ------------------
  508|   291k|      *x_pad = 1;
  509|   291k|    }
  510|       |
  511|   291k|    if (subpel_y_mv || (sf->y_step_q4 != SUBPEL_SHIFTS)) {
  ------------------
  |  |   25|  6.96k|#define SUBPEL_SHIFTS (1 << SUBPEL_BITS)
  |  |  ------------------
  |  |  |  |   23|  6.96k|#define SUBPEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (511:9): [True: 284k, False: 6.96k]
  |  Branch (511:24): [True: 6.96k, False: 0]
  ------------------
  512|   291k|      block->y0 -= AOM_INTERP_EXTEND - 1;
  ------------------
  |  |   31|   291k|#define AOM_INTERP_EXTEND 4
  ------------------
  513|   291k|      block->y1 += AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   291k|#define AOM_INTERP_EXTEND 4
  ------------------
  514|   291k|      *y_pad = 1;
  515|   291k|    }
  516|       |
  517|       |    // Skip border extension if block is inside the frame.
  518|   291k|    if (block->x0 < 0 || block->x1 > frame_width - 1 || block->y0 < 0 ||
  ------------------
  |  Branch (518:9): [True: 52.1k, False: 239k]
  |  Branch (518:26): [True: 50.4k, False: 188k]
  |  Branch (518:57): [True: 29.7k, False: 159k]
  ------------------
  519|   164k|        block->y1 > frame_height - 1) {
  ------------------
  |  Branch (519:9): [True: 31.0k, False: 128k]
  ------------------
  520|   164k|      return 1;
  521|   164k|    }
  522|   291k|  }
  523|   130k|  return 0;
  524|   294k|}
decodeframe.c:highbd_build_mc_border:
  418|  25.5k|                                          int h) {
  419|       |  // Get a pointer to the start of the real data for this row.
  420|  25.5k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  25.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  421|  25.5k|  uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  25.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  422|  25.5k|  const uint16_t *ref_row = src - x - y * src_stride;
  423|       |
  424|  25.5k|  if (y >= h)
  ------------------
  |  Branch (424:7): [True: 68, False: 25.4k]
  ------------------
  425|     68|    ref_row += (h - 1) * src_stride;
  426|  25.4k|  else if (y > 0)
  ------------------
  |  Branch (426:12): [True: 12.3k, False: 13.1k]
  ------------------
  427|  12.3k|    ref_row += y * src_stride;
  428|       |
  429|   328k|  do {
  430|   328k|    int right = 0, copy;
  431|   328k|    int left = x < 0 ? -x : 0;
  ------------------
  |  Branch (431:16): [True: 152k, False: 175k]
  ------------------
  432|       |
  433|   328k|    if (left > b_w) left = b_w;
  ------------------
  |  Branch (433:9): [True: 160, False: 327k]
  ------------------
  434|       |
  435|   328k|    if (x + b_w > w) right = x + b_w - w;
  ------------------
  |  Branch (435:9): [True: 180k, False: 147k]
  ------------------
  436|       |
  437|   328k|    if (right > b_w) right = b_w;
  ------------------
  |  Branch (437:9): [True: 1.08k, False: 326k]
  ------------------
  438|       |
  439|   328k|    copy = b_w - left - right;
  440|       |
  441|   328k|    if (left) aom_memset16(dst, ref_row[0], left);
  ------------------
  |  Branch (441:9): [True: 152k, False: 175k]
  ------------------
  442|       |
  443|   328k|    if (copy) memcpy(dst + left, ref_row + x + left, copy * sizeof(uint16_t));
  ------------------
  |  Branch (443:9): [True: 325k, False: 2.06k]
  ------------------
  444|       |
  445|   328k|    if (right) aom_memset16(dst + left + copy, ref_row[w - 1], right);
  ------------------
  |  Branch (445:9): [True: 180k, False: 147k]
  ------------------
  446|       |
  447|   328k|    dst += dst_stride;
  448|   328k|    ++y;
  449|       |
  450|   328k|    if (y > 0 && y < h) ref_row += src_stride;
  ------------------
  |  Branch (450:9): [True: 282k, False: 45.2k]
  |  Branch (450:18): [True: 195k, False: 86.7k]
  ------------------
  451|   328k|  } while (--b_h);
  ------------------
  |  Branch (451:12): [True: 302k, False: 25.5k]
  ------------------
  452|  25.5k|}
decodeframe.c:build_mc_border:
  457|   138k|                                   int b_w, int b_h, int w, int h) {
  458|       |  // Get a pointer to the start of the real data for this row.
  459|   138k|  const uint8_t *ref_row = src - x - y * src_stride;
  460|       |
  461|   138k|  if (y >= h)
  ------------------
  |  Branch (461:7): [True: 1.23k, False: 137k]
  ------------------
  462|  1.23k|    ref_row += (h - 1) * src_stride;
  463|   137k|  else if (y > 0)
  ------------------
  |  Branch (463:12): [True: 93.9k, False: 43.5k]
  ------------------
  464|  93.9k|    ref_row += y * src_stride;
  465|       |
  466|  1.95M|  do {
  467|  1.95M|    int right = 0, copy;
  468|  1.95M|    int left = x < 0 ? -x : 0;
  ------------------
  |  Branch (468:16): [True: 599k, False: 1.35M]
  ------------------
  469|       |
  470|  1.95M|    if (left > b_w) left = b_w;
  ------------------
  |  Branch (470:9): [True: 1.49k, False: 1.95M]
  ------------------
  471|       |
  472|  1.95M|    if (x + b_w > w) right = x + b_w - w;
  ------------------
  |  Branch (472:9): [True: 848k, False: 1.10M]
  ------------------
  473|       |
  474|  1.95M|    if (right > b_w) right = b_w;
  ------------------
  |  Branch (474:9): [True: 7.29k, False: 1.94M]
  ------------------
  475|       |
  476|  1.95M|    copy = b_w - left - right;
  477|       |
  478|  1.95M|    if (left) memset(dst, ref_row[0], left);
  ------------------
  |  Branch (478:9): [True: 599k, False: 1.35M]
  ------------------
  479|       |
  480|  1.95M|    if (copy) memcpy(dst + left, ref_row + x + left, copy);
  ------------------
  |  Branch (480:9): [True: 1.94M, False: 14.0k]
  ------------------
  481|       |
  482|  1.95M|    if (right) memset(dst + left + copy, ref_row[w - 1], right);
  ------------------
  |  Branch (482:9): [True: 848k, False: 1.10M]
  ------------------
  483|       |
  484|  1.95M|    dst += dst_stride;
  485|  1.95M|    ++y;
  486|       |
  487|  1.95M|    if (y > 0 && y < h) ref_row += src_stride;
  ------------------
  |  Branch (487:9): [True: 1.80M, False: 151k]
  |  Branch (487:18): [True: 1.40M, False: 399k]
  ------------------
  488|  1.95M|  } while (--b_h);
  ------------------
  |  Branch (488:12): [True: 1.81M, False: 138k]
  ------------------
  489|   138k|}
decodeframe.c:cfl_store_inter_block:
  845|   190k|                                         MACROBLOCKD *const xd) {
  846|   190k|  MB_MODE_INFO *mbmi = xd->mi[0];
  847|   190k|  if (store_cfl_required(cm, xd)) {
  ------------------
  |  Branch (847:7): [True: 601, False: 190k]
  ------------------
  848|    601|    cfl_store_block(xd, mbmi->bsize, mbmi->tx_size);
  849|    601|  }
  850|   190k|}
decodeframe.c:get_dec_job_info:
 2991|  85.5k|static TileJobsDec *get_dec_job_info(AV1DecTileMT *tile_mt_info) {
 2992|  85.5k|  TileJobsDec *cur_job_info = NULL;
 2993|  85.5k|#if CONFIG_MULTITHREAD
 2994|  85.5k|  pthread_mutex_lock(tile_mt_info->job_mutex);
 2995|       |
 2996|  85.5k|  if (tile_mt_info->jobs_dequeued < tile_mt_info->jobs_enqueued) {
  ------------------
  |  Branch (2996:7): [True: 42.0k, False: 43.5k]
  ------------------
 2997|  42.0k|    cur_job_info = tile_mt_info->job_queue + tile_mt_info->jobs_dequeued;
 2998|  42.0k|    tile_mt_info->jobs_dequeued++;
 2999|  42.0k|  }
 3000|       |
 3001|  85.5k|  pthread_mutex_unlock(tile_mt_info->job_mutex);
 3002|       |#else
 3003|       |  (void)tile_mt_info;
 3004|       |#endif
 3005|  85.5k|  return cur_job_info;
 3006|  85.5k|}
decodeframe.c:tile_worker_hook_init:
 3012|  42.0k|                                         uint8_t allow_update_cdf) {
 3013|  42.0k|  AV1_COMMON *cm = &pbi->common;
 3014|  42.0k|  ThreadData *const td = thread_data->td;
 3015|  42.0k|  int tile_row = tile_data->tile_info.tile_row;
 3016|  42.0k|  int tile_col = tile_data->tile_info.tile_col;
 3017|       |
 3018|  42.0k|  td->bit_reader = &tile_data->bit_reader;
 3019|  42.0k|  av1_zero(td->cb_buffer_base.dqcoeff);
  ------------------
  |  |   43|  42.0k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3020|       |
 3021|  42.0k|  MACROBLOCKD *const xd = &td->dcb.xd;
 3022|  42.0k|  av1_tile_init(&xd->tile, cm, tile_row, tile_col);
 3023|  42.0k|  xd->current_base_qindex = cm->quant_params.base_qindex;
 3024|       |
 3025|  42.0k|  setup_bool_decoder(xd, tile_buffer->data, thread_data->data_end,
 3026|  42.0k|                     tile_buffer->size, &thread_data->error_info,
 3027|  42.0k|                     td->bit_reader, allow_update_cdf);
 3028|       |#if CONFIG_ACCOUNTING
 3029|       |  if (pbi->acct_enabled) {
 3030|       |    td->bit_reader->accounting = &pbi->accounting;
 3031|       |    td->bit_reader->accounting->last_tell_frac =
 3032|       |        aom_reader_tell_frac(td->bit_reader);
 3033|       |  } else {
 3034|       |    td->bit_reader->accounting = NULL;
 3035|       |  }
 3036|       |#endif
 3037|  42.0k|  av1_init_macroblockd(cm, xd);
 3038|  42.0k|  xd->error_info = &thread_data->error_info;
 3039|  42.0k|  av1_init_above_context(&cm->above_contexts, av1_num_planes(cm), tile_row, xd);
 3040|       |
 3041|       |  // Initialise the tile context from the frame context
 3042|  42.0k|  tile_data->tctx = *cm->fc;
 3043|  42.0k|  xd->tile_ctx = &tile_data->tctx;
 3044|       |#if CONFIG_ACCOUNTING
 3045|       |  if (pbi->acct_enabled) {
 3046|       |    tile_data->bit_reader.accounting->last_tell_frac =
 3047|       |        aom_reader_tell_frac(&tile_data->bit_reader);
 3048|       |  }
 3049|       |#endif
 3050|  42.0k|}
decodeframe.c:setup_bool_decoder:
 1447|  44.9k|    aom_reader *r, uint8_t allow_update_cdf) {
 1448|       |  // Validate the calculated partition length. If the buffer
 1449|       |  // described by the partition can't be fully read, then restrict
 1450|       |  // it to the portion that can be (for EC mode) or throw an error.
 1451|  44.9k|  if (!read_is_valid(data, read_size, data_end)) {
  ------------------
  |  Branch (1451:7): [True: 0, False: 44.9k]
  ------------------
 1452|       |    // When internal error occurs ensure that xd->mi_row is set appropriately
 1453|       |    // w.r.t. current tile, which is used to signal processing of current row is
 1454|       |    // done in row-mt decoding.
 1455|      0|    xd->mi_row = xd->tile.mi_row_start;
 1456|       |
 1457|      0|    aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME,
 1458|      0|                       "Truncated packet or corrupt tile length");
 1459|      0|  }
 1460|  44.9k|  if (aom_reader_init(r, data, read_size)) {
  ------------------
  |  Branch (1460:7): [True: 0, False: 44.9k]
  ------------------
 1461|       |    // When internal error occurs ensure that xd->mi_row is set appropriately
 1462|       |    // w.r.t. current tile, which is used to signal processing of current row is
 1463|       |    // done in row-mt decoding.
 1464|      0|    xd->mi_row = xd->tile.mi_row_start;
 1465|       |
 1466|      0|    aom_internal_error(error_info, AOM_CODEC_MEM_ERROR,
 1467|      0|                       "Failed to allocate bool decoder %d", 1);
 1468|      0|  }
 1469|       |
 1470|  44.9k|  r->allow_update_cdf = allow_update_cdf;
 1471|  44.9k|}
decodeframe.c:parse_tile_row_mt:
 3247|  42.0k|                                     TileDataDec *const tile_data) {
 3248|  42.0k|  AV1_COMMON *const cm = &pbi->common;
 3249|  42.0k|  const int sb_mi_size = mi_size_wide[cm->seq_params->sb_size];
 3250|  42.0k|  const int num_planes = av1_num_planes(cm);
 3251|  42.0k|  const TileInfo *const tile_info = &tile_data->tile_info;
 3252|  42.0k|  int tile_row = tile_info->tile_row;
 3253|  42.0k|  DecoderCodingBlock *const dcb = &td->dcb;
 3254|  42.0k|  MACROBLOCKD *const xd = &dcb->xd;
 3255|       |
 3256|  42.0k|  av1_zero_above_context(cm, xd, tile_info->mi_col_start, tile_info->mi_col_end,
 3257|  42.0k|                         tile_row);
 3258|  42.0k|  av1_reset_loop_filter_delta(xd, num_planes);
 3259|  42.0k|  av1_reset_loop_restoration(xd, num_planes);
 3260|       |
 3261|  87.0k|  for (int mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end;
  ------------------
  |  Branch (3261:46): [True: 44.9k, False: 42.0k]
  ------------------
 3262|  44.9k|       mi_row += cm->seq_params->mib_size) {
 3263|  44.9k|    av1_zero_left_context(xd);
 3264|       |
 3265|  93.3k|    for (int mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end;
  ------------------
  |  Branch (3265:48): [True: 48.3k, False: 44.9k]
  ------------------
 3266|  48.3k|         mi_col += cm->seq_params->mib_size) {
 3267|  48.3k|      set_cb_buffer(pbi, dcb, pbi->cb_buffer_base, num_planes, mi_row, mi_col);
 3268|       |
 3269|       |      // Bit-stream parsing of the superblock
 3270|  48.3k|      decode_partition(pbi, td, mi_row, mi_col, td->bit_reader,
 3271|  48.3k|                       cm->seq_params->sb_size, 0x1);
 3272|       |
 3273|  48.3k|      if (aom_reader_has_overflowed(td->bit_reader)) {
  ------------------
  |  Branch (3273:11): [True: 0, False: 48.3k]
  ------------------
 3274|      0|        aom_merge_corrupted_flag(&dcb->corrupted, 1);
 3275|      0|        return;
 3276|      0|      }
 3277|  48.3k|    }
 3278|  44.9k|    signal_parse_sb_row_done(pbi, tile_data, sb_mi_size);
 3279|  44.9k|  }
 3280|       |
 3281|  42.0k|  int corrupted =
 3282|  42.0k|      (check_trailing_bits_after_symbol_coder(td->bit_reader)) ? 1 : 0;
  ------------------
  |  Branch (3282:7): [True: 0, False: 42.0k]
  ------------------
 3283|  42.0k|  aom_merge_corrupted_flag(&dcb->corrupted, corrupted);
 3284|  42.0k|}
decodeframe.c:set_cb_buffer:
 2505|   100k|                                 const int num_planes, int mi_row, int mi_col) {
 2506|   100k|  AV1_COMMON *const cm = &pbi->common;
 2507|   100k|  int mib_size_log2 = cm->seq_params->mib_size_log2;
 2508|   100k|  int stride = (cm->mi_params.mi_cols >> mib_size_log2) + 1;
 2509|   100k|  int offset = (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2);
 2510|   100k|  CB_BUFFER *cb_buffer = cb_buffer_base + offset;
 2511|       |
 2512|   279k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (2512:23): [True: 179k, False: 100k]
  ------------------
 2513|   179k|    dcb->dqcoeff_block[plane] = cb_buffer->dqcoeff[plane];
 2514|   179k|    dcb->eob_data[plane] = cb_buffer->eob_data[plane];
 2515|   179k|    dcb->cb_offset[plane] = 0;
 2516|   179k|    dcb->txb_offset[plane] = 0;
 2517|   179k|  }
 2518|   100k|  MACROBLOCKD *const xd = &dcb->xd;
 2519|   100k|  xd->plane[0].color_index_map = cb_buffer->color_index_map[0];
 2520|   100k|  xd->plane[1].color_index_map = cb_buffer->color_index_map[1];
 2521|   100k|  xd->color_index_map_offset[0] = 0;
 2522|   100k|  xd->color_index_map_offset[1] = 0;
 2523|   100k|}
decodeframe.c:decode_partition:
 1298|  2.83M|                                    BLOCK_SIZE bsize, int parse_decode_flag) {
 1299|  2.83M|  assert(bsize < BLOCK_SIZES_ALL);
 1300|  2.83M|  AV1_COMMON *const cm = &pbi->common;
 1301|  2.83M|  DecoderCodingBlock *const dcb = &td->dcb;
 1302|  2.83M|  MACROBLOCKD *const xd = &dcb->xd;
 1303|  2.83M|  const int bw = mi_size_wide[bsize];
 1304|  2.83M|  const int hbs = bw >> 1;
 1305|  2.83M|  PARTITION_TYPE partition;
 1306|  2.83M|  BLOCK_SIZE subsize;
 1307|  2.83M|  const int quarter_step = bw / 4;
 1308|  2.83M|  BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
 1309|  2.83M|  const int has_rows = (mi_row + hbs) < cm->mi_params.mi_rows;
 1310|  2.83M|  const int has_cols = (mi_col + hbs) < cm->mi_params.mi_cols;
 1311|       |
 1312|  2.83M|  if (mi_row >= cm->mi_params.mi_rows || mi_col >= cm->mi_params.mi_cols)
  ------------------
  |  Branch (1312:7): [True: 385k, False: 2.45M]
  |  Branch (1312:42): [True: 284k, False: 2.16M]
  ------------------
 1313|   673k|    return;
 1314|       |
 1315|       |  // parse_decode_flag takes the following values :
 1316|       |  // 01 - do parse only
 1317|       |  // 10 - do decode only
 1318|       |  // 11 - do parse and decode
 1319|  2.16M|  static const block_visitor_fn_t block_visit[4] = { NULL, parse_decode_block,
 1320|  2.16M|                                                     decode_block,
 1321|  2.16M|                                                     parse_decode_block };
 1322|       |
 1323|  2.16M|  if (parse_decode_flag & 1) {
  ------------------
  |  Branch (1323:7): [True: 1.13M, False: 1.03M]
  ------------------
 1324|  1.13M|    const int num_planes = av1_num_planes(cm);
 1325|  3.16M|    for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1325:25): [True: 2.03M, False: 1.13M]
  ------------------
 1326|  2.03M|      int rcol0, rcol1, rrow0, rrow1;
 1327|       |
 1328|       |      // Skip some unnecessary work if loop restoration is disabled
 1329|  2.03M|      if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (1329:11): [True: 1.98M, False: 47.6k]
  ------------------
 1330|       |
 1331|  47.6k|      if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize,
  ------------------
  |  Branch (1331:11): [True: 352, False: 47.2k]
  ------------------
 1332|  47.6k|                                             &rcol0, &rcol1, &rrow0, &rrow1)) {
 1333|    352|        const int rstride = cm->rst_info[plane].horz_units;
 1334|    704|        for (int rrow = rrow0; rrow < rrow1; ++rrow) {
  ------------------
  |  Branch (1334:32): [True: 352, False: 352]
  ------------------
 1335|    704|          for (int rcol = rcol0; rcol < rcol1; ++rcol) {
  ------------------
  |  Branch (1335:34): [True: 352, False: 352]
  ------------------
 1336|    352|            const int runit_idx = rcol + rrow * rstride;
 1337|    352|            loop_restoration_read_sb_coeffs(cm, xd, reader, plane, runit_idx);
 1338|    352|          }
 1339|    352|        }
 1340|    352|      }
 1341|  47.6k|    }
 1342|       |
 1343|  1.13M|    partition = (bsize < BLOCK_8X8) ? PARTITION_NONE
  ------------------
  |  Branch (1343:17): [True: 14.8k, False: 1.11M]
  ------------------
 1344|  1.13M|                                    : read_partition(xd, mi_row, mi_col, reader,
 1345|  1.11M|                                                     has_rows, has_cols, bsize);
 1346|  1.13M|  } else {
 1347|  1.03M|    partition = get_partition(cm, mi_row, mi_col, bsize);
 1348|  1.03M|  }
 1349|  2.16M|  subsize = get_partition_subsize(bsize, partition);
 1350|  2.16M|  if (subsize == BLOCK_INVALID) {
  ------------------
  |  Branch (1350:7): [True: 0, False: 2.16M]
  ------------------
 1351|       |    // When an internal error occurs ensure that xd->mi_row is set appropriately
 1352|       |    // w.r.t. current tile, which is used to signal processing of current row is
 1353|       |    // done.
 1354|      0|    xd->mi_row = mi_row;
 1355|      0|    aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1356|      0|                       "Partition is invalid for block size %dx%d",
 1357|      0|                       block_size_wide[bsize], block_size_high[bsize]);
 1358|      0|  }
 1359|       |  // Check the bitstream is conformant: if there is subsampling on the
 1360|       |  // chroma planes, subsize must subsample to a valid block size.
 1361|  2.16M|  const struct macroblockd_plane *const pd_u = &xd->plane[1];
 1362|  2.16M|  if (get_plane_block_size(subsize, pd_u->subsampling_x, pd_u->subsampling_y) ==
  ------------------
  |  Branch (1362:7): [True: 0, False: 2.16M]
  ------------------
 1363|  2.16M|      BLOCK_INVALID) {
 1364|       |    // When an internal error occurs ensure that xd->mi_row is set appropriately
 1365|       |    // w.r.t. current tile, which is used to signal processing of current row is
 1366|       |    // done.
 1367|      0|    xd->mi_row = mi_row;
 1368|      0|    aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1369|      0|                       "Block size %dx%d invalid with this subsampling mode",
 1370|      0|                       block_size_wide[subsize], block_size_high[subsize]);
 1371|      0|  }
 1372|       |
 1373|  2.16M|#define DEC_BLOCK_STX_ARG
 1374|  2.16M|#define DEC_BLOCK_EPT_ARG partition,
 1375|  2.16M|#define DEC_BLOCK(db_r, db_c, db_subsize)                                  \
 1376|  2.16M|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
 1377|  2.16M|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
 1378|  2.16M|#define DEC_PARTITION(db_r, db_c, db_subsize)                        \
 1379|  2.16M|  decode_partition(pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), reader, \
 1380|  2.16M|                   (db_subsize), parse_decode_flag)
 1381|       |
 1382|  2.16M|  switch (partition) {
 1383|  1.44M|    case PARTITION_NONE: DEC_BLOCK(mi_row, mi_col, subsize); break;
  ------------------
  |  | 1376|  1.44M|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|  1.44M|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|  1.44M|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
  |  Branch (1383:5): [True: 1.44M, False: 717k]
  ------------------
 1384|  18.5k|    case PARTITION_HORZ:
  ------------------
  |  Branch (1384:5): [True: 18.5k, False: 2.14M]
  ------------------
 1385|  18.5k|      DEC_BLOCK(mi_row, mi_col, subsize);
  ------------------
  |  | 1376|  18.5k|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|  18.5k|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|  18.5k|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1386|  18.5k|      if (has_rows) DEC_BLOCK(mi_row + hbs, mi_col, subsize);
  ------------------
  |  | 1376|  5.18k|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|  5.18k|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|  5.18k|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
  |  Branch (1386:11): [True: 5.18k, False: 13.3k]
  ------------------
 1387|  18.5k|      break;
 1388|  21.8k|    case PARTITION_VERT:
  ------------------
  |  Branch (1388:5): [True: 21.8k, False: 2.14M]
  ------------------
 1389|  21.8k|      DEC_BLOCK(mi_row, mi_col, subsize);
  ------------------
  |  | 1376|  21.8k|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|  21.8k|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|  21.8k|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1390|  21.8k|      if (has_cols) DEC_BLOCK(mi_row, mi_col + hbs, subsize);
  ------------------
  |  | 1376|  3.62k|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|  3.62k|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|  3.62k|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
  |  Branch (1390:11): [True: 3.62k, False: 18.1k]
  ------------------
 1391|  21.8k|      break;
 1392|   690k|    case PARTITION_SPLIT:
  ------------------
  |  Branch (1392:5): [True: 690k, False: 1.47M]
  ------------------
 1393|   690k|      DEC_PARTITION(mi_row, mi_col, subsize);
  ------------------
  |  | 1379|   690k|  decode_partition(pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), reader, \
  |  | 1380|   690k|                   (db_subsize), parse_decode_flag)
  ------------------
 1394|   690k|      DEC_PARTITION(mi_row, mi_col + hbs, subsize);
  ------------------
  |  | 1379|   690k|  decode_partition(pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), reader, \
  |  | 1380|   690k|                   (db_subsize), parse_decode_flag)
  ------------------
 1395|   690k|      DEC_PARTITION(mi_row + hbs, mi_col, subsize);
  ------------------
  |  | 1379|   690k|  decode_partition(pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), reader, \
  |  | 1380|   690k|                   (db_subsize), parse_decode_flag)
  ------------------
 1396|   690k|      DEC_PARTITION(mi_row + hbs, mi_col + hbs, subsize);
  ------------------
  |  | 1379|   690k|  decode_partition(pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), reader, \
  |  | 1380|   690k|                   (db_subsize), parse_decode_flag)
  ------------------
 1397|   690k|      break;
 1398|      0|    case PARTITION_HORZ_A:
  ------------------
  |  Branch (1398:5): [True: 0, False: 2.16M]
  ------------------
 1399|      0|      DEC_BLOCK(mi_row, mi_col, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1400|      0|      DEC_BLOCK(mi_row, mi_col + hbs, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1401|      0|      DEC_BLOCK(mi_row + hbs, mi_col, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1402|      0|      break;
 1403|      0|    case PARTITION_HORZ_B:
  ------------------
  |  Branch (1403:5): [True: 0, False: 2.16M]
  ------------------
 1404|      0|      DEC_BLOCK(mi_row, mi_col, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1405|      0|      DEC_BLOCK(mi_row + hbs, mi_col, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1406|      0|      DEC_BLOCK(mi_row + hbs, mi_col + hbs, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1407|      0|      break;
 1408|      0|    case PARTITION_VERT_A:
  ------------------
  |  Branch (1408:5): [True: 0, False: 2.16M]
  ------------------
 1409|      0|      DEC_BLOCK(mi_row, mi_col, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1410|      0|      DEC_BLOCK(mi_row + hbs, mi_col, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1411|      0|      DEC_BLOCK(mi_row, mi_col + hbs, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1412|      0|      break;
 1413|      0|    case PARTITION_VERT_B:
  ------------------
  |  Branch (1413:5): [True: 0, False: 2.16M]
  ------------------
 1414|      0|      DEC_BLOCK(mi_row, mi_col, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1415|      0|      DEC_BLOCK(mi_row, mi_col + hbs, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1416|      0|      DEC_BLOCK(mi_row + hbs, mi_col + hbs, bsize2);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1417|      0|      break;
 1418|      0|    case PARTITION_HORZ_4:
  ------------------
  |  Branch (1418:5): [True: 0, False: 2.16M]
  ------------------
 1419|      0|      for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1419:23): [True: 0, False: 0]
  ------------------
 1420|      0|        int this_mi_row = mi_row + i * quarter_step;
 1421|      0|        if (i > 0 && this_mi_row >= cm->mi_params.mi_rows) break;
  ------------------
  |  Branch (1421:13): [True: 0, False: 0]
  |  Branch (1421:22): [True: 0, False: 0]
  ------------------
 1422|      0|        DEC_BLOCK(this_mi_row, mi_col, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1423|      0|      }
 1424|      0|      break;
 1425|      0|    case PARTITION_VERT_4:
  ------------------
  |  Branch (1425:5): [True: 0, False: 2.16M]
  ------------------
 1426|      0|      for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1426:23): [True: 0, False: 0]
  ------------------
 1427|      0|        int this_mi_col = mi_col + i * quarter_step;
 1428|      0|        if (i > 0 && this_mi_col >= cm->mi_params.mi_cols) break;
  ------------------
  |  Branch (1428:13): [True: 0, False: 0]
  |  Branch (1428:22): [True: 0, False: 0]
  ------------------
 1429|      0|        DEC_BLOCK(mi_row, this_mi_col, subsize);
  ------------------
  |  | 1376|      0|  block_visit[parse_decode_flag](pbi, td, DEC_BLOCK_STX_ARG(db_r), (db_c), \
  |  | 1377|      0|                                 reader, DEC_BLOCK_EPT_ARG(db_subsize))
  |  |  ------------------
  |  |  |  | 1374|      0|#define DEC_BLOCK_EPT_ARG partition,
  |  |  ------------------
  ------------------
 1430|      0|      }
 1431|      0|      break;
 1432|      0|    default: assert(0 && "Invalid partition type");
  ------------------
  |  Branch (1432:5): [True: 0, False: 2.16M]
  ------------------
 1433|  2.16M|  }
 1434|       |
 1435|  2.17M|#undef DEC_PARTITION
 1436|  2.17M|#undef DEC_BLOCK
 1437|  2.17M|#undef DEC_BLOCK_EPT_ARG
 1438|  2.17M|#undef DEC_BLOCK_STX_ARG
 1439|       |
 1440|  2.17M|  if (parse_decode_flag & 1)
  ------------------
  |  Branch (1440:7): [True: 1.13M, False: 1.03M]
  ------------------
 1441|  1.13M|    update_ext_partition_context(xd, mi_row, mi_col, subsize, bsize, partition);
 1442|  2.17M|}
decodeframe.c:parse_decode_block:
 1166|   780k|                                      BLOCK_SIZE bsize) {
 1167|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1168|       |  start_timing(pbi, parse_decode_block_time);
 1169|       |#endif
 1170|   780k|  DecoderCodingBlock *const dcb = &td->dcb;
 1171|   780k|  MACROBLOCKD *const xd = &dcb->xd;
 1172|   780k|  decode_mbmi_block(pbi, dcb, mi_row, mi_col, r, partition, bsize);
 1173|       |
 1174|   780k|  av1_visit_palette(pbi, xd, r, av1_decode_palette_tokens);
 1175|       |
 1176|   780k|  AV1_COMMON *cm = &pbi->common;
 1177|   780k|  const int num_planes = av1_num_planes(cm);
 1178|   780k|  MB_MODE_INFO *mbmi = xd->mi[0];
 1179|   780k|  int inter_block_tx = is_inter_block(mbmi) || is_intrabc_block(mbmi);
  ------------------
  |  Branch (1179:24): [True: 192k, False: 588k]
  |  Branch (1179:48): [True: 1.00k, False: 587k]
  ------------------
 1180|   780k|  if (cm->features.tx_mode == TX_MODE_SELECT && block_signals_txsize(bsize) &&
  ------------------
  |  Branch (1180:7): [True: 639k, False: 141k]
  |  Branch (1180:49): [True: 627k, False: 12.1k]
  ------------------
 1181|   627k|      !mbmi->skip_txfm && inter_block_tx && !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (1181:7): [True: 619k, False: 8.40k]
  |  Branch (1181:27): [True: 114k, False: 504k]
  |  Branch (1181:45): [True: 114k, False: 5]
  ------------------
 1182|   114k|    const TX_SIZE max_tx_size = max_txsize_rect_lookup[bsize];
 1183|   114k|    const int bh = tx_size_high_unit[max_tx_size];
 1184|   114k|    const int bw = tx_size_wide_unit[max_tx_size];
 1185|   114k|    const int width = mi_size_wide[bsize];
 1186|   114k|    const int height = mi_size_high[bsize];
 1187|       |
 1188|   229k|    for (int idy = 0; idy < height; idy += bh)
  ------------------
  |  Branch (1188:23): [True: 114k, False: 114k]
  ------------------
 1189|   229k|      for (int idx = 0; idx < width; idx += bw)
  ------------------
  |  Branch (1189:25): [True: 114k, False: 114k]
  ------------------
 1190|   114k|        read_tx_size_vartx(xd, mbmi, max_tx_size, 0, idy, idx, r);
 1191|   665k|  } else {
 1192|   665k|    mbmi->tx_size = read_tx_size(xd, cm->features.tx_mode, inter_block_tx,
 1193|   665k|                                 !mbmi->skip_txfm, r);
 1194|   665k|    if (inter_block_tx)
  ------------------
  |  Branch (1194:9): [True: 76.5k, False: 589k]
  ------------------
 1195|  76.5k|      memset(mbmi->inter_tx_size, mbmi->tx_size, sizeof(mbmi->inter_tx_size));
 1196|   665k|    set_txfm_ctxs(mbmi->tx_size, xd->width, xd->height,
 1197|   665k|                  mbmi->skip_txfm && is_inter_block(mbmi), xd);
  ------------------
  |  Branch (1197:19): [True: 16.3k, False: 649k]
  |  Branch (1197:38): [True: 16.2k, False: 91]
  ------------------
 1198|   665k|  }
 1199|       |
 1200|   780k|  if (cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (1200:7): [True: 101k, False: 679k]
  ------------------
 1201|   906k|    for (int i = 0; i < MAX_SEGMENTS; i++) {
  ------------------
  |  |   23|   906k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (1201:21): [True: 804k, False: 101k]
  ------------------
 1202|   804k|      const int current_qindex =
 1203|   804k|          av1_get_qindex(&cm->seg, i, xd->current_base_qindex);
 1204|   804k|      const CommonQuantParams *const quant_params = &cm->quant_params;
 1205|  2.56M|      for (int j = 0; j < num_planes; ++j) {
  ------------------
  |  Branch (1205:23): [True: 1.76M, False: 804k]
  ------------------
 1206|  1.76M|        const int dc_delta_q = j == 0 ? quant_params->y_dc_delta_q
  ------------------
  |  Branch (1206:32): [True: 805k, False: 958k]
  ------------------
 1207|  1.76M|                                      : (j == 1 ? quant_params->u_dc_delta_q
  ------------------
  |  Branch (1207:42): [True: 481k, False: 476k]
  ------------------
 1208|   958k|                                                : quant_params->v_dc_delta_q);
 1209|  1.76M|        const int ac_delta_q = j == 0 ? 0
  ------------------
  |  Branch (1209:32): [True: 805k, False: 958k]
  ------------------
 1210|  1.76M|                                      : (j == 1 ? quant_params->u_ac_delta_q
  ------------------
  |  Branch (1210:42): [True: 481k, False: 476k]
  ------------------
 1211|   958k|                                                : quant_params->v_ac_delta_q);
 1212|  1.76M|        xd->plane[j].seg_dequant_QTX[i][0] = av1_dc_quant_QTX(
 1213|  1.76M|            current_qindex, dc_delta_q, cm->seq_params->bit_depth);
 1214|  1.76M|        xd->plane[j].seg_dequant_QTX[i][1] = av1_ac_quant_QTX(
 1215|  1.76M|            current_qindex, ac_delta_q, cm->seq_params->bit_depth);
 1216|  1.76M|      }
 1217|   804k|    }
 1218|   101k|  }
 1219|   780k|  if (mbmi->skip_txfm) av1_reset_entropy_context(xd, bsize, num_planes);
  ------------------
  |  Branch (1219:7): [True: 16.2k, False: 764k]
  ------------------
 1220|       |
 1221|   780k|  decode_token_recon_block(pbi, td, r, bsize);
 1222|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1223|       |  end_timing(pbi, parse_decode_block_time);
 1224|       |#endif
 1225|   780k|}
decodeframe.c:decode_mbmi_block:
  375|   780k|                                     BLOCK_SIZE bsize) {
  376|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  377|       |  start_timing(pbi, decode_mbmi_block_time);
  378|       |#endif
  379|   780k|  AV1_COMMON *const cm = &pbi->common;
  380|   780k|  const SequenceHeader *const seq_params = cm->seq_params;
  381|   780k|  const int bw = mi_size_wide[bsize];
  382|   780k|  const int bh = mi_size_high[bsize];
  383|   780k|  const int x_mis = AOMMIN(bw, cm->mi_params.mi_cols - mi_col);
  ------------------
  |  |   34|   780k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 661k, False: 119k]
  |  |  ------------------
  ------------------
  384|   780k|  const int y_mis = AOMMIN(bh, cm->mi_params.mi_rows - mi_row);
  ------------------
  |  |   34|   780k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 658k, False: 122k]
  |  |  ------------------
  ------------------
  385|   780k|  MACROBLOCKD *const xd = &dcb->xd;
  386|       |
  387|       |#if CONFIG_ACCOUNTING
  388|       |  aom_accounting_set_context(&pbi->accounting, mi_col, mi_row);
  389|       |#endif
  390|   780k|  set_offsets(cm, xd, bsize, mi_row, mi_col, bw, bh, x_mis, y_mis);
  391|   780k|  xd->mi[0]->partition = partition;
  392|   780k|  av1_read_mode_info(pbi, dcb, r, x_mis, y_mis);
  393|   780k|  if (bsize >= BLOCK_8X8 &&
  ------------------
  |  Branch (393:7): [True: 758k, False: 22.3k]
  ------------------
  394|   758k|      (seq_params->subsampling_x || seq_params->subsampling_y)) {
  ------------------
  |  Branch (394:8): [True: 705k, False: 52.7k]
  |  Branch (394:37): [True: 1, False: 52.7k]
  ------------------
  395|   705k|    const BLOCK_SIZE uv_subsize =
  396|   705k|        av1_ss_size_lookup[bsize][seq_params->subsampling_x]
  397|   705k|                          [seq_params->subsampling_y];
  398|   705k|    if (uv_subsize == BLOCK_INVALID)
  ------------------
  |  Branch (398:9): [True: 0, False: 705k]
  ------------------
  399|      0|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
  400|      0|                         "Invalid block size.");
  401|   705k|  }
  402|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  403|       |  end_timing(pbi, decode_mbmi_block_time);
  404|       |#endif
  405|   780k|}
decodeframe.c:set_offsets:
  339|   780k|                               int bh, int x_mis, int y_mis) {
  340|   780k|  const int num_planes = av1_num_planes(cm);
  341|   780k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  342|   780k|  const TileInfo *const tile = &xd->tile;
  343|       |
  344|   780k|  set_mi_offsets(mi_params, xd, mi_row, mi_col);
  345|   780k|  xd->mi[0]->bsize = bsize;
  346|       |#if CONFIG_RD_DEBUG
  347|       |  xd->mi[0]->mi_row = mi_row;
  348|       |  xd->mi[0]->mi_col = mi_col;
  349|       |#endif
  350|       |
  351|   780k|  assert(x_mis && y_mis);
  352|  1.71M|  for (int x = 1; x < x_mis; ++x) xd->mi[x] = xd->mi[0];
  ------------------
  |  Branch (352:19): [True: 930k, False: 780k]
  ------------------
  353|   780k|  int idx = mi_params->mi_stride;
  354|  1.71M|  for (int y = 1; y < y_mis; ++y) {
  ------------------
  |  Branch (354:19): [True: 933k, False: 780k]
  ------------------
  355|   933k|    memcpy(&xd->mi[idx], &xd->mi[0], x_mis * sizeof(xd->mi[0]));
  356|   933k|    idx += mi_params->mi_stride;
  357|   933k|  }
  358|       |
  359|   780k|  set_plane_n4(xd, bw, bh, num_planes);
  360|   780k|  set_entropy_context(xd, mi_row, mi_col, num_planes);
  361|       |
  362|       |  // Distance of Mb to the various image edges. These are specified to 8th pel
  363|       |  // as they are always compared to values that are in 1/8th pel units
  364|   780k|  set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, mi_params->mi_rows,
  365|   780k|                 mi_params->mi_cols);
  366|       |
  367|   780k|  av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
  368|   780k|                       num_planes);
  369|   780k|}
decodeframe.c:read_tx_size_vartx:
 1066|   253k|                                      int blk_col, aom_reader *r) {
 1067|   253k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1068|   253k|  int is_split = 0;
 1069|   253k|  const BLOCK_SIZE bsize = mbmi->bsize;
 1070|   253k|  const int max_blocks_high = max_block_high(xd, bsize, 0);
 1071|   253k|  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
 1072|   253k|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (1072:7): [True: 1.15k, False: 252k]
  |  Branch (1072:37): [True: 1.27k, False: 251k]
  ------------------
 1073|   253k|  assert(tx_size > TX_4X4);
 1074|   251k|  TX_SIZE txs = max_txsize_rect_lookup[bsize];
 1075|   502k|  for (int level = 0; level < MAX_VARTX_DEPTH - 1; ++level)
  ------------------
  |  |   56|   502k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (1075:23): [True: 251k, False: 251k]
  ------------------
 1076|   251k|    txs = sub_tx_size_map[txs];
 1077|   251k|  const int tx_w_log2 = tx_size_wide_log2[txs] - MI_SIZE_LOG2;
  ------------------
  |  |   39|   251k|#define MI_SIZE_LOG2 2
  ------------------
 1078|   251k|  const int tx_h_log2 = tx_size_high_log2[txs] - MI_SIZE_LOG2;
  ------------------
  |  |   39|   251k|#define MI_SIZE_LOG2 2
  ------------------
 1079|   251k|  const int bw_log2 = mi_size_wide_log2[bsize];
 1080|   251k|  const int stride_log2 = bw_log2 - tx_w_log2;
 1081|       |
 1082|   251k|  if (depth == MAX_VARTX_DEPTH) {
  ------------------
  |  |   56|   251k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (1082:7): [True: 44.3k, False: 206k]
  ------------------
 1083|  44.3k|    set_inter_tx_size(mbmi, stride_log2, tx_w_log2, tx_h_log2, txs, tx_size,
 1084|  44.3k|                      tx_size, blk_row, blk_col);
 1085|  44.3k|    mbmi->tx_size = tx_size;
 1086|  44.3k|    txfm_partition_update(xd->above_txfm_context + blk_col,
 1087|  44.3k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
 1088|  44.3k|    return;
 1089|  44.3k|  }
 1090|       |
 1091|   206k|  const int ctx = txfm_partition_context(xd->above_txfm_context + blk_col,
 1092|   206k|                                         xd->left_txfm_context + blk_row,
 1093|   206k|                                         mbmi->bsize, tx_size);
 1094|   206k|  is_split = aom_read_symbol(r, ec_ctx->txfm_partition_cdf[ctx], 2, ACCT_STR);
  ------------------
  |  |   51|   206k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1095|       |
 1096|   206k|  if (is_split) {
  ------------------
  |  Branch (1096:7): [True: 40.1k, False: 166k]
  ------------------
 1097|  40.1k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
 1098|  40.1k|    const int bsw = tx_size_wide_unit[sub_txs];
 1099|  40.1k|    const int bsh = tx_size_high_unit[sub_txs];
 1100|       |
 1101|  40.1k|    if (sub_txs == TX_4X4) {
  ------------------
  |  Branch (1101:9): [True: 2.00k, False: 38.1k]
  ------------------
 1102|  2.00k|      set_inter_tx_size(mbmi, stride_log2, tx_w_log2, tx_h_log2, txs, tx_size,
 1103|  2.00k|                        sub_txs, blk_row, blk_col);
 1104|  2.00k|      mbmi->tx_size = sub_txs;
 1105|  2.00k|      txfm_partition_update(xd->above_txfm_context + blk_col,
 1106|  2.00k|                            xd->left_txfm_context + blk_row, sub_txs, tx_size);
 1107|  2.00k|      return;
 1108|  2.00k|    }
 1109|       |
 1110|  40.1k|    assert(bsw > 0 && bsh > 0);
 1111|   111k|    for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) {
  ------------------
  |  Branch (1111:23): [True: 72.8k, False: 38.1k]
  ------------------
 1112|   211k|      for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) {
  ------------------
  |  Branch (1112:25): [True: 139k, False: 72.8k]
  ------------------
 1113|   139k|        int offsetr = blk_row + row;
 1114|   139k|        int offsetc = blk_col + col;
 1115|   139k|        read_tx_size_vartx(xd, mbmi, sub_txs, depth + 1, offsetr, offsetc, r);
 1116|   139k|      }
 1117|  72.8k|    }
 1118|   166k|  } else {
 1119|   166k|    set_inter_tx_size(mbmi, stride_log2, tx_w_log2, tx_h_log2, txs, tx_size,
 1120|   166k|                      tx_size, blk_row, blk_col);
 1121|   166k|    mbmi->tx_size = tx_size;
 1122|   166k|    txfm_partition_update(xd->above_txfm_context + blk_col,
 1123|   166k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
 1124|   166k|  }
 1125|   206k|}
decodeframe.c:set_inter_tx_size:
 1052|   213k|                                     int blk_col) {
 1053|   515k|  for (int idy = 0; idy < tx_size_high_unit[split_size];
  ------------------
  |  Branch (1053:21): [True: 301k, False: 213k]
  ------------------
 1054|   301k|       idy += tx_size_high_unit[min_txs]) {
 1055|   780k|    for (int idx = 0; idx < tx_size_wide_unit[split_size];
  ------------------
  |  Branch (1055:23): [True: 478k, False: 301k]
  ------------------
 1056|   478k|         idx += tx_size_wide_unit[min_txs]) {
 1057|   478k|      const int index = (((blk_row + idy) >> tx_h_log2) << stride_log2) +
 1058|   478k|                        ((blk_col + idx) >> tx_w_log2);
 1059|   478k|      mbmi->inter_tx_size[index] = txs;
 1060|   478k|    }
 1061|   301k|  }
 1062|   213k|}
decodeframe.c:read_tx_size:
 1145|   663k|                            aom_reader *r) {
 1146|   663k|  const BLOCK_SIZE bsize = xd->mi[0]->bsize;
 1147|   663k|  if (xd->lossless[xd->mi[0]->segment_id]) return TX_4X4;
  ------------------
  |  Branch (1147:7): [True: 30.1k, False: 633k]
  ------------------
 1148|       |
 1149|   633k|  if (block_signals_txsize(bsize)) {
  ------------------
  |  Branch (1149:7): [True: 618k, False: 15.4k]
  ------------------
 1150|   618k|    if ((!is_inter || allow_select_inter) && tx_mode == TX_MODE_SELECT) {
  ------------------
  |  Branch (1150:10): [True: 557k, False: 60.2k]
  |  Branch (1150:23): [True: 43.9k, False: 16.2k]
  |  Branch (1150:46): [True: 504k, False: 97.7k]
  ------------------
 1151|   504k|      const TX_SIZE coded_tx_size = read_selected_tx_size(xd, r);
 1152|   504k|      return coded_tx_size;
 1153|   504k|    } else {
 1154|   113k|      return tx_size_from_tx_mode(bsize, tx_mode);
 1155|   113k|    }
 1156|   618k|  } else {
 1157|       |    assert(IMPLIES(tx_mode == ONLY_4X4, bsize == BLOCK_4X4));
 1158|  15.4k|    return max_txsize_rect_lookup[bsize];
 1159|  15.4k|  }
 1160|   633k|}
decodeframe.c:read_selected_tx_size:
 1128|   504k|                                     aom_reader *r) {
 1129|       |  // TODO(debargha): Clean up the logic here. This function should only
 1130|       |  // be called for intra.
 1131|   504k|  const BLOCK_SIZE bsize = xd->mi[0]->bsize;
 1132|   504k|  const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
 1133|   504k|  const int max_depths = bsize_to_max_depth(bsize);
 1134|   504k|  const int ctx = get_tx_size_context(xd);
 1135|   504k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1136|   504k|  const int depth = aom_read_symbol(r, ec_ctx->tx_size_cdf[tx_size_cat][ctx],
  ------------------
  |  |   51|   504k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1137|   504k|                                    max_depths + 1, ACCT_STR);
 1138|       |  assert(depth >= 0 && depth <= max_depths);
 1139|   504k|  const TX_SIZE tx_size = depth_to_tx_size(depth, bsize);
 1140|   504k|  return tx_size;
 1141|   504k|}
decodeframe.c:decode_token_recon_block:
  910|  1.49M|                                            BLOCK_SIZE bsize) {
  911|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  912|       |  start_timing(pbi, decode_token_recon_block_time);
  913|       |#endif
  914|  1.49M|  AV1_COMMON *const cm = &pbi->common;
  915|  1.49M|  DecoderCodingBlock *const dcb = &td->dcb;
  916|  1.49M|  MACROBLOCKD *const xd = &dcb->xd;
  917|  1.49M|  const int num_planes = av1_num_planes(cm);
  918|  1.49M|  MB_MODE_INFO *mbmi = xd->mi[0];
  919|       |
  920|  1.49M|  if (!is_inter_block(mbmi)) {
  ------------------
  |  Branch (920:7): [True: 1.12M, False: 366k]
  ------------------
  921|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  922|       |    start_timing(pbi, decode_token_recon_block_intra_time);
  923|       |#endif
  924|  1.12M|    int row, col;
  925|  1.12M|    assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x,
  926|  1.12M|                                         xd->plane[0].subsampling_y));
  927|  1.12M|    const int max_blocks_wide = max_block_wide(xd, bsize, 0);
  928|  1.12M|    const int max_blocks_high = max_block_high(xd, bsize, 0);
  929|  1.12M|    const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
  930|  1.12M|    int mu_blocks_wide = mi_size_wide[max_unit_bsize];
  931|  1.12M|    int mu_blocks_high = mi_size_high[max_unit_bsize];
  932|  1.12M|    mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide);
  ------------------
  |  |   34|  1.12M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.12M, False: 528]
  |  |  ------------------
  ------------------
  933|  1.12M|    mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high);
  ------------------
  |  |   34|  1.12M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.12M, False: 207]
  |  |  ------------------
  ------------------
  934|       |
  935|  2.25M|    for (row = 0; row < max_blocks_high; row += mu_blocks_high) {
  ------------------
  |  Branch (935:19): [True: 1.12M, False: 1.12M]
  ------------------
  936|  2.25M|      for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) {
  ------------------
  |  Branch (936:21): [True: 1.12M, False: 1.12M]
  ------------------
  937|  3.20M|        for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (937:29): [True: 2.08M, False: 1.11M]
  ------------------
  938|  2.08M|          if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (938:15): [True: 977k, False: 1.11M]
  |  Branch (938:24): [True: 9.54k, False: 967k]
  ------------------
  939|  2.07M|          const struct macroblockd_plane *const pd = &xd->plane[plane];
  940|  2.07M|          const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
  941|  2.07M|          const int stepr = tx_size_high_unit[tx_size];
  942|  2.07M|          const int stepc = tx_size_wide_unit[tx_size];
  943|       |
  944|  2.07M|          const int unit_height = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  4.15M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 2.07M]
  |  |  ------------------
  ------------------
  945|  2.07M|              AOMMIN(mu_blocks_high + row, max_blocks_high), pd->subsampling_y);
  946|  2.07M|          const int unit_width = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  4.15M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 2.07M]
  |  |  ------------------
  ------------------
  947|  2.07M|              AOMMIN(mu_blocks_wide + col, max_blocks_wide), pd->subsampling_x);
  948|       |
  949|  4.45M|          for (int blk_row = row >> pd->subsampling_y; blk_row < unit_height;
  ------------------
  |  Branch (949:56): [True: 2.38M, False: 2.07M]
  ------------------
  950|  2.38M|               blk_row += stepr) {
  951|  5.39M|            for (int blk_col = col >> pd->subsampling_x; blk_col < unit_width;
  ------------------
  |  Branch (951:58): [True: 3.01M, False: 2.38M]
  ------------------
  952|  3.01M|                 blk_col += stepc) {
  953|  3.01M|              td->read_coeffs_tx_intra_block_visit(cm, dcb, r, plane, blk_row,
  954|  3.01M|                                                   blk_col, tx_size);
  955|  3.01M|              td->predict_and_recon_intra_block_visit(
  956|  3.01M|                  cm, dcb, r, plane, blk_row, blk_col, tx_size);
  957|  3.01M|              set_cb_buffer_offsets(dcb, tx_size, plane);
  958|  3.01M|            }
  959|  2.38M|          }
  960|  2.07M|        }
  961|  1.12M|      }
  962|  1.12M|    }
  963|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  964|       |    end_timing(pbi, decode_token_recon_block_intra_time);
  965|       |#endif
  966|  1.12M|  } else {
  967|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  968|       |    start_timing(pbi, decode_token_recon_block_inter_time);
  969|       |#endif
  970|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  971|       |    start_timing(pbi, predict_inter_block_time);
  972|       |#endif
  973|   366k|    td->predict_inter_block_visit(cm, dcb, bsize);
  974|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  975|       |    end_timing(pbi, predict_inter_block_time);
  976|       |#endif
  977|       |    // Reconstruction
  978|   366k|    if (!mbmi->skip_txfm) {
  ------------------
  |  Branch (978:9): [True: 335k, False: 31.3k]
  ------------------
  979|   335k|      int eobtotal = 0;
  980|       |
  981|   335k|      const int max_blocks_wide = max_block_wide(xd, bsize, 0);
  982|   335k|      const int max_blocks_high = max_block_high(xd, bsize, 0);
  983|   335k|      int row, col;
  984|       |
  985|   335k|      const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
  986|   335k|      assert(max_unit_bsize ==
  987|   335k|             get_plane_block_size(BLOCK_64X64, xd->plane[0].subsampling_x,
  988|   335k|                                  xd->plane[0].subsampling_y));
  989|   335k|      int mu_blocks_wide = mi_size_wide[max_unit_bsize];
  990|   335k|      int mu_blocks_high = mi_size_high[max_unit_bsize];
  991|       |
  992|   335k|      mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide);
  ------------------
  |  |   34|   335k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 334k, False: 300]
  |  |  ------------------
  ------------------
  993|   335k|      mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high);
  ------------------
  |  |   34|   335k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 334k, False: 299]
  |  |  ------------------
  ------------------
  994|       |
  995|   670k|      for (row = 0; row < max_blocks_high; row += mu_blocks_high) {
  ------------------
  |  Branch (995:21): [True: 335k, False: 335k]
  ------------------
  996|   670k|        for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) {
  ------------------
  |  Branch (996:23): [True: 335k, False: 335k]
  ------------------
  997|   863k|          for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (997:31): [True: 529k, False: 334k]
  ------------------
  998|   529k|            if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (998:17): [True: 195k, False: 334k]
  |  Branch (998:26): [True: 1.16k, False: 194k]
  ------------------
  999|   528k|            const struct macroblockd_plane *const pd = &xd->plane[plane];
 1000|   528k|            const int ss_x = pd->subsampling_x;
 1001|   528k|            const int ss_y = pd->subsampling_y;
 1002|   528k|            const BLOCK_SIZE plane_bsize =
 1003|   528k|                get_plane_block_size(bsize, ss_x, ss_y);
 1004|   528k|            const TX_SIZE max_tx_size =
 1005|   528k|                get_vartx_max_txsize(xd, plane_bsize, plane);
 1006|   528k|            const int bh_var_tx = tx_size_high_unit[max_tx_size];
 1007|   528k|            const int bw_var_tx = tx_size_wide_unit[max_tx_size];
 1008|   528k|            int block = 0;
 1009|   528k|            int step =
 1010|   528k|                tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
 1011|   528k|            int blk_row, blk_col;
 1012|   528k|            const int unit_height = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  1.05M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 528k]
  |  |  ------------------
  ------------------
 1013|   528k|                AOMMIN(mu_blocks_high + row, max_blocks_high), ss_y);
 1014|   528k|            const int unit_width = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  1.05M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 528k]
  |  |  ------------------
  ------------------
 1015|   528k|                AOMMIN(mu_blocks_wide + col, max_blocks_wide), ss_x);
 1016|       |
 1017|  1.09M|            for (blk_row = row >> ss_y; blk_row < unit_height;
  ------------------
  |  Branch (1017:41): [True: 568k, False: 528k]
  ------------------
 1018|   568k|                 blk_row += bh_var_tx) {
 1019|  1.20M|              for (blk_col = col >> ss_x; blk_col < unit_width;
  ------------------
  |  Branch (1019:43): [True: 640k, False: 568k]
  ------------------
 1020|   640k|                   blk_col += bw_var_tx) {
 1021|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1022|       |                start_timing(pbi, decode_reconstruct_tx_inter_time);
 1023|       |#endif
 1024|   640k|                decode_reconstruct_tx(cm, td, r, mbmi, plane, plane_bsize,
 1025|   640k|                                      blk_row, blk_col, block, max_tx_size,
 1026|   640k|                                      &eobtotal);
 1027|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1028|       |                end_timing(pbi, decode_reconstruct_tx_inter_time);
 1029|       |#endif
 1030|   640k|                block += step;
 1031|   640k|              }
 1032|   568k|            }
 1033|   528k|          }
 1034|   335k|        }
 1035|   335k|      }
 1036|   335k|    }
 1037|   366k|    td->cfl_store_inter_block_visit(cm, xd);
 1038|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1039|       |    end_timing(pbi, decode_token_recon_block_inter_time);
 1040|       |#endif
 1041|   366k|  }
 1042|       |
 1043|  1.49M|  av1_visit_palette(pbi, xd, r, set_color_index_map_offset);
 1044|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1045|       |  end_timing(pbi, decode_token_recon_block_time);
 1046|       |#endif
 1047|  1.49M|}
decodeframe.c:set_cb_buffer_offsets:
  275|  3.84M|                                         TX_SIZE tx_size, int plane) {
  276|  3.84M|  dcb->cb_offset[plane] += tx_size_wide[tx_size] * tx_size_high[tx_size];
  277|  3.84M|  dcb->txb_offset[plane] =
  278|  3.84M|      dcb->cb_offset[plane] / (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  231|  3.84M|#define TX_SIZE_W_MIN 4
  ------------------
                    dcb->cb_offset[plane] / (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  238|  3.84M|#define TX_SIZE_H_MIN 4
  ------------------
  279|  3.84M|}
decodeframe.c:decode_reconstruct_tx:
  286|   919k|                                         TX_SIZE tx_size, int *eob_total) {
  287|   919k|  DecoderCodingBlock *const dcb = &td->dcb;
  288|   919k|  MACROBLOCKD *const xd = &dcb->xd;
  289|   919k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  290|   919k|  const TX_SIZE plane_tx_size =
  291|   919k|      plane ? av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
  ------------------
  |  Branch (291:7): [True: 213k, False: 705k]
  ------------------
  292|   213k|                                    pd->subsampling_y)
  293|   919k|            : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,
  294|   705k|                                                         blk_col)];
  295|       |  // Scale to match transform block unit.
  296|   919k|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  297|   919k|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  298|       |
  299|   919k|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (299:7): [True: 591, False: 918k]
  |  Branch (299:37): [True: 18.4E, False: 918k]
  ------------------
  300|       |
  301|   919k|  if (tx_size == plane_tx_size || plane) {
  ------------------
  |  Branch (301:7): [True: 813k, False: 105k]
  |  Branch (301:35): [True: 27.1k, False: 78.0k]
  ------------------
  302|   842k|    td->read_coeffs_tx_inter_block_visit(cm, dcb, r, plane, blk_row, blk_col,
  303|   842k|                                         tx_size);
  304|       |
  305|   842k|    td->inverse_tx_inter_block_visit(cm, dcb, r, plane, blk_row, blk_col,
  306|   842k|                                     tx_size);
  307|   842k|    eob_info *eob_data = dcb->eob_data[plane] + dcb->txb_offset[plane];
  308|   842k|    *eob_total += eob_data->eob;
  309|   842k|    set_cb_buffer_offsets(dcb, tx_size, plane);
  310|   842k|  } else {
  311|  76.9k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  312|  76.9k|    assert(IMPLIES(tx_size <= TX_4X4, sub_txs == tx_size));
  313|  76.9k|    assert(IMPLIES(tx_size > TX_4X4, sub_txs < tx_size));
  314|  76.9k|    const int bsw = tx_size_wide_unit[sub_txs];
  315|  76.9k|    const int bsh = tx_size_high_unit[sub_txs];
  316|  76.9k|    const int sub_step = bsw * bsh;
  317|  76.9k|    const int row_end =
  318|  76.9k|        AOMMIN(tx_size_high_unit[tx_size], max_blocks_high - blk_row);
  ------------------
  |  |   34|  76.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.9k, False: 66.0k]
  |  |  ------------------
  ------------------
  319|  76.9k|    const int col_end =
  320|  76.9k|        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
  ------------------
  |  |   34|  76.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.0k, False: 65.9k]
  |  |  ------------------
  ------------------
  321|       |
  322|  76.9k|    assert(bsw > 0 && bsh > 0);
  323|       |
  324|   224k|    for (int row = 0; row < row_end; row += bsh) {
  ------------------
  |  Branch (324:23): [True: 148k, False: 76.9k]
  ------------------
  325|   148k|      const int offsetr = blk_row + row;
  326|   427k|      for (int col = 0; col < col_end; col += bsw) {
  ------------------
  |  Branch (326:25): [True: 279k, False: 148k]
  ------------------
  327|   279k|        const int offsetc = blk_col + col;
  328|       |
  329|   279k|        decode_reconstruct_tx(cm, td, r, mbmi, plane, plane_bsize, offsetr,
  330|   279k|                              offsetc, block, sub_txs, eob_total);
  331|   279k|        block += sub_step;
  332|   279k|      }
  333|   148k|    }
  334|  76.9k|  }
  335|   919k|}
decodeframe.c:set_color_index_map_offset:
  899|  49.6k|                                              aom_reader *r) {
  900|  49.6k|  (void)r;
  901|  49.6k|  Av1ColorMapParam params;
  902|  49.6k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  903|  49.6k|  av1_get_block_dimensions(mbmi->bsize, plane, xd, &params.plane_width,
  904|  49.6k|                           &params.plane_height, NULL, NULL);
  905|  49.6k|  xd->color_index_map_offset[plane] += params.plane_width * params.plane_height;
  906|  49.6k|}
decodeframe.c:decode_block:
 1260|   719k|                                PARTITION_TYPE partition, BLOCK_SIZE bsize) {
 1261|   719k|  (void)partition;
 1262|   719k|  set_offsets_for_pred_and_recon(pbi, td, mi_row, mi_col, bsize);
 1263|   719k|  decode_token_recon_block(pbi, td, r, bsize);
 1264|   719k|}
decodeframe.c:set_offsets_for_pred_and_recon:
 1230|   719k|                                                  BLOCK_SIZE bsize) {
 1231|   719k|  AV1_COMMON *const cm = &pbi->common;
 1232|   719k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1233|   719k|  DecoderCodingBlock *const dcb = &td->dcb;
 1234|   719k|  MACROBLOCKD *const xd = &dcb->xd;
 1235|   719k|  const int bw = mi_size_wide[bsize];
 1236|   719k|  const int bh = mi_size_high[bsize];
 1237|   719k|  const int num_planes = av1_num_planes(cm);
 1238|       |
 1239|   719k|  const int offset = mi_row * mi_params->mi_stride + mi_col;
 1240|   719k|  const TileInfo *const tile = &xd->tile;
 1241|       |
 1242|   719k|  xd->mi = mi_params->mi_grid_base + offset;
 1243|   719k|  xd->tx_type_map =
 1244|   719k|      &mi_params->tx_type_map[mi_row * mi_params->mi_stride + mi_col];
 1245|   719k|  xd->tx_type_map_stride = mi_params->mi_stride;
 1246|       |
 1247|   719k|  set_plane_n4(xd, bw, bh, num_planes);
 1248|       |
 1249|       |  // Distance of Mb to the various image edges. These are specified to 8th pel
 1250|       |  // as they are always compared to values that are in 1/8th pel units
 1251|   719k|  set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, mi_params->mi_rows,
 1252|   719k|                 mi_params->mi_cols);
 1253|       |
 1254|   719k|  av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
 1255|   719k|                       num_planes);
 1256|   719k|}
decodeframe.c:loop_restoration_read_sb_coeffs:
 1705|    352|                                                   int plane, int runit_idx) {
 1706|    352|  const RestorationInfo *rsi = &cm->rst_info[plane];
 1707|    352|  RestorationUnitInfo *rui = &rsi->unit_info[runit_idx];
 1708|    352|  assert(rsi->frame_restoration_type != RESTORE_NONE);
 1709|       |
 1710|    352|  assert(!cm->features.all_lossless);
 1711|       |
 1712|    352|  const int wiener_win = (plane > 0) ? WIENER_WIN_CHROMA : WIENER_WIN;
  ------------------
  |  |  128|     65|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|     65|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     65|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                const int wiener_win = (plane > 0) ? WIENER_WIN_CHROMA : WIENER_WIN;
  ------------------
  |  |  121|    287|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    287|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1712:26): [True: 65, False: 287]
  ------------------
 1713|    352|  WienerInfo *wiener_info = xd->wiener_info + plane;
 1714|    352|  SgrprojInfo *sgrproj_info = xd->sgrproj_info + plane;
 1715|       |
 1716|    352|  if (rsi->frame_restoration_type == RESTORE_SWITCHABLE) {
  ------------------
  |  Branch (1716:7): [True: 2, False: 350]
  ------------------
 1717|      2|    rui->restoration_type =
 1718|      2|        aom_read_symbol(r, xd->tile_ctx->switchable_restore_cdf,
  ------------------
  |  |   51|      2|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1719|      2|                        RESTORE_SWITCHABLE_TYPES, ACCT_STR);
 1720|      2|    switch (rui->restoration_type) {
 1721|      1|      case RESTORE_WIENER:
  ------------------
  |  Branch (1721:7): [True: 1, False: 1]
  ------------------
 1722|      1|        read_wiener_filter(wiener_win, &rui->wiener_info, wiener_info, r);
 1723|      1|        break;
 1724|      1|      case RESTORE_SGRPROJ:
  ------------------
  |  Branch (1724:7): [True: 1, False: 1]
  ------------------
 1725|      1|        read_sgrproj_filter(&rui->sgrproj_info, sgrproj_info, r);
 1726|      1|        break;
 1727|      0|      default: assert(rui->restoration_type == RESTORE_NONE); break;
  ------------------
  |  Branch (1727:7): [True: 0, False: 2]
  ------------------
 1728|      2|    }
 1729|    350|  } else if (rsi->frame_restoration_type == RESTORE_WIENER) {
  ------------------
  |  Branch (1729:14): [True: 340, False: 10]
  ------------------
 1730|    340|    if (aom_read_symbol(r, xd->tile_ctx->wiener_restore_cdf, 2, ACCT_STR)) {
  ------------------
  |  |   51|    340|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (51:3): [True: 317, False: 23]
  |  |  ------------------
  ------------------
 1731|    317|      rui->restoration_type = RESTORE_WIENER;
 1732|    317|      read_wiener_filter(wiener_win, &rui->wiener_info, wiener_info, r);
 1733|    317|    } else {
 1734|     23|      rui->restoration_type = RESTORE_NONE;
 1735|     23|    }
 1736|    340|  } else if (rsi->frame_restoration_type == RESTORE_SGRPROJ) {
  ------------------
  |  Branch (1736:14): [True: 10, False: 0]
  ------------------
 1737|     10|    if (aom_read_symbol(r, xd->tile_ctx->sgrproj_restore_cdf, 2, ACCT_STR)) {
  ------------------
  |  |   51|     10|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (51:3): [True: 10, False: 0]
  |  |  ------------------
  ------------------
 1738|     10|      rui->restoration_type = RESTORE_SGRPROJ;
 1739|     10|      read_sgrproj_filter(&rui->sgrproj_info, sgrproj_info, r);
 1740|     10|    } else {
 1741|      0|      rui->restoration_type = RESTORE_NONE;
 1742|      0|    }
 1743|     10|  }
 1744|    352|}
decodeframe.c:read_wiener_filter:
 1607|    318|                                      aom_reader *rb) {
 1608|    318|  memset(wiener_info->vfilter, 0, sizeof(wiener_info->vfilter));
 1609|    318|  memset(wiener_info->hfilter, 0, sizeof(wiener_info->hfilter));
 1610|       |
 1611|    318|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1611:7): [True: 258, False: 60]
  ------------------
 1612|    258|    wiener_info->vfilter[0] = wiener_info->vfilter[WIENER_WIN - 1] =
  ------------------
  |  |  121|    258|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    258|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1613|    258|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    258|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1614|    258|            rb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
 1615|    258|            WIENER_FILT_TAP0_SUBEXP_K,
 1616|    258|            ref_wiener_info->vfilter[0] - WIENER_FILT_TAP0_MINV, ACCT_STR) +
 1617|    258|        WIENER_FILT_TAP0_MINV;
  ------------------
  |  |  152|    258|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    258|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    258|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1618|     60|  else
 1619|     60|    wiener_info->vfilter[0] = wiener_info->vfilter[WIENER_WIN - 1] = 0;
  ------------------
  |  |  121|     60|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|     60|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1620|    318|  wiener_info->vfilter[1] = wiener_info->vfilter[WIENER_WIN - 2] =
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1621|    318|      aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    318|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1622|    318|          rb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
 1623|    318|          WIENER_FILT_TAP1_SUBEXP_K,
 1624|    318|          ref_wiener_info->vfilter[1] - WIENER_FILT_TAP1_MINV, ACCT_STR) +
 1625|    318|      WIENER_FILT_TAP1_MINV;
  ------------------
  |  |  154|    318|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    318|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    318|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1626|    318|  wiener_info->vfilter[2] = wiener_info->vfilter[WIENER_WIN - 3] =
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1627|    318|      aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    318|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1628|    318|          rb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
 1629|    318|          WIENER_FILT_TAP2_SUBEXP_K,
 1630|    318|          ref_wiener_info->vfilter[2] - WIENER_FILT_TAP2_MINV, ACCT_STR) +
 1631|    318|      WIENER_FILT_TAP2_MINV;
  ------------------
  |  |  156|    318|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    318|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    318|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1632|       |  // The central element has an implicit +WIENER_FILT_STEP
 1633|    318|  wiener_info->vfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|    318|#define WIENER_HALFWIN 3
  ------------------
 1634|    318|      -2 * (wiener_info->vfilter[0] + wiener_info->vfilter[1] +
 1635|    318|            wiener_info->vfilter[2]);
 1636|       |
 1637|    318|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1637:7): [True: 257, False: 61]
  ------------------
 1638|    257|    wiener_info->hfilter[0] = wiener_info->hfilter[WIENER_WIN - 1] =
  ------------------
  |  |  121|    257|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    257|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1639|    257|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    257|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1640|    257|            rb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
 1641|    257|            WIENER_FILT_TAP0_SUBEXP_K,
 1642|    257|            ref_wiener_info->hfilter[0] - WIENER_FILT_TAP0_MINV, ACCT_STR) +
 1643|    257|        WIENER_FILT_TAP0_MINV;
  ------------------
  |  |  152|    257|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    257|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    257|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1644|     61|  else
 1645|     61|    wiener_info->hfilter[0] = wiener_info->hfilter[WIENER_WIN - 1] = 0;
  ------------------
  |  |  121|     61|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|     61|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1646|    318|  wiener_info->hfilter[1] = wiener_info->hfilter[WIENER_WIN - 2] =
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1647|    318|      aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    318|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1648|    318|          rb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
 1649|    318|          WIENER_FILT_TAP1_SUBEXP_K,
 1650|    318|          ref_wiener_info->hfilter[1] - WIENER_FILT_TAP1_MINV, ACCT_STR) +
 1651|    318|      WIENER_FILT_TAP1_MINV;
  ------------------
  |  |  154|    318|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    318|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    318|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1652|    318|  wiener_info->hfilter[2] = wiener_info->hfilter[WIENER_WIN - 3] =
  ------------------
  |  |  121|    318|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    318|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1653|    318|      aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|    318|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1654|    318|          rb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
 1655|    318|          WIENER_FILT_TAP2_SUBEXP_K,
 1656|    318|          ref_wiener_info->hfilter[2] - WIENER_FILT_TAP2_MINV, ACCT_STR) +
 1657|    318|      WIENER_FILT_TAP2_MINV;
  ------------------
  |  |  156|    318|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    318|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    318|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1658|       |  // The central element has an implicit +WIENER_FILT_STEP
 1659|    318|  wiener_info->hfilter[WIENER_HALFWIN] =
  ------------------
  |  |   43|    318|#define WIENER_HALFWIN 3
  ------------------
 1660|    318|      -2 * (wiener_info->hfilter[0] + wiener_info->hfilter[1] +
 1661|    318|            wiener_info->hfilter[2]);
 1662|    318|  *ref_wiener_info = *wiener_info;
 1663|    318|}
decodeframe.c:read_sgrproj_filter:
 1667|     11|                                       aom_reader *rb) {
 1668|     11|  sgrproj_info->ep = aom_read_literal(rb, SGRPROJ_PARAMS_BITS, ACCT_STR);
  ------------------
  |  |   47|     11|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1669|     11|  const sgr_params_type *params = &av1_sgr_params[sgrproj_info->ep];
 1670|       |
 1671|     11|  if (params->r[0] == 0) {
  ------------------
  |  Branch (1671:7): [True: 0, False: 11]
  ------------------
 1672|      0|    sgrproj_info->xqd[0] = 0;
 1673|      0|    sgrproj_info->xqd[1] =
 1674|      0|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|      0|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1675|      0|            rb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
 1676|      0|            ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1, ACCT_STR) +
 1677|      0|        SGRPROJ_PRJ_MIN1;
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1678|     11|  } else if (params->r[1] == 0) {
  ------------------
  |  Branch (1678:14): [True: 0, False: 11]
  ------------------
 1679|      0|    sgrproj_info->xqd[0] =
 1680|      0|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|      0|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1681|      0|            rb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
 1682|      0|            ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0, ACCT_STR) +
 1683|      0|        SGRPROJ_PRJ_MIN0;
  ------------------
  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1684|      0|    sgrproj_info->xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - sgrproj_info->xqd[0],
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
 1685|      0|                                 SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1);
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                                               SGRPROJ_PRJ_MIN1, SGRPROJ_PRJ_MAX1);
  ------------------
  |  |  109|      0|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1686|     11|  } else {
 1687|     11|    sgrproj_info->xqd[0] =
 1688|     11|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|     11|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1689|     11|            rb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
 1690|     11|            ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0, ACCT_STR) +
 1691|     11|        SGRPROJ_PRJ_MIN0;
  ------------------
  |  |  106|     11|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|     11|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1692|     11|    sgrproj_info->xqd[1] =
 1693|     11|        aom_read_primitive_refsubexpfin(
  ------------------
  |  |   28|     11|  aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1694|     11|            rb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
 1695|     11|            ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1, ACCT_STR) +
 1696|     11|        SGRPROJ_PRJ_MIN1;
  ------------------
  |  |  108|     11|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|     11|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1697|     11|  }
 1698|       |
 1699|     11|  *ref_sgrproj_info = *sgrproj_info;
 1700|     11|}
decodeframe.c:read_partition:
 1268|  1.11M|                                     BLOCK_SIZE bsize) {
 1269|  1.11M|  const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
 1270|  1.11M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1271|       |
 1272|  1.11M|  if (!has_rows && !has_cols) return PARTITION_SPLIT;
  ------------------
  |  Branch (1272:7): [True: 106k, False: 1.01M]
  |  Branch (1272:20): [True: 46.3k, False: 60.4k]
  ------------------
 1273|       |
 1274|  1.11M|  assert(ctx >= 0);
 1275|  1.07M|  aom_cdf_prob *partition_cdf = ec_ctx->partition_cdf[ctx];
 1276|  1.07M|  if (has_rows && has_cols) {
  ------------------
  |  Branch (1276:7): [True: 1.01M, False: 59.7k]
  |  Branch (1276:19): [True: 950k, False: 60.3k]
  ------------------
 1277|   950k|    return (PARTITION_TYPE)aom_read_symbol(
  ------------------
  |  |   51|   950k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1278|   950k|        r, partition_cdf, partition_cdf_length(bsize), ACCT_STR);
 1279|   950k|  } else if (!has_rows && has_cols) {
  ------------------
  |  Branch (1279:14): [True: 60.4k, False: 59.6k]
  |  Branch (1279:27): [True: 60.5k, False: 18.4E]
  ------------------
 1280|  60.5k|    assert(bsize > BLOCK_8X8);
 1281|  60.5k|    aom_cdf_prob cdf[2];
 1282|  60.5k|    partition_gather_vert_alike(cdf, partition_cdf, bsize);
 1283|  60.5k|    assert(cdf[1] == AOM_ICDF(CDF_PROB_TOP));
 1284|  60.5k|    return aom_read_cdf(r, cdf, 2, ACCT_STR) ? PARTITION_SPLIT : PARTITION_HORZ;
  ------------------
  |  |   49|  60.5k|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (49:3): [True: 53.4k, False: 7.01k]
  |  |  ------------------
  ------------------
 1285|  60.5k|  } else {
 1286|  59.6k|    assert(has_rows && !has_cols);
 1287|  59.6k|    assert(bsize > BLOCK_8X8);
 1288|  59.6k|    aom_cdf_prob cdf[2];
 1289|  59.6k|    partition_gather_horz_alike(cdf, partition_cdf, bsize);
 1290|  59.6k|    assert(cdf[1] == AOM_ICDF(CDF_PROB_TOP));
 1291|  59.6k|    return aom_read_cdf(r, cdf, 2, ACCT_STR) ? PARTITION_SPLIT : PARTITION_VERT;
  ------------------
  |  |   49|  59.6k|  aom_read_cdf_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (49:3): [True: 51.4k, False: 8.18k]
  |  |  ------------------
  ------------------
 1292|  59.6k|  }
 1293|  1.07M|}
decodeframe.c:signal_parse_sb_row_done:
 3225|  45.0k|                                            const int sb_mi_size) {
 3226|  45.0k|  AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info;
 3227|  45.0k|#if CONFIG_MULTITHREAD
 3228|  45.0k|  pthread_mutex_lock(pbi->row_mt_mutex_);
 3229|  45.0k|#endif
 3230|  45.0k|  assert(frame_row_mt_info->mi_rows_parse_done >=
 3231|  45.0k|         frame_row_mt_info->mi_rows_decode_started);
 3232|  45.0k|  tile_data->dec_row_mt_sync.mi_rows_parse_done += sb_mi_size;
 3233|  45.0k|  frame_row_mt_info->mi_rows_parse_done += sb_mi_size;
 3234|  45.0k|#if CONFIG_MULTITHREAD
 3235|       |  // A new decode job is available. Wake up one worker thread to handle the
 3236|       |  // new decode job.
 3237|       |  // NOTE: This assumes we bump mi_rows_parse_done and mi_rows_decode_started
 3238|       |  // by the same increment (sb_mi_size).
 3239|  45.0k|  pthread_cond_signal(pbi->row_mt_cond_);
 3240|  45.0k|  pthread_mutex_unlock(pbi->row_mt_mutex_);
 3241|  45.0k|#endif
 3242|  45.0k|}
decodeframe.c:check_trailing_bits_after_symbol_coder:
 2723|  45.0k|static int check_trailing_bits_after_symbol_coder(aom_reader *r) {
 2724|  45.0k|  if (aom_reader_has_overflowed(r)) return -1;
  ------------------
  |  Branch (2724:7): [True: 0, False: 45.0k]
  ------------------
 2725|       |
 2726|  45.0k|  uint32_t nb_bits = aom_reader_tell(r);
 2727|  45.0k|  uint32_t nb_bytes = (nb_bits + 7) >> 3;
 2728|  45.0k|  const uint8_t *p = aom_reader_find_begin(r) + nb_bytes;
 2729|       |
 2730|       |  // aom_reader_tell() returns 1 for a newly initialized decoder, and the
 2731|       |  // return value only increases as values are decoded. So nb_bits > 0, and
 2732|       |  // thus p > p_begin. Therefore accessing p[-1] is safe.
 2733|  45.0k|  uint8_t last_byte = p[-1];
 2734|  45.0k|  uint8_t pattern = 128 >> ((nb_bits - 1) & 7);
 2735|  45.0k|  if ((last_byte & (2 * pattern - 1)) != pattern) return -1;
  ------------------
  |  Branch (2735:7): [True: 0, False: 45.0k]
  ------------------
 2736|       |
 2737|       |  // Make sure that all padding bytes are zero as required by the spec.
 2738|  45.0k|  const uint8_t *p_end = aom_reader_find_end(r);
 2739|  45.0k|  while (p < p_end) {
  ------------------
  |  Branch (2739:10): [True: 0, False: 45.0k]
  ------------------
 2740|      0|    if (*p != 0) return -1;
  ------------------
  |  Branch (2740:9): [True: 0, False: 0]
  ------------------
 2741|      0|    p++;
 2742|      0|  }
 2743|  45.0k|  return 0;
 2744|  45.0k|}
decodeframe.c:get_next_job_info:
 3121|   107k|                             int *end_of_frame) {
 3122|   107k|  AV1_COMMON *cm = &pbi->common;
 3123|   107k|  TileDataDec *tile_data;
 3124|   107k|  AV1DecRowMTSync *dec_row_mt_sync;
 3125|   107k|  AV1DecRowMTInfo *frame_row_mt_info = &pbi->frame_row_mt_info;
 3126|   107k|  const int tile_rows_start = frame_row_mt_info->tile_rows_start;
 3127|   107k|  const int tile_rows_end = frame_row_mt_info->tile_rows_end;
 3128|   107k|  const int tile_cols_start = frame_row_mt_info->tile_cols_start;
 3129|   107k|  const int tile_cols_end = frame_row_mt_info->tile_cols_end;
 3130|   107k|  const int start_tile = frame_row_mt_info->start_tile;
 3131|   107k|  const int end_tile = frame_row_mt_info->end_tile;
 3132|   107k|  const int sb_mi_size = mi_size_wide[cm->seq_params->sb_size];
 3133|   107k|  int num_mis_to_decode, num_threads_working;
 3134|   107k|  int num_mis_waiting_for_decode;
 3135|   107k|  int min_threads_working = INT_MAX;
 3136|   107k|  int max_mis_to_decode = 0;
 3137|   107k|  int tile_row_idx, tile_col_idx;
 3138|   107k|  int tile_row = -1;
 3139|   107k|  int tile_col = -1;
 3140|       |
 3141|   107k|  memset(next_job_info, 0, sizeof(*next_job_info));
 3142|       |
 3143|       |  // Frame decode is completed or error is encountered.
 3144|   107k|  *end_of_frame = (frame_row_mt_info->mi_rows_decode_started ==
  ------------------
  |  Branch (3144:19): [True: 43.6k, False: 63.9k]
  ------------------
 3145|   107k|                   frame_row_mt_info->mi_rows_to_decode) ||
 3146|  63.9k|                  (frame_row_mt_info->row_mt_exit == 1);
  ------------------
  |  Branch (3146:19): [True: 0, False: 63.9k]
  ------------------
 3147|   107k|  if (*end_of_frame) {
  ------------------
  |  Branch (3147:7): [True: 43.6k, False: 63.9k]
  ------------------
 3148|  43.6k|    return 1;
 3149|  43.6k|  }
 3150|       |
 3151|       |  // Decoding cannot start as bit-stream parsing is not complete.
 3152|   107k|  assert(frame_row_mt_info->mi_rows_parse_done >=
 3153|  63.9k|         frame_row_mt_info->mi_rows_decode_started);
 3154|  63.9k|  if (frame_row_mt_info->mi_rows_parse_done ==
  ------------------
  |  Branch (3154:7): [True: 17.5k, False: 46.4k]
  ------------------
 3155|  63.9k|      frame_row_mt_info->mi_rows_decode_started)
 3156|  17.5k|    return 0;
 3157|       |
 3158|       |  // Choose the tile to decode.
 3159|   125k|  for (tile_row_idx = tile_rows_start; tile_row_idx < tile_rows_end;
  ------------------
  |  Branch (3159:40): [True: 78.7k, False: 46.4k]
  ------------------
 3160|  78.7k|       ++tile_row_idx) {
 3161|   233k|    for (tile_col_idx = tile_cols_start; tile_col_idx < tile_cols_end;
  ------------------
  |  Branch (3161:42): [True: 154k, False: 78.7k]
  ------------------
 3162|   154k|         ++tile_col_idx) {
 3163|   154k|      if (tile_row_idx * cm->tiles.cols + tile_col_idx < start_tile ||
  ------------------
  |  Branch (3163:11): [True: 0, False: 154k]
  ------------------
 3164|   154k|          tile_row_idx * cm->tiles.cols + tile_col_idx > end_tile)
  ------------------
  |  Branch (3164:11): [True: 0, False: 154k]
  ------------------
 3165|      0|        continue;
 3166|       |
 3167|   154k|      tile_data = pbi->tile_data + tile_row_idx * cm->tiles.cols + tile_col_idx;
 3168|   154k|      dec_row_mt_sync = &tile_data->dec_row_mt_sync;
 3169|       |
 3170|   154k|      num_threads_working = dec_row_mt_sync->num_threads_working;
 3171|   154k|      num_mis_waiting_for_decode = (dec_row_mt_sync->mi_rows_parse_done -
 3172|   154k|                                    dec_row_mt_sync->mi_rows_decode_started) *
 3173|   154k|                                   dec_row_mt_sync->mi_cols;
 3174|   154k|      num_mis_to_decode =
 3175|   154k|          (dec_row_mt_sync->mi_rows - dec_row_mt_sync->mi_rows_decode_started) *
 3176|   154k|          dec_row_mt_sync->mi_cols;
 3177|       |
 3178|   154k|      assert(num_mis_to_decode >= num_mis_waiting_for_decode);
 3179|       |
 3180|       |      // Pick the tile which has minimum number of threads working on it.
 3181|   154k|      if (num_mis_waiting_for_decode > 0) {
  ------------------
  |  Branch (3181:11): [True: 55.1k, False: 99.7k]
  ------------------
 3182|  55.1k|        if (num_threads_working < min_threads_working) {
  ------------------
  |  Branch (3182:13): [True: 46.8k, False: 8.23k]
  ------------------
 3183|  46.8k|          min_threads_working = num_threads_working;
 3184|  46.8k|          max_mis_to_decode = 0;
 3185|  46.8k|        }
 3186|  55.1k|        if (num_threads_working == min_threads_working &&
  ------------------
  |  Branch (3186:13): [True: 54.6k, False: 403]
  ------------------
 3187|  54.6k|            num_mis_to_decode > max_mis_to_decode &&
  ------------------
  |  Branch (3187:13): [True: 47.2k, False: 7.46k]
  ------------------
 3188|  47.2k|            num_threads_working <
  ------------------
  |  Branch (3188:13): [True: 45.3k, False: 1.89k]
  ------------------
 3189|  47.2k|                get_max_row_mt_workers_per_tile(cm, &tile_data->tile_info)) {
 3190|  45.3k|          max_mis_to_decode = num_mis_to_decode;
 3191|  45.3k|          tile_row = tile_row_idx;
 3192|  45.3k|          tile_col = tile_col_idx;
 3193|  45.3k|        }
 3194|  55.1k|      }
 3195|   154k|    }
 3196|  78.7k|  }
 3197|       |  // No job found to process
 3198|  46.4k|  if (tile_row == -1 || tile_col == -1) return 0;
  ------------------
  |  Branch (3198:7): [True: 1.42k, False: 45.0k]
  |  Branch (3198:25): [True: 0, False: 45.0k]
  ------------------
 3199|       |
 3200|  45.0k|  tile_data = pbi->tile_data + tile_row * cm->tiles.cols + tile_col;
 3201|  45.0k|  dec_row_mt_sync = &tile_data->dec_row_mt_sync;
 3202|       |
 3203|  45.0k|  next_job_info->tile_row = tile_row;
 3204|  45.0k|  next_job_info->tile_col = tile_col;
 3205|  45.0k|  next_job_info->mi_row = dec_row_mt_sync->mi_rows_decode_started +
 3206|  45.0k|                          tile_data->tile_info.mi_row_start;
 3207|       |
 3208|  45.0k|  dec_row_mt_sync->num_threads_working++;
 3209|  45.0k|  dec_row_mt_sync->mi_rows_decode_started += sb_mi_size;
 3210|  45.0k|  frame_row_mt_info->mi_rows_decode_started += sb_mi_size;
 3211|  45.0k|  assert(frame_row_mt_info->mi_rows_parse_done >=
 3212|  45.0k|         frame_row_mt_info->mi_rows_decode_started);
 3213|  45.0k|#if CONFIG_MULTITHREAD
 3214|  45.0k|  if (frame_row_mt_info->mi_rows_decode_started ==
  ------------------
  |  Branch (3214:7): [True: 26.2k, False: 18.7k]
  ------------------
 3215|  45.0k|      frame_row_mt_info->mi_rows_to_decode) {
 3216|  26.2k|    pthread_cond_broadcast(pbi->row_mt_cond_);
 3217|  26.2k|  }
 3218|  45.0k|#endif
 3219|       |
 3220|  45.0k|  return 1;
 3221|  46.4k|}
decodeframe.c:decode_tile_sb_row:
 2685|  45.0k|                                      const int mi_row) {
 2686|  45.0k|  AV1_COMMON *const cm = &pbi->common;
 2687|  45.0k|  const int num_planes = av1_num_planes(cm);
 2688|  45.0k|  TileDataDec *const tile_data = pbi->tile_data +
 2689|  45.0k|                                 tile_info->tile_row * cm->tiles.cols +
 2690|  45.0k|                                 tile_info->tile_col;
 2691|  45.0k|  const int sb_cols_in_tile = av1_get_sb_cols_in_tile(cm, tile_info);
 2692|  45.0k|  const int sb_row_in_tile =
 2693|  45.0k|      (mi_row - tile_info->mi_row_start) >> cm->seq_params->mib_size_log2;
 2694|  45.0k|  int sb_col_in_tile = 0;
 2695|  45.0k|  int row_mt_exit = 0;
 2696|       |
 2697|  93.4k|  for (int mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end;
  ------------------
  |  Branch (2697:46): [True: 48.4k, False: 45.0k]
  ------------------
 2698|  48.4k|       mi_col += cm->seq_params->mib_size, sb_col_in_tile++) {
 2699|  48.4k|    set_cb_buffer(pbi, &td->dcb, pbi->cb_buffer_base, num_planes, mi_row,
 2700|  48.4k|                  mi_col);
 2701|       |
 2702|  48.4k|    sync_read(&tile_data->dec_row_mt_sync, sb_row_in_tile, sb_col_in_tile);
 2703|       |
 2704|  48.4k|#if CONFIG_MULTITHREAD
 2705|  48.4k|    pthread_mutex_lock(pbi->row_mt_mutex_);
 2706|  48.4k|#endif
 2707|  48.4k|    row_mt_exit = pbi->frame_row_mt_info.row_mt_exit;
 2708|  48.4k|#if CONFIG_MULTITHREAD
 2709|  48.4k|    pthread_mutex_unlock(pbi->row_mt_mutex_);
 2710|  48.4k|#endif
 2711|       |
 2712|  48.4k|    if (!row_mt_exit) {
  ------------------
  |  Branch (2712:9): [True: 48.4k, False: 18.4E]
  ------------------
 2713|       |      // Decoding of the super-block
 2714|  48.4k|      decode_partition(pbi, td, mi_row, mi_col, td->bit_reader,
 2715|  48.4k|                       cm->seq_params->sb_size, 0x2);
 2716|  48.4k|    }
 2717|       |
 2718|  48.4k|    sync_write(&tile_data->dec_row_mt_sync, sb_row_in_tile, sb_col_in_tile,
 2719|  48.4k|               sb_cols_in_tile);
 2720|  48.4k|  }
 2721|  45.0k|}
decodeframe.c:sync_read:
 2617|  48.4k|                             int c) {
 2618|  48.4k|#if CONFIG_MULTITHREAD
 2619|  48.4k|  const int nsync = dec_row_mt_sync->sync_range;
 2620|       |
 2621|  48.4k|  if (r && !(c & (nsync - 1))) {
  ------------------
  |  Branch (2621:7): [True: 3.31k, False: 45.0k]
  |  Branch (2621:12): [True: 3.31k, False: 0]
  ------------------
 2622|  3.31k|    pthread_mutex_t *const mutex = &dec_row_mt_sync->mutex_[r - 1];
 2623|  3.31k|    pthread_mutex_lock(mutex);
 2624|       |
 2625|  3.91k|    while (c > dec_row_mt_sync->cur_sb_col[r - 1] - nsync -
  ------------------
  |  Branch (2625:12): [True: 593, False: 3.31k]
  ------------------
 2626|  3.91k|                   dec_row_mt_sync->intrabc_extra_top_right_sb_delay) {
 2627|    593|      pthread_cond_wait(&dec_row_mt_sync->cond_[r - 1], mutex);
 2628|    593|    }
 2629|  3.31k|    pthread_mutex_unlock(mutex);
 2630|  3.31k|  }
 2631|       |#else
 2632|       |  (void)dec_row_mt_sync;
 2633|       |  (void)r;
 2634|       |  (void)c;
 2635|       |#endif  // CONFIG_MULTITHREAD
 2636|  48.4k|}
decodeframe.c:launch_dec_workers:
 3554|  26.2k|                                      int num_workers) {
 3555|  26.2k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 3556|       |
 3557|  69.8k|  for (int worker_idx = num_workers - 1; worker_idx >= 0; --worker_idx) {
  ------------------
  |  Branch (3557:42): [True: 43.6k, False: 26.2k]
  ------------------
 3558|  43.6k|    AVxWorker *const worker = &pbi->tile_workers[worker_idx];
 3559|  43.6k|    DecWorkerData *const thread_data = (DecWorkerData *)worker->data1;
 3560|       |
 3561|  43.6k|    thread_data->data_end = data_end;
 3562|       |
 3563|  43.6k|    worker->had_error = 0;
 3564|  43.6k|    if (worker_idx == 0) {
  ------------------
  |  Branch (3564:9): [True: 26.2k, False: 17.3k]
  ------------------
 3565|  26.2k|      winterface->execute(worker);
 3566|  26.2k|    } else {
 3567|  17.3k|      winterface->launch(worker);
 3568|  17.3k|    }
 3569|  43.6k|  }
 3570|  26.2k|}
decodeframe.c:sync_dec_workers:
 3572|  26.2k|static inline void sync_dec_workers(AV1Decoder *pbi, int num_workers) {
 3573|  26.2k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 3574|  26.2k|  int corrupted = 0;
 3575|       |
 3576|  69.8k|  for (int worker_idx = num_workers; worker_idx > 0; --worker_idx) {
  ------------------
  |  Branch (3576:38): [True: 43.6k, False: 26.2k]
  ------------------
 3577|  43.6k|    AVxWorker *const worker = &pbi->tile_workers[worker_idx - 1];
 3578|  43.6k|    aom_merge_corrupted_flag(&corrupted, !winterface->sync(worker));
 3579|  43.6k|  }
 3580|       |
 3581|  26.2k|  pbi->dcb.corrupted = corrupted;
 3582|  26.2k|}
decodeframe.c:decode_tile:
 2769|  3.00k|                               int tile_row, int tile_col) {
 2770|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2771|       |  start_timing(pbi, decode_tile_time);
 2772|       |#endif
 2773|  3.00k|  TileInfo tile_info;
 2774|       |
 2775|  3.00k|  AV1_COMMON *const cm = &pbi->common;
 2776|  3.00k|  const int num_planes = av1_num_planes(cm);
 2777|       |
 2778|  3.00k|  av1_tile_set_row(&tile_info, cm, tile_row);
 2779|  3.00k|  av1_tile_set_col(&tile_info, cm, tile_col);
 2780|  3.00k|  DecoderCodingBlock *const dcb = &td->dcb;
 2781|  3.00k|  MACROBLOCKD *const xd = &dcb->xd;
 2782|       |
 2783|  3.00k|  av1_zero_above_context(cm, xd, tile_info.mi_col_start, tile_info.mi_col_end,
 2784|  3.00k|                         tile_row);
 2785|  3.00k|  av1_reset_loop_filter_delta(xd, num_planes);
 2786|  3.00k|  av1_reset_loop_restoration(xd, num_planes);
 2787|       |
 2788|  6.19k|  for (int mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end;
  ------------------
  |  Branch (2788:45): [True: 3.19k, False: 3.00k]
  ------------------
 2789|  3.19k|       mi_row += cm->seq_params->mib_size) {
 2790|  3.19k|    av1_zero_left_context(xd);
 2791|       |
 2792|  6.76k|    for (int mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end;
  ------------------
  |  Branch (2792:47): [True: 3.57k, False: 3.19k]
  ------------------
 2793|  3.57k|         mi_col += cm->seq_params->mib_size) {
 2794|  3.57k|      set_cb_buffer(pbi, dcb, &td->cb_buffer_base, num_planes, 0, 0);
 2795|       |
 2796|       |#if CONFIG_INSPECTION
 2797|       |      const int start_bits = aom_reader_tell(td->bit_reader);
 2798|       |#endif
 2799|       |      // Bit-stream parsing and decoding of the superblock
 2800|  3.57k|      decode_partition(pbi, td, mi_row, mi_col, td->bit_reader,
 2801|  3.57k|                       cm->seq_params->sb_size, 0x3);
 2802|       |#if CONFIG_INSPECTION
 2803|       |      const int end_bits = aom_reader_tell(td->bit_reader);
 2804|       |#endif
 2805|       |
 2806|       |#if CONFIG_INSPECTION
 2807|       |      if (pbi->sb_bits) {
 2808|       |        const int mib_size = cm->seq_params->mib_size;
 2809|       |        const int sb_cols = (cm->mi_params.mi_cols + mib_size - 1) / mib_size;
 2810|       |        const int sb_row = mi_row / mib_size;
 2811|       |        const int sb_col = mi_col / mib_size;
 2812|       |        pbi->sb_bits[sb_row * sb_cols + sb_col] = end_bits - start_bits;
 2813|       |      }
 2814|       |#endif
 2815|       |
 2816|  3.57k|      if (aom_reader_has_overflowed(td->bit_reader)) {
  ------------------
  |  Branch (2816:11): [True: 0, False: 3.57k]
  ------------------
 2817|      0|        aom_merge_corrupted_flag(&dcb->corrupted, 1);
 2818|      0|        return;
 2819|      0|      }
 2820|  3.57k|    }
 2821|  3.19k|  }
 2822|       |
 2823|  3.00k|  int corrupted =
 2824|  3.00k|      (check_trailing_bits_after_symbol_coder(td->bit_reader)) ? 1 : 0;
  ------------------
  |  Branch (2824:7): [True: 0, False: 3.00k]
  ------------------
 2825|  3.00k|  aom_merge_corrupted_flag(&dcb->corrupted, corrupted);
 2826|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2827|       |  end_timing(pbi, decode_tile_time);
 2828|       |#endif
 2829|  3.00k|}
decodeframe.c:decode_tiles:
 2833|  1.82k|                                   int end_tile) {
 2834|  1.82k|  AV1_COMMON *const cm = &pbi->common;
 2835|       |#if CONFIG_INSPECTION
 2836|       |  const int mib_size = cm->seq_params->mib_size;
 2837|       |  const int sb_cols = (cm->mi_params.mi_cols + mib_size - 1) / mib_size;
 2838|       |  const int sb_rows = (cm->mi_params.mi_rows + mib_size - 1) / mib_size;
 2839|       |  const int required_size = sb_cols * sb_rows;
 2840|       |  if (pbi->sb_bits_alloc_size < required_size) {
 2841|       |    aom_free(pbi->sb_bits);
 2842|       |    CHECK_MEM_ERROR(cm, pbi->sb_bits,
 2843|       |                    (int *)aom_malloc(sizeof(*pbi->sb_bits) * required_size));
 2844|       |    pbi->sb_bits_alloc_size = required_size;
 2845|       |  }
 2846|       |#endif
 2847|  1.82k|  ThreadData *const td = &pbi->td;
 2848|  1.82k|  CommonTileParams *const tiles = &cm->tiles;
 2849|  1.82k|  const int tile_cols = tiles->cols;
 2850|  1.82k|  const int tile_rows = tiles->rows;
 2851|  1.82k|  const int n_tiles = tile_cols * tile_rows;
 2852|  1.82k|  TileBufferDec(*const tile_buffers)[MAX_TILE_COLS] = pbi->tile_buffers;
 2853|  1.82k|  const int dec_tile_row = AOMMIN(pbi->dec_tile_row, tile_rows);
  ------------------
  |  |   34|  1.82k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.82k, False: 0]
  |  |  ------------------
  ------------------
 2854|  1.82k|  const int single_row = pbi->dec_tile_row >= 0;
 2855|  1.82k|  const int dec_tile_col = AOMMIN(pbi->dec_tile_col, tile_cols);
  ------------------
  |  |   34|  1.82k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.82k, False: 0]
  |  |  ------------------
  ------------------
 2856|  1.82k|  const int single_col = pbi->dec_tile_col >= 0;
 2857|  1.82k|  int tile_rows_start;
 2858|  1.82k|  int tile_rows_end;
 2859|  1.82k|  int tile_cols_start;
 2860|  1.82k|  int tile_cols_end;
 2861|  1.82k|  int inv_col_order;
 2862|  1.82k|  int inv_row_order;
 2863|  1.82k|  int tile_row, tile_col;
 2864|  1.82k|  uint8_t allow_update_cdf;
 2865|  1.82k|  const uint8_t *raw_data_end = NULL;
 2866|       |
 2867|  1.82k|  if (tiles->large_scale) {
  ------------------
  |  Branch (2867:7): [True: 0, False: 1.82k]
  ------------------
 2868|      0|    tile_rows_start = single_row ? dec_tile_row : 0;
  ------------------
  |  Branch (2868:23): [True: 0, False: 0]
  ------------------
 2869|      0|    tile_rows_end = single_row ? dec_tile_row + 1 : tile_rows;
  ------------------
  |  Branch (2869:21): [True: 0, False: 0]
  ------------------
 2870|      0|    tile_cols_start = single_col ? dec_tile_col : 0;
  ------------------
  |  Branch (2870:23): [True: 0, False: 0]
  ------------------
 2871|      0|    tile_cols_end = single_col ? tile_cols_start + 1 : tile_cols;
  ------------------
  |  Branch (2871:21): [True: 0, False: 0]
  ------------------
 2872|      0|    inv_col_order = pbi->inv_tile_order && !single_col;
  ------------------
  |  Branch (2872:21): [True: 0, False: 0]
  |  Branch (2872:44): [True: 0, False: 0]
  ------------------
 2873|      0|    inv_row_order = pbi->inv_tile_order && !single_row;
  ------------------
  |  Branch (2873:21): [True: 0, False: 0]
  |  Branch (2873:44): [True: 0, False: 0]
  ------------------
 2874|      0|    allow_update_cdf = 0;
 2875|  1.82k|  } else {
 2876|  1.82k|    tile_rows_start = 0;
 2877|  1.82k|    tile_rows_end = tile_rows;
 2878|  1.82k|    tile_cols_start = 0;
 2879|  1.82k|    tile_cols_end = tile_cols;
 2880|  1.82k|    inv_col_order = pbi->inv_tile_order;
 2881|  1.82k|    inv_row_order = pbi->inv_tile_order;
 2882|  1.82k|    allow_update_cdf = 1;
 2883|  1.82k|  }
 2884|       |
 2885|       |  // No tiles to decode.
 2886|  1.82k|  if (tile_rows_end <= tile_rows_start || tile_cols_end <= tile_cols_start ||
  ------------------
  |  Branch (2886:7): [True: 0, False: 1.82k]
  |  Branch (2886:43): [True: 0, False: 1.82k]
  ------------------
 2887|       |      // First tile is larger than end_tile.
 2888|  1.82k|      tile_rows_start * tiles->cols + tile_cols_start > end_tile ||
  ------------------
  |  Branch (2888:7): [True: 0, False: 1.82k]
  ------------------
 2889|       |      // Last tile is smaller than start_tile.
 2890|  1.82k|      (tile_rows_end - 1) * tiles->cols + tile_cols_end - 1 < start_tile)
  ------------------
  |  Branch (2890:7): [True: 0, False: 1.82k]
  ------------------
 2891|      0|    return data;
 2892|       |
 2893|  1.82k|  allow_update_cdf = allow_update_cdf && !cm->features.disable_cdf_update;
  ------------------
  |  Branch (2893:22): [True: 1.82k, False: 0]
  |  Branch (2893:42): [True: 1.82k, False: 0]
  ------------------
 2894|       |
 2895|  1.82k|  assert(tile_rows <= MAX_TILE_ROWS);
 2896|  1.82k|  assert(tile_cols <= MAX_TILE_COLS);
 2897|       |
 2898|  1.82k|#if EXT_TILE_DEBUG
 2899|  1.82k|  if (tiles->large_scale && !pbi->ext_tile_debug)
  ------------------
  |  Branch (2899:7): [True: 0, False: 1.82k]
  |  Branch (2899:29): [True: 0, False: 0]
  ------------------
 2900|      0|    raw_data_end = get_ls_single_tile_buffer(pbi, data, tile_buffers);
 2901|  1.82k|  else if (tiles->large_scale && pbi->ext_tile_debug)
  ------------------
  |  Branch (2901:12): [True: 0, False: 1.82k]
  |  Branch (2901:34): [True: 0, False: 0]
  ------------------
 2902|      0|    raw_data_end = get_ls_tile_buffers(pbi, data, data_end, tile_buffers);
 2903|  1.82k|  else
 2904|  1.82k|#endif  // EXT_TILE_DEBUG
 2905|  1.82k|    get_tile_buffers(pbi, data, data_end, tile_buffers, start_tile, end_tile);
 2906|       |
 2907|  1.82k|  if (pbi->tile_data == NULL || n_tiles != pbi->allocated_tiles) {
  ------------------
  |  Branch (2907:7): [True: 455, False: 1.36k]
  |  Branch (2907:33): [True: 202, False: 1.16k]
  ------------------
 2908|    657|    decoder_alloc_tile_data(pbi, n_tiles);
 2909|    657|  }
 2910|  1.82k|  if (pbi->dcb.xd.seg_mask == NULL)
  ------------------
  |  Branch (2910:7): [True: 455, False: 1.36k]
  ------------------
 2911|  1.82k|    CHECK_MEM_ERROR(cm, pbi->dcb.xd.seg_mask,
  ------------------
  |  |   51|    455|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|    455|  do {                                                    \
  |  |  |  |   72|    455|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|    455|    lval = (expr);                                        \
  |  |  |  |   74|    455|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 455]
  |  |  |  |  ------------------
  |  |  |  |   75|    455|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|    455|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 455]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2912|  1.82k|                    (uint8_t *)aom_memalign(
 2913|  1.82k|                        16, 2 * MAX_SB_SQUARE * sizeof(*pbi->dcb.xd.seg_mask)));
 2914|       |#if CONFIG_ACCOUNTING
 2915|       |  if (pbi->acct_enabled) {
 2916|       |    aom_accounting_reset(&pbi->accounting);
 2917|       |  }
 2918|       |#endif
 2919|       |
 2920|  1.82k|  set_decode_func_pointers(&pbi->td, 0x3);
 2921|       |
 2922|       |  // Load all tile information into thread_data.
 2923|  1.82k|  td->dcb = pbi->dcb;
 2924|       |
 2925|  1.82k|  td->dcb.corrupted = 0;
 2926|  1.82k|  td->dcb.mc_buf[0] = td->mc_buf[0];
 2927|  1.82k|  td->dcb.mc_buf[1] = td->mc_buf[1];
 2928|  1.82k|  td->dcb.xd.tmp_conv_dst = td->tmp_conv_dst;
 2929|  5.46k|  for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (2929:19): [True: 3.64k, False: 1.82k]
  ------------------
 2930|  3.64k|    td->dcb.xd.tmp_obmc_bufs[j] = td->tmp_obmc_bufs[j];
 2931|  3.64k|  }
 2932|       |
 2933|  4.11k|  for (tile_row = tile_rows_start; tile_row < tile_rows_end; ++tile_row) {
  ------------------
  |  Branch (2933:36): [True: 2.29k, False: 1.82k]
  ------------------
 2934|  2.29k|    const int row = inv_row_order ? tile_rows - 1 - tile_row : tile_row;
  ------------------
  |  Branch (2934:21): [True: 0, False: 2.29k]
  ------------------
 2935|       |
 2936|  5.30k|    for (tile_col = tile_cols_start; tile_col < tile_cols_end; ++tile_col) {
  ------------------
  |  Branch (2936:38): [True: 3.00k, False: 2.29k]
  ------------------
 2937|  3.00k|      const int col = inv_col_order ? tile_cols - 1 - tile_col : tile_col;
  ------------------
  |  Branch (2937:23): [True: 0, False: 3.00k]
  ------------------
 2938|  3.00k|      TileDataDec *const tile_data = pbi->tile_data + row * tiles->cols + col;
 2939|  3.00k|      const TileBufferDec *const tile_bs_buf = &tile_buffers[row][col];
 2940|       |
 2941|  3.00k|      if (row * tiles->cols + col < start_tile ||
  ------------------
  |  Branch (2941:11): [True: 0, False: 3.00k]
  ------------------
 2942|  3.00k|          row * tiles->cols + col > end_tile)
  ------------------
  |  Branch (2942:11): [True: 0, False: 3.00k]
  ------------------
 2943|      0|        continue;
 2944|       |
 2945|  3.00k|      td->bit_reader = &tile_data->bit_reader;
 2946|  3.00k|      av1_zero(td->cb_buffer_base.dqcoeff);
  ------------------
  |  |   43|  3.00k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2947|  3.00k|      av1_tile_init(&td->dcb.xd.tile, cm, row, col);
 2948|  3.00k|      td->dcb.xd.current_base_qindex = cm->quant_params.base_qindex;
 2949|  3.00k|      setup_bool_decoder(&td->dcb.xd, tile_bs_buf->data, data_end,
 2950|  3.00k|                         tile_bs_buf->size, &pbi->error, td->bit_reader,
 2951|  3.00k|                         allow_update_cdf);
 2952|       |#if CONFIG_ACCOUNTING
 2953|       |      if (pbi->acct_enabled) {
 2954|       |        td->bit_reader->accounting = &pbi->accounting;
 2955|       |        td->bit_reader->accounting->last_tell_frac =
 2956|       |            aom_reader_tell_frac(td->bit_reader);
 2957|       |      } else {
 2958|       |        td->bit_reader->accounting = NULL;
 2959|       |      }
 2960|       |#endif
 2961|  3.00k|      av1_init_macroblockd(cm, &td->dcb.xd);
 2962|  3.00k|      av1_init_above_context(&cm->above_contexts, av1_num_planes(cm), row,
 2963|  3.00k|                             &td->dcb.xd);
 2964|       |
 2965|       |      // Initialise the tile context from the frame context
 2966|  3.00k|      tile_data->tctx = *cm->fc;
 2967|  3.00k|      td->dcb.xd.tile_ctx = &tile_data->tctx;
 2968|       |
 2969|       |      // decode tile
 2970|  3.00k|      decode_tile(pbi, td, row, col);
 2971|  3.00k|      aom_merge_corrupted_flag(&pbi->dcb.corrupted, td->dcb.corrupted);
 2972|  3.00k|      if (pbi->dcb.corrupted)
  ------------------
  |  Branch (2972:11): [True: 0, False: 3.00k]
  ------------------
 2973|      0|        aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
 2974|      0|                           "Failed to decode tile data");
 2975|  3.00k|    }
 2976|  2.29k|  }
 2977|       |
 2978|  1.82k|  if (tiles->large_scale) {
  ------------------
  |  Branch (2978:7): [True: 0, False: 1.82k]
  ------------------
 2979|      0|    if (n_tiles == 1) {
  ------------------
  |  Branch (2979:9): [True: 0, False: 0]
  ------------------
 2980|       |      // Find the end of the single tile buffer
 2981|      0|      return aom_reader_find_end(&pbi->tile_data->bit_reader);
 2982|      0|    }
 2983|       |    // Return the end of the last tile buffer
 2984|      0|    return raw_data_end;
 2985|      0|  }
 2986|  1.82k|  TileDataDec *const tile_data = pbi->tile_data + end_tile;
 2987|       |
 2988|  1.82k|  return aom_reader_find_end(&tile_data->bit_reader);
 2989|  1.82k|}
decodeframe.c:set_planes_to_neutral_grey:
  103|  17.2k|    int only_chroma) {
  104|  17.2k|  if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (104:7): [True: 3.84k, False: 13.4k]
  ------------------
  105|  3.84k|    const int val = 1 << (seq_params->bit_depth - 1);
  106|  11.5k|    for (int plane = only_chroma; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|  11.5k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (106:35): [True: 7.68k, False: 3.84k]
  ------------------
  107|  7.68k|      const int is_uv = plane > 0;
  108|  7.68k|      uint16_t *const base = CONVERT_TO_SHORTPTR(buf->buffers[plane]);
  ------------------
  |  |   79|  7.68k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  109|       |      // Set the first row to neutral grey. Then copy the first row to all
  110|       |      // subsequent rows.
  111|  7.68k|      if (buf->crop_heights[is_uv] > 0) {
  ------------------
  |  Branch (111:11): [True: 7.68k, False: 0]
  ------------------
  112|  7.68k|        aom_memset16(base, val, buf->crop_widths[is_uv]);
  113|   130k|        for (int row_idx = 1; row_idx < buf->crop_heights[is_uv]; row_idx++) {
  ------------------
  |  Branch (113:31): [True: 122k, False: 7.68k]
  ------------------
  114|   122k|          memcpy(&base[row_idx * buf->strides[is_uv]], base,
  115|   122k|                 sizeof(*base) * buf->crop_widths[is_uv]);
  116|   122k|        }
  117|  7.68k|      }
  118|  7.68k|    }
  119|  13.4k|  } else {
  120|  40.2k|    for (int plane = only_chroma; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|  40.2k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (120:35): [True: 26.8k, False: 13.4k]
  ------------------
  121|  26.8k|      const int is_uv = plane > 0;
  122|   542k|      for (int row_idx = 0; row_idx < buf->crop_heights[is_uv]; row_idx++) {
  ------------------
  |  Branch (122:29): [True: 515k, False: 26.8k]
  ------------------
  123|   515k|        memset(&buf->buffers[plane][row_idx * buf->strides[is_uv]], 1 << 7,
  124|   515k|               buf->crop_widths[is_uv]);
  125|   515k|      }
  126|  26.8k|    }
  127|  13.4k|  }
  128|  17.2k|}
decodeframe.c:superres_post_decode:
 5248|  20.6k|static inline void superres_post_decode(AV1Decoder *pbi) {
 5249|  20.6k|  AV1_COMMON *const cm = &pbi->common;
 5250|  20.6k|  BufferPool *const pool = cm->buffer_pool;
 5251|       |
 5252|  20.6k|  if (!av1_superres_scaled(cm)) return;
  ------------------
  |  Branch (5252:7): [True: 20.6k, False: 0]
  ------------------
 5253|  20.6k|  assert(!cm->features.all_lossless);
 5254|       |
 5255|      0|  av1_superres_upscale(cm, pool, 0);
 5256|      0|}

av1_read_tx_type:
  627|  1.31M|                      int blk_col, TX_SIZE tx_size, aom_reader *r) {
  628|  1.31M|  MB_MODE_INFO *mbmi = xd->mi[0];
  629|  1.31M|  uint8_t *tx_type =
  630|  1.31M|      &xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
  631|  1.31M|  *tx_type = DCT_DCT;
  632|       |
  633|       |  // No need to read transform type if block is skipped.
  634|  1.31M|  if (mbmi->skip_txfm ||
  ------------------
  |  Branch (634:7): [True: 18.4E, False: 1.31M]
  ------------------
  635|  1.31M|      segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP))
  ------------------
  |  Branch (635:7): [True: 18.4E, False: 1.31M]
  ------------------
  636|      0|    return;
  637|       |
  638|       |  // No need to read transform type for lossless mode(qindex==0).
  639|  1.31M|  const int qindex = xd->qindex[mbmi->segment_id];
  640|  1.31M|  if (qindex == 0) return;
  ------------------
  |  Branch (640:7): [True: 138k, False: 1.17M]
  ------------------
  641|       |
  642|  1.17M|  const int inter_block = is_inter_block(mbmi);
  643|  1.17M|  if (get_ext_tx_types(tx_size, inter_block, cm->features.reduced_tx_set_used) >
  ------------------
  |  Branch (643:7): [True: 1.17M, False: 18.4E]
  ------------------
  644|  1.17M|      1) {
  645|  1.17M|    const TxSetType tx_set_type = av1_get_ext_tx_set_type(
  646|  1.17M|        tx_size, inter_block, cm->features.reduced_tx_set_used);
  647|  1.17M|    const int eset =
  648|  1.17M|        get_ext_tx_set(tx_size, inter_block, cm->features.reduced_tx_set_used);
  649|       |    // eset == 0 should correspond to a set with only DCT_DCT and
  650|       |    // there is no need to read the tx_type
  651|  1.17M|    assert(eset != 0);
  652|       |
  653|  1.17M|    const TX_SIZE square_tx_size = txsize_sqr_map[tx_size];
  654|  1.17M|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  655|  1.17M|    if (inter_block) {
  ------------------
  |  Branch (655:9): [True: 253k, False: 923k]
  ------------------
  656|   253k|      *tx_type = av1_ext_tx_inv[tx_set_type][aom_read_symbol(
  ------------------
  |  |   51|   253k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  657|   253k|          r, ec_ctx->inter_ext_tx_cdf[eset][square_tx_size],
  658|   253k|          av1_num_ext_tx_set[tx_set_type], ACCT_STR)];
  659|   923k|    } else {
  660|   923k|      const PREDICTION_MODE intra_mode =
  661|   923k|          mbmi->filter_intra_mode_info.use_filter_intra
  ------------------
  |  Branch (661:11): [True: 388k, False: 535k]
  ------------------
  662|   923k|              ? fimode_to_intradir[mbmi->filter_intra_mode_info
  663|   388k|                                       .filter_intra_mode]
  664|   923k|              : mbmi->mode;
  665|   923k|      *tx_type = av1_ext_tx_inv[tx_set_type][aom_read_symbol(
  ------------------
  |  |   51|   923k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  666|   923k|          r, ec_ctx->intra_ext_tx_cdf[eset][square_tx_size][intra_mode],
  667|   923k|          av1_num_ext_tx_set[tx_set_type], ACCT_STR)];
  668|   923k|    }
  669|  1.17M|  }
  670|  1.17M|}
av1_read_mode_info:
 1572|   781k|                        aom_reader *r, int x_mis, int y_mis) {
 1573|   781k|  AV1_COMMON *const cm = &pbi->common;
 1574|   781k|  MACROBLOCKD *const xd = &dcb->xd;
 1575|   781k|  MB_MODE_INFO *const mi = xd->mi[0];
 1576|   781k|  mi->use_intrabc = 0;
 1577|       |
 1578|   781k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (1578:7): [True: 61.9k, False: 719k]
  ------------------
 1579|  61.9k|    read_intra_frame_mode_info(cm, dcb, r);
 1580|  61.9k|    if (cm->seq_params->order_hint_info.enable_ref_frame_mvs)
  ------------------
  |  Branch (1580:9): [True: 61.9k, False: 60]
  ------------------
 1581|  61.9k|      intra_copy_frame_mvs(cm, xd->mi_row, xd->mi_col, x_mis, y_mis);
 1582|   719k|  } else {
 1583|   719k|    read_inter_frame_mode_info(pbi, dcb, r);
 1584|   719k|    if (cm->seq_params->order_hint_info.enable_ref_frame_mvs)
  ------------------
  |  Branch (1584:9): [True: 716k, False: 2.03k]
  ------------------
 1585|   716k|      av1_copy_frame_mvs(cm, mi, xd->mi_row, xd->mi_col, x_mis, y_mis);
 1586|   719k|  }
 1587|   781k|}
decodemv.c:read_intra_frame_mode_info:
  774|  61.9k|                                       DecoderCodingBlock *dcb, aom_reader *r) {
  775|  61.9k|  MACROBLOCKD *const xd = &dcb->xd;
  776|  61.9k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  777|  61.9k|  const MB_MODE_INFO *above_mi = xd->above_mbmi;
  778|  61.9k|  const MB_MODE_INFO *left_mi = xd->left_mbmi;
  779|  61.9k|  const BLOCK_SIZE bsize = mbmi->bsize;
  780|  61.9k|  struct segmentation *const seg = &cm->seg;
  781|       |
  782|  61.9k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  783|       |
  784|  61.9k|  if (seg->segid_preskip)
  ------------------
  |  Branch (784:7): [True: 0, False: 61.9k]
  ------------------
  785|      0|    mbmi->segment_id = read_intra_segment_id(cm, xd, bsize, r, 0);
  786|       |
  787|  61.9k|  mbmi->skip_txfm = read_skip_txfm(cm, xd, mbmi->segment_id, r);
  788|       |
  789|  61.9k|  if (!seg->segid_preskip)
  ------------------
  |  Branch (789:7): [True: 61.9k, False: 59]
  ------------------
  790|  61.9k|    mbmi->segment_id = read_intra_segment_id(cm, xd, bsize, r, mbmi->skip_txfm);
  791|       |
  792|  61.9k|  read_cdef(cm, r, xd);
  793|       |
  794|  61.9k|  read_delta_q_params(cm, xd, r);
  795|       |
  796|  61.9k|  mbmi->current_qindex = xd->current_base_qindex;
  797|       |
  798|  61.9k|  mbmi->ref_frame[0] = INTRA_FRAME;
  799|  61.9k|  mbmi->ref_frame[1] = NONE_FRAME;
  800|  61.9k|  mbmi->palette_mode_info.palette_size[0] = 0;
  801|  61.9k|  mbmi->palette_mode_info.palette_size[1] = 0;
  802|  61.9k|  mbmi->filter_intra_mode_info.use_filter_intra = 0;
  803|       |
  804|  61.9k|  const int mi_row = xd->mi_row;
  805|  61.9k|  const int mi_col = xd->mi_col;
  806|  61.9k|  xd->above_txfm_context = cm->above_contexts.txfm[xd->tile.tile_row] + mi_col;
  807|  61.9k|  xd->left_txfm_context =
  808|  61.9k|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  61.9k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  61.9k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  61.9k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  61.9k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  61.9k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|       |
  810|  61.9k|  if (av1_allow_intrabc(cm)) {
  ------------------
  |  Branch (810:7): [True: 0, False: 61.9k]
  ------------------
  811|      0|    read_intrabc_info(cm, dcb, r);
  812|      0|    if (is_intrabc_block(mbmi)) return;
  ------------------
  |  Branch (812:9): [True: 0, False: 0]
  ------------------
  813|      0|  }
  814|       |
  815|  61.9k|  mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi, left_mi));
  816|       |
  817|  61.9k|  const int use_angle_delta = av1_use_angle_delta(bsize);
  818|  61.9k|  mbmi->angle_delta[PLANE_TYPE_Y] =
  819|  61.9k|      (use_angle_delta && av1_is_directional_mode(mbmi->mode))
  ------------------
  |  Branch (819:8): [True: 58.8k, False: 3.11k]
  |  Branch (819:27): [True: 15.4k, False: 43.4k]
  ------------------
  820|  61.9k|          ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED])
  821|  61.9k|          : 0;
  822|       |
  823|  61.9k|  if (!cm->seq_params->monochrome && xd->is_chroma_ref) {
  ------------------
  |  Branch (823:7): [True: 25.4k, False: 36.5k]
  |  Branch (823:38): [True: 24.6k, False: 825]
  ------------------
  824|  24.6k|    mbmi->uv_mode =
  825|  24.6k|        read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode);
  826|  24.6k|    if (mbmi->uv_mode == UV_CFL_PRED) {
  ------------------
  |  Branch (826:9): [True: 11.9k, False: 12.6k]
  ------------------
  827|  11.9k|      mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs);
  828|  11.9k|    }
  829|  24.6k|    const PREDICTION_MODE intra_mode = get_uv_mode(mbmi->uv_mode);
  830|  24.6k|    mbmi->angle_delta[PLANE_TYPE_UV] =
  831|  24.6k|        (use_angle_delta && av1_is_directional_mode(intra_mode))
  ------------------
  |  Branch (831:10): [True: 23.3k, False: 1.35k]
  |  Branch (831:29): [True: 1.16k, False: 22.1k]
  ------------------
  832|  24.6k|            ? read_angle_delta(r, ec_ctx->angle_delta_cdf[intra_mode - V_PRED])
  833|  24.6k|            : 0;
  834|  37.3k|  } else {
  835|       |    // Avoid decoding angle_info if there is no chroma prediction
  836|  37.3k|    mbmi->uv_mode = UV_DC_PRED;
  837|  37.3k|  }
  838|  61.9k|  xd->cfl.store_y = store_cfl_required(cm, xd);
  839|       |
  840|  61.9k|  if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize))
  ------------------
  |  Branch (840:7): [True: 1.78k, False: 60.1k]
  ------------------
  841|  1.78k|    read_palette_mode_info(cm, xd, r);
  842|       |
  843|  61.9k|  read_filter_intra_mode_info(cm, xd, r);
  844|  61.9k|}
decodemv.c:read_intra_segment_id:
  316|  61.9k|                                 aom_reader *r, int skip) {
  317|  61.9k|  struct segmentation *const seg = &cm->seg;
  318|  61.9k|  if (!seg->enabled) return 0;  // Default for disabled segmentation
  ------------------
  |  Branch (318:7): [True: 61.9k, False: 6]
  ------------------
  319|  61.9k|  assert(seg->update_map && !seg->temporal_update);
  320|       |
  321|      6|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  322|      6|  const int mi_row = xd->mi_row;
  323|      6|  const int mi_col = xd->mi_col;
  324|      6|  const int mi_stride = cm->mi_params.mi_cols;
  325|      6|  const int mi_offset = mi_row * mi_stride + mi_col;
  326|      6|  const int bw = mi_size_wide[bsize];
  327|      6|  const int bh = mi_size_high[bsize];
  328|      6|  const int x_mis = AOMMIN(mi_params->mi_cols - mi_col, bw);
  ------------------
  |  |   34|      6|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  329|      6|  const int y_mis = AOMMIN(mi_params->mi_rows - mi_row, bh);
  ------------------
  |  |   34|      6|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  330|      6|  const int segment_id = read_segment_id(cm, xd, r, skip);
  331|      6|  set_segment_id(cm->cur_frame->seg_map, mi_offset, x_mis, y_mis, mi_stride,
  332|      6|                 segment_id);
  333|      6|  return segment_id;
  334|  61.9k|}
decodemv.c:read_skip_txfm:
  447|   780k|                          aom_reader *r) {
  448|   780k|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (448:7): [True: 0, False: 780k]
  ------------------
  449|      0|    return 1;
  450|   780k|  } else {
  451|   780k|    const int ctx = av1_get_skip_txfm_context(xd);
  452|   780k|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  453|   780k|    const int skip_txfm =
  454|   780k|        aom_read_symbol(r, ec_ctx->skip_txfm_cdfs[ctx], 2, ACCT_STR);
  ------------------
  |  |   51|   780k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  455|   780k|    return skip_txfm;
  456|   780k|  }
  457|   780k|}
decodemv.c:read_cdef:
   40|   778k|static void read_cdef(AV1_COMMON *cm, aom_reader *r, MACROBLOCKD *const xd) {
   41|   778k|  const int skip_txfm = xd->mi[0]->skip_txfm;
   42|   778k|  if (cm->features.coded_lossless) return;
  ------------------
  |  Branch (42:7): [True: 30.1k, False: 748k]
  ------------------
   43|   748k|  if (cm->features.allow_intrabc) {
  ------------------
  |  Branch (43:7): [True: 0, False: 748k]
  ------------------
   44|      0|    assert(cm->cdef_info.cdef_bits == 0);
   45|      0|    return;
   46|      0|  }
   47|       |
   48|       |  // At the start of a superblock, mark that we haven't yet read CDEF strengths
   49|       |  // for any of the CDEF units contained in this superblock.
   50|   748k|  const int sb_mask = (cm->seq_params->mib_size - 1);
   51|   748k|  const int mi_row_in_sb = (xd->mi_row & sb_mask);
   52|   748k|  const int mi_col_in_sb = (xd->mi_col & sb_mask);
   53|   748k|  if (mi_row_in_sb == 0 && mi_col_in_sb == 0) {
  ------------------
  |  Branch (53:7): [True: 177k, False: 571k]
  |  Branch (53:28): [True: 49.6k, False: 127k]
  ------------------
   54|  49.6k|    xd->cdef_transmitted[0] = xd->cdef_transmitted[1] =
   55|  49.6k|        xd->cdef_transmitted[2] = xd->cdef_transmitted[3] = false;
   56|  49.6k|  }
   57|       |
   58|       |  // CDEF unit size is 64x64 irrespective of the superblock size.
   59|   748k|  const int cdef_size = 1 << (6 - MI_SIZE_LOG2);
  ------------------
  |  |   39|   748k|#define MI_SIZE_LOG2 2
  ------------------
   60|       |
   61|       |  // Find index of this CDEF unit in this superblock.
   62|   748k|  const int index_mask = cdef_size;
   63|   748k|  const int cdef_unit_row_in_sb = ((xd->mi_row & index_mask) != 0);
   64|   748k|  const int cdef_unit_col_in_sb = ((xd->mi_col & index_mask) != 0);
   65|   748k|  const int index = (cm->seq_params->sb_size == BLOCK_128X128)
  ------------------
  |  Branch (65:21): [True: 0, False: 748k]
  ------------------
   66|   748k|                        ? cdef_unit_col_in_sb + 2 * cdef_unit_row_in_sb
   67|   748k|                        : 0;
   68|       |
   69|       |  // Read CDEF strength from the first non-skip coding block in this CDEF unit.
   70|   748k|  if (!xd->cdef_transmitted[index] && !skip_txfm) {
  ------------------
  |  Branch (70:7): [True: 56.5k, False: 691k]
  |  Branch (70:39): [True: 48.7k, False: 7.81k]
  ------------------
   71|       |    // CDEF strength for this CDEF unit needs to be read into the MB_MODE_INFO
   72|       |    // of the 1st block in this CDEF unit.
   73|  48.7k|    const int first_block_mask = ~(cdef_size - 1);
   74|  48.7k|    CommonModeInfoParams *const mi_params = &cm->mi_params;
   75|  48.7k|    const int grid_idx =
   76|  48.7k|        get_mi_grid_idx(mi_params, xd->mi_row & first_block_mask,
   77|  48.7k|                        xd->mi_col & first_block_mask);
   78|  48.7k|    MB_MODE_INFO *const mbmi = mi_params->mi_grid_base[grid_idx];
   79|  48.7k|    mbmi->cdef_strength =
   80|  48.7k|        aom_read_literal(r, cm->cdef_info.cdef_bits, ACCT_STR);
  ------------------
  |  |   47|  48.7k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   81|       |    xd->cdef_transmitted[index] = true;
   82|  48.7k|  }
   83|   748k|}
decodemv.c:read_delta_q_params:
  736|   779k|                                aom_reader *r) {
  737|   779k|  DeltaQInfo *const delta_q_info = &cm->delta_q_info;
  738|       |
  739|   779k|  if (delta_q_info->delta_q_present_flag) {
  ------------------
  |  Branch (739:7): [True: 102k, False: 677k]
  ------------------
  740|   102k|    MB_MODE_INFO *const mbmi = xd->mi[0];
  741|   102k|    xd->current_base_qindex +=
  742|   102k|        read_delta_qindex(cm, xd, r, mbmi) * delta_q_info->delta_q_res;
  743|       |    /* Normative: Clamp to [1,MAXQ] to not interfere with lossless mode */
  744|   102k|    xd->current_base_qindex = clamp(xd->current_base_qindex, 1, MAXQ);
  ------------------
  |  |   26|   102k|#define MAXQ 255
  ------------------
  745|   102k|    FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
  746|   102k|    if (delta_q_info->delta_lf_present_flag) {
  ------------------
  |  Branch (746:9): [True: 0, False: 102k]
  ------------------
  747|      0|      const int mi_row = xd->mi_row;
  748|      0|      const int mi_col = xd->mi_col;
  749|      0|      if (delta_q_info->delta_lf_multi) {
  ------------------
  |  Branch (749:11): [True: 0, False: 0]
  ------------------
  750|      0|        const int frame_lf_count =
  751|      0|            av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
                          av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (751:13): [True: 0, False: 0]
  ------------------
  752|      0|        for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) {
  ------------------
  |  Branch (752:29): [True: 0, False: 0]
  ------------------
  753|      0|          const int tmp_lvl =
  754|      0|              xd->delta_lf[lf_id] +
  755|      0|              read_delta_lflevel(cm, r, ec_ctx->delta_lf_multi_cdf[lf_id], mbmi,
  756|      0|                                 mi_col, mi_row) *
  757|      0|                  delta_q_info->delta_lf_res;
  758|      0|          mbmi->delta_lf[lf_id] = xd->delta_lf[lf_id] =
  759|      0|              clamp(tmp_lvl, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
                            clamp(tmp_lvl, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  760|      0|        }
  761|      0|      } else {
  762|      0|        const int tmp_lvl = xd->delta_lf_from_base +
  763|      0|                            read_delta_lflevel(cm, r, ec_ctx->delta_lf_cdf,
  764|      0|                                               mbmi, mi_col, mi_row) *
  765|      0|                                delta_q_info->delta_lf_res;
  766|      0|        mbmi->delta_lf_from_base = xd->delta_lf_from_base =
  767|      0|            clamp(tmp_lvl, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
                          clamp(tmp_lvl, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  768|      0|      }
  769|      0|    }
  770|   102k|  }
  771|   779k|}
decodemv.c:read_delta_qindex:
   86|   102k|                             aom_reader *r, MB_MODE_INFO *const mbmi) {
   87|   102k|  int sign, abs, reduced_delta_qindex = 0;
   88|   102k|  BLOCK_SIZE bsize = mbmi->bsize;
   89|   102k|  const int b_col = xd->mi_col & (cm->seq_params->mib_size - 1);
   90|   102k|  const int b_row = xd->mi_row & (cm->seq_params->mib_size - 1);
   91|   102k|  const int read_delta_q_flag = (b_col == 0 && b_row == 0);
  ------------------
  |  Branch (91:34): [True: 37.9k, False: 64.4k]
  |  Branch (91:48): [True: 16.2k, False: 21.6k]
  ------------------
   92|   102k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
   93|       |
   94|   102k|  if ((bsize != cm->seq_params->sb_size || mbmi->skip_txfm == 0) &&
  ------------------
  |  Branch (94:8): [True: 102k, False: 97]
  |  Branch (94:44): [True: 91, False: 6]
  ------------------
   95|   102k|      read_delta_q_flag) {
  ------------------
  |  Branch (95:7): [True: 16.2k, False: 86.1k]
  ------------------
   96|  16.2k|    abs = aom_read_symbol(r, ec_ctx->delta_q_cdf, DELTA_Q_PROBS + 1, ACCT_STR);
  ------------------
  |  |   51|  16.2k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   97|  16.2k|    const int smallval = (abs < DELTA_Q_SMALL);
  ------------------
  |  |  497|  16.2k|#define DELTA_Q_SMALL 3
  ------------------
   98|       |
   99|  16.2k|    if (!smallval) {
  ------------------
  |  Branch (99:9): [True: 9.39k, False: 6.89k]
  ------------------
  100|  9.39k|      const int rem_bits = aom_read_literal(r, 3, ACCT_STR) + 1;
  ------------------
  |  |   47|  9.39k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  101|  9.39k|      const int thr = (1 << rem_bits) + 1;
  102|  9.39k|      abs = aom_read_literal(r, rem_bits, ACCT_STR) + thr;
  ------------------
  |  |   47|  9.39k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  103|  9.39k|    }
  104|       |
  105|  16.2k|    if (abs) {
  ------------------
  |  Branch (105:9): [True: 13.4k, False: 2.82k]
  ------------------
  106|  13.4k|      sign = aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|  13.4k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  107|  13.4k|    } else {
  108|  2.82k|      sign = 1;
  109|  2.82k|    }
  110|       |
  111|  16.2k|    reduced_delta_qindex = sign ? -abs : abs;
  ------------------
  |  Branch (111:28): [True: 16.2k, False: 41]
  ------------------
  112|  16.2k|  }
  113|   102k|  return reduced_delta_qindex;
  114|   102k|}
decodemv.c:read_mv:
  887|   105k|                           nmv_context *ctx, MvSubpelPrecision precision) {
  888|   105k|  MV diff = kZeroMv;
  889|   105k|  const MV_JOINT_TYPE joint_type =
  890|   105k|      (MV_JOINT_TYPE)aom_read_symbol(r, ctx->joints_cdf, MV_JOINTS, ACCT_STR);
  ------------------
  |  |   51|   105k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  891|       |
  892|   105k|  if (mv_joint_vertical(joint_type))
  ------------------
  |  Branch (892:7): [True: 95.5k, False: 9.44k]
  ------------------
  893|  95.5k|    diff.row = read_mv_component(r, &ctx->comps[0], precision > MV_SUBPEL_NONE,
  894|  95.5k|                                 precision > MV_SUBPEL_LOW_PRECISION);
  895|       |
  896|   105k|  if (mv_joint_horizontal(joint_type))
  ------------------
  |  Branch (896:7): [True: 95.4k, False: 9.53k]
  ------------------
  897|  95.4k|    diff.col = read_mv_component(r, &ctx->comps[1], precision > MV_SUBPEL_NONE,
  898|  95.4k|                                 precision > MV_SUBPEL_LOW_PRECISION);
  899|       |
  900|   105k|  mv->row = ref->row + diff.row;
  901|   105k|  mv->col = ref->col + diff.col;
  902|   105k|}
decodemv.c:read_mv_component:
  847|   190k|                             int use_subpel, int usehp) {
  848|   190k|  int mag, d, fr, hp;
  849|   190k|  const int sign = aom_read_symbol(r, mvcomp->sign_cdf, 2, ACCT_STR);
  ------------------
  |  |   51|   190k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  850|   190k|  const int mv_class =
  851|   190k|      aom_read_symbol(r, mvcomp->classes_cdf, MV_CLASSES, ACCT_STR);
  ------------------
  |  |   51|   190k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  852|   190k|  const int class0 = mv_class == MV_CLASS_0;
  853|       |
  854|       |  // Integer part
  855|   190k|  if (class0) {
  ------------------
  |  Branch (855:7): [True: 119k, False: 71.7k]
  ------------------
  856|   119k|    d = aom_read_symbol(r, mvcomp->class0_cdf, CLASS0_SIZE, ACCT_STR);
  ------------------
  |  |   51|   119k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  857|   119k|    mag = 0;
  858|   119k|  } else {
  859|  71.7k|    const int n = mv_class + CLASS0_BITS - 1;  // number of bits
  ------------------
  |  |   64|  71.7k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
  860|  71.7k|    d = 0;
  861|   204k|    for (int i = 0; i < n; ++i)
  ------------------
  |  Branch (861:21): [True: 132k, False: 71.7k]
  ------------------
  862|   132k|      d |= aom_read_symbol(r, mvcomp->bits_cdf[i], 2, ACCT_STR) << i;
  ------------------
  |  |   51|   132k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  863|  71.7k|    mag = CLASS0_SIZE << (mv_class + 2);
  ------------------
  |  |   65|  71.7k|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|  71.7k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  864|  71.7k|  }
  865|       |
  866|   190k|  if (use_subpel) {
  ------------------
  |  Branch (866:7): [True: 190k, False: 3]
  ------------------
  867|       |    // Fractional part
  868|   190k|    fr = aom_read_symbol(r, class0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf,
  ------------------
  |  |   51|   381k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 119k, False: 71.8k]
  |  |  ------------------
  ------------------
  869|   190k|                         MV_FP_SIZE, ACCT_STR);
  870|       |
  871|       |    // High precision part (if hp is not used, the default value of the hp is 1)
  872|   190k|    hp = usehp ? aom_read_symbol(
  ------------------
  |  |   51|   243k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 76.6k, False: 44.8k]
  |  |  ------------------
  ------------------
  |  Branch (872:10): [True: 121k, False: 69.3k]
  ------------------
  873|   190k|                     r, class0 ? mvcomp->class0_hp_cdf : mvcomp->hp_cdf, 2,
  874|   190k|                     ACCT_STR)
  875|   190k|               : 1;
  876|   190k|  } else {
  877|      3|    fr = 3;
  878|      3|    hp = 1;
  879|      3|  }
  880|       |
  881|       |  // Result
  882|   190k|  mag += ((d << 3) | (fr << 1) | hp) + 1;
  883|   190k|  return sign ? -mag : mag;
  ------------------
  |  Branch (883:10): [True: 95.2k, False: 95.6k]
  ------------------
  884|   190k|}
decodemv.c:is_mv_valid:
 1109|   191k|static inline int is_mv_valid(const MV *mv) {
 1110|   191k|  return mv->row > MV_LOW && mv->row < MV_UPP && mv->col > MV_LOW &&
  ------------------
  |  |   76|   382k|#define MV_LOW (-(1 << MV_IN_USE_BITS))
  |  |  ------------------
  |  |  |  |   74|   191k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
                return mv->row > MV_LOW && mv->row < MV_UPP && mv->col > MV_LOW &&
  ------------------
  |  |   75|   382k|#define MV_UPP (1 << MV_IN_USE_BITS)
  |  |  ------------------
  |  |  |  |   74|   191k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
                return mv->row > MV_LOW && mv->row < MV_UPP && mv->col > MV_LOW &&
  ------------------
  |  |   76|   382k|#define MV_LOW (-(1 << MV_IN_USE_BITS))
  |  |  ------------------
  |  |  |  |   74|   191k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
  |  Branch (1110:10): [True: 191k, False: 18.4E]
  |  Branch (1110:30): [True: 191k, False: 18.4E]
  |  Branch (1110:50): [True: 191k, False: 18.4E]
  ------------------
 1111|   191k|         mv->col < MV_UPP;
  ------------------
  |  |   75|   191k|#define MV_UPP (1 << MV_IN_USE_BITS)
  |  |  ------------------
  |  |  |  |   74|   191k|#define MV_IN_USE_BITS 14
  |  |  ------------------
  ------------------
  |  Branch (1111:10): [True: 191k, False: 18.4E]
  ------------------
 1112|   191k|}
decodemv.c:read_intra_mode:
   36|   587k|static PREDICTION_MODE read_intra_mode(aom_reader *r, aom_cdf_prob *cdf) {
   37|   587k|  return (PREDICTION_MODE)aom_read_symbol(r, cdf, INTRA_MODES, ACCT_STR);
  ------------------
  |  |   51|   587k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   38|   587k|}
decodemv.c:read_angle_delta:
  603|  62.0k|static int read_angle_delta(aom_reader *r, aom_cdf_prob *cdf) {
  604|  62.0k|  const int sym = aom_read_symbol(r, cdf, 2 * MAX_ANGLE_DELTA + 1, ACCT_STR);
  ------------------
  |  |   51|  62.0k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  605|  62.0k|  return sym - MAX_ANGLE_DELTA;
  ------------------
  |  |  467|  62.0k|#define MAX_ANGLE_DELTA 3
  ------------------
  606|  62.0k|}
decodemv.c:read_intra_mode_uv:
  143|   256k|                                             PREDICTION_MODE y_mode) {
  144|   256k|  const UV_PREDICTION_MODE uv_mode =
  145|   256k|      aom_read_symbol(r, ec_ctx->uv_mode_cdf[cfl_allowed][y_mode],
  ------------------
  |  |   51|   256k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  146|   256k|                      UV_INTRA_MODES - !cfl_allowed, ACCT_STR);
  147|   256k|  return uv_mode;
  148|   256k|}
decodemv.c:read_cfl_alphas:
  151|  93.0k|                               int8_t *signs_out) {
  152|  93.0k|  const int8_t joint_sign =
  153|  93.0k|      aom_read_symbol(r, ec_ctx->cfl_sign_cdf, CFL_JOINT_SIGNS, "cfl:signs");
  ------------------
  |  |   51|  93.0k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  154|  93.0k|  uint8_t idx = 0;
  155|       |  // Magnitudes are only coded for nonzero values
  156|  93.0k|  if (CFL_SIGN_U(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  281|  93.0k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  ------------------
  |  Branch (156:7): [True: 86.7k, False: 6.31k]
  ------------------
  157|  86.7k|    aom_cdf_prob *cdf_u = ec_ctx->cfl_alpha_cdf[CFL_CONTEXT_U(joint_sign)];
  ------------------
  |  |  288|  86.7k|#define CFL_CONTEXT_U(js) (js + 1 - CFL_SIGNS)
  ------------------
  158|  86.7k|    idx = (uint8_t)aom_read_symbol(r, cdf_u, CFL_ALPHABET_SIZE, "cfl:alpha_u")
  ------------------
  |  |   51|  86.7k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  159|  86.7k|          << CFL_ALPHABET_SIZE_LOG2;
  ------------------
  |  |  256|  86.7k|#define CFL_ALPHABET_SIZE_LOG2 4
  ------------------
  160|  86.7k|  }
  161|  93.0k|  if (CFL_SIGN_V(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  283|  93.0k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  ------------------
  |  |  |  |  281|  93.0k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  |  Branch (161:7): [True: 83.0k, False: 10.0k]
  ------------------
  162|  83.0k|    aom_cdf_prob *cdf_v = ec_ctx->cfl_alpha_cdf[CFL_CONTEXT_V(joint_sign)];
  ------------------
  |  |  291|  83.0k|  (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  283|  83.0k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  |  |  ------------------
  |  |  |  |  |  |  281|  83.0k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  281|  83.0k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  163|  83.0k|    idx += (uint8_t)aom_read_symbol(r, cdf_v, CFL_ALPHABET_SIZE, "cfl:alpha_v");
  ------------------
  |  |   51|  83.0k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  164|  83.0k|  }
  165|  93.0k|  *signs_out = joint_sign;
  166|  93.0k|  return idx;
  167|  93.0k|}
decodemv.c:read_palette_mode_info:
  568|  23.0k|                                   aom_reader *r) {
  569|  23.0k|  const int num_planes = av1_num_planes(cm);
  570|  23.0k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  571|  23.0k|  const BLOCK_SIZE bsize = mbmi->bsize;
  572|  23.0k|  assert(av1_allow_palette(cm->features.allow_screen_content_tools, bsize));
  573|  23.0k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  574|  23.0k|  const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  575|       |
  576|  23.0k|  if (mbmi->mode == DC_PRED) {
  ------------------
  |  Branch (576:7): [True: 22.1k, False: 821]
  ------------------
  577|  22.1k|    const int palette_mode_ctx = av1_get_palette_mode_ctx(xd);
  578|  22.1k|    const int modev = aom_read_symbol(
  ------------------
  |  |   51|  22.1k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  579|  22.1k|        r, xd->tile_ctx->palette_y_mode_cdf[bsize_ctx][palette_mode_ctx], 2,
  580|  22.1k|        ACCT_STR);
  581|  22.1k|    if (modev) {
  ------------------
  |  Branch (581:9): [True: 16.0k, False: 6.11k]
  ------------------
  582|  16.0k|      pmi->palette_size[0] =
  583|  16.0k|          aom_read_symbol(r, xd->tile_ctx->palette_y_size_cdf[bsize_ctx],
  ------------------
  |  |   51|  16.0k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  584|  16.0k|                          PALETTE_SIZES, ACCT_STR) +
  585|  16.0k|          2;
  586|  16.0k|      read_palette_colors_y(xd, cm->seq_params->bit_depth, pmi, r);
  587|  16.0k|    }
  588|  22.1k|  }
  589|  23.0k|  if (num_planes > 1 && mbmi->uv_mode == UV_DC_PRED && xd->is_chroma_ref) {
  ------------------
  |  Branch (589:7): [True: 17.6k, False: 5.39k]
  |  Branch (589:25): [True: 12.5k, False: 5.02k]
  |  Branch (589:56): [True: 12.5k, False: 18.4E]
  ------------------
  590|  12.5k|    const int palette_uv_mode_ctx = (pmi->palette_size[0] > 0);
  591|  12.5k|    const int modev = aom_read_symbol(
  ------------------
  |  |   51|  12.5k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  592|  12.5k|        r, xd->tile_ctx->palette_uv_mode_cdf[palette_uv_mode_ctx], 2, ACCT_STR);
  593|  12.5k|    if (modev) {
  ------------------
  |  Branch (593:9): [True: 9.28k, False: 3.31k]
  ------------------
  594|  9.28k|      pmi->palette_size[1] =
  595|  9.28k|          aom_read_symbol(r, xd->tile_ctx->palette_uv_size_cdf[bsize_ctx],
  ------------------
  |  |   51|  9.28k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  596|  9.28k|                          PALETTE_SIZES, ACCT_STR) +
  597|  9.28k|          2;
  598|  9.28k|      read_palette_colors_uv(xd, cm->seq_params->bit_depth, pmi, r);
  599|  9.28k|    }
  600|  12.5k|  }
  601|  23.0k|}
decodemv.c:read_palette_colors_y:
  479|  16.0k|                                  PALETTE_MODE_INFO *const pmi, aom_reader *r) {
  480|  16.0k|  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  481|  16.0k|  uint16_t cached_colors[PALETTE_MAX_SIZE];
  482|  16.0k|  const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
  483|  16.0k|  const int n = pmi->palette_size[0];
  484|  16.0k|  int idx = 0;
  485|  92.6k|  for (int i = 0; i < n_cache && idx < n; ++i)
  ------------------
  |  Branch (485:19): [True: 76.7k, False: 15.9k]
  |  Branch (485:34): [True: 76.5k, False: 120]
  ------------------
  486|  76.5k|    if (aom_read_bit(r, ACCT_STR)) cached_colors[idx++] = color_cache[i];
  ------------------
  |  |   43|  76.5k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 28.6k, False: 47.9k]
  |  |  ------------------
  ------------------
  487|  16.0k|  if (idx < n) {
  ------------------
  |  Branch (487:7): [True: 13.2k, False: 2.78k]
  ------------------
  488|  13.2k|    const int n_cached_colors = idx;
  489|  13.2k|    pmi->palette_colors[idx++] = aom_read_literal(r, bit_depth, ACCT_STR);
  ------------------
  |  |   47|  13.2k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  490|  13.2k|    if (idx < n) {
  ------------------
  |  Branch (490:9): [True: 10.4k, False: 2.81k]
  ------------------
  491|  10.4k|      const int min_bits = bit_depth - 3;
  492|  10.4k|      int bits = min_bits + aom_read_literal(r, 2, ACCT_STR);
  ------------------
  |  |   47|  10.4k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  493|  10.4k|      int range = (1 << bit_depth) - pmi->palette_colors[idx - 1] - 1;
  494|  38.8k|      for (; idx < n; ++idx) {
  ------------------
  |  Branch (494:14): [True: 28.3k, False: 10.4k]
  ------------------
  495|  28.3k|        assert(range >= 0);
  496|  28.3k|        const int delta = aom_read_literal(r, bits, ACCT_STR) + 1;
  ------------------
  |  |   47|  28.3k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  497|  28.3k|        pmi->palette_colors[idx] = clamp(pmi->palette_colors[idx - 1] + delta,
  498|  28.3k|                                         0, (1 << bit_depth) - 1);
  499|  28.3k|        range -= (pmi->palette_colors[idx] - pmi->palette_colors[idx - 1]);
  500|  28.3k|        bits = AOMMIN(bits, aom_ceil_log2(range));
  ------------------
  |  |   34|  28.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.3k, False: 13.0k]
  |  |  ------------------
  ------------------
  501|  28.3k|      }
  502|  10.4k|    }
  503|  13.2k|    merge_colors(pmi->palette_colors, cached_colors, n, n_cached_colors);
  504|  13.2k|  } else {
  505|  2.78k|    memcpy(pmi->palette_colors, cached_colors, n * sizeof(cached_colors[0]));
  506|  2.78k|  }
  507|  16.0k|}
decodemv.c:merge_colors:
  463|  22.3k|                         int n_colors, int n_cached_colors) {
  464|  22.3k|  if (n_cached_colors == 0) return;
  ------------------
  |  Branch (464:7): [True: 6.90k, False: 15.4k]
  ------------------
  465|  15.4k|  int cache_idx = 0, trans_idx = n_cached_colors;
  466|  94.4k|  for (int i = 0; i < n_colors; ++i) {
  ------------------
  |  Branch (466:19): [True: 78.9k, False: 15.4k]
  ------------------
  467|  78.9k|    if (cache_idx < n_cached_colors &&
  ------------------
  |  Branch (467:9): [True: 67.1k, False: 11.7k]
  ------------------
  468|  67.1k|        (trans_idx >= n_colors ||
  ------------------
  |  Branch (468:10): [True: 11.6k, False: 55.4k]
  ------------------
  469|  55.4k|         cached_colors[cache_idx] <= colors[trans_idx])) {
  ------------------
  |  Branch (469:10): [True: 23.2k, False: 32.2k]
  ------------------
  470|  34.9k|      colors[i] = cached_colors[cache_idx++];
  471|  44.0k|    } else {
  472|       |      assert(trans_idx < n_colors);
  473|  44.0k|      colors[i] = colors[trans_idx++];
  474|  44.0k|    }
  475|  78.9k|  }
  476|  15.4k|}
decodemv.c:read_palette_colors_uv:
  511|  9.28k|                                   aom_reader *r) {
  512|  9.28k|  const int n = pmi->palette_size[1];
  513|       |  // U channel colors.
  514|  9.28k|  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  515|  9.28k|  uint16_t cached_colors[PALETTE_MAX_SIZE];
  516|  9.28k|  const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  517|  9.28k|  int idx = 0;
  518|  49.5k|  for (int i = 0; i < n_cache && idx < n; ++i)
  ------------------
  |  Branch (518:19): [True: 40.2k, False: 9.22k]
  |  Branch (518:34): [True: 40.2k, False: 64]
  ------------------
  519|  40.2k|    if (aom_read_bit(r, ACCT_STR)) cached_colors[idx++] = color_cache[i];
  ------------------
  |  |   43|  40.2k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 12.7k, False: 27.5k]
  |  |  ------------------
  ------------------
  520|  9.28k|  if (idx < n) {
  ------------------
  |  Branch (520:7): [True: 9.06k, False: 216]
  ------------------
  521|  9.06k|    const int n_cached_colors = idx;
  522|  9.06k|    idx += PALETTE_MAX_SIZE;
  ------------------
  |  |   63|  9.06k|#define PALETTE_MAX_SIZE 8
  ------------------
  523|  9.06k|    pmi->palette_colors[idx++] = aom_read_literal(r, bit_depth, ACCT_STR);
  ------------------
  |  |   47|  9.06k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  524|  9.06k|    if (idx < PALETTE_MAX_SIZE + n) {
  ------------------
  |  |   63|  9.06k|#define PALETTE_MAX_SIZE 8
  ------------------
  |  Branch (524:9): [True: 8.03k, False: 1.02k]
  ------------------
  525|  8.03k|      const int min_bits = bit_depth - 3;
  526|  8.03k|      int bits = min_bits + aom_read_literal(r, 2, ACCT_STR);
  ------------------
  |  |   47|  8.03k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  527|  8.03k|      int range = (1 << bit_depth) - pmi->palette_colors[idx - 1];
  528|  30.2k|      for (; idx < PALETTE_MAX_SIZE + n; ++idx) {
  ------------------
  |  |   63|  30.2k|#define PALETTE_MAX_SIZE 8
  ------------------
  |  Branch (528:14): [True: 22.2k, False: 8.03k]
  ------------------
  529|  22.2k|        assert(range >= 0);
  530|  22.2k|        const int delta = aom_read_literal(r, bits, ACCT_STR);
  ------------------
  |  |   47|  22.2k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  531|  22.2k|        pmi->palette_colors[idx] = clamp(pmi->palette_colors[idx - 1] + delta,
  532|  22.2k|                                         0, (1 << bit_depth) - 1);
  533|  22.2k|        range -= (pmi->palette_colors[idx] - pmi->palette_colors[idx - 1]);
  534|  22.2k|        bits = AOMMIN(bits, aom_ceil_log2(range));
  ------------------
  |  |   34|  22.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.99k, False: 15.2k]
  |  |  ------------------
  ------------------
  535|  22.2k|      }
  536|  8.03k|    }
  537|  9.06k|    merge_colors(pmi->palette_colors + PALETTE_MAX_SIZE, cached_colors, n,
  ------------------
  |  |   63|  9.06k|#define PALETTE_MAX_SIZE 8
  ------------------
  538|  9.06k|                 n_cached_colors);
  539|  9.06k|  } else {
  540|    216|    memcpy(pmi->palette_colors + PALETTE_MAX_SIZE, cached_colors,
  ------------------
  |  |   63|    216|#define PALETTE_MAX_SIZE 8
  ------------------
  541|    216|           n * sizeof(cached_colors[0]));
  542|    216|  }
  543|       |
  544|       |  // V channel colors.
  545|  9.28k|  if (aom_read_bit(r, ACCT_STR)) {  // Delta encoding.
  ------------------
  |  |   43|  9.28k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 3.57k, False: 5.70k]
  |  |  ------------------
  ------------------
  546|  3.57k|    const int min_bits_v = bit_depth - 4;
  547|  3.57k|    const int max_val = 1 << bit_depth;
  548|  3.57k|    int bits = min_bits_v + aom_read_literal(r, 2, ACCT_STR);
  ------------------
  |  |   47|  3.57k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  549|  3.57k|    pmi->palette_colors[2 * PALETTE_MAX_SIZE] =
  ------------------
  |  |   63|  3.57k|#define PALETTE_MAX_SIZE 8
  ------------------
  550|  3.57k|        aom_read_literal(r, bit_depth, ACCT_STR);
  ------------------
  |  |   47|  3.57k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  551|  14.5k|    for (int i = 1; i < n; ++i) {
  ------------------
  |  Branch (551:21): [True: 10.9k, False: 3.57k]
  ------------------
  552|  10.9k|      int delta = aom_read_literal(r, bits, ACCT_STR);
  ------------------
  |  |   47|  10.9k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  553|  10.9k|      if (delta && aom_read_bit(r, ACCT_STR)) delta = -delta;
  ------------------
  |  |   43|  10.3k|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 5.37k, False: 4.97k]
  |  |  ------------------
  ------------------
  |  Branch (553:11): [True: 10.3k, False: 593]
  ------------------
  554|  10.9k|      int val = (int)pmi->palette_colors[2 * PALETTE_MAX_SIZE + i - 1] + delta;
  ------------------
  |  |   63|  10.9k|#define PALETTE_MAX_SIZE 8
  ------------------
  555|  10.9k|      if (val < 0) val += max_val;
  ------------------
  |  Branch (555:11): [True: 4.22k, False: 6.71k]
  ------------------
  556|  10.9k|      if (val >= max_val) val -= max_val;
  ------------------
  |  Branch (556:11): [True: 3.71k, False: 7.22k]
  ------------------
  557|  10.9k|      pmi->palette_colors[2 * PALETTE_MAX_SIZE + i] = val;
  ------------------
  |  |   63|  10.9k|#define PALETTE_MAX_SIZE 8
  ------------------
  558|  10.9k|    }
  559|  5.70k|  } else {
  560|  35.1k|    for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (560:21): [True: 29.4k, False: 5.70k]
  ------------------
  561|  29.4k|      pmi->palette_colors[2 * PALETTE_MAX_SIZE + i] =
  ------------------
  |  |   63|  29.4k|#define PALETTE_MAX_SIZE 8
  ------------------
  562|  29.4k|          aom_read_literal(r, bit_depth, ACCT_STR);
  ------------------
  |  |   47|  29.4k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  563|  29.4k|    }
  564|  5.70k|  }
  565|  9.28k|}
decodemv.c:read_filter_intra_mode_info:
  609|   588k|                                        MACROBLOCKD *const xd, aom_reader *r) {
  610|   588k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  611|   588k|  FILTER_INTRA_MODE_INFO *filter_intra_mode_info =
  612|   588k|      &mbmi->filter_intra_mode_info;
  613|       |
  614|   588k|  if (av1_filter_intra_allowed(cm, mbmi)) {
  ------------------
  |  Branch (614:7): [True: 513k, False: 75.0k]
  ------------------
  615|   513k|    filter_intra_mode_info->use_filter_intra = aom_read_symbol(
  ------------------
  |  |   51|   513k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  616|   513k|        r, xd->tile_ctx->filter_intra_cdfs[mbmi->bsize], 2, ACCT_STR);
  617|   513k|    if (filter_intra_mode_info->use_filter_intra) {
  ------------------
  |  Branch (617:9): [True: 242k, False: 271k]
  ------------------
  618|   242k|      filter_intra_mode_info->filter_intra_mode = aom_read_symbol(
  ------------------
  |  |   51|   242k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  619|   242k|          r, xd->tile_ctx->filter_intra_mode_cdf, FILTER_INTRA_MODES, ACCT_STR);
  620|   242k|    }
  621|   513k|  } else {
  622|  75.0k|    filter_intra_mode_info->use_filter_intra = 0;
  623|  75.0k|  }
  624|   588k|}
decodemv.c:intra_copy_frame_mvs:
 1554|  61.9k|                                 int x_mis, int y_mis) {
 1555|  61.9k|  const int frame_mvs_stride = ROUND_POWER_OF_TWO(cm->mi_params.mi_cols, 1);
  ------------------
  |  |   41|  61.9k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1556|  61.9k|  MV_REF *frame_mvs =
 1557|  61.9k|      cm->cur_frame->mvs + (mi_row >> 1) * frame_mvs_stride + (mi_col >> 1);
 1558|  61.9k|  x_mis = ROUND_POWER_OF_TWO(x_mis, 1);
  ------------------
  |  |   41|  61.9k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1559|  61.9k|  y_mis = ROUND_POWER_OF_TWO(y_mis, 1);
  ------------------
  |  |   41|  61.9k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1560|       |
 1561|   137k|  for (int h = 0; h < y_mis; h++) {
  ------------------
  |  Branch (1561:19): [True: 75.9k, False: 61.9k]
  ------------------
 1562|  75.9k|    MV_REF *mv = frame_mvs;
 1563|   190k|    for (int w = 0; w < x_mis; w++) {
  ------------------
  |  Branch (1563:21): [True: 114k, False: 75.9k]
  ------------------
 1564|   114k|      mv->ref_frame = NONE_FRAME;
 1565|   114k|      mv++;
 1566|   114k|    }
 1567|  75.9k|    frame_mvs += frame_mvs_stride;
 1568|  75.9k|  }
 1569|  61.9k|}
decodemv.c:read_inter_frame_mode_info:
 1513|   719k|                                       DecoderCodingBlock *dcb, aom_reader *r) {
 1514|   719k|  AV1_COMMON *const cm = &pbi->common;
 1515|   719k|  MACROBLOCKD *const xd = &dcb->xd;
 1516|   719k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1517|   719k|  int inter_block = 1;
 1518|       |
 1519|   719k|  mbmi->mv[0].as_int = 0;
 1520|   719k|  mbmi->mv[1].as_int = 0;
 1521|   719k|  mbmi->segment_id = read_inter_segment_id(cm, xd, 1, r);
 1522|       |
 1523|   719k|  mbmi->skip_mode = read_skip_mode(cm, xd, mbmi->segment_id, r);
 1524|       |
 1525|   719k|  if (mbmi->skip_mode)
  ------------------
  |  Branch (1525:7): [True: 0, False: 719k]
  ------------------
 1526|      0|    mbmi->skip_txfm = 1;
 1527|   719k|  else
 1528|   719k|    mbmi->skip_txfm = read_skip_txfm(cm, xd, mbmi->segment_id, r);
 1529|       |
 1530|   719k|  if (!cm->seg.segid_preskip)
  ------------------
  |  Branch (1530:7): [True: 716k, False: 2.35k]
  ------------------
 1531|   716k|    mbmi->segment_id = read_inter_segment_id(cm, xd, 0, r);
 1532|       |
 1533|   719k|  read_cdef(cm, r, xd);
 1534|       |
 1535|   719k|  read_delta_q_params(cm, xd, r);
 1536|       |
 1537|   719k|  if (!mbmi->skip_mode)
  ------------------
  |  Branch (1537:7): [True: 717k, False: 1.60k]
  ------------------
 1538|   717k|    inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r);
 1539|       |
 1540|   719k|  mbmi->current_qindex = xd->current_base_qindex;
 1541|       |
 1542|   719k|  xd->above_txfm_context =
 1543|   719k|      cm->above_contexts.txfm[xd->tile.tile_row] + xd->mi_col;
 1544|   719k|  xd->left_txfm_context =
 1545|   719k|      xd->left_txfm_context_buffer + (xd->mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|   719k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   719k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   719k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   719k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   719k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1546|       |
 1547|   719k|  if (inter_block)
  ------------------
  |  Branch (1547:7): [True: 191k, False: 527k]
  ------------------
 1548|   191k|    read_inter_block_mode_info(pbi, dcb, mbmi, r);
 1549|   527k|  else
 1550|   527k|    read_intra_block_mode_info(cm, xd, mbmi, r);
 1551|   719k|}
decodemv.c:read_inter_segment_id:
  364|  1.42M|                                 int preskip, aom_reader *r) {
  365|  1.42M|  struct segmentation *const seg = &cm->seg;
  366|  1.42M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  367|  1.42M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  368|  1.42M|  const int mi_row = xd->mi_row;
  369|  1.42M|  const int mi_col = xd->mi_col;
  370|  1.42M|  const int mi_offset = mi_row * mi_params->mi_cols + mi_col;
  371|  1.42M|  const int bw = mi_size_wide[mbmi->bsize];
  372|  1.42M|  const int bh = mi_size_high[mbmi->bsize];
  373|       |
  374|       |  // TODO(slavarnway): move x_mis, y_mis into xd ?????
  375|  1.42M|  const int x_mis = AOMMIN(mi_params->mi_cols - mi_col, bw);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.95k, False: 1.42M]
  |  |  ------------------
  ------------------
  376|  1.42M|  const int y_mis = AOMMIN(mi_params->mi_rows - mi_row, bh);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.74k, False: 1.42M]
  |  |  ------------------
  ------------------
  377|       |
  378|  1.42M|  if (!seg->enabled) return 0;  // Default for disabled segmentation
  ------------------
  |  Branch (378:7): [True: 1.42M, False: 18.4E]
  ------------------
  379|       |
  380|  18.4E|  if (!seg->update_map) {
  ------------------
  |  Branch (380:7): [True: 0, False: 18.4E]
  ------------------
  381|      0|    copy_segment_id(mi_params, cm->last_frame_seg_map, cm->cur_frame->seg_map,
  382|      0|                    mi_offset, x_mis, y_mis);
  383|      0|    return get_predicted_segment_id(cm, mi_offset, x_mis, y_mis);
  384|      0|  }
  385|       |
  386|  18.4E|  uint8_t segment_id;
  387|  18.4E|  const int mi_stride = cm->mi_params.mi_cols;
  388|  18.4E|  if (preskip) {
  ------------------
  |  Branch (388:7): [True: 0, False: 18.4E]
  ------------------
  389|      0|    if (!seg->segid_preskip) return 0;
  ------------------
  |  Branch (389:9): [True: 0, False: 0]
  ------------------
  390|  18.4E|  } else {
  391|  18.4E|    if (mbmi->skip_txfm) {
  ------------------
  |  Branch (391:9): [True: 0, False: 18.4E]
  ------------------
  392|      0|      if (seg->temporal_update) {
  ------------------
  |  Branch (392:11): [True: 0, False: 0]
  ------------------
  393|      0|        mbmi->seg_id_predicted = 0;
  394|      0|      }
  395|      0|      segment_id = read_segment_id(cm, xd, r, 1);
  396|      0|      set_segment_id(cm->cur_frame->seg_map, mi_offset, x_mis, y_mis, mi_stride,
  397|      0|                     segment_id);
  398|      0|      return segment_id;
  399|      0|    }
  400|  18.4E|  }
  401|       |
  402|  18.4E|  if (seg->temporal_update) {
  ------------------
  |  Branch (402:7): [True: 0, False: 18.4E]
  ------------------
  403|      0|    const uint8_t ctx = av1_get_pred_context_seg_id(xd);
  404|      0|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  405|      0|    struct segmentation_probs *const segp = &ec_ctx->seg;
  406|      0|    aom_cdf_prob *pred_cdf = segp->pred_cdf[ctx];
  407|      0|    mbmi->seg_id_predicted = aom_read_symbol(r, pred_cdf, 2, ACCT_STR);
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  408|      0|    if (mbmi->seg_id_predicted) {
  ------------------
  |  Branch (408:9): [True: 0, False: 0]
  ------------------
  409|      0|      segment_id = get_predicted_segment_id(cm, mi_offset, x_mis, y_mis);
  410|      0|    } else {
  411|      0|      segment_id = read_segment_id(cm, xd, r, 0);
  412|      0|    }
  413|  18.4E|  } else {
  414|  18.4E|    segment_id = read_segment_id(cm, xd, r, 0);
  415|  18.4E|  }
  416|  18.4E|  set_segment_id(cm->cur_frame->seg_map, mi_offset, x_mis, y_mis, mi_stride,
  417|  18.4E|                 segment_id);
  418|  18.4E|  return segment_id;
  419|  18.4E|}
decodemv.c:read_skip_mode:
  422|   718k|                          aom_reader *r) {
  423|   718k|  if (!cm->current_frame.skip_mode_info.skip_mode_flag) return 0;
  ------------------
  |  Branch (423:7): [True: 718k, False: 5]
  ------------------
  424|       |
  425|      5|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (425:7): [True: 0, False: 5]
  ------------------
  426|      0|    return 0;
  427|      0|  }
  428|       |
  429|      5|  if (!is_comp_ref_allowed(xd->mi[0]->bsize)) return 0;
  ------------------
  |  Branch (429:7): [True: 0, False: 5]
  ------------------
  430|       |
  431|      5|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME) ||
  ------------------
  |  Branch (431:7): [True: 5, False: 0]
  ------------------
  432|      0|      segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (432:7): [True: 0, False: 0]
  ------------------
  433|       |    // These features imply single-reference mode, while skip mode implies
  434|       |    // compound reference. Hence, the two are mutually exclusive.
  435|       |    // In other words, skip_mode is implicitly 0 here.
  436|      0|    return 0;
  437|      0|  }
  438|       |
  439|      5|  const int ctx = av1_get_skip_mode_context(xd);
  440|      5|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  441|      5|  const int skip_mode =
  442|      5|      aom_read_symbol(r, ec_ctx->skip_mode_cdfs[ctx], 2, ACCT_STR);
  ------------------
  |  |   51|      5|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  443|      5|  return skip_mode;
  444|      5|}
decodemv.c:read_is_inter_block:
 1224|   717k|                               int segment_id, aom_reader *r) {
 1225|   717k|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (1225:7): [True: 0, False: 717k]
  ------------------
 1226|      0|    const int frame = get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
 1227|      0|    if (frame < LAST_FRAME) return 0;
  ------------------
  |  Branch (1227:9): [True: 0, False: 0]
  ------------------
 1228|      0|    return frame != INTRA_FRAME;
 1229|      0|  }
 1230|   717k|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (1230:7): [True: 0, False: 717k]
  ------------------
 1231|      0|    return 1;
 1232|      0|  }
 1233|   717k|  const int ctx = av1_get_intra_inter_context(xd);
 1234|   717k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1235|   717k|  const int is_inter =
 1236|   717k|      aom_read_symbol(r, ec_ctx->intra_inter_cdf[ctx], 2, ACCT_STR);
  ------------------
  |  |   51|   717k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1237|   717k|  return is_inter;
 1238|   717k|}
decodemv.c:read_inter_block_mode_info:
 1276|   191k|                                       aom_reader *r) {
 1277|   191k|  AV1_COMMON *const cm = &pbi->common;
 1278|   191k|  FeatureFlags *const features = &cm->features;
 1279|   191k|  const BLOCK_SIZE bsize = mbmi->bsize;
 1280|   191k|  const int allow_hp = features->allow_high_precision_mv;
 1281|   191k|  int_mv nearestmv[2], nearmv[2];
 1282|   191k|  int_mv ref_mvs[MODE_CTX_REF_FRAMES][MAX_MV_REF_CANDIDATES] = { { { 0 } } };
 1283|   191k|  int16_t inter_mode_ctx[MODE_CTX_REF_FRAMES];
 1284|   191k|  int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 1285|   191k|  MACROBLOCKD *const xd = &dcb->xd;
 1286|   191k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1287|       |
 1288|   191k|  mbmi->uv_mode = UV_DC_PRED;
 1289|   191k|  mbmi->palette_mode_info.palette_size[0] = 0;
 1290|   191k|  mbmi->palette_mode_info.palette_size[1] = 0;
 1291|       |
 1292|   191k|  av1_collect_neighbors_ref_counts(xd);
 1293|       |
 1294|   191k|  read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame);
 1295|   191k|  const int is_compound = has_second_ref(mbmi);
 1296|       |
 1297|   191k|  const MV_REFERENCE_FRAME ref_frame = av1_ref_frame_type(mbmi->ref_frame);
 1298|   191k|  av1_find_mv_refs(cm, xd, mbmi, ref_frame, dcb->ref_mv_count, xd->ref_mv_stack,
 1299|   191k|                   xd->weight, ref_mvs, /*global_mvs=*/NULL, inter_mode_ctx);
 1300|       |
 1301|   191k|  mbmi->ref_mv_idx = 0;
 1302|       |
 1303|   191k|  if (mbmi->skip_mode) {
  ------------------
  |  Branch (1303:7): [True: 0, False: 191k]
  ------------------
 1304|      0|    assert(is_compound);
 1305|      0|    mbmi->mode = NEAREST_NEARESTMV;
 1306|   191k|  } else {
 1307|   191k|    if (segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) ||
  ------------------
  |  Branch (1307:9): [True: 18.4E, False: 192k]
  ------------------
 1308|   192k|        segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (1308:9): [True: 90, False: 191k]
  ------------------
 1309|      0|      mbmi->mode = GLOBALMV;
 1310|   191k|    } else {
 1311|   191k|      const int mode_ctx =
 1312|   191k|          av1_mode_context_analyzer(inter_mode_ctx, mbmi->ref_frame);
 1313|   191k|      if (is_compound)
  ------------------
  |  Branch (1313:11): [True: 0, False: 191k]
  ------------------
 1314|      0|        mbmi->mode = read_inter_compound_mode(xd, r, mode_ctx);
 1315|   191k|      else
 1316|   191k|        mbmi->mode = read_inter_mode(ec_ctx, r, mode_ctx);
 1317|   191k|      if (mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV ||
  ------------------
  |  Branch (1317:11): [True: 104k, False: 86.2k]
  |  Branch (1317:34): [True: 18.4E, False: 86.2k]
  ------------------
 1318|  86.3k|          have_nearmv_in_inter_mode(mbmi->mode))
  ------------------
  |  Branch (1318:11): [True: 20.8k, False: 65.4k]
  ------------------
 1319|   126k|        read_drl_idx(ec_ctx, dcb, mbmi, r);
 1320|   191k|    }
 1321|   191k|  }
 1322|       |
 1323|   191k|  if (is_compound != is_inter_compound_mode(mbmi->mode)) {
  ------------------
  |  Branch (1323:7): [True: 0, False: 191k]
  ------------------
 1324|      0|    aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
 1325|      0|                       "Prediction mode %d invalid with ref frame %d %d",
 1326|      0|                       mbmi->mode, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 1327|      0|  }
 1328|       |
 1329|   191k|  if (!is_compound && mbmi->mode != GLOBALMV) {
  ------------------
  |  Branch (1329:7): [True: 191k, False: 2]
  |  Branch (1329:23): [True: 186k, False: 5.07k]
  ------------------
 1330|   186k|    av1_find_best_ref_mvs(allow_hp, ref_mvs[mbmi->ref_frame[0]], &nearestmv[0],
 1331|   186k|                          &nearmv[0], features->cur_frame_force_integer_mv);
 1332|   186k|  }
 1333|       |
 1334|   191k|  if (is_compound && mbmi->mode != GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (1334:7): [True: 0, False: 191k]
  |  Branch (1334:22): [True: 0, False: 0]
  ------------------
 1335|      0|    const int ref_mv_idx = mbmi->ref_mv_idx + 1;
 1336|      0|    nearestmv[0] = xd->ref_mv_stack[ref_frame][0].this_mv;
 1337|      0|    nearestmv[1] = xd->ref_mv_stack[ref_frame][0].comp_mv;
 1338|      0|    nearmv[0] = xd->ref_mv_stack[ref_frame][ref_mv_idx].this_mv;
 1339|      0|    nearmv[1] = xd->ref_mv_stack[ref_frame][ref_mv_idx].comp_mv;
 1340|      0|    lower_mv_precision(&nearestmv[0].as_mv, allow_hp,
 1341|      0|                       features->cur_frame_force_integer_mv);
 1342|      0|    lower_mv_precision(&nearestmv[1].as_mv, allow_hp,
 1343|      0|                       features->cur_frame_force_integer_mv);
 1344|      0|    lower_mv_precision(&nearmv[0].as_mv, allow_hp,
 1345|      0|                       features->cur_frame_force_integer_mv);
 1346|      0|    lower_mv_precision(&nearmv[1].as_mv, allow_hp,
 1347|      0|                       features->cur_frame_force_integer_mv);
 1348|   191k|  } else if (mbmi->ref_mv_idx > 0 && mbmi->mode == NEARMV) {
  ------------------
  |  Branch (1348:14): [True: 6.15k, False: 185k]
  |  Branch (1348:38): [True: 790, False: 5.36k]
  ------------------
 1349|    791|    nearmv[0] =
 1350|    791|        xd->ref_mv_stack[mbmi->ref_frame[0]][1 + mbmi->ref_mv_idx].this_mv;
 1351|    791|  }
 1352|       |
 1353|   191k|  int_mv ref_mv[2] = { nearestmv[0], nearestmv[1] };
 1354|       |
 1355|   191k|  if (is_compound) {
  ------------------
  |  Branch (1355:7): [True: 0, False: 191k]
  ------------------
 1356|      0|    int ref_mv_idx = mbmi->ref_mv_idx;
 1357|       |    // Special case: NEAR_NEWMV and NEW_NEARMV modes use
 1358|       |    // 1 + mbmi->ref_mv_idx (like NEARMV) instead of
 1359|       |    // mbmi->ref_mv_idx (like NEWMV)
 1360|      0|    if (mbmi->mode == NEAR_NEWMV || mbmi->mode == NEW_NEARMV)
  ------------------
  |  Branch (1360:9): [True: 0, False: 0]
  |  Branch (1360:37): [True: 0, False: 0]
  ------------------
 1361|      0|      ref_mv_idx = 1 + mbmi->ref_mv_idx;
 1362|       |
 1363|       |    // TODO(jingning, yunqing): Do we need a lower_mv_precision() call here?
 1364|      0|    if (compound_ref0_mode(mbmi->mode) == NEWMV)
  ------------------
  |  Branch (1364:9): [True: 0, False: 0]
  ------------------
 1365|      0|      ref_mv[0] = xd->ref_mv_stack[ref_frame][ref_mv_idx].this_mv;
 1366|       |
 1367|      0|    if (compound_ref1_mode(mbmi->mode) == NEWMV)
  ------------------
  |  Branch (1367:9): [True: 0, False: 0]
  ------------------
 1368|      0|      ref_mv[1] = xd->ref_mv_stack[ref_frame][ref_mv_idx].comp_mv;
 1369|   191k|  } else {
 1370|   191k|    if (mbmi->mode == NEWMV) {
  ------------------
  |  Branch (1370:9): [True: 105k, False: 86.1k]
  ------------------
 1371|   105k|      if (dcb->ref_mv_count[ref_frame] > 1)
  ------------------
  |  Branch (1371:11): [True: 66.8k, False: 38.1k]
  ------------------
 1372|  66.8k|        ref_mv[0] = xd->ref_mv_stack[ref_frame][mbmi->ref_mv_idx].this_mv;
 1373|   105k|    }
 1374|   191k|  }
 1375|       |
 1376|   191k|  if (mbmi->skip_mode) assert(mbmi->mode == NEAREST_NEARESTMV);
  ------------------
  |  Branch (1376:7): [True: 0, False: 191k]
  ------------------
 1377|       |
 1378|   191k|  const int mv_corrupted_flag =
 1379|   191k|      !assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, mbmi->mv, ref_mv,
 1380|   191k|                 nearestmv, nearmv, is_compound, allow_hp, r);
 1381|   191k|  aom_merge_corrupted_flag(&dcb->corrupted, mv_corrupted_flag);
 1382|       |
 1383|   191k|  mbmi->use_wedge_interintra = 0;
 1384|   191k|  if (cm->seq_params->enable_interintra_compound && !mbmi->skip_mode &&
  ------------------
  |  Branch (1384:7): [True: 0, False: 191k]
  |  Branch (1384:53): [True: 0, False: 0]
  ------------------
 1385|      0|      is_interintra_allowed(mbmi)) {
  ------------------
  |  Branch (1385:7): [True: 0, False: 0]
  ------------------
 1386|      0|    const int bsize_group = size_group_lookup[bsize];
 1387|      0|    const int interintra =
 1388|      0|        aom_read_symbol(r, ec_ctx->interintra_cdf[bsize_group], 2, ACCT_STR);
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1389|      0|    assert(mbmi->ref_frame[1] == NONE_FRAME);
 1390|      0|    if (interintra) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 0]
  ------------------
 1391|      0|      const INTERINTRA_MODE interintra_mode =
 1392|      0|          read_interintra_mode(xd, r, bsize_group);
 1393|      0|      mbmi->ref_frame[1] = INTRA_FRAME;
 1394|      0|      mbmi->interintra_mode = interintra_mode;
 1395|      0|      mbmi->angle_delta[PLANE_TYPE_Y] = 0;
 1396|      0|      mbmi->angle_delta[PLANE_TYPE_UV] = 0;
 1397|      0|      mbmi->filter_intra_mode_info.use_filter_intra = 0;
 1398|      0|      if (av1_is_wedge_used(bsize)) {
  ------------------
  |  Branch (1398:11): [True: 0, False: 0]
  ------------------
 1399|      0|        mbmi->use_wedge_interintra = aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1400|      0|            r, ec_ctx->wedge_interintra_cdf[bsize], 2, ACCT_STR);
 1401|      0|        if (mbmi->use_wedge_interintra) {
  ------------------
  |  Branch (1401:13): [True: 0, False: 0]
  ------------------
 1402|      0|          mbmi->interintra_wedge_index = (int8_t)aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1403|      0|              r, ec_ctx->wedge_idx_cdf[bsize], MAX_WEDGE_TYPES, ACCT_STR);
 1404|      0|        }
 1405|      0|      }
 1406|      0|    }
 1407|      0|  }
 1408|       |
 1409|   382k|  for (int ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1409:21): [True: 191k, False: 191k]
  ------------------
 1410|   191k|    const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
 1411|   191k|    xd->block_ref_scale_factors[ref] = get_ref_scale_factors_const(cm, frame);
 1412|   191k|  }
 1413|       |
 1414|   191k|  mbmi->motion_mode = SIMPLE_TRANSLATION;
 1415|   191k|  if (is_motion_variation_allowed_bsize(mbmi->bsize) && !mbmi->skip_mode &&
  ------------------
  |  Branch (1415:7): [True: 189k, False: 1.72k]
  |  Branch (1415:57): [True: 189k, False: 18.4E]
  ------------------
 1416|   189k|      !has_second_ref(mbmi)) {
  ------------------
  |  Branch (1416:7): [True: 189k, False: 184]
  ------------------
 1417|   189k|    mbmi->num_proj_ref = av1_findSamples(cm, xd, pts, pts_inref);
 1418|   189k|  }
 1419|   191k|  av1_count_overlappable_neighbors(cm, xd);
 1420|       |
 1421|   191k|  if (mbmi->ref_frame[1] != INTRA_FRAME)
  ------------------
  |  Branch (1421:7): [True: 191k, False: 18.4E]
  ------------------
 1422|   191k|    mbmi->motion_mode = read_motion_mode(cm, xd, mbmi, r);
 1423|       |
 1424|       |  // init
 1425|   191k|  mbmi->comp_group_idx = 0;
 1426|   191k|  mbmi->compound_idx = 1;
 1427|   191k|  mbmi->interinter_comp.type = COMPOUND_AVERAGE;
 1428|       |
 1429|   191k|  if (has_second_ref(mbmi) && !mbmi->skip_mode) {
  ------------------
  |  Branch (1429:7): [True: 0, False: 191k]
  |  Branch (1429:31): [True: 0, False: 0]
  ------------------
 1430|       |    // Read idx to indicate current compound inter prediction mode group
 1431|      0|    const int masked_compound_used = is_any_masked_compound_used(bsize) &&
  ------------------
  |  Branch (1431:38): [True: 0, False: 0]
  ------------------
 1432|      0|                                     cm->seq_params->enable_masked_compound;
  ------------------
  |  Branch (1432:38): [True: 0, False: 0]
  ------------------
 1433|       |
 1434|      0|    if (masked_compound_used) {
  ------------------
  |  Branch (1434:9): [True: 0, False: 0]
  ------------------
 1435|      0|      const int ctx_comp_group_idx = get_comp_group_idx_context(xd);
 1436|      0|      mbmi->comp_group_idx = (uint8_t)aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1437|      0|          r, ec_ctx->comp_group_idx_cdf[ctx_comp_group_idx], 2, ACCT_STR);
 1438|      0|    }
 1439|       |
 1440|      0|    if (mbmi->comp_group_idx == 0) {
  ------------------
  |  Branch (1440:9): [True: 0, False: 0]
  ------------------
 1441|      0|      if (cm->seq_params->order_hint_info.enable_dist_wtd_comp) {
  ------------------
  |  Branch (1441:11): [True: 0, False: 0]
  ------------------
 1442|      0|        const int comp_index_ctx = get_comp_index_context(cm, xd);
 1443|      0|        mbmi->compound_idx = (uint8_t)aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1444|      0|            r, ec_ctx->compound_index_cdf[comp_index_ctx], 2, ACCT_STR);
 1445|      0|        mbmi->interinter_comp.type =
 1446|      0|            mbmi->compound_idx ? COMPOUND_AVERAGE : COMPOUND_DISTWTD;
  ------------------
  |  Branch (1446:13): [True: 0, False: 0]
  ------------------
 1447|      0|      } else {
 1448|       |        // Distance-weighted compound is disabled, so always use average
 1449|      0|        mbmi->compound_idx = 1;
 1450|      0|        mbmi->interinter_comp.type = COMPOUND_AVERAGE;
 1451|      0|      }
 1452|      0|    } else {
 1453|      0|      assert(cm->current_frame.reference_mode != SINGLE_REFERENCE &&
 1454|      0|             is_inter_compound_mode(mbmi->mode) &&
 1455|      0|             mbmi->motion_mode == SIMPLE_TRANSLATION);
 1456|      0|      assert(masked_compound_used);
 1457|       |
 1458|       |      // compound_diffwtd, wedge
 1459|      0|      if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
  ------------------
  |  Branch (1459:11): [True: 0, False: 0]
  ------------------
 1460|      0|        mbmi->interinter_comp.type =
 1461|      0|            COMPOUND_WEDGE + aom_read_symbol(r,
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1462|      0|                                             ec_ctx->compound_type_cdf[bsize],
 1463|      0|                                             MASKED_COMPOUND_TYPES, ACCT_STR);
 1464|      0|      } else {
 1465|      0|        mbmi->interinter_comp.type = COMPOUND_DIFFWTD;
 1466|      0|      }
 1467|       |
 1468|      0|      if (mbmi->interinter_comp.type == COMPOUND_WEDGE) {
  ------------------
  |  Branch (1468:11): [True: 0, False: 0]
  ------------------
 1469|      0|        assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
 1470|      0|        mbmi->interinter_comp.wedge_index = (int8_t)aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1471|      0|            r, ec_ctx->wedge_idx_cdf[bsize], MAX_WEDGE_TYPES, ACCT_STR);
 1472|      0|        mbmi->interinter_comp.wedge_sign = (int8_t)aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|      0|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1473|      0|      } else {
 1474|      0|        assert(mbmi->interinter_comp.type == COMPOUND_DIFFWTD);
 1475|      0|        mbmi->interinter_comp.mask_type =
 1476|      0|            aom_read_literal(r, MAX_DIFFWTD_MASK_BITS, ACCT_STR);
  ------------------
  |  |   47|      0|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1477|      0|      }
 1478|      0|    }
 1479|      0|  }
 1480|       |
 1481|   191k|  read_mb_interp_filter(xd, features->interp_filter,
 1482|   191k|                        cm->seq_params->enable_dual_filter, mbmi, r);
 1483|       |
 1484|   191k|  if (mbmi->motion_mode == WARPED_CAUSAL) {
  ------------------
  |  Branch (1484:7): [True: 2.04k, False: 189k]
  ------------------
 1485|  2.04k|    const int mi_row = xd->mi_row;
 1486|  2.04k|    const int mi_col = xd->mi_col;
 1487|  2.04k|    mbmi->wm_params.wmtype = DEFAULT_WMTYPE;
  ------------------
  |  |   32|  2.04k|#define DEFAULT_WMTYPE AFFINE
  ------------------
 1488|  2.04k|    mbmi->wm_params.invalid = 0;
 1489|       |
 1490|  2.04k|    if (mbmi->num_proj_ref > 1) {
  ------------------
  |  Branch (1490:9): [True: 889, False: 1.15k]
  ------------------
 1491|    889|      mbmi->num_proj_ref = av1_selectSamples(&mbmi->mv[0].as_mv, pts, pts_inref,
 1492|    889|                                             mbmi->num_proj_ref, bsize);
 1493|    889|    }
 1494|       |
 1495|  2.04k|    if (av1_find_projection(mbmi->num_proj_ref, pts, pts_inref, bsize,
  ------------------
  |  Branch (1495:9): [True: 0, False: 2.04k]
  ------------------
 1496|  2.04k|                            mbmi->mv[0].as_mv.row, mbmi->mv[0].as_mv.col,
 1497|  2.04k|                            &mbmi->wm_params, mi_row, mi_col)) {
 1498|       |#if WARPED_MOTION_DEBUG
 1499|       |      printf("Warning: unexpected warped model from aomenc\n");
 1500|       |#endif
 1501|      0|      mbmi->wm_params.invalid = 1;
 1502|      0|    }
 1503|  2.04k|  }
 1504|       |
 1505|   191k|  xd->cfl.store_y = store_cfl_required(cm, xd);
 1506|       |
 1507|       |#if DEC_MISMATCH_DEBUG
 1508|       |  dec_dump_logs(cm, mi, mi_row, mi_col, mode_ctx);
 1509|       |#endif  // DEC_MISMATCH_DEBUG
 1510|   191k|}
decodemv.c:read_ref_frames:
  940|   191k|                            MV_REFERENCE_FRAME ref_frame[2]) {
  941|   191k|  if (xd->mi[0]->skip_mode) {
  ------------------
  |  Branch (941:7): [True: 0, False: 191k]
  ------------------
  942|      0|    set_ref_frames_for_skip_mode(cm, ref_frame);
  943|      0|    return;
  944|      0|  }
  945|       |
  946|   191k|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (946:7): [True: 0, False: 191k]
  ------------------
  947|      0|    ref_frame[0] = (MV_REFERENCE_FRAME)get_segdata(&cm->seg, segment_id,
  948|      0|                                                   SEG_LVL_REF_FRAME);
  949|      0|    ref_frame[1] = NONE_FRAME;
  950|   191k|  } else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
  ------------------
  |  Branch (950:14): [True: 18.4E, False: 191k]
  ------------------
  951|   191k|             segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (951:14): [True: 158, False: 191k]
  ------------------
  952|      0|    ref_frame[0] = LAST_FRAME;
  953|      0|    ref_frame[1] = NONE_FRAME;
  954|   191k|  } else {
  955|   191k|    const REFERENCE_MODE mode = read_block_reference_mode(cm, xd, r);
  956|       |
  957|   191k|    if (mode == COMPOUND_REFERENCE) {
  ------------------
  |  Branch (957:9): [True: 0, False: 191k]
  ------------------
  958|      0|      const COMP_REFERENCE_TYPE comp_ref_type = read_comp_reference_type(xd, r);
  959|       |
  960|      0|      if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
  ------------------
  |  Branch (960:11): [True: 0, False: 0]
  ------------------
  961|      0|        const int bit = READ_REF_BIT(uni_comp_ref_p);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  962|      0|        if (bit) {
  ------------------
  |  Branch (962:13): [True: 0, False: 0]
  ------------------
  963|      0|          ref_frame[0] = BWDREF_FRAME;
  964|      0|          ref_frame[1] = ALTREF_FRAME;
  965|      0|        } else {
  966|      0|          const int bit1 = READ_REF_BIT(uni_comp_ref_p1);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  967|      0|          if (bit1) {
  ------------------
  |  Branch (967:15): [True: 0, False: 0]
  ------------------
  968|      0|            const int bit2 = READ_REF_BIT(uni_comp_ref_p2);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  969|      0|            if (bit2) {
  ------------------
  |  Branch (969:17): [True: 0, False: 0]
  ------------------
  970|      0|              ref_frame[0] = LAST_FRAME;
  971|      0|              ref_frame[1] = GOLDEN_FRAME;
  972|      0|            } else {
  973|      0|              ref_frame[0] = LAST_FRAME;
  974|      0|              ref_frame[1] = LAST3_FRAME;
  975|      0|            }
  976|      0|          } else {
  977|      0|            ref_frame[0] = LAST_FRAME;
  978|      0|            ref_frame[1] = LAST2_FRAME;
  979|      0|          }
  980|      0|        }
  981|       |
  982|      0|        return;
  983|      0|      }
  984|       |
  985|      0|      assert(comp_ref_type == BIDIR_COMP_REFERENCE);
  986|       |
  987|      0|      const int idx = 1;
  988|      0|      const int bit = READ_REF_BIT(comp_ref_p);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  989|       |      // Decode forward references.
  990|      0|      if (!bit) {
  ------------------
  |  Branch (990:11): [True: 0, False: 0]
  ------------------
  991|      0|        const int bit1 = READ_REF_BIT(comp_ref_p1);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  992|      0|        ref_frame[!idx] = bit1 ? LAST2_FRAME : LAST_FRAME;
  ------------------
  |  Branch (992:27): [True: 0, False: 0]
  ------------------
  993|      0|      } else {
  994|      0|        const int bit2 = READ_REF_BIT(comp_ref_p2);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
  995|      0|        ref_frame[!idx] = bit2 ? GOLDEN_FRAME : LAST3_FRAME;
  ------------------
  |  Branch (995:27): [True: 0, False: 0]
  ------------------
  996|      0|      }
  997|       |
  998|       |      // Decode backward references.
  999|      0|      const int bit_bwd = READ_REF_BIT(comp_bwdref_p);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1000|      0|      if (!bit_bwd) {
  ------------------
  |  Branch (1000:11): [True: 0, False: 0]
  ------------------
 1001|      0|        const int bit1_bwd = READ_REF_BIT(comp_bwdref_p1);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1002|      0|        ref_frame[idx] = bit1_bwd ? ALTREF2_FRAME : BWDREF_FRAME;
  ------------------
  |  Branch (1002:26): [True: 0, False: 0]
  ------------------
 1003|      0|      } else {
 1004|      0|        ref_frame[idx] = ALTREF_FRAME;
 1005|      0|      }
 1006|   191k|    } else if (mode == SINGLE_REFERENCE) {
  ------------------
  |  Branch (1006:16): [True: 191k, False: 173]
  ------------------
 1007|   191k|      const int bit0 = READ_REF_BIT(single_ref_p1);
  ------------------
  |  |  920|   191k|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|   191k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1008|   191k|      if (bit0) {
  ------------------
  |  Branch (1008:11): [True: 0, False: 191k]
  ------------------
 1009|      0|        const int bit1 = READ_REF_BIT(single_ref_p2);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1010|      0|        if (!bit1) {
  ------------------
  |  Branch (1010:13): [True: 0, False: 0]
  ------------------
 1011|      0|          const int bit5 = READ_REF_BIT(single_ref_p6);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1012|      0|          ref_frame[0] = bit5 ? ALTREF2_FRAME : BWDREF_FRAME;
  ------------------
  |  Branch (1012:26): [True: 0, False: 0]
  ------------------
 1013|      0|        } else {
 1014|      0|          ref_frame[0] = ALTREF_FRAME;
 1015|      0|        }
 1016|   191k|      } else {
 1017|   191k|        const int bit2 = READ_REF_BIT(single_ref_p3);
  ------------------
  |  |  920|   191k|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|   191k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1018|   191k|        if (bit2) {
  ------------------
  |  Branch (1018:13): [True: 0, False: 191k]
  ------------------
 1019|      0|          const int bit4 = READ_REF_BIT(single_ref_p5);
  ------------------
  |  |  920|      0|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1020|      0|          ref_frame[0] = bit4 ? GOLDEN_FRAME : LAST3_FRAME;
  ------------------
  |  Branch (1020:26): [True: 0, False: 0]
  ------------------
 1021|   191k|        } else {
 1022|   191k|          const int bit3 = READ_REF_BIT(single_ref_p4);
  ------------------
  |  |  920|   191k|  aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
  |  |  ------------------
  |  |  |  |   51|   191k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  |  |  ------------------
  ------------------
 1023|   191k|          ref_frame[0] = bit3 ? LAST2_FRAME : LAST_FRAME;
  ------------------
  |  Branch (1023:26): [True: 0, False: 191k]
  ------------------
 1024|   191k|        }
 1025|   191k|      }
 1026|       |
 1027|   191k|      ref_frame[1] = NONE_FRAME;
 1028|   191k|    } else {
 1029|       |      assert(0 && "Invalid prediction mode.");
 1030|    173|    }
 1031|   191k|  }
 1032|   191k|}
decodemv.c:read_block_reference_mode:
  906|   191k|                                                aom_reader *r) {
  907|   191k|  if (!is_comp_ref_allowed(xd->mi[0]->bsize)) return SINGLE_REFERENCE;
  ------------------
  |  Branch (907:7): [True: 1.89k, False: 189k]
  ------------------
  908|   189k|  if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (908:7): [True: 0, False: 189k]
  ------------------
  909|      0|    const int ctx = av1_get_reference_mode_context(xd);
  910|      0|    const REFERENCE_MODE mode = (REFERENCE_MODE)aom_read_symbol(
  ------------------
  |  |   51|      0|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  911|      0|        r, xd->tile_ctx->comp_inter_cdf[ctx], 2, ACCT_STR);
  912|      0|    return mode;  // SINGLE_REFERENCE or COMPOUND_REFERENCE
  913|   189k|  } else {
  914|       |    assert(cm->current_frame.reference_mode == SINGLE_REFERENCE);
  915|   189k|    return cm->current_frame.reference_mode;
  916|   189k|  }
  917|   189k|}
decodemv.c:read_inter_mode:
  178|   191k|                                       int16_t ctx) {
  179|   191k|  int16_t mode_ctx = ctx & NEWMV_CTX_MASK;
  ------------------
  |  |  490|   191k|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|   191k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  180|   191k|  int is_newmv, is_zeromv, is_refmv;
  181|   191k|  is_newmv = aom_read_symbol(r, ec_ctx->newmv_cdf[mode_ctx], 2, ACCT_STR) == 0;
  ------------------
  |  |   51|   191k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  182|   191k|  if (is_newmv) return NEWMV;
  ------------------
  |  Branch (182:7): [True: 105k, False: 86.8k]
  ------------------
  183|       |
  184|  86.8k|  mode_ctx = (ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  487|  86.8k|#define GLOBALMV_OFFSET 3
  ------------------
                mode_ctx = (ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  491|  86.8k|#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  86.8k|#define REFMV_OFFSET 4
  |  |  ------------------
  |  |               #define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  487|  86.8k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  185|  86.8k|  is_zeromv =
  186|  86.8k|      aom_read_symbol(r, ec_ctx->zeromv_cdf[mode_ctx], 2, ACCT_STR) == 0;
  ------------------
  |  |   51|  86.8k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  187|  86.8k|  if (is_zeromv) return GLOBALMV;
  ------------------
  |  Branch (187:7): [True: 5.10k, False: 81.6k]
  ------------------
  188|       |
  189|  81.6k|  mode_ctx = (ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|  81.6k|#define REFMV_OFFSET 4
  ------------------
                mode_ctx = (ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|  81.6k|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  81.6k|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  190|  81.6k|  is_refmv = aom_read_symbol(r, ec_ctx->refmv_cdf[mode_ctx], 2, ACCT_STR) == 0;
  ------------------
  |  |   51|  81.6k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  191|  81.6k|  if (is_refmv)
  ------------------
  |  Branch (191:7): [True: 60.2k, False: 21.4k]
  ------------------
  192|  60.2k|    return NEARESTMV;
  193|  21.4k|  else
  194|  21.4k|    return NEARMV;
  195|  81.6k|}
decodemv.c:read_drl_idx:
  198|   126k|                         MB_MODE_INFO *mbmi, aom_reader *r) {
  199|   126k|  MACROBLOCKD *const xd = &dcb->xd;
  200|   126k|  uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
  201|   126k|  mbmi->ref_mv_idx = 0;
  202|   126k|  if (mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV) {
  ------------------
  |  Branch (202:7): [True: 104k, False: 21.0k]
  |  Branch (202:30): [True: 0, False: 21.0k]
  ------------------
  203|   189k|    for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (203:23): [True: 148k, False: 41.1k]
  ------------------
  204|   148k|      if (dcb->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (204:11): [True: 70.3k, False: 78.1k]
  ------------------
  205|  70.3k|        uint8_t drl_ctx = av1_drl_ctx(xd->weight[ref_frame_type], idx);
  206|  70.3k|        int drl_idx = aom_read_symbol(r, ec_ctx->drl_cdf[drl_ctx], 2, ACCT_STR);
  ------------------
  |  |   51|  70.3k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  207|  70.3k|        mbmi->ref_mv_idx = idx + drl_idx;
  208|  70.3k|        if (!drl_idx) return;
  ------------------
  |  Branch (208:13): [True: 63.8k, False: 6.55k]
  ------------------
  209|  70.3k|      }
  210|   148k|    }
  211|   105k|  }
  212|  62.1k|  if (have_nearmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (212:7): [True: 21.0k, False: 41.1k]
  ------------------
  213|       |    // Offset the NEARESTMV mode.
  214|       |    // TODO(jingning): Unify the two syntax decoding loops after the NEARESTMV
  215|       |    // mode is factored in.
  216|  39.8k|    for (int idx = 1; idx < 3; ++idx) {
  ------------------
  |  Branch (216:23): [True: 30.6k, False: 9.27k]
  ------------------
  217|  30.6k|      if (dcb->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (217:11): [True: 12.8k, False: 17.7k]
  ------------------
  218|  12.8k|        uint8_t drl_ctx = av1_drl_ctx(xd->weight[ref_frame_type], idx);
  219|  12.8k|        int drl_idx = aom_read_symbol(r, ec_ctx->drl_cdf[drl_ctx], 2, ACCT_STR);
  ------------------
  |  |   51|  12.8k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  220|  12.8k|        mbmi->ref_mv_idx = idx + drl_idx - 1;
  221|  12.8k|        if (!drl_idx) return;
  ------------------
  |  Branch (221:13): [True: 11.7k, False: 1.04k]
  ------------------
  222|  12.8k|      }
  223|  30.6k|    }
  224|  21.0k|  }
  225|  62.1k|}
decodemv.c:assign_mv:
 1119|   191k|                            aom_reader *r) {
 1120|   191k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1121|   191k|  MB_MODE_INFO *mbmi = xd->mi[0];
 1122|   191k|  BLOCK_SIZE bsize = mbmi->bsize;
 1123|   191k|  FeatureFlags *const features = &cm->features;
 1124|   191k|  if (features->cur_frame_force_integer_mv) {
  ------------------
  |  Branch (1124:7): [True: 0, False: 191k]
  ------------------
 1125|      0|    allow_hp = MV_SUBPEL_NONE;
 1126|      0|  }
 1127|   191k|  switch (mode) {
 1128|   105k|    case NEWMV: {
  ------------------
  |  Branch (1128:5): [True: 105k, False: 86.3k]
  ------------------
 1129|   105k|      nmv_context *const nmvc = &ec_ctx->nmvc;
 1130|   105k|      read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp);
 1131|   105k|      break;
 1132|      0|    }
 1133|  60.4k|    case NEARESTMV: {
  ------------------
  |  Branch (1133:5): [True: 60.4k, False: 130k]
  ------------------
 1134|  60.4k|      mv[0].as_int = nearest_mv[0].as_int;
 1135|  60.4k|      break;
 1136|      0|    }
 1137|  21.0k|    case NEARMV: {
  ------------------
  |  Branch (1137:5): [True: 21.0k, False: 170k]
  ------------------
 1138|  21.0k|      mv[0].as_int = near_mv[0].as_int;
 1139|  21.0k|      break;
 1140|      0|    }
 1141|  5.10k|    case GLOBALMV: {
  ------------------
  |  Branch (1141:5): [True: 5.10k, False: 186k]
  ------------------
 1142|  5.10k|      mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]],
 1143|  5.10k|                                          features->allow_high_precision_mv,
 1144|  5.10k|                                          bsize, xd->mi_col, xd->mi_row,
 1145|  5.10k|                                          features->cur_frame_force_integer_mv)
 1146|  5.10k|                         .as_int;
 1147|  5.10k|      break;
 1148|      0|    }
 1149|      0|    case NEW_NEWMV: {
  ------------------
  |  Branch (1149:5): [True: 0, False: 191k]
  ------------------
 1150|      0|      assert(is_compound);
 1151|      0|      for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (1151:23): [True: 0, False: 0]
  ------------------
 1152|      0|        nmv_context *const nmvc = &ec_ctx->nmvc;
 1153|      0|        read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, nmvc, allow_hp);
 1154|      0|      }
 1155|      0|      break;
 1156|      0|    }
 1157|      0|    case NEAREST_NEARESTMV: {
  ------------------
  |  Branch (1157:5): [True: 0, False: 191k]
  ------------------
 1158|      0|      assert(is_compound);
 1159|      0|      mv[0].as_int = nearest_mv[0].as_int;
 1160|      0|      mv[1].as_int = nearest_mv[1].as_int;
 1161|      0|      break;
 1162|      0|    }
 1163|      0|    case NEAR_NEARMV: {
  ------------------
  |  Branch (1163:5): [True: 0, False: 191k]
  ------------------
 1164|      0|      assert(is_compound);
 1165|      0|      mv[0].as_int = near_mv[0].as_int;
 1166|      0|      mv[1].as_int = near_mv[1].as_int;
 1167|      0|      break;
 1168|      0|    }
 1169|      0|    case NEW_NEARESTMV: {
  ------------------
  |  Branch (1169:5): [True: 0, False: 191k]
  ------------------
 1170|      0|      nmv_context *const nmvc = &ec_ctx->nmvc;
 1171|      0|      read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp);
 1172|      0|      assert(is_compound);
 1173|      0|      mv[1].as_int = nearest_mv[1].as_int;
 1174|      0|      break;
 1175|      0|    }
 1176|      0|    case NEAREST_NEWMV: {
  ------------------
  |  Branch (1176:5): [True: 0, False: 191k]
  ------------------
 1177|      0|      nmv_context *const nmvc = &ec_ctx->nmvc;
 1178|      0|      mv[0].as_int = nearest_mv[0].as_int;
 1179|      0|      read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, nmvc, allow_hp);
 1180|      0|      assert(is_compound);
 1181|      0|      break;
 1182|      0|    }
 1183|      0|    case NEAR_NEWMV: {
  ------------------
  |  Branch (1183:5): [True: 0, False: 191k]
  ------------------
 1184|      0|      nmv_context *const nmvc = &ec_ctx->nmvc;
 1185|      0|      mv[0].as_int = near_mv[0].as_int;
 1186|      0|      read_mv(r, &mv[1].as_mv, &ref_mv[1].as_mv, nmvc, allow_hp);
 1187|      0|      assert(is_compound);
 1188|      0|      break;
 1189|      0|    }
 1190|      0|    case NEW_NEARMV: {
  ------------------
  |  Branch (1190:5): [True: 0, False: 191k]
  ------------------
 1191|      0|      nmv_context *const nmvc = &ec_ctx->nmvc;
 1192|      0|      read_mv(r, &mv[0].as_mv, &ref_mv[0].as_mv, nmvc, allow_hp);
 1193|      0|      assert(is_compound);
 1194|      0|      mv[1].as_int = near_mv[1].as_int;
 1195|      0|      break;
 1196|      0|    }
 1197|      0|    case GLOBAL_GLOBALMV: {
  ------------------
  |  Branch (1197:5): [True: 0, False: 191k]
  ------------------
 1198|      0|      assert(is_compound);
 1199|      0|      mv[0].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[0]],
 1200|      0|                                          features->allow_high_precision_mv,
 1201|      0|                                          bsize, xd->mi_col, xd->mi_row,
 1202|      0|                                          features->cur_frame_force_integer_mv)
 1203|      0|                         .as_int;
 1204|      0|      mv[1].as_int = gm_get_motion_vector(&cm->global_motion[ref_frame[1]],
 1205|      0|                                          features->allow_high_precision_mv,
 1206|      0|                                          bsize, xd->mi_col, xd->mi_row,
 1207|      0|                                          features->cur_frame_force_integer_mv)
 1208|      0|                         .as_int;
 1209|      0|      break;
 1210|      0|    }
 1211|      0|    default: {
  ------------------
  |  Branch (1211:5): [True: 0, False: 191k]
  ------------------
 1212|      0|      return 0;
 1213|      0|    }
 1214|   191k|  }
 1215|       |
 1216|   191k|  int ret = is_mv_valid(&mv[0].as_mv);
 1217|   191k|  if (is_compound) {
  ------------------
  |  Branch (1217:7): [True: 0, False: 191k]
  ------------------
 1218|      0|    ret = ret && is_mv_valid(&mv[1].as_mv);
  ------------------
  |  Branch (1218:11): [True: 0, False: 0]
  |  Branch (1218:18): [True: 0, False: 0]
  ------------------
 1219|      0|  }
 1220|   191k|  return ret;
 1221|   191k|}
decodemv.c:read_motion_mode:
  228|   191k|                                    MB_MODE_INFO *mbmi, aom_reader *r) {
  229|   191k|  if (cm->features.switchable_motion_mode == 0) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (229:7): [True: 0, False: 191k]
  ------------------
  230|   191k|  if (mbmi->skip_mode) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (230:7): [True: 0, False: 191k]
  ------------------
  231|       |
  232|   191k|  const MOTION_MODE last_motion_mode_allowed = motion_mode_allowed(
  233|   191k|      xd->global_motion, xd, mbmi, cm->features.allow_warped_motion);
  234|   191k|  int motion_mode;
  235|       |
  236|   191k|  if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return SIMPLE_TRANSLATION;
  ------------------
  |  Branch (236:7): [True: 56.3k, False: 135k]
  ------------------
  237|       |
  238|   135k|  if (last_motion_mode_allowed == OBMC_CAUSAL) {
  ------------------
  |  Branch (238:7): [True: 122k, False: 12.4k]
  ------------------
  239|   122k|    motion_mode =
  240|   122k|        aom_read_symbol(r, xd->tile_ctx->obmc_cdf[mbmi->bsize], 2, ACCT_STR);
  ------------------
  |  |   51|   122k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  241|   122k|    return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
  242|   122k|  } else {
  243|  12.4k|    motion_mode = aom_read_symbol(r, xd->tile_ctx->motion_mode_cdf[mbmi->bsize],
  ------------------
  |  |   51|  12.4k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  244|  12.4k|                                  MOTION_MODES, ACCT_STR);
  245|  12.4k|    return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
  246|  12.4k|  }
  247|   135k|}
decodemv.c:read_mb_interp_filter:
 1038|   191k|                                         aom_reader *r) {
 1039|   191k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1040|       |
 1041|   191k|  if (!av1_is_interp_needed(xd)) {
  ------------------
  |  Branch (1041:7): [True: 7.14k, False: 184k]
  ------------------
 1042|  7.14k|    set_default_interp_filters(mbmi, interp_filter);
 1043|  7.14k|    return;
 1044|  7.14k|  }
 1045|       |
 1046|   184k|  if (interp_filter != SWITCHABLE) {
  ------------------
  |  Branch (1046:7): [True: 83.5k, False: 100k]
  ------------------
 1047|  83.5k|    mbmi->interp_filters = av1_broadcast_interp_filter(interp_filter);
 1048|   100k|  } else {
 1049|   100k|    InterpFilter ref0_filter[2] = { EIGHTTAP_REGULAR, EIGHTTAP_REGULAR };
 1050|   100k|    for (int dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (1050:23): [True: 100k, False: 18.4E]
  ------------------
 1051|   100k|      const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
 1052|   100k|      ref0_filter[dir] = (InterpFilter)aom_read_symbol(
  ------------------
  |  |   51|   100k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
 1053|   100k|          r, ec_ctx->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS, ACCT_STR);
 1054|   100k|      if (!enable_dual_filter) {
  ------------------
  |  Branch (1054:11): [True: 100k, False: 21]
  ------------------
 1055|   100k|        ref0_filter[1] = ref0_filter[0];
 1056|   100k|        break;
 1057|   100k|      }
 1058|   100k|    }
 1059|       |    // The index system works as: (0, 1) -> (vertical, horizontal) filter types
 1060|   100k|    mbmi->interp_filters.as_filters.x_filter = ref0_filter[1];
 1061|   100k|    mbmi->interp_filters.as_filters.y_filter = ref0_filter[0];
 1062|   100k|  }
 1063|   184k|}
decodemv.c:read_intra_block_mode_info:
 1068|   525k|                                       aom_reader *r) {
 1069|   525k|  const BLOCK_SIZE bsize = mbmi->bsize;
 1070|   525k|  const int use_angle_delta = av1_use_angle_delta(bsize);
 1071|       |
 1072|   525k|  mbmi->ref_frame[0] = INTRA_FRAME;
 1073|   525k|  mbmi->ref_frame[1] = NONE_FRAME;
 1074|       |
 1075|   525k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1076|       |
 1077|   525k|  mbmi->mode = read_intra_mode(r, ec_ctx->y_mode_cdf[size_group_lookup[bsize]]);
 1078|       |
 1079|   525k|  mbmi->angle_delta[PLANE_TYPE_Y] =
 1080|   525k|      use_angle_delta && av1_is_directional_mode(mbmi->mode)
  ------------------
  |  Branch (1080:7): [True: 510k, False: 14.7k]
  |  Branch (1080:26): [True: 27.6k, False: 483k]
  ------------------
 1081|   525k|          ? read_angle_delta(r, ec_ctx->angle_delta_cdf[mbmi->mode - V_PRED])
 1082|   525k|          : 0;
 1083|   525k|  if (!cm->seq_params->monochrome && xd->is_chroma_ref) {
  ------------------
  |  Branch (1083:7): [True: 235k, False: 289k]
  |  Branch (1083:38): [True: 231k, False: 3.95k]
  ------------------
 1084|   231k|    mbmi->uv_mode =
 1085|   231k|        read_intra_mode_uv(ec_ctx, r, is_cfl_allowed(xd), mbmi->mode);
 1086|   231k|    if (mbmi->uv_mode == UV_CFL_PRED) {
  ------------------
  |  Branch (1086:9): [True: 81.1k, False: 150k]
  ------------------
 1087|  81.1k|      mbmi->cfl_alpha_idx =
 1088|  81.1k|          read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs);
 1089|  81.1k|    }
 1090|   231k|    const PREDICTION_MODE intra_mode = get_uv_mode(mbmi->uv_mode);
 1091|   231k|    mbmi->angle_delta[PLANE_TYPE_UV] =
 1092|   231k|        use_angle_delta && av1_is_directional_mode(intra_mode)
  ------------------
  |  Branch (1092:9): [True: 224k, False: 7.76k]
  |  Branch (1092:28): [True: 17.6k, False: 206k]
  ------------------
 1093|   231k|            ? read_angle_delta(r, ec_ctx->angle_delta_cdf[intra_mode - V_PRED])
 1094|   231k|            : 0;
 1095|   293k|  } else {
 1096|       |    // Avoid decoding angle_info if there is no chroma prediction
 1097|   293k|    mbmi->uv_mode = UV_DC_PRED;
 1098|   293k|  }
 1099|   525k|  xd->cfl.store_y = store_cfl_required(cm, xd);
 1100|       |
 1101|   525k|  mbmi->palette_mode_info.palette_size[0] = 0;
 1102|   525k|  mbmi->palette_mode_info.palette_size[1] = 0;
 1103|   525k|  if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize))
  ------------------
  |  Branch (1103:7): [True: 21.2k, False: 504k]
  ------------------
 1104|  21.2k|    read_palette_mode_info(cm, xd, r);
 1105|       |
 1106|   525k|  read_filter_intra_mode_info(cm, xd, r);
 1107|   525k|}

av1_decoder_create:
   90|  7.01k|AV1Decoder *av1_decoder_create(BufferPool *const pool) {
   91|  7.01k|  AV1Decoder *volatile const pbi = aom_memalign(32, sizeof(*pbi));
   92|  7.01k|  if (!pbi) return NULL;
  ------------------
  |  Branch (92:7): [True: 0, False: 7.01k]
  ------------------
   93|  7.01k|  av1_zero(*pbi);
  ------------------
  |  |   43|  7.01k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   94|       |
   95|  7.01k|  AV1_COMMON *volatile const cm = &pbi->common;
   96|  7.01k|  cm->seq_params = &pbi->seq_params;
   97|  7.01k|  cm->error = &pbi->error;
   98|       |
   99|       |  // The jmp_buf is valid only for the duration of the function that calls
  100|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
  101|       |  // before it returns.
  102|  7.01k|  if (setjmp(pbi->error.jmp)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 7.01k]
  ------------------
  103|      0|    pbi->error.setjmp = 0;
  104|      0|    av1_decoder_remove(pbi);
  105|      0|    return NULL;
  106|      0|  }
  107|       |
  108|  7.01k|  pbi->error.setjmp = 1;
  109|       |
  110|  7.01k|  CHECK_MEM_ERROR(cm, cm->fc,
  ------------------
  |  |   51|  7.01k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  7.01k|  do {                                                    \
  |  |  |  |   72|  7.01k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  7.01k|    lval = (expr);                                        \
  |  |  |  |   74|  7.01k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 7.01k]
  |  |  |  |  ------------------
  |  |  |  |   75|  7.01k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  7.01k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 7.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|  7.01k|                  (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->fc)));
  112|  7.01k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  7.01k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  7.01k|  do {                                                    \
  |  |  |  |   72|  7.01k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  7.01k|    lval = (expr);                                        \
  |  |  |  |   74|  7.01k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 7.01k]
  |  |  |  |  ------------------
  |  |  |  |   75|  7.01k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  7.01k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 7.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  7.01k|      cm, cm->default_frame_context,
  114|  7.01k|      (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->default_frame_context)));
  115|  7.01k|  memset(cm->fc, 0, sizeof(*cm->fc));
  116|  7.01k|  memset(cm->default_frame_context, 0, sizeof(*cm->default_frame_context));
  117|       |
  118|  7.01k|  pbi->need_resync = 1;
  119|  7.01k|  initialize_dec();
  120|       |
  121|       |  // Initialize the references to not point to any frame buffers.
  122|  63.1k|  for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (122:19): [True: 56.1k, False: 7.01k]
  ------------------
  123|  56.1k|    cm->ref_frame_map[i] = NULL;
  124|  56.1k|  }
  125|       |
  126|  7.01k|  cm->current_frame.frame_number = 0;
  127|  7.01k|  pbi->decoding_first_frame = 1;
  128|  7.01k|  pbi->common.buffer_pool = pool;
  129|       |
  130|  7.01k|  cm->seq_params->bit_depth = AOM_BITS_8;
  131|       |
  132|  7.01k|  cm->mi_params.free_mi = dec_free_mi;
  133|  7.01k|  cm->mi_params.setup_mi = dec_setup_mi;
  134|  7.01k|  cm->mi_params.set_mb_mi = dec_set_mb_mi;
  135|       |
  136|  7.01k|  av1_loop_filter_init(cm);
  137|       |
  138|  7.01k|  av1_qm_init(&cm->quant_params, av1_num_planes(cm));
  139|  7.01k|  av1_loop_restoration_precal();
  140|       |
  141|       |#if CONFIG_ACCOUNTING
  142|       |  pbi->acct_enabled = 1;
  143|       |  aom_accounting_init(&pbi->accounting);
  144|       |#endif
  145|       |
  146|  7.01k|  pbi->error.setjmp = 0;
  147|       |
  148|  7.01k|  aom_get_worker_interface()->init(&pbi->lf_worker);
  149|  7.01k|  pbi->lf_worker.thread_name = "aom lf worker";
  150|       |
  151|       |#if CONFIG_INSPECTION
  152|       |  pbi->sb_bits = NULL;
  153|       |  pbi->sb_bits_alloc_size = 0;
  154|       |#endif
  155|       |
  156|  7.01k|  return pbi;
  157|  7.01k|}
av1_dealloc_dec_jobs:
  159|  15.9k|void av1_dealloc_dec_jobs(struct AV1DecTileMTData *tile_mt_info) {
  160|  15.9k|  if (tile_mt_info != NULL) {
  ------------------
  |  Branch (160:7): [True: 15.9k, False: 0]
  ------------------
  161|  15.9k|#if CONFIG_MULTITHREAD
  162|  15.9k|    if (tile_mt_info->job_mutex != NULL) {
  ------------------
  |  Branch (162:9): [True: 9.34k, False: 6.56k]
  ------------------
  163|  9.34k|      pthread_mutex_destroy(tile_mt_info->job_mutex);
  164|  9.34k|      aom_free(tile_mt_info->job_mutex);
  165|  9.34k|    }
  166|  15.9k|#endif
  167|  15.9k|    aom_free(tile_mt_info->job_queue);
  168|       |    // clear the structure as the source of this call may be a resize in which
  169|       |    // case this call will be followed by an _alloc() which may fail.
  170|  15.9k|    av1_zero(*tile_mt_info);
  ------------------
  |  |   43|  15.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  171|  15.9k|  }
  172|  15.9k|}
av1_dec_free_cb_buf:
  174|  17.3k|void av1_dec_free_cb_buf(AV1Decoder *pbi) {
  175|  17.3k|  aom_free(pbi->cb_buffer_base);
  176|       |  pbi->cb_buffer_base = NULL;
  177|  17.3k|  pbi->cb_buffer_alloc_size = 0;
  178|  17.3k|}
av1_decoder_remove:
  180|  7.01k|void av1_decoder_remove(AV1Decoder *pbi) {
  181|  7.01k|  int i;
  182|       |
  183|  7.01k|  if (!pbi) return;
  ------------------
  |  Branch (183:7): [True: 0, False: 7.01k]
  ------------------
  184|       |
  185|       |  // Free the tile list output buffer.
  186|  7.01k|  aom_free_frame_buffer(&pbi->tile_list_outbuf);
  187|       |
  188|  7.01k|  aom_get_worker_interface()->end(&pbi->lf_worker);
  189|  7.01k|  aom_free(pbi->lf_worker.data1);
  190|       |
  191|  7.01k|  if (pbi->thread_data) {
  ------------------
  |  Branch (191:7): [True: 6.56k, False: 455]
  ------------------
  192|   212k|    for (int worker_idx = 1; worker_idx < pbi->num_workers; worker_idx++) {
  ------------------
  |  Branch (192:30): [True: 206k, False: 6.56k]
  ------------------
  193|   206k|      DecWorkerData *const thread_data = pbi->thread_data + worker_idx;
  194|   206k|      if (thread_data->td != NULL) {
  ------------------
  |  Branch (194:11): [True: 206k, False: 0]
  ------------------
  195|   206k|        av1_free_mc_tmp_buf(thread_data->td);
  196|   206k|        aom_free(thread_data->td);
  197|   206k|      }
  198|   206k|    }
  199|  6.56k|    aom_free(pbi->thread_data);
  200|  6.56k|  }
  201|  7.01k|  aom_free(pbi->dcb.xd.seg_mask);
  202|       |
  203|   219k|  for (i = 0; i < pbi->num_workers; ++i) {
  ------------------
  |  Branch (203:15): [True: 212k, False: 7.01k]
  ------------------
  204|   212k|    AVxWorker *const worker = &pbi->tile_workers[i];
  205|   212k|    aom_get_worker_interface()->end(worker);
  206|   212k|  }
  207|  7.01k|#if CONFIG_MULTITHREAD
  208|  7.01k|  if (pbi->row_mt_mutex_ != NULL) {
  ------------------
  |  Branch (208:7): [True: 6.56k, False: 455]
  ------------------
  209|  6.56k|    pthread_mutex_destroy(pbi->row_mt_mutex_);
  210|  6.56k|    aom_free(pbi->row_mt_mutex_);
  211|  6.56k|  }
  212|  7.01k|  if (pbi->row_mt_cond_ != NULL) {
  ------------------
  |  Branch (212:7): [True: 6.56k, False: 455]
  ------------------
  213|  6.56k|    pthread_cond_destroy(pbi->row_mt_cond_);
  214|  6.56k|    aom_free(pbi->row_mt_cond_);
  215|  6.56k|  }
  216|  7.01k|#endif
  217|  21.6k|  for (i = 0; i < pbi->allocated_tiles; i++) {
  ------------------
  |  Branch (217:15): [True: 14.5k, False: 7.01k]
  ------------------
  218|  14.5k|    TileDataDec *const tile_data = pbi->tile_data + i;
  219|  14.5k|    av1_dec_row_mt_dealloc(&tile_data->dec_row_mt_sync);
  220|  14.5k|  }
  221|  7.01k|  aom_free(pbi->tile_data);
  222|  7.01k|  aom_free(pbi->tile_workers);
  223|       |
  224|  7.01k|  if (pbi->num_workers > 0) {
  ------------------
  |  Branch (224:7): [True: 6.56k, False: 455]
  ------------------
  225|  6.56k|    av1_loop_filter_dealloc(&pbi->lf_row_sync);
  226|  6.56k|    av1_loop_restoration_dealloc(&pbi->lr_row_sync);
  227|  6.56k|    av1_dealloc_dec_jobs(&pbi->tile_mt_info);
  228|  6.56k|  }
  229|       |
  230|  7.01k|  av1_dec_free_cb_buf(pbi);
  231|       |#if CONFIG_ACCOUNTING
  232|       |  aom_accounting_clear(&pbi->accounting);
  233|       |#endif
  234|       |#if CONFIG_INSPECTION
  235|       |  aom_free(pbi->sb_bits);
  236|       |#endif
  237|  7.01k|  av1_free_mc_tmp_buf(&pbi->td);
  238|  7.01k|  aom_img_metadata_array_free(pbi->metadata);
  239|  7.01k|  av1_remove_common(&pbi->common);
  240|  7.01k|  aom_free(pbi);
  241|  7.01k|}
av1_visit_palette:
  244|  2.26M|                       aom_reader *r, palette_visitor_fn_t visit) {
  245|  2.26M|  if (!is_inter_block(xd->mi[0])) {
  ------------------
  |  Branch (245:7): [True: 1.71M, False: 552k]
  ------------------
  246|  4.17M|    for (int plane = 0; plane < AOMMIN(2, av1_num_planes(&pbi->common));
  ------------------
  |  |   34|  4.17M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.26M, False: 1.91M]
  |  |  ------------------
  ------------------
  |  Branch (246:25): [True: 2.46M, False: 1.71M]
  ------------------
  247|  2.46M|         ++plane) {
  248|  2.46M|      if (plane == 0 || xd->is_chroma_ref) {
  ------------------
  |  Branch (248:11): [True: 1.71M, False: 756k]
  |  Branch (248:25): [True: 742k, False: 14.3k]
  ------------------
  249|  2.45M|        if (xd->mi[0]->palette_mode_info.palette_size[plane])
  ------------------
  |  Branch (249:13): [True: 74.9k, False: 2.37M]
  ------------------
  250|  74.9k|          visit(xd, plane, r);
  251|  2.45M|      } else {
  252|       |        assert(xd->mi[0]->palette_mode_info.palette_size[plane] == 0);
  253|  14.0k|      }
  254|  2.46M|    }
  255|  1.71M|  }
  256|  2.26M|}
av1_receive_compressed_data:
  433|  28.0k|                                const uint8_t **psource) {
  434|  28.0k|  AV1_COMMON *volatile const cm = &pbi->common;
  435|  28.0k|  const uint8_t *source = *psource;
  436|  28.0k|  pbi->error.error_code = AOM_CODEC_OK;
  437|  28.0k|  pbi->error.has_detail = 0;
  438|       |
  439|  28.0k|  if (size == 0) {
  ------------------
  |  Branch (439:7): [True: 0, False: 28.0k]
  ------------------
  440|       |    // This is used to signal that we are missing frames.
  441|       |    // We do not know if the missing frame(s) was supposed to update
  442|       |    // any of the reference buffers, but we act conservative and
  443|       |    // mark only the last buffer as corrupted.
  444|       |    //
  445|       |    // TODO(jkoleszar): Error concealment is undefined and non-normative
  446|       |    // at this point, but if it becomes so, [0] may not always be the correct
  447|       |    // thing to do here.
  448|      0|    RefCntBuffer *ref_buf = get_ref_frame_buf(cm, LAST_FRAME);
  449|      0|    if (ref_buf != NULL) ref_buf->buf.corrupted = 1;
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  ------------------
  450|      0|  }
  451|       |
  452|  28.0k|  if (assign_cur_frame_new_fb(cm) == NULL) {
  ------------------
  |  Branch (452:7): [True: 0, False: 28.0k]
  ------------------
  453|      0|    pbi->error.error_code = AOM_CODEC_MEM_ERROR;
  454|      0|    return 1;
  455|      0|  }
  456|       |
  457|       |  // The jmp_buf is valid only for the duration of the function that calls
  458|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
  459|       |  // before it returns.
  460|  28.0k|  if (setjmp(pbi->error.jmp)) {
  ------------------
  |  Branch (460:7): [True: 0, False: 28.0k]
  ------------------
  461|      0|    const AVxWorkerInterface *const winterface = aom_get_worker_interface();
  462|      0|    int i;
  463|       |
  464|      0|    pbi->error.setjmp = 0;
  465|       |
  466|       |    // Synchronize all threads immediately as a subsequent decode call may
  467|       |    // cause a resize invalidating some allocations.
  468|      0|    winterface->sync(&pbi->lf_worker);
  469|      0|    for (i = 0; i < pbi->num_workers; ++i) {
  ------------------
  |  Branch (469:17): [True: 0, False: 0]
  ------------------
  470|      0|      winterface->sync(&pbi->tile_workers[i]);
  471|      0|    }
  472|       |
  473|      0|    release_current_frame(pbi);
  474|      0|    return -1;
  475|      0|  }
  476|       |
  477|  28.0k|  pbi->error.setjmp = 1;
  478|       |
  479|  28.0k|  int frame_decoded =
  480|  28.0k|      aom_decode_frame_from_obus(pbi, source, source + size, psource);
  481|       |
  482|  28.0k|  if (frame_decoded < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 28.0k]
  ------------------
  483|      0|    assert(pbi->error.error_code != AOM_CODEC_OK);
  484|      0|    release_current_frame(pbi);
  485|      0|    pbi->error.setjmp = 0;
  486|      0|    return 1;
  487|      0|  }
  488|       |
  489|       |#if TXCOEFF_TIMER
  490|       |  cm->cum_txcoeff_timer += cm->txcoeff_timer;
  491|       |  fprintf(stderr,
  492|       |          "txb coeff block number: %d, frame time: %ld, cum time %ld in us\n",
  493|       |          cm->txb_count, cm->txcoeff_timer, cm->cum_txcoeff_timer);
  494|       |  cm->txcoeff_timer = 0;
  495|       |  cm->txb_count = 0;
  496|       |#endif
  497|       |
  498|       |  // Note: At this point, this function holds a reference to cm->cur_frame
  499|       |  // in the buffer pool. This reference is consumed by update_frame_buffers().
  500|  28.0k|  update_frame_buffers(pbi, frame_decoded);
  501|       |
  502|  28.0k|  if (frame_decoded) {
  ------------------
  |  Branch (502:7): [True: 28.0k, False: 0]
  ------------------
  503|  28.0k|    pbi->decoding_first_frame = 0;
  504|  28.0k|  }
  505|       |
  506|  28.0k|  if (pbi->error.error_code != AOM_CODEC_OK) {
  ------------------
  |  Branch (506:7): [True: 0, False: 28.0k]
  ------------------
  507|      0|    pbi->error.setjmp = 0;
  508|      0|    return 1;
  509|      0|  }
  510|       |
  511|  28.0k|  if (!cm->show_existing_frame) {
  ------------------
  |  Branch (511:7): [True: 28.0k, False: 0]
  ------------------
  512|  28.0k|    if (cm->seg.enabled) {
  ------------------
  |  Branch (512:9): [True: 0, False: 28.0k]
  ------------------
  513|      0|      if (cm->prev_frame &&
  ------------------
  |  Branch (513:11): [True: 0, False: 0]
  ------------------
  514|      0|          (cm->mi_params.mi_rows == cm->prev_frame->mi_rows) &&
  ------------------
  |  Branch (514:11): [True: 0, False: 0]
  ------------------
  515|      0|          (cm->mi_params.mi_cols == cm->prev_frame->mi_cols)) {
  ------------------
  |  Branch (515:11): [True: 0, False: 0]
  ------------------
  516|      0|        cm->last_frame_seg_map = cm->prev_frame->seg_map;
  517|      0|      } else {
  518|      0|        cm->last_frame_seg_map = NULL;
  519|      0|      }
  520|      0|    }
  521|  28.0k|  }
  522|       |
  523|       |  // Update progress in frame parallel decode.
  524|  28.0k|  pbi->error.setjmp = 0;
  525|       |
  526|  28.0k|  return 0;
  527|  28.0k|}
av1_get_raw_frame:
  531|  28.3k|                      aom_film_grain_t **grain_params) {
  532|  28.3k|  if (index >= pbi->num_output_frames) return -1;
  ------------------
  |  Branch (532:7): [True: 10.6k, False: 17.6k]
  ------------------
  533|  17.6k|  *sd = &pbi->output_frames[index]->buf;
  534|  17.6k|  *grain_params = &pbi->output_frames[index]->film_grain_params;
  535|  17.6k|  return 0;
  536|  28.3k|}
decoder.c:initialize_dec:
   38|  7.01k|static void initialize_dec(void) {
   39|  7.01k|  av1_rtcd();
   40|  7.01k|  aom_dsp_rtcd();
   41|  7.01k|  aom_scale_rtcd();
   42|  7.01k|  av1_init_intra_predictors();
   43|  7.01k|  av1_init_wedge_masks();
   44|  7.01k|}
decoder.c:dec_free_mi:
   79|  22.6k|static void dec_free_mi(CommonModeInfoParams *mi_params) {
   80|  22.6k|  aom_free(mi_params->mi_alloc);
   81|  22.6k|  mi_params->mi_alloc = NULL;
   82|  22.6k|  mi_params->mi_alloc_size = 0;
   83|  22.6k|  aom_free(mi_params->mi_grid_base);
   84|  22.6k|  mi_params->mi_grid_base = NULL;
   85|  22.6k|  mi_params->mi_grid_size = 0;
   86|  22.6k|  aom_free(mi_params->tx_type_map);
   87|       |  mi_params->tx_type_map = NULL;
   88|  22.6k|}
decoder.c:dec_setup_mi:
   72|  52.2k|static void dec_setup_mi(CommonModeInfoParams *mi_params) {
   73|  52.2k|  const int mi_grid_size =
   74|  52.2k|      mi_params->mi_stride * calc_mi_size(mi_params->mi_rows);
   75|  52.2k|  memset(mi_params->mi_grid_base, 0,
   76|  52.2k|         mi_grid_size * sizeof(*mi_params->mi_grid_base));
   77|  52.2k|}
decoder.c:dec_set_mb_mi:
   47|  24.1k|                          int height, BLOCK_SIZE min_partition_size) {
   48|  24.1k|  (void)min_partition_size;
   49|       |  // Ensure that the decoded width and height are both multiples of
   50|       |  // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if
   51|       |  // subsampling is used).
   52|       |  // This simplifies the implementation of various experiments,
   53|       |  // eg. cdef, which operates on units of 8x8 luma pixels.
   54|  24.1k|  const int aligned_width = ALIGN_POWER_OF_TWO(width, 3);
  ------------------
  |  |   69|  24.1k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
   55|  24.1k|  const int aligned_height = ALIGN_POWER_OF_TWO(height, 3);
  ------------------
  |  |   69|  24.1k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
   56|       |
   57|  24.1k|  mi_params->mi_cols = aligned_width >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  24.1k|#define MI_SIZE_LOG2 2
  ------------------
   58|  24.1k|  mi_params->mi_rows = aligned_height >> MI_SIZE_LOG2;
  ------------------
  |  |   39|  24.1k|#define MI_SIZE_LOG2 2
  ------------------
   59|  24.1k|  mi_params->mi_stride = calc_mi_size(mi_params->mi_cols);
   60|       |
   61|  24.1k|  mi_params->mb_cols = ROUND_POWER_OF_TWO(mi_params->mi_cols, 2);
  ------------------
  |  |   41|  24.1k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   62|  24.1k|  mi_params->mb_rows = ROUND_POWER_OF_TWO(mi_params->mi_rows, 2);
  ------------------
  |  |   41|  24.1k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   63|  24.1k|  mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols;
   64|       |
   65|  24.1k|  mi_params->mi_alloc_bsize = BLOCK_4X4;
   66|  24.1k|  mi_params->mi_alloc_stride = mi_params->mi_stride;
   67|       |
   68|       |  assert(mi_size_wide[mi_params->mi_alloc_bsize] ==
   69|  24.1k|         mi_size_high[mi_params->mi_alloc_bsize]);
   70|  24.1k|}
decoder.c:update_frame_buffers:
  365|  28.0k|static void update_frame_buffers(AV1Decoder *pbi, int frame_decoded) {
  366|  28.0k|  int ref_index = 0, mask;
  367|  28.0k|  AV1_COMMON *const cm = &pbi->common;
  368|  28.0k|  BufferPool *const pool = cm->buffer_pool;
  369|       |
  370|  28.0k|  if (frame_decoded) {
  ------------------
  |  Branch (370:7): [True: 28.0k, False: 0]
  ------------------
  371|  28.0k|    lock_buffer_pool(pool);
  372|       |
  373|       |    // In ext-tile decoding, the camera frame header is only decoded once. So,
  374|       |    // we don't update the references here.
  375|  28.0k|    if (!pbi->camera_frame_header_ready) {
  ------------------
  |  Branch (375:9): [True: 28.0k, False: 0]
  ------------------
  376|       |      // The following for loop needs to release the reference stored in
  377|       |      // cm->ref_frame_map[ref_index] before storing a reference to
  378|       |      // cm->cur_frame in cm->ref_frame_map[ref_index].
  379|   105k|      for (mask = cm->current_frame.refresh_frame_flags; mask; mask >>= 1) {
  ------------------
  |  Branch (379:58): [True: 77.1k, False: 28.0k]
  ------------------
  380|  77.1k|        if (mask & 1) {
  ------------------
  |  Branch (380:13): [True: 77.1k, False: 0]
  ------------------
  381|  77.1k|          decrease_ref_count(cm->ref_frame_map[ref_index], pool);
  382|  77.1k|          cm->ref_frame_map[ref_index] = cm->cur_frame;
  383|  77.1k|          ++cm->cur_frame->ref_count;
  384|  77.1k|        }
  385|  77.1k|        ++ref_index;
  386|  77.1k|      }
  387|  28.0k|    }
  388|       |
  389|  28.0k|    if (cm->show_existing_frame || cm->show_frame) {
  ------------------
  |  Branch (389:9): [True: 0, False: 28.0k]
  |  Branch (389:36): [True: 28.0k, False: 0]
  ------------------
  390|  28.0k|      if (pbi->output_all_layers) {
  ------------------
  |  Branch (390:11): [True: 14.2k, False: 13.8k]
  ------------------
  391|       |        // Append this frame to the output queue
  392|  14.2k|        if (pbi->num_output_frames >= MAX_NUM_SPATIAL_LAYERS) {
  ------------------
  |  |   71|  14.2k|#define MAX_NUM_SPATIAL_LAYERS 4
  ------------------
  |  Branch (392:13): [True: 0, False: 14.2k]
  ------------------
  393|       |          // We can't store the new frame anywhere, so drop it and return an
  394|       |          // error
  395|      0|          cm->cur_frame->buf.corrupted = 1;
  396|      0|          decrease_ref_count(cm->cur_frame, pool);
  397|      0|          pbi->error.error_code = AOM_CODEC_UNSUP_BITSTREAM;
  398|  14.2k|        } else {
  399|  14.2k|          pbi->output_frames[pbi->num_output_frames] = cm->cur_frame;
  400|  14.2k|          pbi->num_output_frames++;
  401|  14.2k|        }
  402|  14.2k|      } else {
  403|       |        // Replace any existing output frame
  404|  13.8k|        assert(pbi->num_output_frames == 0 || pbi->num_output_frames == 1);
  405|  13.8k|        if (pbi->num_output_frames > 0) {
  ------------------
  |  Branch (405:13): [True: 10.3k, False: 3.46k]
  ------------------
  406|  10.3k|          decrease_ref_count(pbi->output_frames[0], pool);
  407|  10.3k|        }
  408|  13.8k|        pbi->output_frames[0] = cm->cur_frame;
  409|  13.8k|        pbi->num_output_frames = 1;
  410|  13.8k|      }
  411|  28.0k|    } else {
  412|      0|      decrease_ref_count(cm->cur_frame, pool);
  413|      0|    }
  414|       |
  415|  28.0k|    unlock_buffer_pool(pool);
  416|  28.0k|  } else {
  417|       |    // Nothing was decoded, so just drop this frame buffer
  418|      0|    lock_buffer_pool(pool);
  419|      0|    decrease_ref_count(cm->cur_frame, pool);
  420|      0|    unlock_buffer_pool(pool);
  421|      0|  }
  422|  28.0k|  cm->cur_frame = NULL;
  423|       |
  424|  28.0k|  if (!pbi->camera_frame_header_ready) {
  ------------------
  |  Branch (424:7): [True: 28.0k, False: 0]
  ------------------
  425|       |    // Invalidate these references until the next frame starts.
  426|   224k|    for (ref_index = 0; ref_index < INTER_REFS_PER_FRAME; ref_index++) {
  ------------------
  |  Branch (426:25): [True: 196k, False: 28.0k]
  ------------------
  427|   196k|      cm->remapped_ref_idx[ref_index] = INVALID_IDX;
  ------------------
  |  |   15|   196k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  428|   196k|    }
  429|  28.0k|  }
  430|  28.0k|}

av1_dx_iface.c:decrease_ref_count:
  468|  10.6k|                                      BufferPool *const pool) {
  469|  10.6k|  if (buf != NULL) {
  ------------------
  |  Branch (469:7): [True: 10.6k, False: 0]
  ------------------
  470|  10.6k|    --buf->ref_count;
  471|       |    // Reference counts should never become negative. If this assertion fails,
  472|       |    // there is a bug in our reference count management.
  473|  10.6k|    assert(buf->ref_count >= 0);
  474|       |    // A worker may only get a free framebuffer index when calling get_free_fb.
  475|       |    // But the raw frame buffer is not set up until we finish decoding header.
  476|       |    // So if any error happens during decoding header, frame_bufs[idx] will not
  477|       |    // have a valid raw frame buffer.
  478|  10.6k|    if (buf->ref_count == 0 && buf->raw_frame_buffer.data) {
  ------------------
  |  Branch (478:9): [True: 0, False: 10.6k]
  |  Branch (478:32): [True: 0, False: 0]
  ------------------
  479|      0|      pool->release_fb_cb(pool->cb_priv, &buf->raw_frame_buffer);
  480|      0|      buf->raw_frame_buffer.data = NULL;
  481|      0|      buf->raw_frame_buffer.size = 0;
  482|       |      buf->raw_frame_buffer.priv = NULL;
  483|      0|    }
  484|  10.6k|  }
  485|  10.6k|}
decodeframe.c:decrease_ref_count:
  468|  56.1k|                                      BufferPool *const pool) {
  469|  56.1k|  if (buf != NULL) {
  ------------------
  |  Branch (469:7): [True: 0, False: 56.1k]
  ------------------
  470|      0|    --buf->ref_count;
  471|       |    // Reference counts should never become negative. If this assertion fails,
  472|       |    // there is a bug in our reference count management.
  473|      0|    assert(buf->ref_count >= 0);
  474|       |    // A worker may only get a free framebuffer index when calling get_free_fb.
  475|       |    // But the raw frame buffer is not set up until we finish decoding header.
  476|       |    // So if any error happens during decoding header, frame_bufs[idx] will not
  477|       |    // have a valid raw frame buffer.
  478|      0|    if (buf->ref_count == 0 && buf->raw_frame_buffer.data) {
  ------------------
  |  Branch (478:9): [True: 0, False: 0]
  |  Branch (478:32): [True: 0, False: 0]
  ------------------
  479|      0|      pool->release_fb_cb(pool->cb_priv, &buf->raw_frame_buffer);
  480|      0|      buf->raw_frame_buffer.data = NULL;
  481|      0|      buf->raw_frame_buffer.size = 0;
  482|       |      buf->raw_frame_buffer.priv = NULL;
  483|      0|    }
  484|      0|  }
  485|  56.1k|}
decoder.c:decrease_ref_count:
  468|  87.5k|                                      BufferPool *const pool) {
  469|  87.5k|  if (buf != NULL) {
  ------------------
  |  Branch (469:7): [True: 31.4k, False: 56.1k]
  ------------------
  470|  31.4k|    --buf->ref_count;
  471|       |    // Reference counts should never become negative. If this assertion fails,
  472|       |    // there is a bug in our reference count management.
  473|  31.4k|    assert(buf->ref_count >= 0);
  474|       |    // A worker may only get a free framebuffer index when calling get_free_fb.
  475|       |    // But the raw frame buffer is not set up until we finish decoding header.
  476|       |    // So if any error happens during decoding header, frame_bufs[idx] will not
  477|       |    // have a valid raw frame buffer.
  478|  31.4k|    if (buf->ref_count == 0 && buf->raw_frame_buffer.data) {
  ------------------
  |  Branch (478:9): [True: 14.0k, False: 17.4k]
  |  Branch (478:32): [True: 14.0k, False: 0]
  ------------------
  479|  14.0k|      pool->release_fb_cb(pool->cb_priv, &buf->raw_frame_buffer);
  480|  14.0k|      buf->raw_frame_buffer.data = NULL;
  481|  14.0k|      buf->raw_frame_buffer.size = 0;
  482|       |      buf->raw_frame_buffer.priv = NULL;
  483|  14.0k|    }
  484|  31.4k|  }
  485|  87.5k|}
detokenize.c:av1_read_uniform:
  488|  25.3k|static inline int av1_read_uniform(aom_reader *r, int n) {
  489|  25.3k|  const int l = get_unsigned_bits(n);
  490|  25.3k|  const int m = (1 << l) - n;
  491|  25.3k|  const int v = aom_read_literal(r, l - 1, ACCT_STR);
  ------------------
  |  |   47|  25.3k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  492|  25.3k|  assert(l != 0);
  493|  25.3k|  if (v < m)
  ------------------
  |  Branch (493:7): [True: 19.7k, False: 5.63k]
  ------------------
  494|  19.7k|    return v;
  495|  5.63k|  else
  496|  5.63k|    return (v << 1) - m + aom_read_literal(r, 1, ACCT_STR);
  ------------------
  |  |   47|  5.63k|  aom_read_literal_(r, bits ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  497|  25.3k|}

av1_read_coeffs_txb:
  326|  2.02M|                         const int col, const TX_SIZE tx_size) {
  327|       |#if TXCOEFF_TIMER
  328|       |  struct aom_usec_timer timer;
  329|       |  aom_usec_timer_start(&timer);
  330|       |#endif
  331|  2.02M|  MACROBLOCKD *const xd = &dcb->xd;
  332|  2.02M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  333|  2.02M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  334|       |
  335|  2.02M|  const BLOCK_SIZE bsize = mbmi->bsize;
  336|  2.02M|  assert(bsize < BLOCK_SIZES_ALL);
  337|  2.02M|  const BLOCK_SIZE plane_bsize =
  338|  2.02M|      get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
  339|       |
  340|  2.02M|  TXB_CTX txb_ctx;
  341|  2.02M|  get_txb_ctx(plane_bsize, tx_size, plane, pd->above_entropy_context + col,
  342|  2.02M|              pd->left_entropy_context + row, &txb_ctx);
  343|       |
  344|  2.02M|  assert(dcb->xd.error_info->setjmp);
  345|  2.02M|  const uint8_t cul_level =
  346|  2.02M|      read_coeffs_txb(cm, dcb, r, row, col, plane, &txb_ctx, tx_size);
  347|  2.02M|  av1_set_entropy_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level, col,
  348|  2.02M|                           row);
  349|       |
  350|  2.02M|  if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (350:7): [True: 438k, False: 1.59M]
  ------------------
  351|   438k|    const PLANE_TYPE plane_type = get_plane_type(plane);
  352|       |    // tx_type will be read out in av1_read_coeffs_txb_facade
  353|   438k|    const TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, row, col, tx_size,
  354|   438k|                                            cm->features.reduced_tx_set_used);
  355|       |
  356|   438k|    if (plane == 0) {
  ------------------
  |  Branch (356:9): [True: 327k, False: 111k]
  ------------------
  357|   327k|      const int txw = tx_size_wide_unit[tx_size];
  358|   327k|      const int txh = tx_size_high_unit[tx_size];
  359|       |      // The 16x16 unit is due to the constraint from tx_64x64 which sets the
  360|       |      // maximum tx size for chroma as 32x32. Coupled with 4x1 transform block
  361|       |      // size, the constraint takes effect in 32x16 / 16x32 size too. To solve
  362|       |      // the intricacy, cover all the 16x16 units inside a 64 level transform.
  363|   327k|      if (txw == tx_size_wide_unit[TX_64X64] ||
  ------------------
  |  Branch (363:11): [True: 284, False: 327k]
  ------------------
  364|   327k|          txh == tx_size_high_unit[TX_64X64]) {
  ------------------
  |  Branch (364:11): [True: 18.4E, False: 327k]
  ------------------
  365|    311|        const int tx_unit = tx_size_wide_unit[TX_16X16];
  366|    311|        const int stride = xd->tx_type_map_stride;
  367|  1.55k|        for (int idy = 0; idy < txh; idy += tx_unit) {
  ------------------
  |  Branch (367:27): [True: 1.24k, False: 311]
  ------------------
  368|  6.20k|          for (int idx = 0; idx < txw; idx += tx_unit) {
  ------------------
  |  Branch (368:29): [True: 4.96k, False: 1.24k]
  ------------------
  369|  4.96k|            xd->tx_type_map[(row + idy) * stride + col + idx] = tx_type;
  370|  4.96k|          }
  371|  1.24k|        }
  372|    311|      }
  373|   327k|    }
  374|   438k|  }
  375|       |
  376|       |#if TXCOEFF_TIMER
  377|       |  aom_usec_timer_mark(&timer);
  378|       |  const int64_t elapsed_time = aom_usec_timer_elapsed(&timer);
  379|       |  cm->txcoeff_timer += elapsed_time;
  380|       |  ++cm->txb_count;
  381|       |#endif
  382|  2.02M|}
decodetxb.c:read_coeffs_txb:
  113|  2.03M|                               const TX_SIZE tx_size) {
  114|  2.03M|  MACROBLOCKD *const xd = &dcb->xd;
  115|  2.03M|  FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
  116|  2.03M|  const int32_t max_value = (1 << (7 + xd->bd)) - 1;
  117|  2.03M|  const int32_t min_value = -(1 << (7 + xd->bd));
  118|  2.03M|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  119|  2.03M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  120|  2.03M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  121|  2.03M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  122|  2.03M|  const int16_t *const dequant = pd->seg_dequant_QTX[mbmi->segment_id];
  123|  2.03M|  tran_low_t *const tcoeffs = dcb->dqcoeff_block[plane] + dcb->cb_offset[plane];
  124|  2.03M|  const int shift = av1_get_tx_scale(tx_size);
  125|  2.03M|  const int bhl = get_txb_bhl(tx_size);
  126|  2.03M|  const int width = get_txb_wide(tx_size);
  127|  2.03M|  const int height = get_txb_high(tx_size);
  128|  2.03M|  int cul_level = 0;
  129|  2.03M|  int dc_val = 0;
  130|  2.03M|  uint8_t levels_buf[TX_PAD_2D];
  131|  2.03M|  uint8_t *const levels = set_levels(levels_buf, height);
  132|  2.03M|  const int all_zero = aom_read_symbol(
  ------------------
  |  |   51|  2.03M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  133|  2.03M|      r, ec_ctx->txb_skip_cdf[txs_ctx][txb_ctx->txb_skip_ctx], 2, ACCT_STR);
  134|  2.03M|  eob_info *eob_data = dcb->eob_data[plane] + dcb->txb_offset[plane];
  135|  2.03M|  uint16_t *const eob = &(eob_data->eob);
  136|  2.03M|  uint16_t *const max_scan_line = &(eob_data->max_scan_line);
  137|  2.03M|  *max_scan_line = 0;
  138|  2.03M|  *eob = 0;
  139|       |
  140|       |#if CONFIG_INSPECTION
  141|       |  if (plane == 0) {
  142|       |    const int txk_type_idx =
  143|       |        av1_get_txk_type_index(mbmi->bsize, blk_row, blk_col);
  144|       |    mbmi->tx_skip[txk_type_idx] = all_zero;
  145|       |  }
  146|       |#endif
  147|       |
  148|  2.03M|  if (all_zero) {
  ------------------
  |  Branch (148:7): [True: 113k, False: 1.91M]
  ------------------
  149|   113k|    *max_scan_line = 0;
  150|   113k|    if (plane == 0) {
  ------------------
  |  Branch (150:9): [True: 71.0k, False: 42.5k]
  ------------------
  151|  71.0k|      xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col] = DCT_DCT;
  152|  71.0k|    }
  153|   113k|    return 0;
  154|   113k|  }
  155|       |
  156|  1.91M|  if (plane == AOM_PLANE_Y) {
  ------------------
  |  |  281|  1.91M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (156:7): [True: 1.31M, False: 606k]
  ------------------
  157|       |    // only y plane's tx_type is transmitted
  158|  1.31M|    av1_read_tx_type(cm, xd, blk_row, blk_col, tx_size, r);
  159|  1.31M|  }
  160|  1.91M|  const TX_TYPE tx_type =
  161|  1.91M|      av1_get_tx_type(xd, plane_type, blk_row, blk_col, tx_size,
  162|  1.91M|                      cm->features.reduced_tx_set_used);
  163|  1.91M|  const TX_CLASS tx_class = tx_type_to_class[tx_type];
  164|  1.91M|  const qm_val_t *iqmatrix =
  165|  1.91M|      av1_get_iqmatrix(&cm->quant_params, xd, plane, tx_size, tx_type);
  166|  1.91M|  const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type);
  167|  1.91M|  const int16_t *const scan = scan_order->scan;
  168|  1.91M|  int eob_extra = 0;
  169|  1.91M|  int eob_pt = 1;
  170|       |
  171|  1.91M|  const int eob_multi_size = txsize_log2_minus4[tx_size];
  172|  1.91M|  const int eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1;
  ------------------
  |  Branch (172:29): [True: 1.78M, False: 134k]
  ------------------
  173|  1.91M|  switch (eob_multi_size) {
  174|   995k|    case 0:
  ------------------
  |  Branch (174:5): [True: 995k, False: 921k]
  ------------------
  175|   995k|      eob_pt =
  176|   995k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf16[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|   995k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  177|   995k|                          5, ACCT_STR) +
  178|   995k|          1;
  179|   995k|      break;
  180|   126k|    case 1:
  ------------------
  |  Branch (180:5): [True: 126k, False: 1.79M]
  ------------------
  181|   126k|      eob_pt =
  182|   126k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf32[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|   126k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  183|   126k|                          6, ACCT_STR) +
  184|   126k|          1;
  185|   126k|      break;
  186|   723k|    case 2:
  ------------------
  |  Branch (186:5): [True: 723k, False: 1.19M]
  ------------------
  187|   723k|      eob_pt =
  188|   723k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf64[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|   723k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  189|   723k|                          7, ACCT_STR) +
  190|   723k|          1;
  191|   723k|      break;
  192|  22.7k|    case 3:
  ------------------
  |  Branch (192:5): [True: 22.7k, False: 1.89M]
  ------------------
  193|  22.7k|      eob_pt =
  194|  22.7k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf128[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|  22.7k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  195|  22.7k|                          8, ACCT_STR) +
  196|  22.7k|          1;
  197|  22.7k|      break;
  198|  45.1k|    case 4:
  ------------------
  |  Branch (198:5): [True: 45.1k, False: 1.87M]
  ------------------
  199|  45.1k|      eob_pt =
  200|  45.1k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf256[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|  45.1k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  201|  45.1k|                          9, ACCT_STR) +
  202|  45.1k|          1;
  203|  45.1k|      break;
  204|  2.70k|    case 5:
  ------------------
  |  Branch (204:5): [True: 2.70k, False: 1.91M]
  ------------------
  205|  2.70k|      eob_pt =
  206|  2.70k|          aom_read_symbol(r, ec_ctx->eob_flag_cdf512[plane_type][eob_multi_ctx],
  ------------------
  |  |   51|  2.70k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  207|  2.70k|                          10, ACCT_STR) +
  208|  2.70k|          1;
  209|  2.70k|      break;
  210|  4.43k|    case 6:
  ------------------
  |  Branch (210:5): [True: 4.43k, False: 1.91M]
  ------------------
  211|  4.43k|    default:
  ------------------
  |  Branch (211:5): [True: 0, False: 1.91M]
  ------------------
  212|  4.43k|      eob_pt = aom_read_symbol(
  ------------------
  |  |   51|  4.43k|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  213|  4.43k|                   r, ec_ctx->eob_flag_cdf1024[plane_type][eob_multi_ctx], 11,
  214|  4.43k|                   ACCT_STR) +
  215|  4.43k|               1;
  216|  4.43k|      break;
  217|  1.91M|  }
  218|       |
  219|  1.90M|  const int eob_offset_bits = av1_eob_offset_bits[eob_pt];
  220|  1.90M|  if (eob_offset_bits > 0) {
  ------------------
  |  Branch (220:7): [True: 1.79M, False: 104k]
  ------------------
  221|  1.79M|    const int eob_ctx = eob_pt - 3;
  222|  1.79M|    int bit = aom_read_symbol(
  ------------------
  |  |   51|  1.79M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  223|  1.79M|        r, ec_ctx->eob_extra_cdf[txs_ctx][plane_type][eob_ctx], 2, ACCT_STR);
  224|  1.79M|    if (bit) {
  ------------------
  |  Branch (224:9): [True: 1.44M, False: 354k]
  ------------------
  225|  1.44M|      eob_extra += (1 << (eob_offset_bits - 1));
  226|  1.44M|    }
  227|       |
  228|  6.44M|    for (int i = 1; i < eob_offset_bits; i++) {
  ------------------
  |  Branch (228:21): [True: 4.64M, False: 1.79M]
  ------------------
  229|  4.64M|      bit = aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|  4.64M|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  230|  4.64M|      if (bit) {
  ------------------
  |  Branch (230:11): [True: 3.44M, False: 1.19M]
  ------------------
  231|  3.44M|        eob_extra += (1 << (eob_offset_bits - 1 - i));
  232|  3.44M|      }
  233|  4.64M|    }
  234|  1.79M|  }
  235|  1.90M|  *eob = rec_eob_pos(eob_pt, eob_extra);
  236|       |
  237|  1.90M|  if (*eob > 1) {
  ------------------
  |  Branch (237:7): [True: 1.79M, False: 103k]
  ------------------
  238|  1.79M|    memset(levels_buf, 0,
  239|  1.79M|           sizeof(*levels_buf) *
  240|  1.79M|               ((height + TX_PAD_HOR) * (width + TX_PAD_VER) + TX_PAD_END));
  ------------------
  |  |  190|  1.79M|#define TX_PAD_HOR 4
  ------------------
                             ((height + TX_PAD_HOR) * (width + TX_PAD_VER) + TX_PAD_END));
  ------------------
  |  |  195|  1.79M|#define TX_PAD_VER (TX_PAD_TOP + TX_PAD_BOTTOM)
  |  |  ------------------
  |  |  |  |  193|  1.79M|#define TX_PAD_TOP 0
  |  |  ------------------
  |  |               #define TX_PAD_VER (TX_PAD_TOP + TX_PAD_BOTTOM)
  |  |  ------------------
  |  |  |  |  194|  1.79M|#define TX_PAD_BOTTOM 4
  |  |  ------------------
  ------------------
                             ((height + TX_PAD_HOR) * (width + TX_PAD_VER) + TX_PAD_END));
  ------------------
  |  |  197|  1.79M|#define TX_PAD_END 16
  ------------------
  241|  1.79M|  }
  242|       |
  243|  1.90M|  {
  244|       |    // Read the non-zero coefficient with scan index eob-1
  245|       |    // TODO(angiebird): Put this into a function
  246|  1.90M|    const int c = *eob - 1;
  247|  1.90M|    const int pos = scan[c];
  248|  1.90M|    const int coeff_ctx = get_lower_levels_ctx_eob(bhl, width, c);
  249|  1.90M|    const int nsymbs = 3;
  250|  1.90M|    aom_cdf_prob *cdf =
  251|  1.90M|        ec_ctx->coeff_base_eob_cdf[txs_ctx][plane_type][coeff_ctx];
  252|  1.90M|    int level = aom_read_symbol(r, cdf, nsymbs, ACCT_STR) + 1;
  ------------------
  |  |   51|  1.90M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  253|  1.90M|    if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  1.90M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (253:9): [True: 618k, False: 1.28M]
  ------------------
  254|   618k|      const int br_ctx = get_br_ctx_eob(pos, bhl, tx_class);
  255|   618k|      cdf = ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type][br_ctx];
  ------------------
  |  |   34|   618k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 617k, False: 535]
  |  |  ------------------
  ------------------
  256|  1.78M|      for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|  1.78M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  1.78M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                    for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|  1.16M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (256:25): [True: 1.57M, False: 214k]
  ------------------
  257|  1.57M|        const int k = aom_read_symbol(r, cdf, BR_CDF_SIZE, ACCT_STR);
  ------------------
  |  |   51|  1.57M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  258|  1.57M|        level += k;
  259|  1.57M|        if (k < BR_CDF_SIZE - 1) break;
  ------------------
  |  |   48|  1.57M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (259:13): [True: 403k, False: 1.16M]
  ------------------
  260|  1.57M|      }
  261|   618k|    }
  262|  1.90M|    levels[get_padded_idx(pos, bhl)] = level;
  263|  1.90M|  }
  264|  1.90M|  if (*eob > 1) {
  ------------------
  |  Branch (264:7): [True: 1.81M, False: 91.3k]
  ------------------
  265|  1.81M|    base_cdf_arr base_cdf = ec_ctx->coeff_base_cdf[txs_ctx][plane_type];
  266|  1.81M|    br_cdf_arr br_cdf =
  267|  1.81M|        ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type];
  ------------------
  |  |   34|  1.81M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.80M, False: 6.15k]
  |  |  ------------------
  ------------------
  268|  1.81M|    if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (268:9): [True: 1.68M, False: 123k]
  ------------------
  269|  1.68M|      read_coeffs_reverse_2d(r, tx_size, 1, *eob - 1 - 1, scan, bhl, levels,
  270|  1.68M|                             base_cdf, br_cdf);
  271|  1.68M|      read_coeffs_reverse(r, tx_size, tx_class, 0, 0, scan, bhl, levels,
  272|  1.68M|                          base_cdf, br_cdf);
  273|  1.68M|    } else {
  274|   123k|      read_coeffs_reverse(r, tx_size, tx_class, 0, *eob - 1 - 1, scan, bhl,
  275|   123k|                          levels, base_cdf, br_cdf);
  276|   123k|    }
  277|  1.81M|  }
  278|       |
  279|  50.6M|  for (int c = 0; c < *eob; ++c) {
  ------------------
  |  Branch (279:19): [True: 48.7M, False: 1.90M]
  ------------------
  280|  48.7M|    const int pos = scan[c];
  281|  48.7M|    uint8_t sign;
  282|  48.7M|    tran_low_t level = levels[get_padded_idx(pos, bhl)];
  283|  48.7M|    if (level) {
  ------------------
  |  Branch (283:9): [True: 31.9M, False: 16.8M]
  ------------------
  284|  31.9M|      *max_scan_line = AOMMAX(*max_scan_line, pos);
  ------------------
  |  |   35|  31.9M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 19.0M, False: 12.8M]
  |  |  ------------------
  ------------------
  285|  31.9M|      if (c == 0) {
  ------------------
  |  Branch (285:11): [True: 1.67M, False: 30.2M]
  ------------------
  286|  1.67M|        const int dc_sign_ctx = txb_ctx->dc_sign_ctx;
  287|  1.67M|        sign = aom_read_symbol(r, ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx],
  ------------------
  |  |   51|  1.67M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  288|  1.67M|                               2, ACCT_STR);
  289|  30.2M|      } else {
  290|  30.2M|        sign = aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|  30.2M|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  291|  30.2M|      }
  292|  31.9M|      if (level >= MAX_BASE_BR_RANGE) {
  ------------------
  |  |   53|  31.9M|#define MAX_BASE_BR_RANGE (COEFF_BASE_RANGE + NUM_BASE_LEVELS + 1)
  |  |  ------------------
  |  |  |  |   49|  31.9M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|  31.9M|#define BR_CDF_SIZE (4)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_BASE_BR_RANGE (COEFF_BASE_RANGE + NUM_BASE_LEVELS + 1)
  |  |  ------------------
  |  |  |  |   46|  31.9M|#define NUM_BASE_LEVELS 2
  |  |  ------------------
  ------------------
  |  Branch (292:11): [True: 5.49M, False: 26.4M]
  ------------------
  293|  5.49M|        level += read_golomb(xd, r);
  294|  5.49M|      }
  295|       |
  296|  31.9M|      if (c == 0) dc_val = sign ? -level : level;
  ------------------
  |  Branch (296:11): [True: 1.67M, False: 30.2M]
  |  Branch (296:28): [True: 855k, False: 817k]
  ------------------
  297|       |
  298|       |      // Bitmasking to clamp level to valid range:
  299|       |      //   The valid range for 8/10/12 bit vdieo is at most 14/16/18 bit
  300|  31.9M|      level &= 0xfffff;
  301|  31.9M|      cul_level += level;
  302|  31.9M|      tran_low_t dq_coeff;
  303|       |      // Bitmasking to clamp dq_coeff to valid range:
  304|       |      //   The valid range for 8/10/12 bit video is at most 17/19/21 bit
  305|  31.9M|      dq_coeff =
  306|  31.9M|          (tran_low_t)((int64_t)level * get_dqv(dequant, scan[c], iqmatrix) &
  307|  31.9M|                       0xffffff);
  308|  31.9M|      dq_coeff = dq_coeff >> shift;
  309|  31.9M|      if (sign) {
  ------------------
  |  Branch (309:11): [True: 16.8M, False: 15.1M]
  ------------------
  310|  16.8M|        dq_coeff = -dq_coeff;
  311|  16.8M|      }
  312|  31.9M|      tcoeffs[pos] = clamp(dq_coeff, min_value, max_value);
  313|  31.9M|    }
  314|  48.7M|  }
  315|       |
  316|  1.90M|  cul_level = AOMMIN(COEFF_CONTEXT_MASK, cul_level);
  ------------------
  |  |   34|  1.90M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.47M, False: 428k]
  |  |  ------------------
  ------------------
  317|       |
  318|       |  // DC value
  319|  1.90M|  set_dc_sign(&cul_level, dc_val);
  320|       |
  321|  1.90M|  return cul_level;
  322|  1.91M|}
decodetxb.c:rec_eob_pos:
   44|  1.88M|static inline int rec_eob_pos(const int eob_token, const int extra) {
   45|  1.88M|  int eob = av1_eob_group_start[eob_token];
   46|  1.88M|  if (eob > 2) {
  ------------------
  |  Branch (46:7): [True: 1.77M, False: 103k]
  ------------------
   47|  1.77M|    eob += extra;
   48|  1.77M|  }
   49|  1.88M|  return eob;
   50|  1.88M|}
decodetxb.c:read_coeffs_reverse_2d:
   66|  1.68M|                                          br_cdf_arr br_cdf) {
   67|  39.3M|  for (int c = end_si; c >= start_si; --c) {
  ------------------
  |  Branch (67:24): [True: 37.6M, False: 1.68M]
  ------------------
   68|  37.6M|    const int pos = scan[c];
   69|  37.6M|    const int coeff_ctx = get_lower_levels_ctx_2d(levels, pos, bhl, tx_size);
   70|  37.6M|    const int nsymbs = 4;
   71|  37.6M|    int level = aom_read_symbol(r, base_cdf[coeff_ctx], nsymbs, ACCT_STR);
  ------------------
  |  |   51|  37.6M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   72|  37.6M|    if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  37.6M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (72:9): [True: 14.2M, False: 23.3M]
  ------------------
   73|  14.2M|      const int br_ctx = get_br_ctx_2d(levels, pos, bhl);
   74|  14.2M|      aom_cdf_prob *cdf = br_cdf[br_ctx];
   75|  35.6M|      for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|  35.6M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  35.6M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                    for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|  21.3M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (75:25): [True: 31.9M, False: 3.63M]
  ------------------
   76|  31.9M|        const int k = aom_read_symbol(r, cdf, BR_CDF_SIZE, ACCT_STR);
  ------------------
  |  |   51|  31.9M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   77|  31.9M|        level += k;
   78|  31.9M|        if (k < BR_CDF_SIZE - 1) break;
  ------------------
  |  |   48|  31.9M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (78:13): [True: 10.6M, False: 21.3M]
  ------------------
   79|  31.9M|      }
   80|  14.2M|    }
   81|  37.6M|    levels[get_padded_idx(pos, bhl)] = level;
   82|  37.6M|  }
   83|  1.68M|}
decodetxb.c:read_coeffs_reverse:
   89|  1.80M|                                       br_cdf_arr br_cdf) {
   90|  7.08M|  for (int c = end_si; c >= start_si; --c) {
  ------------------
  |  Branch (90:24): [True: 5.27M, False: 1.80M]
  ------------------
   91|  5.27M|    const int pos = scan[c];
   92|  5.27M|    const int coeff_ctx =
   93|  5.27M|        get_lower_levels_ctx(levels, pos, bhl, tx_size, tx_class);
   94|  5.27M|    const int nsymbs = 4;
   95|  5.27M|    int level = aom_read_symbol(r, base_cdf[coeff_ctx], nsymbs, ACCT_STR);
  ------------------
  |  |   51|  5.27M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   96|  5.27M|    if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  5.27M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (96:9): [True: 2.87M, False: 2.40M]
  ------------------
   97|  2.87M|      const int br_ctx = get_br_ctx(levels, pos, bhl, tx_class);
   98|  2.87M|      aom_cdf_prob *cdf = br_cdf[br_ctx];
   99|  9.11M|      for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|  9.11M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  9.11M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                    for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|  6.24M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (99:25): [True: 7.83M, False: 1.27M]
  ------------------
  100|  7.83M|        const int k = aom_read_symbol(r, cdf, BR_CDF_SIZE, ACCT_STR);
  ------------------
  |  |   51|  7.83M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
  101|  7.83M|        level += k;
  102|  7.83M|        if (k < BR_CDF_SIZE - 1) break;
  ------------------
  |  |   48|  7.83M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (102:13): [True: 1.59M, False: 6.24M]
  ------------------
  103|  7.83M|      }
  104|  2.87M|    }
  105|  5.27M|    levels[get_padded_idx(pos, bhl)] = level;
  106|  5.27M|  }
  107|  1.80M|}
decodetxb.c:read_golomb:
   22|  5.50M|static int read_golomb(MACROBLOCKD *xd, aom_reader *r) {
   23|  5.50M|  int x = 1;
   24|  5.50M|  int length = 0;
   25|  5.50M|  int i = 0;
   26|       |
   27|  28.1M|  while (!i) {
  ------------------
  |  Branch (27:10): [True: 22.6M, False: 5.50M]
  ------------------
   28|  22.6M|    i = aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|  22.6M|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   29|  22.6M|    ++length;
   30|  22.6M|    if (length > 20) {
  ------------------
  |  Branch (30:9): [True: 0, False: 22.6M]
  ------------------
   31|      0|      aom_internal_error(xd->error_info, AOM_CODEC_CORRUPT_FRAME,
   32|      0|                         "Invalid length in read_golomb");
   33|      0|    }
   34|  22.6M|  }
   35|       |
   36|  23.2M|  for (i = 0; i < length - 1; ++i) {
  ------------------
  |  Branch (36:15): [True: 17.7M, False: 5.50M]
  ------------------
   37|  17.7M|    x <<= 1;
   38|  17.7M|    x += aom_read_bit(r, ACCT_STR);
  ------------------
  |  |   43|  17.7M|  aom_read_bit_(r ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   39|  17.7M|  }
   40|       |
   41|  5.50M|  return x - 1;
   42|  5.50M|}
decodetxb.c:get_dqv:
   53|  31.9M|                          const qm_val_t *iqmatrix) {
   54|  31.9M|  int dqv = dequant[!!coeff_idx];
   55|  31.9M|  if (iqmatrix != NULL)
  ------------------
  |  Branch (55:7): [True: 18.7M, False: 13.2M]
  ------------------
   56|  18.7M|    dqv =
   57|  18.7M|        ((iqmatrix[coeff_idx] * dqv) + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|  18.7M|#define AOM_QM_BITS 5
  ------------------
                      ((iqmatrix[coeff_idx] * dqv) + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|  18.7M|#define AOM_QM_BITS 5
  ------------------
   58|  31.9M|  return dqv;
   59|  31.9M|}

av1_decode_palette_tokens:
   66|  25.3k|                               aom_reader *r) {
   67|  25.3k|  assert(plane == 0 || plane == 1);
   68|  25.3k|  Av1ColorMapParam params;
   69|  25.3k|  params.color_map =
   70|  25.3k|      xd->plane[plane].color_index_map + xd->color_index_map_offset[plane];
   71|  25.3k|  params.map_cdf = plane ? xd->tile_ctx->palette_uv_color_index_cdf
  ------------------
  |  Branch (71:20): [True: 9.28k, False: 16.0k]
  ------------------
   72|  25.3k|                         : xd->tile_ctx->palette_y_color_index_cdf;
   73|  25.3k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
   74|  25.3k|  params.n_colors = mbmi->palette_mode_info.palette_size[plane];
   75|  25.3k|  av1_get_block_dimensions(mbmi->bsize, plane, xd, &params.plane_width,
   76|  25.3k|                           &params.plane_height, &params.rows, &params.cols);
   77|  25.3k|  decode_color_map_tokens(&params, r);
   78|  25.3k|}
detokenize.c:decode_color_map_tokens:
   25|  25.3k|static void decode_color_map_tokens(Av1ColorMapParam *param, aom_reader *r) {
   26|  25.3k|  uint8_t color_order[PALETTE_MAX_SIZE];
   27|  25.3k|  const int n = param->n_colors;
   28|  25.3k|  uint8_t *const color_map = param->color_map;
   29|  25.3k|  MapCdf color_map_cdf = param->map_cdf;
   30|  25.3k|  int plane_block_width = param->plane_width;
   31|  25.3k|  int plane_block_height = param->plane_height;
   32|  25.3k|  int rows = param->rows;
   33|  25.3k|  int cols = param->cols;
   34|       |
   35|       |  // The first color index.
   36|  25.3k|  color_map[0] = av1_read_uniform(r, n);
   37|  25.3k|  assert(color_map[0] < n);
   38|       |
   39|       |  // Run wavefront on the palette map index decoding.
   40|   338k|  for (int i = 1; i < rows + cols - 1; ++i) {
  ------------------
  |  Branch (40:19): [True: 312k, False: 25.3k]
  ------------------
   41|  1.56M|    for (int j = AOMMIN(i, cols - 1); j >= AOMMAX(0, i - rows + 1); --j) {
  ------------------
  |  |   34|   312k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 127k, False: 185k]
  |  |  ------------------
  ------------------
                  for (int j = AOMMIN(i, cols - 1); j >= AOMMAX(0, i - rows + 1); --j) {
  ------------------
  |  |   35|  1.56M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 713k, False: 849k]
  |  |  ------------------
  ------------------
  |  Branch (41:39): [True: 1.25M, False: 312k]
  ------------------
   42|  1.25M|      const int color_ctx = av1_get_palette_color_index_context(
   43|  1.25M|          color_map, plane_block_width, (i - j), j, n, color_order, NULL);
   44|  1.25M|      const int color_idx = aom_read_symbol(
  ------------------
  |  |   51|  1.25M|  aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
  ------------------
   45|  1.25M|          r, color_map_cdf[n - PALETTE_MIN_SIZE][color_ctx], n, ACCT_STR);
   46|  1.25M|      assert(color_idx >= 0 && color_idx < n);
   47|  1.25M|      color_map[(i - j) * plane_block_width + j] = color_order[color_idx];
   48|  1.25M|    }
   49|   312k|  }
   50|       |  // Copy last column to extra columns.
   51|  25.3k|  if (cols < plane_block_width) {
  ------------------
  |  Branch (51:7): [True: 12, False: 25.3k]
  ------------------
   52|    300|    for (int i = 0; i < rows; ++i) {
  ------------------
  |  Branch (52:21): [True: 288, False: 12]
  ------------------
   53|    288|      memset(color_map + i * plane_block_width + cols,
   54|    288|             color_map[i * plane_block_width + cols - 1],
   55|    288|             (plane_block_width - cols));
   56|    288|    }
   57|     12|  }
   58|       |  // Copy last row to extra rows.
   59|  25.4k|  for (int i = rows; i < plane_block_height; ++i) {
  ------------------
  |  Branch (59:22): [True: 120, False: 25.3k]
  ------------------
   60|    120|    memcpy(color_map + i * plane_block_width,
   61|    120|           color_map + (rows - 1) * plane_block_width, plane_block_width);
   62|    120|  }
   63|  25.3k|}

aom_get_num_layers_from_operating_point_idc:
   31|  14.0k|    unsigned int *number_temporal_layers) {
   32|       |  // derive number of spatial/temporal layers from operating_point_idc
   33|       |
   34|  14.0k|  if (!number_spatial_layers || !number_temporal_layers)
  ------------------
  |  Branch (34:7): [True: 0, False: 14.0k]
  |  Branch (34:33): [True: 0, False: 14.0k]
  ------------------
   35|      0|    return AOM_CODEC_INVALID_PARAM;
   36|       |
   37|  14.0k|  if (operating_point_idc == 0) {
  ------------------
  |  Branch (37:7): [True: 0, False: 14.0k]
  ------------------
   38|      0|    *number_temporal_layers = 1;
   39|      0|    *number_spatial_layers = 1;
   40|  14.0k|  } else {
   41|  14.0k|    *number_spatial_layers = 0;
   42|  14.0k|    *number_temporal_layers = 0;
   43|  70.1k|    for (int j = 0; j < MAX_NUM_SPATIAL_LAYERS; j++) {
  ------------------
  |  |   71|  70.1k|#define MAX_NUM_SPATIAL_LAYERS 4
  ------------------
  |  Branch (43:21): [True: 56.1k, False: 14.0k]
  ------------------
   44|  56.1k|      *number_spatial_layers +=
   45|  56.1k|          (operating_point_idc >> (j + MAX_NUM_TEMPORAL_LAYERS)) & 0x1;
  ------------------
  |  |   70|  56.1k|#define MAX_NUM_TEMPORAL_LAYERS 8
  ------------------
   46|  56.1k|    }
   47|   126k|    for (int j = 0; j < MAX_NUM_TEMPORAL_LAYERS; j++) {
  ------------------
  |  |   70|   126k|#define MAX_NUM_TEMPORAL_LAYERS 8
  ------------------
  |  Branch (47:21): [True: 112k, False: 14.0k]
  ------------------
   48|   112k|      *number_temporal_layers += (operating_point_idc >> j) & 0x1;
   49|   112k|    }
   50|  14.0k|  }
   51|       |
   52|  14.0k|  return AOM_CODEC_OK;
   53|  14.0k|}
aom_decode_frame_from_obus:
  869|  28.0k|                               const uint8_t **p_data_end) {
  870|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  871|       |  start_timing(pbi, aom_decode_frame_from_obus_time);
  872|       |#endif
  873|  28.0k|  AV1_COMMON *const cm = &pbi->common;
  874|  28.0k|  int frame_decoding_finished = 0;
  875|  28.0k|  int is_first_tg_obu_received = 1;
  876|       |  // Whenever pbi->seen_frame_header is set to 1, frame_header is set to the
  877|       |  // beginning of the frame_header_obu and frame_header_size is set to its
  878|       |  // size. This allows us to check if a redundant frame_header_obu is a copy
  879|       |  // of the previous frame_header_obu.
  880|       |  //
  881|       |  // Initialize frame_header to a dummy nonnull pointer, otherwise the Clang
  882|       |  // Static Analyzer in clang 7.0.1 will falsely warn that a null pointer is
  883|       |  // passed as an argument to a 'nonnull' parameter of memcmp(). The initial
  884|       |  // value will not be used.
  885|  28.0k|  const uint8_t *frame_header = data;
  886|  28.0k|  uint32_t frame_header_size = 0;
  887|  28.0k|  ObuHeader obu_header;
  888|       |
  889|  28.0k|  assert(pbi->error.setjmp);
  890|       |
  891|  28.0k|  memset(&obu_header, 0, sizeof(obu_header));
  892|  28.0k|  pbi->seen_frame_header = 0;
  893|  28.0k|  pbi->next_start_tile = 0;
  894|  28.0k|  pbi->num_tile_groups = 0;
  895|       |
  896|  28.0k|  if (data_end < data) {
  ------------------
  |  Branch (896:7): [True: 0, False: 28.0k]
  ------------------
  897|      0|    pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  898|      0|    return -1;
  899|      0|  }
  900|       |
  901|       |  // Reset pbi->camera_frame_header_ready to 0 if cm->tiles.large_scale = 0.
  902|  28.0k|  if (!cm->tiles.large_scale) pbi->camera_frame_header_ready = 0;
  ------------------
  |  Branch (902:7): [True: 28.0k, False: 0]
  ------------------
  903|       |
  904|       |  // decode frame as a series of OBUs
  905|  70.1k|  while (!frame_decoding_finished && pbi->error.error_code == AOM_CODEC_OK) {
  ------------------
  |  Branch (905:10): [True: 42.1k, False: 28.0k]
  |  Branch (905:38): [True: 42.1k, False: 0]
  ------------------
  906|  42.1k|    struct aom_read_bit_buffer rb;
  907|  42.1k|    size_t payload_size = 0;
  908|  42.1k|    size_t decoded_payload_size = 0;
  909|  42.1k|    size_t obu_payload_offset = 0;
  910|  42.1k|    size_t bytes_read = 0;
  911|  42.1k|    const size_t bytes_available = data_end - data;
  912|       |
  913|  42.1k|    if (bytes_available == 0 && !pbi->seen_frame_header) {
  ------------------
  |  Branch (913:9): [True: 0, False: 42.1k]
  |  Branch (913:33): [True: 0, False: 0]
  ------------------
  914|      0|      *p_data_end = data;
  915|      0|      pbi->error.error_code = AOM_CODEC_OK;
  916|      0|      break;
  917|      0|    }
  918|       |
  919|  42.1k|    aom_codec_err_t status =
  920|  42.1k|        aom_read_obu_header_and_size(data, bytes_available, pbi->is_annexb,
  921|  42.1k|                                     &obu_header, &payload_size, &bytes_read);
  922|       |
  923|  42.1k|    if (status != AOM_CODEC_OK) {
  ------------------
  |  Branch (923:9): [True: 0, False: 42.1k]
  ------------------
  924|      0|      pbi->error.error_code = status;
  925|      0|      return -1;
  926|      0|    }
  927|       |
  928|       |    // Record obu size header information.
  929|  42.1k|    pbi->obu_size_hdr.data = data + obu_header.size;
  930|  42.1k|    pbi->obu_size_hdr.size = bytes_read - obu_header.size;
  931|       |
  932|       |    // Note: aom_read_obu_header_and_size() takes care of checking that this
  933|       |    // doesn't cause 'data' to advance past 'data_end'.
  934|  42.1k|    data += bytes_read;
  935|       |
  936|  42.1k|    if ((size_t)(data_end - data) < payload_size) {
  ------------------
  |  Branch (936:9): [True: 0, False: 42.1k]
  ------------------
  937|      0|      pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  938|      0|      return -1;
  939|      0|    }
  940|       |
  941|  42.1k|    cm->temporal_layer_id = obu_header.temporal_layer_id;
  942|  42.1k|    cm->spatial_layer_id = obu_header.spatial_layer_id;
  943|       |
  944|  42.1k|    if (obu_header.type != OBU_TEMPORAL_DELIMITER &&
  ------------------
  |  Branch (944:9): [True: 35.0k, False: 7.01k]
  ------------------
  945|  35.0k|        obu_header.type != OBU_SEQUENCE_HEADER) {
  ------------------
  |  Branch (945:9): [True: 28.0k, False: 7.01k]
  ------------------
  946|       |      // don't decode obu if it's not in current operating mode
  947|  28.0k|      if (!is_obu_in_current_operating_point(pbi, &obu_header)) {
  ------------------
  |  Branch (947:11): [True: 0, False: 28.0k]
  ------------------
  948|      0|        data += payload_size;
  949|      0|        continue;
  950|      0|      }
  951|  28.0k|    }
  952|       |
  953|  42.1k|    av1_init_read_bit_buffer(pbi, &rb, data, data + payload_size);
  954|       |
  955|  42.1k|    switch (obu_header.type) {
  956|  7.01k|      case OBU_TEMPORAL_DELIMITER:
  ------------------
  |  Branch (956:7): [True: 7.01k, False: 35.0k]
  ------------------
  957|  7.01k|        decoded_payload_size = read_temporal_delimiter_obu();
  958|  7.01k|        if (pbi->seen_frame_header) {
  ------------------
  |  Branch (958:13): [True: 0, False: 7.01k]
  ------------------
  959|       |          // A new temporal unit has started, but the frame in the previous
  960|       |          // temporal unit is incomplete.
  961|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  962|      0|          return -1;
  963|      0|        }
  964|  7.01k|        break;
  965|  7.01k|      case OBU_SEQUENCE_HEADER:
  ------------------
  |  Branch (965:7): [True: 7.01k, False: 35.0k]
  ------------------
  966|  7.01k|        decoded_payload_size = read_sequence_header_obu(pbi, &rb);
  967|  7.01k|        if (pbi->error.error_code != AOM_CODEC_OK) return -1;
  ------------------
  |  Branch (967:13): [True: 0, False: 7.01k]
  ------------------
  968|       |        // The sequence header should not change in the middle of a frame.
  969|  7.01k|        if (pbi->sequence_header_changed && pbi->seen_frame_header) {
  ------------------
  |  Branch (969:13): [True: 0, False: 7.01k]
  |  Branch (969:45): [True: 0, False: 0]
  ------------------
  970|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  971|      0|          return -1;
  972|      0|        }
  973|  7.01k|        break;
  974|  7.01k|      case OBU_FRAME_HEADER:
  ------------------
  |  Branch (974:7): [True: 0, False: 42.1k]
  ------------------
  975|      0|      case OBU_REDUNDANT_FRAME_HEADER:
  ------------------
  |  Branch (975:7): [True: 0, False: 42.1k]
  ------------------
  976|  28.0k|      case OBU_FRAME:
  ------------------
  |  Branch (976:7): [True: 28.0k, False: 14.0k]
  ------------------
  977|  28.0k|        if (obu_header.type == OBU_REDUNDANT_FRAME_HEADER) {
  ------------------
  |  Branch (977:13): [True: 0, False: 28.0k]
  ------------------
  978|      0|          if (!pbi->seen_frame_header) {
  ------------------
  |  Branch (978:15): [True: 0, False: 0]
  ------------------
  979|      0|            pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  980|      0|            return -1;
  981|      0|          }
  982|  28.0k|        } else {
  983|       |          // OBU_FRAME_HEADER or OBU_FRAME.
  984|  28.0k|          if (pbi->seen_frame_header) {
  ------------------
  |  Branch (984:15): [True: 0, False: 28.0k]
  ------------------
  985|      0|            pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
  986|      0|            return -1;
  987|      0|          }
  988|  28.0k|        }
  989|       |        // Only decode first frame header received
  990|  28.0k|        if (!pbi->seen_frame_header ||
  ------------------
  |  Branch (990:13): [True: 28.0k, False: 0]
  ------------------
  991|      0|            (cm->tiles.large_scale && !pbi->camera_frame_header_ready &&
  ------------------
  |  Branch (991:14): [True: 0, False: 0]
  |  Branch (991:39): [True: 0, False: 0]
  ------------------
  992|  28.0k|             obu_header.type != OBU_REDUNDANT_FRAME_HEADER)) {
  ------------------
  |  Branch (992:14): [True: 0, False: 0]
  ------------------
  993|  28.0k|          frame_header_size = read_frame_header_obu(
  994|  28.0k|              pbi, &rb, data, p_data_end, obu_header.type != OBU_FRAME);
  995|  28.0k|          frame_header = data;
  996|  28.0k|          pbi->seen_frame_header = 1;
  997|  28.0k|          if (!pbi->ext_tile_debug && cm->tiles.large_scale)
  ------------------
  |  Branch (997:15): [True: 28.0k, False: 0]
  |  Branch (997:39): [True: 0, False: 28.0k]
  ------------------
  998|      0|            pbi->camera_frame_header_ready = 1;
  999|  28.0k|        } else {
 1000|       |          // Verify that the frame_header_obu is identical to the original
 1001|       |          // frame_header_obu.
 1002|      0|          if (frame_header_size > payload_size ||
  ------------------
  |  Branch (1002:15): [True: 0, False: 0]
  ------------------
 1003|      0|              memcmp(data, frame_header, frame_header_size) != 0) {
  ------------------
  |  Branch (1003:15): [True: 0, False: 0]
  ------------------
 1004|      0|            pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1005|      0|            return -1;
 1006|      0|          }
 1007|      0|          assert(rb.bit_offset == 0);
 1008|      0|          rb.bit_offset = 8 * frame_header_size;
 1009|      0|        }
 1010|       |
 1011|  28.0k|        decoded_payload_size = frame_header_size;
 1012|  28.0k|        pbi->frame_header_size = frame_header_size;
 1013|  28.0k|        cm->cur_frame->temporal_id = obu_header.temporal_layer_id;
 1014|  28.0k|        cm->cur_frame->spatial_id = obu_header.spatial_layer_id;
 1015|       |
 1016|  28.0k|        if (cm->show_existing_frame) {
  ------------------
  |  Branch (1016:13): [True: 0, False: 28.0k]
  ------------------
 1017|      0|          if (obu_header.type == OBU_FRAME) {
  ------------------
  |  Branch (1017:15): [True: 0, False: 0]
  ------------------
 1018|      0|            pbi->error.error_code = AOM_CODEC_UNSUP_BITSTREAM;
 1019|      0|            return -1;
 1020|      0|          }
 1021|      0|          frame_decoding_finished = 1;
 1022|      0|          pbi->seen_frame_header = 0;
 1023|       |
 1024|      0|          if (cm->show_frame &&
  ------------------
  |  Branch (1024:15): [True: 0, False: 0]
  ------------------
 1025|      0|              !cm->seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (1025:15): [True: 0, False: 0]
  ------------------
 1026|      0|            ++cm->current_frame.frame_number;
 1027|      0|          }
 1028|      0|          break;
 1029|      0|        }
 1030|       |
 1031|       |        // In large scale tile coding, decode the common camera frame header
 1032|       |        // before any tile list OBU.
 1033|  28.0k|        if (!pbi->ext_tile_debug && pbi->camera_frame_header_ready) {
  ------------------
  |  Branch (1033:13): [True: 28.0k, False: 0]
  |  Branch (1033:37): [True: 0, False: 28.0k]
  ------------------
 1034|      0|          frame_decoding_finished = 1;
 1035|       |          // Skip the rest of the frame data.
 1036|      0|          decoded_payload_size = payload_size;
 1037|       |          // Update data_end.
 1038|      0|          *p_data_end = data_end;
 1039|      0|          break;
 1040|      0|        }
 1041|       |
 1042|  28.0k|        if (obu_header.type != OBU_FRAME) break;
  ------------------
  |  Branch (1042:13): [True: 0, False: 28.0k]
  ------------------
 1043|  28.0k|        obu_payload_offset = frame_header_size;
 1044|       |        // Byte align the reader before reading the tile group.
 1045|  28.0k|        byte_alignment(&pbi->error, &rb);
 1046|  28.0k|        AOM_FALLTHROUGH_INTENDED;  // fall through to read tile group.
  ------------------
  |  |   52|  28.0k|  do {                           \
  |  |   53|  28.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 28.0k]
  |  |  ------------------
  ------------------
 1047|  28.0k|      case OBU_TILE_GROUP:
  ------------------
  |  Branch (1047:7): [True: 0, False: 42.1k]
  ------------------
 1048|  28.0k|        if (!pbi->seen_frame_header) {
  ------------------
  |  Branch (1048:13): [True: 0, False: 28.0k]
  ------------------
 1049|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1050|      0|          return -1;
 1051|      0|        }
 1052|  28.0k|        if (obu_payload_offset > payload_size) {
  ------------------
  |  Branch (1052:13): [True: 0, False: 28.0k]
  ------------------
 1053|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1054|      0|          return -1;
 1055|      0|        }
 1056|  28.0k|        decoded_payload_size += read_one_tile_group_obu(
 1057|  28.0k|            pbi, &rb, is_first_tg_obu_received, data + obu_payload_offset,
 1058|  28.0k|            data + payload_size, p_data_end, &frame_decoding_finished,
 1059|  28.0k|            obu_header.type == OBU_FRAME);
 1060|  28.0k|        is_first_tg_obu_received = 0;
 1061|  28.0k|        if (frame_decoding_finished) {
  ------------------
  |  Branch (1061:13): [True: 28.0k, False: 0]
  ------------------
 1062|  28.0k|          pbi->seen_frame_header = 0;
 1063|  28.0k|          pbi->next_start_tile = 0;
 1064|  28.0k|        }
 1065|  28.0k|        pbi->num_tile_groups++;
 1066|  28.0k|        break;
 1067|      0|      case OBU_METADATA: {
  ------------------
  |  Branch (1067:7): [True: 0, False: 42.1k]
  ------------------
 1068|      0|        decoded_payload_size =
 1069|      0|            read_metadata(pbi, data, payload_size, obu_header.has_extension);
 1070|      0|        if (pbi->error.error_code != AOM_CODEC_OK) return -1;
  ------------------
  |  Branch (1070:13): [True: 0, False: 0]
  ------------------
 1071|      0|        break;
 1072|      0|      }
 1073|      0|      case OBU_TILE_LIST:
  ------------------
  |  Branch (1073:7): [True: 0, False: 42.1k]
  ------------------
 1074|      0|        if (CONFIG_NORMAL_TILE_MODE) {
  ------------------
  |  |   54|      0|#define CONFIG_NORMAL_TILE_MODE 0
  |  |  ------------------
  |  |  |  Branch (54:33): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1075|      0|          pbi->error.error_code = AOM_CODEC_UNSUP_BITSTREAM;
 1076|      0|          return -1;
 1077|      0|        }
 1078|       |
 1079|       |        // This OBU type is purely for the large scale tile coding mode.
 1080|       |        // The common camera frame header has to be already decoded.
 1081|      0|        if (!pbi->camera_frame_header_ready) {
  ------------------
  |  Branch (1081:13): [True: 0, False: 0]
  ------------------
 1082|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1083|      0|          return -1;
 1084|      0|        }
 1085|       |
 1086|      0|        cm->tiles.large_scale = 1;
 1087|      0|        av1_set_single_tile_decoding_mode(cm);
 1088|      0|        decoded_payload_size =
 1089|      0|            read_and_decode_one_tile_list(pbi, &rb, data, data + payload_size,
 1090|      0|                                          p_data_end, &frame_decoding_finished);
 1091|      0|        if (pbi->error.error_code != AOM_CODEC_OK) return -1;
  ------------------
  |  Branch (1091:13): [True: 0, False: 0]
  ------------------
 1092|      0|        break;
 1093|      0|      case OBU_PADDING:
  ------------------
  |  Branch (1093:7): [True: 0, False: 42.1k]
  ------------------
 1094|      0|        decoded_payload_size = read_padding(&pbi->error, data, payload_size);
 1095|      0|        if (pbi->error.error_code != AOM_CODEC_OK) return -1;
  ------------------
  |  Branch (1095:13): [True: 0, False: 0]
  ------------------
 1096|      0|        break;
 1097|      0|      default:
  ------------------
  |  Branch (1097:7): [True: 0, False: 42.1k]
  ------------------
 1098|       |        // Skip unrecognized OBUs
 1099|      0|        if (payload_size > 0 &&
  ------------------
  |  Branch (1099:13): [True: 0, False: 0]
  ------------------
 1100|      0|            get_last_nonzero_byte(data, payload_size) == 0) {
  ------------------
  |  Branch (1100:13): [True: 0, False: 0]
  ------------------
 1101|      0|          pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1102|      0|          return -1;
 1103|      0|        }
 1104|      0|        decoded_payload_size = payload_size;
 1105|      0|        break;
 1106|  42.1k|    }
 1107|       |
 1108|       |    // Check that the signalled OBU size matches the actual amount of data read
 1109|  42.1k|    if (decoded_payload_size > payload_size) {
  ------------------
  |  Branch (1109:9): [True: 0, False: 42.1k]
  ------------------
 1110|      0|      pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1111|      0|      return -1;
 1112|      0|    }
 1113|       |
 1114|       |    // If there are extra padding bytes, they should all be zero
 1115|  42.1k|    while (decoded_payload_size < payload_size) {
  ------------------
  |  Branch (1115:12): [True: 0, False: 42.1k]
  ------------------
 1116|      0|      uint8_t padding_byte = data[decoded_payload_size++];
 1117|      0|      if (padding_byte != 0) {
  ------------------
  |  Branch (1117:11): [True: 0, False: 0]
  ------------------
 1118|      0|        pbi->error.error_code = AOM_CODEC_CORRUPT_FRAME;
 1119|      0|        return -1;
 1120|      0|      }
 1121|      0|    }
 1122|       |
 1123|  42.1k|    data += payload_size;
 1124|  42.1k|  }
 1125|       |
 1126|  28.0k|  if (pbi->error.error_code != AOM_CODEC_OK) return -1;
  ------------------
  |  Branch (1126:7): [True: 0, False: 28.0k]
  ------------------
 1127|       |
 1128|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1129|       |  end_timing(pbi, aom_decode_frame_from_obus_time);
 1130|       |
 1131|       |  // Print out timing information.
 1132|       |  int i;
 1133|       |  fprintf(stderr,
 1134|       |          "\n Frame number: %d, Frame type: %s, Show Frame: %d, Show existing "
 1135|       |          "frame: %d\n",
 1136|       |          cm->current_frame.frame_number,
 1137|       |          get_frame_type_enum(cm->current_frame.frame_type), cm->show_frame,
 1138|       |          cm->show_existing_frame);
 1139|       |  // Exclude show_existing_frame since it doesn't take much time.
 1140|       |  if (!cm->show_existing_frame) {
 1141|       |    for (i = 0; i < kTimingComponents; i++) {
 1142|       |      pbi->component_time[i] += pbi->frame_component_time[i];
 1143|       |      fprintf(stderr, " %s:  %" PRId64 " us (total: %" PRId64 " us)\n",
 1144|       |              get_component_name(i), pbi->frame_component_time[i],
 1145|       |              pbi->component_time[i]);
 1146|       |      pbi->frame_component_time[i] = 0;
 1147|       |    }
 1148|       |  }
 1149|       |#endif
 1150|       |
 1151|  28.0k|  return frame_decoding_finished;
 1152|  28.0k|}
obu.c:is_obu_in_current_operating_point:
   56|  28.0k|                                             const ObuHeader *obu_header) {
   57|  28.0k|  if (!pbi->current_operating_point || !obu_header->has_extension) {
  ------------------
  |  Branch (57:7): [True: 0, False: 28.0k]
  |  Branch (57:40): [True: 0, False: 28.0k]
  ------------------
   58|      0|    return 1;
   59|      0|  }
   60|       |
   61|  28.0k|  if ((pbi->current_operating_point >> obu_header->temporal_layer_id) & 0x1 &&
  ------------------
  |  Branch (61:7): [True: 28.0k, False: 0]
  ------------------
   62|  28.0k|      (pbi->current_operating_point >> (obu_header->spatial_layer_id + 8)) &
  ------------------
  |  Branch (62:7): [True: 28.0k, False: 0]
  ------------------
   63|  28.0k|          0x1) {
   64|  28.0k|    return 1;
   65|  28.0k|  }
   66|      0|  return 0;
   67|  28.0k|}
obu.c:read_temporal_delimiter_obu:
   79|  7.01k|static uint32_t read_temporal_delimiter_obu(void) { return 0; }
obu.c:read_sequence_header_obu:
  105|  7.01k|                                         struct aom_read_bit_buffer *rb) {
  106|  7.01k|  AV1_COMMON *const cm = &pbi->common;
  107|  7.01k|  const uint32_t saved_bit_offset = rb->bit_offset;
  108|       |
  109|       |  // Verify rb has been configured to report errors.
  110|  7.01k|  assert(rb->error_handler);
  111|       |
  112|       |  // Use a local variable to store the information as we decode. At the end,
  113|       |  // if no errors have occurred, cm->seq_params is updated.
  114|  7.01k|  SequenceHeader sh = *cm->seq_params;
  115|  7.01k|  SequenceHeader *const seq_params = &sh;
  116|       |
  117|  7.01k|  seq_params->profile = av1_read_profile(rb);
  118|  7.01k|  if (seq_params->profile > CONFIG_MAX_DECODE_PROFILE) {
  ------------------
  |  |   50|  7.01k|#define CONFIG_MAX_DECODE_PROFILE 2
  ------------------
  |  Branch (118:7): [True: 0, False: 7.01k]
  ------------------
  119|      0|    pbi->error.error_code = AOM_CODEC_UNSUP_BITSTREAM;
  120|      0|    return 0;
  121|      0|  }
  122|       |
  123|       |  // Still picture or not
  124|  7.01k|  seq_params->still_picture = aom_rb_read_bit(rb);
  125|  7.01k|  seq_params->reduced_still_picture_hdr = aom_rb_read_bit(rb);
  126|       |  // Video must have reduced_still_picture_hdr = 0
  127|  7.01k|  if (!seq_params->still_picture && seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (127:7): [True: 7.01k, False: 0]
  |  Branch (127:37): [True: 0, False: 7.01k]
  ------------------
  128|      0|    pbi->error.error_code = AOM_CODEC_UNSUP_BITSTREAM;
  129|      0|    return 0;
  130|      0|  }
  131|       |
  132|  7.01k|  if (seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (132:7): [True: 0, False: 7.01k]
  ------------------
  133|      0|    seq_params->timing_info_present = 0;
  134|      0|    seq_params->decoder_model_info_present_flag = 0;
  135|      0|    seq_params->display_model_info_present_flag = 0;
  136|      0|    seq_params->operating_points_cnt_minus_1 = 0;
  137|      0|    seq_params->operating_point_idc[0] = 0;
  138|      0|    seq_params->has_nonzero_operating_point_idc = false;
  139|      0|    if (!read_bitstream_level(&seq_params->seq_level_idx[0], rb)) {
  ------------------
  |  Branch (139:9): [True: 0, False: 0]
  ------------------
  140|      0|      aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  141|      0|                         "Value %d of seq_level_idx[%d] is not yet defined",
  142|      0|                         seq_params->seq_level_idx[0], 0);
  143|      0|    }
  144|      0|    seq_params->tier[0] = 0;
  145|      0|    seq_params->op_params[0].decoder_model_param_present_flag = 0;
  146|      0|    seq_params->op_params[0].display_model_param_present_flag = 0;
  147|  7.01k|  } else {
  148|  7.01k|    seq_params->timing_info_present = aom_rb_read_bit(rb);
  149|  7.01k|    if (seq_params->timing_info_present) {
  ------------------
  |  Branch (149:9): [True: 0, False: 7.01k]
  ------------------
  150|      0|      av1_read_timing_info_header(&seq_params->timing_info, &pbi->error, rb);
  151|       |
  152|      0|      seq_params->decoder_model_info_present_flag = aom_rb_read_bit(rb);
  153|      0|      if (seq_params->decoder_model_info_present_flag)
  ------------------
  |  Branch (153:11): [True: 0, False: 0]
  ------------------
  154|      0|        av1_read_decoder_model_info(&seq_params->decoder_model_info, rb);
  155|  7.01k|    } else {
  156|  7.01k|      seq_params->decoder_model_info_present_flag = 0;
  157|  7.01k|    }
  158|  7.01k|    seq_params->display_model_info_present_flag = aom_rb_read_bit(rb);
  159|  7.01k|    seq_params->operating_points_cnt_minus_1 =
  160|  7.01k|        aom_rb_read_literal(rb, OP_POINTS_CNT_MINUS_1_BITS);
  ------------------
  |  |   93|  7.01k|#define OP_POINTS_CNT_MINUS_1_BITS 5
  ------------------
  161|  7.01k|    seq_params->has_nonzero_operating_point_idc = false;
  162|  35.0k|    for (int i = 0; i < seq_params->operating_points_cnt_minus_1 + 1; i++) {
  ------------------
  |  Branch (162:21): [True: 28.0k, False: 7.01k]
  ------------------
  163|  28.0k|      seq_params->operating_point_idc[i] =
  164|  28.0k|          aom_rb_read_literal(rb, OP_POINTS_IDC_BITS);
  ------------------
  |  |   94|  28.0k|#define OP_POINTS_IDC_BITS 12
  ------------------
  165|  28.0k|      if (seq_params->operating_point_idc[i] != 0)
  ------------------
  |  Branch (165:11): [True: 28.0k, False: 0]
  ------------------
  166|  28.0k|        seq_params->has_nonzero_operating_point_idc = true;
  167|  28.0k|      if (!read_bitstream_level(&seq_params->seq_level_idx[i], rb)) {
  ------------------
  |  Branch (167:11): [True: 0, False: 28.0k]
  ------------------
  168|      0|        aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  169|      0|                           "Value %d of seq_level_idx[%d] is not yet defined",
  170|      0|                           seq_params->seq_level_idx[i], i);
  171|      0|      }
  172|       |      // This is the seq_level_idx[i] > 7 check in the spec. seq_level_idx 7
  173|       |      // is equivalent to level 3.3.
  174|  28.0k|      if (seq_params->seq_level_idx[i] >= SEQ_LEVEL_4_0)
  ------------------
  |  Branch (174:11): [True: 0, False: 28.0k]
  ------------------
  175|      0|        seq_params->tier[i] = aom_rb_read_bit(rb);
  176|  28.0k|      else
  177|  28.0k|        seq_params->tier[i] = 0;
  178|  28.0k|      if (seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (178:11): [True: 0, False: 28.0k]
  ------------------
  179|      0|        seq_params->op_params[i].decoder_model_param_present_flag =
  180|      0|            aom_rb_read_bit(rb);
  181|      0|        if (seq_params->op_params[i].decoder_model_param_present_flag)
  ------------------
  |  Branch (181:13): [True: 0, False: 0]
  ------------------
  182|      0|          av1_read_op_parameters_info(&seq_params->op_params[i],
  183|      0|                                      seq_params->decoder_model_info
  184|      0|                                          .encoder_decoder_buffer_delay_length,
  185|      0|                                      rb);
  186|  28.0k|      } else {
  187|  28.0k|        seq_params->op_params[i].decoder_model_param_present_flag = 0;
  188|  28.0k|      }
  189|  28.0k|      if (seq_params->timing_info_present &&
  ------------------
  |  Branch (189:11): [True: 0, False: 28.0k]
  ------------------
  190|      0|          (seq_params->timing_info.equal_picture_interval ||
  ------------------
  |  Branch (190:12): [True: 0, False: 0]
  ------------------
  191|      0|           seq_params->op_params[i].decoder_model_param_present_flag)) {
  ------------------
  |  Branch (191:12): [True: 0, False: 0]
  ------------------
  192|      0|        seq_params->op_params[i].bitrate = av1_max_level_bitrate(
  193|      0|            seq_params->profile, seq_params->seq_level_idx[i],
  194|      0|            seq_params->tier[i]);
  195|       |        // Level with seq_level_idx = 31 returns a high "dummy" bitrate to pass
  196|       |        // the check
  197|      0|        if (seq_params->op_params[i].bitrate == 0)
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|          aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  199|      0|                             "AV1 does not support this combination of "
  200|      0|                             "profile, level, and tier.");
  201|       |        // Buffer size in bits is bitrate in bits/s * 1 s
  202|      0|        seq_params->op_params[i].buffer_size = seq_params->op_params[i].bitrate;
  203|      0|      }
  204|  28.0k|      if (seq_params->timing_info_present &&
  ------------------
  |  Branch (204:11): [True: 0, False: 28.0k]
  ------------------
  205|      0|          seq_params->timing_info.equal_picture_interval &&
  ------------------
  |  Branch (205:11): [True: 0, False: 0]
  ------------------
  206|      0|          !seq_params->op_params[i].decoder_model_param_present_flag) {
  ------------------
  |  Branch (206:11): [True: 0, False: 0]
  ------------------
  207|       |        // When the decoder_model_parameters are not sent for this op, set
  208|       |        // the default ones that can be used with the resource availability mode
  209|      0|        seq_params->op_params[i].decoder_buffer_delay = 70000;
  210|      0|        seq_params->op_params[i].encoder_buffer_delay = 20000;
  211|      0|        seq_params->op_params[i].low_delay_mode_flag = 0;
  212|      0|      }
  213|       |
  214|  28.0k|      if (seq_params->display_model_info_present_flag) {
  ------------------
  |  Branch (214:11): [True: 0, False: 28.0k]
  ------------------
  215|      0|        seq_params->op_params[i].display_model_param_present_flag =
  216|      0|            aom_rb_read_bit(rb);
  217|      0|        if (seq_params->op_params[i].display_model_param_present_flag) {
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|          seq_params->op_params[i].initial_display_delay =
  219|      0|              aom_rb_read_literal(rb, 4) + 1;
  220|      0|          if (seq_params->op_params[i].initial_display_delay > 10)
  ------------------
  |  Branch (220:15): [True: 0, False: 0]
  ------------------
  221|      0|            aom_internal_error(
  222|      0|                &pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  223|      0|                "AV1 does not support more than 10 decoded frames delay");
  224|      0|        } else {
  225|      0|          seq_params->op_params[i].initial_display_delay = 10;
  226|      0|        }
  227|  28.0k|      } else {
  228|  28.0k|        seq_params->op_params[i].display_model_param_present_flag = 0;
  229|  28.0k|        seq_params->op_params[i].initial_display_delay = 10;
  230|  28.0k|      }
  231|  28.0k|    }
  232|  7.01k|  }
  233|       |  // This decoder supports all levels.  Choose operating point provided by
  234|       |  // external means
  235|  7.01k|  int operating_point = pbi->operating_point;
  236|  7.01k|  if (operating_point < 0 ||
  ------------------
  |  Branch (236:7): [True: 0, False: 7.01k]
  ------------------
  237|  7.01k|      operating_point > seq_params->operating_points_cnt_minus_1)
  ------------------
  |  Branch (237:7): [True: 0, False: 7.01k]
  ------------------
  238|      0|    operating_point = 0;
  239|  7.01k|  pbi->current_operating_point =
  240|  7.01k|      seq_params->operating_point_idc[operating_point];
  241|  7.01k|  aom_codec_err_t status = aom_get_num_layers_from_operating_point_idc(
  242|  7.01k|      pbi->current_operating_point, &pbi->number_spatial_layers,
  243|  7.01k|      &pbi->number_temporal_layers);
  244|  7.01k|  if (status != AOM_CODEC_OK) {
  ------------------
  |  Branch (244:7): [True: 0, False: 7.01k]
  ------------------
  245|      0|    pbi->error.error_code = status;
  246|      0|    return 0;
  247|      0|  }
  248|       |
  249|  7.01k|  av1_read_sequence_header(cm, rb, seq_params);
  250|       |
  251|  7.01k|  av1_read_color_config(rb, pbi->allow_lowbitdepth, seq_params, &pbi->error);
  252|  7.01k|  if (!(seq_params->subsampling_x == 0 && seq_params->subsampling_y == 0) &&
  ------------------
  |  Branch (252:9): [True: 634, False: 6.38k]
  |  Branch (252:43): [True: 634, False: 0]
  ------------------
  253|  6.38k|      !(seq_params->subsampling_x == 1 && seq_params->subsampling_y == 1) &&
  ------------------
  |  Branch (253:9): [True: 6.38k, False: 0]
  |  Branch (253:43): [True: 5.70k, False: 681]
  ------------------
  254|    681|      !(seq_params->subsampling_x == 1 && seq_params->subsampling_y == 0)) {
  ------------------
  |  Branch (254:9): [True: 681, False: 0]
  |  Branch (254:43): [True: 681, False: 0]
  ------------------
  255|      0|    aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  256|      0|                       "Only 4:4:4, 4:2:2 and 4:2:0 are currently supported, "
  257|      0|                       "%d %d subsampling is not supported.\n",
  258|      0|                       seq_params->subsampling_x, seq_params->subsampling_y);
  259|      0|  }
  260|       |
  261|  7.01k|  seq_params->film_grain_params_present = aom_rb_read_bit(rb);
  262|       |
  263|  7.01k|  if (av1_check_trailing_bits(pbi, rb) != 0) {
  ------------------
  |  Branch (263:7): [True: 0, False: 7.01k]
  ------------------
  264|       |    // pbi->error.error_code is already set.
  265|      0|    return 0;
  266|      0|  }
  267|       |
  268|       |  // If a sequence header has been decoded before, we check if the new
  269|       |  // one is consistent with the old one.
  270|  7.01k|  if (pbi->sequence_header_ready) {
  ------------------
  |  Branch (270:7): [True: 0, False: 7.01k]
  ------------------
  271|      0|    if (!are_seq_headers_consistent(cm->seq_params, seq_params))
  ------------------
  |  Branch (271:9): [True: 0, False: 0]
  ------------------
  272|      0|      pbi->sequence_header_changed = 1;
  273|      0|  }
  274|       |
  275|  7.01k|  *cm->seq_params = *seq_params;
  276|  7.01k|  pbi->sequence_header_ready = 1;
  277|       |
  278|  7.01k|  return ((rb->bit_offset - saved_bit_offset + 7) >> 3);
  279|  7.01k|}
obu.c:read_bitstream_level:
   83|  28.0k|                                struct aom_read_bit_buffer *rb) {
   84|  28.0k|  *seq_level_idx = aom_rb_read_literal(rb, LEVEL_BITS);
  ------------------
  |  |  464|  28.0k|#define LEVEL_BITS 5
  ------------------
   85|  28.0k|  if (!is_valid_seq_level_idx(*seq_level_idx)) return 0;
  ------------------
  |  Branch (85:7): [True: 0, False: 28.0k]
  ------------------
   86|  28.0k|  return 1;
   87|  28.0k|}
obu.c:read_frame_header_obu:
  288|  28.0k|                                      int trailing_bits_present) {
  289|  28.0k|  const uint32_t hdr_size =
  290|  28.0k|      av1_decode_frame_headers_and_setup(pbi, rb, trailing_bits_present);
  291|  28.0k|  const AV1_COMMON *cm = &pbi->common;
  292|  28.0k|  if (cm->show_existing_frame) {
  ------------------
  |  Branch (292:7): [True: 0, False: 28.0k]
  ------------------
  293|      0|    *p_data_end = data + hdr_size;
  294|      0|  }
  295|  28.0k|  return hdr_size;
  296|  28.0k|}
obu.c:byte_alignment:
   70|  56.1k|                           struct aom_read_bit_buffer *const rb) {
   71|   208k|  while (rb->bit_offset & 7) {
  ------------------
  |  Branch (71:10): [True: 152k, False: 56.1k]
  ------------------
   72|   152k|    if (aom_rb_read_bit(rb)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 152k]
  ------------------
   73|      0|      aom_internal_error(error_info, AOM_CODEC_CORRUPT_FRAME,
   74|      0|                         "byte_alignment() is not all 0 bits");
   75|      0|    }
   76|   152k|  }
   77|  56.1k|}
obu.c:read_one_tile_group_obu:
  353|  28.0k|    int *is_last_tg, int tile_start_implicit) {
  354|  28.0k|  AV1_COMMON *const cm = &pbi->common;
  355|  28.0k|  int start_tile, end_tile;
  356|       |
  357|  28.0k|  assert((rb->bit_offset & 7) == 0);
  358|  28.0k|  assert(rb->bit_buffer + aom_rb_bytes_read(rb) == data);
  359|       |
  360|  28.0k|  uint32_t header_size = read_tile_group_header(pbi, rb, &start_tile, &end_tile,
  361|  28.0k|                                                tile_start_implicit);
  362|  28.0k|  byte_alignment(&pbi->error, rb);
  363|  28.0k|  data += header_size;
  364|  28.0k|  av1_decode_tg_tiles_and_wrapup(pbi, data, data_end, p_data_end, start_tile,
  365|  28.0k|                                 end_tile, is_first_tg);
  366|       |
  367|  28.0k|  uint32_t tg_payload_size = (uint32_t)(*p_data_end - data);
  368|       |
  369|  28.0k|  *is_last_tg = end_tile == cm->tiles.rows * cm->tiles.cols - 1;
  370|  28.0k|  return header_size + tg_payload_size;
  371|  28.0k|}
obu.c:read_tile_group_header:
  303|  28.0k|                                       int tile_start_implicit) {
  304|  28.0k|  AV1_COMMON *const cm = &pbi->common;
  305|  28.0k|  CommonTileParams *const tiles = &cm->tiles;
  306|  28.0k|  uint32_t saved_bit_offset = rb->bit_offset;
  307|  28.0k|  int tile_start_and_end_present_flag = 0;
  308|  28.0k|  const int num_tiles = tiles->rows * tiles->cols;
  309|       |
  310|  28.0k|  if (!tiles->large_scale && num_tiles > 1) {
  ------------------
  |  Branch (310:7): [True: 28.0k, False: 0]
  |  Branch (310:30): [True: 7.10k, False: 20.9k]
  ------------------
  311|  7.10k|    tile_start_and_end_present_flag = aom_rb_read_bit(rb);
  312|  7.10k|    if (tile_start_implicit && tile_start_and_end_present_flag) {
  ------------------
  |  Branch (312:9): [True: 7.10k, False: 0]
  |  Branch (312:32): [True: 0, False: 7.10k]
  ------------------
  313|      0|      aom_internal_error(
  314|      0|          &pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
  315|      0|          "For OBU_FRAME type obu tile_start_and_end_present_flag must be 0");
  316|      0|    }
  317|  7.10k|  }
  318|  28.0k|  if (tiles->large_scale || num_tiles == 1 ||
  ------------------
  |  Branch (318:7): [True: 0, False: 28.0k]
  |  Branch (318:29): [True: 20.9k, False: 7.10k]
  ------------------
  319|  28.0k|      !tile_start_and_end_present_flag) {
  ------------------
  |  Branch (319:7): [True: 7.10k, False: 0]
  ------------------
  320|  28.0k|    *start_tile = 0;
  321|  28.0k|    *end_tile = num_tiles - 1;
  322|  28.0k|  } else {
  323|      0|    int tile_bits = tiles->log2_rows + tiles->log2_cols;
  324|      0|    *start_tile = aom_rb_read_literal(rb, tile_bits);
  325|      0|    *end_tile = aom_rb_read_literal(rb, tile_bits);
  326|      0|  }
  327|  28.0k|  if (*start_tile != pbi->next_start_tile) {
  ------------------
  |  Branch (327:7): [True: 0, False: 28.0k]
  ------------------
  328|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
  329|      0|                       "tg_start (%d) must be equal to %d", *start_tile,
  330|      0|                       pbi->next_start_tile);
  331|      0|  }
  332|  28.0k|  if (*start_tile > *end_tile) {
  ------------------
  |  Branch (332:7): [True: 0, False: 28.0k]
  ------------------
  333|      0|    aom_internal_error(
  334|      0|        &pbi->error, AOM_CODEC_CORRUPT_FRAME,
  335|      0|        "tg_end (%d) must be greater than or equal to tg_start (%d)", *end_tile,
  336|      0|        *start_tile);
  337|      0|  }
  338|  28.0k|  if (*end_tile >= num_tiles) {
  ------------------
  |  Branch (338:7): [True: 0, False: 28.0k]
  ------------------
  339|      0|    aom_internal_error(&pbi->error, AOM_CODEC_CORRUPT_FRAME,
  340|      0|                       "tg_end (%d) must be less than NumTiles (%d)", *end_tile,
  341|      0|                       num_tiles);
  342|      0|  }
  343|  28.0k|  pbi->next_start_tile = (*end_tile == num_tiles - 1) ? 0 : *end_tile + 1;
  ------------------
  |  Branch (343:26): [True: 28.0k, False: 0]
  ------------------
  344|       |
  345|  28.0k|  return ((rb->bit_offset - saved_bit_offset + 7) >> 3);
  346|  28.0k|}

av1_dealloc_mb_wiener_var_pred_buf:
   55|   105k|void av1_dealloc_mb_wiener_var_pred_buf(ThreadData *td) {
   56|   105k|  aom_free(td->wiener_tmp_pred_buf);
   57|       |  td->wiener_tmp_pred_buf = NULL;
   58|   105k|}
av1_get_sbq_variance_boost:
 1075|  93.9k|int av1_get_sbq_variance_boost(const AV1_COMP *cpi, const MACROBLOCK *x) {
 1076|  93.9k|  const AV1_COMMON *cm = &cpi->common;
 1077|  93.9k|  const int base_qindex = cm->quant_params.base_qindex;
 1078|  93.9k|  const aom_bit_depth_t bit_depth = cm->seq_params->bit_depth;
 1079|       |
 1080|       |  // Variance Boost only supports 64x64 SBs.
 1081|  93.9k|  assert(cm->seq_params->sb_size == BLOCK_64X64);
 1082|       |
 1083|  93.9k|  unsigned int variance = av1_get_variance_boost_block_variance(cpi, x);
 1084|       |  // Compute Variance Boost strength from the deltaq_strength value.
 1085|  93.9k|  double strength = (cpi->oxcf.q_cfg.deltaq_strength / 100.0) * 3.0;
 1086|       |
 1087|       |  // Clamp strength to a reasonable range.
 1088|       |  // deltaq_strength can go up to 1000%, which is too strong for the Variance
 1089|       |  // Boost scaling. Testing revealed strengths as high as 6 (200%) are still
 1090|       |  // reasonable for some specific scenarios.
 1091|  93.9k|  strength = fclamp(strength, 0.0, 6.0);
 1092|       |
 1093|       |  // Variance = 0 areas are either completely flat patches or have very fine
 1094|       |  // gradients. Boost these blocks as if they have a variance of 1.
 1095|  93.9k|  if (variance == 0) {
  ------------------
  |  Branch (1095:7): [True: 15.9k, False: 78.0k]
  ------------------
 1096|  15.9k|    variance = 1;
 1097|  15.9k|  }
 1098|       |
 1099|       |  // Compute a boost based on a fast-growing formula.
 1100|       |  // High and medium variance SBs essentially get no boost, while lower variance
 1101|       |  // SBs get increasingly stronger boosts.
 1102|       |  // Still picture curve, with variance crossover point at 1024.
 1103|  93.9k|  double qstep_ratio = 0.15 * strength * (-log2((double)variance) + 10.0) + 1.0;
 1104|  93.9k|  qstep_ratio = fclamp(qstep_ratio, 1.0, VAR_BOOST_MAX_BOOST);
  ------------------
  |  |   41|  93.9k|#define VAR_BOOST_MAX_BOOST 8.0
  ------------------
 1105|       |
 1106|  93.9k|  double base_q = av1_convert_qindex_to_q(base_qindex, bit_depth);
 1107|  93.9k|  double target_q = base_q / qstep_ratio;
 1108|  93.9k|  int target_qindex = av1_convert_q_to_qindex(target_q, bit_depth);
 1109|       |
 1110|       |  // Determine the SB's delta_q boost by computing an (unscaled) delta_q from
 1111|       |  // the base and target q values, then scale that delta_q according to the
 1112|       |  // frame's base qindex.
 1113|       |  // The scaling coefficients were chosen empirically to maximize SSIMULACRA 2
 1114|       |  // scores, 10th percentile scores, and subjective quality. Boosts become
 1115|       |  // smaller (for a given variance) the lower the base qindex.
 1116|  93.9k|  int boost = (int)round((base_qindex + 544.0) * (base_qindex - target_qindex) /
 1117|  93.9k|                         1279.0);
 1118|  93.9k|  boost = AOMMIN(VAR_BOOST_MAX_DELTAQ_RANGE, boost);
  ------------------
  |  |   34|  93.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 93.9k]
  |  |  ------------------
  ------------------
 1119|       |
 1120|       |  // Variance Boost was designed to always operate in the lossy domain, so MINQ
 1121|       |  // is excluded.
 1122|  93.9k|  int sb_qindex = AOMMAX(base_qindex - boost, MINQ + 1);
  ------------------
  |  |   35|  93.9k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 93.8k, False: 100]
  |  |  ------------------
  ------------------
 1123|       |
 1124|  93.9k|  return sb_qindex;
 1125|  93.9k|}

av1_cyclic_refresh_alloc:
   24|  30.7k|CYCLIC_REFRESH *av1_cyclic_refresh_alloc(int mi_rows, int mi_cols) {
   25|  30.7k|  CYCLIC_REFRESH *const cr = aom_calloc(1, sizeof(*cr));
   26|  30.7k|  if (cr == NULL) return NULL;
  ------------------
  |  Branch (26:7): [True: 0, False: 30.7k]
  ------------------
   27|       |
   28|  30.7k|  cr->map = aom_calloc(mi_rows * mi_cols, sizeof(*cr->map));
   29|  30.7k|  cr->counter_encode_maxq_scene_change = 0;
   30|  30.7k|  cr->percent_refresh_adjustment = 5;
   31|  30.7k|  cr->rate_ratio_qdelta_adjustment = 0.25;
   32|  30.7k|  if (cr->map == NULL) {
  ------------------
  |  Branch (32:7): [True: 0, False: 30.7k]
  ------------------
   33|      0|    av1_cyclic_refresh_free(cr);
   34|      0|    return NULL;
   35|      0|  }
   36|  30.7k|  return cr;
   37|  30.7k|}
av1_cyclic_refresh_free:
   39|  30.7k|void av1_cyclic_refresh_free(CYCLIC_REFRESH *cr) {
   40|  30.7k|  if (cr != NULL) {
  ------------------
  |  Branch (40:7): [True: 30.7k, False: 0]
  ------------------
   41|  30.7k|    aom_free(cr->map);
   42|  30.7k|    aom_free(cr);
   43|  30.7k|  }
   44|  30.7k|}
av1_init_cyclic_refresh_counters:
  257|   116k|void av1_init_cyclic_refresh_counters(MACROBLOCK *const x) {
  258|   116k|  x->actual_num_seg1_blocks = 0;
  259|   116k|  x->actual_num_seg2_blocks = 0;
  260|   116k|}

partition_search.c:cyclic_refresh_segment_id_boosted:
  312|  51.5k|static inline int cyclic_refresh_segment_id_boosted(int segment_id) {
  313|  51.5k|  return segment_id == CR_SEGMENT_ID_BOOST1 ||
  ------------------
  |  |   26|   103k|#define CR_SEGMENT_ID_BOOST1 1
  ------------------
  |  Branch (313:10): [True: 0, False: 51.5k]
  ------------------
  314|  51.5k|         segment_id == CR_SEGMENT_ID_BOOST2;
  ------------------
  |  |   27|  51.5k|#define CR_SEGMENT_ID_BOOST2 2
  ------------------
  |  Branch (314:10): [True: 18.4E, False: 51.5k]
  ------------------
  315|  51.5k|}
nonrd_pickmode.c:cyclic_refresh_segment_id_boosted:
  312|  17.9k|static inline int cyclic_refresh_segment_id_boosted(int segment_id) {
  313|  17.9k|  return segment_id == CR_SEGMENT_ID_BOOST1 ||
  ------------------
  |  |   26|  35.8k|#define CR_SEGMENT_ID_BOOST1 1
  ------------------
  |  Branch (313:10): [True: 0, False: 17.9k]
  ------------------
  314|  17.9k|         segment_id == CR_SEGMENT_ID_BOOST2;
  ------------------
  |  |   27|  17.9k|#define CR_SEGMENT_ID_BOOST2 2
  ------------------
  |  Branch (314:10): [True: 0, False: 17.9k]
  ------------------
  315|  17.9k|}
nonrd_opt.c:cyclic_refresh_segment_id_boosted:
  312|    310|static inline int cyclic_refresh_segment_id_boosted(int segment_id) {
  313|    310|  return segment_id == CR_SEGMENT_ID_BOOST1 ||
  ------------------
  |  |   26|    620|#define CR_SEGMENT_ID_BOOST1 1
  ------------------
  |  Branch (313:10): [True: 0, False: 310]
  ------------------
  314|    310|         segment_id == CR_SEGMENT_ID_BOOST2;
  ------------------
  |  |   27|    310|#define CR_SEGMENT_ID_BOOST2 2
  ------------------
  |  Branch (314:10): [True: 0, False: 310]
  ------------------
  315|    310|}
var_based_part.c:cyclic_refresh_segment_id_boosted:
  312|   533k|static inline int cyclic_refresh_segment_id_boosted(int segment_id) {
  313|   533k|  return segment_id == CR_SEGMENT_ID_BOOST1 ||
  ------------------
  |  |   26|  1.06M|#define CR_SEGMENT_ID_BOOST1 1
  ------------------
  |  Branch (313:10): [True: 18.4E, False: 533k]
  ------------------
  314|   533k|         segment_id == CR_SEGMENT_ID_BOOST2;
  ------------------
  |  |   27|   533k|#define CR_SEGMENT_ID_BOOST2 2
  ------------------
  |  Branch (314:10): [True: 18.4E, False: 533k]
  ------------------
  315|   533k|}

av1_get_variance_boost_block_variance:
  185|  93.9k|                                                   const MACROBLOCK *x) {
  186|  93.9k|#define SUPERBLOCK_SIZE 64
  187|  93.9k|#define SUBBLOCK_SIZE 8
  188|  93.9k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  189|  93.9k|#define SUBBLOCKS_IN_SB (SUBBLOCKS_IN_SB_DIM * SUBBLOCKS_IN_SB_DIM)
  190|  93.9k|#define SUBBLOCKS_IN_OCTILE (SUBBLOCKS_IN_SB / 8)
  191|  93.9k|  DECLARE_ALIGNED(16, static const uint16_t,
  ------------------
  |  |   19|  93.9k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  192|  93.9k|                  av1_highbd_all_zeros[SUBBLOCK_SIZE]) = { 0 };
  193|  93.9k|  DECLARE_ALIGNED(16, static const uint8_t,
  ------------------
  |  |   19|  93.9k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  194|  93.9k|                  av1_all_zeros[SUBBLOCK_SIZE]) = { 0 };
  195|       |
  196|  93.9k|  const MACROBLOCKD *xd = &x->e_mbd;
  197|  93.9k|  unsigned int sse;
  198|       |  // Octile is currently hard-coded and optimized for still pictures. In the
  199|       |  // future, we might want to expose this as a parameter that can be fine-tuned
  200|       |  // by the caller.
  201|       |  // An octile of 5 was chosen because it was found to strike the best balance
  202|       |  // between quality and consistency. Lower octiles tend to score lower in
  203|       |  // SSIMU2, while higher octiles tend to harm subjective quality consistency,
  204|       |  // especially in <1 MP images.
  205|  93.9k|  const int octile = 5;
  206|  93.9k|  const uint8_t *all_zeros = is_cur_buf_hbd(xd)
  ------------------
  |  Branch (206:30): [True: 22.3k, False: 71.5k]
  ------------------
  207|  93.9k|                                 ? CONVERT_TO_BYTEPTR(av1_highbd_all_zeros)
  ------------------
  |  |   80|  22.3k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  208|  93.9k|                                 : av1_all_zeros;
  209|  93.9k|  unsigned int variances[SUBBLOCKS_IN_SB];
  210|       |
  211|       |  // Calculate subblock variances.
  212|  93.9k|  aom_variance_fn_t vf = cpi->ppi->fn_ptr[BLOCK_8X8].vf;
  213|   844k|  for (int subb_i = 0; subb_i < SUBBLOCKS_IN_SB_DIM; subb_i++) {
  ------------------
  |  |  188|   844k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  186|   844k|#define SUPERBLOCK_SIZE 64
  |  |  ------------------
  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  187|   844k|#define SUBBLOCK_SIZE 8
  |  |  ------------------
  ------------------
  |  Branch (213:24): [True: 751k, False: 93.9k]
  ------------------
  214|   751k|    int i = subb_i * SUBBLOCK_SIZE;
  ------------------
  |  |  187|   751k|#define SUBBLOCK_SIZE 8
  ------------------
  215|  6.73M|    for (int subb_j = 0; subb_j < SUBBLOCKS_IN_SB_DIM; subb_j++) {
  ------------------
  |  |  188|  6.73M|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  186|  6.73M|#define SUPERBLOCK_SIZE 64
  |  |  ------------------
  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  187|  6.73M|#define SUBBLOCK_SIZE 8
  |  |  ------------------
  ------------------
  |  Branch (215:26): [True: 5.97M, False: 751k]
  ------------------
  216|  5.97M|      int j = subb_j * SUBBLOCK_SIZE;
  ------------------
  |  |  187|  5.97M|#define SUBBLOCK_SIZE 8
  ------------------
  217|       |      // Truncating values to integers (i.e. the 64 term) was found to perform
  218|       |      // better than rounding, or returning them as doubles.
  219|  5.97M|      variances[subb_i * SUBBLOCKS_IN_SB_DIM + subb_j] =
  ------------------
  |  |  188|  5.97M|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  186|  5.97M|#define SUPERBLOCK_SIZE 64
  |  |  ------------------
  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  ------------------
  |  |  |  |  187|  5.97M|#define SUBBLOCK_SIZE 8
  |  |  ------------------
  ------------------
  220|  5.97M|          vf(x->plane[0].src.buf + i * x->plane[0].src.stride + j,
  221|  5.97M|             x->plane[0].src.stride, all_zeros, 0, &sse) /
  222|  5.97M|          64;
  223|  5.97M|    }
  224|   751k|  }
  225|       |
  226|       |  // Order the 8x8 SB values from smallest to largest variance.
  227|  93.9k|  qsort(variances, SUBBLOCKS_IN_SB, sizeof(unsigned int), comp_unsigned_int);
  ------------------
  |  |  189|  93.9k|#define SUBBLOCKS_IN_SB (SUBBLOCKS_IN_SB_DIM * SUBBLOCKS_IN_SB_DIM)
  |  |  ------------------
  |  |  |  |  188|  93.9k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  186|  93.9k|#define SUPERBLOCK_SIZE 64
  |  |  |  |  ------------------
  |  |  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|  93.9k|#define SUBBLOCK_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SUBBLOCKS_IN_SB (SUBBLOCKS_IN_SB_DIM * SUBBLOCKS_IN_SB_DIM)
  |  |  ------------------
  |  |  |  |  188|  93.9k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  186|  93.9k|#define SUPERBLOCK_SIZE 64
  |  |  |  |  ------------------
  |  |  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|  93.9k|#define SUBBLOCK_SIZE 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|       |
  229|       |  // Sample three 8x8 variance values: at the specified octile, previous octile,
  230|       |  // and next octile. Make sure we use the last subblock in each octile as the
  231|       |  // representative of the octile.
  232|  93.9k|  assert(octile >= 1 && octile <= 8);
  233|  93.9k|  const int middle_index = octile * SUBBLOCKS_IN_OCTILE - 1;
  ------------------
  |  |  190|  93.9k|#define SUBBLOCKS_IN_OCTILE (SUBBLOCKS_IN_SB / 8)
  |  |  ------------------
  |  |  |  |  189|  93.9k|#define SUBBLOCKS_IN_SB (SUBBLOCKS_IN_SB_DIM * SUBBLOCKS_IN_SB_DIM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  93.9k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  93.9k|#define SUPERBLOCK_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  93.9k|#define SUBBLOCK_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define SUBBLOCKS_IN_SB (SUBBLOCKS_IN_SB_DIM * SUBBLOCKS_IN_SB_DIM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  93.9k|#define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  93.9k|#define SUPERBLOCK_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define SUBBLOCKS_IN_SB_DIM (SUPERBLOCK_SIZE / SUBBLOCK_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  93.9k|#define SUBBLOCK_SIZE 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  93.9k|  const int lower_index =
  235|  93.9k|      AOMMAX(SUBBLOCKS_IN_OCTILE - 1, middle_index - SUBBLOCKS_IN_OCTILE);
  ------------------
  |  |   35|  93.9k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [Folded, False: 93.9k]
  |  |  ------------------
  ------------------
  236|  93.9k|  const int upper_index =
  237|  93.9k|      AOMMIN(SUBBLOCKS_IN_SB - 1, middle_index + SUBBLOCKS_IN_OCTILE);
  ------------------
  |  |   34|  93.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [Folded, False: 93.9k]
  |  |  ------------------
  ------------------
  238|       |
  239|       |  // Weigh the three variances in a 1:2:1 ratio, with rounding (the +2 term).
  240|       |  // This allows for smoother delta-q transitions among superblocks with
  241|       |  // mixed-variance features.
  242|  93.9k|  const unsigned int variance =
  243|  93.9k|      (variances[lower_index] + (variances[middle_index] * 2) +
  244|  93.9k|       variances[upper_index] + 2) /
  245|  93.9k|      4;
  246|       |
  247|  93.9k|  return variance;
  248|  93.9k|}
aq_variance.c:comp_unsigned_int:
  177|  26.9M|static int comp_unsigned_int(const void *a, const void *b) {
  178|  26.9M|  unsigned int arg1 = *(const unsigned int *)a;
  179|  26.9M|  unsigned int arg2 = *(const unsigned int *)b;
  180|       |
  181|  26.9M|  return (arg1 > arg2) - (arg1 < arg2);
  182|  26.9M|}

av1_extrc_init:
   15|  18.4k|aom_codec_err_t av1_extrc_init(AOM_EXT_RATECTRL *ext_ratectrl) {
   16|  18.4k|  if (ext_ratectrl == NULL) {
  ------------------
  |  Branch (16:7): [True: 0, False: 18.4k]
  ------------------
   17|      0|    return AOM_CODEC_INVALID_PARAM;
   18|      0|  }
   19|  18.4k|  av1_zero(*ext_ratectrl);
  ------------------
  |  |   43|  18.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   20|  18.4k|  return AOM_CODEC_OK;
   21|  18.4k|}
av1_extrc_delete:
  182|  18.4k|aom_codec_err_t av1_extrc_delete(AOM_EXT_RATECTRL *ext_ratectrl) {
  183|  18.4k|  if (ext_ratectrl == NULL) {
  ------------------
  |  Branch (183:7): [True: 0, False: 18.4k]
  ------------------
  184|      0|    return AOM_CODEC_INVALID_PARAM;
  185|      0|  }
  186|  18.4k|  if (ext_ratectrl->ready) {
  ------------------
  |  Branch (186:7): [True: 0, False: 18.4k]
  ------------------
  187|      0|    aom_rc_status_t rc_status =
  188|      0|        ext_ratectrl->funcs.delete_model(ext_ratectrl->model);
  189|      0|    if (rc_status == AOM_RC_ERROR) {
  ------------------
  |  Branch (189:9): [True: 0, False: 0]
  ------------------
  190|      0|      return AOM_CODEC_ERROR;
  191|      0|    }
  192|      0|    aom_free(ext_ratectrl->rc_firstpass_stats.frame_stats);
  193|      0|    aom_free(ext_ratectrl->sb_params_list);
  194|      0|  }
  195|  18.4k|  return av1_extrc_init(ext_ratectrl);
  196|  18.4k|}

av1_noise_estimate_init:
   36|  81.7k|void av1_noise_estimate_init(NOISE_ESTIMATE *const ne, int width, int height) {
   37|  81.7k|  const int64_t area = (int64_t)width * height;
   38|  81.7k|  ne->enabled = 0;
   39|  81.7k|  ne->level = (area < 1280 * 720) ? kLowLow : kLow;
  ------------------
  |  Branch (39:15): [True: 81.7k, False: 0]
  ------------------
   40|  81.7k|  ne->value = 0;
   41|  81.7k|  ne->count = 0;
   42|  81.7k|  ne->thresh = 90;
   43|  81.7k|  ne->last_w = 0;
   44|  81.7k|  ne->last_h = 0;
   45|  81.7k|  if (area >= 1920 * 1080) {
  ------------------
  |  Branch (45:7): [True: 0, False: 81.7k]
  ------------------
   46|      0|    ne->thresh = 200;
   47|  81.7k|  } else if (area >= 1280 * 720) {
  ------------------
  |  Branch (47:14): [True: 0, False: 81.7k]
  ------------------
   48|      0|    ne->thresh = 140;
   49|  81.7k|  } else if (area >= 640 * 360) {
  ------------------
  |  Branch (49:14): [True: 0, False: 81.7k]
  ------------------
   50|      0|    ne->thresh = 115;
   51|      0|  }
   52|  81.7k|  ne->num_frames_estimate = 15;
   53|  81.7k|  ne->adapt_thresh = (3 * ne->thresh) >> 1;
   54|  81.7k|}

av1_quantize_fp_facade:
  271|  43.6M|                            const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
  272|  43.6M|  const qm_val_t *qm_ptr = qparam->qmatrix;
  273|  43.6M|  const qm_val_t *iqm_ptr = qparam->iqmatrix;
  274|  43.6M|  if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (274:7): [True: 25.9M, False: 17.7M]
  |  Branch (274:25): [True: 25.9M, False: 18.4E]
  ------------------
  275|  25.9M|    quantize_fp_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,
  276|  25.9M|                         p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr,
  277|  25.9M|                         dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  278|  25.9M|                         sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  279|  25.9M|  } else {
  280|  17.6M|    switch (qparam->log_scale) {
  281|  17.7M|      case 0:
  ------------------
  |  Branch (281:7): [True: 17.7M, False: 18.4E]
  ------------------
  282|  17.7M|        av1_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,
  283|  17.7M|                        p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr,
  284|  17.7M|                        dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  285|  17.7M|                        sc->iscan);
  286|  17.7M|        break;
  287|  71.6k|      case 1:
  ------------------
  |  Branch (287:7): [True: 71.6k, False: 17.6M]
  ------------------
  288|  71.6k|        av1_quantize_fp_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,
  289|  71.6k|                              p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr,
  290|  71.6k|                              dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  291|  71.6k|                              sc->iscan);
  292|  71.6k|        break;
  293|  4.69k|      case 2:
  ------------------
  |  Branch (293:7): [True: 4.69k, False: 17.6M]
  ------------------
  294|  4.69k|        av1_quantize_fp_64x64(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,
  295|  4.69k|                              p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr,
  296|  4.69k|                              dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  297|  4.69k|                              sc->iscan);
  298|  4.69k|        break;
  299|      0|      default: assert(0);
  ------------------
  |  Branch (299:7): [True: 0, False: 17.6M]
  ------------------
  300|  17.6M|    }
  301|  17.6M|  }
  302|  43.6M|}
av1_quantize_b_facade:
  307|  48.0M|                           const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
  308|  48.0M|  const qm_val_t *qm_ptr = qparam->qmatrix;
  309|  48.0M|  const qm_val_t *iqm_ptr = qparam->iqmatrix;
  310|  48.0M|#if !CONFIG_REALTIME_ONLY
  311|  48.0M|  if (qparam->use_quant_b_adapt) {
  ------------------
  |  Branch (311:7): [True: 0, False: 48.0M]
  ------------------
  312|       |    // TODO(sarahparker) These quantize_b optimizations need SIMD
  313|       |    // implementations
  314|      0|    if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (314:9): [True: 0, False: 0]
  |  Branch (314:27): [True: 0, False: 0]
  ------------------
  315|      0|      aom_quantize_b_adaptive_helper_c(
  316|      0|          coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  317|      0|          p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr,
  318|      0|          sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  319|      0|    } else {
  320|      0|      switch (qparam->log_scale) {
  321|      0|        case 0:
  ------------------
  |  Branch (321:9): [True: 0, False: 0]
  ------------------
  322|      0|          aom_quantize_b_adaptive(coeff_ptr, n_coeffs, p->zbin_QTX,
  323|      0|                                  p->round_QTX, p->quant_QTX,
  324|      0|                                  p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr,
  325|      0|                                  p->dequant_QTX, eob_ptr, sc->scan, sc->iscan);
  326|      0|          break;
  327|      0|        case 1:
  ------------------
  |  Branch (327:9): [True: 0, False: 0]
  ------------------
  328|      0|          aom_quantize_b_32x32_adaptive(
  ------------------
  |  | 4453|      0|#define aom_quantize_b_32x32_adaptive aom_quantize_b_32x32_adaptive_sse2
  ------------------
  329|      0|              coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  330|      0|              p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  331|      0|              eob_ptr, sc->scan, sc->iscan);
  332|      0|          break;
  333|      0|        case 2:
  ------------------
  |  Branch (333:9): [True: 0, False: 0]
  ------------------
  334|      0|          aom_quantize_b_64x64_adaptive(
  ------------------
  |  | 4462|      0|#define aom_quantize_b_64x64_adaptive aom_quantize_b_64x64_adaptive_sse2
  ------------------
  335|      0|              coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  336|      0|              p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  337|      0|              eob_ptr, sc->scan, sc->iscan);
  338|      0|          break;
  339|      0|        default: assert(0);
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|      0|      }
  341|      0|    }
  342|      0|    return;
  343|      0|  }
  344|  48.0M|#endif  // !CONFIG_REALTIME_ONLY
  345|       |
  346|  48.0M|  if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (346:7): [True: 33.6M, False: 14.4M]
  |  Branch (346:25): [True: 33.6M, False: 18.4E]
  ------------------
  347|  33.6M|    aom_quantize_b_helper_c(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,
  348|  33.6M|                            p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr,
  349|  33.6M|                            dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  350|  33.6M|                            sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  351|  33.6M|  } else {
  352|  14.4M|    switch (qparam->log_scale) {
  353|  14.4M|      case 0:
  ------------------
  |  Branch (353:7): [True: 14.4M, False: 21.3k]
  ------------------
  354|  14.4M|        aom_quantize_b(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,
  355|  14.4M|                       p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr,
  356|  14.4M|                       dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  357|  14.4M|                       sc->iscan);
  358|  14.4M|        break;
  359|  65.8k|      case 1:
  ------------------
  |  Branch (359:7): [True: 65.8k, False: 14.4M]
  ------------------
  360|  65.8k|        aom_quantize_b_32x32(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,
  361|  65.8k|                             p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr,
  362|  65.8k|                             dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  363|  65.8k|                             sc->iscan);
  364|  65.8k|        break;
  365|  10.6k|      case 2:
  ------------------
  |  Branch (365:7): [True: 10.6k, False: 14.4M]
  ------------------
  366|  10.6k|        aom_quantize_b_64x64(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,
  367|  10.6k|                             p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr,
  368|  10.6k|                             dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  369|  10.6k|                             sc->iscan);
  370|  10.6k|        break;
  371|      0|      default: assert(0);
  ------------------
  |  Branch (371:7): [True: 0, False: 14.4M]
  ------------------
  372|  14.4M|    }
  373|  14.4M|  }
  374|  48.0M|}
av1_highbd_quantize_fp_facade:
  430|  13.0M|                                   const QUANT_PARAM *qparam) {
  431|  13.0M|  const qm_val_t *qm_ptr = qparam->qmatrix;
  432|  13.0M|  const qm_val_t *iqm_ptr = qparam->iqmatrix;
  433|  13.0M|  if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (433:7): [True: 6.51M, False: 6.54M]
  |  Branch (433:25): [True: 6.51M, False: 18.4E]
  ------------------
  434|  6.51M|    highbd_quantize_fp_helper_c(
  435|  6.51M|        coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX,
  436|  6.51M|        p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr,
  437|  6.51M|        sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  438|  6.54M|  } else {
  439|  6.54M|    av1_highbd_quantize_fp(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_fp_QTX,
  440|  6.54M|                           p->quant_fp_QTX, p->quant_shift_QTX, qcoeff_ptr,
  441|  6.54M|                           dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  442|  6.54M|                           sc->iscan, qparam->log_scale);
  443|  6.54M|  }
  444|  13.0M|}
av1_highbd_quantize_b_facade:
  451|  28.5M|                                  const QUANT_PARAM *qparam) {
  452|  28.5M|  const qm_val_t *qm_ptr = qparam->qmatrix;
  453|  28.5M|  const qm_val_t *iqm_ptr = qparam->iqmatrix;
  454|  28.5M|#if !CONFIG_REALTIME_ONLY
  455|  28.5M|  if (qparam->use_quant_b_adapt) {
  ------------------
  |  Branch (455:7): [True: 0, False: 28.5M]
  ------------------
  456|      0|    if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (456:9): [True: 0, False: 0]
  |  Branch (456:27): [True: 0, False: 0]
  ------------------
  457|      0|      aom_highbd_quantize_b_adaptive_helper_c(
  458|      0|          coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  459|      0|          p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr,
  460|      0|          sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  461|      0|    } else {
  462|      0|      switch (qparam->log_scale) {
  463|      0|        case 0:
  ------------------
  |  Branch (463:9): [True: 0, False: 0]
  ------------------
  464|      0|          aom_highbd_quantize_b_adaptive(
  465|      0|              coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  466|      0|              p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  467|      0|              eob_ptr, sc->scan, sc->iscan);
  468|      0|          break;
  469|      0|        case 1:
  ------------------
  |  Branch (469:9): [True: 0, False: 0]
  ------------------
  470|      0|          aom_highbd_quantize_b_32x32_adaptive(
  471|      0|              coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  472|      0|              p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  473|      0|              eob_ptr, sc->scan, sc->iscan);
  474|      0|          break;
  475|      0|        case 2:
  ------------------
  |  Branch (475:9): [True: 0, False: 0]
  ------------------
  476|      0|          aom_highbd_quantize_b_64x64_adaptive(
  ------------------
  |  | 2918|      0|#define aom_highbd_quantize_b_64x64_adaptive aom_highbd_quantize_b_64x64_adaptive_sse2
  ------------------
  477|      0|              coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  478|      0|              p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  479|      0|              eob_ptr, sc->scan, sc->iscan);
  480|      0|          break;
  481|      0|        default: assert(0);
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  ------------------
  482|      0|      }
  483|      0|    }
  484|      0|    return;
  485|      0|  }
  486|  28.5M|#endif  // !CONFIG_REALTIME_ONLY
  487|       |
  488|  28.5M|  if (qm_ptr != NULL && iqm_ptr != NULL) {
  ------------------
  |  Branch (488:7): [True: 24.0M, False: 4.51M]
  |  Branch (488:25): [True: 24.0M, False: 18.4E]
  ------------------
  489|  24.0M|    aom_highbd_quantize_b_helper_c(
  490|  24.0M|        coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  491|  24.0M|        p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX, eob_ptr,
  492|  24.0M|        sc->scan, sc->iscan, qm_ptr, iqm_ptr, qparam->log_scale);
  493|  24.0M|  } else {
  494|  4.51M|    switch (qparam->log_scale) {
  495|  4.53M|      case 0:
  ------------------
  |  Branch (495:7): [True: 4.53M, False: 18.4E]
  ------------------
  496|  4.53M|        aom_highbd_quantize_b(coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX,
  497|  4.53M|                              p->quant_QTX, p->quant_shift_QTX, qcoeff_ptr,
  498|  4.53M|                              dqcoeff_ptr, p->dequant_QTX, eob_ptr, sc->scan,
  499|  4.53M|                              sc->iscan);
  500|  4.53M|        break;
  501|  12.9k|      case 1:
  ------------------
  |  Branch (501:7): [True: 12.9k, False: 4.50M]
  ------------------
  502|  12.9k|        aom_highbd_quantize_b_32x32(
  503|  12.9k|            coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  504|  12.9k|            p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  505|  12.9k|            eob_ptr, sc->scan, sc->iscan);
  506|  12.9k|        break;
  507|    908|      case 2:
  ------------------
  |  Branch (507:7): [True: 908, False: 4.51M]
  ------------------
  508|    908|        aom_highbd_quantize_b_64x64(
  509|    908|            coeff_ptr, n_coeffs, p->zbin_QTX, p->round_QTX, p->quant_QTX,
  510|    908|            p->quant_shift_QTX, qcoeff_ptr, dqcoeff_ptr, p->dequant_QTX,
  511|    908|            eob_ptr, sc->scan, sc->iscan);
  512|    908|        break;
  513|      0|      default: assert(0);
  ------------------
  |  Branch (513:7): [True: 0, False: 4.51M]
  ------------------
  514|  4.51M|    }
  515|  4.51M|  }
  516|  28.5M|}
av1_build_quantizer:
  607|  32.7k|                         Dequants *const deq, int sharpness) {
  608|  32.7k|  int i, q, quant_QTX;
  609|  32.7k|  const int sharpness_adjustment = 16 * (7 - sharpness) / 7;
  610|       |
  611|  8.41M|  for (q = 0; q < QINDEX_RANGE; q++) {
  ------------------
  |  |   27|  8.41M|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  8.41M|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  8.41M|#define MINQ 0
  |  |  ------------------
  ------------------
  |  Branch (611:15): [True: 8.37M, False: 32.7k]
  ------------------
  612|  8.37M|    const int qzbin_factor = get_qzbin_factor(q, bit_depth);
  613|  8.37M|    int qrounding_factor = q == 0 ? 64 : 48;
  ------------------
  |  Branch (613:28): [True: 32.7k, False: 8.34M]
  ------------------
  614|       |
  615|  25.1M|    for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (615:17): [True: 16.7M, False: 8.37M]
  ------------------
  616|  16.7M|      int qrounding_factor_fp = 64;
  617|       |
  618|  16.7M|      if (sharpness != 0 && q != 0) {
  ------------------
  |  Branch (618:11): [True: 7.33M, False: 9.42M]
  |  Branch (618:29): [True: 7.30M, False: 28.6k]
  ------------------
  619|  7.30M|        qrounding_factor = 64 - sharpness_adjustment;
  620|  7.30M|        qrounding_factor_fp = 64 - sharpness_adjustment;
  621|  7.30M|      }
  622|       |
  623|       |      // y quantizer with TX scale
  624|  16.7M|      quant_QTX = i == 0 ? av1_dc_quant_QTX(q, y_dc_delta_q, bit_depth)
  ------------------
  |  Branch (624:19): [True: 8.37M, False: 8.37M]
  ------------------
  625|  16.7M|                         : av1_ac_quant_QTX(q, 0, bit_depth);
  626|  16.7M|      invert_quant(&quants->y_quant[q][i], &quants->y_quant_shift[q][i],
  627|  16.7M|                   quant_QTX);
  628|  16.7M|      quants->y_quant_fp[q][i] = (1 << 16) / quant_QTX;
  629|  16.7M|      quants->y_round_fp[q][i] = (qrounding_factor_fp * quant_QTX) >> 7;
  630|  16.7M|      quants->y_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant_QTX, 7);
  ------------------
  |  |   41|  16.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  631|  16.7M|      quants->y_round[q][i] = (qrounding_factor * quant_QTX) >> 7;
  632|  16.7M|      deq->y_dequant_QTX[q][i] = quant_QTX;
  633|       |
  634|       |      // u quantizer with TX scale
  635|  16.7M|      quant_QTX = i == 0 ? av1_dc_quant_QTX(q, u_dc_delta_q, bit_depth)
  ------------------
  |  Branch (635:19): [True: 8.37M, False: 8.37M]
  ------------------
  636|  16.7M|                         : av1_ac_quant_QTX(q, u_ac_delta_q, bit_depth);
  637|  16.7M|      invert_quant(&quants->u_quant[q][i], &quants->u_quant_shift[q][i],
  638|  16.7M|                   quant_QTX);
  639|  16.7M|      quants->u_quant_fp[q][i] = (1 << 16) / quant_QTX;
  640|  16.7M|      quants->u_round_fp[q][i] = (qrounding_factor_fp * quant_QTX) >> 7;
  641|  16.7M|      quants->u_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant_QTX, 7);
  ------------------
  |  |   41|  16.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  642|  16.7M|      quants->u_round[q][i] = (qrounding_factor * quant_QTX) >> 7;
  643|  16.7M|      deq->u_dequant_QTX[q][i] = quant_QTX;
  644|       |
  645|       |      // v quantizer with TX scale
  646|  16.7M|      quant_QTX = i == 0 ? av1_dc_quant_QTX(q, v_dc_delta_q, bit_depth)
  ------------------
  |  Branch (646:19): [True: 8.37M, False: 8.37M]
  ------------------
  647|  16.7M|                         : av1_ac_quant_QTX(q, v_ac_delta_q, bit_depth);
  648|  16.7M|      invert_quant(&quants->v_quant[q][i], &quants->v_quant_shift[q][i],
  649|  16.7M|                   quant_QTX);
  650|  16.7M|      quants->v_quant_fp[q][i] = (1 << 16) / quant_QTX;
  651|  16.7M|      quants->v_round_fp[q][i] = (qrounding_factor_fp * quant_QTX) >> 7;
  652|  16.7M|      quants->v_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant_QTX, 7);
  ------------------
  |  |   41|  16.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  653|  16.7M|      quants->v_round[q][i] = (qrounding_factor * quant_QTX) >> 7;
  654|  16.7M|      deq->v_dequant_QTX[q][i] = quant_QTX;
  655|  16.7M|    }
  656|       |
  657|  58.6M|    for (i = 2; i < 8; i++) {  // 8: SIMD width
  ------------------
  |  Branch (657:17): [True: 50.2M, False: 8.37M]
  ------------------
  658|  50.2M|      quants->y_quant[q][i] = quants->y_quant[q][1];
  659|  50.2M|      quants->y_quant_fp[q][i] = quants->y_quant_fp[q][1];
  660|  50.2M|      quants->y_round_fp[q][i] = quants->y_round_fp[q][1];
  661|  50.2M|      quants->y_quant_shift[q][i] = quants->y_quant_shift[q][1];
  662|  50.2M|      quants->y_zbin[q][i] = quants->y_zbin[q][1];
  663|  50.2M|      quants->y_round[q][i] = quants->y_round[q][1];
  664|  50.2M|      deq->y_dequant_QTX[q][i] = deq->y_dequant_QTX[q][1];
  665|       |
  666|  50.2M|      quants->u_quant[q][i] = quants->u_quant[q][1];
  667|  50.2M|      quants->u_quant_fp[q][i] = quants->u_quant_fp[q][1];
  668|  50.2M|      quants->u_round_fp[q][i] = quants->u_round_fp[q][1];
  669|  50.2M|      quants->u_quant_shift[q][i] = quants->u_quant_shift[q][1];
  670|  50.2M|      quants->u_zbin[q][i] = quants->u_zbin[q][1];
  671|  50.2M|      quants->u_round[q][i] = quants->u_round[q][1];
  672|  50.2M|      deq->u_dequant_QTX[q][i] = deq->u_dequant_QTX[q][1];
  673|       |
  674|  50.2M|      quants->v_quant[q][i] = quants->v_quant[q][1];
  675|  50.2M|      quants->v_quant_fp[q][i] = quants->v_quant_fp[q][1];
  676|  50.2M|      quants->v_round_fp[q][i] = quants->v_round_fp[q][1];
  677|  50.2M|      quants->v_quant_shift[q][i] = quants->v_quant_shift[q][1];
  678|  50.2M|      quants->v_zbin[q][i] = quants->v_zbin[q][1];
  679|  50.2M|      quants->v_round[q][i] = quants->v_round[q][1];
  680|  50.2M|      deq->v_dequant_QTX[q][i] = deq->v_dequant_QTX[q][1];
  681|  50.2M|    }
  682|  8.37M|  }
  683|  32.7k|}
av1_init_quantizer:
  698|  92.0k|                        aom_bit_depth_t bit_depth, int sharpness) {
  699|  92.0k|  DeltaQuantParams *const prev_deltaq_params =
  700|  92.0k|      &enc_quant_dequant_params->prev_deltaq_params;
  701|  92.0k|  quant_params->sharpness = sharpness;
  702|       |
  703|       |  // Re-initialize the quantizer only if any of the dc/ac deltaq parameters
  704|       |  // change.
  705|  92.0k|  if (!deltaq_params_have_changed(prev_deltaq_params, quant_params)) return;
  ------------------
  |  Branch (705:7): [True: 59.3k, False: 32.7k]
  ------------------
  706|  32.7k|  QUANTS *const quants = &enc_quant_dequant_params->quants;
  707|  32.7k|  Dequants *const dequants = &enc_quant_dequant_params->dequants;
  708|  32.7k|  av1_build_quantizer(bit_depth, quant_params->y_dc_delta_q,
  709|  32.7k|                      quant_params->u_dc_delta_q, quant_params->u_ac_delta_q,
  710|  32.7k|                      quant_params->v_dc_delta_q, quant_params->v_ac_delta_q,
  711|  32.7k|                      quants, dequants, sharpness);
  712|       |
  713|       |  // Record the state of deltaq parameters.
  714|  32.7k|  prev_deltaq_params->y_dc_delta_q = quant_params->y_dc_delta_q;
  715|  32.7k|  prev_deltaq_params->u_dc_delta_q = quant_params->u_dc_delta_q;
  716|  32.7k|  prev_deltaq_params->v_dc_delta_q = quant_params->v_dc_delta_q;
  717|  32.7k|  prev_deltaq_params->u_ac_delta_q = quant_params->u_ac_delta_q;
  718|  32.7k|  prev_deltaq_params->v_ac_delta_q = quant_params->v_ac_delta_q;
  719|  32.7k|  prev_deltaq_params->sharpness = sharpness;
  720|  32.7k|}
av1_init_plane_quantizers:
  797|   167k|                               int segment_id, const int do_update) {
  798|   167k|  const AV1_COMMON *const cm = &cpi->common;
  799|   167k|  const CommonQuantParams *const quant_params = &cm->quant_params;
  800|   167k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  801|   167k|  const int boost_index = AOMMIN(15, (cpi->ppi->p_rc.gfu_boost / 100));
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 167k, False: 18.4E]
  |  |  ------------------
  ------------------
  802|   167k|  const int layer_depth = AOMMIN(gf_group->layer_depth[cpi->gf_frame_index], 6);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 167k, False: 18.4E]
  |  |  ------------------
  ------------------
  803|   167k|  const FRAME_TYPE frame_type = cm->current_frame.frame_type;
  804|   167k|  int qindex_rd;
  805|       |
  806|   167k|  const int current_qindex =
  807|   167k|      clamp(cm->delta_q_info.delta_q_present_flag
  ------------------
  |  Branch (807:13): [True: 146k, False: 21.2k]
  ------------------
  808|   167k|                ? quant_params->base_qindex + x->delta_qindex
  809|   167k|                : quant_params->base_qindex,
  810|   167k|            0, QINDEX_RANGE - 1);
  ------------------
  |  |   27|   167k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|   167k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|   167k|#define MINQ 0
  |  |  ------------------
  ------------------
  811|   167k|  const int qindex = av1_get_qindex(&cm->seg, segment_id, current_qindex);
  812|       |
  813|   167k|  if (cpi->oxcf.sb_qp_sweep) {
  ------------------
  |  Branch (813:7): [True: 0, False: 167k]
  ------------------
  814|      0|    const int current_rd_qindex =
  815|      0|        clamp(cm->delta_q_info.delta_q_present_flag
  ------------------
  |  Branch (815:15): [True: 0, False: 0]
  ------------------
  816|      0|                  ? quant_params->base_qindex + x->rdmult_delta_qindex
  817|      0|                  : quant_params->base_qindex,
  818|      0|              0, QINDEX_RANGE - 1);
  ------------------
  |  |   27|      0|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|      0|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|      0|#define MINQ 0
  |  |  ------------------
  ------------------
  819|      0|    qindex_rd = av1_get_qindex(&cm->seg, segment_id, current_rd_qindex);
  820|   167k|  } else {
  821|   167k|    if (cpi->cb_delta_rdmult_enabled) {
  ------------------
  |  Branch (821:9): [True: 146k, False: 21.2k]
  ------------------
  822|   146k|      const int current_rd_qindex =
  823|   146k|          clamp(quant_params->base_qindex + x->rdmult_delta_qindex, 0,
  824|   146k|                QINDEX_RANGE - 1);
  ------------------
  |  |   27|   146k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|   146k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|   146k|#define MINQ 0
  |  |  ------------------
  ------------------
  825|   146k|      qindex_rd = av1_get_qindex(&cm->seg, segment_id, current_rd_qindex);
  826|   146k|    } else {
  827|  21.2k|      qindex_rd = qindex;
  828|  21.2k|    }
  829|   167k|  }
  830|       |
  831|   167k|  const int qindex_rdmult = qindex_rd + quant_params->y_dc_delta_q;
  832|   167k|  const int rdmult = av1_compute_rd_mult(
  833|   167k|      qindex_rdmult, cm->seq_params->bit_depth,
  834|   167k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index], layer_depth,
  835|   167k|      boost_index, frame_type, cpi->oxcf.q_cfg.use_fixed_qp_offsets,
  836|   167k|      is_stat_consumption_stage(cpi), cpi->oxcf.tune_cfg.tuning,
  837|   167k|      cpi->oxcf.mode);
  838|       |
  839|   167k|  const int qindex_change = x->qindex != qindex;
  840|   167k|  if (qindex_change || do_update) {
  ------------------
  |  Branch (840:7): [True: 83.4k, False: 83.9k]
  |  Branch (840:24): [True: 24.2k, False: 59.6k]
  ------------------
  841|   107k|    set_q_index(&cpi->enc_quant_dequant_params, qindex, x);
  842|   107k|  }
  843|       |
  844|   167k|  MACROBLOCKD *const xd = &x->e_mbd;
  845|   167k|  if ((segment_id != x->prev_segment_id) ||
  ------------------
  |  Branch (845:7): [True: 73.5k, False: 93.8k]
  ------------------
  846|   167k|      av1_use_qmatrix(quant_params, xd, segment_id)) {
  ------------------
  |  Branch (846:7): [True: 93.8k, False: 0]
  ------------------
  847|   167k|    set_qmatrix(quant_params, segment_id, xd);
  848|   167k|  }
  849|       |
  850|   167k|  x->seg_skip_block = segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP);
  851|       |
  852|   167k|  av1_set_error_per_bit(&x->errorperbit, rdmult);
  853|   167k|  av1_set_sad_per_bit(cpi, &x->sadperbit, qindex_rd);
  854|       |
  855|   167k|  x->prev_segment_id = segment_id;
  856|   167k|}
av1_frame_init_quantizer:
  858|  73.6k|void av1_frame_init_quantizer(AV1_COMP *cpi) {
  859|  73.6k|  MACROBLOCK *const x = &cpi->td.mb;
  860|  73.6k|  MACROBLOCKD *const xd = &x->e_mbd;
  861|  73.6k|  x->prev_segment_id = -1;
  862|  73.6k|  av1_init_plane_quantizers(cpi, x, xd->mi[0]->segment_id, 1);
  863|  73.6k|}
av1_set_quantizer:
  887|  73.6k|                       bool is_allintra, aom_tune_metric tuning) {
  888|       |  // quantizer has to be reinitialized with av1_init_quantizer() if any
  889|       |  // delta_q changes.
  890|  73.6k|  CommonQuantParams *quant_params = &cm->quant_params;
  891|  73.6k|  quant_params->base_qindex = AOMMAX(cm->delta_q_info.delta_q_present_flag, q);
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1, False: 73.6k]
  |  |  ------------------
  ------------------
  892|  73.6k|  quant_params->y_dc_delta_q = 0;
  893|       |
  894|       |  // Disable deltaq in lossless mode.
  895|  73.6k|  if (enable_chroma_deltaq && q) {
  ------------------
  |  Branch (895:7): [True: 52.3k, False: 21.2k]
  |  Branch (895:31): [True: 52.1k, False: 199]
  ------------------
  896|  52.1k|    if (tuning == AOM_TUNE_IQ || tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (896:9): [True: 52.1k, False: 0]
  |  Branch (896:34): [True: 0, False: 0]
  ------------------
  897|  52.1k|      int chroma_dc_delta_q = 0;
  898|  52.1k|      int chroma_ac_delta_q = 0;
  899|       |
  900|  52.1k|      if (cm->seq_params->subsampling_x == 1 &&
  ------------------
  |  Branch (900:11): [True: 46.3k, False: 5.86k]
  ------------------
  901|  46.3k|          cm->seq_params->subsampling_y == 1) {
  ------------------
  |  Branch (901:11): [True: 39.3k, False: 6.99k]
  ------------------
  902|       |        // 4:2:0 subsampling: Constant chroma delta_q decrease (i.e. improved
  903|       |        // chroma quality relative to luma) with gradual ramp-down for very low
  904|       |        // qindexes.
  905|       |        // Lowering chroma delta_q by 16 was found to improve SSIMULACRA 2
  906|       |        // BD-Rate by 1.5-2% on Daala's subset1, as well as reducing chroma
  907|       |        // artifacts (smudging, discoloration) during subjective quality
  908|       |        // evaluations.
  909|       |        // The ramp-down of chroma increase was determined by generating the
  910|       |        // convex hull of SSIMULACRA 2 scores (for all boosts from 0-16), and
  911|       |        // finding a linear equation that fits the convex hull.
  912|       |        // For the SSIMULACRA 2 tune only: a convex hull of SSIMULACRA 2 scores
  913|       |        // (mean, 10th percentile) was generated by decreasing chroma delta_q
  914|       |        // by 3 different values (16, 20 and 24). 20 was selected as it had the
  915|       |        // best 10th percentile performance.
  916|  39.3k|        int offset = (tuning == AOM_TUNE_SSIMULACRA2) ? 20 : 16;
  ------------------
  |  Branch (916:22): [True: 0, False: 39.3k]
  ------------------
  917|  39.3k|        chroma_dc_delta_q =
  918|  39.3k|            -clamp((quant_params->base_qindex / 2) - 14, 0, offset);
  919|  39.3k|        chroma_ac_delta_q = chroma_dc_delta_q;
  920|  39.3k|      } else if (cm->seq_params->subsampling_x == 1 &&
  ------------------
  |  Branch (920:18): [True: 6.99k, False: 5.86k]
  ------------------
  921|  6.99k|                 cm->seq_params->subsampling_y == 0) {
  ------------------
  |  Branch (921:18): [True: 6.99k, False: 0]
  ------------------
  922|       |        // 4:2:2 subsampling: Constant chroma AC delta_q increase (i.e. improved
  923|       |        // luma quality relative to chroma) with gradual ramp-down for very low
  924|       |        // qindexes.
  925|       |        // SSIMULACRA 2 appears to have some issues correctly scoring 4:2:2
  926|       |        // material. Solely optimizing for maximum scores suggests a chroma AC
  927|       |        // delta_q of 12 is the most efficient. However, visual inspection on
  928|       |        // difficult-to-encode material resulted in chroma quality degrading too
  929|       |        // much relative to luma, and chroma channels ending up being too small
  930|       |        // compared to equivalent 4:4:4 or 4:2:0 encodes.
  931|       |        // A chroma AC delta_q of 6 was selected because encoded chroma channels
  932|       |        // have a much closer size to 4:4:4 and 4:2:0 encodes, and have more
  933|       |        // favorable visual quality characteristics.
  934|       |        // The ramp-down of chroma decrease was put into place to match 4:2:0
  935|       |        // and 4:4:4 behavior. There were no special considerations on
  936|       |        // SSIMULACRA 2 scores.
  937|  6.99k|        chroma_dc_delta_q = 0;
  938|  6.99k|        chroma_ac_delta_q = clamp((quant_params->base_qindex / 2), 0, 6);
  939|  6.99k|      } else if (cm->seq_params->subsampling_x == 0 &&
  ------------------
  |  Branch (939:18): [True: 5.86k, False: 0]
  ------------------
  940|  5.86k|                 cm->seq_params->subsampling_y == 0) {
  ------------------
  |  Branch (940:18): [True: 5.86k, False: 0]
  ------------------
  941|       |        // 4:4:4 subsampling: Constant chroma AC delta_q increase (i.e. improved
  942|       |        // luma quality relative to chroma) with gradual ramp-down for very low
  943|       |        // qindexes.
  944|       |        // Raising chroma AC delta_q by 24 was found to improve SSIMULACRA 2
  945|       |        // BD-Rate by 2.5-3% on Daala's subset1, as well as providing a more
  946|       |        // balanced bit allocation between the (relatively-starved) luma and
  947|       |        // chroma channels.
  948|       |        // Raising chroma DC delta_q appears to be harmful, both for SSIMULACRA
  949|       |        // 2 scores and subjective quality (harshens blocking artifacts).
  950|       |        // The ramp-down of chroma decrease was put into place so (lossy) QP 0
  951|       |        // encodes still score within 0.1 SSIMULACRA 2 points of the equivalent
  952|       |        // with no chroma delta_q (with a small efficiency improvement), while
  953|       |        // encodes in the SSIMULACRA 2 <=90 range yield full benefits from this
  954|       |        // adjustment.
  955|  5.86k|        chroma_dc_delta_q = 0;
  956|  5.86k|        chroma_ac_delta_q = clamp((quant_params->base_qindex / 2), 0, 24);
  957|  5.86k|      }
  958|       |
  959|       |      // TODO: bug https://crbug.com/aomedia/375221136 - find chroma_delta_q
  960|       |      // values for 4:2:2 subsampling mode.
  961|  52.1k|      quant_params->u_dc_delta_q = chroma_dc_delta_q;
  962|  52.1k|      quant_params->u_ac_delta_q = chroma_ac_delta_q;
  963|  52.1k|      quant_params->v_dc_delta_q = chroma_dc_delta_q;
  964|  52.1k|      quant_params->v_ac_delta_q = chroma_ac_delta_q;
  965|  52.1k|    } else {
  966|       |      // TODO(aomedia:2717): need to design better delta
  967|      0|      quant_params->u_dc_delta_q = 2;
  968|      0|      quant_params->u_ac_delta_q = 2;
  969|      0|      quant_params->v_dc_delta_q = 2;
  970|      0|      quant_params->v_ac_delta_q = 2;
  971|      0|    }
  972|  52.1k|  } else {
  973|  21.4k|    quant_params->u_dc_delta_q = 0;
  974|  21.4k|    quant_params->u_ac_delta_q = 0;
  975|  21.4k|    quant_params->v_dc_delta_q = 0;
  976|  21.4k|    quant_params->v_ac_delta_q = 0;
  977|  21.4k|  }
  978|       |
  979|       |  // following section 8.3.2 in T-REC-H.Sup15 document
  980|       |  // to apply to AV1 qindex in the range of [0, 255]
  981|  73.6k|  if (enable_hdr_deltaq && q) {
  ------------------
  |  Branch (981:7): [True: 0, False: 73.6k]
  |  Branch (981:28): [True: 0, False: 0]
  ------------------
  982|      0|    int dqpCb = adjust_hdr_cb_deltaq(quant_params->base_qindex);
  983|      0|    int dqpCr = adjust_hdr_cr_deltaq(quant_params->base_qindex);
  984|      0|    quant_params->u_dc_delta_q = quant_params->u_ac_delta_q = dqpCb;
  985|      0|    quant_params->v_dc_delta_q = quant_params->v_ac_delta_q = dqpCr;
  986|      0|    if (dqpCb != dqpCr) {
  ------------------
  |  Branch (986:9): [True: 0, False: 0]
  ------------------
  987|      0|      cm->seq_params->separate_uv_delta_q = 1;
  988|      0|    }
  989|      0|  }
  990|       |
  991|       |  // Select the best luma and chroma QM formulas based on encoding mode and
  992|       |  // tuning
  993|  73.6k|  int (*get_luma_qmlevel)(int, int, int);
  994|  73.6k|  int (*get_chroma_qmlevel)(int, int, int);
  995|       |
  996|  73.6k|  if (tuning == AOM_TUNE_IQ || tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (996:7): [True: 52.3k, False: 21.2k]
  |  Branch (996:32): [True: 0, False: 21.2k]
  ------------------
  997|  52.3k|    if (tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (997:9): [True: 0, False: 52.3k]
  ------------------
  998|       |      // Use luma QM formula specifically tailored for tune SSIMULACRA2
  999|      0|      get_luma_qmlevel = aom_get_qmlevel_luma_ssimulacra2;
 1000|  52.3k|    } else {
 1001|  52.3k|      get_luma_qmlevel = aom_get_qmlevel_allintra;
 1002|  52.3k|    }
 1003|       |
 1004|  52.3k|    if (cm->seq_params->subsampling_x == 0 &&
  ------------------
  |  Branch (1004:9): [True: 5.88k, False: 46.4k]
  ------------------
 1005|  5.88k|        cm->seq_params->subsampling_y == 0) {
  ------------------
  |  Branch (1005:9): [True: 5.88k, False: 0]
  ------------------
 1006|       |      // 4:4:4 subsampling mode has 4x the number of chroma coefficients
 1007|       |      // compared to 4:2:0 (2x on each dimension). This means the encoder
 1008|       |      // should use lower chroma QM levels that more closely match the scaling
 1009|       |      // of an equivalent 4:2:0 chroma QM.
 1010|  5.88k|      get_chroma_qmlevel = aom_get_qmlevel_444_chroma;
 1011|  46.4k|    } else {
 1012|       |      // For all other chroma subsampling modes, use the all intra QM formula
 1013|  46.4k|      get_chroma_qmlevel = aom_get_qmlevel_allintra;
 1014|  46.4k|    }
 1015|  52.3k|  } else if (is_allintra) {
  ------------------
  |  Branch (1015:14): [True: 0, False: 21.2k]
  ------------------
 1016|      0|    get_luma_qmlevel = aom_get_qmlevel_allintra;
 1017|      0|    get_chroma_qmlevel = aom_get_qmlevel_allintra;
 1018|  21.2k|  } else {
 1019|  21.2k|    get_luma_qmlevel = aom_get_qmlevel;
 1020|  21.2k|    get_chroma_qmlevel = aom_get_qmlevel;
 1021|  21.2k|  }
 1022|       |
 1023|  73.6k|  quant_params->qmatrix_level_y =
 1024|  73.6k|      get_luma_qmlevel(quant_params->base_qindex, min_qmlevel, max_qmlevel);
 1025|  73.6k|  quant_params->qmatrix_level_u =
 1026|  73.6k|      get_chroma_qmlevel(quant_params->base_qindex + quant_params->u_ac_delta_q,
 1027|  73.6k|                         min_qmlevel, max_qmlevel);
 1028|       |
 1029|  73.6k|  if (cm->seq_params->separate_uv_delta_q) {
  ------------------
  |  Branch (1029:7): [True: 0, False: 73.6k]
  ------------------
 1030|      0|    quant_params->qmatrix_level_v = get_chroma_qmlevel(
 1031|      0|        quant_params->base_qindex + quant_params->v_ac_delta_q, min_qmlevel,
 1032|      0|        max_qmlevel);
 1033|  73.6k|  } else {
 1034|  73.6k|    quant_params->qmatrix_level_v = quant_params->qmatrix_level_u;
 1035|  73.6k|  }
 1036|  73.6k|}
av1_quantizer_to_qindex:
 1048|   757k|int av1_quantizer_to_qindex(int quantizer) {
 1049|   757k|  return quantizer_to_qindex[quantizer];
 1050|   757k|}
av1_quantize.c:quantize_fp_helper_c:
   78|  25.9M|    const qm_val_t *iqm_ptr, int log_scale) {
   79|  25.9M|  int i, eob = -1;
   80|  25.9M|  const int rounding[2] = { ROUND_POWER_OF_TWO(round_ptr[0], log_scale),
  ------------------
  |  |   41|  25.9M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   81|  25.9M|                            ROUND_POWER_OF_TWO(round_ptr[1], log_scale) };
  ------------------
  |  |   41|  25.9M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   82|       |  // TODO(jingning) Decide the need of these arguments after the
   83|       |  // quantization process is completed.
   84|  25.9M|  (void)zbin_ptr;
   85|  25.9M|  (void)quant_shift_ptr;
   86|  25.9M|  (void)iscan;
   87|       |
   88|  25.9M|  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
   89|  25.9M|  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
   90|       |
   91|  25.9M|  if (qm_ptr == NULL && iqm_ptr == NULL) {
  ------------------
  |  Branch (91:7): [True: 0, False: 25.9M]
  |  Branch (91:25): [True: 0, False: 0]
  ------------------
   92|      0|    *eob_ptr = av1_quantize_fp_no_qmatrix(quant_ptr, dequant_ptr, round_ptr,
   93|      0|                                          log_scale, scan, (int)n_coeffs,
   94|      0|                                          coeff_ptr, qcoeff_ptr, dqcoeff_ptr);
   95|  25.9M|  } else {
   96|       |    // Quantization pass: All coefficients with index >= zero_flag are
   97|       |    // skippable. Note: zero_flag can be zero.
   98|   960M|    for (i = 0; i < n_coeffs; i++) {
  ------------------
  |  Branch (98:17): [True: 934M, False: 25.9M]
  ------------------
   99|   934M|      const int rc = scan[i];
  100|   934M|      const int coeff = coeff_ptr[rc];
  101|   934M|      const qm_val_t wt = qm_ptr ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|   735k|#define AOM_QM_BITS 5
  ------------------
  |  Branch (101:27): [True: 933M, False: 735k]
  ------------------
  102|   934M|      const qm_val_t iwt = iqm_ptr ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|   889k|#define AOM_QM_BITS 5
  ------------------
  |  Branch (102:28): [True: 933M, False: 889k]
  ------------------
  103|   934M|      const int dequant =
  104|   934M|          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
  ------------------
  |  |   62|   934M|#define AOM_QM_BITS 5
  ------------------
  105|   934M|          AOM_QM_BITS;
  ------------------
  |  |   62|   934M|#define AOM_QM_BITS 5
  ------------------
  106|   934M|      const int coeff_sign = AOMSIGN(coeff);
  ------------------
  |  |   36|   934M|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 451M, False: 483M]
  |  |  ------------------
  ------------------
  107|   934M|      int64_t abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
  108|   934M|      int tmp32 = 0;
  109|   934M|      if (abs_coeff * wt >=
  ------------------
  |  Branch (109:11): [True: 405M, False: 529M]
  ------------------
  110|   934M|          (dequant_ptr[rc != 0] << (AOM_QM_BITS - (1 + log_scale)))) {
  ------------------
  |  |   62|   934M|#define AOM_QM_BITS 5
  ------------------
  111|   405M|        abs_coeff += rounding[rc != 0];
  112|   405M|        abs_coeff = clamp64(abs_coeff, INT16_MIN, INT16_MAX);
  113|   405M|        tmp32 = (int)((abs_coeff * wt * quant_ptr[rc != 0]) >>
  114|   405M|                      (16 - log_scale + AOM_QM_BITS));
  ------------------
  |  |   62|   405M|#define AOM_QM_BITS 5
  ------------------
  115|   405M|        qcoeff_ptr[rc] = (tmp32 ^ coeff_sign) - coeff_sign;
  116|   405M|        const tran_low_t abs_dqcoeff = (tmp32 * dequant) >> log_scale;
  117|   405M|        dqcoeff_ptr[rc] = (abs_dqcoeff ^ coeff_sign) - coeff_sign;
  118|   405M|      }
  119|       |
  120|   934M|      if (tmp32) eob = i;
  ------------------
  |  Branch (120:11): [True: 372M, False: 562M]
  ------------------
  121|   934M|    }
  122|  25.9M|    *eob_ptr = eob + 1;
  123|  25.9M|  }
  124|  25.9M|}
av1_quantize.c:highbd_quantize_fp_helper_c:
  133|  6.51M|    const qm_val_t *iqm_ptr, int log_scale) {
  134|  6.51M|  int i;
  135|  6.51M|  int eob = -1;
  136|  6.51M|  const int shift = 16 - log_scale;
  137|       |  // TODO(jingning) Decide the need of these arguments after the
  138|       |  // quantization process is completed.
  139|  6.51M|  (void)zbin_ptr;
  140|  6.51M|  (void)quant_shift_ptr;
  141|  6.51M|  (void)iscan;
  142|       |
  143|  6.51M|  if (qm_ptr || iqm_ptr) {
  ------------------
  |  Branch (143:7): [True: 6.51M, False: 0]
  |  Branch (143:17): [True: 0, False: 0]
  ------------------
  144|       |    // Quantization pass: All coefficients with index >= zero_flag are
  145|       |    // skippable. Note: zero_flag can be zero.
  146|   197M|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (146:17): [True: 190M, False: 6.51M]
  ------------------
  147|   190M|      const int rc = scan[i];
  148|   190M|      const int coeff = coeff_ptr[rc];
  149|  18.4E|      const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (149:27): [True: 190M, False: 18.4E]
  ------------------
  150|  18.4E|      const qm_val_t iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
  ------------------
  |  |   62|  18.4E|#define AOM_QM_BITS 5
  ------------------
  |  Branch (150:28): [True: 190M, False: 18.4E]
  ------------------
  151|   190M|      const int dequant =
  152|   190M|          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
  ------------------
  |  |   62|   190M|#define AOM_QM_BITS 5
  ------------------
  153|   190M|          AOM_QM_BITS;
  ------------------
  |  |   62|   190M|#define AOM_QM_BITS 5
  ------------------
  154|   190M|      const int coeff_sign = AOMSIGN(coeff);
  ------------------
  |  |   36|   190M|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 87.8M, False: 102M]
  |  |  ------------------
  ------------------
  155|   190M|      const int64_t abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
  156|   190M|      int abs_qcoeff = 0;
  157|   190M|      if (abs_coeff * wt >=
  ------------------
  |  Branch (157:11): [True: 87.3M, False: 103M]
  ------------------
  158|   190M|          (dequant_ptr[rc != 0] << (AOM_QM_BITS - (1 + log_scale)))) {
  ------------------
  |  |   62|   190M|#define AOM_QM_BITS 5
  ------------------
  159|  87.3M|        const int64_t tmp =
  160|  87.3M|            abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale);
  ------------------
  |  |   41|  87.3M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  161|  87.3M|        abs_qcoeff =
  162|  87.3M|            (int)((tmp * quant_ptr[rc != 0] * wt) >> (shift + AOM_QM_BITS));
  ------------------
  |  |   62|  87.3M|#define AOM_QM_BITS 5
  ------------------
  163|  87.3M|        qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
  164|  87.3M|        const tran_low_t abs_dqcoeff = (abs_qcoeff * dequant) >> log_scale;
  165|  87.3M|        dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
  166|  87.3M|        if (abs_qcoeff) eob = i;
  ------------------
  |  Branch (166:13): [True: 78.9M, False: 8.46M]
  ------------------
  167|   103M|      } else {
  168|   103M|        qcoeff_ptr[rc] = 0;
  169|   103M|        dqcoeff_ptr[rc] = 0;
  170|   103M|      }
  171|   190M|    }
  172|  18.4E|  } else {
  173|  18.4E|    const int log_scaled_round_arr[2] = {
  174|  18.4E|      ROUND_POWER_OF_TWO(round_ptr[0], log_scale),
  ------------------
  |  |   41|  18.4E|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  175|  18.4E|      ROUND_POWER_OF_TWO(round_ptr[1], log_scale),
  ------------------
  |  |   41|  18.4E|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  176|  18.4E|    };
  177|  18.4E|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (177:17): [True: 0, False: 18.4E]
  ------------------
  178|      0|      const int rc = scan[i];
  179|      0|      const int coeff = coeff_ptr[rc];
  180|      0|      const int rc01 = (rc != 0);
  181|      0|      const int coeff_sign = AOMSIGN(coeff);
  ------------------
  |  |   36|      0|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  182|      0|      const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
  183|      0|      const int log_scaled_round = log_scaled_round_arr[rc01];
  184|      0|      if ((abs_coeff << (1 + log_scale)) >= dequant_ptr[rc01]) {
  ------------------
  |  Branch (184:11): [True: 0, False: 0]
  ------------------
  185|      0|        const int quant = quant_ptr[rc01];
  186|      0|        const int dequant = dequant_ptr[rc01];
  187|      0|        const int64_t tmp = (int64_t)abs_coeff + log_scaled_round;
  188|      0|        const int abs_qcoeff = (int)((tmp * quant) >> shift);
  189|      0|        qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
  190|      0|        const tran_low_t abs_dqcoeff = (abs_qcoeff * dequant) >> log_scale;
  191|      0|        if (abs_qcoeff) eob = i;
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|      0|        dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
  193|      0|      } else {
  194|      0|        qcoeff_ptr[rc] = 0;
  195|      0|        dqcoeff_ptr[rc] = 0;
  196|      0|      }
  197|      0|    }
  198|  18.4E|  }
  199|  6.51M|  *eob_ptr = eob + 1;
  200|  6.51M|}
av1_quantize.c:get_qzbin_factor:
  592|  8.37M|static int get_qzbin_factor(int q, aom_bit_depth_t bit_depth) {
  593|  8.37M|  const int quant = av1_dc_quant_QTX(q, 0, bit_depth);
  594|  8.37M|  switch (bit_depth) {
  595|  6.04M|    case AOM_BITS_8: return q == 0 ? 64 : (quant < 148 ? 84 : 80);
  ------------------
  |  Branch (595:5): [True: 6.04M, False: 2.33M]
  |  Branch (595:29): [True: 23.6k, False: 6.02M]
  |  Branch (595:44): [True: 3.09M, False: 2.92M]
  ------------------
  596|  1.11M|    case AOM_BITS_10: return q == 0 ? 64 : (quant < 592 ? 84 : 80);
  ------------------
  |  Branch (596:5): [True: 1.11M, False: 7.25M]
  |  Branch (596:30): [True: 4.37k, False: 1.11M]
  |  Branch (596:45): [True: 572k, False: 541k]
  ------------------
  597|  1.21M|    case AOM_BITS_12: return q == 0 ? 64 : (quant < 2368 ? 84 : 80);
  ------------------
  |  Branch (597:5): [True: 1.21M, False: 7.16M]
  |  Branch (597:30): [True: 4.73k, False: 1.20M]
  |  Branch (597:45): [True: 625k, False: 582k]
  ------------------
  598|      0|    default:
  ------------------
  |  Branch (598:5): [True: 0, False: 8.37M]
  ------------------
  599|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  600|      0|      return -1;
  601|  8.37M|  }
  602|  8.37M|}
av1_quantize.c:invert_quant:
  582|  50.2M|static void invert_quant(int16_t *quant, int16_t *shift, int d) {
  583|  50.2M|  uint32_t t;
  584|  50.2M|  int l, m;
  585|  50.2M|  t = d;
  586|  50.2M|  l = get_msb(t);
  587|  50.2M|  m = 1 + (1 << (16 + l)) / d;
  588|  50.2M|  *quant = (int16_t)(m - (1 << 16));
  589|  50.2M|  *shift = 1 << (16 - l);
  590|  50.2M|}
av1_quantize.c:deltaq_params_have_changed:
  687|  92.0k|    const CommonQuantParams *quant_params) {
  688|  92.0k|  return (prev_deltaq_params->y_dc_delta_q != quant_params->y_dc_delta_q ||
  ------------------
  |  Branch (688:11): [True: 18.4k, False: 73.6k]
  ------------------
  689|  73.6k|          prev_deltaq_params->u_dc_delta_q != quant_params->u_dc_delta_q ||
  ------------------
  |  Branch (689:11): [True: 9.45k, False: 64.1k]
  ------------------
  690|  64.1k|          prev_deltaq_params->v_dc_delta_q != quant_params->v_dc_delta_q ||
  ------------------
  |  Branch (690:11): [True: 0, False: 64.1k]
  ------------------
  691|  64.1k|          prev_deltaq_params->u_ac_delta_q != quant_params->u_ac_delta_q ||
  ------------------
  |  Branch (691:11): [True: 3.37k, False: 60.7k]
  ------------------
  692|  60.7k|          prev_deltaq_params->v_ac_delta_q != quant_params->v_ac_delta_q ||
  ------------------
  |  Branch (692:11): [True: 0, False: 60.7k]
  ------------------
  693|  60.7k|          prev_deltaq_params->sharpness != quant_params->sharpness);
  ------------------
  |  Branch (693:11): [True: 1.49k, False: 59.3k]
  ------------------
  694|  92.0k|}
av1_quantize.c:set_q_index:
  733|   107k|                        int qindex, MACROBLOCK *x) {
  734|   107k|  const QUANTS *const quants = &enc_quant_dequant_params->quants;
  735|   107k|  const Dequants *const dequants = &enc_quant_dequant_params->dequants;
  736|   107k|  x->qindex = qindex;
  737|   107k|  x->seg_skip_block =
  738|   107k|      0;  // TODO(angiebird): Find a proper place to init this variable.
  739|       |
  740|       |  // Y
  741|   107k|  x->plane[0].quant_QTX = quants->y_quant[qindex];
  742|   107k|  x->plane[0].quant_fp_QTX = quants->y_quant_fp[qindex];
  743|   107k|  x->plane[0].round_fp_QTX = quants->y_round_fp[qindex];
  744|   107k|  x->plane[0].quant_shift_QTX = quants->y_quant_shift[qindex];
  745|   107k|  x->plane[0].zbin_QTX = quants->y_zbin[qindex];
  746|   107k|  x->plane[0].round_QTX = quants->y_round[qindex];
  747|   107k|  x->plane[0].dequant_QTX = dequants->y_dequant_QTX[qindex];
  748|       |
  749|       |  // U
  750|   107k|  x->plane[1].quant_QTX = quants->u_quant[qindex];
  751|   107k|  x->plane[1].quant_fp_QTX = quants->u_quant_fp[qindex];
  752|   107k|  x->plane[1].round_fp_QTX = quants->u_round_fp[qindex];
  753|   107k|  x->plane[1].quant_shift_QTX = quants->u_quant_shift[qindex];
  754|   107k|  x->plane[1].zbin_QTX = quants->u_zbin[qindex];
  755|   107k|  x->plane[1].round_QTX = quants->u_round[qindex];
  756|   107k|  x->plane[1].dequant_QTX = dequants->u_dequant_QTX[qindex];
  757|       |
  758|       |  // V
  759|   107k|  x->plane[2].quant_QTX = quants->v_quant[qindex];
  760|   107k|  x->plane[2].quant_fp_QTX = quants->v_quant_fp[qindex];
  761|   107k|  x->plane[2].round_fp_QTX = quants->v_round_fp[qindex];
  762|   107k|  x->plane[2].quant_shift_QTX = quants->v_quant_shift[qindex];
  763|   107k|  x->plane[2].zbin_QTX = quants->v_zbin[qindex];
  764|   107k|  x->plane[2].round_QTX = quants->v_round[qindex];
  765|   107k|  x->plane[2].dequant_QTX = dequants->v_dequant_QTX[qindex];
  766|   107k|}
av1_quantize.c:set_qmatrix:
  776|   167k|                        MACROBLOCKD *xd) {
  777|   167k|  const int use_qmatrix = av1_use_qmatrix(quant_params, xd, segment_id);
  778|   167k|  const int qmlevel_y =
  779|   167k|      use_qmatrix ? quant_params->qmatrix_level_y : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  21.4k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  21.4k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (779:7): [True: 146k, False: 21.4k]
  ------------------
  780|   167k|  const int qmlevel_u =
  781|   167k|      use_qmatrix ? quant_params->qmatrix_level_u : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  21.4k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  21.4k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (781:7): [True: 146k, False: 21.4k]
  ------------------
  782|   167k|  const int qmlevel_v =
  783|   167k|      use_qmatrix ? quant_params->qmatrix_level_v : NUM_QM_LEVELS - 1;
  ------------------
  |  |   31|  21.4k|#define NUM_QM_LEVELS (1 << QM_LEVEL_BITS)
  |  |  ------------------
  |  |  |  |   30|  21.4k|#define QM_LEVEL_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (783:7): [True: 146k, False: 21.4k]
  ------------------
  784|   167k|  const int qmlevel_ls[MAX_MB_PLANE] = { qmlevel_y, qmlevel_u, qmlevel_v };
  785|   669k|  for (int i = 0; i < MAX_MB_PLANE; ++i) {
  ------------------
  |  |   36|   669k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (785:19): [True: 501k, False: 167k]
  ------------------
  786|   501k|    const int qmlevel = qmlevel_ls[i];
  787|   501k|    memcpy(&xd->plane[i].seg_qmatrix[segment_id],
  788|   501k|           quant_params->gqmatrix[qmlevel][i],
  789|   501k|           sizeof(quant_params->gqmatrix[qmlevel][i]));
  790|   501k|    memcpy(&xd->plane[i].seg_iqmatrix[segment_id],
  791|   501k|           quant_params->giqmatrix[qmlevel][i],
  792|   501k|           sizeof(quant_params->giqmatrix[qmlevel][i]));
  793|   501k|  }
  794|   167k|}

av1_write_tx_type:
  811|  3.43M|                       TX_TYPE tx_type, TX_SIZE tx_size, aom_writer *w) {
  812|  3.43M|  MB_MODE_INFO *mbmi = xd->mi[0];
  813|  3.43M|  const FeatureFlags *const features = &cm->features;
  814|  3.43M|  const int is_inter = is_inter_block(mbmi);
  815|  3.43M|  if (get_ext_tx_types(tx_size, is_inter, features->reduced_tx_set_used) > 1 &&
  ------------------
  |  Branch (815:7): [True: 3.43M, False: 3.38k]
  ------------------
  816|  3.43M|      ((!cm->seg.enabled && cm->quant_params.base_qindex > 0) ||
  ------------------
  |  Branch (816:9): [True: 3.43M, False: 18.4E]
  |  Branch (816:29): [True: 3.06M, False: 361k]
  ------------------
  817|   361k|       (cm->seg.enabled && xd->qindex[mbmi->segment_id] > 0)) &&
  ------------------
  |  Branch (817:9): [True: 0, False: 361k]
  |  Branch (817:28): [True: 0, False: 0]
  ------------------
  818|  3.06M|      !mbmi->skip_txfm &&
  ------------------
  |  Branch (818:7): [True: 3.06M, False: 18.4E]
  ------------------
  819|  3.06M|      !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (819:7): [True: 3.06M, False: 1.35k]
  ------------------
  820|  3.06M|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  821|  3.06M|    const TX_SIZE square_tx_size = txsize_sqr_map[tx_size];
  822|  3.06M|    const TxSetType tx_set_type = av1_get_ext_tx_set_type(
  823|  3.06M|        tx_size, is_inter, features->reduced_tx_set_used);
  824|  3.06M|    const int eset =
  825|  3.06M|        get_ext_tx_set(tx_size, is_inter, features->reduced_tx_set_used);
  826|       |    // eset == 0 should correspond to a set with only DCT_DCT and there
  827|       |    // is no need to send the tx_type
  828|  3.06M|    assert(eset > 0);
  829|  3.06M|    assert(av1_ext_tx_used[tx_set_type][tx_type]);
  830|  3.06M|    if (is_inter) {
  ------------------
  |  Branch (830:9): [True: 689k, False: 2.37M]
  ------------------
  831|   689k|      aom_write_symbol(w, av1_ext_tx_ind[tx_set_type][tx_type],
  832|   689k|                       ec_ctx->inter_ext_tx_cdf[eset][square_tx_size],
  833|   689k|                       av1_num_ext_tx_set[tx_set_type]);
  834|  2.37M|    } else {
  835|  2.37M|      PREDICTION_MODE intra_dir;
  836|  2.37M|      if (mbmi->filter_intra_mode_info.use_filter_intra)
  ------------------
  |  Branch (836:11): [True: 982k, False: 1.39M]
  ------------------
  837|   982k|        intra_dir =
  838|   982k|            fimode_to_intradir[mbmi->filter_intra_mode_info.filter_intra_mode];
  839|  1.39M|      else
  840|  1.39M|        intra_dir = mbmi->mode;
  841|  2.37M|      aom_write_symbol(
  842|  2.37M|          w, av1_ext_tx_ind[tx_set_type][tx_type],
  843|  2.37M|          ec_ctx->intra_ext_tx_cdf[eset][square_tx_size][intra_dir],
  844|  2.37M|          av1_num_ext_tx_set[tx_set_type]);
  845|  2.37M|    }
  846|  3.06M|  }
  847|  3.43M|}
av1_write_obu_header:
 3391|   110k|                              uint8_t *const dst) {
 3392|   110k|  assert(IMPLIES(!has_nonzero_operating_point_idc, obu_extension == 0));
 3393|       |
 3394|   110k|  if (level_params->keep_level_stats &&
  ------------------
  |  Branch (3394:7): [True: 0, False: 110k]
  ------------------
 3395|      0|      (obu_type == OBU_FRAME || obu_type == OBU_FRAME_HEADER))
  ------------------
  |  Branch (3395:8): [True: 0, False: 0]
  |  Branch (3395:33): [True: 0, False: 0]
  ------------------
 3396|      0|    ++(*frame_header_count);
 3397|       |
 3398|   110k|  uint32_t size = 0;
 3399|       |
 3400|       |  // The AV1 spec draft version (as of git commit 5e04f)
 3401|       |  // has the following requirements on the OBU extension header:
 3402|       |  //
 3403|       |  // 6.4.1. General sequence header OBU semantics:
 3404|       |  //   If operating_point_idc[ op ] is not equal to 0 for any value of op from 0
 3405|       |  //   to operating_points_cnt_minus_1, it is a requirement of bitstream
 3406|       |  //   conformance that obu_extension_flag is equal to 1 for all layer-specific
 3407|       |  //   OBUs in the coded video sequence.
 3408|       |  //   (...)
 3409|       |  //   It is a requirement of bitstream conformance that if OperatingPointIdc
 3410|       |  //   is equal to 0, then obu_extension_flag is equal to 0 for all OBUs that
 3411|       |  //   follow this sequence header until the next sequence header.
 3412|       |  //
 3413|       |  // Set obu_extension_flag to satisfy these requirements.
 3414|   110k|  const int obu_extension_flag =
 3415|   110k|      has_nonzero_operating_point_idc && is_layer_specific_obu;
  ------------------
  |  Branch (3415:7): [True: 110k, False: 0]
  |  Branch (3415:42): [True: 73.6k, False: 36.8k]
  ------------------
 3416|   110k|  const int obu_has_size_field = 1;
 3417|       |
 3418|   110k|  dst[0] = ((int)obu_type << 3) | (obu_extension_flag << 2) |
 3419|   110k|           (obu_has_size_field << 1);
 3420|   110k|  size++;
 3421|       |
 3422|   110k|  if (obu_extension_flag) {
  ------------------
  |  Branch (3422:7): [True: 73.6k, False: 36.8k]
  ------------------
 3423|  73.6k|    dst[1] = obu_extension & 0xFF;
 3424|  73.6k|    size++;
 3425|  73.6k|  }
 3426|       |
 3427|   110k|  return size;
 3428|   110k|}
av1_write_uleb_obu_size:
 3431|  36.8k|                            size_t dest_size) {
 3432|  36.8k|  size_t coded_obu_size = 0;
 3433|       |
 3434|  36.8k|  if (aom_uleb_encode(obu_payload_size, dest_size, dest, &coded_obu_size) !=
  ------------------
  |  Branch (3434:7): [True: 0, False: 36.8k]
  ------------------
 3435|  36.8k|      0) {
 3436|      0|    return AOM_CODEC_ERROR;
 3437|      0|  }
 3438|  36.8k|  if (coded_obu_size != dest_size) {
  ------------------
  |  Branch (3438:7): [True: 0, False: 36.8k]
  ------------------
 3439|      0|    return AOM_CODEC_ERROR;
 3440|      0|  }
 3441|       |
 3442|  36.8k|  return AOM_CODEC_OK;
 3443|  36.8k|}
av1_write_sequence_header_obu:
 3504|  18.4k|                                       uint8_t *const dst, size_t dst_size) {
 3505|       |  // TODO: bug 42302568 - Use dst_size.
 3506|  18.4k|  (void)dst_size;
 3507|  18.4k|  struct aom_write_bit_buffer wb = { dst, 0 };
 3508|  18.4k|  uint32_t size = 0;
 3509|       |
 3510|  18.4k|  write_profile(seq_params->profile, &wb);
 3511|       |
 3512|       |  // Still picture or not
 3513|  18.4k|  aom_wb_write_bit(&wb, seq_params->still_picture);
 3514|  18.4k|  assert(IMPLIES(!seq_params->still_picture,
 3515|  18.4k|                 !seq_params->reduced_still_picture_hdr));
 3516|       |  // whether to use reduced still picture header
 3517|  18.4k|  aom_wb_write_bit(&wb, seq_params->reduced_still_picture_hdr);
 3518|       |
 3519|  18.4k|  if (seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (3519:7): [True: 0, False: 18.4k]
  ------------------
 3520|      0|    assert(seq_params->timing_info_present == 0);
 3521|      0|    assert(seq_params->decoder_model_info_present_flag == 0);
 3522|      0|    assert(seq_params->display_model_info_present_flag == 0);
 3523|      0|    write_bitstream_level(seq_params->seq_level_idx[0], &wb);
 3524|  18.4k|  } else {
 3525|  18.4k|    aom_wb_write_bit(
 3526|  18.4k|        &wb, seq_params->timing_info_present);  // timing info present flag
 3527|       |
 3528|  18.4k|    if (seq_params->timing_info_present) {
  ------------------
  |  Branch (3528:9): [True: 0, False: 18.4k]
  ------------------
 3529|       |      // timing_info
 3530|      0|      write_timing_info_header(&seq_params->timing_info, &wb);
 3531|      0|      aom_wb_write_bit(&wb, seq_params->decoder_model_info_present_flag);
 3532|      0|      if (seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (3532:11): [True: 0, False: 0]
  ------------------
 3533|      0|        write_decoder_model_info(&seq_params->decoder_model_info, &wb);
 3534|      0|      }
 3535|      0|    }
 3536|  18.4k|    aom_wb_write_bit(&wb, seq_params->display_model_info_present_flag);
 3537|  18.4k|    aom_wb_write_literal(&wb, seq_params->operating_points_cnt_minus_1,
 3538|  18.4k|                         OP_POINTS_CNT_MINUS_1_BITS);
  ------------------
  |  |   93|  18.4k|#define OP_POINTS_CNT_MINUS_1_BITS 5
  ------------------
 3539|  18.4k|    int i;
 3540|  92.0k|    for (i = 0; i < seq_params->operating_points_cnt_minus_1 + 1; i++) {
  ------------------
  |  Branch (3540:17): [True: 73.6k, False: 18.4k]
  ------------------
 3541|  73.6k|      aom_wb_write_literal(&wb, seq_params->operating_point_idc[i],
 3542|  73.6k|                           OP_POINTS_IDC_BITS);
  ------------------
  |  |   94|  73.6k|#define OP_POINTS_IDC_BITS 12
  ------------------
 3543|  73.6k|      write_bitstream_level(seq_params->seq_level_idx[i], &wb);
 3544|  73.6k|      if (seq_params->seq_level_idx[i] >= SEQ_LEVEL_4_0)
  ------------------
  |  Branch (3544:11): [True: 0, False: 73.6k]
  ------------------
 3545|      0|        aom_wb_write_bit(&wb, seq_params->tier[i]);
 3546|  73.6k|      if (seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (3546:11): [True: 0, False: 73.6k]
  ------------------
 3547|      0|        aom_wb_write_bit(
 3548|      0|            &wb, seq_params->op_params[i].decoder_model_param_present_flag);
 3549|      0|        if (seq_params->op_params[i].decoder_model_param_present_flag) {
  ------------------
  |  Branch (3549:13): [True: 0, False: 0]
  ------------------
 3550|      0|          write_dec_model_op_parameters(
 3551|      0|              &seq_params->op_params[i],
 3552|      0|              seq_params->decoder_model_info
 3553|      0|                  .encoder_decoder_buffer_delay_length,
 3554|      0|              &wb);
 3555|      0|        }
 3556|      0|      }
 3557|  73.6k|      if (seq_params->display_model_info_present_flag) {
  ------------------
  |  Branch (3557:11): [True: 0, False: 73.6k]
  ------------------
 3558|      0|        aom_wb_write_bit(
 3559|      0|            &wb, seq_params->op_params[i].display_model_param_present_flag);
 3560|      0|        if (seq_params->op_params[i].display_model_param_present_flag) {
  ------------------
  |  Branch (3560:13): [True: 0, False: 0]
  ------------------
 3561|      0|          assert(seq_params->op_params[i].initial_display_delay >= 1);
 3562|      0|          assert(seq_params->op_params[i].initial_display_delay <= 10);
 3563|      0|          aom_wb_write_literal(
 3564|      0|              &wb, seq_params->op_params[i].initial_display_delay - 1, 4);
 3565|      0|        }
 3566|      0|      }
 3567|  73.6k|    }
 3568|  18.4k|  }
 3569|  18.4k|  write_sequence_header(seq_params, &wb);
 3570|       |
 3571|  18.4k|  write_color_config(seq_params, &wb);
 3572|       |
 3573|  18.4k|  aom_wb_write_bit(&wb, seq_params->film_grain_params_present);
 3574|       |
 3575|  18.4k|  add_trailing_bits(&wb);
 3576|       |
 3577|  18.4k|  size = aom_wb_bytes_written(&wb);
 3578|  18.4k|  return size;
 3579|  18.4k|}
av1_write_obu_tg_tile_headers:
 3828|  73.6k|                                   const int tile_idx) {
 3829|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 3830|  73.6k|  const CommonTileParams *const tiles = &cm->tiles;
 3831|  73.6k|  int *const curr_tg_hdr_size = &pack_bs_params->curr_tg_hdr_size;
 3832|  73.6k|  const int tg_size =
 3833|  73.6k|      (tiles->rows * tiles->cols + cpi->num_tg - 1) / cpi->num_tg;
 3834|       |
 3835|       |  // Write Tile group, frame and OBU header
 3836|       |  // A new tile group begins at this tile.  Write the obu header and
 3837|       |  // tile group header
 3838|  73.6k|  const OBU_TYPE obu_type = (cpi->num_tg == 1) ? OBU_FRAME : OBU_TILE_GROUP;
  ------------------
  |  Branch (3838:29): [True: 73.6k, False: 0]
  ------------------
 3839|  73.6k|  *curr_tg_hdr_size = av1_write_obu_header(
 3840|  73.6k|      &cpi->ppi->level_params, &cpi->frame_header_count, obu_type,
 3841|  73.6k|      cm->seq_params->has_nonzero_operating_point_idc,
 3842|  73.6k|      /*is_layer_specific_obu=*/true, pack_bs_params->obu_extn_header,
 3843|  73.6k|      pack_bs_params->tile_data_curr);
 3844|  73.6k|  pack_bs_params->obu_header_size = *curr_tg_hdr_size;
 3845|       |
 3846|  73.6k|  if (cpi->num_tg == 1)
  ------------------
  |  Branch (3846:7): [True: 73.6k, False: 0]
  ------------------
 3847|  73.6k|    *curr_tg_hdr_size += write_frame_header_obu(
 3848|  73.6k|        cpi, xd, pack_bs_params->saved_wb,
 3849|  73.6k|        pack_bs_params->tile_data_curr + *curr_tg_hdr_size, 0);
 3850|  73.6k|  *curr_tg_hdr_size += write_tile_group_header(
 3851|  73.6k|      pack_bs_params->tile_data_curr + *curr_tg_hdr_size, tile_idx,
 3852|  73.6k|      AOMMIN(tile_idx + tg_size - 1, tiles->cols * tiles->rows - 1),
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 73.6k]
  |  |  ------------------
  ------------------
 3853|  73.6k|      (tiles->log2_rows + tiles->log2_cols), cpi->num_tg > 1);
 3854|  73.6k|  *pack_bs_params->total_size += *curr_tg_hdr_size;
 3855|  73.6k|}
av1_pack_tile_info:
 3860|   117k|                        PackBSParams *const pack_bs_params) {
 3861|   117k|  aom_writer mode_bc;
 3862|   117k|  AV1_COMMON *const cm = &cpi->common;
 3863|   117k|  int tile_row = pack_bs_params->tile_row;
 3864|   117k|  int tile_col = pack_bs_params->tile_col;
 3865|   117k|  uint32_t *const total_size = pack_bs_params->total_size;
 3866|   117k|  TileInfo tile_info;
 3867|   117k|  av1_tile_set_col(&tile_info, cm, tile_col);
 3868|   117k|  av1_tile_set_row(&tile_info, cm, tile_row);
 3869|   117k|  mode_bc.allow_update_cdf = 1;
 3870|   117k|  mode_bc.allow_update_cdf =
 3871|   117k|      mode_bc.allow_update_cdf && !cm->features.disable_cdf_update;
  ------------------
  |  Branch (3871:7): [True: 117k, False: 44]
  |  Branch (3871:35): [True: 117k, False: 18.4E]
  ------------------
 3872|       |
 3873|   117k|  unsigned int tile_size;
 3874|       |
 3875|   117k|  const int num_planes = av1_num_planes(cm);
 3876|   117k|  av1_reset_loop_restoration(&td->mb.e_mbd, num_planes);
 3877|       |
 3878|   117k|  pack_bs_params->buf.data = pack_bs_params->dst + *total_size;
 3879|       |
 3880|       |  // The last tile of the tile group does not have a tile_size_minus_1 header.
 3881|   117k|  if (!pack_bs_params->is_last_tile_in_tg) *total_size += 4;
  ------------------
  |  Branch (3881:7): [True: 43.9k, False: 73.6k]
  ------------------
 3882|       |
 3883|       |  // Pack tile data
 3884|   117k|  if (pack_bs_params->tile_buf_size <= *total_size) {
  ------------------
  |  Branch (3884:7): [True: 0, False: 117k]
  ------------------
 3885|      0|    aom_internal_error(td->mb.e_mbd.error_info, AOM_CODEC_ERROR,
 3886|      0|                       "Error writing modes");
 3887|      0|  }
 3888|   117k|  aom_start_encode(&mode_bc, pack_bs_params->dst + *total_size,
 3889|   117k|                   pack_bs_params->tile_buf_size - *total_size);
 3890|   117k|  write_modes(cpi, td, &tile_info, &mode_bc, tile_row, tile_col);
 3891|   117k|  if (aom_stop_encode(&mode_bc) < 0) {
  ------------------
  |  Branch (3891:7): [True: 0, False: 117k]
  ------------------
 3892|      0|    aom_internal_error(td->mb.e_mbd.error_info, AOM_CODEC_ERROR,
 3893|      0|                       "Error writing modes");
 3894|      0|  }
 3895|   117k|  tile_size = mode_bc.pos;
 3896|   117k|  assert(tile_size >= AV1_MIN_TILE_SIZE_BYTES);
 3897|       |
 3898|   117k|  pack_bs_params->buf.size = tile_size;
 3899|       |
 3900|       |  // Write tile size
 3901|   117k|  if (!pack_bs_params->is_last_tile_in_tg) {
  ------------------
  |  Branch (3901:7): [True: 44.0k, False: 73.6k]
  ------------------
 3902|       |    // size of this tile minus 1
 3903|  44.0k|    mem_put_le32(pack_bs_params->buf.data, tile_size - AV1_MIN_TILE_SIZE_BYTES);
  ------------------
  |  |  218|  44.0k|#define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32)
  |  |  ------------------
  |  |  |  |   51|  44.0k|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  44.0k|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  44.0k|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  mem_put_le32(pack_bs_params->buf.data, tile_size - AV1_MIN_TILE_SIZE_BYTES);
  ------------------
  |  |   55|  44.0k|#define AV1_MIN_TILE_SIZE_BYTES 1
  ------------------
 3904|  44.0k|  }
 3905|   117k|}
av1_write_last_tile_info:
 3912|  73.6k|    int *const is_first_tg, uint32_t obu_header_size, uint8_t obu_extn_header) {
 3913|       |  // write current tile group size
 3914|  73.6k|  const size_t obu_payload_size = *curr_tg_data_size - obu_header_size;
 3915|  73.6k|  const size_t length_field_size =
 3916|  73.6k|      obu_memmove_unsafe(obu_header_size, obu_payload_size, curr_tg_start);
 3917|  73.6k|  if (av1_write_uleb_obu_size_unsafe(
  ------------------
  |  Branch (3917:7): [True: 0, False: 73.6k]
  ------------------
 3918|  73.6k|          obu_payload_size, curr_tg_start + obu_header_size) != AOM_CODEC_OK) {
 3919|      0|    aom_internal_error(cpi->common.error, AOM_CODEC_ERROR,
 3920|      0|                       "av1_write_last_tile_info: output buffer full");
 3921|      0|  }
 3922|  73.6k|  *curr_tg_data_size += length_field_size;
 3923|  73.6k|  *total_size += (uint32_t)length_field_size;
 3924|  73.6k|  *tile_data_start += length_field_size;
 3925|  73.6k|  if (cpi->num_tg == 1) {
  ------------------
  |  Branch (3925:7): [True: 73.6k, False: 0]
  ------------------
 3926|       |    // if this tg is combined with the frame header then update saved
 3927|       |    // frame header base offset according to length field size
 3928|  73.6k|    saved_wb->bit_buffer += length_field_size;
 3929|  73.6k|  }
 3930|       |
 3931|  73.6k|  if (!(*is_first_tg) && cpi->common.features.error_resilient_mode) {
  ------------------
  |  Branch (3931:7): [True: 0, False: 73.6k]
  |  Branch (3931:26): [True: 0, False: 0]
  ------------------
 3932|       |    // Make room for a duplicate Frame Header OBU.
 3933|      0|    memmove(curr_tg_start + fh_info->total_length, curr_tg_start,
 3934|      0|            *curr_tg_data_size);
 3935|       |
 3936|       |    // Insert a copy of the Frame Header OBU.
 3937|      0|    memcpy(curr_tg_start, fh_info->frame_header, fh_info->total_length);
 3938|       |
 3939|       |    // Force context update tile to be the first tile in error
 3940|       |    // resilient mode as the duplicate frame headers will have
 3941|       |    // context_update_tile_id set to 0
 3942|      0|    *largest_tile_id = 0;
 3943|       |
 3944|       |    // Rewrite the OBU header to change the OBU type to Redundant Frame
 3945|       |    // Header.
 3946|      0|    av1_write_obu_header(
 3947|      0|        &cpi->ppi->level_params, &cpi->frame_header_count,
 3948|      0|        OBU_REDUNDANT_FRAME_HEADER,
 3949|      0|        cpi->common.seq_params->has_nonzero_operating_point_idc,
 3950|      0|        /*is_layer_specific_obu=*/true, obu_extn_header,
 3951|      0|        &curr_tg_start[fh_info->obu_header_byte_offset]);
 3952|       |
 3953|      0|    *curr_tg_data_size += fh_info->total_length;
 3954|      0|    *total_size += (uint32_t)fh_info->total_length;
 3955|      0|  }
 3956|  73.6k|  *is_first_tg = 0;
 3957|  73.6k|}
av1_reset_pack_bs_thread_data:
 3959|   102k|void av1_reset_pack_bs_thread_data(ThreadData *const td) {
 3960|   102k|  td->coefficient_size = 0;
 3961|   102k|  td->max_mv_magnitude = 0;
 3962|   102k|  av1_zero(td->interp_filter_selected);
  ------------------
  |  |   43|   102k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3963|   102k|}
av1_accumulate_pack_bs_thread_data:
 3966|   102k|                                        ThreadData const *td) {
 3967|   102k|  int do_max_mv_magnitude_update = 1;
 3968|   102k|  cpi->rc.coefficient_size += td->coefficient_size;
 3969|       |
 3970|       |  // Disable max_mv_magnitude update for parallel frames based on update flag.
 3971|   102k|  if (!cpi->do_frame_data_update) do_max_mv_magnitude_update = 0;
  ------------------
  |  Branch (3971:7): [True: 0, False: 102k]
  ------------------
 3972|       |
 3973|   102k|  if (cpi->sf.mv_sf.auto_mv_step_size && do_max_mv_magnitude_update)
  ------------------
  |  Branch (3973:7): [True: 102k, False: 0]
  |  Branch (3973:42): [True: 102k, False: 0]
  ------------------
 3974|   102k|    cpi->mv_search_params.max_mv_magnitude =
 3975|   102k|        AOMMAX(cpi->mv_search_params.max_mv_magnitude, td->max_mv_magnitude);
  ------------------
  |  |   35|   102k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 35.2k, False: 67.5k]
  |  |  ------------------
  ------------------
 3976|       |
 3977|   514k|  for (InterpFilter filter = EIGHTTAP_REGULAR; filter < SWITCHABLE; filter++)
  ------------------
  |  Branch (3977:48): [True: 411k, False: 102k]
  ------------------
 3978|   411k|    cpi->common.cur_frame->interp_filter_selected[filter] +=
 3979|   411k|        td->interp_filter_selected[filter];
 3980|   102k|}
av1_pack_bitstream:
 4307|  73.6k|                       size_t *size, int *const largest_tile_id) {
 4308|  73.6k|  uint8_t *data = dst;
 4309|  73.6k|  size_t data_size = dst_size;
 4310|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4311|  73.6k|  AV1LevelParams *const level_params = &cpi->ppi->level_params;
 4312|  73.6k|  uint32_t obu_header_size = 0;
 4313|  73.6k|  uint32_t obu_payload_size = 0;
 4314|  73.6k|  FrameHeaderInfo fh_info = { NULL, 0, 0 };
 4315|  73.6k|  const uint8_t obu_extension_header =
 4316|  73.6k|      cm->temporal_layer_id << 5 | cm->spatial_layer_id << 3 | 0;
 4317|       |
 4318|       |  // If no non-zero delta_q has been used, reset delta_q_present_flag
 4319|  73.6k|  if (cm->delta_q_info.delta_q_present_flag && cpi->deltaq_used == 0) {
  ------------------
  |  Branch (4319:7): [True: 31.1k, False: 42.4k]
  |  Branch (4319:48): [True: 0, False: 31.1k]
  ------------------
 4320|      0|    cm->delta_q_info.delta_q_present_flag = 0;
 4321|      0|  }
 4322|       |
 4323|       |#if CONFIG_BITSTREAM_DEBUG
 4324|       |  bitstream_queue_reset_write();
 4325|       |#endif
 4326|       |
 4327|  73.6k|  cpi->frame_header_count = 0;
 4328|       |
 4329|       |  // The TD is now written outside the frame encode loop
 4330|       |
 4331|       |  // write sequence header obu at each key frame or intra_only frame,
 4332|       |  // preceded by 4-byte size
 4333|  73.6k|  if (cm->current_frame.frame_type == INTRA_ONLY_FRAME ||
  ------------------
  |  Branch (4333:7): [True: 0, False: 73.6k]
  ------------------
 4334|  73.6k|      cm->current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (4334:7): [True: 18.4k, False: 55.2k]
  ------------------
 4335|       |    // OBU header is either one or two bytes.
 4336|  18.4k|    if (data_size < 2) {
  ------------------
  |  Branch (4336:9): [True: 0, False: 18.4k]
  ------------------
 4337|      0|      return AOM_CODEC_ERROR;
 4338|      0|    }
 4339|  18.4k|    obu_header_size = av1_write_obu_header(
 4340|  18.4k|        level_params, &cpi->frame_header_count, OBU_SEQUENCE_HEADER,
 4341|  18.4k|        cm->seq_params->has_nonzero_operating_point_idc,
 4342|  18.4k|        /*is_layer_specific_obu=*/false, 0, data);
 4343|  18.4k|    assert(obu_header_size <= 2);
 4344|  18.4k|    obu_payload_size = av1_write_sequence_header_obu(
 4345|  18.4k|        cm->seq_params, data + obu_header_size, data_size - obu_header_size);
 4346|  18.4k|    const size_t length_field_size =
 4347|  18.4k|        obu_memmove(obu_header_size, obu_payload_size, data, data_size);
 4348|  18.4k|    if (length_field_size == 0) {
  ------------------
  |  Branch (4348:9): [True: 0, False: 18.4k]
  ------------------
 4349|      0|      return AOM_CODEC_ERROR;
 4350|      0|    }
 4351|  18.4k|    if (av1_write_uleb_obu_size(obu_payload_size, data + obu_header_size,
  ------------------
  |  Branch (4351:9): [True: 0, False: 18.4k]
  ------------------
 4352|  18.4k|                                length_field_size) != AOM_CODEC_OK) {
 4353|      0|      return AOM_CODEC_ERROR;
 4354|      0|    }
 4355|       |
 4356|  18.4k|    const size_t bytes_written =
 4357|  18.4k|        obu_header_size + length_field_size + obu_payload_size;
 4358|  18.4k|    data += bytes_written;
 4359|  18.4k|    data_size -= bytes_written;
 4360|  18.4k|  }
 4361|       |
 4362|       |  // write metadata obus before the frame obu that has the show_frame flag set
 4363|  73.6k|  if (cm->show_frame) {
  ------------------
  |  Branch (4363:7): [True: 73.6k, False: 0]
  ------------------
 4364|  73.6k|    const size_t bytes_written = av1_write_metadata_array(cpi, data, data_size);
 4365|  73.6k|    data += bytes_written;
 4366|  73.6k|    data_size -= bytes_written;
 4367|  73.6k|  }
 4368|       |
 4369|  73.6k|  const int write_frame_header =
 4370|  73.6k|      (cpi->num_tg > 1 || encode_show_existing_frame(cm));
  ------------------
  |  Branch (4370:8): [True: 0, False: 73.6k]
  |  Branch (4370:27): [True: 0, False: 73.6k]
  ------------------
 4371|  73.6k|  struct aom_write_bit_buffer saved_wb = { NULL, 0 };
 4372|  73.6k|  size_t length_field = 0;
 4373|  73.6k|  if (write_frame_header) {
  ------------------
  |  Branch (4373:7): [True: 0, False: 73.6k]
  ------------------
 4374|       |    // Write Frame Header OBU.
 4375|      0|    fh_info.frame_header = data;
 4376|       |    // OBU header is either one or two bytes.
 4377|      0|    if (data_size < 2) {
  ------------------
  |  Branch (4377:9): [True: 0, False: 0]
  ------------------
 4378|      0|      return AOM_CODEC_ERROR;
 4379|      0|    }
 4380|      0|    obu_header_size = av1_write_obu_header(
 4381|      0|        level_params, &cpi->frame_header_count, OBU_FRAME_HEADER,
 4382|      0|        cm->seq_params->has_nonzero_operating_point_idc,
 4383|      0|        /*is_layer_specific_obu=*/true, obu_extension_header, data);
 4384|       |    // TODO: bug 42302568 - Pass data_size - obu_header_size to
 4385|       |    // write_frame_header_obu().
 4386|      0|    obu_payload_size = write_frame_header_obu(cpi, &cpi->td.mb.e_mbd, &saved_wb,
 4387|      0|                                              data + obu_header_size, 1);
 4388|       |
 4389|      0|    length_field =
 4390|      0|        obu_memmove(obu_header_size, obu_payload_size, data, data_size);
 4391|      0|    if (length_field == 0) {
  ------------------
  |  Branch (4391:9): [True: 0, False: 0]
  ------------------
 4392|      0|      return AOM_CODEC_ERROR;
 4393|      0|    }
 4394|      0|    if (av1_write_uleb_obu_size(obu_payload_size, data + obu_header_size,
  ------------------
  |  Branch (4394:9): [True: 0, False: 0]
  ------------------
 4395|      0|                                length_field) != AOM_CODEC_OK) {
 4396|      0|      return AOM_CODEC_ERROR;
 4397|      0|    }
 4398|       |
 4399|      0|    fh_info.obu_header_byte_offset = 0;
 4400|      0|    fh_info.total_length = obu_header_size + length_field + obu_payload_size;
 4401|       |    // Make sure it is safe to cast fh_info.total_length to uint32_t.
 4402|      0|    if (fh_info.total_length > UINT32_MAX) {
  ------------------
  |  Branch (4402:9): [True: 0, False: 0]
  ------------------
 4403|      0|      return AOM_CODEC_ERROR;
 4404|      0|    }
 4405|      0|    data += fh_info.total_length;
 4406|      0|    data_size -= fh_info.total_length;
 4407|      0|  }
 4408|       |
 4409|  73.6k|  if (!encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (4409:7): [True: 73.6k, False: 0]
  ------------------
 4410|       |    // Since length_field is determined adaptively after frame header
 4411|       |    // encoding, saved_wb must be adjusted accordingly.
 4412|  73.6k|    if (saved_wb.bit_buffer != NULL) {
  ------------------
  |  Branch (4412:9): [True: 0, False: 73.6k]
  ------------------
 4413|      0|      saved_wb.bit_buffer += length_field;
 4414|      0|    }
 4415|       |
 4416|       |    //  Each tile group obu will be preceded by 4-byte size of the tile group
 4417|       |    //  obu
 4418|  73.6k|    const size_t bytes_written =
 4419|  73.6k|        write_tiles_in_tg_obus(cpi, data, data_size, &saved_wb,
 4420|  73.6k|                               obu_extension_header, &fh_info, largest_tile_id);
 4421|  73.6k|    data += bytes_written;
 4422|  73.6k|    data_size -= bytes_written;
 4423|  73.6k|  }
 4424|  73.6k|  *size = data - dst;
 4425|  73.6k|  (void)data_size;
 4426|  73.6k|  return AOM_CODEC_OK;
 4427|  73.6k|}
bitstream.c:write_profile:
 2418|  18.4k|                                 struct aom_write_bit_buffer *wb) {
 2419|  18.4k|  assert(profile >= PROFILE_0 && profile < MAX_PROFILES);
 2420|  18.4k|  aom_wb_write_literal(wb, profile, PROFILE_BITS);
  ------------------
  |  |   79|  18.4k|#define PROFILE_BITS 3
  ------------------
 2421|  18.4k|}
bitstream.c:write_bitstream_level:
 3498|  73.6k|                                         struct aom_write_bit_buffer *wb) {
 3499|  73.6k|  assert(is_valid_seq_level_idx(seq_level_idx));
 3500|  73.6k|  aom_wb_write_literal(wb, seq_level_idx, LEVEL_BITS);
  ------------------
  |  |  464|  73.6k|#define LEVEL_BITS 5
  ------------------
 3501|  73.6k|}
bitstream.c:write_sequence_header:
 2656|  18.4k|                                         struct aom_write_bit_buffer *wb) {
 2657|  18.4k|  aom_wb_write_literal(wb, seq_params->num_bits_width - 1, 4);
 2658|  18.4k|  aom_wb_write_literal(wb, seq_params->num_bits_height - 1, 4);
 2659|  18.4k|  aom_wb_write_literal(wb, seq_params->max_frame_width - 1,
 2660|  18.4k|                       seq_params->num_bits_width);
 2661|  18.4k|  aom_wb_write_literal(wb, seq_params->max_frame_height - 1,
 2662|  18.4k|                       seq_params->num_bits_height);
 2663|       |
 2664|  18.4k|  if (!seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (2664:7): [True: 18.4k, False: 0]
  ------------------
 2665|  18.4k|    aom_wb_write_bit(wb, seq_params->frame_id_numbers_present_flag);
 2666|  18.4k|    if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (2666:9): [True: 0, False: 18.4k]
  ------------------
 2667|       |      // We must always have delta_frame_id_length < frame_id_length,
 2668|       |      // in order for a frame to be referenced with a unique delta.
 2669|       |      // Avoid wasting bits by using a coding that enforces this restriction.
 2670|      0|      aom_wb_write_literal(wb, seq_params->delta_frame_id_length - 2, 4);
 2671|      0|      aom_wb_write_literal(
 2672|      0|          wb,
 2673|      0|          seq_params->frame_id_length - seq_params->delta_frame_id_length - 1,
 2674|      0|          3);
 2675|      0|    }
 2676|  18.4k|  }
 2677|       |
 2678|  18.4k|  write_sb_size(seq_params, wb);
 2679|       |
 2680|  18.4k|  aom_wb_write_bit(wb, seq_params->enable_filter_intra);
 2681|  18.4k|  aom_wb_write_bit(wb, seq_params->enable_intra_edge_filter);
 2682|       |
 2683|  18.4k|  if (!seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (2683:7): [True: 18.4k, False: 0]
  ------------------
 2684|  18.4k|    aom_wb_write_bit(wb, seq_params->enable_interintra_compound);
 2685|  18.4k|    aom_wb_write_bit(wb, seq_params->enable_masked_compound);
 2686|  18.4k|    aom_wb_write_bit(wb, seq_params->enable_warped_motion);
 2687|  18.4k|    aom_wb_write_bit(wb, seq_params->enable_dual_filter);
 2688|       |
 2689|  18.4k|    aom_wb_write_bit(wb, seq_params->order_hint_info.enable_order_hint);
 2690|       |
 2691|  18.4k|    if (seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (2691:9): [True: 18.4k, False: 0]
  ------------------
 2692|  18.4k|      aom_wb_write_bit(wb, seq_params->order_hint_info.enable_dist_wtd_comp);
 2693|  18.4k|      aom_wb_write_bit(wb, seq_params->order_hint_info.enable_ref_frame_mvs);
 2694|  18.4k|    }
 2695|  18.4k|    if (seq_params->force_screen_content_tools == 2) {
  ------------------
  |  Branch (2695:9): [True: 18.4k, False: 0]
  ------------------
 2696|  18.4k|      aom_wb_write_bit(wb, 1);
 2697|  18.4k|    } else {
 2698|      0|      aom_wb_write_bit(wb, 0);
 2699|      0|      aom_wb_write_bit(wb, seq_params->force_screen_content_tools);
 2700|      0|    }
 2701|  18.4k|    if (seq_params->force_screen_content_tools > 0) {
  ------------------
  |  Branch (2701:9): [True: 18.4k, False: 0]
  ------------------
 2702|  18.4k|      if (seq_params->force_integer_mv == 2) {
  ------------------
  |  Branch (2702:11): [True: 18.4k, False: 0]
  ------------------
 2703|  18.4k|        aom_wb_write_bit(wb, 1);
 2704|  18.4k|      } else {
 2705|      0|        aom_wb_write_bit(wb, 0);
 2706|      0|        aom_wb_write_bit(wb, seq_params->force_integer_mv);
 2707|      0|      }
 2708|  18.4k|    } else {
 2709|      0|      assert(seq_params->force_integer_mv == 2);
 2710|      0|    }
 2711|  18.4k|    if (seq_params->order_hint_info.enable_order_hint)
  ------------------
  |  Branch (2711:9): [True: 18.4k, False: 0]
  ------------------
 2712|  18.4k|      aom_wb_write_literal(
 2713|  18.4k|          wb, seq_params->order_hint_info.order_hint_bits_minus_1, 3);
 2714|  18.4k|  }
 2715|       |
 2716|  18.4k|  aom_wb_write_bit(wb, seq_params->enable_superres);
 2717|  18.4k|  aom_wb_write_bit(wb, seq_params->enable_cdef);
 2718|  18.4k|  aom_wb_write_bit(wb, seq_params->enable_restoration);
 2719|  18.4k|}
bitstream.c:write_sb_size:
 2645|  18.4k|                                 struct aom_write_bit_buffer *wb) {
 2646|  18.4k|  (void)seq_params;
 2647|  18.4k|  (void)wb;
 2648|  18.4k|  assert(seq_params->mib_size == mi_size_wide[seq_params->sb_size]);
 2649|  18.4k|  assert(seq_params->mib_size == 1 << seq_params->mib_size_log2);
 2650|  18.4k|  assert(seq_params->sb_size == BLOCK_128X128 ||
 2651|  18.4k|         seq_params->sb_size == BLOCK_64X64);
 2652|  18.4k|  aom_wb_write_bit(wb, seq_params->sb_size == BLOCK_128X128 ? 1 : 0);
  ------------------
  |  Branch (2652:24): [True: 0, False: 18.4k]
  ------------------
 2653|  18.4k|}
bitstream.c:write_color_config:
 2434|  18.4k|                                      struct aom_write_bit_buffer *wb) {
 2435|  18.4k|  write_bitdepth(seq_params, wb);
 2436|  18.4k|  const int is_monochrome = seq_params->monochrome;
 2437|       |  // monochrome bit
 2438|  18.4k|  if (seq_params->profile != PROFILE_1)
  ------------------
  |  Branch (2438:7): [True: 17.1k, False: 1.28k]
  ------------------
 2439|  17.1k|    aom_wb_write_bit(wb, is_monochrome);
 2440|  1.28k|  else
 2441|  18.4k|    assert(!is_monochrome);
 2442|  18.4k|  if (seq_params->color_primaries == AOM_CICP_CP_UNSPECIFIED &&
  ------------------
  |  Branch (2442:7): [True: 18.4k, False: 0]
  ------------------
 2443|  18.4k|      seq_params->transfer_characteristics == AOM_CICP_TC_UNSPECIFIED &&
  ------------------
  |  Branch (2443:7): [True: 18.4k, False: 0]
  ------------------
 2444|  18.4k|      seq_params->matrix_coefficients == AOM_CICP_MC_UNSPECIFIED) {
  ------------------
  |  Branch (2444:7): [True: 18.4k, False: 0]
  ------------------
 2445|  18.4k|    aom_wb_write_bit(wb, 0);  // No color description present
 2446|  18.4k|  } else {
 2447|      0|    aom_wb_write_bit(wb, 1);  // Color description present
 2448|      0|    aom_wb_write_literal(wb, seq_params->color_primaries, 8);
 2449|      0|    aom_wb_write_literal(wb, seq_params->transfer_characteristics, 8);
 2450|      0|    aom_wb_write_literal(wb, seq_params->matrix_coefficients, 8);
 2451|      0|  }
 2452|  18.4k|  if (is_monochrome) {
  ------------------
  |  Branch (2452:7): [True: 11.4k, False: 6.99k]
  ------------------
 2453|       |    // 0: [16, 235] (i.e. xvYCC), 1: [0, 255]
 2454|  11.4k|    aom_wb_write_bit(wb, seq_params->color_range);
 2455|  11.4k|    return;
 2456|  11.4k|  }
 2457|  6.99k|  if (seq_params->color_primaries == AOM_CICP_CP_BT_709 &&
  ------------------
  |  Branch (2457:7): [True: 0, False: 6.99k]
  ------------------
 2458|      0|      seq_params->transfer_characteristics == AOM_CICP_TC_SRGB &&
  ------------------
  |  Branch (2458:7): [True: 0, False: 0]
  ------------------
 2459|      0|      seq_params->matrix_coefficients == AOM_CICP_MC_IDENTITY) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|    assert(seq_params->subsampling_x == 0 && seq_params->subsampling_y == 0);
 2461|      0|    assert(seq_params->profile == PROFILE_1 ||
 2462|      0|           (seq_params->profile == PROFILE_2 &&
 2463|      0|            seq_params->bit_depth == AOM_BITS_12));
 2464|  6.99k|  } else {
 2465|       |    // 0: [16, 235] (i.e. xvYCC), 1: [0, 255]
 2466|  6.99k|    aom_wb_write_bit(wb, seq_params->color_range);
 2467|  6.99k|    if (seq_params->profile == PROFILE_0) {
  ------------------
  |  Branch (2467:9): [True: 2.87k, False: 4.12k]
  ------------------
 2468|       |      // 420 only
 2469|  2.87k|      assert(seq_params->subsampling_x == 1 && seq_params->subsampling_y == 1);
 2470|  4.12k|    } else if (seq_params->profile == PROFILE_1) {
  ------------------
  |  Branch (2470:16): [True: 1.28k, False: 2.83k]
  ------------------
 2471|       |      // 444 only
 2472|  1.28k|      assert(seq_params->subsampling_x == 0 && seq_params->subsampling_y == 0);
 2473|  2.83k|    } else if (seq_params->profile == PROFILE_2) {
  ------------------
  |  Branch (2473:16): [True: 2.83k, False: 0]
  ------------------
 2474|  2.83k|      if (seq_params->bit_depth == AOM_BITS_12) {
  ------------------
  |  Branch (2474:11): [True: 1.24k, False: 1.59k]
  ------------------
 2475|       |        // 420, 444 or 422
 2476|  1.24k|        aom_wb_write_bit(wb, seq_params->subsampling_x);
 2477|  1.24k|        if (seq_params->subsampling_x == 0) {
  ------------------
  |  Branch (2477:13): [True: 266, False: 978]
  ------------------
 2478|    266|          assert(seq_params->subsampling_y == 0 &&
 2479|    266|                 "4:4:0 subsampling not allowed in AV1");
 2480|    978|        } else {
 2481|    978|          aom_wb_write_bit(wb, seq_params->subsampling_y);
 2482|    978|        }
 2483|  1.59k|      } else {
 2484|       |        // 422 only
 2485|  1.59k|        assert(seq_params->subsampling_x == 1 &&
 2486|  1.59k|               seq_params->subsampling_y == 0);
 2487|  1.59k|      }
 2488|  2.83k|    }
 2489|  6.99k|    if (seq_params->matrix_coefficients == AOM_CICP_MC_IDENTITY) {
  ------------------
  |  Branch (2489:9): [True: 0, False: 6.99k]
  ------------------
 2490|      0|      assert(seq_params->subsampling_x == 0 && seq_params->subsampling_y == 0);
 2491|      0|    }
 2492|  6.99k|    if (seq_params->subsampling_x == 1 && seq_params->subsampling_y == 1) {
  ------------------
  |  Branch (2492:9): [True: 5.44k, False: 1.55k]
  |  Branch (2492:43): [True: 3.59k, False: 1.85k]
  ------------------
 2493|  3.59k|      aom_wb_write_literal(wb, seq_params->chroma_sample_position, 2);
 2494|  3.59k|    }
 2495|  6.99k|  }
 2496|  6.99k|  aom_wb_write_bit(wb, seq_params->separate_uv_delta_q);
 2497|  6.99k|}
bitstream.c:write_bitdepth:
 2424|  18.4k|                                  struct aom_write_bit_buffer *wb) {
 2425|       |  // Profile 0/1: [0] for 8 bit, [1]  10-bit
 2426|       |  // Profile   2: [0] for 8 bit, [10] 10-bit, [11] - 12-bit
 2427|  18.4k|  aom_wb_write_bit(wb, seq_params->bit_depth == AOM_BITS_8 ? 0 : 1);
  ------------------
  |  Branch (2427:24): [True: 13.2k, False: 5.12k]
  ------------------
 2428|  18.4k|  if (seq_params->profile == PROFILE_2 && seq_params->bit_depth != AOM_BITS_8) {
  ------------------
  |  Branch (2428:7): [True: 4.26k, False: 14.1k]
  |  Branch (2428:43): [True: 3.01k, False: 1.24k]
  ------------------
 2429|  3.01k|    aom_wb_write_bit(wb, seq_params->bit_depth == AOM_BITS_10 ? 0 : 1);
  ------------------
  |  Branch (2429:26): [True: 346, False: 2.66k]
  ------------------
 2430|  3.01k|  }
 2431|  18.4k|}
bitstream.c:add_trailing_bits:
 3488|  18.4k|static inline void add_trailing_bits(struct aom_write_bit_buffer *wb) {
 3489|  18.4k|  if (aom_wb_is_byte_aligned(wb)) {
  ------------------
  |  Branch (3489:7): [True: 3.18k, False: 15.2k]
  ------------------
 3490|  3.18k|    aom_wb_write_literal(wb, 0x80, 8);
 3491|  15.2k|  } else {
 3492|       |    // assumes that the other bits are already 0s
 3493|  15.2k|    aom_wb_write_bit(wb, 1);
 3494|  15.2k|  }
 3495|  18.4k|}
bitstream.c:write_frame_header_obu:
 3584|  73.6k|                                       int append_trailing_bits) {
 3585|  73.6k|  struct aom_write_bit_buffer wb = { dst, 0 };
 3586|  73.6k|  write_uncompressed_header_obu(cpi, xd, saved_wb, &wb);
 3587|  73.6k|  if (append_trailing_bits) add_trailing_bits(&wb);
  ------------------
  |  Branch (3587:7): [True: 0, False: 73.6k]
  ------------------
 3588|  73.6k|  return aom_wb_bytes_written(&wb);
 3589|  73.6k|}
bitstream.c:write_uncompressed_header_obu:
 2910|  73.6k|    struct aom_write_bit_buffer *wb) {
 2911|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 2912|  73.6k|  const SequenceHeader *const seq_params = cm->seq_params;
 2913|  73.6k|  const CommonQuantParams *quant_params = &cm->quant_params;
 2914|  73.6k|  CurrentFrame *const current_frame = &cm->current_frame;
 2915|  73.6k|  FeatureFlags *const features = &cm->features;
 2916|       |
 2917|  73.6k|  if (!cpi->sf.rt_sf.enable_ref_short_signaling ||
  ------------------
  |  Branch (2917:7): [True: 64.6k, False: 9.01k]
  ------------------
 2918|  9.01k|      !seq_params->order_hint_info.enable_order_hint ||
  ------------------
  |  Branch (2918:7): [True: 0, False: 9.01k]
  ------------------
 2919|  73.6k|      seq_params->order_hint_info.enable_ref_frame_mvs) {
  ------------------
  |  Branch (2919:7): [True: 9.01k, False: 0]
  ------------------
 2920|  73.6k|    current_frame->frame_refs_short_signaling = 0;
 2921|  73.6k|  } else {
 2922|      0|    current_frame->frame_refs_short_signaling = 1;
 2923|      0|  }
 2924|       |
 2925|  73.6k|  if (seq_params->still_picture) {
  ------------------
  |  Branch (2925:7): [True: 0, False: 73.6k]
  ------------------
 2926|      0|    assert(cm->show_existing_frame == 0);
 2927|      0|    assert(cm->show_frame == 1);
 2928|      0|    assert(current_frame->frame_type == KEY_FRAME);
 2929|      0|  }
 2930|  73.6k|  if (!seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (2930:7): [True: 73.6k, False: 0]
  ------------------
 2931|  73.6k|    if (encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (2931:9): [True: 0, False: 73.6k]
  ------------------
 2932|      0|      aom_wb_write_bit(wb, 1);  // show_existing_frame
 2933|      0|      aom_wb_write_literal(wb, cpi->existing_fb_idx_to_show, 3);
 2934|       |
 2935|      0|      if (seq_params->decoder_model_info_present_flag &&
  ------------------
  |  Branch (2935:11): [True: 0, False: 0]
  ------------------
 2936|      0|          seq_params->timing_info.equal_picture_interval == 0) {
  ------------------
  |  Branch (2936:11): [True: 0, False: 0]
  ------------------
 2937|      0|        write_tu_pts_info(cm, wb);
 2938|      0|      }
 2939|      0|      if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (2939:11): [True: 0, False: 0]
  ------------------
 2940|      0|        int frame_id_len = seq_params->frame_id_length;
 2941|      0|        int display_frame_id = cm->ref_frame_id[cpi->existing_fb_idx_to_show];
 2942|      0|        aom_wb_write_literal(wb, display_frame_id, frame_id_len);
 2943|      0|      }
 2944|      0|      return;
 2945|  73.6k|    } else {
 2946|  73.6k|      aom_wb_write_bit(wb, 0);  // show_existing_frame
 2947|  73.6k|    }
 2948|       |
 2949|  73.6k|    aom_wb_write_literal(wb, current_frame->frame_type, 2);
 2950|       |
 2951|  73.6k|    aom_wb_write_bit(wb, cm->show_frame);
 2952|  73.6k|    if (cm->show_frame) {
  ------------------
  |  Branch (2952:9): [True: 73.6k, False: 0]
  ------------------
 2953|  73.6k|      if (seq_params->decoder_model_info_present_flag &&
  ------------------
  |  Branch (2953:11): [True: 0, False: 73.6k]
  ------------------
 2954|      0|          seq_params->timing_info.equal_picture_interval == 0)
  ------------------
  |  Branch (2954:11): [True: 0, False: 0]
  ------------------
 2955|      0|        write_tu_pts_info(cm, wb);
 2956|  73.6k|    } else {
 2957|      0|      aom_wb_write_bit(wb, cm->showable_frame);
 2958|      0|    }
 2959|  73.6k|    if (frame_is_sframe(cm)) {
  ------------------
  |  Branch (2959:9): [True: 0, False: 73.6k]
  ------------------
 2960|      0|      assert(features->error_resilient_mode);
 2961|  73.6k|    } else if (!(current_frame->frame_type == KEY_FRAME && cm->show_frame)) {
  ------------------
  |  Branch (2961:18): [True: 18.4k, False: 55.2k]
  |  Branch (2961:60): [True: 18.4k, False: 0]
  ------------------
 2962|  55.2k|      aom_wb_write_bit(wb, features->error_resilient_mode);
 2963|  55.2k|    }
 2964|  73.6k|  }
 2965|  73.6k|  aom_wb_write_bit(wb, features->disable_cdf_update);
 2966|       |
 2967|  73.6k|  if (seq_params->force_screen_content_tools == 2) {
  ------------------
  |  Branch (2967:7): [True: 73.6k, False: 0]
  ------------------
 2968|  73.6k|    aom_wb_write_bit(wb, features->allow_screen_content_tools);
 2969|  73.6k|  } else {
 2970|      0|    assert(features->allow_screen_content_tools ==
 2971|      0|           seq_params->force_screen_content_tools);
 2972|      0|  }
 2973|       |
 2974|  73.6k|  if (features->allow_screen_content_tools) {
  ------------------
  |  Branch (2974:7): [True: 7.92k, False: 65.7k]
  ------------------
 2975|  7.92k|    if (seq_params->force_integer_mv == 2) {
  ------------------
  |  Branch (2975:9): [True: 7.92k, False: 0]
  ------------------
 2976|  7.92k|      aom_wb_write_bit(wb, features->cur_frame_force_integer_mv);
 2977|  7.92k|    } else {
 2978|      0|      assert(features->cur_frame_force_integer_mv ==
 2979|      0|             seq_params->force_integer_mv);
 2980|      0|    }
 2981|  65.7k|  } else {
 2982|  65.7k|    assert(features->cur_frame_force_integer_mv == 0);
 2983|  65.7k|  }
 2984|       |
 2985|  73.6k|  int frame_size_override_flag = 0;
 2986|       |
 2987|  73.6k|  if (!seq_params->reduced_still_picture_hdr) {
  ------------------
  |  Branch (2987:7): [True: 73.6k, False: 0]
  ------------------
 2988|  73.6k|    if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (2988:9): [True: 0, False: 73.6k]
  ------------------
 2989|      0|      int frame_id_len = seq_params->frame_id_length;
 2990|      0|      aom_wb_write_literal(wb, cm->current_frame_id, frame_id_len);
 2991|      0|    }
 2992|       |
 2993|  73.6k|    if (cm->superres_upscaled_width > seq_params->max_frame_width ||
  ------------------
  |  Branch (2993:9): [True: 0, False: 73.6k]
  ------------------
 2994|  73.6k|        cm->superres_upscaled_height > seq_params->max_frame_height) {
  ------------------
  |  Branch (2994:9): [True: 0, False: 73.6k]
  ------------------
 2995|      0|      aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM,
 2996|      0|                         "Frame dimensions are larger than the maximum values");
 2997|      0|    }
 2998|       |
 2999|  73.6k|    frame_size_override_flag =
 3000|  73.6k|        frame_is_sframe(cm)
  ------------------
  |  Branch (3000:9): [True: 0, False: 73.6k]
  ------------------
 3001|  73.6k|            ? 1
 3002|  73.6k|            : (cm->superres_upscaled_width != seq_params->max_frame_width ||
  ------------------
  |  Branch (3002:16): [True: 55.2k, False: 18.4k]
  ------------------
 3003|  18.4k|               cm->superres_upscaled_height != seq_params->max_frame_height);
  ------------------
  |  Branch (3003:16): [True: 0, False: 18.4k]
  ------------------
 3004|  73.6k|    if (!frame_is_sframe(cm)) aom_wb_write_bit(wb, frame_size_override_flag);
  ------------------
  |  Branch (3004:9): [True: 73.6k, False: 0]
  ------------------
 3005|       |
 3006|  73.6k|    if (seq_params->order_hint_info.enable_order_hint)
  ------------------
  |  Branch (3006:9): [True: 73.6k, False: 0]
  ------------------
 3007|  73.6k|      aom_wb_write_literal(
 3008|  73.6k|          wb, current_frame->order_hint,
 3009|  73.6k|          seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
 3010|       |
 3011|  73.6k|    if (!features->error_resilient_mode && !frame_is_intra_only(cm)) {
  ------------------
  |  Branch (3011:9): [True: 73.6k, False: 0]
  |  Branch (3011:44): [True: 55.2k, False: 18.4k]
  ------------------
 3012|  55.2k|      aom_wb_write_literal(wb, features->primary_ref_frame, PRIMARY_REF_BITS);
  ------------------
  |  |   65|  55.2k|#define PRIMARY_REF_BITS 3
  ------------------
 3013|  55.2k|    }
 3014|  73.6k|  }
 3015|       |
 3016|  73.6k|  if (seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (3016:7): [True: 0, False: 73.6k]
  ------------------
 3017|      0|    aom_wb_write_bit(wb, cpi->ppi->buffer_removal_time_present);
 3018|      0|    if (cpi->ppi->buffer_removal_time_present) {
  ------------------
  |  Branch (3018:9): [True: 0, False: 0]
  ------------------
 3019|      0|      for (int op_num = 0;
 3020|      0|           op_num < seq_params->operating_points_cnt_minus_1 + 1; op_num++) {
  ------------------
  |  Branch (3020:12): [True: 0, False: 0]
  ------------------
 3021|      0|        if (seq_params->op_params[op_num].decoder_model_param_present_flag) {
  ------------------
  |  Branch (3021:13): [True: 0, False: 0]
  ------------------
 3022|      0|          if (seq_params->operating_point_idc[op_num] == 0 ||
  ------------------
  |  Branch (3022:15): [True: 0, False: 0]
  ------------------
 3023|      0|              ((seq_params->operating_point_idc[op_num] >>
  ------------------
  |  Branch (3023:16): [True: 0, False: 0]
  ------------------
 3024|      0|                cm->temporal_layer_id) &
 3025|      0|                   0x1 &&
 3026|      0|               (seq_params->operating_point_idc[op_num] >>
  ------------------
  |  Branch (3026:16): [True: 0, False: 0]
  ------------------
 3027|      0|                (cm->spatial_layer_id + 8)) &
 3028|      0|                   0x1)) {
 3029|      0|            aom_wb_write_unsigned_literal(
 3030|      0|                wb, cm->buffer_removal_times[op_num],
 3031|      0|                seq_params->decoder_model_info.buffer_removal_time_length);
 3032|      0|            cm->buffer_removal_times[op_num]++;
 3033|      0|            if (cm->buffer_removal_times[op_num] == 0) {
  ------------------
  |  Branch (3033:17): [True: 0, False: 0]
  ------------------
 3034|      0|              aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM,
 3035|      0|                                 "buffer_removal_time overflowed");
 3036|      0|            }
 3037|      0|          }
 3038|      0|        }
 3039|      0|      }
 3040|      0|    }
 3041|      0|  }
 3042|       |
 3043|       |  // Shown keyframes and switch-frames automatically refreshes all reference
 3044|       |  // frames.  For all other frame types, we need to write refresh_frame_flags.
 3045|  73.6k|  if ((current_frame->frame_type == KEY_FRAME && !cm->show_frame) ||
  ------------------
  |  Branch (3045:8): [True: 18.4k, False: 55.2k]
  |  Branch (3045:50): [True: 0, False: 18.4k]
  ------------------
 3046|  73.6k|      current_frame->frame_type == INTER_FRAME ||
  ------------------
  |  Branch (3046:7): [True: 55.2k, False: 18.4k]
  ------------------
 3047|  18.4k|      current_frame->frame_type == INTRA_ONLY_FRAME)
  ------------------
  |  Branch (3047:7): [True: 0, False: 18.4k]
  ------------------
 3048|  55.2k|    aom_wb_write_literal(wb, current_frame->refresh_frame_flags, REF_FRAMES);
 3049|       |
 3050|  73.6k|  if (!frame_is_intra_only(cm) || current_frame->refresh_frame_flags != 0xff) {
  ------------------
  |  Branch (3050:7): [True: 55.2k, False: 18.4k]
  |  Branch (3050:35): [True: 0, False: 18.4k]
  ------------------
 3051|       |    // Write all ref frame order hints if error_resilient_mode == 1
 3052|  55.2k|    if (features->error_resilient_mode &&
  ------------------
  |  Branch (3052:9): [True: 0, False: 55.2k]
  ------------------
 3053|      0|        seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (3053:9): [True: 0, False: 0]
  ------------------
 3054|      0|      for (int ref_idx = 0; ref_idx < REF_FRAMES; ref_idx++) {
  ------------------
  |  Branch (3054:29): [True: 0, False: 0]
  ------------------
 3055|      0|        aom_wb_write_literal(
 3056|      0|            wb, cm->ref_frame_map[ref_idx]->order_hint,
 3057|      0|            seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
 3058|      0|      }
 3059|      0|    }
 3060|  55.2k|  }
 3061|       |
 3062|  73.6k|  if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (3062:7): [True: 18.4k, False: 55.2k]
  ------------------
 3063|  18.4k|    write_frame_size(cm, frame_size_override_flag, wb);
 3064|  18.4k|    assert(!av1_superres_scaled(cm) || !features->allow_intrabc);
 3065|  18.4k|    if (features->allow_screen_content_tools && !av1_superres_scaled(cm))
  ------------------
  |  Branch (3065:9): [True: 1.98k, False: 16.4k]
  |  Branch (3065:49): [True: 1.98k, False: 0]
  ------------------
 3066|  1.98k|      aom_wb_write_bit(wb, features->allow_intrabc);
 3067|  55.2k|  } else {
 3068|  55.2k|    if (current_frame->frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (3068:9): [True: 0, False: 55.2k]
  ------------------
 3069|      0|      write_frame_size(cm, frame_size_override_flag, wb);
 3070|      0|      assert(!av1_superres_scaled(cm) || !features->allow_intrabc);
 3071|      0|      if (features->allow_screen_content_tools && !av1_superres_scaled(cm))
  ------------------
  |  Branch (3071:11): [True: 0, False: 0]
  |  Branch (3071:51): [True: 0, False: 0]
  ------------------
 3072|      0|        aom_wb_write_bit(wb, features->allow_intrabc);
 3073|  55.2k|    } else if (current_frame->frame_type == INTER_FRAME ||
  ------------------
  |  Branch (3073:16): [True: 55.2k, False: 0]
  ------------------
 3074|  55.2k|               frame_is_sframe(cm)) {
  ------------------
  |  Branch (3074:16): [True: 0, False: 0]
  ------------------
 3075|  55.2k|      MV_REFERENCE_FRAME ref_frame;
 3076|       |
 3077|       |      // NOTE: Error resilient mode turns off frame_refs_short_signaling
 3078|       |      //       automatically.
 3079|  55.2k|#define FRAME_REFS_SHORT_SIGNALING 0
 3080|       |#if FRAME_REFS_SHORT_SIGNALING
 3081|       |      current_frame->frame_refs_short_signaling =
 3082|       |          seq_params->order_hint_info.enable_order_hint;
 3083|       |#endif  // FRAME_REFS_SHORT_SIGNALING
 3084|       |
 3085|  55.2k|      if (current_frame->frame_refs_short_signaling) {
  ------------------
  |  Branch (3085:11): [True: 0, False: 55.2k]
  ------------------
 3086|       |        //    In rtc case when cpi->sf.rt_sf.enable_ref_short_signaling is true,
 3087|       |        //    we turn on frame_refs_short_signaling when the current frame and
 3088|       |        //    golden frame are in the same order_hint group, and their relative
 3089|       |        //    distance is <= 64 (in order to be decodable).
 3090|       |
 3091|       |        //    For other cases, an example solution for encoder-side
 3092|       |        //    implementation on frame_refs_short_signaling is also provided in
 3093|       |        //    this function, where frame_refs_short_signaling is only turned on
 3094|       |        //    when the encoder side decision on ref frames is identical to that
 3095|       |        //    at the decoder side.
 3096|       |
 3097|      0|        current_frame->frame_refs_short_signaling =
 3098|      0|            check_frame_refs_short_signaling(
 3099|      0|                cm, cpi->sf.rt_sf.enable_ref_short_signaling);
 3100|      0|      }
 3101|       |
 3102|  55.2k|      if (seq_params->order_hint_info.enable_order_hint)
  ------------------
  |  Branch (3102:11): [True: 55.2k, False: 0]
  ------------------
 3103|  55.2k|        aom_wb_write_bit(wb, current_frame->frame_refs_short_signaling);
 3104|       |
 3105|  55.2k|      if (current_frame->frame_refs_short_signaling) {
  ------------------
  |  Branch (3105:11): [True: 0, False: 55.2k]
  ------------------
 3106|      0|        const int lst_ref = get_ref_frame_map_idx(cm, LAST_FRAME);
 3107|      0|        aom_wb_write_literal(wb, lst_ref, REF_FRAMES_LOG2);
  ------------------
  |  |  554|      0|#define REF_FRAMES_LOG2 3
  ------------------
 3108|       |
 3109|      0|        const int gld_ref = get_ref_frame_map_idx(cm, GOLDEN_FRAME);
 3110|      0|        aom_wb_write_literal(wb, gld_ref, REF_FRAMES_LOG2);
  ------------------
  |  |  554|      0|#define REF_FRAMES_LOG2 3
  ------------------
 3111|      0|      }
 3112|  55.2k|      int first_ref_map_idx = INVALID_IDX;
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 3113|  55.2k|      if (cpi->ppi->rtc_ref.set_ref_frame_config) {
  ------------------
  |  Branch (3113:11): [True: 0, False: 55.2k]
  ------------------
 3114|      0|        for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (3114:38): [True: 0, False: 0]
  ------------------
 3115|      0|          if (cpi->ppi->rtc_ref.reference[ref_frame - 1] == 1) {
  ------------------
  |  Branch (3115:15): [True: 0, False: 0]
  ------------------
 3116|      0|            first_ref_map_idx = cpi->ppi->rtc_ref.ref_idx[ref_frame - 1];
 3117|      0|            break;
 3118|      0|          }
 3119|      0|        }
 3120|      0|      }
 3121|   441k|      for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (3121:36): [True: 386k, False: 55.2k]
  ------------------
 3122|   386k|        assert(get_ref_frame_map_idx(cm, ref_frame) != INVALID_IDX);
 3123|   386k|        if (!current_frame->frame_refs_short_signaling) {
  ------------------
  |  Branch (3123:13): [True: 386k, False: 0]
  ------------------
 3124|   386k|          if (cpi->ppi->rtc_ref.set_ref_frame_config &&
  ------------------
  |  Branch (3124:15): [True: 0, False: 386k]
  ------------------
 3125|      0|              first_ref_map_idx != INVALID_IDX &&
  ------------------
  |  |   15|   386k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (3125:15): [True: 0, False: 0]
  ------------------
 3126|      0|              cpi->svc.number_spatial_layers == 1 &&
  ------------------
  |  Branch (3126:15): [True: 0, False: 0]
  ------------------
 3127|      0|              !seq_params->order_hint_info.enable_order_hint) {
  ------------------
  |  Branch (3127:15): [True: 0, False: 0]
  ------------------
 3128|       |            // For the usage of set_ref_frame_config:
 3129|       |            // for any reference not used set their ref_map_idx
 3130|       |            // to the first used reference.
 3131|      0|            const int map_idx = cpi->ppi->rtc_ref.reference[ref_frame - 1]
  ------------------
  |  Branch (3131:33): [True: 0, False: 0]
  ------------------
 3132|      0|                                    ? get_ref_frame_map_idx(cm, ref_frame)
 3133|      0|                                    : first_ref_map_idx;
 3134|      0|            aom_wb_write_literal(wb, map_idx, REF_FRAMES_LOG2);
  ------------------
  |  |  554|      0|#define REF_FRAMES_LOG2 3
  ------------------
 3135|   386k|          } else {
 3136|   386k|            aom_wb_write_literal(wb, get_ref_frame_map_idx(cm, ref_frame),
 3137|   386k|                                 REF_FRAMES_LOG2);
  ------------------
  |  |  554|   386k|#define REF_FRAMES_LOG2 3
  ------------------
 3138|   386k|          }
 3139|   386k|        }
 3140|   386k|        if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (3140:13): [True: 0, False: 386k]
  ------------------
 3141|      0|          int i = get_ref_frame_map_idx(cm, ref_frame);
 3142|      0|          int frame_id_len = seq_params->frame_id_length;
 3143|      0|          int diff_len = seq_params->delta_frame_id_length;
 3144|      0|          int delta_frame_id_minus_1 =
 3145|      0|              ((cm->current_frame_id - cm->ref_frame_id[i] +
 3146|      0|                (1 << frame_id_len)) %
 3147|      0|               (1 << frame_id_len)) -
 3148|      0|              1;
 3149|      0|          if (delta_frame_id_minus_1 < 0 ||
  ------------------
  |  Branch (3149:15): [True: 0, False: 0]
  ------------------
 3150|      0|              delta_frame_id_minus_1 >= (1 << diff_len)) {
  ------------------
  |  Branch (3150:15): [True: 0, False: 0]
  ------------------
 3151|      0|            aom_internal_error(cm->error, AOM_CODEC_ERROR,
 3152|      0|                               "Invalid delta_frame_id_minus_1");
 3153|      0|          }
 3154|      0|          aom_wb_write_literal(wb, delta_frame_id_minus_1, diff_len);
 3155|      0|        }
 3156|   386k|      }
 3157|       |
 3158|  55.2k|      if (!features->error_resilient_mode && frame_size_override_flag) {
  ------------------
  |  Branch (3158:11): [True: 55.2k, False: 0]
  |  Branch (3158:46): [True: 36.8k, False: 18.4k]
  ------------------
 3159|  36.8k|        write_frame_size_with_refs(cm, wb);
 3160|  36.8k|      } else {
 3161|  18.4k|        write_frame_size(cm, frame_size_override_flag, wb);
 3162|  18.4k|      }
 3163|       |
 3164|  55.2k|      if (!features->cur_frame_force_integer_mv)
  ------------------
  |  Branch (3164:11): [True: 55.2k, False: 0]
  ------------------
 3165|  55.2k|        aom_wb_write_bit(wb, features->allow_high_precision_mv);
 3166|  55.2k|      write_frame_interp_filter(features->interp_filter, wb);
 3167|  55.2k|      aom_wb_write_bit(wb, features->switchable_motion_mode);
 3168|  55.2k|      if (frame_might_allow_ref_frame_mvs(cm)) {
  ------------------
  |  Branch (3168:11): [True: 55.2k, False: 0]
  ------------------
 3169|  55.2k|        aom_wb_write_bit(wb, features->allow_ref_frame_mvs);
 3170|  55.2k|      } else {
 3171|      0|        assert(features->allow_ref_frame_mvs == 0);
 3172|      0|      }
 3173|  55.2k|    }
 3174|  55.2k|  }
 3175|       |
 3176|  73.6k|  const int might_bwd_adapt = !(seq_params->reduced_still_picture_hdr) &&
  ------------------
  |  Branch (3176:31): [True: 73.6k, False: 0]
  ------------------
 3177|  73.6k|                              !(features->disable_cdf_update);
  ------------------
  |  Branch (3177:31): [True: 73.6k, False: 0]
  ------------------
 3178|  73.6k|  if (cm->tiles.large_scale)
  ------------------
  |  Branch (3178:7): [True: 0, False: 73.6k]
  ------------------
 3179|  73.6k|    assert(features->refresh_frame_context == REFRESH_FRAME_CONTEXT_DISABLED);
 3180|       |
 3181|  73.6k|  if (might_bwd_adapt) {
  ------------------
  |  Branch (3181:7): [True: 73.6k, False: 0]
  ------------------
 3182|  73.6k|    aom_wb_write_bit(
 3183|  73.6k|        wb, features->refresh_frame_context == REFRESH_FRAME_CONTEXT_DISABLED);
 3184|  73.6k|  }
 3185|       |
 3186|  73.6k|  write_tile_info(cm, saved_wb, wb);
 3187|  73.6k|  encode_quantization(quant_params, av1_num_planes(cm),
 3188|  73.6k|                      cm->seq_params->separate_uv_delta_q, wb);
 3189|  73.6k|  encode_segmentation(cm, wb);
 3190|       |
 3191|  73.6k|  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
 3192|  73.6k|  if (delta_q_info->delta_q_present_flag) assert(quant_params->base_qindex > 0);
  ------------------
  |  Branch (3192:7): [True: 31.1k, False: 42.4k]
  ------------------
 3193|  73.6k|  if (quant_params->base_qindex > 0) {
  ------------------
  |  Branch (3193:7): [True: 70.2k, False: 3.40k]
  ------------------
 3194|  70.2k|    aom_wb_write_bit(wb, delta_q_info->delta_q_present_flag);
 3195|  70.2k|    if (delta_q_info->delta_q_present_flag) {
  ------------------
  |  Branch (3195:9): [True: 31.1k, False: 39.0k]
  ------------------
 3196|  31.1k|      aom_wb_write_literal(wb, get_msb(delta_q_info->delta_q_res), 2);
 3197|  31.1k|      xd->current_base_qindex = quant_params->base_qindex;
 3198|  31.1k|      if (features->allow_intrabc)
  ------------------
  |  Branch (3198:11): [True: 0, False: 31.1k]
  ------------------
 3199|  31.1k|        assert(delta_q_info->delta_lf_present_flag == 0);
 3200|  31.1k|      else
 3201|  31.1k|        aom_wb_write_bit(wb, delta_q_info->delta_lf_present_flag);
 3202|  31.1k|      if (delta_q_info->delta_lf_present_flag) {
  ------------------
  |  Branch (3202:11): [True: 0, False: 31.1k]
  ------------------
 3203|      0|        aom_wb_write_literal(wb, get_msb(delta_q_info->delta_lf_res), 2);
 3204|      0|        aom_wb_write_bit(wb, delta_q_info->delta_lf_multi);
 3205|      0|        av1_reset_loop_filter_delta(xd, av1_num_planes(cm));
 3206|      0|      }
 3207|  31.1k|    }
 3208|  70.2k|  }
 3209|       |
 3210|  73.6k|  if (features->all_lossless) {
  ------------------
  |  Branch (3210:7): [True: 3.40k, False: 70.2k]
  ------------------
 3211|  3.40k|    assert(!av1_superres_scaled(cm));
 3212|  70.2k|  } else {
 3213|  70.2k|    if (!features->coded_lossless) {
  ------------------
  |  Branch (3213:9): [True: 70.2k, False: 0]
  ------------------
 3214|  70.2k|      encode_loopfilter(cm, wb);
 3215|  70.2k|      encode_cdef(cm, wb);
 3216|  70.2k|    }
 3217|  70.2k|    encode_restoration_mode(cm, wb);
 3218|  70.2k|  }
 3219|       |
 3220|       |  // Write TX mode
 3221|  73.6k|  if (features->coded_lossless)
  ------------------
  |  Branch (3221:7): [True: 3.40k, False: 70.2k]
  ------------------
 3222|  73.6k|    assert(features->tx_mode == ONLY_4X4);
 3223|  70.2k|  else
 3224|  70.2k|    aom_wb_write_bit(wb, features->tx_mode == TX_MODE_SELECT);
 3225|       |
 3226|  73.6k|  if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (3226:7): [True: 55.2k, False: 18.4k]
  ------------------
 3227|  55.2k|    const int use_hybrid_pred =
 3228|  55.2k|        current_frame->reference_mode == REFERENCE_MODE_SELECT;
 3229|       |
 3230|  55.2k|    aom_wb_write_bit(wb, use_hybrid_pred);
 3231|  55.2k|  }
 3232|       |
 3233|  73.6k|  if (current_frame->skip_mode_info.skip_mode_allowed)
  ------------------
  |  Branch (3233:7): [True: 0, False: 73.6k]
  ------------------
 3234|      0|    aom_wb_write_bit(wb, current_frame->skip_mode_info.skip_mode_flag);
 3235|       |
 3236|  73.6k|  if (frame_might_allow_warped_motion(cm))
  ------------------
  |  Branch (3236:7): [True: 55.2k, False: 18.4k]
  ------------------
 3237|  55.2k|    aom_wb_write_bit(wb, features->allow_warped_motion);
 3238|  18.4k|  else
 3239|  73.6k|    assert(!features->allow_warped_motion);
 3240|       |
 3241|  73.6k|  aom_wb_write_bit(wb, features->reduced_tx_set_used);
 3242|       |
 3243|  73.6k|  if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb);
  ------------------
  |  Branch (3243:7): [True: 55.2k, False: 18.4k]
  ------------------
 3244|       |
 3245|  73.6k|  if (seq_params->film_grain_params_present &&
  ------------------
  |  Branch (3245:7): [True: 0, False: 73.6k]
  ------------------
 3246|      0|      (cm->show_frame || cm->showable_frame))
  ------------------
  |  Branch (3246:8): [True: 0, False: 0]
  |  Branch (3246:26): [True: 0, False: 0]
  ------------------
 3247|      0|    write_film_grain_params(cpi, wb);
 3248|       |
 3249|  73.6k|  if (cm->tiles.large_scale) write_ext_tile_info(cm, saved_wb, wb);
  ------------------
  |  Branch (3249:7): [True: 0, False: 73.6k]
  ------------------
 3250|  73.6k|}
bitstream.c:write_frame_size:
 2367|  63.3k|                                    struct aom_write_bit_buffer *wb) {
 2368|  63.3k|  const int coded_width = cm->superres_upscaled_width - 1;
 2369|  63.3k|  const int coded_height = cm->superres_upscaled_height - 1;
 2370|  63.3k|  const SequenceHeader *seq_params = cm->seq_params;
 2371|       |
 2372|  63.3k|  if (frame_size_override) {
  ------------------
  |  Branch (2372:7): [True: 44.9k, False: 18.4k]
  ------------------
 2373|  44.9k|    int num_bits_width = seq_params->num_bits_width;
 2374|  44.9k|    int num_bits_height = seq_params->num_bits_height;
 2375|  44.9k|    aom_wb_write_literal(wb, coded_width, num_bits_width);
 2376|  44.9k|    aom_wb_write_literal(wb, coded_height, num_bits_height);
 2377|  44.9k|  } else {
 2378|  18.4k|    if (cm->superres_upscaled_width != seq_params->max_frame_width ||
  ------------------
  |  Branch (2378:9): [True: 0, False: 18.4k]
  ------------------
 2379|  18.4k|        cm->superres_upscaled_height != seq_params->max_frame_height) {
  ------------------
  |  Branch (2379:9): [True: 0, False: 18.4k]
  ------------------
 2380|      0|      aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM,
 2381|      0|                         "Frame dimensions are different from the maximum "
 2382|      0|                         "values when frame_size_override_flag is 0");
 2383|      0|    }
 2384|  18.4k|  }
 2385|       |
 2386|  63.3k|  write_superres_scale(cm, wb);
 2387|  63.3k|  write_render_size(cm, wb);
 2388|  63.3k|}
bitstream.c:write_superres_scale:
 2344|  73.6k|                                        struct aom_write_bit_buffer *wb) {
 2345|  73.6k|  const SequenceHeader *const seq_params = cm->seq_params;
 2346|  73.6k|  if (!seq_params->enable_superres) {
  ------------------
  |  Branch (2346:7): [True: 73.6k, False: 0]
  ------------------
 2347|  73.6k|    assert(cm->superres_scale_denominator == SCALE_NUMERATOR);
 2348|  73.6k|    return;
 2349|  73.6k|  }
 2350|       |
 2351|       |  // First bit is whether to to scale or not
 2352|      0|  if (cm->superres_scale_denominator == SCALE_NUMERATOR) {
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (2352:7): [True: 0, False: 0]
  ------------------
 2353|      0|    aom_wb_write_bit(wb, 0);  // no scaling
 2354|      0|  } else {
 2355|      0|    aom_wb_write_bit(wb, 1);  // scaling, write scale factor
 2356|      0|    assert(cm->superres_scale_denominator >= SUPERRES_SCALE_DENOMINATOR_MIN);
 2357|      0|    assert(cm->superres_scale_denominator <
 2358|      0|           SUPERRES_SCALE_DENOMINATOR_MIN + (1 << SUPERRES_SCALE_BITS));
 2359|      0|    aom_wb_write_literal(
 2360|      0|        wb, cm->superres_scale_denominator - SUPERRES_SCALE_DENOMINATOR_MIN,
  ------------------
  |  |  639|      0|#define SUPERRES_SCALE_DENOMINATOR_MIN (SCALE_NUMERATOR + 1)
  |  |  ------------------
  |  |  |  |   22|      0|#define SCALE_NUMERATOR 8
  |  |  ------------------
  ------------------
 2361|      0|        SUPERRES_SCALE_BITS);
  ------------------
  |  |  638|      0|#define SUPERRES_SCALE_BITS 3
  ------------------
 2362|      0|  }
 2363|      0|}
bitstream.c:write_render_size:
 2334|  63.3k|                                     struct aom_write_bit_buffer *wb) {
 2335|  63.3k|  const int scaling_active = av1_resize_scaled(cm);
 2336|  63.3k|  aom_wb_write_bit(wb, scaling_active);
 2337|  63.3k|  if (scaling_active) {
  ------------------
  |  Branch (2337:7): [True: 44.9k, False: 18.4k]
  ------------------
 2338|  44.9k|    aom_wb_write_literal(wb, cm->render_width - 1, 16);
 2339|  44.9k|    aom_wb_write_literal(wb, cm->render_height - 1, 16);
 2340|  44.9k|  }
 2341|  63.3k|}
bitstream.c:write_frame_size_with_refs:
 2391|  36.8k|                                              struct aom_write_bit_buffer *wb) {
 2392|  36.8k|  int found = 0;
 2393|       |
 2394|  36.8k|  MV_REFERENCE_FRAME ref_frame;
 2395|   222k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (2395:32): [True: 196k, False: 26.5k]
  ------------------
 2396|   196k|    const YV12_BUFFER_CONFIG *cfg = get_ref_frame_yv12_buf(cm, ref_frame);
 2397|       |
 2398|   196k|    if (cfg != NULL) {
  ------------------
  |  Branch (2398:9): [True: 196k, False: 0]
  ------------------
 2399|   196k|      found = cm->superres_upscaled_width == cfg->y_crop_width &&
  ------------------
  |  Branch (2399:15): [True: 66.1k, False: 130k]
  ------------------
 2400|  66.1k|              cm->superres_upscaled_height == cfg->y_crop_height;
  ------------------
  |  Branch (2400:15): [True: 10.2k, False: 55.8k]
  ------------------
 2401|   196k|      found &= cm->render_width == cfg->render_width &&
  ------------------
  |  Branch (2401:16): [True: 196k, False: 0]
  ------------------
 2402|   196k|               cm->render_height == cfg->render_height;
  ------------------
  |  Branch (2402:16): [True: 196k, False: 0]
  ------------------
 2403|   196k|    }
 2404|   196k|    aom_wb_write_bit(wb, found);
 2405|   196k|    if (found) {
  ------------------
  |  Branch (2405:9): [True: 10.2k, False: 186k]
  ------------------
 2406|  10.2k|      write_superres_scale(cm, wb);
 2407|  10.2k|      break;
 2408|  10.2k|    }
 2409|   196k|  }
 2410|       |
 2411|  36.8k|  if (!found) {
  ------------------
  |  Branch (2411:7): [True: 26.5k, False: 10.2k]
  ------------------
 2412|  26.5k|    int frame_size_override = 1;  // Always equal to 1 in this function
 2413|  26.5k|    write_frame_size(cm, frame_size_override, wb);
 2414|  26.5k|  }
 2415|  36.8k|}
bitstream.c:write_frame_interp_filter:
 2180|  55.2k|                                             struct aom_write_bit_buffer *wb) {
 2181|  55.2k|  aom_wb_write_bit(wb, filter == SWITCHABLE);
 2182|  55.2k|  if (filter != SWITCHABLE)
  ------------------
  |  Branch (2182:7): [True: 25.8k, False: 29.3k]
  ------------------
 2183|  25.8k|    aom_wb_write_literal(wb, filter, LOG_SWITCHABLE_FILTERS);
  ------------------
  |  |   99|  25.8k|#define LOG_SWITCHABLE_FILTERS 2
  ------------------
 2184|  55.2k|}
bitstream.c:write_tile_info:
 2251|  73.6k|                                   struct aom_write_bit_buffer *wb) {
 2252|  73.6k|  write_tile_info_max_tile(cm, wb);
 2253|       |
 2254|  73.6k|  *saved_wb = *wb;
 2255|  73.6k|  if (cm->tiles.rows * cm->tiles.cols > 1) {
  ------------------
  |  Branch (2255:7): [True: 18.5k, False: 55.0k]
  ------------------
 2256|       |    // tile id used for cdf update
 2257|  18.5k|    aom_wb_write_literal(wb, 0, cm->tiles.log2_cols + cm->tiles.log2_rows);
 2258|       |    // Number of bytes in tile size - 1
 2259|  18.5k|    aom_wb_write_literal(wb, 3, 2);
 2260|  18.5k|  }
 2261|  73.6k|}
bitstream.c:write_tile_info_max_tile:
 2201|  73.6k|                                            struct aom_write_bit_buffer *wb) {
 2202|  73.6k|  int width_sb =
 2203|  73.6k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  73.6k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 2204|  73.6k|  int height_sb =
 2205|  73.6k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  73.6k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 2206|  73.6k|  int size_sb, i;
 2207|  73.6k|  const CommonTileParams *const tiles = &cm->tiles;
 2208|       |
 2209|  73.6k|  aom_wb_write_bit(wb, tiles->uniform_spacing);
 2210|       |
 2211|  73.6k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (2211:7): [True: 73.6k, False: 0]
  ------------------
 2212|  73.6k|    int ones = tiles->log2_cols - tiles->min_log2_cols;
 2213|  88.7k|    while (ones--) {
  ------------------
  |  Branch (2213:12): [True: 15.0k, False: 73.6k]
  ------------------
 2214|  15.0k|      aom_wb_write_bit(wb, 1);
 2215|  15.0k|    }
 2216|  73.6k|    if (tiles->log2_cols < tiles->max_log2_cols) {
  ------------------
  |  Branch (2216:9): [True: 3.97k, False: 69.6k]
  ------------------
 2217|  3.97k|      aom_wb_write_bit(wb, 0);
 2218|  3.97k|    }
 2219|       |
 2220|       |    // rows
 2221|  73.6k|    ones = tiles->log2_rows - tiles->min_log2_rows;
 2222|  89.4k|    while (ones--) {
  ------------------
  |  Branch (2222:12): [True: 15.8k, False: 73.6k]
  ------------------
 2223|  15.8k|      aom_wb_write_bit(wb, 1);
 2224|  15.8k|    }
 2225|  73.6k|    if (tiles->log2_rows < tiles->max_log2_rows) {
  ------------------
  |  Branch (2225:9): [True: 3.66k, False: 69.9k]
  ------------------
 2226|  3.66k|      aom_wb_write_bit(wb, 0);
 2227|  3.66k|    }
 2228|  73.6k|  } else {
 2229|       |    // Explicit tiles with configurable tile widths and heights
 2230|       |    // columns
 2231|      0|    for (i = 0; i < tiles->cols; i++) {
  ------------------
  |  Branch (2231:17): [True: 0, False: 0]
  ------------------
 2232|      0|      size_sb = tiles->col_start_sb[i + 1] - tiles->col_start_sb[i];
 2233|      0|      wb_write_uniform(wb, AOMMIN(width_sb, tiles->max_width_sb), size_sb - 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2234|      0|      width_sb -= size_sb;
 2235|      0|    }
 2236|      0|    assert(width_sb == 0);
 2237|       |
 2238|       |    // rows
 2239|      0|    for (i = 0; i < tiles->rows; i++) {
  ------------------
  |  Branch (2239:17): [True: 0, False: 0]
  ------------------
 2240|      0|      size_sb = tiles->row_start_sb[i + 1] - tiles->row_start_sb[i];
 2241|      0|      wb_write_uniform(wb, AOMMIN(height_sb, tiles->max_height_sb),
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2242|      0|                       size_sb - 1);
 2243|      0|      height_sb -= size_sb;
 2244|      0|    }
 2245|       |    assert(height_sb == 0);
 2246|      0|  }
 2247|  73.6k|}
bitstream.c:encode_quantization:
 2115|  73.6k|    bool separate_uv_delta_q, struct aom_write_bit_buffer *wb) {
 2116|  73.6k|  aom_wb_write_literal(wb, quant_params->base_qindex, QINDEX_BITS);
  ------------------
  |  |   28|  73.6k|#define QINDEX_BITS 8
  ------------------
 2117|  73.6k|  write_delta_q(wb, quant_params->y_dc_delta_q);
 2118|  73.6k|  if (num_planes > 1) {
  ------------------
  |  Branch (2118:7): [True: 27.9k, False: 45.6k]
  ------------------
 2119|  27.9k|    int diff_uv_delta =
 2120|  27.9k|        (quant_params->u_dc_delta_q != quant_params->v_dc_delta_q) ||
  ------------------
  |  Branch (2120:9): [True: 0, False: 27.9k]
  ------------------
 2121|  27.9k|        (quant_params->u_ac_delta_q != quant_params->v_ac_delta_q);
  ------------------
  |  Branch (2121:9): [True: 0, False: 27.9k]
  ------------------
 2122|  27.9k|    if (separate_uv_delta_q) aom_wb_write_bit(wb, diff_uv_delta);
  ------------------
  |  Branch (2122:9): [True: 0, False: 27.9k]
  ------------------
 2123|  27.9k|    write_delta_q(wb, quant_params->u_dc_delta_q);
 2124|  27.9k|    write_delta_q(wb, quant_params->u_ac_delta_q);
 2125|  27.9k|    if (diff_uv_delta) {
  ------------------
  |  Branch (2125:9): [True: 0, False: 27.9k]
  ------------------
 2126|      0|      write_delta_q(wb, quant_params->v_dc_delta_q);
 2127|      0|      write_delta_q(wb, quant_params->v_ac_delta_q);
 2128|      0|    }
 2129|  27.9k|  }
 2130|  73.6k|  aom_wb_write_bit(wb, quant_params->using_qmatrix);
 2131|  73.6k|  if (quant_params->using_qmatrix) {
  ------------------
  |  Branch (2131:7): [True: 52.3k, False: 21.2k]
  ------------------
 2132|  52.3k|    aom_wb_write_literal(wb, quant_params->qmatrix_level_y, QM_LEVEL_BITS);
  ------------------
  |  |   30|  52.3k|#define QM_LEVEL_BITS 4
  ------------------
 2133|  52.3k|    aom_wb_write_literal(wb, quant_params->qmatrix_level_u, QM_LEVEL_BITS);
  ------------------
  |  |   30|  52.3k|#define QM_LEVEL_BITS 4
  ------------------
 2134|  52.3k|    if (!separate_uv_delta_q)
  ------------------
  |  Branch (2134:9): [True: 52.3k, False: 0]
  ------------------
 2135|  52.3k|      assert(quant_params->qmatrix_level_u == quant_params->qmatrix_level_v);
 2136|      0|    else
 2137|      0|      aom_wb_write_literal(wb, quant_params->qmatrix_level_v, QM_LEVEL_BITS);
  ------------------
  |  |   30|      0|#define QM_LEVEL_BITS 4
  ------------------
 2138|  52.3k|  }
 2139|  73.6k|}
bitstream.c:write_delta_q:
 2104|   129k|static inline void write_delta_q(struct aom_write_bit_buffer *wb, int delta_q) {
 2105|   129k|  if (delta_q != 0) {
  ------------------
  |  Branch (2105:7): [True: 36.3k, False: 93.2k]
  ------------------
 2106|  36.3k|    aom_wb_write_bit(wb, 1);
 2107|  36.3k|    aom_wb_write_inv_signed_literal(wb, delta_q, 6);
 2108|  93.2k|  } else {
 2109|  93.2k|    aom_wb_write_bit(wb, 0);
 2110|  93.2k|  }
 2111|   129k|}
bitstream.c:encode_segmentation:
 2142|  73.6k|                                       struct aom_write_bit_buffer *wb) {
 2143|  73.6k|  int i, j;
 2144|  73.6k|  struct segmentation *seg = &cm->seg;
 2145|       |
 2146|  73.6k|  aom_wb_write_bit(wb, seg->enabled);
 2147|  73.6k|  if (!seg->enabled) return;
  ------------------
  |  Branch (2147:7): [True: 73.6k, False: 0]
  ------------------
 2148|       |
 2149|       |  // Write update flags
 2150|      0|  if (cm->features.primary_ref_frame != PRIMARY_REF_NONE) {
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (2150:7): [True: 0, False: 0]
  ------------------
 2151|      0|    aom_wb_write_bit(wb, seg->update_map);
 2152|      0|    if (seg->update_map) aom_wb_write_bit(wb, seg->temporal_update);
  ------------------
  |  Branch (2152:9): [True: 0, False: 0]
  ------------------
 2153|      0|    aom_wb_write_bit(wb, seg->update_data);
 2154|      0|  }
 2155|       |
 2156|       |  // Segmentation data
 2157|      0|  if (seg->update_data) {
  ------------------
  |  Branch (2157:7): [True: 0, False: 0]
  ------------------
 2158|      0|    for (i = 0; i < MAX_SEGMENTS; i++) {
  ------------------
  |  |   23|      0|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (2158:17): [True: 0, False: 0]
  ------------------
 2159|      0|      for (j = 0; j < SEG_LVL_MAX; j++) {
  ------------------
  |  Branch (2159:19): [True: 0, False: 0]
  ------------------
 2160|      0|        const int active = segfeature_active(seg, i, j);
 2161|      0|        aom_wb_write_bit(wb, active);
 2162|      0|        if (active) {
  ------------------
  |  Branch (2162:13): [True: 0, False: 0]
  ------------------
 2163|      0|          const int data_max = av1_seg_feature_data_max(j);
 2164|      0|          const int data_min = -data_max;
 2165|      0|          const int ubits = get_unsigned_bits(data_max);
 2166|      0|          const int data = clamp(get_segdata(seg, i, j), data_min, data_max);
 2167|       |
 2168|      0|          if (av1_is_segfeature_signed(j)) {
  ------------------
  |  Branch (2168:15): [True: 0, False: 0]
  ------------------
 2169|      0|            aom_wb_write_inv_signed_literal(wb, data, ubits);
 2170|      0|          } else {
 2171|      0|            aom_wb_write_literal(wb, data, ubits);
 2172|      0|          }
 2173|      0|        }
 2174|      0|      }
 2175|      0|    }
 2176|      0|  }
 2177|      0|}
bitstream.c:encode_loopfilter:
 2031|  70.2k|                                     struct aom_write_bit_buffer *wb) {
 2032|  70.2k|  assert(!cm->features.coded_lossless);
 2033|  70.2k|  if (cm->features.allow_intrabc) return;
  ------------------
  |  Branch (2033:7): [True: 0, False: 70.2k]
  ------------------
 2034|  70.2k|  const int num_planes = av1_num_planes(cm);
 2035|  70.2k|  struct loopfilter *lf = &cm->lf;
 2036|       |
 2037|       |  // Encode the loop filter level and type
 2038|  70.2k|  aom_wb_write_literal(wb, lf->filter_level[0], 6);
 2039|  70.2k|  aom_wb_write_literal(wb, lf->filter_level[1], 6);
 2040|  70.2k|  if (num_planes > 1) {
  ------------------
  |  Branch (2040:7): [True: 26.5k, False: 43.6k]
  ------------------
 2041|  26.5k|    if (lf->filter_level[0] || lf->filter_level[1]) {
  ------------------
  |  Branch (2041:9): [True: 9.99k, False: 16.5k]
  |  Branch (2041:32): [True: 0, False: 16.5k]
  ------------------
 2042|  9.99k|      aom_wb_write_literal(wb, lf->filter_level_u, 6);
 2043|  9.99k|      aom_wb_write_literal(wb, lf->filter_level_v, 6);
 2044|  9.99k|    }
 2045|  26.5k|  }
 2046|  70.2k|  aom_wb_write_literal(wb, lf->sharpness_level, 3);
 2047|       |
 2048|  70.2k|  aom_wb_write_bit(wb, lf->mode_ref_delta_enabled);
 2049|       |
 2050|  70.2k|  if (lf->mode_ref_delta_enabled) {
  ------------------
  |  Branch (2050:7): [True: 70.2k, False: 0]
  ------------------
 2051|       |    // Check if the loop filter deltas have changed from the previous frame.
 2052|       |    // If mode_ref_delta_update_decision is 1, signal the update and write out
 2053|       |    // the actual delta values. Otherwise, signal 0 and skip writing delta
 2054|       |    // values.
 2055|  70.2k|    int mode_ref_delta_update = is_mode_ref_delta_meaningful(cm);
 2056|  70.2k|    aom_wb_write_bit(wb, mode_ref_delta_update);
 2057|  70.2k|    if (!mode_ref_delta_update) {
  ------------------
  |  Branch (2057:9): [True: 70.2k, False: 0]
  ------------------
 2058|  70.2k|      return;
 2059|  70.2k|    }
 2060|       |
 2061|      0|    const RefCntBuffer *buf = get_primary_ref_frame_buf(cm);
 2062|      0|    int8_t last_ref_deltas[REF_FRAMES];
 2063|      0|    int8_t last_mode_deltas[MAX_MODE_LF_DELTAS];
 2064|      0|    if (buf == NULL) {
  ------------------
  |  Branch (2064:9): [True: 0, False: 0]
  ------------------
 2065|      0|      av1_set_default_ref_deltas(last_ref_deltas);
 2066|      0|      av1_set_default_mode_deltas(last_mode_deltas);
 2067|      0|    } else {
 2068|      0|      memcpy(last_ref_deltas, buf->ref_deltas, REF_FRAMES);
 2069|      0|      memcpy(last_mode_deltas, buf->mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|      0|#define MAX_MODE_LF_DELTAS 2
  ------------------
 2070|      0|    }
 2071|      0|    for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (2071:21): [True: 0, False: 0]
  ------------------
 2072|      0|      const int delta = lf->ref_deltas[i];
 2073|      0|      const int changed = delta != last_ref_deltas[i];
 2074|      0|      aom_wb_write_bit(wb, changed);
 2075|      0|      if (changed) aom_wb_write_inv_signed_literal(wb, delta, 6);
  ------------------
  |  Branch (2075:11): [True: 0, False: 0]
  ------------------
 2076|      0|    }
 2077|      0|    for (int i = 0; i < MAX_MODE_LF_DELTAS; i++) {
  ------------------
  |  |   74|      0|#define MAX_MODE_LF_DELTAS 2
  ------------------
  |  Branch (2077:21): [True: 0, False: 0]
  ------------------
 2078|      0|      const int delta = lf->mode_deltas[i];
 2079|      0|      const int changed = delta != last_mode_deltas[i];
 2080|      0|      aom_wb_write_bit(wb, changed);
 2081|      0|      if (changed) aom_wb_write_inv_signed_literal(wb, delta, 6);
  ------------------
  |  Branch (2081:11): [True: 0, False: 0]
  ------------------
 2082|      0|    }
 2083|      0|  }
 2084|  70.2k|}
bitstream.c:is_mode_ref_delta_meaningful:
 2002|  70.2k|static bool is_mode_ref_delta_meaningful(AV1_COMMON *cm) {
 2003|  70.2k|  struct loopfilter *lf = &cm->lf;
 2004|  70.2k|  if (!lf->mode_ref_delta_update) {
  ------------------
  |  Branch (2004:7): [True: 29.3k, False: 40.8k]
  ------------------
 2005|  29.3k|    return 0;
 2006|  29.3k|  }
 2007|  40.8k|  const RefCntBuffer *buf = get_primary_ref_frame_buf(cm);
 2008|  40.8k|  int8_t last_ref_deltas[REF_FRAMES];
 2009|  40.8k|  int8_t last_mode_deltas[MAX_MODE_LF_DELTAS];
 2010|  40.8k|  if (buf == NULL) {
  ------------------
  |  Branch (2010:7): [True: 40.8k, False: 0]
  ------------------
 2011|  40.8k|    av1_set_default_ref_deltas(last_ref_deltas);
 2012|  40.8k|    av1_set_default_mode_deltas(last_mode_deltas);
 2013|  40.8k|  } else {
 2014|      0|    memcpy(last_ref_deltas, buf->ref_deltas, REF_FRAMES);
 2015|      0|    memcpy(last_mode_deltas, buf->mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|      0|#define MAX_MODE_LF_DELTAS 2
  ------------------
 2016|      0|  }
 2017|   367k|  for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (2017:19): [True: 327k, False: 40.8k]
  ------------------
 2018|   327k|    if (lf->ref_deltas[i] != last_ref_deltas[i]) {
  ------------------
  |  Branch (2018:9): [True: 0, False: 327k]
  ------------------
 2019|      0|      return true;
 2020|      0|    }
 2021|   327k|  }
 2022|   122k|  for (int i = 0; i < MAX_MODE_LF_DELTAS; i++) {
  ------------------
  |  |   74|   122k|#define MAX_MODE_LF_DELTAS 2
  ------------------
  |  Branch (2022:19): [True: 81.7k, False: 40.8k]
  ------------------
 2023|  81.7k|    if (lf->mode_deltas[i] != last_mode_deltas[i]) {
  ------------------
  |  Branch (2023:9): [True: 0, False: 81.7k]
  ------------------
 2024|      0|      return true;
 2025|      0|    }
 2026|  81.7k|  }
 2027|  40.8k|  return false;
 2028|  40.8k|}
bitstream.c:encode_cdef:
 2087|  70.2k|                               struct aom_write_bit_buffer *wb) {
 2088|  70.2k|  assert(!cm->features.coded_lossless);
 2089|  70.2k|  if (!cm->seq_params->enable_cdef) return;
  ------------------
  |  Branch (2089:7): [True: 0, False: 70.2k]
  ------------------
 2090|  70.2k|  if (cm->features.allow_intrabc) return;
  ------------------
  |  Branch (2090:7): [True: 0, False: 70.2k]
  ------------------
 2091|  70.2k|  const int num_planes = av1_num_planes(cm);
 2092|  70.2k|  int i;
 2093|  70.2k|  aom_wb_write_literal(wb, cm->cdef_info.cdef_damping - 3, 2);
 2094|  70.2k|  aom_wb_write_literal(wb, cm->cdef_info.cdef_bits, 2);
 2095|   150k|  for (i = 0; i < cm->cdef_info.nb_cdef_strengths; i++) {
  ------------------
  |  Branch (2095:15): [True: 80.3k, False: 70.2k]
  ------------------
 2096|  80.3k|    aom_wb_write_literal(wb, cm->cdef_info.cdef_strengths[i],
 2097|  80.3k|                         CDEF_STRENGTH_BITS);
  ------------------
  |  |   14|  80.3k|#define CDEF_STRENGTH_BITS 6
  ------------------
 2098|  80.3k|    if (num_planes > 1)
  ------------------
  |  Branch (2098:9): [True: 31.6k, False: 48.6k]
  ------------------
 2099|  31.6k|      aom_wb_write_literal(wb, cm->cdef_info.cdef_uv_strengths[i],
 2100|  31.6k|                           CDEF_STRENGTH_BITS);
  ------------------
  |  |   14|  31.6k|#define CDEF_STRENGTH_BITS 6
  ------------------
 2101|  80.3k|  }
 2102|  70.2k|}
bitstream.c:encode_restoration_mode:
 1775|  70.2k|                                           struct aom_write_bit_buffer *wb) {
 1776|  70.2k|  assert(!cm->features.all_lossless);
 1777|  70.2k|  if (!cm->seq_params->enable_restoration) return;
  ------------------
  |  Branch (1777:7): [True: 60.0k, False: 10.1k]
  ------------------
 1778|  10.1k|  if (cm->features.allow_intrabc) return;
  ------------------
  |  Branch (1778:7): [True: 0, False: 10.1k]
  ------------------
 1779|  10.1k|  const int num_planes = av1_num_planes(cm);
 1780|  10.1k|  int all_none = 1, chroma_none = 1;
 1781|  27.7k|  for (int p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (1781:19): [True: 17.6k, False: 10.1k]
  ------------------
 1782|  17.6k|    RestorationInfo *rsi = &cm->rst_info[p];
 1783|  17.6k|    if (rsi->frame_restoration_type != RESTORE_NONE) {
  ------------------
  |  Branch (1783:9): [True: 794, False: 16.8k]
  ------------------
 1784|    794|      all_none = 0;
 1785|    794|      chroma_none &= p == 0;
 1786|    794|    }
 1787|  17.6k|    switch (rsi->frame_restoration_type) {
 1788|  16.8k|      case RESTORE_NONE:
  ------------------
  |  Branch (1788:7): [True: 16.8k, False: 794]
  ------------------
 1789|  16.8k|        aom_wb_write_bit(wb, 0);
 1790|  16.8k|        aom_wb_write_bit(wb, 0);
 1791|  16.8k|        break;
 1792|    757|      case RESTORE_WIENER:
  ------------------
  |  Branch (1792:7): [True: 757, False: 16.8k]
  ------------------
 1793|    757|        aom_wb_write_bit(wb, 1);
 1794|    757|        aom_wb_write_bit(wb, 0);
 1795|    757|        break;
 1796|     36|      case RESTORE_SGRPROJ:
  ------------------
  |  Branch (1796:7): [True: 36, False: 17.5k]
  ------------------
 1797|     36|        aom_wb_write_bit(wb, 1);
 1798|     36|        aom_wb_write_bit(wb, 1);
 1799|     36|        break;
 1800|      1|      case RESTORE_SWITCHABLE:
  ------------------
  |  Branch (1800:7): [True: 1, False: 17.6k]
  ------------------
 1801|      1|        aom_wb_write_bit(wb, 0);
 1802|      1|        aom_wb_write_bit(wb, 1);
 1803|      1|        break;
 1804|      0|      default: assert(0);
  ------------------
  |  Branch (1804:7): [True: 0, False: 17.6k]
  ------------------
 1805|  17.6k|    }
 1806|  17.6k|  }
 1807|  10.1k|  if (!all_none) {
  ------------------
  |  Branch (1807:7): [True: 739, False: 9.42k]
  ------------------
 1808|    739|    assert(cm->seq_params->sb_size == BLOCK_64X64 ||
 1809|    739|           cm->seq_params->sb_size == BLOCK_128X128);
 1810|    739|    const int sb_size = cm->seq_params->sb_size == BLOCK_128X128 ? 128 : 64;
  ------------------
  |  Branch (1810:25): [True: 0, False: 739]
  ------------------
 1811|       |
 1812|    739|    RestorationInfo *rsi = &cm->rst_info[0];
 1813|       |
 1814|    739|    assert(rsi->restoration_unit_size >= sb_size);
 1815|    739|    assert(RESTORATION_UNITSIZE_MAX == 256);
 1816|       |
 1817|    739|    if (sb_size == 64) {
  ------------------
  |  Branch (1817:9): [True: 739, False: 0]
  ------------------
 1818|    739|      aom_wb_write_bit(wb, rsi->restoration_unit_size > 64);
 1819|    739|    }
 1820|    739|    if (rsi->restoration_unit_size > 64) {
  ------------------
  |  Branch (1820:9): [True: 739, False: 0]
  ------------------
 1821|    739|      aom_wb_write_bit(wb, rsi->restoration_unit_size > 128);
 1822|    739|    }
 1823|    739|  }
 1824|       |
 1825|  10.1k|  if (num_planes > 1) {
  ------------------
  |  Branch (1825:7): [True: 3.73k, False: 6.42k]
  ------------------
 1826|  3.73k|    int s =
 1827|  3.73k|        AOMMIN(cm->seq_params->subsampling_x, cm->seq_params->subsampling_y);
  ------------------
  |  |   34|  3.73k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 3.73k]
  |  |  ------------------
  ------------------
 1828|  3.73k|    if (s && !chroma_none) {
  ------------------
  |  Branch (1828:9): [True: 1.73k, False: 2.00k]
  |  Branch (1828:14): [True: 15, False: 1.71k]
  ------------------
 1829|     15|      aom_wb_write_bit(wb, cm->rst_info[1].restoration_unit_size !=
 1830|     15|                               cm->rst_info[0].restoration_unit_size);
 1831|     15|      assert(cm->rst_info[1].restoration_unit_size ==
 1832|     15|                 cm->rst_info[0].restoration_unit_size ||
 1833|     15|             cm->rst_info[1].restoration_unit_size ==
 1834|     15|                 (cm->rst_info[0].restoration_unit_size >> s));
 1835|     15|      assert(cm->rst_info[2].restoration_unit_size ==
 1836|     15|             cm->rst_info[1].restoration_unit_size);
 1837|  3.71k|    } else if (!s) {
  ------------------
  |  Branch (1837:16): [True: 2.00k, False: 1.71k]
  ------------------
 1838|  2.00k|      assert(cm->rst_info[1].restoration_unit_size ==
 1839|  2.00k|             cm->rst_info[0].restoration_unit_size);
 1840|       |      assert(cm->rst_info[2].restoration_unit_size ==
 1841|  2.00k|             cm->rst_info[1].restoration_unit_size);
 1842|  2.00k|    }
 1843|  3.73k|  }
 1844|  10.1k|}
bitstream.c:write_global_motion:
 2781|  55.2k|                                       struct aom_write_bit_buffer *wb) {
 2782|  55.2k|  AV1_COMMON *const cm = &cpi->common;
 2783|  55.2k|  int frame;
 2784|   441k|  for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
  ------------------
  |  Branch (2784:28): [True: 386k, False: 55.2k]
  ------------------
 2785|   386k|    const WarpedMotionParams *ref_params =
 2786|   386k|        cm->prev_frame ? &cm->prev_frame->global_motion[frame]
  ------------------
  |  Branch (2786:9): [True: 214k, False: 172k]
  ------------------
 2787|   386k|                       : &default_warp_params;
 2788|   386k|    write_global_motion_params(&cm->global_motion[frame], ref_params, wb,
 2789|   386k|                               cm->features.allow_high_precision_mv);
 2790|       |    // TODO(sarahparker, debargha): The logic in the commented out code below
 2791|       |    // does not work currently and causes mismatches when resize is on.
 2792|       |    // Fix it before turning the optimization back on.
 2793|       |    /*
 2794|       |    YV12_BUFFER_CONFIG *ref_buf = get_ref_frame_yv12_buf(cpi, frame);
 2795|       |    if (cpi->source->y_crop_width == ref_buf->y_crop_width &&
 2796|       |        cpi->source->y_crop_height == ref_buf->y_crop_height) {
 2797|       |      write_global_motion_params(&cm->global_motion[frame],
 2798|       |                                 &cm->prev_frame->global_motion[frame], wb,
 2799|       |                                 cm->features.allow_high_precision_mv);
 2800|       |    } else {
 2801|       |      assert(cm->global_motion[frame].wmtype == IDENTITY &&
 2802|       |             "Invalid warp type for frames of different resolutions");
 2803|       |    }
 2804|       |    */
 2805|       |    /*
 2806|       |    printf("Frame %d/%d: Enc Ref %d: %d %d %d %d\n",
 2807|       |           cm->current_frame.frame_number, cm->show_frame, frame,
 2808|       |           cm->global_motion[frame].wmmat[0],
 2809|       |           cm->global_motion[frame].wmmat[1], cm->global_motion[frame].wmmat[2],
 2810|       |           cm->global_motion[frame].wmmat[3]);
 2811|       |           */
 2812|   386k|  }
 2813|  55.2k|}
bitstream.c:write_global_motion_params:
 2723|   386k|    struct aom_write_bit_buffer *wb, int allow_hp) {
 2724|   386k|  const TransformationType type = params->wmtype;
 2725|       |
 2726|       |  // As a workaround for an AV1 spec bug, we avoid choosing TRANSLATION
 2727|       |  // type models. Check here that we don't accidentally pick one somehow.
 2728|       |  // See comments in gm_get_motion_vector() for details on the bug we're
 2729|       |  // working around here
 2730|   386k|  assert(type != TRANSLATION);
 2731|       |
 2732|   386k|  aom_wb_write_bit(wb, type != IDENTITY);
 2733|   386k|  if (type != IDENTITY) {
  ------------------
  |  Branch (2733:7): [True: 0, False: 386k]
  ------------------
 2734|      0|    aom_wb_write_bit(wb, type == ROTZOOM);
 2735|      0|    if (type != ROTZOOM) aom_wb_write_bit(wb, type == TRANSLATION);
  ------------------
  |  Branch (2735:9): [True: 0, False: 0]
  ------------------
 2736|      0|  }
 2737|       |
 2738|   386k|  if (type >= ROTZOOM) {
  ------------------
  |  Branch (2738:7): [True: 0, False: 386k]
  ------------------
 2739|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2740|      0|        wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                      wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2741|      0|        (ref_params->wmmat[2] >> GM_ALPHA_PREC_DIFF) -
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2742|      0|            (1 << GM_ALPHA_PREC_BITS),
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 2743|      0|        (params->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
                      (params->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 2744|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2745|      0|        wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                      wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2746|      0|        (ref_params->wmmat[3] >> GM_ALPHA_PREC_DIFF),
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2747|      0|        (params->wmmat[3] >> GM_ALPHA_PREC_DIFF));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2748|      0|  }
 2749|       |
 2750|   386k|  if (type >= AFFINE) {
  ------------------
  |  Branch (2750:7): [True: 0, False: 386k]
  ------------------
 2751|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2752|      0|        wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                      wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2753|      0|        (ref_params->wmmat[4] >> GM_ALPHA_PREC_DIFF),
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2754|      0|        (params->wmmat[4] >> GM_ALPHA_PREC_DIFF));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2755|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2756|      0|        wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                      wb, GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2757|      0|        (ref_params->wmmat[5] >> GM_ALPHA_PREC_DIFF) -
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
 2758|      0|            (1 << GM_ALPHA_PREC_BITS),
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 2759|      0|        (params->wmmat[5] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
                      (params->wmmat[5] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
 2760|      0|  }
 2761|       |
 2762|   386k|  if (type >= TRANSLATION) {
  ------------------
  |  Branch (2762:7): [True: 0, False: 386k]
  ------------------
 2763|      0|    const int trans_bits = (type == TRANSLATION)
  ------------------
  |  Branch (2763:28): [True: 0, False: 0]
  ------------------
 2764|      0|                               ? GM_ABS_TRANS_ONLY_BITS - !allow_hp
  ------------------
  |  |  166|      0|#define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  165|      0|#define GM_ABS_TRANS_BITS 12
  |  |  ------------------
  |  |               #define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
 2765|      0|                               : GM_ABS_TRANS_BITS;
  ------------------
  |  |  165|      0|#define GM_ABS_TRANS_BITS 12
  ------------------
 2766|      0|    const int trans_prec_diff = (type == TRANSLATION)
  ------------------
  |  Branch (2766:33): [True: 0, False: 0]
  ------------------
 2767|      0|                                    ? GM_TRANS_ONLY_PREC_DIFF + !allow_hp
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
 2768|      0|                                    : GM_TRANS_PREC_DIFF;
  ------------------
  |  |  167|      0|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
 2769|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2770|      0|        wb, (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2771|      0|        (ref_params->wmmat[0] >> trans_prec_diff),
 2772|      0|        (params->wmmat[0] >> trans_prec_diff));
 2773|      0|    aom_wb_write_signed_primitive_refsubexpfin(
 2774|      0|        wb, (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
 2775|      0|        (ref_params->wmmat[1] >> trans_prec_diff),
 2776|      0|        (params->wmmat[1] >> trans_prec_diff));
 2777|      0|  }
 2778|   386k|}
bitstream.c:write_tile_group_header:
 3593|  73.6k|                                        int tile_start_and_end_present_flag) {
 3594|  73.6k|  struct aom_write_bit_buffer wb = { dst, 0 };
 3595|  73.6k|  uint32_t size = 0;
 3596|       |
 3597|  73.6k|  if (!tiles_log2) return size;
  ------------------
  |  Branch (3597:7): [True: 55.0k, False: 18.5k]
  ------------------
 3598|       |
 3599|  18.5k|  aom_wb_write_bit(&wb, tile_start_and_end_present_flag);
 3600|       |
 3601|  18.5k|  if (tile_start_and_end_present_flag) {
  ------------------
  |  Branch (3601:7): [True: 0, False: 18.5k]
  ------------------
 3602|      0|    aom_wb_write_literal(&wb, start_tile, tiles_log2);
 3603|      0|    aom_wb_write_literal(&wb, end_tile, tiles_log2);
 3604|      0|  }
 3605|       |
 3606|  18.5k|  size = aom_wb_bytes_written(&wb);
 3607|  18.5k|  return size;
 3608|  73.6k|}
bitstream.c:write_modes:
 1733|   117k|                               int tile_row, int tile_col) {
 1734|   117k|  AV1_COMMON *const cm = &cpi->common;
 1735|   117k|  MACROBLOCKD *const xd = &td->mb.e_mbd;
 1736|   117k|  const int mi_row_start = tile->mi_row_start;
 1737|   117k|  const int mi_row_end = tile->mi_row_end;
 1738|   117k|  const int mi_col_start = tile->mi_col_start;
 1739|   117k|  const int mi_col_end = tile->mi_col_end;
 1740|   117k|  const int num_planes = av1_num_planes(cm);
 1741|       |
 1742|   117k|  av1_zero_above_context(cm, xd, mi_col_start, mi_col_end, tile->tile_row);
 1743|   117k|  av1_init_above_context(&cm->above_contexts, num_planes, tile->tile_row, xd);
 1744|       |
 1745|   117k|  if (cpi->common.delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (1745:7): [True: 39.3k, False: 78.2k]
  ------------------
 1746|  39.3k|    xd->current_base_qindex = cpi->common.quant_params.base_qindex;
 1747|  39.3k|    if (cpi->common.delta_q_info.delta_lf_present_flag) {
  ------------------
  |  Branch (1747:9): [True: 0, False: 39.3k]
  ------------------
 1748|      0|      av1_reset_loop_filter_delta(xd, num_planes);
 1749|      0|    }
 1750|  39.3k|  }
 1751|       |
 1752|   243k|  for (int mi_row = mi_row_start; mi_row < mi_row_end;
  ------------------
  |  Branch (1752:35): [True: 126k, False: 117k]
  ------------------
 1753|   126k|       mi_row += cm->seq_params->mib_size) {
 1754|   126k|    const int sb_row_in_tile =
 1755|   126k|        (mi_row - tile->mi_row_start) >> cm->seq_params->mib_size_log2;
 1756|   126k|    const TokenInfo *token_info = &cpi->token_info;
 1757|   126k|    const TokenExtra *tok;
 1758|   126k|    const TokenExtra *tok_end;
 1759|   126k|    get_token_pointers(token_info, tile_row, tile_col, sb_row_in_tile, &tok,
 1760|   126k|                       &tok_end);
 1761|       |
 1762|   126k|    av1_zero_left_context(xd);
 1763|       |
 1764|   263k|    for (int mi_col = mi_col_start; mi_col < mi_col_end;
  ------------------
  |  Branch (1764:37): [True: 137k, False: 126k]
  ------------------
 1765|   137k|         mi_col += cm->seq_params->mib_size) {
 1766|   137k|      td->mb.cb_coef_buff = av1_get_cb_coeff_buffer(cpi, mi_row, mi_col);
 1767|   137k|      write_modes_sb(cpi, td, tile, w, &tok, tok_end, mi_row, mi_col,
 1768|   137k|                     cm->seq_params->sb_size);
 1769|   137k|    }
 1770|       |    assert(tok == tok_end);
 1771|   126k|  }
 1772|   117k|}
bitstream.c:get_token_pointers:
 1720|   126k|                                      const TokenExtra **tok_end) {
 1721|   126k|  if (!is_token_info_allocated(token_info)) {
  ------------------
  |  Branch (1721:7): [True: 115k, False: 11.1k]
  ------------------
 1722|   115k|    *tok = NULL;
 1723|   115k|    *tok_end = NULL;
 1724|   115k|    return;
 1725|   115k|  }
 1726|  11.1k|  *tok = token_info->tplist[tile_row][tile_col][sb_row_in_tile].start;
 1727|  11.1k|  *tok_end =
 1728|  11.1k|      *tok + token_info->tplist[tile_row][tile_col][sb_row_in_tile].count;
 1729|  11.1k|}
bitstream.c:write_modes_sb:
 1613|  3.86M|                                  int mi_col, BLOCK_SIZE bsize) {
 1614|  3.86M|  const AV1_COMMON *const cm = &cpi->common;
 1615|  3.86M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1616|  3.86M|  MACROBLOCKD *const xd = &td->mb.e_mbd;
 1617|  3.86M|  assert(bsize < BLOCK_SIZES_ALL);
 1618|  3.86M|  const int hbs = mi_size_wide[bsize] / 2;
 1619|  3.86M|  const int quarter_step = mi_size_wide[bsize] / 4;
 1620|  3.86M|  int i;
 1621|  3.86M|  const PARTITION_TYPE partition = get_partition(cm, mi_row, mi_col, bsize);
 1622|  3.86M|  const BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);
 1623|       |
 1624|  3.86M|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols) return;
  ------------------
  |  Branch (1624:7): [True: 516k, False: 3.34M]
  |  Branch (1624:39): [True: 393k, False: 2.95M]
  ------------------
 1625|       |
 1626|  2.94M|#if !CONFIG_REALTIME_ONLY
 1627|  2.94M|  const int num_planes = av1_num_planes(cm);
 1628|  8.19M|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1628:23): [True: 5.25M, False: 2.94M]
  ------------------
 1629|  5.25M|    int rcol0, rcol1, rrow0, rrow1;
 1630|       |
 1631|       |    // Skip some unnecessary work if loop restoration is disabled
 1632|  5.25M|    if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
  ------------------
  |  Branch (1632:9): [True: 5.12M, False: 128k]
  ------------------
 1633|       |
 1634|   128k|    if (av1_loop_restoration_corners_in_sb(cm, plane, mi_row, mi_col, bsize,
  ------------------
  |  Branch (1634:9): [True: 882, False: 127k]
  ------------------
 1635|   128k|                                           &rcol0, &rcol1, &rrow0, &rrow1)) {
 1636|    882|      const int rstride = cm->rst_info[plane].horz_units;
 1637|  1.76k|      for (int rrow = rrow0; rrow < rrow1; ++rrow) {
  ------------------
  |  Branch (1637:30): [True: 882, False: 882]
  ------------------
 1638|  1.76k|        for (int rcol = rcol0; rcol < rcol1; ++rcol) {
  ------------------
  |  Branch (1638:32): [True: 882, False: 882]
  ------------------
 1639|    882|          const int runit_idx = rcol + rrow * rstride;
 1640|    882|          loop_restoration_write_sb_coeffs(cm, xd, runit_idx, w, plane,
 1641|    882|                                           td->counts);
 1642|    882|        }
 1643|    882|      }
 1644|    882|    }
 1645|   128k|  }
 1646|  2.94M|#endif
 1647|       |
 1648|  2.94M|  write_partition(cm, xd, hbs, mi_row, mi_col, partition, bsize, w);
 1649|  2.94M|  switch (partition) {
 1650|  1.96M|    case PARTITION_NONE:
  ------------------
  |  Branch (1650:5): [True: 1.96M, False: 985k]
  ------------------
 1651|  1.96M|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1652|  1.96M|      break;
 1653|  27.3k|    case PARTITION_HORZ:
  ------------------
  |  Branch (1653:5): [True: 27.3k, False: 2.91M]
  ------------------
 1654|  27.3k|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1655|  27.3k|      if (mi_row + hbs < mi_params->mi_rows)
  ------------------
  |  Branch (1655:11): [True: 7.23k, False: 20.1k]
  ------------------
 1656|  7.23k|        write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col);
 1657|  27.3k|      break;
 1658|  30.8k|    case PARTITION_VERT:
  ------------------
  |  Branch (1658:5): [True: 30.8k, False: 2.91M]
  ------------------
 1659|  30.8k|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1660|  30.8k|      if (mi_col + hbs < mi_params->mi_cols)
  ------------------
  |  Branch (1660:11): [True: 5.08k, False: 25.7k]
  ------------------
 1661|  5.08k|        write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col + hbs);
 1662|  30.8k|      break;
 1663|   934k|    case PARTITION_SPLIT:
  ------------------
  |  Branch (1663:5): [True: 934k, False: 2.01M]
  ------------------
 1664|   934k|      write_modes_sb(cpi, td, tile, w, tok, tok_end, mi_row, mi_col, subsize);
 1665|   934k|      write_modes_sb(cpi, td, tile, w, tok, tok_end, mi_row, mi_col + hbs,
 1666|   934k|                     subsize);
 1667|   934k|      write_modes_sb(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col,
 1668|   934k|                     subsize);
 1669|   934k|      write_modes_sb(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col + hbs,
 1670|   934k|                     subsize);
 1671|   934k|      break;
 1672|      0|    case PARTITION_HORZ_A:
  ------------------
  |  Branch (1672:5): [True: 0, False: 2.94M]
  ------------------
 1673|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1674|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col + hbs);
 1675|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col);
 1676|      0|      break;
 1677|      0|    case PARTITION_HORZ_B:
  ------------------
  |  Branch (1677:5): [True: 0, False: 2.94M]
  ------------------
 1678|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1679|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col);
 1680|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col + hbs);
 1681|      0|      break;
 1682|      0|    case PARTITION_VERT_A:
  ------------------
  |  Branch (1682:5): [True: 0, False: 2.94M]
  ------------------
 1683|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1684|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col);
 1685|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col + hbs);
 1686|      0|      break;
 1687|      0|    case PARTITION_VERT_B:
  ------------------
  |  Branch (1687:5): [True: 0, False: 2.94M]
  ------------------
 1688|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col);
 1689|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, mi_col + hbs);
 1690|      0|      write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row + hbs, mi_col + hbs);
 1691|      0|      break;
 1692|      0|    case PARTITION_HORZ_4:
  ------------------
  |  Branch (1692:5): [True: 0, False: 2.94M]
  ------------------
 1693|      0|      for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1693:19): [True: 0, False: 0]
  ------------------
 1694|      0|        int this_mi_row = mi_row + i * quarter_step;
 1695|      0|        if (i > 0 && this_mi_row >= mi_params->mi_rows) break;
  ------------------
  |  Branch (1695:13): [True: 0, False: 0]
  |  Branch (1695:22): [True: 0, False: 0]
  ------------------
 1696|       |
 1697|      0|        write_modes_b(cpi, td, tile, w, tok, tok_end, this_mi_row, mi_col);
 1698|      0|      }
 1699|      0|      break;
 1700|      0|    case PARTITION_VERT_4:
  ------------------
  |  Branch (1700:5): [True: 0, False: 2.94M]
  ------------------
 1701|      0|      for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1701:19): [True: 0, False: 0]
  ------------------
 1702|      0|        int this_mi_col = mi_col + i * quarter_step;
 1703|      0|        if (i > 0 && this_mi_col >= mi_params->mi_cols) break;
  ------------------
  |  Branch (1703:13): [True: 0, False: 0]
  |  Branch (1703:22): [True: 0, False: 0]
  ------------------
 1704|       |
 1705|      0|        write_modes_b(cpi, td, tile, w, tok, tok_end, mi_row, this_mi_col);
 1706|      0|      }
 1707|      0|      break;
 1708|      0|    default: assert(0);
  ------------------
  |  Branch (1708:5): [True: 0, False: 2.94M]
  ------------------
 1709|  2.94M|  }
 1710|       |
 1711|       |  // update partition context
 1712|  2.94M|  update_ext_partition_context(xd, mi_row, mi_col, subsize, bsize, partition);
 1713|  2.94M|}
bitstream.c:loop_restoration_write_sb_coeffs:
 1925|    882|    aom_writer *const w, int plane, FRAME_COUNTS *counts) {
 1926|    882|  const RestorationUnitInfo *rui = &cm->rst_info[plane].unit_info[runit_idx];
 1927|    882|  const RestorationInfo *rsi = cm->rst_info + plane;
 1928|    882|  RestorationType frame_rtype = rsi->frame_restoration_type;
 1929|    882|  assert(frame_rtype != RESTORE_NONE);
 1930|       |
 1931|    882|  (void)counts;
 1932|    882|  assert(!cm->features.all_lossless);
 1933|       |
 1934|    882|  const int wiener_win = (plane > 0) ? WIENER_WIN_CHROMA : WIENER_WIN;
  ------------------
  |  |  128|    160|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|    160|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    160|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                const int wiener_win = (plane > 0) ? WIENER_WIN_CHROMA : WIENER_WIN;
  ------------------
  |  |  121|    722|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    722|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1934:26): [True: 160, False: 722]
  ------------------
 1935|    882|  WienerInfo *ref_wiener_info = &xd->wiener_info[plane];
 1936|    882|  SgrprojInfo *ref_sgrproj_info = &xd->sgrproj_info[plane];
 1937|    882|  RestorationType unit_rtype = rui->restoration_type;
 1938|       |
 1939|    882|  if (frame_rtype == RESTORE_SWITCHABLE) {
  ------------------
  |  Branch (1939:7): [True: 2, False: 880]
  ------------------
 1940|      2|    aom_write_symbol(w, unit_rtype, xd->tile_ctx->switchable_restore_cdf,
 1941|      2|                     RESTORE_SWITCHABLE_TYPES);
 1942|       |#if CONFIG_ENTROPY_STATS
 1943|       |    ++counts->switchable_restore[unit_rtype];
 1944|       |#endif
 1945|      2|    switch (unit_rtype) {
 1946|      1|      case RESTORE_WIENER:
  ------------------
  |  Branch (1946:7): [True: 1, False: 1]
  ------------------
 1947|       |#if DEBUG_LR_COSTING
 1948|       |        assert(!memcmp(
 1949|       |            ref_wiener_info,
 1950|       |            &lr_ref_params[RESTORE_SWITCHABLE][plane][runit_idx].wiener_info,
 1951|       |            sizeof(*ref_wiener_info)));
 1952|       |#endif
 1953|      1|        write_wiener_filter(wiener_win, &rui->wiener_info, ref_wiener_info, w);
 1954|      1|        break;
 1955|      1|      case RESTORE_SGRPROJ:
  ------------------
  |  Branch (1955:7): [True: 1, False: 1]
  ------------------
 1956|       |#if DEBUG_LR_COSTING
 1957|       |        assert(!memcmp(&ref_sgrproj_info->xqd,
 1958|       |                       &lr_ref_params[RESTORE_SWITCHABLE][plane][runit_idx]
 1959|       |                            .sgrproj_info.xqd,
 1960|       |                       sizeof(ref_sgrproj_info->xqd)));
 1961|       |#endif
 1962|      1|        write_sgrproj_filter(&rui->sgrproj_info, ref_sgrproj_info, w);
 1963|      1|        break;
 1964|      0|      default: assert(unit_rtype == RESTORE_NONE); break;
  ------------------
  |  Branch (1964:7): [True: 0, False: 2]
  ------------------
 1965|      2|    }
 1966|    880|  } else if (frame_rtype == RESTORE_WIENER) {
  ------------------
  |  Branch (1966:14): [True: 844, False: 36]
  ------------------
 1967|    844|    aom_write_symbol(w, unit_rtype != RESTORE_NONE,
 1968|    844|                     xd->tile_ctx->wiener_restore_cdf, 2);
 1969|       |#if CONFIG_ENTROPY_STATS
 1970|       |    ++counts->wiener_restore[unit_rtype != RESTORE_NONE];
 1971|       |#endif
 1972|    844|    if (unit_rtype != RESTORE_NONE) {
  ------------------
  |  Branch (1972:9): [True: 794, False: 50]
  ------------------
 1973|       |#if DEBUG_LR_COSTING
 1974|       |      assert(
 1975|       |          !memcmp(ref_wiener_info,
 1976|       |                  &lr_ref_params[RESTORE_WIENER][plane][runit_idx].wiener_info,
 1977|       |                  sizeof(*ref_wiener_info)));
 1978|       |#endif
 1979|    794|      write_wiener_filter(wiener_win, &rui->wiener_info, ref_wiener_info, w);
 1980|    794|    }
 1981|    844|  } else if (frame_rtype == RESTORE_SGRPROJ) {
  ------------------
  |  Branch (1981:14): [True: 36, False: 0]
  ------------------
 1982|     36|    aom_write_symbol(w, unit_rtype != RESTORE_NONE,
 1983|     36|                     xd->tile_ctx->sgrproj_restore_cdf, 2);
 1984|       |#if CONFIG_ENTROPY_STATS
 1985|       |    ++counts->sgrproj_restore[unit_rtype != RESTORE_NONE];
 1986|       |#endif
 1987|     36|    if (unit_rtype != RESTORE_NONE) {
  ------------------
  |  Branch (1987:9): [True: 36, False: 0]
  ------------------
 1988|       |#if DEBUG_LR_COSTING
 1989|       |      assert(!memcmp(
 1990|       |          &ref_sgrproj_info->xqd,
 1991|       |          &lr_ref_params[RESTORE_SGRPROJ][plane][runit_idx].sgrproj_info.xqd,
 1992|       |          sizeof(ref_sgrproj_info->xqd)));
 1993|       |#endif
 1994|     36|      write_sgrproj_filter(&rui->sgrproj_info, ref_sgrproj_info, w);
 1995|     36|    }
 1996|     36|  }
 1997|    882|}
bitstream.c:write_wiener_filter:
 1850|    795|                                       aom_writer *wb) {
 1851|    795|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|    795|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    795|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1851:7): [True: 650, False: 145]
  ------------------
 1852|    650|    aom_write_primitive_refsubexpfin(
 1853|    650|        wb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  159|    650|  (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                      wb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1854|    650|        WIENER_FILT_TAP0_SUBEXP_K,
  ------------------
  |  |  165|    650|#define WIENER_FILT_TAP0_SUBEXP_K 1
  ------------------
 1855|    650|        ref_wiener_info->vfilter[0] - WIENER_FILT_TAP0_MINV,
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1856|    650|        wiener_info->vfilter[0] - WIENER_FILT_TAP0_MINV);
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1857|    145|  else
 1858|    795|    assert(wiener_info->vfilter[0] == 0 &&
 1859|    795|           wiener_info->vfilter[WIENER_WIN - 1] == 0);
 1860|    795|  aom_write_primitive_refsubexpfin(
 1861|    795|      wb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  161|    795|  (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
                    wb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1862|    795|      WIENER_FILT_TAP1_SUBEXP_K,
  ------------------
  |  |  166|    795|#define WIENER_FILT_TAP1_SUBEXP_K 2
  ------------------
 1863|    795|      ref_wiener_info->vfilter[1] - WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1864|    795|      wiener_info->vfilter[1] - WIENER_FILT_TAP1_MINV);
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1865|    795|  aom_write_primitive_refsubexpfin(
 1866|    795|      wb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  163|    795|  (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
                    wb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1867|    795|      WIENER_FILT_TAP2_SUBEXP_K,
  ------------------
  |  |  167|    795|#define WIENER_FILT_TAP2_SUBEXP_K 3
  ------------------
 1868|    795|      ref_wiener_info->vfilter[2] - WIENER_FILT_TAP2_MINV,
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1869|    795|      wiener_info->vfilter[2] - WIENER_FILT_TAP2_MINV);
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1870|    795|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|    795|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|    795|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1870:7): [True: 650, False: 145]
  ------------------
 1871|    650|    aom_write_primitive_refsubexpfin(
 1872|    650|        wb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  159|    650|  (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                      wb, WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1873|    650|        WIENER_FILT_TAP0_SUBEXP_K,
  ------------------
  |  |  165|    650|#define WIENER_FILT_TAP0_SUBEXP_K 1
  ------------------
 1874|    650|        ref_wiener_info->hfilter[0] - WIENER_FILT_TAP0_MINV,
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1875|    650|        wiener_info->hfilter[0] - WIENER_FILT_TAP0_MINV);
  ------------------
  |  |  152|    650|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|    650|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|    650|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1876|    145|  else
 1877|    795|    assert(wiener_info->hfilter[0] == 0 &&
 1878|    795|           wiener_info->hfilter[WIENER_WIN - 1] == 0);
 1879|    795|  aom_write_primitive_refsubexpfin(
 1880|    795|      wb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  161|    795|  (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
                    wb, WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1881|    795|      WIENER_FILT_TAP1_SUBEXP_K,
  ------------------
  |  |  166|    795|#define WIENER_FILT_TAP1_SUBEXP_K 2
  ------------------
 1882|    795|      ref_wiener_info->hfilter[1] - WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1883|    795|      wiener_info->hfilter[1] - WIENER_FILT_TAP1_MINV);
  ------------------
  |  |  154|    795|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|    795|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|    795|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1884|    795|  aom_write_primitive_refsubexpfin(
 1885|    795|      wb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  163|    795|  (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
                    wb, WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1886|    795|      WIENER_FILT_TAP2_SUBEXP_K,
  ------------------
  |  |  167|    795|#define WIENER_FILT_TAP2_SUBEXP_K 3
  ------------------
 1887|    795|      ref_wiener_info->hfilter[2] - WIENER_FILT_TAP2_MINV,
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1888|    795|      wiener_info->hfilter[2] - WIENER_FILT_TAP2_MINV);
  ------------------
  |  |  156|    795|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|    795|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|    795|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1889|    795|  *ref_wiener_info = *wiener_info;
 1890|    795|}
bitstream.c:write_sgrproj_filter:
 1894|     37|                                        aom_writer *wb) {
 1895|     37|  aom_write_literal(wb, sgrproj_info->ep, SGRPROJ_PARAMS_BITS);
  ------------------
  |  |   95|     37|#define SGRPROJ_PARAMS_BITS 4
  ------------------
 1896|     37|  const sgr_params_type *params = &av1_sgr_params[sgrproj_info->ep];
 1897|       |
 1898|     37|  if (params->r[0] == 0) {
  ------------------
  |  Branch (1898:7): [True: 0, False: 37]
  ------------------
 1899|      0|    assert(sgrproj_info->xqd[0] == 0);
 1900|      0|    aom_write_primitive_refsubexpfin(
 1901|      0|        wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  109|      0|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|      0|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
 1902|      0|        ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1903|      0|        sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1);
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1904|     37|  } else if (params->r[1] == 0) {
  ------------------
  |  Branch (1904:14): [True: 0, False: 37]
  ------------------
 1905|      0|    aom_write_primitive_refsubexpfin(
 1906|      0|        wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  107|      0|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|      0|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
 1907|      0|        ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0,
  ------------------
  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1908|      0|        sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0);
  ------------------
  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1909|     37|  } else {
 1910|     37|    aom_write_primitive_refsubexpfin(
 1911|     37|        wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  107|     37|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|     37|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  106|     37|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|     37|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
 1912|     37|        ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0,
  ------------------
  |  |  106|     37|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1913|     37|        sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0);
  ------------------
  |  |  106|     37|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1914|     37|    aom_write_primitive_refsubexpfin(
 1915|     37|        wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  109|     37|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|     37|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  108|     37|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      wb, SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|     37|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
 1916|     37|        ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|     37|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1917|     37|        sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1);
  ------------------
  |  |  108|     37|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|     37|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
 1918|     37|  }
 1919|       |
 1920|     37|  *ref_sgrproj_info = *sgrproj_info;
 1921|     37|}
bitstream.c:write_partition:
 1575|  2.94M|                                   BLOCK_SIZE bsize, aom_writer *w) {
 1576|  2.94M|  const int is_partition_point = bsize >= BLOCK_8X8;
 1577|       |
 1578|  2.94M|  if (!is_partition_point) return;
  ------------------
  |  Branch (1578:7): [True: 38.7k, False: 2.90M]
  ------------------
 1579|       |
 1580|  2.90M|  const int has_rows = (mi_row + hbs) < cm->mi_params.mi_rows;
 1581|  2.90M|  const int has_cols = (mi_col + hbs) < cm->mi_params.mi_cols;
 1582|  2.90M|  const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
 1583|  2.90M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1584|       |
 1585|  2.90M|  if (!has_rows && !has_cols) {
  ------------------
  |  Branch (1585:7): [True: 281k, False: 2.62M]
  |  Branch (1585:20): [True: 121k, False: 159k]
  ------------------
 1586|   121k|    assert(p == PARTITION_SPLIT);
 1587|   121k|    return;
 1588|   121k|  }
 1589|       |
 1590|  2.78M|  if (has_rows && has_cols) {
  ------------------
  |  Branch (1590:7): [True: 2.62M, False: 159k]
  |  Branch (1590:19): [True: 2.46M, False: 161k]
  ------------------
 1591|  2.46M|    aom_write_symbol(w, p, ec_ctx->partition_cdf[ctx],
 1592|  2.46M|                     partition_cdf_length(bsize));
 1593|  2.46M|  } else if (!has_rows && has_cols) {
  ------------------
  |  Branch (1593:14): [True: 159k, False: 160k]
  |  Branch (1593:27): [True: 159k, False: 0]
  ------------------
 1594|   159k|    assert(p == PARTITION_SPLIT || p == PARTITION_HORZ);
 1595|   159k|    assert(bsize > BLOCK_8X8);
 1596|   159k|    aom_cdf_prob cdf[2];
 1597|   159k|    partition_gather_vert_alike(cdf, ec_ctx->partition_cdf[ctx], bsize);
 1598|   159k|    aom_write_cdf(w, p == PARTITION_SPLIT, cdf, 2);
 1599|   160k|  } else {
 1600|   160k|    assert(has_rows && !has_cols);
 1601|   160k|    assert(p == PARTITION_SPLIT || p == PARTITION_VERT);
 1602|       |    assert(bsize > BLOCK_8X8);
 1603|   160k|    aom_cdf_prob cdf[2];
 1604|   160k|    partition_gather_horz_alike(cdf, ec_ctx->partition_cdf[ctx], bsize);
 1605|   160k|    aom_write_cdf(w, p == PARTITION_SPLIT, cdf, 2);
 1606|   160k|  }
 1607|  2.78M|}
bitstream.c:write_modes_b:
 1488|  2.03M|                                 int mi_col) {
 1489|  2.03M|  const AV1_COMMON *cm = &cpi->common;
 1490|  2.03M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1491|  2.03M|  MACROBLOCKD *xd = &td->mb.e_mbd;
 1492|  2.03M|  FRAME_CONTEXT *tile_ctx = xd->tile_ctx;
 1493|  2.03M|  const int grid_idx = mi_row * mi_params->mi_stride + mi_col;
 1494|  2.03M|  xd->mi = mi_params->mi_grid_base + grid_idx;
 1495|  2.03M|  td->mb.mbmi_ext_frame =
 1496|  2.03M|      cpi->mbmi_ext_info.frame_base +
 1497|  2.03M|      get_mi_ext_idx(mi_row, mi_col, cm->mi_params.mi_alloc_bsize,
 1498|  2.03M|                     cpi->mbmi_ext_info.stride);
 1499|  2.03M|  xd->tx_type_map = mi_params->tx_type_map + grid_idx;
 1500|  2.03M|  xd->tx_type_map_stride = mi_params->mi_stride;
 1501|       |
 1502|  2.03M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1503|  2.03M|  const BLOCK_SIZE bsize = mbmi->bsize;
 1504|  2.03M|  assert(bsize <= cm->seq_params->sb_size ||
 1505|  2.03M|         (bsize >= BLOCK_SIZES && bsize < BLOCK_SIZES_ALL));
 1506|       |
 1507|  2.03M|  const int bh = mi_size_high[bsize];
 1508|  2.03M|  const int bw = mi_size_wide[bsize];
 1509|  2.03M|  set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, mi_params->mi_rows,
 1510|  2.03M|                 mi_params->mi_cols);
 1511|       |
 1512|  2.03M|  xd->above_txfm_context = cm->above_contexts.txfm[tile->tile_row] + mi_col;
 1513|  2.03M|  xd->left_txfm_context =
 1514|  2.03M|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  2.03M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  2.03M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.03M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.03M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  2.03M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1515|       |
 1516|  2.03M|  write_mbmi_b(cpi, td, w);
 1517|       |
 1518|  4.85M|  for (int plane = 0; plane < AOMMIN(2, av1_num_planes(cm)); ++plane) {
  ------------------
  |  |   34|  4.85M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.39M, False: 2.46M]
  |  |  ------------------
  ------------------
  |  Branch (1518:23): [True: 2.82M, False: 2.03M]
  ------------------
 1519|  2.82M|    const uint8_t palette_size_plane =
 1520|  2.82M|        mbmi->palette_mode_info.palette_size[plane];
 1521|  2.82M|    assert(!mbmi->skip_mode || !palette_size_plane);
 1522|  2.82M|    if (palette_size_plane > 0) {
  ------------------
  |  Branch (1522:9): [True: 66.9k, False: 2.76M]
  ------------------
 1523|  66.9k|      assert(mbmi->use_intrabc == 0);
 1524|  66.9k|      assert(av1_allow_palette(cm->features.allow_screen_content_tools,
 1525|  66.9k|                               mbmi->bsize));
 1526|  66.9k|      assert(!plane || xd->is_chroma_ref);
 1527|  66.9k|      int rows, cols;
 1528|  66.9k|      av1_get_block_dimensions(mbmi->bsize, plane, xd, NULL, NULL, &rows,
 1529|  66.9k|                               &cols);
 1530|  66.9k|      assert(*tok < tok_end);
 1531|  66.9k|      MapCdf map_pb_cdf = plane ? tile_ctx->palette_uv_color_index_cdf
  ------------------
  |  Branch (1531:27): [True: 24.7k, False: 42.2k]
  ------------------
 1532|  66.9k|                                : tile_ctx->palette_y_color_index_cdf;
 1533|  66.9k|      pack_map_tokens(w, tok, palette_size_plane, rows * cols, map_pb_cdf);
 1534|  66.9k|    }
 1535|  2.82M|  }
 1536|       |
 1537|  2.03M|  const int is_inter_tx = is_inter_block(mbmi);
 1538|  2.03M|  const int skip_txfm = mbmi->skip_txfm;
 1539|  2.03M|  const uint8_t segment_id = mbmi->segment_id;
 1540|  2.03M|  if (cm->features.tx_mode == TX_MODE_SELECT && block_signals_txsize(bsize) &&
  ------------------
  |  Branch (1540:7): [True: 1.68M, False: 345k]
  |  Branch (1540:49): [True: 1.65M, False: 32.3k]
  ------------------
 1541|  1.65M|      !(is_inter_tx && skip_txfm) && !xd->lossless[segment_id]) {
  ------------------
  |  Branch (1541:9): [True: 344k, False: 1.30M]
  |  Branch (1541:24): [True: 22.2k, False: 322k]
  |  Branch (1541:38): [True: 1.63M, False: 18.4E]
  ------------------
 1542|  1.63M|    if (is_inter_tx) {  // This implies skip flag is 0.
  ------------------
  |  Branch (1542:9): [True: 322k, False: 1.30M]
  ------------------
 1543|   322k|      const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, bsize, 0);
 1544|   322k|      const int txbh = tx_size_high_unit[max_tx_size];
 1545|   322k|      const int txbw = tx_size_wide_unit[max_tx_size];
 1546|   322k|      const int width = mi_size_wide[bsize];
 1547|   322k|      const int height = mi_size_high[bsize];
 1548|   644k|      for (int idy = 0; idy < height; idy += txbh) {
  ------------------
  |  Branch (1548:25): [True: 322k, False: 322k]
  ------------------
 1549|   644k|        for (int idx = 0; idx < width; idx += txbw) {
  ------------------
  |  Branch (1549:27): [True: 322k, False: 322k]
  ------------------
 1550|   322k|          write_tx_size_vartx(xd, mbmi, max_tx_size, 0, idy, idx, w);
 1551|   322k|        }
 1552|   322k|      }
 1553|  1.30M|    } else {
 1554|  1.30M|      write_selected_tx_size(xd, w);
 1555|  1.30M|      set_txfm_ctxs(mbmi->tx_size, xd->width, xd->height, 0, xd);
 1556|  1.30M|    }
 1557|  1.63M|  } else {
 1558|   399k|    set_txfm_ctxs(mbmi->tx_size, xd->width, xd->height,
 1559|   399k|                  skip_txfm && is_inter_tx, xd);
  ------------------
  |  Branch (1559:19): [True: 42.5k, False: 357k]
  |  Branch (1559:32): [True: 42.5k, False: 18.4E]
  ------------------
 1560|   399k|  }
 1561|       |
 1562|  2.03M|  if (!mbmi->skip_txfm) {
  ------------------
  |  Branch (1562:7): [True: 1.98M, False: 48.0k]
  ------------------
 1563|  1.98M|    int start = aom_tell_size(w);
 1564|       |
 1565|  1.98M|    write_tokens_b(cpi, &td->mb, w, tok, tok_end);
 1566|       |
 1567|  1.98M|    const int end = aom_tell_size(w);
 1568|  1.98M|    td->coefficient_size += end - start;
 1569|  1.98M|  }
 1570|  2.03M|}
bitstream.c:write_mbmi_b:
 1374|  2.03M|                                aom_writer *w) {
 1375|  2.03M|  AV1_COMMON *const cm = &cpi->common;
 1376|  2.03M|  MACROBLOCKD *const xd = &td->mb.e_mbd;
 1377|  2.03M|  MB_MODE_INFO *m = xd->mi[0];
 1378|       |
 1379|  2.03M|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (1379:7): [True: 164k, False: 1.87M]
  ------------------
 1380|   164k|    write_mb_modes_kf(cpi, xd, td->mb.mbmi_ext_frame, w);
 1381|  1.87M|  } else {
 1382|       |    // has_subpel_mv_component needs the ref frame buffers set up to look
 1383|       |    // up if they are scaled. has_subpel_mv_component is in turn needed by
 1384|       |    // write_switchable_interp_filter, which is called by pack_inter_mode_mvs.
 1385|  1.87M|    set_ref_ptrs(cm, xd, m->ref_frame[0], m->ref_frame[1]);
 1386|       |
 1387|       |#if ENC_MISMATCH_DEBUG
 1388|       |    enc_dump_logs(cm, &cpi->mbmi_ext_info, xd->mi_row, xd->mi_col);
 1389|       |#endif  // ENC_MISMATCH_DEBUG
 1390|       |
 1391|  1.87M|    pack_inter_mode_mvs(cpi, td, w);
 1392|  1.87M|  }
 1393|  2.03M|}
bitstream.c:write_mb_modes_kf:
 1269|   164k|    const MB_MODE_INFO_EXT_FRAME *mbmi_ext_frame, aom_writer *w) {
 1270|   164k|  AV1_COMMON *const cm = &cpi->common;
 1271|   164k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1272|   164k|  const struct segmentation *const seg = &cm->seg;
 1273|   164k|  struct segmentation_probs *const segp = &ec_ctx->seg;
 1274|   164k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1275|       |
 1276|   164k|  if (seg->segid_preskip && seg->update_map)
  ------------------
  |  Branch (1276:7): [True: 0, False: 164k]
  |  Branch (1276:29): [True: 0, False: 0]
  ------------------
 1277|      0|    write_segment_id(cpi, xd, mbmi, w, seg, segp, 0);
 1278|       |
 1279|   164k|  const int skip = write_skip(cm, xd, mbmi->segment_id, mbmi, w);
 1280|       |
 1281|   164k|  if (!seg->segid_preskip && seg->update_map)
  ------------------
  |  Branch (1281:7): [True: 163k, False: 183]
  |  Branch (1281:30): [True: 0, False: 163k]
  ------------------
 1282|      0|    write_segment_id(cpi, xd, mbmi, w, seg, segp, skip);
 1283|       |
 1284|   164k|  write_cdef(cm, xd, w, skip);
 1285|       |
 1286|   164k|  write_delta_q_params(cm, xd, skip, w);
 1287|       |
 1288|   164k|  if (av1_allow_intrabc(cm)) {
  ------------------
  |  Branch (1288:7): [True: 0, False: 164k]
  ------------------
 1289|      0|    write_intrabc_info(xd, mbmi_ext_frame, w);
 1290|      0|    if (is_intrabc_block(mbmi)) return;
  ------------------
  |  Branch (1290:9): [True: 0, False: 0]
  ------------------
 1291|      0|  }
 1292|       |
 1293|   164k|  write_intra_prediction_modes(cm, xd, 1, w);
 1294|   164k|}
bitstream.c:write_skip:
  227|  2.03M|                      aom_writer *w) {
  228|  2.03M|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (228:7): [True: 0, False: 2.03M]
  ------------------
  229|      0|    return 1;
  230|  2.03M|  } else {
  231|  2.03M|    const int skip_txfm = mi->skip_txfm;
  232|  2.03M|    const int ctx = av1_get_skip_txfm_context(xd);
  233|  2.03M|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  234|  2.03M|    aom_write_symbol(w, skip_txfm, ec_ctx->skip_txfm_cdfs[ctx], 2);
  235|  2.03M|    return skip_txfm;
  236|  2.03M|  }
  237|  2.03M|}
bitstream.c:write_cdef:
  881|  2.02M|                              aom_writer *w, int skip) {
  882|  2.02M|  if (cm->features.coded_lossless || cm->features.allow_intrabc) return;
  ------------------
  |  Branch (882:7): [True: 74.4k, False: 1.95M]
  |  Branch (882:38): [True: 18.4E, False: 1.95M]
  ------------------
  883|       |
  884|       |  // At the start of a superblock, mark that we haven't yet written CDEF
  885|       |  // strengths for any of the CDEF units contained in this superblock.
  886|  1.95M|  const int sb_mask = (cm->seq_params->mib_size - 1);
  887|  1.95M|  const int mi_row_in_sb = (xd->mi_row & sb_mask);
  888|  1.95M|  const int mi_col_in_sb = (xd->mi_col & sb_mask);
  889|  1.95M|  if (mi_row_in_sb == 0 && mi_col_in_sb == 0) {
  ------------------
  |  Branch (889:7): [True: 466k, False: 1.48M]
  |  Branch (889:28): [True: 131k, False: 334k]
  ------------------
  890|   131k|    xd->cdef_transmitted[0] = xd->cdef_transmitted[1] =
  891|   131k|        xd->cdef_transmitted[2] = xd->cdef_transmitted[3] = false;
  892|   131k|  }
  893|       |
  894|       |  // CDEF unit size is 64x64 irrespective of the superblock size.
  895|  1.95M|  const int cdef_size = 1 << (6 - MI_SIZE_LOG2);
  ------------------
  |  |   39|  1.95M|#define MI_SIZE_LOG2 2
  ------------------
  896|       |
  897|       |  // Find index of this CDEF unit in this superblock.
  898|  1.95M|  const int index_mask = cdef_size;
  899|  1.95M|  const int cdef_unit_row_in_sb = ((xd->mi_row & index_mask) != 0);
  900|  1.95M|  const int cdef_unit_col_in_sb = ((xd->mi_col & index_mask) != 0);
  901|  1.95M|  const int index = (cm->seq_params->sb_size == BLOCK_128X128)
  ------------------
  |  Branch (901:21): [True: 0, False: 1.95M]
  ------------------
  902|  1.95M|                        ? cdef_unit_col_in_sb + 2 * cdef_unit_row_in_sb
  903|  1.95M|                        : 0;
  904|       |
  905|       |  // Write CDEF strength to the first non-skip coding block in this CDEF unit.
  906|  1.95M|  if (!xd->cdef_transmitted[index] && !skip) {
  ------------------
  |  Branch (906:7): [True: 148k, False: 1.80M]
  |  Branch (906:39): [True: 129k, False: 19.6k]
  ------------------
  907|       |    // CDEF strength for this CDEF unit needs to be stored in the MB_MODE_INFO
  908|       |    // of the 1st block in this CDEF unit.
  909|   129k|    const int first_block_mask = ~(cdef_size - 1);
  910|   129k|    const CommonModeInfoParams *const mi_params = &cm->mi_params;
  911|   129k|    const int grid_idx =
  912|   129k|        get_mi_grid_idx(mi_params, xd->mi_row & first_block_mask,
  913|   129k|                        xd->mi_col & first_block_mask);
  914|   129k|    const MB_MODE_INFO *const mbmi = mi_params->mi_grid_base[grid_idx];
  915|   129k|    aom_write_literal(w, mbmi->cdef_strength, cm->cdef_info.cdef_bits);
  916|       |    xd->cdef_transmitted[index] = true;
  917|   129k|  }
  918|  1.95M|}
bitstream.c:write_delta_q_params:
  962|  2.03M|                                        aom_writer *w) {
  963|  2.03M|  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
  964|       |
  965|  2.03M|  if (delta_q_info->delta_q_present_flag) {
  ------------------
  |  Branch (965:7): [True: 273k, False: 1.75M]
  ------------------
  966|   273k|    const MB_MODE_INFO *const mbmi = xd->mi[0];
  967|   273k|    const BLOCK_SIZE bsize = mbmi->bsize;
  968|   273k|    const int super_block_upper_left =
  969|   273k|        ((xd->mi_row & (cm->seq_params->mib_size - 1)) == 0) &&
  ------------------
  |  Branch (969:9): [True: 101k, False: 172k]
  ------------------
  970|   101k|        ((xd->mi_col & (cm->seq_params->mib_size - 1)) == 0);
  ------------------
  |  Branch (970:9): [True: 42.7k, False: 58.4k]
  ------------------
  971|       |
  972|   273k|    if ((bsize != cm->seq_params->sb_size || skip == 0) &&
  ------------------
  |  Branch (972:10): [True: 272k, False: 316]
  |  Branch (972:46): [True: 298, False: 18]
  ------------------
  973|   273k|        super_block_upper_left) {
  ------------------
  |  Branch (973:9): [True: 42.6k, False: 230k]
  ------------------
  974|  42.6k|      assert(mbmi->current_qindex > 0);
  975|  42.6k|      const int reduced_delta_qindex =
  976|  42.6k|          (mbmi->current_qindex - xd->current_base_qindex) /
  977|  42.6k|          delta_q_info->delta_q_res;
  978|  42.6k|      write_delta_qindex(xd, reduced_delta_qindex, w);
  979|  42.6k|      xd->current_base_qindex = mbmi->current_qindex;
  980|  42.6k|      if (delta_q_info->delta_lf_present_flag) {
  ------------------
  |  Branch (980:11): [True: 0, False: 42.6k]
  ------------------
  981|      0|        if (delta_q_info->delta_lf_multi) {
  ------------------
  |  Branch (981:13): [True: 0, False: 0]
  ------------------
  982|      0|          const int frame_lf_count =
  983|      0|              av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
                            av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (983:15): [True: 0, False: 0]
  ------------------
  984|      0|          for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) {
  ------------------
  |  Branch (984:31): [True: 0, False: 0]
  ------------------
  985|      0|            int reduced_delta_lflevel =
  986|      0|                (mbmi->delta_lf[lf_id] - xd->delta_lf[lf_id]) /
  987|      0|                delta_q_info->delta_lf_res;
  988|      0|            write_delta_lflevel(cm, xd, lf_id, reduced_delta_lflevel, 1, w);
  989|      0|            xd->delta_lf[lf_id] = mbmi->delta_lf[lf_id];
  990|      0|          }
  991|      0|        } else {
  992|      0|          int reduced_delta_lflevel =
  993|      0|              (mbmi->delta_lf_from_base - xd->delta_lf_from_base) /
  994|      0|              delta_q_info->delta_lf_res;
  995|      0|          write_delta_lflevel(cm, xd, -1, reduced_delta_lflevel, 0, w);
  996|      0|          xd->delta_lf_from_base = mbmi->delta_lf_from_base;
  997|      0|        }
  998|      0|      }
  999|  42.6k|    }
 1000|   273k|  }
 1001|  2.03M|}
bitstream.c:write_delta_qindex:
  300|  42.6k|                                      aom_writer *w) {
  301|  42.6k|  int sign = delta_qindex < 0;
  302|  42.6k|  int abs = sign ? -delta_qindex : delta_qindex;
  ------------------
  |  Branch (302:13): [True: 34.9k, False: 7.74k]
  ------------------
  303|  42.6k|  int rem_bits, thr;
  304|  42.6k|  int smallval = abs < DELTA_Q_SMALL ? 1 : 0;
  ------------------
  |  |  497|  42.6k|#define DELTA_Q_SMALL 3
  ------------------
  |  Branch (304:18): [True: 18.1k, False: 24.5k]
  ------------------
  305|  42.6k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  306|       |
  307|  42.6k|  aom_write_symbol(w, AOMMIN(abs, DELTA_Q_SMALL), ec_ctx->delta_q_cdf,
  ------------------
  |  |   34|  42.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.1k, False: 24.4k]
  |  |  ------------------
  ------------------
  308|  42.6k|                   DELTA_Q_PROBS + 1);
  ------------------
  |  |  498|  42.6k|#define DELTA_Q_PROBS (DELTA_Q_SMALL)
  |  |  ------------------
  |  |  |  |  497|  42.6k|#define DELTA_Q_SMALL 3
  |  |  ------------------
  ------------------
  309|       |
  310|  42.6k|  if (!smallval) {
  ------------------
  |  Branch (310:7): [True: 24.5k, False: 18.1k]
  ------------------
  311|  24.5k|    rem_bits = get_msb(abs - 1);
  312|  24.5k|    thr = (1 << rem_bits) + 1;
  313|  24.5k|    aom_write_literal(w, rem_bits - 1, 3);
  314|  24.5k|    aom_write_literal(w, abs - thr, rem_bits);
  315|  24.5k|  }
  316|  42.6k|  if (abs > 0) {
  ------------------
  |  Branch (316:7): [True: 35.0k, False: 7.64k]
  ------------------
  317|  35.0k|    aom_write_bit(w, sign);
  318|  35.0k|  }
  319|  42.6k|}
bitstream.c:write_intra_prediction_modes:
 1006|  1.51M|                                                aom_writer *w) {
 1007|  1.51M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1008|  1.51M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1009|  1.51M|  const PREDICTION_MODE mode = mbmi->mode;
 1010|  1.51M|  const BLOCK_SIZE bsize = mbmi->bsize;
 1011|       |
 1012|       |  // Y mode.
 1013|  1.51M|  if (is_keyframe) {
  ------------------
  |  Branch (1013:7): [True: 163k, False: 1.35M]
  ------------------
 1014|   163k|    const MB_MODE_INFO *const above_mi = xd->above_mbmi;
 1015|   163k|    const MB_MODE_INFO *const left_mi = xd->left_mbmi;
 1016|   163k|    write_intra_y_mode_kf(ec_ctx, mbmi, above_mi, left_mi, mode, w);
 1017|  1.35M|  } else {
 1018|  1.35M|    write_intra_y_mode_nonkf(ec_ctx, bsize, mode, w);
 1019|  1.35M|  }
 1020|       |
 1021|       |  // Y angle delta.
 1022|  1.51M|  const int use_angle_delta = av1_use_angle_delta(bsize);
 1023|  1.51M|  if (use_angle_delta && av1_is_directional_mode(mode)) {
  ------------------
  |  Branch (1023:7): [True: 1.47M, False: 47.4k]
  |  Branch (1023:26): [True: 110k, False: 1.36M]
  ------------------
 1024|   110k|    write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_Y],
 1025|   110k|                      ec_ctx->angle_delta_cdf[mode - V_PRED]);
 1026|   110k|  }
 1027|       |
 1028|       |  // UV mode and UV angle delta.
 1029|  1.51M|  if (!cm->seq_params->monochrome && xd->is_chroma_ref) {
  ------------------
  |  Branch (1029:7): [True: 662k, False: 856k]
  |  Branch (1029:38): [True: 651k, False: 11.7k]
  ------------------
 1030|   651k|    const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
 1031|   651k|    write_intra_uv_mode(ec_ctx, uv_mode, mode, is_cfl_allowed(xd), w);
 1032|   651k|    if (uv_mode == UV_CFL_PRED)
  ------------------
  |  Branch (1032:9): [True: 232k, False: 418k]
  ------------------
 1033|   232k|      write_cfl_alphas(ec_ctx, mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, w);
 1034|   651k|    const PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
 1035|   651k|    if (use_angle_delta && av1_is_directional_mode(intra_mode)) {
  ------------------
  |  Branch (1035:9): [True: 624k, False: 26.8k]
  |  Branch (1035:28): [True: 46.4k, False: 577k]
  ------------------
 1036|  46.4k|      write_angle_delta(w, mbmi->angle_delta[PLANE_TYPE_UV],
 1037|  46.4k|                        ec_ctx->angle_delta_cdf[intra_mode - V_PRED]);
 1038|  46.4k|    }
 1039|   651k|  }
 1040|       |
 1041|       |  // Palette.
 1042|  1.51M|  if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize)) {
  ------------------
  |  Branch (1042:7): [True: 61.5k, False: 1.45M]
  ------------------
 1043|  61.5k|    write_palette_mode_info(cm, xd, mbmi, w);
 1044|  61.5k|  }
 1045|       |
 1046|       |  // Filter intra.
 1047|  1.51M|  write_filter_intra_mode_info(cm, xd, mbmi, w);
 1048|  1.51M|}
bitstream.c:write_intra_y_mode_kf:
   80|   163k|                                         PREDICTION_MODE mode, aom_writer *w) {
   81|       |  assert(!is_intrabc_block(mi));
   82|   163k|  (void)mi;
   83|   163k|  aom_write_symbol(w, mode, get_y_mode_cdf(frame_ctx, above_mi, left_mi),
   84|   163k|                   INTRA_MODES);
   85|   163k|}
bitstream.c:write_intra_y_mode_nonkf:
  852|  1.35M|                                            aom_writer *w) {
  853|  1.35M|  aom_write_symbol(w, mode, frame_ctx->y_mode_cdf[size_group_lookup[bsize]],
  854|  1.35M|                   INTRA_MODES);
  855|  1.35M|}
bitstream.c:write_angle_delta:
  620|   156k|                                     aom_cdf_prob *cdf) {
  621|   156k|  aom_write_symbol(w, angle_delta + MAX_ANGLE_DELTA, cdf,
  ------------------
  |  |  467|   156k|#define MAX_ANGLE_DELTA 3
  ------------------
  622|   156k|                   2 * MAX_ANGLE_DELTA + 1);
  ------------------
  |  |  467|   156k|#define MAX_ANGLE_DELTA 3
  ------------------
  623|   156k|}
bitstream.c:write_intra_uv_mode:
  861|   651k|                                       aom_writer *w) {
  862|   651k|  aom_write_symbol(w, uv_mode, frame_ctx->uv_mode_cdf[cfl_allowed][y_mode],
  863|   651k|                   UV_INTRA_MODES - !cfl_allowed);
  864|   651k|}
bitstream.c:write_cfl_alphas:
  867|   232k|                                    int8_t joint_sign, aom_writer *w) {
  868|   232k|  aom_write_symbol(w, joint_sign, ec_ctx->cfl_sign_cdf, CFL_JOINT_SIGNS);
  ------------------
  |  |  279|   232k|#define CFL_JOINT_SIGNS (CFL_SIGNS * CFL_SIGNS - 1)
  ------------------
  869|       |  // Magnitudes are only signaled for nonzero codes.
  870|   232k|  if (CFL_SIGN_U(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  281|   232k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  ------------------
  |  Branch (870:7): [True: 215k, False: 16.4k]
  ------------------
  871|   215k|    aom_cdf_prob *cdf_u = ec_ctx->cfl_alpha_cdf[CFL_CONTEXT_U(joint_sign)];
  ------------------
  |  |  288|   215k|#define CFL_CONTEXT_U(js) (js + 1 - CFL_SIGNS)
  ------------------
  872|   215k|    aom_write_symbol(w, CFL_IDX_U(idx), cdf_u, CFL_ALPHABET_SIZE);
  ------------------
  |  |  260|   215k|#define CFL_IDX_U(idx) (idx >> CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   215k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
                  aom_write_symbol(w, CFL_IDX_U(idx), cdf_u, CFL_ALPHABET_SIZE);
  ------------------
  |  |  257|   215k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   215k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  873|   215k|  }
  874|   232k|  if (CFL_SIGN_V(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  283|   232k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  ------------------
  |  |  |  |  281|   232k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  |  Branch (874:7): [True: 206k, False: 26.0k]
  ------------------
  875|   206k|    aom_cdf_prob *cdf_v = ec_ctx->cfl_alpha_cdf[CFL_CONTEXT_V(joint_sign)];
  ------------------
  |  |  291|   206k|  (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  283|   206k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  |  |  ------------------
  |  |  |  |  |  |  281|   206k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  281|   206k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  876|   206k|    aom_write_symbol(w, CFL_IDX_V(idx), cdf_v, CFL_ALPHABET_SIZE);
  ------------------
  |  |  261|   206k|#define CFL_IDX_V(idx) (idx & (CFL_ALPHABET_SIZE - 1))
  |  |  ------------------
  |  |  |  |  257|   206k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|   206k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  aom_write_symbol(w, CFL_IDX_V(idx), cdf_v, CFL_ALPHABET_SIZE);
  ------------------
  |  |  257|   206k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   206k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  877|   206k|  }
  878|   232k|}
bitstream.c:write_palette_mode_info:
  773|  61.5k|                                           aom_writer *w) {
  774|  61.5k|  const int num_planes = av1_num_planes(cm);
  775|  61.5k|  const BLOCK_SIZE bsize = mbmi->bsize;
  776|  61.5k|  assert(av1_allow_palette(cm->features.allow_screen_content_tools, bsize));
  777|  61.5k|  const PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  778|  61.5k|  const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  779|       |
  780|  61.5k|  if (mbmi->mode == DC_PRED) {
  ------------------
  |  Branch (780:7): [True: 59.1k, False: 2.39k]
  ------------------
  781|  59.1k|    const int n = pmi->palette_size[0];
  782|  59.1k|    const int palette_y_mode_ctx = av1_get_palette_mode_ctx(xd);
  783|  59.1k|    aom_write_symbol(
  784|  59.1k|        w, n > 0,
  785|  59.1k|        xd->tile_ctx->palette_y_mode_cdf[bsize_ctx][palette_y_mode_ctx], 2);
  786|  59.1k|    if (n > 0) {
  ------------------
  |  Branch (786:9): [True: 42.2k, False: 16.8k]
  ------------------
  787|  42.2k|      aom_write_symbol(w, n - PALETTE_MIN_SIZE,
  ------------------
  |  |   65|  42.2k|#define PALETTE_MIN_SIZE 2
  ------------------
  788|  42.2k|                       xd->tile_ctx->palette_y_size_cdf[bsize_ctx],
  789|  42.2k|                       PALETTE_SIZES);
  790|  42.2k|      write_palette_colors_y(xd, pmi, cm->seq_params->bit_depth, w);
  791|  42.2k|    }
  792|  59.1k|  }
  793|       |
  794|  61.5k|  const int uv_dc_pred =
  795|  61.5k|      num_planes > 1 && mbmi->uv_mode == UV_DC_PRED && xd->is_chroma_ref;
  ------------------
  |  Branch (795:7): [True: 46.1k, False: 15.3k]
  |  Branch (795:25): [True: 33.0k, False: 13.0k]
  |  Branch (795:56): [True: 33.0k, False: 18.4E]
  ------------------
  796|  61.5k|  if (uv_dc_pred) {
  ------------------
  |  Branch (796:7): [True: 33.0k, False: 28.4k]
  ------------------
  797|  33.0k|    const int n = pmi->palette_size[1];
  798|  33.0k|    const int palette_uv_mode_ctx = (pmi->palette_size[0] > 0);
  799|  33.0k|    aom_write_symbol(w, n > 0,
  800|  33.0k|                     xd->tile_ctx->palette_uv_mode_cdf[palette_uv_mode_ctx], 2);
  801|  33.0k|    if (n > 0) {
  ------------------
  |  Branch (801:9): [True: 24.7k, False: 8.29k]
  ------------------
  802|  24.7k|      aom_write_symbol(w, n - PALETTE_MIN_SIZE,
  ------------------
  |  |   65|  24.7k|#define PALETTE_MIN_SIZE 2
  ------------------
  803|  24.7k|                       xd->tile_ctx->palette_uv_size_cdf[bsize_ctx],
  804|  24.7k|                       PALETTE_SIZES);
  805|  24.7k|      write_palette_colors_uv(xd, pmi, cm->seq_params->bit_depth, w);
  806|  24.7k|    }
  807|  33.0k|  }
  808|  61.5k|}
bitstream.c:write_palette_colors_y:
  689|  42.2k|                                          int bit_depth, aom_writer *w) {
  690|  42.2k|  const int n = pmi->palette_size[0];
  691|  42.2k|  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  692|  42.2k|  const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
  693|  42.2k|  int out_cache_colors[PALETTE_MAX_SIZE];
  694|  42.2k|  uint8_t cache_color_found[2 * PALETTE_MAX_SIZE];
  695|  42.2k|  const int n_out_cache =
  696|  42.2k|      av1_index_color_cache(color_cache, n_cache, pmi->palette_colors, n,
  697|  42.2k|                            cache_color_found, out_cache_colors);
  698|  42.2k|  int n_in_cache = 0;
  699|   244k|  for (int i = 0; i < n_cache && n_in_cache < n; ++i) {
  ------------------
  |  Branch (699:19): [True: 202k, False: 41.9k]
  |  Branch (699:34): [True: 202k, False: 310]
  ------------------
  700|   202k|    const int found = cache_color_found[i];
  701|   202k|    aom_write_bit(w, found);
  702|   202k|    n_in_cache += found;
  703|   202k|  }
  704|       |  assert(n_in_cache + n_out_cache == n);
  705|  42.2k|  delta_encode_palette_colors(out_cache_colors, n_out_cache, bit_depth, 1, w);
  706|  42.2k|}
bitstream.c:delta_encode_palette_colors:
  657|  66.9k|                                               aom_writer *w) {
  658|  66.9k|  if (num <= 0) return;
  ------------------
  |  Branch (658:7): [True: 7.87k, False: 59.0k]
  ------------------
  659|  66.9k|  assert(colors[0] < (1 << bit_depth));
  660|  59.0k|  aom_write_literal(w, colors[0], bit_depth);
  661|  59.0k|  if (num == 1) return;
  ------------------
  |  Branch (661:7): [True: 9.66k, False: 49.3k]
  ------------------
  662|  49.3k|  int max_delta = 0;
  663|  49.3k|  int deltas[PALETTE_MAX_SIZE];
  664|  49.3k|  memset(deltas, 0, sizeof(deltas));
  665|   185k|  for (int i = 1; i < num; ++i) {
  ------------------
  |  Branch (665:19): [True: 136k, False: 49.3k]
  ------------------
  666|   136k|    assert(colors[i] < (1 << bit_depth));
  667|   136k|    const int delta = colors[i] - colors[i - 1];
  668|   136k|    deltas[i - 1] = delta;
  669|   136k|    assert(delta >= min_val);
  670|   136k|    if (delta > max_delta) max_delta = delta;
  ------------------
  |  Branch (670:9): [True: 80.7k, False: 55.4k]
  ------------------
  671|   136k|  }
  672|  49.3k|  const int min_bits = bit_depth - 3;
  673|  49.3k|  int bits = AOMMAX(aom_ceil_log2(max_delta + 1 - min_val), min_bits);
  ------------------
  |  |   35|  49.3k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 46.7k, False: 2.68k]
  |  |  ------------------
  ------------------
  674|  49.3k|  assert(bits <= bit_depth);
  675|  49.3k|  int range = (1 << bit_depth) - colors[0] - min_val;
  676|  49.3k|  aom_write_literal(w, bits - min_bits, 2);
  677|   185k|  for (int i = 0; i < num - 1; ++i) {
  ------------------
  |  Branch (677:19): [True: 135k, False: 49.3k]
  ------------------
  678|   135k|    aom_write_literal(w, deltas[i] - min_val, bits);
  679|   135k|    range -= deltas[i];
  680|   135k|    bits = AOMMIN(bits, aom_ceil_log2(range));
  ------------------
  |  |   34|   135k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 59.1k, False: 76.6k]
  |  |  ------------------
  ------------------
  681|   135k|  }
  682|  49.3k|}
bitstream.c:write_palette_colors_uv:
  713|  24.7k|                                           int bit_depth, aom_writer *w) {
  714|  24.7k|  const int n = pmi->palette_size[1];
  715|  24.7k|  const uint16_t *colors_u = pmi->palette_colors + PALETTE_MAX_SIZE;
  ------------------
  |  |   63|  24.7k|#define PALETTE_MAX_SIZE 8
  ------------------
  716|  24.7k|  const uint16_t *colors_v = pmi->palette_colors + 2 * PALETTE_MAX_SIZE;
  ------------------
  |  |   63|  24.7k|#define PALETTE_MAX_SIZE 8
  ------------------
  717|       |  // U channel colors.
  718|  24.7k|  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  719|  24.7k|  const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  720|  24.7k|  int out_cache_colors[PALETTE_MAX_SIZE];
  721|  24.7k|  uint8_t cache_color_found[2 * PALETTE_MAX_SIZE];
  722|  24.7k|  const int n_out_cache = av1_index_color_cache(
  723|  24.7k|      color_cache, n_cache, colors_u, n, cache_color_found, out_cache_colors);
  724|  24.7k|  int n_in_cache = 0;
  725|   135k|  for (int i = 0; i < n_cache && n_in_cache < n; ++i) {
  ------------------
  |  Branch (725:19): [True: 110k, False: 24.6k]
  |  Branch (725:34): [True: 110k, False: 132]
  ------------------
  726|   110k|    const int found = cache_color_found[i];
  727|   110k|    aom_write_bit(w, found);
  728|   110k|    n_in_cache += found;
  729|   110k|  }
  730|  24.7k|  delta_encode_palette_colors(out_cache_colors, n_out_cache, bit_depth, 0, w);
  731|       |
  732|       |  // V channel colors. Don't use color cache as the colors are not sorted.
  733|  24.7k|  const int max_val = 1 << bit_depth;
  734|  24.7k|  int zero_count = 0, min_bits_v = 0;
  735|  24.7k|  int bits_v =
  736|  24.7k|      av1_get_palette_delta_bits_v(pmi, bit_depth, &zero_count, &min_bits_v);
  737|  24.7k|  const int rate_using_delta =
  738|  24.7k|      2 + bit_depth + (bits_v + 1) * (n - 1) - zero_count;
  739|  24.7k|  const int rate_using_raw = bit_depth * n;
  740|  24.7k|  if (rate_using_delta < rate_using_raw) {  // delta encoding
  ------------------
  |  Branch (740:7): [True: 8.73k, False: 16.0k]
  ------------------
  741|  8.73k|    assert(colors_v[0] < (1 << bit_depth));
  742|  8.73k|    aom_write_bit(w, 1);
  743|  8.73k|    aom_write_literal(w, bits_v - min_bits_v, 2);
  744|  8.73k|    aom_write_literal(w, colors_v[0], bit_depth);
  745|  35.6k|    for (int i = 1; i < n; ++i) {
  ------------------
  |  Branch (745:21): [True: 26.9k, False: 8.73k]
  ------------------
  746|  26.9k|      assert(colors_v[i] < (1 << bit_depth));
  747|  26.9k|      if (colors_v[i] == colors_v[i - 1]) {  // No need to signal sign bit.
  ------------------
  |  Branch (747:11): [True: 1.54k, False: 25.3k]
  ------------------
  748|  1.54k|        aom_write_literal(w, 0, bits_v);
  749|  1.54k|        continue;
  750|  1.54k|      }
  751|  25.3k|      const int delta = abs((int)colors_v[i] - colors_v[i - 1]);
  752|  25.3k|      const int sign_bit = colors_v[i] < colors_v[i - 1];
  753|  25.3k|      if (delta <= max_val - delta) {
  ------------------
  |  Branch (753:11): [True: 6.04k, False: 19.3k]
  ------------------
  754|  6.04k|        aom_write_literal(w, delta, bits_v);
  755|  6.04k|        aom_write_bit(w, sign_bit);
  756|  19.3k|      } else {
  757|  19.3k|        aom_write_literal(w, max_val - delta, bits_v);
  758|  19.3k|        aom_write_bit(w, !sign_bit);
  759|  19.3k|      }
  760|  25.3k|    }
  761|  16.0k|  } else {  // Transmit raw values.
  762|  16.0k|    aom_write_bit(w, 0);
  763|   100k|    for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (763:21): [True: 84.9k, False: 16.0k]
  ------------------
  764|       |      assert(colors_v[i] < (1 << bit_depth));
  765|  84.9k|      aom_write_literal(w, colors_v[i], bit_depth);
  766|  84.9k|    }
  767|  16.0k|  }
  768|  24.7k|}
bitstream.c:write_filter_intra_mode_info:
  606|  1.52M|                                                aom_writer *w) {
  607|  1.52M|  if (av1_filter_intra_allowed(cm, mbmi)) {
  ------------------
  |  Branch (607:7): [True: 1.32M, False: 193k]
  ------------------
  608|  1.32M|    aom_write_symbol(w, mbmi->filter_intra_mode_info.use_filter_intra,
  609|  1.32M|                     xd->tile_ctx->filter_intra_cdfs[mbmi->bsize], 2);
  610|  1.32M|    if (mbmi->filter_intra_mode_info.use_filter_intra) {
  ------------------
  |  Branch (610:9): [True: 616k, False: 713k]
  ------------------
  611|   616k|      const FILTER_INTRA_MODE mode =
  612|   616k|          mbmi->filter_intra_mode_info.filter_intra_mode;
  613|   616k|      aom_write_symbol(w, mode, xd->tile_ctx->filter_intra_mode_cdf,
  614|   616k|                       FILTER_INTRA_MODES);
  615|   616k|    }
  616|  1.32M|  }
  617|  1.52M|}
bitstream.c:pack_inter_mode_mvs:
 1093|  1.86M|                                       aom_writer *w) {
 1094|  1.86M|  AV1_COMMON *const cm = &cpi->common;
 1095|  1.86M|  MACROBLOCK *const x = &td->mb;
 1096|  1.86M|  MACROBLOCKD *const xd = &x->e_mbd;
 1097|  1.86M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
 1098|  1.86M|  const struct segmentation *const seg = &cm->seg;
 1099|  1.86M|  struct segmentation_probs *const segp = &ec_ctx->seg;
 1100|  1.86M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 1101|  1.86M|  const MB_MODE_INFO_EXT_FRAME *const mbmi_ext_frame = x->mbmi_ext_frame;
 1102|  1.86M|  const PREDICTION_MODE mode = mbmi->mode;
 1103|  1.86M|  const uint8_t segment_id = mbmi->segment_id;
 1104|  1.86M|  const BLOCK_SIZE bsize = mbmi->bsize;
 1105|  1.86M|  const int allow_hp = cm->features.allow_high_precision_mv;
 1106|  1.86M|  const int is_inter = is_inter_block(mbmi);
 1107|  1.86M|  const int is_compound = has_second_ref(mbmi);
 1108|  1.86M|  int ref;
 1109|       |
 1110|  1.86M|  write_inter_segment_id(cpi, xd, w, seg, segp, 0, 1);
 1111|       |
 1112|  1.86M|  write_skip_mode(cm, xd, segment_id, mbmi, w);
 1113|       |
 1114|  1.86M|  assert(IMPLIES(mbmi->skip_mode, mbmi->skip_txfm));
 1115|  1.86M|  const int skip =
 1116|  1.86M|      mbmi->skip_mode ? 1 : write_skip(cm, xd, segment_id, mbmi, w);
  ------------------
  |  Branch (1116:7): [True: 0, False: 1.86M]
  ------------------
 1117|       |
 1118|  1.86M|  write_inter_segment_id(cpi, xd, w, seg, segp, skip, 0);
 1119|       |
 1120|  1.86M|  write_cdef(cm, xd, w, skip);
 1121|       |
 1122|  1.86M|  write_delta_q_params(cm, xd, skip, w);
 1123|       |
 1124|  1.86M|  if (!mbmi->skip_mode) write_is_inter(cm, xd, mbmi->segment_id, w, is_inter);
  ------------------
  |  Branch (1124:7): [True: 1.86M, False: 3.21k]
  ------------------
 1125|       |
 1126|  1.86M|  if (mbmi->skip_mode) return;
  ------------------
  |  Branch (1126:7): [True: 0, False: 1.86M]
  ------------------
 1127|       |
 1128|  1.86M|  if (!is_inter) {
  ------------------
  |  Branch (1128:7): [True: 1.35M, False: 514k]
  ------------------
 1129|  1.35M|    write_intra_prediction_modes(cm, xd, 0, w);
 1130|  1.35M|  } else {
 1131|   514k|    int16_t mode_ctx;
 1132|       |
 1133|   514k|    av1_collect_neighbors_ref_counts(xd);
 1134|       |
 1135|   514k|    write_ref_frames(cm, xd, w);
 1136|       |
 1137|   514k|    mode_ctx =
 1138|   514k|        mode_context_analyzer(mbmi_ext_frame->mode_context, mbmi->ref_frame);
 1139|       |
 1140|       |    // If segment skip is not enabled code the mode.
 1141|   514k|    if (!segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (1141:9): [True: 509k, False: 5.13k]
  ------------------
 1142|   509k|      if (is_inter_compound_mode(mode))
  ------------------
  |  Branch (1142:11): [True: 0, False: 509k]
  ------------------
 1143|      0|        write_inter_compound_mode(xd, w, mode, mode_ctx);
 1144|   509k|      else if (is_inter_singleref_mode(mode))
  ------------------
  |  Branch (1144:16): [True: 509k, False: 100]
  ------------------
 1145|   509k|        write_inter_mode(w, mode, ec_ctx, mode_ctx);
 1146|       |
 1147|   509k|      if (mode == NEWMV || mode == NEW_NEWMV || have_nearmv_in_inter_mode(mode))
  ------------------
  |  Branch (1147:11): [True: 275k, False: 233k]
  |  Branch (1147:28): [True: 18.4E, False: 233k]
  |  Branch (1147:49): [True: 58.2k, False: 175k]
  ------------------
 1148|   334k|        write_drl_idx(ec_ctx, mbmi, mbmi_ext_frame, w);
 1149|   174k|      else
 1150|   509k|        assert(mbmi->ref_mv_idx == 0);
 1151|   509k|    }
 1152|       |
 1153|   514k|    if (mode == NEWMV || mode == NEW_NEWMV) {
  ------------------
  |  Branch (1153:9): [True: 280k, False: 233k]
  |  Branch (1153:26): [True: 18.4E, False: 233k]
  ------------------
 1154|   552k|      for (ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (1154:21): [True: 276k, False: 276k]
  ------------------
 1155|   276k|        nmv_context *nmvc = &ec_ctx->nmvc;
 1156|   276k|        const int_mv ref_mv = get_ref_mv(x, ref);
 1157|   276k|        av1_encode_mv(cpi, w, td, &mbmi->mv[ref].as_mv, &ref_mv.as_mv, nmvc,
 1158|   276k|                      allow_hp);
 1159|   276k|      }
 1160|   276k|    } else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
  ------------------
  |  Branch (1160:16): [True: 4.24k, False: 233k]
  |  Branch (1160:41): [True: 18.4E, False: 233k]
  ------------------
 1161|      0|      nmv_context *nmvc = &ec_ctx->nmvc;
 1162|      0|      const int_mv ref_mv = get_ref_mv(x, 1);
 1163|      0|      av1_encode_mv(cpi, w, td, &mbmi->mv[1].as_mv, &ref_mv.as_mv, nmvc,
 1164|      0|                    allow_hp);
 1165|   238k|    } else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
  ------------------
  |  Branch (1165:16): [True: 4.19k, False: 233k]
  |  Branch (1165:41): [True: 18.4E, False: 233k]
  ------------------
 1166|      0|      nmv_context *nmvc = &ec_ctx->nmvc;
 1167|      0|      const int_mv ref_mv = get_ref_mv(x, 0);
 1168|      0|      av1_encode_mv(cpi, w, td, &mbmi->mv[0].as_mv, &ref_mv.as_mv, nmvc,
 1169|      0|                    allow_hp);
 1170|      0|    }
 1171|       |
 1172|   514k|    if (cpi->common.current_frame.reference_mode != COMPOUND_REFERENCE &&
  ------------------
  |  Branch (1172:9): [True: 509k, False: 4.30k]
  ------------------
 1173|   509k|        cpi->common.seq_params->enable_interintra_compound &&
  ------------------
  |  Branch (1173:9): [True: 0, False: 509k]
  ------------------
 1174|      0|        is_interintra_allowed(mbmi)) {
  ------------------
  |  Branch (1174:9): [True: 0, False: 0]
  ------------------
 1175|      0|      const int interintra = mbmi->ref_frame[1] == INTRA_FRAME;
 1176|      0|      const int bsize_group = size_group_lookup[bsize];
 1177|      0|      aom_write_symbol(w, interintra, ec_ctx->interintra_cdf[bsize_group], 2);
 1178|      0|      if (interintra) {
  ------------------
  |  Branch (1178:11): [True: 0, False: 0]
  ------------------
 1179|      0|        aom_write_symbol(w, mbmi->interintra_mode,
 1180|      0|                         ec_ctx->interintra_mode_cdf[bsize_group],
 1181|      0|                         INTERINTRA_MODES);
 1182|      0|        if (av1_is_wedge_used(bsize)) {
  ------------------
  |  Branch (1182:13): [True: 0, False: 0]
  ------------------
 1183|      0|          aom_write_symbol(w, mbmi->use_wedge_interintra,
 1184|      0|                           ec_ctx->wedge_interintra_cdf[bsize], 2);
 1185|      0|          if (mbmi->use_wedge_interintra) {
  ------------------
  |  Branch (1185:15): [True: 0, False: 0]
  ------------------
 1186|      0|            aom_write_symbol(w, mbmi->interintra_wedge_index,
 1187|      0|                             ec_ctx->wedge_idx_cdf[bsize], MAX_WEDGE_TYPES);
  ------------------
  |  |   38|      0|#define MAX_WEDGE_TYPES 16
  ------------------
 1188|      0|          }
 1189|      0|        }
 1190|      0|      }
 1191|      0|    }
 1192|       |
 1193|   514k|    if (mbmi->ref_frame[1] != INTRA_FRAME) write_motion_mode(cm, xd, mbmi, w);
  ------------------
  |  Branch (1193:9): [True: 509k, False: 4.28k]
  ------------------
 1194|       |
 1195|       |    // First write idx to indicate current compound inter prediction mode group
 1196|       |    // Group A (0): dist_wtd_comp, compound_average
 1197|       |    // Group B (1): interintra, compound_diffwtd, wedge
 1198|   514k|    if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1198:9): [True: 0, False: 514k]
  ------------------
 1199|      0|      const int masked_compound_used = is_any_masked_compound_used(bsize) &&
  ------------------
  |  Branch (1199:40): [True: 0, False: 0]
  ------------------
 1200|      0|                                       cm->seq_params->enable_masked_compound;
  ------------------
  |  Branch (1200:40): [True: 0, False: 0]
  ------------------
 1201|       |
 1202|      0|      if (masked_compound_used) {
  ------------------
  |  Branch (1202:11): [True: 0, False: 0]
  ------------------
 1203|      0|        const int ctx_comp_group_idx = get_comp_group_idx_context(xd);
 1204|      0|        aom_write_symbol(w, mbmi->comp_group_idx,
 1205|      0|                         ec_ctx->comp_group_idx_cdf[ctx_comp_group_idx], 2);
 1206|      0|      } else {
 1207|      0|        assert(mbmi->comp_group_idx == 0);
 1208|      0|      }
 1209|       |
 1210|      0|      if (mbmi->comp_group_idx == 0) {
  ------------------
  |  Branch (1210:11): [True: 0, False: 0]
  ------------------
 1211|      0|        if (mbmi->compound_idx)
  ------------------
  |  Branch (1211:13): [True: 0, False: 0]
  ------------------
 1212|      0|          assert(mbmi->interinter_comp.type == COMPOUND_AVERAGE);
 1213|       |
 1214|      0|        if (cm->seq_params->order_hint_info.enable_dist_wtd_comp) {
  ------------------
  |  Branch (1214:13): [True: 0, False: 0]
  ------------------
 1215|      0|          const int comp_index_ctx = get_comp_index_context(cm, xd);
 1216|      0|          aom_write_symbol(w, mbmi->compound_idx,
 1217|      0|                           ec_ctx->compound_index_cdf[comp_index_ctx], 2);
 1218|      0|        } else {
 1219|      0|          assert(mbmi->compound_idx == 1);
 1220|      0|        }
 1221|      0|      } else {
 1222|      0|        assert(cpi->common.current_frame.reference_mode != SINGLE_REFERENCE &&
 1223|      0|               is_inter_compound_mode(mbmi->mode) &&
 1224|      0|               mbmi->motion_mode == SIMPLE_TRANSLATION);
 1225|      0|        assert(masked_compound_used);
 1226|       |        // compound_diffwtd, wedge
 1227|      0|        assert(mbmi->interinter_comp.type == COMPOUND_WEDGE ||
 1228|      0|               mbmi->interinter_comp.type == COMPOUND_DIFFWTD);
 1229|       |
 1230|      0|        if (is_interinter_compound_used(COMPOUND_WEDGE, bsize))
  ------------------
  |  Branch (1230:13): [True: 0, False: 0]
  ------------------
 1231|      0|          aom_write_symbol(w, mbmi->interinter_comp.type - COMPOUND_WEDGE,
 1232|      0|                           ec_ctx->compound_type_cdf[bsize],
 1233|      0|                           MASKED_COMPOUND_TYPES);
 1234|       |
 1235|      0|        if (mbmi->interinter_comp.type == COMPOUND_WEDGE) {
  ------------------
  |  Branch (1235:13): [True: 0, False: 0]
  ------------------
 1236|      0|          assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
 1237|      0|          aom_write_symbol(w, mbmi->interinter_comp.wedge_index,
 1238|      0|                           ec_ctx->wedge_idx_cdf[bsize], MAX_WEDGE_TYPES);
  ------------------
  |  |   38|      0|#define MAX_WEDGE_TYPES 16
  ------------------
 1239|      0|          aom_write_bit(w, mbmi->interinter_comp.wedge_sign);
 1240|      0|        } else {
 1241|      0|          assert(mbmi->interinter_comp.type == COMPOUND_DIFFWTD);
 1242|      0|          aom_write_literal(w, mbmi->interinter_comp.mask_type,
 1243|      0|                            MAX_DIFFWTD_MASK_BITS);
  ------------------
  |  |   38|      0|#define MAX_DIFFWTD_MASK_BITS 1
  ------------------
 1244|      0|        }
 1245|      0|      }
 1246|      0|    }
 1247|   514k|    write_mb_interp_filter(cm, td, w);
 1248|   514k|  }
 1249|  1.86M|}
bitstream.c:write_inter_segment_id:
  924|  3.71M|                                          int skip, int preskip) {
  925|  3.71M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  926|  3.71M|  AV1_COMMON *const cm = &cpi->common;
  927|  3.71M|  const int mi_row = xd->mi_row;
  928|  3.71M|  const int mi_col = xd->mi_col;
  929|       |
  930|  3.71M|  if (seg->update_map) {
  ------------------
  |  Branch (930:7): [True: 0, False: 3.71M]
  ------------------
  931|      0|    if (preskip) {
  ------------------
  |  Branch (931:9): [True: 0, False: 0]
  ------------------
  932|      0|      if (!seg->segid_preskip) return;
  ------------------
  |  Branch (932:11): [True: 0, False: 0]
  ------------------
  933|      0|    } else {
  934|      0|      if (seg->segid_preskip) return;
  ------------------
  |  Branch (934:11): [True: 0, False: 0]
  ------------------
  935|      0|      if (skip) {
  ------------------
  |  Branch (935:11): [True: 0, False: 0]
  ------------------
  936|      0|        write_segment_id(cpi, xd, mbmi, w, seg, segp, 1);
  937|      0|        if (seg->temporal_update) mbmi->seg_id_predicted = 0;
  ------------------
  |  Branch (937:13): [True: 0, False: 0]
  ------------------
  938|      0|        return;
  939|      0|      }
  940|      0|    }
  941|      0|    if (seg->temporal_update) {
  ------------------
  |  Branch (941:9): [True: 0, False: 0]
  ------------------
  942|      0|      const int pred_flag = mbmi->seg_id_predicted;
  943|      0|      aom_cdf_prob *pred_cdf = av1_get_pred_cdf_seg_id(segp, xd);
  944|      0|      aom_write_symbol(w, pred_flag, pred_cdf, 2);
  945|      0|      if (!pred_flag) {
  ------------------
  |  Branch (945:11): [True: 0, False: 0]
  ------------------
  946|      0|        write_segment_id(cpi, xd, mbmi, w, seg, segp, 0);
  947|      0|      }
  948|      0|      if (pred_flag) {
  ------------------
  |  Branch (948:11): [True: 0, False: 0]
  ------------------
  949|      0|        set_spatial_segment_id(&cm->mi_params, cm->cur_frame->seg_map,
  950|      0|                               mbmi->bsize, mi_row, mi_col, mbmi->segment_id);
  951|      0|      }
  952|      0|    } else {
  953|      0|      write_segment_id(cpi, xd, mbmi, w, seg, segp, 0);
  954|      0|    }
  955|      0|  }
  956|  3.71M|}
bitstream.c:write_skip_mode:
  241|  1.86M|                           aom_writer *w) {
  242|  1.86M|  if (!cm->current_frame.skip_mode_info.skip_mode_flag) return 0;
  ------------------
  |  Branch (242:7): [True: 1.86M, False: 77]
  ------------------
  243|     77|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (243:7): [True: 0, False: 77]
  ------------------
  244|      0|    return 0;
  245|      0|  }
  246|     77|  const int skip_mode = mi->skip_mode;
  247|     77|  if (!is_comp_ref_allowed(mi->bsize)) {
  ------------------
  |  Branch (247:7): [True: 0, False: 77]
  ------------------
  248|      0|    assert(!skip_mode);
  249|      0|    return 0;
  250|      0|  }
  251|     77|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME) ||
  ------------------
  |  Branch (251:7): [True: 77, False: 0]
  ------------------
  252|      0|      segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (252:7): [True: 0, False: 0]
  ------------------
  253|       |    // These features imply single-reference mode, while skip mode implies
  254|       |    // compound reference. Hence, the two are mutually exclusive.
  255|       |    // In other words, skip_mode is implicitly 0 here.
  256|      0|    assert(!skip_mode);
  257|      0|    return 0;
  258|      0|  }
  259|     77|  const int ctx = av1_get_skip_mode_context(xd);
  260|     77|  aom_write_symbol(w, skip_mode, xd->tile_ctx->skip_mode_cdfs[ctx], 2);
  261|     77|  return skip_mode;
  262|     77|}
bitstream.c:write_is_inter:
  266|  1.86M|                                  const int is_inter) {
  267|  1.86M|  if (!segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (267:7): [True: 1.86M, False: 461]
  ------------------
  268|  1.86M|    if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (268:9): [True: 0, False: 1.86M]
  ------------------
  269|      0|      assert(is_inter);
  270|      0|      return;
  271|      0|    }
  272|  1.86M|    const int ctx = av1_get_intra_inter_context(xd);
  273|  1.86M|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  274|  1.86M|    aom_write_symbol(w, is_inter, ec_ctx->intra_inter_cdf[ctx], 2);
  275|  1.86M|  }
  276|  1.86M|}
bitstream.c:write_ref_frames:
  500|   509k|                                    aom_writer *w) {
  501|   509k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  502|   509k|  const int is_compound = has_second_ref(mbmi);
  503|   509k|  const uint8_t segment_id = mbmi->segment_id;
  504|       |
  505|       |  // If segment level coding of this signal is disabled...
  506|       |  // or the segment allows multiple reference frame options
  507|   509k|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (507:7): [True: 0, False: 509k]
  ------------------
  508|      0|    assert(!is_compound);
  509|      0|    assert(mbmi->ref_frame[0] ==
  510|      0|           get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME));
  511|   509k|  } else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
  ------------------
  |  Branch (511:14): [True: 158, False: 508k]
  ------------------
  512|   508k|             segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
  ------------------
  |  Branch (512:14): [True: 464, False: 508k]
  ------------------
  513|      0|    assert(!is_compound);
  514|      0|    assert(mbmi->ref_frame[0] == LAST_FRAME);
  515|   509k|  } else {
  516|       |    // does the feature use compound prediction or not
  517|       |    // (if not specified at the frame/segment level)
  518|   509k|    if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (518:9): [True: 0, False: 509k]
  ------------------
  519|      0|      if (is_comp_ref_allowed(mbmi->bsize))
  ------------------
  |  Branch (519:11): [True: 0, False: 0]
  ------------------
  520|      0|        aom_write_symbol(w, is_compound, av1_get_reference_mode_cdf(xd), 2);
  521|   509k|    } else {
  522|   509k|      assert((!is_compound) ==
  523|   509k|             (cm->current_frame.reference_mode == SINGLE_REFERENCE));
  524|   509k|    }
  525|       |
  526|   509k|    if (is_compound) {
  ------------------
  |  Branch (526:9): [True: 0, False: 509k]
  ------------------
  527|      0|      const COMP_REFERENCE_TYPE comp_ref_type = has_uni_comp_refs(mbmi)
  ------------------
  |  Branch (527:49): [True: 0, False: 0]
  ------------------
  528|      0|                                                    ? UNIDIR_COMP_REFERENCE
  529|      0|                                                    : BIDIR_COMP_REFERENCE;
  530|      0|      aom_write_symbol(w, comp_ref_type, av1_get_comp_reference_type_cdf(xd),
  531|      0|                       2);
  532|       |
  533|      0|      if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
  ------------------
  |  Branch (533:11): [True: 0, False: 0]
  ------------------
  534|      0|        const int bit = mbmi->ref_frame[0] == BWDREF_FRAME;
  535|      0|        WRITE_REF_BIT(bit, uni_comp_ref_p);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  536|       |
  537|      0|        if (!bit) {
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|          assert(mbmi->ref_frame[0] == LAST_FRAME);
  539|      0|          const int bit1 = mbmi->ref_frame[1] == LAST3_FRAME ||
  ------------------
  |  Branch (539:28): [True: 0, False: 0]
  ------------------
  540|      0|                           mbmi->ref_frame[1] == GOLDEN_FRAME;
  ------------------
  |  Branch (540:28): [True: 0, False: 0]
  ------------------
  541|      0|          WRITE_REF_BIT(bit1, uni_comp_ref_p1);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  542|      0|          if (bit1) {
  ------------------
  |  Branch (542:15): [True: 0, False: 0]
  ------------------
  543|      0|            const int bit2 = mbmi->ref_frame[1] == GOLDEN_FRAME;
  544|      0|            WRITE_REF_BIT(bit2, uni_comp_ref_p2);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  545|      0|          }
  546|      0|        } else {
  547|      0|          assert(mbmi->ref_frame[1] == ALTREF_FRAME);
  548|      0|        }
  549|       |
  550|      0|        return;
  551|      0|      }
  552|       |
  553|      0|      assert(comp_ref_type == BIDIR_COMP_REFERENCE);
  554|       |
  555|      0|      const int bit = (mbmi->ref_frame[0] == GOLDEN_FRAME ||
  ------------------
  |  Branch (555:24): [True: 0, False: 0]
  ------------------
  556|      0|                       mbmi->ref_frame[0] == LAST3_FRAME);
  ------------------
  |  Branch (556:24): [True: 0, False: 0]
  ------------------
  557|      0|      WRITE_REF_BIT(bit, comp_ref_p);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  558|       |
  559|      0|      if (!bit) {
  ------------------
  |  Branch (559:11): [True: 0, False: 0]
  ------------------
  560|      0|        const int bit1 = mbmi->ref_frame[0] == LAST2_FRAME;
  561|      0|        WRITE_REF_BIT(bit1, comp_ref_p1);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  562|      0|      } else {
  563|      0|        const int bit2 = mbmi->ref_frame[0] == GOLDEN_FRAME;
  564|      0|        WRITE_REF_BIT(bit2, comp_ref_p2);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  565|      0|      }
  566|       |
  567|      0|      const int bit_bwd = mbmi->ref_frame[1] == ALTREF_FRAME;
  568|      0|      WRITE_REF_BIT(bit_bwd, comp_bwdref_p);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  569|       |
  570|      0|      if (!bit_bwd) {
  ------------------
  |  Branch (570:11): [True: 0, False: 0]
  ------------------
  571|      0|        WRITE_REF_BIT(mbmi->ref_frame[1] == ALTREF2_FRAME, comp_bwdref_p1);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  572|      0|      }
  573|       |
  574|   509k|    } else {
  575|   509k|      const int bit0 = (mbmi->ref_frame[0] <= ALTREF_FRAME &&
  ------------------
  |  Branch (575:25): [True: 508k, False: 641]
  ------------------
  576|   508k|                        mbmi->ref_frame[0] >= BWDREF_FRAME);
  ------------------
  |  Branch (576:25): [True: 0, False: 508k]
  ------------------
  577|   509k|      WRITE_REF_BIT(bit0, single_ref_p1);
  ------------------
  |  |  496|   509k|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  578|       |
  579|   509k|      if (bit0) {
  ------------------
  |  Branch (579:11): [True: 0, False: 509k]
  ------------------
  580|      0|        const int bit1 = mbmi->ref_frame[0] == ALTREF_FRAME;
  581|      0|        WRITE_REF_BIT(bit1, single_ref_p2);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  582|       |
  583|      0|        if (!bit1) {
  ------------------
  |  Branch (583:13): [True: 0, False: 0]
  ------------------
  584|      0|          WRITE_REF_BIT(mbmi->ref_frame[0] == ALTREF2_FRAME, single_ref_p6);
  ------------------
  |  |  496|      0|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  585|      0|        }
  586|   509k|      } else {
  587|   509k|        const int bit2 = (mbmi->ref_frame[0] == LAST3_FRAME ||
  ------------------
  |  Branch (587:27): [True: 18.4E, False: 509k]
  ------------------
  588|   509k|                          mbmi->ref_frame[0] == GOLDEN_FRAME);
  ------------------
  |  Branch (588:27): [True: 18.4E, False: 509k]
  ------------------
  589|   509k|        WRITE_REF_BIT(bit2, single_ref_p3);
  ------------------
  |  |  496|   509k|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  590|       |
  591|   509k|        if (!bit2) {
  ------------------
  |  Branch (591:13): [True: 509k, False: 18.4E]
  ------------------
  592|   509k|          const int bit3 = mbmi->ref_frame[0] != LAST_FRAME;
  593|   509k|          WRITE_REF_BIT(bit3, single_ref_p4);
  ------------------
  |  |  496|   509k|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  594|  18.4E|        } else {
  595|  18.4E|          const int bit4 = mbmi->ref_frame[0] != LAST3_FRAME;
  596|  18.4E|          WRITE_REF_BIT(bit4, single_ref_p5);
  ------------------
  |  |  496|  18.4E|  aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
  ------------------
  597|  18.4E|        }
  598|   509k|      }
  599|   509k|    }
  600|   509k|  }
  601|   509k|}
bitstream.c:mode_context_analyzer:
 1051|   509k|    const int16_t mode_context, const MV_REFERENCE_FRAME *const rf) {
 1052|   509k|  if (rf[1] <= INTRA_FRAME) return mode_context;
  ------------------
  |  Branch (1052:7): [True: 509k, False: 18.4E]
  ------------------
 1053|       |
 1054|  18.4E|  const int16_t newmv_ctx = mode_context & NEWMV_CTX_MASK;
  ------------------
  |  |  490|  18.4E|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|  18.4E|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
 1055|  18.4E|  const int16_t refmv_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|  18.4E|#define REFMV_OFFSET 4
  ------------------
                const int16_t refmv_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|  18.4E|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  18.4E|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
 1056|       |
 1057|  18.4E|  const int16_t comp_ctx = compound_mode_ctx_map[refmv_ctx >> 1][AOMMIN(
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
 1058|  18.4E|      newmv_ctx, COMP_NEWMV_CTXS - 1)];
 1059|  18.4E|  return comp_ctx;
 1060|   509k|}
bitstream.c:write_inter_mode:
   89|   508k|                                    const int16_t mode_ctx) {
   90|   508k|  const int16_t newmv_ctx = mode_ctx & NEWMV_CTX_MASK;
  ------------------
  |  |  490|   508k|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|   508k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
   91|       |
   92|   508k|  aom_write_symbol(w, mode != NEWMV, ec_ctx->newmv_cdf[newmv_ctx], 2);
   93|       |
   94|   508k|  if (mode != NEWMV) {
  ------------------
  |  Branch (94:7): [True: 233k, False: 275k]
  ------------------
   95|   233k|    const int16_t zeromv_ctx =
   96|   233k|        (mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  487|   233k|#define GLOBALMV_OFFSET 3
  ------------------
                      (mode_ctx >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  491|   233k|#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|   233k|#define REFMV_OFFSET 4
  |  |  ------------------
  |  |               #define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  487|   233k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
   97|   233k|    aom_write_symbol(w, mode != GLOBALMV, ec_ctx->zeromv_cdf[zeromv_ctx], 2);
   98|       |
   99|   233k|    if (mode != GLOBALMV) {
  ------------------
  |  Branch (99:9): [True: 219k, False: 13.9k]
  ------------------
  100|   219k|      int16_t refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|   219k|#define REFMV_OFFSET 4
  ------------------
                    int16_t refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|   219k|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|   219k|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  101|   219k|      aom_write_symbol(w, mode != NEARESTMV, ec_ctx->refmv_cdf[refmv_ctx], 2);
  102|   219k|    }
  103|   233k|  }
  104|   508k|}
bitstream.c:write_drl_idx:
  109|   334k|                                 aom_writer *w) {
  110|   334k|  assert(mbmi->ref_mv_idx < 3);
  111|       |
  112|   334k|  const int new_mv = mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV;
  ------------------
  |  Branch (112:22): [True: 275k, False: 58.9k]
  |  Branch (112:45): [True: 18.4E, False: 58.9k]
  ------------------
  113|   334k|  if (new_mv) {
  ------------------
  |  Branch (113:7): [True: 276k, False: 58.6k]
  ------------------
  114|   276k|    int idx;
  115|   497k|    for (idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (115:19): [True: 390k, False: 107k]
  ------------------
  116|   390k|      if (mbmi_ext_frame->ref_mv_count > idx + 1) {
  ------------------
  |  Branch (116:11): [True: 186k, False: 203k]
  ------------------
  117|   186k|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext_frame->weight, idx);
  118|       |
  119|   186k|        aom_write_symbol(w, mbmi->ref_mv_idx != idx, ec_ctx->drl_cdf[drl_ctx],
  120|   186k|                         2);
  121|   186k|        if (mbmi->ref_mv_idx == idx) return;
  ------------------
  |  Branch (121:13): [True: 168k, False: 17.9k]
  ------------------
  122|   186k|      }
  123|   390k|    }
  124|   107k|    return;
  125|   276k|  }
  126|       |
  127|  58.9k|  if (have_nearmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (127:7): [True: 58.9k, False: 18.4E]
  ------------------
  128|  58.9k|    int idx;
  129|       |    // TODO(jingning): Temporary solution to compensate the NEARESTMV offset.
  130|   110k|    for (idx = 1; idx < 3; ++idx) {
  ------------------
  |  Branch (130:19): [True: 85.2k, False: 25.5k]
  ------------------
  131|  85.2k|      if (mbmi_ext_frame->ref_mv_count > idx + 1) {
  ------------------
  |  Branch (131:11): [True: 36.2k, False: 49.0k]
  ------------------
  132|  36.2k|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext_frame->weight, idx);
  133|  36.2k|        aom_write_symbol(w, mbmi->ref_mv_idx != (idx - 1),
  134|  36.2k|                         ec_ctx->drl_cdf[drl_ctx], 2);
  135|  36.2k|        if (mbmi->ref_mv_idx == (idx - 1)) return;
  ------------------
  |  Branch (135:13): [True: 33.3k, False: 2.85k]
  ------------------
  136|  36.2k|      }
  137|  85.2k|    }
  138|  25.5k|    return;
  139|  58.9k|  }
  140|  58.6k|}
bitstream.c:get_ref_mv:
 1080|   276k|static inline int_mv get_ref_mv(const MACROBLOCK *x, int ref_idx) {
 1081|   276k|  const MACROBLOCKD *xd = &x->e_mbd;
 1082|   276k|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1083|   276k|  int ref_mv_idx = mbmi->ref_mv_idx;
 1084|   276k|  if (mbmi->mode == NEAR_NEWMV || mbmi->mode == NEW_NEARMV) {
  ------------------
  |  Branch (1084:7): [True: 18.4E, False: 276k]
  |  Branch (1084:35): [True: 18.4E, False: 276k]
  ------------------
 1085|       |    assert(has_second_ref(mbmi));
 1086|      0|    ref_mv_idx += 1;
 1087|      0|  }
 1088|   276k|  return get_ref_mv_from_stack(ref_idx, mbmi->ref_frame, ref_mv_idx,
 1089|   276k|                               x->mbmi_ext_frame);
 1090|   276k|}
bitstream.c:get_ref_mv_from_stack:
 1064|   276k|    const MB_MODE_INFO_EXT_FRAME *mbmi_ext_frame) {
 1065|   276k|  const int8_t ref_frame_type = av1_ref_frame_type(ref_frame);
 1066|   276k|  const CANDIDATE_MV *curr_ref_mv_stack = mbmi_ext_frame->ref_mv_stack;
 1067|       |
 1068|   276k|  if (ref_frame[1] > INTRA_FRAME) {
  ------------------
  |  Branch (1068:7): [True: 0, False: 276k]
  ------------------
 1069|      0|    assert(ref_idx == 0 || ref_idx == 1);
 1070|      0|    return ref_idx ? curr_ref_mv_stack[ref_mv_idx].comp_mv
  ------------------
  |  Branch (1070:12): [True: 0, False: 0]
  ------------------
 1071|      0|                   : curr_ref_mv_stack[ref_mv_idx].this_mv;
 1072|      0|  }
 1073|       |
 1074|   276k|  assert(ref_idx == 0);
 1075|   276k|  return ref_mv_idx < mbmi_ext_frame->ref_mv_count
  ------------------
  |  Branch (1075:10): [True: 229k, False: 46.4k]
  ------------------
 1076|   276k|             ? curr_ref_mv_stack[ref_mv_idx].this_mv
 1077|   276k|             : mbmi_ext_frame->global_mvs[ref_frame_type];
 1078|   276k|}
bitstream.c:write_motion_mode:
  279|   509k|                                     const MB_MODE_INFO *mbmi, aom_writer *w) {
  280|   509k|  MOTION_MODE last_motion_mode_allowed =
  281|   509k|      cm->features.switchable_motion_mode
  ------------------
  |  Branch (281:7): [True: 510k, False: 18.4E]
  ------------------
  282|   510k|          ? motion_mode_allowed(cm->global_motion, xd, mbmi,
  283|   510k|                                cm->features.allow_warped_motion)
  284|  18.4E|          : SIMPLE_TRANSLATION;
  285|   509k|  assert(mbmi->motion_mode <= last_motion_mode_allowed);
  286|   509k|  switch (last_motion_mode_allowed) {
  287|   146k|    case SIMPLE_TRANSLATION: break;
  ------------------
  |  Branch (287:5): [True: 146k, False: 363k]
  ------------------
  288|   325k|    case OBMC_CAUSAL:
  ------------------
  |  Branch (288:5): [True: 325k, False: 184k]
  ------------------
  289|   325k|      aom_write_symbol(w, mbmi->motion_mode == OBMC_CAUSAL,
  290|   325k|                       xd->tile_ctx->obmc_cdf[mbmi->bsize], 2);
  291|   325k|      break;
  292|  38.0k|    default:
  ------------------
  |  Branch (292:5): [True: 38.0k, False: 471k]
  ------------------
  293|  38.0k|      aom_write_symbol(w, mbmi->motion_mode,
  294|  38.0k|                       xd->tile_ctx->motion_mode_cdf[mbmi->bsize],
  295|  38.0k|                       MOTION_MODES);
  296|   509k|  }
  297|   509k|}
bitstream.c:write_mb_interp_filter:
  626|   509k|                                          aom_writer *w) {
  627|   509k|  const MACROBLOCKD *xd = &td->mb.e_mbd;
  628|   509k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  629|   509k|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  630|       |
  631|   509k|  if (!av1_is_interp_needed(xd)) {
  ------------------
  |  Branch (631:7): [True: 20.9k, False: 489k]
  ------------------
  632|  20.9k|    int_interpfilters filters = av1_broadcast_interp_filter(
  633|  20.9k|        av1_unswitchable_filter(cm->features.interp_filter));
  634|  20.9k|    assert(mbmi->interp_filters.as_int == filters.as_int);
  635|  20.9k|    (void)filters;
  636|  20.9k|    return;
  637|  20.9k|  }
  638|   489k|  if (cm->features.interp_filter == SWITCHABLE) {
  ------------------
  |  Branch (638:7): [True: 270k, False: 218k]
  ------------------
  639|   270k|    int dir;
  640|   270k|    for (dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (640:19): [True: 270k, False: 103]
  ------------------
  641|   270k|      const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
  642|   270k|      InterpFilter filter =
  643|   270k|          av1_extract_interp_filter(mbmi->interp_filters, dir);
  644|   270k|      aom_write_symbol(w, filter, ec_ctx->switchable_interp_cdf[ctx],
  645|   270k|                       SWITCHABLE_FILTERS);
  646|   270k|      ++td->interp_filter_selected[filter];
  647|   270k|      if (cm->seq_params->enable_dual_filter == 0) return;
  ------------------
  |  Branch (647:11): [True: 270k, False: 103]
  ------------------
  648|   270k|    }
  649|   270k|  }
  650|   489k|}
bitstream.c:pack_map_tokens:
  354|  66.9k|                                   int num, MapCdf map_pb_cdf) {
  355|  66.9k|  const TokenExtra *p = *tp;
  356|  66.9k|  const int palette_size_idx = n - PALETTE_MIN_SIZE;
  ------------------
  |  |   65|  66.9k|#define PALETTE_MIN_SIZE 2
  ------------------
  357|  66.9k|  write_uniform(w, n, p->token);  // The first color index.
  358|  66.9k|  ++p;
  359|  66.9k|  --num;
  360|  3.50M|  for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (360:19): [True: 3.43M, False: 66.9k]
  ------------------
  361|       |    assert((p->color_ctx >= 0) &&
  362|  3.43M|           (p->color_ctx < PALETTE_COLOR_INDEX_CONTEXTS));
  363|  3.43M|    aom_cdf_prob *color_map_cdf = map_pb_cdf[palette_size_idx][p->color_ctx];
  364|  3.43M|    aom_write_symbol(w, p->token, color_map_cdf, n);
  365|  3.43M|    ++p;
  366|  3.43M|  }
  367|  66.9k|  *tp = p;
  368|  66.9k|}
bitstream.c:write_uniform:
   58|  67.0k|static inline void write_uniform(aom_writer *w, int n, int v) {
   59|  67.0k|  const int l = get_unsigned_bits(n);
   60|  67.0k|  const int m = (1 << l) - n;
   61|  67.0k|  if (l == 0) return;
  ------------------
  |  Branch (61:7): [True: 0, False: 67.0k]
  ------------------
   62|  67.0k|  if (v < m) {
  ------------------
  |  Branch (62:7): [True: 51.7k, False: 15.2k]
  ------------------
   63|  51.7k|    aom_write_literal(w, v, l - 1);
   64|  51.7k|  } else {
   65|  15.2k|    aom_write_literal(w, m + ((v - m) >> 1), l - 1);
   66|  15.2k|    aom_write_literal(w, (v - m) & 1, 1);
   67|  15.2k|  }
   68|  67.0k|}
bitstream.c:write_tx_size_vartx:
  154|   711k|                                       int blk_col, aom_writer *w) {
  155|   711k|  FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
  156|   711k|  const int max_blocks_high = max_block_high(xd, mbmi->bsize, 0);
  157|   711k|  const int max_blocks_wide = max_block_wide(xd, mbmi->bsize, 0);
  158|       |
  159|   711k|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (159:7): [True: 2.83k, False: 708k]
  |  Branch (159:37): [True: 3.38k, False: 705k]
  ------------------
  160|       |
  161|   705k|  if (depth == MAX_VARTX_DEPTH) {
  ------------------
  |  |   56|   705k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (161:7): [True: 118k, False: 586k]
  ------------------
  162|   118k|    txfm_partition_update(xd->above_txfm_context + blk_col,
  163|   118k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
  164|   118k|    return;
  165|   118k|  }
  166|       |
  167|   586k|  const int ctx = txfm_partition_context(xd->above_txfm_context + blk_col,
  168|   586k|                                         xd->left_txfm_context + blk_row,
  169|   586k|                                         mbmi->bsize, tx_size);
  170|   586k|  const int txb_size_index =
  171|   586k|      av1_get_txb_size_index(mbmi->bsize, blk_row, blk_col);
  172|   586k|  const int write_txfm_partition =
  173|   586k|      tx_size == mbmi->inter_tx_size[txb_size_index];
  174|   586k|  if (write_txfm_partition) {
  ------------------
  |  Branch (174:7): [True: 475k, False: 110k]
  ------------------
  175|   475k|    aom_write_symbol(w, 0, ec_ctx->txfm_partition_cdf[ctx], 2);
  176|       |
  177|   475k|    txfm_partition_update(xd->above_txfm_context + blk_col,
  178|   475k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
  179|       |    // TODO(yuec): set correct txfm partition update for qttx
  180|   475k|  } else {
  181|   110k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  182|   110k|    const int bsw = tx_size_wide_unit[sub_txs];
  183|   110k|    const int bsh = tx_size_high_unit[sub_txs];
  184|       |
  185|   110k|    aom_write_symbol(w, 1, ec_ctx->txfm_partition_cdf[ctx], 2);
  186|       |
  187|   110k|    if (sub_txs == TX_4X4) {
  ------------------
  |  Branch (187:9): [True: 5.50k, False: 105k]
  ------------------
  188|  5.50k|      txfm_partition_update(xd->above_txfm_context + blk_col,
  189|  5.50k|                            xd->left_txfm_context + blk_row, sub_txs, tx_size);
  190|  5.50k|      return;
  191|  5.50k|    }
  192|       |
  193|   110k|    assert(bsw > 0 && bsh > 0);
  194|   309k|    for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) {
  ------------------
  |  Branch (194:23): [True: 204k, False: 105k]
  ------------------
  195|   204k|      const int offsetr = blk_row + row;
  196|   594k|      for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) {
  ------------------
  |  Branch (196:25): [True: 389k, False: 204k]
  ------------------
  197|   389k|        const int offsetc = blk_col + col;
  198|   389k|        write_tx_size_vartx(xd, mbmi, sub_txs, depth + 1, offsetr, offsetc, w);
  199|   389k|      }
  200|   204k|    }
  201|   105k|  }
  202|   586k|}
bitstream.c:write_selected_tx_size:
  205|  1.31M|                                          aom_writer *w) {
  206|  1.31M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  207|  1.31M|  const BLOCK_SIZE bsize = mbmi->bsize;
  208|  1.31M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  209|  1.31M|  if (block_signals_txsize(bsize)) {
  ------------------
  |  Branch (209:7): [True: 1.30M, False: 1.94k]
  ------------------
  210|  1.30M|    const TX_SIZE tx_size = mbmi->tx_size;
  211|  1.30M|    const int tx_size_ctx = get_tx_size_context(xd);
  212|  1.30M|    const int depth = tx_size_to_depth(tx_size, bsize);
  213|  1.30M|    const int max_depths = bsize_to_max_depth(bsize);
  214|  1.30M|    const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
  215|       |
  216|  1.30M|    assert(depth >= 0 && depth <= max_depths);
  217|  1.30M|    assert(!is_inter_block(mbmi));
  218|  1.30M|    assert(IMPLIES(is_rect_tx(tx_size), is_rect_tx_allowed(xd, mbmi)));
  219|       |
  220|  1.30M|    aom_write_symbol(w, depth, ec_ctx->tx_size_cdf[tx_size_cat][tx_size_ctx],
  221|  1.30M|                     max_depths + 1);
  222|  1.30M|  }
  223|  1.31M|}
bitstream.c:write_tokens_b:
 1433|  1.98M|                                  const TokenExtra *const tok_end) {
 1434|  1.98M|  AV1_COMMON *const cm = &cpi->common;
 1435|  1.98M|  MACROBLOCKD *const xd = &x->e_mbd;
 1436|  1.98M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1437|  1.98M|  const BLOCK_SIZE bsize = mbmi->bsize;
 1438|       |
 1439|  1.98M|  assert(!mbmi->skip_txfm);
 1440|       |
 1441|  1.98M|  const int is_inter = is_inter_block(mbmi);
 1442|  1.98M|  if (!is_inter) {
  ------------------
  |  Branch (1442:7): [True: 1.51M, False: 467k]
  ------------------
 1443|  1.51M|    av1_write_intra_coeffs_mb(cm, x, w, bsize);
 1444|  1.51M|  } else {
 1445|   467k|    int block[MAX_MB_PLANE] = { 0 };
 1446|   467k|    assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x,
 1447|   467k|                                         xd->plane[0].subsampling_y));
 1448|   467k|    const int num_4x4_w = mi_size_wide[bsize];
 1449|   467k|    const int num_4x4_h = mi_size_high[bsize];
 1450|   467k|    TOKEN_STATS token_stats;
 1451|   467k|    init_token_stats(&token_stats);
 1452|       |
 1453|   467k|    const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
 1454|   467k|    assert(max_unit_bsize == get_plane_block_size(BLOCK_64X64,
 1455|   467k|                                                  xd->plane[0].subsampling_x,
 1456|   467k|                                                  xd->plane[0].subsampling_y));
 1457|   467k|    int mu_blocks_wide = mi_size_wide[max_unit_bsize];
 1458|   467k|    int mu_blocks_high = mi_size_high[max_unit_bsize];
 1459|   467k|    mu_blocks_wide = AOMMIN(num_4x4_w, mu_blocks_wide);
  ------------------
  |  |   34|   467k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 466k, False: 1.03k]
  |  |  ------------------
  ------------------
 1460|   467k|    mu_blocks_high = AOMMIN(num_4x4_h, mu_blocks_high);
  ------------------
  |  |   34|   467k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 466k, False: 1.03k]
  |  |  ------------------
  ------------------
 1461|       |
 1462|   467k|    const int num_planes = av1_num_planes(cm);
 1463|   934k|    for (int row = 0; row < num_4x4_h; row += mu_blocks_high) {
  ------------------
  |  Branch (1463:23): [True: 467k, False: 467k]
  ------------------
 1464|   934k|      for (int col = 0; col < num_4x4_w; col += mu_blocks_wide) {
  ------------------
  |  Branch (1464:25): [True: 467k, False: 467k]
  ------------------
 1465|  1.19M|        for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1465:29): [True: 728k, False: 465k]
  ------------------
 1466|   728k|          if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (1466:15): [True: 261k, False: 466k]
  |  Branch (1466:24): [True: 1.31k, False: 260k]
  ------------------
 1467|   726k|          write_inter_txb_coeff(cm, x, mbmi, w, tok, tok_end, &token_stats, row,
 1468|   726k|                                col, &block[plane], plane);
 1469|   726k|        }
 1470|   467k|      }
 1471|   467k|    }
 1472|       |#if CONFIG_RD_DEBUG
 1473|       |    for (int plane = 0; plane < num_planes; ++plane) {
 1474|       |      if (mbmi->bsize >= BLOCK_8X8 &&
 1475|       |          rd_token_stats_mismatch(&mbmi->rd_stats, &token_stats, plane)) {
 1476|       |        dump_mode_info(mbmi);
 1477|       |        assert(0);
 1478|       |      }
 1479|       |    }
 1480|       |#endif  // CONFIG_RD_DEBUG
 1481|   467k|  }
 1482|  1.98M|}
bitstream.c:write_inter_txb_coeff:
 1399|   726k|    const int plane) {
 1400|   726k|  MACROBLOCKD *const xd = &x->e_mbd;
 1401|   726k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 1402|   726k|  const BLOCK_SIZE bsize = mbmi->bsize;
 1403|   726k|  assert(bsize < BLOCK_SIZES_ALL);
 1404|   726k|  const int ss_x = pd->subsampling_x;
 1405|   726k|  const int ss_y = pd->subsampling_y;
 1406|   726k|  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
 1407|   726k|  assert(plane_bsize < BLOCK_SIZES_ALL);
 1408|   726k|  const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane);
 1409|   726k|  const int step =
 1410|   726k|      tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
 1411|   726k|  const int bkw = tx_size_wide_unit[max_tx_size];
 1412|   726k|  const int bkh = tx_size_high_unit[max_tx_size];
 1413|   726k|  const BLOCK_SIZE max_unit_bsize =
 1414|   726k|      get_plane_block_size(BLOCK_64X64, ss_x, ss_y);
 1415|   726k|  const int num_4x4_w = mi_size_wide[plane_bsize];
 1416|   726k|  const int num_4x4_h = mi_size_high[plane_bsize];
 1417|   726k|  const int mu_blocks_wide = mi_size_wide[max_unit_bsize];
 1418|   726k|  const int mu_blocks_high = mi_size_high[max_unit_bsize];
 1419|   726k|  const int unit_height = AOMMIN(mu_blocks_high + (row >> ss_y), num_4x4_h);
  ------------------
  |  |   34|   726k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 726k]
  |  |  ------------------
  ------------------
 1420|   726k|  const int unit_width = AOMMIN(mu_blocks_wide + (col >> ss_x), num_4x4_w);
  ------------------
  |  |   34|   726k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 726k]
  |  |  ------------------
  ------------------
 1421|  1.50M|  for (int blk_row = row >> ss_y; blk_row < unit_height; blk_row += bkh) {
  ------------------
  |  Branch (1421:35): [True: 781k, False: 726k]
  ------------------
 1422|  1.67M|    for (int blk_col = col >> ss_x; blk_col < unit_width; blk_col += bkw) {
  ------------------
  |  Branch (1422:37): [True: 889k, False: 781k]
  ------------------
 1423|   889k|      pack_txb_tokens(w, cm, x, tok, tok_end, xd, mbmi, plane, plane_bsize,
 1424|   889k|                      cm->seq_params->bit_depth, *block, blk_row, blk_col,
 1425|   889k|                      max_tx_size, token_stats);
 1426|   889k|      *block += step;
 1427|   889k|    }
 1428|   781k|  }
 1429|   726k|}
bitstream.c:pack_txb_tokens:
  374|  1.29M|    int blk_row, int blk_col, TX_SIZE tx_size, TOKEN_STATS *token_stats) {
  375|  1.29M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  376|  1.29M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  377|       |
  378|  1.29M|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (378:7): [True: 2.09k, False: 1.29M]
  |  Branch (378:37): [True: 2.01k, False: 1.28M]
  ------------------
  379|       |
  380|  1.28M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  381|  1.28M|  const TX_SIZE plane_tx_size =
  382|  1.28M|      plane ? av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
  ------------------
  |  Branch (382:7): [True: 288k, False: 1.00M]
  ------------------
  383|   288k|                                    pd->subsampling_y)
  384|  1.28M|            : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,
  385|  1.00M|                                                         blk_col)];
  386|       |
  387|  1.28M|  if (tx_size == plane_tx_size || plane) {
  ------------------
  |  Branch (387:7): [True: 1.13M, False: 152k]
  |  Branch (387:35): [True: 39.4k, False: 112k]
  ------------------
  388|  1.17M|    av1_write_coeffs_txb(cm, x, w, blk_row, blk_col, plane, block, tx_size);
  389|       |#if CONFIG_RD_DEBUG
  390|       |    TOKEN_STATS tmp_token_stats;
  391|       |    init_token_stats(&tmp_token_stats);
  392|       |    token_stats->cost += tmp_token_stats.cost;
  393|       |#endif
  394|  1.17M|  } else {
  395|   111k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  396|   111k|    const int bsw = tx_size_wide_unit[sub_txs];
  397|   111k|    const int bsh = tx_size_high_unit[sub_txs];
  398|   111k|    const int step = bsh * bsw;
  399|   111k|    const int row_end =
  400|   111k|        AOMMIN(tx_size_high_unit[tx_size], max_blocks_high - blk_row);
  ------------------
  |  |   34|   111k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 14.7k, False: 96.4k]
  |  |  ------------------
  ------------------
  401|   111k|    const int col_end =
  402|   111k|        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
  ------------------
  |  |   34|   111k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 14.9k, False: 96.2k]
  |  |  ------------------
  ------------------
  403|       |
  404|   111k|    assert(bsw > 0 && bsh > 0);
  405|       |
  406|   325k|    for (int r = 0; r < row_end; r += bsh) {
  ------------------
  |  Branch (406:21): [True: 213k, False: 111k]
  ------------------
  407|   213k|      const int offsetr = blk_row + r;
  408|   617k|      for (int c = 0; c < col_end; c += bsw) {
  ------------------
  |  Branch (408:23): [True: 403k, False: 213k]
  ------------------
  409|   403k|        const int offsetc = blk_col + c;
  410|   403k|        pack_txb_tokens(w, cm, x, tp, tok_end, xd, mbmi, plane, plane_bsize,
  411|   403k|                        bit_depth, block, offsetr, offsetc, sub_txs,
  412|   403k|                        token_stats);
  413|   403k|        block += step;
  414|   403k|      }
  415|   213k|    }
  416|   111k|  }
  417|  1.28M|}
bitstream.c:obu_memmove_unsafe:
 3479|  73.6k|                                 size_t obu_payload_size, uint8_t *data) {
 3480|  73.6k|  const size_t length_field_size = aom_uleb_size_in_bytes(obu_payload_size);
 3481|  73.6k|  const size_t move_dst_offset = obu_header_size + length_field_size;
 3482|  73.6k|  const size_t move_src_offset = obu_header_size;
 3483|  73.6k|  const size_t move_size = obu_payload_size;
 3484|  73.6k|  memmove(data + move_dst_offset, data + move_src_offset, move_size);
 3485|  73.6k|  return length_field_size;
 3486|  73.6k|}
bitstream.c:av1_write_uleb_obu_size_unsafe:
 3447|  73.6k|                                          uint8_t *dest) {
 3448|  73.6k|  size_t coded_obu_size = 0;
 3449|       |
 3450|  73.6k|  if (aom_uleb_encode(obu_payload_size, sizeof(uint32_t), dest,
  ------------------
  |  Branch (3450:7): [True: 0, False: 73.6k]
  ------------------
 3451|  73.6k|                      &coded_obu_size) != 0) {
 3452|      0|    return AOM_CODEC_ERROR;
 3453|      0|  }
 3454|       |
 3455|  73.6k|  return AOM_CODEC_OK;
 3456|  73.6k|}
bitstream.c:obu_memmove:
 3460|  18.4k|                          uint8_t *data, size_t data_size) {
 3461|  18.4k|  const size_t length_field_size = aom_uleb_size_in_bytes(obu_payload_size);
 3462|  18.4k|  const size_t move_dst_offset = obu_header_size + length_field_size;
 3463|  18.4k|  const size_t move_src_offset = obu_header_size;
 3464|  18.4k|  const size_t move_size = obu_payload_size;
 3465|  18.4k|  if (move_size > data_size || move_src_offset > data_size - move_size) {
  ------------------
  |  Branch (3465:7): [True: 0, False: 18.4k]
  |  Branch (3465:32): [True: 0, False: 18.4k]
  ------------------
 3466|      0|    assert(0 && "obu_memmove: output buffer overflow");
 3467|      0|    return 0;
 3468|      0|  }
 3469|  18.4k|  if (move_dst_offset > data_size - move_size) {
  ------------------
  |  Branch (3469:7): [True: 0, False: 18.4k]
  ------------------
 3470|       |    // Buffer full.
 3471|      0|    return 0;
 3472|      0|  }
 3473|  18.4k|  memmove(data + move_dst_offset, data + move_src_offset, move_size);
 3474|  18.4k|  return length_field_size;
 3475|  18.4k|}
bitstream.c:av1_write_metadata_array:
 4245|  73.6k|                                       size_t dst_size) {
 4246|  73.6k|  if (!cpi->source) return 0;
  ------------------
  |  Branch (4246:7): [True: 0, False: 73.6k]
  ------------------
 4247|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4248|  73.6k|  aom_metadata_array_t *arr = cpi->source->metadata;
 4249|  73.6k|  if (!arr) return 0;
  ------------------
  |  Branch (4249:7): [True: 73.6k, False: 0]
  ------------------
 4250|      0|  size_t obu_header_size = 0;
 4251|      0|  size_t obu_payload_size = 0;
 4252|      0|  size_t total_bytes_written = 0;
 4253|      0|  size_t length_field_size = 0;
 4254|      0|  for (size_t i = 0; i < arr->sz; i++) {
  ------------------
  |  Branch (4254:22): [True: 0, False: 0]
  ------------------
 4255|      0|    aom_metadata_t *current_metadata = arr->metadata_array[i];
 4256|      0|    if (current_metadata && current_metadata->payload) {
  ------------------
  |  Branch (4256:9): [True: 0, False: 0]
  |  Branch (4256:29): [True: 0, False: 0]
  ------------------
 4257|      0|      const int metadata_insert_location =
 4258|      0|          current_metadata->insert_flag & AOM_MIF_INSERT_LOCATION_MASK;
  ------------------
  |  |   38|      0|#define AOM_MIF_INSERT_LOCATION_MASK 0x0f
  ------------------
 4259|      0|      if ((cm->current_frame.frame_type == KEY_FRAME &&
  ------------------
  |  Branch (4259:12): [True: 0, False: 0]
  ------------------
 4260|      0|           metadata_insert_location == AOM_MIF_KEY_FRAME) ||
  ------------------
  |  Branch (4260:12): [True: 0, False: 0]
  ------------------
 4261|      0|          (cm->current_frame.frame_type != KEY_FRAME &&
  ------------------
  |  Branch (4261:12): [True: 0, False: 0]
  ------------------
 4262|      0|           metadata_insert_location == AOM_MIF_NON_KEY_FRAME) ||
  ------------------
  |  Branch (4262:12): [True: 0, False: 0]
  ------------------
 4263|      0|          metadata_insert_location == AOM_MIF_ANY_FRAME) {
  ------------------
  |  Branch (4263:11): [True: 0, False: 0]
  ------------------
 4264|       |        // OBU header is either one or two bytes.
 4265|      0|        if (dst_size < 2) {
  ------------------
  |  Branch (4265:13): [True: 0, False: 0]
  ------------------
 4266|      0|          aom_internal_error(cm->error, AOM_CODEC_ERROR,
 4267|      0|                             "av1_write_metadata_array: output buffer full");
 4268|      0|        }
 4269|      0|        const bool is_layer_specific_obu =
 4270|      0|            (current_metadata->insert_flag & AOM_MIF_LAYER_SPECIFIC) != 0;
  ------------------
  |  |   34|      0|#define AOM_MIF_LAYER_SPECIFIC 0x10
  ------------------
 4271|      0|        obu_header_size = av1_write_obu_header(
 4272|      0|            &cpi->ppi->level_params, &cpi->frame_header_count, OBU_METADATA,
 4273|      0|            cm->seq_params->has_nonzero_operating_point_idc,
 4274|      0|            is_layer_specific_obu, 0, dst);
 4275|      0|        assert(obu_header_size <= 2);
 4276|      0|        obu_payload_size =
 4277|      0|            av1_write_metadata_obu(current_metadata, dst + obu_header_size,
 4278|      0|                                   dst_size - obu_header_size);
 4279|      0|        if (obu_payload_size == 0) {
  ------------------
  |  Branch (4279:13): [True: 0, False: 0]
  ------------------
 4280|      0|          aom_internal_error(cm->error, AOM_CODEC_ERROR,
 4281|      0|                             "av1_write_metadata_array: output buffer full");
 4282|      0|        }
 4283|      0|        length_field_size =
 4284|      0|            obu_memmove(obu_header_size, obu_payload_size, dst, dst_size);
 4285|      0|        if (length_field_size == 0) {
  ------------------
  |  Branch (4285:13): [True: 0, False: 0]
  ------------------
 4286|      0|          aom_internal_error(cm->error, AOM_CODEC_ERROR,
 4287|      0|                             "av1_write_metadata_array: output buffer full");
 4288|      0|        }
 4289|      0|        if (av1_write_uleb_obu_size(obu_payload_size, dst + obu_header_size,
  ------------------
  |  Branch (4289:13): [True: 0, False: 0]
  ------------------
 4290|      0|                                    length_field_size) == AOM_CODEC_OK) {
 4291|      0|          const size_t obu_size =
 4292|      0|              obu_header_size + length_field_size + obu_payload_size;
 4293|      0|          dst += obu_size;
 4294|      0|          dst_size -= obu_size;
 4295|      0|          total_bytes_written += obu_size;
 4296|      0|        } else {
 4297|      0|          aom_internal_error(cpi->common.error, AOM_CODEC_ERROR,
 4298|      0|                             "av1_write_metadata_array: output buffer full");
 4299|      0|        }
 4300|      0|      }
 4301|      0|    }
 4302|      0|  }
 4303|      0|  return total_bytes_written;
 4304|  73.6k|}
bitstream.c:write_tiles_in_tg_obus:
 4201|  73.6k|                                       int *const largest_tile_id) {
 4202|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4203|  73.6k|  const CommonTileParams *const tiles = &cm->tiles;
 4204|  73.6k|  *largest_tile_id = 0;
 4205|       |
 4206|       |  // Select the coding strategy (temporal or spatial)
 4207|  73.6k|  if (cm->seg.enabled && cm->seg.update_map) {
  ------------------
  |  Branch (4207:7): [True: 0, False: 73.6k]
  |  Branch (4207:26): [True: 0, False: 0]
  ------------------
 4208|      0|    if (cm->features.primary_ref_frame == PRIMARY_REF_NONE) {
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (4208:9): [True: 0, False: 0]
  ------------------
 4209|      0|      cm->seg.temporal_update = 0;
 4210|      0|    } else {
 4211|      0|      cm->seg.temporal_update = 1;
 4212|      0|      if (cpi->td.rd_counts.seg_tmp_pred_cost[0] <
  ------------------
  |  Branch (4212:11): [True: 0, False: 0]
  ------------------
 4213|      0|          cpi->td.rd_counts.seg_tmp_pred_cost[1])
 4214|      0|        cm->seg.temporal_update = 0;
 4215|      0|    }
 4216|      0|  }
 4217|       |
 4218|  73.6k|  if (tiles->large_scale)
  ------------------
  |  Branch (4218:7): [True: 0, False: 73.6k]
  ------------------
 4219|      0|    return pack_large_scale_tiles_in_tg_obus(
 4220|      0|        cpi, dst, dst_size, saved_wb, obu_extension_header, largest_tile_id);
 4221|       |
 4222|  73.6k|  return pack_tiles_in_tg_obus(cpi, dst, dst_size, saved_wb,
 4223|  73.6k|                               obu_extension_header, fh_info, largest_tile_id);
 4224|  73.6k|}
bitstream.c:remux_tiles:
 3287|  18.5k|                       int *const tile_col_size_bytes) {
 3288|       |  // Choose the tile size bytes (tsb) and tile column size bytes (tcsb)
 3289|  18.5k|  int tsb;
 3290|  18.5k|  int tcsb;
 3291|       |
 3292|  18.5k|  if (tiles->large_scale) {
  ------------------
  |  Branch (3292:7): [True: 0, False: 18.5k]
  ------------------
 3293|       |    // The top bit in the tile size field indicates tile copy mode, so we
 3294|       |    // have 1 less bit to code the tile size
 3295|      0|    tsb = choose_size_bytes(max_tile_size, 1);
 3296|      0|    tcsb = choose_size_bytes(max_tile_col_size, 0);
 3297|  18.5k|  } else {
 3298|  18.5k|    tsb = choose_size_bytes(max_tile_size, 0);
 3299|  18.5k|    tcsb = 4;  // This is ignored
 3300|  18.5k|    (void)max_tile_col_size;
 3301|  18.5k|  }
 3302|       |
 3303|  18.5k|  assert(tsb > 0);
 3304|  18.5k|  assert(tcsb > 0);
 3305|       |
 3306|  18.5k|  *tile_size_bytes = tsb;
 3307|  18.5k|  *tile_col_size_bytes = tcsb;
 3308|  18.5k|  if (tsb == 4 && tcsb == 4) return data_size;
  ------------------
  |  Branch (3308:7): [True: 0, False: 18.5k]
  |  Branch (3308:19): [True: 0, False: 0]
  ------------------
 3309|       |
 3310|  18.5k|  uint32_t wpos = 0;
 3311|  18.5k|  uint32_t rpos = 0;
 3312|       |
 3313|  18.5k|  if (tiles->large_scale) {
  ------------------
  |  Branch (3313:7): [True: 0, False: 18.5k]
  ------------------
 3314|      0|    int tile_row;
 3315|      0|    int tile_col;
 3316|       |
 3317|      0|    for (tile_col = 0; tile_col < tiles->cols; tile_col++) {
  ------------------
  |  Branch (3317:24): [True: 0, False: 0]
  ------------------
 3318|       |      // All but the last column has a column header
 3319|      0|      if (tile_col < tiles->cols - 1) {
  ------------------
  |  Branch (3319:11): [True: 0, False: 0]
  ------------------
 3320|      0|        uint32_t tile_col_size = mem_get_le32(dst + rpos);
  ------------------
  |  |  124|      0|#define mem_get_le32 mem_ops_wrap_symbol(mem_get_le32)
  |  |  ------------------
  |  |  |  |   51|      0|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3321|      0|        rpos += 4;
 3322|       |
 3323|       |        // Adjust the tile column size by the number of bytes removed
 3324|       |        // from the tile size fields.
 3325|      0|        tile_col_size -= (4 - tsb) * tiles->rows;
 3326|       |
 3327|      0|        mem_put_varsize(dst + wpos, tcsb, tile_col_size);
 3328|      0|        wpos += tcsb;
 3329|      0|      }
 3330|       |
 3331|      0|      for (tile_row = 0; tile_row < tiles->rows; tile_row++) {
  ------------------
  |  Branch (3331:26): [True: 0, False: 0]
  ------------------
 3332|       |        // All, including the last row has a header
 3333|      0|        uint32_t tile_header = mem_get_le32(dst + rpos);
  ------------------
  |  |  124|      0|#define mem_get_le32 mem_ops_wrap_symbol(mem_get_le32)
  |  |  ------------------
  |  |  |  |   51|      0|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3334|      0|        rpos += 4;
 3335|       |
 3336|       |        // If this is a copy tile, we need to shift the MSB to the
 3337|       |        // top bit of the new width, and there is no data to copy.
 3338|      0|        if (tile_header >> 31 != 0) {
  ------------------
  |  Branch (3338:13): [True: 0, False: 0]
  ------------------
 3339|      0|          if (tsb < 4) tile_header >>= 32 - 8 * tsb;
  ------------------
  |  Branch (3339:15): [True: 0, False: 0]
  ------------------
 3340|      0|          mem_put_varsize(dst + wpos, tsb, tile_header);
 3341|      0|          wpos += tsb;
 3342|      0|        } else {
 3343|      0|          mem_put_varsize(dst + wpos, tsb, tile_header);
 3344|      0|          wpos += tsb;
 3345|       |
 3346|      0|          tile_header += AV1_MIN_TILE_SIZE_BYTES;
  ------------------
  |  |   55|      0|#define AV1_MIN_TILE_SIZE_BYTES 1
  ------------------
 3347|      0|          memmove(dst + wpos, dst + rpos, tile_header);
 3348|      0|          rpos += tile_header;
 3349|      0|          wpos += tile_header;
 3350|      0|        }
 3351|      0|      }
 3352|      0|    }
 3353|       |
 3354|      0|    assert(rpos > wpos);
 3355|      0|    assert(rpos == data_size);
 3356|       |
 3357|      0|    return wpos;
 3358|      0|  }
 3359|  18.5k|  const int n_tiles = tiles->cols * tiles->rows;
 3360|  18.5k|  int n;
 3361|       |
 3362|  81.1k|  for (n = 0; n < n_tiles; n++) {
  ------------------
  |  Branch (3362:15): [True: 62.5k, False: 18.5k]
  ------------------
 3363|  62.5k|    int tile_size;
 3364|       |
 3365|  62.5k|    if (n == n_tiles - 1) {
  ------------------
  |  Branch (3365:9): [True: 18.5k, False: 44.0k]
  ------------------
 3366|  18.5k|      tile_size = data_size - rpos;
 3367|  44.0k|    } else {
 3368|  44.0k|      tile_size = mem_get_le32(dst + rpos);
  ------------------
  |  |  124|  44.0k|#define mem_get_le32 mem_ops_wrap_symbol(mem_get_le32)
  |  |  ------------------
  |  |  |  |   51|  44.0k|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  44.0k|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  44.0k|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3369|  44.0k|      rpos += 4;
 3370|  44.0k|      mem_put_varsize(dst + wpos, tsb, tile_size);
 3371|  44.0k|      tile_size += AV1_MIN_TILE_SIZE_BYTES;
  ------------------
  |  |   55|  44.0k|#define AV1_MIN_TILE_SIZE_BYTES 1
  ------------------
 3372|  44.0k|      wpos += tsb;
 3373|  44.0k|    }
 3374|       |
 3375|  62.5k|    memmove(dst + wpos, dst + rpos, tile_size);
 3376|       |
 3377|  62.5k|    rpos += tile_size;
 3378|  62.5k|    wpos += tile_size;
 3379|  62.5k|  }
 3380|       |
 3381|  18.5k|  assert(rpos > wpos);
 3382|  18.5k|  assert(rpos == data_size);
 3383|       |
 3384|  18.5k|  return wpos;
 3385|  18.5k|}
bitstream.c:choose_size_bytes:
 3252|  18.5k|static int choose_size_bytes(uint32_t size, int spare_msbs) {
 3253|       |  // Choose the number of bytes required to represent size, without
 3254|       |  // using the 'spare_msbs' number of most significant bits.
 3255|       |
 3256|       |  // Make sure we will fit in 4 bytes to start with..
 3257|  18.5k|  if (spare_msbs > 0 && size >> (32 - spare_msbs) != 0) return -1;
  ------------------
  |  Branch (3257:7): [True: 0, False: 18.5k]
  |  Branch (3257:25): [True: 0, False: 0]
  ------------------
 3258|       |
 3259|       |  // Normalise to 32 bits
 3260|  18.5k|  size <<= spare_msbs;
 3261|       |
 3262|  18.5k|  if (size >> 24 != 0)
  ------------------
  |  Branch (3262:7): [True: 0, False: 18.5k]
  ------------------
 3263|      0|    return 4;
 3264|  18.5k|  else if (size >> 16 != 0)
  ------------------
  |  Branch (3264:12): [True: 1, False: 18.5k]
  ------------------
 3265|      1|    return 3;
 3266|  18.5k|  else if (size >> 8 != 0)
  ------------------
  |  Branch (3266:12): [True: 11.1k, False: 7.37k]
  ------------------
 3267|  11.1k|    return 2;
 3268|  7.37k|  else
 3269|  7.37k|    return 1;
 3270|  18.5k|}
bitstream.c:mem_put_varsize:
 3273|  44.0k|                                   const int val) {
 3274|  44.0k|  switch (sz) {
 3275|  14.4k|    case 1: dst[0] = (uint8_t)(val & 0xff); break;
  ------------------
  |  Branch (3275:5): [True: 14.4k, False: 29.6k]
  ------------------
 3276|  29.6k|    case 2: mem_put_le16(dst, val); break;
  ------------------
  |  |  199|  29.6k|#define mem_put_le16 mem_ops_wrap_symbol(mem_put_le16)
  |  |  ------------------
  |  |  |  |   51|  29.6k|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  29.6k|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  29.6k|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3276:5): [True: 29.6k, False: 14.4k]
  ------------------
 3277|      1|    case 3: mem_put_le24(dst, val); break;
  ------------------
  |  |  208|      1|#define mem_put_le24 mem_ops_wrap_symbol(mem_put_le24)
  |  |  ------------------
  |  |  |  |   51|      1|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      1|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      1|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3277:5): [True: 1, False: 44.0k]
  ------------------
 3278|      0|    case 4: mem_put_le32(dst, val); break;
  ------------------
  |  |  218|      0|#define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32)
  |  |  ------------------
  |  |  |  |   51|      0|#define mem_ops_wrap_symbol(fn) mem_ops_wrap_symbol2(fn, MEM_VALUE_T)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define mem_ops_wrap_symbol2(fn, typ) mem_ops_wrap_symbol3(fn, typ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define mem_ops_wrap_symbol3(fn, typ) fn##_as_##typ
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3278:5): [True: 0, False: 44.0k]
  ------------------
 3279|      0|    default: assert(0 && "Invalid size"); break;
  ------------------
  |  Branch (3279:5): [True: 0, False: 44.0k]
  ------------------
 3280|  44.0k|  }
 3281|  44.0k|}
bitstream.c:pack_tiles_in_tg_obus:
 4164|  73.6k|    const FrameHeaderInfo *fh_info, int *const largest_tile_id) {
 4165|  73.6k|  const CommonTileParams *const tiles = &cpi->common.tiles;
 4166|  73.6k|  uint32_t total_size = 0;
 4167|  73.6k|  unsigned int max_tile_size = 0;
 4168|  73.6k|  uint32_t obu_header_size = 0;
 4169|  73.6k|  uint8_t *tile_data_start = dst;
 4170|  73.6k|  const int tile_cols = tiles->cols;
 4171|  73.6k|  const int tile_rows = tiles->rows;
 4172|  73.6k|  const int num_tiles = tile_rows * tile_cols;
 4173|       |
 4174|  73.6k|  const int num_workers = calc_pack_bs_mt_workers(
 4175|  73.6k|      cpi->tile_data, num_tiles, cpi->mt_info.num_mod_workers[MOD_PACK_BS],
 4176|  73.6k|      cpi->mt_info.pack_bs_mt_enabled);
 4177|       |
 4178|  73.6k|  if (num_workers > 1) {
  ------------------
  |  Branch (4178:7): [True: 13.1k, False: 60.4k]
  ------------------
 4179|  13.1k|    av1_write_tile_obu_mt(cpi, dst, dst_size, &total_size, saved_wb,
 4180|  13.1k|                          obu_extension_header, fh_info, largest_tile_id,
 4181|  13.1k|                          &max_tile_size, &obu_header_size, &tile_data_start,
 4182|  13.1k|                          num_workers);
 4183|  60.4k|  } else {
 4184|  60.4k|    write_tile_obu(cpi, dst, dst_size, &total_size, saved_wb,
 4185|  60.4k|                   obu_extension_header, fh_info, largest_tile_id,
 4186|  60.4k|                   &max_tile_size, &obu_header_size, &tile_data_start);
 4187|  60.4k|  }
 4188|       |
 4189|  73.6k|  if (num_tiles > 1)
  ------------------
  |  Branch (4189:7): [True: 18.5k, False: 55.0k]
  ------------------
 4190|  18.5k|    write_tile_obu_size(cpi, dst, dst_size, saved_wb, *largest_tile_id,
 4191|  18.5k|                        &total_size, max_tile_size, obu_header_size,
 4192|  18.5k|                        tile_data_start);
 4193|  73.6k|  return total_size;
 4194|  73.6k|}
bitstream.c:calc_pack_bs_mt_workers:
 4134|  73.6k|                                   int avail_workers, bool pack_bs_mt_enabled) {
 4135|  73.6k|  if (!pack_bs_mt_enabled) return 1;
  ------------------
  |  Branch (4135:7): [True: 59.9k, False: 13.6k]
  ------------------
 4136|       |
 4137|  13.6k|  uint64_t frame_abs_sum_level = 0;
 4138|       |
 4139|  62.7k|  for (int idx = 0; idx < num_tiles; idx++)
  ------------------
  |  Branch (4139:21): [True: 49.0k, False: 13.6k]
  ------------------
 4140|  49.0k|    frame_abs_sum_level += tile_data[idx].abs_sum_level;
 4141|       |
 4142|  13.6k|  int ideal_num_workers = 1;
 4143|  13.6k|  const float job_disp_time_const = (float)num_tiles * JOB_DISP_TIME_OH_CONST;
  ------------------
  |  |   56|  13.6k|#define JOB_DISP_TIME_OH_CONST 1  // Job dispatch time overhead per tile
  ------------------
 4144|  13.6k|  float max_sum = 0.0;
 4145|       |
 4146|  45.3k|  for (int num_workers = avail_workers; num_workers > 1; num_workers--) {
  ------------------
  |  Branch (4146:41): [True: 31.6k, False: 13.6k]
  ------------------
 4147|  31.6k|    const float fas_per_worker_const =
 4148|  31.6k|        ((float)(num_workers - 1) / num_workers) * frame_abs_sum_level;
 4149|  31.6k|    const float setup_time_const = (float)num_workers * SETUP_TIME_OH_CONST;
  ------------------
  |  |   55|  31.6k|#define SETUP_TIME_OH_CONST 5     // Setup time overhead constant per worker
  ------------------
 4150|  31.6k|    const float this_sum = fas_per_worker_const - setup_time_const -
 4151|  31.6k|                           job_disp_time_const / num_workers;
 4152|       |
 4153|  31.6k|    if (this_sum > max_sum) {
  ------------------
  |  Branch (4153:9): [True: 13.9k, False: 17.7k]
  ------------------
 4154|  13.9k|      max_sum = this_sum;
 4155|  13.9k|      ideal_num_workers = num_workers;
 4156|  13.9k|    }
 4157|  31.6k|  }
 4158|  13.6k|  return ideal_num_workers;
 4159|  73.6k|}
bitstream.c:write_tile_obu:
 3988|  60.4k|    uint32_t *const obu_header_size, uint8_t **tile_data_start) {
 3989|  60.4k|  AV1_COMMON *const cm = &cpi->common;
 3990|  60.4k|  MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 3991|  60.4k|  const CommonTileParams *const tiles = &cm->tiles;
 3992|  60.4k|  const int tile_cols = tiles->cols;
 3993|  60.4k|  const int tile_rows = tiles->rows;
 3994|       |  // Fixed size tile groups for the moment
 3995|  60.4k|  const int num_tg_hdrs = cpi->num_tg;
 3996|  60.4k|  const int tg_size = (tile_rows * tile_cols + num_tg_hdrs - 1) / num_tg_hdrs;
 3997|  60.4k|  int tile_count = 0;
 3998|  60.4k|  size_t curr_tg_data_size = 0;
 3999|  60.4k|  uint8_t *tile_data_curr = dst;
 4000|  60.4k|  int new_tg = 1;
 4001|  60.4k|  int is_first_tg = 1;
 4002|       |
 4003|  60.4k|  av1_reset_pack_bs_thread_data(&cpi->td);
 4004|   125k|  for (int tile_row = 0; tile_row < tile_rows; tile_row++) {
  ------------------
  |  Branch (4004:26): [True: 64.8k, False: 60.4k]
  ------------------
 4005|   134k|    for (int tile_col = 0; tile_col < tile_cols; tile_col++) {
  ------------------
  |  Branch (4005:28): [True: 70.0k, False: 64.8k]
  ------------------
 4006|  70.0k|      const int tile_idx = tile_row * tile_cols + tile_col;
 4007|  70.0k|      TileDataEnc *this_tile = &cpi->tile_data[tile_idx];
 4008|       |
 4009|  70.0k|      int is_last_tile_in_tg = 0;
 4010|  70.0k|      if (new_tg) {
  ------------------
  |  Branch (4010:11): [True: 60.4k, False: 9.54k]
  ------------------
 4011|  60.4k|        tile_data_curr = dst + *total_size;
 4012|  60.4k|        tile_count = 0;
 4013|  60.4k|      }
 4014|  70.0k|      tile_count++;
 4015|       |
 4016|  70.0k|      if (tile_count == tg_size || tile_idx == (tile_cols * tile_rows - 1))
  ------------------
  |  Branch (4016:11): [True: 60.4k, False: 9.54k]
  |  Branch (4016:36): [True: 0, False: 9.54k]
  ------------------
 4017|  60.4k|        is_last_tile_in_tg = 1;
 4018|       |
 4019|  70.0k|      xd->tile_ctx = &this_tile->tctx;
 4020|       |
 4021|       |      // PackBSParams stores all parameters required to pack tile and header
 4022|       |      // info.
 4023|  70.0k|      PackBSParams pack_bs_params;
 4024|  70.0k|      pack_bs_params.dst = dst;
 4025|  70.0k|      pack_bs_params.tile_buf_size = dst_size;
 4026|  70.0k|      pack_bs_params.curr_tg_hdr_size = 0;
 4027|  70.0k|      pack_bs_params.is_last_tile_in_tg = is_last_tile_in_tg;
 4028|  70.0k|      pack_bs_params.new_tg = new_tg;
 4029|  70.0k|      pack_bs_params.obu_extn_header = obu_extn_header;
 4030|  70.0k|      pack_bs_params.obu_header_size = 0;
 4031|  70.0k|      pack_bs_params.saved_wb = saved_wb;
 4032|  70.0k|      pack_bs_params.tile_col = tile_col;
 4033|  70.0k|      pack_bs_params.tile_row = tile_row;
 4034|  70.0k|      pack_bs_params.tile_data_curr = tile_data_curr;
 4035|  70.0k|      pack_bs_params.total_size = total_size;
 4036|       |
 4037|  70.0k|      if (new_tg)
  ------------------
  |  Branch (4037:11): [True: 60.4k, False: 9.54k]
  ------------------
 4038|  60.4k|        av1_write_obu_tg_tile_headers(cpi, xd, &pack_bs_params, tile_idx);
 4039|       |
 4040|  70.0k|      av1_pack_tile_info(cpi, &cpi->td, &pack_bs_params);
 4041|       |
 4042|  70.0k|      if (new_tg) {
  ------------------
  |  Branch (4042:11): [True: 60.4k, False: 9.54k]
  ------------------
 4043|  60.4k|        curr_tg_data_size = pack_bs_params.curr_tg_hdr_size;
 4044|  60.4k|        *tile_data_start += pack_bs_params.curr_tg_hdr_size;
 4045|  60.4k|        *obu_header_size = pack_bs_params.obu_header_size;
 4046|  60.4k|        new_tg = 0;
 4047|  60.4k|      }
 4048|  70.0k|      if (is_last_tile_in_tg) new_tg = 1;
  ------------------
  |  Branch (4048:11): [True: 60.4k, False: 9.54k]
  ------------------
 4049|       |
 4050|  70.0k|      curr_tg_data_size +=
 4051|  70.0k|          (pack_bs_params.buf.size + (is_last_tile_in_tg ? 0 : 4));
  ------------------
  |  Branch (4051:39): [True: 60.4k, False: 9.54k]
  ------------------
 4052|       |
 4053|  70.0k|      if (pack_bs_params.buf.size > *max_tile_size) {
  ------------------
  |  Branch (4053:11): [True: 61.8k, False: 8.18k]
  ------------------
 4054|  61.8k|        *largest_tile_id = tile_idx;
 4055|  61.8k|        *max_tile_size = (unsigned int)pack_bs_params.buf.size;
 4056|  61.8k|      }
 4057|       |
 4058|  70.0k|      if (is_last_tile_in_tg)
  ------------------
  |  Branch (4058:11): [True: 60.4k, False: 9.54k]
  ------------------
 4059|  60.4k|        av1_write_last_tile_info(cpi, fh_info, saved_wb, &curr_tg_data_size,
 4060|  60.4k|                                 tile_data_curr, total_size, tile_data_start,
 4061|  60.4k|                                 largest_tile_id, &is_first_tg,
 4062|  60.4k|                                 *obu_header_size, obu_extn_header);
 4063|  70.0k|      *total_size += (uint32_t)pack_bs_params.buf.size;
 4064|  70.0k|    }
 4065|  64.8k|  }
 4066|  60.4k|  av1_accumulate_pack_bs_thread_data(cpi, &cpi->td);
 4067|  60.4k|}
bitstream.c:write_tile_obu_size:
 4077|  18.5k|                                uint8_t *tile_data_start) {
 4078|       |  // TODO: bug 42302568 - Use dst_size.
 4079|  18.5k|  (void)dst_size;
 4080|  18.5k|  const CommonTileParams *const tiles = &cpi->common.tiles;
 4081|       |
 4082|       |  // Fill in context_update_tile_id indicating the tile to use for the
 4083|       |  // cdf update. The encoder currently sets it to the largest tile
 4084|       |  // (but is up to the encoder)
 4085|  18.5k|  aom_wb_overwrite_literal(saved_wb, largest_tile_id,
 4086|  18.5k|                           (tiles->log2_cols + tiles->log2_rows));
 4087|       |  // If more than one tile group. tile_size_bytes takes the default value 4
 4088|       |  // and does not need to be set. For a single tile group it is set in the
 4089|       |  // section below.
 4090|  18.5k|  if (cpi->num_tg != 1) return;
  ------------------
  |  Branch (4090:7): [True: 0, False: 18.5k]
  ------------------
 4091|  18.5k|  int tile_size_bytes = 4, unused;
 4092|  18.5k|  const uint32_t tile_data_offset = (uint32_t)(tile_data_start - dst);
 4093|  18.5k|  const uint32_t tile_data_size = *total_size - tile_data_offset;
 4094|       |
 4095|  18.5k|  *total_size = remux_tiles(tiles, tile_data_start, tile_data_size,
 4096|  18.5k|                            max_tile_size, 0, &tile_size_bytes, &unused);
 4097|  18.5k|  *total_size += tile_data_offset;
 4098|  18.5k|  assert(tile_size_bytes >= 1 && tile_size_bytes <= 4);
 4099|       |
 4100|  18.5k|  aom_wb_overwrite_literal(saved_wb, tile_size_bytes - 1, 2);
 4101|       |
 4102|       |  // Update the OBU length if remux_tiles() reduced the size.
 4103|  18.5k|  uint64_t payload_size;
 4104|  18.5k|  size_t length_field_size;
 4105|  18.5k|  int res =
 4106|  18.5k|      aom_uleb_decode(dst + obu_header_size, *total_size - obu_header_size,
 4107|  18.5k|                      &payload_size, &length_field_size);
 4108|  18.5k|  assert(res == 0);
 4109|  18.5k|  (void)res;
 4110|       |
 4111|  18.5k|  const uint64_t new_payload_size =
 4112|  18.5k|      *total_size - obu_header_size - length_field_size;
 4113|  18.5k|  if (new_payload_size != payload_size) {
  ------------------
  |  Branch (4113:7): [True: 18.5k, False: 0]
  ------------------
 4114|  18.5k|    size_t new_length_field_size;
 4115|  18.5k|    res = aom_uleb_encode(new_payload_size, length_field_size,
 4116|  18.5k|                          dst + obu_header_size, &new_length_field_size);
 4117|  18.5k|    assert(res == 0);
 4118|  18.5k|    if (new_length_field_size < length_field_size) {
  ------------------
  |  Branch (4118:9): [True: 90, False: 18.4k]
  ------------------
 4119|     90|      const size_t src_offset = obu_header_size + length_field_size;
 4120|     90|      const size_t dst_offset = obu_header_size + new_length_field_size;
 4121|     90|      memmove(dst + dst_offset, dst + src_offset, (size_t)payload_size);
 4122|     90|      *total_size -= (int)(length_field_size - new_length_field_size);
 4123|     90|    }
 4124|  18.5k|  }
 4125|  18.5k|}

bitstream.c:tx_size_to_depth:
 1521|  1.30M|static inline int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
 1522|  1.30M|  TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
 1523|  1.30M|  int depth = 0;
 1524|  1.66M|  while (tx_size != ctx_size) {
  ------------------
  |  Branch (1524:10): [True: 360k, False: 1.30M]
  ------------------
 1525|   360k|    depth++;
 1526|   360k|    ctx_size = sub_tx_size_map[ctx_size];
 1527|       |    assert(depth <= MAX_TX_DEPTH);
 1528|   360k|  }
 1529|  1.30M|  return depth;
 1530|  1.30M|}
palette.c:tx_size_to_depth:
 1521|   436k|static inline int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
 1522|   436k|  TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
 1523|   436k|  int depth = 0;
 1524|   700k|  while (tx_size != ctx_size) {
  ------------------
  |  Branch (1524:10): [True: 263k, False: 436k]
  ------------------
 1525|   263k|    depth++;
 1526|   263k|    ctx_size = sub_tx_size_map[ctx_size];
 1527|       |    assert(depth <= MAX_TX_DEPTH);
 1528|   263k|  }
 1529|   436k|  return depth;
 1530|   436k|}
partition_search.c:tx_size_to_depth:
 1521|  1.45M|static inline int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
 1522|  1.45M|  TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
 1523|  1.45M|  int depth = 0;
 1524|  1.82M|  while (tx_size != ctx_size) {
  ------------------
  |  Branch (1524:10): [True: 361k, False: 1.45M]
  ------------------
 1525|   361k|    depth++;
 1526|   361k|    ctx_size = sub_tx_size_map[ctx_size];
 1527|       |    assert(depth <= MAX_TX_DEPTH);
 1528|   361k|  }
 1529|  1.45M|  return depth;
 1530|  1.45M|}
rdopt.c:zero_winner_mode_stats:
 1465|  1.91M|                                          WinnerModeStats *stats) {
 1466|       |  // When winner mode stats are not required, the memory allocation is avoided
 1467|       |  // for x->winner_mode_stats. The stats pointer will be NULL in such cases.
 1468|  1.91M|  if (stats == NULL) return;
  ------------------
  |  Branch (1468:7): [True: 1.91M, False: 12]
  ------------------
 1469|       |
 1470|     12|  const int block_height = block_size_high[bsize];
 1471|     12|  const int block_width = block_size_wide[bsize];
 1472|     12|  for (int i = 0; i < n_stats; ++i) {
  ------------------
  |  Branch (1472:19): [True: 0, False: 12]
  ------------------
 1473|      0|    WinnerModeStats *const stat = &stats[i];
 1474|      0|    memset(&stat->mbmi, 0, sizeof(stat->mbmi));
 1475|      0|    memset(&stat->rd_cost, 0, sizeof(stat->rd_cost));
 1476|      0|    memset(&stat->rd, 0, sizeof(stat->rd));
 1477|      0|    memset(&stat->rate_y, 0, sizeof(stat->rate_y));
 1478|      0|    memset(&stat->rate_uv, 0, sizeof(stat->rate_uv));
 1479|       |    // Do not reset the whole array as it is CPU intensive.
 1480|      0|    memset(&stat->color_index_map, 0,
 1481|      0|           block_width * block_height * sizeof(stat->color_index_map[0]));
 1482|      0|    memset(&stat->mode_index, 0, sizeof(stat->mode_index));
 1483|      0|  }
 1484|     12|}
tx_search.c:tx_size_to_depth:
 1521|  4.10M|static inline int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
 1522|  4.10M|  TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
 1523|  4.10M|  int depth = 0;
 1524|  6.12M|  while (tx_size != ctx_size) {
  ------------------
  |  Branch (1524:10): [True: 2.02M, False: 4.10M]
  ------------------
 1525|  2.02M|    depth++;
 1526|  2.02M|    ctx_size = sub_tx_size_map[ctx_size];
 1527|       |    assert(depth <= MAX_TX_DEPTH);
 1528|  2.02M|  }
 1529|  4.10M|  return depth;
 1530|  4.10M|}
intra_mode_search.c:zero_winner_mode_stats:
 1465|   439k|                                          WinnerModeStats *stats) {
 1466|       |  // When winner mode stats are not required, the memory allocation is avoided
 1467|       |  // for x->winner_mode_stats. The stats pointer will be NULL in such cases.
 1468|   439k|  if (stats == NULL) return;
  ------------------
  |  Branch (1468:7): [True: 439k, False: 18.4E]
  ------------------
 1469|       |
 1470|  18.4E|  const int block_height = block_size_high[bsize];
 1471|  18.4E|  const int block_width = block_size_wide[bsize];
 1472|  18.4E|  for (int i = 0; i < n_stats; ++i) {
  ------------------
  |  Branch (1472:19): [True: 0, False: 18.4E]
  ------------------
 1473|      0|    WinnerModeStats *const stat = &stats[i];
 1474|      0|    memset(&stat->mbmi, 0, sizeof(stat->mbmi));
 1475|      0|    memset(&stat->rd_cost, 0, sizeof(stat->rd_cost));
 1476|      0|    memset(&stat->rd, 0, sizeof(stat->rd));
 1477|      0|    memset(&stat->rate_y, 0, sizeof(stat->rate_y));
 1478|      0|    memset(&stat->rate_uv, 0, sizeof(stat->rate_uv));
 1479|       |    // Do not reset the whole array as it is CPU intensive.
 1480|      0|    memset(&stat->color_index_map, 0,
 1481|      0|           block_width * block_height * sizeof(stat->color_index_map[0]));
 1482|      0|    memset(&stat->mode_index, 0, sizeof(stat->mode_index));
 1483|      0|  }
 1484|  18.4E|}
intra_mode_search.c:tx_size_to_depth:
 1521|   336k|static inline int tx_size_to_depth(TX_SIZE tx_size, BLOCK_SIZE bsize) {
 1522|   336k|  TX_SIZE ctx_size = max_txsize_rect_lookup[bsize];
 1523|   336k|  int depth = 0;
 1524|   449k|  while (tx_size != ctx_size) {
  ------------------
  |  Branch (1524:10): [True: 112k, False: 336k]
  ------------------
 1525|   112k|    depth++;
 1526|   112k|    ctx_size = sub_tx_size_map[ctx_size];
 1527|       |    assert(depth <= MAX_TX_DEPTH);
 1528|   112k|  }
 1529|   336k|  return depth;
 1530|   336k|}

av1_find_cnn_layer_output_size:
  154|  3.90k|                                    int *out_width, int *out_height) {
  155|  3.90k|  assert(layer_config->skip_width > 0);
  156|  3.90k|  assert(layer_config->skip_height > 0);
  157|  3.90k|  if (!layer_config->deconvolve) {
  ------------------
  |  Branch (157:7): [True: 3.90k, False: 0]
  ------------------
  158|  3.90k|    switch (layer_config->pad) {
  159|      0|      case PADDING_SAME_ZERO:
  ------------------
  |  Branch (159:7): [True: 0, False: 3.90k]
  ------------------
  160|      0|      case PADDING_SAME_REPLICATE:
  ------------------
  |  Branch (160:7): [True: 0, False: 3.90k]
  ------------------
  161|      0|        *out_width = (in_width + layer_config->skip_width - 1) /
  162|      0|                     layer_config->skip_width;
  163|      0|        *out_height = (in_height + layer_config->skip_height - 1) /
  164|      0|                      layer_config->skip_height;
  165|      0|        break;
  166|  3.90k|      case PADDING_VALID:
  ------------------
  |  Branch (166:7): [True: 3.90k, False: 0]
  ------------------
  167|  3.90k|        *out_width =
  168|  3.90k|            (in_width - layer_config->filter_width + layer_config->skip_width) /
  169|  3.90k|            layer_config->skip_width;
  170|  3.90k|        *out_height = (in_height - layer_config->filter_height +
  171|  3.90k|                       layer_config->skip_height) /
  172|  3.90k|                      layer_config->skip_height;
  173|  3.90k|        break;
  174|      0|      default: assert(0 && "Unknown padding type");
  ------------------
  |  Branch (174:7): [True: 0, False: 3.90k]
  ------------------
  175|  3.90k|    }
  176|  3.90k|  } else {
  177|      0|    switch (layer_config->pad) {
  178|      0|      case PADDING_SAME_ZERO:
  ------------------
  |  Branch (178:7): [True: 0, False: 0]
  ------------------
  179|      0|      case PADDING_SAME_REPLICATE:
  ------------------
  |  Branch (179:7): [True: 0, False: 0]
  ------------------
  180|      0|        *out_width = in_width * layer_config->skip_width;
  181|      0|        *out_height = in_height * layer_config->skip_height;
  182|      0|        break;
  183|      0|      case PADDING_VALID:
  ------------------
  |  Branch (183:7): [True: 0, False: 0]
  ------------------
  184|      0|        *out_width = (in_width - 1) * layer_config->skip_width +
  185|      0|                     layer_config->filter_width;
  186|      0|        *out_height = (in_height - 1) * layer_config->skip_height +
  187|      0|                      layer_config->filter_height;
  188|      0|        break;
  189|      0|      default: assert(0 && "Unknown padding type");
  ------------------
  |  Branch (189:7): [True: 0, False: 0]
  ------------------
  190|      0|    }
  191|      0|  }
  192|  3.90k|}
av1_cnn_activate_c:
  310|  3.90k|                        int stride, ACTIVATION layer_activation) {
  311|  3.90k|  if (layer_activation == RELU) {
  ------------------
  |  Branch (311:7): [True: 3.90k, False: 0]
  ------------------
  312|  69.1k|    for (int c = 0; c < channels; ++c) {
  ------------------
  |  Branch (312:21): [True: 65.2k, False: 3.90k]
  ------------------
  313|   508k|      for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (313:23): [True: 442k, False: 65.2k]
  ------------------
  314|  5.43M|        for (int j = 0; j < width; ++j)
  ------------------
  |  Branch (314:25): [True: 4.99M, False: 442k]
  ------------------
  315|  4.99M|          output[c][i * stride + j] = relu(output[c][i * stride + j]);
  316|  65.2k|    }
  317|  3.90k|  } else if (layer_activation == SOFTSIGN) {
  ------------------
  |  Branch (317:14): [True: 0, False: 0]
  ------------------
  318|      0|    for (int c = 0; c < channels; ++c) {
  ------------------
  |  Branch (318:21): [True: 0, False: 0]
  ------------------
  319|      0|      for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (319:23): [True: 0, False: 0]
  ------------------
  320|      0|        for (int j = 0; j < width; ++j)
  ------------------
  |  Branch (320:25): [True: 0, False: 0]
  ------------------
  321|      0|          output[c][i * stride + j] = softsign(output[c][i * stride + j]);
  322|      0|    }
  323|      0|  } else if (layer_activation == SIGMOID) {
  ------------------
  |  Branch (323:14): [True: 0, False: 0]
  ------------------
  324|      0|    assert(0 && "Sigmoid has not been supported in CNN.");  // TO DO
  325|      0|  } else if (layer_activation != NONE) {
  ------------------
  |  Branch (325:14): [True: 0, False: 0]
  ------------------
  326|       |    assert(0 && "Unknown activation type");
  327|      0|  }
  328|  3.90k|}
av1_cnn_convolve_no_maxpool_padding_valid_c:
  618|  1.56k|    int start_idx, int cstep, int channel_step) {
  619|  1.56k|  assert((layer_config->skip_height == 1 && layer_config->skip_width == 1) ||
  620|  1.56k|         !layer_config->maxpool);
  621|  1.56k|  assert(layer_config->filter_height > 1 || layer_config->filter_width > 1);
  622|  1.56k|  assert(layer_config->pad == PADDING_VALID);
  623|  20.2k|  for (int i = start_idx; i < layer_config->out_channels; i += channel_step) {
  ------------------
  |  Branch (623:27): [True: 18.7k, False: 1.56k]
  ------------------
  624|  40.5k|    for (int h = 0, u = 0; h < in_height - layer_config->filter_height + 1;
  ------------------
  |  Branch (624:28): [True: 21.8k, False: 18.7k]
  ------------------
  625|  21.8k|         h += layer_config->skip_height, ++u) {
  626|  21.8k|      const int out_h = u * out_stride;
  627|  21.8k|      const int upper_ii_index = layer_config->filter_height + h;
  628|  21.8k|      for (int w = 0, out_index = out_h;
  629|  49.8k|           w < in_width - layer_config->filter_width + 1;
  ------------------
  |  Branch (629:12): [True: 28.0k, False: 21.8k]
  ------------------
  630|  28.0k|           w += layer_config->skip_width, ++out_index) {
  631|  28.0k|        const int upper_jj_index = layer_config->filter_width + w;
  632|  28.0k|        float sum = layer_config->bias[i];
  633|   337k|        for (int k = 0; k < layer_config->in_channels; ++k) {
  ------------------
  |  Branch (633:25): [True: 309k, False: 28.0k]
  ------------------
  634|   309k|          int off = k * layer_config->out_channels + i;
  635|   928k|          for (int ii = h; ii < upper_ii_index; ++ii) {
  ------------------
  |  Branch (635:28): [True: 618k, False: 309k]
  ------------------
  636|  1.85M|            for (int jj = w; jj < upper_jj_index; ++jj) {
  ------------------
  |  Branch (636:30): [True: 1.23M, False: 618k]
  ------------------
  637|       |              assert(ii >= 0 && ii < in_height && jj >= 0 && jj < in_width);
  638|  1.23M|              sum += layer_config->weights[off] * input[k][ii * in_stride + jj];
  639|  1.23M|              off += cstep;
  640|  1.23M|            }
  641|   618k|          }
  642|   309k|        }
  643|  28.0k|        output[i][out_index] = sum;
  644|  28.0k|      }
  645|  21.8k|    }
  646|  18.7k|  }
  647|  1.56k|}
av1_cnn_predict_c:
  903|    781|                       CNN_MULTI_OUT *output_struct) {
  904|    781|  bool success = false;
  905|    781|  TENSOR tensor1[CNN_MAX_BRANCHES] = { { 0 } };
  906|    781|  TENSOR tensor2[CNN_MAX_BRANCHES] = { { 0 } };
  907|       |
  908|    781|  float **output[CNN_MAX_BRANCHES];
  909|    781|  const int *out_chs = output_struct->output_channels;
  910|    781|  output[0] = output_struct->output_buffer;
  911|  3.12k|  for (int out_idx = 1; out_idx < output_struct->num_outputs; out_idx++) {
  ------------------
  |  Branch (911:25): [True: 2.34k, False: 781]
  ------------------
  912|  2.34k|    output[out_idx] = output[out_idx - 1] + out_chs[out_idx - 1];
  913|  2.34k|  }
  914|       |
  915|    781|  int i_width = in_width;
  916|    781|  int i_height = in_height;
  917|    781|  int o_width = 0, o_height = 0;
  918|  3.80k|  for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|  3.80k|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (918:19): [True: 3.02k, False: 781]
  ------------------
  919|  3.02k|    init_tensor(&tensor1[b]);
  920|  3.02k|    init_tensor(&tensor2[b]);
  921|  3.02k|  }
  922|       |
  923|    781|  const int *out_stride = output_struct->output_strides;
  924|  4.68k|  for (int layer = 0; layer < cnn_config->num_layers; ++layer) {
  ------------------
  |  Branch (924:23): [True: 3.90k, False: 781]
  ------------------
  925|  3.90k|    const CNN_LAYER_CONFIG *layer_config = &cnn_config->layer_config[layer];
  926|  3.90k|    const int branch = layer_config->branch;
  927|  3.90k|    const CNN_BRANCH_CONFIG *branch_config = &layer_config->branch_config;
  928|       |
  929|       |    // Allocate input tensor
  930|  3.90k|    if (layer == 0) {       // First layer
  ------------------
  |  Branch (930:9): [True: 780, False: 3.12k]
  ------------------
  931|    780|      assert(branch == 0);  // First layer must be primary branch
  932|    780|      assign_tensor(&tensor1[branch], (float **)input,
  933|    780|                    layer_config->in_channels, in_width, in_height, in_stride);
  934|  3.12k|    } else {  // Non-first layer
  935|       |      // Swap tensor1 and tensor2
  936|  3.12k|      swap_tensor(&tensor1[branch], &tensor2[branch]);
  937|       |
  938|  3.12k|      i_width = tensor1[branch].width;
  939|  3.12k|      i_height = tensor1[branch].height;
  940|  3.12k|    }
  941|       |
  942|       |    // Allocate output tensor
  943|  3.90k|    av1_find_cnn_layer_output_size(i_width, i_height, layer_config, &o_width,
  944|  3.90k|                                   &o_height);
  945|  3.90k|    const int output_num = layer_config->output_num;
  946|  3.90k|    if (output_num == -1) {  // Non-output layer
  ------------------
  |  Branch (946:9): [True: 781, False: 3.12k]
  ------------------
  947|    781|      if (!realloc_tensor(&tensor2[branch], layer_config->out_channels, o_width,
  ------------------
  |  Branch (947:11): [True: 0, False: 781]
  ------------------
  948|    781|                          o_height)) {
  949|      0|        goto Error;
  950|      0|      }
  951|  3.12k|    } else {  // Output layer
  952|  3.12k|      free_tensor(&tensor2[branch]);
  953|  3.12k|      assign_tensor(&tensor2[branch], output[output_num],
  954|  3.12k|                    layer_config->out_channels, o_width, o_height,
  955|  3.12k|                    out_stride[output_num]);
  956|  3.12k|    }
  957|       |
  958|       |    // If we are combining branches make sure that the branch to combine
  959|       |    // is different from the current branch.
  960|  3.90k|    assert(IMPLIES(layer_config->branch_combine_type != BRANCH_NOC,
  961|  3.90k|                   !(branch_config->branches_to_combine & (1 << branch))));
  962|       |
  963|  3.90k|    if (layer_config->branch_copy_type == BRANCH_INPUT) {
  ------------------
  |  Branch (963:9): [True: 0, False: 3.90k]
  ------------------
  964|      0|      if (!copy_active_tensor_to_branches(&tensor1[branch], layer_config,
  ------------------
  |  Branch (964:11): [True: 0, False: 0]
  ------------------
  965|      0|                                          branch, tensor2)) {
  966|      0|        goto Error;
  967|      0|      }
  968|      0|    }
  969|       |    // Check consistency of input and output channels
  970|  3.90k|    assert(tensor1[branch].channels == layer_config->in_channels);
  971|  3.90k|    assert(tensor2[branch].channels == layer_config->out_channels);
  972|       |
  973|       |    // Convolve/Deconvolve
  974|  3.90k|    if (!cnn_config->layer_config[layer].deconvolve) {
  ------------------
  |  Branch (974:9): [True: 3.90k, False: 18.4E]
  ------------------
  975|  3.90k|      if (thread_data->num_workers > 1) {
  ------------------
  |  Branch (975:11): [True: 0, False: 3.90k]
  ------------------
  976|      0|        convolve_layer_mt((const float **)tensor1[branch].buf,
  977|      0|                          tensor1[branch].width, tensor1[branch].height,
  978|      0|                          tensor1[branch].stride, layer_config, thread_data,
  979|      0|                          tensor2[branch].buf, tensor2[branch].stride);
  980|  3.90k|      } else {
  981|  3.90k|        av1_cnn_convolve((const float **)tensor1[branch].buf,
  982|  3.90k|                         tensor1[branch].width, tensor1[branch].height,
  983|  3.90k|                         tensor1[branch].stride, layer_config,
  984|  3.90k|                         tensor2[branch].buf, tensor2[branch].stride, 0, 1);
  985|  3.90k|      }
  986|  18.4E|    } else {
  987|  18.4E|      av1_cnn_deconvolve((const float **)tensor1[branch].buf,
  ------------------
  |  |  196|  18.4E|#define av1_cnn_deconvolve av1_cnn_deconvolve_c
  ------------------
  988|  18.4E|                         tensor1[branch].width, tensor1[branch].height,
  989|  18.4E|                         tensor1[branch].stride, layer_config,
  990|  18.4E|                         tensor2[branch].buf, tensor2[branch].stride);
  991|  18.4E|    }
  992|       |
  993|  3.90k|    if (layer_config->branch_copy_type == BRANCH_OUTPUT) {
  ------------------
  |  Branch (993:9): [True: 0, False: 3.90k]
  ------------------
  994|      0|      if (!copy_active_tensor_to_branches(&tensor2[branch], layer_config,
  ------------------
  |  Branch (994:11): [True: 0, False: 0]
  ------------------
  995|      0|                                          branch, tensor2)) {
  996|      0|        goto Error;
  997|      0|      }
  998|      0|    }
  999|       |
 1000|       |    // Add tensors from other branches if needed
 1001|  3.90k|    if (layer_config->branch_combine_type == BRANCH_ADD) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 3.90k]
  ------------------
 1002|      0|      for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|      0|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (1002:23): [True: 0, False: 0]
  ------------------
 1003|      0|        if ((branch_config->branches_to_combine & (1 << b)) && b != branch) {
  ------------------
  |  Branch (1003:13): [True: 0, False: 0]
  |  Branch (1003:64): [True: 0, False: 0]
  ------------------
 1004|      0|          assert(check_tensor_equal_size(&tensor2[b], &tensor2[branch]));
 1005|      0|          av1_cnn_add(tensor2[branch].buf, tensor2[branch].channels,
  ------------------
  |  |  186|      0|#define av1_cnn_add av1_cnn_add_c
  ------------------
 1006|      0|                      tensor2[branch].width, tensor2[branch].height,
 1007|      0|                      tensor2[branch].stride, (const float **)tensor2[b].buf);
 1008|      0|        }
 1009|      0|      }
 1010|      0|    }
 1011|       |
 1012|       |    // Non-linearity
 1013|  3.90k|    av1_cnn_activate(tensor2[branch].buf, tensor2[branch].channels,
  ------------------
  |  |  183|  3.90k|#define av1_cnn_activate av1_cnn_activate_c
  ------------------
 1014|  3.90k|                     tensor2[branch].width, tensor2[branch].height,
 1015|  3.90k|                     tensor2[branch].stride, layer_config->activation);
 1016|       |
 1017|  3.90k|    if (layer_config->bn_params.bn_gamma) {
  ------------------
  |  Branch (1017:9): [True: 0, False: 3.90k]
  ------------------
 1018|      0|      av1_cnn_batchnorm(
  ------------------
  |  |  189|      0|#define av1_cnn_batchnorm av1_cnn_batchnorm_c
  ------------------
 1019|      0|          tensor2[branch].buf, tensor2[branch].channels, tensor2[branch].width,
 1020|      0|          tensor2[branch].height, tensor2[branch].stride,
 1021|      0|          layer_config->bn_params.bn_gamma, layer_config->bn_params.bn_beta,
 1022|      0|          layer_config->bn_params.bn_mean, layer_config->bn_params.bn_std);
 1023|      0|    }
 1024|       |
 1025|       |    // Concatenate tensors
 1026|  3.90k|    if (layer_config->branch_combine_type == BRANCH_CAT) {
  ------------------
  |  Branch (1026:9): [True: 0, False: 3.90k]
  ------------------
 1027|      0|      if (output_num == -1) {  // Non-output layer
  ------------------
  |  Branch (1027:11): [True: 0, False: 0]
  ------------------
 1028|      0|        for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|      0|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (1028:25): [True: 0, False: 0]
  ------------------
 1029|      0|          if ((branch_config->branches_to_combine & (1 << b)) && b != branch) {
  ------------------
  |  Branch (1029:15): [True: 0, False: 0]
  |  Branch (1029:66): [True: 0, False: 0]
  ------------------
 1030|      0|            assert(check_tensor_equal_dims(&tensor2[b], &tensor2[branch]));
 1031|      0|            assert(tensor2[b].channels > 0);
 1032|      0|            if (!concat_tensor(&tensor2[b], &tensor2[branch])) goto Error;
  ------------------
  |  Branch (1032:17): [True: 0, False: 0]
  ------------------
 1033|      0|          }
 1034|      0|        }
 1035|      0|      } else {  // Output layer
 1036|      0|        const int existing_channels = tensor2[branch].channels;
 1037|      0|        int num_chs = existing_channels;
 1038|      0|        for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|      0|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (1038:25): [True: 0, False: 0]
  ------------------
 1039|      0|          if ((branch_config->branches_to_combine & (1 << b)) && b != branch) {
  ------------------
  |  Branch (1039:15): [True: 0, False: 0]
  |  Branch (1039:66): [True: 0, False: 0]
  ------------------
 1040|      0|            assert(check_tensor_equal_dims(&tensor2[b], &tensor2[branch]));
 1041|       |            // Needed only to assign the new channel buffers
 1042|      0|            num_chs += tensor2[b].channels;
 1043|      0|          }
 1044|      0|        }
 1045|      0|        assign_tensor(&tensor2[branch], output[output_num], num_chs, o_width,
 1046|      0|                      o_height, out_stride[output_num]);
 1047|       |
 1048|      0|        num_chs = existing_channels;
 1049|      0|        for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|      0|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (1049:25): [True: 0, False: 0]
  ------------------
 1050|      0|          if ((branch_config->branches_to_combine & (1 << b)) && b != branch) {
  ------------------
  |  Branch (1050:15): [True: 0, False: 0]
  |  Branch (1050:66): [True: 0, False: 0]
  ------------------
 1051|      0|            assert(check_tensor_equal_dims(&tensor2[b], &tensor2[branch]));
 1052|       |            // Needed only to assign the new channel buffers
 1053|      0|            copy_tensor(&tensor2[b], tensor2[b].channels, num_chs,
 1054|      0|                        &tensor2[branch]);
 1055|      0|            num_chs += tensor2[b].channels;
 1056|      0|          }
 1057|      0|        }
 1058|      0|      }
 1059|      0|    }
 1060|       |
 1061|  3.90k|    if (layer_config->branch_copy_type == BRANCH_COMBINED) {
  ------------------
  |  Branch (1061:9): [True: 0, False: 3.90k]
  ------------------
 1062|      0|      if (!copy_active_tensor_to_branches(&tensor2[branch], layer_config,
  ------------------
  |  Branch (1062:11): [True: 0, False: 0]
  ------------------
 1063|      0|                                          branch, tensor2)) {
 1064|      0|        goto Error;
 1065|      0|      }
 1066|      0|    }
 1067|  3.90k|  }
 1068|       |
 1069|    781|  success = true;
 1070|    781|Error:
 1071|  3.90k|  for (int b = 0; b < CNN_MAX_BRANCHES; ++b) {
  ------------------
  |  |   30|  3.90k|#define CNN_MAX_BRANCHES 4
  ------------------
  |  Branch (1071:19): [True: 3.12k, False: 781]
  ------------------
 1072|  3.12k|    free_tensor(&tensor1[b]);
 1073|  3.12k|    free_tensor(&tensor2[b]);
 1074|  3.12k|  }
 1075|    781|  return success;
 1076|    781|}
av1_cnn_predict_img_multi_out:
 1083|    773|                                   CNN_MULTI_OUT *output) {
 1084|    773|  const float max_val = 255.0;
 1085|       |
 1086|    773|  const int in_width = width + 2 * cnn_config->ext_width;
 1087|    773|  const int in_height = height + 2 * cnn_config->ext_height;
 1088|    773|  const int in_channels = cnn_config->layer_config[0].in_channels;
 1089|    773|  float *inputs[CNN_MAX_CHANNELS];
 1090|    773|  float *input_ =
 1091|    773|      (float *)aom_malloc(in_width * in_height * in_channels * sizeof(*input_));
 1092|    773|  if (!input_) return false;
  ------------------
  |  Branch (1092:7): [True: 0, False: 773]
  ------------------
 1093|    773|  const int in_stride = in_width;
 1094|       |
 1095|  1.55k|  for (int c = 0; c < in_channels; ++c) {
  ------------------
  |  Branch (1095:19): [True: 779, False: 773]
  ------------------
 1096|    779|    inputs[c] = input_ + c * in_stride * in_height;
 1097|    779|    float *input =
 1098|    779|        inputs[c] + cnn_config->ext_height * in_stride + cnn_config->ext_width;
 1099|       |
 1100|    779|    if (cnn_config->strict_bounds) {
  ------------------
  |  Branch (1100:9): [True: 0, False: 779]
  ------------------
 1101|      0|      for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (1101:23): [True: 0, False: 0]
  ------------------
 1102|      0|        for (int j = 0; j < width; ++j)
  ------------------
  |  Branch (1102:25): [True: 0, False: 0]
  ------------------
 1103|      0|          input[i * in_stride + j] = (float)dgd[c][i * stride + j] / max_val;
 1104|       |      // extend left and right
 1105|      0|      for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (1105:23): [True: 0, False: 0]
  ------------------
 1106|      0|        for (int j = -cnn_config->ext_width; j < 0; ++j)
  ------------------
  |  Branch (1106:46): [True: 0, False: 0]
  ------------------
 1107|      0|          input[i * in_stride + j] = input[i * in_stride];
 1108|      0|        for (int j = width; j < width + cnn_config->ext_width; ++j)
  ------------------
  |  Branch (1108:29): [True: 0, False: 0]
  ------------------
 1109|      0|          input[i * in_stride + j] = input[i * in_stride + width - 1];
 1110|      0|      }
 1111|       |      // extend top and bottom
 1112|      0|      for (int i = -cnn_config->ext_height; i < 0; ++i)
  ------------------
  |  Branch (1112:45): [True: 0, False: 0]
  ------------------
 1113|      0|        memcpy(&input[i * in_stride - cnn_config->ext_width],
 1114|      0|               &input[-cnn_config->ext_width], in_width * sizeof(*input));
 1115|      0|      for (int i = height; i < height + cnn_config->ext_height; ++i)
  ------------------
  |  Branch (1115:28): [True: 0, False: 0]
  ------------------
 1116|      0|        memcpy(&input[i * in_stride - cnn_config->ext_width],
 1117|      0|               &input[(height - 1) * in_stride - cnn_config->ext_width],
 1118|      0|               in_width * sizeof(*input));
 1119|    779|    } else {
 1120|  51.1k|      for (int i = -cnn_config->ext_height; i < height + cnn_config->ext_height;
  ------------------
  |  Branch (1120:45): [True: 50.4k, False: 779]
  ------------------
 1121|  50.4k|           ++i)
 1122|  3.25M|        for (int j = -cnn_config->ext_width; j < width + cnn_config->ext_width;
  ------------------
  |  Branch (1122:46): [True: 3.20M, False: 50.4k]
  ------------------
 1123|  3.20M|             ++j)
 1124|  3.20M|          input[i * in_stride + j] = (float)dgd[c][i * stride + j] / max_val;
 1125|    779|    }
 1126|    779|  }
 1127|    773|  bool success = av1_cnn_predict((const float **)inputs, in_width, in_height,
  ------------------
  |  |  199|    773|#define av1_cnn_predict av1_cnn_predict_c
  ------------------
 1128|    773|                                 in_stride, cnn_config, thread_data, output);
 1129|       |
 1130|    773|  aom_free(input_);
 1131|    773|  return success;
 1132|    773|}
av1_cnn_predict_img_multi_out_highbd:
 1141|      2|                                          CNN_MULTI_OUT *output) {
 1142|      2|  const float max_val = (float)((1 << bit_depth) - 1);
 1143|       |
 1144|      2|  const int in_width = width + 2 * cnn_config->ext_width;
 1145|      2|  const int in_height = height + 2 * cnn_config->ext_height;
 1146|      2|  const int in_channels = cnn_config->layer_config[0].in_channels;
 1147|      2|  float *inputs[CNN_MAX_CHANNELS];
 1148|      2|  float *input_ =
 1149|      2|      (float *)aom_malloc(in_width * in_height * in_channels * sizeof(*input_));
 1150|      2|  if (!input_) return false;
  ------------------
  |  Branch (1150:7): [True: 0, False: 2]
  ------------------
 1151|      2|  const int in_stride = in_width;
 1152|       |
 1153|      4|  for (int c = 0; c < in_channels; ++c) {
  ------------------
  |  Branch (1153:19): [True: 2, False: 2]
  ------------------
 1154|      2|    inputs[c] = input_ + c * in_stride * in_height;
 1155|      2|    float *input =
 1156|      2|        inputs[c] + cnn_config->ext_height * in_stride + cnn_config->ext_width;
 1157|       |
 1158|      2|    if (cnn_config->strict_bounds) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 2]
  ------------------
 1159|      0|      for (int i = 0; i < height; ++i)
  ------------------
  |  Branch (1159:23): [True: 0, False: 0]
  ------------------
 1160|      0|        for (int j = 0; j < width; ++j)
  ------------------
  |  Branch (1160:25): [True: 0, False: 0]
  ------------------
 1161|      0|          input[i * in_stride + j] = (float)dgd[c][i * stride + j] / max_val;
 1162|       |      // extend left and right
 1163|      0|      for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (1163:23): [True: 0, False: 0]
  ------------------
 1164|      0|        for (int j = -cnn_config->ext_width; j < 0; ++j)
  ------------------
  |  Branch (1164:46): [True: 0, False: 0]
  ------------------
 1165|      0|          input[i * in_stride + j] = input[i * in_stride];
 1166|      0|        for (int j = width; j < width + cnn_config->ext_width; ++j)
  ------------------
  |  Branch (1166:29): [True: 0, False: 0]
  ------------------
 1167|      0|          input[i * in_stride + j] = input[i * in_stride + width - 1];
 1168|      0|      }
 1169|       |      // extend top and bottom
 1170|      0|      for (int i = -cnn_config->ext_height; i < 0; ++i)
  ------------------
  |  Branch (1170:45): [True: 0, False: 0]
  ------------------
 1171|      0|        memcpy(&input[i * in_stride - cnn_config->ext_width],
 1172|      0|               &input[-cnn_config->ext_width], in_width * sizeof(*input));
 1173|      0|      for (int i = height; i < height + cnn_config->ext_height; ++i)
  ------------------
  |  Branch (1173:28): [True: 0, False: 0]
  ------------------
 1174|      0|        memcpy(&input[i * in_stride - cnn_config->ext_width],
 1175|      0|               &input[(height - 1) * in_stride - cnn_config->ext_width],
 1176|      0|               in_width * sizeof(*input));
 1177|      2|    } else {
 1178|    132|      for (int i = -cnn_config->ext_height; i < height + cnn_config->ext_height;
  ------------------
  |  Branch (1178:45): [True: 130, False: 2]
  ------------------
 1179|    130|           ++i)
 1180|  8.58k|        for (int j = -cnn_config->ext_width; j < width + cnn_config->ext_width;
  ------------------
  |  Branch (1180:46): [True: 8.45k, False: 130]
  ------------------
 1181|  8.45k|             ++j)
 1182|  8.45k|          input[i * in_stride + j] = (float)dgd[c][i * stride + j] / max_val;
 1183|      2|    }
 1184|      2|  }
 1185|       |
 1186|      2|  bool success = av1_cnn_predict((const float **)inputs, in_width, in_height,
  ------------------
  |  |  199|      2|#define av1_cnn_predict av1_cnn_predict_c
  ------------------
 1187|      2|                                 in_stride, cnn_config, thread_data, output);
 1188|       |
 1189|      2|  aom_free(input_);
 1190|      2|  return success;
 1191|      2|}
cnn.c:relu:
   36|  4.99M|static inline float relu(float x) { return (x < 0) ? 0 : x; }
  ------------------
  |  Branch (36:44): [True: 2.82M, False: 2.17M]
  ------------------
cnn.c:init_tensor:
   45|  6.05k|static void init_tensor(TENSOR *tensor) { memset(tensor, 0, sizeof(*tensor)); }
cnn.c:assign_tensor:
   96|  3.90k|                          int channels, int width, int height, int stride) {
   97|  3.90k|  tensor->allocsize = 0;
   98|  3.90k|  tensor->channels = channels;
   99|  3.90k|  tensor->width = width;
  100|  3.90k|  tensor->height = height;
  101|  3.90k|  tensor->stride = stride;
  102|  3.90k|  if (buf) {
  ------------------
  |  Branch (102:7): [True: 3.90k, False: 0]
  ------------------
  103|  54.6k|    for (int c = 0; c < channels; ++c) tensor->buf[c] = buf[c];
  ------------------
  |  Branch (103:21): [True: 50.7k, False: 3.90k]
  ------------------
  104|  3.90k|  } else {
  105|      0|    for (int c = 0; c < channels; ++c) tensor->buf[c] = NULL;
  ------------------
  |  Branch (105:21): [True: 0, False: 0]
  ------------------
  106|      0|  }
  107|  3.90k|}
cnn.c:swap_tensor:
  109|  3.12k|static void swap_tensor(TENSOR *t1, TENSOR *t2) {
  110|  3.12k|  TENSOR t = *t1;
  111|  3.12k|  *t1 = *t2;
  112|  3.12k|  *t2 = t;
  113|  3.12k|}
cnn.c:realloc_tensor:
   56|    781|                           int height) {
   57|    781|  const int newallocsize = channels * width * height;
   58|    781|  if (tensor->allocsize < newallocsize) {
  ------------------
  |  Branch (58:7): [True: 781, False: 0]
  ------------------
   59|    781|    free_tensor(tensor);
   60|    781|    tensor->buf[0] =
   61|    781|        (float *)aom_malloc(sizeof(*tensor->buf[0]) * newallocsize);
   62|    781|    if (!tensor->buf[0]) return false;
  ------------------
  |  Branch (62:9): [True: 0, False: 781]
  ------------------
   63|    781|    tensor->allocsize = newallocsize;
   64|    781|  }
   65|    781|  tensor->width = width;
   66|    781|  tensor->height = height;
   67|    781|  tensor->stride = width;
   68|    781|  tensor->channels = channels;
   69|  15.6k|  for (int c = 1; c < channels; ++c)
  ------------------
  |  Branch (69:19): [True: 14.8k, False: 781]
  ------------------
   70|  14.8k|    tensor->buf[c] = &tensor->buf[0][c * width * height];
   71|       |  return true;
   72|    781|}
cnn.c:free_tensor:
   47|  10.1k|static void free_tensor(TENSOR *tensor) {
   48|  10.1k|  if (tensor->allocsize) {
  ------------------
  |  Branch (48:7): [True: 780, False: 9.37k]
  ------------------
   49|    780|    aom_free(tensor->buf[0]);
   50|       |    tensor->buf[0] = NULL;
   51|    780|    tensor->allocsize = 0;
   52|    780|  }
   53|  10.1k|}
cnn.c:av1_cnn_convolve:
  653|  3.90k|                             int step) {
  654|  3.90k|  assert(!layer_config->deconvolve);
  655|  3.90k|  const int cstep = layer_config->in_channels * layer_config->out_channels;
  656|  3.90k|  const int filter_height_half = layer_config->filter_height >> 1;
  657|  3.90k|  const int filter_width_half = layer_config->filter_width >> 1;
  658|  3.90k|  const int channel_step = AOMMAX(step, 1);
  ------------------
  |  |   35|  3.90k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 3.90k]
  |  |  ------------------
  ------------------
  659|       |
  660|  3.90k|  if (layer_config->maxpool &&
  ------------------
  |  Branch (660:7): [True: 0, False: 3.90k]
  ------------------
  661|      0|      (layer_config->skip_height > 1 || layer_config->skip_width > 1)) {
  ------------------
  |  Branch (661:8): [True: 0, False: 0]
  |  Branch (661:41): [True: 0, False: 0]
  ------------------
  662|      0|    switch (layer_config->pad) {
  663|      0|      case PADDING_SAME_ZERO:
  ------------------
  |  Branch (663:7): [True: 0, False: 0]
  ------------------
  664|      0|        convolve_maxpool_padding_zero(input, in_width, in_height, in_stride,
  665|      0|                                      layer_config, output, out_stride, cstep,
  666|      0|                                      filter_width_half, filter_height_half);
  667|      0|        break;
  668|      0|      case PADDING_SAME_REPLICATE:
  ------------------
  |  Branch (668:7): [True: 0, False: 0]
  ------------------
  669|      0|        convolve_maxpool_padding_replicate(
  670|      0|            input, in_width, in_height, in_stride, layer_config, output,
  671|      0|            out_stride, cstep, filter_width_half, filter_height_half);
  672|      0|        break;
  673|      0|      case PADDING_VALID:
  ------------------
  |  Branch (673:7): [True: 0, False: 0]
  ------------------
  674|      0|        convolve_maxpool_padding_valid(input, in_width, in_height, in_stride,
  675|      0|                                       layer_config, output, out_stride, cstep);
  676|      0|        break;
  677|      0|      default: assert(0 && "Unknown padding type");
  ------------------
  |  Branch (677:7): [True: 0, False: 0]
  ------------------
  678|      0|    }
  679|  3.90k|  } else {
  680|       |    // Results in element-wise matrix multiplication.
  681|  3.90k|    if (layer_config->filter_height == 1 && layer_config->filter_width == 1) {
  ------------------
  |  Branch (681:9): [True: 0, False: 3.90k]
  |  Branch (681:45): [True: 0, False: 0]
  ------------------
  682|      0|      convolve_element_wise(input, in_width, in_height, in_stride, layer_config,
  683|      0|                            output, out_stride, start_idx, step);
  684|      0|      return;
  685|      0|    }
  686|  3.90k|    const int ii_shift =
  687|  3.90k|        filter_height_half - (layer_config->filter_height - 1) % 2;
  688|  3.90k|    const int jj_shift =
  689|  3.90k|        filter_width_half - (layer_config->filter_width - 1) % 2;
  690|  3.90k|    switch (layer_config->pad) {
  691|      0|      case PADDING_SAME_ZERO:
  ------------------
  |  Branch (691:7): [True: 0, False: 3.90k]
  ------------------
  692|      0|        convolve_no_maxpool_padding_zero(
  693|      0|            input, in_width, in_height, in_stride, layer_config, output,
  694|      0|            out_stride, start_idx, cstep, filter_width_half, filter_height_half,
  695|      0|            ii_shift, jj_shift, channel_step);
  696|      0|        break;
  697|      0|      case PADDING_SAME_REPLICATE:
  ------------------
  |  Branch (697:7): [True: 0, False: 3.90k]
  ------------------
  698|      0|        convolve_no_maxpool_padding_replicate(
  699|      0|            input, in_width, in_height, in_stride, layer_config, output,
  700|      0|            out_stride, start_idx, cstep, ii_shift, jj_shift, channel_step);
  701|      0|        break;
  702|  3.90k|      case PADDING_VALID:
  ------------------
  |  Branch (702:7): [True: 3.90k, False: 0]
  ------------------
  703|  3.90k|        av1_cnn_convolve_no_maxpool_padding_valid(
  704|  3.90k|            input, in_width, in_height, in_stride, layer_config, output,
  705|  3.90k|            out_stride, start_idx, cstep, channel_step);
  706|  3.90k|        break;
  707|      0|      default: assert(0 && "Unknown padding type");
  ------------------
  |  Branch (707:7): [True: 0, False: 3.90k]
  ------------------
  708|  3.90k|    }
  709|  3.90k|  }
  710|  3.90k|}

av1_setup_shared_coeff_buffer:
   37|   117k|                                   struct aom_internal_error_info *error) {
   38|   117k|  const int num_planes = seq_params->monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  45.7k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (38:26): [True: 71.9k, False: 45.7k]
  ------------------
   39|   117k|  const int max_sb_square_y = 1 << num_pels_log2_lookup[seq_params->sb_size];
   40|   117k|  const int max_sb_square_uv = max_sb_square_y >> (seq_params->subsampling_x +
   41|   117k|                                                   seq_params->subsampling_y);
   42|   326k|  for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (42:19): [True: 209k, False: 117k]
  ------------------
   43|   209k|    const int max_num_pix =
   44|   209k|        (i == AOM_PLANE_Y) ? max_sb_square_y : max_sb_square_uv;
  ------------------
  |  |  281|   209k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (44:9): [True: 117k, False: 91.4k]
  ------------------
   45|   209k|    AOM_CHECK_MEM_ERROR(error, shared_bufs->coeff_buf[i],
  ------------------
  |  |   71|   209k|  do {                                                    \
  |  |   72|   209k|    assert((error_info)->setjmp);                         \
  |  |   73|   209k|    lval = (expr);                                        \
  |  |   74|   209k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 209k]
  |  |  ------------------
  |  |   75|   209k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|   209k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 209k]
  |  |  ------------------
  ------------------
   46|   209k|                        aom_memalign(32, max_num_pix * sizeof(tran_low_t)));
   47|   209k|    AOM_CHECK_MEM_ERROR(error, shared_bufs->qcoeff_buf[i],
  ------------------
  |  |   71|   209k|  do {                                                    \
  |  |   72|   209k|    assert((error_info)->setjmp);                         \
  |  |   73|   209k|    lval = (expr);                                        \
  |  |   74|   209k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 209k]
  |  |  ------------------
  |  |   75|   209k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|   209k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 209k]
  |  |  ------------------
  ------------------
   48|   209k|                        aom_memalign(32, max_num_pix * sizeof(tran_low_t)));
   49|       |    AOM_CHECK_MEM_ERROR(error, shared_bufs->dqcoeff_buf[i],
  ------------------
  |  |   71|   209k|  do {                                                    \
  |  |   72|   209k|    assert((error_info)->setjmp);                         \
  |  |   73|   209k|    lval = (expr);                                        \
  |  |   74|   209k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 209k]
  |  |  ------------------
  |  |   75|   209k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|   209k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 209k]
  |  |  ------------------
  ------------------
   50|   209k|                        aom_memalign(32, max_num_pix * sizeof(tran_low_t)));
   51|   209k|  }
   52|   117k|}
av1_free_shared_coeff_buffer:
   54|   117k|void av1_free_shared_coeff_buffer(PC_TREE_SHARED_BUFFERS *shared_bufs) {
   55|   470k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (55:19): [True: 353k, False: 117k]
  ------------------
   56|   353k|    aom_free(shared_bufs->coeff_buf[i]);
   57|   353k|    aom_free(shared_bufs->qcoeff_buf[i]);
   58|   353k|    aom_free(shared_bufs->dqcoeff_buf[i]);
   59|   353k|    shared_bufs->coeff_buf[i] = NULL;
   60|   353k|    shared_bufs->qcoeff_buf[i] = NULL;
   61|       |    shared_bufs->dqcoeff_buf[i] = NULL;
   62|   353k|  }
   63|   117k|}
av1_alloc_pmc:
   67|  2.83M|                                 PC_TREE_SHARED_BUFFERS *shared_bufs) {
   68|  2.83M|  PICK_MODE_CONTEXT *volatile ctx = NULL;
   69|  2.83M|  const AV1_COMMON *const cm = &cpi->common;
   70|  2.83M|  struct aom_internal_error_info error;
   71|       |
   72|  2.83M|  if (setjmp(error.jmp)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 2.83M]
  ------------------
   73|      0|    av1_free_pmc(ctx, av1_num_planes(cm));
   74|      0|    return NULL;
   75|      0|  }
   76|  2.83M|  error.setjmp = 1;
   77|       |
   78|  2.83M|  AOM_CHECK_MEM_ERROR(&error, ctx, aom_calloc(1, sizeof(*ctx)));
  ------------------
  |  |   71|  2.83M|  do {                                                    \
  |  |   72|  2.83M|    assert((error_info)->setjmp);                         \
  |  |   73|  2.83M|    lval = (expr);                                        \
  |  |   74|  2.83M|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 2.83M]
  |  |  ------------------
  |  |   75|  2.83M|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  2.83M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 2.83M]
  |  |  ------------------
  ------------------
   79|  2.83M|  ctx->rd_mode_is_ready = 0;
   80|       |
   81|  2.83M|  const int num_planes = av1_num_planes(cm);
   82|  2.83M|  const int num_pix = block_size_wide[bsize] * block_size_high[bsize];
   83|  2.83M|  const int num_blk = num_pix / 16;
   84|       |
   85|  2.83M|  AOM_CHECK_MEM_ERROR(&error, ctx->tx_type_map,
  ------------------
  |  |   71|  2.83M|  do {                                                    \
  |  |   72|  2.83M|    assert((error_info)->setjmp);                         \
  |  |   73|  2.83M|    lval = (expr);                                        \
  |  |   74|  2.83M|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 2.83M]
  |  |  ------------------
  |  |   75|  2.83M|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  2.83M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 2.83M]
  |  |  ------------------
  ------------------
   86|  2.83M|                      aom_calloc(num_blk, sizeof(*ctx->tx_type_map)));
   87|  2.83M|  ctx->num_4x4_blk = num_blk;
   88|       |
   89|  8.29M|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (89:19): [True: 5.45M, False: 2.83M]
  ------------------
   90|  5.45M|    ctx->coeff[i] = shared_bufs->coeff_buf[i];
   91|  5.45M|    ctx->qcoeff[i] = shared_bufs->qcoeff_buf[i];
   92|  5.45M|    ctx->dqcoeff[i] = shared_bufs->dqcoeff_buf[i];
   93|  5.45M|    AOM_CHECK_MEM_ERROR(&error, ctx->eobs[i],
  ------------------
  |  |   71|  5.45M|  do {                                                    \
  |  |   72|  5.45M|    assert((error_info)->setjmp);                         \
  |  |   73|  5.45M|    lval = (expr);                                        \
  |  |   74|  5.45M|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 5.45M]
  |  |  ------------------
  |  |   75|  5.45M|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  5.45M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 5.45M]
  |  |  ------------------
  ------------------
   94|  5.45M|                        aom_memalign(32, num_blk * sizeof(*ctx->eobs[i])));
   95|  5.45M|    AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  5.45M|  do {                                                    \
  |  |   72|  5.45M|    assert((error_info)->setjmp);                         \
  |  |   73|  5.45M|    lval = (expr);                                        \
  |  |   74|  5.45M|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 5.45M]
  |  |  ------------------
  |  |   75|  5.45M|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  5.45M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 5.45M]
  |  |  ------------------
  ------------------
   96|  5.45M|        &error, ctx->txb_entropy_ctx[i],
   97|  5.45M|        aom_memalign(32, num_blk * sizeof(*ctx->txb_entropy_ctx[i])));
   98|  5.45M|  }
   99|       |
  100|  2.83M|  if (num_pix <= MAX_PALETTE_SQUARE) {
  ------------------
  |  |   61|  2.83M|#define MAX_PALETTE_SQUARE (64 * 64)
  ------------------
  |  Branch (100:7): [True: 2.83M, False: 18.4E]
  ------------------
  101|  8.51M|    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (101:21): [True: 5.67M, False: 2.83M]
  ------------------
  102|  5.67M|      if (cm->features.allow_screen_content_tools) {
  ------------------
  |  Branch (102:11): [True: 1.16M, False: 4.51M]
  ------------------
  103|  1.16M|        AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  1.16M|  do {                                                    \
  |  |   72|  1.16M|    assert((error_info)->setjmp);                         \
  |  |   73|  1.16M|    lval = (expr);                                        \
  |  |   74|  1.16M|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.16M]
  |  |  ------------------
  |  |   75|  1.16M|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  1.16M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 1.16M]
  |  |  ------------------
  ------------------
  104|  1.16M|            &error, ctx->color_index_map[i],
  105|  1.16M|            aom_memalign(32, num_pix * sizeof(*ctx->color_index_map[i])));
  106|  4.51M|      } else {
  107|  4.51M|        ctx->color_index_map[i] = NULL;
  108|  4.51M|      }
  109|  5.67M|    }
  110|  2.83M|  }
  111|       |
  112|  2.83M|  av1_invalid_rd_stats(&ctx->rd_stats);
  113|       |
  114|  2.83M|  return ctx;
  115|  2.83M|}
av1_reset_pmc:
  117|   267k|void av1_reset_pmc(PICK_MODE_CONTEXT *ctx) {
  118|   267k|  av1_zero_array(ctx->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   44|   267k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
  119|   267k|  av1_invalid_rd_stats(&ctx->rd_stats);
  120|   267k|}
av1_free_pmc:
  122|   152M|void av1_free_pmc(PICK_MODE_CONTEXT *ctx, int num_planes) {
  123|   152M|  if (ctx == NULL) return;
  ------------------
  |  Branch (123:7): [True: 149M, False: 2.78M]
  ------------------
  124|       |
  125|  2.78M|  aom_free(ctx->tx_type_map);
  126|  8.22M|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (126:19): [True: 5.43M, False: 2.78M]
  ------------------
  127|  5.43M|    ctx->coeff[i] = NULL;
  128|  5.43M|    ctx->qcoeff[i] = NULL;
  129|  5.43M|    ctx->dqcoeff[i] = NULL;
  130|  5.43M|    aom_free(ctx->eobs[i]);
  131|  5.43M|    ctx->eobs[i] = NULL;
  132|  5.43M|    aom_free(ctx->txb_entropy_ctx[i]);
  133|  5.43M|    ctx->txb_entropy_ctx[i] = NULL;
  134|  5.43M|  }
  135|       |
  136|  8.45M|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (136:19): [True: 5.67M, False: 2.78M]
  ------------------
  137|  5.67M|    if (ctx->color_index_map[i]) {
  ------------------
  |  Branch (137:9): [True: 1.16M, False: 4.50M]
  ------------------
  138|  1.16M|      aom_free(ctx->color_index_map[i]);
  139|  1.16M|      ctx->color_index_map[i] = NULL;
  140|  1.16M|    }
  141|  5.67M|  }
  142|       |
  143|  2.78M|  aom_free(ctx);
  144|  2.78M|}
av1_alloc_pc_tree_node:
  146|  4.21M|PC_TREE *av1_alloc_pc_tree_node(BLOCK_SIZE bsize) {
  147|  4.21M|  PC_TREE *pc_tree = aom_calloc(1, sizeof(*pc_tree));
  148|  4.21M|  if (pc_tree == NULL) return NULL;
  ------------------
  |  Branch (148:7): [True: 0, False: 4.21M]
  ------------------
  149|       |
  150|  4.21M|  pc_tree->partitioning = PARTITION_NONE;
  151|  4.21M|  pc_tree->block_size = bsize;
  152|       |
  153|  4.21M|  return pc_tree;
  154|  4.21M|}
av1_free_pc_tree_recursive:
  164|  6.99M|                                PARTITION_SEARCH_TYPE partition_search_type) {
  165|  6.99M|  if (pc_tree == NULL) return;
  ------------------
  |  Branch (165:7): [True: 178k, False: 6.81M]
  ------------------
  166|       |
  167|       |  // Avoid freeing of extended partitions as they are not supported when
  168|       |  // partition_search_type is VAR_BASED_PARTITION.
  169|  6.81M|  if (partition_search_type == VAR_BASED_PARTITION && !keep_best &&
  ------------------
  |  Branch (169:7): [True: 765k, False: 6.05M]
  |  Branch (169:55): [True: 765k, False: 18.4E]
  ------------------
  170|   766k|      !keep_none) {
  ------------------
  |  Branch (170:7): [True: 765k, False: 18.4E]
  ------------------
  171|   766k|    FREE_PMC_NODE(pc_tree->none);
  ------------------
  |  |  157|   766k|  do {                             \
  |  |  158|   766k|    av1_free_pmc(CTX, num_planes); \
  |  |  159|   766k|    CTX = NULL;                    \
  |  |  160|   766k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 766k]
  |  |  ------------------
  ------------------
  172|       |
  173|  2.29M|    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (173:21): [True: 1.52M, False: 766k]
  ------------------
  174|  1.52M|      FREE_PMC_NODE(pc_tree->horizontal[i]);
  ------------------
  |  |  157|  1.52M|  do {                             \
  |  |  158|  1.52M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  1.52M|    CTX = NULL;                    \
  |  |  160|  1.52M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 1.52M]
  |  |  ------------------
  ------------------
  175|  1.52M|      FREE_PMC_NODE(pc_tree->vertical[i]);
  ------------------
  |  |  157|  1.52M|  do {                             \
  |  |  158|  1.52M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  1.52M|    CTX = NULL;                    \
  |  |  160|  1.52M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 1.52M]
  |  |  ------------------
  ------------------
  176|  1.52M|    }
  177|       |
  178|       |#if !defined(NDEBUG) && !CONFIG_REALTIME_ONLY
  179|       |    for (int i = 0; i < 3; ++i) {
  180|       |      assert(pc_tree->horizontala[i] == NULL);
  181|       |      assert(pc_tree->horizontalb[i] == NULL);
  182|       |      assert(pc_tree->verticala[i] == NULL);
  183|       |      assert(pc_tree->verticalb[i] == NULL);
  184|       |    }
  185|       |    for (int i = 0; i < 4; ++i) {
  186|       |      assert(pc_tree->horizontal4[i] == NULL);
  187|       |      assert(pc_tree->vertical4[i] == NULL);
  188|       |    }
  189|       |#endif
  190|       |
  191|  3.78M|    for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (191:21): [True: 3.02M, False: 766k]
  ------------------
  192|  3.02M|      if (pc_tree->split[i] != NULL) {
  ------------------
  |  Branch (192:11): [True: 726k, False: 2.29M]
  ------------------
  193|   726k|        av1_free_pc_tree_recursive(pc_tree->split[i], num_planes, 0, 0,
  194|   726k|                                   partition_search_type);
  195|   726k|        pc_tree->split[i] = NULL;
  196|   726k|      }
  197|  3.02M|    }
  198|   766k|    aom_free(pc_tree);
  199|   766k|    return;
  200|   766k|  }
  201|       |
  202|  6.05M|  const PARTITION_TYPE partition = pc_tree->partitioning;
  203|       |
  204|  6.05M|  if (!keep_none && (!keep_best || (partition != PARTITION_NONE)))
  ------------------
  |  Branch (204:7): [True: 3.43M, False: 2.61M]
  |  Branch (204:22): [True: 3.43M, False: 0]
  |  Branch (204:36): [True: 0, False: 0]
  ------------------
  205|  3.43M|    FREE_PMC_NODE(pc_tree->none);
  ------------------
  |  |  157|  3.43M|  do {                             \
  |  |  158|  3.43M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  3.43M|    CTX = NULL;                    \
  |  |  160|  3.43M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 3.43M]
  |  |  ------------------
  ------------------
  206|       |
  207|  18.1M|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (207:19): [True: 12.1M, False: 6.05M]
  ------------------
  208|  12.1M|    if (!keep_best || (partition != PARTITION_HORZ))
  ------------------
  |  Branch (208:9): [True: 6.87M, False: 5.23M]
  |  Branch (208:23): [True: 5.20M, False: 30.0k]
  ------------------
  209|  12.0M|      FREE_PMC_NODE(pc_tree->horizontal[i]);
  ------------------
  |  |  157|  12.0M|  do {                             \
  |  |  158|  12.0M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  12.0M|    CTX = NULL;                    \
  |  |  160|  12.0M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  210|  12.1M|    if (!keep_best || (partition != PARTITION_VERT))
  ------------------
  |  Branch (210:9): [True: 6.87M, False: 5.23M]
  |  Branch (210:23): [True: 5.19M, False: 39.9k]
  ------------------
  211|  12.0M|      FREE_PMC_NODE(pc_tree->vertical[i]);
  ------------------
  |  |  157|  12.0M|  do {                             \
  |  |  158|  12.0M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  12.0M|    CTX = NULL;                    \
  |  |  160|  12.0M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 12.0M]
  |  |  ------------------
  ------------------
  212|  12.1M|  }
  213|  6.05M|#if !CONFIG_REALTIME_ONLY
  214|  24.1M|  for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (214:19): [True: 18.1M, False: 6.05M]
  ------------------
  215|  18.1M|    if (!keep_best || (partition != PARTITION_HORZ_A))
  ------------------
  |  Branch (215:9): [True: 10.3M, False: 7.84M]
  |  Branch (215:23): [True: 7.84M, False: 0]
  ------------------
  216|  18.1M|      FREE_PMC_NODE(pc_tree->horizontala[i]);
  ------------------
  |  |  157|  18.1M|  do {                             \
  |  |  158|  18.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  18.1M|    CTX = NULL;                    \
  |  |  160|  18.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 18.1M]
  |  |  ------------------
  ------------------
  217|  18.1M|    if (!keep_best || (partition != PARTITION_HORZ_B))
  ------------------
  |  Branch (217:9): [True: 10.3M, False: 7.84M]
  |  Branch (217:23): [True: 7.84M, False: 0]
  ------------------
  218|  18.1M|      FREE_PMC_NODE(pc_tree->horizontalb[i]);
  ------------------
  |  |  157|  18.1M|  do {                             \
  |  |  158|  18.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  18.1M|    CTX = NULL;                    \
  |  |  160|  18.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 18.1M]
  |  |  ------------------
  ------------------
  219|  18.1M|    if (!keep_best || (partition != PARTITION_VERT_A))
  ------------------
  |  Branch (219:9): [True: 10.3M, False: 7.84M]
  |  Branch (219:23): [True: 7.84M, False: 0]
  ------------------
  220|  18.1M|      FREE_PMC_NODE(pc_tree->verticala[i]);
  ------------------
  |  |  157|  18.1M|  do {                             \
  |  |  158|  18.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  18.1M|    CTX = NULL;                    \
  |  |  160|  18.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 18.1M]
  |  |  ------------------
  ------------------
  221|  18.1M|    if (!keep_best || (partition != PARTITION_VERT_B))
  ------------------
  |  Branch (221:9): [True: 10.3M, False: 7.84M]
  |  Branch (221:23): [True: 7.84M, False: 0]
  ------------------
  222|  18.1M|      FREE_PMC_NODE(pc_tree->verticalb[i]);
  ------------------
  |  |  157|  18.1M|  do {                             \
  |  |  158|  18.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  18.1M|    CTX = NULL;                    \
  |  |  160|  18.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 18.1M]
  |  |  ------------------
  ------------------
  223|  18.1M|  }
  224|  30.2M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (224:19): [True: 24.1M, False: 6.05M]
  ------------------
  225|  24.1M|    if (!keep_best || (partition != PARTITION_HORZ_4))
  ------------------
  |  Branch (225:9): [True: 13.7M, False: 10.4M]
  |  Branch (225:23): [True: 10.4M, False: 0]
  ------------------
  226|  24.1M|      FREE_PMC_NODE(pc_tree->horizontal4[i]);
  ------------------
  |  |  157|  24.1M|  do {                             \
  |  |  158|  24.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  24.1M|    CTX = NULL;                    \
  |  |  160|  24.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 24.1M]
  |  |  ------------------
  ------------------
  227|  24.1M|    if (!keep_best || (partition != PARTITION_VERT_4))
  ------------------
  |  Branch (227:9): [True: 13.7M, False: 10.4M]
  |  Branch (227:23): [True: 10.4M, False: 0]
  ------------------
  228|  24.1M|      FREE_PMC_NODE(pc_tree->vertical4[i]);
  ------------------
  |  |  157|  24.1M|  do {                             \
  |  |  158|  24.1M|    av1_free_pmc(CTX, num_planes); \
  |  |  159|  24.1M|    CTX = NULL;                    \
  |  |  160|  24.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (160:12): [Folded, False: 24.1M]
  |  |  ------------------
  ------------------
  229|  24.1M|  }
  230|  6.05M|#endif
  231|  6.05M|  if (!keep_best || (partition != PARTITION_SPLIT)) {
  ------------------
  |  Branch (231:7): [True: 3.43M, False: 2.61M]
  |  Branch (231:21): [True: 2.01M, False: 598k]
  ------------------
  232|  27.2M|    for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (232:21): [True: 21.8M, False: 5.45M]
  ------------------
  233|  21.8M|      if (pc_tree->split[i] != NULL) {
  ------------------
  |  Branch (233:11): [True: 3.34M, False: 18.4M]
  ------------------
  234|  3.34M|        av1_free_pc_tree_recursive(pc_tree->split[i], num_planes, 0, 0,
  235|  3.34M|                                   partition_search_type);
  236|  3.34M|        pc_tree->split[i] = NULL;
  237|  3.34M|      }
  238|  21.8M|    }
  239|  5.45M|  }
  240|       |
  241|  6.05M|  if (!keep_best && !keep_none) aom_free(pc_tree);
  ------------------
  |  Branch (241:7): [True: 3.43M, False: 2.61M]
  |  Branch (241:21): [True: 3.43M, False: 18.4E]
  ------------------
  242|  6.05M|}
av1_setup_sms_tree:
  244|  47.6k|int av1_setup_sms_tree(AV1_COMP *const cpi, ThreadData *td) {
  245|       |  // The structure 'sms_tree' is used to store the simple motion search data for
  246|       |  // partition pruning in inter frames. Hence, the memory allocations and
  247|       |  // initializations related to it are avoided for allintra encoding mode.
  248|  47.6k|  if (cpi->oxcf.kf_cfg.key_freq_max == 0) return 0;
  ------------------
  |  Branch (248:7): [True: 0, False: 47.6k]
  ------------------
  249|       |
  250|  47.6k|  AV1_COMMON *const cm = &cpi->common;
  251|  47.6k|  const int stat_generation_stage = is_stat_generation_stage(cpi);
  252|  47.6k|  const int is_sb_size_128 = cm->seq_params->sb_size == BLOCK_128X128;
  253|  47.6k|  const int tree_nodes =
  254|  47.6k|      av1_get_pc_tree_nodes(is_sb_size_128, stat_generation_stage);
  255|  47.6k|  int sms_tree_index = 0;
  256|  47.6k|  SIMPLE_MOTION_DATA_TREE *this_sms;
  257|  47.6k|  int square_index = 1;
  258|  47.6k|  int nodes;
  259|       |
  260|  47.6k|  aom_free(td->sms_tree);
  261|  47.6k|  td->sms_tree =
  262|  47.6k|      (SIMPLE_MOTION_DATA_TREE *)aom_calloc(tree_nodes, sizeof(*td->sms_tree));
  263|  47.6k|  if (!td->sms_tree) return -1;
  ------------------
  |  Branch (263:7): [True: 0, False: 47.6k]
  ------------------
  264|  47.6k|  this_sms = &td->sms_tree[0];
  265|       |
  266|  47.6k|  if (!stat_generation_stage) {
  ------------------
  |  Branch (266:7): [True: 47.6k, False: 0]
  ------------------
  267|  47.6k|    const int leaf_factor = is_sb_size_128 ? 4 : 1;
  ------------------
  |  Branch (267:29): [True: 12.3k, False: 35.3k]
  ------------------
  268|  47.6k|    const int leaf_nodes = 256 * leaf_factor;
  269|       |
  270|       |    // Sets up all the leaf nodes in the tree.
  271|  21.6M|    for (sms_tree_index = 0; sms_tree_index < leaf_nodes; ++sms_tree_index) {
  ------------------
  |  Branch (271:30): [True: 21.6M, False: 47.6k]
  ------------------
  272|  21.6M|      SIMPLE_MOTION_DATA_TREE *const tree = &td->sms_tree[sms_tree_index];
  273|  21.6M|      tree->block_size = square[0];
  274|  21.6M|    }
  275|       |
  276|       |    // Each node has 4 leaf nodes, fill each block_size level of the tree
  277|       |    // from leafs to the root.
  278|   250k|    for (nodes = leaf_nodes >> 2; nodes > 0; nodes >>= 2) {
  ------------------
  |  Branch (278:35): [True: 202k, False: 47.6k]
  ------------------
  279|  7.40M|      for (int i = 0; i < nodes; ++i) {
  ------------------
  |  Branch (279:23): [True: 7.20M, False: 202k]
  ------------------
  280|  7.20M|        SIMPLE_MOTION_DATA_TREE *const tree = &td->sms_tree[sms_tree_index];
  281|  7.20M|        tree->block_size = square[square_index];
  282|  36.0M|        for (int j = 0; j < 4; j++) tree->split[j] = this_sms++;
  ------------------
  |  Branch (282:25): [True: 28.8M, False: 7.20M]
  ------------------
  283|  7.20M|        ++sms_tree_index;
  284|  7.20M|      }
  285|   202k|      ++square_index;
  286|   202k|    }
  287|  47.6k|  } else {
  288|       |    // Allocation for firstpass/LAP stage
  289|       |    // TODO(Mufaddal): refactor square_index to use a common block_size macro
  290|       |    // from firstpass.c
  291|      0|    SIMPLE_MOTION_DATA_TREE *const tree = &td->sms_tree[sms_tree_index];
  292|      0|    square_index = 2;
  293|      0|    tree->block_size = square[square_index];
  294|      0|  }
  295|       |
  296|       |  // Set up the root node for the largest superblock size
  297|  47.6k|  td->sms_root = &td->sms_tree[tree_nodes - 1];
  298|  47.6k|  return 0;
  299|  47.6k|}
av1_free_sms_tree:
  301|   117k|void av1_free_sms_tree(ThreadData *td) {
  302|   117k|  aom_free(td->sms_tree);
  303|       |  td->sms_tree = NULL;
  304|   117k|}

context_tree.c:av1_get_pc_tree_nodes:
  126|  47.6k|                                        int stat_generation_stage) {
  127|  47.6k|  const int tree_nodes_inc = is_sb_size_128 ? 1024 : 0;
  ------------------
  |  Branch (127:30): [True: 12.3k, False: 35.3k]
  ------------------
  128|  47.6k|  const int tree_nodes =
  129|  47.6k|      stat_generation_stage ? 1 : (tree_nodes_inc + 256 + 64 + 16 + 4 + 1);
  ------------------
  |  Branch (129:7): [True: 0, False: 47.6k]
  ------------------
  130|  47.6k|  return tree_nodes;
  131|  47.6k|}

av1_cost_tokens_from_cdf:
   31|   212M|                              const int *inv_map) {
   32|   212M|  int i;
   33|   212M|  aom_cdf_prob prev_cdf = 0;
   34|   906M|  for (i = 0;; ++i) {
   35|   906M|    aom_cdf_prob p15 = AOM_ICDF(cdf[i]) - prev_cdf;
  ------------------
  |  |   38|   906M|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   906M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   906M|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|   906M|    p15 = (p15 < EC_MIN_PROB) ? EC_MIN_PROB : p15;
  ------------------
  |  |   21|   906M|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
                  p15 = (p15 < EC_MIN_PROB) ? EC_MIN_PROB : p15;
  ------------------
  |  |   21|   576k|#define EC_MIN_PROB 4  // must be <= (1<<EC_PROB_SHIFT)/16
  ------------------
  |  Branch (36:11): [True: 576k, False: 906M]
  ------------------
   37|   906M|    prev_cdf = AOM_ICDF(cdf[i]);
  ------------------
  |  |   38|   906M|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   906M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   906M|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   38|       |
   39|   906M|    if (inv_map)
  ------------------
  |  Branch (39:9): [True: 57.7M, False: 849M]
  ------------------
   40|  57.7M|      costs[inv_map[i]] = av1_cost_symbol(p15);
   41|   849M|    else
   42|   849M|      costs[i] = av1_cost_symbol(p15);
   43|       |
   44|       |    // Stop once we reach the end of the CDF
   45|   906M|    if (cdf[i] == AOM_ICDF(CDF_PROB_TOP)) break;
  ------------------
  |  |   38|   906M|#define AOM_ICDF(x) (CDF_PROB_TOP - (x))
  |  |  ------------------
  |  |  |  |   33|   906M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   906M|#define CDF_PROB_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 212M, False: 694M]
  ------------------
   46|   906M|  }
   47|   212M|}

partition_search.c:av1_cost_symbol:
   32|   304k|static inline int av1_cost_symbol(aom_cdf_prob p15) {
   33|       |  // p15 can be out of range [1, CDF_PROB_TOP - 1]. Clamping it, so that the
   34|       |  // following cost calculation works correctly. Otherwise, if p15 =
   35|       |  // CDF_PROB_TOP, shift would be -1, and "p15 << shift" would be wrong.
   36|   304k|  p15 = (aom_cdf_prob)clamp(p15, 1, CDF_PROB_TOP - 1);
  ------------------
  |  |   33|   304k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   304k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
   37|   304k|  assert(0 < p15 && p15 < CDF_PROB_TOP);
   38|   304k|  const int shift = CDF_PROB_BITS - 1 - get_msb(p15);
  ------------------
  |  |   32|   304k|#define CDF_PROB_BITS 15
  ------------------
   39|   304k|  const int prob = get_prob(p15 << shift, CDF_PROB_TOP);
  ------------------
  |  |   33|   304k|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   304k|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
   40|   304k|  assert(prob >= 128);
   41|   304k|  return av1_prob_cost[prob - 128] + av1_cost_literal(shift);
  ------------------
  |  |   29|   304k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   304k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
   42|   304k|}
cost.c:av1_cost_symbol:
   32|   906M|static inline int av1_cost_symbol(aom_cdf_prob p15) {
   33|       |  // p15 can be out of range [1, CDF_PROB_TOP - 1]. Clamping it, so that the
   34|       |  // following cost calculation works correctly. Otherwise, if p15 =
   35|       |  // CDF_PROB_TOP, shift would be -1, and "p15 << shift" would be wrong.
   36|   906M|  p15 = (aom_cdf_prob)clamp(p15, 1, CDF_PROB_TOP - 1);
  ------------------
  |  |   33|   906M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   906M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
   37|   906M|  assert(0 < p15 && p15 < CDF_PROB_TOP);
   38|   906M|  const int shift = CDF_PROB_BITS - 1 - get_msb(p15);
  ------------------
  |  |   32|   906M|#define CDF_PROB_BITS 15
  ------------------
   39|   906M|  const int prob = get_prob(p15 << shift, CDF_PROB_TOP);
  ------------------
  |  |   33|   906M|#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
  |  |  ------------------
  |  |  |  |   32|   906M|#define CDF_PROB_BITS 15
  |  |  ------------------
  ------------------
   40|   906M|  assert(prob >= 128);
   41|   906M|  return av1_prob_cost[prob - 128] + av1_cost_literal(shift);
  ------------------
  |  |   29|   906M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   906M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
   42|   906M|}

av1_configure_buffer_updates:
   59|  73.6k|                                  int force_refresh_all) {
   60|       |  // NOTE(weitinglin): Should we define another function to take care of
   61|       |  // cpi->rc.is_$Source_Type to make this function as it is in the comment?
   62|  73.6k|  const ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags =
   63|  73.6k|      &cpi->ext_flags.refresh_frame;
   64|  73.6k|  cpi->rc.is_src_frame_alt_ref = 0;
   65|       |
   66|  73.6k|  switch (type) {
   67|  18.4k|    case KF_UPDATE:
  ------------------
  |  Branch (67:5): [True: 18.4k, False: 55.2k]
  ------------------
   68|  18.4k|      set_refresh_frame_flags(refresh_frame, true, true, true);
   69|  18.4k|      break;
   70|       |
   71|  46.2k|    case LF_UPDATE:
  ------------------
  |  Branch (71:5): [True: 46.2k, False: 27.4k]
  ------------------
   72|  46.2k|      set_refresh_frame_flags(refresh_frame, false, false, false);
   73|  46.2k|      break;
   74|       |
   75|  9.01k|    case GF_UPDATE:
  ------------------
  |  Branch (75:5): [True: 9.01k, False: 64.6k]
  ------------------
   76|  9.01k|      set_refresh_frame_flags(refresh_frame, true, false, false);
   77|  9.01k|      break;
   78|       |
   79|      0|    case OVERLAY_UPDATE:
  ------------------
  |  Branch (79:5): [True: 0, False: 73.6k]
  ------------------
   80|      0|      if (refbuf_state == REFBUF_RESET)
  ------------------
  |  Branch (80:11): [True: 0, False: 0]
  ------------------
   81|      0|        set_refresh_frame_flags(refresh_frame, true, true, true);
   82|      0|      else
   83|      0|        set_refresh_frame_flags(refresh_frame, true, false, false);
   84|       |
   85|      0|      cpi->rc.is_src_frame_alt_ref = 1;
   86|      0|      break;
   87|       |
   88|      0|    case ARF_UPDATE:
  ------------------
  |  Branch (88:5): [True: 0, False: 73.6k]
  ------------------
   89|       |      // NOTE: BWDREF does not get updated along with ALTREF_FRAME.
   90|      0|      if (refbuf_state == REFBUF_RESET)
  ------------------
  |  Branch (90:11): [True: 0, False: 0]
  ------------------
   91|      0|        set_refresh_frame_flags(refresh_frame, true, true, true);
   92|      0|      else
   93|      0|        set_refresh_frame_flags(refresh_frame, false, false, true);
   94|       |
   95|      0|      break;
   96|       |
   97|      0|    case INTNL_OVERLAY_UPDATE:
  ------------------
  |  Branch (97:5): [True: 0, False: 73.6k]
  ------------------
   98|      0|      set_refresh_frame_flags(refresh_frame, false, false, false);
   99|      0|      cpi->rc.is_src_frame_alt_ref = 1;
  100|      0|      break;
  101|       |
  102|      0|    case INTNL_ARF_UPDATE:
  ------------------
  |  Branch (102:5): [True: 0, False: 73.6k]
  ------------------
  103|      0|      set_refresh_frame_flags(refresh_frame, false, true, false);
  104|      0|      break;
  105|       |
  106|      0|    default: assert(0); break;
  ------------------
  |  Branch (106:5): [True: 0, False: 73.6k]
  ------------------
  107|  73.6k|  }
  108|       |
  109|  73.6k|  if (ext_refresh_frame_flags->update_pending &&
  ------------------
  |  Branch (109:7): [True: 55.2k, False: 18.4k]
  ------------------
  110|  55.2k|      (!is_stat_generation_stage(cpi))) {
  ------------------
  |  Branch (110:7): [True: 55.2k, False: 0]
  ------------------
  111|  55.2k|    set_refresh_frame_flags(refresh_frame,
  112|  55.2k|                            ext_refresh_frame_flags->golden_frame,
  113|  55.2k|                            ext_refresh_frame_flags->bwd_ref_frame,
  114|  55.2k|                            ext_refresh_frame_flags->alt_ref_frame);
  115|  55.2k|    GF_GROUP *gf_group = &cpi->ppi->gf_group;
  116|  55.2k|    if (ext_refresh_frame_flags->golden_frame)
  ------------------
  |  Branch (116:9): [True: 0, False: 55.2k]
  ------------------
  117|      0|      gf_group->update_type[cpi->gf_frame_index] = GF_UPDATE;
  118|  55.2k|    if (ext_refresh_frame_flags->alt_ref_frame)
  ------------------
  |  Branch (118:9): [True: 0, False: 55.2k]
  ------------------
  119|      0|      gf_group->update_type[cpi->gf_frame_index] = ARF_UPDATE;
  120|  55.2k|    if (ext_refresh_frame_flags->bwd_ref_frame)
  ------------------
  |  Branch (120:9): [True: 0, False: 55.2k]
  ------------------
  121|      0|      gf_group->update_type[cpi->gf_frame_index] = INTNL_ARF_UPDATE;
  122|  55.2k|  }
  123|       |
  124|  73.6k|  if (force_refresh_all)
  ------------------
  |  Branch (124:7): [True: 18.4k, False: 55.2k]
  ------------------
  125|  18.4k|    set_refresh_frame_flags(refresh_frame, true, true, true);
  126|  73.6k|}
is_forced_keyframe_pending:
  306|  61.5k|                               const COMPRESSOR_STAGE compressor_stage) {
  307|   123k|  for (int i = 0; i <= up_to_index; i++) {
  ------------------
  |  Branch (307:19): [True: 123k, False: 0]
  ------------------
  308|   123k|    const struct lookahead_entry *e =
  309|   123k|        av1_lookahead_peek(lookahead, i, compressor_stage);
  310|   123k|    if (e == NULL) {
  ------------------
  |  Branch (310:9): [True: 61.5k, False: 61.5k]
  ------------------
  311|       |      // We have reached the end of the lookahead buffer and not early-returned
  312|       |      // so there isn't a forced key-frame pending.
  313|  61.5k|      return -1;
  314|  61.5k|    } else if (e->flags == AOM_EFLAG_FORCE_KF) {
  ------------------
  |  |  379|  61.5k|#define AOM_EFLAG_FORCE_KF (1 << 0)
  ------------------
  |  Branch (314:16): [True: 0, False: 61.5k]
  ------------------
  315|      0|      return i;
  316|  61.5k|    } else {
  317|  61.5k|      continue;
  318|  61.5k|    }
  319|   123k|  }
  320|      0|  return -1;  // Never reached
  321|  61.5k|}
av1_get_refresh_frame_flags:
  622|  73.6k|    RefFrameMapPair ref_frame_map_pairs[REF_FRAMES]) {
  623|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
  624|  73.6k|  const ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags =
  625|  73.6k|      &cpi->ext_flags.refresh_frame;
  626|       |
  627|  73.6k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
  628|  73.6k|  if (gf_group->refbuf_state[gf_index] == REFBUF_RESET)
  ------------------
  |  Branch (628:7): [True: 18.4k, False: 55.2k]
  ------------------
  629|  18.4k|    return SELECT_ALL_BUF_SLOTS;
  ------------------
  |  |  573|  18.4k|#define SELECT_ALL_BUF_SLOTS 0xFF
  ------------------
  630|       |
  631|       |  // TODO(jingning): Deprecate the following operations.
  632|       |  // Switch frames and shown key-frames overwrite all reference slots
  633|  55.2k|  if (frame_params->frame_type == S_FRAME) return SELECT_ALL_BUF_SLOTS;
  ------------------
  |  |  573|      0|#define SELECT_ALL_BUF_SLOTS 0xFF
  ------------------
  |  Branch (633:7): [True: 0, False: 55.2k]
  ------------------
  634|       |
  635|       |  // show_existing_frames don't actually send refresh_frame_flags so set the
  636|       |  // flags to 0 to keep things consistent.
  637|  55.2k|  if (frame_params->show_existing_frame) return 0;
  ------------------
  |  Branch (637:7): [True: 0, False: 55.2k]
  ------------------
  638|       |
  639|  55.2k|  const RTC_REF *const rtc_ref = &cpi->ppi->rtc_ref;
  640|  55.2k|  if (is_frame_droppable(rtc_ref, ext_refresh_frame_flags)) return 0;
  ------------------
  |  Branch (640:7): [True: 0, False: 55.2k]
  ------------------
  641|       |
  642|  55.2k|#if !CONFIG_REALTIME_ONLY
  643|  55.2k|  if (cpi->use_ducky_encode &&
  ------------------
  |  Branch (643:7): [True: 0, False: 55.2k]
  ------------------
  644|      0|      cpi->ducky_encode_info.frame_info.gop_mode == DUCKY_ENCODE_GOP_MODE_RCL) {
  ------------------
  |  Branch (644:7): [True: 0, False: 0]
  ------------------
  645|      0|    return get_new_fb_map_idx_rc(gf_group->update_ref_idx[gf_index]);
  646|      0|  }
  647|  55.2k|#endif  // !CONFIG_REALTIME_ONLY
  648|       |
  649|  55.2k|  if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (649:7): [True: 0, False: 55.2k]
  ------------------
  650|      0|      (cpi->ext_ratectrl.funcs.rc_type & AOM_RC_GOP) != 0 &&
  ------------------
  |  Branch (650:7): [True: 0, False: 0]
  ------------------
  651|      0|      cpi->ext_ratectrl.funcs.get_gop_decision != NULL) {
  ------------------
  |  Branch (651:7): [True: 0, False: 0]
  ------------------
  652|      0|    return get_new_fb_map_idx_rc(gf_group->update_ref_idx[gf_index]);
  653|      0|  }
  654|       |
  655|  55.2k|  int refresh_mask = 0;
  656|  55.2k|  if (ext_refresh_frame_flags->update_pending) {
  ------------------
  |  Branch (656:7): [True: 55.2k, False: 0]
  ------------------
  657|  55.2k|    if (rtc_ref->set_ref_frame_config ||
  ------------------
  |  Branch (657:9): [True: 0, False: 55.2k]
  ------------------
  658|  55.2k|        use_rtc_reference_structure_one_layer(cpi)) {
  ------------------
  |  Branch (658:9): [True: 0, False: 55.2k]
  ------------------
  659|      0|      for (unsigned int i = 0; i < INTER_REFS_PER_FRAME; i++) {
  ------------------
  |  Branch (659:32): [True: 0, False: 0]
  ------------------
  660|      0|        int ref_frame_map_idx = rtc_ref->ref_idx[i];
  661|      0|        refresh_mask |= rtc_ref->refresh[ref_frame_map_idx]
  662|      0|                        << ref_frame_map_idx;
  663|      0|      }
  664|      0|      return refresh_mask;
  665|      0|    }
  666|       |    // Unfortunately the encoder interface reflects the old refresh_*_frame
  667|       |    // flags so we have to replicate the old refresh_frame_flags logic here in
  668|       |    // order to preserve the behaviour of the flag overrides.
  669|  55.2k|    int ref_frame_map_idx = get_ref_frame_map_idx(cm, LAST_FRAME);
  670|  55.2k|    if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (670:9): [True: 55.2k, False: 0]
  ------------------
  671|  55.2k|      refresh_mask |= ext_refresh_frame_flags->last_frame << ref_frame_map_idx;
  672|       |
  673|  55.2k|    ref_frame_map_idx = get_ref_frame_map_idx(cm, EXTREF_FRAME);
  674|  55.2k|    if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (674:9): [True: 55.2k, False: 0]
  ------------------
  675|  55.2k|      refresh_mask |= ext_refresh_frame_flags->bwd_ref_frame
  676|  55.2k|                      << ref_frame_map_idx;
  677|       |
  678|  55.2k|    ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF2_FRAME);
  679|  55.2k|    if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (679:9): [True: 55.2k, False: 0]
  ------------------
  680|  55.2k|      refresh_mask |= ext_refresh_frame_flags->alt2_ref_frame
  681|  55.2k|                      << ref_frame_map_idx;
  682|       |
  683|  55.2k|    if (frame_update_type == OVERLAY_UPDATE) {
  ------------------
  |  Branch (683:9): [True: 0, False: 55.2k]
  ------------------
  684|      0|      ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF_FRAME);
  685|      0|      if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (685:11): [True: 0, False: 0]
  ------------------
  686|      0|        refresh_mask |= ext_refresh_frame_flags->golden_frame
  687|      0|                        << ref_frame_map_idx;
  688|  55.2k|    } else {
  689|  55.2k|      ref_frame_map_idx = get_ref_frame_map_idx(cm, GOLDEN_FRAME);
  690|  55.2k|      if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (690:11): [True: 55.2k, False: 0]
  ------------------
  691|  55.2k|        refresh_mask |= ext_refresh_frame_flags->golden_frame
  692|  55.2k|                        << ref_frame_map_idx;
  693|       |
  694|  55.2k|      ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF_FRAME);
  695|  55.2k|      if (ref_frame_map_idx != INVALID_IDX)
  ------------------
  |  |   15|  55.2k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (695:11): [True: 55.2k, False: 0]
  ------------------
  696|  55.2k|        refresh_mask |= ext_refresh_frame_flags->alt_ref_frame
  697|  55.2k|                        << ref_frame_map_idx;
  698|  55.2k|    }
  699|  55.2k|    return refresh_mask;
  700|  55.2k|  }
  701|       |
  702|       |  // Search for the open slot to store the current frame.
  703|      0|  int free_fb_index = get_free_ref_map_index(ref_frame_map_pairs);
  704|       |
  705|       |  // No refresh necessary for these frame types.
  706|      0|  if (frame_update_type == OVERLAY_UPDATE ||
  ------------------
  |  Branch (706:7): [True: 0, False: 0]
  ------------------
  707|      0|      frame_update_type == INTNL_OVERLAY_UPDATE)
  ------------------
  |  Branch (707:7): [True: 0, False: 0]
  ------------------
  708|      0|    return refresh_mask;
  709|       |
  710|       |  // If there is an open slot, refresh that one instead of replacing a
  711|       |  // reference.
  712|      0|  if (free_fb_index != INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (712:7): [True: 0, False: 0]
  ------------------
  713|      0|    refresh_mask = 1 << free_fb_index;
  714|      0|    return refresh_mask;
  715|      0|  }
  716|      0|  const int enable_refresh_skip = !is_one_pass_rt_params(cpi);
  717|      0|  const int update_arf = frame_update_type == ARF_UPDATE;
  718|      0|  const int refresh_idx =
  719|      0|      get_refresh_idx(ref_frame_map_pairs, update_arf, &cpi->ppi->gf_group,
  720|      0|                      gf_index, enable_refresh_skip, cur_disp_order);
  721|      0|  return 1 << refresh_idx;
  722|      0|}
av1_get_ref_frames:
 1012|  18.4k|                        int remapped_ref_idx[REF_FRAMES]) {
 1013|  18.4k|  int buf_map_idx = 0;
 1014|       |
 1015|       |  // Initialize reference frame mappings.
 1016|   165k|  for (int i = 0; i < REF_FRAMES; ++i) remapped_ref_idx[i] = INVALID_IDX;
  ------------------
  |  |   15|   147k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1016:19): [True: 147k, False: 18.4k]
  ------------------
 1017|       |
 1018|  18.4k|  if (cpi->ppi->gf_group.use_ext_ref_frame_map[gf_index]) {
  ------------------
  |  Branch (1018:7): [True: 0, False: 18.4k]
  ------------------
 1019|      0|    for (int rf = LAST_FRAME; rf < REF_FRAMES; ++rf) {
  ------------------
  |  Branch (1019:31): [True: 0, False: 0]
  ------------------
 1020|      0|      if (cpi->ppi->gf_group.ref_frame_list[gf_index][rf] != INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1020:11): [True: 0, False: 0]
  ------------------
 1021|      0|        remapped_ref_idx[rf - LAST_FRAME] =
 1022|      0|            (int)cpi->ppi->gf_group.ref_frame_list[gf_index][rf];
 1023|      0|      }
 1024|      0|    }
 1025|      0|    for (int i = 0; i < REF_FRAMES; ++i) {
  ------------------
  |  Branch (1025:21): [True: 0, False: 0]
  ------------------
 1026|      0|      if (remapped_ref_idx[i] == INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1026:11): [True: 0, False: 0]
  ------------------
 1027|      0|        remapped_ref_idx[i] = 0;
 1028|      0|      }
 1029|      0|    }
 1030|      0|    return;
 1031|      0|  }
 1032|       |
 1033|  18.4k|#if !CONFIG_REALTIME_ONLY
 1034|  18.4k|  if (cpi->use_ducky_encode &&
  ------------------
  |  Branch (1034:7): [True: 0, False: 18.4k]
  ------------------
 1035|      0|      cpi->ducky_encode_info.frame_info.gop_mode == DUCKY_ENCODE_GOP_MODE_RCL) {
  ------------------
  |  Branch (1035:7): [True: 0, False: 0]
  ------------------
 1036|      0|    for (int rf = LAST_FRAME; rf < REF_FRAMES; ++rf) {
  ------------------
  |  Branch (1036:31): [True: 0, False: 0]
  ------------------
 1037|      0|      if (cpi->ppi->gf_group.ref_frame_list[gf_index][rf] != INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1037:11): [True: 0, False: 0]
  ------------------
 1038|      0|        remapped_ref_idx[rf - LAST_FRAME] =
 1039|      0|            cpi->ppi->gf_group.ref_frame_list[gf_index][rf];
 1040|      0|      }
 1041|      0|    }
 1042|       |
 1043|      0|    int valid_rf_idx = 0;
 1044|      0|    static const int ref_frame_type_order[REF_FRAMES - LAST_FRAME] = {
 1045|      0|      GOLDEN_FRAME,  ALTREF_FRAME, LAST_FRAME, BWDREF_FRAME,
 1046|      0|      ALTREF2_FRAME, LAST2_FRAME,  LAST3_FRAME
 1047|      0|    };
 1048|      0|    for (int i = 0; i < REF_FRAMES - LAST_FRAME; i++) {
  ------------------
  |  Branch (1048:21): [True: 0, False: 0]
  ------------------
 1049|      0|      int rf = ref_frame_type_order[i];
 1050|      0|      if (remapped_ref_idx[rf - LAST_FRAME] != INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1050:11): [True: 0, False: 0]
  ------------------
 1051|      0|        valid_rf_idx = remapped_ref_idx[rf - LAST_FRAME];
 1052|      0|        break;
 1053|      0|      }
 1054|      0|    }
 1055|       |
 1056|      0|    for (int i = 0; i < REF_FRAMES; ++i) {
  ------------------
  |  Branch (1056:21): [True: 0, False: 0]
  ------------------
 1057|      0|      if (remapped_ref_idx[i] == INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1057:11): [True: 0, False: 0]
  ------------------
 1058|      0|        remapped_ref_idx[i] = valid_rf_idx;
 1059|      0|      }
 1060|      0|    }
 1061|       |
 1062|      0|    return;
 1063|      0|  }
 1064|  18.4k|#endif  // !CONFIG_REALTIME_ONLY
 1065|       |
 1066|  18.4k|  RefBufMapData buffer_map[REF_FRAMES];
 1067|  18.4k|  int n_bufs = 0;
 1068|  18.4k|  memset(buffer_map, 0, REF_FRAMES * sizeof(buffer_map[0]));
 1069|  18.4k|  int min_level = MAX_ARF_LAYERS;
  ------------------
  |  |   54|  18.4k|#define MAX_ARF_LAYERS 6
  ------------------
 1070|  18.4k|  int max_level = 0;
 1071|  18.4k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
 1072|  18.4k|  int skip_ref_unmapping = 0;
 1073|  18.4k|  int is_one_pass_rt = is_one_pass_rt_params(cpi);
 1074|       |
 1075|       |  // Go through current reference buffers and store display order, pyr level,
 1076|       |  // and map index.
 1077|   165k|  for (int map_idx = 0; map_idx < REF_FRAMES; map_idx++) {
  ------------------
  |  Branch (1077:25): [True: 147k, False: 18.4k]
  ------------------
 1078|       |    // Get reference frame buffer.
 1079|   147k|    RefFrameMapPair ref_pair = ref_frame_map_pairs[map_idx];
 1080|   147k|    if (ref_pair.disp_order == -1) continue;
  ------------------
  |  Branch (1080:9): [True: 147k, False: 0]
  ------------------
 1081|      0|    const int frame_order = ref_pair.disp_order;
 1082|       |    // Avoid duplicates.
 1083|      0|    if (is_in_ref_map(buffer_map, frame_order, n_bufs)) continue;
  ------------------
  |  Branch (1083:9): [True: 0, False: 0]
  ------------------
 1084|      0|    const int reference_frame_level = ref_pair.pyr_level;
 1085|       |
 1086|       |    // Keep track of the lowest and highest levels that currently exist.
 1087|      0|    if (reference_frame_level < min_level) min_level = reference_frame_level;
  ------------------
  |  Branch (1087:9): [True: 0, False: 0]
  ------------------
 1088|      0|    if (reference_frame_level > max_level) max_level = reference_frame_level;
  ------------------
  |  Branch (1088:9): [True: 0, False: 0]
  ------------------
 1089|       |
 1090|      0|    buffer_map[n_bufs].map_idx = map_idx;
 1091|      0|    buffer_map[n_bufs].disp_order = frame_order;
 1092|      0|    buffer_map[n_bufs].pyr_level = reference_frame_level;
 1093|      0|    buffer_map[n_bufs].used = 0;
 1094|      0|    n_bufs++;
 1095|      0|  }
 1096|       |
 1097|       |  // Sort frames in ascending display order.
 1098|  18.4k|  qsort(buffer_map, n_bufs, sizeof(buffer_map[0]), compare_map_idx_pair_asc);
 1099|       |
 1100|  18.4k|  int n_min_level_refs = 0;
 1101|  18.4k|  int closest_past_ref = -1;
 1102|  18.4k|  int golden_idx = -1;
 1103|  18.4k|  int altref_idx = -1;
 1104|       |
 1105|       |  // Find the GOLDEN_FRAME and BWDREF_FRAME.
 1106|       |  // Also collect various stats about the reference frames for the remaining
 1107|       |  // mappings.
 1108|  18.4k|  for (int i = n_bufs - 1; i >= 0; i--) {
  ------------------
  |  Branch (1108:28): [True: 0, False: 18.4k]
  ------------------
 1109|      0|    if (buffer_map[i].pyr_level == min_level) {
  ------------------
  |  Branch (1109:9): [True: 0, False: 0]
  ------------------
 1110|       |      // Keep track of the number of lowest level frames.
 1111|      0|      n_min_level_refs++;
 1112|      0|      if (buffer_map[i].disp_order < cur_frame_disp && golden_idx == -1 &&
  ------------------
  |  Branch (1112:11): [True: 0, False: 0]
  |  Branch (1112:56): [True: 0, False: 0]
  ------------------
 1113|      0|          remapped_ref_idx[GOLDEN_FRAME - LAST_FRAME] == INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1113:11): [True: 0, False: 0]
  ------------------
 1114|       |        // Save index for GOLDEN.
 1115|      0|        golden_idx = i;
 1116|      0|      } else if (buffer_map[i].disp_order > cur_frame_disp &&
  ------------------
  |  Branch (1116:18): [True: 0, False: 0]
  ------------------
 1117|      0|                 altref_idx == -1 &&
  ------------------
  |  Branch (1117:18): [True: 0, False: 0]
  ------------------
 1118|      0|                 remapped_ref_idx[ALTREF_FRAME - LAST_FRAME] == INVALID_IDX) {
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1118:18): [True: 0, False: 0]
  ------------------
 1119|       |        // Save index for ALTREF.
 1120|      0|        altref_idx = i;
 1121|      0|      }
 1122|      0|    } else if (buffer_map[i].disp_order == cur_frame_disp) {
  ------------------
  |  Branch (1122:16): [True: 0, False: 0]
  ------------------
 1123|       |      // Map the BWDREF_FRAME if this is the show_existing_frame.
 1124|      0|      add_ref_to_slot(&buffer_map[i], remapped_ref_idx, BWDREF_FRAME);
 1125|      0|    }
 1126|       |
 1127|       |    // During parallel encodes of lower layer frames, exclude the first frame
 1128|       |    // (frame_parallel_level 1) from being used for the reference assignment of
 1129|       |    // the second frame (frame_parallel_level 2).
 1130|      0|    if (!is_one_pass_rt && gf_group->frame_parallel_level[gf_index] == 2 &&
  ------------------
  |  Branch (1130:9): [True: 0, False: 0]
  |  Branch (1130:28): [True: 0, False: 0]
  ------------------
 1131|      0|        gf_group->frame_parallel_level[gf_index - 1] == 1 &&
  ------------------
  |  Branch (1131:9): [True: 0, False: 0]
  ------------------
 1132|      0|        gf_group->update_type[gf_index - 1] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (1132:9): [True: 0, False: 0]
  ------------------
 1133|      0|      assert(gf_group->update_type[gf_index] == INTNL_ARF_UPDATE);
 1134|       |#if CONFIG_FPMT_TEST
 1135|       |      is_parallel_encode = (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_ENCODE)
 1136|       |                               ? is_parallel_encode
 1137|       |                               : 0;
 1138|       |#endif  // CONFIG_FPMT_TEST
 1139|       |      // If parallel cpis are active, use ref_idx_to_skip, else, use display
 1140|       |      // index.
 1141|      0|      assert(IMPLIES(is_parallel_encode, cpi->ref_idx_to_skip != INVALID_IDX));
 1142|      0|      assert(IMPLIES(!is_parallel_encode,
 1143|      0|                     gf_group->skip_frame_as_ref[gf_index] != INVALID_IDX));
 1144|      0|      buffer_map[i].used = is_parallel_encode
  ------------------
  |  Branch (1144:28): [True: 0, False: 0]
  ------------------
 1145|      0|                               ? (buffer_map[i].map_idx == cpi->ref_idx_to_skip)
 1146|      0|                               : (buffer_map[i].disp_order ==
 1147|      0|                                  gf_group->skip_frame_as_ref[gf_index]);
 1148|       |      // In case a ref frame is excluded from being used during assignment,
 1149|       |      // skip the call to set_unmapped_ref(). Applicable in steady state.
 1150|      0|      if (buffer_map[i].used) skip_ref_unmapping = 1;
  ------------------
  |  Branch (1150:11): [True: 0, False: 0]
  ------------------
 1151|      0|    }
 1152|       |
 1153|       |    // Keep track of where the frames change from being past frames to future
 1154|       |    // frames.
 1155|      0|    if (buffer_map[i].disp_order < cur_frame_disp && closest_past_ref < 0)
  ------------------
  |  Branch (1155:9): [True: 0, False: 0]
  |  Branch (1155:54): [True: 0, False: 0]
  ------------------
 1156|      0|      closest_past_ref = i;
 1157|      0|  }
 1158|       |
 1159|       |  // Do not map GOLDEN and ALTREF based on their pyramid level if all reference
 1160|       |  // frames have the same level.
 1161|  18.4k|  if (n_min_level_refs < n_bufs) {
  ------------------
  |  Branch (1161:7): [True: 0, False: 18.4k]
  ------------------
 1162|       |    // Map the GOLDEN_FRAME.
 1163|      0|    if (golden_idx > -1)
  ------------------
  |  Branch (1163:9): [True: 0, False: 0]
  ------------------
 1164|      0|      add_ref_to_slot(&buffer_map[golden_idx], remapped_ref_idx, GOLDEN_FRAME);
 1165|       |    // Map the ALTREF_FRAME.
 1166|      0|    if (altref_idx > -1)
  ------------------
  |  Branch (1166:9): [True: 0, False: 0]
  ------------------
 1167|      0|      add_ref_to_slot(&buffer_map[altref_idx], remapped_ref_idx, ALTREF_FRAME);
 1168|      0|  }
 1169|       |
 1170|       |  // Find the buffer to be excluded from the mapping.
 1171|  18.4k|  if (!skip_ref_unmapping)
  ------------------
  |  Branch (1171:7): [True: 18.4k, False: 0]
  ------------------
 1172|  18.4k|    set_unmapped_ref(buffer_map, n_bufs, n_min_level_refs, min_level,
 1173|  18.4k|                     cur_frame_disp);
 1174|       |
 1175|       |  // Place past frames in LAST_FRAME, LAST2_FRAME, and LAST3_FRAME.
 1176|  18.4k|  for (int frame = LAST_FRAME; frame < GOLDEN_FRAME; frame++) {
  ------------------
  |  Branch (1176:32): [True: 18.4k, False: 0]
  ------------------
 1177|       |    // Continue if the current ref slot is already full.
 1178|  18.4k|    if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
  ------------------
  |  |   15|  18.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1178:9): [True: 0, False: 18.4k]
  ------------------
 1179|       |    // Find the next unmapped reference buffer
 1180|       |    // in decreasing output order relative to current picture.
 1181|  18.4k|    int next_buf_max = -1;
 1182|  18.4k|    int next_disp_order = INT_MIN;
 1183|  18.4k|    for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) {
  ------------------
  |  Branch (1183:36): [True: 0, False: 18.4k]
  ------------------
 1184|      0|      if (!buffer_map[buf_map_idx].used &&
  ------------------
  |  Branch (1184:11): [True: 0, False: 0]
  ------------------
 1185|      0|          buffer_map[buf_map_idx].disp_order < cur_frame_disp &&
  ------------------
  |  Branch (1185:11): [True: 0, False: 0]
  ------------------
 1186|      0|          buffer_map[buf_map_idx].disp_order > next_disp_order) {
  ------------------
  |  Branch (1186:11): [True: 0, False: 0]
  ------------------
 1187|      0|        next_disp_order = buffer_map[buf_map_idx].disp_order;
 1188|      0|        next_buf_max = buf_map_idx;
 1189|      0|      }
 1190|      0|    }
 1191|  18.4k|    buf_map_idx = next_buf_max;
 1192|  18.4k|    if (buf_map_idx < 0) break;
  ------------------
  |  Branch (1192:9): [True: 18.4k, False: 0]
  ------------------
 1193|      0|    if (buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1193:9): [True: 0, False: 0]
  ------------------
 1194|      0|    add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
 1195|      0|  }
 1196|       |
 1197|       |  // Place future frames (if there are any) in BWDREF_FRAME and ALTREF2_FRAME.
 1198|  18.4k|  for (int frame = BWDREF_FRAME; frame < REF_FRAMES; frame++) {
  ------------------
  |  Branch (1198:34): [True: 18.4k, False: 0]
  ------------------
 1199|       |    // Continue if the current ref slot is already full.
 1200|  18.4k|    if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
  ------------------
  |  |   15|  18.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1200:9): [True: 0, False: 18.4k]
  ------------------
 1201|       |    // Find the next unmapped reference buffer
 1202|       |    // in increasing output order relative to current picture.
 1203|  18.4k|    int next_buf_max = -1;
 1204|  18.4k|    int next_disp_order = INT_MAX;
 1205|  18.4k|    for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) {
  ------------------
  |  Branch (1205:36): [True: 0, False: 18.4k]
  ------------------
 1206|      0|      if (!buffer_map[buf_map_idx].used &&
  ------------------
  |  Branch (1206:11): [True: 0, False: 0]
  ------------------
 1207|      0|          buffer_map[buf_map_idx].disp_order > cur_frame_disp &&
  ------------------
  |  Branch (1207:11): [True: 0, False: 0]
  ------------------
 1208|      0|          buffer_map[buf_map_idx].disp_order < next_disp_order) {
  ------------------
  |  Branch (1208:11): [True: 0, False: 0]
  ------------------
 1209|      0|        next_disp_order = buffer_map[buf_map_idx].disp_order;
 1210|      0|        next_buf_max = buf_map_idx;
 1211|      0|      }
 1212|      0|    }
 1213|  18.4k|    buf_map_idx = next_buf_max;
 1214|  18.4k|    if (buf_map_idx < 0) break;
  ------------------
  |  Branch (1214:9): [True: 18.4k, False: 0]
  ------------------
 1215|      0|    if (buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1215:9): [True: 0, False: 0]
  ------------------
 1216|      0|    add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
 1217|      0|  }
 1218|       |
 1219|       |  // Place remaining past frames.
 1220|  18.4k|  buf_map_idx = closest_past_ref;
 1221|  18.4k|  for (int frame = LAST_FRAME; frame < REF_FRAMES; frame++) {
  ------------------
  |  Branch (1221:32): [True: 18.4k, False: 0]
  ------------------
 1222|       |    // Continue if the current ref slot is already full.
 1223|  18.4k|    if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
  ------------------
  |  |   15|  18.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1223:9): [True: 0, False: 18.4k]
  ------------------
 1224|       |    // Find the next unmapped reference buffer.
 1225|  18.4k|    for (; buf_map_idx >= 0; buf_map_idx--) {
  ------------------
  |  Branch (1225:12): [True: 0, False: 18.4k]
  ------------------
 1226|      0|      if (!buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1226:11): [True: 0, False: 0]
  ------------------
 1227|      0|    }
 1228|  18.4k|    if (buf_map_idx < 0) break;
  ------------------
  |  Branch (1228:9): [True: 18.4k, False: 0]
  ------------------
 1229|      0|    if (buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1229:9): [True: 0, False: 0]
  ------------------
 1230|      0|    add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
 1231|      0|  }
 1232|       |
 1233|       |  // Place remaining future frames.
 1234|  18.4k|  buf_map_idx = n_bufs - 1;
 1235|  18.4k|  for (int frame = ALTREF_FRAME; frame >= LAST_FRAME; frame--) {
  ------------------
  |  Branch (1235:34): [True: 18.4k, False: 0]
  ------------------
 1236|       |    // Continue if the current ref slot is already full.
 1237|  18.4k|    if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
  ------------------
  |  |   15|  18.4k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1237:9): [True: 0, False: 18.4k]
  ------------------
 1238|       |    // Find the next unmapped reference buffer.
 1239|  18.4k|    for (; buf_map_idx > closest_past_ref; buf_map_idx--) {
  ------------------
  |  Branch (1239:12): [True: 0, False: 18.4k]
  ------------------
 1240|      0|      if (!buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1240:11): [True: 0, False: 0]
  ------------------
 1241|      0|    }
 1242|  18.4k|    if (buf_map_idx < 0) break;
  ------------------
  |  Branch (1242:9): [True: 18.4k, False: 0]
  ------------------
 1243|      0|    if (buffer_map[buf_map_idx].used) break;
  ------------------
  |  Branch (1243:9): [True: 0, False: 0]
  ------------------
 1244|      0|    add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
 1245|      0|  }
 1246|       |
 1247|       |  // Fill any slots that are empty (should only happen for the first 7 frames).
 1248|   165k|  for (int i = 0; i < REF_FRAMES; ++i)
  ------------------
  |  Branch (1248:19): [True: 147k, False: 18.4k]
  ------------------
 1249|   147k|    if (remapped_ref_idx[i] == INVALID_IDX) remapped_ref_idx[i] = 0;
  ------------------
  |  |   15|   147k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (1249:9): [True: 147k, False: 0]
  ------------------
 1250|  18.4k|}
av1_encode_strategy:
 1257|  92.0k|                        int *const pop_lookahead, int flush) {
 1258|  92.0k|  AV1EncoderConfig *const oxcf = &cpi->oxcf;
 1259|  92.0k|  AV1_COMMON *const cm = &cpi->common;
 1260|  92.0k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
 1261|  92.0k|  ExternalFlags *const ext_flags = &cpi->ext_flags;
 1262|  92.0k|  GFConfig *const gf_cfg = &oxcf->gf_cfg;
 1263|       |
 1264|  92.0k|  EncodeFrameInput frame_input;
 1265|  92.0k|  EncodeFrameParams frame_params;
 1266|  92.0k|  size_t frame_size;
 1267|  92.0k|  memset(&frame_input, 0, sizeof(frame_input));
 1268|  92.0k|  memset(&frame_params, 0, sizeof(frame_params));
 1269|  92.0k|  frame_size = 0;
 1270|       |
 1271|       |#if CONFIG_BITRATE_ACCURACY && CONFIG_THREE_PASS
 1272|       |  VBR_RATECTRL_INFO *vbr_rc_info = &cpi->vbr_rc_info;
 1273|       |  if (oxcf->pass == AOM_RC_THIRD_PASS && vbr_rc_info->ready == 0) {
 1274|       |    THIRD_PASS_FRAME_INFO frame_info[MAX_THIRD_PASS_BUF];
 1275|       |    av1_open_second_pass_log(cpi, 1);
 1276|       |    FILE *second_pass_log_stream = cpi->second_pass_log_stream;
 1277|       |    fseek(second_pass_log_stream, 0, SEEK_END);
 1278|       |    size_t file_size = ftell(second_pass_log_stream);
 1279|       |    rewind(second_pass_log_stream);
 1280|       |    size_t read_size = 0;
 1281|       |    while (read_size < file_size) {
 1282|       |      THIRD_PASS_GOP_INFO gop_info;
 1283|       |      struct aom_internal_error_info *error = cpi->common.error;
 1284|       |      // Read in GOP information from the second pass file.
 1285|       |      av1_read_second_pass_gop_info(second_pass_log_stream, &gop_info, error);
 1286|       |      TPL_INFO *tpl_info;
 1287|       |      AOM_CHECK_MEM_ERROR(cm->error, tpl_info, aom_malloc(sizeof(*tpl_info)));
 1288|       |      av1_read_tpl_info(tpl_info, second_pass_log_stream, error);
 1289|       |      // Read in per-frame info from second-pass encoding
 1290|       |      av1_read_second_pass_per_frame_info(second_pass_log_stream, frame_info,
 1291|       |                                          gop_info.num_frames, error);
 1292|       |      av1_vbr_rc_append_tpl_info(vbr_rc_info, tpl_info);
 1293|       |      read_size = ftell(second_pass_log_stream);
 1294|       |      aom_free(tpl_info);
 1295|       |    }
 1296|       |    av1_close_second_pass_log(cpi);
 1297|       |    if (cpi->oxcf.rc_cfg.mode == AOM_Q) {
 1298|       |      vbr_rc_info->base_q_index = cpi->oxcf.rc_cfg.cq_level;
 1299|       |      av1_vbr_rc_compute_q_indices(
 1300|       |          vbr_rc_info->base_q_index, vbr_rc_info->total_frame_count,
 1301|       |          vbr_rc_info->qstep_ratio_list, cm->seq_params->bit_depth,
 1302|       |          vbr_rc_info->q_index_list);
 1303|       |    } else {
 1304|       |      vbr_rc_info->base_q_index = av1_vbr_rc_info_estimate_base_q(
 1305|       |          vbr_rc_info->total_bit_budget, cm->seq_params->bit_depth,
 1306|       |          vbr_rc_info->scale_factors, vbr_rc_info->total_frame_count,
 1307|       |          vbr_rc_info->update_type_list, vbr_rc_info->qstep_ratio_list,
 1308|       |          vbr_rc_info->txfm_stats_list, vbr_rc_info->q_index_list, NULL);
 1309|       |    }
 1310|       |    vbr_rc_info->ready = 1;
 1311|       |#if CONFIG_RATECTRL_LOG
 1312|       |    rc_log_record_chunk_info(&cpi->rc_log, vbr_rc_info->base_q_index,
 1313|       |                             vbr_rc_info->total_frame_count);
 1314|       |#endif  // CONFIG_RATECTRL_LOG
 1315|       |  }
 1316|       |#endif  // CONFIG_BITRATE_ACCURACY && CONFIG_THREE_PASS
 1317|       |
 1318|       |  // Check if we need to stuff more src frames
 1319|  92.0k|  if (flush == 0) {
  ------------------
  |  Branch (1319:7): [True: 73.6k, False: 18.4k]
  ------------------
 1320|  73.6k|    int srcbuf_size =
 1321|  73.6k|        av1_lookahead_depth(cpi->ppi->lookahead, cpi->compressor_stage);
 1322|  73.6k|    int pop_size =
 1323|  73.6k|        av1_lookahead_pop_sz(cpi->ppi->lookahead, cpi->compressor_stage);
 1324|       |
 1325|       |    // Continue buffering look ahead buffer.
 1326|  73.6k|    if (srcbuf_size < pop_size) return -1;
  ------------------
  |  Branch (1326:9): [True: 0, False: 73.6k]
  ------------------
 1327|  73.6k|  }
 1328|       |
 1329|  92.0k|  if (!av1_lookahead_peek(cpi->ppi->lookahead, 0, cpi->compressor_stage)) {
  ------------------
  |  Branch (1329:7): [True: 18.4k, False: 73.6k]
  ------------------
 1330|  18.4k|#if !CONFIG_REALTIME_ONLY
 1331|  18.4k|    if (flush && oxcf->pass == AOM_RC_FIRST_PASS &&
  ------------------
  |  Branch (1331:9): [True: 18.4k, False: 0]
  |  Branch (1331:18): [True: 0, False: 18.4k]
  ------------------
 1332|      0|        !cpi->ppi->twopass.first_pass_done) {
  ------------------
  |  Branch (1332:9): [True: 0, False: 0]
  ------------------
 1333|      0|      av1_end_first_pass(cpi); /* get last stats packet */
 1334|      0|      cpi->ppi->twopass.first_pass_done = 1;
 1335|      0|    }
 1336|  18.4k|#endif
 1337|  18.4k|    return -1;
 1338|  18.4k|  }
 1339|       |
 1340|  73.6k|  if (has_no_stats_stage(cpi) && !is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (1340:7): [True: 73.6k, False: 0]
  |  Branch (1340:34): [True: 73.6k, False: 0]
  ------------------
 1341|  73.6k|    gf_cfg->gf_max_pyr_height =
 1342|  73.6k|        AOMMIN(gf_cfg->gf_max_pyr_height, USE_ALTREF_FOR_ONE_PASS);
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 73.6k]
  |  |  ------------------
  ------------------
 1343|  73.6k|    gf_cfg->gf_min_pyr_height =
 1344|  73.6k|        AOMMIN(gf_cfg->gf_min_pyr_height, gf_cfg->gf_max_pyr_height);
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
 1345|  73.6k|  }
 1346|       |
 1347|       |  // Allocation of mi buffers.
 1348|  73.6k|  alloc_mb_mode_info_buffers(cpi);
 1349|       |
 1350|  73.6k|  cpi->cb_delta_rdmult_enabled = 0;
 1351|       |
 1352|  73.6k|  cpi->skip_tpl_setup_stats = 0;
 1353|  73.6k|#if !CONFIG_REALTIME_ONLY
 1354|  73.6k|  if (oxcf->pass != AOM_RC_FIRST_PASS) {
  ------------------
  |  Branch (1354:7): [True: 73.6k, False: 0]
  ------------------
 1355|  73.6k|    TplParams *const tpl_data = &cpi->ppi->tpl_data;
 1356|  73.6k|    if (tpl_data->tpl_stats_pool[0] == NULL) {
  ------------------
  |  Branch (1356:9): [True: 73.6k, False: 0]
  ------------------
 1357|  73.6k|      av1_setup_tpl_buffers(cpi->ppi, &cm->mi_params, oxcf->frm_dim_cfg.width,
 1358|  73.6k|                            oxcf->frm_dim_cfg.height, 0,
 1359|  73.6k|                            oxcf->gf_cfg.lag_in_frames);
 1360|  73.6k|    }
 1361|  73.6k|  }
 1362|  73.6k|  cpi->twopass_frame.this_frame = NULL;
 1363|  73.6k|  const int use_one_pass_rt_params = is_one_pass_rt_params(cpi);
 1364|  73.6k|  if (!use_one_pass_rt_params && !is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1364:7): [True: 49.2k, False: 24.4k]
  |  Branch (1364:34): [True: 49.2k, False: 0]
  ------------------
 1365|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1366|       |    start_timing(cpi, av1_get_second_pass_params_time);
 1367|       |#endif
 1368|       |
 1369|       |    // Initialise frame_level_rate_correction_factors with value previous
 1370|       |    // to the parallel frames.
 1371|  49.2k|    if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 49.2k]
  ------------------
 1372|      0|      for (int i = 0; i < RATE_FACTOR_LEVELS; i++) {
  ------------------
  |  Branch (1372:23): [True: 0, False: 0]
  ------------------
 1373|      0|        cpi->rc.frame_level_rate_correction_factors[i] =
 1374|       |#if CONFIG_FPMT_TEST
 1375|       |            (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE)
 1376|       |                ? cpi->ppi->p_rc.temp_rate_correction_factors[i]
 1377|       |                :
 1378|       |#endif  // CONFIG_FPMT_TEST
 1379|      0|                cpi->ppi->p_rc.rate_correction_factors[i];
 1380|      0|      }
 1381|      0|    }
 1382|       |
 1383|       |    // copy mv_stats from ppi to frame_level cpi.
 1384|  49.2k|    cpi->mv_stats = cpi->ppi->mv_stats;
 1385|  49.2k|    av1_get_second_pass_params(cpi, &frame_params, *frame_flags);
 1386|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1387|       |    end_timing(cpi, av1_get_second_pass_params_time);
 1388|       |#endif
 1389|  49.2k|  }
 1390|  73.6k|#endif
 1391|       |
 1392|  73.6k|  if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1392:7): [True: 73.6k, False: 0]
  ------------------
 1393|       |    // TODO(jingning): fwd key frame always uses show existing frame?
 1394|  73.6k|    if (gf_group->update_type[cpi->gf_frame_index] == OVERLAY_UPDATE &&
  ------------------
  |  Branch (1394:9): [True: 0, False: 73.6k]
  ------------------
 1395|      0|        gf_group->refbuf_state[cpi->gf_frame_index] == REFBUF_RESET) {
  ------------------
  |  Branch (1395:9): [True: 0, False: 0]
  ------------------
 1396|      0|      frame_params.show_existing_frame = 1;
 1397|  73.6k|    } else {
 1398|  73.6k|      frame_params.show_existing_frame =
 1399|  73.6k|          (cpi->ppi->show_existing_alt_ref &&
  ------------------
  |  Branch (1399:12): [True: 0, False: 73.6k]
  ------------------
 1400|      0|           gf_group->update_type[cpi->gf_frame_index] == OVERLAY_UPDATE) ||
  ------------------
  |  Branch (1400:12): [True: 0, False: 0]
  ------------------
 1401|  73.6k|          gf_group->update_type[cpi->gf_frame_index] == INTNL_OVERLAY_UPDATE;
  ------------------
  |  Branch (1401:11): [True: 0, False: 73.6k]
  ------------------
 1402|  73.6k|    }
 1403|  73.6k|    frame_params.show_existing_frame &= allow_show_existing(cpi, *frame_flags);
 1404|       |
 1405|       |    // Special handling to reset 'show_existing_frame' in case of dropped
 1406|       |    // frames.
 1407|  73.6k|    if (oxcf->rc_cfg.drop_frames_water_mark &&
  ------------------
  |  Branch (1407:9): [True: 0, False: 73.6k]
  ------------------
 1408|      0|        (gf_group->update_type[cpi->gf_frame_index] == OVERLAY_UPDATE ||
  ------------------
  |  Branch (1408:10): [True: 0, False: 0]
  ------------------
 1409|      0|         gf_group->update_type[cpi->gf_frame_index] == INTNL_OVERLAY_UPDATE)) {
  ------------------
  |  Branch (1409:10): [True: 0, False: 0]
  ------------------
 1410|       |      // During the encode of an OVERLAY_UPDATE/INTNL_OVERLAY_UPDATE frame, loop
 1411|       |      // over the gf group to check if the corresponding
 1412|       |      // ARF_UPDATE/INTNL_ARF_UPDATE frame was dropped.
 1413|      0|      int cur_disp_idx = gf_group->display_idx[cpi->gf_frame_index];
 1414|      0|      for (int idx = 0; idx < cpi->gf_frame_index; idx++) {
  ------------------
  |  Branch (1414:25): [True: 0, False: 0]
  ------------------
 1415|      0|        if (cur_disp_idx == gf_group->display_idx[idx]) {
  ------------------
  |  Branch (1415:13): [True: 0, False: 0]
  ------------------
 1416|      0|          assert(IMPLIES(
 1417|      0|              gf_group->update_type[cpi->gf_frame_index] == OVERLAY_UPDATE,
 1418|      0|              gf_group->update_type[idx] == ARF_UPDATE));
 1419|      0|          assert(IMPLIES(gf_group->update_type[cpi->gf_frame_index] ==
 1420|      0|                             INTNL_OVERLAY_UPDATE,
 1421|      0|                         gf_group->update_type[idx] == INTNL_ARF_UPDATE));
 1422|       |          // Reset show_existing_frame and set cpi->is_dropped_frame to true if
 1423|       |          // the frame was dropped during its first encode.
 1424|      0|          if (gf_group->is_frame_dropped[idx]) {
  ------------------
  |  Branch (1424:15): [True: 0, False: 0]
  ------------------
 1425|      0|            frame_params.show_existing_frame = 0;
 1426|      0|            assert(!cpi->is_dropped_frame);
 1427|      0|            cpi->is_dropped_frame = true;
 1428|      0|          }
 1429|      0|          break;
 1430|      0|        }
 1431|      0|      }
 1432|      0|    }
 1433|       |
 1434|       |    // Reset show_existing_alt_ref decision to 0 after it is used.
 1435|  73.6k|    if (gf_group->update_type[cpi->gf_frame_index] == OVERLAY_UPDATE) {
  ------------------
  |  Branch (1435:9): [True: 0, False: 73.6k]
  ------------------
 1436|      0|      cpi->ppi->show_existing_alt_ref = 0;
 1437|      0|    }
 1438|  73.6k|  } else {
 1439|      0|    frame_params.show_existing_frame = 0;
 1440|      0|  }
 1441|       |
 1442|  73.6k|  struct lookahead_entry *source = NULL;
 1443|  73.6k|  struct lookahead_entry *last_source = NULL;
 1444|  73.6k|  if (frame_params.show_existing_frame) {
  ------------------
  |  Branch (1444:7): [True: 0, False: 73.6k]
  ------------------
 1445|      0|    source = av1_lookahead_peek(cpi->ppi->lookahead, 0, cpi->compressor_stage);
 1446|      0|    *pop_lookahead = 1;
 1447|      0|    frame_params.show_frame = 1;
 1448|  73.6k|  } else {
 1449|  73.6k|    source = choose_frame_source(cpi, &flush, pop_lookahead, &last_source,
 1450|  73.6k|                                 &frame_params.show_frame);
 1451|  73.6k|  }
 1452|       |
 1453|  73.6k|  if (source == NULL) {  // If no source was found, we can't encode a frame.
  ------------------
  |  Branch (1453:7): [True: 0, False: 73.6k]
  ------------------
 1454|      0|#if !CONFIG_REALTIME_ONLY
 1455|      0|    if (flush && oxcf->pass == AOM_RC_FIRST_PASS &&
  ------------------
  |  Branch (1455:9): [True: 0, False: 0]
  |  Branch (1455:18): [True: 0, False: 0]
  ------------------
 1456|      0|        !cpi->ppi->twopass.first_pass_done) {
  ------------------
  |  Branch (1456:9): [True: 0, False: 0]
  ------------------
 1457|      0|      av1_end_first_pass(cpi); /* get last stats packet */
 1458|      0|      cpi->ppi->twopass.first_pass_done = 1;
 1459|      0|    }
 1460|      0|#endif
 1461|      0|    return -1;
 1462|      0|  }
 1463|       |
 1464|       |  // reset src_offset to allow actual encode call for this frame to get its
 1465|       |  // source.
 1466|  73.6k|  gf_group->src_offset[cpi->gf_frame_index] = 0;
 1467|       |
 1468|       |  // Source may be changed if temporal filtered later.
 1469|  73.6k|  frame_input.source = &source->img;
 1470|  73.6k|  if ((cpi->ppi->use_svc || cpi->rc.prev_frame_is_dropped) &&
  ------------------
  |  Branch (1470:8): [True: 0, False: 73.6k]
  |  Branch (1470:29): [True: 0, False: 73.6k]
  ------------------
 1471|      0|      last_source != NULL)
  ------------------
  |  Branch (1471:7): [True: 0, False: 0]
  ------------------
 1472|      0|    av1_svc_set_last_source(cpi, &frame_input, &last_source->img);
 1473|  73.6k|  else
 1474|  73.6k|    frame_input.last_source = last_source != NULL ? &last_source->img : NULL;
  ------------------
  |  Branch (1474:31): [True: 55.2k, False: 18.4k]
  ------------------
 1475|  73.6k|  frame_input.ts_duration = source->ts_end - source->ts_start;
 1476|       |  // Save unfiltered source. It is used in av1_get_second_pass_params().
 1477|  73.6k|  cpi->unfiltered_source = frame_input.source;
 1478|       |
 1479|  73.6k|  *time_stamp = source->ts_start;
 1480|  73.6k|  *time_end = source->ts_end;
 1481|  73.6k|  if (source->ts_start < cpi->time_stamps.first_ts_start) {
  ------------------
  |  Branch (1481:7): [True: 18.4k, False: 55.2k]
  ------------------
 1482|  18.4k|    cpi->time_stamps.first_ts_start = source->ts_start;
 1483|  18.4k|    cpi->time_stamps.prev_ts_end = source->ts_start;
 1484|  18.4k|  }
 1485|       |
 1486|  73.6k|  av1_apply_encoding_flags(cpi, source->flags);
 1487|  73.6k|  *frame_flags = (source->flags & AOM_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0;
  ------------------
  |  |  379|  73.6k|#define AOM_EFLAG_FORCE_KF (1 << 0)
  ------------------
  |  Branch (1487:18): [True: 0, False: 73.6k]
  ------------------
 1488|       |
 1489|       |#if CONFIG_FPMT_TEST
 1490|       |  if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 1491|       |    if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
 1492|       |      cpi->framerate = cpi->temp_framerate;
 1493|       |    }
 1494|       |  }
 1495|       |#endif  // CONFIG_FPMT_TEST
 1496|       |
 1497|       |  // Shown frames and arf-overlay frames need frame-rate considering
 1498|  73.6k|  if (frame_params.show_frame)
  ------------------
  |  Branch (1498:7): [True: 73.6k, False: 0]
  ------------------
 1499|  73.6k|    adjust_frame_rate(cpi, source->ts_start, source->ts_end);
 1500|       |
 1501|  73.6k|  if (!frame_params.show_existing_frame) {
  ------------------
  |  Branch (1501:7): [True: 73.6k, False: 0]
  ------------------
 1502|  73.6k|#if !CONFIG_REALTIME_ONLY
 1503|  73.6k|    if (cpi->film_grain_table) {
  ------------------
  |  Branch (1503:9): [True: 0, False: 73.6k]
  ------------------
 1504|      0|      cm->cur_frame->film_grain_params_present = aom_film_grain_table_lookup(
 1505|      0|          cpi->film_grain_table, *time_stamp, *time_end, 0 /* =erase */,
 1506|      0|          &cm->film_grain_params);
 1507|  73.6k|    } else {
 1508|  73.6k|      cm->cur_frame->film_grain_params_present =
 1509|  73.6k|          cm->seq_params->film_grain_params_present;
 1510|  73.6k|    }
 1511|  73.6k|#endif
 1512|       |    // only one operating point supported now
 1513|  73.6k|    const int64_t pts64 = ticks_to_timebase_units(timestamp_ratio, *time_stamp);
 1514|  73.6k|    if (pts64 < 0 || pts64 > UINT32_MAX) return AOM_CODEC_ERROR;
  ------------------
  |  Branch (1514:9): [True: 0, False: 73.6k]
  |  Branch (1514:22): [True: 0, False: 73.6k]
  ------------------
 1515|       |
 1516|  73.6k|    cm->frame_presentation_time = (uint32_t)pts64;
 1517|  73.6k|  }
 1518|       |
 1519|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1520|       |  start_timing(cpi, av1_get_one_pass_rt_params_time);
 1521|       |#endif
 1522|       |#if CONFIG_REALTIME_ONLY
 1523|       |  av1_get_one_pass_rt_params(cpi, &frame_params.frame_type, &frame_input,
 1524|       |                             *frame_flags);
 1525|       |  if (use_rtc_reference_structure_one_layer(cpi))
 1526|       |    av1_set_rtc_reference_structure_one_layer(cpi, cpi->gf_frame_index == 0);
 1527|       |#else
 1528|  73.6k|  if (use_one_pass_rt_params) {
  ------------------
  |  Branch (1528:7): [True: 24.4k, False: 49.2k]
  ------------------
 1529|  24.4k|    av1_get_one_pass_rt_params(cpi, &frame_params.frame_type, &frame_input,
 1530|  24.4k|                               *frame_flags);
 1531|  24.4k|    if (use_rtc_reference_structure_one_layer(cpi))
  ------------------
  |  Branch (1531:9): [True: 0, False: 24.4k]
  ------------------
 1532|      0|      av1_set_rtc_reference_structure_one_layer(cpi, cpi->gf_frame_index == 0);
 1533|  49.2k|  } else if (is_one_pass_rt_lag_params(cpi) && oxcf->rc_cfg.mode == AOM_CBR) {
  ------------------
  |  Branch (1533:14): [True: 0, False: 49.2k]
  |  Branch (1533:48): [True: 0, False: 0]
  ------------------
 1534|       |    // For realtime mode with lookahead in CBR: the current frame buffer_level
 1535|       |    // is used to update the frame target_bandwidth, so we need to call
 1536|       |    // av1_calc_i/pframe_target_size_one_pass_cbr() here for every frame.
 1537|      0|    int target;
 1538|      0|    const FRAME_UPDATE_TYPE cur_update_type =
 1539|      0|        gf_group->update_type[cpi->gf_frame_index];
 1540|      0|    if (cur_update_type == KF_UPDATE) {
  ------------------
  |  Branch (1540:9): [True: 0, False: 0]
  ------------------
 1541|      0|      target = av1_calc_iframe_target_size_one_pass_cbr(cpi);
 1542|      0|    } else {
 1543|      0|      target = av1_calc_pframe_target_size_one_pass_cbr(cpi, cur_update_type);
 1544|      0|    }
 1545|      0|    gf_group->bit_allocation[cpi->gf_frame_index] = target;
 1546|      0|    av1_rc_set_frame_target(cpi, target, cm->width, cm->height);
 1547|      0|    cpi->rc.base_frame_target = target;
 1548|      0|  }
 1549|  73.6k|#endif
 1550|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1551|       |  end_timing(cpi, av1_get_one_pass_rt_params_time);
 1552|       |#endif
 1553|       |
 1554|  73.6k|  FRAME_UPDATE_TYPE frame_update_type =
 1555|  73.6k|      get_frame_update_type(gf_group, cpi->gf_frame_index);
 1556|       |
 1557|  73.6k|  if (frame_params.show_existing_frame &&
  ------------------
  |  Branch (1557:7): [True: 0, False: 73.6k]
  ------------------
 1558|      0|      frame_params.frame_type != KEY_FRAME) {
  ------------------
  |  Branch (1558:7): [True: 0, False: 0]
  ------------------
 1559|       |    // Force show-existing frames to be INTER, except forward keyframes
 1560|      0|    frame_params.frame_type = INTER_FRAME;
 1561|      0|  }
 1562|       |
 1563|       |  // Per-frame encode speed.  In theory this can vary, but things may have
 1564|       |  // been written assuming speed-level will not change within a sequence, so
 1565|       |  // this parameter should be used with caution.
 1566|  73.6k|  frame_params.speed = oxcf->speed;
 1567|       |
 1568|  73.6k|#if !CONFIG_REALTIME_ONLY
 1569|       |  // Set forced key frames when necessary. For two-pass encoding / lap mode,
 1570|       |  // this is already handled by av1_get_second_pass_params. However when no
 1571|       |  // stats are available, we still need to check if the new frame is a keyframe.
 1572|       |  // For one pass rt, this is already checked in av1_get_one_pass_rt_params.
 1573|  73.6k|  if (!use_one_pass_rt_params &&
  ------------------
  |  Branch (1573:7): [True: 49.2k, False: 24.4k]
  ------------------
 1574|  49.2k|      (is_stat_generation_stage(cpi) || has_no_stats_stage(cpi))) {
  ------------------
  |  Branch (1574:8): [True: 0, False: 49.2k]
  |  Branch (1574:41): [True: 49.2k, False: 0]
  ------------------
 1575|       |    // Current frame is coded as a key-frame for any of the following cases:
 1576|       |    // 1) First frame of a video
 1577|       |    // 2) For all-intra frame encoding
 1578|       |    // 3) When a key-frame is forced
 1579|  49.2k|    const int kf_requested =
 1580|  49.2k|        (cm->current_frame.frame_number == 0 ||
  ------------------
  |  Branch (1580:10): [True: 12.3k, False: 36.9k]
  ------------------
 1581|  36.9k|         oxcf->kf_cfg.key_freq_max == 0 || (*frame_flags & FRAMEFLAGS_KEY));
  ------------------
  |  Branch (1581:10): [True: 0, False: 36.9k]
  |  Branch (1581:44): [True: 0, False: 36.9k]
  ------------------
 1582|  49.2k|    if (kf_requested && frame_update_type != OVERLAY_UPDATE &&
  ------------------
  |  Branch (1582:9): [True: 12.3k, False: 36.9k]
  |  Branch (1582:25): [True: 12.3k, False: 0]
  ------------------
 1583|  12.3k|        frame_update_type != INTNL_OVERLAY_UPDATE) {
  ------------------
  |  Branch (1583:9): [True: 12.3k, False: 0]
  ------------------
 1584|  12.3k|      frame_params.frame_type = KEY_FRAME;
 1585|  36.9k|    } else if (is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1585:16): [True: 0, False: 36.9k]
  ------------------
 1586|       |      // For stats generation, set the frame type to inter here.
 1587|      0|      frame_params.frame_type = INTER_FRAME;
 1588|      0|    }
 1589|  49.2k|  }
 1590|  73.6k|#endif
 1591|       |
 1592|       |  // Work out some encoding parameters specific to the pass:
 1593|  73.6k|  if (has_no_stats_stage(cpi) && oxcf->q_cfg.aq_mode == CYCLIC_REFRESH_AQ) {
  ------------------
  |  Branch (1593:7): [True: 73.6k, False: 0]
  |  Branch (1593:34): [True: 0, False: 73.6k]
  ------------------
 1594|      0|    av1_cyclic_refresh_update_parameters(cpi);
 1595|  73.6k|  } else if (is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1595:14): [True: 0, False: 73.6k]
  ------------------
 1596|      0|    cpi->td.mb.e_mbd.lossless[0] = is_lossless_requested(&oxcf->rc_cfg);
 1597|  73.6k|  } else if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (1597:14): [True: 0, False: 73.6k]
  ------------------
 1598|       |#if CONFIG_MISMATCH_DEBUG
 1599|       |    mismatch_move_frame_idx_w();
 1600|       |#endif
 1601|       |#if TXCOEFF_COST_TIMER
 1602|       |    cm->txcoeff_cost_timer = 0;
 1603|       |    cm->txcoeff_cost_count = 0;
 1604|       |#endif
 1605|      0|  }
 1606|       |
 1607|  73.6k|  if (!is_stat_generation_stage(cpi))
  ------------------
  |  Branch (1607:7): [True: 73.6k, False: 0]
  ------------------
 1608|  73.6k|    set_ext_overrides(cm, &frame_params, ext_flags);
 1609|       |
 1610|       |  // Shown keyframes and S frames refresh all reference buffers
 1611|  73.6k|  const int force_refresh_all =
 1612|  73.6k|      ((frame_params.frame_type == KEY_FRAME && frame_params.show_frame) ||
  ------------------
  |  Branch (1612:9): [True: 18.4k, False: 55.2k]
  |  Branch (1612:49): [True: 18.4k, False: 0]
  ------------------
 1613|  55.2k|       frame_params.frame_type == S_FRAME) &&
  ------------------
  |  Branch (1613:8): [True: 0, False: 55.2k]
  ------------------
 1614|  18.4k|      !frame_params.show_existing_frame;
  ------------------
  |  Branch (1614:7): [True: 18.4k, False: 0]
  ------------------
 1615|       |
 1616|  73.6k|  av1_configure_buffer_updates(
 1617|  73.6k|      cpi, &frame_params.refresh_frame, frame_update_type,
 1618|  73.6k|      gf_group->refbuf_state[cpi->gf_frame_index], force_refresh_all);
 1619|       |
 1620|  73.6k|  if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1620:7): [True: 73.6k, False: 0]
  ------------------
 1621|  73.6k|    const YV12_BUFFER_CONFIG *ref_frame_buf[INTER_REFS_PER_FRAME];
 1622|       |
 1623|  73.6k|    RefFrameMapPair ref_frame_map_pairs[REF_FRAMES];
 1624|  73.6k|    init_ref_map_pair(cpi, ref_frame_map_pairs);
 1625|  73.6k|    const int order_offset = gf_group->arf_src_offset[cpi->gf_frame_index];
 1626|  73.6k|    const int cur_frame_disp =
 1627|  73.6k|        cpi->common.current_frame.frame_number + order_offset;
 1628|       |
 1629|  73.6k|    int get_ref_frames = 0;
 1630|       |#if CONFIG_FPMT_TEST
 1631|       |    get_ref_frames =
 1632|       |        (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 1 : 0;
 1633|       |#endif  // CONFIG_FPMT_TEST
 1634|  73.6k|    if (get_ref_frames ||
  ------------------
  |  Branch (1634:9): [True: 0, False: 73.6k]
  ------------------
 1635|  73.6k|        gf_group->frame_parallel_level[cpi->gf_frame_index] == 0) {
  ------------------
  |  Branch (1635:9): [True: 73.6k, False: 0]
  ------------------
 1636|  73.6k|      if (!ext_flags->refresh_frame.update_pending) {
  ------------------
  |  Branch (1636:11): [True: 18.4k, False: 55.2k]
  ------------------
 1637|  18.4k|        av1_get_ref_frames(ref_frame_map_pairs, cur_frame_disp, cpi,
 1638|  18.4k|                           cpi->gf_frame_index, 1, cm->remapped_ref_idx);
 1639|  55.2k|      } else if (cpi->ppi->rtc_ref.set_ref_frame_config ||
  ------------------
  |  Branch (1639:18): [True: 0, False: 55.2k]
  ------------------
 1640|  55.2k|                 use_rtc_reference_structure_one_layer(cpi)) {
  ------------------
  |  Branch (1640:18): [True: 0, False: 55.2k]
  ------------------
 1641|      0|        for (unsigned int i = 0; i < INTER_REFS_PER_FRAME; i++)
  ------------------
  |  Branch (1641:34): [True: 0, False: 0]
  ------------------
 1642|      0|          cm->remapped_ref_idx[i] = cpi->ppi->rtc_ref.ref_idx[i];
 1643|      0|      }
 1644|  73.6k|    }
 1645|       |
 1646|       |    // Get the reference frames
 1647|  73.6k|    bool has_ref_frames = false;
 1648|   588k|    for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (1648:21): [True: 515k, False: 73.6k]
  ------------------
 1649|   515k|      const RefCntBuffer *ref_frame =
 1650|   515k|          get_ref_frame_buf(cm, ref_frame_priority_order[i]);
 1651|   515k|      ref_frame_buf[i] = ref_frame != NULL ? &ref_frame->buf : NULL;
  ------------------
  |  Branch (1651:26): [True: 386k, False: 128k]
  ------------------
 1652|   515k|      if (ref_frame != NULL) has_ref_frames = true;
  ------------------
  |  Branch (1652:11): [True: 386k, False: 128k]
  ------------------
 1653|   515k|    }
 1654|  73.6k|    if (!has_ref_frames && (frame_params.frame_type == INTER_FRAME ||
  ------------------
  |  Branch (1654:9): [True: 18.4k, False: 55.2k]
  |  Branch (1654:29): [True: 0, False: 18.4k]
  ------------------
 1655|  18.4k|                            frame_params.frame_type == S_FRAME)) {
  ------------------
  |  Branch (1655:29): [True: 0, False: 18.4k]
  ------------------
 1656|      0|      return AOM_CODEC_ERROR;
 1657|      0|    }
 1658|       |
 1659|       |    // Work out which reference frame slots may be used.
 1660|  73.6k|    frame_params.ref_frame_flags =
 1661|  73.6k|        get_ref_frame_flags(&cpi->sf, is_one_pass_rt_params(cpi), ref_frame_buf,
 1662|  73.6k|                            ext_flags->ref_frame_flags);
 1663|       |
 1664|       |    // Set primary_ref_frame of non-reference frames as PRIMARY_REF_NONE.
 1665|  73.6k|    if (cpi->ppi->gf_group.is_frame_non_ref[cpi->gf_frame_index]) {
  ------------------
  |  Branch (1665:9): [True: 0, False: 73.6k]
  ------------------
 1666|      0|      frame_params.primary_ref_frame = PRIMARY_REF_NONE;
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
 1667|  73.6k|    } else {
 1668|  73.6k|      frame_params.primary_ref_frame =
 1669|  73.6k|          choose_primary_ref_frame(cpi, &frame_params);
 1670|  73.6k|    }
 1671|       |
 1672|  73.6k|    frame_params.order_offset = gf_group->arf_src_offset[cpi->gf_frame_index];
 1673|       |
 1674|       |    // Call av1_get_refresh_frame_flags() if refresh index not available.
 1675|  73.6k|    if (!cpi->refresh_idx_available) {
  ------------------
  |  Branch (1675:9): [True: 73.6k, False: 0]
  ------------------
 1676|  73.6k|      frame_params.refresh_frame_flags = av1_get_refresh_frame_flags(
 1677|  73.6k|          cpi, &frame_params, frame_update_type, cpi->gf_frame_index,
 1678|  73.6k|          cur_frame_disp, ref_frame_map_pairs);
 1679|  73.6k|    } else {
 1680|      0|      assert(cpi->ref_refresh_index != INVALID_IDX);
 1681|      0|      frame_params.refresh_frame_flags = (1 << cpi->ref_refresh_index);
 1682|      0|    }
 1683|       |
 1684|       |    // Make the frames marked as is_frame_non_ref to non-reference frames.
 1685|  73.6k|    if (gf_group->is_frame_non_ref[cpi->gf_frame_index])
  ------------------
  |  Branch (1685:9): [True: 0, False: 73.6k]
  ------------------
 1686|      0|      frame_params.refresh_frame_flags = 0;
 1687|       |
 1688|  73.6k|    frame_params.existing_fb_idx_to_show = INVALID_IDX;
  ------------------
  |  |   15|  73.6k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1689|       |    // Find the frame buffer to show based on display order.
 1690|  73.6k|    if (frame_params.show_existing_frame) {
  ------------------
  |  Branch (1690:9): [True: 0, False: 73.6k]
  ------------------
 1691|      0|      for (int frame = 0; frame < REF_FRAMES; frame++) {
  ------------------
  |  Branch (1691:27): [True: 0, False: 0]
  ------------------
 1692|      0|        const RefCntBuffer *const buf = cm->ref_frame_map[frame];
 1693|      0|        if (buf == NULL) continue;
  ------------------
  |  Branch (1693:13): [True: 0, False: 0]
  ------------------
 1694|      0|        const int frame_order = (int)buf->display_order_hint;
 1695|      0|        if (frame_order == cur_frame_disp)
  ------------------
  |  Branch (1695:13): [True: 0, False: 0]
  ------------------
 1696|      0|          frame_params.existing_fb_idx_to_show = frame;
 1697|      0|      }
 1698|      0|    }
 1699|  73.6k|  }
 1700|       |
 1701|       |  // The way frame_params->remapped_ref_idx is setup is a placeholder.
 1702|       |  // Currently, reference buffer assignment is done by update_ref_frame_map()
 1703|       |  // which is called by high-level strategy AFTER encoding a frame.  It
 1704|       |  // modifies cm->remapped_ref_idx.  If you want to use an alternative method
 1705|       |  // to determine reference buffer assignment, just put your assignments into
 1706|       |  // frame_params->remapped_ref_idx here and they will be used when encoding
 1707|       |  // this frame.  If frame_params->remapped_ref_idx is setup independently of
 1708|       |  // cm->remapped_ref_idx then update_ref_frame_map() will have no effect.
 1709|  73.6k|  memcpy(frame_params.remapped_ref_idx, cm->remapped_ref_idx,
 1710|  73.6k|         REF_FRAMES * sizeof(*cm->remapped_ref_idx));
 1711|       |
 1712|  73.6k|  cpi->td.mb.rdmult_delta_qindex = cpi->td.mb.delta_qindex = 0;
 1713|       |
 1714|  73.6k|  if (!frame_params.show_existing_frame) {
  ------------------
  |  Branch (1714:7): [True: 73.6k, False: 0]
  ------------------
 1715|  73.6k|    cm->quant_params.using_qmatrix = oxcf->q_cfg.using_qm;
 1716|  73.6k|  }
 1717|       |
 1718|  73.6k|  const int is_intra_frame = frame_params.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1718:30): [True: 18.4k, False: 55.2k]
  ------------------
 1719|  55.2k|                             frame_params.frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (1719:30): [True: 0, False: 55.2k]
  ------------------
 1720|  73.6k|  FeatureFlags *const features = &cm->features;
 1721|  73.6k|  if (!is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (1721:7): [True: 73.6k, False: 0]
  ------------------
 1722|  73.6k|      (oxcf->pass == AOM_RC_ONE_PASS || oxcf->pass >= AOM_RC_SECOND_PASS) &&
  ------------------
  |  Branch (1722:8): [True: 73.6k, False: 0]
  |  Branch (1722:41): [True: 0, False: 0]
  ------------------
 1723|  73.6k|      is_intra_frame) {
  ------------------
  |  Branch (1723:7): [True: 18.4k, False: 55.2k]
  ------------------
 1724|  18.4k|    av1_set_screen_content_options(cpi, features);
 1725|  18.4k|  }
 1726|       |
 1727|       |#if CONFIG_REALTIME_ONLY
 1728|       |  if (av1_encode(cpi, dest, dest_size, &frame_input, &frame_params,
 1729|       |                 &frame_size) != AOM_CODEC_OK) {
 1730|       |    return AOM_CODEC_ERROR;
 1731|       |  }
 1732|       |#else
 1733|  73.6k|  if (has_no_stats_stage(cpi) && oxcf->mode == REALTIME &&
  ------------------
  |  Branch (1733:7): [True: 73.6k, False: 0]
  |  Branch (1733:34): [True: 24.4k, False: 49.2k]
  ------------------
 1734|  24.4k|      gf_cfg->lag_in_frames == 0) {
  ------------------
  |  Branch (1734:7): [True: 24.4k, False: 0]
  ------------------
 1735|  24.4k|    if (av1_encode(cpi, dest, dest_size, &frame_input, &frame_params,
  ------------------
  |  Branch (1735:9): [True: 0, False: 24.4k]
  ------------------
 1736|  24.4k|                   &frame_size) != AOM_CODEC_OK) {
 1737|      0|      return AOM_CODEC_ERROR;
 1738|      0|    }
 1739|  49.2k|  } else if (denoise_and_encode(cpi, dest, dest_size, &frame_input,
  ------------------
  |  Branch (1739:14): [True: 0, False: 49.2k]
  ------------------
 1740|  49.2k|                                &frame_params, &frame_size) != AOM_CODEC_OK) {
 1741|      0|    return AOM_CODEC_ERROR;
 1742|      0|  }
 1743|  73.6k|#endif  // CONFIG_REALTIME_ONLY
 1744|       |
 1745|       |  // This is used in rtc temporal filter case. Use true source in the PSNR
 1746|       |  // calculation.
 1747|  73.6k|  if (is_psnr_calc_enabled(cpi) && cpi->sf.rt_sf.use_rtc_tf) {
  ------------------
  |  Branch (1747:7): [True: 0, False: 73.6k]
  |  Branch (1747:36): [True: 0, False: 0]
  ------------------
 1748|      0|    assert(cpi->orig_source.buffer_alloc_sz > 0);
 1749|      0|    cpi->source = &cpi->orig_source;
 1750|      0|  }
 1751|       |
 1752|  73.6k|  if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1752:7): [True: 73.6k, False: 0]
  ------------------
 1753|       |    // First pass doesn't modify reference buffer assignment or produce frame
 1754|       |    // flags
 1755|  73.6k|    update_frame_flags(&cpi->common, &cpi->refresh_frame, frame_flags);
 1756|  73.6k|    set_additional_frame_flags(cm, frame_flags);
 1757|  73.6k|  }
 1758|       |
 1759|  73.6k|#if !CONFIG_REALTIME_ONLY
 1760|       |#if TXCOEFF_COST_TIMER
 1761|       |  if (!is_stat_generation_stage(cpi)) {
 1762|       |    cm->cum_txcoeff_cost_timer += cm->txcoeff_cost_timer;
 1763|       |    fprintf(stderr,
 1764|       |            "\ntxb coeff cost block number: %ld, frame time: %ld, cum time %ld "
 1765|       |            "in us\n",
 1766|       |            cm->txcoeff_cost_count, cm->txcoeff_cost_timer,
 1767|       |            cm->cum_txcoeff_cost_timer);
 1768|       |  }
 1769|       |#endif
 1770|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 1771|       |
 1772|       |#if CONFIG_TUNE_VMAF
 1773|       |  if (!is_stat_generation_stage(cpi) &&
 1774|       |      (oxcf->tune_cfg.tuning >= AOM_TUNE_VMAF_WITH_PREPROCESSING &&
 1775|       |       oxcf->tune_cfg.tuning <= AOM_TUNE_VMAF_NEG_MAX_GAIN)) {
 1776|       |    av1_update_vmaf_curve(cpi);
 1777|       |  }
 1778|       |#endif
 1779|       |
 1780|  73.6k|  *size = frame_size;
 1781|       |
 1782|       |  // Leave a signal for a higher level caller about if this frame is droppable
 1783|  73.6k|  if (*size > 0) {
  ------------------
  |  Branch (1783:7): [True: 73.6k, False: 0]
  ------------------
 1784|  73.6k|    cpi->droppable =
 1785|  73.6k|        is_frame_droppable(&cpi->ppi->rtc_ref, &ext_flags->refresh_frame);
 1786|  73.6k|  }
 1787|       |
 1788|       |  // For SVC, or when frame-dropper is enabled:
 1789|       |  // keep track of the (unscaled) source corresponding to the refresh of LAST
 1790|       |  // reference (base temporal layer - TL0). Copy only for the
 1791|       |  // top spatial enhancement layer so all spatial layers of the next
 1792|       |  // superframe have last_source to be aligned with previous TL0 superframe.
 1793|       |  // Avoid cases where resolution changes for unscaled source (top spatial
 1794|       |  // layer). Only needs to be done for frame that are encoded (size > 0).
 1795|  73.6k|  if (*size > 0 &&
  ------------------
  |  Branch (1795:7): [True: 73.6k, False: 0]
  ------------------
 1796|  73.6k|      (cpi->ppi->use_svc || cpi->oxcf.rc_cfg.drop_frames_water_mark > 0) &&
  ------------------
  |  Branch (1796:8): [True: 0, False: 73.6k]
  |  Branch (1796:29): [True: 0, False: 73.6k]
  ------------------
 1797|      0|      cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1 &&
  ------------------
  |  Branch (1797:7): [True: 0, False: 0]
  ------------------
 1798|      0|      cpi->svc.temporal_layer_id == 0 &&
  ------------------
  |  Branch (1798:7): [True: 0, False: 0]
  ------------------
 1799|      0|      cpi->unscaled_source->y_width == cpi->svc.source_last_TL0.y_width &&
  ------------------
  |  Branch (1799:7): [True: 0, False: 0]
  ------------------
 1800|      0|      cpi->unscaled_source->y_height == cpi->svc.source_last_TL0.y_height) {
  ------------------
  |  Branch (1800:7): [True: 0, False: 0]
  ------------------
 1801|      0|    aom_yv12_copy_y(cpi->unscaled_source, &cpi->svc.source_last_TL0, 1);
  ------------------
  |  |   46|      0|#define aom_yv12_copy_y aom_yv12_copy_y_c
  ------------------
 1802|      0|    aom_yv12_copy_u(cpi->unscaled_source, &cpi->svc.source_last_TL0, 1);
  ------------------
  |  |   40|      0|#define aom_yv12_copy_u aom_yv12_copy_u_c
  ------------------
 1803|      0|    aom_yv12_copy_v(cpi->unscaled_source, &cpi->svc.source_last_TL0, 1);
  ------------------
  |  |   43|      0|#define aom_yv12_copy_v aom_yv12_copy_v_c
  ------------------
 1804|      0|  }
 1805|       |
 1806|  73.6k|  return AOM_CODEC_OK;
 1807|  73.6k|}
encode_strategy.c:set_refresh_frame_flags:
   49|   147k|    bool refresh_arf) {
   50|   147k|  refresh_frame->golden_frame = refresh_gf;
   51|   147k|  refresh_frame->bwd_ref_frame = refresh_bwdref;
   52|   147k|  refresh_frame->alt_ref_frame = refresh_arf;
   53|   147k|}
encode_strategy.c:set_unmapped_ref:
  990|  18.4k|                             int cur_frame_disp) {
  991|  18.4k|  int max_dist = 0;
  992|  18.4k|  int unmapped_idx = -1;
  993|  18.4k|  if (n_bufs <= ALTREF_FRAME) return;
  ------------------
  |  Branch (993:7): [True: 18.4k, False: 0]
  ------------------
  994|      0|  for (int i = 0; i < n_bufs; i++) {
  ------------------
  |  Branch (994:19): [True: 0, False: 0]
  ------------------
  995|      0|    if (buffer_map[i].used) continue;
  ------------------
  |  Branch (995:9): [True: 0, False: 0]
  ------------------
  996|      0|    if (buffer_map[i].pyr_level != min_level ||
  ------------------
  |  Branch (996:9): [True: 0, False: 0]
  ------------------
  997|      0|        n_min_level_refs >= LOW_LEVEL_FRAMES_TR) {
  ------------------
  |  |  984|      0|#define LOW_LEVEL_FRAMES_TR 5
  ------------------
  |  Branch (997:9): [True: 0, False: 0]
  ------------------
  998|      0|      int dist = abs(cur_frame_disp - buffer_map[i].disp_order);
  999|      0|      if (dist > max_dist) {
  ------------------
  |  Branch (999:11): [True: 0, False: 0]
  ------------------
 1000|      0|        max_dist = dist;
 1001|      0|        unmapped_idx = i;
 1002|      0|      }
 1003|      0|    }
 1004|      0|  }
 1005|       |  assert(unmapped_idx >= 0 && "Unmapped reference not found");
 1006|      0|  buffer_map[unmapped_idx].used = 1;
 1007|      0|}
encode_strategy.c:allow_show_existing:
  408|  73.6k|                               unsigned int frame_flags) {
  409|  73.6k|  if (cpi->common.current_frame.frame_number == 0) return 0;
  ------------------
  |  Branch (409:7): [True: 18.4k, False: 55.2k]
  ------------------
  410|       |
  411|  55.2k|  const struct lookahead_entry *lookahead_src =
  412|  55.2k|      av1_lookahead_peek(cpi->ppi->lookahead, 0, cpi->compressor_stage);
  413|  55.2k|  if (lookahead_src == NULL) return 1;
  ------------------
  |  Branch (413:7): [True: 0, False: 55.2k]
  ------------------
  414|       |
  415|  55.2k|  const int is_error_resilient =
  416|  55.2k|      cpi->oxcf.tool_cfg.error_resilient_mode ||
  ------------------
  |  Branch (416:7): [True: 0, False: 55.2k]
  ------------------
  417|  55.2k|      (lookahead_src->flags & AOM_EFLAG_ERROR_RESILIENT);
  ------------------
  |  |  155|  55.2k|#define AOM_EFLAG_ERROR_RESILIENT (1 << 28)
  ------------------
  |  Branch (417:7): [True: 0, False: 55.2k]
  ------------------
  418|  55.2k|  const int is_s_frame = cpi->oxcf.kf_cfg.enable_sframe ||
  ------------------
  |  Branch (418:26): [True: 0, False: 55.2k]
  ------------------
  419|  55.2k|                         (lookahead_src->flags & AOM_EFLAG_SET_S_FRAME);
  ------------------
  |  |  161|  55.2k|#define AOM_EFLAG_SET_S_FRAME (1 << 29)
  ------------------
  |  Branch (419:26): [True: 0, False: 55.2k]
  ------------------
  420|  55.2k|  const int is_key_frame =
  421|  55.2k|      (cpi->rc.frames_to_key == 0) || (frame_flags & FRAMEFLAGS_KEY);
  ------------------
  |  Branch (421:7): [True: 0, False: 55.2k]
  |  Branch (421:39): [True: 0, False: 55.2k]
  ------------------
  422|  55.2k|  return !(is_error_resilient || is_s_frame) || is_key_frame;
  ------------------
  |  Branch (422:12): [True: 0, False: 55.2k]
  |  Branch (422:34): [True: 0, False: 55.2k]
  |  Branch (422:49): [True: 0, False: 0]
  ------------------
  423|  55.2k|}
encode_strategy.c:choose_frame_source:
  329|  73.6k|    struct lookahead_entry **last_source, int *const show_frame) {
  330|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  331|  73.6k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  332|  73.6k|  struct lookahead_entry *source = NULL;
  333|       |
  334|       |  // Source index in lookahead buffer.
  335|  73.6k|  int src_index = gf_group->arf_src_offset[cpi->gf_frame_index];
  336|       |
  337|       |  // TODO(Aasaipriya): Forced key frames need to be fixed when rc_mode != AOM_Q
  338|  73.6k|  if (src_index &&
  ------------------
  |  Branch (338:7): [True: 0, False: 73.6k]
  ------------------
  339|      0|      (is_forced_keyframe_pending(cpi->ppi->lookahead, src_index,
  ------------------
  |  Branch (339:7): [True: 0, False: 0]
  ------------------
  340|      0|                                  cpi->compressor_stage) != -1) &&
  341|      0|      cpi->oxcf.rc_cfg.mode != AOM_Q && !is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (341:7): [True: 0, False: 0]
  |  Branch (341:41): [True: 0, False: 0]
  ------------------
  342|      0|    src_index = 0;
  343|      0|    *flush = 1;
  344|      0|  }
  345|       |
  346|       |  // If the current frame is arf, then we should not pop from the lookahead
  347|       |  // buffer. If the current frame is not arf, then pop it. This assumes the
  348|       |  // first frame in the GF group is not arf. May need to change if it is not
  349|       |  // true.
  350|  73.6k|  *pop_lookahead = (src_index == 0);
  351|       |  // If this is a key frame and keyframe filtering is enabled with overlay,
  352|       |  // then do not pop.
  353|  73.6k|  if (*pop_lookahead && cpi->oxcf.kf_cfg.enable_keyframe_filtering > 1 &&
  ------------------
  |  Branch (353:7): [True: 73.6k, False: 0]
  |  Branch (353:25): [True: 0, False: 73.6k]
  ------------------
  354|      0|      gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE &&
  ------------------
  |  Branch (354:7): [True: 0, False: 0]
  ------------------
  355|      0|      !is_stat_generation_stage(cpi) && cpi->ppi->lookahead) {
  ------------------
  |  Branch (355:7): [True: 0, False: 0]
  |  Branch (355:41): [True: 0, False: 0]
  ------------------
  356|      0|    if (cpi->ppi->lookahead->read_ctxs[cpi->compressor_stage].sz &&
  ------------------
  |  Branch (356:9): [True: 0, False: 0]
  ------------------
  357|      0|        (*flush ||
  ------------------
  |  Branch (357:10): [True: 0, False: 0]
  ------------------
  358|      0|         cpi->ppi->lookahead->read_ctxs[cpi->compressor_stage].sz ==
  ------------------
  |  Branch (358:10): [True: 0, False: 0]
  ------------------
  359|      0|             cpi->ppi->lookahead->read_ctxs[cpi->compressor_stage].pop_sz)) {
  360|      0|      *pop_lookahead = 0;
  361|      0|    }
  362|      0|  }
  363|       |
  364|       |  // LAP stage does not have ARFs or forward key-frames,
  365|       |  // hence, always pop_lookahead here.
  366|  73.6k|  if (is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (366:7): [True: 0, False: 73.6k]
  ------------------
  367|      0|    *pop_lookahead = 1;
  368|      0|    src_index = 0;
  369|      0|  }
  370|       |
  371|  73.6k|  *show_frame = *pop_lookahead;
  372|       |
  373|       |#if CONFIG_FPMT_TEST
  374|       |  if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_ENCODE) {
  375|       |#else
  376|  73.6k|  {
  377|  73.6k|#endif  // CONFIG_FPMT_TEST
  378|       |    // Future frame in parallel encode set
  379|  73.6k|    if (gf_group->src_offset[cpi->gf_frame_index] != 0 &&
  ------------------
  |  Branch (379:9): [True: 0, False: 73.6k]
  ------------------
  380|      0|        !is_stat_generation_stage(cpi))
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|      src_index = gf_group->src_offset[cpi->gf_frame_index];
  382|  73.6k|  }
  383|  73.6k|  if (*show_frame) {
  ------------------
  |  Branch (383:7): [True: 73.6k, False: 0]
  ------------------
  384|       |    // show frame, pop from buffer
  385|       |    // Get last frame source.
  386|  73.6k|    if (cm->current_frame.frame_number > 0) {
  ------------------
  |  Branch (386:9): [True: 55.2k, False: 18.4k]
  ------------------
  387|  55.2k|      *last_source = av1_lookahead_peek(cpi->ppi->lookahead, src_index - 1,
  388|  55.2k|                                        cpi->compressor_stage);
  389|  55.2k|    }
  390|       |    // Read in the source frame.
  391|  73.6k|    source = av1_lookahead_peek(cpi->ppi->lookahead, src_index,
  392|  73.6k|                                cpi->compressor_stage);
  393|  73.6k|  } else {
  394|       |    // no show frames are arf frames
  395|      0|    source = av1_lookahead_peek(cpi->ppi->lookahead, src_index,
  396|      0|                                cpi->compressor_stage);
  397|      0|    if (source != NULL) {
  ------------------
  |  Branch (397:9): [True: 0, False: 0]
  ------------------
  398|      0|      cm->showable_frame = 1;
  399|      0|    }
  400|      0|  }
  401|  73.6k|  return source;
  402|  73.6k|}
encode_strategy.c:adjust_frame_rate:
  233|  73.6k|static void adjust_frame_rate(AV1_COMP *cpi, int64_t ts_start, int64_t ts_end) {
  234|  73.6k|  TimeStamps *time_stamps = &cpi->time_stamps;
  235|  73.6k|  int64_t this_duration;
  236|  73.6k|  int step = 0;
  237|       |
  238|       |  // Clear down mmx registers
  239|       |
  240|  73.6k|  if (is_one_pass_rt_params(cpi) ||
  ------------------
  |  Branch (240:7): [True: 24.4k, False: 49.2k]
  ------------------
  241|  49.2k|      (cpi->ppi->use_svc && cpi->ppi->rtc_ref.set_ref_frame_config &&
  ------------------
  |  Branch (241:8): [True: 0, False: 49.2k]
  |  Branch (241:29): [True: 0, False: 0]
  ------------------
  242|  24.4k|       cpi->svc.number_spatial_layers > 1)) {
  ------------------
  |  Branch (242:8): [True: 0, False: 0]
  ------------------
  243|       |    // ts_start is the timestamp for the current frame and ts_end is the
  244|       |    // expected next timestamp given the duration passed into codec_encode().
  245|       |    // See the setting in encoder_encode() in av1_cx_iface.c:
  246|       |    // ts_start = timebase_units_to_ticks(cpi_data.timestamp_ratio, ptsvol),
  247|       |    // ts_end = timebase_units_to_ticks(cpi_data.timestamp_ratio, ptsvol +
  248|       |    // duration). So the difference ts_end - ts_start is the duration passed
  249|       |    // in by the user. For RTC or spatial layers SVC set the framerate based
  250|       |    // directly on the duration, and bypass the adjustments below.
  251|  24.4k|    this_duration = ts_end - ts_start;
  252|  24.4k|    if (this_duration > 0) {
  ------------------
  |  Branch (252:9): [True: 24.4k, False: 0]
  ------------------
  253|  24.4k|      cpi->new_framerate = 10000000.0 / this_duration;
  254|  24.4k|      av1_new_framerate(cpi, cpi->new_framerate);
  255|  24.4k|      time_stamps->prev_ts_start = ts_start;
  256|  24.4k|      time_stamps->prev_ts_end = ts_end;
  257|  24.4k|      return;
  258|  24.4k|    }
  259|  24.4k|  }
  260|       |
  261|  49.2k|  if (ts_start == time_stamps->first_ts_start) {
  ------------------
  |  Branch (261:7): [True: 49.2k, False: 0]
  ------------------
  262|  49.2k|    this_duration = ts_end - ts_start;
  263|  49.2k|    step = 1;
  264|  49.2k|  } else {
  265|      0|    int64_t last_duration =
  266|      0|        time_stamps->prev_ts_end - time_stamps->prev_ts_start;
  267|       |
  268|      0|    this_duration = ts_end - time_stamps->prev_ts_end;
  269|       |
  270|       |    // do a step update if the duration changes by 10%
  271|      0|    if (last_duration)
  ------------------
  |  Branch (271:9): [True: 0, False: 0]
  ------------------
  272|      0|      step = (int)((this_duration - last_duration) * 10 / last_duration);
  273|      0|  }
  274|       |
  275|  49.2k|  if (this_duration) {
  ------------------
  |  Branch (275:7): [True: 49.2k, False: 0]
  ------------------
  276|  49.2k|    if (step) {
  ------------------
  |  Branch (276:9): [True: 49.2k, False: 0]
  ------------------
  277|  49.2k|      cpi->new_framerate = 10000000.0 / this_duration;
  278|  49.2k|      av1_new_framerate(cpi, cpi->new_framerate);
  279|  49.2k|    } else {
  280|       |      // Average this frame's rate into the last second's average
  281|       |      // frame rate. If we haven't seen 1 second yet, then average
  282|       |      // over the whole interval seen.
  283|      0|      const double interval =
  284|      0|          AOMMIN((double)(ts_end - time_stamps->first_ts_start), 10000000.0);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  285|      0|      double avg_duration = 10000000.0 / cpi->framerate;
  286|      0|      avg_duration *= (interval - avg_duration + this_duration);
  287|      0|      avg_duration /= interval;
  288|      0|      cpi->new_framerate = (10000000.0 / avg_duration);
  289|       |      // For parallel frames update cpi->framerate with new_framerate
  290|       |      // during av1_post_encode_updates()
  291|      0|      double framerate =
  292|      0|          (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (292:11): [True: 0, False: 0]
  ------------------
  293|      0|              ? cpi->framerate
  294|      0|              : cpi->new_framerate;
  295|      0|      av1_new_framerate(cpi, framerate);
  296|      0|    }
  297|  49.2k|  }
  298|       |
  299|  49.2k|  time_stamps->prev_ts_start = ts_start;
  300|  49.2k|  time_stamps->prev_ts_end = ts_end;
  301|  49.2k|}
encode_strategy.c:set_ext_overrides:
  143|  73.6k|                              ExternalFlags *const ext_flags) {
  144|       |  // Overrides the defaults with the externally supplied values with
  145|       |  // av1_update_reference() and av1_update_entropy() calls
  146|       |  // Note: The overrides are valid only for the next frame passed
  147|       |  // to av1_encode_lowlevel()
  148|       |
  149|  73.6k|  if (ext_flags->use_s_frame) {
  ------------------
  |  Branch (149:7): [True: 0, False: 73.6k]
  ------------------
  150|      0|    frame_params->frame_type = S_FRAME;
  151|      0|  }
  152|       |
  153|  73.6k|  if (ext_flags->refresh_frame_context_pending) {
  ------------------
  |  Branch (153:7): [True: 0, False: 73.6k]
  ------------------
  154|      0|    cm->features.refresh_frame_context = ext_flags->refresh_frame_context;
  155|      0|    ext_flags->refresh_frame_context_pending = 0;
  156|      0|  }
  157|  73.6k|  cm->features.allow_ref_frame_mvs = ext_flags->use_ref_frame_mvs;
  158|       |
  159|  73.6k|  frame_params->error_resilient_mode = ext_flags->use_error_resilient;
  160|       |  // A keyframe is already error resilient and keyframes with
  161|       |  // error_resilient_mode interferes with the use of show_existing_frame
  162|       |  // when forward reference keyframes are enabled.
  163|  73.6k|  frame_params->error_resilient_mode &= frame_params->frame_type != KEY_FRAME;
  164|       |  // For bitstream conformance, s-frames must be error-resilient
  165|  73.6k|  frame_params->error_resilient_mode |= frame_params->frame_type == S_FRAME;
  166|  73.6k|}
encode_strategy.c:choose_primary_ref_frame:
  169|  73.6k|    AV1_COMP *const cpi, const EncodeFrameParams *const frame_params) {
  170|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
  171|       |
  172|  73.6k|  const int intra_only = frame_params->frame_type == KEY_FRAME ||
  ------------------
  |  Branch (172:26): [True: 18.4k, False: 55.2k]
  ------------------
  173|  55.2k|                         frame_params->frame_type == INTRA_ONLY_FRAME;
  ------------------
  |  Branch (173:26): [True: 0, False: 55.2k]
  ------------------
  174|  73.6k|  if (intra_only || frame_params->error_resilient_mode ||
  ------------------
  |  Branch (174:7): [True: 18.4k, False: 55.2k]
  |  Branch (174:21): [True: 0, False: 55.2k]
  ------------------
  175|  55.2k|      cpi->ext_flags.use_primary_ref_none) {
  ------------------
  |  Branch (175:7): [True: 0, False: 55.2k]
  ------------------
  176|  18.4k|    return PRIMARY_REF_NONE;
  ------------------
  |  |   66|  18.4k|#define PRIMARY_REF_NONE 7
  ------------------
  177|  18.4k|  }
  178|       |
  179|  55.2k|#if !CONFIG_REALTIME_ONLY
  180|  55.2k|  if (cpi->use_ducky_encode) {
  ------------------
  |  Branch (180:7): [True: 0, False: 55.2k]
  ------------------
  181|      0|    int wanted_fb = cpi->ppi->gf_group.primary_ref_idx[cpi->gf_frame_index];
  182|      0|    for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
  ------------------
  |  Branch (182:38): [True: 0, False: 0]
  ------------------
  183|      0|      if (get_ref_frame_map_idx(cm, ref_frame) == wanted_fb)
  ------------------
  |  Branch (183:11): [True: 0, False: 0]
  ------------------
  184|      0|        return ref_frame - LAST_FRAME;
  185|      0|    }
  186|       |
  187|      0|    return PRIMARY_REF_NONE;
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
  188|      0|  }
  189|  55.2k|#endif  // !CONFIG_REALTIME_ONLY
  190|       |
  191|       |  // In large scale case, always use Last frame's frame contexts.
  192|       |  // Note(yunqing): In other cases, primary_ref_frame is chosen based on
  193|       |  // cpi->ppi->gf_group.layer_depth[cpi->gf_frame_index], which also controls
  194|       |  // frame bit allocation.
  195|  55.2k|  if (cm->tiles.large_scale) return (LAST_FRAME - LAST_FRAME);
  ------------------
  |  Branch (195:7): [True: 0, False: 55.2k]
  ------------------
  196|       |
  197|  55.2k|  if (cpi->ppi->use_svc || cpi->ppi->rtc_ref.set_ref_frame_config)
  ------------------
  |  Branch (197:7): [True: 0, False: 55.2k]
  |  Branch (197:28): [True: 0, False: 55.2k]
  ------------------
  198|      0|    return av1_svc_primary_ref_frame(cpi);
  199|       |
  200|       |  // Find the most recent reference frame with the same reference type as the
  201|       |  // current frame
  202|  55.2k|  const int current_ref_type = get_current_frame_ref_type(cpi);
  203|  55.2k|  int wanted_fb = cpi->ppi->fb_of_context_type[current_ref_type];
  204|       |#if CONFIG_FPMT_TEST
  205|       |  if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
  206|       |    GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  207|       |    if (gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE) {
  208|       |      int frame_level = gf_group->frame_parallel_level[cpi->gf_frame_index];
  209|       |      // Book keep wanted_fb of frame_parallel_level 1 frame in an FP2 set.
  210|       |      if (frame_level == 1) {
  211|       |        cpi->wanted_fb = wanted_fb;
  212|       |      }
  213|       |      // Use the wanted_fb of level 1 frame in an FP2 for a level 2 frame in the
  214|       |      // set.
  215|       |      if (frame_level == 2 &&
  216|       |          gf_group->update_type[cpi->gf_frame_index - 1] == INTNL_ARF_UPDATE) {
  217|       |        assert(gf_group->frame_parallel_level[cpi->gf_frame_index - 1] == 1);
  218|       |        wanted_fb = cpi->wanted_fb;
  219|       |      }
  220|       |    }
  221|       |  }
  222|       |#endif  // CONFIG_FPMT_TEST
  223|  55.2k|  int primary_ref_frame = PRIMARY_REF_NONE;
  ------------------
  |  |   66|  55.2k|#define PRIMARY_REF_NONE 7
  ------------------
  224|   441k|  for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
  ------------------
  |  Branch (224:36): [True: 386k, False: 55.2k]
  ------------------
  225|   386k|    if (get_ref_frame_map_idx(cm, ref_frame) == wanted_fb) {
  ------------------
  |  Branch (225:9): [True: 214k, False: 172k]
  ------------------
  226|   214k|      primary_ref_frame = ref_frame - LAST_FRAME;
  227|   214k|    }
  228|   386k|  }
  229|       |
  230|  55.2k|  return primary_ref_frame;
  231|  55.2k|}
encode_strategy.c:denoise_and_encode:
  732|  49.2k|                              size_t *const frame_size) {
  733|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  734|       |  if (cpi->oxcf.pass == 2) start_timing(cpi, denoise_and_encode_time);
  735|       |#endif
  736|  49.2k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
  737|  49.2k|  AV1_COMMON *const cm = &cpi->common;
  738|       |
  739|  49.2k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  740|  49.2k|  FRAME_UPDATE_TYPE update_type =
  741|  49.2k|      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
  742|  49.2k|  const int is_second_arf =
  743|  49.2k|      av1_gop_is_second_arf(gf_group, cpi->gf_frame_index);
  744|       |
  745|       |  // Decide whether to apply temporal filtering to the source frame.
  746|  49.2k|  int apply_filtering =
  747|  49.2k|      av1_is_temporal_filter_on(oxcf) && !is_stat_generation_stage(cpi);
  ------------------
  |  Branch (747:7): [True: 0, False: 49.2k]
  |  Branch (747:42): [True: 0, False: 0]
  ------------------
  748|  49.2k|  if (update_type != KF_UPDATE && update_type != ARF_UPDATE && !is_second_arf) {
  ------------------
  |  Branch (748:7): [True: 36.9k, False: 12.3k]
  |  Branch (748:35): [True: 36.9k, False: 0]
  |  Branch (748:64): [True: 36.9k, False: 0]
  ------------------
  749|  36.9k|    apply_filtering = 0;
  750|  36.9k|  }
  751|  49.2k|  if (apply_filtering) {
  ------------------
  |  Branch (751:7): [True: 0, False: 49.2k]
  ------------------
  752|      0|    if (frame_params->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (752:9): [True: 0, False: 0]
  ------------------
  753|       |      // TODO(angiebird): Move the noise level check to av1_tf_info_filtering.
  754|       |      // Decide whether it is allowed to perform key frame filtering
  755|      0|      int allow_kf_filtering = oxcf->kf_cfg.enable_keyframe_filtering &&
  ------------------
  |  Branch (755:32): [True: 0, False: 0]
  ------------------
  756|      0|                               !frame_params->show_existing_frame &&
  ------------------
  |  Branch (756:32): [True: 0, False: 0]
  ------------------
  757|      0|                               !is_lossless_requested(&oxcf->rc_cfg);
  ------------------
  |  Branch (757:32): [True: 0, False: 0]
  ------------------
  758|      0|      if (allow_kf_filtering) {
  ------------------
  |  Branch (758:11): [True: 0, False: 0]
  ------------------
  759|      0|        double y_noise_level = 0.0;
  760|      0|        av1_estimate_noise_level(
  761|      0|            frame_input->source, &y_noise_level, AOM_PLANE_Y, AOM_PLANE_Y,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                          frame_input->source, &y_noise_level, AOM_PLANE_Y, AOM_PLANE_Y,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  762|      0|            cm->seq_params->bit_depth, NOISE_ESTIMATION_EDGE_THRESHOLD);
  ------------------
  |  |   87|      0|#define NOISE_ESTIMATION_EDGE_THRESHOLD 50
  ------------------
  763|      0|        apply_filtering = y_noise_level > 0;
  764|      0|      } else {
  765|      0|        apply_filtering = 0;
  766|      0|      }
  767|       |      // If we are doing kf filtering, set up a few things.
  768|      0|      if (apply_filtering) {
  ------------------
  |  Branch (768:11): [True: 0, False: 0]
  ------------------
  769|      0|        av1_setup_past_independence(cm);
  770|      0|      }
  771|      0|    } else if (is_second_arf) {
  ------------------
  |  Branch (771:16): [True: 0, False: 0]
  ------------------
  772|      0|      apply_filtering = cpi->sf.hl_sf.second_alt_ref_filtering;
  773|      0|    }
  774|      0|  }
  775|       |
  776|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  777|       |  if (cpi->oxcf.pass == 2) start_timing(cpi, apply_filtering_time);
  778|       |#endif
  779|       |  // Save the pointer to the original source image.
  780|  49.2k|  YV12_BUFFER_CONFIG *source_buffer = frame_input->source;
  781|       |
  782|       |  // Set cm->current_frame.frame_type and cpi->rc.this_frame_target
  783|       |  // so that the call to av1_rc_pick_q_and_bounds() below returns the
  784|       |  // correct q_index.
  785|  49.2k|  cm->current_frame.frame_type = frame_params->frame_type;
  786|  49.2k|  av1_set_frame_size(cpi, cm->width, cm->height);
  787|       |
  788|       |  // apply filtering to frame
  789|  49.2k|  if (apply_filtering) {
  ------------------
  |  Branch (789:7): [True: 0, False: 49.2k]
  ------------------
  790|      0|    int show_existing_alt_ref = 0;
  791|      0|    FRAME_DIFF frame_diff;
  792|      0|    int top_index = 0;
  793|      0|    int bottom_index = 0;
  794|      0|    const int q_index = av1_rc_pick_q_and_bounds(
  795|      0|        cpi, cpi->oxcf.frm_dim_cfg.width, cpi->oxcf.frm_dim_cfg.height,
  796|      0|        cpi->gf_frame_index, &bottom_index, &top_index);
  797|       |
  798|      0|    if (update_type == KF_UPDATE || update_type == ARF_UPDATE) {
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  |  Branch (798:37): [True: 0, False: 0]
  ------------------
  799|      0|      YV12_BUFFER_CONFIG *tf_buf = av1_tf_info_get_filtered_buf(
  800|      0|          &cpi->ppi->tf_info, cpi->gf_frame_index, &frame_diff);
  801|      0|      if (tf_buf != NULL) {
  ------------------
  |  Branch (801:11): [True: 0, False: 0]
  ------------------
  802|      0|        frame_input->source = tf_buf;
  803|      0|        show_existing_alt_ref = av1_check_show_filtered_frame(
  804|      0|            tf_buf, &frame_diff, q_index, cm->seq_params->bit_depth,
  805|      0|            cpi->oxcf.algo_cfg.enable_overlay, 0);
  806|      0|        if (show_existing_alt_ref) {
  ------------------
  |  Branch (806:13): [True: 0, False: 0]
  ------------------
  807|      0|          cpi->common.showable_frame |= 1;
  808|      0|        } else {
  809|      0|          cpi->common.showable_frame = 0;
  810|      0|        }
  811|      0|      }
  812|      0|      if (gf_group->frame_type[cpi->gf_frame_index] != KEY_FRAME) {
  ------------------
  |  Branch (812:11): [True: 0, False: 0]
  ------------------
  813|      0|        cpi->ppi->show_existing_alt_ref = show_existing_alt_ref;
  814|      0|      }
  815|      0|    }
  816|       |
  817|      0|    if (is_second_arf) {
  ------------------
  |  Branch (817:9): [True: 0, False: 0]
  ------------------
  818|       |      // Allocate the memory for tf_buf_second_arf buffer, only when it is
  819|       |      // required.
  820|      0|      int ret = aom_realloc_frame_buffer(
  821|      0|          &cpi->ppi->tf_info.tf_buf_second_arf, oxcf->frm_dim_cfg.width,
  822|      0|          oxcf->frm_dim_cfg.height, cm->seq_params->subsampling_x,
  823|      0|          cm->seq_params->subsampling_y, cm->seq_params->use_highbitdepth,
  824|      0|          cpi->oxcf.border_in_pixels, cm->features.byte_alignment, NULL, NULL,
  825|      0|          NULL, cpi->alloc_pyramid, 0);
  826|      0|      if (ret)
  ------------------
  |  Branch (826:11): [True: 0, False: 0]
  ------------------
  827|      0|        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  828|      0|                           "Failed to allocate tf_buf_second_arf");
  829|       |
  830|      0|      YV12_BUFFER_CONFIG *tf_buf_second_arf =
  831|      0|          &cpi->ppi->tf_info.tf_buf_second_arf;
  832|       |      // We didn't apply temporal filtering for second arf ahead in
  833|       |      // av1_tf_info_filtering().
  834|      0|      const int arf_src_index = gf_group->arf_src_offset[cpi->gf_frame_index];
  835|       |      // Right now, we are still using tf_buf_second_arf due to
  836|       |      // implementation complexity.
  837|       |      // TODO(angiebird): Reuse tf_info->tf_buf here.
  838|      0|      av1_temporal_filter(cpi, arf_src_index, cpi->gf_frame_index, &frame_diff,
  839|      0|                          tf_buf_second_arf);
  840|      0|      show_existing_alt_ref =
  841|      0|          av1_check_show_filtered_frame(tf_buf_second_arf, &frame_diff, q_index,
  842|      0|                                        cm->seq_params->bit_depth, 1, 1);
  843|      0|      if (show_existing_alt_ref) {
  ------------------
  |  Branch (843:11): [True: 0, False: 0]
  ------------------
  844|      0|        aom_extend_frame_borders(tf_buf_second_arf, av1_num_planes(cm));
  ------------------
  |  |   31|      0|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
  845|      0|        frame_input->source = tf_buf_second_arf;
  846|      0|      }
  847|       |      // Currently INTNL_ARF_UPDATE only do show_existing.
  848|      0|      cpi->common.showable_frame |= 1;
  849|      0|    }
  850|       |
  851|       |    // Copy source metadata to the temporal filtered frame
  852|      0|    if (source_buffer->metadata &&
  ------------------
  |  Branch (852:9): [True: 0, False: 0]
  ------------------
  853|      0|        aom_copy_metadata_to_frame_buffer(frame_input->source,
  ------------------
  |  Branch (853:9): [True: 0, False: 0]
  ------------------
  854|      0|                                          source_buffer->metadata)) {
  855|      0|      aom_internal_error(
  856|      0|          cm->error, AOM_CODEC_MEM_ERROR,
  857|      0|          "Failed to copy source metadata to the temporal filtered frame");
  858|      0|    }
  859|      0|  }
  860|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  861|       |  if (cpi->oxcf.pass == 2) end_timing(cpi, apply_filtering_time);
  862|       |#endif
  863|       |
  864|  49.2k|  int set_mv_params = frame_params->frame_type == KEY_FRAME ||
  ------------------
  |  Branch (864:23): [True: 12.3k, False: 36.9k]
  ------------------
  865|  36.9k|                      update_type == ARF_UPDATE || update_type == GF_UPDATE;
  ------------------
  |  Branch (865:23): [True: 0, False: 36.9k]
  |  Branch (865:52): [True: 0, False: 36.9k]
  ------------------
  866|  49.2k|  cm->show_frame = frame_params->show_frame;
  867|  49.2k|  if (set_mv_params) av1_set_mv_search_params(cpi);
  ------------------
  |  Branch (867:7): [True: 12.3k, False: 36.9k]
  ------------------
  868|       |
  869|       |#if CONFIG_RD_COMMAND
  870|       |  if (frame_params->frame_type == KEY_FRAME) {
  871|       |    char filepath[] = "rd_command.txt";
  872|       |    av1_read_rd_command(filepath, &cpi->rd_command);
  873|       |  }
  874|       |#endif  // CONFIG_RD_COMMAND
  875|  49.2k|  if (cpi->gf_frame_index == 0 && !is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (875:7): [True: 12.3k, False: 36.9k]
  |  Branch (875:35): [True: 12.3k, False: 0]
  ------------------
  876|       |    // perform tpl after filtering
  877|  12.3k|    int allow_tpl =
  878|  12.3k|        oxcf->gf_cfg.lag_in_frames > 1 && oxcf->algo_cfg.enable_tpl_model;
  ------------------
  |  Branch (878:9): [True: 0, False: 12.3k]
  |  Branch (878:43): [True: 0, False: 0]
  ------------------
  879|  12.3k|    if (gf_group->size > MAX_LENGTH_TPL_FRAME_STATS) {
  ------------------
  |  |  104|  12.3k|#define MAX_LENGTH_TPL_FRAME_STATS (MAX_TPL_FRAME_IDX + REF_FRAMES + 1)
  |  |  ------------------
  |  |  |  |  101|  12.3k|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  12.3k|#define MAX_LAG_BUFFERS 48
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (879:9): [True: 0, False: 12.3k]
  ------------------
  880|      0|      allow_tpl = 0;
  881|      0|    }
  882|  12.3k|    if (frame_params->frame_type != KEY_FRAME) {
  ------------------
  |  Branch (882:9): [True: 0, False: 12.3k]
  ------------------
  883|       |      // In rare case, it's possible to have non ARF/GF update_type here.
  884|       |      // We should set allow_tpl to zero in the situation
  885|      0|      bool frame_type_allow_tpl =
  886|      0|          update_type == ARF_UPDATE || update_type == GF_UPDATE;
  ------------------
  |  Branch (886:11): [True: 0, False: 0]
  |  Branch (886:40): [True: 0, False: 0]
  ------------------
  887|       |      // When external rate control is used, sometimes the sequence ends with
  888|       |      // a GOP with only 1 frame which is a leaf frame. TPL stats needs to be
  889|       |      // calculated for it as well.
  890|      0|      if (av1_use_tpl_for_extrc(&cpi->ext_ratectrl)) {
  ------------------
  |  Branch (890:11): [True: 0, False: 0]
  ------------------
  891|      0|        frame_type_allow_tpl |= update_type == LF_UPDATE;
  892|      0|      }
  893|      0|      allow_tpl = allow_tpl && (frame_type_allow_tpl ||
  ------------------
  |  Branch (893:19): [True: 0, False: 0]
  |  Branch (893:33): [True: 0, False: 0]
  ------------------
  894|      0|                                (cpi->use_ducky_encode &&
  ------------------
  |  Branch (894:34): [True: 0, False: 0]
  ------------------
  895|      0|                                 cpi->ducky_encode_info.frame_info.gop_mode ==
  ------------------
  |  Branch (895:34): [True: 0, False: 0]
  ------------------
  896|      0|                                     DUCKY_ENCODE_GOP_MODE_RCL));
  897|      0|    }
  898|       |
  899|  12.3k|    if (allow_tpl) {
  ------------------
  |  Branch (899:9): [True: 0, False: 12.3k]
  ------------------
  900|      0|      if (!cpi->skip_tpl_setup_stats) {
  ------------------
  |  Branch (900:11): [True: 0, False: 0]
  ------------------
  901|      0|        av1_tpl_preload_rc_estimate(cpi, frame_params);
  902|      0|        av1_tpl_setup_stats(cpi, 0, frame_params);
  903|       |#if CONFIG_BITRATE_ACCURACY && !CONFIG_THREE_PASS
  904|       |        assert(cpi->gf_frame_index == 0);
  905|       |        av1_vbr_rc_update_q_index_list(&cpi->vbr_rc_info, &cpi->ppi->tpl_data,
  906|       |                                       gf_group, cm->seq_params->bit_depth);
  907|       |#endif
  908|      0|      }
  909|  12.3k|    } else {
  910|  12.3k|      av1_init_tpl_stats(&cpi->ppi->tpl_data);
  911|  12.3k|    }
  912|       |#if CONFIG_BITRATE_ACCURACY && CONFIG_THREE_PASS
  913|       |    if (cpi->oxcf.pass == AOM_RC_SECOND_PASS &&
  914|       |        cpi->second_pass_log_stream != NULL) {
  915|       |      TPL_INFO *tpl_info;
  916|       |      AOM_CHECK_MEM_ERROR(cm->error, tpl_info, aom_malloc(sizeof(*tpl_info)));
  917|       |      av1_pack_tpl_info(tpl_info, gf_group, &cpi->ppi->tpl_data);
  918|       |      av1_write_tpl_info(tpl_info, cpi->second_pass_log_stream,
  919|       |                         cpi->common.error);
  920|       |      aom_free(tpl_info);
  921|       |    }
  922|       |#endif  // CONFIG_BITRATE_ACCURACY && CONFIG_THREE_PASS
  923|  12.3k|  }
  924|       |
  925|  49.2k|  if (av1_encode(cpi, dest, dest_size, frame_input, frame_params, frame_size) !=
  ------------------
  |  Branch (925:7): [True: 0, False: 49.2k]
  ------------------
  926|  49.2k|      AOM_CODEC_OK) {
  927|      0|    return AOM_CODEC_ERROR;
  928|      0|  }
  929|       |
  930|       |  // Set frame_input source to true source for psnr calculation.
  931|  49.2k|  if (apply_filtering && is_psnr_calc_enabled(cpi)) {
  ------------------
  |  Branch (931:7): [True: 0, False: 49.2k]
  |  Branch (931:26): [True: 0, False: 0]
  ------------------
  932|      0|    cpi->source = av1_realloc_and_scale_if_required(
  933|      0|        cm, source_buffer, &cpi->scaled_source, cm->features.interp_filter, 0,
  934|      0|        false, true, cpi->oxcf.border_in_pixels, cpi->alloc_pyramid);
  935|      0|    cpi->unscaled_source = source_buffer;
  936|      0|  }
  937|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  938|       |  if (cpi->oxcf.pass == 2) end_timing(cpi, denoise_and_encode_time);
  939|       |#endif
  940|  49.2k|  return AOM_CODEC_OK;
  941|  49.2k|}
encode_strategy.c:update_frame_flags:
  429|  73.6k|                               unsigned int *frame_flags) {
  430|  73.6k|  if (encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (430:7): [True: 0, False: 73.6k]
  ------------------
  431|      0|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_GOLDEN;
  432|      0|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_BWDREF;
  433|      0|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_ALTREF;
  434|      0|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_KEY;
  435|      0|    return;
  436|      0|  }
  437|       |
  438|  73.6k|  if (refresh_frame->golden_frame) {
  ------------------
  |  Branch (438:7): [True: 18.4k, False: 55.2k]
  ------------------
  439|  18.4k|    *frame_flags |= FRAMEFLAGS_GOLDEN;
  440|  55.2k|  } else {
  441|  55.2k|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_GOLDEN;
  442|  55.2k|  }
  443|       |
  444|  73.6k|  if (refresh_frame->alt_ref_frame) {
  ------------------
  |  Branch (444:7): [True: 18.4k, False: 55.2k]
  ------------------
  445|  18.4k|    *frame_flags |= FRAMEFLAGS_ALTREF;
  446|  55.2k|  } else {
  447|  55.2k|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_ALTREF;
  448|  55.2k|  }
  449|       |
  450|  73.6k|  if (refresh_frame->bwd_ref_frame) {
  ------------------
  |  Branch (450:7): [True: 18.4k, False: 55.2k]
  ------------------
  451|  18.4k|    *frame_flags |= FRAMEFLAGS_BWDREF;
  452|  55.2k|  } else {
  453|  55.2k|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_BWDREF;
  454|  55.2k|  }
  455|       |
  456|  73.6k|  if (cm->current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (456:7): [True: 18.4k, False: 55.2k]
  ------------------
  457|  18.4k|    *frame_flags |= FRAMEFLAGS_KEY;
  458|  55.2k|  } else {
  459|  55.2k|    *frame_flags &= ~(uint32_t)FRAMEFLAGS_KEY;
  460|  55.2k|  }
  461|  73.6k|}
encode_strategy.c:set_additional_frame_flags:
  129|  73.6k|                                       unsigned int *const frame_flags) {
  130|  73.6k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (130:7): [True: 18.4k, False: 55.2k]
  ------------------
  131|  18.4k|    *frame_flags |= FRAMEFLAGS_INTRAONLY;
  132|  18.4k|  }
  133|  73.6k|  if (frame_is_sframe(cm)) {
  ------------------
  |  Branch (133:7): [True: 0, False: 73.6k]
  ------------------
  134|      0|    *frame_flags |= FRAMEFLAGS_SWITCH;
  135|      0|  }
  136|  73.6k|  if (cm->features.error_resilient_mode) {
  ------------------
  |  Branch (136:7): [True: 0, False: 73.6k]
  ------------------
  137|      0|    *frame_flags |= FRAMEFLAGS_ERROR_RESILIENT;
  138|      0|  }
  139|  73.6k|}

encoder.c:get_current_frame_ref_type:
  116|  73.6k|static inline int get_current_frame_ref_type(const AV1_COMP *const cpi) {
  117|       |  // We choose the reference "type" of this frame from the flags which indicate
  118|       |  // which reference frames will be refreshed by it. More than one of these
  119|       |  // flags may be set, so the order here implies an order of precedence. This is
  120|       |  // just used to choose the primary_ref_frame (as the most recent reference
  121|       |  // buffer of the same reference-type as the current frame).
  122|       |
  123|  73.6k|  switch (cpi->ppi->gf_group.layer_depth[cpi->gf_frame_index]) {
  124|  36.7k|    case 0: return 0;
  ------------------
  |  Branch (124:5): [True: 36.7k, False: 36.9k]
  ------------------
  125|  12.3k|    case 1: return 1;
  ------------------
  |  Branch (125:5): [True: 12.3k, False: 61.3k]
  ------------------
  126|      0|    case MAX_ARF_LAYERS:
  ------------------
  |  |   54|      0|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (126:5): [True: 0, False: 73.6k]
  ------------------
  127|      0|    case MAX_ARF_LAYERS + 1: return 4;
  ------------------
  |  |   54|      0|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (127:5): [True: 0, False: 73.6k]
  ------------------
  128|  24.6k|    default: return 7;
  ------------------
  |  Branch (128:5): [True: 24.6k, False: 49.0k]
  ------------------
  129|  73.6k|  }
  130|  73.6k|}
encode_strategy.c:is_frame_droppable:
  101|   128k|    const ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags) {
  102|       |  // Droppable frame is only used by external refresh flags. VoD setting won't
  103|       |  // trigger its use case.
  104|   128k|  if (rtc_ref->set_ref_frame_config)
  ------------------
  |  Branch (104:7): [True: 0, False: 128k]
  ------------------
  105|      0|    return rtc_ref->non_reference_frame;
  106|   128k|  else if (ext_refresh_frame_flags->update_pending)
  ------------------
  |  Branch (106:12): [True: 110k, False: 18.4k]
  ------------------
  107|   110k|    return !(ext_refresh_frame_flags->alt_ref_frame ||
  ------------------
  |  Branch (107:14): [True: 0, False: 110k]
  ------------------
  108|   110k|             ext_refresh_frame_flags->alt2_ref_frame ||
  ------------------
  |  Branch (108:14): [True: 0, False: 110k]
  ------------------
  109|   110k|             ext_refresh_frame_flags->bwd_ref_frame ||
  ------------------
  |  Branch (109:14): [True: 0, False: 110k]
  ------------------
  110|   110k|             ext_refresh_frame_flags->golden_frame ||
  ------------------
  |  Branch (110:14): [True: 0, False: 110k]
  ------------------
  111|   110k|             ext_refresh_frame_flags->last_frame);
  ------------------
  |  Branch (111:14): [True: 110k, False: 0]
  ------------------
  112|  18.4k|  else
  113|  18.4k|    return 0;
  114|   128k|}
encode_strategy.c:get_current_frame_ref_type:
  116|  55.2k|static inline int get_current_frame_ref_type(const AV1_COMP *const cpi) {
  117|       |  // We choose the reference "type" of this frame from the flags which indicate
  118|       |  // which reference frames will be refreshed by it. More than one of these
  119|       |  // flags may be set, so the order here implies an order of precedence. This is
  120|       |  // just used to choose the primary_ref_frame (as the most recent reference
  121|       |  // buffer of the same reference-type as the current frame).
  122|       |
  123|  55.2k|  switch (cpi->ppi->gf_group.layer_depth[cpi->gf_frame_index]) {
  124|  18.3k|    case 0: return 0;
  ------------------
  |  Branch (124:5): [True: 18.3k, False: 36.9k]
  ------------------
  125|  12.3k|    case 1: return 1;
  ------------------
  |  Branch (125:5): [True: 12.3k, False: 42.9k]
  ------------------
  126|      0|    case MAX_ARF_LAYERS:
  ------------------
  |  |   54|      0|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (126:5): [True: 0, False: 55.2k]
  ------------------
  127|      0|    case MAX_ARF_LAYERS + 1: return 4;
  ------------------
  |  |   54|      0|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (127:5): [True: 0, False: 55.2k]
  ------------------
  128|  24.6k|    default: return 7;
  ------------------
  |  Branch (128:5): [True: 24.6k, False: 30.6k]
  ------------------
  129|  55.2k|  }
  130|  55.2k|}

av1_init_rtc_counters:
  175|   116k|void av1_init_rtc_counters(MACROBLOCK *const x) {
  176|   116k|  av1_init_cyclic_refresh_counters(x);
  177|   116k|  x->cnt_zeromv = 0;
  178|   116k|  x->sb_col_scroll = 0;
  179|   116k|  x->sb_row_scroll = 0;
  180|   116k|}
av1_accumulate_rtc_counters:
  182|  80.7k|void av1_accumulate_rtc_counters(AV1_COMP *cpi, const MACROBLOCK *const x) {
  183|  80.7k|  if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ)
  ------------------
  |  Branch (183:7): [True: 0, False: 80.7k]
  ------------------
  184|      0|    av1_accumulate_cyclic_refresh_counters(cpi->cyclic_refresh, x);
  185|  80.7k|  cpi->rc.cnt_zeromv += x->cnt_zeromv;
  186|  80.7k|  cpi->rc.num_col_blscroll_last_tl0 += x->sb_col_scroll;
  187|  80.7k|  cpi->rc.num_row_blscroll_last_tl0 += x->sb_row_scroll;
  188|  80.7k|}
av1_get_perpixel_variance:
  194|  5.89M|                                       int use_hbd) {
  195|  5.89M|  const int subsampling_x = xd->plane[plane].subsampling_x;
  196|  5.89M|  const int subsampling_y = xd->plane[plane].subsampling_y;
  197|  5.89M|  const BLOCK_SIZE plane_bsize =
  198|  5.89M|      get_plane_block_size(bsize, subsampling_x, subsampling_y);
  199|  5.89M|  unsigned int sse;
  200|  5.89M|  const unsigned int var = cpi->ppi->fn_ptr[plane_bsize].vf(
  201|  5.89M|      ref->buf, ref->stride, get_var_offs(use_hbd, xd->bd), 0, &sse);
  202|  5.89M|  return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[plane_bsize]);
  ------------------
  |  |   41|  5.89M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  203|  5.89M|}
av1_get_perpixel_variance_facade:
  208|  5.88M|                                              BLOCK_SIZE bsize, int plane) {
  209|  5.88M|  const int use_hbd = is_cur_buf_hbd(xd);
  210|  5.88M|  return av1_get_perpixel_variance(cpi, xd, ref, bsize, plane, use_hbd);
  211|  5.88M|}
av1_setup_src_planes:
  215|  16.8M|                          BLOCK_SIZE bsize) {
  216|       |  // Set current frame pointer.
  217|  16.8M|  x->e_mbd.cur_buf = src;
  218|       |
  219|       |  // We use AOMMIN(num_planes, MAX_MB_PLANE) instead of num_planes to quiet
  220|       |  // the static analysis warnings.
  221|  48.4M|  for (int i = 0; i < AOMMIN(num_planes, MAX_MB_PLANE); i++) {
  ------------------
  |  |   34|  48.4M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.7M, False: 29.7M]
  |  |  ------------------
  ------------------
  |  Branch (221:19): [True: 31.6M, False: 16.8M]
  ------------------
  222|  31.6M|    const int is_uv = i > 0;
  223|  31.6M|    setup_pred_plane(
  224|  31.6M|        &x->plane[i].src, bsize, src->buffers[i], src->crop_widths[is_uv],
  225|       |        src->crop_heights[is_uv], src->strides[is_uv], mi_row, mi_col, NULL,
  226|  31.6M|        x->e_mbd.plane[i].subsampling_x, x->e_mbd.plane[i].subsampling_y);
  227|  31.6M|  }
  228|  16.8M|}
av1_alloc_tile_data:
 1376|  26.2k|void av1_alloc_tile_data(AV1_COMP *cpi) {
 1377|  26.2k|  AV1_COMMON *const cm = &cpi->common;
 1378|  26.2k|  const int tile_cols = cm->tiles.cols;
 1379|  26.2k|  const int tile_rows = cm->tiles.rows;
 1380|       |
 1381|  26.2k|  av1_row_mt_mem_dealloc(cpi);
 1382|       |
 1383|  26.2k|  aom_free(cpi->tile_data);
 1384|  26.2k|  cpi->allocated_tiles = 0;
 1385|       |
 1386|  26.2k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  26.2k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  26.2k|  do {                                                    \
  |  |  |  |   72|  26.2k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  26.2k|    lval = (expr);                                        \
  |  |  |  |   74|  26.2k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 26.2k]
  |  |  |  |  ------------------
  |  |  |  |   75|  26.2k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  26.2k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 26.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1387|  26.2k|      cm, cpi->tile_data,
 1388|  26.2k|      aom_memalign(32, tile_cols * tile_rows * sizeof(*cpi->tile_data)));
 1389|       |
 1390|  26.2k|  cpi->allocated_tiles = tile_cols * tile_rows;
 1391|  63.5k|  for (int tile_row = 0; tile_row < tile_rows; ++tile_row) {
  ------------------
  |  Branch (1391:26): [True: 37.3k, False: 26.2k]
  ------------------
 1392|  93.2k|    for (int tile_col = 0; tile_col < tile_cols; ++tile_col) {
  ------------------
  |  Branch (1392:28): [True: 55.9k, False: 37.3k]
  ------------------
 1393|  55.9k|      const int tile_index = tile_row * tile_cols + tile_col;
 1394|  55.9k|      TileDataEnc *const this_tile = &cpi->tile_data[tile_index];
 1395|  55.9k|      av1_zero(this_tile->row_mt_sync);
  ------------------
  |  |   43|  55.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1396|       |      this_tile->row_ctx = NULL;
 1397|  55.9k|    }
 1398|  37.3k|  }
 1399|  26.2k|}
av1_init_tile_data:
 1401|  73.6k|void av1_init_tile_data(AV1_COMP *cpi) {
 1402|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 1403|  73.6k|  const int num_planes = av1_num_planes(cm);
 1404|  73.6k|  const int tile_cols = cm->tiles.cols;
 1405|  73.6k|  const int tile_rows = cm->tiles.rows;
 1406|  73.6k|  int tile_col, tile_row;
 1407|  73.6k|  TokenInfo *const token_info = &cpi->token_info;
 1408|  73.6k|  TokenExtra *pre_tok = token_info->tile_tok[0][0];
 1409|  73.6k|  TokenList *tplist = token_info->tplist[0][0];
 1410|  73.6k|  unsigned int tile_tok = 0;
 1411|  73.6k|  int tplist_count = 0;
 1412|       |
 1413|  73.6k|  if (!is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (1413:7): [True: 73.6k, False: 0]
  ------------------
 1414|  73.6k|      cm->features.allow_screen_content_tools) {
  ------------------
  |  Branch (1414:7): [True: 7.92k, False: 65.7k]
  ------------------
 1415|       |    // Number of tokens for which token info needs to be allocated.
 1416|  7.92k|    unsigned int tokens_required =
 1417|  7.92k|        get_token_alloc(cm->mi_params.mb_rows, cm->mi_params.mb_cols,
 1418|  7.92k|                        MAX_SB_SIZE_LOG2, num_planes);
  ------------------
  |  |   31|  7.92k|#define MAX_SB_SIZE_LOG2 7
  ------------------
 1419|       |    // Allocate/reallocate memory for token related info if the number of tokens
 1420|       |    // required is more than the number of tokens already allocated. This could
 1421|       |    // occur in case of the following:
 1422|       |    // 1) If the memory is not yet allocated
 1423|       |    // 2) If the frame dimensions have changed
 1424|  7.92k|    const bool realloc_tokens = tokens_required > token_info->tokens_allocated;
 1425|  7.92k|    if (realloc_tokens) {
  ------------------
  |  Branch (1425:9): [True: 2.33k, False: 5.58k]
  ------------------
 1426|  2.33k|      free_token_info(token_info);
 1427|  2.33k|      alloc_token_info(cm, token_info, tokens_required);
 1428|  2.33k|      pre_tok = token_info->tile_tok[0][0];
 1429|  2.33k|      tplist = token_info->tplist[0][0];
 1430|  2.33k|    }
 1431|  7.92k|  }
 1432|       |
 1433|   164k|  for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
  ------------------
  |  Branch (1433:22): [True: 91.1k, False: 73.6k]
  ------------------
 1434|   208k|    for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
  ------------------
  |  Branch (1434:24): [True: 117k, False: 91.1k]
  ------------------
 1435|   117k|      TileDataEnc *const tile_data =
 1436|   117k|          &cpi->tile_data[tile_row * tile_cols + tile_col];
 1437|   117k|      TileInfo *const tile_info = &tile_data->tile_info;
 1438|   117k|      av1_tile_init(tile_info, cm, tile_row, tile_col);
 1439|   117k|      tile_data->firstpass_top_mv = kZeroMv;
 1440|   117k|      tile_data->abs_sum_level = 0;
 1441|       |
 1442|   117k|      if (is_token_info_allocated(token_info)) {
  ------------------
  |  Branch (1442:11): [True: 10.7k, False: 106k]
  ------------------
 1443|  10.7k|        token_info->tile_tok[tile_row][tile_col] = pre_tok + tile_tok;
 1444|  10.7k|        pre_tok = token_info->tile_tok[tile_row][tile_col];
 1445|  10.7k|        tile_tok = allocated_tokens(
 1446|  10.7k|            tile_info, cm->seq_params->mib_size_log2 + MI_SIZE_LOG2,
  ------------------
  |  |   39|  10.7k|#define MI_SIZE_LOG2 2
  ------------------
 1447|  10.7k|            num_planes);
 1448|  10.7k|        token_info->tplist[tile_row][tile_col] = tplist + tplist_count;
 1449|  10.7k|        tplist = token_info->tplist[tile_row][tile_col];
 1450|  10.7k|        tplist_count = av1_get_sb_rows_in_tile(cm, tile_info);
 1451|  10.7k|      }
 1452|   117k|      tile_data->allow_update_cdf = !cm->tiles.large_scale;
 1453|   117k|      tile_data->allow_update_cdf = tile_data->allow_update_cdf &&
  ------------------
  |  Branch (1453:37): [True: 117k, False: 0]
  ------------------
 1454|   117k|                                    !cm->features.disable_cdf_update &&
  ------------------
  |  Branch (1454:37): [True: 117k, False: 0]
  ------------------
 1455|   117k|                                    !delay_wait_for_top_right_sb(cpi);
  ------------------
  |  Branch (1455:37): [True: 117k, False: 0]
  ------------------
 1456|   117k|      tile_data->tctx = *cm->fc;
 1457|   117k|    }
 1458|  91.1k|  }
 1459|  73.6k|}
av1_encode_sb_row:
 1515|   126k|                       int tile_col, int mi_row) {
 1516|   126k|  AV1_COMMON *const cm = &cpi->common;
 1517|   126k|  const int tile_cols = cm->tiles.cols;
 1518|   126k|  TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
 1519|   126k|  const TileInfo *const tile_info = &this_tile->tile_info;
 1520|   126k|  TokenExtra *tok = NULL;
 1521|       |
 1522|   126k|  get_token_start(cpi, tile_info, tile_row, tile_col, mi_row, &tok);
 1523|       |
 1524|   126k|  encode_sb_row(cpi, td, this_tile, mi_row, &tok);
 1525|       |
 1526|   126k|  populate_token_count(cpi, tile_info, tile_row, tile_col, mi_row, tok);
 1527|   126k|}
av1_encode_tile:
 1534|  21.8k|                     int tile_col) {
 1535|  21.8k|  AV1_COMMON *const cm = &cpi->common;
 1536|  21.8k|  TileDataEnc *const this_tile =
 1537|  21.8k|      &cpi->tile_data[tile_row * cm->tiles.cols + tile_col];
 1538|  21.8k|  const TileInfo *const tile_info = &this_tile->tile_info;
 1539|       |
 1540|  21.8k|  if (!cpi->sf.rt_sf.use_nonrd_pick_mode) av1_inter_mode_data_init(this_tile);
  ------------------
  |  Branch (1540:7): [True: 15.5k, False: 6.31k]
  ------------------
 1541|       |
 1542|  21.8k|  av1_zero_above_context(cm, &td->mb.e_mbd, tile_info->mi_col_start,
 1543|  21.8k|                         tile_info->mi_col_end, tile_row);
 1544|  21.8k|  av1_init_above_context(&cm->above_contexts, av1_num_planes(cm), tile_row,
 1545|  21.8k|                         &td->mb.e_mbd);
 1546|       |
 1547|  21.8k|#if !CONFIG_REALTIME_ONLY
 1548|  21.8k|  if (cpi->oxcf.intra_mode_cfg.enable_cfl_intra)
  ------------------
  |  Branch (1548:7): [True: 21.8k, False: 0]
  ------------------
 1549|  21.8k|    cfl_init(&td->mb.e_mbd.cfl, cm->seq_params);
 1550|  21.8k|#endif
 1551|       |
 1552|  21.8k|  if (td->mb.txfm_search_info.mb_rd_record != NULL) {
  ------------------
  |  Branch (1552:7): [True: 15.5k, False: 6.31k]
  ------------------
 1553|  15.5k|    av1_crc32c_calculator_init(
 1554|  15.5k|        &td->mb.txfm_search_info.mb_rd_record->crc_calculator);
 1555|  15.5k|  }
 1556|       |
 1557|  44.5k|  for (int mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end;
  ------------------
  |  Branch (1557:46): [True: 22.7k, False: 21.8k]
  ------------------
 1558|  22.7k|       mi_row += cm->seq_params->mib_size) {
 1559|  22.7k|    av1_encode_sb_row(cpi, td, tile_row, tile_col, mi_row);
 1560|  22.7k|  }
 1561|  21.8k|  this_tile->abs_sum_level = td->abs_sum_level;
 1562|  21.8k|}
av1_encode_frame:
 2739|  73.6k|void av1_encode_frame(AV1_COMP *cpi) {
 2740|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 2741|  73.6k|  CurrentFrame *const current_frame = &cm->current_frame;
 2742|  73.6k|  FeatureFlags *const features = &cm->features;
 2743|  73.6k|  RD_COUNTS *const rdc = &cpi->td.rd_counts;
 2744|  73.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2745|       |  // Indicates whether or not to use a default reduced set for ext-tx
 2746|       |  // rather than the potential full set of 16 transforms
 2747|  73.6k|  features->reduced_tx_set_used = oxcf->txfm_cfg.reduced_tx_type_set;
 2748|       |
 2749|       |  // Make sure segment_id is no larger than last_active_segid.
 2750|  73.6k|  if (cm->seg.enabled && cm->seg.update_map) {
  ------------------
  |  Branch (2750:7): [True: 0, False: 73.6k]
  |  Branch (2750:26): [True: 0, False: 0]
  ------------------
 2751|      0|    const int mi_rows = cm->mi_params.mi_rows;
 2752|      0|    const int mi_cols = cm->mi_params.mi_cols;
 2753|      0|    const int last_active_segid = cm->seg.last_active_segid;
 2754|      0|    uint8_t *map = cpi->enc_seg.map;
 2755|      0|    for (int mi_row = 0; mi_row < mi_rows; ++mi_row) {
  ------------------
  |  Branch (2755:26): [True: 0, False: 0]
  ------------------
 2756|      0|      for (int mi_col = 0; mi_col < mi_cols; ++mi_col) {
  ------------------
  |  Branch (2756:28): [True: 0, False: 0]
  ------------------
 2757|      0|        map[mi_col] = AOMMIN(map[mi_col], last_active_segid);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2758|      0|      }
 2759|      0|      map += mi_cols;
 2760|      0|    }
 2761|      0|  }
 2762|       |
 2763|  73.6k|  av1_setup_frame_buf_refs(cm);
 2764|  73.6k|  enforce_max_ref_frames(cpi, &cpi->ref_frame_flags,
 2765|  73.6k|                         cm->cur_frame->ref_display_order_hint,
 2766|  73.6k|                         cm->current_frame.display_order_hint);
 2767|  73.6k|  set_rel_frame_dist(&cpi->common, &cpi->ref_frame_dist_info,
 2768|  73.6k|                     cpi->ref_frame_flags);
 2769|  73.6k|  av1_setup_frame_sign_bias(cm);
 2770|       |
 2771|       |  // If global motion is enabled, then every buffer which is used as either
 2772|       |  // a source or a ref frame should have an image pyramid allocated.
 2773|       |  // Check here so that issues can be caught early in debug mode
 2774|       |#if !defined(NDEBUG) && !CONFIG_REALTIME_ONLY
 2775|       |  if (cpi->alloc_pyramid) {
 2776|       |    assert(cpi->source->y_pyramid);
 2777|       |    for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
 2778|       |      const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 2779|       |      if (buf != NULL) {
 2780|       |        assert(buf->buf.y_pyramid);
 2781|       |      }
 2782|       |    }
 2783|       |  }
 2784|       |#endif  // !defined(NDEBUG) && !CONFIG_REALTIME_ONLY
 2785|       |
 2786|       |#if CONFIG_MISMATCH_DEBUG
 2787|       |  mismatch_reset_frame(av1_num_planes(cm));
 2788|       |#endif
 2789|       |
 2790|  73.6k|  rdc->newmv_or_intra_blocks = 0;
 2791|  73.6k|  cpi->palette_pixel_num = 0;
 2792|       |
 2793|  73.6k|  if (cpi->sf.hl_sf.frame_parameter_update ||
  ------------------
  |  Branch (2793:7): [True: 49.2k, False: 24.4k]
  ------------------
 2794|  64.6k|      cpi->sf.rt_sf.use_comp_ref_nonrd) {
  ------------------
  |  Branch (2794:7): [True: 15.3k, False: 9.01k]
  ------------------
 2795|  64.6k|    if (frame_is_intra_only(cm))
  ------------------
  |  Branch (2795:9): [True: 16.1k, False: 48.4k]
  ------------------
 2796|  16.1k|      current_frame->reference_mode = SINGLE_REFERENCE;
 2797|  48.4k|    else
 2798|  48.4k|      current_frame->reference_mode = REFERENCE_MODE_SELECT;
 2799|       |
 2800|  64.6k|    features->interp_filter = SWITCHABLE;
 2801|  64.6k|    if (cm->tiles.large_scale) features->interp_filter = EIGHTTAP_REGULAR;
  ------------------
  |  Branch (2801:9): [True: 0, False: 64.6k]
  ------------------
 2802|       |
 2803|  64.6k|    features->switchable_motion_mode = is_switchable_motion_mode_allowed(
 2804|  64.6k|        features->allow_warped_motion, oxcf->motion_mode_cfg.enable_obmc);
 2805|       |
 2806|  64.6k|    rdc->compound_ref_used_flag = 0;
 2807|  64.6k|    rdc->skip_mode_used_flag = 0;
 2808|       |
 2809|  64.6k|    encode_frame_internal(cpi);
 2810|       |
 2811|  64.6k|    if (current_frame->reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (2811:9): [True: 48.4k, False: 16.1k]
  ------------------
 2812|       |      // Use a flag that includes 4x4 blocks
 2813|  48.4k|      if (rdc->compound_ref_used_flag == 0) {
  ------------------
  |  Branch (2813:11): [True: 48.4k, False: 0]
  ------------------
 2814|  48.4k|        current_frame->reference_mode = SINGLE_REFERENCE;
 2815|       |#if CONFIG_ENTROPY_STATS
 2816|       |        av1_zero(cpi->td.counts->comp_inter);
 2817|       |#endif  // CONFIG_ENTROPY_STATS
 2818|  48.4k|      }
 2819|  48.4k|    }
 2820|       |    // Re-check on the skip mode status as reference mode may have been
 2821|       |    // changed.
 2822|  64.6k|    SkipModeInfo *const skip_mode_info = &current_frame->skip_mode_info;
 2823|  64.6k|    if (frame_is_intra_only(cm) ||
  ------------------
  |  Branch (2823:9): [True: 16.1k, False: 48.4k]
  ------------------
 2824|  64.6k|        current_frame->reference_mode == SINGLE_REFERENCE) {
  ------------------
  |  Branch (2824:9): [True: 48.4k, False: 0]
  ------------------
 2825|  64.6k|      skip_mode_info->skip_mode_allowed = 0;
 2826|  64.6k|      skip_mode_info->skip_mode_flag = 0;
 2827|  64.6k|    }
 2828|  64.6k|    if (skip_mode_info->skip_mode_flag && rdc->skip_mode_used_flag == 0)
  ------------------
  |  Branch (2828:9): [True: 0, False: 64.6k]
  |  Branch (2828:43): [True: 0, False: 0]
  ------------------
 2829|      0|      skip_mode_info->skip_mode_flag = 0;
 2830|       |
 2831|  64.6k|    if (!cm->tiles.large_scale) {
  ------------------
  |  Branch (2831:9): [True: 64.6k, False: 0]
  ------------------
 2832|  64.6k|      if (features->tx_mode == TX_MODE_SELECT &&
  ------------------
  |  Branch (2832:11): [True: 61.6k, False: 2.92k]
  ------------------
 2833|  61.6k|          cpi->td.mb.txfm_search_info.txb_split_count == 0)
  ------------------
  |  Branch (2833:11): [True: 26.4k, False: 35.2k]
  ------------------
 2834|  26.4k|        features->tx_mode = TX_MODE_LARGEST;
 2835|  64.6k|    }
 2836|  64.6k|  } else {
 2837|       |    // This is needed if real-time speed setting is changed on the fly
 2838|       |    // from one using compound prediction to one using single reference.
 2839|  9.01k|    if (current_frame->reference_mode == REFERENCE_MODE_SELECT)
  ------------------
  |  Branch (2839:9): [True: 0, False: 9.01k]
  ------------------
 2840|      0|      current_frame->reference_mode = SINGLE_REFERENCE;
 2841|  9.01k|    encode_frame_internal(cpi);
 2842|  9.01k|  }
 2843|  73.6k|}
encodeframe.c:get_var_offs:
  156|  5.89M|static const uint8_t *get_var_offs(int use_hbd, int bd) {
  157|  5.89M|#if CONFIG_AV1_HIGHBITDEPTH
  158|  5.89M|  if (use_hbd) {
  ------------------
  |  Branch (158:7): [True: 1.39M, False: 4.49M]
  ------------------
  159|  1.39M|    assert(bd == 8 || bd == 10 || bd == 12);
  160|  1.39M|    const int off_index = (bd - 8) >> 1;
  161|  1.39M|    static const uint16_t *high_var_offs[3] = { AV1_HIGH_VAR_OFFS_8,
  162|  1.39M|                                                AV1_HIGH_VAR_OFFS_10,
  163|  1.39M|                                                AV1_HIGH_VAR_OFFS_12 };
  164|  1.39M|    return CONVERT_TO_BYTEPTR(high_var_offs[off_index]);
  ------------------
  |  |   80|  1.39M|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  165|  1.39M|  }
  166|       |#else
  167|       |  (void)use_hbd;
  168|       |  (void)bd;
  169|       |  assert(!use_hbd);
  170|       |#endif
  171|  5.89M|  assert(bd == 8);
  172|  4.49M|  return AV1_VAR_OFFS;
  173|  5.89M|}
encodeframe.c:delay_wait_for_top_right_sb:
 1065|   255k|static inline int delay_wait_for_top_right_sb(const AV1_COMP *const cpi) {
 1066|   255k|  const MODE mode = cpi->oxcf.mode;
 1067|   255k|  if (mode == GOOD) return 0;
  ------------------
  |  Branch (1067:7): [True: 164k, False: 90.2k]
  ------------------
 1068|       |
 1069|  90.2k|  if (mode == ALLINTRA)
  ------------------
  |  Branch (1069:7): [True: 0, False: 90.2k]
  ------------------
 1070|      0|    return is_mode_coeff_dv_upd_freq_tile_or_off(cpi);
 1071|  90.2k|  else if (mode == REALTIME)
  ------------------
  |  Branch (1071:12): [True: 90.2k, False: 18.4E]
  ------------------
 1072|  90.2k|    return (is_mode_coeff_dv_upd_freq_tile_or_off(cpi) &&
  ------------------
  |  Branch (1072:13): [True: 0, False: 90.2k]
  ------------------
 1073|      0|            cpi->sf.inter_sf.mv_cost_upd_level <= INTERNAL_COST_UPD_TILE);
  ------------------
  |  Branch (1073:13): [True: 0, False: 0]
  ------------------
 1074|  18.4E|  else
 1075|  18.4E|    return 0;
 1076|  90.2k|}
encodeframe.c:is_mode_coeff_dv_upd_freq_tile_or_off:
 1053|  90.2k|    const AV1_COMP *const cpi) {
 1054|  90.2k|  const INTER_MODE_SPEED_FEATURES *const inter_sf = &cpi->sf.inter_sf;
 1055|       |
 1056|  90.2k|  return (inter_sf->coeff_cost_upd_level <= INTERNAL_COST_UPD_TILE &&
  ------------------
  |  Branch (1056:11): [True: 0, False: 90.2k]
  ------------------
 1057|      0|          inter_sf->mode_cost_upd_level <= INTERNAL_COST_UPD_TILE &&
  ------------------
  |  Branch (1057:11): [True: 0, False: 0]
  ------------------
 1058|      0|          cpi->sf.intra_sf.dv_cost_upd_level <= INTERNAL_COST_UPD_TILE);
  ------------------
  |  Branch (1058:11): [True: 0, False: 0]
  ------------------
 1059|  90.2k|}
encodeframe.c:get_token_start:
 1464|   126k|                                   TokenExtra **tp) {
 1465|   126k|  const TokenInfo *token_info = &cpi->token_info;
 1466|   126k|  if (!is_token_info_allocated(token_info)) return;
  ------------------
  |  Branch (1466:7): [True: 115k, False: 11.1k]
  ------------------
 1467|       |
 1468|  11.1k|  const AV1_COMMON *cm = &cpi->common;
 1469|  11.1k|  const int num_planes = av1_num_planes(cm);
 1470|  11.1k|  TokenList *const tplist = cpi->token_info.tplist[tile_row][tile_col];
 1471|  11.1k|  const int sb_row_in_tile =
 1472|  11.1k|      (mi_row - tile_info->mi_row_start) >> cm->seq_params->mib_size_log2;
 1473|       |
 1474|  11.1k|  get_start_tok(cpi, tile_row, tile_col, mi_row, tp,
 1475|  11.1k|                cm->seq_params->mib_size_log2 + MI_SIZE_LOG2, num_planes);
  ------------------
  |  |   39|  11.1k|#define MI_SIZE_LOG2 2
  ------------------
 1476|       |  assert(tplist != NULL);
 1477|  11.1k|  tplist[sb_row_in_tile].start = *tp;
 1478|  11.1k|}
encodeframe.c:encode_sb_row:
 1217|   126k|                                 TokenExtra **tp) {
 1218|   126k|  AV1_COMMON *const cm = &cpi->common;
 1219|   126k|  const TileInfo *const tile_info = &tile_data->tile_info;
 1220|   126k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 1221|   126k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &mt_info->enc_row_mt;
 1222|   126k|  AV1EncRowMultiThreadSync *const row_mt_sync = &tile_data->row_mt_sync;
 1223|   126k|  bool row_mt_enabled = mt_info->row_mt_enabled;
 1224|   126k|  MACROBLOCK *const x = &td->mb;
 1225|   126k|  MACROBLOCKD *const xd = &x->e_mbd;
 1226|   126k|  const int sb_cols_in_tile = av1_get_sb_cols_in_tile(cm, tile_info);
 1227|   126k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
 1228|   126k|  const int mib_size = cm->seq_params->mib_size;
 1229|   126k|  const int mib_size_log2 = cm->seq_params->mib_size_log2;
 1230|   126k|  const int sb_row = (mi_row - tile_info->mi_row_start) >> mib_size_log2;
 1231|   126k|  const int use_nonrd_mode = cpi->sf.rt_sf.use_nonrd_pick_mode;
 1232|       |
 1233|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1234|       |  start_timing(cpi, encode_sb_row_time);
 1235|       |#endif
 1236|       |
 1237|       |  // Initialize the left context for the new SB row
 1238|   126k|  av1_zero_left_context(xd);
 1239|       |
 1240|       |  // Reset delta for quantizer and loof filters at the beginning of every tile
 1241|   126k|  if (mi_row == tile_info->mi_row_start || row_mt_enabled) {
  ------------------
  |  Branch (1241:7): [True: 117k, False: 8.81k]
  |  Branch (1241:44): [True: 7.91k, False: 891]
  ------------------
 1242|   125k|    if (cpi->cb_delta_rdmult_enabled)
  ------------------
  |  Branch (1242:9): [True: 86.4k, False: 38.9k]
  ------------------
 1243|  86.4k|      xd->current_base_qindex = cm->quant_params.base_qindex;
 1244|   125k|    if (cm->delta_q_info.delta_lf_present_flag) {
  ------------------
  |  Branch (1244:9): [True: 0, False: 125k]
  ------------------
 1245|      0|      av1_reset_loop_filter_delta(xd, av1_num_planes(cm));
 1246|      0|    }
 1247|   125k|  }
 1248|       |
 1249|   126k|  reset_thresh_freq_fact(x);
 1250|       |
 1251|       |  // Code each SB in the row
 1252|   126k|  for (int mi_col = tile_info->mi_col_start, sb_col_in_tile = 0;
 1253|   263k|       mi_col < tile_info->mi_col_end; mi_col += mib_size, sb_col_in_tile++) {
  ------------------
  |  Branch (1253:8): [True: 137k, False: 126k]
  ------------------
 1254|       |    // In realtime/allintra mode and when frequency of cost updates is off/tile,
 1255|       |    // wait for the top superblock to finish encoding. Otherwise, wait for the
 1256|       |    // top-right superblock to finish encoding.
 1257|   137k|    enc_row_mt->sync_read_ptr(
 1258|   137k|        row_mt_sync, sb_row, sb_col_in_tile - delay_wait_for_top_right_sb(cpi));
 1259|       |
 1260|   137k|#if CONFIG_MULTITHREAD
 1261|   137k|    if (row_mt_enabled) {
  ------------------
  |  Branch (1261:9): [True: 112k, False: 24.8k]
  ------------------
 1262|   112k|      pthread_mutex_lock(enc_row_mt->mutex_);
 1263|   112k|      const bool row_mt_exit = enc_row_mt->row_mt_exit;
 1264|   112k|      pthread_mutex_unlock(enc_row_mt->mutex_);
 1265|       |      // Exit in case any worker has encountered an error.
 1266|   112k|      if (row_mt_exit) return;
  ------------------
  |  Branch (1266:11): [True: 0, False: 112k]
  ------------------
 1267|   112k|    }
 1268|   137k|#endif
 1269|       |
 1270|   137k|    const int update_cdf = tile_data->allow_update_cdf && row_mt_enabled;
  ------------------
  |  Branch (1270:28): [True: 137k, False: 18.4E]
  |  Branch (1270:59): [True: 112k, False: 24.7k]
  ------------------
 1271|   137k|    if (update_cdf && (tile_info->mi_row_start != mi_row)) {
  ------------------
  |  Branch (1271:9): [True: 112k, False: 24.6k]
  |  Branch (1271:23): [True: 9.38k, False: 103k]
  ------------------
 1272|  9.38k|      if ((tile_info->mi_col_start == mi_col)) {
  ------------------
  |  Branch (1272:11): [True: 7.92k, False: 1.45k]
  ------------------
 1273|       |        // restore frame context at the 1st column sb
 1274|  7.92k|        *xd->tile_ctx = *x->row_ctx;
 1275|  7.92k|      } else {
 1276|       |        // update context
 1277|  1.45k|        int wt_left = AVG_CDF_WEIGHT_LEFT;
  ------------------
  |  |  579|  1.45k|#define AVG_CDF_WEIGHT_LEFT 3
  ------------------
 1278|  1.45k|        int wt_tr = AVG_CDF_WEIGHT_TOP_RIGHT;
  ------------------
  |  |  580|  1.45k|#define AVG_CDF_WEIGHT_TOP_RIGHT 1
  ------------------
 1279|  1.45k|        if (tile_info->mi_col_end > (mi_col + mib_size))
  ------------------
  |  Branch (1279:13): [True: 589, False: 869]
  ------------------
 1280|    589|          av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile,
 1281|    589|                              wt_left, wt_tr);
 1282|    869|        else
 1283|    869|          av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile - 1,
 1284|    869|                              wt_left, wt_tr);
 1285|  1.45k|      }
 1286|  9.38k|    }
 1287|       |
 1288|       |    // Update the rate cost tables for some symbols
 1289|   137k|    av1_set_cost_upd_freq(cpi, td, tile_info, mi_row, mi_col);
 1290|       |
 1291|       |    // Reset color coding related parameters
 1292|   137k|    av1_zero(x->color_sensitivity_sb);
  ------------------
  |  |   43|   137k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1293|   137k|    av1_zero(x->color_sensitivity_sb_g);
  ------------------
  |  |   43|   137k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1294|   137k|    av1_zero(x->color_sensitivity_sb_alt);
  ------------------
  |  |   43|   137k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1295|   137k|    av1_zero(x->color_sensitivity);
  ------------------
  |  |   43|   137k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1296|   137k|    x->content_state_sb.source_sad_nonrd = kMedSad;
 1297|   137k|    x->content_state_sb.source_sad_rd = kMedSad;
 1298|   137k|    x->content_state_sb.lighting_change = 0;
 1299|   137k|    x->content_state_sb.low_sumdiff = 0;
 1300|   137k|    x->force_zeromv_skip_for_sb = 0;
 1301|   137k|    x->sb_me_block = 0;
 1302|   137k|    x->sb_me_partition = 0;
 1303|   137k|    x->sb_me_mv.as_int = 0;
 1304|   137k|    x->sb_force_fixed_part = 1;
 1305|   137k|    x->color_palette_thresh = 64;
 1306|   137k|    x->force_color_check_block_level = 0;
 1307|   137k|    x->nonrd_prune_ref_frame_search =
 1308|   137k|        cpi->sf.rt_sf.nonrd_prune_ref_frame_search;
 1309|       |
 1310|   137k|    if (cpi->oxcf.mode == ALLINTRA) {
  ------------------
  |  Branch (1310:9): [True: 0, False: 137k]
  ------------------
 1311|      0|      x->intra_sb_rdmult_modifier = 128;
 1312|      0|    }
 1313|       |
 1314|   137k|    xd->cur_frame_force_integer_mv = cm->features.cur_frame_force_integer_mv;
 1315|   137k|    x->source_variance = UINT_MAX;
 1316|   137k|    td->mb.cb_coef_buff = av1_get_cb_coeff_buffer(cpi, mi_row, mi_col);
 1317|       |
 1318|       |    // Get segment id and skip flag
 1319|   137k|    const struct segmentation *const seg = &cm->seg;
 1320|   137k|    int seg_skip = 0;
 1321|   137k|    if (seg->enabled) {
  ------------------
  |  Branch (1321:9): [True: 0, False: 137k]
  ------------------
 1322|      0|      const uint8_t *const map =
 1323|      0|          seg->update_map ? cpi->enc_seg.map : cm->last_frame_seg_map;
  ------------------
  |  Branch (1323:11): [True: 0, False: 0]
  ------------------
 1324|      0|      const uint8_t segment_id =
 1325|      0|          map ? get_segment_id(&cm->mi_params, map, sb_size, mi_row, mi_col)
  ------------------
  |  Branch (1325:11): [True: 0, False: 0]
  ------------------
 1326|      0|              : 0;
 1327|      0|      seg_skip = segfeature_active(seg, segment_id, SEG_LVL_SKIP);
 1328|      0|    }
 1329|       |
 1330|   137k|    produce_gradients_for_sb(cpi, x, sb_size, mi_row, mi_col);
 1331|       |
 1332|   137k|    init_src_var_info_of_4x4_sub_blocks(cpi, x->src_var_info_of_4x4_sub_blocks,
 1333|   137k|                                        sb_size);
 1334|       |
 1335|       |    // Grade the temporal variation of the sb, the grade will be used to decide
 1336|       |    // fast mode search strategy for coding blocks
 1337|   137k|    if (!seg_skip) grade_source_content_sb(cpi, x, tile_data, mi_row, mi_col);
  ------------------
  |  Branch (1337:9): [True: 137k, False: 18.4E]
  ------------------
 1338|       |
 1339|       |    // encode the superblock
 1340|   137k|    if (use_nonrd_mode) {
  ------------------
  |  Branch (1340:9): [True: 49.0k, False: 88.3k]
  ------------------
 1341|  49.0k|      encode_nonrd_sb(cpi, td, tile_data, tp, mi_row, mi_col, seg_skip);
 1342|  88.3k|    } else {
 1343|  88.3k|      encode_rd_sb(cpi, td, tile_data, tp, mi_row, mi_col, seg_skip);
 1344|  88.3k|    }
 1345|       |
 1346|       |    // Update the top-right context in row_mt coding
 1347|   137k|    if (update_cdf && (tile_info->mi_row_end > (mi_row + mib_size))) {
  ------------------
  |  Branch (1347:9): [True: 112k, False: 24.6k]
  |  Branch (1347:23): [True: 9.38k, False: 103k]
  ------------------
 1348|  9.38k|      if (sb_cols_in_tile == 1)
  ------------------
  |  Branch (1348:11): [True: 7.05k, False: 2.32k]
  ------------------
 1349|  7.05k|        x->row_ctx[0] = *xd->tile_ctx;
 1350|  2.32k|      else if (sb_col_in_tile >= 1)
  ------------------
  |  Branch (1350:16): [True: 1.45k, False: 869]
  ------------------
 1351|  1.45k|        x->row_ctx[sb_col_in_tile - 1] = *xd->tile_ctx;
 1352|  9.38k|    }
 1353|   137k|    enc_row_mt->sync_write_ptr(row_mt_sync, sb_row, sb_col_in_tile,
 1354|   137k|                               sb_cols_in_tile);
 1355|   137k|  }
 1356|       |
 1357|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1358|       |  end_timing(cpi, encode_sb_row_time);
 1359|       |#endif
 1360|   126k|}
encodeframe.c:grade_source_content_sb:
 1179|   137k|                                           int mi_col) {
 1180|   137k|  AV1_COMMON *const cm = &cpi->common;
 1181|   137k|  if (cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (1181:7): [True: 24.8k, False: 112k]
  ------------------
 1182|   112k|      (cpi->ppi->use_svc &&
  ------------------
  |  Branch (1182:8): [True: 0, False: 112k]
  ------------------
 1183|  24.8k|       cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
  ------------------
  |  Branch (1183:8): [True: 0, False: 0]
  ------------------
 1184|  24.8k|    assert(x->content_state_sb.source_sad_nonrd == kMedSad);
 1185|  24.8k|    assert(x->content_state_sb.source_sad_rd == kMedSad);
 1186|  24.8k|    return;
 1187|  24.8k|  }
 1188|   137k|  bool calc_src_content = false;
 1189|       |
 1190|   112k|  if (cpi->sf.rt_sf.source_metrics_sb_nonrd) {
  ------------------
  |  Branch (1190:7): [True: 40.6k, False: 71.9k]
  ------------------
 1191|  40.6k|    if (!cpi->sf.rt_sf.check_scene_detection || cpi->rc.frame_source_sad > 0) {
  ------------------
  |  Branch (1191:9): [True: 0, False: 40.6k]
  |  Branch (1191:49): [True: 40.6k, False: 0]
  ------------------
 1192|  40.6k|      calc_src_content = is_calc_src_content_needed(cpi, x, mi_row, mi_col);
 1193|  40.6k|    } else {
 1194|      2|      x->content_state_sb.source_sad_nonrd = kZeroSad;
 1195|      2|    }
 1196|  71.9k|  } else if ((cpi->sf.rt_sf.var_part_based_on_qidx >= 1) &&
  ------------------
  |  Branch (1196:14): [True: 0, False: 71.9k]
  ------------------
 1197|      0|             (cm->width * cm->height <= 352 * 288)) {
  ------------------
  |  Branch (1197:14): [True: 0, False: 0]
  ------------------
 1198|      0|    if (cpi->rc.frame_source_sad > 0)
  ------------------
  |  Branch (1198:9): [True: 0, False: 0]
  ------------------
 1199|      0|      calc_src_content = true;
 1200|      0|    else
 1201|      0|      x->content_state_sb.source_sad_rd = kZeroSad;
 1202|      0|  }
 1203|   112k|  if (calc_src_content)
  ------------------
  |  Branch (1203:7): [True: 40.6k, False: 71.9k]
  ------------------
 1204|  40.6k|    av1_source_content_sb(cpi, x, tile_data, mi_row, mi_col);
 1205|   112k|}
encodeframe.c:is_calc_src_content_needed:
 1128|  40.6k|                                              int mi_col) {
 1129|  40.6k|  if (cpi->svc.spatial_layer_id < cpi->svc.number_spatial_layers - 1)
  ------------------
  |  Branch (1129:7): [True: 0, False: 40.6k]
  ------------------
 1130|      0|    return true;
 1131|  40.6k|  const uint64_t curr_sb_sad = get_sb_source_sad(cpi, mi_row, mi_col);
 1132|  40.6k|  if (curr_sb_sad == UINT64_MAX) return true;
  ------------------
  |  Branch (1132:7): [True: 40.6k, False: 3]
  ------------------
 1133|      3|  if (curr_sb_sad == 0) {
  ------------------
  |  Branch (1133:7): [True: 0, False: 3]
  ------------------
 1134|      0|    x->content_state_sb.source_sad_nonrd = kZeroSad;
 1135|      0|    return false;
 1136|      0|  }
 1137|      3|  AV1_COMMON *const cm = &cpi->common;
 1138|      3|  bool do_calc_src_content = true;
 1139|       |
 1140|      3|  if (cpi->oxcf.speed < 9) return do_calc_src_content;
  ------------------
  |  Branch (1140:7): [True: 0, False: 3]
  ------------------
 1141|       |
 1142|       |  // TODO(yunqing): Tune/validate the thresholds for 128x128 SB size.
 1143|      3|  if (AOMMIN(cm->width, cm->height) < 360) {
  ------------------
  |  |   34|      3|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  |  Branch (1143:7): [True: 0, False: 3]
  ------------------
 1144|       |    // Derive Average 64x64 block source SAD from SB source SAD
 1145|      0|    const uint64_t avg_64x64_blk_sad =
 1146|      0|        (cm->seq_params->sb_size == BLOCK_128X128) ? ((curr_sb_sad + 2) >> 2)
  ------------------
  |  Branch (1146:9): [True: 0, False: 0]
  ------------------
 1147|      0|                                                   : curr_sb_sad;
 1148|       |
 1149|       |    // The threshold is determined based on kLowSad and kHighSad threshold and
 1150|       |    // test results.
 1151|      0|    uint64_t thresh_low = 15000;
 1152|      0|    uint64_t thresh_high = 40000;
 1153|       |
 1154|      0|    if (cpi->sf.rt_sf.increase_source_sad_thresh) {
  ------------------
  |  Branch (1154:9): [True: 0, False: 0]
  ------------------
 1155|      0|      thresh_low = thresh_low << 1;
 1156|      0|      thresh_high = thresh_high << 1;
 1157|      0|    }
 1158|       |
 1159|      0|    if (avg_64x64_blk_sad > thresh_low && avg_64x64_blk_sad < thresh_high) {
  ------------------
  |  Branch (1159:9): [True: 0, False: 0]
  |  Branch (1159:43): [True: 0, False: 0]
  ------------------
 1160|      0|      do_calc_src_content = false;
 1161|       |      // Note: set x->content_state_sb.source_sad_rd as well if this is extended
 1162|       |      // to RTC rd path.
 1163|      0|      x->content_state_sb.source_sad_nonrd = kMedSad;
 1164|      0|    }
 1165|      0|  }
 1166|       |
 1167|      3|  return do_calc_src_content;
 1168|      3|}
encodeframe.c:get_sb_source_sad:
 1085|  40.6k|                                         int mi_col) {
 1086|  40.6k|  if (cpi->src_sad_blk_64x64 == NULL) return UINT64_MAX;
  ------------------
  |  Branch (1086:7): [True: 40.6k, False: 0]
  ------------------
 1087|       |
 1088|      0|  const AV1_COMMON *const cm = &cpi->common;
 1089|      0|  const int blk_64x64_in_mis = (cm->seq_params->sb_size == BLOCK_128X128)
  ------------------
  |  Branch (1089:32): [True: 0, False: 0]
  ------------------
 1090|      0|                                   ? (cm->seq_params->mib_size >> 1)
 1091|      0|                                   : cm->seq_params->mib_size;
 1092|      0|  const int num_blk_64x64_cols =
 1093|      0|      (cm->mi_params.mi_cols + blk_64x64_in_mis - 1) / blk_64x64_in_mis;
 1094|      0|  const int num_blk_64x64_rows =
 1095|      0|      (cm->mi_params.mi_rows + blk_64x64_in_mis - 1) / blk_64x64_in_mis;
 1096|      0|  const int blk_64x64_col_index = mi_col / blk_64x64_in_mis;
 1097|      0|  const int blk_64x64_row_index = mi_row / blk_64x64_in_mis;
 1098|      0|  uint64_t curr_sb_sad = UINT64_MAX;
 1099|       |  // Avoid the border as sad_blk_64x64 may not be set for the border
 1100|       |  // in the scene detection.
 1101|      0|  if ((blk_64x64_row_index >= num_blk_64x64_rows - 1) ||
  ------------------
  |  Branch (1101:7): [True: 0, False: 0]
  ------------------
 1102|      0|      (blk_64x64_col_index >= num_blk_64x64_cols - 1)) {
  ------------------
  |  Branch (1102:7): [True: 0, False: 0]
  ------------------
 1103|      0|    return curr_sb_sad;
 1104|      0|  }
 1105|      0|  const uint64_t *const src_sad_blk_64x64_data =
 1106|      0|      &cpi->src_sad_blk_64x64[blk_64x64_col_index +
 1107|      0|                              blk_64x64_row_index * num_blk_64x64_cols];
 1108|      0|  if (cm->seq_params->sb_size == BLOCK_128X128) {
  ------------------
  |  Branch (1108:7): [True: 0, False: 0]
  ------------------
 1109|       |    // Calculate SB source SAD by accumulating source SAD of 64x64 blocks in the
 1110|       |    // superblock
 1111|      0|    curr_sb_sad = src_sad_blk_64x64_data[0] + src_sad_blk_64x64_data[1] +
 1112|      0|                  src_sad_blk_64x64_data[num_blk_64x64_cols] +
 1113|      0|                  src_sad_blk_64x64_data[num_blk_64x64_cols + 1];
 1114|      0|  } else if (cm->seq_params->sb_size == BLOCK_64X64) {
  ------------------
  |  Branch (1114:14): [True: 0, False: 0]
  ------------------
 1115|      0|    curr_sb_sad = src_sad_blk_64x64_data[0];
 1116|      0|  }
 1117|      0|  return curr_sb_sad;
 1118|      0|}
encodeframe.c:encode_nonrd_sb:
  592|  49.0k|                                   const int seg_skip) {
  593|  49.0k|  AV1_COMMON *const cm = &cpi->common;
  594|  49.0k|  MACROBLOCK *const x = &td->mb;
  595|  49.0k|  const SPEED_FEATURES *const sf = &cpi->sf;
  596|  49.0k|  const TileInfo *const tile_info = &tile_data->tile_info;
  597|  49.0k|  MB_MODE_INFO **mi = cm->mi_params.mi_grid_base +
  598|  49.0k|                      get_mi_grid_idx(&cm->mi_params, mi_row, mi_col);
  599|  49.0k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  600|  49.0k|  PC_TREE *const pc_root = td->pc_root;
  601|       |
  602|  49.0k|#if !CONFIG_REALTIME_ONLY
  603|  49.0k|  if (cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (603:7): [True: 34.0k, False: 15.0k]
  ------------------
  604|  34.0k|    const int num_planes = av1_num_planes(cm);
  605|       |
  606|  34.0k|    setup_delta_q_nonrd(cpi, td, x, tile_info, mi_row, mi_col, num_planes);
  607|  34.0k|  }
  608|  49.0k|#endif
  609|       |#if CONFIG_RT_ML_PARTITIONING
  610|       |  if (sf->part_sf.partition_search_type == ML_BASED_PARTITION) {
  611|       |    RD_STATS dummy_rdc;
  612|       |    get_estimated_pred(cpi, tile_info, x, mi_row, mi_col);
  613|       |    av1_nonrd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col,
  614|       |                             BLOCK_64X64, &dummy_rdc, 1, INT64_MAX, pc_root);
  615|       |    return;
  616|       |  }
  617|       |#endif
  618|       |  // Set the partition
  619|  49.0k|  if (sf->part_sf.partition_search_type == FIXED_PARTITION || seg_skip ||
  ------------------
  |  Branch (619:7): [True: 18.4E, False: 49.0k]
  |  Branch (619:63): [True: 18.4E, False: 49.1k]
  ------------------
  620|  49.1k|      (sf->rt_sf.use_fast_fixed_part && x->sb_force_fixed_part == 1 &&
  ------------------
  |  Branch (620:8): [True: 0, False: 49.1k]
  |  Branch (620:41): [True: 0, False: 0]
  ------------------
  621|      0|       (!frame_is_intra_only(cm) &&
  ------------------
  |  Branch (621:9): [True: 0, False: 0]
  ------------------
  622|      0|        (!cpi->ppi->use_svc ||
  ------------------
  |  Branch (622:10): [True: 0, False: 0]
  ------------------
  623|      0|         !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)))) {
  ------------------
  |  Branch (623:10): [True: 0, False: 0]
  ------------------
  624|       |    // set a fixed-size partition
  625|      0|    av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  626|      0|    BLOCK_SIZE bsize_select = sf->part_sf.fixed_partition_size;
  627|      0|    if (sf->rt_sf.use_fast_fixed_part &&
  ------------------
  |  Branch (627:9): [True: 0, False: 0]
  ------------------
  628|      0|        x->content_state_sb.source_sad_nonrd < kLowSad) {
  ------------------
  |  Branch (628:9): [True: 0, False: 0]
  ------------------
  629|      0|      bsize_select = cm->seq_params->sb_size;
  630|      0|    }
  631|      0|    if (cpi->sf.rt_sf.skip_encoding_non_reference_slide_change &&
  ------------------
  |  Branch (631:9): [True: 0, False: 0]
  ------------------
  632|      0|        cpi->rc.high_source_sad && cpi->ppi->rtc_ref.non_reference_frame) {
  ------------------
  |  Branch (632:9): [True: 0, False: 0]
  |  Branch (632:36): [True: 0, False: 0]
  ------------------
  633|      0|      bsize_select = cm->seq_params->sb_size;
  634|      0|      x->force_zeromv_skip_for_sb = 1;
  635|      0|    }
  636|      0|    const BLOCK_SIZE bsize = seg_skip ? sb_size : bsize_select;
  ------------------
  |  Branch (636:30): [True: 0, False: 0]
  ------------------
  637|      0|    if (x->content_state_sb.source_sad_nonrd > kZeroSad)
  ------------------
  |  Branch (637:9): [True: 0, False: 0]
  ------------------
  638|      0|      x->force_color_check_block_level = 1;
  639|      0|    av1_set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize);
  640|  49.1k|  } else if (sf->part_sf.partition_search_type == VAR_BASED_PARTITION) {
  ------------------
  |  Branch (640:14): [True: 49.1k, False: 18.4E]
  ------------------
  641|       |    // set a variance-based partition
  642|  49.1k|    av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  643|  49.1k|    av1_choose_var_based_partitioning(cpi, tile_info, td, x, mi_row, mi_col);
  644|  49.1k|  }
  645|  49.0k|  assert(sf->part_sf.partition_search_type == FIXED_PARTITION || seg_skip ||
  646|  49.0k|         sf->part_sf.partition_search_type == VAR_BASED_PARTITION);
  647|  49.0k|  set_cb_offsets(td->mb.cb_offset, 0, 0);
  648|       |
  649|       |  // Initialize the flag to skip cdef to 1.
  650|  49.0k|  if (sf->rt_sf.skip_cdef_sb) {
  ------------------
  |  Branch (650:7): [True: 0, False: 49.0k]
  ------------------
  651|      0|    const int block64_in_sb = (sb_size == BLOCK_128X128) ? 2 : 1;
  ------------------
  |  Branch (651:31): [True: 0, False: 0]
  ------------------
  652|       |    // If 128x128 block is used, we need to set the flag for all 4 64x64 sub
  653|       |    // "blocks".
  654|      0|    for (int r = 0; r < block64_in_sb; ++r) {
  ------------------
  |  Branch (654:21): [True: 0, False: 0]
  ------------------
  655|      0|      for (int c = 0; c < block64_in_sb; ++c) {
  ------------------
  |  Branch (655:23): [True: 0, False: 0]
  ------------------
  656|      0|        const int idx_in_sb =
  657|      0|            r * MI_SIZE_64X64 * cm->mi_params.mi_stride + c * MI_SIZE_64X64;
  ------------------
  |  |   58|      0|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                          r * MI_SIZE_64X64 * cm->mi_params.mi_stride + c * MI_SIZE_64X64;
  ------------------
  |  |   58|      0|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  658|      0|        if (mi[idx_in_sb]) mi[idx_in_sb]->cdef_strength = 1;
  ------------------
  |  Branch (658:13): [True: 0, False: 0]
  ------------------
  659|      0|      }
  660|      0|    }
  661|      0|  }
  662|       |
  663|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  664|       |  start_timing(cpi, nonrd_use_partition_time);
  665|       |#endif
  666|  49.0k|  av1_nonrd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, sb_size,
  667|  49.0k|                          pc_root);
  668|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  669|       |  end_timing(cpi, nonrd_use_partition_time);
  670|       |#endif
  671|  49.0k|}
encodeframe.c:setup_delta_q_nonrd:
  249|  34.0k|                                       int mi_row, int mi_col, int num_planes) {
  250|  34.0k|  AV1_COMMON *const cm = &cpi->common;
  251|  34.0k|  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
  252|  34.0k|  assert(delta_q_info->delta_q_present_flag);
  253|       |
  254|  34.0k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  255|  34.0k|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, sb_size);
  256|       |
  257|  34.0k|  const int delta_q_res = delta_q_info->delta_q_res;
  258|  34.0k|  int current_qindex = cm->quant_params.base_qindex;
  259|       |
  260|  34.0k|  if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_VARIANCE_BOOST) {
  ------------------
  |  Branch (260:7): [True: 34.0k, False: 0]
  ------------------
  261|  34.0k|    current_qindex = av1_get_sbq_variance_boost(cpi, x);
  262|  34.0k|  }
  263|       |
  264|  34.0k|  x->rdmult_cur_qindex = current_qindex;
  265|  34.0k|  MACROBLOCKD *const xd = &x->e_mbd;
  266|  34.0k|  current_qindex = av1_adjust_q_from_delta_q_res(
  267|  34.0k|      delta_q_res, xd->current_base_qindex, current_qindex);
  268|       |
  269|  34.0k|  x->delta_qindex = current_qindex - cm->quant_params.base_qindex;
  270|  34.0k|  x->rdmult_delta_qindex = x->delta_qindex;
  271|       |
  272|  34.0k|  av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  273|  34.0k|  xd->mi[0]->current_qindex = current_qindex;
  274|  34.0k|  av1_init_plane_quantizers(cpi, x, xd->mi[0]->segment_id, 0);
  275|       |
  276|       |  // keep track of any non-zero delta-q used
  277|  34.0k|  td->deltaq_used |= (x->delta_qindex != 0);
  278|  34.0k|}
encodeframe.c:encode_rd_sb:
  859|  88.3k|                                const int seg_skip) {
  860|  88.3k|  AV1_COMMON *const cm = &cpi->common;
  861|  88.3k|  MACROBLOCK *const x = &td->mb;
  862|  88.3k|  MACROBLOCKD *const xd = &x->e_mbd;
  863|  88.3k|  const SPEED_FEATURES *const sf = &cpi->sf;
  864|  88.3k|  const TileInfo *const tile_info = &tile_data->tile_info;
  865|  88.3k|  MB_MODE_INFO **mi = cm->mi_params.mi_grid_base +
  866|  88.3k|                      get_mi_grid_idx(&cm->mi_params, mi_row, mi_col);
  867|  88.3k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  868|  88.3k|  const int num_planes = av1_num_planes(cm);
  869|  88.3k|  int dummy_rate;
  870|  88.3k|  int64_t dummy_dist;
  871|  88.3k|  RD_STATS dummy_rdc;
  872|  88.3k|  SIMPLE_MOTION_DATA_TREE *const sms_root = td->sms_root;
  873|       |
  874|       |#if CONFIG_REALTIME_ONLY
  875|       |  (void)seg_skip;
  876|       |#endif  // CONFIG_REALTIME_ONLY
  877|       |
  878|  88.3k|  init_encode_rd_sb(cpi, td, tile_data, sms_root, &dummy_rdc, mi_row, mi_col,
  879|  88.3k|                    1);
  880|       |
  881|       |  // Encode the superblock
  882|  88.3k|  if (sf->part_sf.partition_search_type == VAR_BASED_PARTITION) {
  ------------------
  |  Branch (882:7): [True: 0, False: 88.3k]
  ------------------
  883|       |    // partition search starting from a variance-based partition
  884|      0|    av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  885|      0|    av1_choose_var_based_partitioning(cpi, tile_info, td, x, mi_row, mi_col);
  886|       |
  887|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  888|       |    start_timing(cpi, rd_use_partition_time);
  889|       |#endif
  890|      0|    td->pc_root = av1_alloc_pc_tree_node(sb_size);
  891|      0|    if (!td->pc_root)
  ------------------
  |  Branch (891:9): [True: 0, False: 0]
  ------------------
  892|      0|      aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  893|      0|                         "Failed to allocate PC_TREE");
  894|      0|    av1_rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, sb_size,
  895|      0|                         &dummy_rate, &dummy_dist, 1, td->pc_root);
  896|      0|    av1_free_pc_tree_recursive(td->pc_root, num_planes, 0, 0,
  897|      0|                               sf->part_sf.partition_search_type);
  898|      0|    td->pc_root = NULL;
  899|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  900|       |    end_timing(cpi, rd_use_partition_time);
  901|       |#endif
  902|      0|  }
  903|  88.3k|#if !CONFIG_REALTIME_ONLY
  904|  88.3k|  else if (sf->part_sf.partition_search_type == FIXED_PARTITION || seg_skip) {
  ------------------
  |  Branch (904:12): [True: 222, False: 88.1k]
  |  Branch (904:68): [True: 18.4E, False: 88.1k]
  ------------------
  905|       |    // partition search by adjusting a fixed-size partition
  906|      0|    av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  907|      0|    const BLOCK_SIZE bsize =
  908|      0|        seg_skip ? sb_size : sf->part_sf.fixed_partition_size;
  ------------------
  |  Branch (908:9): [True: 0, False: 0]
  ------------------
  909|      0|    av1_set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize);
  910|      0|    td->pc_root = av1_alloc_pc_tree_node(sb_size);
  911|      0|    if (!td->pc_root)
  ------------------
  |  Branch (911:9): [True: 0, False: 0]
  ------------------
  912|      0|      aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  913|      0|                         "Failed to allocate PC_TREE");
  914|      0|    av1_rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, sb_size,
  915|      0|                         &dummy_rate, &dummy_dist, 1, td->pc_root);
  916|      0|    av1_free_pc_tree_recursive(td->pc_root, num_planes, 0, 0,
  917|      0|                               sf->part_sf.partition_search_type);
  918|      0|    td->pc_root = NULL;
  919|  88.3k|  } else {
  920|       |    // The most exhaustive recursive partition search
  921|  88.3k|    SuperBlockEnc *sb_enc = &x->sb_enc;
  922|       |    // No stats for overlay frames. Exclude key frame.
  923|  88.3k|    av1_get_tpl_stats_sb(cpi, sb_size, mi_row, mi_col, sb_enc);
  924|       |
  925|       |    // Reset the tree for simple motion search data
  926|  88.3k|    av1_reset_simple_motion_tree_partition(sms_root, sb_size);
  927|       |
  928|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  929|       |    start_timing(cpi, rd_pick_partition_time);
  930|       |#endif
  931|       |
  932|       |    // Estimate the maximum square partition block size, which will be used
  933|       |    // as the starting block size for partitioning the sb
  934|  88.3k|    set_max_min_partition_size(sb_enc, cpi, x, sf, sb_size, mi_row, mi_col);
  935|       |
  936|       |    // The superblock can be searched only once, or twice consecutively for
  937|       |    // better quality. Note that the meaning of passes here is different from
  938|       |    // the general concept of 1-pass/2-pass encoders.
  939|  88.3k|    const int num_passes =
  940|  88.3k|        cpi->oxcf.unit_test_cfg.sb_multipass_unit_test ? 2 : 1;
  ------------------
  |  Branch (940:9): [True: 0, False: 88.3k]
  ------------------
  941|       |
  942|  88.3k|    if (cpi->oxcf.sb_qp_sweep &&
  ------------------
  |  Branch (942:9): [True: 0, False: 88.3k]
  ------------------
  943|      0|        !(has_no_stats_stage(cpi) && cpi->oxcf.mode == REALTIME &&
  ------------------
  |  Branch (943:11): [True: 0, False: 0]
  |  Branch (943:38): [True: 0, False: 0]
  ------------------
  944|      0|          cpi->oxcf.gf_cfg.lag_in_frames == 0) &&
  ------------------
  |  Branch (944:11): [True: 0, False: 0]
  ------------------
  945|      0|        cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (945:9): [True: 0, False: 0]
  ------------------
  946|      0|      AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|      0|  do {                                                    \
  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |   73|      0|    lval = (expr);                                        \
  |  |   74|      0|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  947|      0|          x->e_mbd.error_info, td->mb.sb_stats_cache,
  948|      0|          (SB_FIRST_PASS_STATS *)aom_malloc(sizeof(*td->mb.sb_stats_cache)));
  949|      0|      av1_backup_sb_state(td->mb.sb_stats_cache, cpi, td, tile_data, mi_row,
  950|      0|                          mi_col);
  951|      0|      assert(x->rdmult_delta_qindex == x->delta_qindex);
  952|       |
  953|      0|      const int best_qp_diff =
  954|      0|          sb_qp_sweep(cpi, td, tile_data, tp, mi_row, mi_col, sb_size, sms_root,
  955|      0|                      td->mb.sb_stats_cache) -
  956|      0|          x->rdmult_delta_qindex;
  957|       |
  958|      0|      sb_qp_sweep_init_quantizers(cpi, td, tile_data, sms_root, &dummy_rdc,
  959|      0|                                  mi_row, mi_col, best_qp_diff);
  960|       |
  961|      0|      const int alloc_mi_idx = get_alloc_mi_idx(&cm->mi_params, mi_row, mi_col);
  962|      0|      const int backup_current_qindex =
  963|      0|          cm->mi_params.mi_alloc[alloc_mi_idx].current_qindex;
  964|       |
  965|      0|      av1_reset_mbmi(&cm->mi_params, sb_size, mi_row, mi_col);
  966|      0|      av1_restore_sb_state(td->mb.sb_stats_cache, cpi, td, tile_data, mi_row,
  967|      0|                           mi_col);
  968|       |
  969|      0|      cm->mi_params.mi_alloc[alloc_mi_idx].current_qindex =
  970|      0|          backup_current_qindex;
  971|      0|      aom_free(td->mb.sb_stats_cache);
  972|      0|      td->mb.sb_stats_cache = NULL;
  973|      0|    }
  974|  88.3k|    if (num_passes == 1) {
  ------------------
  |  Branch (974:9): [True: 88.1k, False: 185]
  ------------------
  975|       |#if CONFIG_PARTITION_SEARCH_ORDER
  976|       |      if (cpi->ext_part_controller.ready && !frame_is_intra_only(cm)) {
  977|       |        av1_reset_part_sf(&cpi->sf.part_sf);
  978|       |        av1_reset_sf_for_ext_part(cpi);
  979|       |        RD_STATS this_rdc;
  980|       |        av1_rd_partition_search(cpi, td, tile_data, tp, sms_root, mi_row,
  981|       |                                mi_col, sb_size, &this_rdc);
  982|       |      } else {
  983|       |        td->pc_root = av1_alloc_pc_tree_node(sb_size);
  984|       |        if (!td->pc_root)
  985|       |          aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  986|       |                             "Failed to allocate PC_TREE");
  987|       |        av1_rd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, sb_size,
  988|       |                              &dummy_rdc, dummy_rdc, td->pc_root, sms_root,
  989|       |                              NULL, SB_SINGLE_PASS, NULL);
  990|       |      }
  991|       |#else
  992|  88.1k|      td->pc_root = av1_alloc_pc_tree_node(sb_size);
  993|  88.1k|      if (!td->pc_root)
  ------------------
  |  Branch (993:11): [True: 0, False: 88.1k]
  ------------------
  994|      0|        aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  995|      0|                           "Failed to allocate PC_TREE");
  996|  88.1k|      av1_rd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, sb_size,
  997|  88.1k|                            &dummy_rdc, dummy_rdc, td->pc_root, sms_root, NULL,
  998|  88.1k|                            SB_SINGLE_PASS, NULL);
  999|  88.1k|#endif  // CONFIG_PARTITION_SEARCH_ORDER
 1000|  88.1k|    } else {
 1001|       |      // First pass
 1002|    185|      AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|    185|  do {                                                    \
  |  |   72|    185|    assert((error_info)->setjmp);                         \
  |  |   73|    185|    lval = (expr);                                        \
  |  |   74|    185|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 185]
  |  |  ------------------
  |  |   75|    185|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|    185|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 185]
  |  |  ------------------
  ------------------
 1003|    185|          x->e_mbd.error_info, td->mb.sb_fp_stats,
 1004|    185|          (SB_FIRST_PASS_STATS *)aom_malloc(sizeof(*td->mb.sb_fp_stats)));
 1005|    185|      av1_backup_sb_state(td->mb.sb_fp_stats, cpi, td, tile_data, mi_row,
 1006|    185|                          mi_col);
 1007|    185|      td->pc_root = av1_alloc_pc_tree_node(sb_size);
 1008|    185|      if (!td->pc_root)
  ------------------
  |  Branch (1008:11): [True: 0, False: 185]
  ------------------
 1009|      0|        aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 1010|      0|                           "Failed to allocate PC_TREE");
 1011|    185|      av1_rd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, sb_size,
 1012|    185|                            &dummy_rdc, dummy_rdc, td->pc_root, sms_root, NULL,
 1013|    185|                            SB_DRY_PASS, NULL);
 1014|       |
 1015|       |      // Second pass
 1016|    185|      init_encode_rd_sb(cpi, td, tile_data, sms_root, &dummy_rdc, mi_row,
 1017|    185|                        mi_col, 0);
 1018|    185|      av1_reset_mbmi(&cm->mi_params, sb_size, mi_row, mi_col);
 1019|    185|      av1_reset_simple_motion_tree_partition(sms_root, sb_size);
 1020|       |
 1021|    185|      av1_restore_sb_state(td->mb.sb_fp_stats, cpi, td, tile_data, mi_row,
 1022|    185|                           mi_col);
 1023|       |
 1024|    185|      td->pc_root = av1_alloc_pc_tree_node(sb_size);
 1025|    185|      if (!td->pc_root)
  ------------------
  |  Branch (1025:11): [True: 0, False: 185]
  ------------------
 1026|      0|        aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 1027|      0|                           "Failed to allocate PC_TREE");
 1028|    185|      av1_rd_pick_partition(cpi, td, tile_data, tp, mi_row, mi_col, sb_size,
 1029|    185|                            &dummy_rdc, dummy_rdc, td->pc_root, sms_root, NULL,
 1030|    185|                            SB_WET_PASS, NULL);
 1031|    185|      aom_free(td->mb.sb_fp_stats);
 1032|    185|      td->mb.sb_fp_stats = NULL;
 1033|    185|    }
 1034|       |
 1035|       |    // Reset to 0 so that it wouldn't be used elsewhere mistakenly.
 1036|  88.3k|    sb_enc->tpl_data_count = 0;
 1037|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1038|       |    end_timing(cpi, rd_pick_partition_time);
 1039|       |#endif
 1040|  88.3k|  }
 1041|  88.3k|#endif  // !CONFIG_REALTIME_ONLY
 1042|       |
 1043|       |  // Update the inter rd model
 1044|       |  // TODO(angiebird): Let inter_mode_rd_model_estimation support multi-tile.
 1045|  88.3k|  if (cpi->sf.inter_sf.inter_mode_rd_model_estimation == 1 &&
  ------------------
  |  Branch (1045:7): [True: 6.05k, False: 82.2k]
  ------------------
 1046|  6.05k|      cm->tiles.cols == 1 && cm->tiles.rows == 1) {
  ------------------
  |  Branch (1046:7): [True: 5.08k, False: 971]
  |  Branch (1046:30): [True: 4.29k, False: 791]
  ------------------
 1047|  4.29k|    av1_inter_mode_data_fit(tile_data, x->rdmult);
 1048|  4.29k|  }
 1049|  88.3k|}
encodeframe.c:init_encode_rd_sb:
  678|  88.3k|                                     int gather_tpl_data) {
  679|  88.3k|  const AV1_COMMON *cm = &cpi->common;
  680|  88.3k|  const TileInfo *tile_info = &tile_data->tile_info;
  681|  88.3k|  MACROBLOCK *x = &td->mb;
  682|       |
  683|  88.3k|  const SPEED_FEATURES *sf = &cpi->sf;
  684|  88.3k|  const int use_simple_motion_search =
  685|  88.3k|      (sf->part_sf.simple_motion_search_split ||
  ------------------
  |  Branch (685:8): [True: 88.3k, False: 0]
  ------------------
  686|      0|       sf->part_sf.simple_motion_search_prune_rect ||
  ------------------
  |  Branch (686:8): [True: 0, False: 0]
  ------------------
  687|      0|       sf->part_sf.simple_motion_search_early_term_none ||
  ------------------
  |  Branch (687:8): [True: 0, False: 0]
  ------------------
  688|      0|       sf->part_sf.ml_early_term_after_part_split_level) &&
  ------------------
  |  Branch (688:8): [True: 0, False: 0]
  ------------------
  689|  88.3k|      !frame_is_intra_only(cm);
  ------------------
  |  Branch (689:7): [True: 71.9k, False: 16.3k]
  ------------------
  690|  88.3k|  if (use_simple_motion_search) {
  ------------------
  |  Branch (690:7): [True: 71.9k, False: 16.3k]
  ------------------
  691|  71.9k|    av1_init_simple_motion_search_mvs_for_sb(cpi, tile_info, x, sms_root,
  692|  71.9k|                                             mi_row, mi_col);
  693|  71.9k|  }
  694|       |
  695|  88.3k|#if !CONFIG_REALTIME_ONLY
  696|  88.3k|  if (!(has_no_stats_stage(cpi) && cpi->oxcf.mode == REALTIME &&
  ------------------
  |  Branch (696:9): [True: 88.3k, False: 18.4E]
  |  Branch (696:36): [True: 0, False: 88.3k]
  ------------------
  697|  88.3k|        cpi->oxcf.gf_cfg.lag_in_frames == 0)) {
  ------------------
  |  Branch (697:9): [True: 0, False: 0]
  ------------------
  698|  88.3k|    init_ref_frame_space(cpi, td, mi_row, mi_col);
  699|  88.3k|    x->sb_energy_level = 0;
  700|  88.3k|    x->part_search_info.cnn_output_valid = 0;
  701|  88.3k|    if (gather_tpl_data) {
  ------------------
  |  Branch (701:9): [True: 88.3k, False: 36]
  ------------------
  702|  88.3k|      if (cpi->cb_delta_rdmult_enabled) {
  ------------------
  |  Branch (702:11): [True: 59.9k, False: 28.3k]
  ------------------
  703|  59.9k|        const int num_planes = av1_num_planes(cm);
  704|  59.9k|        const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  705|  59.9k|        setup_delta_q(cpi, td, x, tile_info, mi_row, mi_col, num_planes);
  706|  59.9k|        av1_tpl_rdmult_setup_sb(cpi, x, sb_size, mi_row, mi_col);
  707|  59.9k|      }
  708|       |
  709|       |      // TODO(jingning): revisit this function.
  710|  88.3k|      if (cpi->oxcf.algo_cfg.enable_tpl_model && (0)) {
  ------------------
  |  Branch (710:11): [True: 16.3k, False: 71.9k]
  |  Branch (710:50): [Folded, False: 16.3k]
  ------------------
  711|      0|        adjust_rdmult_tpl_model(cpi, x, mi_row, mi_col);
  712|      0|      }
  713|  88.3k|    }
  714|  88.3k|  }
  715|       |#else
  716|       |  (void)tile_info;
  717|       |  (void)mi_row;
  718|       |  (void)mi_col;
  719|       |  (void)gather_tpl_data;
  720|       |#endif
  721|       |
  722|  88.3k|  x->reuse_inter_pred = false;
  723|  88.3k|  x->txfm_search_params.mode_eval_type = DEFAULT_EVAL;
  724|  88.3k|  reset_mb_rd_record(x->txfm_search_info.mb_rd_record);
  725|  88.3k|  av1_zero(x->picked_ref_frames_mask);
  ------------------
  |  |   43|  88.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  726|  88.3k|  av1_invalid_rd_stats(rd_cost);
  727|  88.3k|}
encodeframe.c:init_ref_frame_space:
  411|  88.3k|                                 int mi_col) {
  412|  88.3k|  const AV1_COMMON *cm = &cpi->common;
  413|  88.3k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  414|  88.3k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  415|  88.3k|  MACROBLOCK *x = &td->mb;
  416|  88.3k|  const int frame_idx = cpi->gf_frame_index;
  417|  88.3k|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
  418|  88.3k|  const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2;
  419|       |
  420|  88.3k|  av1_zero(x->tpl_keep_ref_frame);
  ------------------
  |  |   43|  88.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  421|       |
  422|  88.3k|  if (!av1_tpl_stats_ready(tpl_data, frame_idx)) return;
  ------------------
  |  Branch (422:7): [True: 88.3k, False: 24]
  ------------------
  423|     24|  if (!is_frame_tpl_eligible(gf_group, cpi->gf_frame_index)) return;
  ------------------
  |  Branch (423:7): [True: 0, False: 24]
  ------------------
  424|     24|  if (cpi->oxcf.q_cfg.aq_mode != NO_AQ) return;
  ------------------
  |  Branch (424:7): [True: 0, False: 24]
  ------------------
  425|       |
  426|     24|  const int is_overlay =
  427|     24|      cpi->ppi->gf_group.update_type[frame_idx] == OVERLAY_UPDATE;
  428|     24|  if (is_overlay) {
  ------------------
  |  Branch (428:7): [True: 0, False: 24]
  ------------------
  429|      0|    memset(x->tpl_keep_ref_frame, 1, sizeof(x->tpl_keep_ref_frame));
  430|      0|    return;
  431|      0|  }
  432|       |
  433|     24|  TplDepFrame *tpl_frame = &tpl_data->tpl_frame[frame_idx];
  434|     24|  TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr;
  435|     24|  const int tpl_stride = tpl_frame->stride;
  436|     24|  int64_t inter_cost[INTER_REFS_PER_FRAME] = { 0 };
  437|     24|  const int step = 1 << block_mis_log2;
  438|     24|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  439|       |
  440|     24|  const int mi_row_end =
  441|     24|      AOMMIN(mi_size_high[sb_size] + mi_row, mi_params->mi_rows);
  ------------------
  |  |   34|     24|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 24]
  |  |  ------------------
  ------------------
  442|     24|  const int mi_cols_sr = av1_pixels_to_mi(cm->superres_upscaled_width);
  443|     24|  const int mi_col_sr =
  444|     24|      coded_to_superres_mi(mi_col, cm->superres_scale_denominator);
  445|     24|  const int mi_col_end_sr =
  446|     24|      AOMMIN(coded_to_superres_mi(mi_col + mi_size_wide[sb_size],
  ------------------
  |  |   34|     24|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 24]
  |  |  ------------------
  ------------------
  447|     24|                                  cm->superres_scale_denominator),
  448|     24|             mi_cols_sr);
  449|     24|  const int row_step = step;
  450|     24|  const int col_step_sr =
  451|     24|      coded_to_superres_mi(step, cm->superres_scale_denominator);
  452|     24|  for (int row = mi_row; row < mi_row_end; row += row_step) {
  ------------------
  |  Branch (452:26): [True: 0, False: 24]
  ------------------
  453|      0|    for (int col = mi_col_sr; col < mi_col_end_sr; col += col_step_sr) {
  ------------------
  |  Branch (453:31): [True: 0, False: 0]
  ------------------
  454|      0|      const TplDepStats *this_stats =
  455|      0|          &tpl_stats[av1_tpl_ptr_pos(row, col, tpl_stride, block_mis_log2)];
  456|      0|      int64_t tpl_pred_error[INTER_REFS_PER_FRAME] = { 0 };
  457|       |      // Find the winner ref frame idx for the current block
  458|      0|      int64_t best_inter_cost = this_stats->pred_error[0];
  459|      0|      int best_rf_idx = 0;
  460|      0|      for (int idx = 1; idx < INTER_REFS_PER_FRAME; ++idx) {
  ------------------
  |  Branch (460:25): [True: 0, False: 0]
  ------------------
  461|      0|        if ((this_stats->pred_error[idx] < best_inter_cost) &&
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            (this_stats->pred_error[idx] != 0)) {
  ------------------
  |  Branch (462:13): [True: 0, False: 0]
  ------------------
  463|      0|          best_inter_cost = this_stats->pred_error[idx];
  464|      0|          best_rf_idx = idx;
  465|      0|        }
  466|      0|      }
  467|       |      // tpl_pred_error is the pred_error reduction of best_ref w.r.t.
  468|       |      // LAST_FRAME.
  469|      0|      tpl_pred_error[best_rf_idx] = this_stats->pred_error[best_rf_idx] -
  470|      0|                                    this_stats->pred_error[LAST_FRAME - 1];
  471|       |
  472|      0|      for (int rf_idx = 1; rf_idx < INTER_REFS_PER_FRAME; ++rf_idx)
  ------------------
  |  Branch (472:28): [True: 0, False: 0]
  ------------------
  473|      0|        inter_cost[rf_idx] += tpl_pred_error[rf_idx];
  474|      0|    }
  475|      0|  }
  476|       |
  477|     24|  int rank_index[INTER_REFS_PER_FRAME - 1];
  478|     24|  for (int idx = 0; idx < INTER_REFS_PER_FRAME - 1; ++idx) {
  ------------------
  |  Branch (478:21): [True: 0, False: 24]
  ------------------
  479|      0|    rank_index[idx] = idx + 1;
  480|      0|    for (int i = idx; i > 0; --i) {
  ------------------
  |  Branch (480:23): [True: 0, False: 0]
  ------------------
  481|      0|      if (inter_cost[rank_index[i - 1]] > inter_cost[rank_index[i]]) {
  ------------------
  |  Branch (481:11): [True: 0, False: 0]
  ------------------
  482|      0|        const int tmp = rank_index[i - 1];
  483|      0|        rank_index[i - 1] = rank_index[i];
  484|      0|        rank_index[i] = tmp;
  485|      0|      }
  486|      0|    }
  487|      0|  }
  488|       |
  489|     24|  x->tpl_keep_ref_frame[INTRA_FRAME] = 1;
  490|     24|  x->tpl_keep_ref_frame[LAST_FRAME] = 1;
  491|       |
  492|     24|  int cutoff_ref = 0;
  493|     24|  for (int idx = 0; idx < INTER_REFS_PER_FRAME - 1; ++idx) {
  ------------------
  |  Branch (493:21): [True: 0, False: 24]
  ------------------
  494|      0|    x->tpl_keep_ref_frame[rank_index[idx] + LAST_FRAME] = 1;
  495|      0|    if (idx > 2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 0]
  ------------------
  496|      0|      if (!cutoff_ref) {
  ------------------
  |  Branch (496:11): [True: 0, False: 0]
  ------------------
  497|       |        // If the predictive coding gains are smaller than the previous more
  498|       |        // relevant frame over certain amount, discard this frame and all the
  499|       |        // frames afterwards.
  500|      0|        if (llabs(inter_cost[rank_index[idx]]) <
  ------------------
  |  Branch (500:13): [True: 0, False: 0]
  ------------------
  501|      0|                llabs(inter_cost[rank_index[idx - 1]]) / 8 ||
  502|      0|            inter_cost[rank_index[idx]] == 0)
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      0|          cutoff_ref = 1;
  504|      0|      }
  505|       |
  506|      0|      if (cutoff_ref) x->tpl_keep_ref_frame[rank_index[idx] + LAST_FRAME] = 0;
  ------------------
  |  Branch (506:11): [True: 0, False: 0]
  ------------------
  507|      0|    }
  508|      0|  }
  509|     24|}
encodeframe.c:setup_delta_q:
  300|  59.9k|                                 int mi_col, int num_planes) {
  301|  59.9k|  AV1_COMMON *const cm = &cpi->common;
  302|  59.9k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  303|  59.9k|  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
  304|       |
  305|  59.9k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  306|  59.9k|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, sb_size);
  307|       |
  308|  59.9k|  const int delta_q_res = delta_q_info->delta_q_res;
  309|  59.9k|  int current_qindex = cm->quant_params.base_qindex;
  310|  59.9k|  const int sb_row = mi_row >> cm->seq_params->mib_size_log2;
  311|  59.9k|  const int sb_col = mi_col >> cm->seq_params->mib_size_log2;
  312|  59.9k|  const int sb_cols =
  313|  59.9k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  59.9k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  314|  59.9k|  const int sb_index = sb_row * sb_cols + sb_col;
  315|  59.9k|  if (cpi->use_ducky_encode && cpi->ducky_encode_info.frame_info.qp_mode ==
  ------------------
  |  Branch (315:7): [True: 0, False: 59.9k]
  |  Branch (315:32): [True: 0, False: 0]
  ------------------
  316|      0|                                   DUCKY_ENCODE_FRAME_MODE_QINDEX) {
  317|      0|    current_qindex =
  318|      0|        cpi->ducky_encode_info.frame_info.superblock_encode_qindex[sb_index];
  319|  59.9k|  } else if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (319:14): [True: 0, False: 59.9k]
  ------------------
  320|      0|             (cpi->ext_ratectrl.funcs.rc_type & AOM_RC_QP) != 0 &&
  ------------------
  |  Branch (320:14): [True: 0, False: 0]
  ------------------
  321|      0|             cpi->ext_ratectrl.funcs.get_encodeframe_decision != NULL &&
  ------------------
  |  Branch (321:14): [True: 0, False: 0]
  ------------------
  322|      0|             cpi->ext_ratectrl.sb_params_list != NULL) {
  ------------------
  |  Branch (322:14): [True: 0, False: 0]
  ------------------
  323|      0|    if (cpi->ext_ratectrl.use_delta_q) {
  ------------------
  |  Branch (323:9): [True: 0, False: 0]
  ------------------
  324|       |      // Only used for per-coding-block RD mult calculation later.
  325|      0|      current_qindex = av1_get_q_for_deltaq_objective(cpi, td, NULL, sb_size,
  326|      0|                                                      mi_row, mi_col);
  327|       |
  328|      0|      const int q_index = cpi->ext_ratectrl.sb_params_list[sb_index].q_index;
  329|      0|      if (q_index != AOM_DEFAULT_Q) {
  ------------------
  |  |  138|      0|#define AOM_DEFAULT_Q -1
  ------------------
  |  Branch (329:11): [True: 0, False: 0]
  ------------------
  330|      0|        current_qindex = q_index;
  331|      0|      }
  332|      0|    }
  333|  59.9k|  } else if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_PERCEPTUAL) {
  ------------------
  |  Branch (333:14): [True: 0, False: 59.9k]
  ------------------
  334|      0|    if (DELTA_Q_PERCEPTUAL_MODULATION == 1) {
  ------------------
  |  |   26|      0|  1  // 0: variance based
  ------------------
  |  Branch (334:9): [True: 0, Folded]
  ------------------
  335|      0|      const int block_wavelet_energy_level =
  336|      0|          av1_block_wavelet_energy_level(cpi, x, sb_size);
  337|      0|      x->sb_energy_level = block_wavelet_energy_level;
  338|      0|      current_qindex = av1_compute_q_from_energy_level_deltaq_mode(
  339|      0|          cpi, block_wavelet_energy_level);
  340|      0|    } else {
  341|      0|      const int block_var_level = av1_log_block_var(cpi, x, sb_size);
  342|      0|      x->sb_energy_level = block_var_level;
  343|      0|      current_qindex =
  344|      0|          av1_compute_q_from_energy_level_deltaq_mode(cpi, block_var_level);
  345|      0|    }
  346|  59.9k|  } else if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_OBJECTIVE &&
  ------------------
  |  Branch (346:14): [True: 0, False: 59.9k]
  ------------------
  347|      0|             cpi->oxcf.algo_cfg.enable_tpl_model) {
  ------------------
  |  Branch (347:14): [True: 0, False: 0]
  ------------------
  348|       |    // Setup deltaq based on tpl stats
  349|      0|    current_qindex =
  350|      0|        av1_get_q_for_deltaq_objective(cpi, td, NULL, sb_size, mi_row, mi_col);
  351|  59.9k|  } else if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_PERCEPTUAL_AI) {
  ------------------
  |  Branch (351:14): [True: 0, False: 59.9k]
  ------------------
  352|      0|    current_qindex = av1_get_sbq_perceptual_ai(cpi, sb_size, mi_row, mi_col);
  353|  59.9k|  } else if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_USER_RATING_BASED) {
  ------------------
  |  Branch (353:14): [True: 0, False: 59.9k]
  ------------------
  354|      0|    current_qindex = av1_get_sbq_user_rating_based(cpi, mi_row, mi_col);
  355|  59.9k|  } else if (cpi->oxcf.q_cfg.enable_hdr_deltaq) {
  ------------------
  |  Branch (355:14): [True: 0, False: 59.9k]
  ------------------
  356|      0|    current_qindex = av1_get_q_for_hdr(cpi, x, sb_size, mi_row, mi_col);
  357|  59.9k|  } else if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_VARIANCE_BOOST) {
  ------------------
  |  Branch (357:14): [True: 59.9k, False: 19]
  ------------------
  358|  59.9k|    current_qindex = av1_get_sbq_variance_boost(cpi, x);
  359|  59.9k|  }
  360|       |
  361|  59.9k|  x->rdmult_cur_qindex = current_qindex;
  362|  59.9k|  MACROBLOCKD *const xd = &x->e_mbd;
  363|  59.9k|  const int adjusted_qindex = av1_adjust_q_from_delta_q_res(
  364|  59.9k|      delta_q_res, xd->current_base_qindex, current_qindex);
  365|  59.9k|  if (cpi->use_ducky_encode) {
  ------------------
  |  Branch (365:7): [True: 0, False: 59.9k]
  ------------------
  366|      0|    assert(adjusted_qindex == current_qindex);
  367|      0|  }
  368|  59.9k|  current_qindex = adjusted_qindex;
  369|       |
  370|  59.9k|  x->delta_qindex = cm->delta_q_info.delta_q_present_flag
  ------------------
  |  Branch (370:21): [True: 59.9k, False: 38]
  ------------------
  371|  59.9k|                        ? current_qindex - cm->quant_params.base_qindex
  372|  59.9k|                        : 0;
  373|  59.9k|  x->rdmult_delta_qindex = current_qindex - cm->quant_params.base_qindex;
  374|       |
  375|  59.9k|  av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
  376|  59.9k|  xd->mi[0]->current_qindex = cm->delta_q_info.delta_q_present_flag
  ------------------
  |  Branch (376:31): [True: 59.9k, False: 18.4E]
  ------------------
  377|  59.9k|                                  ? current_qindex
  378|  18.4E|                                  : cm->quant_params.base_qindex;
  379|  59.9k|  av1_init_plane_quantizers(cpi, x, xd->mi[0]->segment_id, 0);
  380|       |
  381|       |  // keep track of any non-zero delta-q used
  382|  59.9k|  td->deltaq_used |= (x->delta_qindex != 0);
  383|       |
  384|  59.9k|  if (cpi->oxcf.tool_cfg.enable_deltalf_mode &&
  ------------------
  |  Branch (384:7): [True: 0, False: 59.9k]
  ------------------
  385|      0|      cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (385:7): [True: 0, False: 0]
  ------------------
  386|      0|    const int delta_lf_res = delta_q_info->delta_lf_res;
  387|      0|    const int lfmask = ~(delta_lf_res - 1);
  388|      0|    const int delta_lf_from_base =
  389|      0|        ((x->delta_qindex / 4 + delta_lf_res / 2) & lfmask);
  390|      0|    const int8_t delta_lf =
  391|      0|        (int8_t)clamp(delta_lf_from_base, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
                      (int8_t)clamp(delta_lf_from_base, -MAX_LOOP_FILTER, MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  392|      0|    const int frame_lf_count =
  393|      0|        av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
                      av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (393:9): [True: 0, False: 0]
  ------------------
  394|      0|    const int mib_size = cm->seq_params->mib_size;
  395|       |
  396|       |    // pre-set the delta lf for loop filter. Note that this value is set
  397|       |    // before mi is assigned for each block in current superblock
  398|      0|    for (int j = 0; j < AOMMIN(mib_size, mi_params->mi_rows - mi_row); j++) {
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (398:21): [True: 0, False: 0]
  ------------------
  399|      0|      for (int k = 0; k < AOMMIN(mib_size, mi_params->mi_cols - mi_col); k++) {
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (399:23): [True: 0, False: 0]
  ------------------
  400|      0|        const int grid_idx = get_mi_grid_idx(mi_params, mi_row + j, mi_col + k);
  401|      0|        mi_params->mi_alloc[grid_idx].delta_lf_from_base = delta_lf;
  402|      0|        for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) {
  ------------------
  |  Branch (402:29): [True: 0, False: 0]
  ------------------
  403|      0|          mi_params->mi_alloc[grid_idx].delta_lf[lf_id] = delta_lf;
  404|      0|        }
  405|      0|      }
  406|      0|    }
  407|      0|  }
  408|  59.9k|}
encodeframe.c:populate_token_count:
 1484|   126k|                                        TokenExtra *tok) {
 1485|   126k|  const TokenInfo *token_info = &cpi->token_info;
 1486|   126k|  if (!is_token_info_allocated(token_info)) return;
  ------------------
  |  Branch (1486:7): [True: 115k, False: 11.1k]
  ------------------
 1487|       |
 1488|  11.1k|  const AV1_COMMON *cm = &cpi->common;
 1489|  11.1k|  const int num_planes = av1_num_planes(cm);
 1490|  11.1k|  TokenList *const tplist = token_info->tplist[tile_row][tile_col];
 1491|  11.1k|  const int sb_row_in_tile =
 1492|  11.1k|      (mi_row - tile_info->mi_row_start) >> cm->seq_params->mib_size_log2;
 1493|  11.1k|  const int tile_mb_cols =
 1494|  11.1k|      (tile_info->mi_col_end - tile_info->mi_col_start + 2) >> 2;
 1495|  11.1k|  const int num_mb_rows_in_sb =
 1496|  11.1k|      ((1 << (cm->seq_params->mib_size_log2 + MI_SIZE_LOG2)) + 8) >> 4;
  ------------------
  |  |   39|  11.1k|#define MI_SIZE_LOG2 2
  ------------------
 1497|  11.1k|  tplist[sb_row_in_tile].count =
 1498|  11.1k|      (unsigned int)(tok - tplist[sb_row_in_tile].start);
 1499|       |
 1500|  11.1k|  assert((unsigned int)(tok - tplist[sb_row_in_tile].start) <=
 1501|  11.1k|         get_token_alloc(num_mb_rows_in_sb, tile_mb_cols,
 1502|  11.1k|                         cm->seq_params->mib_size_log2 + MI_SIZE_LOG2,
 1503|  11.1k|                         num_planes));
 1504|       |
 1505|  11.1k|  (void)num_planes;
 1506|  11.1k|  (void)tile_mb_cols;
 1507|  11.1k|  (void)num_mb_rows_in_sb;
 1508|  11.1k|}
encodeframe.c:set_rel_frame_dist:
 1611|  73.6k|    const int ref_frame_flags) {
 1612|  73.6k|  MV_REFERENCE_FRAME ref_frame;
 1613|  73.6k|  int min_past_dist = INT32_MAX, min_future_dist = INT32_MAX;
 1614|  73.6k|  ref_frame_dist_info->nearest_past_ref = NONE_FRAME;
 1615|  73.6k|  ref_frame_dist_info->nearest_future_ref = NONE_FRAME;
 1616|   588k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (1616:32): [True: 515k, False: 73.6k]
  ------------------
 1617|   515k|    ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME] = 0;
 1618|   515k|    if (ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
  ------------------
  |  Branch (1618:9): [True: 73.6k, False: 441k]
  ------------------
 1619|  73.6k|      int dist = av1_encoder_get_relative_dist(
 1620|  73.6k|          cm->cur_frame->ref_display_order_hint[ref_frame - LAST_FRAME],
 1621|  73.6k|          cm->current_frame.display_order_hint);
 1622|  73.6k|      ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME] = dist;
 1623|       |      // Get the nearest ref_frame in the past
 1624|  73.6k|      if (abs(dist) < min_past_dist && dist < 0) {
  ------------------
  |  Branch (1624:11): [True: 73.6k, False: 0]
  |  Branch (1624:40): [True: 55.2k, False: 18.4k]
  ------------------
 1625|  55.2k|        ref_frame_dist_info->nearest_past_ref = ref_frame;
 1626|  55.2k|        min_past_dist = abs(dist);
 1627|  55.2k|      }
 1628|       |      // Get the nearest ref_frame in the future
 1629|  73.6k|      if (dist < min_future_dist && dist > 0) {
  ------------------
  |  Branch (1629:11): [True: 73.6k, False: 0]
  |  Branch (1629:37): [True: 0, False: 73.6k]
  ------------------
 1630|      0|        ref_frame_dist_info->nearest_future_ref = ref_frame;
 1631|      0|        min_future_dist = dist;
 1632|      0|      }
 1633|  73.6k|    }
 1634|   515k|  }
 1635|  73.6k|}
encodeframe.c:encode_frame_internal:
 2176|  73.6k|static inline void encode_frame_internal(AV1_COMP *cpi) {
 2177|  73.6k|  ThreadData *const td = &cpi->td;
 2178|  73.6k|  MACROBLOCK *const x = &td->mb;
 2179|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 2180|  73.6k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
 2181|  73.6k|  FeatureFlags *const features = &cm->features;
 2182|  73.6k|  MACROBLOCKD *const xd = &x->e_mbd;
 2183|  73.6k|  RD_COUNTS *const rdc = &cpi->td.rd_counts;
 2184|       |#if CONFIG_FPMT_TEST
 2185|       |  FrameProbInfo *const temp_frame_probs = &cpi->ppi->temp_frame_probs;
 2186|       |  FrameProbInfo *const temp_frame_probs_simulation =
 2187|       |      &cpi->ppi->temp_frame_probs_simulation;
 2188|       |#endif
 2189|  73.6k|  FrameProbInfo *const frame_probs = &cpi->ppi->frame_probs;
 2190|  73.6k|  IntraBCHashInfo *const intrabc_hash_info = &x->intrabc_hash_info;
 2191|  73.6k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 2192|  73.6k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &mt_info->enc_row_mt;
 2193|  73.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2194|  73.6k|  const DELTAQ_MODE deltaq_mode = oxcf->q_cfg.deltaq_mode;
 2195|  73.6k|  int i;
 2196|       |
 2197|  73.6k|  if (!cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (2197:7): [True: 49.2k, False: 24.4k]
  ------------------
 2198|  49.2k|    mi_params->setup_mi(mi_params);
 2199|  49.2k|  }
 2200|       |
 2201|  73.6k|  set_mi_offsets(mi_params, xd, 0, 0);
 2202|       |
 2203|  73.6k|  av1_zero(*td->counts);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2204|  73.6k|  av1_zero(rdc->tx_type_used);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2205|  73.6k|  av1_zero(rdc->obmc_used);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2206|  73.6k|  av1_zero(rdc->warped_used);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2207|  73.6k|  av1_zero(rdc->seg_tmp_pred_cost);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2208|       |
 2209|       |  // Reset the flag.
 2210|  73.6k|  cpi->intrabc_used = 0;
 2211|       |  // Need to disable intrabc when superres is selected
 2212|  73.6k|  if (av1_superres_scaled(cm)) {
  ------------------
  |  Branch (2212:7): [True: 0, False: 73.6k]
  ------------------
 2213|      0|    features->allow_intrabc = 0;
 2214|      0|  }
 2215|       |
 2216|  73.6k|  features->allow_intrabc &= (oxcf->kf_cfg.enable_intrabc);
 2217|       |
 2218|  73.6k|  if (features->allow_warped_motion &&
  ------------------
  |  Branch (2218:7): [True: 55.2k, False: 18.4k]
  ------------------
 2219|  55.2k|      cpi->sf.inter_sf.prune_warped_prob_thresh > 0) {
  ------------------
  |  Branch (2219:7): [True: 18.3k, False: 36.9k]
  ------------------
 2220|  18.3k|    const FRAME_UPDATE_TYPE update_type =
 2221|  18.3k|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 2222|  18.3k|    int warped_probability =
 2223|       |#if CONFIG_FPMT_TEST
 2224|       |        cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE
 2225|       |            ? temp_frame_probs->warped_probs[update_type]
 2226|       |            :
 2227|       |#endif  // CONFIG_FPMT_TEST
 2228|  18.3k|            frame_probs->warped_probs[update_type];
 2229|  18.3k|    if (warped_probability < cpi->sf.inter_sf.prune_warped_prob_thresh)
  ------------------
  |  Branch (2229:9): [True: 0, False: 18.3k]
  ------------------
 2230|      0|      features->allow_warped_motion = 0;
 2231|  18.3k|  }
 2232|       |
 2233|  73.6k|  int hash_table_created = 0;
 2234|  73.6k|  if (!is_stat_generation_stage(cpi) && av1_use_hash_me(cpi) &&
  ------------------
  |  Branch (2234:7): [True: 73.6k, False: 0]
  |  Branch (2234:41): [True: 1.98k, False: 71.6k]
  ------------------
 2235|  1.98k|      (!cpi->sf.rt_sf.use_nonrd_pick_mode || cpi->sf.rt_sf.rt_use_intrabc)) {
  ------------------
  |  Branch (2235:8): [True: 1.98k, False: 0]
  |  Branch (2235:46): [True: 0, False: 0]
  ------------------
 2236|       |    // TODO(any): move this outside of the recoding loop to avoid recalculating
 2237|       |    // the hash table.
 2238|       |    // add to hash table
 2239|  1.98k|    const int pic_width = cpi->source->y_crop_width;
 2240|  1.98k|    const int pic_height = cpi->source->y_crop_height;
 2241|  1.98k|    uint32_t *block_hash_values[2] = { NULL };  // two buffers used ping-pong
 2242|  1.98k|    bool error = false;
 2243|       |
 2244|  5.94k|    for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (2244:21): [True: 3.96k, False: 1.98k]
  ------------------
 2245|  3.96k|      block_hash_values[j] = (uint32_t *)aom_malloc(
 2246|  3.96k|          sizeof(*block_hash_values[j]) * pic_width * pic_height);
 2247|  3.96k|      if (!block_hash_values[j]) {
  ------------------
  |  Branch (2247:11): [True: 0, False: 3.96k]
  ------------------
 2248|      0|        error = true;
 2249|      0|        break;
 2250|      0|      }
 2251|  3.96k|    }
 2252|       |
 2253|  1.98k|    av1_hash_table_init(intrabc_hash_info);
 2254|  1.98k|    if (error ||
  ------------------
  |  Branch (2254:9): [True: 0, False: 1.98k]
  ------------------
 2255|  1.98k|        !av1_hash_table_create(&intrabc_hash_info->intrabc_hash_table)) {
  ------------------
  |  Branch (2255:9): [True: 0, False: 1.98k]
  ------------------
 2256|      0|      free_block_hash_buffers(block_hash_values);
 2257|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2258|      0|                         "Error allocating intrabc_hash_table and buffers");
 2259|      0|    }
 2260|  1.98k|    hash_table_created = 1;
 2261|  1.98k|    av1_generate_block_2x2_hash_value(cpi->source, block_hash_values[0]);
 2262|       |    // Hash data generated for screen contents is used for intraBC ME
 2263|  1.98k|    const int min_alloc_size = block_size_wide[mi_params->mi_alloc_bsize];
 2264|  1.98k|    int max_sb_size = (1 << (cm->seq_params->mib_size_log2 + MI_SIZE_LOG2));
  ------------------
  |  |   39|  1.98k|#define MI_SIZE_LOG2 2
  ------------------
 2265|       |
 2266|  1.98k|    if (cpi->sf.mv_sf.hash_max_8x8_intrabc_blocks) {
  ------------------
  |  Branch (2266:9): [True: 0, False: 1.98k]
  ------------------
 2267|      0|      max_sb_size = AOMMIN(8, max_sb_size);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2268|      0|    }
 2269|       |
 2270|  1.98k|    int src_idx = 0;
 2271|  11.8k|    for (int size = 4; size <= max_sb_size; size *= 2, src_idx = !src_idx) {
  ------------------
  |  Branch (2271:24): [True: 9.90k, False: 1.98k]
  ------------------
 2272|  9.90k|      const int dst_idx = !src_idx;
 2273|  9.90k|      av1_generate_block_hash_value(intrabc_hash_info, cpi->source, size,
 2274|  9.90k|                                    block_hash_values[src_idx],
 2275|  9.90k|                                    block_hash_values[dst_idx]);
 2276|  9.90k|      if (size >= min_alloc_size &&
  ------------------
  |  Branch (2276:11): [True: 9.90k, False: 0]
  ------------------
 2277|  9.90k|          !av1_add_to_hash_map_by_row_with_precal_data(
  ------------------
  |  Branch (2277:11): [True: 0, False: 9.90k]
  ------------------
 2278|  9.90k|              &intrabc_hash_info->intrabc_hash_table,
 2279|  9.90k|              block_hash_values[dst_idx], pic_width, pic_height, size)) {
 2280|      0|        error = true;
 2281|      0|        break;
 2282|      0|      }
 2283|  9.90k|    }
 2284|       |
 2285|  1.98k|    free_block_hash_buffers(block_hash_values);
 2286|       |
 2287|  1.98k|    if (error) {
  ------------------
  |  Branch (2287:9): [True: 0, False: 1.98k]
  ------------------
 2288|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2289|      0|                         "Error adding data to intrabc_hash_table");
 2290|      0|    }
 2291|  1.98k|  }
 2292|       |
 2293|  73.6k|  const CommonQuantParams *quant_params = &cm->quant_params;
 2294|   662k|  for (i = 0; i < MAX_SEGMENTS; ++i) {
  ------------------
  |  |   23|   662k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (2294:15): [True: 588k, False: 73.6k]
  ------------------
 2295|   588k|    const int qindex =
 2296|   588k|        cm->seg.enabled ? av1_get_qindex(&cm->seg, i, quant_params->base_qindex)
  ------------------
  |  Branch (2296:9): [True: 0, False: 588k]
  ------------------
 2297|   588k|                        : quant_params->base_qindex;
 2298|   588k|    xd->lossless[i] =
 2299|   588k|        qindex == 0 && quant_params->y_dc_delta_q == 0 &&
  ------------------
  |  Branch (2299:9): [True: 27.2k, False: 561k]
  |  Branch (2299:24): [True: 27.2k, False: 0]
  ------------------
 2300|  27.2k|        quant_params->u_dc_delta_q == 0 && quant_params->u_ac_delta_q == 0 &&
  ------------------
  |  Branch (2300:9): [True: 27.2k, False: 0]
  |  Branch (2300:44): [True: 27.2k, False: 0]
  ------------------
 2301|  27.2k|        quant_params->v_dc_delta_q == 0 && quant_params->v_ac_delta_q == 0;
  ------------------
  |  Branch (2301:9): [True: 27.2k, False: 0]
  |  Branch (2301:44): [True: 27.2k, False: 0]
  ------------------
 2302|   588k|    if (xd->lossless[i]) cpi->enc_seg.has_lossless_segment = 1;
  ------------------
  |  Branch (2302:9): [True: 27.2k, False: 561k]
  ------------------
 2303|   588k|    xd->qindex[i] = qindex;
 2304|   588k|    if (xd->lossless[i]) {
  ------------------
  |  Branch (2304:9): [True: 27.2k, False: 561k]
  ------------------
 2305|  27.2k|      cpi->optimize_seg_arr[i] = NO_TRELLIS_OPT;
 2306|   561k|    } else {
 2307|   561k|      cpi->optimize_seg_arr[i] = cpi->sf.rd_sf.optimize_coefficients;
 2308|   561k|    }
 2309|   588k|  }
 2310|  73.6k|  features->coded_lossless = is_coded_lossless(cm, xd);
 2311|  73.6k|  features->all_lossless = features->coded_lossless && !av1_superres_scaled(cm);
  ------------------
  |  Branch (2311:28): [True: 3.40k, False: 70.2k]
  |  Branch (2311:56): [True: 3.40k, False: 0]
  ------------------
 2312|       |
 2313|       |  // Fix delta q resolution for the moment
 2314|       |
 2315|  73.6k|  cm->delta_q_info.delta_q_res = 0;
 2316|  73.6k|  if (cpi->use_ducky_encode) {
  ------------------
  |  Branch (2316:7): [True: 0, False: 73.6k]
  ------------------
 2317|      0|    cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_DUCKY_ENCODE;
  ------------------
  |  |  501|      0|#define DEFAULT_DELTA_Q_RES_DUCKY_ENCODE 4
  ------------------
 2318|  73.6k|  } else if (cpi->oxcf.q_cfg.aq_mode != CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (2318:14): [True: 73.6k, False: 0]
  ------------------
 2319|  73.6k|             !cpi->roi.enabled) {
  ------------------
  |  Branch (2319:14): [True: 73.6k, False: 0]
  ------------------
 2320|  73.6k|    if (deltaq_mode == DELTA_Q_OBJECTIVE)
  ------------------
  |  Branch (2320:9): [True: 21.2k, False: 52.3k]
  ------------------
 2321|  21.2k|      cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_OBJECTIVE;
  ------------------
  |  |  500|  21.2k|#define DEFAULT_DELTA_Q_RES_OBJECTIVE 4
  ------------------
 2322|  52.3k|    else if (deltaq_mode == DELTA_Q_PERCEPTUAL)
  ------------------
  |  Branch (2322:14): [True: 0, False: 52.3k]
  ------------------
 2323|      0|      cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_PERCEPTUAL;
  ------------------
  |  |  499|      0|#define DEFAULT_DELTA_Q_RES_PERCEPTUAL 4
  ------------------
 2324|  52.3k|    else if (deltaq_mode == DELTA_Q_PERCEPTUAL_AI)
  ------------------
  |  Branch (2324:14): [True: 0, False: 52.3k]
  ------------------
 2325|      0|      cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_PERCEPTUAL;
  ------------------
  |  |  499|      0|#define DEFAULT_DELTA_Q_RES_PERCEPTUAL 4
  ------------------
 2326|  52.3k|    else if (deltaq_mode == DELTA_Q_USER_RATING_BASED)
  ------------------
  |  Branch (2326:14): [True: 0, False: 52.3k]
  ------------------
 2327|      0|      cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_PERCEPTUAL;
  ------------------
  |  |  499|      0|#define DEFAULT_DELTA_Q_RES_PERCEPTUAL 4
  ------------------
 2328|  52.3k|    else if (deltaq_mode == DELTA_Q_HDR)
  ------------------
  |  Branch (2328:14): [True: 0, False: 52.3k]
  ------------------
 2329|      0|      cm->delta_q_info.delta_q_res = DEFAULT_DELTA_Q_RES_PERCEPTUAL;
  ------------------
  |  |  499|      0|#define DEFAULT_DELTA_Q_RES_PERCEPTUAL 4
  ------------------
 2330|  52.3k|    else if (deltaq_mode == DELTA_Q_VARIANCE_BOOST)
  ------------------
  |  Branch (2330:14): [True: 52.3k, False: 0]
  ------------------
 2331|  52.3k|      cm->delta_q_info.delta_q_res =
 2332|  52.3k|          aom_get_variance_boost_delta_q_res(quant_params->base_qindex);
 2333|       |    // Set delta_q_present_flag before it is used for the first time
 2334|  73.6k|    cm->delta_q_info.delta_lf_res = DEFAULT_DELTA_LF_RES;
  ------------------
  |  |  505|  73.6k|#define DEFAULT_DELTA_LF_RES 2
  ------------------
 2335|  73.6k|    cm->delta_q_info.delta_q_present_flag = deltaq_mode != NO_DELTA_Q;
 2336|       |
 2337|       |    // Turn off cm->delta_q_info.delta_q_present_flag if objective delta_q
 2338|       |    // is used for ineligible frames. That effectively will turn off row_mt
 2339|       |    // usage. Note objective delta_q and tpl eligible frames are only altref
 2340|       |    // frames currently.
 2341|  73.6k|    if (cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (2341:9): [True: 73.6k, False: 0]
  ------------------
 2342|  73.6k|      if (deltaq_mode == DELTA_Q_OBJECTIVE && !enable_delta_q(cpi))
  ------------------
  |  Branch (2342:11): [True: 21.2k, False: 52.3k]
  |  Branch (2342:47): [True: 13.5k, False: 7.70k]
  ------------------
 2343|  13.5k|        cm->delta_q_info.delta_q_present_flag = 0;
 2344|       |
 2345|  73.6k|      if (deltaq_mode == DELTA_Q_OBJECTIVE &&
  ------------------
  |  Branch (2345:11): [True: 21.2k, False: 52.3k]
  ------------------
 2346|  21.2k|          cm->delta_q_info.delta_q_present_flag) {
  ------------------
  |  Branch (2346:11): [True: 7.70k, False: 13.5k]
  ------------------
 2347|  7.70k|        cm->delta_q_info.delta_q_present_flag &= allow_deltaq_mode(cpi);
 2348|  7.70k|      }
 2349|  73.6k|    }
 2350|       |
 2351|       |    // Reset delta_q_used flag
 2352|  73.6k|    cpi->deltaq_used = 0;
 2353|       |
 2354|  73.6k|    cm->delta_q_info.delta_lf_present_flag =
 2355|  73.6k|        cm->delta_q_info.delta_q_present_flag &&
  ------------------
  |  Branch (2355:9): [True: 52.3k, False: 21.2k]
  ------------------
 2356|  52.3k|        oxcf->tool_cfg.enable_deltalf_mode;
  ------------------
  |  Branch (2356:9): [True: 0, False: 52.3k]
  ------------------
 2357|  73.6k|    cm->delta_q_info.delta_lf_multi = DEFAULT_DELTA_LF_MULTI;
  ------------------
  |  |   73|  73.6k|#define DEFAULT_DELTA_LF_MULTI 0
  ------------------
 2358|       |
 2359|       |    // update delta_q_present_flag and delta_lf_present_flag based on
 2360|       |    // base_qindex
 2361|  73.6k|    cm->delta_q_info.delta_q_present_flag &= quant_params->base_qindex > 0;
 2362|  73.6k|    cm->delta_q_info.delta_lf_present_flag &= quant_params->base_qindex > 0;
 2363|  73.6k|  } else if (cpi->cyclic_refresh->apply_cyclic_refresh ||
  ------------------
  |  Branch (2363:14): [True: 0, False: 0]
  ------------------
 2364|      0|             cpi->svc.number_temporal_layers == 1) {
  ------------------
  |  Branch (2364:14): [True: 0, False: 0]
  ------------------
 2365|      0|    cpi->cyclic_refresh->actual_num_seg1_blocks = 0;
 2366|      0|    cpi->cyclic_refresh->actual_num_seg2_blocks = 0;
 2367|      0|  }
 2368|  73.6k|  cpi->rc.cnt_zeromv = 0;
 2369|  73.6k|  cpi->cb_delta_rdmult_enabled = enable_delta_rdmult(cpi);
 2370|       |
 2371|  73.6k|  av1_frame_init_quantizer(cpi);
 2372|  73.6k|  init_encode_frame_mb_context(cpi);
 2373|  73.6k|  set_default_interp_skip_flags(cm, &cpi->interp_search_flags);
 2374|       |
 2375|  73.6k|  if (cm->prev_frame && cm->prev_frame->seg.enabled &&
  ------------------
  |  Branch (2375:7): [True: 30.6k, False: 43.0k]
  |  Branch (2375:25): [True: 0, False: 30.6k]
  ------------------
 2376|      0|      cpi->svc.number_spatial_layers == 1)
  ------------------
  |  Branch (2376:7): [True: 0, False: 0]
  ------------------
 2377|      0|    cm->last_frame_seg_map = cm->prev_frame->seg_map;
 2378|  73.6k|  else
 2379|  73.6k|    cm->last_frame_seg_map = NULL;
 2380|  73.6k|  if (features->allow_intrabc || features->coded_lossless) {
  ------------------
  |  Branch (2380:7): [True: 1.98k, False: 71.6k]
  |  Branch (2380:34): [True: 3.40k, False: 68.2k]
  ------------------
 2381|  5.38k|    av1_set_default_ref_deltas(cm->lf.ref_deltas);
 2382|  5.38k|    av1_set_default_mode_deltas(cm->lf.mode_deltas);
 2383|  68.2k|  } else if (cm->prev_frame) {
  ------------------
  |  Branch (2383:14): [True: 29.3k, False: 38.9k]
  ------------------
 2384|  29.3k|    memcpy(cm->lf.ref_deltas, cm->prev_frame->ref_deltas, REF_FRAMES);
 2385|  29.3k|    memcpy(cm->lf.mode_deltas, cm->prev_frame->mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|  29.3k|#define MAX_MODE_LF_DELTAS 2
  ------------------
 2386|  29.3k|  }
 2387|  73.6k|  cm->lf.mode_ref_delta_enabled = oxcf->algo_cfg.mode_ref_delta_enabled;
 2388|  73.6k|  memcpy(cm->cur_frame->ref_deltas, cm->lf.ref_deltas, REF_FRAMES);
 2389|  73.6k|  memcpy(cm->cur_frame->mode_deltas, cm->lf.mode_deltas, MAX_MODE_LF_DELTAS);
  ------------------
  |  |   74|  73.6k|#define MAX_MODE_LF_DELTAS 2
  ------------------
 2390|       |
 2391|  73.6k|  cpi->all_one_sided_refs =
 2392|  73.6k|      frame_is_intra_only(cm) ? 0 : refs_are_one_sided(cm);
  ------------------
  |  Branch (2392:7): [True: 18.4k, False: 55.2k]
  ------------------
 2393|       |
 2394|  73.6k|  cpi->prune_ref_frame_mask = 0;
 2395|       |  // Figure out which ref frames can be skipped at frame level.
 2396|  73.6k|  setup_prune_ref_frame_mask(cpi);
 2397|       |  // Disable certain reference frame pruning based on temporal distance and
 2398|       |  // quality of that reference frame.
 2399|  73.6k|  setup_keep_ref_frame_mask(cpi);
 2400|       |
 2401|  73.6k|  x->txfm_search_info.txb_split_count = 0;
 2402|       |#if CONFIG_SPEED_STATS
 2403|       |  x->txfm_search_info.tx_search_count = 0;
 2404|       |#endif  // CONFIG_SPEED_STATS
 2405|       |
 2406|  73.6k|#if !CONFIG_REALTIME_ONLY
 2407|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2408|       |  start_timing(cpi, av1_compute_global_motion_time);
 2409|       |#endif
 2410|  73.6k|  av1_compute_global_motion_facade(cpi);
 2411|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2412|       |  end_timing(cpi, av1_compute_global_motion_time);
 2413|       |#endif
 2414|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 2415|       |
 2416|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2417|       |  start_timing(cpi, av1_setup_motion_field_time);
 2418|       |#endif
 2419|  73.6k|  av1_calculate_ref_frame_side(cm);
 2420|       |
 2421|  73.6k|  features->allow_ref_frame_mvs &= !(cpi->sf.hl_sf.ref_frame_mvs_lvl == 2);
 2422|  73.6k|  if (features->allow_ref_frame_mvs) av1_setup_motion_field(cm);
  ------------------
  |  Branch (2422:7): [True: 55.2k, False: 18.4k]
  ------------------
 2423|  73.6k|#if !CONFIG_REALTIME_ONLY
 2424|  73.6k|  check_to_disable_ref_frame_mvs(cpi);
 2425|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 2426|       |
 2427|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2428|       |  end_timing(cpi, av1_setup_motion_field_time);
 2429|       |#endif
 2430|       |
 2431|  73.6k|  cm->current_frame.skip_mode_info.skip_mode_flag =
 2432|  73.6k|      check_skip_mode_enabled(cpi);
 2433|       |
 2434|       |  // Initialization of skip mode cost depends on the value of
 2435|       |  // 'skip_mode_flag'. This initialization happens in the function
 2436|       |  // av1_fill_mode_rates(), which is in turn called in
 2437|       |  // av1_initialize_rd_consts(). Thus, av1_initialize_rd_consts()
 2438|       |  // has to be called after 'skip_mode_flag' is initialized.
 2439|  73.6k|  av1_initialize_rd_consts(cpi);
 2440|  73.6k|  av1_set_sad_per_bit(cpi, &x->sadperbit, quant_params->base_qindex);
 2441|  73.6k|  populate_thresh_to_force_zeromv_skip(cpi);
 2442|       |
 2443|  73.6k|  enc_row_mt->sync_read_ptr = av1_row_mt_sync_read_dummy;
 2444|  73.6k|  enc_row_mt->sync_write_ptr = av1_row_mt_sync_write_dummy;
 2445|  73.6k|  mt_info->row_mt_enabled = 0;
 2446|  73.6k|  mt_info->pack_bs_mt_enabled = AOMMIN(mt_info->num_mod_workers[MOD_PACK_BS],
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 24.8k, False: 48.8k]
  |  |  ------------------
  ------------------
 2447|  73.6k|                                       cm->tiles.cols * cm->tiles.rows) > 1;
 2448|       |
 2449|  73.6k|  if (oxcf->row_mt && (mt_info->num_workers > 1)) {
  ------------------
  |  Branch (2449:7): [True: 73.6k, False: 0]
  |  Branch (2449:23): [True: 56.0k, False: 17.5k]
  ------------------
 2450|  56.0k|    mt_info->row_mt_enabled = 1;
 2451|  56.0k|    enc_row_mt->sync_read_ptr = av1_row_mt_sync_read;
 2452|  56.0k|    enc_row_mt->sync_write_ptr = av1_row_mt_sync_write;
 2453|  56.0k|    av1_encode_tiles_row_mt(cpi);
 2454|  56.0k|  } else {
 2455|  17.5k|    if (AOMMIN(mt_info->num_workers, cm->tiles.cols * cm->tiles.rows) > 1) {
  ------------------
  |  |   34|  17.5k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 17.5k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2455:9): [True: 0, False: 17.5k]
  ------------------
 2456|      0|      av1_encode_tiles_mt(cpi);
 2457|  17.5k|    } else {
 2458|       |      // Preallocate the pc_tree for realtime coding to reduce the cost of
 2459|       |      // memory allocation.
 2460|  17.5k|      const int use_nonrd_mode = cpi->sf.rt_sf.use_nonrd_pick_mode;
 2461|  17.5k|      if (use_nonrd_mode) {
  ------------------
  |  Branch (2461:11): [True: 5.49k, False: 12.0k]
  ------------------
 2462|  5.49k|        td->pc_root = av1_alloc_pc_tree_node(cm->seq_params->sb_size);
 2463|  5.49k|        if (!td->pc_root)
  ------------------
  |  Branch (2463:13): [True: 0, False: 5.49k]
  ------------------
 2464|      0|          aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 2465|      0|                             "Failed to allocate PC_TREE");
 2466|  12.0k|      } else {
 2467|  12.0k|        td->pc_root = NULL;
 2468|  12.0k|      }
 2469|       |
 2470|  17.5k|      encode_tiles(cpi);
 2471|  17.5k|      av1_free_pc_tree_recursive(td->pc_root, av1_num_planes(cm), 0, 0,
 2472|  17.5k|                                 cpi->sf.part_sf.partition_search_type);
 2473|  17.5k|      td->pc_root = NULL;
 2474|  17.5k|    }
 2475|  17.5k|  }
 2476|       |
 2477|       |  // If intrabc is allowed but never selected, reset the allow_intrabc flag.
 2478|  73.6k|  if (features->allow_intrabc && !cpi->intrabc_used) {
  ------------------
  |  Branch (2478:7): [True: 1.98k, False: 71.6k]
  |  Branch (2478:34): [True: 1.98k, False: 0]
  ------------------
 2479|  1.98k|    features->allow_intrabc = 0;
 2480|  1.98k|  }
 2481|  73.6k|  if (features->allow_intrabc) {
  ------------------
  |  Branch (2481:7): [True: 0, False: 73.6k]
  ------------------
 2482|      0|    cm->delta_q_info.delta_lf_present_flag = 0;
 2483|      0|  }
 2484|       |
 2485|  73.6k|  if (cm->delta_q_info.delta_q_present_flag && cpi->deltaq_used == 0) {
  ------------------
  |  Branch (2485:7): [True: 52.1k, False: 21.4k]
  |  Branch (2485:48): [True: 20.9k, False: 31.1k]
  ------------------
 2486|  20.9k|    cm->delta_q_info.delta_q_present_flag = 0;
 2487|  20.9k|  }
 2488|       |
 2489|       |  // Set the transform size appropriately before bitstream creation
 2490|  73.6k|  const MODE_EVAL_TYPE eval_type =
 2491|  73.6k|      cpi->sf.winner_mode_sf.enable_winner_mode_for_tx_size_srch
  ------------------
  |  Branch (2491:7): [True: 73.6k, False: 0]
  ------------------
 2492|  73.6k|          ? WINNER_MODE_EVAL
 2493|  73.6k|          : DEFAULT_EVAL;
 2494|  73.6k|  const TX_SIZE_SEARCH_METHOD tx_search_type =
 2495|  73.6k|      cpi->winner_mode_params.tx_size_search_methods[eval_type];
 2496|  73.6k|  assert(oxcf->txfm_cfg.enable_tx64 || tx_search_type != USE_LARGESTALL);
 2497|  73.6k|  features->tx_mode = select_tx_mode(cm, tx_search_type);
 2498|       |
 2499|       |  // Retain the frame level probability update conditions for parallel frames.
 2500|       |  // These conditions will be consumed during postencode stage to update the
 2501|       |  // probability.
 2502|  73.6k|  if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (2502:7): [True: 0, False: 73.6k]
  ------------------
 2503|      0|    cpi->do_update_frame_probs_txtype[cpi->num_frame_recode] =
 2504|      0|        cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats;
 2505|      0|    cpi->do_update_frame_probs_obmc[cpi->num_frame_recode] =
 2506|      0|        (cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  ------------------
  |  Branch (2506:10): [True: 0, False: 0]
  ------------------
 2507|      0|         cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX);
  ------------------
  |  Branch (2507:10): [True: 0, False: 0]
  ------------------
 2508|      0|    cpi->do_update_frame_probs_warp[cpi->num_frame_recode] =
 2509|      0|        (features->allow_warped_motion &&
  ------------------
  |  Branch (2509:10): [True: 0, False: 0]
  ------------------
 2510|      0|         cpi->sf.inter_sf.prune_warped_prob_thresh > 0);
  ------------------
  |  Branch (2510:10): [True: 0, False: 0]
  ------------------
 2511|      0|    cpi->do_update_frame_probs_interpfilter[cpi->num_frame_recode] =
 2512|      0|        (cm->current_frame.frame_type != KEY_FRAME &&
  ------------------
  |  Branch (2512:10): [True: 0, False: 0]
  ------------------
 2513|      0|         cpi->sf.interp_sf.adaptive_interp_filter_search == 2 &&
  ------------------
  |  Branch (2513:10): [True: 0, False: 0]
  ------------------
 2514|      0|         features->interp_filter == SWITCHABLE);
  ------------------
  |  Branch (2514:10): [True: 0, False: 0]
  ------------------
 2515|      0|  }
 2516|       |
 2517|  73.6k|  if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats ||
  ------------------
  |  Branch (2517:7): [True: 0, False: 73.6k]
  ------------------
 2518|  73.6k|      ((cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh !=
  ------------------
  |  Branch (2518:8): [True: 73.6k, False: 0]
  ------------------
 2519|  73.6k|        INT_MAX) &&
 2520|  73.6k|       (cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh != 0))) {
  ------------------
  |  Branch (2520:8): [True: 49.2k, False: 24.4k]
  ------------------
 2521|  49.2k|    const FRAME_UPDATE_TYPE update_type =
 2522|  49.2k|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 2523|   984k|    for (i = 0; i < TX_SIZES_ALL; i++) {
  ------------------
  |  Branch (2523:17): [True: 935k, False: 49.2k]
  ------------------
 2524|   935k|      int sum = 0;
 2525|   935k|      int j;
 2526|   935k|      int left = MAX_TX_TYPE_PROB;
  ------------------
  |  |   44|   935k|#define MAX_TX_TYPE_PROB 1024
  ------------------
 2527|       |
 2528|  15.8M|      for (j = 0; j < TX_TYPES; j++)
  ------------------
  |  Branch (2528:19): [True: 14.9M, False: 935k]
  ------------------
 2529|  14.9M|        sum += cpi->td.rd_counts.tx_type_used[i][j];
 2530|       |
 2531|  15.8M|      for (j = TX_TYPES - 1; j >= 0; j--) {
  ------------------
  |  Branch (2531:30): [True: 14.9M, False: 935k]
  ------------------
 2532|  14.9M|        int update_txtype_frameprobs = 1;
 2533|  14.9M|        const int new_prob =
 2534|  14.9M|            sum ? (int)((int64_t)MAX_TX_TYPE_PROB *
  ------------------
  |  |   44|  1.45M|#define MAX_TX_TYPE_PROB 1024
  ------------------
  |  Branch (2534:13): [True: 1.45M, False: 13.5M]
  ------------------
 2535|  1.45M|                        cpi->td.rd_counts.tx_type_used[i][j] / sum)
 2536|  14.9M|                : (j ? 0 : MAX_TX_TYPE_PROB);
  ------------------
  |  |   44|   844k|#define MAX_TX_TYPE_PROB 1024
  ------------------
  |  Branch (2536:20): [True: 12.6M, False: 844k]
  ------------------
 2537|       |#if CONFIG_FPMT_TEST
 2538|       |        if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 2539|       |          if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] ==
 2540|       |              0) {
 2541|       |            int prob =
 2542|       |                (temp_frame_probs_simulation->tx_type_probs[update_type][i][j] +
 2543|       |                 new_prob) >>
 2544|       |                1;
 2545|       |            left -= prob;
 2546|       |            if (j == 0) prob += left;
 2547|       |            temp_frame_probs_simulation->tx_type_probs[update_type][i][j] =
 2548|       |                prob;
 2549|       |            // Copy temp_frame_probs_simulation to temp_frame_probs
 2550|       |            for (int update_type_idx = 0; update_type_idx < FRAME_UPDATE_TYPES;
 2551|       |                 update_type_idx++) {
 2552|       |              temp_frame_probs->tx_type_probs[update_type_idx][i][j] =
 2553|       |                  temp_frame_probs_simulation
 2554|       |                      ->tx_type_probs[update_type_idx][i][j];
 2555|       |            }
 2556|       |          }
 2557|       |          update_txtype_frameprobs = 0;
 2558|       |        }
 2559|       |#endif  // CONFIG_FPMT_TEST
 2560|       |        // Track the frame probabilities of parallel encode frames to update
 2561|       |        // during postencode stage.
 2562|  14.9M|        if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (2562:13): [True: 0, False: 14.9M]
  ------------------
 2563|      0|          update_txtype_frameprobs = 0;
 2564|      0|          cpi->frame_new_probs[cpi->num_frame_recode]
 2565|      0|              .tx_type_probs[update_type][i][j] = new_prob;
 2566|      0|        }
 2567|  14.9M|        if (update_txtype_frameprobs) {
  ------------------
  |  Branch (2567:13): [True: 14.9M, False: 0]
  ------------------
 2568|  14.9M|          int prob =
 2569|  14.9M|              (frame_probs->tx_type_probs[update_type][i][j] + new_prob) >> 1;
 2570|  14.9M|          left -= prob;
 2571|  14.9M|          if (j == 0) prob += left;
  ------------------
  |  Branch (2571:15): [True: 935k, False: 14.0M]
  ------------------
 2572|  14.9M|          frame_probs->tx_type_probs[update_type][i][j] = prob;
 2573|  14.9M|        }
 2574|  14.9M|      }
 2575|   935k|    }
 2576|  49.2k|  }
 2577|       |
 2578|  73.6k|  if (cm->seg.enabled) {
  ------------------
  |  Branch (2578:7): [True: 0, False: 73.6k]
  ------------------
 2579|      0|    cm->seg.temporal_update = 1;
 2580|      0|    if (rdc->seg_tmp_pred_cost[0] < rdc->seg_tmp_pred_cost[1])
  ------------------
  |  Branch (2580:9): [True: 0, False: 0]
  ------------------
 2581|      0|      cm->seg.temporal_update = 0;
 2582|      0|  }
 2583|       |
 2584|  73.6k|  if (cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  ------------------
  |  Branch (2584:7): [True: 49.2k, False: 24.4k]
  ------------------
 2585|  49.2k|      cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX) {
  ------------------
  |  Branch (2585:7): [True: 0, False: 49.2k]
  ------------------
 2586|      0|    const FRAME_UPDATE_TYPE update_type =
 2587|      0|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 2588|       |
 2589|      0|    for (i = 0; i < BLOCK_SIZES_ALL; i++) {
  ------------------
  |  Branch (2589:17): [True: 0, False: 0]
  ------------------
 2590|      0|      int sum = 0;
 2591|      0|      int update_obmc_frameprobs = 1;
 2592|      0|      for (int j = 0; j < 2; j++) sum += cpi->td.rd_counts.obmc_used[i][j];
  ------------------
  |  Branch (2592:23): [True: 0, False: 0]
  ------------------
 2593|       |
 2594|      0|      const int new_prob =
 2595|      0|          sum ? 128 * cpi->td.rd_counts.obmc_used[i][1] / sum : 0;
  ------------------
  |  Branch (2595:11): [True: 0, False: 0]
  ------------------
 2596|       |#if CONFIG_FPMT_TEST
 2597|       |      if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 2598|       |        if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
 2599|       |          temp_frame_probs_simulation->obmc_probs[update_type][i] =
 2600|       |              (temp_frame_probs_simulation->obmc_probs[update_type][i] +
 2601|       |               new_prob) >>
 2602|       |              1;
 2603|       |          // Copy temp_frame_probs_simulation to temp_frame_probs
 2604|       |          for (int update_type_idx = 0; update_type_idx < FRAME_UPDATE_TYPES;
 2605|       |               update_type_idx++) {
 2606|       |            temp_frame_probs->obmc_probs[update_type_idx][i] =
 2607|       |                temp_frame_probs_simulation->obmc_probs[update_type_idx][i];
 2608|       |          }
 2609|       |        }
 2610|       |        update_obmc_frameprobs = 0;
 2611|       |      }
 2612|       |#endif  // CONFIG_FPMT_TEST
 2613|       |      // Track the frame probabilities of parallel encode frames to update
 2614|       |      // during postencode stage.
 2615|      0|      if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (2615:11): [True: 0, False: 0]
  ------------------
 2616|      0|        update_obmc_frameprobs = 0;
 2617|      0|        cpi->frame_new_probs[cpi->num_frame_recode].obmc_probs[update_type][i] =
 2618|      0|            new_prob;
 2619|      0|      }
 2620|      0|      if (update_obmc_frameprobs) {
  ------------------
  |  Branch (2620:11): [True: 0, False: 0]
  ------------------
 2621|      0|        frame_probs->obmc_probs[update_type][i] =
 2622|      0|            (frame_probs->obmc_probs[update_type][i] + new_prob) >> 1;
 2623|      0|      }
 2624|      0|    }
 2625|      0|  }
 2626|       |
 2627|  73.6k|  if (features->allow_warped_motion &&
  ------------------
  |  Branch (2627:7): [True: 55.2k, False: 18.4k]
  ------------------
 2628|  55.2k|      cpi->sf.inter_sf.prune_warped_prob_thresh > 0) {
  ------------------
  |  Branch (2628:7): [True: 18.3k, False: 36.9k]
  ------------------
 2629|  18.3k|    const FRAME_UPDATE_TYPE update_type =
 2630|  18.3k|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 2631|  18.3k|    int update_warp_frameprobs = 1;
 2632|  18.3k|    int sum = 0;
 2633|  54.9k|    for (i = 0; i < 2; i++) sum += cpi->td.rd_counts.warped_used[i];
  ------------------
  |  Branch (2633:17): [True: 36.6k, False: 18.3k]
  ------------------
 2634|  18.3k|    const int new_prob = sum ? 128 * cpi->td.rd_counts.warped_used[1] / sum : 0;
  ------------------
  |  Branch (2634:26): [True: 0, False: 18.3k]
  ------------------
 2635|       |#if CONFIG_FPMT_TEST
 2636|       |    if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 2637|       |      if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
 2638|       |        temp_frame_probs_simulation->warped_probs[update_type] =
 2639|       |            (temp_frame_probs_simulation->warped_probs[update_type] +
 2640|       |             new_prob) >>
 2641|       |            1;
 2642|       |        // Copy temp_frame_probs_simulation to temp_frame_probs
 2643|       |        for (int update_type_idx = 0; update_type_idx < FRAME_UPDATE_TYPES;
 2644|       |             update_type_idx++) {
 2645|       |          temp_frame_probs->warped_probs[update_type_idx] =
 2646|       |              temp_frame_probs_simulation->warped_probs[update_type_idx];
 2647|       |        }
 2648|       |      }
 2649|       |      update_warp_frameprobs = 0;
 2650|       |    }
 2651|       |#endif  // CONFIG_FPMT_TEST
 2652|       |    // Track the frame probabilities of parallel encode frames to update
 2653|       |    // during postencode stage.
 2654|  18.3k|    if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (2654:9): [True: 0, False: 18.3k]
  ------------------
 2655|      0|      update_warp_frameprobs = 0;
 2656|      0|      cpi->frame_new_probs[cpi->num_frame_recode].warped_probs[update_type] =
 2657|      0|          new_prob;
 2658|      0|    }
 2659|  18.3k|    if (update_warp_frameprobs) {
  ------------------
  |  Branch (2659:9): [True: 18.3k, False: 0]
  ------------------
 2660|  18.3k|      frame_probs->warped_probs[update_type] =
 2661|  18.3k|          (frame_probs->warped_probs[update_type] + new_prob) >> 1;
 2662|  18.3k|    }
 2663|  18.3k|  }
 2664|       |
 2665|  73.6k|  if (cm->current_frame.frame_type != KEY_FRAME &&
  ------------------
  |  Branch (2665:7): [True: 55.2k, False: 18.4k]
  ------------------
 2666|  55.2k|      cpi->sf.interp_sf.adaptive_interp_filter_search == 2 &&
  ------------------
  |  Branch (2666:7): [True: 36.9k, False: 18.3k]
  ------------------
 2667|  36.9k|      features->interp_filter == SWITCHABLE) {
  ------------------
  |  Branch (2667:7): [True: 36.9k, False: 0]
  ------------------
 2668|  36.9k|    const FRAME_UPDATE_TYPE update_type =
 2669|  36.9k|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 2670|       |
 2671|   627k|    for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
  ------------------
  |  |  101|   627k|#define SWITCHABLE_FILTER_CONTEXTS ((SWITCHABLE_FILTERS + 1) * 4)
  ------------------
  |  Branch (2671:17): [True: 590k, False: 36.9k]
  ------------------
 2672|   590k|      int sum = 0;
 2673|   590k|      int j;
 2674|   590k|      int left = 1536;
 2675|       |
 2676|  2.36M|      for (j = 0; j < SWITCHABLE_FILTERS; j++) {
  ------------------
  |  Branch (2676:19): [True: 1.77M, False: 590k]
  ------------------
 2677|  1.77M|        sum += cpi->td.counts->switchable_interp[i][j];
 2678|  1.77M|      }
 2679|       |
 2680|  2.36M|      for (j = SWITCHABLE_FILTERS - 1; j >= 0; j--) {
  ------------------
  |  Branch (2680:40): [True: 1.77M, False: 590k]
  ------------------
 2681|  1.77M|        int update_interpfilter_frameprobs = 1;
 2682|  1.77M|        const int new_prob =
 2683|  1.77M|            sum ? 1536 * cpi->td.counts->switchable_interp[i][j] / sum
  ------------------
  |  Branch (2683:13): [True: 147k, False: 1.62M]
  ------------------
 2684|  1.77M|                : (j ? 0 : 1536);
  ------------------
  |  Branch (2684:20): [True: 1.08M, False: 541k]
  ------------------
 2685|       |#if CONFIG_FPMT_TEST
 2686|       |        if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 2687|       |          if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] ==
 2688|       |              0) {
 2689|       |            int prob = (temp_frame_probs_simulation
 2690|       |                            ->switchable_interp_probs[update_type][i][j] +
 2691|       |                        new_prob) >>
 2692|       |                       1;
 2693|       |            left -= prob;
 2694|       |            if (j == 0) prob += left;
 2695|       |            temp_frame_probs_simulation
 2696|       |                ->switchable_interp_probs[update_type][i][j] = prob;
 2697|       |            // Copy temp_frame_probs_simulation to temp_frame_probs
 2698|       |            for (int update_type_idx = 0; update_type_idx < FRAME_UPDATE_TYPES;
 2699|       |                 update_type_idx++) {
 2700|       |              temp_frame_probs->switchable_interp_probs[update_type_idx][i][j] =
 2701|       |                  temp_frame_probs_simulation
 2702|       |                      ->switchable_interp_probs[update_type_idx][i][j];
 2703|       |            }
 2704|       |          }
 2705|       |          update_interpfilter_frameprobs = 0;
 2706|       |        }
 2707|       |#endif  // CONFIG_FPMT_TEST
 2708|       |        // Track the frame probabilities of parallel encode frames to update
 2709|       |        // during postencode stage.
 2710|  1.77M|        if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (2710:13): [True: 0, False: 1.77M]
  ------------------
 2711|      0|          update_interpfilter_frameprobs = 0;
 2712|      0|          cpi->frame_new_probs[cpi->num_frame_recode]
 2713|      0|              .switchable_interp_probs[update_type][i][j] = new_prob;
 2714|      0|        }
 2715|  1.77M|        if (update_interpfilter_frameprobs) {
  ------------------
  |  Branch (2715:13): [True: 1.77M, False: 0]
  ------------------
 2716|  1.77M|          int prob = (frame_probs->switchable_interp_probs[update_type][i][j] +
 2717|  1.77M|                      new_prob) >>
 2718|  1.77M|                     1;
 2719|  1.77M|          left -= prob;
 2720|  1.77M|          if (j == 0) prob += left;
  ------------------
  |  Branch (2720:15): [True: 590k, False: 1.18M]
  ------------------
 2721|  1.77M|          frame_probs->switchable_interp_probs[update_type][i][j] = prob;
 2722|  1.77M|        }
 2723|  1.77M|      }
 2724|   590k|    }
 2725|  36.9k|  }
 2726|  73.6k|  if (hash_table_created) {
  ------------------
  |  Branch (2726:7): [True: 1.98k, False: 71.6k]
  ------------------
 2727|  1.98k|    av1_hash_table_destroy(&intrabc_hash_info->intrabc_hash_table);
 2728|  1.98k|  }
 2729|  73.6k|}
encodeframe.c:free_block_hash_buffers:
 1947|  1.98k|static void free_block_hash_buffers(uint32_t *block_hash_values[2]) {
 1948|  5.94k|  for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (1948:19): [True: 3.96k, False: 1.98k]
  ------------------
 1949|  3.96k|    aom_free(block_hash_values[j]);
 1950|  3.96k|  }
 1951|  1.98k|}
encodeframe.c:aom_get_variance_boost_delta_q_res:
 1955|  52.3k|static int aom_get_variance_boost_delta_q_res(int qindex) {
 1956|       |  // Signaling delta_q changes across superblocks comes with inherent syntax
 1957|       |  // element overhead, which adds up to total payload size. This overhead
 1958|       |  // becomes proportionally bigger the higher the base qindex (i.e. lower
 1959|       |  // quality, smaller file size), so a balance needs to be struck.
 1960|       |  // - Smaller delta_q_res: more granular delta_q control, more bits spent
 1961|       |  // signaling deltas.
 1962|       |  // - Larger delta_q_res: coarser delta_q control, less bits spent signaling
 1963|       |  // deltas.
 1964|       |  //
 1965|       |  // At the same time, SB qindex fluctuations become larger the higher
 1966|       |  // the base qindex (between lowest and highest-variance regions):
 1967|       |  // - For QP 5: up to 8 qindexes
 1968|       |  // - For QP 60: up to 52 qindexes
 1969|       |  //
 1970|       |  // With these factors in mind, it was found that the best strategy that
 1971|       |  // maximizes quality per bitrate is by having very finely-grained delta_q
 1972|       |  // values for the lowest picture qindexes (to preserve tiny qindex SB deltas),
 1973|       |  // and progressively making them coarser as base qindex increases (to reduce
 1974|       |  // total signaling overhead).
 1975|  52.3k|  int delta_q_res = 1;
 1976|       |
 1977|  52.3k|  if (qindex >= 160) {
  ------------------
  |  Branch (1977:7): [True: 29.4k, False: 22.9k]
  ------------------
 1978|  29.4k|    delta_q_res = 8;
 1979|  29.4k|  } else if (qindex >= 120) {
  ------------------
  |  Branch (1979:14): [True: 5.25k, False: 17.7k]
  ------------------
 1980|  5.25k|    delta_q_res = 4;
 1981|  17.7k|  } else if (qindex >= 80) {
  ------------------
  |  Branch (1981:14): [True: 4.85k, False: 12.8k]
  ------------------
 1982|  4.85k|    delta_q_res = 2;
 1983|  12.8k|  } else {
 1984|  12.8k|    delta_q_res = 1;
 1985|  12.8k|  }
 1986|       |
 1987|  52.3k|  return delta_q_res;
 1988|  52.3k|}
encodeframe.c:enable_delta_q:
 1902|  21.2k|static inline int enable_delta_q(const AV1_COMP *cpi) {
 1903|  21.2k|  const GF_GROUP *gf_group = &cpi->ppi->gf_group;
 1904|  21.2k|  if (!disable_deltaq_for_intl_arfs(cpi))
  ------------------
  |  Branch (1904:7): [True: 21.2k, False: 0]
  ------------------
 1905|  21.2k|    return gf_group->update_type[cpi->gf_frame_index] != LF_UPDATE;
 1906|       |
 1907|      0|  return cpi->common.current_frame.pyramid_level <= 1;
 1908|  21.2k|}
encodeframe.c:disable_deltaq_for_intl_arfs:
 1883|  94.8k|static inline int disable_deltaq_for_intl_arfs(const AV1_COMP *cpi) {
 1884|  94.8k|  if (cpi->oxcf.mode == GOOD && is_stat_consumption_stage_twopass(cpi) &&
  ------------------
  |  Branch (1884:7): [True: 63.9k, False: 30.9k]
  |  Branch (1884:33): [True: 0, False: 63.9k]
  ------------------
 1885|      0|      cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_OBJECTIVE &&
  ------------------
  |  Branch (1885:7): [True: 0, False: 0]
  ------------------
 1886|      0|      cpi->oxcf.algo_cfg.enable_tpl_model && cpi->oxcf.q_cfg.aq_mode == NO_AQ &&
  ------------------
  |  Branch (1886:7): [True: 0, False: 0]
  |  Branch (1886:46): [True: 0, False: 0]
  ------------------
 1887|      0|      !cpi->common.seg.enabled && !cpi->roi.enabled && !cpi->oxcf.sb_qp_sweep &&
  ------------------
  |  Branch (1887:7): [True: 0, False: 0]
  |  Branch (1887:35): [True: 0, False: 0]
  |  Branch (1887:56): [True: 0, False: 0]
  ------------------
 1888|      0|      !cpi->use_ducky_encode) {
  ------------------
  |  Branch (1888:7): [True: 0, False: 0]
  ------------------
 1889|      0|    return 1;
 1890|      0|  }
 1891|  94.8k|  return 0;
 1892|  94.8k|}
encodeframe.c:allow_deltaq_mode:
 1860|  7.70k|static int allow_deltaq_mode(AV1_COMP *cpi) {
 1861|  7.70k|#if !CONFIG_REALTIME_ONLY
 1862|  7.70k|  AV1_COMMON *const cm = &cpi->common;
 1863|  7.70k|  BLOCK_SIZE sb_size = cm->seq_params->sb_size;
 1864|  7.70k|  int sbs_wide = mi_size_wide[sb_size];
 1865|  7.70k|  int sbs_high = mi_size_high[sb_size];
 1866|       |
 1867|  7.70k|  int64_t delta_rdcost = 0;
 1868|  17.4k|  for (int mi_row = 0; mi_row < cm->mi_params.mi_rows; mi_row += sbs_high) {
  ------------------
  |  Branch (1868:24): [True: 9.77k, False: 7.70k]
  ------------------
 1869|  22.5k|    for (int mi_col = 0; mi_col < cm->mi_params.mi_cols; mi_col += sbs_wide) {
  ------------------
  |  Branch (1869:26): [True: 12.8k, False: 9.77k]
  ------------------
 1870|  12.8k|      int64_t this_delta_rdcost = 0;
 1871|  12.8k|      av1_get_q_for_deltaq_objective(cpi, &cpi->td, &this_delta_rdcost, sb_size,
 1872|  12.8k|                                     mi_row, mi_col);
 1873|  12.8k|      delta_rdcost += this_delta_rdcost;
 1874|  12.8k|    }
 1875|  9.77k|  }
 1876|  7.70k|  return delta_rdcost < 0;
 1877|       |#else
 1878|       |  (void)cpi;
 1879|       |  return 1;
 1880|       |#endif  // !CONFIG_REALTIME_ONLY
 1881|  7.70k|}
encodeframe.c:enable_delta_rdmult:
 1894|  73.6k|static inline int enable_delta_rdmult(const AV1_COMP *cpi) {
 1895|  73.6k|  if (!disable_deltaq_for_intl_arfs(cpi))
  ------------------
  |  Branch (1895:7): [True: 73.6k, False: 0]
  ------------------
 1896|  73.6k|    return cpi->common.delta_q_info.delta_q_present_flag;
 1897|       |
 1898|      0|  const GF_GROUP *gf_group = &cpi->ppi->gf_group;
 1899|      0|  return gf_group->update_type[cpi->gf_frame_index] != LF_UPDATE;
 1900|  73.6k|}
encodeframe.c:init_encode_frame_mb_context:
 1362|  73.6k|static inline void init_encode_frame_mb_context(AV1_COMP *cpi) {
 1363|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 1364|  73.6k|  const int num_planes = av1_num_planes(cm);
 1365|  73.6k|  MACROBLOCK *const x = &cpi->td.mb;
 1366|  73.6k|  MACROBLOCKD *const xd = &x->e_mbd;
 1367|       |
 1368|       |  // Copy data over into macro block data structures.
 1369|  73.6k|  av1_setup_src_planes(x, cpi->source, 0, 0, num_planes,
 1370|  73.6k|                       cm->seq_params->sb_size);
 1371|       |
 1372|  73.6k|  av1_setup_block_planes(xd, cm->seq_params->subsampling_x,
 1373|  73.6k|                         cm->seq_params->subsampling_y, num_planes);
 1374|  73.6k|}
encodeframe.c:set_default_interp_skip_flags:
 1702|  73.6k|    const AV1_COMMON *cm, InterpSearchFlags *interp_search_flags) {
 1703|  73.6k|  const int num_planes = av1_num_planes(cm);
 1704|  73.6k|  interp_search_flags->default_interp_skip_flags =
 1705|  73.6k|      (num_planes == 1) ? INTERP_SKIP_LUMA_EVAL_CHROMA
  ------------------
  |  Branch (1705:7): [True: 45.6k, False: 27.9k]
  ------------------
 1706|  73.6k|                        : INTERP_SKIP_LUMA_SKIP_CHROMA;
 1707|  73.6k|}
encodeframe.c:refs_are_one_sided:
 1637|  55.2k|static inline int refs_are_one_sided(const AV1_COMMON *cm) {
 1638|  55.2k|  assert(!frame_is_intra_only(cm));
 1639|       |
 1640|  55.2k|  int one_sided_refs = 1;
 1641|  55.2k|  const int cur_display_order_hint = cm->current_frame.display_order_hint;
 1642|   441k|  for (int ref = LAST_FRAME; ref <= ALTREF_FRAME; ++ref) {
  ------------------
  |  Branch (1642:30): [True: 386k, False: 55.2k]
  ------------------
 1643|   386k|    const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref);
 1644|   386k|    if (buf == NULL) continue;
  ------------------
  |  Branch (1644:9): [True: 0, False: 386k]
  ------------------
 1645|   386k|    if (av1_encoder_get_relative_dist(buf->display_order_hint,
  ------------------
  |  Branch (1645:9): [True: 0, False: 386k]
  ------------------
 1646|   386k|                                      cur_display_order_hint) > 0) {
 1647|      0|      one_sided_refs = 0;  // bwd reference
 1648|      0|      break;
 1649|      0|    }
 1650|   386k|  }
 1651|  55.2k|  return one_sided_refs;
 1652|  55.2k|}
encodeframe.c:setup_prune_ref_frame_mask:
 1803|  73.6k|static inline void setup_prune_ref_frame_mask(AV1_COMP *cpi) {
 1804|  73.6k|  if ((!cpi->oxcf.ref_frm_cfg.enable_onesided_comp ||
  ------------------
  |  Branch (1804:8): [True: 0, False: 73.6k]
  ------------------
 1805|  73.6k|       cpi->sf.inter_sf.disable_onesided_comp) &&
  ------------------
  |  Branch (1805:8): [True: 49.2k, False: 24.4k]
  ------------------
 1806|  49.2k|      cpi->all_one_sided_refs) {
  ------------------
  |  Branch (1806:7): [True: 36.9k, False: 12.3k]
  ------------------
 1807|       |    // Disable all compound references
 1808|  36.9k|    cpi->prune_ref_frame_mask = (1 << MODE_CTX_REF_FRAMES) - (1 << REF_FRAMES);
  ------------------
  |  |  598|  36.9k|#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
  |  |  ------------------
  |  |  |  |  591|  36.9k|#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
  |  |  ------------------
  ------------------
 1809|  36.9k|  } else if (!cpi->sf.rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (1809:14): [True: 12.3k, False: 24.4k]
  ------------------
 1810|  12.3k|             cpi->sf.inter_sf.selective_ref_frame >= 1) {
  ------------------
  |  Branch (1810:14): [True: 12.3k, False: 0]
  ------------------
 1811|  12.3k|    AV1_COMMON *const cm = &cpi->common;
 1812|  12.3k|    const int cur_frame_display_order_hint =
 1813|  12.3k|        cm->current_frame.display_order_hint;
 1814|  12.3k|    unsigned int *ref_display_order_hint =
 1815|  12.3k|        cm->cur_frame->ref_display_order_hint;
 1816|  12.3k|    const int arf2_dist = av1_encoder_get_relative_dist(
 1817|  12.3k|        ref_display_order_hint[ALTREF2_FRAME - LAST_FRAME],
 1818|  12.3k|        cur_frame_display_order_hint);
 1819|  12.3k|    const int bwd_dist = av1_encoder_get_relative_dist(
 1820|  12.3k|        ref_display_order_hint[BWDREF_FRAME - LAST_FRAME],
 1821|  12.3k|        cur_frame_display_order_hint);
 1822|       |
 1823|   270k|    for (int ref_idx = REF_FRAMES; ref_idx < MODE_CTX_REF_FRAMES; ++ref_idx) {
  ------------------
  |  |  598|   270k|#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
  |  |  ------------------
  |  |  |  |  591|   270k|#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
  |  |  ------------------
  ------------------
  |  Branch (1823:36): [True: 258k, False: 12.3k]
  ------------------
 1824|   258k|      MV_REFERENCE_FRAME rf[2];
 1825|   258k|      av1_set_ref_frame(rf, ref_idx);
 1826|   258k|      if (!(cpi->ref_frame_flags & av1_ref_frame_flag_list[rf[0]]) ||
  ------------------
  |  Branch (1826:11): [True: 184k, False: 73.8k]
  ------------------
 1827|   258k|          !(cpi->ref_frame_flags & av1_ref_frame_flag_list[rf[1]])) {
  ------------------
  |  Branch (1827:11): [True: 73.8k, False: 0]
  ------------------
 1828|   258k|        continue;
 1829|   258k|      }
 1830|       |
 1831|      0|      if (!cpi->all_one_sided_refs) {
  ------------------
  |  Branch (1831:11): [True: 0, False: 0]
  ------------------
 1832|      0|        int ref_dist[2];
 1833|      0|        for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (1833:25): [True: 0, False: 0]
  ------------------
 1834|      0|          ref_dist[i] = av1_encoder_get_relative_dist(
 1835|      0|              ref_display_order_hint[rf[i] - LAST_FRAME],
 1836|      0|              cur_frame_display_order_hint);
 1837|      0|        }
 1838|       |
 1839|       |        // One-sided compound is used only when all reference frames are
 1840|       |        // one-sided.
 1841|      0|        if ((ref_dist[0] > 0) == (ref_dist[1] > 0)) {
  ------------------
  |  Branch (1841:13): [True: 0, False: 0]
  ------------------
 1842|      0|          cpi->prune_ref_frame_mask |= 1 << ref_idx;
 1843|      0|        }
 1844|      0|      }
 1845|       |
 1846|      0|      if (cpi->sf.inter_sf.selective_ref_frame >= 4 &&
  ------------------
  |  Branch (1846:11): [True: 0, False: 0]
  ------------------
 1847|      0|          (rf[0] == ALTREF2_FRAME || rf[1] == ALTREF2_FRAME) &&
  ------------------
  |  Branch (1847:12): [True: 0, False: 0]
  |  Branch (1847:38): [True: 0, False: 0]
  ------------------
 1848|      0|          (cpi->ref_frame_flags & av1_ref_frame_flag_list[BWDREF_FRAME])) {
  ------------------
  |  Branch (1848:11): [True: 0, False: 0]
  ------------------
 1849|       |        // Check if both ALTREF2_FRAME and BWDREF_FRAME are future references.
 1850|      0|        if (arf2_dist > 0 && bwd_dist > 0 && bwd_dist <= arf2_dist) {
  ------------------
  |  Branch (1850:13): [True: 0, False: 0]
  |  Branch (1850:30): [True: 0, False: 0]
  |  Branch (1850:46): [True: 0, False: 0]
  ------------------
 1851|       |          // Drop ALTREF2_FRAME as a reference if BWDREF_FRAME is a closer
 1852|       |          // reference to the current frame than ALTREF2_FRAME
 1853|      0|          cpi->prune_ref_frame_mask |= 1 << ref_idx;
 1854|      0|        }
 1855|      0|      }
 1856|      0|    }
 1857|  12.3k|  }
 1858|  73.6k|}
encodeframe.c:setup_keep_ref_frame_mask:
 1734|  73.6k|static inline void setup_keep_ref_frame_mask(AV1_COMP *cpi) {
 1735|  73.6k|  const int prune_single_ref = cpi->sf.inter_sf.prune_single_ref;
 1736|  73.6k|  const int prune_comp_ref_frames = cpi->sf.inter_sf.prune_comp_ref_frames;
 1737|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 1738|  73.6k|  cpi->keep_single_ref_frame_mask = 0;
 1739|  73.6k|  cpi->keep_comp_ref_frame_mask = 0;
 1740|  73.6k|  if (frame_is_intra_only(cm)) return;
  ------------------
  |  Branch (1740:7): [True: 18.4k, False: 55.2k]
  ------------------
 1741|       |
 1742|  55.2k|  RefScoreData ref_score_data[INTER_REFS_PER_FRAME];
 1743|   441k|  for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (1743:19): [True: 386k, False: 55.2k]
  ------------------
 1744|   386k|    ref_score_data[i].score = INT_MAX;
 1745|   386k|    ref_score_data[i].index = i;
 1746|   386k|  }
 1747|       |
 1748|       |  // Calculate score for each reference frame based on relative distance to
 1749|       |  // the current frame and its base_qindex. A lower score means that the
 1750|       |  // reference is potentially more useful.
 1751|   441k|  for (MV_REFERENCE_FRAME ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME;
  ------------------
  |  Branch (1751:51): [True: 386k, False: 55.2k]
  ------------------
 1752|   386k|       ++ref_frame) {
 1753|   386k|    if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
  ------------------
  |  Branch (1753:9): [True: 55.2k, False: 331k]
  ------------------
 1754|  55.2k|      const RefFrameDistanceInfo *const ref_frame_dist_info =
 1755|  55.2k|          &cpi->ref_frame_dist_info;
 1756|  55.2k|      const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 1757|  55.2k|      ref_score_data[ref_frame - LAST_FRAME].score =
 1758|  55.2k|          abs(ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME]) +
 1759|  55.2k|          buf->base_qindex;
 1760|  55.2k|    }
 1761|   386k|  }
 1762|       |
 1763|  55.2k|  qsort(ref_score_data, INTER_REFS_PER_FRAME, sizeof(ref_score_data[0]),
 1764|  55.2k|        compare_score_data_asc);
 1765|       |
 1766|       |  // Decide the number of reference frames for which pruning via the speed
 1767|       |  // feature prune_single_ref is disallowed.
 1768|       |  // prune_single_ref = 0 => None of the 7 reference frames are pruned.
 1769|       |  // prune_single_ref = 1 => The best 5 reference frames are not pruned.
 1770|       |  // prune_single_ref = 2 => The best 3 reference frames are not pruned.
 1771|       |  // prune_single_ref = 3, 4 => All the 7 references are allowed to be pruned.
 1772|  55.2k|  static const int num_single_ref_to_keep_lookup[5] = { INTER_REFS_PER_FRAME, 5,
 1773|  55.2k|                                                        3, 0, 0 };
 1774|  55.2k|  assert(prune_single_ref >= 0 && prune_single_ref <= 4);
 1775|  55.2k|  const int num_single_ref_to_keep =
 1776|  55.2k|      num_single_ref_to_keep_lookup[prune_single_ref];
 1777|   183k|  for (int i = 0; i < num_single_ref_to_keep; ++i) {
  ------------------
  |  Branch (1777:19): [True: 128k, False: 55.2k]
  ------------------
 1778|   128k|    const int idx = ref_score_data[i].index;
 1779|   128k|    cpi->keep_single_ref_frame_mask |= 1 << idx;
 1780|   128k|  }
 1781|       |
 1782|       |  // Decide the number of reference frame pairs for which pruning via the speed
 1783|       |  // feature "prune_comp_ref_frames" is disallowed.
 1784|       |  // prune_comp_ref_frames = 0    => None of the allowed reference frame pairs
 1785|       |  //                                 are pruned.
 1786|       |  // prune_comp_ref_frames = 1    => The best 3 reference frame pairs are not
 1787|       |  //                                 allowed to be pruned, i.e, reference frame
 1788|       |  //                                 pairs with rank (1, 2), (1, 3), (2, 3) are
 1789|       |  //                                 not  pruned.
 1790|       |  // prune_comp_ref_frames = 2, 3 => All the reference frame pairs are allowed
 1791|       |  //                                 to be pruned.
 1792|  55.2k|  static const int num_comp_ref_to_keep_lookup[4] = { INTER_REFS_PER_FRAME, 3,
 1793|  55.2k|                                                      0, 0 };
 1794|  55.2k|  assert(prune_comp_ref_frames >= 0 && prune_comp_ref_frames <= 3);
 1795|  55.2k|  const int num_comp_ref_to_keep =
 1796|  55.2k|      num_comp_ref_to_keep_lookup[prune_comp_ref_frames];
 1797|   183k|  for (int i = 0; i < num_comp_ref_to_keep; ++i) {
  ------------------
  |  Branch (1797:19): [True: 128k, False: 55.2k]
  ------------------
 1798|   128k|    const int idx = ref_score_data[i].index;
 1799|   128k|    cpi->keep_comp_ref_frame_mask |= 1 << idx;
 1800|   128k|  }
 1801|  55.2k|}
encodeframe.c:compare_score_data_asc:
 1720|   496k|static int compare_score_data_asc(const void *a, const void *b) {
 1721|   496k|  const RefScoreData *ra = (const RefScoreData *)a;
 1722|   496k|  const RefScoreData *rb = (const RefScoreData *)b;
 1723|       |
 1724|   496k|  const int score_diff = ra->score - rb->score;
 1725|   496k|  if (score_diff != 0) return score_diff;
  ------------------
  |  Branch (1725:7): [True: 110k, False: 386k]
  ------------------
 1726|       |
 1727|   386k|  return ra->index - rb->index;
 1728|   496k|}
encodeframe.c:check_to_disable_ref_frame_mvs:
 2111|  73.6k|static void check_to_disable_ref_frame_mvs(AV1_COMP *cpi) {
 2112|  73.6k|  AV1_COMMON *cm = &cpi->common;
 2113|  73.6k|  if (!cm->features.allow_ref_frame_mvs || cpi->sf.hl_sf.ref_frame_mvs_lvl != 1)
  ------------------
  |  Branch (2113:7): [True: 18.4k, False: 55.2k]
  |  Branch (2113:44): [True: 55.2k, False: 0]
  ------------------
 2114|  73.6k|    return;
 2115|       |
 2116|      0|  const int tpl_idx = cpi->gf_frame_index;
 2117|      0|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
 2118|      0|  if (!av1_tpl_stats_ready(tpl_data, tpl_idx)) return;
  ------------------
  |  Branch (2118:7): [True: 0, False: 0]
  ------------------
 2119|       |
 2120|      0|  const SUBPEL_FORCE_STOP tpl_subpel_precision =
 2121|      0|      cpi->sf.tpl_sf.subpel_force_stop;
 2122|      0|  const int allow_high_precision_mv = tpl_subpel_precision == EIGHTH_PEL &&
  ------------------
  |  Branch (2122:39): [True: 0, False: 0]
  ------------------
 2123|      0|                                      cm->features.allow_high_precision_mv;
  ------------------
  |  Branch (2123:39): [True: 0, False: 0]
  ------------------
 2124|      0|  const int force_integer_mv = tpl_subpel_precision == FULL_PEL ||
  ------------------
  |  Branch (2124:32): [True: 0, False: 0]
  ------------------
 2125|      0|                               cm->features.cur_frame_force_integer_mv;
  ------------------
  |  Branch (2125:32): [True: 0, False: 0]
  ------------------
 2126|       |
 2127|      0|  const TplDepFrame *tpl_frame = &tpl_data->tpl_frame[tpl_idx];
 2128|      0|  TplDepStats *tpl_ptr = tpl_frame->tpl_stats_ptr;
 2129|      0|  const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2;
 2130|      0|  const int step = 1 << block_mis_log2;
 2131|       |
 2132|      0|  uint64_t accum_spatial_mvpred_err = 0;
 2133|      0|  uint64_t accum_best_err = 0;
 2134|       |
 2135|      0|  for (int mi_row = 0; mi_row < tpl_frame->mi_rows; mi_row += step) {
  ------------------
  |  Branch (2135:24): [True: 0, False: 0]
  ------------------
 2136|      0|    for (int mi_col = 0; mi_col < tpl_frame->mi_cols; mi_col += step) {
  ------------------
  |  Branch (2136:26): [True: 0, False: 0]
  ------------------
 2137|      0|      TplDepStats *tpl_stats_ptr = &tpl_ptr[av1_tpl_ptr_pos(
 2138|      0|          mi_row, mi_col, tpl_frame->stride, block_mis_log2)];
 2139|      0|      const int cur_best_ref_idx = tpl_stats_ptr->ref_frame_index[0];
 2140|      0|      if (cur_best_ref_idx == NONE_FRAME) continue;
  ------------------
  |  Branch (2140:11): [True: 0, False: 0]
  ------------------
 2141|       |
 2142|      0|      int_mv cur_mv = tpl_stats_ptr->mv[cur_best_ref_idx];
 2143|      0|      lower_mv_precision(&cur_mv.as_mv, allow_high_precision_mv,
 2144|      0|                         force_integer_mv);
 2145|       |
 2146|      0|      const int cur_spatial_mvpred_err = get_spatial_mvpred_err(
 2147|      0|          cm, tpl_data, tpl_idx, mi_row, mi_col, cur_best_ref_idx, cur_mv,
 2148|      0|          allow_high_precision_mv, force_integer_mv);
 2149|       |
 2150|      0|      const int cur_temporal_mvpred_err = get_temporal_mvpred_err(
 2151|      0|          cm, mi_row, mi_col, tpl_frame->mi_rows, tpl_frame->mi_cols,
 2152|      0|          cur_best_ref_idx, cur_mv, allow_high_precision_mv, force_integer_mv);
 2153|       |
 2154|      0|      const int cur_best_err =
 2155|      0|          AOMMIN(cur_spatial_mvpred_err, cur_temporal_mvpred_err);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2156|      0|      accum_spatial_mvpred_err += cur_spatial_mvpred_err;
 2157|      0|      accum_best_err += cur_best_err;
 2158|      0|    }
 2159|      0|  }
 2160|       |
 2161|      0|  const float threshold =
 2162|      0|      get_thresh_based_on_q(cm->quant_params.base_qindex, cpi->oxcf.speed);
 2163|      0|  const float mv_err_reduction =
 2164|      0|      (float)(accum_spatial_mvpred_err - accum_best_err);
 2165|       |
 2166|      0|  if (mv_err_reduction <= threshold * accum_spatial_mvpred_err)
  ------------------
  |  Branch (2166:7): [True: 0, False: 0]
  ------------------
 2167|      0|    cm->features.allow_ref_frame_mvs = 0;
 2168|      0|}
encodeframe.c:check_skip_mode_enabled:
 1670|  73.6k|static int check_skip_mode_enabled(AV1_COMP *const cpi) {
 1671|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 1672|       |
 1673|  73.6k|  av1_setup_skip_mode_allowed(cm);
 1674|  73.6k|  if (!cm->current_frame.skip_mode_info.skip_mode_allowed) return 0;
  ------------------
  |  Branch (1674:7): [True: 73.6k, False: 0]
  ------------------
 1675|       |
 1676|       |  // Turn off skip mode if the temporal distances of the reference pair to the
 1677|       |  // current frame are different by more than 1 frame.
 1678|      0|  const int cur_offset = (int)cm->current_frame.order_hint;
 1679|      0|  int ref_offset[2];
 1680|      0|  get_skip_mode_ref_offsets(cm, ref_offset);
 1681|      0|  const int cur_to_ref0 = get_relative_dist(&cm->seq_params->order_hint_info,
 1682|      0|                                            cur_offset, ref_offset[0]);
 1683|      0|  const int cur_to_ref1 = abs(get_relative_dist(
 1684|      0|      &cm->seq_params->order_hint_info, cur_offset, ref_offset[1]));
 1685|      0|  if (abs(cur_to_ref0 - cur_to_ref1) > 1) return 0;
  ------------------
  |  Branch (1685:7): [True: 0, False: 0]
  ------------------
 1686|       |
 1687|       |  // High Latency: Turn off skip mode if all refs are fwd.
 1688|      0|  if (cpi->all_one_sided_refs && cpi->oxcf.gf_cfg.lag_in_frames > 0) return 0;
  ------------------
  |  Branch (1688:7): [True: 0, False: 0]
  |  Branch (1688:34): [True: 0, False: 0]
  ------------------
 1689|       |
 1690|      0|  const int ref_frame[2] = {
 1691|      0|    cm->current_frame.skip_mode_info.ref_frame_idx_0 + LAST_FRAME,
 1692|      0|    cm->current_frame.skip_mode_info.ref_frame_idx_1 + LAST_FRAME
 1693|      0|  };
 1694|      0|  if (!(cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame[0]]) ||
  ------------------
  |  Branch (1694:7): [True: 0, False: 0]
  ------------------
 1695|      0|      !(cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame[1]]))
  ------------------
  |  Branch (1695:7): [True: 0, False: 0]
  ------------------
 1696|      0|    return 0;
 1697|       |
 1698|      0|  return 1;
 1699|      0|}
encodeframe.c:populate_thresh_to_force_zeromv_skip:
 1914|  73.6k|static void populate_thresh_to_force_zeromv_skip(AV1_COMP *cpi) {
 1915|  73.6k|  if (cpi->sf.rt_sf.part_early_exit_zeromv == 0) return;
  ------------------
  |  Branch (1915:7): [True: 73.6k, False: 0]
  ------------------
 1916|       |
 1917|       |  // Threshold for forcing zeromv-skip decision is as below:
 1918|       |  // For 128x128 blocks, threshold is 10000 and per pixel threshold is 0.6103.
 1919|       |  // For 64x64 blocks, threshold is 5000 and per pixel threshold is 1.221
 1920|       |  // allowing slightly higher error for smaller blocks.
 1921|       |  // Per Pixel Threshold of 64x64 block        Area of 64x64 block         1  1
 1922|       |  // ------------------------------------=sqrt(---------------------)=sqrt(-)=-
 1923|       |  // Per Pixel Threshold of 128x128 block      Area of 128x128 block       4  2
 1924|       |  // Thus, per pixel thresholds for blocks of size 32x32, 16x16,...  can be
 1925|       |  // chosen as 2.442, 4.884,.... As the per pixel error tends to be higher for
 1926|       |  // small blocks, the same is clipped to 4.
 1927|      0|  const unsigned int thresh_exit_128x128_part = FORCE_ZMV_SKIP_128X128_BLK_DIFF;
  ------------------
  |  | 1910|      0|#define FORCE_ZMV_SKIP_128X128_BLK_DIFF 10000
  ------------------
 1928|      0|  const int num_128x128_pix =
 1929|      0|      block_size_wide[BLOCK_128X128] * block_size_high[BLOCK_128X128];
 1930|       |
 1931|      0|  for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES_ALL; bsize++) {
  ------------------
  |  Branch (1931:38): [True: 0, False: 0]
  ------------------
 1932|      0|    const int num_block_pix = block_size_wide[bsize] * block_size_high[bsize];
 1933|       |
 1934|       |    // Calculate the threshold for zeromv-skip decision based on area of the
 1935|       |    // partition
 1936|      0|    unsigned int thresh_exit_part_blk =
 1937|      0|        (unsigned int)(thresh_exit_128x128_part *
 1938|      0|                           sqrt((double)num_block_pix / num_128x128_pix) +
 1939|      0|                       0.5);
 1940|      0|    thresh_exit_part_blk = AOMMIN(
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1941|      0|        thresh_exit_part_blk,
 1942|      0|        (unsigned int)(FORCE_ZMV_SKIP_MAX_PER_PIXEL_DIFF * num_block_pix));
 1943|      0|    cpi->zeromv_skip_thresh_exit_part[bsize] = thresh_exit_part_blk;
 1944|      0|  }
 1945|      0|}
encodeframe.c:encode_tiles:
 1570|  17.5k|static inline void encode_tiles(AV1_COMP *cpi) {
 1571|  17.5k|  AV1_COMMON *const cm = &cpi->common;
 1572|  17.5k|  const int tile_cols = cm->tiles.cols;
 1573|  17.5k|  const int tile_rows = cm->tiles.rows;
 1574|  17.5k|  int tile_col, tile_row;
 1575|       |
 1576|  17.5k|  MACROBLOCK *const mb = &cpi->td.mb;
 1577|  17.5k|  assert(IMPLIES(cpi->tile_data == NULL, cpi->allocated_tiles == 0));
 1578|  17.5k|  if (cpi->allocated_tiles != tile_cols * tile_rows) av1_alloc_tile_data(cpi);
  ------------------
  |  Branch (1578:7): [True: 5.13k, False: 12.4k]
  ------------------
 1579|       |
 1580|  17.5k|  av1_init_tile_data(cpi);
 1581|  17.5k|  av1_alloc_mb_data(cpi, mb);
 1582|       |
 1583|  36.9k|  for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
  ------------------
  |  Branch (1583:22): [True: 19.3k, False: 17.5k]
  ------------------
 1584|  41.1k|    for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
  ------------------
  |  Branch (1584:24): [True: 21.8k, False: 19.3k]
  ------------------
 1585|  21.8k|      TileDataEnc *const this_tile =
 1586|  21.8k|          &cpi->tile_data[tile_row * cm->tiles.cols + tile_col];
 1587|  21.8k|      cpi->td.intrabc_used = 0;
 1588|  21.8k|      cpi->td.deltaq_used = 0;
 1589|  21.8k|      cpi->td.abs_sum_level = 0;
 1590|  21.8k|      cpi->td.rd_counts.seg_tmp_pred_cost[0] = 0;
 1591|  21.8k|      cpi->td.rd_counts.seg_tmp_pred_cost[1] = 0;
 1592|  21.8k|      cpi->td.mb.e_mbd.tile_ctx = &this_tile->tctx;
 1593|  21.8k|      cpi->td.mb.tile_pb_ctx = &this_tile->tctx;
 1594|  21.8k|      av1_init_rtc_counters(&cpi->td.mb);
 1595|  21.8k|      cpi->td.mb.palette_pixels = 0;
 1596|  21.8k|      av1_encode_tile(cpi, &cpi->td, tile_row, tile_col);
 1597|  21.8k|      if (!frame_is_intra_only(&cpi->common))
  ------------------
  |  Branch (1597:11): [True: 17.0k, False: 4.81k]
  ------------------
 1598|  17.0k|        av1_accumulate_rtc_counters(cpi, &cpi->td.mb);
 1599|  21.8k|      cpi->palette_pixel_num += cpi->td.mb.palette_pixels;
 1600|  21.8k|      cpi->intrabc_used |= cpi->td.intrabc_used;
 1601|  21.8k|      cpi->deltaq_used |= cpi->td.deltaq_used;
 1602|  21.8k|    }
 1603|  19.3k|  }
 1604|       |
 1605|  17.5k|  av1_dealloc_mb_data(mb, av1_num_planes(cm));
 1606|  17.5k|}

av1_set_ssim_rdmult:
   26|  8.25M|                         const int mi_col, int *const rdmult) {
   27|  8.25M|  const AV1_COMMON *const cm = &cpi->common;
   28|       |
   29|  8.25M|  const BLOCK_SIZE bsize_base = BLOCK_16X16;
   30|  8.25M|  const int num_mi_w = mi_size_wide[bsize_base];
   31|  8.25M|  const int num_mi_h = mi_size_high[bsize_base];
   32|  8.25M|  const int num_cols = (cm->mi_params.mi_cols + num_mi_w - 1) / num_mi_w;
   33|  8.25M|  const int num_rows = (cm->mi_params.mi_rows + num_mi_h - 1) / num_mi_h;
   34|  8.25M|  const int num_bcols = (mi_size_wide[bsize] + num_mi_w - 1) / num_mi_w;
   35|  8.25M|  const int num_brows = (mi_size_high[bsize] + num_mi_h - 1) / num_mi_h;
   36|  8.25M|  int row, col;
   37|  8.25M|  double num_of_mi = 0.0;
   38|  8.25M|  double geom_mean_of_scale = 1.0;
   39|       |
   40|       |  // To avoid overflow of 'geom_mean_of_scale', bsize_base must be at least
   41|       |  // BLOCK_8X8.
   42|       |  //
   43|       |  // For bsize=BLOCK_128X128 and bsize_base=BLOCK_8X8, the loop below would
   44|       |  // iterate 256 times. Considering the maximum value of
   45|       |  // cpi->ssim_rdmult_scaling_factors (see av1_set_mb_ssim_rdmult_scaling()),
   46|       |  // geom_mean_of_scale can go up to 4.8323^256, which is within DBL_MAX
   47|       |  // (maximum value a double data type can hold). If bsize_base is modified to
   48|       |  // BLOCK_4X4 (minimum possible block size), geom_mean_of_scale can go up
   49|       |  // to 4.8323^1024 and exceed DBL_MAX, resulting in data overflow.
   50|  8.25M|  assert(bsize_base >= BLOCK_8X8);
   51|  8.25M|  assert(cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIM ||
   52|  8.25M|         cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
   53|  8.25M|         cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2);
   54|       |
   55|  8.25M|  for (row = mi_row / num_mi_w;
   56|  16.7M|       row < num_rows && row < mi_row / num_mi_w + num_brows; ++row) {
  ------------------
  |  Branch (56:8): [True: 14.3M, False: 2.36M]
  |  Branch (56:26): [True: 8.47M, False: 5.89M]
  ------------------
   57|  8.47M|    for (col = mi_col / num_mi_h;
   58|  17.4M|         col < num_cols && col < mi_col / num_mi_h + num_bcols; ++col) {
  ------------------
  |  Branch (58:10): [True: 15.0M, False: 2.40M]
  |  Branch (58:28): [True: 8.94M, False: 6.06M]
  ------------------
   59|  8.94M|      const int index = row * num_cols + col;
   60|  8.94M|      assert(cpi->ssim_rdmult_scaling_factors[index] != 0.0);
   61|  8.94M|      geom_mean_of_scale *= cpi->ssim_rdmult_scaling_factors[index];
   62|  8.94M|      num_of_mi += 1.0;
   63|  8.94M|    }
   64|  8.47M|  }
   65|  8.25M|  geom_mean_of_scale = pow(geom_mean_of_scale, (1.0 / num_of_mi));
   66|       |
   67|  8.25M|  *rdmult = (int)((double)(*rdmult) * geom_mean_of_scale + 0.5);
   68|  8.25M|  *rdmult = AOMMAX(*rdmult, 0);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 8.26M, False: 18.4E]
  |  |  ------------------
  ------------------
   69|  8.25M|  av1_set_error_per_bit(errorperbit, *rdmult);
   70|  8.25M|}
av1_get_cb_rdmult:
   95|  7.37M|                      const int mi_col) {
   96|  7.37M|  const AV1_COMMON *const cm = &cpi->common;
   97|  7.37M|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
   98|  7.37M|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
   99|  7.37M|  const int tpl_idx = cpi->gf_frame_index;
  100|  7.37M|  int deltaq_rdmult = set_rdmult(cpi, x, -1);
  101|  7.37M|  if (!av1_tpl_stats_ready(&cpi->ppi->tpl_data, tpl_idx)) return deltaq_rdmult;
  ------------------
  |  Branch (101:7): [True: 7.37M, False: 2.13k]
  ------------------
  102|  2.13k|  if (cm->superres_scale_denominator != SCALE_NUMERATOR) return deltaq_rdmult;
  ------------------
  |  |   22|  2.13k|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (102:7): [True: 0, False: 2.13k]
  ------------------
  103|  2.13k|  if (cpi->oxcf.q_cfg.aq_mode != NO_AQ) return deltaq_rdmult;
  ------------------
  |  Branch (103:7): [True: 0, False: 2.13k]
  ------------------
  104|  2.13k|  if (x->rb == 0) return deltaq_rdmult;
  ------------------
  |  Branch (104:7): [True: 0, False: 2.13k]
  ------------------
  105|       |
  106|  2.13k|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
  107|  2.13k|  TplDepFrame *tpl_frame = &tpl_data->tpl_frame[tpl_idx];
  108|  2.13k|  TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr;
  109|       |
  110|  2.13k|  const int mi_wide = mi_size_wide[bsize];
  111|  2.13k|  const int mi_high = mi_size_high[bsize];
  112|       |
  113|  2.13k|  int tpl_stride = tpl_frame->stride;
  114|  2.13k|  double intra_cost_base = 0;
  115|  2.13k|  double mc_dep_cost_base = 0;
  116|  2.13k|  double cbcmp_base = 0;
  117|  2.13k|  const int step = 1 << tpl_data->tpl_stats_block_mis_log2;
  118|       |
  119|  2.13k|  for (int row = mi_row; row < mi_row + mi_high; row += step) {
  ------------------
  |  Branch (119:26): [True: 0, False: 2.13k]
  ------------------
  120|      0|    for (int col = mi_col; col < mi_col + mi_wide; col += step) {
  ------------------
  |  Branch (120:28): [True: 0, False: 0]
  ------------------
  121|      0|      if (row >= cm->mi_params.mi_rows || col >= cm->mi_params.mi_cols)
  ------------------
  |  Branch (121:11): [True: 0, False: 0]
  |  Branch (121:43): [True: 0, False: 0]
  ------------------
  122|      0|        continue;
  123|       |
  124|      0|      TplDepStats *this_stats = &tpl_stats[av1_tpl_ptr_pos(
  125|      0|          row, col, tpl_stride, tpl_data->tpl_stats_block_mis_log2)];
  126|       |
  127|      0|      double cbcmp = (double)this_stats->srcrf_dist;
  128|      0|      int64_t mc_dep_delta =
  129|      0|          RDCOST(tpl_frame->base_rdmult, this_stats->mc_dep_rate,
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  130|      0|                 this_stats->mc_dep_dist);
  131|      0|      double dist_scaled = (double)(this_stats->recrf_dist << RDDIV_BITS);
  ------------------
  |  |   29|      0|#define RDDIV_BITS 7
  ------------------
  132|      0|      intra_cost_base += log(dist_scaled) * cbcmp;
  133|      0|      mc_dep_cost_base += log(3 * dist_scaled + mc_dep_delta) * cbcmp;
  134|      0|      cbcmp_base += cbcmp;
  135|      0|    }
  136|      0|  }
  137|       |
  138|  2.13k|  if (cbcmp_base == 0) return deltaq_rdmult;
  ------------------
  |  Branch (138:7): [True: 0, False: 2.13k]
  ------------------
  139|       |
  140|  2.13k|  double rk = exp((intra_cost_base - mc_dep_cost_base) / cbcmp_base);
  141|  2.13k|  deltaq_rdmult = (int)(deltaq_rdmult * (rk / x->rb));
  142|       |
  143|  2.13k|  return AOMMAX(deltaq_rdmult, 1);
  ------------------
  |  |   35|  2.13k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.13k]
  |  |  ------------------
  ------------------
  144|  2.13k|}
av1_update_state:
  178|  6.38M|                      int mi_col, BLOCK_SIZE bsize, RUN_TYPE dry_run) {
  179|  6.38M|  int i, x_idx, y;
  180|  6.38M|  const AV1_COMMON *const cm = &cpi->common;
  181|  6.38M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  182|  6.38M|  const int num_planes = av1_num_planes(cm);
  183|  6.38M|  MACROBLOCK *const x = &td->mb;
  184|  6.38M|  MACROBLOCKD *const xd = &x->e_mbd;
  185|  6.38M|  struct macroblock_plane *const p = x->plane;
  186|  6.38M|  struct macroblockd_plane *const pd = xd->plane;
  187|  6.38M|  const MB_MODE_INFO *const mi = &ctx->mic;
  188|  6.38M|  if (ctx == NULL) {
  ------------------
  |  Branch (188:7): [True: 0, False: 6.38M]
  ------------------
  189|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
  190|      0|                       "ctx is NULL in av1_update_state: %d %d %d %d %d %d \n",
  191|      0|                       cm->current_frame.frame_type, cm->width, cm->height,
  192|      0|                       mi_col, mi_row, bsize);
  193|      0|  }
  194|  6.38M|  if (mi == NULL) {
  ------------------
  |  Branch (194:7): [True: 0, False: 6.38M]
  ------------------
  195|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
  196|      0|                       "mi is NULL in av1_update_state: %d %d %d %d %d %d \n",
  197|      0|                       cm->current_frame.frame_type, cm->width, cm->height,
  198|      0|                       mi_col, mi_row, bsize);
  199|      0|  }
  200|  6.38M|  MB_MODE_INFO *const mi_addr = xd->mi[0];
  201|  6.38M|  const struct segmentation *const seg = &cm->seg;
  202|  6.38M|  assert(bsize < BLOCK_SIZES_ALL);
  203|  6.38M|  assert(mi->bsize == bsize);
  204|  6.38M|  const int bw = mi_size_wide[bsize];
  205|  6.38M|  const int bh = mi_size_high[bsize];
  206|  6.38M|  const int mis = mi_params->mi_stride;
  207|  6.38M|  const int mi_width = mi_size_wide[bsize];
  208|  6.38M|  const int mi_height = mi_size_high[bsize];
  209|  6.38M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
  210|       |
  211|  6.38M|  *mi_addr = *mi;
  212|  6.38M|  copy_mbmi_ext_frame_to_mbmi_ext(&x->mbmi_ext, &ctx->mbmi_ext_best,
  213|  6.38M|                                  av1_ref_frame_type(ctx->mic.ref_frame));
  214|       |
  215|  6.38M|  txfm_info->skip_txfm = ctx->rd_stats.skip_txfm;
  216|       |
  217|  6.38M|  xd->tx_type_map = ctx->tx_type_map;
  218|  6.38M|  xd->tx_type_map_stride = mi_size_wide[bsize];
  219|       |  // If not dry_run, copy the transform type data into the frame level buffer.
  220|       |  // Encoder will fetch tx types when writing bitstream.
  221|  6.38M|  if (!dry_run) {
  ------------------
  |  Branch (221:7): [True: 2.04M, False: 4.34M]
  ------------------
  222|  2.04M|    const int grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
  223|  2.04M|    uint8_t *const tx_type_map = mi_params->tx_type_map + grid_idx;
  224|  2.04M|    const int mi_stride = mi_params->mi_stride;
  225|  6.56M|    for (int blk_row = 0; blk_row < bh; ++blk_row) {
  ------------------
  |  Branch (225:27): [True: 4.52M, False: 2.04M]
  ------------------
  226|  4.52M|      av1_copy_array(tx_type_map + blk_row * mi_stride,
  ------------------
  |  |   38|  4.52M|  do {                                                    \
  |  |   39|  4.52M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  4.52M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  4.52M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4.52M]
  |  |  ------------------
  ------------------
  227|  4.52M|                     xd->tx_type_map + blk_row * xd->tx_type_map_stride, bw);
  228|  4.52M|    }
  229|  2.04M|    xd->tx_type_map = tx_type_map;
  230|  2.04M|    xd->tx_type_map_stride = mi_stride;
  231|  2.04M|  }
  232|       |
  233|       |  // If segmentation in use
  234|  6.38M|  if (seg->enabled) {
  ------------------
  |  Branch (234:7): [True: 0, False: 6.38M]
  ------------------
  235|       |    // For in frame complexity AQ or ROI copy the segment id from the
  236|       |    // segment map.
  237|      0|    if (cpi->oxcf.q_cfg.aq_mode == COMPLEXITY_AQ || cpi->roi.enabled) {
  ------------------
  |  Branch (237:9): [True: 0, False: 0]
  |  Branch (237:53): [True: 0, False: 0]
  ------------------
  238|      0|      const uint8_t *const map =
  239|      0|          seg->update_map ? cpi->enc_seg.map : cm->last_frame_seg_map;
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|      mi_addr->segment_id =
  241|      0|          map ? get_segment_id(mi_params, map, bsize, mi_row, mi_col) : 0;
  ------------------
  |  Branch (241:11): [True: 0, False: 0]
  ------------------
  242|      0|    }
  243|       |    // Else for cyclic refresh mode update the segment map, set the segment id
  244|       |    // and then update the quantizer.
  245|      0|    if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ && !cpi->roi.enabled &&
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  |  Branch (245:57): [True: 0, False: 0]
  ------------------
  246|      0|        mi_addr->segment_id != AM_SEGMENT_ID_INACTIVE &&
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|        !cpi->rc.rtc_external_ratectrl) {
  ------------------
  |  Branch (247:9): [True: 0, False: 0]
  ------------------
  248|      0|      av1_cyclic_refresh_update_segment(cpi, x, mi_row, mi_col, bsize,
  249|      0|                                        ctx->rd_stats.rate, ctx->rd_stats.dist,
  250|      0|                                        txfm_info->skip_txfm, dry_run);
  251|      0|    }
  252|      0|    if (mi_addr->uv_mode == UV_CFL_PRED && !is_cfl_allowed(xd))
  ------------------
  |  Branch (252:9): [True: 0, False: 0]
  |  Branch (252:44): [True: 0, False: 0]
  ------------------
  253|      0|      mi_addr->uv_mode = UV_DC_PRED;
  254|       |
  255|      0|    if (!dry_run && !mi_addr->skip_txfm) {
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  |  Branch (255:21): [True: 0, False: 0]
  ------------------
  256|      0|      int cdf_num;
  257|      0|      const uint8_t spatial_pred = av1_get_spatial_seg_pred(
  258|      0|          cm, xd, &cdf_num, cpi->cyclic_refresh->skip_over4x4);
  259|      0|      const uint8_t coded_id = av1_neg_interleave(
  260|      0|          mi_addr->segment_id, spatial_pred, seg->last_active_segid + 1);
  261|      0|      int64_t spatial_cost = x->mode_costs.spatial_pred_cost[cdf_num][coded_id];
  262|      0|      td->rd_counts.seg_tmp_pred_cost[0] += spatial_cost;
  263|       |
  264|      0|      const int pred_segment_id =
  265|      0|          cm->last_frame_seg_map
  ------------------
  |  Branch (265:11): [True: 0, False: 0]
  ------------------
  266|      0|              ? get_segment_id(mi_params, cm->last_frame_seg_map, bsize, mi_row,
  267|      0|                               mi_col)
  268|      0|              : 0;
  269|      0|      const int use_tmp_pred = pred_segment_id == mi_addr->segment_id;
  270|      0|      const uint8_t tmp_pred_ctx = av1_get_pred_context_seg_id(xd);
  271|      0|      td->rd_counts.seg_tmp_pred_cost[1] +=
  272|      0|          x->mode_costs.tmp_pred_cost[tmp_pred_ctx][use_tmp_pred];
  273|      0|      if (!use_tmp_pred) {
  ------------------
  |  Branch (273:11): [True: 0, False: 0]
  ------------------
  274|      0|        td->rd_counts.seg_tmp_pred_cost[1] += spatial_cost;
  275|      0|      }
  276|      0|    }
  277|      0|  }
  278|       |
  279|       |  // Count zero motion vector.
  280|  6.38M|  if (!dry_run && !frame_is_intra_only(cm)) {
  ------------------
  |  Branch (280:7): [True: 2.04M, False: 4.34M]
  |  Branch (280:19): [True: 1.87M, False: 164k]
  ------------------
  281|  1.87M|    const MV mv = mi->mv[0].as_mv;
  282|  1.87M|    if (is_inter_block(mi) && mi->ref_frame[0] == LAST_FRAME &&
  ------------------
  |  Branch (282:9): [True: 511k, False: 1.36M]
  |  Branch (282:31): [True: 511k, False: 18.4E]
  ------------------
  283|   511k|        abs(mv.row) < 8 && abs(mv.col) < 8) {
  ------------------
  |  Branch (283:9): [True: 207k, False: 304k]
  |  Branch (283:28): [True: 138k, False: 68.3k]
  ------------------
  284|   138k|      const int ymis = AOMMIN(cm->mi_params.mi_rows - mi_row, bh);
  ------------------
  |  |   34|   138k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.04k, False: 137k]
  |  |  ------------------
  ------------------
  285|       |      // Accumulate low_content_frame.
  286|   322k|      for (int mi_y = 0; mi_y < ymis; mi_y += 2) x->cnt_zeromv += bw << 1;
  ------------------
  |  Branch (286:26): [True: 183k, False: 138k]
  ------------------
  287|   138k|    }
  288|  1.87M|  }
  289|       |
  290|  18.2M|  for (i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (290:15): [True: 11.8M, False: 6.38M]
  ------------------
  291|  11.8M|    p[i].coeff = ctx->coeff[i];
  292|  11.8M|    p[i].qcoeff = ctx->qcoeff[i];
  293|  11.8M|    p[i].dqcoeff = ctx->dqcoeff[i];
  294|  11.8M|    p[i].eobs = ctx->eobs[i];
  295|  11.8M|    p[i].txb_entropy_ctx = ctx->txb_entropy_ctx[i];
  296|  11.8M|  }
  297|  19.1M|  for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
  ------------------
  |  Branch (297:15): [True: 12.7M, False: 6.38M]
  ------------------
  298|       |  // Restore the coding context of the MB to that that was in place
  299|       |  // when the mode was picked for it
  300|       |
  301|  6.38M|  const int cols =
  302|  6.38M|      AOMMIN((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width, mi_width);
  ------------------
  |  |   34|  6.38M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.80k, False: 6.38M]
  |  |  ------------------
  ------------------
  303|  6.38M|  const int rows = AOMMIN(
  ------------------
  |  |   34|  6.38M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.29k, False: 6.38M]
  |  |  ------------------
  ------------------
  304|  6.38M|      (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height, mi_height);
  305|  19.4M|  for (y = 0; y < rows; y++) {
  ------------------
  |  Branch (305:15): [True: 13.1M, False: 6.38M]
  ------------------
  306|  42.3M|    for (x_idx = 0; x_idx < cols; x_idx++) xd->mi[x_idx + y * mis] = mi_addr;
  ------------------
  |  Branch (306:21): [True: 29.2M, False: 13.1M]
  ------------------
  307|  13.1M|  }
  308|       |
  309|  6.38M|  if (cpi->oxcf.q_cfg.aq_mode ||
  ------------------
  |  Branch (309:7): [True: 18.4E, False: 6.39M]
  ------------------
  310|  6.39M|      (cpi->roi.enabled && cpi->roi.delta_qp_enabled))
  ------------------
  |  Branch (310:8): [True: 0, False: 6.39M]
  |  Branch (310:28): [True: 0, False: 0]
  ------------------
  311|      0|    av1_init_plane_quantizers(cpi, x, mi_addr->segment_id, 0);
  312|       |
  313|  6.38M|  if (dry_run) return;
  ------------------
  |  Branch (313:7): [True: 4.34M, False: 2.03M]
  ------------------
  314|       |
  315|       |#if CONFIG_INTERNAL_STATS
  316|       |  {
  317|       |    unsigned int *const mode_chosen_counts =
  318|       |        (unsigned int *)cpi->mode_chosen_counts;  // Cast const away.
  319|       |    if (frame_is_intra_only(cm)) {
  320|       |      static const int kf_mode_index[] = {
  321|       |        THR_DC /*DC_PRED*/,
  322|       |        THR_V_PRED /*V_PRED*/,
  323|       |        THR_H_PRED /*H_PRED*/,
  324|       |        THR_D45_PRED /*D45_PRED*/,
  325|       |        THR_D135_PRED /*D135_PRED*/,
  326|       |        THR_D113_PRED /*D113_PRED*/,
  327|       |        THR_D157_PRED /*D157_PRED*/,
  328|       |        THR_D203_PRED /*D203_PRED*/,
  329|       |        THR_D67_PRED /*D67_PRED*/,
  330|       |        THR_SMOOTH,   /*SMOOTH_PRED*/
  331|       |        THR_SMOOTH_V, /*SMOOTH_V_PRED*/
  332|       |        THR_SMOOTH_H, /*SMOOTH_H_PRED*/
  333|       |        THR_PAETH /*PAETH_PRED*/,
  334|       |      };
  335|       |      ++mode_chosen_counts[kf_mode_index[mi_addr->mode]];
  336|       |    } else {
  337|       |      // Note how often each mode chosen as best
  338|       |      ++mode_chosen_counts[ctx->best_mode_index];
  339|       |    }
  340|       |  }
  341|       |#endif
  342|  2.03M|  if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (342:7): [True: 1.87M, False: 160k]
  ------------------
  343|  1.87M|    if (is_inter_block(mi) && cm->features.interp_filter == SWITCHABLE) {
  ------------------
  |  Branch (343:9): [True: 511k, False: 1.36M]
  |  Branch (343:31): [True: 511k, False: 4]
  ------------------
  344|       |      // When the frame interp filter is SWITCHABLE, several cases that always
  345|       |      // use the default type (EIGHTTAP_REGULAR) are described in
  346|       |      // av1_is_interp_needed(). Here, we should keep the counts for all
  347|       |      // applicable blocks, so the frame filter resetting decision in
  348|       |      // fix_interp_filter() is made correctly.
  349|   511k|      update_filter_type_count(td->counts, xd, mi_addr);
  350|   511k|    }
  351|  1.87M|  }
  352|       |
  353|  2.03M|  const int x_mis = AOMMIN(bw, mi_params->mi_cols - mi_col);
  ------------------
  |  |   34|  2.03M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.72M, False: 313k]
  |  |  ------------------
  ------------------
  354|  2.03M|  const int y_mis = AOMMIN(bh, mi_params->mi_rows - mi_row);
  ------------------
  |  |   34|  2.03M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.72M, False: 318k]
  |  |  ------------------
  ------------------
  355|  2.03M|  if (cm->seq_params->order_hint_info.enable_ref_frame_mvs)
  ------------------
  |  Branch (355:7): [True: 2.04M, False: 18.4E]
  ------------------
  356|  2.04M|    av1_copy_frame_mvs(cm, mi, mi_row, mi_col, x_mis, y_mis);
  357|  2.03M|}
av1_update_inter_mode_stats:
  360|   510k|                                 PREDICTION_MODE mode, int16_t mode_context) {
  361|   510k|  (void)counts;
  362|       |
  363|   510k|  int16_t mode_ctx = mode_context & NEWMV_CTX_MASK;
  ------------------
  |  |  490|   510k|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|   510k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  364|   510k|  if (mode == NEWMV) {
  ------------------
  |  Branch (364:7): [True: 276k, False: 234k]
  ------------------
  365|       |#if CONFIG_ENTROPY_STATS
  366|       |    ++counts->newmv_mode[mode_ctx][0];
  367|       |#endif
  368|   276k|    update_cdf(fc->newmv_cdf[mode_ctx], 0, 2);
  369|   276k|    return;
  370|   276k|  }
  371|       |
  372|       |#if CONFIG_ENTROPY_STATS
  373|       |  ++counts->newmv_mode[mode_ctx][1];
  374|       |#endif
  375|   234k|  update_cdf(fc->newmv_cdf[mode_ctx], 1, 2);
  376|       |
  377|   234k|  mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  487|   234k|#define GLOBALMV_OFFSET 3
  ------------------
                mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  491|   234k|#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|   234k|#define REFMV_OFFSET 4
  |  |  ------------------
  |  |               #define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  487|   234k|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  378|   234k|  if (mode == GLOBALMV) {
  ------------------
  |  Branch (378:7): [True: 13.8k, False: 220k]
  ------------------
  379|       |#if CONFIG_ENTROPY_STATS
  380|       |    ++counts->zeromv_mode[mode_ctx][0];
  381|       |#endif
  382|  13.8k|    update_cdf(fc->zeromv_cdf[mode_ctx], 0, 2);
  383|  13.8k|    return;
  384|  13.8k|  }
  385|       |
  386|       |#if CONFIG_ENTROPY_STATS
  387|       |  ++counts->zeromv_mode[mode_ctx][1];
  388|       |#endif
  389|   220k|  update_cdf(fc->zeromv_cdf[mode_ctx], 1, 2);
  390|       |
  391|   220k|  mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|   220k|#define REFMV_OFFSET 4
  ------------------
                mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|   220k|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|   220k|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  392|       |#if CONFIG_ENTROPY_STATS
  393|       |  ++counts->refmv_mode[mode_ctx][mode != NEARESTMV];
  394|       |#endif
  395|   220k|  update_cdf(fc->refmv_cdf[mode_ctx], mode != NEARESTMV, 2);
  396|   220k|}
av1_sum_intra_stats:
  447|  1.53M|                         const MB_MODE_INFO *left_mi, const int intraonly) {
  448|  1.53M|  FRAME_CONTEXT *fc = xd->tile_ctx;
  449|  1.53M|  const PREDICTION_MODE y_mode = mbmi->mode;
  450|  1.53M|  (void)counts;
  451|  1.53M|  const BLOCK_SIZE bsize = mbmi->bsize;
  452|       |
  453|  1.53M|  if (intraonly) {
  ------------------
  |  Branch (453:7): [True: 164k, False: 1.36M]
  ------------------
  454|       |#if CONFIG_ENTROPY_STATS
  455|       |    const PREDICTION_MODE above = av1_above_block_mode(above_mi);
  456|       |    const PREDICTION_MODE left = av1_left_block_mode(left_mi);
  457|       |    const int above_ctx = intra_mode_context[above];
  458|       |    const int left_ctx = intra_mode_context[left];
  459|       |    ++counts->kf_y_mode[above_ctx][left_ctx][y_mode];
  460|       |#endif  // CONFIG_ENTROPY_STATS
  461|   164k|    update_cdf(get_y_mode_cdf(fc, above_mi, left_mi), y_mode, INTRA_MODES);
  462|  1.36M|  } else {
  463|       |#if CONFIG_ENTROPY_STATS
  464|       |    ++counts->y_mode[size_group_lookup[bsize]][y_mode];
  465|       |#endif  // CONFIG_ENTROPY_STATS
  466|  1.36M|    update_cdf(fc->y_mode_cdf[size_group_lookup[bsize]], y_mode, INTRA_MODES);
  467|  1.36M|  }
  468|       |
  469|  1.53M|  if (av1_filter_intra_allowed(cm, mbmi)) {
  ------------------
  |  Branch (469:7): [True: 1.33M, False: 194k]
  ------------------
  470|  1.33M|    const int use_filter_intra_mode =
  471|  1.33M|        mbmi->filter_intra_mode_info.use_filter_intra;
  472|       |#if CONFIG_ENTROPY_STATS
  473|       |    ++counts->filter_intra[mbmi->bsize][use_filter_intra_mode];
  474|       |    if (use_filter_intra_mode) {
  475|       |      ++counts
  476|       |            ->filter_intra_mode[mbmi->filter_intra_mode_info.filter_intra_mode];
  477|       |    }
  478|       |#endif  // CONFIG_ENTROPY_STATS
  479|  1.33M|    update_cdf(fc->filter_intra_cdfs[mbmi->bsize], use_filter_intra_mode, 2);
  480|  1.33M|    if (use_filter_intra_mode) {
  ------------------
  |  Branch (480:9): [True: 618k, False: 717k]
  ------------------
  481|   618k|      update_cdf(fc->filter_intra_mode_cdf,
  482|   618k|                 mbmi->filter_intra_mode_info.filter_intra_mode,
  483|   618k|                 FILTER_INTRA_MODES);
  484|   618k|    }
  485|  1.33M|  }
  486|  1.53M|  if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (486:7): [True: 122k, False: 1.40M]
  |  Branch (486:46): [True: 110k, False: 12.0k]
  ------------------
  487|       |#if CONFIG_ENTROPY_STATS
  488|       |    ++counts->angle_delta[mbmi->mode - V_PRED]
  489|       |                         [mbmi->angle_delta[PLANE_TYPE_Y] + MAX_ANGLE_DELTA];
  490|       |#endif
  491|   110k|    update_cdf(fc->angle_delta_cdf[mbmi->mode - V_PRED],
  492|   110k|               mbmi->angle_delta[PLANE_TYPE_Y] + MAX_ANGLE_DELTA,
  ------------------
  |  |  467|   110k|#define MAX_ANGLE_DELTA 3
  ------------------
  493|   110k|               2 * MAX_ANGLE_DELTA + 1);
  ------------------
  |  |  467|   110k|#define MAX_ANGLE_DELTA 3
  ------------------
  494|   110k|  }
  495|       |
  496|  1.53M|  if (!xd->is_chroma_ref) return;
  ------------------
  |  Branch (496:7): [True: 19.2k, False: 1.51M]
  ------------------
  497|       |
  498|  1.51M|  const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
  499|  1.51M|  const CFL_ALLOWED_TYPE cfl_allowed = is_cfl_allowed(xd);
  500|       |#if CONFIG_ENTROPY_STATS
  501|       |  ++counts->uv_mode[cfl_allowed][y_mode][uv_mode];
  502|       |#endif  // CONFIG_ENTROPY_STATS
  503|  1.51M|  update_cdf(fc->uv_mode_cdf[cfl_allowed][y_mode], uv_mode,
  504|  1.51M|             UV_INTRA_MODES - !cfl_allowed);
  505|  1.51M|  if (uv_mode == UV_CFL_PRED) {
  ------------------
  |  Branch (505:7): [True: 232k, False: 1.27M]
  ------------------
  506|   232k|    const int8_t joint_sign = mbmi->cfl_alpha_signs;
  507|   232k|    const uint8_t idx = mbmi->cfl_alpha_idx;
  508|       |
  509|       |#if CONFIG_ENTROPY_STATS
  510|       |    ++counts->cfl_sign[joint_sign];
  511|       |#endif
  512|   232k|    update_cdf(fc->cfl_sign_cdf, joint_sign, CFL_JOINT_SIGNS);
  ------------------
  |  |  279|   232k|#define CFL_JOINT_SIGNS (CFL_SIGNS * CFL_SIGNS - 1)
  ------------------
  513|   232k|    if (CFL_SIGN_U(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  281|   232k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  ------------------
  |  Branch (513:9): [True: 216k, False: 16.3k]
  ------------------
  514|   216k|      aom_cdf_prob *cdf_u = fc->cfl_alpha_cdf[CFL_CONTEXT_U(joint_sign)];
  ------------------
  |  |  288|   216k|#define CFL_CONTEXT_U(js) (js + 1 - CFL_SIGNS)
  ------------------
  515|       |
  516|       |#if CONFIG_ENTROPY_STATS
  517|       |      ++counts->cfl_alpha[CFL_CONTEXT_U(joint_sign)][CFL_IDX_U(idx)];
  518|       |#endif
  519|   216k|      update_cdf(cdf_u, CFL_IDX_U(idx), CFL_ALPHABET_SIZE);
  ------------------
  |  |  260|   216k|#define CFL_IDX_U(idx) (idx >> CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   216k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
                    update_cdf(cdf_u, CFL_IDX_U(idx), CFL_ALPHABET_SIZE);
  ------------------
  |  |  257|   216k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   216k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  520|   216k|    }
  521|   232k|    if (CFL_SIGN_V(joint_sign) != CFL_SIGN_ZERO) {
  ------------------
  |  |  283|   232k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  ------------------
  |  |  |  |  281|   232k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  |  Branch (521:9): [True: 206k, False: 26.0k]
  ------------------
  522|   206k|      aom_cdf_prob *cdf_v = fc->cfl_alpha_cdf[CFL_CONTEXT_V(joint_sign)];
  ------------------
  |  |  291|   206k|  (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  283|   206k|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  |  |  ------------------
  |  |  |  |  |  |  281|   206k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  281|   206k|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  523|       |
  524|       |#if CONFIG_ENTROPY_STATS
  525|       |      ++counts->cfl_alpha[CFL_CONTEXT_V(joint_sign)][CFL_IDX_V(idx)];
  526|       |#endif
  527|   206k|      update_cdf(cdf_v, CFL_IDX_V(idx), CFL_ALPHABET_SIZE);
  ------------------
  |  |  261|   206k|#define CFL_IDX_V(idx) (idx & (CFL_ALPHABET_SIZE - 1))
  |  |  ------------------
  |  |  |  |  257|   206k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|   206k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    update_cdf(cdf_v, CFL_IDX_V(idx), CFL_ALPHABET_SIZE);
  ------------------
  |  |  257|   206k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   206k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  528|   206k|    }
  529|   232k|  }
  530|  1.51M|  const PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
  531|  1.51M|  if (av1_is_directional_mode(intra_mode) && av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (531:7): [True: 62.4k, False: 1.44M]
  |  Branch (531:46): [True: 55.6k, False: 6.77k]
  ------------------
  532|       |#if CONFIG_ENTROPY_STATS
  533|       |    ++counts->angle_delta[intra_mode - V_PRED]
  534|       |                         [mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA];
  535|       |#endif
  536|  55.6k|    update_cdf(fc->angle_delta_cdf[intra_mode - V_PRED],
  537|  55.6k|               mbmi->angle_delta[PLANE_TYPE_UV] + MAX_ANGLE_DELTA,
  ------------------
  |  |  467|  55.6k|#define MAX_ANGLE_DELTA 3
  ------------------
  538|  55.6k|               2 * MAX_ANGLE_DELTA + 1);
  ------------------
  |  |  467|  55.6k|#define MAX_ANGLE_DELTA 3
  ------------------
  539|  55.6k|  }
  540|  1.51M|  if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize)) {
  ------------------
  |  Branch (540:7): [True: 61.6k, False: 1.45M]
  ------------------
  541|  61.6k|    update_palette_cdf(xd, mbmi, counts);
  542|  61.6k|  }
  543|  1.51M|}
av1_restore_context:
  547|  3.13M|                         const int num_planes) {
  548|  3.13M|  MACROBLOCKD *xd = &x->e_mbd;
  549|  3.13M|  int p;
  550|  3.13M|  const int num_4x4_blocks_wide = mi_size_wide[bsize];
  551|  3.13M|  const int num_4x4_blocks_high = mi_size_high[bsize];
  552|  3.13M|  int mi_width = mi_size_wide[bsize];
  553|  3.13M|  int mi_height = mi_size_high[bsize];
  554|  9.19M|  for (p = 0; p < num_planes; p++) {
  ------------------
  |  Branch (554:15): [True: 6.06M, False: 3.13M]
  ------------------
  555|  6.06M|    int tx_col = mi_col;
  556|  6.06M|    int tx_row = mi_row & MAX_MIB_MASK;
  ------------------
  |  |   50|  6.06M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  6.06M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  6.06M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  6.06M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  6.06M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  557|  6.06M|    memcpy(
  558|  6.06M|        xd->above_entropy_context[p] + (tx_col >> xd->plane[p].subsampling_x),
  559|  6.06M|        ctx->a + num_4x4_blocks_wide * p,
  560|  6.06M|        (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_wide) >>
  561|  6.06M|            xd->plane[p].subsampling_x);
  562|  6.06M|    memcpy(xd->left_entropy_context[p] + (tx_row >> xd->plane[p].subsampling_y),
  563|  6.06M|           ctx->l + num_4x4_blocks_high * p,
  564|  6.06M|           (sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >>
  565|  6.06M|               xd->plane[p].subsampling_y);
  566|  6.06M|  }
  567|  3.13M|  memcpy(xd->above_partition_context + mi_col, ctx->sa,
  568|  3.13M|         sizeof(*xd->above_partition_context) * mi_width);
  569|  3.13M|  memcpy(xd->left_partition_context + (mi_row & MAX_MIB_MASK), ctx->sl,
  ------------------
  |  |   50|  3.13M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  3.13M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  3.13M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  3.13M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  3.13M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  3.13M|         sizeof(xd->left_partition_context[0]) * mi_height);
  571|  3.13M|  xd->above_txfm_context = ctx->p_ta;
  572|  3.13M|  xd->left_txfm_context = ctx->p_tl;
  573|  3.13M|  memcpy(xd->above_txfm_context, ctx->ta,
  574|  3.13M|         sizeof(*xd->above_txfm_context) * mi_width);
  575|  3.13M|  memcpy(xd->left_txfm_context, ctx->tl,
  576|  3.13M|         sizeof(*xd->left_txfm_context) * mi_height);
  577|  3.13M|}
av1_save_context:
  581|  2.75M|                      const int num_planes) {
  582|  2.75M|  const MACROBLOCKD *xd = &x->e_mbd;
  583|  2.75M|  int p;
  584|  2.75M|  int mi_width = mi_size_wide[bsize];
  585|  2.75M|  int mi_height = mi_size_high[bsize];
  586|       |
  587|       |  // buffer the above/left context information of the block in search.
  588|  8.01M|  for (p = 0; p < num_planes; ++p) {
  ------------------
  |  Branch (588:15): [True: 5.26M, False: 2.75M]
  ------------------
  589|  5.26M|    int tx_col = mi_col;
  590|  5.26M|    int tx_row = mi_row & MAX_MIB_MASK;
  ------------------
  |  |   50|  5.26M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  5.26M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  5.26M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  5.26M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  5.26M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|  5.26M|    memcpy(
  592|  5.26M|        ctx->a + mi_width * p,
  593|  5.26M|        xd->above_entropy_context[p] + (tx_col >> xd->plane[p].subsampling_x),
  594|  5.26M|        (sizeof(ENTROPY_CONTEXT) * mi_width) >> xd->plane[p].subsampling_x);
  595|  5.26M|    memcpy(ctx->l + mi_height * p,
  596|  5.26M|           xd->left_entropy_context[p] + (tx_row >> xd->plane[p].subsampling_y),
  597|  5.26M|           (sizeof(ENTROPY_CONTEXT) * mi_height) >> xd->plane[p].subsampling_y);
  598|  5.26M|  }
  599|  2.75M|  memcpy(ctx->sa, xd->above_partition_context + mi_col,
  600|  2.75M|         sizeof(*xd->above_partition_context) * mi_width);
  601|  2.75M|  memcpy(ctx->sl, xd->left_partition_context + (mi_row & MAX_MIB_MASK),
  ------------------
  |  |   50|  2.75M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  2.75M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.75M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.75M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  2.75M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|  2.75M|         sizeof(xd->left_partition_context[0]) * mi_height);
  603|  2.75M|  memcpy(ctx->ta, xd->above_txfm_context,
  604|  2.75M|         sizeof(*xd->above_txfm_context) * mi_width);
  605|  2.75M|  memcpy(ctx->tl, xd->left_txfm_context,
  606|  2.75M|         sizeof(*xd->left_txfm_context) * mi_height);
  607|  2.75M|  ctx->p_ta = xd->above_txfm_context;
  608|  2.75M|  ctx->p_tl = xd->left_txfm_context;
  609|  2.75M|}
av1_is_leaf_split_partition:
  672|   119k|                                BLOCK_SIZE bsize) {
  673|   119k|  const int bs = mi_size_wide[bsize];
  674|   119k|  const int hbs = bs / 2;
  675|   119k|  assert(bsize >= BLOCK_8X8);
  676|   119k|  const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
  677|       |
  678|   373k|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (678:19): [True: 317k, False: 56.3k]
  ------------------
  679|   317k|    int x_idx = (i & 1) * hbs;
  680|   317k|    int y_idx = (i >> 1) * hbs;
  681|   317k|    if ((mi_row + y_idx >= cm->mi_params.mi_rows) ||
  ------------------
  |  Branch (681:9): [True: 7.28k, False: 310k]
  ------------------
  682|   310k|        (mi_col + x_idx >= cm->mi_params.mi_cols))
  ------------------
  |  Branch (682:9): [True: 10.7k, False: 299k]
  ------------------
  683|  18.0k|      return 0;
  684|   299k|    if (get_partition(cm, mi_row + y_idx, mi_col + x_idx, subsize) !=
  ------------------
  |  Branch (684:9): [True: 45.1k, False: 254k]
  ------------------
  685|   299k|            PARTITION_NONE &&
  686|  45.1k|        subsize != BLOCK_8X8)
  ------------------
  |  Branch (686:9): [True: 45.1k, False: 18.4E]
  ------------------
  687|  45.1k|      return 0;
  688|   299k|  }
  689|  56.3k|  return 1;
  690|   119k|}
av1_active_h_edge:
  767|  78.0k|int av1_active_h_edge(const AV1_COMP *cpi, int mi_row, int mi_step) {
  768|  78.0k|  int top_edge = 0;
  769|  78.0k|  int bottom_edge = cpi->common.mi_params.mi_rows;
  770|  78.0k|  int is_active_h_edge = 0;
  771|       |
  772|       |  // For two pass account for any formatting bars detected.
  773|  78.0k|  if (is_stat_consumption_stage_twopass(cpi)) {
  ------------------
  |  Branch (773:7): [True: 0, False: 78.0k]
  ------------------
  774|      0|    const AV1_COMMON *const cm = &cpi->common;
  775|      0|    const FIRSTPASS_STATS *const this_frame_stats = read_one_frame_stats(
  776|      0|        &cpi->ppi->twopass, cm->current_frame.display_order_hint);
  777|      0|    if (this_frame_stats == NULL) return AOM_CODEC_ERROR;
  ------------------
  |  Branch (777:9): [True: 0, False: 0]
  ------------------
  778|       |
  779|       |    // The inactive region is specified in MBs not mi units.
  780|       |    // The image edge is in the following MB row.
  781|      0|    top_edge += (int)(this_frame_stats->inactive_zone_rows * 4);
  782|       |
  783|      0|    bottom_edge -= (int)(this_frame_stats->inactive_zone_rows * 4);
  784|      0|    bottom_edge = AOMMAX(top_edge, bottom_edge);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  785|      0|  }
  786|       |
  787|  78.0k|  if (((top_edge >= mi_row) && (top_edge < (mi_row + mi_step))) ||
  ------------------
  |  Branch (787:8): [True: 28.5k, False: 49.5k]
  |  Branch (787:32): [True: 28.5k, False: 0]
  ------------------
  788|  49.5k|      ((bottom_edge >= mi_row) && (bottom_edge < (mi_row + mi_step)))) {
  ------------------
  |  Branch (788:8): [True: 49.5k, False: 18.4E]
  |  Branch (788:35): [True: 0, False: 49.5k]
  ------------------
  789|  28.5k|    is_active_h_edge = 1;
  790|  28.5k|  }
  791|  78.0k|  return is_active_h_edge;
  792|  78.0k|}
av1_active_v_edge:
  797|  65.6k|int av1_active_v_edge(const AV1_COMP *cpi, int mi_col, int mi_step) {
  798|  65.6k|  int left_edge = 0;
  799|  65.6k|  int right_edge = cpi->common.mi_params.mi_cols;
  800|  65.6k|  int is_active_v_edge = 0;
  801|       |
  802|       |  // For two pass account for any formatting bars detected.
  803|  65.6k|  if (is_stat_consumption_stage_twopass(cpi)) {
  ------------------
  |  Branch (803:7): [True: 0, False: 65.6k]
  ------------------
  804|      0|    const AV1_COMMON *const cm = &cpi->common;
  805|      0|    const FIRSTPASS_STATS *const this_frame_stats = read_one_frame_stats(
  806|      0|        &cpi->ppi->twopass, cm->current_frame.display_order_hint);
  807|      0|    if (this_frame_stats == NULL) return AOM_CODEC_ERROR;
  ------------------
  |  Branch (807:9): [True: 0, False: 0]
  ------------------
  808|       |
  809|       |    // The inactive region is specified in MBs not mi units.
  810|       |    // The image edge is in the following MB row.
  811|      0|    left_edge += (int)(this_frame_stats->inactive_zone_cols * 4);
  812|       |
  813|      0|    right_edge -= (int)(this_frame_stats->inactive_zone_cols * 4);
  814|      0|    right_edge = AOMMAX(left_edge, right_edge);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  815|      0|  }
  816|       |
  817|  65.6k|  if (((left_edge >= mi_col) && (left_edge < (mi_col + mi_step))) ||
  ------------------
  |  Branch (817:8): [True: 23.2k, False: 42.4k]
  |  Branch (817:33): [True: 23.2k, False: 0]
  ------------------
  818|  42.4k|      ((right_edge >= mi_col) && (right_edge < (mi_col + mi_step)))) {
  ------------------
  |  Branch (818:8): [True: 42.4k, False: 0]
  |  Branch (818:34): [True: 0, False: 42.4k]
  ------------------
  819|  23.2k|    is_active_v_edge = 1;
  820|  23.2k|  }
  821|  65.6k|  return is_active_v_edge;
  822|  65.6k|}
av1_get_tpl_stats_sb:
  825|  88.1k|                          int mi_col, SuperBlockEnc *sb_enc) {
  826|  88.1k|  sb_enc->tpl_data_count = 0;
  827|       |
  828|  88.1k|  if (!cpi->oxcf.algo_cfg.enable_tpl_model) return;
  ------------------
  |  Branch (828:7): [True: 71.7k, False: 16.3k]
  ------------------
  829|  16.3k|  if (cpi->common.current_frame.frame_type == KEY_FRAME) return;
  ------------------
  |  Branch (829:7): [True: 16.3k, False: 18.4E]
  ------------------
  830|  18.4E|  const FRAME_UPDATE_TYPE update_type =
  831|  18.4E|      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
  832|  18.4E|  if (update_type == INTNL_OVERLAY_UPDATE || update_type == OVERLAY_UPDATE)
  ------------------
  |  Branch (832:7): [True: 18.4E, False: 0]
  |  Branch (832:46): [True: 0, False: 0]
  ------------------
  833|      0|    return;
  834|  18.4E|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
  835|  18.4E|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
  836|       |
  837|  18.4E|  AV1_COMMON *const cm = &cpi->common;
  838|  18.4E|  const int gf_group_index = cpi->gf_frame_index;
  839|  18.4E|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
  840|  18.4E|  if (!av1_tpl_stats_ready(tpl_data, gf_group_index)) return;
  ------------------
  |  Branch (840:7): [True: 0, False: 18.4E]
  ------------------
  841|  18.4E|  const int mi_wide = mi_size_wide[bsize];
  842|  18.4E|  const int mi_high = mi_size_high[bsize];
  843|       |
  844|  18.4E|  TplDepFrame *tpl_frame = &tpl_data->tpl_frame[gf_group_index];
  845|  18.4E|  TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr;
  846|  18.4E|  int tpl_stride = tpl_frame->stride;
  847|       |
  848|  18.4E|  int mi_count = 0;
  849|  18.4E|  int count = 0;
  850|  18.4E|  const int mi_col_sr =
  851|  18.4E|      coded_to_superres_mi(mi_col, cm->superres_scale_denominator);
  852|  18.4E|  const int mi_col_end_sr =
  853|  18.4E|      coded_to_superres_mi(mi_col + mi_wide, cm->superres_scale_denominator);
  854|       |  // mi_cols_sr is mi_cols at superres case.
  855|  18.4E|  const int mi_cols_sr = av1_pixels_to_mi(cm->superres_upscaled_width);
  856|       |
  857|       |  // TPL store unit size is not the same as the motion estimation unit size.
  858|       |  // Here always use motion estimation size to avoid getting repetitive inter/
  859|       |  // intra cost.
  860|  18.4E|  const BLOCK_SIZE tpl_bsize = convert_length_to_bsize(tpl_data->tpl_bsize_1d);
  861|  18.4E|  assert(mi_size_wide[tpl_bsize] == mi_size_high[tpl_bsize]);
  862|  18.4E|  const int row_step = mi_size_high[tpl_bsize];
  863|  18.4E|  const int col_step_sr = coded_to_superres_mi(mi_size_wide[tpl_bsize],
  864|  18.4E|                                               cm->superres_scale_denominator);
  865|       |
  866|       |  // Stride is only based on SB size, and we fill in values for every 16x16
  867|       |  // block in a SB.
  868|  18.4E|  sb_enc->tpl_stride = (mi_col_end_sr - mi_col_sr) / col_step_sr;
  869|       |
  870|  18.4E|  for (int row = mi_row; row < mi_row + mi_high; row += row_step) {
  ------------------
  |  Branch (870:26): [True: 0, False: 18.4E]
  ------------------
  871|      0|    for (int col = mi_col_sr; col < mi_col_end_sr; col += col_step_sr) {
  ------------------
  |  Branch (871:31): [True: 0, False: 0]
  ------------------
  872|      0|      assert(count < MAX_TPL_BLK_IN_SB * MAX_TPL_BLK_IN_SB);
  873|       |      // Handle partial SB, so that no invalid values are used later.
  874|      0|      if (row >= cm->mi_params.mi_rows || col >= mi_cols_sr) {
  ------------------
  |  Branch (874:11): [True: 0, False: 0]
  |  Branch (874:43): [True: 0, False: 0]
  ------------------
  875|      0|        sb_enc->tpl_inter_cost[count] = INT64_MAX;
  876|      0|        sb_enc->tpl_intra_cost[count] = INT64_MAX;
  877|      0|        for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (877:25): [True: 0, False: 0]
  ------------------
  878|      0|          sb_enc->tpl_mv[count][i].as_int = INVALID_MV;
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
  879|      0|        }
  880|      0|        count++;
  881|      0|        continue;
  882|      0|      }
  883|       |
  884|      0|      TplDepStats *this_stats = &tpl_stats[av1_tpl_ptr_pos(
  885|      0|          row, col, tpl_stride, tpl_data->tpl_stats_block_mis_log2)];
  886|      0|      sb_enc->tpl_inter_cost[count] = this_stats->inter_cost
  887|      0|                                      << TPL_DEP_COST_SCALE_LOG2;
  ------------------
  |  |  105|      0|#define TPL_DEP_COST_SCALE_LOG2 4
  ------------------
  888|      0|      sb_enc->tpl_intra_cost[count] = this_stats->intra_cost
  889|      0|                                      << TPL_DEP_COST_SCALE_LOG2;
  ------------------
  |  |  105|      0|#define TPL_DEP_COST_SCALE_LOG2 4
  ------------------
  890|      0|      memcpy(sb_enc->tpl_mv[count], this_stats->mv, sizeof(this_stats->mv));
  891|      0|      mi_count++;
  892|      0|      count++;
  893|      0|    }
  894|      0|  }
  895|       |
  896|       |  assert(mi_count <= MAX_TPL_BLK_IN_SB * MAX_TPL_BLK_IN_SB);
  897|  18.4E|  sb_enc->tpl_data_count = mi_count;
  898|  18.4E|}
av1_get_q_for_deltaq_objective:
  906|  12.8k|                                   int mi_row, int mi_col) {
  907|  12.8k|  AV1_COMMON *const cm = &cpi->common;
  908|  12.8k|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
  909|  12.8k|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
  910|  12.8k|  const int tpl_idx = cpi->gf_frame_index;
  911|  12.8k|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
  912|  12.8k|  const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2;
  913|  12.8k|  double intra_cost = 0;
  914|  12.8k|  double mc_dep_reg = 0;
  915|  12.8k|  double mc_dep_cost = 0;
  916|  12.8k|  double cbcmp_base = 1;
  917|  12.8k|  double srcrf_dist = 0;
  918|  12.8k|  double srcrf_sse = 0;
  919|  12.8k|  double srcrf_rate = 0;
  920|  12.8k|  const int mi_wide = mi_size_wide[bsize];
  921|  12.8k|  const int mi_high = mi_size_high[bsize];
  922|  12.8k|  const int base_qindex = cm->quant_params.base_qindex;
  923|       |
  924|  12.8k|  if (tpl_idx >= MAX_TPL_FRAME_IDX) return base_qindex;
  ------------------
  |  |  101|  12.8k|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  ------------------
  |  |  |  |   28|  12.8k|#define MAX_LAG_BUFFERS 48
  |  |  ------------------
  ------------------
  |  Branch (924:7): [True: 0, False: 12.8k]
  ------------------
  925|       |
  926|  12.8k|  TplDepFrame *tpl_frame = &tpl_data->tpl_frame[tpl_idx];
  927|  12.8k|  TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr;
  928|  12.8k|  int tpl_stride = tpl_frame->stride;
  929|  12.8k|  if (!tpl_frame->is_valid) return base_qindex;
  ------------------
  |  Branch (929:7): [True: 12.8k, False: 0]
  ------------------
  930|       |
  931|       |#ifndef NDEBUG
  932|       |  int mi_count = 0;
  933|       |#endif
  934|      0|  const int mi_col_sr =
  935|      0|      coded_to_superres_mi(mi_col, cm->superres_scale_denominator);
  936|      0|  const int mi_col_end_sr =
  937|      0|      coded_to_superres_mi(mi_col + mi_wide, cm->superres_scale_denominator);
  938|      0|  const int mi_cols_sr = av1_pixels_to_mi(cm->superres_upscaled_width);
  939|      0|  const int step = 1 << block_mis_log2;
  940|      0|  const int row_step = step;
  941|      0|  const int col_step_sr =
  942|      0|      coded_to_superres_mi(step, cm->superres_scale_denominator);
  943|      0|  for (int row = mi_row; row < mi_row + mi_high; row += row_step) {
  ------------------
  |  Branch (943:26): [True: 0, False: 0]
  ------------------
  944|      0|    for (int col = mi_col_sr; col < mi_col_end_sr; col += col_step_sr) {
  ------------------
  |  Branch (944:31): [True: 0, False: 0]
  ------------------
  945|      0|      if (row >= cm->mi_params.mi_rows || col >= mi_cols_sr) continue;
  ------------------
  |  Branch (945:11): [True: 0, False: 0]
  |  Branch (945:43): [True: 0, False: 0]
  ------------------
  946|      0|      TplDepStats *this_stats =
  947|      0|          &tpl_stats[av1_tpl_ptr_pos(row, col, tpl_stride, block_mis_log2)];
  948|      0|      double cbcmp = (double)this_stats->srcrf_dist;
  949|      0|      int64_t mc_dep_delta =
  950|      0|          RDCOST(tpl_frame->base_rdmult, this_stats->mc_dep_rate,
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  951|      0|                 this_stats->mc_dep_dist);
  952|      0|      double dist_scaled = (double)(this_stats->recrf_dist << RDDIV_BITS);
  ------------------
  |  |   29|      0|#define RDDIV_BITS 7
  ------------------
  953|      0|      intra_cost += log(dist_scaled) * cbcmp;
  954|      0|      mc_dep_cost += log(dist_scaled + mc_dep_delta) * cbcmp;
  955|      0|      mc_dep_reg += log(3 * dist_scaled + mc_dep_delta) * cbcmp;
  956|      0|      srcrf_dist += (double)(this_stats->srcrf_dist << RDDIV_BITS);
  ------------------
  |  |   29|      0|#define RDDIV_BITS 7
  ------------------
  957|      0|      srcrf_sse += (double)(this_stats->srcrf_sse << RDDIV_BITS);
  ------------------
  |  |   29|      0|#define RDDIV_BITS 7
  ------------------
  958|      0|      srcrf_rate += (double)(this_stats->srcrf_rate << TPL_DEP_COST_SCALE_LOG2);
  ------------------
  |  |  105|      0|#define TPL_DEP_COST_SCALE_LOG2 4
  ------------------
  959|       |#ifndef NDEBUG
  960|       |      mi_count++;
  961|       |#endif
  962|      0|      cbcmp_base += cbcmp;
  963|      0|    }
  964|      0|  }
  965|      0|  assert(mi_count <= MAX_TPL_BLK_IN_SB * MAX_TPL_BLK_IN_SB);
  966|       |
  967|      0|  int offset = 0;
  968|      0|  double beta = 1.0;
  969|      0|  double rk;
  970|      0|  if (mc_dep_cost > 0 && intra_cost > 0) {
  ------------------
  |  Branch (970:7): [True: 0, False: 0]
  |  Branch (970:26): [True: 0, False: 0]
  ------------------
  971|      0|    const double r0 = cpi->rd.r0;
  972|      0|    rk = exp((intra_cost - mc_dep_cost) / cbcmp_base);
  973|      0|    td->mb.rb = exp((intra_cost - mc_dep_reg) / cbcmp_base);
  974|      0|    beta = (r0 / rk);
  975|      0|    assert(beta > 0.0);
  976|      0|  } else {
  977|      0|    return base_qindex;
  978|      0|  }
  979|      0|  offset = av1_get_deltaq_offset(cm->seq_params->bit_depth, base_qindex, beta);
  980|       |
  981|      0|  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
  982|      0|  offset = AOMMIN(offset, delta_q_info->delta_q_res * 9 - 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  983|      0|  offset = AOMMAX(offset, -delta_q_info->delta_q_res * 9 + 1);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  984|      0|  int qindex = cm->quant_params.base_qindex + offset;
  985|      0|  qindex = AOMMIN(qindex, MAXQ);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  986|      0|  qindex = AOMMAX(qindex, MINQ);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  987|       |
  988|      0|  int frm_qstep = av1_dc_quant_QTX(base_qindex, 0, cm->seq_params->bit_depth);
  989|      0|  int sbs_qstep =
  990|      0|      av1_dc_quant_QTX(base_qindex, offset, cm->seq_params->bit_depth);
  991|       |
  992|      0|  if (delta_dist) {
  ------------------
  |  Branch (992:7): [True: 0, False: 0]
  ------------------
  993|      0|    double sbs_dist = srcrf_dist * pow((double)sbs_qstep / frm_qstep, 2.0);
  994|      0|    double sbs_rate = srcrf_rate * ((double)frm_qstep / sbs_qstep);
  995|      0|    sbs_dist = AOMMIN(sbs_dist, srcrf_sse);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  996|      0|    *delta_dist = (int64_t)((sbs_dist - srcrf_dist) / rk);
  997|      0|    *delta_dist += RDCOST(tpl_frame->base_rdmult, 4 * 256, 0);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  998|      0|    *delta_dist += RDCOST(tpl_frame->base_rdmult, sbs_rate - srcrf_rate, 0);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  999|      0|  }
 1000|      0|  return qindex;
 1001|      0|}
av1_reset_simple_motion_tree_partition:
 1048|  29.9M|                                            BLOCK_SIZE bsize) {
 1049|  29.9M|  if (sms_tree == NULL) return;
  ------------------
  |  Branch (1049:7): [True: 0, False: 29.9M]
  ------------------
 1050|  29.9M|  sms_tree->partitioning = PARTITION_NONE;
 1051|       |
 1052|  29.9M|  if (bsize >= BLOCK_8X8) {
  ------------------
  |  Branch (1052:7): [True: 7.48M, False: 22.4M]
  ------------------
 1053|  7.48M|    BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
 1054|  37.3M|    for (int idx = 0; idx < 4; ++idx)
  ------------------
  |  Branch (1054:23): [True: 29.8M, False: 7.48M]
  ------------------
 1055|  29.8M|      av1_reset_simple_motion_tree_partition(sms_tree->split[idx], subsize);
 1056|  7.48M|  }
 1057|  29.9M|}
av1_update_picked_ref_frames_mask:
 1062|  1.39M|                                       int mi_row, int mi_col) {
 1063|  1.39M|  assert(mi_size_wide[bsize] == mi_size_high[bsize]);
 1064|  1.39M|  const int sb_size_mask = mib_size - 1;
 1065|  1.39M|  const int mi_row_in_sb = mi_row & sb_size_mask;
 1066|  1.39M|  const int mi_col_in_sb = mi_col & sb_size_mask;
 1067|  1.39M|  const int mi_size = mi_size_wide[bsize];
 1068|  4.39M|  for (int i = mi_row_in_sb; i < mi_row_in_sb + mi_size; ++i) {
  ------------------
  |  Branch (1068:30): [True: 3.00M, False: 1.39M]
  ------------------
 1069|  11.3M|    for (int j = mi_col_in_sb; j < mi_col_in_sb + mi_size; ++j) {
  ------------------
  |  Branch (1069:32): [True: 8.32M, False: 3.00M]
  ------------------
 1070|  8.32M|      x->picked_ref_frames_mask[i * 32 + j] |= 1 << ref_type;
 1071|  8.32M|    }
 1072|  3.00M|  }
 1073|  1.39M|}
av1_avg_cdf_symbols:
 1129|  1.45k|                         int wt_left, int wt_tr) {
 1130|  1.45k|  AVERAGE_CDF(ctx_left->txb_skip_cdf, ctx_tr->txb_skip_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1131|  1.45k|  AVERAGE_CDF(ctx_left->eob_extra_cdf, ctx_tr->eob_extra_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|  1.45k|  AVERAGE_CDF(ctx_left->dc_sign_cdf, ctx_tr->dc_sign_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1133|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf16, ctx_tr->eob_flag_cdf16, 5);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf32, ctx_tr->eob_flag_cdf32, 6);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1135|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf64, ctx_tr->eob_flag_cdf64, 7);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1136|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf128, ctx_tr->eob_flag_cdf128, 8);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1137|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf256, ctx_tr->eob_flag_cdf256, 9);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf512, ctx_tr->eob_flag_cdf512, 10);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1139|  1.45k|  AVERAGE_CDF(ctx_left->eob_flag_cdf1024, ctx_tr->eob_flag_cdf1024, 11);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1140|  1.45k|  AVERAGE_CDF(ctx_left->coeff_base_eob_cdf, ctx_tr->coeff_base_eob_cdf, 3);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1141|  1.45k|  AVERAGE_CDF(ctx_left->coeff_base_cdf, ctx_tr->coeff_base_cdf, 4);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1142|  1.45k|  AVERAGE_CDF(ctx_left->coeff_br_cdf, ctx_tr->coeff_br_cdf, BR_CDF_SIZE);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1143|  1.45k|  AVERAGE_CDF(ctx_left->newmv_cdf, ctx_tr->newmv_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1144|  1.45k|  AVERAGE_CDF(ctx_left->zeromv_cdf, ctx_tr->zeromv_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1145|  1.45k|  AVERAGE_CDF(ctx_left->refmv_cdf, ctx_tr->refmv_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|  1.45k|  AVERAGE_CDF(ctx_left->drl_cdf, ctx_tr->drl_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1147|  1.45k|  AVERAGE_CDF(ctx_left->inter_compound_mode_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1148|  1.45k|              ctx_tr->inter_compound_mode_cdf, INTER_COMPOUND_MODES);
 1149|  1.45k|  AVERAGE_CDF(ctx_left->compound_type_cdf, ctx_tr->compound_type_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1150|  1.45k|              MASKED_COMPOUND_TYPES);
 1151|  1.45k|  AVERAGE_CDF(ctx_left->wedge_idx_cdf, ctx_tr->wedge_idx_cdf, 16);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1152|  1.45k|  AVERAGE_CDF(ctx_left->interintra_cdf, ctx_tr->interintra_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1153|  1.45k|  AVERAGE_CDF(ctx_left->wedge_interintra_cdf, ctx_tr->wedge_interintra_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1154|  1.45k|  AVERAGE_CDF(ctx_left->interintra_mode_cdf, ctx_tr->interintra_mode_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1155|  1.45k|              INTERINTRA_MODES);
 1156|  1.45k|  AVERAGE_CDF(ctx_left->motion_mode_cdf, ctx_tr->motion_mode_cdf, MOTION_MODES);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1157|  1.45k|  AVERAGE_CDF(ctx_left->obmc_cdf, ctx_tr->obmc_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1158|  1.45k|  AVERAGE_CDF(ctx_left->palette_y_size_cdf, ctx_tr->palette_y_size_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1159|  1.45k|              PALETTE_SIZES);
 1160|  1.45k|  AVERAGE_CDF(ctx_left->palette_uv_size_cdf, ctx_tr->palette_uv_size_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1161|  1.45k|              PALETTE_SIZES);
 1162|  11.6k|  for (int j = 0; j < PALETTE_SIZES; j++) {
  ------------------
  |  Branch (1162:19): [True: 10.2k, False: 1.45k]
  ------------------
 1163|  10.2k|    int nsymbs = j + PALETTE_MIN_SIZE;
  ------------------
  |  |   65|  10.2k|#define PALETTE_MIN_SIZE 2
  ------------------
 1164|  10.2k|    AVG_CDF_STRIDE(ctx_left->palette_y_color_index_cdf[j],
  ------------------
  |  | 1095|  10.2k|  do {                                                                     \
  |  | 1096|  10.2k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  10.2k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  10.2k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  10.2k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  10.2k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  10.2k|                   wt_left, wt_tr);                                        \
  |  | 1102|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1165|  10.2k|                   ctx_tr->palette_y_color_index_cdf[j], nsymbs,
 1166|  10.2k|                   CDF_SIZE(PALETTE_COLORS));
 1167|  10.2k|    AVG_CDF_STRIDE(ctx_left->palette_uv_color_index_cdf[j],
  ------------------
  |  | 1095|  10.2k|  do {                                                                     \
  |  | 1096|  10.2k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  10.2k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  10.2k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  10.2k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  10.2k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  10.2k|                   wt_left, wt_tr);                                        \
  |  | 1102|  10.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1168|  10.2k|                   ctx_tr->palette_uv_color_index_cdf[j], nsymbs,
 1169|  10.2k|                   CDF_SIZE(PALETTE_COLORS));
 1170|  10.2k|  }
 1171|  1.45k|  AVERAGE_CDF(ctx_left->palette_y_mode_cdf, ctx_tr->palette_y_mode_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1172|  1.45k|  AVERAGE_CDF(ctx_left->palette_uv_mode_cdf, ctx_tr->palette_uv_mode_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1173|  1.45k|  AVERAGE_CDF(ctx_left->comp_inter_cdf, ctx_tr->comp_inter_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1174|  1.45k|  AVERAGE_CDF(ctx_left->single_ref_cdf, ctx_tr->single_ref_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1175|  1.45k|  AVERAGE_CDF(ctx_left->comp_ref_type_cdf, ctx_tr->comp_ref_type_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1176|  1.45k|  AVERAGE_CDF(ctx_left->uni_comp_ref_cdf, ctx_tr->uni_comp_ref_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1177|  1.45k|  AVERAGE_CDF(ctx_left->comp_ref_cdf, ctx_tr->comp_ref_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1178|  1.45k|  AVERAGE_CDF(ctx_left->comp_bwdref_cdf, ctx_tr->comp_bwdref_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1179|  1.45k|  AVERAGE_CDF(ctx_left->txfm_partition_cdf, ctx_tr->txfm_partition_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1180|  1.45k|  AVERAGE_CDF(ctx_left->compound_index_cdf, ctx_tr->compound_index_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1181|  1.45k|  AVERAGE_CDF(ctx_left->comp_group_idx_cdf, ctx_tr->comp_group_idx_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|  1.45k|  AVERAGE_CDF(ctx_left->skip_mode_cdfs, ctx_tr->skip_mode_cdfs, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1183|  1.45k|  AVERAGE_CDF(ctx_left->skip_txfm_cdfs, ctx_tr->skip_txfm_cdfs, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1184|  1.45k|  AVERAGE_CDF(ctx_left->intra_inter_cdf, ctx_tr->intra_inter_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1185|  1.45k|  avg_nmv(&ctx_left->nmvc, &ctx_tr->nmvc, wt_left, wt_tr);
 1186|  1.45k|  avg_nmv(&ctx_left->ndvc, &ctx_tr->ndvc, wt_left, wt_tr);
 1187|  1.45k|  AVERAGE_CDF(ctx_left->intrabc_cdf, ctx_tr->intrabc_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1188|  1.45k|  AVERAGE_CDF(ctx_left->seg.pred_cdf, ctx_tr->seg.pred_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|  1.45k|  AVERAGE_CDF(ctx_left->seg.spatial_pred_seg_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1190|  1.45k|              ctx_tr->seg.spatial_pred_seg_cdf, MAX_SEGMENTS);
 1191|  1.45k|  AVERAGE_CDF(ctx_left->filter_intra_cdfs, ctx_tr->filter_intra_cdfs, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1192|  1.45k|  AVERAGE_CDF(ctx_left->filter_intra_mode_cdf, ctx_tr->filter_intra_mode_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1193|  1.45k|              FILTER_INTRA_MODES);
 1194|  1.45k|  AVERAGE_CDF(ctx_left->switchable_restore_cdf, ctx_tr->switchable_restore_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1195|  1.45k|              RESTORE_SWITCHABLE_TYPES);
 1196|  1.45k|  AVERAGE_CDF(ctx_left->wiener_restore_cdf, ctx_tr->wiener_restore_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1197|  1.45k|  AVERAGE_CDF(ctx_left->sgrproj_restore_cdf, ctx_tr->sgrproj_restore_cdf, 2);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1198|  1.45k|  AVERAGE_CDF(ctx_left->y_mode_cdf, ctx_tr->y_mode_cdf, INTRA_MODES);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1199|  1.45k|  AVG_CDF_STRIDE(ctx_left->uv_mode_cdf[0], ctx_tr->uv_mode_cdf[0],
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1200|  1.45k|                 UV_INTRA_MODES - 1, CDF_SIZE(UV_INTRA_MODES));
 1201|  1.45k|  AVERAGE_CDF(ctx_left->uv_mode_cdf[1], ctx_tr->uv_mode_cdf[1], UV_INTRA_MODES);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1202|  30.6k|  for (int i = 0; i < PARTITION_CONTEXTS; i++) {
  ------------------
  |  |  171|  30.6k|#define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  170|  30.6k|#define PARTITION_BLOCK_SIZES 5
  |  |  ------------------
  |  |               #define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  169|  30.6k|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  |  |  ------------------
  ------------------
  |  Branch (1202:19): [True: 29.1k, False: 1.45k]
  ------------------
 1203|  29.1k|    if (i < 4) {
  ------------------
  |  Branch (1203:9): [True: 5.83k, False: 23.3k]
  ------------------
 1204|  5.83k|      AVG_CDF_STRIDE(ctx_left->partition_cdf[i], ctx_tr->partition_cdf[i], 4,
  ------------------
  |  | 1095|  5.83k|  do {                                                                     \
  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  | 1102|  5.83k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  ------------------
  ------------------
 1205|  5.83k|                     CDF_SIZE(10));
 1206|  23.3k|    } else if (i < 16) {
  ------------------
  |  Branch (1206:16): [True: 17.4k, False: 5.83k]
  ------------------
 1207|  17.4k|      AVERAGE_CDF(ctx_left->partition_cdf[i], ctx_tr->partition_cdf[i], 10);
  ------------------
  |  | 1092|  17.4k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  17.4k|  do {                                                                     \
  |  |  |  | 1096|  17.4k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  17.4k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  17.4k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  17.4k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  17.4k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  17.4k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  17.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 17.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1208|  17.4k|    } else {
 1209|  5.83k|      AVG_CDF_STRIDE(ctx_left->partition_cdf[i], ctx_tr->partition_cdf[i], 8,
  ------------------
  |  | 1095|  5.83k|  do {                                                                     \
  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  | 1102|  5.83k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  ------------------
  ------------------
 1210|  5.83k|                     CDF_SIZE(10));
 1211|  5.83k|    }
 1212|  29.1k|  }
 1213|  1.45k|  AVERAGE_CDF(ctx_left->switchable_interp_cdf, ctx_tr->switchable_interp_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1214|  1.45k|              SWITCHABLE_FILTERS);
 1215|  1.45k|  AVERAGE_CDF(ctx_left->kf_y_cdf, ctx_tr->kf_y_cdf, INTRA_MODES);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1216|  1.45k|  AVERAGE_CDF(ctx_left->angle_delta_cdf, ctx_tr->angle_delta_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1217|  1.45k|              2 * MAX_ANGLE_DELTA + 1);
 1218|  1.45k|  AVG_CDF_STRIDE(ctx_left->tx_size_cdf[0], ctx_tr->tx_size_cdf[0], MAX_TX_DEPTH,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1219|  1.45k|                 CDF_SIZE(MAX_TX_DEPTH + 1));
 1220|  1.45k|  AVERAGE_CDF(ctx_left->tx_size_cdf[1], ctx_tr->tx_size_cdf[1],
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1221|  1.45k|              MAX_TX_DEPTH + 1);
 1222|  1.45k|  AVERAGE_CDF(ctx_left->tx_size_cdf[2], ctx_tr->tx_size_cdf[2],
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1223|  1.45k|              MAX_TX_DEPTH + 1);
 1224|  1.45k|  AVERAGE_CDF(ctx_left->tx_size_cdf[3], ctx_tr->tx_size_cdf[3],
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1225|  1.45k|              MAX_TX_DEPTH + 1);
 1226|  1.45k|  AVERAGE_CDF(ctx_left->delta_q_cdf, ctx_tr->delta_q_cdf, DELTA_Q_PROBS + 1);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1227|  1.45k|  AVERAGE_CDF(ctx_left->delta_lf_cdf, ctx_tr->delta_lf_cdf, DELTA_LF_PROBS + 1);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|  7.29k|  for (int i = 0; i < FRAME_LF_COUNT; i++) {
  ------------------
  |  |   72|  7.29k|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (1228:19): [True: 5.83k, False: 1.45k]
  ------------------
 1229|  5.83k|    AVERAGE_CDF(ctx_left->delta_lf_multi_cdf[i], ctx_tr->delta_lf_multi_cdf[i],
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1230|  5.83k|                DELTA_LF_PROBS + 1);
 1231|  5.83k|  }
 1232|  1.45k|  AVG_CDF_STRIDE(ctx_left->intra_ext_tx_cdf[1], ctx_tr->intra_ext_tx_cdf[1], 7,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1233|  1.45k|                 CDF_SIZE(TX_TYPES));
 1234|  1.45k|  AVG_CDF_STRIDE(ctx_left->intra_ext_tx_cdf[2], ctx_tr->intra_ext_tx_cdf[2], 5,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1235|  1.45k|                 CDF_SIZE(TX_TYPES));
 1236|  1.45k|  AVG_CDF_STRIDE(ctx_left->inter_ext_tx_cdf[1], ctx_tr->inter_ext_tx_cdf[1], 16,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1237|  1.45k|                 CDF_SIZE(TX_TYPES));
 1238|  1.45k|  AVG_CDF_STRIDE(ctx_left->inter_ext_tx_cdf[2], ctx_tr->inter_ext_tx_cdf[2], 12,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1239|  1.45k|                 CDF_SIZE(TX_TYPES));
 1240|  1.45k|  AVG_CDF_STRIDE(ctx_left->inter_ext_tx_cdf[3], ctx_tr->inter_ext_tx_cdf[3], 2,
  ------------------
  |  | 1095|  1.45k|  do {                                                                     \
  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  | 1102|  1.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 1241|  1.45k|                 CDF_SIZE(TX_TYPES));
 1242|  1.45k|  AVERAGE_CDF(ctx_left->cfl_sign_cdf, ctx_tr->cfl_sign_cdf, CFL_JOINT_SIGNS);
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1243|  1.45k|  AVERAGE_CDF(ctx_left->cfl_alpha_cdf, ctx_tr->cfl_alpha_cdf,
  ------------------
  |  | 1092|  1.45k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  1.45k|  do {                                                                     \
  |  |  |  | 1096|  1.45k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  1.45k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  1.45k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  1.45k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  1.45k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  1.45k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  1.45k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1244|  1.45k|              CFL_ALPHABET_SIZE);
 1245|  1.45k|}
av1_source_content_sb:
 1318|  40.6k|                           int mi_row, int mi_col) {
 1319|  40.6k|  if (cpi->last_source->y_width != cpi->source->y_width ||
  ------------------
  |  Branch (1319:7): [True: 14.1k, False: 26.4k]
  ------------------
 1320|  26.4k|      cpi->last_source->y_height != cpi->source->y_height)
  ------------------
  |  Branch (1320:7): [True: 1.87k, False: 24.5k]
  ------------------
 1321|  16.0k|    return;
 1322|  24.5k|#if CONFIG_AV1_HIGHBITDEPTH
 1323|  24.5k|  if (x->e_mbd.cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) return;
  ------------------
  |  |  142|  24.5k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (1323:7): [True: 3.78k, False: 20.8k]
  ------------------
 1324|  20.8k|#endif
 1325|       |
 1326|  20.8k|  unsigned int tmp_sse;
 1327|  20.8k|  unsigned int tmp_variance;
 1328|  20.8k|  const BLOCK_SIZE bsize = cpi->common.seq_params->sb_size;
 1329|  20.8k|  uint8_t *src_y = cpi->source->y_buffer;
 1330|  20.8k|  const int src_ystride = cpi->source->y_stride;
 1331|  20.8k|  const int src_offset = src_ystride * (mi_row << 2) + (mi_col << 2);
 1332|  20.8k|  uint8_t *last_src_y = cpi->last_source->y_buffer;
 1333|  20.8k|  const int last_src_ystride = cpi->last_source->y_stride;
 1334|  20.8k|  const int last_src_offset = last_src_ystride * (mi_row << 2) + (mi_col << 2);
 1335|  20.8k|  uint64_t avg_source_sse_threshold_verylow = 10000;     // ~1.5*1.5*(64*64)
 1336|  20.8k|  uint64_t avg_source_sse_threshold_low[2] = { 100000,   // ~5*5*(64*64)
 1337|  20.8k|                                               36000 };  // ~3*3*(64*64)
 1338|       |
 1339|  20.8k|  uint64_t avg_source_sse_threshold_high = 1000000;  // ~15*15*(64*64)
 1340|  20.8k|  if (cpi->sf.rt_sf.increase_source_sad_thresh) {
  ------------------
  |  Branch (1340:7): [True: 0, False: 20.8k]
  ------------------
 1341|      0|    avg_source_sse_threshold_high = avg_source_sse_threshold_high << 1;
 1342|      0|    avg_source_sse_threshold_low[0] = avg_source_sse_threshold_low[0] << 1;
 1343|      0|    avg_source_sse_threshold_verylow = avg_source_sse_threshold_verylow << 1;
 1344|      0|  }
 1345|  20.8k|  uint64_t sum_sq_thresh = 10000;  // sum = sqrt(thresh / 64*64)) ~1.5
 1346|  20.8k|  src_y += src_offset;
 1347|  20.8k|  last_src_y += last_src_offset;
 1348|  20.8k|  tmp_variance = cpi->ppi->fn_ptr[bsize].vf(src_y, src_ystride, last_src_y,
 1349|  20.8k|                                            last_src_ystride, &tmp_sse);
 1350|       |  // rd thresholds
 1351|  20.8k|  if (tmp_sse < avg_source_sse_threshold_low[1])
  ------------------
  |  Branch (1351:7): [True: 50, False: 20.7k]
  ------------------
 1352|     50|    x->content_state_sb.source_sad_rd = kLowSad;
 1353|       |
 1354|       |  // nonrd thresholds
 1355|  20.8k|  if (tmp_sse == 0) {
  ------------------
  |  Branch (1355:7): [True: 10, False: 20.7k]
  ------------------
 1356|     10|    x->content_state_sb.source_sad_nonrd = kZeroSad;
 1357|     10|    return;
 1358|     10|  }
 1359|  20.7k|  if (tmp_sse < avg_source_sse_threshold_verylow)
  ------------------
  |  Branch (1359:7): [True: 17, False: 20.7k]
  ------------------
 1360|     17|    x->content_state_sb.source_sad_nonrd = kVeryLowSad;
 1361|  20.7k|  else if (tmp_sse < avg_source_sse_threshold_low[0])
  ------------------
  |  Branch (1361:12): [True: 90, False: 20.6k]
  ------------------
 1362|     90|    x->content_state_sb.source_sad_nonrd = kLowSad;
 1363|  20.6k|  else if (tmp_sse > avg_source_sse_threshold_high)
  ------------------
  |  Branch (1363:12): [True: 20.2k, False: 472]
  ------------------
 1364|  20.2k|    x->content_state_sb.source_sad_nonrd = kHighSad;
 1365|       |
 1366|       |  // Detect large lighting change.
 1367|       |  // Note: tmp_sse - tmp_variance = ((sum * sum) >> 12)
 1368|  20.7k|  if (tmp_variance < (tmp_sse >> 1) && (tmp_sse - tmp_variance) > sum_sq_thresh)
  ------------------
  |  Branch (1368:7): [True: 3.29k, False: 17.4k]
  |  Branch (1368:40): [True: 3.27k, False: 16]
  ------------------
 1369|  3.27k|    x->content_state_sb.lighting_change = 1;
 1370|  20.7k|  if ((tmp_sse - tmp_variance) < (sum_sq_thresh >> 1))
  ------------------
  |  Branch (1370:7): [True: 3.99k, False: 16.7k]
  ------------------
 1371|  3.99k|    x->content_state_sb.low_sumdiff = 1;
 1372|       |
 1373|  20.7k|  if (tmp_sse > ((avg_source_sse_threshold_high * 7) >> 3) &&
  ------------------
  |  Branch (1373:7): [True: 20.3k, False: 488]
  ------------------
 1374|  20.3k|      !x->content_state_sb.lighting_change && !x->content_state_sb.low_sumdiff)
  ------------------
  |  Branch (1374:7): [True: 17.2k, False: 3.07k]
  |  Branch (1374:47): [True: 13.2k, False: 3.93k]
  ------------------
 1375|  13.2k|    x->sb_force_fixed_part = 0;
 1376|       |
 1377|  20.7k|  if (!cpi->sf.rt_sf.use_rtc_tf || cpi->rc.high_source_sad ||
  ------------------
  |  Branch (1377:7): [True: 745, False: 20.0k]
  |  Branch (1377:36): [True: 0, False: 20.0k]
  ------------------
 1378|  20.0k|      cpi->rc.frame_source_sad > 20000 || cpi->svc.number_spatial_layers > 1)
  ------------------
  |  Branch (1378:7): [True: 20.0k, False: 0]
  |  Branch (1378:43): [True: 0, False: 0]
  ------------------
 1379|  20.7k|    return;
 1380|       |
 1381|       |  // In-place temporal filter. If psnr calculation is enabled, we store the
 1382|       |  // source for that.
 1383|      0|  AV1_COMMON *const cm = &cpi->common;
 1384|       |  // Calculate n*mean^2
 1385|      0|  const unsigned int nmean2 = tmp_sse - tmp_variance;
 1386|      0|  const int ac_q_step = av1_ac_quant_QTX(cm->quant_params.base_qindex, 0,
 1387|      0|                                         cm->seq_params->bit_depth);
 1388|      0|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 1389|      0|  const int avg_q_step = av1_ac_quant_QTX(p_rc->avg_frame_qindex[INTER_FRAME],
 1390|      0|                                          0, cm->seq_params->bit_depth);
 1391|       |
 1392|      0|  const unsigned int threshold = (cpi->sf.rt_sf.use_rtc_tf == 1)
  ------------------
  |  Branch (1392:34): [True: 0, False: 0]
  ------------------
 1393|      0|                                     ? clamp(avg_q_step, 250, 1000) * ac_q_step
 1394|      0|                                     : 250 * ac_q_step;
 1395|       |
 1396|       |  // TODO(yunqing): use a weighted sum instead of averaging in filtering.
 1397|      0|  if (tmp_variance <= threshold && nmean2 <= 15) {
  ------------------
  |  Branch (1397:7): [True: 0, False: 0]
  |  Branch (1397:36): [True: 0, False: 0]
  ------------------
 1398|       |    // Check neighbor blocks. If neighbor blocks aren't low-motion blocks,
 1399|       |    // skip temporal filtering for this block.
 1400|      0|    MB_MODE_INFO **mi = cm->mi_params.mi_grid_base +
 1401|      0|                        get_mi_grid_idx(&cm->mi_params, mi_row, mi_col);
 1402|      0|    const TileInfo *const tile_info = &tile_data->tile_info;
 1403|      0|    const int is_neighbor_blocks_low_motion = check_neighbor_blocks(
 1404|      0|        mi, cm->mi_params.mi_stride, tile_info, mi_row, mi_col);
 1405|      0|    if (!is_neighbor_blocks_low_motion) return;
  ------------------
  |  Branch (1405:9): [True: 0, False: 0]
  ------------------
 1406|       |
 1407|       |    // Only consider 64x64 SB for now. Need to extend to 128x128 for large SB
 1408|       |    // size.
 1409|       |    // Test several nearby points. If non-zero mv exists, don't do temporal
 1410|       |    // filtering.
 1411|      0|    const int is_this_blk_low_motion = fast_detect_non_zero_motion(
 1412|      0|        cpi, src_y, src_ystride, last_src_y, last_src_ystride, mi_row, mi_col);
 1413|       |
 1414|      0|    if (!is_this_blk_low_motion) return;
  ------------------
  |  Branch (1414:9): [True: 0, False: 0]
  ------------------
 1415|       |
 1416|      0|    const int shift_x[2] = { 0, cpi->source->subsampling_x };
 1417|      0|    const int shift_y[2] = { 0, cpi->source->subsampling_y };
 1418|      0|    const uint8_t h = block_size_high[bsize];
 1419|      0|    const uint8_t w = block_size_wide[bsize];
 1420|       |
 1421|      0|    for (int plane = 0; plane < av1_num_planes(cm); ++plane) {
  ------------------
  |  Branch (1421:25): [True: 0, False: 0]
  ------------------
 1422|      0|      uint8_t *src = cpi->source->buffers[plane];
 1423|      0|      const int src_stride = cpi->source->strides[plane != 0];
 1424|      0|      uint8_t *last_src = cpi->last_source->buffers[plane];
 1425|      0|      const int last_src_stride = cpi->last_source->strides[plane != 0];
 1426|      0|      src += src_stride * (mi_row << (2 - shift_y[plane != 0])) +
 1427|      0|             (mi_col << (2 - shift_x[plane != 0]));
 1428|      0|      last_src += last_src_stride * (mi_row << (2 - shift_y[plane != 0])) +
 1429|      0|                  (mi_col << (2 - shift_x[plane != 0]));
 1430|       |
 1431|      0|      for (int i = 0; i < (h >> shift_y[plane != 0]); ++i) {
  ------------------
  |  Branch (1431:23): [True: 0, False: 0]
  ------------------
 1432|      0|        for (int j = 0; j < (w >> shift_x[plane != 0]); ++j) {
  ------------------
  |  Branch (1432:25): [True: 0, False: 0]
  ------------------
 1433|      0|          src[j] = (last_src[j] + src[j]) >> 1;
 1434|      0|        }
 1435|      0|        src += src_stride;
 1436|      0|        last_src += last_src_stride;
 1437|      0|      }
 1438|      0|    }
 1439|      0|  }
 1440|      0|}
av1_set_cost_upd_freq:
 1623|   137k|                           const int mi_col) {
 1624|   137k|  AV1_COMMON *const cm = &cpi->common;
 1625|   137k|  const int num_planes = av1_num_planes(cm);
 1626|   137k|  MACROBLOCK *const x = &td->mb;
 1627|   137k|  MACROBLOCKD *const xd = &x->e_mbd;
 1628|       |
 1629|   137k|  if (cm->features.disable_cdf_update) {
  ------------------
  |  Branch (1629:7): [True: 0, False: 137k]
  ------------------
 1630|      0|    return;
 1631|      0|  }
 1632|       |
 1633|   137k|  switch (cpi->sf.inter_sf.coeff_cost_upd_level) {
 1634|      0|    case INTERNAL_COST_UPD_OFF:
  ------------------
  |  Branch (1634:5): [True: 0, False: 137k]
  ------------------
 1635|      0|    case INTERNAL_COST_UPD_TILE:  // Tile level
  ------------------
  |  Branch (1635:5): [True: 0, False: 137k]
  ------------------
 1636|      0|      break;
 1637|      0|    case INTERNAL_COST_UPD_SBROW_SET:  // SB row set level in tile
  ------------------
  |  Branch (1637:5): [True: 0, False: 137k]
  ------------------
 1638|  88.2k|    case INTERNAL_COST_UPD_SBROW:      // SB row level in tile
  ------------------
  |  Branch (1638:5): [True: 88.2k, False: 49.1k]
  ------------------
 1639|   137k|    case INTERNAL_COST_UPD_SB:         // SB level
  ------------------
  |  Branch (1639:5): [True: 49.1k, False: 88.3k]
  ------------------
 1640|   137k|      if (skip_cost_update(cm->seq_params, tile_info, mi_row, mi_col,
  ------------------
  |  Branch (1640:11): [True: 6.88k, False: 130k]
  ------------------
 1641|   137k|                           cpi->sf.inter_sf.coeff_cost_upd_level))
 1642|  6.88k|        break;
 1643|   130k|      av1_fill_coeff_costs(&x->coeff_costs, xd->tile_ctx, num_planes);
 1644|   130k|      break;
 1645|      0|    default: assert(0);
  ------------------
  |  Branch (1645:5): [True: 0, False: 137k]
  ------------------
 1646|   137k|  }
 1647|       |
 1648|   137k|  switch (cpi->sf.inter_sf.mode_cost_upd_level) {
 1649|      0|    case INTERNAL_COST_UPD_OFF:
  ------------------
  |  Branch (1649:5): [True: 0, False: 137k]
  ------------------
 1650|      0|    case INTERNAL_COST_UPD_TILE:  // Tile level
  ------------------
  |  Branch (1650:5): [True: 0, False: 137k]
  ------------------
 1651|      0|      break;
 1652|      0|    case INTERNAL_COST_UPD_SBROW_SET:  // SB row set level in tile
  ------------------
  |  Branch (1652:5): [True: 0, False: 137k]
  ------------------
 1653|  88.3k|    case INTERNAL_COST_UPD_SBROW:      // SB row level in tile
  ------------------
  |  Branch (1653:5): [True: 88.3k, False: 49.1k]
  ------------------
 1654|   137k|    case INTERNAL_COST_UPD_SB:         // SB level
  ------------------
  |  Branch (1654:5): [True: 49.1k, False: 88.3k]
  ------------------
 1655|   137k|      if (skip_cost_update(cm->seq_params, tile_info, mi_row, mi_col,
  ------------------
  |  Branch (1655:11): [True: 6.88k, False: 130k]
  ------------------
 1656|   137k|                           cpi->sf.inter_sf.mode_cost_upd_level))
 1657|  6.88k|        break;
 1658|   130k|      av1_fill_mode_rates(cm, &x->mode_costs, xd->tile_ctx);
 1659|   130k|      break;
 1660|      0|    default: assert(0);
  ------------------
  |  Branch (1660:5): [True: 0, False: 137k]
  ------------------
 1661|   137k|  }
 1662|       |
 1663|   137k|  switch (cpi->sf.inter_sf.mv_cost_upd_level) {
 1664|      0|    case INTERNAL_COST_UPD_OFF:
  ------------------
  |  Branch (1664:5): [True: 0, False: 137k]
  ------------------
 1665|      0|    case INTERNAL_COST_UPD_TILE:  // Tile level
  ------------------
  |  Branch (1665:5): [True: 0, False: 137k]
  ------------------
 1666|      0|      break;
 1667|  17.7k|    case INTERNAL_COST_UPD_SBROW_SET:  // SB row set level in tile
  ------------------
  |  Branch (1667:5): [True: 17.7k, False: 119k]
  ------------------
 1668|   137k|    case INTERNAL_COST_UPD_SBROW:      // SB row level in tile
  ------------------
  |  Branch (1668:5): [True: 119k, False: 17.7k]
  ------------------
 1669|   137k|    case INTERNAL_COST_UPD_SB:         // SB level
  ------------------
  |  Branch (1669:5): [True: 0, False: 137k]
  ------------------
 1670|       |      // Checks for skip status of mv cost update.
 1671|   137k|      if (skip_mv_cost_update(cpi, tile_info, mi_row, mi_col)) break;
  ------------------
  |  Branch (1671:11): [True: 35.6k, False: 101k]
  ------------------
 1672|   101k|      av1_fill_mv_costs(&xd->tile_ctx->nmvc,
 1673|   101k|                        cm->features.cur_frame_force_integer_mv,
 1674|   101k|                        cm->features.allow_high_precision_mv, x->mv_costs);
 1675|   101k|      break;
 1676|      0|    default: assert(0);
  ------------------
  |  Branch (1676:5): [True: 0, False: 137k]
  ------------------
 1677|   137k|  }
 1678|       |
 1679|   137k|  switch (cpi->sf.intra_sf.dv_cost_upd_level) {
 1680|  49.1k|    case INTERNAL_COST_UPD_OFF:
  ------------------
  |  Branch (1680:5): [True: 49.1k, False: 88.3k]
  ------------------
 1681|  49.1k|    case INTERNAL_COST_UPD_TILE:  // Tile level
  ------------------
  |  Branch (1681:5): [True: 0, False: 137k]
  ------------------
 1682|  49.1k|      break;
 1683|      0|    case INTERNAL_COST_UPD_SBROW_SET:  // SB row set level in tile
  ------------------
  |  Branch (1683:5): [True: 0, False: 137k]
  ------------------
 1684|      0|    case INTERNAL_COST_UPD_SBROW:      // SB row level in tile
  ------------------
  |  Branch (1684:5): [True: 0, False: 137k]
  ------------------
 1685|  88.3k|    case INTERNAL_COST_UPD_SB:         // SB level
  ------------------
  |  Branch (1685:5): [True: 88.3k, False: 49.1k]
  ------------------
 1686|       |      // Checks for skip status of dv cost update.
 1687|  88.3k|      if (skip_dv_cost_update(cpi, tile_info, mi_row, mi_col)) break;
  ------------------
  |  Branch (1687:11): [True: 86.0k, False: 2.33k]
  ------------------
 1688|  2.33k|      av1_fill_dv_costs(&xd->tile_ctx->ndvc, x->dv_costs);
 1689|  2.33k|      break;
 1690|      0|    default: assert(0);
  ------------------
  |  Branch (1690:5): [True: 0, False: 137k]
  ------------------
 1691|   137k|  }
 1692|   137k|}
av1_dealloc_src_diff_buf:
 1694|   312k|void av1_dealloc_src_diff_buf(struct macroblock *mb, int num_planes) {
 1695|   868k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1695:23): [True: 556k, False: 312k]
  ------------------
 1696|   556k|    aom_free(mb->plane[plane].src_diff);
 1697|       |    mb->plane[plane].src_diff = NULL;
 1698|   556k|  }
 1699|   312k|}
av1_alloc_src_diff_buf:
 1701|   112k|void av1_alloc_src_diff_buf(const struct AV1Common *cm, struct macroblock *mb) {
 1702|   112k|  const int num_planes = av1_num_planes(cm);
 1703|       |#ifndef NDEBUG
 1704|       |  for (int plane = 0; plane < num_planes; ++plane) {
 1705|       |    assert(!mb->plane[plane].src_diff);
 1706|       |  }
 1707|       |#endif
 1708|   311k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (1708:23): [True: 199k, False: 112k]
  ------------------
 1709|   199k|    const int subsampling_xy =
 1710|   199k|        plane ? cm->seq_params->subsampling_x + cm->seq_params->subsampling_y
  ------------------
  |  Branch (1710:9): [True: 87.3k, False: 112k]
  ------------------
 1711|   199k|              : 0;
 1712|   199k|    const int sb_size = MAX_SB_SQUARE >> subsampling_xy;
  ------------------
  |  |   33|   199k|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|   199k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   199k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|   199k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   199k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1713|       |    CHECK_MEM_ERROR(cm, mb->plane[plane].src_diff,
  ------------------
  |  |   51|   199k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|   199k|  do {                                                    \
  |  |  |  |   72|   199k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|   199k|    lval = (expr);                                        \
  |  |  |  |   74|   199k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 199k]
  |  |  |  |  ------------------
  |  |  |  |   75|   199k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|   199k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 199k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1714|   199k|                    (int16_t *)aom_memalign(
 1715|   199k|                        32, sizeof(*mb->plane[plane].src_diff) * sb_size));
 1716|   199k|  }
 1717|   112k|}
encodeframe_utils.c:copy_mbmi_ext_frame_to_mbmi_ext:
  165|  6.38M|    const MB_MODE_INFO_EXT_FRAME *const mbmi_ext_best, uint8_t ref_frame_type) {
  166|  6.38M|  memcpy(mbmi_ext->ref_mv_stack[ref_frame_type], mbmi_ext_best->ref_mv_stack,
  167|  6.38M|         sizeof(mbmi_ext->ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  6.38M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  168|  6.38M|  memcpy(mbmi_ext->weight[ref_frame_type], mbmi_ext_best->weight,
  169|  6.38M|         sizeof(mbmi_ext->weight[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  6.38M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  170|  6.38M|  mbmi_ext->mode_context[ref_frame_type] = mbmi_ext_best->mode_context;
  171|  6.38M|  mbmi_ext->ref_mv_count[ref_frame_type] = mbmi_ext_best->ref_mv_count;
  172|  6.38M|  memcpy(mbmi_ext->global_mvs, mbmi_ext_best->global_mvs,
  173|  6.38M|         sizeof(mbmi_ext->global_mvs));
  174|  6.38M|}
encodeframe_utils.c:update_filter_type_count:
  149|   511k|                                            const MB_MODE_INFO *mbmi) {
  150|   511k|  int dir;
  151|  1.53M|  for (dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (151:17): [True: 1.02M, False: 511k]
  ------------------
  152|  1.02M|    const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
  153|  1.02M|    InterpFilter filter = av1_extract_interp_filter(mbmi->interp_filters, dir);
  154|       |
  155|       |    // Only allow the 3 valid SWITCHABLE_FILTERS.
  156|       |    assert(filter < SWITCHABLE_FILTERS);
  157|  1.02M|    ++counts->switchable_interp[ctx][filter];
  158|  1.02M|  }
  159|   511k|}
encodeframe_utils.c:update_palette_cdf:
  399|  61.6k|                               FRAME_COUNTS *counts) {
  400|  61.6k|  FRAME_CONTEXT *fc = xd->tile_ctx;
  401|  61.6k|  const BLOCK_SIZE bsize = mbmi->bsize;
  402|  61.6k|  const PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  403|  61.6k|  const int palette_bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  404|       |
  405|  61.6k|  (void)counts;
  406|       |
  407|  61.6k|  if (mbmi->mode == DC_PRED) {
  ------------------
  |  Branch (407:7): [True: 59.2k, False: 2.40k]
  ------------------
  408|  59.2k|    const int n = pmi->palette_size[0];
  409|  59.2k|    const int palette_mode_ctx = av1_get_palette_mode_ctx(xd);
  410|       |
  411|       |#if CONFIG_ENTROPY_STATS
  412|       |    ++counts->palette_y_mode[palette_bsize_ctx][palette_mode_ctx][n > 0];
  413|       |#endif
  414|  59.2k|    update_cdf(fc->palette_y_mode_cdf[palette_bsize_ctx][palette_mode_ctx],
  415|  59.2k|               n > 0, 2);
  416|  59.2k|    if (n > 0) {
  ------------------
  |  Branch (416:9): [True: 42.3k, False: 16.8k]
  ------------------
  417|       |#if CONFIG_ENTROPY_STATS
  418|       |      ++counts->palette_y_size[palette_bsize_ctx][n - PALETTE_MIN_SIZE];
  419|       |#endif
  420|  42.3k|      update_cdf(fc->palette_y_size_cdf[palette_bsize_ctx],
  421|  42.3k|                 n - PALETTE_MIN_SIZE, PALETTE_SIZES);
  ------------------
  |  |   65|  42.3k|#define PALETTE_MIN_SIZE 2
  ------------------
  422|  42.3k|    }
  423|  59.2k|  }
  424|       |
  425|  61.6k|  if (mbmi->uv_mode == UV_DC_PRED) {
  ------------------
  |  Branch (425:7): [True: 48.5k, False: 13.1k]
  ------------------
  426|  48.5k|    const int n = pmi->palette_size[1];
  427|  48.5k|    const int palette_uv_mode_ctx = (pmi->palette_size[0] > 0);
  428|       |
  429|       |#if CONFIG_ENTROPY_STATS
  430|       |    ++counts->palette_uv_mode[palette_uv_mode_ctx][n > 0];
  431|       |#endif
  432|  48.5k|    update_cdf(fc->palette_uv_mode_cdf[palette_uv_mode_ctx], n > 0, 2);
  433|       |
  434|  48.5k|    if (n > 0) {
  ------------------
  |  Branch (434:9): [True: 24.7k, False: 23.7k]
  ------------------
  435|       |#if CONFIG_ENTROPY_STATS
  436|       |      ++counts->palette_uv_size[palette_bsize_ctx][n - PALETTE_MIN_SIZE];
  437|       |#endif
  438|  24.7k|      update_cdf(fc->palette_uv_size_cdf[palette_bsize_ctx],
  439|  24.7k|                 n - PALETTE_MIN_SIZE, PALETTE_SIZES);
  ------------------
  |  |   65|  24.7k|#define PALETTE_MIN_SIZE 2
  ------------------
  440|  24.7k|    }
  441|  48.5k|  }
  442|  61.6k|}
encodeframe_utils.c:avg_cdf_symbol:
 1077|   204k|                           int wt_left, int wt_tr) {
 1078|  2.46M|  for (int i = 0; i < num_cdfs; i++) {
  ------------------
  |  Branch (1078:19): [True: 2.25M, False: 204k]
  ------------------
 1079|  14.3M|    for (int j = 0; j <= nsymbs; j++) {
  ------------------
  |  Branch (1079:21): [True: 12.0M, False: 2.25M]
  ------------------
 1080|  12.0M|      cdf_ptr_left[i * cdf_stride + j] =
 1081|  12.0M|          (aom_cdf_prob)(((int)cdf_ptr_left[i * cdf_stride + j] * wt_left +
 1082|  12.0M|                          (int)cdf_ptr_tr[i * cdf_stride + j] * wt_tr +
 1083|  12.0M|                          ((wt_left + wt_tr) / 2)) /
 1084|  12.0M|                         (wt_left + wt_tr));
 1085|       |      assert(cdf_ptr_left[i * cdf_stride + j] >= 0 &&
 1086|  12.0M|             cdf_ptr_left[i * cdf_stride + j] < CDF_PROB_TOP);
 1087|  12.0M|    }
 1088|  2.25M|  }
 1089|   204k|}
encodeframe_utils.c:avg_nmv:
 1105|  2.91k|                    int wt_tr) {
 1106|  2.91k|  AVERAGE_CDF(nmv_left->joints_cdf, nmv_tr->joints_cdf, 4);
  ------------------
  |  | 1092|  2.91k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  2.91k|  do {                                                                     \
  |  |  |  | 1096|  2.91k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  2.91k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  2.91k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  2.91k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  2.91k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  2.91k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  2.91k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 2.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1107|  8.74k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1107:19): [True: 5.83k, False: 2.91k]
  ------------------
 1108|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].classes_cdf, nmv_tr->comps[i].classes_cdf,
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|  5.83k|                MV_CLASSES);
 1110|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].class0_fp_cdf,
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|  5.83k|                nmv_tr->comps[i].class0_fp_cdf, MV_FP_SIZE);
 1112|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].fp_cdf, nmv_tr->comps[i].fp_cdf, MV_FP_SIZE);
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1113|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].sign_cdf, nmv_tr->comps[i].sign_cdf, 2);
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1114|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].class0_hp_cdf,
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|  5.83k|                nmv_tr->comps[i].class0_hp_cdf, 2);
 1116|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].hp_cdf, nmv_tr->comps[i].hp_cdf, 2);
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1117|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].class0_cdf, nmv_tr->comps[i].class0_cdf,
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1118|  5.83k|                CLASS0_SIZE);
 1119|  5.83k|    AVERAGE_CDF(nmv_left->comps[i].bits_cdf, nmv_tr->comps[i].bits_cdf, 2);
  ------------------
  |  | 1092|  5.83k|  AVG_CDF_STRIDE(cname_left, cname_tr, nsymbs, CDF_SIZE(nsymbs))
  |  |  ------------------
  |  |  |  | 1095|  5.83k|  do {                                                                     \
  |  |  |  | 1096|  5.83k|    aom_cdf_prob *cdf_ptr_left = (aom_cdf_prob *)cname_left;               \
  |  |  |  | 1097|  5.83k|    aom_cdf_prob *cdf_ptr_tr = (aom_cdf_prob *)cname_tr;                   \
  |  |  |  | 1098|  5.83k|    int array_size = (int)sizeof(cname_left) / sizeof(aom_cdf_prob);       \
  |  |  |  | 1099|  5.83k|    int num_cdfs = array_size / cdf_stride;                                \
  |  |  |  | 1100|  5.83k|    avg_cdf_symbol(cdf_ptr_left, cdf_ptr_tr, num_cdfs, cdf_stride, nsymbs, \
  |  |  |  | 1101|  5.83k|                   wt_left, wt_tr);                                        \
  |  |  |  | 1102|  5.83k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:12): [Folded, False: 5.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1120|  5.83k|  }
 1121|  2.91k|}
encodeframe_utils.c:skip_cost_update:
 1559|   389k|                            INTERNAL_COST_UPDATE_TYPE upd_level) {
 1560|   389k|  if (upd_level == INTERNAL_COST_UPD_SB) return 0;
  ------------------
  |  Branch (1560:7): [True: 100k, False: 289k]
  ------------------
 1561|   289k|  if (upd_level == INTERNAL_COST_UPD_OFF) return 1;
  ------------------
  |  Branch (1561:7): [True: 0, False: 289k]
  ------------------
 1562|       |
 1563|       |  // upd_level is at most as frequent as each sb_row in a tile.
 1564|   289k|  if (mi_col != tile_info->mi_col_start) return 1;
  ------------------
  |  Branch (1564:7): [True: 23.8k, False: 265k]
  ------------------
 1565|       |
 1566|   265k|  if (upd_level == INTERNAL_COST_UPD_SBROW_SET) {
  ------------------
  |  Branch (1566:7): [True: 12.7k, False: 252k]
  ------------------
 1567|  12.7k|    const int mib_size_log2 = seq_params->mib_size_log2;
 1568|  12.7k|    const int sb_row = (mi_row - tile_info->mi_row_start) >> mib_size_log2;
 1569|  12.7k|    const int sb_size = seq_params->mib_size * MI_SIZE;
  ------------------
  |  |   40|  12.7k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1570|  12.7k|    const int tile_height =
 1571|  12.7k|        (tile_info->mi_row_end - tile_info->mi_row_start) * MI_SIZE;
  ------------------
  |  |   40|  12.7k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.7k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1572|       |    // When upd_level = INTERNAL_COST_UPD_SBROW_SET, the cost update happens
 1573|       |    // once for 2, 4 sb rows for sb size 128, sb size 64 respectively. However,
 1574|       |    // as the update will not be equally spaced in smaller resolutions making
 1575|       |    // it equally spaced by calculating (mv_num_rows_cost_update) the number of
 1576|       |    // rows after which the cost update should happen.
 1577|  12.7k|    const int sb_size_update_freq_map[2] = { 2, 4 };
 1578|  12.7k|    const int update_freq_sb_rows =
 1579|  12.7k|        sb_size_update_freq_map[sb_size != MAX_SB_SIZE];
  ------------------
  |  |   32|  12.7k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  12.7k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 1580|  12.7k|    const int update_freq_num_rows = sb_size * update_freq_sb_rows;
 1581|       |    // Round-up the division result to next integer.
 1582|  12.7k|    const int num_updates_per_tile =
 1583|  12.7k|        (tile_height + update_freq_num_rows - 1) / update_freq_num_rows;
 1584|  12.7k|    const int num_rows_update_per_tile = num_updates_per_tile * sb_size;
 1585|       |    // Round-up the division result to next integer.
 1586|  12.7k|    const int num_sb_rows_per_update =
 1587|  12.7k|        (tile_height + num_rows_update_per_tile - 1) / num_rows_update_per_tile;
 1588|  12.7k|    if ((sb_row % num_sb_rows_per_update) != 0) return 1;
  ------------------
  |  Branch (1588:9): [True: 634, False: 12.1k]
  ------------------
 1589|  12.7k|  }
 1590|   264k|  return 0;
 1591|   265k|}
encodeframe_utils.c:skip_mv_cost_update:
 1595|   137k|                               const int mi_row, const int mi_col) {
 1596|   137k|  const AV1_COMMON *cm = &cpi->common;
 1597|       |  // For intra frames, mv cdfs are not updated during the encode. Hence, the mv
 1598|       |  // cost calculation is skipped in this case.
 1599|   137k|  if (frame_is_intra_only(cm)) return 1;
  ------------------
  |  Branch (1599:7): [True: 24.8k, False: 112k]
  ------------------
 1600|       |
 1601|   112k|  return skip_cost_update(cm->seq_params, tile_info, mi_row, mi_col,
 1602|   112k|                          cpi->sf.inter_sf.mv_cost_upd_level);
 1603|   137k|}
encodeframe_utils.c:skip_dv_cost_update:
 1607|  88.3k|                               const int mi_row, const int mi_col) {
 1608|  88.3k|  const AV1_COMMON *cm = &cpi->common;
 1609|       |  // Intrabc is only applicable to intra frames. So skip if intrabc is not
 1610|       |  // allowed.
 1611|  88.3k|  if (!av1_allow_intrabc(cm) || is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (1611:7): [True: 86.0k, False: 2.32k]
  |  Branch (1611:33): [True: 0, False: 2.32k]
  ------------------
 1612|  86.0k|    return 1;
 1613|  86.0k|  }
 1614|       |
 1615|  2.33k|  return skip_cost_update(cm->seq_params, tile_info, mi_row, mi_col,
 1616|  2.33k|                          cpi->sf.intra_sf.dv_cost_upd_level);
 1617|  88.3k|}

encodeframe.c:enforce_max_ref_frames:
  553|  73.6k|    unsigned int cur_frame_display_index) {
  554|  73.6k|  MV_REFERENCE_FRAME ref_frame;
  555|  73.6k|  int total_valid_refs = 0;
  556|       |
  557|   588k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (557:32): [True: 515k, False: 73.6k]
  ------------------
  558|   515k|    if (*ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
  ------------------
  |  Branch (558:9): [True: 73.6k, False: 441k]
  ------------------
  559|  73.6k|      total_valid_refs++;
  560|  73.6k|    }
  561|   515k|  }
  562|       |
  563|  73.6k|  const int max_allowed_refs = get_max_allowed_ref_frames(
  564|  73.6k|      cpi, ref_frame_flags, ref_display_order_hint, cur_frame_display_index);
  565|       |
  566|  73.6k|  for (int i = 0; i < 4 && total_valid_refs > max_allowed_refs; ++i) {
  ------------------
  |  Branch (566:19): [True: 73.6k, False: 0]
  |  Branch (566:28): [True: 0, False: 73.6k]
  ------------------
  567|      0|    const MV_REFERENCE_FRAME ref_frame_to_disable = disable_order[i];
  568|       |
  569|      0|    if (!(*ref_frame_flags & av1_ref_frame_flag_list[ref_frame_to_disable])) {
  ------------------
  |  Branch (569:9): [True: 0, False: 0]
  ------------------
  570|      0|      continue;
  571|      0|    }
  572|       |
  573|      0|    switch (ref_frame_to_disable) {
  574|      0|      case LAST3_FRAME: *ref_frame_flags &= ~AOM_LAST3_FLAG; break;
  ------------------
  |  Branch (574:7): [True: 0, False: 0]
  ------------------
  575|      0|      case LAST2_FRAME: *ref_frame_flags &= ~AOM_LAST2_FLAG; break;
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|      case ALTREF2_FRAME: *ref_frame_flags &= ~AOM_ALT2_FLAG; break;
  ------------------
  |  Branch (576:7): [True: 0, False: 0]
  ------------------
  577|      0|      case BWDREF_FRAME: *ref_frame_flags &= ~AOM_GOLD_FLAG; break;
  ------------------
  |  Branch (577:7): [True: 0, False: 0]
  ------------------
  578|      0|      default: assert(0);
  ------------------
  |  Branch (578:7): [True: 0, False: 0]
  ------------------
  579|      0|    }
  580|      0|    --total_valid_refs;
  581|      0|  }
  582|  73.6k|  assert(total_valid_refs <= max_allowed_refs);
  583|  73.6k|}
encodeframe.c:get_max_allowed_ref_frames:
  538|  73.6k|    unsigned int cur_frame_display_index) {
  539|  73.6k|  const unsigned int max_reference_frames =
  540|  73.6k|      cpi->oxcf.ref_frm_cfg.max_reference_frames;
  541|  73.6k|  const unsigned int num_refs_to_disable = get_num_refs_to_disable(
  542|  73.6k|      cpi, ref_frame_flags, ref_display_order_hint, cur_frame_display_index);
  543|  73.6k|  const unsigned int max_allowed_refs_for_given_speed =
  544|  73.6k|      INTER_REFS_PER_FRAME - num_refs_to_disable;
  545|  73.6k|  return AOMMIN(max_allowed_refs_for_given_speed, max_reference_frames);
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
  546|  73.6k|}
encodeframe.c:get_num_refs_to_disable:
  504|  73.6k|    unsigned int cur_frame_display_index) {
  505|  73.6k|  unsigned int num_refs_to_disable = 0;
  506|  73.6k|  if (cpi->sf.inter_sf.selective_ref_frame >= 3) {
  ------------------
  |  Branch (506:7): [True: 73.6k, False: 0]
  ------------------
  507|  73.6k|    num_refs_to_disable++;
  508|  73.6k|    if (cpi->sf.inter_sf.selective_ref_frame >= 6) {
  ------------------
  |  Branch (508:9): [True: 49.2k, False: 24.4k]
  ------------------
  509|       |      // Disable LAST2_FRAME  and ALTREF2_FRAME
  510|  49.2k|      num_refs_to_disable += 2;
  511|  49.2k|    } else if (cpi->sf.inter_sf.selective_ref_frame == 5 &&
  ------------------
  |  Branch (511:16): [True: 0, False: 24.4k]
  ------------------
  512|      0|               *ref_frame_flags & av1_ref_frame_flag_list[LAST2_FRAME]) {
  ------------------
  |  Branch (512:16): [True: 0, False: 0]
  ------------------
  513|      0|      const int last2_frame_dist = av1_encoder_get_relative_dist(
  514|      0|          ref_display_order_hint[LAST2_FRAME - LAST_FRAME],
  515|      0|          cur_frame_display_index);
  516|       |      // Disable LAST2_FRAME if it is a temporally distant frame
  517|      0|      if (abs(last2_frame_dist) > 2) {
  ------------------
  |  Branch (517:11): [True: 0, False: 0]
  ------------------
  518|      0|        num_refs_to_disable++;
  519|      0|      }
  520|      0|#if !CONFIG_REALTIME_ONLY
  521|      0|      else if (is_stat_consumption_stage_twopass(cpi)) {
  ------------------
  |  Branch (521:16): [True: 0, False: 0]
  ------------------
  522|      0|        const FIRSTPASS_STATS *const this_frame_stats =
  523|      0|            read_one_frame_stats(&cpi->ppi->twopass, cur_frame_display_index);
  524|      0|        const double coded_error_per_mb = this_frame_stats->coded_error;
  525|       |        // Disable LAST2_FRAME if the coded error of the current frame based on
  526|       |        // first pass stats is very low.
  527|      0|        if (coded_error_per_mb < 100.0) num_refs_to_disable++;
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|      }
  529|      0|#endif  // CONFIG_REALTIME_ONLY
  530|      0|    }
  531|  73.6k|  }
  532|  73.6k|  return num_refs_to_disable;
  533|  73.6k|}
encodeframe.c:av1_alloc_mb_data:
  469|  17.5k|                                     struct macroblock *mb) {
  470|  17.5k|  const AV1_COMMON *cm = &cpi->common;
  471|  17.5k|  const SPEED_FEATURES *sf = &cpi->sf;
  472|  17.5k|  if (!sf->rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (472:7): [True: 12.0k, False: 5.49k]
  ------------------
  473|       |    // Memory for mb_rd_record is allocated only when use_mb_rd_hash sf is
  474|       |    // enabled.
  475|  12.0k|    if (sf->rd_sf.use_mb_rd_hash)
  ------------------
  |  Branch (475:9): [True: 12.0k, False: 0]
  ------------------
  476|  12.0k|      CHECK_MEM_ERROR(cm, mb->txfm_search_info.mb_rd_record,
  ------------------
  |  |   51|  12.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  12.0k|  do {                                                    \
  |  |  |  |   72|  12.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  12.0k|    lval = (expr);                                        \
  |  |  |  |   74|  12.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 12.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  12.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  12.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 12.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|  12.0k|                      (MB_RD_RECORD *)aom_malloc(sizeof(MB_RD_RECORD)));
  478|  12.0k|    if (!frame_is_intra_only(cm))
  ------------------
  |  Branch (478:9): [True: 9.06k, False: 3.02k]
  ------------------
  479|  12.0k|      CHECK_MEM_ERROR(
  ------------------
  |  |   51|  9.06k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  9.06k|  do {                                                    \
  |  |  |  |   72|  9.06k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  9.06k|    lval = (expr);                                        \
  |  |  |  |   74|  9.06k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 9.06k]
  |  |  |  |  ------------------
  |  |  |  |   75|  9.06k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  9.06k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 9.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  12.0k|          cm, mb->inter_modes_info,
  481|  12.0k|          (InterModesInfo *)aom_malloc(sizeof(*mb->inter_modes_info)));
  482|  12.0k|  }
  483|       |
  484|  17.5k|  av1_alloc_src_diff_buf(cm, mb);
  485|       |
  486|  17.5k|  CHECK_MEM_ERROR(cm, mb->e_mbd.seg_mask,
  ------------------
  |  |   51|  17.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  17.5k|  do {                                                    \
  |  |  |  |   72|  17.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  17.5k|    lval = (expr);                                        \
  |  |  |  |   74|  17.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 17.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  17.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  17.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 17.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  17.5k|                  (uint8_t *)aom_memalign(
  488|  17.5k|                      16, 2 * MAX_SB_SQUARE * sizeof(mb->e_mbd.seg_mask[0])));
  489|       |
  490|  17.5k|  allocate_winner_mode_stats(cpi, mb);
  491|       |
  492|  17.5k|  const int max_sb_square_y = 1
  493|  17.5k|                              << num_pels_log2_lookup[cm->seq_params->sb_size];
  494|       |  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  17.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  17.5k|  do {                                                    \
  |  |  |  |   72|  17.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  17.5k|    lval = (expr);                                        \
  |  |  |  |   74|  17.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 17.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  17.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  17.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 17.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  17.5k|      cm, mb->dqcoeff_buf,
  496|  17.5k|      (tran_low_t *)aom_memalign(32, max_sb_square_y * sizeof(tran_low_t)));
  497|  17.5k|}
encodeframe.c:allocate_winner_mode_stats:
  450|  17.5k|                                              struct macroblock *mb) {
  451|  17.5k|  const SPEED_FEATURES *sf = &cpi->sf;
  452|       |  // The winner_mode_stats buffer is not required in these cases.
  453|  17.5k|  if (is_stat_generation_stage(cpi) ||
  ------------------
  |  Branch (453:7): [True: 0, False: 17.5k]
  ------------------
  454|  17.5k|      (sf->rt_sf.use_nonrd_pick_mode && !sf->rt_sf.hybrid_intra_pickmode) ||
  ------------------
  |  Branch (454:8): [True: 5.49k, False: 12.0k]
  |  Branch (454:41): [True: 0, False: 5.49k]
  ------------------
  455|  17.5k|      (sf->winner_mode_sf.multi_winner_mode_type == MULTI_WINNER_MODE_OFF))
  ------------------
  |  Branch (455:7): [True: 17.5k, False: 0]
  ------------------
  456|  17.5k|    return;
  457|       |
  458|      0|  const AV1_COMMON *cm = &cpi->common;
  459|      0|  const int winner_mode_count =
  460|      0|      winner_mode_count_allowed[sf->winner_mode_sf.multi_winner_mode_type];
  461|       |  CHECK_MEM_ERROR(cm, mb->winner_mode_stats,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  462|      0|                  (WinnerModeStats *)aom_malloc(
  463|      0|                      winner_mode_count * sizeof(mb->winner_mode_stats[0])));
  464|      0|}
encodeframe.c:av1_dealloc_mb_data:
  430|  17.5k|static inline void av1_dealloc_mb_data(struct macroblock *mb, int num_planes) {
  431|  17.5k|  aom_free(mb->txfm_search_info.mb_rd_record);
  432|  17.5k|  mb->txfm_search_info.mb_rd_record = NULL;
  433|       |
  434|  17.5k|  aom_free(mb->inter_modes_info);
  435|  17.5k|  mb->inter_modes_info = NULL;
  436|       |
  437|  17.5k|  av1_dealloc_src_diff_buf(mb, num_planes);
  438|       |
  439|  17.5k|  aom_free(mb->e_mbd.seg_mask);
  440|  17.5k|  mb->e_mbd.seg_mask = NULL;
  441|       |
  442|  17.5k|  aom_free(mb->winner_mode_stats);
  443|  17.5k|  mb->winner_mode_stats = NULL;
  444|       |
  445|  17.5k|  aom_free(mb->dqcoeff_buf);
  446|       |  mb->dqcoeff_buf = NULL;
  447|  17.5k|}
encodeframe_utils.c:set_rdmult:
  299|  7.37M|                             const MACROBLOCK *const x, int segment_id) {
  300|  7.37M|  const AV1_COMMON *const cm = &cpi->common;
  301|  7.37M|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  302|  7.37M|  const CommonQuantParams *quant_params = &cm->quant_params;
  303|  7.37M|  const aom_bit_depth_t bit_depth = cm->seq_params->bit_depth;
  304|  7.37M|  const FRAME_UPDATE_TYPE update_type =
  305|  7.37M|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index];
  306|  7.37M|  const FRAME_TYPE frame_type = cm->current_frame.frame_type;
  307|  7.37M|  const int boost_index = AOMMIN(15, (cpi->ppi->p_rc.gfu_boost / 100));
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.37M, False: 18.4E]
  |  |  ------------------
  ------------------
  308|  7.37M|  const int layer_depth = AOMMIN(gf_group->layer_depth[cpi->gf_frame_index], 6);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.37M, False: 18.4E]
  |  |  ------------------
  ------------------
  309|       |
  310|  7.37M|  int qindex;
  311|  7.37M|  if (segment_id >= 0) {
  ------------------
  |  Branch (311:7): [True: 0, False: 7.37M]
  ------------------
  312|      0|    qindex = av1_get_qindex(&cm->seg, segment_id, cm->quant_params.base_qindex);
  313|  7.37M|  } else {
  314|  7.37M|    qindex = quant_params->base_qindex + x->rdmult_delta_qindex +
  315|  7.37M|             quant_params->y_dc_delta_q;
  316|  7.37M|  }
  317|       |
  318|  7.37M|  return av1_compute_rd_mult(
  319|  7.37M|      qindex, bit_depth, update_type, layer_depth, boost_index, frame_type,
  320|  7.37M|      cpi->oxcf.q_cfg.use_fixed_qp_offsets, is_stat_consumption_stage(cpi),
  321|  7.37M|      cpi->oxcf.tune_cfg.tuning, cpi->oxcf.mode);
  322|  7.37M|}
encoder.c:av1_dealloc_mb_data:
  430|   105k|static inline void av1_dealloc_mb_data(struct macroblock *mb, int num_planes) {
  431|   105k|  aom_free(mb->txfm_search_info.mb_rd_record);
  432|   105k|  mb->txfm_search_info.mb_rd_record = NULL;
  433|       |
  434|   105k|  aom_free(mb->inter_modes_info);
  435|   105k|  mb->inter_modes_info = NULL;
  436|       |
  437|   105k|  av1_dealloc_src_diff_buf(mb, num_planes);
  438|       |
  439|   105k|  aom_free(mb->e_mbd.seg_mask);
  440|   105k|  mb->e_mbd.seg_mask = NULL;
  441|       |
  442|   105k|  aom_free(mb->winner_mode_stats);
  443|   105k|  mb->winner_mode_stats = NULL;
  444|       |
  445|   105k|  aom_free(mb->dqcoeff_buf);
  446|       |  mb->dqcoeff_buf = NULL;
  447|   105k|}
ethread.c:av1_dealloc_mb_data:
  430|   189k|static inline void av1_dealloc_mb_data(struct macroblock *mb, int num_planes) {
  431|   189k|  aom_free(mb->txfm_search_info.mb_rd_record);
  432|   189k|  mb->txfm_search_info.mb_rd_record = NULL;
  433|       |
  434|   189k|  aom_free(mb->inter_modes_info);
  435|   189k|  mb->inter_modes_info = NULL;
  436|       |
  437|   189k|  av1_dealloc_src_diff_buf(mb, num_planes);
  438|       |
  439|   189k|  aom_free(mb->e_mbd.seg_mask);
  440|   189k|  mb->e_mbd.seg_mask = NULL;
  441|       |
  442|   189k|  aom_free(mb->winner_mode_stats);
  443|   189k|  mb->winner_mode_stats = NULL;
  444|       |
  445|   189k|  aom_free(mb->dqcoeff_buf);
  446|       |  mb->dqcoeff_buf = NULL;
  447|   189k|}
ethread.c:av1_alloc_mb_data:
  469|  94.7k|                                     struct macroblock *mb) {
  470|  94.7k|  const AV1_COMMON *cm = &cpi->common;
  471|  94.7k|  const SPEED_FEATURES *sf = &cpi->sf;
  472|  94.7k|  if (!sf->rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (472:7): [True: 60.5k, False: 34.1k]
  ------------------
  473|       |    // Memory for mb_rd_record is allocated only when use_mb_rd_hash sf is
  474|       |    // enabled.
  475|  60.5k|    if (sf->rd_sf.use_mb_rd_hash)
  ------------------
  |  Branch (475:9): [True: 60.5k, False: 0]
  ------------------
  476|  60.5k|      CHECK_MEM_ERROR(cm, mb->txfm_search_info.mb_rd_record,
  ------------------
  |  |   51|  60.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  60.5k|  do {                                                    \
  |  |  |  |   72|  60.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  60.5k|    lval = (expr);                                        \
  |  |  |  |   74|  60.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 60.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  60.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  60.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 60.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|  60.5k|                      (MB_RD_RECORD *)aom_malloc(sizeof(MB_RD_RECORD)));
  478|  60.5k|    if (!frame_is_intra_only(cm))
  ------------------
  |  Branch (478:9): [True: 41.0k, False: 19.5k]
  ------------------
  479|  60.5k|      CHECK_MEM_ERROR(
  ------------------
  |  |   51|  41.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  41.0k|  do {                                                    \
  |  |  |  |   72|  41.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  41.0k|    lval = (expr);                                        \
  |  |  |  |   74|  41.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 41.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  41.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  41.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 41.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  60.5k|          cm, mb->inter_modes_info,
  481|  60.5k|          (InterModesInfo *)aom_malloc(sizeof(*mb->inter_modes_info)));
  482|  60.5k|  }
  483|       |
  484|  94.7k|  av1_alloc_src_diff_buf(cm, mb);
  485|       |
  486|  94.7k|  CHECK_MEM_ERROR(cm, mb->e_mbd.seg_mask,
  ------------------
  |  |   51|  94.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  94.7k|  do {                                                    \
  |  |  |  |   72|  94.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  94.7k|    lval = (expr);                                        \
  |  |  |  |   74|  94.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 94.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  94.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  94.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 94.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  94.7k|                  (uint8_t *)aom_memalign(
  488|  94.7k|                      16, 2 * MAX_SB_SQUARE * sizeof(mb->e_mbd.seg_mask[0])));
  489|       |
  490|  94.7k|  allocate_winner_mode_stats(cpi, mb);
  491|       |
  492|  94.7k|  const int max_sb_square_y = 1
  493|  94.7k|                              << num_pels_log2_lookup[cm->seq_params->sb_size];
  494|       |  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  94.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  94.7k|  do {                                                    \
  |  |  |  |   72|  94.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  94.7k|    lval = (expr);                                        \
  |  |  |  |   74|  94.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 94.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  94.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  94.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 94.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  94.7k|      cm, mb->dqcoeff_buf,
  496|  94.7k|      (tran_low_t *)aom_memalign(32, max_sb_square_y * sizeof(tran_low_t)));
  497|  94.7k|}
ethread.c:allocate_winner_mode_stats:
  450|  94.7k|                                              struct macroblock *mb) {
  451|  94.7k|  const SPEED_FEATURES *sf = &cpi->sf;
  452|       |  // The winner_mode_stats buffer is not required in these cases.
  453|  94.7k|  if (is_stat_generation_stage(cpi) ||
  ------------------
  |  Branch (453:7): [True: 0, False: 94.7k]
  ------------------
  454|  94.7k|      (sf->rt_sf.use_nonrd_pick_mode && !sf->rt_sf.hybrid_intra_pickmode) ||
  ------------------
  |  Branch (454:8): [True: 34.1k, False: 60.5k]
  |  Branch (454:41): [True: 0, False: 34.1k]
  ------------------
  455|  94.7k|      (sf->winner_mode_sf.multi_winner_mode_type == MULTI_WINNER_MODE_OFF))
  ------------------
  |  Branch (455:7): [True: 94.7k, False: 0]
  ------------------
  456|  94.7k|    return;
  457|       |
  458|      0|  const AV1_COMMON *cm = &cpi->common;
  459|      0|  const int winner_mode_count =
  460|      0|      winner_mode_count_allowed[sf->winner_mode_sf.multi_winner_mode_type];
  461|       |  CHECK_MEM_ERROR(cm, mb->winner_mode_stats,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  462|      0|                  (WinnerModeStats *)aom_malloc(
  463|      0|                      winner_mode_count * sizeof(mb->winner_mode_stats[0])));
  464|      0|}
partition_search.c:update_filter_type_cdf:
  288|   490k|                                          int dual_filter) {
  289|   979k|  for (int dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (289:21): [True: 979k, False: 18.4E]
  ------------------
  290|   979k|    if (dir && !dual_filter) break;
  ------------------
  |  Branch (290:9): [True: 490k, False: 489k]
  |  Branch (290:16): [True: 490k, False: 18.4E]
  ------------------
  291|   489k|    const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
  292|   489k|    InterpFilter filter = av1_extract_interp_filter(mbmi->interp_filters, dir);
  293|   489k|    update_cdf(xd->tile_ctx->switchable_interp_cdf[ctx], filter,
  294|   489k|               SWITCHABLE_FILTERS);
  295|   489k|  }
  296|   490k|}
partition_search.c:av1_blk_has_rows_and_cols:
  273|  5.45M|    const PartitionBlkParams *blk_params) {
  274|  5.45M|  return blk_params->has_rows && blk_params->has_cols;
  ------------------
  |  Branch (274:10): [True: 5.06M, False: 384k]
  |  Branch (274:34): [True: 4.84M, False: 224k]
  ------------------
  275|  5.45M|}
partition_strategy.c:av1_disable_rect_partitions:
  254|  3.00M|    PartitionSearchState *part_state) {
  255|  3.00M|  part_state->do_rectangular_split = 0;
  256|  3.00M|  part_state->partition_rect_allowed[HORZ] = 0;
  257|  3.00M|  part_state->partition_rect_allowed[VERT] = 0;
  258|  3.00M|}
partition_strategy.c:av1_disable_all_splits:
  261|  1.53M|static inline void av1_disable_all_splits(PartitionSearchState *part_state) {
  262|  1.53M|  av1_disable_square_split_partition(part_state);
  263|  1.53M|  av1_disable_rect_partitions(part_state);
  264|  1.53M|}
partition_strategy.c:av1_disable_square_split_partition:
  247|  1.58M|    PartitionSearchState *part_state) {
  248|  1.58M|  part_state->do_square_split = 0;
  249|  1.58M|}
partition_strategy.c:av1_is_whole_blk_in_frame:
  279|  1.11M|    const CommonModeInfoParams *mi_params) {
  280|  1.11M|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
  281|  1.11M|  const BLOCK_SIZE bsize = blk_params->bsize;
  282|  1.11M|  return mi_row + mi_size_high[bsize] <= mi_params->mi_rows &&
  ------------------
  |  Branch (282:10): [True: 861k, False: 251k]
  ------------------
  283|   861k|         mi_col + mi_size_wide[bsize] <= mi_params->mi_cols;
  ------------------
  |  Branch (283:10): [True: 731k, False: 129k]
  ------------------
  284|  1.11M|}
partition_strategy.c:av1_set_square_split_only:
  266|   363k|static inline void av1_set_square_split_only(PartitionSearchState *part_state) {
  267|   363k|  part_state->partition_none_allowed = 0;
  268|   363k|  part_state->do_square_split = 1;
  269|   363k|  av1_disable_rect_partitions(part_state);
  270|   363k|}
partition_strategy.c:av1_blk_has_rows_and_cols:
  273|   320k|    const PartitionBlkParams *blk_params) {
  274|   320k|  return blk_params->has_rows && blk_params->has_cols;
  ------------------
  |  Branch (274:10): [True: 320k, False: 18.4E]
  |  Branch (274:34): [True: 320k, False: 0]
  ------------------
  275|   320k|}

av1_subtract_block:
  148|   115M|                        TX_TYPE tx_type, bool do_border_pad) {
  149|   115M|  assert(rows >= 4 && cols >= 4);
  150|   115M|  const MACROBLOCKD *const xd = &x->e_mbd;
  151|   115M|  BitDepthInfo bd_info = get_bit_depth_info(xd);
  152|   115M|#if CONFIG_AV1_HIGHBITDEPTH
  153|   115M|  if (bd_info.use_highbitdepth_buf) {
  ------------------
  |  Branch (153:7): [True: 37.3M, False: 77.9M]
  ------------------
  154|  37.3M|    aom_highbd_subtract_block(rows, cols, diff, diff_stride, src8, src_stride,
  ------------------
  |  | 3604|  37.3M|#define aom_highbd_subtract_block aom_highbd_subtract_block_sse2
  ------------------
  155|  37.3M|                              pred8, pred_stride);
  156|  77.9M|  } else {
  157|  77.9M|    aom_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8,
  158|  77.9M|                       pred_stride);
  159|  77.9M|  }
  160|       |#else
  161|       |  (void)bd_info;
  162|       |  aom_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8,
  163|       |                     pred_stride);
  164|       |#endif
  165|   115M|  if (!do_border_pad) return;
  ------------------
  |  Branch (165:7): [True: 111M, False: 3.50M]
  ------------------
  166|       |
  167|  3.50M|  int visible_cols, visible_rows;
  168|  3.50M|  const int is_border_block = get_visible_dimensions(
  169|  3.50M|      x, plane, plane_bsize, blk_col, blk_row, cols, rows,
  170|  3.50M|      /*clip_dims=*/true, &visible_cols, &visible_rows);
  171|  3.50M|  if (is_border_block)
  ------------------
  |  Branch (171:7): [True: 2.76M, False: 736k]
  ------------------
  172|  2.76M|    fill_residue_outside_frame(diff, diff_stride, cols, rows, visible_cols,
  173|  2.76M|                               visible_rows, tx_type);
  174|  3.50M|}
av1_subtract_txb:
  178|  76.0M|                      TX_TYPE tx_type, bool do_border_pad) {
  179|  76.0M|  struct macroblock_plane *const p = &x->plane[plane];
  180|  76.0M|  const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane];
  181|  76.0M|  const int diff_stride = block_size_wide[plane_bsize];
  182|  76.0M|  const int src_stride = p->src.stride;
  183|  76.0M|  const int dst_stride = pd->dst.stride;
  184|  76.0M|  const int tx1d_width = tx_size_wide[tx_size];
  185|  76.0M|  const int tx1d_height = tx_size_high[tx_size];
  186|  76.0M|  uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  76.0M|#define MI_SIZE_LOG2 2
  ------------------
  187|  76.0M|  uint8_t *src = &p->src.buf[(blk_row * src_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  76.0M|#define MI_SIZE_LOG2 2
  ------------------
  188|  76.0M|  int16_t *src_diff =
  189|  76.0M|      &p->src_diff[(blk_row * diff_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  76.0M|#define MI_SIZE_LOG2 2
  ------------------
  190|  76.0M|  av1_subtract_block(x, tx1d_height, tx1d_width, src_diff, diff_stride, src,
  191|  76.0M|                     src_stride, dst, dst_stride, plane, plane_bsize, blk_col,
  192|  76.0M|                     blk_row, tx_type, do_border_pad);
  193|  76.0M|}
av1_subtract_plane:
  196|  9.15M|                        bool do_border_pad) {
  197|  9.15M|  struct macroblock_plane *const p = &x->plane[plane];
  198|  9.15M|  const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane];
  199|  9.15M|  assert(plane_bsize < BLOCK_SIZES_ALL);
  200|  9.15M|  const int bw = block_size_wide[plane_bsize];
  201|  9.15M|  const int bh = block_size_high[plane_bsize];
  202|       |
  203|  9.15M|  av1_subtract_block(x, bh, bw, p->src_diff, bw, p->src.buf, p->src.stride,
  204|  9.15M|                     pd->dst.buf, pd->dst.stride, plane, plane_bsize, 0, 0,
  205|  9.15M|                     DCT_DCT, do_border_pad);
  206|  9.15M|}
av1_optimize_b:
  210|  56.6M|                   const TXB_CTX *const txb_ctx, int *rate_cost) {
  211|  56.6M|  MACROBLOCKD *const xd = &x->e_mbd;
  212|  56.6M|  struct macroblock_plane *const p = &x->plane[plane];
  213|  56.6M|  const int eob = p->eobs[block];
  214|  56.6M|  const int segment_id = xd->mi[0]->segment_id;
  215|       |
  216|  56.6M|  if (eob == 0 || !cpi->optimize_seg_arr[segment_id] ||
  ------------------
  |  Branch (216:7): [True: 2.72M, False: 53.9M]
  |  Branch (216:19): [True: 18.4E, False: 53.9M]
  ------------------
  217|  53.9M|      xd->lossless[segment_id]) {
  ------------------
  |  Branch (217:7): [True: 18.4E, False: 53.9M]
  ------------------
  218|  2.77M|    *rate_cost = av1_cost_skip_txb(&x->coeff_costs, txb_ctx, plane, tx_size);
  219|  2.77M|    return eob;
  220|  2.77M|  }
  221|       |
  222|  53.9M|  return av1_optimize_txb(cpi, x, plane, block, tx_size, tx_type, txb_ctx,
  223|  53.9M|                          rate_cost, cpi->oxcf.algo_cfg.sharpness);
  224|  56.6M|}
av1_xform_dc_only:
  394|  2.01M|                       TxfmParam *txfm_param, int64_t per_px_mean) {
  395|  2.01M|  assert(per_px_mean != INT64_MAX);
  396|  2.01M|  const struct macroblock_plane *const p = &x->plane[plane];
  397|  2.01M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|  2.01M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  398|  2.01M|  tran_low_t *const coeff = p->coeff + block_offset;
  399|  2.01M|  const int n_coeffs = av1_get_max_eob(txfm_param->tx_size);
  400|  2.01M|  memset(coeff, 0, sizeof(*coeff) * n_coeffs);
  401|  2.01M|  coeff[0] =
  402|  2.01M|      (tran_low_t)((per_px_mean * dc_coeff_scale[txfm_param->tx_size]) >> 12);
  403|  2.01M|}
av1_xform_quant:
  407|  17.2M|                     const QUANT_PARAM *qparam) {
  408|  17.2M|  av1_xform(x, plane, block, blk_row, blk_col, plane_bsize, txfm_param);
  409|  17.2M|  av1_quant(x, plane, block, txfm_param, qparam);
  410|  17.2M|}
av1_xform:
  413|   129M|               BLOCK_SIZE plane_bsize, TxfmParam *txfm_param) {
  414|   129M|  const struct macroblock_plane *const p = &x->plane[plane];
  415|   129M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|   129M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  416|   129M|  tran_low_t *const coeff = p->coeff + block_offset;
  417|   129M|  const int diff_stride = block_size_wide[plane_bsize];
  418|       |
  419|   129M|  const int src_offset = (blk_row * diff_stride + blk_col);
  420|   129M|  const int16_t *src_diff = &p->src_diff[src_offset << MI_SIZE_LOG2];
  ------------------
  |  |   39|   129M|#define MI_SIZE_LOG2 2
  ------------------
  421|       |
  422|   129M|  av1_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
  423|   129M|}
av1_quant:
  426|   132M|               const QUANT_PARAM *qparam) {
  427|   132M|  const struct macroblock_plane *const p = &x->plane[plane];
  428|   132M|  const SCAN_ORDER *const scan_order =
  429|   132M|      get_scan(txfm_param->tx_size, txfm_param->tx_type);
  430|   132M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|   132M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  431|   132M|  tran_low_t *const coeff = p->coeff + block_offset;
  432|   132M|  tran_low_t *const qcoeff = p->qcoeff + block_offset;
  433|   132M|  tran_low_t *const dqcoeff = p->dqcoeff + block_offset;
  434|   132M|  uint16_t *const eob = &p->eobs[block];
  435|       |
  436|   132M|  if (qparam->xform_quant_idx != AV1_XFORM_QUANT_SKIP_QUANT) {
  ------------------
  |  Branch (436:7): [True: 132M, False: 121k]
  ------------------
  437|   132M|    const int n_coeffs = av1_get_max_eob(txfm_param->tx_size);
  438|   132M|    if (LIKELY(!x->seg_skip_block)) {
  ------------------
  |  |   54|   132M|#define LIKELY(v) __builtin_expect(v, 1)
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 132M, False: 108k]
  |  |  ------------------
  ------------------
  439|   132M|#if CONFIG_AV1_HIGHBITDEPTH
  440|   132M|      quant_func_list[qparam->xform_quant_idx][txfm_param->is_hbd](
  441|   132M|          coeff, n_coeffs, p, qcoeff, dqcoeff, eob, scan_order, qparam);
  442|       |#else
  443|       |      quant_func_list[qparam->xform_quant_idx](
  444|       |          coeff, n_coeffs, p, qcoeff, dqcoeff, eob, scan_order, qparam);
  445|       |#endif
  446|   132M|    } else {
  447|   108k|      av1_quantize_skip(n_coeffs, qcoeff, dqcoeff, eob);
  448|   108k|    }
  449|   132M|  }
  450|       |  // use_optimize_b is true means av1_optimze_b will be called,
  451|       |  // thus cannot update entropy ctx now (performed in optimize_b)
  452|   132M|  if (qparam->use_optimize_b) {
  ------------------
  |  Branch (452:7): [True: 56.7M, False: 76.1M]
  ------------------
  453|  56.7M|    p->txb_entropy_ctx[block] = 0;
  454|  76.1M|  } else {
  455|  76.1M|    p->txb_entropy_ctx[block] =
  456|  76.1M|        av1_get_txb_entropy_context(qcoeff, scan_order, *eob);
  457|  76.1M|  }
  458|   132M|}
av1_setup_xform:
  461|  80.8M|                     TX_TYPE tx_type, TxfmParam *txfm_param) {
  462|  80.8M|  MACROBLOCKD *const xd = &x->e_mbd;
  463|  80.8M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  464|       |
  465|  80.8M|  txfm_param->tx_type = tx_type;
  466|  80.8M|  txfm_param->tx_size = tx_size;
  467|  80.8M|  txfm_param->lossless = xd->lossless[mbmi->segment_id];
  468|  80.8M|  txfm_param->tx_set_type = av1_get_ext_tx_set_type(
  469|  80.8M|      tx_size, is_inter_block(mbmi), cm->features.reduced_tx_set_used);
  470|       |
  471|  80.8M|  txfm_param->bd = xd->bd;
  472|  80.8M|  txfm_param->is_hbd = is_cur_buf_hbd(xd);
  473|  80.8M|}
av1_setup_quant:
  475|  87.3M|                     int use_quant_b_adapt, QUANT_PARAM *qparam) {
  476|  87.3M|  qparam->log_scale = av1_get_tx_scale(tx_size);
  477|  87.3M|  qparam->tx_size = tx_size;
  478|       |
  479|  87.3M|  qparam->use_quant_b_adapt = use_quant_b_adapt;
  480|       |
  481|       |  // TODO(bohanli): optimize_b and quantization idx has relationship,
  482|       |  // but is kind of buried and complicated in different encoding stages.
  483|       |  // Should have a unified function to derive quant_idx, rather than
  484|       |  // determine and pass in the quant_idx
  485|  87.3M|  qparam->use_optimize_b = use_optimize_b;
  486|  87.3M|  qparam->xform_quant_idx = xform_quant_idx;
  487|       |
  488|  87.3M|  qparam->qmatrix = NULL;
  489|       |  qparam->iqmatrix = NULL;
  490|  87.3M|}
av1_setup_qmatrix:
  493|   111M|                       TX_TYPE tx_type, QUANT_PARAM *qparam) {
  494|   111M|  qparam->qmatrix = av1_get_qmatrix(quant_params, xd, plane, tx_size, tx_type);
  495|   111M|  qparam->iqmatrix =
  496|   111M|      av1_get_iqmatrix(quant_params, xd, plane, tx_size, tx_type);
  497|   111M|}
av1_foreach_transformed_block_in_plane:
  662|  78.4M|    foreach_transformed_block_visitor visit, void *arg) {
  663|  78.4M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  664|       |  // block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
  665|       |  // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
  666|       |  // transform size varies per plane, look it up in a common way.
  667|  78.4M|  const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
  668|  78.4M|  const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
  669|       |  // Call visit() directly with zero offsets if the current block size is the
  670|       |  // same as the transform block size.
  671|  78.4M|  if (plane_bsize == tx_bsize) {
  ------------------
  |  Branch (671:7): [True: 72.9M, False: 5.56M]
  ------------------
  672|  72.9M|    visit(plane, 0, 0, 0, plane_bsize, tx_size, arg);
  673|  72.9M|    return;
  674|  72.9M|  }
  675|  5.56M|  const uint8_t txw_unit = tx_size_wide_unit[tx_size];
  676|  5.56M|  const uint8_t txh_unit = tx_size_high_unit[tx_size];
  677|  5.56M|  const int step = txw_unit * txh_unit;
  678|       |
  679|       |  // If mb_to_right_edge is < 0 we are in a situation in which
  680|       |  // the current block size extends into the UMV and we won't
  681|       |  // visit the sub blocks that are wholly within the UMV.
  682|  5.56M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  683|  5.56M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  684|  5.56M|  const BLOCK_SIZE max_unit_bsize =
  685|  5.56M|      get_plane_block_size(BLOCK_64X64, pd->subsampling_x, pd->subsampling_y);
  686|  5.56M|  const int mu_blocks_wide =
  687|  5.56M|      AOMMIN(mi_size_wide[max_unit_bsize], max_blocks_wide);
  ------------------
  |  |   34|  5.56M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 5.56M]
  |  |  ------------------
  ------------------
  688|  5.56M|  const int mu_blocks_high =
  689|  5.56M|      AOMMIN(mi_size_high[max_unit_bsize], max_blocks_high);
  ------------------
  |  |   34|  5.56M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 5.56M]
  |  |  ------------------
  ------------------
  690|       |
  691|       |  // Keep track of the row and column of the blocks we use so that we know
  692|       |  // if we are in the unrestricted motion border.
  693|  5.56M|  int i = 0;
  694|  11.1M|  for (int r = 0; r < max_blocks_high; r += mu_blocks_high) {
  ------------------
  |  Branch (694:19): [True: 5.58M, False: 5.56M]
  ------------------
  695|  5.58M|    const int unit_height = AOMMIN(mu_blocks_high + r, max_blocks_high);
  ------------------
  |  |   34|  5.58M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 5.58M]
  |  |  ------------------
  ------------------
  696|       |    // Skip visiting the sub blocks that are wholly within the UMV.
  697|  11.1M|    for (int c = 0; c < max_blocks_wide; c += mu_blocks_wide) {
  ------------------
  |  Branch (697:21): [True: 5.58M, False: 5.58M]
  ------------------
  698|  5.58M|      const int unit_width = AOMMIN(mu_blocks_wide + c, max_blocks_wide);
  ------------------
  |  |   34|  5.58M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 5.58M]
  |  |  ------------------
  ------------------
  699|  16.7M|      for (int blk_row = r; blk_row < unit_height; blk_row += txh_unit) {
  ------------------
  |  Branch (699:29): [True: 11.1M, False: 5.58M]
  ------------------
  700|  33.5M|        for (int blk_col = c; blk_col < unit_width; blk_col += txw_unit) {
  ------------------
  |  Branch (700:31): [True: 22.4M, False: 11.1M]
  ------------------
  701|  22.4M|          visit(plane, i, blk_row, blk_col, plane_bsize, tx_size, arg);
  702|  22.4M|          i += step;
  703|  22.4M|        }
  704|  11.1M|      }
  705|  5.58M|    }
  706|  5.58M|  }
  707|       |  // Check if visit() is invoked at least once.
  708|       |  assert(i >= 1);
  709|  5.56M|}
av1_encode_sb:
  761|  1.13M|                   RUN_TYPE dry_run) {
  762|  1.13M|  assert(bsize < BLOCK_SIZES_ALL);
  763|  1.13M|  MACROBLOCKD *const xd = &x->e_mbd;
  764|  1.13M|  MB_MODE_INFO *mbmi = xd->mi[0];
  765|       |  // In the current encoder implementation, for inter blocks,
  766|       |  // only when YUV planes all have zero quantized transform coefficients,
  767|       |  // mbmi->skip_txfm flag is set to 1.
  768|       |  // For intra blocks, this flag is set to 0 since skipped blocks are so rare
  769|       |  // that transmitting skip_txfm = 1 is very expensive.
  770|       |  // mbmi->skip_txfm is init to 1, and will be modified in encode_block() based
  771|       |  // on transform, quantization, and (if exists) trellis optimization.
  772|  1.13M|  mbmi->skip_txfm = 1;
  773|  1.13M|  if (x->txfm_search_info.skip_txfm) return;
  ------------------
  |  Branch (773:7): [True: 197k, False: 939k]
  ------------------
  774|       |
  775|   939k|  struct optimize_ctx ctx;
  776|   939k|  struct encode_b_args arg = {
  777|   939k|    cpi, x, &ctx, NULL, NULL, dry_run, cpi->optimize_seg_arr[mbmi->segment_id]
  778|   939k|  };
  779|   939k|  const AV1_COMMON *const cm = &cpi->common;
  780|   939k|  const int num_planes = av1_num_planes(cm);
  781|  2.36M|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (781:23): [True: 1.43M, False: 929k]
  ------------------
  782|  1.43M|    const struct macroblockd_plane *const pd = &xd->plane[plane];
  783|  1.43M|    const int subsampling_x = pd->subsampling_x;
  784|  1.43M|    const int subsampling_y = pd->subsampling_y;
  785|  1.43M|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (785:9): [True: 497k, False: 939k]
  |  Branch (785:18): [True: 10.6k, False: 487k]
  ------------------
  786|  1.42M|    const BLOCK_SIZE plane_bsize =
  787|  1.42M|        get_plane_block_size(bsize, subsampling_x, subsampling_y);
  788|  1.42M|    assert(plane_bsize < BLOCK_SIZES_ALL);
  789|  1.42M|    const int mi_width = mi_size_wide[plane_bsize];
  790|  1.42M|    const int mi_height = mi_size_high[plane_bsize];
  791|  1.42M|    const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane);
  792|  1.42M|    const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size];
  793|  1.42M|    const int bw = mi_size_wide[txb_size];
  794|  1.42M|    const int bh = mi_size_high[txb_size];
  795|  1.42M|    int block = 0;
  796|  1.42M|    const int step =
  797|  1.42M|        tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
  798|  1.42M|    av1_get_entropy_contexts(plane_bsize, pd, ctx.ta[plane], ctx.tl[plane]);
  799|  1.42M|    arg.ta = ctx.ta[plane];
  800|  1.42M|    arg.tl = ctx.tl[plane];
  801|  1.42M|    const BLOCK_SIZE max_unit_bsize =
  802|  1.42M|        get_plane_block_size(BLOCK_64X64, subsampling_x, subsampling_y);
  803|  1.42M|    int mu_blocks_wide = mi_size_wide[max_unit_bsize];
  804|  1.42M|    int mu_blocks_high = mi_size_high[max_unit_bsize];
  805|  1.42M|    mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.42M, False: 1.85k]
  |  |  ------------------
  ------------------
  806|  1.42M|    mu_blocks_high = AOMMIN(mi_height, mu_blocks_high);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.42M, False: 1.67k]
  |  |  ------------------
  ------------------
  807|       |
  808|  2.85M|    for (int idy = 0; idy < mi_height; idy += mu_blocks_high) {
  ------------------
  |  Branch (808:23): [True: 1.42M, False: 1.42M]
  ------------------
  809|  2.85M|      for (int idx = 0; idx < mi_width; idx += mu_blocks_wide) {
  ------------------
  |  Branch (809:25): [True: 1.42M, False: 1.42M]
  ------------------
  810|  1.42M|        int blk_row, blk_col;
  811|  1.42M|        const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.42M]
  |  |  ------------------
  ------------------
  812|  1.42M|        const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.42M]
  |  |  ------------------
  ------------------
  813|  2.97M|        for (blk_row = idy; blk_row < unit_height; blk_row += bh) {
  ------------------
  |  Branch (813:29): [True: 1.55M, False: 1.42M]
  ------------------
  814|  3.32M|          for (blk_col = idx; blk_col < unit_width; blk_col += bw) {
  ------------------
  |  Branch (814:31): [True: 1.77M, False: 1.55M]
  ------------------
  815|  1.77M|            encode_block_inter(plane, block, blk_row, blk_col, plane_bsize,
  816|  1.77M|                               max_tx_size, &arg, dry_run);
  817|  1.77M|            block += step;
  818|  1.77M|          }
  819|  1.55M|        }
  820|  1.42M|      }
  821|  1.42M|    }
  822|  1.42M|  }
  823|   939k|}
av1_encode_intra_block_plane:
  927|  11.0M|                                  TRELLIS_OPT_TYPE enable_optimize_b) {
  928|  11.0M|  assert(bsize < BLOCK_SIZES_ALL);
  929|  11.0M|  const MACROBLOCKD *const xd = &x->e_mbd;
  930|  11.0M|  if (plane && !xd->is_chroma_ref) return;
  ------------------
  |  Branch (930:7): [True: 4.90M, False: 6.16M]
  |  Branch (930:16): [True: 329k, False: 4.57M]
  ------------------
  931|       |
  932|  10.7M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  933|  10.7M|  const int ss_x = pd->subsampling_x;
  934|  10.7M|  const int ss_y = pd->subsampling_y;
  935|  10.7M|  ENTROPY_CONTEXT ta[MAX_MIB_SIZE] = { 0 };
  936|  10.7M|  ENTROPY_CONTEXT tl[MAX_MIB_SIZE] = { 0 };
  937|  10.7M|  struct encode_b_args arg = {
  938|  10.7M|    cpi, x, NULL, ta, tl, dry_run, enable_optimize_b
  939|  10.7M|  };
  940|  10.7M|  const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
  941|  10.7M|  if (enable_optimize_b) {
  ------------------
  |  Branch (941:7): [True: 10.1M, False: 640k]
  ------------------
  942|  10.1M|    av1_get_entropy_contexts(plane_bsize, pd, ta, tl);
  943|  10.1M|  }
  944|  10.7M|  av1_foreach_transformed_block_in_plane(
  945|  10.7M|      xd, plane_bsize, plane, encode_block_intra_and_set_context, &arg);
  946|  10.7M|}
encodemb.c:fill_residue_outside_frame:
   81|  2.76M|    int visible_tx_cols, int visible_tx_rows, TX_TYPE tx_type) {
   82|  2.76M|  const int complete_block_outside =
   83|  2.76M|      (visible_tx_cols == 0 || visible_tx_rows == 0);
  ------------------
  |  Branch (83:8): [True: 171k, False: 2.59M]
  |  Branch (83:32): [True: 184k, False: 2.40M]
  ------------------
   84|       |
   85|  2.76M|  if (tx_type <= IDTX) {
  ------------------
  |  Branch (85:7): [True: 2.61M, False: 153k]
  ------------------
   86|  2.61M|    int16_t avg = 0;
   87|  2.61M|    if (tx_type != IDTX && !complete_block_outside)
  ------------------
  |  Branch (87:9): [True: 2.58M, False: 20.7k]
  |  Branch (87:28): [True: 2.23M, False: 355k]
  ------------------
   88|  2.23M|      avg =
   89|  2.23M|          avg_wxh_block_c(diff, diff_stride, visible_tx_cols, visible_tx_rows);
   90|       |
   91|       |    // Fill the remaining parts of the block with the average value
   92|  2.61M|    const int right_pixels = tx_cols - visible_tx_cols;
   93|  24.2M|    for (int i = 0; i < tx_rows; ++i) {
  ------------------
  |  Branch (93:21): [True: 21.6M, False: 2.61M]
  ------------------
   94|  21.6M|      aom_memset16(diff + i * diff_stride + visible_tx_cols, avg, right_pixels);
   95|  21.6M|    }
   96|       |
   97|  9.19M|    for (int i = visible_tx_rows; i < tx_rows; ++i) {
  ------------------
  |  Branch (97:35): [True: 6.58M, False: 2.61M]
  ------------------
   98|  6.58M|      aom_memset16(diff + i * diff_stride, avg, visible_tx_cols);
   99|  6.58M|    }
  100|  2.61M|  } else if (htx_tab[tx_type] == IDTX_1D) {
  ------------------
  |  Branch (100:14): [True: 63.6k, False: 89.5k]
  ------------------
  101|  63.6k|    if (visible_tx_rows < tx_rows) {
  ------------------
  |  Branch (101:9): [True: 36.2k, False: 27.3k]
  ------------------
  102|  36.2k|      int16_t out[64] = { 0 };
  103|  36.2k|      if (!complete_block_outside)
  ------------------
  |  Branch (103:11): [True: 36.2k, False: 4]
  ------------------
  104|  36.2k|        avg_wxh_block_vert_c(diff, diff_stride, visible_tx_cols,
  105|  36.2k|                             visible_tx_rows, out);
  106|       |
  107|   308k|      for (int j = 0; j < visible_tx_cols; j++) {
  ------------------
  |  Branch (107:23): [True: 271k, False: 36.2k]
  ------------------
  108|  1.53M|        for (int i = visible_tx_rows; i < tx_rows; ++i) {
  ------------------
  |  Branch (108:39): [True: 1.26M, False: 271k]
  ------------------
  109|  1.26M|          *(diff + i * diff_stride + j) = out[j];
  110|  1.26M|        }
  111|   271k|      }
  112|  36.2k|    }
  113|       |
  114|  63.6k|    const int right_pixels = tx_cols - visible_tx_cols;
  115|  63.6k|    if (right_pixels) {
  ------------------
  |  Branch (115:9): [True: 34.5k, False: 29.0k]
  ------------------
  116|   273k|      for (int i = 0; i < tx_rows; ++i) {
  ------------------
  |  Branch (116:23): [True: 238k, False: 34.5k]
  ------------------
  117|   238k|        memset(diff + i * diff_stride + visible_tx_cols, 0,
  118|   238k|               right_pixels * sizeof(*diff));
  119|   238k|      }
  120|  34.5k|    }
  121|  89.5k|  } else {
  122|  89.5k|    assert(vtx_tab[tx_type] == IDTX_1D);
  123|       |
  124|  89.5k|    const int right_pixels = tx_cols - visible_tx_cols;
  125|  89.5k|    if (right_pixels) {
  ------------------
  |  Branch (125:9): [True: 49.1k, False: 40.3k]
  ------------------
  126|  49.1k|      int16_t out[64] = { 0 };
  127|  49.1k|      if (!complete_block_outside)
  ------------------
  |  Branch (127:11): [True: 49.1k, False: 0]
  ------------------
  128|  49.1k|        avg_wxh_block_horiz_c(diff, diff_stride, visible_tx_cols,
  129|  49.1k|                              visible_tx_rows, out);
  130|       |
  131|   413k|      for (int i = 0; i < visible_tx_rows; ++i) {
  ------------------
  |  Branch (131:23): [True: 364k, False: 49.1k]
  ------------------
  132|   364k|        aom_memset16(diff + i * diff_stride + visible_tx_cols, out[i],
  133|   364k|                     right_pixels);
  134|   364k|      }
  135|  49.1k|    }
  136|       |
  137|   246k|    for (int i = visible_tx_rows; i < tx_rows; ++i) {
  ------------------
  |  Branch (137:35): [True: 157k, False: 89.5k]
  ------------------
  138|   157k|      memset(diff + i * diff_stride, 0, tx_cols * sizeof(*diff));
  139|   157k|    }
  140|  89.5k|  }
  141|  2.76M|}
encodemb.c:avg_wxh_block_c:
   40|  2.23M|                                      int w, int h) {
   41|  2.23M|  assert(w > 0 && h > 0);
   42|  2.23M|  int32_t sum = 0;
   43|  16.4M|  for (int row = 0; row < h; ++row) {
  ------------------
  |  Branch (43:21): [True: 14.2M, False: 2.23M]
  ------------------
   44|   123M|    for (int col = 0; col < w; ++col) {
  ------------------
  |  Branch (44:23): [True: 109M, False: 14.2M]
  ------------------
   45|   109M|      sum += diff[row * diff_stride + col];
   46|   109M|    }
   47|  14.2M|  }
   48|  2.23M|  return (int16_t)DIVIDE_AND_ROUND_SIGNED(sum, w * h);
  ------------------
  |  |   77|  2.23M|  (((n) < 0) ? (((n) - (d) / 2) / (d)) : (((n) + (d) / 2) / (d)))
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 1.23M, False: 999k]
  |  |  ------------------
  ------------------
   49|  2.23M|}
encodemb.c:avg_wxh_block_vert_c:
   66|  36.2k|                                        int w, int h, int16_t *out) {
   67|  36.2k|  assert(w > 0 && h > 0);
   68|   307k|  for (int col = 0; col < w; ++col) {
  ------------------
  |  Branch (68:21): [True: 271k, False: 36.2k]
  ------------------
   69|   271k|    int32_t sum = 0;
   70|  1.24M|    for (int row = 0; row < h; ++row) {
  ------------------
  |  Branch (70:23): [True: 969k, False: 271k]
  ------------------
   71|   969k|      sum += diff[row * diff_stride + col];
   72|   969k|    }
   73|   271k|    out[col] = (int16_t)DIVIDE_AND_ROUND_SIGNED(sum, h);
  ------------------
  |  |   77|   271k|  (((n) < 0) ? (((n) - (d) / 2) / (d)) : (((n) + (d) / 2) / (d)))
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 148k, False: 122k]
  |  |  ------------------
  ------------------
   74|   271k|  }
   75|  36.2k|}
encodemb.c:avg_wxh_block_horiz_c:
   53|  49.1k|                                         int w, int h, int16_t *out) {
   54|  49.1k|  assert(w > 0 && h > 0);
   55|   413k|  for (int row = 0; row < h; ++row) {
  ------------------
  |  Branch (55:21): [True: 364k, False: 49.1k]
  ------------------
   56|   364k|    int32_t sum = 0;
   57|  1.68M|    for (int col = 0; col < w; ++col) {
  ------------------
  |  Branch (57:23): [True: 1.32M, False: 364k]
  ------------------
   58|  1.32M|      sum += diff[row * diff_stride + col];
   59|  1.32M|    }
   60|   364k|    out[row] = (int16_t)DIVIDE_AND_ROUND_SIGNED(sum, w);
  ------------------
  |  |   77|   364k|  (((n) < 0) ? (((n) - (d) / 2) / (d)) : (((n) + (d) / 2) / (d)))
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 186k, False: 177k]
  |  |  ------------------
  ------------------
   61|   364k|  }
   62|  49.1k|}
encodemb.c:encode_block_inter:
  608|  2.29M|                               void *arg, RUN_TYPE dry_run) {
  609|  2.29M|  struct encode_b_args *const args = arg;
  610|  2.29M|  MACROBLOCK *const x = args->x;
  611|  2.29M|  MACROBLOCKD *const xd = &x->e_mbd;
  612|  2.29M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  613|  2.29M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  614|  2.29M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  615|  2.29M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  616|       |
  617|  2.29M|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (617:7): [True: 3.58k, False: 2.28M]
  |  Branch (617:37): [True: 2.45k, False: 2.28M]
  ------------------
  618|       |
  619|  2.28M|  const TX_SIZE plane_tx_size =
  620|  2.28M|      plane ? av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
  ------------------
  |  Branch (620:7): [True: 544k, False: 1.74M]
  ------------------
  621|   544k|                                    pd->subsampling_y)
  622|  2.28M|            : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,
  623|  1.74M|                                                         blk_col)];
  624|  2.28M|  if (!plane) {
  ------------------
  |  Branch (624:7): [True: 1.74M, False: 544k]
  ------------------
  625|  1.74M|    assert(tx_size_wide[tx_size] >= tx_size_wide[plane_tx_size] &&
  626|  1.74M|           tx_size_high[tx_size] >= tx_size_high[plane_tx_size]);
  627|  1.74M|  }
  628|       |
  629|  2.28M|  if (tx_size == plane_tx_size || plane) {
  ------------------
  |  Branch (629:7): [True: 2.05M, False: 227k]
  |  Branch (629:35): [True: 86.5k, False: 141k]
  ------------------
  630|  2.14M|    encode_block(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg,
  631|  2.14M|                 dry_run);
  632|  2.14M|  } else {
  633|   141k|    assert(tx_size < TX_SIZES_ALL);
  634|   141k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  635|   141k|    assert(IMPLIES(tx_size <= TX_4X4, sub_txs == tx_size));
  636|   141k|    assert(IMPLIES(tx_size > TX_4X4, sub_txs < tx_size));
  637|       |    // This is the square transform block partition entry point.
  638|   141k|    const int bsw = tx_size_wide_unit[sub_txs];
  639|   141k|    const int bsh = tx_size_high_unit[sub_txs];
  640|   141k|    const int step = bsh * bsw;
  641|   141k|    const int row_end =
  642|   141k|        AOMMIN(tx_size_high_unit[tx_size], max_blocks_high - blk_row);
  ------------------
  |  |   34|   141k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.0k, False: 126k]
  |  |  ------------------
  ------------------
  643|   141k|    const int col_end =
  644|   141k|        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
  ------------------
  |  |   34|   141k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.2k, False: 126k]
  |  |  ------------------
  ------------------
  645|   141k|    assert(bsw > 0 && bsh > 0);
  646|       |
  647|   411k|    for (int row = 0; row < row_end; row += bsh) {
  ------------------
  |  Branch (647:23): [True: 269k, False: 141k]
  ------------------
  648|   269k|      const int offsetr = blk_row + row;
  649|   785k|      for (int col = 0; col < col_end; col += bsw) {
  ------------------
  |  Branch (649:25): [True: 516k, False: 269k]
  ------------------
  650|   516k|        const int offsetc = blk_col + col;
  651|       |
  652|   516k|        encode_block_inter(plane, block, offsetr, offsetc, plane_bsize, sub_txs,
  653|   516k|                           arg, dry_run);
  654|   516k|        block += step;
  655|   516k|      }
  656|   269k|    }
  657|   141k|  }
  658|  2.28M|}
encodemb.c:encode_block:
  501|  2.14M|                         RUN_TYPE dry_run) {
  502|  2.14M|  (void)dry_run;
  503|  2.14M|  struct encode_b_args *const args = arg;
  504|  2.14M|  const AV1_COMP *const cpi = args->cpi;
  505|  2.14M|  const AV1_COMMON *const cm = &cpi->common;
  506|  2.14M|  MACROBLOCK *const x = args->x;
  507|  2.14M|  MACROBLOCKD *const xd = &x->e_mbd;
  508|  2.14M|  MB_MODE_INFO *mbmi = xd->mi[0];
  509|  2.14M|  struct macroblock_plane *const p = &x->plane[plane];
  510|  2.14M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  511|  2.14M|  tran_low_t *const dqcoeff = p->dqcoeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  2.14M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  512|  2.14M|  uint8_t *dst;
  513|  2.14M|  ENTROPY_CONTEXT *a, *l;
  514|  2.14M|  int dummy_rate_cost = 0;
  515|       |
  516|  2.14M|  dst = &pd->dst.buf[(blk_row * pd->dst.stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  2.14M|#define MI_SIZE_LOG2 2
  ------------------
  517|       |
  518|  2.14M|  a = &args->ta[blk_col];
  519|  2.14M|  l = &args->tl[blk_row];
  520|       |
  521|  2.14M|  TX_TYPE tx_type = DCT_DCT;
  522|  2.14M|  if (!mbmi->skip_mode) {
  ------------------
  |  Branch (522:7): [True: 2.14M, False: 18.4E]
  ------------------
  523|  2.14M|    tx_type = av1_get_tx_type(xd, pd->plane_type, blk_row, blk_col, tx_size,
  524|  2.14M|                              cm->features.reduced_tx_set_used);
  525|       |
  526|  2.14M|    av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size, tx_type,
  527|  2.14M|                     cpi->do_border_pad);
  528|  2.14M|    TxfmParam txfm_param;
  529|  2.14M|    QUANT_PARAM quant_param;
  530|  2.14M|    const int use_trellis = is_trellis_used(args->enable_optimize_b, dry_run);
  531|  2.14M|    int quant_idx;
  532|  2.14M|    if (use_trellis)
  ------------------
  |  Branch (532:9): [True: 677k, False: 1.46M]
  ------------------
  533|   677k|      quant_idx = AV1_XFORM_QUANT_FP;
  534|  1.46M|    else
  535|  1.46M|      quant_idx =
  536|  1.46M|          USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B : AV1_XFORM_QUANT_FP;
  ------------------
  |  |   34|  1.46M|#define USE_B_QUANT_NO_TRELLIS 1
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 1.46M, Folded]
  |  |  ------------------
  ------------------
  537|  2.14M|    av1_setup_xform(cm, x, tx_size, tx_type, &txfm_param);
  538|  2.14M|    av1_setup_quant(tx_size, use_trellis, quant_idx,
  539|  2.14M|                    cpi->oxcf.q_cfg.quant_b_adapt, &quant_param);
  540|  2.14M|    av1_setup_qmatrix(&cm->quant_params, xd, plane, tx_size, tx_type,
  541|  2.14M|                      &quant_param);
  542|  2.14M|    av1_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, &txfm_param,
  543|  2.14M|                    &quant_param);
  544|  2.14M|    if (use_trellis) {
  ------------------
  |  Branch (544:9): [True: 677k, False: 1.46M]
  ------------------
  545|   677k|      TXB_CTX txb_ctx;
  546|   677k|      get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx);
  547|   677k|      av1_optimize_b(args->cpi, x, plane, block, tx_size, tx_type, &txb_ctx,
  548|   677k|                     &dummy_rate_cost);
  549|   677k|    }
  550|  18.4E|  } else {
  551|  18.4E|    p->eobs[block] = 0;
  552|  18.4E|    p->txb_entropy_ctx[block] = 0;
  553|  18.4E|  }
  554|       |
  555|  2.14M|  av1_set_txb_context(x, plane, block, tx_size, a, l);
  556|       |
  557|  2.14M|  if (p->eobs[block]) {
  ------------------
  |  Branch (557:7): [True: 2.09M, False: 46.6k]
  ------------------
  558|       |    // As long as any YUV plane has non-zero quantized transform coefficients,
  559|       |    // mbmi->skip_txfm flag is set to 0.
  560|  2.09M|    mbmi->skip_txfm = 0;
  561|  2.09M|    av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst,
  562|  2.09M|                                pd->dst.stride, p->eobs[block],
  563|  2.09M|                                cm->features.reduced_tx_set_used);
  564|  2.09M|  } else {
  565|       |    // Only when YUV planes all have zero quantized transform coefficients,
  566|       |    // mbmi->skip_txfm flag is set to 1.
  567|  46.6k|    mbmi->skip_txfm &= 1;
  568|  46.6k|  }
  569|       |
  570|       |  // TODO(debargha, jingning): Temporarily disable txk_type check for eob=0
  571|       |  // case. It is possible that certain collision in hash index would cause
  572|       |  // the assertion failure. To further optimize the rate-distortion
  573|       |  // performance, we need to re-visit this part and enable this assert
  574|       |  // again.
  575|  2.14M|  if (p->eobs[block] == 0 && plane == 0) {
  ------------------
  |  Branch (575:7): [True: 48.3k, False: 2.09M]
  |  Branch (575:30): [True: 39.5k, False: 8.86k]
  ------------------
  576|       |#if 0
  577|       |    if (args->cpi->oxcf.q_cfg.aq_mode == NO_AQ &&
  578|       |        args->cpi->oxcf.q_cfg.deltaq_mode == NO_DELTA_Q) {
  579|       |      // TODO(jingning,angiebird,huisu@google.com): enable txk_check when
  580|       |      // enable_optimize_b is true to detect potential RD bug.
  581|       |      const uint8_t disable_txk_check = args->enable_optimize_b;
  582|       |      if (!disable_txk_check) {
  583|       |        assert(xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col)] ==
  584|       |            DCT_DCT);
  585|       |      }
  586|       |    }
  587|       |#endif
  588|  39.5k|    update_txk_array(xd, blk_row, blk_col, tx_size, DCT_DCT);
  589|  39.5k|  }
  590|       |
  591|       |#if CONFIG_MISMATCH_DEBUG
  592|       |  if (dry_run == OUTPUT_ENABLED) {
  593|       |    int pixel_c, pixel_r;
  594|       |    BLOCK_SIZE bsize = txsize_to_bsize[tx_size];
  595|       |    int blk_w = block_size_wide[bsize];
  596|       |    int blk_h = block_size_high[bsize];
  597|       |    mi_to_pixel_loc(&pixel_c, &pixel_r, xd->mi_col, xd->mi_row, blk_col,
  598|       |                    blk_row, pd->subsampling_x, pd->subsampling_y);
  599|       |    mismatch_record_block_tx(dst, pd->dst.stride, cm->current_frame.order_hint,
  600|       |                             plane, pixel_c, pixel_r, blk_w, blk_h,
  601|       |                             xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH);
  602|       |  }
  603|       |#endif
  604|  2.14M|}
encodemb.c:encode_block_intra_and_set_context:
  915|  15.0M|                                               TX_SIZE tx_size, void *arg) {
  916|  15.0M|  encode_block_intra(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg);
  917|       |
  918|  15.0M|  struct encode_b_args *const args = arg;
  919|  15.0M|  MACROBLOCK *x = args->x;
  920|  15.0M|  ENTROPY_CONTEXT *a = &args->ta[blk_col];
  921|  15.0M|  ENTROPY_CONTEXT *l = &args->tl[blk_row];
  922|  15.0M|  av1_set_txb_context(x, plane, block, tx_size, a, l);
  923|  15.0M|}
encodemb.c:encode_block_intra:
  827|  15.0M|                               void *arg) {
  828|  15.0M|  struct encode_b_args *const args = arg;
  829|  15.0M|  const AV1_COMP *const cpi = args->cpi;
  830|  15.0M|  const AV1_COMMON *const cm = &cpi->common;
  831|  15.0M|  MACROBLOCK *const x = args->x;
  832|  15.0M|  MACROBLOCKD *const xd = &x->e_mbd;
  833|  15.0M|  struct macroblock_plane *const p = &x->plane[plane];
  834|  15.0M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  835|  15.0M|  tran_low_t *dqcoeff = p->dqcoeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  15.0M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  836|  15.0M|  PLANE_TYPE plane_type = get_plane_type(plane);
  837|  15.0M|  uint16_t *eob = &p->eobs[block];
  838|  15.0M|  const int dst_stride = pd->dst.stride;
  839|  15.0M|  uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  15.0M|#define MI_SIZE_LOG2 2
  ------------------
  840|  15.0M|  int dummy_rate_cost = 0;
  841|       |
  842|  15.0M|  av1_predict_intra_block_facade(cm, xd, plane, blk_col, blk_row, tx_size);
  843|       |
  844|  15.0M|  TX_TYPE tx_type = DCT_DCT;
  845|  15.0M|  if (xd->mi[0]->skip_txfm) {
  ------------------
  |  Branch (845:7): [True: 0, False: 15.0M]
  ------------------
  846|      0|    *eob = 0;
  847|      0|    p->txb_entropy_ctx[block] = 0;
  848|  15.0M|  } else {
  849|  15.0M|    const ENTROPY_CONTEXT *a = &args->ta[blk_col];
  850|  15.0M|    const ENTROPY_CONTEXT *l = &args->tl[blk_row];
  851|  15.0M|    tx_type = av1_get_tx_type(xd, plane_type, blk_row, blk_col, tx_size,
  852|  15.0M|                              cm->features.reduced_tx_set_used);
  853|  15.0M|    TX_TYPE primary_tx_type = is_stat_generation_stage(cpi) ? DCT_DCT : tx_type;
  ------------------
  |  Branch (853:31): [True: 0, False: 15.0M]
  ------------------
  854|  15.0M|    av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size,
  855|  15.0M|                     primary_tx_type, cpi->do_border_pad);
  856|  15.0M|    TxfmParam txfm_param;
  857|  15.0M|    QUANT_PARAM quant_param;
  858|  15.0M|    const int use_trellis =
  859|  15.0M|        is_trellis_used(args->enable_optimize_b, args->dry_run);
  860|  15.0M|    int quant_idx;
  861|  15.0M|    if (use_trellis)
  ------------------
  |  Branch (861:9): [True: 13.9M, False: 1.19M]
  ------------------
  862|  13.9M|      quant_idx = AV1_XFORM_QUANT_FP;
  863|  1.19M|    else
  864|  1.19M|      quant_idx =
  865|  18.4E|          USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B : AV1_XFORM_QUANT_FP;
  ------------------
  |  |   34|  1.19M|#define USE_B_QUANT_NO_TRELLIS 1
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 1.20M, Folded]
  |  |  ------------------
  ------------------
  866|       |
  867|  15.0M|    av1_setup_xform(cm, x, tx_size, tx_type, &txfm_param);
  868|  15.0M|    av1_setup_quant(tx_size, use_trellis, quant_idx,
  869|  15.0M|                    cpi->oxcf.q_cfg.quant_b_adapt, &quant_param);
  870|  15.0M|    av1_setup_qmatrix(&cm->quant_params, xd, plane, tx_size, tx_type,
  871|  15.0M|                      &quant_param);
  872|       |
  873|  15.0M|    av1_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, &txfm_param,
  874|  15.0M|                    &quant_param);
  875|  15.0M|    if (use_trellis) {
  ------------------
  |  Branch (875:9): [True: 13.8M, False: 1.21M]
  ------------------
  876|  13.8M|      TXB_CTX txb_ctx;
  877|  13.8M|      get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx);
  878|  13.8M|      av1_optimize_b(args->cpi, x, plane, block, tx_size, tx_type, &txb_ctx,
  879|  13.8M|                     &dummy_rate_cost);
  880|  13.8M|    }
  881|  15.0M|  }
  882|       |
  883|  15.0M|  if (*eob) {
  ------------------
  |  Branch (883:7): [True: 13.8M, False: 1.22M]
  ------------------
  884|  13.8M|    av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst,
  885|  13.8M|                                dst_stride, *eob,
  886|  13.8M|                                cm->features.reduced_tx_set_used);
  887|  13.8M|  }
  888|       |
  889|       |  // TODO(jingning): Temporarily disable txk_type check for eob=0 case.
  890|       |  // It is possible that certain collision in hash index would cause
  891|       |  // the assertion failure. To further optimize the rate-distortion
  892|       |  // performance, we need to re-visit this part and enable this assert
  893|       |  // again.
  894|  15.0M|  if (*eob == 0 && plane == 0) {
  ------------------
  |  Branch (894:7): [True: 1.23M, False: 13.8M]
  |  Branch (894:20): [True: 786k, False: 446k]
  ------------------
  895|       |#if 0
  896|       |    if (args->cpi->oxcf.q_cfg.aq_mode == NO_AQ
  897|       |        && args->cpi->oxcf.q_cfg.deltaq_mode == NO_DELTA_Q) {
  898|       |      assert(xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col)] ==
  899|       |          DCT_DCT);
  900|       |    }
  901|       |#endif
  902|   786k|    update_txk_array(xd, blk_row, blk_col, tx_size, DCT_DCT);
  903|   786k|  }
  904|       |
  905|  15.0M|#if !CONFIG_REALTIME_ONLY
  906|  15.0M|  if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
  ------------------
  |  |  281|  30.1M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (906:7): [True: 10.4M, False: 4.67M]
  |  Branch (906:31): [True: 2.79M, False: 7.62M]
  ------------------
  907|  2.79M|    cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
  908|  2.79M|  }
  909|  15.0M|#endif
  910|  15.0M|}

encodemb.c:is_trellis_used:
  158|  17.2M|                                  RUN_TYPE dry_run) {
  159|  17.2M|  if (optimize_b == NO_TRELLIS_OPT) return false;
  ------------------
  |  Branch (159:7): [True: 2.66M, False: 14.5M]
  ------------------
  160|  14.5M|  if (optimize_b == FINAL_PASS_TRELLIS_OPT && dry_run != OUTPUT_ENABLED)
  ------------------
  |  Branch (160:7): [True: 0, False: 14.5M]
  |  Branch (160:47): [True: 0, False: 0]
  ------------------
  161|      0|    return false;
  162|  14.5M|  return true;
  163|  14.5M|}
encodemb.c:av1_set_txb_context:
  147|  17.2M|                                       ENTROPY_CONTEXT *l) {
  148|  17.2M|  const uint8_t ctx = x->plane[plane].txb_entropy_ctx[block];
  149|  17.2M|  memset(a, ctx, tx_size_wide_unit[tx_size] * sizeof(*a));
  150|  17.2M|  memset(l, ctx, tx_size_high_unit[tx_size] * sizeof(*l));
  151|  17.2M|}
tx_search.c:av1_set_txb_context:
  147|  65.0M|                                       ENTROPY_CONTEXT *l) {
  148|  65.0M|  const uint8_t ctx = x->plane[plane].txb_entropy_ctx[block];
  149|  65.0M|  memset(a, ctx, tx_size_wide_unit[tx_size] * sizeof(*a));
  150|  65.0M|  memset(l, ctx, tx_size_high_unit[tx_size] * sizeof(*l));
  151|  65.0M|}
tx_search.c:is_trellis_used:
  158|  65.3M|                                  RUN_TYPE dry_run) {
  159|  65.3M|  if (optimize_b == NO_TRELLIS_OPT) return false;
  ------------------
  |  Branch (159:7): [True: 4.52M, False: 60.8M]
  ------------------
  160|  60.8M|  if (optimize_b == FINAL_PASS_TRELLIS_OPT && dry_run != OUTPUT_ENABLED)
  ------------------
  |  Branch (160:7): [True: 0, False: 60.8M]
  |  Branch (160:47): [True: 0, False: 0]
  ------------------
  161|      0|    return false;
  162|  60.8M|  return true;
  163|  60.8M|}

av1_update_mv_stats:
   64|   276k|                         MvSubpelPrecision precision) {
   65|   276k|  const MV diff = { mv->row - ref->row, mv->col - ref->col };
   66|   276k|  const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
   67|       |
   68|   276k|  update_cdf(mvctx->joints_cdf, j, MV_JOINTS);
  ------------------
  |  |   32|   276k|#define MV_JOINTS 4
  ------------------
   69|       |
   70|   276k|  if (mv_joint_vertical(j))
  ------------------
  |  Branch (70:7): [True: 252k, False: 24.0k]
  ------------------
   71|   252k|    update_mv_component_stats(diff.row, &mvctx->comps[0], precision);
   72|       |
   73|   276k|  if (mv_joint_horizontal(j))
  ------------------
  |  Branch (73:7): [True: 251k, False: 24.8k]
  ------------------
   74|   251k|    update_mv_component_stats(diff.col, &mvctx->comps[1], precision);
   75|   276k|}
av1_build_nmv_component_cost_table:
  126|   334k|                                        MvSubpelPrecision precision) {
  127|   334k|  int i, j, v, o, mantissa;
  128|   334k|  int sign_cost[2], class_cost[MV_CLASSES], class0_cost[CLASS0_SIZE];
  129|   334k|  int bits_cost[MV_OFFSET_BITS][2];
  130|   334k|  int class0_fp_cost[CLASS0_SIZE][MV_FP_SIZE] = { 0 },
  131|   334k|      fp_cost[MV_FP_SIZE] = { 0 };
  132|   334k|  int class0_hp_cost[2] = { 0 }, hp_cost[2] = { 0 };
  133|       |
  134|   334k|  av1_cost_tokens_from_cdf(sign_cost, mvcomp->sign_cdf, NULL);
  135|   334k|  av1_cost_tokens_from_cdf(class_cost, mvcomp->classes_cdf, NULL);
  136|   334k|  av1_cost_tokens_from_cdf(class0_cost, mvcomp->class0_cdf, NULL);
  137|  3.68M|  for (i = 0; i < MV_OFFSET_BITS; ++i) {
  ------------------
  |  |   66|  3.68M|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|  3.68M|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|  3.68M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (137:15): [True: 3.34M, False: 334k]
  ------------------
  138|  3.34M|    av1_cost_tokens_from_cdf(bits_cost[i], mvcomp->bits_cdf[i], NULL);
  139|  3.34M|  }
  140|       |
  141|   334k|  if (precision > MV_SUBPEL_NONE) {
  ------------------
  |  Branch (141:7): [True: 326k, False: 8.69k]
  ------------------
  142|   978k|    for (i = 0; i < CLASS0_SIZE; ++i)
  ------------------
  |  |   65|   978k|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|   978k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (142:17): [True: 652k, False: 326k]
  ------------------
  143|   652k|      av1_cost_tokens_from_cdf(class0_fp_cost[i], mvcomp->class0_fp_cdf[i],
  144|   652k|                               NULL);
  145|   326k|    av1_cost_tokens_from_cdf(fp_cost, mvcomp->fp_cdf, NULL);
  146|   326k|  }
  147|       |
  148|   334k|  if (precision > MV_SUBPEL_LOW_PRECISION) {
  ------------------
  |  Branch (148:7): [True: 148k, False: 186k]
  ------------------
  149|   148k|    av1_cost_tokens_from_cdf(class0_hp_cost, mvcomp->class0_hp_cdf, NULL);
  150|   148k|    av1_cost_tokens_from_cdf(hp_cost, mvcomp->hp_cdf, NULL);
  151|   148k|  }
  152|       |
  153|       |  // Instead of accumulating the cost of each vector component's bits
  154|       |  //   individually, compute the costs based on smaller vectors. Costs for
  155|       |  //   [2^exp, 2 * 2^exp - 1] are calculated based on [0, 2^exp - 1]
  156|       |  //   respectively. Offsets are maintained to swap both 1) class costs when
  157|       |  //   treated as a complete vector component with the highest set bit when
  158|       |  //   treated as a mantissa (significand) and 2) leading zeros to account for
  159|       |  //   the current exponent.
  160|       |
  161|       |  // Cost offsets
  162|   334k|  int cost_swap[MV_OFFSET_BITS] = { 0 };
  163|       |  // Delta to convert positive vector to negative vector costs
  164|   334k|  int negate_sign = sign_cost[1] - sign_cost[0];
  165|       |
  166|       |  // Initialize with offsets to swap the class costs with the costs of the
  167|       |  //   highest set bit.
  168|  3.34M|  for (i = 1; i < MV_OFFSET_BITS; ++i) {
  ------------------
  |  |   66|  3.34M|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|  3.34M|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|  3.34M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (168:15): [True: 3.01M, False: 334k]
  ------------------
  169|  3.01M|    cost_swap[i] = bits_cost[i - 1][1];
  170|  3.01M|    if (i > CLASS0_BITS) cost_swap[i] -= class_cost[i - CLASS0_BITS];
  ------------------
  |  |   64|  3.01M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
                  if (i > CLASS0_BITS) cost_swap[i] -= class_cost[i - CLASS0_BITS];
  ------------------
  |  |   64|  2.67M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
  |  Branch (170:9): [True: 2.67M, False: 334k]
  ------------------
  171|  3.01M|  }
  172|       |
  173|       |  // Seed the fractional costs onto the output (overwritten latter).
  174|  1.67M|  for (o = 0; o < MV_FP_SIZE; ++o) {
  ------------------
  |  |   68|  1.67M|#define MV_FP_SIZE 4
  ------------------
  |  Branch (174:15): [True: 1.33M, False: 334k]
  ------------------
  175|  1.33M|    int hp;
  176|  4.01M|    for (hp = 0; hp < 2; ++hp) {
  ------------------
  |  Branch (176:18): [True: 2.67M, False: 1.33M]
  ------------------
  177|  2.67M|      v = 2 * o + hp + 1;
  178|  2.67M|      mvcost[v] = fp_cost[o] + hp_cost[hp] + sign_cost[0];
  179|  2.67M|    }
  180|  1.33M|  }
  181|       |
  182|   334k|  mvcost[0] = 0;
  183|       |  // Fill the costs for each exponent's vectors, using the costs set in the
  184|       |  //   previous exponents.
  185|  3.68M|  for (i = 0; i < MV_OFFSET_BITS; ++i) {
  ------------------
  |  |   66|  3.68M|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|  3.68M|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|  3.68M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (185:15): [True: 3.34M, False: 334k]
  ------------------
  186|  3.34M|    const int exponent = (2 * MV_FP_SIZE) << i;
  ------------------
  |  |   68|  3.34M|#define MV_FP_SIZE 4
  ------------------
  187|       |
  188|  3.34M|    int class = 0;
  189|  3.34M|    if (i >= CLASS0_BITS) {
  ------------------
  |  |   64|  3.34M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
  |  Branch (189:9): [True: 3.01M, False: 334k]
  ------------------
  190|  3.01M|      class = class_cost[i - CLASS0_BITS + 1];
  ------------------
  |  |   64|  3.01M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
  191|  3.01M|    }
  192|       |
  193|       |    // Iterate through mantissas, keeping track of the location
  194|       |    //   of the highest set bit for the mantissa.
  195|       |    // To be clear: in the outer loop, the position of the highest set bit
  196|       |    //   (exponent) is tracked and, in this loop, the highest set bit of the
  197|       |    //   mantissa is tracked.
  198|  3.34M|    mantissa = 0;
  199|  21.6M|    for (j = 0; j <= i; ++j) {
  ------------------
  |  Branch (199:17): [True: 18.3M, False: 3.34M]
  ------------------
  200|  2.65G|      for (; mantissa < (2 * MV_FP_SIZE) << j; ++mantissa) {
  ------------------
  |  |   68|  2.65G|#define MV_FP_SIZE 4
  ------------------
  |  Branch (200:14): [True: 2.63G, False: 18.3M]
  ------------------
  201|  2.63G|        int cost = mvcost[mantissa + 1] + class + cost_swap[j];
  202|  2.63G|        v = exponent + mantissa + 1;
  203|  2.63G|        mvcost[v] = cost;
  204|  2.63G|        mvcost[-v] = cost + negate_sign;
  205|  2.63G|      }
  206|  18.3M|      cost_swap[j] += bits_cost[i][0];
  207|  18.3M|    }
  208|  3.34M|  }
  209|       |
  210|       |  // Special case to avoid buffer overrun
  211|   334k|  {
  212|   334k|    int exponent = (2 * MV_FP_SIZE) << MV_OFFSET_BITS;
  ------------------
  |  |   68|   334k|#define MV_FP_SIZE 4
  ------------------
                  int exponent = (2 * MV_FP_SIZE) << MV_OFFSET_BITS;
  ------------------
  |  |   66|   334k|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|   334k|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|   334k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  213|   334k|    int class = class_cost[MV_CLASSES - 1];
  ------------------
  |  |   49|   334k|#define MV_CLASSES 11
  ------------------
  214|   334k|    mantissa = 0;
  215|  3.68M|    for (j = 0; j < MV_OFFSET_BITS; ++j) {
  ------------------
  |  |   66|  3.68M|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|  3.68M|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|  3.68M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (215:17): [True: 3.34M, False: 334k]
  ------------------
  216|  1.34G|      for (; mantissa < (2 * MV_FP_SIZE) << j; ++mantissa) {
  ------------------
  |  |   68|  1.34G|#define MV_FP_SIZE 4
  ------------------
  |  Branch (216:14): [True: 1.33G, False: 3.34M]
  ------------------
  217|  1.33G|        int cost = mvcost[mantissa + 1] + class + cost_swap[j];
  218|  1.33G|        v = exponent + mantissa + 1;
  219|  1.33G|        mvcost[v] = cost;
  220|  1.33G|        mvcost[-v] = cost + negate_sign;
  221|  1.33G|      }
  222|  3.34M|    }
  223|       |    // At this point: mantissa = exponent >> 1
  224|       |
  225|       |    // Manually calculate the final cost offset
  226|   334k|    int cost_swap_hi =
  227|   334k|        bits_cost[MV_OFFSET_BITS - 1][1] - class_cost[MV_CLASSES - 2];
  ------------------
  |  |   66|   334k|#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   49|   334k|#define MV_CLASSES 11
  |  |  ------------------
  |  |               #define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
  |  |  ------------------
  |  |  |  |   64|   334k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
                      bits_cost[MV_OFFSET_BITS - 1][1] - class_cost[MV_CLASSES - 2];
  ------------------
  |  |   49|   334k|#define MV_CLASSES 11
  ------------------
  228|  1.34G|    for (; mantissa < exponent - 1; ++mantissa) {
  ------------------
  |  Branch (228:12): [True: 1.34G, False: 334k]
  ------------------
  229|  1.34G|      int cost = mvcost[mantissa + 1] + class + cost_swap_hi;
  230|  1.34G|      v = exponent + mantissa + 1;
  231|  1.34G|      mvcost[v] = cost;
  232|  1.34G|      mvcost[-v] = cost + negate_sign;
  233|  1.34G|    }
  234|   334k|  }
  235|       |
  236|       |  // Fill costs for class0 vectors, overwriting previous placeholder values
  237|       |  //   used for calculating the costs of the larger vectors.
  238|  1.00M|  for (i = 0; i < CLASS0_SIZE; ++i) {
  ------------------
  |  |   65|  1.00M|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|  1.00M|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (238:15): [True: 670k, False: 334k]
  ------------------
  239|   670k|    const int top = i * 2 * MV_FP_SIZE;
  ------------------
  |  |   68|   670k|#define MV_FP_SIZE 4
  ------------------
  240|  3.35M|    for (o = 0; o < MV_FP_SIZE; ++o) {
  ------------------
  |  |   68|  3.35M|#define MV_FP_SIZE 4
  ------------------
  |  Branch (240:17): [True: 2.68M, False: 670k]
  ------------------
  241|  2.68M|      int hp;
  242|  2.68M|      int cost = class0_fp_cost[i][o] + class_cost[0] + class0_cost[i];
  243|  8.04M|      for (hp = 0; hp < 2; ++hp) {
  ------------------
  |  Branch (243:20): [True: 5.36M, False: 2.68M]
  ------------------
  244|  5.36M|        v = top + 2 * o + hp + 1;
  245|  5.36M|        mvcost[v] = cost + class0_hp_cost[hp] + sign_cost[0];
  246|  5.36M|        mvcost[-v] = cost + class0_hp_cost[hp] + sign_cost[1];
  247|  5.36M|      }
  248|  2.68M|    }
  249|   670k|  }
  250|   334k|}
av1_encode_mv:
  253|   276k|                   const MV *ref, nmv_context *mvctx, int usehp) {
  254|   276k|  const MV diff = { mv->row - ref->row, mv->col - ref->col };
  255|   276k|  const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
  256|       |  // If the mv_diff is zero, then we should have used near or nearest instead.
  257|   276k|  assert(j != MV_JOINT_ZERO);
  258|   276k|  if (cpi->common.features.cur_frame_force_integer_mv) {
  ------------------
  |  Branch (258:7): [True: 0, False: 276k]
  ------------------
  259|      0|    usehp = MV_SUBPEL_NONE;
  260|      0|  }
  261|   276k|  aom_write_symbol(w, j, mvctx->joints_cdf, MV_JOINTS);
  ------------------
  |  |   32|   276k|#define MV_JOINTS 4
  ------------------
  262|   276k|  if (mv_joint_vertical(j))
  ------------------
  |  Branch (262:7): [True: 252k, False: 24.2k]
  ------------------
  263|   252k|    encode_mv_component(w, diff.row, &mvctx->comps[0], usehp);
  264|       |
  265|   276k|  if (mv_joint_horizontal(j))
  ------------------
  |  Branch (265:7): [True: 251k, False: 25.1k]
  ------------------
  266|   251k|    encode_mv_component(w, diff.col, &mvctx->comps[1], usehp);
  267|       |
  268|       |  // If auto_mv_step_size is enabled then keep track of the largest
  269|       |  // motion vector component used.
  270|   276k|  if (cpi->sf.mv_sf.auto_mv_step_size) {
  ------------------
  |  Branch (270:7): [True: 276k, False: 36]
  ------------------
  271|   276k|    int maxv = AOMMAX(abs(mv->row), abs(mv->col)) >> 3;
  ------------------
  |  |   35|   276k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 133k, False: 142k]
  |  |  ------------------
  ------------------
  272|   276k|    td->max_mv_magnitude = AOMMAX(maxv, td->max_mv_magnitude);
  ------------------
  |  |   35|   276k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 71.4k, False: 205k]
  |  |  ------------------
  ------------------
  273|   276k|  }
  274|   276k|}
av1_build_nmv_cost_table:
  296|   167k|                              MvSubpelPrecision precision) {
  297|       |  av1_cost_tokens_from_cdf(mvjoint, ctx->joints_cdf, NULL);
  298|   167k|  av1_build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], precision);
  299|   167k|  av1_build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], precision);
  300|   167k|}
av1_get_ref_mv_from_stack:
  305|  12.4M|                                 const MB_MODE_INFO_EXT *mbmi_ext) {
  306|  12.4M|  const int8_t ref_frame_type = av1_ref_frame_type(ref_frame);
  307|  12.4M|  const CANDIDATE_MV *curr_ref_mv_stack =
  308|  12.4M|      mbmi_ext->ref_mv_stack[ref_frame_type];
  309|       |
  310|  12.4M|  if (ref_frame[1] > INTRA_FRAME) {
  ------------------
  |  Branch (310:7): [True: 0, False: 12.4M]
  ------------------
  311|      0|    assert(ref_idx == 0 || ref_idx == 1);
  312|      0|    return ref_idx ? curr_ref_mv_stack[ref_mv_idx].comp_mv
  ------------------
  |  Branch (312:12): [True: 0, False: 0]
  ------------------
  313|      0|                   : curr_ref_mv_stack[ref_mv_idx].this_mv;
  314|      0|  }
  315|       |
  316|  12.4M|  assert(ref_idx == 0);
  317|  12.4M|  return ref_mv_idx < mbmi_ext->ref_mv_count[ref_frame_type]
  ------------------
  |  Branch (317:10): [True: 5.08M, False: 7.35M]
  ------------------
  318|  12.4M|             ? curr_ref_mv_stack[ref_mv_idx].this_mv
  319|  12.4M|             : mbmi_ext->global_mvs[ref_frame_type];
  320|  12.4M|}
av1_get_ref_mv:
  322|  6.54M|int_mv av1_get_ref_mv(const MACROBLOCK *x, int ref_idx) {
  323|  6.54M|  const MACROBLOCKD *xd = &x->e_mbd;
  324|  6.54M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  325|  6.54M|  int ref_mv_idx = mbmi->ref_mv_idx;
  326|  6.54M|  if (mbmi->mode == NEAR_NEWMV || mbmi->mode == NEW_NEARMV) {
  ------------------
  |  Branch (326:7): [True: 18.4E, False: 6.54M]
  |  Branch (326:35): [True: 18.4E, False: 6.54M]
  ------------------
  327|       |    assert(has_second_ref(mbmi));
  328|      0|    ref_mv_idx += 1;
  329|      0|  }
  330|  6.54M|  return av1_get_ref_mv_from_stack(ref_idx, mbmi->ref_frame, ref_mv_idx,
  331|  6.54M|                                   &x->mbmi_ext);
  332|  6.54M|}
av1_find_best_ref_mvs_from_stack:
  338|   671k|                                      int is_integer) {
  339|   671k|  const int ref_idx = 0;
  340|   671k|  MV_REFERENCE_FRAME ref_frames[2] = { ref_frame, NONE_FRAME };
  341|   671k|  *nearest_mv = av1_get_ref_mv_from_stack(ref_idx, ref_frames, 0, mbmi_ext);
  342|   671k|  lower_mv_precision(&nearest_mv->as_mv, allow_hp, is_integer);
  343|   671k|  *near_mv = av1_get_ref_mv_from_stack(ref_idx, ref_frames, 1, mbmi_ext);
  344|   671k|  lower_mv_precision(&near_mv->as_mv, allow_hp, is_integer);
  345|   671k|}
encodemv.c:update_mv_component_stats:
   24|   503k|                                      MvSubpelPrecision precision) {
   25|   503k|  assert(comp != 0);
   26|   503k|  int offset;
   27|   503k|  const int sign = comp < 0;
   28|   503k|  const int mag = sign ? -comp : comp;
  ------------------
  |  Branch (28:19): [True: 250k, False: 252k]
  ------------------
   29|   503k|  const int mv_class = av1_get_mv_class(mag - 1, &offset);
   30|   503k|  const int d = offset >> 3;         // int mv data
   31|   503k|  const int fr = (offset >> 1) & 3;  // fractional mv data
   32|   503k|  const int hp = offset & 1;         // high precision mv data
   33|       |
   34|       |  // Sign
   35|   503k|  update_cdf(mvcomp->sign_cdf, sign, 2);
   36|       |
   37|       |  // Class
   38|   503k|  update_cdf(mvcomp->classes_cdf, mv_class, MV_CLASSES);
  ------------------
  |  |   49|   503k|#define MV_CLASSES 11
  ------------------
   39|       |
   40|       |  // Integer bits
   41|   503k|  if (mv_class == MV_CLASS_0) {
  ------------------
  |  Branch (41:7): [True: 313k, False: 189k]
  ------------------
   42|   313k|    update_cdf(mvcomp->class0_cdf, d, CLASS0_SIZE);
  ------------------
  |  |   65|   313k|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|   313k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
   43|   313k|  } else {
   44|   189k|    const int n = mv_class + CLASS0_BITS - 1;  // number of bits
  ------------------
  |  |   64|   189k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
   45|   542k|    for (int i = 0; i < n; ++i)
  ------------------
  |  Branch (45:21): [True: 352k, False: 189k]
  ------------------
   46|   352k|      update_cdf(mvcomp->bits_cdf[i], (d >> i) & 1, 2);
   47|   189k|  }
   48|       |  // Fractional bits
   49|   503k|  if (precision > MV_SUBPEL_NONE) {
  ------------------
  |  Branch (49:7): [True: 503k, False: 18.4E]
  ------------------
   50|   503k|    aom_cdf_prob *fp_cdf =
   51|   503k|        mv_class == MV_CLASS_0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf;
  ------------------
  |  Branch (51:9): [True: 313k, False: 190k]
  ------------------
   52|   503k|    update_cdf(fp_cdf, fr, MV_FP_SIZE);
  ------------------
  |  |   68|   503k|#define MV_FP_SIZE 4
  ------------------
   53|   503k|  }
   54|       |
   55|       |  // High precision bit
   56|   503k|  if (precision > MV_SUBPEL_LOW_PRECISION) {
  ------------------
  |  Branch (56:7): [True: 308k, False: 194k]
  ------------------
   57|   308k|    aom_cdf_prob *hp_cdf =
   58|   308k|        mv_class == MV_CLASS_0 ? mvcomp->class0_hp_cdf : mvcomp->hp_cdf;
  ------------------
  |  Branch (58:9): [True: 191k, False: 117k]
  ------------------
   59|   308k|    update_cdf(hp_cdf, hp, 2);
   60|   308k|  }
   61|   503k|}
encodemv.c:encode_mv_component:
   78|   503k|                                MvSubpelPrecision precision) {
   79|   503k|  assert(comp != 0);
   80|   503k|  int offset;
   81|   503k|  const int sign = comp < 0;
   82|   503k|  const int mag = sign ? -comp : comp;
  ------------------
  |  Branch (82:19): [True: 250k, False: 252k]
  ------------------
   83|   503k|  const int mv_class = av1_get_mv_class(mag - 1, &offset);
   84|   503k|  const int d = offset >> 3;         // int mv data
   85|   503k|  const int fr = (offset >> 1) & 3;  // fractional mv data
   86|   503k|  const int hp = offset & 1;         // high precision mv data
   87|       |
   88|       |  // Sign
   89|   503k|  aom_write_symbol(w, sign, mvcomp->sign_cdf, 2);
   90|       |
   91|       |  // Class
   92|   503k|  aom_write_symbol(w, mv_class, mvcomp->classes_cdf, MV_CLASSES);
  ------------------
  |  |   49|   503k|#define MV_CLASSES 11
  ------------------
   93|       |
   94|       |  // Integer bits
   95|   503k|  if (mv_class == MV_CLASS_0) {
  ------------------
  |  Branch (95:7): [True: 313k, False: 189k]
  ------------------
   96|   313k|    aom_write_symbol(w, d, mvcomp->class0_cdf, CLASS0_SIZE);
  ------------------
  |  |   65|   313k|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|   313k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
   97|   313k|  } else {
   98|   189k|    int i;
   99|   189k|    const int n = mv_class + CLASS0_BITS - 1;  // number of bits
  ------------------
  |  |   64|   189k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  ------------------
  100|   541k|    for (i = 0; i < n; ++i)
  ------------------
  |  Branch (100:17): [True: 352k, False: 189k]
  ------------------
  101|   352k|      aom_write_symbol(w, (d >> i) & 1, mvcomp->bits_cdf[i], 2);
  102|   189k|  }
  103|       |  // Fractional bits
  104|   503k|  if (precision > MV_SUBPEL_NONE) {
  ------------------
  |  Branch (104:7): [True: 503k, False: 18.4E]
  ------------------
  105|   503k|    aom_write_symbol(
  106|   503k|        w, fr,
  107|   503k|        mv_class == MV_CLASS_0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf,
  ------------------
  |  Branch (107:9): [True: 313k, False: 189k]
  ------------------
  108|   503k|        MV_FP_SIZE);
  ------------------
  |  |   68|   503k|#define MV_FP_SIZE 4
  ------------------
  109|   503k|  }
  110|       |
  111|       |  // High precision bit
  112|   503k|  if (precision > MV_SUBPEL_LOW_PRECISION)
  ------------------
  |  Branch (112:7): [True: 308k, False: 194k]
  ------------------
  113|   308k|    aom_write_symbol(
  114|   308k|        w, hp, mv_class == MV_CLASS_0 ? mvcomp->class0_hp_cdf : mvcomp->hp_cdf,
  ------------------
  |  Branch (114:16): [True: 191k, False: 116k]
  ------------------
  115|   308k|        2);
  116|   503k|}

encodemv.c:av1_get_mv_joint:
   49|   552k|static inline MV_JOINT_TYPE av1_get_mv_joint(const MV *mv) {
   50|       |  // row:  Z  col:  Z  | MV_JOINT_ZERO   (0)
   51|       |  // row:  Z  col: NZ  | MV_JOINT_HNZVZ  (1)
   52|       |  // row: NZ  col:  Z  | MV_JOINT_HZVNZ  (2)
   53|       |  // row: NZ  col: NZ  | MV_JOINT_HNZVNZ (3)
   54|   552k|  return (!!mv->col) | ((!!mv->row) << 1);
   55|   552k|}
encodemv.c:av1_get_mv_class:
   67|  1.00M|static inline MV_CLASS_TYPE av1_get_mv_class(int z, int *offset) {
   68|  1.00M|  assert(z >= 0);
   69|  1.00M|  const MV_CLASS_TYPE c = (MV_CLASS_TYPE)av1_log_in_base_2(z >> 3);
   70|  1.00M|  assert(c <= MV_CLASS_10);
   71|  1.00M|  if (offset) *offset = z - av1_mv_class_base(c);
  ------------------
  |  Branch (71:7): [True: 1.00M, False: 18.4E]
  ------------------
   72|  1.00M|  return c;
   73|  1.00M|}
encodemv.c:av1_log_in_base_2:
   62|  1.00M|static inline uint8_t av1_log_in_base_2(unsigned int n) {
   63|       |  // get_msb() is only valid when n != 0.
   64|  1.00M|  return n == 0 ? 0 : get_msb(n);
  ------------------
  |  Branch (64:10): [True: 381k, False: 625k]
  ------------------
   65|  1.00M|}
encodemv.c:av1_mv_class_base:
   57|  1.00M|static inline int av1_mv_class_base(MV_CLASS_TYPE c) {
   58|  1.00M|  return c ? CLASS0_SIZE << (c + 2) : 0;
  ------------------
  |  |   65|   380k|#define CLASS0_SIZE (1 << CLASS0_BITS)
  |  |  ------------------
  |  |  |  |   64|   380k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  ------------------
  ------------------
  |  Branch (58:10): [True: 380k, False: 626k]
  ------------------
   59|  1.00M|}
mcomp.c:av1_get_mv_joint:
   49|   195M|static inline MV_JOINT_TYPE av1_get_mv_joint(const MV *mv) {
   50|       |  // row:  Z  col:  Z  | MV_JOINT_ZERO   (0)
   51|       |  // row:  Z  col: NZ  | MV_JOINT_HNZVZ  (1)
   52|       |  // row: NZ  col:  Z  | MV_JOINT_HZVNZ  (2)
   53|       |  // row: NZ  col: NZ  | MV_JOINT_HNZVNZ (3)
   54|   195M|  return (!!mv->col) | ((!!mv->row) << 1);
   55|   195M|}
rdopt.c:av1_check_newmv_joint_nonzero:
   76|  9.39M|                                                MACROBLOCK *const x) {
   77|  9.39M|  (void)cm;
   78|  9.39M|  MACROBLOCKD *xd = &x->e_mbd;
   79|  9.39M|  MB_MODE_INFO *mbmi = xd->mi[0];
   80|  9.39M|  const PREDICTION_MODE this_mode = mbmi->mode;
   81|  9.39M|  if (this_mode == NEW_NEWMV) {
  ------------------
  |  Branch (81:7): [True: 0, False: 9.39M]
  ------------------
   82|      0|    const int_mv ref_mv_0 = av1_get_ref_mv(x, 0);
   83|      0|    const int_mv ref_mv_1 = av1_get_ref_mv(x, 1);
   84|      0|    if (mbmi->mv[0].as_int == ref_mv_0.as_int ||
  ------------------
  |  Branch (84:9): [True: 0, False: 0]
  ------------------
   85|      0|        mbmi->mv[1].as_int == ref_mv_1.as_int) {
  ------------------
  |  Branch (85:9): [True: 0, False: 0]
  ------------------
   86|      0|      return 0;
   87|      0|    }
   88|  9.39M|  } else if (this_mode == NEAREST_NEWMV || this_mode == NEAR_NEWMV) {
  ------------------
  |  Branch (88:14): [True: 415, False: 9.39M]
  |  Branch (88:44): [True: 18.4E, False: 9.39M]
  ------------------
   89|      0|    const int_mv ref_mv_1 = av1_get_ref_mv(x, 1);
   90|      0|    if (mbmi->mv[1].as_int == ref_mv_1.as_int) {
  ------------------
  |  Branch (90:9): [True: 0, False: 0]
  ------------------
   91|      0|      return 0;
   92|      0|    }
   93|  9.39M|  } else if (this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV) {
  ------------------
  |  Branch (93:14): [True: 843, False: 9.39M]
  |  Branch (93:44): [True: 18.4E, False: 9.39M]
  ------------------
   94|      0|    const int_mv ref_mv_0 = av1_get_ref_mv(x, 0);
   95|      0|    if (mbmi->mv[0].as_int == ref_mv_0.as_int) {
  ------------------
  |  Branch (95:9): [True: 0, False: 0]
  ------------------
   96|      0|      return 0;
   97|      0|    }
   98|  9.39M|  } else if (this_mode == NEWMV) {
  ------------------
  |  Branch (98:14): [True: 3.26M, False: 6.13M]
  ------------------
   99|  3.26M|    const int_mv ref_mv_0 = av1_get_ref_mv(x, 0);
  100|  3.26M|    if (mbmi->mv[0].as_int == ref_mv_0.as_int) {
  ------------------
  |  Branch (100:9): [True: 376k, False: 2.89M]
  ------------------
  101|   376k|      return 0;
  102|   376k|    }
  103|  3.26M|  }
  104|  9.02M|  return 1;
  105|  9.39M|}

av1_initialize_enc:
  305|  18.4k|void av1_initialize_enc(unsigned int usage, enum aom_rc_mode end_usage) {
  306|  18.4k|  bool is_allintra = usage == ALLINTRA;
  307|       |
  308|  18.4k|  av1_rtcd();
  309|  18.4k|  aom_dsp_rtcd();
  310|  18.4k|  aom_scale_rtcd();
  311|  18.4k|  av1_init_intra_predictors();
  312|  18.4k|  av1_init_me_luts();
  313|  18.4k|  if (!is_allintra) av1_init_wedge_masks();
  ------------------
  |  Branch (313:7): [True: 18.4k, False: 0]
  ------------------
  314|  18.4k|  if (!is_allintra || end_usage != AOM_Q) av1_rc_init_minq_luts();
  ------------------
  |  Branch (314:7): [True: 18.4k, False: 0]
  |  Branch (314:23): [True: 0, False: 0]
  ------------------
  315|  18.4k|}
av1_new_framerate:
  317|   229k|void av1_new_framerate(AV1_COMP *cpi, double framerate) {
  318|   229k|  cpi->framerate = framerate < 0.1 ? 30 : framerate;
  ------------------
  |  Branch (318:20): [True: 0, False: 229k]
  ------------------
  319|   229k|  av1_rc_update_framerate(cpi, cpi->common.width, cpi->common.height);
  320|   229k|}
av1_update_frame_size:
  432|   219k|void av1_update_frame_size(AV1_COMP *cpi) {
  433|   219k|  AV1_COMMON *const cm = &cpi->common;
  434|   219k|  MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
  435|       |
  436|       |  // Setup mi_params here in case we need more mi's.
  437|   219k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
  438|   219k|  mi_params->set_mb_mi(mi_params, cm->width, cm->height,
  439|   219k|                       cpi->sf.part_sf.default_min_partition_size);
  440|       |
  441|   219k|  av1_init_macroblockd(cm, xd);
  442|       |
  443|   219k|  if (!cpi->ppi->seq_params_locked)
  ------------------
  |  Branch (443:7): [True: 174k, False: 44.9k]
  ------------------
  444|   174k|    set_sb_size(cm->seq_params,
  445|   174k|                av1_select_sb_size(&cpi->oxcf, cm->width, cm->height,
  446|   174k|                                   cpi->ppi->number_spatial_layers));
  447|       |
  448|   219k|  set_tile_info(cm, &cpi->oxcf.tile_cfg);
  449|   219k|}
av1_set_svc_seq_params:
  561|   155k|void av1_set_svc_seq_params(AV1_PRIMARY *const ppi) {
  562|   155k|  SequenceHeader *const seq = &ppi->seq_params;
  563|   155k|  if (seq->operating_points_cnt_minus_1 == 0) {
  ------------------
  |  Branch (563:7): [True: 61.8k, False: 93.9k]
  ------------------
  564|  61.8k|    seq->operating_point_idc[0] = 0;
  565|  61.8k|    seq->has_nonzero_operating_point_idc = false;
  566|  93.9k|  } else {
  567|       |    // Set operating_point_idc[] such that the i=0 point corresponds to the
  568|       |    // highest quality operating point (all layers), and subsequent
  569|       |    // operarting points (i > 0) are lower quality corresponding to
  570|       |    // skip decoding enhancement  layers (temporal first).
  571|  93.9k|    int i = 0;
  572|  93.9k|    assert(seq->operating_points_cnt_minus_1 ==
  573|  93.9k|           (int)(ppi->number_spatial_layers * ppi->number_temporal_layers - 1));
  574|   469k|    for (unsigned int sl = 0; sl < ppi->number_spatial_layers; sl++) {
  ------------------
  |  Branch (574:31): [True: 375k, False: 93.9k]
  ------------------
  575|   751k|      for (unsigned int tl = 0; tl < ppi->number_temporal_layers; tl++) {
  ------------------
  |  Branch (575:33): [True: 375k, False: 375k]
  ------------------
  576|   375k|        seq->operating_point_idc[i] =
  577|   375k|            (~(~0u << (ppi->number_spatial_layers - sl)) << 8) |
  578|   375k|            ~(~0u << (ppi->number_temporal_layers - tl));
  579|   375k|        assert(seq->operating_point_idc[i] != 0);
  580|   375k|        i++;
  581|   375k|      }
  582|   375k|    }
  583|       |    seq->has_nonzero_operating_point_idc = true;
  584|  93.9k|  }
  585|   155k|}
av1_change_config_seq:
  787|   155k|                           bool *is_sb_size_changed) {
  788|   155k|  SequenceHeader *const seq_params = &ppi->seq_params;
  789|   155k|  const FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
  790|   155k|  const DecoderModelCfg *const dec_model_cfg = &oxcf->dec_model_cfg;
  791|   155k|  const ColorCfg *const color_cfg = &oxcf->color_cfg;
  792|       |
  793|   155k|  if (seq_params->profile != oxcf->profile) seq_params->profile = oxcf->profile;
  ------------------
  |  Branch (793:7): [True: 0, False: 155k]
  ------------------
  794|   155k|  seq_params->bit_depth = oxcf->tool_cfg.bit_depth;
  795|   155k|  seq_params->color_primaries = color_cfg->color_primaries;
  796|   155k|  seq_params->transfer_characteristics = color_cfg->transfer_characteristics;
  797|   155k|  seq_params->matrix_coefficients = color_cfg->matrix_coefficients;
  798|   155k|  seq_params->monochrome = oxcf->tool_cfg.enable_monochrome;
  799|   155k|  seq_params->chroma_sample_position = color_cfg->chroma_sample_position;
  800|   155k|  seq_params->color_range = color_cfg->color_range;
  801|       |
  802|   155k|  assert(IMPLIES(seq_params->profile <= PROFILE_1,
  803|   155k|                 seq_params->bit_depth <= AOM_BITS_10));
  804|       |
  805|   155k|  seq_params->timing_info_present = dec_model_cfg->timing_info_present;
  806|   155k|  seq_params->timing_info.num_units_in_display_tick =
  807|   155k|      dec_model_cfg->timing_info.num_units_in_display_tick;
  808|   155k|  seq_params->timing_info.time_scale = dec_model_cfg->timing_info.time_scale;
  809|   155k|  seq_params->timing_info.equal_picture_interval =
  810|   155k|      dec_model_cfg->timing_info.equal_picture_interval;
  811|   155k|  seq_params->timing_info.num_ticks_per_picture =
  812|   155k|      dec_model_cfg->timing_info.num_ticks_per_picture;
  813|       |
  814|   155k|  seq_params->display_model_info_present_flag =
  815|   155k|      dec_model_cfg->display_model_info_present_flag;
  816|   155k|  seq_params->decoder_model_info_present_flag =
  817|   155k|      dec_model_cfg->decoder_model_info_present_flag;
  818|   155k|  if (dec_model_cfg->decoder_model_info_present_flag) {
  ------------------
  |  Branch (818:7): [True: 0, False: 155k]
  ------------------
  819|       |    // set the decoder model parameters in schedule mode
  820|      0|    seq_params->decoder_model_info.num_units_in_decoding_tick =
  821|      0|        dec_model_cfg->num_units_in_decoding_tick;
  822|      0|    ppi->buffer_removal_time_present = 1;
  823|      0|    av1_set_aom_dec_model_info(&seq_params->decoder_model_info);
  824|      0|    av1_set_dec_model_op_parameters(&seq_params->op_params[0]);
  825|   155k|  } else if (seq_params->timing_info_present &&
  ------------------
  |  Branch (825:14): [True: 0, False: 155k]
  ------------------
  826|      0|             seq_params->timing_info.equal_picture_interval &&
  ------------------
  |  Branch (826:14): [True: 0, False: 0]
  ------------------
  827|      0|             !seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (827:14): [True: 0, False: 0]
  ------------------
  828|       |    // set the decoder model parameters in resource availability mode
  829|      0|    av1_set_resource_availability_parameters(&seq_params->op_params[0]);
  830|   155k|  } else {
  831|   155k|    seq_params->op_params[0].initial_display_delay =
  832|   155k|        10;  // Default value (not signaled)
  833|   155k|  }
  834|       |
  835|   155k|#if !CONFIG_REALTIME_ONLY
  836|   155k|  av1_update_film_grain_parameters_seq(ppi, oxcf);
  837|   155k|#endif
  838|       |
  839|   155k|  int sb_size = seq_params->sb_size;
  840|       |  // Superblock size should not be updated after the first key frame.
  841|   155k|  if (!ppi->seq_params_locked) {
  ------------------
  |  Branch (841:7): [True: 155k, False: 0]
  ------------------
  842|   155k|    set_sb_size(seq_params, av1_select_sb_size(oxcf, frm_dim_cfg->width,
  843|   155k|                                               frm_dim_cfg->height,
  844|   155k|                                               ppi->number_spatial_layers));
  845|  5.14M|    for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i)
  ------------------
  |  |   76|  5.14M|  (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   70|  5.14M|#define MAX_NUM_TEMPORAL_LAYERS 8
  |  |  ------------------
  |  |                 (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   71|  5.14M|#define MAX_NUM_SPATIAL_LAYERS 4
  |  |  ------------------
  ------------------
  |  Branch (845:21): [True: 4.98M, False: 155k]
  ------------------
  846|  4.98M|      seq_params->tier[i] = (oxcf->tier_mask >> i) & 1;
  847|   155k|  }
  848|   155k|  if (is_sb_size_changed != NULL && sb_size != seq_params->sb_size)
  ------------------
  |  Branch (848:7): [True: 137k, False: 18.4k]
  |  Branch (848:37): [True: 12.3k, False: 125k]
  ------------------
  849|  12.3k|    *is_sb_size_changed = true;
  850|       |
  851|       |  // Init sequence level coding tools
  852|       |  // This should not be called after the first key frame.
  853|       |  // Note that for SVC encoding the sequence parameters
  854|       |  // (operating_points_cnt_minus_1, operating_point_idc[],
  855|       |  // has_nonzero_operating_point_idc) should be updated whenever the
  856|       |  // number of layers is changed. This is done in the
  857|       |  // ctrl_set_svc_params().
  858|   155k|  if (!ppi->seq_params_locked) {
  ------------------
  |  Branch (858:7): [True: 155k, False: 0]
  ------------------
  859|   155k|    seq_params->operating_points_cnt_minus_1 =
  860|   155k|        (ppi->number_spatial_layers > 1 || ppi->number_temporal_layers > 1)
  ------------------
  |  Branch (860:10): [True: 93.9k, False: 61.8k]
  |  Branch (860:44): [True: 0, False: 61.8k]
  ------------------
  861|   155k|            ? ppi->number_spatial_layers * ppi->number_temporal_layers - 1
  862|   155k|            : 0;
  863|   155k|    init_seq_coding_tools(ppi, oxcf,
  864|   155k|                          ppi->use_svc || ppi->rtc_ref.set_ref_frame_config);
  ------------------
  |  Branch (864:27): [True: 0, False: 155k]
  |  Branch (864:43): [True: 0, False: 155k]
  ------------------
  865|   155k|  }
  866|   155k|  seq_params->timing_info_present &= !seq_params->reduced_still_picture_hdr;
  867|       |
  868|   155k|#if CONFIG_AV1_HIGHBITDEPTH
  869|   155k|  highbd_set_var_fns(ppi);
  870|   155k|#endif
  871|       |
  872|   155k|  set_primary_rc_buffer_sizes(oxcf, ppi);
  873|   155k|}
av1_change_config:
  876|   155k|                       bool is_sb_size_changed) {
  877|   155k|  AV1_COMMON *const cm = &cpi->common;
  878|   155k|  SequenceHeader *const seq_params = cm->seq_params;
  879|   155k|  RATE_CONTROL *const rc = &cpi->rc;
  880|   155k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  881|   155k|  MACROBLOCK *const x = &cpi->td.mb;
  882|   155k|  AV1LevelParams *const level_params = &cpi->ppi->level_params;
  883|   155k|  RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
  884|   155k|  const FrameDimensionCfg *const frm_dim_cfg = &cpi->oxcf.frm_dim_cfg;
  885|   155k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
  886|   155k|  FeatureFlags *const features = &cm->features;
  887|   155k|  const int is_highbitdepth = seq_params->use_highbitdepth;
  888|       |
  889|       |  // in case of LAP, lag in frames is set according to number of lap buffers
  890|       |  // calculated at init time. This stores and restores LAP's lag in frames to
  891|       |  // prevent override by new cfg.
  892|   155k|  int lap_lag_in_frames = -1;
  893|   155k|  if (cpi->ppi->lap_enabled && cpi->compressor_stage == LAP_STAGE) {
  ------------------
  |  Branch (893:7): [True: 0, False: 155k]
  |  Branch (893:32): [True: 0, False: 0]
  ------------------
  894|      0|    lap_lag_in_frames = cpi->oxcf.gf_cfg.lag_in_frames;
  895|      0|  }
  896|       |
  897|   155k|  cpi->oxcf = *oxcf;
  898|       |
  899|   155k|#if !CONFIG_REALTIME_ONLY
  900|   155k|  av1_update_film_grain_parameters(cpi, oxcf);
  901|   155k|#endif
  902|       |
  903|       |  // When user provides superres_mode = AOM_SUPERRES_AUTO, we still initialize
  904|       |  // superres mode for current encoding = AOM_SUPERRES_NONE. This is to ensure
  905|       |  // that any analysis (e.g. TPL) happening outside the main encoding loop still
  906|       |  // happens at full resolution.
  907|       |  // This value will later be set appropriately just before main encoding loop.
  908|   155k|  cpi->superres_mode = oxcf->superres_cfg.superres_mode == AOM_SUPERRES_AUTO
  ------------------
  |  Branch (908:24): [True: 0, False: 155k]
  ------------------
  909|   155k|                           ? AOM_SUPERRES_NONE
  910|   155k|                           : oxcf->superres_cfg.superres_mode;  // default
  911|   155k|  x->e_mbd.bd = (int)seq_params->bit_depth;
  912|   155k|  x->e_mbd.global_motion = cm->global_motion;
  913|       |
  914|   155k|  memcpy(level_params->target_seq_level_idx, cpi->oxcf.target_seq_level_idx,
  915|   155k|         sizeof(level_params->target_seq_level_idx));
  916|   155k|  level_params->keep_level_stats = 0;
  917|  5.14M|  for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) {
  ------------------
  |  |   76|  5.14M|  (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   70|  5.14M|#define MAX_NUM_TEMPORAL_LAYERS 8
  |  |  ------------------
  |  |                 (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   71|  5.14M|#define MAX_NUM_SPATIAL_LAYERS 4
  |  |  ------------------
  ------------------
  |  Branch (917:19): [True: 4.98M, False: 155k]
  ------------------
  918|  4.98M|    if (level_params->target_seq_level_idx[i] < SEQ_LEVELS ||
  ------------------
  |  Branch (918:9): [True: 0, False: 4.98M]
  ------------------
  919|  4.98M|        level_params->target_seq_level_idx[i] == SEQ_LEVEL_KEEP_STATS) {
  ------------------
  |  Branch (919:9): [True: 0, False: 4.98M]
  ------------------
  920|      0|      level_params->keep_level_stats |= 1u << i;
  921|      0|      if (!level_params->level_info[i]) {
  ------------------
  |  Branch (921:11): [True: 0, False: 0]
  ------------------
  922|      0|        CHECK_MEM_ERROR(cm, level_params->level_info[i],
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|      0|                        aom_calloc(1, sizeof(*level_params->level_info[i])));
  924|      0|      }
  925|      0|    }
  926|  4.98M|  }
  927|       |
  928|       |  // TODO(huisu@): level targeting currently only works for the 0th operating
  929|       |  // point, so scalable coding is not supported yet.
  930|   155k|  if (level_params->target_seq_level_idx[0] < SEQ_LEVELS) {
  ------------------
  |  Branch (930:7): [True: 0, False: 155k]
  ------------------
  931|       |    // Adjust encoder config in order to meet target level.
  932|      0|    config_target_level(cpi, level_params->target_seq_level_idx[0],
  933|      0|                        seq_params->tier[0]);
  934|      0|  }
  935|       |
  936|   155k|  if (has_no_stats_stage(cpi) && (rc_cfg->mode == AOM_Q)) {
  ------------------
  |  Branch (936:7): [True: 155k, False: 0]
  |  Branch (936:34): [True: 108k, False: 47.3k]
  ------------------
  937|   108k|    p_rc->baseline_gf_interval = FIXED_GF_INTERVAL;
  ------------------
  |  |   46|   108k|#define FIXED_GF_INTERVAL 16
  ------------------
  938|   108k|  } else if (!is_one_pass_rt_params(cpi) ||
  ------------------
  |  Branch (938:14): [True: 0, False: 47.3k]
  ------------------
  939|  47.3k|             cm->current_frame.frame_number == 0) {
  ------------------
  |  Branch (939:14): [True: 47.3k, False: 0]
  ------------------
  940|       |    // For rtc mode: logic for setting the baseline_gf_interval is done
  941|       |    // in av1_get_one_pass_rt_params(), and it should not be reset here in
  942|       |    // change_config(), unless after init_config (first frame).
  943|  47.3k|    p_rc->baseline_gf_interval = (MIN_GF_INTERVAL + MAX_GF_INTERVAL) / 2;
  ------------------
  |  |   44|  47.3k|#define MIN_GF_INTERVAL 4
  ------------------
                  p_rc->baseline_gf_interval = (MIN_GF_INTERVAL + MAX_GF_INTERVAL) / 2;
  ------------------
  |  |   45|  47.3k|#define MAX_GF_INTERVAL 32
  ------------------
  944|  47.3k|  }
  945|       |
  946|   155k|  refresh_frame->golden_frame = false;
  947|   155k|  refresh_frame->bwd_ref_frame = false;
  948|       |
  949|   155k|  features->refresh_frame_context =
  950|   155k|      (oxcf->tool_cfg.frame_parallel_decoding_mode)
  ------------------
  |  Branch (950:7): [True: 0, False: 155k]
  ------------------
  951|   155k|          ? REFRESH_FRAME_CONTEXT_DISABLED
  952|   155k|          : REFRESH_FRAME_CONTEXT_BACKWARD;
  953|   155k|  if (oxcf->tile_cfg.enable_large_scale_tile)
  ------------------
  |  Branch (953:7): [True: 0, False: 155k]
  ------------------
  954|      0|    features->refresh_frame_context = REFRESH_FRAME_CONTEXT_DISABLED;
  955|       |
  956|   155k|  if (x->palette_buffer == NULL) {
  ------------------
  |  Branch (956:7): [True: 18.4k, False: 137k]
  ------------------
  957|  18.4k|    CHECK_MEM_ERROR(cm, x->palette_buffer,
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  958|  18.4k|                    aom_memalign(16, sizeof(*x->palette_buffer)));
  959|  18.4k|  }
  960|       |
  961|   155k|  if (x->tmp_conv_dst == NULL) {
  ------------------
  |  Branch (961:7): [True: 18.4k, False: 137k]
  ------------------
  962|  18.4k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|  18.4k|        cm, x->tmp_conv_dst,
  964|  18.4k|        aom_memalign(32, MAX_SB_SIZE * MAX_SB_SIZE * sizeof(*x->tmp_conv_dst)));
  965|  18.4k|    x->e_mbd.tmp_conv_dst = x->tmp_conv_dst;
  966|  18.4k|  }
  967|       |  // The buffers 'tmp_pred_bufs[]' and 'comp_rd_buffer' are used in inter frames
  968|       |  // to store intermediate inter mode prediction results and are not required
  969|       |  // for allintra encoding mode. Hence, the memory allocations for these buffers
  970|       |  // are avoided for allintra encoding mode.
  971|   155k|  if (cpi->oxcf.kf_cfg.key_freq_max != 0) {
  ------------------
  |  Branch (971:7): [True: 155k, False: 0]
  ------------------
  972|   155k|    if (x->comp_rd_buffer.pred0 == NULL)
  ------------------
  |  Branch (972:9): [True: 18.4k, False: 137k]
  ------------------
  973|  18.4k|      alloc_compound_type_rd_buffers(cm->error, &x->comp_rd_buffer);
  974|       |
  975|   467k|    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (975:21): [True: 311k, False: 155k]
  ------------------
  976|   311k|      if (x->tmp_pred_bufs[i] == NULL) {
  ------------------
  |  Branch (976:11): [True: 36.8k, False: 274k]
  ------------------
  977|  36.8k|        CHECK_MEM_ERROR(cm, x->tmp_pred_bufs[i],
  ------------------
  |  |   51|  36.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  36.8k|  do {                                                    \
  |  |  |  |   72|  36.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  36.8k|    lval = (expr);                                        \
  |  |  |  |   74|  36.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 36.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  36.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  36.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 36.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  36.8k|                        aom_memalign(32, 2 * MAX_MB_PLANE * MAX_SB_SQUARE *
  979|  36.8k|                                             sizeof(*x->tmp_pred_bufs[i])));
  980|  36.8k|        x->e_mbd.tmp_obmc_bufs[i] = x->tmp_pred_bufs[i];
  981|  36.8k|      }
  982|   311k|    }
  983|   155k|  }
  984|       |
  985|   155k|  if (x->upsample_pred == NULL) {
  ------------------
  |  Branch (985:7): [True: 18.4k, False: 137k]
  ------------------
  986|  18.4k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  987|  18.4k|        cm, x->upsample_pred,
  988|  18.4k|        aom_memalign(16, (1 + is_highbitdepth) * ((MAX_SB_SIZE + 16) + 16) *
  989|  18.4k|                             MAX_SB_SIZE * sizeof(*x->upsample_pred)));
  990|  18.4k|    x->e_mbd.tmp_upsample_pred = x->upsample_pred;
  991|  18.4k|  }
  992|       |
  993|   155k|  av1_reset_segment_features(cm);
  994|       |
  995|   155k|  av1_set_high_precision_mv(cpi, 1, 0);
  996|       |
  997|       |  // Under a configuration change, where maximum_buffer_size may change,
  998|       |  // keep buffer level clipped to the maximum allowed buffer size.
  999|   155k|  p_rc->bits_off_target =
 1000|   155k|      AOMMIN(p_rc->bits_off_target, p_rc->maximum_buffer_size);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
 1001|   155k|  p_rc->buffer_level = AOMMIN(p_rc->buffer_level, p_rc->maximum_buffer_size);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
 1002|       |
 1003|       |  // Set up frame rate and related parameters rate control values.
 1004|   155k|  av1_new_framerate(cpi, cpi->framerate);
 1005|       |
 1006|       |  // Set absolute upper and lower quality limits
 1007|   155k|  rc->worst_quality = rc_cfg->worst_allowed_q;
 1008|   155k|  rc->best_quality = rc_cfg->best_allowed_q;
 1009|       |
 1010|       |  // If lossless has been requested make sure average Q accumulators are reset.
 1011|   155k|  if (is_lossless_requested(&cpi->oxcf.rc_cfg)) {
  ------------------
  |  Branch (1011:7): [True: 5.47k, False: 150k]
  ------------------
 1012|  5.47k|    int i;
 1013|  27.3k|    for (i = 0; i < FRAME_TYPES; ++i) {
  ------------------
  |  Branch (1013:17): [True: 21.9k, False: 5.47k]
  ------------------
 1014|  21.9k|      p_rc->avg_frame_qindex[i] = 0;
 1015|  21.9k|    }
 1016|  5.47k|  }
 1017|       |
 1018|   155k|  features->interp_filter =
 1019|   155k|      oxcf->tile_cfg.enable_large_scale_tile ? EIGHTTAP_REGULAR : SWITCHABLE;
  ------------------
  |  Branch (1019:7): [True: 0, False: 155k]
  ------------------
 1020|   155k|  features->switchable_motion_mode = is_switchable_motion_mode_allowed(
 1021|   155k|      features->allow_warped_motion, oxcf->motion_mode_cfg.enable_obmc);
 1022|       |
 1023|   155k|  if (frm_dim_cfg->render_width > 0 && frm_dim_cfg->render_height > 0) {
  ------------------
  |  Branch (1023:7): [True: 0, False: 155k]
  |  Branch (1023:40): [True: 0, False: 0]
  ------------------
 1024|      0|    cm->render_width = frm_dim_cfg->render_width;
 1025|      0|    cm->render_height = frm_dim_cfg->render_height;
 1026|   155k|  } else {
 1027|   155k|    cm->render_width = frm_dim_cfg->width;
 1028|   155k|    cm->render_height = frm_dim_cfg->height;
 1029|   155k|  }
 1030|       |
 1031|   155k|  int last_width = cm->width;
 1032|   155k|  int last_height = cm->height;
 1033|   155k|  cm->width = frm_dim_cfg->width;
 1034|   155k|  cm->height = frm_dim_cfg->height;
 1035|       |
 1036|   155k|  if (cm->width > cpi->data_alloc_width ||
  ------------------
  |  Branch (1036:7): [True: 0, False: 155k]
  ------------------
 1037|   155k|      cm->height > cpi->data_alloc_height || is_sb_size_changed) {
  ------------------
  |  Branch (1037:7): [True: 0, False: 155k]
  |  Branch (1037:46): [True: 12.3k, False: 143k]
  ------------------
 1038|  12.3k|    av1_free_context_buffers(cm);
 1039|  12.3k|    av1_free_shared_coeff_buffer(&cpi->td.shared_coeff_buf);
 1040|  12.3k|    av1_free_sms_tree(&cpi->td);
 1041|  12.3k|    av1_free_pmc(cpi->td.firstpass_ctx, av1_num_planes(cm));
 1042|  12.3k|    cpi->td.firstpass_ctx = NULL;
 1043|  12.3k|    alloc_compressor_data(cpi);
 1044|  12.3k|    realloc_segmentation_maps(cpi);
 1045|  12.3k|    cpi->data_alloc_width = oxcf->frm_dim_cfg.forced_max_frame_width
  ------------------
  |  Branch (1045:29): [True: 0, False: 12.3k]
  ------------------
 1046|  12.3k|                                ? oxcf->frm_dim_cfg.forced_max_frame_width
 1047|  12.3k|                                : cm->width;
 1048|  12.3k|    cpi->data_alloc_height = oxcf->frm_dim_cfg.forced_max_frame_height
  ------------------
  |  Branch (1048:30): [True: 0, False: 12.3k]
  ------------------
 1049|  12.3k|                                 ? oxcf->frm_dim_cfg.forced_max_frame_height
 1050|  12.3k|                                 : cm->height;
 1051|  12.3k|    cpi->frame_size_related_setup_done = false;
 1052|  12.3k|  }
 1053|   155k|  av1_update_frame_size(cpi);
 1054|       |
 1055|   155k|  if (cm->width != last_width || cm->height != last_height) {
  ------------------
  |  Branch (1055:7): [True: 0, False: 155k]
  |  Branch (1055:34): [True: 0, False: 155k]
  ------------------
 1056|      0|    if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ) {
  ------------------
  |  Branch (1056:9): [True: 0, False: 0]
  ------------------
 1057|      0|      int mi_rows = cpi->common.mi_params.mi_rows;
 1058|      0|      int mi_cols = cpi->common.mi_params.mi_cols;
 1059|      0|      if (cpi->oxcf.frm_dim_cfg.forced_max_frame_width) {
  ------------------
  |  Branch (1059:11): [True: 0, False: 0]
  ------------------
 1060|      0|        mi_cols = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_width);
 1061|      0|      }
 1062|      0|      if (cpi->oxcf.frm_dim_cfg.forced_max_frame_height) {
  ------------------
  |  Branch (1062:11): [True: 0, False: 0]
  ------------------
 1063|      0|        mi_rows = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_height);
 1064|      0|      }
 1065|      0|      aom_free(cpi->cyclic_refresh->map);
 1066|      0|      CHECK_MEM_ERROR(
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1067|      0|          cm, cpi->cyclic_refresh->map,
 1068|      0|          aom_calloc(mi_rows * mi_cols, sizeof(*cpi->cyclic_refresh->map)));
 1069|      0|      if (cpi->svc.number_spatial_layers > 1) {
  ------------------
  |  Branch (1069:11): [True: 0, False: 0]
  ------------------
 1070|      0|        for (int sl = 0; sl < cpi->svc.number_spatial_layers; ++sl) {
  ------------------
  |  Branch (1070:26): [True: 0, False: 0]
  ------------------
 1071|      0|          const int layer =
 1072|      0|              LAYER_IDS_TO_IDX(sl, 0, cpi->svc.number_temporal_layers);
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 1073|      0|          LAYER_CONTEXT *const lc = &cpi->svc.layer_context[layer];
 1074|      0|          lc->sb_index = 0;
 1075|      0|          lc->actual_num_seg1_blocks = 0;
 1076|      0|          lc->actual_num_seg2_blocks = 0;
 1077|      0|          lc->counter_encode_maxq_scene_change = 0;
 1078|      0|          aom_free(lc->map);
 1079|      0|          CHECK_MEM_ERROR(cm, lc->map,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1080|      0|                          aom_calloc(mi_rows * mi_cols, sizeof(*lc->map)));
 1081|      0|        }
 1082|      0|      }
 1083|      0|    }
 1084|      0|  }
 1085|       |
 1086|   155k|  rc->is_src_frame_alt_ref = 0;
 1087|       |
 1088|   155k|  if (!cpi->ppi->rtc_ref.set_ref_frame_config)
  ------------------
  |  Branch (1088:7): [True: 155k, False: 0]
  ------------------
 1089|   155k|    cpi->ext_flags.refresh_frame.update_pending = 0;
 1090|   155k|  cpi->ext_flags.refresh_frame_context_pending = 0;
 1091|       |
 1092|   155k|  if (cpi->ppi->use_svc)
  ------------------
  |  Branch (1092:7): [True: 0, False: 155k]
  ------------------
 1093|      0|    av1_update_layer_context_change_config(cpi, rc_cfg->target_bandwidth);
 1094|       |
 1095|   155k|  check_reset_rc_flag(cpi);
 1096|       |
 1097|       |  // restore the value of lag_in_frame for LAP stage.
 1098|   155k|  if (lap_lag_in_frames != -1) {
  ------------------
  |  Branch (1098:7): [True: 0, False: 155k]
  ------------------
 1099|      0|    cpi->oxcf.gf_cfg.lag_in_frames = lap_lag_in_frames;
 1100|      0|  }
 1101|       |
 1102|       |#if CONFIG_REALTIME_ONLY
 1103|       |  assert(!oxcf->tool_cfg.enable_global_motion);
 1104|       |  cpi->alloc_pyramid = false;
 1105|       |#else
 1106|   155k|  cpi->alloc_pyramid = oxcf->tool_cfg.enable_global_motion;
 1107|   155k|#endif  // CONFIG_REALTIME_ONLY
 1108|   155k|}
av1_create_primary_compressor:
 1138|  18.4k|    const AV1EncoderConfig *oxcf) {
 1139|  18.4k|  AV1_PRIMARY *volatile const ppi = aom_memalign(32, sizeof(AV1_PRIMARY));
 1140|  18.4k|  if (!ppi) return NULL;
  ------------------
  |  Branch (1140:7): [True: 0, False: 18.4k]
  ------------------
 1141|  18.4k|  av1_zero(*ppi);
  ------------------
  |  |   43|  18.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1142|       |
 1143|       |  // The jmp_buf is valid only for the duration of the function that calls
 1144|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 1145|       |  // before it returns.
 1146|  18.4k|  if (setjmp(ppi->error.jmp)) {
  ------------------
  |  Branch (1146:7): [True: 0, False: 18.4k]
  ------------------
 1147|      0|    ppi->error.setjmp = 0;
 1148|      0|    av1_remove_primary_compressor(ppi);
 1149|      0|    return 0;
 1150|      0|  }
 1151|  18.4k|  ppi->error.setjmp = 1;
 1152|       |
 1153|  18.4k|  ppi->seq_params_locked = 0;
 1154|  18.4k|  ppi->lap_enabled = num_lap_buffers > 0;
 1155|  18.4k|  ppi->output_pkt_list = pkt_list_head;
 1156|  18.4k|  ppi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
  ------------------
  |  |   46|  18.4k|#define CONFIG_INTERNAL_STATS 0
  ------------------
 1157|  18.4k|  ppi->frames_left = oxcf->input_cfg.limit;
 1158|  18.4k|  ppi->num_fp_contexts = 1;
 1159|       |
 1160|  18.4k|  init_config_sequence(ppi, oxcf);
 1161|       |
 1162|       |#if CONFIG_ENTROPY_STATS
 1163|       |  av1_zero(ppi->aggregate_fc);
 1164|       |#endif  // CONFIG_ENTROPY_STATS
 1165|       |
 1166|  18.4k|  av1_primary_rc_init(oxcf, &ppi->p_rc);
 1167|       |
 1168|       |  // For two pass and lag_in_frames > 33 in LAP.
 1169|  18.4k|  ppi->p_rc.enable_scenecut_detection = ENABLE_SCENECUT_MODE_2;
 1170|  18.4k|  if (ppi->lap_enabled) {
  ------------------
  |  Branch (1170:7): [True: 0, False: 18.4k]
  ------------------
 1171|      0|    if ((num_lap_buffers <
  ------------------
  |  Branch (1171:9): [True: 0, False: 0]
  ------------------
 1172|      0|         (MAX_GF_LENGTH_LAP + SCENE_CUT_KEY_TEST_INTERVAL + 1)) &&
  ------------------
  |  |   47|      0|#define MAX_GF_LENGTH_LAP 16
  ------------------
                       (MAX_GF_LENGTH_LAP + SCENE_CUT_KEY_TEST_INTERVAL + 1)) &&
  ------------------
  |  |   90|      0|#define SCENE_CUT_KEY_TEST_INTERVAL 16
  ------------------
 1173|      0|        num_lap_buffers >= (MAX_GF_LENGTH_LAP + 3)) {
  ------------------
  |  |   47|      0|#define MAX_GF_LENGTH_LAP 16
  ------------------
  |  Branch (1173:9): [True: 0, False: 0]
  ------------------
 1174|       |      /*
 1175|       |       * For lag in frames >= 19 and <33, enable scenecut
 1176|       |       * with limited future frame prediction.
 1177|       |       */
 1178|      0|      ppi->p_rc.enable_scenecut_detection = ENABLE_SCENECUT_MODE_1;
 1179|      0|    } else if (num_lap_buffers < (MAX_GF_LENGTH_LAP + 3)) {
  ------------------
  |  |   47|      0|#define MAX_GF_LENGTH_LAP 16
  ------------------
  |  Branch (1179:16): [True: 0, False: 0]
  ------------------
 1180|       |      // Disable scenecut when lag_in_frames < 19.
 1181|      0|      ppi->p_rc.enable_scenecut_detection = DISABLE_SCENECUT;
 1182|      0|    }
 1183|      0|  }
 1184|       |
 1185|  18.4k|#define BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX4DF, SDX3DF) \
 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
 1193|       |
 1194|       |// Realtime mode doesn't use 4x rectangular blocks.
 1195|  18.4k|#if !CONFIG_REALTIME_ONLY
 1196|       |  // sdaf (used in compound prediction, get_mvpred_compound_sad()) is unused
 1197|       |  // for 4xN and Nx4 blocks.
 1198|  18.4k|  BFP(BLOCK_4X16, aom_sad4x16, /*SDAF=*/NULL, aom_variance4x16,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1199|  18.4k|      aom_sub_pixel_variance4x16, aom_sub_pixel_avg_variance4x16,
 1200|  18.4k|      aom_sad4x16x4d, aom_sad4x16x3d)
 1201|       |
 1202|       |  // sdaf (used in compound prediction, get_mvpred_compound_sad()) is unused
 1203|       |  // for 4xN and Nx4 blocks.
 1204|  18.4k|  BFP(BLOCK_16X4, aom_sad16x4, /*SDAF=*/NULL, aom_variance16x4,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1205|  18.4k|      aom_sub_pixel_variance16x4, aom_sub_pixel_avg_variance16x4,
 1206|  18.4k|      aom_sad16x4x4d, aom_sad16x4x3d)
 1207|       |
 1208|  18.4k|  BFP(BLOCK_8X32, aom_sad8x32, aom_sad8x32_avg, aom_variance8x32,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1209|  18.4k|      aom_sub_pixel_variance8x32, aom_sub_pixel_avg_variance8x32,
 1210|  18.4k|      aom_sad8x32x4d, aom_sad8x32x3d)
 1211|       |
 1212|  18.4k|  BFP(BLOCK_32X8, aom_sad32x8, aom_sad32x8_avg, aom_variance32x8,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1213|  18.4k|      aom_sub_pixel_variance32x8, aom_sub_pixel_avg_variance32x8,
 1214|  18.4k|      aom_sad32x8x4d, aom_sad32x8x3d)
 1215|       |
 1216|  18.4k|  BFP(BLOCK_16X64, aom_sad16x64, aom_sad16x64_avg, aom_variance16x64,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1217|  18.4k|      aom_sub_pixel_variance16x64, aom_sub_pixel_avg_variance16x64,
 1218|  18.4k|      aom_sad16x64x4d, aom_sad16x64x3d)
 1219|       |
 1220|  18.4k|  BFP(BLOCK_64X16, aom_sad64x16, aom_sad64x16_avg, aom_variance64x16,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1221|  18.4k|      aom_sub_pixel_variance64x16, aom_sub_pixel_avg_variance64x16,
 1222|  18.4k|      aom_sad64x16x4d, aom_sad64x16x3d)
 1223|  18.4k|#endif  // !CONFIG_REALTIME_ONLY
 1224|       |
 1225|  18.4k|  BFP(BLOCK_128X128, aom_sad128x128, aom_sad128x128_avg, aom_variance128x128,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1226|  18.4k|      aom_sub_pixel_variance128x128, aom_sub_pixel_avg_variance128x128,
 1227|  18.4k|      aom_sad128x128x4d, aom_sad128x128x3d)
 1228|       |
 1229|  18.4k|  BFP(BLOCK_128X64, aom_sad128x64, aom_sad128x64_avg, aom_variance128x64,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1230|  18.4k|      aom_sub_pixel_variance128x64, aom_sub_pixel_avg_variance128x64,
 1231|  18.4k|      aom_sad128x64x4d, aom_sad128x64x3d)
 1232|       |
 1233|  18.4k|  BFP(BLOCK_64X128, aom_sad64x128, aom_sad64x128_avg, aom_variance64x128,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1234|  18.4k|      aom_sub_pixel_variance64x128, aom_sub_pixel_avg_variance64x128,
 1235|  18.4k|      aom_sad64x128x4d, aom_sad64x128x3d)
 1236|       |
 1237|  18.4k|  BFP(BLOCK_32X16, aom_sad32x16, aom_sad32x16_avg, aom_variance32x16,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1238|  18.4k|      aom_sub_pixel_variance32x16, aom_sub_pixel_avg_variance32x16,
 1239|  18.4k|      aom_sad32x16x4d, aom_sad32x16x3d)
 1240|       |
 1241|  18.4k|  BFP(BLOCK_16X32, aom_sad16x32, aom_sad16x32_avg, aom_variance16x32,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1242|  18.4k|      aom_sub_pixel_variance16x32, aom_sub_pixel_avg_variance16x32,
 1243|  18.4k|      aom_sad16x32x4d, aom_sad16x32x3d)
 1244|       |
 1245|  18.4k|  BFP(BLOCK_64X32, aom_sad64x32, aom_sad64x32_avg, aom_variance64x32,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1246|  18.4k|      aom_sub_pixel_variance64x32, aom_sub_pixel_avg_variance64x32,
 1247|  18.4k|      aom_sad64x32x4d, aom_sad64x32x3d)
 1248|       |
 1249|  18.4k|  BFP(BLOCK_32X64, aom_sad32x64, aom_sad32x64_avg, aom_variance32x64,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1250|  18.4k|      aom_sub_pixel_variance32x64, aom_sub_pixel_avg_variance32x64,
 1251|  18.4k|      aom_sad32x64x4d, aom_sad32x64x3d)
 1252|       |
 1253|  18.4k|  BFP(BLOCK_32X32, aom_sad32x32, aom_sad32x32_avg, aom_variance32x32,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1254|  18.4k|      aom_sub_pixel_variance32x32, aom_sub_pixel_avg_variance32x32,
 1255|  18.4k|      aom_sad32x32x4d, aom_sad32x32x3d)
 1256|       |
 1257|  18.4k|  BFP(BLOCK_64X64, aom_sad64x64, aom_sad64x64_avg, aom_variance64x64,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1258|  18.4k|      aom_sub_pixel_variance64x64, aom_sub_pixel_avg_variance64x64,
 1259|  18.4k|      aom_sad64x64x4d, aom_sad64x64x3d)
 1260|       |
 1261|  18.4k|  BFP(BLOCK_16X16, aom_sad16x16, aom_sad16x16_avg, aom_variance16x16,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1262|  18.4k|      aom_sub_pixel_variance16x16, aom_sub_pixel_avg_variance16x16,
 1263|  18.4k|      aom_sad16x16x4d, aom_sad16x16x3d)
 1264|       |
 1265|  18.4k|  BFP(BLOCK_16X8, aom_sad16x8, aom_sad16x8_avg, aom_variance16x8,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1266|  18.4k|      aom_sub_pixel_variance16x8, aom_sub_pixel_avg_variance16x8,
 1267|  18.4k|      aom_sad16x8x4d, aom_sad16x8x3d)
 1268|       |
 1269|  18.4k|  BFP(BLOCK_8X16, aom_sad8x16, aom_sad8x16_avg, aom_variance8x16,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1270|  18.4k|      aom_sub_pixel_variance8x16, aom_sub_pixel_avg_variance8x16,
 1271|  18.4k|      aom_sad8x16x4d, aom_sad8x16x3d)
 1272|       |
 1273|  18.4k|  BFP(BLOCK_8X8, aom_sad8x8, aom_sad8x8_avg, aom_variance8x8,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1274|  18.4k|      aom_sub_pixel_variance8x8, aom_sub_pixel_avg_variance8x8, aom_sad8x8x4d,
 1275|  18.4k|      aom_sad8x8x3d)
 1276|       |
 1277|       |  // sdaf (used in compound prediction, get_mvpred_compound_sad()) is unused
 1278|       |  // for 4xN and Nx4 blocks.
 1279|  18.4k|  BFP(BLOCK_8X4, aom_sad8x4, /*SDAF=*/NULL, aom_variance8x4,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1280|  18.4k|      aom_sub_pixel_variance8x4, aom_sub_pixel_avg_variance8x4, aom_sad8x4x4d,
 1281|  18.4k|      aom_sad8x4x3d)
 1282|       |
 1283|       |  // sdaf (used in compound prediction, get_mvpred_compound_sad()) is unused
 1284|       |  // for 4xN and Nx4 blocks.
 1285|  18.4k|  BFP(BLOCK_4X8, aom_sad4x8, /*SDAF=*/NULL, aom_variance4x8,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1286|  18.4k|      aom_sub_pixel_variance4x8, aom_sub_pixel_avg_variance4x8, aom_sad4x8x4d,
 1287|  18.4k|      aom_sad4x8x3d)
 1288|       |
 1289|       |  // sdaf (used in compound prediction, get_mvpred_compound_sad()) is unused
 1290|       |  // for 4xN and Nx4 blocks.
 1291|  18.4k|  BFP(BLOCK_4X4, aom_sad4x4, /*SDAF=*/NULL, aom_variance4x4,
  ------------------
  |  | 1186|  18.4k|  ppi->fn_ptr[BT].sdf = SDF;                              \
  |  | 1187|  18.4k|  ppi->fn_ptr[BT].sdaf = SDAF;                            \
  |  | 1188|  18.4k|  ppi->fn_ptr[BT].vf = VF;                                \
  |  | 1189|  18.4k|  ppi->fn_ptr[BT].svf = SVF;                              \
  |  | 1190|  18.4k|  ppi->fn_ptr[BT].svaf = SVAF;                            \
  |  | 1191|  18.4k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                        \
  |  | 1192|  18.4k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  ------------------
 1292|  18.4k|      aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x4d,
 1293|  18.4k|      aom_sad4x4x3d)
 1294|       |
 1295|  18.4k|#if !CONFIG_REALTIME_ONLY
 1296|  18.4k|#define OBFP(BT, OSDF, OVF, OSVF) \
 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
 1300|       |
 1301|  18.4k|  OBFP(BLOCK_128X128, aom_obmc_sad128x128, aom_obmc_variance128x128,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1302|  18.4k|       aom_obmc_sub_pixel_variance128x128)
 1303|  18.4k|  OBFP(BLOCK_128X64, aom_obmc_sad128x64, aom_obmc_variance128x64,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1304|  18.4k|       aom_obmc_sub_pixel_variance128x64)
 1305|  18.4k|  OBFP(BLOCK_64X128, aom_obmc_sad64x128, aom_obmc_variance64x128,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1306|  18.4k|       aom_obmc_sub_pixel_variance64x128)
 1307|  18.4k|  OBFP(BLOCK_64X64, aom_obmc_sad64x64, aom_obmc_variance64x64,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1308|  18.4k|       aom_obmc_sub_pixel_variance64x64)
 1309|  18.4k|  OBFP(BLOCK_64X32, aom_obmc_sad64x32, aom_obmc_variance64x32,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1310|  18.4k|       aom_obmc_sub_pixel_variance64x32)
 1311|  18.4k|  OBFP(BLOCK_32X64, aom_obmc_sad32x64, aom_obmc_variance32x64,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1312|  18.4k|       aom_obmc_sub_pixel_variance32x64)
 1313|  18.4k|  OBFP(BLOCK_32X32, aom_obmc_sad32x32, aom_obmc_variance32x32,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1314|  18.4k|       aom_obmc_sub_pixel_variance32x32)
 1315|  18.4k|  OBFP(BLOCK_32X16, aom_obmc_sad32x16, aom_obmc_variance32x16,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1316|  18.4k|       aom_obmc_sub_pixel_variance32x16)
 1317|  18.4k|  OBFP(BLOCK_16X32, aom_obmc_sad16x32, aom_obmc_variance16x32,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1318|  18.4k|       aom_obmc_sub_pixel_variance16x32)
 1319|  18.4k|  OBFP(BLOCK_16X16, aom_obmc_sad16x16, aom_obmc_variance16x16,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1320|  18.4k|       aom_obmc_sub_pixel_variance16x16)
 1321|  18.4k|  OBFP(BLOCK_16X8, aom_obmc_sad16x8, aom_obmc_variance16x8,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1322|  18.4k|       aom_obmc_sub_pixel_variance16x8)
 1323|  18.4k|  OBFP(BLOCK_8X16, aom_obmc_sad8x16, aom_obmc_variance8x16,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1324|  18.4k|       aom_obmc_sub_pixel_variance8x16)
 1325|  18.4k|  OBFP(BLOCK_8X8, aom_obmc_sad8x8, aom_obmc_variance8x8,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1326|  18.4k|       aom_obmc_sub_pixel_variance8x8)
 1327|  18.4k|  OBFP(BLOCK_4X8, aom_obmc_sad4x8, aom_obmc_variance4x8,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1328|  18.4k|       aom_obmc_sub_pixel_variance4x8)
 1329|  18.4k|  OBFP(BLOCK_8X4, aom_obmc_sad8x4, aom_obmc_variance8x4,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1330|  18.4k|       aom_obmc_sub_pixel_variance8x4)
 1331|  18.4k|  OBFP(BLOCK_4X4, aom_obmc_sad4x4, aom_obmc_variance4x4,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1332|  18.4k|       aom_obmc_sub_pixel_variance4x4)
 1333|  18.4k|  OBFP(BLOCK_4X16, aom_obmc_sad4x16, aom_obmc_variance4x16,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1334|  18.4k|       aom_obmc_sub_pixel_variance4x16)
 1335|  18.4k|  OBFP(BLOCK_16X4, aom_obmc_sad16x4, aom_obmc_variance16x4,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1336|  18.4k|       aom_obmc_sub_pixel_variance16x4)
 1337|  18.4k|  OBFP(BLOCK_8X32, aom_obmc_sad8x32, aom_obmc_variance8x32,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1338|  18.4k|       aom_obmc_sub_pixel_variance8x32)
 1339|  18.4k|  OBFP(BLOCK_32X8, aom_obmc_sad32x8, aom_obmc_variance32x8,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1340|  18.4k|       aom_obmc_sub_pixel_variance32x8)
 1341|  18.4k|  OBFP(BLOCK_16X64, aom_obmc_sad16x64, aom_obmc_variance16x64,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1342|  18.4k|       aom_obmc_sub_pixel_variance16x64)
 1343|  18.4k|  OBFP(BLOCK_64X16, aom_obmc_sad64x16, aom_obmc_variance64x16,
  ------------------
  |  | 1297|  18.4k|  ppi->fn_ptr[BT].osdf = OSDF;    \
  |  | 1298|  18.4k|  ppi->fn_ptr[BT].ovf = OVF;      \
  |  | 1299|  18.4k|  ppi->fn_ptr[BT].osvf = OSVF;
  ------------------
 1344|  18.4k|       aom_obmc_sub_pixel_variance64x16)
 1345|  18.4k|#endif  // !CONFIG_REALTIME_ONLY
 1346|       |
 1347|  18.4k|#define MBFP(BT, MCSDF, MCSVF)  \
 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
 1350|       |
 1351|  18.4k|  MBFP(BLOCK_128X128, aom_masked_sad128x128,
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1352|  18.4k|       aom_masked_sub_pixel_variance128x128)
 1353|  18.4k|  MBFP(BLOCK_128X64, aom_masked_sad128x64, aom_masked_sub_pixel_variance128x64)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1354|  18.4k|  MBFP(BLOCK_64X128, aom_masked_sad64x128, aom_masked_sub_pixel_variance64x128)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1355|  18.4k|  MBFP(BLOCK_64X64, aom_masked_sad64x64, aom_masked_sub_pixel_variance64x64)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1356|  18.4k|  MBFP(BLOCK_64X32, aom_masked_sad64x32, aom_masked_sub_pixel_variance64x32)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1357|  18.4k|  MBFP(BLOCK_32X64, aom_masked_sad32x64, aom_masked_sub_pixel_variance32x64)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1358|  18.4k|  MBFP(BLOCK_32X32, aom_masked_sad32x32, aom_masked_sub_pixel_variance32x32)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1359|  18.4k|  MBFP(BLOCK_32X16, aom_masked_sad32x16, aom_masked_sub_pixel_variance32x16)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1360|  18.4k|  MBFP(BLOCK_16X32, aom_masked_sad16x32, aom_masked_sub_pixel_variance16x32)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1361|  18.4k|  MBFP(BLOCK_16X16, aom_masked_sad16x16, aom_masked_sub_pixel_variance16x16)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1362|  18.4k|  MBFP(BLOCK_16X8, aom_masked_sad16x8, aom_masked_sub_pixel_variance16x8)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1363|  18.4k|  MBFP(BLOCK_8X16, aom_masked_sad8x16, aom_masked_sub_pixel_variance8x16)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1364|  18.4k|  MBFP(BLOCK_8X8, aom_masked_sad8x8, aom_masked_sub_pixel_variance8x8)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1365|  18.4k|  MBFP(BLOCK_4X8, aom_masked_sad4x8, aom_masked_sub_pixel_variance4x8)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1366|  18.4k|  MBFP(BLOCK_8X4, aom_masked_sad8x4, aom_masked_sub_pixel_variance8x4)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1367|  18.4k|  MBFP(BLOCK_4X4, aom_masked_sad4x4, aom_masked_sub_pixel_variance4x4)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1368|       |
 1369|  18.4k|#if !CONFIG_REALTIME_ONLY
 1370|  18.4k|  MBFP(BLOCK_4X16, aom_masked_sad4x16, aom_masked_sub_pixel_variance4x16)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1371|  18.4k|  MBFP(BLOCK_16X4, aom_masked_sad16x4, aom_masked_sub_pixel_variance16x4)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1372|  18.4k|  MBFP(BLOCK_8X32, aom_masked_sad8x32, aom_masked_sub_pixel_variance8x32)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1373|  18.4k|  MBFP(BLOCK_32X8, aom_masked_sad32x8, aom_masked_sub_pixel_variance32x8)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1374|  18.4k|  MBFP(BLOCK_16X64, aom_masked_sad16x64, aom_masked_sub_pixel_variance16x64)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1375|  18.4k|  MBFP(BLOCK_64X16, aom_masked_sad64x16, aom_masked_sub_pixel_variance64x16)
  ------------------
  |  | 1348|  18.4k|  ppi->fn_ptr[BT].msdf = MCSDF; \
  |  | 1349|  18.4k|  ppi->fn_ptr[BT].msvf = MCSVF;
  ------------------
 1376|  18.4k|#endif
 1377|       |
 1378|  18.4k|#define SDSFP(BT, SDSF, SDSX4DF) \
 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
 1381|       |
 1382|  18.4k|  SDSFP(BLOCK_128X128, aom_sad_skip_128x128, aom_sad_skip_128x128x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1383|  18.4k|  SDSFP(BLOCK_128X64, aom_sad_skip_128x64, aom_sad_skip_128x64x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1384|  18.4k|  SDSFP(BLOCK_64X128, aom_sad_skip_64x128, aom_sad_skip_64x128x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1385|  18.4k|  SDSFP(BLOCK_64X64, aom_sad_skip_64x64, aom_sad_skip_64x64x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1386|  18.4k|  SDSFP(BLOCK_64X32, aom_sad_skip_64x32, aom_sad_skip_64x32x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1387|       |
 1388|  18.4k|  SDSFP(BLOCK_32X64, aom_sad_skip_32x64, aom_sad_skip_32x64x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1389|  18.4k|  SDSFP(BLOCK_32X32, aom_sad_skip_32x32, aom_sad_skip_32x32x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1390|  18.4k|  SDSFP(BLOCK_32X16, aom_sad_skip_32x16, aom_sad_skip_32x16x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1391|       |
 1392|  18.4k|  SDSFP(BLOCK_16X32, aom_sad_skip_16x32, aom_sad_skip_16x32x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1393|  18.4k|  SDSFP(BLOCK_16X16, aom_sad_skip_16x16, aom_sad_skip_16x16x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1394|  18.4k|  SDSFP(BLOCK_8X16, aom_sad_skip_8x16, aom_sad_skip_8x16x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1395|       |
 1396|  18.4k|#if !CONFIG_REALTIME_ONLY
 1397|  18.4k|  SDSFP(BLOCK_64X16, aom_sad_skip_64x16, aom_sad_skip_64x16x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1398|  18.4k|  SDSFP(BLOCK_16X64, aom_sad_skip_16x64, aom_sad_skip_16x64x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1399|  18.4k|  SDSFP(BLOCK_8X32, aom_sad_skip_8x32, aom_sad_skip_8x32x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1400|  18.4k|  SDSFP(BLOCK_4X16, aom_sad_skip_4x16, aom_sad_skip_4x16x4d)
  ------------------
  |  | 1379|  18.4k|  ppi->fn_ptr[BT].sdsf = SDSF;   \
  |  | 1380|  18.4k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  ------------------
 1401|  18.4k|#endif
 1402|  18.4k|#undef SDSFP
 1403|       |
 1404|  18.4k|#if CONFIG_AV1_HIGHBITDEPTH
 1405|  18.4k|  highbd_set_var_fns(ppi);
 1406|  18.4k|#endif
 1407|       |
 1408|  18.4k|  {
 1409|       |    // As cm->mi_params is a part of the frame level context (cpi), it is
 1410|       |    // unavailable at this point. mi_params is created as a local temporary
 1411|       |    // variable, to be passed into the functions used for allocating tpl
 1412|       |    // buffers. The values in this variable are populated according to initial
 1413|       |    // width and height of the frame.
 1414|  18.4k|    CommonModeInfoParams mi_params;
 1415|  18.4k|    enc_set_mb_mi(&mi_params, oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height,
 1416|  18.4k|                  BLOCK_4X4);
 1417|       |
 1418|  18.4k|    const BLOCK_SIZE bsize = BLOCK_16X16;
 1419|  18.4k|    const int w = mi_size_wide[bsize];
 1420|  18.4k|    const int h = mi_size_high[bsize];
 1421|  18.4k|    const int num_cols = (mi_params.mi_cols + w - 1) / w;
 1422|  18.4k|    const int num_rows = (mi_params.mi_rows + h - 1) / h;
 1423|  18.4k|    AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 1424|  18.4k|        &ppi->error, ppi->tpl_sb_rdmult_scaling_factors,
 1425|  18.4k|        aom_calloc(num_rows * num_cols,
 1426|  18.4k|                   sizeof(*ppi->tpl_sb_rdmult_scaling_factors)));
 1427|       |
 1428|       |#if CONFIG_INTERNAL_STATS
 1429|       |    ppi->b_calculate_blockiness = 1;
 1430|       |    ppi->b_calculate_consistency = 1;
 1431|       |
 1432|       |    for (int i = 0; i <= STAT_ALL; i++) {
 1433|       |      ppi->psnr[0].stat[i] = 0;
 1434|       |      ppi->psnr[1].stat[i] = 0;
 1435|       |
 1436|       |      ppi->fastssim.stat[i] = 0;
 1437|       |      ppi->psnrhvs.stat[i] = 0;
 1438|       |    }
 1439|       |
 1440|       |    ppi->psnr[0].worst = 100.0;
 1441|       |    ppi->psnr[1].worst = 100.0;
 1442|       |    ppi->worst_ssim = 100.0;
 1443|       |    ppi->worst_ssim_hbd = 100.0;
 1444|       |
 1445|       |    ppi->count[0] = 0;
 1446|       |    ppi->count[1] = 0;
 1447|       |    ppi->total_bytes = 0;
 1448|       |
 1449|       |    if (ppi->b_calculate_psnr) {
 1450|       |      ppi->total_sq_error[0] = 0;
 1451|       |      ppi->total_samples[0] = 0;
 1452|       |      ppi->total_sq_error[1] = 0;
 1453|       |      ppi->total_samples[1] = 0;
 1454|       |      ppi->total_recode_hits = 0;
 1455|       |      ppi->summed_quality = 0;
 1456|       |      ppi->summed_weights = 0;
 1457|       |      ppi->summed_quality_hbd = 0;
 1458|       |      ppi->summed_weights_hbd = 0;
 1459|       |    }
 1460|       |
 1461|       |    ppi->fastssim.worst = 100.0;
 1462|       |    ppi->psnrhvs.worst = 100.0;
 1463|       |
 1464|       |    if (ppi->b_calculate_blockiness) {
 1465|       |      ppi->total_blockiness = 0;
 1466|       |      ppi->worst_blockiness = 0.0;
 1467|       |    }
 1468|       |
 1469|       |    ppi->total_inconsistency = 0;
 1470|       |    ppi->worst_consistency = 100.0;
 1471|       |    if (ppi->b_calculate_consistency) {
 1472|       |      AOM_CHECK_MEM_ERROR(&ppi->error, ppi->ssim_vars,
 1473|       |                          aom_malloc(sizeof(*ppi->ssim_vars) * 4 *
 1474|       |                                     mi_params.mi_rows * mi_params.mi_cols));
 1475|       |    }
 1476|       |#endif
 1477|  18.4k|  }
 1478|       |
 1479|  18.4k|  ppi->error.setjmp = 0;
 1480|  18.4k|  return ppi;
 1481|  18.4k|}
av1_create_compressor:
 1485|  18.4k|                                int lap_lag_in_frames) {
 1486|  18.4k|  AV1_COMP *volatile const cpi = aom_memalign(32, sizeof(AV1_COMP));
 1487|       |
 1488|  18.4k|  if (!cpi) return NULL;
  ------------------
  |  Branch (1488:7): [True: 0, False: 18.4k]
  ------------------
 1489|       |
 1490|  18.4k|  av1_zero(*cpi);
  ------------------
  |  |   43|  18.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1491|       |
 1492|  18.4k|  cpi->ppi = ppi;
 1493|       |
 1494|  18.4k|  AV1_COMMON *volatile const cm = &cpi->common;
 1495|  18.4k|  cm->seq_params = &ppi->seq_params;
 1496|  18.4k|  cm->error =
 1497|  18.4k|      (struct aom_internal_error_info *)aom_calloc(1, sizeof(*cm->error));
 1498|  18.4k|  if (!cm->error) {
  ------------------
  |  Branch (1498:7): [True: 0, False: 18.4k]
  ------------------
 1499|      0|    aom_free(cpi);
 1500|      0|    return NULL;
 1501|      0|  }
 1502|       |
 1503|       |  // The jmp_buf is valid only for the duration of the function that calls
 1504|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 1505|       |  // before it returns.
 1506|  18.4k|  if (setjmp(cm->error->jmp)) {
  ------------------
  |  Branch (1506:7): [True: 0, False: 18.4k]
  ------------------
 1507|      0|    cm->error->setjmp = 0;
 1508|      0|    av1_remove_compressor(cpi);
 1509|      0|    return NULL;
 1510|      0|  }
 1511|       |
 1512|  18.4k|  cm->error->setjmp = 1;
 1513|  18.4k|  cpi->compressor_stage = stage;
 1514|       |
 1515|  18.4k|  cpi->do_frame_data_update = true;
 1516|       |
 1517|  18.4k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
 1518|  18.4k|  mi_params->free_mi = enc_free_mi;
 1519|  18.4k|  mi_params->setup_mi = enc_setup_mi;
 1520|  18.4k|  mi_params->set_mb_mi =
 1521|  18.4k|      (oxcf->pass == AOM_RC_FIRST_PASS || cpi->compressor_stage == LAP_STAGE)
  ------------------
  |  Branch (1521:8): [True: 0, False: 18.4k]
  |  Branch (1521:43): [True: 0, False: 18.4k]
  ------------------
 1522|  18.4k|          ? stat_stage_set_mb_mi
 1523|  18.4k|          : enc_set_mb_mi;
 1524|       |
 1525|  18.4k|  mi_params->mi_alloc_bsize = BLOCK_4X4;
 1526|       |
 1527|  18.4k|  CHECK_MEM_ERROR(cm, cm->fc,
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|  18.4k|                  (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->fc)));
 1529|  18.4k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1530|  18.4k|      cm, cm->default_frame_context,
 1531|  18.4k|      (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->default_frame_context)));
 1532|  18.4k|  memset(cm->fc, 0, sizeof(*cm->fc));
 1533|  18.4k|  memset(cm->default_frame_context, 0, sizeof(*cm->default_frame_context));
 1534|       |
 1535|  18.4k|  cpi->common.buffer_pool = pool;
 1536|       |
 1537|  18.4k|  init_config(cpi, oxcf);
 1538|  18.4k|  if (cpi->compressor_stage == LAP_STAGE) {
  ------------------
  |  Branch (1538:7): [True: 0, False: 18.4k]
  ------------------
 1539|      0|    cpi->oxcf.gf_cfg.lag_in_frames = lap_lag_in_frames;
 1540|      0|  }
 1541|       |
 1542|  18.4k|  av1_rc_init(&cpi->oxcf, &cpi->rc);
 1543|       |
 1544|  18.4k|  init_frame_info(&cpi->frame_info, cm);
 1545|  18.4k|  init_frame_index_set(&cpi->frame_index_set);
 1546|       |
 1547|  18.4k|  cm->current_frame.frame_number = 0;
 1548|  18.4k|  cpi->rc.frame_number_encoded = 0;
 1549|  18.4k|  cpi->rc.prev_frame_is_dropped = 0;
 1550|  18.4k|  cpi->rc.max_consec_drop = INT_MAX;
 1551|  18.4k|  cpi->rc.drop_count_consec = 0;
 1552|  18.4k|  cm->current_frame_id = -1;
 1553|  18.4k|  cpi->tile_data = NULL;
 1554|  18.4k|  cpi->last_show_frame_buf = NULL;
 1555|  18.4k|  realloc_segmentation_maps(cpi);
 1556|       |
 1557|  18.4k|  cpi->refresh_frame.alt_ref_frame = false;
 1558|       |
 1559|       |#if CONFIG_SPEED_STATS
 1560|       |  cpi->tx_search_count = 0;
 1561|       |#endif  // CONFIG_SPEED_STATS
 1562|       |
 1563|  18.4k|  cpi->time_stamps.first_ts_start = INT64_MAX;
 1564|       |
 1565|       |#ifdef OUTPUT_YUV_REC
 1566|       |  yuv_rec_file = fopen("rec.yuv", "wb");
 1567|       |#endif
 1568|       |#ifdef OUTPUT_YUV_DENOISED
 1569|       |  yuv_denoised_file = fopen("denoised.yuv", "wb");
 1570|       |#endif
 1571|       |
 1572|  18.4k|#if !CONFIG_REALTIME_ONLY
 1573|  18.4k|  if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (1573:7): [True: 0, False: 18.4k]
  ------------------
 1574|      0|    const size_t packet_sz = sizeof(FIRSTPASS_STATS);
 1575|      0|    const int packets = (int)(oxcf->twopass_stats_in.sz / packet_sz);
 1576|       |
 1577|      0|    if (!cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (1577:9): [True: 0, False: 0]
  ------------------
 1578|       |      /*Re-initialize to stats buffer, populated by application in the case of
 1579|       |       * two pass*/
 1580|      0|      cpi->ppi->twopass.stats_buf_ctx->stats_in_start =
 1581|      0|          oxcf->twopass_stats_in.buf;
 1582|      0|      cpi->twopass_frame.stats_in =
 1583|      0|          cpi->ppi->twopass.stats_buf_ctx->stats_in_start;
 1584|      0|      cpi->ppi->twopass.stats_buf_ctx->stats_in_end =
 1585|      0|          &cpi->ppi->twopass.stats_buf_ctx->stats_in_start[packets - 1];
 1586|       |
 1587|       |      // The buffer size is packets - 1 because the last packet is total_stats.
 1588|      0|      av1_firstpass_info_init(&cpi->ppi->twopass.firstpass_info,
 1589|      0|                              oxcf->twopass_stats_in.buf, packets - 1);
 1590|      0|      av1_init_second_pass(cpi);
 1591|      0|    } else {
 1592|      0|      av1_firstpass_info_init(&cpi->ppi->twopass.firstpass_info, NULL, 0);
 1593|      0|      av1_init_single_pass_lap(cpi);
 1594|      0|    }
 1595|      0|  }
 1596|  18.4k|#endif
 1597|       |
 1598|       |  // The buffer "obmc_buffer" is used in inter frames for fast obmc search.
 1599|       |  // Hence, the memory allocation for the same is avoided for allintra encoding
 1600|       |  // mode.
 1601|  18.4k|  if (cpi->oxcf.kf_cfg.key_freq_max != 0)
  ------------------
  |  Branch (1601:7): [True: 18.4k, False: 0]
  ------------------
 1602|  18.4k|    alloc_obmc_buffers(&cpi->td.mb.obmc_buffer, cm->error);
 1603|       |
 1604|  55.2k|  for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (1604:19): [True: 36.8k, False: 18.4k]
  ------------------
 1605|  36.8k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  36.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  36.8k|  do {                                                    \
  |  |  |  |   72|  36.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  36.8k|    lval = (expr);                                        \
  |  |  |  |   74|  36.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 36.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  36.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  36.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 36.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|  36.8k|        cm, cpi->td.mb.intrabc_hash_info.hash_value_buffer[x],
 1607|  36.8k|        (uint32_t *)aom_malloc(
 1608|  36.8k|            AOM_BUFFER_SIZE_FOR_BLOCK_HASH *
 1609|  36.8k|            sizeof(*cpi->td.mb.intrabc_hash_info.hash_value_buffer[x])));
 1610|  36.8k|  }
 1611|       |
 1612|  18.4k|  cpi->td.mb.intrabc_hash_info.crc_initialized = 0;
 1613|       |
 1614|  18.4k|  av1_set_speed_features_framesize_independent(cpi, oxcf->speed);
 1615|  18.4k|  av1_set_speed_features_framesize_dependent(cpi, oxcf->speed);
 1616|       |
 1617|  18.4k|  int max_mi_cols = mi_params->mi_cols;
 1618|  18.4k|  int max_mi_rows = mi_params->mi_rows;
 1619|  18.4k|  if (oxcf->frm_dim_cfg.forced_max_frame_width) {
  ------------------
  |  Branch (1619:7): [True: 0, False: 18.4k]
  ------------------
 1620|      0|    max_mi_cols = size_in_mi(oxcf->frm_dim_cfg.forced_max_frame_width);
 1621|      0|  }
 1622|  18.4k|  if (oxcf->frm_dim_cfg.forced_max_frame_height) {
  ------------------
  |  Branch (1622:7): [True: 0, False: 18.4k]
  ------------------
 1623|      0|    max_mi_rows = size_in_mi(oxcf->frm_dim_cfg.forced_max_frame_height);
 1624|      0|  }
 1625|       |
 1626|  18.4k|  const int consec_zero_mv_alloc_size = (max_mi_rows * max_mi_cols) >> 2;
 1627|  18.4k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1628|  18.4k|      cm, cpi->consec_zero_mv,
 1629|  18.4k|      aom_calloc(consec_zero_mv_alloc_size, sizeof(*cpi->consec_zero_mv)));
 1630|  18.4k|  cpi->consec_zero_mv_alloc_size = consec_zero_mv_alloc_size;
 1631|       |
 1632|  18.4k|  cpi->mb_weber_stats = NULL;
 1633|  18.4k|  cpi->mb_delta_q = NULL;
 1634|  18.4k|  cpi->palette_pixel_num = 0;
 1635|  18.4k|  cpi->scaled_last_source_available = 0;
 1636|       |
 1637|  18.4k|  {
 1638|  18.4k|    const BLOCK_SIZE bsize = BLOCK_16X16;
 1639|  18.4k|    const int w = mi_size_wide[bsize];
 1640|  18.4k|    const int h = mi_size_high[bsize];
 1641|  18.4k|    const int num_cols = (max_mi_cols + w - 1) / w;
 1642|  18.4k|    const int num_rows = (max_mi_rows + h - 1) / h;
 1643|  18.4k|    CHECK_MEM_ERROR(cm, cpi->ssim_rdmult_scaling_factors,
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1644|  18.4k|                    aom_calloc(num_rows * num_cols,
 1645|  18.4k|                               sizeof(*cpi->ssim_rdmult_scaling_factors)));
 1646|  18.4k|    CHECK_MEM_ERROR(cm, cpi->tpl_rdmult_scaling_factors,
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1647|  18.4k|                    aom_calloc(num_rows * num_cols,
 1648|  18.4k|                               sizeof(*cpi->tpl_rdmult_scaling_factors)));
 1649|  18.4k|  }
 1650|       |
 1651|       |#if CONFIG_TUNE_VMAF
 1652|       |  {
 1653|       |    const BLOCK_SIZE bsize = BLOCK_64X64;
 1654|       |    const int w = mi_size_wide[bsize];
 1655|       |    const int h = mi_size_high[bsize];
 1656|       |    const int num_cols = (mi_params->mi_cols + w - 1) / w;
 1657|       |    const int num_rows = (mi_params->mi_rows + h - 1) / h;
 1658|       |    CHECK_MEM_ERROR(cm, cpi->vmaf_info.rdmult_scaling_factors,
 1659|       |                    aom_calloc(num_rows * num_cols,
 1660|       |                               sizeof(*cpi->vmaf_info.rdmult_scaling_factors)));
 1661|       |    for (int i = 0; i < MAX_ARF_LAYERS; i++) {
 1662|       |      cpi->vmaf_info.last_frame_unsharp_amount[i] = -1.0;
 1663|       |      cpi->vmaf_info.last_frame_ysse[i] = -1.0;
 1664|       |      cpi->vmaf_info.last_frame_vmaf[i] = -1.0;
 1665|       |    }
 1666|       |    cpi->vmaf_info.original_qindex = -1;
 1667|       |    cpi->vmaf_info.vmaf_model = NULL;
 1668|       |  }
 1669|       |#endif
 1670|       |
 1671|       |#if CONFIG_TUNE_BUTTERAUGLI
 1672|       |  {
 1673|       |    const int w = mi_size_wide[butteraugli_rdo_bsize];
 1674|       |    const int h = mi_size_high[butteraugli_rdo_bsize];
 1675|       |    const int num_cols = (mi_params->mi_cols + w - 1) / w;
 1676|       |    const int num_rows = (mi_params->mi_rows + h - 1) / h;
 1677|       |    CHECK_MEM_ERROR(
 1678|       |        cm, cpi->butteraugli_info.rdmult_scaling_factors,
 1679|       |        aom_malloc(num_rows * num_cols *
 1680|       |                   sizeof(*cpi->butteraugli_info.rdmult_scaling_factors)));
 1681|       |    memset(&cpi->butteraugli_info.source, 0,
 1682|       |           sizeof(cpi->butteraugli_info.source));
 1683|       |    memset(&cpi->butteraugli_info.resized_source, 0,
 1684|       |           sizeof(cpi->butteraugli_info.resized_source));
 1685|       |    cpi->butteraugli_info.recon_set = false;
 1686|       |  }
 1687|       |#endif
 1688|       |
 1689|       |#if CONFIG_SALIENCY_MAP
 1690|       |  {
 1691|       |    CHECK_MEM_ERROR(cm, cpi->saliency_map,
 1692|       |                    (uint8_t *)aom_calloc(cm->height * cm->width,
 1693|       |                                          sizeof(*cpi->saliency_map)));
 1694|       |    // Buffer initialization based on MIN_MIB_SIZE_LOG2 to ensure that
 1695|       |    // cpi->sm_scaling_factor buffer is allocated big enough, since we have no
 1696|       |    // idea of the actual superblock size we are going to use yet.
 1697|       |    const int min_mi_w_sb = (1 << MIN_MIB_SIZE_LOG2);
 1698|       |    const int min_mi_h_sb = (1 << MIN_MIB_SIZE_LOG2);
 1699|       |    const int max_sb_cols =
 1700|       |        (cm->mi_params.mi_cols + min_mi_w_sb - 1) / min_mi_w_sb;
 1701|       |    const int max_sb_rows =
 1702|       |        (cm->mi_params.mi_rows + min_mi_h_sb - 1) / min_mi_h_sb;
 1703|       |    CHECK_MEM_ERROR(cm, cpi->sm_scaling_factor,
 1704|       |                    (double *)aom_calloc(max_sb_rows * max_sb_cols,
 1705|       |                                         sizeof(*cpi->sm_scaling_factor)));
 1706|       |  }
 1707|       |#endif
 1708|       |
 1709|       |#if CONFIG_COLLECT_PARTITION_STATS
 1710|       |  av1_zero(cpi->partition_stats);
 1711|       |#endif  // CONFIG_COLLECT_PARTITION_STATS
 1712|       |
 1713|       |  // Initialize the members of DeltaQuantParams with INT_MAX to ensure that
 1714|       |  // the quantizer tables are correctly initialized using the default deltaq
 1715|       |  // parameters when av1_init_quantizer is called for the first time.
 1716|  18.4k|  DeltaQuantParams *const prev_deltaq_params =
 1717|  18.4k|      &cpi->enc_quant_dequant_params.prev_deltaq_params;
 1718|  18.4k|  prev_deltaq_params->y_dc_delta_q = INT_MAX;
 1719|  18.4k|  prev_deltaq_params->u_dc_delta_q = INT_MAX;
 1720|  18.4k|  prev_deltaq_params->v_dc_delta_q = INT_MAX;
 1721|  18.4k|  prev_deltaq_params->u_ac_delta_q = INT_MAX;
 1722|  18.4k|  prev_deltaq_params->v_ac_delta_q = INT_MAX;
 1723|       |
 1724|  18.4k|  av1_init_quantizer(&cpi->enc_quant_dequant_params, &cm->quant_params,
 1725|  18.4k|                     cm->seq_params->bit_depth, cpi->oxcf.algo_cfg.sharpness);
 1726|  18.4k|  av1_qm_init(&cm->quant_params, av1_num_planes(cm));
 1727|       |
 1728|  18.4k|  av1_loop_filter_init(cm);
 1729|  18.4k|  cm->superres_scale_denominator = SCALE_NUMERATOR;
  ------------------
  |  |   22|  18.4k|#define SCALE_NUMERATOR 8
  ------------------
 1730|  18.4k|  cm->superres_upscaled_width = oxcf->frm_dim_cfg.width;
 1731|  18.4k|  cm->superres_upscaled_height = oxcf->frm_dim_cfg.height;
 1732|  18.4k|#if !CONFIG_REALTIME_ONLY
 1733|  18.4k|  av1_loop_restoration_precal();
 1734|  18.4k|#endif
 1735|       |
 1736|       |#if CONFIG_THREE_PASS
 1737|       |  cpi->third_pass_ctx = NULL;
 1738|       |  if (cpi->oxcf.pass == AOM_RC_THIRD_PASS) {
 1739|       |    av1_init_thirdpass_ctx(cm, &cpi->third_pass_ctx, NULL);
 1740|       |  }
 1741|       |#endif
 1742|       |
 1743|  18.4k|  cpi->second_pass_log_stream = NULL;
 1744|  18.4k|  cpi->use_ducky_encode = 0;
 1745|       |
 1746|  18.4k|  cm->error->setjmp = 0;
 1747|  18.4k|  return cpi;
 1748|  18.4k|}
av1_remove_primary_compressor:
 1757|  18.4k|void av1_remove_primary_compressor(AV1_PRIMARY *ppi) {
 1758|  18.4k|  if (!ppi) return;
  ------------------
  |  Branch (1758:7): [True: 0, False: 18.4k]
  ------------------
 1759|  18.4k|#if !CONFIG_REALTIME_ONLY
 1760|  18.4k|  av1_tf_info_free(&ppi->tf_info);
 1761|  18.4k|#endif  // !CONFIG_REALTIME_ONLY
 1762|       |
 1763|   607k|  for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) {
  ------------------
  |  |   76|   607k|  (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   70|   607k|#define MAX_NUM_TEMPORAL_LAYERS 8
  |  |  ------------------
  |  |                 (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   71|   607k|#define MAX_NUM_SPATIAL_LAYERS 4
  |  |  ------------------
  ------------------
  |  Branch (1763:19): [True: 588k, False: 18.4k]
  ------------------
 1764|   588k|    aom_free(ppi->level_params.level_info[i]);
 1765|   588k|  }
 1766|  18.4k|  av1_lookahead_destroy(ppi->lookahead);
 1767|       |
 1768|  18.4k|  aom_free(ppi->tpl_sb_rdmult_scaling_factors);
 1769|  18.4k|  ppi->tpl_sb_rdmult_scaling_factors = NULL;
 1770|       |
 1771|  18.4k|  TplParams *const tpl_data = &ppi->tpl_data;
 1772|  18.4k|  aom_free(tpl_data->txfm_stats_list);
 1773|       |
 1774|   901k|  for (int frame = 0; frame < MAX_LAG_BUFFERS; ++frame) {
  ------------------
  |  |   28|   901k|#define MAX_LAG_BUFFERS 48
  ------------------
  |  Branch (1774:23): [True: 883k, False: 18.4k]
  ------------------
 1775|   883k|    aom_free(tpl_data->tpl_stats_pool[frame]);
 1776|   883k|    aom_free_frame_buffer(&tpl_data->tpl_rec_pool[frame]);
 1777|   883k|    aom_free_frame_buffer(&tpl_data->prev_gop_arf_src);
 1778|   883k|    aom_free_frame_buffer(&tpl_data->prev_gop_arf_tpl_recon);
 1779|   883k|    tpl_data->prev_gop_arf_disp_order = -1;
 1780|   883k|    tpl_data->tpl_stats_pool[frame] = NULL;
 1781|   883k|  }
 1782|       |
 1783|  18.4k|#if !CONFIG_REALTIME_ONLY
 1784|  18.4k|  av1_tpl_dealloc(&tpl_data->tpl_mt_sync);
 1785|  18.4k|#endif
 1786|       |
 1787|  18.4k|  av1_terminate_workers(ppi);
 1788|  18.4k|  free_thread_data(ppi);
 1789|       |
 1790|  18.4k|  aom_free(ppi->p_mt_info.tile_thr_data);
 1791|  18.4k|  ppi->p_mt_info.tile_thr_data = NULL;
 1792|  18.4k|  aom_free(ppi->p_mt_info.workers);
 1793|  18.4k|  ppi->p_mt_info.workers = NULL;
 1794|  18.4k|  ppi->p_mt_info.num_workers = 0;
 1795|       |
 1796|  18.4k|  aom_free(ppi);
 1797|  18.4k|}
av1_remove_compressor:
 1799|  73.6k|void av1_remove_compressor(AV1_COMP *cpi) {
 1800|  73.6k|  if (!cpi) return;
  ------------------
  |  Branch (1800:7): [True: 55.2k, False: 18.4k]
  ------------------
 1801|       |#if CONFIG_RATECTRL_LOG
 1802|       |  if (cpi->oxcf.pass == 3) {
 1803|       |    rc_log_show(&cpi->rc_log);
 1804|       |  }
 1805|       |#endif  // CONFIG_RATECTRL_LOG
 1806|       |
 1807|  18.4k|  AV1_COMMON *cm = &cpi->common;
 1808|  18.4k|  if (cm->current_frame.frame_number > 0) {
  ------------------
  |  Branch (1808:7): [True: 18.4k, False: 0]
  ------------------
 1809|       |#if CONFIG_SPEED_STATS
 1810|       |    if (!is_stat_generation_stage(cpi)) {
 1811|       |      fprintf(stdout, "tx_search_count = %d\n", cpi->tx_search_count);
 1812|       |    }
 1813|       |#endif  // CONFIG_SPEED_STATS
 1814|       |
 1815|       |#if CONFIG_COLLECT_PARTITION_STATS == 2
 1816|       |    if (!is_stat_generation_stage(cpi)) {
 1817|       |      av1_print_fr_partition_timing_stats(&cpi->partition_stats,
 1818|       |                                          "fr_part_timing_data.csv");
 1819|       |    }
 1820|       |#endif
 1821|  18.4k|  }
 1822|       |
 1823|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 1824|       |  av1_denoiser_free(&(cpi->denoiser));
 1825|       |#endif
 1826|       |
 1827|  18.4k|  if (cm->error) {
  ------------------
  |  Branch (1827:7): [True: 18.4k, False: 0]
  ------------------
 1828|       |    // Help detect use after free of the error detail string.
 1829|  18.4k|    memset(cm->error->detail, 'A', sizeof(cm->error->detail) - 1);
 1830|  18.4k|    cm->error->detail[sizeof(cm->error->detail) - 1] = '\0';
 1831|  18.4k|    aom_free(cm->error);
 1832|  18.4k|  }
 1833|  18.4k|  aom_free(cpi->td.tctx);
 1834|  18.4k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 1835|  18.4k|#if CONFIG_MULTITHREAD
 1836|  18.4k|  pthread_mutex_t *const enc_row_mt_mutex_ = mt_info->enc_row_mt.mutex_;
 1837|  18.4k|  pthread_cond_t *const enc_row_mt_cond_ = mt_info->enc_row_mt.cond_;
 1838|  18.4k|  pthread_mutex_t *const gm_mt_mutex_ = mt_info->gm_sync.mutex_;
 1839|  18.4k|  pthread_mutex_t *const tpl_error_mutex_ = mt_info->tpl_row_mt.mutex_;
 1840|  18.4k|  pthread_mutex_t *const pack_bs_mt_mutex_ = mt_info->pack_bs_sync.mutex_;
 1841|  18.4k|  if (enc_row_mt_mutex_ != NULL) {
  ------------------
  |  Branch (1841:7): [True: 14.0k, False: 4.39k]
  ------------------
 1842|  14.0k|    pthread_mutex_destroy(enc_row_mt_mutex_);
 1843|  14.0k|    aom_free(enc_row_mt_mutex_);
 1844|  14.0k|  }
 1845|  18.4k|  if (enc_row_mt_cond_ != NULL) {
  ------------------
  |  Branch (1845:7): [True: 14.0k, False: 4.39k]
  ------------------
 1846|  14.0k|    pthread_cond_destroy(enc_row_mt_cond_);
 1847|  14.0k|    aom_free(enc_row_mt_cond_);
 1848|  14.0k|  }
 1849|  18.4k|  if (gm_mt_mutex_ != NULL) {
  ------------------
  |  Branch (1849:7): [True: 14.0k, False: 4.39k]
  ------------------
 1850|  14.0k|    pthread_mutex_destroy(gm_mt_mutex_);
 1851|  14.0k|    aom_free(gm_mt_mutex_);
 1852|  14.0k|  }
 1853|  18.4k|  if (tpl_error_mutex_ != NULL) {
  ------------------
  |  Branch (1853:7): [True: 14.0k, False: 4.39k]
  ------------------
 1854|  14.0k|    pthread_mutex_destroy(tpl_error_mutex_);
 1855|  14.0k|    aom_free(tpl_error_mutex_);
 1856|  14.0k|  }
 1857|  18.4k|  if (pack_bs_mt_mutex_ != NULL) {
  ------------------
  |  Branch (1857:7): [True: 14.0k, False: 4.39k]
  ------------------
 1858|  14.0k|    pthread_mutex_destroy(pack_bs_mt_mutex_);
 1859|  14.0k|    aom_free(pack_bs_mt_mutex_);
 1860|  14.0k|  }
 1861|  18.4k|#endif
 1862|  18.4k|  av1_row_mt_mem_dealloc(cpi);
 1863|       |
 1864|  18.4k|  if (mt_info->num_workers > 1) {
  ------------------
  |  Branch (1864:7): [True: 14.0k, False: 4.39k]
  ------------------
 1865|  14.0k|    av1_row_mt_sync_mem_dealloc(&cpi->ppi->intra_row_mt_sync);
 1866|  14.0k|    av1_loop_filter_dealloc(&mt_info->lf_row_sync);
 1867|  14.0k|    av1_cdef_mt_dealloc(&mt_info->cdef_sync);
 1868|  14.0k|#if !CONFIG_REALTIME_ONLY
 1869|  14.0k|    av1_loop_restoration_dealloc(&mt_info->lr_row_sync);
 1870|  14.0k|    av1_tf_mt_dealloc(&mt_info->tf_sync);
 1871|  14.0k|#endif
 1872|  14.0k|  }
 1873|       |
 1874|       |#if CONFIG_THREE_PASS
 1875|       |  av1_free_thirdpass_ctx(cpi->third_pass_ctx);
 1876|       |
 1877|       |  av1_close_second_pass_log(cpi);
 1878|       |#endif
 1879|       |
 1880|  18.4k|  dealloc_compressor_data(cpi);
 1881|       |
 1882|  18.4k|  av1_ext_part_delete(&cpi->ext_part_controller);
 1883|       |
 1884|  18.4k|  av1_remove_common(cm);
 1885|       |
 1886|  18.4k|  aom_free(cpi);
 1887|       |
 1888|       |#ifdef OUTPUT_YUV_REC
 1889|       |  fclose(yuv_rec_file);
 1890|       |#endif
 1891|       |
 1892|       |#ifdef OUTPUT_YUV_DENOISED
 1893|       |  fclose(yuv_denoised_file);
 1894|       |#endif
 1895|  18.4k|}
av1_use_as_reference:
 1931|   110k|int av1_use_as_reference(int *ext_ref_frame_flags, int ref_frame_flags) {
 1932|   110k|  if (ref_frame_flags > ((1 << INTER_REFS_PER_FRAME) - 1)) return -1;
  ------------------
  |  Branch (1932:7): [True: 0, False: 110k]
  ------------------
 1933|       |
 1934|   110k|  *ext_ref_frame_flags = ref_frame_flags;
 1935|   110k|  return 0;
 1936|   110k|}
av1_set_mv_search_params:
 2020|  85.9k|void av1_set_mv_search_params(AV1_COMP *cpi) {
 2021|  85.9k|  const AV1_COMMON *const cm = &cpi->common;
 2022|  85.9k|  MotionVectorSearchParams *const mv_search_params = &cpi->mv_search_params;
 2023|  85.9k|  const int max_mv_def = AOMMAX(cm->width, cm->height);
  ------------------
  |  |   35|  85.9k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 37.8k, False: 48.0k]
  |  |  ------------------
  ------------------
 2024|       |
 2025|       |  // Default based on max resolution.
 2026|  85.9k|  mv_search_params->mv_step_param = av1_init_search_range(max_mv_def);
 2027|       |
 2028|  85.9k|  if (cpi->sf.mv_sf.auto_mv_step_size) {
  ------------------
  |  Branch (2028:7): [True: 85.9k, False: 0]
  ------------------
 2029|  85.9k|    if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (2029:9): [True: 30.7k, False: 55.2k]
  ------------------
 2030|       |      // Initialize max_mv_magnitude for use in the first INTER frame
 2031|       |      // after a key/intra-only frame.
 2032|  30.7k|      mv_search_params->max_mv_magnitude = max_mv_def;
 2033|  55.2k|    } else {
 2034|       |      // Use adaptive mv steps based on previous frame stats for show frames and
 2035|       |      // internal arfs.
 2036|  55.2k|      FRAME_UPDATE_TYPE cur_update_type =
 2037|  55.2k|          cpi->ppi->gf_group.update_type[cpi->gf_frame_index];
 2038|  55.2k|      int use_auto_mv_step =
 2039|  55.2k|          (cm->show_frame || cur_update_type == INTNL_ARF_UPDATE) &&
  ------------------
  |  Branch (2039:12): [True: 55.2k, False: 0]
  |  Branch (2039:30): [True: 0, False: 0]
  ------------------
 2040|  55.2k|          mv_search_params->max_mv_magnitude != -1 &&
  ------------------
  |  Branch (2040:11): [True: 55.2k, False: 0]
  ------------------
 2041|  55.2k|          cpi->sf.mv_sf.auto_mv_step_size >= 2;
  ------------------
  |  Branch (2041:11): [True: 36.9k, False: 18.3k]
  ------------------
 2042|  55.2k|      if (use_auto_mv_step) {
  ------------------
  |  Branch (2042:11): [True: 36.9k, False: 18.3k]
  ------------------
 2043|       |        // Allow mv_steps to correspond to twice the max mv magnitude found
 2044|       |        // in the previous frame, capped by the default max_mv_magnitude based
 2045|       |        // on resolution.
 2046|  36.9k|        mv_search_params->mv_step_param = av1_init_search_range(
 2047|  36.9k|            AOMMIN(max_mv_def, 2 * mv_search_params->max_mv_magnitude));
  ------------------
  |  |   34|  36.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.7k, False: 26.2k]
  |  |  ------------------
  ------------------
 2048|  36.9k|      }
 2049|       |      // Reset max_mv_magnitude based on update flag.
 2050|  55.2k|      if (cpi->do_frame_data_update) mv_search_params->max_mv_magnitude = -1;
  ------------------
  |  Branch (2050:11): [True: 55.2k, False: 0]
  ------------------
 2051|  55.2k|    }
 2052|  85.9k|  }
 2053|  85.9k|}
av1_find_dominant_value:
 2126|  5.86k|                                int cols) {
 2127|  5.86k|  uint32_t value_count[1 << 8] = { 0 };  // Maximum (1 << 8) value levels.
 2128|  5.86k|  uint32_t dominant_value_count = 0;
 2129|  5.86k|  uint8_t dominant_value = 0;
 2130|       |
 2131|  99.7k|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (2131:19): [True: 93.8k, False: 5.86k]
  ------------------
 2132|  1.59M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (2132:21): [True: 1.50M, False: 93.8k]
  ------------------
 2133|  1.50M|      const uint8_t value = src[r * (ptrdiff_t)stride + c];
 2134|       |
 2135|  1.50M|      value_count[value]++;
 2136|       |
 2137|  1.50M|      if (value_count[value] > dominant_value_count) {
  ------------------
  |  Branch (2137:11): [True: 769k, False: 732k]
  ------------------
 2138|   769k|        dominant_value = value;
 2139|   769k|        dominant_value_count = value_count[value];
 2140|   769k|      }
 2141|  1.50M|    }
 2142|  93.8k|  }
 2143|       |
 2144|  5.86k|  return dominant_value;
 2145|  5.86k|}
av1_dilate_block:
 2168|  5.86k|                      int dilated_stride, int rows, int cols) {
 2169|  5.86k|  uint8_t dominant_value = av1_find_dominant_value(src, src_stride, rows, cols);
 2170|       |
 2171|  99.7k|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (2171:19): [True: 93.8k, False: 5.86k]
  ------------------
 2172|  1.59M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (2172:21): [True: 1.50M, False: 93.8k]
  ------------------
 2173|  1.50M|      const uint8_t value = src[r * (ptrdiff_t)src_stride + c];
 2174|       |
 2175|  1.50M|      dilated[r * (ptrdiff_t)dilated_stride + c] = value;
 2176|  1.50M|    }
 2177|  93.8k|  }
 2178|       |
 2179|  99.7k|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (2179:19): [True: 93.8k, False: 5.86k]
  ------------------
 2180|  1.59M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (2180:21): [True: 1.50M, False: 93.8k]
  ------------------
 2181|  1.50M|      const uint8_t value = src[r * (ptrdiff_t)src_stride + c];
 2182|       |
 2183|  1.50M|      if (value == dominant_value) {
  ------------------
  |  Branch (2183:11): [True: 769k, False: 732k]
  ------------------
 2184|       |        // Dilate up
 2185|   769k|        if (r != 0) {
  ------------------
  |  Branch (2185:13): [True: 720k, False: 48.6k]
  ------------------
 2186|   720k|          dilated[(r - 1) * (ptrdiff_t)dilated_stride + c] = value;
 2187|   720k|        }
 2188|       |        // Dilate down
 2189|   769k|        if (r != rows - 1) {
  ------------------
  |  Branch (2189:13): [True: 721k, False: 47.9k]
  ------------------
 2190|   721k|          dilated[(r + 1) * (ptrdiff_t)dilated_stride + c] = value;
 2191|   721k|        }
 2192|       |        // Dilate left
 2193|   769k|        if (c != 0) {
  ------------------
  |  Branch (2193:13): [True: 722k, False: 46.2k]
  ------------------
 2194|   722k|          dilated[r * (ptrdiff_t)dilated_stride + (c - 1)] = value;
 2195|   722k|        }
 2196|       |        // Dilate right
 2197|   769k|        if (c != cols - 1) {
  ------------------
  |  Branch (2197:13): [True: 719k, False: 49.4k]
  ------------------
 2198|   719k|          dilated[r * (ptrdiff_t)dilated_stride + (c + 1)] = value;
 2199|   719k|        }
 2200|       |        // Dilate upper-left corner
 2201|   769k|        if (r != 0 && c != 0) {
  ------------------
  |  Branch (2201:13): [True: 720k, False: 48.6k]
  |  Branch (2201:23): [True: 677k, False: 43.1k]
  ------------------
 2202|   677k|          dilated[(r - 1) * (ptrdiff_t)dilated_stride + (c - 1)] = value;
 2203|   677k|        }
 2204|       |        // Dilate upper-right corner
 2205|   769k|        if (r != 0 && c != cols - 1) {
  ------------------
  |  Branch (2205:13): [True: 720k, False: 48.6k]
  |  Branch (2205:23): [True: 674k, False: 46.3k]
  ------------------
 2206|   674k|          dilated[(r - 1) * (ptrdiff_t)dilated_stride + (c + 1)] = value;
 2207|   674k|        }
 2208|       |        // Dilate lower-left corner
 2209|   769k|        if (r != rows - 1 && c != 0) {
  ------------------
  |  Branch (2209:13): [True: 721k, False: 47.9k]
  |  Branch (2209:30): [True: 677k, False: 43.2k]
  ------------------
 2210|   677k|          dilated[(r + 1) * (ptrdiff_t)dilated_stride + (c - 1)] = value;
 2211|   677k|        }
 2212|       |        // Dilate lower-right corner
 2213|   769k|        if (r != rows - 1 && c != cols - 1) {
  ------------------
  |  Branch (2213:13): [True: 721k, False: 47.9k]
  |  Branch (2213:30): [True: 674k, False: 46.3k]
  ------------------
 2214|   674k|          dilated[(r + 1) * (ptrdiff_t)dilated_stride + (c + 1)] = value;
 2215|   674k|        }
 2216|   769k|      }
 2217|  1.50M|    }
 2218|  93.8k|  }
 2219|  5.86k|}
av1_set_screen_content_options:
 2454|  18.4k|void av1_set_screen_content_options(AV1_COMP *cpi, FeatureFlags *features) {
 2455|  18.4k|  const AV1_COMMON *const cm = &cpi->common;
 2456|       |
 2457|  18.4k|  if (cm->seq_params->force_screen_content_tools != 2) {
  ------------------
  |  Branch (2457:7): [True: 0, False: 18.4k]
  ------------------
 2458|      0|    features->allow_screen_content_tools = features->allow_intrabc =
 2459|      0|        cm->seq_params->force_screen_content_tools;
 2460|      0|    return;
 2461|      0|  }
 2462|       |
 2463|  18.4k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (2463:7): [True: 0, False: 18.4k]
  ------------------
 2464|      0|    features->allow_screen_content_tools = 1;
 2465|      0|    features->allow_intrabc =
 2466|      0|        (cpi->oxcf.mode == REALTIME && !cpi->sf.rt_sf.rt_use_intrabc) ? 0 : 1;
  ------------------
  |  Branch (2466:10): [True: 0, False: 0]
  |  Branch (2466:40): [True: 0, False: 0]
  ------------------
 2467|      0|    cpi->is_screen_content_type = 1;
 2468|      0|    cpi->use_screen_content_tools = 1;
 2469|      0|    return;
 2470|      0|  }
 2471|       |
 2472|  18.4k|  if (cpi->oxcf.mode == REALTIME) {
  ------------------
  |  Branch (2472:7): [True: 6.10k, False: 12.3k]
  ------------------
 2473|  6.10k|    features->allow_screen_content_tools = features->allow_intrabc = 0;
 2474|  6.10k|    return;
 2475|  6.10k|  }
 2476|       |
 2477|       |  // Screen content tools are not evaluated in non-RD encoding mode unless
 2478|       |  // content type is not set explicitly, i.e., when
 2479|       |  // cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN, use_nonrd_pick_mode = 1
 2480|       |  // and hybrid_intra_pickmode = 0. Hence, screen content detection is
 2481|       |  // disabled.
 2482|  12.3k|  if (cpi->sf.rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (2482:7): [True: 0, False: 12.3k]
  ------------------
 2483|      0|      !cpi->sf.rt_sf.hybrid_intra_pickmode) {
  ------------------
  |  Branch (2483:7): [True: 0, False: 0]
  ------------------
 2484|      0|    features->allow_screen_content_tools = features->allow_intrabc = 0;
 2485|      0|    return;
 2486|      0|  }
 2487|       |
 2488|  12.3k|  if (cpi->oxcf.algo_cfg.screen_detection_mode ==
  ------------------
  |  Branch (2488:7): [True: 8.61k, False: 3.68k]
  ------------------
 2489|  12.3k|      AOM_SCREEN_DETECTION_ANTIALIASING_AWARE) {
 2490|  8.61k|    estimate_screen_content_antialiasing_aware(cpi, features);
 2491|  8.61k|  } else {
 2492|  3.68k|    estimate_screen_content(cpi, features);
 2493|  3.68k|  }
 2494|  12.3k|}
av1_check_initial_width:
 2579|   137k|                                        int subsampling_x, int subsampling_y) {
 2580|   137k|  AV1_COMMON *const cm = &cpi->common;
 2581|   137k|  SequenceHeader *const seq_params = cm->seq_params;
 2582|       |
 2583|   137k|  if (!cpi->frame_size_related_setup_done ||
  ------------------
  |  Branch (2583:7): [True: 18.4k, False: 118k]
  ------------------
 2584|   118k|      seq_params->use_highbitdepth != use_highbitdepth ||
  ------------------
  |  Branch (2584:7): [True: 0, False: 118k]
  ------------------
 2585|   118k|      seq_params->subsampling_x != subsampling_x ||
  ------------------
  |  Branch (2585:7): [True: 0, False: 118k]
  ------------------
 2586|   118k|      seq_params->subsampling_y != subsampling_y) {
  ------------------
  |  Branch (2586:7): [True: 0, False: 118k]
  ------------------
 2587|  18.4k|    seq_params->subsampling_x = subsampling_x;
 2588|  18.4k|    seq_params->subsampling_y = subsampling_y;
 2589|  18.4k|    seq_params->use_highbitdepth = use_highbitdepth;
 2590|       |
 2591|  18.4k|    av1_set_speed_features_framesize_independent(cpi, cpi->oxcf.speed);
 2592|  18.4k|    av1_set_speed_features_framesize_dependent(cpi, cpi->oxcf.speed);
 2593|       |
 2594|  18.4k|    if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (2594:9): [True: 18.4k, False: 0]
  ------------------
 2595|  18.4k|#if !CONFIG_REALTIME_ONLY
 2596|  18.4k|      if (!av1_tf_info_alloc(&cpi->ppi->tf_info, cpi))
  ------------------
  |  Branch (2596:11): [True: 0, False: 18.4k]
  ------------------
 2597|      0|        return AOM_CODEC_MEM_ERROR;
 2598|  18.4k|#endif  // !CONFIG_REALTIME_ONLY
 2599|  18.4k|    }
 2600|  18.4k|    init_ref_frame_bufs(cpi);
 2601|       |
 2602|  18.4k|    init_motion_estimation(cpi);  // TODO(agrange) This can be removed.
 2603|       |
 2604|  18.4k|    cpi->initial_mbs = cm->mi_params.MBs;
 2605|  18.4k|    cpi->frame_size_related_setup_done = true;
 2606|  18.4k|  }
 2607|   137k|  return AOM_CODEC_OK;
 2608|   137k|}
av1_set_frame_size:
 2668|   122k|void av1_set_frame_size(AV1_COMP *cpi, int width, int height) {
 2669|   122k|  AV1_COMMON *const cm = &cpi->common;
 2670|   122k|  const SequenceHeader *const seq_params = cm->seq_params;
 2671|   122k|  const int num_planes = av1_num_planes(cm);
 2672|   122k|  MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 2673|   122k|  int ref_frame;
 2674|       |
 2675|   122k|  if (width != cm->width || height != cm->height) {
  ------------------
  |  Branch (2675:7): [True: 55.3k, False: 67.4k]
  |  Branch (2675:29): [True: 7.98k, False: 59.4k]
  ------------------
 2676|       |    // There has been a change in the encoded frame size
 2677|  63.3k|    set_size_literal(cpi, width, height);
 2678|       |    // Recalculate 'all_lossless' in case super-resolution was (un)selected.
 2679|  63.3k|    cm->features.all_lossless =
 2680|  63.3k|        cm->features.coded_lossless && !av1_superres_scaled(cm);
  ------------------
  |  Branch (2680:9): [True: 2.08k, False: 61.2k]
  |  Branch (2680:40): [True: 2.08k, False: 0]
  ------------------
 2681|       |
 2682|  63.3k|    av1_noise_estimate_init(&cpi->noise_estimate, cm->width, cm->height);
 2683|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 2684|       |    // Reset the denoiser on the resized frame.
 2685|       |    if (cpi->oxcf.noise_sensitivity > 0) {
 2686|       |      av1_denoiser_free(&(cpi->denoiser));
 2687|       |      setup_denoiser_buffer(cpi);
 2688|       |    }
 2689|       |#endif
 2690|  63.3k|  }
 2691|   122k|  if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (2691:7): [True: 0, False: 122k]
  ------------------
 2692|      0|    av1_set_target_rate(cpi, cm->width, cm->height);
 2693|      0|  }
 2694|       |
 2695|   122k|  alloc_frame_mvs(cm, cm->cur_frame);
 2696|       |
 2697|       |  // Allocate above context buffers
 2698|   122k|  CommonContexts *const above_contexts = &cm->above_contexts;
 2699|   122k|  if (above_contexts->num_planes < av1_num_planes(cm) ||
  ------------------
  |  Branch (2699:7): [True: 18.4k, False: 104k]
  ------------------
 2700|   104k|      above_contexts->num_mi_cols < cm->mi_params.mi_cols ||
  ------------------
  |  Branch (2700:7): [True: 903, False: 103k]
  ------------------
 2701|   103k|      above_contexts->num_tile_rows < cm->tiles.rows) {
  ------------------
  |  Branch (2701:7): [True: 1.35k, False: 102k]
  ------------------
 2702|  20.6k|    av1_free_above_context_buffers(above_contexts);
 2703|  20.6k|    if (av1_alloc_above_context_buffers(above_contexts, cm->tiles.rows,
  ------------------
  |  Branch (2703:9): [True: 0, False: 20.6k]
  ------------------
 2704|  20.6k|                                        cm->mi_params.mi_cols,
 2705|  20.6k|                                        av1_num_planes(cm)))
 2706|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2707|      0|                         "Failed to allocate context buffers");
 2708|  20.6k|  }
 2709|       |
 2710|   122k|  AV1EncoderConfig *oxcf = &cpi->oxcf;
 2711|   122k|  oxcf->border_in_pixels = av1_get_enc_border_size(
 2712|   122k|      av1_is_resize_needed(oxcf), oxcf->kf_cfg.key_freq_max == 0,
 2713|   122k|      cm->seq_params->sb_size);
 2714|       |
 2715|       |  // Reset the frame pointers to the current frame size.
 2716|   122k|  if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (2716:7): [True: 0, False: 122k]
  ------------------
 2717|   122k|          &cm->cur_frame->buf, cm->width, cm->height, seq_params->subsampling_x,
 2718|   122k|          seq_params->subsampling_y, seq_params->use_highbitdepth,
 2719|   122k|          cpi->oxcf.border_in_pixels, cm->features.byte_alignment, NULL, NULL,
 2720|   122k|          NULL, cpi->alloc_pyramid, 0))
 2721|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2722|      0|                       "Failed to allocate frame buffer");
 2723|       |
 2724|   122k|  if (!is_stat_generation_stage(cpi)) av1_init_cdef_worker(cpi);
  ------------------
  |  Branch (2724:7): [True: 122k, False: 0]
  ------------------
 2725|       |
 2726|   122k|#if !CONFIG_REALTIME_ONLY
 2727|   122k|  if (is_restoration_used(cm)) {
  ------------------
  |  Branch (2727:7): [True: 28.2k, False: 94.5k]
  ------------------
 2728|  77.5k|    for (int i = 0; i < num_planes; ++i)
  ------------------
  |  Branch (2728:21): [True: 49.2k, False: 28.2k]
  ------------------
 2729|  49.2k|      cm->rst_info[i].frame_restoration_type = RESTORE_NONE;
 2730|       |
 2731|  28.2k|    const bool is_sgr_enabled = !cpi->sf.lpf_sf.disable_sgr_filter;
 2732|  28.2k|    av1_alloc_restoration_buffers(cm, is_sgr_enabled);
 2733|       |    // Store the allocated restoration buffers in MT object.
 2734|  28.2k|    if (cpi->ppi->p_mt_info.num_workers > 1) {
  ------------------
  |  Branch (2734:9): [True: 7.50k, False: 20.7k]
  ------------------
 2735|  7.50k|      av1_init_lr_mt_buffers(cpi);
 2736|  7.50k|    }
 2737|  28.2k|  }
 2738|   122k|#endif
 2739|       |
 2740|   122k|  init_motion_estimation(cpi);
 2741|       |
 2742|   122k|  int has_valid_ref_frame = 0;
 2743|   982k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (2743:32): [True: 859k, False: 122k]
  ------------------
 2744|   859k|    RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 2745|   859k|    if (buf != NULL) {
  ------------------
  |  Branch (2745:9): [True: 644k, False: 214k]
  ------------------
 2746|   644k|      struct scale_factors *sf = get_ref_scale_factors(cm, ref_frame);
 2747|   644k|      av1_setup_scale_factors_for_frame(sf, buf->buf.y_crop_width,
 2748|   644k|                                        buf->buf.y_crop_height, cm->width,
 2749|   644k|                                        cm->height);
 2750|   644k|      has_valid_ref_frame |= av1_is_valid_scale(sf);
 2751|   644k|      if (av1_is_scaled(sf)) aom_extend_frame_borders(&buf->buf, num_planes);
  ------------------
  |  |   31|   314k|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
  |  Branch (2751:11): [True: 314k, False: 330k]
  ------------------
 2752|   644k|    }
 2753|   859k|  }
 2754|       |  // For 1 pass CBR mode: we can skip this check for spatial enhancement
 2755|       |  // layer if the target_bandwidth is zero, since it will be dropped.
 2756|   122k|  const bool dropped_frame =
 2757|   122k|      has_no_stats_stage(cpi) && cpi->oxcf.rc_cfg.mode == AOM_CBR &&
  ------------------
  |  Branch (2757:7): [True: 122k, False: 0]
  |  Branch (2757:34): [True: 24.4k, False: 98.4k]
  ------------------
 2758|  24.4k|      cpi->svc.spatial_layer_id > 0 && cpi->oxcf.rc_cfg.target_bandwidth == 0;
  ------------------
  |  Branch (2758:7): [True: 0, False: 24.4k]
  |  Branch (2758:40): [True: 0, False: 0]
  ------------------
 2759|   122k|  if (!frame_is_intra_only(cm) && !has_valid_ref_frame && !dropped_frame) {
  ------------------
  |  Branch (2759:7): [True: 92.1k, False: 30.7k]
  |  Branch (2759:35): [True: 0, False: 92.1k]
  |  Branch (2759:59): [True: 0, False: 0]
  ------------------
 2760|      0|    aom_internal_error(
 2761|      0|        cm->error, AOM_CODEC_CORRUPT_FRAME,
 2762|      0|        "Can't find at least one reference frame with valid size");
 2763|      0|  }
 2764|       |
 2765|   122k|  av1_setup_scale_factors_for_frame(&cm->sf_identity, cm->width, cm->height,
 2766|   122k|                                    cm->width, cm->height);
 2767|       |
 2768|   122k|  set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
 2769|   122k|}
av1_encode:
 4568|  73.6k|               size_t *const frame_size) {
 4569|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4570|  73.6k|  CurrentFrame *const current_frame = &cm->current_frame;
 4571|       |
 4572|  73.6k|  cpi->unscaled_source = frame_input->source;
 4573|  73.6k|  cpi->source = frame_input->source;
 4574|  73.6k|  cpi->unscaled_last_source = frame_input->last_source;
 4575|       |
 4576|  73.6k|  current_frame->refresh_frame_flags = frame_params->refresh_frame_flags;
 4577|  73.6k|  cm->features.error_resilient_mode = frame_params->error_resilient_mode;
 4578|  73.6k|  cm->features.primary_ref_frame = frame_params->primary_ref_frame;
 4579|  73.6k|  cm->current_frame.frame_type = frame_params->frame_type;
 4580|  73.6k|  cm->show_frame = frame_params->show_frame;
 4581|  73.6k|  cpi->ref_frame_flags = frame_params->ref_frame_flags;
 4582|  73.6k|  cpi->speed = frame_params->speed;
 4583|  73.6k|  cm->show_existing_frame = frame_params->show_existing_frame;
 4584|  73.6k|  cpi->existing_fb_idx_to_show = frame_params->existing_fb_idx_to_show;
 4585|       |
 4586|  73.6k|  if (cpi->oxcf.mode == GOOD &&
  ------------------
  |  Branch (4586:7): [True: 49.2k, False: 24.4k]
  ------------------
 4587|  49.2k|      cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_OBJECTIVE &&
  ------------------
  |  Branch (4587:7): [True: 14.7k, False: 34.4k]
  ------------------
 4588|  14.7k|      cpi->oxcf.algo_cfg.enable_tpl_model && cpi->oxcf.q_cfg.aq_mode == NO_AQ &&
  ------------------
  |  Branch (4588:7): [True: 3.68k, False: 11.0k]
  |  Branch (4588:46): [True: 3.68k, False: 0]
  ------------------
 4589|  3.68k|      !cpi->common.seg.enabled && !cpi->roi.enabled && !cpi->oxcf.sb_qp_sweep &&
  ------------------
  |  Branch (4589:7): [True: 3.68k, False: 0]
  |  Branch (4589:35): [True: 3.68k, False: 0]
  |  Branch (4589:56): [True: 3.68k, False: 0]
  ------------------
 4590|  3.68k|      !cpi->use_ducky_encode && cpi->oxcf.algo_cfg.sharpness != 3) {
  ------------------
  |  Branch (4590:7): [True: 3.68k, False: 0]
  |  Branch (4590:33): [True: 3.68k, False: 0]
  ------------------
 4591|  3.68k|    cpi->do_border_pad = true;
 4592|  69.9k|  } else {
 4593|  69.9k|    cpi->do_border_pad = false;
 4594|  69.9k|  }
 4595|       |
 4596|  73.6k|  memcpy(cm->remapped_ref_idx, frame_params->remapped_ref_idx,
 4597|  73.6k|         REF_FRAMES * sizeof(*cm->remapped_ref_idx));
 4598|       |
 4599|  73.6k|  memcpy(&cpi->refresh_frame, &frame_params->refresh_frame,
 4600|  73.6k|         sizeof(cpi->refresh_frame));
 4601|       |
 4602|  73.6k|  if (current_frame->frame_type == KEY_FRAME &&
  ------------------
  |  Branch (4602:7): [True: 18.4k, False: 55.2k]
  ------------------
 4603|  18.4k|      cpi->ppi->gf_group.refbuf_state[cpi->gf_frame_index] == REFBUF_RESET) {
  ------------------
  |  Branch (4603:7): [True: 18.4k, False: 0]
  ------------------
 4604|  18.4k|    current_frame->frame_number = 0;
 4605|  18.4k|  }
 4606|       |
 4607|  73.6k|  current_frame->order_hint =
 4608|  73.6k|      current_frame->frame_number + frame_params->order_offset;
 4609|       |
 4610|  73.6k|  current_frame->display_order_hint = current_frame->order_hint;
 4611|  73.6k|  current_frame->order_hint %=
 4612|  73.6k|      (1 << (cm->seq_params->order_hint_info.order_hint_bits_minus_1 + 1));
 4613|       |
 4614|  73.6k|  current_frame->pyramid_level = get_true_pyr_level(
 4615|  73.6k|      cpi->ppi->gf_group.layer_depth[cpi->gf_frame_index],
 4616|  73.6k|      current_frame->display_order_hint, cpi->ppi->gf_group.max_layer_depth);
 4617|       |
 4618|  73.6k|#if !CONFIG_REALTIME_ONLY
 4619|  73.6k|  const GF_GROUP *gf_group = &cpi->ppi->gf_group;
 4620|       |  // Check if this is the last frame in the gop. If so, make a copy of the
 4621|       |  // source for TPL.
 4622|  73.6k|  if (cpi->oxcf.algo_cfg.enable_tpl_model &&
  ------------------
  |  Branch (4622:7): [True: 18.4k, False: 55.2k]
  ------------------
 4623|  18.4k|      av1_tpl_stats_ready(&cpi->ppi->tpl_data, cpi->gf_frame_index) &&
  ------------------
  |  Branch (4623:7): [True: 0, False: 18.4k]
  ------------------
 4624|      0|      gf_group->update_type[cpi->gf_frame_index] != OVERLAY_UPDATE &&
  ------------------
  |  Branch (4624:7): [True: 0, False: 0]
  ------------------
 4625|      0|      gf_group->update_type[cpi->gf_frame_index] != INTNL_OVERLAY_UPDATE) {
  ------------------
  |  Branch (4625:7): [True: 0, False: 0]
  ------------------
 4626|      0|    int is_last = 1;
 4627|      0|    for (int i = 0; i < gf_group->size; ++i) {
  ------------------
  |  Branch (4627:21): [True: 0, False: 0]
  ------------------
 4628|      0|      if (gf_group->display_idx[i] >
  ------------------
  |  Branch (4628:11): [True: 0, False: 0]
  ------------------
 4629|      0|          gf_group->display_idx[cpi->gf_frame_index]) {
 4630|      0|        is_last = 0;
 4631|      0|        break;
 4632|      0|      }
 4633|      0|    }
 4634|      0|    if (is_last) {
  ------------------
  |  Branch (4634:9): [True: 0, False: 0]
  ------------------
 4635|      0|      const int alloc_y_plane_only =
 4636|      0|          cpi->sf.tpl_sf.use_y_only_rate_distortion ? 1 : 0;
  ------------------
  |  Branch (4636:11): [True: 0, False: 0]
  ------------------
 4637|      0|      cpi->ppi->tpl_data.prev_gop_arf_disp_order = -1;
 4638|      0|      const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 4639|      0|      int available = 1;
 4640|      0|      int ret = aom_realloc_frame_buffer(
 4641|      0|          &cpi->ppi->tpl_data.prev_gop_arf_src, oxcf->frm_dim_cfg.width,
 4642|      0|          oxcf->frm_dim_cfg.height, cm->seq_params->subsampling_x,
 4643|      0|          cm->seq_params->subsampling_y, cm->seq_params->use_highbitdepth,
 4644|      0|          cpi->oxcf.border_in_pixels, cm->features.byte_alignment, NULL, NULL,
 4645|      0|          NULL, cpi->alloc_pyramid, alloc_y_plane_only);
 4646|      0|      if (ret)
  ------------------
  |  Branch (4646:11): [True: 0, False: 0]
  ------------------
 4647|      0|        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 4648|      0|                           "Failed to allocate tpl prev_gop_arf_src buf.");
 4649|       |
 4650|       |      // Currently it is not supported if source/reference is resized.
 4651|      0|      if (cpi->source->y_width == cpi->ppi->tpl_data.prev_gop_arf_src.y_width &&
  ------------------
  |  Branch (4651:11): [True: 0, False: 0]
  ------------------
 4652|      0|          cpi->source->y_height ==
  ------------------
  |  Branch (4652:11): [True: 0, False: 0]
  ------------------
 4653|      0|              cpi->ppi->tpl_data.prev_gop_arf_src.y_height) {
 4654|       |        // Copy the content from source to this buffer for next gop.
 4655|      0|        aom_yv12_copy_frame(cpi->source, &cpi->ppi->tpl_data.prev_gop_arf_src,
  ------------------
  |  |   37|      0|#define aom_yv12_copy_frame aom_yv12_copy_frame_c
  ------------------
 4656|      0|                            alloc_y_plane_only ? 1 : av1_num_planes(cm));
  ------------------
  |  Branch (4656:29): [True: 0, False: 0]
  ------------------
 4657|      0|      } else {
 4658|      0|        available = 0;
 4659|      0|      }
 4660|       |
 4661|      0|      ret = aom_realloc_frame_buffer(
 4662|      0|          &cpi->ppi->tpl_data.prev_gop_arf_tpl_recon, oxcf->frm_dim_cfg.width,
 4663|      0|          oxcf->frm_dim_cfg.height, cm->seq_params->subsampling_x,
 4664|      0|          cm->seq_params->subsampling_y, cm->seq_params->use_highbitdepth,
 4665|      0|          cpi->oxcf.border_in_pixels, cm->features.byte_alignment, NULL, NULL,
 4666|      0|          NULL, cpi->alloc_pyramid, alloc_y_plane_only);
 4667|      0|      if (ret)
  ------------------
  |  Branch (4667:11): [True: 0, False: 0]
  ------------------
 4668|      0|        aom_internal_error(
 4669|      0|            cm->error, AOM_CODEC_MEM_ERROR,
 4670|      0|            "Failed to allocate tpl prev_gop_arf_tpl_recon buf.");
 4671|       |
 4672|      0|      YV12_BUFFER_CONFIG *prev_gop_arf_tpl_recon_buf =
 4673|      0|          cpi->ppi->tpl_data.tpl_frame
  ------------------
  |  Branch (4673:11): [True: 0, False: 0]
  ------------------
 4674|      0|              ? cpi->ppi->tpl_data.tpl_frame[cpi->gf_frame_index].rec_picture
 4675|      0|              : NULL;
 4676|       |
 4677|       |      // Currently it is not supported if source/reference is resized.
 4678|      0|      if (prev_gop_arf_tpl_recon_buf &&
  ------------------
  |  Branch (4678:11): [True: 0, False: 0]
  ------------------
 4679|      0|          prev_gop_arf_tpl_recon_buf->y_width ==
  ------------------
  |  Branch (4679:11): [True: 0, False: 0]
  ------------------
 4680|      0|              cpi->ppi->tpl_data.prev_gop_arf_tpl_recon.y_width &&
 4681|      0|          prev_gop_arf_tpl_recon_buf->y_height ==
  ------------------
  |  Branch (4681:11): [True: 0, False: 0]
  ------------------
 4682|      0|              cpi->ppi->tpl_data.prev_gop_arf_tpl_recon.y_height) {
 4683|       |        // Copy the content from source to this buffer for next gop.
 4684|      0|        aom_yv12_copy_frame(prev_gop_arf_tpl_recon_buf,
  ------------------
  |  |   37|      0|#define aom_yv12_copy_frame aom_yv12_copy_frame_c
  ------------------
 4685|      0|                            &cpi->ppi->tpl_data.prev_gop_arf_tpl_recon,
 4686|      0|                            alloc_y_plane_only ? 1 : av1_num_planes(cm));
  ------------------
  |  Branch (4686:29): [True: 0, False: 0]
  ------------------
 4687|      0|      } else {
 4688|      0|        available = 0;
 4689|      0|      }
 4690|       |
 4691|      0|      if (available) {
  ------------------
  |  Branch (4691:11): [True: 0, False: 0]
  ------------------
 4692|      0|        cpi->ppi->tpl_data.prev_gop_arf_disp_order =
 4693|      0|            current_frame->display_order_hint;
 4694|      0|      }
 4695|      0|    }
 4696|      0|  }
 4697|  73.6k|#endif
 4698|       |
 4699|  73.6k|  if (is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (4699:7): [True: 0, False: 73.6k]
  ------------------
 4700|      0|#if !CONFIG_REALTIME_ONLY
 4701|      0|    if (cpi->oxcf.q_cfg.use_fixed_qp_offsets != 0)
  ------------------
  |  Branch (4701:9): [True: 0, False: 0]
  ------------------
 4702|      0|      av1_noop_first_pass_frame(cpi, frame_input->ts_duration);
 4703|      0|    else
 4704|      0|      av1_first_pass(cpi, frame_input->ts_duration);
 4705|      0|#endif
 4706|  73.6k|  } else if (cpi->oxcf.pass == AOM_RC_ONE_PASS ||
  ------------------
  |  Branch (4706:14): [True: 73.6k, False: 0]
  ------------------
 4707|  73.6k|             cpi->oxcf.pass >= AOM_RC_SECOND_PASS) {
  ------------------
  |  Branch (4707:14): [True: 0, False: 0]
  ------------------
 4708|  73.6k|    if (encode_frame_to_data_rate(cpi, frame_size, dest, dest_size) !=
  ------------------
  |  Branch (4708:9): [True: 0, False: 73.6k]
  ------------------
 4709|  73.6k|        AOM_CODEC_OK) {
 4710|      0|      return AOM_CODEC_ERROR;
 4711|      0|    }
 4712|  73.6k|  } else {
 4713|      0|    return AOM_CODEC_ERROR;
 4714|      0|  }
 4715|       |
 4716|  73.6k|  if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (4716:7): [True: 0, False: 73.6k]
  ------------------
 4717|      0|      cpi->ext_ratectrl.funcs.update_encodeframe_result != NULL) {
  ------------------
  |  Branch (4717:7): [True: 0, False: 0]
  ------------------
 4718|      0|    aom_codec_err_t codec_status = av1_extrc_update_encodeframe_result(
 4719|      0|        &cpi->ext_ratectrl, (*frame_size) << 3, cm->quant_params.base_qindex);
 4720|      0|    if (codec_status != AOM_CODEC_OK) {
  ------------------
  |  Branch (4720:9): [True: 0, False: 0]
  ------------------
 4721|      0|      aom_internal_error(cm->error, codec_status,
 4722|      0|                         "av1_extrc_update_encodeframe_result() failed");
 4723|      0|    }
 4724|      0|  }
 4725|       |
 4726|  73.6k|  return AOM_CODEC_OK;
 4727|  73.6k|}
av1_receive_raw_frame:
 4766|  73.6k|                          int64_t end_time) {
 4767|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4768|  73.6k|  const SequenceHeader *const seq_params = cm->seq_params;
 4769|  73.6k|  int res = 0;
 4770|  73.6k|  const int subsampling_x = sd->subsampling_x;
 4771|  73.6k|  const int subsampling_y = sd->subsampling_y;
 4772|  73.6k|  const int use_highbitdepth = (sd->flags & YV12_FLAG_HIGHBITDEPTH) != 0;
  ------------------
  |  |  142|  73.6k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 4773|       |
 4774|       |  // Note: Regarding profile setting, the following checks are added to help
 4775|       |  // choose a proper profile for the input video. The criterion is that all
 4776|       |  // bitstreams must be designated as the lowest profile that match its content.
 4777|       |  // E.G. A bitstream that contains 4:4:4 video must be designated as High
 4778|       |  // Profile in the seq header, and likewise a bitstream that contains 4:2:2
 4779|       |  // bitstream must be designated as Professional Profile in the sequence
 4780|       |  // header.
 4781|  73.6k|  if ((seq_params->profile == PROFILE_0) && !seq_params->monochrome &&
  ------------------
  |  Branch (4781:7): [True: 51.4k, False: 22.1k]
  |  Branch (4781:45): [True: 11.5k, False: 39.9k]
  ------------------
 4782|  11.5k|      (subsampling_x != 1 || subsampling_y != 1)) {
  ------------------
  |  Branch (4782:8): [True: 0, False: 11.5k]
  |  Branch (4782:30): [True: 0, False: 11.5k]
  ------------------
 4783|      0|    aom_set_error(cm->error, AOM_CODEC_INVALID_PARAM,
 4784|      0|                  "Non-4:2:0 color format requires profile 1 or 2");
 4785|      0|    return -1;
 4786|      0|  }
 4787|  73.6k|  if ((seq_params->profile == PROFILE_1) &&
  ------------------
  |  Branch (4787:7): [True: 5.14k, False: 68.4k]
  ------------------
 4788|  5.14k|      !(subsampling_x == 0 && subsampling_y == 0)) {
  ------------------
  |  Branch (4788:9): [True: 5.14k, False: 0]
  |  Branch (4788:31): [True: 5.14k, False: 0]
  ------------------
 4789|      0|    aom_set_error(cm->error, AOM_CODEC_INVALID_PARAM,
 4790|      0|                  "Profile 1 requires 4:4:4 color format");
 4791|      0|    return -1;
 4792|      0|  }
 4793|  73.6k|  if ((seq_params->profile == PROFILE_2) &&
  ------------------
  |  Branch (4793:7): [True: 17.0k, False: 56.5k]
  ------------------
 4794|  17.0k|      (seq_params->bit_depth <= AOM_BITS_10) &&
  ------------------
  |  Branch (4794:7): [True: 6.37k, False: 10.6k]
  ------------------
 4795|  6.37k|      !(subsampling_x == 1 && subsampling_y == 0)) {
  ------------------
  |  Branch (4795:9): [True: 6.37k, False: 0]
  |  Branch (4795:31): [True: 6.37k, False: 0]
  ------------------
 4796|      0|    aom_set_error(cm->error, AOM_CODEC_INVALID_PARAM,
 4797|      0|                  "Profile 2 bit-depth <= 10 requires 4:2:2 color format");
 4798|      0|    return -1;
 4799|      0|  }
 4800|       |
 4801|       |#if CONFIG_TUNE_VMAF
 4802|       |  if (!is_stat_generation_stage(cpi) &&
 4803|       |      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_WITH_PREPROCESSING) {
 4804|       |    av1_vmaf_frame_preprocessing(cpi, sd);
 4805|       |  }
 4806|       |  if (!is_stat_generation_stage(cpi) &&
 4807|       |      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN) {
 4808|       |    av1_vmaf_blk_preprocessing(cpi, sd);
 4809|       |  }
 4810|       |#endif
 4811|       |
 4812|       |#if CONFIG_INTERNAL_STATS
 4813|       |  struct aom_usec_timer timer;
 4814|       |  aom_usec_timer_start(&timer);
 4815|       |#endif
 4816|       |
 4817|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 4818|       |  setup_denoiser_buffer(cpi);
 4819|       |#endif
 4820|       |
 4821|  73.6k|#if CONFIG_DENOISE
 4822|       |  // even if denoise_noise_level is > 0, we don't need need to denoise on pass
 4823|       |  // 1 of 2 if enable_dnl_denoising is disabled since the 2nd pass will be
 4824|       |  // encoding the original (non-denoised) frame
 4825|  73.6k|  if (cpi->oxcf.noise_level > 0 && !(cpi->oxcf.pass == AOM_RC_FIRST_PASS &&
  ------------------
  |  Branch (4825:7): [True: 0, False: 73.6k]
  |  Branch (4825:38): [True: 0, False: 0]
  ------------------
 4826|      0|                                     !cpi->oxcf.enable_dnl_denoising)) {
  ------------------
  |  Branch (4826:38): [True: 0, False: 0]
  ------------------
 4827|      0|#if !CONFIG_REALTIME_ONLY
 4828|       |    // Choose a synthetic noise level for still images for enhanced perceptual
 4829|       |    // quality based on an estimated noise level in the source, but only if
 4830|       |    // the noise level is set on the command line to > 0.
 4831|      0|    if (cpi->oxcf.mode == ALLINTRA) {
  ------------------
  |  Branch (4831:9): [True: 0, False: 0]
  ------------------
 4832|       |      // No noise synthesis if source is very clean.
 4833|       |      // Uses a low edge threshold to focus on smooth areas.
 4834|       |      // Increase output noise setting a little compared to measured value.
 4835|      0|      double y_noise_level = 0.0;
 4836|      0|      av1_estimate_noise_level(sd, &y_noise_level, AOM_PLANE_Y, AOM_PLANE_Y,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                    av1_estimate_noise_level(sd, &y_noise_level, AOM_PLANE_Y, AOM_PLANE_Y,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 4837|      0|                               cm->seq_params->bit_depth, 16);
 4838|      0|      cpi->oxcf.noise_level = (float)(y_noise_level - 0.1);
 4839|      0|      cpi->oxcf.noise_level = (float)AOMMAX(0.0, cpi->oxcf.noise_level);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4840|      0|      if (cpi->oxcf.noise_level > 0.0) {
  ------------------
  |  Branch (4840:11): [True: 0, False: 0]
  ------------------
 4841|      0|        cpi->oxcf.noise_level += (float)0.5;
 4842|      0|      }
 4843|      0|      cpi->oxcf.noise_level = (float)AOMMIN(5.0, cpi->oxcf.noise_level);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4844|      0|    }
 4845|       |
 4846|      0|    if (apply_denoise_2d(cpi, sd, cpi->oxcf.noise_block_size,
  ------------------
  |  Branch (4846:9): [True: 0, False: 0]
  ------------------
 4847|      0|                         cpi->oxcf.noise_level, time_stamp, end_time) < 0)
 4848|      0|      res = -1;
 4849|      0|#endif  // !CONFIG_REALTIME_ONLY
 4850|      0|  }
 4851|  73.6k|#endif  //  CONFIG_DENOISE
 4852|       |
 4853|  73.6k|  if (av1_lookahead_push(cpi->ppi->lookahead, sd, time_stamp, end_time,
  ------------------
  |  Branch (4853:7): [True: 0, False: 73.6k]
  ------------------
 4854|  73.6k|                         use_highbitdepth, cpi->alloc_pyramid, frame_flags)) {
 4855|      0|    aom_set_error(cm->error, AOM_CODEC_ERROR, "av1_lookahead_push() failed");
 4856|      0|    res = -1;
 4857|      0|  }
 4858|       |#if CONFIG_INTERNAL_STATS
 4859|       |  aom_usec_timer_mark(&timer);
 4860|       |  cpi->ppi->total_time_receive_data += aom_usec_timer_elapsed(&timer);
 4861|       |#endif
 4862|       |
 4863|  73.6k|  return res;
 4864|  73.6k|}
av1_post_encode_updates:
 5261|  73.6k|                             const AV1_COMP_DATA *const cpi_data) {
 5262|  73.6k|  AV1_PRIMARY *const ppi = cpi->ppi;
 5263|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 5264|       |
 5265|  73.6k|  if (ppi->b_freeze_internal_state) {
  ------------------
  |  Branch (5265:7): [True: 0, False: 73.6k]
  ------------------
 5266|       |    // Should not update encoder state, just necessary work to get the
 5267|       |    // expected output and then return early.
 5268|       |
 5269|       |    // Note *size = 0 indicates a dropped frame for which psnr is not calculated
 5270|      0|    if (ppi->b_calculate_psnr && cpi_data->frame_size > 0) {
  ------------------
  |  Branch (5270:9): [True: 0, False: 0]
  |  Branch (5270:34): [True: 0, False: 0]
  ------------------
 5271|      0|      if (cm->show_existing_frame ||
  ------------------
  |  Branch (5271:11): [True: 0, False: 0]
  ------------------
 5272|      0|          (!is_stat_generation_stage(cpi) && cm->show_frame)) {
  ------------------
  |  Branch (5272:12): [True: 0, False: 0]
  |  Branch (5272:46): [True: 0, False: 0]
  ------------------
 5273|      0|        generate_psnr_packet(cpi);
 5274|      0|      }
 5275|      0|    }
 5276|       |
 5277|      0|    if (cpi_data->pop_lookahead == 1) {
  ------------------
  |  Branch (5277:9): [True: 0, False: 0]
  ------------------
 5278|      0|      av1_lookahead_pop(cpi->ppi->lookahead, cpi_data->flush,
 5279|      0|                        cpi->compressor_stage);
 5280|      0|    }
 5281|      0|    return;
 5282|      0|  }
 5283|       |
 5284|  73.6k|  update_gm_stats(cpi);
 5285|       |
 5286|  73.6k|#if !CONFIG_REALTIME_ONLY
 5287|       |  // Update the total stats remaining structure.
 5288|  73.6k|  if (cpi->twopass_frame.this_frame != NULL &&
  ------------------
  |  Branch (5288:7): [True: 0, False: 73.6k]
  ------------------
 5289|      0|      ppi->twopass.stats_buf_ctx->total_left_stats) {
  ------------------
  |  Branch (5289:7): [True: 0, False: 0]
  ------------------
 5290|      0|    subtract_stats(ppi->twopass.stats_buf_ctx->total_left_stats,
 5291|      0|                   cpi->twopass_frame.this_frame);
 5292|      0|  }
 5293|  73.6k|#endif
 5294|       |
 5295|       |#if CONFIG_OUTPUT_FRAME_SIZE
 5296|       |  FILE *f = fopen("frame_sizes.csv", "a");
 5297|       |  fprintf(f, "%d,", 8 * (int)cpi_data->frame_size);
 5298|       |  fprintf(f, "%d\n", cm->quant_params.base_qindex);
 5299|       |  fclose(f);
 5300|       |#endif  // CONFIG_OUTPUT_FRAME_SIZE
 5301|       |
 5302|  73.6k|  if (!is_stat_generation_stage(cpi) && !cpi->is_dropped_frame) {
  ------------------
  |  Branch (5302:7): [True: 73.6k, False: 0]
  |  Branch (5302:41): [True: 73.6k, False: 0]
  ------------------
 5303|       |    // Before calling refresh_reference_frames(), copy ppi->ref_frame_map_copy
 5304|       |    // to cm->ref_frame_map for frame_parallel_level 2 frame in a parallel
 5305|       |    // encode set of lower layer frames.
 5306|       |    // TODO(Remya): Move ref_frame_map from AV1_COMMON to AV1_PRIMARY to avoid
 5307|       |    // copy.
 5308|  73.6k|    if (ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 2 &&
  ------------------
  |  Branch (5308:9): [True: 0, False: 73.6k]
  ------------------
 5309|      0|        ppi->gf_group.frame_parallel_level[cpi->gf_frame_index - 1] == 1 &&
  ------------------
  |  Branch (5309:9): [True: 0, False: 0]
  ------------------
 5310|      0|        ppi->gf_group.update_type[cpi->gf_frame_index - 1] ==
  ------------------
  |  Branch (5310:9): [True: 0, False: 0]
  ------------------
 5311|      0|            INTNL_ARF_UPDATE) {
 5312|      0|      memcpy(cm->ref_frame_map, ppi->ref_frame_map_copy,
 5313|      0|             sizeof(cm->ref_frame_map));
 5314|      0|    }
 5315|  73.6k|    refresh_reference_frames(cpi);
 5316|       |    // For frame_parallel_level 1 frame in a parallel encode set of lower layer
 5317|       |    // frames, store the updated cm->ref_frame_map in ppi->ref_frame_map_copy.
 5318|  73.6k|    if (ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 1 &&
  ------------------
  |  Branch (5318:9): [True: 0, False: 73.6k]
  ------------------
 5319|      0|        ppi->gf_group.update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (5319:9): [True: 0, False: 0]
  ------------------
 5320|      0|      memcpy(ppi->ref_frame_map_copy, cm->ref_frame_map,
 5321|      0|             sizeof(cm->ref_frame_map));
 5322|      0|    }
 5323|  73.6k|    av1_rc_postencode_update(cpi, cpi_data->frame_size);
 5324|  73.6k|  }
 5325|       |
 5326|  73.6k|  if (cpi_data->pop_lookahead == 1) {
  ------------------
  |  Branch (5326:7): [True: 73.6k, False: 0]
  ------------------
 5327|  73.6k|    av1_lookahead_pop(cpi->ppi->lookahead, cpi_data->flush,
 5328|  73.6k|                      cpi->compressor_stage);
 5329|  73.6k|  }
 5330|  73.6k|  if (cpi->common.show_frame) {
  ------------------
  |  Branch (5330:7): [True: 73.6k, False: 0]
  ------------------
 5331|  73.6k|    cpi->ppi->ts_start_last_show_frame = cpi_data->ts_frame_start;
 5332|  73.6k|    cpi->ppi->ts_end_last_show_frame = cpi_data->ts_frame_end;
 5333|  73.6k|  }
 5334|  73.6k|  if (ppi->level_params.keep_level_stats && !is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (5334:7): [True: 0, False: 73.6k]
  |  Branch (5334:45): [True: 0, False: 0]
  ------------------
 5335|       |    // Initialize level info. at the beginning of each sequence.
 5336|      0|    if (cm->current_frame.frame_type == KEY_FRAME &&
  ------------------
  |  Branch (5336:9): [True: 0, False: 0]
  ------------------
 5337|      0|        ppi->gf_group.refbuf_state[cpi->gf_frame_index] == REFBUF_RESET) {
  ------------------
  |  Branch (5337:9): [True: 0, False: 0]
  ------------------
 5338|      0|      av1_init_level_info(cpi);
 5339|      0|    }
 5340|      0|    av1_update_level_info(cpi, cpi_data->frame_size, cpi_data->ts_frame_start,
 5341|      0|                          cpi_data->ts_frame_end);
 5342|      0|  }
 5343|       |
 5344|  73.6k|  if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (5344:7): [True: 73.6k, False: 0]
  ------------------
 5345|  73.6k|#if !CONFIG_REALTIME_ONLY
 5346|  73.6k|    if (!has_no_stats_stage(cpi)) av1_twopass_postencode_update(cpi);
  ------------------
  |  Branch (5346:9): [True: 0, False: 73.6k]
  ------------------
 5347|  73.6k|#endif
 5348|  73.6k|    update_fb_of_context_type(cpi, ppi->fb_of_context_type);
 5349|  73.6k|    update_rc_counts(cpi);
 5350|  73.6k|    update_end_of_frame_stats(cpi);
 5351|  73.6k|  }
 5352|       |
 5353|       |#if CONFIG_THREE_PASS
 5354|       |  if (cpi->oxcf.pass == AOM_RC_THIRD_PASS && cpi->third_pass_ctx) {
 5355|       |    av1_pop_third_pass_info(cpi->third_pass_ctx);
 5356|       |  }
 5357|       |#endif
 5358|       |
 5359|  73.6k|  if (ppi->rtc_ref.set_ref_frame_config && !cpi->is_dropped_frame) {
  ------------------
  |  Branch (5359:7): [True: 0, False: 73.6k]
  |  Branch (5359:44): [True: 0, False: 0]
  ------------------
 5360|      0|    av1_svc_update_buffer_slot_refreshed(cpi);
 5361|      0|    av1_svc_set_reference_was_previous(cpi);
 5362|      0|  }
 5363|       |
 5364|  73.6k|  if (ppi->use_svc) av1_save_layer_context(cpi);
  ------------------
  |  Branch (5364:7): [True: 0, False: 73.6k]
  ------------------
 5365|       |
 5366|       |  // Note *size = 0 indicates a dropped frame for which psnr is not calculated
 5367|  73.6k|  if (ppi->b_calculate_psnr && cpi_data->frame_size > 0) {
  ------------------
  |  Branch (5367:7): [True: 0, False: 73.6k]
  |  Branch (5367:32): [True: 0, False: 0]
  ------------------
 5368|      0|    if (cm->show_existing_frame ||
  ------------------
  |  Branch (5368:9): [True: 0, False: 0]
  ------------------
 5369|      0|        (!is_stat_generation_stage(cpi) && cm->show_frame)) {
  ------------------
  |  Branch (5369:10): [True: 0, False: 0]
  |  Branch (5369:44): [True: 0, False: 0]
  ------------------
 5370|      0|      generate_psnr_packet(cpi);
 5371|      0|    }
 5372|      0|  }
 5373|       |
 5374|       |#if CONFIG_INTERNAL_STATS
 5375|       |  if (!is_stat_generation_stage(cpi)) {
 5376|       |    compute_internal_stats(cpi, (int)cpi_data->frame_size);
 5377|       |  }
 5378|       |#endif  // CONFIG_INTERNAL_STATS
 5379|       |
 5380|       |#if CONFIG_THREE_PASS
 5381|       |  // Write frame info. Subtract 1 from frame index since if was incremented in
 5382|       |  // update_rc_counts.
 5383|       |  av1_write_second_pass_per_frame_info(cpi, cpi->gf_frame_index - 1);
 5384|       |#endif
 5385|  73.6k|}
av1_get_compressed_data:
 5387|  92.0k|int av1_get_compressed_data(AV1_COMP *cpi, AV1_COMP_DATA *const cpi_data) {
 5388|  92.0k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 5389|  92.0k|  AV1_COMMON *const cm = &cpi->common;
 5390|       |
 5391|       |  // The jmp_buf is valid only for the duration of the function that calls
 5392|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 5393|       |  // before it returns.
 5394|  92.0k|  if (setjmp(cm->error->jmp)) {
  ------------------
  |  Branch (5394:7): [True: 0, False: 92.0k]
  ------------------
 5395|      0|    cm->error->setjmp = 0;
 5396|      0|    return cm->error->error_code;
 5397|      0|  }
 5398|  92.0k|  cm->error->setjmp = 1;
 5399|       |
 5400|       |#if CONFIG_INTERNAL_STATS
 5401|       |  cpi->frame_recode_hits = 0;
 5402|       |  cpi->time_compress_data = 0;
 5403|       |  cpi->bytes = 0;
 5404|       |#endif
 5405|       |#if CONFIG_ENTROPY_STATS
 5406|       |  if (cpi->compressor_stage == ENCODE_STAGE) {
 5407|       |    av1_zero(cpi->counts);
 5408|       |  }
 5409|       |#endif
 5410|       |
 5411|       |#if CONFIG_BITSTREAM_DEBUG
 5412|       |  assert(cpi->oxcf.max_threads <= 1 &&
 5413|       |         "bitstream debug tool does not support multithreading");
 5414|       |  bitstream_queue_record_write();
 5415|       |
 5416|       |  if (cm->seq_params->order_hint_info.enable_order_hint) {
 5417|       |    aom_bitstream_queue_set_frame_write(cm->current_frame.order_hint * 2 +
 5418|       |                                        cm->show_frame);
 5419|       |  } else {
 5420|       |    // This is currently used in RTC encoding. cm->show_frame is always 1.
 5421|       |    aom_bitstream_queue_set_frame_write(cm->current_frame.frame_number);
 5422|       |  }
 5423|       |#endif
 5424|  92.0k|  if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (5424:7): [True: 0, False: 92.0k]
  ------------------
 5425|      0|    av1_one_pass_cbr_svc_start_layer(cpi);
 5426|      0|  }
 5427|       |
 5428|  92.0k|  cpi->is_dropped_frame = false;
 5429|  92.0k|  cm->showable_frame = 0;
 5430|  92.0k|  cpi_data->frame_size = 0;
 5431|       |#if CONFIG_INTERNAL_STATS
 5432|       |  struct aom_usec_timer cmptimer;
 5433|       |  aom_usec_timer_start(&cmptimer);
 5434|       |#endif
 5435|  92.0k|  av1_set_high_precision_mv(cpi, 1, 0);
 5436|       |
 5437|       |  // Normal defaults
 5438|  92.0k|  cm->features.refresh_frame_context =
 5439|  92.0k|      oxcf->tool_cfg.frame_parallel_decoding_mode
  ------------------
  |  Branch (5439:7): [True: 0, False: 92.0k]
  ------------------
 5440|  92.0k|          ? REFRESH_FRAME_CONTEXT_DISABLED
 5441|  92.0k|          : REFRESH_FRAME_CONTEXT_BACKWARD;
 5442|  92.0k|  if (oxcf->tile_cfg.enable_large_scale_tile)
  ------------------
  |  Branch (5442:7): [True: 0, False: 92.0k]
  ------------------
 5443|      0|    cm->features.refresh_frame_context = REFRESH_FRAME_CONTEXT_DISABLED;
 5444|       |
 5445|  92.0k|  if (assign_cur_frame_new_fb(cm) == NULL) {
  ------------------
  |  Branch (5445:7): [True: 0, False: 92.0k]
  ------------------
 5446|      0|    aom_internal_error(cpi->common.error, AOM_CODEC_ERROR,
 5447|      0|                       "Failed to allocate new cur_frame");
 5448|      0|  }
 5449|       |
 5450|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5451|       |  // Accumulate 2nd pass time in 2-pass case or 1 pass time in 1-pass case.
 5452|       |  if (cpi->oxcf.pass == 2 || cpi->oxcf.pass == 0)
 5453|       |    start_timing(cpi, av1_encode_strategy_time);
 5454|       |#endif
 5455|       |
 5456|  92.0k|  const int result = av1_encode_strategy(
 5457|  92.0k|      cpi, &cpi_data->frame_size, cpi_data->cx_data, cpi_data->cx_data_sz,
 5458|  92.0k|      &cpi_data->lib_flags, &cpi_data->ts_frame_start, &cpi_data->ts_frame_end,
 5459|  92.0k|      cpi_data->timestamp_ratio, &cpi_data->pop_lookahead, cpi_data->flush);
 5460|       |
 5461|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5462|       |  if (cpi->oxcf.pass == 2 || cpi->oxcf.pass == 0)
 5463|       |    end_timing(cpi, av1_encode_strategy_time);
 5464|       |
 5465|       |  // Print out timing information.
 5466|       |  // Note: Use "cpi->frame_component_time[0] > 100 us" to avoid showing of
 5467|       |  // show_existing_frame and lag-in-frames.
 5468|       |  if ((cpi->oxcf.pass == 2 || cpi->oxcf.pass == 0) &&
 5469|       |      cpi->frame_component_time[0] > 100) {
 5470|       |    int i;
 5471|       |    uint64_t frame_total = 0, total = 0;
 5472|       |    const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 5473|       |    FRAME_UPDATE_TYPE frame_update_type =
 5474|       |        get_frame_update_type(gf_group, cpi->gf_frame_index);
 5475|       |
 5476|       |    fprintf(stderr,
 5477|       |            "\n Frame number: %d, Frame type: %s, Show Frame: %d, Frame Update "
 5478|       |            "Type: %d, Q: %d\n",
 5479|       |            cm->current_frame.frame_number,
 5480|       |            get_frame_type_enum(cm->current_frame.frame_type), cm->show_frame,
 5481|       |            frame_update_type, cm->quant_params.base_qindex);
 5482|       |    for (i = 0; i < kTimingComponents; i++) {
 5483|       |      cpi->component_time[i] += cpi->frame_component_time[i];
 5484|       |      // Use av1_encode_strategy_time (i = 0) as the total time.
 5485|       |      if (i == 0) {
 5486|       |        frame_total = cpi->frame_component_time[0];
 5487|       |        total = cpi->component_time[0];
 5488|       |      }
 5489|       |      fprintf(stderr,
 5490|       |              " %50s:  %15" PRId64 " us [%6.2f%%] (total: %15" PRId64
 5491|       |              " us [%6.2f%%])\n",
 5492|       |              get_component_name(i), cpi->frame_component_time[i],
 5493|       |              (float)((float)cpi->frame_component_time[i] * 100.0 /
 5494|       |                      (float)frame_total),
 5495|       |              cpi->component_time[i],
 5496|       |              (float)((float)cpi->component_time[i] * 100.0 / (float)total));
 5497|       |      cpi->frame_component_time[i] = 0;
 5498|       |    }
 5499|       |  }
 5500|       |#endif
 5501|       |
 5502|       |  // Reset the flag to 0 afer encoding.
 5503|  92.0k|  cpi->rc.use_external_qp_one_pass = 0;
 5504|       |
 5505|  92.0k|  if (result == -1) {
  ------------------
  |  Branch (5505:7): [True: 18.4k, False: 73.6k]
  ------------------
 5506|  18.4k|    cm->error->setjmp = 0;
 5507|       |    // Returning -1 indicates no frame encoded; more input is required
 5508|  18.4k|    return -1;
 5509|  18.4k|  }
 5510|  73.6k|  if (result != AOM_CODEC_OK) {
  ------------------
  |  Branch (5510:7): [True: 0, False: 73.6k]
  ------------------
 5511|      0|    aom_internal_error(cpi->common.error, AOM_CODEC_ERROR,
 5512|      0|                       "Failed to encode frame");
 5513|      0|  }
 5514|       |#if CONFIG_INTERNAL_STATS
 5515|       |  aom_usec_timer_mark(&cmptimer);
 5516|       |  cpi->time_compress_data += aom_usec_timer_elapsed(&cmptimer);
 5517|       |#endif  // CONFIG_INTERNAL_STATS
 5518|       |
 5519|       |#if CONFIG_SPEED_STATS
 5520|       |  if (!is_stat_generation_stage(cpi) && !cm->show_existing_frame) {
 5521|       |    cpi->tx_search_count += cpi->td.mb.txfm_search_info.tx_search_count;
 5522|       |    cpi->td.mb.txfm_search_info.tx_search_count = 0;
 5523|       |  }
 5524|       |#endif  // CONFIG_SPEED_STATS
 5525|       |
 5526|  73.6k|  cm->error->setjmp = 0;
 5527|  73.6k|  return AOM_CODEC_OK;
 5528|  92.0k|}
av1_init_sc_decisions:
 5599|  18.4k|void av1_init_sc_decisions(AV1_PRIMARY *const ppi) {
 5600|  18.4k|  AV1_COMP *const first_cpi = ppi->cpi;
 5601|  18.4k|  for (int i = 1; i < ppi->num_fp_contexts; ++i) {
  ------------------
  |  Branch (5601:19): [True: 0, False: 18.4k]
  ------------------
 5602|      0|    AV1_COMP *cur_cpi = ppi->parallel_cpi[i];
 5603|      0|    cur_cpi->common.features.allow_screen_content_tools =
 5604|      0|        first_cpi->common.features.allow_screen_content_tools;
 5605|      0|    cur_cpi->common.features.allow_intrabc =
 5606|      0|        first_cpi->common.features.allow_intrabc;
 5607|      0|    cur_cpi->use_screen_content_tools = first_cpi->use_screen_content_tools;
 5608|      0|    cur_cpi->is_screen_content_type = first_cpi->is_screen_content_type;
 5609|      0|  }
 5610|  18.4k|}
av1_set_internal_size:
 5874|  55.2k|                          AOM_SCALING_MODE vert_mode) {
 5875|  55.2k|  int hr = 0, hs = 0, vr = 0, vs = 0;
 5876|       |
 5877|       |  // Checks for invalid AOM_SCALING_MODE values.
 5878|  55.2k|  if (horiz_mode > AOME_ONETHREE || vert_mode > AOME_ONETHREE) return -1;
  ------------------
  |  Branch (5878:7): [True: 0, False: 55.2k]
  |  Branch (5878:37): [True: 0, False: 55.2k]
  ------------------
 5879|       |
 5880|  55.2k|  Scale2Ratio(horiz_mode, &hr, &hs);
 5881|  55.2k|  Scale2Ratio(vert_mode, &vr, &vs);
 5882|       |
 5883|       |  // always go to the next whole number
 5884|  55.2k|  resize_pending_params->width = (hs - 1 + oxcf->frm_dim_cfg.width * hr) / hs;
 5885|  55.2k|  resize_pending_params->height = (vs - 1 + oxcf->frm_dim_cfg.height * vr) / vs;
 5886|       |
 5887|  55.2k|  if (horiz_mode != AOME_NORMAL || vert_mode != AOME_NORMAL) {
  ------------------
  |  Branch (5887:7): [True: 55.2k, False: 0]
  |  Branch (5887:36): [True: 0, False: 0]
  ------------------
 5888|  55.2k|    oxcf->resize_cfg.resize_mode = RESIZE_FIXED;
 5889|  55.2k|    oxcf->algo_cfg.enable_tpl_model = 0;
 5890|  55.2k|  }
 5891|  55.2k|  return 0;
 5892|  55.2k|}
av1_apply_encoding_flags:
 5991|   165k|void av1_apply_encoding_flags(AV1_COMP *cpi, aom_enc_frame_flags_t flags) {
 5992|       |  // TODO(yunqingwang): For what references to use, external encoding flags
 5993|       |  // should be consistent with internal reference frame selection. Need to
 5994|       |  // ensure that there is not conflict between the two. In AV1 encoder, the
 5995|       |  // priority rank for 7 reference frames are: LAST, ALTREF, LAST2, LAST3,
 5996|       |  // GOLDEN, BWDREF, ALTREF2.
 5997|       |
 5998|   165k|  ExternalFlags *const ext_flags = &cpi->ext_flags;
 5999|   165k|  ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags =
 6000|   165k|      &ext_flags->refresh_frame;
 6001|   165k|  ext_flags->ref_frame_flags = AOM_REFFRAME_ALL;
 6002|   165k|  if (flags &
  ------------------
  |  Branch (6002:7): [True: 110k, False: 55.2k]
  ------------------
 6003|   165k|      (AOM_EFLAG_NO_REF_LAST | AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
  ------------------
  |  |   73|   165k|#define AOM_EFLAG_NO_REF_LAST (1 << 16)
  ------------------
                    (AOM_EFLAG_NO_REF_LAST | AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
  ------------------
  |  |   80|   165k|#define AOM_EFLAG_NO_REF_LAST2 (1 << 17)
  ------------------
                    (AOM_EFLAG_NO_REF_LAST | AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
  ------------------
  |  |   87|   165k|#define AOM_EFLAG_NO_REF_LAST3 (1 << 18)
  ------------------
 6004|   165k|       AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD |
  ------------------
  |  |   94|   165k|#define AOM_EFLAG_NO_REF_GF (1 << 19)
  ------------------
                     AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD |
  ------------------
  |  |  102|   165k|#define AOM_EFLAG_NO_REF_ARF (1 << 20)
  ------------------
                     AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD |
  ------------------
  |  |  109|   165k|#define AOM_EFLAG_NO_REF_BWD (1 << 21)
  ------------------
 6005|   165k|       AOM_EFLAG_NO_REF_ARF2)) {
  ------------------
  |  |  116|   165k|#define AOM_EFLAG_NO_REF_ARF2 (1 << 22)
  ------------------
 6006|   110k|    int ref = AOM_REFFRAME_ALL;
 6007|       |
 6008|   110k|    if (flags & AOM_EFLAG_NO_REF_LAST) ref ^= AOM_LAST_FLAG;
  ------------------
  |  |   73|   110k|#define AOM_EFLAG_NO_REF_LAST (1 << 16)
  ------------------
  |  Branch (6008:9): [True: 0, False: 110k]
  ------------------
 6009|   110k|    if (flags & AOM_EFLAG_NO_REF_LAST2) ref ^= AOM_LAST2_FLAG;
  ------------------
  |  |   80|   110k|#define AOM_EFLAG_NO_REF_LAST2 (1 << 17)
  ------------------
  |  Branch (6009:9): [True: 0, False: 110k]
  ------------------
 6010|   110k|    if (flags & AOM_EFLAG_NO_REF_LAST3) ref ^= AOM_LAST3_FLAG;
  ------------------
  |  |   87|   110k|#define AOM_EFLAG_NO_REF_LAST3 (1 << 18)
  ------------------
  |  Branch (6010:9): [True: 0, False: 110k]
  ------------------
 6011|       |
 6012|   110k|    if (flags & AOM_EFLAG_NO_REF_GF) ref ^= AOM_GOLD_FLAG;
  ------------------
  |  |   94|   110k|#define AOM_EFLAG_NO_REF_GF (1 << 19)
  ------------------
  |  Branch (6012:9): [True: 110k, False: 0]
  ------------------
 6013|       |
 6014|   110k|    if (flags & AOM_EFLAG_NO_REF_ARF) {
  ------------------
  |  |  102|   110k|#define AOM_EFLAG_NO_REF_ARF (1 << 20)
  ------------------
  |  Branch (6014:9): [True: 110k, False: 0]
  ------------------
 6015|   110k|      ref ^= AOM_ALT_FLAG;
 6016|   110k|      ref ^= AOM_BWD_FLAG;
 6017|   110k|      ref ^= AOM_ALT2_FLAG;
 6018|   110k|    } else {
 6019|      0|      if (flags & AOM_EFLAG_NO_REF_BWD) ref ^= AOM_BWD_FLAG;
  ------------------
  |  |  109|      0|#define AOM_EFLAG_NO_REF_BWD (1 << 21)
  ------------------
  |  Branch (6019:11): [True: 0, False: 0]
  ------------------
 6020|      0|      if (flags & AOM_EFLAG_NO_REF_ARF2) ref ^= AOM_ALT2_FLAG;
  ------------------
  |  |  116|      0|#define AOM_EFLAG_NO_REF_ARF2 (1 << 22)
  ------------------
  |  Branch (6020:11): [True: 0, False: 0]
  ------------------
 6021|      0|    }
 6022|       |
 6023|   110k|    av1_use_as_reference(&ext_flags->ref_frame_flags, ref);
 6024|   110k|  } else {
 6025|  55.2k|    if (cpi->ppi->rtc_ref.set_ref_frame_config) {
  ------------------
  |  Branch (6025:9): [True: 0, False: 55.2k]
  ------------------
 6026|      0|      int ref = rtc_set_references_external_ref_frame_config(cpi);
 6027|      0|      av1_use_as_reference(&ext_flags->ref_frame_flags, ref);
 6028|      0|    }
 6029|  55.2k|  }
 6030|       |
 6031|   165k|  if (flags &
  ------------------
  |  Branch (6031:7): [True: 110k, False: 55.2k]
  ------------------
 6032|   165k|      (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
  ------------------
  |  |  123|   165k|#define AOM_EFLAG_NO_UPD_LAST (1 << 23)
  ------------------
                    (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
  ------------------
  |  |  130|   165k|#define AOM_EFLAG_NO_UPD_GF (1 << 24)
  ------------------
                    (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
  ------------------
  |  |  137|   165k|#define AOM_EFLAG_NO_UPD_ARF (1 << 25)
  ------------------
 6033|   110k|    int upd = AOM_REFFRAME_ALL;
 6034|       |
 6035|       |    // Refreshing LAST/LAST2/LAST3 is handled by 1 common flag.
 6036|   110k|    if (flags & AOM_EFLAG_NO_UPD_LAST) upd ^= AOM_LAST_FLAG;
  ------------------
  |  |  123|   110k|#define AOM_EFLAG_NO_UPD_LAST (1 << 23)
  ------------------
  |  Branch (6036:9): [True: 0, False: 110k]
  ------------------
 6037|       |
 6038|   110k|    if (flags & AOM_EFLAG_NO_UPD_GF) upd ^= AOM_GOLD_FLAG;
  ------------------
  |  |  130|   110k|#define AOM_EFLAG_NO_UPD_GF (1 << 24)
  ------------------
  |  Branch (6038:9): [True: 110k, False: 0]
  ------------------
 6039|       |
 6040|   110k|    if (flags & AOM_EFLAG_NO_UPD_ARF) {
  ------------------
  |  |  137|   110k|#define AOM_EFLAG_NO_UPD_ARF (1 << 25)
  ------------------
  |  Branch (6040:9): [True: 110k, False: 0]
  ------------------
 6041|   110k|      upd ^= AOM_ALT_FLAG;
 6042|   110k|      upd ^= AOM_BWD_FLAG;
 6043|   110k|      upd ^= AOM_ALT2_FLAG;
 6044|   110k|    }
 6045|       |
 6046|   110k|    ext_refresh_frame_flags->last_frame = (upd & AOM_LAST_FLAG) != 0;
 6047|   110k|    ext_refresh_frame_flags->golden_frame = (upd & AOM_GOLD_FLAG) != 0;
 6048|   110k|    ext_refresh_frame_flags->alt_ref_frame = (upd & AOM_ALT_FLAG) != 0;
 6049|   110k|    ext_refresh_frame_flags->bwd_ref_frame = (upd & AOM_BWD_FLAG) != 0;
 6050|   110k|    ext_refresh_frame_flags->alt2_ref_frame = (upd & AOM_ALT2_FLAG) != 0;
 6051|   110k|    ext_refresh_frame_flags->update_pending = 1;
 6052|   110k|  } else {
 6053|  55.2k|    if (cpi->ppi->rtc_ref.set_ref_frame_config)
  ------------------
  |  Branch (6053:9): [True: 0, False: 55.2k]
  ------------------
 6054|      0|      rtc_set_updates_ref_frame_config(ext_refresh_frame_flags,
 6055|      0|                                       &cpi->ppi->rtc_ref);
 6056|  55.2k|    else
 6057|  55.2k|      ext_refresh_frame_flags->update_pending = 0;
 6058|  55.2k|  }
 6059|       |
 6060|   165k|  ext_flags->use_ref_frame_mvs = cpi->oxcf.tool_cfg.enable_ref_frame_mvs &
 6061|   165k|                                 ((flags & AOM_EFLAG_NO_REF_FRAME_MVS) == 0);
  ------------------
  |  |  149|   165k|#define AOM_EFLAG_NO_REF_FRAME_MVS (1 << 27)
  ------------------
 6062|   165k|  ext_flags->use_error_resilient = cpi->oxcf.tool_cfg.error_resilient_mode |
 6063|   165k|                                   ((flags & AOM_EFLAG_ERROR_RESILIENT) != 0);
  ------------------
  |  |  155|   165k|#define AOM_EFLAG_ERROR_RESILIENT (1 << 28)
  ------------------
 6064|   165k|  ext_flags->use_s_frame =
 6065|   165k|      cpi->oxcf.kf_cfg.enable_sframe | ((flags & AOM_EFLAG_SET_S_FRAME) != 0);
  ------------------
  |  |  161|   165k|#define AOM_EFLAG_SET_S_FRAME (1 << 29)
  ------------------
 6066|   165k|  ext_flags->use_primary_ref_none =
 6067|   165k|      (flags & AOM_EFLAG_SET_PRIMARY_REF_NONE) != 0;
  ------------------
  |  |  167|   165k|#define AOM_EFLAG_SET_PRIMARY_REF_NONE (1 << 30)
  ------------------
 6068|       |
 6069|   165k|  if (flags & AOM_EFLAG_NO_UPD_ENTROPY) {
  ------------------
  |  |  143|   165k|#define AOM_EFLAG_NO_UPD_ENTROPY (1 << 26)
  ------------------
  |  Branch (6069:7): [True: 0, False: 165k]
  ------------------
 6070|      0|    update_entropy(&ext_flags->refresh_frame_context,
 6071|      0|                   &ext_flags->refresh_frame_context_pending, 0);
 6072|      0|  }
 6073|   165k|}
encoder.c:set_tile_info:
  371|   219k|                          const TileConfig *const tile_cfg) {
  372|   219k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  373|   219k|  const SequenceHeader *const seq_params = cm->seq_params;
  374|   219k|  CommonTileParams *const tiles = &cm->tiles;
  375|   219k|  int i, start_sb;
  376|       |
  377|   219k|  av1_get_tile_limits(cm);
  378|       |
  379|   219k|  int sb_cols =
  380|   219k|      CEIL_POWER_OF_TWO(mi_params->mi_cols, seq_params->mib_size_log2);
  ------------------
  |  |   62|   219k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  381|       |  // configure tile columns
  382|   219k|  if (tile_cfg->tile_width_count == 0 || tile_cfg->tile_height_count == 0) {
  ------------------
  |  Branch (382:7): [True: 219k, False: 0]
  |  Branch (382:42): [True: 0, False: 0]
  ------------------
  383|   219k|    tiles->uniform_spacing = 1;
  384|   219k|    tiles->log2_cols = AOMMAX(tile_cfg->tile_columns, tiles->min_log2_cols);
  ------------------
  |  |   35|   219k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 143k, False: 75.2k]
  |  |  ------------------
  ------------------
  385|       |    // Add a special case to handle super resolution
  386|   219k|    sb_cols = coded_to_superres_mi(sb_cols, cm->superres_scale_denominator);
  387|   219k|    int min_log2_cols = 0;
  388|   219k|    for (; (tiles->max_width_sb << min_log2_cols) <= sb_cols; ++min_log2_cols) {
  ------------------
  |  Branch (388:12): [True: 0, False: 219k]
  ------------------
  389|      0|    }
  390|   219k|    tiles->log2_cols = AOMMAX(tiles->log2_cols, min_log2_cols);
  ------------------
  |  |   35|   219k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 143k, False: 75.2k]
  |  |  ------------------
  ------------------
  391|       |
  392|   219k|    tiles->log2_cols = AOMMIN(tiles->log2_cols, tiles->max_log2_cols);
  ------------------
  |  |   34|   219k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 19.8k, False: 199k]
  |  |  ------------------
  ------------------
  393|   219k|  } else if (tile_cfg->tile_widths[0] < 0) {
  ------------------
  |  Branch (393:14): [True: 0, False: 0]
  ------------------
  394|      0|    auto_tile_size_balancing(cm, sb_cols, tile_cfg->tile_columns, 1);
  395|      0|  } else {
  396|      0|    int size_sb, j = 0;
  397|      0|    tiles->uniform_spacing = 0;
  398|      0|    for (i = 0, start_sb = 0; start_sb < sb_cols && i < MAX_TILE_COLS; i++) {
  ------------------
  |  |   54|      0|#define MAX_TILE_COLS 64
  ------------------
  |  Branch (398:31): [True: 0, False: 0]
  |  Branch (398:53): [True: 0, False: 0]
  ------------------
  399|      0|      tiles->col_start_sb[i] = start_sb;
  400|      0|      size_sb = tile_cfg->tile_widths[j++];
  401|      0|      if (j >= tile_cfg->tile_width_count) j = 0;
  ------------------
  |  Branch (401:11): [True: 0, False: 0]
  ------------------
  402|      0|      start_sb += AOMMIN(size_sb, tiles->max_width_sb);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  403|      0|    }
  404|      0|    tiles->cols = i;
  405|      0|    tiles->col_start_sb[i] = sb_cols;
  406|      0|  }
  407|   219k|  av1_calculate_tile_cols(seq_params, mi_params->mi_rows, mi_params->mi_cols,
  408|   219k|                          tiles);
  409|       |
  410|       |  // configure tile rows
  411|   219k|  int sb_rows =
  412|   219k|      CEIL_POWER_OF_TWO(mi_params->mi_rows, seq_params->mib_size_log2);
  ------------------
  |  |   62|   219k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  413|   219k|  if (tiles->uniform_spacing) {
  ------------------
  |  Branch (413:7): [True: 219k, False: 0]
  ------------------
  414|   219k|    tiles->log2_rows = AOMMAX(tile_cfg->tile_rows, tiles->min_log2_rows);
  ------------------
  |  |   35|   219k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 158k, False: 60.5k]
  |  |  ------------------
  ------------------
  415|   219k|    tiles->log2_rows = AOMMIN(tiles->log2_rows, tiles->max_log2_rows);
  ------------------
  |  |   34|   219k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 16.5k, False: 202k]
  |  |  ------------------
  ------------------
  416|   219k|  } else if (tile_cfg->tile_heights[0] < 0) {
  ------------------
  |  Branch (416:14): [True: 0, False: 0]
  ------------------
  417|      0|    auto_tile_size_balancing(cm, sb_rows, tile_cfg->tile_rows, 0);
  418|      0|  } else {
  419|      0|    int size_sb, j = 0;
  420|      0|    for (i = 0, start_sb = 0; start_sb < sb_rows && i < MAX_TILE_ROWS; i++) {
  ------------------
  |  |   53|      0|#define MAX_TILE_ROWS 64
  ------------------
  |  Branch (420:31): [True: 0, False: 0]
  |  Branch (420:53): [True: 0, False: 0]
  ------------------
  421|      0|      tiles->row_start_sb[i] = start_sb;
  422|      0|      size_sb = tile_cfg->tile_heights[j++];
  423|      0|      if (j >= tile_cfg->tile_height_count) j = 0;
  ------------------
  |  Branch (423:11): [True: 0, False: 0]
  ------------------
  424|      0|      start_sb += AOMMIN(size_sb, tiles->max_height_sb);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  425|      0|    }
  426|      0|    tiles->rows = i;
  427|      0|    tiles->row_start_sb[i] = sb_rows;
  428|      0|  }
  429|   219k|  av1_calculate_tile_rows(seq_params, mi_params->mi_rows, tiles);
  430|   219k|}
encoder.c:init_seq_coding_tools:
  589|   155k|                                  int disable_frame_id_numbers) {
  590|   155k|  SequenceHeader *const seq = &ppi->seq_params;
  591|   155k|  const FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
  592|   155k|  const ToolCfg *const tool_cfg = &oxcf->tool_cfg;
  593|       |
  594|   155k|  seq->still_picture =
  595|   155k|      !tool_cfg->force_video_mode && (oxcf->input_cfg.limit == 1);
  ------------------
  |  Branch (595:7): [True: 155k, False: 0]
  |  Branch (595:38): [True: 0, False: 155k]
  ------------------
  596|   155k|  seq->reduced_still_picture_hdr =
  597|   155k|      seq->still_picture && !tool_cfg->full_still_picture_hdr;
  ------------------
  |  Branch (597:7): [True: 0, False: 155k]
  |  Branch (597:29): [True: 0, False: 0]
  ------------------
  598|   155k|  seq->force_screen_content_tools = 2;
  599|   155k|  seq->force_integer_mv = 2;
  600|   155k|  seq->order_hint_info.enable_order_hint = tool_cfg->enable_order_hint;
  601|   155k|  seq->frame_id_numbers_present_flag =
  602|   155k|      !seq->reduced_still_picture_hdr &&
  ------------------
  |  Branch (602:7): [True: 155k, False: 0]
  ------------------
  603|   155k|      !oxcf->tile_cfg.enable_large_scale_tile &&
  ------------------
  |  Branch (603:7): [True: 155k, False: 0]
  ------------------
  604|   155k|      tool_cfg->error_resilient_mode && !disable_frame_id_numbers;
  ------------------
  |  Branch (604:7): [True: 0, False: 155k]
  |  Branch (604:41): [True: 0, False: 0]
  ------------------
  605|   155k|  if (seq->reduced_still_picture_hdr) {
  ------------------
  |  Branch (605:7): [True: 0, False: 155k]
  ------------------
  606|      0|    seq->order_hint_info.enable_order_hint = 0;
  607|      0|    seq->force_screen_content_tools = 2;
  608|      0|    seq->force_integer_mv = 2;
  609|      0|  }
  610|   155k|  seq->order_hint_info.order_hint_bits_minus_1 =
  611|   155k|      seq->order_hint_info.enable_order_hint
  ------------------
  |  Branch (611:7): [True: 155k, False: 0]
  ------------------
  612|   155k|          ? DEFAULT_EXPLICIT_ORDER_HINT_BITS - 1
  ------------------
  |  |  100|   155k|#define DEFAULT_EXPLICIT_ORDER_HINT_BITS 7
  ------------------
  613|   155k|          : -1;
  614|       |
  615|   155k|  seq->max_frame_width = frm_dim_cfg->forced_max_frame_width
  ------------------
  |  Branch (615:26): [True: 0, False: 155k]
  ------------------
  616|   155k|                             ? frm_dim_cfg->forced_max_frame_width
  617|   155k|                             : AOMMAX(seq->max_frame_width, frm_dim_cfg->width);
  ------------------
  |  |   35|   311k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 155k]
  |  |  ------------------
  ------------------
  618|   155k|  seq->max_frame_height =
  619|   155k|      frm_dim_cfg->forced_max_frame_height
  ------------------
  |  Branch (619:7): [True: 0, False: 155k]
  ------------------
  620|   155k|          ? frm_dim_cfg->forced_max_frame_height
  621|   155k|          : AOMMAX(seq->max_frame_height, frm_dim_cfg->height);
  ------------------
  |  |   35|   311k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 155k]
  |  |  ------------------
  ------------------
  622|   155k|  seq->num_bits_width =
  623|   155k|      (seq->max_frame_width > 1) ? get_msb(seq->max_frame_width - 1) + 1 : 1;
  ------------------
  |  Branch (623:7): [True: 155k, False: 0]
  ------------------
  624|   155k|  seq->num_bits_height =
  625|   155k|      (seq->max_frame_height > 1) ? get_msb(seq->max_frame_height - 1) + 1 : 1;
  ------------------
  |  Branch (625:7): [True: 155k, False: 0]
  ------------------
  626|   155k|  assert(seq->num_bits_width <= 16);
  627|   155k|  assert(seq->num_bits_height <= 16);
  628|       |
  629|   155k|  seq->frame_id_length = FRAME_ID_LENGTH;
  ------------------
  |  |   59|   155k|#define FRAME_ID_LENGTH 15
  ------------------
  630|   155k|  seq->delta_frame_id_length = DELTA_FRAME_ID_LENGTH;
  ------------------
  |  |   60|   155k|#define DELTA_FRAME_ID_LENGTH 14
  ------------------
  631|       |
  632|   155k|  seq->enable_dual_filter = tool_cfg->enable_dual_filter;
  633|   155k|  seq->order_hint_info.enable_dist_wtd_comp =
  634|   155k|      oxcf->comp_type_cfg.enable_dist_wtd_comp;
  635|   155k|  seq->order_hint_info.enable_dist_wtd_comp &=
  636|   155k|      seq->order_hint_info.enable_order_hint;
  637|   155k|  seq->order_hint_info.enable_ref_frame_mvs = tool_cfg->ref_frame_mvs_present;
  638|   155k|  seq->order_hint_info.enable_ref_frame_mvs &=
  639|   155k|      seq->order_hint_info.enable_order_hint;
  640|   155k|  seq->enable_superres = oxcf->superres_cfg.enable_superres;
  641|   155k|  seq->enable_cdef = tool_cfg->cdef_control != CDEF_NONE ? 1 : 0;
  ------------------
  |  Branch (641:22): [True: 155k, False: 0]
  ------------------
  642|   155k|  seq->enable_restoration = tool_cfg->enable_restoration;
  643|   155k|  seq->enable_warped_motion = oxcf->motion_mode_cfg.enable_warped_motion;
  644|   155k|  seq->enable_interintra_compound = tool_cfg->enable_interintra_comp;
  645|   155k|  seq->enable_masked_compound = oxcf->comp_type_cfg.enable_masked_comp;
  646|   155k|  seq->enable_intra_edge_filter = oxcf->intra_mode_cfg.enable_intra_edge_filter;
  647|   155k|  seq->enable_filter_intra = oxcf->intra_mode_cfg.enable_filter_intra;
  648|       |
  649|   155k|  set_bitstream_level_tier(ppi, seq->max_frame_width, seq->max_frame_height,
  650|   155k|                           oxcf->input_cfg.init_framerate);
  651|   155k|  av1_set_svc_seq_params(ppi);
  652|   155k|}
encoder.c:set_bitstream_level_tier:
  465|   155k|                                     int height, double init_framerate) {
  466|   155k|  SequenceHeader *const seq_params = &ppi->seq_params;
  467|   155k|  const AV1LevelParams *const level_params = &ppi->level_params;
  468|       |  // TODO(any): This is a placeholder function that only addresses dimensions
  469|       |  // and max display sample rates.
  470|       |  // Need to add checks for max bit rate, max decoded luma sample rate, header
  471|       |  // rate, etc. that are not covered by this function.
  472|   155k|  AV1_LEVEL level = SEQ_LEVEL_MAX;
  473|   155k|  if (does_level_match(width, height, init_framerate, 512, 288, 30.0, 4)) {
  ------------------
  |  Branch (473:7): [True: 155k, False: 0]
  ------------------
  474|   155k|    level = SEQ_LEVEL_2_0;
  475|   155k|  } else if (does_level_match(width, height, init_framerate, 704, 396, 30.0,
  ------------------
  |  Branch (475:14): [True: 0, False: 0]
  ------------------
  476|      0|                              4)) {
  477|      0|    level = SEQ_LEVEL_2_1;
  478|      0|  } else if (does_level_match(width, height, init_framerate, 1088, 612, 30.0,
  ------------------
  |  Branch (478:14): [True: 0, False: 0]
  ------------------
  479|      0|                              4)) {
  480|      0|    level = SEQ_LEVEL_3_0;
  481|      0|  } else if (does_level_match(width, height, init_framerate, 1376, 774, 30.0,
  ------------------
  |  Branch (481:14): [True: 0, False: 0]
  ------------------
  482|      0|                              4)) {
  483|      0|    level = SEQ_LEVEL_3_1;
  484|      0|  } else if (does_level_match(width, height, init_framerate, 2048, 1152, 30.0,
  ------------------
  |  Branch (484:14): [True: 0, False: 0]
  ------------------
  485|      0|                              3)) {
  486|      0|    level = SEQ_LEVEL_4_0;
  487|      0|  } else if (does_level_match(width, height, init_framerate, 2048, 1152, 60.0,
  ------------------
  |  Branch (487:14): [True: 0, False: 0]
  ------------------
  488|      0|                              3)) {
  489|      0|    level = SEQ_LEVEL_4_1;
  490|      0|  } else if (does_level_match(width, height, init_framerate, 4096, 2176, 30.0,
  ------------------
  |  Branch (490:14): [True: 0, False: 0]
  ------------------
  491|      0|                              2)) {
  492|      0|    level = SEQ_LEVEL_5_0;
  493|      0|  } else if (does_level_match(width, height, init_framerate, 4096, 2176, 60.0,
  ------------------
  |  Branch (493:14): [True: 0, False: 0]
  ------------------
  494|      0|                              2)) {
  495|      0|    level = SEQ_LEVEL_5_1;
  496|      0|  } else if (does_level_match(width, height, init_framerate, 4096, 2176, 120.0,
  ------------------
  |  Branch (496:14): [True: 0, False: 0]
  ------------------
  497|      0|                              2)) {
  498|      0|    level = SEQ_LEVEL_5_2;
  499|      0|  } else if (does_level_match(width, height, init_framerate, 8192, 4352, 30.0,
  ------------------
  |  Branch (499:14): [True: 0, False: 0]
  ------------------
  500|      0|                              2)) {
  501|      0|    level = SEQ_LEVEL_6_0;
  502|      0|  } else if (does_level_match(width, height, init_framerate, 8192, 4352, 60.0,
  ------------------
  |  Branch (502:14): [True: 0, False: 0]
  ------------------
  503|      0|                              2)) {
  504|      0|    level = SEQ_LEVEL_6_1;
  505|      0|  } else if (does_level_match(width, height, init_framerate, 8192, 4352, 120.0,
  ------------------
  |  Branch (505:14): [True: 0, False: 0]
  ------------------
  506|      0|                              2)) {
  507|      0|    level = SEQ_LEVEL_6_2;
  508|      0|  }
  509|       |#if CONFIG_CWG_C013
  510|       |  // TODO(bohanli): currently target level is only working for the 0th operating
  511|       |  // point, so scalable coding is not supported.
  512|       |  else if (level_params->target_seq_level_idx[0] >= SEQ_LEVEL_7_0 &&
  513|       |           level_params->target_seq_level_idx[0] <= SEQ_LEVEL_8_3) {
  514|       |    // Only use level 7.x to 8.x when explicitly asked to.
  515|       |    if (does_level_match(width, height, init_framerate, 16384, 8704, 30.0, 2)) {
  516|       |      level = SEQ_LEVEL_7_0;
  517|       |    } else if (does_level_match(width, height, init_framerate, 16384, 8704,
  518|       |                                60.0, 2)) {
  519|       |      level = SEQ_LEVEL_7_1;
  520|       |    } else if (does_level_match(width, height, init_framerate, 16384, 8704,
  521|       |                                120.0, 2)) {
  522|       |      level = SEQ_LEVEL_7_2;
  523|       |    } else if (does_level_match(width, height, init_framerate, 32768, 17408,
  524|       |                                30.0, 2)) {
  525|       |      level = SEQ_LEVEL_8_0;
  526|       |    } else if (does_level_match(width, height, init_framerate, 32768, 17408,
  527|       |                                60.0, 2)) {
  528|       |      level = SEQ_LEVEL_8_1;
  529|       |    } else if (does_level_match(width, height, init_framerate, 32768, 17408,
  530|       |                                120.0, 2)) {
  531|       |      level = SEQ_LEVEL_8_2;
  532|       |    }
  533|       |  }
  534|       |#endif
  535|       |
  536|  5.14M|  for (int i = 0; i < MAX_NUM_OPERATING_POINTS; ++i) {
  ------------------
  |  |   76|  5.14M|  (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   70|  5.14M|#define MAX_NUM_TEMPORAL_LAYERS 8
  |  |  ------------------
  |  |                 (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
  |  |  ------------------
  |  |  |  |   71|  5.14M|#define MAX_NUM_SPATIAL_LAYERS 4
  |  |  ------------------
  ------------------
  |  Branch (536:19): [True: 4.98M, False: 155k]
  ------------------
  537|  4.98M|    assert(is_valid_seq_level_idx(level_params->target_seq_level_idx[i]) ||
  538|  4.98M|           level_params->target_seq_level_idx[i] == SEQ_LEVEL_KEEP_STATS);
  539|       |    // If a higher target level is specified, it is then used rather than the
  540|       |    // inferred one from resolution and framerate.
  541|  4.98M|    seq_params->seq_level_idx[i] =
  542|  4.98M|        level_params->target_seq_level_idx[i] < SEQ_LEVELS &&
  ------------------
  |  Branch (542:9): [True: 588k, False: 4.39M]
  ------------------
  543|   588k|                level_params->target_seq_level_idx[i] > level
  ------------------
  |  Branch (543:17): [True: 0, False: 588k]
  ------------------
  544|  4.98M|            ? level_params->target_seq_level_idx[i]
  545|  4.98M|            : level;
  546|       |    // Set the maximum parameters for bitrate and buffer size for this profile,
  547|       |    // level, and tier
  548|  4.98M|    seq_params->op_params[i].bitrate = av1_max_level_bitrate(
  549|  4.98M|        seq_params->profile, seq_params->seq_level_idx[i], seq_params->tier[i]);
  550|       |    // Level with seq_level_idx = 31 returns a high "dummy" bitrate to pass the
  551|       |    // check
  552|  4.98M|    if (seq_params->op_params[i].bitrate == 0)
  ------------------
  |  Branch (552:9): [True: 0, False: 4.98M]
  ------------------
  553|      0|      aom_internal_error(
  554|      0|          &ppi->error, AOM_CODEC_UNSUP_BITSTREAM,
  555|      0|          "AV1 does not support this combination of profile, level, and tier.");
  556|       |    // Buffer size in bits is bitrate in bits/s * 1 s
  557|  4.98M|    seq_params->op_params[i].buffer_size = seq_params->op_params[i].bitrate;
  558|  4.98M|  }
  559|   155k|}
encoder.c:does_level_match:
  453|   155k|                                   double lvl_fps, int lvl_dim_mult) {
  454|   155k|  const int64_t lvl_luma_pels = (int64_t)lvl_width * lvl_height;
  455|   155k|  const double lvl_display_sample_rate = lvl_luma_pels * lvl_fps;
  456|   155k|  const int64_t luma_pels = (int64_t)width * height;
  457|   155k|  const double display_sample_rate = luma_pels * fps;
  458|   155k|  return luma_pels <= lvl_luma_pels &&
  ------------------
  |  Branch (458:10): [True: 155k, False: 0]
  ------------------
  459|   155k|         display_sample_rate <= lvl_display_sample_rate &&
  ------------------
  |  Branch (459:10): [True: 155k, False: 0]
  ------------------
  460|   155k|         width <= lvl_width * lvl_dim_mult &&
  ------------------
  |  Branch (460:10): [True: 155k, False: 0]
  ------------------
  461|   155k|         height <= lvl_height * lvl_dim_mult;
  ------------------
  |  Branch (461:10): [True: 155k, False: 0]
  ------------------
  462|   155k|}
encoder.c:init_config_sequence:
  655|  18.4k|                                 const AV1EncoderConfig *oxcf) {
  656|  18.4k|  SequenceHeader *const seq_params = &ppi->seq_params;
  657|  18.4k|  const DecoderModelCfg *const dec_model_cfg = &oxcf->dec_model_cfg;
  658|  18.4k|  const ColorCfg *const color_cfg = &oxcf->color_cfg;
  659|       |
  660|  18.4k|  ppi->use_svc = 0;
  661|  18.4k|  ppi->number_spatial_layers = 1;
  662|  18.4k|  ppi->number_temporal_layers = 1;
  663|       |
  664|  18.4k|  seq_params->profile = oxcf->profile;
  665|  18.4k|  seq_params->bit_depth = oxcf->tool_cfg.bit_depth;
  666|  18.4k|  seq_params->use_highbitdepth = oxcf->use_highbitdepth;
  667|  18.4k|  seq_params->color_primaries = color_cfg->color_primaries;
  668|  18.4k|  seq_params->transfer_characteristics = color_cfg->transfer_characteristics;
  669|  18.4k|  seq_params->matrix_coefficients = color_cfg->matrix_coefficients;
  670|  18.4k|  seq_params->monochrome = oxcf->tool_cfg.enable_monochrome;
  671|  18.4k|  seq_params->chroma_sample_position = color_cfg->chroma_sample_position;
  672|  18.4k|  seq_params->color_range = color_cfg->color_range;
  673|  18.4k|  seq_params->timing_info_present = dec_model_cfg->timing_info_present;
  674|  18.4k|  seq_params->timing_info.num_units_in_display_tick =
  675|  18.4k|      dec_model_cfg->timing_info.num_units_in_display_tick;
  676|  18.4k|  seq_params->timing_info.time_scale = dec_model_cfg->timing_info.time_scale;
  677|  18.4k|  seq_params->timing_info.equal_picture_interval =
  678|  18.4k|      dec_model_cfg->timing_info.equal_picture_interval;
  679|  18.4k|  seq_params->timing_info.num_ticks_per_picture =
  680|  18.4k|      dec_model_cfg->timing_info.num_ticks_per_picture;
  681|       |
  682|  18.4k|  seq_params->display_model_info_present_flag =
  683|  18.4k|      dec_model_cfg->display_model_info_present_flag;
  684|  18.4k|  seq_params->decoder_model_info_present_flag =
  685|  18.4k|      dec_model_cfg->decoder_model_info_present_flag;
  686|  18.4k|  if (dec_model_cfg->decoder_model_info_present_flag) {
  ------------------
  |  Branch (686:7): [True: 0, False: 18.4k]
  ------------------
  687|       |    // set the decoder model parameters in schedule mode
  688|      0|    seq_params->decoder_model_info.num_units_in_decoding_tick =
  689|      0|        dec_model_cfg->num_units_in_decoding_tick;
  690|      0|    ppi->buffer_removal_time_present = 1;
  691|      0|    av1_set_aom_dec_model_info(&seq_params->decoder_model_info);
  692|      0|    av1_set_dec_model_op_parameters(&seq_params->op_params[0]);
  693|  18.4k|  } else if (seq_params->timing_info_present &&
  ------------------
  |  Branch (693:14): [True: 0, False: 18.4k]
  ------------------
  694|      0|             seq_params->timing_info.equal_picture_interval &&
  ------------------
  |  Branch (694:14): [True: 0, False: 0]
  ------------------
  695|      0|             !seq_params->decoder_model_info_present_flag) {
  ------------------
  |  Branch (695:14): [True: 0, False: 0]
  ------------------
  696|       |    // set the decoder model parameters in resource availability mode
  697|      0|    av1_set_resource_availability_parameters(&seq_params->op_params[0]);
  698|  18.4k|  } else {
  699|  18.4k|    seq_params->op_params[0].initial_display_delay =
  700|  18.4k|        10;  // Default value (not signaled)
  701|  18.4k|  }
  702|       |
  703|  18.4k|  if (seq_params->monochrome) {
  ------------------
  |  Branch (703:7): [True: 11.4k, False: 6.99k]
  ------------------
  704|  11.4k|    seq_params->subsampling_x = 1;
  705|  11.4k|    seq_params->subsampling_y = 1;
  706|  11.4k|  } else if (seq_params->color_primaries == AOM_CICP_CP_BT_709 &&
  ------------------
  |  Branch (706:14): [True: 0, False: 6.99k]
  ------------------
  707|      0|             seq_params->transfer_characteristics == AOM_CICP_TC_SRGB &&
  ------------------
  |  Branch (707:14): [True: 0, False: 0]
  ------------------
  708|      0|             seq_params->matrix_coefficients == AOM_CICP_MC_IDENTITY) {
  ------------------
  |  Branch (708:14): [True: 0, False: 0]
  ------------------
  709|      0|    seq_params->subsampling_x = 0;
  710|      0|    seq_params->subsampling_y = 0;
  711|  6.99k|  } else {
  712|  6.99k|    if (seq_params->profile == 0) {
  ------------------
  |  Branch (712:9): [True: 2.87k, False: 4.12k]
  ------------------
  713|  2.87k|      seq_params->subsampling_x = 1;
  714|  2.87k|      seq_params->subsampling_y = 1;
  715|  4.12k|    } else if (seq_params->profile == 1) {
  ------------------
  |  Branch (715:16): [True: 1.28k, False: 2.83k]
  ------------------
  716|  1.28k|      seq_params->subsampling_x = 0;
  717|  1.28k|      seq_params->subsampling_y = 0;
  718|  2.83k|    } else {
  719|  2.83k|      if (seq_params->bit_depth == AOM_BITS_12) {
  ------------------
  |  Branch (719:11): [True: 1.24k, False: 1.59k]
  ------------------
  720|  1.24k|        seq_params->subsampling_x = oxcf->input_cfg.chroma_subsampling_x;
  721|  1.24k|        seq_params->subsampling_y = oxcf->input_cfg.chroma_subsampling_y;
  722|  1.59k|      } else {
  723|  1.59k|        seq_params->subsampling_x = 1;
  724|  1.59k|        seq_params->subsampling_y = 0;
  725|  1.59k|      }
  726|  2.83k|    }
  727|  6.99k|  }
  728|       |  av1_change_config_seq(ppi, oxcf, NULL);
  729|  18.4k|}
encoder.c:init_config:
  731|  18.4k|static void init_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) {
  732|  18.4k|  AV1_COMMON *const cm = &cpi->common;
  733|  18.4k|  ResizePendingParams *resize_pending_params = &cpi->resize_pending_params;
  734|       |
  735|  18.4k|  cpi->oxcf = *oxcf;
  736|  18.4k|  cpi->framerate = oxcf->input_cfg.init_framerate;
  737|       |
  738|  18.4k|  cm->width = oxcf->frm_dim_cfg.width;
  739|  18.4k|  cm->height = oxcf->frm_dim_cfg.height;
  740|  18.4k|  cpi->is_dropped_frame = false;
  741|       |
  742|  18.4k|  alloc_compressor_data(cpi);
  743|       |
  744|  18.4k|  cpi->data_alloc_width = oxcf->frm_dim_cfg.forced_max_frame_width
  ------------------
  |  Branch (744:27): [True: 0, False: 18.4k]
  ------------------
  745|  18.4k|                              ? oxcf->frm_dim_cfg.forced_max_frame_width
  746|  18.4k|                              : cm->width;
  747|  18.4k|  cpi->data_alloc_height = oxcf->frm_dim_cfg.forced_max_frame_height
  ------------------
  |  Branch (747:28): [True: 0, False: 18.4k]
  ------------------
  748|  18.4k|                               ? oxcf->frm_dim_cfg.forced_max_frame_height
  749|  18.4k|                               : cm->height;
  750|  18.4k|  cpi->frame_size_related_setup_done = false;
  751|       |
  752|       |  // Single thread case: use counts in common.
  753|  18.4k|  cpi->td.counts = &cpi->counts;
  754|       |
  755|       |  // Init SVC parameters.
  756|  18.4k|  cpi->svc.number_spatial_layers = 1;
  757|  18.4k|  cpi->svc.number_temporal_layers = 1;
  758|  18.4k|  cm->spatial_layer_id = 0;
  759|  18.4k|  cm->temporal_layer_id = 0;
  760|  18.4k|  cpi->src_sad_blk_alloc_size = 0;
  761|       |  // Init rtc_ref parameters.
  762|  18.4k|  cpi->ppi->rtc_ref.set_ref_frame_config = 0;
  763|  18.4k|  cpi->ppi->rtc_ref.non_reference_frame = 0;
  764|  18.4k|  cpi->ppi->rtc_ref.ref_frame_comp[0] = 0;
  765|  18.4k|  cpi->ppi->rtc_ref.ref_frame_comp[1] = 0;
  766|  18.4k|  cpi->ppi->rtc_ref.ref_frame_comp[2] = 0;
  767|       |
  768|       |  // change includes all joint functionality
  769|  18.4k|  av1_change_config(cpi, oxcf, false);
  770|       |
  771|  18.4k|  cpi->ref_frame_flags = 0;
  772|       |
  773|       |  // Reset resize pending flags
  774|  18.4k|  resize_pending_params->width = 0;
  775|  18.4k|  resize_pending_params->height = 0;
  776|       |
  777|       |  // Setup identity scale factor
  778|  18.4k|  av1_setup_scale_factors_for_frame(&cm->sf_identity, 1, 1, 1, 1);
  779|       |
  780|  18.4k|  init_buffer_indices(&cpi->force_intpel_info, cm->remapped_ref_idx);
  781|       |
  782|  18.4k|  av1_noise_estimate_init(&cpi->noise_estimate, cm->width, cm->height);
  783|  18.4k|}
encoder.c:init_frame_info:
 1111|  18.4k|                                   const AV1_COMMON *const cm) {
 1112|  18.4k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1113|  18.4k|  const SequenceHeader *const seq_params = cm->seq_params;
 1114|  18.4k|  frame_info->frame_width = cm->width;
 1115|  18.4k|  frame_info->frame_height = cm->height;
 1116|  18.4k|  frame_info->mi_cols = mi_params->mi_cols;
 1117|  18.4k|  frame_info->mi_rows = mi_params->mi_rows;
 1118|  18.4k|  frame_info->mb_cols = mi_params->mb_cols;
 1119|  18.4k|  frame_info->mb_rows = mi_params->mb_rows;
 1120|  18.4k|  frame_info->num_mbs = mi_params->MBs;
 1121|  18.4k|  frame_info->bit_depth = seq_params->bit_depth;
 1122|  18.4k|  frame_info->subsampling_x = seq_params->subsampling_x;
 1123|  18.4k|  frame_info->subsampling_y = seq_params->subsampling_y;
 1124|  18.4k|}
encoder.c:init_frame_index_set:
 1126|  18.4k|static inline void init_frame_index_set(FRAME_INDEX_SET *frame_index_set) {
 1127|  18.4k|  frame_index_set->show_frame_count = 0;
 1128|  18.4k|}
encoder.c:estimate_screen_content_antialiasing_aware:
 2238|  8.61k|                                                       FeatureFlags *features) {
 2239|  8.61k|  enum {
 2240|  8.61k|    kBlockWidth = 16,
 2241|  8.61k|    kBlockHeight = 16,
 2242|  8.61k|    kBlockArea = kBlockWidth * kBlockHeight
 2243|  8.61k|  };
 2244|       |
 2245|  8.61k|  const bool fast_detection =
 2246|  8.61k|      cpi->sf.hl_sf.screen_detection_mode2_fast_detection;
 2247|  8.61k|  const AV1_COMMON *const cm = &cpi->common;
 2248|  8.61k|  const MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 2249|  8.61k|  const uint8_t *src = cpi->unfiltered_source->y_buffer;
 2250|  8.61k|  assert(src != NULL);
 2251|  8.61k|  const int use_hbd = cpi->unfiltered_source->flags & YV12_FLAG_HIGHBITDEPTH;
  ------------------
  |  |  142|  8.61k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 2252|  8.61k|  const int stride = cpi->unfiltered_source->y_stride;
 2253|  8.61k|  const int width = cpi->unfiltered_source->y_width;
 2254|  8.61k|  const int height = cpi->unfiltered_source->y_height;
 2255|  8.61k|  const int64_t area = (int64_t)width * height;
 2256|  8.61k|  const int bd = cm->seq_params->bit_depth;
 2257|       |  // Holds the down-converted block to 8 bit (if source is HBD)
 2258|  8.61k|  uint8_t downconv_blk[kBlockArea];
 2259|       |  // Holds the block after a round of dilation
 2260|  8.61k|  uint8_t dilated_blk[kBlockArea];
 2261|       |
 2262|       |  // These threshold values are selected experimentally
 2263|       |  // Detects text and glyphs without anti-aliasing, and graphics with a 4-color
 2264|       |  // palette
 2265|  8.61k|  const int kSimpleColorThresh = 4;
 2266|       |  // Detects potential text and glyphs with anti-aliasing, and graphics with a
 2267|       |  // more extended color palette
 2268|  8.61k|  const int kComplexInitialColorThresh = 40;
 2269|       |  // Detects text and glyphs with anti-aliasing, and graphics with a more
 2270|       |  // extended color palette
 2271|  8.61k|  const int kComplexFinalColorThresh = 6;
 2272|       |  // Threshold used to classify low-variance and high-variance blocks
 2273|  8.61k|  const int kVarThresh = 5;
 2274|       |  // Count of blocks that are candidates for using palette mode
 2275|  8.61k|  int64_t count_palette = 0;
 2276|       |  // Count of blocks that are candidates for using IntraBC
 2277|  8.61k|  int64_t count_intrabc = 0;
 2278|       |  // Count of "photo-like" blocks (i.e. can't use palette mode or IntraBC)
 2279|  8.61k|  int64_t count_photo = 0;
 2280|       |
 2281|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2282|       |  FILE *stats_file;
 2283|       |  stats_file = fopen("scrdetm2.stt", "a");
 2284|       |
 2285|       |  fprintf(stats_file, "\n");
 2286|       |  fprintf(stats_file, "Screen detection mode 2 image map legend\n");
 2287|       |  if (fast_detection) {
 2288|       |    fprintf(stats_file, "Fast detection enabled\n");
 2289|       |  }
 2290|       |  fprintf(stats_file,
 2291|       |          "-------------------------------------------------------\n");
 2292|       |  fprintf(stats_file,
 2293|       |          "S: simple block, high var    C: complex block, high var\n");
 2294|       |  fprintf(stats_file,
 2295|       |          "-: simple block, low var     =: complex block, low var \n");
 2296|       |  fprintf(stats_file,
 2297|       |          "x: photo-like block          .: non-palettizable block \n");
 2298|       |  fprintf(stats_file,
 2299|       |          "(whitespace): solid block                              \n");
 2300|       |  fprintf(stats_file,
 2301|       |          "-------------------------------------------------------\n");
 2302|       |#endif
 2303|       |
 2304|       |  // Skip every other block and weigh each block twice as much when performing
 2305|       |  // fast detection
 2306|  8.61k|  const int multiplier = fast_detection ? 2 : 1;
  ------------------
  |  Branch (2306:26): [True: 0, False: 8.61k]
  ------------------
 2307|       |
 2308|  35.0k|  for (int r = 0; r + kBlockHeight <= height; r += kBlockHeight) {
  ------------------
  |  Branch (2308:19): [True: 26.4k, False: 8.61k]
  ------------------
 2309|       |    // Alternate skipping in a "checkerboard" pattern when performing fast
 2310|       |    // detection
 2311|  26.4k|    const int initial_col =
 2312|  26.4k|        (fast_detection && (r / kBlockHeight) % 2) ? kBlockWidth : 0;
  ------------------
  |  Branch (2312:10): [True: 0, False: 26.4k]
  |  Branch (2312:28): [True: 0, False: 0]
  ------------------
 2313|       |
 2314|   142k|    for (int c = initial_col; c + kBlockWidth <= width;
  ------------------
  |  Branch (2314:31): [True: 116k, False: 26.4k]
  ------------------
 2315|   116k|         c += kBlockWidth * multiplier) {
 2316|   116k|      const uint8_t *blk_src = src + r * (ptrdiff_t)stride + c;
 2317|   116k|      const uint8_t *blk = blk_src;
 2318|   116k|      int blk_stride = stride;
 2319|       |
 2320|       |      // Down-convert pixels to 8-bit domain if source is HBD
 2321|   116k|      if (use_hbd) {
  ------------------
  |  Branch (2321:11): [True: 14.5k, False: 101k]
  ------------------
 2322|  14.5k|        const uint16_t *blk_src_hbd = CONVERT_TO_SHORTPTR(blk_src);
  ------------------
  |  |   79|  14.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 2323|       |
 2324|   247k|        for (int blk_r = 0; blk_r < kBlockHeight; ++blk_r) {
  ------------------
  |  Branch (2324:29): [True: 232k, False: 14.5k]
  ------------------
 2325|  3.95M|          for (int blk_c = 0; blk_c < kBlockWidth; ++blk_c) {
  ------------------
  |  Branch (2325:31): [True: 3.72M, False: 232k]
  ------------------
 2326|  3.72M|            const int downconv_val =
 2327|  3.72M|                (blk_src_hbd[blk_r * (ptrdiff_t)stride + blk_c]) >> (bd - 8);
 2328|       |
 2329|       |            // Ensure down-converted value is 8-bit
 2330|  3.72M|            assert(downconv_val < (1 << 8));
 2331|  3.72M|            downconv_blk[blk_r * (ptrdiff_t)kBlockWidth + blk_c] = downconv_val;
 2332|  3.72M|          }
 2333|   232k|        }
 2334|       |
 2335|       |        // Switch block source and stride to down-converted buffer and its width
 2336|  14.5k|        blk = downconv_blk;
 2337|  14.5k|        blk_stride = kBlockWidth;
 2338|  14.5k|      }
 2339|       |
 2340|       |      // First, find if the block could be palettized
 2341|   116k|      int number_of_colors;
 2342|   116k|      bool under_threshold = av1_count_colors_with_threshold(
 2343|   116k|          blk, blk_stride, /*rows=*/kBlockHeight,
 2344|   116k|          /*cols=*/kBlockWidth, kComplexInitialColorThresh, &number_of_colors);
 2345|   116k|      if (number_of_colors > 1 && under_threshold) {
  ------------------
  |  Branch (2345:11): [True: 116k, False: 0]
  |  Branch (2345:35): [True: 5.86k, False: 110k]
  ------------------
 2346|  5.86k|        struct buf_2d buf;
 2347|  5.86k|        buf.stride = stride;
 2348|  5.86k|        buf.buf = (uint8_t *)blk_src;
 2349|       |
 2350|  5.86k|        if (number_of_colors <= kSimpleColorThresh) {
  ------------------
  |  Branch (2350:13): [True: 0, False: 5.86k]
  ------------------
 2351|       |          // Simple block detected, add to block count with no further
 2352|       |          // processing required
 2353|      0|          ++count_palette;
 2354|       |          // Variance always comes from the source image with no down-conversion
 2355|      0|          int var = av1_get_perpixel_variance(cpi, xd, &buf, BLOCK_16X16,
 2356|      0|                                              AOM_PLANE_Y, use_hbd);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2357|       |
 2358|      0|          if (var > kVarThresh) {
  ------------------
  |  Branch (2358:15): [True: 0, False: 0]
  ------------------
 2359|      0|            ++count_intrabc;
 2360|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2361|       |            fprintf(stats_file, "S");
 2362|       |          } else {
 2363|       |            fprintf(stats_file, "-");
 2364|       |#endif
 2365|      0|          }
 2366|  5.86k|        } else {
 2367|       |          // Complex block detected, try to find if it's palettizable
 2368|       |          // Dilate block with dominant color, to exclude anti-aliased pixels
 2369|       |          // from final palette count
 2370|  5.86k|          av1_dilate_block(blk, blk_stride, dilated_blk, kBlockWidth,
 2371|  5.86k|                           /*rows=*/kBlockHeight, /*cols=*/kBlockWidth);
 2372|  5.86k|          under_threshold = av1_count_colors_with_threshold(
 2373|  5.86k|              dilated_blk, kBlockWidth, /*rows=*/kBlockHeight,
 2374|  5.86k|              /*cols=*/kBlockWidth, kComplexFinalColorThresh,
 2375|  5.86k|              &number_of_colors);
 2376|       |
 2377|  5.86k|          if (under_threshold) {
  ------------------
  |  Branch (2377:15): [True: 5.75k, False: 115]
  ------------------
 2378|       |            // Variance always comes from the source image with no
 2379|       |            // down-conversion
 2380|  5.75k|            int var = av1_get_perpixel_variance(cpi, xd, &buf, BLOCK_16X16,
 2381|  5.75k|                                                AOM_PLANE_Y, use_hbd);
  ------------------
  |  |  281|  5.75k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2382|       |
 2383|  5.75k|            if (var > kVarThresh) {
  ------------------
  |  Branch (2383:17): [True: 5.75k, False: 0]
  ------------------
 2384|  5.75k|              ++count_palette;
 2385|  5.75k|              ++count_intrabc;
 2386|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2387|       |              fprintf(stats_file, "C");
 2388|       |            } else {
 2389|       |              fprintf(stats_file, "=");
 2390|       |#endif
 2391|  5.75k|            }
 2392|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2393|       |          } else {
 2394|       |            fprintf(stats_file, ".");
 2395|       |#endif
 2396|  5.75k|          }
 2397|  5.86k|        }
 2398|   110k|      } else {
 2399|   110k|        if (number_of_colors > kComplexInitialColorThresh) {
  ------------------
  |  Branch (2399:13): [True: 110k, False: 0]
  ------------------
 2400|   110k|          ++count_photo;
 2401|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2402|       |          fprintf(stats_file, "x");
 2403|       |        } else {
 2404|       |          fprintf(stats_file, " ");  // Solid block (1 color)
 2405|       |#endif
 2406|   110k|        }
 2407|   110k|      }
 2408|   116k|    }
 2409|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2410|       |    fprintf(stats_file, "\n");
 2411|       |#endif
 2412|  26.4k|  }
 2413|       |
 2414|       |  // Normalize counts to account for the blocks that were skipped
 2415|  8.61k|  if (fast_detection) {
  ------------------
  |  Branch (2415:7): [True: 0, False: 8.61k]
  ------------------
 2416|      0|    count_photo *= multiplier;
 2417|      0|    count_palette *= multiplier;
 2418|      0|    count_intrabc *= multiplier;
 2419|      0|  }
 2420|       |
 2421|       |  // The threshold values are selected experimentally.
 2422|       |  // Penalize presence of photo-like blocks (1/16th the weight of a palettizable
 2423|       |  // block)
 2424|  8.61k|  features->allow_screen_content_tools =
 2425|  8.61k|      ((count_palette - count_photo / 16) * kBlockArea * 10 > area);
 2426|       |
 2427|       |  // IntraBC would force loop filters off, so we use more strict rules that also
 2428|       |  // requires that the block has high variance.
 2429|       |  // Penalize presence of photo-like blocks (1/16th the weight of a palettizable
 2430|       |  // block)
 2431|  8.61k|  features->allow_intrabc =
 2432|  8.61k|      features->allow_screen_content_tools &&
  ------------------
  |  Branch (2432:7): [True: 1.98k, False: 6.63k]
  ------------------
 2433|  1.98k|      ((count_intrabc - count_photo / 16) * kBlockArea * 12 > area);
  ------------------
  |  Branch (2433:7): [True: 1.98k, False: 0]
  ------------------
 2434|  8.61k|  cpi->use_screen_content_tools = features->allow_screen_content_tools;
 2435|  8.61k|  cpi->is_screen_content_type =
 2436|  8.61k|      features->allow_intrabc || (count_palette * kBlockArea * 15 > area * 4 &&
  ------------------
  |  Branch (2436:7): [True: 1.98k, False: 6.63k]
  |  Branch (2436:35): [True: 0, False: 6.63k]
  ------------------
 2437|      0|                                  count_intrabc * kBlockArea * 30 > area);
  ------------------
  |  Branch (2437:35): [True: 0, False: 0]
  ------------------
 2438|       |
 2439|       |#ifdef OUTPUT_SCR_DET_MODE2_STATS
 2440|       |  fprintf(stats_file,
 2441|       |          "block count palette: %" PRId64 ", count intrabc: %" PRId64
 2442|       |          ", count photo: %" PRId64 ", total: %d\n",
 2443|       |          count_palette, count_intrabc, count_photo,
 2444|       |          (int)(ceil(width / kBlockWidth) * ceil(height / kBlockHeight)));
 2445|       |  fprintf(stats_file, "sc palette value: %" PRId64 ", threshold %" PRId64 "\n",
 2446|       |          (count_palette - count_photo / 16) * kBlockArea * 10, area);
 2447|       |  fprintf(stats_file, "sc ibc value: %" PRId64 ", threshold %" PRId64 "\n",
 2448|       |          (count_intrabc - count_photo / 16) * kBlockArea * 12, area);
 2449|       |  fprintf(stats_file, "allow sct: %d, allow ibc: %d\n",
 2450|       |          features->allow_screen_content_tools, features->allow_intrabc);
 2451|       |#endif
 2452|  8.61k|}
encoder.c:estimate_screen_content:
 2057|  3.68k|static void estimate_screen_content(AV1_COMP *cpi, FeatureFlags *features) {
 2058|  3.68k|  const AV1_COMMON *const cm = &cpi->common;
 2059|  3.68k|  const MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 2060|  3.68k|  const uint8_t *src = cpi->unfiltered_source->y_buffer;
 2061|  3.68k|  assert(src != NULL);
 2062|  3.68k|  const int use_hbd = cpi->unfiltered_source->flags & YV12_FLAG_HIGHBITDEPTH;
  ------------------
  |  |  142|  3.68k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 2063|  3.68k|  const int stride = cpi->unfiltered_source->y_stride;
 2064|  3.68k|  const int width = cpi->unfiltered_source->y_width;
 2065|  3.68k|  const int height = cpi->unfiltered_source->y_height;
 2066|  3.68k|  const int64_t area = (int64_t)width * height;
 2067|  3.68k|  const int bd = cm->seq_params->bit_depth;
 2068|  3.68k|  const int kBlockWidth = 16;
 2069|  3.68k|  const int kBlockHeight = 16;
 2070|  3.68k|  const int kBlockArea = kBlockWidth * kBlockHeight;
 2071|       |  // These threshold values are selected experimentally.
 2072|  3.68k|  const int kColorThresh = 4;
 2073|  3.68k|  const unsigned int kVarThresh = 0;
 2074|       |  // Counts of blocks with no more than kColorThresh colors.
 2075|  3.68k|  int64_t counts_1 = 0;
 2076|       |  // Counts of blocks with no more than kColorThresh colors and variance larger
 2077|       |  // than kVarThresh.
 2078|  3.68k|  int64_t counts_2 = 0;
 2079|       |
 2080|  16.8k|  for (int r = 0; r + kBlockHeight <= height; r += kBlockHeight) {
  ------------------
  |  Branch (2080:19): [True: 13.1k, False: 3.68k]
  ------------------
 2081|  76.8k|    for (int c = 0; c + kBlockWidth <= width; c += kBlockWidth) {
  ------------------
  |  Branch (2081:21): [True: 63.6k, False: 13.1k]
  ------------------
 2082|  63.6k|      int count_buf[1 << 8];  // Maximum (1 << 8) bins for hbd path.
 2083|  63.6k|      const uint8_t *const this_src = src + r * stride + c;
 2084|  63.6k|      int n_colors;
 2085|  63.6k|      if (use_hbd) {
  ------------------
  |  Branch (2085:11): [True: 5.72k, False: 57.9k]
  ------------------
 2086|  5.72k|        av1_count_colors_highbd(this_src, stride, /*rows=*/kBlockHeight,
 2087|  5.72k|                                /*cols=*/kBlockWidth, bd, NULL, count_buf,
 2088|  5.72k|                                &n_colors, NULL);
 2089|  57.9k|      } else {
 2090|  57.9k|        av1_count_colors(this_src, stride, /*rows=*/kBlockHeight,
 2091|  57.9k|                         /*cols=*/kBlockWidth, count_buf, &n_colors);
 2092|  57.9k|      }
 2093|  63.6k|      if (n_colors > 1 && n_colors <= kColorThresh) {
  ------------------
  |  Branch (2093:11): [True: 63.6k, False: 0]
  |  Branch (2093:27): [True: 0, False: 63.6k]
  ------------------
 2094|      0|        ++counts_1;
 2095|      0|        struct buf_2d buf;
 2096|      0|        buf.stride = stride;
 2097|      0|        buf.buf = (uint8_t *)this_src;
 2098|      0|        const unsigned int var = av1_get_perpixel_variance(
 2099|      0|            cpi, xd, &buf, BLOCK_16X16, AOM_PLANE_Y, use_hbd);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2100|      0|        if (var > kVarThresh) ++counts_2;
  ------------------
  |  Branch (2100:13): [True: 0, False: 0]
  ------------------
 2101|      0|      }
 2102|  63.6k|    }
 2103|  13.1k|  }
 2104|       |
 2105|       |  // The threshold values are selected experimentally.
 2106|  3.68k|  features->allow_screen_content_tools = counts_1 * kBlockArea * 10 > area;
 2107|       |  // IntraBC would force loop filters off, so we use more strict rules that also
 2108|       |  // requires that the block has high variance.
 2109|  3.68k|  features->allow_intrabc =
 2110|  3.68k|      features->allow_screen_content_tools && counts_2 * kBlockArea * 12 > area;
  ------------------
  |  Branch (2110:7): [True: 0, False: 3.68k]
  |  Branch (2110:47): [True: 0, False: 0]
  ------------------
 2111|  3.68k|  cpi->use_screen_content_tools = features->allow_screen_content_tools;
 2112|  3.68k|  cpi->is_screen_content_type =
 2113|  3.68k|      features->allow_intrabc || (counts_1 * kBlockArea * 10 > area * 4 &&
  ------------------
  |  Branch (2113:7): [True: 0, False: 3.68k]
  |  Branch (2113:35): [True: 0, False: 3.68k]
  ------------------
 2114|      0|                                  counts_2 * kBlockArea * 30 > area);
  ------------------
  |  Branch (2114:35): [True: 0, False: 0]
  ------------------
 2115|  3.68k|}
encoder.c:init_ref_frame_bufs:
 2554|  18.4k|static void init_ref_frame_bufs(AV1_COMP *cpi) {
 2555|  18.4k|  AV1_COMMON *const cm = &cpi->common;
 2556|  18.4k|  int i;
 2557|  18.4k|  if (cm->cur_frame) {
  ------------------
  |  Branch (2557:7): [True: 0, False: 18.4k]
  ------------------
 2558|      0|    cm->cur_frame->ref_count--;
 2559|      0|    cm->cur_frame = NULL;
 2560|      0|  }
 2561|   165k|  for (i = 0; i < REF_FRAMES; ++i) {
  ------------------
  |  Branch (2561:15): [True: 147k, False: 18.4k]
  ------------------
 2562|   147k|    if (cm->ref_frame_map[i]) {
  ------------------
  |  Branch (2562:9): [True: 0, False: 147k]
  ------------------
 2563|      0|      cm->ref_frame_map[i]->ref_count--;
 2564|      0|      cm->ref_frame_map[i] = NULL;
 2565|      0|    }
 2566|   147k|  }
 2567|       |#ifndef NDEBUG
 2568|       |  BufferPool *const pool = cm->buffer_pool;
 2569|       |  for (i = 0; i < pool->num_frame_bufs; ++i) {
 2570|       |    assert(pool->frame_bufs[i].ref_count == 0);
 2571|       |  }
 2572|       |#endif
 2573|  18.4k|}
encoder.c:init_motion_estimation:
 2496|   141k|static void init_motion_estimation(AV1_COMP *cpi) {
 2497|   141k|  AV1_COMMON *const cm = &cpi->common;
 2498|   141k|  MotionVectorSearchParams *const mv_search_params = &cpi->mv_search_params;
 2499|   141k|  const int aligned_width = (cm->width + 7) & ~7;
 2500|   141k|  const int y_stride =
 2501|   141k|      aom_calc_y_stride(aligned_width, cpi->oxcf.border_in_pixels);
 2502|       |  // cpi->ppi->lookahead->buf is a multi-slot buffer, so buf[0] may not be
 2503|       |  // the current frame's slot and can retain an old stride after a frame resize
 2504|       |  // in av1_lookahead_push(). During av1_encode(), cpi->unscaled_source points
 2505|       |  // to the current frame's lookahead buffer entry (frame_input->source).
 2506|   141k|  const int lookahead_y_stride = cpi->unscaled_source != NULL
  ------------------
  |  Branch (2506:34): [True: 110k, False: 30.7k]
  ------------------
 2507|   141k|                                     ? cpi->unscaled_source->y_stride
 2508|   141k|                                     : cpi->ppi->lookahead->buf[0].img.y_stride;
 2509|   141k|  const int y_stride_src = ((cpi->oxcf.frm_dim_cfg.width != cm->width ||
  ------------------
  |  Branch (2509:30): [True: 92.1k, False: 49.1k]
  ------------------
 2510|  49.1k|                             cpi->oxcf.frm_dim_cfg.height != cm->height) ||
  ------------------
  |  Branch (2510:30): [True: 0, False: 49.1k]
  ------------------
 2511|  49.1k|                            av1_superres_scaled(cm))
  ------------------
  |  Branch (2511:29): [True: 0, False: 49.1k]
  ------------------
 2512|   141k|                               ? y_stride
 2513|   141k|                               : lookahead_y_stride;
 2514|   141k|  int fpf_y_stride =
 2515|   141k|      cm->cur_frame != NULL ? cm->cur_frame->buf.y_stride : y_stride;
  ------------------
  |  Branch (2515:7): [True: 122k, False: 18.4k]
  ------------------
 2516|       |
 2517|       |  // Update if search_site_cfg is uninitialized or the current frame has a new
 2518|       |  // stride
 2519|   141k|  const int should_update =
 2520|   141k|      !mv_search_params->search_site_cfg[SS_CFG_SRC][DIAMOND].stride ||
  ------------------
  |  Branch (2520:7): [True: 18.4k, False: 122k]
  ------------------
 2521|   122k|      !mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD][DIAMOND].stride ||
  ------------------
  |  Branch (2521:7): [True: 0, False: 122k]
  ------------------
 2522|   122k|      !mv_search_params->search_site_cfg[SS_CFG_FPF][DIAMOND].stride ||
  ------------------
  |  Branch (2522:7): [True: 0, False: 122k]
  ------------------
 2523|   122k|      (y_stride !=
  ------------------
  |  Branch (2523:7): [True: 33.5k, False: 89.3k]
  ------------------
 2524|   122k|       mv_search_params->search_site_cfg[SS_CFG_SRC][DIAMOND].stride) ||
 2525|  89.3k|      (y_stride_src !=
  ------------------
  |  Branch (2525:7): [True: 16.8k, False: 72.4k]
  ------------------
 2526|  89.3k|       mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD][DIAMOND].stride) ||
 2527|  72.4k|      (fpf_y_stride !=
  ------------------
  |  Branch (2527:7): [True: 0, False: 72.4k]
  ------------------
 2528|  72.4k|       mv_search_params->search_site_cfg[SS_CFG_FPF][DIAMOND].stride);
 2529|       |
 2530|   141k|  if (!should_update) {
  ------------------
  |  Branch (2530:7): [True: 72.4k, False: 68.7k]
  ------------------
 2531|  72.4k|    return;
 2532|  72.4k|  }
 2533|       |
 2534|       |  // Initialization of search_site_cfg for NUM_DISTINCT_SEARCH_METHODS.
 2535|   481k|  for (SEARCH_METHODS i = DIAMOND; i < NUM_DISTINCT_SEARCH_METHODS; i++) {
  ------------------
  |  Branch (2535:36): [True: 412k, False: 68.7k]
  ------------------
 2536|   412k|    const int level = ((i == NSTEP_8PT) || (i == CLAMPED_DIAMOND)) ? 1 : 0;
  ------------------
  |  Branch (2536:24): [True: 68.7k, False: 343k]
  |  Branch (2536:44): [True: 68.7k, False: 275k]
  ------------------
 2537|   412k|    av1_init_motion_compensation[i](
 2538|   412k|        &mv_search_params->search_site_cfg[SS_CFG_SRC][i], y_stride, level);
 2539|   412k|    av1_init_motion_compensation[i](
 2540|   412k|        &mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD][i], y_stride_src,
 2541|   412k|        level);
 2542|   412k|  }
 2543|       |
 2544|       |  // First pass search site config initialization.
 2545|  68.7k|  av1_init_motion_fpf(&mv_search_params->search_site_cfg[SS_CFG_FPF][DIAMOND],
 2546|  68.7k|                      fpf_y_stride);
 2547|   412k|  for (SEARCH_METHODS i = NSTEP; i < NUM_DISTINCT_SEARCH_METHODS; i++) {
  ------------------
  |  Branch (2547:34): [True: 343k, False: 68.7k]
  ------------------
 2548|   343k|    memcpy(&mv_search_params->search_site_cfg[SS_CFG_FPF][i],
 2549|   343k|           &mv_search_params->search_site_cfg[SS_CFG_FPF][DIAMOND],
 2550|   343k|           sizeof(search_site_config));
 2551|   343k|  }
 2552|  68.7k|}
encoder.c:set_size_literal:
 2627|  63.3k|static int set_size_literal(AV1_COMP *cpi, int width, int height) {
 2628|  63.3k|  AV1_COMMON *cm = &cpi->common;
 2629|  63.3k|  aom_codec_err_t err = av1_check_initial_width(
 2630|  63.3k|      cpi, cm->seq_params->use_highbitdepth, cm->seq_params->subsampling_x,
 2631|  63.3k|      cm->seq_params->subsampling_y);
 2632|  63.3k|  if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (2632:7): [True: 0, False: 63.3k]
  ------------------
 2633|      0|    aom_internal_error(cm->error, err, "av1_check_initial_width() failed");
 2634|      0|  }
 2635|       |
 2636|  63.3k|  if (width <= 0 || height <= 0) return 1;
  ------------------
  |  Branch (2636:7): [True: 0, False: 63.3k]
  |  Branch (2636:21): [True: 0, False: 63.3k]
  ------------------
 2637|       |
 2638|  63.3k|  cm->width = width;
 2639|  63.3k|  cm->height = height;
 2640|       |
 2641|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 2642|       |  setup_denoiser_buffer(cpi);
 2643|       |#endif
 2644|       |
 2645|  63.3k|  if (cm->width > cpi->data_alloc_width ||
  ------------------
  |  Branch (2645:7): [True: 0, False: 63.3k]
  ------------------
 2646|  63.3k|      cm->height > cpi->data_alloc_height) {
  ------------------
  |  Branch (2646:7): [True: 0, False: 63.3k]
  ------------------
 2647|      0|    av1_free_context_buffers(cm);
 2648|      0|    av1_free_shared_coeff_buffer(&cpi->td.shared_coeff_buf);
 2649|      0|    av1_free_sms_tree(&cpi->td);
 2650|      0|    av1_free_pmc(cpi->td.firstpass_ctx, av1_num_planes(cm));
 2651|      0|    cpi->td.firstpass_ctx = NULL;
 2652|      0|    alloc_compressor_data(cpi);
 2653|      0|    realloc_segmentation_maps(cpi);
 2654|      0|    cpi->data_alloc_width = cpi->oxcf.frm_dim_cfg.forced_max_frame_width
  ------------------
  |  Branch (2654:29): [True: 0, False: 0]
  ------------------
 2655|      0|                                ? cpi->oxcf.frm_dim_cfg.forced_max_frame_width
 2656|      0|                                : cm->width;
 2657|      0|    cpi->data_alloc_height = cpi->oxcf.frm_dim_cfg.forced_max_frame_height
  ------------------
  |  Branch (2657:30): [True: 0, False: 0]
  ------------------
 2658|      0|                                 ? cpi->oxcf.frm_dim_cfg.forced_max_frame_height
 2659|      0|                                 : cm->height;
 2660|      0|    cpi->frame_size_related_setup_done = false;
 2661|      0|  }
 2662|  63.3k|  alloc_mb_mode_info_buffers(cpi);
 2663|  63.3k|  av1_update_frame_size(cpi);
 2664|       |
 2665|  63.3k|  return 0;
 2666|  63.3k|}
encoder.c:encode_frame_to_data_rate:
 4148|  73.6k|                                     size_t dest_size) {
 4149|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 4150|  73.6k|  SequenceHeader *const seq_params = cm->seq_params;
 4151|  73.6k|  CurrentFrame *const current_frame = &cm->current_frame;
 4152|  73.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 4153|  73.6k|  struct segmentation *const seg = &cm->seg;
 4154|  73.6k|  FeatureFlags *const features = &cm->features;
 4155|  73.6k|  const TileConfig *const tile_cfg = &oxcf->tile_cfg;
 4156|  73.6k|  assert(cpi->source != NULL);
 4157|  73.6k|  cpi->td.mb.e_mbd.cur_buf = cpi->source;
 4158|       |
 4159|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 4160|       |  start_timing(cpi, encode_frame_to_data_rate_time);
 4161|       |#endif
 4162|       |
 4163|  73.6k|#if !CONFIG_REALTIME_ONLY
 4164|  73.6k|  calculate_frame_avg_haar_energy(cpi);
 4165|  73.6k|#endif
 4166|       |
 4167|       |  // frame type has been decided outside of this function call
 4168|  73.6k|  cm->cur_frame->frame_type = current_frame->frame_type;
 4169|       |
 4170|  73.6k|  cm->tiles.large_scale = tile_cfg->enable_large_scale_tile;
 4171|  73.6k|  cm->tiles.single_tile_decoding = tile_cfg->enable_single_tile_decoding;
 4172|       |
 4173|  73.6k|  features->allow_ref_frame_mvs &= frame_might_allow_ref_frame_mvs(cm);
 4174|       |  // features->allow_ref_frame_mvs needs to be written into the frame header
 4175|       |  // while cm->tiles.large_scale is 1, therefore, "cm->tiles.large_scale=1" case
 4176|       |  // is separated from frame_might_allow_ref_frame_mvs().
 4177|  73.6k|  features->allow_ref_frame_mvs &= !cm->tiles.large_scale;
 4178|       |
 4179|  73.6k|  features->allow_warped_motion = oxcf->motion_mode_cfg.allow_warped_motion &&
  ------------------
  |  Branch (4179:35): [True: 73.6k, False: 0]
  ------------------
 4180|  73.6k|                                  frame_might_allow_warped_motion(cm);
  ------------------
  |  Branch (4180:35): [True: 55.2k, False: 18.4k]
  ------------------
 4181|       |
 4182|  73.6k|  cpi->last_frame_type = current_frame->frame_type;
 4183|       |
 4184|  73.6k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (4184:7): [True: 18.4k, False: 55.2k]
  ------------------
 4185|  18.4k|    cpi->frames_since_last_update = 0;
 4186|  18.4k|  }
 4187|       |
 4188|  73.6k|  if (frame_is_sframe(cm)) {
  ------------------
  |  Branch (4188:7): [True: 0, False: 73.6k]
  ------------------
 4189|      0|    GF_GROUP *gf_group = &cpi->ppi->gf_group;
 4190|       |    // S frame will wipe out any previously encoded altref so we cannot place
 4191|       |    // an overlay frame
 4192|      0|    gf_group->update_type[gf_group->size] = GF_UPDATE;
 4193|      0|  }
 4194|       |
 4195|  73.6k|  if (encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (4195:7): [True: 0, False: 73.6k]
  ------------------
 4196|       |#if CONFIG_RATECTRL_LOG && CONFIG_THREE_PASS && CONFIG_BITRATE_ACCURACY
 4197|       |    // TODO(angiebird): Move this into a function.
 4198|       |    if (oxcf->pass == AOM_RC_THIRD_PASS) {
 4199|       |      int frame_coding_idx =
 4200|       |          av1_vbr_rc_frame_coding_idx(&cpi->vbr_rc_info, cpi->gf_frame_index);
 4201|       |      rc_log_frame_encode_param(
 4202|       |          &cpi->rc_log, frame_coding_idx, 1, 255,
 4203|       |          cpi->ppi->gf_group.update_type[cpi->gf_frame_index]);
 4204|       |    }
 4205|       |#endif
 4206|      0|    av1_finalize_encoded_frame(cpi);
 4207|       |    // Build the bitstream
 4208|      0|    int largest_tile_id = 0;  // Output from bitstream: unused here
 4209|      0|    cpi->rc.coefficient_size = 0;
 4210|      0|    if (av1_pack_bitstream(cpi, dest, dest_size, size, &largest_tile_id) !=
  ------------------
  |  Branch (4210:9): [True: 0, False: 0]
  ------------------
 4211|      0|        AOM_CODEC_OK)
 4212|      0|      return AOM_CODEC_ERROR;
 4213|       |
 4214|      0|    if (seq_params->frame_id_numbers_present_flag &&
  ------------------
  |  Branch (4214:9): [True: 0, False: 0]
  ------------------
 4215|      0|        current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (4215:9): [True: 0, False: 0]
  ------------------
 4216|       |      // Displaying a forward key-frame, so reset the ref buffer IDs
 4217|      0|      int display_frame_id = cm->ref_frame_id[cpi->existing_fb_idx_to_show];
 4218|      0|      for (int i = 0; i < REF_FRAMES; i++)
  ------------------
  |  Branch (4218:23): [True: 0, False: 0]
  ------------------
 4219|      0|        cm->ref_frame_id[i] = display_frame_id;
 4220|      0|    }
 4221|       |
 4222|       |#if DUMP_RECON_FRAMES == 1
 4223|       |    // NOTE(zoeliu): For debug - Output the filtered reconstructed video.
 4224|       |    av1_dump_filtered_recon_frames(cpi);
 4225|       |#endif  // DUMP_RECON_FRAMES
 4226|       |
 4227|       |    // NOTE: Save the new show frame buffer index for --test-code=warn, i.e.,
 4228|       |    //       for the purpose to verify no mismatch between encoder and decoder.
 4229|      0|    if (cm->show_frame) cpi->last_show_frame_buf = cm->cur_frame;
  ------------------
  |  Branch (4229:9): [True: 0, False: 0]
  ------------------
 4230|       |
 4231|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 4232|       |    av1_denoiser_update_ref_frame(cpi);
 4233|       |#endif
 4234|       |
 4235|       |    // Since we allocate a spot for the OVERLAY frame in the gf group, we need
 4236|       |    // to do post-encoding update accordingly.
 4237|      0|    av1_set_target_rate(cpi, cm->width, cm->height);
 4238|       |
 4239|      0|    if (is_psnr_calc_enabled(cpi)) {
  ------------------
  |  Branch (4239:9): [True: 0, False: 0]
  ------------------
 4240|      0|      cpi->source =
 4241|      0|          realloc_and_scale_source(cpi, cm->cur_frame->buf.y_crop_width,
 4242|      0|                                   cm->cur_frame->buf.y_crop_height);
 4243|      0|    }
 4244|       |
 4245|      0|#if !CONFIG_REALTIME_ONLY
 4246|      0|    if (cpi->use_ducky_encode) {
  ------------------
  |  Branch (4246:9): [True: 0, False: 0]
  ------------------
 4247|      0|      PSNR_STATS psnr;
 4248|      0|      aom_calc_psnr(cpi->source, &cpi->common.cur_frame->buf, &psnr);
 4249|      0|      DuckyEncodeFrameResult *frame_result =
 4250|      0|          &cpi->ducky_encode_info.frame_result;
 4251|      0|      frame_result->global_order_idx = cm->cur_frame->display_order_hint;
 4252|      0|      frame_result->q_index = cm->quant_params.base_qindex;
 4253|      0|      frame_result->rdmult = cpi->rd.RDMULT;
 4254|      0|      frame_result->rate = (int)(*size) * 8;
 4255|      0|      frame_result->dist = psnr.sse[0];
 4256|      0|      frame_result->psnr = psnr.psnr[0];
 4257|      0|    }
 4258|      0|#endif  // !CONFIG_REALTIME_ONLY
 4259|       |
 4260|      0|    update_counters_for_show_frame(cpi);
 4261|      0|    return AOM_CODEC_OK;
 4262|      0|  }
 4263|       |
 4264|       |  // Work out whether to force_integer_mv this frame
 4265|  73.6k|  if (!is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (4265:7): [True: 73.6k, False: 0]
  ------------------
 4266|  73.6k|      cpi->common.features.allow_screen_content_tools &&
  ------------------
  |  Branch (4266:7): [True: 7.92k, False: 65.7k]
  ------------------
 4267|  7.92k|      !frame_is_intra_only(cm) && !cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (4267:7): [True: 5.94k, False: 1.98k]
  |  Branch (4267:35): [True: 5.94k, False: 0]
  ------------------
 4268|  5.94k|    if (cpi->common.seq_params->force_integer_mv == 2) {
  ------------------
  |  Branch (4268:9): [True: 5.94k, False: 0]
  ------------------
 4269|       |      // Adaptive mode: see what previous frame encoded did
 4270|  5.94k|      if (cpi->unscaled_last_source != NULL) {
  ------------------
  |  Branch (4270:11): [True: 5.94k, False: 0]
  ------------------
 4271|  5.94k|        features->cur_frame_force_integer_mv = av1_is_integer_mv(
 4272|  5.94k|            cpi->source, cpi->unscaled_last_source, &cpi->force_intpel_info);
 4273|  5.94k|      } else {
 4274|      0|        cpi->common.features.cur_frame_force_integer_mv = 0;
 4275|      0|      }
 4276|  5.94k|    } else {
 4277|      0|      cpi->common.features.cur_frame_force_integer_mv =
 4278|      0|          cpi->common.seq_params->force_integer_mv;
 4279|      0|    }
 4280|  67.6k|  } else {
 4281|  67.6k|    cpi->common.features.cur_frame_force_integer_mv = 0;
 4282|  67.6k|  }
 4283|       |
 4284|       |  // This is used by av1_pack_bitstream. So this needs to be set in case of
 4285|       |  // row-mt where the encoding code will use a temporary structure.
 4286|  73.6k|  cpi->td.mb.e_mbd.cur_frame_force_integer_mv =
 4287|  73.6k|      cpi->common.features.cur_frame_force_integer_mv;
 4288|       |
 4289|       |  // Set default state for segment based loop filter update flags.
 4290|  73.6k|  cm->lf.mode_ref_delta_update = 0;
 4291|       |
 4292|       |  // Set various flags etc to special state if it is a key frame.
 4293|  73.6k|  if (frame_is_intra_only(cm) || frame_is_sframe(cm)) {
  ------------------
  |  Branch (4293:7): [True: 18.4k, False: 55.2k]
  |  Branch (4293:34): [True: 0, False: 55.2k]
  ------------------
 4294|       |    // Reset the loop filter deltas and segmentation map.
 4295|  18.4k|    av1_reset_segment_features(cm);
 4296|       |
 4297|       |    // If segmentation is enabled force a map update for key frames.
 4298|  18.4k|    if (seg->enabled) {
  ------------------
  |  Branch (4298:9): [True: 0, False: 18.4k]
  ------------------
 4299|      0|      seg->update_map = 1;
 4300|      0|      seg->update_data = 1;
 4301|      0|    }
 4302|  18.4k|  }
 4303|  73.6k|  if (tile_cfg->mtu == 0) {
  ------------------
  |  Branch (4303:7): [True: 73.6k, False: 0]
  ------------------
 4304|  73.6k|    cpi->num_tg = tile_cfg->num_tile_groups;
 4305|  73.6k|  } else {
 4306|       |    // Use a default value for the purposes of weighting costs in probability
 4307|       |    // updates
 4308|      0|    cpi->num_tg = DEFAULT_MAX_NUM_TG;
  ------------------
  |  |   27|      0|#define DEFAULT_MAX_NUM_TG 1
  ------------------
 4309|      0|  }
 4310|       |
 4311|       |  // For 1 pass CBR mode: check if we are dropping this frame.
 4312|  73.6k|  if (has_no_stats_stage(cpi) && oxcf->rc_cfg.mode == AOM_CBR) {
  ------------------
  |  Branch (4312:7): [True: 73.6k, False: 0]
  |  Branch (4312:34): [True: 24.4k, False: 49.2k]
  ------------------
 4313|       |    // Always drop for spatial enhancement layer if layer bandwidth is 0.
 4314|       |    // Otherwise check for frame-dropping based on buffer level in
 4315|       |    // av1_rc_drop_frame().
 4316|  24.4k|    if ((cpi->svc.spatial_layer_id > 0 &&
  ------------------
  |  Branch (4316:10): [True: 0, False: 24.4k]
  ------------------
 4317|      0|         cpi->oxcf.rc_cfg.target_bandwidth == 0) ||
  ------------------
  |  Branch (4317:10): [True: 0, False: 0]
  ------------------
 4318|  24.4k|        av1_rc_drop_frame(cpi)) {
  ------------------
  |  Branch (4318:9): [True: 0, False: 24.4k]
  ------------------
 4319|      0|      cpi->is_dropped_frame = true;
 4320|      0|    }
 4321|  24.4k|    if (cpi->is_dropped_frame) {
  ------------------
  |  Branch (4321:9): [True: 0, False: 24.4k]
  ------------------
 4322|      0|      av1_setup_frame_size(cpi);
 4323|      0|      av1_set_mv_search_params(cpi);
 4324|      0|      av1_rc_postencode_update_drop_frame(cpi);
 4325|      0|      release_scaled_references(cpi);
 4326|      0|      cpi->ppi->gf_group.is_frame_dropped[cpi->gf_frame_index] = true;
 4327|       |      // A dropped frame might not be shown but it always takes a slot in the gf
 4328|       |      // group. Therefore, even when it is not shown, we still need to update
 4329|       |      // the relevant frame counters.
 4330|      0|      if (cm->show_frame) {
  ------------------
  |  Branch (4330:11): [True: 0, False: 0]
  ------------------
 4331|      0|        update_counters_for_show_frame(cpi);
 4332|      0|      }
 4333|      0|      return AOM_CODEC_OK;
 4334|      0|    }
 4335|  24.4k|  }
 4336|       |
 4337|  73.6k|  if (oxcf->tune_cfg.tuning == AOM_TUNE_SSIM ||
  ------------------
  |  Branch (4337:7): [True: 0, False: 73.6k]
  ------------------
 4338|  73.6k|      oxcf->tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (4338:7): [True: 52.3k, False: 21.2k]
  ------------------
 4339|  52.3k|      oxcf->tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (4339:7): [True: 0, False: 21.2k]
  ------------------
 4340|  52.3k|    av1_set_mb_ssim_rdmult_scaling(cpi);
 4341|  52.3k|  }
 4342|       |#if CONFIG_SALIENCY_MAP
 4343|       |  else if (oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_SALIENCY_MAP &&
 4344|       |           !(cpi->source->flags & YV12_FLAG_HIGHBITDEPTH)) {
 4345|       |    if (av1_set_saliency_map(cpi) == 0) {
 4346|       |      return AOM_CODEC_MEM_ERROR;
 4347|       |    }
 4348|       |#if !CONFIG_REALTIME_ONLY
 4349|       |    double motion_ratio = av1_setup_motion_ratio(cpi);
 4350|       |#else
 4351|       |    double motion_ratio = 1.0;
 4352|       |#endif
 4353|       |    if (av1_setup_sm_rdmult_scaling_factor(cpi, motion_ratio) == 0) {
 4354|       |      return AOM_CODEC_MEM_ERROR;
 4355|       |    }
 4356|       |  }
 4357|       |#endif
 4358|       |#if CONFIG_TUNE_VMAF
 4359|       |  else if (oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_WITHOUT_PREPROCESSING ||
 4360|       |           oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
 4361|       |           oxcf->tune_cfg.tuning == AOM_TUNE_VMAF_NEG_MAX_GAIN) {
 4362|       |    av1_set_mb_vmaf_rdmult_scaling(cpi);
 4363|       |  }
 4364|       |#endif
 4365|       |
 4366|  73.6k|  if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_PERCEPTUAL_AI &&
  ------------------
  |  Branch (4366:7): [True: 0, False: 73.6k]
  ------------------
 4367|      0|      cpi->sf.rt_sf.use_nonrd_pick_mode == 0) {
  ------------------
  |  Branch (4367:7): [True: 0, False: 0]
  ------------------
 4368|      0|    av1_init_mb_wiener_var_buffer(cpi);
 4369|      0|    av1_set_mb_wiener_variance(cpi);
 4370|      0|  }
 4371|       |
 4372|  73.6k|  if (cpi->oxcf.q_cfg.deltaq_mode == DELTA_Q_USER_RATING_BASED) {
  ------------------
  |  Branch (4372:7): [True: 0, False: 73.6k]
  ------------------
 4373|      0|    av1_init_mb_ur_var_buffer(cpi);
 4374|      0|    av1_set_mb_ur_variance(cpi);
 4375|      0|  }
 4376|       |
 4377|       |#if CONFIG_INTERNAL_STATS
 4378|       |  memset(cpi->mode_chosen_counts, 0,
 4379|       |         MAX_MODES * sizeof(*cpi->mode_chosen_counts));
 4380|       |#endif
 4381|       |
 4382|  73.6k|  if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (4382:7): [True: 0, False: 73.6k]
  ------------------
 4383|       |    /* Non-normative definition of current_frame_id ("frame counter" with
 4384|       |     * wraparound) */
 4385|      0|    if (cm->current_frame_id == -1) {
  ------------------
  |  Branch (4385:9): [True: 0, False: 0]
  ------------------
 4386|      0|      int lsb, msb;
 4387|       |      /* quasi-random initialization of current_frame_id for a key frame */
 4388|      0|      if (cpi->source->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|      0|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (4388:11): [True: 0, False: 0]
  ------------------
 4389|      0|        lsb = CONVERT_TO_SHORTPTR(cpi->source->y_buffer)[0] & 0xff;
  ------------------
  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 4390|      0|        msb = CONVERT_TO_SHORTPTR(cpi->source->y_buffer)[1] & 0xff;
  ------------------
  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 4391|      0|      } else {
 4392|      0|        lsb = cpi->source->y_buffer[0] & 0xff;
 4393|      0|        msb = cpi->source->y_buffer[1] & 0xff;
 4394|      0|      }
 4395|      0|      cm->current_frame_id =
 4396|      0|          ((msb << 8) + lsb) % (1 << seq_params->frame_id_length);
 4397|       |
 4398|       |      // S_frame is meant for stitching different streams of different
 4399|       |      // resolutions together, so current_frame_id must be the
 4400|       |      // same across different streams of the same content current_frame_id
 4401|       |      // should be the same and not random. 0x37 is a chosen number as start
 4402|       |      // point
 4403|      0|      if (oxcf->kf_cfg.sframe_dist != 0) cm->current_frame_id = 0x37;
  ------------------
  |  Branch (4403:11): [True: 0, False: 0]
  ------------------
 4404|      0|    } else {
 4405|      0|      cm->current_frame_id =
 4406|      0|          (cm->current_frame_id + 1 + (1 << seq_params->frame_id_length)) %
 4407|      0|          (1 << seq_params->frame_id_length);
 4408|      0|    }
 4409|      0|  }
 4410|       |
 4411|  73.6k|  switch (oxcf->algo_cfg.cdf_update_mode) {
  ------------------
  |  Branch (4411:11): [True: 73.6k, False: 0]
  ------------------
 4412|      0|    case 0:  // No CDF update for any frames(4~6% compression loss).
  ------------------
  |  Branch (4412:5): [True: 0, False: 73.6k]
  ------------------
 4413|      0|      features->disable_cdf_update = 1;
 4414|      0|      break;
 4415|  73.6k|    case 1:  // Enable CDF update for all frames.
  ------------------
  |  Branch (4415:5): [True: 73.6k, False: 0]
  ------------------
 4416|  73.6k|      if (cpi->sf.rt_sf.disable_cdf_update_non_reference_frame &&
  ------------------
  |  Branch (4416:11): [True: 0, False: 73.6k]
  ------------------
 4417|      0|          cpi->ppi->rtc_ref.non_reference_frame && cpi->rc.frames_since_key > 2)
  ------------------
  |  Branch (4417:11): [True: 0, False: 0]
  |  Branch (4417:52): [True: 0, False: 0]
  ------------------
 4418|      0|        features->disable_cdf_update = 1;
 4419|  73.6k|      else if (cpi->sf.rt_sf.selective_cdf_update)
  ------------------
  |  Branch (4419:16): [True: 0, False: 73.6k]
  ------------------
 4420|      0|        features->disable_cdf_update = selective_disable_cdf_rtc(cpi);
 4421|  73.6k|      else
 4422|  73.6k|        features->disable_cdf_update = 0;
 4423|  73.6k|      break;
 4424|      0|    case 2:
  ------------------
  |  Branch (4424:5): [True: 0, False: 73.6k]
  ------------------
 4425|       |      // Strategically determine at which frames to do CDF update.
 4426|       |      // Currently only enable CDF update for all-intra and no-show frames(1.5%
 4427|       |      // compression loss) for good qualiy or allintra mode.
 4428|      0|      if (oxcf->mode == GOOD || oxcf->mode == ALLINTRA) {
  ------------------
  |  Branch (4428:11): [True: 0, False: 0]
  |  Branch (4428:33): [True: 0, False: 0]
  ------------------
 4429|      0|        features->disable_cdf_update =
 4430|      0|            (frame_is_intra_only(cm) || !cm->show_frame) ? 0 : 1;
  ------------------
  |  Branch (4430:14): [True: 0, False: 0]
  |  Branch (4430:41): [True: 0, False: 0]
  ------------------
 4431|      0|      } else {
 4432|      0|        features->disable_cdf_update = selective_disable_cdf_rtc(cpi);
 4433|      0|      }
 4434|      0|      break;
 4435|  73.6k|  }
 4436|       |
 4437|       |  // Disable cdf update for the INTNL_ARF_UPDATE frame with
 4438|       |  // frame_parallel_level 1.
 4439|  73.6k|  if (!cpi->do_frame_data_update &&
  ------------------
  |  Branch (4439:7): [True: 0, False: 73.6k]
  ------------------
 4440|      0|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (4440:7): [True: 0, False: 0]
  ------------------
 4441|      0|    assert(cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 1);
 4442|      0|    features->disable_cdf_update = 1;
 4443|      0|  }
 4444|       |
 4445|  73.6k|#if !CONFIG_REALTIME_ONLY
 4446|  73.6k|  if (cpi->oxcf.tool_cfg.enable_global_motion && !frame_is_intra_only(cm)) {
  ------------------
  |  Branch (4446:7): [True: 49.2k, False: 24.4k]
  |  Branch (4446:50): [True: 36.9k, False: 12.3k]
  ------------------
 4447|       |    // Flush any stale global motion information, which may be left over
 4448|       |    // from a previous frame
 4449|  36.9k|    aom_invalidate_pyramid(cpi->source->y_pyramid);
 4450|  36.9k|    av1_invalidate_corner_list(cpi->source->corners);
 4451|  36.9k|  }
 4452|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 4453|       |
 4454|  73.6k|  int largest_tile_id = 0;
 4455|  73.6k|  if (av1_superres_in_recode_allowed(cpi)) {
  ------------------
  |  Branch (4455:7): [True: 0, False: 73.6k]
  ------------------
 4456|      0|    if (encode_with_and_without_superres(cpi, size, dest, dest_size,
  ------------------
  |  Branch (4456:9): [True: 0, False: 0]
  ------------------
 4457|      0|                                         &largest_tile_id) != AOM_CODEC_OK) {
 4458|      0|      return AOM_CODEC_ERROR;
 4459|      0|    }
 4460|  73.6k|  } else {
 4461|  73.6k|    const aom_superres_mode orig_superres_mode = cpi->superres_mode;  // save
 4462|  73.6k|    cpi->superres_mode = cpi->oxcf.superres_cfg.superres_mode;
 4463|  73.6k|    if (encode_with_recode_loop_and_filter(cpi, size, dest, dest_size, NULL,
  ------------------
  |  Branch (4463:9): [True: 0, False: 73.6k]
  ------------------
 4464|  73.6k|                                           NULL,
 4465|  73.6k|                                           &largest_tile_id) != AOM_CODEC_OK) {
 4466|      0|      return AOM_CODEC_ERROR;
 4467|      0|    }
 4468|  73.6k|    cpi->superres_mode = orig_superres_mode;  // restore
 4469|  73.6k|  }
 4470|       |
 4471|       |  // Update reference frame ids for reference frames this frame will overwrite
 4472|  73.6k|  if (seq_params->frame_id_numbers_present_flag) {
  ------------------
  |  Branch (4472:7): [True: 0, False: 73.6k]
  ------------------
 4473|      0|    for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (4473:21): [True: 0, False: 0]
  ------------------
 4474|      0|      if ((current_frame->refresh_frame_flags >> i) & 1) {
  ------------------
  |  Branch (4474:11): [True: 0, False: 0]
  ------------------
 4475|      0|        cm->ref_frame_id[i] = cm->current_frame_id;
 4476|      0|      }
 4477|      0|    }
 4478|      0|  }
 4479|       |
 4480|  73.6k|  if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)
  ------------------
  |  Branch (4480:7): [True: 73.6k, False: 0]
  ------------------
 4481|  73.6k|    cpi->svc.num_encoded_top_layer++;
 4482|       |
 4483|       |#if DUMP_RECON_FRAMES == 1
 4484|       |  // NOTE(zoeliu): For debug - Output the filtered reconstructed video.
 4485|       |  av1_dump_filtered_recon_frames(cpi);
 4486|       |#endif  // DUMP_RECON_FRAMES
 4487|       |
 4488|  73.6k|  if (cm->seg.enabled) {
  ------------------
  |  Branch (4488:7): [True: 0, False: 73.6k]
  ------------------
 4489|      0|    if (cm->seg.update_map == 0 && cm->last_frame_seg_map) {
  ------------------
  |  Branch (4489:9): [True: 0, False: 0]
  |  Branch (4489:36): [True: 0, False: 0]
  ------------------
 4490|      0|      memcpy(cm->cur_frame->seg_map, cm->last_frame_seg_map,
 4491|      0|             cm->cur_frame->mi_cols * cm->cur_frame->mi_rows *
 4492|      0|                 sizeof(*cm->cur_frame->seg_map));
 4493|      0|    }
 4494|      0|  }
 4495|       |
 4496|  73.6k|  int release_scaled_refs = 0;
 4497|       |#if CONFIG_FPMT_TEST
 4498|       |  release_scaled_refs =
 4499|       |      (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 1 : 0;
 4500|       |#endif  // CONFIG_FPMT_TEST
 4501|  73.6k|  if (release_scaled_refs ||
  ------------------
  |  Branch (4501:7): [True: 0, False: 73.6k]
  ------------------
 4502|  73.6k|      cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
  ------------------
  |  Branch (4502:7): [True: 73.6k, False: 0]
  ------------------
 4503|  73.6k|    if (frame_is_intra_only(cm) == 0) {
  ------------------
  |  Branch (4503:9): [True: 55.2k, False: 18.4k]
  ------------------
 4504|  55.2k|      release_scaled_references(cpi);
 4505|  55.2k|    }
 4506|  73.6k|  }
 4507|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 4508|       |  av1_denoiser_update_ref_frame(cpi);
 4509|       |#endif
 4510|       |
 4511|       |  // NOTE: Save the new show frame buffer index for --test-code=warn, i.e.,
 4512|       |  //       for the purpose to verify no mismatch between encoder and decoder.
 4513|  73.6k|  if (cm->show_frame) cpi->last_show_frame_buf = cm->cur_frame;
  ------------------
  |  Branch (4513:7): [True: 73.6k, False: 0]
  ------------------
 4514|       |
 4515|  73.6k|  if (features->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
  ------------------
  |  Branch (4515:7): [True: 73.6k, False: 0]
  ------------------
 4516|  73.6k|    *cm->fc = cpi->tile_data[largest_tile_id].tctx;
 4517|  73.6k|    av1_reset_cdf_symbol_counters(cm->fc);
 4518|  73.6k|  }
 4519|  73.6k|  if (!cm->tiles.large_scale) {
  ------------------
  |  Branch (4519:7): [True: 73.6k, False: 0]
  ------------------
 4520|  73.6k|    cm->cur_frame->frame_context = *cm->fc;
 4521|  73.6k|  }
 4522|       |
 4523|  73.6k|  if (tile_cfg->enable_ext_tile_debug) {
  ------------------
  |  Branch (4523:7): [True: 0, False: 73.6k]
  ------------------
 4524|       |    // (yunqing) This test ensures the correctness of large scale tile coding.
 4525|      0|    if (cm->tiles.large_scale && is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (4525:9): [True: 0, False: 0]
  |  Branch (4525:34): [True: 0, False: 0]
  ------------------
 4526|      0|      char fn[20] = "./fc";
 4527|      0|      fn[4] = current_frame->frame_number / 100 + '0';
 4528|      0|      fn[5] = (current_frame->frame_number % 100) / 10 + '0';
 4529|      0|      fn[6] = (current_frame->frame_number % 10) + '0';
 4530|      0|      fn[7] = '\0';
 4531|      0|      av1_print_frame_contexts(cm->fc, fn);
 4532|      0|    }
 4533|      0|  }
 4534|       |
 4535|  73.6k|  cpi->last_frame_type = current_frame->frame_type;
 4536|       |
 4537|  73.6k|  if (cm->features.disable_cdf_update) {
  ------------------
  |  Branch (4537:7): [True: 0, False: 73.6k]
  ------------------
 4538|      0|    cpi->frames_since_last_update++;
 4539|  73.6k|  } else {
 4540|  73.6k|    cpi->frames_since_last_update = 1;
 4541|  73.6k|  }
 4542|       |
 4543|  73.6k|  if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
  ------------------
  |  Branch (4543:7): [True: 73.6k, False: 0]
  ------------------
 4544|  73.6k|    cpi->svc.prev_number_spatial_layers = cpi->svc.number_spatial_layers;
 4545|  73.6k|  }
 4546|  73.6k|  cpi->svc.prev_number_temporal_layers = cpi->svc.number_temporal_layers;
 4547|       |
 4548|       |  // Clear the one shot update flags for segmentation map and mode/ref loop
 4549|       |  // filter deltas.
 4550|  73.6k|  cm->seg.update_map = 0;
 4551|  73.6k|  cm->seg.update_data = 0;
 4552|  73.6k|  cm->lf.mode_ref_delta_update = 0;
 4553|       |
 4554|  73.6k|  if (cm->show_frame) {
  ------------------
  |  Branch (4554:7): [True: 73.6k, False: 0]
  ------------------
 4555|  73.6k|    update_counters_for_show_frame(cpi);
 4556|  73.6k|  }
 4557|       |
 4558|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 4559|       |  end_timing(cpi, encode_frame_to_data_rate_time);
 4560|       |#endif
 4561|       |
 4562|  73.6k|  return AOM_CODEC_OK;
 4563|  73.6k|}
encoder.c:calculate_frame_avg_haar_energy:
 4096|  73.6k|static void calculate_frame_avg_haar_energy(AV1_COMP *cpi) {
 4097|  73.6k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
 4098|  73.6k|  const FIRSTPASS_STATS *const total_stats =
 4099|  73.6k|      twopass->stats_buf_ctx->total_stats;
 4100|       |
 4101|  73.6k|  if (is_one_pass_rt_params(cpi) ||
  ------------------
  |  Branch (4101:7): [True: 24.4k, False: 49.2k]
  ------------------
 4102|  49.2k|      (cpi->oxcf.q_cfg.deltaq_mode != DELTA_Q_PERCEPTUAL) ||
  ------------------
  |  Branch (4102:7): [True: 49.2k, False: 0]
  ------------------
 4103|      0|      (is_fp_wavelet_energy_invalid(total_stats) == 0))
  ------------------
  |  Branch (4103:7): [True: 0, False: 0]
  ------------------
 4104|  73.6k|    return;
 4105|       |
 4106|      0|  const int num_mbs = (cpi->oxcf.resize_cfg.resize_mode != RESIZE_NONE)
  ------------------
  |  Branch (4106:23): [True: 0, False: 0]
  ------------------
 4107|      0|                          ? cpi->initial_mbs
 4108|      0|                          : cpi->common.mi_params.MBs;
 4109|      0|  const YV12_BUFFER_CONFIG *const unfiltered_source = cpi->unfiltered_source;
 4110|      0|  const uint8_t *const src = unfiltered_source->y_buffer;
 4111|      0|  const int hbd = unfiltered_source->flags & YV12_FLAG_HIGHBITDEPTH;
  ------------------
  |  |  142|      0|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 4112|      0|  const int stride = unfiltered_source->y_stride;
 4113|      0|  const BLOCK_SIZE fp_block_size =
 4114|      0|      get_fp_block_size(cpi->is_screen_content_type);
 4115|      0|  const int fp_block_size_width = block_size_wide[fp_block_size];
 4116|      0|  const int fp_block_size_height = block_size_high[fp_block_size];
 4117|      0|  const int num_unit_cols =
 4118|      0|      get_num_blocks(unfiltered_source->y_crop_width, fp_block_size_width);
 4119|      0|  const int num_unit_rows =
 4120|      0|      get_num_blocks(unfiltered_source->y_crop_height, fp_block_size_height);
 4121|      0|  const int num_8x8_cols = num_unit_cols * (fp_block_size_width / 8);
 4122|      0|  const int num_8x8_rows = num_unit_rows * (fp_block_size_height / 8);
 4123|      0|  int64_t frame_avg_wavelet_energy = av1_haar_ac_sad_mxn_uint8_input(
 4124|      0|      src, stride, hbd, num_8x8_rows, num_8x8_cols);
 4125|       |
 4126|      0|  cpi->twopass_frame.frame_avg_haar_energy =
 4127|      0|      log1p((double)frame_avg_wavelet_energy / num_mbs);
 4128|      0|}
encoder.c:update_counters_for_show_frame:
 1130|  73.6k|static inline void update_counters_for_show_frame(AV1_COMP *const cpi) {
 1131|       |  assert(cpi->common.show_frame);
 1132|  73.6k|  cpi->frame_index_set.show_frame_count++;
 1133|  73.6k|  cpi->common.current_frame.frame_number++;
 1134|  73.6k|}
encoder.c:encode_with_recode_loop_and_filter:
 3739|  73.6k|                                              int *largest_tile_id) {
 3740|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3741|       |  start_timing(cpi, encode_with_or_without_recode_time);
 3742|       |#endif
 3743|   809k|  for (int i = 0; i < NUM_RECODES_PER_FRAME; i++) {
  ------------------
  |  | 1647|   809k|#define NUM_RECODES_PER_FRAME 10
  ------------------
  |  Branch (3743:19): [True: 736k, False: 73.6k]
  ------------------
 3744|   736k|    cpi->do_update_frame_probs_txtype[i] = 0;
 3745|   736k|    cpi->do_update_frame_probs_obmc[i] = 0;
 3746|   736k|    cpi->do_update_frame_probs_warp[i] = 0;
 3747|   736k|    cpi->do_update_frame_probs_interpfilter[i] = 0;
 3748|   736k|  }
 3749|       |
 3750|  73.6k|  cpi->do_update_vbr_bits_off_target_fast = 0;
 3751|  73.6k|  int err;
 3752|       |#if CONFIG_REALTIME_ONLY
 3753|       |  err = encode_without_recode(cpi);
 3754|       |#else
 3755|  73.6k|  if (cpi->sf.hl_sf.recode_loop == DISALLOW_RECODE)
  ------------------
  |  Branch (3755:7): [True: 73.6k, False: 0]
  ------------------
 3756|  73.6k|    err = encode_without_recode(cpi);
 3757|      0|  else
 3758|      0|    err = encode_with_recode_loop(cpi, size, dest, dest_size);
 3759|  73.6k|#endif
 3760|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3761|       |  end_timing(cpi, encode_with_or_without_recode_time);
 3762|       |#endif
 3763|  73.6k|  if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 73.6k]
  ------------------
 3764|      0|    if (err == -1) {
  ------------------
  |  Branch (3764:9): [True: 0, False: 0]
  ------------------
 3765|       |      // special case as described in encode_with_recode_loop().
 3766|       |      // Encoding was skipped.
 3767|      0|      err = AOM_CODEC_OK;
 3768|      0|      if (sse != NULL) *sse = INT64_MAX;
  ------------------
  |  Branch (3768:11): [True: 0, False: 0]
  ------------------
 3769|      0|      if (rate != NULL) *rate = INT64_MAX;
  ------------------
  |  Branch (3769:11): [True: 0, False: 0]
  ------------------
 3770|      0|      *largest_tile_id = 0;
 3771|      0|    }
 3772|      0|    return err;
 3773|      0|  }
 3774|       |
 3775|       |#ifdef OUTPUT_YUV_DENOISED
 3776|       |  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 3777|       |  if (oxcf->noise_sensitivity > 0 && denoise_svc(cpi)) {
 3778|       |    aom_write_yuv_frame(yuv_denoised_file,
 3779|       |                        &cpi->denoiser.running_avg_y[INTRA_FRAME]);
 3780|       |  }
 3781|       |#endif
 3782|       |
 3783|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 3784|  73.6k|  SequenceHeader *const seq_params = cm->seq_params;
 3785|       |
 3786|       |  // Special case code to reduce pulsing when key frames are forced at a
 3787|       |  // fixed interval. Note the reconstruction error if it is the frame before
 3788|       |  // the force key frame
 3789|  73.6k|  if (cpi->ppi->p_rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) {
  ------------------
  |  Branch (3789:7): [True: 0, False: 73.6k]
  |  Branch (3789:47): [True: 0, False: 0]
  ------------------
 3790|      0|#if CONFIG_AV1_HIGHBITDEPTH
 3791|      0|    if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (3791:9): [True: 0, False: 0]
  ------------------
 3792|      0|      cpi->ambient_err = aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf);
 3793|      0|    } else {
 3794|      0|      cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf);
 3795|      0|    }
 3796|       |#else
 3797|       |    cpi->ambient_err = aom_get_y_sse(cpi->source, &cm->cur_frame->buf);
 3798|       |#endif
 3799|      0|  }
 3800|       |
 3801|  73.6k|  cm->cur_frame->buf.color_primaries = seq_params->color_primaries;
 3802|  73.6k|  cm->cur_frame->buf.transfer_characteristics =
 3803|  73.6k|      seq_params->transfer_characteristics;
 3804|  73.6k|  cm->cur_frame->buf.matrix_coefficients = seq_params->matrix_coefficients;
 3805|  73.6k|  cm->cur_frame->buf.monochrome = seq_params->monochrome;
 3806|  73.6k|  cm->cur_frame->buf.chroma_sample_position =
 3807|  73.6k|      seq_params->chroma_sample_position;
 3808|  73.6k|  cm->cur_frame->buf.color_range = seq_params->color_range;
 3809|  73.6k|  cm->cur_frame->buf.render_width = cm->render_width;
 3810|  73.6k|  cm->cur_frame->buf.render_height = cm->render_height;
 3811|       |
 3812|  73.6k|  if (!cpi->mt_info.pipeline_lpf_mt_with_enc)
  ------------------
  |  Branch (3812:7): [True: 54.7k, False: 18.9k]
  ------------------
 3813|  54.7k|    set_postproc_filter_default_params(&cpi->common);
 3814|       |
 3815|  73.6k|  if (!cm->features.allow_intrabc) {
  ------------------
  |  Branch (3815:7): [True: 73.6k, False: 0]
  ------------------
 3816|  73.6k|    loopfilter_frame(cpi, cm);
 3817|  73.6k|  }
 3818|       |
 3819|  73.6k|  if (cpi->oxcf.mode != ALLINTRA && !cpi->ppi->rtc_ref.non_reference_frame) {
  ------------------
  |  Branch (3819:7): [True: 73.6k, False: 0]
  |  Branch (3819:37): [True: 73.6k, False: 0]
  ------------------
 3820|  73.6k|    extend_frame_borders(cpi);
 3821|  73.6k|  }
 3822|       |
 3823|       |#ifdef OUTPUT_YUV_REC
 3824|       |  aom_write_one_yuv_frame(cm, &cm->cur_frame->buf);
 3825|       |#endif
 3826|       |
 3827|  73.6k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_FILM) {
  ------------------
  |  Branch (3827:7): [True: 0, False: 73.6k]
  ------------------
 3828|      0|    set_grain_syn_params(cm);
 3829|      0|  }
 3830|       |
 3831|  73.6k|  av1_finalize_encoded_frame(cpi);
 3832|       |  // Build the bitstream
 3833|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3834|       |  start_timing(cpi, av1_pack_bitstream_final_time);
 3835|       |#endif
 3836|  73.6k|  cpi->rc.coefficient_size = 0;
 3837|  73.6k|  if (av1_pack_bitstream(cpi, dest, dest_size, size, largest_tile_id) !=
  ------------------
  |  Branch (3837:7): [True: 0, False: 73.6k]
  ------------------
 3838|  73.6k|      AOM_CODEC_OK)
 3839|      0|    return AOM_CODEC_ERROR;
 3840|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3841|       |  end_timing(cpi, av1_pack_bitstream_final_time);
 3842|       |#endif
 3843|       |
 3844|  73.6k|  if (cpi->rc.postencode_drop && allow_postencode_drop_rtc(cpi) &&
  ------------------
  |  Branch (3844:7): [True: 0, False: 73.6k]
  |  Branch (3844:34): [True: 0, False: 0]
  ------------------
 3845|      0|      av1_postencode_drop_cbr(cpi, size)) {
  ------------------
  |  Branch (3845:7): [True: 0, False: 0]
  ------------------
 3846|      0|    return AOM_CODEC_OK;
 3847|      0|  }
 3848|       |
 3849|       |  // Compute sse and rate.
 3850|  73.6k|  if (sse != NULL) {
  ------------------
  |  Branch (3850:7): [True: 0, False: 73.6k]
  ------------------
 3851|      0|#if CONFIG_AV1_HIGHBITDEPTH
 3852|      0|    *sse = (seq_params->use_highbitdepth)
  ------------------
  |  Branch (3852:12): [True: 0, False: 0]
  ------------------
 3853|      0|               ? aom_highbd_get_y_sse(cpi->source, &cm->cur_frame->buf)
 3854|      0|               : aom_get_y_sse(cpi->source, &cm->cur_frame->buf);
 3855|       |#else
 3856|       |    *sse = aom_get_y_sse(cpi->source, &cm->cur_frame->buf);
 3857|       |#endif
 3858|      0|  }
 3859|  73.6k|  if (rate != NULL) {
  ------------------
  |  Branch (3859:7): [True: 0, False: 73.6k]
  ------------------
 3860|      0|    const int64_t bits = (*size << 3);
 3861|      0|    *rate = (bits << 5);  // To match scale.
 3862|      0|  }
 3863|       |
 3864|  73.6k|#if !CONFIG_REALTIME_ONLY
 3865|  73.6k|  if (cpi->use_ducky_encode) {
  ------------------
  |  Branch (3865:7): [True: 0, False: 73.6k]
  ------------------
 3866|      0|    PSNR_STATS psnr;
 3867|      0|    aom_calc_psnr(cpi->source, &cpi->common.cur_frame->buf, &psnr);
 3868|      0|    DuckyEncodeFrameResult *frame_result = &cpi->ducky_encode_info.frame_result;
 3869|      0|    frame_result->global_order_idx = cm->cur_frame->display_order_hint;
 3870|      0|    frame_result->q_index = cm->quant_params.base_qindex;
 3871|      0|    frame_result->rdmult = cpi->rd.RDMULT;
 3872|      0|    frame_result->rate = (int)(*size) * 8;
 3873|      0|    frame_result->dist = psnr.sse[0];
 3874|      0|    frame_result->psnr = psnr.psnr[0];
 3875|      0|  }
 3876|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 3877|       |
 3878|  73.6k|  return AOM_CODEC_OK;
 3879|  73.6k|}
encoder.c:encode_without_recode:
 2987|  73.6k|static int encode_without_recode(AV1_COMP *cpi) {
 2988|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 2989|  73.6k|  const QuantizationCfg *const q_cfg = &cpi->oxcf.q_cfg;
 2990|  73.6k|  SVC *const svc = &cpi->svc;
 2991|  73.6k|  const int resize_pending = is_frame_resize_pending(cpi);
 2992|  73.6k|  int top_index = 0, bottom_index = 0, q = 0;
 2993|  73.6k|  YV12_BUFFER_CONFIG *unscaled = cpi->unscaled_source;
 2994|  73.6k|  InterpFilter filter_scaler =
 2995|  73.6k|      cpi->ppi->use_svc ? svc->downsample_filter_type[svc->spatial_layer_id]
  ------------------
  |  Branch (2995:7): [True: 0, False: 73.6k]
  ------------------
 2996|  73.6k|                        : EIGHTTAP_SMOOTH;
 2997|  73.6k|  int phase_scaler = cpi->ppi->use_svc
  ------------------
  |  Branch (2997:22): [True: 0, False: 73.6k]
  ------------------
 2998|  73.6k|                         ? svc->downsample_filter_phase[svc->spatial_layer_id]
 2999|  73.6k|                         : 0;
 3000|       |
 3001|  73.6k|  if (cpi->rc.postencode_drop && allow_postencode_drop_rtc(cpi))
  ------------------
  |  Branch (3001:7): [True: 0, False: 73.6k]
  |  Branch (3001:34): [True: 0, False: 0]
  ------------------
 3002|      0|    av1_save_all_coding_context(cpi);
 3003|       |
 3004|  73.6k|  set_size_independent_vars(cpi);
 3005|  73.6k|  av1_setup_frame_size(cpi);
 3006|  73.6k|  cm->prev_frame = get_primary_ref_frame_buf(cm);
 3007|  73.6k|  av1_set_size_dependent_vars(cpi, &q, &bottom_index, &top_index);
 3008|  73.6k|  av1_set_mv_search_params(cpi);
 3009|       |
 3010|  73.6k|  const SequenceHeader *seq_params = cm->seq_params;
 3011|  73.6k|  if ((cpi->svc.source_last_TL0.buffer_alloc_sz == 0 ||
  ------------------
  |  Branch (3011:8): [True: 73.6k, False: 0]
  ------------------
 3012|      0|       cpi->svc.source_last_TL0.y_crop_width != cpi->oxcf.frm_dim_cfg.width ||
  ------------------
  |  Branch (3012:8): [True: 0, False: 0]
  ------------------
 3013|      0|       cpi->svc.source_last_TL0.y_crop_height != cpi->oxcf.frm_dim_cfg.height ||
  ------------------
  |  Branch (3013:8): [True: 0, False: 0]
  ------------------
 3014|      0|       cpi->svc.source_last_TL0.subsampling_x != seq_params->subsampling_x ||
  ------------------
  |  Branch (3014:8): [True: 0, False: 0]
  ------------------
 3015|      0|       cpi->svc.source_last_TL0.subsampling_y != seq_params->subsampling_y ||
  ------------------
  |  Branch (3015:8): [True: 0, False: 0]
  ------------------
 3016|      0|       cpi->svc.source_last_TL0.flags != cpi->source->flags) &&
  ------------------
  |  Branch (3016:8): [True: 0, False: 0]
  ------------------
 3017|  73.6k|      (cpi->ppi->use_svc || cpi->oxcf.rc_cfg.drop_frames_water_mark > 0)) {
  ------------------
  |  Branch (3017:8): [True: 0, False: 73.6k]
  |  Branch (3017:29): [True: 0, False: 73.6k]
  ------------------
 3018|      0|    if (aom_alloc_frame_buffer(
  ------------------
  |  Branch (3018:9): [True: 0, False: 0]
  ------------------
 3019|      0|            &cpi->svc.source_last_TL0, cpi->oxcf.frm_dim_cfg.width,
 3020|      0|            cpi->oxcf.frm_dim_cfg.height, seq_params->subsampling_x,
 3021|      0|            seq_params->subsampling_y, seq_params->use_highbitdepth,
 3022|      0|            cpi->oxcf.border_in_pixels, cm->features.byte_alignment, false,
 3023|      0|            0)) {
 3024|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 3025|      0|                         "Failed to allocate buffer for source_last_TL0");
 3026|      0|    }
 3027|      0|  }
 3028|       |
 3029|  73.6k|  if (!cpi->ppi->use_svc) {
  ------------------
  |  Branch (3029:7): [True: 73.6k, False: 0]
  ------------------
 3030|  73.6k|    phase_scaler = 8;
 3031|       |    // 2:1 scaling.
 3032|  73.6k|    if ((cm->width << 1) == unscaled->y_crop_width &&
  ------------------
  |  Branch (3032:9): [True: 4.36k, False: 69.2k]
  ------------------
 3033|  4.36k|        (cm->height << 1) == unscaled->y_crop_height) {
  ------------------
  |  Branch (3033:9): [True: 555, False: 3.81k]
  ------------------
 3034|    555|      filter_scaler = BILINEAR;
 3035|       |      // For lower resolutions use eighttap_smooth.
 3036|    555|      if (cm->width * cm->height <= 320 * 180) filter_scaler = EIGHTTAP_SMOOTH;
  ------------------
  |  Branch (3036:11): [True: 555, False: 0]
  ------------------
 3037|  73.0k|    } else if ((cm->width << 2) == unscaled->y_crop_width &&
  ------------------
  |  Branch (3037:16): [True: 3.00k, False: 70.0k]
  ------------------
 3038|  3.00k|               (cm->height << 2) == unscaled->y_crop_height) {
  ------------------
  |  Branch (3038:16): [True: 362, False: 2.63k]
  ------------------
 3039|       |      // 4:1 scaling.
 3040|    362|      filter_scaler = EIGHTTAP_SMOOTH;
 3041|  72.7k|    } else if ((cm->width << 2) == 3 * unscaled->y_crop_width &&
  ------------------
  |  Branch (3041:16): [True: 4.61k, False: 68.0k]
  ------------------
 3042|  4.61k|               (cm->height << 2) == 3 * unscaled->y_crop_height) {
  ------------------
  |  Branch (3042:16): [True: 659, False: 3.95k]
  ------------------
 3043|       |      // 4:3 scaling.
 3044|    659|      filter_scaler = EIGHTTAP_REGULAR;
 3045|    659|    }
 3046|  73.6k|  }
 3047|       |
 3048|  73.6k|  allocate_gradient_info_for_hog(cpi);
 3049|       |
 3050|  73.6k|  allocate_src_var_of_4x4_sub_block_buf(cpi);
 3051|       |
 3052|  73.6k|  const SPEED_FEATURES *sf = &cpi->sf;
 3053|  73.6k|  if (sf->part_sf.partition_search_type == VAR_BASED_PARTITION)
  ------------------
  |  Branch (3053:7): [True: 24.4k, False: 49.2k]
  ------------------
 3054|  24.4k|    variance_partition_alloc(cpi);
 3055|       |
 3056|  73.6k|  if (cm->current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (3056:7): [True: 18.4k, False: 55.2k]
  ------------------
 3057|  55.2k|      ((sf->inter_sf.extra_prune_warped && cpi->refresh_frame.golden_frame)))
  ------------------
  |  Branch (3057:9): [True: 18.3k, False: 36.9k]
  |  Branch (3057:44): [True: 0, False: 18.3k]
  ------------------
 3058|  18.4k|    copy_frame_prob_info(cpi);
 3059|       |
 3060|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3061|       |  printf("\n Encoding a frame: \n");
 3062|       |#endif
 3063|       |
 3064|       |#if CONFIG_TUNE_BUTTERAUGLI
 3065|       |  if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_BUTTERAUGLI) {
 3066|       |    av1_setup_butteraugli_rdmult(cpi);
 3067|       |  }
 3068|       |#endif
 3069|       |
 3070|  73.6k|  cpi->source = av1_realloc_and_scale_if_required(
 3071|  73.6k|      cm, unscaled, &cpi->scaled_source, filter_scaler, phase_scaler, true,
 3072|  73.6k|      false, cpi->oxcf.border_in_pixels, cpi->alloc_pyramid);
 3073|  73.6k|  if (frame_is_intra_only(cm) || resize_pending != 0) {
  ------------------
  |  Branch (3073:7): [True: 18.4k, False: 55.2k]
  |  Branch (3073:34): [True: 26.5k, False: 28.6k]
  ------------------
 3074|  44.9k|    const int current_size =
 3075|  44.9k|        (cm->mi_params.mi_rows * cm->mi_params.mi_cols) >> 2;
 3076|  44.9k|    if (cpi->consec_zero_mv &&
  ------------------
  |  Branch (3076:9): [True: 44.9k, False: 0]
  ------------------
 3077|  44.9k|        (cpi->consec_zero_mv_alloc_size < current_size)) {
  ------------------
  |  Branch (3077:9): [True: 0, False: 44.9k]
  ------------------
 3078|      0|      aom_free(cpi->consec_zero_mv);
 3079|      0|      cpi->consec_zero_mv_alloc_size = 0;
 3080|      0|      CHECK_MEM_ERROR(cm, cpi->consec_zero_mv,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3081|      0|                      aom_malloc(current_size * sizeof(*cpi->consec_zero_mv)));
 3082|      0|      cpi->consec_zero_mv_alloc_size = current_size;
 3083|      0|    }
 3084|  44.9k|    assert(cpi->consec_zero_mv != NULL);
 3085|  44.9k|    memset(cpi->consec_zero_mv, 0, current_size * sizeof(*cpi->consec_zero_mv));
 3086|  44.9k|  }
 3087|       |
 3088|  73.6k|  if (cpi->scaled_last_source_available) {
  ------------------
  |  Branch (3088:7): [True: 18.4k, False: 55.2k]
  ------------------
 3089|  18.4k|    cpi->last_source = &cpi->scaled_last_source;
 3090|  18.4k|    cpi->scaled_last_source_available = 0;
 3091|  55.2k|  } else if (cpi->unscaled_last_source != NULL) {
  ------------------
  |  Branch (3091:14): [True: 36.8k, False: 18.4k]
  ------------------
 3092|  36.8k|    cpi->last_source = av1_realloc_and_scale_if_required(
 3093|  36.8k|        cm, cpi->unscaled_last_source, &cpi->scaled_last_source, filter_scaler,
 3094|  36.8k|        phase_scaler, true, false, cpi->oxcf.border_in_pixels,
 3095|  36.8k|        cpi->alloc_pyramid);
 3096|  36.8k|  }
 3097|       |
 3098|  73.6k|  if (cpi->sf.rt_sf.use_temporal_noise_estimate) {
  ------------------
  |  Branch (3098:7): [True: 0, False: 73.6k]
  ------------------
 3099|      0|    av1_update_noise_estimate(cpi);
 3100|      0|  }
 3101|       |
 3102|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3103|       |  if (cpi->oxcf.noise_sensitivity > 0 && cpi->ppi->use_svc)
 3104|       |    av1_denoiser_reset_on_first_frame(cpi);
 3105|       |#endif
 3106|       |
 3107|       |  // For 1 spatial layer encoding: if the (non-LAST) reference has different
 3108|       |  // resolution from the source then disable that reference. This is to avoid
 3109|       |  // significant increase in encode time from scaling the references in
 3110|       |  // av1_scale_references. Note GOLDEN is forced to update on the (first/tigger)
 3111|       |  // resized frame and ALTREF will be refreshed ~4 frames later, so both
 3112|       |  // references become available again after few frames.
 3113|       |  // For superres: don't disable golden reference.
 3114|  73.6k|  if (svc->number_spatial_layers == 1) {
  ------------------
  |  Branch (3114:7): [True: 73.6k, False: 0]
  ------------------
 3115|  73.6k|    if (!cpi->oxcf.superres_cfg.enable_superres) {
  ------------------
  |  Branch (3115:9): [True: 73.6k, False: 0]
  ------------------
 3116|  73.6k|      if (cpi->ref_frame_flags & av1_ref_frame_flag_list[GOLDEN_FRAME]) {
  ------------------
  |  Branch (3116:11): [True: 0, False: 73.6k]
  ------------------
 3117|      0|        const YV12_BUFFER_CONFIG *const ref =
 3118|      0|            get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
 3119|      0|        if (ref == NULL || ref->y_crop_width != cm->width ||
  ------------------
  |  Branch (3119:13): [True: 0, False: 0]
  |  Branch (3119:28): [True: 0, False: 0]
  ------------------
 3120|      0|            ref->y_crop_height != cm->height) {
  ------------------
  |  Branch (3120:13): [True: 0, False: 0]
  ------------------
 3121|      0|          cpi->ref_frame_flags ^= AOM_GOLD_FLAG;
 3122|      0|        }
 3123|      0|      }
 3124|  73.6k|    }
 3125|  73.6k|    if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]) {
  ------------------
  |  Branch (3125:9): [True: 0, False: 73.6k]
  ------------------
 3126|      0|      const YV12_BUFFER_CONFIG *const ref =
 3127|      0|          get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
 3128|      0|      if (ref == NULL || ref->y_crop_width != cm->width ||
  ------------------
  |  Branch (3128:11): [True: 0, False: 0]
  |  Branch (3128:26): [True: 0, False: 0]
  ------------------
 3129|      0|          ref->y_crop_height != cm->height) {
  ------------------
  |  Branch (3129:11): [True: 0, False: 0]
  ------------------
 3130|      0|        cpi->ref_frame_flags ^= AOM_ALT_FLAG;
 3131|      0|      }
 3132|      0|    }
 3133|  73.6k|  }
 3134|       |
 3135|  73.6k|  int scale_references = 0;
 3136|       |#if CONFIG_FPMT_TEST
 3137|       |  scale_references =
 3138|       |      cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE ? 1 : 0;
 3139|       |#endif  // CONFIG_FPMT_TEST
 3140|  73.6k|  if (scale_references ||
  ------------------
  |  Branch (3140:7): [True: 0, False: 73.6k]
  ------------------
 3141|  73.6k|      cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
  ------------------
  |  Branch (3141:7): [True: 73.6k, False: 0]
  ------------------
 3142|  73.6k|    if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (3142:9): [True: 55.2k, False: 18.4k]
  ------------------
 3143|  55.2k|      av1_scale_references(cpi, filter_scaler, phase_scaler, 1);
 3144|  55.2k|    }
 3145|  73.6k|  }
 3146|       |
 3147|  73.6k|  av1_set_quantizer(cm, q_cfg->qm_minlevel, q_cfg->qm_maxlevel, q,
 3148|  73.6k|                    q_cfg->enable_chroma_deltaq, q_cfg->enable_hdr_deltaq,
 3149|  73.6k|                    cpi->oxcf.mode == ALLINTRA, cpi->oxcf.tune_cfg.tuning);
 3150|  73.6k|  av1_set_speed_features_qindex_dependent(cpi, cpi->oxcf.speed);
 3151|  73.6k|  av1_init_quantizer(&cpi->enc_quant_dequant_params, &cm->quant_params,
 3152|  73.6k|                     cm->seq_params->bit_depth, cpi->oxcf.algo_cfg.sharpness);
 3153|  73.6k|  av1_set_variance_partition_thresholds(cpi, q, 0);
 3154|  73.6k|  av1_setup_frame(cpi);
 3155|       |
 3156|       |  // Check if this high_source_sad (scene/slide change) frame should be
 3157|       |  // encoded at high/max QP, and if so, set the q and adjust some rate
 3158|       |  // control parameters.
 3159|  73.6k|  if (cpi->sf.rt_sf.overshoot_detection_cbr == FAST_DETECTION_MAXQ &&
  ------------------
  |  Branch (3159:7): [True: 18.3k, False: 55.3k]
  ------------------
 3160|  18.3k|      cpi->rc.high_source_sad) {
  ------------------
  |  Branch (3160:7): [True: 0, False: 18.3k]
  ------------------
 3161|      0|    if (av1_encodedframe_overshoot_cbr(cpi, &q)) {
  ------------------
  |  Branch (3161:9): [True: 0, False: 0]
  ------------------
 3162|      0|      av1_set_quantizer(cm, q_cfg->qm_minlevel, q_cfg->qm_maxlevel, q,
 3163|      0|                        q_cfg->enable_chroma_deltaq, q_cfg->enable_hdr_deltaq,
 3164|      0|                        cpi->oxcf.mode == ALLINTRA, cpi->oxcf.tune_cfg.tuning);
 3165|      0|      av1_set_speed_features_qindex_dependent(cpi, cpi->oxcf.speed);
 3166|      0|      av1_init_quantizer(&cpi->enc_quant_dequant_params, &cm->quant_params,
 3167|      0|                         cm->seq_params->bit_depth,
 3168|      0|                         cpi->oxcf.algo_cfg.sharpness);
 3169|      0|      av1_set_variance_partition_thresholds(cpi, q, 0);
 3170|      0|      if (frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
  ------------------
  |  Branch (3170:11): [True: 0, False: 0]
  |  Branch (3170:38): [True: 0, False: 0]
  ------------------
 3171|      0|          cm->features.primary_ref_frame == PRIMARY_REF_NONE)
  ------------------
  |  |   66|      0|#define PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3171:11): [True: 0, False: 0]
  ------------------
 3172|      0|        av1_setup_frame(cpi);
 3173|      0|    }
 3174|      0|  }
 3175|  73.6k|  av1_apply_active_map(cpi);
 3176|  73.6k|  if (cpi->roi.enabled) {
  ------------------
  |  Branch (3176:7): [True: 0, False: 73.6k]
  ------------------
 3177|       |    // For now if roi map is used: don't setup cyclic refresh.
 3178|      0|    av1_apply_roi_map(cpi);
 3179|  73.6k|  } else if (q_cfg->aq_mode == CYCLIC_REFRESH_AQ) {
  ------------------
  |  Branch (3179:14): [True: 0, False: 73.6k]
  ------------------
 3180|      0|    av1_cyclic_refresh_setup(cpi);
 3181|      0|  }
 3182|  73.6k|  if (cm->seg.enabled) {
  ------------------
  |  Branch (3182:7): [True: 0, False: 73.6k]
  ------------------
 3183|      0|    if (!cm->seg.update_data && cm->prev_frame) {
  ------------------
  |  Branch (3183:9): [True: 0, False: 0]
  |  Branch (3183:33): [True: 0, False: 0]
  ------------------
 3184|      0|      segfeatures_copy(&cm->seg, &cm->prev_frame->seg);
 3185|      0|      cm->seg.enabled = cm->prev_frame->seg.enabled;
 3186|      0|    } else {
 3187|      0|      av1_calculate_segdata(&cm->seg);
 3188|      0|    }
 3189|  73.6k|  } else {
 3190|  73.6k|    memset(&cm->seg, 0, sizeof(cm->seg));
 3191|  73.6k|  }
 3192|  73.6k|  segfeatures_copy(&cm->cur_frame->seg, &cm->seg);
 3193|  73.6k|  cm->cur_frame->seg.enabled = cm->seg.enabled;
 3194|       |
 3195|       |  // This is for rtc temporal filtering case.
 3196|  73.6k|  if (is_psnr_calc_enabled(cpi) && cpi->sf.rt_sf.use_rtc_tf) {
  ------------------
  |  Branch (3196:7): [True: 0, False: 73.6k]
  |  Branch (3196:36): [True: 0, False: 0]
  ------------------
 3197|      0|    if (cpi->orig_source.buffer_alloc_sz == 0 ||
  ------------------
  |  Branch (3197:9): [True: 0, False: 0]
  ------------------
 3198|      0|        cpi->orig_source.y_crop_width != cpi->source->y_crop_width ||
  ------------------
  |  Branch (3198:9): [True: 0, False: 0]
  ------------------
 3199|      0|        cpi->orig_source.y_crop_height != cpi->source->y_crop_height ||
  ------------------
  |  Branch (3199:9): [True: 0, False: 0]
  ------------------
 3200|      0|        cpi->orig_source.subsampling_x != cpi->source->subsampling_x ||
  ------------------
  |  Branch (3200:9): [True: 0, False: 0]
  ------------------
 3201|      0|        cpi->orig_source.subsampling_y != cpi->source->subsampling_y ||
  ------------------
  |  Branch (3201:9): [True: 0, False: 0]
  ------------------
 3202|      0|        cpi->orig_source.flags != cpi->source->flags) {
  ------------------
  |  Branch (3202:9): [True: 0, False: 0]
  ------------------
 3203|       |      // Allocate a source buffer to store the original source for psnr
 3204|       |      // calculation.
 3205|      0|      const int use_highbitdepth =
 3206|      0|          (cpi->source->flags & YV12_FLAG_HIGHBITDEPTH) != 0;
  ------------------
  |  |  142|      0|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
 3207|      0|      if (aom_alloc_frame_buffer(&cpi->orig_source, cpi->source->y_crop_width,
  ------------------
  |  Branch (3207:11): [True: 0, False: 0]
  ------------------
 3208|      0|                                 cpi->source->y_crop_height,
 3209|      0|                                 cpi->source->subsampling_x,
 3210|      0|                                 cpi->source->subsampling_y, use_highbitdepth,
 3211|      0|                                 cpi->oxcf.border_in_pixels,
 3212|      0|                                 cm->features.byte_alignment, false, 0))
 3213|      0|        aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 3214|      0|                           "Failed to allocate cpi->orig_source buffer");
 3215|      0|    }
 3216|       |
 3217|      0|    aom_yv12_copy_y(cpi->source, &cpi->orig_source, 1);
  ------------------
  |  |   46|      0|#define aom_yv12_copy_y aom_yv12_copy_y_c
  ------------------
 3218|      0|    aom_yv12_copy_u(cpi->source, &cpi->orig_source, 1);
  ------------------
  |  |   40|      0|#define aom_yv12_copy_u aom_yv12_copy_u_c
  ------------------
 3219|      0|    aom_yv12_copy_v(cpi->source, &cpi->orig_source, 1);
  ------------------
  |  |   43|      0|#define aom_yv12_copy_v aom_yv12_copy_v_c
  ------------------
 3220|      0|  }
 3221|       |
 3222|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3223|       |  start_timing(cpi, av1_encode_frame_time);
 3224|       |#endif
 3225|       |
 3226|       |  // Set the motion vector precision based on mv stats from the last coded
 3227|       |  // frame.
 3228|  73.6k|  if (!frame_is_intra_only(cm)) av1_pick_and_set_high_precision_mv(cpi, q);
  ------------------
  |  Branch (3228:7): [True: 55.2k, False: 18.4k]
  ------------------
 3229|       |
 3230|  73.6k|  if (svc->temporal_layer_id == 0) {
  ------------------
  |  Branch (3230:7): [True: 73.6k, False: 0]
  ------------------
 3231|  73.6k|    cpi->rc.num_col_blscroll_last_tl0 = 0;
 3232|  73.6k|    cpi->rc.num_row_blscroll_last_tl0 = 0;
 3233|  73.6k|  }
 3234|       |
 3235|       |  // transform / motion compensation build reconstruction frame
 3236|  73.6k|  av1_encode_frame(cpi);
 3237|       |
 3238|  73.6k|  if (!cpi->rc.rtc_external_ratectrl && !frame_is_intra_only(cm))
  ------------------
  |  Branch (3238:7): [True: 73.6k, False: 0]
  |  Branch (3238:41): [True: 55.2k, False: 18.4k]
  ------------------
 3239|  55.2k|    update_motion_stat(cpi);
 3240|       |
 3241|       |  // Adjust the refresh of the golden (longer-term) reference based on QP
 3242|       |  // selected for this frame. This is for CBR real-time mode, and only
 3243|       |  // for single layer without usage of the set_ref_frame_config (so
 3244|       |  // reference structure for 1 layer is set internally).
 3245|  73.6k|  if (!frame_is_intra_only(cm) && cpi->oxcf.rc_cfg.mode == AOM_CBR &&
  ------------------
  |  Branch (3245:7): [True: 55.2k, False: 18.4k]
  |  Branch (3245:35): [True: 18.3k, False: 36.9k]
  ------------------
 3246|  18.3k|      cpi->oxcf.mode == REALTIME && svc->number_spatial_layers == 1 &&
  ------------------
  |  Branch (3246:7): [True: 18.3k, False: 0]
  |  Branch (3246:37): [True: 18.3k, False: 0]
  ------------------
 3247|  18.3k|      svc->number_temporal_layers == 1 && !cpi->rc.rtc_external_ratectrl &&
  ------------------
  |  Branch (3247:7): [True: 18.3k, False: 0]
  |  Branch (3247:43): [True: 18.3k, False: 0]
  ------------------
 3248|  18.3k|      !cpi->ppi->rtc_ref.set_ref_frame_config &&
  ------------------
  |  Branch (3248:7): [True: 18.3k, False: 0]
  ------------------
 3249|  18.3k|      sf->rt_sf.gf_refresh_based_on_qp)
  ------------------
  |  Branch (3249:7): [True: 18.3k, False: 0]
  ------------------
 3250|  18.3k|    av1_adjust_gf_refresh_qp_one_pass_rt(cpi);
 3251|       |
 3252|       |  // For non-svc: if scaling is required, copy scaled_source
 3253|       |  // into scaled_last_source.
 3254|  73.6k|  if (cm->current_frame.frame_number > 1 && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (3254:7): [True: 36.8k, False: 36.8k]
  |  Branch (3254:45): [True: 36.8k, False: 0]
  ------------------
 3255|  36.8k|      cpi->scaled_source.y_buffer != NULL &&
  ------------------
  |  Branch (3255:7): [True: 36.8k, False: 0]
  ------------------
 3256|  36.8k|      cpi->scaled_last_source.y_buffer != NULL &&
  ------------------
  |  Branch (3256:7): [True: 36.8k, False: 0]
  ------------------
 3257|  36.8k|      cpi->scaled_source.y_crop_width == cpi->scaled_last_source.y_crop_width &&
  ------------------
  |  Branch (3257:7): [True: 36.8k, False: 0]
  ------------------
 3258|  36.8k|      cpi->scaled_source.y_crop_height ==
  ------------------
  |  Branch (3258:7): [True: 36.8k, False: 0]
  ------------------
 3259|  36.8k|          cpi->scaled_last_source.y_crop_height &&
 3260|  36.8k|      (cm->width != cpi->unscaled_source->y_crop_width ||
  ------------------
  |  Branch (3260:8): [True: 18.4k, False: 18.4k]
  ------------------
 3261|  18.4k|       cm->height != cpi->unscaled_source->y_crop_height)) {
  ------------------
  |  Branch (3261:8): [True: 0, False: 18.4k]
  ------------------
 3262|  18.4k|    cpi->scaled_last_source_available = 1;
 3263|  18.4k|    aom_yv12_copy_y(&cpi->scaled_source, &cpi->scaled_last_source, 1);
  ------------------
  |  |   46|  18.4k|#define aom_yv12_copy_y aom_yv12_copy_y_c
  ------------------
 3264|  18.4k|    aom_yv12_copy_u(&cpi->scaled_source, &cpi->scaled_last_source, 1);
  ------------------
  |  |   40|  18.4k|#define aom_yv12_copy_u aom_yv12_copy_u_c
  ------------------
 3265|  18.4k|    aom_yv12_copy_v(&cpi->scaled_source, &cpi->scaled_last_source, 1);
  ------------------
  |  |   43|  18.4k|#define aom_yv12_copy_v aom_yv12_copy_v_c
  ------------------
 3266|  18.4k|  }
 3267|       |
 3268|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3269|       |  end_timing(cpi, av1_encode_frame_time);
 3270|       |#endif
 3271|       |#if CONFIG_INTERNAL_STATS
 3272|       |  ++cpi->frame_recode_hits;
 3273|       |#endif
 3274|       |
 3275|  73.6k|  return AOM_CODEC_OK;
 3276|  73.6k|}
encoder.c:update_motion_stat:
 2946|  55.2k|static void update_motion_stat(AV1_COMP *const cpi) {
 2947|  55.2k|  AV1_COMMON *const cm = &cpi->common;
 2948|  55.2k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 2949|  55.2k|  RATE_CONTROL *const rc = &cpi->rc;
 2950|  55.2k|  SVC *const svc = &cpi->svc;
 2951|  55.2k|  const int avg_cnt_zeromv =
 2952|  55.2k|      100 * cpi->rc.cnt_zeromv / (mi_params->mi_rows * mi_params->mi_cols);
 2953|  55.2k|  if (!cpi->ppi->use_svc ||
  ------------------
  |  Branch (2953:7): [True: 55.2k, False: 0]
  ------------------
 2954|      0|      (cpi->ppi->use_svc &&
  ------------------
  |  Branch (2954:8): [True: 0, False: 0]
  ------------------
 2955|      0|       !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
  ------------------
  |  Branch (2955:8): [True: 0, False: 0]
  ------------------
 2956|  55.2k|       cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
  ------------------
  |  Branch (2956:8): [True: 0, False: 0]
  ------------------
 2957|  55.2k|    rc->avg_frame_low_motion =
 2958|  55.2k|        (rc->avg_frame_low_motion == 0)
  ------------------
  |  Branch (2958:9): [True: 36.1k, False: 19.0k]
  ------------------
 2959|  55.2k|            ? avg_cnt_zeromv
 2960|  55.2k|            : (3 * rc->avg_frame_low_motion + avg_cnt_zeromv) / 4;
 2961|       |    // For SVC: set avg_frame_low_motion (only computed on top spatial layer)
 2962|       |    // to all lower spatial layers.
 2963|  55.2k|    if (cpi->ppi->use_svc &&
  ------------------
  |  Branch (2963:9): [True: 0, False: 55.2k]
  ------------------
 2964|      0|        svc->spatial_layer_id == svc->number_spatial_layers - 1) {
  ------------------
  |  Branch (2964:9): [True: 0, False: 0]
  ------------------
 2965|      0|      for (int i = 0; i < svc->number_spatial_layers - 1; ++i) {
  ------------------
  |  Branch (2965:23): [True: 0, False: 0]
  ------------------
 2966|      0|        const int layer = LAYER_IDS_TO_IDX(i, svc->temporal_layer_id,
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 2967|      0|                                           svc->number_temporal_layers);
 2968|      0|        LAYER_CONTEXT *const lc = &svc->layer_context[layer];
 2969|      0|        RATE_CONTROL *const lrc = &lc->rc;
 2970|      0|        lrc->avg_frame_low_motion = rc->avg_frame_low_motion;
 2971|      0|      }
 2972|      0|    }
 2973|  55.2k|  }
 2974|  55.2k|}
encoder.c:loopfilter_frame:
 2894|  73.6k|static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
 2895|  73.6k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 2896|  73.6k|  const int num_workers = mt_info->num_mod_workers[MOD_LPF];
 2897|  73.6k|  const int num_planes = av1_num_planes(cm);
 2898|  73.6k|  MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
 2899|  73.6k|  cpi->td.mb.rdmult = cpi->rd.RDMULT;
 2900|       |
 2901|  73.6k|  assert(IMPLIES(is_lossless_requested(&cpi->oxcf.rc_cfg),
 2902|  73.6k|                 cm->features.coded_lossless && cm->features.all_lossless));
 2903|       |
 2904|  73.6k|  const int use_loopfilter =
 2905|  73.6k|      is_loopfilter_used(cm) && !cpi->mt_info.pipeline_lpf_mt_with_enc;
  ------------------
  |  Branch (2905:7): [True: 70.2k, False: 3.40k]
  |  Branch (2905:33): [True: 52.0k, False: 18.1k]
  ------------------
 2906|  73.6k|  const int use_cdef = is_cdef_used(cm);
 2907|  73.6k|  const int use_superres = av1_superres_scaled(cm);
 2908|  73.6k|  const int use_restoration = is_restoration_used(cm);
 2909|       |
 2910|  73.6k|  const unsigned int skip_apply_postproc_filters =
 2911|  73.6k|      derive_skip_apply_postproc_filters(cpi, use_loopfilter, use_cdef,
 2912|  73.6k|                                         use_superres, use_restoration);
 2913|       |
 2914|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2915|       |  start_timing(cpi, loop_filter_time);
 2916|       |#endif
 2917|  73.6k|  if (use_loopfilter) {
  ------------------
  |  Branch (2917:7): [True: 52.0k, False: 21.5k]
  ------------------
 2918|  52.0k|    av1_pick_filter_level(cpi->source, cpi, cpi->sf.lpf_sf.lpf_pick);
 2919|  52.0k|    struct loopfilter *lf = &cm->lf;
 2920|  52.0k|    if ((lf->filter_level[0] || lf->filter_level[1]) &&
  ------------------
  |  Branch (2920:10): [True: 9.68k, False: 42.3k]
  |  Branch (2920:33): [True: 0, False: 42.3k]
  ------------------
 2921|  9.68k|        (skip_apply_postproc_filters & SKIP_APPLY_LOOPFILTER) == 0) {
  ------------------
  |  Branch (2921:9): [True: 9.68k, False: 0]
  ------------------
 2922|  9.68k|      assert(!cpi->ppi->rtc_ref.non_reference_frame);
 2923|       |      // lpf_opt_level = 1 : Enables dual/quad loop-filtering.
 2924|       |      // lpf_opt_level is set to 1 if transform size search depth in inter
 2925|       |      // blocks is limited to one as quad loop filtering assumes that all the
 2926|       |      // transform blocks within a 16x8/8x16/16x16 prediction block are of the
 2927|       |      // same size. lpf_opt_level = 2 : Filters both chroma planes together, in
 2928|       |      // addition to enabling dual/quad loop-filtering. This is enabled when lpf
 2929|       |      // pick method is LPF_PICK_FROM_Q as u and v plane filter levels are
 2930|       |      // equal.
 2931|  9.68k|      int lpf_opt_level = get_lpf_opt_level(&cpi->sf);
 2932|  9.68k|      av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, xd, 0, num_planes, 0,
 2933|  9.68k|                               mt_info->workers, num_workers,
 2934|  9.68k|                               &mt_info->lf_row_sync, lpf_opt_level);
 2935|  9.68k|    }
 2936|  52.0k|  }
 2937|       |
 2938|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2939|       |  end_timing(cpi, loop_filter_time);
 2940|       |#endif
 2941|       |
 2942|  73.6k|  cdef_restoration_frame(cpi, cm, xd, use_restoration, use_cdef,
 2943|  73.6k|                         skip_apply_postproc_filters);
 2944|  73.6k|}
encoder.c:cdef_restoration_frame:
 2800|  73.6k|                                   unsigned int skip_apply_postproc_filters) {
 2801|  73.6k|#if !CONFIG_REALTIME_ONLY
 2802|  73.6k|  if (use_restoration)
  ------------------
  |  Branch (2802:7): [True: 10.1k, False: 63.4k]
  ------------------
 2803|  10.1k|    av1_loop_restoration_save_boundary_lines(&cm->cur_frame->buf, cm, 0);
 2804|       |#else
 2805|       |  (void)use_restoration;
 2806|       |#endif
 2807|       |
 2808|  73.6k|  if (use_cdef) {
  ------------------
  |  Branch (2808:7): [True: 70.2k, False: 3.40k]
  ------------------
 2809|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2810|       |    start_timing(cpi, cdef_time);
 2811|       |#endif
 2812|  70.2k|    const int num_workers = cpi->mt_info.num_mod_workers[MOD_CDEF];
 2813|       |    // Find CDEF parameters
 2814|  70.2k|    av1_cdef_search(cpi);
 2815|       |
 2816|       |    // Apply the filter
 2817|  70.2k|    if ((skip_apply_postproc_filters & SKIP_APPLY_CDEF) == 0) {
  ------------------
  |  Branch (2817:9): [True: 70.2k, False: 0]
  ------------------
 2818|  70.2k|      assert(!cpi->ppi->rtc_ref.non_reference_frame);
 2819|  70.2k|      if (num_workers > 1) {
  ------------------
  |  Branch (2819:11): [True: 16.6k, False: 53.6k]
  ------------------
 2820|       |        // Extension of frame borders is multi-threaded along with cdef.
 2821|  16.6k|        const int do_extend_border =
 2822|  16.6k|            extend_borders_mt(cpi, MOD_CDEF, /* plane */ 0);
 2823|  16.6k|        av1_cdef_frame_mt(cm, xd, cpi->mt_info.cdef_worker,
 2824|  16.6k|                          cpi->mt_info.workers, &cpi->mt_info.cdef_sync,
 2825|  16.6k|                          num_workers, av1_cdef_init_fb_row_mt,
 2826|  16.6k|                          do_extend_border);
 2827|  53.6k|      } else {
 2828|  53.6k|        av1_cdef_frame(&cm->cur_frame->buf, cm, xd, av1_cdef_init_fb_row);
 2829|  53.6k|      }
 2830|  70.2k|    }
 2831|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2832|       |    end_timing(cpi, cdef_time);
 2833|       |#endif
 2834|  70.2k|  }
 2835|       |
 2836|  73.6k|  const int use_superres = av1_superres_scaled(cm);
 2837|  73.6k|  if (use_superres) {
  ------------------
  |  Branch (2837:7): [True: 0, False: 73.6k]
  ------------------
 2838|      0|    if ((skip_apply_postproc_filters & SKIP_APPLY_SUPERRES) == 0) {
  ------------------
  |  Branch (2838:9): [True: 0, False: 0]
  ------------------
 2839|      0|      av1_superres_post_encode(cpi);
 2840|      0|    }
 2841|      0|  }
 2842|       |
 2843|  73.6k|#if !CONFIG_REALTIME_ONLY
 2844|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2845|       |  start_timing(cpi, loop_restoration_time);
 2846|       |#endif
 2847|  73.6k|  if (use_restoration) {
  ------------------
  |  Branch (2847:7): [True: 10.1k, False: 63.4k]
  ------------------
 2848|  10.1k|    MultiThreadInfo *const mt_info = &cpi->mt_info;
 2849|  10.1k|    const int num_workers = mt_info->num_mod_workers[MOD_LR];
 2850|  10.1k|    av1_loop_restoration_save_boundary_lines(&cm->cur_frame->buf, cm, 1);
 2851|  10.1k|    av1_pick_filter_restoration(cpi->source, cpi);
 2852|  10.1k|    if ((skip_apply_postproc_filters & SKIP_APPLY_RESTORATION) == 0 &&
  ------------------
  |  Branch (2852:9): [True: 10.1k, False: 0]
  ------------------
 2853|  10.1k|        (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (2853:10): [True: 636, False: 9.52k]
  ------------------
 2854|  9.52k|         cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
  ------------------
  |  Branch (2854:10): [True: 64, False: 9.46k]
  ------------------
 2855|  9.46k|         cm->rst_info[2].frame_restoration_type != RESTORE_NONE)) {
  ------------------
  |  Branch (2855:10): [True: 39, False: 9.42k]
  ------------------
 2856|    739|      if (num_workers > 1) {
  ------------------
  |  Branch (2856:11): [True: 0, False: 739]
  ------------------
 2857|       |        // Extension of frame borders is multi-threaded along with loop
 2858|       |        // restoration filter.
 2859|      0|        const int do_extend_border = 1;
 2860|      0|        av1_loop_restoration_filter_frame_mt(
 2861|      0|            &cm->cur_frame->buf, cm, 0, mt_info->workers, num_workers,
 2862|      0|            &mt_info->lr_row_sync, &cpi->lr_ctxt, do_extend_border);
 2863|    739|      } else {
 2864|    739|        av1_loop_restoration_filter_frame(&cm->cur_frame->buf, cm, 0,
 2865|    739|                                          &cpi->lr_ctxt);
 2866|    739|      }
 2867|    739|    }
 2868|  10.1k|  }
 2869|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2870|       |  end_timing(cpi, loop_restoration_time);
 2871|       |#endif
 2872|  73.6k|#endif  // !CONFIG_REALTIME_ONLY
 2873|  73.6k|}
encoder.c:extend_borders_mt:
 2772|   245k|                                    MULTI_THREADED_MODULES stage, int plane) {
 2773|   245k|  const AV1_COMMON *const cm = &cpi->common;
 2774|   245k|  if (cpi->mt_info.num_mod_workers[stage] < 2) return 0;
  ------------------
  |  Branch (2774:7): [True: 197k, False: 48.4k]
  ------------------
 2775|  48.4k|  switch (stage) {
 2776|       |    // TODO(deepa.kg@ittiam.com): When cdef and loop-restoration are disabled,
 2777|       |    // multi-thread frame border extension along with loop filter frame.
 2778|       |    // As loop-filtering of a superblock row modifies the pixels of the
 2779|       |    // above superblock row, border extension requires that loop filtering
 2780|       |    // of the current and above superblock row is complete.
 2781|      0|    case MOD_LPF: return 0;
  ------------------
  |  Branch (2781:5): [True: 0, False: 48.4k]
  ------------------
 2782|  47.6k|    case MOD_CDEF:
  ------------------
  |  Branch (2782:5): [True: 47.6k, False: 844]
  ------------------
 2783|  47.6k|      return is_cdef_used(cm) && !cpi->ppi->rtc_ref.non_reference_frame &&
  ------------------
  |  Branch (2783:14): [True: 46.8k, False: 844]
  |  Branch (2783:34): [True: 46.8k, False: 0]
  ------------------
 2784|  46.8k|             !is_restoration_used(cm) && !av1_superres_scaled(cm);
  ------------------
  |  Branch (2784:14): [True: 46.8k, False: 0]
  |  Branch (2784:42): [True: 46.8k, False: 0]
  ------------------
 2785|    844|    case MOD_LR:
  ------------------
  |  Branch (2785:5): [True: 844, False: 47.6k]
  ------------------
 2786|    844|      return is_restoration_used(cm) &&
  ------------------
  |  Branch (2786:14): [True: 0, False: 844]
  ------------------
 2787|      0|             (cm->rst_info[plane].frame_restoration_type != RESTORE_NONE);
  ------------------
  |  Branch (2787:14): [True: 0, False: 0]
  ------------------
 2788|      0|    default: assert(0);
  ------------------
  |  Branch (2788:5): [True: 0, False: 48.4k]
  ------------------
 2789|  48.4k|  }
 2790|      0|  return 0;
 2791|  48.4k|}
encoder.c:extend_frame_borders:
 2875|  73.6k|static void extend_frame_borders(AV1_COMP *cpi) {
 2876|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 2877|       |  // TODO(debargha): Fix mv search range on encoder side
 2878|   203k|  for (int plane = 0; plane < av1_num_planes(cm); ++plane) {
  ------------------
  |  Branch (2878:23): [True: 129k, False: 73.6k]
  ------------------
 2879|   129k|    const bool extend_border_done = extend_borders_mt(cpi, MOD_CDEF, plane) ||
  ------------------
  |  Branch (2879:37): [True: 30.1k, False: 99.4k]
  ------------------
 2880|  99.4k|                                    extend_borders_mt(cpi, MOD_LR, plane);
  ------------------
  |  Branch (2880:37): [True: 0, False: 99.4k]
  ------------------
 2881|   129k|    if (!extend_border_done) {
  ------------------
  |  Branch (2881:9): [True: 99.4k, False: 30.1k]
  ------------------
 2882|  99.4k|      const YV12_BUFFER_CONFIG *const ybf = &cm->cur_frame->buf;
 2883|  99.4k|      aom_extend_frame_borders_plane_row(ybf, plane, 0,
  ------------------
  |  |   34|  99.4k|#define aom_extend_frame_borders_plane_row aom_extend_frame_borders_plane_row_c
  ------------------
 2884|  99.4k|                                         ybf->crop_heights[plane > 0]);
 2885|  99.4k|    }
 2886|   129k|  }
 2887|  73.6k|}
encoder.c:update_gm_stats:
 5215|  73.6k|static inline void update_gm_stats(AV1_COMP *cpi) {
 5216|  73.6k|  FRAME_UPDATE_TYPE update_type =
 5217|  73.6k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index];
 5218|  73.6k|  int i, is_gm_present = 0;
 5219|       |
 5220|       |  // Check if the current frame has any valid global motion model across its
 5221|       |  // reference frames
 5222|   662k|  for (i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (5222:15): [True: 588k, False: 73.6k]
  ------------------
 5223|   588k|    if (cpi->common.global_motion[i].wmtype != IDENTITY) {
  ------------------
  |  Branch (5223:9): [True: 0, False: 588k]
  ------------------
 5224|      0|      is_gm_present = 1;
 5225|      0|      break;
 5226|      0|    }
 5227|   588k|  }
 5228|  73.6k|  int update_actual_stats = 1;
 5229|       |#if CONFIG_FPMT_TEST
 5230|       |  update_actual_stats =
 5231|       |      (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
 5232|       |  if (!update_actual_stats) {
 5233|       |    if (cpi->ppi->temp_valid_gm_model_found[update_type] == INT32_MAX) {
 5234|       |      cpi->ppi->temp_valid_gm_model_found[update_type] = is_gm_present;
 5235|       |    } else {
 5236|       |      cpi->ppi->temp_valid_gm_model_found[update_type] |= is_gm_present;
 5237|       |    }
 5238|       |    int show_existing_between_parallel_frames =
 5239|       |        (cpi->ppi->gf_group.update_type[cpi->gf_frame_index] ==
 5240|       |             INTNL_OVERLAY_UPDATE &&
 5241|       |         cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index + 1] == 2);
 5242|       |    if (cpi->do_frame_data_update == 1 &&
 5243|       |        !show_existing_between_parallel_frames) {
 5244|       |      for (i = 0; i < FRAME_UPDATE_TYPES; i++) {
 5245|       |        cpi->ppi->valid_gm_model_found[i] =
 5246|       |            cpi->ppi->temp_valid_gm_model_found[i];
 5247|       |      }
 5248|       |    }
 5249|       |  }
 5250|       |#endif
 5251|  73.6k|  if (update_actual_stats) {
  ------------------
  |  Branch (5251:7): [True: 73.6k, False: 0]
  ------------------
 5252|  73.6k|    if (cpi->ppi->valid_gm_model_found[update_type] == INT32_MAX) {
  ------------------
  |  Branch (5252:9): [True: 24.6k, False: 49.0k]
  ------------------
 5253|  24.6k|      cpi->ppi->valid_gm_model_found[update_type] = is_gm_present;
 5254|  49.0k|    } else {
 5255|  49.0k|      cpi->ppi->valid_gm_model_found[update_type] |= is_gm_present;
 5256|  49.0k|    }
 5257|  73.6k|  }
 5258|  73.6k|}
encoder.c:update_fb_of_context_type:
 5159|  73.6k|                                      int *const fb_of_context_type) {
 5160|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 5161|  73.6k|  const int current_frame_ref_type = get_current_frame_ref_type(cpi);
 5162|       |
 5163|  73.6k|  if (frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
  ------------------
  |  Branch (5163:7): [True: 18.4k, False: 55.2k]
  |  Branch (5163:34): [True: 0, False: 55.2k]
  ------------------
 5164|  55.2k|      cpi->ext_flags.use_primary_ref_none) {
  ------------------
  |  Branch (5164:7): [True: 0, False: 55.2k]
  ------------------
 5165|   165k|    for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (5165:21): [True: 147k, False: 18.4k]
  ------------------
 5166|   147k|      fb_of_context_type[i] = -1;
 5167|   147k|    }
 5168|  18.4k|    fb_of_context_type[current_frame_ref_type] =
 5169|  18.4k|        cm->show_frame ? get_ref_frame_map_idx(cm, GOLDEN_FRAME)
  ------------------
  |  Branch (5169:9): [True: 18.4k, False: 0]
  ------------------
 5170|  18.4k|                       : get_ref_frame_map_idx(cm, ALTREF_FRAME);
 5171|  18.4k|  }
 5172|       |
 5173|  73.6k|  if (!encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (5173:7): [True: 73.6k, False: 0]
  ------------------
 5174|       |    // Refresh fb_of_context_type[]: see encoder.h for explanation
 5175|  73.6k|    if (cm->current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (5175:9): [True: 18.4k, False: 55.2k]
  ------------------
 5176|       |      // All ref frames are refreshed, pick one that will live long enough
 5177|  18.4k|      fb_of_context_type[current_frame_ref_type] = 0;
 5178|  55.2k|    } else {
 5179|       |      // If more than one frame is refreshed, it doesn't matter which one we
 5180|       |      // pick so pick the first.  LST sometimes doesn't refresh any: this is ok
 5181|       |
 5182|  55.2k|      for (int i = 0; i < REF_FRAMES; i++) {
  ------------------
  |  Branch (5182:23): [True: 55.2k, False: 0]
  ------------------
 5183|  55.2k|        if (cm->current_frame.refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (5183:13): [True: 55.2k, False: 0]
  ------------------
 5184|  55.2k|          fb_of_context_type[current_frame_ref_type] = i;
 5185|  55.2k|          break;
 5186|  55.2k|        }
 5187|  55.2k|      }
 5188|  55.2k|    }
 5189|  73.6k|  }
 5190|  73.6k|}
encoder.c:update_rc_counts:
 5192|  73.6k|static void update_rc_counts(AV1_COMP *cpi) {
 5193|  73.6k|  update_keyframe_counters(cpi);
 5194|  73.6k|  update_frames_till_gf_update(cpi);
 5195|  73.6k|  update_gf_group_index(cpi);
 5196|  73.6k|}
encoder.c:update_keyframe_counters:
 5116|  73.6k|static inline void update_keyframe_counters(AV1_COMP *cpi) {
 5117|  73.6k|  if (cpi->common.show_frame && cpi->rc.frames_to_key) {
  ------------------
  |  Branch (5117:7): [True: 73.6k, False: 0]
  |  Branch (5117:33): [True: 73.6k, False: 0]
  ------------------
 5118|  73.6k|#if !CONFIG_REALTIME_ONLY
 5119|  73.6k|    FIRSTPASS_INFO *firstpass_info = &cpi->ppi->twopass.firstpass_info;
 5120|  73.6k|    if (firstpass_info->past_stats_count > FIRSTPASS_INFO_STATS_PAST_MIN) {
  ------------------
  |  |  182|  73.6k|#define FIRSTPASS_INFO_STATS_PAST_MIN 1
  ------------------
  |  Branch (5120:9): [True: 0, False: 73.6k]
  ------------------
 5121|      0|      av1_firstpass_info_move_cur_index_and_pop(firstpass_info);
 5122|  73.6k|    } else {
 5123|       |      // When there is not enough past stats, we move the current
 5124|       |      // index without popping the past stats
 5125|  73.6k|      av1_firstpass_info_move_cur_index(firstpass_info);
 5126|  73.6k|    }
 5127|  73.6k|#endif
 5128|  73.6k|    if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
  ------------------
  |  Branch (5128:9): [True: 73.6k, False: 0]
  ------------------
 5129|  73.6k|      cpi->rc.frames_since_key++;
 5130|  73.6k|      cpi->rc.frames_to_key--;
 5131|  73.6k|      cpi->rc.frames_to_fwd_kf--;
 5132|  73.6k|      cpi->rc.frames_since_scene_change++;
 5133|  73.6k|    }
 5134|  73.6k|  }
 5135|  73.6k|}
encoder.c:update_frames_till_gf_update:
 5137|  73.6k|static inline void update_frames_till_gf_update(AV1_COMP *cpi) {
 5138|       |  // TODO(weitinglin): Updating this counter for is_frame_droppable
 5139|       |  // is a work-around to handle the condition when a frame is drop.
 5140|       |  // We should fix the cpi->common.show_frame flag
 5141|       |  // instead of checking the other condition to update the counter properly.
 5142|  73.6k|  if (cpi->common.show_frame ||
  ------------------
  |  Branch (5142:7): [True: 73.6k, False: 0]
  ------------------
 5143|  73.6k|      is_frame_droppable(&cpi->ppi->rtc_ref, &cpi->ext_flags.refresh_frame)) {
  ------------------
  |  Branch (5143:7): [True: 0, False: 0]
  ------------------
 5144|       |    // Decrement count down till next gf
 5145|  73.6k|    if (cpi->rc.frames_till_gf_update_due > 0)
  ------------------
  |  Branch (5145:9): [True: 73.6k, False: 0]
  ------------------
 5146|  73.6k|      cpi->rc.frames_till_gf_update_due--;
 5147|  73.6k|  }
 5148|  73.6k|}
encoder.c:update_gf_group_index:
 5150|  73.6k|static inline void update_gf_group_index(AV1_COMP *cpi) {
 5151|       |  // Increment the gf group index ready for the next frame.
 5152|  73.6k|  ++cpi->gf_frame_index;
 5153|       |  // Reset gf_frame_index in case it reaches MAX_STATIC_GF_GROUP_LENGTH.
 5154|  73.6k|  if (cpi->gf_frame_index == MAX_STATIC_GF_GROUP_LENGTH)
  ------------------
  |  |   42|  73.6k|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
  |  Branch (5154:7): [True: 0, False: 73.6k]
  ------------------
 5155|      0|    cpi->gf_frame_index = 0;
 5156|  73.6k|}
encoder.c:update_end_of_frame_stats:
 5198|  73.6k|static void update_end_of_frame_stats(AV1_COMP *cpi) {
 5199|  73.6k|  if (cpi->do_frame_data_update) {
  ------------------
  |  Branch (5199:7): [True: 73.6k, False: 0]
  ------------------
 5200|       |    // Store current frame loopfilter levels in ppi, if update flag is set.
 5201|  73.6k|    if (!cpi->common.show_existing_frame) {
  ------------------
  |  Branch (5201:9): [True: 73.6k, False: 0]
  ------------------
 5202|  73.6k|      AV1_COMMON *const cm = &cpi->common;
 5203|  73.6k|      struct loopfilter *const lf = &cm->lf;
 5204|  73.6k|      cpi->ppi->filter_level[0] = lf->backup_filter_level[0];
 5205|  73.6k|      cpi->ppi->filter_level[1] = lf->backup_filter_level[1];
 5206|  73.6k|      cpi->ppi->filter_level_u = lf->backup_filter_level_u;
 5207|  73.6k|      cpi->ppi->filter_level_v = lf->backup_filter_level_v;
 5208|  73.6k|    }
 5209|  73.6k|  }
 5210|       |  // Store frame level mv_stats from cpi to ppi.
 5211|  73.6k|  cpi->ppi->mv_stats = cpi->mv_stats;
 5212|  73.6k|}
encoder.c:Scale2Ratio:
  112|   110k|static inline void Scale2Ratio(AOM_SCALING_MODE mode, int *hr, int *hs) {
  113|   110k|  switch (mode) {
  114|      0|    case AOME_NORMAL:
  ------------------
  |  Branch (114:5): [True: 0, False: 110k]
  ------------------
  115|      0|      *hr = 1;
  116|      0|      *hs = 1;
  117|      0|      break;
  118|  26.7k|    case AOME_FOURFIVE:
  ------------------
  |  Branch (118:5): [True: 26.7k, False: 83.7k]
  ------------------
  119|  26.7k|      *hr = 4;
  120|  26.7k|      *hs = 5;
  121|  26.7k|      break;
  122|  16.7k|    case AOME_THREEFIVE:
  ------------------
  |  Branch (122:5): [True: 16.7k, False: 93.6k]
  ------------------
  123|  16.7k|      *hr = 3;
  124|  16.7k|      *hs = 5;
  125|  16.7k|      break;
  126|  23.8k|    case AOME_THREEFOUR:
  ------------------
  |  Branch (126:5): [True: 23.8k, False: 86.5k]
  ------------------
  127|  23.8k|      *hr = 3;
  128|  23.8k|      *hs = 4;
  129|  23.8k|      break;
  130|  13.1k|    case AOME_ONEFOUR:
  ------------------
  |  Branch (130:5): [True: 13.1k, False: 97.2k]
  ------------------
  131|  13.1k|      *hr = 1;
  132|  13.1k|      *hs = 4;
  133|  13.1k|      break;
  134|  14.9k|    case AOME_ONEEIGHT:
  ------------------
  |  Branch (134:5): [True: 14.9k, False: 95.5k]
  ------------------
  135|  14.9k|      *hr = 1;
  136|  14.9k|      *hs = 8;
  137|  14.9k|      break;
  138|  14.9k|    case AOME_ONETWO:
  ------------------
  |  Branch (138:5): [True: 14.9k, False: 95.4k]
  ------------------
  139|  14.9k|      *hr = 1;
  140|  14.9k|      *hs = 2;
  141|  14.9k|      break;
  142|      0|    case AOME_TWOTHREE:
  ------------------
  |  Branch (142:5): [True: 0, False: 110k]
  ------------------
  143|      0|      *hr = 2;
  144|      0|      *hs = 3;
  145|      0|      break;
  146|      0|    case AOME_ONETHREE:
  ------------------
  |  Branch (146:5): [True: 0, False: 110k]
  ------------------
  147|      0|      *hr = 1;
  148|      0|      *hs = 3;
  149|      0|      break;
  150|      0|    default:
  ------------------
  |  Branch (150:5): [True: 0, False: 110k]
  ------------------
  151|      0|      *hr = 1;
  152|      0|      *hs = 1;
  153|       |      assert(0);
  154|      0|      break;
  155|   110k|  }
  156|   110k|}

av1_cx_iface.c:get_stats_buf_size:
 4210|  36.8k|static inline int get_stats_buf_size(int num_lap_buffer, int num_lag_buffer) {
 4211|       |  /* if lookahead is enabled return num_lap_buffers else num_lag_buffers */
 4212|  36.8k|  if (num_lap_buffer > 0) {
  ------------------
  |  Branch (4212:7): [True: 0, False: 36.8k]
  ------------------
 4213|      0|    return AOMMAX(num_lap_buffer + 1, MAX_GF_LENGTH_LAP + 1);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4214|      0|  }
 4215|  36.8k|  return num_lag_buffer;
 4216|  36.8k|}
av1_cx_iface.c:is_one_pass_rt_params:
 4188|  92.0k|static inline int is_one_pass_rt_params(const AV1_COMP *cpi) {
 4189|  92.0k|  return has_no_stats_stage(cpi) && cpi->oxcf.gf_cfg.lag_in_frames == 0 &&
  ------------------
  |  Branch (4189:10): [True: 92.0k, False: 0]
  |  Branch (4189:37): [True: 92.0k, False: 0]
  ------------------
 4190|  92.0k|         (cpi->oxcf.mode == REALTIME || cpi->svc.number_spatial_layers > 1);
  ------------------
  |  Branch (4190:11): [True: 30.5k, False: 61.5k]
  |  Branch (4190:41): [True: 0, False: 61.5k]
  ------------------
 4191|  92.0k|}
av1_cx_iface.c:has_no_stats_stage:
 4174|  92.0k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|  92.0k|  assert(
 4176|  92.0k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|  92.0k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 92.0k, False: 0]
  ------------------
 4178|  92.0k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 92.0k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|  92.0k|}
av1_cx_iface.c:is_stat_generation_stage:
 4140|  92.0k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  92.0k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  92.0k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  92.0k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 92.0k]
  ------------------
 4144|  92.0k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 92.0k]
  ------------------
 4145|  92.0k|}
av1_cx_iface.c:timebase_units_to_ticks:
 4054|   147k|    const aom_rational64_t *timestamp_ratio, int64_t n) {
 4055|   147k|  return n * timestamp_ratio->num / timestamp_ratio->den;
 4056|   147k|}
av1_cx_iface.c:is_stat_consumption_stage:
 4152|   106k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|   106k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 106k]
  ------------------
 4154|   106k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 106k, False: 0]
  ------------------
 4155|   106k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 106k, False: 0]
  |  Branch (4155:55): [True: 0, False: 106k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|   106k|}
av1_cx_iface.c:is_stat_consumption_stage_twopass:
 4147|   106k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|   106k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|   106k|}
av1_cx_iface.c:ticks_to_timebase_units:
 4059|   147k|    const aom_rational64_t *timestamp_ratio, int64_t n) {
 4060|   147k|  int64_t round = timestamp_ratio->num / 2;
 4061|   147k|  if (round > 0) --round;
  ------------------
  |  Branch (4061:7): [True: 147k, False: 0]
  ------------------
 4062|   147k|  return (n * timestamp_ratio->den + round) / timestamp_ratio->num;
 4063|   147k|}
av1_quantize.c:is_stat_consumption_stage:
 4152|   167k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|   167k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 97, False: 167k]
  ------------------
 4154|   167k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 167k, False: 10]
  ------------------
 4155|   167k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 167k, False: 18.4E]
  |  Branch (4155:55): [True: 0, False: 167k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|   167k|}
av1_quantize.c:is_stat_consumption_stage_twopass:
 4147|   167k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|   167k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|   167k|}
bitstream.c:av1_resize_scaled:
 4257|  63.3k|static inline int av1_resize_scaled(const AV1_COMMON *cm) {
 4258|  63.3k|  return cm->superres_upscaled_width != cm->render_width ||
  ------------------
  |  Branch (4258:10): [True: 44.9k, False: 18.4k]
  ------------------
 4259|  18.4k|         cm->superres_upscaled_height != cm->render_height;
  ------------------
  |  Branch (4259:10): [True: 0, False: 18.4k]
  ------------------
 4260|  63.3k|}
bitstream.c:get_ref_frame_yv12_buf:
 4082|   196k|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|   196k|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|   196k|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 196k, False: 0]
  ------------------
 4085|   196k|}
bitstream.c:get_mi_ext_idx:
 4283|  2.03M|                                 const int mbmi_ext_stride) {
 4284|  2.03M|  const int mi_ext_size_1d = mi_size_wide[mi_alloc_bsize];
 4285|  2.03M|  const int mi_ext_row = mi_row / mi_ext_size_1d;
 4286|  2.03M|  const int mi_ext_col = mi_col / mi_ext_size_1d;
 4287|  2.03M|  return mi_ext_row * mbmi_ext_stride + mi_ext_col;
 4288|  2.03M|}
bitstream.c:set_ref_ptrs:
 4222|  1.87M|                                MV_REFERENCE_FRAME ref1) {
 4223|  1.87M|  xd->block_ref_scale_factors[0] =
 4224|  1.87M|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 511k, False: 1.36M]
  ------------------
 4225|  1.87M|  xd->block_ref_scale_factors[1] =
 4226|  1.87M|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 1.87M]
  ------------------
 4227|  1.87M|}
bitstream.c:encode_show_existing_frame:
 4274|   220k|static inline int encode_show_existing_frame(const AV1_COMMON *cm) {
 4275|   220k|  return cm->show_existing_frame && (!cm->features.error_resilient_mode ||
  ------------------
  |  Branch (4275:10): [True: 0, False: 220k]
  |  Branch (4275:38): [True: 0, False: 0]
  ------------------
 4276|      0|                                     cm->current_frame.frame_type == KEY_FRAME);
  ------------------
  |  Branch (4276:38): [True: 0, False: 0]
  ------------------
 4277|   220k|}
context_tree.c:is_stat_generation_stage:
 4140|  47.6k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  47.6k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  47.6k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  47.6k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 47.6k]
  ------------------
 4144|  47.6k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 47.6k]
  ------------------
 4145|  47.6k|}
encodeframe.c:is_stat_generation_stage:
 4140|   164k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|   164k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|   164k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|   164k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 164k]
  ------------------
 4144|   164k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 164k]
  ------------------
 4145|   164k|}
encodeframe.c:allocated_tokens:
 4097|  10.7k|                                            int sb_size_log2, int num_planes) {
 4098|  10.7k|  int tile_mb_rows =
 4099|  10.7k|      ROUND_POWER_OF_TWO(tile->mi_row_end - tile->mi_row_start, 2);
  ------------------
  |  |   41|  10.7k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 4100|  10.7k|  int tile_mb_cols =
 4101|  10.7k|      ROUND_POWER_OF_TWO(tile->mi_col_end - tile->mi_col_start, 2);
  ------------------
  |  |   41|  10.7k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 4102|       |
 4103|  10.7k|  return get_token_alloc(tile_mb_rows, tile_mb_cols, sb_size_log2, num_planes);
 4104|  10.7k|}
encodeframe.c:get_start_tok:
 4108|  11.1k|                                 int num_planes) {
 4109|  11.1k|  AV1_COMMON *const cm = &cpi->common;
 4110|  11.1k|  const int tile_cols = cm->tiles.cols;
 4111|  11.1k|  TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
 4112|  11.1k|  const TileInfo *const tile_info = &this_tile->tile_info;
 4113|       |
 4114|  11.1k|  const int tile_mb_cols =
 4115|  11.1k|      (tile_info->mi_col_end - tile_info->mi_col_start + 2) >> 2;
 4116|  11.1k|  const int tile_mb_row = (mi_row - tile_info->mi_row_start + 2) >> 2;
 4117|       |
 4118|  11.1k|  *tok = cpi->token_info.tile_tok[tile_row][tile_col] +
 4119|  11.1k|         get_token_alloc(tile_mb_row, tile_mb_cols, sb_size_log2, num_planes);
 4120|  11.1k|}
encodeframe.c:has_no_stats_stage:
 4174|  88.3k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|  88.3k|  assert(
 4176|  88.3k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|  88.3k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 88.3k, False: 18.4E]
  ------------------
 4178|  88.3k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 88.3k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|  88.3k|}
encodeframe.c:is_stat_consumption_stage_twopass:
 4147|  63.9k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  63.9k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  63.9k|}
encodeframe.c:is_switchable_motion_mode_allowed:
 4550|  64.6k|                                                     bool enable_obmc) {
 4551|  64.6k|  return (allow_warped_motion || enable_obmc);
  ------------------
  |  Branch (4551:11): [True: 48.4k, False: 16.1k]
  |  Branch (4551:34): [True: 16.1k, False: 0]
  ------------------
 4552|  64.6k|}
encodeframe.c:get_frame_update_type:
 4432|   122k|                                                      int gf_frame_index) {
 4433|   122k|  return gf_group->update_type[gf_frame_index];
 4434|   122k|}
encodeframe.c:av1_use_hash_me:
 4075|  73.6k|static inline int av1_use_hash_me(const AV1_COMP *const cpi) {
 4076|  73.6k|  return (cpi->common.features.allow_screen_content_tools &&
  ------------------
  |  Branch (4076:11): [True: 7.92k, False: 65.7k]
  ------------------
 4077|  7.92k|          cpi->common.features.allow_intrabc &&
  ------------------
  |  Branch (4077:11): [True: 1.98k, False: 5.94k]
  ------------------
 4078|  1.98k|          frame_is_intra_only(&cpi->common));
  ------------------
  |  Branch (4078:11): [True: 1.98k, False: 0]
  ------------------
 4079|  73.6k|}
encodeframe_utils.c:is_stat_consumption_stage:
 4152|  7.37M|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|  7.37M|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 90, False: 7.37M]
  ------------------
 4154|  7.37M|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 7.37M, False: 76]
  ------------------
 4155|  7.37M|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 7.37M, False: 18.4E]
  |  Branch (4155:55): [True: 0, False: 7.37M]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|  7.37M|}
encodeframe_utils.c:is_stat_consumption_stage_twopass:
 4147|  7.52M|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  7.52M|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  7.52M|}
encodeframe_utils.c:is_stat_generation_stage:
 4140|  2.32k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  2.32k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  2.32k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  2.32k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 2.32k]
  ------------------
 4144|  2.32k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 2.32k]
  ------------------
 4145|  2.32k|}
encodemb.c:is_stat_generation_stage:
 4140|  15.1M|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  15.1M|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  15.1M|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  15.1M|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 18.4E, False: 15.1M]
  ------------------
 4144|  15.1M|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 18.4E, False: 15.1M]
  ------------------
 4145|  15.1M|}
encoder.c:has_no_stats_stage:
 4174|   700k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|   700k|  assert(
 4176|   700k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|   700k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 700k, False: 0]
  ------------------
 4178|   700k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 700k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|   700k|}
encoder.c:is_one_pass_rt_params:
 4188|   274k|static inline int is_one_pass_rt_params(const AV1_COMP *cpi) {
 4189|   274k|  return has_no_stats_stage(cpi) && cpi->oxcf.gf_cfg.lag_in_frames == 0 &&
  ------------------
  |  Branch (4189:10): [True: 274k, False: 0]
  |  Branch (4189:37): [True: 274k, False: 0]
  ------------------
 4190|   274k|         (cpi->oxcf.mode == REALTIME || cpi->svc.number_spatial_layers > 1);
  ------------------
  |  Branch (4190:11): [True: 138k, False: 135k]
  |  Branch (4190:41): [True: 0, False: 135k]
  ------------------
 4191|   274k|}
encoder.c:is_lossless_requested:
 1127|   155k|static inline int is_lossless_requested(const RateControlCfg *const rc_cfg) {
 1128|   155k|  return rc_cfg->best_allowed_q == 0 && rc_cfg->worst_allowed_q == 0;
  ------------------
  |  Branch (1128:10): [True: 113k, False: 42.3k]
  |  Branch (1128:41): [True: 5.47k, False: 107k]
  ------------------
 1129|   155k|}
encoder.c:is_switchable_motion_mode_allowed:
 4550|   229k|                                                     bool enable_obmc) {
 4551|   229k|  return (allow_warped_motion || enable_obmc);
  ------------------
  |  Branch (4551:11): [True: 55.2k, False: 174k]
  |  Branch (4551:34): [True: 174k, False: 0]
  ------------------
 4552|   229k|}
encoder.c:is_stat_consumption_stage:
 4152|   141k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|   141k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 141k]
  ------------------
 4154|   141k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 141k, False: 0]
  ------------------
 4155|   141k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 141k, False: 0]
  |  Branch (4155:55): [True: 0, False: 141k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|   141k|}
encoder.c:is_stat_consumption_stage_twopass:
 4147|   141k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|   141k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|   141k|}
encoder.c:is_stat_generation_stage:
 4140|   548k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|   548k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|   548k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|   548k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 548k]
  ------------------
 4144|   548k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 548k]
  ------------------
 4145|   548k|}
encoder.c:alloc_frame_mvs:
 4087|   122k|static inline void alloc_frame_mvs(AV1_COMMON *const cm, RefCntBuffer *buf) {
 4088|       |  assert(buf != NULL);
 4089|   122k|  ensure_mv_buffer(buf, cm);
 4090|   122k|  buf->width = cm->width;
 4091|   122k|  buf->height = cm->height;
 4092|   122k|}
encoder.c:is_restoration_used:
 4467|   244k|static inline int is_restoration_used(const AV1_COMMON *const cm) {
 4468|   244k|  return cm->seq_params->enable_restoration && !cm->features.all_lossless &&
  ------------------
  |  Branch (4468:10): [True: 40.4k, False: 203k]
  |  Branch (4468:48): [True: 38.4k, False: 2.07k]
  ------------------
 4469|  38.4k|         !cm->tiles.large_scale;
  ------------------
  |  Branch (4469:10): [True: 38.4k, False: 0]
  ------------------
 4470|   244k|}
encoder.c:set_ref_ptrs:
 4222|   122k|                                MV_REFERENCE_FRAME ref1) {
 4223|   122k|  xd->block_ref_scale_factors[0] =
 4224|   122k|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 122k, False: 0]
  ------------------
 4225|   122k|  xd->block_ref_scale_factors[1] =
 4226|   122k|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 122k, False: 0]
  ------------------
 4227|   122k|}
encoder.c:get_true_pyr_level:
  132|  73.6k|                                     int max_layer_depth) {
  133|  73.6k|  if (frame_order == 0) {
  ------------------
  |  Branch (133:7): [True: 18.4k, False: 55.2k]
  ------------------
  134|       |    // Keyframe case
  135|  18.4k|    return MIN_PYR_LEVEL;
  ------------------
  |  |  130|  18.4k|#define MIN_PYR_LEVEL 1
  ------------------
  136|  55.2k|  } else if (frame_level == MAX_ARF_LAYERS) {
  ------------------
  |  |   54|  55.2k|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (136:14): [True: 0, False: 55.2k]
  ------------------
  137|       |    // Leaves
  138|      0|    return max_layer_depth;
  139|  55.2k|  } else if (frame_level == (MAX_ARF_LAYERS + 1)) {
  ------------------
  |  |   54|  55.2k|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (139:14): [True: 0, False: 55.2k]
  ------------------
  140|       |    // Altrefs
  141|      0|    return MIN_PYR_LEVEL;
  ------------------
  |  |  130|      0|#define MIN_PYR_LEVEL 1
  ------------------
  142|      0|  }
  143|  55.2k|  return AOMMAX(MIN_PYR_LEVEL, frame_level);
  ------------------
  |  |   35|  55.2k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 18.3k, False: 36.9k]
  |  |  ------------------
  ------------------
  144|  73.6k|}
encoder.c:encode_show_existing_frame:
 4274|   147k|static inline int encode_show_existing_frame(const AV1_COMMON *cm) {
 4275|   147k|  return cm->show_existing_frame && (!cm->features.error_resilient_mode ||
  ------------------
  |  Branch (4275:10): [True: 0, False: 147k]
  |  Branch (4275:38): [True: 0, False: 0]
  ------------------
 4276|      0|                                     cm->current_frame.frame_type == KEY_FRAME);
  ------------------
  |  Branch (4276:38): [True: 0, False: 0]
  ------------------
 4277|   147k|}
encoder.c:is_psnr_calc_enabled:
 4440|  73.6k|static inline int is_psnr_calc_enabled(const AV1_COMP *cpi) {
 4441|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 4442|       |
 4443|  73.6k|  return cpi->ppi->b_calculate_psnr && !is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (4443:10): [True: 0, False: 73.6k]
  |  Branch (4443:40): [True: 0, False: 0]
  ------------------
 4444|      0|         cm->show_frame && !cpi->is_dropped_frame;
  ------------------
  |  Branch (4444:10): [True: 0, False: 0]
  |  Branch (4444:28): [True: 0, False: 0]
  ------------------
 4445|  73.6k|}
encoder.c:is_frame_resize_pending:
 4447|  73.6k|static inline int is_frame_resize_pending(const AV1_COMP *const cpi) {
 4448|  73.6k|  const ResizePendingParams *const resize_pending_params =
 4449|  73.6k|      &cpi->resize_pending_params;
 4450|  73.6k|  return (resize_pending_params->width && resize_pending_params->height &&
  ------------------
  |  Branch (4450:11): [True: 55.2k, False: 18.4k]
  |  Branch (4450:43): [True: 55.2k, False: 0]
  ------------------
 4451|  55.2k|          (cpi->common.width != resize_pending_params->width ||
  ------------------
  |  Branch (4451:12): [True: 36.9k, False: 18.2k]
  ------------------
 4452|  18.2k|           cpi->common.height != resize_pending_params->height));
  ------------------
  |  Branch (4452:12): [True: 7.98k, False: 10.2k]
  ------------------
 4453|  73.6k|}
encoder.c:set_postproc_filter_default_params:
 4517|  54.7k|static inline void set_postproc_filter_default_params(AV1_COMMON *cm) {
 4518|  54.7k|  struct loopfilter *const lf = &cm->lf;
 4519|  54.7k|  CdefInfo *const cdef_info = &cm->cdef_info;
 4520|  54.7k|  RestorationInfo *const rst_info = cm->rst_info;
 4521|       |
 4522|  54.7k|  lf->filter_level[0] = 0;
 4523|  54.7k|  lf->filter_level[1] = 0;
 4524|  54.7k|  lf->backup_filter_level[0] = 0;
 4525|  54.7k|  lf->backup_filter_level[1] = 0;
 4526|  54.7k|  cdef_info->cdef_bits = 0;
 4527|  54.7k|  cdef_info->cdef_strengths[0] = 0;
 4528|  54.7k|  cdef_info->nb_cdef_strengths = 1;
 4529|  54.7k|  cdef_info->cdef_uv_strengths[0] = 0;
 4530|  54.7k|  rst_info[0].frame_restoration_type = RESTORE_NONE;
 4531|  54.7k|  rst_info[1].frame_restoration_type = RESTORE_NONE;
 4532|  54.7k|  rst_info[2].frame_restoration_type = RESTORE_NONE;
 4533|  54.7k|}
encoder.c:is_loopfilter_used:
 4456|  73.6k|static inline int is_loopfilter_used(const AV1_COMMON *const cm) {
 4457|  73.6k|  return !cm->features.coded_lossless && !cm->tiles.large_scale;
  ------------------
  |  Branch (4457:10): [True: 70.2k, False: 3.40k]
  |  Branch (4457:42): [True: 70.2k, False: 0]
  ------------------
 4458|  73.6k|}
encoder.c:is_cdef_used:
 4461|   121k|static inline int is_cdef_used(const AV1_COMMON *const cm) {
 4462|   121k|  return cm->seq_params->enable_cdef && !cm->features.coded_lossless &&
  ------------------
  |  Branch (4462:10): [True: 121k, False: 0]
  |  Branch (4462:41): [True: 117k, False: 4.24k]
  ------------------
 4463|   117k|         !cm->tiles.large_scale;
  ------------------
  |  Branch (4463:10): [True: 117k, False: 0]
  ------------------
 4464|   121k|}
encoder.c:derive_skip_apply_postproc_filters:
 4479|  73.6k|    int use_restoration) {
 4480|       |  // Though CDEF parameter selection should be dependent on
 4481|       |  // deblocked/loop-filtered pixels for cdef_pick_method <=
 4482|       |  // CDEF_FAST_SEARCH_LVL5, CDEF strength values are calculated based on the
 4483|       |  // pixel values that are not loop-filtered in svc real-time encoding mode.
 4484|       |  // Hence this case is handled separately using the condition below.
 4485|  73.6k|  if (cpi->ppi->rtc_ref.non_reference_frame)
  ------------------
  |  Branch (4485:7): [True: 0, False: 73.6k]
  ------------------
 4486|      0|    return (SKIP_APPLY_LOOPFILTER | SKIP_APPLY_CDEF);
 4487|       |
 4488|  73.6k|  if (!cpi->oxcf.algo_cfg.skip_postproc_filtering || cpi->ppi->b_calculate_psnr)
  ------------------
  |  Branch (4488:7): [True: 73.6k, False: 0]
  |  Branch (4488:54): [True: 0, False: 0]
  ------------------
 4489|  73.6k|    return 0;
 4490|  73.6k|  assert(cpi->oxcf.mode == ALLINTRA);
 4491|       |
 4492|       |  // The post-processing filters are applied one after the other in the
 4493|       |  // following order: deblocking->cdef->superres->restoration. In case of
 4494|       |  // ALLINTRA encoding, the reconstructed frame is not used as a reference
 4495|       |  // frame. Hence, the application of these filters can be skipped when
 4496|       |  // 1. filter parameters of the subsequent stages are not dependent on the
 4497|       |  // filtered output of the current stage or
 4498|       |  // 2. subsequent filtering stages are disabled
 4499|      0|  if (use_restoration) return SKIP_APPLY_RESTORATION;
  ------------------
  |  Branch (4499:7): [True: 0, False: 0]
  ------------------
 4500|      0|  if (use_superres) return SKIP_APPLY_SUPERRES;
  ------------------
  |  Branch (4500:7): [True: 0, False: 0]
  ------------------
 4501|      0|  if (use_cdef) {
  ------------------
  |  Branch (4501:7): [True: 0, False: 0]
  ------------------
 4502|       |    // CDEF parameter selection is not dependent on the deblocked frame if
 4503|       |    // cdef_pick_method is CDEF_PICK_FROM_Q. Hence the application of deblocking
 4504|       |    // filters and cdef filters can be skipped in this case.
 4505|      0|    return (cpi->sf.lpf_sf.cdef_pick_method == CDEF_PICK_FROM_Q &&
  ------------------
  |  Branch (4505:13): [True: 0, False: 0]
  ------------------
 4506|      0|            use_loopfilter)
  ------------------
  |  Branch (4506:13): [True: 0, False: 0]
  ------------------
 4507|      0|               ? (SKIP_APPLY_LOOPFILTER | SKIP_APPLY_CDEF)
 4508|      0|               : SKIP_APPLY_CDEF;
 4509|      0|  }
 4510|      0|  if (use_loopfilter) return SKIP_APPLY_LOOPFILTER;
  ------------------
  |  Branch (4510:7): [True: 0, False: 0]
  ------------------
 4511|       |
 4512|       |  // If we reach here, all post-processing stages are disabled, so none need to
 4513|       |  // be skipped.
 4514|      0|  return 0;
 4515|      0|}
encoder.c:get_lpf_opt_level:
 4541|  9.68k|static inline int get_lpf_opt_level(const SPEED_FEATURES *sf) {
 4542|  9.68k|  int lpf_opt_level = 0;
 4543|  9.68k|  if (is_inter_tx_size_search_level_one(&sf->tx_sf))
  ------------------
  |  Branch (4543:7): [True: 9.68k, False: 0]
  ------------------
 4544|  9.68k|    lpf_opt_level = (sf->lpf_sf.lpf_pick == LPF_PICK_FROM_Q) ? 2 : 1;
  ------------------
  |  Branch (4544:21): [True: 4.93k, False: 4.74k]
  ------------------
 4545|  9.68k|  return lpf_opt_level;
 4546|  9.68k|}
encoder.c:is_inter_tx_size_search_level_one:
 4536|  9.68k|    const TX_SPEED_FEATURES *tx_sf) {
 4537|  9.68k|  return (tx_sf->inter_tx_size_search_init_depth_rect >= 1 &&
  ------------------
  |  Branch (4537:11): [True: 9.68k, False: 0]
  ------------------
 4538|  9.68k|          tx_sf->inter_tx_size_search_init_depth_sqr >= 1);
  ------------------
  |  Branch (4538:11): [True: 9.68k, False: 0]
  ------------------
 4539|  9.68k|}
encoder.c:use_rtc_reference_structure_one_layer:
 4194|  24.4k|static inline int use_rtc_reference_structure_one_layer(const AV1_COMP *cpi) {
 4195|  24.4k|  return is_one_pass_rt_params(cpi) && cpi->ppi->number_spatial_layers == 1 &&
  ------------------
  |  Branch (4195:10): [True: 24.4k, False: 0]
  |  Branch (4195:40): [True: 0, False: 24.4k]
  ------------------
 4196|      0|         cpi->ppi->number_temporal_layers == 1 &&
  ------------------
  |  Branch (4196:10): [True: 0, False: 0]
  ------------------
 4197|      0|         !cpi->ppi->rtc_ref.set_ref_frame_config;
  ------------------
  |  Branch (4197:10): [True: 0, False: 0]
  ------------------
 4198|  24.4k|}
encoder_utils.c:is_stat_consumption_stage_twopass:
 4147|  73.6k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  73.6k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  73.6k|}
encoder_utils.c:get_ref_frame_yv12_buf:
 4082|  55.2k|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|  55.2k|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|  55.2k|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 55.2k, False: 0]
  ------------------
 4085|  55.2k|}
encoder_utils.c:is_one_pass_rt_params:
 4188|  55.2k|static inline int is_one_pass_rt_params(const AV1_COMP *cpi) {
 4189|  55.2k|  return has_no_stats_stage(cpi) && cpi->oxcf.gf_cfg.lag_in_frames == 0 &&
  ------------------
  |  Branch (4189:10): [True: 55.2k, False: 0]
  |  Branch (4189:37): [True: 55.2k, False: 0]
  ------------------
 4190|  55.2k|         (cpi->oxcf.mode == REALTIME || cpi->svc.number_spatial_layers > 1);
  ------------------
  |  Branch (4190:11): [True: 18.3k, False: 36.9k]
  |  Branch (4190:41): [True: 0, False: 36.9k]
  ------------------
 4191|  55.2k|}
encoder_utils.c:alloc_frame_mvs:
 4087|  44.9k|static inline void alloc_frame_mvs(AV1_COMMON *const cm, RefCntBuffer *buf) {
 4088|       |  assert(buf != NULL);
 4089|  44.9k|  ensure_mv_buffer(buf, cm);
 4090|  44.9k|  buf->width = cm->width;
 4091|  44.9k|  buf->height = cm->height;
 4092|  44.9k|}
encoder_utils.c:has_no_stats_stage:
 4174|   386k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|   386k|  assert(
 4176|   386k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|   386k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 386k, False: 0]
  ------------------
 4178|   386k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 386k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|   386k|}
encoder_utils.c:encode_show_existing_frame:
 4274|   147k|static inline int encode_show_existing_frame(const AV1_COMMON *cm) {
 4275|   147k|  return cm->show_existing_frame && (!cm->features.error_resilient_mode ||
  ------------------
  |  Branch (4275:10): [True: 0, False: 147k]
  |  Branch (4275:38): [True: 0, False: 0]
  ------------------
 4276|      0|                                     cm->current_frame.frame_type == KEY_FRAME);
  ------------------
  |  Branch (4276:38): [True: 0, False: 0]
  ------------------
 4277|   147k|}
ethread.c:is_restoration_used:
 4467|   126k|static inline int is_restoration_used(const AV1_COMMON *const cm) {
 4468|   126k|  return cm->seq_params->enable_restoration && !cm->features.all_lossless &&
  ------------------
  |  Branch (4468:10): [True: 7.50k, False: 118k]
  |  Branch (4468:48): [True: 7.50k, False: 0]
  ------------------
 4469|  7.50k|         !cm->tiles.large_scale;
  ------------------
  |  Branch (4469:10): [True: 7.50k, False: 0]
  ------------------
 4470|   126k|}
ethread.c:av1_need_dv_costs:
 4160|  23.4k|static inline bool av1_need_dv_costs(const AV1_COMP *const cpi) {
 4161|  23.4k|  return (!cpi->sf.rt_sf.use_nonrd_pick_mode || cpi->sf.rt_sf.rt_use_intrabc) &&
  ------------------
  |  Branch (4161:11): [True: 23.4k, False: 0]
  |  Branch (4161:49): [True: 0, False: 0]
  ------------------
 4162|  23.4k|         av1_allow_intrabc(&cpi->common) && !is_stat_generation_stage(cpi);
  ------------------
  |  Branch (4162:10): [True: 1.23k, False: 22.1k]
  |  Branch (4162:45): [True: 1.23k, False: 0]
  ------------------
 4163|  23.4k|}
ethread.c:is_stat_generation_stage:
 4140|  95.9k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  95.9k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  95.9k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  95.9k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 95.9k]
  ------------------
 4144|  95.9k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 95.9k]
  ------------------
 4145|  95.9k|}
ethread.c:is_loopfilter_used:
 4456|  56.0k|static inline int is_loopfilter_used(const AV1_COMMON *const cm) {
 4457|  56.0k|  return !cm->features.coded_lossless && !cm->tiles.large_scale;
  ------------------
  |  Branch (4457:10): [True: 54.0k, False: 2.02k]
  |  Branch (4457:42): [True: 54.0k, False: 0]
  ------------------
 4458|  56.0k|}
ethread.c:is_cdef_used:
 4461|  56.0k|static inline int is_cdef_used(const AV1_COMMON *const cm) {
 4462|  56.0k|  return cm->seq_params->enable_cdef && !cm->features.coded_lossless &&
  ------------------
  |  Branch (4462:10): [True: 56.0k, False: 0]
  |  Branch (4462:41): [True: 54.0k, False: 2.02k]
  ------------------
 4463|  54.0k|         !cm->tiles.large_scale;
  ------------------
  |  Branch (4463:10): [True: 54.0k, False: 0]
  ------------------
 4464|  56.0k|}
ethread.c:derive_skip_apply_postproc_filters:
 4479|  56.0k|    int use_restoration) {
 4480|       |  // Though CDEF parameter selection should be dependent on
 4481|       |  // deblocked/loop-filtered pixels for cdef_pick_method <=
 4482|       |  // CDEF_FAST_SEARCH_LVL5, CDEF strength values are calculated based on the
 4483|       |  // pixel values that are not loop-filtered in svc real-time encoding mode.
 4484|       |  // Hence this case is handled separately using the condition below.
 4485|  56.0k|  if (cpi->ppi->rtc_ref.non_reference_frame)
  ------------------
  |  Branch (4485:7): [True: 0, False: 56.0k]
  ------------------
 4486|      0|    return (SKIP_APPLY_LOOPFILTER | SKIP_APPLY_CDEF);
 4487|       |
 4488|  56.0k|  if (!cpi->oxcf.algo_cfg.skip_postproc_filtering || cpi->ppi->b_calculate_psnr)
  ------------------
  |  Branch (4488:7): [True: 56.0k, False: 0]
  |  Branch (4488:54): [True: 0, False: 0]
  ------------------
 4489|  56.0k|    return 0;
 4490|  56.0k|  assert(cpi->oxcf.mode == ALLINTRA);
 4491|       |
 4492|       |  // The post-processing filters are applied one after the other in the
 4493|       |  // following order: deblocking->cdef->superres->restoration. In case of
 4494|       |  // ALLINTRA encoding, the reconstructed frame is not used as a reference
 4495|       |  // frame. Hence, the application of these filters can be skipped when
 4496|       |  // 1. filter parameters of the subsequent stages are not dependent on the
 4497|       |  // filtered output of the current stage or
 4498|       |  // 2. subsequent filtering stages are disabled
 4499|      0|  if (use_restoration) return SKIP_APPLY_RESTORATION;
  ------------------
  |  Branch (4499:7): [True: 0, False: 0]
  ------------------
 4500|      0|  if (use_superres) return SKIP_APPLY_SUPERRES;
  ------------------
  |  Branch (4500:7): [True: 0, False: 0]
  ------------------
 4501|      0|  if (use_cdef) {
  ------------------
  |  Branch (4501:7): [True: 0, False: 0]
  ------------------
 4502|       |    // CDEF parameter selection is not dependent on the deblocked frame if
 4503|       |    // cdef_pick_method is CDEF_PICK_FROM_Q. Hence the application of deblocking
 4504|       |    // filters and cdef filters can be skipped in this case.
 4505|      0|    return (cpi->sf.lpf_sf.cdef_pick_method == CDEF_PICK_FROM_Q &&
  ------------------
  |  Branch (4505:13): [True: 0, False: 0]
  ------------------
 4506|      0|            use_loopfilter)
  ------------------
  |  Branch (4506:13): [True: 0, False: 0]
  ------------------
 4507|      0|               ? (SKIP_APPLY_LOOPFILTER | SKIP_APPLY_CDEF)
 4508|      0|               : SKIP_APPLY_CDEF;
 4509|      0|  }
 4510|      0|  if (use_loopfilter) return SKIP_APPLY_LOOPFILTER;
  ------------------
  |  Branch (4510:7): [True: 0, False: 0]
  ------------------
 4511|       |
 4512|       |  // If we reach here, all post-processing stages are disabled, so none need to
 4513|       |  // be skipped.
 4514|      0|  return 0;
 4515|      0|}
ethread.c:set_postproc_filter_default_params:
 4517|  18.9k|static inline void set_postproc_filter_default_params(AV1_COMMON *cm) {
 4518|  18.9k|  struct loopfilter *const lf = &cm->lf;
 4519|  18.9k|  CdefInfo *const cdef_info = &cm->cdef_info;
 4520|  18.9k|  RestorationInfo *const rst_info = cm->rst_info;
 4521|       |
 4522|  18.9k|  lf->filter_level[0] = 0;
 4523|  18.9k|  lf->filter_level[1] = 0;
 4524|  18.9k|  lf->backup_filter_level[0] = 0;
 4525|  18.9k|  lf->backup_filter_level[1] = 0;
 4526|  18.9k|  cdef_info->cdef_bits = 0;
 4527|  18.9k|  cdef_info->cdef_strengths[0] = 0;
 4528|  18.9k|  cdef_info->nb_cdef_strengths = 1;
 4529|  18.9k|  cdef_info->cdef_uv_strengths[0] = 0;
 4530|  18.9k|  rst_info[0].frame_restoration_type = RESTORE_NONE;
 4531|  18.9k|  rst_info[1].frame_restoration_type = RESTORE_NONE;
 4532|  18.9k|  rst_info[2].frame_restoration_type = RESTORE_NONE;
 4533|  18.9k|}
ethread.c:get_lpf_opt_level:
 4541|  17.8k|static inline int get_lpf_opt_level(const SPEED_FEATURES *sf) {
 4542|  17.8k|  int lpf_opt_level = 0;
 4543|  17.8k|  if (is_inter_tx_size_search_level_one(&sf->tx_sf))
  ------------------
  |  Branch (4543:7): [True: 17.8k, False: 0]
  ------------------
 4544|  17.8k|    lpf_opt_level = (sf->lpf_sf.lpf_pick == LPF_PICK_FROM_Q) ? 2 : 1;
  ------------------
  |  Branch (4544:21): [True: 17.8k, False: 0]
  ------------------
 4545|  17.8k|  return lpf_opt_level;
 4546|  17.8k|}
ethread.c:is_inter_tx_size_search_level_one:
 4536|  17.8k|    const TX_SPEED_FEATURES *tx_sf) {
 4537|  17.8k|  return (tx_sf->inter_tx_size_search_init_depth_rect >= 1 &&
  ------------------
  |  Branch (4537:11): [True: 17.8k, False: 0]
  ------------------
 4538|  17.8k|          tx_sf->inter_tx_size_search_init_depth_sqr >= 1);
  ------------------
  |  Branch (4538:11): [True: 17.8k, False: 0]
  ------------------
 4539|  17.8k|}
global_motion_facade.c:is_frame_eligible_for_ref_pruning:
 4425|  36.9k|                                                    int gf_index) {
 4426|  36.9k|  return (selective_ref_frame > 0) && (prune_ref_frames > 0) &&
  ------------------
  |  Branch (4426:10): [True: 36.9k, False: 0]
  |  Branch (4426:39): [True: 36.9k, False: 0]
  ------------------
 4427|  36.9k|         !is_frame_tpl_eligible(gf_group, gf_index);
  ------------------
  |  Branch (4427:10): [True: 36.9k, False: 0]
  ------------------
 4428|  36.9k|}
global_motion_facade.c:is_frame_tpl_eligible:
 4416|  36.9k|                                        uint8_t index) {
 4417|  36.9k|  const FRAME_UPDATE_TYPE update_type = gf_group->update_type[index];
 4418|  36.9k|  return update_type == ARF_UPDATE || update_type == GF_UPDATE ||
  ------------------
  |  Branch (4418:10): [True: 0, False: 36.9k]
  |  Branch (4418:39): [True: 0, False: 36.9k]
  ------------------
 4419|  36.9k|         update_type == KF_UPDATE;
  ------------------
  |  Branch (4419:10): [True: 0, False: 36.9k]
  ------------------
 4420|  36.9k|}
mcomp.c:cond_cost_list_const:
 4234|  2.62M|                                              const int *cost_list) {
 4235|  2.62M|  const int use_cost_list = cpi->sf.mv_sf.subpel_search_method != SUBPEL_TREE &&
  ------------------
  |  Branch (4235:29): [True: 2.62M, False: 18.4E]
  ------------------
 4236|  2.62M|                            cpi->sf.mv_sf.use_fullpel_costlist;
  ------------------
  |  Branch (4236:29): [True: 598k, False: 2.03M]
  ------------------
 4237|  2.62M|  return use_cost_list ? cost_list : NULL;
  ------------------
  |  Branch (4237:10): [True: 598k, False: 2.03M]
  ------------------
 4238|  2.62M|}
mcomp.c:av1_use_hash_me:
 4075|   144k|static inline int av1_use_hash_me(const AV1_COMP *const cpi) {
 4076|   144k|  return (cpi->common.features.allow_screen_content_tools &&
  ------------------
  |  Branch (4076:11): [True: 144k, False: 0]
  ------------------
 4077|   144k|          cpi->common.features.allow_intrabc &&
  ------------------
  |  Branch (4077:11): [True: 144k, False: 18.4E]
  ------------------
 4078|   144k|          frame_is_intra_only(&cpi->common));
  ------------------
  |  Branch (4078:11): [True: 144k, False: 2]
  ------------------
 4079|   144k|}
partition_search.c:set_mode_info_offsets:
 4317|  12.1M|    MACROBLOCKD *const xd, int mi_row, int mi_col) {
 4318|  12.1M|  set_mi_offsets(mi_params, xd, mi_row, mi_col);
 4319|  12.1M|  const int ext_idx = get_mi_ext_idx(mi_row, mi_col, mi_params->mi_alloc_bsize,
 4320|  12.1M|                                     mbmi_ext_info->stride);
 4321|  12.1M|  x->mbmi_ext_frame = mbmi_ext_info->frame_base + ext_idx;
 4322|  12.1M|}
partition_search.c:get_mi_ext_idx:
 4283|  12.1M|                                 const int mbmi_ext_stride) {
 4284|  12.1M|  const int mi_ext_size_1d = mi_size_wide[mi_alloc_bsize];
 4285|  12.1M|  const int mi_ext_row = mi_row / mi_ext_size_1d;
 4286|  12.1M|  const int mi_ext_col = mi_col / mi_ext_size_1d;
 4287|  12.1M|  return mi_ext_row * mbmi_ext_stride + mi_ext_col;
 4288|  12.1M|}
partition_search.c:set_pixels_to_frame_edge:
 4296|  12.1M|                                            bool do_border_pad) {
 4297|       |  // For do_border_pad = true, compute distances using the actual frame
 4298|       |  // dimensions.
 4299|       |  // For do_border_pad = false, compute distances using the frame dimensions
 4300|       |  // aligned to a multiple of 8 pixels to match the dimensions represented
 4301|       |  // by mi_cols and mi_rows, which are rounded up to multiples of 8 pixels.
 4302|  12.1M|  int boundary_frame_width =
 4303|  12.1M|      do_border_pad ? frame_width : (mi_cols << MI_SIZE_LOG2);
  ------------------
  |  |   39|  11.8M|#define MI_SIZE_LOG2 2
  ------------------
  |  Branch (4303:7): [True: 304k, False: 11.8M]
  ------------------
 4304|  12.1M|  int boundary_frame_height =
 4305|  12.1M|      do_border_pad ? frame_height : (mi_rows << MI_SIZE_LOG2);
  ------------------
  |  |   39|  11.8M|#define MI_SIZE_LOG2 2
  ------------------
  |  Branch (4305:7): [True: 304k, False: 11.8M]
  ------------------
 4306|       |
 4307|  12.1M|  x->pix_to_bottom_edge =
 4308|  12.1M|      boundary_frame_height - ((mi_row + bh) << MI_SIZE_LOG2);
  ------------------
  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  ------------------
 4309|  12.1M|  x->pix_to_right_edge = boundary_frame_width - ((mi_col + bw) << MI_SIZE_LOG2);
  ------------------
  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  ------------------
 4310|  12.1M|}
partition_search.c:set_ref_ptrs:
 4222|  1.64M|                                MV_REFERENCE_FRAME ref1) {
 4223|  1.64M|  xd->block_ref_scale_factors[0] =
 4224|  18.4E|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 1.64M, False: 18.4E]
  ------------------
 4225|  1.64M|  xd->block_ref_scale_factors[1] =
 4226|  1.64M|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 1.64M]
  ------------------
 4227|  1.64M|}
partition_search.c:get_ref_frame_yv12_buf:
 4082|  1.13M|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|  1.13M|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|  1.13M|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 1.13M, False: 85]
  ------------------
 4085|  1.13M|}
partition_strategy.c:set_mode_info_offsets:
 4317|   707k|    MACROBLOCKD *const xd, int mi_row, int mi_col) {
 4318|   707k|  set_mi_offsets(mi_params, xd, mi_row, mi_col);
 4319|   707k|  const int ext_idx = get_mi_ext_idx(mi_row, mi_col, mi_params->mi_alloc_bsize,
 4320|   707k|                                     mbmi_ext_info->stride);
 4321|   707k|  x->mbmi_ext_frame = mbmi_ext_info->frame_base + ext_idx;
 4322|   707k|}
partition_strategy.c:get_mi_ext_idx:
 4283|   708k|                                 const int mbmi_ext_stride) {
 4284|   708k|  const int mi_ext_size_1d = mi_size_wide[mi_alloc_bsize];
 4285|   708k|  const int mi_ext_row = mi_row / mi_ext_size_1d;
 4286|   708k|  const int mi_ext_col = mi_col / mi_ext_size_1d;
 4287|   708k|  return mi_ext_row * mbmi_ext_stride + mi_ext_col;
 4288|   708k|}
pass2_strategy.c:has_no_stats_stage:
 4174|   135k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|   135k|  assert(
 4176|   135k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|   135k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 135k, False: 0]
  ------------------
 4178|   135k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 135k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|   135k|}
pass2_strategy.c:is_one_pass_rt_lag_params:
 4183|  49.2k|static inline int is_one_pass_rt_lag_params(const AV1_COMP *cpi) {
 4184|  49.2k|  return cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4184:10): [True: 49.2k, False: 0]
  ------------------
 4185|  49.2k|         cpi->oxcf.gf_cfg.lag_in_frames > 0 && cpi->oxcf.mode == REALTIME;
  ------------------
  |  Branch (4185:10): [True: 0, False: 49.2k]
  |  Branch (4185:48): [True: 0, False: 0]
  ------------------
 4186|  49.2k|}
pass2_strategy.c:is_altref_enabled:
 4125|  12.3k|static inline int is_altref_enabled(int lag_in_frames, bool enable_auto_arf) {
 4126|  12.3k|  return lag_in_frames >= ALT_MIN_LAG && enable_auto_arf;
  ------------------
  |  | 4124|  24.6k|#define ALT_MIN_LAG 3
  ------------------
  |  Branch (4126:10): [True: 0, False: 12.3k]
  |  Branch (4126:42): [True: 0, False: 0]
  ------------------
 4127|  12.3k|}
pass2_strategy.c:is_stat_consumption_stage:
 4152|  98.4k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|  98.4k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 98.4k]
  ------------------
 4154|  98.4k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 98.4k, False: 0]
  ------------------
 4155|  98.4k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 98.4k, False: 0]
  |  Branch (4155:55): [True: 0, False: 98.4k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|  98.4k|}
pass2_strategy.c:is_stat_consumption_stage_twopass:
 4147|  98.4k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  98.4k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  98.4k|}
picklpf.c:is_stat_consumption_stage_twopass:
 4147|   252k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|   252k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|   252k|}
picklpf.c:is_inter_tx_size_search_level_one:
 4536|   233k|    const TX_SPEED_FEATURES *tx_sf) {
 4537|   233k|  return (tx_sf->inter_tx_size_search_init_depth_rect >= 1 &&
  ------------------
  |  Branch (4537:11): [True: 233k, False: 0]
  ------------------
 4538|   233k|          tx_sf->inter_tx_size_search_init_depth_sqr >= 1);
  ------------------
  |  Branch (4538:11): [True: 233k, False: 0]
  ------------------
 4539|   233k|}
ratectrl.c:is_stat_consumption_stage:
 4152|   133k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|   133k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 133k]
  ------------------
 4154|   133k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 133k, False: 0]
  ------------------
 4155|   133k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 133k, False: 0]
  |  Branch (4155:55): [True: 0, False: 133k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|   133k|}
ratectrl.c:is_stat_consumption_stage_twopass:
 4147|   133k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|   133k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|   133k|}
ratectrl.c:has_no_stats_stage:
 4174|  63.9k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|  63.9k|  assert(
 4176|  63.9k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|  63.9k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 63.9k, False: 0]
  ------------------
 4178|  63.9k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 63.9k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|  63.9k|}
ratectrl.c:av1_frame_scaled:
 4262|   184k|static inline int av1_frame_scaled(const AV1_COMMON *cm) {
 4263|   184k|  return av1_superres_scaled(cm) || av1_resize_scaled(cm);
  ------------------
  |  Branch (4263:10): [True: 0, False: 184k]
  |  Branch (4263:37): [True: 147k, False: 36.8k]
  ------------------
 4264|   184k|}
ratectrl.c:av1_resize_scaled:
 4257|   184k|static inline int av1_resize_scaled(const AV1_COMMON *cm) {
 4258|   184k|  return cm->superres_upscaled_width != cm->render_width ||
  ------------------
  |  Branch (4258:10): [True: 147k, False: 36.8k]
  ------------------
 4259|  36.8k|         cm->superres_upscaled_height != cm->render_height;
  ------------------
  |  Branch (4259:10): [True: 0, False: 36.8k]
  ------------------
 4260|   184k|}
ratectrl.c:is_altref_enabled:
 4125|  73.6k|static inline int is_altref_enabled(int lag_in_frames, bool enable_auto_arf) {
 4126|  73.6k|  return lag_in_frames >= ALT_MIN_LAG && enable_auto_arf;
  ------------------
  |  | 4124|   147k|#define ALT_MIN_LAG 3
  ------------------
  |  Branch (4126:10): [True: 0, False: 73.6k]
  |  Branch (4126:42): [True: 0, False: 0]
  ------------------
 4127|  73.6k|}
ratectrl.c:is_one_pass_rt_lag_params:
 4183|   107k|static inline int is_one_pass_rt_lag_params(const AV1_COMP *cpi) {
 4184|   107k|  return cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4184:10): [True: 107k, False: 0]
  ------------------
 4185|   107k|         cpi->oxcf.gf_cfg.lag_in_frames > 0 && cpi->oxcf.mode == REALTIME;
  ------------------
  |  Branch (4185:10): [True: 0, False: 107k]
  |  Branch (4185:48): [True: 0, False: 0]
  ------------------
 4186|   107k|}
ratectrl.c:is_frame_resize_pending:
 4447|  67.1k|static inline int is_frame_resize_pending(const AV1_COMP *const cpi) {
 4448|  67.1k|  const ResizePendingParams *const resize_pending_params =
 4449|  67.1k|      &cpi->resize_pending_params;
 4450|  67.1k|  return (resize_pending_params->width && resize_pending_params->height &&
  ------------------
  |  Branch (4450:11): [True: 36.6k, False: 30.5k]
  |  Branch (4450:43): [True: 36.6k, False: 0]
  ------------------
 4451|  36.6k|          (cpi->common.width != resize_pending_params->width ||
  ------------------
  |  Branch (4451:12): [True: 24.7k, False: 11.8k]
  ------------------
 4452|  11.8k|           cpi->common.height != resize_pending_params->height));
  ------------------
  |  Branch (4452:12): [True: 5.43k, False: 6.37k]
  ------------------
 4453|  67.1k|}
rd.c:is_stat_consumption_stage:
 4152|  73.6k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|  73.6k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 73.6k]
  ------------------
 4154|  73.6k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 73.6k, False: 0]
  ------------------
 4155|  73.6k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 73.6k, False: 0]
  |  Branch (4155:55): [True: 0, False: 73.6k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|  73.6k|}
rd.c:is_stat_consumption_stage_twopass:
 4147|  73.6k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  73.6k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  73.6k|}
rd.c:is_frame_resize_pending:
 4447|  6.76k|static inline int is_frame_resize_pending(const AV1_COMP *const cpi) {
 4448|  6.76k|  const ResizePendingParams *const resize_pending_params =
 4449|  6.76k|      &cpi->resize_pending_params;
 4450|  6.76k|  return (resize_pending_params->width && resize_pending_params->height &&
  ------------------
  |  Branch (4450:11): [True: 0, False: 6.76k]
  |  Branch (4450:43): [True: 0, False: 0]
  ------------------
 4451|      0|          (cpi->common.width != resize_pending_params->width ||
  ------------------
  |  Branch (4451:12): [True: 0, False: 0]
  ------------------
 4452|      0|           cpi->common.height != resize_pending_params->height));
  ------------------
  |  Branch (4452:12): [True: 0, False: 0]
  ------------------
 4453|  6.76k|}
rd.c:av1_need_dv_costs:
 4160|  73.6k|static inline bool av1_need_dv_costs(const AV1_COMP *const cpi) {
 4161|  73.6k|  return (!cpi->sf.rt_sf.use_nonrd_pick_mode || cpi->sf.rt_sf.rt_use_intrabc) &&
  ------------------
  |  Branch (4161:11): [True: 49.2k, False: 24.4k]
  |  Branch (4161:49): [True: 0, False: 24.4k]
  ------------------
 4162|  49.2k|         av1_allow_intrabc(&cpi->common) && !is_stat_generation_stage(cpi);
  ------------------
  |  Branch (4162:10): [True: 1.98k, False: 47.2k]
  |  Branch (4162:45): [True: 1.98k, False: 0]
  ------------------
 4163|  73.6k|}
rd.c:is_stat_generation_stage:
 4140|  1.98k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|  1.98k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|  1.98k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|  1.98k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 1.98k]
  ------------------
 4144|  1.98k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 1.98k]
  ------------------
 4145|  1.98k|}
rdopt.c:get_ref_frame_yv12_buf:
 4082|  1.91M|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|  1.91M|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|  1.91M|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 1.91M, False: 0]
  ------------------
 4085|  1.91M|}
rdopt.c:get_frame_update_type:
 4432|   305M|                                                      int gf_frame_index) {
 4433|   305M|  return gf_group->update_type[gf_frame_index];
 4434|   305M|}
rdopt.c:set_ref_ptrs:
 4222|  12.3M|                                MV_REFERENCE_FRAME ref1) {
 4223|  12.3M|  xd->block_ref_scale_factors[0] =
 4224|  12.3M|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 10.9M, False: 1.48M]
  ------------------
 4225|  12.3M|  xd->block_ref_scale_factors[1] =
 4226|  12.3M|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 12.3M]
  ------------------
 4227|  12.3M|}
nonrd_pickmode.c:is_lossless_requested:
 1127|   602k|static inline int is_lossless_requested(const RateControlCfg *const rc_cfg) {
 1128|   602k|  return rc_cfg->best_allowed_q == 0 && rc_cfg->worst_allowed_q == 0;
  ------------------
  |  Branch (1128:10): [True: 87.1k, False: 515k]
  |  Branch (1128:41): [True: 31.0k, False: 56.0k]
  ------------------
 1129|   602k|}
nonrd_pickmode.c:is_one_pass_rt_lag_params:
 4183|  19.7M|static inline int is_one_pass_rt_lag_params(const AV1_COMP *cpi) {
 4184|  19.7M|  return cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4184:10): [True: 19.7M, False: 18.4E]
  ------------------
 4185|  19.7M|         cpi->oxcf.gf_cfg.lag_in_frames > 0 && cpi->oxcf.mode == REALTIME;
  ------------------
  |  Branch (4185:10): [True: 0, False: 19.7M]
  |  Branch (4185:48): [True: 0, False: 0]
  ------------------
 4186|  19.7M|}
nonrd_pickmode.c:get_ref_frame_yv12_buf:
 4082|   598k|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|   598k|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|   598k|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 598k, False: 157]
  ------------------
 4085|   598k|}
nonrd_pickmode.c:set_ref_ptrs:
 4222|  2.70M|                                MV_REFERENCE_FRAME ref1) {
 4223|  2.70M|  xd->block_ref_scale_factors[0] =
 4224|  2.70M|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 2.51M, False: 195k]
  ------------------
 4225|  2.70M|  xd->block_ref_scale_factors[1] =
 4226|  2.70M|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 2.70M]
  ------------------
 4227|  2.70M|}
nonrd_pickmode.c:cond_cost_list:
 4240|   598k|static inline int *cond_cost_list(const struct AV1_COMP *cpi, int *cost_list) {
 4241|   598k|  const int use_cost_list = cpi->sf.mv_sf.subpel_search_method != SUBPEL_TREE &&
  ------------------
  |  Branch (4241:29): [True: 598k, False: 18.4E]
  ------------------
 4242|   598k|                            cpi->sf.mv_sf.use_fullpel_costlist;
  ------------------
  |  Branch (4242:29): [True: 598k, False: 18.4E]
  ------------------
 4243|   598k|  return use_cost_list ? cost_list : NULL;
  ------------------
  |  Branch (4243:10): [True: 598k, False: 18.4E]
  ------------------
 4244|   598k|}
nonrd_pickmode.c:warped_motion_update_num_proj_ref:
 4555|   597k|    const struct AV1_COMP *const cpi, const MB_MODE_INFO *const mi) {
 4556|   597k|  return cpi->oxcf.motion_mode_cfg.allow_warped_motion && is_inter_block(mi) &&
  ------------------
  |  Branch (4556:10): [True: 597k, False: 18.4E]
  |  Branch (4556:59): [True: 399k, False: 198k]
  ------------------
 4557|   399k|         !mi->skip_mode && is_motion_variation_allowed_bsize(mi->bsize) &&
  ------------------
  |  Branch (4557:10): [True: 399k, False: 18.4E]
  |  Branch (4557:28): [True: 399k, False: 18.4E]
  ------------------
 4558|   399k|         !has_second_ref(mi);
  ------------------
  |  Branch (4558:10): [True: 399k, False: 13]
  ------------------
 4559|   597k|}
speed_features.c:is_lossless_requested:
 1127|   147k|static inline int is_lossless_requested(const RateControlCfg *const rc_cfg) {
 1128|   147k|  return rc_cfg->best_allowed_q == 0 && rc_cfg->worst_allowed_q == 0;
  ------------------
  |  Branch (1128:10): [True: 81.4k, False: 65.5k]
  |  Branch (1128:41): [True: 5.59k, False: 75.8k]
  ------------------
 1129|   147k|}
speed_features.c:is_psnr_calc_enabled:
 4440|  36.6k|static inline int is_psnr_calc_enabled(const AV1_COMP *cpi) {
 4441|  36.6k|  const AV1_COMMON *const cm = &cpi->common;
 4442|       |
 4443|  36.6k|  return cpi->ppi->b_calculate_psnr && !is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (4443:10): [True: 0, False: 36.6k]
  |  Branch (4443:40): [True: 0, False: 0]
  ------------------
 4444|      0|         cm->show_frame && !cpi->is_dropped_frame;
  ------------------
  |  Branch (4444:10): [True: 0, False: 0]
  |  Branch (4444:28): [True: 0, False: 0]
  ------------------
 4445|  36.6k|}
speed_features.c:is_one_pass_rt_lag_params:
 4183|   109k|static inline int is_one_pass_rt_lag_params(const AV1_COMP *cpi) {
 4184|   109k|  return cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4184:10): [True: 109k, False: 0]
  ------------------
 4185|   109k|         cpi->oxcf.gf_cfg.lag_in_frames > 0 && cpi->oxcf.mode == REALTIME;
  ------------------
  |  Branch (4185:10): [True: 0, False: 109k]
  |  Branch (4185:48): [True: 0, False: 0]
  ------------------
 4186|   109k|}
speed_features.c:is_stat_generation_stage:
 4140|   110k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|   110k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|   110k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|   110k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 110k]
  ------------------
 4144|   110k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 110k]
  ------------------
 4145|   110k|}
speed_features.c:has_no_stats_stage:
 4174|   110k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|   110k|  assert(
 4176|   110k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|   110k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 110k, False: 0]
  ------------------
 4178|   110k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 110k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|   110k|}
speed_features.c:frame_is_kf_gf_arf:
 4065|   294k|static inline int frame_is_kf_gf_arf(const AV1_COMP *cpi) {
 4066|   294k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 4067|   294k|  const FRAME_UPDATE_TYPE update_type =
 4068|   294k|      gf_group->update_type[cpi->gf_frame_index];
 4069|       |
 4070|   294k|  return frame_is_intra_only(&cpi->common) || update_type == ARF_UPDATE ||
  ------------------
  |  Branch (4070:10): [True: 128k, False: 165k]
  |  Branch (4070:47): [True: 0, False: 165k]
  ------------------
 4071|   165k|         update_type == GF_UPDATE;
  ------------------
  |  Branch (4071:10): [True: 27.0k, False: 138k]
  ------------------
 4072|   294k|}
superres_scale.c:has_no_stats_stage:
 4174|  73.6k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|  73.6k|  assert(
 4176|  73.6k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|  73.6k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 73.6k, False: 0]
  ------------------
 4178|  73.6k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 73.6k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|  73.6k|}
superres_scale.c:is_stat_generation_stage:
 4140|   110k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|   110k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|   110k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|   110k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 110k]
  ------------------
 4144|   110k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 110k]
  ------------------
 4145|   110k|}
tx_search.c:get_frame_update_type:
 4432|  62.0M|                                                      int gf_frame_index) {
 4433|  62.0M|  return gf_group->update_type[gf_frame_index];
 4434|  62.0M|}
var_based_part.c:get_ref_frame_yv12_buf:
 4082|  88.4k|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|  88.4k|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|  88.5k|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 88.5k, False: 18.4E]
  ------------------
 4085|  88.4k|}
var_based_part.c:set_ref_ptrs:
 4222|    765|                                MV_REFERENCE_FRAME ref1) {
 4223|    765|  xd->block_ref_scale_factors[0] =
 4224|    765|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 765, False: 0]
  ------------------
 4225|    765|  xd->block_ref_scale_factors[1] =
 4226|    765|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 765]
  ------------------
 4227|    765|}
encode_strategy.c:is_stat_generation_stage:
 4140|   791k|static inline int is_stat_generation_stage(const AV1_COMP *const cpi) {
 4141|   791k|  assert(IMPLIES(cpi->compressor_stage == LAP_STAGE,
 4142|   791k|                 cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->ppi->lap_enabled));
 4143|   791k|  return (cpi->oxcf.pass == AOM_RC_FIRST_PASS ||
  ------------------
  |  Branch (4143:11): [True: 0, False: 791k]
  ------------------
 4144|   791k|          (cpi->compressor_stage == LAP_STAGE));
  ------------------
  |  Branch (4144:11): [True: 0, False: 791k]
  ------------------
 4145|   791k|}
encode_strategy.c:is_one_pass_rt_params:
 4188|   374k|static inline int is_one_pass_rt_params(const AV1_COMP *cpi) {
 4189|   374k|  return has_no_stats_stage(cpi) && cpi->oxcf.gf_cfg.lag_in_frames == 0 &&
  ------------------
  |  Branch (4189:10): [True: 374k, False: 0]
  |  Branch (4189:37): [True: 374k, False: 0]
  ------------------
 4190|   374k|         (cpi->oxcf.mode == REALTIME || cpi->svc.number_spatial_layers > 1);
  ------------------
  |  Branch (4190:11): [True: 140k, False: 233k]
  |  Branch (4190:41): [True: 0, False: 233k]
  ------------------
 4191|   374k|}
encode_strategy.c:use_rtc_reference_structure_one_layer:
 4194|   134k|static inline int use_rtc_reference_structure_one_layer(const AV1_COMP *cpi) {
 4195|   134k|  return is_one_pass_rt_params(cpi) && cpi->ppi->number_spatial_layers == 1 &&
  ------------------
  |  Branch (4195:10): [True: 61.0k, False: 73.8k]
  |  Branch (4195:40): [True: 0, False: 61.0k]
  ------------------
 4196|      0|         cpi->ppi->number_temporal_layers == 1 &&
  ------------------
  |  Branch (4196:10): [True: 0, False: 0]
  ------------------
 4197|      0|         !cpi->ppi->rtc_ref.set_ref_frame_config;
  ------------------
  |  Branch (4197:10): [True: 0, False: 0]
  ------------------
 4198|   134k|}
encode_strategy.c:has_no_stats_stage:
 4174|   644k|static inline int has_no_stats_stage(const AV1_COMP *const cpi) {
 4175|   644k|  assert(
 4176|   644k|      IMPLIES(!cpi->ppi->lap_enabled, cpi->compressor_stage == ENCODE_STAGE));
 4177|   644k|  return (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4177:11): [True: 644k, False: 0]
  ------------------
 4178|   644k|          (!cpi->ppi->lap_enabled || cpi->oxcf.mode == REALTIME));
  ------------------
  |  Branch (4178:12): [True: 644k, False: 0]
  |  Branch (4178:38): [True: 0, False: 0]
  ------------------
 4179|   644k|}
encode_strategy.c:is_one_pass_rt_lag_params:
 4183|   122k|static inline int is_one_pass_rt_lag_params(const AV1_COMP *cpi) {
 4184|   122k|  return cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4184:10): [True: 122k, False: 0]
  ------------------
 4185|   122k|         cpi->oxcf.gf_cfg.lag_in_frames > 0 && cpi->oxcf.mode == REALTIME;
  ------------------
  |  Branch (4185:10): [True: 0, False: 122k]
  |  Branch (4185:48): [True: 0, False: 0]
  ------------------
 4186|   122k|}
encode_strategy.c:ticks_to_timebase_units:
 4059|  73.6k|    const aom_rational64_t *timestamp_ratio, int64_t n) {
 4060|  73.6k|  int64_t round = timestamp_ratio->num / 2;
 4061|  73.6k|  if (round > 0) --round;
  ------------------
  |  Branch (4061:7): [True: 73.6k, False: 0]
  ------------------
 4062|  73.6k|  return (n * timestamp_ratio->den + round) / timestamp_ratio->num;
 4063|  73.6k|}
encode_strategy.c:get_frame_update_type:
 4432|   122k|                                                      int gf_frame_index) {
 4433|   122k|  return gf_group->update_type[gf_frame_index];
 4434|   122k|}
encode_strategy.c:is_stat_consumption_stage:
 4152|  73.6k|static inline int is_stat_consumption_stage(const AV1_COMP *const cpi) {
 4153|  73.6k|  return (is_stat_consumption_stage_twopass(cpi) ||
  ------------------
  |  Branch (4153:11): [True: 0, False: 73.6k]
  ------------------
 4154|  73.6k|          (cpi->oxcf.pass == AOM_RC_ONE_PASS &&
  ------------------
  |  Branch (4154:12): [True: 73.6k, False: 0]
  ------------------
 4155|  73.6k|           (cpi->compressor_stage == ENCODE_STAGE) && cpi->ppi->lap_enabled &&
  ------------------
  |  Branch (4155:12): [True: 73.6k, False: 0]
  |  Branch (4155:55): [True: 0, False: 73.6k]
  ------------------
 4156|      0|           cpi->oxcf.mode != REALTIME));
  ------------------
  |  Branch (4156:12): [True: 0, False: 0]
  ------------------
 4157|  73.6k|}
encode_strategy.c:is_stat_consumption_stage_twopass:
 4147|  73.6k|static inline int is_stat_consumption_stage_twopass(const AV1_COMP *const cpi) {
 4148|  73.6k|  return (cpi->oxcf.pass >= AOM_RC_SECOND_PASS);
 4149|  73.6k|}
encode_strategy.c:init_ref_map_pair:
 3991|  73.6k|    AV1_COMP *cpi, RefFrameMapPair ref_frame_map_pairs[REF_FRAMES]) {
 3992|  73.6k|  if (cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == KF_UPDATE) {
  ------------------
  |  Branch (3992:7): [True: 18.4k, False: 55.2k]
  ------------------
 3993|  18.4k|    memset(ref_frame_map_pairs, -1, sizeof(*ref_frame_map_pairs) * REF_FRAMES);
 3994|  18.4k|    return;
 3995|  18.4k|  }
 3996|  55.2k|  memset(ref_frame_map_pairs, 0, sizeof(*ref_frame_map_pairs) * REF_FRAMES);
 3997|   496k|  for (int map_idx = 0; map_idx < REF_FRAMES; map_idx++) {
  ------------------
  |  Branch (3997:25): [True: 441k, False: 55.2k]
  ------------------
 3998|       |    // Get reference frame buffer.
 3999|   441k|    const RefCntBuffer *const buf = cpi->common.ref_frame_map[map_idx];
 4000|   441k|    if (ref_frame_map_pairs[map_idx].disp_order == -1) continue;
  ------------------
  |  Branch (4000:9): [True: 349k, False: 92.0k]
  ------------------
 4001|  92.0k|    if (buf == NULL) {
  ------------------
  |  Branch (4001:9): [True: 0, False: 92.0k]
  ------------------
 4002|      0|      ref_frame_map_pairs[map_idx].disp_order = -1;
 4003|      0|      ref_frame_map_pairs[map_idx].pyr_level = -1;
 4004|      0|      continue;
 4005|  92.0k|    } else if (buf->ref_count > 1) {
  ------------------
  |  Branch (4005:16): [True: 55.2k, False: 36.8k]
  ------------------
 4006|       |      // Once the keyframe is coded, the slots in ref_frame_map will all
 4007|       |      // point to the same frame. In that case, all subsequent pointers
 4008|       |      // matching the current are considered "free" slots. This will find
 4009|       |      // the next occurrence of the current pointer if ref_count indicates
 4010|       |      // there are multiple instances of it and mark it as free.
 4011|   404k|      for (int idx2 = map_idx + 1; idx2 < REF_FRAMES; ++idx2) {
  ------------------
  |  Branch (4011:36): [True: 349k, False: 55.2k]
  ------------------
 4012|   349k|        const RefCntBuffer *const buf2 = cpi->common.ref_frame_map[idx2];
 4013|   349k|        if (buf2 == buf) {
  ------------------
  |  Branch (4013:13): [True: 349k, False: 0]
  ------------------
 4014|   349k|          ref_frame_map_pairs[idx2].disp_order = -1;
 4015|   349k|          ref_frame_map_pairs[idx2].pyr_level = -1;
 4016|   349k|        }
 4017|   349k|      }
 4018|  55.2k|    }
 4019|  92.0k|    ref_frame_map_pairs[map_idx].disp_order = (int)buf->display_order_hint;
 4020|  92.0k|    ref_frame_map_pairs[map_idx].pyr_level = buf->pyramid_level;
 4021|  92.0k|  }
 4022|  55.2k|}
encode_strategy.c:get_ref_frame_flags:
 4371|  73.6k|                                      const int ext_ref_frame_flags) {
 4372|       |  // cpi->ext_flags.ref_frame_flags allows certain reference types to be
 4373|       |  // disabled by the external interface.  These are set by
 4374|       |  // av1_apply_encoding_flags(). Start with what the external interface allows,
 4375|       |  // then suppress any reference types which we have found to be duplicates.
 4376|  73.6k|  int flags = ext_ref_frame_flags;
 4377|       |
 4378|   515k|  for (int i = 1; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (4378:19): [True: 441k, False: 73.6k]
  ------------------
 4379|   441k|    const YV12_BUFFER_CONFIG *const this_ref = ref_frames[i];
 4380|       |    // If this_ref has appeared before, mark the corresponding ref frame as
 4381|       |    // invalid. For one_pass_rt mode, only disable GOLDEN_FRAME if it's the
 4382|       |    // same as LAST_FRAME or ALTREF_FRAME (if ALTREF is being used in nonrd).
 4383|   441k|    int index =
 4384|   441k|        (use_one_pass_rt_params && ref_frame_priority_order[i] == GOLDEN_FRAME)
  ------------------
  |  Branch (4384:10): [True: 146k, False: 295k]
  |  Branch (4384:36): [True: 24.4k, False: 122k]
  ------------------
 4385|   441k|            ? (1 + sf->rt_sf.use_nonrd_altref_frame)
 4386|   441k|            : i;
 4387|   441k|    for (int j = 0; j < index; ++j) {
  ------------------
  |  Branch (4387:21): [True: 441k, False: 0]
  ------------------
 4388|       |      // If this_ref has appeared before (same as the reference corresponding
 4389|       |      // to lower index j), remove it as a reference only if that reference
 4390|       |      // (for index j) is actually used as a reference.
 4391|   441k|      if (this_ref == ref_frames[j] &&
  ------------------
  |  Branch (4391:11): [True: 441k, False: 0]
  ------------------
 4392|   441k|          (flags & (1 << (ref_frame_priority_order[j] - 1)))) {
  ------------------
  |  Branch (4392:11): [True: 441k, False: 0]
  ------------------
 4393|   441k|        flags &= ~(1 << (ref_frame_priority_order[i] - 1));
 4394|   441k|        break;
 4395|   441k|      }
 4396|   441k|    }
 4397|   441k|  }
 4398|  73.6k|  return flags;
 4399|  73.6k|}
encode_strategy.c:is_psnr_calc_enabled:
 4440|  73.6k|static inline int is_psnr_calc_enabled(const AV1_COMP *cpi) {
 4441|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 4442|       |
 4443|  73.6k|  return cpi->ppi->b_calculate_psnr && !is_stat_generation_stage(cpi) &&
  ------------------
  |  Branch (4443:10): [True: 0, False: 73.6k]
  |  Branch (4443:40): [True: 0, False: 0]
  ------------------
 4444|      0|         cm->show_frame && !cpi->is_dropped_frame;
  ------------------
  |  Branch (4444:10): [True: 0, False: 0]
  |  Branch (4444:28): [True: 0, False: 0]
  ------------------
 4445|  73.6k|}
encode_strategy.c:encode_show_existing_frame:
 4274|  73.6k|static inline int encode_show_existing_frame(const AV1_COMMON *cm) {
 4275|  73.6k|  return cm->show_existing_frame && (!cm->features.error_resilient_mode ||
  ------------------
  |  Branch (4275:10): [True: 0, False: 73.6k]
  |  Branch (4275:38): [True: 0, False: 0]
  ------------------
 4276|      0|                                     cm->current_frame.frame_type == KEY_FRAME);
  ------------------
  |  Branch (4276:38): [True: 0, False: 0]
  ------------------
 4277|  73.6k|}
motion_search_facade.c:cond_cost_list:
 4240|  5.13M|static inline int *cond_cost_list(const struct AV1_COMP *cpi, int *cost_list) {
 4241|  5.13M|  const int use_cost_list = cpi->sf.mv_sf.subpel_search_method != SUBPEL_TREE &&
  ------------------
  |  Branch (4241:29): [True: 5.13M, False: 18.4E]
  ------------------
 4242|  5.13M|                            cpi->sf.mv_sf.use_fullpel_costlist;
  ------------------
  |  Branch (4242:29): [True: 0, False: 5.13M]
  ------------------
 4243|  5.13M|  return use_cost_list ? cost_list : NULL;
  ------------------
  |  Branch (4243:10): [True: 0, False: 5.13M]
  ------------------
 4244|  5.13M|}
motion_search_facade.c:set_mode_info_offsets:
 4317|  3.00M|    MACROBLOCKD *const xd, int mi_row, int mi_col) {
 4318|  3.00M|  set_mi_offsets(mi_params, xd, mi_row, mi_col);
 4319|  3.00M|  const int ext_idx = get_mi_ext_idx(mi_row, mi_col, mi_params->mi_alloc_bsize,
 4320|  3.00M|                                     mbmi_ext_info->stride);
 4321|  3.00M|  x->mbmi_ext_frame = mbmi_ext_info->frame_base + ext_idx;
 4322|  3.00M|}
motion_search_facade.c:get_mi_ext_idx:
 4283|  3.00M|                                 const int mbmi_ext_stride) {
 4284|  3.00M|  const int mi_ext_size_1d = mi_size_wide[mi_alloc_bsize];
 4285|  3.00M|  const int mi_ext_row = mi_row / mi_ext_size_1d;
 4286|  3.00M|  const int mi_ext_col = mi_col / mi_ext_size_1d;
 4287|  3.00M|  return mi_ext_row * mbmi_ext_stride + mi_ext_col;
 4288|  3.00M|}
motion_search_facade.c:get_ref_frame_yv12_buf:
 4082|  3.00M|    const AV1_COMMON *const cm, MV_REFERENCE_FRAME ref_frame) {
 4083|  3.00M|  const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
 4084|  3.00M|  return buf != NULL ? &buf->buf : NULL;
  ------------------
  |  Branch (4084:10): [True: 3.00M, False: 18.4E]
  ------------------
 4085|  3.00M|}
motion_search_facade.c:set_ref_ptrs:
 4222|  3.00M|                                MV_REFERENCE_FRAME ref1) {
 4223|  3.00M|  xd->block_ref_scale_factors[0] =
 4224|  3.00M|      get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
  ------------------
  |  Branch (4224:39): [True: 3.00M, False: 55]
  ------------------
 4225|  3.00M|  xd->block_ref_scale_factors[1] =
 4226|  3.00M|      get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
  ------------------
  |  Branch (4226:39): [True: 0, False: 3.00M]
  ------------------
 4227|  3.00M|}

encoder.c:alloc_compound_type_rd_buffers:
  165|  18.4k|    struct aom_internal_error_info *error, CompoundTypeRdBuffers *const bufs) {
  166|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  167|  18.4k|      error, bufs->pred0,
  168|  18.4k|      (uint8_t *)aom_memalign(16, 2 * MAX_SB_SQUARE * sizeof(*bufs->pred0)));
  169|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  170|  18.4k|      error, bufs->pred1,
  171|  18.4k|      (uint8_t *)aom_memalign(16, 2 * MAX_SB_SQUARE * sizeof(*bufs->pred1)));
  172|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  173|  18.4k|      error, bufs->residual1,
  174|  18.4k|      (int16_t *)aom_memalign(32, MAX_SB_SQUARE * sizeof(*bufs->residual1)));
  175|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  176|  18.4k|      error, bufs->diff10,
  177|  18.4k|      (int16_t *)aom_memalign(32, MAX_SB_SQUARE * sizeof(*bufs->diff10)));
  178|       |  AOM_CHECK_MEM_ERROR(error, bufs->tmp_best_mask_buf,
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  179|  18.4k|                      (uint8_t *)aom_malloc(2 * MAX_SB_SQUARE *
  180|  18.4k|                                            sizeof(*bufs->tmp_best_mask_buf)));
  181|  18.4k|}
encoder.c:alloc_compressor_data:
   59|  30.7k|static inline void alloc_compressor_data(AV1_COMP *cpi) {
   60|  30.7k|  AV1_COMMON *cm = &cpi->common;
   61|  30.7k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
   62|       |
   63|       |  // Setup mi_params
   64|  30.7k|  mi_params->set_mb_mi(mi_params, cm->width, cm->height,
   65|  30.7k|                       cpi->sf.part_sf.default_min_partition_size);
   66|       |
   67|  30.7k|  if (!is_stat_generation_stage(cpi)) av1_alloc_txb_buf(cpi);
  ------------------
  |  Branch (67:7): [True: 30.7k, False: 0]
  ------------------
   68|       |
   69|  30.7k|  aom_free(cpi->td.mv_costs_alloc);
   70|  30.7k|  cpi->td.mv_costs_alloc = NULL;
   71|       |  // Avoid the memory allocation of 'mv_costs_alloc' for allintra encoding
   72|       |  // mode.
   73|  30.7k|  if (cpi->oxcf.kf_cfg.key_freq_max != 0) {
  ------------------
  |  Branch (73:7): [True: 30.7k, False: 0]
  ------------------
   74|  30.7k|    CHECK_MEM_ERROR(cm, cpi->td.mv_costs_alloc,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|  30.7k|                    (MvCosts *)aom_calloc(1, sizeof(*cpi->td.mv_costs_alloc)));
   76|  30.7k|    cpi->td.mb.mv_costs = cpi->td.mv_costs_alloc;
   77|  30.7k|  }
   78|       |
   79|  30.7k|  av1_setup_shared_coeff_buffer(cm->seq_params, &cpi->td.shared_coeff_buf,
   80|  30.7k|                                cm->error);
   81|  30.7k|  if (av1_setup_sms_tree(cpi, &cpi->td)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 30.7k]
  ------------------
   82|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
   83|      0|                       "Failed to allocate SMS tree");
   84|      0|  }
   85|  30.7k|  cpi->td.firstpass_ctx =
   86|  30.7k|      av1_alloc_pmc(cpi, BLOCK_16X16, &cpi->td.shared_coeff_buf);
   87|  30.7k|  if (!cpi->td.firstpass_ctx)
  ------------------
  |  Branch (87:7): [True: 0, False: 30.7k]
  ------------------
   88|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
   89|      0|                       "Failed to allocate PICK_MODE_CONTEXT");
   90|  30.7k|}
encoder.c:realloc_segmentation_maps:
  106|  30.7k|static inline void realloc_segmentation_maps(AV1_COMP *cpi) {
  107|  30.7k|  AV1_COMMON *const cm = &cpi->common;
  108|  30.7k|  CommonModeInfoParams *const mi_params = &cm->mi_params;
  109|  30.7k|  int max_mi_cols = mi_params->mi_cols;
  110|  30.7k|  int max_mi_rows = mi_params->mi_rows;
  111|  30.7k|  if (cpi->oxcf.frm_dim_cfg.forced_max_frame_width) {
  ------------------
  |  Branch (111:7): [True: 0, False: 30.7k]
  ------------------
  112|      0|    max_mi_cols = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_width);
  113|      0|  }
  114|  30.7k|  if (cpi->oxcf.frm_dim_cfg.forced_max_frame_height) {
  ------------------
  |  Branch (114:7): [True: 0, False: 30.7k]
  ------------------
  115|      0|    max_mi_rows = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_height);
  116|      0|  }
  117|       |
  118|       |  // Create the encoder segmentation map and set all entries to 0
  119|  30.7k|  aom_free(cpi->enc_seg.map);
  120|  30.7k|  CHECK_MEM_ERROR(cm, cpi->enc_seg.map,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|  30.7k|                  aom_calloc(max_mi_rows * max_mi_cols, 1));
  122|       |
  123|       |  // Create a map used for cyclic background refresh.
  124|  30.7k|  if (cpi->cyclic_refresh) av1_cyclic_refresh_free(cpi->cyclic_refresh);
  ------------------
  |  Branch (124:7): [True: 12.3k, False: 18.4k]
  ------------------
  125|  30.7k|  CHECK_MEM_ERROR(cm, cpi->cyclic_refresh,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  30.7k|                  av1_cyclic_refresh_alloc(max_mi_rows, max_mi_cols));
  127|       |
  128|       |  // Create a map used to mark inactive areas.
  129|  30.7k|  aom_free(cpi->active_map.map);
  130|       |  CHECK_MEM_ERROR(cm, cpi->active_map.map,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  30.7k|                  aom_calloc(max_mi_rows * max_mi_cols, 1));
  132|  30.7k|}
encoder.c:alloc_obmc_buffers:
  135|  18.4k|                                      struct aom_internal_error_info *error) {
  136|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  137|  18.4k|      error, obmc_buffer->wsrc,
  138|  18.4k|      (int32_t *)aom_memalign(16, MAX_SB_SQUARE * sizeof(*obmc_buffer->wsrc)));
  139|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  140|  18.4k|      error, obmc_buffer->mask,
  141|  18.4k|      (int32_t *)aom_memalign(16, MAX_SB_SQUARE * sizeof(*obmc_buffer->mask)));
  142|  18.4k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  143|  18.4k|      error, obmc_buffer->above_pred,
  144|  18.4k|      (uint8_t *)aom_memalign(
  145|  18.4k|          16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*obmc_buffer->above_pred)));
  146|       |  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  18.4k|  do {                                                    \
  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  18.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  147|  18.4k|      error, obmc_buffer->left_pred,
  148|  18.4k|      (uint8_t *)aom_memalign(
  149|  18.4k|          16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*obmc_buffer->left_pred)));
  150|  18.4k|}
encoder.c:free_thread_data:
  471|  18.4k|static inline void free_thread_data(AV1_PRIMARY *ppi) {
  472|  18.4k|  PrimaryMultiThreadInfo *const p_mt_info = &ppi->p_mt_info;
  473|  18.4k|  const int num_tf_workers =
  474|  18.4k|      AOMMIN(p_mt_info->num_mod_workers[MOD_TF], p_mt_info->num_workers);
  ------------------
  |  |   34|  18.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.1k, False: 6.24k]
  |  |  ------------------
  ------------------
  475|  18.4k|  const int num_tpl_workers =
  476|  18.4k|      AOMMIN(p_mt_info->num_mod_workers[MOD_TPL], p_mt_info->num_workers);
  ------------------
  |  |   34|  18.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.1k, False: 6.24k]
  |  |  ------------------
  ------------------
  477|  18.4k|  const int is_highbitdepth = ppi->seq_params.use_highbitdepth;
  478|  18.4k|  const int num_planes = ppi->seq_params.monochrome ? 1 : MAX_MB_PLANE;
  ------------------
  |  |   36|  6.99k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (478:26): [True: 11.4k, False: 6.99k]
  ------------------
  479|   105k|  for (int t = 1; t < p_mt_info->num_workers; ++t) {
  ------------------
  |  Branch (479:19): [True: 86.9k, False: 18.4k]
  ------------------
  480|  86.9k|    EncWorkerData *const thread_data = &p_mt_info->tile_thr_data[t];
  481|  86.9k|    thread_data->td = thread_data->original_td;
  482|  86.9k|    ThreadData *const td = thread_data->td;
  483|  86.9k|    if (!td) continue;
  ------------------
  |  Branch (483:9): [True: 0, False: 86.9k]
  ------------------
  484|  86.9k|    aom_free(td->tctx);
  485|  86.9k|    aom_free(td->palette_buffer);
  486|  86.9k|    aom_free(td->tmp_conv_dst);
  487|  86.9k|    aom_free(td->upsample_pred);
  488|  86.9k|    release_compound_type_rd_buffers(&td->comp_rd_buffer);
  489|   260k|    for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (489:21): [True: 173k, False: 86.9k]
  ------------------
  490|   173k|      aom_free(td->tmp_pred_bufs[j]);
  491|   173k|    }
  492|  86.9k|    aom_free(td->pixel_gradient_info);
  493|  86.9k|    aom_free(td->src_var_info_of_4x4_sub_blocks);
  494|  86.9k|    release_obmc_buffers(&td->obmc_buffer);
  495|  86.9k|    aom_free(td->vt64x64);
  496|       |
  497|   260k|    for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (497:21): [True: 173k, False: 86.9k]
  ------------------
  498|   173k|      aom_free(td->hash_value_buffer[x]);
  499|   173k|      td->hash_value_buffer[x] = NULL;
  500|   173k|    }
  501|  86.9k|    aom_free(td->mv_costs_alloc);
  502|  86.9k|    td->mv_costs_alloc = NULL;
  503|  86.9k|    aom_free(td->dv_costs_alloc);
  504|  86.9k|    td->dv_costs_alloc = NULL;
  505|  86.9k|    aom_free(td->counts);
  506|  86.9k|    av1_free_pmc(td->firstpass_ctx, num_planes);
  507|  86.9k|    td->firstpass_ctx = NULL;
  508|  86.9k|    av1_free_shared_coeff_buffer(&td->shared_coeff_buf);
  509|  86.9k|    av1_free_sms_tree(td);
  510|       |    // This call ensures that the buffers allocated by tf_alloc_and_reset_data()
  511|       |    // in prepare_tf_workers() for MT encode are freed in case an error is
  512|       |    // encountered during temporal filtering (due to early termination
  513|       |    // tf_dealloc_thread_data() in av1_tf_do_filtering_mt() would not be
  514|       |    // invoked).
  515|  86.9k|    if (t < num_tf_workers) tf_dealloc_data(&td->tf_data, is_highbitdepth);
  ------------------
  |  Branch (515:9): [True: 16.9k, False: 70.0k]
  ------------------
  516|       |    // This call ensures that tpl_tmp_buffers for MT encode are freed in case of
  517|       |    // an error during tpl.
  518|  86.9k|    if (t < num_tpl_workers) tpl_dealloc_temp_buffers(&td->tpl_tmp_buffers);
  ------------------
  |  Branch (518:9): [True: 16.9k, False: 70.0k]
  ------------------
  519|       |    // This call ensures that the buffers in gm_data for MT encode are freed in
  520|       |    // case of an error during gm.
  521|  86.9k|    gm_dealloc_data(&td->gm_data);
  522|  86.9k|    av1_dealloc_mb_data(&td->mb, num_planes);
  523|  86.9k|    aom_free(td->mb.sb_stats_cache);
  524|  86.9k|    td->mb.sb_stats_cache = NULL;
  525|  86.9k|    aom_free(td->mb.sb_fp_stats);
  526|  86.9k|    td->mb.sb_fp_stats = NULL;
  527|       |#if CONFIG_PARTITION_SEARCH_ORDER
  528|       |    aom_free(td->mb.rdcost);
  529|       |    td->mb.rdcost = NULL;
  530|       |#endif
  531|  86.9k|    av1_free_pc_tree_recursive(td->pc_root, num_planes, 0, 0, SEARCH_PARTITION);
  532|  86.9k|    td->pc_root = NULL;
  533|  86.9k|    av1_dealloc_mb_wiener_var_pred_buf(td);
  534|  86.9k|    aom_free(td);
  535|  86.9k|    thread_data->td = NULL;
  536|       |    thread_data->original_td = NULL;
  537|  86.9k|  }
  538|  18.4k|}
encoder.c:release_compound_type_rd_buffers:
  184|   105k|    CompoundTypeRdBuffers *const bufs) {
  185|   105k|  aom_free(bufs->pred0);
  186|   105k|  aom_free(bufs->pred1);
  187|   105k|  aom_free(bufs->residual1);
  188|   105k|  aom_free(bufs->diff10);
  189|   105k|  aom_free(bufs->tmp_best_mask_buf);
  190|   105k|  av1_zero(*bufs);  // Set all pointers to NULL for safety.
  ------------------
  |  |   43|   105k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  191|   105k|}
encoder.c:release_obmc_buffers:
  152|   105k|static inline void release_obmc_buffers(OBMCBuffer *obmc_buffer) {
  153|   105k|  aom_free(obmc_buffer->mask);
  154|   105k|  aom_free(obmc_buffer->above_pred);
  155|   105k|  aom_free(obmc_buffer->left_pred);
  156|   105k|  aom_free(obmc_buffer->wsrc);
  157|       |
  158|   105k|  obmc_buffer->mask = NULL;
  159|   105k|  obmc_buffer->above_pred = NULL;
  160|   105k|  obmc_buffer->left_pred = NULL;
  161|       |  obmc_buffer->wsrc = NULL;
  162|   105k|}
encoder.c:dealloc_compressor_data:
  193|  18.4k|static inline void dealloc_compressor_data(AV1_COMP *cpi) {
  194|  18.4k|  AV1_COMMON *const cm = &cpi->common;
  195|  18.4k|  TokenInfo *token_info = &cpi->token_info;
  196|  18.4k|  const int num_planes = av1_num_planes(cm);
  197|  18.4k|  dealloc_context_buffers_ext(&cpi->mbmi_ext_info);
  198|       |
  199|  18.4k|  aom_free(cpi->tile_data);
  200|  18.4k|  cpi->tile_data = NULL;
  201|  18.4k|  cpi->allocated_tiles = 0;
  202|       |
  203|       |  // Delete sementation map
  204|  18.4k|  aom_free(cpi->enc_seg.map);
  205|  18.4k|  cpi->enc_seg.map = NULL;
  206|       |
  207|  18.4k|  av1_cyclic_refresh_free(cpi->cyclic_refresh);
  208|  18.4k|  cpi->cyclic_refresh = NULL;
  209|       |
  210|  18.4k|  aom_free(cpi->active_map.map);
  211|  18.4k|  cpi->active_map.map = NULL;
  212|       |
  213|  18.4k|  aom_free(cpi->roi.roi_map);
  214|  18.4k|  cpi->roi.roi_map = NULL;
  215|       |
  216|  18.4k|  aom_free(cpi->ssim_rdmult_scaling_factors);
  217|  18.4k|  cpi->ssim_rdmult_scaling_factors = NULL;
  218|       |
  219|  18.4k|  aom_free(cpi->tpl_rdmult_scaling_factors);
  220|  18.4k|  cpi->tpl_rdmult_scaling_factors = NULL;
  221|       |
  222|       |#if CONFIG_TUNE_VMAF
  223|       |  aom_free(cpi->vmaf_info.rdmult_scaling_factors);
  224|       |  cpi->vmaf_info.rdmult_scaling_factors = NULL;
  225|       |  aom_close_vmaf_model(cpi->vmaf_info.vmaf_model);
  226|       |#endif
  227|       |
  228|       |#if CONFIG_TUNE_BUTTERAUGLI
  229|       |  aom_free(cpi->butteraugli_info.rdmult_scaling_factors);
  230|       |  cpi->butteraugli_info.rdmult_scaling_factors = NULL;
  231|       |  aom_free_frame_buffer(&cpi->butteraugli_info.source);
  232|       |  aom_free_frame_buffer(&cpi->butteraugli_info.resized_source);
  233|       |#endif
  234|       |
  235|       |#if CONFIG_SALIENCY_MAP
  236|       |  aom_free(cpi->saliency_map);
  237|       |  aom_free(cpi->sm_scaling_factor);
  238|       |#endif
  239|       |
  240|  18.4k|  release_obmc_buffers(&cpi->td.mb.obmc_buffer);
  241|       |
  242|  18.4k|  aom_free(cpi->td.mv_costs_alloc);
  243|  18.4k|  cpi->td.mv_costs_alloc = NULL;
  244|  18.4k|  aom_free(cpi->td.dv_costs_alloc);
  245|  18.4k|  cpi->td.dv_costs_alloc = NULL;
  246|       |
  247|  18.4k|  aom_free(cpi->td.mb.sb_stats_cache);
  248|  18.4k|  cpi->td.mb.sb_stats_cache = NULL;
  249|       |
  250|  18.4k|  aom_free(cpi->td.mb.sb_fp_stats);
  251|  18.4k|  cpi->td.mb.sb_fp_stats = NULL;
  252|       |
  253|       |#if CONFIG_PARTITION_SEARCH_ORDER
  254|       |  aom_free(cpi->td.mb.rdcost);
  255|       |  cpi->td.mb.rdcost = NULL;
  256|       |#endif
  257|       |
  258|  18.4k|  av1_free_pc_tree_recursive(cpi->td.pc_root, num_planes, 0, 0,
  259|  18.4k|                             cpi->sf.part_sf.partition_search_type);
  260|  18.4k|  cpi->td.pc_root = NULL;
  261|       |
  262|  55.2k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (262:19): [True: 36.8k, False: 18.4k]
  ------------------
  263|  36.8k|    aom_free(cpi->td.mb.intrabc_hash_info.hash_value_buffer[i]);
  264|  36.8k|    cpi->td.mb.intrabc_hash_info.hash_value_buffer[i] = NULL;
  265|  36.8k|  }
  266|       |
  267|  18.4k|  av1_hash_table_destroy(&cpi->td.mb.intrabc_hash_info.intrabc_hash_table);
  268|       |
  269|  18.4k|  aom_free(cm->tpl_mvs);
  270|  18.4k|  cm->tpl_mvs = NULL;
  271|       |
  272|  18.4k|  aom_free(cpi->td.pixel_gradient_info);
  273|  18.4k|  cpi->td.pixel_gradient_info = NULL;
  274|       |
  275|  18.4k|  aom_free(cpi->td.src_var_info_of_4x4_sub_blocks);
  276|  18.4k|  cpi->td.src_var_info_of_4x4_sub_blocks = NULL;
  277|       |
  278|  18.4k|  aom_free(cpi->td.vt64x64);
  279|  18.4k|  cpi->td.vt64x64 = NULL;
  280|       |
  281|  18.4k|  av1_free_pmc(cpi->td.firstpass_ctx, num_planes);
  282|  18.4k|  cpi->td.firstpass_ctx = NULL;
  283|       |
  284|  18.4k|  const int is_highbitdepth = cpi->tf_ctx.is_highbitdepth;
  285|       |  // This call ensures that the buffers allocated by tf_alloc_and_reset_data()
  286|       |  // in av1_temporal_filter() for single-threaded encode are freed in case an
  287|       |  // error is encountered during temporal filtering (due to early termination
  288|       |  // tf_dealloc_data() in av1_temporal_filter() would not be invoked).
  289|  18.4k|  tf_dealloc_data(&cpi->td.tf_data, is_highbitdepth);
  290|       |
  291|       |  // This call ensures that tpl_tmp_buffers for single-threaded encode are freed
  292|       |  // in case of an error during tpl.
  293|  18.4k|  tpl_dealloc_temp_buffers(&cpi->td.tpl_tmp_buffers);
  294|       |
  295|       |  // This call ensures that the global motion (gm) data buffers for
  296|       |  // single-threaded encode are freed in case of an error during gm.
  297|  18.4k|  gm_dealloc_data(&cpi->td.gm_data);
  298|       |
  299|       |  // This call ensures that CDEF search context buffers are deallocated in case
  300|       |  // of an error during cdef search.
  301|  18.4k|  av1_cdef_dealloc_data(cpi->cdef_search_ctx);
  302|  18.4k|  aom_free(cpi->cdef_search_ctx);
  303|  18.4k|  cpi->cdef_search_ctx = NULL;
  304|       |
  305|  18.4k|  av1_dealloc_mb_data(&cpi->td.mb, num_planes);
  306|       |
  307|  18.4k|  av1_dealloc_mb_wiener_var_pred_buf(&cpi->td);
  308|       |
  309|  18.4k|  av1_free_txb_buf(cpi);
  310|  18.4k|  av1_free_context_buffers(cm);
  311|       |
  312|  18.4k|  aom_free_frame_buffer(&cpi->last_frame_uf);
  313|  18.4k|#if !CONFIG_REALTIME_ONLY
  314|  18.4k|  av1_free_restoration_buffers(cm);
  315|  18.4k|  av1_free_firstpass_data(&cpi->firstpass_data);
  316|  18.4k|#endif
  317|       |
  318|  18.4k|  if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (318:7): [True: 18.4k, False: 0]
  ------------------
  319|  18.4k|    av1_free_cdef_buffers(cm, &cpi->ppi->p_mt_info.cdef_worker,
  320|  18.4k|                          &cpi->mt_info.cdef_sync);
  321|  18.4k|  }
  322|       |
  323|  50.8k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (323:23): [True: 32.4k, False: 18.4k]
  ------------------
  324|  32.4k|    aom_free(cpi->pick_lr_ctxt.rusi[plane]);
  325|  32.4k|    cpi->pick_lr_ctxt.rusi[plane] = NULL;
  326|  32.4k|  }
  327|  18.4k|  aom_free(cpi->pick_lr_ctxt.dgd_avg);
  328|  18.4k|  cpi->pick_lr_ctxt.dgd_avg = NULL;
  329|       |
  330|  18.4k|  aom_free_frame_buffer(&cpi->trial_frame_rst);
  331|  18.4k|  aom_free_frame_buffer(&cpi->scaled_source);
  332|  18.4k|  aom_free_frame_buffer(&cpi->scaled_last_source);
  333|  18.4k|  aom_free_frame_buffer(&cpi->orig_source);
  334|  18.4k|  aom_free_frame_buffer(&cpi->svc.source_last_TL0);
  335|       |
  336|  18.4k|  free_token_info(token_info);
  337|       |
  338|  18.4k|  av1_free_shared_coeff_buffer(&cpi->td.shared_coeff_buf);
  339|  18.4k|  av1_free_sms_tree(&cpi->td);
  340|       |
  341|  18.4k|  aom_free(cpi->td.mb.palette_buffer);
  342|  18.4k|  release_compound_type_rd_buffers(&cpi->td.mb.comp_rd_buffer);
  343|  18.4k|  aom_free(cpi->td.mb.tmp_conv_dst);
  344|  18.4k|  aom_free(cpi->td.mb.upsample_pred);
  345|  55.2k|  for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (345:19): [True: 36.8k, False: 18.4k]
  ------------------
  346|  36.8k|    aom_free(cpi->td.mb.tmp_pred_bufs[j]);
  347|  36.8k|  }
  348|       |
  349|  18.4k|#if CONFIG_DENOISE && !CONFIG_REALTIME_ONLY
  350|  18.4k|  if (cpi->denoise_and_model) {
  ------------------
  |  Branch (350:7): [True: 0, False: 18.4k]
  ------------------
  351|      0|    aom_denoise_and_model_free(cpi->denoise_and_model);
  352|      0|    cpi->denoise_and_model = NULL;
  353|      0|  }
  354|  18.4k|#endif
  355|  18.4k|#if !CONFIG_REALTIME_ONLY
  356|  18.4k|  if (cpi->film_grain_table) {
  ------------------
  |  Branch (356:7): [True: 0, False: 18.4k]
  ------------------
  357|      0|    aom_film_grain_table_free(cpi->film_grain_table);
  358|      0|    aom_free(cpi->film_grain_table);
  359|      0|    cpi->film_grain_table = NULL;
  360|      0|  }
  361|  18.4k|#endif
  362|       |
  363|  18.4k|  if (cpi->ppi->use_svc) av1_free_svc_cyclic_refresh(cpi);
  ------------------
  |  Branch (363:7): [True: 0, False: 18.4k]
  ------------------
  364|  18.4k|  aom_free(cpi->svc.layer_context);
  365|  18.4k|  cpi->svc.layer_context = NULL;
  366|       |
  367|  18.4k|  aom_free(cpi->consec_zero_mv);
  368|  18.4k|  cpi->consec_zero_mv = NULL;
  369|  18.4k|  cpi->consec_zero_mv_alloc_size = 0;
  370|       |
  371|  18.4k|  aom_free(cpi->src_sad_blk_64x64);
  372|  18.4k|  cpi->src_sad_blk_64x64 = NULL;
  373|       |
  374|  18.4k|  aom_free(cpi->mb_weber_stats);
  375|  18.4k|  cpi->mb_weber_stats = NULL;
  376|       |
  377|  18.4k|  if (cpi->oxcf.enable_rate_guide_deltaq) {
  ------------------
  |  Branch (377:7): [True: 0, False: 18.4k]
  ------------------
  378|      0|    aom_free(cpi->prep_rate_estimates);
  379|      0|    cpi->prep_rate_estimates = NULL;
  380|       |
  381|      0|    aom_free(cpi->ext_rate_distribution);
  382|      0|    cpi->ext_rate_distribution = NULL;
  383|      0|  }
  384|       |
  385|  18.4k|  aom_free(cpi->mb_delta_q);
  386|  18.4k|  cpi->mb_delta_q = NULL;
  387|       |
  388|  18.4k|#if !CONFIG_REALTIME_ONLY
  389|  18.4k|  av1_free_tpl_gop_stats(&cpi->extrc_tpl_gop_stats);
  390|  18.4k|#endif
  391|  18.4k|}
encoder.c:dealloc_context_buffers_ext:
   30|  18.4k|    MBMIExtFrameBufferInfo *mbmi_ext_info) {
   31|  18.4k|  aom_free(mbmi_ext_info->frame_base);
   32|       |  mbmi_ext_info->frame_base = NULL;
   33|  18.4k|  mbmi_ext_info->alloc_size = 0;
   34|  18.4k|}
encoder.c:alloc_mb_mode_info_buffers:
   94|  63.3k|static inline void alloc_mb_mode_info_buffers(AV1_COMP *const cpi) {
   95|  63.3k|  AV1_COMMON *const cm = &cpi->common;
   96|  63.3k|  if (av1_alloc_context_buffers(cm, cm->width, cm->height,
  ------------------
  |  Branch (96:7): [True: 0, False: 63.3k]
  ------------------
   97|  63.3k|                                cpi->sf.part_sf.default_min_partition_size)) {
   98|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
   99|      0|                       "Failed to allocate context buffers");
  100|      0|  }
  101|       |
  102|  63.3k|  if (!is_stat_generation_stage(cpi))
  ------------------
  |  Branch (102:7): [True: 63.3k, False: 0]
  ------------------
  103|  63.3k|    alloc_context_buffers_ext(cm, &cpi->mbmi_ext_info);
  104|  63.3k|}
encoder.c:alloc_context_buffers_ext:
   37|  63.3k|    AV1_COMMON *cm, MBMIExtFrameBufferInfo *mbmi_ext_info) {
   38|  63.3k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
   39|       |
   40|  63.3k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
   41|  63.3k|  const int mi_alloc_rows =
   42|  63.3k|      (mi_params->mi_rows + mi_alloc_size_1d - 1) / mi_alloc_size_1d;
   43|  63.3k|  const int mi_alloc_cols =
   44|  63.3k|      (mi_params->mi_cols + mi_alloc_size_1d - 1) / mi_alloc_size_1d;
   45|  63.3k|  const int new_ext_mi_size = mi_alloc_rows * mi_alloc_cols;
   46|       |
   47|  63.3k|  if (new_ext_mi_size > mbmi_ext_info->alloc_size) {
  ------------------
  |  Branch (47:7): [True: 0, False: 63.3k]
  ------------------
   48|      0|    dealloc_context_buffers_ext(mbmi_ext_info);
   49|      0|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|      0|        cm, mbmi_ext_info->frame_base,
   51|      0|        aom_malloc(new_ext_mi_size * sizeof(*mbmi_ext_info->frame_base)));
   52|      0|    mbmi_ext_info->alloc_size = new_ext_mi_size;
   53|      0|  }
   54|       |  // The stride needs to be updated regardless of whether new allocation
   55|       |  // happened or not.
   56|  63.3k|  mbmi_ext_info->stride = mi_alloc_cols;
   57|  63.3k|}
encoder.c:allocate_gradient_info_for_hog:
  393|  73.6k|static inline void allocate_gradient_info_for_hog(AV1_COMP *cpi) {
  394|  73.6k|  if (!is_gradient_caching_for_hog_enabled(cpi)) return;
  ------------------
  |  Branch (394:7): [True: 61.3k, False: 12.3k]
  ------------------
  395|       |
  396|  12.3k|  PixelLevelGradientInfo *pixel_gradient_info = cpi->td.pixel_gradient_info;
  397|  12.3k|  if (!pixel_gradient_info) {
  ------------------
  |  Branch (397:7): [True: 12.3k, False: 0]
  ------------------
  398|  12.3k|    const AV1_COMMON *const cm = &cpi->common;
  399|  12.3k|    const int plane_types = PLANE_TYPES >> cm->seq_params->monochrome;
  400|  12.3k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  12.3k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  12.3k|  do {                                                    \
  |  |  |  |   72|  12.3k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  12.3k|    lval = (expr);                                        \
  |  |  |  |   74|  12.3k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 12.3k]
  |  |  |  |  ------------------
  |  |  |  |   75|  12.3k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  12.3k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 12.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|  12.3k|        cm, pixel_gradient_info,
  402|  12.3k|        aom_malloc(sizeof(*pixel_gradient_info) * plane_types * MAX_SB_SQUARE));
  403|  12.3k|    cpi->td.pixel_gradient_info = pixel_gradient_info;
  404|  12.3k|  }
  405|       |
  406|  12.3k|  cpi->td.mb.pixel_gradient_info = pixel_gradient_info;
  407|  12.3k|}
encoder.c:allocate_src_var_of_4x4_sub_block_buf:
  409|  73.6k|static inline void allocate_src_var_of_4x4_sub_block_buf(AV1_COMP *cpi) {
  410|  73.6k|  if (!is_src_var_for_4x4_sub_blocks_caching_enabled(cpi)) return;
  ------------------
  |  Branch (410:7): [True: 73.6k, False: 0]
  ------------------
  411|       |
  412|      0|  Block4x4VarInfo *source_variance_info =
  413|      0|      cpi->td.src_var_info_of_4x4_sub_blocks;
  414|      0|  if (!source_variance_info) {
  ------------------
  |  Branch (414:7): [True: 0, False: 0]
  ------------------
  415|      0|    const AV1_COMMON *const cm = &cpi->common;
  416|      0|    const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
  417|      0|    const int mi_count_in_sb = mi_size_wide[sb_size] * mi_size_high[sb_size];
  418|      0|    CHECK_MEM_ERROR(cm, source_variance_info,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  419|      0|                    aom_malloc(sizeof(*source_variance_info) * mi_count_in_sb));
  420|      0|    cpi->td.src_var_info_of_4x4_sub_blocks = source_variance_info;
  421|      0|  }
  422|       |
  423|      0|  cpi->td.mb.src_var_info_of_4x4_sub_blocks = source_variance_info;
  424|      0|}
encoder.c:variance_partition_alloc:
  426|  24.4k|static inline void variance_partition_alloc(AV1_COMP *cpi) {
  427|  24.4k|  AV1_COMMON *const cm = &cpi->common;
  428|  24.4k|  const int num_64x64_blocks = (cm->seq_params->sb_size == BLOCK_64X64) ? 1 : 4;
  ------------------
  |  Branch (428:32): [True: 24.4k, False: 0]
  ------------------
  429|  24.4k|  if (cpi->td.vt64x64) {
  ------------------
  |  Branch (429:7): [True: 18.3k, False: 6.10k]
  ------------------
  430|  18.3k|    if (num_64x64_blocks != cpi->td.num_64x64_blocks) {
  ------------------
  |  Branch (430:9): [True: 0, False: 18.3k]
  ------------------
  431|      0|      aom_free(cpi->td.vt64x64);
  432|      0|      cpi->td.vt64x64 = NULL;
  433|      0|    }
  434|  18.3k|  }
  435|  24.4k|  if (!cpi->td.vt64x64) {
  ------------------
  |  Branch (435:7): [True: 6.10k, False: 18.3k]
  ------------------
  436|       |    CHECK_MEM_ERROR(cm, cpi->td.vt64x64,
  ------------------
  |  |   51|  6.10k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  6.10k|  do {                                                    \
  |  |  |  |   72|  6.10k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  6.10k|    lval = (expr);                                        \
  |  |  |  |   74|  6.10k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 6.10k]
  |  |  |  |  ------------------
  |  |  |  |   75|  6.10k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  6.10k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 6.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|  6.10k|                    aom_malloc(sizeof(*cpi->td.vt64x64) * num_64x64_blocks));
  438|  6.10k|    cpi->td.num_64x64_blocks = num_64x64_blocks;
  439|  6.10k|  }
  440|  24.4k|}
ethread.c:alloc_obmc_buffers:
  135|  16.9k|                                      struct aom_internal_error_info *error) {
  136|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  137|  16.9k|      error, obmc_buffer->wsrc,
  138|  16.9k|      (int32_t *)aom_memalign(16, MAX_SB_SQUARE * sizeof(*obmc_buffer->wsrc)));
  139|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  140|  16.9k|      error, obmc_buffer->mask,
  141|  16.9k|      (int32_t *)aom_memalign(16, MAX_SB_SQUARE * sizeof(*obmc_buffer->mask)));
  142|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  143|  16.9k|      error, obmc_buffer->above_pred,
  144|  16.9k|      (uint8_t *)aom_memalign(
  145|  16.9k|          16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*obmc_buffer->above_pred)));
  146|       |  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  147|  16.9k|      error, obmc_buffer->left_pred,
  148|  16.9k|      (uint8_t *)aom_memalign(
  149|  16.9k|          16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*obmc_buffer->left_pred)));
  150|  16.9k|}
ethread.c:alloc_compound_type_rd_buffers:
  165|  16.9k|    struct aom_internal_error_info *error, CompoundTypeRdBuffers *const bufs) {
  166|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  167|  16.9k|      error, bufs->pred0,
  168|  16.9k|      (uint8_t *)aom_memalign(16, 2 * MAX_SB_SQUARE * sizeof(*bufs->pred0)));
  169|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  170|  16.9k|      error, bufs->pred1,
  171|  16.9k|      (uint8_t *)aom_memalign(16, 2 * MAX_SB_SQUARE * sizeof(*bufs->pred1)));
  172|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  173|  16.9k|      error, bufs->residual1,
  174|  16.9k|      (int16_t *)aom_memalign(32, MAX_SB_SQUARE * sizeof(*bufs->residual1)));
  175|  16.9k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  176|  16.9k|      error, bufs->diff10,
  177|  16.9k|      (int16_t *)aom_memalign(32, MAX_SB_SQUARE * sizeof(*bufs->diff10)));
  178|       |  AOM_CHECK_MEM_ERROR(error, bufs->tmp_best_mask_buf,
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  179|  16.9k|                      (uint8_t *)aom_malloc(2 * MAX_SB_SQUARE *
  180|  16.9k|                                            sizeof(*bufs->tmp_best_mask_buf)));
  181|  16.9k|}
encode_strategy.c:alloc_mb_mode_info_buffers:
   94|  73.6k|static inline void alloc_mb_mode_info_buffers(AV1_COMP *const cpi) {
   95|  73.6k|  AV1_COMMON *const cm = &cpi->common;
   96|  73.6k|  if (av1_alloc_context_buffers(cm, cm->width, cm->height,
  ------------------
  |  Branch (96:7): [True: 0, False: 73.6k]
  ------------------
   97|  73.6k|                                cpi->sf.part_sf.default_min_partition_size)) {
   98|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
   99|      0|                       "Failed to allocate context buffers");
  100|      0|  }
  101|       |
  102|  73.6k|  if (!is_stat_generation_stage(cpi))
  ------------------
  |  Branch (102:7): [True: 73.6k, False: 0]
  ------------------
  103|  73.6k|    alloc_context_buffers_ext(cm, &cpi->mbmi_ext_info);
  104|  73.6k|}
encode_strategy.c:alloc_context_buffers_ext:
   37|  73.6k|    AV1_COMMON *cm, MBMIExtFrameBufferInfo *mbmi_ext_info) {
   38|  73.6k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
   39|       |
   40|  73.6k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
   41|  73.6k|  const int mi_alloc_rows =
   42|  73.6k|      (mi_params->mi_rows + mi_alloc_size_1d - 1) / mi_alloc_size_1d;
   43|  73.6k|  const int mi_alloc_cols =
   44|  73.6k|      (mi_params->mi_cols + mi_alloc_size_1d - 1) / mi_alloc_size_1d;
   45|  73.6k|  const int new_ext_mi_size = mi_alloc_rows * mi_alloc_cols;
   46|       |
   47|  73.6k|  if (new_ext_mi_size > mbmi_ext_info->alloc_size) {
  ------------------
  |  Branch (47:7): [True: 18.4k, False: 55.2k]
  ------------------
   48|  18.4k|    dealloc_context_buffers_ext(mbmi_ext_info);
   49|  18.4k|    CHECK_MEM_ERROR(
  ------------------
  |  |   51|  18.4k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  18.4k|  do {                                                    \
  |  |  |  |   72|  18.4k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  18.4k|    lval = (expr);                                        \
  |  |  |  |   74|  18.4k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   75|  18.4k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  18.4k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|  18.4k|        cm, mbmi_ext_info->frame_base,
   51|  18.4k|        aom_malloc(new_ext_mi_size * sizeof(*mbmi_ext_info->frame_base)));
   52|  18.4k|    mbmi_ext_info->alloc_size = new_ext_mi_size;
   53|  18.4k|  }
   54|       |  // The stride needs to be updated regardless of whether new allocation
   55|       |  // happened or not.
   56|  73.6k|  mbmi_ext_info->stride = mi_alloc_cols;
   57|  73.6k|}
encode_strategy.c:dealloc_context_buffers_ext:
   30|  18.4k|    MBMIExtFrameBufferInfo *mbmi_ext_info) {
   31|  18.4k|  aom_free(mbmi_ext_info->frame_base);
   32|       |  mbmi_ext_info->frame_base = NULL;
   33|  18.4k|  mbmi_ext_info->alloc_size = 0;
   34|  18.4k|}

av1_apply_active_map:
  538|  73.6k|void av1_apply_active_map(AV1_COMP *cpi) {
  539|  73.6k|  struct segmentation *const seg = &cpi->common.seg;
  540|  73.6k|  unsigned char *const seg_map = cpi->enc_seg.map;
  541|  73.6k|  const unsigned char *const active_map = cpi->active_map.map;
  542|       |
  543|  73.6k|  assert(AM_SEGMENT_ID_ACTIVE == CR_SEGMENT_ID_BASE);
  544|       |
  545|       |  // Disable the active_maps on intra_only frames or if the
  546|       |  // input map for the current frame has no inactive blocks.
  547|  73.6k|  if (frame_is_intra_only(&cpi->common) ||
  ------------------
  |  Branch (547:7): [True: 18.4k, False: 55.2k]
  ------------------
  548|  73.6k|      cpi->rc.percent_blocks_inactive == 0) {
  ------------------
  |  Branch (548:7): [True: 55.2k, False: 0]
  ------------------
  549|  73.6k|    cpi->active_map.enabled = 0;
  550|  73.6k|    cpi->active_map.update = 1;
  551|  73.6k|  }
  552|       |
  553|  73.6k|  if (cpi->active_map.update) {
  ------------------
  |  Branch (553:7): [True: 73.6k, False: 0]
  ------------------
  554|  73.6k|    if (cpi->active_map.enabled) {
  ------------------
  |  Branch (554:9): [True: 0, False: 73.6k]
  ------------------
  555|      0|      const int num_mis =
  556|      0|          cpi->common.mi_params.mi_rows * cpi->common.mi_params.mi_cols;
  557|      0|      memcpy(seg_map, active_map, sizeof(active_map[0]) * num_mis);
  558|      0|      av1_enable_segmentation(seg);
  559|      0|      av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP);
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  560|      0|      av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H);
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  561|      0|      av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V);
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  562|      0|      av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U);
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  563|      0|      av1_enable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V);
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  564|       |
  565|      0|      av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H,
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  566|      0|                      -MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  567|      0|      av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V,
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  568|      0|                      -MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  569|      0|      av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U,
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  570|      0|                      -MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  571|      0|      av1_set_segdata(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V,
  ------------------
  |  |   25|      0|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  572|      0|                      -MAX_LOOP_FILTER);
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  573|  73.6k|    } else {
  574|  73.6k|      av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_SKIP);
  ------------------
  |  |   25|  73.6k|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  575|  73.6k|      av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_H);
  ------------------
  |  |   25|  73.6k|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  576|  73.6k|      av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_Y_V);
  ------------------
  |  |   25|  73.6k|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  577|  73.6k|      av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_U);
  ------------------
  |  |   25|  73.6k|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  578|  73.6k|      av1_disable_segfeature(seg, AM_SEGMENT_ID_INACTIVE, SEG_LVL_ALT_LF_V);
  ------------------
  |  |   25|  73.6k|#define AM_SEGMENT_ID_INACTIVE 7
  ------------------
  579|  73.6k|      if (seg->enabled) {
  ------------------
  |  Branch (579:11): [True: 0, False: 73.6k]
  ------------------
  580|      0|        seg->update_data = 1;
  581|      0|        seg->update_map = 1;
  582|      0|      }
  583|  73.6k|    }
  584|  73.6k|    cpi->active_map.update = 0;
  585|  73.6k|  }
  586|  73.6k|}
av1_set_size_dependent_vars:
  671|  73.6k|                                 int *top_index) {
  672|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  673|       |
  674|       |  // Setup variables that depend on the dimensions of the frame.
  675|  73.6k|  av1_set_speed_features_framesize_dependent(cpi, cpi->speed);
  676|       |
  677|  73.6k|#if !CONFIG_REALTIME_ONLY
  678|  73.6k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
  679|  73.6k|  if (cpi->oxcf.algo_cfg.enable_tpl_model &&
  ------------------
  |  Branch (679:7): [True: 18.4k, False: 55.2k]
  ------------------
  680|  18.4k|      av1_tpl_stats_ready(&cpi->ppi->tpl_data, cpi->gf_frame_index)) {
  ------------------
  |  Branch (680:7): [True: 0, False: 18.4k]
  ------------------
  681|      0|    process_tpl_stats_frame(cpi);
  682|      0|    av1_tpl_rdmult_setup(cpi);
  683|      0|  }
  684|  73.6k|#endif
  685|       |
  686|  73.6k|  if (cpi->oxcf.q_cfg.use_fixed_qp_offsets == 2 &&
  ------------------
  |  Branch (686:7): [True: 49.2k, False: 24.4k]
  ------------------
  687|  49.2k|      cpi->oxcf.rc_cfg.mode == AOM_Q) {
  ------------------
  |  Branch (687:7): [True: 49.2k, False: 0]
  ------------------
  688|       |    // Disable scaling, and use the same q for all frames of the pyramid
  689|  49.2k|    *q = cpi->oxcf.rc_cfg.cq_level;
  690|  49.2k|    *top_index = *bottom_index = *q;
  691|  49.2k|    cpi->ppi->p_rc.arf_q = *q;
  692|  49.2k|  } else {
  693|       |    // Decide q and q bounds.
  694|  24.4k|    *q = av1_rc_pick_q_and_bounds(cpi, cm->width, cm->height,
  695|  24.4k|                                  cpi->gf_frame_index, bottom_index, top_index);
  696|       |
  697|  24.4k|    if (cpi->oxcf.rc_cfg.mode == AOM_CBR && cpi->rc.force_max_q) {
  ------------------
  |  Branch (697:9): [True: 24.4k, False: 0]
  |  Branch (697:45): [True: 0, False: 24.4k]
  ------------------
  698|      0|      *q = cpi->rc.worst_quality;
  699|      0|      cpi->rc.force_max_q = 0;
  700|      0|    }
  701|       |
  702|  24.4k|#if !CONFIG_REALTIME_ONLY
  703|  24.4k|    if (cpi->oxcf.rc_cfg.mode == AOM_Q &&
  ------------------
  |  Branch (703:9): [True: 0, False: 24.4k]
  ------------------
  704|      0|        cpi->ppi->tpl_data.tpl_frame[cpi->gf_frame_index].is_valid &&
  ------------------
  |  Branch (704:9): [True: 0, False: 0]
  ------------------
  705|      0|        !is_lossless_requested(&cpi->oxcf.rc_cfg)) {
  ------------------
  |  Branch (705:9): [True: 0, False: 0]
  ------------------
  706|      0|      const RateControlCfg *const rc_cfg = &cpi->oxcf.rc_cfg;
  707|      0|      const int tpl_q = av1_tpl_get_q_index(
  708|      0|          &cpi->ppi->tpl_data, cpi->gf_frame_index,
  709|      0|          cpi->rc.active_worst_quality, cm->seq_params->bit_depth);
  710|      0|      *q = clamp(tpl_q, rc_cfg->best_allowed_q, rc_cfg->worst_allowed_q);
  711|      0|      *top_index = *bottom_index = *q;
  712|      0|      if (gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE)
  ------------------
  |  Branch (712:11): [True: 0, False: 0]
  ------------------
  713|      0|        cpi->ppi->p_rc.arf_q = *q;
  714|      0|    }
  715|       |
  716|  24.4k|    if (cpi->oxcf.q_cfg.use_fixed_qp_offsets == 1 &&
  ------------------
  |  Branch (716:9): [True: 0, False: 24.4k]
  ------------------
  717|      0|        cpi->oxcf.rc_cfg.mode == AOM_Q) {
  ------------------
  |  Branch (717:9): [True: 0, False: 0]
  ------------------
  718|      0|      if (is_frame_tpl_eligible(gf_group, cpi->gf_frame_index)) {
  ------------------
  |  Branch (718:11): [True: 0, False: 0]
  ------------------
  719|      0|        const double qratio_grad =
  720|      0|            cpi->ppi->p_rc.baseline_gf_interval > 20 ? 0.2 : 0.3;
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|        const double qstep_ratio =
  722|      0|            0.2 +
  723|      0|            (1.0 - (double)cpi->rc.active_worst_quality / MAXQ) * qratio_grad;
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
  724|      0|        *q = av1_get_q_index_from_qstep_ratio(cpi->rc.active_worst_quality,
  725|      0|                                              qstep_ratio,
  726|      0|                                              cm->seq_params->bit_depth);
  727|      0|        *top_index = *bottom_index = *q;
  728|      0|        if (gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE ||
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|            gf_group->update_type[cpi->gf_frame_index] == KF_UPDATE ||
  ------------------
  |  Branch (729:13): [True: 0, False: 0]
  ------------------
  730|      0|            gf_group->update_type[cpi->gf_frame_index] == GF_UPDATE)
  ------------------
  |  Branch (730:13): [True: 0, False: 0]
  ------------------
  731|      0|          cpi->ppi->p_rc.arf_q = *q;
  732|      0|      } else if (gf_group->layer_depth[cpi->gf_frame_index] <
  ------------------
  |  Branch (732:18): [True: 0, False: 0]
  ------------------
  733|      0|                 gf_group->max_layer_depth) {
  734|      0|        int this_height = gf_group->layer_depth[cpi->gf_frame_index];
  735|      0|        int arf_q = cpi->ppi->p_rc.arf_q;
  736|      0|        while (this_height > 1) {
  ------------------
  |  Branch (736:16): [True: 0, False: 0]
  ------------------
  737|      0|          arf_q = (arf_q + cpi->oxcf.rc_cfg.cq_level + 1) / 2;
  738|      0|          --this_height;
  739|      0|        }
  740|      0|        *top_index = *bottom_index = *q = arf_q;
  741|      0|      }
  742|      0|    }
  743|  24.4k|#endif
  744|  24.4k|  }
  745|       |
  746|       |  // Configure experimental use of segmentation for enhanced coding of
  747|       |  // static regions if indicated.
  748|       |  // Only allowed in the second pass of a two pass encode, as it requires
  749|       |  // lagged coding, and if the relevant speed feature flag is set.
  750|  73.6k|  if (is_stat_consumption_stage_twopass(cpi) &&
  ------------------
  |  Branch (750:7): [True: 0, False: 73.6k]
  ------------------
  751|      0|      cpi->sf.hl_sf.static_segmentation)
  ------------------
  |  Branch (751:7): [True: 0, False: 0]
  ------------------
  752|      0|    configure_static_seg_features(cpi);
  753|       |
  754|  73.6k|  if (cpi->oxcf.rc_cfg.force_max_q || cpi->oxcf.rc_cfg.over_shoot_pct == 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 73.6k]
  |  Branch (754:39): [True: 0, False: 73.6k]
  ------------------
  755|      0|    *top_index = MAXQ;
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
  756|      0|  }
  757|  73.6k|  if (cpi->oxcf.rc_cfg.under_shoot_pct == 0) *bottom_index = MINQ;
  ------------------
  |  |   25|      0|#define MINQ 0
  ------------------
  |  Branch (757:7): [True: 0, False: 73.6k]
  ------------------
  758|  73.6k|}
av1_update_film_grain_parameters_seq:
  776|   155k|                                          const AV1EncoderConfig *oxcf) {
  777|   155k|  SequenceHeader *const seq_params = &ppi->seq_params;
  778|   155k|  const TuneCfg *const tune_cfg = &oxcf->tune_cfg;
  779|       |
  780|   155k|  if (tune_cfg->film_grain_test_vector || tune_cfg->film_grain_table_filename ||
  ------------------
  |  Branch (780:7): [True: 0, False: 155k]
  |  Branch (780:43): [True: 0, False: 155k]
  ------------------
  781|   155k|      tune_cfg->content == AOM_CONTENT_FILM) {
  ------------------
  |  Branch (781:7): [True: 0, False: 155k]
  ------------------
  782|      0|    seq_params->film_grain_params_present = 1;
  783|   155k|  } else {
  784|   155k|#if CONFIG_DENOISE
  785|   155k|    seq_params->film_grain_params_present = (oxcf->noise_level > 0);
  786|       |#else
  787|       |    seq_params->film_grain_params_present = 0;
  788|       |#endif
  789|   155k|  }
  790|   155k|}
av1_update_film_grain_parameters:
  793|   155k|                                      const AV1EncoderConfig *oxcf) {
  794|   155k|  AV1_COMMON *const cm = &cpi->common;
  795|   155k|  const TuneCfg *const tune_cfg = &oxcf->tune_cfg;
  796|       |
  797|   155k|  if (cpi->film_grain_table) {
  ------------------
  |  Branch (797:7): [True: 0, False: 155k]
  ------------------
  798|      0|    aom_film_grain_table_free(cpi->film_grain_table);
  799|      0|    aom_free(cpi->film_grain_table);
  800|      0|    cpi->film_grain_table = NULL;
  801|      0|  }
  802|       |
  803|   155k|  if (tune_cfg->film_grain_test_vector) {
  ------------------
  |  Branch (803:7): [True: 0, False: 155k]
  ------------------
  804|      0|    if (cm->current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (804:9): [True: 0, False: 0]
  ------------------
  805|      0|      cm->film_grain_params =
  806|      0|          film_grain_test_vectors[tune_cfg->film_grain_test_vector - 1];
  807|      0|      if (oxcf->tool_cfg.enable_monochrome)
  ------------------
  |  Branch (807:11): [True: 0, False: 0]
  ------------------
  808|      0|        reset_film_grain_chroma_params(&cm->film_grain_params);
  809|      0|      cm->film_grain_params.bit_depth = cm->seq_params->bit_depth;
  810|      0|      if (cm->seq_params->color_range == AOM_CR_FULL_RANGE) {
  ------------------
  |  Branch (810:11): [True: 0, False: 0]
  ------------------
  811|      0|        cm->film_grain_params.clip_to_restricted_range = 0;
  812|      0|      }
  813|      0|    }
  814|   155k|  } else if (tune_cfg->film_grain_table_filename) {
  ------------------
  |  Branch (814:14): [True: 0, False: 155k]
  ------------------
  815|      0|    CHECK_MEM_ERROR(cm, cpi->film_grain_table,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|      0|                    aom_calloc(1, sizeof(*cpi->film_grain_table)));
  817|       |
  818|      0|    aom_film_grain_table_read(cpi->film_grain_table,
  819|      0|                              tune_cfg->film_grain_table_filename, cm->error);
  820|   155k|  } else if (tune_cfg->content == AOM_CONTENT_FILM) {
  ------------------
  |  Branch (820:14): [True: 0, False: 155k]
  ------------------
  821|      0|    cm->film_grain_params.bit_depth = cm->seq_params->bit_depth;
  822|      0|    if (oxcf->tool_cfg.enable_monochrome)
  ------------------
  |  Branch (822:9): [True: 0, False: 0]
  ------------------
  823|      0|      reset_film_grain_chroma_params(&cm->film_grain_params);
  824|      0|    if (cm->seq_params->color_range == AOM_CR_FULL_RANGE)
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  ------------------
  825|      0|      cm->film_grain_params.clip_to_restricted_range = 0;
  826|   155k|  } else {
  827|   155k|    memset(&cm->film_grain_params, 0, sizeof(cm->film_grain_params));
  828|   155k|  }
  829|   155k|}
av1_scale_references:
  833|  55.2k|                          const int phase, const int use_optimized_scaler) {
  834|  55.2k|  AV1_COMMON *cm = &cpi->common;
  835|  55.2k|  const int num_planes = av1_num_planes(cm);
  836|  55.2k|  MV_REFERENCE_FRAME ref_frame;
  837|       |
  838|   441k|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (838:32): [True: 386k, False: 55.2k]
  ------------------
  839|       |    // Need to convert from AOM_REFFRAME to index into ref_mask (subtract 1).
  840|   386k|    if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
  ------------------
  |  Branch (840:9): [True: 55.2k, False: 331k]
  ------------------
  841|  55.2k|      BufferPool *const pool = cm->buffer_pool;
  842|  55.2k|      const YV12_BUFFER_CONFIG *const ref =
  843|  55.2k|          get_ref_frame_yv12_buf(cm, ref_frame);
  844|       |
  845|  55.2k|      if (ref == NULL) {
  ------------------
  |  Branch (845:11): [True: 0, False: 55.2k]
  ------------------
  846|      0|        cpi->scaled_ref_buf[ref_frame - 1] = NULL;
  847|      0|        continue;
  848|      0|      }
  849|       |
  850|       |      // For RTC-SVC: if force_zero_mode_spatial_ref is enabled, check if the
  851|       |      // motion search can be skipped for the references: last, golden,
  852|       |      // altref. If so, we can skip scaling that reference.
  853|  55.2k|      if (cpi->ppi->use_svc && cpi->svc.force_zero_mode_spatial_ref &&
  ------------------
  |  Branch (853:11): [True: 0, False: 55.2k]
  |  Branch (853:32): [True: 0, False: 0]
  ------------------
  854|      0|          cpi->ppi->rtc_ref.set_ref_frame_config) {
  ------------------
  |  Branch (854:11): [True: 0, False: 0]
  ------------------
  855|      0|        if (ref_frame == LAST_FRAME && cpi->svc.skip_mvsearch_last) continue;
  ------------------
  |  Branch (855:13): [True: 0, False: 0]
  |  Branch (855:40): [True: 0, False: 0]
  ------------------
  856|      0|        if (ref_frame == GOLDEN_FRAME && cpi->svc.skip_mvsearch_gf) continue;
  ------------------
  |  Branch (856:13): [True: 0, False: 0]
  |  Branch (856:42): [True: 0, False: 0]
  ------------------
  857|      0|        if (ref_frame == ALTREF_FRAME && cpi->svc.skip_mvsearch_altref)
  ------------------
  |  Branch (857:13): [True: 0, False: 0]
  |  Branch (857:42): [True: 0, False: 0]
  ------------------
  858|      0|          continue;
  859|      0|      }
  860|       |      // For RTC with superres on: golden reference only needs to be scaled
  861|       |      // if it was refreshed in previous frame.
  862|  55.2k|      if (is_one_pass_rt_params(cpi) &&
  ------------------
  |  Branch (862:11): [True: 18.3k, False: 36.9k]
  ------------------
  863|  18.3k|          cpi->oxcf.superres_cfg.enable_superres && ref_frame == GOLDEN_FRAME &&
  ------------------
  |  Branch (863:11): [True: 0, False: 18.3k]
  |  Branch (863:53): [True: 0, False: 0]
  ------------------
  864|      0|          cpi->rc.frame_num_last_gf_refresh <
  ------------------
  |  Branch (864:11): [True: 0, False: 0]
  ------------------
  865|      0|              (int)cm->current_frame.frame_number - 1) {
  866|      0|        continue;
  867|      0|      }
  868|       |
  869|  55.2k|      if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) {
  ------------------
  |  Branch (869:11): [True: 36.9k, False: 18.2k]
  |  Branch (869:45): [True: 7.98k, False: 10.2k]
  ------------------
  870|       |        // Replace the reference buffer with a copy having a thicker border,
  871|       |        // if the reference buffer is higher resolution than the current
  872|       |        // frame, and the border is thin.
  873|  44.9k|        if ((ref->y_crop_width > cm->width ||
  ------------------
  |  Branch (873:14): [True: 0, False: 44.9k]
  ------------------
  874|  44.9k|             ref->y_crop_height > cm->height) &&
  ------------------
  |  Branch (874:14): [True: 0, False: 44.9k]
  ------------------
  875|      0|            ref->border < AOM_BORDER_IN_PIXELS) {
  ------------------
  |  |   32|      0|#define AOM_BORDER_IN_PIXELS 288
  ------------------
  |  Branch (875:13): [True: 0, False: 0]
  ------------------
  876|      0|          RefCntBuffer *ref_fb = get_ref_frame_buf(cm, ref_frame);
  877|      0|          if (aom_yv12_realloc_with_new_border(
  ------------------
  |  |   67|      0|#define aom_yv12_realloc_with_new_border aom_yv12_realloc_with_new_border_c
  ------------------
  |  Branch (877:15): [True: 0, False: 0]
  ------------------
  878|      0|                  &ref_fb->buf, AOM_BORDER_IN_PIXELS,
  ------------------
  |  |   32|      0|#define AOM_BORDER_IN_PIXELS 288
  ------------------
  879|      0|                  cm->features.byte_alignment, cpi->alloc_pyramid,
  880|      0|                  num_planes) != 0) {
  881|      0|            aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  882|      0|                               "Failed to allocate frame buffer");
  883|      0|          }
  884|      0|        }
  885|  44.9k|        int force_scaling = 0;
  886|  44.9k|        RefCntBuffer *new_fb = cpi->scaled_ref_buf[ref_frame - 1];
  887|  44.9k|        if (new_fb == NULL) {
  ------------------
  |  Branch (887:13): [True: 44.9k, False: 0]
  ------------------
  888|  44.9k|          const int new_fb_idx = get_free_fb(cm);
  889|  44.9k|          if (new_fb_idx == INVALID_IDX) {
  ------------------
  |  |   15|  44.9k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  |  Branch (889:15): [True: 0, False: 44.9k]
  ------------------
  890|      0|            aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  891|      0|                               "Unable to find free frame buffer");
  892|      0|          }
  893|  44.9k|          force_scaling = 1;
  894|  44.9k|          new_fb = &pool->frame_bufs[new_fb_idx];
  895|  44.9k|        }
  896|       |
  897|  44.9k|        if (force_scaling || new_fb->buf.y_crop_width != cm->width ||
  ------------------
  |  Branch (897:13): [True: 44.9k, False: 0]
  |  Branch (897:30): [True: 0, False: 0]
  ------------------
  898|  44.9k|            new_fb->buf.y_crop_height != cm->height) {
  ------------------
  |  Branch (898:13): [True: 0, False: 0]
  ------------------
  899|  44.9k|          if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (899:15): [True: 0, False: 44.9k]
  ------------------
  900|  44.9k|                  &new_fb->buf, cm->width, cm->height,
  901|  44.9k|                  cm->seq_params->subsampling_x, cm->seq_params->subsampling_y,
  902|  44.9k|                  cm->seq_params->use_highbitdepth, AOM_BORDER_IN_PIXELS,
  ------------------
  |  |   32|  44.9k|#define AOM_BORDER_IN_PIXELS 288
  ------------------
  903|  44.9k|                  cm->features.byte_alignment, NULL, NULL, NULL, false, 0)) {
  904|      0|            if (force_scaling) {
  ------------------
  |  Branch (904:17): [True: 0, False: 0]
  ------------------
  905|       |              // Release the reference acquired in the get_free_fb() call
  906|       |              // above.
  907|      0|              --new_fb->ref_count;
  908|      0|            }
  909|      0|            aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  910|      0|                               "Failed to allocate frame buffer");
  911|      0|          }
  912|  44.9k|          bool has_optimized_scaler = av1_has_optimized_scaler(
  913|  44.9k|              ref->y_crop_width, ref->y_crop_height, new_fb->buf.y_crop_width,
  914|  44.9k|              new_fb->buf.y_crop_height);
  915|  44.9k|          if (num_planes > 1) {
  ------------------
  |  Branch (915:15): [True: 17.3k, False: 27.6k]
  ------------------
  916|  17.3k|            has_optimized_scaler =
  917|  17.3k|                has_optimized_scaler &&
  ------------------
  |  Branch (917:17): [True: 954, False: 16.3k]
  ------------------
  918|    954|                av1_has_optimized_scaler(
  ------------------
  |  Branch (918:17): [True: 766, False: 188]
  ------------------
  919|    954|                    ref->uv_crop_width, ref->uv_crop_height,
  920|    954|                    new_fb->buf.uv_crop_width, new_fb->buf.uv_crop_height);
  921|  17.3k|          }
  922|  44.9k|#if CONFIG_AV1_HIGHBITDEPTH
  923|  44.9k|          if (use_optimized_scaler && has_optimized_scaler &&
  ------------------
  |  Branch (923:15): [True: 44.9k, False: 0]
  |  Branch (923:39): [True: 2.32k, False: 42.6k]
  ------------------
  924|  2.32k|              cm->seq_params->bit_depth == AOM_BITS_8) {
  ------------------
  |  Branch (924:15): [True: 1.67k, False: 650]
  ------------------
  925|  1.67k|            av1_resize_and_extend_frame(ref, &new_fb->buf, filter, phase,
  926|  1.67k|                                        num_planes);
  927|  43.3k|          } else if (!av1_resize_and_extend_frame_nonnormative(
  ------------------
  |  Branch (927:22): [True: 0, False: 43.3k]
  ------------------
  928|  43.3k|                         ref, &new_fb->buf, (int)cm->seq_params->bit_depth,
  929|  43.3k|                         num_planes)) {
  930|      0|            aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  931|      0|                               "Failed to allocate buffer during resize");
  932|      0|          }
  933|       |#else
  934|       |          if (use_optimized_scaler && has_optimized_scaler) {
  935|       |            av1_resize_and_extend_frame(ref, &new_fb->buf, filter, phase,
  936|       |                                        num_planes);
  937|       |          } else if (!av1_resize_and_extend_frame_nonnormative(
  938|       |                         ref, &new_fb->buf, (int)cm->seq_params->bit_depth,
  939|       |                         num_planes)) {
  940|       |            aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  941|       |                               "Failed to allocate buffer during resize");
  942|       |          }
  943|       |#endif
  944|  44.9k|          cpi->scaled_ref_buf[ref_frame - 1] = new_fb;
  945|  44.9k|          alloc_frame_mvs(cm, new_fb);
  946|  44.9k|        }
  947|  44.9k|      } else {
  948|  10.2k|        RefCntBuffer *buf = get_ref_frame_buf(cm, ref_frame);
  949|  10.2k|        buf->buf.y_crop_width = ref->y_crop_width;
  950|  10.2k|        buf->buf.y_crop_height = ref->y_crop_height;
  951|  10.2k|        cpi->scaled_ref_buf[ref_frame - 1] = buf;
  952|  10.2k|        ++buf->ref_count;
  953|  10.2k|      }
  954|   331k|    } else {
  955|   331k|      if (!has_no_stats_stage(cpi)) cpi->scaled_ref_buf[ref_frame - 1] = NULL;
  ------------------
  |  Branch (955:11): [True: 0, False: 331k]
  ------------------
  956|   331k|    }
  957|   386k|  }
  958|  55.2k|}
av1_select_sb_size:
  961|   366k|                              int height, int number_spatial_layers) {
  962|   366k|  if (oxcf->tool_cfg.superblock_size == AOM_SUPERBLOCK_SIZE_64X64) {
  ------------------
  |  Branch (962:7): [True: 0, False: 366k]
  ------------------
  963|      0|    return BLOCK_64X64;
  964|      0|  }
  965|   366k|  if (oxcf->tool_cfg.superblock_size == AOM_SUPERBLOCK_SIZE_128X128) {
  ------------------
  |  Branch (965:7): [True: 0, False: 366k]
  ------------------
  966|      0|    return BLOCK_128X128;
  967|      0|  }
  968|       |#if CONFIG_TFLITE
  969|       |  if (oxcf->q_cfg.deltaq_mode == DELTA_Q_USER_RATING_BASED) return BLOCK_64X64;
  970|       |#endif
  971|       |  // Force 64x64 superblock size to increase resolution in perceptual
  972|       |  // AQ and user rating based modes.
  973|   366k|  if (oxcf->mode == ALLINTRA &&
  ------------------
  |  Branch (973:7): [True: 0, False: 366k]
  ------------------
  974|      0|      (oxcf->q_cfg.deltaq_mode == DELTA_Q_PERCEPTUAL_AI ||
  ------------------
  |  Branch (974:8): [True: 0, False: 0]
  ------------------
  975|      0|       oxcf->q_cfg.deltaq_mode == DELTA_Q_USER_RATING_BASED)) {
  ------------------
  |  Branch (975:8): [True: 0, False: 0]
  ------------------
  976|      0|    return BLOCK_64X64;
  977|      0|  }
  978|       |  // Variance Boost only supports 64x64 superblocks.
  979|   366k|  if (oxcf->q_cfg.deltaq_mode == DELTA_Q_VARIANCE_BOOST) {
  ------------------
  |  Branch (979:7): [True: 95.5k, False: 271k]
  ------------------
  980|  95.5k|    return BLOCK_64X64;
  981|  95.5k|  }
  982|   366k|  assert(oxcf->tool_cfg.superblock_size == AOM_SUPERBLOCK_SIZE_DYNAMIC);
  983|       |
  984|   271k|  if (number_spatial_layers > 1) {
  ------------------
  |  Branch (984:7): [True: 147k, False: 123k]
  ------------------
  985|       |    // For spatial layers better selection may be done given the resolutions
  986|       |    // used across the layers, but for now use 64x64 for spatial layers.
  987|   147k|    return BLOCK_64X64;
  988|   147k|  } else if (oxcf->resize_cfg.resize_mode != RESIZE_NONE) {
  ------------------
  |  Branch (988:14): [True: 0, False: 123k]
  ------------------
  989|       |    // Use the configured size (top resolution) for resize.
  990|      0|    return AOMMIN(oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height) > 720
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (990:12): [True: 0, False: 0]
  ------------------
  991|      0|               ? BLOCK_128X128
  992|      0|               : BLOCK_64X64;
  993|   123k|  } else if (oxcf->mode == REALTIME) {
  ------------------
  |  Branch (993:14): [True: 32.8k, False: 90.8k]
  ------------------
  994|  32.8k|    if (oxcf->tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (994:9): [True: 0, False: 32.8k]
  ------------------
  995|      0|      const TileConfig *const tile_cfg = &oxcf->tile_cfg;
  996|      0|      const int num_tiles =
  997|      0|          (1 << tile_cfg->tile_columns) * (1 << tile_cfg->tile_rows);
  998|       |      // For multi-thread encode: if the number of (128x128) superblocks
  999|       |      // per tile is low use 64X64 superblock.
 1000|      0|      if (oxcf->row_mt == 1 && oxcf->max_threads >= 4 &&
  ------------------
  |  Branch (1000:11): [True: 0, False: 0]
  |  Branch (1000:32): [True: 0, False: 0]
  ------------------
 1001|      0|          oxcf->max_threads >= num_tiles && AOMMIN(width, height) >= 720 &&
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1001:11): [True: 0, False: 0]
  |  Branch (1001:45): [True: 0, False: 0]
  ------------------
 1002|      0|          (width * height) / (128 * 128 * num_tiles) < 40)
  ------------------
  |  Branch (1002:11): [True: 0, False: 0]
  ------------------
 1003|      0|        return BLOCK_64X64;
 1004|      0|      else
 1005|      0|        return AOMMIN(width, height) >= 720 ? BLOCK_128X128 : BLOCK_64X64;
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1005:16): [True: 0, False: 0]
  ------------------
 1006|  32.8k|    } else {
 1007|  32.8k|      return AOMMIN(width, height) > 720 ? BLOCK_128X128 : BLOCK_64X64;
  ------------------
  |  |   34|  32.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.9k, False: 19.9k]
  |  |  ------------------
  ------------------
  |  Branch (1007:14): [True: 0, False: 32.8k]
  ------------------
 1008|  32.8k|    }
 1009|  32.8k|  }
 1010|       |
 1011|       |  // TODO(any): Possibly could improve this with a heuristic.
 1012|       |  // When superres / resize is on, 'cm->width / height' can change between
 1013|       |  // calls, so we don't apply this heuristic there.
 1014|       |  // Things break if superblock size changes between the first pass and second
 1015|       |  // pass encoding, which is why this heuristic is not configured as a
 1016|       |  // speed-feature.
 1017|  90.8k|  if (oxcf->superres_cfg.superres_mode == AOM_SUPERRES_NONE &&
  ------------------
  |  Branch (1017:7): [True: 90.8k, False: 0]
  ------------------
 1018|  90.8k|      oxcf->resize_cfg.resize_mode == RESIZE_NONE) {
  ------------------
  |  Branch (1018:7): [True: 90.8k, False: 0]
  ------------------
 1019|  90.8k|    int is_480p_or_lesser = AOMMIN(width, height) <= 480;
  ------------------
  |  |   34|  90.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 38.8k, False: 52.0k]
  |  |  ------------------
  ------------------
 1020|  90.8k|    if (oxcf->speed >= 1 && is_480p_or_lesser) return BLOCK_64X64;
  ------------------
  |  Branch (1020:9): [True: 0, False: 90.8k]
  |  Branch (1020:29): [True: 0, False: 0]
  ------------------
 1021|       |
 1022|       |    // For 1080p and lower resolutions, choose SB size adaptively based on
 1023|       |    // resolution and speed level for multi-thread encode.
 1024|  90.8k|    int is_1080p_or_lesser = AOMMIN(width, height) <= 1080;
  ------------------
  |  |   34|  90.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 38.8k, False: 52.0k]
  |  |  ------------------
  ------------------
 1025|  90.8k|    if (!is_480p_or_lesser && is_1080p_or_lesser && oxcf->mode == GOOD &&
  ------------------
  |  Branch (1025:9): [True: 0, False: 90.8k]
  |  Branch (1025:31): [True: 0, False: 0]
  |  Branch (1025:53): [True: 0, False: 0]
  ------------------
 1026|      0|        oxcf->row_mt == 1 && oxcf->max_threads > 1 && oxcf->speed >= 5)
  ------------------
  |  Branch (1026:9): [True: 0, False: 0]
  |  Branch (1026:30): [True: 0, False: 0]
  |  Branch (1026:55): [True: 0, False: 0]
  ------------------
 1027|      0|      return BLOCK_64X64;
 1028|       |
 1029|       |    // For allintra encode, since the maximum partition size is set to 32X32
 1030|       |    // for speed>=6, superblock size is set to 64X64 instead of 128X128. This
 1031|       |    // improves the multithread performance due to reduction in top right
 1032|       |    // delay and thread sync wastage. Currently, this setting is selectively
 1033|       |    // enabled only for speed>=9 and resolutions less than 4k since cost
 1034|       |    // update frequency is set to INTERNAL_COST_UPD_OFF in these cases.
 1035|  90.8k|    const int is_4k_or_larger = AOMMIN(width, height) >= 2160;
  ------------------
  |  |   34|  90.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 38.8k, False: 52.0k]
  |  |  ------------------
  ------------------
 1036|  90.8k|    if (oxcf->mode == ALLINTRA && oxcf->speed >= 9 && !is_4k_or_larger)
  ------------------
  |  Branch (1036:9): [True: 0, False: 90.8k]
  |  Branch (1036:35): [True: 0, False: 0]
  |  Branch (1036:55): [True: 0, False: 0]
  ------------------
 1037|      0|      return BLOCK_64X64;
 1038|  90.8k|  }
 1039|  90.8k|  return BLOCK_128X128;
 1040|  90.8k|}
av1_setup_frame:
 1042|  73.6k|void av1_setup_frame(AV1_COMP *cpi) {
 1043|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 1044|       |  // Set up entropy context depending on frame type. The decoder mandates
 1045|       |  // the use of the default context, index 0, for keyframes and inter
 1046|       |  // frames where the error_resilient_mode or intra_only flag is set. For
 1047|       |  // other inter-frames the encoder currently uses only two contexts;
 1048|       |  // context 1 for ALTREF frames and context 0 for the others.
 1049|       |
 1050|  73.6k|  if (frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
  ------------------
  |  Branch (1050:7): [True: 18.4k, False: 55.2k]
  |  Branch (1050:34): [True: 0, False: 55.2k]
  ------------------
 1051|  55.2k|      cpi->ext_flags.use_primary_ref_none) {
  ------------------
  |  Branch (1051:7): [True: 0, False: 55.2k]
  ------------------
 1052|  18.4k|    av1_setup_past_independence(cm);
 1053|  18.4k|  }
 1054|       |
 1055|  73.6k|  if ((cm->current_frame.frame_type == KEY_FRAME && cm->show_frame) ||
  ------------------
  |  Branch (1055:8): [True: 18.4k, False: 55.2k]
  |  Branch (1055:53): [True: 18.4k, False: 0]
  ------------------
 1056|  55.2k|      frame_is_sframe(cm)) {
  ------------------
  |  Branch (1056:7): [True: 0, False: 55.2k]
  ------------------
 1057|  18.4k|    if (!cpi->ppi->seq_params_locked) {
  ------------------
  |  Branch (1057:9): [True: 18.4k, False: 0]
  ------------------
 1058|  18.4k|      set_sb_size(cm->seq_params,
 1059|  18.4k|                  av1_select_sb_size(&cpi->oxcf, cm->width, cm->height,
 1060|  18.4k|                                     cpi->ppi->number_spatial_layers));
 1061|  18.4k|    }
 1062|  55.2k|  } else {
 1063|  55.2k|    const RefCntBuffer *const primary_ref_buf = get_primary_ref_frame_buf(cm);
 1064|  55.2k|    if (primary_ref_buf == NULL) {
  ------------------
  |  Branch (1064:9): [True: 24.6k, False: 30.6k]
  ------------------
 1065|  24.6k|      av1_setup_past_independence(cm);
 1066|  24.6k|      cm->seg.update_map = 1;
 1067|  24.6k|      cm->seg.update_data = 1;
 1068|  30.6k|    } else {
 1069|  30.6k|      *cm->fc = primary_ref_buf->frame_context;
 1070|  30.6k|    }
 1071|  55.2k|  }
 1072|       |
 1073|  73.6k|  av1_zero(cm->cur_frame->interp_filter_selected);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1074|  73.6k|  cm->prev_frame = get_primary_ref_frame_buf(cm);
 1075|  73.6k|  cpi->vaq_refresh = 0;
 1076|  73.6k|}
av1_finalize_encoded_frame:
 1325|  73.6k|void av1_finalize_encoded_frame(AV1_COMP *const cpi) {
 1326|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 1327|  73.6k|  CurrentFrame *const current_frame = &cm->current_frame;
 1328|       |
 1329|  73.6k|  if (!cm->seq_params->reduced_still_picture_hdr &&
  ------------------
  |  Branch (1329:7): [True: 73.6k, False: 0]
  ------------------
 1330|  73.6k|      encode_show_existing_frame(cm)) {
  ------------------
  |  Branch (1330:7): [True: 0, False: 73.6k]
  ------------------
 1331|      0|    assert(cpi->existing_fb_idx_to_show >= 0 &&
 1332|      0|           cpi->existing_fb_idx_to_show < REF_FRAMES);
 1333|      0|    RefCntBuffer *const frame_to_show =
 1334|      0|        cm->ref_frame_map[cpi->existing_fb_idx_to_show];
 1335|       |
 1336|      0|    if (frame_to_show == NULL) {
  ------------------
  |  Branch (1336:9): [True: 0, False: 0]
  ------------------
 1337|      0|      aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM,
 1338|      0|                         "Buffer does not contain a reconstructed frame");
 1339|      0|    }
 1340|      0|    assert(frame_to_show->ref_count > 0);
 1341|      0|    assign_frame_buffer_p(&cm->cur_frame, frame_to_show);
 1342|      0|  }
 1343|       |
 1344|  73.6k|  if (!encode_show_existing_frame(cm) &&
  ------------------
  |  Branch (1344:7): [True: 73.6k, False: 0]
  ------------------
 1345|  73.6k|      cm->seq_params->film_grain_params_present &&
  ------------------
  |  Branch (1345:7): [True: 0, False: 73.6k]
  ------------------
 1346|      0|      (cm->show_frame || cm->showable_frame)) {
  ------------------
  |  Branch (1346:8): [True: 0, False: 0]
  |  Branch (1346:26): [True: 0, False: 0]
  ------------------
 1347|       |    // Copy the current frame's film grain params to the its corresponding
 1348|       |    // RefCntBuffer slot.
 1349|      0|    cm->cur_frame->film_grain_params = cm->film_grain_params;
 1350|       |
 1351|       |    // We must update the parameters if this is not an INTER_FRAME
 1352|      0|    if (current_frame->frame_type != INTER_FRAME)
  ------------------
  |  Branch (1352:9): [True: 0, False: 0]
  ------------------
 1353|      0|      cm->cur_frame->film_grain_params.update_parameters = 1;
 1354|       |
 1355|       |    // Iterate the random seed for the next frame.
 1356|      0|    cm->film_grain_params.random_seed += 3381;
 1357|      0|    if (cm->film_grain_params.random_seed == 0)
  ------------------
  |  Branch (1357:9): [True: 0, False: 0]
  ------------------
 1358|      0|      cm->film_grain_params.random_seed = 7391;
 1359|      0|  }
 1360|       |
 1361|       |  // Initialise all tiles' contexts from the global frame context
 1362|   163k|  for (int tile_col = 0; tile_col < cm->tiles.cols; tile_col++) {
  ------------------
  |  Branch (1362:26): [True: 90.3k, False: 73.6k]
  ------------------
 1363|   207k|    for (int tile_row = 0; tile_row < cm->tiles.rows; tile_row++) {
  ------------------
  |  Branch (1363:28): [True: 117k, False: 90.3k]
  ------------------
 1364|   117k|      const int tile_idx = tile_row * cm->tiles.cols + tile_col;
 1365|   117k|      cpi->tile_data[tile_idx].tctx = *cm->fc;
 1366|   117k|    }
 1367|  90.3k|  }
 1368|       |
 1369|  73.6k|  if (!frame_is_intra_only(cm))
  ------------------
  |  Branch (1369:7): [True: 55.2k, False: 18.4k]
  ------------------
 1370|  55.2k|    fix_interp_filter(&cm->features.interp_filter, cpi->td.counts);
 1371|  73.6k|}
av1_is_integer_mv:
 1375|  5.94k|                      ForceIntegerMVInfo *const force_intpel_info) {
 1376|       |  // check use hash ME
 1377|  5.94k|  int k;
 1378|       |
 1379|  5.94k|  const int block_size = FORCE_INT_MV_DECISION_BLOCK_SIZE;
  ------------------
  |  |   26|  5.94k|#define FORCE_INT_MV_DECISION_BLOCK_SIZE 8
  ------------------
 1380|  5.94k|  const double threshold_current = 0.8;
 1381|  5.94k|  const double threshold_average = 0.95;
 1382|  5.94k|  const int max_history_size = 32;
 1383|  5.94k|  int T = 0;  // total block
 1384|  5.94k|  int C = 0;  // match with collocated block
 1385|  5.94k|  int S = 0;  // smooth region but not match with collocated block
 1386|       |
 1387|  5.94k|  const int pic_width = cur_picture->y_width;
 1388|  5.94k|  const int pic_height = cur_picture->y_height;
 1389|  41.4k|  for (int i = 0; i + block_size <= pic_height; i += block_size) {
  ------------------
  |  Branch (1389:19): [True: 35.5k, False: 5.94k]
  ------------------
 1390|   169k|    for (int j = 0; j + block_size <= pic_width; j += block_size) {
  ------------------
  |  Branch (1390:21): [True: 134k, False: 35.5k]
  ------------------
 1391|   134k|      const int x_pos = j;
 1392|   134k|      const int y_pos = i;
 1393|   134k|      int match = 1;
 1394|   134k|      T++;
 1395|       |
 1396|       |      // check whether collocated block match with current
 1397|   134k|      uint8_t *p_cur = cur_picture->y_buffer;
 1398|   134k|      uint8_t *p_ref = last_picture->y_buffer;
 1399|   134k|      int stride_cur = cur_picture->y_stride;
 1400|   134k|      int stride_ref = last_picture->y_stride;
 1401|   134k|      p_cur += (y_pos * stride_cur + x_pos);
 1402|   134k|      p_ref += (y_pos * stride_ref + x_pos);
 1403|       |
 1404|   134k|      if (cur_picture->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   134k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (1404:11): [True: 134k, False: 0]
  ------------------
 1405|   134k|        uint16_t *p16_cur = CONVERT_TO_SHORTPTR(p_cur);
  ------------------
  |  |   79|   134k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1406|   134k|        uint16_t *p16_ref = CONVERT_TO_SHORTPTR(p_ref);
  ------------------
  |  |   79|   134k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1407|   272k|        for (int tmpY = 0; tmpY < block_size && match; tmpY++) {
  ------------------
  |  Branch (1407:28): [True: 272k, False: 155]
  |  Branch (1407:49): [True: 138k, False: 134k]
  ------------------
 1408|   331k|          for (int tmpX = 0; tmpX < block_size && match; tmpX++) {
  ------------------
  |  Branch (1408:30): [True: 327k, False: 4.14k]
  |  Branch (1408:51): [True: 193k, False: 134k]
  ------------------
 1409|   193k|            if (p16_cur[tmpX] != p16_ref[tmpX]) {
  ------------------
  |  Branch (1409:17): [True: 134k, False: 59.6k]
  ------------------
 1410|   134k|              match = 0;
 1411|   134k|            }
 1412|   193k|          }
 1413|   138k|          p16_cur += stride_cur;
 1414|   138k|          p16_ref += stride_ref;
 1415|   138k|        }
 1416|   134k|      } else {
 1417|      0|        for (int tmpY = 0; tmpY < block_size && match; tmpY++) {
  ------------------
  |  Branch (1417:28): [True: 0, False: 0]
  |  Branch (1417:49): [True: 0, False: 0]
  ------------------
 1418|      0|          for (int tmpX = 0; tmpX < block_size && match; tmpX++) {
  ------------------
  |  Branch (1418:30): [True: 0, False: 0]
  |  Branch (1418:51): [True: 0, False: 0]
  ------------------
 1419|      0|            if (p_cur[tmpX] != p_ref[tmpX]) {
  ------------------
  |  Branch (1419:17): [True: 0, False: 0]
  ------------------
 1420|      0|              match = 0;
 1421|      0|            }
 1422|      0|          }
 1423|      0|          p_cur += stride_cur;
 1424|      0|          p_ref += stride_ref;
 1425|      0|        }
 1426|      0|      }
 1427|       |
 1428|   134k|      if (match) {
  ------------------
  |  Branch (1428:11): [True: 155, False: 134k]
  ------------------
 1429|    155|        C++;
 1430|    155|        continue;
 1431|    155|      }
 1432|       |
 1433|   134k|      if (av1_hash_is_horizontal_perfect(cur_picture, block_size, x_pos,
  ------------------
  |  Branch (1433:11): [True: 13.0k, False: 121k]
  ------------------
 1434|   134k|                                         y_pos) ||
 1435|   121k|          av1_hash_is_vertical_perfect(cur_picture, block_size, x_pos, y_pos)) {
  ------------------
  |  Branch (1435:11): [True: 8.42k, False: 112k]
  ------------------
 1436|  21.4k|        S++;
 1437|  21.4k|        continue;
 1438|  21.4k|      }
 1439|   134k|    }
 1440|  35.5k|  }
 1441|       |
 1442|  5.94k|  assert(T > 0);
 1443|  5.94k|  double cs_rate = ((double)(C + S)) / ((double)(T));
 1444|       |
 1445|  5.94k|  force_intpel_info->cs_rate_array[force_intpel_info->rate_index] = cs_rate;
 1446|       |
 1447|  5.94k|  force_intpel_info->rate_index =
 1448|  5.94k|      (force_intpel_info->rate_index + 1) % max_history_size;
 1449|  5.94k|  force_intpel_info->rate_size++;
 1450|  5.94k|  force_intpel_info->rate_size =
 1451|  5.94k|      AOMMIN(force_intpel_info->rate_size, max_history_size);
  ------------------
  |  |   34|  5.94k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.94k, False: 0]
  |  |  ------------------
  ------------------
 1452|       |
 1453|  5.94k|  if (cs_rate < threshold_current) {
  ------------------
  |  Branch (1453:7): [True: 5.94k, False: 0]
  ------------------
 1454|  5.94k|    return 0;
 1455|  5.94k|  }
 1456|       |
 1457|      0|  if (C == T) {
  ------------------
  |  Branch (1457:7): [True: 0, False: 0]
  ------------------
 1458|      0|    return 1;
 1459|      0|  }
 1460|       |
 1461|      0|  double cs_average = 0.0;
 1462|       |
 1463|      0|  for (k = 0; k < force_intpel_info->rate_size; k++) {
  ------------------
  |  Branch (1463:15): [True: 0, False: 0]
  ------------------
 1464|      0|    cs_average += force_intpel_info->cs_rate_array[k];
 1465|      0|  }
 1466|      0|  cs_average /= force_intpel_info->rate_size;
 1467|       |
 1468|      0|  if (cs_average < threshold_average) {
  ------------------
  |  Branch (1468:7): [True: 0, False: 0]
  ------------------
 1469|      0|    return 0;
 1470|      0|  }
 1471|       |
 1472|      0|  if ((T - C - S) < 0) {
  ------------------
  |  Branch (1472:7): [True: 0, False: 0]
  ------------------
 1473|      0|    return 1;
 1474|      0|  }
 1475|       |
 1476|      0|  if (cs_average > 1.01) {
  ------------------
  |  Branch (1476:7): [True: 0, False: 0]
  ------------------
 1477|      0|    return 1;
 1478|      0|  }
 1479|       |
 1480|      0|  return 0;
 1481|      0|}
av1_set_mb_ssim_rdmult_scaling:
 1483|  52.3k|void av1_set_mb_ssim_rdmult_scaling(AV1_COMP *cpi) {
 1484|  52.3k|  const CommonModeInfoParams *const mi_params = &cpi->common.mi_params;
 1485|  52.3k|  const MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 1486|  52.3k|  uint8_t *y_buffer = cpi->source->y_buffer;
 1487|  52.3k|  const int y_stride = cpi->source->y_stride;
 1488|  52.3k|  const int block_size = BLOCK_16X16;
 1489|       |
 1490|  52.3k|  const int num_mi_w = mi_size_wide[block_size];
 1491|  52.3k|  const int num_mi_h = mi_size_high[block_size];
 1492|  52.3k|  const int num_cols = (mi_params->mi_cols + num_mi_w - 1) / num_mi_w;
 1493|  52.3k|  const int num_rows = (mi_params->mi_rows + num_mi_h - 1) / num_mi_h;
 1494|  52.3k|  double log_sum = 0.0;
 1495|       |
 1496|       |  // Loop through each 16x16 block.
 1497|   194k|  for (int row = 0; row < num_rows; ++row) {
  ------------------
  |  Branch (1497:21): [True: 142k, False: 52.3k]
  ------------------
 1498|   686k|    for (int col = 0; col < num_cols; ++col) {
  ------------------
  |  Branch (1498:23): [True: 544k, False: 142k]
  ------------------
 1499|   544k|      double var = 0.0, num_of_var = 0.0;
 1500|   544k|      const int index = row * num_cols + col;
 1501|       |
 1502|       |      // Loop through each 8x8 block.
 1503|   544k|      for (int mi_row = row * num_mi_h;
 1504|  1.55M|           mi_row < mi_params->mi_rows && mi_row < (row + 1) * num_mi_h;
  ------------------
  |  Branch (1504:12): [True: 1.40M, False: 144k]
  |  Branch (1504:43): [True: 1.01M, False: 399k]
  ------------------
 1505|  1.01M|           mi_row += 2) {
 1506|  1.01M|        for (int mi_col = col * num_mi_w;
 1507|  2.88M|             mi_col < mi_params->mi_cols && mi_col < (col + 1) * num_mi_w;
  ------------------
  |  Branch (1507:14): [True: 2.63M, False: 254k]
  |  Branch (1507:45): [True: 1.87M, False: 756k]
  ------------------
 1508|  1.87M|             mi_col += 2) {
 1509|  1.87M|          struct buf_2d buf;
 1510|  1.87M|          const int row_offset_y = mi_row << 2;
 1511|  1.87M|          const int col_offset_y = mi_col << 2;
 1512|       |
 1513|  1.87M|          buf.buf = y_buffer + row_offset_y * y_stride + col_offset_y;
 1514|  1.87M|          buf.stride = y_stride;
 1515|       |
 1516|  1.87M|          var += av1_get_perpixel_variance_facade(cpi, xd, &buf, BLOCK_8X8,
 1517|  1.87M|                                                  AOM_PLANE_Y);
  ------------------
  |  |  281|  1.87M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1518|  1.87M|          num_of_var += 1.0;
 1519|  1.87M|        }
 1520|  1.01M|      }
 1521|   544k|      var = var / num_of_var;
 1522|       |
 1523|       |      // Curve fitting with an exponential model on all 16x16 blocks from the
 1524|       |      // midres dataset.
 1525|   544k|      var = 67.035434 * (1 - exp(-0.0021489 * var)) + 17.492222;
 1526|       |
 1527|       |      // As per the above computation, var will be in the range of
 1528|       |      // [17.492222, 84.527656], assuming the data type is of infinite
 1529|       |      // precision. The following assert conservatively checks if var is in
 1530|       |      // the range of [17.0, 85.0] to avoid any issues due to the precision of
 1531|       |      // the relevant data type.
 1532|   544k|      assert(var > 17.0 && var < 85.0);
 1533|   544k|      cpi->ssim_rdmult_scaling_factors[index] = var;
 1534|   544k|      log_sum += log(var);
 1535|   544k|    }
 1536|   142k|  }
 1537|       |
 1538|       |  // As log_sum holds the geometric mean, it will be in the range
 1539|       |  // [17.492222, 84.527656]. Hence, in the below loop, the value of
 1540|       |  // cpi->ssim_rdmult_scaling_factors[index] would be in the range
 1541|       |  // [0.2069, 4.8323].
 1542|  52.3k|  log_sum = exp(log_sum / (double)(num_rows * num_cols));
 1543|       |
 1544|   194k|  for (int row = 0; row < num_rows; ++row) {
  ------------------
  |  Branch (1544:21): [True: 142k, False: 52.3k]
  ------------------
 1545|   686k|    for (int col = 0; col < num_cols; ++col) {
  ------------------
  |  Branch (1545:23): [True: 544k, False: 142k]
  ------------------
 1546|   544k|      const int index = row * num_cols + col;
 1547|   544k|      cpi->ssim_rdmult_scaling_factors[index] /= log_sum;
 1548|   544k|    }
 1549|   142k|  }
 1550|  52.3k|}
encoder_utils.c:fix_interp_filter:
 1303|  55.2k|                              const FRAME_COUNTS *const counts) {
 1304|  55.2k|  if (*interp_filter == SWITCHABLE) {
  ------------------
  |  Branch (1304:7): [True: 55.2k, False: 0]
  ------------------
 1305|       |    // Check to see if only one of the filters is actually used
 1306|  55.2k|    int count[SWITCHABLE_FILTERS] = { 0 };
 1307|  55.2k|    int num_filters_used = 0;
 1308|   220k|    for (int i = 0; i < SWITCHABLE_FILTERS; ++i) {
  ------------------
  |  Branch (1308:21): [True: 165k, False: 55.2k]
  ------------------
 1309|  2.81M|      for (int j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
  ------------------
  |  |  101|  2.81M|#define SWITCHABLE_FILTER_CONTEXTS ((SWITCHABLE_FILTERS + 1) * 4)
  ------------------
  |  Branch (1309:23): [True: 2.65M, False: 165k]
  ------------------
 1310|  2.65M|        count[i] += counts->switchable_interp[j][i];
 1311|   165k|      num_filters_used += (count[i] > 0);
 1312|   165k|    }
 1313|  55.2k|    if (num_filters_used == 1) {
  ------------------
  |  Branch (1313:9): [True: 25.8k, False: 29.3k]
  ------------------
 1314|       |      // Only one filter is used. So set the filter at frame level
 1315|  28.5k|      for (int i = 0; i < SWITCHABLE_FILTERS; ++i) {
  ------------------
  |  Branch (1315:23): [True: 28.5k, False: 0]
  ------------------
 1316|  28.5k|        if (count[i]) {
  ------------------
  |  Branch (1316:13): [True: 25.8k, False: 2.67k]
  ------------------
 1317|  25.8k|          *interp_filter = i;
 1318|  25.8k|          break;
 1319|  25.8k|        }
 1320|  28.5k|      }
 1321|  25.8k|    }
 1322|  55.2k|  }
 1323|  55.2k|}

av1_cx_iface.c:av1_get_enc_border_size:
 1052|   174k|                                          BLOCK_SIZE sb_size) {
 1053|       |  // For allintra encoding mode, inter-frame motion search is not applicable and
 1054|       |  // the intraBC motion vectors are restricted within the tile boundaries. Hence
 1055|       |  // a smaller frame border size (AOM_ENC_ALLINTRA_BORDER) is used in this case.
 1056|   174k|  if (resize) {
  ------------------
  |  Branch (1056:7): [True: 0, False: 174k]
  ------------------
 1057|      0|    return AOM_BORDER_IN_PIXELS;
  ------------------
  |  |   32|      0|#define AOM_BORDER_IN_PIXELS 288
  ------------------
 1058|      0|  }
 1059|   174k|  if (all_intra) {
  ------------------
  |  Branch (1059:7): [True: 0, False: 174k]
  ------------------
 1060|      0|    return AOM_ENC_ALLINTRA_BORDER;
  ------------------
  |  |   34|      0|#define AOM_ENC_ALLINTRA_BORDER 64
  ------------------
 1061|      0|  }
 1062|   174k|  return block_size_wide[sb_size] + 32;
 1063|   174k|}
av1_cx_iface.c:av1_is_resize_needed:
 1065|   180k|static inline bool av1_is_resize_needed(const AV1EncoderConfig *oxcf) {
 1066|   180k|  const ResizeCfg *resize_cfg = &oxcf->resize_cfg;
 1067|   180k|  const SuperResCfg *superres_cfg = &oxcf->superres_cfg;
 1068|   180k|  return resize_cfg->resize_mode || superres_cfg->superres_mode;
  ------------------
  |  Branch (1068:10): [True: 0, False: 180k]
  |  Branch (1068:37): [True: 0, False: 180k]
  ------------------
 1069|   180k|}
encoder.c:highbd_set_var_fns:
  514|   174k|static inline void highbd_set_var_fns(AV1_PRIMARY *const ppi) {
  515|   174k|  SequenceHeader *const seq_params = &ppi->seq_params;
  516|   174k|  if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (516:7): [True: 50.9k, False: 123k]
  ------------------
  517|  50.9k|    switch (seq_params->bit_depth) {
  518|      0|      case AOM_BITS_8:
  ------------------
  |  Branch (518:7): [True: 0, False: 50.9k]
  ------------------
  519|      0|#if !CONFIG_REALTIME_ONLY
  520|      0|        HIGHBD_BFP_WRAPPER(64, 16, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  521|      0|        HIGHBD_BFP_WRAPPER(16, 64, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  522|      0|        HIGHBD_BFP_WRAPPER(32, 8, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  523|      0|        HIGHBD_BFP_WRAPPER(8, 32, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  524|      0|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(16, 4, 8)
  ------------------
  |  |  150|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  525|      0|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 16, 8)
  ------------------
  |  |  150|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  526|      0|#endif
  527|      0|        HIGHBD_BFP_WRAPPER(32, 16, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  528|      0|        HIGHBD_BFP_WRAPPER(16, 32, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  529|      0|        HIGHBD_BFP_WRAPPER(64, 32, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  530|      0|        HIGHBD_BFP_WRAPPER(32, 64, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  531|      0|        HIGHBD_BFP_WRAPPER(32, 32, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  532|      0|        HIGHBD_BFP_WRAPPER(64, 64, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  533|      0|        HIGHBD_BFP_WRAPPER(16, 16, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  534|      0|        HIGHBD_BFP_WRAPPER(16, 8, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  535|      0|        HIGHBD_BFP_WRAPPER(8, 16, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  536|      0|        HIGHBD_BFP_WRAPPER(8, 8, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  537|      0|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(8, 4, 8)
  ------------------
  |  |  150|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  538|      0|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 8, 8)
  ------------------
  |  |  150|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  539|      0|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 4, 8)
  ------------------
  |  |  150|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  540|      0|        HIGHBD_BFP_WRAPPER(128, 128, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  541|      0|        HIGHBD_BFP_WRAPPER(128, 64, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  542|      0|        HIGHBD_BFP_WRAPPER(64, 128, 8)
  ------------------
  |  |  140|      0|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|      0|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|      0|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|      0|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|      0|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|      0|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|      0|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|      0|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|      0|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|      0|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|      0|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|      0|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  543|       |
  544|      0|        HIGHBD_MBFP_WRAPPER(128, 128, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  545|      0|        HIGHBD_MBFP_WRAPPER(128, 64, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  546|      0|        HIGHBD_MBFP_WRAPPER(64, 128, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  547|      0|        HIGHBD_MBFP_WRAPPER(64, 64, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  548|      0|        HIGHBD_MBFP_WRAPPER(64, 32, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  549|      0|        HIGHBD_MBFP_WRAPPER(32, 64, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  550|      0|        HIGHBD_MBFP_WRAPPER(32, 32, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  551|      0|        HIGHBD_MBFP_WRAPPER(32, 16, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  552|      0|        HIGHBD_MBFP_WRAPPER(16, 32, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  553|      0|        HIGHBD_MBFP_WRAPPER(16, 16, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  554|      0|        HIGHBD_MBFP_WRAPPER(8, 16, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  555|      0|        HIGHBD_MBFP_WRAPPER(16, 8, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  556|      0|        HIGHBD_MBFP_WRAPPER(8, 8, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  557|      0|        HIGHBD_MBFP_WRAPPER(4, 8, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  558|      0|        HIGHBD_MBFP_WRAPPER(8, 4, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  559|      0|        HIGHBD_MBFP_WRAPPER(4, 4, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  560|      0|#if !CONFIG_REALTIME_ONLY
  561|      0|        HIGHBD_MBFP_WRAPPER(64, 16, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  562|      0|        HIGHBD_MBFP_WRAPPER(16, 64, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  563|      0|        HIGHBD_MBFP_WRAPPER(32, 8, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  564|      0|        HIGHBD_MBFP_WRAPPER(8, 32, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  565|      0|        HIGHBD_MBFP_WRAPPER(16, 4, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  566|      0|        HIGHBD_MBFP_WRAPPER(4, 16, 8)
  ------------------
  |  |  309|      0|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|      0|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|      0|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|      0|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|      0|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  567|      0|#endif
  568|       |
  569|       |// OBMC excluded from realtime only build.
  570|      0|#if !CONFIG_REALTIME_ONLY
  571|      0|        HIGHBD_OBFP_WRAPPER_8(128, 128)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  572|      0|        HIGHBD_OBFP_WRAPPER_8(128, 64)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  573|      0|        HIGHBD_OBFP_WRAPPER_8(64, 128)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  574|      0|        HIGHBD_OBFP_WRAPPER_8(64, 64)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  575|      0|        HIGHBD_OBFP_WRAPPER_8(64, 32)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  576|      0|        HIGHBD_OBFP_WRAPPER_8(32, 64)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  577|      0|        HIGHBD_OBFP_WRAPPER_8(32, 32)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  578|      0|        HIGHBD_OBFP_WRAPPER_8(32, 16)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  579|      0|        HIGHBD_OBFP_WRAPPER_8(16, 32)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  580|      0|        HIGHBD_OBFP_WRAPPER_8(16, 16)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  581|      0|        HIGHBD_OBFP_WRAPPER_8(8, 16)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  582|      0|        HIGHBD_OBFP_WRAPPER_8(16, 8)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  583|      0|        HIGHBD_OBFP_WRAPPER_8(8, 8)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  584|      0|        HIGHBD_OBFP_WRAPPER_8(4, 8)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  585|      0|        HIGHBD_OBFP_WRAPPER_8(8, 4)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  586|      0|        HIGHBD_OBFP_WRAPPER_8(4, 4)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  587|      0|        HIGHBD_OBFP_WRAPPER_8(64, 16)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  588|      0|        HIGHBD_OBFP_WRAPPER_8(16, 64)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  589|      0|        HIGHBD_OBFP_WRAPPER_8(32, 8)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  590|      0|        HIGHBD_OBFP_WRAPPER_8(8, 32)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  591|      0|        HIGHBD_OBFP_WRAPPER_8(16, 4)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  592|      0|        HIGHBD_OBFP_WRAPPER_8(4, 16)
  ------------------
  |  |  453|      0|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                      \
  |  |  ------------------
  |  |  |  |  459|      0|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|      0|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|      0|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  454|      0|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits8, \
  |  |  455|      0|              aom_highbd_8_obmc_variance##WIDTH##x##HEIGHT,  \
  |  |  456|      0|              aom_highbd_8_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  593|      0|#endif
  594|       |
  595|      0|        HIGHBD_SDSFP_WRAPPER(128, 128, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  596|      0|        HIGHBD_SDSFP_WRAPPER(128, 64, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  597|      0|        HIGHBD_SDSFP_WRAPPER(64, 128, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  598|      0|        HIGHBD_SDSFP_WRAPPER(64, 64, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  599|      0|        HIGHBD_SDSFP_WRAPPER(64, 32, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  600|      0|        HIGHBD_SDSFP_WRAPPER(32, 64, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  601|      0|        HIGHBD_SDSFP_WRAPPER(32, 32, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  602|      0|        HIGHBD_SDSFP_WRAPPER(32, 16, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  603|      0|        HIGHBD_SDSFP_WRAPPER(16, 32, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  604|      0|        HIGHBD_SDSFP_WRAPPER(16, 16, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  605|      0|        HIGHBD_SDSFP_WRAPPER(8, 16, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  606|      0|#if !CONFIG_REALTIME_ONLY
  607|      0|        HIGHBD_SDSFP_WRAPPER(64, 16, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  608|      0|        HIGHBD_SDSFP_WRAPPER(16, 64, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  609|      0|        HIGHBD_SDSFP_WRAPPER(8, 32, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  610|      0|        HIGHBD_SDSFP_WRAPPER(4, 16, 8)
  ------------------
  |  |  370|      0|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|      0|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|      0|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|      0|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  611|      0|#endif
  612|      0|        break;
  613|       |
  614|  23.1k|      case AOM_BITS_10:
  ------------------
  |  Branch (614:7): [True: 23.1k, False: 27.7k]
  ------------------
  615|  23.1k|#if !CONFIG_REALTIME_ONLY
  616|  23.1k|        HIGHBD_BFP_WRAPPER(64, 16, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  617|  23.1k|        HIGHBD_BFP_WRAPPER(16, 64, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  618|  23.1k|        HIGHBD_BFP_WRAPPER(32, 8, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  619|  23.1k|        HIGHBD_BFP_WRAPPER(8, 32, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  620|  23.1k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(16, 4, 10)
  ------------------
  |  |  150|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  621|  23.1k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 16, 10)
  ------------------
  |  |  150|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  622|  23.1k|#endif
  623|  23.1k|        HIGHBD_BFP_WRAPPER(32, 16, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  624|  23.1k|        HIGHBD_BFP_WRAPPER(16, 32, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  625|  23.1k|        HIGHBD_BFP_WRAPPER(64, 32, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  626|  23.1k|        HIGHBD_BFP_WRAPPER(32, 64, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  627|  23.1k|        HIGHBD_BFP_WRAPPER(32, 32, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  628|  23.1k|        HIGHBD_BFP_WRAPPER(64, 64, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  629|  23.1k|        HIGHBD_BFP_WRAPPER(16, 16, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  630|  23.1k|        HIGHBD_BFP_WRAPPER(16, 8, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  631|  23.1k|        HIGHBD_BFP_WRAPPER(8, 16, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  632|  23.1k|        HIGHBD_BFP_WRAPPER(8, 8, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  633|  23.1k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(8, 4, 10)
  ------------------
  |  |  150|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  634|  23.1k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 8, 10)
  ------------------
  |  |  150|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  635|  23.1k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 4, 10)
  ------------------
  |  |  150|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  636|  23.1k|        HIGHBD_BFP_WRAPPER(128, 128, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  637|  23.1k|        HIGHBD_BFP_WRAPPER(128, 64, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  638|  23.1k|        HIGHBD_BFP_WRAPPER(64, 128, 10)
  ------------------
  |  |  140|  23.1k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  23.1k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  23.1k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  23.1k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  23.1k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  23.1k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  23.1k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  23.1k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  23.1k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  23.1k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  23.1k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  23.1k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  639|       |
  640|  23.1k|        HIGHBD_MBFP_WRAPPER(128, 128, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  641|  23.1k|        HIGHBD_MBFP_WRAPPER(128, 64, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  642|  23.1k|        HIGHBD_MBFP_WRAPPER(64, 128, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  643|  23.1k|        HIGHBD_MBFP_WRAPPER(64, 64, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  644|  23.1k|        HIGHBD_MBFP_WRAPPER(64, 32, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  645|  23.1k|        HIGHBD_MBFP_WRAPPER(32, 64, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  646|  23.1k|        HIGHBD_MBFP_WRAPPER(32, 32, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  647|  23.1k|        HIGHBD_MBFP_WRAPPER(32, 16, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  648|  23.1k|        HIGHBD_MBFP_WRAPPER(16, 32, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  649|  23.1k|        HIGHBD_MBFP_WRAPPER(16, 16, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  650|  23.1k|        HIGHBD_MBFP_WRAPPER(8, 16, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  651|  23.1k|        HIGHBD_MBFP_WRAPPER(16, 8, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  652|  23.1k|        HIGHBD_MBFP_WRAPPER(8, 8, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  653|  23.1k|        HIGHBD_MBFP_WRAPPER(4, 8, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  654|  23.1k|        HIGHBD_MBFP_WRAPPER(8, 4, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  655|  23.1k|        HIGHBD_MBFP_WRAPPER(4, 4, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  656|  23.1k|#if !CONFIG_REALTIME_ONLY
  657|  23.1k|        HIGHBD_MBFP_WRAPPER(64, 16, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  658|  23.1k|        HIGHBD_MBFP_WRAPPER(16, 64, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  659|  23.1k|        HIGHBD_MBFP_WRAPPER(32, 8, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  660|  23.1k|        HIGHBD_MBFP_WRAPPER(8, 32, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  661|  23.1k|        HIGHBD_MBFP_WRAPPER(16, 4, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  662|  23.1k|        HIGHBD_MBFP_WRAPPER(4, 16, 10)
  ------------------
  |  |  309|  23.1k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  23.1k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  23.1k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  23.1k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  23.1k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  663|  23.1k|#endif
  664|       |
  665|       |// OBMC excluded from realtime only build.
  666|  23.1k|#if !CONFIG_REALTIME_ONLY
  667|  23.1k|        HIGHBD_OBFP_WRAPPER(128, 128, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  668|  23.1k|        HIGHBD_OBFP_WRAPPER(128, 64, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  669|  23.1k|        HIGHBD_OBFP_WRAPPER(64, 128, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  670|  23.1k|        HIGHBD_OBFP_WRAPPER(64, 64, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  671|  23.1k|        HIGHBD_OBFP_WRAPPER(64, 32, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  672|  23.1k|        HIGHBD_OBFP_WRAPPER(32, 64, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  673|  23.1k|        HIGHBD_OBFP_WRAPPER(32, 32, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  674|  23.1k|        HIGHBD_OBFP_WRAPPER(32, 16, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  675|  23.1k|        HIGHBD_OBFP_WRAPPER(16, 32, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  676|  23.1k|        HIGHBD_OBFP_WRAPPER(16, 16, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  677|  23.1k|        HIGHBD_OBFP_WRAPPER(8, 16, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  678|  23.1k|        HIGHBD_OBFP_WRAPPER(16, 8, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  679|  23.1k|        HIGHBD_OBFP_WRAPPER(8, 8, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  680|  23.1k|        HIGHBD_OBFP_WRAPPER(4, 8, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  681|  23.1k|        HIGHBD_OBFP_WRAPPER(8, 4, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  682|  23.1k|        HIGHBD_OBFP_WRAPPER(4, 4, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  683|  23.1k|        HIGHBD_OBFP_WRAPPER(64, 16, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  684|  23.1k|        HIGHBD_OBFP_WRAPPER(16, 64, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  685|  23.1k|        HIGHBD_OBFP_WRAPPER(32, 8, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  686|  23.1k|        HIGHBD_OBFP_WRAPPER(8, 32, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  687|  23.1k|        HIGHBD_OBFP_WRAPPER(16, 4, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  688|  23.1k|        HIGHBD_OBFP_WRAPPER(4, 16, 10)
  ------------------
  |  |  464|  23.1k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  23.1k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  23.1k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  23.1k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  23.1k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  23.1k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  23.1k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  689|  23.1k|#endif
  690|       |
  691|  23.1k|        HIGHBD_SDSFP_WRAPPER(128, 128, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  692|  23.1k|        HIGHBD_SDSFP_WRAPPER(128, 64, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  693|  23.1k|        HIGHBD_SDSFP_WRAPPER(64, 128, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  694|  23.1k|        HIGHBD_SDSFP_WRAPPER(64, 64, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  695|  23.1k|        HIGHBD_SDSFP_WRAPPER(64, 32, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  696|  23.1k|        HIGHBD_SDSFP_WRAPPER(32, 64, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  697|  23.1k|        HIGHBD_SDSFP_WRAPPER(32, 32, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  698|  23.1k|        HIGHBD_SDSFP_WRAPPER(32, 16, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  699|  23.1k|        HIGHBD_SDSFP_WRAPPER(16, 32, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  700|  23.1k|        HIGHBD_SDSFP_WRAPPER(16, 16, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  701|  23.1k|        HIGHBD_SDSFP_WRAPPER(8, 16, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  702|       |
  703|  23.1k|#if !CONFIG_REALTIME_ONLY
  704|  23.1k|        HIGHBD_SDSFP_WRAPPER(64, 16, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  705|  23.1k|        HIGHBD_SDSFP_WRAPPER(16, 64, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  706|  23.1k|        HIGHBD_SDSFP_WRAPPER(8, 32, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  707|  23.1k|        HIGHBD_SDSFP_WRAPPER(4, 16, 10)
  ------------------
  |  |  370|  23.1k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  23.1k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  23.1k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  23.1k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  708|  23.1k|#endif
  709|  23.1k|        break;
  710|       |
  711|  27.7k|      case AOM_BITS_12:
  ------------------
  |  Branch (711:7): [True: 27.7k, False: 23.1k]
  ------------------
  712|  27.7k|#if !CONFIG_REALTIME_ONLY
  713|  27.7k|        HIGHBD_BFP_WRAPPER(64, 16, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  714|  27.7k|        HIGHBD_BFP_WRAPPER(16, 64, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  715|  27.7k|        HIGHBD_BFP_WRAPPER(32, 8, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  716|  27.7k|        HIGHBD_BFP_WRAPPER(8, 32, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  717|  27.7k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(16, 4, 12)
  ------------------
  |  |  150|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  718|  27.7k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 16, 12)
  ------------------
  |  |  150|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  719|  27.7k|#endif
  720|  27.7k|        HIGHBD_BFP_WRAPPER(32, 16, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  721|  27.7k|        HIGHBD_BFP_WRAPPER(16, 32, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  722|  27.7k|        HIGHBD_BFP_WRAPPER(64, 32, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  723|  27.7k|        HIGHBD_BFP_WRAPPER(32, 64, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  724|  27.7k|        HIGHBD_BFP_WRAPPER(32, 32, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  725|  27.7k|        HIGHBD_BFP_WRAPPER(64, 64, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  726|  27.7k|        HIGHBD_BFP_WRAPPER(16, 16, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  727|  27.7k|        HIGHBD_BFP_WRAPPER(16, 8, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  728|  27.7k|        HIGHBD_BFP_WRAPPER(8, 16, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  729|  27.7k|        HIGHBD_BFP_WRAPPER(8, 8, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  730|  27.7k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(8, 4, 12)
  ------------------
  |  |  150|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  731|  27.7k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 8, 12)
  ------------------
  |  |  150|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  732|  27.7k|        HIGHBD_BFP_WRAPPER_NO_SAD_AVG(4, 4, 12)
  ------------------
  |  |  150|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  151|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD, /*SDAF=*/NULL, \
  |  |  152|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  153|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  154|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  155|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  156|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  733|  27.7k|        HIGHBD_BFP_WRAPPER(128, 128, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  734|  27.7k|        HIGHBD_BFP_WRAPPER(128, 64, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  735|  27.7k|        HIGHBD_BFP_WRAPPER(64, 128, 12)
  ------------------
  |  |  140|  27.7k|  HIGHBD_BFP(BLOCK_##WIDTH##X##HEIGHT,                                   \
  |  |  ------------------
  |  |  |  |  131|  27.7k|  ppi->fn_ptr[BT].sdf = SDF;                                     \
  |  |  |  |  132|  27.7k|  ppi->fn_ptr[BT].sdaf = SDAF;                                   \
  |  |  |  |  133|  27.7k|  ppi->fn_ptr[BT].vf = VF;                                       \
  |  |  |  |  134|  27.7k|  ppi->fn_ptr[BT].svf = SVF;                                     \
  |  |  |  |  135|  27.7k|  ppi->fn_ptr[BT].svaf = SVAF;                                   \
  |  |  |  |  136|  27.7k|  ppi->fn_ptr[BT].sdx4df = SDX4DF;                               \
  |  |  |  |  137|  27.7k|  ppi->fn_ptr[BT].sdx3df = SDX3DF;
  |  |  ------------------
  |  |  141|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_bits##BD,                \
  |  |  142|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##_avg_bits##BD,            \
  |  |  143|  27.7k|             aom_highbd_##BD##_variance##WIDTH##x##HEIGHT,               \
  |  |  144|  27.7k|             aom_highbd_##BD##_sub_pixel_variance##WIDTH##x##HEIGHT,     \
  |  |  145|  27.7k|             aom_highbd_##BD##_sub_pixel_avg_variance##WIDTH##x##HEIGHT, \
  |  |  146|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x4d_bits##BD,             \
  |  |  147|  27.7k|             aom_highbd_sad##WIDTH##x##HEIGHT##x3d_bits##BD)
  ------------------
  736|       |
  737|  27.7k|        HIGHBD_MBFP_WRAPPER(128, 128, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  738|  27.7k|        HIGHBD_MBFP_WRAPPER(128, 64, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  739|  27.7k|        HIGHBD_MBFP_WRAPPER(64, 128, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  740|  27.7k|        HIGHBD_MBFP_WRAPPER(64, 64, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  741|  27.7k|        HIGHBD_MBFP_WRAPPER(64, 32, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  742|  27.7k|        HIGHBD_MBFP_WRAPPER(32, 64, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  743|  27.7k|        HIGHBD_MBFP_WRAPPER(32, 32, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  744|  27.7k|        HIGHBD_MBFP_WRAPPER(32, 16, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  745|  27.7k|        HIGHBD_MBFP_WRAPPER(16, 32, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  746|  27.7k|        HIGHBD_MBFP_WRAPPER(16, 16, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  747|  27.7k|        HIGHBD_MBFP_WRAPPER(8, 16, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  748|  27.7k|        HIGHBD_MBFP_WRAPPER(16, 8, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  749|  27.7k|        HIGHBD_MBFP_WRAPPER(8, 8, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  750|  27.7k|        HIGHBD_MBFP_WRAPPER(4, 8, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  751|  27.7k|        HIGHBD_MBFP_WRAPPER(8, 4, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  752|  27.7k|        HIGHBD_MBFP_WRAPPER(4, 4, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  753|  27.7k|#if !CONFIG_REALTIME_ONLY
  754|  27.7k|        HIGHBD_MBFP_WRAPPER(64, 16, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  755|  27.7k|        HIGHBD_MBFP_WRAPPER(16, 64, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  756|  27.7k|        HIGHBD_MBFP_WRAPPER(32, 8, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  757|  27.7k|        HIGHBD_MBFP_WRAPPER(8, 32, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  758|  27.7k|        HIGHBD_MBFP_WRAPPER(16, 4, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  759|  27.7k|        HIGHBD_MBFP_WRAPPER(4, 16, 12)
  ------------------
  |  |  309|  27.7k|  HIGHBD_MBFP(BLOCK_##WIDTH##X##HEIGHT,                           \
  |  |  ------------------
  |  |  |  |  305|  27.7k|  ppi->fn_ptr[BT].msdf = MCSDF;       \
  |  |  |  |  306|  27.7k|  ppi->fn_ptr[BT].msvf = MCSVF;
  |  |  ------------------
  |  |  310|  27.7k|              aom_highbd_masked_sad##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  311|  27.7k|              aom_highbd_##BD##_masked_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  760|  27.7k|#endif
  761|       |
  762|       |// OBMC excluded from realtime only build.
  763|  27.7k|#if !CONFIG_REALTIME_ONLY
  764|  27.7k|        HIGHBD_OBFP_WRAPPER(128, 128, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  765|  27.7k|        HIGHBD_OBFP_WRAPPER(128, 64, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  766|  27.7k|        HIGHBD_OBFP_WRAPPER(64, 128, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  767|  27.7k|        HIGHBD_OBFP_WRAPPER(64, 64, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  768|  27.7k|        HIGHBD_OBFP_WRAPPER(64, 32, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  769|  27.7k|        HIGHBD_OBFP_WRAPPER(32, 64, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  770|  27.7k|        HIGHBD_OBFP_WRAPPER(32, 32, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  771|  27.7k|        HIGHBD_OBFP_WRAPPER(32, 16, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  772|  27.7k|        HIGHBD_OBFP_WRAPPER(16, 32, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  773|  27.7k|        HIGHBD_OBFP_WRAPPER(16, 16, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  774|  27.7k|        HIGHBD_OBFP_WRAPPER(8, 16, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  775|  27.7k|        HIGHBD_OBFP_WRAPPER(16, 8, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  776|  27.7k|        HIGHBD_OBFP_WRAPPER(8, 8, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  777|  27.7k|        HIGHBD_OBFP_WRAPPER(4, 8, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  778|  27.7k|        HIGHBD_OBFP_WRAPPER(8, 4, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  779|  27.7k|        HIGHBD_OBFP_WRAPPER(4, 4, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  780|  27.7k|        HIGHBD_OBFP_WRAPPER(64, 16, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  781|  27.7k|        HIGHBD_OBFP_WRAPPER(16, 64, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  782|  27.7k|        HIGHBD_OBFP_WRAPPER(32, 8, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  783|  27.7k|        HIGHBD_OBFP_WRAPPER(8, 32, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  784|  27.7k|        HIGHBD_OBFP_WRAPPER(16, 4, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  785|  27.7k|        HIGHBD_OBFP_WRAPPER(4, 16, 12)
  ------------------
  |  |  464|  27.7k|  HIGHBD_OBFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  459|  27.7k|  ppi->fn_ptr[BT].osdf = OSDF;           \
  |  |  |  |  460|  27.7k|  ppi->fn_ptr[BT].ovf = OVF;             \
  |  |  |  |  461|  27.7k|  ppi->fn_ptr[BT].osvf = OSVF;
  |  |  ------------------
  |  |  465|  27.7k|              aom_highbd_obmc_sad##WIDTH##x##HEIGHT##_bits##BD,  \
  |  |  466|  27.7k|              aom_highbd_##BD##_obmc_variance##WIDTH##x##HEIGHT, \
  |  |  467|  27.7k|              aom_highbd_##BD##_obmc_sub_pixel_variance##WIDTH##x##HEIGHT)
  ------------------
  786|  27.7k|#endif
  787|       |
  788|  27.7k|        HIGHBD_SDSFP_WRAPPER(128, 128, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  789|  27.7k|        HIGHBD_SDSFP_WRAPPER(128, 64, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  790|  27.7k|        HIGHBD_SDSFP_WRAPPER(64, 128, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  791|  27.7k|        HIGHBD_SDSFP_WRAPPER(64, 64, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  792|  27.7k|        HIGHBD_SDSFP_WRAPPER(64, 32, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  793|  27.7k|        HIGHBD_SDSFP_WRAPPER(32, 64, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  794|  27.7k|        HIGHBD_SDSFP_WRAPPER(32, 32, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  795|  27.7k|        HIGHBD_SDSFP_WRAPPER(32, 16, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  796|  27.7k|        HIGHBD_SDSFP_WRAPPER(16, 32, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  797|  27.7k|        HIGHBD_SDSFP_WRAPPER(16, 16, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  798|  27.7k|        HIGHBD_SDSFP_WRAPPER(8, 16, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  799|       |
  800|  27.7k|#if !CONFIG_REALTIME_ONLY
  801|  27.7k|        HIGHBD_SDSFP_WRAPPER(64, 16, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  802|  27.7k|        HIGHBD_SDSFP_WRAPPER(16, 64, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  803|  27.7k|        HIGHBD_SDSFP_WRAPPER(8, 32, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  804|  27.7k|        HIGHBD_SDSFP_WRAPPER(4, 16, 12)
  ------------------
  |  |  370|  27.7k|  HIGHBD_SDSFP(BLOCK_##WIDTH##X##HEIGHT,                          \
  |  |  ------------------
  |  |  |  |  366|  27.7k|  ppi->fn_ptr[BT].sdsf = SDSF;          \
  |  |  |  |  367|  27.7k|  ppi->fn_ptr[BT].sdsx4df = SDSX4DF;
  |  |  ------------------
  |  |  371|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##_bits##BD, \
  |  |  372|  27.7k|               aom_highbd_sad_skip_##WIDTH##x##HEIGHT##x4d##_bits##BD)
  ------------------
  805|  27.7k|#endif
  806|  27.7k|        break;
  807|       |
  808|      0|      default:
  ------------------
  |  Branch (808:7): [True: 0, False: 50.9k]
  ------------------
  809|       |        assert(0 &&
  810|  50.9k|               "cm->seq_params->bit_depth should be AOM_BITS_8, "
  811|  50.9k|               "AOM_BITS_10 or AOM_BITS_12");
  812|  50.9k|    }
  813|  50.9k|  }
  814|   174k|}
encoder.c:aom_highbd_sad32x16_bits10:
  166|  21.7k|      int ref_stride) {                                                        \
  167|  21.7k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  21.7k|  }                                                                            \
encoder.c:aom_highbd_sad32x16x4d_bits10:
  202|  21.9k|                              unsigned int *sad_array) {                      \
  203|  21.9k|    int i;                                                                    \
  204|  21.9k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|   109k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 87.6k, False: 21.9k]
  ------------------
  206|  21.9k|  }                                                                           \
encoder.c:aom_highbd_sad32x16x3d_bits10:
  202|    111|                              unsigned int *sad_array) {                      \
  203|    111|    int i;                                                                    \
  204|    111|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|    555|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 444, False: 111]
  ------------------
  206|    111|  }                                                                           \
encoder.c:aom_highbd_sad16x32_bits10:
  166|  18.3k|      int ref_stride) {                                                        \
  167|  18.3k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  18.3k|  }                                                                            \
encoder.c:aom_highbd_sad16x32x4d_bits10:
  202|  4.23k|                              unsigned int *sad_array) {                      \
  203|  4.23k|    int i;                                                                    \
  204|  4.23k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  21.1k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 16.9k, False: 4.23k]
  ------------------
  206|  4.23k|  }                                                                           \
encoder.c:aom_highbd_sad16x32x3d_bits10:
  202|     74|                              unsigned int *sad_array) {                      \
  203|     74|    int i;                                                                    \
  204|     74|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|    370|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 296, False: 74]
  ------------------
  206|     74|  }                                                                           \
encoder.c:aom_highbd_sad64x32_bits10:
  166|  8.48k|      int ref_stride) {                                                        \
  167|  8.48k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  8.48k|  }                                                                            \
encoder.c:aom_highbd_sad64x32x4d_bits10:
  202|  8.37k|                              unsigned int *sad_array) {                      \
  203|  8.37k|    int i;                                                                    \
  204|  8.37k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  41.8k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 33.4k, False: 8.37k]
  ------------------
  206|  8.37k|  }                                                                           \
encoder.c:aom_highbd_sad32x64_bits10:
  166|  9.12k|      int ref_stride) {                                                        \
  167|  9.12k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  9.12k|  }                                                                            \
encoder.c:aom_highbd_sad32x64x4d_bits10:
  202|  1.98k|                              unsigned int *sad_array) {                      \
  203|  1.98k|    int i;                                                                    \
  204|  1.98k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  9.92k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 7.93k, False: 1.98k]
  ------------------
  206|  1.98k|  }                                                                           \
encoder.c:aom_highbd_sad32x32_bits10:
  166|  16.5k|      int ref_stride) {                                                        \
  167|  16.5k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  16.5k|  }                                                                            \
encoder.c:aom_highbd_sad32x32x4d_bits10:
  202|  7.77k|                              unsigned int *sad_array) {                      \
  203|  7.77k|    int i;                                                                    \
  204|  7.77k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  38.8k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 31.1k, False: 7.77k]
  ------------------
  206|  7.77k|  }                                                                           \
encoder.c:aom_highbd_sad32x32x3d_bits10:
  202|    247|                              unsigned int *sad_array) {                      \
  203|    247|    int i;                                                                    \
  204|    247|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  1.23k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 988, False: 247]
  ------------------
  206|    247|  }                                                                           \
encoder.c:aom_highbd_sad64x64_bits10:
  166|  10.9k|      int ref_stride) {                                                        \
  167|  10.9k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  10.9k|  }                                                                            \
encoder.c:aom_highbd_sad64x64x4d_bits10:
  202|    724|                              unsigned int *sad_array) {                      \
  203|    724|    int i;                                                                    \
  204|    724|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  3.62k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 2.89k, False: 724]
  ------------------
  206|    724|  }                                                                           \
encoder.c:aom_highbd_sad64x64x3d_bits10:
  202|    477|                              unsigned int *sad_array) {                      \
  203|    477|    int i;                                                                    \
  204|    477|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  2.38k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 1.90k, False: 477]
  ------------------
  206|    477|  }                                                                           \
encoder.c:aom_highbd_sad16x16_bits10:
  166|  39.3k|      int ref_stride) {                                                        \
  167|  39.3k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  39.3k|  }                                                                            \
encoder.c:aom_highbd_sad16x16x4d_bits10:
  202|  28.7k|                              unsigned int *sad_array) {                      \
  203|  28.7k|    int i;                                                                    \
  204|  28.7k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|   143k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 115k, False: 28.7k]
  ------------------
  206|  28.7k|  }                                                                           \
encoder.c:aom_highbd_sad16x16x3d_bits10:
  202|  6.84k|                              unsigned int *sad_array) {                      \
  203|  6.84k|    int i;                                                                    \
  204|  6.84k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  34.1k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 27.3k, False: 6.84k]
  ------------------
  206|  6.84k|  }                                                                           \
encoder.c:aom_highbd_sad16x8_bits10:
  166|  75.2k|      int ref_stride) {                                                        \
  167|  75.2k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  75.2k|  }                                                                            \
encoder.c:aom_highbd_sad16x8x4d_bits10:
  202|   217k|                              unsigned int *sad_array) {                      \
  203|   217k|    int i;                                                                    \
  204|   217k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  1.08M|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 869k, False: 217k]
  ------------------
  206|   217k|  }                                                                           \
encoder.c:aom_highbd_sad16x8x3d_bits10:
  202|  2.40k|                              unsigned int *sad_array) {                      \
  203|  2.40k|    int i;                                                                    \
  204|  2.40k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  12.0k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 9.62k, False: 2.40k]
  ------------------
  206|  2.40k|  }                                                                           \
encoder.c:aom_highbd_sad8x16_bits10:
  166|  40.1k|      int ref_stride) {                                                        \
  167|  40.1k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  40.1k|  }                                                                            \
encoder.c:aom_highbd_sad8x16x4d_bits10:
  202|  24.0k|                              unsigned int *sad_array) {                      \
  203|  24.0k|    int i;                                                                    \
  204|  24.0k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|   120k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 96.1k, False: 24.0k]
  ------------------
  206|  24.0k|  }                                                                           \
encoder.c:aom_highbd_sad8x16x3d_bits10:
  202|  2.40k|                              unsigned int *sad_array) {                      \
  203|  2.40k|    int i;                                                                    \
  204|  2.40k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  12.0k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 9.63k, False: 2.40k]
  ------------------
  206|  2.40k|  }                                                                           \
encoder.c:aom_highbd_sad8x8_bits10:
  166|   722k|      int ref_stride) {                                                        \
  167|   722k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|   722k|  }                                                                            \
encoder.c:aom_highbd_sad8x8x4d_bits10:
  202|  3.00M|                              unsigned int *sad_array) {                      \
  203|  3.00M|    int i;                                                                    \
  204|  3.00M|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  15.0M|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 12.0M, False: 3.00M]
  ------------------
  206|  3.00M|  }                                                                           \
encoder.c:aom_highbd_sad8x8x3d_bits10:
  202|  19.7k|                              unsigned int *sad_array) {                      \
  203|  19.7k|    int i;                                                                    \
  204|  19.7k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  98.8k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 79.0k, False: 19.7k]
  ------------------
  206|  19.7k|  }                                                                           \
encoder.c:aom_highbd_sad8x4_bits10:
  166|   410k|      int ref_stride) {                                                        \
  167|   410k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|   410k|  }                                                                            \
encoder.c:aom_highbd_sad8x4x4d_bits10:
  202|   780k|                              unsigned int *sad_array) {                      \
  203|   780k|    int i;                                                                    \
  204|   780k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  3.90M|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 3.12M, False: 780k]
  ------------------
  206|   780k|  }                                                                           \
encoder.c:aom_highbd_sad4x8_bits10:
  166|   225k|      int ref_stride) {                                                        \
  167|   225k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|   225k|  }                                                                            \
encoder.c:aom_highbd_sad4x8x4d_bits10:
  202|   466k|                              unsigned int *sad_array) {                      \
  203|   466k|    int i;                                                                    \
  204|   466k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  2.33M|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 1.86M, False: 466k]
  ------------------
  206|   466k|  }                                                                           \
encoder.c:aom_highbd_sad4x4_bits10:
  166|  1.61M|      int ref_stride) {                                                        \
  167|  1.61M|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 2;           \
  168|  1.61M|  }                                                                            \
encoder.c:aom_highbd_sad4x4x4d_bits10:
  202|  4.14M|                              unsigned int *sad_array) {                      \
  203|  4.14M|    int i;                                                                    \
  204|  4.14M|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  205|  20.7M|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (205:17): [True: 16.5M, False: 4.14M]
  ------------------
  206|  4.14M|  }                                                                           \
encoder.c:aom_highbd_sad_skip_64x64_bits10:
  380|  21.8k|                                      const uint8_t *ref, int ref_stride) { \
  381|  21.8k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  21.8k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_64x64x4d_bits10:
  396|  44.1k|                              unsigned int *sad_array) {                      \
  397|  44.1k|    int i;                                                                    \
  398|  44.1k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   220k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 176k, False: 44.1k]
  ------------------
  400|  44.1k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_64x32_bits10:
  380|  30.4k|                                      const uint8_t *ref, int ref_stride) { \
  381|  30.4k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  30.4k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_64x32x4d_bits10:
  396|  39.4k|                              unsigned int *sad_array) {                      \
  397|  39.4k|    int i;                                                                    \
  398|  39.4k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   197k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 157k, False: 39.4k]
  ------------------
  400|  39.4k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_32x64_bits10:
  380|  32.3k|                                      const uint8_t *ref, int ref_stride) { \
  381|  32.3k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  32.3k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_32x64x4d_bits10:
  396|  47.5k|                              unsigned int *sad_array) {                      \
  397|  47.5k|    int i;                                                                    \
  398|  47.5k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   237k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 189k, False: 47.5k]
  ------------------
  400|  47.5k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_32x32_bits10:
  380|  59.1k|                                      const uint8_t *ref, int ref_stride) { \
  381|  59.1k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  59.1k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_32x32x4d_bits10:
  396|   106k|                              unsigned int *sad_array) {                      \
  397|   106k|    int i;                                                                    \
  398|   106k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   533k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 426k, False: 106k]
  ------------------
  400|   106k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_32x16_bits10:
  380|  60.5k|                                      const uint8_t *ref, int ref_stride) { \
  381|  60.5k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  60.5k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_32x16x4d_bits10:
  396|  78.7k|                              unsigned int *sad_array) {                      \
  397|  78.7k|    int i;                                                                    \
  398|  78.7k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   393k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 315k, False: 78.7k]
  ------------------
  400|  78.7k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_16x32_bits10:
  380|  66.4k|                                      const uint8_t *ref, int ref_stride) { \
  381|  66.4k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  66.4k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_16x32x4d_bits10:
  396|  99.4k|                              unsigned int *sad_array) {                      \
  397|  99.4k|    int i;                                                                    \
  398|  99.4k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   497k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 397k, False: 99.4k]
  ------------------
  400|  99.4k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_16x16_bits10:
  380|   123k|                                      const uint8_t *ref, int ref_stride) { \
  381|   123k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|   123k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_16x16x4d_bits10:
  396|   186k|                              unsigned int *sad_array) {                      \
  397|   186k|    int i;                                                                    \
  398|   186k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   930k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 744k, False: 186k]
  ------------------
  400|   186k|  }                                                                           \
encoder.c:aom_highbd_sad_skip_8x16_bits10:
  380|  97.1k|                                      const uint8_t *ref, int ref_stride) { \
  381|  97.1k|    return fnname(src, src_stride, ref, ref_stride) >> 2;                   \
  382|  97.1k|  }                                                                         \
encoder.c:aom_highbd_sad_skip_8x16x4d_bits10:
  396|   174k|                              unsigned int *sad_array) {                      \
  397|   174k|    int i;                                                                    \
  398|   174k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  399|   872k|    for (i = 0; i < 4; i++) sad_array[i] >>= 2;                               \
  ------------------
  |  Branch (399:17): [True: 698k, False: 174k]
  ------------------
  400|   174k|  }                                                                           \
encoder.c:aom_highbd_sad32x16_bits12:
  171|  23.0k|      int ref_stride) {                                                        \
  172|  23.0k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  23.0k|  }
encoder.c:aom_highbd_sad32x16x4d_bits12:
  209|  21.6k|                              unsigned int *sad_array) {                      \
  210|  21.6k|    int i;                                                                    \
  211|  21.6k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|   108k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 86.5k, False: 21.6k]
  ------------------
  213|  21.6k|  }
encoder.c:aom_highbd_sad32x16x3d_bits12:
  209|      9|                              unsigned int *sad_array) {                      \
  210|      9|    int i;                                                                    \
  211|      9|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|     45|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 36, False: 9]
  ------------------
  213|      9|  }
encoder.c:aom_highbd_sad16x32_bits12:
  171|  21.4k|      int ref_stride) {                                                        \
  172|  21.4k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  21.4k|  }
encoder.c:aom_highbd_sad16x32x4d_bits12:
  209|  4.04k|                              unsigned int *sad_array) {                      \
  210|  4.04k|    int i;                                                                    \
  211|  4.04k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  20.2k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 16.1k, False: 4.04k]
  ------------------
  213|  4.04k|  }
encoder.c:aom_highbd_sad16x32x3d_bits12:
  209|     24|                              unsigned int *sad_array) {                      \
  210|     24|    int i;                                                                    \
  211|     24|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|    120|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 96, False: 24]
  ------------------
  213|     24|  }
encoder.c:aom_highbd_sad64x32_bits12:
  171|  9.25k|      int ref_stride) {                                                        \
  172|  9.25k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  9.25k|  }
encoder.c:aom_highbd_sad64x32x4d_bits12:
  209|  9.34k|                              unsigned int *sad_array) {                      \
  210|  9.34k|    int i;                                                                    \
  211|  9.34k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  46.7k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 37.4k, False: 9.34k]
  ------------------
  213|  9.34k|  }
encoder.c:aom_highbd_sad32x64_bits12:
  171|  9.95k|      int ref_stride) {                                                        \
  172|  9.95k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  9.95k|  }
encoder.c:aom_highbd_sad32x64x4d_bits12:
  209|  1.97k|                              unsigned int *sad_array) {                      \
  210|  1.97k|    int i;                                                                    \
  211|  1.97k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  9.89k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 7.91k, False: 1.97k]
  ------------------
  213|  1.97k|  }
encoder.c:aom_highbd_sad32x32_bits12:
  171|  16.7k|      int ref_stride) {                                                        \
  172|  16.7k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  16.7k|  }
encoder.c:aom_highbd_sad32x32x4d_bits12:
  209|  8.12k|                              unsigned int *sad_array) {                      \
  210|  8.12k|    int i;                                                                    \
  211|  8.12k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  40.6k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 32.5k, False: 8.12k]
  ------------------
  213|  8.12k|  }
encoder.c:aom_highbd_sad32x32x3d_bits12:
  209|     21|                              unsigned int *sad_array) {                      \
  210|     21|    int i;                                                                    \
  211|     21|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|    105|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 84, False: 21]
  ------------------
  213|     21|  }
encoder.c:aom_highbd_sad64x64_bits12:
  171|  11.7k|      int ref_stride) {                                                        \
  172|  11.7k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  11.7k|  }
encoder.c:aom_highbd_sad64x64x4d_bits12:
  209|    995|                              unsigned int *sad_array) {                      \
  210|    995|    int i;                                                                    \
  211|    995|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  4.97k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 3.98k, False: 995]
  ------------------
  213|    995|  }
encoder.c:aom_highbd_sad64x64x3d_bits12:
  209|    705|                              unsigned int *sad_array) {                      \
  210|    705|    int i;                                                                    \
  211|    705|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  3.52k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 2.82k, False: 705]
  ------------------
  213|    705|  }
encoder.c:aom_highbd_sad16x16_bits12:
  171|  42.9k|      int ref_stride) {                                                        \
  172|  42.9k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  42.9k|  }
encoder.c:aom_highbd_sad16x16x4d_bits12:
  209|  27.1k|                              unsigned int *sad_array) {                      \
  210|  27.1k|    int i;                                                                    \
  211|  27.1k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|   135k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 108k, False: 27.1k]
  ------------------
  213|  27.1k|  }
encoder.c:aom_highbd_sad16x16x3d_bits12:
  209|  5.58k|                              unsigned int *sad_array) {                      \
  210|  5.58k|    int i;                                                                    \
  211|  5.58k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  27.9k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 22.3k, False: 5.58k]
  ------------------
  213|  5.58k|  }
encoder.c:aom_highbd_sad16x8_bits12:
  171|  70.8k|      int ref_stride) {                                                        \
  172|  70.8k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  70.8k|  }
encoder.c:aom_highbd_sad16x8x4d_bits12:
  209|   194k|                              unsigned int *sad_array) {                      \
  210|   194k|    int i;                                                                    \
  211|   194k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|   971k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 777k, False: 194k]
  ------------------
  213|   194k|  }
encoder.c:aom_highbd_sad16x8x3d_bits12:
  209|  2.14k|                              unsigned int *sad_array) {                      \
  210|  2.14k|    int i;                                                                    \
  211|  2.14k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  10.7k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 8.57k, False: 2.14k]
  ------------------
  213|  2.14k|  }
encoder.c:aom_highbd_sad8x16_bits12:
  171|  57.8k|      int ref_stride) {                                                        \
  172|  57.8k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  57.8k|  }
encoder.c:aom_highbd_sad8x16x4d_bits12:
  209|  26.8k|                              unsigned int *sad_array) {                      \
  210|  26.8k|    int i;                                                                    \
  211|  26.8k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|   134k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 107k, False: 26.8k]
  ------------------
  213|  26.8k|  }
encoder.c:aom_highbd_sad8x16x3d_bits12:
  209|  1.76k|                              unsigned int *sad_array) {                      \
  210|  1.76k|    int i;                                                                    \
  211|  1.76k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  8.83k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 7.07k, False: 1.76k]
  ------------------
  213|  1.76k|  }
encoder.c:aom_highbd_sad8x8_bits12:
  171|   714k|      int ref_stride) {                                                        \
  172|   714k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|   714k|  }
encoder.c:aom_highbd_sad8x8x4d_bits12:
  209|  2.87M|                              unsigned int *sad_array) {                      \
  210|  2.87M|    int i;                                                                    \
  211|  2.87M|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  14.3M|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 11.5M, False: 2.87M]
  ------------------
  213|  2.87M|  }
encoder.c:aom_highbd_sad8x8x3d_bits12:
  209|  27.8k|                              unsigned int *sad_array) {                      \
  210|  27.8k|    int i;                                                                    \
  211|  27.8k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|   139k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 111k, False: 27.8k]
  ------------------
  213|  27.8k|  }
encoder.c:aom_highbd_sad8x4_bits12:
  171|   399k|      int ref_stride) {                                                        \
  172|   399k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|   399k|  }
encoder.c:aom_highbd_sad8x4x4d_bits12:
  209|   724k|                              unsigned int *sad_array) {                      \
  210|   724k|    int i;                                                                    \
  211|   724k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  3.62M|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 2.89M, False: 724k]
  ------------------
  213|   724k|  }
encoder.c:aom_highbd_sad4x8_bits12:
  171|   371k|      int ref_stride) {                                                        \
  172|   371k|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|   371k|  }
encoder.c:aom_highbd_sad4x8x4d_bits12:
  209|   700k|                              unsigned int *sad_array) {                      \
  210|   700k|    int i;                                                                    \
  211|   700k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  3.50M|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 2.80M, False: 700k]
  ------------------
  213|   700k|  }
encoder.c:aom_highbd_sad4x4_bits12:
  171|  1.74M|      int ref_stride) {                                                        \
  172|  1.74M|    return fnname(src_ptr, source_stride, ref_ptr, ref_stride) >> 4;           \
  173|  1.74M|  }
encoder.c:aom_highbd_sad4x4x4d_bits12:
  209|  4.18M|                              unsigned int *sad_array) {                      \
  210|  4.18M|    int i;                                                                    \
  211|  4.18M|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  212|  20.9M|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (212:17): [True: 16.7M, False: 4.18M]
  ------------------
  213|  4.18M|  }
encoder.c:aom_highbd_sad_skip_64x64_bits12:
  384|  22.4k|                                      const uint8_t *ref, int ref_stride) { \
  385|  22.4k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  22.4k|  }
encoder.c:aom_highbd_sad_skip_64x64x4d_bits12:
  403|  46.9k|                              unsigned int *sad_array) {                      \
  404|  46.9k|    int i;                                                                    \
  405|  46.9k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   235k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 188k, False: 46.9k]
  ------------------
  407|  46.9k|  }
encoder.c:aom_highbd_sad_skip_64x32_bits12:
  384|  31.7k|                                      const uint8_t *ref, int ref_stride) { \
  385|  31.7k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  31.7k|  }
encoder.c:aom_highbd_sad_skip_64x32x4d_bits12:
  403|  39.9k|                              unsigned int *sad_array) {                      \
  404|  39.9k|    int i;                                                                    \
  405|  39.9k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   200k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 160k, False: 39.9k]
  ------------------
  407|  39.9k|  }
encoder.c:aom_highbd_sad_skip_32x64_bits12:
  384|  34.2k|                                      const uint8_t *ref, int ref_stride) { \
  385|  34.2k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  34.2k|  }
encoder.c:aom_highbd_sad_skip_32x64x4d_bits12:
  403|  48.2k|                              unsigned int *sad_array) {                      \
  404|  48.2k|    int i;                                                                    \
  405|  48.2k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   241k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 192k, False: 48.2k]
  ------------------
  407|  48.2k|  }
encoder.c:aom_highbd_sad_skip_32x32_bits12:
  384|  57.7k|                                      const uint8_t *ref, int ref_stride) { \
  385|  57.7k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  57.7k|  }
encoder.c:aom_highbd_sad_skip_32x32x4d_bits12:
  403|  95.9k|                              unsigned int *sad_array) {                      \
  404|  95.9k|    int i;                                                                    \
  405|  95.9k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   479k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 383k, False: 95.9k]
  ------------------
  407|  95.9k|  }
encoder.c:aom_highbd_sad_skip_32x16_bits12:
  384|  61.6k|                                      const uint8_t *ref, int ref_stride) { \
  385|  61.6k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  61.6k|  }
encoder.c:aom_highbd_sad_skip_32x16x4d_bits12:
  403|  77.8k|                              unsigned int *sad_array) {                      \
  404|  77.8k|    int i;                                                                    \
  405|  77.8k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   389k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 311k, False: 77.8k]
  ------------------
  407|  77.8k|  }
encoder.c:aom_highbd_sad_skip_16x32_bits12:
  384|  69.2k|                                      const uint8_t *ref, int ref_stride) { \
  385|  69.2k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|  69.2k|  }
encoder.c:aom_highbd_sad_skip_16x32x4d_bits12:
  403|  98.2k|                              unsigned int *sad_array) {                      \
  404|  98.2k|    int i;                                                                    \
  405|  98.2k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   491k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 393k, False: 98.2k]
  ------------------
  407|  98.2k|  }
encoder.c:aom_highbd_sad_skip_16x16_bits12:
  384|   126k|                                      const uint8_t *ref, int ref_stride) { \
  385|   126k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|   126k|  }
encoder.c:aom_highbd_sad_skip_16x16x4d_bits12:
  403|   185k|                              unsigned int *sad_array) {                      \
  404|   185k|    int i;                                                                    \
  405|   185k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   925k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 740k, False: 185k]
  ------------------
  407|   185k|  }
encoder.c:aom_highbd_sad_skip_8x16_bits12:
  384|   102k|                                      const uint8_t *ref, int ref_stride) { \
  385|   102k|    return fnname(src, src_stride, ref, ref_stride) >> 4;                   \
  386|   102k|  }
encoder.c:aom_highbd_sad_skip_8x16x4d_bits12:
  403|   196k|                              unsigned int *sad_array) {                      \
  404|   196k|    int i;                                                                    \
  405|   196k|    fnname(src_ptr, source_stride, ref_ptr, ref_stride, sad_array);           \
  406|   983k|    for (i = 0; i < 4; i++) sad_array[i] >>= 4;                               \
  ------------------
  |  Branch (406:17): [True: 786k, False: 196k]
  ------------------
  407|   196k|  }
encoder.c:size_in_mi:
   55|   810k|static inline int size_in_mi(int size) {
   56|       |  // Ensure that the decoded width and height are both multiples of
   57|       |  // 8 luma pixels (note: this may only be a multiple of 4 chroma pixels if
   58|       |  // subsampling is used).
   59|       |  // This simplifies the implementation of various experiments,
   60|       |  // eg. cdef, which operates on units of 8x8 luma pixels.
   61|   810k|  const int aligned_size = ALIGN_POWER_OF_TWO(size, 3);
  ------------------
  |  |   69|   810k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
   62|   810k|  return aligned_size >> MI_SIZE_LOG2;
  ------------------
  |  |   39|   810k|#define MI_SIZE_LOG2 2
  ------------------
   63|   810k|}
encoder.c:enc_set_mb_mi:
   95|   405k|                                 int height, BLOCK_SIZE min_partition_size) {
   96|   405k|  mi_params->mi_alloc_bsize = min_partition_size;
   97|       |
   98|   405k|  set_mb_mi(mi_params, width, height);
   99|   405k|}
encoder.c:set_mb_mi:
   66|   405k|                             int height) {
   67|   405k|  mi_params->mi_cols = size_in_mi(width);
   68|   405k|  mi_params->mi_rows = size_in_mi(height);
   69|   405k|  mi_params->mi_stride = calc_mi_size(mi_params->mi_cols);
   70|       |
   71|   405k|  mi_params->mb_cols = ROUND_POWER_OF_TWO(mi_params->mi_cols, 2);
  ------------------
  |  |   41|   405k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   72|   405k|  mi_params->mb_rows = ROUND_POWER_OF_TWO(mi_params->mi_rows, 2);
  ------------------
  |  |   41|   405k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   73|   405k|  mi_params->MBs = mi_params->mb_rows * mi_params->mb_cols;
   74|       |
   75|   405k|  const int mi_alloc_size_1d = mi_size_wide[mi_params->mi_alloc_bsize];
   76|   405k|  mi_params->mi_alloc_stride =
   77|   405k|      (mi_params->mi_stride + mi_alloc_size_1d - 1) / mi_alloc_size_1d;
   78|       |
   79|       |  assert(mi_size_wide[mi_params->mi_alloc_bsize] ==
   80|   405k|         mi_size_high[mi_params->mi_alloc_bsize]);
   81|   405k|}
encoder.c:enc_free_mi:
   83|  67.5k|static inline void enc_free_mi(CommonModeInfoParams *mi_params) {
   84|  67.5k|  aom_free(mi_params->mi_alloc);
   85|  67.5k|  mi_params->mi_alloc = NULL;
   86|  67.5k|  mi_params->mi_alloc_size = 0;
   87|  67.5k|  aom_free(mi_params->mi_grid_base);
   88|  67.5k|  mi_params->mi_grid_base = NULL;
   89|  67.5k|  mi_params->mi_grid_size = 0;
   90|  67.5k|  aom_free(mi_params->tx_type_map);
   91|       |  mi_params->tx_type_map = NULL;
   92|  67.5k|}
encoder.c:enc_setup_mi:
  110|  49.2k|static inline void enc_setup_mi(CommonModeInfoParams *mi_params) {
  111|  49.2k|  const int mi_grid_size =
  112|  49.2k|      mi_params->mi_stride * calc_mi_size(mi_params->mi_rows);
  113|  49.2k|  memset(mi_params->mi_alloc, 0,
  114|  49.2k|         mi_params->mi_alloc_size * sizeof(*mi_params->mi_alloc));
  115|  49.2k|  memset(mi_params->mi_grid_base, 0,
  116|  49.2k|         mi_grid_size * sizeof(*mi_params->mi_grid_base));
  117|  49.2k|  memset(mi_params->tx_type_map, 0,
  118|  49.2k|         mi_grid_size * sizeof(*mi_params->tx_type_map));
  119|  49.2k|}
encoder.c:init_buffer_indices:
  122|  18.4k|    ForceIntegerMVInfo *const force_intpel_info, int *const remapped_ref_idx) {
  123|  18.4k|  int fb_idx;
  124|   165k|  for (fb_idx = 0; fb_idx < REF_FRAMES; ++fb_idx)
  ------------------
  |  Branch (124:20): [True: 147k, False: 18.4k]
  ------------------
  125|   147k|    remapped_ref_idx[fb_idx] = fb_idx;
  126|  18.4k|  force_intpel_info->rate_index = 0;
  127|  18.4k|  force_intpel_info->rate_size = 0;
  128|  18.4k|}
encoder.c:av1_get_enc_border_size:
 1052|   122k|                                          BLOCK_SIZE sb_size) {
 1053|       |  // For allintra encoding mode, inter-frame motion search is not applicable and
 1054|       |  // the intraBC motion vectors are restricted within the tile boundaries. Hence
 1055|       |  // a smaller frame border size (AOM_ENC_ALLINTRA_BORDER) is used in this case.
 1056|   122k|  if (resize) {
  ------------------
  |  Branch (1056:7): [True: 92.1k, False: 30.7k]
  ------------------
 1057|  92.1k|    return AOM_BORDER_IN_PIXELS;
  ------------------
  |  |   32|  92.1k|#define AOM_BORDER_IN_PIXELS 288
  ------------------
 1058|  92.1k|  }
 1059|  30.7k|  if (all_intra) {
  ------------------
  |  Branch (1059:7): [True: 0, False: 30.7k]
  ------------------
 1060|      0|    return AOM_ENC_ALLINTRA_BORDER;
  ------------------
  |  |   34|      0|#define AOM_ENC_ALLINTRA_BORDER 64
  ------------------
 1061|      0|  }
 1062|  30.7k|  return block_size_wide[sb_size] + 32;
 1063|  30.7k|}
encoder.c:av1_is_resize_needed:
 1065|   122k|static inline bool av1_is_resize_needed(const AV1EncoderConfig *oxcf) {
 1066|   122k|  const ResizeCfg *resize_cfg = &oxcf->resize_cfg;
 1067|   122k|  const SuperResCfg *superres_cfg = &oxcf->superres_cfg;
 1068|   122k|  return resize_cfg->resize_mode || superres_cfg->superres_mode;
  ------------------
  |  Branch (1068:10): [True: 92.1k, False: 30.7k]
  |  Branch (1068:37): [True: 0, False: 30.7k]
  ------------------
 1069|   122k|}
encoder.c:release_scaled_references:
  946|  55.2k|static inline void release_scaled_references(AV1_COMP *cpi) {
  947|       |  // Scaled references should only need to be released under certain conditions:
  948|       |  // if the reference will be updated, or if the scaled reference has same
  949|       |  // resolution. For now only apply this to Golden for non-svc RTC mode.
  950|  55.2k|  AV1_COMMON *const cm = &cpi->common;
  951|  55.2k|  const bool refresh_golden = (cpi->refresh_frame.golden_frame) ? 1 : 0;
  ------------------
  |  Branch (951:31): [True: 0, False: 55.2k]
  ------------------
  952|  55.2k|  bool release_golden = true;
  953|   441k|  for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
  ------------------
  |  Branch (953:19): [True: 386k, False: 55.2k]
  ------------------
  954|   386k|    RefCntBuffer *const buf = cpi->scaled_ref_buf[i];
  955|   386k|    const int golden_ref = (i == GOLDEN_FRAME - 1);
  956|   386k|    if (golden_ref && is_one_pass_rt_params(cpi) && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (956:9): [True: 55.2k, False: 331k]
  |  Branch (956:23): [True: 18.3k, False: 36.9k]
  |  Branch (956:53): [True: 18.3k, False: 0]
  ------------------
  957|  18.3k|        buf != NULL) {
  ------------------
  |  Branch (957:9): [True: 0, False: 18.3k]
  ------------------
  958|      0|      const RefCntBuffer *const ref = get_ref_frame_buf(cm, GOLDEN_FRAME);
  959|      0|      const bool same_resoln = buf->buf.y_crop_width == ref->buf.y_crop_width &&
  ------------------
  |  Branch (959:32): [True: 0, False: 0]
  ------------------
  960|      0|                               buf->buf.y_crop_height == ref->buf.y_crop_height;
  ------------------
  |  Branch (960:32): [True: 0, False: 0]
  ------------------
  961|      0|      release_golden = refresh_golden || same_resoln;
  ------------------
  |  Branch (961:24): [True: 0, False: 0]
  |  Branch (961:42): [True: 0, False: 0]
  ------------------
  962|      0|    }
  963|   386k|    if (buf != NULL && (!golden_ref || (golden_ref && release_golden))) {
  ------------------
  |  Branch (963:9): [True: 55.2k, False: 331k]
  |  Branch (963:25): [True: 55.2k, False: 0]
  |  Branch (963:41): [True: 0, False: 0]
  |  Branch (963:55): [True: 0, False: 0]
  ------------------
  964|  55.2k|      --buf->ref_count;
  965|       |      cpi->scaled_ref_buf[i] = NULL;
  966|  55.2k|    }
  967|   386k|  }
  968|  55.2k|}
encoder.c:set_size_independent_vars:
  930|  73.6k|static inline void set_size_independent_vars(AV1_COMP *cpi) {
  931|  73.6k|  int i;
  932|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  933|  73.6k|  FeatureFlags *const features = &cm->features;
  934|   588k|  for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
  ------------------
  |  Branch (934:24): [True: 515k, False: 73.6k]
  ------------------
  935|   515k|    cm->global_motion[i] = default_warp_params;
  936|   515k|  }
  937|  73.6k|  cpi->gm_info.search_done = 0;
  938|       |
  939|  73.6k|  av1_set_speed_features_framesize_independent(cpi, cpi->speed);
  940|  73.6k|  av1_set_rd_speed_thresholds(cpi);
  941|  73.6k|  features->interp_filter = SWITCHABLE;
  942|  73.6k|  features->switchable_motion_mode = is_switchable_motion_mode_allowed(
  943|  73.6k|      features->allow_warped_motion, cpi->oxcf.motion_mode_cfg.enable_obmc);
  944|  73.6k|}
encoder.c:copy_frame_prob_info:
  817|  18.4k|static inline void copy_frame_prob_info(AV1_COMP *cpi) {
  818|  18.4k|  FrameProbInfo *const frame_probs = &cpi->ppi->frame_probs;
  819|  18.4k|  if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
  ------------------
  |  Branch (819:7): [True: 0, False: 18.4k]
  ------------------
  820|      0|    av1_copy(frame_probs->tx_type_probs, default_tx_type_probs);
  ------------------
  |  |   31|      0|  do {                                              \
  |  |   32|      0|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|      0|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  821|      0|  }
  822|  18.4k|  if (cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  ------------------
  |  Branch (822:7): [True: 12.3k, False: 6.10k]
  ------------------
  823|  12.3k|      cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX) {
  ------------------
  |  Branch (823:7): [True: 0, False: 12.3k]
  ------------------
  824|      0|    av1_copy(frame_probs->obmc_probs, default_obmc_probs);
  ------------------
  |  |   31|      0|  do {                                              \
  |  |   32|      0|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|      0|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  825|      0|  }
  826|  18.4k|  if (cpi->sf.inter_sf.prune_warped_prob_thresh > 0) {
  ------------------
  |  Branch (826:7): [True: 6.10k, False: 12.3k]
  ------------------
  827|  6.10k|    av1_copy(frame_probs->warped_probs, default_warped_probs);
  ------------------
  |  |   31|  6.10k|  do {                                              \
  |  |   32|  6.10k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  6.10k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  6.10k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 6.10k]
  |  |  ------------------
  ------------------
  828|  6.10k|  }
  829|  18.4k|  if (cpi->sf.interp_sf.adaptive_interp_filter_search == 2) {
  ------------------
  |  Branch (829:7): [True: 12.3k, False: 6.10k]
  ------------------
  830|  12.3k|    av1_copy(frame_probs->switchable_interp_probs,
  ------------------
  |  |   31|  12.3k|  do {                                              \
  |  |   32|  12.3k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  12.3k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  831|  12.3k|             default_switchable_interp_probs);
  832|  12.3k|  }
  833|       |
  834|       |#if CONFIG_FPMT_TEST
  835|       |  if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
  836|       |    FrameProbInfo *const temp_frame_probs = &cpi->ppi->temp_frame_probs;
  837|       |    if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
  838|       |      av1_copy(temp_frame_probs->tx_type_probs, default_tx_type_probs);
  839|       |    }
  840|       |    if (cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  841|       |        cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX) {
  842|       |      av1_copy(temp_frame_probs->obmc_probs, default_obmc_probs);
  843|       |    }
  844|       |    if (cpi->sf.inter_sf.prune_warped_prob_thresh > 0) {
  845|       |      av1_copy(temp_frame_probs->warped_probs, default_warped_probs);
  846|       |    }
  847|       |    if (cpi->sf.interp_sf.adaptive_interp_filter_search == 2) {
  848|       |      av1_copy(temp_frame_probs->switchable_interp_probs,
  849|       |               default_switchable_interp_probs);
  850|       |    }
  851|       |
  852|       |    FrameProbInfo *const temp_frame_probs_simulation =
  853|       |        &cpi->ppi->temp_frame_probs_simulation;
  854|       |    if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
  855|       |      av1_copy(temp_frame_probs_simulation->tx_type_probs,
  856|       |               default_tx_type_probs);
  857|       |    }
  858|       |    if (cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  859|       |        cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX) {
  860|       |      av1_copy(temp_frame_probs_simulation->obmc_probs, default_obmc_probs);
  861|       |    }
  862|       |    if (cpi->sf.inter_sf.prune_warped_prob_thresh > 0) {
  863|       |      av1_copy(temp_frame_probs_simulation->warped_probs, default_warped_probs);
  864|       |    }
  865|       |    if (cpi->sf.interp_sf.adaptive_interp_filter_search == 2) {
  866|       |      av1_copy(temp_frame_probs_simulation->switchable_interp_probs,
  867|       |               default_switchable_interp_probs);
  868|       |    }
  869|       |  }
  870|       |#endif
  871|  18.4k|}
encoder.c:refresh_reference_frames:
  984|  73.6k|static inline void refresh_reference_frames(AV1_COMP *cpi) {
  985|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  986|       |  // All buffers are refreshed for shown keyframes and S-frames.
  987|       |  // In case of RT, golden frame refreshes the 6th slot and other reference
  988|       |  // frames refresh slots 0 to 5. Slot 7 is not refreshed by any reference
  989|       |  // frame. Thus, only 7 buffers are refreshed for keyframes and S-frames
  990|       |  // instead of 8.
  991|  73.6k|  int num_ref_buffers = REF_FRAMES;
  992|  73.6k|  if (reduce_num_ref_buffers(cpi)) {
  ------------------
  |  Branch (992:7): [True: 0, False: 73.6k]
  ------------------
  993|      0|    const int refresh_all_bufs =
  994|      0|        (cpi->ppi->gf_group.refbuf_state[cpi->gf_frame_index] == REFBUF_RESET ||
  ------------------
  |  Branch (994:10): [True: 0, False: 0]
  ------------------
  995|      0|         frame_is_sframe(cm));
  ------------------
  |  Branch (995:10): [True: 0, False: 0]
  ------------------
  996|      0|    assert(IMPLIES(((cm->current_frame.refresh_frame_flags >> 7) & 1) == 1,
  997|      0|                   refresh_all_bufs));
  998|      0|    (void)refresh_all_bufs;
  999|      0|    num_ref_buffers--;
 1000|      0|  }
 1001|       |
 1002|   662k|  for (int ref_frame = 0; ref_frame < num_ref_buffers; ref_frame++) {
  ------------------
  |  Branch (1002:27): [True: 588k, False: 73.6k]
  ------------------
 1003|   588k|    if (((cm->current_frame.refresh_frame_flags >> ref_frame) & 1) == 1) {
  ------------------
  |  Branch (1003:9): [True: 202k, False: 386k]
  ------------------
 1004|   202k|      assign_frame_buffer_p(&cm->ref_frame_map[ref_frame], cm->cur_frame);
 1005|   202k|    }
 1006|   588k|  }
 1007|  73.6k|}
encoder.c:reduce_num_ref_buffers:
  975|  73.6k|static inline int reduce_num_ref_buffers(const AV1_COMP *cpi) {
  976|  73.6k|  const SequenceHeader *const seq_params = cpi->common.seq_params;
  977|  73.6k|  return is_one_pass_rt_params(cpi) &&
  ------------------
  |  Branch (977:10): [True: 24.4k, False: 49.2k]
  ------------------
  978|  24.4k|         use_rtc_reference_structure_one_layer(cpi) &&
  ------------------
  |  Branch (978:10): [True: 0, False: 24.4k]
  ------------------
  979|      0|         (seq_params->order_hint_info.enable_order_hint == 0) &&
  ------------------
  |  Branch (979:10): [True: 0, False: 0]
  ------------------
  980|      0|         cpi->rt_reduce_num_ref_buffers;
  ------------------
  |  Branch (980:10): [True: 0, False: 0]
  ------------------
  981|  73.6k|}

av1_alloc_txb_buf:
   29|  30.7k|void av1_alloc_txb_buf(AV1_COMP *cpi) {
   30|  30.7k|  AV1_COMMON *cm = &cpi->common;
   31|  30.7k|  CoeffBufferPool *coeff_buf_pool = &cpi->coeff_buffer_pool;
   32|  30.7k|  int mi_rows = cm->mi_params.mi_rows;
   33|  30.7k|  int mi_cols = cm->mi_params.mi_cols;
   34|  30.7k|  if (cpi->oxcf.frm_dim_cfg.forced_max_frame_width) {
  ------------------
  |  Branch (34:7): [True: 0, False: 30.7k]
  ------------------
   35|      0|    mi_cols = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_width);
   36|      0|  }
   37|  30.7k|  if (cpi->oxcf.frm_dim_cfg.forced_max_frame_height) {
  ------------------
  |  Branch (37:7): [True: 0, False: 30.7k]
  ------------------
   38|      0|    mi_rows = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_height);
   39|      0|  }
   40|  30.7k|  const int num_sb_rows =
   41|  30.7k|      CEIL_POWER_OF_TWO(mi_rows, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  30.7k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   42|  30.7k|  const int num_sb_cols =
   43|  30.7k|      CEIL_POWER_OF_TWO(mi_cols, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  30.7k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
   44|  30.7k|  const int size = num_sb_rows * num_sb_cols;
   45|  30.7k|  const int num_planes = av1_num_planes(cm);
   46|  30.7k|  const int subsampling_x = cm->seq_params->subsampling_x;
   47|  30.7k|  const int subsampling_y = cm->seq_params->subsampling_y;
   48|  30.7k|  const int luma_max_sb_square =
   49|  30.7k|      1 << num_pels_log2_lookup[cm->seq_params->sb_size];
   50|  30.7k|  const int chroma_max_sb_square =
   51|  30.7k|      luma_max_sb_square >> (subsampling_x + subsampling_y);
   52|  30.7k|  const int total_max_sb_square =
   53|  30.7k|      (luma_max_sb_square + (num_planes - 1) * chroma_max_sb_square);
   54|  30.7k|  if ((size_t)size > SIZE_MAX / (size_t)total_max_sb_square) {
  ------------------
  |  Branch (54:7): [True: 0, False: 30.7k]
  ------------------
   55|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
   56|      0|                       "A multiplication would overflow size_t");
   57|      0|  }
   58|  30.7k|  const size_t num_tcoeffs = (size_t)size * (size_t)total_max_sb_square;
   59|  30.7k|  const int txb_unit_size = TX_SIZE_W_MIN * TX_SIZE_H_MIN;
  ------------------
  |  |  231|  30.7k|#define TX_SIZE_W_MIN 4
  ------------------
                const int txb_unit_size = TX_SIZE_W_MIN * TX_SIZE_H_MIN;
  ------------------
  |  |  238|  30.7k|#define TX_SIZE_H_MIN 4
  ------------------
   60|       |
   61|  30.7k|  av1_free_txb_buf(cpi);
   62|       |  // TODO(jingning): This should be further reduced.
   63|  30.7k|  CHECK_MEM_ERROR(cm, cpi->coeff_buffer_base,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|  30.7k|                  aom_malloc(sizeof(*cpi->coeff_buffer_base) * size));
   65|  30.7k|  if (sizeof(*coeff_buf_pool->tcoeff) > SIZE_MAX / num_tcoeffs) {
  ------------------
  |  Branch (65:7): [True: 0, False: 30.7k]
  ------------------
   66|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
   67|      0|                       "A multiplication would overflow size_t");
   68|      0|  }
   69|  30.7k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|  30.7k|      cm, coeff_buf_pool->tcoeff,
   71|  30.7k|      aom_memalign(32, sizeof(*coeff_buf_pool->tcoeff) * num_tcoeffs));
   72|  30.7k|  if (sizeof(*coeff_buf_pool->eobs) > SIZE_MAX / num_tcoeffs) {
  ------------------
  |  Branch (72:7): [True: 0, False: 30.7k]
  ------------------
   73|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
   74|      0|                       "A multiplication would overflow size_t");
   75|      0|  }
   76|  30.7k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  30.7k|      cm, coeff_buf_pool->eobs,
   78|  30.7k|      aom_malloc(sizeof(*coeff_buf_pool->eobs) * num_tcoeffs / txb_unit_size));
   79|  30.7k|  if (sizeof(*coeff_buf_pool->entropy_ctx) > SIZE_MAX / num_tcoeffs) {
  ------------------
  |  Branch (79:7): [True: 0, False: 30.7k]
  ------------------
   80|      0|    aom_internal_error(cm->error, AOM_CODEC_ERROR,
   81|      0|                       "A multiplication would overflow size_t");
   82|      0|  }
   83|  30.7k|  CHECK_MEM_ERROR(cm, coeff_buf_pool->entropy_ctx,
  ------------------
  |  |   51|  30.7k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  30.7k|  do {                                                    \
  |  |  |  |   72|  30.7k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  30.7k|    lval = (expr);                                        \
  |  |  |  |   74|  30.7k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 30.7k]
  |  |  |  |  ------------------
  |  |  |  |   75|  30.7k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  30.7k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 30.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  30.7k|                  aom_malloc(sizeof(*coeff_buf_pool->entropy_ctx) *
   85|  30.7k|                             num_tcoeffs / txb_unit_size));
   86|       |
   87|  30.7k|  tran_low_t *tcoeff_ptr = coeff_buf_pool->tcoeff;
   88|  30.7k|  uint16_t *eob_ptr = coeff_buf_pool->eobs;
   89|  30.7k|  uint8_t *entropy_ctx_ptr = coeff_buf_pool->entropy_ctx;
   90|  95.2k|  for (int i = 0; i < size; i++) {
  ------------------
  |  Branch (90:19): [True: 64.5k, False: 30.7k]
  ------------------
   91|   179k|    for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (91:25): [True: 114k, False: 64.5k]
  ------------------
   92|   114k|      const int max_sb_square =
   93|   114k|          (plane == AOM_PLANE_Y) ? luma_max_sb_square : chroma_max_sb_square;
  ------------------
  |  |  281|   114k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (93:11): [True: 64.5k, False: 50.4k]
  ------------------
   94|   114k|      cpi->coeff_buffer_base[i].tcoeff[plane] = tcoeff_ptr;
   95|   114k|      cpi->coeff_buffer_base[i].eobs[plane] = eob_ptr;
   96|   114k|      cpi->coeff_buffer_base[i].entropy_ctx[plane] = entropy_ctx_ptr;
   97|   114k|      tcoeff_ptr += max_sb_square;
   98|   114k|      eob_ptr += max_sb_square / txb_unit_size;
   99|   114k|      entropy_ctx_ptr += max_sb_square / txb_unit_size;
  100|   114k|    }
  101|  64.5k|  }
  102|  30.7k|}
av1_free_txb_buf:
  104|  49.1k|void av1_free_txb_buf(AV1_COMP *cpi) {
  105|  49.1k|  CoeffBufferPool *coeff_buf_pool = &cpi->coeff_buffer_pool;
  106|  49.1k|  aom_free(cpi->coeff_buffer_base);
  107|  49.1k|  cpi->coeff_buffer_base = NULL;
  108|  49.1k|  aom_free(coeff_buf_pool->tcoeff);
  109|  49.1k|  coeff_buf_pool->tcoeff = NULL;
  110|  49.1k|  aom_free(coeff_buf_pool->eobs);
  111|  49.1k|  coeff_buf_pool->eobs = NULL;
  112|  49.1k|  aom_free(coeff_buf_pool->entropy_ctx);
  113|       |  coeff_buf_pool->entropy_ctx = NULL;
  114|  49.1k|}
av1_get_eob_pos_token:
  149|   230M|int av1_get_eob_pos_token(const int eob, int *const extra) {
  150|   230M|  int t;
  151|       |
  152|   230M|  if (eob < 33) {
  ------------------
  |  Branch (152:7): [True: 167M, False: 63.0M]
  ------------------
  153|   167M|    t = eob_to_pos_small[eob];
  154|   167M|  } else {
  155|  63.0M|    const int e = AOMMIN((eob - 1) >> 5, 16);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 65.0M, False: 18.4E]
  |  |  ------------------
  ------------------
  156|  63.0M|    t = eob_to_pos_large[e];
  157|  63.0M|  }
  158|       |
  159|   230M|  *extra = eob - av1_eob_group_start[t];
  160|       |
  161|   230M|  return t;
  162|   230M|}
av1_write_coeffs_txb:
  303|  5.24M|                          int block, TX_SIZE tx_size) {
  304|  5.24M|  MACROBLOCKD *xd = &x->e_mbd;
  305|  5.24M|  const CB_COEFF_BUFFER *cb_coef_buff = x->cb_coef_buff;
  306|  5.24M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  307|  5.24M|  const int txb_offset = x->mbmi_ext_frame->cb_offset[plane_type] /
  308|  5.24M|                         (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  231|  5.24M|#define TX_SIZE_W_MIN 4
  ------------------
                                       (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  238|  5.24M|#define TX_SIZE_H_MIN 4
  ------------------
  309|  5.24M|  const uint16_t *eob_txb = cb_coef_buff->eobs[plane] + txb_offset;
  310|  5.24M|  const uint16_t eob = eob_txb[block];
  311|  5.24M|  const uint8_t *entropy_ctx = cb_coef_buff->entropy_ctx[plane] + txb_offset;
  312|  5.24M|  const int txb_skip_ctx = entropy_ctx[block] & TXB_SKIP_CTX_MASK;
  ------------------
  |  |   28|  5.24M|#define TXB_SKIP_CTX_MASK 15
  ------------------
  313|  5.24M|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  314|  5.24M|  FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  315|  5.24M|  aom_write_symbol(w, eob == 0, ec_ctx->txb_skip_cdf[txs_ctx][txb_skip_ctx], 2);
  316|  5.24M|  if (eob == 0) return;
  ------------------
  |  Branch (316:7): [True: 301k, False: 4.94M]
  ------------------
  317|       |
  318|  4.94M|  const TX_TYPE tx_type =
  319|  4.94M|      av1_get_tx_type(xd, plane_type, blk_row, blk_col, tx_size,
  320|  4.94M|                      cm->features.reduced_tx_set_used);
  321|       |  // Only y plane's tx_type is transmitted
  322|  4.94M|  if (plane == 0) {
  ------------------
  |  Branch (322:7): [True: 3.43M, False: 1.51M]
  ------------------
  323|  3.43M|    av1_write_tx_type(cm, xd, tx_type, tx_size, w);
  324|  3.43M|  }
  325|       |
  326|  4.94M|  int eob_extra;
  327|  4.94M|  const int eob_pt = av1_get_eob_pos_token(eob, &eob_extra);
  328|  4.94M|  const int eob_multi_size = txsize_log2_minus4[tx_size];
  329|  4.94M|  const TX_CLASS tx_class = tx_type_to_class[tx_type];
  330|  4.94M|  const int eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1;
  ------------------
  |  Branch (330:29): [True: 4.61M, False: 325k]
  ------------------
  331|  4.94M|  switch (eob_multi_size) {
  332|  2.51M|    case 0:
  ------------------
  |  Branch (332:5): [True: 2.51M, False: 2.43M]
  ------------------
  333|  2.51M|      aom_write_symbol(w, eob_pt - 1,
  334|  2.51M|                       ec_ctx->eob_flag_cdf16[plane_type][eob_multi_ctx], 5);
  335|  2.51M|      break;
  336|   333k|    case 1:
  ------------------
  |  Branch (336:5): [True: 333k, False: 4.61M]
  ------------------
  337|   333k|      aom_write_symbol(w, eob_pt - 1,
  338|   333k|                       ec_ctx->eob_flag_cdf32[plane_type][eob_multi_ctx], 6);
  339|   333k|      break;
  340|  1.92M|    case 2:
  ------------------
  |  Branch (340:5): [True: 1.92M, False: 3.01M]
  ------------------
  341|  1.92M|      aom_write_symbol(w, eob_pt - 1,
  342|  1.92M|                       ec_ctx->eob_flag_cdf64[plane_type][eob_multi_ctx], 7);
  343|  1.92M|      break;
  344|  56.7k|    case 3:
  ------------------
  |  Branch (344:5): [True: 56.7k, False: 4.88M]
  ------------------
  345|  56.7k|      aom_write_symbol(w, eob_pt - 1,
  346|  56.7k|                       ec_ctx->eob_flag_cdf128[plane_type][eob_multi_ctx], 8);
  347|  56.7k|      break;
  348|   125k|    case 4:
  ------------------
  |  Branch (348:5): [True: 125k, False: 4.82M]
  ------------------
  349|   125k|      aom_write_symbol(w, eob_pt - 1,
  350|   125k|                       ec_ctx->eob_flag_cdf256[plane_type][eob_multi_ctx], 9);
  351|   125k|      break;
  352|  5.92k|    case 5:
  ------------------
  |  Branch (352:5): [True: 5.92k, False: 4.93M]
  ------------------
  353|  5.92k|      aom_write_symbol(w, eob_pt - 1,
  354|  5.92k|                       ec_ctx->eob_flag_cdf512[plane_type][eob_multi_ctx], 10);
  355|  5.92k|      break;
  356|  10.7k|    default:
  ------------------
  |  Branch (356:5): [True: 10.7k, False: 4.93M]
  ------------------
  357|  10.7k|      aom_write_symbol(w, eob_pt - 1,
  358|  10.7k|                       ec_ctx->eob_flag_cdf1024[plane_type][eob_multi_ctx], 11);
  359|  10.7k|      break;
  360|  4.94M|  }
  361|       |
  362|  4.90M|  const int eob_offset_bits = av1_eob_offset_bits[eob_pt];
  363|  4.90M|  if (eob_offset_bits > 0) {
  ------------------
  |  Branch (363:7): [True: 4.61M, False: 285k]
  ------------------
  364|  4.61M|    const int eob_ctx = eob_pt - 3;
  365|  4.61M|    int eob_shift = eob_offset_bits - 1;
  366|  4.61M|    int bit = (eob_extra & (1 << eob_shift)) ? 1 : 0;
  ------------------
  |  Branch (366:15): [True: 3.72M, False: 893k]
  ------------------
  367|  4.61M|    aom_write_symbol(w, bit,
  368|  4.61M|                     ec_ctx->eob_extra_cdf[txs_ctx][plane_type][eob_ctx], 2);
  369|  16.6M|    for (int i = 1; i < eob_offset_bits; i++) {
  ------------------
  |  Branch (369:21): [True: 12.0M, False: 4.61M]
  ------------------
  370|  12.0M|      eob_shift = eob_offset_bits - 1 - i;
  371|  12.0M|      bit = (eob_extra & (1 << eob_shift)) ? 1 : 0;
  ------------------
  |  Branch (371:13): [True: 8.99M, False: 3.07M]
  ------------------
  372|  12.0M|      aom_write_bit(w, bit);
  373|  12.0M|    }
  374|  4.61M|  }
  375|       |
  376|  4.90M|  const int width = get_txb_wide(tx_size);
  377|  4.90M|  const int height = get_txb_high(tx_size);
  378|  4.90M|  uint8_t levels_buf[TX_PAD_2D];
  379|  4.90M|  uint8_t *const levels = set_levels(levels_buf, height);
  380|  4.90M|  const tran_low_t *tcoeff_txb =
  381|  4.90M|      cb_coef_buff->tcoeff[plane] + x->mbmi_ext_frame->cb_offset[plane_type];
  382|  4.90M|  const tran_low_t *tcoeff = tcoeff_txb + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  4.90M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  383|  4.90M|  av1_txb_init_levels(tcoeff, width, height, levels);
  384|  4.90M|  const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type);
  385|  4.90M|  const int16_t *const scan = scan_order->scan;
  386|  4.90M|  DECLARE_ALIGNED(16, int8_t, coeff_contexts[MAX_TX_SQUARE]);
  ------------------
  |  |   19|  4.90M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  387|  4.90M|  av1_get_nz_map_contexts(levels, scan, eob, tx_size, tx_class, coeff_contexts);
  ------------------
  |  |  390|  4.90M|#define av1_get_nz_map_contexts av1_get_nz_map_contexts_sse2
  ------------------
  388|       |
  389|  4.90M|  const int bhl = get_txb_bhl(tx_size);
  390|   128M|  for (int c = eob - 1; c >= 0; --c) {
  ------------------
  |  Branch (390:25): [True: 123M, False: 4.90M]
  ------------------
  391|   123M|    const int pos = scan[c];
  392|   123M|    const int coeff_ctx = coeff_contexts[pos];
  393|   123M|    const tran_low_t v = tcoeff[pos];
  394|   123M|    const tran_low_t level = abs(v);
  395|       |
  396|   123M|    if (c == eob - 1) {
  ------------------
  |  Branch (396:9): [True: 4.95M, False: 118M]
  ------------------
  397|  4.95M|      aom_write_symbol(
  398|  4.95M|          w, AOMMIN(level, 3) - 1,
  ------------------
  |  |   34|  4.95M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.36M, False: 1.59M]
  |  |  ------------------
  ------------------
  399|  4.95M|          ec_ctx->coeff_base_eob_cdf[txs_ctx][plane_type][coeff_ctx], 3);
  400|   118M|    } else {
  401|   118M|      aom_write_symbol(w, AOMMIN(level, 3),
  ------------------
  |  |   34|   118M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 77.8M, False: 40.3M]
  |  |  ------------------
  ------------------
  402|   118M|                       ec_ctx->coeff_base_cdf[txs_ctx][plane_type][coeff_ctx],
  403|   118M|                       4);
  404|   118M|    }
  405|   123M|    if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   123M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (405:9): [True: 46.8M, False: 76.3M]
  ------------------
  406|       |      // level is above 1.
  407|  46.8M|      const int base_range = level - 1 - NUM_BASE_LEVELS;
  ------------------
  |  |   46|  46.8M|#define NUM_BASE_LEVELS 2
  ------------------
  408|  46.8M|      const int br_ctx = get_br_ctx(levels, pos, bhl, tx_class);
  409|  46.8M|      aom_cdf_prob *cdf =
  410|  46.8M|          ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type][br_ctx];
  ------------------
  |  |   34|  46.8M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 46.0M, False: 757k]
  |  |  ------------------
  ------------------
  411|   119M|      for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|   119M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   119M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                    for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|  72.6M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (411:25): [True: 106M, False: 13.2M]
  ------------------
  412|   106M|        const int k = AOMMIN(base_range - idx, BR_CDF_SIZE - 1);
  ------------------
  |  |   34|   106M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 33.4M, False: 72.7M]
  |  |  ------------------
  ------------------
  413|   106M|        aom_write_symbol(w, k, cdf, BR_CDF_SIZE);
  ------------------
  |  |   48|   106M|#define BR_CDF_SIZE (4)
  ------------------
  414|   106M|        if (k < BR_CDF_SIZE - 1) break;
  ------------------
  |  |   48|   106M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (414:13): [True: 33.5M, False: 72.6M]
  ------------------
  415|   106M|      }
  416|  46.8M|    }
  417|   123M|  }
  418|       |
  419|       |  // Loop to code all signs in the transform block,
  420|       |  // starting with the sign of DC (if applicable)
  421|   143M|  for (int c = 0; c < eob; ++c) {
  ------------------
  |  Branch (421:19): [True: 138M, False: 4.90M]
  ------------------
  422|   138M|    const tran_low_t v = tcoeff[scan[c]];
  423|   138M|    const tran_low_t level = abs(v);
  424|   138M|    const int sign = (v < 0) ? 1 : 0;
  ------------------
  |  Branch (424:22): [True: 46.0M, False: 92.7M]
  ------------------
  425|   138M|    if (level) {
  ------------------
  |  Branch (425:9): [True: 91.9M, False: 46.7M]
  ------------------
  426|  91.9M|      if (c == 0) {
  ------------------
  |  Branch (426:11): [True: 4.34M, False: 87.6M]
  ------------------
  427|  4.34M|        const int dc_sign_ctx =
  428|  4.34M|            (entropy_ctx[block] >> DC_SIGN_CTX_SHIFT) & DC_SIGN_CTX_MASK;
  ------------------
  |  |   29|  4.34M|#define DC_SIGN_CTX_SHIFT 4
  ------------------
                          (entropy_ctx[block] >> DC_SIGN_CTX_SHIFT) & DC_SIGN_CTX_MASK;
  ------------------
  |  |   30|  4.34M|#define DC_SIGN_CTX_MASK 3
  ------------------
  429|  4.34M|        aom_write_symbol(w, sign, ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx],
  430|  4.34M|                         2);
  431|  87.6M|      } else {
  432|  87.6M|        aom_write_bit(w, sign);
  433|  87.6M|      }
  434|  91.9M|      if (level > COEFF_BASE_RANGE + NUM_BASE_LEVELS)
  ------------------
  |  |   49|  91.9M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  91.9M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                    if (level > COEFF_BASE_RANGE + NUM_BASE_LEVELS)
  ------------------
  |  |   46|  91.9M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (434:11): [True: 15.0M, False: 76.9M]
  ------------------
  435|  15.0M|        write_golomb(w, level - COEFF_BASE_RANGE - 1 - NUM_BASE_LEVELS);
  ------------------
  |  |   49|  15.0M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  15.0M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                      write_golomb(w, level - COEFF_BASE_RANGE - 1 - NUM_BASE_LEVELS);
  ------------------
  |  |   46|  15.0M|#define NUM_BASE_LEVELS 2
  ------------------
  436|  91.9M|    }
  437|   138M|  }
  438|  4.90M|}
av1_write_intra_coeffs_mb:
  441|  1.51M|                               aom_writer *w, BLOCK_SIZE bsize) {
  442|  1.51M|  MACROBLOCKD *xd = &x->e_mbd;
  443|  1.51M|  const int num_planes = av1_num_planes(cm);
  444|  1.51M|  int block[MAX_MB_PLANE] = { 0 };
  445|  1.51M|  int row, col;
  446|  1.51M|  assert(bsize == get_plane_block_size(bsize, xd->plane[0].subsampling_x,
  447|  1.51M|                                       xd->plane[0].subsampling_y));
  448|  1.51M|  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
  449|  1.51M|  const int max_blocks_high = max_block_high(xd, bsize, 0);
  450|  1.51M|  const BLOCK_SIZE max_unit_bsize = BLOCK_64X64;
  451|  1.51M|  int mu_blocks_wide = mi_size_wide[max_unit_bsize];
  452|  1.51M|  int mu_blocks_high = mi_size_high[max_unit_bsize];
  453|  1.51M|  mu_blocks_wide = AOMMIN(max_blocks_wide, mu_blocks_wide);
  ------------------
  |  |   34|  1.51M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.51M, False: 1.31k]
  |  |  ------------------
  ------------------
  454|  1.51M|  mu_blocks_high = AOMMIN(max_blocks_high, mu_blocks_high);
  ------------------
  |  |   34|  1.51M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.51M, False: 1.23k]
  |  |  ------------------
  ------------------
  455|       |
  456|  3.03M|  for (row = 0; row < max_blocks_high; row += mu_blocks_high) {
  ------------------
  |  Branch (456:17): [True: 1.51M, False: 1.51M]
  ------------------
  457|  3.03M|    for (col = 0; col < max_blocks_wide; col += mu_blocks_wide) {
  ------------------
  |  Branch (457:19): [True: 1.51M, False: 1.51M]
  ------------------
  458|  4.31M|      for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (458:27): [True: 2.80M, False: 1.50M]
  ------------------
  459|  2.80M|        if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (459:13): [True: 1.30M, False: 1.50M]
  |  Branch (459:22): [True: 12.0k, False: 1.29M]
  ------------------
  460|  2.79M|        const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
  461|  2.79M|        const int stepr = tx_size_high_unit[tx_size];
  462|  2.79M|        const int stepc = tx_size_wide_unit[tx_size];
  463|  2.79M|        const int step = stepr * stepc;
  464|  2.79M|        const struct macroblockd_plane *const pd = &xd->plane[plane];
  465|  2.79M|        const int unit_height = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  5.58M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 2.79M]
  |  |  ------------------
  ------------------
  466|  2.79M|            AOMMIN(mu_blocks_high + row, max_blocks_high), pd->subsampling_y);
  467|  2.79M|        const int unit_width = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  5.58M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |  |  Branch (41:41): [True: 0, False: 2.79M]
  |  |  ------------------
  ------------------
  468|  2.79M|            AOMMIN(mu_blocks_wide + col, max_blocks_wide), pd->subsampling_x);
  469|  6.00M|        for (int blk_row = row >> pd->subsampling_y; blk_row < unit_height;
  ------------------
  |  Branch (469:54): [True: 3.21M, False: 2.79M]
  ------------------
  470|  3.21M|             blk_row += stepr) {
  471|  7.27M|          for (int blk_col = col >> pd->subsampling_x; blk_col < unit_width;
  ------------------
  |  Branch (471:56): [True: 4.06M, False: 3.21M]
  ------------------
  472|  4.06M|               blk_col += stepc) {
  473|  4.06M|            av1_write_coeffs_txb(cm, x, w, blk_row, blk_col, plane,
  474|  4.06M|                                 block[plane], tx_size);
  475|  4.06M|            block[plane] += step;
  476|  4.06M|          }
  477|  3.21M|        }
  478|  2.79M|      }
  479|  1.51M|    }
  480|  1.51M|  }
  481|  1.51M|}
av1_get_txb_entropy_context:
  484|   145M|                                    const SCAN_ORDER *scan_order, int eob) {
  485|   145M|  const int16_t *const scan = scan_order->scan;
  486|   145M|  int cul_level = 0;
  487|   145M|  int c;
  488|       |
  489|   145M|  if (eob == 0) return 0;
  ------------------
  |  Branch (489:7): [True: 4.35M, False: 141M]
  ------------------
  490|   851M|  for (c = 0; c < eob; ++c) {
  ------------------
  |  Branch (490:15): [True: 815M, False: 35.7M]
  ------------------
  491|   815M|    const int32_t v = qcoeff[scan[c]];
  492|   815M|    if (!v) continue;
  ------------------
  |  Branch (492:9): [True: 447M, False: 367M]
  ------------------
  493|   367M|    cul_level += abs(v);
  494|   367M|    if (cul_level > COEFF_CONTEXT_MASK) break;
  ------------------
  |  |   52|   367M|#define COEFF_CONTEXT_MASK ((1 << COEFF_CONTEXT_BITS) - 1)
  |  |  ------------------
  |  |  |  |   51|   367M|#define COEFF_CONTEXT_BITS 3
  |  |  ------------------
  ------------------
  |  Branch (494:9): [True: 105M, False: 262M]
  ------------------
  495|   367M|  }
  496|       |
  497|   141M|  cul_level = AOMMIN(COEFF_CONTEXT_MASK, cul_level);
  ------------------
  |  |   34|   141M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 105M, False: 35.6M]
  |  |  ------------------
  ------------------
  498|   141M|  set_dc_sign(&cul_level, qcoeff[0]);
  499|       |
  500|   141M|  return (uint8_t)cul_level;
  501|   145M|}
av1_update_and_record_txb_context:
  583|  16.2M|                                       TX_SIZE tx_size, void *arg) {
  584|  16.2M|  struct tokenize_b_args *const args = arg;
  585|  16.2M|  const AV1_COMP *cpi = args->cpi;
  586|  16.2M|  const AV1_COMMON *cm = &cpi->common;
  587|  16.2M|  ThreadData *const td = args->td;
  588|  16.2M|  MACROBLOCK *const x = &td->mb;
  589|  16.2M|  MACROBLOCKD *const xd = &x->e_mbd;
  590|  16.2M|  struct macroblock_plane *p = &x->plane[plane];
  591|  16.2M|  struct macroblockd_plane *pd = &xd->plane[plane];
  592|  16.2M|  const int eob = p->eobs[block];
  593|  16.2M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|  16.2M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  594|  16.2M|  tran_low_t *qcoeff = p->qcoeff + block_offset;
  595|  16.2M|  const PLANE_TYPE plane_type = pd->plane_type;
  596|  16.2M|  const TX_TYPE tx_type =
  597|  16.2M|      av1_get_tx_type(xd, plane_type, blk_row, blk_col, tx_size,
  598|  16.2M|                      cm->features.reduced_tx_set_used);
  599|  16.2M|  const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type);
  600|  16.2M|  tran_low_t *tcoeff;
  601|  16.2M|  assert(args->dry_run != DRY_RUN_COSTCOEFFS);
  602|  16.2M|  if (args->dry_run == OUTPUT_ENABLED) {
  ------------------
  |  Branch (602:7): [True: 5.30M, False: 10.8M]
  ------------------
  603|  5.30M|    MB_MODE_INFO *mbmi = xd->mi[0];
  604|  5.30M|    TXB_CTX txb_ctx;
  605|  5.30M|    get_txb_ctx(plane_bsize, tx_size, plane,
  606|  5.30M|                pd->above_entropy_context + blk_col,
  607|  5.30M|                pd->left_entropy_context + blk_row, &txb_ctx);
  608|  5.30M|    const int bhl = get_txb_bhl(tx_size);
  609|  5.30M|    const int width = get_txb_wide(tx_size);
  610|  5.30M|    const int height = get_txb_high(tx_size);
  611|  5.30M|    const uint8_t allow_update_cdf = args->allow_update_cdf;
  612|  5.30M|    const TX_SIZE txsize_ctx = get_txsize_entropy_ctx(tx_size);
  613|  5.30M|    FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
  614|       |#if CONFIG_ENTROPY_STATS
  615|       |    int cdf_idx = cm->coef_cdf_category;
  616|       |    ++td->counts->txb_skip[cdf_idx][txsize_ctx][txb_ctx.txb_skip_ctx][eob == 0];
  617|       |#endif  // CONFIG_ENTROPY_STATS
  618|  5.30M|    if (allow_update_cdf) {
  ------------------
  |  Branch (618:9): [True: 5.30M, False: 4.12k]
  ------------------
  619|  5.30M|      update_cdf(ec_ctx->txb_skip_cdf[txsize_ctx][txb_ctx.txb_skip_ctx],
  620|  5.30M|                 eob == 0, 2);
  621|  5.30M|    }
  622|       |
  623|  5.30M|    CB_COEFF_BUFFER *cb_coef_buff = x->cb_coef_buff;
  624|  5.30M|    const int txb_offset = x->mbmi_ext_frame->cb_offset[plane_type] /
  625|  5.30M|                           (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  231|  5.30M|#define TX_SIZE_W_MIN 4
  ------------------
                                         (TX_SIZE_W_MIN * TX_SIZE_H_MIN);
  ------------------
  |  |  238|  5.30M|#define TX_SIZE_H_MIN 4
  ------------------
  626|  5.30M|    uint16_t *eob_txb = cb_coef_buff->eobs[plane] + txb_offset;
  627|  5.30M|    uint8_t *const entropy_ctx = cb_coef_buff->entropy_ctx[plane] + txb_offset;
  628|  5.30M|    entropy_ctx[block] = txb_ctx.txb_skip_ctx;
  629|  5.30M|    eob_txb[block] = eob;
  630|       |
  631|  5.30M|    if (eob == 0) {
  ------------------
  |  Branch (631:9): [True: 303k, False: 5.00M]
  ------------------
  632|   303k|      av1_set_entropy_contexts(xd, pd, plane, plane_bsize, tx_size, 0, blk_col,
  633|   303k|                               blk_row);
  634|   303k|      return;
  635|   303k|    }
  636|  5.00M|    const int segment_id = mbmi->segment_id;
  637|  5.00M|    const int seg_eob = av1_get_tx_eob(&cpi->common.seg, segment_id, tx_size);
  638|  5.00M|    tran_low_t *tcoeff_txb =
  639|  5.00M|        cb_coef_buff->tcoeff[plane] + x->mbmi_ext_frame->cb_offset[plane_type];
  640|  5.00M|    tcoeff = tcoeff_txb + block_offset;
  641|  5.00M|    memcpy(tcoeff, qcoeff, sizeof(*tcoeff) * seg_eob);
  642|       |
  643|  5.00M|    uint8_t levels_buf[TX_PAD_2D];
  644|  5.00M|    uint8_t *const levels = set_levels(levels_buf, height);
  645|  5.00M|    av1_txb_init_levels(tcoeff, width, height, levels);
  646|  5.00M|    update_tx_type_count(cpi, cm, xd, blk_row, blk_col, plane, tx_size,
  647|  5.00M|                         td->counts, allow_update_cdf);
  648|       |
  649|  5.00M|    const TX_CLASS tx_class = tx_type_to_class[tx_type];
  650|  5.00M|    const int16_t *const scan = scan_order->scan;
  651|       |
  652|       |    // record tx type usage
  653|  5.00M|    td->rd_counts.tx_type_used[tx_size][tx_type]++;
  654|       |
  655|       |#if CONFIG_ENTROPY_STATS
  656|       |    update_eob_context(cdf_idx, eob, tx_size, tx_class, plane_type, ec_ctx,
  657|       |                       td->counts, allow_update_cdf);
  658|       |#else
  659|  5.00M|    update_eob_context(eob, tx_size, tx_class, plane_type, ec_ctx,
  660|  5.00M|                       allow_update_cdf);
  661|  5.00M|#endif
  662|       |
  663|  5.00M|    DECLARE_ALIGNED(16, int8_t, coeff_contexts[MAX_TX_SQUARE]);
  ------------------
  |  |   19|  5.00M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  664|  5.00M|    av1_get_nz_map_contexts(levels, scan, eob, tx_size, tx_class,
  ------------------
  |  |  390|  5.00M|#define av1_get_nz_map_contexts av1_get_nz_map_contexts_sse2
  ------------------
  665|  5.00M|                            coeff_contexts);
  666|       |
  667|   152M|    for (int c = eob - 1; c >= 0; --c) {
  ------------------
  |  Branch (667:27): [True: 147M, False: 5.00M]
  ------------------
  668|   147M|      const int pos = scan[c];
  669|   147M|      const int coeff_ctx = coeff_contexts[pos];
  670|   147M|      const tran_low_t v = qcoeff[pos];
  671|   147M|      const tran_low_t level = abs(v);
  672|       |      /* abs_sum_level is needed to decide the job scheduling order of
  673|       |       * pack bitstream multi-threading. This data is not needed if
  674|       |       * multi-threading is disabled. */
  675|   147M|      if (cpi->mt_info.pack_bs_mt_enabled) td->abs_sum_level += level;
  ------------------
  |  Branch (675:11): [True: 100M, False: 47.0M]
  ------------------
  676|       |
  677|   147M|      if (allow_update_cdf) {
  ------------------
  |  Branch (677:11): [True: 147M, False: 18.4E]
  ------------------
  678|   147M|        if (c == eob - 1) {
  ------------------
  |  Branch (678:13): [True: 5.00M, False: 142M]
  ------------------
  679|  5.00M|          assert(coeff_ctx < 4);
  680|  5.00M|          update_cdf(
  681|  5.00M|              ec_ctx->coeff_base_eob_cdf[txsize_ctx][plane_type][coeff_ctx],
  682|  5.00M|              AOMMIN(level, 3) - 1, 3);
  ------------------
  |  |   34|  5.00M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.40M, False: 1.60M]
  |  |  ------------------
  ------------------
  683|   142M|        } else {
  684|   142M|          update_cdf(ec_ctx->coeff_base_cdf[txsize_ctx][plane_type][coeff_ctx],
  685|   142M|                     AOMMIN(level, 3), 4);
  ------------------
  |  |   34|   142M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 93.6M, False: 49.2M]
  |  |  ------------------
  ------------------
  686|   142M|        }
  687|   147M|      }
  688|   147M|      if (c == eob - 1) {
  ------------------
  |  Branch (688:11): [True: 5.00M, False: 142M]
  ------------------
  689|  5.00M|        assert(coeff_ctx < 4);
  690|       |#if CONFIG_ENTROPY_STATS
  691|       |        ++td->counts->coeff_base_eob_multi[cdf_idx][txsize_ctx][plane_type]
  692|       |                                          [coeff_ctx][AOMMIN(level, 3) - 1];
  693|       |      } else {
  694|       |        ++td->counts->coeff_base_multi[cdf_idx][txsize_ctx][plane_type]
  695|       |                                      [coeff_ctx][AOMMIN(level, 3)];
  696|       |#endif
  697|  5.00M|      }
  698|   147M|      if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   147M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (698:11): [True: 51.5M, False: 96.2M]
  ------------------
  699|  51.5M|        const int base_range = level - 1 - NUM_BASE_LEVELS;
  ------------------
  |  |   46|  51.5M|#define NUM_BASE_LEVELS 2
  ------------------
  700|  51.5M|        const int br_ctx = get_br_ctx(levels, pos, bhl, tx_class);
  701|   139M|        for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|   139M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   139M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                      for (int idx = 0; idx < COEFF_BASE_RANGE; idx += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|  88.0M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (701:27): [True: 124M, False: 14.9M]
  ------------------
  702|   124M|          const int k = AOMMIN(base_range - idx, BR_CDF_SIZE - 1);
  ------------------
  |  |   34|   124M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 36.5M, False: 88.0M]
  |  |  ------------------
  ------------------
  703|   124M|          if (allow_update_cdf) {
  ------------------
  |  Branch (703:15): [True: 124M, False: 18.4E]
  ------------------
  704|   124M|            update_cdf(ec_ctx->coeff_br_cdf[AOMMIN(txsize_ctx, TX_32X32)]
  ------------------
  |  |   34|   124M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 121M, False: 3.02M]
  |  |  ------------------
  ------------------
  705|   124M|                                           [plane_type][br_ctx],
  706|   124M|                       k, BR_CDF_SIZE);
  ------------------
  |  |   48|   124M|#define BR_CDF_SIZE (4)
  ------------------
  707|   124M|          }
  708|   420M|          for (int lps = 0; lps < BR_CDF_SIZE - 1; lps++) {
  ------------------
  |  |   48|   420M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (708:29): [True: 332M, False: 88.0M]
  ------------------
  709|       |#if CONFIG_ENTROPY_STATS
  710|       |            ++td->counts->coeff_lps[AOMMIN(txsize_ctx, TX_32X32)][plane_type]
  711|       |                                   [lps][br_ctx][lps == k];
  712|       |#endif  // CONFIG_ENTROPY_STATS
  713|   332M|            if (lps == k) break;
  ------------------
  |  Branch (713:17): [True: 36.6M, False: 295M]
  ------------------
  714|   332M|          }
  715|       |#if CONFIG_ENTROPY_STATS
  716|       |          ++td->counts->coeff_lps_multi[cdf_idx][AOMMIN(txsize_ctx, TX_32X32)]
  717|       |                                       [plane_type][br_ctx][k];
  718|       |#endif
  719|   124M|          if (k < BR_CDF_SIZE - 1) break;
  ------------------
  |  |   48|   124M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (719:15): [True: 36.6M, False: 88.0M]
  ------------------
  720|   124M|        }
  721|  51.5M|      }
  722|   147M|    }
  723|       |    // Update the context needed to code the DC sign (if applicable)
  724|  5.00M|    if (tcoeff[0] != 0) {
  ------------------
  |  Branch (724:9): [True: 4.40M, False: 601k]
  ------------------
  725|  4.40M|      const int dc_sign = (tcoeff[0] < 0) ? 1 : 0;
  ------------------
  |  Branch (725:27): [True: 2.22M, False: 2.17M]
  ------------------
  726|  4.40M|      const int dc_sign_ctx = txb_ctx.dc_sign_ctx;
  727|       |#if CONFIG_ENTROPY_STATS
  728|       |      ++td->counts->dc_sign[plane_type][dc_sign_ctx][dc_sign];
  729|       |#endif  // CONFIG_ENTROPY_STATS
  730|  4.40M|      if (allow_update_cdf)
  ------------------
  |  Branch (730:11): [True: 4.40M, False: 18.4E]
  ------------------
  731|  4.40M|        update_cdf(ec_ctx->dc_sign_cdf[plane_type][dc_sign_ctx], dc_sign, 2);
  732|  4.40M|      entropy_ctx[block] |= dc_sign_ctx << DC_SIGN_CTX_SHIFT;
  ------------------
  |  |   29|  4.40M|#define DC_SIGN_CTX_SHIFT 4
  ------------------
  733|  4.40M|    }
  734|  10.8M|  } else {
  735|  10.8M|    tcoeff = qcoeff;
  736|  10.8M|  }
  737|  15.9M|  const uint8_t cul_level =
  738|  15.9M|      av1_get_txb_entropy_context(tcoeff, scan_order, eob);
  739|  15.9M|  av1_set_entropy_contexts(xd, pd, plane, plane_bsize, tx_size, cul_level,
  740|  15.9M|                           blk_col, blk_row);
  741|  15.9M|}
av1_update_intra_mb_txb_context:
  882|  5.25M|                                     uint8_t allow_update_cdf) {
  883|  5.25M|  const AV1_COMMON *const cm = &cpi->common;
  884|  5.25M|  const int num_planes = av1_num_planes(cm);
  885|  5.25M|  MACROBLOCK *const x = &td->mb;
  886|  5.25M|  MACROBLOCKD *const xd = &x->e_mbd;
  887|  5.25M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  888|  5.25M|  struct tokenize_b_args arg = { cpi, td, 0, allow_update_cdf, dry_run };
  889|  5.25M|  if (mbmi->skip_txfm) {
  ------------------
  |  Branch (889:7): [True: 0, False: 5.25M]
  ------------------
  890|      0|    av1_reset_entropy_context(xd, bsize, num_planes);
  891|      0|    return;
  892|      0|  }
  893|  5.25M|  const foreach_transformed_block_visitor visit =
  894|  5.25M|      allow_update_cdf ? av1_update_and_record_txb_context
  ------------------
  |  Branch (894:7): [True: 5.25M, False: 69]
  ------------------
  895|  5.25M|                       : av1_record_txb_context;
  896|       |
  897|  15.0M|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (897:23): [True: 9.98M, False: 5.08M]
  ------------------
  898|  9.98M|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (898:9): [True: 4.74M, False: 5.24M]
  |  Branch (898:18): [True: 164k, False: 4.57M]
  ------------------
  899|  9.82M|    const struct macroblockd_plane *const pd = &xd->plane[plane];
  900|  9.82M|    const int ss_x = pd->subsampling_x;
  901|  9.82M|    const int ss_y = pd->subsampling_y;
  902|  9.82M|    const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
  903|  9.82M|    av1_foreach_transformed_block_in_plane(xd, plane_bsize, plane, visit, &arg);
  904|  9.82M|  }
  905|  5.25M|}
av1_get_cb_coeff_buffer:
  908|   274k|                                         int mi_col) {
  909|   274k|  const AV1_COMMON *const cm = &cpi->common;
  910|   274k|  const int mib_size_log2 = cm->seq_params->mib_size_log2;
  911|   274k|  int mi_cols = cm->mi_params.mi_cols;
  912|   274k|  if (cpi->oxcf.frm_dim_cfg.forced_max_frame_width) {
  ------------------
  |  Branch (912:7): [True: 0, False: 274k]
  ------------------
  913|      0|    mi_cols = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_width);
  914|      0|  }
  915|   274k|  const int stride = CEIL_POWER_OF_TWO(mi_cols, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|   274k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  916|   274k|  const int offset =
  917|   274k|      (mi_row >> mib_size_log2) * stride + (mi_col >> mib_size_log2);
  918|   274k|  return cpi->coeff_buffer_base + offset;
  919|   274k|}
encodetxb.c:write_golomb:
  116|  15.0M|static void write_golomb(aom_writer *w, int level) {
  117|  15.0M|  int x = level + 1;
  118|  15.0M|  int i = x;
  119|  15.0M|  int length = 0;
  120|       |
  121|  82.7M|  while (i) {
  ------------------
  |  Branch (121:10): [True: 67.7M, False: 15.0M]
  ------------------
  122|  67.7M|    i >>= 1;
  123|  67.7M|    ++length;
  124|  67.7M|  }
  125|  15.0M|  assert(length > 0);
  126|       |
  127|  65.1M|  for (i = 0; i < length - 1; ++i) aom_write_bit(w, 0);
  ------------------
  |  Branch (127:15): [True: 50.1M, False: 15.0M]
  ------------------
  128|       |
  129|  77.9M|  for (i = length - 1; i >= 0; --i) aom_write_bit(w, (x >> i) & 0x01);
  ------------------
  |  Branch (129:24): [True: 62.8M, False: 15.0M]
  ------------------
  130|  15.0M|}
encodetxb.c:update_tx_type_count:
  507|  5.00M|                                 uint8_t allow_update_cdf) {
  508|  5.00M|  MB_MODE_INFO *mbmi = xd->mi[0];
  509|  5.00M|  int is_inter = is_inter_block(mbmi);
  510|  5.00M|  const int reduced_tx_set_used = cm->features.reduced_tx_set_used;
  511|  5.00M|  FRAME_CONTEXT *fc = xd->tile_ctx;
  512|  5.00M|#if !CONFIG_ENTROPY_STATS
  513|  5.00M|  (void)counts;
  514|  5.00M|#endif  // !CONFIG_ENTROPY_STATS
  515|       |
  516|       |  // Only y plane's tx_type is updated
  517|  5.00M|  if (plane > 0) return;
  ------------------
  |  Branch (517:7): [True: 1.54M, False: 3.45M]
  ------------------
  518|  3.45M|  const TX_TYPE tx_type = av1_get_tx_type(xd, PLANE_TYPE_Y, blk_row, blk_col,
  519|  3.45M|                                          tx_size, reduced_tx_set_used);
  520|  3.45M|  if (is_inter) {
  ------------------
  |  Branch (520:7): [True: 861k, False: 2.59M]
  ------------------
  521|   861k|    if (cpi->oxcf.txfm_cfg.use_inter_dct_only) {
  ------------------
  |  Branch (521:9): [True: 0, False: 861k]
  ------------------
  522|      0|      assert(tx_type == DCT_DCT);
  523|      0|    }
  524|  2.59M|  } else {
  525|  2.59M|    if (cpi->oxcf.txfm_cfg.use_intra_dct_only) {
  ------------------
  |  Branch (525:9): [True: 0, False: 2.59M]
  ------------------
  526|      0|      assert(tx_type == DCT_DCT);
  527|  2.59M|    } else if (cpi->oxcf.txfm_cfg.use_intra_default_tx_only) {
  ------------------
  |  Branch (527:16): [True: 0, False: 2.59M]
  ------------------
  528|      0|      const TX_TYPE default_type = get_default_tx_type(
  529|      0|          PLANE_TYPE_Y, xd, tx_size, cpi->use_screen_content_tools);
  530|      0|      (void)default_type;
  531|       |      // TODO(kyslov): We don't always respect use_intra_default_tx_only flag in
  532|       |      // NonRD and REALTIME case. Specifically we ignore it in hybrid inta mode
  533|       |      // search, when picking up intra mode in nonRD inter mode search and in RD
  534|       |      // REALTIME mode when we limit TX type usage.
  535|       |      // We need to fix txfm cfg for these cases. Meanwhile relieving the
  536|       |      // assert.
  537|      0|      assert(tx_type == default_type || cpi->sf.rt_sf.use_nonrd_pick_mode ||
  538|      0|             cpi->oxcf.mode == REALTIME);
  539|      0|    }
  540|  2.59M|  }
  541|       |
  542|  3.45M|  if (get_ext_tx_types(tx_size, is_inter, reduced_tx_set_used) > 1 &&
  ------------------
  |  Branch (542:7): [True: 3.45M, False: 4.12k]
  ------------------
  543|  3.45M|      cm->quant_params.base_qindex > 0 && !mbmi->skip_txfm &&
  ------------------
  |  Branch (543:7): [True: 3.09M, False: 361k]
  |  Branch (543:43): [True: 3.09M, False: 18.4E]
  ------------------
  544|  3.09M|      !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (544:7): [True: 3.09M, False: 189]
  ------------------
  545|  3.09M|    const int eset = get_ext_tx_set(tx_size, is_inter, reduced_tx_set_used);
  546|  3.09M|    if (eset > 0) {
  ------------------
  |  Branch (546:9): [True: 3.09M, False: 598]
  ------------------
  547|  3.09M|      const TxSetType tx_set_type =
  548|  3.09M|          av1_get_ext_tx_set_type(tx_size, is_inter, reduced_tx_set_used);
  549|  3.09M|      if (is_inter) {
  ------------------
  |  Branch (549:11): [True: 691k, False: 2.40M]
  ------------------
  550|   691k|        if (allow_update_cdf) {
  ------------------
  |  Branch (550:13): [True: 691k, False: 18.4E]
  ------------------
  551|   691k|          update_cdf(fc->inter_ext_tx_cdf[eset][txsize_sqr_map[tx_size]],
  552|   691k|                     av1_ext_tx_ind[tx_set_type][tx_type],
  553|   691k|                     av1_num_ext_tx_set[tx_set_type]);
  554|   691k|        }
  555|       |#if CONFIG_ENTROPY_STATS
  556|       |        ++counts->inter_ext_tx[eset][txsize_sqr_map[tx_size]]
  557|       |                              [av1_ext_tx_ind[tx_set_type][tx_type]];
  558|       |#endif  // CONFIG_ENTROPY_STATS
  559|  2.40M|      } else {
  560|  2.40M|        PREDICTION_MODE intra_dir;
  561|  2.40M|        if (mbmi->filter_intra_mode_info.use_filter_intra)
  ------------------
  |  Branch (561:13): [True: 986k, False: 1.41M]
  ------------------
  562|   986k|          intra_dir = fimode_to_intradir[mbmi->filter_intra_mode_info
  563|   986k|                                             .filter_intra_mode];
  564|  1.41M|        else
  565|  1.41M|          intra_dir = mbmi->mode;
  566|       |#if CONFIG_ENTROPY_STATS
  567|       |        ++counts->intra_ext_tx[eset][txsize_sqr_map[tx_size]][intra_dir]
  568|       |                              [av1_ext_tx_ind[tx_set_type][tx_type]];
  569|       |#endif  // CONFIG_ENTROPY_STATS
  570|  2.40M|        if (allow_update_cdf) {
  ------------------
  |  Branch (570:13): [True: 2.40M, False: 18.4E]
  ------------------
  571|  2.40M|          update_cdf(
  572|  2.40M|              fc->intra_ext_tx_cdf[eset][txsize_sqr_map[tx_size]][intra_dir],
  573|  2.40M|              av1_ext_tx_ind[tx_set_type][tx_type],
  574|  2.40M|              av1_num_ext_tx_set[tx_set_type]);
  575|  2.40M|        }
  576|  2.40M|      }
  577|  3.09M|    }
  578|  3.09M|  }
  579|  3.45M|}
encodetxb.c:update_eob_context:
  172|  4.99M|                               uint8_t allow_update_cdf) {
  173|  4.99M|#endif
  174|  4.99M|  int eob_extra;
  175|  4.99M|  const int eob_pt = av1_get_eob_pos_token(eob, &eob_extra);
  176|  4.99M|  TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  177|       |
  178|  4.99M|  const int eob_multi_size = txsize_log2_minus4[tx_size];
  179|  4.99M|  const int eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1;
  ------------------
  |  Branch (179:29): [True: 4.66M, False: 331k]
  ------------------
  180|       |
  181|  4.99M|  switch (eob_multi_size) {
  182|  2.52M|    case 0:
  ------------------
  |  Branch (182:5): [True: 2.52M, False: 2.46M]
  ------------------
  183|       |#if CONFIG_ENTROPY_STATS
  184|       |      ++counts->eob_multi16[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  185|       |#endif
  186|  2.52M|      if (allow_update_cdf)
  ------------------
  |  Branch (186:11): [True: 2.52M, False: 18.4E]
  ------------------
  187|  2.52M|        update_cdf(ec_ctx->eob_flag_cdf16[plane][eob_multi_ctx], eob_pt - 1, 5);
  188|  2.52M|      break;
  189|   337k|    case 1:
  ------------------
  |  Branch (189:5): [True: 337k, False: 4.65M]
  ------------------
  190|       |#if CONFIG_ENTROPY_STATS
  191|       |      ++counts->eob_multi32[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  192|       |#endif
  193|   337k|      if (allow_update_cdf)
  ------------------
  |  Branch (193:11): [True: 337k, False: 18.4E]
  ------------------
  194|   337k|        update_cdf(ec_ctx->eob_flag_cdf32[plane][eob_multi_ctx], eob_pt - 1, 6);
  195|   337k|      break;
  196|  1.93M|    case 2:
  ------------------
  |  Branch (196:5): [True: 1.93M, False: 3.05M]
  ------------------
  197|       |#if CONFIG_ENTROPY_STATS
  198|       |      ++counts->eob_multi64[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  199|       |#endif
  200|  1.93M|      if (allow_update_cdf)
  ------------------
  |  Branch (200:11): [True: 1.93M, False: 18.4E]
  ------------------
  201|  1.93M|        update_cdf(ec_ctx->eob_flag_cdf64[plane][eob_multi_ctx], eob_pt - 1, 7);
  202|  1.93M|      break;
  203|  56.9k|    case 3:
  ------------------
  |  Branch (203:5): [True: 56.9k, False: 4.93M]
  ------------------
  204|       |#if CONFIG_ENTROPY_STATS
  205|       |      ++counts->eob_multi128[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  206|       |#endif
  207|  56.9k|      if (allow_update_cdf) {
  ------------------
  |  Branch (207:11): [True: 56.9k, False: 0]
  ------------------
  208|  56.9k|        update_cdf(ec_ctx->eob_flag_cdf128[plane][eob_multi_ctx], eob_pt - 1,
  209|  56.9k|                   8);
  210|  56.9k|      }
  211|  56.9k|      break;
  212|   126k|    case 4:
  ------------------
  |  Branch (212:5): [True: 126k, False: 4.86M]
  ------------------
  213|       |#if CONFIG_ENTROPY_STATS
  214|       |      ++counts->eob_multi256[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  215|       |#endif
  216|   126k|      if (allow_update_cdf) {
  ------------------
  |  Branch (216:11): [True: 126k, False: 18.4E]
  ------------------
  217|   126k|        update_cdf(ec_ctx->eob_flag_cdf256[plane][eob_multi_ctx], eob_pt - 1,
  218|   126k|                   9);
  219|   126k|      }
  220|   126k|      break;
  221|  5.93k|    case 5:
  ------------------
  |  Branch (221:5): [True: 5.93k, False: 4.98M]
  ------------------
  222|       |#if CONFIG_ENTROPY_STATS
  223|       |      ++counts->eob_multi512[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  224|       |#endif
  225|  5.93k|      if (allow_update_cdf) {
  ------------------
  |  Branch (225:11): [True: 5.93k, False: 18.4E]
  ------------------
  226|  5.93k|        update_cdf(ec_ctx->eob_flag_cdf512[plane][eob_multi_ctx], eob_pt - 1,
  227|  5.93k|                   10);
  228|  5.93k|      }
  229|  5.93k|      break;
  230|  10.7k|    case 6:
  ------------------
  |  Branch (230:5): [True: 10.7k, False: 4.98M]
  ------------------
  231|  10.7k|    default:
  ------------------
  |  Branch (231:5): [True: 0, False: 4.99M]
  ------------------
  232|       |#if CONFIG_ENTROPY_STATS
  233|       |      ++counts->eob_multi1024[cdf_idx][plane][eob_multi_ctx][eob_pt - 1];
  234|       |#endif
  235|  10.7k|      if (allow_update_cdf) {
  ------------------
  |  Branch (235:11): [True: 10.7k, False: 18.4E]
  ------------------
  236|  10.7k|        update_cdf(ec_ctx->eob_flag_cdf1024[plane][eob_multi_ctx], eob_pt - 1,
  237|  10.7k|                   11);
  238|  10.7k|      }
  239|  10.7k|      break;
  240|  4.99M|  }
  241|       |
  242|  4.98M|  if (av1_eob_offset_bits[eob_pt] > 0) {
  ------------------
  |  Branch (242:7): [True: 4.68M, False: 304k]
  ------------------
  243|  4.68M|    int eob_ctx = eob_pt - 3;
  244|  4.68M|    int eob_shift = av1_eob_offset_bits[eob_pt] - 1;
  245|  4.68M|    int bit = (eob_extra & (1 << eob_shift)) ? 1 : 0;
  ------------------
  |  Branch (245:15): [True: 3.76M, False: 915k]
  ------------------
  246|       |#if CONFIG_ENTROPY_STATS
  247|       |    counts->eob_extra[cdf_idx][txs_ctx][plane][eob_pt][bit]++;
  248|       |#endif  // CONFIG_ENTROPY_STATS
  249|  4.68M|    if (allow_update_cdf)
  ------------------
  |  Branch (249:9): [True: 4.68M, False: 18.4E]
  ------------------
  250|  4.68M|      update_cdf(ec_ctx->eob_extra_cdf[txs_ctx][plane][eob_ctx], bit, 2);
  251|  4.68M|  }
  252|  4.98M|}

encodemb.c:av1_cost_skip_txb:
  256|  2.77M|                                    TX_SIZE tx_size) {
  257|  2.77M|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  258|  2.77M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  259|  2.77M|  const LV_MAP_COEFF_COST *const coeff_costs_ =
  260|  2.77M|      &coeff_costs->coeff_costs[txs_ctx][plane_type];
  261|  2.77M|  return coeff_costs_->txb_skip_cost[txb_ctx->txb_skip_ctx][1];
  262|  2.77M|}

av1_row_mt_sync_read_dummy:
  105|  33.7k|                                int c) {
  106|  33.7k|  (void)row_mt_sync;
  107|  33.7k|  (void)r;
  108|  33.7k|  (void)c;
  109|  33.7k|}
av1_row_mt_sync_write_dummy:
  112|  24.7k|                                 int c, int cols) {
  113|  24.7k|  (void)row_mt_sync;
  114|  24.7k|  (void)r;
  115|  24.7k|  (void)c;
  116|  24.7k|  (void)cols;
  117|  24.7k|}
av1_row_mt_sync_read:
  119|   181k|void av1_row_mt_sync_read(AV1EncRowMultiThreadSync *row_mt_sync, int r, int c) {
  120|   181k|#if CONFIG_MULTITHREAD
  121|   181k|  const int nsync = row_mt_sync->sync_range;
  122|       |
  123|   181k|  if (r) {
  ------------------
  |  Branch (123:7): [True: 16.2k, False: 165k]
  ------------------
  124|  16.2k|    pthread_mutex_t *const mutex = &row_mt_sync->mutex_[r - 1];
  125|  16.2k|    pthread_mutex_lock(mutex);
  126|       |
  127|  16.9k|    while (c > row_mt_sync->num_finished_cols[r - 1] - nsync -
  ------------------
  |  Branch (127:12): [True: 731, False: 16.2k]
  ------------------
  128|  16.9k|                   row_mt_sync->intrabc_extra_top_right_sb_delay) {
  129|    731|      pthread_cond_wait(&row_mt_sync->cond_[r - 1], mutex);
  130|    731|    }
  131|  16.2k|    pthread_mutex_unlock(mutex);
  132|  16.2k|  }
  133|       |#else
  134|       |  (void)row_mt_sync;
  135|       |  (void)r;
  136|       |  (void)c;
  137|       |#endif  // CONFIG_MULTITHREAD
  138|   181k|}
av1_row_mt_sync_write:
  141|   112k|                           int cols) {
  142|   112k|#if CONFIG_MULTITHREAD
  143|   112k|  const int nsync = row_mt_sync->sync_range;
  144|   112k|  int cur;
  145|       |  // Only signal when there are enough encoded blocks for next row to run.
  146|   112k|  int sig = 1;
  147|       |
  148|   112k|  if (c < cols - 1) {
  ------------------
  |  Branch (148:7): [True: 9.07k, False: 103k]
  ------------------
  149|  9.07k|    cur = c;
  150|  9.07k|    if (c % nsync) sig = 0;
  ------------------
  |  Branch (150:9): [True: 0, False: 9.07k]
  ------------------
  151|   103k|  } else {
  152|   103k|    cur = cols + nsync + row_mt_sync->intrabc_extra_top_right_sb_delay;
  153|   103k|  }
  154|       |
  155|   112k|  if (sig) {
  ------------------
  |  Branch (155:7): [True: 112k, False: 18.4E]
  ------------------
  156|   112k|    pthread_mutex_lock(&row_mt_sync->mutex_[r]);
  157|       |
  158|       |    // When a thread encounters an error, num_finished_cols[r] is set to maximum
  159|       |    // column number. In this case, the AOMMAX operation here ensures that
  160|       |    // num_finished_cols[r] is not overwritten with a smaller value thus
  161|       |    // preventing the infinite waiting of threads in the relevant sync_read()
  162|       |    // function.
  163|   112k|    row_mt_sync->num_finished_cols[r] =
  164|   112k|        AOMMAX(row_mt_sync->num_finished_cols[r], cur);
  ------------------
  |  |   35|   112k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 112k]
  |  |  ------------------
  ------------------
  165|       |
  166|   112k|    pthread_cond_signal(&row_mt_sync->cond_[r]);
  167|   112k|    pthread_mutex_unlock(&row_mt_sync->mutex_[r]);
  168|   112k|  }
  169|       |#else
  170|       |  (void)row_mt_sync;
  171|       |  (void)r;
  172|       |  (void)c;
  173|       |  (void)cols;
  174|       |#endif  // CONFIG_MULTITHREAD
  175|   112k|}
av1_row_mt_sync_mem_dealloc:
  209|  64.9k|void av1_row_mt_sync_mem_dealloc(AV1EncRowMultiThreadSync *row_mt_sync) {
  210|  64.9k|  if (row_mt_sync != NULL) {
  ------------------
  |  Branch (210:7): [True: 64.9k, False: 0]
  ------------------
  211|  64.9k|#if CONFIG_MULTITHREAD
  212|  64.9k|    int i;
  213|       |
  214|  64.9k|    if (row_mt_sync->mutex_ != NULL) {
  ------------------
  |  Branch (214:9): [True: 50.8k, False: 14.0k]
  ------------------
  215|   108k|      for (i = 0; i < row_mt_sync->rows; ++i) {
  ------------------
  |  Branch (215:19): [True: 57.1k, False: 50.8k]
  ------------------
  216|  57.1k|        pthread_mutex_destroy(&row_mt_sync->mutex_[i]);
  217|  57.1k|      }
  218|  50.8k|      aom_free(row_mt_sync->mutex_);
  219|  50.8k|    }
  220|  64.9k|    if (row_mt_sync->cond_ != NULL) {
  ------------------
  |  Branch (220:9): [True: 50.8k, False: 14.0k]
  ------------------
  221|   108k|      for (i = 0; i < row_mt_sync->rows; ++i) {
  ------------------
  |  Branch (221:19): [True: 57.1k, False: 50.8k]
  ------------------
  222|  57.1k|        pthread_cond_destroy(&row_mt_sync->cond_[i]);
  223|  57.1k|      }
  224|  50.8k|      aom_free(row_mt_sync->cond_);
  225|  50.8k|    }
  226|  64.9k|#endif  // CONFIG_MULTITHREAD
  227|  64.9k|    aom_free(row_mt_sync->num_finished_cols);
  228|       |
  229|       |    // clear the structure as the source of this call may be dynamic change
  230|       |    // in tiles in which case this call will be followed by an _alloc()
  231|       |    // which may fail.
  232|  64.9k|    av1_zero(*row_mt_sync);
  ------------------
  |  |   43|  64.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  233|  64.9k|  }
  234|  64.9k|}
av1_row_mt_mem_dealloc:
  281|  67.7k|void av1_row_mt_mem_dealloc(AV1_COMP *cpi) {
  282|  67.7k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &cpi->mt_info.enc_row_mt;
  283|  67.7k|  const int tile_cols = enc_row_mt->allocated_tile_cols;
  284|  67.7k|  const int tile_rows = enc_row_mt->allocated_tile_rows;
  285|  67.7k|  int tile_col, tile_row;
  286|       |
  287|       |  // Free row based multi-threading sync memory
  288|   101k|  for (tile_row = 0; tile_row < tile_rows; tile_row++) {
  ------------------
  |  Branch (288:22): [True: 33.4k, False: 67.7k]
  ------------------
  289|  84.3k|    for (tile_col = 0; tile_col < tile_cols; tile_col++) {
  ------------------
  |  Branch (289:24): [True: 50.8k, False: 33.4k]
  ------------------
  290|  50.8k|      int tile_index = tile_row * tile_cols + tile_col;
  291|  50.8k|      TileDataEnc *const this_tile = &cpi->tile_data[tile_index];
  292|       |
  293|  50.8k|      av1_row_mt_sync_mem_dealloc(&this_tile->row_mt_sync);
  294|       |
  295|  50.8k|      if (cpi->oxcf.algo_cfg.cdf_update_mode) {
  ------------------
  |  Branch (295:11): [True: 50.8k, False: 0]
  ------------------
  296|  50.8k|        aom_free(this_tile->row_ctx);
  297|  50.8k|        this_tile->row_ctx = NULL;
  298|  50.8k|      }
  299|  50.8k|    }
  300|  33.4k|  }
  301|  67.7k|  enc_row_mt->allocated_tile_cols = 0;
  302|  67.7k|  enc_row_mt->allocated_tile_rows = 0;
  303|  67.7k|  aom_free(enc_row_mt->num_tile_cols_done);
  304|       |  enc_row_mt->num_tile_cols_done = NULL;
  305|  67.7k|  enc_row_mt->allocated_rows = 0;
  306|  67.7k|  enc_row_mt->allocated_cols = 0;
  307|  67.7k|  enc_row_mt->allocated_sb_rows = 0;
  308|  67.7k|}
av1_init_frame_mt:
  806|  92.0k|void av1_init_frame_mt(AV1_PRIMARY *ppi, AV1_COMP *cpi) {
  807|  92.0k|  cpi->mt_info.workers = ppi->p_mt_info.workers;
  808|  92.0k|  cpi->mt_info.num_workers = ppi->p_mt_info.num_workers;
  809|  92.0k|  cpi->mt_info.tile_thr_data = ppi->p_mt_info.tile_thr_data;
  810|  92.0k|  int i;
  811|  1.19M|  for (i = MOD_FP; i < NUM_MT_MODULES; i++) {
  ------------------
  |  Branch (811:20): [True: 1.10M, False: 92.0k]
  ------------------
  812|  1.10M|    cpi->mt_info.num_mod_workers[i] =
  813|  1.10M|        AOMMIN(cpi->mt_info.num_workers, ppi->p_mt_info.num_mod_workers[i]);
  ------------------
  |  |   34|  1.10M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 241k, False: 862k]
  |  |  ------------------
  ------------------
  814|  1.10M|  }
  815|  92.0k|}
av1_init_cdef_worker:
  817|   122k|void av1_init_cdef_worker(AV1_COMP *cpi) {
  818|       |  // The allocation is done only for level 0 parallel frames. No change
  819|       |  // in config is supported in the middle of a parallel encode set, since the
  820|       |  // rest of the MT modules also do not support dynamic change of config.
  821|   122k|  if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) return;
  ------------------
  |  Branch (821:7): [True: 0, False: 122k]
  ------------------
  822|   122k|  PrimaryMultiThreadInfo *const p_mt_info = &cpi->ppi->p_mt_info;
  823|   122k|  int num_cdef_workers = av1_get_num_mod_workers_for_alloc(p_mt_info, MOD_CDEF);
  824|       |
  825|   122k|  av1_alloc_cdef_buffers(&cpi->common, &p_mt_info->cdef_worker,
  826|   122k|                         &cpi->mt_info.cdef_sync, num_cdef_workers, 1);
  827|   122k|  cpi->mt_info.cdef_worker = p_mt_info->cdef_worker;
  828|   122k|}
av1_init_lr_mt_buffers:
  831|  7.50k|void av1_init_lr_mt_buffers(AV1_COMP *cpi) {
  832|  7.50k|  AV1_COMMON *const cm = &cpi->common;
  833|  7.50k|  AV1LrSync *lr_sync = &cpi->mt_info.lr_row_sync;
  834|  7.50k|  if (lr_sync->sync_range) {
  ------------------
  |  Branch (834:7): [True: 7.50k, False: 0]
  ------------------
  835|  7.50k|    if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (835:9): [True: 0, False: 7.50k]
  ------------------
  836|      0|      return;
  837|  7.50k|    int num_lr_workers = lr_sync->num_workers;
  838|  7.50k|    lr_sync->lrworkerdata[num_lr_workers - 1].rst_tmpbuf = cm->rst_tmpbuf;
  839|  7.50k|    lr_sync->lrworkerdata[num_lr_workers - 1].rlbs = cm->rlbs;
  840|  7.50k|  }
  841|  7.50k|}
av1_init_mt_sync:
  845|  70.0k|void av1_init_mt_sync(AV1_COMP *cpi, int is_first_pass) {
  846|  70.0k|  AV1_COMMON *const cm = &cpi->common;
  847|  70.0k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
  848|       |
  849|  70.0k|  if (setjmp(cm->error->jmp)) {
  ------------------
  |  Branch (849:7): [True: 0, False: 70.0k]
  ------------------
  850|      0|    cm->error->setjmp = 0;
  851|      0|    aom_internal_error_copy(&cpi->ppi->error, cm->error);
  852|      0|  }
  853|  70.0k|  cm->error->setjmp = 1;
  854|       |  // Initialize enc row MT object.
  855|  70.0k|  if (is_first_pass || cpi->oxcf.row_mt == 1) {
  ------------------
  |  Branch (855:7): [True: 0, False: 70.0k]
  |  Branch (855:24): [True: 70.0k, False: 0]
  ------------------
  856|  70.0k|    AV1EncRowMultiThreadInfo *enc_row_mt = &mt_info->enc_row_mt;
  857|  70.0k|    if (enc_row_mt->mutex_ == NULL) {
  ------------------
  |  Branch (857:9): [True: 14.0k, False: 56.0k]
  ------------------
  858|  14.0k|      CHECK_MEM_ERROR(cm, enc_row_mt->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  859|  14.0k|                      aom_malloc(sizeof(*(enc_row_mt->mutex_))));
  860|  14.0k|      if (enc_row_mt->mutex_) pthread_mutex_init(enc_row_mt->mutex_, NULL);
  ------------------
  |  Branch (860:11): [True: 14.0k, False: 0]
  ------------------
  861|  14.0k|    }
  862|  70.0k|    if (enc_row_mt->cond_ == NULL) {
  ------------------
  |  Branch (862:9): [True: 14.0k, False: 56.0k]
  ------------------
  863|  14.0k|      CHECK_MEM_ERROR(cm, enc_row_mt->cond_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  864|  14.0k|                      aom_malloc(sizeof(*(enc_row_mt->cond_))));
  865|  14.0k|      if (enc_row_mt->cond_) pthread_cond_init(enc_row_mt->cond_, NULL);
  ------------------
  |  Branch (865:11): [True: 14.0k, False: 0]
  ------------------
  866|  14.0k|    }
  867|  70.0k|  }
  868|       |
  869|  70.0k|  if (!is_first_pass) {
  ------------------
  |  Branch (869:7): [True: 70.0k, False: 0]
  ------------------
  870|       |    // Initialize global motion MT object.
  871|  70.0k|    AV1GlobalMotionSync *gm_sync = &mt_info->gm_sync;
  872|  70.0k|    if (gm_sync->mutex_ == NULL) {
  ------------------
  |  Branch (872:9): [True: 14.0k, False: 56.0k]
  ------------------
  873|  14.0k|      CHECK_MEM_ERROR(cm, gm_sync->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  874|  14.0k|                      aom_malloc(sizeof(*(gm_sync->mutex_))));
  875|  14.0k|      if (gm_sync->mutex_) pthread_mutex_init(gm_sync->mutex_, NULL);
  ------------------
  |  Branch (875:11): [True: 14.0k, False: 0]
  ------------------
  876|  14.0k|    }
  877|  70.0k|#if !CONFIG_REALTIME_ONLY
  878|       |    // Initialize temporal filtering MT object.
  879|  70.0k|    AV1TemporalFilterSync *tf_sync = &mt_info->tf_sync;
  880|  70.0k|    if (tf_sync->mutex_ == NULL) {
  ------------------
  |  Branch (880:9): [True: 14.0k, False: 56.0k]
  ------------------
  881|  14.0k|      CHECK_MEM_ERROR(cm, tf_sync->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|  14.0k|                      aom_malloc(sizeof(*tf_sync->mutex_)));
  883|  14.0k|      if (tf_sync->mutex_) pthread_mutex_init(tf_sync->mutex_, NULL);
  ------------------
  |  Branch (883:11): [True: 14.0k, False: 0]
  ------------------
  884|  14.0k|    }
  885|  70.0k|#endif  // !CONFIG_REALTIME_ONLY
  886|       |        // Initialize CDEF MT object.
  887|  70.0k|    AV1CdefSync *cdef_sync = &mt_info->cdef_sync;
  888|  70.0k|    if (cdef_sync->mutex_ == NULL) {
  ------------------
  |  Branch (888:9): [True: 14.0k, False: 56.0k]
  ------------------
  889|  14.0k|      CHECK_MEM_ERROR(cm, cdef_sync->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  890|  14.0k|                      aom_malloc(sizeof(*(cdef_sync->mutex_))));
  891|  14.0k|      if (cdef_sync->mutex_) pthread_mutex_init(cdef_sync->mutex_, NULL);
  ------------------
  |  Branch (891:11): [True: 14.0k, False: 0]
  ------------------
  892|  14.0k|    }
  893|       |
  894|       |    // Initialize loop filter MT object.
  895|  70.0k|    AV1LfSync *lf_sync = &mt_info->lf_row_sync;
  896|       |    // Number of superblock rows
  897|  70.0k|    const int sb_rows =
  898|  70.0k|        CEIL_POWER_OF_TWO(cm->height >> MI_SIZE_LOG2, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   62|  70.0k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  899|  70.0k|    PrimaryMultiThreadInfo *const p_mt_info = &cpi->ppi->p_mt_info;
  900|  70.0k|    int num_lf_workers = av1_get_num_mod_workers_for_alloc(p_mt_info, MOD_LPF);
  901|       |
  902|  70.0k|    if (!lf_sync->sync_range || sb_rows != lf_sync->rows ||
  ------------------
  |  Branch (902:9): [True: 14.0k, False: 56.0k]
  |  Branch (902:33): [True: 11.0k, False: 45.0k]
  ------------------
  903|  45.0k|        num_lf_workers > lf_sync->num_workers) {
  ------------------
  |  Branch (903:9): [True: 1.69k, False: 43.3k]
  ------------------
  904|  26.7k|      av1_loop_filter_dealloc(lf_sync);
  905|  26.7k|      av1_loop_filter_alloc(lf_sync, cm, sb_rows, cm->width, num_lf_workers);
  906|  26.7k|    }
  907|       |
  908|       |    // Initialize tpl MT object.
  909|  70.0k|    AV1TplRowMultiThreadInfo *tpl_row_mt = &mt_info->tpl_row_mt;
  910|  70.0k|    if (tpl_row_mt->mutex_ == NULL) {
  ------------------
  |  Branch (910:9): [True: 14.0k, False: 56.0k]
  ------------------
  911|  14.0k|      CHECK_MEM_ERROR(cm, tpl_row_mt->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  14.0k|                      aom_malloc(sizeof(*(tpl_row_mt->mutex_))));
  913|  14.0k|      if (tpl_row_mt->mutex_) pthread_mutex_init(tpl_row_mt->mutex_, NULL);
  ------------------
  |  Branch (913:11): [True: 14.0k, False: 0]
  ------------------
  914|  14.0k|    }
  915|       |
  916|  70.0k|#if !CONFIG_REALTIME_ONLY
  917|  70.0k|    if (is_restoration_used(cm)) {
  ------------------
  |  Branch (917:9): [True: 7.50k, False: 62.5k]
  ------------------
  918|       |      // Initialize loop restoration MT object.
  919|  7.50k|      AV1LrSync *lr_sync = &mt_info->lr_row_sync;
  920|  7.50k|      int rst_unit_size = cpi->sf.lpf_sf.min_lr_unit_size;
  921|  7.50k|      int num_rows_lr = av1_lr_count_units(rst_unit_size, cm->height);
  922|  7.50k|      int num_lr_workers = av1_get_num_mod_workers_for_alloc(p_mt_info, MOD_LR);
  923|  7.50k|      const int num_planes = av1_num_planes(cm);
  924|  7.50k|      if (!lr_sync->sync_range || num_rows_lr > lr_sync->rows ||
  ------------------
  |  Branch (924:11): [True: 7.50k, False: 0]
  |  Branch (924:35): [True: 0, False: 0]
  ------------------
  925|      0|          num_lr_workers > lr_sync->num_workers ||
  ------------------
  |  Branch (925:11): [True: 0, False: 0]
  ------------------
  926|  7.50k|          num_planes > lr_sync->num_planes) {
  ------------------
  |  Branch (926:11): [True: 0, False: 0]
  ------------------
  927|  7.50k|        av1_loop_restoration_dealloc(lr_sync);
  928|  7.50k|        av1_loop_restoration_alloc(lr_sync, cm, num_lr_workers, num_rows_lr,
  929|  7.50k|                                   num_planes, cm->width);
  930|  7.50k|      }
  931|  7.50k|    }
  932|  70.0k|#endif
  933|       |
  934|       |    // Initialization of pack bitstream MT object.
  935|  70.0k|    AV1EncPackBSSync *pack_bs_sync = &mt_info->pack_bs_sync;
  936|  70.0k|    if (pack_bs_sync->mutex_ == NULL) {
  ------------------
  |  Branch (936:9): [True: 14.0k, False: 56.0k]
  ------------------
  937|  14.0k|      CHECK_MEM_ERROR(cm, pack_bs_sync->mutex_,
  ------------------
  |  |   51|  14.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  14.0k|  do {                                                    \
  |  |  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  14.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  938|  14.0k|                      aom_malloc(sizeof(*pack_bs_sync->mutex_)));
  939|  14.0k|      if (pack_bs_sync->mutex_) pthread_mutex_init(pack_bs_sync->mutex_, NULL);
  ------------------
  |  Branch (939:11): [True: 14.0k, False: 0]
  ------------------
  940|  14.0k|    }
  941|  70.0k|  }
  942|  70.0k|  cm->error->setjmp = 0;
  943|  70.0k|}
av1_get_num_mod_workers_for_alloc:
  949|   306k|                                      MULTI_THREADED_MODULES mod_name) {
  950|   306k|  int num_mod_workers = p_mt_info->num_mod_workers[mod_name];
  951|   306k|  if (p_mt_info->num_mod_workers[MOD_FRAME_ENC] > 1) {
  ------------------
  |  Branch (951:7): [True: 0, False: 306k]
  ------------------
  952|       |    // TODO(anyone): Change num_mod_workers to num_mod_workers[MOD_FRAME_ENC].
  953|       |    // As frame parallel jobs will only perform multi-threading for the encode
  954|       |    // stage, we can limit the allocations according to num_enc_workers per
  955|       |    // frame parallel encode(a.k.a num_mod_workers[MOD_FRAME_ENC]).
  956|      0|    num_mod_workers = p_mt_info->num_workers;
  957|      0|  }
  958|   306k|  return num_mod_workers;
  959|   306k|}
av1_init_tile_thread_data:
  961|  14.0k|void av1_init_tile_thread_data(AV1_PRIMARY *ppi, int is_first_pass) {
  962|  14.0k|  PrimaryMultiThreadInfo *const p_mt_info = &ppi->p_mt_info;
  963|       |
  964|  14.0k|  assert(p_mt_info->workers != NULL);
  965|  14.0k|  assert(p_mt_info->tile_thr_data != NULL);
  966|       |
  967|  14.0k|  const int is_highbitdepth = ppi->seq_params.use_highbitdepth;
  968|  14.0k|  int num_workers = p_mt_info->num_workers;
  969|  14.0k|  int num_enc_workers = av1_get_num_mod_workers_for_alloc(p_mt_info, MOD_ENC);
  970|  14.0k|  assert(num_enc_workers <= num_workers);
  971|   114k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (971:33): [True: 100k, False: 14.0k]
  ------------------
  972|   100k|    EncWorkerData *const thread_data = &p_mt_info->tile_thr_data[i];
  973|       |
  974|   100k|    if (i > 0) {
  ------------------
  |  Branch (974:9): [True: 86.9k, False: 14.0k]
  ------------------
  975|       |      // Allocate thread data.
  976|  86.9k|      ThreadData *td;
  977|  86.9k|      AOM_CHECK_MEM_ERROR(&ppi->error, td, aom_memalign(32, sizeof(*td)));
  ------------------
  |  |   71|  86.9k|  do {                                                    \
  |  |   72|  86.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  86.9k|    lval = (expr);                                        \
  |  |   74|  86.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 86.9k]
  |  |  ------------------
  |  |   75|  86.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  86.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 86.9k]
  |  |  ------------------
  ------------------
  978|  86.9k|      av1_zero(*td);
  ------------------
  |  |   43|  86.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  979|  86.9k|      thread_data->original_td = thread_data->td = td;
  980|       |
  981|       |      // Set up shared coeff buffers.
  982|  86.9k|      av1_setup_shared_coeff_buffer(&ppi->seq_params, &td->shared_coeff_buf,
  983|  86.9k|                                    &ppi->error);
  984|  86.9k|      AOM_CHECK_MEM_ERROR(&ppi->error, td->tmp_conv_dst,
  ------------------
  |  |   71|  86.9k|  do {                                                    \
  |  |   72|  86.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  86.9k|    lval = (expr);                                        \
  |  |   74|  86.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 86.9k]
  |  |  ------------------
  |  |   75|  86.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  86.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 86.9k]
  |  |  ------------------
  ------------------
  985|  86.9k|                          aom_memalign(32, MAX_SB_SIZE * MAX_SB_SIZE *
  986|  86.9k|                                               sizeof(*td->tmp_conv_dst)));
  987|       |
  988|  86.9k|      if (i < p_mt_info->num_mod_workers[MOD_FP]) {
  ------------------
  |  Branch (988:11): [True: 16.9k, False: 70.0k]
  ------------------
  989|       |        // Set up firstpass PICK_MODE_CONTEXT.
  990|  16.9k|        td->firstpass_ctx =
  991|  16.9k|            av1_alloc_pmc(ppi->cpi, BLOCK_16X16, &td->shared_coeff_buf);
  992|  16.9k|        if (!td->firstpass_ctx)
  ------------------
  |  Branch (992:13): [True: 0, False: 16.9k]
  ------------------
  993|      0|          aom_internal_error(&ppi->error, AOM_CODEC_MEM_ERROR,
  994|      0|                             "Failed to allocate PICK_MODE_CONTEXT");
  995|  16.9k|      }
  996|       |
  997|  86.9k|      AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  86.9k|  do {                                                    \
  |  |   72|  86.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  86.9k|    lval = (expr);                                        \
  |  |   74|  86.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 86.9k]
  |  |  ------------------
  |  |   75|  86.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  86.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 86.9k]
  |  |  ------------------
  ------------------
  998|  86.9k|          &ppi->error, td->upsample_pred,
  999|  86.9k|          aom_memalign(16, (1 + is_highbitdepth) * ((MAX_SB_SIZE + 16) + 16) *
 1000|  86.9k|                               MAX_SB_SIZE * sizeof(*td->upsample_pred)));
 1001|       |
 1002|  86.9k|      if (!is_first_pass && i < num_enc_workers) {
  ------------------
  |  Branch (1002:11): [True: 86.9k, False: 0]
  |  Branch (1002:29): [True: 16.9k, False: 70.0k]
  ------------------
 1003|       |        // Set up sms_tree.
 1004|  16.9k|        if (av1_setup_sms_tree(ppi->cpi, td)) {
  ------------------
  |  Branch (1004:13): [True: 0, False: 16.9k]
  ------------------
 1005|      0|          aom_internal_error(&ppi->error, AOM_CODEC_MEM_ERROR,
 1006|      0|                             "Failed to allocate SMS tree");
 1007|      0|        }
 1008|       |
 1009|  50.8k|        for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (1009:25): [True: 33.8k, False: 16.9k]
  ------------------
 1010|  33.8k|          AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  33.8k|  do {                                                    \
  |  |   72|  33.8k|    assert((error_info)->setjmp);                         \
  |  |   73|  33.8k|    lval = (expr);                                        \
  |  |   74|  33.8k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 33.8k]
  |  |  ------------------
  |  |   75|  33.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  33.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 33.8k]
  |  |  ------------------
  ------------------
 1011|  33.8k|              &ppi->error, td->hash_value_buffer[x],
 1012|  33.8k|              (uint32_t *)aom_malloc(AOM_BUFFER_SIZE_FOR_BLOCK_HASH *
 1013|  33.8k|                                     sizeof(*td->hash_value_buffer[x])));
 1014|  33.8k|        }
 1015|       |
 1016|       |        // Allocate frame counters in thread data.
 1017|  16.9k|        AOM_CHECK_MEM_ERROR(&ppi->error, td->counts,
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 1018|  16.9k|                            aom_calloc(1, sizeof(*td->counts)));
 1019|       |
 1020|       |        // Allocate buffers used by palette coding mode.
 1021|  16.9k|        AOM_CHECK_MEM_ERROR(&ppi->error, td->palette_buffer,
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 1022|  16.9k|                            aom_memalign(16, sizeof(*td->palette_buffer)));
 1023|       |
 1024|       |        // The buffers 'tmp_pred_bufs[]', 'comp_rd_buffer' and 'obmc_buffer' are
 1025|       |        // used in inter frames to store intermediate inter mode prediction
 1026|       |        // results and are not required for allintra encoding mode. Hence, the
 1027|       |        // memory allocations for these buffers are avoided for allintra
 1028|       |        // encoding mode.
 1029|  16.9k|        if (ppi->cpi->oxcf.kf_cfg.key_freq_max != 0) {
  ------------------
  |  Branch (1029:13): [True: 16.9k, False: 0]
  ------------------
 1030|  16.9k|          alloc_obmc_buffers(&td->obmc_buffer, &ppi->error);
 1031|       |
 1032|  16.9k|          alloc_compound_type_rd_buffers(&ppi->error, &td->comp_rd_buffer);
 1033|       |
 1034|  50.8k|          for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (1034:27): [True: 33.8k, False: 16.9k]
  ------------------
 1035|  33.8k|            AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  33.8k|  do {                                                    \
  |  |   72|  33.8k|    assert((error_info)->setjmp);                         \
  |  |   73|  33.8k|    lval = (expr);                                        \
  |  |   74|  33.8k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 33.8k]
  |  |  ------------------
  |  |   75|  33.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  33.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 33.8k]
  |  |  ------------------
  ------------------
 1036|  33.8k|                &ppi->error, td->tmp_pred_bufs[j],
 1037|  33.8k|                aom_memalign(32, 2 * MAX_MB_PLANE * MAX_SB_SQUARE *
 1038|  33.8k|                                     sizeof(*td->tmp_pred_bufs[j])));
 1039|  33.8k|          }
 1040|  16.9k|        }
 1041|       |
 1042|  16.9k|        const int plane_types = PLANE_TYPES >> ppi->seq_params.monochrome;
 1043|  16.9k|        AOM_CHECK_MEM_ERROR(&ppi->error, td->pixel_gradient_info,
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 1044|  16.9k|                            aom_malloc(sizeof(*td->pixel_gradient_info) *
 1045|  16.9k|                                       plane_types * MAX_SB_SQUARE));
 1046|       |
 1047|  16.9k|        if (is_src_var_for_4x4_sub_blocks_caching_enabled(ppi->cpi)) {
  ------------------
  |  Branch (1047:13): [True: 0, False: 16.9k]
  ------------------
 1048|      0|          const BLOCK_SIZE sb_size = ppi->cpi->common.seq_params->sb_size;
 1049|      0|          const int mi_count_in_sb =
 1050|      0|              mi_size_wide[sb_size] * mi_size_high[sb_size];
 1051|       |
 1052|      0|          AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|      0|  do {                                                    \
  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |   73|      0|    lval = (expr);                                        \
  |  |   74|      0|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1053|      0|              &ppi->error, td->src_var_info_of_4x4_sub_blocks,
 1054|      0|              aom_malloc(sizeof(*td->src_var_info_of_4x4_sub_blocks) *
 1055|      0|                         mi_count_in_sb));
 1056|      0|        }
 1057|       |
 1058|  16.9k|        if (ppi->cpi->sf.part_sf.partition_search_type == VAR_BASED_PARTITION) {
  ------------------
  |  Branch (1058:13): [True: 6.72k, False: 10.2k]
  ------------------
 1059|  6.72k|          const int num_64x64_blocks =
 1060|  6.72k|              (ppi->seq_params.sb_size == BLOCK_64X64) ? 1 : 4;
  ------------------
  |  Branch (1060:15): [True: 6.72k, False: 0]
  ------------------
 1061|  6.72k|          AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  6.72k|  do {                                                    \
  |  |   72|  6.72k|    assert((error_info)->setjmp);                         \
  |  |   73|  6.72k|    lval = (expr);                                        \
  |  |   74|  6.72k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 6.72k]
  |  |  ------------------
  |  |   75|  6.72k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  6.72k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 6.72k]
  |  |  ------------------
  ------------------
 1062|  6.72k|              &ppi->error, td->vt64x64,
 1063|  6.72k|              aom_malloc(sizeof(*td->vt64x64) * num_64x64_blocks));
 1064|  6.72k|        }
 1065|  16.9k|      }
 1066|  86.9k|    }
 1067|       |
 1068|   100k|    if (!is_first_pass && ppi->cpi->oxcf.row_mt == 1 && i < num_enc_workers) {
  ------------------
  |  Branch (1068:9): [True: 100k, False: 0]
  |  Branch (1068:27): [True: 100k, False: 0]
  |  Branch (1068:57): [True: 30.9k, False: 70.0k]
  ------------------
 1069|  30.9k|      if (i == 0) {
  ------------------
  |  Branch (1069:11): [True: 14.0k, False: 16.9k]
  ------------------
 1070|  28.0k|        for (int j = 0; j < ppi->num_fp_contexts; j++) {
  ------------------
  |  Branch (1070:25): [True: 14.0k, False: 14.0k]
  ------------------
 1071|  14.0k|          AOM_CHECK_MEM_ERROR(&ppi->error, ppi->parallel_cpi[j]->td.tctx,
  ------------------
  |  |   71|  14.0k|  do {                                                    \
  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  14.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1072|  14.0k|                              (FRAME_CONTEXT *)aom_memalign(
 1073|  14.0k|                                  16, sizeof(*ppi->parallel_cpi[j]->td.tctx)));
 1074|  14.0k|        }
 1075|  16.9k|      } else {
 1076|  16.9k|        AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  16.9k|  do {                                                    \
  |  |   72|  16.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  16.9k|    lval = (expr);                                        \
  |  |   74|  16.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   75|  16.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  16.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 1077|  16.9k|            &ppi->error, thread_data->td->tctx,
 1078|  16.9k|            (FRAME_CONTEXT *)aom_memalign(16, sizeof(*thread_data->td->tctx)));
 1079|  16.9k|      }
 1080|  30.9k|    }
 1081|   100k|  }
 1082|       |
 1083|       |  // Record the number of workers in encode stage multi-threading for which
 1084|       |  // allocation is done.
 1085|  14.0k|  p_mt_info->prev_num_enc_workers = num_enc_workers;
 1086|  14.0k|}
av1_create_workers:
 1088|  14.0k|void av1_create_workers(AV1_PRIMARY *ppi, int num_workers) {
 1089|  14.0k|  PrimaryMultiThreadInfo *const p_mt_info = &ppi->p_mt_info;
 1090|  14.0k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 1091|  14.0k|  assert(p_mt_info->num_workers == 0);
 1092|       |
 1093|  14.0k|  AOM_CHECK_MEM_ERROR(&ppi->error, p_mt_info->workers,
  ------------------
  |  |   71|  14.0k|  do {                                                    \
  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  14.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1094|  14.0k|                      aom_malloc(num_workers * sizeof(*p_mt_info->workers)));
 1095|       |
 1096|  14.0k|  AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|  14.0k|  do {                                                    \
  |  |   72|  14.0k|    assert((error_info)->setjmp);                         \
  |  |   73|  14.0k|    lval = (expr);                                        \
  |  |   74|  14.0k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |   75|  14.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  14.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1097|  14.0k|      &ppi->error, p_mt_info->tile_thr_data,
 1098|  14.0k|      aom_calloc(num_workers, sizeof(*p_mt_info->tile_thr_data)));
 1099|       |
 1100|   114k|  for (int i = 0; i < num_workers; ++i) {
  ------------------
  |  Branch (1100:19): [True: 100k, False: 14.0k]
  ------------------
 1101|   100k|    AVxWorker *const worker = &p_mt_info->workers[i];
 1102|   100k|    EncWorkerData *const thread_data = &p_mt_info->tile_thr_data[i];
 1103|       |
 1104|   100k|    winterface->init(worker);
 1105|   100k|    worker->thread_name = "aom enc worker";
 1106|       |
 1107|   100k|    thread_data->thread_id = i;
 1108|       |    // Set the starting tile for each thread.
 1109|   100k|    thread_data->start = i;
 1110|       |
 1111|   100k|    if (i > 0) {
  ------------------
  |  Branch (1111:9): [True: 86.9k, False: 14.0k]
  ------------------
 1112|       |      // Create threads
 1113|  86.9k|      if (!winterface->reset(worker))
  ------------------
  |  Branch (1113:11): [True: 0, False: 86.9k]
  ------------------
 1114|      0|        aom_internal_error(&ppi->error, AOM_CODEC_ERROR,
 1115|      0|                           "Tile encoder thread creation failed");
 1116|  86.9k|    }
 1117|   100k|    winterface->sync(worker);
 1118|       |
 1119|       |    // Ensure p_mt_info->num_workers is the number of threads successfuly
 1120|       |    // created. Important to av1_terminate_workers().
 1121|   100k|    ++p_mt_info->num_workers;
 1122|   100k|  }
 1123|  14.0k|}
av1_terminate_workers:
 1128|  18.4k|void av1_terminate_workers(AV1_PRIMARY *ppi) {
 1129|  18.4k|  PrimaryMultiThreadInfo *const p_mt_info = &ppi->p_mt_info;
 1130|   119k|  for (int t = 0; t < p_mt_info->num_workers; ++t) {
  ------------------
  |  Branch (1130:19): [True: 100k, False: 18.4k]
  ------------------
 1131|   100k|    AVxWorker *const worker = &p_mt_info->workers[t];
 1132|   100k|    aom_get_worker_interface()->end(worker);
 1133|   100k|  }
 1134|  18.4k|}
av1_check_fpmt_config:
 1177|   174k|                          const AV1EncoderConfig *const oxcf) {
 1178|   174k|  if (is_fpmt_config(ppi, oxcf)) return 1;
  ------------------
  |  Branch (1178:7): [True: 0, False: 174k]
  ------------------
 1179|       |  // Reset frame parallel configuration for unsupported config
 1180|   174k|  if (ppi->num_fp_contexts > 1) {
  ------------------
  |  Branch (1180:7): [True: 0, False: 174k]
  ------------------
 1181|      0|    for (int i = 1; i < ppi->num_fp_contexts; i++) {
  ------------------
  |  Branch (1181:21): [True: 0, False: 0]
  ------------------
 1182|       |      // Release the previously-used frame-buffer
 1183|      0|      if (ppi->parallel_cpi[i]->common.cur_frame != NULL) {
  ------------------
  |  Branch (1183:11): [True: 0, False: 0]
  ------------------
 1184|      0|        --ppi->parallel_cpi[i]->common.cur_frame->ref_count;
 1185|      0|        ppi->parallel_cpi[i]->common.cur_frame = NULL;
 1186|      0|      }
 1187|      0|    }
 1188|       |
 1189|      0|    int cur_gf_index = ppi->cpi->gf_frame_index;
 1190|      0|    int reset_size = AOMMAX(0, ppi->gf_group.size - cur_gf_index);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1191|      0|    av1_zero_array(&ppi->gf_group.frame_parallel_level[cur_gf_index],
  ------------------
  |  |   44|      0|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1192|      0|                   reset_size);
 1193|      0|    av1_zero_array(&ppi->gf_group.is_frame_non_ref[cur_gf_index], reset_size);
  ------------------
  |  |   44|      0|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1194|      0|    av1_zero_array(&ppi->gf_group.src_offset[cur_gf_index], reset_size);
  ------------------
  |  |   44|      0|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1195|      0|    memset(&ppi->gf_group.skip_frame_refresh[cur_gf_index][0], INVALID_IDX,
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1196|      0|           sizeof(ppi->gf_group.skip_frame_refresh[cur_gf_index][0]) *
 1197|      0|               reset_size * REF_FRAMES);
 1198|      0|    memset(&ppi->gf_group.skip_frame_as_ref[cur_gf_index], INVALID_IDX,
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
 1199|      0|           sizeof(ppi->gf_group.skip_frame_as_ref[cur_gf_index]) * reset_size);
 1200|      0|    ppi->num_fp_contexts = 1;
 1201|      0|  }
 1202|   174k|  return 0;
 1203|   174k|}
av1_get_max_num_workers:
 1736|  92.0k|int av1_get_max_num_workers(const AV1_COMP *cpi) {
 1737|  92.0k|  int max_num_workers = 0;
 1738|  1.19M|  for (int i = MOD_FP; i < NUM_MT_MODULES; i++)
  ------------------
  |  Branch (1738:24): [True: 1.10M, False: 92.0k]
  ------------------
 1739|  1.10M|    max_num_workers =
 1740|  1.10M|        AOMMAX(cpi->ppi->p_mt_info.num_mod_workers[i], max_num_workers);
  ------------------
  |  |   35|  1.10M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 143k, False: 960k]
  |  |  ------------------
  ------------------
 1741|  92.0k|  assert(max_num_workers >= 1);
 1742|  92.0k|  return AOMMIN(max_num_workers, cpi->oxcf.max_threads);
  ------------------
  |  |   34|  92.0k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 78.8k, False: 13.1k]
  |  |  ------------------
  ------------------
 1743|  92.0k|}
av1_accumulate_frame_counts:
 1776|  38.6k|                                 const FRAME_COUNTS *counts) {
 1777|  38.6k|  unsigned int *const acc = (unsigned int *)acc_counts;
 1778|  38.6k|  const unsigned int *const cnt = (const unsigned int *)counts;
 1779|       |
 1780|  38.6k|  const unsigned int n_counts = sizeof(FRAME_COUNTS) / sizeof(unsigned int);
 1781|       |
 1782|  1.89M|  for (unsigned int i = 0; i < n_counts; i++) acc[i] += cnt[i];
  ------------------
  |  Branch (1782:28): [True: 1.85M, False: 38.6k]
  ------------------
 1783|  38.6k|}
av1_encode_tiles_row_mt:
 1932|  56.0k|void av1_encode_tiles_row_mt(AV1_COMP *cpi) {
 1933|  56.0k|  AV1_COMMON *const cm = &cpi->common;
 1934|  56.0k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 1935|  56.0k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &mt_info->enc_row_mt;
 1936|  56.0k|  const int tile_cols = cm->tiles.cols;
 1937|  56.0k|  const int tile_rows = cm->tiles.rows;
 1938|  56.0k|  const int sb_rows_in_frame = get_sb_rows_in_frame(cm);
 1939|  56.0k|  int *thread_id_to_tile_id = enc_row_mt->thread_id_to_tile_id;
 1940|  56.0k|  int max_sb_rows_in_tile = 0, max_sb_cols_in_tile = 0;
 1941|  56.0k|  int num_workers = mt_info->num_mod_workers[MOD_ENC];
 1942|       |
 1943|  56.0k|  compute_max_sb_rows_cols(cm, &max_sb_rows_in_tile, &max_sb_cols_in_tile);
 1944|  56.0k|  const bool alloc_row_mt_mem =
 1945|  56.0k|      (enc_row_mt->allocated_tile_cols != tile_cols ||
  ------------------
  |  Branch (1945:8): [True: 17.8k, False: 38.1k]
  ------------------
 1946|  38.1k|       enc_row_mt->allocated_tile_rows != tile_rows ||
  ------------------
  |  Branch (1946:8): [True: 3.28k, False: 34.9k]
  ------------------
 1947|  34.9k|       enc_row_mt->allocated_rows != max_sb_rows_in_tile ||
  ------------------
  |  Branch (1947:8): [True: 990, False: 33.9k]
  ------------------
 1948|  33.9k|       enc_row_mt->allocated_cols != (max_sb_cols_in_tile - 1) ||
  ------------------
  |  Branch (1948:8): [True: 782, False: 33.1k]
  ------------------
 1949|  33.1k|       enc_row_mt->allocated_sb_rows != sb_rows_in_frame);
  ------------------
  |  Branch (1949:8): [True: 132, False: 32.9k]
  ------------------
 1950|  56.0k|  const bool alloc_tile_data = cpi->allocated_tiles != tile_cols * tile_rows;
 1951|       |
 1952|  56.0k|  assert(IMPLIES(cpi->tile_data == NULL, alloc_tile_data));
 1953|  56.0k|  assert(IMPLIES(cpi->tile_data == NULL, cpi->allocated_tiles == 0));
 1954|  56.0k|  if (alloc_tile_data) {
  ------------------
  |  Branch (1954:7): [True: 21.1k, False: 34.9k]
  ------------------
 1955|  21.1k|    av1_alloc_tile_data(cpi);
 1956|  21.1k|  }
 1957|       |
 1958|  56.0k|  assert(IMPLIES(alloc_tile_data, alloc_row_mt_mem));
 1959|  56.0k|  if (alloc_row_mt_mem) {
  ------------------
  |  Branch (1959:7): [True: 23.0k, False: 32.9k]
  ------------------
 1960|  23.0k|    row_mt_mem_alloc(cpi, max_sb_rows_in_tile, max_sb_cols_in_tile,
 1961|  23.0k|                     cpi->oxcf.algo_cfg.cdf_update_mode);
 1962|  23.0k|  }
 1963|       |
 1964|  56.0k|  num_workers = AOMMIN(num_workers, mt_info->num_workers);
  ------------------
  |  |   34|  56.0k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 52.6k, False: 3.43k]
  |  |  ------------------
  ------------------
 1965|  56.0k|  lpf_pipeline_mt_init(cpi, num_workers);
 1966|       |
 1967|  56.0k|  av1_init_tile_data(cpi);
 1968|       |
 1969|  56.0k|  memset(thread_id_to_tile_id, -1,
 1970|  56.0k|         sizeof(*thread_id_to_tile_id) * MAX_NUM_THREADS);
  ------------------
  |  |   21|  56.0k|#define MAX_NUM_THREADS 64
  ------------------
 1971|  56.0k|  memset(enc_row_mt->num_tile_cols_done, 0,
 1972|  56.0k|         sizeof(*enc_row_mt->num_tile_cols_done) * sb_rows_in_frame);
 1973|  56.0k|  enc_row_mt->row_mt_exit = false;
 1974|       |
 1975|   127k|  for (int tile_row = 0; tile_row < tile_rows; tile_row++) {
  ------------------
  |  Branch (1975:26): [True: 71.8k, False: 56.0k]
  ------------------
 1976|   167k|    for (int tile_col = 0; tile_col < tile_cols; tile_col++) {
  ------------------
  |  Branch (1976:28): [True: 95.8k, False: 71.8k]
  ------------------
 1977|  95.8k|      int tile_index = tile_row * tile_cols + tile_col;
 1978|  95.8k|      TileDataEnc *const this_tile = &cpi->tile_data[tile_index];
 1979|  95.8k|      AV1EncRowMultiThreadSync *const row_mt_sync = &this_tile->row_mt_sync;
 1980|       |
 1981|       |      // Initialize num_finished_cols to -1 for all rows.
 1982|  95.8k|      memset(row_mt_sync->num_finished_cols, -1,
 1983|  95.8k|             sizeof(*row_mt_sync->num_finished_cols) * max_sb_rows_in_tile);
 1984|  95.8k|      row_mt_sync->next_mi_row = this_tile->tile_info.mi_row_start;
 1985|  95.8k|      row_mt_sync->num_threads_working = 0;
 1986|  95.8k|      row_mt_sync->intrabc_extra_top_right_sb_delay =
 1987|  95.8k|          av1_get_intrabc_extra_top_right_sb_delay(cm);
 1988|       |
 1989|  95.8k|      av1_inter_mode_data_init(this_tile);
 1990|  95.8k|      av1_zero_above_context(cm, &cpi->td.mb.e_mbd,
 1991|  95.8k|                             this_tile->tile_info.mi_col_start,
 1992|  95.8k|                             this_tile->tile_info.mi_col_end, tile_row);
 1993|  95.8k|    }
 1994|  71.8k|  }
 1995|       |
 1996|  56.0k|  assign_tile_to_thread(thread_id_to_tile_id, tile_cols * tile_rows,
 1997|  56.0k|                        num_workers);
 1998|  56.0k|  prepare_enc_workers(cpi, enc_row_mt_worker_hook, num_workers);
 1999|  56.0k|  launch_workers(&cpi->mt_info, num_workers);
 2000|  56.0k|  sync_enc_workers(&cpi->mt_info, cm, num_workers);
 2001|  56.0k|  if (cm->delta_q_info.delta_lf_present_flag) update_delta_lf_for_row_mt(cpi);
  ------------------
  |  Branch (2001:7): [True: 0, False: 56.0k]
  ------------------
 2002|  56.0k|  accumulate_counters_enc_workers(cpi, num_workers);
 2003|  56.0k|}
av1_tpl_dealloc:
 2233|  18.4k|void av1_tpl_dealloc(AV1TplRowMultiThreadSync *tpl_sync) {
 2234|  18.4k|  assert(tpl_sync != NULL);
 2235|       |
 2236|  18.4k|#if CONFIG_MULTITHREAD
 2237|  18.4k|  if (tpl_sync->mutex_ != NULL) {
  ------------------
  |  Branch (2237:7): [True: 0, False: 18.4k]
  ------------------
 2238|      0|    for (int i = 0; i < tpl_sync->rows; ++i)
  ------------------
  |  Branch (2238:21): [True: 0, False: 0]
  ------------------
 2239|      0|      pthread_mutex_destroy(&tpl_sync->mutex_[i]);
 2240|      0|    aom_free(tpl_sync->mutex_);
 2241|      0|  }
 2242|  18.4k|  if (tpl_sync->cond_ != NULL) {
  ------------------
  |  Branch (2242:7): [True: 0, False: 18.4k]
  ------------------
 2243|      0|    for (int i = 0; i < tpl_sync->rows; ++i)
  ------------------
  |  Branch (2243:21): [True: 0, False: 0]
  ------------------
 2244|      0|      pthread_cond_destroy(&tpl_sync->cond_[i]);
 2245|      0|    aom_free(tpl_sync->cond_);
 2246|      0|  }
 2247|  18.4k|#endif  // CONFIG_MULTITHREAD
 2248|       |
 2249|  18.4k|  aom_free(tpl_sync->num_finished_cols);
 2250|       |  // clear the structure as the source of this call may be a resize in which
 2251|       |  // case this call will be followed by an _alloc() which may fail.
 2252|  18.4k|  av1_zero(*tpl_sync);
  ------------------
  |  |   43|  18.4k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2253|  18.4k|}
av1_tf_mt_dealloc:
 2381|  14.0k|void av1_tf_mt_dealloc(AV1TemporalFilterSync *tf_sync) {
 2382|  14.0k|  assert(tf_sync != NULL);
 2383|  14.0k|#if CONFIG_MULTITHREAD
 2384|  14.0k|  if (tf_sync->mutex_ != NULL) {
  ------------------
  |  Branch (2384:7): [True: 14.0k, False: 0]
  ------------------
 2385|  14.0k|    pthread_mutex_destroy(tf_sync->mutex_);
 2386|  14.0k|    aom_free(tf_sync->mutex_);
 2387|  14.0k|  }
 2388|  14.0k|#endif  // CONFIG_MULTITHREAD
 2389|  14.0k|  tf_sync->next_tf_row = 0;
 2390|  14.0k|}
av1_global_motion_estimation_mt:
 2720|  2.88k|void av1_global_motion_estimation_mt(AV1_COMP *cpi) {
 2721|  2.88k|  GlobalMotionJobInfo *job_info = &cpi->mt_info.gm_sync.job_info;
 2722|       |
 2723|  2.88k|  av1_zero(*job_info);
  ------------------
  |  |   43|  2.88k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2724|       |
 2725|  2.88k|  int num_workers = compute_gm_workers(cpi);
 2726|       |
 2727|  2.88k|  assign_thread_to_dir(job_info->thread_id_to_dir, num_workers);
 2728|  2.88k|  prepare_gm_workers(cpi, gm_mt_worker_hook, num_workers);
 2729|  2.88k|  launch_workers(&cpi->mt_info, num_workers);
 2730|  2.88k|  sync_enc_workers(&cpi->mt_info, &cpi->common, num_workers);
 2731|  2.88k|  gm_dealloc_thread_data(cpi, num_workers);
 2732|  2.88k|}
av1_write_tile_obu_mt:
 3247|  13.1k|                           uint8_t **tile_data_start, const int num_workers) {
 3248|  13.1k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 3249|       |
 3250|  13.1k|  PackBSParams pack_bs_params[MAX_TILES];
 3251|  13.1k|  uint32_t tile_size[MAX_TILES] = { 0 };
 3252|       |
 3253|  6.73M|  for (int tile_idx = 0; tile_idx < MAX_TILES; tile_idx++)
  ------------------
  |  |  643|  6.73M|#define MAX_TILES 512
  ------------------
  |  Branch (3253:26): [True: 6.71M, False: 13.1k]
  ------------------
 3254|  6.71M|    pack_bs_params[tile_idx].total_size = &tile_size[tile_idx];
 3255|       |
 3256|  13.1k|  init_tile_pack_bs_params(cpi, dst, dst_size, saved_wb, pack_bs_params,
 3257|  13.1k|                           obu_extn_header);
 3258|  13.1k|  prepare_pack_bs_workers(cpi, pack_bs_params, pack_bs_worker_hook,
 3259|  13.1k|                          num_workers);
 3260|  13.1k|  launch_workers(mt_info, num_workers);
 3261|  13.1k|  sync_enc_workers(mt_info, &cpi->common, num_workers);
 3262|  13.1k|  accumulate_pack_bs_data(cpi, pack_bs_params, dst, total_size, fh_info,
 3263|  13.1k|                          largest_tile_id, max_tile_size, obu_header_size,
 3264|  13.1k|                          tile_data_start, num_workers);
 3265|  13.1k|}
av1_cdef_mt_dealloc:
 3268|  14.0k|void av1_cdef_mt_dealloc(AV1CdefSync *cdef_sync) {
 3269|  14.0k|  (void)cdef_sync;
 3270|  14.0k|  assert(cdef_sync != NULL);
 3271|  14.0k|#if CONFIG_MULTITHREAD
 3272|  14.0k|  if (cdef_sync->mutex_ != NULL) {
  ------------------
  |  Branch (3272:7): [True: 14.0k, False: 0]
  ------------------
 3273|  14.0k|    pthread_mutex_destroy(cdef_sync->mutex_);
 3274|  14.0k|    aom_free(cdef_sync->mutex_);
 3275|  14.0k|  }
 3276|  14.0k|#endif  // CONFIG_MULTITHREAD
 3277|  14.0k|}
av1_cdef_mse_calc_frame_mt:
 3394|  31.9k|void av1_cdef_mse_calc_frame_mt(AV1_COMP *cpi) {
 3395|  31.9k|  MultiThreadInfo *mt_info = &cpi->mt_info;
 3396|  31.9k|  AV1CdefSync *cdef_sync = &mt_info->cdef_sync;
 3397|  31.9k|  const int num_workers = mt_info->num_mod_workers[MOD_CDEF_SEARCH];
 3398|       |
 3399|  31.9k|  cdef_reset_job_info(cdef_sync);
 3400|  31.9k|  prepare_cdef_workers(cpi, cdef_filter_block_worker_hook, num_workers);
 3401|  31.9k|  launch_workers(mt_info, num_workers);
 3402|  31.9k|  sync_enc_workers(mt_info, &cpi->common, num_workers);
 3403|  31.9k|}
av1_compute_num_workers_for_mt:
 3499|  92.0k|void av1_compute_num_workers_for_mt(AV1_COMP *cpi) {
 3500|  1.19M|  for (int i = MOD_FP; i < NUM_MT_MODULES; i++) {
  ------------------
  |  Branch (3500:24): [True: 1.10M, False: 92.0k]
  ------------------
 3501|  1.10M|    cpi->ppi->p_mt_info.num_mod_workers[i] =
 3502|  1.10M|        compute_num_mod_workers(cpi, (MULTI_THREADED_MODULES)i);
 3503|  1.10M|  }
 3504|  92.0k|}
ethread.c:is_fpmt_config:
 1139|   174k|                                 const AV1EncoderConfig *oxcf) {
 1140|       |  // FPMT is enabled for AOM_Q and AOM_VBR.
 1141|       |  // TODO(Tarun): Test and enable resize config.
 1142|   174k|  if (oxcf->rc_cfg.mode == AOM_CBR || oxcf->rc_cfg.mode == AOM_CQ) {
  ------------------
  |  Branch (1142:7): [True: 53.4k, False: 120k]
  |  Branch (1142:39): [True: 0, False: 120k]
  ------------------
 1143|  53.4k|    return 0;
 1144|  53.4k|  }
 1145|   120k|  if (ppi->use_svc) {
  ------------------
  |  Branch (1145:7): [True: 0, False: 120k]
  ------------------
 1146|      0|    return 0;
 1147|      0|  }
 1148|   120k|  if (oxcf->tile_cfg.enable_large_scale_tile) {
  ------------------
  |  Branch (1148:7): [True: 0, False: 120k]
  ------------------
 1149|      0|    return 0;
 1150|      0|  }
 1151|   120k|  if (oxcf->dec_model_cfg.timing_info_present) {
  ------------------
  |  Branch (1151:7): [True: 0, False: 120k]
  ------------------
 1152|      0|    return 0;
 1153|      0|  }
 1154|   120k|  if (oxcf->mode != GOOD) {
  ------------------
  |  Branch (1154:7): [True: 0, False: 120k]
  ------------------
 1155|      0|    return 0;
 1156|      0|  }
 1157|   120k|  if (oxcf->tool_cfg.error_resilient_mode) {
  ------------------
  |  Branch (1157:7): [True: 0, False: 120k]
  ------------------
 1158|      0|    return 0;
 1159|      0|  }
 1160|   120k|  if (oxcf->resize_cfg.resize_mode) {
  ------------------
  |  Branch (1160:7): [True: 24.6k, False: 96.1k]
  ------------------
 1161|  24.6k|    return 0;
 1162|  24.6k|  }
 1163|  96.1k|  if (oxcf->pass != AOM_RC_SECOND_PASS) {
  ------------------
  |  Branch (1163:7): [True: 96.1k, False: 0]
  ------------------
 1164|  96.1k|    return 0;
 1165|  96.1k|  }
 1166|      0|  if (oxcf->max_threads < 2) {
  ------------------
  |  Branch (1166:7): [True: 0, False: 0]
  ------------------
 1167|      0|    return 0;
 1168|      0|  }
 1169|      0|  if (!oxcf->fp_mt) {
  ------------------
  |  Branch (1169:7): [True: 0, False: 0]
  ------------------
 1170|      0|    return 0;
 1171|      0|  }
 1172|       |
 1173|      0|  return 1;
 1174|      0|}
ethread.c:prepare_enc_workers:
 1567|  56.0k|                                       int num_workers) {
 1568|  56.0k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 1569|  56.0k|  AV1_COMMON *const cm = &cpi->common;
 1570|       |
 1571|       |  // If a previous frame's encode raised an error after this function ran,
 1572|       |  // accumulate_counters_enc_workers() was skipped via longjmp and the mb
 1573|       |  // buffers (including cpi->td.mb) were never freed. Free them here so the
 1574|       |  // shallow copy of cpi->td.mb below cannot leave a worker's mb aliasing
 1575|       |  // cpi->td.mb's heap allocations on a subsequent partial-allocation failure
 1576|       |  // (which would double-free in encoder_destroy()).
 1577|   150k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1577:33): [True: 94.7k, False: 56.0k]
  ------------------
 1578|  94.7k|    EncWorkerData *const thread_data = &mt_info->tile_thr_data[i];
 1579|  94.7k|    ThreadData *const td = (i == 0) ? &cpi->td : thread_data->original_td;
  ------------------
  |  Branch (1579:28): [True: 56.0k, False: 38.6k]
  ------------------
 1580|  94.7k|    if (td) av1_dealloc_mb_data(&td->mb, av1_num_planes(cm));
  ------------------
  |  Branch (1580:9): [True: 94.7k, False: 0]
  ------------------
 1581|  94.7k|  }
 1582|       |
 1583|   150k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1583:33): [True: 94.7k, False: 56.0k]
  ------------------
 1584|  94.7k|    AVxWorker *const worker = &mt_info->workers[i];
 1585|  94.7k|    EncWorkerData *const thread_data = &mt_info->tile_thr_data[i];
 1586|       |
 1587|  94.7k|    worker->hook = hook;
 1588|  94.7k|    worker->data1 = thread_data;
 1589|  94.7k|    worker->data2 = NULL;
 1590|       |
 1591|  94.7k|    thread_data->thread_id = i;
 1592|       |    // Set the starting tile for each thread.
 1593|  94.7k|    thread_data->start = i;
 1594|       |
 1595|  94.7k|    thread_data->cpi = cpi;
 1596|  94.7k|    if (i == 0) {
  ------------------
  |  Branch (1596:9): [True: 56.0k, False: 38.6k]
  ------------------
 1597|  56.0k|      thread_data->td = &cpi->td;
 1598|  56.0k|    } else {
 1599|  38.6k|      thread_data->td = thread_data->original_td;
 1600|  38.6k|    }
 1601|       |
 1602|  94.7k|    thread_data->td->intrabc_used = 0;
 1603|  94.7k|    thread_data->td->deltaq_used = 0;
 1604|  94.7k|    thread_data->td->abs_sum_level = 0;
 1605|  94.7k|    thread_data->td->rd_counts.seg_tmp_pred_cost[0] = 0;
 1606|  94.7k|    thread_data->td->rd_counts.seg_tmp_pred_cost[1] = 0;
 1607|       |
 1608|       |    // Before encoding a frame, copy the thread data from cpi.
 1609|  94.7k|    if (thread_data->td != &cpi->td) {
  ------------------
  |  Branch (1609:9): [True: 38.6k, False: 56.0k]
  ------------------
 1610|  38.6k|      thread_data->td->mb = cpi->td.mb;
 1611|  38.6k|      thread_data->td->rd_counts = cpi->td.rd_counts;
 1612|  38.6k|      thread_data->td->mb.obmc_buffer = thread_data->td->obmc_buffer;
 1613|       |
 1614|   116k|      for (int x = 0; x < 2; x++) {
  ------------------
  |  Branch (1614:23): [True: 77.3k, False: 38.6k]
  ------------------
 1615|  77.3k|        thread_data->td->mb.intrabc_hash_info.hash_value_buffer[x] =
 1616|  77.3k|            thread_data->td->hash_value_buffer[x];
 1617|  77.3k|      }
 1618|       |      // Keep these conditional expressions in sync with the corresponding ones
 1619|       |      // in accumulate_counters_enc_workers().
 1620|  38.6k|      if (cpi->sf.inter_sf.mv_cost_upd_level != INTERNAL_COST_UPD_OFF) {
  ------------------
  |  Branch (1620:11): [True: 38.6k, False: 0]
  ------------------
 1621|  38.6k|        CHECK_MEM_ERROR(
  ------------------
  |  |   51|  38.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  38.6k|  do {                                                    \
  |  |  |  |   72|  38.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  38.6k|    lval = (expr);                                        \
  |  |  |  |   74|  38.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 38.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  38.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  38.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 38.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1622|  38.6k|            cm, thread_data->td->mv_costs_alloc,
 1623|  38.6k|            (MvCosts *)aom_malloc(sizeof(*thread_data->td->mv_costs_alloc)));
 1624|  38.6k|        thread_data->td->mb.mv_costs = thread_data->td->mv_costs_alloc;
 1625|  38.6k|        *thread_data->td->mb.mv_costs = *cpi->td.mb.mv_costs;
 1626|  38.6k|      }
 1627|  38.6k|      if (cpi->sf.intra_sf.dv_cost_upd_level != INTERNAL_COST_UPD_OFF) {
  ------------------
  |  Branch (1627:11): [True: 23.4k, False: 15.2k]
  ------------------
 1628|       |        // Reset dv_costs to NULL for worker threads when dv cost update is
 1629|       |        // enabled so that only dv_cost_upd_level needs to be checked before the
 1630|       |        // aom_free() call for the same.
 1631|  23.4k|        thread_data->td->mb.dv_costs = NULL;
 1632|  23.4k|        if (av1_need_dv_costs(cpi)) {
  ------------------
  |  Branch (1632:13): [True: 1.23k, False: 22.1k]
  ------------------
 1633|  1.23k|          CHECK_MEM_ERROR(cm, thread_data->td->dv_costs_alloc,
  ------------------
  |  |   51|  1.23k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  1.23k|  do {                                                    \
  |  |  |  |   72|  1.23k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  1.23k|    lval = (expr);                                        \
  |  |  |  |   74|  1.23k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 1.23k]
  |  |  |  |  ------------------
  |  |  |  |   75|  1.23k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  1.23k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 1.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1634|  1.23k|                          (IntraBCMVCosts *)aom_malloc(
 1635|  1.23k|                              sizeof(*thread_data->td->dv_costs_alloc)));
 1636|  1.23k|          thread_data->td->mb.dv_costs = thread_data->td->dv_costs_alloc;
 1637|  1.23k|          *thread_data->td->mb.dv_costs = *cpi->td.mb.dv_costs;
 1638|  1.23k|        }
 1639|  23.4k|      }
 1640|  38.6k|    }
 1641|  94.7k|    av1_alloc_mb_data(cpi, &thread_data->td->mb);
 1642|       |
 1643|       |    // Reset rtc counters.
 1644|  94.7k|    av1_init_rtc_counters(&thread_data->td->mb);
 1645|       |
 1646|  94.7k|    thread_data->td->mb.palette_pixels = 0;
 1647|       |
 1648|  94.7k|    if (thread_data->td->counts != &cpi->counts) {
  ------------------
  |  Branch (1648:9): [True: 38.6k, False: 56.0k]
  ------------------
 1649|  38.6k|      *thread_data->td->counts = cpi->counts;
 1650|  38.6k|    }
 1651|       |
 1652|  94.7k|    if (i > 0) {
  ------------------
  |  Branch (1652:9): [True: 38.6k, False: 56.0k]
  ------------------
 1653|  38.6k|      thread_data->td->mb.palette_buffer = thread_data->td->palette_buffer;
 1654|  38.6k|      thread_data->td->mb.comp_rd_buffer = thread_data->td->comp_rd_buffer;
 1655|  38.6k|      thread_data->td->mb.tmp_conv_dst = thread_data->td->tmp_conv_dst;
 1656|  38.6k|      thread_data->td->mb.upsample_pred = thread_data->td->upsample_pred;
 1657|   116k|      for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (1657:23): [True: 77.3k, False: 38.6k]
  ------------------
 1658|  77.3k|        thread_data->td->mb.tmp_pred_bufs[j] =
 1659|  77.3k|            thread_data->td->tmp_pred_bufs[j];
 1660|  77.3k|      }
 1661|  38.6k|      thread_data->td->mb.pixel_gradient_info =
 1662|  38.6k|          thread_data->td->pixel_gradient_info;
 1663|       |
 1664|  38.6k|      thread_data->td->mb.src_var_info_of_4x4_sub_blocks =
 1665|  38.6k|          thread_data->td->src_var_info_of_4x4_sub_blocks;
 1666|       |
 1667|  38.6k|      thread_data->td->mb.e_mbd.tmp_conv_dst = thread_data->td->mb.tmp_conv_dst;
 1668|  38.6k|      thread_data->td->mb.e_mbd.tmp_upsample_pred =
 1669|  38.6k|          thread_data->td->mb.upsample_pred;
 1670|   116k|      for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (1670:23): [True: 77.3k, False: 38.6k]
  ------------------
 1671|  77.3k|        thread_data->td->mb.e_mbd.tmp_obmc_bufs[j] =
 1672|  77.3k|            thread_data->td->mb.tmp_pred_bufs[j];
 1673|  77.3k|      }
 1674|  38.6k|    }
 1675|  94.7k|  }
 1676|  56.0k|}
ethread.c:launch_workers:
 1485|   104k|                                  int num_workers) {
 1486|   104k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 1487|   299k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1487:33): [True: 195k, False: 104k]
  ------------------
 1488|   195k|    AVxWorker *const worker = &mt_info->workers[i];
 1489|   195k|    worker->had_error = 0;
 1490|   195k|    if (i == 0)
  ------------------
  |  Branch (1490:9): [True: 104k, False: 91.9k]
  ------------------
 1491|   104k|      winterface->execute(worker);
 1492|  91.9k|    else
 1493|  91.9k|      winterface->launch(worker);
 1494|   195k|  }
 1495|   104k|}
ethread.c:sync_enc_workers:
 1498|   104k|                                    AV1_COMMON *const cm, int num_workers) {
 1499|   104k|  const AVxWorkerInterface *const winterface = aom_get_worker_interface();
 1500|   104k|  const AVxWorker *const worker_main = &mt_info->workers[0];
 1501|   104k|  int had_error = worker_main->had_error;
 1502|   104k|  struct aom_internal_error_info error_info;
 1503|       |
 1504|       |  // Read the error_info of main thread.
 1505|   104k|  if (had_error) {
  ------------------
  |  Branch (1505:7): [True: 0, False: 104k]
  ------------------
 1506|      0|    error_info = ((EncWorkerData *)worker_main->data1)->error_info;
 1507|      0|  }
 1508|       |
 1509|       |  // Encoding ends.
 1510|   195k|  for (int i = num_workers - 1; i > 0; i--) {
  ------------------
  |  Branch (1510:33): [True: 91.9k, False: 104k]
  ------------------
 1511|  91.9k|    AVxWorker *const worker = &mt_info->workers[i];
 1512|  91.9k|    if (!winterface->sync(worker)) {
  ------------------
  |  Branch (1512:9): [True: 0, False: 91.9k]
  ------------------
 1513|      0|      had_error = 1;
 1514|      0|      error_info = ((EncWorkerData *)worker->data1)->error_info;
 1515|      0|    }
 1516|  91.9k|  }
 1517|       |
 1518|   104k|  if (had_error) aom_internal_error_copy(cm->error, &error_info);
  ------------------
  |  Branch (1518:7): [True: 0, False: 104k]
  ------------------
 1519|       |
 1520|       |  // Restore xd->error_info of the main thread back to cm->error so that the
 1521|       |  // multithreaded code, when executed using a single thread, has a valid
 1522|       |  // xd->error_info.
 1523|   104k|  MACROBLOCKD *const xd = &((EncWorkerData *)worker_main->data1)->td->mb.e_mbd;
 1524|   104k|  xd->error_info = cm->error;
 1525|   104k|}
ethread.c:accumulate_counters_enc_workers:
 1528|  56.0k|                                                   int num_workers) {
 1529|   150k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1529:33): [True: 94.7k, False: 56.0k]
  ------------------
 1530|  94.7k|    AVxWorker *const worker = &cpi->mt_info.workers[i];
 1531|  94.7k|    EncWorkerData *const thread_data = (EncWorkerData *)worker->data1;
 1532|  94.7k|    cpi->intrabc_used |= thread_data->td->intrabc_used;
 1533|  94.7k|    cpi->deltaq_used |= thread_data->td->deltaq_used;
 1534|       |    // Accumulate rtc counters.
 1535|  94.7k|    if (!frame_is_intra_only(&cpi->common))
  ------------------
  |  Branch (1535:9): [True: 63.7k, False: 30.9k]
  ------------------
 1536|  63.7k|      av1_accumulate_rtc_counters(cpi, &thread_data->td->mb);
 1537|  94.7k|    cpi->palette_pixel_num += thread_data->td->mb.palette_pixels;
 1538|  94.7k|    if (thread_data->td != &cpi->td) {
  ------------------
  |  Branch (1538:9): [True: 38.6k, False: 56.0k]
  ------------------
 1539|       |      // Keep these conditional expressions in sync with the corresponding ones
 1540|       |      // in prepare_enc_workers().
 1541|  38.6k|      if (cpi->sf.inter_sf.mv_cost_upd_level != INTERNAL_COST_UPD_OFF) {
  ------------------
  |  Branch (1541:11): [True: 38.6k, False: 0]
  ------------------
 1542|  38.6k|        aom_free(thread_data->td->mv_costs_alloc);
 1543|  38.6k|        thread_data->td->mv_costs_alloc = NULL;
 1544|  38.6k|      }
 1545|  38.6k|      if (cpi->sf.intra_sf.dv_cost_upd_level != INTERNAL_COST_UPD_OFF) {
  ------------------
  |  Branch (1545:11): [True: 23.4k, False: 15.2k]
  ------------------
 1546|  23.4k|        aom_free(thread_data->td->dv_costs_alloc);
 1547|  23.4k|        thread_data->td->dv_costs_alloc = NULL;
 1548|  23.4k|      }
 1549|  38.6k|    }
 1550|  94.7k|    av1_dealloc_mb_data(&thread_data->td->mb, av1_num_planes(&cpi->common));
 1551|       |
 1552|       |    // Accumulate counters.
 1553|  94.7k|    if (i > 0) {
  ------------------
  |  Branch (1553:9): [True: 38.6k, False: 56.0k]
  ------------------
 1554|  38.6k|      av1_accumulate_frame_counts(&cpi->counts, thread_data->td->counts);
 1555|  38.6k|      accumulate_rd_opt(&cpi->td, thread_data->td);
 1556|  38.6k|      cpi->td.mb.txfm_search_info.txb_split_count +=
 1557|  38.6k|          thread_data->td->mb.txfm_search_info.txb_split_count;
 1558|       |#if CONFIG_SPEED_STATS
 1559|       |      cpi->td.mb.txfm_search_info.tx_search_count +=
 1560|       |          thread_data->td->mb.txfm_search_info.tx_search_count;
 1561|       |#endif  // CONFIG_SPEED_STATS
 1562|  38.6k|    }
 1563|  94.7k|  }
 1564|  56.0k|}
ethread.c:accumulate_rd_opt:
   40|  38.6k|static inline void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) {
   41|  38.6k|  td->rd_counts.compound_ref_used_flag |=
   42|  38.6k|      td_t->rd_counts.compound_ref_used_flag;
   43|  38.6k|  td->rd_counts.skip_mode_used_flag |= td_t->rd_counts.skip_mode_used_flag;
   44|       |
   45|   773k|  for (int i = 0; i < TX_SIZES_ALL; i++) {
  ------------------
  |  Branch (45:19): [True: 734k, False: 38.6k]
  ------------------
   46|  12.4M|    for (int j = 0; j < TX_TYPES; j++)
  ------------------
  |  Branch (46:21): [True: 11.7M, False: 734k]
  ------------------
   47|  11.7M|      td->rd_counts.tx_type_used[i][j] += td_t->rd_counts.tx_type_used[i][j];
   48|   734k|  }
   49|       |
   50|   889k|  for (int i = 0; i < BLOCK_SIZES_ALL; i++) {
  ------------------
  |  Branch (50:19): [True: 850k, False: 38.6k]
  ------------------
   51|  2.55M|    for (int j = 0; j < 2; j++) {
  ------------------
  |  Branch (51:21): [True: 1.70M, False: 850k]
  ------------------
   52|  1.70M|      td->rd_counts.obmc_used[i][j] += td_t->rd_counts.obmc_used[i][j];
   53|  1.70M|    }
   54|   850k|  }
   55|       |
   56|   116k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (56:19): [True: 77.3k, False: 38.6k]
  ------------------
   57|  77.3k|    td->rd_counts.warped_used[i] += td_t->rd_counts.warped_used[i];
   58|  77.3k|  }
   59|       |
   60|  38.6k|  td->rd_counts.seg_tmp_pred_cost[0] += td_t->rd_counts.seg_tmp_pred_cost[0];
   61|  38.6k|  td->rd_counts.seg_tmp_pred_cost[1] += td_t->rd_counts.seg_tmp_pred_cost[1];
   62|       |
   63|  38.6k|  td->rd_counts.newmv_or_intra_blocks += td_t->rd_counts.newmv_or_intra_blocks;
   64|  38.6k|}
ethread.c:get_sb_rows_in_frame:
  236|   111k|static inline int get_sb_rows_in_frame(AV1_COMMON *cm) {
  237|   111k|  return CEIL_POWER_OF_TWO(cm->mi_params.mi_rows,
  ------------------
  |  |   62|   111k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  238|   111k|                           cm->seq_params->mib_size_log2);
  239|   111k|}
ethread.c:compute_max_sb_rows_cols:
 1789|  56.0k|                                            int *max_sb_cols_in_tile) {
 1790|  56.0k|  const int tile_rows = cm->tiles.rows;
 1791|  56.0k|  const int mib_size_log2 = cm->seq_params->mib_size_log2;
 1792|  56.0k|  const int num_mi_rows = cm->mi_params.mi_rows;
 1793|  56.0k|  const int *const row_start_sb = cm->tiles.row_start_sb;
 1794|   127k|  for (int row = 0; row < tile_rows; row++) {
  ------------------
  |  Branch (1794:21): [True: 71.8k, False: 56.0k]
  ------------------
 1795|  71.8k|    const int mi_row_start = row_start_sb[row] << mib_size_log2;
 1796|  71.8k|    const int mi_row_end =
 1797|  71.8k|        AOMMIN(row_start_sb[row + 1] << mib_size_log2, num_mi_rows);
  ------------------
  |  |   34|  71.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.7k, False: 56.0k]
  |  |  ------------------
  ------------------
 1798|  71.8k|    const int num_sb_rows_in_tile =
 1799|  71.8k|        CEIL_POWER_OF_TWO(mi_row_end - mi_row_start, mib_size_log2);
  ------------------
  |  |   62|  71.8k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1800|  71.8k|    *max_sb_rows_in_tile = AOMMAX(*max_sb_rows_in_tile, num_sb_rows_in_tile);
  ------------------
  |  |   35|  71.8k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 595, False: 71.2k]
  |  |  ------------------
  ------------------
 1801|  71.8k|  }
 1802|       |
 1803|  56.0k|  const int tile_cols = cm->tiles.cols;
 1804|  56.0k|  const int num_mi_cols = cm->mi_params.mi_cols;
 1805|  56.0k|  const int *const col_start_sb = cm->tiles.col_start_sb;
 1806|   127k|  for (int col = 0; col < tile_cols; col++) {
  ------------------
  |  Branch (1806:21): [True: 71.2k, False: 56.0k]
  ------------------
 1807|  71.2k|    const int mi_col_start = col_start_sb[col] << mib_size_log2;
 1808|  71.2k|    const int mi_col_end =
 1809|  71.2k|        AOMMIN(col_start_sb[col + 1] << mib_size_log2, num_mi_cols);
  ------------------
  |  |   34|  71.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.2k, False: 56.0k]
  |  |  ------------------
  ------------------
 1810|  71.2k|    const int num_sb_cols_in_tile =
 1811|  71.2k|        CEIL_POWER_OF_TWO(mi_col_end - mi_col_start, mib_size_log2);
  ------------------
  |  |   62|  71.2k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
 1812|  71.2k|    *max_sb_cols_in_tile = AOMMAX(*max_sb_cols_in_tile, num_sb_cols_in_tile);
  ------------------
  |  |   35|  71.2k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 568, False: 70.6k]
  |  |  ------------------
  ------------------
 1813|  71.2k|  }
 1814|  56.0k|}
ethread.c:row_mt_mem_alloc:
  242|  23.0k|                             int alloc_row_ctx) {
  243|  23.0k|  struct AV1Common *cm = &cpi->common;
  244|  23.0k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &cpi->mt_info.enc_row_mt;
  245|  23.0k|  const int tile_cols = cm->tiles.cols;
  246|  23.0k|  const int tile_rows = cm->tiles.rows;
  247|  23.0k|  int tile_col, tile_row;
  248|       |
  249|  23.0k|  av1_row_mt_mem_dealloc(cpi);
  250|       |
  251|       |  // Allocate memory for row based multi-threading
  252|  23.0k|  assert(cpi->allocated_tiles == tile_cols * tile_rows);
  253|  56.5k|  for (tile_row = 0; tile_row < tile_rows; tile_row++) {
  ------------------
  |  Branch (253:22): [True: 33.4k, False: 23.0k]
  ------------------
  254|  84.3k|    for (tile_col = 0; tile_col < tile_cols; tile_col++) {
  ------------------
  |  Branch (254:24): [True: 50.8k, False: 33.4k]
  ------------------
  255|  50.8k|      int tile_index = tile_row * tile_cols + tile_col;
  256|  50.8k|      TileDataEnc *const this_tile = &cpi->tile_data[tile_index];
  257|       |
  258|  50.8k|      row_mt_sync_mem_alloc(&this_tile->row_mt_sync, cm, max_rows);
  259|       |
  260|  50.8k|      if (alloc_row_ctx) {
  ------------------
  |  Branch (260:11): [True: 50.8k, False: 0]
  ------------------
  261|  50.8k|        assert(max_cols > 0);
  262|  50.8k|        const int num_row_ctx = AOMMAX(1, (max_cols - 1));
  ------------------
  |  |   35|  50.8k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 46.7k, False: 4.17k]
  |  |  ------------------
  ------------------
  263|  50.8k|        CHECK_MEM_ERROR(cm, this_tile->row_ctx,
  ------------------
  |  |   51|  50.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  50.8k|  do {                                                    \
  |  |  |  |   72|  50.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  50.8k|    lval = (expr);                                        \
  |  |  |  |   74|  50.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 50.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  50.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  50.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|  50.8k|                        (FRAME_CONTEXT *)aom_memalign(
  265|  50.8k|                            16, num_row_ctx * sizeof(*this_tile->row_ctx)));
  266|  50.8k|      }
  267|  50.8k|    }
  268|  33.4k|  }
  269|  23.0k|  enc_row_mt->allocated_tile_cols = tile_cols;
  270|  23.0k|  enc_row_mt->allocated_tile_rows = tile_rows;
  271|  23.0k|  const int sb_rows = get_sb_rows_in_frame(cm);
  272|  23.0k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  23.0k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  23.0k|  do {                                                    \
  |  |  |  |   72|  23.0k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  23.0k|    lval = (expr);                                        \
  |  |  |  |   74|  23.0k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 23.0k]
  |  |  |  |  ------------------
  |  |  |  |   75|  23.0k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  23.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 23.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  23.0k|      cm, enc_row_mt->num_tile_cols_done,
  274|  23.0k|      aom_malloc(sizeof(*enc_row_mt->num_tile_cols_done) * sb_rows));
  275|       |
  276|  23.0k|  enc_row_mt->allocated_rows = max_rows;
  277|  23.0k|  enc_row_mt->allocated_cols = max_cols - 1;
  278|  23.0k|  enc_row_mt->allocated_sb_rows = sb_rows;
  279|  23.0k|}
ethread.c:lpf_pipeline_mt_init:
 1864|  56.0k|static void lpf_pipeline_mt_init(AV1_COMP *cpi, int num_workers) {
 1865|       |  // Pipelining of loop-filtering after encoding is enabled when loop-filter
 1866|       |  // level is chosen based on quantizer and frame type. It is disabled in case
 1867|       |  // of 'LOOPFILTER_SELECTIVELY' as the stats collected during encoding stage
 1868|       |  // decides the filter level. Loop-filtering is disabled in case
 1869|       |  // of non-reference frames and for frames with intra block copy tool enabled.
 1870|  56.0k|  AV1_COMMON *cm = &cpi->common;
 1871|  56.0k|  const int use_loopfilter = is_loopfilter_used(cm);
 1872|  56.0k|  const int use_superres = av1_superres_scaled(cm);
 1873|  56.0k|  const int use_cdef = is_cdef_used(cm);
 1874|  56.0k|  const int use_restoration = is_restoration_used(cm);
 1875|  56.0k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 1876|  56.0k|  MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
 1877|       |
 1878|  56.0k|  const unsigned int skip_apply_postproc_filters =
 1879|  56.0k|      derive_skip_apply_postproc_filters(cpi, use_loopfilter, use_cdef,
 1880|  56.0k|                                         use_superres, use_restoration);
 1881|  56.0k|  mt_info->pipeline_lpf_mt_with_enc =
 1882|  56.0k|      (cpi->oxcf.mode == REALTIME) && (cpi->oxcf.speed >= 5) &&
  ------------------
  |  Branch (1882:7): [True: 18.9k, False: 37.1k]
  |  Branch (1882:39): [True: 18.9k, False: 0]
  ------------------
 1883|  18.9k|      (cpi->sf.lpf_sf.lpf_pick == LPF_PICK_FROM_Q) &&
  ------------------
  |  Branch (1883:7): [True: 18.9k, False: 0]
  ------------------
 1884|  18.9k|      (cpi->oxcf.algo_cfg.loopfilter_control != LOOPFILTER_SELECTIVELY) &&
  ------------------
  |  Branch (1884:7): [True: 18.9k, False: 0]
  ------------------
 1885|  18.9k|      !cpi->ppi->rtc_ref.non_reference_frame && !cm->features.allow_intrabc &&
  ------------------
  |  Branch (1885:7): [True: 18.9k, False: 0]
  |  Branch (1885:49): [True: 18.9k, False: 0]
  ------------------
 1886|  18.9k|      ((skip_apply_postproc_filters & SKIP_APPLY_LOOPFILTER) == 0);
  ------------------
  |  Branch (1886:7): [True: 18.9k, False: 0]
  ------------------
 1887|       |
 1888|  56.0k|  if (!mt_info->pipeline_lpf_mt_with_enc) return;
  ------------------
  |  Branch (1888:7): [True: 37.1k, False: 18.9k]
  ------------------
 1889|       |
 1890|  18.9k|  set_postproc_filter_default_params(cm);
 1891|       |
 1892|  18.9k|  if (!use_loopfilter) return;
  ------------------
  |  Branch (1892:7): [True: 749, False: 18.1k]
  ------------------
 1893|       |
 1894|  18.1k|  const LPF_PICK_METHOD method = cpi->sf.lpf_sf.lpf_pick;
 1895|  18.1k|  assert(method == LPF_PICK_FROM_Q);
 1896|  18.1k|  assert(cpi->oxcf.algo_cfg.loopfilter_control != LOOPFILTER_SELECTIVELY);
 1897|       |
 1898|  18.1k|  av1_pick_filter_level(cpi->source, cpi, method);
 1899|       |
 1900|  18.1k|  struct loopfilter *lf = &cm->lf;
 1901|  18.1k|  const int plane_start = 0;
 1902|  18.1k|  const int plane_end = av1_num_planes(cm);
 1903|  18.1k|  int planes_to_lf[MAX_MB_PLANE];
 1904|  18.1k|  if (lpf_mt_with_enc_enabled(cpi->mt_info.pipeline_lpf_mt_with_enc,
  ------------------
  |  Branch (1904:7): [True: 17.8k, False: 348]
  ------------------
 1905|  18.1k|                              lf->filter_level)) {
 1906|  17.8k|    set_planes_to_loop_filter(lf, planes_to_lf, plane_start, plane_end);
 1907|  17.8k|    int lpf_opt_level = get_lpf_opt_level(&cpi->sf);
 1908|  17.8k|    assert(lpf_opt_level == 2);
 1909|       |
 1910|  17.8k|    const int start_mi_row = 0;
 1911|  17.8k|    const int end_mi_row = start_mi_row + cm->mi_params.mi_rows;
 1912|       |
 1913|  17.8k|    av1_loop_filter_frame_init(cm, plane_start, plane_end);
 1914|       |
 1915|  17.8k|    assert(mt_info->num_mod_workers[MOD_ENC] ==
 1916|  17.8k|           mt_info->num_mod_workers[MOD_LPF]);
 1917|  17.8k|    loop_filter_frame_mt_init(cm, start_mi_row, end_mi_row, planes_to_lf,
 1918|  17.8k|                              mt_info->num_mod_workers[MOD_LPF],
 1919|  17.8k|                              &mt_info->lf_row_sync, lpf_opt_level,
 1920|  17.8k|                              cm->seq_params->mib_size_log2);
 1921|       |
 1922|  49.8k|    for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (1922:35): [True: 32.0k, False: 17.8k]
  ------------------
 1923|  32.0k|      EncWorkerData *const thread_data = &mt_info->tile_thr_data[i];
 1924|       |      // Initialize loopfilter data
 1925|  32.0k|      thread_data->lf_sync = &mt_info->lf_row_sync;
 1926|  32.0k|      thread_data->lf_data = &thread_data->lf_sync->lfdata[i];
 1927|  32.0k|      loop_filter_data_reset(thread_data->lf_data, &cm->cur_frame->buf, cm, xd);
 1928|  32.0k|    }
 1929|  17.8k|  }
 1930|  18.1k|}
ethread.c:lpf_mt_with_enc_enabled:
  589|   112k|                                    const int filter_level[2]) {
  590|   112k|  return pipeline_lpf_mt_with_enc && (filter_level[0] || filter_level[1]);
  ------------------
  |  Branch (590:10): [True: 52.2k, False: 60.4k]
  |  Branch (590:39): [True: 49.8k, False: 2.43k]
  |  Branch (590:58): [True: 18.4E, False: 2.43k]
  ------------------
  591|   112k|}
ethread.c:assign_tile_to_thread:
  311|  56.0k|                                         int num_tiles, int num_workers) {
  312|  56.0k|  int tile_id = 0;
  313|  56.0k|  int i;
  314|       |
  315|   150k|  for (i = 0; i < num_workers; i++) {
  ------------------
  |  Branch (315:15): [True: 94.7k, False: 56.0k]
  ------------------
  316|  94.7k|    thread_id_to_tile_id[i] = tile_id++;
  317|  94.7k|    if (tile_id == num_tiles) tile_id = 0;
  ------------------
  |  Branch (317:9): [True: 57.5k, False: 37.1k]
  ------------------
  318|  94.7k|  }
  319|  56.0k|}
ethread.c:enc_row_mt_worker_hook:
  593|  94.4k|static int enc_row_mt_worker_hook(void *arg1, void *unused) {
  594|  94.4k|  EncWorkerData *const thread_data = (EncWorkerData *)arg1;
  595|  94.4k|  AV1_COMP *const cpi = thread_data->cpi;
  596|  94.4k|  int thread_id = thread_data->thread_id;
  597|  94.4k|  AV1EncRowMultiThreadInfo *const enc_row_mt = &cpi->mt_info.enc_row_mt;
  598|  94.4k|#if CONFIG_MULTITHREAD
  599|  94.4k|  pthread_mutex_t *enc_row_mt_mutex_ = enc_row_mt->mutex_;
  600|  94.4k|#endif
  601|  94.4k|  (void)unused;
  602|       |
  603|  94.4k|  struct aom_internal_error_info *const error_info = &thread_data->error_info;
  604|  94.4k|  AV1LfSync *const lf_sync = thread_data->lf_sync;
  605|  94.4k|  MACROBLOCKD *const xd = &thread_data->td->mb.e_mbd;
  606|  94.4k|  xd->error_info = error_info;
  607|  94.4k|  AV1_COMMON *volatile const cm = &cpi->common;
  608|  94.4k|  volatile const bool do_pipelined_lpf_mt_with_enc = lpf_mt_with_enc_enabled(
  609|  94.4k|      cpi->mt_info.pipeline_lpf_mt_with_enc, cm->lf.filter_level);
  610|       |
  611|       |  // The jmp_buf is valid only for the duration of the function that calls
  612|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
  613|       |  // before it returns.
  614|  94.4k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (614:7): [True: 0, False: 94.4k]
  ------------------
  615|      0|    error_info->setjmp = 0;
  616|      0|#if CONFIG_MULTITHREAD
  617|      0|    pthread_mutex_lock(enc_row_mt_mutex_);
  618|      0|    enc_row_mt->row_mt_exit = true;
  619|       |    // Wake up all the workers waiting in launch_loop_filter_rows() to exit in
  620|       |    // case of an error.
  621|      0|    pthread_cond_broadcast(enc_row_mt->cond_);
  622|      0|    pthread_mutex_unlock(enc_row_mt_mutex_);
  623|      0|#endif
  624|      0|    set_encoding_done(cpi);
  625|       |
  626|      0|    if (do_pipelined_lpf_mt_with_enc) {
  ------------------
  |  Branch (626:9): [True: 0, False: 0]
  ------------------
  627|      0|#if CONFIG_MULTITHREAD
  628|      0|      pthread_mutex_lock(lf_sync->job_mutex);
  629|      0|      lf_sync->lf_mt_exit = true;
  630|      0|      pthread_mutex_unlock(lf_sync->job_mutex);
  631|      0|#endif
  632|      0|      av1_set_vert_loop_filter_done(&cpi->common, lf_sync,
  633|      0|                                    cpi->common.seq_params->mib_size_log2);
  634|      0|    }
  635|      0|    return 0;
  636|      0|  }
  637|  94.4k|  error_info->setjmp = 1;
  638|       |
  639|  94.4k|  const int mib_size_log2 = cm->seq_params->mib_size_log2;
  640|  94.4k|  int cur_tile_id = enc_row_mt->thread_id_to_tile_id[thread_id];
  641|       |
  642|       |  // Preallocate the pc_tree for realtime coding to reduce the cost of memory
  643|       |  // allocation.
  644|  94.4k|  if (cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (644:7): [True: 34.0k, False: 60.4k]
  ------------------
  645|  34.0k|    thread_data->td->pc_root = av1_alloc_pc_tree_node(cm->seq_params->sb_size);
  646|  34.0k|    if (!thread_data->td->pc_root)
  ------------------
  |  Branch (646:9): [True: 0, False: 34.0k]
  ------------------
  647|      0|      aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  648|      0|                         "Failed to allocate PC_TREE");
  649|  60.4k|  } else {
  650|  60.4k|    thread_data->td->pc_root = NULL;
  651|  60.4k|  }
  652|       |
  653|  94.4k|  assert(cur_tile_id != -1);
  654|       |
  655|  94.4k|  const BLOCK_SIZE fp_block_size = cpi->fp_block_size;
  656|  94.4k|  int end_of_frame = 0;
  657|  94.4k|  bool row_mt_exit = false;
  658|       |
  659|       |  // When master thread does not have a valid job to process, xd->tile_ctx
  660|       |  // is not set and it contains NULL pointer. This can result in NULL pointer
  661|       |  // access violation if accessed beyond the encode stage. Hence, updating
  662|       |  // thread_data->td->mb.e_mbd.tile_ctx is initialized with common frame
  663|       |  // context to avoid NULL pointer access in subsequent stages.
  664|  94.4k|  thread_data->td->mb.e_mbd.tile_ctx = cm->fc;
  665|   198k|  while (1) {
  ------------------
  |  Branch (665:10): [True: 198k, Folded]
  ------------------
  666|   198k|    int current_mi_row = -1;
  667|   198k|#if CONFIG_MULTITHREAD
  668|   198k|    pthread_mutex_lock(enc_row_mt_mutex_);
  669|   198k|#endif
  670|   198k|    row_mt_exit = enc_row_mt->row_mt_exit;
  671|       |    // row_mt_exit check here can be avoided as it is checked after
  672|       |    // sync_read_ptr() in encode_sb_row(). However, checking row_mt_exit here,
  673|       |    // tries to return before calling the function get_next_job().
  674|   198k|    if (!row_mt_exit &&
  ------------------
  |  Branch (674:9): [True: 198k, False: 18.4E]
  ------------------
  675|   198k|        !get_next_job(&cpi->tile_data[cur_tile_id], &current_mi_row,
  ------------------
  |  Branch (675:9): [True: 111k, False: 86.7k]
  ------------------
  676|   198k|                      cm->seq_params->mib_size)) {
  677|       |      // No jobs are available for the current tile. Query for the status of
  678|       |      // other tiles and get the next job if available
  679|   111k|      switch_tile_and_get_next_job(cm, cpi->tile_data, &cur_tile_id,
  680|   111k|                                   &current_mi_row, &end_of_frame, 0,
  681|   111k|                                   fp_block_size);
  682|   111k|    }
  683|   198k|#if CONFIG_MULTITHREAD
  684|   198k|    pthread_mutex_unlock(enc_row_mt_mutex_);
  685|   198k|#endif
  686|       |    // When row_mt_exit is set to true, other workers need not pursue any
  687|       |    // further jobs.
  688|   198k|    if (row_mt_exit) {
  ------------------
  |  Branch (688:9): [True: 0, False: 198k]
  ------------------
  689|      0|      error_info->setjmp = 0;
  690|      0|      return 1;
  691|      0|    }
  692|       |
  693|   198k|    if (end_of_frame) break;
  ------------------
  |  Branch (693:9): [True: 94.7k, False: 103k]
  ------------------
  694|       |
  695|   103k|    TileDataEnc *const this_tile = &cpi->tile_data[cur_tile_id];
  696|   103k|    AV1EncRowMultiThreadSync *const row_mt_sync = &this_tile->row_mt_sync;
  697|   103k|    const TileInfo *const tile_info = &this_tile->tile_info;
  698|   103k|    const int tile_row = tile_info->tile_row;
  699|   103k|    const int tile_col = tile_info->tile_col;
  700|   103k|    ThreadData *td = thread_data->td;
  701|   103k|    const int sb_row = current_mi_row >> mib_size_log2;
  702|       |
  703|   103k|    assert(current_mi_row != -1 && current_mi_row <= tile_info->mi_row_end);
  704|       |
  705|   103k|    td->mb.e_mbd.tile_ctx = td->tctx;
  706|   103k|    td->mb.tile_pb_ctx = &this_tile->tctx;
  707|   103k|    td->abs_sum_level = 0;
  708|       |
  709|   103k|    if (this_tile->allow_update_cdf) {
  ------------------
  |  Branch (709:9): [True: 103k, False: 18.4E]
  ------------------
  710|   103k|      td->mb.row_ctx = this_tile->row_ctx;
  711|   103k|      if (current_mi_row == tile_info->mi_row_start)
  ------------------
  |  Branch (711:11): [True: 95.7k, False: 7.92k]
  ------------------
  712|  95.7k|        *td->mb.e_mbd.tile_ctx = this_tile->tctx;
  713|  18.4E|    } else {
  714|  18.4E|      *td->mb.e_mbd.tile_ctx = this_tile->tctx;
  715|  18.4E|    }
  716|       |
  717|   103k|    av1_init_above_context(&cm->above_contexts, av1_num_planes(cm), tile_row,
  718|   103k|                           &td->mb.e_mbd);
  719|   103k|#if !CONFIG_REALTIME_ONLY
  720|   103k|    cfl_init(&td->mb.e_mbd.cfl, cm->seq_params);
  721|   103k|#endif
  722|   103k|    if (td->mb.txfm_search_info.mb_rd_record != NULL) {
  ------------------
  |  Branch (722:9): [True: 65.2k, False: 38.2k]
  ------------------
  723|  65.2k|      av1_crc32c_calculator_init(
  724|  65.2k|          &td->mb.txfm_search_info.mb_rd_record->crc_calculator);
  725|  65.2k|    }
  726|       |
  727|   103k|    av1_encode_sb_row(cpi, td, tile_row, tile_col, current_mi_row);
  728|   103k|#if CONFIG_MULTITHREAD
  729|   103k|    pthread_mutex_lock(enc_row_mt_mutex_);
  730|   103k|#endif
  731|   103k|    this_tile->abs_sum_level += td->abs_sum_level;
  732|   103k|    row_mt_sync->num_threads_working--;
  733|   103k|    enc_row_mt->num_tile_cols_done[sb_row]++;
  734|   103k|#if CONFIG_MULTITHREAD
  735|   103k|    pthread_cond_broadcast(enc_row_mt->cond_);
  736|   103k|    pthread_mutex_unlock(enc_row_mt_mutex_);
  737|   103k|#endif
  738|   103k|  }
  739|  94.4k|  if (do_pipelined_lpf_mt_with_enc) {
  ------------------
  |  Branch (739:7): [True: 32.0k, False: 62.4k]
  ------------------
  740|       |    // Loop-filter a superblock row if encoding of the current and next
  741|       |    // superblock row is complete.
  742|       |    // TODO(deepa.kg @ittiam.com) Evaluate encoder speed by interleaving
  743|       |    // encoding and loop filter stage.
  744|  32.0k|    launch_loop_filter_rows(cm, thread_data, enc_row_mt, mib_size_log2);
  745|  32.0k|  }
  746|  94.4k|  av1_free_pc_tree_recursive(thread_data->td->pc_root, av1_num_planes(cm), 0, 0,
  747|  94.4k|                             cpi->sf.part_sf.partition_search_type);
  748|       |  thread_data->td->pc_root = NULL;
  749|  94.4k|  error_info->setjmp = 0;
  750|  94.4k|  return 1;
  751|  94.4k|}
ethread.c:get_next_job:
  322|   215k|                               int *current_mi_row, int mib_size) {
  323|   215k|  AV1EncRowMultiThreadSync *const row_mt_sync = &tile_data->row_mt_sync;
  324|   215k|  const int mi_row_end = tile_data->tile_info.mi_row_end;
  325|       |
  326|   215k|  if (row_mt_sync->next_mi_row < mi_row_end) {
  ------------------
  |  Branch (326:7): [True: 103k, False: 111k]
  ------------------
  327|   103k|    *current_mi_row = row_mt_sync->next_mi_row;
  328|   103k|    row_mt_sync->num_threads_working++;
  329|   103k|    row_mt_sync->next_mi_row += mib_size;
  330|   103k|    return 1;
  331|   103k|  }
  332|   111k|  return 0;
  333|   215k|}
ethread.c:switch_tile_and_get_next_job:
  338|   111k|    const BLOCK_SIZE fp_block_size) {
  339|   111k|  const int tile_cols = cm->tiles.cols;
  340|   111k|  const int tile_rows = cm->tiles.rows;
  341|       |
  342|   111k|  int tile_id = -1;  // Stores the tile ID with minimum proc done
  343|   111k|  int max_mis_to_encode = 0;
  344|   111k|  int min_num_threads_working = INT_MAX;
  345|       |
  346|   305k|  for (int tile_row = 0; tile_row < tile_rows; tile_row++) {
  ------------------
  |  Branch (346:26): [True: 193k, False: 111k]
  ------------------
  347|   560k|    for (int tile_col = 0; tile_col < tile_cols; tile_col++) {
  ------------------
  |  Branch (347:28): [True: 367k, False: 193k]
  ------------------
  348|   367k|      int tile_index = tile_row * tile_cols + tile_col;
  349|   367k|      TileDataEnc *const this_tile = &tile_data[tile_index];
  350|   367k|      AV1EncRowMultiThreadSync *const row_mt_sync = &this_tile->row_mt_sync;
  351|       |
  352|       |#if CONFIG_REALTIME_ONLY
  353|       |      int num_b_rows_in_tile =
  354|       |          av1_get_sb_rows_in_tile(cm, &this_tile->tile_info);
  355|       |      int num_b_cols_in_tile =
  356|       |          av1_get_sb_cols_in_tile(cm, &this_tile->tile_info);
  357|       |#else
  358|   367k|      int num_b_rows_in_tile =
  359|   367k|          is_firstpass
  ------------------
  |  Branch (359:11): [True: 0, False: 367k]
  ------------------
  360|   367k|              ? av1_get_unit_rows_in_tile(&this_tile->tile_info, fp_block_size)
  361|   367k|              : av1_get_sb_rows_in_tile(cm, &this_tile->tile_info);
  362|   367k|      int num_b_cols_in_tile =
  363|   367k|          is_firstpass
  ------------------
  |  Branch (363:11): [True: 0, False: 367k]
  ------------------
  364|   367k|              ? av1_get_unit_cols_in_tile(&this_tile->tile_info, fp_block_size)
  365|   367k|              : av1_get_sb_cols_in_tile(cm, &this_tile->tile_info);
  366|   367k|#endif
  367|   367k|      int theoretical_limit_on_threads =
  368|   367k|          AOMMIN((num_b_cols_in_tile + 1) >> 1, num_b_rows_in_tile);
  ------------------
  |  |   34|   367k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.7k, False: 351k]
  |  |  ------------------
  ------------------
  369|   367k|      int num_threads_working = row_mt_sync->num_threads_working;
  370|       |
  371|   367k|      if (num_threads_working < theoretical_limit_on_threads) {
  ------------------
  |  Branch (371:11): [True: 265k, False: 102k]
  ------------------
  372|   265k|        int num_mis_to_encode =
  373|   265k|            this_tile->tile_info.mi_row_end - row_mt_sync->next_mi_row;
  374|       |
  375|       |        // Tile to be processed by this thread is selected on the basis of
  376|       |        // availability of jobs:
  377|       |        // 1) If jobs are available, tile to be processed is chosen on the
  378|       |        // basis of minimum number of threads working for that tile. If two or
  379|       |        // more tiles have same number of threads working for them, then the
  380|       |        // tile with maximum number of jobs available will be chosen.
  381|       |        // 2) If no jobs are available, then end_of_frame is reached.
  382|   265k|        if (num_mis_to_encode > 0) {
  ------------------
  |  Branch (382:13): [True: 40.3k, False: 224k]
  ------------------
  383|  40.3k|          if (num_threads_working < min_num_threads_working) {
  ------------------
  |  Branch (383:15): [True: 16.9k, False: 23.4k]
  ------------------
  384|  16.9k|            min_num_threads_working = num_threads_working;
  385|  16.9k|            max_mis_to_encode = 0;
  386|  16.9k|          }
  387|  40.3k|          if (num_threads_working == min_num_threads_working &&
  ------------------
  |  Branch (387:15): [True: 40.3k, False: 0]
  ------------------
  388|  40.3k|              num_mis_to_encode > max_mis_to_encode) {
  ------------------
  |  Branch (388:15): [True: 16.9k, False: 23.4k]
  ------------------
  389|  16.9k|            tile_id = tile_index;
  390|  16.9k|            max_mis_to_encode = num_mis_to_encode;
  391|  16.9k|          }
  392|  40.3k|        }
  393|   265k|      }
  394|   367k|    }
  395|   193k|  }
  396|   111k|  if (tile_id == -1) {
  ------------------
  |  Branch (396:7): [True: 94.7k, False: 16.9k]
  ------------------
  397|  94.7k|    *end_of_frame = 1;
  398|  94.7k|  } else {
  399|       |    // Update the current tile id to the tile id that will be processed next,
  400|       |    // which will be the least processed tile.
  401|  16.9k|    *cur_tile_id = tile_id;
  402|  16.9k|    const int unit_height = mi_size_high[fp_block_size];
  403|  16.9k|    get_next_job(&tile_data[tile_id], current_mi_row,
  404|  16.9k|                 is_firstpass ? unit_height : cm->seq_params->mib_size);
  ------------------
  |  Branch (404:18): [True: 0, False: 16.9k]
  ------------------
  405|  16.9k|  }
  406|   111k|}
ethread.c:launch_loop_filter_rows:
  522|  32.0k|                                    int mib_size_log2) {
  523|  32.0k|  AV1LfSync *const lf_sync = (AV1LfSync *)thread_data->lf_sync;
  524|  32.0k|  const int sb_rows = get_sb_rows_in_frame(cm);
  525|  32.0k|  AV1LfMTInfo *cur_job_info;
  526|  32.0k|  bool row_mt_exit = false;
  527|  32.0k|  (void)enc_row_mt;
  528|  32.0k|#if CONFIG_MULTITHREAD
  529|  32.0k|  pthread_mutex_t *enc_row_mt_mutex_ = enc_row_mt->mutex_;
  530|  32.0k|#endif
  531|       |
  532|   101k|  while ((cur_job_info = get_lf_job_info(lf_sync)) != NULL) {
  ------------------
  |  Branch (532:10): [True: 69.0k, False: 32.0k]
  ------------------
  533|  69.0k|    LFWorkerData *const lf_data = (LFWorkerData *)thread_data->lf_data;
  534|  69.0k|    const int lpf_opt_level = cur_job_info->lpf_opt_level;
  535|  69.0k|    (void)sb_rows;
  536|  69.0k|#if CONFIG_MULTITHREAD
  537|  69.0k|    const int cur_sb_row = cur_job_info->mi_row >> mib_size_log2;
  538|  69.0k|    const int next_sb_row = AOMMIN(sb_rows - 1, cur_sb_row + 1);
  ------------------
  |  |   34|  69.0k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 47.9k, False: 21.1k]
  |  |  ------------------
  ------------------
  539|       |    // Wait for current and next superblock row to finish encoding.
  540|  69.0k|    pthread_mutex_lock(enc_row_mt_mutex_);
  541|  89.0k|    while (!enc_row_mt->row_mt_exit &&
  ------------------
  |  Branch (541:12): [True: 89.0k, False: 18.4E]
  ------------------
  542|  89.0k|           (enc_row_mt->num_tile_cols_done[cur_sb_row] < cm->tiles.cols ||
  ------------------
  |  Branch (542:13): [True: 14.5k, False: 74.4k]
  ------------------
  543|  74.4k|            enc_row_mt->num_tile_cols_done[next_sb_row] < cm->tiles.cols)) {
  ------------------
  |  Branch (543:13): [True: 5.43k, False: 69.0k]
  ------------------
  544|  20.0k|      pthread_cond_wait(enc_row_mt->cond_, enc_row_mt_mutex_);
  545|  20.0k|    }
  546|  69.0k|    row_mt_exit = enc_row_mt->row_mt_exit;
  547|  69.0k|    pthread_mutex_unlock(enc_row_mt_mutex_);
  548|  69.0k|#endif
  549|  69.0k|    if (row_mt_exit) return;
  ------------------
  |  Branch (549:9): [True: 0, False: 69.0k]
  ------------------
  550|       |
  551|  69.0k|    av1_thread_loop_filter_rows(
  552|  69.0k|        lf_data->frame_buffer, lf_data->cm, lf_data->planes, lf_data->xd,
  553|  69.0k|        cur_job_info->mi_row, cur_job_info->plane, cur_job_info->dir,
  554|  69.0k|        lpf_opt_level, lf_sync, &thread_data->error_info, lf_data->params_buf,
  555|  69.0k|        lf_data->tx_buf, mib_size_log2);
  556|  69.0k|  }
  557|  32.0k|}
ethread.c:compute_gm_workers:
 2699|  2.88k|static inline int compute_gm_workers(const AV1_COMP *cpi) {
 2700|  2.88k|  int total_refs =
 2701|  2.88k|      cpi->gm_info.num_ref_frames[0] + cpi->gm_info.num_ref_frames[1];
 2702|  2.88k|  int num_gm_workers = cpi->sf.gm_sf.prune_ref_frame_for_gm_search
  ------------------
  |  Branch (2702:24): [True: 0, False: 2.88k]
  ------------------
 2703|  2.88k|                           ? AOMMIN(MAX_DIRECTIONS, total_refs)
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2704|  2.88k|                           : total_refs;
 2705|  2.88k|  num_gm_workers = AOMMIN(num_gm_workers, cpi->mt_info.num_workers);
  ------------------
  |  |   34|  2.88k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.58k, False: 1.30k]
  |  |  ------------------
  ------------------
 2706|  2.88k|  return (num_gm_workers);
 2707|  2.88k|}
ethread.c:assign_thread_to_dir:
 2689|  2.88k|                                        int num_workers) {
 2690|  2.88k|  int8_t frame_dir_idx = 0;
 2691|       |
 2692|  8.66k|  for (int i = 0; i < num_workers; i++) {
  ------------------
  |  Branch (2692:19): [True: 5.77k, False: 2.88k]
  ------------------
 2693|  5.77k|    thread_id_to_dir[i] = frame_dir_idx++;
 2694|  5.77k|    if (frame_dir_idx == MAX_DIRECTIONS) frame_dir_idx = 0;
  ------------------
  |  |   26|  5.77k|#define MAX_DIRECTIONS 2
  ------------------
  |  Branch (2694:9): [True: 2.88k, False: 2.88k]
  ------------------
 2695|  5.77k|  }
 2696|  2.88k|}
ethread.c:prepare_gm_workers:
 2660|  2.88k|                                      int num_workers) {
 2661|  2.88k|  MultiThreadInfo *mt_info = &cpi->mt_info;
 2662|  2.88k|  mt_info->gm_sync.gm_mt_exit = false;
 2663|  8.66k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (2663:33): [True: 5.77k, False: 2.88k]
  ------------------
 2664|  5.77k|    AVxWorker *worker = &mt_info->workers[i];
 2665|  5.77k|    EncWorkerData *thread_data = &mt_info->tile_thr_data[i];
 2666|       |
 2667|  5.77k|    worker->hook = hook;
 2668|  5.77k|    worker->data1 = thread_data;
 2669|  5.77k|    worker->data2 = NULL;
 2670|       |
 2671|  5.77k|    thread_data->thread_id = i;
 2672|       |    // Set the starting tile for each thread.
 2673|  5.77k|    thread_data->start = i;
 2674|       |
 2675|  5.77k|    thread_data->cpi = cpi;
 2676|  5.77k|    if (i == 0) {
  ------------------
  |  Branch (2676:9): [True: 2.88k, False: 2.88k]
  ------------------
 2677|  2.88k|      thread_data->td = &cpi->td;
 2678|  2.88k|    } else {
 2679|  2.88k|      thread_data->td = thread_data->original_td;
 2680|  2.88k|    }
 2681|       |
 2682|  5.77k|    if (thread_data->td != &cpi->td)
  ------------------
  |  Branch (2682:9): [True: 2.88k, False: 2.88k]
  ------------------
 2683|  2.88k|      gm_alloc_data(cpi, &thread_data->td->gm_data);
 2684|  5.77k|  }
 2685|  2.88k|}
ethread.c:gm_mt_worker_hook:
 2576|  5.77k|static int gm_mt_worker_hook(void *arg1, void *unused) {
 2577|  5.77k|  (void)unused;
 2578|       |
 2579|  5.77k|  EncWorkerData *thread_data = (EncWorkerData *)arg1;
 2580|  5.77k|  AV1_COMP *cpi = thread_data->cpi;
 2581|  5.77k|  GlobalMotionInfo *gm_info = &cpi->gm_info;
 2582|  5.77k|  AV1GlobalMotionSync *gm_sync = &cpi->mt_info.gm_sync;
 2583|  5.77k|  GlobalMotionJobInfo *job_info = &gm_sync->job_info;
 2584|  5.77k|  int thread_id = thread_data->thread_id;
 2585|  5.77k|  GlobalMotionData *gm_thread_data = &thread_data->td->gm_data;
 2586|  5.77k|#if CONFIG_MULTITHREAD
 2587|  5.77k|  pthread_mutex_t *gm_mt_mutex_ = gm_sync->mutex_;
 2588|  5.77k|#endif
 2589|       |
 2590|  5.77k|  MACROBLOCKD *const xd = &thread_data->td->mb.e_mbd;
 2591|  5.77k|  struct aom_internal_error_info *const error_info = &thread_data->error_info;
 2592|  5.77k|  xd->error_info = error_info;
 2593|       |
 2594|       |  // The jmp_buf is valid only for the duration of the function that calls
 2595|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 2596|       |  // before it returns.
 2597|  5.77k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (2597:7): [True: 0, False: 5.77k]
  ------------------
 2598|      0|    error_info->setjmp = 0;
 2599|      0|#if CONFIG_MULTITHREAD
 2600|      0|    pthread_mutex_lock(gm_mt_mutex_);
 2601|      0|    gm_sync->gm_mt_exit = true;
 2602|      0|    pthread_mutex_unlock(gm_mt_mutex_);
 2603|      0|#endif
 2604|      0|    return 0;
 2605|      0|  }
 2606|  5.77k|  error_info->setjmp = 1;
 2607|       |
 2608|  5.77k|  int cur_dir = job_info->thread_id_to_dir[thread_id];
 2609|  5.77k|  bool gm_mt_exit = false;
 2610|  11.5k|  while (1) {
  ------------------
  |  Branch (2610:10): [True: 11.5k, Folded]
  ------------------
 2611|  11.5k|    int ref_buf_idx = -1;
 2612|       |
 2613|  11.5k|#if CONFIG_MULTITHREAD
 2614|  11.5k|    pthread_mutex_lock(gm_mt_mutex_);
 2615|  11.5k|#endif
 2616|       |
 2617|  11.5k|    gm_mt_exit = gm_sync->gm_mt_exit;
 2618|       |    // Populates ref_buf_idx(the reference frame type) for which global motion
 2619|       |    // estimation will be done.
 2620|  11.5k|    if (!gm_mt_exit && !get_next_gm_job(cpi, &ref_buf_idx, cur_dir)) {
  ------------------
  |  Branch (2620:9): [True: 11.5k, False: 18.4E]
  |  Branch (2620:24): [True: 6.97k, False: 4.57k]
  ------------------
 2621|       |      // No jobs are available for the current direction. Switch
 2622|       |      // to other direction and get the next job, if available.
 2623|  6.97k|      switch_direction(cpi, &ref_buf_idx, &cur_dir);
 2624|  6.97k|    }
 2625|       |
 2626|  11.5k|#if CONFIG_MULTITHREAD
 2627|  11.5k|    pthread_mutex_unlock(gm_mt_mutex_);
 2628|  11.5k|#endif
 2629|       |
 2630|       |    // When gm_mt_exit is set to true, other workers need not pursue any
 2631|       |    // further jobs.
 2632|  11.5k|    if (gm_mt_exit || ref_buf_idx == -1) break;
  ------------------
  |  Branch (2632:9): [True: 18.4E, False: 11.5k]
  |  Branch (2632:23): [True: 5.77k, False: 5.77k]
  ------------------
 2633|       |
 2634|       |    // Compute global motion for the given ref_buf_idx.
 2635|  5.75k|    av1_compute_gm_for_valid_ref_frames(
 2636|  5.75k|        cpi, error_info, gm_info->ref_buf, ref_buf_idx,
 2637|  5.75k|        gm_thread_data->motion_models, gm_thread_data->segment_map,
 2638|  5.75k|        gm_info->segment_map_w, gm_info->segment_map_h);
 2639|       |
 2640|  5.75k|#if CONFIG_MULTITHREAD
 2641|  5.75k|    pthread_mutex_lock(gm_mt_mutex_);
 2642|  5.75k|#endif
 2643|       |    // If global motion w.r.t. current ref frame is
 2644|       |    // INVALID/TRANSLATION/IDENTITY, skip the evaluation of global motion w.r.t
 2645|       |    // the remaining ref frames in that direction.
 2646|  5.75k|    if (cpi->sf.gm_sf.prune_ref_frame_for_gm_search &&
  ------------------
  |  Branch (2646:9): [True: 0, False: 5.75k]
  ------------------
 2647|      0|        cpi->common.global_motion[ref_buf_idx].wmtype <= TRANSLATION)
  ------------------
  |  Branch (2647:9): [True: 0, False: 0]
  ------------------
 2648|      0|      job_info->early_exit[cur_dir] = 1;
 2649|       |
 2650|  5.75k|#if CONFIG_MULTITHREAD
 2651|  5.75k|    pthread_mutex_unlock(gm_mt_mutex_);
 2652|  5.75k|#endif
 2653|  5.75k|  }
 2654|  5.77k|  error_info->setjmp = 0;
 2655|  5.77k|  return 1;
 2656|  5.77k|}
ethread.c:get_next_gm_job:
 2550|  18.5k|static inline int get_next_gm_job(AV1_COMP *cpi, int *frame_idx, int cur_dir) {
 2551|  18.5k|  GlobalMotionInfo *gm_info = &cpi->gm_info;
 2552|  18.5k|  GlobalMotionJobInfo *job_info = &cpi->mt_info.gm_sync.job_info;
 2553|       |
 2554|  18.5k|  int total_refs = gm_info->num_ref_frames[cur_dir];
 2555|  18.5k|  int8_t cur_frame_to_process = job_info->next_frame_to_process[cur_dir];
 2556|       |
 2557|  18.5k|  if (cur_frame_to_process < total_refs && !job_info->early_exit[cur_dir]) {
  ------------------
  |  Branch (2557:7): [True: 5.77k, False: 12.7k]
  |  Branch (2557:44): [True: 5.77k, False: 0]
  ------------------
 2558|  5.77k|    *frame_idx = gm_info->reference_frames[cur_dir][cur_frame_to_process].frame;
 2559|  5.77k|    job_info->next_frame_to_process[cur_dir] += 1;
 2560|  5.77k|    return 1;
 2561|  5.77k|  }
 2562|  12.7k|  return 0;
 2563|  18.5k|}
ethread.c:switch_direction:
 2568|  6.97k|                                    int *cur_dir) {
 2569|  6.97k|  if (cpi->sf.gm_sf.prune_ref_frame_for_gm_search) return;
  ------------------
  |  Branch (2569:7): [True: 0, False: 6.97k]
  ------------------
 2570|       |  // Switch the direction and get next job
 2571|  6.97k|  *cur_dir = !(*cur_dir);
 2572|  6.97k|  get_next_gm_job(cpi, frame_idx, *(cur_dir));
 2573|  6.97k|}
ethread.c:gm_dealloc_thread_data:
 2710|  2.88k|static inline void gm_dealloc_thread_data(AV1_COMP *cpi, int num_workers) {
 2711|  2.88k|  MultiThreadInfo *mt_info = &cpi->mt_info;
 2712|  8.66k|  for (int j = 0; j < num_workers; j++) {
  ------------------
  |  Branch (2712:19): [True: 5.77k, False: 2.88k]
  ------------------
 2713|  5.77k|    EncWorkerData *thread_data = &mt_info->tile_thr_data[j];
 2714|  5.77k|    ThreadData *td = thread_data->td;
 2715|  5.77k|    if (td != &cpi->td) gm_dealloc_data(&td->gm_data);
  ------------------
  |  Branch (2715:9): [True: 2.88k, False: 2.88k]
  ------------------
 2716|  5.77k|  }
 2717|  2.88k|}
ethread.c:row_mt_sync_mem_alloc:
  179|  50.8k|                                  AV1_COMMON *cm, int rows) {
  180|  50.8k|#if CONFIG_MULTITHREAD
  181|  50.8k|  int i;
  182|       |
  183|  50.8k|  CHECK_MEM_ERROR(cm, row_mt_sync->mutex_,
  ------------------
  |  |   51|  50.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  50.8k|  do {                                                    \
  |  |  |  |   72|  50.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  50.8k|    lval = (expr);                                        \
  |  |  |  |   74|  50.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 50.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  50.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  50.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  184|  50.8k|                  aom_malloc(sizeof(*row_mt_sync->mutex_) * rows));
  185|  50.8k|  if (row_mt_sync->mutex_) {
  ------------------
  |  Branch (185:7): [True: 50.8k, False: 0]
  ------------------
  186|   108k|    for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (186:17): [True: 57.1k, False: 50.8k]
  ------------------
  187|  57.1k|      pthread_mutex_init(&row_mt_sync->mutex_[i], NULL);
  188|  57.1k|    }
  189|  50.8k|  }
  190|       |
  191|  50.8k|  CHECK_MEM_ERROR(cm, row_mt_sync->cond_,
  ------------------
  |  |   51|  50.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  50.8k|  do {                                                    \
  |  |  |  |   72|  50.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  50.8k|    lval = (expr);                                        \
  |  |  |  |   74|  50.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 50.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  50.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  50.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  50.8k|                  aom_malloc(sizeof(*row_mt_sync->cond_) * rows));
  193|  50.8k|  if (row_mt_sync->cond_) {
  ------------------
  |  Branch (193:7): [True: 50.8k, False: 0]
  ------------------
  194|   108k|    for (i = 0; i < rows; ++i) {
  ------------------
  |  Branch (194:17): [True: 57.1k, False: 50.8k]
  ------------------
  195|  57.1k|      pthread_cond_init(&row_mt_sync->cond_[i], NULL);
  196|  57.1k|    }
  197|  50.8k|  }
  198|  50.8k|#endif  // CONFIG_MULTITHREAD
  199|       |
  200|  50.8k|  CHECK_MEM_ERROR(cm, row_mt_sync->num_finished_cols,
  ------------------
  |  |   51|  50.8k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  50.8k|  do {                                                    \
  |  |  |  |   72|  50.8k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  50.8k|    lval = (expr);                                        \
  |  |  |  |   74|  50.8k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 50.8k]
  |  |  |  |  ------------------
  |  |  |  |   75|  50.8k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  50.8k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  50.8k|                  aom_malloc(sizeof(*row_mt_sync->num_finished_cols) * rows));
  202|       |
  203|  50.8k|  row_mt_sync->rows = rows;
  204|       |  // Set up nsync.
  205|  50.8k|  row_mt_sync->sync_range = 1;
  206|  50.8k|}
ethread.c:init_tile_pack_bs_params:
 2963|  13.1k|                                     uint8_t obu_extn_header) {
 2964|  13.1k|  MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
 2965|  13.1k|  AV1_COMMON *const cm = &cpi->common;
 2966|  13.1k|  const CommonTileParams *const tiles = &cm->tiles;
 2967|  13.1k|  const int num_tiles = tiles->cols * tiles->rows;
 2968|       |  // Fixed size tile groups for the moment
 2969|  13.1k|  const int num_tg_hdrs = cpi->num_tg;
 2970|       |  // Tile group size in terms of number of tiles.
 2971|  13.1k|  const int tg_size_in_tiles = (num_tiles + num_tg_hdrs - 1) / num_tg_hdrs;
 2972|  13.1k|  uint8_t *tile_dst = dst;
 2973|  13.1k|  uint8_t *tile_data_curr = dst;
 2974|       |  // Max tile group count can not be more than MAX_TILES.
 2975|  13.1k|  int tg_size_mi[MAX_TILES] = { 0 };  // Size of tile group in mi units
 2976|  13.1k|  int tile_idx;
 2977|  13.1k|  int tg_idx = 0;
 2978|  13.1k|  int tile_count_in_tg = 0;
 2979|  13.1k|  int new_tg = 1;
 2980|       |
 2981|       |  // Populate pack bitstream params of all tiles.
 2982|  60.7k|  for (tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
  ------------------
  |  Branch (2982:22): [True: 47.6k, False: 13.1k]
  ------------------
 2983|  47.6k|    const TileInfo *const tile_info = &cpi->tile_data[tile_idx].tile_info;
 2984|  47.6k|    PackBSParams *const pack_bs_params = &pack_bs_params_arr[tile_idx];
 2985|       |    // Calculate tile size in mi units.
 2986|  47.6k|    const int tile_size_mi = (tile_info->mi_col_end - tile_info->mi_col_start) *
 2987|  47.6k|                             (tile_info->mi_row_end - tile_info->mi_row_start);
 2988|  47.6k|    int is_last_tile_in_tg = 0;
 2989|  47.6k|    tile_count_in_tg++;
 2990|  47.6k|    if (tile_count_in_tg == tg_size_in_tiles || tile_idx == (num_tiles - 1))
  ------------------
  |  Branch (2990:9): [True: 13.1k, False: 34.4k]
  |  Branch (2990:49): [True: 0, False: 34.4k]
  ------------------
 2991|  13.1k|      is_last_tile_in_tg = 1;
 2992|       |
 2993|       |    // Populate pack bitstream params of this tile.
 2994|  47.6k|    pack_bs_params->curr_tg_hdr_size = 0;
 2995|  47.6k|    pack_bs_params->obu_extn_header = obu_extn_header;
 2996|  47.6k|    pack_bs_params->saved_wb = saved_wb;
 2997|  47.6k|    pack_bs_params->obu_header_size = 0;
 2998|  47.6k|    pack_bs_params->is_last_tile_in_tg = is_last_tile_in_tg;
 2999|  47.6k|    pack_bs_params->new_tg = new_tg;
 3000|  47.6k|    pack_bs_params->tile_col = tile_info->tile_col;
 3001|  47.6k|    pack_bs_params->tile_row = tile_info->tile_row;
 3002|  47.6k|    pack_bs_params->tile_size_mi = tile_size_mi;
 3003|  47.6k|    tg_size_mi[tg_idx] += tile_size_mi;
 3004|       |
 3005|  47.6k|    if (new_tg) new_tg = 0;
  ------------------
  |  Branch (3005:9): [True: 13.1k, False: 34.4k]
  ------------------
 3006|  47.6k|    if (is_last_tile_in_tg) {
  ------------------
  |  Branch (3006:9): [True: 13.1k, False: 34.4k]
  ------------------
 3007|  13.1k|      tile_count_in_tg = 0;
 3008|  13.1k|      new_tg = 1;
 3009|  13.1k|      tg_idx++;
 3010|  13.1k|    }
 3011|  47.6k|  }
 3012|       |
 3013|  13.1k|  assert(dst_size > 0);
 3014|  13.1k|  size_t tg_buf_size[MAX_TILES] = { 0 };
 3015|  13.1k|  size_t max_buf_size = dst_size;
 3016|  13.1k|  size_t remain_buf_size = max_buf_size;
 3017|  13.1k|  const int frame_size_mi = cm->mi_params.mi_rows * cm->mi_params.mi_cols;
 3018|       |
 3019|  13.1k|  tile_idx = 0;
 3020|       |  // Prepare obu, tile group and frame header of each tile group.
 3021|  26.2k|  for (tg_idx = 0; tg_idx < cpi->num_tg; tg_idx++) {
  ------------------
  |  Branch (3021:20): [True: 13.1k, False: 13.1k]
  ------------------
 3022|  13.1k|    PackBSParams *const pack_bs_params = &pack_bs_params_arr[tile_idx];
 3023|  13.1k|    int is_last_tg = tg_idx == cpi->num_tg - 1;
 3024|       |    // Prorate bitstream buffer size based on tile group size and available
 3025|       |    // buffer size. This buffer will be used to store headers and tile data.
 3026|  13.1k|    tg_buf_size[tg_idx] =
 3027|  13.1k|        get_bs_chunk_size(tg_size_mi[tg_idx], frame_size_mi, &remain_buf_size,
 3028|  13.1k|                          max_buf_size, is_last_tg);
 3029|       |
 3030|  13.1k|    pack_bs_params->dst = tile_dst;
 3031|  13.1k|    pack_bs_params->tile_data_curr = tile_dst;
 3032|       |
 3033|       |    // Write obu, tile group and frame header at first tile in the tile
 3034|       |    // group.
 3035|  13.1k|    av1_write_obu_tg_tile_headers(cpi, xd, pack_bs_params, tile_idx);
 3036|  13.1k|    tile_dst += tg_buf_size[tg_idx];
 3037|       |
 3038|       |    // Exclude headers from tile group buffer size.
 3039|  13.1k|    tg_buf_size[tg_idx] -= pack_bs_params->curr_tg_hdr_size;
 3040|  13.1k|    tile_idx += tg_size_in_tiles;
 3041|  13.1k|  }
 3042|       |
 3043|  13.1k|  tg_idx = 0;
 3044|       |  // Calculate bitstream buffer size of each tile in the tile group.
 3045|  60.7k|  for (tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
  ------------------
  |  Branch (3045:22): [True: 47.6k, False: 13.1k]
  ------------------
 3046|  47.6k|    PackBSParams *const pack_bs_params = &pack_bs_params_arr[tile_idx];
 3047|       |
 3048|  47.6k|    if (pack_bs_params->new_tg) {
  ------------------
  |  Branch (3048:9): [True: 13.1k, False: 34.4k]
  ------------------
 3049|  13.1k|      max_buf_size = tg_buf_size[tg_idx];
 3050|  13.1k|      remain_buf_size = max_buf_size;
 3051|  13.1k|    }
 3052|       |
 3053|       |    // Prorate bitstream buffer size of this tile based on tile size and
 3054|       |    // available buffer size. For this proration, header size is not accounted.
 3055|  47.6k|    const size_t tile_buf_size = get_bs_chunk_size(
 3056|  47.6k|        pack_bs_params->tile_size_mi, tg_size_mi[tg_idx], &remain_buf_size,
 3057|  47.6k|        max_buf_size, pack_bs_params->is_last_tile_in_tg);
 3058|  47.6k|    pack_bs_params->tile_buf_size = tile_buf_size;
 3059|       |
 3060|       |    // Update base address of bitstream buffer for tile and tile group.
 3061|  47.6k|    if (pack_bs_params->new_tg) {
  ------------------
  |  Branch (3061:9): [True: 13.1k, False: 34.4k]
  ------------------
 3062|  13.1k|      tile_dst = pack_bs_params->dst;
 3063|  13.1k|      tile_data_curr = pack_bs_params->tile_data_curr;
 3064|       |      // Account header size in first tile of a tile group.
 3065|  13.1k|      pack_bs_params->tile_buf_size += pack_bs_params->curr_tg_hdr_size;
 3066|  34.4k|    } else {
 3067|  34.4k|      pack_bs_params->dst = tile_dst;
 3068|  34.4k|      pack_bs_params->tile_data_curr = tile_data_curr;
 3069|  34.4k|    }
 3070|       |
 3071|  47.6k|    if (pack_bs_params->is_last_tile_in_tg) tg_idx++;
  ------------------
  |  Branch (3071:9): [True: 13.1k, False: 34.4k]
  ------------------
 3072|  47.6k|    tile_dst += pack_bs_params->tile_buf_size;
 3073|  47.6k|  }
 3074|  13.1k|}
ethread.c:get_bs_chunk_size:
 2942|  60.7k|                                       size_t max_buf_size, int is_last_chunk) {
 2943|  60.7k|  size_t this_chunk_size;
 2944|  60.7k|  assert(*remain_buf_size > 0);
 2945|  60.7k|  if (is_last_chunk) {
  ------------------
  |  Branch (2945:7): [True: 26.2k, False: 34.4k]
  ------------------
 2946|  26.2k|    this_chunk_size = *remain_buf_size;
 2947|  26.2k|    *remain_buf_size = 0;
 2948|  34.4k|  } else {
 2949|  34.4k|    const uint64_t size_scale = (uint64_t)max_buf_size * tg_or_tile_size;
 2950|  34.4k|    this_chunk_size = (size_t)(size_scale / frame_or_tg_size);
 2951|  34.4k|    *remain_buf_size -= this_chunk_size;
 2952|  34.4k|    assert(*remain_buf_size > 0);
 2953|  34.4k|  }
 2954|       |  assert(this_chunk_size > 0);
 2955|  60.7k|  return this_chunk_size;
 2956|  60.7k|}
ethread.c:prepare_pack_bs_workers:
 3134|  13.1k|                                    AVxWorkerHook hook, const int num_workers) {
 3135|  13.1k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 3136|  55.5k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (3136:33): [True: 42.3k, False: 13.1k]
  ------------------
 3137|  42.3k|    AVxWorker *worker = &mt_info->workers[i];
 3138|  42.3k|    EncWorkerData *const thread_data = &mt_info->tile_thr_data[i];
 3139|  42.3k|    if (i == 0) {
  ------------------
  |  Branch (3139:9): [True: 13.1k, False: 29.2k]
  ------------------
 3140|  13.1k|      thread_data->td = &cpi->td;
 3141|  29.2k|    } else {
 3142|  29.2k|      thread_data->td = thread_data->original_td;
 3143|  29.2k|    }
 3144|       |
 3145|  42.3k|    if (thread_data->td != &cpi->td) thread_data->td->mb = cpi->td.mb;
  ------------------
  |  Branch (3145:9): [True: 29.2k, False: 13.1k]
  ------------------
 3146|       |
 3147|  42.3k|    thread_data->cpi = cpi;
 3148|  42.3k|    thread_data->start = i;
 3149|  42.3k|    thread_data->thread_id = i;
 3150|  42.3k|    av1_reset_pack_bs_thread_data(thread_data->td);
 3151|       |
 3152|  42.3k|    worker->hook = hook;
 3153|  42.3k|    worker->data1 = thread_data;
 3154|  42.3k|    worker->data2 = pack_bs_params;
 3155|  42.3k|  }
 3156|       |
 3157|  13.1k|  AV1_COMMON *const cm = &cpi->common;
 3158|  13.1k|  AV1EncPackBSSync *const pack_bs_sync = &mt_info->pack_bs_sync;
 3159|  13.1k|  const uint16_t num_tiles = cm->tiles.rows * cm->tiles.cols;
 3160|  13.1k|  pack_bs_sync->next_job_idx = 0;
 3161|  13.1k|  pack_bs_sync->pack_bs_mt_exit = false;
 3162|       |
 3163|  13.1k|  PackBSTileOrder *const pack_bs_tile_order = pack_bs_sync->pack_bs_tile_order;
 3164|       |  // Reset tile order data of pack bitstream
 3165|  13.1k|  av1_zero_array(pack_bs_tile_order, num_tiles);
  ------------------
  |  |   44|  13.1k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 3166|       |
 3167|       |  // Populate pack bitstream tile order structure
 3168|  60.7k|  for (uint16_t tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
  ------------------
  |  Branch (3168:31): [True: 47.6k, False: 13.1k]
  ------------------
 3169|  47.6k|    pack_bs_tile_order[tile_idx].abs_sum_level =
 3170|  47.6k|        cpi->tile_data[tile_idx].abs_sum_level;
 3171|  47.6k|    pack_bs_tile_order[tile_idx].tile_idx = tile_idx;
 3172|  47.6k|  }
 3173|       |
 3174|       |  // Sort tiles in descending order based on tile area.
 3175|  13.1k|  qsort(pack_bs_tile_order, num_tiles, sizeof(*pack_bs_tile_order),
 3176|  13.1k|        compare_tile_order);
 3177|  13.1k|}
ethread.c:compare_tile_order:
 2915|  60.6k|static int compare_tile_order(const void *a, const void *b) {
 2916|  60.6k|  const PackBSTileOrder *const tile_a = (const PackBSTileOrder *)a;
 2917|  60.6k|  const PackBSTileOrder *const tile_b = (const PackBSTileOrder *)b;
 2918|       |
 2919|  60.6k|  if (tile_a->abs_sum_level > tile_b->abs_sum_level)
  ------------------
  |  Branch (2919:7): [True: 41.0k, False: 19.5k]
  ------------------
 2920|  41.0k|    return -1;
 2921|  19.5k|  else if (tile_a->abs_sum_level == tile_b->abs_sum_level)
  ------------------
  |  Branch (2921:12): [True: 590, False: 18.9k]
  ------------------
 2922|    590|    return (tile_a->tile_idx > tile_b->tile_idx ? 1 : -1);
  ------------------
  |  Branch (2922:13): [True: 0, False: 590]
  ------------------
 2923|  18.9k|  else
 2924|  18.9k|    return 1;
 2925|  60.6k|}
ethread.c:pack_bs_worker_hook:
 3077|  42.2k|static int pack_bs_worker_hook(void *arg1, void *arg2) {
 3078|  42.2k|  EncWorkerData *const thread_data = (EncWorkerData *)arg1;
 3079|  42.2k|  PackBSParams *const pack_bs_params = (PackBSParams *)arg2;
 3080|  42.2k|  AV1_COMP *const cpi = thread_data->cpi;
 3081|  42.2k|  AV1_COMMON *const cm = &cpi->common;
 3082|  42.2k|  AV1EncPackBSSync *const pack_bs_sync = &cpi->mt_info.pack_bs_sync;
 3083|  42.2k|  const CommonTileParams *const tiles = &cm->tiles;
 3084|  42.2k|  const int num_tiles = tiles->cols * tiles->rows;
 3085|       |
 3086|  42.2k|#if CONFIG_MULTITHREAD
 3087|  42.2k|  pthread_mutex_t *const pack_bs_mutex = pack_bs_sync->mutex_;
 3088|  42.2k|#endif
 3089|  42.2k|  MACROBLOCKD *const xd = &thread_data->td->mb.e_mbd;
 3090|  42.2k|  struct aom_internal_error_info *const error_info = &thread_data->error_info;
 3091|  42.2k|  xd->error_info = error_info;
 3092|       |
 3093|       |  // The jmp_buf is valid only for the duration of the function that calls
 3094|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 3095|       |  // before it returns.
 3096|  42.2k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (3096:7): [True: 0, False: 42.2k]
  ------------------
 3097|      0|    error_info->setjmp = 0;
 3098|      0|#if CONFIG_MULTITHREAD
 3099|      0|    pthread_mutex_lock(pack_bs_mutex);
 3100|      0|    pack_bs_sync->pack_bs_mt_exit = true;
 3101|      0|    pthread_mutex_unlock(pack_bs_mutex);
 3102|      0|#endif
 3103|      0|    return 0;
 3104|      0|  }
 3105|  42.2k|  error_info->setjmp = 1;
 3106|       |
 3107|  89.8k|  while (1) {
  ------------------
  |  Branch (3107:10): [True: 89.8k, Folded]
  ------------------
 3108|  89.8k|#if CONFIG_MULTITHREAD
 3109|  89.8k|    pthread_mutex_lock(pack_bs_mutex);
 3110|  89.8k|#endif
 3111|  89.8k|    const int tile_idx =
 3112|  89.8k|        pack_bs_sync->pack_bs_mt_exit
  ------------------
  |  Branch (3112:9): [True: 0, False: 89.8k]
  ------------------
 3113|  89.8k|            ? -1
 3114|  89.8k|            : get_next_pack_bs_tile_idx(pack_bs_sync, num_tiles);
 3115|  89.8k|#if CONFIG_MULTITHREAD
 3116|  89.8k|    pthread_mutex_unlock(pack_bs_mutex);
 3117|  89.8k|#endif
 3118|       |    // When pack_bs_mt_exit is set to true, other workers need not pursue any
 3119|       |    // further jobs.
 3120|  89.8k|    if (tile_idx == -1) break;
  ------------------
  |  Branch (3120:9): [True: 42.3k, False: 47.4k]
  ------------------
 3121|  47.4k|    TileDataEnc *this_tile = &cpi->tile_data[tile_idx];
 3122|  47.4k|    thread_data->td->mb.e_mbd.tile_ctx = &this_tile->tctx;
 3123|       |
 3124|  47.4k|    av1_pack_tile_info(cpi, thread_data->td, &pack_bs_params[tile_idx]);
 3125|  47.4k|  }
 3126|       |
 3127|  42.2k|  error_info->setjmp = 0;
 3128|  42.2k|  return 1;
 3129|  42.2k|}
ethread.c:get_next_pack_bs_tile_idx:
 2929|  89.9k|    AV1EncPackBSSync *const pack_bs_sync, const int num_tiles) {
 2930|  89.9k|  assert(pack_bs_sync->next_job_idx <= num_tiles);
 2931|  89.9k|  if (pack_bs_sync->next_job_idx == num_tiles) return -1;
  ------------------
  |  Branch (2931:7): [True: 42.3k, False: 47.6k]
  ------------------
 2932|       |
 2933|  47.6k|  return pack_bs_sync->pack_bs_tile_order[pack_bs_sync->next_job_idx++]
 2934|  47.6k|      .tile_idx;
 2935|  89.9k|}
ethread.c:accumulate_pack_bs_data:
 3185|  13.1k|    const int num_workers) {
 3186|  13.1k|  const AV1_COMMON *const cm = &cpi->common;
 3187|  13.1k|  const CommonTileParams *const tiles = &cm->tiles;
 3188|  13.1k|  const int tile_count = tiles->cols * tiles->rows;
 3189|       |  // Fixed size tile groups for the moment
 3190|  13.1k|  size_t curr_tg_data_size = 0;
 3191|  13.1k|  int is_first_tg = 1;
 3192|  13.1k|  uint8_t *curr_tg_start = dst;
 3193|  13.1k|  size_t src_offset = 0;
 3194|  13.1k|  size_t dst_offset = 0;
 3195|       |
 3196|  60.7k|  for (int tile_idx = 0; tile_idx < tile_count; tile_idx++) {
  ------------------
  |  Branch (3196:26): [True: 47.6k, False: 13.1k]
  ------------------
 3197|       |    // PackBSParams stores all parameters required to pack tile and header
 3198|       |    // info.
 3199|  47.6k|    const PackBSParams *const pack_bs_params = &pack_bs_params_arr[tile_idx];
 3200|  47.6k|    uint32_t tile_size = 0;
 3201|       |
 3202|  47.6k|    if (pack_bs_params->new_tg) {
  ------------------
  |  Branch (3202:9): [True: 13.1k, False: 34.4k]
  ------------------
 3203|  13.1k|      curr_tg_start = dst + *total_size;
 3204|  13.1k|      curr_tg_data_size = pack_bs_params->curr_tg_hdr_size;
 3205|  13.1k|      *tile_data_start += pack_bs_params->curr_tg_hdr_size;
 3206|  13.1k|      *obu_header_size = pack_bs_params->obu_header_size;
 3207|  13.1k|    }
 3208|  47.6k|    curr_tg_data_size +=
 3209|  47.6k|        pack_bs_params->buf.size + (pack_bs_params->is_last_tile_in_tg ? 0 : 4);
  ------------------
  |  Branch (3209:37): [True: 13.1k, False: 34.4k]
  ------------------
 3210|       |
 3211|  47.6k|    if (pack_bs_params->buf.size > *max_tile_size) {
  ------------------
  |  Branch (3211:9): [True: 18.8k, False: 28.7k]
  ------------------
 3212|  18.8k|      *largest_tile_id = tile_idx;
 3213|  18.8k|      *max_tile_size = (unsigned int)pack_bs_params->buf.size;
 3214|  18.8k|    }
 3215|  47.6k|    tile_size +=
 3216|  47.6k|        (uint32_t)pack_bs_params->buf.size + *pack_bs_params->total_size;
 3217|       |
 3218|       |    // Pack all the chunks of tile bitstreams together
 3219|  47.6k|    if (tile_idx != 0) memmove(dst + dst_offset, dst + src_offset, tile_size);
  ------------------
  |  Branch (3219:9): [True: 34.4k, False: 13.1k]
  ------------------
 3220|       |
 3221|  47.6k|    if (pack_bs_params->is_last_tile_in_tg)
  ------------------
  |  Branch (3221:9): [True: 13.1k, False: 34.4k]
  ------------------
 3222|  13.1k|      av1_write_last_tile_info(
 3223|  13.1k|          cpi, fh_info, pack_bs_params->saved_wb, &curr_tg_data_size,
 3224|  13.1k|          curr_tg_start, &tile_size, tile_data_start, largest_tile_id,
 3225|  13.1k|          &is_first_tg, *obu_header_size, pack_bs_params->obu_extn_header);
 3226|  47.6k|    src_offset += pack_bs_params->tile_buf_size;
 3227|  47.6k|    dst_offset += tile_size;
 3228|  47.6k|    *total_size += tile_size;
 3229|  47.6k|  }
 3230|       |
 3231|       |  // Accumulate thread data
 3232|  13.1k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
 3233|  55.5k|  for (int idx = num_workers - 1; idx >= 0; idx--) {
  ------------------
  |  Branch (3233:35): [True: 42.3k, False: 13.1k]
  ------------------
 3234|  42.3k|    ThreadData const *td = mt_info->tile_thr_data[idx].td;
 3235|  42.3k|    av1_accumulate_pack_bs_thread_data(cpi, td);
 3236|  42.3k|  }
 3237|  13.1k|}
ethread.c:cdef_reset_job_info:
 3294|  31.9k|static inline void cdef_reset_job_info(AV1CdefSync *cdef_sync) {
 3295|  31.9k|#if CONFIG_MULTITHREAD
 3296|  31.9k|  if (cdef_sync->mutex_) pthread_mutex_init(cdef_sync->mutex_, NULL);
  ------------------
  |  Branch (3296:7): [True: 31.9k, False: 0]
  ------------------
 3297|  31.9k|#endif  // CONFIG_MULTITHREAD
 3298|  31.9k|  cdef_sync->end_of_frame = 0;
 3299|  31.9k|  cdef_sync->fbr = 0;
 3300|  31.9k|  cdef_sync->fbc = 0;
 3301|       |  cdef_sync->cdef_mt_exit = false;
 3302|  31.9k|}
ethread.c:prepare_cdef_workers:
 3380|  31.9k|                                 int num_workers) {
 3381|  31.9k|  MultiThreadInfo *mt_info = &cpi->mt_info;
 3382|  85.0k|  for (int i = num_workers - 1; i >= 0; i--) {
  ------------------
  |  Branch (3382:33): [True: 53.0k, False: 31.9k]
  ------------------
 3383|  53.0k|    AVxWorker *worker = &mt_info->workers[i];
 3384|  53.0k|    EncWorkerData *thread_data = &mt_info->tile_thr_data[i];
 3385|       |
 3386|  53.0k|    thread_data->cpi = cpi;
 3387|  53.0k|    worker->hook = hook;
 3388|  53.0k|    worker->data1 = thread_data;
 3389|  53.0k|    worker->data2 = &mt_info->cdef_sync;
 3390|  53.0k|  }
 3391|  31.9k|}
ethread.c:cdef_filter_block_worker_hook:
 3343|  53.0k|static int cdef_filter_block_worker_hook(void *arg1, void *arg2) {
 3344|  53.0k|  EncWorkerData *thread_data = (EncWorkerData *)arg1;
 3345|  53.0k|  AV1CdefSync *const cdef_sync = (AV1CdefSync *)arg2;
 3346|       |
 3347|  53.0k|#if CONFIG_MULTITHREAD
 3348|  53.0k|  pthread_mutex_t *cdef_mutex_ = cdef_sync->mutex_;
 3349|  53.0k|#endif
 3350|  53.0k|  struct aom_internal_error_info *const error_info = &thread_data->error_info;
 3351|  53.0k|  CdefSearchCtx *cdef_search_ctx = thread_data->cpi->cdef_search_ctx;
 3352|       |
 3353|       |  // The jmp_buf is valid only for the duration of the function that calls
 3354|       |  // setjmp(). Therefore, this function must reset the 'setjmp' field to 0
 3355|       |  // before it returns.
 3356|  53.0k|  if (setjmp(error_info->jmp)) {
  ------------------
  |  Branch (3356:7): [True: 0, False: 53.0k]
  ------------------
 3357|      0|    error_info->setjmp = 0;
 3358|      0|#if CONFIG_MULTITHREAD
 3359|      0|    pthread_mutex_lock(cdef_mutex_);
 3360|      0|    cdef_sync->cdef_mt_exit = true;
 3361|      0|    pthread_mutex_unlock(cdef_mutex_);
 3362|      0|#endif
 3363|      0|    return 0;
 3364|      0|  }
 3365|  53.0k|  error_info->setjmp = 1;
 3366|       |
 3367|  53.0k|  volatile int cur_fbr, cur_fbc, sb_count;
 3368|   113k|  while (cdef_get_next_job(cdef_sync, cdef_search_ctx, &cur_fbr, &cur_fbc,
  ------------------
  |  Branch (3368:10): [True: 60.4k, False: 53.0k]
  ------------------
 3369|   113k|                           &sb_count)) {
 3370|  60.4k|    av1_cdef_mse_calc_block(cdef_search_ctx, error_info, cur_fbr, cur_fbc,
 3371|  60.4k|                            sb_count,
 3372|  60.4k|                            thread_data->cpi->sf.lpf_sf.adaptive_cdef_mode);
 3373|  60.4k|  }
 3374|  53.0k|  error_info->setjmp = 0;
 3375|  53.0k|  return 1;
 3376|  53.0k|}
ethread.c:cdef_get_next_job:
 3310|   113k|                                    volatile int *sb_count) {
 3311|   113k|#if CONFIG_MULTITHREAD
 3312|   113k|  pthread_mutex_lock(cdef_sync->mutex_);
 3313|   113k|#endif  // CONFIG_MULTITHREAD
 3314|   113k|  int do_next_block = 0;
 3315|   113k|  const int nvfb = cdef_search_ctx->nvfb;
 3316|   113k|  const int nhfb = cdef_search_ctx->nhfb;
 3317|       |
 3318|       |  // If a block is skip, do not process the block and
 3319|       |  // check the skip condition for the next block.
 3320|   115k|  while (!cdef_sync->cdef_mt_exit && !cdef_sync->end_of_frame &&
  ------------------
  |  Branch (3320:10): [True: 115k, False: 18.4E]
  |  Branch (3320:38): [True: 61.9k, False: 53.0k]
  ------------------
 3321|  61.9k|         cdef_sb_skip(cdef_search_ctx->mi_params, cdef_sync->fbr,
  ------------------
  |  Branch (3321:10): [True: 1.50k, False: 60.4k]
  ------------------
 3322|  61.9k|                      cdef_sync->fbc)) {
 3323|  1.50k|    update_next_job_info(cdef_sync, nvfb, nhfb);
 3324|  1.50k|  }
 3325|       |
 3326|       |  // Populates information needed for current job and update the row,
 3327|       |  // column indices of the next block to be processed.
 3328|   113k|  if (!cdef_sync->cdef_mt_exit && cdef_sync->end_of_frame == 0) {
  ------------------
  |  Branch (3328:7): [True: 113k, False: 18.4E]
  |  Branch (3328:35): [True: 60.4k, False: 53.0k]
  ------------------
 3329|  60.4k|    do_next_block = 1;
 3330|  60.4k|    *cur_fbr = cdef_sync->fbr;
 3331|  60.4k|    *cur_fbc = cdef_sync->fbc;
 3332|  60.4k|    *sb_count = cdef_search_ctx->sb_count;
 3333|  60.4k|    cdef_search_ctx->sb_count++;
 3334|  60.4k|    update_next_job_info(cdef_sync, nvfb, nhfb);
 3335|  60.4k|  }
 3336|   113k|#if CONFIG_MULTITHREAD
 3337|   113k|  pthread_mutex_unlock(cdef_sync->mutex_);
 3338|   113k|#endif  // CONFIG_MULTITHREAD
 3339|   113k|  return do_next_block;
 3340|   113k|}
ethread.c:update_next_job_info:
 3281|  61.9k|static void update_next_job_info(AV1CdefSync *cdef_sync, int nvfb, int nhfb) {
 3282|  61.9k|  cdef_sync->fbc++;
 3283|  61.9k|  if (cdef_sync->fbc == nhfb) {
  ------------------
  |  Branch (3283:7): [True: 43.3k, False: 18.5k]
  ------------------
 3284|  43.3k|    cdef_sync->fbr++;
 3285|  43.3k|    if (cdef_sync->fbr == nvfb) {
  ------------------
  |  Branch (3285:9): [True: 31.9k, False: 11.4k]
  ------------------
 3286|  31.9k|      cdef_sync->end_of_frame = 1;
 3287|  31.9k|    } else {
 3288|  11.4k|      cdef_sync->fbc = 0;
 3289|  11.4k|    }
 3290|  43.3k|  }
 3291|  61.9k|}
ethread.c:compute_num_mod_workers:
 3462|  1.10M|                                   MULTI_THREADED_MODULES mod_name) {
 3463|  1.10M|  int num_mod_workers = 0;
 3464|  1.10M|  switch (mod_name) {
 3465|  92.0k|    case MOD_FP:
  ------------------
  |  Branch (3465:5): [True: 92.0k, False: 1.01M]
  ------------------
 3466|  92.0k|      if (cpi->oxcf.pass >= AOM_RC_SECOND_PASS)
  ------------------
  |  Branch (3466:11): [True: 0, False: 92.0k]
  ------------------
 3467|      0|        num_mod_workers = 0;
 3468|  92.0k|      else
 3469|  92.0k|        num_mod_workers = compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3470|  92.0k|      break;
 3471|  92.0k|    case MOD_TF: num_mod_workers = compute_num_tf_workers(cpi); break;
  ------------------
  |  Branch (3471:5): [True: 92.0k, False: 1.01M]
  ------------------
 3472|  92.0k|    case MOD_TPL: num_mod_workers = compute_num_tpl_workers(cpi); break;
  ------------------
  |  Branch (3472:5): [True: 92.0k, False: 1.01M]
  ------------------
 3473|  92.0k|    case MOD_GME: num_mod_workers = 1; break;
  ------------------
  |  Branch (3473:5): [True: 92.0k, False: 1.01M]
  ------------------
 3474|  92.0k|    case MOD_ENC:
  ------------------
  |  Branch (3474:5): [True: 92.0k, False: 1.01M]
  ------------------
 3475|  92.0k|      num_mod_workers = compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3476|  92.0k|      break;
 3477|  92.0k|    case MOD_LPF: num_mod_workers = compute_num_lf_workers(cpi); break;
  ------------------
  |  Branch (3477:5): [True: 92.0k, False: 1.01M]
  ------------------
 3478|  92.0k|    case MOD_CDEF_SEARCH:
  ------------------
  |  Branch (3478:5): [True: 92.0k, False: 1.01M]
  ------------------
 3479|  92.0k|      num_mod_workers = compute_num_cdef_workers(cpi);
 3480|  92.0k|      break;
 3481|  92.0k|    case MOD_CDEF: num_mod_workers = compute_num_cdef_workers(cpi); break;
  ------------------
  |  Branch (3481:5): [True: 92.0k, False: 1.01M]
  ------------------
 3482|  92.0k|    case MOD_LR: num_mod_workers = compute_num_lr_workers(cpi); break;
  ------------------
  |  Branch (3482:5): [True: 92.0k, False: 1.01M]
  ------------------
 3483|  92.0k|    case MOD_PACK_BS: num_mod_workers = compute_num_pack_bs_workers(cpi); break;
  ------------------
  |  Branch (3483:5): [True: 92.0k, False: 1.01M]
  ------------------
 3484|  92.0k|    case MOD_FRAME_ENC:
  ------------------
  |  Branch (3484:5): [True: 92.0k, False: 1.01M]
  ------------------
 3485|  92.0k|      num_mod_workers = cpi->ppi->p_mt_info.num_mod_workers[MOD_FRAME_ENC];
 3486|  92.0k|      break;
 3487|  92.0k|    case MOD_AI:
  ------------------
  |  Branch (3487:5): [True: 92.0k, False: 1.01M]
  ------------------
 3488|  92.0k|      if (cpi->oxcf.pass == AOM_RC_ONE_PASS) {
  ------------------
  |  Branch (3488:11): [True: 92.0k, False: 0]
  ------------------
 3489|  92.0k|        num_mod_workers = compute_num_ai_workers(cpi);
 3490|  92.0k|      } else {
 3491|      0|        num_mod_workers = 0;
 3492|      0|      }
 3493|  92.0k|      break;
 3494|      0|    default: assert(0); break;
  ------------------
  |  Branch (3494:5): [True: 0, False: 1.10M]
  ------------------
 3495|  1.10M|  }
 3496|  1.10M|  return (num_mod_workers);
 3497|  1.10M|}
ethread.c:compute_num_enc_workers:
 1746|   736k|static int compute_num_enc_workers(const AV1_COMP *cpi, int max_workers) {
 1747|   736k|  if (max_workers <= 1) return 1;
  ------------------
  |  Branch (1747:7): [True: 53.8k, False: 682k]
  ------------------
 1748|   682k|  if (cpi->oxcf.row_mt)
  ------------------
  |  Branch (1748:7): [True: 682k, False: 0]
  ------------------
 1749|   682k|    return compute_num_enc_row_mt_workers(&cpi->common, max_workers);
 1750|      0|  else
 1751|      0|    return compute_num_enc_tile_mt_workers(&cpi->common, max_workers);
 1752|   682k|}
ethread.c:compute_num_enc_row_mt_workers:
 1710|   682k|                                                 int max_threads) {
 1711|   682k|  TileInfo tile_info;
 1712|   682k|  const int tile_cols = cm->tiles.cols;
 1713|   682k|  const int tile_rows = cm->tiles.rows;
 1714|   682k|  int total_num_threads_row_mt = 0;
 1715|  1.54M|  for (int row = 0; row < tile_rows; row++) {
  ------------------
  |  Branch (1715:21): [True: 860k, False: 682k]
  ------------------
 1716|  2.00M|    for (int col = 0; col < tile_cols; col++) {
  ------------------
  |  Branch (1716:23): [True: 1.14M, False: 860k]
  ------------------
 1717|  1.14M|      av1_tile_init(&tile_info, cm, row, col);
 1718|  1.14M|      const int num_sb_rows_in_tile = av1_get_sb_rows_in_tile(cm, &tile_info);
 1719|  1.14M|      const int num_sb_cols_in_tile = av1_get_sb_cols_in_tile(cm, &tile_info);
 1720|  1.14M|      total_num_threads_row_mt +=
 1721|  1.14M|          AOMMIN((num_sb_cols_in_tile + 1) >> 1, num_sb_rows_in_tile);
  ------------------
  |  |   34|  1.14M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 60.0k, False: 1.08M]
  |  |  ------------------
  ------------------
 1722|  1.14M|    }
 1723|   860k|  }
 1724|   682k|  return AOMMIN(max_threads, total_num_threads_row_mt);
  ------------------
  |  |   34|   682k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.16k, False: 677k]
  |  |  ------------------
  ------------------
 1725|   682k|}
ethread.c:compute_num_enc_tile_mt_workers:
 1729|  85.2k|                                                  int max_threads) {
 1730|  85.2k|  const int tile_cols = cm->tiles.cols;
 1731|  85.2k|  const int tile_rows = cm->tiles.rows;
 1732|  85.2k|  return AOMMIN(max_threads, tile_cols * tile_rows);
  ------------------
  |  |   34|  85.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 573, False: 84.7k]
  |  |  ------------------
  ------------------
 1733|  85.2k|}
ethread.c:compute_num_tf_workers:
 3406|  92.0k|static inline int compute_num_tf_workers(const AV1_COMP *cpi) {
 3407|       |  // For single-pass encode, using no. of workers as per tf block size was not
 3408|       |  // found to improve speed. Hence the thread assignment for single-pass encode
 3409|       |  // is kept based on compute_num_enc_workers().
 3410|  92.0k|  if (cpi->oxcf.pass < AOM_RC_SECOND_PASS)
  ------------------
  |  Branch (3410:7): [True: 92.0k, False: 0]
  ------------------
 3411|  92.0k|    return compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3412|       |
 3413|      0|  if (cpi->oxcf.max_threads <= 1) return 1;
  ------------------
  |  Branch (3413:7): [True: 0, False: 0]
  ------------------
 3414|       |
 3415|      0|  const int frame_height = cpi->common.height;
 3416|      0|  const BLOCK_SIZE block_size = TF_BLOCK_SIZE;
  ------------------
  |  |   33|      0|#define TF_BLOCK_SIZE BLOCK_64X64
  ------------------
 3417|      0|  const int mb_height = block_size_high[block_size];
 3418|      0|  const int mb_rows = get_num_blocks(frame_height, mb_height);
 3419|      0|  return AOMMIN(cpi->oxcf.max_threads, mb_rows);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3420|      0|}
ethread.c:compute_num_tpl_workers:
 3423|  92.0k|static inline int compute_num_tpl_workers(AV1_COMP *cpi) {
 3424|  92.0k|  return compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3425|  92.0k|}
ethread.c:compute_num_lf_workers:
 3428|  92.0k|static inline int compute_num_lf_workers(AV1_COMP *cpi) {
 3429|  92.0k|  return compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3430|  92.0k|}
ethread.c:compute_num_cdef_workers:
 3433|   184k|static inline int compute_num_cdef_workers(AV1_COMP *cpi) {
 3434|   184k|  return compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3435|   184k|}
ethread.c:compute_num_lr_workers:
 3438|  92.0k|static inline int compute_num_lr_workers(AV1_COMP *cpi) {
 3439|  92.0k|  return compute_num_enc_workers(cpi, cpi->oxcf.max_threads);
 3440|  92.0k|}
ethread.c:compute_num_pack_bs_workers:
 3443|  92.0k|static inline int compute_num_pack_bs_workers(AV1_COMP *cpi) {
 3444|  92.0k|  if (cpi->oxcf.max_threads <= 1) return 1;
  ------------------
  |  Branch (3444:7): [True: 6.73k, False: 85.2k]
  ------------------
 3445|  85.2k|  return compute_num_enc_tile_mt_workers(&cpi->common, cpi->oxcf.max_threads);
 3446|  92.0k|}
ethread.c:compute_num_ai_workers:
 3449|  92.0k|static inline int compute_num_ai_workers(AV1_COMP *cpi) {
 3450|  92.0k|  if (cpi->oxcf.max_threads <= 1) return 1;
  ------------------
  |  Branch (3450:7): [True: 6.73k, False: 85.2k]
  ------------------
 3451|       |  // The multi-threading implementation of deltaq-mode = 3 in allintra
 3452|       |  // mode is based on row multi threading.
 3453|  85.2k|  if (!cpi->oxcf.row_mt) return 1;
  ------------------
  |  Branch (3453:7): [True: 0, False: 85.2k]
  ------------------
 3454|  85.2k|  cpi->weber_bsize = BLOCK_8X8;
 3455|  85.2k|  const BLOCK_SIZE bsize = cpi->weber_bsize;
 3456|  85.2k|  const int mb_step = mi_size_wide[bsize];
 3457|  85.2k|  const int num_mb_rows = cpi->common.mi_params.mi_rows / mb_step;
 3458|  85.2k|  return AOMMIN(num_mb_rows, cpi->oxcf.max_threads);
  ------------------
  |  |   34|  85.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 78.9k, False: 6.33k]
  |  |  ------------------
  ------------------
 3459|  85.2k|}

av1_copy_and_extend_frame:
  114|  73.6k|                               YV12_BUFFER_CONFIG *dst) {
  115|       |  // Extend src frame in buffer
  116|  73.6k|  const int et_y = dst->border;
  117|  73.6k|  const int el_y = dst->border;
  118|  73.6k|  const int er_y = AOMMAX(src->y_crop_width + dst->border,
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 73.5k, False: 108]
  |  |  ------------------
  ------------------
  119|  73.6k|                          ALIGN_POWER_OF_TWO(src->y_crop_width, 6)) -
  120|  73.6k|                   src->y_crop_width;
  121|  73.6k|  const int eb_y = AOMMAX(src->y_crop_height + dst->border,
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 73.5k, False: 56]
  |  |  ------------------
  ------------------
  122|  73.6k|                          ALIGN_POWER_OF_TWO(src->y_crop_height, 6)) -
  123|  73.6k|                   src->y_crop_height;
  124|  73.6k|  const int uv_width_subsampling = src->subsampling_x;
  125|  73.6k|  const int uv_height_subsampling = src->subsampling_y;
  126|  73.6k|  const int et_uv = et_y >> uv_height_subsampling;
  127|  73.6k|  const int el_uv = el_y >> uv_width_subsampling;
  128|  73.6k|  const int eb_uv = eb_y >> uv_height_subsampling;
  129|  73.6k|  const int er_uv = er_y >> uv_width_subsampling;
  130|       |
  131|  73.6k|  if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  73.6k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (131:7): [True: 20.4k, False: 53.1k]
  ------------------
  132|  20.4k|    highbd_copy_and_extend_plane(src->y_buffer, src->y_stride, dst->y_buffer,
  133|  20.4k|                                 dst->y_stride, src->y_crop_width,
  134|  20.4k|                                 src->y_crop_height, et_y, el_y, eb_y, er_y);
  135|  20.4k|    if (!src->monochrome) {
  ------------------
  |  Branch (135:9): [True: 9.28k, False: 11.2k]
  ------------------
  136|  9.28k|      highbd_copy_and_extend_plane(
  137|  9.28k|          src->u_buffer, src->uv_stride, dst->u_buffer, dst->uv_stride,
  138|  9.28k|          src->uv_crop_width, src->uv_crop_height, et_uv, el_uv, eb_uv, er_uv);
  139|  9.28k|      highbd_copy_and_extend_plane(
  140|  9.28k|          src->v_buffer, src->uv_stride, dst->v_buffer, dst->uv_stride,
  141|  9.28k|          src->uv_crop_width, src->uv_crop_height, et_uv, el_uv, eb_uv, er_uv);
  142|  9.28k|    }
  143|  20.4k|    return;
  144|  20.4k|  }
  145|       |
  146|  53.1k|  copy_and_extend_plane(src->y_buffer, src->y_stride, dst->y_buffer,
  147|  53.1k|                        dst->y_stride, src->y_crop_width, src->y_crop_height,
  148|  53.1k|                        et_y, el_y, eb_y, er_y, 1);
  149|  53.1k|  if (!src->monochrome) {
  ------------------
  |  Branch (149:7): [True: 18.7k, False: 34.4k]
  ------------------
  150|       |    // detect nv12 format
  151|  18.7k|    const int chroma_step = src->v_buffer ? 1 : 2;
  ------------------
  |  Branch (151:29): [True: 18.7k, False: 0]
  ------------------
  152|  18.7k|    const uint8_t *src_v_buffer =
  153|  18.7k|        src->v_buffer ? src->v_buffer : src->u_buffer + 1;
  ------------------
  |  Branch (153:9): [True: 18.7k, False: 0]
  ------------------
  154|  18.7k|    copy_and_extend_plane(src->u_buffer, src->uv_stride, dst->u_buffer,
  155|  18.7k|                          dst->uv_stride, src->uv_crop_width,
  156|  18.7k|                          src->uv_crop_height, et_uv, el_uv, eb_uv, er_uv,
  157|  18.7k|                          chroma_step);
  158|  18.7k|    copy_and_extend_plane(src_v_buffer, src->uv_stride, dst->v_buffer,
  159|  18.7k|                          dst->uv_stride, src->uv_crop_width,
  160|  18.7k|                          src->uv_crop_height, et_uv, el_uv, eb_uv, er_uv,
  161|  18.7k|                          chroma_step);
  162|  18.7k|  }
  163|  53.1k|}
extend.c:highbd_copy_and_extend_plane:
   72|  39.0k|                                         int extend_bottom, int extend_right) {
   73|  39.0k|  int i, linesize;
   74|  39.0k|  uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  39.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   75|  39.0k|  uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  ------------------
  |  |   79|  39.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
   76|       |
   77|       |  // copy the left and right most columns out
   78|  39.0k|  const uint16_t *src_ptr1 = src;
   79|  39.0k|  const uint16_t *src_ptr2 = src + w - 1;
   80|  39.0k|  uint16_t *dst_ptr1 = dst - extend_left;
   81|  39.0k|  uint16_t *dst_ptr2 = dst + w;
   82|       |
   83|  1.68M|  for (i = 0; i < h; i++) {
  ------------------
  |  Branch (83:15): [True: 1.64M, False: 39.0k]
  ------------------
   84|  1.64M|    aom_memset16(dst_ptr1, src_ptr1[0], extend_left);
   85|  1.64M|    memcpy(dst_ptr1 + extend_left, src_ptr1, w * sizeof(src_ptr1[0]));
   86|  1.64M|    aom_memset16(dst_ptr2, src_ptr2[0], extend_right);
   87|  1.64M|    src_ptr1 += src_pitch;
   88|  1.64M|    src_ptr2 += src_pitch;
   89|  1.64M|    dst_ptr1 += dst_pitch;
   90|  1.64M|    dst_ptr2 += dst_pitch;
   91|  1.64M|  }
   92|       |
   93|       |  // Now copy the top and bottom lines into each line of the respective
   94|       |  // borders
   95|  39.0k|  src_ptr1 = dst - extend_left;
   96|  39.0k|  src_ptr2 = dst + dst_pitch * (h - 1) - extend_left;
   97|  39.0k|  dst_ptr1 = dst + dst_pitch * (-extend_top) - extend_left;
   98|  39.0k|  dst_ptr2 = dst + dst_pitch * (h)-extend_left;
   99|  39.0k|  linesize = extend_left + extend_right + w;
  100|  39.0k|  assert(linesize <= dst_pitch);
  101|       |
  102|  3.08M|  for (i = 0; i < extend_top; i++) {
  ------------------
  |  Branch (102:15): [True: 3.04M, False: 39.0k]
  ------------------
  103|  3.04M|    memcpy(dst_ptr1, src_ptr1, linesize * sizeof(src_ptr1[0]));
  104|  3.04M|    dst_ptr1 += dst_pitch;
  105|  3.04M|  }
  106|       |
  107|  3.08M|  for (i = 0; i < extend_bottom; i++) {
  ------------------
  |  Branch (107:15): [True: 3.04M, False: 39.0k]
  ------------------
  108|  3.04M|    memcpy(dst_ptr2, src_ptr2, linesize * sizeof(src_ptr2[0]));
  109|  3.04M|    dst_ptr2 += dst_pitch;
  110|  3.04M|  }
  111|  39.0k|}
extend.c:copy_and_extend_plane:
   25|  90.5k|                                  int chroma_step) {
   26|  90.5k|  int i, linesize;
   27|       |  // copy the left and right most columns out
   28|  90.5k|  const uint8_t *src_ptr1 = src;
   29|  90.5k|  const uint8_t *src_ptr2 = src + (w - 1) * chroma_step;
   30|  90.5k|  uint8_t *dst_ptr1 = dst - extend_left;
   31|  90.5k|  uint8_t *dst_ptr2 = dst + w;
   32|       |
   33|  4.65M|  for (i = 0; i < h; i++) {
  ------------------
  |  Branch (33:15): [True: 4.56M, False: 90.5k]
  ------------------
   34|  4.56M|    memset(dst_ptr1, src_ptr1[0], extend_left);
   35|  4.56M|    if (chroma_step == 1) {
  ------------------
  |  Branch (35:9): [True: 4.56M, False: 0]
  ------------------
   36|  4.56M|      memcpy(dst_ptr1 + extend_left, src_ptr1, w);
   37|  4.56M|    } else {
   38|      0|      for (int j = 0; j < w; j++) {
  ------------------
  |  Branch (38:23): [True: 0, False: 0]
  ------------------
   39|      0|        dst_ptr1[extend_left + j] = src_ptr1[chroma_step * j];
   40|      0|      }
   41|      0|    }
   42|  4.56M|    memset(dst_ptr2, src_ptr2[0], extend_right);
   43|  4.56M|    src_ptr1 += src_pitch;
   44|  4.56M|    src_ptr2 += src_pitch;
   45|  4.56M|    dst_ptr1 += dst_pitch;
   46|  4.56M|    dst_ptr2 += dst_pitch;
   47|  4.56M|  }
   48|       |
   49|       |  // Now copy the top and bottom lines into each line of the respective
   50|       |  // borders
   51|  90.5k|  src_ptr1 = dst - extend_left;
   52|  90.5k|  src_ptr2 = dst + dst_pitch * (h - 1) - extend_left;
   53|  90.5k|  dst_ptr1 = dst + dst_pitch * (-extend_top) - extend_left;
   54|  90.5k|  dst_ptr2 = dst + dst_pitch * (h)-extend_left;
   55|  90.5k|  linesize = extend_left + extend_right + w;
   56|  90.5k|  assert(linesize <= dst_pitch);
   57|       |
   58|  6.84M|  for (i = 0; i < extend_top; i++) {
  ------------------
  |  Branch (58:15): [True: 6.75M, False: 90.5k]
  ------------------
   59|  6.75M|    memcpy(dst_ptr1, src_ptr1, linesize);
   60|  6.75M|    dst_ptr1 += dst_pitch;
   61|  6.75M|  }
   62|       |
   63|  6.84M|  for (i = 0; i < extend_bottom; i++) {
  ------------------
  |  Branch (63:15): [True: 6.75M, False: 90.5k]
  ------------------
   64|  6.75M|    memcpy(dst_ptr2, src_ptr2, linesize);
   65|  6.75M|    dst_ptr2 += dst_pitch;
   66|  6.75M|  }
   67|  90.5k|}

av1_ext_part_delete:
   49|  18.4k|aom_codec_err_t av1_ext_part_delete(ExtPartController *ext_part_controller) {
   50|  18.4k|  if (ext_part_controller == NULL) {
  ------------------
  |  Branch (50:7): [True: 0, False: 18.4k]
  ------------------
   51|      0|    return AOM_CODEC_INVALID_PARAM;
   52|      0|  }
   53|  18.4k|  if (ext_part_controller->ready) {
  ------------------
  |  Branch (53:7): [True: 0, False: 18.4k]
  ------------------
   54|      0|    const aom_ext_part_status_t status =
   55|      0|        ext_part_controller->funcs.delete_model(ext_part_controller->model);
   56|      0|    if (status != AOM_EXT_PART_OK) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|      return AOM_CODEC_ERROR;
   58|      0|    }
   59|      0|  }
   60|  18.4k|  return ext_part_init(ext_part_controller);
   61|  18.4k|}
external_partition.c:ext_part_init:
   41|  18.4k|static aom_codec_err_t ext_part_init(ExtPartController *ext_part_controller) {
   42|  18.4k|  if (ext_part_controller == NULL) {
  ------------------
  |  Branch (42:7): [True: 0, False: 18.4k]
  ------------------
   43|      0|    return AOM_CODEC_INVALID_PARAM;
   44|      0|  }
   45|  18.4k|  memset(ext_part_controller, 0, sizeof(*ext_part_controller));
   46|  18.4k|  return AOM_CODEC_OK;
   47|  18.4k|}

av1_twopass_zero_stats:
   92|  36.8k|void av1_twopass_zero_stats(FIRSTPASS_STATS *section) {
   93|  36.8k|  section->frame = 0.0;
   94|  36.8k|  section->weight = 0.0;
   95|  36.8k|  section->intra_error = 0.0;
   96|  36.8k|  section->frame_avg_wavelet_energy = 0.0;
   97|  36.8k|  section->coded_error = 0.0;
   98|  36.8k|  section->log_intra_error = 0.0;
   99|  36.8k|  section->log_coded_error = 0.0;
  100|  36.8k|  section->sr_coded_error = 0.0;
  101|  36.8k|  section->lt_coded_error = 0.0;
  102|  36.8k|  section->pcnt_inter = 0.0;
  103|  36.8k|  section->pcnt_motion = 0.0;
  104|  36.8k|  section->pcnt_second_ref = 0.0;
  105|  36.8k|  section->pcnt_neutral = 0.0;
  106|  36.8k|  section->intra_skip_pct = 0.0;
  107|  36.8k|  section->inactive_zone_rows = 0.0;
  108|  36.8k|  section->inactive_zone_cols = 0.0;
  109|  36.8k|  section->MVr = 0.0;
  110|  36.8k|  section->mvr_abs = 0.0;
  111|  36.8k|  section->MVc = 0.0;
  112|  36.8k|  section->mvc_abs = 0.0;
  113|  36.8k|  section->MVrv = 0.0;
  114|  36.8k|  section->MVcv = 0.0;
  115|  36.8k|  section->mv_in_out_count = 0.0;
  116|  36.8k|  section->new_mv_count = 0.0;
  117|  36.8k|  section->count = 0.0;
  118|  36.8k|  section->duration = 1.0;
  119|  36.8k|  section->is_flash = 0;
  120|  36.8k|  section->noise_var = 0;
  121|  36.8k|  section->cor_coeff = 1.0;
  122|  36.8k|}
av1_free_firstpass_data:
 1114|  18.4k|void av1_free_firstpass_data(FirstPassData *firstpass_data) {
 1115|  18.4k|  aom_free(firstpass_data->raw_motion_err_list);
 1116|  18.4k|  firstpass_data->raw_motion_err_list = NULL;
 1117|  18.4k|  aom_free(firstpass_data->mb_stats);
 1118|       |  firstpass_data->mb_stats = NULL;
 1119|  18.4k|}
av1_firstpass_info_move_cur_index:
 1598|  73.6k|    FIRSTPASS_INFO *firstpass_info) {
 1599|  73.6k|  assert(firstpass_info->future_stats_count +
 1600|  73.6k|             firstpass_info->past_stats_count ==
 1601|  73.6k|         firstpass_info->stats_count);
 1602|  73.6k|  if (firstpass_info->future_stats_count > 1) {
  ------------------
  |  Branch (1602:7): [True: 0, False: 73.6k]
  ------------------
 1603|      0|    firstpass_info->cur_index =
 1604|      0|        (firstpass_info->cur_index + 1) % firstpass_info->stats_buf_size;
 1605|      0|    --firstpass_info->future_stats_count;
 1606|      0|    ++firstpass_info->past_stats_count;
 1607|      0|    return AOM_CODEC_OK;
 1608|  73.6k|  } else {
 1609|  73.6k|    return AOM_CODEC_ERROR;
 1610|  73.6k|  }
 1611|  73.6k|}

av1_is_enough_erroradvantage:
   34|    247|                                 double gm_erroradv_tr) {
   35|    247|  return best_erroradvantage < gm_erroradv_tr &&
  ------------------
  |  Branch (35:10): [True: 0, False: 247]
  ------------------
   36|      0|         best_erroradvantage * params_cost < erroradv_prod_tr;
  ------------------
  |  Branch (36:10): [True: 0, False: 0]
  ------------------
   37|    247|}
av1_convert_model_to_params:
   58|    267|                                 WarpedMotionParams *model) {
   59|    267|  convert_to_params(params, model->wmmat);
   60|    267|  model->wmtype = get_wmtype(model);
   61|    267|  model->invalid = 0;
   62|    267|}
av1_segmented_frame_error:
  325|    250|                                  int segment_map_stride) {
  326|    250|#if CONFIG_AV1_HIGHBITDEPTH
  327|    250|  if (use_hbd) {
  ------------------
  |  Branch (327:7): [True: 14, False: 236]
  ------------------
  328|     14|    return highbd_segmented_frame_error(
  329|     14|        CONVERT_TO_SHORTPTR(ref), ref_stride, CONVERT_TO_SHORTPTR(dst),
  ------------------
  |  |   79|     14|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
                      CONVERT_TO_SHORTPTR(ref), ref_stride, CONVERT_TO_SHORTPTR(dst),
  ------------------
  |  |   79|     14|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  330|     14|        dst_stride, p_width, p_height, bd, segment_map, segment_map_stride);
  331|     14|  }
  332|    236|#endif
  333|    236|  (void)use_hbd;
  334|    236|  (void)bd;
  335|    236|  return segmented_frame_error(ref, ref_stride, dst, dst_stride, p_width,
  336|    236|                               p_height, segment_map, segment_map_stride);
  337|    250|}
av1_refine_integerized_param:
  369|    249|    double gm_erroradv_tr) {
  370|    249|  static const int max_trans_model_params[TRANS_TYPES] = { 0, 2, 4, 6 };
  371|    249|  const int border = ERRORADV_BORDER;
  ------------------
  |  |   31|    249|#define ERRORADV_BORDER 0
  ------------------
  372|    249|  int i = 0, p;
  373|    249|  int n_params = max_trans_model_params[wmtype];
  374|    249|  int32_t *param_mat = wm->wmmat;
  375|    249|  int64_t step_error, best_error;
  376|    249|  int32_t step;
  377|    249|  int32_t *param;
  378|    249|  int32_t curr_param;
  379|    249|  int32_t best_param;
  380|       |
  381|    249|  force_wmtype(wm, wmtype);
  382|    249|  wm->wmtype = get_wmtype(wm);
  383|       |
  384|    251|  if (n_refinements == 0) {
  ------------------
  |  Branch (384:7): [True: 251, False: 18.4E]
  ------------------
  385|       |    // Compute the maximum error value that will be accepted, so that
  386|       |    // get_warp_error can terminate early if it proves the model will not
  387|       |    // be accepted.
  388|    251|    int64_t selection_threshold =
  389|    251|        (int64_t)lrint(ref_frame_error * gm_erroradv_tr);
  390|    251|    return get_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
  391|    251|                          dst + border * d_stride + border, d_stride, border,
  392|    251|                          border, d_width - 2 * border, d_height - 2 * border,
  393|    251|                          0, 0, selection_threshold, segment_map,
  394|    251|                          segment_map_stride);
  395|    251|  }
  396|       |
  397|       |  // When refining, use a slightly higher threshold for the initial error
  398|       |  // calculation - see comment above erroradv_early_tr for why.
  399|  18.4E|  int64_t selection_threshold =
  400|  18.4E|      (int64_t)lrint(ref_frame_error * erroradv_early_tr);
  401|  18.4E|  best_error =
  402|  18.4E|      get_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
  403|  18.4E|                     dst + border * d_stride + border, d_stride, border, border,
  404|  18.4E|                     d_width - 2 * border, d_height - 2 * border, 0, 0,
  405|  18.4E|                     selection_threshold, segment_map, segment_map_stride);
  406|       |
  407|  18.4E|  if (best_error > selection_threshold) {
  ------------------
  |  Branch (407:7): [True: 0, False: 18.4E]
  ------------------
  408|      0|    return INT64_MAX;
  409|      0|  }
  410|       |
  411|  18.4E|  step = 1 << (n_refinements - 1);
  412|  18.4E|  for (i = 0; i < n_refinements; i++, step >>= 1) {
  ------------------
  |  Branch (412:15): [True: 0, False: 18.4E]
  ------------------
  413|      0|    for (p = 0; p < n_params; ++p) {
  ------------------
  |  Branch (413:17): [True: 0, False: 0]
  ------------------
  414|      0|      int step_dir = 0;
  415|      0|      param = param_mat + p;
  416|      0|      curr_param = *param;
  417|      0|      best_param = curr_param;
  418|       |      // look to the left
  419|       |      // Note: We have to use force_wmtype() to keep the proper symmetry for
  420|       |      // ROTZOOM type models
  421|      0|      *param = add_param_offset(p, curr_param, -step);
  422|      0|      force_wmtype(wm, wmtype);
  423|      0|      step_error =
  424|      0|          get_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
  425|      0|                         dst + border * d_stride + border, d_stride, border,
  426|      0|                         border, d_width - 2 * border, d_height - 2 * border, 0,
  427|      0|                         0, best_error, segment_map, segment_map_stride);
  428|      0|      if (step_error < best_error) {
  ------------------
  |  Branch (428:11): [True: 0, False: 0]
  ------------------
  429|      0|        best_error = step_error;
  430|      0|        best_param = *param;
  431|      0|        step_dir = -1;
  432|      0|      }
  433|       |
  434|       |      // look to the right
  435|      0|      *param = add_param_offset(p, curr_param, step);
  436|      0|      force_wmtype(wm, wmtype);
  437|      0|      step_error =
  438|      0|          get_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
  439|      0|                         dst + border * d_stride + border, d_stride, border,
  440|      0|                         border, d_width - 2 * border, d_height - 2 * border, 0,
  441|      0|                         0, best_error, segment_map, segment_map_stride);
  442|      0|      if (step_error < best_error) {
  ------------------
  |  Branch (442:11): [True: 0, False: 0]
  ------------------
  443|      0|        best_error = step_error;
  444|      0|        best_param = *param;
  445|      0|        step_dir = 1;
  446|      0|      }
  447|       |
  448|       |      // look to the direction chosen above repeatedly until error increases
  449|       |      // for the biggest step size
  450|      0|      while (step_dir) {
  ------------------
  |  Branch (450:14): [True: 0, False: 0]
  ------------------
  451|      0|        *param = add_param_offset(p, best_param, step * step_dir);
  452|      0|        force_wmtype(wm, wmtype);
  453|      0|        step_error =
  454|      0|            get_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
  455|      0|                           dst + border * d_stride + border, d_stride, border,
  456|      0|                           border, d_width - 2 * border, d_height - 2 * border,
  457|      0|                           0, 0, best_error, segment_map, segment_map_stride);
  458|      0|        if (step_error < best_error) {
  ------------------
  |  Branch (458:13): [True: 0, False: 0]
  ------------------
  459|      0|          best_error = step_error;
  460|      0|          best_param = *param;
  461|      0|        } else {
  462|      0|          step_dir = 0;
  463|      0|        }
  464|      0|      }
  465|       |
  466|       |      // Restore best parameter value so far
  467|      0|      *param = best_param;
  468|      0|      force_wmtype(wm, wmtype);
  469|      0|    }
  470|      0|  }
  471|       |
  472|  18.4E|  wm->wmtype = get_wmtype(wm);
  473|       |  // Recompute shear params for the refined model
  474|       |  // This should never fail, because we only ever consider warp-able models
  475|  18.4E|  if (!av1_get_shear_params(wm)) {
  ------------------
  |  Branch (475:7): [True: 0, False: 18.4E]
  ------------------
  476|       |    assert(0);
  477|      0|  }
  478|  18.4E|  return best_error;
  479|  18.4E|}
av1_compute_feature_segmentation_map:
  485|    246|                                          int num_inliers) {
  486|    246|  int seg_count = 0;
  487|    246|  memset(segment_map, 0, sizeof(*segment_map) * width * height);
  488|       |
  489|  2.43k|  for (int i = 0; i < num_inliers; i++) {
  ------------------
  |  Branch (489:19): [True: 2.18k, False: 246]
  ------------------
  490|  2.18k|    int x = inliers[i * 2];
  491|  2.18k|    int y = inliers[i * 2 + 1];
  492|  2.18k|    int seg_x = x >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  2.18k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  493|  2.18k|    int seg_y = y >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  2.18k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  494|  2.18k|    segment_map[seg_y * width + seg_x] += 1;
  495|  2.18k|  }
  496|       |
  497|  1.25k|  for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (497:19): [True: 1.01k, False: 246]
  ------------------
  498|  4.12k|    for (int j = 0; j < width; j++) {
  ------------------
  |  Branch (498:21): [True: 3.11k, False: 1.01k]
  ------------------
  499|  3.11k|      uint8_t feat_count = segment_map[i * width + j];
  500|  3.11k|      segment_map[i * width + j] = (feat_count >= FEAT_COUNT_TR);
  ------------------
  |  |  481|  3.11k|#define FEAT_COUNT_TR 3
  ------------------
  501|  3.11k|      seg_count += (segment_map[i * width + j]);
  502|  3.11k|    }
  503|  1.01k|  }
  504|       |
  505|       |  // If this motion does not make up a large enough portion of the frame,
  506|       |  // use the unsegmented version of the error metric
  507|    246|  if (seg_count < SEG_COUNT_TR)
  ------------------
  |  |  482|    246|#define SEG_COUNT_TR 48
  ------------------
  |  Branch (507:7): [True: 252, False: 18.4E]
  ------------------
  508|    252|    memset(segment_map, 1, width * height * sizeof(*segment_map));
  509|    246|}
global_motion.c:convert_to_params:
   39|    267|static void convert_to_params(const double *params, int32_t *model) {
   40|    267|  int i;
   41|    267|  model[0] = (int32_t)floor(params[0] * (1 << GM_TRANS_PREC_BITS) + 0.5);
  ------------------
  |  |  164|    267|#define GM_TRANS_PREC_BITS 6
  ------------------
   42|    267|  model[1] = (int32_t)floor(params[1] * (1 << GM_TRANS_PREC_BITS) + 0.5);
  ------------------
  |  |  164|    267|#define GM_TRANS_PREC_BITS 6
  ------------------
   43|    267|  model[0] = (int32_t)clamp(model[0], GM_TRANS_MIN, GM_TRANS_MAX) *
  ------------------
  |  |  180|    267|#define GM_TRANS_MIN -GM_TRANS_MAX
  |  |  ------------------
  |  |  |  |  177|    267|#define GM_TRANS_MAX (1 << GM_ABS_TRANS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  165|    267|#define GM_ABS_TRANS_BITS 12
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                model[0] = (int32_t)clamp(model[0], GM_TRANS_MIN, GM_TRANS_MAX) *
  ------------------
  |  |  177|    267|#define GM_TRANS_MAX (1 << GM_ABS_TRANS_BITS)
  |  |  ------------------
  |  |  |  |  165|    267|#define GM_ABS_TRANS_BITS 12
  |  |  ------------------
  ------------------
   44|    267|             GM_TRANS_DECODE_FACTOR;
  ------------------
  |  |  169|    267|#define GM_TRANS_DECODE_FACTOR (1 << GM_TRANS_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  167|    267|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    267|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|    267|#define GM_TRANS_PREC_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   45|    267|  model[1] = (int32_t)clamp(model[1], GM_TRANS_MIN, GM_TRANS_MAX) *
  ------------------
  |  |  180|    267|#define GM_TRANS_MIN -GM_TRANS_MAX
  |  |  ------------------
  |  |  |  |  177|    267|#define GM_TRANS_MAX (1 << GM_ABS_TRANS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  165|    267|#define GM_ABS_TRANS_BITS 12
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                model[1] = (int32_t)clamp(model[1], GM_TRANS_MIN, GM_TRANS_MAX) *
  ------------------
  |  |  177|    267|#define GM_TRANS_MAX (1 << GM_ABS_TRANS_BITS)
  |  |  ------------------
  |  |  |  |  165|    267|#define GM_ABS_TRANS_BITS 12
  |  |  ------------------
  ------------------
   46|    267|             GM_TRANS_DECODE_FACTOR;
  ------------------
  |  |  169|    267|#define GM_TRANS_DECODE_FACTOR (1 << GM_TRANS_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  167|    267|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    267|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  164|    267|#define GM_TRANS_PREC_BITS 6
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|       |
   48|  1.33k|  for (i = 2; i < 6; ++i) {
  ------------------
  |  Branch (48:15): [True: 1.06k, False: 267]
  ------------------
   49|  1.06k|    const int diag_value = ((i == 2 || i == 5) ? (1 << GM_ALPHA_PREC_BITS) : 0);
  ------------------
  |  |  172|    536|#define GM_ALPHA_PREC_BITS 15
  ------------------
  |  Branch (49:30): [True: 259, False: 806]
  |  Branch (49:40): [True: 269, False: 537]
  ------------------
   50|  1.06k|    model[i] = (int32_t)floor(params[i] * (1 << GM_ALPHA_PREC_BITS) + 0.5);
  ------------------
  |  |  172|  1.06k|#define GM_ALPHA_PREC_BITS 15
  ------------------
   51|  1.06k|    model[i] =
   52|  1.06k|        (int32_t)clamp(model[i] - diag_value, GM_ALPHA_MIN, GM_ALPHA_MAX);
  ------------------
  |  |  181|  1.06k|#define GM_ALPHA_MIN -GM_ALPHA_MAX
  |  |  ------------------
  |  |  |  |  178|  1.06k|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  1.06k|#define GM_ABS_ALPHA_BITS 12
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (int32_t)clamp(model[i] - diag_value, GM_ALPHA_MIN, GM_ALPHA_MAX);
  ------------------
  |  |  178|  1.06k|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|  1.06k|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
   53|  1.06k|    model[i] = (model[i] + diag_value) * GM_ALPHA_DECODE_FACTOR;
  ------------------
  |  |  175|  1.06k|#define GM_ALPHA_DECODE_FACTOR (1 << GM_ALPHA_PREC_DIFF)
  |  |  ------------------
  |  |  |  |  174|  1.06k|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.06k|#define WARPEDMODEL_PREC_BITS 16
  |  |  |  |  ------------------
  |  |  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  1.06k|#define GM_ALPHA_PREC_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|  1.06k|  }
   55|    267|}
global_motion.c:highbd_segmented_frame_error:
  137|     14|    int segment_map_stride) {
  138|     14|  (void)bd;
  139|     14|  int patch_w, patch_h;
  140|     14|  const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|     14|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  141|     14|  const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|     14|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  142|     14|  int64_t sum_error = 0;
  143|     54|  for (int i = 0; i < p_height; i += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     40|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     40|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (143:19): [True: 40, False: 14]
  ------------------
  144|    132|    for (int j = 0; j < p_width; j += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     92|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     92|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (144:21): [True: 92, False: 40]
  ------------------
  145|     92|      int seg_x = j >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|     92|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  146|     92|      int seg_y = i >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|     92|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  147|       |      // Only compute the error if this block contains inliers from the motion
  148|       |      // model
  149|     92|      if (!segment_map[seg_y * segment_map_stride + seg_x]) continue;
  ------------------
  |  Branch (149:11): [True: 0, False: 92]
  ------------------
  150|       |
  151|       |      // avoid computing error into the frame padding
  152|     92|      patch_w = AOMMIN(error_bsize_w, p_width - j);
  ------------------
  |  |   34|     92|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 52, False: 40]
  |  |  ------------------
  ------------------
  153|     92|      patch_h = AOMMIN(error_bsize_h, p_height - i);
  ------------------
  |  |   34|     92|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 58, False: 34]
  |  |  ------------------
  ------------------
  154|       |
  155|     92|      if (patch_w == WARP_ERROR_BLOCK && patch_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|    184|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     92|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    if (patch_w == WARP_ERROR_BLOCK && patch_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     52|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     52|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (155:11): [True: 52, False: 40]
  |  Branch (155:42): [True: 32, False: 20]
  ------------------
  156|     32|        sum_error += aom_highbd_sad32x32(
  157|     32|            CONVERT_TO_BYTEPTR(ref + j + i * ref_stride), ref_stride,
  ------------------
  |  |   80|     32|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  158|     32|            CONVERT_TO_BYTEPTR(dst + j + i * dst_stride), dst_stride);
  ------------------
  |  |   80|     32|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  159|     60|      } else {
  160|     60|        sum_error += generic_sad_highbd(ref + j + i * ref_stride, ref_stride,
  161|     60|                                        dst + j + i * dst_stride, dst_stride,
  162|     60|                                        patch_w, patch_h);
  163|     60|      }
  164|     92|    }
  165|     40|  }
  166|     14|  return sum_error;
  167|     14|}
global_motion.c:generic_sad_highbd:
  116|     76|                                     int p_width, int p_height) {
  117|       |  // This function should only be called for patches smaller than
  118|       |  // WARP_ERROR_BLOCK x WARP_ERROR_BLOCK. This keeps the number of pixels
  119|       |  // small enough that we don't need a 64-bit accumulator
  120|     76|  assert(p_width <= WARP_ERROR_BLOCK && p_height <= WARP_ERROR_BLOCK);
  121|       |
  122|     76|  int sad = 0;
  123|  1.78k|  for (int i = 0; i < p_height; ++i) {
  ------------------
  |  Branch (123:19): [True: 1.71k, False: 76]
  ------------------
  124|  39.1k|    for (int j = 0; j < p_width; ++j) {
  ------------------
  |  Branch (124:21): [True: 37.4k, False: 1.71k]
  ------------------
  125|  37.4k|      sad += abs(dst[j + i * dst_stride] - ref[j + i * ref_stride]);
  126|  37.4k|    }
  127|  1.71k|  }
  128|     76|  return sad;
  129|     76|}
global_motion.c:segmented_frame_error:
  243|    232|                                     int segment_map_stride) {
  244|    232|  int patch_w, patch_h;
  245|    232|  const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|    232|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 232]
  |  |  ------------------
  ------------------
  246|    232|  const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|    232|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 232]
  |  |  ------------------
  ------------------
  247|    232|  int64_t sum_error = 0;
  248|  1.20k|  for (int i = 0; i < p_height; i += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|    972|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|    972|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (248:19): [True: 972, False: 232]
  ------------------
  249|  3.91k|    for (int j = 0; j < p_width; j += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  2.94k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  2.94k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (249:21): [True: 2.94k, False: 972]
  ------------------
  250|  2.94k|      int seg_x = j >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  2.94k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  251|  2.94k|      int seg_y = i >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  2.94k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  252|       |      // Only compute the error if this block contains inliers from the motion
  253|       |      // model
  254|  2.94k|      if (!segment_map[seg_y * segment_map_stride + seg_x]) continue;
  ------------------
  |  Branch (254:11): [True: 0, False: 2.94k]
  ------------------
  255|       |
  256|       |      // avoid computing error into the frame padding
  257|  2.94k|      patch_w = AOMMIN(error_bsize_w, p_width - j);
  ------------------
  |  |   34|  2.94k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.04k, False: 906]
  |  |  ------------------
  ------------------
  258|  2.94k|      patch_h = AOMMIN(error_bsize_h, p_height - i);
  ------------------
  |  |   34|  2.94k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.22k, False: 724]
  |  |  ------------------
  ------------------
  259|       |
  260|  2.94k|      if (patch_w == WARP_ERROR_BLOCK && patch_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  5.89k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  2.94k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    if (patch_w == WARP_ERROR_BLOCK && patch_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  2.09k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  2.09k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (260:11): [True: 2.09k, False: 855]
  |  Branch (260:42): [True: 1.61k, False: 472]
  ------------------
  261|  1.62k|        sum_error += aom_sad32x32(ref + j + i * ref_stride, ref_stride,
  262|  1.62k|                                  dst + j + i * dst_stride, dst_stride);
  263|  1.62k|      } else {
  264|  1.32k|        sum_error +=
  265|  1.32k|            generic_sad(ref + j + i * ref_stride, ref_stride,
  266|  1.32k|                        dst + j + i * dst_stride, dst_stride, patch_w, patch_h);
  267|  1.32k|      }
  268|  2.94k|    }
  269|    972|  }
  270|    232|  return sum_error;
  271|    232|}
global_motion.c:generic_sad:
  221|  1.89k|                              int p_width, int p_height) {
  222|       |  // This function should only be called for patches smaller than
  223|       |  // WARP_ERROR_BLOCK x WARP_ERROR_BLOCK. This keeps the number of pixels
  224|       |  // small enough that we don't need a 64-bit accumulator
  225|  1.89k|  assert(p_width <= WARP_ERROR_BLOCK && p_height <= WARP_ERROR_BLOCK);
  226|       |
  227|  1.89k|  int sad = 0;
  228|  48.3k|  for (int i = 0; i < p_height; ++i) {
  ------------------
  |  Branch (228:19): [True: 46.4k, False: 1.89k]
  ------------------
  229|   775k|    for (int j = 0; j < p_width; ++j) {
  ------------------
  |  Branch (229:21): [True: 729k, False: 46.4k]
  ------------------
  230|   729k|      sad += abs(dst[j + i * dst_stride] - ref[j + i * ref_stride]);
  231|   729k|    }
  232|  46.4k|  }
  233|  1.89k|  return sad;
  234|  1.89k|}
global_motion.c:force_wmtype:
   93|    246|static void force_wmtype(WarpedMotionParams *wm, TransformationType wmtype) {
   94|    246|  switch (wmtype) {
   95|      0|    case IDENTITY:
  ------------------
  |  Branch (95:5): [True: 0, False: 246]
  ------------------
   96|      0|      wm->wmmat[0] = 0;
   97|      0|      wm->wmmat[1] = 0;
   98|      0|      AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|      0|  do {                           \
  |  |   53|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   99|      0|    case TRANSLATION:
  ------------------
  |  Branch (99:5): [True: 0, False: 246]
  ------------------
  100|      0|      wm->wmmat[2] = 1 << WARPEDMODEL_PREC_BITS;
  ------------------
  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  ------------------
  101|      0|      wm->wmmat[3] = 0;
  102|      0|      AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|      0|  do {                           \
  |  |   53|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  103|    249|    case ROTZOOM:
  ------------------
  |  Branch (103:5): [True: 249, False: 18.4E]
  ------------------
  104|    249|      wm->wmmat[4] = -wm->wmmat[3];
  105|    249|      wm->wmmat[5] = wm->wmmat[2];
  106|    249|      AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|    249|  do {                           \
  |  |   53|    249|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 249]
  |  |  ------------------
  ------------------
  107|    249|    case AFFINE: break;
  ------------------
  |  Branch (107:5): [True: 0, False: 246]
  ------------------
  108|      0|    default: assert(0);
  ------------------
  |  Branch (108:5): [True: 0, False: 246]
  ------------------
  109|    246|  }
  110|    250|  wm->wmtype = wmtype;
  111|    250|}
global_motion.c:get_warp_error:
  347|    246|                              int segment_map_stride) {
  348|    246|  if (!av1_get_shear_params(wm)) return INT64_MAX;
  ------------------
  |  Branch (348:7): [True: 0, False: 246]
  ------------------
  349|    246|#if CONFIG_AV1_HIGHBITDEPTH
  350|    246|  if (use_hbd)
  ------------------
  |  Branch (350:7): [True: 14, False: 232]
  ------------------
  351|     14|    return highbd_warp_error(wm, CONVERT_TO_SHORTPTR(ref), ref_width,
  ------------------
  |  |   79|     14|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  352|     14|                             ref_height, ref_stride, CONVERT_TO_SHORTPTR(dst),
  ------------------
  |  |   79|     14|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  353|     14|                             dst_stride, p_col, p_row, p_width, p_height,
  354|     14|                             subsampling_x, subsampling_y, bd, best_error,
  355|     14|                             segment_map, segment_map_stride);
  356|    232|#endif
  357|    232|  (void)use_hbd;
  358|    232|  (void)bd;
  359|    232|  return warp_error(wm, ref, ref_width, ref_height, ref_stride, dst, dst_stride,
  360|    232|                    p_col, p_row, p_width, p_height, subsampling_x,
  361|    232|                    subsampling_y, best_error, segment_map, segment_map_stride);
  362|    246|}
global_motion.c:highbd_warp_error:
  179|     14|                                 uint8_t *segment_map, int segment_map_stride) {
  180|     14|  int64_t gm_sumerr = 0;
  181|     14|  const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|     14|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  182|     14|  const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|     14|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  183|     14|  DECLARE_ALIGNED(32, uint16_t, tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]);
  ------------------
  |  |   19|     14|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  184|       |
  185|     14|  ConvolveParams conv_params = get_conv_params(0, 0, bd);
  186|     14|  conv_params.use_dist_wtd_comp_avg = 0;
  187|     26|  for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     12|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     12|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (187:23): [True: 26, False: 0]
  ------------------
  188|     60|    for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     34|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     34|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (188:25): [True: 48, False: 12]
  ------------------
  189|     48|      int seg_x = j >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|     48|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  190|     48|      int seg_y = i >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|     48|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  191|       |      // Only compute the error if this block contains inliers from the motion
  192|       |      // model
  193|     48|      if (!segment_map[seg_y * segment_map_stride + seg_x]) continue;
  ------------------
  |  Branch (193:11): [True: 0, False: 48]
  ------------------
  194|       |      // avoid warping extra 8x8 blocks in the padded region of the frame
  195|       |      // when p_width and p_height are not multiples of WARP_ERROR_BLOCK
  196|     48|      const int warp_w = AOMMIN(error_bsize_w, p_col + ref_width - j);
  ------------------
  |  |   34|     48|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32, False: 16]
  |  |  ------------------
  ------------------
  197|     48|      const int warp_h = AOMMIN(error_bsize_h, p_row + ref_height - i);
  ------------------
  |  |   34|     48|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 48, False: 0]
  |  |  ------------------
  ------------------
  198|     48|      highbd_warp_plane(wm, ref, ref_width, ref_height, ref_stride, tmp, j, i,
  199|     48|                        warp_w, warp_h, WARP_ERROR_BLOCK, subsampling_x,
  ------------------
  |  |   34|     48|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     48|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  200|     48|                        subsampling_y, bd, &conv_params);
  201|       |
  202|     48|      if (warp_w == WARP_ERROR_BLOCK && warp_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     96|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     48|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    if (warp_w == WARP_ERROR_BLOCK && warp_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|     32|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     32|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (202:11): [True: 32, False: 16]
  |  Branch (202:41): [True: 32, False: 0]
  ------------------
  203|     32|        gm_sumerr += aom_highbd_sad32x32(
  204|     32|            CONVERT_TO_BYTEPTR(tmp), WARP_ERROR_BLOCK,
  ------------------
  |  |   80|     32|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
                          CONVERT_TO_BYTEPTR(tmp), WARP_ERROR_BLOCK,
  ------------------
  |  |   34|     32|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     32|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  205|     32|            CONVERT_TO_BYTEPTR(dst + j + i * dst_stride), dst_stride);
  ------------------
  |  |   80|     32|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  206|     32|      } else {
  207|     16|        gm_sumerr +=
  208|     16|            generic_sad_highbd(tmp, WARP_ERROR_BLOCK, dst + j + i * dst_stride,
  ------------------
  |  |   34|     16|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|     16|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  209|     16|                               dst_stride, warp_w, warp_h);
  210|     16|      }
  211|       |
  212|     48|      if (gm_sumerr > best_error) return INT64_MAX;
  ------------------
  |  Branch (212:11): [True: 14, False: 34]
  ------------------
  213|     48|    }
  214|     26|  }
  215|      0|  return gm_sumerr;
  216|     14|}
global_motion.c:warp_error:
  282|    231|                          int segment_map_stride) {
  283|    231|  int64_t gm_sumerr = 0;
  284|    231|  int warp_w, warp_h;
  285|    231|  const int error_bsize_w = AOMMIN(p_width, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|    231|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 231]
  |  |  ------------------
  ------------------
  286|    231|  const int error_bsize_h = AOMMIN(p_height, WARP_ERROR_BLOCK);
  ------------------
  |  |   34|    231|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 231]
  |  |  ------------------
  ------------------
  287|    231|  DECLARE_ALIGNED(16, uint8_t, tmp[WARP_ERROR_BLOCK * WARP_ERROR_BLOCK]);
  ------------------
  |  |   19|    231|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  288|    231|  ConvolveParams conv_params = get_conv_params(0, 0, 8);
  289|    231|  conv_params.use_dist_wtd_comp_avg = 0;
  290|       |
  291|    660|  for (int i = p_row; i < p_row + p_height; i += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|    422|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|    422|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (291:23): [True: 660, False: 18.4E]
  ------------------
  292|  2.22k|    for (int j = p_col; j < p_col + p_width; j += WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  1.56k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  1.56k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (292:25): [True: 1.79k, False: 422]
  ------------------
  293|  1.79k|      int seg_x = j >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  1.79k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  294|  1.79k|      int seg_y = i >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  1.79k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  295|       |      // Only compute the error if this block contains inliers from the motion
  296|       |      // model
  297|  1.79k|      if (!segment_map[seg_y * segment_map_stride + seg_x]) continue;
  ------------------
  |  Branch (297:11): [True: 0, False: 1.79k]
  ------------------
  298|       |      // avoid warping extra 8x8 blocks in the padded region of the frame
  299|       |      // when p_width and p_height are not multiples of WARP_ERROR_BLOCK
  300|  1.79k|      warp_w = AOMMIN(error_bsize_w, p_col + ref_width - j);
  ------------------
  |  |   34|  1.79k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.31k, False: 483]
  |  |  ------------------
  ------------------
  301|  1.79k|      warp_h = AOMMIN(error_bsize_h, p_row + ref_height - i);
  ------------------
  |  |   34|  1.79k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.74k, False: 49]
  |  |  ------------------
  ------------------
  302|  1.79k|      warp_plane(wm, ref, ref_width, ref_height, ref_stride, tmp, j, i, warp_w,
  303|  1.79k|                 warp_h, WARP_ERROR_BLOCK, subsampling_x, subsampling_y,
  ------------------
  |  |   34|  1.79k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  1.79k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  304|  1.79k|                 &conv_params);
  305|       |
  306|  1.79k|      if (warp_w == WARP_ERROR_BLOCK && warp_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  3.59k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  1.79k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    if (warp_w == WARP_ERROR_BLOCK && warp_h == WARP_ERROR_BLOCK) {
  ------------------
  |  |   34|  1.34k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  1.34k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  |  Branch (306:11): [True: 1.34k, False: 456]
  |  Branch (306:41): [True: 1.30k, False: 42]
  ------------------
  307|  1.30k|        gm_sumerr += aom_sad32x32(tmp, WARP_ERROR_BLOCK,
  ------------------
  |  |   34|  1.30k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  1.30k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  308|  1.30k|                                  dst + j + i * dst_stride, dst_stride);
  309|  1.30k|      } else {
  310|    496|        gm_sumerr +=
  311|    496|            generic_sad(tmp, WARP_ERROR_BLOCK, dst + j + i * dst_stride,
  ------------------
  |  |   34|    496|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|    496|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
  312|    496|                        dst_stride, warp_w, warp_h);
  313|    496|      }
  314|       |
  315|  1.79k|      if (gm_sumerr > best_error) return INT64_MAX;
  ------------------
  |  Branch (315:11): [True: 238, False: 1.56k]
  ------------------
  316|  1.79k|    }
  317|    660|  }
  318|  18.4E|  return gm_sumerr;
  319|    231|}

av1_compute_gm_for_valid_ref_frames:
  188|  6.58k|    int segment_map_h) {
  189|  6.58k|  AV1_COMMON *const cm = &cpi->common;
  190|  6.58k|  const WarpedMotionParams *ref_params =
  191|  6.58k|      cm->prev_frame ? &cm->prev_frame->global_motion[frame]
  ------------------
  |  Branch (191:7): [True: 0, False: 6.58k]
  ------------------
  192|  6.58k|                     : &default_warp_params;
  193|       |
  194|  6.58k|  compute_global_motion_for_ref_frame(cpi, error_info, ref_buf, frame,
  195|  6.58k|                                      motion_models, segment_map, segment_map_w,
  196|  6.58k|                                      segment_map_h, ref_params);
  197|  6.58k|}
av1_compute_global_motion_facade:
  406|  73.6k|void av1_compute_global_motion_facade(AV1_COMP *cpi) {
  407|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  408|  73.6k|  GlobalMotionInfo *const gm_info = &cpi->gm_info;
  409|       |
  410|  73.6k|  if (cpi->oxcf.tool_cfg.enable_global_motion) {
  ------------------
  |  Branch (410:7): [True: 49.2k, False: 24.4k]
  ------------------
  411|  49.2k|    if (cpi->gf_frame_index == 0) {
  ------------------
  |  Branch (411:9): [True: 12.3k, False: 36.9k]
  ------------------
  412|  98.4k|      for (int i = 0; i < FRAME_UPDATE_TYPES; i++) {
  ------------------
  |  Branch (412:23): [True: 86.1k, False: 12.3k]
  ------------------
  413|  86.1k|        cpi->ppi->valid_gm_model_found[i] = INT32_MAX;
  414|       |#if CONFIG_FPMT_TEST
  415|       |        if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE)
  416|       |          cpi->ppi->temp_valid_gm_model_found[i] = INT32_MAX;
  417|       |#endif
  418|  86.1k|      }
  419|  12.3k|    }
  420|  49.2k|  }
  421|       |
  422|  73.6k|  if (cpi->common.current_frame.frame_type == INTER_FRAME && cpi->source &&
  ------------------
  |  Branch (422:7): [True: 55.2k, False: 18.4k]
  |  Branch (422:62): [True: 55.2k, False: 0]
  ------------------
  423|  55.2k|      cpi->oxcf.tool_cfg.enable_global_motion && !gm_info->search_done &&
  ------------------
  |  Branch (423:7): [True: 36.9k, False: 18.3k]
  |  Branch (423:50): [True: 36.9k, False: 0]
  ------------------
  424|  36.9k|      cpi->sf.gm_sf.gm_search_type != GM_DISABLE_SEARCH) {
  ------------------
  |  Branch (424:7): [True: 36.9k, False: 0]
  ------------------
  425|  36.9k|    setup_global_motion_info_params(cpi);
  426|       |    // Terminate early if the total number of reference frames is zero.
  427|  36.9k|    if (cpi->gm_info.num_ref_frames[0] || cpi->gm_info.num_ref_frames[1]) {
  ------------------
  |  Branch (427:9): [True: 3.70k, False: 33.2k]
  |  Branch (427:43): [True: 0, False: 33.2k]
  ------------------
  428|  3.70k|      gm_alloc_data(cpi, &cpi->td.gm_data);
  429|  3.70k|      if (cpi->mt_info.num_workers > 1)
  ------------------
  |  Branch (429:11): [True: 2.88k, False: 812]
  ------------------
  430|  2.88k|        av1_global_motion_estimation_mt(cpi);
  431|    812|      else
  432|    812|        global_motion_estimation(cpi);
  433|  3.70k|      gm_dealloc_data(&cpi->td.gm_data);
  434|  3.70k|      gm_info->search_done = 1;
  435|  3.70k|    }
  436|  36.9k|  }
  437|  73.6k|  memcpy(cm->cur_frame->global_motion, cm->global_motion,
  438|  73.6k|         sizeof(cm->cur_frame->global_motion));
  439|  73.6k|}
global_motion_facade.c:compute_global_motion_for_ref_frame:
   83|  6.58k|    const int segment_map_h, const WarpedMotionParams *ref_params) {
   84|  6.58k|  AV1_COMMON *const cm = &cpi->common;
   85|  6.58k|  MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
   86|  6.58k|  int src_width = cpi->source->y_crop_width;
   87|  6.58k|  int src_height = cpi->source->y_crop_height;
   88|  6.58k|  int src_stride = cpi->source->y_stride;
   89|  6.58k|  assert(ref_buf[frame] != NULL);
   90|  6.58k|  int bit_depth = cpi->common.seq_params->bit_depth;
   91|  6.58k|  GlobalMotionMethod global_motion_method = default_global_motion_method;
   92|  6.58k|  int downsample_level = cpi->sf.gm_sf.downsample_level;
   93|  6.58k|  int num_refinements = cpi->sf.gm_sf.num_refinement_steps;
   94|  6.58k|  int gm_erroradv_tr_level = cpi->sf.gm_sf.gm_erroradv_tr_level;
   95|  6.58k|  bool mem_alloc_failed = false;
   96|       |
   97|  6.58k|  assert(gm_erroradv_tr_level < 3);
   98|       |  // Select the best model based on fractional error reduction.
   99|       |  // By initializing this to erroradv_tr, the same logic which is used to
  100|       |  // select the best model will automatically filter out any model which
  101|       |  // doesn't meet the required quality threshold
  102|  6.58k|  double best_erroradv = erroradv_tr[gm_erroradv_tr_level];
  103|  6.58k|  for (TransformationType model = FIRST_GLOBAL_TRANS_TYPE;
  ------------------
  |  |   24|  6.58k|#define FIRST_GLOBAL_TRANS_TYPE ROTZOOM
  ------------------
  104|  13.1k|       model <= LAST_GLOBAL_TRANS_TYPE; ++model) {
  ------------------
  |  |   25|  13.1k|#define LAST_GLOBAL_TRANS_TYPE ROTZOOM
  ------------------
  |  Branch (104:8): [True: 6.58k, False: 6.58k]
  ------------------
  105|  6.58k|    if (!aom_compute_global_motion(model, cpi->source, ref_buf[frame],
  ------------------
  |  Branch (105:9): [True: 6.31k, False: 269]
  ------------------
  106|  6.58k|                                   bit_depth, global_motion_method,
  107|  6.58k|                                   downsample_level, motion_models,
  108|  6.58k|                                   RANSAC_NUM_MOTIONS, &mem_alloc_failed)) {
  ------------------
  |  |   24|  6.58k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  109|  6.31k|      if (mem_alloc_failed) {
  ------------------
  |  Branch (109:11): [True: 0, False: 6.31k]
  ------------------
  110|      0|        aom_internal_error(error_info, AOM_CODEC_MEM_ERROR,
  111|      0|                           "Failed to allocate global motion buffers");
  112|      0|      }
  113|  6.31k|      continue;
  114|  6.31k|    }
  115|       |
  116|    539|    for (int i = 0; i < RANSAC_NUM_MOTIONS; ++i) {
  ------------------
  |  |   24|    539|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (116:21): [True: 270, False: 269]
  ------------------
  117|    270|      if (motion_models[i].num_inliers == 0) continue;
  ------------------
  |  Branch (117:11): [True: 0, False: 270]
  ------------------
  118|       |
  119|    270|      WarpedMotionParams tmp_wm_params;
  120|    270|      av1_convert_model_to_params(motion_models[i].params, &tmp_wm_params);
  121|       |
  122|       |      // Check that the generated model is warp-able
  123|    270|      if (!av1_get_shear_params(&tmp_wm_params)) continue;
  ------------------
  |  Branch (123:11): [True: 18, False: 252]
  ------------------
  124|       |
  125|       |      // Skip models that we won't use (IDENTITY or TRANSLATION)
  126|       |      //
  127|       |      // For IDENTITY type models, we don't need to evaluate anything because
  128|       |      // all the following logic is effectively comparing the estimated model
  129|       |      // to an identity model.
  130|       |      //
  131|       |      // For TRANSLATION type global motion models, gm_get_motion_vector() gives
  132|       |      // the wrong motion vector (see comments in that function for details).
  133|       |      // As translation-type models do not give much gain, we can avoid this bug
  134|       |      // by never choosing a TRANSLATION type model
  135|    252|      if (tmp_wm_params.wmtype <= TRANSLATION) continue;
  ------------------
  |  Branch (135:11): [True: 0, False: 252]
  ------------------
  136|       |
  137|    252|      av1_compute_feature_segmentation_map(
  138|    252|          segment_map, segment_map_w, segment_map_h, motion_models[i].inliers,
  139|    252|          motion_models[i].num_inliers);
  140|       |
  141|    252|      int64_t ref_frame_error = av1_segmented_frame_error(
  142|    252|          is_cur_buf_hbd(xd), xd->bd, ref_buf[frame]->y_buffer,
  143|    252|          ref_buf[frame]->y_stride, cpi->source->y_buffer, src_stride,
  144|    252|          src_width, src_height, segment_map, segment_map_w);
  145|       |
  146|    252|      if (ref_frame_error == 0) continue;
  ------------------
  |  Branch (146:11): [True: 0, False: 252]
  ------------------
  147|       |
  148|    252|      const int64_t warp_error = av1_refine_integerized_param(
  149|    252|          &tmp_wm_params, tmp_wm_params.wmtype, is_cur_buf_hbd(xd), xd->bd,
  150|    252|          ref_buf[frame]->y_buffer, ref_buf[frame]->y_crop_width,
  151|    252|          ref_buf[frame]->y_crop_height, ref_buf[frame]->y_stride,
  152|    252|          cpi->source->y_buffer, src_width, src_height, src_stride,
  153|    252|          num_refinements, ref_frame_error, segment_map, segment_map_w,
  154|    252|          erroradv_tr[gm_erroradv_tr_level]);
  155|       |
  156|       |      // av1_refine_integerized_param() can return a simpler model type than
  157|       |      // its input, so re-check model type here
  158|    252|      if (tmp_wm_params.wmtype <= TRANSLATION) continue;
  ------------------
  |  Branch (158:11): [True: 0, False: 252]
  ------------------
  159|       |
  160|    252|      double erroradvantage = (double)warp_error / ref_frame_error;
  161|       |
  162|       |      // Check that the model signaling cost is not too high
  163|    252|      if (!av1_is_enough_erroradvantage(
  ------------------
  |  Branch (163:11): [True: 248, False: 4]
  ------------------
  164|    252|              erroradvantage,
  165|    252|              gm_get_params_cost(&tmp_wm_params, ref_params,
  166|    252|                                 cm->features.allow_high_precision_mv),
  167|    252|              erroradv_tr[gm_erroradv_tr_level])) {
  168|    248|        continue;
  169|    248|      }
  170|       |
  171|      4|      if (erroradvantage < best_erroradv) {
  ------------------
  |  Branch (171:11): [True: 0, False: 4]
  ------------------
  172|      0|        best_erroradv = erroradvantage;
  173|       |        // Save the wm_params modified by
  174|       |        // av1_refine_integerized_param() rather than motion index to
  175|       |        // avoid rerunning refine() below.
  176|      0|        memcpy(&(cm->global_motion[frame]), &tmp_wm_params,
  177|      0|               sizeof(WarpedMotionParams));
  178|      0|      }
  179|      4|    }
  180|    269|  }
  181|  6.58k|}
global_motion_facade.c:gm_get_params_cost:
   29|    247|                              const WarpedMotionParams *ref_gm, int allow_hp) {
   30|    247|  int params_cost = 0;
   31|    247|  int trans_bits, trans_prec_diff;
   32|    247|  switch (gm->wmtype) {
   33|      0|    case AFFINE:
  ------------------
  |  Branch (33:5): [True: 0, False: 247]
  ------------------
   34|    248|    case ROTZOOM:
  ------------------
  |  Branch (34:5): [True: 248, False: 18.4E]
  ------------------
   35|    248|      params_cost += aom_count_signed_primitive_refsubexpfin(
   36|    248|          GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|    248|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|    248|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                        GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|    248|#define SUBEXPFIN_K 3
  ------------------
   37|    248|          (ref_gm->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS),
  ------------------
  |  |  174|    248|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    248|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
                        (ref_gm->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS),
  ------------------
  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  ------------------
   38|    248|          (gm->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  174|    248|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    248|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
                        (gm->wmmat[2] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  ------------------
   39|    248|      params_cost += aom_count_signed_primitive_refsubexpfin(
   40|    248|          GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|    248|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|    248|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                        GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|    248|#define SUBEXPFIN_K 3
  ------------------
   41|    248|          (ref_gm->wmmat[3] >> GM_ALPHA_PREC_DIFF),
  ------------------
  |  |  174|    248|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    248|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
   42|    248|          (gm->wmmat[3] >> GM_ALPHA_PREC_DIFF));
  ------------------
  |  |  174|    248|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    248|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|    248|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
   43|    248|      if (gm->wmtype >= AFFINE) {
  ------------------
  |  Branch (43:11): [True: 0, False: 248]
  ------------------
   44|      0|        params_cost += aom_count_signed_primitive_refsubexpfin(
   45|      0|            GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                          GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
   46|      0|            (ref_gm->wmmat[4] >> GM_ALPHA_PREC_DIFF),
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
   47|      0|            (gm->wmmat[4] >> GM_ALPHA_PREC_DIFF));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
   48|      0|        params_cost += aom_count_signed_primitive_refsubexpfin(
   49|      0|            GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  178|      0|#define GM_ALPHA_MAX (1 << GM_ABS_ALPHA_BITS)
  |  |  ------------------
  |  |  |  |  173|      0|#define GM_ABS_ALPHA_BITS 12
  |  |  ------------------
  ------------------
                          GM_ALPHA_MAX + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|      0|#define SUBEXPFIN_K 3
  ------------------
   50|      0|            (ref_gm->wmmat[5] >> GM_ALPHA_PREC_DIFF) -
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
   51|      0|                (1 << GM_ALPHA_PREC_BITS),
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
   52|      0|            (gm->wmmat[5] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  174|      0|#define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_ALPHA_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_ALPHA_PREC_BITS)
  |  |  ------------------
  |  |  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  |  |  ------------------
  ------------------
                          (gm->wmmat[5] >> GM_ALPHA_PREC_DIFF) - (1 << GM_ALPHA_PREC_BITS));
  ------------------
  |  |  172|      0|#define GM_ALPHA_PREC_BITS 15
  ------------------
   53|      0|      }
   54|    248|      AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|    248|  do {                           \
  |  |   53|    248|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 248]
  |  |  ------------------
  ------------------
   55|    248|    case TRANSLATION:
  ------------------
  |  Branch (55:5): [True: 0, False: 247]
  ------------------
   56|    248|      trans_bits = (gm->wmtype == TRANSLATION)
  ------------------
  |  Branch (56:20): [True: 0, False: 248]
  ------------------
   57|    248|                       ? GM_ABS_TRANS_ONLY_BITS - !allow_hp
  ------------------
  |  |  166|      0|#define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  165|      0|#define GM_ABS_TRANS_BITS 12
  |  |  ------------------
  |  |               #define GM_ABS_TRANS_ONLY_BITS (GM_ABS_TRANS_BITS - GM_TRANS_PREC_BITS + 3)
  |  |  ------------------
  |  |  |  |  164|      0|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
   58|    248|                       : GM_ABS_TRANS_BITS;
  ------------------
  |  |  165|    496|#define GM_ABS_TRANS_BITS 12
  ------------------
   59|    248|      trans_prec_diff = (gm->wmtype == TRANSLATION)
  ------------------
  |  Branch (59:25): [True: 0, False: 248]
  ------------------
   60|    248|                            ? GM_TRANS_ONLY_PREC_DIFF + !allow_hp
  ------------------
  |  |  168|      0|#define GM_TRANS_ONLY_PREC_DIFF (WARPEDMODEL_PREC_BITS - 3)
  |  |  ------------------
  |  |  |  |   96|      0|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  ------------------
   61|    248|                            : GM_TRANS_PREC_DIFF;
  ------------------
  |  |  167|    496|#define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |   96|    248|#define WARPEDMODEL_PREC_BITS 16
  |  |  ------------------
  |  |               #define GM_TRANS_PREC_DIFF (WARPEDMODEL_PREC_BITS - GM_TRANS_PREC_BITS)
  |  |  ------------------
  |  |  |  |  164|    248|#define GM_TRANS_PREC_BITS 6
  |  |  ------------------
  ------------------
   62|    248|      params_cost += aom_count_signed_primitive_refsubexpfin(
   63|    248|          (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|    248|#define SUBEXPFIN_K 3
  ------------------
   64|    248|          (ref_gm->wmmat[0] >> trans_prec_diff),
   65|    248|          (gm->wmmat[0] >> trans_prec_diff));
   66|    248|      params_cost += aom_count_signed_primitive_refsubexpfin(
   67|    248|          (1 << trans_bits) + 1, SUBEXPFIN_K,
  ------------------
  |  |  163|    248|#define SUBEXPFIN_K 3
  ------------------
   68|    248|          (ref_gm->wmmat[1] >> trans_prec_diff),
   69|    248|          (gm->wmmat[1] >> trans_prec_diff));
   70|    248|      AOM_FALLTHROUGH_INTENDED;
  ------------------
  |  |   52|    248|  do {                           \
  |  |   53|    248|  } while (0)
  |  |  ------------------
  |  |  |  Branch (53:12): [Folded, False: 248]
  |  |  ------------------
  ------------------
   71|    248|    case IDENTITY: break;
  ------------------
  |  Branch (71:5): [True: 0, False: 247]
  ------------------
   72|      0|    default: assert(0);
  ------------------
  |  Branch (72:5): [True: 0, False: 247]
  ------------------
   73|    247|  }
   74|    252|  return (params_cost << AV1_PROB_COST_SHIFT);
  ------------------
  |  |   25|    252|#define AV1_PROB_COST_SHIFT 9
  ------------------
   75|    247|}
global_motion_facade.c:setup_global_motion_info_params:
  347|  36.9k|static inline void setup_global_motion_info_params(AV1_COMP *cpi) {
  348|  36.9k|  GlobalMotionInfo *const gm_info = &cpi->gm_info;
  349|  36.9k|  YV12_BUFFER_CONFIG *source = cpi->source;
  350|       |
  351|  36.9k|  gm_info->segment_map_w =
  352|  36.9k|      (source->y_crop_width + WARP_ERROR_BLOCK - 1) >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   34|  36.9k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  36.9k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    (source->y_crop_width + WARP_ERROR_BLOCK - 1) >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  36.9k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  353|  36.9k|  gm_info->segment_map_h =
  354|  36.9k|      (source->y_crop_height + WARP_ERROR_BLOCK - 1) >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   34|  36.9k|#define WARP_ERROR_BLOCK (1 << WARP_ERROR_BLOCK_LOG)
  |  |  ------------------
  |  |  |  |   33|  36.9k|#define WARP_ERROR_BLOCK_LOG 5
  |  |  ------------------
  ------------------
                    (source->y_crop_height + WARP_ERROR_BLOCK - 1) >> WARP_ERROR_BLOCK_LOG;
  ------------------
  |  |   33|  36.9k|#define WARP_ERROR_BLOCK_LOG 5
  ------------------
  355|       |
  356|  36.9k|  memset(gm_info->reference_frames, -1,
  357|  36.9k|         sizeof(gm_info->reference_frames[0][0]) * MAX_DIRECTIONS *
  ------------------
  |  |   26|  36.9k|#define MAX_DIRECTIONS 2
  ------------------
  358|  36.9k|             (REF_FRAMES - 1));
  359|  36.9k|  av1_zero(gm_info->num_ref_frames);
  ------------------
  |  |   43|  36.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  360|       |
  361|       |  // Populate ref_buf for valid ref frames in global motion
  362|  36.9k|  update_valid_ref_frames_for_gm(cpi, gm_info->ref_buf,
  363|  36.9k|                                 gm_info->reference_frames,
  364|  36.9k|                                 gm_info->num_ref_frames);
  365|       |
  366|       |  // Sort the past and future ref frames in the ascending order of their
  367|       |  // distance from the current frame. reference_frames[0] => past direction
  368|       |  // and reference_frames[1] => future direction.
  369|  36.9k|  qsort(gm_info->reference_frames[0], gm_info->num_ref_frames[0],
  370|  36.9k|        sizeof(gm_info->reference_frames[0][0]), compare_distance);
  371|  36.9k|  qsort(gm_info->reference_frames[1], gm_info->num_ref_frames[1],
  372|  36.9k|        sizeof(gm_info->reference_frames[1][0]), compare_distance);
  373|       |
  374|  36.9k|  if (cpi->sf.gm_sf.gm_search_type == GM_SEARCH_CLOSEST_REFS_ONLY) {
  ------------------
  |  Branch (374:7): [True: 36.9k, False: 0]
  ------------------
  375|       |    // Filter down to the nearest two ref frames.
  376|       |    // Prefer one past and one future ref over two past refs, even if
  377|       |    // the second past ref is closer
  378|  36.9k|    if (gm_info->num_ref_frames[1] > 0) {
  ------------------
  |  Branch (378:9): [True: 0, False: 36.9k]
  ------------------
  379|      0|      gm_info->num_ref_frames[0] = AOMMIN(gm_info->num_ref_frames[0], 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  380|      0|      gm_info->num_ref_frames[1] = AOMMIN(gm_info->num_ref_frames[1], 1);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  381|  36.9k|    } else {
  382|  36.9k|      gm_info->num_ref_frames[0] = AOMMIN(gm_info->num_ref_frames[0], 2);
  ------------------
  |  |   34|  36.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 33.2k, False: 3.70k]
  |  |  ------------------
  ------------------
  383|  36.9k|    }
  384|  36.9k|  }
  385|  36.9k|}
global_motion_facade.c:update_valid_ref_frames_for_gm:
  280|  36.9k|    int *num_ref_frames) {
  281|  36.9k|  AV1_COMMON *const cm = &cpi->common;
  282|  36.9k|  int *num_past_ref_frames = &num_ref_frames[0];
  283|  36.9k|  int *num_future_ref_frames = &num_ref_frames[1];
  284|  36.9k|  const GF_GROUP *gf_group = &cpi->ppi->gf_group;
  285|  36.9k|  int ref_pruning_enabled = is_frame_eligible_for_ref_pruning(
  286|  36.9k|      gf_group, cpi->sf.inter_sf.selective_ref_frame, 1, cpi->gf_frame_index);
  287|  36.9k|  int cur_frame_gm_disabled = 0;
  288|  36.9k|  int pyr_lvl = cm->cur_frame->pyramid_level;
  289|       |
  290|  36.9k|  if (cpi->sf.gm_sf.disable_gm_search_based_on_stats) {
  ------------------
  |  Branch (290:7): [True: 36.9k, False: 0]
  ------------------
  291|  36.9k|    cur_frame_gm_disabled = disable_gm_search_based_on_stats(cpi);
  292|  36.9k|  }
  293|       |
  294|   295k|  for (int frame = ALTREF_FRAME; frame >= LAST_FRAME; --frame) {
  ------------------
  |  Branch (294:34): [True: 258k, False: 36.9k]
  ------------------
  295|   258k|    const MV_REFERENCE_FRAME ref_frame[2] = { frame, NONE_FRAME };
  296|   258k|    RefCntBuffer *buf = get_ref_frame_buf(cm, frame);
  297|   258k|    const int ref_disabled =
  298|   258k|        !(cpi->ref_frame_flags & av1_ref_frame_flag_list[frame]);
  299|   258k|    ref_buf[frame] = NULL;
  300|   258k|    cm->global_motion[frame] = default_warp_params;
  301|       |    // Skip global motion estimation for invalid ref frames
  302|   258k|    if (buf == NULL ||
  ------------------
  |  Branch (302:9): [True: 0, False: 258k]
  ------------------
  303|   258k|        (ref_disabled && cpi->sf.hl_sf.recode_loop != DISALLOW_RECODE)) {
  ------------------
  |  Branch (303:10): [True: 221k, False: 36.9k]
  |  Branch (303:26): [True: 0, False: 221k]
  ------------------
  304|      0|      continue;
  305|   258k|    } else {
  306|   258k|      ref_buf[frame] = &buf->buf;
  307|   258k|    }
  308|       |
  309|   258k|    int prune_ref_frames =
  310|   258k|        ref_pruning_enabled &&
  ------------------
  |  Branch (310:9): [True: 258k, False: 0]
  ------------------
  311|   258k|        prune_ref_by_selective_ref_frame(cpi, NULL, ref_frame,
  ------------------
  |  Branch (311:9): [True: 0, False: 258k]
  ------------------
  312|   258k|                                         cm->cur_frame->ref_display_order_hint);
  313|   258k|    int ref_pyr_lvl = buf->pyramid_level;
  314|       |
  315|   258k|    if (ref_buf[frame]->y_crop_width == cpi->source->y_crop_width &&
  ------------------
  |  Branch (315:9): [True: 86.2k, False: 172k]
  ------------------
  316|  86.2k|        ref_buf[frame]->y_crop_height == cpi->source->y_crop_height &&
  ------------------
  |  Branch (316:9): [True: 49.3k, False: 36.8k]
  ------------------
  317|  49.3k|        do_gm_search_logic(&cpi->sf, frame) && !prune_ref_frames &&
  ------------------
  |  Branch (317:9): [True: 49.3k, False: 0]
  |  Branch (317:48): [True: 49.3k, False: 0]
  ------------------
  318|  49.3k|        ref_pyr_lvl <= pyr_lvl && !cur_frame_gm_disabled) {
  ------------------
  |  Branch (318:9): [True: 25.9k, False: 23.4k]
  |  Branch (318:35): [True: 25.9k, False: 0]
  ------------------
  319|  25.9k|      assert(ref_buf[frame] != NULL);
  320|  25.9k|      const int relative_frame_dist = av1_encoder_get_relative_dist(
  321|  25.9k|          buf->display_order_hint, cm->cur_frame->display_order_hint);
  322|       |      // Populate past and future ref frames.
  323|       |      // reference_frames[0][] indicates past direction and
  324|       |      // reference_frames[1][] indicates future direction.
  325|  25.9k|      if (relative_frame_dist == 0) {
  ------------------
  |  Branch (325:11): [True: 0, False: 25.9k]
  ------------------
  326|       |        // Skip global motion estimation for frames at the same nominal instant.
  327|       |        // This will generally be either a "real" frame coded against a
  328|       |        // temporal filtered version, or a higher spatial layer coded against
  329|       |        // a lower spatial layer. In either case, the optimal motion model will
  330|       |        // be IDENTITY, so we don't need to search explicitly.
  331|  25.9k|      } else if (relative_frame_dist < 0) {
  ------------------
  |  Branch (331:18): [True: 25.9k, False: 0]
  ------------------
  332|  25.9k|        reference_frames[0][*num_past_ref_frames].distance =
  333|  25.9k|            abs(relative_frame_dist);
  334|  25.9k|        reference_frames[0][*num_past_ref_frames].frame = frame;
  335|  25.9k|        (*num_past_ref_frames)++;
  336|  25.9k|      } else {
  337|      0|        reference_frames[1][*num_future_ref_frames].distance =
  338|      0|            abs(relative_frame_dist);
  339|      0|        reference_frames[1][*num_future_ref_frames].frame = frame;
  340|      0|        (*num_future_ref_frames)++;
  341|      0|      }
  342|  25.9k|    }
  343|   258k|  }
  344|  36.9k|}
global_motion_facade.c:disable_gm_search_based_on_stats:
  236|  36.9k|static int disable_gm_search_based_on_stats(const AV1_COMP *const cpi) {
  237|  36.9k|  int is_gm_present = 1;
  238|       |
  239|       |  // Check number of GM models only in GF groups with ARF frames. GM param
  240|       |  // estimation is always done in the case of GF groups with no ARF frames (flat
  241|       |  // gops)
  242|  36.9k|  if (cpi->ppi->gf_group.arf_index > -1) {
  ------------------
  |  Branch (242:7): [True: 0, False: 36.9k]
  ------------------
  243|       |    // valid_gm_model_found is initialized to INT32_MAX in the beginning of
  244|       |    // every GF group.
  245|       |    // Therefore, GM param estimation is always done for all frames until
  246|       |    // at least 1 frame each of ARF_UPDATE, INTNL_ARF_UPDATE and LF_UPDATE are
  247|       |    // encoded in a GF group For subsequent frames, GM param estimation is
  248|       |    // disabled, if no valid models have been found in all the three update
  249|       |    // types.
  250|      0|    is_gm_present = (cpi->ppi->valid_gm_model_found[ARF_UPDATE] != 0) ||
  ------------------
  |  Branch (250:21): [True: 0, False: 0]
  ------------------
  251|      0|                    (cpi->ppi->valid_gm_model_found[INTNL_ARF_UPDATE] != 0) ||
  ------------------
  |  Branch (251:21): [True: 0, False: 0]
  ------------------
  252|      0|                    (cpi->ppi->valid_gm_model_found[LF_UPDATE] != 0);
  ------------------
  |  Branch (252:21): [True: 0, False: 0]
  ------------------
  253|      0|  }
  254|  36.9k|  return !is_gm_present;
  255|  36.9k|}
global_motion_facade.c:do_gm_search_logic:
  259|  49.3k|static int do_gm_search_logic(SPEED_FEATURES *const sf, int frame) {
  260|  49.3k|  (void)frame;
  261|  49.3k|  switch (sf->gm_sf.gm_search_type) {
  262|      0|    case GM_FULL_SEARCH: return 1;
  ------------------
  |  Branch (262:5): [True: 0, False: 49.3k]
  ------------------
  263|      0|    case GM_REDUCED_REF_SEARCH_SKIP_L2_L3:
  ------------------
  |  Branch (263:5): [True: 0, False: 49.3k]
  ------------------
  264|      0|      return !(frame == LAST2_FRAME || frame == LAST3_FRAME);
  ------------------
  |  Branch (264:16): [True: 0, False: 0]
  |  Branch (264:40): [True: 0, False: 0]
  ------------------
  265|      0|    case GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2:
  ------------------
  |  Branch (265:5): [True: 0, False: 49.3k]
  ------------------
  266|      0|      return !(frame == LAST2_FRAME || frame == LAST3_FRAME ||
  ------------------
  |  Branch (266:16): [True: 0, False: 0]
  |  Branch (266:40): [True: 0, False: 0]
  ------------------
  267|      0|               (frame == ALTREF2_FRAME));
  ------------------
  |  Branch (267:16): [True: 0, False: 0]
  ------------------
  268|  49.3k|    case GM_SEARCH_CLOSEST_REFS_ONLY: return 1;
  ------------------
  |  Branch (268:5): [True: 49.3k, False: 0]
  ------------------
  269|      0|    case GM_DISABLE_SEARCH: return 0;
  ------------------
  |  Branch (269:5): [True: 0, False: 49.3k]
  ------------------
  270|      0|    default: assert(0);
  ------------------
  |  Branch (270:5): [True: 0, False: 49.3k]
  ------------------
  271|  49.3k|  }
  272|      0|  return 1;
  273|  49.3k|}
global_motion_facade.c:compare_distance:
  226|  33.3k|static int compare_distance(const void *a, const void *b) {
  227|  33.3k|  const int diff =
  228|  33.3k|      ((FrameDistPair *)a)->distance - ((FrameDistPair *)b)->distance;
  229|  33.3k|  if (diff > 0)
  ------------------
  |  Branch (229:7): [True: 0, False: 33.3k]
  ------------------
  230|      0|    return 1;
  231|  33.3k|  else if (diff < 0)
  ------------------
  |  Branch (231:12): [True: 0, False: 33.3k]
  ------------------
  232|      0|    return -1;
  233|  33.3k|  return 0;
  234|  33.3k|}
global_motion_facade.c:global_motion_estimation:
  388|    812|static inline void global_motion_estimation(AV1_COMP *cpi) {
  389|    812|  GlobalMotionInfo *const gm_info = &cpi->gm_info;
  390|    812|  GlobalMotionData *gm_data = &cpi->td.gm_data;
  391|       |
  392|       |  // Compute global motion w.r.t. past reference frames and future reference
  393|       |  // frames
  394|  2.43k|  for (int dir = 0; dir < MAX_DIRECTIONS; dir++) {
  ------------------
  |  |   26|  2.43k|#define MAX_DIRECTIONS 2
  ------------------
  |  Branch (394:21): [True: 1.62k, False: 812]
  ------------------
  395|  1.62k|    if (gm_info->num_ref_frames[dir] > 0)
  ------------------
  |  Branch (395:9): [True: 812, False: 812]
  ------------------
  396|    812|      compute_global_motion_for_references(
  397|    812|          cpi, gm_info->ref_buf, gm_info->reference_frames[dir],
  398|    812|          gm_info->num_ref_frames[dir], gm_data->motion_models,
  399|    812|          gm_data->segment_map, gm_info->segment_map_w, gm_info->segment_map_h);
  400|  1.62k|  }
  401|    812|}
global_motion_facade.c:compute_global_motion_for_references:
  204|    812|    const int segment_map_h) {
  205|    812|  AV1_COMMON *const cm = &cpi->common;
  206|    812|  struct aom_internal_error_info *const error_info =
  207|    812|      cpi->td.mb.e_mbd.error_info;
  208|       |  // Compute global motion w.r.t. reference frames starting from the nearest ref
  209|       |  // frame in a given direction.
  210|    812|  for (int frame = 0; frame < num_ref_frames; frame++) {
  ------------------
  |  Branch (210:23): [True: 812, False: 0]
  ------------------
  211|    812|    int ref_frame = reference_frame[frame].frame;
  212|    812|    av1_compute_gm_for_valid_ref_frames(cpi, error_info, ref_buf, ref_frame,
  213|    812|                                        motion_models, segment_map,
  214|    812|                                        segment_map_w, segment_map_h);
  215|       |    // If global motion w.r.t. current ref frame is
  216|       |    // INVALID/TRANSLATION/IDENTITY, skip the evaluation of global motion w.r.t
  217|       |    // the remaining ref frames in that direction.
  218|    812|    if (cpi->sf.gm_sf.prune_ref_frame_for_gm_search &&
  ------------------
  |  Branch (218:9): [True: 812, False: 0]
  ------------------
  219|    812|        cm->global_motion[ref_frame].wmtype <= TRANSLATION)
  ------------------
  |  Branch (219:9): [True: 812, False: 0]
  ------------------
  220|    812|      break;
  221|    812|  }
  222|    812|}

encoder.c:gm_dealloc_data:
   39|   105k|static inline void gm_dealloc_data(GlobalMotionData *gm_data) {
   40|   105k|  aom_free(gm_data->segment_map);
   41|   105k|  gm_data->segment_map = NULL;
   42|   210k|  for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) {
  ------------------
  |  |   24|   210k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (42:19): [True: 105k, False: 105k]
  ------------------
   43|   105k|    aom_free(gm_data->motion_models[m].inliers);
   44|       |    gm_data->motion_models[m].inliers = NULL;
   45|   105k|  }
   46|   105k|}
ethread.c:gm_alloc_data:
   22|  2.88k|static inline void gm_alloc_data(AV1_COMP *cpi, GlobalMotionData *gm_data) {
   23|  2.88k|  AV1_COMMON *cm = &cpi->common;
   24|  2.88k|  GlobalMotionInfo *gm_info = &cpi->gm_info;
   25|       |
   26|  2.88k|  CHECK_MEM_ERROR(cm, gm_data->segment_map,
  ------------------
  |  |   51|  2.88k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  2.88k|  do {                                                    \
  |  |  |  |   72|  2.88k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  2.88k|    lval = (expr);                                        \
  |  |  |  |   74|  2.88k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 2.88k]
  |  |  |  |  ------------------
  |  |  |  |   75|  2.88k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  2.88k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 2.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   27|  2.88k|                  aom_malloc(sizeof(*gm_data->segment_map) *
   28|  2.88k|                             gm_info->segment_map_w * gm_info->segment_map_h));
   29|       |
   30|  2.88k|  av1_zero_array(gm_data->motion_models, RANSAC_NUM_MOTIONS);
  ------------------
  |  |   44|  2.88k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
   31|  5.77k|  for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) {
  ------------------
  |  |   24|  5.77k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (31:19): [True: 2.88k, False: 2.88k]
  ------------------
   32|       |    CHECK_MEM_ERROR(cm, gm_data->motion_models[m].inliers,
  ------------------
  |  |   51|  2.88k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  2.88k|  do {                                                    \
  |  |  |  |   72|  2.88k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  2.88k|    lval = (expr);                                        \
  |  |  |  |   74|  2.88k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 2.88k]
  |  |  |  |  ------------------
  |  |  |  |   75|  2.88k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  2.88k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 2.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|  2.88k|                    aom_malloc(sizeof(*gm_data->motion_models[m].inliers) * 2 *
   34|  2.88k|                               MAX_CORNERS));
   35|  2.88k|  }
   36|  2.88k|}
ethread.c:gm_dealloc_data:
   39|  2.88k|static inline void gm_dealloc_data(GlobalMotionData *gm_data) {
   40|  2.88k|  aom_free(gm_data->segment_map);
   41|  2.88k|  gm_data->segment_map = NULL;
   42|  5.77k|  for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) {
  ------------------
  |  |   24|  5.77k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (42:19): [True: 2.88k, False: 2.88k]
  ------------------
   43|  2.88k|    aom_free(gm_data->motion_models[m].inliers);
   44|       |    gm_data->motion_models[m].inliers = NULL;
   45|  2.88k|  }
   46|  2.88k|}
global_motion_facade.c:gm_alloc_data:
   22|  3.70k|static inline void gm_alloc_data(AV1_COMP *cpi, GlobalMotionData *gm_data) {
   23|  3.70k|  AV1_COMMON *cm = &cpi->common;
   24|  3.70k|  GlobalMotionInfo *gm_info = &cpi->gm_info;
   25|       |
   26|  3.70k|  CHECK_MEM_ERROR(cm, gm_data->segment_map,
  ------------------
  |  |   51|  3.70k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  3.70k|  do {                                                    \
  |  |  |  |   72|  3.70k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  3.70k|    lval = (expr);                                        \
  |  |  |  |   74|  3.70k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 3.70k]
  |  |  |  |  ------------------
  |  |  |  |   75|  3.70k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  3.70k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 3.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   27|  3.70k|                  aom_malloc(sizeof(*gm_data->segment_map) *
   28|  3.70k|                             gm_info->segment_map_w * gm_info->segment_map_h));
   29|       |
   30|  3.70k|  av1_zero_array(gm_data->motion_models, RANSAC_NUM_MOTIONS);
  ------------------
  |  |   44|  3.70k|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
   31|  7.40k|  for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) {
  ------------------
  |  |   24|  7.40k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (31:19): [True: 3.70k, False: 3.70k]
  ------------------
   32|       |    CHECK_MEM_ERROR(cm, gm_data->motion_models[m].inliers,
  ------------------
  |  |   51|  3.70k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  3.70k|  do {                                                    \
  |  |  |  |   72|  3.70k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  3.70k|    lval = (expr);                                        \
  |  |  |  |   74|  3.70k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 3.70k]
  |  |  |  |  ------------------
  |  |  |  |   75|  3.70k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  3.70k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 3.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|  3.70k|                    aom_malloc(sizeof(*gm_data->motion_models[m].inliers) * 2 *
   34|  3.70k|                               MAX_CORNERS));
   35|  3.70k|  }
   36|  3.70k|}
global_motion_facade.c:gm_dealloc_data:
   39|  3.70k|static inline void gm_dealloc_data(GlobalMotionData *gm_data) {
   40|  3.70k|  aom_free(gm_data->segment_map);
   41|  3.70k|  gm_data->segment_map = NULL;
   42|  7.40k|  for (int m = 0; m < RANSAC_NUM_MOTIONS; m++) {
  ------------------
  |  |   24|  7.40k|#define RANSAC_NUM_MOTIONS 1
  ------------------
  |  Branch (42:19): [True: 3.70k, False: 3.70k]
  ------------------
   43|  3.70k|    aom_free(gm_data->motion_models[m].inliers);
   44|       |    gm_data->motion_models[m].inliers = NULL;
   45|  3.70k|  }
   46|  3.70k|}

av1_gop_setup_structure:
  896|  24.6k|void av1_gop_setup_structure(AV1_COMP *cpi, const int is_final_pass) {
  897|  24.6k|  RATE_CONTROL *const rc = &cpi->rc;
  898|  24.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  899|  24.6k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  900|  24.6k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
  901|  24.6k|  FRAME_INFO *const frame_info = &cpi->frame_info;
  902|  24.6k|  const int key_frame = rc->frames_since_key == 0;
  903|  24.6k|  FRAME_UPDATE_TYPE first_frame_update_type = ARF_UPDATE;
  904|       |
  905|       |  // define_gf_group() is called twice in av1_set_second_pass_params() with
  906|       |  // `is_final_pass` being 0 and 1 separately. But only one GOP can be advanced
  907|       |  // with the external RC. That is only done when `is_final_pass` is true.
  908|  24.6k|  if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (908:7): [True: 0, False: 24.6k]
  ------------------
  909|      0|      (cpi->ext_ratectrl.funcs.rc_type & AOM_RC_GOP) != 0 &&
  ------------------
  |  Branch (909:7): [True: 0, False: 0]
  ------------------
  910|      0|      cpi->ext_ratectrl.funcs.get_gop_decision != NULL && is_final_pass) {
  ------------------
  |  Branch (910:7): [True: 0, False: 0]
  |  Branch (910:59): [True: 0, False: 0]
  ------------------
  911|      0|    aom_rc_gop_decision_t gop_decision;
  912|      0|    aom_codec_err_t codec_status =
  913|      0|        av1_extrc_get_gop_decision(&cpi->ext_ratectrl, &gop_decision);
  914|      0|    if (codec_status != AOM_CODEC_OK) {
  ------------------
  |  Branch (914:9): [True: 0, False: 0]
  ------------------
  915|      0|      aom_internal_error(cpi->common.error, codec_status,
  916|      0|                         "av1_extrc_get_gop_decision() failed");
  917|      0|    }
  918|      0|    construct_gop_structure_from_rc(gf_group, &gop_decision);
  919|      0|    if (gop_decision.gop_frame_list[0].is_key_frame) {
  ------------------
  |  Branch (919:9): [True: 0, False: 0]
  ------------------
  920|      0|      rc->frames_since_key = 0;
  921|      0|    }
  922|  24.6k|  } else {
  923|  24.6k|    if (key_frame) {
  ------------------
  |  Branch (923:9): [True: 24.6k, False: 0]
  ------------------
  924|  24.6k|      first_frame_update_type = KF_UPDATE;
  925|  24.6k|      if (cpi->oxcf.kf_max_pyr_height != -1) {
  ------------------
  |  Branch (925:11): [True: 0, False: 24.6k]
  ------------------
  926|      0|        gf_group->max_layer_depth_allowed = AOMMIN(
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  927|      0|            cpi->oxcf.kf_max_pyr_height, gf_group->max_layer_depth_allowed);
  928|      0|      }
  929|  24.6k|    } else if (!cpi->ppi->gf_state.arf_gf_boost_lst) {
  ------------------
  |  Branch (929:16): [True: 0, False: 0]
  ------------------
  930|      0|      first_frame_update_type = GF_UPDATE;
  931|      0|    }
  932|       |
  933|  24.6k|    if (cpi->oxcf.algo_cfg.sharpness == 3)
  ------------------
  |  Branch (933:9): [True: 0, False: 24.6k]
  ------------------
  934|      0|      gf_group->max_layer_depth_allowed =
  935|      0|          AOMMIN(gf_group->max_layer_depth_allowed, 2);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  936|       |
  937|  24.6k|    gf_group->size = construct_multi_layer_gf_structure(
  938|  24.6k|        cpi, twopass, gf_group, rc, frame_info, p_rc->baseline_gf_interval,
  939|  24.6k|        first_frame_update_type);
  940|       |
  941|  24.6k|    if (gf_group->max_layer_depth_allowed == 0)
  ------------------
  |  Branch (941:9): [True: 24.6k, False: 0]
  ------------------
  942|  24.6k|      set_ld_layer_depth(gf_group, p_rc->baseline_gf_interval);
  943|  24.6k|  }
  944|  24.6k|}
av1_gop_is_second_arf:
  952|  49.2k|int av1_gop_is_second_arf(const GF_GROUP *gf_group, int gf_frame_index) {
  953|  49.2k|  const int arf_src_offset = gf_group->arf_src_offset[gf_frame_index];
  954|       |  // TODO(angiebird): when gf_group->size == 32, it's possble to
  955|       |  // have "two" second arf. Check if this is acceptable.
  956|  49.2k|  if (gf_group->update_type[gf_frame_index] == INTNL_ARF_UPDATE &&
  ------------------
  |  Branch (956:7): [True: 0, False: 49.2k]
  ------------------
  957|      0|      arf_src_offset >= TF_LOOKAHEAD_IDX_THR) {
  ------------------
  |  |   93|      0|#define TF_LOOKAHEAD_IDX_THR 7
  ------------------
  |  Branch (957:7): [True: 0, False: 0]
  ------------------
  958|      0|    return 1;
  959|      0|  }
  960|  49.2k|  return 0;
  961|  49.2k|}
gop_structure.c:construct_multi_layer_gf_structure:
  543|  24.6k|    FRAME_UPDATE_TYPE first_frame_update_type) {
  544|  24.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  545|       |  // TODO(angiebird): Why do we need "-1" here?
  546|  24.6k|  const int gf_interval = baseline_gf_interval - 1;
  547|  24.6k|  int frame_index = 0;
  548|  24.6k|  int cur_frame_index = 0;
  549|       |
  550|       |  // Set the display order hint for the first frame in the GF_GROUP.
  551|  24.6k|  int cur_disp_index = (first_frame_update_type == KF_UPDATE)
  ------------------
  |  Branch (551:24): [True: 24.6k, False: 0]
  ------------------
  552|  24.6k|                           ? 0
  553|  24.6k|                           : cpi->common.current_frame.frame_number;
  554|       |
  555|       |  // Initialize gf_group->frame_parallel_level, gf_group->is_frame_non_ref,
  556|       |  // gf_group->src_offset and gf_group->is_frame_dropped with 0.
  557|  24.6k|  memset(gf_group->frame_parallel_level, 0,
  558|  24.6k|         sizeof(gf_group->frame_parallel_level));
  559|  24.6k|  memset(gf_group->is_frame_non_ref, 0, sizeof(gf_group->is_frame_non_ref));
  560|  24.6k|  memset(gf_group->src_offset, 0, sizeof(gf_group->src_offset));
  561|  24.6k|  memset(gf_group->is_frame_dropped, 0, sizeof(gf_group->is_frame_dropped));
  562|       |  // Initialize gf_group->skip_frame_refresh and gf_group->skip_frame_as_ref
  563|       |  // with INVALID_IDX.
  564|  24.6k|  memset(gf_group->skip_frame_refresh, INVALID_IDX,
  ------------------
  |  |   15|  24.6k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  565|  24.6k|         sizeof(gf_group->skip_frame_refresh));
  566|  24.6k|  memset(gf_group->skip_frame_as_ref, INVALID_IDX,
  ------------------
  |  |   15|  24.6k|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  567|  24.6k|         sizeof(gf_group->skip_frame_as_ref));
  568|       |
  569|  24.6k|  int kf_decomp = cpi->oxcf.kf_cfg.enable_keyframe_filtering > 1;
  570|       |  // This is a patch that fixes https://crbug.com/aomedia/3163
  571|       |  // enable_keyframe_filtering > 1 will introduce an extra overlay frame at
  572|       |  // key frame location. However when
  573|       |  // baseline_gf_interval == MAX_STATIC_GF_GROUP_LENGTH, we can't
  574|       |  // afford to have an extra overlay frame. Otherwise, the gf_group->size will
  575|       |  // become MAX_STATIC_GF_GROUP_LENGTH + 1, which causes memory error.
  576|       |  // A cheap solution is to turn of kf_decomp here.
  577|       |  // TODO(angiebird): Find a systematic way to solve this issue.
  578|  24.6k|  if (baseline_gf_interval == MAX_STATIC_GF_GROUP_LENGTH) {
  ------------------
  |  |   42|  24.6k|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
  |  Branch (578:7): [True: 0, False: 24.6k]
  ------------------
  579|      0|    kf_decomp = 0;
  580|      0|  }
  581|  24.6k|  if (first_frame_update_type == KF_UPDATE) {
  ------------------
  |  Branch (581:7): [True: 24.6k, False: 0]
  ------------------
  582|  24.6k|    gf_group->update_type[frame_index] = kf_decomp ? ARF_UPDATE : KF_UPDATE;
  ------------------
  |  Branch (582:42): [True: 0, False: 24.6k]
  ------------------
  583|  24.6k|    gf_group->arf_src_offset[frame_index] = 0;
  584|  24.6k|    gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  585|  24.6k|    gf_group->layer_depth[frame_index] = 0;
  586|  24.6k|    gf_group->frame_type[frame_index] = KEY_FRAME;
  587|  24.6k|    gf_group->refbuf_state[frame_index] = REFBUF_RESET;
  588|  24.6k|    gf_group->max_layer_depth = 0;
  589|  24.6k|    gf_group->display_idx[frame_index] = cur_disp_index;
  590|  24.6k|    if (!kf_decomp) cur_disp_index++;
  ------------------
  |  Branch (590:9): [True: 24.6k, False: 0]
  ------------------
  591|  24.6k|    ++frame_index;
  592|       |
  593|  24.6k|    if (kf_decomp) {
  ------------------
  |  Branch (593:9): [True: 0, False: 24.6k]
  ------------------
  594|      0|      gf_group->update_type[frame_index] = OVERLAY_UPDATE;
  595|      0|      gf_group->arf_src_offset[frame_index] = 0;
  596|      0|      gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  597|      0|      gf_group->layer_depth[frame_index] = 0;
  598|      0|      gf_group->frame_type[frame_index] = INTER_FRAME;
  599|      0|      gf_group->refbuf_state[frame_index] = REFBUF_UPDATE;
  600|      0|      gf_group->max_layer_depth = 0;
  601|      0|      gf_group->display_idx[frame_index] = cur_disp_index;
  602|      0|      cur_disp_index++;
  603|      0|      ++frame_index;
  604|      0|    }
  605|  24.6k|    cur_frame_index++;
  606|  24.6k|  }
  607|       |
  608|  24.6k|  if (first_frame_update_type == GF_UPDATE) {
  ------------------
  |  Branch (608:7): [True: 0, False: 24.6k]
  ------------------
  609|      0|    gf_group->update_type[frame_index] = GF_UPDATE;
  610|      0|    gf_group->arf_src_offset[frame_index] = 0;
  611|      0|    gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  612|      0|    gf_group->layer_depth[frame_index] = 0;
  613|      0|    gf_group->frame_type[frame_index] = INTER_FRAME;
  614|      0|    gf_group->refbuf_state[frame_index] = REFBUF_UPDATE;
  615|      0|    gf_group->max_layer_depth = 0;
  616|      0|    gf_group->display_idx[frame_index] = cur_disp_index;
  617|      0|    cur_disp_index++;
  618|      0|    ++frame_index;
  619|      0|    ++cur_frame_index;
  620|      0|  }
  621|       |
  622|       |  // ALTREF.
  623|  24.6k|  const int use_altref = gf_group->max_layer_depth_allowed > 0;
  624|  24.6k|  int is_fwd_kf = rc->frames_to_fwd_kf == gf_interval;
  625|       |
  626|  24.6k|  const int sframe_dist = cpi->oxcf.kf_cfg.sframe_dist;
  627|  24.6k|  const int sframe_mode = cpi->oxcf.kf_cfg.sframe_mode;
  628|  24.6k|  const int sframe_enabled = (sframe_mode > 0) && (sframe_dist > 0);
  ------------------
  |  Branch (628:30): [True: 24.6k, False: 0]
  |  Branch (628:51): [True: 0, False: 24.6k]
  ------------------
  629|       |
  630|  24.6k|  if (sframe_enabled) {
  ------------------
  |  Branch (630:7): [True: 0, False: 24.6k]
  ------------------
  631|      0|    switch (sframe_mode) {
  ------------------
  |  Branch (631:13): [True: 0, False: 0]
  ------------------
  632|      0|      case 1: gf_group->is_sframe_due = use_altref; break;
  ------------------
  |  Branch (632:7): [True: 0, False: 0]
  ------------------
  633|      0|      case 2:
  ------------------
  |  Branch (633:7): [True: 0, False: 0]
  ------------------
  634|      0|        gf_group->is_sframe_due |=
  635|      0|            (frame_index && !(frame_index % sframe_dist));
  ------------------
  |  Branch (635:14): [True: 0, False: 0]
  |  Branch (635:29): [True: 0, False: 0]
  ------------------
  636|      0|        break;
  637|      0|    }
  638|      0|  }
  639|       |
  640|  24.6k|  if (use_altref) {
  ------------------
  |  Branch (640:7): [True: 0, False: 24.6k]
  ------------------
  641|      0|    gf_group->update_type[frame_index] = ARF_UPDATE;
  642|      0|    gf_group->arf_src_offset[frame_index] = gf_interval - cur_frame_index;
  643|      0|    gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  644|      0|    gf_group->layer_depth[frame_index] = 1;
  645|      0|    gf_group->arf_boost[frame_index] = cpi->ppi->p_rc.gfu_boost;
  646|      0|    gf_group->frame_type[frame_index] = is_fwd_kf                 ? KEY_FRAME
  ------------------
  |  Branch (646:41): [True: 0, False: 0]
  ------------------
  647|      0|                                        : gf_group->is_sframe_due ? S_FRAME
  ------------------
  |  Branch (647:43): [True: 0, False: 0]
  ------------------
  648|      0|                                                                  : INTER_FRAME;
  649|      0|    gf_group->is_sframe_due =
  650|      0|        sframe_enabled && gf_group->frame_type[frame_index] != S_FRAME;
  ------------------
  |  Branch (650:9): [True: 0, False: 0]
  |  Branch (650:27): [True: 0, False: 0]
  ------------------
  651|      0|    gf_group->refbuf_state[frame_index] = REFBUF_UPDATE;
  652|      0|    gf_group->max_layer_depth = 1;
  653|      0|    gf_group->arf_index = frame_index;
  654|      0|    gf_group->display_idx[frame_index] =
  655|      0|        cur_disp_index + gf_group->arf_src_offset[frame_index];
  656|      0|    ++frame_index;
  657|  24.6k|  } else {
  658|  24.6k|    gf_group->arf_index = -1;
  659|  24.6k|  }
  660|       |
  661|       |  // Flag to indicate if multi-layer configuration is complete.
  662|  24.6k|  int is_multi_layer_configured = 0;
  663|       |
  664|       |  // Running count of no. of frames that is part of a given parallel
  665|       |  // encode set in a gf_group. Value of 1 indicates no parallel encode.
  666|  24.6k|  int parallel_frame_count = 1;
  667|       |  // Enable parallel encode of frames if gf_group has a multi-layer pyramid
  668|       |  // structure with minimum 4 layers.
  669|  24.6k|  int do_frame_parallel_encode = (cpi->ppi->num_fp_contexts > 1 && use_altref &&
  ------------------
  |  Branch (669:35): [True: 0, False: 24.6k]
  |  Branch (669:68): [True: 0, False: 0]
  ------------------
  670|      0|                                  gf_group->max_layer_depth_allowed >= 4);
  ------------------
  |  Branch (670:35): [True: 0, False: 0]
  ------------------
  671|       |
  672|  24.6k|  int first_frame_index = cur_frame_index;
  673|  24.6k|  const bool scale_max_boost = (cpi->oxcf.mode != REALTIME);
  674|       |
  675|  24.6k|  if (do_frame_parallel_encode) {
  ------------------
  |  Branch (675:7): [True: 0, False: 24.6k]
  ------------------
  676|       |    // construct_multi_layer_gf_structure() takes the input parameter
  677|       |    // 'gf_interval' as p_rc->baseline_gf_interval - 1 . Below code computes the
  678|       |    // actual GF_GROUP length by compensating for this offset.
  679|      0|    int actual_gf_length = ((first_frame_update_type == KF_UPDATE) ||
  ------------------
  |  Branch (679:29): [True: 0, False: 0]
  ------------------
  680|      0|                            (first_frame_update_type == GF_UPDATE))
  ------------------
  |  Branch (680:29): [True: 0, False: 0]
  ------------------
  681|      0|                               ? gf_interval
  682|      0|                               : gf_interval + 1;
  683|       |
  684|       |    // In order to facilitate parallel encoding of frames in lower layer depths,
  685|       |    // encode reordering is done. Currently encode reordering is enabled only
  686|       |    // for gf-intervals 16 and 32. NOTE: Since the buffer holding the
  687|       |    // reference frames is of size 8 (ref_frame_map[REF_FRAMES]), there is a
  688|       |    // limitation on the number of hidden frames possible at any given point and
  689|       |    // hence the reordering is enabled only for gf-intervals 16 and 32.
  690|       |    // Disabling encode reordering for gf-interval 14 since some cross-frame
  691|       |    // dependencies related to temporal filtering for FPMT is currently not
  692|       |    // handled.
  693|      0|    int disable_gf14_reorder = 1;
  694|      0|    if (actual_gf_length == 14 && !disable_gf14_reorder) {
  ------------------
  |  Branch (694:9): [True: 0, False: 0]
  |  Branch (694:35): [True: 0, False: 0]
  ------------------
  695|       |      // This array holds the gf index of INTNL_ARF_UPDATE frames in the slot
  696|       |      // corresponding to their display order hint. This is used while
  697|       |      // configuring the LF_UPDATE frames and INTNL_OVERLAY_UPDATE frames.
  698|      0|      int doh_gf_index_map[FIXED_GF_INTERVAL];
  699|       |      // Initialize doh_gf_index_map with INVALID_IDX.
  700|      0|      memset(&doh_gf_index_map[0], INVALID_IDX,
  ------------------
  |  |   15|      0|#define INVALID_IDX -1  // Invalid buffer index.
  ------------------
  701|      0|             (sizeof(doh_gf_index_map[0]) * FIXED_GF_INTERVAL));
  ------------------
  |  |   46|      0|#define FIXED_GF_INTERVAL 16
  ------------------
  702|       |
  703|      0|      FRAME_REORDER_INFO arf_frame_stats[REF_FRAMES - 1];
  704|       |      // Store the stats corresponding to layer 1 frame.
  705|      0|      fill_arf_frame_stats(arf_frame_stats, 0, actual_gf_length, 1,
  706|      0|                           actual_gf_length);
  707|      0|      int count_arf_frames = 1;
  708|       |
  709|       |      // Sets multi-layer params for gf-interval 14 to consecutively encode
  710|       |      // frames in the same layer depth, i.e., encode order would be 0-> 14->
  711|       |      // 7-> 3-> 10-> 5-> 12-> 1-> 2-> 4-> 6-> 8-> 9-> 11-> 13.
  712|       |      // TODO(Remya): Set GF_GROUP param 'arf_boost' for all frames.
  713|      0|      set_multi_layer_params_for_gf14(
  714|      0|          twopass, &cpi->twopass_frame, p_rc, frame_info, gf_group,
  715|      0|          arf_frame_stats, &cur_frame_index, &frame_index, &count_arf_frames,
  716|      0|          doh_gf_index_map, &parallel_frame_count, &first_frame_index,
  717|      0|          &cur_disp_index, actual_gf_length, use_altref + 1,
  718|      0|          cpi->ppi->num_fp_contexts, scale_max_boost);
  719|       |
  720|       |      // Set gf_group->skip_frame_refresh.
  721|      0|      for (int i = 0; i < actual_gf_length; i++) {
  ------------------
  |  Branch (721:23): [True: 0, False: 0]
  ------------------
  722|      0|        int count = 0;
  723|      0|        if (gf_group->update_type[i] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (723:13): [True: 0, False: 0]
  ------------------
  724|      0|          for (int j = 0; j < i; j++) {
  ------------------
  |  Branch (724:27): [True: 0, False: 0]
  ------------------
  725|       |            // Store the display order hint of the frames which would not
  726|       |            // have been displayed at the encode call of frame 'i'.
  727|      0|            if ((gf_group->display_idx[j] < gf_group->display_idx[i]) &&
  ------------------
  |  Branch (727:17): [True: 0, False: 0]
  ------------------
  728|      0|                gf_group->update_type[j] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (728:17): [True: 0, False: 0]
  ------------------
  729|      0|              gf_group->skip_frame_refresh[i][count++] =
  730|      0|                  gf_group->display_idx[j];
  731|      0|            }
  732|      0|          }
  733|      0|        }
  734|      0|      }
  735|      0|    } else {
  736|       |      // Set layer depth threshold for reordering as per the gf length.
  737|      0|      int depth_thr = (actual_gf_length == 16)   ? 3
  ------------------
  |  Branch (737:23): [True: 0, False: 0]
  ------------------
  738|      0|                      : (actual_gf_length == 32) ? 4
  ------------------
  |  Branch (738:25): [True: 0, False: 0]
  ------------------
  739|      0|                                                 : INT_MAX;
  740|       |
  741|      0|      set_multi_layer_params_for_fp(
  742|      0|          twopass, &cpi->twopass_frame, gf_group, p_rc, rc, frame_info,
  743|      0|          cur_frame_index, gf_interval, &cur_frame_index, &frame_index,
  744|      0|          &parallel_frame_count, cpi->ppi->num_fp_contexts,
  745|      0|          do_frame_parallel_encode, &first_frame_index, depth_thr,
  746|      0|          &cur_disp_index, use_altref + 1, scale_max_boost);
  747|      0|    }
  748|      0|    is_multi_layer_configured = 1;
  749|      0|  }
  750|       |
  751|       |  // Rest of the frames.
  752|  24.6k|  if (!is_multi_layer_configured)
  ------------------
  |  Branch (752:7): [True: 24.6k, False: 0]
  ------------------
  753|  24.6k|    set_multi_layer_params(twopass, &cpi->twopass_frame, gf_group, p_rc, rc,
  754|  24.6k|                           frame_info, cur_frame_index, gf_interval,
  755|  24.6k|                           &cur_frame_index, &frame_index,
  756|  24.6k|                           &parallel_frame_count, cpi->ppi->num_fp_contexts,
  757|  24.6k|                           do_frame_parallel_encode, &first_frame_index,
  758|  24.6k|                           &cur_disp_index, use_altref + 1, scale_max_boost);
  759|       |
  760|  24.6k|  if (use_altref) {
  ------------------
  |  Branch (760:7): [True: 0, False: 24.6k]
  ------------------
  761|      0|    gf_group->update_type[frame_index] = OVERLAY_UPDATE;
  762|      0|    gf_group->arf_src_offset[frame_index] = 0;
  763|      0|    gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  764|      0|    gf_group->layer_depth[frame_index] = MAX_ARF_LAYERS;
  ------------------
  |  |   54|      0|#define MAX_ARF_LAYERS 6
  ------------------
  765|      0|    gf_group->arf_boost[frame_index] = NORMAL_BOOST;
  ------------------
  |  |   26|      0|#define NORMAL_BOOST 100
  ------------------
  766|      0|    gf_group->frame_type[frame_index] = INTER_FRAME;
  767|      0|    gf_group->refbuf_state[frame_index] =
  768|      0|        is_fwd_kf ? REFBUF_RESET : REFBUF_UPDATE;
  ------------------
  |  Branch (768:9): [True: 0, False: 0]
  ------------------
  769|      0|    gf_group->display_idx[frame_index] = cur_disp_index;
  770|      0|    ++frame_index;
  771|  24.6k|  } else {
  772|  49.2k|    for (; cur_frame_index <= gf_interval; ++cur_frame_index) {
  ------------------
  |  Branch (772:12): [True: 24.6k, False: 24.6k]
  ------------------
  773|  24.6k|      gf_group->update_type[frame_index] = LF_UPDATE;
  774|  24.6k|      gf_group->arf_src_offset[frame_index] = 0;
  775|  24.6k|      gf_group->cur_frame_idx[frame_index] = cur_frame_index;
  776|  24.6k|      gf_group->layer_depth[frame_index] = MAX_ARF_LAYERS;
  ------------------
  |  |   54|  24.6k|#define MAX_ARF_LAYERS 6
  ------------------
  777|  24.6k|      gf_group->arf_boost[frame_index] = NORMAL_BOOST;
  ------------------
  |  |   26|  24.6k|#define NORMAL_BOOST 100
  ------------------
  778|  24.6k|      gf_group->frame_type[frame_index] = INTER_FRAME;
  779|  24.6k|      gf_group->refbuf_state[frame_index] = REFBUF_UPDATE;
  780|  24.6k|      gf_group->max_layer_depth = AOMMAX(gf_group->max_layer_depth, 2);
  ------------------
  |  |   35|  24.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 24.6k]
  |  |  ------------------
  ------------------
  781|  24.6k|      set_src_offset(gf_group, &first_frame_index, cur_frame_index,
  782|  24.6k|                     frame_index);
  783|  24.6k|      gf_group->display_idx[frame_index] = cur_disp_index;
  784|  24.6k|      cur_disp_index++;
  785|  24.6k|      ++frame_index;
  786|  24.6k|    }
  787|  24.6k|  }
  788|  24.6k|  if (do_frame_parallel_encode) {
  ------------------
  |  Branch (788:7): [True: 0, False: 24.6k]
  ------------------
  789|       |    // Iterate through the gf_group and reset frame_parallel_level to 0 in case
  790|       |    // a frame is marked as frame_parallel_level 1 with no subsequent
  791|       |    // frame_parallel_level 2 frame(s).
  792|      0|    int level1_frame_idx = INT_MAX;
  793|      0|    int level2_frame_count = 0;
  794|      0|    for (int frame_idx = 0; frame_idx < frame_index; frame_idx++) {
  ------------------
  |  Branch (794:29): [True: 0, False: 0]
  ------------------
  795|      0|      if (gf_group->frame_parallel_level[frame_idx] == 1) {
  ------------------
  |  Branch (795:11): [True: 0, False: 0]
  ------------------
  796|       |        // Set frame_parallel_level to 0 if only one frame is present in a
  797|       |        // parallel encode set.
  798|      0|        if (level1_frame_idx != INT_MAX && !level2_frame_count)
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  |  Branch (798:44): [True: 0, False: 0]
  ------------------
  799|      0|          gf_group->frame_parallel_level[level1_frame_idx] = 0;
  800|       |        // Book-keep frame_idx of frame_parallel_level 1 frame and reset the
  801|       |        // count of frame_parallel_level 2 frames in the corresponding parallel
  802|       |        // encode set.
  803|      0|        level1_frame_idx = frame_idx;
  804|      0|        level2_frame_count = 0;
  805|      0|      }
  806|      0|      if (gf_group->frame_parallel_level[frame_idx] == 2) level2_frame_count++;
  ------------------
  |  Branch (806:11): [True: 0, False: 0]
  ------------------
  807|      0|    }
  808|       |    // If frame_parallel_level is set to 1 for the last LF_UPDATE
  809|       |    // frame in the gf_group, reset it to zero since there are no subsequent
  810|       |    // frames in the gf_group.
  811|      0|    if (gf_group->frame_parallel_level[frame_index - 2] == 1) {
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|      0|      assert(gf_group->update_type[frame_index - 2] == LF_UPDATE);
  813|      0|      gf_group->frame_parallel_level[frame_index - 2] = 0;
  814|      0|    }
  815|      0|  }
  816|       |
  817|  6.07M|  for (int gf_idx = frame_index; gf_idx < MAX_STATIC_GF_GROUP_LENGTH;
  ------------------
  |  |   42|  6.07M|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
  |  Branch (817:34): [True: 6.05M, False: 24.6k]
  ------------------
  818|  6.05M|       ++gf_idx) {
  819|  6.05M|    gf_group->update_type[gf_idx] = LF_UPDATE;
  820|  6.05M|    gf_group->arf_src_offset[gf_idx] = 0;
  821|  6.05M|    gf_group->cur_frame_idx[gf_idx] = gf_idx;
  822|  6.05M|    gf_group->layer_depth[gf_idx] = MAX_ARF_LAYERS;
  ------------------
  |  |   54|  6.05M|#define MAX_ARF_LAYERS 6
  ------------------
  823|  6.05M|    gf_group->arf_boost[gf_idx] = NORMAL_BOOST;
  ------------------
  |  |   26|  6.05M|#define NORMAL_BOOST 100
  ------------------
  824|  6.05M|    gf_group->frame_type[gf_idx] = INTER_FRAME;
  825|  6.05M|    gf_group->refbuf_state[gf_idx] = REFBUF_UPDATE;
  826|  6.05M|    gf_group->max_layer_depth = AOMMAX(gf_group->max_layer_depth, 2);
  ------------------
  |  |   35|  6.05M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.05M]
  |  |  ------------------
  ------------------
  827|  6.05M|  }
  828|       |
  829|  24.6k|  return frame_index;
  830|  24.6k|}
gop_structure.c:set_multi_layer_params:
  444|  24.6k|    const bool scale_max_boost) {
  445|  24.6k|  const int num_frames_to_process = end - start;
  446|       |
  447|       |  // Either we are at the last level of the pyramid, or we don't have enough
  448|       |  // frames between 'l' and 'r' to create one more level.
  449|  24.6k|  if (layer_depth > gf_group->max_layer_depth_allowed ||
  ------------------
  |  Branch (449:7): [True: 24.6k, False: 0]
  ------------------
  450|  24.6k|      num_frames_to_process < 3) {
  ------------------
  |  Branch (450:7): [True: 0, False: 0]
  ------------------
  451|       |    // Leaf nodes.
  452|  73.8k|    while (start < end) {
  ------------------
  |  Branch (452:12): [True: 49.2k, False: 24.6k]
  ------------------
  453|  49.2k|      gf_group->update_type[*frame_ind] = LF_UPDATE;
  454|  49.2k|      gf_group->arf_src_offset[*frame_ind] = 0;
  455|  49.2k|      gf_group->cur_frame_idx[*frame_ind] = *cur_frame_idx;
  456|  49.2k|      gf_group->display_idx[*frame_ind] = *cur_disp_idx;
  457|  49.2k|      gf_group->layer_depth[*frame_ind] = MAX_ARF_LAYERS;
  ------------------
  |  |   54|  49.2k|#define MAX_ARF_LAYERS 6
  ------------------
  458|  49.2k|      gf_group->arf_boost[*frame_ind] =
  459|  49.2k|          av1_calc_arf_boost(twopass, twopass_frame, p_rc, frame_info, start,
  460|  49.2k|                             end - start, 0, NULL, NULL, 0, scale_max_boost);
  461|  49.2k|      gf_group->frame_type[*frame_ind] = INTER_FRAME;
  462|  49.2k|      gf_group->refbuf_state[*frame_ind] = REFBUF_UPDATE;
  463|  49.2k|      gf_group->max_layer_depth =
  464|  49.2k|          AOMMAX(gf_group->max_layer_depth, layer_depth);
  ------------------
  |  |   35|  49.2k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 49.2k]
  |  |  ------------------
  ------------------
  465|       |      // Set the level of parallelism for the LF_UPDATE frame.
  466|  49.2k|      if (do_frame_parallel_encode) {
  ------------------
  |  Branch (466:11): [True: 0, False: 49.2k]
  ------------------
  467|      0|        set_frame_parallel_level(&gf_group->frame_parallel_level[*frame_ind],
  468|      0|                                 parallel_frame_count, max_parallel_frames);
  469|       |        // Set LF_UPDATE frames as non-reference frames.
  470|      0|        gf_group->is_frame_non_ref[*frame_ind] = true;
  471|      0|      }
  472|  49.2k|      set_src_offset(gf_group, first_frame_index, *cur_frame_idx, *frame_ind);
  473|  49.2k|      ++(*frame_ind);
  474|  49.2k|      ++(*cur_frame_idx);
  475|  49.2k|      ++(*cur_disp_idx);
  476|  49.2k|      ++start;
  477|  49.2k|    }
  478|  24.6k|  } else {
  479|      0|    const int m = (start + end - 1) / 2;
  480|       |
  481|       |    // Internal ARF.
  482|      0|    gf_group->update_type[*frame_ind] = INTNL_ARF_UPDATE;
  483|      0|    gf_group->arf_src_offset[*frame_ind] = m - start;
  484|      0|    gf_group->cur_frame_idx[*frame_ind] = *cur_frame_idx;
  485|      0|    gf_group->display_idx[*frame_ind] =
  486|      0|        *cur_disp_idx + gf_group->arf_src_offset[*frame_ind];
  487|      0|    gf_group->layer_depth[*frame_ind] = layer_depth;
  488|      0|    gf_group->frame_type[*frame_ind] = INTER_FRAME;
  489|      0|    gf_group->refbuf_state[*frame_ind] = REFBUF_UPDATE;
  490|       |
  491|      0|    if (do_frame_parallel_encode) {
  ------------------
  |  Branch (491:9): [True: 0, False: 0]
  ------------------
  492|       |      // If max_parallel_frames is not exceeded and if the frame will not be
  493|       |      // temporally filtered, encode the next internal ARF frame in parallel.
  494|      0|      if (*parallel_frame_count > 1 &&
  ------------------
  |  Branch (494:11): [True: 0, False: 0]
  ------------------
  495|      0|          *parallel_frame_count <= max_parallel_frames) {
  ------------------
  |  Branch (495:11): [True: 0, False: 0]
  ------------------
  496|      0|        if (gf_group->arf_src_offset[*frame_ind] < TF_LOOKAHEAD_IDX_THR)
  ------------------
  |  |   93|      0|#define TF_LOOKAHEAD_IDX_THR 7
  ------------------
  |  Branch (496:13): [True: 0, False: 0]
  ------------------
  497|      0|          gf_group->frame_parallel_level[*frame_ind] = 2;
  498|      0|        *parallel_frame_count = 1;
  499|      0|      }
  500|      0|    }
  501|      0|    set_src_offset(gf_group, first_frame_index, *cur_frame_idx, *frame_ind);
  502|       |
  503|       |    // Get the boost factor for intermediate ARF frames.
  504|      0|    gf_group->arf_boost[*frame_ind] =
  505|      0|        av1_calc_arf_boost(twopass, twopass_frame, p_rc, frame_info, m, end - m,
  506|      0|                           m - start, NULL, NULL, 0, scale_max_boost);
  507|      0|    ++(*frame_ind);
  508|       |
  509|       |    // Frames displayed before this internal ARF.
  510|      0|    set_multi_layer_params(twopass, twopass_frame, gf_group, p_rc, rc,
  511|      0|                           frame_info, start, m, cur_frame_idx, frame_ind,
  512|      0|                           parallel_frame_count, max_parallel_frames,
  513|      0|                           do_frame_parallel_encode, first_frame_index,
  514|      0|                           cur_disp_idx, layer_depth + 1, scale_max_boost);
  515|       |
  516|       |    // Overlay for internal ARF.
  517|      0|    gf_group->update_type[*frame_ind] = INTNL_OVERLAY_UPDATE;
  518|      0|    gf_group->arf_src_offset[*frame_ind] = 0;
  519|      0|    gf_group->cur_frame_idx[*frame_ind] = *cur_frame_idx;
  520|      0|    gf_group->display_idx[*frame_ind] = *cur_disp_idx;
  521|      0|    gf_group->arf_boost[*frame_ind] = 0;
  522|      0|    gf_group->layer_depth[*frame_ind] = layer_depth;
  523|      0|    gf_group->frame_type[*frame_ind] = INTER_FRAME;
  524|      0|    gf_group->refbuf_state[*frame_ind] = REFBUF_UPDATE;
  525|       |
  526|      0|    set_src_offset(gf_group, first_frame_index, *cur_frame_idx, *frame_ind);
  527|      0|    ++(*frame_ind);
  528|      0|    ++(*cur_frame_idx);
  529|      0|    ++(*cur_disp_idx);
  530|       |
  531|       |    // Frames displayed after this internal ARF.
  532|      0|    set_multi_layer_params(twopass, twopass_frame, gf_group, p_rc, rc,
  533|      0|                           frame_info, m + 1, end, cur_frame_idx, frame_ind,
  534|      0|                           parallel_frame_count, max_parallel_frames,
  535|      0|                           do_frame_parallel_encode, first_frame_index,
  536|      0|                           cur_disp_idx, layer_depth + 1, scale_max_boost);
  537|      0|  }
  538|  24.6k|}
gop_structure.c:set_src_offset:
   47|  73.8k|                           int cur_frame_idx, int frame_ind) {
   48|  73.8k|  if (gf_group->frame_parallel_level[frame_ind] > 0) {
  ------------------
  |  Branch (48:7): [True: 0, False: 73.8k]
  ------------------
   49|      0|    if (gf_group->frame_parallel_level[frame_ind] == 1) {
  ------------------
  |  Branch (49:9): [True: 0, False: 0]
  ------------------
   50|      0|      *first_frame_index = cur_frame_idx;
   51|      0|    }
   52|       |
   53|       |    // Obtain the offset of the frame at frame_ind in the lookahead queue by
   54|       |    // subtracting the display order hints of the current frame from the display
   55|       |    // order hint of the first frame in parallel encoding set (at
   56|       |    // first_frame_index).
   57|      0|    gf_group->src_offset[frame_ind] =
   58|      0|        (cur_frame_idx + gf_group->arf_src_offset[frame_ind]) -
   59|      0|        *first_frame_index;
   60|      0|  }
   61|  73.8k|}
gop_structure.c:set_ld_layer_depth:
  832|  24.6k|static void set_ld_layer_depth(GF_GROUP *gf_group, int gop_length) {
  833|  24.6k|  int log_gop_length = 0;
  834|  73.8k|  while ((1 << log_gop_length) < gop_length) {
  ------------------
  |  Branch (834:10): [True: 49.2k, False: 24.6k]
  ------------------
  835|  49.2k|    ++log_gop_length;
  836|  49.2k|  }
  837|       |
  838|   123k|  for (int gf_index = 0; gf_index < gf_group->size; ++gf_index) {
  ------------------
  |  Branch (838:26): [True: 98.4k, False: 24.6k]
  ------------------
  839|  98.4k|    int count = 0;
  840|       |    // Find the trailing zeros
  841|   270k|    for (; count < MAX_ARF_LAYERS; ++count) {
  ------------------
  |  |   54|   270k|#define MAX_ARF_LAYERS 6
  ------------------
  |  Branch (841:12): [True: 246k, False: 24.6k]
  ------------------
  842|   246k|      if ((gf_index >> count) & 0x01) break;
  ------------------
  |  Branch (842:11): [True: 73.8k, False: 172k]
  ------------------
  843|   246k|    }
  844|  98.4k|    gf_group->layer_depth[gf_index] = AOMMAX(log_gop_length - count, 0);
  ------------------
  |  |   35|  98.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 73.8k, False: 24.6k]
  |  |  ------------------
  ------------------
  845|  98.4k|  }
  846|  24.6k|  gf_group->max_layer_depth = AOMMIN(log_gop_length, MAX_ARF_LAYERS);
  ------------------
  |  |   34|  24.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 24.6k, False: 0]
  |  |  ------------------
  ------------------
  847|  24.6k|}

av1_crc32c_calculator_init:
   22|  82.7k|void av1_crc32c_calculator_init(CRC32C *p_crc32c) {
   23|  82.7k|  uint32_t crc;
   24|       |
   25|  20.3M|  for (int n = 0; n < 256; n++) {
  ------------------
  |  Branch (25:19): [True: 20.2M, False: 82.7k]
  ------------------
   26|  20.2M|    crc = n;
   27|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (27:11): [True: 10.1M, False: 10.1M]
  ------------------
   28|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (28:11): [True: 10.1M, False: 10.1M]
  ------------------
   29|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (29:11): [True: 10.1M, False: 10.1M]
  ------------------
   30|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (30:11): [True: 10.1M, False: 10.1M]
  ------------------
   31|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (31:11): [True: 10.1M, False: 10.1M]
  ------------------
   32|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (32:11): [True: 10.1M, False: 10.1M]
  ------------------
   33|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (33:11): [True: 10.1M, False: 10.1M]
  ------------------
   34|  20.2M|    crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
  ------------------
  |  |   19|  10.1M|#define POLY 0x82f63b78
  ------------------
  |  Branch (34:11): [True: 10.1M, False: 10.1M]
  ------------------
   35|  20.2M|    p_crc32c->table[0][n] = crc;
   36|  20.2M|  }
   37|  20.5M|  for (int n = 0; n < 256; n++) {
  ------------------
  |  Branch (37:19): [True: 20.4M, False: 82.7k]
  ------------------
   38|  20.4M|    crc = p_crc32c->table[0][n];
   39|   162M|    for (int k = 1; k < 8; k++) {
  ------------------
  |  Branch (39:21): [True: 142M, False: 20.4M]
  ------------------
   40|   142M|      crc = p_crc32c->table[0][crc & 0xff] ^ (crc >> 8);
   41|   142M|      p_crc32c->table[k][n] = crc;
   42|   142M|    }
   43|  20.4M|  }
   44|  82.7k|}

av1_hash_table_init:
   91|  1.98k|void av1_hash_table_init(IntraBCHashInfo *intrabc_hash_info) {
   92|  1.98k|  if (!intrabc_hash_info->crc_initialized) {
  ------------------
  |  Branch (92:7): [True: 1.98k, False: 0]
  ------------------
   93|  1.98k|    av1_crc32c_calculator_init(&intrabc_hash_info->crc_calculator);
   94|  1.98k|    intrabc_hash_info->crc_initialized = 1;
   95|  1.98k|  }
   96|       |  intrabc_hash_info->intrabc_hash_table.p_lookup_table = NULL;
   97|  1.98k|}
av1_hash_table_destroy:
  112|  20.3k|void av1_hash_table_destroy(hash_table *p_hash_table) {
  113|  20.3k|  clear_all(p_hash_table);
  114|  20.3k|  aom_free(p_hash_table->p_lookup_table);
  115|       |  p_hash_table->p_lookup_table = NULL;
  116|  20.3k|}
av1_hash_table_create:
  118|  1.98k|bool av1_hash_table_create(hash_table *p_hash_table) {
  119|  1.98k|  if (p_hash_table->p_lookup_table != NULL) {
  ------------------
  |  Branch (119:7): [True: 0, False: 1.98k]
  ------------------
  120|      0|    clear_all(p_hash_table);
  121|      0|    return true;
  122|      0|  }
  123|  1.98k|  p_hash_table->p_lookup_table =
  124|  1.98k|      (Vector **)aom_calloc(kMaxAddr, sizeof(p_hash_table->p_lookup_table[0]));
  ------------------
  |  |   27|  1.98k|#define kMaxAddr (6 << kSrcBits)
  |  |  ------------------
  |  |  |  |   21|  1.98k|#define kSrcBits 16
  |  |  ------------------
  ------------------
  125|  1.98k|  if (!p_hash_table->p_lookup_table) return false;
  ------------------
  |  Branch (125:7): [True: 0, False: 1.98k]
  ------------------
  126|  1.98k|  return true;
  127|  1.98k|}
av1_hash_table_count:
  155|  87.5k|                             uint32_t hash_value) {
  156|  87.5k|  if (p_hash_table->p_lookup_table[hash_value] == NULL) {
  ------------------
  |  Branch (156:7): [True: 60.8k, False: 26.6k]
  ------------------
  157|  60.8k|    return 0;
  158|  60.8k|  } else {
  159|  26.6k|    return (int32_t)(p_hash_table->p_lookup_table[hash_value]->size);
  160|  26.6k|  }
  161|  87.5k|}
av1_hash_get_first_iterator:
  164|    276|                                     uint32_t hash_value) {
  165|       |  assert(av1_hash_table_count(p_hash_table, hash_value) > 0);
  166|    276|  return aom_vector_begin(p_hash_table->p_lookup_table[hash_value]);
  167|    276|}
av1_generate_block_2x2_hash_value:
  170|  1.98k|                                       uint32_t *pic_block_hash) {
  171|  1.98k|  const int width = 2;
  172|  1.98k|  const int height = 2;
  173|  1.98k|  const int x_end = picture->y_crop_width - width + 1;
  174|  1.98k|  const int y_end = picture->y_crop_height - height + 1;
  175|       |
  176|  1.98k|  if (picture->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|  1.98k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (176:7): [True: 1.98k, False: 0]
  ------------------
  177|  1.98k|    uint16_t p[4];
  178|  1.98k|    int pos = 0;
  179|  31.2k|    for (int y_pos = 0; y_pos < y_end; y_pos++) {
  ------------------
  |  Branch (179:25): [True: 29.2k, False: 1.98k]
  ------------------
  180|   276k|      for (int x_pos = 0; x_pos < x_end; x_pos++) {
  ------------------
  |  Branch (180:27): [True: 247k, False: 29.2k]
  ------------------
  181|   247k|        get_pixels_in_1D_short_array_by_block_2x2(
  182|   247k|            CONVERT_TO_SHORTPTR(picture->y_buffer) + y_pos * picture->y_stride +
  ------------------
  |  |   79|   247k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  183|   247k|                x_pos,
  184|   247k|            picture->y_stride, p);
  185|       |        // For HBD, we either have 40 or 48 bits of input data that the xor hash
  186|       |        // reduce to 32 bits. We intentionally don't want to "discard" bits to
  187|       |        // avoid any kind of biasing.
  188|   247k|        pic_block_hash[pos] = get_xor_hash_value_hbd(p[0], p[1], p[2], p[3]);
  189|   247k|        pos++;
  190|   247k|      }
  191|  29.2k|      pos += width - 1;
  192|  29.2k|    }
  193|  1.98k|  } else {
  194|      0|    uint8_t p[4];
  195|      0|    int pos = 0;
  196|      0|    for (int y_pos = 0; y_pos < y_end; y_pos++) {
  ------------------
  |  Branch (196:25): [True: 0, False: 0]
  ------------------
  197|      0|      for (int x_pos = 0; x_pos < x_end; x_pos++) {
  ------------------
  |  Branch (197:27): [True: 0, False: 0]
  ------------------
  198|      0|        get_pixels_in_1D_char_array_by_block_2x2(
  199|      0|            picture->y_buffer + y_pos * picture->y_stride + x_pos,
  200|      0|            picture->y_stride, p);
  201|       |        // This 2x2 hash isn't used directly as a "key" for the hash table, so
  202|       |        // we can afford to just copy the 4 8-bit pixel values as a single
  203|       |        // 32-bit value directly. (i.e. there are no concerns of a lack of
  204|       |        // uniform distribution)
  205|      0|        pic_block_hash[pos] = get_identity_hash_value(p[0], p[1], p[2], p[3]);
  206|      0|        pos++;
  207|      0|      }
  208|      0|      pos += width - 1;
  209|      0|    }
  210|      0|  }
  211|  1.98k|}
av1_generate_block_hash_value:
  217|  9.90k|                                   uint32_t *dst_pic_block_hash) {
  218|  9.90k|  CRC32C *calc = &intrabc_hash_info->crc_calculator;
  219|       |
  220|  9.90k|  const int pic_width = picture->y_crop_width;
  221|  9.90k|  const int x_end = picture->y_crop_width - block_size + 1;
  222|  9.90k|  const int y_end = picture->y_crop_height - block_size + 1;
  223|  9.90k|  const int src_size = block_size >> 1;
  224|       |
  225|  9.90k|  uint32_t p[4];
  226|  9.90k|  const int length = sizeof(p);
  227|       |
  228|  9.90k|  int pos = 0;
  229|  90.8k|  for (int y_pos = 0; y_pos < y_end; y_pos++) {
  ------------------
  |  Branch (229:23): [True: 80.9k, False: 9.90k]
  ------------------
  230|   308k|    for (int x_pos = 0; x_pos < x_end; x_pos++) {
  ------------------
  |  Branch (230:25): [True: 227k, False: 80.9k]
  ------------------
  231|       |      // Build up a bigger block from 4 smaller, non-overlapping source block
  232|       |      // hashes, and compute its hash. Note: source blocks at the right and
  233|       |      // bottom borders cannot be part of larger blocks, therefore they won't be
  234|       |      // considered into the block hash value generation process.
  235|   227k|      p[0] = src_pic_block_hash[pos];
  236|   227k|      p[1] = src_pic_block_hash[pos + src_size];
  237|   227k|      p[2] = src_pic_block_hash[pos + src_size * pic_width];
  238|   227k|      p[3] = src_pic_block_hash[pos + src_size * pic_width + src_size];
  239|       |      // TODO: bug aomedia:433531610 - serialize input values in a way that's
  240|       |      // independent of the computer architecture's endianness
  241|   227k|      dst_pic_block_hash[pos] =
  242|   227k|          av1_get_crc32c_value(calc, (uint8_t *)p, length);
  243|   227k|      pos++;
  244|   227k|    }
  245|  80.9k|    pos += block_size - 1;
  246|  80.9k|  }
  247|  9.90k|}
av1_add_to_hash_map_by_row_with_precal_data:
  252|  9.90k|                                                 int block_size) {
  253|  9.90k|  const int x_end = pic_width - block_size + 1;
  254|  9.90k|  const int y_end = pic_height - block_size + 1;
  255|       |
  256|  9.90k|  int add_value = hash_block_size_to_index(block_size);
  257|  9.90k|  assert(add_value >= 0);
  258|  9.90k|  add_value <<= kSrcBits;
  ------------------
  |  |   21|  9.90k|#define kSrcBits 16
  ------------------
  259|  9.90k|  const int crc_mask = (1 << kSrcBits) - 1;
  ------------------
  |  |   21|  9.90k|#define kSrcBits 16
  ------------------
  260|  9.90k|  int step = block_size;
  261|  9.90k|  int x_offset = 0;
  262|  9.90k|  int y_offset = 0;
  263|       |
  264|       |  // Explore the entire frame hierarchically to add intrabc candidate blocks to
  265|       |  // the hash table, by starting with coarser steps (the block size), towards
  266|       |  // finer-grained steps until every candidate block has been considered.
  267|       |  // The nested for loop goes through the pic_hash array column by column.
  268|       |
  269|       |  // Doing a hierarchical block exploration helps maximize spatial dispersion
  270|       |  // of the first and foremost candidate blocks while minimizing overlap between
  271|       |  // them. This is helpful because we only keep up to 256 entries of the
  272|       |  // same candidate block (located in different places), so we want those
  273|       |  // entries to cover the biggest area of the image to encode to maximize coding
  274|       |  // efficiency.
  275|       |
  276|       |  // This is the coordinate exploration order example for an 8x8 region, with
  277|       |  // block_size = 4. The top-left corner (x, y) coordinates of each candidate
  278|       |  // block are shown below. There are 5 * 5 (25) candidate blocks.
  279|       |  //    x  0  1  2  3  4  5  6  7
  280|       |  //  y +------------------------
  281|       |  //  0 |  1 10  5 13  3
  282|       |  //  1 | 16 22 18 24 20
  283|       |  //  2 |  7 11  9 14  8
  284|       |  //  3 | 17 23 19 25 21
  285|       |  //  4 |  2 12  6 15  4--------+
  286|       |  //  5 |              | 4 x 4  |
  287|       |  //  6 |              | block  |
  288|       |  //  7 |              +--------+
  289|       |
  290|       |  // Please note that due to the way block exploration works, the smallest step
  291|       |  // used is 2 (i.e. no two adjacent blocks will be explored consecutively).
  292|       |  // Also, the exploration is designed to visit each block candidate only once.
  293|   138k|  while (step > 1) {
  ------------------
  |  Branch (293:10): [True: 128k, False: 9.90k]
  ------------------
  294|   401k|    for (int x_pos = x_offset; x_pos < x_end; x_pos += step) {
  ------------------
  |  Branch (294:32): [True: 272k, False: 128k]
  ------------------
  295|   500k|      for (int y_pos = y_offset; y_pos < y_end; y_pos += step) {
  ------------------
  |  Branch (295:34): [True: 227k, False: 272k]
  ------------------
  296|   227k|        const int pos = y_pos * pic_width + x_pos;
  297|   227k|        block_hash curr_block_hash;
  298|       |
  299|   227k|        curr_block_hash.x = x_pos;
  300|   227k|        curr_block_hash.y = y_pos;
  301|       |
  302|   227k|        const uint32_t hash_value1 = (pic_hash[pos] & crc_mask) + add_value;
  303|   227k|        curr_block_hash.hash_value2 = pic_hash[pos];
  304|       |
  305|   227k|        if (!hash_table_add_to_table(p_hash_table, hash_value1,
  ------------------
  |  Branch (305:13): [True: 0, False: 227k]
  ------------------
  306|   227k|                                     &curr_block_hash)) {
  307|      0|          return false;
  308|      0|        }
  309|   227k|      }
  310|   272k|    }
  311|       |
  312|       |    // Adjust offsets and step sizes with this state machine.
  313|       |    // State 0 is needed because no blocks in pic_hash have been explored,
  314|       |    // so exploration requires a way to account for blocks with both zero
  315|       |    // x_offset and zero y_offset.
  316|       |    // State 0 is always meant to be executed first, but the relative order of
  317|       |    // states 1, 2 and 3 can be arbitrary, as long as no two adjacent blocks
  318|       |    // are explored consecutively.
  319|   128k|    if (x_offset == 0 && y_offset == 0) {
  ------------------
  |  Branch (319:9): [True: 49.5k, False: 79.2k]
  |  Branch (319:26): [True: 9.90k, False: 39.6k]
  ------------------
  320|       |      // State 0 -> State 1: special case
  321|       |      // This state transition will only execute when step == block_size
  322|  9.90k|      x_offset = step / 2;
  323|   118k|    } else if (x_offset == step / 2 && y_offset == 0) {
  ------------------
  |  Branch (323:16): [True: 79.2k, False: 39.6k]
  |  Branch (323:40): [True: 39.6k, False: 39.6k]
  ------------------
  324|       |      // State 1 -> State 2
  325|  39.6k|      x_offset = 0;
  326|  39.6k|      y_offset = step / 2;
  327|  79.2k|    } else if (x_offset == 0 && y_offset == step / 2) {
  ------------------
  |  Branch (327:16): [True: 39.6k, False: 39.6k]
  |  Branch (327:33): [True: 39.6k, False: 0]
  ------------------
  328|       |      // State 2 -> State 3
  329|  39.6k|      x_offset = step / 2;
  330|  39.6k|    } else {
  331|  39.6k|      assert(x_offset == step / 2 && y_offset == step / 2);
  332|       |      // State 3 -> State 1: We've fully explored all the coordinates for the
  333|       |      // current step size, continue by halving the step size
  334|  39.6k|      step /= 2;
  335|  39.6k|      x_offset = step / 2;
  336|  39.6k|      y_offset = 0;
  337|  39.6k|    }
  338|   128k|  }
  339|       |
  340|  9.90k|  return true;
  341|  9.90k|}
av1_hash_is_horizontal_perfect:
  344|   134k|                                   int block_size, int x_start, int y_start) {
  345|   134k|  const int stride = picture->y_stride;
  346|   134k|  const uint8_t *p = picture->y_buffer + y_start * stride + x_start;
  347|       |
  348|   134k|  if (picture->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   134k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (348:7): [True: 134k, False: 0]
  ------------------
  349|   134k|    const uint16_t *p16 = CONVERT_TO_SHORTPTR(p);
  ------------------
  |  |   79|   134k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  350|   240k|    for (int i = 0; i < block_size; i++) {
  ------------------
  |  Branch (350:21): [True: 227k, False: 13.0k]
  ------------------
  351|  1.00M|      for (int j = 1; j < block_size; j++) {
  ------------------
  |  Branch (351:23): [True: 894k, False: 106k]
  ------------------
  352|   894k|        if (p16[j] != p16[0]) {
  ------------------
  |  Branch (352:13): [True: 121k, False: 773k]
  ------------------
  353|   121k|          return 0;
  354|   121k|        }
  355|   894k|      }
  356|   106k|      p16 += stride;
  357|   106k|    }
  358|   134k|  } else {
  359|      0|    for (int i = 0; i < block_size; i++) {
  ------------------
  |  Branch (359:21): [True: 0, False: 0]
  ------------------
  360|      0|      for (int j = 1; j < block_size; j++) {
  ------------------
  |  Branch (360:23): [True: 0, False: 0]
  ------------------
  361|      0|        if (p[j] != p[0]) {
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|      0|          return 0;
  363|      0|        }
  364|      0|      }
  365|      0|      p += stride;
  366|      0|    }
  367|      0|  }
  368|       |
  369|  13.0k|  return 1;
  370|   134k|}
av1_hash_is_vertical_perfect:
  373|   121k|                                 int block_size, int x_start, int y_start) {
  374|   121k|  const int stride = picture->y_stride;
  375|   121k|  const uint8_t *p = picture->y_buffer + y_start * stride + x_start;
  376|       |
  377|   121k|  if (picture->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   121k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (377:7): [True: 121k, False: 0]
  ------------------
  378|   121k|    const uint16_t *p16 = CONVERT_TO_SHORTPTR(p);
  ------------------
  |  |   79|   121k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  379|   190k|    for (int i = 0; i < block_size; i++) {
  ------------------
  |  Branch (379:21): [True: 182k, False: 8.42k]
  ------------------
  380|   693k|      for (int j = 1; j < block_size; j++) {
  ------------------
  |  Branch (380:23): [True: 623k, False: 69.4k]
  ------------------
  381|   623k|        if (p16[j * stride + i] != p16[i]) {
  ------------------
  |  Branch (381:13): [True: 112k, False: 511k]
  ------------------
  382|   112k|          return 0;
  383|   112k|        }
  384|   623k|      }
  385|   182k|    }
  386|   121k|  } else {
  387|      0|    for (int i = 0; i < block_size; i++) {
  ------------------
  |  Branch (387:21): [True: 0, False: 0]
  ------------------
  388|      0|      for (int j = 1; j < block_size; j++) {
  ------------------
  |  Branch (388:23): [True: 0, False: 0]
  ------------------
  389|      0|        if (p[j * stride + i] != p[i]) {
  ------------------
  |  Branch (389:13): [True: 0, False: 0]
  ------------------
  390|      0|          return 0;
  391|      0|        }
  392|      0|      }
  393|      0|    }
  394|      0|  }
  395|  8.42k|  return 1;
  396|   121k|}
av1_get_block_hash_value:
  401|  87.5k|                              int use_highbitdepth) {
  402|  87.5k|  int add_value = hash_block_size_to_index(block_size);
  403|  87.5k|  assert(add_value >= 0);
  404|  87.5k|  add_value <<= kSrcBits;
  ------------------
  |  |   21|  87.5k|#define kSrcBits 16
  ------------------
  405|  87.5k|  const int crc_mask = (1 << kSrcBits) - 1;
  ------------------
  |  |   21|  87.5k|#define kSrcBits 16
  ------------------
  406|       |
  407|  87.5k|  CRC32C *calc = &intra_bc_hash_info->crc_calculator;
  408|  87.5k|  uint32_t **buf = intra_bc_hash_info->hash_value_buffer;
  409|       |
  410|       |  // 2x2 subblock hash values in current CU
  411|  87.5k|  int sub_block_in_width = (block_size >> 1);
  412|  87.5k|  if (use_highbitdepth) {
  ------------------
  |  Branch (412:7): [True: 87.5k, False: 18.4E]
  ------------------
  413|  87.5k|    uint16_t pixel_to_hash[4];
  414|  87.5k|    uint16_t *y16_src = CONVERT_TO_SHORTPTR(y_src);
  ------------------
  |  |   79|  87.5k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  415|   309k|    for (int y_pos = 0; y_pos < block_size; y_pos += 2) {
  ------------------
  |  Branch (415:25): [True: 222k, False: 87.5k]
  ------------------
  416|   920k|      for (int x_pos = 0; x_pos < block_size; x_pos += 2) {
  ------------------
  |  Branch (416:27): [True: 698k, False: 222k]
  ------------------
  417|   698k|        int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1);
  418|   698k|        get_pixels_in_1D_short_array_by_block_2x2(
  419|   698k|            y16_src + y_pos * stride + x_pos, stride, pixel_to_hash);
  420|   698k|        assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
  421|       |        // For HBD, we either have 40 or 48 bits of input data that the xor hash
  422|       |        // reduce to 32 bits. We intentionally don't want to "discard" bits to
  423|       |        // avoid any kind of biasing.
  424|   698k|        buf[0][pos] =
  425|   698k|            get_xor_hash_value_hbd(pixel_to_hash[0], pixel_to_hash[1],
  426|   698k|                                   pixel_to_hash[2], pixel_to_hash[3]);
  427|   698k|      }
  428|   222k|    }
  429|  18.4E|  } else {
  430|  18.4E|    uint8_t pixel_to_hash[4];
  431|  18.4E|    for (int y_pos = 0; y_pos < block_size; y_pos += 2) {
  ------------------
  |  Branch (431:25): [True: 0, False: 18.4E]
  ------------------
  432|      0|      for (int x_pos = 0; x_pos < block_size; x_pos += 2) {
  ------------------
  |  Branch (432:27): [True: 0, False: 0]
  ------------------
  433|      0|        int pos = (y_pos >> 1) * sub_block_in_width + (x_pos >> 1);
  434|      0|        get_pixels_in_1D_char_array_by_block_2x2(y_src + y_pos * stride + x_pos,
  435|      0|                                                 stride, pixel_to_hash);
  436|      0|        assert(pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
  437|       |        // This 2x2 hash isn't used directly as a "key" for the hash table, so
  438|       |        // we can afford to just copy the 4 8-bit pixel values as a single
  439|       |        // 32-bit value directly. (i.e. there are no concerns of a lack of
  440|       |        // uniform distribution)
  441|      0|        buf[0][pos] =
  442|      0|            get_identity_hash_value(pixel_to_hash[0], pixel_to_hash[1],
  443|      0|                                    pixel_to_hash[2], pixel_to_hash[3]);
  444|      0|      }
  445|      0|    }
  446|  18.4E|  }
  447|       |
  448|  87.5k|  int src_sub_block_in_width = sub_block_in_width;
  449|  87.5k|  sub_block_in_width >>= 1;
  450|       |
  451|  87.5k|  int src_idx = 0;
  452|  87.5k|  int dst_idx = !src_idx;
  453|       |
  454|       |  // 4x4 subblock hash values to current block hash values
  455|  87.5k|  uint32_t to_hash[4];
  456|   196k|  for (int sub_width = 4; sub_width <= block_size;
  ------------------
  |  Branch (456:27): [True: 109k, False: 87.5k]
  ------------------
  457|   109k|       sub_width *= 2, src_idx = !src_idx) {
  458|   109k|    dst_idx = !src_idx;
  459|       |
  460|   109k|    int dst_pos = 0;
  461|   243k|    for (int y_pos = 0; y_pos < sub_block_in_width; y_pos++) {
  ------------------
  |  Branch (461:25): [True: 134k, False: 109k]
  ------------------
  462|   338k|      for (int x_pos = 0; x_pos < sub_block_in_width; x_pos++) {
  ------------------
  |  Branch (462:27): [True: 203k, False: 134k]
  ------------------
  463|   203k|        int srcPos = (y_pos << 1) * src_sub_block_in_width + (x_pos << 1);
  464|       |
  465|   203k|        assert(srcPos + 1 < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
  466|   203k|        assert(srcPos + src_sub_block_in_width + 1 <
  467|   203k|               AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
  468|   203k|        assert(dst_pos < AOM_BUFFER_SIZE_FOR_BLOCK_HASH);
  469|       |
  470|   203k|        to_hash[0] = buf[src_idx][srcPos];
  471|   203k|        to_hash[1] = buf[src_idx][srcPos + 1];
  472|   203k|        to_hash[2] = buf[src_idx][srcPos + src_sub_block_in_width];
  473|   203k|        to_hash[3] = buf[src_idx][srcPos + src_sub_block_in_width + 1];
  474|       |
  475|       |        // TODO: bug aomedia:433531610 - serialize input values in a way that's
  476|       |        // independent of the computer architecture's endianness
  477|   203k|        buf[dst_idx][dst_pos] =
  478|   203k|            av1_get_crc32c_value(calc, (uint8_t *)to_hash, sizeof(to_hash));
  479|   203k|        dst_pos++;
  480|   203k|      }
  481|   134k|    }
  482|       |
  483|   109k|    src_sub_block_in_width = sub_block_in_width;
  484|   109k|    sub_block_in_width >>= 1;
  485|   109k|  }
  486|       |
  487|  87.5k|  *hash_value1 = (buf[dst_idx][0] & crc_mask) + add_value;
  488|  87.5k|  *hash_value2 = buf[dst_idx][0];
  489|  87.5k|}
hash_motion.c:clear_all:
   99|  20.3k|static void clear_all(hash_table *p_hash_table) {
  100|  20.3k|  if (p_hash_table->p_lookup_table == NULL) {
  ------------------
  |  Branch (100:7): [True: 18.4k, False: 1.98k]
  ------------------
  101|  18.4k|    return;
  102|  18.4k|  }
  103|   778M|  for (int i = 0; i < kMaxAddr; i++) {
  ------------------
  |  |   27|   778M|#define kMaxAddr (6 << kSrcBits)
  |  |  ------------------
  |  |  |  |   21|   778M|#define kSrcBits 16
  |  |  ------------------
  ------------------
  |  Branch (103:19): [True: 778M, False: 1.98k]
  ------------------
  104|   778M|    if (p_hash_table->p_lookup_table[i] != NULL) {
  ------------------
  |  Branch (104:9): [True: 225k, False: 778M]
  ------------------
  105|   225k|      aom_vector_destroy(p_hash_table->p_lookup_table[i]);
  106|   225k|      aom_free(p_hash_table->p_lookup_table[i]);
  107|       |      p_hash_table->p_lookup_table[i] = NULL;
  108|   225k|    }
  109|   778M|  }
  110|  1.98k|}
hash_motion.c:get_pixels_in_1D_short_array_by_block_2x2:
   45|   945k|                                                      uint16_t *p_pixels_in1D) {
   46|   945k|  const uint16_t *p_pel = y_src;
   47|   945k|  int index = 0;
   48|  2.83M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (48:19): [True: 1.88M, False: 945k]
  ------------------
   49|  5.67M|    for (int j = 0; j < 2; j++) {
  ------------------
  |  Branch (49:21): [True: 3.78M, False: 1.88M]
  ------------------
   50|  3.78M|      p_pixels_in1D[index++] = p_pel[j];
   51|  3.78M|    }
   52|  1.88M|    p_pel += stride;
   53|  1.88M|  }
   54|   945k|}
hash_motion.c:get_xor_hash_value_hbd:
   80|   945k|                                       const uint16_t c, const uint16_t d) {
   81|   945k|  uint32_t result;
   82|       |  // Pack the lower 8 bits of each input value to the 32 bit output, then xor
   83|       |  // with the upper 8 bits of each input value.
   84|   945k|  result = ((uint32_t)(a & 0x00ff) << 24) + ((uint32_t)(b & 0x00ff) << 16) +
   85|   945k|           ((uint32_t)(c & 0x00ff) << 8) + ((uint32_t)(d & 0x00ff));
   86|   945k|  result ^= ((uint32_t)(a & 0xff00) << 16) + ((uint32_t)(b & 0xff00) << 8) +
   87|   945k|            ((uint32_t)(c & 0xff00)) + ((uint32_t)(d & 0xff00) >> 8);
   88|   945k|  return result;
   89|   945k|}
hash_motion.c:hash_block_size_to_index:
   59|  97.4k|static int hash_block_size_to_index(int block_size) {
   60|  97.4k|  switch (block_size) {
   61|  69.1k|    case 4: return 0;
  ------------------
  |  Branch (61:5): [True: 69.1k, False: 28.2k]
  ------------------
   62|  21.0k|    case 8: return 1;
  ------------------
  |  Branch (62:5): [True: 21.0k, False: 76.3k]
  ------------------
   63|  3.06k|    case 16: return 2;
  ------------------
  |  Branch (63:5): [True: 3.06k, False: 94.3k]
  ------------------
   64|  2.11k|    case 32: return 3;
  ------------------
  |  Branch (64:5): [True: 2.11k, False: 95.2k]
  ------------------
   65|  2.00k|    case 64: return 4;
  ------------------
  |  Branch (65:5): [True: 2.00k, False: 95.4k]
  ------------------
   66|      0|    case 128: return 5;
  ------------------
  |  Branch (66:5): [True: 0, False: 97.4k]
  ------------------
   67|      0|    default: return -1;
  ------------------
  |  Branch (67:5): [True: 0, False: 97.4k]
  ------------------
   68|  97.4k|  }
   69|  97.4k|}
hash_motion.c:hash_table_add_to_table:
  131|   227k|                                    const block_hash *curr_block_hash) {
  132|   227k|  if (p_hash_table->p_lookup_table[hash_value] == NULL) {
  ------------------
  |  Branch (132:7): [True: 225k, False: 1.88k]
  ------------------
  133|   225k|    p_hash_table->p_lookup_table[hash_value] =
  134|   225k|        aom_malloc(sizeof(*p_hash_table->p_lookup_table[hash_value]));
  135|   225k|    if (p_hash_table->p_lookup_table[hash_value] == NULL) {
  ------------------
  |  Branch (135:9): [True: 0, False: 225k]
  ------------------
  136|      0|      return false;
  137|      0|    }
  138|   225k|    if (aom_vector_setup(p_hash_table->p_lookup_table[hash_value], 10,
  ------------------
  |  Branch (138:9): [True: 0, False: 225k]
  ------------------
  139|   225k|                         sizeof(*curr_block_hash)) == VECTOR_ERROR)
  ------------------
  |  |   35|   225k|#define VECTOR_ERROR -1
  ------------------
  140|      0|      return false;
  141|   225k|  }
  142|       |  // Place an upper bound each hash table bucket to up to 256 intrabc
  143|       |  // block candidates, and ignore subsequent ones. Considering more can
  144|       |  // unnecessarily slow down encoding for virtually no efficiency gain.
  145|   227k|  if (aom_vector_byte_size(p_hash_table->p_lookup_table[hash_value]) <
  ------------------
  |  Branch (145:7): [True: 227k, False: 0]
  ------------------
  146|   227k|      kMaxCandidatesPerHashBucket * sizeof(*curr_block_hash)) {
  ------------------
  |  |   28|   227k|#define kMaxCandidatesPerHashBucket 256
  ------------------
  147|   227k|    if (aom_vector_push_back(p_hash_table->p_lookup_table[hash_value],
  ------------------
  |  Branch (147:9): [True: 0, False: 227k]
  ------------------
  148|   227k|                             (void *)curr_block_hash) == VECTOR_ERROR)
  ------------------
  |  |   35|   227k|#define VECTOR_ERROR -1
  ------------------
  149|      0|      return false;
  150|   227k|  }
  151|   227k|  return true;
  152|   227k|}

av1_fwd_txfm:
  234|   140M|                  TxfmParam *txfm_param) {
  235|   140M|  if (txfm_param->bd == 8)
  ------------------
  |  Branch (235:7): [True: 96.3M, False: 44.1M]
  ------------------
  236|  96.3M|    av1_lowbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
  237|  44.1M|  else
  238|  44.1M|    av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
  239|   140M|}
av1_lowbd_fwd_txfm_c:
  242|  4.03M|                          int diff_stride, TxfmParam *txfm_param) {
  243|  4.03M|  av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
  244|  4.03M|}
av1_highbd_fwd_txfm:
  247|  48.2M|                         int diff_stride, TxfmParam *txfm_param) {
  248|  48.2M|  assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]);
  249|  48.2M|  const TX_SIZE tx_size = txfm_param->tx_size;
  250|  48.2M|  switch (tx_size) {
  251|  1.34k|    case TX_64X64:
  ------------------
  |  Branch (251:5): [True: 1.34k, False: 48.2M]
  ------------------
  252|  1.34k|      highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
  253|  1.34k|      break;
  254|  1.47k|    case TX_32X64:
  ------------------
  |  Branch (254:5): [True: 1.47k, False: 48.2M]
  ------------------
  255|  1.47k|      highbd_fwd_txfm_32x64(src_diff, coeff, diff_stride, txfm_param);
  256|  1.47k|      break;
  257|  1.66k|    case TX_64X32:
  ------------------
  |  Branch (257:5): [True: 1.66k, False: 48.2M]
  ------------------
  258|  1.66k|      highbd_fwd_txfm_64x32(src_diff, coeff, diff_stride, txfm_param);
  259|  1.66k|      break;
  260|       |
  261|  20.6k|    case TX_32X32:
  ------------------
  |  Branch (261:5): [True: 20.6k, False: 48.2M]
  ------------------
  262|  20.6k|      highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
  263|  20.6k|      break;
  264|   188k|    case TX_16X16:
  ------------------
  |  Branch (264:5): [True: 188k, False: 48.0M]
  ------------------
  265|   188k|      highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
  266|   188k|      break;
  267|  8.85M|    case TX_8X8:
  ------------------
  |  Branch (267:5): [True: 8.85M, False: 39.4M]
  ------------------
  268|  8.85M|      highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param);
  269|  8.85M|      break;
  270|  3.82M|    case TX_4X8:
  ------------------
  |  Branch (270:5): [True: 3.82M, False: 44.4M]
  ------------------
  271|  3.82M|      highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param);
  272|  3.82M|      break;
  273|  2.96M|    case TX_8X4:
  ------------------
  |  Branch (273:5): [True: 2.96M, False: 45.2M]
  ------------------
  274|  2.96M|      highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param);
  275|  2.96M|      break;
  276|   423k|    case TX_8X16:
  ------------------
  |  Branch (276:5): [True: 423k, False: 47.8M]
  ------------------
  277|   423k|      highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
  278|   423k|      break;
  279|   418k|    case TX_16X8:
  ------------------
  |  Branch (279:5): [True: 418k, False: 47.8M]
  ------------------
  280|   418k|      highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
  281|   418k|      break;
  282|  16.2k|    case TX_16X32:
  ------------------
  |  Branch (282:5): [True: 16.2k, False: 48.2M]
  ------------------
  283|  16.2k|      highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
  284|  16.2k|      break;
  285|  22.5k|    case TX_32X16:
  ------------------
  |  Branch (285:5): [True: 22.5k, False: 48.2M]
  ------------------
  286|  22.5k|      highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
  287|  22.5k|      break;
  288|  31.7M|    case TX_4X4:
  ------------------
  |  Branch (288:5): [True: 31.7M, False: 16.5M]
  ------------------
  289|  31.7M|      highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param);
  290|  31.7M|      break;
  291|      0|#if !CONFIG_REALTIME_ONLY
  292|      0|    case TX_4X16:
  ------------------
  |  Branch (292:5): [True: 0, False: 48.2M]
  ------------------
  293|      0|      highbd_fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param);
  294|      0|      break;
  295|      0|    case TX_16X4:
  ------------------
  |  Branch (295:5): [True: 0, False: 48.2M]
  ------------------
  296|      0|      highbd_fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param);
  297|      0|      break;
  298|      0|    case TX_8X32:
  ------------------
  |  Branch (298:5): [True: 0, False: 48.2M]
  ------------------
  299|      0|      highbd_fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param);
  300|      0|      break;
  301|      0|    case TX_32X8:
  ------------------
  |  Branch (301:5): [True: 0, False: 48.2M]
  ------------------
  302|      0|      highbd_fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param);
  303|      0|      break;
  304|      0|    case TX_16X64:
  ------------------
  |  Branch (304:5): [True: 0, False: 48.2M]
  ------------------
  305|      0|      highbd_fwd_txfm_16x64(src_diff, coeff, diff_stride, txfm_param);
  306|      0|      break;
  307|      0|    case TX_64X16:
  ------------------
  |  Branch (307:5): [True: 0, False: 48.2M]
  ------------------
  308|      0|      highbd_fwd_txfm_64x16(src_diff, coeff, diff_stride, txfm_param);
  309|      0|      break;
  310|      0|#endif
  311|      0|    default: assert(0); break;
  ------------------
  |  Branch (311:5): [True: 0, False: 48.2M]
  ------------------
  312|  48.2M|  }
  313|  48.2M|}
av1_quick_txfm:
  349|  30.4M|                    tran_low_t *coeff) {
  350|  30.4M|  if (use_hadamard) {
  ------------------
  |  Branch (350:7): [True: 19.4M, False: 11.0M]
  ------------------
  351|  19.4M|#if CONFIG_AV1_HIGHBITDEPTH
  352|  19.4M|    if (bd_info.use_highbitdepth_buf) {
  ------------------
  |  Branch (352:9): [True: 7.65M, False: 11.7M]
  ------------------
  353|  7.65M|      highbd_wht_fwd_txfm(tx_size, src_diff, src_stride, coeff);
  354|  11.7M|    } else {
  355|  11.7M|      wht_fwd_txfm(tx_size, src_diff, src_stride, coeff);
  356|  11.7M|    }
  357|       |#else
  358|       |    wht_fwd_txfm(tx_size, src_diff, src_stride, coeff);
  359|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
  360|  19.4M|  } else {
  361|  11.0M|    TxfmParam txfm_param;
  362|  11.0M|    txfm_param.tx_type = DCT_DCT;
  363|  11.0M|    txfm_param.tx_size = tx_size;
  364|  11.0M|    txfm_param.lossless = 0;
  365|  11.0M|    txfm_param.bd = bd_info.bit_depth;
  366|  11.0M|    txfm_param.is_hbd = bd_info.use_highbitdepth_buf;
  367|  11.0M|    txfm_param.tx_set_type = EXT_TX_SET_ALL16;
  368|  11.0M|    av1_fwd_txfm(src_diff, coeff, src_stride, &txfm_param);
  369|  11.0M|  }
  370|  30.4M|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_64x64:
  226|  1.34k|                                  int diff_stride, TxfmParam *txfm_param) {
  227|       |  assert(txfm_param->tx_type == DCT_DCT);
  228|  1.34k|  int32_t *dst_coeff = (int32_t *)coeff;
  229|  1.34k|  const int bd = txfm_param->bd;
  230|  1.34k|  av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, DCT_DCT, bd);
  231|  1.34k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_32x64:
  190|  1.47k|                                  int diff_stride, TxfmParam *txfm_param) {
  191|       |  assert(txfm_param->tx_type == DCT_DCT);
  192|  1.47k|  int32_t *dst_coeff = (int32_t *)coeff;
  193|  1.47k|  const int bd = txfm_param->bd;
  194|  1.47k|  av1_fwd_txfm2d_32x64(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
  195|  1.47k|                       bd);
  196|  1.47k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_64x32:
  199|  1.66k|                                  int diff_stride, TxfmParam *txfm_param) {
  200|       |  assert(txfm_param->tx_type == DCT_DCT);
  201|  1.66k|  int32_t *dst_coeff = (int32_t *)coeff;
  202|  1.66k|  const int bd = txfm_param->bd;
  203|  1.66k|  av1_fwd_txfm2d_64x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
  204|  1.66k|                       bd);
  205|  1.66k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_32x32:
  182|  20.6k|                                  int diff_stride, TxfmParam *txfm_param) {
  183|  20.6k|  int32_t *dst_coeff = (int32_t *)coeff;
  184|  20.6k|  const TX_TYPE tx_type = txfm_param->tx_type;
  185|  20.6k|  const int bd = txfm_param->bd;
  186|  20.6k|  av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd);
  187|  20.6k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_16x16:
  174|   188k|                                  int diff_stride, TxfmParam *txfm_param) {
  175|   188k|  int32_t *dst_coeff = (int32_t *)coeff;
  176|   188k|  const TX_TYPE tx_type = txfm_param->tx_type;
  177|   188k|  const int bd = txfm_param->bd;
  178|   188k|  av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
  179|   188k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_8x8:
  166|  8.85M|                                int diff_stride, TxfmParam *txfm_param) {
  167|  8.85M|  int32_t *dst_coeff = (int32_t *)coeff;
  168|  8.85M|  const TX_TYPE tx_type = txfm_param->tx_type;
  169|  8.85M|  const int bd = txfm_param->bd;
  170|  8.85M|  av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
  171|  8.85M|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_4x8:
   92|  3.82M|                                int diff_stride, TxfmParam *txfm_param) {
   93|  3.82M|  int32_t *dst_coeff = (int32_t *)coeff;
   94|  3.82M|  av1_fwd_txfm2d_4x8(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
   95|  3.82M|                     txfm_param->bd);
   96|  3.82M|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_8x4:
   99|  2.96M|                                int diff_stride, TxfmParam *txfm_param) {
  100|  2.96M|  int32_t *dst_coeff = (int32_t *)coeff;
  101|  2.96M|  av1_fwd_txfm2d_8x4(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
  102|  2.96M|                     txfm_param->bd);
  103|  2.96M|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_8x16:
  106|   423k|                                 int diff_stride, TxfmParam *txfm_param) {
  107|   423k|  int32_t *dst_coeff = (int32_t *)coeff;
  108|   423k|  const TX_TYPE tx_type = txfm_param->tx_type;
  109|   423k|  const int bd = txfm_param->bd;
  110|   423k|  av1_fwd_txfm2d_8x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
  111|   423k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_16x8:
  114|   418k|                                 int diff_stride, TxfmParam *txfm_param) {
  115|   418k|  int32_t *dst_coeff = (int32_t *)coeff;
  116|   418k|  const TX_TYPE tx_type = txfm_param->tx_type;
  117|   418k|  const int bd = txfm_param->bd;
  118|   418k|  av1_fwd_txfm2d_16x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
  119|   418k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_16x32:
  122|  16.2k|                                  int diff_stride, TxfmParam *txfm_param) {
  123|  16.2k|  int32_t *dst_coeff = (int32_t *)coeff;
  124|  16.2k|  av1_fwd_txfm2d_16x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
  125|  16.2k|                       txfm_param->bd);
  126|  16.2k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_32x16:
  129|  22.5k|                                  int diff_stride, TxfmParam *txfm_param) {
  130|  22.5k|  int32_t *dst_coeff = (int32_t *)coeff;
  131|  22.5k|  av1_fwd_txfm2d_32x16(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
  132|  22.5k|                       txfm_param->bd);
  133|  22.5k|}
hybrid_fwd_txfm.c:highbd_fwd_txfm_4x4:
   79|  31.7M|                                int diff_stride, TxfmParam *txfm_param) {
   80|  31.7M|  int32_t *dst_coeff = (int32_t *)coeff;
   81|  31.7M|  const TX_TYPE tx_type = txfm_param->tx_type;
   82|  31.7M|  const int bd = txfm_param->bd;
   83|  31.7M|  if (txfm_param->lossless) {
  ------------------
  |  Branch (83:7): [True: 4.27M, False: 27.4M]
  ------------------
   84|  4.27M|    assert(tx_type == DCT_DCT);
   85|  4.27M|    av1_fwht4x4(src_diff, coeff, diff_stride);
   86|  4.27M|    return;
   87|  4.27M|  }
   88|  27.4M|  av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd);
   89|  27.4M|}
hybrid_fwd_txfm.c:highbd_wht_fwd_txfm:
  318|  7.65M|                                       tran_low_t *coeff) {
  319|  7.65M|  switch (tx_size) {
  320|       |    // As the output transform co-efficients of 4x4 Hadamard transform can be
  321|       |    // represented using 15 bits (for 12-bit clip) use lowbd variant of
  322|       |    // hadamard_4x4.
  323|  5.56M|    case TX_4X4: aom_hadamard_4x4(src_diff, src_stride, coeff); break;
  ------------------
  |  |  571|  5.56M|#define aom_hadamard_4x4 aom_hadamard_4x4_sse2
  ------------------
  |  Branch (323:5): [True: 5.56M, False: 2.08M]
  ------------------
  324|  1.96M|    case TX_8X8: aom_highbd_hadamard_8x8(src_diff, src_stride, coeff); break;
  ------------------
  |  Branch (324:5): [True: 1.96M, False: 5.68M]
  ------------------
  325|   114k|    case TX_16X16:
  ------------------
  |  Branch (325:5): [True: 114k, False: 7.53M]
  ------------------
  326|   114k|      aom_highbd_hadamard_16x16(src_diff, src_stride, coeff);
  327|   114k|      break;
  328|  6.18k|    case TX_32X32:
  ------------------
  |  Branch (328:5): [True: 6.18k, False: 7.64M]
  ------------------
  329|  6.18k|      aom_highbd_hadamard_32x32(src_diff, src_stride, coeff);
  330|  6.18k|      break;
  331|      0|    default: assert(0);
  ------------------
  |  Branch (331:5): [True: 0, False: 7.65M]
  ------------------
  332|  7.65M|  }
  333|  7.65M|}
hybrid_fwd_txfm.c:wht_fwd_txfm:
  337|  11.7M|                                ptrdiff_t src_stride, tran_low_t *coeff) {
  338|  11.7M|  switch (tx_size) {
  339|    163|    case TX_4X4: aom_hadamard_4x4(src_diff, src_stride, coeff); break;
  ------------------
  |  |  571|    163|#define aom_hadamard_4x4 aom_hadamard_4x4_sse2
  ------------------
  |  Branch (339:5): [True: 163, False: 11.7M]
  ------------------
  340|  11.1M|    case TX_8X8: aom_hadamard_8x8(src_diff, src_stride, coeff); break;
  ------------------
  |  |  575|  11.1M|#define aom_hadamard_8x8 aom_hadamard_8x8_sse2
  ------------------
  |  Branch (340:5): [True: 11.1M, False: 628k]
  ------------------
  341|   562k|    case TX_16X16: aom_hadamard_16x16(src_diff, src_stride, coeff); break;
  ------------------
  |  Branch (341:5): [True: 562k, False: 11.2M]
  ------------------
  342|  67.9k|    case TX_32X32: aom_hadamard_32x32(src_diff, src_stride, coeff); break;
  ------------------
  |  Branch (342:5): [True: 67.9k, False: 11.6M]
  ------------------
  343|      0|    default: assert(0);
  ------------------
  |  Branch (343:5): [True: 0, False: 11.7M]
  ------------------
  344|  11.7M|  }
  345|  11.7M|}

av1_count_colors:
  321|  57.9k|                      int *val_count, int *num_colors) {
  322|  57.9k|  const int max_pix_val = 1 << 8;
  323|  57.9k|  memset(val_count, 0, max_pix_val * sizeof(val_count[0]));
  324|   985k|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (324:19): [True: 927k, False: 57.9k]
  ------------------
  325|  15.7M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (325:21): [True: 14.8M, False: 927k]
  ------------------
  326|  14.8M|      const int this_val = src[r * stride + c];
  327|  14.8M|      assert(this_val < max_pix_val);
  328|  14.8M|      ++val_count[this_val];
  329|  14.8M|    }
  330|   927k|  }
  331|  57.9k|  int n = 0;
  332|  14.8M|  for (int i = 0; i < max_pix_val; ++i) {
  ------------------
  |  Branch (332:19): [True: 14.8M, False: 57.9k]
  ------------------
  333|  14.8M|    if (val_count[i]) ++n;
  ------------------
  |  Branch (333:9): [True: 9.15M, False: 5.67M]
  ------------------
  334|  14.8M|  }
  335|  57.9k|  *num_colors = n;
  336|  57.9k|}
av1_count_colors_highbd:
  341|   252k|                             int *num_colors) {
  342|   252k|  assert(bit_depth <= 12);
  343|   252k|  const int max_bin_val = 1 << 8;
  344|   252k|  const int max_pix_val = 1 << bit_depth;
  345|   252k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|   252k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  346|   252k|  memset(bin_val_count, 0, max_bin_val * sizeof(val_count[0]));
  347|   252k|  if (val_count != NULL)
  ------------------
  |  Branch (347:7): [True: 246k, False: 5.71k]
  ------------------
  348|   246k|    memset(val_count, 0, max_pix_val * sizeof(val_count[0]));
  349|  2.24M|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (349:19): [True: 1.99M, False: 252k]
  ------------------
  350|  18.1M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (350:21): [True: 16.1M, False: 1.99M]
  ------------------
  351|       |      /*
  352|       |       * Down-convert the pixels to 8-bit domain before counting.
  353|       |       * This provides consistency of behavior for palette search
  354|       |       * between lbd and hbd encodes. This down-converted pixels
  355|       |       * are only used for calculating the threshold (n).
  356|       |       */
  357|  16.1M|      const int this_val = ((src[r * stride + c]) >> (bit_depth - 8));
  358|  16.1M|      assert(this_val < max_bin_val);
  359|  16.1M|      if (this_val >= max_bin_val) continue;
  ------------------
  |  Branch (359:11): [True: 0, False: 16.1M]
  ------------------
  360|  16.1M|      ++bin_val_count[this_val];
  361|  16.1M|      if (val_count != NULL) ++val_count[(src[r * stride + c])];
  ------------------
  |  Branch (361:11): [True: 14.6M, False: 1.46M]
  ------------------
  362|  16.1M|    }
  363|  1.99M|  }
  364|   252k|  int n = 0;
  365|       |  // Count the colors based on 8-bit domain used to gate the palette path
  366|  64.7M|  for (int i = 0; i < max_bin_val; ++i) {
  ------------------
  |  Branch (366:19): [True: 64.5M, False: 252k]
  ------------------
  367|  64.5M|    if (bin_val_count[i]) ++n;
  ------------------
  |  Branch (367:9): [True: 5.92M, False: 58.6M]
  ------------------
  368|  64.5M|  }
  369|   252k|  *num_color_bins = n;
  370|       |
  371|       |  // Count the actual hbd colors used to create top_colors
  372|   252k|  n = 0;
  373|   252k|  if (val_count != NULL) {
  ------------------
  |  Branch (373:7): [True: 246k, False: 5.70k]
  ------------------
  374|   624M|    for (int i = 0; i < max_pix_val; ++i) {
  ------------------
  |  Branch (374:21): [True: 623M, False: 246k]
  ------------------
  375|   623M|      if (val_count[i]) ++n;
  ------------------
  |  Branch (375:11): [True: 6.63M, False: 617M]
  ------------------
  376|   623M|    }
  377|   246k|    *num_colors = n;
  378|   246k|  }
  379|   252k|}
av1_count_colors_with_threshold:
  383|   122k|                                     int *num_colors) {
  384|   122k|  bool has_color[1 << 8] = { false };
  385|   122k|  *num_colors = 0;
  386|       |
  387|   620k|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (387:19): [True: 608k, False: 11.6k]
  ------------------
  388|  9.71M|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (388:21): [True: 9.21M, False: 498k]
  ------------------
  389|  9.21M|      const int this_val = src[r * stride + c];
  390|  9.21M|      if (!has_color[this_val]) {
  ------------------
  |  Branch (390:11): [True: 4.73M, False: 4.47M]
  ------------------
  391|  4.73M|        has_color[this_val] = true;
  392|  4.73M|        (*num_colors)++;
  393|  4.73M|        if (*num_colors > num_colors_threshold) {
  ------------------
  |  Branch (393:13): [True: 110k, False: 4.62M]
  ------------------
  394|       |          // We're over the threshold, so we can exit early
  395|   110k|          return false;
  396|   110k|        }
  397|  4.73M|      }
  398|  9.21M|    }
  399|   608k|  }
  400|  11.6k|  return true;
  401|   122k|}
set_y_mode_and_delta_angle:
  404|   139M|                                int reorder_delta_angle_eval) {
  405|   139M|  if (mode_idx < INTRA_MODE_END) {
  ------------------
  |  Branch (405:7): [True: 29.7M, False: 109M]
  ------------------
  406|  29.7M|    mbmi->mode = intra_rd_search_mode_order[mode_idx];
  407|  29.7M|    mbmi->angle_delta[PLANE_TYPE_Y] = 0;
  408|   109M|  } else {
  409|   109M|    mbmi->mode = (mode_idx - INTRA_MODE_END) / (MAX_ANGLE_DELTA * 2) + V_PRED;
  ------------------
  |  |  467|   109M|#define MAX_ANGLE_DELTA 3
  ------------------
  410|   109M|    int delta_angle_eval_idx =
  411|   109M|        (mode_idx - INTRA_MODE_END) % (MAX_ANGLE_DELTA * 2);
  ------------------
  |  |  467|   109M|#define MAX_ANGLE_DELTA 3
  ------------------
  412|   109M|    if (reorder_delta_angle_eval) {
  ------------------
  |  Branch (412:9): [True: 0, False: 109M]
  ------------------
  413|      0|      mbmi->angle_delta[PLANE_TYPE_Y] =
  414|      0|          luma_delta_angles_order[delta_angle_eval_idx];
  415|   109M|    } else {
  416|   109M|      mbmi->angle_delta[PLANE_TYPE_Y] =
  417|   109M|          (delta_angle_eval_idx < 3 ? (delta_angle_eval_idx - 3)
  ------------------
  |  Branch (417:12): [True: 54.8M, False: 54.5M]
  ------------------
  418|   109M|                                    : (delta_angle_eval_idx - 2));
  419|   109M|    }
  420|   109M|  }
  421|   139M|}
av1_rd_pick_intra_sbuv_mode:
  867|  1.05M|                                    BLOCK_SIZE bsize, TX_SIZE max_tx_size) {
  868|  1.05M|  const AV1_COMMON *const cm = &cpi->common;
  869|  1.05M|  MACROBLOCKD *xd = &x->e_mbd;
  870|  1.05M|  MB_MODE_INFO *mbmi = xd->mi[0];
  871|  1.05M|  assert(!is_inter_block(mbmi));
  872|  1.05M|  MB_MODE_INFO best_mbmi = *mbmi;
  873|  1.05M|  int64_t best_rd = INT64_MAX, this_rd;
  874|  1.05M|  const ModeCosts *mode_costs = &x->mode_costs;
  875|  1.05M|  const IntraModeCfg *const intra_mode_cfg = &cpi->oxcf.intra_mode_cfg;
  876|       |
  877|  1.05M|  init_sbuv_mode(mbmi);
  878|       |
  879|       |  // Return if the current block does not correspond to a chroma block.
  880|  1.05M|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (880:7): [True: 117k, False: 934k]
  ------------------
  881|   117k|    *rate = 0;
  882|   117k|    *rate_tokenonly = 0;
  883|   117k|    *distortion = 0;
  884|   117k|    *skippable = 1;
  885|   117k|    return INT64_MAX;
  886|   117k|  }
  887|       |
  888|       |  // Only store reconstructed luma when there's chroma RDO. When there's no
  889|       |  // chroma RDO, the reconstructed luma will be stored in encode_superblock().
  890|   934k|  xd->cfl.store_y = store_cfl_required_rdo(cm, x);
  891|   934k|  if (xd->cfl.store_y) {
  ------------------
  |  Branch (891:7): [True: 924k, False: 9.79k]
  ------------------
  892|       |    // Restore reconstructed luma values.
  893|       |    // TODO(chiyotsai@google.com): right now we are re-computing the txfm in
  894|       |    // this function everytime we search through uv modes. There is some
  895|       |    // potential speed up here if we cache the result to avoid redundant
  896|       |    // computation.
  897|   924k|    av1_encode_intra_block_plane(cpi, x, mbmi->bsize, AOM_PLANE_Y,
  ------------------
  |  |  281|   924k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  898|   924k|                                 DRY_RUN_NORMAL,
  899|   924k|                                 cpi->optimize_seg_arr[mbmi->segment_id]);
  900|   924k|    xd->cfl.store_y = 0;
  901|   924k|  }
  902|   934k|  IntraModeSearchState intra_search_state;
  903|   934k|  init_intra_mode_search_state(&intra_search_state);
  904|   934k|  const CFL_ALLOWED_TYPE cfl_allowed = is_cfl_allowed(xd);
  905|       |
  906|       |  // Search through all non-palette modes.
  907|  14.0M|  for (int mode_idx = 0; mode_idx < UV_INTRA_MODES; ++mode_idx) {
  ------------------
  |  Branch (907:26): [True: 13.0M, False: 934k]
  ------------------
  908|  13.0M|    int this_rate;
  909|  13.0M|    RD_STATS tokenonly_rd_stats;
  910|  13.0M|    UV_PREDICTION_MODE uv_mode = uv_rd_search_mode_order[mode_idx];
  911|       |
  912|       |    // Skip the current mode evaluation if the RD cost derived using the mode
  913|       |    // signaling rate exceeds the best_rd so far.
  914|  13.0M|    const int mode_rate =
  915|  13.0M|        mode_costs->intra_uv_mode_cost[cfl_allowed][mbmi->mode][uv_mode];
  916|  13.0M|    if (RDCOST(x->rdmult, mode_rate, 0) > best_rd) continue;
  ------------------
  |  |   33|  13.0M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  13.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  13.0M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  13.0M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (916:9): [True: 6.70k, False: 13.0M]
  ------------------
  917|       |
  918|  13.0M|    PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
  919|  13.0M|    const int is_diagonal_mode = av1_is_diagonal_mode(intra_mode);
  920|  13.0M|    const int is_directional_mode = av1_is_directional_mode(intra_mode);
  921|       |
  922|  13.0M|    if (is_diagonal_mode && !cpi->oxcf.intra_mode_cfg.enable_diagonal_intra)
  ------------------
  |  Branch (922:9): [True: 5.60M, False: 7.46M]
  |  Branch (922:29): [True: 0, False: 5.60M]
  ------------------
  923|      0|      continue;
  924|  13.0M|    if (is_directional_mode &&
  ------------------
  |  Branch (924:9): [True: 7.46M, False: 5.59M]
  ------------------
  925|  7.46M|        !cpi->oxcf.intra_mode_cfg.enable_directional_intra)
  ------------------
  |  Branch (925:9): [True: 0, False: 7.46M]
  ------------------
  926|      0|      continue;
  927|       |
  928|  13.0M|    if (!(cpi->sf.intra_sf.intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] &
  ------------------
  |  Branch (928:9): [True: 606k, False: 12.4M]
  ------------------
  929|  13.0M|          (1 << uv_mode)))
  930|   606k|      continue;
  931|  12.4M|    if (!intra_mode_cfg->enable_smooth_intra && uv_mode >= UV_SMOOTH_PRED &&
  ------------------
  |  Branch (931:9): [True: 0, False: 12.4M]
  |  Branch (931:49): [True: 0, False: 0]
  ------------------
  932|      0|        uv_mode <= UV_SMOOTH_H_PRED)
  ------------------
  |  Branch (932:9): [True: 0, False: 0]
  ------------------
  933|      0|      continue;
  934|       |
  935|  12.4M|    if (!intra_mode_cfg->enable_paeth_intra && uv_mode == UV_PAETH_PRED)
  ------------------
  |  Branch (935:9): [True: 0, False: 12.4M]
  |  Branch (935:48): [True: 0, False: 0]
  ------------------
  936|      0|      continue;
  937|       |
  938|  12.4M|    assert(mbmi->mode < INTRA_MODES);
  939|  12.4M|    if (cpi->sf.intra_sf.prune_chroma_modes_using_luma_winner &&
  ------------------
  |  Branch (939:9): [True: 0, False: 12.4M]
  ------------------
  940|      0|        !(av1_derived_chroma_intra_mode_used_flag[mbmi->mode] & (1 << uv_mode)))
  ------------------
  |  Branch (940:9): [True: 0, False: 0]
  ------------------
  941|      0|      continue;
  942|       |
  943|  12.4M|    mbmi->uv_mode = uv_mode;
  944|       |
  945|       |    // Init variables for cfl and angle delta
  946|  12.4M|    const SPEED_FEATURES *sf = &cpi->sf;
  947|  12.4M|    mbmi->angle_delta[PLANE_TYPE_UV] = 0;
  948|  12.4M|    if (uv_mode == UV_CFL_PRED) {
  ------------------
  |  Branch (948:9): [True: 930k, False: 11.5M]
  ------------------
  949|   930k|      if (!cfl_allowed || !intra_mode_cfg->enable_cfl_intra) continue;
  ------------------
  |  Branch (949:11): [True: 8.32k, False: 922k]
  |  Branch (949:27): [True: 18.4E, False: 922k]
  ------------------
  950|   930k|      assert(!is_directional_mode);
  951|   922k|      const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd);
  ------------------
  |  |  282|   922k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  952|   922k|      if (!cfl_rd_pick_alpha(x, cpi, uv_tx_size, best_rd,
  ------------------
  |  Branch (952:11): [True: 361k, False: 560k]
  ------------------
  953|   922k|                             sf->intra_sf.cfl_search_range, &tokenonly_rd_stats,
  954|   922k|                             &mbmi->cfl_alpha_idx, &mbmi->cfl_alpha_signs)) {
  955|   361k|        continue;
  956|   361k|      }
  957|  11.5M|    } else if (is_directional_mode && av1_use_angle_delta(mbmi->bsize) &&
  ------------------
  |  Branch (957:16): [True: 7.08M, False: 4.43M]
  |  Branch (957:39): [True: 5.56M, False: 1.52M]
  ------------------
  958|  5.56M|               intra_mode_cfg->enable_angle_delta) {
  ------------------
  |  Branch (958:16): [True: 5.56M, False: 18.4E]
  ------------------
  959|  5.56M|      if (sf->intra_sf.chroma_intra_pruning_with_hog &&
  ------------------
  |  Branch (959:11): [True: 5.56M, False: 18.4E]
  ------------------
  960|  5.56M|          !intra_search_state.dir_mode_skip_mask_ready) {
  ------------------
  |  Branch (960:11): [True: 719k, False: 4.84M]
  ------------------
  961|   719k|        static const float thresh[2][4] = {
  962|   719k|          { -1.2f, 0.0f, 0.0f, 1.2f },    // Interframe
  963|   719k|          { -1.2f, -1.2f, -0.6f, 0.4f },  // Intraframe
  964|   719k|        };
  965|   719k|        const int is_chroma = 1;
  966|   719k|        const int is_intra_frame = frame_is_intra_only(cm);
  967|   719k|        prune_intra_mode_with_hog(
  968|   719k|            x, bsize, cm->seq_params->sb_size,
  969|   719k|            thresh[is_intra_frame]
  970|   719k|                  [sf->intra_sf.chroma_intra_pruning_with_hog - 1],
  971|   719k|            intra_search_state.directional_mode_skip_mask, is_chroma);
  972|   719k|        intra_search_state.dir_mode_skip_mask_ready = 1;
  973|   719k|      }
  974|  5.56M|      if (intra_search_state.directional_mode_skip_mask[uv_mode]) {
  ------------------
  |  Branch (974:11): [True: 4.76M, False: 799k]
  ------------------
  975|  4.76M|        continue;
  976|  4.76M|      }
  977|       |
  978|       |      // Search through angle delta
  979|   799k|      const int rate_overhead =
  980|   799k|          mode_costs->intra_uv_mode_cost[cfl_allowed][mbmi->mode][uv_mode];
  981|   799k|      if (!rd_pick_intra_angle_sbuv(cpi, x, bsize, rate_overhead, best_rd,
  ------------------
  |  Branch (981:11): [True: 730k, False: 69.2k]
  ------------------
  982|   799k|                                    &this_rate, &tokenonly_rd_stats))
  983|   730k|        continue;
  984|  5.95M|    } else {
  985|  5.95M|      if (uv_mode == UV_SMOOTH_PRED &&
  ------------------
  |  Branch (985:11): [True: 879k, False: 5.07M]
  ------------------
  986|   879k|          should_prune_chroma_smooth_pred_based_on_source_variance(cpi, x,
  ------------------
  |  Branch (986:11): [True: 0, False: 879k]
  ------------------
  987|   879k|                                                                   bsize))
  988|      0|        continue;
  989|       |
  990|       |      // Predict directly if we don't need to search for angle delta.
  991|  5.95M|      if (!av1_txfm_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd)) {
  ------------------
  |  Branch (991:11): [True: 3.89M, False: 2.06M]
  ------------------
  992|  3.89M|        continue;
  993|  3.89M|      }
  994|  5.95M|    }
  995|  2.69M|    const int mode_cost =
  996|  2.69M|        mode_costs->intra_uv_mode_cost[cfl_allowed][mbmi->mode][uv_mode];
  997|  2.69M|    this_rate = tokenonly_rd_stats.rate +
  998|  2.69M|                intra_mode_info_cost_uv(cpi, x, mbmi, bsize, mode_cost);
  999|  2.69M|    this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist);
  ------------------
  |  |   33|  2.69M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  2.69M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  2.69M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  2.69M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1000|       |
 1001|  2.69M|    if (this_rd < best_rd) {
  ------------------
  |  Branch (1001:9): [True: 1.87M, False: 817k]
  ------------------
 1002|  1.87M|      best_mbmi = *mbmi;
 1003|  1.87M|      best_rd = this_rd;
 1004|  1.87M|      *rate = this_rate;
 1005|  1.87M|      *rate_tokenonly = tokenonly_rd_stats.rate;
 1006|  1.87M|      *distortion = tokenonly_rd_stats.dist;
 1007|  1.87M|      *skippable = tokenonly_rd_stats.skip_txfm;
 1008|  1.87M|    }
 1009|  2.69M|  }
 1010|       |
 1011|       |  // Search palette mode
 1012|   934k|  const int try_palette =
 1013|   934k|      cpi->oxcf.tool_cfg.enable_palette &&
  ------------------
  |  Branch (1013:7): [True: 934k, False: 18.4E]
  ------------------
 1014|   934k|      av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  ------------------
  |  Branch (1014:7): [True: 76.6k, False: 858k]
  ------------------
 1015|   934k|                        mbmi->bsize);
 1016|   934k|  if (try_palette) {
  ------------------
  |  Branch (1016:7): [True: 76.6k, False: 858k]
  ------------------
 1017|  76.6k|    uint8_t *best_palette_color_map = x->palette_buffer->best_palette_color_map;
 1018|  76.6k|    av1_rd_pick_palette_intra_sbuv(
 1019|  76.6k|        cpi, x,
 1020|  76.6k|        mode_costs->intra_uv_mode_cost[cfl_allowed][mbmi->mode][UV_DC_PRED],
 1021|  76.6k|        best_palette_color_map, &best_mbmi, &best_rd, rate, rate_tokenonly,
 1022|  76.6k|        distortion, skippable);
 1023|  76.6k|  }
 1024|       |
 1025|   934k|  *mbmi = best_mbmi;
 1026|       |  // Make sure we actually chose a mode
 1027|       |  assert(best_rd < INT64_MAX);
 1028|   934k|  return best_rd;
 1029|  1.05M|}
av1_search_palette_mode:
 1036|  76.3k|                            int64_t best_rd) {
 1037|  76.3k|  const AV1_COMMON *const cm = &cpi->common;
 1038|  76.3k|  MB_MODE_INFO *const mbmi = x->e_mbd.mi[0];
 1039|  76.3k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 1040|  76.3k|  const int num_planes = av1_num_planes(cm);
 1041|  76.3k|  MACROBLOCKD *const xd = &x->e_mbd;
 1042|  76.3k|  int rate2 = 0;
 1043|  76.3k|  int64_t distortion2 = 0, best_rd_palette = best_rd, this_rd;
 1044|  76.3k|  int skippable = 0;
 1045|  76.3k|  uint8_t *const best_palette_color_map =
 1046|  76.3k|      x->palette_buffer->best_palette_color_map;
 1047|  76.3k|  uint8_t *const color_map = xd->plane[0].color_index_map;
 1048|  76.3k|  MB_MODE_INFO best_mbmi_palette = *mbmi;
 1049|  76.3k|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 1050|  76.3k|  const ModeCosts *mode_costs = &x->mode_costs;
 1051|  76.3k|  const int *const intra_mode_cost =
 1052|  76.3k|      mode_costs->mbmode_cost[size_group_lookup[bsize]];
 1053|  76.3k|  const int rows = block_size_high[bsize];
 1054|  76.3k|  const int cols = block_size_wide[bsize];
 1055|       |
 1056|  76.3k|  mbmi->mode = DC_PRED;
 1057|  76.3k|  mbmi->uv_mode = UV_DC_PRED;
 1058|  76.3k|  mbmi->ref_frame[0] = INTRA_FRAME;
 1059|  76.3k|  mbmi->ref_frame[1] = NONE_FRAME;
 1060|  76.3k|  av1_zero(pmi->palette_size);
  ------------------
  |  |   43|  76.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1061|       |
 1062|  76.3k|  RD_STATS rd_stats_y;
 1063|  76.3k|  av1_invalid_rd_stats(&rd_stats_y);
 1064|  76.3k|  av1_rd_pick_palette_intra_sby(
 1065|  76.3k|      cpi, x, bsize, intra_mode_cost[DC_PRED], &best_mbmi_palette,
 1066|  76.3k|      best_palette_color_map, &best_rd_palette, &rd_stats_y.rate, NULL,
 1067|  76.3k|      &rd_stats_y.dist, &rd_stats_y.skip_txfm, NULL, ctx, best_tx_type_map);
 1068|  76.3k|  if (rd_stats_y.rate == INT_MAX || pmi->palette_size[0] == 0) {
  ------------------
  |  Branch (1068:7): [True: 11.2k, False: 65.1k]
  |  Branch (1068:37): [True: 0, False: 65.1k]
  ------------------
 1069|  11.2k|    this_rd_cost->rdcost = INT64_MAX;
 1070|  11.2k|    return skippable;
 1071|  11.2k|  }
 1072|       |
 1073|  65.1k|  av1_copy_array(xd->tx_type_map, best_tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  65.1k|  do {                                                    \
  |  |   39|  65.1k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  65.1k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  65.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 65.1k]
  |  |  ------------------
  ------------------
 1074|  65.1k|  memcpy(color_map, best_palette_color_map,
 1075|  65.1k|         rows * cols * sizeof(best_palette_color_map[0]));
 1076|       |
 1077|  65.1k|  skippable = rd_stats_y.skip_txfm;
 1078|  65.1k|  distortion2 = rd_stats_y.dist;
 1079|  65.1k|  rate2 = rd_stats_y.rate + ref_frame_cost;
 1080|  65.1k|  if (num_planes > 1) {
  ------------------
  |  Branch (1080:7): [True: 54.0k, False: 11.0k]
  ------------------
 1081|  54.0k|    if (intra_search_state->rate_uv_intra == INT_MAX) {
  ------------------
  |  Branch (1081:9): [True: 0, False: 54.0k]
  ------------------
 1082|       |      // We have not found any good uv mode yet, so we need to search for it.
 1083|      0|      TX_SIZE uv_tx = av1_get_tx_size(AOM_PLANE_U, xd);
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 1084|      0|      av1_rd_pick_intra_sbuv_mode(cpi, x, &intra_search_state->rate_uv_intra,
 1085|      0|                                  &intra_search_state->rate_uv_tokenonly,
 1086|      0|                                  &intra_search_state->dist_uvs,
 1087|      0|                                  &intra_search_state->skip_uvs, bsize, uv_tx);
 1088|      0|      intra_search_state->mode_uv = mbmi->uv_mode;
 1089|      0|      intra_search_state->pmi_uv = *pmi;
 1090|      0|      intra_search_state->uv_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV];
 1091|      0|    }
 1092|       |
 1093|       |    // We have found at least one good uv mode before, so copy and paste it
 1094|       |    // over.
 1095|  54.0k|    mbmi->uv_mode = intra_search_state->mode_uv;
 1096|  54.0k|    pmi->palette_size[1] = intra_search_state->pmi_uv.palette_size[1];
 1097|  54.0k|    if (pmi->palette_size[1] > 0) {
  ------------------
  |  Branch (1097:9): [True: 27.8k, False: 26.2k]
  ------------------
 1098|  27.8k|      memcpy(pmi->palette_colors + PALETTE_MAX_SIZE,
  ------------------
  |  |   63|  27.8k|#define PALETTE_MAX_SIZE 8
  ------------------
 1099|  27.8k|             intra_search_state->pmi_uv.palette_colors + PALETTE_MAX_SIZE,
  ------------------
  |  |   63|  27.8k|#define PALETTE_MAX_SIZE 8
  ------------------
 1100|  27.8k|             2 * PALETTE_MAX_SIZE * sizeof(pmi->palette_colors[0]));
  ------------------
  |  |   63|  27.8k|#define PALETTE_MAX_SIZE 8
  ------------------
 1101|  27.8k|    }
 1102|  54.0k|    mbmi->angle_delta[PLANE_TYPE_UV] = intra_search_state->uv_angle_delta;
 1103|  54.0k|    skippable = skippable && intra_search_state->skip_uvs;
  ------------------
  |  Branch (1103:17): [True: 0, False: 54.0k]
  |  Branch (1103:30): [True: 0, False: 0]
  ------------------
 1104|  54.0k|    distortion2 += intra_search_state->dist_uvs;
 1105|  54.0k|    rate2 += intra_search_state->rate_uv_intra;
 1106|  54.0k|  }
 1107|       |
 1108|  65.1k|  if (skippable) {
  ------------------
  |  Branch (1108:7): [True: 0, False: 65.1k]
  ------------------
 1109|      0|    rate2 -= rd_stats_y.rate;
 1110|      0|    if (num_planes > 1) rate2 -= intra_search_state->rate_uv_tokenonly;
  ------------------
  |  Branch (1110:9): [True: 0, False: 0]
  ------------------
 1111|      0|    rate2 += mode_costs->skip_txfm_cost[av1_get_skip_txfm_context(xd)][1];
 1112|  65.1k|  } else {
 1113|  65.1k|    rate2 += mode_costs->skip_txfm_cost[av1_get_skip_txfm_context(xd)][0];
 1114|  65.1k|  }
 1115|  65.1k|  this_rd = RDCOST(x->rdmult, rate2, distortion2);
  ------------------
  |  |   33|  65.1k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  65.1k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  65.1k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  65.1k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1116|  65.1k|  this_rd_cost->rate = rate2;
 1117|  65.1k|  this_rd_cost->dist = distortion2;
 1118|  65.1k|  this_rd_cost->rdcost = this_rd;
 1119|  65.1k|  return skippable;
 1120|  76.3k|}
av1_handle_intra_y_mode:
 1298|  87.4M|                            int64_t top_intra_model_rd[]) {
 1299|  87.4M|  const AV1_COMMON *cm = &cpi->common;
 1300|  87.4M|  const INTRA_MODE_SPEED_FEATURES *const intra_sf = &cpi->sf.intra_sf;
 1301|  87.4M|  MACROBLOCKD *const xd = &x->e_mbd;
 1302|  87.4M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1303|  87.4M|  assert(mbmi->ref_frame[0] == INTRA_FRAME);
 1304|  87.4M|  const PREDICTION_MODE mode = mbmi->mode;
 1305|  87.4M|  const ModeCosts *mode_costs = &x->mode_costs;
 1306|  87.4M|  const int mode_cost =
 1307|  87.4M|      mode_costs->mbmode_cost[size_group_lookup[bsize]][mode] + ref_frame_cost;
 1308|  87.4M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 1309|  87.4M|  int known_rate = mode_cost + mode_costs->skip_txfm_cost[skip_ctx][0];
 1310|  87.4M|  const int64_t known_rd = RDCOST(x->rdmult, known_rate, 0);
  ------------------
  |  |   33|  87.4M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  87.4M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  87.4M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  87.4M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1311|  87.4M|  if (known_rd > best_rd) {
  ------------------
  |  Branch (1311:7): [True: 113k, False: 87.3M]
  ------------------
 1312|   113k|    intra_search_state->skip_intra_modes = 1;
 1313|   113k|    return 0;
 1314|   113k|  }
 1315|       |
 1316|  87.3M|  const int is_directional_mode = av1_is_directional_mode(mode);
 1317|  87.3M|  if (is_directional_mode && av1_use_angle_delta(bsize) &&
  ------------------
  |  Branch (1317:7): [True: 83.6M, False: 3.63M]
  |  Branch (1317:30): [True: 80.5M, False: 3.08M]
  ------------------
 1318|  80.6M|      cpi->oxcf.intra_mode_cfg.enable_angle_delta) {
  ------------------
  |  Branch (1318:7): [True: 80.6M, False: 18.4E]
  ------------------
 1319|  80.6M|    if (intra_sf->intra_pruning_with_hog &&
  ------------------
  |  Branch (1319:9): [True: 80.6M, False: 635]
  ------------------
 1320|  80.6M|        !intra_search_state->dir_mode_skip_mask_ready) {
  ------------------
  |  Branch (1320:9): [True: 1.44M, False: 79.1M]
  ------------------
 1321|  1.44M|      const float thresh[4] = { -1.2f, 0.0f, 0.0f, 1.2f };
 1322|  1.44M|      const int is_chroma = 0;
 1323|  1.44M|      prune_intra_mode_with_hog(x, bsize, cm->seq_params->sb_size,
 1324|  1.44M|                                thresh[intra_sf->intra_pruning_with_hog - 1],
 1325|  1.44M|                                intra_search_state->directional_mode_skip_mask,
 1326|  1.44M|                                is_chroma);
 1327|  1.44M|      intra_search_state->dir_mode_skip_mask_ready = 1;
 1328|  1.44M|    }
 1329|  80.6M|    if (intra_search_state->directional_mode_skip_mask[mode]) return 0;
  ------------------
  |  Branch (1329:9): [True: 77.6M, False: 2.96M]
  ------------------
 1330|  80.6M|  }
 1331|  9.66M|  const TX_SIZE tx_size = AOMMIN(TX_32X32, max_txsize_lookup[bsize]);
  ------------------
  |  |   34|  9.66M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.64k, False: 9.66M]
  |  |  ------------------
  ------------------
 1332|  9.66M|  const int64_t this_model_rd =
 1333|  9.66M|      intra_model_rd(&cpi->common, x, 0, bsize, tx_size, /*use_hadamard=*/1,
 1334|  9.66M|                     cpi->do_border_pad);
 1335|       |
 1336|  9.66M|  const int model_rd_index_for_pruning =
 1337|  9.66M|      get_model_rd_index_for_pruning(x, intra_sf);
 1338|       |
 1339|  9.66M|  if (prune_intra_y_mode(this_model_rd, best_model_rd, top_intra_model_rd,
  ------------------
  |  Branch (1339:7): [True: 4.06M, False: 5.60M]
  ------------------
 1340|  9.66M|                         intra_sf->top_intra_model_count_allowed,
 1341|  9.66M|                         model_rd_index_for_pruning))
 1342|  4.06M|    return 0;
 1343|  5.60M|  av1_init_rd_stats(rd_stats_y);
 1344|  5.60M|  av1_pick_uniform_tx_size_type_yrd(cpi, x, rd_stats_y, bsize, best_rd);
 1345|       |
 1346|       |  // Pick filter intra modes.
 1347|  5.60M|  if (mode == DC_PRED && av1_filter_intra_allowed_bsize(cm, bsize)) {
  ------------------
  |  Branch (1347:7): [True: 1.84M, False: 3.75M]
  |  Branch (1347:26): [True: 1.84M, False: 2.54k]
  ------------------
 1348|  1.84M|    int try_filter_intra = 1;
 1349|  1.84M|    int64_t best_rd_so_far = INT64_MAX;
 1350|  1.84M|    if (rd_stats_y->rate != INT_MAX) {
  ------------------
  |  Branch (1350:9): [True: 1.66M, False: 177k]
  ------------------
 1351|       |      // best_rd_so_far is the rdcost of DC_PRED without using filter_intra.
 1352|       |      // Later, in filter intra search, best_rd_so_far is used for comparison.
 1353|  1.66M|      mbmi->filter_intra_mode_info.use_filter_intra = 0;
 1354|  1.66M|      const int tmp_rate =
 1355|  1.66M|          rd_stats_y->rate +
 1356|  1.66M|          intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost, 0);
 1357|  1.66M|      best_rd_so_far = RDCOST(x->rdmult, tmp_rate, rd_stats_y->dist);
  ------------------
  |  |   33|  1.66M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.66M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.66M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.66M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1358|  1.66M|      try_filter_intra = (best_rd_so_far / 2) <= best_rd;
 1359|  1.66M|    } else if (intra_sf->skip_filter_intra_in_inter_frames >= 1) {
  ------------------
  |  Branch (1359:16): [True: 177k, False: 18.4E]
  ------------------
 1360|       |      // As rd cost of luma intra dc mode is more than best_rd (i.e.,
 1361|       |      // rd_stats_y->rate = INT_MAX), skip the evaluation of filter intra modes.
 1362|   177k|      try_filter_intra = 0;
 1363|   177k|    }
 1364|       |
 1365|  1.84M|    if (try_filter_intra) {
  ------------------
  |  Branch (1365:9): [True: 1.66M, False: 177k]
  ------------------
 1366|  1.66M|      handle_filter_intra_mode(cpi, x, bsize, ctx, rd_stats_y, mode_cost,
 1367|  1.66M|                               best_rd, best_rd_so_far);
 1368|  1.66M|    }
 1369|  1.84M|  }
 1370|       |
 1371|  5.60M|  if (rd_stats_y->rate == INT_MAX) return 0;
  ------------------
  |  Branch (1371:7): [True: 882k, False: 4.71M]
  ------------------
 1372|       |
 1373|  4.71M|  *mode_cost_y = intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost, 0);
 1374|  4.71M|  const int rate_y = rd_stats_y->skip_txfm
  ------------------
  |  Branch (1374:22): [True: 0, False: 4.71M]
  ------------------
 1375|  4.71M|                         ? mode_costs->skip_txfm_cost[skip_ctx][1]
 1376|  4.71M|                         : rd_stats_y->rate;
 1377|  4.71M|  *rd_y = RDCOST(x->rdmult, rate_y + *mode_cost_y, rd_stats_y->dist);
  ------------------
  |  |   33|  4.71M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.71M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.71M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.71M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1378|  4.78M|  if (best_rd < (INT64_MAX / 2) && *rd_y > (best_rd + (best_rd >> 2))) {
  ------------------
  |  Branch (1378:7): [True: 4.78M, False: 18.4E]
  |  Branch (1378:36): [True: 25.3k, False: 4.76M]
  ------------------
 1379|  25.3k|    intra_search_state->skip_intra_modes = 1;
 1380|  25.3k|    return 0;
 1381|  25.3k|  }
 1382|       |
 1383|  4.69M|  return 1;
 1384|  4.71M|}
av1_search_intra_uv_modes_in_interframe:
 1389|   865k|    const RD_STATS *rd_stats_y, RD_STATS *rd_stats_uv, int64_t best_rd) {
 1390|   865k|  const AV1_COMMON *cm = &cpi->common;
 1391|   865k|  MACROBLOCKD *const xd = &x->e_mbd;
 1392|   865k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1393|   865k|  assert(mbmi->ref_frame[0] == INTRA_FRAME);
 1394|       |
 1395|       |  // TODO(chiyotsai@google.com): Consolidate the chroma search code here with
 1396|       |  // the one in av1_search_palette_mode.
 1397|   865k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 1398|   865k|  const int try_palette =
 1399|   865k|      cpi->oxcf.tool_cfg.enable_palette &&
  ------------------
  |  Branch (1399:7): [True: 865k, False: 18.4E]
  ------------------
 1400|   865k|      av1_allow_palette(cm->features.allow_screen_content_tools, mbmi->bsize);
  ------------------
  |  Branch (1400:7): [True: 64.5k, False: 801k]
  ------------------
 1401|   865k|  assert(intra_search_state->rate_uv_intra == INT_MAX);
 1402|       |  // If no good uv-predictor had been found, search for it.
 1403|   865k|  const TX_SIZE uv_tx = av1_get_tx_size(AOM_PLANE_U, xd);
  ------------------
  |  |  282|   865k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 1404|   865k|  av1_rd_pick_intra_sbuv_mode(cpi, x, &intra_search_state->rate_uv_intra,
 1405|   865k|                              &intra_search_state->rate_uv_tokenonly,
 1406|   865k|                              &intra_search_state->dist_uvs,
 1407|   865k|                              &intra_search_state->skip_uvs, bsize, uv_tx);
 1408|   865k|  intra_search_state->mode_uv = mbmi->uv_mode;
 1409|   865k|  if (try_palette) intra_search_state->pmi_uv = *pmi;
  ------------------
  |  Branch (1409:7): [True: 64.5k, False: 801k]
  ------------------
 1410|   865k|  intra_search_state->uv_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV];
 1411|       |
 1412|   865k|  const int uv_rate = intra_search_state->rate_uv_tokenonly;
 1413|   865k|  const int64_t uv_dist = intra_search_state->dist_uvs;
 1414|   865k|  const int64_t uv_rd = RDCOST(x->rdmult, uv_rate, uv_dist);
  ------------------
  |  |   33|   865k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   865k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   865k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   865k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1415|   865k|  if (uv_rd > best_rd) {
  ------------------
  |  Branch (1415:7): [True: 32.0k, False: 833k]
  ------------------
 1416|       |    // If there is no good intra uv-mode available, we can skip all intra
 1417|       |    // modes.
 1418|  32.0k|    intra_search_state->skip_intra_modes = 1;
 1419|  32.0k|    return 0;
 1420|  32.0k|  }
 1421|       |
 1422|       |  // If we are here, then the encoder has found at least one good intra uv
 1423|       |  // predictor, so we can directly copy its statistics over.
 1424|       |  // TODO(any): the stats here is not right if the best uv mode is CFL but the
 1425|       |  // best y mode is palette.
 1426|   833k|  rd_stats_uv->rate = intra_search_state->rate_uv_tokenonly;
 1427|   833k|  rd_stats_uv->dist = intra_search_state->dist_uvs;
 1428|   833k|  rd_stats_uv->skip_txfm = intra_search_state->skip_uvs;
 1429|   833k|  rd_stats->skip_txfm = rd_stats_y->skip_txfm && rd_stats_uv->skip_txfm;
  ------------------
  |  Branch (1429:25): [True: 0, False: 833k]
  |  Branch (1429:50): [True: 0, False: 0]
  ------------------
 1430|   833k|  mbmi->uv_mode = intra_search_state->mode_uv;
 1431|   833k|  if (try_palette) {
  ------------------
  |  Branch (1431:7): [True: 63.9k, False: 769k]
  ------------------
 1432|  63.9k|    pmi->palette_size[1] = intra_search_state->pmi_uv.palette_size[1];
 1433|  63.9k|    memcpy(pmi->palette_colors + PALETTE_MAX_SIZE,
  ------------------
  |  |   63|  63.9k|#define PALETTE_MAX_SIZE 8
  ------------------
 1434|  63.9k|           intra_search_state->pmi_uv.palette_colors + PALETTE_MAX_SIZE,
  ------------------
  |  |   63|  63.9k|#define PALETTE_MAX_SIZE 8
  ------------------
 1435|  63.9k|           2 * PALETTE_MAX_SIZE * sizeof(pmi->palette_colors[0]));
  ------------------
  |  |   63|  63.9k|#define PALETTE_MAX_SIZE 8
  ------------------
 1436|  63.9k|  }
 1437|   833k|  mbmi->angle_delta[PLANE_TYPE_UV] = intra_search_state->uv_angle_delta;
 1438|       |
 1439|   833k|  return 1;
 1440|   865k|}
av1_rd_pick_intra_sby_mode:
 1473|   439k|                                   PICK_MODE_CONTEXT *ctx) {
 1474|   439k|  MACROBLOCKD *const xd = &x->e_mbd;
 1475|   439k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1476|   439k|  assert(!is_inter_block(mbmi));
 1477|   439k|  int64_t best_model_rd = INT64_MAX;
 1478|   439k|  int is_directional_mode;
 1479|   439k|  uint8_t directional_mode_skip_mask[INTRA_MODES] = { 0 };
 1480|       |  // Flag to check rd of any intra mode is better than best_rd passed to this
 1481|       |  // function
 1482|   439k|  int beat_best_rd = 0;
 1483|   439k|  const int *bmode_costs;
 1484|   439k|  const IntraModeCfg *const intra_mode_cfg = &cpi->oxcf.intra_mode_cfg;
 1485|   439k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 1486|   439k|  const int try_palette =
 1487|   439k|      cpi->oxcf.tool_cfg.enable_palette &&
  ------------------
  |  Branch (1487:7): [True: 439k, False: 18.4E]
  ------------------
 1488|   439k|      av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  ------------------
  |  Branch (1488:7): [True: 16.7k, False: 422k]
  ------------------
 1489|   439k|                        mbmi->bsize);
 1490|   439k|  uint8_t *best_palette_color_map =
 1491|   439k|      try_palette ? x->palette_buffer->best_palette_color_map : NULL;
  ------------------
  |  Branch (1491:7): [True: 16.7k, False: 422k]
  ------------------
 1492|   439k|  const MB_MODE_INFO *above_mi = xd->above_mbmi;
 1493|   439k|  const MB_MODE_INFO *left_mi = xd->left_mbmi;
 1494|   439k|  const PREDICTION_MODE A = av1_above_block_mode(above_mi);
 1495|   439k|  const PREDICTION_MODE L = av1_left_block_mode(left_mi);
 1496|   439k|  const int above_ctx = intra_mode_context[A];
 1497|   439k|  const int left_ctx = intra_mode_context[L];
 1498|   439k|  bmode_costs = x->mode_costs.y_mode_costs[above_ctx][left_ctx];
 1499|       |
 1500|   439k|  mbmi->angle_delta[PLANE_TYPE_Y] = 0;
 1501|   439k|  const INTRA_MODE_SPEED_FEATURES *const intra_sf = &cpi->sf.intra_sf;
 1502|   439k|  if (intra_sf->intra_pruning_with_hog) {
  ------------------
  |  Branch (1502:7): [True: 413k, False: 25.9k]
  ------------------
 1503|       |    // Less aggressive thresholds are used here than those used in inter frame
 1504|       |    // encoding in av1_handle_intra_y_mode() because we want key frames/intra
 1505|       |    // frames to have higher quality.
 1506|   413k|    const float thresh[4] = { -1.2f, -1.2f, -0.6f, 0.4f };
 1507|   413k|    const int is_chroma = 0;
 1508|   413k|    prune_intra_mode_with_hog(x, bsize, cpi->common.seq_params->sb_size,
 1509|   413k|                              thresh[intra_sf->intra_pruning_with_hog - 1],
 1510|   413k|                              directional_mode_skip_mask, is_chroma);
 1511|   413k|  }
 1512|   439k|  mbmi->filter_intra_mode_info.use_filter_intra = 0;
 1513|   439k|  pmi->palette_size[0] = 0;
 1514|       |
 1515|       |  // Set params for mode evaluation
 1516|   439k|  set_mode_eval_params(cpi, x, MODE_EVAL);
 1517|       |
 1518|   439k|  MB_MODE_INFO best_mbmi = *mbmi;
 1519|   439k|  const int max_winner_mode_count =
 1520|   439k|      winner_mode_count_allowed[cpi->sf.winner_mode_sf.multi_winner_mode_type];
 1521|   439k|  zero_winner_mode_stats(bsize, max_winner_mode_count, x->winner_mode_stats);
 1522|   439k|  x->winner_mode_count = 0;
 1523|       |
 1524|       |  // Searches the intra-modes except for intrabc, palette, and filter_intra.
 1525|   439k|  int64_t top_intra_model_rd[TOP_INTRA_MODEL_COUNT];
 1526|  2.19M|  for (int i = 0; i < TOP_INTRA_MODEL_COUNT; i++) {
  ------------------
  |  |  391|  2.19M|#define TOP_INTRA_MODEL_COUNT 4
  ------------------
  |  Branch (1526:19): [True: 1.75M, False: 439k]
  ------------------
 1527|  1.75M|    top_intra_model_rd[i] = INT64_MAX;
 1528|  1.75M|  }
 1529|       |
 1530|       |  // Initialize the rdcost corresponding to all the directional and
 1531|       |  // non-directional intra modes.
 1532|       |  // 1. For directional modes, it stores the rdcost values for delta angles -4,
 1533|       |  // -3, ..., 3, 4.
 1534|       |  // 2. The rdcost value for luma_delta_angle is stored at index
 1535|       |  // luma_delta_angle + MAX_ANGLE_DELTA + 1.
 1536|       |  // 3. The rdcost values for fictitious/nonexistent luma_delta_angle -4 and 4
 1537|       |  // (array indices 0 and 8) are always set to INT64_MAX (the initial value).
 1538|   439k|  int64_t intra_modes_rd_cost[INTRA_MODE_END]
 1539|   439k|                             [SIZE_OF_ANGLE_DELTA_RD_COST_ARRAY];
 1540|  6.15M|  for (int i = 0; i < INTRA_MODE_END; i++) {
  ------------------
  |  Branch (1540:19): [True: 5.71M, False: 439k]
  ------------------
 1541|  57.1M|    for (int j = 0; j < SIZE_OF_ANGLE_DELTA_RD_COST_ARRAY; j++) {
  ------------------
  |  |   26|  57.1M|#define SIZE_OF_ANGLE_DELTA_RD_COST_ARRAY (2 * MAX_ANGLE_DELTA + 3)
  |  |  ------------------
  |  |  |  |  467|  57.1M|#define MAX_ANGLE_DELTA 3
  |  |  ------------------
  ------------------
  |  Branch (1541:21): [True: 51.4M, False: 5.71M]
  ------------------
 1542|  51.4M|      intra_modes_rd_cost[i][j] = INT64_MAX;
 1543|  51.4M|    }
 1544|  5.71M|  }
 1545|       |
 1546|  27.1M|  for (int mode_idx = INTRA_MODE_START; mode_idx < LUMA_MODE_COUNT;
  ------------------
  |  |  395|  27.1M|#define LUMA_MODE_COUNT (PAETH_PRED - DC_PRED + 1 + 6 * 8)
  ------------------
  |  Branch (1546:41): [True: 26.7M, False: 439k]
  ------------------
 1547|  26.7M|       ++mode_idx) {
 1548|  26.7M|    set_y_mode_and_delta_angle(mode_idx, mbmi,
 1549|  26.7M|                               intra_sf->prune_luma_odd_delta_angles_in_intra);
 1550|  26.7M|    RD_STATS this_rd_stats;
 1551|  26.7M|    int this_rate, this_rate_tokenonly, s;
 1552|  26.7M|    int is_diagonal_mode;
 1553|  26.7M|    int64_t this_distortion, this_rd;
 1554|  26.7M|    const int luma_delta_angle = mbmi->angle_delta[PLANE_TYPE_Y];
 1555|       |
 1556|  26.7M|    is_diagonal_mode = av1_is_diagonal_mode(mbmi->mode);
 1557|  26.7M|    if (is_diagonal_mode && !intra_mode_cfg->enable_diagonal_intra) continue;
  ------------------
  |  Branch (1557:9): [True: 18.4M, False: 8.30M]
  |  Branch (1557:29): [True: 0, False: 18.4M]
  ------------------
 1558|  26.7M|    if (av1_is_directional_mode(mbmi->mode) &&
  ------------------
  |  Branch (1558:9): [True: 24.5M, False: 2.19M]
  ------------------
 1559|  24.5M|        !intra_mode_cfg->enable_directional_intra)
  ------------------
  |  Branch (1559:9): [True: 0, False: 24.5M]
  ------------------
 1560|      0|      continue;
 1561|       |
 1562|       |    // The smooth prediction mode appears to be more frequently picked
 1563|       |    // than horizontal / vertical smooth prediction modes. Hence treat
 1564|       |    // them differently in speed features.
 1565|  26.7M|    if ((!intra_mode_cfg->enable_smooth_intra ||
  ------------------
  |  Branch (1565:10): [True: 8.08k, False: 26.7M]
  ------------------
 1566|  26.7M|         intra_sf->disable_smooth_intra) &&
  ------------------
  |  Branch (1566:10): [True: 26.7M, False: 0]
  ------------------
 1567|  26.7M|        (mbmi->mode == SMOOTH_H_PRED || mbmi->mode == SMOOTH_V_PRED))
  ------------------
  |  Branch (1567:10): [True: 437k, False: 26.2M]
  |  Branch (1567:41): [True: 436k, False: 25.8M]
  ------------------
 1568|   879k|      continue;
 1569|  25.8M|    if (!intra_mode_cfg->enable_smooth_intra && mbmi->mode == SMOOTH_PRED)
  ------------------
  |  Branch (1569:9): [True: 0, False: 25.8M]
  |  Branch (1569:49): [True: 0, False: 0]
  ------------------
 1570|      0|      continue;
 1571|       |
 1572|       |    // The functionality of filter intra modes and smooth prediction
 1573|       |    // overlap. Hence smooth prediction is pruned only if all the
 1574|       |    // filter intra modes are enabled.
 1575|  25.8M|    if (intra_sf->disable_smooth_intra &&
  ------------------
  |  Branch (1575:9): [True: 25.8M, False: 3.04k]
  ------------------
 1576|  25.8M|        intra_sf->prune_filter_intra_level == 0 && mbmi->mode == SMOOTH_PRED)
  ------------------
  |  Branch (1576:9): [True: 25.8M, False: 18.4E]
  |  Branch (1576:52): [True: 439k, False: 25.4M]
  ------------------
 1577|   439k|      continue;
 1578|  25.4M|    if (!intra_mode_cfg->enable_paeth_intra && mbmi->mode == PAETH_PRED)
  ------------------
  |  Branch (1578:9): [True: 0, False: 25.4M]
  |  Branch (1578:48): [True: 0, False: 0]
  ------------------
 1579|      0|      continue;
 1580|       |
 1581|       |    // Skip the evaluation of modes that do not match with the winner mode in
 1582|       |    // x->mb_mode_cache.
 1583|  25.4M|    if (x->use_mb_mode_cache && mbmi->mode != x->mb_mode_cache->mode) continue;
  ------------------
  |  Branch (1583:9): [True: 0, False: 25.4M]
  |  Branch (1583:33): [True: 0, False: 0]
  ------------------
 1584|       |
 1585|  25.4M|    is_directional_mode = av1_is_directional_mode(mbmi->mode);
 1586|  25.4M|    if (is_directional_mode && directional_mode_skip_mask[mbmi->mode]) continue;
  ------------------
  |  Branch (1586:9): [True: 24.5M, False: 879k]
  |  Branch (1586:32): [True: 19.5M, False: 4.99M]
  ------------------
 1587|  5.87M|    if (is_directional_mode &&
  ------------------
  |  Branch (1587:9): [True: 5.01M, False: 865k]
  ------------------
 1588|  5.01M|        !(av1_use_angle_delta(bsize) && intra_mode_cfg->enable_angle_delta) &&
  ------------------
  |  Branch (1588:11): [True: 4.32M, False: 685k]
  |  Branch (1588:41): [True: 4.32M, False: 18.4E]
  ------------------
 1589|   682k|        luma_delta_angle != 0)
  ------------------
  |  Branch (1589:9): [True: 584k, False: 97.4k]
  ------------------
 1590|   584k|      continue;
 1591|       |
 1592|       |    // Use intra_y_mode_mask speed feature to skip intra mode evaluation.
 1593|  5.29M|    if (!(intra_sf->intra_y_mode_mask[max_txsize_lookup[bsize]] &
  ------------------
  |  Branch (1593:9): [True: 81.0k, False: 5.21M]
  ------------------
 1594|  5.29M|          (1 << mbmi->mode)))
 1595|  81.0k|      continue;
 1596|       |
 1597|  5.21M|    if (prune_luma_odd_delta_angles_using_rd_cost(
  ------------------
  |  Branch (1597:9): [True: 0, False: 5.21M]
  ------------------
 1598|  5.21M|            mbmi, intra_modes_rd_cost[mbmi->mode], best_rd,
 1599|  5.21M|            intra_sf->prune_luma_odd_delta_angles_in_intra))
 1600|      0|      continue;
 1601|       |
 1602|  5.21M|    const TX_SIZE tx_size = AOMMIN(TX_32X32, max_txsize_lookup[bsize]);
  ------------------
  |  |   34|  5.21M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.15k, False: 5.21M]
  |  |  ------------------
  ------------------
 1603|  5.21M|    const int64_t this_model_rd =
 1604|  5.21M|        intra_model_rd(&cpi->common, x, 0, bsize, tx_size, /*use_hadamard=*/1,
 1605|  5.21M|                       cpi->do_border_pad);
 1606|       |
 1607|  5.21M|    const int model_rd_index_for_pruning =
 1608|  5.21M|        get_model_rd_index_for_pruning(x, intra_sf);
 1609|       |
 1610|  5.21M|    if (prune_intra_y_mode(this_model_rd, &best_model_rd, top_intra_model_rd,
  ------------------
  |  Branch (1610:9): [True: 2.70M, False: 2.50M]
  ------------------
 1611|  5.21M|                           intra_sf->top_intra_model_count_allowed,
 1612|  5.21M|                           model_rd_index_for_pruning))
 1613|  2.70M|      continue;
 1614|       |
 1615|       |    // Builds the actual prediction. The prediction from
 1616|       |    // model_intra_yrd_and_prune was just an estimation that did not take into
 1617|       |    // account the effect of txfm pipeline, so we need to redo it for real
 1618|       |    // here.
 1619|  2.50M|    av1_pick_uniform_tx_size_type_yrd(cpi, x, &this_rd_stats, bsize, best_rd);
 1620|  2.50M|    this_rate_tokenonly = this_rd_stats.rate;
 1621|  2.50M|    this_distortion = this_rd_stats.dist;
 1622|  2.50M|    s = this_rd_stats.skip_txfm;
 1623|       |
 1624|  2.50M|    if (this_rate_tokenonly == INT_MAX) continue;
  ------------------
  |  Branch (1624:9): [True: 1.33M, False: 1.16M]
  ------------------
 1625|       |
 1626|  1.18M|    if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->bsize)) {
  ------------------
  |  Branch (1626:9): [True: 1.18M, False: 18.4E]
  |  Branch (1626:44): [True: 1.10M, False: 77.9k]
  ------------------
 1627|       |      // av1_pick_uniform_tx_size_type_yrd above includes the cost of the
 1628|       |      // tx_size in the tokenonly rate, but for intra blocks, tx_size is always
 1629|       |      // coded (prediction granularity), so we account for it in the full rate,
 1630|       |      // not the tokenonly rate.
 1631|  1.10M|      this_rate_tokenonly -= tx_size_cost(x, bsize, mbmi->tx_size);
 1632|  1.10M|    }
 1633|  1.16M|    this_rate =
 1634|  1.16M|        this_rd_stats.rate +
 1635|  1.16M|        intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode], 0);
 1636|  1.16M|    this_rd = RDCOST(x->rdmult, this_rate, this_distortion);
  ------------------
  |  |   33|  1.16M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.16M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.16M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.16M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1637|       |
 1638|       |    // Visual quality adjustment based on recon vs source variance.
 1639|  1.16M|    if ((cpi->oxcf.mode == ALLINTRA) && (this_rd != INT64_MAX)) {
  ------------------
  |  Branch (1639:9): [True: 0, False: 1.16M]
  |  Branch (1639:41): [True: 0, False: 0]
  ------------------
 1640|      0|      this_rd = (int64_t)(this_rd * intra_rd_variance_factor(cpi, x, bsize));
 1641|      0|    }
 1642|       |
 1643|  1.16M|    intra_modes_rd_cost[mbmi->mode][luma_delta_angle + MAX_ANGLE_DELTA + 1] =
  ------------------
  |  |  467|  1.16M|#define MAX_ANGLE_DELTA 3
  ------------------
 1644|  1.16M|        this_rd;
 1645|       |
 1646|       |    // Collect mode stats for multiwinner mode processing
 1647|  1.16M|    const int txfm_search_done = 1;
 1648|  1.16M|    store_winner_mode_stats(
 1649|  1.16M|        cpi, x, mbmi, NULL, NULL, NULL, 0, NULL, bsize, this_rd,
 1650|  1.16M|        cpi->sf.winner_mode_sf.multi_winner_mode_type, txfm_search_done);
 1651|  1.16M|    if (this_rd < best_rd) {
  ------------------
  |  Branch (1651:9): [True: 567k, False: 597k]
  ------------------
 1652|   567k|      best_mbmi = *mbmi;
 1653|   567k|      best_rd = this_rd;
 1654|       |      // Setting beat_best_rd flag because current mode rd is better than
 1655|       |      // best_rd passed to this function
 1656|   567k|      beat_best_rd = 1;
 1657|   567k|      *rate = this_rate;
 1658|   567k|      *rate_tokenonly = this_rate_tokenonly;
 1659|   567k|      *distortion = this_distortion;
 1660|   567k|      *skippable = s;
 1661|   567k|      av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   567k|  do {                                                    \
  |  |   39|   567k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   567k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   567k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 567k]
  |  |  ------------------
  ------------------
 1662|   567k|    }
 1663|  1.16M|  }
 1664|       |
 1665|       |  // Searches palette
 1666|   439k|  if (try_palette) {
  ------------------
  |  Branch (1666:7): [True: 16.7k, False: 422k]
  ------------------
 1667|  16.7k|    av1_rd_pick_palette_intra_sby(cpi, x, bsize, bmode_costs[DC_PRED],
 1668|  16.7k|                                  &best_mbmi, best_palette_color_map, &best_rd,
 1669|  16.7k|                                  rate, rate_tokenonly, distortion, skippable,
 1670|  16.7k|                                  &beat_best_rd, ctx, ctx->tx_type_map);
 1671|  16.7k|  }
 1672|       |
 1673|       |  // Searches filter_intra
 1674|   439k|  if (beat_best_rd && av1_filter_intra_allowed_bsize(&cpi->common, bsize)) {
  ------------------
  |  Branch (1674:7): [True: 381k, False: 58.5k]
  |  Branch (1674:23): [True: 378k, False: 2.88k]
  ------------------
 1675|   378k|    if (rd_pick_filter_intra_sby(cpi, x, rate, rate_tokenonly, distortion,
  ------------------
  |  Branch (1675:9): [True: 158k, False: 219k]
  ------------------
 1676|   378k|                                 skippable, bsize, bmode_costs[DC_PRED],
 1677|   378k|                                 best_mbmi.mode, &best_rd, &best_model_rd,
 1678|   378k|                                 ctx)) {
 1679|   158k|      best_mbmi = *mbmi;
 1680|   158k|    }
 1681|   378k|  }
 1682|       |
 1683|       |  // No mode is identified with less rd value than best_rd passed to this
 1684|       |  // function. In such cases winner mode processing is not necessary and return
 1685|       |  // best_rd as INT64_MAX to indicate best mode is not identified
 1686|   439k|  if (!beat_best_rd) return INT64_MAX;
  ------------------
  |  Branch (1686:7): [True: 58.6k, False: 381k]
  ------------------
 1687|       |
 1688|       |  // In multi-winner mode processing, perform tx search for few best modes
 1689|       |  // identified during mode evaluation. Winner mode processing uses best tx
 1690|       |  // configuration for tx search.
 1691|   381k|  if (cpi->sf.winner_mode_sf.multi_winner_mode_type) {
  ------------------
  |  Branch (1691:7): [True: 0, False: 381k]
  ------------------
 1692|      0|    int best_mode_idx = 0;
 1693|      0|    int block_width, block_height;
 1694|      0|    uint8_t *color_map_dst = xd->plane[PLANE_TYPE_Y].color_index_map;
 1695|      0|    av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1696|      0|                             &block_height, NULL, NULL);
 1697|       |
 1698|      0|    for (int mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++) {
  ------------------
  |  Branch (1698:28): [True: 0, False: 0]
  ------------------
 1699|      0|      *mbmi = x->winner_mode_stats[mode_idx].mbmi;
 1700|      0|      if (is_winner_mode_processing_enabled(cpi, x, mbmi, 0)) {
  ------------------
  |  Branch (1700:11): [True: 0, False: 0]
  ------------------
 1701|       |        // Restore color_map of palette mode before winner mode processing
 1702|      0|        if (mbmi->palette_mode_info.palette_size[0] > 0) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 0]
  ------------------
 1703|      0|          uint8_t *color_map_src =
 1704|      0|              x->winner_mode_stats[mode_idx].color_index_map;
 1705|      0|          memcpy(color_map_dst, color_map_src,
 1706|      0|                 block_width * block_height * sizeof(*color_map_src));
 1707|      0|        }
 1708|       |        // Set params for winner mode evaluation
 1709|      0|        set_mode_eval_params(cpi, x, WINNER_MODE_EVAL);
 1710|       |
 1711|       |        // Winner mode processing
 1712|       |        // If previous searches use only the default tx type/no R-D optimization
 1713|       |        // of quantized coeffs, do an extra search for the best tx type/better
 1714|       |        // R-D optimization of quantized coeffs
 1715|      0|        if (intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate,
  ------------------
  |  Branch (1715:13): [True: 0, False: 0]
  ------------------
 1716|      0|                            rate_tokenonly, distortion, skippable, &best_mbmi,
 1717|      0|                            ctx))
 1718|      0|          best_mode_idx = mode_idx;
 1719|      0|      }
 1720|      0|    }
 1721|       |    // Copy color_map of palette mode for final winner mode
 1722|      0|    if (best_mbmi.palette_mode_info.palette_size[0] > 0) {
  ------------------
  |  Branch (1722:9): [True: 0, False: 0]
  ------------------
 1723|      0|      uint8_t *color_map_src =
 1724|      0|          x->winner_mode_stats[best_mode_idx].color_index_map;
 1725|      0|      memcpy(color_map_dst, color_map_src,
 1726|      0|             block_width * block_height * sizeof(*color_map_src));
 1727|      0|    }
 1728|   381k|  } else {
 1729|       |    // If previous searches use only the default tx type/no R-D optimization of
 1730|       |    // quantized coeffs, do an extra search for the best tx type/better R-D
 1731|       |    // optimization of quantized coeffs
 1732|   381k|    if (is_winner_mode_processing_enabled(cpi, x, mbmi, 0)) {
  ------------------
  |  Branch (1732:9): [True: 381k, False: 18.4E]
  ------------------
 1733|       |      // Set params for winner mode evaluation
 1734|   381k|      set_mode_eval_params(cpi, x, WINNER_MODE_EVAL);
 1735|   381k|      *mbmi = best_mbmi;
 1736|   381k|      intra_block_yrd(cpi, x, bsize, bmode_costs, &best_rd, rate,
 1737|   381k|                      rate_tokenonly, distortion, skippable, &best_mbmi, ctx);
 1738|   381k|    }
 1739|   381k|  }
 1740|   381k|  *mbmi = best_mbmi;
 1741|       |  av1_copy_array(xd->tx_type_map, ctx->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   381k|  do {                                                    \
  |  |   39|   381k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   381k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   381k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 381k]
  |  |  ------------------
  ------------------
 1742|   381k|  return best_rd;
 1743|   439k|}
intra_mode_search.c:cfl_rd_pick_alpha:
  749|   922k|                             int8_t *best_cfl_alpha_signs) {
  750|   922k|  assert(cfl_search_range >= 1 && cfl_search_range <= CFL_MAGS_SIZE);
  751|   922k|  const ModeCosts *mode_costs = &x->mode_costs;
  752|   922k|  RD_STATS cfl_rd_arr_u[CFL_MAGS_SIZE];
  753|   922k|  RD_STATS cfl_rd_arr_v[CFL_MAGS_SIZE];
  754|   922k|  MACROBLOCKD *const xd = &x->e_mbd;
  755|   922k|  int est_best_cfl_idx_u, est_best_cfl_idx_v;
  756|       |
  757|   922k|  av1_invalid_rd_stats(best_rd_stats);
  758|       |
  759|       |  // As the dc pred data is same for different values of alpha, enable the
  760|       |  // caching of dc pred data. Call clear_cfl_dc_pred_cache_flags() before
  761|       |  // returning to avoid the unintentional usage of cached dc pred data.
  762|   922k|  xd->cfl.use_dc_pred_cache = true;
  763|       |  // Evaluate alpha parameter of each chroma plane.
  764|   922k|  est_best_cfl_idx_u =
  765|   922k|      cfl_pick_plane_parameter(cpi, x, 1, tx_size, cfl_search_range);
  766|   922k|  est_best_cfl_idx_v =
  767|   922k|      cfl_pick_plane_parameter(cpi, x, 2, tx_size, cfl_search_range);
  768|       |
  769|   922k|  if (cfl_search_range == 1) {
  ------------------
  |  Branch (769:7): [True: 0, False: 922k]
  ------------------
  770|       |    // For cfl_search_range=1, further refinement of alpha is not enabled. Hence
  771|       |    // CfL index=0 for both the chroma planes implies invalid CfL mode.
  772|      0|    if (est_best_cfl_idx_u == CFL_INDEX_ZERO &&
  ------------------
  |  |  259|      0|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|      0|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|      0|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (772:9): [True: 0, False: 0]
  ------------------
  773|      0|        est_best_cfl_idx_v == CFL_INDEX_ZERO) {
  ------------------
  |  |  259|      0|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|      0|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|      0|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (773:9): [True: 0, False: 0]
  ------------------
  774|      0|      set_invalid_cfl_parameters(best_cfl_alpha_idx, best_cfl_alpha_signs);
  775|      0|      clear_cfl_dc_pred_cache_flags(&xd->cfl);
  776|      0|      return 0;
  777|      0|    }
  778|       |
  779|      0|    int cfl_alpha_u, cfl_alpha_v;
  780|      0|    CFL_SIGN_TYPE cfl_sign_u, cfl_sign_v;
  781|      0|    const MB_MODE_INFO *mbmi = xd->mi[0];
  782|      0|    cfl_idx_to_sign_and_alpha(est_best_cfl_idx_u, &cfl_sign_u, &cfl_alpha_u);
  783|      0|    cfl_idx_to_sign_and_alpha(est_best_cfl_idx_v, &cfl_sign_v, &cfl_alpha_v);
  784|      0|    const int joint_sign = cfl_sign_u * CFL_SIGNS + cfl_sign_v - 1;
  785|       |    // Compute alpha and mode signaling rate.
  786|      0|    const int rate_overhead =
  787|      0|        mode_costs->cfl_cost[joint_sign][CFL_PRED_U][cfl_alpha_u] +
  788|      0|        mode_costs->cfl_cost[joint_sign][CFL_PRED_V][cfl_alpha_v] +
  789|      0|        mode_costs
  790|      0|            ->intra_uv_mode_cost[is_cfl_allowed(xd)][mbmi->mode][UV_CFL_PRED];
  791|       |    // Skip the CfL mode evaluation if the RD cost derived using the rate needed
  792|       |    // to signal the CfL mode and alpha parameter exceeds the ref_best_rd.
  793|      0|    if (RDCOST(x->rdmult, rate_overhead, 0) > ref_best_rd) {
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (793:9): [True: 0, False: 0]
  ------------------
  794|      0|      set_invalid_cfl_parameters(best_cfl_alpha_idx, best_cfl_alpha_signs);
  795|      0|      clear_cfl_dc_pred_cache_flags(&xd->cfl);
  796|      0|      return 0;
  797|      0|    }
  798|      0|  }
  799|       |
  800|       |  // Compute the rd cost of each chroma plane using the alpha parameters which
  801|       |  // were already evaluated.
  802|   922k|  cfl_pick_plane_rd(cpi, x, 1, tx_size, cfl_search_range, cfl_rd_arr_u,
  803|   922k|                    est_best_cfl_idx_u);
  804|   922k|  cfl_pick_plane_rd(cpi, x, 2, tx_size, cfl_search_range, cfl_rd_arr_v,
  805|   922k|                    est_best_cfl_idx_v);
  806|       |
  807|   922k|  clear_cfl_dc_pred_cache_flags(&xd->cfl);
  808|       |
  809|  31.2M|  for (int ui = 0; ui < CFL_MAGS_SIZE; ++ui) {
  ------------------
  |  |  258|  31.2M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  31.2M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (809:20): [True: 30.3M, False: 922k]
  ------------------
  810|  30.3M|    if (cfl_rd_arr_u[ui].rate == INT_MAX) continue;
  ------------------
  |  Branch (810:9): [True: 25.8M, False: 4.56M]
  ------------------
  811|  4.56M|    int cfl_alpha_u;
  812|  4.56M|    CFL_SIGN_TYPE cfl_sign_u;
  813|  4.56M|    cfl_idx_to_sign_and_alpha(ui, &cfl_sign_u, &cfl_alpha_u);
  814|   155M|    for (int vi = 0; vi < CFL_MAGS_SIZE; ++vi) {
  ------------------
  |  |  258|   155M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|   155M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (814:22): [True: 150M, False: 4.56M]
  ------------------
  815|   150M|      if (cfl_rd_arr_v[vi].rate == INT_MAX) continue;
  ------------------
  |  Branch (815:11): [True: 127M, False: 22.6M]
  ------------------
  816|  22.6M|      int cfl_alpha_v;
  817|  22.6M|      CFL_SIGN_TYPE cfl_sign_v;
  818|  22.6M|      cfl_idx_to_sign_and_alpha(vi, &cfl_sign_v, &cfl_alpha_v);
  819|       |      // cfl_sign_u == CFL_SIGN_ZERO && cfl_sign_v == CFL_SIGN_ZERO is not a
  820|       |      // valid parameter for CFL
  821|  22.6M|      if (cfl_sign_u == CFL_SIGN_ZERO && cfl_sign_v == CFL_SIGN_ZERO) continue;
  ------------------
  |  Branch (821:11): [True: 2.64M, False: 20.0M]
  |  Branch (821:42): [True: 354k, False: 2.29M]
  ------------------
  822|  22.3M|      int joint_sign = cfl_sign_u * CFL_SIGNS + cfl_sign_v - 1;
  823|  22.3M|      RD_STATS rd_stats = cfl_rd_arr_u[ui];
  824|  22.3M|      av1_merge_rd_stats(&rd_stats, &cfl_rd_arr_v[vi]);
  825|  22.3M|      if (rd_stats.rate != INT_MAX) {
  ------------------
  |  Branch (825:11): [True: 22.3M, False: 18.4E]
  ------------------
  826|  22.3M|        rd_stats.rate +=
  827|  22.3M|            mode_costs->cfl_cost[joint_sign][CFL_PRED_U][cfl_alpha_u];
  828|  22.3M|        rd_stats.rate +=
  829|  22.3M|            mode_costs->cfl_cost[joint_sign][CFL_PRED_V][cfl_alpha_v];
  830|  22.3M|      }
  831|  22.3M|      av1_rd_cost_update(x->rdmult, &rd_stats);
  832|  22.3M|      if (rd_stats.rdcost < best_rd_stats->rdcost) {
  ------------------
  |  Branch (832:11): [True: 4.37M, False: 17.9M]
  ------------------
  833|  4.37M|        *best_rd_stats = rd_stats;
  834|  4.37M|        *best_cfl_alpha_idx =
  835|  4.37M|            (cfl_alpha_u << CFL_ALPHABET_SIZE_LOG2) + cfl_alpha_v;
  ------------------
  |  |  256|  4.37M|#define CFL_ALPHABET_SIZE_LOG2 4
  ------------------
  836|  4.37M|        *best_cfl_alpha_signs = joint_sign;
  837|  4.37M|      }
  838|  22.3M|    }
  839|  4.56M|  }
  840|   922k|  if (best_rd_stats->rdcost >= ref_best_rd) {
  ------------------
  |  Branch (840:7): [True: 361k, False: 560k]
  ------------------
  841|   361k|    av1_invalid_rd_stats(best_rd_stats);
  842|       |    // Set invalid CFL parameters here since the rdcost is not better than
  843|       |    // ref_best_rd.
  844|   361k|    set_invalid_cfl_parameters(best_cfl_alpha_idx, best_cfl_alpha_signs);
  845|   361k|    return 0;
  846|   361k|  }
  847|   560k|  return 1;
  848|   922k|}
intra_mode_search.c:cfl_pick_plane_parameter:
  642|  1.84M|                                    int cfl_search_range) {
  643|  1.84M|  assert(cfl_search_range >= 1 && cfl_search_range <= CFL_MAGS_SIZE);
  644|       |
  645|  1.84M|  if (cfl_search_range == CFL_MAGS_SIZE) return CFL_INDEX_ZERO;
  ------------------
  |  |  258|  1.84M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  1.84M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
                if (cfl_search_range == CFL_MAGS_SIZE) return CFL_INDEX_ZERO;
  ------------------
  |  |  259|      0|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|      0|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|      0|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (645:7): [True: 0, False: 1.84M]
  ------------------
  646|       |
  647|  1.84M|  const MACROBLOCKD *const xd = &x->e_mbd;
  648|  1.84M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  649|  1.84M|  assert(mbmi->uv_mode == UV_CFL_PRED);
  650|  1.84M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
  651|  1.84M|  const BLOCK_SIZE plane_bsize =
  652|  1.84M|      get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
  653|       |
  654|  1.84M|  int est_best_cfl_idx = CFL_INDEX_ZERO;
  ------------------
  |  |  259|  1.84M|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|  1.84M|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|  1.84M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  655|  1.84M|  int fast_mode = 1;
  656|  1.84M|  int start_cfl_idx = CFL_INDEX_ZERO;
  ------------------
  |  |  259|  1.84M|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|  1.84M|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|  1.84M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|  1.84M|  int64_t best_cfl_cost = cfl_compute_rd(cpi, x, plane, tx_size, plane_bsize,
  658|  1.84M|                                         start_cfl_idx, fast_mode, NULL);
  659|  5.53M|  for (int si = 0; si < 2; ++si) {
  ------------------
  |  Branch (659:20): [True: 3.68M, False: 1.84M]
  ------------------
  660|  3.68M|    const int dir = cfl_dir_ls[si];
  661|  9.27M|    for (int i = 1; i < CFL_MAGS_SIZE; ++i) {
  ------------------
  |  |  258|  9.27M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  9.27M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (661:21): [True: 9.27M, False: 3.19k]
  ------------------
  662|  9.27M|      int cfl_idx = start_cfl_idx + dir * i;
  663|  9.27M|      if (cfl_idx < 0 || cfl_idx >= CFL_MAGS_SIZE) break;
  ------------------
  |  |  258|  9.25M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  9.25M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (663:11): [True: 16.4k, False: 9.25M]
  |  Branch (663:26): [True: 16.5k, False: 9.24M]
  ------------------
  664|  9.24M|      int64_t cfl_cost = cfl_compute_rd(cpi, x, plane, tx_size, plane_bsize,
  665|  9.24M|                                        cfl_idx, fast_mode, NULL);
  666|  9.24M|      if (cfl_cost < best_cfl_cost) {
  ------------------
  |  Branch (666:11): [True: 5.59M, False: 3.65M]
  ------------------
  667|  5.59M|        best_cfl_cost = cfl_cost;
  668|  5.59M|        est_best_cfl_idx = cfl_idx;
  669|  5.59M|      } else {
  670|  3.65M|        break;
  671|  3.65M|      }
  672|  9.24M|    }
  673|  3.68M|  }
  674|  1.84M|  return est_best_cfl_idx;
  675|  1.84M|}
intra_mode_search.c:cfl_compute_rd:
  604|  20.2M|                              int fast_mode, RD_STATS *rd_stats) {
  605|  20.2M|  assert(IMPLIES(fast_mode, rd_stats == NULL));
  606|  20.2M|  const AV1_COMMON *const cm = &cpi->common;
  607|  20.2M|  MACROBLOCKD *const xd = &x->e_mbd;
  608|  20.2M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  609|  20.2M|  int cfl_plane = get_cfl_pred_type(plane);
  610|  20.2M|  CFL_SIGN_TYPE cfl_sign;
  611|  20.2M|  int cfl_alpha;
  612|  20.2M|  cfl_idx_to_sign_and_alpha(cfl_idx, &cfl_sign, &cfl_alpha);
  613|       |  // We conly build CFL for a given plane, the other plane's sign is dummy
  614|  20.2M|  int dummy_sign = CFL_SIGN_NEG;
  615|  20.2M|  const int8_t orig_cfl_alpha_signs = mbmi->cfl_alpha_signs;
  616|  20.2M|  const uint8_t orig_cfl_alpha_idx = mbmi->cfl_alpha_idx;
  617|  20.2M|  mbmi->cfl_alpha_signs =
  618|  20.2M|      PLANE_SIGN_TO_JOINT_SIGN(cfl_plane, cfl_sign, dummy_sign);
  ------------------
  |  |  587|  20.2M|  (plane == CFL_PRED_U ? a * CFL_SIGNS + b - 1 : b * CFL_SIGNS + a - 1)
  |  |  ------------------
  |  |  |  Branch (587:4): [True: 10.1M, False: 10.0M]
  |  |  ------------------
  ------------------
  619|  20.2M|  mbmi->cfl_alpha_idx = (cfl_alpha << CFL_ALPHABET_SIZE_LOG2) + cfl_alpha;
  ------------------
  |  |  256|  20.2M|#define CFL_ALPHABET_SIZE_LOG2 4
  ------------------
  620|  20.2M|  int64_t cfl_cost;
  621|  20.2M|  if (fast_mode) {
  ------------------
  |  Branch (621:7): [True: 11.0M, False: 9.11M]
  ------------------
  622|  11.0M|    cfl_cost = intra_model_rd(cm, x, plane, plane_bsize, tx_size,
  623|  11.0M|                              /*use_hadamard=*/0, cpi->do_border_pad);
  624|  11.0M|  } else {
  625|  9.11M|    av1_init_rd_stats(rd_stats);
  626|       |    av1_txfm_rd_in_plane(x, cpi, rd_stats, INT64_MAX, 0, plane, plane_bsize,
  627|  9.11M|                         tx_size, FTXS_NONE);
  628|  9.11M|    av1_rd_cost_update(x->rdmult, rd_stats);
  629|  9.11M|    cfl_cost = rd_stats->rdcost;
  630|  9.11M|  }
  631|  20.2M|  mbmi->cfl_alpha_signs = orig_cfl_alpha_signs;
  632|  20.2M|  mbmi->cfl_alpha_idx = orig_cfl_alpha_idx;
  633|  20.2M|  return cfl_cost;
  634|  20.2M|}
intra_mode_search.c:set_invalid_cfl_parameters:
  678|   361k|                                              int8_t *best_cfl_alpha_signs) {
  679|   361k|  *best_cfl_alpha_idx = 0;
  680|   361k|  *best_cfl_alpha_signs = 0;
  681|   361k|}
intra_mode_search.c:cfl_idx_to_sign_and_alpha:
  590|  47.3M|                                      int *cfl_alpha) {
  591|  47.3M|  int cfl_linear_idx = cfl_idx - CFL_INDEX_ZERO;
  ------------------
  |  |  259|  47.3M|#define CFL_INDEX_ZERO CFL_ALPHABET_SIZE
  |  |  ------------------
  |  |  |  |  257|  47.3M|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  256|  47.3M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|  47.3M|  if (cfl_linear_idx == 0) {
  ------------------
  |  Branch (592:7): [True: 6.08M, False: 41.2M]
  ------------------
  593|  6.08M|    *cfl_sign = CFL_SIGN_ZERO;
  594|  6.08M|    *cfl_alpha = 0;
  595|  41.2M|  } else {
  596|  41.2M|    *cfl_sign = cfl_linear_idx > 0 ? CFL_SIGN_POS : CFL_SIGN_NEG;
  ------------------
  |  Branch (596:17): [True: 20.6M, False: 20.6M]
  ------------------
  597|  41.2M|    *cfl_alpha = abs(cfl_linear_idx) - 1;
  598|  41.2M|  }
  599|  47.3M|}
intra_mode_search.c:cfl_pick_plane_rd:
  686|  1.84M|                              int est_best_cfl_idx) {
  687|  1.84M|  assert(cfl_search_range >= 1 && cfl_search_range <= CFL_MAGS_SIZE);
  688|  1.84M|  const MACROBLOCKD *const xd = &x->e_mbd;
  689|  1.84M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  690|  1.84M|  assert(mbmi->uv_mode == UV_CFL_PRED);
  691|  1.84M|  const MACROBLOCKD_PLANE *pd = &xd->plane[plane];
  692|  1.84M|  const BLOCK_SIZE plane_bsize =
  693|  1.84M|      get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
  694|       |
  695|  62.6M|  for (int cfl_idx = 0; cfl_idx < CFL_MAGS_SIZE; ++cfl_idx) {
  ------------------
  |  |  258|  62.6M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  62.6M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (695:25): [True: 60.8M, False: 1.84M]
  ------------------
  696|  60.8M|    av1_invalid_rd_stats(&cfl_rd_arr[cfl_idx]);
  697|  60.8M|  }
  698|       |
  699|  1.84M|  int fast_mode = 0;
  700|  1.84M|  int start_cfl_idx = est_best_cfl_idx;
  701|  1.84M|  cfl_compute_rd(cpi, x, plane, tx_size, plane_bsize, start_cfl_idx, fast_mode,
  702|  1.84M|                 &cfl_rd_arr[start_cfl_idx]);
  703|       |
  704|  1.84M|  if (cfl_search_range == 1) return;
  ------------------
  |  Branch (704:7): [True: 0, False: 1.84M]
  ------------------
  705|       |
  706|  5.53M|  for (int si = 0; si < 2; ++si) {
  ------------------
  |  Branch (706:20): [True: 3.68M, False: 1.84M]
  ------------------
  707|  3.68M|    const int dir = cfl_dir_ls[si];
  708|  10.9M|    for (int i = 1; i < cfl_search_range; ++i) {
  ------------------
  |  Branch (708:21): [True: 7.33M, False: 3.64M]
  ------------------
  709|  7.33M|      int cfl_idx = start_cfl_idx + dir * i;
  710|  7.33M|      if (cfl_idx < 0 || cfl_idx >= CFL_MAGS_SIZE) break;
  ------------------
  |  |  258|  7.31M|#define CFL_MAGS_SIZE ((2 << CFL_ALPHABET_SIZE_LOG2) + 1)
  |  |  ------------------
  |  |  |  |  256|  7.31M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (710:11): [True: 19.2k, False: 7.31M]
  |  Branch (710:26): [True: 19.0k, False: 7.29M]
  ------------------
  711|  7.29M|      cfl_compute_rd(cpi, x, plane, tx_size, plane_bsize, cfl_idx, fast_mode,
  712|  7.29M|                     &cfl_rd_arr[cfl_idx]);
  713|  7.29M|    }
  714|  3.68M|  }
  715|  1.84M|}
intra_mode_search.c:rd_pick_intra_angle_sbuv:
  534|   801k|                                    RD_STATS *rd_stats) {
  535|   801k|  MACROBLOCKD *const xd = &x->e_mbd;
  536|   801k|  MB_MODE_INFO *mbmi = xd->mi[0];
  537|   801k|  assert(!is_inter_block(mbmi));
  538|   801k|  int i, angle_delta, best_angle_delta = 0;
  539|   801k|  int64_t this_rd, best_rd_in, rd_cost[2 * (MAX_ANGLE_DELTA + 2)];
  540|       |
  541|   801k|  rd_stats->rate = INT_MAX;
  542|   801k|  rd_stats->skip_txfm = 0;
  543|   801k|  rd_stats->dist = INT64_MAX;
  544|  8.81M|  for (i = 0; i < 2 * (MAX_ANGLE_DELTA + 2); ++i) rd_cost[i] = INT64_MAX;
  ------------------
  |  |  467|  8.81M|#define MAX_ANGLE_DELTA 3
  ------------------
  |  Branch (544:15): [True: 8.01M, False: 801k]
  ------------------
  545|       |
  546|  1.74M|  for (angle_delta = 0; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) {
  ------------------
  |  |  467|  1.74M|#define MAX_ANGLE_DELTA 3
  ------------------
  |  Branch (546:25): [True: 1.27M, False: 470k]
  ------------------
  547|  2.21M|    for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (547:17): [True: 1.74M, False: 470k]
  ------------------
  548|  1.74M|      best_rd_in = (best_rd == INT64_MAX)
  ------------------
  |  Branch (548:20): [True: 0, False: 1.74M]
  ------------------
  549|  1.74M|                       ? INT64_MAX
  550|  1.74M|                       : (best_rd + (best_rd >> ((angle_delta == 0) ? 3 : 5)));
  ------------------
  |  Branch (550:50): [True: 801k, False: 941k]
  ------------------
  551|  1.74M|      mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta;
  552|  1.74M|      this_rd = pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead,
  553|  1.74M|                                              best_rd_in, rate, rd_stats,
  554|  1.74M|                                              &best_angle_delta, &best_rd);
  555|  1.74M|      rd_cost[2 * angle_delta + i] = this_rd;
  556|  1.74M|      if (angle_delta == 0) {
  ------------------
  |  Branch (556:11): [True: 800k, False: 941k]
  ------------------
  557|   800k|        if (this_rd == INT64_MAX) return 0;
  ------------------
  |  Branch (557:13): [True: 330k, False: 470k]
  ------------------
  558|   470k|        rd_cost[1] = this_rd;
  559|   470k|        break;
  560|   800k|      }
  561|  1.74M|    }
  562|  1.27M|  }
  563|       |
  564|   801k|  assert(best_rd != INT64_MAX);
  565|  1.41M|  for (angle_delta = 1; angle_delta <= MAX_ANGLE_DELTA; angle_delta += 2) {
  ------------------
  |  |  467|  1.41M|#define MAX_ANGLE_DELTA 3
  ------------------
  |  Branch (565:25): [True: 941k, False: 470k]
  ------------------
  566|   941k|    int64_t rd_thresh;
  567|  2.82M|    for (i = 0; i < 2; ++i) {
  ------------------
  |  Branch (567:17): [True: 1.88M, False: 941k]
  ------------------
  568|  1.88M|      int skip_search = 0;
  569|  1.88M|      rd_thresh = best_rd + (best_rd >> 5);
  570|  1.88M|      if (rd_cost[2 * (angle_delta + 1) + i] > rd_thresh &&
  ------------------
  |  Branch (570:11): [True: 1.75M, False: 129k]
  ------------------
  571|  1.75M|          rd_cost[2 * (angle_delta - 1) + i] > rd_thresh)
  ------------------
  |  Branch (571:11): [True: 1.56M, False: 192k]
  ------------------
  572|  1.56M|        skip_search = 1;
  573|  1.88M|      if (!skip_search) {
  ------------------
  |  Branch (573:11): [True: 322k, False: 1.56M]
  ------------------
  574|   322k|        mbmi->angle_delta[PLANE_TYPE_UV] = (1 - 2 * i) * angle_delta;
  575|   322k|        pick_intra_angle_routine_sbuv(cpi, x, bsize, rate_overhead, best_rd,
  576|   322k|                                      rate, rd_stats, &best_angle_delta,
  577|   322k|                                      &best_rd);
  578|   322k|      }
  579|  1.88M|    }
  580|   941k|  }
  581|       |
  582|   470k|  mbmi->angle_delta[PLANE_TYPE_UV] = best_angle_delta;
  583|       |  return rd_stats->rate != INT_MAX;
  584|   801k|}
intra_mode_search.c:pick_intra_angle_routine_sbuv:
  499|  2.06M|    int *best_angle_delta, int64_t *best_rd) {
  500|  2.06M|  MB_MODE_INFO *mbmi = x->e_mbd.mi[0];
  501|  2.06M|  assert(!is_inter_block(mbmi));
  502|  2.06M|  int this_rate;
  503|  2.06M|  int64_t this_rd;
  504|  2.06M|  RD_STATS tokenonly_rd_stats;
  505|       |
  506|  2.06M|  if (!av1_txfm_uvrd(cpi, x, &tokenonly_rd_stats, bsize, best_rd_in))
  ------------------
  |  Branch (506:7): [True: 903k, False: 1.16M]
  ------------------
  507|   903k|    return INT64_MAX;
  508|  1.16M|  this_rate = tokenonly_rd_stats.rate +
  509|  1.16M|              intra_mode_info_cost_uv(cpi, x, mbmi, bsize, rate_overhead);
  510|  1.16M|  this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist);
  ------------------
  |  |   33|  1.16M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.16M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.16M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.16M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  511|  1.16M|  if (this_rd < *best_rd) {
  ------------------
  |  Branch (511:7): [True: 103k, False: 1.05M]
  ------------------
  512|   103k|    *best_rd = this_rd;
  513|   103k|    *best_angle_delta = mbmi->angle_delta[PLANE_TYPE_UV];
  514|   103k|    *rate = this_rate;
  515|   103k|    rd_stats->rate = tokenonly_rd_stats.rate;
  516|   103k|    rd_stats->dist = tokenonly_rd_stats.dist;
  517|   103k|    rd_stats->skip_txfm = tokenonly_rd_stats.skip_txfm;
  518|   103k|  }
  519|  1.16M|  return this_rd;
  520|  2.06M|}
intra_mode_search.c:should_prune_chroma_smooth_pred_based_on_source_variance:
  851|   879k|    const AV1_COMP *cpi, const MACROBLOCK *x, BLOCK_SIZE bsize) {
  852|   879k|  if (!cpi->sf.intra_sf.prune_smooth_intra_mode_for_chroma) return false;
  ------------------
  |  Branch (852:7): [True: 879k, False: 18.4E]
  ------------------
  853|       |
  854|       |  // If the source variance of both chroma planes is less than 20 (empirically
  855|       |  // derived), prune UV_SMOOTH_PRED.
  856|  18.4E|  for (int i = AOM_PLANE_U; i < av1_num_planes(&cpi->common); i++) {
  ------------------
  |  |  282|  18.4E|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (856:29): [True: 0, False: 18.4E]
  ------------------
  857|      0|    const unsigned int variance = av1_get_perpixel_variance_facade(
  858|      0|        cpi, &x->e_mbd, &x->plane[i].src, bsize, i);
  859|      0|    if (variance >= 20) return false;
  ------------------
  |  Branch (859:9): [True: 0, False: 0]
  ------------------
  860|      0|  }
  861|  18.4E|  return true;
  862|  18.4E|}
intra_mode_search.c:get_model_rd_index_for_pruning:
  425|  14.9M|    const INTRA_MODE_SPEED_FEATURES *const intra_sf) {
  426|  14.9M|  const int top_intra_model_count_allowed =
  427|  14.9M|      intra_sf->top_intra_model_count_allowed;
  428|  14.9M|  if (!intra_sf->adapt_top_model_rd_count_using_neighbors)
  ------------------
  |  Branch (428:7): [True: 14.9M, False: 18.4E]
  ------------------
  429|  14.9M|    return top_intra_model_count_allowed - 1;
  430|       |
  431|  18.4E|  const MACROBLOCKD *const xd = &x->e_mbd;
  432|  18.4E|  const PREDICTION_MODE mode = xd->mi[0]->mode;
  433|  18.4E|  int model_rd_index_for_pruning = top_intra_model_count_allowed - 1;
  434|  18.4E|  int is_left_mode_neq_cur_mode = 0, is_above_mode_neq_cur_mode = 0;
  435|  18.4E|  if (xd->left_available)
  ------------------
  |  Branch (435:7): [True: 0, False: 18.4E]
  ------------------
  436|      0|    is_left_mode_neq_cur_mode = xd->left_mbmi->mode != mode;
  437|  18.4E|  if (xd->up_available)
  ------------------
  |  Branch (437:7): [True: 0, False: 18.4E]
  ------------------
  438|      0|    is_above_mode_neq_cur_mode = xd->above_mbmi->mode != mode;
  439|       |  // The pruning of luma intra modes is made more aggressive at lower quantizers
  440|       |  // and vice versa. The value for model_rd_index_for_pruning is derived as
  441|       |  // follows.
  442|       |  // qidx 0 to 127: Reduce the index of a candidate used for comparison only if
  443|       |  // the current mode does not match either of the available neighboring modes.
  444|       |  // qidx 128 to 255: Reduce the index of a candidate used for comparison only
  445|       |  // if the current mode does not match both the available neighboring modes.
  446|  18.4E|  if (x->qindex <= 127) {
  ------------------
  |  Branch (446:7): [True: 0, False: 18.4E]
  ------------------
  447|      0|    if (is_left_mode_neq_cur_mode || is_above_mode_neq_cur_mode)
  ------------------
  |  Branch (447:9): [True: 0, False: 0]
  |  Branch (447:38): [True: 0, False: 0]
  ------------------
  448|      0|      model_rd_index_for_pruning = AOMMAX(model_rd_index_for_pruning - 1, 0);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  449|  18.4E|  } else {
  450|  18.4E|    if (is_left_mode_neq_cur_mode && is_above_mode_neq_cur_mode)
  ------------------
  |  Branch (450:9): [True: 0, False: 18.4E]
  |  Branch (450:38): [True: 0, False: 0]
  ------------------
  451|      0|      model_rd_index_for_pruning = AOMMAX(model_rd_index_for_pruning - 1, 0);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  452|  18.4E|  }
  453|  18.4E|  return model_rd_index_for_pruning;
  454|  14.9M|}
intra_mode_search.c:prune_intra_y_mode:
  470|  14.9M|                              int model_rd_index_for_pruning) {
  471|  14.9M|  const double thresh_best = 1.50;
  472|  14.9M|  const double thresh_top = 1.00;
  473|  39.1M|  for (int i = 0; i < max_model_cnt_allowed; i++) {
  ------------------
  |  Branch (473:19): [True: 31.0M, False: 8.11M]
  ------------------
  474|  31.0M|    if (this_model_rd < top_intra_model_rd[i]) {
  ------------------
  |  Branch (474:9): [True: 6.86M, False: 24.2M]
  ------------------
  475|  10.7M|      for (int j = max_model_cnt_allowed - 1; j > i; j--) {
  ------------------
  |  Branch (475:47): [True: 3.87M, False: 6.86M]
  ------------------
  476|  3.87M|        top_intra_model_rd[j] = top_intra_model_rd[j - 1];
  477|  3.87M|      }
  478|  6.86M|      top_intra_model_rd[i] = this_model_rd;
  479|  6.86M|      break;
  480|  6.86M|    }
  481|  31.0M|  }
  482|  14.9M|  if (top_intra_model_rd[model_rd_index_for_pruning] != INT64_MAX &&
  ------------------
  |  Branch (482:7): [True: 12.5M, False: 2.41M]
  ------------------
  483|  12.5M|      this_model_rd >
  ------------------
  |  Branch (483:7): [True: 6.65M, False: 5.91M]
  ------------------
  484|  12.5M|          thresh_top * top_intra_model_rd[model_rd_index_for_pruning])
  485|  6.65M|    return 1;
  486|       |
  487|  8.33M|  if (this_model_rd != INT64_MAX &&
  ------------------
  |  Branch (487:7): [True: 8.34M, False: 18.4E]
  ------------------
  488|  8.34M|      this_model_rd > thresh_best * (*best_model_rd))
  ------------------
  |  Branch (488:7): [True: 120k, False: 8.22M]
  ------------------
  489|   120k|    return 1;
  490|  8.20M|  if (this_model_rd < *best_model_rd) *best_model_rd = this_model_rd;
  ------------------
  |  Branch (490:7): [True: 2.99M, False: 5.21M]
  ------------------
  491|  8.20M|  return 0;
  492|  8.33M|}
intra_mode_search.c:handle_filter_intra_mode:
 1243|  1.66M|                                            int64_t best_rd_so_far) {
 1244|  1.66M|  MACROBLOCKD *const xd = &x->e_mbd;
 1245|  1.66M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1246|  1.66M|  assert(mbmi->mode == DC_PRED &&
 1247|  1.66M|         av1_filter_intra_allowed_bsize(&cpi->common, bsize));
 1248|       |
 1249|  1.66M|  RD_STATS rd_stats_y_fi;
 1250|  1.66M|  int filter_intra_selected_flag = 0;
 1251|  1.66M|  TX_SIZE best_tx_size = mbmi->tx_size;
 1252|  1.66M|  FILTER_INTRA_MODE best_fi_mode = FILTER_DC_PRED;
 1253|  1.66M|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 1254|  1.66M|  av1_copy_array(best_tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  1.66M|  do {                                                    \
  |  |   39|  1.66M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  1.66M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  1.66M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.66M]
  |  |  ------------------
  ------------------
 1255|  1.66M|  mbmi->filter_intra_mode_info.use_filter_intra = 1;
 1256|  9.98M|  for (FILTER_INTRA_MODE fi_mode = FILTER_DC_PRED; fi_mode < FILTER_INTRA_MODES;
  ------------------
  |  Branch (1256:52): [True: 8.31M, False: 1.66M]
  ------------------
 1257|  8.31M|       ++fi_mode) {
 1258|  8.31M|    mbmi->filter_intra_mode_info.filter_intra_mode = fi_mode;
 1259|  8.31M|    av1_pick_uniform_tx_size_type_yrd(cpi, x, &rd_stats_y_fi, bsize, best_rd);
 1260|  8.31M|    if (rd_stats_y_fi.rate == INT_MAX) continue;
  ------------------
  |  Branch (1260:9): [True: 950k, False: 7.36M]
  ------------------
 1261|  7.36M|    const int this_rate_tmp =
 1262|  7.36M|        rd_stats_y_fi.rate +
 1263|  7.36M|        intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost, 0);
 1264|  7.36M|    const int64_t this_rd_tmp =
 1265|  7.36M|        RDCOST(x->rdmult, this_rate_tmp, rd_stats_y_fi.dist);
  ------------------
  |  |   33|  7.36M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  7.36M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  7.36M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  7.36M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1266|       |
 1267|  7.36M|    if (this_rd_tmp != INT64_MAX && this_rd_tmp / 2 > best_rd) {
  ------------------
  |  Branch (1267:9): [True: 7.36M, False: 18.4E]
  |  Branch (1267:37): [True: 107, False: 7.36M]
  ------------------
 1268|    107|      break;
 1269|    107|    }
 1270|  7.36M|    if (this_rd_tmp < best_rd_so_far) {
  ------------------
  |  Branch (1270:9): [True: 1.37M, False: 5.99M]
  ------------------
 1271|  1.37M|      best_tx_size = mbmi->tx_size;
 1272|  1.37M|      av1_copy_array(best_tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  1.37M|  do {                                                    \
  |  |   39|  1.37M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  1.37M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  1.37M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.37M]
  |  |  ------------------
  ------------------
 1273|  1.37M|      best_fi_mode = fi_mode;
 1274|  1.37M|      *rd_stats_y = rd_stats_y_fi;
 1275|  1.37M|      filter_intra_selected_flag = 1;
 1276|  1.37M|      best_rd_so_far = this_rd_tmp;
 1277|  1.37M|    }
 1278|  7.36M|  }
 1279|       |
 1280|  1.66M|  mbmi->tx_size = best_tx_size;
 1281|  1.66M|  av1_copy_array(xd->tx_type_map, best_tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  1.66M|  do {                                                    \
  |  |   39|  1.66M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  1.66M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  1.66M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.66M]
  |  |  ------------------
  ------------------
 1282|       |
 1283|  1.66M|  if (filter_intra_selected_flag) {
  ------------------
  |  Branch (1283:7): [True: 929k, False: 734k]
  ------------------
 1284|   929k|    mbmi->filter_intra_mode_info.use_filter_intra = 1;
 1285|   929k|    mbmi->filter_intra_mode_info.filter_intra_mode = best_fi_mode;
 1286|   929k|  } else {
 1287|   734k|    mbmi->filter_intra_mode_info.use_filter_intra = 0;
 1288|   734k|  }
 1289|  1.66M|}
intra_mode_search.c:prune_luma_odd_delta_angles_using_rd_cost:
 1446|  5.21M|    int64_t best_rd, int prune_luma_odd_delta_angles_in_intra) {
 1447|  5.21M|  const int luma_delta_angle = mbmi->angle_delta[PLANE_TYPE_Y];
 1448|  5.21M|  if (!prune_luma_odd_delta_angles_in_intra ||
  ------------------
  |  Branch (1448:7): [True: 5.21M, False: 0]
  ------------------
 1449|      0|      !av1_is_directional_mode(mbmi->mode) || !(abs(luma_delta_angle) & 1) ||
  ------------------
  |  Branch (1449:7): [True: 0, False: 0]
  |  Branch (1449:47): [True: 0, False: 0]
  ------------------
 1450|      0|      best_rd == INT64_MAX)
  ------------------
  |  Branch (1450:7): [True: 0, False: 0]
  ------------------
 1451|  5.21M|    return 0;
 1452|       |
 1453|  18.4E|  const int64_t rd_thresh = best_rd + (best_rd >> 3);
 1454|       |
 1455|       |  // Neighbour rdcosts are considered for pruning of odd delta angles as
 1456|       |  // mentioned below:
 1457|       |  // Delta angle      Delta angle rdcost
 1458|       |  // to be pruned     to be considered
 1459|       |  //    -3                   -2
 1460|       |  //    -1                -2, 0
 1461|       |  //     1                 0, 2
 1462|       |  //     3                    2
 1463|  18.4E|  return intra_modes_rd_cost[luma_delta_angle + MAX_ANGLE_DELTA] > rd_thresh &&
  ------------------
  |  |  467|  18.4E|#define MAX_ANGLE_DELTA 3
  ------------------
  |  Branch (1463:10): [True: 0, False: 18.4E]
  ------------------
 1464|      0|         intra_modes_rd_cost[luma_delta_angle + MAX_ANGLE_DELTA + 2] >
  ------------------
  |  |  467|      0|#define MAX_ANGLE_DELTA 3
  ------------------
  |  Branch (1464:10): [True: 0, False: 0]
  ------------------
 1465|      0|             rd_thresh;
 1466|  5.21M|}
intra_mode_search.c:rd_pick_filter_intra_sby:
  237|   378k|                                    PICK_MODE_CONTEXT *ctx) {
  238|       |  // Skip the evaluation of filter intra modes.
  239|   378k|  if (cpi->sf.intra_sf.prune_filter_intra_level == 2) return 0;
  ------------------
  |  Branch (239:7): [True: 0, False: 378k]
  ------------------
  240|       |
  241|   378k|  MACROBLOCKD *const xd = &x->e_mbd;
  242|   378k|  MB_MODE_INFO *mbmi = xd->mi[0];
  243|   378k|  int filter_intra_selected_flag = 0;
  244|   378k|  FILTER_INTRA_MODE mode;
  245|   378k|  TX_SIZE best_tx_size = TX_8X8;
  246|   378k|  FILTER_INTRA_MODE_INFO filter_intra_mode_info;
  247|   378k|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
  248|   378k|  av1_zero(filter_intra_mode_info);
  ------------------
  |  |   43|   378k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  249|   378k|  mbmi->filter_intra_mode_info.use_filter_intra = 1;
  250|   378k|  mbmi->mode = DC_PRED;
  251|   378k|  mbmi->palette_mode_info.palette_size[0] = 0;
  252|       |
  253|       |  // Skip the evaluation of filter-intra if cached MB_MODE_INFO does not have
  254|       |  // filter-intra as winner.
  255|   378k|  if (x->use_mb_mode_cache &&
  ------------------
  |  Branch (255:7): [True: 0, False: 378k]
  ------------------
  256|      0|      !x->mb_mode_cache->filter_intra_mode_info.use_filter_intra)
  ------------------
  |  Branch (256:7): [True: 0, False: 0]
  ------------------
  257|      0|    return 0;
  258|       |
  259|  2.26M|  for (mode = 0; mode < FILTER_INTRA_MODES; ++mode) {
  ------------------
  |  Branch (259:18): [True: 1.88M, False: 378k]
  ------------------
  260|  1.88M|    int64_t this_rd;
  261|  1.88M|    RD_STATS tokenonly_rd_stats;
  262|  1.88M|    mbmi->filter_intra_mode_info.filter_intra_mode = mode;
  263|       |
  264|  1.88M|    if ((cpi->sf.intra_sf.prune_filter_intra_level == 1) &&
  ------------------
  |  Branch (264:9): [True: 0, False: 1.88M]
  ------------------
  265|      0|        !(av1_derived_filter_intra_mode_used_flag[best_mode_so_far] &
  ------------------
  |  Branch (265:9): [True: 0, False: 0]
  ------------------
  266|      0|          (1 << mode)))
  267|      0|      continue;
  268|       |
  269|       |    // Skip the evaluation of modes that do not match with the winner mode in
  270|       |    // x->mb_mode_cache.
  271|  1.88M|    if (x->use_mb_mode_cache &&
  ------------------
  |  Branch (271:9): [True: 0, False: 1.88M]
  ------------------
  272|      0|        mode != x->mb_mode_cache->filter_intra_mode_info.filter_intra_mode)
  ------------------
  |  Branch (272:9): [True: 0, False: 0]
  ------------------
  273|      0|      continue;
  274|       |
  275|  1.88M|    if (model_intra_yrd_and_prune(cpi, x, bsize, best_model_rd)) {
  ------------------
  |  Branch (275:9): [True: 321k, False: 1.56M]
  ------------------
  276|   321k|      continue;
  277|   321k|    }
  278|  1.56M|    av1_pick_uniform_tx_size_type_yrd(cpi, x, &tokenonly_rd_stats, bsize,
  279|  1.56M|                                      *best_rd);
  280|  1.56M|    if (tokenonly_rd_stats.rate == INT_MAX) continue;
  ------------------
  |  Branch (280:9): [True: 956k, False: 611k]
  ------------------
  281|   611k|    const int this_rate =
  282|   611k|        tokenonly_rd_stats.rate +
  283|   611k|        intra_mode_info_cost_y(cpi, x, mbmi, bsize, mode_cost, 0);
  284|   611k|    this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist);
  ------------------
  |  |   33|   611k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   611k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   611k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   611k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  285|       |
  286|       |    // Visual quality adjustment based on recon vs source variance.
  287|   611k|    if ((cpi->oxcf.mode == ALLINTRA) && (this_rd != INT64_MAX)) {
  ------------------
  |  Branch (287:9): [True: 0, False: 611k]
  |  Branch (287:41): [True: 0, False: 0]
  ------------------
  288|      0|      this_rd = (int64_t)(this_rd * intra_rd_variance_factor(cpi, x, bsize));
  289|      0|    }
  290|       |
  291|       |    // Collect mode stats for multiwinner mode processing
  292|   611k|    const int txfm_search_done = 1;
  293|   611k|    store_winner_mode_stats(
  294|   611k|        cpi, x, mbmi, NULL, NULL, NULL, 0, NULL, bsize, this_rd,
  295|   611k|        cpi->sf.winner_mode_sf.multi_winner_mode_type, txfm_search_done);
  296|   611k|    if (this_rd < *best_rd) {
  ------------------
  |  Branch (296:9): [True: 207k, False: 403k]
  ------------------
  297|   207k|      *best_rd = this_rd;
  298|   207k|      best_tx_size = mbmi->tx_size;
  299|   207k|      filter_intra_mode_info = mbmi->filter_intra_mode_info;
  300|   207k|      av1_copy_array(best_tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   207k|  do {                                                    \
  |  |   39|   207k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   207k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   207k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 207k]
  |  |  ------------------
  ------------------
  301|   207k|      *rate = this_rate;
  302|   207k|      *rate_tokenonly = tokenonly_rd_stats.rate;
  303|   207k|      *distortion = tokenonly_rd_stats.dist;
  304|   207k|      *skippable = tokenonly_rd_stats.skip_txfm;
  305|   207k|      filter_intra_selected_flag = 1;
  306|   207k|    }
  307|   611k|  }
  308|       |
  309|   378k|  if (filter_intra_selected_flag) {
  ------------------
  |  Branch (309:7): [True: 158k, False: 219k]
  ------------------
  310|   158k|    mbmi->mode = DC_PRED;
  311|   158k|    mbmi->tx_size = best_tx_size;
  312|   158k|    mbmi->filter_intra_mode_info = filter_intra_mode_info;
  313|   158k|    av1_copy_array(ctx->tx_type_map, best_tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   158k|  do {                                                    \
  |  |   39|   158k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   158k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   158k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 158k]
  |  |  ------------------
  ------------------
  314|   158k|    return 1;
  315|   219k|  } else {
  316|   219k|    return 0;
  317|   219k|  }
  318|   378k|}
intra_mode_search.c:intra_block_yrd:
 1193|   381k|                                  PICK_MODE_CONTEXT *ctx) {
 1194|   381k|  MACROBLOCKD *const xd = &x->e_mbd;
 1195|   381k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1196|   381k|  RD_STATS rd_stats;
 1197|       |  // In order to improve txfm search, avoid rd based breakouts during winner
 1198|       |  // mode evaluation. Hence passing ref_best_rd as INT64_MAX by default when the
 1199|       |  // speed feature use_rd_based_breakout_for_intra_tx_search is disabled.
 1200|   381k|  int64_t ref_best_rd = cpi->sf.tx_sf.use_rd_based_breakout_for_intra_tx_search
  ------------------
  |  Branch (1200:25): [True: 0, False: 381k]
  ------------------
 1201|   381k|                            ? *best_rd
 1202|   381k|                            : INT64_MAX;
 1203|   381k|  av1_pick_uniform_tx_size_type_yrd(cpi, x, &rd_stats, bsize, ref_best_rd);
 1204|   381k|  if (rd_stats.rate == INT_MAX) return 0;
  ------------------
  |  Branch (1204:7): [True: 0, False: 381k]
  ------------------
 1205|   381k|  int this_rate_tokenonly = rd_stats.rate;
 1206|   381k|  if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->bsize)) {
  ------------------
  |  Branch (1206:7): [True: 367k, False: 13.4k]
  |  Branch (1206:42): [True: 336k, False: 30.9k]
  ------------------
 1207|       |    // av1_pick_uniform_tx_size_type_yrd above includes the cost of the tx_size
 1208|       |    // in the tokenonly rate, but for intra blocks, tx_size is always coded
 1209|       |    // (prediction granularity), so we account for it in the full rate,
 1210|       |    // not the tokenonly rate.
 1211|   336k|    this_rate_tokenonly -= tx_size_cost(x, bsize, mbmi->tx_size);
 1212|   336k|  }
 1213|   381k|  const int this_rate =
 1214|   381k|      rd_stats.rate +
 1215|   381k|      intra_mode_info_cost_y(cpi, x, mbmi, bsize, bmode_costs[mbmi->mode], 0);
 1216|   381k|  const int64_t this_rd = RDCOST(x->rdmult, this_rate, rd_stats.dist);
  ------------------
  |  |   33|   381k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   381k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   381k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   381k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1217|   381k|  if (this_rd < *best_rd) {
  ------------------
  |  Branch (1217:7): [True: 188k, False: 192k]
  ------------------
 1218|   188k|    *best_mbmi = *mbmi;
 1219|   188k|    *best_rd = this_rd;
 1220|   188k|    *rate = this_rate;
 1221|   188k|    *rate_tokenonly = this_rate_tokenonly;
 1222|   188k|    *distortion = rd_stats.dist;
 1223|   188k|    *skippable = rd_stats.skip_txfm;
 1224|   188k|    av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   188k|  do {                                                    \
  |  |   39|   188k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   188k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   188k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 188k]
  |  |  ------------------
  ------------------
 1225|   188k|    return 1;
 1226|   188k|  }
 1227|   192k|  return 0;
 1228|   381k|}

rdopt.c:init_intra_mode_search_state:
  306|  1.91M|    IntraModeSearchState *intra_search_state) {
  307|  1.91M|  memset(intra_search_state, 0, sizeof(*intra_search_state));
  308|       |  intra_search_state->rate_uv_intra = INT_MAX;
  309|  1.91M|}
intra_mode_search.c:init_intra_mode_search_state:
  306|   934k|    IntraModeSearchState *intra_search_state) {
  307|   934k|  memset(intra_search_state, 0, sizeof(*intra_search_state));
  308|       |  intra_search_state->rate_uv_intra = INT_MAX;
  309|   934k|}

encodeframe.c:produce_gradients_for_sb:
  341|   137k|                                            int mi_col) {
  342|       |  // Initialise flags related to hog data caching.
  343|   137k|  x->is_sb_gradient_cached[PLANE_TYPE_Y] = false;
  344|   137k|  x->is_sb_gradient_cached[PLANE_TYPE_UV] = false;
  345|   137k|  if (!is_gradient_caching_for_hog_enabled(cpi)) return;
  ------------------
  |  Branch (345:7): [True: 121k, False: 16.3k]
  ------------------
  346|       |
  347|  16.3k|  const SPEED_FEATURES *sf = &cpi->sf;
  348|  16.3k|  const int num_planes = av1_num_planes(&cpi->common);
  349|       |
  350|  16.3k|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, sb_size);
  351|       |
  352|  16.3k|  if (sf->intra_sf.intra_pruning_with_hog) {
  ------------------
  |  Branch (352:7): [True: 16.3k, False: 18.4E]
  ------------------
  353|  16.3k|    compute_gradient_info_sb(x, sb_size, PLANE_TYPE_Y);
  354|  16.3k|    x->is_sb_gradient_cached[PLANE_TYPE_Y] = true;
  355|  16.3k|  }
  356|  16.3k|  if (sf->intra_sf.chroma_intra_pruning_with_hog && num_planes > 1) {
  ------------------
  |  Branch (356:7): [True: 16.3k, False: 18.4E]
  |  Branch (356:53): [True: 6.61k, False: 9.77k]
  ------------------
  357|  6.61k|    compute_gradient_info_sb(x, sb_size, PLANE_TYPE_UV);
  358|       |    x->is_sb_gradient_cached[PLANE_TYPE_UV] = true;
  359|  6.61k|  }
  360|  16.3k|}
encodeframe.c:is_gradient_caching_for_hog_enabled:
  328|   137k|    const AV1_COMP *const cpi) {
  329|   137k|  const SPEED_FEATURES *const sf = &cpi->sf;
  330|   137k|  return frame_is_intra_only(&cpi->common) && !sf->rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (330:10): [True: 24.8k, False: 112k]
  |  Branch (330:47): [True: 16.3k, False: 8.49k]
  ------------------
  331|  16.3k|         (sf->part_sf.partition_search_type == SEARCH_PARTITION) &&
  ------------------
  |  Branch (331:10): [True: 16.3k, False: 18.4E]
  ------------------
  332|  16.3k|         (sf->intra_sf.intra_pruning_with_hog ||
  ------------------
  |  Branch (332:11): [True: 16.3k, False: 0]
  ------------------
  333|      0|          sf->intra_sf.chroma_intra_pruning_with_hog);
  ------------------
  |  Branch (333:11): [True: 0, False: 0]
  ------------------
  334|   137k|}
encodeframe.c:compute_gradient_info_sb:
  305|  22.9k|                                            PLANE_TYPE plane) {
  306|  22.9k|#if CONFIG_AV1_HIGHBITDEPTH
  307|  22.9k|  if (is_cur_buf_hbd(&x->e_mbd)) {
  ------------------
  |  Branch (307:7): [True: 7.14k, False: 15.8k]
  ------------------
  308|  7.14k|    highbd_compute_gradient_info_sb(x, sb_size, plane);
  309|  7.14k|    return;
  310|  7.14k|  }
  311|  15.8k|#endif  // CONFIG_AV1_HIGHBITDEPTH
  312|  15.8k|  lowbd_compute_gradient_info_sb(x, sb_size, plane);
  313|  15.8k|}
encodeframe.c:highbd_compute_gradient_info_sb:
  258|  7.14k|                                                   PLANE_TYPE plane) {
  259|  7.14k|  PixelLevelGradientInfo *const grad_info_sb =
  260|  7.14k|      x->pixel_gradient_info + plane * MAX_SB_SQUARE;
  ------------------
  |  |   33|  7.14k|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  7.14k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  7.14k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  7.14k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  7.14k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|  7.14k|  const uint16_t *src = CONVERT_TO_SHORTPTR(x->plane[plane].src.buf);
  ------------------
  |  |   79|  7.14k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  262|  7.14k|  const int stride = x->plane[plane].src.stride;
  263|  7.14k|  const int ss_x = x->e_mbd.plane[plane].subsampling_x;
  264|  7.14k|  const int ss_y = x->e_mbd.plane[plane].subsampling_y;
  265|  7.14k|  const int sb_height = block_size_high[sb_size] >> ss_y;
  266|  7.14k|  const int sb_width = block_size_wide[sb_size] >> ss_x;
  267|  7.14k|  src += stride;
  268|   414k|  for (int r = 1; r < sb_height - 1; ++r) {
  ------------------
  |  Branch (268:19): [True: 406k, False: 7.14k]
  ------------------
  269|  22.5M|    for (int c = 1; c < sb_width - 1; ++c) {
  ------------------
  |  Branch (269:21): [True: 22.1M, False: 406k]
  ------------------
  270|  22.1M|      const uint16_t *above = &src[c - stride];
  271|  22.1M|      const uint16_t *below = &src[c + stride];
  272|  22.1M|      const uint16_t *left = &src[c - 1];
  273|  22.1M|      const uint16_t *right = &src[c + 1];
  274|       |      // Calculate gradient using Sobel filters.
  275|  22.1M|      const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
  276|  22.1M|                     (left[-stride] + 2 * left[0] + left[stride]);
  277|  22.1M|      const int dy = (below[-1] + 2 * below[0] + below[1]) -
  278|  22.1M|                     (above[-1] + 2 * above[0] + above[1]);
  279|  22.1M|      grad_info_sb[r * sb_width + c].is_dx_zero = (dx == 0);
  280|  22.1M|      grad_info_sb[r * sb_width + c].abs_dx_abs_dy_sum =
  281|  22.1M|          (uint16_t)(abs(dx) + abs(dy));
  282|  22.1M|      grad_info_sb[r * sb_width + c].hist_bin_idx =
  283|  22.1M|          (dx != 0) ? get_hist_bin_idx(dx, dy) : -1;
  ------------------
  |  Branch (283:11): [True: 5.57M, False: 16.5M]
  ------------------
  284|  22.1M|    }
  285|   406k|    src += stride;
  286|   406k|  }
  287|  7.14k|}
encodeframe.c:get_hist_bin_idx:
  106|  23.1M|static inline int get_hist_bin_idx(int dx, int dy) {
  107|  23.1M|  const int32_t ratio = (dy * (1 << FIX_PREC_BITS)) / dx;
  ------------------
  |  |  105|  23.1M|#define FIX_PREC_BITS (16)
  ------------------
  108|       |
  109|       |  // Find index by bisection
  110|  23.1M|  static const int thresholds[BINS] = {
  111|  23.1M|    -1334015, -441798, -261605, -183158, -138560, -109331, -88359, -72303,
  112|  23.1M|    -59392,   -48579,  -39272,  -30982,  -23445,  -16400,  -9715,  -3194,
  113|  23.1M|    3227,     9748,    16433,   23478,   31015,   39305,   48611,  59425,
  114|  23.1M|    72336,    88392,   109364,  138593,  183191,  261638,  441831, INT32_MAX
  115|  23.1M|  };
  116|       |
  117|  23.1M|  int lo_idx = 0, hi_idx = BINS - 1;
  ------------------
  |  |   40|  23.1M|#define BINS 32
  ------------------
  118|       |  // Divide into segments of size 8 gives better performance than binary search
  119|       |  // here.
  120|  23.1M|  if (ratio <= thresholds[7]) {
  ------------------
  |  Branch (120:7): [True: 2.24M, False: 20.8M]
  ------------------
  121|  2.24M|    lo_idx = 0;
  122|  2.24M|    hi_idx = 7;
  123|  20.8M|  } else if (ratio <= thresholds[15]) {
  ------------------
  |  Branch (123:14): [True: 2.39M, False: 18.4M]
  ------------------
  124|  2.39M|    lo_idx = 8;
  125|  2.39M|    hi_idx = 15;
  126|  18.4M|  } else if (ratio <= thresholds[23]) {
  ------------------
  |  Branch (126:14): [True: 16.9M, False: 1.57M]
  ------------------
  127|  16.9M|    lo_idx = 16;
  128|  16.9M|    hi_idx = 23;
  129|  16.9M|  } else {
  130|  1.57M|    lo_idx = 24;
  131|  1.57M|    hi_idx = 31;
  132|  1.57M|  }
  133|       |
  134|  53.8M|  for (int idx = lo_idx; idx <= hi_idx; idx++) {
  ------------------
  |  Branch (134:26): [True: 53.8M, False: 18.4E]
  ------------------
  135|  53.8M|    if (ratio <= thresholds[idx]) {
  ------------------
  |  Branch (135:9): [True: 23.2M, False: 30.5M]
  ------------------
  136|  23.2M|      return idx;
  137|  23.2M|    }
  138|  53.8M|  }
  139|  18.4E|  assert(0 && "No valid histogram bin found!");
  140|  18.4E|  return BINS - 1;
  ------------------
  |  |   40|  18.4E|#define BINS 32
  ------------------
  141|  23.1M|}
encodeframe.c:lowbd_compute_gradient_info_sb:
  187|  15.8k|                                                  PLANE_TYPE plane) {
  188|  15.8k|  PixelLevelGradientInfo *const grad_info_sb =
  189|  15.8k|      x->pixel_gradient_info + plane * MAX_SB_SQUARE;
  ------------------
  |  |   33|  15.8k|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  15.8k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  15.8k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  15.8k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  15.8k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  15.8k|  const uint8_t *src = x->plane[plane].src.buf;
  191|  15.8k|  const int stride = x->plane[plane].src.stride;
  192|  15.8k|  const int ss_x = x->e_mbd.plane[plane].subsampling_x;
  193|  15.8k|  const int ss_y = x->e_mbd.plane[plane].subsampling_y;
  194|  15.8k|  const int sb_height = block_size_high[sb_size] >> ss_y;
  195|  15.8k|  const int sb_width = block_size_wide[sb_size] >> ss_x;
  196|  15.8k|  src += stride;
  197|   922k|  for (int r = 1; r < sb_height - 1; ++r) {
  ------------------
  |  Branch (197:19): [True: 906k, False: 15.8k]
  ------------------
  198|  50.1M|    for (int c = 1; c < sb_width - 1; ++c) {
  ------------------
  |  Branch (198:21): [True: 49.2M, False: 906k]
  ------------------
  199|  49.2M|      const uint8_t *above = &src[c - stride];
  200|  49.2M|      const uint8_t *below = &src[c + stride];
  201|  49.2M|      const uint8_t *left = &src[c - 1];
  202|  49.2M|      const uint8_t *right = &src[c + 1];
  203|       |      // Calculate gradient using Sobel filters.
  204|  49.2M|      const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
  205|  49.2M|                     (left[-stride] + 2 * left[0] + left[stride]);
  206|  49.2M|      const int dy = (below[-1] + 2 * below[0] + below[1]) -
  207|  49.2M|                     (above[-1] + 2 * above[0] + above[1]);
  208|  49.2M|      grad_info_sb[r * sb_width + c].is_dx_zero = (dx == 0);
  209|  49.2M|      grad_info_sb[r * sb_width + c].abs_dx_abs_dy_sum =
  210|  49.2M|          (uint16_t)(abs(dx) + abs(dy));
  211|  49.2M|      grad_info_sb[r * sb_width + c].hist_bin_idx =
  212|  49.2M|          (dx != 0) ? get_hist_bin_idx(dx, dy) : -1;
  ------------------
  |  Branch (212:11): [True: 17.5M, False: 31.6M]
  ------------------
  213|  49.2M|    }
  214|   906k|    src += stride;
  215|   906k|  }
  216|  15.8k|}
encodeframe.c:init_src_var_info_of_4x4_sub_blocks:
  478|   137k|    const BLOCK_SIZE sb_size) {
  479|   137k|  if (!is_src_var_for_4x4_sub_blocks_caching_enabled(cpi)) return;
  ------------------
  |  Branch (479:7): [True: 137k, False: 0]
  ------------------
  480|       |
  481|      0|  const int mi_count_in_sb = mi_size_wide[sb_size] * mi_size_high[sb_size];
  482|      0|  for (int i = 0; i < mi_count_in_sb; i++) {
  ------------------
  |  Branch (482:19): [True: 0, False: 0]
  ------------------
  483|      0|    src_var_info_of_4x4_sub_blocks[i].var = -1;
  484|      0|    src_var_info_of_4x4_sub_blocks[i].log_var = -1.0;
  485|      0|  }
  486|      0|}
encodeframe.c:is_src_var_for_4x4_sub_blocks_caching_enabled:
  461|   137k|    const AV1_COMP *const cpi) {
  462|   137k|  const SPEED_FEATURES *const sf = &cpi->sf;
  463|   137k|  if (cpi->oxcf.mode != ALLINTRA) return false;
  ------------------
  |  Branch (463:7): [True: 137k, False: 0]
  ------------------
  464|       |
  465|      0|  if (sf->part_sf.partition_search_type == SEARCH_PARTITION) return true;
  ------------------
  |  Branch (465:7): [True: 0, False: 0]
  ------------------
  466|       |
  467|      0|  if (INTRA_RD_VAR_THRESH(cpi->oxcf.speed) <= 0 ||
  ------------------
  |  |   38|      0|#define INTRA_RD_VAR_THRESH(X) (1.0 - (0.25 * (X)))
  ------------------
  |  Branch (467:7): [True: 0, False: 0]
  ------------------
  468|      0|      (sf->rt_sf.use_nonrd_pick_mode && !sf->rt_sf.hybrid_intra_pickmode))
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:41): [True: 0, False: 0]
  ------------------
  469|      0|    return false;
  470|       |
  471|      0|  return true;
  472|      0|}
encoder.c:is_gradient_caching_for_hog_enabled:
  328|  73.6k|    const AV1_COMP *const cpi) {
  329|  73.6k|  const SPEED_FEATURES *const sf = &cpi->sf;
  330|  73.6k|  return frame_is_intra_only(&cpi->common) && !sf->rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (330:10): [True: 18.4k, False: 55.2k]
  |  Branch (330:47): [True: 12.3k, False: 6.10k]
  ------------------
  331|  12.3k|         (sf->part_sf.partition_search_type == SEARCH_PARTITION) &&
  ------------------
  |  Branch (331:10): [True: 12.3k, False: 0]
  ------------------
  332|  12.3k|         (sf->intra_sf.intra_pruning_with_hog ||
  ------------------
  |  Branch (332:11): [True: 12.3k, False: 0]
  ------------------
  333|      0|          sf->intra_sf.chroma_intra_pruning_with_hog);
  ------------------
  |  Branch (333:11): [True: 0, False: 0]
  ------------------
  334|  73.6k|}
encoder.c:is_src_var_for_4x4_sub_blocks_caching_enabled:
  461|  73.6k|    const AV1_COMP *const cpi) {
  462|  73.6k|  const SPEED_FEATURES *const sf = &cpi->sf;
  463|  73.6k|  if (cpi->oxcf.mode != ALLINTRA) return false;
  ------------------
  |  Branch (463:7): [True: 73.6k, False: 0]
  ------------------
  464|       |
  465|      0|  if (sf->part_sf.partition_search_type == SEARCH_PARTITION) return true;
  ------------------
  |  Branch (465:7): [True: 0, False: 0]
  ------------------
  466|       |
  467|      0|  if (INTRA_RD_VAR_THRESH(cpi->oxcf.speed) <= 0 ||
  ------------------
  |  |   38|      0|#define INTRA_RD_VAR_THRESH(X) (1.0 - (0.25 * (X)))
  ------------------
  |  Branch (467:7): [True: 0, False: 0]
  ------------------
  468|      0|      (sf->rt_sf.use_nonrd_pick_mode && !sf->rt_sf.hybrid_intra_pickmode))
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:41): [True: 0, False: 0]
  ------------------
  469|      0|    return false;
  470|       |
  471|      0|  return true;
  472|      0|}
ethread.c:is_src_var_for_4x4_sub_blocks_caching_enabled:
  461|  16.9k|    const AV1_COMP *const cpi) {
  462|  16.9k|  const SPEED_FEATURES *const sf = &cpi->sf;
  463|  16.9k|  if (cpi->oxcf.mode != ALLINTRA) return false;
  ------------------
  |  Branch (463:7): [True: 16.9k, False: 0]
  ------------------
  464|       |
  465|      0|  if (sf->part_sf.partition_search_type == SEARCH_PARTITION) return true;
  ------------------
  |  Branch (465:7): [True: 0, False: 0]
  ------------------
  466|       |
  467|      0|  if (INTRA_RD_VAR_THRESH(cpi->oxcf.speed) <= 0 ||
  ------------------
  |  |   38|      0|#define INTRA_RD_VAR_THRESH(X) (1.0 - (0.25 * (X)))
  ------------------
  |  Branch (467:7): [True: 0, False: 0]
  ------------------
  468|      0|      (sf->rt_sf.use_nonrd_pick_mode && !sf->rt_sf.hybrid_intra_pickmode))
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:41): [True: 0, False: 0]
  ------------------
  469|      0|    return false;
  470|       |
  471|      0|  return true;
  472|      0|}
palette.c:intra_mode_info_cost_y:
  508|   493k|                                         int discount_color_cost) {
  509|   493k|  int total_rate = mode_cost;
  510|   493k|  const ModeCosts *mode_costs = &x->mode_costs;
  511|   493k|  const int use_palette = mbmi->palette_mode_info.palette_size[0] > 0;
  512|   493k|  const int use_filter_intra = mbmi->filter_intra_mode_info.use_filter_intra;
  513|   493k|  const int use_intrabc = mbmi->use_intrabc;
  514|       |  // Can only activate one mode.
  515|   493k|  assert(((mbmi->mode != DC_PRED) + use_palette + use_intrabc +
  516|   493k|          use_filter_intra) <= 1);
  517|   493k|  const int try_palette = av1_allow_palette(
  518|   493k|      cpi->common.features.allow_screen_content_tools, mbmi->bsize);
  519|   493k|  if (try_palette && mbmi->mode == DC_PRED) {
  ------------------
  |  Branch (519:7): [True: 493k, False: 1]
  |  Branch (519:22): [True: 493k, False: 2]
  ------------------
  520|   493k|    const MACROBLOCKD *xd = &x->e_mbd;
  521|   493k|    const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  522|   493k|    const int mode_ctx = av1_get_palette_mode_ctx(xd);
  523|   493k|    total_rate +=
  524|   493k|        mode_costs->palette_y_mode_cost[bsize_ctx][mode_ctx][use_palette];
  525|   493k|    if (use_palette) {
  ------------------
  |  Branch (525:9): [True: 493k, False: 3]
  ------------------
  526|   493k|      const uint8_t *const color_map = xd->plane[0].color_index_map;
  527|   493k|      int block_width, block_height, rows, cols;
  528|   493k|      av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows,
  529|   493k|                               &cols);
  530|   493k|      const int plt_size = mbmi->palette_mode_info.palette_size[0];
  531|   493k|      int palette_mode_cost =
  532|   493k|          mode_costs
  533|   493k|              ->palette_y_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
  ------------------
  |  |   65|   493k|#define PALETTE_MIN_SIZE 2
  ------------------
  534|   493k|          write_uniform_cost(plt_size, color_map[0]);
  535|   493k|      uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  536|   493k|      const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
  537|   493k|      palette_mode_cost +=
  538|   493k|          av1_palette_color_cost_y(&mbmi->palette_mode_info, color_cache,
  539|   493k|                                   n_cache, cpi->common.seq_params->bit_depth);
  540|   493k|      if (!discount_color_cost)
  ------------------
  |  Branch (540:11): [True: 493k, False: 25]
  ------------------
  541|   493k|        palette_mode_cost +=
  542|   493k|            av1_cost_color_map(x, 0, bsize, mbmi->tx_size, PALETTE_MAP);
  543|       |
  544|   493k|      total_rate += palette_mode_cost;
  545|   493k|    }
  546|   493k|  }
  547|   493k|  if (av1_filter_intra_allowed(&cpi->common, mbmi)) {
  ------------------
  |  Branch (547:7): [True: 0, False: 493k]
  ------------------
  548|      0|    total_rate += mode_costs->filter_intra_cost[mbmi->bsize][use_filter_intra];
  549|      0|    if (use_filter_intra) {
  ------------------
  |  Branch (549:9): [True: 0, False: 0]
  ------------------
  550|      0|      total_rate +=
  551|      0|          mode_costs->filter_intra_mode_cost[mbmi->filter_intra_mode_info
  552|      0|                                                 .filter_intra_mode];
  553|      0|    }
  554|      0|  }
  555|   493k|  if (av1_is_directional_mode(mbmi->mode)) {
  ------------------
  |  Branch (555:7): [True: 0, False: 493k]
  ------------------
  556|      0|    if (av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (556:9): [True: 0, False: 0]
  ------------------
  557|      0|      total_rate +=
  558|      0|          mode_costs->angle_delta_cost[mbmi->mode - V_PRED]
  559|      0|                                      [MAX_ANGLE_DELTA +
  ------------------
  |  |  467|      0|#define MAX_ANGLE_DELTA 3
  ------------------
  560|      0|                                       mbmi->angle_delta[PLANE_TYPE_Y]];
  561|      0|    }
  562|      0|  }
  563|   493k|  if (av1_allow_intrabc(&cpi->common))
  ------------------
  |  Branch (563:7): [True: 56.3k, False: 436k]
  ------------------
  564|  56.3k|    total_rate += mode_costs->intrabc_cost[use_intrabc];
  565|   493k|  return total_rate;
  566|   493k|}
palette.c:write_uniform_cost:
  489|   831k|static inline int write_uniform_cost(int n, int v) {
  490|   831k|  const int l = get_unsigned_bits(n);
  491|   831k|  const int m = (1 << l) - n;
  492|   831k|  if (l == 0) return 0;
  ------------------
  |  Branch (492:7): [True: 0, False: 831k]
  ------------------
  493|   831k|  if (v < m)
  ------------------
  |  Branch (493:7): [True: 618k, False: 213k]
  ------------------
  494|   618k|    return av1_cost_literal(l - 1);
  ------------------
  |  |   29|   618k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   618k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  495|   213k|  else
  496|   213k|    return av1_cost_literal(l);
  ------------------
  |  |   29|   213k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   213k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  497|   831k|}
palette.c:intra_mode_info_cost_uv:
  575|   338k|                                          BLOCK_SIZE bsize, int mode_cost) {
  576|   338k|  int total_rate = mode_cost;
  577|   338k|  const ModeCosts *mode_costs = &x->mode_costs;
  578|   338k|  const int use_palette = mbmi->palette_mode_info.palette_size[1] > 0;
  579|   338k|  const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
  580|       |  // Can only activate one mode.
  581|   338k|  assert(((uv_mode != UV_DC_PRED) + use_palette + mbmi->use_intrabc) <= 1);
  582|       |
  583|   338k|  const int try_palette = av1_allow_palette(
  584|   338k|      cpi->common.features.allow_screen_content_tools, mbmi->bsize);
  585|   338k|  if (try_palette && uv_mode == UV_DC_PRED) {
  ------------------
  |  Branch (585:7): [True: 338k, False: 18.4E]
  |  Branch (585:22): [True: 338k, False: 18.4E]
  ------------------
  586|   338k|    const PALETTE_MODE_INFO *pmi = &mbmi->palette_mode_info;
  587|   338k|    total_rate +=
  588|   338k|        mode_costs->palette_uv_mode_cost[pmi->palette_size[0] > 0][use_palette];
  589|   338k|    if (use_palette) {
  ------------------
  |  Branch (589:9): [True: 338k, False: 18.4E]
  ------------------
  590|   338k|      const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  591|   338k|      const int plt_size = pmi->palette_size[1];
  592|   338k|      const MACROBLOCKD *xd = &x->e_mbd;
  593|   338k|      const uint8_t *const color_map = xd->plane[1].color_index_map;
  594|   338k|      int palette_mode_cost =
  595|   338k|          mode_costs
  596|   338k|              ->palette_uv_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
  ------------------
  |  |   65|   338k|#define PALETTE_MIN_SIZE 2
  ------------------
  597|   338k|          write_uniform_cost(plt_size, color_map[0]);
  598|   338k|      uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  599|   338k|      const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  600|   338k|      palette_mode_cost += av1_palette_color_cost_uv(
  601|   338k|          pmi, color_cache, n_cache, cpi->common.seq_params->bit_depth);
  602|   338k|      palette_mode_cost +=
  603|   338k|          av1_cost_color_map(x, 1, bsize, mbmi->tx_size, PALETTE_MAP);
  604|   338k|      total_rate += palette_mode_cost;
  605|   338k|    }
  606|   338k|  }
  607|   338k|  const PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
  608|   338k|  if (av1_is_directional_mode(intra_mode)) {
  ------------------
  |  Branch (608:7): [True: 0, False: 338k]
  ------------------
  609|      0|    if (av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (609:9): [True: 0, False: 0]
  ------------------
  610|      0|      total_rate +=
  611|      0|          mode_costs->angle_delta_cost[intra_mode - V_PRED]
  612|      0|                                      [mbmi->angle_delta[PLANE_TYPE_UV] +
  613|      0|                                       MAX_ANGLE_DELTA];
  ------------------
  |  |  467|      0|#define MAX_ANGLE_DELTA 3
  ------------------
  614|      0|    }
  615|      0|  }
  616|   338k|  return total_rate;
  617|   338k|}
rdopt.c:intra_mode_info_cost_uv:
  575|   730k|                                          BLOCK_SIZE bsize, int mode_cost) {
  576|   730k|  int total_rate = mode_cost;
  577|   730k|  const ModeCosts *mode_costs = &x->mode_costs;
  578|   730k|  const int use_palette = mbmi->palette_mode_info.palette_size[1] > 0;
  579|   730k|  const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
  580|       |  // Can only activate one mode.
  581|   730k|  assert(((uv_mode != UV_DC_PRED) + use_palette + mbmi->use_intrabc) <= 1);
  582|       |
  583|   730k|  const int try_palette = av1_allow_palette(
  584|   730k|      cpi->common.features.allow_screen_content_tools, mbmi->bsize);
  585|   730k|  if (try_palette && uv_mode == UV_DC_PRED) {
  ------------------
  |  Branch (585:7): [True: 63.9k, False: 666k]
  |  Branch (585:22): [True: 42.5k, False: 21.4k]
  ------------------
  586|  42.5k|    const PALETTE_MODE_INFO *pmi = &mbmi->palette_mode_info;
  587|  42.5k|    total_rate +=
  588|  42.5k|        mode_costs->palette_uv_mode_cost[pmi->palette_size[0] > 0][use_palette];
  589|  42.5k|    if (use_palette) {
  ------------------
  |  Branch (589:9): [True: 30.0k, False: 12.4k]
  ------------------
  590|  30.0k|      const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  591|  30.0k|      const int plt_size = pmi->palette_size[1];
  592|  30.0k|      const MACROBLOCKD *xd = &x->e_mbd;
  593|  30.0k|      const uint8_t *const color_map = xd->plane[1].color_index_map;
  594|  30.0k|      int palette_mode_cost =
  595|  30.0k|          mode_costs
  596|  30.0k|              ->palette_uv_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
  ------------------
  |  |   65|  30.0k|#define PALETTE_MIN_SIZE 2
  ------------------
  597|  30.0k|          write_uniform_cost(plt_size, color_map[0]);
  598|  30.0k|      uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  599|  30.0k|      const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  600|  30.0k|      palette_mode_cost += av1_palette_color_cost_uv(
  601|  30.0k|          pmi, color_cache, n_cache, cpi->common.seq_params->bit_depth);
  602|  30.0k|      palette_mode_cost +=
  603|  30.0k|          av1_cost_color_map(x, 1, bsize, mbmi->tx_size, PALETTE_MAP);
  604|  30.0k|      total_rate += palette_mode_cost;
  605|  30.0k|    }
  606|  42.5k|  }
  607|   730k|  const PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
  608|   730k|  if (av1_is_directional_mode(intra_mode)) {
  ------------------
  |  Branch (608:7): [True: 68.6k, False: 662k]
  ------------------
  609|  68.6k|    if (av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (609:9): [True: 37.6k, False: 30.9k]
  ------------------
  610|  37.6k|      total_rate +=
  611|  37.6k|          mode_costs->angle_delta_cost[intra_mode - V_PRED]
  612|  37.6k|                                      [mbmi->angle_delta[PLANE_TYPE_UV] +
  613|  37.6k|                                       MAX_ANGLE_DELTA];
  ------------------
  |  |  467|  37.6k|#define MAX_ANGLE_DELTA 3
  ------------------
  614|  37.6k|    }
  615|  68.6k|  }
  616|   730k|  return total_rate;
  617|   730k|}
rdopt.c:write_uniform_cost:
  489|  30.0k|static inline int write_uniform_cost(int n, int v) {
  490|  30.0k|  const int l = get_unsigned_bits(n);
  491|  30.0k|  const int m = (1 << l) - n;
  492|  30.0k|  if (l == 0) return 0;
  ------------------
  |  Branch (492:7): [True: 0, False: 30.0k]
  ------------------
  493|  30.0k|  if (v < m)
  ------------------
  |  Branch (493:7): [True: 21.0k, False: 8.99k]
  ------------------
  494|  21.0k|    return av1_cost_literal(l - 1);
  ------------------
  |  |   29|  21.0k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  21.0k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  495|  8.99k|  else
  496|  8.99k|    return av1_cost_literal(l);
  ------------------
  |  |   29|  8.99k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  8.99k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  497|  30.0k|}
intra_mode_search.c:prune_intra_mode_with_hog:
  439|  2.57M|    uint8_t *directional_mode_skip_mask, int is_chroma) {
  440|  2.57M|  const int plane = is_chroma ? AOM_PLANE_U : AOM_PLANE_Y;
  ------------------
  |  |  282|   719k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                const int plane = is_chroma ? AOM_PLANE_U : AOM_PLANE_Y;
  ------------------
  |  |  281|  1.85M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (440:21): [True: 719k, False: 1.85M]
  ------------------
  441|  2.57M|  float hist[BINS] = { 0.0f };
  442|  2.57M|  collect_hog_data(x, bsize, sb_size, plane, hist);
  443|       |
  444|       |  // Make prediction for each of the mode
  445|  2.57M|  float scores[DIRECTIONAL_MODES] = { 0.0f };
  446|  2.57M|  av1_nn_predict(hist, &av1_intra_hog_model_nnconfig, 1, scores);
  447|  23.2M|  for (UV_PREDICTION_MODE uv_mode = UV_V_PRED; uv_mode <= UV_D67_PRED;
  ------------------
  |  Branch (447:48): [True: 20.6M, False: 2.57M]
  ------------------
  448|  20.6M|       uv_mode++) {
  449|  20.6M|    if (scores[uv_mode - UV_V_PRED] <= th) {
  ------------------
  |  Branch (449:9): [True: 18.8M, False: 1.74M]
  ------------------
  450|  18.8M|      directional_mode_skip_mask[uv_mode] = 1;
  451|  18.8M|    }
  452|  20.6M|  }
  453|  2.57M|}
intra_mode_search.c:collect_hog_data:
  407|  2.57M|                                    BLOCK_SIZE sb_size, int plane, float *hog) {
  408|  2.57M|  const MACROBLOCKD *xd = &x->e_mbd;
  409|  2.57M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  410|  2.57M|  const int ss_x = pd->subsampling_x;
  411|  2.57M|  const int ss_y = pd->subsampling_y;
  412|  2.57M|  const int bh = block_size_high[bsize];
  413|  2.57M|  const int bw = block_size_wide[bsize];
  414|  2.57M|  const int rows =
  415|  2.57M|      ((xd->mb_to_bottom_edge >= 0) ? bh : (xd->mb_to_bottom_edge >> 3) + bh) >>
  ------------------
  |  Branch (415:8): [True: 2.56M, False: 11.3k]
  ------------------
  416|  2.57M|      ss_y;
  417|  2.57M|  const int cols =
  418|  2.57M|      ((xd->mb_to_right_edge >= 0) ? bw : (xd->mb_to_right_edge >> 3) + bw) >>
  ------------------
  |  Branch (418:8): [True: 2.56M, False: 9.98k]
  ------------------
  419|  2.57M|      ss_x;
  420|       |
  421|       |  // If gradient data is already generated at SB level, reuse the cached data.
  422|       |  // Otherwise, compute the data.
  423|  2.57M|  if (x->is_sb_gradient_cached[plane]) {
  ------------------
  |  Branch (423:7): [True: 493k, False: 2.08M]
  ------------------
  424|   493k|    generate_hog_using_gradient_cache(x, rows, cols, sb_size, plane, hog);
  425|  2.08M|  } else {
  426|  2.08M|    const uint8_t *src = x->plane[plane].src.buf;
  427|  2.08M|    const int src_stride = x->plane[plane].src.stride;
  428|  2.08M|    generate_hog(src, src_stride, rows, cols, hog, is_cur_buf_hbd(xd));
  429|  2.08M|  }
  430|       |
  431|       |  // Scale the hog so the luma and chroma are on the same scale
  432|  85.1M|  for (int b = 0; b < BINS; ++b) {
  ------------------
  |  |   40|  85.1M|#define BINS 32
  ------------------
  |  Branch (432:19): [True: 82.5M, False: 2.57M]
  ------------------
  433|  82.5M|    hog[b] *= (1 + ss_x) * (1 + ss_y);
  434|  82.5M|  }
  435|  2.57M|}
intra_mode_search.c:generate_hog_using_gradient_cache:
  368|   493k|                                                     float *hist) {
  369|   493k|  float total = 0.1f;
  370|   493k|  const int ss_x = x->e_mbd.plane[plane].subsampling_x;
  371|   493k|  const int ss_y = x->e_mbd.plane[plane].subsampling_y;
  372|   493k|  const int sb_width = block_size_wide[sb_size] >> ss_x;
  373|       |
  374|       |  // Derive the offset from the starting of the superblock in order to locate
  375|       |  // the block level gradient data in the cache.
  376|   493k|  const int mi_row_in_sb = x->e_mbd.mi_row & (mi_size_high[sb_size] - 1);
  377|   493k|  const int mi_col_in_sb = x->e_mbd.mi_col & (mi_size_wide[sb_size] - 1);
  378|   493k|  const int block_offset_in_grad_cache =
  379|   493k|      sb_width * (mi_row_in_sb << (MI_SIZE_LOG2 - ss_y)) +
  ------------------
  |  |   39|   493k|#define MI_SIZE_LOG2 2
  ------------------
  380|   493k|      (mi_col_in_sb << (MI_SIZE_LOG2 - ss_x));
  ------------------
  |  |   39|   493k|#define MI_SIZE_LOG2 2
  ------------------
  381|   493k|  const PixelLevelGradientInfo *grad_info_blk = x->pixel_gradient_info +
  382|   493k|                                                plane * MAX_SB_SQUARE +
  ------------------
  |  |   33|   493k|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|   493k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   493k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|   493k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|   493k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  383|   493k|                                                block_offset_in_grad_cache;
  384|       |
  385|       |  // Retrieve the cached gradient information and generate the histogram.
  386|  4.24M|  for (int r = 1; r < rows - 1; ++r) {
  ------------------
  |  Branch (386:19): [True: 3.74M, False: 493k]
  ------------------
  387|  42.9M|    for (int c = 1; c < cols - 1; ++c) {
  ------------------
  |  Branch (387:21): [True: 39.1M, False: 3.74M]
  ------------------
  388|  39.1M|      const uint16_t abs_dx_abs_dy_sum =
  389|  39.1M|          grad_info_blk[r * sb_width + c].abs_dx_abs_dy_sum;
  390|  39.1M|      if (!abs_dx_abs_dy_sum) continue;
  ------------------
  |  Branch (390:11): [True: 386k, False: 38.7M]
  ------------------
  391|  38.7M|      total += abs_dx_abs_dy_sum;
  392|  38.7M|      const bool is_dx_zero = grad_info_blk[r * sb_width + c].is_dx_zero;
  393|  38.7M|      if (is_dx_zero) {
  ------------------
  |  Branch (393:11): [True: 3.28M, False: 35.5M]
  ------------------
  394|  3.28M|        hist[0] += abs_dx_abs_dy_sum >> 1;
  395|  3.28M|        hist[BINS - 1] += abs_dx_abs_dy_sum >> 1;
  ------------------
  |  |   40|  3.28M|#define BINS 32
  ------------------
  396|  35.5M|      } else {
  397|  35.5M|        const int8_t idx = grad_info_blk[r * sb_width + c].hist_bin_idx;
  398|       |        assert(idx >= 0 && idx < BINS);
  399|  35.5M|        hist[idx] += abs_dx_abs_dy_sum;
  400|  35.5M|      }
  401|  38.7M|    }
  402|  3.74M|  }
  403|   493k|  normalize_hog(total, hist);
  404|   493k|}
intra_mode_search.c:normalize_hog:
  145|  2.57M|static inline void normalize_hog(float total, float *hist) {
  146|  85.0M|  for (int i = 0; i < BINS; ++i) hist[i] /= total;
  ------------------
  |  |   40|  85.0M|#define BINS 32
  ------------------
  |  Branch (146:19): [True: 82.5M, False: 2.57M]
  ------------------
  147|  2.57M|}
intra_mode_search.c:generate_hog:
  291|  2.08M|                                int cols, float *hist, int highbd) {
  292|  2.08M|#if CONFIG_AV1_HIGHBITDEPTH
  293|  2.08M|  if (highbd) {
  ------------------
  |  Branch (293:7): [True: 275k, False: 1.80M]
  ------------------
  294|   275k|    highbd_generate_hog(src8, stride, rows, cols, hist);
  295|   275k|    return;
  296|   275k|  }
  297|       |#else
  298|       |  (void)highbd;
  299|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
  300|  1.80M|  lowbd_generate_hog(src8, stride, rows, cols, hist);
  301|  1.80M|}
intra_mode_search.c:highbd_generate_hog:
  220|   275k|                                       int rows, int cols, float *hist) {
  221|   275k|  float total = 0.1f;
  222|   275k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|   275k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  223|   275k|  src += stride;
  224|  1.89M|  for (int r = 1; r < rows - 1; ++r) {
  ------------------
  |  Branch (224:19): [True: 1.62M, False: 275k]
  ------------------
  225|  11.1M|    for (int c = 1; c < cols - 1; ++c) {
  ------------------
  |  Branch (225:21): [True: 9.48M, False: 1.62M]
  ------------------
  226|  9.48M|      const uint16_t *above = &src[c - stride];
  227|  9.48M|      const uint16_t *below = &src[c + stride];
  228|  9.48M|      const uint16_t *left = &src[c - 1];
  229|  9.48M|      const uint16_t *right = &src[c + 1];
  230|       |      // Calculate gradient using Sobel filters.
  231|  9.48M|      const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
  232|  9.48M|                     (left[-stride] + 2 * left[0] + left[stride]);
  233|  9.48M|      const int dy = (below[-1] + 2 * below[0] + below[1]) -
  234|  9.48M|                     (above[-1] + 2 * above[0] + above[1]);
  235|  9.48M|      if (dx == 0 && dy == 0) continue;
  ------------------
  |  Branch (235:11): [True: 1.68M, False: 7.79M]
  |  Branch (235:22): [True: 371k, False: 1.31M]
  ------------------
  236|  9.10M|      const int temp = abs(dx) + abs(dy);
  237|  9.10M|      if (!temp) continue;
  ------------------
  |  Branch (237:11): [True: 0, False: 9.10M]
  ------------------
  238|  9.10M|      total += temp;
  239|  9.10M|      if (dx == 0) {
  ------------------
  |  Branch (239:11): [True: 1.31M, False: 7.79M]
  ------------------
  240|  1.31M|        hist[0] += temp / 2;
  241|  1.31M|        hist[BINS - 1] += temp / 2;
  ------------------
  |  |   40|  1.31M|#define BINS 32
  ------------------
  242|  7.79M|      } else {
  243|  7.79M|        const int idx = get_hist_bin_idx(dx, dy);
  244|  7.79M|        assert(idx >= 0 && idx < BINS);
  245|  7.79M|        hist[idx] += temp;
  246|  7.79M|      }
  247|  9.10M|    }
  248|  1.62M|    src += stride;
  249|  1.62M|  }
  250|       |
  251|   275k|  normalize_hog(total, hist);
  252|   275k|}
intra_mode_search.c:get_hist_bin_idx:
  106|  62.3M|static inline int get_hist_bin_idx(int dx, int dy) {
  107|  62.3M|  const int32_t ratio = (dy * (1 << FIX_PREC_BITS)) / dx;
  ------------------
  |  |  105|  62.3M|#define FIX_PREC_BITS (16)
  ------------------
  108|       |
  109|       |  // Find index by bisection
  110|  62.3M|  static const int thresholds[BINS] = {
  111|  62.3M|    -1334015, -441798, -261605, -183158, -138560, -109331, -88359, -72303,
  112|  62.3M|    -59392,   -48579,  -39272,  -30982,  -23445,  -16400,  -9715,  -3194,
  113|  62.3M|    3227,     9748,    16433,   23478,   31015,   39305,   48611,  59425,
  114|  62.3M|    72336,    88392,   109364,  138593,  183191,  261638,  441831, INT32_MAX
  115|  62.3M|  };
  116|       |
  117|  62.3M|  int lo_idx = 0, hi_idx = BINS - 1;
  ------------------
  |  |   40|  62.3M|#define BINS 32
  ------------------
  118|       |  // Divide into segments of size 8 gives better performance than binary search
  119|       |  // here.
  120|  62.3M|  if (ratio <= thresholds[7]) {
  ------------------
  |  Branch (120:7): [True: 13.6M, False: 48.7M]
  ------------------
  121|  13.6M|    lo_idx = 0;
  122|  13.6M|    hi_idx = 7;
  123|  48.7M|  } else if (ratio <= thresholds[15]) {
  ------------------
  |  Branch (123:14): [True: 14.6M, False: 34.0M]
  ------------------
  124|  14.6M|    lo_idx = 8;
  125|  14.6M|    hi_idx = 15;
  126|  34.0M|  } else if (ratio <= thresholds[23]) {
  ------------------
  |  Branch (126:14): [True: 18.4M, False: 15.5M]
  ------------------
  127|  18.4M|    lo_idx = 16;
  128|  18.4M|    hi_idx = 23;
  129|  18.4M|  } else {
  130|  15.5M|    lo_idx = 24;
  131|  15.5M|    hi_idx = 31;
  132|  15.5M|  }
  133|       |
  134|   272M|  for (int idx = lo_idx; idx <= hi_idx; idx++) {
  ------------------
  |  Branch (134:26): [True: 272M, False: 3.85k]
  ------------------
  135|   272M|    if (ratio <= thresholds[idx]) {
  ------------------
  |  Branch (135:9): [True: 62.3M, False: 209M]
  ------------------
  136|  62.3M|      return idx;
  137|  62.3M|    }
  138|   272M|  }
  139|  62.3M|  assert(0 && "No valid histogram bin found!");
  140|  3.85k|  return BINS - 1;
  ------------------
  |  |   40|  3.85k|#define BINS 32
  ------------------
  141|  62.3M|}
intra_mode_search.c:lowbd_generate_hog:
  150|  1.80M|                                      int cols, float *hist) {
  151|  1.80M|  float total = 0.1f;
  152|  1.80M|  src += stride;
  153|  11.8M|  for (int r = 1; r < rows - 1; ++r) {
  ------------------
  |  Branch (153:19): [True: 10.0M, False: 1.80M]
  ------------------
  154|  67.8M|    for (int c = 1; c < cols - 1; ++c) {
  ------------------
  |  Branch (154:21): [True: 57.7M, False: 10.0M]
  ------------------
  155|  57.7M|      const uint8_t *above = &src[c - stride];
  156|  57.7M|      const uint8_t *below = &src[c + stride];
  157|  57.7M|      const uint8_t *left = &src[c - 1];
  158|  57.7M|      const uint8_t *right = &src[c + 1];
  159|       |      // Calculate gradient using Sobel filters.
  160|  57.7M|      const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
  161|  57.7M|                     (left[-stride] + 2 * left[0] + left[stride]);
  162|  57.7M|      const int dy = (below[-1] + 2 * below[0] + below[1]) -
  163|  57.7M|                     (above[-1] + 2 * above[0] + above[1]);
  164|  57.7M|      if (dx == 0 && dy == 0) continue;
  ------------------
  |  Branch (164:11): [True: 3.21M, False: 54.5M]
  |  Branch (164:22): [True: 316k, False: 2.89M]
  ------------------
  165|  57.4M|      const int temp = abs(dx) + abs(dy);
  166|  57.4M|      if (!temp) continue;
  ------------------
  |  Branch (166:11): [True: 0, False: 57.4M]
  ------------------
  167|  57.4M|      total += temp;
  168|  57.4M|      if (dx == 0) {
  ------------------
  |  Branch (168:11): [True: 2.89M, False: 54.5M]
  ------------------
  169|  2.89M|        hist[0] += temp / 2;
  170|  2.89M|        hist[BINS - 1] += temp / 2;
  ------------------
  |  |   40|  2.89M|#define BINS 32
  ------------------
  171|  54.5M|      } else {
  172|  54.5M|        const int idx = get_hist_bin_idx(dx, dy);
  173|  54.5M|        assert(idx >= 0 && idx < BINS);
  174|  54.5M|        hist[idx] += temp;
  175|  54.5M|      }
  176|  57.4M|    }
  177|  10.0M|    src += stride;
  178|  10.0M|  }
  179|       |
  180|  1.80M|  normalize_hog(total, hist);
  181|  1.80M|}
intra_mode_search.c:intra_mode_info_cost_uv:
  575|  3.87M|                                          BLOCK_SIZE bsize, int mode_cost) {
  576|  3.87M|  int total_rate = mode_cost;
  577|  3.87M|  const ModeCosts *mode_costs = &x->mode_costs;
  578|  3.87M|  const int use_palette = mbmi->palette_mode_info.palette_size[1] > 0;
  579|  3.87M|  const UV_PREDICTION_MODE uv_mode = mbmi->uv_mode;
  580|       |  // Can only activate one mode.
  581|  3.87M|  assert(((uv_mode != UV_DC_PRED) + use_palette + mbmi->use_intrabc) <= 1);
  582|       |
  583|  3.87M|  const int try_palette = av1_allow_palette(
  584|  3.87M|      cpi->common.features.allow_screen_content_tools, mbmi->bsize);
  585|  3.87M|  if (try_palette && uv_mode == UV_DC_PRED) {
  ------------------
  |  Branch (585:7): [True: 289k, False: 3.58M]
  |  Branch (585:22): [True: 76.6k, False: 213k]
  ------------------
  586|  76.6k|    const PALETTE_MODE_INFO *pmi = &mbmi->palette_mode_info;
  587|  76.6k|    total_rate +=
  588|  76.6k|        mode_costs->palette_uv_mode_cost[pmi->palette_size[0] > 0][use_palette];
  589|  76.6k|    if (use_palette) {
  ------------------
  |  Branch (589:9): [True: 0, False: 76.6k]
  ------------------
  590|      0|      const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  591|      0|      const int plt_size = pmi->palette_size[1];
  592|      0|      const MACROBLOCKD *xd = &x->e_mbd;
  593|      0|      const uint8_t *const color_map = xd->plane[1].color_index_map;
  594|      0|      int palette_mode_cost =
  595|      0|          mode_costs
  596|      0|              ->palette_uv_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
  ------------------
  |  |   65|      0|#define PALETTE_MIN_SIZE 2
  ------------------
  597|      0|          write_uniform_cost(plt_size, color_map[0]);
  598|      0|      uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  599|      0|      const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  600|      0|      palette_mode_cost += av1_palette_color_cost_uv(
  601|      0|          pmi, color_cache, n_cache, cpi->common.seq_params->bit_depth);
  602|      0|      palette_mode_cost +=
  603|      0|          av1_cost_color_map(x, 1, bsize, mbmi->tx_size, PALETTE_MAP);
  604|      0|      total_rate += palette_mode_cost;
  605|      0|    }
  606|  76.6k|  }
  607|  3.87M|  const PREDICTION_MODE intra_mode = get_uv_mode(uv_mode);
  608|  3.87M|  if (av1_is_directional_mode(intra_mode)) {
  ------------------
  |  Branch (608:7): [True: 1.57M, False: 2.30M]
  ------------------
  609|  1.57M|    if (av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (609:9): [True: 1.23M, False: 338k]
  ------------------
  610|  1.23M|      total_rate +=
  611|  1.23M|          mode_costs->angle_delta_cost[intra_mode - V_PRED]
  612|  1.23M|                                      [mbmi->angle_delta[PLANE_TYPE_UV] +
  613|  1.23M|                                       MAX_ANGLE_DELTA];
  ------------------
  |  |  467|  1.23M|#define MAX_ANGLE_DELTA 3
  ------------------
  614|  1.23M|    }
  615|  1.57M|  }
  616|  3.87M|  return total_rate;
  617|  3.87M|}
intra_mode_search.c:write_uniform_cost:
  489|  4.47k|static inline int write_uniform_cost(int n, int v) {
  490|  4.47k|  const int l = get_unsigned_bits(n);
  491|  4.47k|  const int m = (1 << l) - n;
  492|  4.47k|  if (l == 0) return 0;
  ------------------
  |  Branch (492:7): [True: 0, False: 4.47k]
  ------------------
  493|  4.47k|  if (v < m)
  ------------------
  |  Branch (493:7): [True: 3.27k, False: 1.20k]
  ------------------
  494|  3.27k|    return av1_cost_literal(l - 1);
  ------------------
  |  |   29|  3.27k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  3.27k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  495|  1.20k|  else
  496|  1.20k|    return av1_cost_literal(l);
  ------------------
  |  |   29|  1.20k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  1.20k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  497|  4.47k|}
intra_mode_search.c:intra_model_rd:
  625|  27.8M|                              bool do_border_pad) {
  626|  27.8M|  MACROBLOCKD *const xd = &x->e_mbd;
  627|  27.8M|  const BitDepthInfo bd_info = get_bit_depth_info(xd);
  628|  27.8M|  int row, col;
  629|  27.8M|  assert(!is_inter_block(xd->mi[0]));
  630|  27.8M|  const int stepr = tx_size_high_unit[tx_size];
  631|  27.8M|  const int stepc = tx_size_wide_unit[tx_size];
  632|  27.8M|  const int txbw = tx_size_wide[tx_size];
  633|  27.8M|  const int txbh = tx_size_high[tx_size];
  634|  27.8M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  635|  27.8M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  636|  27.8M|  int64_t satd_cost = 0;
  637|  27.8M|  struct macroblock_plane *p = &x->plane[plane];
  638|  27.8M|  struct macroblockd_plane *pd = &xd->plane[plane];
  639|       |  // Prediction.
  640|  56.9M|  for (row = 0; row < max_blocks_high; row += stepr) {
  ------------------
  |  Branch (640:17): [True: 29.0M, False: 27.8M]
  ------------------
  641|  59.5M|    for (col = 0; col < max_blocks_wide; col += stepc) {
  ------------------
  |  Branch (641:19): [True: 30.4M, False: 29.0M]
  ------------------
  642|  30.4M|      av1_predict_intra_block_facade(cm, xd, plane, col, row, tx_size);
  643|       |      // Here we use p->src_diff and p->coeff as temporary buffers for
  644|       |      // prediction residue and transform coefficients. The buffers are only
  645|       |      // used in this for loop, therefore we don't need to properly add offset
  646|       |      // to the buffers.
  647|  30.4M|      av1_subtract_block(
  648|  30.4M|          x, txbh, txbw, p->src_diff, block_size_wide[plane_bsize],
  649|  30.4M|          p->src.buf + (((row * p->src.stride) + col) << 2), p->src.stride,
  650|  30.4M|          pd->dst.buf + (((row * pd->dst.stride) + col) << 2), pd->dst.stride,
  651|  30.4M|          plane, plane_bsize, col, row, DCT_DCT, do_border_pad);
  652|  30.4M|      av1_quick_txfm(use_hadamard, tx_size, bd_info, p->src_diff,
  653|  30.4M|                     block_size_wide[plane_bsize], p->coeff);
  654|  30.4M|      satd_cost += aom_satd(p->coeff, tx_size_2d[tx_size]);
  655|  30.4M|    }
  656|  29.0M|  }
  657|  27.8M|  return satd_cost;
  658|  27.8M|}
intra_mode_search.c:intra_mode_info_cost_y:
  508|  16.0M|                                         int discount_color_cost) {
  509|  16.0M|  int total_rate = mode_cost;
  510|  16.0M|  const ModeCosts *mode_costs = &x->mode_costs;
  511|  16.0M|  const int use_palette = mbmi->palette_mode_info.palette_size[0] > 0;
  512|  16.0M|  const int use_filter_intra = mbmi->filter_intra_mode_info.use_filter_intra;
  513|  16.0M|  const int use_intrabc = mbmi->use_intrabc;
  514|       |  // Can only activate one mode.
  515|  16.0M|  assert(((mbmi->mode != DC_PRED) + use_palette + use_intrabc +
  516|  16.0M|          use_filter_intra) <= 1);
  517|  16.0M|  const int try_palette = av1_allow_palette(
  518|  16.0M|      cpi->common.features.allow_screen_content_tools, mbmi->bsize);
  519|  16.0M|  if (try_palette && mbmi->mode == DC_PRED) {
  ------------------
  |  Branch (519:7): [True: 954k, False: 15.0M]
  |  Branch (519:22): [True: 677k, False: 276k]
  ------------------
  520|   677k|    const MACROBLOCKD *xd = &x->e_mbd;
  521|   677k|    const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
  522|   677k|    const int mode_ctx = av1_get_palette_mode_ctx(xd);
  523|   677k|    total_rate +=
  524|   677k|        mode_costs->palette_y_mode_cost[bsize_ctx][mode_ctx][use_palette];
  525|   677k|    if (use_palette) {
  ------------------
  |  Branch (525:9): [True: 4.47k, False: 672k]
  ------------------
  526|  4.47k|      const uint8_t *const color_map = xd->plane[0].color_index_map;
  527|  4.47k|      int block_width, block_height, rows, cols;
  528|  4.47k|      av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows,
  529|  4.47k|                               &cols);
  530|  4.47k|      const int plt_size = mbmi->palette_mode_info.palette_size[0];
  531|  4.47k|      int palette_mode_cost =
  532|  4.47k|          mode_costs
  533|  4.47k|              ->palette_y_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
  ------------------
  |  |   65|  4.47k|#define PALETTE_MIN_SIZE 2
  ------------------
  534|  4.47k|          write_uniform_cost(plt_size, color_map[0]);
  535|  4.47k|      uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  536|  4.47k|      const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
  537|  4.47k|      palette_mode_cost +=
  538|  4.47k|          av1_palette_color_cost_y(&mbmi->palette_mode_info, color_cache,
  539|  4.47k|                                   n_cache, cpi->common.seq_params->bit_depth);
  540|  4.47k|      if (!discount_color_cost)
  ------------------
  |  Branch (540:11): [True: 4.47k, False: 0]
  ------------------
  541|  4.47k|        palette_mode_cost +=
  542|  4.47k|            av1_cost_color_map(x, 0, bsize, mbmi->tx_size, PALETTE_MAP);
  543|       |
  544|  4.47k|      total_rate += palette_mode_cost;
  545|  4.47k|    }
  546|   677k|  }
  547|  16.0M|  if (av1_filter_intra_allowed(&cpi->common, mbmi)) {
  ------------------
  |  Branch (547:7): [True: 11.9M, False: 4.03M]
  ------------------
  548|  11.9M|    total_rate += mode_costs->filter_intra_cost[mbmi->bsize][use_filter_intra];
  549|  11.9M|    if (use_filter_intra) {
  ------------------
  |  Branch (549:9): [True: 9.06M, False: 2.91M]
  ------------------
  550|  9.06M|      total_rate +=
  551|  9.06M|          mode_costs->filter_intra_mode_cost[mbmi->filter_intra_mode_info
  552|  9.06M|                                                 .filter_intra_mode];
  553|  9.06M|    }
  554|  11.9M|  }
  555|  16.0M|  if (av1_is_directional_mode(mbmi->mode)) {
  ------------------
  |  Branch (555:7): [True: 2.97M, False: 13.0M]
  ------------------
  556|  2.97M|    if (av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (556:9): [True: 1.90M, False: 1.07M]
  ------------------
  557|  1.90M|      total_rate +=
  558|  1.90M|          mode_costs->angle_delta_cost[mbmi->mode - V_PRED]
  559|  1.90M|                                      [MAX_ANGLE_DELTA +
  ------------------
  |  |  467|  1.90M|#define MAX_ANGLE_DELTA 3
  ------------------
  560|  1.90M|                                       mbmi->angle_delta[PLANE_TYPE_Y]];
  561|  1.90M|    }
  562|  2.97M|  }
  563|  16.0M|  if (av1_allow_intrabc(&cpi->common))
  ------------------
  |  Branch (563:7): [True: 372k, False: 15.6M]
  ------------------
  564|   372k|    total_rate += mode_costs->intrabc_cost[use_intrabc];
  565|  16.0M|  return total_rate;
  566|  16.0M|}
intra_mode_search.c:model_intra_yrd_and_prune:
  673|  1.88M|                                            int64_t *best_model_rd) {
  674|  1.88M|  const TX_SIZE tx_size = AOMMIN(TX_32X32, max_txsize_lookup[bsize]);
  ------------------
  |  |   34|  1.88M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.88M]
  |  |  ------------------
  ------------------
  675|  1.88M|  const int plane = 0;
  676|  1.88M|  const AV1_COMMON *cm = &cpi->common;
  677|  1.88M|  const int64_t this_model_rd = intra_model_rd(
  678|  1.88M|      cm, x, plane, bsize, tx_size, /*use_hadamard=*/1, cpi->do_border_pad);
  679|  1.88M|  if (*best_model_rd != INT64_MAX &&
  ------------------
  |  Branch (679:7): [True: 1.89M, False: 18.4E]
  ------------------
  680|  1.89M|      this_model_rd > *best_model_rd + (*best_model_rd >> 2)) {
  ------------------
  |  Branch (680:7): [True: 321k, False: 1.56M]
  ------------------
  681|   321k|    return 1;
  682|  1.56M|  } else if (this_model_rd < *best_model_rd) {
  ------------------
  |  Branch (682:14): [True: 116k, False: 1.45M]
  ------------------
  683|   116k|    *best_model_rd = this_model_rd;
  684|   116k|  }
  685|  1.56M|  return 0;
  686|  1.88M|}

av1_k_means_dim1:
  107|   252k|                         uint8_t *indices, int n, int k, int max_itr) {
  108|   252k|  int16_t centroids_tmp[AV1_K_MEANS_DIM * PALETTE_MAX_SIZE];
  109|   252k|  uint8_t indices_tmp[MAX_PALETTE_BLOCK_WIDTH * MAX_PALETTE_BLOCK_HEIGHT];
  110|   252k|  int16_t *meta_centroids[2] = { centroids, centroids_tmp };
  111|   252k|  uint8_t *meta_indices[2] = { indices, indices_tmp };
  112|   252k|  int i, l = 0, prev_l, best_l = 0;
  113|   252k|  int64_t this_dist;
  114|       |
  115|   252k|  assert(n <= MAX_PALETTE_BLOCK_WIDTH * MAX_PALETTE_BLOCK_HEIGHT);
  116|       |
  117|   252k|#if AV1_K_MEANS_DIM == 1
  118|   252k|  av1_calc_indices_dim1(data, centroids, indices, &this_dist, n, k);
  119|       |#else
  120|       |  av1_calc_indices_dim2(data, centroids, indices, &this_dist, n, k);
  121|       |#endif
  122|       |
  123|   799k|  for (i = 0; i < max_itr; ++i) {
  ------------------
  |  Branch (123:15): [True: 799k, False: 18.4E]
  ------------------
  124|   799k|    const int64_t prev_dist = this_dist;
  125|   799k|    prev_l = l;
  126|   799k|    l = (l == 1) ? 0 : 1;
  ------------------
  |  Branch (126:9): [True: 343k, False: 455k]
  ------------------
  127|       |
  128|   799k|    RENAME(calc_centroids)(data, meta_centroids[l], meta_indices[prev_l], n, k);
  ------------------
  |  |   26|   799k|#define RENAME(x) RENAME_(x, AV1_K_MEANS_DIM)
  |  |  ------------------
  |  |  |  |   25|   799k|#define RENAME_(x, y) AV1_K_MEANS_RENAME(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|   799k|#define AV1_K_MEANS_RENAME(func, dim) func##_dim##dim
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|   799k|    if (!memcmp(meta_centroids[l], meta_centroids[prev_l],
  ------------------
  |  Branch (129:9): [True: 252k, False: 546k]
  ------------------
  130|   799k|                sizeof(centroids[0]) * k * AV1_K_MEANS_DIM)) {
  ------------------
  |  |   28|   799k|#define AV1_K_MEANS_DIM 1
  ------------------
  131|   252k|      break;
  132|   252k|    }
  133|   546k|#if AV1_K_MEANS_DIM == 1
  134|   546k|    av1_calc_indices_dim1(data, meta_centroids[l], meta_indices[l], &this_dist,
  135|   546k|                          n, k);
  136|       |#else
  137|       |    av1_calc_indices_dim2(data, meta_centroids[l], meta_indices[l], &this_dist,
  138|       |                          n, k);
  139|       |#endif
  140|       |
  141|   546k|    if (this_dist > prev_dist) {
  ------------------
  |  Branch (141:9): [True: 0, False: 546k]
  ------------------
  142|      0|      best_l = prev_l;
  143|      0|      break;
  144|      0|    }
  145|   546k|  }
  146|   252k|  if (i == max_itr) best_l = l;
  ------------------
  |  Branch (146:7): [True: 0, False: 252k]
  ------------------
  147|   252k|  if (best_l != 0) {
  ------------------
  |  Branch (147:7): [True: 0, False: 252k]
  ------------------
  148|      0|    memcpy(centroids, meta_centroids[1],
  149|      0|           sizeof(centroids[0]) * k * AV1_K_MEANS_DIM);
  ------------------
  |  |   28|      0|#define AV1_K_MEANS_DIM 1
  ------------------
  150|      0|    memcpy(indices, meta_indices[1], sizeof(indices[0]) * n);
  151|      0|  }
  152|   252k|}
av1_k_means_dim2:
  107|   338k|                         uint8_t *indices, int n, int k, int max_itr) {
  108|   338k|  int16_t centroids_tmp[AV1_K_MEANS_DIM * PALETTE_MAX_SIZE];
  109|   338k|  uint8_t indices_tmp[MAX_PALETTE_BLOCK_WIDTH * MAX_PALETTE_BLOCK_HEIGHT];
  110|   338k|  int16_t *meta_centroids[2] = { centroids, centroids_tmp };
  111|   338k|  uint8_t *meta_indices[2] = { indices, indices_tmp };
  112|   338k|  int i, l = 0, prev_l, best_l = 0;
  113|   338k|  int64_t this_dist;
  114|       |
  115|   338k|  assert(n <= MAX_PALETTE_BLOCK_WIDTH * MAX_PALETTE_BLOCK_HEIGHT);
  116|       |
  117|       |#if AV1_K_MEANS_DIM == 1
  118|       |  av1_calc_indices_dim1(data, centroids, indices, &this_dist, n, k);
  119|       |#else
  120|   338k|  av1_calc_indices_dim2(data, centroids, indices, &this_dist, n, k);
  121|   338k|#endif
  122|       |
  123|  1.44M|  for (i = 0; i < max_itr; ++i) {
  ------------------
  |  Branch (123:15): [True: 1.44M, False: 18.4E]
  ------------------
  124|  1.44M|    const int64_t prev_dist = this_dist;
  125|  1.44M|    prev_l = l;
  126|  1.44M|    l = (l == 1) ? 0 : 1;
  ------------------
  |  Branch (126:9): [True: 642k, False: 807k]
  ------------------
  127|       |
  128|  1.44M|    RENAME(calc_centroids)(data, meta_centroids[l], meta_indices[prev_l], n, k);
  ------------------
  |  |   26|  1.44M|#define RENAME(x) RENAME_(x, AV1_K_MEANS_DIM)
  |  |  ------------------
  |  |  |  |   25|  1.44M|#define RENAME_(x, y) AV1_K_MEANS_RENAME(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.44M|#define AV1_K_MEANS_RENAME(func, dim) func##_dim##dim
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|  1.44M|    if (!memcmp(meta_centroids[l], meta_centroids[prev_l],
  ------------------
  |  Branch (129:9): [True: 338k, False: 1.11M]
  ------------------
  130|  1.44M|                sizeof(centroids[0]) * k * AV1_K_MEANS_DIM)) {
  ------------------
  |  |   31|  1.44M|#define AV1_K_MEANS_DIM 2
  ------------------
  131|   338k|      break;
  132|   338k|    }
  133|       |#if AV1_K_MEANS_DIM == 1
  134|       |    av1_calc_indices_dim1(data, meta_centroids[l], meta_indices[l], &this_dist,
  135|       |                          n, k);
  136|       |#else
  137|  1.11M|    av1_calc_indices_dim2(data, meta_centroids[l], meta_indices[l], &this_dist,
  138|  1.11M|                          n, k);
  139|  1.11M|#endif
  140|       |
  141|  1.11M|    if (this_dist > prev_dist) {
  ------------------
  |  Branch (141:9): [True: 0, False: 1.11M]
  ------------------
  142|      0|      best_l = prev_l;
  143|      0|      break;
  144|      0|    }
  145|  1.11M|  }
  146|   338k|  if (i == max_itr) best_l = l;
  ------------------
  |  Branch (146:7): [True: 0, False: 338k]
  ------------------
  147|   338k|  if (best_l != 0) {
  ------------------
  |  Branch (147:7): [True: 0, False: 338k]
  ------------------
  148|      0|    memcpy(centroids, meta_centroids[1],
  149|      0|           sizeof(centroids[0]) * k * AV1_K_MEANS_DIM);
  ------------------
  |  |   31|      0|#define AV1_K_MEANS_DIM 2
  ------------------
  150|      0|    memcpy(indices, meta_indices[1], sizeof(indices[0]) * n);
  151|      0|  }
  152|   338k|}
palette.c:calc_centroids_dim1:
   74|   799k|                                   const uint8_t *indices, int n, int k) {
   75|   799k|  int i, j;
   76|   799k|  int count[PALETTE_MAX_SIZE] = { 0 };
   77|   799k|  int centroids_sum[AV1_K_MEANS_DIM * PALETTE_MAX_SIZE];
   78|   799k|  unsigned int rand_state = (unsigned int)data[0];
   79|   799k|  assert(n <= 32768);
   80|   799k|  memset(centroids_sum, 0, sizeof(centroids_sum[0]) * k * AV1_K_MEANS_DIM);
  ------------------
  |  |   28|   799k|#define AV1_K_MEANS_DIM 1
  ------------------
   81|       |
   82|  56.3M|  for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (82:15): [True: 55.5M, False: 799k]
  ------------------
   83|  55.5M|    const int index = indices[i];
   84|  55.5M|    assert(index < k);
   85|  55.5M|    ++count[index];
   86|   111M|    for (j = 0; j < AV1_K_MEANS_DIM; ++j) {
  ------------------
  |  |   28|   111M|#define AV1_K_MEANS_DIM 1
  ------------------
  |  Branch (86:17): [True: 55.5M, False: 55.5M]
  ------------------
   87|  55.5M|      centroids_sum[index * AV1_K_MEANS_DIM + j] +=
  ------------------
  |  |   28|  55.5M|#define AV1_K_MEANS_DIM 1
  ------------------
   88|  55.5M|          data[i * AV1_K_MEANS_DIM + j];
  ------------------
  |  |   28|  55.5M|#define AV1_K_MEANS_DIM 1
  ------------------
   89|  55.5M|    }
   90|  55.5M|  }
   91|       |
   92|  4.74M|  for (i = 0; i < k; ++i) {
  ------------------
  |  Branch (92:15): [True: 3.94M, False: 799k]
  ------------------
   93|  3.94M|    if (count[i] == 0) {
  ------------------
  |  Branch (93:9): [True: 158k, False: 3.79M]
  ------------------
   94|   158k|      memcpy(centroids + i * AV1_K_MEANS_DIM,
  ------------------
  |  |   28|   158k|#define AV1_K_MEANS_DIM 1
  ------------------
   95|   158k|             data + (lcg_rand16(&rand_state) % n) * AV1_K_MEANS_DIM,
  ------------------
  |  |   28|   158k|#define AV1_K_MEANS_DIM 1
  ------------------
   96|   158k|             sizeof(centroids[0]) * AV1_K_MEANS_DIM);
  ------------------
  |  |   28|   158k|#define AV1_K_MEANS_DIM 1
  ------------------
   97|  3.79M|    } else {
   98|  7.58M|      for (j = 0; j < AV1_K_MEANS_DIM; ++j) {
  ------------------
  |  |   28|  7.58M|#define AV1_K_MEANS_DIM 1
  ------------------
  |  Branch (98:19): [True: 3.79M, False: 3.79M]
  ------------------
   99|  3.79M|        centroids[i * AV1_K_MEANS_DIM + j] =
  ------------------
  |  |   28|  3.79M|#define AV1_K_MEANS_DIM 1
  ------------------
  100|  3.79M|            DIVIDE_AND_ROUND(centroids_sum[i * AV1_K_MEANS_DIM + j], count[i]);
  ------------------
  |  |   73|  3.79M|#define DIVIDE_AND_ROUND(x, y) (((x) + ((y) >> 1)) / (y))
  ------------------
  101|  3.79M|      }
  102|  3.79M|    }
  103|  3.94M|  }
  104|   799k|}
palette.c:calc_centroids_dim2:
   74|  1.44M|                                   const uint8_t *indices, int n, int k) {
   75|  1.44M|  int i, j;
   76|  1.44M|  int count[PALETTE_MAX_SIZE] = { 0 };
   77|  1.44M|  int centroids_sum[AV1_K_MEANS_DIM * PALETTE_MAX_SIZE];
   78|  1.44M|  unsigned int rand_state = (unsigned int)data[0];
   79|  1.44M|  assert(n <= 32768);
   80|  1.44M|  memset(centroids_sum, 0, sizeof(centroids_sum[0]) * k * AV1_K_MEANS_DIM);
  ------------------
  |  |   31|  1.44M|#define AV1_K_MEANS_DIM 2
  ------------------
   81|       |
   82|  70.0M|  for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (82:15): [True: 68.6M, False: 1.44M]
  ------------------
   83|  68.6M|    const int index = indices[i];
   84|  68.6M|    assert(index < k);
   85|  68.6M|    ++count[index];
   86|   205M|    for (j = 0; j < AV1_K_MEANS_DIM; ++j) {
  ------------------
  |  |   31|   205M|#define AV1_K_MEANS_DIM 2
  ------------------
  |  Branch (86:17): [True: 137M, False: 68.6M]
  ------------------
   87|   137M|      centroids_sum[index * AV1_K_MEANS_DIM + j] +=
  ------------------
  |  |   31|   137M|#define AV1_K_MEANS_DIM 2
  ------------------
   88|   137M|          data[i * AV1_K_MEANS_DIM + j];
  ------------------
  |  |   31|   137M|#define AV1_K_MEANS_DIM 2
  ------------------
   89|   137M|    }
   90|  68.6M|  }
   91|       |
   92|  8.17M|  for (i = 0; i < k; ++i) {
  ------------------
  |  Branch (92:15): [True: 6.72M, False: 1.44M]
  ------------------
   93|  6.72M|    if (count[i] == 0) {
  ------------------
  |  Branch (93:9): [True: 201k, False: 6.52M]
  ------------------
   94|   201k|      memcpy(centroids + i * AV1_K_MEANS_DIM,
  ------------------
  |  |   31|   201k|#define AV1_K_MEANS_DIM 2
  ------------------
   95|   201k|             data + (lcg_rand16(&rand_state) % n) * AV1_K_MEANS_DIM,
  ------------------
  |  |   31|   201k|#define AV1_K_MEANS_DIM 2
  ------------------
   96|   201k|             sizeof(centroids[0]) * AV1_K_MEANS_DIM);
  ------------------
  |  |   31|   201k|#define AV1_K_MEANS_DIM 2
  ------------------
   97|  6.52M|    } else {
   98|  19.5M|      for (j = 0; j < AV1_K_MEANS_DIM; ++j) {
  ------------------
  |  |   31|  19.5M|#define AV1_K_MEANS_DIM 2
  ------------------
  |  Branch (98:19): [True: 13.0M, False: 6.52M]
  ------------------
   99|  13.0M|        centroids[i * AV1_K_MEANS_DIM + j] =
  ------------------
  |  |   31|  13.0M|#define AV1_K_MEANS_DIM 2
  ------------------
  100|  13.0M|            DIVIDE_AND_ROUND(centroids_sum[i * AV1_K_MEANS_DIM + j], count[i]);
  ------------------
  |  |   73|  13.0M|#define DIVIDE_AND_ROUND(x, y) (((x) + ((y) >> 1)) / (y))
  ------------------
  101|  13.0M|      }
  102|  6.52M|    }
  103|  6.72M|  }
  104|  1.44M|}

av1_lookahead_destroy:
   33|  18.4k|void av1_lookahead_destroy(struct lookahead_ctx *ctx) {
   34|  18.4k|  if (ctx) {
  ------------------
  |  Branch (34:7): [True: 18.4k, False: 0]
  ------------------
   35|  18.4k|    if (ctx->buf) {
  ------------------
  |  Branch (35:9): [True: 18.4k, False: 0]
  ------------------
   36|  18.4k|      int i;
   37|       |
   38|  55.2k|      for (i = 0; i < ctx->max_sz; i++) aom_free_frame_buffer(&ctx->buf[i].img);
  ------------------
  |  Branch (38:19): [True: 36.8k, False: 18.4k]
  ------------------
   39|  18.4k|      free(ctx->buf);
   40|  18.4k|    }
   41|  18.4k|    free(ctx);
   42|  18.4k|  }
   43|  18.4k|}
av1_lookahead_init:
   48|  18.4k|    int num_lap_buffers, bool is_all_intra, bool alloc_pyramid) {
   49|  18.4k|  int lag_in_frames = AOMMAX(1, depth);
  ------------------
  |  |   35|  18.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 18.4k, False: 0]
  |  |  ------------------
  ------------------
   50|       |
   51|       |  // For all-intra frame encoding, previous source frames are not required.
   52|       |  // Hence max_pre_frames is set to 0 in this case. As previous source frames
   53|       |  // are accessed using a negative index to av1_lookahead_peek(), setting
   54|       |  // max_pre_frames to 0 will cause av1_lookahead_peek() to return NULL for a
   55|       |  // negative index.
   56|  18.4k|  const uint8_t max_pre_frames = is_all_intra ? 0 : MAX_PRE_FRAMES;
  ------------------
  |  |   42|  36.8k|#define MAX_PRE_FRAMES 1
  ------------------
  |  Branch (56:34): [True: 0, False: 18.4k]
  ------------------
   57|       |
   58|       |  // Add the lags to depth and clamp
   59|  18.4k|  depth += num_lap_buffers;
   60|  18.4k|  depth = clamp(depth, 1, MAX_TOTAL_BUFFERS);
  ------------------
  |  |   30|  18.4k|#define MAX_TOTAL_BUFFERS (MAX_LAG_BUFFERS + MAX_LAP_BUFFERS)
  |  |  ------------------
  |  |  |  |   28|  18.4k|#define MAX_LAG_BUFFERS 48
  |  |  ------------------
  |  |               #define MAX_TOTAL_BUFFERS (MAX_LAG_BUFFERS + MAX_LAP_BUFFERS)
  |  |  ------------------
  |  |  |  |   29|  18.4k|#define MAX_LAP_BUFFERS 48
  |  |  ------------------
  ------------------
   61|       |
   62|       |  // Allocate memory to keep previous source frames available.
   63|  18.4k|  depth += max_pre_frames;
   64|       |
   65|       |  // Allocate the lookahead structures
   66|  18.4k|  struct lookahead_ctx *ctx = calloc(1, sizeof(*ctx));
   67|  18.4k|  if (ctx) {
  ------------------
  |  Branch (67:7): [True: 18.4k, False: 0]
  ------------------
   68|  18.4k|    ctx->max_sz = depth;
   69|  18.4k|    ctx->push_frame_count = 0;
   70|  18.4k|    ctx->max_pre_frames = max_pre_frames;
   71|  18.4k|    ctx->read_ctxs[ENCODE_STAGE].pop_sz = ctx->max_sz - ctx->max_pre_frames;
   72|  18.4k|    ctx->read_ctxs[ENCODE_STAGE].valid = 1;
   73|  18.4k|    if (num_lap_buffers) {
  ------------------
  |  Branch (73:9): [True: 0, False: 18.4k]
  ------------------
   74|      0|      ctx->read_ctxs[LAP_STAGE].pop_sz = lag_in_frames;
   75|      0|      ctx->read_ctxs[LAP_STAGE].valid = 1;
   76|      0|    }
   77|  18.4k|    ctx->buf = calloc(depth, sizeof(*ctx->buf));
   78|  18.4k|    if (!ctx->buf) goto fail;
  ------------------
  |  Branch (78:9): [True: 0, False: 18.4k]
  ------------------
   79|  55.2k|    for (int i = 0; i < depth; i++) {
  ------------------
  |  Branch (79:21): [True: 36.8k, False: 18.4k]
  ------------------
   80|  36.8k|      if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (80:11): [True: 0, False: 36.8k]
  ------------------
   81|  36.8k|              &ctx->buf[i].img, width, height, subsampling_x, subsampling_y,
   82|  36.8k|              use_highbitdepth, border_in_pixels, byte_alignment, NULL, NULL,
   83|  36.8k|              NULL, alloc_pyramid, 0)) {
   84|      0|        goto fail;
   85|      0|      }
   86|  36.8k|    }
   87|  18.4k|  }
   88|  18.4k|  return ctx;
   89|      0|fail:
   90|      0|  av1_lookahead_destroy(ctx);
   91|       |  return NULL;
   92|  18.4k|}
av1_lookahead_push:
  101|  73.6k|                       bool alloc_pyramid, aom_enc_frame_flags_t flags) {
  102|  73.6k|  int width = src->y_crop_width;
  103|  73.6k|  int height = src->y_crop_height;
  104|  73.6k|  int uv_width = src->uv_crop_width;
  105|  73.6k|  int uv_height = src->uv_crop_height;
  106|  73.6k|  int subsampling_x = src->subsampling_x;
  107|  73.6k|  int subsampling_y = src->subsampling_y;
  108|  73.6k|  int larger_dimensions, new_dimensions;
  109|       |
  110|  73.6k|  assert(ctx->read_ctxs[ENCODE_STAGE].valid == 1);
  111|  73.6k|  if (ctx->read_ctxs[ENCODE_STAGE].sz + ctx->max_pre_frames > ctx->max_sz)
  ------------------
  |  Branch (111:7): [True: 0, False: 73.6k]
  ------------------
  112|      0|    return 1;
  113|       |
  114|  73.6k|  ctx->read_ctxs[ENCODE_STAGE].sz++;
  115|  73.6k|  if (ctx->read_ctxs[LAP_STAGE].valid) {
  ------------------
  |  Branch (115:7): [True: 0, False: 73.6k]
  ------------------
  116|      0|    ctx->read_ctxs[LAP_STAGE].sz++;
  117|      0|  }
  118|       |
  119|  73.6k|  struct lookahead_entry *buf = pop(ctx, &ctx->write_idx);
  120|       |
  121|  73.6k|  new_dimensions = width != buf->img.y_crop_width ||
  ------------------
  |  Branch (121:20): [True: 0, False: 73.6k]
  ------------------
  122|  73.6k|                   height != buf->img.y_crop_height ||
  ------------------
  |  Branch (122:20): [True: 0, False: 73.6k]
  ------------------
  123|  73.6k|                   uv_width != buf->img.uv_crop_width ||
  ------------------
  |  Branch (123:20): [True: 0, False: 73.6k]
  ------------------
  124|  73.6k|                   uv_height != buf->img.uv_crop_height;
  ------------------
  |  Branch (124:20): [True: 0, False: 73.6k]
  ------------------
  125|  73.6k|  larger_dimensions =
  126|  73.6k|      width > buf->img.y_crop_width || height > buf->img.y_crop_height ||
  ------------------
  |  Branch (126:7): [True: 0, False: 73.6k]
  |  Branch (126:40): [True: 0, False: 73.6k]
  ------------------
  127|  73.6k|      uv_width > buf->img.uv_crop_width || uv_height > buf->img.uv_crop_height;
  ------------------
  |  Branch (127:7): [True: 0, False: 73.6k]
  |  Branch (127:44): [True: 0, False: 73.6k]
  ------------------
  128|  73.6k|  assert(!larger_dimensions || new_dimensions);
  129|       |
  130|  73.6k|  if (larger_dimensions) {
  ------------------
  |  Branch (130:7): [True: 0, False: 73.6k]
  ------------------
  131|      0|    YV12_BUFFER_CONFIG new_img;
  132|      0|    memset(&new_img, 0, sizeof(new_img));
  133|      0|    if (aom_alloc_frame_buffer(&new_img, width, height, subsampling_x,
  ------------------
  |  Branch (133:9): [True: 0, False: 0]
  ------------------
  134|      0|                               subsampling_y, use_highbitdepth,
  135|      0|                               AOM_BORDER_IN_PIXELS, 0, alloc_pyramid, 0))
  ------------------
  |  |   32|      0|#define AOM_BORDER_IN_PIXELS 288
  ------------------
  136|      0|      return 1;
  137|      0|    aom_free_frame_buffer(&buf->img);
  138|      0|    buf->img = new_img;
  139|  73.6k|  } else if (new_dimensions) {
  ------------------
  |  Branch (139:14): [True: 0, False: 73.6k]
  ------------------
  140|      0|    buf->img.y_width = src->y_width;
  141|      0|    buf->img.y_height = src->y_height;
  142|      0|    buf->img.uv_width = src->uv_width;
  143|      0|    buf->img.uv_height = src->uv_height;
  144|      0|    buf->img.y_crop_width = src->y_crop_width;
  145|      0|    buf->img.y_crop_height = src->y_crop_height;
  146|      0|    buf->img.uv_crop_width = src->uv_crop_width;
  147|      0|    buf->img.uv_crop_height = src->uv_crop_height;
  148|      0|    buf->img.subsampling_x = src->subsampling_x;
  149|      0|    buf->img.subsampling_y = src->subsampling_y;
  150|      0|  }
  151|  73.6k|  av1_copy_and_extend_frame(src, &buf->img);
  152|       |
  153|  73.6k|  buf->ts_start = ts_start;
  154|  73.6k|  buf->ts_end = ts_end;
  155|  73.6k|  buf->display_idx = ctx->push_frame_count;
  156|  73.6k|  buf->flags = flags;
  157|  73.6k|  ++ctx->push_frame_count;
  158|  73.6k|  aom_remove_metadata_from_frame_buffer(&buf->img);
  159|  73.6k|  if (src->metadata &&
  ------------------
  |  Branch (159:7): [True: 0, False: 73.6k]
  ------------------
  160|      0|      aom_copy_metadata_to_frame_buffer(&buf->img, src->metadata)) {
  ------------------
  |  Branch (160:7): [True: 0, False: 0]
  ------------------
  161|      0|    return 1;
  162|      0|  }
  163|  73.6k|  return 0;
  164|  73.6k|}
av1_lookahead_pop:
  167|  73.6k|                                          COMPRESSOR_STAGE stage) {
  168|  73.6k|  struct lookahead_entry *buf = NULL;
  169|  73.6k|  if (ctx) {
  ------------------
  |  Branch (169:7): [True: 73.6k, False: 0]
  ------------------
  170|  73.6k|    struct read_ctx *read_ctx = &ctx->read_ctxs[stage];
  171|  73.6k|    assert(read_ctx->valid == 1);
  172|  73.6k|    if (read_ctx->sz && (drain || read_ctx->sz == read_ctx->pop_sz)) {
  ------------------
  |  Branch (172:9): [True: 73.6k, False: 0]
  |  Branch (172:26): [True: 0, False: 73.6k]
  |  Branch (172:35): [True: 73.6k, False: 0]
  ------------------
  173|  73.6k|      buf = pop(ctx, &read_ctx->read_idx);
  174|  73.6k|      read_ctx->sz--;
  175|  73.6k|    }
  176|  73.6k|  }
  177|  73.6k|  return buf;
  178|  73.6k|}
av1_lookahead_peek:
  181|   399k|                                           COMPRESSOR_STAGE stage) {
  182|   399k|  struct lookahead_entry *buf = NULL;
  183|   399k|  if (ctx == NULL) {
  ------------------
  |  Branch (183:7): [True: 0, False: 399k]
  ------------------
  184|      0|    return buf;
  185|      0|  }
  186|       |
  187|   399k|  struct read_ctx *read_ctx = &ctx->read_ctxs[stage];
  188|   399k|  assert(read_ctx->valid == 1);
  189|   399k|  if (index >= 0) {
  ------------------
  |  Branch (189:7): [True: 343k, False: 55.2k]
  ------------------
  190|       |    // Forward peek
  191|   343k|    if (index < read_ctx->sz) {
  ------------------
  |  Branch (191:9): [True: 263k, False: 79.9k]
  ------------------
  192|   263k|      index += read_ctx->read_idx;
  193|   263k|      if (index >= ctx->max_sz) index -= ctx->max_sz;
  ------------------
  |  Branch (193:11): [True: 0, False: 263k]
  ------------------
  194|   263k|      buf = ctx->buf + index;
  195|   263k|    }
  196|   343k|  } else if (index < 0) {
  ------------------
  |  Branch (196:14): [True: 55.2k, False: 0]
  ------------------
  197|       |    // Backward peek
  198|  55.2k|    if (-index <= ctx->max_pre_frames) {
  ------------------
  |  Branch (198:9): [True: 55.2k, False: 0]
  ------------------
  199|  55.2k|      index += (int)(read_ctx->read_idx);
  200|  55.2k|      if (index < 0) index += (int)(ctx->max_sz);
  ------------------
  |  Branch (200:11): [True: 18.4k, False: 36.8k]
  ------------------
  201|  55.2k|      buf = ctx->buf + index;
  202|  55.2k|    }
  203|  55.2k|  }
  204|       |
  205|   399k|  return buf;
  206|   399k|}
av1_lookahead_depth:
  208|   110k|int av1_lookahead_depth(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage) {
  209|   110k|  assert(ctx != NULL);
  210|       |
  211|   110k|  struct read_ctx *read_ctx = &ctx->read_ctxs[stage];
  212|       |  assert(read_ctx->valid == 1);
  213|   110k|  return read_ctx->sz;
  214|   110k|}
av1_lookahead_pop_sz:
  216|   110k|int av1_lookahead_pop_sz(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage) {
  217|   110k|  assert(ctx != NULL);
  218|       |
  219|   110k|  struct read_ctx *read_ctx = &ctx->read_ctxs[stage];
  220|       |  assert(read_ctx->valid == 1);
  221|   110k|  return read_ctx->pop_sz;
  222|   110k|}
lookahead.c:pop:
   23|   147k|static struct lookahead_entry *pop(struct lookahead_ctx *ctx, int *idx) {
   24|   147k|  int index = *idx;
   25|   147k|  struct lookahead_entry *buf = ctx->buf + index;
   26|       |
   27|   147k|  assert(index < ctx->max_sz);
   28|   147k|  if (++index >= ctx->max_sz) index -= ctx->max_sz;
  ------------------
  |  Branch (28:7): [True: 73.6k, False: 73.6k]
  ------------------
   29|   147k|  *idx = index;
   30|   147k|  return buf;
   31|   147k|}

av1_make_default_fullpel_ms_params:
   76|  5.80M|    SEARCH_METHODS search_method, int fine_search_interval) {
   77|  5.80M|  const MV_SPEED_FEATURES *mv_sf = &cpi->sf.mv_sf;
   78|  5.80M|  const int is_key_frame =
   79|  5.80M|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == KF_UPDATE;
   80|       |
   81|       |  // High level params
   82|  5.80M|  ms_params->bsize = bsize;
   83|  5.80M|  ms_params->vfp = &cpi->ppi->fn_ptr[bsize];
   84|       |
   85|  5.80M|  init_ms_buffers(&ms_params->ms_buffers, x);
   86|       |
   87|  5.80M|  av1_set_mv_search_method(ms_params, search_sites, search_method);
   88|       |
   89|  5.80M|  ms_params->mesh_patterns[0] = mv_sf->mesh_patterns;
   90|  5.80M|  ms_params->mesh_patterns[1] = mv_sf->intrabc_mesh_patterns;
   91|  5.80M|  ms_params->force_mesh_thresh = mv_sf->exhaustive_searches_thresh;
   92|  5.80M|  ms_params->prune_mesh_search =
   93|  5.80M|      (cpi->sf.mv_sf.prune_mesh_search == PRUNE_MESH_SEARCH_LVL_2) ? 1 : 0;
  ------------------
  |  Branch (93:7): [True: 5.20M, False: 598k]
  ------------------
   94|  5.80M|  ms_params->mesh_search_mv_diff_threshold = 4;
   95|  5.80M|  ms_params->run_mesh_search = 0;
   96|  5.80M|  ms_params->fine_search_interval = fine_search_interval;
   97|       |
   98|  5.80M|  ms_params->is_intra_mode = 0;
   99|       |
  100|  5.80M|  ms_params->fast_obmc_search = mv_sf->obmc_full_pixel_search_level;
  101|       |
  102|  5.80M|  ms_params->mv_limits = x->mv_limits;
  103|  5.80M|  av1_set_mv_search_range(&ms_params->mv_limits, ref_mv);
  104|       |
  105|  5.80M|  if (cpi->oxcf.algo_cfg.sharpness == 3) {
  ------------------
  |  Branch (105:7): [True: 0, False: 5.80M]
  ------------------
  106|      0|    int top_margin = x->e_mbd.mi_row * MI_SIZE + 8;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  107|      0|    int left_margin = x->e_mbd.mi_col * MI_SIZE + 8;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  108|      0|    int bottom_margin =
  109|      0|        cpi->common.height - mi_size_high[bsize] * MI_SIZE - top_margin + 16;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  110|      0|    int right_margin =
  111|      0|        cpi->common.width - mi_size_wide[bsize] * MI_SIZE - left_margin + 16;
  ------------------
  |  |   40|      0|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  112|       |
  113|      0|    bottom_margin = AOMMAX(bottom_margin, -top_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  114|      0|    right_margin = AOMMAX(right_margin, -left_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  115|       |
  116|      0|    FullMvLimits *mv_limits = &ms_params->mv_limits;
  117|      0|    mv_limits->row_min = AOMMAX(mv_limits->row_min, -top_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  118|      0|    mv_limits->row_max = AOMMIN(mv_limits->row_max, bottom_margin);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  119|      0|    mv_limits->col_min = AOMMAX(mv_limits->col_min, -left_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  120|      0|    mv_limits->col_max = AOMMIN(mv_limits->col_max, right_margin);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  121|      0|  }
  122|       |
  123|       |  // Mvcost params
  124|  5.80M|  init_mv_cost_params(&ms_params->mv_cost_params, x->mv_costs, ref_mv,
  125|  5.80M|                      x->errorperbit, x->sadperbit);
  126|       |
  127|  5.80M|  ms_params->sdf = ms_params->vfp->sdf;
  128|  5.80M|  ms_params->sdx4df = ms_params->vfp->sdx4df;
  129|  5.80M|  ms_params->sdx3df = ms_params->vfp->sdx3df;
  130|       |
  131|  5.80M|  if (mv_sf->use_downsampled_sad == 2 && block_size_high[bsize] >= 16) {
  ------------------
  |  Branch (131:7): [True: 0, False: 5.80M]
  |  Branch (131:42): [True: 0, False: 0]
  ------------------
  132|      0|    assert(ms_params->vfp->sdsf != NULL);
  133|      0|    ms_params->sdf = ms_params->vfp->sdsf;
  134|      0|    assert(ms_params->vfp->sdsx4df != NULL);
  135|      0|    ms_params->sdx4df = ms_params->vfp->sdsx4df;
  136|       |    // Skip version of sadx3 is not available yet
  137|      0|    ms_params->sdx3df = ms_params->vfp->sdsx4df;
  138|  5.80M|  } else if (mv_sf->use_downsampled_sad == 1 && block_size_high[bsize] >= 16 &&
  ------------------
  |  Branch (138:14): [True: 5.20M, False: 597k]
  |  Branch (138:49): [True: 1.16M, False: 4.04M]
  ------------------
  139|  1.16M|             !is_key_frame) {
  ------------------
  |  Branch (139:14): [True: 1.16M, False: 4.67k]
  ------------------
  140|  1.16M|    FULLPEL_MV start_mv_clamped = start_mv;
  141|       |    // adjust start_mv to make sure it is within MV range
  142|  1.16M|    clamp_fullmv(&start_mv_clamped, &ms_params->mv_limits);
  143|       |
  144|  1.16M|    const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  145|  1.16M|    const int ref_stride = ref->stride;
  146|  1.16M|    const uint8_t *best_address = get_buf_from_fullmv(ref, &start_mv_clamped);
  147|  1.16M|    const struct buf_2d *const src = ms_params->ms_buffers.src;
  148|  1.16M|    const uint8_t *src_buf = src->buf;
  149|  1.16M|    const int src_stride = src->stride;
  150|       |
  151|  1.16M|    unsigned int start_mv_sad_even_rows, start_mv_sad_odd_rows;
  152|  1.16M|    assert(ms_params->vfp->sdsf != NULL);
  153|  1.16M|    start_mv_sad_even_rows =
  154|  1.16M|        ms_params->vfp->sdsf(src_buf, src_stride, best_address, ref_stride);
  155|  1.16M|    start_mv_sad_odd_rows =
  156|  1.16M|        ms_params->vfp->sdsf(src_buf + src_stride, src_stride,
  157|  1.16M|                             best_address + ref_stride, ref_stride);
  158|       |
  159|       |    // If the absolute SAD difference computed between the pred-to-src of even
  160|       |    // and odd rows is small, skip every other row in sad computation.
  161|  1.16M|    const int odd_to_even_diff_sad =
  162|  1.16M|        abs((int)start_mv_sad_even_rows - (int)start_mv_sad_odd_rows);
  163|  1.16M|    const int mult_thresh = 4;
  164|  1.16M|    if (odd_to_even_diff_sad * mult_thresh < (int)start_mv_sad_even_rows) {
  ------------------
  |  Branch (164:9): [True: 1.08M, False: 80.3k]
  ------------------
  165|  1.08M|      ms_params->sdf = ms_params->vfp->sdsf;
  166|       |      assert(ms_params->vfp->sdsx4df != NULL);
  167|  1.08M|      ms_params->sdx4df = ms_params->vfp->sdsx4df;
  168|  1.08M|      ms_params->sdx3df = ms_params->vfp->sdsx4df;
  169|  1.08M|    }
  170|  1.16M|  }
  171|  5.80M|}
av1_set_ms_to_intra_mode:
  174|  72.2k|                              const IntraBCMVCosts *dv_costs) {
  175|  72.2k|  ms_params->is_intra_mode = 1;
  176|       |
  177|  72.2k|  MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
  178|       |
  179|  72.2k|  mv_cost_params->mvjcost = dv_costs->joint_mv;
  180|  72.2k|  mv_cost_params->mvcost[0] = dv_costs->dv_costs[0];
  181|  72.2k|  mv_cost_params->mvcost[1] = dv_costs->dv_costs[1];
  182|  72.2k|}
av1_make_default_subpel_ms_params:
  187|  2.62M|                                       const MV *ref_mv, const int *cost_list) {
  188|  2.62M|  const AV1_COMMON *cm = &cpi->common;
  189|       |  // High level params
  190|  2.62M|  ms_params->allow_hp = cm->features.allow_high_precision_mv;
  191|  2.62M|  ms_params->forced_stop = cpi->sf.mv_sf.subpel_force_stop;
  192|  2.62M|  ms_params->iters_per_step = cpi->sf.mv_sf.subpel_iters_per_step;
  193|  2.62M|  ms_params->cost_list = cond_cost_list_const(cpi, cost_list);
  194|       |
  195|  2.62M|  av1_set_subpel_mv_search_range(&ms_params->mv_limits, &x->mv_limits, ref_mv);
  196|       |
  197|  2.62M|  if (cpi->oxcf.algo_cfg.sharpness == 3) {
  ------------------
  |  Branch (197:7): [True: 0, False: 2.62M]
  ------------------
  198|      0|    int top_margin = GET_MV_SUBPEL(x->e_mbd.mi_row * MI_SIZE + 8);
  ------------------
  |  |   29|      0|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  199|      0|    int left_margin = GET_MV_SUBPEL(x->e_mbd.mi_col * MI_SIZE + 8);
  ------------------
  |  |   29|      0|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  200|      0|    int bottom_margin =
  201|      0|        GET_MV_SUBPEL(cpi->common.height - mi_size_high[bsize] * MI_SIZE -
  ------------------
  |  |   29|      0|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  202|      0|                      x->e_mbd.mi_row * MI_SIZE + 8);
  203|      0|    int right_margin =
  204|      0|        GET_MV_SUBPEL(cpi->common.width - mi_size_wide[bsize] * MI_SIZE -
  ------------------
  |  |   29|      0|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  205|      0|                      x->e_mbd.mi_col * MI_SIZE + 8);
  206|       |
  207|      0|    bottom_margin = AOMMAX(bottom_margin, -top_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|      0|    right_margin = AOMMAX(right_margin, -left_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  209|       |
  210|      0|    SubpelMvLimits *mv_limits = &ms_params->mv_limits;
  211|      0|    mv_limits->row_min = AOMMAX(mv_limits->row_min, -top_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  212|      0|    mv_limits->row_max = AOMMIN(mv_limits->row_max, bottom_margin);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  213|      0|    mv_limits->col_min = AOMMAX(mv_limits->col_min, -left_margin);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  214|      0|    mv_limits->col_max = AOMMIN(mv_limits->col_max, right_margin);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  215|      0|  }
  216|       |
  217|       |  // Mvcost params
  218|  2.62M|  init_mv_cost_params(&ms_params->mv_cost_params, x->mv_costs, ref_mv,
  219|  2.62M|                      x->errorperbit, x->sadperbit);
  220|       |
  221|       |  // Subpel variance params
  222|  2.62M|  ms_params->var_params.vfp = &cpi->ppi->fn_ptr[bsize];
  223|  2.62M|  ms_params->var_params.subpel_search_type =
  224|  2.62M|      cpi->sf.mv_sf.use_accurate_subpel_search;
  225|  2.62M|  ms_params->var_params.w = block_size_wide[bsize];
  226|  2.62M|  ms_params->var_params.h = block_size_high[bsize];
  227|       |
  228|       |  // Ref and src buffers
  229|  2.62M|  MSBuffers *ms_buffers = &ms_params->var_params.ms_buffers;
  230|  2.62M|  init_ms_buffers(ms_buffers, x);
  231|  2.62M|}
av1_set_mv_search_range:
  233|  5.95M|void av1_set_mv_search_range(FullMvLimits *mv_limits, const MV *mv) {
  234|       |  // Calculate the outermost full-pixel MVs which are inside the limits set by
  235|       |  // av1_set_subpel_mv_search_range().
  236|       |  //
  237|       |  // The subpel limits are simply mv->col +/- 8*MAX_FULL_PEL_VAL, and similar
  238|       |  // for mv->row. We can then divide by 8 to find the fullpel MV limits. But
  239|       |  // we have to be careful about the rounding. We want these bounds to be
  240|       |  // at least as tight as the subpel limits, which means that we must round
  241|       |  // the minimum values up and the maximum values down when dividing.
  242|  5.95M|  int col_min = ((mv->col + 7) >> 3) - MAX_FULL_PEL_VAL;
  ------------------
  |  |   22|  5.95M|#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
  |  |  ------------------
  |  |  |  |   19|  5.95M|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  243|  5.95M|  int row_min = ((mv->row + 7) >> 3) - MAX_FULL_PEL_VAL;
  ------------------
  |  |   22|  5.95M|#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
  |  |  ------------------
  |  |  |  |   19|  5.95M|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  244|  5.95M|  int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL;
  ------------------
  |  |   22|  5.95M|#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
  |  |  ------------------
  |  |  |  |   19|  5.95M|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  245|  5.95M|  int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL;
  ------------------
  |  |   22|  5.95M|#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
  |  |  ------------------
  |  |  |  |   19|  5.95M|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  246|       |
  247|  5.95M|  col_min = AOMMAX(col_min, (MV_LOW >> 3) + 1);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  248|  5.95M|  row_min = AOMMAX(row_min, (MV_LOW >> 3) + 1);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  249|  5.95M|  col_max = AOMMIN(col_max, (MV_UPP >> 3) - 1);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  250|  5.95M|  row_max = AOMMIN(row_max, (MV_UPP >> 3) - 1);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  251|       |
  252|       |  // Get intersection of UMV window and valid MV window to reduce # of checks
  253|       |  // in diamond search.
  254|  5.95M|  mv_limits->col_min = AOMMAX(mv_limits->col_min, col_min);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  255|  5.95M|  mv_limits->col_max = AOMMIN(mv_limits->col_max, col_max);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  256|  5.95M|  mv_limits->row_min = AOMMAX(mv_limits->row_min, row_min);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  257|  5.95M|  mv_limits->row_max = AOMMIN(mv_limits->row_max, row_max);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.95M, False: 18.4E]
  |  |  ------------------
  ------------------
  258|       |
  259|  5.95M|  mv_limits->col_max = AOMMAX(mv_limits->col_min, mv_limits->col_max);
  ------------------
  |  |   35|  5.95M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 71.5k, False: 5.88M]
  |  |  ------------------
  ------------------
  260|  5.95M|  mv_limits->row_max = AOMMAX(mv_limits->row_min, mv_limits->row_max);
  ------------------
  |  |   35|  5.95M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 71.8k, False: 5.88M]
  |  |  ------------------
  ------------------
  261|  5.95M|}
av1_init_search_range:
  263|  2.27M|int av1_init_search_range(int size) {
  264|  2.27M|  int sr = 0;
  265|       |  // Minimum search size no matter what the passed in value.
  266|  2.27M|  size = AOMMAX(16, size);
  ------------------
  |  |   35|  2.27M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.94M, False: 328k]
  |  |  ------------------
  ------------------
  267|       |
  268|  15.6M|  while ((size << sr) < MAX_FULL_PEL_VAL) sr++;
  ------------------
  |  |   22|  15.6M|#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
  |  |  ------------------
  |  |  |  |   19|  15.6M|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  |  Branch (268:10): [True: 13.3M, False: 2.27M]
  ------------------
  269|       |
  270|  2.27M|  sr = AOMMIN(sr, MAX_MVSEARCH_STEPS - 2);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.27M, False: 18.4E]
  |  |  ------------------
  ------------------
  271|  2.27M|  return sr;
  272|  2.27M|}
av1_mv_bit_cost:
  308|  5.35M|                    int *const mvcost[2], int weight) {
  309|  5.35M|  const MV diff = { mv->row - ref_mv->row, mv->col - ref_mv->col };
  310|  5.35M|  return ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  5.35M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  311|  5.35M|      mv_cost(&diff, mvjcost, CONVERT_TO_CONST_MVCOST(mvcost)) * weight, 7);
  312|  5.35M|}
av1_init_motion_fpf:
  433|  68.7k|void av1_init_motion_fpf(search_site_config *cfg, int stride) {
  434|  68.7k|  int num_search_steps = 0;
  435|  68.7k|  int stage_index = MAX_MVSEARCH_STEPS - 1;
  ------------------
  |  |   19|  68.7k|#define MAX_MVSEARCH_STEPS 11
  ------------------
  436|       |
  437|  68.7k|  cfg->site[stage_index][0].mv.col = cfg->site[stage_index][0].mv.row = 0;
  438|  68.7k|  cfg->site[stage_index][0].offset = 0;
  439|  68.7k|  cfg->stride = stride;
  440|       |
  441|   825k|  for (int radius = MAX_FIRST_STEP; radius > 0; radius /= 2) {
  ------------------
  |  |   24|  68.7k|#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS - 1))
  |  |  ------------------
  |  |  |  |   19|  68.7k|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  |  Branch (441:37): [True: 756k, False: 68.7k]
  ------------------
  442|       |    // Generate offsets for 8 search sites per step.
  443|   756k|    int tan_radius = AOMMAX((int)(0.41 * radius), 1);
  ------------------
  |  |   35|   756k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 550k, False: 206k]
  |  |  ------------------
  ------------------
  444|   756k|    int num_search_pts = 12;
  445|   756k|    if (radius == 1) num_search_pts = 8;
  ------------------
  |  Branch (445:9): [True: 68.7k, False: 687k]
  ------------------
  446|       |
  447|   756k|    const FULLPEL_MV search_site_mvs[13] = {
  448|   756k|      { 0, 0 },
  449|   756k|      { -radius, 0 },
  450|   756k|      { radius, 0 },
  451|   756k|      { 0, -radius },
  452|   756k|      { 0, radius },
  453|   756k|      { -radius, -tan_radius },
  454|   756k|      { radius, tan_radius },
  455|   756k|      { -tan_radius, radius },
  456|   756k|      { tan_radius, -radius },
  457|   756k|      { -radius, tan_radius },
  458|   756k|      { radius, -tan_radius },
  459|   756k|      { tan_radius, radius },
  460|   756k|      { -tan_radius, -radius },
  461|   756k|    };
  462|       |
  463|   756k|    int i;
  464|  10.3M|    for (i = 0; i <= num_search_pts; ++i) {
  ------------------
  |  Branch (464:17): [True: 9.56M, False: 756k]
  ------------------
  465|  9.56M|      search_site *const site = &cfg->site[stage_index][i];
  466|  9.56M|      site->mv = search_site_mvs[i];
  467|  9.56M|      site->offset = get_offset_from_fullmv(&site->mv, stride);
  468|  9.56M|    }
  469|   756k|    cfg->searches_per_step[stage_index] = num_search_pts;
  470|   756k|    cfg->radius[stage_index] = radius;
  471|   756k|    --stage_index;
  472|   756k|    ++num_search_steps;
  473|   756k|  }
  474|  68.7k|  cfg->num_search_steps = num_search_steps;
  475|  68.7k|}
av1_full_pixel_search:
 1772|  5.87M|                          FULLPEL_MV *second_best_mv) {
 1773|  5.87M|  const BLOCK_SIZE bsize = ms_params->bsize;
 1774|  5.87M|  const SEARCH_METHODS search_method = ms_params->search_method;
 1775|       |
 1776|  5.87M|  const int is_intra_mode = ms_params->is_intra_mode;
 1777|  5.87M|  int run_mesh_search = ms_params->run_mesh_search;
 1778|       |
 1779|  5.87M|  int var = 0;
 1780|  5.87M|  MARK_MV_INVALID(best_mv);
  ------------------
  |  |   32|  5.87M|  do {                                     \
  |  |   33|  5.87M|    ((int_mv *)(mv))->as_int = INVALID_MV; \
  |  |  ------------------
  |  |  |  |   26|  5.87M|#define INVALID_MV 0x80008000
  |  |  ------------------
  |  |   34|  5.87M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 5.87M]
  |  |  ------------------
  ------------------
 1781|  5.87M|  if (second_best_mv) {
  ------------------
  |  Branch (1781:7): [True: 2.13M, False: 3.74M]
  ------------------
 1782|  2.13M|    MARK_MV_INVALID(second_best_mv);
  ------------------
  |  |   32|  2.13M|  do {                                     \
  |  |   33|  2.13M|    ((int_mv *)(mv))->as_int = INVALID_MV; \
  |  |  ------------------
  |  |  |  |   26|  2.13M|#define INVALID_MV 0x80008000
  |  |  ------------------
  |  |   34|  2.13M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 2.13M]
  |  |  ------------------
  ------------------
 1783|  2.13M|  }
 1784|       |
 1785|  5.87M|  if (cost_list) {
  ------------------
  |  Branch (1785:7): [True: 598k, False: 5.27M]
  ------------------
 1786|   598k|    cost_list[0] = INT_MAX;
 1787|   598k|    cost_list[1] = INT_MAX;
 1788|   598k|    cost_list[2] = INT_MAX;
 1789|   598k|    cost_list[3] = INT_MAX;
 1790|   598k|    cost_list[4] = INT_MAX;
 1791|   598k|  }
 1792|       |
 1793|  5.87M|  assert(ms_params->ms_buffers.ref->stride == ms_params->search_sites->stride);
 1794|       |
 1795|  5.87M|  switch (search_method) {
 1796|      0|    case FAST_BIGDIA:
  ------------------
  |  Branch (1796:5): [True: 0, False: 5.87M]
  ------------------
 1797|      0|      var = fast_bigdia_search(start_mv, ms_params, step_param, 0, cost_list,
 1798|      0|                               best_mv, best_mv_stats);
 1799|      0|      break;
 1800|  1.38k|    case VFAST_DIAMOND:
  ------------------
  |  Branch (1800:5): [True: 1.38k, False: 5.87M]
  ------------------
 1801|  1.38k|      var = vfast_dia_search(start_mv, ms_params, step_param, 0, cost_list,
 1802|  1.38k|                             best_mv, best_mv_stats);
 1803|  1.38k|      break;
 1804|   597k|    case FAST_DIAMOND:
  ------------------
  |  Branch (1804:5): [True: 597k, False: 5.28M]
  ------------------
 1805|   597k|      var = fast_dia_search(start_mv, ms_params, step_param, 0, cost_list,
 1806|   597k|                            best_mv, best_mv_stats);
 1807|   597k|      break;
 1808|      0|    case HEX:
  ------------------
  |  Branch (1808:5): [True: 0, False: 5.87M]
  ------------------
 1809|      0|      var = hex_search(start_mv, ms_params, step_param, 1, cost_list, best_mv,
 1810|      0|                       best_mv_stats);
 1811|      0|      break;
 1812|  53.8k|    case BIGDIA:
  ------------------
  |  Branch (1812:5): [True: 53.8k, False: 5.82M]
  ------------------
 1813|  53.8k|      var = bigdia_search(start_mv, ms_params, step_param, 1, cost_list,
 1814|  53.8k|                          best_mv, best_mv_stats);
 1815|  53.8k|      break;
 1816|      0|    case NSTEP:
  ------------------
  |  Branch (1816:5): [True: 0, False: 5.87M]
  ------------------
 1817|      0|    case NSTEP_8PT:
  ------------------
  |  Branch (1817:5): [True: 0, False: 5.87M]
  ------------------
 1818|  5.22M|    case DIAMOND:
  ------------------
  |  Branch (1818:5): [True: 5.22M, False: 651k]
  ------------------
 1819|  5.22M|    case CLAMPED_DIAMOND:
  ------------------
  |  Branch (1819:5): [True: 0, False: 5.87M]
  ------------------
 1820|  5.22M|      var = full_pixel_diamond(start_mv, ms_params, step_param, cost_list,
 1821|  5.22M|                               best_mv, best_mv_stats, second_best_mv);
 1822|  5.22M|      break;
 1823|      0|    default: assert(0 && "Invalid search method.");
  ------------------
  |  Branch (1823:5): [True: 0, False: 5.87M]
  ------------------
 1824|  5.87M|  }
 1825|       |
 1826|       |  // Should we allow a follow on exhaustive search?
 1827|  5.87M|  if (!run_mesh_search &&
  ------------------
  |  Branch (1827:7): [True: 5.87M, False: 18.4E]
  ------------------
 1828|  5.87M|      ((search_method == NSTEP) || (search_method == NSTEP_8PT)) &&
  ------------------
  |  Branch (1828:8): [True: 18.4E, False: 5.87M]
  |  Branch (1828:36): [True: 18.4E, False: 5.87M]
  ------------------
 1829|      0|      !ms_params->ms_buffers.second_pred) {
  ------------------
  |  Branch (1829:7): [True: 0, False: 0]
  ------------------
 1830|      0|    int exhaustive_thr = ms_params->force_mesh_thresh;
 1831|      0|    exhaustive_thr >>=
 1832|      0|        10 - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]);
 1833|       |    // Threshold variance for an exhaustive full search.
 1834|      0|    if (var > exhaustive_thr) run_mesh_search = 1;
  ------------------
  |  Branch (1834:9): [True: 0, False: 0]
  ------------------
 1835|      0|  }
 1836|       |
 1837|       |  // TODO(yunqing): the following is used to reduce mesh search in temporal
 1838|       |  // filtering. Can extend it to intrabc.
 1839|  5.87M|  if (!is_intra_mode && ms_params->prune_mesh_search) {
  ------------------
  |  Branch (1839:7): [True: 5.73M, False: 144k]
  |  Branch (1839:25): [True: 5.13M, False: 597k]
  ------------------
 1840|  5.13M|    const int full_pel_mv_diff = AOMMAX(abs(start_mv.row - best_mv->row),
  ------------------
  |  |   35|  5.13M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.59M, False: 3.54M]
  |  |  ------------------
  ------------------
 1841|  5.13M|                                        abs(start_mv.col - best_mv->col));
 1842|  5.13M|    if (full_pel_mv_diff <= ms_params->mesh_search_mv_diff_threshold) {
  ------------------
  |  Branch (1842:9): [True: 3.84M, False: 1.29M]
  ------------------
 1843|  3.84M|      run_mesh_search = 0;
 1844|  3.84M|    }
 1845|  5.13M|  }
 1846|       |
 1847|  5.87M|  if (ms_params->sdf != ms_params->vfp->sdf) {
  ------------------
  |  Branch (1847:7): [True: 1.08M, False: 4.79M]
  ------------------
 1848|       |    // If we are skipping rows when we perform the motion search, we need to
 1849|       |    // check the quality of skipping. If it's bad, then we run mesh search with
 1850|       |    // skip row features off.
 1851|       |    // TODO(chiyotsai@google.com): Handle the case where we have a vertical
 1852|       |    // offset of 1 before we hit this statement to avoid having to redo
 1853|       |    // motion search.
 1854|  1.08M|    const struct buf_2d *src = ms_params->ms_buffers.src;
 1855|  1.08M|    const struct buf_2d *ref = ms_params->ms_buffers.ref;
 1856|  1.08M|    const int src_stride = src->stride;
 1857|  1.08M|    const int ref_stride = ref->stride;
 1858|       |
 1859|  1.08M|    const uint8_t *src_address = src->buf;
 1860|  1.08M|    const uint8_t *best_address = get_buf_from_fullmv(ref, best_mv);
 1861|  1.08M|    const int sad =
 1862|  1.08M|        ms_params->vfp->sdf(src_address, src_stride, best_address, ref_stride);
 1863|  1.08M|    const int skip_sad =
 1864|  1.08M|        ms_params->vfp->sdsf(src_address, src_stride, best_address, ref_stride);
 1865|       |    // We will keep the result of skipping rows if it's good enough. Here, good
 1866|       |    // enough means the error is less than 1 per pixel.
 1867|  1.08M|    const int kSADThresh =
 1868|  1.08M|        1 << (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]);
 1869|  1.08M|    if (sad > kSADThresh && abs(skip_sad - sad) * 10 >= AOMMAX(sad, 1) * 9) {
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.08M, False: 18.4E]
  |  |  ------------------
  ------------------
  |  Branch (1869:9): [True: 1.08M, False: 62]
  |  Branch (1869:29): [True: 0, False: 1.08M]
  ------------------
 1870|       |      // There is a large discrepancy between skipping and not skipping, so we
 1871|       |      // need to redo the motion search.
 1872|      0|      FULLPEL_MOTION_SEARCH_PARAMS new_ms_params = *ms_params;
 1873|      0|      new_ms_params.sdf = new_ms_params.vfp->sdf;
 1874|      0|      new_ms_params.sdx4df = new_ms_params.vfp->sdx4df;
 1875|      0|      new_ms_params.sdx3df = new_ms_params.vfp->sdx3df;
 1876|       |
 1877|      0|      return av1_full_pixel_search(start_mv, &new_ms_params, step_param,
 1878|      0|                                   cost_list, best_mv, best_mv_stats,
 1879|      0|                                   second_best_mv);
 1880|      0|    }
 1881|  1.08M|  }
 1882|       |
 1883|  5.87M|  if (run_mesh_search) {
  ------------------
  |  Branch (1883:7): [True: 0, False: 5.87M]
  ------------------
 1884|      0|    int var_ex;
 1885|      0|    FULLPEL_MV tmp_mv_ex;
 1886|      0|    FULLPEL_MV_STATS tmp_mv_stats;
 1887|       |    // Pick the mesh pattern for exhaustive search based on the toolset (intraBC
 1888|       |    // or non-intraBC)
 1889|       |    // TODO(chiyotsai@google.com):  There is a bug here where the second best mv
 1890|       |    // gets overwritten without actually comparing the rdcost.
 1891|      0|    const MESH_PATTERN *const mesh_patterns =
 1892|      0|        ms_params->mesh_patterns[is_intra_mode];
 1893|       |    // TODO(chiyotsai@google.com): the second best mv is not set correctly by
 1894|       |    // full_pixel_exhaustive, which can incorrectly override it.
 1895|      0|    var_ex =
 1896|      0|        full_pixel_exhaustive(*best_mv, ms_params, mesh_patterns, cost_list,
 1897|      0|                              &tmp_mv_ex, &tmp_mv_stats, second_best_mv);
 1898|      0|    if (var_ex < var) {
  ------------------
  |  Branch (1898:9): [True: 0, False: 0]
  ------------------
 1899|      0|      var = var_ex;
 1900|      0|      *best_mv_stats = tmp_mv_stats;
 1901|      0|      *best_mv = tmp_mv_ex;
 1902|      0|    }
 1903|      0|  }
 1904|       |
 1905|  5.87M|  return var;
 1906|  5.87M|}
av1_intrabc_hash_search:
 1911|   144k|                            FULLPEL_MV *best_mv) {
 1912|   144k|  if (!av1_use_hash_me(cpi)) return INT_MAX;
  ------------------
  |  Branch (1912:7): [True: 0, False: 144k]
  ------------------
 1913|       |
 1914|   144k|  const BLOCK_SIZE bsize = ms_params->bsize;
 1915|   144k|  const int block_width = block_size_wide[bsize];
 1916|   144k|  const int block_height = block_size_high[bsize];
 1917|       |
 1918|   144k|  if (block_width != block_height) return INT_MAX;
  ------------------
  |  Branch (1918:7): [True: 56.9k, False: 87.5k]
  ------------------
 1919|       |
 1920|  87.5k|  const FullMvLimits *mv_limits = &ms_params->mv_limits;
 1921|  87.5k|  const MSBuffers *ms_buffer = &ms_params->ms_buffers;
 1922|       |
 1923|  87.5k|  const uint8_t *src = ms_buffer->src->buf;
 1924|  87.5k|  const int src_stride = ms_buffer->src->stride;
 1925|       |
 1926|  87.5k|  const int mi_row = xd->mi_row;
 1927|  87.5k|  const int mi_col = xd->mi_col;
 1928|  87.5k|  const int x_pos = mi_col * MI_SIZE;
  ------------------
  |  |   40|  87.5k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  87.5k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1929|  87.5k|  const int y_pos = mi_row * MI_SIZE;
  ------------------
  |  |   40|  87.5k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  87.5k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 1930|       |
 1931|  87.5k|  uint32_t hash_value1, hash_value2;
 1932|  87.5k|  int best_hash_cost = INT_MAX;
 1933|       |
 1934|       |  // for the hashMap
 1935|  87.5k|  hash_table *ref_frame_hash = &intrabc_hash_info->intrabc_hash_table;
 1936|       |
 1937|  87.5k|  av1_get_block_hash_value(intrabc_hash_info, src, src_stride, block_width,
 1938|  87.5k|                           &hash_value1, &hash_value2, is_cur_buf_hbd(xd));
 1939|       |
 1940|  87.5k|  int count = av1_hash_table_count(ref_frame_hash, hash_value1);
 1941|  87.5k|  if (count <= 1) {
  ------------------
  |  Branch (1941:7): [True: 87.2k, False: 250]
  ------------------
 1942|  87.2k|    return INT_MAX;
 1943|  87.2k|  }
 1944|    250|  if (cpi->sf.mv_sf.prune_intrabc_candidate_block_hash_search) {
  ------------------
  |  Branch (1944:7): [True: 0, False: 250]
  ------------------
 1945|      0|    count = AOMMIN(64, count);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1946|      0|  }
 1947|       |
 1948|    250|  Iterator iterator = av1_hash_get_first_iterator(ref_frame_hash, hash_value1);
 1949|    802|  for (int i = 0; i < count; i++, aom_iterator_increment(&iterator)) {
  ------------------
  |  Branch (1949:19): [True: 552, False: 250]
  ------------------
 1950|    552|    block_hash ref_block_hash = *(block_hash *)(aom_iterator_get(&iterator));
 1951|    552|    if (hash_value2 == ref_block_hash.hash_value2) {
  ------------------
  |  Branch (1951:9): [True: 276, False: 276]
  ------------------
 1952|       |      // Make sure the prediction is from valid area.
 1953|    276|      const MV dv = { GET_MV_SUBPEL(ref_block_hash.y - y_pos),
  ------------------
  |  |   29|    276|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1954|    276|                      GET_MV_SUBPEL(ref_block_hash.x - x_pos) };
  ------------------
  |  |   29|    276|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1955|    276|      if (!av1_is_dv_valid(dv, &cpi->common, xd, mi_row, mi_col, bsize,
  ------------------
  |  Branch (1955:11): [True: 276, False: 0]
  ------------------
 1956|    276|                           cpi->common.seq_params->mib_size_log2))
 1957|    276|        continue;
 1958|       |
 1959|      0|      FULLPEL_MV hash_mv;
 1960|      0|      hash_mv.col = ref_block_hash.x - x_pos;
 1961|      0|      hash_mv.row = ref_block_hash.y - y_pos;
 1962|      0|      if (!av1_is_fullmv_in_range(mv_limits, hash_mv)) continue;
  ------------------
  |  Branch (1962:11): [True: 0, False: 0]
  ------------------
 1963|      0|      FULLPEL_MV_STATS mv_stats;
 1964|      0|      const int refCost = get_mvpred_var_cost(ms_params, &hash_mv, &mv_stats);
 1965|      0|      if (refCost < best_hash_cost) {
  ------------------
  |  Branch (1965:11): [True: 0, False: 0]
  ------------------
 1966|      0|        best_hash_cost = refCost;
 1967|      0|        *best_mv = hash_mv;
 1968|      0|      }
 1969|      0|    }
 1970|    552|  }
 1971|       |
 1972|    250|  return best_hash_cost;
 1973|  87.5k|}
av1_vector_match:
 1977|  14.5k|                     int full_search, int *sad) {
 1978|  14.5k|  int best_sad = INT_MAX;
 1979|  14.5k|  int this_sad;
 1980|  14.5k|  int d;
 1981|  14.5k|  int center, offset = 0;
 1982|  14.5k|  int bw = search_size_top + search_size_bottom;
 1983|       |
 1984|  14.5k|  if (full_search) {
  ------------------
  |  Branch (1984:7): [True: 0, False: 14.5k]
  ------------------
 1985|      0|    for (d = 0; d <= bw; d++) {
  ------------------
  |  Branch (1985:17): [True: 0, False: 0]
  ------------------
 1986|      0|      this_sad = aom_vector_var(&ref[d], src, bwl);
 1987|      0|      if (this_sad < best_sad) {
  ------------------
  |  Branch (1987:11): [True: 0, False: 0]
  ------------------
 1988|      0|        best_sad = this_sad;
 1989|      0|        offset = d;
 1990|      0|      }
 1991|      0|    }
 1992|      0|    center = offset;
 1993|      0|    *sad = best_sad;
 1994|      0|    return (center - search_size_top);
 1995|      0|  }
 1996|       |
 1997|  87.4k|  for (d = 0; d <= bw; d += 16) {
  ------------------
  |  Branch (1997:15): [True: 72.8k, False: 14.5k]
  ------------------
 1998|  72.8k|    this_sad = aom_vector_var(&ref[d], src, bwl);
 1999|  72.8k|    if (this_sad < best_sad) {
  ------------------
  |  Branch (1999:9): [True: 31.9k, False: 40.9k]
  ------------------
 2000|  31.9k|      best_sad = this_sad;
 2001|  31.9k|      offset = d;
 2002|  31.9k|    }
 2003|  72.8k|  }
 2004|  14.5k|  center = offset;
 2005|       |
 2006|  43.7k|  for (d = -8; d <= 8; d += 16) {
  ------------------
  |  Branch (2006:16): [True: 29.1k, False: 14.5k]
  ------------------
 2007|  29.1k|    int this_pos = offset + d;
 2008|       |    // check limit
 2009|  29.1k|    if (this_pos < 0 || this_pos > bw) continue;
  ------------------
  |  Branch (2009:9): [True: 4.26k, False: 24.8k]
  |  Branch (2009:25): [True: 3.27k, False: 21.6k]
  ------------------
 2010|  21.5k|    this_sad = aom_vector_var(&ref[this_pos], src, bwl);
 2011|  21.5k|    if (this_sad < best_sad) {
  ------------------
  |  Branch (2011:9): [True: 3.65k, False: 17.9k]
  ------------------
 2012|  3.65k|      best_sad = this_sad;
 2013|  3.65k|      center = this_pos;
 2014|  3.65k|    }
 2015|  21.5k|  }
 2016|  14.5k|  offset = center;
 2017|       |
 2018|  43.7k|  for (d = -4; d <= 4; d += 8) {
  ------------------
  |  Branch (2018:16): [True: 29.1k, False: 14.5k]
  ------------------
 2019|  29.1k|    int this_pos = offset + d;
 2020|       |    // check limit
 2021|  29.1k|    if (this_pos < 0 || this_pos > bw) continue;
  ------------------
  |  Branch (2021:9): [True: 3.39k, False: 25.7k]
  |  Branch (2021:25): [True: 2.62k, False: 23.1k]
  ------------------
 2022|  23.1k|    this_sad = aom_vector_var(&ref[this_pos], src, bwl);
 2023|  23.1k|    if (this_sad < best_sad) {
  ------------------
  |  Branch (2023:9): [True: 3.48k, False: 19.6k]
  ------------------
 2024|  3.48k|      best_sad = this_sad;
 2025|  3.48k|      center = this_pos;
 2026|  3.48k|    }
 2027|  23.1k|  }
 2028|  14.5k|  offset = center;
 2029|       |
 2030|  43.7k|  for (d = -2; d <= 2; d += 4) {
  ------------------
  |  Branch (2030:16): [True: 29.1k, False: 14.5k]
  ------------------
 2031|  29.1k|    int this_pos = offset + d;
 2032|       |    // check limit
 2033|  29.1k|    if (this_pos < 0 || this_pos > bw) continue;
  ------------------
  |  Branch (2033:9): [True: 2.78k, False: 26.3k]
  |  Branch (2033:25): [True: 2.13k, False: 24.2k]
  ------------------
 2034|  24.1k|    this_sad = aom_vector_var(&ref[this_pos], src, bwl);
 2035|  24.1k|    if (this_sad < best_sad) {
  ------------------
  |  Branch (2035:9): [True: 3.52k, False: 20.6k]
  ------------------
 2036|  3.52k|      best_sad = this_sad;
 2037|  3.52k|      center = this_pos;
 2038|  3.52k|    }
 2039|  24.1k|  }
 2040|  14.5k|  offset = center;
 2041|       |
 2042|  43.7k|  for (d = -1; d <= 1; d += 2) {
  ------------------
  |  Branch (2042:16): [True: 29.1k, False: 14.5k]
  ------------------
 2043|  29.1k|    int this_pos = offset + d;
 2044|       |    // check limit
 2045|  29.1k|    if (this_pos < 0 || this_pos > bw) continue;
  ------------------
  |  Branch (2045:9): [True: 2.31k, False: 26.8k]
  |  Branch (2045:25): [True: 1.73k, False: 25.0k]
  ------------------
 2046|  25.0k|    this_sad = aom_vector_var(&ref[this_pos], src, bwl);
 2047|  25.0k|    if (this_sad < best_sad) {
  ------------------
  |  Branch (2047:9): [True: 4.85k, False: 20.2k]
  ------------------
 2048|  4.85k|      best_sad = this_sad;
 2049|  4.85k|      center = this_pos;
 2050|  4.85k|    }
 2051|  25.0k|  }
 2052|  14.5k|  *sad = best_sad;
 2053|  14.5k|  return (center - search_size_top);
 2054|  14.5k|}
av1_int_pro_motion_estimation:
 2063|  7.25k|    int use_larger_search) {
 2064|  7.25k|  const AV1_COMMON *const cm = &cpi->common;
 2065|  7.25k|  MACROBLOCKD *xd = &x->e_mbd;
 2066|  7.25k|  MB_MODE_INFO *mi = xd->mi[0];
 2067|  7.25k|  struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0, 0, 0, 0 } };
 2068|  7.25k|  int idx;
 2069|  7.25k|  const int bw = block_size_wide[bsize];
 2070|  7.25k|  const int bh = block_size_high[bsize];
 2071|  7.25k|  const int is_screen = cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN;
 2072|  7.25k|  const int full_search = is_screen;
 2073|  7.25k|  const bool scroll_superblock =
 2074|  7.25k|      use_larger_search && bsize == cm->seq_params->sb_size;
  ------------------
  |  Branch (2074:7): [True: 0, False: 7.25k]
  |  Branch (2074:28): [True: 0, False: 0]
  ------------------
 2075|       |  // Keep border a multiple of 16.
 2076|  7.25k|  const int border = (cpi->oxcf.border_in_pixels >> 4) << 4;
 2077|  7.25k|  int search_size_width_left = me_search_size_col;
 2078|  7.25k|  int search_size_width_right = me_search_size_col;
 2079|  7.25k|  int search_size_height_top = me_search_size_row;
 2080|  7.25k|  int search_size_height_bottom = me_search_size_row;
 2081|       |  // Allow for larger search size for column/horizontal screen motion.
 2082|  7.25k|  if (scroll_superblock && is_var_part) {
  ------------------
  |  Branch (2082:7): [True: 0, False: 7.25k]
  |  Branch (2082:28): [True: 0, False: 0]
  ------------------
 2083|      0|    if (((mi_col << 2) - search_size_width_left) < -border)
  ------------------
  |  Branch (2083:9): [True: 0, False: 0]
  ------------------
 2084|      0|      search_size_width_left = (mi_col << 2) + border;
 2085|      0|    if (((mi_col << 2) + search_size_width_right + bw) > cm->width + border)
  ------------------
  |  Branch (2085:9): [True: 0, False: 0]
  ------------------
 2086|      0|      search_size_width_right = cm->width + border - (mi_col << 2) - bw;
 2087|  7.25k|  } else {
 2088|  7.25k|    if (((mi_col << 2) - search_size_width_left < -border) ||
  ------------------
  |  Branch (2088:9): [True: 0, False: 7.25k]
  ------------------
 2089|  7.25k|        ((mi_col << 2) + search_size_width_right + bw > cm->width + border)) {
  ------------------
  |  Branch (2089:9): [True: 0, False: 7.25k]
  ------------------
 2090|      0|      search_size_width_left = AOMMIN(border, (mi_col << 2) + border);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2091|      0|      search_size_width_right =
 2092|      0|          AOMMIN(border, cm->width + border - (mi_col << 2) - bw);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2093|      0|    }
 2094|  7.25k|  }
 2095|       |  // Allow for larger search size for row/vertical screen motion.
 2096|  7.25k|  if (scroll_superblock && is_var_part) {
  ------------------
  |  Branch (2096:7): [True: 0, False: 7.25k]
  |  Branch (2096:28): [True: 0, False: 0]
  ------------------
 2097|      0|    if (((mi_row << 2) - search_size_height_top) < -border)
  ------------------
  |  Branch (2097:9): [True: 0, False: 0]
  ------------------
 2098|      0|      search_size_height_top = (mi_row << 2) + border;
 2099|      0|    if (((mi_row << 2) + search_size_height_bottom + bh) > cm->height + border)
  ------------------
  |  Branch (2099:9): [True: 0, False: 0]
  ------------------
 2100|      0|      search_size_height_bottom = cm->height + border - (mi_row << 2) - bh;
 2101|  7.25k|  } else {
 2102|  7.25k|    if (((mi_row << 2) - search_size_height_top < -border) ||
  ------------------
  |  Branch (2102:9): [True: 1, False: 7.25k]
  ------------------
 2103|  7.25k|        ((mi_row << 2) + search_size_height_bottom + bh >
  ------------------
  |  Branch (2103:9): [True: 18.4E, False: 7.25k]
  ------------------
 2104|  7.25k|         cm->height + border)) {
 2105|      0|      search_size_height_top = AOMMIN(border, (mi_row << 2) + border);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2106|      0|      search_size_height_bottom =
 2107|      0|          AOMMIN(border, cm->height + border - (mi_row << 2) - bh);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2108|      0|    }
 2109|  7.25k|  }
 2110|       |  // Make search_size_width/height_left/right/top/bottom multiple of 16.
 2111|  7.25k|  search_size_width_left &= ~15;
 2112|  7.25k|  search_size_width_right &= ~15;
 2113|  7.25k|  search_size_height_top &= ~15;
 2114|  7.25k|  search_size_height_bottom &= ~15;
 2115|  7.25k|  const int src_stride = x->plane[0].src.stride;
 2116|  7.25k|  uint8_t const *ref_buf, *src_buf;
 2117|  7.25k|  int_mv *best_int_mv = &xd->mi[0]->mv[0];
 2118|  7.25k|  unsigned int best_sad, tmp_sad, this_sad[4];
 2119|  7.25k|  int best_sad_col, best_sad_row;
 2120|  7.25k|  const int row_norm_factor = mi_size_high_log2[bsize] + 1;
 2121|  7.25k|  const int col_norm_factor = 3 + (bw >> 5);
 2122|  7.25k|  const YV12_BUFFER_CONFIG *scaled_ref_frame =
 2123|  7.25k|      av1_get_scaled_ref_frame(cpi, mi->ref_frame[0]);
 2124|  7.25k|  static const MV search_pos[4] = {
 2125|  7.25k|    { -1, 0 },
 2126|  7.25k|    { 0, -1 },
 2127|  7.25k|    { 0, 1 },
 2128|  7.25k|    { 1, 0 },
 2129|  7.25k|  };
 2130|       |
 2131|  7.25k|  if (scaled_ref_frame) {
  ------------------
  |  Branch (2131:7): [True: 6.57k, False: 682]
  ------------------
 2132|  6.57k|    int i;
 2133|       |    // Swap out the reference frame for a version that's been scaled to
 2134|       |    // match the resolution of the current frame, allowing the existing
 2135|       |    // motion search code to be used without additional modifications.
 2136|  26.3k|    for (i = 0; i < MAX_MB_PLANE; i++) backup_yv12[i] = xd->plane[i].pre[0];
  ------------------
  |  |   36|  26.3k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (2136:17): [True: 19.7k, False: 6.57k]
  ------------------
 2137|  6.57k|    av1_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL,
 2138|  6.57k|                         MAX_MB_PLANE);
  ------------------
  |  |   36|  6.57k|#define MAX_MB_PLANE 3
  ------------------
 2139|  6.57k|  }
 2140|  7.25k|  const int ref_stride = xd->plane[0].pre[0].stride;
 2141|       |
 2142|  7.25k|  if (xd->bd != 8) {
  ------------------
  |  Branch (2142:7): [True: 0, False: 7.25k]
  ------------------
 2143|      0|    best_int_mv->as_fullmv = kZeroFullMv;
 2144|      0|    best_sad = cpi->ppi->fn_ptr[bsize].sdf(x->plane[0].src.buf, src_stride,
 2145|      0|                                           xd->plane[0].pre[0].buf, ref_stride);
 2146|       |
 2147|      0|    if (scaled_ref_frame) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 0]
  ------------------
 2148|      0|      int i;
 2149|      0|      for (i = 0; i < MAX_MB_PLANE; i++) xd->plane[i].pre[0] = backup_yv12[i];
  ------------------
  |  |   36|      0|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (2149:19): [True: 0, False: 0]
  ------------------
 2150|      0|    }
 2151|      0|    return best_sad;
 2152|      0|  }
 2153|  7.25k|  const int width_ref_buf =
 2154|  7.25k|      search_size_width_left + search_size_width_right + bw;
 2155|  7.25k|  const int height_ref_buf =
 2156|  7.25k|      search_size_height_top + search_size_height_bottom + bh;
 2157|  7.25k|  int16_t *hbuf = (int16_t *)aom_malloc(width_ref_buf * sizeof(*hbuf));
 2158|  7.25k|  int16_t *vbuf = (int16_t *)aom_malloc(height_ref_buf * sizeof(*vbuf));
 2159|  7.25k|  int16_t *src_hbuf = (int16_t *)aom_malloc(bw * sizeof(*src_hbuf));
 2160|  7.25k|  int16_t *src_vbuf = (int16_t *)aom_malloc(bh * sizeof(*src_vbuf));
 2161|  7.30k|  if (!hbuf || !vbuf || !src_hbuf || !src_vbuf) {
  ------------------
  |  Branch (2161:7): [True: 18.4E, False: 7.29k]
  |  Branch (2161:16): [True: 18.4E, False: 7.30k]
  |  Branch (2161:25): [True: 0, False: 7.30k]
  |  Branch (2161:38): [True: 0, False: 7.30k]
  ------------------
 2162|      0|    aom_free(hbuf);
 2163|      0|    aom_free(vbuf);
 2164|      0|    aom_free(src_hbuf);
 2165|      0|    aom_free(src_vbuf);
 2166|      0|    aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 2167|      0|                       "Failed to allocate hbuf, vbuf, src_hbuf, or src_vbuf");
 2168|      0|  }
 2169|       |
 2170|       |  // Set up prediction 1-D reference set for rows.
 2171|  7.25k|  ref_buf = xd->plane[0].pre[0].buf - search_size_width_left;
 2172|  7.25k|  aom_int_pro_row(hbuf, ref_buf, ref_stride, width_ref_buf, bh,
 2173|  7.25k|                  row_norm_factor);
 2174|       |
 2175|       |  // Set up prediction 1-D reference set for cols
 2176|  7.25k|  ref_buf = xd->plane[0].pre[0].buf - search_size_height_top * ref_stride;
 2177|  7.25k|  aom_int_pro_col(vbuf, ref_buf, ref_stride, bw, height_ref_buf,
 2178|  7.25k|                  col_norm_factor);
 2179|       |
 2180|       |  // Set up src 1-D reference set
 2181|  7.25k|  src_buf = x->plane[0].src.buf;
 2182|  7.25k|  aom_int_pro_row(src_hbuf, src_buf, src_stride, bw, bh, row_norm_factor);
 2183|  7.25k|  aom_int_pro_col(src_vbuf, src_buf, src_stride, bw, bh, col_norm_factor);
 2184|       |
 2185|       |  // Find the best match per 1-D search
 2186|  7.25k|  best_int_mv->as_fullmv.col = av1_vector_match(
 2187|  7.25k|      hbuf, src_hbuf, mi_size_wide_log2[bsize], search_size_width_left,
 2188|  7.25k|      search_size_width_right, full_search, &best_sad_col);
 2189|  7.25k|  best_int_mv->as_fullmv.row = av1_vector_match(
 2190|  7.25k|      vbuf, src_vbuf, mi_size_high_log2[bsize], search_size_height_top,
 2191|  7.25k|      search_size_height_bottom, full_search, &best_sad_row);
 2192|       |
 2193|       |  // For screen: select between horiz or vert motion.
 2194|  7.25k|  if (is_screen) {
  ------------------
  |  Branch (2194:7): [True: 0, False: 7.25k]
  ------------------
 2195|      0|    if (best_sad_col < best_sad_row)
  ------------------
  |  Branch (2195:9): [True: 0, False: 0]
  ------------------
 2196|      0|      best_int_mv->as_fullmv.row = 0;
 2197|      0|    else
 2198|      0|      best_int_mv->as_fullmv.col = 0;
 2199|      0|  }
 2200|       |
 2201|  7.25k|  FULLPEL_MV this_mv = best_int_mv->as_fullmv;
 2202|  7.25k|  src_buf = x->plane[0].src.buf;
 2203|  7.25k|  ref_buf = get_buf_from_fullmv(&xd->plane[0].pre[0], &this_mv);
 2204|  7.25k|  best_sad =
 2205|  7.25k|      cpi->ppi->fn_ptr[bsize].sdf(src_buf, src_stride, ref_buf, ref_stride);
 2206|       |
 2207|  7.29k|  if (!is_screen && scroll_superblock) {
  ------------------
  |  Branch (2207:7): [True: 7.29k, False: 18.4E]
  |  Branch (2207:21): [True: 0, False: 7.29k]
  ------------------
 2208|      0|    if (best_sad_col < best_sad_row && best_sad_col < (int)best_sad) {
  ------------------
  |  Branch (2208:9): [True: 0, False: 0]
  |  Branch (2208:40): [True: 0, False: 0]
  ------------------
 2209|      0|      best_int_mv->as_fullmv.row = 0;
 2210|      0|      best_sad = best_sad_col;
 2211|      0|    } else if (best_sad_row < best_sad_col && best_sad_row < (int)best_sad) {
  ------------------
  |  Branch (2211:16): [True: 0, False: 0]
  |  Branch (2211:47): [True: 0, False: 0]
  ------------------
 2212|      0|      best_int_mv->as_fullmv.col = 0;
 2213|      0|      best_sad = best_sad_row;
 2214|      0|    }
 2215|      0|  }
 2216|       |
 2217|       |  // Evaluate zero MV if found MV is non-zero.
 2218|  7.26k|  if (best_int_mv->as_int != 0) {
  ------------------
  |  Branch (2218:7): [True: 7.26k, False: 18.4E]
  ------------------
 2219|  7.26k|    tmp_sad = cpi->ppi->fn_ptr[bsize].sdf(x->plane[0].src.buf, src_stride,
 2220|  7.26k|                                          xd->plane[0].pre[0].buf, ref_stride);
 2221|  7.26k|    *y_sad_zero = tmp_sad;
 2222|  7.26k|    if (tmp_sad < best_sad) {
  ------------------
  |  Branch (2222:9): [True: 3.81k, False: 3.45k]
  ------------------
 2223|  3.81k|      best_int_mv->as_fullmv = kZeroFullMv;
 2224|  3.81k|      this_mv = best_int_mv->as_fullmv;
 2225|  3.81k|      ref_buf = xd->plane[0].pre[0].buf;
 2226|  3.81k|      best_sad = tmp_sad;
 2227|  3.81k|    }
 2228|  18.4E|  } else {
 2229|  18.4E|    *y_sad_zero = best_sad;
 2230|  18.4E|  }
 2231|       |
 2232|  7.28k|  if (!scroll_superblock) {
  ------------------
  |  Branch (2232:7): [True: 7.28k, False: 18.4E]
  ------------------
 2233|  7.28k|    const uint8_t *const pos[4] = {
 2234|  7.28k|      ref_buf - ref_stride,
 2235|  7.28k|      ref_buf - 1,
 2236|  7.28k|      ref_buf + 1,
 2237|  7.28k|      ref_buf + ref_stride,
 2238|  7.28k|    };
 2239|       |
 2240|  7.28k|    cpi->ppi->fn_ptr[bsize].sdx4df(src_buf, src_stride, pos, ref_stride,
 2241|  7.28k|                                   this_sad);
 2242|       |
 2243|  36.3k|    for (idx = 0; idx < 4; ++idx) {
  ------------------
  |  Branch (2243:19): [True: 29.0k, False: 7.28k]
  ------------------
 2244|  29.0k|      if (this_sad[idx] < best_sad) {
  ------------------
  |  Branch (2244:11): [True: 8.65k, False: 20.4k]
  ------------------
 2245|  8.65k|        best_sad = this_sad[idx];
 2246|  8.65k|        best_int_mv->as_fullmv.row = search_pos[idx].row + this_mv.row;
 2247|  8.65k|        best_int_mv->as_fullmv.col = search_pos[idx].col + this_mv.col;
 2248|  8.65k|      }
 2249|  29.0k|    }
 2250|       |
 2251|  7.28k|    if (this_sad[0] < this_sad[3])
  ------------------
  |  Branch (2251:9): [True: 3.53k, False: 3.75k]
  ------------------
 2252|  3.53k|      this_mv.row -= 1;
 2253|  3.75k|    else
 2254|  3.75k|      this_mv.row += 1;
 2255|       |
 2256|  7.28k|    if (this_sad[1] < this_sad[2])
  ------------------
  |  Branch (2256:9): [True: 3.50k, False: 3.78k]
  ------------------
 2257|  3.50k|      this_mv.col -= 1;
 2258|  3.78k|    else
 2259|  3.78k|      this_mv.col += 1;
 2260|       |
 2261|  7.28k|    ref_buf = get_buf_from_fullmv(&xd->plane[0].pre[0], &this_mv);
 2262|       |
 2263|  7.28k|    tmp_sad =
 2264|  7.28k|        cpi->ppi->fn_ptr[bsize].sdf(src_buf, src_stride, ref_buf, ref_stride);
 2265|  7.28k|    if (best_sad > tmp_sad) {
  ------------------
  |  Branch (2265:9): [True: 2.33k, False: 4.95k]
  ------------------
 2266|  2.33k|      best_int_mv->as_fullmv = this_mv;
 2267|  2.33k|      best_sad = tmp_sad;
 2268|  2.33k|    }
 2269|  7.28k|  }
 2270|       |
 2271|  7.25k|  FullMvLimits mv_limits = x->mv_limits;
 2272|  7.25k|  av1_set_mv_search_range(&mv_limits, ref_mv);
 2273|  7.25k|  clamp_fullmv(&best_int_mv->as_fullmv, &mv_limits);
 2274|       |
 2275|  7.25k|  convert_fullmv_to_mv(best_int_mv);
 2276|       |
 2277|  7.25k|  if (scaled_ref_frame) {
  ------------------
  |  Branch (2277:7): [True: 6.59k, False: 663]
  ------------------
 2278|  6.59k|    int i;
 2279|  26.3k|    for (i = 0; i < MAX_MB_PLANE; i++) xd->plane[i].pre[0] = backup_yv12[i];
  ------------------
  |  |   36|  26.3k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (2279:17): [True: 19.7k, False: 6.59k]
  ------------------
 2280|  6.59k|  }
 2281|       |
 2282|  7.25k|  aom_free(hbuf);
 2283|  7.25k|  aom_free(vbuf);
 2284|  7.25k|  aom_free(src_hbuf);
 2285|  7.25k|  aom_free(src_vbuf);
 2286|  7.25k|  return best_sad;
 2287|  7.25k|}
av1_find_best_sub_pixel_tree_pruned_more:
 3030|  3.64M|    unsigned int *sse1, int_mv *last_mv_search_list) {
 3031|  3.64M|  (void)cm;
 3032|  3.64M|  const int allow_hp = ms_params->allow_hp;
 3033|  3.64M|  const int forced_stop = ms_params->forced_stop;
 3034|  3.64M|  const int iters_per_step = ms_params->iters_per_step;
 3035|  3.64M|  const int *cost_list = ms_params->cost_list;
 3036|  3.64M|  const SubpelMvLimits *mv_limits = &ms_params->mv_limits;
 3037|  3.64M|  const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
 3038|  3.64M|  const SUBPEL_SEARCH_VAR_PARAMS *var_params = &ms_params->var_params;
 3039|       |
 3040|       |  // The iteration we are current searching for. Iter 0 corresponds to fullpel
 3041|       |  // mv, iter 1 to half pel, and so on
 3042|  3.64M|  int iter = 0;
 3043|  3.64M|  int hstep = INIT_SUBPEL_STEP_SIZE;  // Step size, initialized to 4/8=1/2 pel
  ------------------
  |  | 2466|  3.64M|#define INIT_SUBPEL_STEP_SIZE (4)
  ------------------
 3044|  3.64M|  unsigned int besterr = INT_MAX;
 3045|  3.64M|  *bestmv = start_mv;
 3046|       |
 3047|  3.64M|  const struct scale_factors *const sf = is_intrabc_block(xd->mi[0])
  ------------------
  |  Branch (3047:42): [True: 0, False: 3.64M]
  ------------------
 3048|  3.64M|                                             ? &cm->sf_identity
 3049|  3.64M|                                             : xd->block_ref_scale_factors[0];
 3050|  3.64M|  const int is_scaled = av1_is_scaled(sf);
 3051|       |
 3052|  3.64M|  if (start_mv_stats != NULL && !is_scaled) {
  ------------------
  |  Branch (3052:7): [True: 2.02M, False: 1.62M]
  |  Branch (3052:33): [True: 238k, False: 1.78M]
  ------------------
 3053|   238k|    besterr = start_mv_stats->distortion + start_mv_stats->err_cost;
 3054|   238k|    *distortion = start_mv_stats->distortion;
 3055|   238k|    *sse1 = start_mv_stats->sse;
 3056|  3.40M|  } else {
 3057|  3.40M|    besterr =
 3058|  3.40M|        setup_center_error_facade(xd, cm, bestmv, var_params, mv_cost_params,
 3059|  3.40M|                                  sse1, distortion, is_scaled);
 3060|  3.40M|  }
 3061|       |
 3062|       |  // If forced_stop is FULL_PEL, return.
 3063|  3.64M|  if (forced_stop == FULL_PEL) return besterr;
  ------------------
  |  Branch (3063:7): [True: 0, False: 3.64M]
  ------------------
 3064|       |
 3065|  3.64M|  if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3065:7): [True: 0, False: 3.64M]
  ------------------
 3066|      0|    return INT_MAX;
 3067|      0|  }
 3068|  3.64M|  iter++;
 3069|       |
 3070|  3.64M|  if (cost_list && cost_list[0] != INT_MAX && cost_list[1] != INT_MAX &&
  ------------------
  |  Branch (3070:7): [True: 925, False: 3.64M]
  |  Branch (3070:20): [True: 925, False: 0]
  |  Branch (3070:47): [True: 925, False: 0]
  ------------------
 3071|    925|      cost_list[2] != INT_MAX && cost_list[3] != INT_MAX &&
  ------------------
  |  Branch (3071:7): [True: 925, False: 0]
  |  Branch (3071:34): [True: 925, False: 0]
  ------------------
 3072|    925|      cost_list[4] != INT_MAX && is_cost_list_wellbehaved(cost_list)) {
  ------------------
  |  Branch (3072:7): [True: 925, False: 0]
  |  Branch (3072:34): [True: 877, False: 48]
  ------------------
 3073|    877|    int ir, ic;
 3074|    877|    get_cost_surf_min(cost_list, &ir, &ic, 1);
 3075|    877|    if (ir != 0 || ic != 0) {
  ------------------
  |  Branch (3075:9): [True: 273, False: 604]
  |  Branch (3075:20): [True: 188, False: 416]
  ------------------
 3076|    461|      const MV this_mv = { start_mv.row + ir * hstep,
 3077|    461|                           start_mv.col + ic * hstep };
 3078|    461|      int dummy = 0;
 3079|    461|      check_better_fast(xd, cm, &this_mv, bestmv, mv_limits, var_params,
 3080|    461|                        mv_cost_params, &besterr, sse1, distortion, &dummy,
 3081|    461|                        is_scaled);
 3082|    461|    }
 3083|  3.64M|  } else {
 3084|  3.64M|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3085|  3.64M|                          var_params, mv_cost_params, &besterr, sse1,
 3086|  3.64M|                          distortion, iters_per_step, is_scaled);
 3087|  3.64M|  }
 3088|       |
 3089|       |  // Each subsequent iteration checks at least one point in common with
 3090|       |  // the last iteration could be 2 ( if diag selected) 1/4 pel
 3091|  3.64M|  if (forced_stop < HALF_PEL) {
  ------------------
  |  Branch (3091:7): [True: 3.64M, False: 771]
  ------------------
 3092|  3.64M|    if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3092:9): [True: 32.4k, False: 3.61M]
  ------------------
 3093|  32.4k|      return INT_MAX;
 3094|  32.4k|    }
 3095|  3.61M|    iter++;
 3096|       |
 3097|  3.61M|    hstep >>= 1;
 3098|  3.61M|    start_mv = *bestmv;
 3099|  3.61M|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3100|  3.61M|                          var_params, mv_cost_params, &besterr, sse1,
 3101|  3.61M|                          distortion, iters_per_step, is_scaled);
 3102|  3.61M|  }
 3103|       |
 3104|  3.61M|  if (allow_hp && forced_stop == EIGHTH_PEL) {
  ------------------
  |  Branch (3104:7): [True: 1.49M, False: 2.12M]
  |  Branch (3104:19): [True: 1.49M, False: 197]
  ------------------
 3105|  1.49M|    if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3105:9): [True: 6.87k, False: 1.48M]
  ------------------
 3106|  6.87k|      return INT_MAX;
 3107|  6.87k|    }
 3108|  1.48M|    iter++;
 3109|       |
 3110|  1.48M|    hstep >>= 1;
 3111|  1.48M|    start_mv = *bestmv;
 3112|  1.48M|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3113|  1.48M|                          var_params, mv_cost_params, &besterr, sse1,
 3114|  1.48M|                          distortion, iters_per_step, is_scaled);
 3115|  1.48M|  }
 3116|       |
 3117|  3.60M|  return besterr;
 3118|  3.61M|}
av1_find_best_sub_pixel_tree_pruned:
 3124|   597k|    unsigned int *sse1, int_mv *last_mv_search_list) {
 3125|   597k|  (void)cm;
 3126|   597k|  (void)start_mv_stats;
 3127|   597k|  const int allow_hp = ms_params->allow_hp;
 3128|   597k|  const int forced_stop = ms_params->forced_stop;
 3129|   597k|  const int iters_per_step = ms_params->iters_per_step;
 3130|   597k|  const int *cost_list = ms_params->cost_list;
 3131|   597k|  const SubpelMvLimits *mv_limits = &ms_params->mv_limits;
 3132|   597k|  const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
 3133|   597k|  const SUBPEL_SEARCH_VAR_PARAMS *var_params = &ms_params->var_params;
 3134|       |
 3135|       |  // The iteration we are current searching for. Iter 0 corresponds to fullpel
 3136|       |  // mv, iter 1 to half pel, and so on
 3137|   597k|  int iter = 0;
 3138|   597k|  int hstep = INIT_SUBPEL_STEP_SIZE;  // Step size, initialized to 4/8=1/2 pel
  ------------------
  |  | 2466|   597k|#define INIT_SUBPEL_STEP_SIZE (4)
  ------------------
 3139|   597k|  unsigned int besterr = INT_MAX;
 3140|   597k|  *bestmv = start_mv;
 3141|       |
 3142|   597k|  const struct scale_factors *const sf = is_intrabc_block(xd->mi[0])
  ------------------
  |  Branch (3142:42): [True: 0, False: 597k]
  ------------------
 3143|   597k|                                             ? &cm->sf_identity
 3144|   597k|                                             : xd->block_ref_scale_factors[0];
 3145|   597k|  const int is_scaled = av1_is_scaled(sf);
 3146|       |
 3147|   597k|  if (start_mv_stats != NULL && !is_scaled) {
  ------------------
  |  Branch (3147:7): [True: 597k, False: 18.4E]
  |  Branch (3147:33): [True: 597k, False: 18.4E]
  ------------------
 3148|   597k|    besterr = start_mv_stats->distortion + start_mv_stats->err_cost;
 3149|   597k|    *distortion = start_mv_stats->distortion;
 3150|   597k|    *sse1 = start_mv_stats->sse;
 3151|  18.4E|  } else {
 3152|  18.4E|    besterr =
 3153|  18.4E|        setup_center_error_facade(xd, cm, bestmv, var_params, mv_cost_params,
 3154|  18.4E|                                  sse1, distortion, is_scaled);
 3155|  18.4E|  }
 3156|       |
 3157|       |  // If forced_stop is FULL_PEL, return.
 3158|   597k|  if (forced_stop == FULL_PEL) return besterr;
  ------------------
  |  Branch (3158:7): [True: 0, False: 597k]
  ------------------
 3159|       |
 3160|   597k|  if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3160:7): [True: 0, False: 597k]
  ------------------
 3161|      0|    return INT_MAX;
 3162|      0|  }
 3163|   597k|  iter++;
 3164|       |
 3165|   597k|  if (cost_list && cost_list[0] != INT_MAX && cost_list[1] != INT_MAX &&
  ------------------
  |  Branch (3165:7): [True: 597k, False: 11]
  |  Branch (3165:20): [True: 597k, False: 18.4E]
  |  Branch (3165:47): [True: 597k, False: 2]
  ------------------
 3166|   597k|      cost_list[2] != INT_MAX && cost_list[3] != INT_MAX &&
  ------------------
  |  Branch (3166:7): [True: 597k, False: 115]
  |  Branch (3166:34): [True: 597k, False: 34]
  ------------------
 3167|   597k|      cost_list[4] != INT_MAX) {
  ------------------
  |  Branch (3167:7): [True: 597k, False: 3]
  ------------------
 3168|   597k|    const unsigned int whichdir = (cost_list[1] < cost_list[3] ? 0 : 1) +
  ------------------
  |  Branch (3168:36): [True: 286k, False: 310k]
  ------------------
 3169|   597k|                                  (cost_list[2] < cost_list[4] ? 0 : 2);
  ------------------
  |  Branch (3169:36): [True: 296k, False: 300k]
  ------------------
 3170|       |
 3171|   597k|    const MV left_mv = { start_mv.row, start_mv.col - hstep };
 3172|   597k|    const MV right_mv = { start_mv.row, start_mv.col + hstep };
 3173|   597k|    const MV bottom_mv = { start_mv.row + hstep, start_mv.col };
 3174|   597k|    const MV top_mv = { start_mv.row - hstep, start_mv.col };
 3175|       |
 3176|   597k|    const MV bottom_left_mv = { start_mv.row + hstep, start_mv.col - hstep };
 3177|   597k|    const MV bottom_right_mv = { start_mv.row + hstep, start_mv.col + hstep };
 3178|   597k|    const MV top_left_mv = { start_mv.row - hstep, start_mv.col - hstep };
 3179|   597k|    const MV top_right_mv = { start_mv.row - hstep, start_mv.col + hstep };
 3180|       |
 3181|   597k|    int dummy = 0;
 3182|       |
 3183|   597k|    switch (whichdir) {
  ------------------
  |  Branch (3183:13): [True: 599k, False: 18.4E]
  ------------------
 3184|   143k|      case 0:  // bottom left quadrant
  ------------------
  |  Branch (3184:7): [True: 143k, False: 453k]
  ------------------
 3185|   143k|        check_better_fast(xd, cm, &left_mv, bestmv, mv_limits, var_params,
 3186|   143k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3187|   143k|                          is_scaled);
 3188|   143k|        check_better_fast(xd, cm, &bottom_mv, bestmv, mv_limits, var_params,
 3189|   143k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3190|   143k|                          is_scaled);
 3191|   143k|        check_better_fast(xd, cm, &bottom_left_mv, bestmv, mv_limits,
 3192|   143k|                          var_params, mv_cost_params, &besterr, sse1,
 3193|   143k|                          distortion, &dummy, is_scaled);
 3194|   143k|        break;
 3195|   153k|      case 1:  // bottom right quadrant
  ------------------
  |  Branch (3195:7): [True: 153k, False: 443k]
  ------------------
 3196|   153k|        check_better_fast(xd, cm, &right_mv, bestmv, mv_limits, var_params,
 3197|   153k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3198|   153k|                          is_scaled);
 3199|   153k|        check_better_fast(xd, cm, &bottom_mv, bestmv, mv_limits, var_params,
 3200|   153k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3201|   153k|                          is_scaled);
 3202|   153k|        check_better_fast(xd, cm, &bottom_right_mv, bestmv, mv_limits,
 3203|   153k|                          var_params, mv_cost_params, &besterr, sse1,
 3204|   153k|                          distortion, &dummy, is_scaled);
 3205|   153k|        break;
 3206|   144k|      case 2:  // top left quadrant
  ------------------
  |  Branch (3206:7): [True: 144k, False: 453k]
  ------------------
 3207|   144k|        check_better_fast(xd, cm, &left_mv, bestmv, mv_limits, var_params,
 3208|   144k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3209|   144k|                          is_scaled);
 3210|   144k|        check_better_fast(xd, cm, &top_mv, bestmv, mv_limits, var_params,
 3211|   144k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3212|   144k|                          is_scaled);
 3213|   144k|        check_better_fast(xd, cm, &top_left_mv, bestmv, mv_limits, var_params,
 3214|   144k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3215|   144k|                          is_scaled);
 3216|   144k|        break;
 3217|   157k|      case 3:  // top right quadrant
  ------------------
  |  Branch (3217:7): [True: 157k, False: 439k]
  ------------------
 3218|   157k|        check_better_fast(xd, cm, &right_mv, bestmv, mv_limits, var_params,
 3219|   157k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3220|   157k|                          is_scaled);
 3221|   157k|        check_better_fast(xd, cm, &top_mv, bestmv, mv_limits, var_params,
 3222|   157k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3223|   157k|                          is_scaled);
 3224|   157k|        check_better_fast(xd, cm, &top_right_mv, bestmv, mv_limits, var_params,
 3225|   157k|                          mv_cost_params, &besterr, sse1, distortion, &dummy,
 3226|   157k|                          is_scaled);
 3227|   157k|        break;
 3228|   597k|    }
 3229|  18.4E|  } else {
 3230|  18.4E|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3231|  18.4E|                          var_params, mv_cost_params, &besterr, sse1,
 3232|  18.4E|                          distortion, iters_per_step, is_scaled);
 3233|  18.4E|  }
 3234|       |
 3235|       |  // Each subsequent iteration checks at least one point in common with
 3236|       |  // the last iteration could be 2 ( if diag selected) 1/4 pel
 3237|   598k|  if (forced_stop < HALF_PEL) {
  ------------------
  |  Branch (3237:7): [True: 598k, False: 18.4E]
  ------------------
 3238|   598k|    if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3238:9): [True: 0, False: 598k]
  ------------------
 3239|      0|      return INT_MAX;
 3240|      0|    }
 3241|   598k|    iter++;
 3242|       |
 3243|   598k|    hstep >>= 1;
 3244|   598k|    start_mv = *bestmv;
 3245|   598k|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3246|   598k|                          var_params, mv_cost_params, &besterr, sse1,
 3247|   598k|                          distortion, iters_per_step, is_scaled);
 3248|   598k|  }
 3249|       |
 3250|   598k|  if (allow_hp && forced_stop == EIGHTH_PEL) {
  ------------------
  |  Branch (3250:7): [True: 307k, False: 291k]
  |  Branch (3250:19): [True: 0, False: 307k]
  ------------------
 3251|      0|    if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
  ------------------
  |  Branch (3251:9): [True: 0, False: 0]
  ------------------
 3252|      0|      return INT_MAX;
 3253|      0|    }
 3254|      0|    iter++;
 3255|       |
 3256|      0|    hstep >>= 1;
 3257|      0|    start_mv = *bestmv;
 3258|      0|    two_level_checks_fast(xd, cm, start_mv, bestmv, hstep, mv_limits,
 3259|      0|                          var_params, mv_cost_params, &besterr, sse1,
 3260|      0|                          distortion, iters_per_step, is_scaled);
 3261|      0|  }
 3262|       |
 3263|   598k|  return besterr;
 3264|   598k|}
av1_refine_warped_mv:
 3536|  9.38k|                                  int num_iterations) {
 3537|  9.38k|  MB_MODE_INFO *mbmi = xd->mi[0];
 3538|       |
 3539|  9.38k|  const MV *neighbors = warp_search_info[search_method].neighbors;
 3540|  9.38k|  const int num_neighbors = warp_search_info[search_method].num_neighbors;
 3541|  9.38k|  const uint8_t *neighbor_mask = warp_search_info[search_method].neighbor_mask;
 3542|       |
 3543|  9.38k|  MV *best_mv = &mbmi->mv[0].as_mv;
 3544|       |
 3545|  9.38k|  WarpedMotionParams best_wm_params = mbmi->wm_params;
 3546|  9.38k|  int best_num_proj_ref = mbmi->num_proj_ref;
 3547|  9.38k|  unsigned int bestmse;
 3548|  9.38k|  const SubpelMvLimits *mv_limits = &ms_params->mv_limits;
 3549|       |
 3550|  9.38k|  const int mv_shift = ms_params->allow_hp ? 0 : 1;
  ------------------
  |  Branch (3550:24): [True: 1.78k, False: 7.59k]
  ------------------
 3551|       |
 3552|       |  // Calculate the center position's error
 3553|  9.38k|  assert(av1_is_subpelmv_in_range(mv_limits, *best_mv));
 3554|  9.38k|  bestmse = compute_motion_cost(xd, cm, ms_params, bsize, best_mv);
 3555|       |
 3556|       |  // MV search
 3557|  9.38k|  int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 3558|  9.38k|  const int mi_row = xd->mi_row;
 3559|  9.38k|  const int mi_col = xd->mi_col;
 3560|       |
 3561|       |  // First step always scans all neighbors
 3562|  9.38k|  uint8_t valid_neighbors = UINT8_MAX;
 3563|       |
 3564|  26.0k|  for (int ite = 0; ite < num_iterations; ++ite) {
  ------------------
  |  Branch (3564:21): [True: 25.8k, False: 185]
  ------------------
 3565|  25.8k|    int best_idx = -1;
 3566|       |
 3567|   129k|    for (int idx = 0; idx < num_neighbors; ++idx) {
  ------------------
  |  Branch (3567:23): [True: 103k, False: 25.8k]
  ------------------
 3568|   103k|      if ((valid_neighbors & (1 << idx)) == 0) {
  ------------------
  |  Branch (3568:11): [True: 16.5k, False: 86.9k]
  ------------------
 3569|  16.5k|        continue;
 3570|  16.5k|      }
 3571|       |
 3572|  86.9k|      unsigned int thismse;
 3573|       |
 3574|  86.9k|      MV this_mv = { best_mv->row + neighbors[idx].row * (1 << mv_shift),
 3575|  86.9k|                     best_mv->col + neighbors[idx].col * (1 << mv_shift) };
 3576|  86.9k|      if (av1_is_subpelmv_in_range(mv_limits, this_mv)) {
  ------------------
  |  Branch (3576:11): [True: 86.4k, False: 467]
  ------------------
 3577|  86.4k|        memcpy(pts, pts0, total_samples * 2 * sizeof(*pts0));
 3578|  86.4k|        memcpy(pts_inref, pts_inref0, total_samples * 2 * sizeof(*pts_inref0));
 3579|  86.4k|        if (total_samples > 1) {
  ------------------
  |  Branch (3579:13): [True: 35.3k, False: 51.0k]
  ------------------
 3580|  35.3k|          mbmi->num_proj_ref =
 3581|  35.3k|              av1_selectSamples(&this_mv, pts, pts_inref, total_samples, bsize);
 3582|  35.3k|        }
 3583|       |
 3584|  86.4k|        if (!av1_find_projection(mbmi->num_proj_ref, pts, pts_inref, bsize,
  ------------------
  |  Branch (3584:13): [True: 85.2k, False: 1.20k]
  ------------------
 3585|  86.4k|                                 this_mv.row, this_mv.col, &mbmi->wm_params,
 3586|  86.4k|                                 mi_row, mi_col)) {
 3587|  85.2k|          thismse = compute_motion_cost(xd, cm, ms_params, bsize, &this_mv);
 3588|       |
 3589|  85.2k|          if (thismse < bestmse) {
  ------------------
  |  Branch (3589:15): [True: 19.9k, False: 65.2k]
  ------------------
 3590|  19.9k|            best_idx = idx;
 3591|  19.9k|            best_wm_params = mbmi->wm_params;
 3592|  19.9k|            best_num_proj_ref = mbmi->num_proj_ref;
 3593|  19.9k|            bestmse = thismse;
 3594|  19.9k|          }
 3595|  85.2k|        }
 3596|  86.4k|      }
 3597|  86.9k|    }
 3598|       |
 3599|  25.8k|    if (best_idx == -1) break;
  ------------------
  |  Branch (3599:9): [True: 9.19k, False: 16.6k]
  ------------------
 3600|       |
 3601|  16.6k|    if (best_idx >= 0) {
  ------------------
  |  Branch (3601:9): [True: 16.6k, False: 18.4E]
  ------------------
 3602|  16.6k|      best_mv->row += neighbors[best_idx].row * (1 << mv_shift);
 3603|  16.6k|      best_mv->col += neighbors[best_idx].col * (1 << mv_shift);
 3604|  16.6k|      valid_neighbors = neighbor_mask[best_idx];
 3605|  16.6k|    }
 3606|  16.6k|  }
 3607|       |
 3608|  9.38k|  mbmi->wm_params = best_wm_params;
 3609|  9.38k|  mbmi->num_proj_ref = best_num_proj_ref;
 3610|  9.38k|  return bestmse;
 3611|  9.38k|}
mcomp.c:init_ms_buffers:
   55|  8.42M|static inline void init_ms_buffers(MSBuffers *ms_buffers, const MACROBLOCK *x) {
   56|  8.42M|  ms_buffers->ref = &x->e_mbd.plane[0].pre[0];
   57|  8.42M|  ms_buffers->src = &x->plane[0].src;
   58|       |
   59|  8.42M|  av1_set_ms_compound_refs(ms_buffers, NULL, NULL, 0, 0);
   60|       |
   61|  8.42M|  ms_buffers->wsrc = x->obmc_buffer.wsrc;
   62|  8.42M|  ms_buffers->obmc_mask = x->obmc_buffer.mask;
   63|  8.42M|}
mcomp.c:init_mv_cost_params:
   39|  8.43M|                                       int sadperbit) {
   40|  8.43M|  mv_cost_params->ref_mv = ref_mv;
   41|  8.43M|  mv_cost_params->full_ref_mv = get_fullmv_from_mv(ref_mv);
   42|  8.43M|  mv_cost_params->mv_cost_type = MV_COST_ENTROPY;
   43|  8.43M|  mv_cost_params->error_per_bit = errorperbit;
   44|  8.43M|  mv_cost_params->sad_per_bit = sadperbit;
   45|       |  // For allintra encoding mode, 'mv_costs' is not allocated. Hence, the
   46|       |  // population of mvjcost and mvcost are avoided. In case of IntraBC, these
   47|       |  // values are populated from 'dv_costs' in av1_set_ms_to_intra_mode().
   48|  8.43M|  if (mv_costs != NULL) {
  ------------------
  |  Branch (48:7): [True: 8.42M, False: 1.45k]
  ------------------
   49|  8.42M|    mv_cost_params->mvjcost = mv_costs->nmv_joint_cost;
   50|  8.42M|    mv_cost_params->mvcost[0] = mv_costs->mv_cost_stack[0];
   51|  8.42M|    mv_cost_params->mvcost[1] = mv_costs->mv_cost_stack[1];
   52|  8.42M|  }
   53|  8.43M|}
mcomp.c:mv_cost:
  297|   195M|                          const int *const comp_cost[2]) {
  298|   195M|  return joint_cost[av1_get_mv_joint(mv)] + comp_cost[0][mv->row] +
  299|   195M|         comp_cost[1][mv->col];
  300|   195M|}
mcomp.c:init_dsmotion_compensation:
  397|   279k|                                       int level) {
  398|   279k|  int num_search_steps = 0;
  399|   279k|  int stage_index = MAX_MVSEARCH_STEPS - 1;
  ------------------
  |  |   19|   279k|#define MAX_MVSEARCH_STEPS 11
  ------------------
  400|       |
  401|   279k|  cfg->site[stage_index][0].mv.col = cfg->site[stage_index][0].mv.row = 0;
  402|   279k|  cfg->site[stage_index][0].offset = 0;
  403|   279k|  cfg->stride = stride;
  404|       |
  405|       |  // Choose the initial step size depending on level.
  406|   279k|  const int first_step = (level > 0) ? (MAX_FIRST_STEP / 4) : MAX_FIRST_STEP;
  ------------------
  |  |   24|   137k|#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS - 1))
  |  |  ------------------
  |  |  |  |   19|   137k|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
                const int first_step = (level > 0) ? (MAX_FIRST_STEP / 4) : MAX_FIRST_STEP;
  ------------------
  |  |   24|   142k|#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS - 1))
  |  |  ------------------
  |  |  |  |   19|   142k|#define MAX_MVSEARCH_STEPS 11
  |  |  ------------------
  ------------------
  |  Branch (406:26): [True: 137k, False: 142k]
  ------------------
  407|       |
  408|  3.35M|  for (int radius = first_step; radius > 0;) {
  ------------------
  |  Branch (408:33): [True: 3.07M, False: 279k]
  ------------------
  409|  3.07M|    int num_search_pts = 8;
  410|       |
  411|  3.07M|    const FULLPEL_MV search_site_mvs[13] = {
  412|  3.07M|      { 0, 0 },           { -radius, 0 },      { radius, 0 },
  413|  3.07M|      { 0, -radius },     { 0, radius },       { -radius, -radius },
  414|  3.07M|      { radius, radius }, { -radius, radius }, { radius, -radius },
  415|  3.07M|    };
  416|       |
  417|  3.07M|    int i;
  418|  30.7M|    for (i = 0; i <= num_search_pts; ++i) {
  ------------------
  |  Branch (418:17): [True: 27.7M, False: 3.07M]
  ------------------
  419|  27.7M|      search_site *const site = &cfg->site[stage_index][i];
  420|  27.7M|      site->mv = search_site_mvs[i];
  421|  27.7M|      site->offset = get_offset_from_fullmv(&site->mv, stride);
  422|  27.7M|    }
  423|  3.07M|    cfg->searches_per_step[stage_index] = num_search_pts;
  424|  3.07M|    cfg->radius[stage_index] = radius;
  425|       |    // Update the search radius based on level.
  426|  3.07M|    if (!level || ((stage_index < 9) && level)) radius /= 2;
  ------------------
  |  Branch (426:9): [True: 1.56M, False: 1.51M]
  |  Branch (426:20): [True: 1.23M, False: 275k]
  |  Branch (426:41): [True: 1.23M, False: 0]
  ------------------
  427|  3.07M|    --stage_index;
  428|  3.07M|    ++num_search_steps;
  429|  3.07M|  }
  430|   279k|  cfg->num_search_steps = num_search_steps;
  431|   279k|}
mcomp.c:init_motion_compensation_nstep:
  480|   275k|                                           int level) {
  481|   275k|  int num_search_steps = 0;
  482|   275k|  int stage_index = 0;
  483|   275k|  cfg->stride = stride;
  484|   275k|  int radius = 1;
  485|   275k|  const int num_stages = (level > 0) ? 16 : 15;
  ------------------
  |  Branch (485:26): [True: 137k, False: 137k]
  ------------------
  486|  4.54M|  for (stage_index = 0; stage_index < num_stages; ++stage_index) {
  ------------------
  |  Branch (486:25): [True: 4.26M, False: 275k]
  ------------------
  487|  4.26M|    int tan_radius = AOMMAX((int)(0.41 * radius), 1);
  ------------------
  |  |   35|  4.26M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 3.43M, False: 825k]
  |  |  ------------------
  ------------------
  488|  4.26M|    int num_search_pts = 12;
  489|  4.26M|    if ((radius <= 5) || (level > 0)) {
  ------------------
  |  Branch (489:9): [True: 1.10M, False: 3.16M]
  |  Branch (489:26): [True: 1.65M, False: 1.51M]
  ------------------
  490|  2.75M|      tan_radius = radius;
  491|  2.75M|      num_search_pts = 8;
  492|  2.75M|    }
  493|  4.26M|    const FULLPEL_MV search_site_mvs[13] = {
  494|  4.26M|      { 0, 0 },
  495|  4.26M|      { -radius, 0 },
  496|  4.26M|      { radius, 0 },
  497|  4.26M|      { 0, -radius },
  498|  4.26M|      { 0, radius },
  499|  4.26M|      { -radius, -tan_radius },
  500|  4.26M|      { radius, tan_radius },
  501|  4.26M|      { -tan_radius, radius },
  502|  4.26M|      { tan_radius, -radius },
  503|  4.26M|      { -radius, tan_radius },
  504|  4.26M|      { radius, -tan_radius },
  505|  4.26M|      { tan_radius, radius },
  506|  4.26M|      { -tan_radius, -radius },
  507|  4.26M|    };
  508|       |
  509|  48.7M|    for (int i = 0; i <= num_search_pts; ++i) {
  ------------------
  |  Branch (509:21): [True: 44.4M, False: 4.26M]
  ------------------
  510|  44.4M|      search_site *const site = &cfg->site[stage_index][i];
  511|  44.4M|      site->mv = search_site_mvs[i];
  512|  44.4M|      site->offset = get_offset_from_fullmv(&site->mv, stride);
  513|  44.4M|    }
  514|  4.26M|    cfg->searches_per_step[stage_index] = num_search_pts;
  515|  4.26M|    cfg->radius[stage_index] = radius;
  516|  4.26M|    ++num_search_steps;
  517|  4.26M|    if (stage_index < 12)
  ------------------
  |  Branch (517:9): [True: 3.30M, False: 963k]
  ------------------
  518|  3.30M|      radius = (int)AOMMAX((radius * 1.5 + 0.5), radius + 1);
  ------------------
  |  |   35|  3.30M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 3.02M, False: 275k]
  |  |  ------------------
  ------------------
  519|  4.26M|  }
  520|   275k|  cfg->num_search_steps = num_search_steps;
  521|   275k|}
mcomp.c:init_motion_compensation_hex:
  581|   137k|                                         int level) {
  582|   137k|  (void)level;
  583|   137k|  cfg->stride = stride;
  584|       |  // First scale has 8-closest points, the rest have 6 points in hex shape
  585|       |  // at increasing scales.
  586|   137k|  static const int hex_num_candidates[MAX_PATTERN_SCALES] = { 8, 6, 6, 6, 6, 6,
  587|   137k|                                                              6, 6, 6, 6, 6 };
  588|       |  // Note that the largest candidate step at each scale is 2^scale.
  589|       |  /* clang-format off */
  590|   137k|    static const FULLPEL_MV
  591|   137k|        hex_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = {
  592|   137k|        { { -1, -1 }, { 0, -1 }, { 1, -1 }, { 1, 0 }, { 1, 1 }, { 0, 1 },
  593|   137k|          { -1, 1 }, { -1, 0 } },
  594|   137k|        { { -1, -2 }, { 1, -2 }, { 2, 0 }, { 1, 2 }, { -1, 2 }, { -2, 0 } },
  595|   137k|        { { -2, -4 }, { 2, -4 }, { 4, 0 }, { 2, 4 }, { -2, 4 }, { -4, 0 } },
  596|   137k|        { { -4, -8 }, { 4, -8 }, { 8, 0 }, { 4, 8 }, { -4, 8 }, { -8, 0 } },
  597|   137k|        { { -8, -16 }, { 8, -16 }, { 16, 0 }, { 8, 16 },
  598|   137k|          { -8, 16 }, { -16, 0 } },
  599|   137k|        { { -16, -32 }, { 16, -32 }, { 32, 0 }, { 16, 32 }, { -16, 32 },
  600|   137k|          { -32, 0 } },
  601|   137k|        { { -32, -64 }, { 32, -64 }, { 64, 0 }, { 32, 64 }, { -32, 64 },
  602|   137k|          { -64, 0 } },
  603|   137k|        { { -64, -128 }, { 64, -128 }, { 128, 0 }, { 64, 128 },
  604|   137k|          { -64, 128 }, { -128, 0 } },
  605|   137k|        { { -128, -256 }, { 128, -256 }, { 256, 0 }, { 128, 256 },
  606|   137k|          { -128, 256 }, { -256, 0 } },
  607|   137k|        { { -256, -512 }, { 256, -512 }, { 512, 0 }, { 256, 512 },
  608|   137k|          { -256, 512 }, { -512, 0 } },
  609|   137k|        { { -512, -1024 }, { 512, -1024 }, { 1024, 0 }, { 512, 1024 },
  610|   137k|          { -512, 1024 }, { -1024, 0 } },
  611|   137k|    };
  612|       |
  613|       |  /* clang-format on */
  614|   137k|  int radius = 1;
  615|  1.65M|  for (int i = 0; i < MAX_PATTERN_SCALES; ++i) {
  ------------------
  |  |  390|  1.65M|#define MAX_PATTERN_SCALES 11
  ------------------
  |  Branch (615:19): [True: 1.51M, False: 137k]
  ------------------
  616|  1.51M|    cfg->searches_per_step[i] = hex_num_candidates[i];
  617|  1.51M|    cfg->radius[i] = radius;
  618|  10.8M|    for (int j = 0; j < hex_num_candidates[i]; ++j) {
  ------------------
  |  Branch (618:21): [True: 9.35M, False: 1.51M]
  ------------------
  619|  9.35M|      search_site *const site = &cfg->site[i][j];
  620|  9.35M|      site->mv = hex_candidates[i][j];
  621|  9.35M|      site->offset = get_offset_from_fullmv(&site->mv, stride);
  622|  9.35M|    }
  623|  1.51M|    radius *= 2;
  624|  1.51M|  }
  625|   137k|  cfg->num_search_steps = MAX_PATTERN_SCALES;
  ------------------
  |  |  390|   137k|#define MAX_PATTERN_SCALES 11
  ------------------
  626|   137k|}
mcomp.c:init_motion_compensation_bigdia:
  526|   141k|                                            int level) {
  527|   141k|  (void)level;
  528|   141k|  cfg->stride = stride;
  529|       |  // First scale has 4-closest points, the rest have 8 points in diamond
  530|       |  // shape at increasing scales
  531|   141k|  static const int bigdia_num_candidates[MAX_PATTERN_SCALES] = {
  532|   141k|    4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  533|   141k|  };
  534|       |
  535|       |  // BIGDIA search method candidates.
  536|       |  // Note that the largest candidate step at each scale is 2^scale
  537|       |  /* clang-format off */
  538|   141k|  static const FULLPEL_MV
  539|   141k|      site_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = {
  540|   141k|          { { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, 0 }, { 0, 0 },
  541|   141k|            { 0, 0 }, { 0, 0 } },
  542|   141k|          { { -1, -1 }, { 0, -2 }, { 1, -1 }, { 2, 0 }, { 1, 1 }, { 0, 2 },
  543|   141k|            { -1, 1 }, { -2, 0 } },
  544|   141k|          { { -2, -2 }, { 0, -4 }, { 2, -2 }, { 4, 0 }, { 2, 2 }, { 0, 4 },
  545|   141k|            { -2, 2 }, { -4, 0 } },
  546|   141k|          { { -4, -4 }, { 0, -8 }, { 4, -4 }, { 8, 0 }, { 4, 4 }, { 0, 8 },
  547|   141k|            { -4, 4 }, { -8, 0 } },
  548|   141k|          { { -8, -8 }, { 0, -16 }, { 8, -8 }, { 16, 0 }, { 8, 8 }, { 0, 16 },
  549|   141k|            { -8, 8 }, { -16, 0 } },
  550|   141k|          { { -16, -16 }, { 0, -32 }, { 16, -16 }, { 32, 0 }, { 16, 16 },
  551|   141k|            { 0, 32 }, { -16, 16 }, { -32, 0 } },
  552|   141k|          { { -32, -32 }, { 0, -64 }, { 32, -32 }, { 64, 0 }, { 32, 32 },
  553|   141k|            { 0, 64 }, { -32, 32 }, { -64, 0 } },
  554|   141k|          { { -64, -64 }, { 0, -128 }, { 64, -64 }, { 128, 0 }, { 64, 64 },
  555|   141k|            { 0, 128 }, { -64, 64 }, { -128, 0 } },
  556|   141k|          { { -128, -128 }, { 0, -256 }, { 128, -128 }, { 256, 0 },
  557|   141k|            { 128, 128 }, { 0, 256 }, { -128, 128 }, { -256, 0 } },
  558|   141k|          { { -256, -256 }, { 0, -512 }, { 256, -256 }, { 512, 0 },
  559|   141k|            { 256, 256 }, { 0, 512 }, { -256, 256 }, { -512, 0 } },
  560|   141k|          { { -512, -512 }, { 0, -1024 }, { 512, -512 }, { 1024, 0 },
  561|   141k|            { 512, 512 }, { 0, 1024 }, { -512, 512 }, { -1024, 0 } },
  562|   141k|        };
  563|       |
  564|       |  /* clang-format on */
  565|   141k|  int radius = 1;
  566|  1.69M|  for (int i = 0; i < MAX_PATTERN_SCALES; ++i) {
  ------------------
  |  |  390|  1.69M|#define MAX_PATTERN_SCALES 11
  ------------------
  |  Branch (566:19): [True: 1.55M, False: 141k]
  ------------------
  567|  1.55M|    cfg->searches_per_step[i] = bigdia_num_candidates[i];
  568|  1.55M|    cfg->radius[i] = radius;
  569|  14.0M|    for (int j = 0; j < MAX_PATTERN_CANDIDATES; ++j) {
  ------------------
  |  |  391|  14.0M|#define MAX_PATTERN_CANDIDATES 8  // max number of candidates per scale
  ------------------
  |  Branch (569:21): [True: 12.4M, False: 1.55M]
  ------------------
  570|  12.4M|      search_site *const site = &cfg->site[i][j];
  571|  12.4M|      site->mv = site_candidates[i][j];
  572|  12.4M|      site->offset = get_offset_from_fullmv(&site->mv, stride);
  573|  12.4M|    }
  574|  1.55M|    radius *= 2;
  575|  1.55M|  }
  576|   141k|  cfg->num_search_steps = MAX_PATTERN_SCALES;
  ------------------
  |  |  390|   141k|#define MAX_PATTERN_SCALES 11
  ------------------
  577|   141k|}
mcomp.c:mvsad_err_cost_:
  380|   124M|                                  const MV_COST_PARAMS *mv_cost_params) {
  381|   124M|  return mvsad_err_cost(mv, &mv_cost_params->full_ref_mv,
  382|   124M|                        mv_cost_params->mvjcost, mv_cost_params->mvcost,
  383|   124M|                        mv_cost_params->sad_per_bit,
  384|   124M|                        mv_cost_params->mv_cost_type);
  385|   124M|}
mcomp.c:mvsad_err_cost:
  358|   124M|                                 int sad_per_bit, MV_COST_TYPE mv_cost_type) {
  359|   124M|  const MV diff = { GET_MV_SUBPEL(mv->row - ref_mv->row),
  ------------------
  |  |   29|   124M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  360|   124M|                    GET_MV_SUBPEL(mv->col - ref_mv->col) };
  ------------------
  |  |   29|   124M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  361|       |
  362|   124M|  switch (mv_cost_type) {
  363|   124M|    case MV_COST_ENTROPY:
  ------------------
  |  Branch (363:5): [True: 124M, False: 18.4E]
  ------------------
  364|   124M|      return ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|   124M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  365|      0|          (unsigned)mv_cost(&diff, mvjcost, CONVERT_TO_CONST_MVCOST(mvcost)) *
  366|      0|              sad_per_bit,
  367|      0|          AV1_PROB_COST_SHIFT);
  368|      0|    case MV_COST_L1_LOWRES:
  ------------------
  |  Branch (368:5): [True: 0, False: 124M]
  ------------------
  369|      0|      return (SAD_LAMBDA_LOWRES * (abs(diff.row) + abs(diff.col))) >> 3;
  ------------------
  |  |  284|      0|#define SAD_LAMBDA_LOWRES 32  // Used by mvsad_err_cost during full pixel search
  ------------------
  370|      0|    case MV_COST_L1_MIDRES:
  ------------------
  |  Branch (370:5): [True: 0, False: 124M]
  ------------------
  371|      0|      return (SAD_LAMBDA_MIDRES * (abs(diff.row) + abs(diff.col))) >> 3;
  ------------------
  |  |  287|      0|#define SAD_LAMBDA_MIDRES 15  // Used by mvsad_err_cost during full pixel search
  ------------------
  372|      0|    case MV_COST_L1_HDRES:
  ------------------
  |  Branch (372:5): [True: 0, False: 124M]
  ------------------
  373|      0|      return (SAD_LAMBDA_HDRES * (abs(diff.row) + abs(diff.col))) >> 3;
  ------------------
  |  |  290|      0|#define SAD_LAMBDA_HDRES 8  // Used by mvsad_err_cost during full pixel search
  ------------------
  374|      0|    case MV_COST_NONE: return 0;
  ------------------
  |  Branch (374:5): [True: 0, False: 124M]
  ------------------
  375|      0|    default: assert(0 && "Invalid rd_cost_type"); return 0;
  ------------------
  |  Branch (375:5): [True: 0, False: 124M]
  ------------------
  376|   124M|  }
  377|   124M|}
mcomp.c:vfast_dia_search:
 1269|  1.38k|                            FULLPEL_MV_STATS *best_mv_stats) {
 1270|  1.38k|  return bigdia_search(start_mv, ms_params,
 1271|  1.38k|                       AOMMAX(MAX_MVSEARCH_STEPS - 1, search_step),
  ------------------
  |  |   35|  1.38k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.38k, False: 0]
  |  |  ------------------
  ------------------
 1272|  1.38k|                       do_init_search, cost_list, best_mv, best_mv_stats);
 1273|  1.38k|}
mcomp.c:fast_dia_search:
 1279|   596k|                           FULLPEL_MV_STATS *best_mv_stats) {
 1280|   596k|  return bigdia_search(start_mv, ms_params,
 1281|   596k|                       AOMMAX(MAX_MVSEARCH_STEPS - 2, search_step),
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 597k, False: 18.4E]
  |  |  ------------------
  ------------------
 1282|   596k|                       do_init_search, cost_list, best_mv, best_mv_stats);
 1283|   596k|}
mcomp.c:pattern_search:
 1009|   651k|                          FULLPEL_MV_STATS *best_mv_stats) {
 1010|   651k|  static const int search_steps[MAX_MVSEARCH_STEPS] = {
 1011|   651k|    10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
 1012|   651k|  };
 1013|   651k|  int i, s, t;
 1014|       |
 1015|   651k|  const struct buf_2d *const src = ms_params->ms_buffers.src;
 1016|   651k|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
 1017|   651k|  const search_site_config *search_sites = ms_params->search_sites;
 1018|   651k|  const int *num_candidates = search_sites->searches_per_step;
 1019|   651k|  const int ref_stride = ref->stride;
 1020|   651k|  const int last_is_4 = num_candidates[0] == 4;
 1021|   651k|  int br, bc;
 1022|   651k|  unsigned int bestsad = UINT_MAX, raw_bestsad = UINT_MAX;
 1023|   651k|  int k = -1;
 1024|   651k|  const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
 1025|   651k|  search_step = AOMMIN(search_step, MAX_MVSEARCH_STEPS - 1);
  ------------------
  |  |   34|   651k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 650k, False: 1.37k]
  |  |  ------------------
  ------------------
 1026|   651k|  assert(search_step >= 0);
 1027|   651k|  int best_init_s = search_steps[search_step];
 1028|       |  // adjust ref_mv to make sure it is within MV range
 1029|   651k|  clamp_fullmv(&start_mv, &ms_params->mv_limits);
 1030|   651k|  br = start_mv.row;
 1031|   651k|  bc = start_mv.col;
 1032|   651k|  if (cost_list != NULL) {
  ------------------
  |  Branch (1032:7): [True: 597k, False: 54.0k]
  ------------------
 1033|   597k|    cost_list[0] = cost_list[1] = cost_list[2] = cost_list[3] = cost_list[4] =
 1034|   597k|        INT_MAX;
 1035|   597k|  }
 1036|   651k|  int costlist_has_sad = 0;
 1037|       |
 1038|       |  // Work out the start point for the search
 1039|   651k|  raw_bestsad = get_mvpred_sad(ms_params, src,
 1040|   651k|                               get_buf_from_fullmv(ref, &start_mv), ref_stride);
 1041|   651k|  bestsad = raw_bestsad + mvsad_err_cost_(&start_mv, mv_cost_params);
 1042|       |
 1043|       |  // Search all possible scales up to the search param around the center point
 1044|       |  // pick the scale of the point that is best as the starting scale of
 1045|       |  // further steps around it.
 1046|   651k|  const uint8_t *center_address = get_buf_from_fullmv(ref, &start_mv);
 1047|   651k|  if (do_init_search) {
  ------------------
  |  Branch (1047:7): [True: 53.8k, False: 597k]
  ------------------
 1048|  53.8k|    s = best_init_s;
 1049|  53.8k|    best_init_s = -1;
 1050|   214k|    for (t = 0; t <= s; ++t) {
  ------------------
  |  Branch (1050:17): [True: 160k, False: 53.8k]
  ------------------
 1051|   160k|      int best_site = -1;
 1052|   160k|      FULLPEL_MV center_mv = { br, bc };
 1053|   160k|      if (check_bounds(&ms_params->mv_limits, br, bc, 1 << t)) {
  ------------------
  |  Branch (1053:11): [True: 158k, False: 1.99k]
  ------------------
 1054|       |        // Call 4-point sad for multiples of 4 candidates.
 1055|   158k|        const int no_of_4_cand_loops = num_candidates[t] >> 2;
 1056|   421k|        for (i = 0; i < no_of_4_cand_loops; i++) {
  ------------------
  |  Branch (1056:21): [True: 263k, False: 158k]
  ------------------
 1057|   263k|          calc_sad4_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1058|   263k|                                  center_address, &bestsad, &raw_bestsad, t,
 1059|   263k|                                  &best_site, i * 4, /*cost_list=*/NULL);
 1060|   263k|        }
 1061|       |        // Rest of the candidates
 1062|   158k|        const int remaining_cand = num_candidates[t] % 4;
 1063|   158k|        calc_sad_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1064|   158k|                               center_address, &bestsad, &raw_bestsad, t,
 1065|   158k|                               &best_site, remaining_cand,
 1066|   158k|                               no_of_4_cand_loops * 4, NULL);
 1067|   158k|      } else {
 1068|  1.99k|        calc_sad_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1069|  1.99k|                               center_address, &bestsad, &raw_bestsad, t,
 1070|  1.99k|                               &best_site, num_candidates[t], 0, NULL);
 1071|  1.99k|      }
 1072|   160k|      if (best_site == -1) {
  ------------------
  |  Branch (1072:11): [True: 53.1k, False: 107k]
  ------------------
 1073|  53.1k|        continue;
 1074|   107k|      } else {
 1075|   107k|        best_init_s = t;
 1076|   107k|        k = best_site;
 1077|   107k|      }
 1078|   160k|    }
 1079|  53.8k|    if (best_init_s != -1) {
  ------------------
  |  Branch (1079:9): [True: 48.9k, False: 4.93k]
  ------------------
 1080|  48.9k|      br += search_sites->site[best_init_s][k].mv.row;
 1081|  48.9k|      bc += search_sites->site[best_init_s][k].mv.col;
 1082|  48.9k|      center_address += search_sites->site[best_init_s][k].offset;
 1083|  48.9k|    }
 1084|  53.8k|  }
 1085|       |
 1086|       |  // If the center point is still the best, just skip this and move to
 1087|       |  // the refinement step.
 1088|   651k|  if (best_init_s != -1) {
  ------------------
  |  Branch (1088:7): [True: 646k, False: 4.89k]
  ------------------
 1089|   646k|    const int last_s = (last_is_4 && cost_list != NULL);
  ------------------
  |  Branch (1089:25): [True: 646k, False: 18.4E]
  |  Branch (1089:38): [True: 597k, False: 48.9k]
  ------------------
 1090|   646k|    int best_site = -1;
 1091|   646k|    s = best_init_s;
 1092|       |
 1093|  1.36M|    for (; s >= last_s; s--) {
  ------------------
  |  Branch (1093:12): [True: 715k, False: 646k]
  ------------------
 1094|       |      // No need to search all points the 1st time if initial search was used
 1095|   715k|      if (!do_init_search || s != best_init_s) {
  ------------------
  |  Branch (1095:11): [True: 596k, False: 119k]
  |  Branch (1095:30): [True: 70.2k, False: 48.9k]
  ------------------
 1096|   666k|        FULLPEL_MV center_mv = { br, bc };
 1097|   666k|        if (check_bounds(&ms_params->mv_limits, br, bc, 1 << s)) {
  ------------------
  |  Branch (1097:13): [True: 664k, False: 2.49k]
  ------------------
 1098|       |          // Call 4-point sad for multiples of 4 candidates.
 1099|   664k|          const int no_of_4_cand_loops = num_candidates[s] >> 2;
 1100|  1.95M|          for (i = 0; i < no_of_4_cand_loops; i++) {
  ------------------
  |  Branch (1100:23): [True: 1.28M, False: 664k]
  ------------------
 1101|  1.28M|            calc_sad4_update_bestmv(ms_params, mv_cost_params, best_mv,
 1102|  1.28M|                                    center_mv, center_address, &bestsad,
 1103|  1.28M|                                    &raw_bestsad, s, &best_site, i * 4,
 1104|  1.28M|                                    /*cost_list=*/NULL);
 1105|  1.28M|          }
 1106|       |          // Rest of the candidates
 1107|   664k|          const int remaining_cand = num_candidates[s] % 4;
 1108|   664k|          calc_sad_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1109|   664k|                                 center_address, &bestsad, &raw_bestsad, s,
 1110|   664k|                                 &best_site, remaining_cand,
 1111|   664k|                                 no_of_4_cand_loops * 4, NULL);
 1112|   664k|        } else {
 1113|  2.49k|          calc_sad_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1114|  2.49k|                                 center_address, &bestsad, &raw_bestsad, s,
 1115|  2.49k|                                 &best_site, num_candidates[s], 0, NULL);
 1116|  2.49k|        }
 1117|       |
 1118|   666k|        if (best_site == -1) {
  ------------------
  |  Branch (1118:13): [True: 126k, False: 540k]
  ------------------
 1119|   126k|          continue;
 1120|   540k|        } else {
 1121|   540k|          br += search_sites->site[s][best_site].mv.row;
 1122|   540k|          bc += search_sites->site[s][best_site].mv.col;
 1123|   540k|          center_address += search_sites->site[s][best_site].offset;
 1124|   540k|          k = best_site;
 1125|   540k|        }
 1126|   666k|      }
 1127|       |
 1128|   967k|      do {
 1129|   967k|        int next_chkpts_indices[PATTERN_CANDIDATES_REF];
 1130|   967k|        best_site = -1;
 1131|   967k|        next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1;
  ------------------
  |  Branch (1131:34): [True: 113k, False: 853k]
  ------------------
 1132|   967k|        next_chkpts_indices[1] = k;
 1133|   967k|        next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1;
  ------------------
  |  Branch (1133:34): [True: 157k, False: 810k]
  ------------------
 1134|       |
 1135|   967k|        FULLPEL_MV center_mv = { br, bc };
 1136|   967k|        if (check_bounds(&ms_params->mv_limits, br, bc, 1 << s)) {
  ------------------
  |  Branch (1136:13): [True: 964k, False: 2.54k]
  ------------------
 1137|   964k|          calc_sad3_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1138|   964k|                                  center_address, &bestsad, &raw_bestsad, s,
 1139|   964k|                                  &best_site, next_chkpts_indices, NULL);
 1140|   964k|        } else {
 1141|  2.54k|          calc_sad_update_bestmv_with_indices(
 1142|  2.54k|              ms_params, mv_cost_params, best_mv, center_mv, center_address,
 1143|  2.54k|              &bestsad, &raw_bestsad, s, &best_site, PATTERN_CANDIDATES_REF,
  ------------------
  |  |  392|  2.54k|#define PATTERN_CANDIDATES_REF 3  // number of refinement candidates
  ------------------
 1144|  2.54k|              next_chkpts_indices, NULL);
 1145|  2.54k|        }
 1146|       |
 1147|   967k|        if (best_site != -1) {
  ------------------
  |  Branch (1147:13): [True: 377k, False: 589k]
  ------------------
 1148|   377k|          k = next_chkpts_indices[best_site];
 1149|   377k|          br += search_sites->site[s][k].mv.row;
 1150|   377k|          bc += search_sites->site[s][k].mv.col;
 1151|   377k|          center_address += search_sites->site[s][k].offset;
 1152|   377k|        }
 1153|   967k|      } while (best_site != -1);
  ------------------
  |  Branch (1153:16): [True: 377k, False: 589k]
  ------------------
 1154|   589k|    }
 1155|       |    // Note: If we enter the if below, then cost_list must be non-NULL.
 1156|   646k|    if (s == 0) {
  ------------------
  |  Branch (1156:9): [True: 599k, False: 47.6k]
  ------------------
 1157|   599k|      cost_list[0] = raw_bestsad;
 1158|   599k|      costlist_has_sad = 1;
 1159|   599k|      assert(num_candidates[s] == 4);
 1160|   599k|      if (!do_init_search || s != best_init_s) {
  ------------------
  |  Branch (1160:11): [True: 599k, False: 0]
  |  Branch (1160:30): [True: 0, False: 0]
  ------------------
 1161|   599k|        FULLPEL_MV center_mv = { br, bc };
 1162|   599k|        if (check_bounds(&ms_params->mv_limits, br, bc, 1 << s)) {
  ------------------
  |  Branch (1162:13): [True: 598k, False: 129]
  ------------------
 1163|   598k|          calc_sad4_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1164|   598k|                                  center_address, &bestsad, &raw_bestsad, s,
 1165|   598k|                                  &best_site, 0, cost_list);
 1166|   598k|        } else {
 1167|    129|          calc_sad_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1168|    129|                                 center_address, &bestsad, &raw_bestsad, s,
 1169|    129|                                 &best_site, /*num_candidates=*/4,
 1170|    129|                                 /*cand_start=*/0, cost_list);
 1171|    129|        }
 1172|       |
 1173|   599k|        if (best_site != -1) {
  ------------------
  |  Branch (1173:13): [True: 252k, False: 346k]
  ------------------
 1174|   252k|          br += search_sites->site[s][best_site].mv.row;
 1175|   252k|          bc += search_sites->site[s][best_site].mv.col;
 1176|   252k|          center_address += search_sites->site[s][best_site].offset;
 1177|   252k|          k = best_site;
 1178|   252k|        }
 1179|   599k|      }
 1180|   881k|      while (best_site != -1) {
  ------------------
  |  Branch (1180:14): [True: 282k, False: 599k]
  ------------------
 1181|   282k|        int next_chkpts_indices[PATTERN_CANDIDATES_REF];
 1182|   282k|        best_site = -1;
 1183|   282k|        next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1;
  ------------------
  |  Branch (1183:34): [True: 73.7k, False: 208k]
  ------------------
 1184|   282k|        next_chkpts_indices[1] = k;
 1185|   282k|        next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1;
  ------------------
  |  Branch (1185:34): [True: 71.3k, False: 211k]
  ------------------
 1186|   282k|        cost_list[1] = cost_list[2] = cost_list[3] = cost_list[4] = INT_MAX;
 1187|   282k|        cost_list[((k + 2) % 4) + 1] = cost_list[0];
 1188|   282k|        cost_list[0] = raw_bestsad;
 1189|       |
 1190|   282k|        FULLPEL_MV center_mv = { br, bc };
 1191|   282k|        if (check_bounds(&ms_params->mv_limits, br, bc, 1 << s)) {
  ------------------
  |  Branch (1191:13): [True: 282k, False: 72]
  ------------------
 1192|   282k|          assert(PATTERN_CANDIDATES_REF == 3);
 1193|   282k|          calc_sad3_update_bestmv(ms_params, mv_cost_params, best_mv, center_mv,
 1194|   282k|                                  center_address, &bestsad, &raw_bestsad, s,
 1195|   282k|                                  &best_site, next_chkpts_indices, cost_list);
 1196|   282k|        } else {
 1197|     72|          calc_sad_update_bestmv_with_indices(
 1198|     72|              ms_params, mv_cost_params, best_mv, center_mv, center_address,
 1199|     72|              &bestsad, &raw_bestsad, s, &best_site, PATTERN_CANDIDATES_REF,
  ------------------
  |  |  392|     72|#define PATTERN_CANDIDATES_REF 3  // number of refinement candidates
  ------------------
 1200|     72|              next_chkpts_indices, cost_list);
 1201|     72|        }
 1202|       |
 1203|   282k|        if (best_site != -1) {
  ------------------
  |  Branch (1203:13): [True: 30.1k, False: 252k]
  ------------------
 1204|  30.1k|          k = next_chkpts_indices[best_site];
 1205|  30.1k|          br += search_sites->site[s][k].mv.row;
 1206|  30.1k|          bc += search_sites->site[s][k].mv.col;
 1207|  30.1k|          center_address += search_sites->site[s][k].offset;
 1208|  30.1k|        }
 1209|   282k|      }
 1210|   599k|    }
 1211|   646k|  }
 1212|   651k|  best_mv->row = br;
 1213|   651k|  best_mv->col = bc;
 1214|       |
 1215|   651k|  assert(center_address == get_buf_from_fullmv(ref, best_mv) &&
 1216|   651k|         "center address is out of sync with best_mv!\n");
 1217|       |
 1218|       |  // Returns the one-away integer pel cost/sad around the best as follows:
 1219|       |  // cost_list[0]: cost/sad at the best integer pel
 1220|       |  // cost_list[1]: cost/sad at delta {0, -1} (left)   from the best integer pel
 1221|       |  // cost_list[2]: cost/sad at delta { 1, 0} (bottom) from the best integer pel
 1222|       |  // cost_list[3]: cost/sad at delta { 0, 1} (right)  from the best integer pel
 1223|       |  // cost_list[4]: cost/sad at delta {-1, 0} (top)    from the best integer pel
 1224|   651k|  if (cost_list) {
  ------------------
  |  Branch (1224:7): [True: 599k, False: 52.1k]
  ------------------
 1225|   599k|    if (USE_SAD_COSTLIST) {
  ------------------
  |  |  740|   599k|#define USE_SAD_COSTLIST 1
  |  |  ------------------
  |  |  |  Branch (740:26): [True: 599k, Folded]
  |  |  ------------------
  ------------------
 1226|   599k|      calc_int_sad_list(*best_mv, ms_params, cost_list, costlist_has_sad);
 1227|   599k|    } else {
 1228|      0|      calc_int_cost_list(*best_mv, ms_params, cost_list);
 1229|      0|    }
 1230|   599k|  }
 1231|       |
 1232|   651k|  const int var_cost = get_mvpred_var_cost(ms_params, best_mv, best_mv_stats);
 1233|   651k|  return var_cost;
 1234|   651k|}
mcomp.c:get_mvpred_sad:
  670|  17.1M|                                 const int ref_stride) {
  671|  17.1M|  const uint8_t *src_buf = src->buf;
  672|  17.1M|  const int src_stride = src->stride;
  673|       |
  674|  17.1M|  return ms_params->sdf(src_buf, src_stride, ref_address, ref_stride);
  675|  17.1M|}
mcomp.c:check_bounds:
  637|  2.67M|                               int range) {
  638|  2.67M|  return ((row - range) >= mv_limits->row_min) &
  639|  2.67M|         ((row + range) <= mv_limits->row_max) &
  640|  2.67M|         ((col - range) >= mv_limits->col_min) &
  641|  2.67M|         ((col + range) <= mv_limits->col_max);
  642|  2.67M|}
mcomp.c:calc_sad4_update_bestmv:
  874|  2.14M|    int *best_site, int cand_start, int *cost_list) {
  875|  2.14M|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  876|  2.14M|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  877|  2.14M|  const search_site *site = ms_params->search_sites->site[search_step];
  878|       |
  879|  2.14M|  unsigned char const *block_offset[4];
  880|  2.14M|  unsigned int sads_buf[4];
  881|  2.14M|  unsigned int *sads;
  882|  2.14M|  const uint8_t *src_buf = src->buf;
  883|  2.14M|  const int src_stride = src->stride;
  884|  2.14M|  if (cost_list) {
  ------------------
  |  Branch (884:7): [True: 599k, False: 1.54M]
  ------------------
  885|   599k|    sads = (unsigned int *)(cost_list + 1);
  886|  1.54M|  } else {
  887|  1.54M|    sads = sads_buf;
  888|  1.54M|  }
  889|       |  // Loop over number of candidates.
  890|  10.7M|  for (int j = 0; j < 4; j++)
  ------------------
  |  Branch (890:19): [True: 8.58M, False: 2.14M]
  ------------------
  891|  8.58M|    block_offset[j] = site[cand_start + j].offset + center_address;
  892|       |
  893|       |  // 4-point sad calculation.
  894|  2.14M|  ms_params->sdx4df(src_buf, src_stride, block_offset, ref->stride, sads);
  895|       |
  896|  10.7M|  for (int j = 0; j < 4; j++) {
  ------------------
  |  Branch (896:19): [True: 8.57M, False: 2.14M]
  ------------------
  897|  8.57M|    const FULLPEL_MV this_mv = { center_mv.row + site[cand_start + j].mv.row,
  898|  8.57M|                                 center_mv.col + site[cand_start + j].mv.col };
  899|  8.57M|    const int found_better_mv = update_mvs_and_sad(
  900|  8.57M|        sads[j], &this_mv, mv_cost_params, bestsad, raw_bestsad, best_mv,
  901|  8.57M|        /*second_best_mv=*/NULL);
  902|  8.57M|    if (found_better_mv) *best_site = cand_start + j;
  ------------------
  |  Branch (902:9): [True: 1.48M, False: 7.08M]
  ------------------
  903|  8.57M|  }
  904|  2.14M|}
mcomp.c:update_mvs_and_sad:
  852|  12.3M|                                     FULLPEL_MV *second_best_mv) {
  853|  12.3M|  if (this_sad >= *best_sad) return 0;
  ------------------
  |  Branch (853:7): [True: 8.88M, False: 3.43M]
  ------------------
  854|       |
  855|       |  // Add the motion vector cost.
  856|  3.43M|  const unsigned int sad = this_sad + mvsad_err_cost_(mv, mv_cost_params);
  857|  3.43M|  if (sad < *best_sad) {
  ------------------
  |  Branch (857:7): [True: 1.98M, False: 1.44M]
  ------------------
  858|  1.98M|    if (raw_best_sad) *raw_best_sad = this_sad;
  ------------------
  |  Branch (858:9): [True: 1.98M, False: 0]
  ------------------
  859|  1.98M|    *best_sad = sad;
  860|  1.98M|    if (second_best_mv) *second_best_mv = *best_mv;
  ------------------
  |  Branch (860:9): [True: 0, False: 1.98M]
  ------------------
  861|  1.98M|    *best_mv = *mv;
  862|  1.98M|    return 1;
  863|  1.98M|  }
  864|  1.44M|  return 0;
  865|  3.43M|}
mcomp.c:calc_sad_update_bestmv:
  947|   828k|    int *best_site, const int num_candidates, int cand_start, int *cost_list) {
  948|   828k|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  949|   828k|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  950|   828k|  const search_site *site = ms_params->search_sites->site[search_step];
  951|       |  // Loop over number of candidates.
  952|   864k|  for (int i = cand_start; i < num_candidates; i++) {
  ------------------
  |  Branch (952:28): [True: 35.4k, False: 828k]
  ------------------
  953|  35.4k|    const FULLPEL_MV this_mv = { center_mv.row + site[i].mv.row,
  954|  35.4k|                                 center_mv.col + site[i].mv.col };
  955|  35.4k|    if (!av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) continue;
  ------------------
  |  Branch (955:9): [True: 10.0k, False: 25.4k]
  ------------------
  956|  25.4k|    int thissad = get_mvpred_sad(ms_params, src,
  957|  25.4k|                                 center_address + site[i].offset, ref->stride);
  958|  25.4k|    if (cost_list) {
  ------------------
  |  Branch (958:9): [True: 444, False: 25.0k]
  ------------------
  959|    444|      cost_list[i + 1] = thissad;
  960|    444|    }
  961|  25.4k|    const int found_better_mv = update_mvs_and_sad(
  962|  25.4k|        thissad, &this_mv, mv_cost_params, bestsad, raw_bestsad, best_mv,
  963|  25.4k|        /*second_best_mv=*/NULL);
  964|  25.4k|    if (found_better_mv) *best_site = i;
  ------------------
  |  Branch (964:9): [True: 3.49k, False: 21.9k]
  ------------------
  965|  25.4k|  }
  966|   828k|}
mcomp.c:calc_sad3_update_bestmv:
  911|  1.24M|    const int *chkpts_indices, int *cost_list) {
  912|  1.24M|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  913|  1.24M|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  914|  1.24M|  const search_site *site = ms_params->search_sites->site[search_step];
  915|  1.24M|  unsigned char const *block_offset[4] = {
  916|  1.24M|    center_address + site[chkpts_indices[0]].offset,
  917|  1.24M|    center_address + site[chkpts_indices[1]].offset,
  918|  1.24M|    center_address + site[chkpts_indices[2]].offset,
  919|  1.24M|    center_address,
  920|  1.24M|  };
  921|  1.24M|  unsigned int sads[4];
  922|  1.24M|  ms_params->sdx3df(src->buf, src->stride, block_offset, ref->stride, sads);
  923|  4.98M|  for (int j = 0; j < 3; j++) {
  ------------------
  |  Branch (923:19): [True: 3.73M, False: 1.24M]
  ------------------
  924|  3.73M|    const int index = chkpts_indices[j];
  925|  3.73M|    const FULLPEL_MV this_mv = { center_mv.row + site[index].mv.row,
  926|  3.73M|                                 center_mv.col + site[index].mv.col };
  927|  3.73M|    const int found_better_mv = update_mvs_and_sad(
  928|  3.73M|        sads[j], &this_mv, mv_cost_params, bestsad, raw_bestsad, best_mv,
  929|  3.73M|        /*second_best_mv=*/NULL);
  930|  3.73M|    if (found_better_mv) *best_site = j;
  ------------------
  |  Branch (930:9): [True: 496k, False: 3.23M]
  ------------------
  931|  3.73M|  }
  932|  1.24M|  if (cost_list) {
  ------------------
  |  Branch (932:7): [True: 282k, False: 963k]
  ------------------
  933|  1.13M|    for (int j = 0; j < 3; j++) {
  ------------------
  |  Branch (933:21): [True: 847k, False: 282k]
  ------------------
  934|   847k|      int index = chkpts_indices[j];
  935|   847k|      cost_list[index + 1] = sads[j];
  936|   847k|    }
  937|   282k|  }
  938|  1.24M|}
mcomp.c:calc_sad_update_bestmv_with_indices:
  974|  3.92k|    int *cost_list) {
  975|  3.92k|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  976|  3.92k|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  977|  3.92k|  const search_site *site = ms_params->search_sites->site[search_step];
  978|       |  // Loop over number of candidates.
  979|  15.7k|  for (int i = 0; i < num_candidates; i++) {
  ------------------
  |  Branch (979:19): [True: 11.7k, False: 3.92k]
  ------------------
  980|  11.7k|    int index = chkpts_indices[i];
  981|  11.7k|    const FULLPEL_MV this_mv = { center_mv.row + site[index].mv.row,
  982|  11.7k|                                 center_mv.col + site[index].mv.col };
  983|  11.7k|    if (!av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) {
  ------------------
  |  Branch (983:9): [True: 6.33k, False: 5.45k]
  ------------------
  984|  6.33k|      if (cost_list) {
  ------------------
  |  Branch (984:11): [True: 71, False: 6.26k]
  ------------------
  985|     71|        cost_list[index + 1] = INT_MAX;
  986|     71|      }
  987|  6.33k|      continue;
  988|  6.33k|    }
  989|  5.45k|    const int thissad = get_mvpred_sad(
  990|  5.45k|        ms_params, src, center_address + site[index].offset, ref->stride);
  991|  5.45k|    if (cost_list) {
  ------------------
  |  Branch (991:9): [True: 142, False: 5.30k]
  ------------------
  992|    142|      cost_list[index + 1] = thissad;
  993|    142|    }
  994|  5.45k|    const int found_better_mv = update_mvs_and_sad(
  995|  5.45k|        thissad, &this_mv, mv_cost_params, bestsad, raw_bestsad, best_mv,
  996|  5.45k|        /*second_best_mv=*/NULL);
  997|  5.45k|    if (found_better_mv) *best_site = i;
  ------------------
  |  Branch (997:9): [True: 1.15k, False: 4.29k]
  ------------------
  998|  5.45k|  }
  999|  3.92k|}
mcomp.c:calc_int_sad_list:
  781|   600k|    int *cost_list, int costlist_has_sad) {
  782|   600k|  static const FULLPEL_MV neighbors[4] = {
  783|   600k|    { 0, -1 }, { 1, 0 }, { 0, 1 }, { -1, 0 }
  784|   600k|  };
  785|   600k|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  786|   600k|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  787|   600k|  const int ref_stride = ref->stride;
  788|   600k|  const int br = best_mv.row;
  789|   600k|  const int bc = best_mv.col;
  790|       |
  791|   600k|  assert(av1_is_fullmv_in_range(&ms_params->mv_limits, best_mv));
  792|       |
  793|       |  // Refresh the costlist it does not contain valid sad
  794|   600k|  if (!costlist_has_sad) {
  ------------------
  |  Branch (794:7): [True: 0, False: 600k]
  ------------------
  795|      0|    cost_list[0] = get_mvpred_sad(
  796|      0|        ms_params, src, get_buf_from_fullmv(ref, &best_mv), ref_stride);
  797|       |
  798|      0|    if (check_bounds(&ms_params->mv_limits, br, bc, 1)) {
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|      0|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (799:23): [True: 0, False: 0]
  ------------------
  800|      0|        const FULLPEL_MV this_mv = { br + neighbors[i].row,
  801|      0|                                     bc + neighbors[i].col };
  802|      0|        cost_list[i + 1] = get_mvpred_sad(
  803|      0|            ms_params, src, get_buf_from_fullmv(ref, &this_mv), ref_stride);
  804|      0|      }
  805|      0|    } else {
  806|      0|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (806:23): [True: 0, False: 0]
  ------------------
  807|      0|        const FULLPEL_MV this_mv = { br + neighbors[i].row,
  808|      0|                                     bc + neighbors[i].col };
  809|      0|        if (!av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) {
  ------------------
  |  Branch (809:13): [True: 0, False: 0]
  ------------------
  810|      0|          cost_list[i + 1] = INT_MAX;
  811|      0|        } else {
  812|      0|          cost_list[i + 1] = get_mvpred_sad(
  813|      0|              ms_params, src, get_buf_from_fullmv(ref, &this_mv), ref_stride);
  814|      0|        }
  815|      0|      }
  816|      0|    }
  817|      0|  }
  818|       |
  819|   600k|  const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
  820|   600k|  cost_list[0] += mvsad_err_cost_(&best_mv, mv_cost_params);
  821|       |
  822|  2.99M|  for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (822:21): [True: 2.39M, False: 600k]
  ------------------
  823|  2.39M|    if (cost_list[idx + 1] != INT_MAX) {
  ------------------
  |  Branch (823:9): [True: 2.39M, False: 43]
  ------------------
  824|  2.39M|      const FULLPEL_MV this_mv = { br + neighbors[idx].row,
  825|  2.39M|                                   bc + neighbors[idx].col };
  826|  2.39M|      cost_list[idx + 1] += mvsad_err_cost_(&this_mv, mv_cost_params);
  827|  2.39M|    }
  828|  2.39M|  }
  829|   600k|}
mcomp.c:bigdia_search:
 1260|   651k|                         FULLPEL_MV_STATS *best_mv_stats) {
 1261|   651k|  return pattern_search(start_mv, ms_params, search_step, do_init_search,
 1262|   651k|                        cost_list, best_mv, best_mv_stats);
 1263|   651k|}
mcomp.c:full_pixel_diamond:
 1486|  5.22M|                              FULLPEL_MV *second_best_mv) {
 1487|  5.22M|  const search_site_config *cfg = ms_params->search_sites;
 1488|  5.22M|  int thissme, n, num00 = 0;
 1489|       |
 1490|       |  // Clamp start mv and calculate the cost
 1491|  5.22M|  clamp_fullmv(&start_mv, &ms_params->mv_limits);
 1492|  5.22M|  unsigned int start_mv_sad = get_start_mvpred_sad_cost(ms_params, start_mv);
 1493|       |
 1494|  5.22M|  diamond_search_sad(start_mv, start_mv_sad, ms_params, step_param, &n, best_mv,
 1495|  5.22M|                     second_best_mv);
 1496|       |
 1497|  5.22M|  int bestsme = get_mvpred_compound_var_cost(ms_params, best_mv, best_mv_stats);
 1498|       |
 1499|       |  // If there won't be more n-step search, check to see if refining search is
 1500|       |  // needed.
 1501|  5.22M|  const int further_steps = cfg->num_search_steps - 1 - step_param;
 1502|  14.4M|  while (n < further_steps) {
  ------------------
  |  Branch (1502:10): [True: 9.22M, False: 5.22M]
  ------------------
 1503|  9.22M|    ++n;
 1504|       |
 1505|       |    // TODO(chiyotsai@google.com): There is another bug here where the second
 1506|       |    // best mv gets incorrectly overwritten. Fix it later.
 1507|  9.22M|    FULLPEL_MV tmp_best_mv;
 1508|  9.22M|    FULLPEL_MV_STATS tmp_best_mv_stats;
 1509|  9.22M|    diamond_search_sad(start_mv, start_mv_sad, ms_params, step_param + n,
 1510|  9.22M|                       &num00, &tmp_best_mv, second_best_mv);
 1511|       |
 1512|  9.22M|    thissme = get_mvpred_compound_var_cost(ms_params, &tmp_best_mv,
 1513|  9.22M|                                           &tmp_best_mv_stats);
 1514|       |
 1515|  9.22M|    if (thissme < bestsme) {
  ------------------
  |  Branch (1515:9): [True: 1.96M, False: 7.25M]
  ------------------
 1516|  1.96M|      bestsme = thissme;
 1517|  1.96M|      *best_mv = tmp_best_mv;
 1518|  1.96M|      *best_mv_stats = tmp_best_mv_stats;
 1519|  1.96M|    }
 1520|       |
 1521|  9.22M|    if (num00) {
  ------------------
  |  Branch (1521:9): [True: 845k, False: 8.38M]
  ------------------
 1522|       |      // Advance the loop by num00 steps
 1523|   845k|      n += num00;
 1524|   845k|      num00 = 0;
 1525|   845k|    }
 1526|  9.22M|  }
 1527|       |
 1528|       |  // Return cost list.
 1529|  5.22M|  if (cost_list) {
  ------------------
  |  Branch (1529:7): [True: 0, False: 5.22M]
  ------------------
 1530|      0|    if (USE_SAD_COSTLIST) {
  ------------------
  |  |  740|      0|#define USE_SAD_COSTLIST 1
  |  |  ------------------
  |  |  |  Branch (740:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1531|      0|      const int costlist_has_sad = 0;
 1532|      0|      calc_int_sad_list(*best_mv, ms_params, cost_list, costlist_has_sad);
 1533|      0|    } else {
 1534|      0|      calc_int_cost_list(*best_mv, ms_params, cost_list);
 1535|      0|    }
 1536|      0|  }
 1537|  5.22M|  return bestsme;
 1538|  5.22M|}
mcomp.c:get_start_mvpred_sad_cost:
 1464|  5.22M|    const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, FULLPEL_MV start_mv) {
 1465|  5.22M|  const struct buf_2d *const src = ms_params->ms_buffers.src;
 1466|  5.22M|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
 1467|  5.22M|  const uint8_t *best_address = get_buf_from_fullmv(ref, &start_mv);
 1468|       |
 1469|  5.22M|  unsigned int start_mv_sad =
 1470|  5.22M|      mvsad_err_cost_(&start_mv, &ms_params->mv_cost_params);
 1471|       |
 1472|  5.22M|  if (ms_params->ms_buffers.second_pred)
  ------------------
  |  Branch (1472:7): [True: 0, False: 5.22M]
  ------------------
 1473|      0|    start_mv_sad +=
 1474|      0|        get_mvpred_compound_sad(ms_params, src, best_address, ref->stride);
 1475|  5.22M|  else
 1476|  5.22M|    start_mv_sad += get_mvpred_sad(ms_params, src, best_address, ref->stride);
 1477|       |
 1478|  5.22M|  return start_mv_sad;
 1479|  5.22M|}
mcomp.c:diamond_search_sad:
 1314|  14.4M|                              FULLPEL_MV *best_mv, FULLPEL_MV *second_best_mv) {
 1315|  14.4M|#define UPDATE_SEARCH_STEP                                      \
 1316|  14.4M|  do {                                                          \
 1317|  14.4M|    if (best_site != 0) {                                       \
 1318|  14.4M|      tmp_second_best_mv = *best_mv;                            \
 1319|  14.4M|      best_mv->row += site[best_site].mv.row;                   \
 1320|  14.4M|      best_mv->col += site[best_site].mv.col;                   \
 1321|  14.4M|      best_address += site[best_site].offset;                   \
 1322|  14.4M|      is_off_center = 1;                                        \
 1323|  14.4M|    }                                                           \
 1324|  14.4M|                                                                \
 1325|  14.4M|    if (is_off_center == 0) num_center_steps++;                 \
 1326|  14.4M|                                                                \
 1327|  14.4M|    if (best_site == 0 && step > 2) {                           \
 1328|  14.4M|      int next_step_size = cfg->radius[step - 1];               \
 1329|  14.4M|      while (next_step_size == cfg->radius[step] && step > 2) { \
 1330|  14.4M|        num_center_steps++;                                     \
 1331|  14.4M|        --step;                                                 \
 1332|  14.4M|        next_step_size = cfg->radius[step - 1];                 \
 1333|  14.4M|      }                                                         \
 1334|  14.4M|    }                                                           \
 1335|  14.4M|  } while (0)
 1336|       |
 1337|  14.4M|  const struct buf_2d *const src = ms_params->ms_buffers.src;
 1338|  14.4M|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
 1339|       |
 1340|  14.4M|  const uint8_t *src_buf = src->buf;
 1341|  14.4M|  const int src_stride = src->stride;
 1342|  14.4M|  const int ref_stride = ref->stride;
 1343|       |
 1344|  14.4M|  const MV_COST_PARAMS *mv_cost_params = &ms_params->mv_cost_params;
 1345|       |
 1346|  14.4M|  const search_site_config *cfg = ms_params->search_sites;
 1347|       |
 1348|  14.4M|  int is_off_center = 0;
 1349|       |  // Number of times that we have stayed in the middle. This is used to skip
 1350|       |  // search steps in the future if diamond_search_sad is called again.
 1351|  14.4M|  int num_center_steps = 0;
 1352|       |
 1353|       |  // search_step determines the length of the initial step and hence the number
 1354|       |  // of iterations.
 1355|  14.4M|  const int tot_steps = cfg->num_search_steps - search_step;
 1356|  14.4M|  FULLPEL_MV tmp_second_best_mv;
 1357|  14.4M|  if (second_best_mv) {
  ------------------
  |  Branch (1357:7): [True: 8.64M, False: 5.78M]
  ------------------
 1358|  8.64M|    tmp_second_best_mv = *second_best_mv;
 1359|  8.64M|  }
 1360|       |
 1361|  14.4M|  *best_mv = start_mv;
 1362|       |
 1363|       |  // Check the starting position
 1364|  14.4M|  const uint8_t *best_address = get_buf_from_fullmv(ref, &start_mv);
 1365|  14.4M|  unsigned int bestsad = start_mv_sad;
 1366|       |
 1367|       |  // TODO(chiyotsai@google.com): Implement 4 points search for msdf&sdaf
 1368|  14.4M|  if (ms_params->ms_buffers.second_pred) {
  ------------------
  |  Branch (1368:7): [True: 0, False: 14.4M]
  ------------------
 1369|      0|    for (int step = tot_steps - 1; step >= 0; --step) {
  ------------------
  |  Branch (1369:36): [True: 0, False: 0]
  ------------------
 1370|      0|      const search_site *site = cfg->site[step];
 1371|      0|      const int num_searches = cfg->searches_per_step[step];
 1372|      0|      int best_site = 0;
 1373|       |
 1374|      0|      for (int idx = 1; idx <= num_searches; idx++) {
  ------------------
  |  Branch (1374:25): [True: 0, False: 0]
  ------------------
 1375|      0|        const FULLPEL_MV this_mv = { best_mv->row + site[idx].mv.row,
 1376|      0|                                     best_mv->col + site[idx].mv.col };
 1377|       |
 1378|      0|        if (av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) {
  ------------------
  |  Branch (1378:13): [True: 0, False: 0]
  ------------------
 1379|      0|          const uint8_t *const check_here = site[idx].offset + best_address;
 1380|      0|          unsigned int thissad =
 1381|      0|              get_mvpred_compound_sad(ms_params, src, check_here, ref_stride);
 1382|       |
 1383|      0|          if (thissad < bestsad) {
  ------------------
  |  Branch (1383:15): [True: 0, False: 0]
  ------------------
 1384|      0|            thissad += mvsad_err_cost_(&this_mv, mv_cost_params);
 1385|      0|            if (thissad < bestsad) {
  ------------------
  |  Branch (1385:17): [True: 0, False: 0]
  ------------------
 1386|      0|              bestsad = thissad;
 1387|      0|              best_site = idx;
 1388|      0|            }
 1389|      0|          }
 1390|      0|        }
 1391|      0|      }
 1392|      0|      UPDATE_SEARCH_STEP;
  ------------------
  |  | 1316|      0|  do {                                                          \
  |  | 1317|      0|    if (best_site != 0) {                                       \
  |  |  ------------------
  |  |  |  Branch (1317:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1318|      0|      tmp_second_best_mv = *best_mv;                            \
  |  | 1319|      0|      best_mv->row += site[best_site].mv.row;                   \
  |  | 1320|      0|      best_mv->col += site[best_site].mv.col;                   \
  |  | 1321|      0|      best_address += site[best_site].offset;                   \
  |  | 1322|      0|      is_off_center = 1;                                        \
  |  | 1323|      0|    }                                                           \
  |  | 1324|      0|                                                                \
  |  | 1325|      0|    if (is_off_center == 0) num_center_steps++;                 \
  |  |  ------------------
  |  |  |  Branch (1325:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1326|      0|                                                                \
  |  | 1327|      0|    if (best_site == 0 && step > 2) {                           \
  |  |  ------------------
  |  |  |  Branch (1327:9): [True: 0, False: 0]
  |  |  |  Branch (1327:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1328|      0|      int next_step_size = cfg->radius[step - 1];               \
  |  | 1329|      0|      while (next_step_size == cfg->radius[step] && step > 2) { \
  |  |  ------------------
  |  |  |  Branch (1329:14): [True: 0, False: 0]
  |  |  |  Branch (1329:53): [True: 0, False: 0]
  |  |  ------------------
  |  | 1330|      0|        num_center_steps++;                                     \
  |  | 1331|      0|        --step;                                                 \
  |  | 1332|      0|        next_step_size = cfg->radius[step - 1];                 \
  |  | 1333|      0|      }                                                         \
  |  | 1334|      0|    }                                                           \
  |  | 1335|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1335:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1393|      0|    }
 1394|  14.4M|  } else {
 1395|  56.9M|    for (int step = tot_steps - 1; step >= 0; --step) {
  ------------------
  |  Branch (1395:36): [True: 42.5M, False: 14.4M]
  ------------------
 1396|  42.5M|      const search_site *site = cfg->site[step];
 1397|  42.5M|      const int num_searches = cfg->searches_per_step[step];
 1398|  42.5M|      int best_site = 0;
 1399|       |
 1400|  42.5M|      int all_in = 1;
 1401|       |      // Trap illegal vectors
 1402|  42.5M|      all_in &= best_mv->row + site[1].mv.row >= ms_params->mv_limits.row_min;
 1403|  42.5M|      all_in &= best_mv->row + site[2].mv.row <= ms_params->mv_limits.row_max;
 1404|  42.5M|      all_in &= best_mv->col + site[3].mv.col >= ms_params->mv_limits.col_min;
 1405|  42.5M|      all_in &= best_mv->col + site[4].mv.col <= ms_params->mv_limits.col_max;
 1406|       |
 1407|  42.5M|      if (all_in) {
  ------------------
  |  Branch (1407:11): [True: 38.9M, False: 3.62M]
  ------------------
 1408|   116M|        for (int idx = 1; idx <= num_searches; idx += 4) {
  ------------------
  |  Branch (1408:27): [True: 77.6M, False: 38.9M]
  ------------------
 1409|  77.6M|          unsigned char const *block_offset[4];
 1410|  77.6M|          unsigned int sads[4];
 1411|       |
 1412|  77.6M|          block_offset[0] = site[idx + 0].offset + best_address;
 1413|  77.6M|          block_offset[1] = site[idx + 1].offset + best_address;
 1414|  77.6M|          block_offset[2] = site[idx + 2].offset + best_address;
 1415|  77.6M|          block_offset[3] = site[idx + 3].offset + best_address;
 1416|       |
 1417|  77.6M|          ms_params->sdx4df(src_buf, src_stride, block_offset, ref_stride,
 1418|  77.6M|                            sads);
 1419|       |
 1420|  77.6M|          update_best_site(sads[0], best_mv, site, idx + 0, mv_cost_params,
 1421|  77.6M|                           &bestsad, &best_site);
 1422|  77.6M|          update_best_site(sads[1], best_mv, site, idx + 1, mv_cost_params,
 1423|  77.6M|                           &bestsad, &best_site);
 1424|  77.6M|          update_best_site(sads[2], best_mv, site, idx + 2, mv_cost_params,
 1425|  77.6M|                           &bestsad, &best_site);
 1426|  77.6M|          update_best_site(sads[3], best_mv, site, idx + 3, mv_cost_params,
 1427|  77.6M|                           &bestsad, &best_site);
 1428|  77.6M|        }
 1429|  38.9M|      } else {
 1430|  32.9M|        for (int idx = 1; idx <= num_searches; idx++) {
  ------------------
  |  Branch (1430:27): [True: 29.3M, False: 3.62M]
  ------------------
 1431|  29.3M|          const FULLPEL_MV this_mv = { best_mv->row + site[idx].mv.row,
 1432|  29.3M|                                       best_mv->col + site[idx].mv.col };
 1433|       |
 1434|  29.3M|          if (av1_is_fullmv_in_range(&ms_params->mv_limits, this_mv)) {
  ------------------
  |  Branch (1434:15): [True: 11.2M, False: 18.0M]
  ------------------
 1435|  11.2M|            const uint8_t *const check_here = site[idx].offset + best_address;
 1436|  11.2M|            unsigned int thissad =
 1437|  11.2M|                get_mvpred_sad(ms_params, src, check_here, ref_stride);
 1438|       |
 1439|  11.2M|            if (thissad < bestsad) {
  ------------------
  |  Branch (1439:17): [True: 4.62M, False: 6.63M]
  ------------------
 1440|  4.62M|              thissad += mvsad_err_cost_(&this_mv, mv_cost_params);
 1441|  4.62M|              if (thissad < bestsad) {
  ------------------
  |  Branch (1441:19): [True: 2.33M, False: 2.29M]
  ------------------
 1442|  2.33M|                bestsad = thissad;
 1443|  2.33M|                best_site = idx;
 1444|  2.33M|              }
 1445|  4.62M|            }
 1446|  11.2M|          }
 1447|  29.3M|        }
 1448|  3.62M|      }
 1449|  42.5M|      UPDATE_SEARCH_STEP;
  ------------------
  |  | 1316|  42.5M|  do {                                                          \
  |  | 1317|  42.5M|    if (best_site != 0) {                                       \
  |  |  ------------------
  |  |  |  Branch (1317:9): [True: 23.8M, False: 18.6M]
  |  |  ------------------
  |  | 1318|  23.8M|      tmp_second_best_mv = *best_mv;                            \
  |  | 1319|  23.8M|      best_mv->row += site[best_site].mv.row;                   \
  |  | 1320|  23.8M|      best_mv->col += site[best_site].mv.col;                   \
  |  | 1321|  23.8M|      best_address += site[best_site].offset;                   \
  |  | 1322|  23.8M|      is_off_center = 1;                                        \
  |  | 1323|  23.8M|    }                                                           \
  |  | 1324|  42.5M|                                                                \
  |  | 1325|  42.5M|    if (is_off_center == 0) num_center_steps++;                 \
  |  |  ------------------
  |  |  |  Branch (1325:9): [True: 7.46M, False: 35.0M]
  |  |  ------------------
  |  | 1326|  42.5M|                                                                \
  |  | 1327|  42.5M|    if (best_site == 0 && step > 2) {                           \
  |  |  ------------------
  |  |  |  Branch (1327:9): [True: 18.7M, False: 23.7M]
  |  |  |  Branch (1327:27): [True: 4.47M, False: 14.3M]
  |  |  ------------------
  |  | 1328|  4.47M|      int next_step_size = cfg->radius[step - 1];               \
  |  | 1329|  4.47M|      while (next_step_size == cfg->radius[step] && step > 2) { \
  |  |  ------------------
  |  |  |  Branch (1329:14): [True: 0, False: 4.47M]
  |  |  |  Branch (1329:53): [True: 0, False: 0]
  |  |  ------------------
  |  | 1330|      0|        num_center_steps++;                                     \
  |  | 1331|      0|        --step;                                                 \
  |  | 1332|      0|        next_step_size = cfg->radius[step - 1];                 \
  |  | 1333|      0|      }                                                         \
  |  | 1334|  4.47M|    }                                                           \
  |  | 1335|  42.5M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1335:12): [Folded, False: 42.5M]
  |  |  ------------------
  ------------------
 1450|  42.5M|    }
 1451|  14.4M|  }
 1452|       |
 1453|  14.4M|  *num00 = num_center_steps;
 1454|  14.4M|  if (second_best_mv) {
  ------------------
  |  Branch (1454:7): [True: 8.64M, False: 5.79M]
  ------------------
 1455|  8.64M|    *second_best_mv = tmp_second_best_mv;
 1456|  8.64M|  }
 1457|       |
 1458|  14.4M|  return bestsad;
 1459|       |
 1460|  14.4M|#undef UPDATE_SEARCH_STEP
 1461|  14.4M|}
mcomp.c:update_best_site:
 1298|   310M|                                    unsigned int *bestsad, int *best_site) {
 1299|   310M|  if (sad < *bestsad) {
  ------------------
  |  Branch (1299:7): [True: 107M, False: 202M]
  ------------------
 1300|   107M|    const FULLPEL_MV this_mv = { best_mv->row + site[idx].mv.row,
 1301|   107M|                                 best_mv->col + site[idx].mv.col };
 1302|   107M|    const unsigned int thissad =
 1303|   107M|        sad + mvsad_err_cost_(&this_mv, mv_cost_params);
 1304|   107M|    if (thissad < *bestsad) {
  ------------------
  |  Branch (1304:9): [True: 34.2M, False: 73.5M]
  ------------------
 1305|  34.2M|      *bestsad = thissad;
 1306|  34.2M|      *best_site = idx;
 1307|  34.2M|    }
 1308|   107M|  }
 1309|   310M|}
mcomp.c:get_mvpred_compound_var_cost:
  679|  14.4M|    FULLPEL_MV_STATS *mv_stats) {
  680|  14.4M|  const aom_variance_fn_ptr_t *vfp = ms_params->vfp;
  681|  14.4M|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  682|  14.4M|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  683|  14.4M|  const uint8_t *src_buf = src->buf;
  684|  14.4M|  const int src_stride = src->stride;
  685|  14.4M|  const int ref_stride = ref->stride;
  686|       |
  687|  14.4M|  const uint8_t *mask = ms_params->ms_buffers.mask;
  688|  14.4M|  const uint8_t *second_pred = ms_params->ms_buffers.second_pred;
  689|  14.4M|  const int mask_stride = ms_params->ms_buffers.mask_stride;
  690|  14.4M|  const int invert_mask = ms_params->ms_buffers.inv_mask;
  691|  14.4M|  int bestsme;
  692|       |
  693|  14.4M|  if (mask) {
  ------------------
  |  Branch (693:7): [True: 0, False: 14.4M]
  ------------------
  694|      0|    bestsme = vfp->msvf(get_buf_from_fullmv(ref, this_mv), ref_stride, 0, 0,
  695|      0|                        src_buf, src_stride, second_pred, mask, mask_stride,
  696|      0|                        invert_mask, &mv_stats->sse);
  697|  14.4M|  } else if (second_pred) {
  ------------------
  |  Branch (697:14): [True: 0, False: 14.4M]
  ------------------
  698|      0|    bestsme = vfp->svaf(get_buf_from_fullmv(ref, this_mv), ref_stride, 0, 0,
  699|      0|                        src_buf, src_stride, &mv_stats->sse, second_pred);
  700|  14.4M|  } else {
  701|  14.4M|    bestsme = vfp->vf(src_buf, src_stride, get_buf_from_fullmv(ref, this_mv),
  702|  14.4M|                      ref_stride, &mv_stats->sse);
  703|  14.4M|  }
  704|  14.4M|  mv_stats->distortion = bestsme;
  705|       |
  706|  14.4M|  const MV sub_this_mv = get_mv_from_fullmv(this_mv);
  707|  14.4M|  mv_stats->err_cost = mv_err_cost_(&sub_this_mv, &ms_params->mv_cost_params);
  708|  14.4M|  bestsme += mv_stats->err_cost;
  709|       |
  710|  14.4M|  return bestsme;
  711|  14.4M|}
mcomp.c:get_mvpred_var_cost:
  646|   653k|    FULLPEL_MV_STATS *mv_stats) {
  647|   653k|  const aom_variance_fn_ptr_t *vfp = ms_params->vfp;
  648|   653k|  const MV sub_this_mv = get_mv_from_fullmv(this_mv);
  649|   653k|  const struct buf_2d *const src = ms_params->ms_buffers.src;
  650|   653k|  const struct buf_2d *const ref = ms_params->ms_buffers.ref;
  651|   653k|  const uint8_t *src_buf = src->buf;
  652|   653k|  const int src_stride = src->stride;
  653|   653k|  const int ref_stride = ref->stride;
  654|       |
  655|   653k|  int bestsme;
  656|       |
  657|   653k|  bestsme = vfp->vf(src_buf, src_stride, get_buf_from_fullmv(ref, this_mv),
  658|   653k|                    ref_stride, &mv_stats->sse);
  659|   653k|  mv_stats->distortion = bestsme;
  660|       |
  661|   653k|  mv_stats->err_cost = mv_err_cost_(&sub_this_mv, &ms_params->mv_cost_params);
  662|   653k|  bestsme += mv_stats->err_cost;
  663|       |
  664|   653k|  return bestsme;
  665|   653k|}
mcomp.c:setup_center_error_facade:
 3016|  3.40M|    int is_scaled) {
 3017|  3.40M|  if (is_scaled) {
  ------------------
  |  Branch (3017:7): [True: 3.20M, False: 202k]
  ------------------
 3018|  3.20M|    return upsampled_setup_center_error(xd, cm, bestmv, var_params,
 3019|  3.20M|                                        mv_cost_params, sse1, distortion);
 3020|  3.20M|  } else {
 3021|   202k|    return setup_center_error(xd, bestmv, var_params, mv_cost_params, sse1,
 3022|   202k|                              distortion);
 3023|   202k|  }
 3024|  3.40M|}
mcomp.c:check_repeated_mv_and_update:
 3001|  9.96M|                                               const MV current_mv, int iter) {
 3002|  9.96M|  if (last_mv_search_list) {
  ------------------
  |  Branch (3002:7): [True: 8.76M, False: 1.19M]
  ------------------
 3003|  8.76M|    if (CHECK_MV_EQUAL(last_mv_search_list[iter].as_mv, current_mv)) {
  ------------------
  |  |   35|  8.76M|#define CHECK_MV_EQUAL(x, y) (((x).row == (y).row) && ((x).col == (y).col))
  |  |  ------------------
  |  |  |  Branch (35:31): [True: 580k, False: 8.18M]
  |  |  |  Branch (35:55): [True: 39.2k, False: 540k]
  |  |  ------------------
  ------------------
 3004|  39.2k|      return 1;
 3005|  39.2k|    }
 3006|       |
 3007|  8.72M|    last_mv_search_list[iter].as_mv = current_mv;
 3008|  8.72M|  }
 3009|  9.92M|  return 0;
 3010|  9.96M|}
mcomp.c:is_cost_list_wellbehaved:
 2976|    925|static inline int is_cost_list_wellbehaved(const int *cost_list) {
 2977|    925|  return cost_list[0] < cost_list[1] && cost_list[0] < cost_list[2] &&
  ------------------
  |  Branch (2977:10): [True: 910, False: 15]
  |  Branch (2977:41): [True: 901, False: 9]
  ------------------
 2978|    901|         cost_list[0] < cost_list[3] && cost_list[0] < cost_list[4];
  ------------------
  |  Branch (2978:10): [True: 886, False: 15]
  |  Branch (2978:41): [True: 877, False: 9]
  ------------------
 2979|    925|}
mcomp.c:get_cost_surf_min:
 2990|    877|                                     int bits) {
 2991|    877|  *ic = divide_and_round((cost_list[1] - cost_list[3]) * (1 << (bits - 1)),
 2992|    877|                         (cost_list[1] - 2 * cost_list[0] + cost_list[3]));
 2993|    877|  *ir = divide_and_round((cost_list[4] - cost_list[2]) * (1 << (bits - 1)),
 2994|    877|                         (cost_list[4] - 2 * cost_list[0] + cost_list[2]));
 2995|    877|}
mcomp.c:divide_and_round:
 2972|  1.75k|static inline int divide_and_round(int n, int d) {
 2973|  1.75k|  return ((n < 0) ^ (d < 0)) ? ((n - d / 2) / d) : ((n + d / 2) / d);
  ------------------
  |  Branch (2973:10): [True: 406, False: 1.34k]
  ------------------
 2974|  1.75k|}
mcomp.c:check_better_fast:
 2619|  48.1M|    unsigned int *sse1, int *distortion, int *has_better_mv, int is_scaled) {
 2620|  48.1M|  unsigned int cost;
 2621|  48.4M|  if (av1_is_subpelmv_in_range(mv_limits, *this_mv)) {
  ------------------
  |  Branch (2621:7): [True: 48.4M, False: 18.4E]
  ------------------
 2622|  48.4M|    unsigned int sse;
 2623|  48.4M|    int thismse;
 2624|  48.4M|    if (is_scaled) {
  ------------------
  |  Branch (2624:9): [True: 38.4M, False: 9.97M]
  ------------------
 2625|  38.4M|      thismse = upsampled_pref_error(xd, cm, this_mv, var_params, &sse);
 2626|  38.4M|    } else {
 2627|  9.97M|      thismse = estimated_pref_error(this_mv, var_params, &sse);
 2628|  9.97M|    }
 2629|  48.4M|    cost = mv_err_cost_(this_mv, mv_cost_params);
 2630|  48.4M|    cost += thismse;
 2631|       |
 2632|  48.4M|    if (cost < *besterr) {
  ------------------
  |  Branch (2632:9): [True: 12.4M, False: 35.9M]
  ------------------
 2633|  12.4M|      *besterr = cost;
 2634|  12.4M|      *best_mv = *this_mv;
 2635|  12.4M|      *distortion = thismse;
 2636|  12.4M|      *sse1 = sse;
 2637|  12.4M|      *has_better_mv |= 1;
 2638|  12.4M|    }
 2639|  18.4E|  } else {
 2640|       |    cost = INT_MAX;
 2641|  18.4E|  }
 2642|  48.1M|  return cost;
 2643|  48.1M|}
mcomp.c:upsampled_pref_error:
 2524|  41.5M|                                unsigned int *sse) {
 2525|  41.5M|  const aom_variance_fn_ptr_t *vfp = var_params->vfp;
 2526|  41.5M|  const SUBPEL_SEARCH_TYPE subpel_search_type = var_params->subpel_search_type;
 2527|       |
 2528|  41.5M|  const MSBuffers *ms_buffers = &var_params->ms_buffers;
 2529|  41.5M|  const uint8_t *src = ms_buffers->src->buf;
 2530|  41.5M|  const uint8_t *ref = get_buf_from_mv(ms_buffers->ref, *this_mv);
 2531|  41.5M|  const int src_stride = ms_buffers->src->stride;
 2532|  41.5M|  const int ref_stride = ms_buffers->ref->stride;
 2533|  41.5M|  const uint8_t *second_pred = ms_buffers->second_pred;
 2534|  41.5M|  const uint8_t *mask = ms_buffers->mask;
 2535|  41.5M|  const int mask_stride = ms_buffers->mask_stride;
 2536|  41.5M|  const int invert_mask = ms_buffers->inv_mask;
 2537|  41.5M|  const int w = var_params->w;
 2538|  41.5M|  const int h = var_params->h;
 2539|       |
 2540|  41.5M|  const int mi_row = xd->mi_row;
 2541|  41.5M|  const int mi_col = xd->mi_col;
 2542|  41.5M|  const int subpel_x_q3 = get_subpel_part(this_mv->col);
 2543|  41.5M|  const int subpel_y_q3 = get_subpel_part(this_mv->row);
 2544|       |
 2545|  41.5M|  unsigned int besterr;
 2546|  41.5M|#if CONFIG_AV1_HIGHBITDEPTH
 2547|  41.5M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (2547:7): [True: 12.8M, False: 28.7M]
  ------------------
 2548|  12.8M|    uint16_t *pred16 = (uint16_t *)(xd->tmp_upsample_pred);
 2549|  12.8M|    uint8_t *pred8 = CONVERT_TO_BYTEPTR(pred16);
  ------------------
  |  |   80|  12.8M|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 2550|  12.8M|    if (second_pred != NULL) {
  ------------------
  |  Branch (2550:9): [True: 0, False: 12.8M]
  ------------------
 2551|      0|      if (mask) {
  ------------------
  |  Branch (2551:11): [True: 0, False: 0]
  ------------------
 2552|      0|        aom_highbd_comp_mask_upsampled_pred(
 2553|      0|            xd, cm, mi_row, mi_col, this_mv, pred8, second_pred, w, h,
 2554|      0|            subpel_x_q3, subpel_y_q3, ref, ref_stride, mask, mask_stride,
 2555|      0|            invert_mask, xd->bd, subpel_search_type);
 2556|      0|      } else {
 2557|      0|        aom_highbd_comp_avg_upsampled_pred(
  ------------------
  |  |  106|      0|#define aom_highbd_comp_avg_upsampled_pred aom_highbd_comp_avg_upsampled_pred_sse2
  ------------------
 2558|      0|            xd, cm, mi_row, mi_col, this_mv, pred8, second_pred, w, h,
 2559|      0|            subpel_x_q3, subpel_y_q3, ref, ref_stride, xd->bd,
 2560|      0|            subpel_search_type);
 2561|      0|      }
 2562|  12.8M|    } else {
 2563|  12.8M|      aom_highbd_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred8, w, h,
  ------------------
  |  |  114|  12.8M|#define aom_highbd_upsampled_pred aom_highbd_upsampled_pred_sse2
  ------------------
 2564|  12.8M|                                subpel_x_q3, subpel_y_q3, ref, ref_stride,
 2565|  12.8M|                                xd->bd, subpel_search_type);
 2566|  12.8M|    }
 2567|  12.8M|    besterr = vfp->vf(pred8, w, src, src_stride, sse);
 2568|  28.7M|  } else {
 2569|  28.7M|    uint8_t *pred = xd->tmp_upsample_pred;
 2570|  28.7M|    if (second_pred != NULL) {
  ------------------
  |  Branch (2570:9): [True: 0, False: 28.7M]
  ------------------
 2571|      0|      if (mask) {
  ------------------
  |  Branch (2571:11): [True: 0, False: 0]
  ------------------
 2572|      0|        aom_comp_mask_upsampled_pred(
 2573|      0|            xd, cm, mi_row, mi_col, this_mv, pred, second_pred, w, h,
 2574|      0|            subpel_x_q3, subpel_y_q3, ref, ref_stride, mask, mask_stride,
 2575|      0|            invert_mask, subpel_search_type);
 2576|      0|      } else {
 2577|      0|        aom_comp_avg_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred,
  ------------------
  |  |   98|      0|#define aom_comp_avg_upsampled_pred aom_comp_avg_upsampled_pred_sse2
  ------------------
 2578|      0|                                    second_pred, w, h, subpel_x_q3, subpel_y_q3,
 2579|      0|                                    ref, ref_stride, subpel_search_type);
 2580|      0|      }
 2581|  28.7M|    } else {
 2582|  28.7M|      aom_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred, w, h,
  ------------------
  |  |  125|  28.7M|#define aom_upsampled_pred aom_upsampled_pred_sse2
  ------------------
 2583|  28.7M|                         subpel_x_q3, subpel_y_q3, ref, ref_stride,
 2584|  28.7M|                         subpel_search_type);
 2585|  28.7M|    }
 2586|       |
 2587|  28.7M|    besterr = vfp->vf(pred, w, src, src_stride, sse);
 2588|  28.7M|  }
 2589|       |#else
 2590|       |  uint8_t *pred = xd->tmp_upsample_pred;
 2591|       |  if (second_pred != NULL) {
 2592|       |    if (mask) {
 2593|       |      aom_comp_mask_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred,
 2594|       |                                   second_pred, w, h, subpel_x_q3, subpel_y_q3,
 2595|       |                                   ref, ref_stride, mask, mask_stride,
 2596|       |                                   invert_mask, subpel_search_type);
 2597|       |    } else {
 2598|       |      aom_comp_avg_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred,
 2599|       |                                  second_pred, w, h, subpel_x_q3, subpel_y_q3,
 2600|       |                                  ref, ref_stride, subpel_search_type);
 2601|       |    }
 2602|       |  } else {
 2603|       |    aom_upsampled_pred(xd, cm, mi_row, mi_col, this_mv, pred, w, h, subpel_x_q3,
 2604|       |                       subpel_y_q3, ref, ref_stride, subpel_search_type);
 2605|       |  }
 2606|       |
 2607|       |  besterr = vfp->vf(pred, w, src, src_stride, sse);
 2608|       |#endif
 2609|  41.5M|  return besterr;
 2610|  41.5M|}
mcomp.c:get_buf_from_mv:
 2483|  51.7M|                                             const MV mv) {
 2484|  51.7M|  const int offset = (mv.row >> 3) * buf->stride + (mv.col >> 3);
 2485|  51.7M|  return &buf->buf[offset];
 2486|  51.7M|}
mcomp.c:get_subpel_part:
 2478|   103M|static inline int get_subpel_part(int x) { return x & 7; }
mcomp.c:estimated_pref_error:
 2492|  9.97M|    unsigned int *sse) {
 2493|  9.97M|  const aom_variance_fn_ptr_t *vfp = var_params->vfp;
 2494|       |
 2495|  9.97M|  const MSBuffers *ms_buffers = &var_params->ms_buffers;
 2496|  9.97M|  const uint8_t *src = ms_buffers->src->buf;
 2497|  9.97M|  const uint8_t *ref = get_buf_from_mv(ms_buffers->ref, *this_mv);
 2498|  9.97M|  const int src_stride = ms_buffers->src->stride;
 2499|  9.97M|  const int ref_stride = ms_buffers->ref->stride;
 2500|  9.97M|  const uint8_t *second_pred = ms_buffers->second_pred;
 2501|  9.97M|  const uint8_t *mask = ms_buffers->mask;
 2502|  9.97M|  const int mask_stride = ms_buffers->mask_stride;
 2503|  9.97M|  const int invert_mask = ms_buffers->inv_mask;
 2504|       |
 2505|  9.97M|  const int subpel_x_q3 = get_subpel_part(this_mv->col);
 2506|  9.97M|  const int subpel_y_q3 = get_subpel_part(this_mv->row);
 2507|       |
 2508|  9.97M|  if (second_pred == NULL) {
  ------------------
  |  Branch (2508:7): [True: 9.97M, False: 18.4E]
  ------------------
 2509|  9.97M|    return vfp->svf(ref, ref_stride, subpel_x_q3, subpel_y_q3, src, src_stride,
 2510|  9.97M|                    sse);
 2511|  18.4E|  } else if (mask) {
  ------------------
  |  Branch (2511:14): [True: 0, False: 18.4E]
  ------------------
 2512|      0|    return vfp->msvf(ref, ref_stride, subpel_x_q3, subpel_y_q3, src, src_stride,
 2513|      0|                     second_pred, mask, mask_stride, invert_mask, sse);
 2514|  18.4E|  } else {
 2515|  18.4E|    return vfp->svaf(ref, ref_stride, subpel_x_q3, subpel_y_q3, src, src_stride,
 2516|  18.4E|                     sse, second_pred);
 2517|  18.4E|  }
 2518|  9.97M|}
mcomp.c:two_level_checks_fast:
 2797|  9.32M|    unsigned int *sse1, int *distortion, int iters, int is_scaled) {
 2798|  9.32M|  const MV diag_step = first_level_check_fast(
 2799|  9.32M|      xd, cm, this_mv, best_mv, hstep, mv_limits, var_params, mv_cost_params,
 2800|  9.32M|      besterr, sse1, distortion, is_scaled);
 2801|  9.32M|  if (iters > 1) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 9.32M]
  ------------------
 2802|      0|    second_level_check_fast(xd, cm, this_mv, diag_step, best_mv, hstep,
 2803|      0|                            mv_limits, var_params, mv_cost_params, besterr,
 2804|      0|                            sse1, distortion, is_scaled);
 2805|      0|  }
 2806|  9.32M|}
mcomp.c:upsampled_setup_center_error:
 2965|  3.20M|    const MV_COST_PARAMS *mv_cost_params, unsigned int *sse1, int *distortion) {
 2966|  3.20M|  unsigned int besterr = upsampled_pref_error(xd, cm, bestmv, var_params, sse1);
 2967|  3.20M|  *distortion = besterr;
 2968|  3.20M|  besterr += mv_err_cost_(bestmv, mv_cost_params);
 2969|  3.20M|  return besterr;
 2970|  3.20M|}
mcomp.c:setup_center_error:
 2903|   202k|    const MV_COST_PARAMS *mv_cost_params, unsigned int *sse1, int *distortion) {
 2904|   202k|  const aom_variance_fn_ptr_t *vfp = var_params->vfp;
 2905|   202k|  const int w = var_params->w;
 2906|   202k|  const int h = var_params->h;
 2907|       |
 2908|   202k|  const MSBuffers *ms_buffers = &var_params->ms_buffers;
 2909|   202k|  const uint8_t *src = ms_buffers->src->buf;
 2910|   202k|  const uint8_t *y = get_buf_from_mv(ms_buffers->ref, *bestmv);
 2911|   202k|  const int src_stride = ms_buffers->src->stride;
 2912|   202k|  const int y_stride = ms_buffers->ref->stride;
 2913|   202k|  const uint8_t *second_pred = ms_buffers->second_pred;
 2914|   202k|  const uint8_t *mask = ms_buffers->mask;
 2915|   202k|  const int mask_stride = ms_buffers->mask_stride;
 2916|   202k|  const int invert_mask = ms_buffers->inv_mask;
 2917|       |
 2918|   202k|  unsigned int besterr;
 2919|       |
 2920|   202k|  if (second_pred != NULL) {
  ------------------
  |  Branch (2920:7): [True: 0, False: 202k]
  ------------------
 2921|      0|#if CONFIG_AV1_HIGHBITDEPTH
 2922|      0|    if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (2922:9): [True: 0, False: 0]
  ------------------
 2923|      0|      DECLARE_ALIGNED(16, uint16_t, comp_pred16[MAX_SB_SQUARE]);
  ------------------
  |  |   19|      0|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2924|      0|      uint8_t *comp_pred = CONVERT_TO_BYTEPTR(comp_pred16);
  ------------------
  |  |   80|      0|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 2925|      0|      if (mask) {
  ------------------
  |  Branch (2925:11): [True: 0, False: 0]
  ------------------
 2926|      0|        aom_highbd_comp_mask_pred(comp_pred, second_pred, w, h, y, y_stride,
 2927|      0|                                  mask, mask_stride, invert_mask);
 2928|      0|      } else {
 2929|      0|        aom_highbd_comp_avg_pred(comp_pred, second_pred, w, h, y, y_stride);
  ------------------
  |  | 2177|      0|#define aom_highbd_comp_avg_pred aom_highbd_comp_avg_pred_c
  ------------------
 2930|      0|      }
 2931|      0|      besterr = vfp->vf(comp_pred, w, src, src_stride, sse1);
 2932|      0|    } else {
 2933|      0|      DECLARE_ALIGNED(16, uint8_t, comp_pred[MAX_SB_SQUARE]);
  ------------------
  |  |   19|      0|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 2934|      0|      if (mask) {
  ------------------
  |  Branch (2934:11): [True: 0, False: 0]
  ------------------
 2935|      0|        aom_comp_mask_pred(comp_pred, second_pred, w, h, y, y_stride, mask,
 2936|      0|                           mask_stride, invert_mask);
 2937|      0|      } else {
 2938|      0|        aom_comp_avg_pred(comp_pred, second_pred, w, h, y, y_stride);
 2939|      0|      }
 2940|      0|      besterr = vfp->vf(comp_pred, w, src, src_stride, sse1);
 2941|      0|    }
 2942|       |#else
 2943|       |    (void)xd;
 2944|       |    DECLARE_ALIGNED(16, uint8_t, comp_pred[MAX_SB_SQUARE]);
 2945|       |    if (mask) {
 2946|       |      aom_comp_mask_pred(comp_pred, second_pred, w, h, y, y_stride, mask,
 2947|       |                         mask_stride, invert_mask);
 2948|       |    } else {
 2949|       |      aom_comp_avg_pred(comp_pred, second_pred, w, h, y, y_stride);
 2950|       |    }
 2951|       |    besterr = vfp->vf(comp_pred, w, src, src_stride, sse1);
 2952|       |#endif
 2953|   202k|  } else {
 2954|   202k|    besterr = vfp->vf(y, y_stride, src, src_stride, sse1);
 2955|   202k|  }
 2956|   202k|  *distortion = besterr;
 2957|   202k|  besterr += mv_err_cost_(bestmv, mv_cost_params);
 2958|   202k|  return besterr;
 2959|   202k|}
mcomp.c:get_best_diag_step:
 2675|  9.33M|                                    unsigned int down_cost) {
 2676|  9.33M|  const MV diag_step = { up_cost <= down_cost ? -step_size : step_size,
  ------------------
  |  Branch (2676:26): [True: 4.91M, False: 4.41M]
  ------------------
 2677|  9.33M|                         left_cost <= right_cost ? -step_size : step_size };
  ------------------
  |  Branch (2677:26): [True: 4.91M, False: 4.41M]
  ------------------
 2678|       |
 2679|  9.33M|  return diag_step;
 2680|  9.33M|}
mcomp.c:first_level_check_fast:
 2690|  9.32M|    unsigned int *sse1, int *distortion, int is_scaled) {
 2691|       |  // Check the four cardinal directions
 2692|  9.32M|  const MV left_mv = { this_mv.row, this_mv.col - hstep };
 2693|  9.32M|  int dummy = 0;
 2694|  9.32M|  const unsigned int left = check_better_fast(
 2695|  9.32M|      xd, cm, &left_mv, best_mv, mv_limits, var_params, mv_cost_params, besterr,
 2696|  9.32M|      sse1, distortion, &dummy, is_scaled);
 2697|       |
 2698|  9.32M|  const MV right_mv = { this_mv.row, this_mv.col + hstep };
 2699|  9.32M|  const unsigned int right = check_better_fast(
 2700|  9.32M|      xd, cm, &right_mv, best_mv, mv_limits, var_params, mv_cost_params,
 2701|  9.32M|      besterr, sse1, distortion, &dummy, is_scaled);
 2702|       |
 2703|  9.32M|  const MV top_mv = { this_mv.row - hstep, this_mv.col };
 2704|  9.32M|  const unsigned int up = check_better_fast(
 2705|  9.32M|      xd, cm, &top_mv, best_mv, mv_limits, var_params, mv_cost_params, besterr,
 2706|  9.32M|      sse1, distortion, &dummy, is_scaled);
 2707|       |
 2708|  9.32M|  const MV bottom_mv = { this_mv.row + hstep, this_mv.col };
 2709|  9.32M|  const unsigned int down = check_better_fast(
 2710|  9.32M|      xd, cm, &bottom_mv, best_mv, mv_limits, var_params, mv_cost_params,
 2711|  9.32M|      besterr, sse1, distortion, &dummy, is_scaled);
 2712|       |
 2713|  9.32M|  const MV diag_step = get_best_diag_step(hstep, left, right, up, down);
 2714|  9.32M|  const MV diag_mv = { this_mv.row + diag_step.row,
 2715|  9.32M|                       this_mv.col + diag_step.col };
 2716|       |
 2717|       |  // Check the diagonal direction with the best mv
 2718|  9.32M|  check_better_fast(xd, cm, &diag_mv, best_mv, mv_limits, var_params,
 2719|  9.32M|                    mv_cost_params, besterr, sse1, distortion, &dummy,
 2720|  9.32M|                    is_scaled);
 2721|       |
 2722|  9.32M|  return diag_step;
 2723|  9.32M|}
mcomp.c:compute_motion_cost:
 3414|  94.5k|    const MV *this_mv) {
 3415|  94.5k|  unsigned int mse;
 3416|  94.5k|  unsigned int sse;
 3417|  94.5k|  const int mi_row = xd->mi_row;
 3418|  94.5k|  const int mi_col = xd->mi_col;
 3419|       |
 3420|  94.5k|  av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3421|  94.5k|                                AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  94.5k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                              AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  94.5k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 3422|       |
 3423|  94.5k|  const SUBPEL_SEARCH_VAR_PARAMS *var_params = &ms_params->var_params;
 3424|  94.5k|  const MSBuffers *ms_buffers = &var_params->ms_buffers;
 3425|       |
 3426|  94.5k|  const uint8_t *const src = ms_buffers->src->buf;
 3427|  94.5k|  const int src_stride = ms_buffers->src->stride;
 3428|  94.5k|  const uint8_t *const dst = xd->plane[0].dst.buf;
 3429|  94.5k|  const int dst_stride = xd->plane[0].dst.stride;
 3430|  94.5k|  const aom_variance_fn_ptr_t *vfp = ms_params->var_params.vfp;
 3431|       |
 3432|  94.5k|  mse = vfp->vf(dst, dst_stride, src, src_stride, &sse);
 3433|  94.5k|  mse += mv_err_cost_(this_mv, &ms_params->mv_cost_params);
 3434|  94.5k|  return mse;
 3435|  94.5k|}
mcomp.c:mv_err_cost_:
  344|  66.5M|                               const MV_COST_PARAMS *mv_cost_params) {
  345|  66.5M|  if (mv_cost_params->mv_cost_type == MV_COST_NONE) {
  ------------------
  |  Branch (345:7): [True: 0, False: 66.5M]
  ------------------
  346|      0|    return 0;
  347|      0|  }
  348|  66.5M|  return mv_err_cost(mv, mv_cost_params->ref_mv, mv_cost_params->mvjcost,
  349|  66.5M|                     mv_cost_params->mvcost, mv_cost_params->error_per_bit,
  350|  66.5M|                     mv_cost_params->mv_cost_type);
  351|  66.5M|}
mcomp.c:mv_err_cost:
  319|  66.5M|                              int error_per_bit, MV_COST_TYPE mv_cost_type) {
  320|  66.5M|  const MV diff = { mv->row - ref_mv->row, mv->col - ref_mv->col };
  321|  66.5M|  const MV abs_diff = { abs(diff.row), abs(diff.col) };
  322|       |
  323|  66.5M|  switch (mv_cost_type) {
  324|  66.3M|    case MV_COST_ENTROPY:
  ------------------
  |  Branch (324:5): [True: 66.3M, False: 170k]
  ------------------
  325|  66.3M|      if (mvcost) {
  ------------------
  |  Branch (325:11): [True: 66.3M, False: 0]
  ------------------
  326|  66.3M|        return (int)ROUND_POWER_OF_TWO_64(
  ------------------
  |  |   53|  66.3M|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  ------------------
  327|  66.3M|            (int64_t)mv_cost(&diff, mvjcost, mvcost) * error_per_bit,
  328|  66.3M|            RDDIV_BITS + AV1_PROB_COST_SHIFT - RD_EPB_SHIFT +
  329|  66.3M|                PIXEL_TRANSFORM_ERROR_SCALE);
  330|  66.3M|      }
  331|      0|      return 0;
  332|      0|    case MV_COST_L1_LOWRES:
  ------------------
  |  Branch (332:5): [True: 0, False: 66.5M]
  ------------------
  333|      0|      return (SSE_LAMBDA_LOWRES * (abs_diff.row + abs_diff.col)) >> 3;
  ------------------
  |  |  283|      0|#define SSE_LAMBDA_LOWRES 2   // Used by mv_cost_err_fn
  ------------------
  334|      0|    case MV_COST_L1_MIDRES:
  ------------------
  |  Branch (334:5): [True: 0, False: 66.5M]
  ------------------
  335|      0|      return (SSE_LAMBDA_MIDRES * (abs_diff.row + abs_diff.col)) >> 3;
  ------------------
  |  |  286|      0|#define SSE_LAMBDA_MIDRES 0   // Used by mv_cost_err_fn
  ------------------
  336|      0|    case MV_COST_L1_HDRES:
  ------------------
  |  Branch (336:5): [True: 0, False: 66.5M]
  ------------------
  337|      0|      return (SSE_LAMBDA_HDRES * (abs_diff.row + abs_diff.col)) >> 3;
  ------------------
  |  |  289|      0|#define SSE_LAMBDA_HDRES 1  // Used by mv_cost_err_fn
  ------------------
  338|      0|    case MV_COST_NONE: return 0;
  ------------------
  |  Branch (338:5): [True: 0, False: 66.5M]
  ------------------
  339|      0|    default: assert(0 && "Invalid rd_cost_type"); return 0;
  ------------------
  |  Branch (339:5): [True: 0, False: 66.5M]
  ------------------
  340|  66.5M|  }
  341|  66.5M|}

mcomp.c:av1_set_ms_compound_refs:
   82|  8.42M|                                            int mask_stride, int invert_mask) {
   83|  8.42M|  ms_buffers->second_pred = second_pred;
   84|  8.42M|  ms_buffers->mask = mask;
   85|  8.42M|  ms_buffers->mask_stride = mask_stride;
   86|  8.42M|  ms_buffers->inv_mask = invert_mask;
   87|  8.42M|}
mcomp.c:av1_set_mv_search_method:
  195|  5.80M|    SEARCH_METHODS search_method) {
  196|  5.80M|  ms_params->search_method = search_method;
  197|  5.80M|  ms_params->search_sites =
  198|  5.80M|      &search_sites[search_method_lookup[ms_params->search_method]];
  199|  5.80M|}
mcomp.c:get_buf_from_fullmv:
  370|  38.2M|                                                 const FULLPEL_MV *mv) {
  371|  38.2M|  return &buf->buf[get_offset_from_fullmv(mv, buf->stride)];
  372|  38.2M|}
mcomp.c:av1_set_subpel_mv_search_range:
  343|  2.62M|                                                  const MV *ref_mv) {
  344|  2.62M|  const int max_mv = GET_MV_SUBPEL(MAX_FULL_PEL_VAL);
  ------------------
  |  |   29|  2.62M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  345|  2.62M|  int minc = AOMMAX(GET_MV_SUBPEL(mv_limits->col_min), ref_mv->col - max_mv);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.62M, False: 18.4E]
  |  |  ------------------
  ------------------
  346|  2.62M|  int maxc = AOMMIN(GET_MV_SUBPEL(mv_limits->col_max), ref_mv->col + max_mv);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.62M, False: 18.4E]
  |  |  ------------------
  ------------------
  347|  2.62M|  int minr = AOMMAX(GET_MV_SUBPEL(mv_limits->row_min), ref_mv->row - max_mv);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.62M, False: 18.4E]
  |  |  ------------------
  ------------------
  348|  2.62M|  int maxr = AOMMIN(GET_MV_SUBPEL(mv_limits->row_max), ref_mv->row + max_mv);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.62M, False: 18.4E]
  |  |  ------------------
  ------------------
  349|       |
  350|  2.62M|  maxc = AOMMAX(minc, maxc);
  ------------------
  |  |   35|  2.62M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  351|  2.62M|  maxr = AOMMAX(minr, maxr);
  ------------------
  |  |   35|  2.62M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  352|       |
  353|  2.62M|  subpel_limits->col_min = AOMMAX(MV_LOW + 1, minc);
  ------------------
  |  |   35|  2.62M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  354|  2.62M|  subpel_limits->col_max = AOMMIN(MV_UPP - 1, maxc);
  ------------------
  |  |   34|  2.62M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  355|  2.62M|  subpel_limits->row_min = AOMMAX(MV_LOW + 1, minr);
  ------------------
  |  |   35|  2.62M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  356|  2.62M|  subpel_limits->row_max = AOMMIN(MV_UPP - 1, maxr);
  ------------------
  |  |   34|  2.62M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.62M]
  |  |  ------------------
  ------------------
  357|  2.62M|}
mcomp.c:get_offset_from_fullmv:
  365|   141M|static inline int get_offset_from_fullmv(const FULLPEL_MV *mv, int stride) {
  366|   141M|  return mv->row * stride + mv->col;
  367|   141M|}
mcomp.c:av1_is_fullmv_in_range:
  269|  29.3M|                                         FULLPEL_MV mv) {
  270|  29.3M|  return (mv.col >= mv_limits->col_min) && (mv.col <= mv_limits->col_max) &&
  ------------------
  |  Branch (270:10): [True: 23.8M, False: 5.48M]
  |  Branch (270:44): [True: 19.1M, False: 4.68M]
  ------------------
  271|  19.1M|         (mv.row >= mv_limits->row_min) && (mv.row <= mv_limits->row_max);
  ------------------
  |  Branch (271:10): [True: 15.2M, False: 3.94M]
  |  Branch (271:44): [True: 11.2M, False: 3.94M]
  ------------------
  272|  29.3M|}
mcomp.c:av1_is_subpelmv_in_range:
  360|  48.5M|                                           MV mv) {
  361|  48.5M|  return (mv.col >= mv_limits->col_min) && (mv.col <= mv_limits->col_max) &&
  ------------------
  |  Branch (361:10): [True: 48.5M, False: 18.4E]
  |  Branch (361:44): [True: 48.5M, False: 7.60k]
  ------------------
  362|  48.5M|         (mv.row >= mv_limits->row_min) && (mv.row <= mv_limits->row_max);
  ------------------
  |  Branch (362:10): [True: 48.5M, False: 18.4E]
  |  Branch (362:44): [True: 48.5M, False: 10.4k]
  ------------------
  363|  48.5M|}
partition_search.c:av1_set_mv_limits:
  231|  12.1M|    int mi_row, int mi_col, int mi_height, int mi_width, int border) {
  232|  12.1M|  av1_set_mv_row_limits(mi_params, mv_limits, mi_row, mi_height, border);
  233|  12.1M|  av1_set_mv_col_limits(mi_params, mv_limits, mi_col, mi_width, border);
  234|  12.1M|}
partition_search.c:av1_set_mv_row_limits:
  205|  12.1M|    int mi_row, int mi_height, int border) {
  206|  12.1M|  const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  207|  12.1M|  const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  208|  12.1M|  mv_limits->row_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|  12.1M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 12.1M]
  |  |  ------------------
  ------------------
  209|  12.1M|  const int max1 = (mi_params->mi_rows - mi_row - mi_height) * MI_SIZE +
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  210|  12.1M|                   border - 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  211|  12.1M|  const int max2 =
  212|  12.1M|      (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  213|  12.1M|  mv_limits->row_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|  12.1M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 12.1M]
  |  |  ------------------
  ------------------
  214|  12.1M|}
partition_search.c:av1_set_mv_col_limits:
  218|  12.1M|    int mi_col, int mi_width, int border) {
  219|  12.1M|  const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  220|  12.1M|  const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  221|  12.1M|  mv_limits->col_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|  12.1M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 12.1M]
  |  |  ------------------
  ------------------
  222|  12.1M|  const int max1 = (mi_params->mi_cols - mi_col - mi_width) * MI_SIZE + border -
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  223|  12.1M|                   2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  224|  12.1M|  const int max2 =
  225|  12.1M|      (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|  12.1M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  12.1M|#define AOM_INTERP_EXTEND 4
  ------------------
  226|  12.1M|  mv_limits->col_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|  12.1M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 12.1M]
  |  |  ------------------
  ------------------
  227|  12.1M|}
partition_strategy.c:av1_set_mv_limits:
  231|   707k|    int mi_row, int mi_col, int mi_height, int mi_width, int border) {
  232|   707k|  av1_set_mv_row_limits(mi_params, mv_limits, mi_row, mi_height, border);
  233|   707k|  av1_set_mv_col_limits(mi_params, mv_limits, mi_col, mi_width, border);
  234|   707k|}
partition_strategy.c:av1_set_mv_row_limits:
  205|   707k|    int mi_row, int mi_height, int border) {
  206|   707k|  const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  207|   707k|  const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  208|   707k|  mv_limits->row_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|   707k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 707k]
  |  |  ------------------
  ------------------
  209|   707k|  const int max1 = (mi_params->mi_rows - mi_row - mi_height) * MI_SIZE +
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  210|   707k|                   border - 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  211|   707k|  const int max2 =
  212|   707k|      (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  213|   707k|  mv_limits->row_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|   707k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 707k]
  |  |  ------------------
  ------------------
  214|   707k|}
partition_strategy.c:av1_set_mv_col_limits:
  218|   707k|    int mi_col, int mi_width, int border) {
  219|   707k|  const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  220|   707k|  const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  221|   707k|  mv_limits->col_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|   707k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 707k]
  |  |  ------------------
  ------------------
  222|   707k|  const int max1 = (mi_params->mi_cols - mi_col - mi_width) * MI_SIZE + border -
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  223|   707k|                   2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  224|   707k|  const int max2 =
  225|   707k|      (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|   707k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   707k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|   707k|#define AOM_INTERP_EXTEND 4
  ------------------
  226|   707k|  mv_limits->col_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|   707k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 707k]
  |  |  ------------------
  ------------------
  227|   707k|}
rdopt.c:av1_is_fullmv_in_range:
  269|  5.29M|                                         FULLPEL_MV mv) {
  270|  5.29M|  return (mv.col >= mv_limits->col_min) && (mv.col <= mv_limits->col_max) &&
  ------------------
  |  Branch (270:10): [True: 5.29M, False: 18.4E]
  |  Branch (270:44): [True: 5.28M, False: 2.39k]
  ------------------
  271|  5.28M|         (mv.row >= mv_limits->row_min) && (mv.row <= mv_limits->row_max);
  ------------------
  |  Branch (271:10): [True: 5.28M, False: 24]
  |  Branch (271:44): [True: 5.28M, False: 2.76k]
  ------------------
  272|  5.29M|}
nonrd_pickmode.c:av1_refresh_search_site_config:
  183|  1.80k|    const int ref_stride) {
  184|  1.80k|  const int level =
  185|  1.80k|      search_method == NSTEP_8PT || search_method == CLAMPED_DIAMOND;
  ------------------
  |  Branch (185:7): [True: 0, False: 1.80k]
  |  Branch (185:37): [True: 18.4E, False: 1.81k]
  ------------------
  186|  1.80k|  search_method = search_method_lookup[search_method];
  187|  1.80k|  av1_init_motion_compensation[search_method](&ss_cfg_buf[search_method],
  188|  1.80k|                                              ref_stride, level);
  189|  1.80k|}
var_based_part.c:av1_set_subpel_mv_search_range:
  343|  6.70k|                                                  const MV *ref_mv) {
  344|  6.70k|  const int max_mv = GET_MV_SUBPEL(MAX_FULL_PEL_VAL);
  ------------------
  |  |   29|  6.70k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  345|  6.70k|  int minc = AOMMAX(GET_MV_SUBPEL(mv_limits->col_min), ref_mv->col - max_mv);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 6.70k, False: 18.4E]
  |  |  ------------------
  ------------------
  346|  6.70k|  int maxc = AOMMIN(GET_MV_SUBPEL(mv_limits->col_max), ref_mv->col + max_mv);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.70k, False: 18.4E]
  |  |  ------------------
  ------------------
  347|  6.70k|  int minr = AOMMAX(GET_MV_SUBPEL(mv_limits->row_min), ref_mv->row - max_mv);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 6.70k, False: 18.4E]
  |  |  ------------------
  ------------------
  348|  6.70k|  int maxr = AOMMIN(GET_MV_SUBPEL(mv_limits->row_max), ref_mv->row + max_mv);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.70k, False: 18.4E]
  |  |  ------------------
  ------------------
  349|       |
  350|  6.70k|  maxc = AOMMAX(minc, maxc);
  ------------------
  |  |   35|  6.70k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  351|  6.70k|  maxr = AOMMAX(minr, maxr);
  ------------------
  |  |   35|  6.70k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  352|       |
  353|  6.70k|  subpel_limits->col_min = AOMMAX(MV_LOW + 1, minc);
  ------------------
  |  |   35|  6.70k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  354|  6.70k|  subpel_limits->col_max = AOMMIN(MV_UPP - 1, maxc);
  ------------------
  |  |   34|  6.70k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  355|  6.70k|  subpel_limits->row_min = AOMMAX(MV_LOW + 1, minr);
  ------------------
  |  |   35|  6.70k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  356|  6.70k|  subpel_limits->row_max = AOMMIN(MV_UPP - 1, maxr);
  ------------------
  |  |   34|  6.70k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 6.70k]
  |  |  ------------------
  ------------------
  357|  6.70k|}
var_based_part.c:get_buf_from_fullmv:
  370|  4.01k|                                                 const FULLPEL_MV *mv) {
  371|  4.01k|  return &buf->buf[get_offset_from_fullmv(mv, buf->stride)];
  372|  4.01k|}
var_based_part.c:get_offset_from_fullmv:
  365|  4.01k|static inline int get_offset_from_fullmv(const FULLPEL_MV *mv, int stride) {
  366|  4.01k|  return mv->row * stride + mv->col;
  367|  4.01k|}
motion_search_facade.c:av1_refresh_search_site_config:
  183|  6.79k|    const int ref_stride) {
  184|  6.79k|  const int level =
  185|  6.79k|      search_method == NSTEP_8PT || search_method == CLAMPED_DIAMOND;
  ------------------
  |  Branch (185:7): [True: 0, False: 6.79k]
  |  Branch (185:37): [True: 18.4E, False: 6.79k]
  ------------------
  186|  6.79k|  search_method = search_method_lookup[search_method];
  187|  6.79k|  av1_init_motion_compensation[search_method](&ss_cfg_buf[search_method],
  188|  6.79k|                                              ref_stride, level);
  189|  6.79k|}
motion_search_facade.c:av1_set_fractional_mv:
  335|  2.02M|static inline void av1_set_fractional_mv(int_mv *fractional_best_mv) {
  336|  8.08M|  for (int z = 0; z < 3; z++) {
  ------------------
  |  Branch (336:19): [True: 6.06M, False: 2.02M]
  ------------------
  337|  6.06M|    fractional_best_mv[z].as_int = INVALID_MV;
  ------------------
  |  |   26|  6.06M|#define INVALID_MV 0x80008000
  ------------------
  338|  6.06M|  }
  339|  2.02M|}
motion_search_facade.c:av1_is_subpelmv_in_range:
  360|  1.62M|                                           MV mv) {
  361|  1.62M|  return (mv.col >= mv_limits->col_min) && (mv.col <= mv_limits->col_max) &&
  ------------------
  |  Branch (361:10): [True: 1.62M, False: 18.4E]
  |  Branch (361:44): [True: 1.62M, False: 69]
  ------------------
  362|  1.62M|         (mv.row >= mv_limits->row_min) && (mv.row <= mv_limits->row_max);
  ------------------
  |  Branch (362:10): [True: 1.62M, False: 18.4E]
  |  Branch (362:44): [True: 1.62M, False: 18.4E]
  ------------------
  363|  1.62M|}
motion_search_facade.c:av1_set_mv_limits:
  231|  3.00M|    int mi_row, int mi_col, int mi_height, int mi_width, int border) {
  232|  3.00M|  av1_set_mv_row_limits(mi_params, mv_limits, mi_row, mi_height, border);
  233|  3.00M|  av1_set_mv_col_limits(mi_params, mv_limits, mi_col, mi_width, border);
  234|  3.00M|}
motion_search_facade.c:av1_set_mv_row_limits:
  205|  3.00M|    int mi_row, int mi_height, int border) {
  206|  3.00M|  const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  207|  3.00M|  const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  208|  3.00M|  mv_limits->row_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|  3.00M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 3.00M]
  |  |  ------------------
  ------------------
  209|  3.00M|  const int max1 = (mi_params->mi_rows - mi_row - mi_height) * MI_SIZE +
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  210|  3.00M|                   border - 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  211|  3.00M|  const int max2 =
  212|  3.00M|      (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  213|  3.00M|  mv_limits->row_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|  3.00M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 3.00M]
  |  |  ------------------
  ------------------
  214|  3.00M|}
motion_search_facade.c:av1_set_mv_col_limits:
  218|  3.00M|    int mi_col, int mi_width, int border) {
  219|  3.00M|  const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min1 = -(mi_col * MI_SIZE + border - 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  220|  3.00M|  const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int min2 = -(((mi_col + mi_width) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  221|  3.00M|  mv_limits->col_min = AOMMAX(min1, min2);
  ------------------
  |  |   35|  3.00M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 3.00M]
  |  |  ------------------
  ------------------
  222|  3.00M|  const int max1 = (mi_params->mi_cols - mi_col - mi_width) * MI_SIZE + border -
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  223|  3.00M|                   2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  224|  3.00M|  const int max2 =
  225|  3.00M|      (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   40|  3.00M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  3.00M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_cols - mi_col) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
  ------------------
  |  |   31|  3.00M|#define AOM_INTERP_EXTEND 4
  ------------------
  226|  3.00M|  mv_limits->col_max = AOMMIN(max1, max2);
  ------------------
  |  |   34|  3.00M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 3.00M]
  |  |  ------------------
  ------------------
  227|  3.00M|}

av1_nn_output_prec_reduce:
   19|  5.60M|void av1_nn_output_prec_reduce(float *const output, int num_output) {
   20|  5.60M|  const int prec_bits = 9;
   21|  5.60M|  const int prec = 1 << prec_bits;
   22|  5.60M|  const float inv_prec = (float)(1.0 / prec);
   23|  37.4M|  for (int i = 0; i < num_output; i++) {
  ------------------
  |  Branch (23:19): [True: 31.8M, False: 5.60M]
  ------------------
   24|  31.8M|    output[i] = ((int)(output[i] * prec + 0.5)) * inv_prec;
   25|  31.8M|  }
   26|  5.60M|}
av1_nn_softmax:
  143|   249k|void av1_nn_softmax(const float *input, float *output, int n) {
  144|       |  // Softmax function is invariant to adding the same constant
  145|       |  // to all input values, so we subtract the maximum input to avoid
  146|       |  // possible overflow.
  147|   249k|  float max_input = input[0];
  148|  2.03M|  for (int i = 1; i < n; i++) max_input = AOMMAX(max_input, input[i]);
  ------------------
  |  |   35|  1.78M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.47M, False: 308k]
  |  |  ------------------
  ------------------
  |  Branch (148:19): [True: 1.78M, False: 249k]
  ------------------
  149|   249k|  float sum_out = 0.0f;
  150|  2.28M|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (150:19): [True: 2.03M, False: 249k]
  ------------------
  151|       |    // Clamp to range [-10.0, 0.0] to prevent FE_UNDERFLOW errors.
  152|  2.03M|    const float normalized_input = AOMMAX(input[i] - max_input, -10.0f);
  ------------------
  |  |   35|  2.03M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.27M, False: 759k]
  |  |  ------------------
  ------------------
  153|  2.03M|    output[i] = expf(normalized_input);
  154|  2.03M|    sum_out += output[i];
  155|  2.03M|  }
  156|  2.28M|  for (int i = 0; i < n; i++) output[i] /= sum_out;
  ------------------
  |  Branch (156:19): [True: 2.03M, False: 249k]
  ------------------
  157|   249k|}

rdopt.c:model_rd_for_sb_with_curvfit:
  260|  23.8k|    int64_t *plane_sse, int64_t *plane_dist) {
  261|       |  // Note our transform coeffs are 8 times an orthogonal transform.
  262|       |  // Hence quantizer step is also 8 times. To get effective quantizer
  263|       |  // we need to divide by 8 before sending to modeling function.
  264|  23.8k|  const int ref = xd->mi[0]->ref_frame[0];
  265|       |
  266|  23.8k|  int64_t rate_sum = 0;
  267|  23.8k|  int64_t dist_sum = 0;
  268|  23.8k|  int64_t total_sse = 0;
  269|       |
  270|  49.4k|  for (int plane = plane_from; plane <= plane_to; ++plane) {
  ------------------
  |  Branch (270:32): [True: 25.5k, False: 23.8k]
  ------------------
  271|  25.5k|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (271:9): [True: 1.69k, False: 23.8k]
  |  Branch (271:18): [True: 0, False: 1.69k]
  ------------------
  272|  25.5k|    struct macroblockd_plane *const pd = &xd->plane[plane];
  273|  25.5k|    const BLOCK_SIZE plane_bsize =
  274|  25.5k|        get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
  275|  25.5k|    int64_t dist, sse;
  276|  25.5k|    int rate;
  277|  25.5k|    int bw, bh;
  278|  25.5k|    const struct macroblock_plane *const p = &x->plane[plane];
  279|  25.5k|    const int block_width = block_size_wide[plane_bsize];
  280|  25.5k|    const int block_height = block_size_high[plane_bsize];
  281|       |
  282|  25.5k|    get_visible_dimensions(x, plane, plane_bsize, 0, 0, block_width,
  283|  25.5k|                           block_height, /*clip_dims=*/true, &bw, &bh);
  284|       |
  285|  25.5k|    sse = pixel_dist_visible_only(cpi, x, p->src.buf, p->src.stride,
  286|  25.5k|                                  pd->dst.buf, pd->dst.stride, plane_bsize,
  287|  25.5k|                                  block_height, block_width, bh, bw);
  288|       |
  289|  25.5k|    model_rd_with_curvfit(cpi, x, plane_bsize, plane, sse, bw * bh, &rate,
  290|  25.5k|                          &dist);
  291|       |
  292|  25.5k|    if (plane == 0) x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX);
  ------------------
  |  |   34|  23.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 23.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (292:9): [True: 23.8k, False: 1.69k]
  ------------------
  293|       |
  294|  25.5k|    total_sse += sse;
  295|  25.5k|    rate_sum += rate;
  296|  25.5k|    dist_sum += dist;
  297|       |
  298|  25.5k|    if (plane_rate) plane_rate[plane] = rate;
  ------------------
  |  Branch (298:9): [True: 0, False: 25.5k]
  ------------------
  299|  25.5k|    if (plane_sse) plane_sse[plane] = sse;
  ------------------
  |  Branch (299:9): [True: 0, False: 25.5k]
  ------------------
  300|  25.5k|    if (plane_dist) plane_dist[plane] = dist;
  ------------------
  |  Branch (300:9): [True: 0, False: 25.5k]
  ------------------
  301|  25.5k|  }
  302|       |
  303|  23.8k|  if (skip_txfm_sb) *skip_txfm_sb = rate_sum == 0;
  ------------------
  |  Branch (303:7): [True: 0, False: 23.8k]
  ------------------
  304|  23.8k|  if (skip_sse_sb) *skip_sse_sb = total_sse << 4;
  ------------------
  |  Branch (304:7): [True: 21.9k, False: 1.94k]
  ------------------
  305|  23.8k|  *out_rate_sum = (int)rate_sum;
  306|  23.8k|  *out_dist_sum = dist_sum;
  307|  23.8k|}
rdopt.c:pixel_dist_visible_only:
   74|  9.63M|    int visible_cols) {
   75|  9.63M|  if (visible_rows == 0 || visible_cols == 0) return 0;
  ------------------
  |  Branch (75:7): [True: 18.4E, False: 9.63M]
  |  Branch (75:28): [True: 18.4E, False: 9.63M]
  ------------------
   76|       |
   77|  9.63M|  unsigned sse;
   78|  9.63M|  if (txb_rows == visible_rows && txb_cols == visible_cols) {
  ------------------
  |  Branch (78:7): [True: 9.62M, False: 10.5k]
  |  Branch (78:35): [True: 9.61M, False: 11.2k]
  ------------------
   79|  9.61M|    cpi->ppi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse);
   80|  9.61M|    return sse;
   81|  9.61M|  }
   82|       |
   83|  21.6k|#if CONFIG_AV1_HIGHBITDEPTH
   84|  21.6k|  const MACROBLOCKD *xd = &x->e_mbd;
   85|  21.6k|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (85:7): [True: 2.01k, False: 19.6k]
  ------------------
   86|  2.01k|    uint64_t sse64;
   87|  2.01k|    if (!(visible_rows % 4) && !(visible_cols % 4)) {
  ------------------
  |  Branch (87:9): [True: 2.01k, False: 18.4E]
  |  Branch (87:32): [True: 2.01k, False: 0]
  ------------------
   88|  2.01k|      sse64 = aom_highbd_sse(src, src_stride, dst, dst_stride, visible_cols,
   89|  2.01k|                             visible_rows);
   90|  18.4E|    } else {
   91|  18.4E|      sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride,
   92|  18.4E|                                      visible_cols, visible_rows);
   93|  18.4E|    }
   94|  2.01k|    return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2);
  ------------------
  |  |   41|  2.01k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   95|  2.01k|  }
   96|       |#else
   97|       |  (void)x;
   98|       |#endif
   99|  21.6k|  if (!(visible_rows % 4) && !(visible_cols % 4)) {
  ------------------
  |  Branch (99:7): [True: 21.6k, False: 18.4E]
  |  Branch (99:30): [True: 21.6k, False: 0]
  ------------------
  100|  21.6k|    sse = (unsigned)aom_sse(src, src_stride, dst, dst_stride, visible_cols,
  101|  21.6k|                            visible_rows);
  102|  18.4E|  } else {
  103|  18.4E|    sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols,
  104|  18.4E|                           visible_rows);
  105|  18.4E|  }
  106|  19.6k|  return sse;
  107|  21.6k|}
rdopt.c:model_rd_with_curvfit:
  166|  25.5k|                                         int *rate, int64_t *dist) {
  167|  25.5k|  (void)cpi;
  168|  25.5k|  (void)plane_bsize;
  169|  25.5k|  const MACROBLOCKD *const xd = &x->e_mbd;
  170|  25.5k|  const struct macroblock_plane *const p = &x->plane[plane];
  171|  25.5k|  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  ------------------
  |  Branch (171:29): [True: 2.03k, False: 23.5k]
  ------------------
  172|  25.5k|  const int qstep = AOMMAX(p->dequant_QTX[1] >> dequant_shift, 1);
  ------------------
  |  |   35|  25.5k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 21.7k, False: 3.78k]
  |  |  ------------------
  ------------------
  173|       |
  174|  25.5k|  if (sse == 0) {
  ------------------
  |  Branch (174:7): [True: 0, False: 25.5k]
  ------------------
  175|      0|    if (rate) *rate = 0;
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|    if (dist) *dist = 0;
  ------------------
  |  Branch (176:9): [True: 0, False: 0]
  ------------------
  177|      0|    return;
  178|      0|  }
  179|  25.5k|  const double sse_norm = (double)sse / num_samples;
  180|  25.5k|  const double qstepsqr = (double)qstep * qstep;
  181|  25.5k|  const double xqr = log2(sse_norm / qstepsqr);
  182|  25.5k|  double rate_dist_f[2];
  183|  25.5k|  av1_model_rd_curvfit(plane_bsize, sse_norm, xqr, rate_dist_f);
  184|       |
  185|  25.5k|  const double dist_f = rate_dist_f[1] * sse_norm;
  186|  25.5k|  int rate_i = (int)(AOMMAX(0.0, rate_dist_f[0] * num_samples) + 0.5);
  ------------------
  |  |   35|  25.5k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 25.5k]
  |  |  ------------------
  ------------------
  187|  25.5k|  int64_t dist_i = (int64_t)(AOMMAX(0.0, dist_f * num_samples) + 0.5);
  ------------------
  |  |   35|  25.5k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 25.5k]
  |  |  ------------------
  ------------------
  188|       |
  189|       |  // Check if skip is better
  190|  25.5k|  if (rate_i == 0) {
  ------------------
  |  Branch (190:7): [True: 0, False: 25.5k]
  ------------------
  191|      0|    dist_i = sse << 4;
  192|  25.5k|  } else if (RDCOST(x->rdmult, rate_i, dist_i) >=
  ------------------
  |  |   33|  25.5k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  25.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  25.5k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  25.5k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (192:14): [True: 27, False: 25.5k]
  ------------------
  193|  25.5k|             RDCOST(x->rdmult, 0, sse << 4)) {
  ------------------
  |  |   33|  25.5k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  25.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  25.5k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  25.5k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  194|     27|    rate_i = 0;
  195|     27|    dist_i = sse << 4;
  196|     27|  }
  197|       |
  198|  25.5k|  if (rate) *rate = rate_i;
  ------------------
  |  Branch (198:7): [True: 25.5k, False: 4]
  ------------------
  199|  25.5k|  if (dist) *dist = dist_i;
  ------------------
  |  Branch (199:7): [True: 25.5k, False: 4]
  ------------------
  200|  25.5k|}
nonrd_pickmode.c:model_rd_with_curvfit:
  166|  2.74M|                                         int *rate, int64_t *dist) {
  167|  2.74M|  (void)cpi;
  168|  2.74M|  (void)plane_bsize;
  169|  2.74M|  const MACROBLOCKD *const xd = &x->e_mbd;
  170|  2.74M|  const struct macroblock_plane *const p = &x->plane[plane];
  171|  2.74M|  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  ------------------
  |  Branch (171:29): [True: 123k, False: 2.61M]
  ------------------
  172|  2.74M|  const int qstep = AOMMAX(p->dequant_QTX[1] >> dequant_shift, 1);
  ------------------
  |  |   35|  2.74M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.57M, False: 169k]
  |  |  ------------------
  ------------------
  173|       |
  174|  2.74M|  if (sse == 0) {
  ------------------
  |  Branch (174:7): [True: 19, False: 2.74M]
  ------------------
  175|     19|    if (rate) *rate = 0;
  ------------------
  |  Branch (175:9): [True: 19, False: 0]
  ------------------
  176|     19|    if (dist) *dist = 0;
  ------------------
  |  Branch (176:9): [True: 19, False: 0]
  ------------------
  177|     19|    return;
  178|     19|  }
  179|  2.74M|  const double sse_norm = (double)sse / num_samples;
  180|  2.74M|  const double qstepsqr = (double)qstep * qstep;
  181|  2.74M|  const double xqr = log2(sse_norm / qstepsqr);
  182|  2.74M|  double rate_dist_f[2];
  183|  2.74M|  av1_model_rd_curvfit(plane_bsize, sse_norm, xqr, rate_dist_f);
  184|       |
  185|  2.74M|  const double dist_f = rate_dist_f[1] * sse_norm;
  186|  2.74M|  int rate_i = (int)(AOMMAX(0.0, rate_dist_f[0] * num_samples) + 0.5);
  ------------------
  |  |   35|  2.74M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 17, False: 2.74M]
  |  |  ------------------
  ------------------
  187|  2.74M|  int64_t dist_i = (int64_t)(AOMMAX(0.0, dist_f * num_samples) + 0.5);
  ------------------
  |  |   35|  2.74M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 2.74M]
  |  |  ------------------
  ------------------
  188|       |
  189|       |  // Check if skip is better
  190|  2.74M|  if (rate_i == 0) {
  ------------------
  |  Branch (190:7): [True: 41, False: 2.74M]
  ------------------
  191|     41|    dist_i = sse << 4;
  192|  2.74M|  } else if (RDCOST(x->rdmult, rate_i, dist_i) >=
  ------------------
  |  |   33|  2.74M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  2.74M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  2.74M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  2.74M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (192:14): [True: 327, False: 2.74M]
  ------------------
  193|  2.74M|             RDCOST(x->rdmult, 0, sse << 4)) {
  ------------------
  |  |   33|  2.74M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  2.74M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  2.74M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  2.74M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  194|    327|    rate_i = 0;
  195|    327|    dist_i = sse << 4;
  196|    327|  }
  197|       |
  198|  2.74M|  if (rate) *rate = rate_i;
  ------------------
  |  Branch (198:7): [True: 2.74M, False: 18.4E]
  ------------------
  199|  2.74M|  if (dist) *dist = dist_i;
  ------------------
  |  Branch (199:7): [True: 2.74M, False: 18.4E]
  ------------------
  200|  2.74M|}
tx_search.c:pixel_dist_visible_only:
   74|  59.6M|    int visible_cols) {
   75|  59.6M|  if (visible_rows == 0 || visible_cols == 0) return 0;
  ------------------
  |  Branch (75:7): [True: 18.4E, False: 59.6M]
  |  Branch (75:28): [True: 18.4E, False: 59.6M]
  ------------------
   76|       |
   77|  59.6M|  unsigned sse;
   78|  59.6M|  if (txb_rows == visible_rows && txb_cols == visible_cols) {
  ------------------
  |  Branch (78:7): [True: 59.3M, False: 256k]
  |  Branch (78:35): [True: 59.1M, False: 229k]
  ------------------
   79|  59.1M|    cpi->ppi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse);
   80|  59.1M|    return sse;
   81|  59.1M|  }
   82|       |
   83|   485k|#if CONFIG_AV1_HIGHBITDEPTH
   84|   485k|  const MACROBLOCKD *xd = &x->e_mbd;
   85|   485k|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (85:7): [True: 149k, False: 336k]
  ------------------
   86|   149k|    uint64_t sse64;
   87|   149k|    if (!(visible_rows % 4) && !(visible_cols % 4)) {
  ------------------
  |  Branch (87:9): [True: 105k, False: 43.8k]
  |  Branch (87:32): [True: 70.7k, False: 34.4k]
  ------------------
   88|  70.7k|      sse64 = aom_highbd_sse(src, src_stride, dst, dst_stride, visible_cols,
   89|  70.7k|                             visible_rows);
   90|  78.2k|    } else {
   91|  78.2k|      sse64 = aom_highbd_sse_odd_size(src, src_stride, dst, dst_stride,
   92|  78.2k|                                      visible_cols, visible_rows);
   93|  78.2k|    }
   94|   149k|    return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2);
  ------------------
  |  |   41|   149k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
   95|   149k|  }
   96|       |#else
   97|       |  (void)x;
   98|       |#endif
   99|   336k|  if (!(visible_rows % 4) && !(visible_cols % 4)) {
  ------------------
  |  Branch (99:7): [True: 275k, False: 60.7k]
  |  Branch (99:30): [True: 182k, False: 93.1k]
  ------------------
  100|   182k|    sse = (unsigned)aom_sse(src, src_stride, dst, dst_stride, visible_cols,
  101|   182k|                            visible_rows);
  102|   182k|  } else {
  103|   153k|    sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols,
  104|   153k|                           visible_rows);
  105|   153k|  }
  106|   336k|  return sse;
  107|   485k|}

av1_single_motion_search:
  124|  2.15M|                              struct HandleInterModeArgs *const args) {
  125|  2.15M|  MACROBLOCKD *xd = &x->e_mbd;
  126|  2.15M|  const AV1_COMMON *cm = &cpi->common;
  127|  2.15M|  const MotionVectorSearchParams *mv_search_params = &cpi->mv_search_params;
  128|  2.15M|  const int num_planes = av1_num_planes(cm);
  129|  2.15M|  MB_MODE_INFO *mbmi = xd->mi[0];
  130|  2.15M|  struct buf_2d backup_yv12[MAX_MB_PLANE] = { { 0, 0, 0, 0, 0 } };
  131|  2.15M|  int bestsme = INT_MAX;
  132|  2.15M|  const int ref = mbmi->ref_frame[ref_idx];
  133|  2.15M|  const YV12_BUFFER_CONFIG *scaled_ref_frame =
  134|  2.15M|      av1_get_scaled_ref_frame(cpi, ref);
  135|  2.15M|  const int mi_row = xd->mi_row;
  136|  2.15M|  const int mi_col = xd->mi_col;
  137|  2.15M|  const MvCosts *mv_costs = x->mv_costs;
  138|       |
  139|  2.15M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (139:7): [True: 1.89M, False: 260k]
  ------------------
  140|       |    // Swap out the reference frame for a version that's been scaled to
  141|       |    // match the resolution of the current frame, allowing the existing
  142|       |    // full-pixel motion search code to be used without additional
  143|       |    // modifications.
  144|  5.56M|    for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (144:21): [True: 3.67M, False: 1.89M]
  ------------------
  145|  3.67M|      backup_yv12[i] = xd->plane[i].pre[ref_idx];
  146|  3.67M|    }
  147|  1.89M|    av1_setup_pre_planes(xd, ref_idx, scaled_ref_frame, mi_row, mi_col, NULL,
  148|  1.89M|                         num_planes);
  149|  1.89M|  }
  150|       |
  151|       |  // Work out the size of the first step in the mv step search.
  152|       |  // 0 here is maximum length first step. 1 is AOMMAX >> 1 etc.
  153|  2.15M|  int step_param;
  154|  2.15M|  if (cpi->sf.mv_sf.auto_mv_step_size && cm->show_frame) {
  ------------------
  |  Branch (154:7): [True: 2.15M, False: 18.4E]
  |  Branch (154:42): [True: 2.15M, False: 18.4E]
  ------------------
  155|       |    // Take the weighted average of the step_params based on the last frame's
  156|       |    // max mv magnitude and that based on the best ref mvs of the current
  157|       |    // block for the given reference.
  158|  2.15M|    step_param = (av1_init_search_range(x->max_mv_context[ref]) +
  159|  2.15M|                  mv_search_params->mv_step_param) /
  160|  2.15M|                 2;
  161|  18.4E|  } else {
  162|  18.4E|    step_param = mv_search_params->mv_step_param;
  163|  18.4E|  }
  164|       |
  165|  2.15M|  const MV ref_mv = av1_get_ref_mv(x, ref_idx).as_mv;
  166|  2.15M|  FULLPEL_MV start_mv;
  167|  2.15M|  if (mbmi->motion_mode != SIMPLE_TRANSLATION)
  ------------------
  |  Branch (167:7): [True: 0, False: 2.15M]
  ------------------
  168|      0|    start_mv = get_fullmv_from_mv(&mbmi->mv[0].as_mv);
  169|  2.15M|  else
  170|  2.15M|    start_mv = get_fullmv_from_mv(&ref_mv);
  171|       |
  172|  2.15M|  const FULLPEL_MV fullpel_ref_mv = start_mv;
  173|       |
  174|       |  // cand stores start_mv and all possible MVs in a SB.
  175|  2.15M|  cand_mv_t cand[MAX_TPL_BLK_IN_SB * MAX_TPL_BLK_IN_SB + 1];
  176|  2.15M|  av1_zero(cand);
  ------------------
  |  |   43|  2.15M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
  177|  2.15M|  cand[0].fmv.as_fullmv = start_mv;
  178|  2.15M|  int cnt = 1;
  179|  2.15M|  int total_weight = 0;
  180|       |
  181|  2.15M|  if (!cpi->sf.mv_sf.full_pixel_search_level &&
  ------------------
  |  Branch (181:7): [True: 2.15M, False: 191]
  ------------------
  182|  2.15M|      mbmi->motion_mode == SIMPLE_TRANSLATION) {
  ------------------
  |  Branch (182:7): [True: 2.15M, False: 18.4E]
  ------------------
  183|  2.15M|    get_mv_candidate_from_tpl(cpi, x, bsize, ref, cand, &cnt, &total_weight);
  184|  2.15M|  }
  185|       |
  186|  2.15M|  const int cand_cnt = AOMMIN(2, cnt);
  ------------------
  |  |   34|  2.15M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 2.15M]
  |  |  ------------------
  ------------------
  187|       |  // TODO(any): Test the speed feature for OBMC_CAUSAL mode.
  188|  2.15M|  if (cpi->sf.mv_sf.skip_fullpel_search_using_startmv_refmv &&
  ------------------
  |  Branch (188:7): [True: 2.15M, False: 18.4E]
  ------------------
  189|  2.15M|      mbmi->motion_mode == SIMPLE_TRANSLATION) {
  ------------------
  |  Branch (189:7): [True: 2.15M, False: 18.4E]
  ------------------
  190|  4.30M|    for (int cand_idx = 0; cand_idx < cand_cnt; cand_idx++) {
  ------------------
  |  Branch (190:28): [True: 2.15M, False: 2.15M]
  ------------------
  191|  2.15M|      int_mv *fmv_cand = &cand[cand_idx].fmv;
  192|  2.15M|      int skip_cand_mv = 0;
  193|       |
  194|       |      // Check difference between mvs in the stack and candidate mv.
  195|  2.44M|      for (int stack_idx = 0; stack_idx < args->start_mv_cnt; stack_idx++) {
  ------------------
  |  Branch (195:31): [True: 311k, False: 2.13M]
  ------------------
  196|   311k|        uint8_t this_ref_mv_idx = args->ref_mv_idx_stack[stack_idx];
  197|   311k|        const int this_newmv_valid =
  198|   311k|            args->single_newmv_valid[this_ref_mv_idx][ref];
  199|       |
  200|   311k|        if (!this_newmv_valid && this_ref_mv_idx != mbmi->ref_mv_idx) continue;
  ------------------
  |  Branch (200:13): [True: 24.6k, False: 286k]
  |  Branch (200:34): [True: 24.6k, False: 18.4E]
  ------------------
  201|       |
  202|   286k|        const FULLPEL_MV *fmv_stack = &args->start_mv_stack[stack_idx];
  203|   286k|        const int start_mv_row_diff =
  204|   286k|            abs(fmv_stack->row - fmv_cand->as_fullmv.row);
  205|   286k|        const int start_mv_col_diff =
  206|   286k|            abs(fmv_stack->col - fmv_cand->as_fullmv.col);
  207|       |
  208|   286k|        if (mbmi->mode == NEAR_NEWMV || mbmi->mode == NEW_NEARMV) {
  ------------------
  |  Branch (208:13): [True: 18.4E, False: 286k]
  |  Branch (208:41): [True: 18.4E, False: 286k]
  ------------------
  209|      0|          assert(has_second_ref(mbmi));
  210|      0|          this_ref_mv_idx += 1;
  211|      0|        }
  212|   286k|        const MV this_ref_mv =
  213|   286k|            av1_get_ref_mv_from_stack(ref_idx, mbmi->ref_frame, this_ref_mv_idx,
  214|   286k|                                      &x->mbmi_ext)
  215|   286k|                .as_mv;
  216|       |
  217|   286k|        assert(IMPLIES(args->ref_mv_idx_stack[stack_idx] == mbmi->ref_mv_idx,
  218|   286k|                       this_ref_mv.row == ref_mv.row));
  219|   286k|        assert(IMPLIES(args->ref_mv_idx_stack[stack_idx] == mbmi->ref_mv_idx,
  220|   286k|                       this_ref_mv.col == ref_mv.col));
  221|       |
  222|   286k|        const FULLPEL_MV this_fullpel_ref_mv = get_fullmv_from_mv(&this_ref_mv);
  223|   286k|        const int ref_mv_row_diff =
  224|   286k|            abs(this_fullpel_ref_mv.row - fullpel_ref_mv.row);
  225|   286k|        const int ref_mv_col_diff =
  226|   286k|            abs(this_fullpel_ref_mv.col - fullpel_ref_mv.col);
  227|       |
  228|   286k|        if (cpi->sf.mv_sf.skip_fullpel_search_using_startmv_refmv >= 2) {
  ------------------
  |  Branch (228:13): [True: 286k, False: 18.4E]
  ------------------
  229|       |          // Prunes the current start_mv candidate, if the absolute mv
  230|       |          // difference of both row and column are <= 1.
  231|   286k|          if (start_mv_row_diff <= 1 && start_mv_col_diff <= 1 &&
  ------------------
  |  Branch (231:15): [True: 70.5k, False: 216k]
  |  Branch (231:41): [True: 21.7k, False: 48.8k]
  ------------------
  232|  21.7k|              ref_mv_row_diff <= 1 && ref_mv_col_diff <= 1) {
  ------------------
  |  Branch (232:15): [True: 21.7k, False: 0]
  |  Branch (232:39): [True: 21.7k, False: 1]
  ------------------
  233|  21.7k|            skip_cand_mv = 1;
  234|  21.7k|            break;
  235|  21.7k|          }
  236|  18.4E|        } else if (cpi->sf.mv_sf.skip_fullpel_search_using_startmv_refmv >= 1) {
  ------------------
  |  Branch (236:20): [True: 0, False: 18.4E]
  ------------------
  237|       |          // Prunes the current start_mv candidate, if the sum of the absolute
  238|       |          // mv difference of row and column is <= 1.
  239|      0|          if ((start_mv_row_diff + start_mv_col_diff <= 1) &&
  ------------------
  |  Branch (239:15): [True: 0, False: 0]
  ------------------
  240|      0|              (ref_mv_row_diff + ref_mv_col_diff <= 1)) {
  ------------------
  |  Branch (240:15): [True: 0, False: 0]
  ------------------
  241|      0|            skip_cand_mv = 1;
  242|      0|            break;
  243|      0|          }
  244|      0|        }
  245|   286k|      }
  246|  2.15M|      if (skip_cand_mv) {
  ------------------
  |  Branch (246:11): [True: 21.7k, False: 2.13M]
  ------------------
  247|       |        // Mark the candidate mv as invalid so that motion search gets skipped.
  248|  21.7k|        cand[cand_idx].fmv.as_int = INVALID_MV;
  ------------------
  |  |   26|  21.7k|#define INVALID_MV 0x80008000
  ------------------
  249|  2.13M|      } else {
  250|       |        // Store start_mv candidate and corresponding ref_mv_idx of full-pel
  251|       |        // search in the mv stack.
  252|  2.13M|        assert(args->start_mv_cnt < MAX_REF_MV_SEARCH * 2);
  253|  2.13M|        args->start_mv_stack[args->start_mv_cnt] = fmv_cand->as_fullmv;
  254|  2.13M|        args->ref_mv_idx_stack[args->start_mv_cnt] = mbmi->ref_mv_idx;
  255|  2.13M|        args->start_mv_cnt++;
  256|  2.13M|      }
  257|  2.15M|    }
  258|  2.15M|  }
  259|       |
  260|       |  // Hot fix for asan complaints when resize mode is on. When resize mode is on,
  261|       |  // the stride of the reference frame can be different from indicated by
  262|       |  // MotionVectorSearchParams::search_site_cfg. When this happens, we need to
  263|       |  // readjust the stride.
  264|  2.15M|  const MV_SPEED_FEATURES *mv_sf = &cpi->sf.mv_sf;
  265|  2.15M|  const SEARCH_METHODS search_method =
  266|  2.15M|      av1_get_default_mv_search_method(x, mv_sf, bsize);
  267|  2.15M|  const search_site_config *src_search_site_cfg =
  268|  2.15M|      av1_get_search_site_config(cpi, x, search_method);
  269|       |
  270|       |  // Further reduce the search range.
  271|  2.15M|  if (search_range < INT_MAX) {
  ------------------
  |  Branch (271:7): [True: 148k, False: 2.00M]
  ------------------
  272|   148k|    const search_site_config *search_site_cfg =
  273|   148k|        &src_search_site_cfg[search_method_lookup[search_method]];
  274|       |    // Max step_param is search_site_cfg->num_search_steps.
  275|   148k|    if (search_range < 1) {
  ------------------
  |  Branch (275:9): [True: 149, False: 148k]
  ------------------
  276|    149|      step_param = search_site_cfg->num_search_steps;
  277|   148k|    } else {
  278|   305k|      while (search_site_cfg->radius[search_site_cfg->num_search_steps -
  ------------------
  |  Branch (278:14): [True: 157k, False: 148k]
  ------------------
  279|   305k|                                     step_param - 1] > (search_range << 1) &&
  280|   157k|             search_site_cfg->num_search_steps - step_param - 1 > 0)
  ------------------
  |  Branch (280:14): [True: 157k, False: 0]
  ------------------
  281|   157k|        step_param++;
  282|   148k|    }
  283|   148k|  }
  284|       |
  285|  2.15M|  int cost_list[5];
  286|  2.15M|  FULLPEL_MV_STATS best_mv_stats;
  287|  2.15M|  int_mv second_best_mv;
  288|  2.15M|  best_mv->as_int = second_best_mv.as_int = INVALID_MV;
  ------------------
  |  |   26|  2.15M|#define INVALID_MV 0x80008000
  ------------------
  289|       |
  290|       |  // Allow more mesh searches for screen content type on the ARF.
  291|  2.15M|  const int fine_search_interval = use_fine_search_interval(cpi);
  292|  2.15M|  FULLPEL_MOTION_SEARCH_PARAMS full_ms_params;
  293|       |
  294|  2.15M|  switch (mbmi->motion_mode) {
  295|  2.15M|    case SIMPLE_TRANSLATION: {
  ------------------
  |  Branch (295:5): [True: 2.15M, False: 18.4E]
  ------------------
  296|       |      // Perform a search with the top 2 candidates
  297|  2.15M|      int sum_weight = 0;
  298|  4.30M|      for (int m = 0; m < cand_cnt; m++) {
  ------------------
  |  Branch (298:23): [True: 2.15M, False: 2.15M]
  ------------------
  299|  2.15M|        int_mv smv = cand[m].fmv;
  300|  2.15M|        FULLPEL_MV this_best_mv, this_second_best_mv;
  301|  2.15M|        FULLPEL_MV_STATS this_mv_stats;
  302|       |
  303|  2.15M|        if (smv.as_int == INVALID_MV) continue;
  ------------------
  |  |   26|  2.15M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (303:13): [True: 21.7k, False: 2.13M]
  ------------------
  304|       |
  305|  2.13M|        av1_make_default_fullpel_ms_params(
  306|  2.13M|            &full_ms_params, cpi, x, bsize, &ref_mv, smv.as_fullmv,
  307|  2.13M|            src_search_site_cfg, search_method, fine_search_interval);
  308|       |
  309|  2.13M|        const int thissme =
  310|  2.13M|            av1_full_pixel_search(smv.as_fullmv, &full_ms_params, step_param,
  311|  2.13M|                                  cond_cost_list(cpi, cost_list), &this_best_mv,
  312|  2.13M|                                  &this_mv_stats, &this_second_best_mv);
  313|       |
  314|  2.13M|        if (thissme < bestsme) {
  ------------------
  |  Branch (314:13): [True: 2.13M, False: 18.4E]
  ------------------
  315|  2.13M|          bestsme = thissme;
  316|  2.13M|          best_mv->as_fullmv = this_best_mv;
  317|  2.13M|          best_mv_stats = this_mv_stats;
  318|  2.13M|          second_best_mv.as_fullmv = this_second_best_mv;
  319|  2.13M|        }
  320|       |
  321|  2.13M|        sum_weight += cand[m].weight;
  322|  2.13M|        if (4 * sum_weight > 3 * total_weight) break;
  ------------------
  |  Branch (322:13): [True: 0, False: 2.13M]
  ------------------
  323|  2.13M|      }
  324|  2.15M|    } break;
  325|      0|    case OBMC_CAUSAL:
  ------------------
  |  Branch (325:5): [True: 0, False: 2.15M]
  ------------------
  326|      0|      av1_make_default_fullpel_ms_params(&full_ms_params, cpi, x, bsize,
  327|      0|                                         &ref_mv, start_mv, src_search_site_cfg,
  328|      0|                                         search_method, fine_search_interval);
  329|       |
  330|      0|      bestsme = av1_obmc_full_pixel_search(start_mv, &full_ms_params,
  331|      0|                                           step_param, &best_mv->as_fullmv);
  332|      0|      break;
  333|      0|    default: assert(0 && "Invalid motion mode!\n");
  ------------------
  |  Branch (333:5): [True: 0, False: 2.15M]
  ------------------
  334|  2.15M|  }
  335|  2.15M|  if (best_mv->as_int == INVALID_MV) return;
  ------------------
  |  |   26|  2.15M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (335:7): [True: 21.7k, False: 2.13M]
  ------------------
  336|       |
  337|  2.13M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (337:7): [True: 1.87M, False: 256k]
  ------------------
  338|       |    // Swap back the original buffers for subpel motion search.
  339|  5.52M|    for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (339:21): [True: 3.64M, False: 1.87M]
  ------------------
  340|  3.64M|      xd->plane[i].pre[ref_idx] = backup_yv12[i];
  341|  3.64M|    }
  342|  1.87M|  }
  343|       |
  344|       |  // Terminate search with the current ref_idx based on fullpel mv, rate cost,
  345|       |  // and other know cost.
  346|  2.13M|  if (cpi->sf.inter_sf.skip_newmv_in_drl >= 2 &&
  ------------------
  |  Branch (346:7): [True: 2.13M, False: 18.4E]
  ------------------
  347|  2.13M|      mbmi->motion_mode == SIMPLE_TRANSLATION &&
  ------------------
  |  Branch (347:7): [True: 2.13M, False: 18.4E]
  ------------------
  348|  2.13M|      best_mv->as_int != INVALID_MV) {
  ------------------
  |  |   26|  2.13M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (348:7): [True: 2.13M, False: 18.4E]
  ------------------
  349|  2.13M|    int_mv this_mv;
  350|  2.13M|    this_mv.as_mv = get_mv_from_fullmv(&best_mv->as_fullmv);
  351|  2.13M|    const int ref_mv_idx = mbmi->ref_mv_idx;
  352|  2.13M|    const int this_mv_rate =
  353|  2.13M|        av1_mv_bit_cost(&this_mv.as_mv, &ref_mv, mv_costs->nmv_joint_cost,
  354|  2.13M|                        mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|  2.13M|#define MV_COST_WEIGHT 108
  ------------------
  355|  2.13M|    mode_info[ref_mv_idx].full_search_mv.as_int = this_mv.as_int;
  356|  2.13M|    mode_info[ref_mv_idx].full_mv_rate = this_mv_rate;
  357|  2.13M|    mode_info[ref_mv_idx].full_mv_bestsme = bestsme;
  358|       |
  359|  2.27M|    for (int prev_ref_idx = 0; prev_ref_idx < ref_mv_idx; ++prev_ref_idx) {
  ------------------
  |  Branch (359:32): [True: 255k, False: 2.02M]
  ------------------
  360|       |      // Check if the motion search result same as previous results
  361|   255k|      if (this_mv.as_int == mode_info[prev_ref_idx].full_search_mv.as_int) {
  ------------------
  |  Branch (361:11): [True: 19.4k, False: 235k]
  ------------------
  362|       |        // Compare the rate cost
  363|  19.4k|        const int prev_rate_cost = mode_info[prev_ref_idx].full_mv_rate +
  364|  19.4k|                                   mode_info[prev_ref_idx].drl_cost;
  365|  19.4k|        const int this_rate_cost =
  366|  19.4k|            this_mv_rate + mode_info[ref_mv_idx].drl_cost;
  367|       |
  368|  19.4k|        if (prev_rate_cost <= this_rate_cost) {
  ------------------
  |  Branch (368:13): [True: 12.0k, False: 7.42k]
  ------------------
  369|       |          // If the current rate_cost is worse than the previous rate_cost, then
  370|       |          // we terminate the search. Since av1_single_motion_search is only
  371|       |          // called by handle_new_mv in SIMPLE_TRANSLATION mode, we set the
  372|       |          // best_mv to INVALID mv to signal that we wish to terminate search
  373|       |          // for the current mode.
  374|  12.0k|          best_mv->as_int = INVALID_MV;
  ------------------
  |  |   26|  12.0k|#define INVALID_MV 0x80008000
  ------------------
  375|  12.0k|          return;
  376|  12.0k|        }
  377|  19.4k|      }
  378|       |
  379|       |      // Terminate the evaluation of current ref_mv_idx based on bestsme and
  380|       |      // drl_cost.
  381|   243k|      const int psme = mode_info[prev_ref_idx].full_mv_bestsme;
  382|   243k|      if (psme == INT_MAX) continue;
  ------------------
  |  Branch (382:11): [True: 1.86k, False: 241k]
  ------------------
  383|   241k|      const int thr =
  384|   241k|          cpi->sf.inter_sf.skip_newmv_in_drl == 3 ? (psme + (psme >> 2)) : psme;
  ------------------
  |  Branch (384:11): [True: 0, False: 241k]
  ------------------
  385|   241k|      if (cpi->sf.inter_sf.skip_newmv_in_drl >= 3 &&
  ------------------
  |  Branch (385:11): [True: 241k, False: 18.4E]
  ------------------
  386|   241k|          mode_info[ref_mv_idx].full_mv_bestsme > thr &&
  ------------------
  |  Branch (386:11): [True: 116k, False: 124k]
  ------------------
  387|   116k|          mode_info[prev_ref_idx].drl_cost < mode_info[ref_mv_idx].drl_cost) {
  ------------------
  |  Branch (387:11): [True: 98.2k, False: 18.3k]
  ------------------
  388|  98.2k|        best_mv->as_int = INVALID_MV;
  ------------------
  |  |   26|  98.2k|#define INVALID_MV 0x80008000
  ------------------
  389|  98.2k|        return;
  390|  98.2k|      }
  391|   241k|    }
  392|  2.13M|  }
  393|       |
  394|  2.02M|  if (cpi->common.features.cur_frame_force_integer_mv) {
  ------------------
  |  Branch (394:7): [True: 0, False: 2.02M]
  ------------------
  395|      0|    convert_fullmv_to_mv(best_mv);
  396|      0|  }
  397|       |
  398|  2.02M|  const int use_fractional_mv =
  399|  2.02M|      bestsme < INT_MAX && cpi->common.features.cur_frame_force_integer_mv == 0;
  ------------------
  |  Branch (399:7): [True: 2.02M, False: 59]
  |  Branch (399:28): [True: 2.02M, False: 18.4E]
  ------------------
  400|  2.02M|  int best_mv_rate = 0;
  401|  2.02M|  int mv_rate_calculated = 0;
  402|  2.02M|  if (use_fractional_mv) {
  ------------------
  |  Branch (402:7): [True: 2.02M, False: 18.4E]
  ------------------
  403|  2.02M|    int_mv fractional_ms_list[3];
  404|  2.02M|    av1_set_fractional_mv(fractional_ms_list);
  405|  2.02M|    int dis; /* TODO: use dis in distortion calculation later. */
  406|       |
  407|  2.02M|    SUBPEL_MOTION_SEARCH_PARAMS ms_params;
  408|  2.02M|    av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize, &ref_mv,
  409|  2.02M|                                      cost_list);
  410|  2.02M|    MV subpel_start_mv = get_mv_from_fullmv(&best_mv->as_fullmv);
  411|  2.02M|    assert(av1_is_subpelmv_in_range(&ms_params.mv_limits, subpel_start_mv));
  412|       |
  413|  2.02M|    switch (mbmi->motion_mode) {
  414|  2.02M|      case SIMPLE_TRANSLATION:
  ------------------
  |  Branch (414:7): [True: 2.02M, False: 151]
  ------------------
  415|  2.02M|        if (mv_sf->use_accurate_subpel_search) {
  ------------------
  |  Branch (415:13): [True: 2.02M, False: 37]
  ------------------
  416|  2.02M|          const int try_second = second_best_mv.as_int != INVALID_MV &&
  ------------------
  |  |   26|  4.04M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (416:34): [True: 1.64M, False: 377k]
  ------------------
  417|  1.64M|                                 second_best_mv.as_int != best_mv->as_int &&
  ------------------
  |  Branch (417:34): [True: 1.62M, False: 19.0k]
  ------------------
  418|  1.62M|                                 (mv_sf->disable_second_mv <= 1);
  ------------------
  |  Branch (418:34): [True: 1.62M, False: 18.4E]
  ------------------
  419|  2.02M|          const int best_mv_var = mv_search_params->find_fractional_mv_step(
  420|  2.02M|              xd, cm, &ms_params, subpel_start_mv, &best_mv_stats,
  421|  2.02M|              &best_mv->as_mv, &dis, &x->pred_sse[ref], fractional_ms_list);
  422|       |
  423|  2.02M|          if (try_second) {
  ------------------
  |  Branch (423:15): [True: 1.62M, False: 396k]
  ------------------
  424|  1.62M|            struct macroblockd_plane *p = xd->plane;
  425|  1.62M|            const BUFFER_SET orig_dst = {
  426|  1.62M|              { p[0].dst.buf, p[1].dst.buf, p[2].dst.buf },
  427|  1.62M|              { p[0].dst.stride, p[1].dst.stride, p[2].dst.stride },
  428|  1.62M|            };
  429|       |
  430|  1.62M|            MV this_best_mv;
  431|  1.62M|            subpel_start_mv = get_mv_from_fullmv(&second_best_mv.as_fullmv);
  432|  1.62M|            if (av1_is_subpelmv_in_range(&ms_params.mv_limits,
  ------------------
  |  Branch (432:17): [True: 1.62M, False: 18.4E]
  ------------------
  433|  1.62M|                                         subpel_start_mv)) {
  434|  1.62M|              unsigned int sse;
  435|  1.62M|              const int this_var = mv_search_params->find_fractional_mv_step(
  436|  1.62M|                  xd, cm, &ms_params, subpel_start_mv, NULL, &this_best_mv,
  437|  1.62M|                  &dis, &sse, fractional_ms_list);
  438|       |
  439|       |              // If cpi->sf.mv_sf.disable_second_mv is 0 and both MVs are valid,
  440|       |              // use actual rd cost to choose the better MV.
  441|  1.62M|              if (!mv_sf->disable_second_mv && this_var != INT32_MAX) {
  ------------------
  |  Branch (441:19): [True: 0, False: 1.62M]
  |  Branch (441:48): [True: 0, False: 0]
  ------------------
  442|       |                // Calculate rd cost of first MV.
  443|      0|                mbmi->mv[0].as_mv = best_mv->as_mv;
  444|      0|                av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, &orig_dst,
  445|      0|                                              bsize, 0, 0);
  446|      0|                RD_STATS this_rd_stats;
  447|      0|                av1_init_rd_stats(&this_rd_stats);
  448|      0|                av1_estimate_txfm_yrd(cpi, x, &this_rd_stats, INT64_MAX, bsize,
  449|      0|                                      max_txsize_rect_lookup[bsize]);
  450|      0|                int this_mv_rate = av1_mv_bit_cost(
  451|      0|                    &best_mv->as_mv, &ref_mv, mv_costs->nmv_joint_cost,
  452|      0|                    mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
  453|      0|                const int64_t rd =
  454|      0|                    RDCOST(x->rdmult, this_mv_rate + this_rd_stats.rate,
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  455|      0|                           this_rd_stats.dist);
  456|       |
  457|       |                // Calculate rd cost of second MV.
  458|      0|                mbmi->mv[0].as_mv = this_best_mv;
  459|      0|                av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, &orig_dst,
  460|      0|                                              bsize, 0, 0);
  461|      0|                RD_STATS tmp_rd_stats;
  462|      0|                av1_init_rd_stats(&tmp_rd_stats);
  463|      0|                av1_estimate_txfm_yrd(cpi, x, &tmp_rd_stats, INT64_MAX, bsize,
  464|      0|                                      max_txsize_rect_lookup[bsize]);
  465|      0|                int tmp_mv_rate = av1_mv_bit_cost(
  466|      0|                    &this_best_mv, &ref_mv, mv_costs->nmv_joint_cost,
  467|      0|                    mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
  468|      0|                int64_t tmp_rd =
  469|      0|                    RDCOST(x->rdmult, tmp_rd_stats.rate + tmp_mv_rate,
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  470|      0|                           tmp_rd_stats.dist);
  471|      0|                if (tmp_rd < rd) {
  ------------------
  |  Branch (471:21): [True: 0, False: 0]
  ------------------
  472|      0|                  best_mv->as_mv = this_best_mv;
  473|      0|                  x->pred_sse[ref] = sse;
  474|      0|                }
  475|  1.62M|              } else {
  476|       |                // If cpi->sf.mv_sf.disable_second_mv = 1, use var to decide the
  477|       |                // best MV.
  478|  1.62M|                if (this_var < best_mv_var) {
  ------------------
  |  Branch (478:21): [True: 92.0k, False: 1.53M]
  ------------------
  479|  92.0k|                  best_mv->as_mv = this_best_mv;
  480|  92.0k|                  x->pred_sse[ref] = sse;
  481|  92.0k|                }
  482|  1.62M|              }
  483|  1.62M|            }
  484|  1.62M|          }
  485|  2.02M|        } else {
  486|     37|          mv_search_params->find_fractional_mv_step(
  487|     37|              xd, cm, &ms_params, subpel_start_mv, &best_mv_stats,
  488|     37|              &best_mv->as_mv, &dis, &x->pred_sse[ref], NULL);
  489|     37|        }
  490|  2.02M|        break;
  491|      0|      case OBMC_CAUSAL:
  ------------------
  |  Branch (491:7): [True: 0, False: 2.02M]
  ------------------
  492|      0|        av1_find_best_obmc_sub_pixel_tree_up(
  493|      0|            xd, cm, &ms_params, subpel_start_mv, NULL, &best_mv->as_mv, &dis,
  494|      0|            &x->pred_sse[ref], NULL);
  495|      0|        break;
  496|      0|      default: assert(0 && "Invalid motion mode!\n");
  ------------------
  |  Branch (496:7): [True: 0, False: 2.02M]
  ------------------
  497|  2.02M|    }
  498|       |
  499|       |    // Terminate search with the current ref_idx based on subpel mv and rate
  500|       |    // cost.
  501|  2.02M|    if (cpi->sf.inter_sf.skip_newmv_in_drl >= 1 && args != NULL &&
  ------------------
  |  Branch (501:9): [True: 2.02M, False: 100]
  |  Branch (501:52): [True: 2.02M, False: 18.4E]
  ------------------
  502|  2.02M|        mbmi->motion_mode == SIMPLE_TRANSLATION &&
  ------------------
  |  Branch (502:9): [True: 2.02M, False: 18.4E]
  ------------------
  503|  2.02M|        best_mv->as_int != INVALID_MV) {
  ------------------
  |  |   26|  2.02M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (503:9): [True: 2.02M, False: 18.4E]
  ------------------
  504|  2.02M|      const int ref_mv_idx = mbmi->ref_mv_idx;
  505|  2.02M|      best_mv_rate =
  506|  2.02M|          av1_mv_bit_cost(&best_mv->as_mv, &ref_mv, mv_costs->nmv_joint_cost,
  507|  2.02M|                          mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|  2.02M|#define MV_COST_WEIGHT 108
  ------------------
  508|  2.02M|      mv_rate_calculated = 1;
  509|       |
  510|  2.15M|      for (int prev_ref_idx = 0; prev_ref_idx < ref_mv_idx; ++prev_ref_idx) {
  ------------------
  |  Branch (510:34): [True: 136k, False: 2.01M]
  ------------------
  511|   136k|        if (!args->single_newmv_valid[prev_ref_idx][ref]) continue;
  ------------------
  |  Branch (511:13): [True: 9.58k, False: 126k]
  ------------------
  512|       |        // Check if the motion vectors are the same.
  513|   126k|        if (best_mv->as_int == args->single_newmv[prev_ref_idx][ref].as_int) {
  ------------------
  |  Branch (513:13): [True: 5.94k, False: 120k]
  ------------------
  514|       |          // Skip this evaluation if the previous one is skipped.
  515|  5.94k|          if (mode_info[prev_ref_idx].skip) {
  ------------------
  |  Branch (515:15): [True: 9, False: 5.93k]
  ------------------
  516|      9|            mode_info[ref_mv_idx].skip = 1;
  517|      9|            break;
  518|      9|          }
  519|       |          // Compare the rate cost that we current know.
  520|  5.93k|          const int prev_rate_cost =
  521|  5.93k|              args->single_newmv_rate[prev_ref_idx][ref] +
  522|  5.93k|              mode_info[prev_ref_idx].drl_cost;
  523|  5.93k|          const int this_rate_cost =
  524|  5.93k|              best_mv_rate + mode_info[ref_mv_idx].drl_cost;
  525|       |
  526|  5.93k|          if (prev_rate_cost <= this_rate_cost) {
  ------------------
  |  Branch (526:15): [True: 1.16k, False: 4.77k]
  ------------------
  527|       |            // If the current rate_cost is worse than the previous rate_cost,
  528|       |            // then we terminate the search for this ref_mv_idx.
  529|  1.16k|            mode_info[ref_mv_idx].skip = 1;
  530|  1.16k|            break;
  531|  1.16k|          }
  532|  5.93k|        }
  533|   126k|      }
  534|  2.02M|    }
  535|  2.02M|  }
  536|       |
  537|  2.02M|  if (mv_rate_calculated) {
  ------------------
  |  Branch (537:7): [True: 2.02M, False: 18.4E]
  ------------------
  538|  2.02M|    *rate_mv = best_mv_rate;
  539|  18.4E|  } else {
  540|  18.4E|    *rate_mv =
  541|  18.4E|        av1_mv_bit_cost(&best_mv->as_mv, &ref_mv, mv_costs->nmv_joint_cost,
  542|  18.4E|                        mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|  18.4E|#define MV_COST_WEIGHT 108
  ------------------
  543|  18.4E|  }
  544|  2.02M|}
av1_simple_motion_search_sse_var:
 1020|  3.00M|                                        unsigned int *var) {
 1021|  3.00M|  assert(num_planes == 1 &&
 1022|  3.00M|         "Currently simple_motion_search only supports luma plane");
 1023|  3.00M|  assert(!frame_is_intra_only(&cpi->common) &&
 1024|  3.00M|         "Simple motion search only enabled for non-key frames");
 1025|  3.00M|  AV1_COMMON *const cm = &cpi->common;
 1026|  3.00M|  MACROBLOCKD *xd = &x->e_mbd;
 1027|       |
 1028|  3.00M|  set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize);
 1029|       |
 1030|  3.00M|  MB_MODE_INFO *mbmi = xd->mi[0];
 1031|  3.00M|  mbmi->bsize = bsize;
 1032|  3.00M|  mbmi->ref_frame[0] = ref;
 1033|  3.00M|  mbmi->ref_frame[1] = NONE_FRAME;
 1034|  3.00M|  mbmi->motion_mode = SIMPLE_TRANSLATION;
 1035|  3.00M|  mbmi->interp_filters = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
 1036|       |
 1037|  3.00M|  const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_yv12_buf(cm, ref);
 1038|  3.00M|  const YV12_BUFFER_CONFIG *scaled_ref_frame =
 1039|  3.00M|      av1_get_scaled_ref_frame(cpi, ref);
 1040|  3.00M|  struct buf_2d backup_yv12;
 1041|       |  // ref_mv is used to calculate the cost of the motion vector
 1042|  3.00M|  const MV ref_mv = kZeroMv;
 1043|  3.00M|  const int step_param =
 1044|  3.00M|      AOMMIN(cpi->mv_search_params.mv_step_param +
  ------------------
  |  |   34|  3.00M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 953k, False: 2.05M]
  |  |  ------------------
  ------------------
 1045|  3.00M|                 cpi->sf.part_sf.simple_motion_search_reduce_search_steps,
 1046|  3.00M|             MAX_MVSEARCH_STEPS - 2);
 1047|  3.00M|  int cost_list[5];
 1048|  3.00M|  const int ref_idx = 0;
 1049|  3.00M|  int bestsme;
 1050|  3.00M|  int_mv best_mv;
 1051|  3.00M|  FULLPEL_MV_STATS best_mv_stats;
 1052|       |
 1053|  3.00M|  av1_setup_pre_planes(xd, ref_idx, yv12, mi_row, mi_col,
 1054|  3.00M|                       get_ref_scale_factors(cm, ref), num_planes);
 1055|  3.00M|  set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 1056|  3.00M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (1056:7): [True: 2.62M, False: 378k]
  ------------------
 1057|  2.62M|    backup_yv12 = xd->plane[AOM_PLANE_Y].pre[ref_idx];
  ------------------
  |  |  281|  2.62M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1058|  2.62M|    av1_setup_pre_planes(xd, ref_idx, scaled_ref_frame, mi_row, mi_col, NULL,
 1059|  2.62M|                         num_planes);
 1060|  2.62M|  }
 1061|       |
 1062|       |  // Allow more mesh searches for screen content type on the ARF.
 1063|  3.00M|  const int fine_search_interval = use_fine_search_interval(cpi);
 1064|  3.00M|  FULLPEL_MOTION_SEARCH_PARAMS full_ms_params;
 1065|  3.00M|  const MV_SPEED_FEATURES *mv_sf = &cpi->sf.mv_sf;
 1066|  3.00M|  const SEARCH_METHODS search_method =
 1067|  3.00M|      av1_get_default_mv_search_method(x, mv_sf, bsize);
 1068|  3.00M|  const search_site_config *src_search_sites =
 1069|  3.00M|      av1_get_search_site_config(cpi, x, search_method);
 1070|  3.00M|  av1_make_default_fullpel_ms_params(&full_ms_params, cpi, x, bsize, &ref_mv,
 1071|  3.00M|                                     start_mv, src_search_sites, search_method,
 1072|  3.00M|                                     fine_search_interval);
 1073|       |
 1074|  3.00M|  bestsme = av1_full_pixel_search(start_mv, &full_ms_params, step_param,
 1075|  3.00M|                                  cond_cost_list(cpi, cost_list),
 1076|  3.00M|                                  &best_mv.as_fullmv, &best_mv_stats, NULL);
 1077|       |
 1078|  3.00M|  const int use_subpel_search =
 1079|  3.00M|      bestsme < INT_MAX && !cpi->common.features.cur_frame_force_integer_mv &&
  ------------------
  |  Branch (1079:7): [True: 3.00M, False: 18.4E]
  |  Branch (1079:28): [True: 3.00M, False: 18.4E]
  ------------------
 1080|  3.00M|      use_subpixel &&
  ------------------
  |  Branch (1080:7): [True: 3.00M, False: 18.4E]
  ------------------
 1081|  3.00M|      (cpi->sf.mv_sf.simple_motion_subpel_force_stop != FULL_PEL);
  ------------------
  |  Branch (1081:7): [True: 0, False: 3.00M]
  ------------------
 1082|  3.00M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (1082:7): [True: 2.62M, False: 377k]
  ------------------
 1083|  2.62M|    xd->plane[AOM_PLANE_Y].pre[ref_idx] = backup_yv12;
  ------------------
  |  |  281|  2.62M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1084|  2.62M|  }
 1085|  3.00M|  if (use_subpel_search) {
  ------------------
  |  Branch (1085:7): [True: 0, False: 3.00M]
  ------------------
 1086|      0|    int not_used = 0;
 1087|       |
 1088|      0|    SUBPEL_MOTION_SEARCH_PARAMS ms_params;
 1089|      0|    av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize, &ref_mv,
 1090|      0|                                      cost_list);
 1091|       |    // TODO(yunqing): integrate this into av1_make_default_subpel_ms_params().
 1092|      0|    ms_params.forced_stop = mv_sf->simple_motion_subpel_force_stop;
 1093|       |
 1094|      0|    MV subpel_start_mv = get_mv_from_fullmv(&best_mv.as_fullmv);
 1095|      0|    assert(av1_is_subpelmv_in_range(&ms_params.mv_limits, subpel_start_mv));
 1096|       |
 1097|      0|    cpi->mv_search_params.find_fractional_mv_step(
 1098|      0|        xd, cm, &ms_params, subpel_start_mv, &best_mv_stats, &best_mv.as_mv,
 1099|      0|        &not_used, &x->pred_sse[ref], NULL);
 1100|       |
 1101|      0|    mbmi->mv[0] = best_mv;
 1102|       |
 1103|       |    // Get a copy of the prediction output
 1104|      0|    av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1105|      0|                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1106|      0|    *var = cpi->ppi->fn_ptr[bsize].vf(
 1107|      0|        x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].dst.buf,
 1108|      0|        xd->plane[0].dst.stride, sse);
 1109|  3.00M|  } else {
 1110|       |    // Manually convert from units of pixel to 1/8-pixels if we are not doing
 1111|       |    // subpel search
 1112|  3.00M|    convert_fullmv_to_mv(&best_mv);
 1113|  3.00M|    *var = best_mv_stats.distortion;
 1114|  3.00M|    *sse = best_mv_stats.sse;
 1115|  3.00M|  }
 1116|       |
 1117|  3.00M|  return best_mv;
 1118|  3.00M|}
motion_search_facade.c:get_mv_candidate_from_tpl:
   52|  2.15M|                                             int *total_cand_weight) {
   53|  2.15M|  const SuperBlockEnc *sb_enc = &x->sb_enc;
   54|  2.15M|  if (!sb_enc->tpl_data_count) {
  ------------------
  |  Branch (54:7): [True: 2.15M, False: 18.4E]
  ------------------
   55|  2.15M|    return;
   56|  2.15M|  }
   57|       |
   58|  18.4E|  const AV1_COMMON *cm = &cpi->common;
   59|  18.4E|  const MACROBLOCKD *xd = &x->e_mbd;
   60|  18.4E|  const int mi_row = xd->mi_row;
   61|  18.4E|  const int mi_col = xd->mi_col;
   62|       |
   63|  18.4E|  const BLOCK_SIZE tpl_bsize =
   64|  18.4E|      convert_length_to_bsize(cpi->ppi->tpl_data.tpl_bsize_1d);
   65|  18.4E|  const int tplw = mi_size_wide[tpl_bsize];
   66|  18.4E|  const int tplh = mi_size_high[tpl_bsize];
   67|  18.4E|  const int nw = mi_size_wide[bsize] / tplw;
   68|  18.4E|  const int nh = mi_size_high[bsize] / tplh;
   69|       |
   70|  18.4E|  if (nw >= 1 && nh >= 1) {
  ------------------
  |  Branch (70:7): [True: 0, False: 18.4E]
  |  Branch (70:18): [True: 0, False: 0]
  ------------------
   71|      0|    const int of_h = mi_row % mi_size_high[cm->seq_params->sb_size];
   72|      0|    const int of_w = mi_col % mi_size_wide[cm->seq_params->sb_size];
   73|      0|    const int start = of_h / tplh * sb_enc->tpl_stride + of_w / tplw;
   74|      0|    int valid = 1;
   75|       |
   76|       |    // Assign large weight to start_mv, so it is always tested.
   77|      0|    cand[0].weight = nw * nh;
   78|       |
   79|      0|    for (int k = 0; k < nh; k++) {
  ------------------
  |  Branch (79:21): [True: 0, False: 0]
  ------------------
   80|      0|      for (int l = 0; l < nw; l++) {
  ------------------
  |  Branch (80:23): [True: 0, False: 0]
  ------------------
   81|      0|        const int_mv mv =
   82|      0|            sb_enc
   83|      0|                ->tpl_mv[start + k * sb_enc->tpl_stride + l][ref - LAST_FRAME];
   84|      0|        if (mv.as_int == INVALID_MV) {
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          valid = 0;
   86|      0|          break;
   87|      0|        }
   88|       |
   89|      0|        const FULLPEL_MV fmv = { GET_MV_RAWPEL(mv.as_mv.row),
  ------------------
  |  |   28|      0|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   90|      0|                                 GET_MV_RAWPEL(mv.as_mv.col) };
  ------------------
  |  |   28|      0|#define GET_MV_RAWPEL(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   91|      0|        int unique = 1;
   92|      0|        for (int m = 0; m < *cand_count; m++) {
  ------------------
  |  Branch (92:25): [True: 0, False: 0]
  ------------------
   93|      0|          if (RIGHT_SHIFT_MV(fmv.row) ==
  ------------------
  |  |   24|      0|#define RIGHT_SHIFT_MV(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
  |  Branch (93:15): [True: 0, False: 0]
  ------------------
   94|      0|                  RIGHT_SHIFT_MV(cand[m].fmv.as_fullmv.row) &&
  ------------------
  |  |   24|      0|#define RIGHT_SHIFT_MV(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   95|      0|              RIGHT_SHIFT_MV(fmv.col) ==
  ------------------
  |  |   24|      0|#define RIGHT_SHIFT_MV(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
  |  Branch (95:15): [True: 0, False: 0]
  ------------------
   96|      0|                  RIGHT_SHIFT_MV(cand[m].fmv.as_fullmv.col)) {
  ------------------
  |  |   24|      0|#define RIGHT_SHIFT_MV(x) (((x) + 3 + ((x) >= 0)) >> 3)
  ------------------
   97|      0|            unique = 0;
   98|      0|            cand[m].weight++;
   99|      0|            break;
  100|      0|          }
  101|      0|        }
  102|       |
  103|      0|        if (unique) {
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|          cand[*cand_count].fmv.as_fullmv = fmv;
  105|      0|          cand[*cand_count].weight = 1;
  106|      0|          (*cand_count)++;
  107|      0|        }
  108|      0|      }
  109|      0|      if (!valid) break;
  ------------------
  |  Branch (109:11): [True: 0, False: 0]
  ------------------
  110|      0|    }
  111|       |
  112|      0|    if (valid) {
  ------------------
  |  Branch (112:9): [True: 0, False: 0]
  ------------------
  113|      0|      *total_cand_weight = 2 * nh * nw;
  114|      0|      if (*cand_count > 2)
  ------------------
  |  Branch (114:11): [True: 0, False: 0]
  ------------------
  115|      0|        qsort(cand, *cand_count, sizeof(cand[0]), &compare_weight);
  116|      0|    }
  117|      0|  }
  118|  18.4E|}
motion_search_facade.c:use_fine_search_interval:
   41|  5.15M|static int use_fine_search_interval(const AV1_COMP *const cpi) {
   42|  5.15M|  return cpi->is_screen_content_type &&
  ------------------
  |  Branch (42:10): [True: 1.01M, False: 4.14M]
  ------------------
   43|  1.01M|         cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == ARF_UPDATE &&
  ------------------
  |  Branch (43:10): [True: 0, False: 1.01M]
  ------------------
   44|      0|         cpi->oxcf.speed <= 2;
  ------------------
  |  Branch (44:10): [True: 0, False: 0]
  ------------------
   45|  5.15M|}

rdopt.c:av1_get_default_mv_search_method:
  120|  72.2k|    const MACROBLOCK *x, const MV_SPEED_FEATURES *mv_sf, BLOCK_SIZE bsize) {
  121|  72.2k|  SEARCH_METHODS search_method = mv_sf->search_method;
  122|  72.2k|  const int sf_blk_search_method = mv_sf->use_bsize_dependent_search_method;
  123|  72.2k|  const int min_dim = AOMMIN(block_size_wide[bsize], block_size_high[bsize]);
  ------------------
  |  |   34|  72.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.1k, False: 60.0k]
  |  |  ------------------
  ------------------
  124|  72.2k|  const int qband = x->qindex >> (QINDEX_BITS - 2);
  ------------------
  |  |   28|  72.2k|#define QINDEX_BITS 8
  ------------------
  125|  72.2k|  const int min_dim_th[4] = { 128, 64, 32, 16 };
  126|  72.2k|  bool use_faster_search_method = false;
  127|       |
  128|  72.2k|  if (sf_blk_search_method >= 1 && sf_blk_search_method <= 3) {
  ------------------
  |  Branch (128:7): [True: 72.2k, False: 18.4E]
  |  Branch (128:36): [True: 72.2k, False: 18.4E]
  ------------------
  129|  72.2k|    use_faster_search_method =
  130|  72.2k|        (min_dim >= min_dim_th[sf_blk_search_method - 1]);
  131|  18.4E|  } else if (sf_blk_search_method == 4) {
  ------------------
  |  Branch (131:14): [True: 0, False: 18.4E]
  ------------------
  132|      0|    use_faster_search_method =
  133|      0|        (min_dim >= min_dim_th[sf_blk_search_method - 1] &&
  ------------------
  |  Branch (133:10): [True: 0, False: 0]
  ------------------
  134|      0|         x->content_state_sb.source_sad_nonrd <= kMedSad && qband < 3);
  ------------------
  |  Branch (134:10): [True: 0, False: 0]
  |  Branch (134:61): [True: 0, False: 0]
  ------------------
  135|      0|  }
  136|       |
  137|  72.2k|  if (use_faster_search_method) {
  ------------------
  |  Branch (137:7): [True: 10, False: 72.2k]
  ------------------
  138|     10|    search_method = av1_get_faster_search_method(search_method);
  139|     10|  }
  140|  72.2k|  return search_method;
  141|  72.2k|}
rdopt.c:av1_get_faster_search_method:
   98|     10|    SEARCH_METHODS search_method) {
   99|       |  // Note on search method's accuracy:
  100|       |  //  1. NSTEP
  101|       |  //  2. DIAMOND
  102|       |  //  3. BIGDIA
  103|       |  //  4. HEX
  104|       |  //  5. FAST_DIAMOND
  105|     10|  switch (search_method) {
  106|      0|    case NSTEP: return DIAMOND;
  ------------------
  |  Branch (106:5): [True: 0, False: 10]
  ------------------
  107|      0|    case NSTEP_8PT: return DIAMOND;
  ------------------
  |  Branch (107:5): [True: 0, False: 10]
  ------------------
  108|     10|    case DIAMOND: return BIGDIA;
  ------------------
  |  Branch (108:5): [True: 10, False: 0]
  ------------------
  109|      0|    case CLAMPED_DIAMOND: return BIGDIA;
  ------------------
  |  Branch (109:5): [True: 0, False: 10]
  ------------------
  110|      0|    case BIGDIA: return HEX;
  ------------------
  |  Branch (110:5): [True: 0, False: 10]
  ------------------
  111|      0|    case HEX: return FAST_DIAMOND;
  ------------------
  |  Branch (111:5): [True: 0, False: 10]
  ------------------
  112|      0|    case FAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (112:5): [True: 0, False: 10]
  ------------------
  113|      0|    case FAST_BIGDIA: return FAST_BIGDIA;
  ------------------
  |  Branch (113:5): [True: 0, False: 10]
  ------------------
  114|      0|    case VFAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (114:5): [True: 0, False: 10]
  ------------------
  115|      0|    default: assert(0 && "Invalid search method!"); return DIAMOND;
  ------------------
  |  Branch (115:5): [True: 0, False: 10]
  ------------------
  116|     10|  }
  117|     10|}
rdopt.c:av1_get_search_site_config:
   69|  72.2k|    const AV1_COMP *cpi, MACROBLOCK *x, SEARCH_METHODS search_method) {
   70|  72.2k|  const int ref_stride = x->e_mbd.plane[0].pre[0].stride;
   71|       |
   72|       |  // AV1_COMP::mv_search_params.search_site_config is a compressor level cache
   73|       |  // that's shared by multiple threads. In most cases where all frames have the
   74|       |  // same resolution, the cache contains the search site config that we need.
   75|  72.2k|  const MotionVectorSearchParams *mv_search_params = &cpi->mv_search_params;
   76|  72.2k|  if (ref_stride == mv_search_params->search_site_cfg[SS_CFG_SRC]->stride) {
  ------------------
  |  Branch (76:7): [True: 72.2k, False: 18.4E]
  ------------------
   77|  72.2k|    return mv_search_params->search_site_cfg[SS_CFG_SRC];
   78|  18.4E|  } else if (ref_stride ==
  ------------------
  |  Branch (78:14): [True: 0, False: 18.4E]
  ------------------
   79|  18.4E|             mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD]->stride) {
   80|      0|    return mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD];
   81|      0|  }
   82|       |
   83|       |  // If the cache does not contain the correct stride, then we will need to rely
   84|       |  // on the thread level config MACROBLOCK::search_site_cfg_buf. If even the
   85|       |  // thread level config doesn't match, then we need to update it.
   86|  18.4E|  search_method = search_method_lookup[search_method];
   87|  18.4E|  assert(search_method_lookup[search_method] == search_method &&
   88|  18.4E|         "The search_method_lookup table should be idempotent.");
   89|  18.4E|  if (ref_stride != x->search_site_cfg_buf[search_method].stride) {
  ------------------
  |  Branch (89:7): [True: 0, False: 18.4E]
  ------------------
   90|      0|    av1_refresh_search_site_config(x->search_site_cfg_buf, search_method,
   91|      0|                                   ref_stride);
   92|      0|  }
   93|       |
   94|  18.4E|  return x->search_site_cfg_buf;
   95|  72.2k|}
nonrd_pickmode.c:av1_get_default_mv_search_method:
  120|   597k|    const MACROBLOCK *x, const MV_SPEED_FEATURES *mv_sf, BLOCK_SIZE bsize) {
  121|   597k|  SEARCH_METHODS search_method = mv_sf->search_method;
  122|   597k|  const int sf_blk_search_method = mv_sf->use_bsize_dependent_search_method;
  123|   597k|  const int min_dim = AOMMIN(block_size_wide[bsize], block_size_high[bsize]);
  ------------------
  |  |   34|   597k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.7k, False: 585k]
  |  |  ------------------
  ------------------
  124|   597k|  const int qband = x->qindex >> (QINDEX_BITS - 2);
  ------------------
  |  |   28|   597k|#define QINDEX_BITS 8
  ------------------
  125|   597k|  const int min_dim_th[4] = { 128, 64, 32, 16 };
  126|   597k|  bool use_faster_search_method = false;
  127|       |
  128|   597k|  if (sf_blk_search_method >= 1 && sf_blk_search_method <= 3) {
  ------------------
  |  Branch (128:7): [True: 231k, False: 366k]
  |  Branch (128:36): [True: 0, False: 231k]
  ------------------
  129|      0|    use_faster_search_method =
  130|      0|        (min_dim >= min_dim_th[sf_blk_search_method - 1]);
  131|   597k|  } else if (sf_blk_search_method == 4) {
  ------------------
  |  Branch (131:14): [True: 231k, False: 366k]
  ------------------
  132|   231k|    use_faster_search_method =
  133|   231k|        (min_dim >= min_dim_th[sf_blk_search_method - 1] &&
  ------------------
  |  Branch (133:10): [True: 20.5k, False: 210k]
  ------------------
  134|  20.5k|         x->content_state_sb.source_sad_nonrd <= kMedSad && qband < 3);
  ------------------
  |  Branch (134:10): [True: 11.7k, False: 8.75k]
  |  Branch (134:61): [True: 1.38k, False: 10.3k]
  ------------------
  135|   231k|  }
  136|       |
  137|   597k|  if (use_faster_search_method) {
  ------------------
  |  Branch (137:7): [True: 1.38k, False: 596k]
  ------------------
  138|  1.38k|    search_method = av1_get_faster_search_method(search_method);
  139|  1.38k|  }
  140|   597k|  return search_method;
  141|   597k|}
nonrd_pickmode.c:av1_get_faster_search_method:
   98|  1.38k|    SEARCH_METHODS search_method) {
   99|       |  // Note on search method's accuracy:
  100|       |  //  1. NSTEP
  101|       |  //  2. DIAMOND
  102|       |  //  3. BIGDIA
  103|       |  //  4. HEX
  104|       |  //  5. FAST_DIAMOND
  105|  1.38k|  switch (search_method) {
  106|      0|    case NSTEP: return DIAMOND;
  ------------------
  |  Branch (106:5): [True: 0, False: 1.38k]
  ------------------
  107|      0|    case NSTEP_8PT: return DIAMOND;
  ------------------
  |  Branch (107:5): [True: 0, False: 1.38k]
  ------------------
  108|      0|    case DIAMOND: return BIGDIA;
  ------------------
  |  Branch (108:5): [True: 0, False: 1.38k]
  ------------------
  109|      0|    case CLAMPED_DIAMOND: return BIGDIA;
  ------------------
  |  Branch (109:5): [True: 0, False: 1.38k]
  ------------------
  110|      0|    case BIGDIA: return HEX;
  ------------------
  |  Branch (110:5): [True: 0, False: 1.38k]
  ------------------
  111|      0|    case HEX: return FAST_DIAMOND;
  ------------------
  |  Branch (111:5): [True: 0, False: 1.38k]
  ------------------
  112|  1.38k|    case FAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (112:5): [True: 1.38k, False: 18.4E]
  ------------------
  113|      0|    case FAST_BIGDIA: return FAST_BIGDIA;
  ------------------
  |  Branch (113:5): [True: 0, False: 1.38k]
  ------------------
  114|      0|    case VFAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (114:5): [True: 0, False: 1.38k]
  ------------------
  115|      0|    default: assert(0 && "Invalid search method!"); return DIAMOND;
  ------------------
  |  Branch (115:5): [True: 0, False: 1.38k]
  ------------------
  116|  1.38k|  }
  117|  1.38k|}
nonrd_pickmode.c:av1_get_search_site_config:
   69|   597k|    const AV1_COMP *cpi, MACROBLOCK *x, SEARCH_METHODS search_method) {
   70|   597k|  const int ref_stride = x->e_mbd.plane[0].pre[0].stride;
   71|       |
   72|       |  // AV1_COMP::mv_search_params.search_site_config is a compressor level cache
   73|       |  // that's shared by multiple threads. In most cases where all frames have the
   74|       |  // same resolution, the cache contains the search site config that we need.
   75|   597k|  const MotionVectorSearchParams *mv_search_params = &cpi->mv_search_params;
   76|   597k|  if (ref_stride == mv_search_params->search_site_cfg[SS_CFG_SRC]->stride) {
  ------------------
  |  Branch (76:7): [True: 577k, False: 20.7k]
  ------------------
   77|   577k|    return mv_search_params->search_site_cfg[SS_CFG_SRC];
   78|   577k|  } else if (ref_stride ==
  ------------------
  |  Branch (78:14): [True: 0, False: 20.7k]
  ------------------
   79|  20.7k|             mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD]->stride) {
   80|      0|    return mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD];
   81|      0|  }
   82|       |
   83|       |  // If the cache does not contain the correct stride, then we will need to rely
   84|       |  // on the thread level config MACROBLOCK::search_site_cfg_buf. If even the
   85|       |  // thread level config doesn't match, then we need to update it.
   86|  20.7k|  search_method = search_method_lookup[search_method];
   87|  20.7k|  assert(search_method_lookup[search_method] == search_method &&
   88|  20.7k|         "The search_method_lookup table should be idempotent.");
   89|  20.7k|  if (ref_stride != x->search_site_cfg_buf[search_method].stride) {
  ------------------
  |  Branch (89:7): [True: 1.80k, False: 18.9k]
  ------------------
   90|  1.80k|    av1_refresh_search_site_config(x->search_site_cfg_buf, search_method,
   91|  1.80k|                                   ref_stride);
   92|  1.80k|  }
   93|       |
   94|  20.7k|  return x->search_site_cfg_buf;
   95|   597k|}
motion_search_facade.c:av1_get_default_mv_search_method:
  120|  5.15M|    const MACROBLOCK *x, const MV_SPEED_FEATURES *mv_sf, BLOCK_SIZE bsize) {
  121|  5.15M|  SEARCH_METHODS search_method = mv_sf->search_method;
  122|  5.15M|  const int sf_blk_search_method = mv_sf->use_bsize_dependent_search_method;
  123|  5.15M|  const int min_dim = AOMMIN(block_size_wide[bsize], block_size_high[bsize]);
  ------------------
  |  |   34|  5.15M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 396k, False: 4.76M]
  |  |  ------------------
  ------------------
  124|  5.15M|  const int qband = x->qindex >> (QINDEX_BITS - 2);
  ------------------
  |  |   28|  5.15M|#define QINDEX_BITS 8
  ------------------
  125|  5.15M|  const int min_dim_th[4] = { 128, 64, 32, 16 };
  126|  5.15M|  bool use_faster_search_method = false;
  127|       |
  128|  5.15M|  if (sf_blk_search_method >= 1 && sf_blk_search_method <= 3) {
  ------------------
  |  Branch (128:7): [True: 5.15M, False: 18.4E]
  |  Branch (128:36): [True: 5.15M, False: 18.4E]
  ------------------
  129|  5.15M|    use_faster_search_method =
  130|  5.15M|        (min_dim >= min_dim_th[sf_blk_search_method - 1]);
  131|  18.4E|  } else if (sf_blk_search_method == 4) {
  ------------------
  |  Branch (131:14): [True: 0, False: 18.4E]
  ------------------
  132|      0|    use_faster_search_method =
  133|      0|        (min_dim >= min_dim_th[sf_blk_search_method - 1] &&
  ------------------
  |  Branch (133:10): [True: 0, False: 0]
  ------------------
  134|      0|         x->content_state_sb.source_sad_nonrd <= kMedSad && qband < 3);
  ------------------
  |  Branch (134:10): [True: 0, False: 0]
  |  Branch (134:61): [True: 0, False: 0]
  ------------------
  135|      0|  }
  136|       |
  137|  5.15M|  if (use_faster_search_method) {
  ------------------
  |  Branch (137:7): [True: 53.8k, False: 5.10M]
  ------------------
  138|  53.8k|    search_method = av1_get_faster_search_method(search_method);
  139|  53.8k|  }
  140|  5.15M|  return search_method;
  141|  5.15M|}
motion_search_facade.c:av1_get_faster_search_method:
   98|  53.8k|    SEARCH_METHODS search_method) {
   99|       |  // Note on search method's accuracy:
  100|       |  //  1. NSTEP
  101|       |  //  2. DIAMOND
  102|       |  //  3. BIGDIA
  103|       |  //  4. HEX
  104|       |  //  5. FAST_DIAMOND
  105|  53.8k|  switch (search_method) {
  106|      0|    case NSTEP: return DIAMOND;
  ------------------
  |  Branch (106:5): [True: 0, False: 53.8k]
  ------------------
  107|      0|    case NSTEP_8PT: return DIAMOND;
  ------------------
  |  Branch (107:5): [True: 0, False: 53.8k]
  ------------------
  108|  53.8k|    case DIAMOND: return BIGDIA;
  ------------------
  |  Branch (108:5): [True: 53.8k, False: 14]
  ------------------
  109|      0|    case CLAMPED_DIAMOND: return BIGDIA;
  ------------------
  |  Branch (109:5): [True: 0, False: 53.8k]
  ------------------
  110|      0|    case BIGDIA: return HEX;
  ------------------
  |  Branch (110:5): [True: 0, False: 53.8k]
  ------------------
  111|      0|    case HEX: return FAST_DIAMOND;
  ------------------
  |  Branch (111:5): [True: 0, False: 53.8k]
  ------------------
  112|      0|    case FAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (112:5): [True: 0, False: 53.8k]
  ------------------
  113|      0|    case FAST_BIGDIA: return FAST_BIGDIA;
  ------------------
  |  Branch (113:5): [True: 0, False: 53.8k]
  ------------------
  114|      0|    case VFAST_DIAMOND: return VFAST_DIAMOND;
  ------------------
  |  Branch (114:5): [True: 0, False: 53.8k]
  ------------------
  115|      0|    default: assert(0 && "Invalid search method!"); return DIAMOND;
  ------------------
  |  Branch (115:5): [True: 0, False: 53.8k]
  ------------------
  116|  53.8k|  }
  117|  53.8k|}
motion_search_facade.c:av1_get_search_site_config:
   69|  5.15M|    const AV1_COMP *cpi, MACROBLOCK *x, SEARCH_METHODS search_method) {
   70|  5.15M|  const int ref_stride = x->e_mbd.plane[0].pre[0].stride;
   71|       |
   72|       |  // AV1_COMP::mv_search_params.search_site_config is a compressor level cache
   73|       |  // that's shared by multiple threads. In most cases where all frames have the
   74|       |  // same resolution, the cache contains the search site config that we need.
   75|  5.15M|  const MotionVectorSearchParams *mv_search_params = &cpi->mv_search_params;
   76|  5.15M|  if (ref_stride == mv_search_params->search_site_cfg[SS_CFG_SRC]->stride) {
  ------------------
  |  Branch (76:7): [True: 4.89M, False: 260k]
  ------------------
   77|  4.89M|    return mv_search_params->search_site_cfg[SS_CFG_SRC];
   78|  4.89M|  } else if (ref_stride ==
  ------------------
  |  Branch (78:14): [True: 0, False: 260k]
  ------------------
   79|   260k|             mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD]->stride) {
   80|      0|    return mv_search_params->search_site_cfg[SS_CFG_LOOKAHEAD];
   81|      0|  }
   82|       |
   83|       |  // If the cache does not contain the correct stride, then we will need to rely
   84|       |  // on the thread level config MACROBLOCK::search_site_cfg_buf. If even the
   85|       |  // thread level config doesn't match, then we need to update it.
   86|   260k|  search_method = search_method_lookup[search_method];
   87|   260k|  assert(search_method_lookup[search_method] == search_method &&
   88|   260k|         "The search_method_lookup table should be idempotent.");
   89|   260k|  if (ref_stride != x->search_site_cfg_buf[search_method].stride) {
  ------------------
  |  Branch (89:7): [True: 6.79k, False: 253k]
  ------------------
   90|  6.79k|    av1_refresh_search_site_config(x->search_site_cfg_buf, search_method,
   91|  6.79k|                                   ref_stride);
   92|  6.79k|  }
   93|       |
   94|   260k|  return x->search_site_cfg_buf;
   95|  5.15M|}

av1_pick_and_set_high_precision_mv:
  410|  55.2k|void av1_pick_and_set_high_precision_mv(AV1_COMP *cpi, int qindex) {
  411|  55.2k|  int use_hp = qindex < HIGH_PRECISION_MV_QTHRESH;
  ------------------
  |  |   19|  55.2k|#define HIGH_PRECISION_MV_QTHRESH 128
  ------------------
  412|  55.2k|#if !CONFIG_REALTIME_ONLY
  413|  55.2k|  MV_STATS *mv_stats = &cpi->mv_stats;
  414|  55.2k|#endif  // !CONFIG_REALTIME_ONLY
  415|       |
  416|  55.2k|  if (cpi->sf.hl_sf.high_precision_mv_usage == QTR_ONLY) {
  ------------------
  |  Branch (416:7): [True: 0, False: 55.2k]
  ------------------
  417|      0|    use_hp = 0;
  418|      0|  }
  419|  55.2k|#if !CONFIG_REALTIME_ONLY
  420|  55.2k|  else if (cpi->sf.hl_sf.high_precision_mv_usage == LAST_MV_DATA &&
  ------------------
  |  Branch (420:12): [True: 0, False: 55.2k]
  ------------------
  421|      0|           av1_frame_allows_smart_mv(cpi) && mv_stats->valid) {
  ------------------
  |  Branch (421:12): [True: 0, False: 0]
  |  Branch (421:46): [True: 0, False: 0]
  ------------------
  422|      0|    use_hp = get_smart_mv_prec(cpi, mv_stats, qindex);
  423|      0|  }
  424|  55.2k|#endif  // !CONFIG_REALTIME_ONLY
  425|       |
  426|  55.2k|  av1_set_high_precision_mv(cpi, use_hp,
  427|  55.2k|                            cpi->common.features.cur_frame_force_integer_mv);
  428|  55.2k|}

encoder.c:av1_set_high_precision_mv:
   34|   247k|                                             int cur_frame_force_integer_mv) {
   35|   247k|  MvCosts *const mv_costs = cpi->td.mb.mv_costs;
   36|       |  // Avoid accessing 'mv_costs' when it is not allocated.
   37|   247k|  if (mv_costs == NULL) return;
  ------------------
  |  Branch (37:7): [True: 0, False: 247k]
  ------------------
   38|       |
   39|   247k|  const int copy_hp = cpi->common.features.allow_high_precision_mv =
   40|   247k|      allow_high_precision_mv && !cur_frame_force_integer_mv;
  ------------------
  |  Branch (40:7): [True: 247k, False: 0]
  |  Branch (40:34): [True: 247k, False: 0]
  ------------------
   41|       |
   42|   247k|  mv_costs->nmv_cost[0] = &mv_costs->nmv_cost_alloc[0][MV_MAX];
  ------------------
  |  |   71|   247k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   247k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   247k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   247k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   43|   247k|  mv_costs->nmv_cost[1] = &mv_costs->nmv_cost_alloc[1][MV_MAX];
  ------------------
  |  |   71|   247k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   247k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   247k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   247k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|   247k|  mv_costs->nmv_cost_hp[0] = &mv_costs->nmv_cost_hp_alloc[0][MV_MAX];
  ------------------
  |  |   71|   247k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   247k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   247k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   247k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   45|   247k|  mv_costs->nmv_cost_hp[1] = &mv_costs->nmv_cost_hp_alloc[1][MV_MAX];
  ------------------
  |  |   71|   247k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   247k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   247k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   247k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|   247k|  mv_costs->mv_cost_stack =
   47|   247k|      copy_hp ? mv_costs->nmv_cost_hp : mv_costs->nmv_cost;
  ------------------
  |  Branch (47:7): [True: 247k, False: 0]
  ------------------
   48|   247k|}
mv_prec.c:av1_set_high_precision_mv:
   34|  55.2k|                                             int cur_frame_force_integer_mv) {
   35|  55.2k|  MvCosts *const mv_costs = cpi->td.mb.mv_costs;
   36|       |  // Avoid accessing 'mv_costs' when it is not allocated.
   37|  55.2k|  if (mv_costs == NULL) return;
  ------------------
  |  Branch (37:7): [True: 0, False: 55.2k]
  ------------------
   38|       |
   39|  55.2k|  const int copy_hp = cpi->common.features.allow_high_precision_mv =
   40|  55.2k|      allow_high_precision_mv && !cur_frame_force_integer_mv;
  ------------------
  |  Branch (40:7): [True: 21.7k, False: 33.4k]
  |  Branch (40:34): [True: 21.7k, False: 0]
  ------------------
   41|       |
   42|  55.2k|  mv_costs->nmv_cost[0] = &mv_costs->nmv_cost_alloc[0][MV_MAX];
  ------------------
  |  |   71|  55.2k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  55.2k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  55.2k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  55.2k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   43|  55.2k|  mv_costs->nmv_cost[1] = &mv_costs->nmv_cost_alloc[1][MV_MAX];
  ------------------
  |  |   71|  55.2k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  55.2k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  55.2k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  55.2k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|  55.2k|  mv_costs->nmv_cost_hp[0] = &mv_costs->nmv_cost_hp_alloc[0][MV_MAX];
  ------------------
  |  |   71|  55.2k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  55.2k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  55.2k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  55.2k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   45|  55.2k|  mv_costs->nmv_cost_hp[1] = &mv_costs->nmv_cost_hp_alloc[1][MV_MAX];
  ------------------
  |  |   71|  55.2k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  55.2k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  55.2k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  55.2k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|  55.2k|  mv_costs->mv_cost_stack =
   47|  55.2k|      copy_hp ? mv_costs->nmv_cost_hp : mv_costs->nmv_cost;
  ------------------
  |  Branch (47:7): [True: 21.7k, False: 33.4k]
  ------------------
   48|  55.2k|}

av1_block_yrd:
  127|  3.20M|                   BLOCK_SIZE bsize, TX_SIZE tx_size) {
  128|  3.20M|  MACROBLOCKD *xd = &x->e_mbd;
  129|  3.20M|  const struct macroblockd_plane *pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  3.20M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  130|  3.20M|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  3.20M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  131|  3.20M|  assert(bsize < BLOCK_SIZES_ALL);
  132|  3.20M|  const int num_4x4_w = mi_size_wide[bsize];
  133|  3.20M|  const int num_4x4_h = mi_size_high[bsize];
  134|  3.20M|  const int step = 1 << (tx_size << 1);
  135|  3.20M|  const int block_step = (1 << tx_size);
  136|  3.20M|  const int row_step = step * num_4x4_w >> tx_size;
  137|  3.20M|  int block = 0;
  138|  3.20M|  const int max_blocks_wide =
  139|  3.20M|      num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0 : xd->mb_to_right_edge >> 5);
  ------------------
  |  Branch (139:20): [True: 3.20M, False: 3.45k]
  ------------------
  140|  3.20M|  const int max_blocks_high =
  141|  3.20M|      num_4x4_h + (xd->mb_to_bottom_edge >= 0 ? 0 : xd->mb_to_bottom_edge >> 5);
  ------------------
  |  Branch (141:20): [True: 3.20M, False: 3.60k]
  ------------------
  142|  3.20M|  int eob_cost = 0;
  143|  3.20M|  const int bw = 4 * num_4x4_w;
  144|  3.20M|  const int bh = 4 * num_4x4_h;
  145|  3.20M|  const int use_hbd = is_cur_buf_hbd(xd);
  146|  3.20M|  int num_blk_skip_w = num_4x4_w;
  147|       |
  148|  3.20M|#if CONFIG_AV1_HIGHBITDEPTH
  149|  3.20M|  if (use_hbd) {
  ------------------
  |  Branch (149:7): [True: 162k, False: 3.04M]
  ------------------
  150|   162k|    aom_highbd_subtract_block(bh, bw, p->src_diff, bw, p->src.buf,
  ------------------
  |  | 3604|   162k|#define aom_highbd_subtract_block aom_highbd_subtract_block_sse2
  ------------------
  151|   162k|                              p->src.stride, pd->dst.buf, pd->dst.stride);
  152|  3.04M|  } else {
  153|  3.04M|    aom_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, p->src.stride,
  154|  3.04M|                       pd->dst.buf, pd->dst.stride);
  155|  3.04M|  }
  156|       |#else
  157|       |  aom_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, p->src.stride,
  158|       |                     pd->dst.buf, pd->dst.stride);
  159|       |#endif
  160|       |
  161|       |  // Keep the intermediate value on the stack here. Writing directly to
  162|       |  // skippable causes speed regression due to load-and-store issues in
  163|       |  // update_yrd_loop_vars.
  164|  3.20M|  int temp_skippable = 1;
  165|  3.20M|  this_rdc->dist = 0;
  166|  3.20M|  this_rdc->rate = 0;
  167|       |  // For block sizes 8x16 or above, Hadamard txfm of two adjacent 8x8 blocks
  168|       |  // can be done per function call. Hence the call of Hadamard txfm is
  169|       |  // abstracted here for the specified cases.
  170|  3.20M|  int is_tx_8x8_dual_applicable =
  171|  3.20M|      (tx_size == TX_8X8 && block_size_wide[bsize] >= 16 &&
  ------------------
  |  Branch (171:8): [True: 2.70M, False: 503k]
  |  Branch (171:29): [True: 491k, False: 2.21M]
  ------------------
  172|   491k|       block_size_high[bsize] >= 8);
  ------------------
  |  Branch (172:8): [True: 491k, False: 18.4E]
  ------------------
  173|       |
  174|  3.20M|#if CONFIG_AV1_HIGHBITDEPTH
  175|       |  // As of now, dual implementation of hadamard txfm is available for low
  176|       |  // bitdepth.
  177|  3.20M|  if (use_hbd) is_tx_8x8_dual_applicable = 0;
  ------------------
  |  Branch (177:7): [True: 162k, False: 3.04M]
  ------------------
  178|  3.20M|#endif
  179|       |
  180|  3.20M|  if (is_tx_8x8_dual_applicable) {
  ------------------
  |  Branch (180:7): [True: 468k, False: 2.74M]
  ------------------
  181|   468k|    aom_process_hadamard_lp_8x16(x, max_blocks_high, max_blocks_wide, num_4x4_w,
  182|   468k|                                 step, block_step);
  183|   468k|  }
  184|       |
  185|  3.20M|  const SCAN_ORDER *const scan_order = &av1_scan_orders[tx_size][DCT_DCT];
  186|  3.20M|  DECLARE_BLOCK_YRD_BUFFERS()
  ------------------
  |  |   26|  3.20M|  DECLARE_ALIGNED(64, tran_low_t, dqcoeff_buf[16 * 16]); \
  |  |  ------------------
  |  |  |  |   19|  3.20M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  |  |  ------------------
  |  |   27|  3.20M|  DECLARE_ALIGNED(64, tran_low_t, qcoeff_buf[16 * 16]);  \
  |  |  ------------------
  |  |  |  |   19|  3.20M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  |  |  ------------------
  |  |   28|  3.20M|  DECLARE_ALIGNED(64, tran_low_t, coeff_buf[16 * 16]);   \
  |  |  ------------------
  |  |  |  |   19|  3.20M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  |  |  ------------------
  |  |   29|  3.20M|  uint16_t eob[1];
  ------------------
  187|  3.20M|  DECLARE_BLOCK_YRD_VARS()
  ------------------
  |  |   35|  3.20M|  int16_t *low_coeff = (int16_t *)coeff_buf;                              \
  |  |   36|  3.20M|  int16_t *const low_qcoeff = (int16_t *)qcoeff_buf;                      \
  |  |   37|  3.20M|  int16_t *const low_dqcoeff = (int16_t *)dqcoeff_buf;                    \
  |  |   38|  3.20M|  const int diff_stride = bw;
  ------------------
  188|  3.20M|#if CONFIG_AV1_HIGHBITDEPTH
  189|  3.20M|  DECLARE_BLOCK_YRD_HBD_VARS()
  ------------------
  |  |   82|  3.20M|  tran_low_t *const coeff = coeff_buf;   \
  |  |   83|  3.20M|  tran_low_t *const qcoeff = qcoeff_buf; \
  |  |   84|  3.20M|  tran_low_t *const dqcoeff = dqcoeff_buf;
  ------------------
  190|       |#else
  191|       |  (void)use_hbd;
  192|       |#endif
  193|       |
  194|       |  // Keep track of the row and column of the blocks we use so that we know
  195|       |  // if we are in the unrestricted motion border.
  196|  7.28M|  for (int r = 0; r < max_blocks_high; r += block_step) {
  ------------------
  |  Branch (196:19): [True: 4.03M, False: 3.24M]
  ------------------
  197|  10.0M|    for (int c = 0, s = 0; c < max_blocks_wide; c += block_step, s += step) {
  ------------------
  |  Branch (197:28): [True: 6.01M, False: 4.07M]
  ------------------
  198|  6.01M|      DECLARE_LOOP_VARS_BLOCK_YRD()
  ------------------
  |  |   41|  6.01M|  const int16_t *src_diff = &p->src_diff[(r * diff_stride + c) << 2];
  ------------------
  199|       |
  200|  6.01M|      switch (tx_size) {
  201|      0|#if CONFIG_AV1_HIGHBITDEPTH
  202|   417k|        case TX_16X16:
  ------------------
  |  Branch (202:9): [True: 417k, False: 5.59M]
  ------------------
  203|   417k|          if (use_hbd) {
  ------------------
  |  Branch (203:15): [True: 9.94k, False: 407k]
  ------------------
  204|  9.94k|            aom_hadamard_16x16(src_diff, diff_stride, coeff);
  205|  9.94k|            av1_quantize_fp(coeff, 16 * 16, p->zbin_QTX, p->round_fp_QTX,
  206|  9.94k|                            p->quant_fp_QTX, p->quant_shift_QTX, qcoeff,
  207|  9.94k|                            dqcoeff, p->dequant_QTX, eob,
  208|       |                            // default_scan_fp_16x16_transpose and
  209|       |                            // av1_default_iscan_fp_16x16_transpose have to be
  210|       |                            // used together.
  211|  9.94k|                            default_scan_fp_16x16_transpose,
  212|  9.94k|                            av1_default_iscan_fp_16x16_transpose);
  213|   407k|          } else {
  214|   407k|            aom_hadamard_lp_16x16(src_diff, diff_stride, low_coeff);
  215|   407k|            av1_quantize_lp(low_coeff, 16 * 16, p->round_fp_QTX,
  216|   407k|                            p->quant_fp_QTX, low_qcoeff, low_dqcoeff,
  217|   407k|                            p->dequant_QTX, eob,
  218|       |                            // default_scan_lp_16x16_transpose and
  219|       |                            // av1_default_iscan_lp_16x16_transpose have to be
  220|       |                            // used together.
  221|   407k|                            default_scan_lp_16x16_transpose,
  222|   407k|                            av1_default_iscan_lp_16x16_transpose);
  223|   407k|          }
  224|   417k|          break;
  225|  4.60M|        case TX_8X8:
  ------------------
  |  Branch (225:9): [True: 4.60M, False: 1.41M]
  ------------------
  226|  4.60M|          if (use_hbd) {
  ------------------
  |  Branch (226:15): [True: 211k, False: 4.39M]
  ------------------
  227|   211k|            aom_hadamard_8x8(src_diff, diff_stride, coeff);
  ------------------
  |  |  575|   211k|#define aom_hadamard_8x8 aom_hadamard_8x8_sse2
  ------------------
  228|   211k|            av1_quantize_fp(
  229|   211k|                coeff, 8 * 8, p->zbin_QTX, p->round_fp_QTX, p->quant_fp_QTX,
  230|   211k|                p->quant_shift_QTX, qcoeff, dqcoeff, p->dequant_QTX, eob,
  231|   211k|                default_scan_8x8_transpose, av1_default_iscan_8x8_transpose);
  232|  4.39M|          } else {
  233|  4.39M|            if (is_tx_8x8_dual_applicable) {
  ------------------
  |  Branch (233:17): [True: 2.26M, False: 2.12M]
  ------------------
  234|       |              // The coeffs are pre-computed for the whole block, so re-assign
  235|       |              // low_coeff to the appropriate location.
  236|  2.26M|              const int block_offset = BLOCK_OFFSET(block + s);
  ------------------
  |  |  489|  2.26M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  237|  2.26M|              low_coeff = (int16_t *)p->coeff + block_offset;
  238|  2.26M|            } else {
  239|  2.12M|              aom_hadamard_lp_8x8(src_diff, diff_stride, low_coeff);
  ------------------
  |  |  584|  2.12M|#define aom_hadamard_lp_8x8 aom_hadamard_lp_8x8_sse2
  ------------------
  240|  2.12M|            }
  241|  4.39M|            av1_quantize_lp(
  242|  4.39M|                low_coeff, 8 * 8, p->round_fp_QTX, p->quant_fp_QTX, low_qcoeff,
  243|  4.39M|                low_dqcoeff, p->dequant_QTX, eob,
  244|       |                // default_scan_8x8_transpose and
  245|       |                // av1_default_iscan_8x8_transpose have to be used together.
  246|  4.39M|                default_scan_8x8_transpose, av1_default_iscan_8x8_transpose);
  247|  4.39M|          }
  248|  4.60M|          break;
  249|  1.00M|        default:
  ------------------
  |  Branch (249:9): [True: 1.00M, False: 5.00M]
  ------------------
  250|  1.00M|          assert(tx_size == TX_4X4);
  251|       |          // In tx_size=4x4 case, aom_fdct4x4 and aom_fdct4x4_lp generate
  252|       |          // normal coefficients order, so we don't need to change the scan
  253|       |          // order here.
  254|  1.00M|          if (use_hbd) {
  ------------------
  |  Branch (254:15): [True: 24.1k, False: 981k]
  ------------------
  255|  24.1k|            aom_fdct4x4(src_diff, coeff, diff_stride);
  ------------------
  |  |  435|  24.1k|#define aom_fdct4x4 aom_fdct4x4_sse2
  ------------------
  256|  24.1k|            av1_quantize_fp(coeff, 4 * 4, p->zbin_QTX, p->round_fp_QTX,
  257|  24.1k|                            p->quant_fp_QTX, p->quant_shift_QTX, qcoeff,
  258|  24.1k|                            dqcoeff, p->dequant_QTX, eob, scan_order->scan,
  259|  24.1k|                            scan_order->iscan);
  260|   981k|          } else {
  261|   981k|            aom_fdct4x4_lp(src_diff, low_coeff, diff_stride);
  ------------------
  |  |  439|   981k|#define aom_fdct4x4_lp aom_fdct4x4_lp_sse2
  ------------------
  262|   981k|            av1_quantize_lp(low_coeff, 4 * 4, p->round_fp_QTX, p->quant_fp_QTX,
  263|   981k|                            low_qcoeff, low_dqcoeff, p->dequant_QTX, eob,
  264|   981k|                            scan_order->scan, scan_order->iscan);
  265|   981k|          }
  266|  1.00M|          break;
  267|       |#else
  268|       |        case TX_16X16:
  269|       |          aom_hadamard_lp_16x16(src_diff, diff_stride, low_coeff);
  270|       |          av1_quantize_lp(low_coeff, 16 * 16, p->round_fp_QTX, p->quant_fp_QTX,
  271|       |                          low_qcoeff, low_dqcoeff, p->dequant_QTX, eob,
  272|       |                          default_scan_lp_16x16_transpose,
  273|       |                          av1_default_iscan_lp_16x16_transpose);
  274|       |          break;
  275|       |        case TX_8X8:
  276|       |          if (is_tx_8x8_dual_applicable) {
  277|       |            // The coeffs are pre-computed for the whole block, so re-assign
  278|       |            // low_coeff to the appropriate location.
  279|       |            const int block_offset = BLOCK_OFFSET(block + s);
  280|       |            low_coeff = (int16_t *)p->coeff + block_offset;
  281|       |          } else {
  282|       |            aom_hadamard_lp_8x8(src_diff, diff_stride, low_coeff);
  283|       |          }
  284|       |          av1_quantize_lp(low_coeff, 8 * 8, p->round_fp_QTX, p->quant_fp_QTX,
  285|       |                          low_qcoeff, low_dqcoeff, p->dequant_QTX, eob,
  286|       |                          default_scan_8x8_transpose,
  287|       |                          av1_default_iscan_8x8_transpose);
  288|       |          break;
  289|       |        default:
  290|       |          aom_fdct4x4_lp(src_diff, low_coeff, diff_stride);
  291|       |          av1_quantize_lp(low_coeff, 4 * 4, p->round_fp_QTX, p->quant_fp_QTX,
  292|       |                          low_qcoeff, low_dqcoeff, p->dequant_QTX, eob,
  293|       |                          scan_order->scan, scan_order->iscan);
  294|       |          break;
  295|       |#endif
  296|  6.01M|      }
  297|  6.05M|      assert(*eob <= 1024);
  298|  6.05M|#if CONFIG_AV1_HIGHBITDEPTH
  299|  6.05M|      if (use_hbd)
  ------------------
  |  Branch (299:11): [True: 245k, False: 5.80M]
  ------------------
  300|   245k|        update_yrd_loop_vars_hbd(x, &temp_skippable, step, *eob, coeff, qcoeff,
  301|   245k|                                 dqcoeff, this_rdc, &eob_cost,
  302|   245k|                                 r * num_blk_skip_w + c);
  303|  5.80M|      else
  304|  5.80M|#endif
  305|  5.80M|        update_yrd_loop_vars(x, &temp_skippable, step, *eob, low_coeff,
  306|  5.80M|                             low_qcoeff, low_dqcoeff, this_rdc, &eob_cost,
  307|  5.80M|                             r * num_blk_skip_w + c);
  308|  6.05M|    }
  309|  4.07M|    block += row_step;
  310|  4.07M|  }
  311|       |
  312|  3.24M|  this_rdc->skip_txfm = *skippable = temp_skippable;
  313|  3.24M|  if (this_rdc->sse < INT64_MAX) {
  ------------------
  |  Branch (313:7): [True: 1.92M, False: 1.32M]
  ------------------
  314|  1.92M|    this_rdc->sse = (this_rdc->sse << 6) >> 2;
  315|  1.92M|    if (temp_skippable) {
  ------------------
  |  Branch (315:9): [True: 1.43k, False: 1.91M]
  ------------------
  316|  1.43k|      this_rdc->dist = 0;
  317|  1.43k|      this_rdc->dist = this_rdc->sse;
  318|  1.43k|      return;
  319|  1.43k|    }
  320|  1.92M|  }
  321|       |
  322|       |  // If skippable is set, rate gets clobbered later.
  323|  3.24M|  this_rdc->rate <<= (2 + AV1_PROB_COST_SHIFT);
  ------------------
  |  |   25|  3.24M|#define AV1_PROB_COST_SHIFT 9
  ------------------
  324|  3.24M|  this_rdc->rate += (eob_cost << AV1_PROB_COST_SHIFT);
  ------------------
  |  |   25|  3.24M|#define AV1_PROB_COST_SHIFT 9
  ------------------
  325|  3.24M|}
av1_model_rd_for_sb_uv:
  465|  1.69M|                               int stop_plane) {
  466|       |  // Note our transform coeffs are 8 times an orthogonal transform.
  467|       |  // Hence quantizer step is also 8 times. To get effective quantizer
  468|       |  // we need to divide by 8 before sending to modeling function.
  469|  1.69M|  unsigned int sse;
  470|  1.69M|  int rate;
  471|  1.69M|  int64_t dist;
  472|  1.69M|  int plane;
  473|  1.69M|  int64_t tot_sse = 0;
  474|       |
  475|  1.69M|  this_rdc->rate = 0;
  476|  1.69M|  this_rdc->dist = 0;
  477|  1.69M|  this_rdc->skip_txfm = 0;
  478|       |
  479|  3.96M|  for (plane = start_plane; plane <= stop_plane; ++plane) {
  ------------------
  |  Branch (479:29): [True: 2.27M, False: 1.69M]
  ------------------
  480|  2.27M|    struct macroblock_plane *const p = &x->plane[plane];
  481|  2.27M|    struct macroblockd_plane *const pd = &xd->plane[plane];
  482|  2.27M|    const uint32_t dc_quant = p->dequant_QTX[0];
  483|  2.27M|    const uint32_t ac_quant = p->dequant_QTX[1];
  484|  2.27M|    const BLOCK_SIZE bs = plane_bsize;
  485|  2.27M|    unsigned int var;
  486|  2.27M|    if (!x->color_sensitivity[COLOR_SENS_IDX(plane)]) continue;
  ------------------
  |  |   50|  2.27M|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (486:9): [True: 5.01k, False: 2.26M]
  ------------------
  487|       |
  488|  2.26M|    var = cpi->ppi->fn_ptr[bs].vf(p->src.buf, p->src.stride, pd->dst.buf,
  489|  2.26M|                                  pd->dst.stride, &sse);
  490|  2.26M|    assert(sse >= var);
  491|  2.26M|    tot_sse += sse;
  492|       |
  493|  2.26M|    av1_model_rd_from_var_lapndz(sse - var, num_pels_log2_lookup[bs],
  494|  2.26M|                                 dc_quant >> 3, &rate, &dist);
  495|       |
  496|  2.26M|    this_rdc->rate += rate >> 1;
  497|  2.26M|    this_rdc->dist += dist << 3;
  498|       |
  499|  2.26M|    av1_model_rd_from_var_lapndz(var, num_pels_log2_lookup[bs], ac_quant >> 3,
  500|  2.26M|                                 &rate, &dist);
  501|       |
  502|  2.26M|    this_rdc->rate += rate;
  503|  2.26M|    this_rdc->dist += dist << 4;
  504|  2.26M|  }
  505|       |
  506|  1.69M|  if (this_rdc->rate == 0) {
  ------------------
  |  Branch (506:7): [True: 19.1k, False: 1.67M]
  ------------------
  507|  19.1k|    this_rdc->skip_txfm = 1;
  508|  19.1k|  }
  509|       |
  510|  1.69M|  if (RDCOST(x->rdmult, this_rdc->rate, this_rdc->dist) >=
  ------------------
  |  |   33|  1.69M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.69M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.69M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.69M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (510:7): [True: 391, False: 1.69M]
  ------------------
  511|  1.69M|      RDCOST(x->rdmult, 0, tot_sse << 4)) {
  ------------------
  |  |   33|  1.69M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.69M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.69M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.69M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  512|    391|    this_rdc->rate = 0;
  513|    391|    this_rdc->dist = tot_sse << 4;
  514|    391|    this_rdc->skip_txfm = 1;
  515|    391|  }
  516|       |
  517|  1.69M|  return tot_sse;
  518|  1.69M|}
av1_estimate_block_intra:
  612|  1.12M|                              void *arg) {
  613|  1.12M|  struct estimate_block_intra_args *const args = arg;
  614|  1.12M|  AV1_COMP *const cpi = args->cpi;
  615|  1.12M|  AV1_COMMON *const cm = &cpi->common;
  616|  1.12M|  MACROBLOCK *const x = args->x;
  617|  1.12M|  MACROBLOCKD *const xd = &x->e_mbd;
  618|  1.12M|  struct macroblock_plane *const p = &x->plane[plane];
  619|  1.12M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  620|  1.12M|  const BLOCK_SIZE bsize_tx = txsize_to_bsize[tx_size];
  621|  1.12M|  uint8_t *const src_buf_base = p->src.buf;
  622|  1.12M|  uint8_t *const dst_buf_base = pd->dst.buf;
  623|  1.12M|  const int64_t src_stride = p->src.stride;
  624|  1.12M|  const int64_t dst_stride = pd->dst.stride;
  625|       |
  626|  1.12M|  (void)block;
  627|       |
  628|  1.12M|  av1_predict_intra_block_facade(cm, xd, plane, col, row, tx_size);
  629|       |
  630|  1.13M|  if (args->prune_mode_based_on_sad || args->prune_palette_sad) {
  ------------------
  |  Branch (630:7): [True: 18.4E, False: 1.13M]
  |  Branch (630:40): [True: 18.4E, False: 1.13M]
  ------------------
  631|      0|    unsigned int this_sad = cpi->ppi->fn_ptr[plane_bsize].sdf(
  632|      0|        p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride);
  633|      0|    const unsigned int sad_threshold =
  634|      0|        args->best_sad != UINT_MAX ? args->best_sad + (args->best_sad >> 4)
  ------------------
  |  Branch (634:9): [True: 0, False: 0]
  ------------------
  635|      0|                                   : UINT_MAX;
  636|       |    // Skip the evaluation of current mode if its SAD is more than a threshold.
  637|      0|    if (args->prune_mode_based_on_sad && this_sad > sad_threshold) {
  ------------------
  |  Branch (637:9): [True: 0, False: 0]
  |  Branch (637:42): [True: 0, False: 0]
  ------------------
  638|       |      // For the current mode, set rate and distortion to maximum possible
  639|       |      // values and return.
  640|       |      // Note: args->rdc->rate is checked in av1_nonrd_pick_intra_mode() to skip
  641|       |      // the evaluation of the current mode.
  642|      0|      args->rdc->rate = INT_MAX;
  643|      0|      args->rdc->dist = INT64_MAX;
  644|      0|      return;
  645|      0|    }
  646|      0|    if (this_sad < args->best_sad) {
  ------------------
  |  Branch (646:9): [True: 0, False: 0]
  ------------------
  647|      0|      args->best_sad = this_sad;
  648|      0|    }
  649|      0|  }
  650|       |
  651|  1.12M|  RD_STATS this_rdc;
  652|  1.12M|  av1_invalid_rd_stats(&this_rdc);
  653|       |
  654|  1.12M|  p->src.buf = &src_buf_base[4 * (row * src_stride + col)];
  655|  1.12M|  pd->dst.buf = &dst_buf_base[4 * (row * dst_stride + col)];
  656|       |
  657|  1.12M|  if (plane == 0) {
  ------------------
  |  Branch (657:7): [True: 22.0k, False: 1.10M]
  ------------------
  658|  22.0k|    av1_block_yrd(x, &this_rdc, &args->skippable, bsize_tx,
  659|  22.0k|                  AOMMIN(tx_size, TX_16X16));
  ------------------
  |  |   34|  22.0k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 22.0k]
  |  |  ------------------
  ------------------
  660|  1.10M|  } else {
  661|  1.10M|    av1_model_rd_for_sb_uv(cpi, bsize_tx, x, xd, &this_rdc, plane, plane);
  662|  1.10M|  }
  663|       |
  664|  1.12M|  p->src.buf = src_buf_base;
  665|  1.12M|  pd->dst.buf = dst_buf_base;
  666|       |  assert(args->rdc->rate != INT_MAX && args->rdc->dist != INT64_MAX);
  667|  1.12M|  args->rdc->rate += this_rdc.rate;
  668|  1.12M|  args->rdc->dist += this_rdc.dist;
  669|  1.12M|}
av1_estimate_intra_mode:
  711|   597k|                             unsigned int *best_sad_norm) {
  712|   597k|  AV1_COMMON *const cm = &cpi->common;
  713|   597k|  MACROBLOCKD *const xd = &x->e_mbd;
  714|   597k|  MB_MODE_INFO *const mi = xd->mi[0];
  715|   597k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  716|   597k|  const unsigned char segment_id = mi->segment_id;
  717|   597k|  const int *const rd_threshes = cpi->rd.threshes[segment_id][bsize];
  718|   597k|  const int *const rd_thresh_freq_fact = x->thresh_freq_fact[bsize];
  719|   597k|  const bool is_screen_content =
  720|   597k|      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN;
  721|   597k|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|   597k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  722|   597k|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
  723|       |
  724|   597k|  const CommonQuantParams *quant_params = &cm->quant_params;
  725|       |
  726|   597k|  RD_STATS this_rdc;
  727|       |
  728|   597k|  int intra_cost_penalty = av1_get_intra_cost_penalty(
  729|   597k|      quant_params->base_qindex, quant_params->y_dc_delta_q,
  730|   597k|      cm->seq_params->bit_depth);
  731|   597k|  int64_t inter_mode_thresh =
  732|   597k|      RDCOST(x->rdmult, ref_cost_intra + intra_cost_penalty, 0);
  ------------------
  |  |   33|   597k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   597k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   597k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   597k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  733|   597k|  int perform_intra_pred = rt_sf->check_intra_pred_nonrd;
  734|   597k|  int force_intra_check = 0;
  735|       |  // For spatial enhancement layer: turn off intra prediction if the
  736|       |  // previous spatial layer as golden ref is not chosen as best reference.
  737|       |  // only do this for temporal enhancement layer and on non-key frames.
  738|   597k|  if (cpi->svc.spatial_layer_id > 0 &&
  ------------------
  |  Branch (738:7): [True: 0, False: 597k]
  ------------------
  739|      0|      best_pickmode->best_ref_frame != GOLDEN_FRAME &&
  ------------------
  |  Branch (739:7): [True: 0, False: 0]
  ------------------
  740|      0|      cpi->svc.temporal_layer_id > 0 &&
  ------------------
  |  Branch (740:7): [True: 0, False: 0]
  ------------------
  741|      0|      !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)
  ------------------
  |  Branch (741:7): [True: 0, False: 0]
  ------------------
  742|      0|    perform_intra_pred = 0;
  743|       |
  744|   597k|  int do_early_exit_rdthresh = 1;
  745|       |
  746|   597k|  uint32_t spatial_var_thresh = 50;
  747|   597k|  int motion_thresh = 32;
  748|       |  // Adjust thresholds to make intra mode likely tested if the other
  749|       |  // references (golden, alt) are skipped/not checked. For now always
  750|       |  // adjust for svc mode.
  751|   597k|  if (cpi->ppi->use_svc || (rt_sf->use_nonrd_altref_frame == 0 &&
  ------------------
  |  Branch (751:7): [True: 220, False: 597k]
  |  Branch (751:29): [True: 306k, False: 291k]
  ------------------
  752|   306k|                            rt_sf->nonrd_prune_ref_frame_search > 0)) {
  ------------------
  |  Branch (752:29): [True: 306k, False: 18.4E]
  ------------------
  753|   306k|    spatial_var_thresh = 150;
  754|   306k|    motion_thresh = 0;
  755|   306k|  }
  756|       |
  757|       |  // Some adjustments to checking intra mode based on source variance.
  758|   597k|  if (x->source_variance < spatial_var_thresh) {
  ------------------
  |  Branch (758:7): [True: 1.88k, False: 595k]
  ------------------
  759|       |    // If the best inter mode is large motion or non-LAST ref reduce intra cost
  760|       |    // penalty, so intra mode is more likely tested.
  761|  1.88k|    if (best_rdc->rdcost != INT64_MAX &&
  ------------------
  |  Branch (761:9): [True: 1.88k, False: 0]
  ------------------
  762|  1.88k|        (best_pickmode->best_ref_frame != LAST_FRAME ||
  ------------------
  |  Branch (762:10): [True: 0, False: 1.88k]
  ------------------
  763|  1.88k|         abs(mi->mv[0].as_mv.row) >= motion_thresh ||
  ------------------
  |  Branch (763:10): [True: 1.31k, False: 573]
  ------------------
  764|  1.39k|         abs(mi->mv[0].as_mv.col) >= motion_thresh)) {
  ------------------
  |  Branch (764:10): [True: 83, False: 490]
  ------------------
  765|  1.39k|      intra_cost_penalty = intra_cost_penalty >> 2;
  766|  1.39k|      inter_mode_thresh =
  767|  1.39k|          RDCOST(x->rdmult, ref_cost_intra + intra_cost_penalty, 0);
  ------------------
  |  |   33|  1.39k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.39k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.39k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.39k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  768|  1.39k|      do_early_exit_rdthresh = 0;
  769|  1.39k|    }
  770|  1.88k|    if ((x->source_variance < AOMMAX(50, (spatial_var_thresh >> 1)) &&
  ------------------
  |  |   35|  3.77k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 667, False: 1.22k]
  |  |  ------------------
  ------------------
  |  Branch (770:10): [True: 1.42k, False: 460]
  ------------------
  771|  1.42k|         x->content_state_sb.source_sad_nonrd >= kHighSad) ||
  ------------------
  |  Branch (771:10): [True: 756, False: 673]
  ------------------
  772|  1.13k|        (is_screen_content && x->source_variance < 50 &&
  ------------------
  |  Branch (772:10): [True: 0, False: 1.13k]
  |  Branch (772:31): [True: 0, False: 0]
  ------------------
  773|      0|         ((bsize >= BLOCK_32X32 &&
  ------------------
  |  Branch (773:12): [True: 0, False: 0]
  ------------------
  774|      0|           x->content_state_sb.source_sad_nonrd != kZeroSad) ||
  ------------------
  |  Branch (774:12): [True: 0, False: 0]
  ------------------
  775|      0|          x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (775:11): [True: 0, False: 0]
  ------------------
  776|      0|          x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)))
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (776:11): [True: 0, False: 0]
  ------------------
  777|    756|      force_intra_check = 1;
  778|       |    // For big blocks worth checking intra (since only DC will be checked),
  779|       |    // even if best_early_term is set.
  780|  1.88k|    if (bsize >= BLOCK_32X32) best_early_term = 0;
  ------------------
  |  Branch (780:9): [True: 16, False: 1.87k]
  ------------------
  781|   595k|  } else if (rt_sf->source_metrics_sb_nonrd &&
  ------------------
  |  Branch (781:14): [True: 595k, False: 212]
  ------------------
  782|   595k|             x->content_state_sb.source_sad_nonrd <= kLowSad) {
  ------------------
  |  Branch (782:14): [True: 14, False: 595k]
  ------------------
  783|     14|    perform_intra_pred = 0;
  784|     14|  }
  785|       |
  786|   597k|  if (best_rdc->skip_txfm && best_pickmode->best_mode_initial_skip_flag) {
  ------------------
  |  Branch (786:7): [True: 3.15k, False: 594k]
  |  Branch (786:30): [True: 713, False: 2.44k]
  ------------------
  787|    713|    if (rt_sf->skip_intra_pred == 1 && best_pickmode->best_mode != NEWMV)
  ------------------
  |  Branch (787:9): [True: 713, False: 0]
  |  Branch (787:40): [True: 560, False: 153]
  ------------------
  788|    560|      perform_intra_pred = 0;
  789|    153|    else if (rt_sf->skip_intra_pred == 2)
  ------------------
  |  Branch (789:14): [True: 0, False: 153]
  ------------------
  790|      0|      perform_intra_pred = 0;
  791|    713|  }
  792|       |
  793|   597k|  if (!(best_rdc->rdcost == INT64_MAX || force_intra_check ||
  ------------------
  |  Branch (793:9): [True: 265, False: 597k]
  |  Branch (793:42): [True: 715, False: 596k]
  ------------------
  794|   596k|        (perform_intra_pred && !best_early_term &&
  ------------------
  |  Branch (794:10): [True: 596k, False: 514]
  |  Branch (794:32): [True: 596k, False: 18.4E]
  ------------------
  795|   596k|         bsize <= cpi->sf.part_sf.max_intra_bsize))) {
  ------------------
  |  Branch (795:10): [True: 596k, False: 83]
  ------------------
  796|    636|    return;
  797|    636|  }
  798|       |
  799|       |  // Early exit based on RD cost calculated using known rate. When
  800|       |  // is_screen_content is true, more bias is given to intra modes. Hence,
  801|       |  // considered conservative threshold in early exit for the same.
  802|   597k|  const int64_t known_rd = is_screen_content
  ------------------
  |  Branch (802:28): [True: 0, False: 597k]
  ------------------
  803|   597k|                               ? CALC_BIASED_RDCOST(inter_mode_thresh)
  ------------------
  |  |   22|      0|#define CALC_BIASED_RDCOST(rdcost) (7 * (rdcost) >> 3)
  ------------------
  804|   597k|                               : inter_mode_thresh;
  805|   597k|  if (known_rd > best_rdc->rdcost) return;
  ------------------
  |  Branch (805:7): [True: 316, False: 596k]
  ------------------
  806|       |
  807|   596k|  struct estimate_block_intra_args args;
  808|   596k|  init_estimate_block_intra_args(&args, cpi, x);
  809|   596k|  if (prune_palette_testing_inter(cpi, x->source_variance))
  ------------------
  |  Branch (809:7): [True: 0, False: 596k]
  ------------------
  810|      0|    args.prune_palette_sad = true;
  811|   596k|  TX_SIZE intra_tx_size = AOMMIN(
  ------------------
  |  |   34|  1.19M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 443k, False: 153k]
  |  |  |  Branch (34:25): [True: 565k, False: 31.4k]
  |  |  |  Branch (34:38): [True: 412k, False: 30.9k]
  |  |  ------------------
  ------------------
  812|   596k|      AOMMIN(max_txsize_lookup[bsize],
  813|   596k|             tx_mode_to_biggest_tx_size[txfm_params->tx_mode_search_type]),
  814|   596k|      TX_16X16);
  815|   596k|  if (is_screen_content && cpi->rc.high_source_sad &&
  ------------------
  |  Branch (815:7): [True: 0, False: 596k]
  |  Branch (815:28): [True: 0, False: 0]
  ------------------
  816|      0|      x->source_variance > spatial_var_thresh && bsize <= BLOCK_16X16)
  ------------------
  |  Branch (816:7): [True: 0, False: 0]
  |  Branch (816:50): [True: 0, False: 0]
  ------------------
  817|      0|    intra_tx_size = TX_4X4;
  818|       |
  819|   596k|  PRED_BUFFER *const best_pred = best_pickmode->best_pred;
  820|   596k|  if (reuse_prediction && best_pred != NULL) {
  ------------------
  |  Branch (820:7): [True: 0, False: 596k]
  |  Branch (820:27): [True: 0, False: 0]
  ------------------
  821|      0|    const int bh = block_size_high[bsize];
  822|      0|    const int bw = block_size_wide[bsize];
  823|      0|    if (best_pred->data == orig_dst->buf) {
  ------------------
  |  Branch (823:9): [True: 0, False: 0]
  ------------------
  824|      0|      *this_mode_pred = &tmp_buffers[get_pred_buffer(tmp_buffers, 3)];
  825|      0|      aom_convolve_copy(best_pred->data, best_pred->stride,
  826|      0|                        (*this_mode_pred)->data, (*this_mode_pred)->stride, bw,
  827|      0|                        bh);
  828|      0|      best_pickmode->best_pred = *this_mode_pred;
  829|      0|    }
  830|      0|  }
  831|   596k|  pd->dst = *orig_dst;
  832|       |
  833|  2.97M|  for (int midx = 0; midx < RTC_INTRA_MODES; ++midx) {
  ------------------
  |  |   20|  2.97M|#define RTC_INTRA_MODES (4)
  ------------------
  |  Branch (833:22): [True: 2.38M, False: 596k]
  ------------------
  834|  2.38M|    const PREDICTION_MODE this_mode = intra_mode_list[midx];
  835|  2.38M|    const THR_MODES mode_index = mode_idx[INTRA_FRAME][mode_offset(this_mode)];
  836|  2.38M|    const int64_t mode_rd_thresh = rd_threshes[mode_index];
  837|       |
  838|  2.38M|    if (is_prune_intra_mode(cpi, midx, force_intra_check, bsize, segment_id,
  ------------------
  |  Branch (838:9): [True: 1.10M, False: 1.28M]
  ------------------
  839|  2.38M|                            x->content_state_sb.source_sad_nonrd,
  840|  2.38M|                            x->color_sensitivity))
  841|  1.10M|      continue;
  842|       |
  843|  1.28M|    if (is_screen_content && rt_sf->source_metrics_sb_nonrd) {
  ------------------
  |  Branch (843:9): [True: 0, False: 1.28M]
  |  Branch (843:30): [True: 0, False: 0]
  ------------------
  844|       |      // For spatially flat blocks with zero motion only check
  845|       |      // DC mode.
  846|      0|      if (x->content_state_sb.source_sad_nonrd == kZeroSad &&
  ------------------
  |  Branch (846:11): [True: 0, False: 0]
  ------------------
  847|      0|          x->source_variance == 0 && this_mode != DC_PRED)
  ------------------
  |  Branch (847:11): [True: 0, False: 0]
  |  Branch (847:38): [True: 0, False: 0]
  ------------------
  848|      0|        continue;
  849|       |      // Only test Intra for big blocks if spatial_variance is small.
  850|      0|      else if (bsize > BLOCK_32X32 && x->source_variance > 50)
  ------------------
  |  Branch (850:16): [True: 0, False: 0]
  |  Branch (850:39): [True: 0, False: 0]
  ------------------
  851|      0|        continue;
  852|      0|    }
  853|       |
  854|  1.28M|    if (rd_less_than_thresh(best_rdc->rdcost, mode_rd_thresh,
  ------------------
  |  Branch (854:9): [True: 304, False: 1.27M]
  ------------------
  855|  1.28M|                            rd_thresh_freq_fact[mode_index]) &&
  856|    304|        (do_early_exit_rdthresh || this_mode == SMOOTH_PRED)) {
  ------------------
  |  Branch (856:10): [True: 131, False: 173]
  |  Branch (856:36): [True: 0, False: 173]
  ------------------
  857|    131|      continue;
  858|    131|    }
  859|  1.28M|    const BLOCK_SIZE uv_bsize =
  860|  1.28M|        get_plane_block_size(bsize, xd->plane[AOM_PLANE_U].subsampling_x,
  ------------------
  |  |  282|  1.28M|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  861|  1.28M|                             xd->plane[AOM_PLANE_U].subsampling_y);
  ------------------
  |  |  282|  1.28M|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  862|       |
  863|  1.28M|    mi->mode = this_mode;
  864|  1.28M|    mi->ref_frame[0] = INTRA_FRAME;
  865|  1.28M|    mi->ref_frame[1] = NONE_FRAME;
  866|       |
  867|  1.28M|    av1_invalid_rd_stats(&this_rdc);
  868|  1.28M|    args.mode = this_mode;
  869|  1.28M|    args.skippable = 1;
  870|  1.28M|    args.rdc = &this_rdc;
  871|  1.28M|    mi->tx_size = intra_tx_size;
  872|  1.28M|    compute_intra_yprediction(cm, this_mode, bsize, x, xd);
  873|       |    // Look into selecting tx_size here, based on prediction residual.
  874|  1.28M|    av1_block_yrd(x, &this_rdc, &args.skippable, bsize, mi->tx_size);
  875|       |    // TODO(kyslov@) Need to account for skippable
  876|  1.28M|    if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)]) {
  ------------------
  |  |   50|  1.28M|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (876:9): [True: 488k, False: 791k]
  ------------------
  877|   488k|      av1_foreach_transformed_block_in_plane(xd, uv_bsize, AOM_PLANE_U,
  ------------------
  |  |  282|   488k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  878|   488k|                                             av1_estimate_block_intra, &args);
  879|   488k|    }
  880|  1.28M|    if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]) {
  ------------------
  |  |   50|  1.28M|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (880:9): [True: 488k, False: 791k]
  ------------------
  881|   488k|      av1_foreach_transformed_block_in_plane(xd, uv_bsize, AOM_PLANE_V,
  ------------------
  |  |  283|   488k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
  882|   488k|                                             av1_estimate_block_intra, &args);
  883|   488k|    }
  884|       |
  885|  1.28M|    int mode_cost = 0;
  886|  1.28M|    if (av1_is_directional_mode(this_mode) && av1_use_angle_delta(bsize)) {
  ------------------
  |  Branch (886:9): [True: 691k, False: 588k]
  |  Branch (886:47): [True: 691k, False: 177]
  ------------------
  887|   691k|      mode_cost +=
  888|   691k|          x->mode_costs.angle_delta_cost[this_mode - V_PRED]
  889|   691k|                                        [MAX_ANGLE_DELTA +
  ------------------
  |  |  467|   691k|#define MAX_ANGLE_DELTA 3
  ------------------
  890|   691k|                                         mi->angle_delta[PLANE_TYPE_Y]];
  891|   691k|    }
  892|  1.28M|    if (this_mode == DC_PRED && av1_filter_intra_allowed_bsize(cm, bsize)) {
  ------------------
  |  Branch (892:9): [True: 597k, False: 682k]
  |  Branch (892:33): [True: 597k, False: 18.4E]
  ------------------
  893|   597k|      mode_cost += x->mode_costs.filter_intra_cost[bsize][0];
  894|   597k|    }
  895|  1.28M|    this_rdc.rate += ref_cost_intra;
  896|  1.28M|    this_rdc.rate += intra_cost_penalty;
  897|  1.28M|    this_rdc.rate += mode_cost;
  898|  1.28M|    this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist);
  ------------------
  |  |   33|  1.28M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.28M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.28M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.28M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  899|       |
  900|  1.28M|    if (is_screen_content && rt_sf->source_metrics_sb_nonrd) {
  ------------------
  |  Branch (900:9): [True: 0, False: 1.28M]
  |  Branch (900:30): [True: 0, False: 0]
  ------------------
  901|       |      // For blocks with low spatial variance and color sad,
  902|       |      // favor the intra-modes, only on scene/slide change.
  903|      0|      if (cpi->rc.high_source_sad && x->source_variance < 800 &&
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:38): [True: 0, False: 0]
  ------------------
  904|      0|          (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (904:12): [True: 0, False: 0]
  ------------------
  905|      0|           x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]))
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (905:12): [True: 0, False: 0]
  ------------------
  906|      0|        this_rdc.rdcost = CALC_BIASED_RDCOST(this_rdc.rdcost);
  ------------------
  |  |   22|      0|#define CALC_BIASED_RDCOST(rdcost) (7 * (rdcost) >> 3)
  ------------------
  907|       |      // Otherwise bias against intra for blocks with zero
  908|       |      // motion and no color, on non-scene/slide changes.
  909|      0|      else if (!cpi->rc.high_source_sad && x->source_variance > 0 &&
  ------------------
  |  Branch (909:16): [True: 0, False: 0]
  |  Branch (909:44): [True: 0, False: 0]
  ------------------
  910|      0|               x->content_state_sb.source_sad_nonrd == kZeroSad &&
  ------------------
  |  Branch (910:16): [True: 0, False: 0]
  ------------------
  911|      0|               x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (911:16): [True: 0, False: 0]
  ------------------
  912|      0|               x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 0)
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (912:16): [True: 0, False: 0]
  ------------------
  913|      0|        this_rdc.rdcost = (3 * this_rdc.rdcost) >> 1;
  914|      0|    }
  915|       |
  916|  1.28M|    if (this_rdc.rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (916:9): [True: 218k, False: 1.06M]
  ------------------
  917|   218k|      *best_rdc = this_rdc;
  918|   218k|      best_pickmode->best_mode = this_mode;
  919|   218k|      best_pickmode->best_tx_size = mi->tx_size;
  920|   218k|      best_pickmode->best_ref_frame = INTRA_FRAME;
  921|   218k|      best_pickmode->best_second_ref_frame = NONE;
  922|   218k|      best_pickmode->best_mode_skip_txfm = this_rdc.skip_txfm;
  923|   218k|      mi->uv_mode = this_mode;
  924|   218k|      mi->mv[0].as_int = INVALID_MV;
  ------------------
  |  |   26|   218k|#define INVALID_MV 0x80008000
  ------------------
  925|   218k|      mi->mv[1].as_int = INVALID_MV;
  ------------------
  |  |   26|   218k|#define INVALID_MV 0x80008000
  ------------------
  926|   218k|    }
  927|  1.28M|  }
  928|   596k|  mi->tx_size = best_pickmode->best_tx_size;
  929|       |
  930|   596k|  *best_sad_norm = args.best_sad >>
  931|   596k|                   (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
  932|   596k|}
nonrd_opt.c:aom_process_hadamard_lp_8x16:
   64|   468k|                                                int block_step) {
   65|   468k|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|   468k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   66|   468k|  const int bw = 4 * num_4x4_w;
   67|   468k|  const int num_4x4 = AOMMIN(num_4x4_w, max_blocks_wide);
  ------------------
  |  |   34|   468k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 468k]
  |  |  ------------------
  ------------------
   68|   468k|  int block = 0;
   69|       |
   70|  1.44M|  for (int r = 0; r < max_blocks_high; r += block_step) {
  ------------------
  |  Branch (70:19): [True: 978k, False: 468k]
  ------------------
   71|  2.12M|    for (int c = 0; c < num_4x4; c += 2 * block_step) {
  ------------------
  |  Branch (71:21): [True: 1.14M, False: 978k]
  ------------------
   72|  1.14M|      const int16_t *src_diff = &p->src_diff[(r * bw + c) << 2];
   73|  1.14M|      int16_t *low_coeff = (int16_t *)p->coeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  1.14M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
   74|  1.14M|      aom_hadamard_lp_8x8_dual(src_diff, (ptrdiff_t)bw, low_coeff);
   75|  1.14M|      block += 2 * step;
   76|  1.14M|    }
   77|   978k|  }
   78|   468k|}
nonrd_opt.c:update_yrd_loop_vars_hbd:
   90|   245k|    int tx_blk_id) {
   91|   245k|  const MACROBLOCKD *xd = &x->e_mbd;
   92|   245k|  const int is_txfm_skip = (ncoeffs == 0);
   93|   245k|  *skippable &= is_txfm_skip;
   94|   245k|  x->txfm_search_info.blk_skip[tx_blk_id] = is_txfm_skip;
   95|   245k|  *eob_cost += get_msb(ncoeffs + 1);
   96|       |
   97|   245k|  int64_t dummy;
   98|   245k|  if (ncoeffs == 1)
  ------------------
  |  Branch (98:7): [True: 7.32k, False: 238k]
  ------------------
   99|  7.32k|    this_rdc->rate += (int)abs(qcoeff[0]);
  100|   238k|  else if (ncoeffs > 1)
  ------------------
  |  Branch (100:12): [True: 234k, False: 3.69k]
  ------------------
  101|   234k|    this_rdc->rate += aom_satd(qcoeff, step << 4);
  102|   245k|  this_rdc->dist +=
  103|   245k|      av1_highbd_block_error(coeff, dqcoeff, step << 4, &dummy, xd->bd) >> 2;
  104|   245k|}
nonrd_opt.c:update_yrd_loop_vars:
   47|  5.80M|    int tx_blk_id) {
   48|  5.80M|  const int is_txfm_skip = (ncoeffs == 0);
   49|  5.80M|  *skippable &= is_txfm_skip;
   50|  5.80M|  x->txfm_search_info.blk_skip[tx_blk_id] = is_txfm_skip;
   51|  5.80M|  *eob_cost += get_msb(ncoeffs + 1);
   52|  5.80M|  if (ncoeffs == 1)
  ------------------
  |  Branch (52:7): [True: 15.7k, False: 5.78M]
  ------------------
   53|  15.7k|    this_rdc->rate += (int)abs(low_qcoeff[0]);
   54|  5.78M|  else if (ncoeffs > 1)
  ------------------
  |  Branch (54:12): [True: 5.75M, False: 32.3k]
  ------------------
   55|  5.75M|    this_rdc->rate += aom_satd_lp(low_qcoeff, step << 4);
   56|       |
   57|  5.80M|  this_rdc->dist += av1_block_error_lp(low_coeff, low_dqcoeff, step << 4) >> 2;
   58|  5.80M|}
nonrd_opt.c:is_prune_intra_mode:
  567|  2.38M|    uint8_t color_sensitivity[MAX_MB_PLANE - 1]) {
  568|  2.38M|  const PREDICTION_MODE this_mode = intra_mode_list[mode_index];
  569|  2.38M|  if (mode_index > 2 || force_intra_check == 0) {
  ------------------
  |  Branch (569:7): [True: 594k, False: 1.78M]
  |  Branch (569:25): [True: 1.78M, False: 2.19k]
  ------------------
  570|  2.38M|    if (!((1 << this_mode) & cpi->sf.rt_sf.intra_y_mode_bsize_mask_nrd[bsize]))
  ------------------
  |  Branch (570:9): [True: 765k, False: 1.61M]
  ------------------
  571|   765k|      return true;
  572|       |
  573|  1.61M|    if (this_mode == DC_PRED) return false;
  ------------------
  |  Branch (573:9): [True: 596k, False: 1.01M]
  ------------------
  574|       |
  575|  1.01M|    if (!cpi->sf.rt_sf.prune_hv_pred_modes_using_src_sad) return false;
  ------------------
  |  Branch (575:9): [True: 568k, False: 450k]
  ------------------
  576|       |
  577|   450k|    const bool has_color_sensitivity =
  578|   450k|        color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] &&
  ------------------
  |  |   50|   450k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (578:9): [True: 122k, False: 327k]
  ------------------
  579|   122k|        color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)];
  ------------------
  |  |   50|   122k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (579:9): [True: 122k, False: 561]
  ------------------
  580|   450k|    if (has_color_sensitivity &&
  ------------------
  |  Branch (580:9): [True: 122k, False: 328k]
  ------------------
  581|   122k|        (cpi->rc.frame_source_sad > 1.1 * cpi->rc.avg_source_sad ||
  ------------------
  |  Branch (581:10): [True: 121k, False: 310]
  ------------------
  582|    310|         cyclic_refresh_segment_id_boosted(segment_id) ||
  ------------------
  |  Branch (582:10): [True: 0, False: 310]
  ------------------
  583|    310|         source_sad_nonrd > kMedSad))
  ------------------
  |  Branch (583:10): [True: 116, False: 194]
  ------------------
  584|   121k|      return false;
  585|       |
  586|   328k|    return true;
  587|   450k|  }
  588|  1.72k|  return false;
  589|  2.38M|}
nonrd_opt.c:compute_intra_yprediction:
  522|  1.28M|                                      MACROBLOCK *x, MACROBLOCKD *xd) {
  523|  1.28M|  const SequenceHeader *seq_params = cm->seq_params;
  524|  1.28M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  1.28M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  525|  1.28M|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  1.28M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  526|  1.28M|  uint8_t *const src_buf_base = p->src.buf;
  527|  1.28M|  uint8_t *const dst_buf_base = pd->dst.buf;
  528|  1.28M|  const int src_stride = p->src.stride;
  529|  1.28M|  const int dst_stride = pd->dst.stride;
  530|  1.28M|  int plane = 0;
  531|  1.28M|  int row, col;
  532|       |  // block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
  533|       |  // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
  534|       |  // transform size varies per plane, look it up in a common way.
  535|  1.28M|  const TX_SIZE tx_size = max_txsize_lookup[bsize];
  536|  1.28M|  const BLOCK_SIZE plane_bsize =
  537|  1.28M|      get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
  538|       |  // If mb_to_right_edge is < 0 we are in a situation in which
  539|       |  // the current block size extends into the UMV and we won't
  540|       |  // visit the sub blocks that are wholly within the UMV.
  541|  1.28M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  542|  1.28M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  543|       |  // Keep track of the row and column of the blocks we use so that we know
  544|       |  // if we are in the unrestricted motion border.
  545|  2.58M|  for (row = 0; row < max_blocks_high; row += (1 << tx_size)) {
  ------------------
  |  Branch (545:17): [True: 1.30M, False: 1.28M]
  ------------------
  546|       |    // Skip visiting the sub blocks that are wholly within the UMV.
  547|  2.62M|    for (col = 0; col < max_blocks_wide; col += (1 << tx_size)) {
  ------------------
  |  Branch (547:19): [True: 1.32M, False: 1.30M]
  ------------------
  548|  1.32M|      p->src.buf = &src_buf_base[4 * (row * (int64_t)src_stride + col)];
  549|  1.32M|      pd->dst.buf = &dst_buf_base[4 * (row * (int64_t)dst_stride + col)];
  550|  1.32M|      av1_predict_intra_block(
  551|  1.32M|          xd, seq_params->sb_size, seq_params->enable_intra_edge_filter,
  552|  1.32M|          block_size_wide[bsize], block_size_high[bsize], tx_size, mode, 0, 0,
  553|  1.32M|          FILTER_INTRA_MODES, pd->dst.buf, dst_stride, pd->dst.buf, dst_stride,
  554|  1.32M|          0, 0, plane);
  555|  1.32M|    }
  556|  1.30M|  }
  557|  1.28M|  p->src.buf = src_buf_base;
  558|  1.28M|  pd->dst.buf = dst_buf_base;
  559|  1.28M|}

partition_search.c:get_model_rd_flag:
  431|     97|                                    BLOCK_SIZE bsize) {
  432|     97|  const AV1_COMMON *const cm = &cpi->common;
  433|     97|  const int large_block = bsize >= BLOCK_32X32;
  434|       |  // Only enable for low bitdepth to mitigate issue: b/303023614.
  435|     97|  return cpi->oxcf.rc_cfg.mode == AOM_CBR && large_block &&
  ------------------
  |  Branch (435:10): [True: 97, False: 0]
  |  Branch (435:46): [True: 47, False: 50]
  ------------------
  436|     47|         !cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) &&
  ------------------
  |  Branch (436:10): [True: 47, False: 0]
  ------------------
  437|     47|         cm->quant_params.base_qindex && !cpi->oxcf.use_highbitdepth;
  ------------------
  |  Branch (437:10): [True: 47, False: 0]
  |  Branch (437:42): [True: 47, False: 0]
  ------------------
  438|     97|}
nonrd_pickmode.c:init_estimate_block_intra_args:
  539|  5.09k|    struct estimate_block_intra_args *args, AV1_COMP *cpi, MACROBLOCK *x) {
  540|  5.09k|  args->cpi = cpi;
  541|  5.09k|  args->x = x;
  542|  5.09k|  args->mode = DC_PRED;
  543|  5.09k|  args->skippable = 1;
  544|  5.09k|  args->rdc = 0;
  545|  5.09k|  args->best_sad = UINT_MAX;
  546|  5.09k|  args->prune_mode_based_on_sad = false;
  547|       |  args->prune_palette_sad = false;
  548|  5.09k|}
nonrd_pickmode.c:init_mbmi_nonrd:
  520|   603k|                                   const AV1_COMMON *cm) {
  521|   603k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  522|   603k|  mbmi->ref_mv_idx = 0;
  523|   603k|  mbmi->mode = pred_mode;
  524|   603k|  mbmi->uv_mode = UV_DC_PRED;
  525|   603k|  mbmi->ref_frame[0] = ref_frame0;
  526|   603k|  mbmi->ref_frame[1] = ref_frame1;
  527|   603k|  pmi->palette_size[PLANE_TYPE_Y] = 0;
  528|   603k|  pmi->palette_size[PLANE_TYPE_UV] = 0;
  529|   603k|  mbmi->use_intrabc = 0;
  530|   603k|  mbmi->filter_intra_mode_info.use_filter_intra = 0;
  531|   603k|  mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0;
  532|   603k|  mbmi->motion_mode = SIMPLE_TRANSLATION;
  533|   603k|  mbmi->num_proj_ref = 1;
  534|   603k|  mbmi->interintra_mode = 0;
  535|   603k|  set_default_interp_filters(mbmi, cm->features.interp_filter);
  536|   603k|}
nonrd_pickmode.c:store_coding_context_nonrd:
  582|   603k|                                              PICK_MODE_CONTEXT *ctx) {
  583|   603k|#endif  // CONFIG_INTERNAL_STATS
  584|   603k|  MACROBLOCKD *const xd = &x->e_mbd;
  585|   603k|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
  586|       |
  587|       |  // Take a snapshot of the coding context so it can be
  588|       |  // restored if we decide to encode this way
  589|   603k|  ctx->rd_stats.skip_txfm = txfm_info->skip_txfm;
  590|       |
  591|   603k|  ctx->skippable = txfm_info->skip_txfm;
  592|       |#if CONFIG_INTERNAL_STATS
  593|       |  ctx->best_mode_index = mode_index;
  594|       |#endif  // CONFIG_INTERNAL_STATS
  595|   603k|  ctx->mic = *xd->mi[0];
  596|   603k|  ctx->skippable = txfm_info->skip_txfm;
  597|   603k|  av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, &x->mbmi_ext,
  598|   603k|                                      av1_ref_frame_type(xd->mi[0]->ref_frame));
  599|   603k|}
nonrd_pickmode.c:find_predictors:
  468|   598k|    int force_skip_low_temp_var, int skip_pred_mv, bool *use_scaled_ref_frame) {
  469|   598k|  AV1_COMMON *const cm = &cpi->common;
  470|   598k|  MACROBLOCKD *const xd = &x->e_mbd;
  471|   598k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  472|   598k|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
  473|   598k|  const YV12_BUFFER_CONFIG *ref = get_ref_frame_yv12_buf(cm, ref_frame);
  474|   598k|  const bool ref_is_scaled =
  475|   598k|      ref->y_crop_height != cm->height || ref->y_crop_width != cm->width;
  ------------------
  |  Branch (475:7): [True: 474k, False: 123k]
  |  Branch (475:43): [True: 56.1k, False: 67.1k]
  ------------------
  476|   598k|  const YV12_BUFFER_CONFIG *scaled_ref =
  477|   598k|      av1_get_scaled_ref_frame(cpi, ref_frame);
  478|   598k|  const YV12_BUFFER_CONFIG *yv12 =
  479|   598k|      ref_is_scaled && scaled_ref ? scaled_ref : ref;
  ------------------
  |  Branch (479:7): [True: 530k, False: 67.3k]
  |  Branch (479:24): [True: 530k, False: 49]
  ------------------
  480|   598k|  const int num_planes = av1_num_planes(cm);
  481|   598k|  x->pred_mv_sad[ref_frame] = INT_MAX;
  482|   598k|  x->pred_mv0_sad[ref_frame] = INT_MAX;
  483|   598k|  x->pred_mv1_sad[ref_frame] = INT_MAX;
  484|   598k|  frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
  ------------------
  |  |   26|   598k|#define INVALID_MV 0x80008000
  ------------------
  485|       |  // TODO(kyslov) this needs various further optimizations. to be continued..
  486|   598k|  assert(yv12 != NULL);
  487|   598k|  if (yv12 != NULL) {
  ------------------
  |  Branch (487:7): [True: 597k, False: 485]
  ------------------
  488|   597k|    struct scale_factors *const sf =
  489|   597k|        scaled_ref ? NULL : get_ref_scale_factors(cm, ref_frame);
  ------------------
  |  Branch (489:9): [True: 530k, False: 67.1k]
  ------------------
  490|   597k|    av1_setup_pred_block(xd, yv12_mb[ref_frame], yv12, sf, sf, num_planes);
  491|   597k|    av1_find_mv_refs(cm, xd, mbmi, ref_frame, mbmi_ext->ref_mv_count,
  492|   597k|                     xd->ref_mv_stack, xd->weight, NULL, mbmi_ext->global_mvs,
  493|   597k|                     mbmi_ext->mode_context);
  494|       |    // TODO(Ravi): Populate mbmi_ext->ref_mv_stack[ref_frame][4] and
  495|       |    // mbmi_ext->weight[ref_frame][4] inside av1_find_mv_refs.
  496|   597k|    av1_copy_usable_ref_mv_stack_and_weight(xd, mbmi_ext, ref_frame);
  497|   597k|    av1_find_best_ref_mvs_from_stack(
  498|   597k|        cm->features.allow_high_precision_mv, mbmi_ext, ref_frame,
  499|   597k|        &frame_mv[NEARESTMV][ref_frame], &frame_mv[NEARMV][ref_frame], 0);
  500|   597k|    frame_mv[GLOBALMV][ref_frame] = mbmi_ext->global_mvs[ref_frame];
  501|       |    // Early exit for non-LAST frame if force_skip_low_temp_var is set.
  502|   598k|    if (!is_one_pass_rt_lag_params(cpi) && !ref_is_scaled &&
  ------------------
  |  Branch (502:9): [True: 598k, False: 18.4E]
  |  Branch (502:44): [True: 67.3k, False: 531k]
  ------------------
  503|  67.3k|        bsize >= BLOCK_8X8 && !skip_pred_mv &&
  ------------------
  |  Branch (503:9): [True: 67.2k, False: 5]
  |  Branch (503:31): [True: 67.3k, False: 18.4E]
  ------------------
  504|  67.3k|        !(force_skip_low_temp_var && ref_frame != LAST_FRAME)) {
  ------------------
  |  Branch (504:11): [True: 0, False: 67.3k]
  |  Branch (504:38): [True: 0, False: 0]
  ------------------
  505|  67.3k|      av1_mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12->y_stride, ref_frame,
  506|  67.3k|                  bsize);
  507|  67.3k|    }
  508|   597k|  }
  509|   599k|  if (cm->features.switchable_motion_mode) {
  ------------------
  |  Branch (509:7): [True: 599k, False: 18.4E]
  ------------------
  510|   599k|    av1_count_overlappable_neighbors(cm, xd);
  511|   599k|  }
  512|   598k|  mbmi->num_proj_ref = 1;
  513|   598k|  *use_scaled_ref_frame = ref_is_scaled && scaled_ref;
  ------------------
  |  Branch (513:27): [True: 531k, False: 66.6k]
  |  Branch (513:44): [True: 531k, False: 18.4E]
  ------------------
  514|   598k|}
nonrd_pickmode.c:get_model_rd_flag:
  431|   598k|                                    BLOCK_SIZE bsize) {
  432|   598k|  const AV1_COMMON *const cm = &cpi->common;
  433|   598k|  const int large_block = bsize >= BLOCK_32X32;
  434|       |  // Only enable for low bitdepth to mitigate issue: b/303023614.
  435|   598k|  return cpi->oxcf.rc_cfg.mode == AOM_CBR && large_block &&
  ------------------
  |  Branch (435:10): [True: 598k, False: 80]
  |  Branch (435:46): [True: 17.9k, False: 580k]
  ------------------
  436|  17.9k|         !cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) &&
  ------------------
  |  Branch (436:10): [True: 17.9k, False: 2]
  ------------------
  437|  17.9k|         cm->quant_params.base_qindex && !cpi->oxcf.use_highbitdepth;
  ------------------
  |  Branch (437:10): [True: 17.9k, False: 18.4E]
  |  Branch (437:42): [True: 17.8k, False: 105]
  ------------------
  438|   598k|}
nonrd_opt.c:init_estimate_block_intra_args:
  539|   596k|    struct estimate_block_intra_args *args, AV1_COMP *cpi, MACROBLOCK *x) {
  540|   596k|  args->cpi = cpi;
  541|   596k|  args->x = x;
  542|   596k|  args->mode = DC_PRED;
  543|   596k|  args->skippable = 1;
  544|   596k|  args->rdc = 0;
  545|   596k|  args->best_sad = UINT_MAX;
  546|   596k|  args->prune_mode_based_on_sad = false;
  547|       |  args->prune_palette_sad = false;
  548|   596k|}
nonrd_opt.c:prune_palette_testing_inter:
  561|   596k|                                               unsigned int source_variance) {
  562|   596k|  return (
  563|   596k|      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (563:7): [True: 0, False: 596k]
  ------------------
  564|      0|      cpi->oxcf.speed >= 11 && cpi->rc.high_source_sad &&
  ------------------
  |  Branch (564:7): [True: 0, False: 0]
  |  Branch (564:32): [True: 0, False: 0]
  ------------------
  565|      0|      ((cpi->sf.rt_sf.prune_palette_search_nonrd > 2) ||
  ------------------
  |  Branch (565:8): [True: 0, False: 0]
  ------------------
  566|      0|       (cpi->sf.rt_sf.rc_compute_spatial_var_sc_kf &&
  ------------------
  |  Branch (566:9): [True: 0, False: 0]
  ------------------
  567|      0|        cpi->rc.frame_spatial_variance < 1200 &&
  ------------------
  |  Branch (567:9): [True: 0, False: 0]
  ------------------
  568|      0|        cpi->rc.perc_spatial_flat_blocks < 5 &&
  ------------------
  |  Branch (568:9): [True: 0, False: 0]
  ------------------
  569|      0|        cpi->rc.percent_blocks_with_motion > 98 && source_variance < 4000)));
  ------------------
  |  Branch (569:9): [True: 0, False: 0]
  |  Branch (569:52): [True: 0, False: 0]
  ------------------
  570|   596k|}

av1_nonrd_pick_intra_mode:
 1776|  5.09k|                               BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) {
 1777|  5.09k|  AV1_COMMON *const cm = &cpi->common;
 1778|  5.09k|  MACROBLOCKD *const xd = &x->e_mbd;
 1779|  5.09k|  MB_MODE_INFO *const mi = xd->mi[0];
 1780|  5.09k|  RD_STATS this_rdc, best_rdc;
 1781|  5.09k|  struct estimate_block_intra_args args;
 1782|  5.09k|  init_estimate_block_intra_args(&args, cpi, x);
 1783|  5.09k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 1784|  5.09k|  const int mi_row = xd->mi_row;
 1785|  5.09k|  const int mi_col = xd->mi_col;
 1786|  5.09k|  mi->tx_size =
 1787|  5.09k|      AOMMIN(max_txsize_lookup[bsize],
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 5.09k, False: 18.4E]
  |  |  ------------------
  ------------------
 1788|  5.09k|             tx_mode_to_biggest_tx_size[txfm_params->tx_mode_search_type]);
 1789|       |  // For flat blocks at high qp, along the top/left boundary, cap the
 1790|       |  // transform size to 16x16. This is avoid chessboard artifact that
 1791|       |  // can occur for flat input at high QP.
 1792|  5.09k|  if (cm->quant_params.base_qindex > 150 && x->source_variance == 0 &&
  ------------------
  |  Branch (1792:7): [True: 4.47k, False: 617]
  |  Branch (1792:45): [True: 0, False: 4.47k]
  ------------------
 1793|      0|      (mi_row == 0 || mi_col == 0) && mi->tx_size > TX_16X16) {
  ------------------
  |  Branch (1793:8): [True: 0, False: 0]
  |  Branch (1793:23): [True: 0, False: 0]
  |  Branch (1793:39): [True: 0, False: 0]
  ------------------
 1794|      0|    mi->tx_size = TX_16X16;
 1795|      0|  }
 1796|  5.09k|  assert(IMPLIES(xd->lossless[mi->segment_id], mi->tx_size == TX_4X4));
 1797|  5.09k|  const BLOCK_SIZE tx_bsize = txsize_to_bsize[mi->tx_size];
 1798|       |
 1799|       |  // If the current block size is the same as the transform block size, enable
 1800|       |  // mode pruning based on the best SAD so far.
 1801|  5.09k|  if (cpi->sf.rt_sf.prune_intra_mode_using_best_sad_so_far && bsize == tx_bsize)
  ------------------
  |  Branch (1801:7): [True: 0, False: 5.09k]
  |  Branch (1801:63): [True: 0, False: 0]
  ------------------
 1802|      0|    args.prune_mode_based_on_sad = true;
 1803|       |
 1804|  5.09k|  int *bmode_costs;
 1805|  5.09k|  PREDICTION_MODE best_mode = DC_PRED;
 1806|  5.09k|  const MB_MODE_INFO *above_mi = xd->above_mbmi;
 1807|  5.09k|  const MB_MODE_INFO *left_mi = xd->left_mbmi;
 1808|  5.09k|  const PREDICTION_MODE A = av1_above_block_mode(above_mi);
 1809|  5.09k|  const PREDICTION_MODE L = av1_left_block_mode(left_mi);
 1810|  5.09k|  const int above_ctx = intra_mode_context[A];
 1811|  5.09k|  const int left_ctx = intra_mode_context[L];
 1812|  5.09k|  const unsigned int source_variance = x->source_variance;
 1813|  5.09k|  bmode_costs = x->mode_costs.y_mode_costs[above_ctx][left_ctx];
 1814|       |  // Use this flag to signal large flat blocks that may need special
 1815|       |  // treatment: in the current case H/V/SMOOTH may not be skipped if
 1816|       |  // DC has nonzero distortion and skippable is set. This is to remove
 1817|       |  // visual artifacts observed for screen in realtime mode.
 1818|  5.09k|  const bool flat_blocks_screen =
 1819|  5.09k|      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (1819:7): [True: 0, False: 5.09k]
  ------------------
 1820|      0|      cpi->oxcf.mode == REALTIME && x->source_variance == 0 &&
  ------------------
  |  Branch (1820:7): [True: 0, False: 0]
  |  Branch (1820:37): [True: 0, False: 0]
  ------------------
 1821|      0|      bsize >= BLOCK_32X32;
  ------------------
  |  Branch (1821:7): [True: 0, False: 0]
  ------------------
 1822|  5.09k|  av1_invalid_rd_stats(&best_rdc);
 1823|  5.09k|  av1_invalid_rd_stats(&this_rdc);
 1824|       |
 1825|  5.09k|  init_mbmi_nonrd(mi, DC_PRED, INTRA_FRAME, NONE_FRAME, cm);
 1826|  5.09k|  mi->mv[0].as_int = mi->mv[1].as_int = INVALID_MV;
  ------------------
  |  |   26|  5.09k|#define INVALID_MV 0x80008000
  ------------------
 1827|       |
 1828|  5.09k|  bool allow_skip_nondc = true;
 1829|  5.09k|  bool palette_selected = false;
 1830|       |  // Change the limit of this loop to add other intra prediction
 1831|       |  // mode tests.
 1832|  25.4k|  for (int mode_index = 0; mode_index < RTC_INTRA_MODES; ++mode_index) {
  ------------------
  |  |   20|  25.4k|#define RTC_INTRA_MODES (4)
  ------------------
  |  Branch (1832:28): [True: 20.3k, False: 5.09k]
  ------------------
 1833|  20.3k|    PREDICTION_MODE this_mode = intra_mode_list[mode_index];
 1834|       |
 1835|       |    // Force DC for spatially flat block for large bsize, on top-left corner.
 1836|       |    // This removed potential artifact observed in gray scale image for high Q.
 1837|  20.3k|    if (x->source_variance == 0 && mi_col == 0 && mi_row == 0 &&
  ------------------
  |  Branch (1837:9): [True: 0, False: 20.3k]
  |  Branch (1837:36): [True: 0, False: 0]
  |  Branch (1837:51): [True: 0, False: 0]
  ------------------
 1838|      0|        bsize >= BLOCK_32X32 && this_mode > 0)
  ------------------
  |  Branch (1838:9): [True: 0, False: 0]
  |  Branch (1838:33): [True: 0, False: 0]
  ------------------
 1839|      0|      continue;
 1840|       |
 1841|       |    // As per the statistics generated for intra mode evaluation in the nonrd
 1842|       |    // path, it is found that the probability of H_PRED mode being the winner is
 1843|       |    // very low when the best mode so far is V_PRED (out of DC_PRED and V_PRED).
 1844|       |    // If V_PRED is the winner mode out of DC_PRED and V_PRED, it could imply
 1845|       |    // the presence of a vertically dominant pattern. Hence, H_PRED mode is not
 1846|       |    // evaluated.
 1847|  20.3k|    if (cpi->sf.rt_sf.prune_h_pred_using_best_mode_so_far &&
  ------------------
  |  Branch (1847:9): [True: 0, False: 20.3k]
  ------------------
 1848|      0|        this_mode == H_PRED && best_mode == V_PRED && allow_skip_nondc)
  ------------------
  |  Branch (1848:9): [True: 0, False: 0]
  |  Branch (1848:32): [True: 0, False: 0]
  |  Branch (1848:55): [True: 0, False: 0]
  ------------------
 1849|      0|      continue;
 1850|       |
 1851|  20.3k|    if (should_prune_intra_modes_using_neighbors(
  ------------------
  |  Branch (1851:9): [True: 0, False: 20.3k]
  ------------------
 1852|  20.3k|            xd, cpi->sf.rt_sf.enable_intra_mode_pruning_using_neighbors,
 1853|  20.3k|            this_mode, A, L)) {
 1854|       |      // Prune V_PRED and H_PRED if source variance of the block is less than
 1855|       |      // or equal to 50. The source variance threshold is obtained empirically.
 1856|      0|      if ((this_mode == V_PRED || this_mode == H_PRED) &&
  ------------------
  |  Branch (1856:12): [True: 0, False: 0]
  |  Branch (1856:35): [True: 0, False: 0]
  ------------------
 1857|      0|          source_variance <= 50 && allow_skip_nondc)
  ------------------
  |  Branch (1857:11): [True: 0, False: 0]
  |  Branch (1857:36): [True: 0, False: 0]
  ------------------
 1858|      0|        continue;
 1859|       |
 1860|       |      // As per the statistics, probability of SMOOTH_PRED being the winner is
 1861|       |      // low when best mode so far is DC_PRED (out of DC_PRED, V_PRED and
 1862|       |      // H_PRED). Hence, SMOOTH_PRED mode is not evaluated.
 1863|      0|      if (best_mode == DC_PRED && this_mode == SMOOTH_PRED && allow_skip_nondc)
  ------------------
  |  Branch (1863:11): [True: 0, False: 0]
  |  Branch (1863:35): [True: 0, False: 0]
  |  Branch (1863:63): [True: 0, False: 0]
  ------------------
 1864|      0|        continue;
 1865|      0|    }
 1866|       |
 1867|  20.3k|    this_rdc.dist = this_rdc.rate = 0;
 1868|  20.3k|    args.mode = this_mode;
 1869|  20.3k|    args.skippable = 1;
 1870|  20.3k|    args.rdc = &this_rdc;
 1871|  20.3k|    mi->mode = this_mode;
 1872|  20.3k|    av1_foreach_transformed_block_in_plane(xd, bsize, AOM_PLANE_Y,
  ------------------
  |  |  281|  20.3k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1873|  20.3k|                                           av1_estimate_block_intra, &args);
 1874|       |
 1875|  20.3k|    if (this_rdc.rate == INT_MAX) continue;
  ------------------
  |  Branch (1875:9): [True: 0, False: 20.3k]
  ------------------
 1876|       |
 1877|  20.3k|    const int skip_ctx = av1_get_skip_txfm_context(xd);
 1878|  20.3k|    if (args.skippable) {
  ------------------
  |  Branch (1878:9): [True: 263, False: 20.1k]
  ------------------
 1879|    263|      this_rdc.rate = x->mode_costs.skip_txfm_cost[skip_ctx][1];
 1880|  20.1k|    } else {
 1881|  20.1k|      this_rdc.rate += x->mode_costs.skip_txfm_cost[skip_ctx][0];
 1882|  20.1k|    }
 1883|  20.3k|    this_rdc.rate += bmode_costs[this_mode];
 1884|  20.3k|    this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist);
  ------------------
  |  |   33|  20.3k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  20.3k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  20.3k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  20.3k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1885|  20.3k|    if (this_rdc.rdcost < best_rdc.rdcost) {
  ------------------
  |  Branch (1885:9): [True: 7.12k, False: 13.2k]
  ------------------
 1886|  7.12k|      best_rdc = this_rdc;
 1887|  7.12k|      best_mode = this_mode;
 1888|  7.12k|    }
 1889|  20.3k|    if (this_mode == DC_PRED) {
  ------------------
  |  Branch (1889:9): [True: 5.10k, False: 15.2k]
  ------------------
 1890|  5.10k|      if (flat_blocks_screen && args.skippable && this_rdc.dist > 0)
  ------------------
  |  Branch (1890:11): [True: 0, False: 5.10k]
  |  Branch (1890:33): [True: 0, False: 0]
  |  Branch (1890:51): [True: 0, False: 0]
  ------------------
 1891|      0|        allow_skip_nondc = false;
 1892|  5.10k|    }
 1893|  20.3k|  }
 1894|       |
 1895|  5.09k|  const unsigned int thresh_sad =
 1896|  5.09k|      cpi->sf.rt_sf.prune_palette_search_nonrd > 1 ? 100 : 20;
  ------------------
  |  Branch (1896:7): [True: 0, False: 5.09k]
  ------------------
 1897|  5.09k|  const unsigned int best_sad_norm =
 1898|  5.09k|      args.best_sad >>
 1899|  5.09k|      (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
 1900|       |
 1901|       |  // Try palette if it's enabled.
 1902|  5.09k|  bool try_palette =
 1903|  5.09k|      cpi->oxcf.tool_cfg.enable_palette &&
  ------------------
  |  Branch (1903:7): [True: 5.10k, False: 18.4E]
  ------------------
 1904|  5.10k|      av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  ------------------
  |  Branch (1904:7): [True: 0, False: 5.10k]
  ------------------
 1905|  5.10k|                        mi->bsize);
 1906|  5.09k|  if (cpi->sf.rt_sf.prune_palette_search_nonrd > 0) {
  ------------------
  |  Branch (1906:7): [True: 0, False: 5.09k]
  ------------------
 1907|      0|    bool prune =
 1908|      0|        (!args.prune_mode_based_on_sad || best_sad_norm > thresh_sad) &&
  ------------------
  |  Branch (1908:10): [True: 0, False: 0]
  |  Branch (1908:43): [True: 0, False: 0]
  ------------------
 1909|      0|        bsize <= BLOCK_16X16 && x->source_variance > 200;
  ------------------
  |  Branch (1909:9): [True: 0, False: 0]
  |  Branch (1909:33): [True: 0, False: 0]
  ------------------
 1910|      0|    try_palette &= prune;
 1911|      0|  }
 1912|  5.09k|  if (try_palette) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 5.09k]
  ------------------
 1913|      0|    const unsigned int intra_ref_frame_cost = 0;
 1914|      0|    x->color_palette_thresh = (best_sad_norm < 500) ? 32 : 64;
  ------------------
  |  Branch (1914:31): [True: 0, False: 0]
  ------------------
 1915|       |
 1916|       |    // Search palette mode for Luma plane in intra frame.
 1917|      0|    av1_search_palette_mode_luma(cpi, x, bsize, intra_ref_frame_cost, ctx,
 1918|      0|                                 &this_rdc, best_rdc.rdcost);
 1919|       |    // Update best mode data.
 1920|      0|    if (this_rdc.rdcost < best_rdc.rdcost) {
  ------------------
  |  Branch (1920:9): [True: 0, False: 0]
  ------------------
 1921|      0|      palette_selected = true;
 1922|      0|      best_mode = DC_PRED;
 1923|      0|      mi->mv[0].as_int = INVALID_MV;
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
 1924|      0|      mi->mv[1].as_int = INVALID_MV;
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
 1925|      0|      best_rdc.rate = this_rdc.rate;
 1926|      0|      best_rdc.dist = this_rdc.dist;
 1927|      0|      best_rdc.rdcost = this_rdc.rdcost;
 1928|      0|      if (xd->tx_type_map[0] != DCT_DCT)
  ------------------
  |  Branch (1928:11): [True: 0, False: 0]
  ------------------
 1929|      0|        av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|      0|  do {                                                    \
  |  |   39|      0|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|      0|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1930|      0|    } else {
 1931|      0|      av1_zero(mi->palette_mode_info);
  ------------------
  |  |   43|      0|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1932|      0|    }
 1933|      0|  }
 1934|       |
 1935|  5.09k|  bool try_intrabc =
 1936|  5.09k|      cpi->sf.rt_sf.rt_use_intrabc && av1_allow_intrabc(cm) &&
  ------------------
  |  Branch (1936:7): [True: 0, False: 5.09k]
  |  Branch (1936:39): [True: 0, False: 0]
  ------------------
 1937|      0|      bsize <= BLOCK_16X16 &&
  ------------------
  |  Branch (1937:7): [True: 0, False: 0]
  ------------------
 1938|      0|      (!cpi->sf.rt_sf.rt_prune_intrabc_nonrd || palette_selected);
  ------------------
  |  Branch (1938:8): [True: 0, False: 0]
  |  Branch (1938:49): [True: 0, False: 0]
  ------------------
 1939|       |
 1940|  5.09k|  if (try_intrabc) {
  ------------------
  |  Branch (1940:7): [True: 0, False: 5.09k]
  ------------------
 1941|      0|    int_mv best_dv;
 1942|      0|    av1_search_intrabc_nonrd(cpi, x, bsize, &this_rdc, &best_dv);
 1943|      0|    if (this_rdc.rdcost < best_rdc.rdcost) {
  ------------------
  |  Branch (1943:9): [True: 0, False: 0]
  ------------------
 1944|      0|      best_rdc = this_rdc;
 1945|      0|      best_mode = DC_PRED;
 1946|      0|      mi->use_intrabc = 1;
 1947|      0|      mi->mv[0] = best_dv;
 1948|      0|      mi->uv_mode = UV_DC_PRED;
 1949|      0|      mi->motion_mode = SIMPLE_TRANSLATION;
 1950|      0|      mi->interp_filters = av1_broadcast_interp_filter(BILINEAR);
 1951|      0|      memset(&mi->palette_mode_info, 0, sizeof(mi->palette_mode_info));
 1952|      0|      memset(mi->inter_tx_size, mi->tx_size, sizeof(mi->inter_tx_size));
 1953|      0|    } else {
 1954|      0|      mi->use_intrabc = 0;
 1955|      0|    }
 1956|      0|  }
 1957|       |
 1958|  5.09k|  mi->mode = best_mode;
 1959|       |  // Keep DC for UV since mode test is based on Y channel only.
 1960|  5.09k|  mi->uv_mode = UV_DC_PRED;
 1961|  5.09k|  *rd_cost = best_rdc;
 1962|       |
 1963|       |  // For lossless: always force the skip flags off.
 1964|       |  // Even though the blk_skip is set to 0 above in the rdcost comparison,
 1965|       |  // do it here again in case the above logic changes.
 1966|  5.09k|  if (is_lossless_requested(&cpi->oxcf.rc_cfg)) {
  ------------------
  |  Branch (1966:7): [True: 0, False: 5.09k]
  ------------------
 1967|      0|    x->txfm_search_info.skip_txfm = 0;
 1968|      0|  }
 1969|       |
 1970|       |#if CONFIG_INTERNAL_STATS
 1971|       |  store_coding_context_nonrd(x, ctx, mi->mode);
 1972|       |#else
 1973|  5.09k|  store_coding_context_nonrd(x, ctx);
 1974|  5.09k|#endif  // CONFIG_INTERNAL_STATS
 1975|  5.09k|}
av1_nonrd_pick_inter_mode_sb:
 3505|   598k|                                  BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) {
 3506|   598k|  AV1_COMMON *const cm = &cpi->common;
 3507|   598k|  SVC *const svc = &cpi->svc;
 3508|   598k|  MACROBLOCKD *const xd = &x->e_mbd;
 3509|   598k|  MB_MODE_INFO *const mi = xd->mi[0];
 3510|   598k|  const struct segmentation *const seg = &cm->seg;
 3511|   598k|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|   598k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 3512|   598k|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 3513|   598k|  MV_REFERENCE_FRAME ref_frame, ref_frame2;
 3514|   598k|  const unsigned char segment_id = mi->segment_id;
 3515|   598k|  int best_early_term = 0;
 3516|   598k|  int force_skip_low_temp_var = 0;
 3517|   598k|  unsigned int sse_zeromv_norm = UINT_MAX;
 3518|   598k|  const int num_inter_modes =
 3519|   598k|      is_one_pass_rt_lag_params(cpi) ? NUM_INTER_MODES_FULL : NUM_INTER_MODES;
  ------------------
  |  |   26|      0|#define NUM_INTER_MODES_FULL 28
  ------------------
                    is_one_pass_rt_lag_params(cpi) ? NUM_INTER_MODES_FULL : NUM_INTER_MODES;
  ------------------
  |  |   25|   598k|#define NUM_INTER_MODES 12
  ------------------
  |  Branch (3519:7): [True: 0, False: 598k]
  ------------------
 3520|   598k|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
 3521|   598k|  bool check_globalmv = rt_sf->check_globalmv_on_single_ref;
 3522|   598k|  PRED_BUFFER tmp_buffer[4];
 3523|   598k|  DECLARE_ALIGNED(16, uint8_t, pred_buf[MAX_MB_PLANE * MAX_SB_SQUARE]);
  ------------------
  |  |   19|   598k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 3524|   598k|  PRED_BUFFER *this_mode_pred = NULL;
 3525|   598k|  const int reuse_inter_pred =
 3526|   598k|      rt_sf->reuse_inter_pred_nonrd && cm->seq_params->bit_depth == AOM_BITS_8;
  ------------------
  |  Branch (3526:7): [True: 0, False: 598k]
  |  Branch (3526:40): [True: 0, False: 0]
  ------------------
 3527|   598k|  InterModeSearchStateNonrd search_state;
 3528|   598k|  av1_zero(search_state.use_ref_frame_mask);
  ------------------
  |  |   43|   598k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3529|   598k|  av1_zero(search_state.use_scaled_ref_frame);
  ------------------
  |  |   43|   598k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3530|   598k|  BEST_PICKMODE *const best_pickmode = &search_state.best_pickmode;
 3531|   598k|  (void)tile_data;
 3532|       |
 3533|   598k|  const int bh = block_size_high[bsize];
 3534|   598k|  const int bw = block_size_wide[bsize];
 3535|   598k|  const int pixels_in_block = bh * bw;
 3536|   598k|  struct buf_2d orig_dst = pd->dst;
 3537|   598k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 3538|   598k|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 3539|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3540|       |  // Mode statistics can be collected only when num_workers is 1
 3541|       |  assert(cpi->mt_info.num_workers <= 1);
 3542|       |  aom_usec_timer_start(&x->ms_stat_nonrd.bsize_timer);
 3543|       |#endif
 3544|   598k|  int64_t thresh_sad_pred = INT64_MAX;
 3545|   598k|  const int mi_row = xd->mi_row;
 3546|   598k|  const int mi_col = xd->mi_col;
 3547|   598k|  int_mv svc_mv = { .as_int = 0 };
 3548|   598k|  int force_mv_inter_layer = 0;
 3549|   598k|  bool comp_use_zero_zeromv_only = 0;
 3550|   598k|  int tot_num_comp_modes = is_one_pass_rt_lag_params(cpi)
  ------------------
  |  Branch (3550:28): [True: 0, False: 598k]
  ------------------
 3551|   598k|                               ? NUM_COMP_INTER_MODES_RT_FULL
  ------------------
  |  |   24|      0|#define NUM_COMP_INTER_MODES_RT_FULL (10)
  ------------------
 3552|   598k|                               : NUM_COMP_INTER_MODES_RT;
  ------------------
  |  |   23|   598k|#define NUM_COMP_INTER_MODES_RT (6)
  ------------------
 3553|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3554|       |  const int denoise_recheck_zeromv = 1;
 3555|       |  AV1_PICKMODE_CTX_DEN ctx_den;
 3556|       |  int64_t zero_last_cost_orig = INT64_MAX;
 3557|       |  int denoise_svc_pickmode = 1;
 3558|       |  const int resize_pending = is_frame_resize_pending(cpi);
 3559|       |#endif
 3560|   598k|  const ModeCosts *mode_costs = &x->mode_costs;
 3561|   598k|  struct scale_factors sf_no_scale;
 3562|   598k|  av1_setup_scale_factors_for_frame(&sf_no_scale, cm->width, cm->height,
 3563|   598k|                                    cm->width, cm->height);
 3564|   598k|  if (reuse_inter_pred) {
  ------------------
  |  Branch (3564:7): [True: 0, False: 598k]
  ------------------
 3565|      0|    for (int buf_idx = 0; buf_idx < 3; buf_idx++) {
  ------------------
  |  Branch (3565:27): [True: 0, False: 0]
  ------------------
 3566|      0|      tmp_buffer[buf_idx].data = &pred_buf[pixels_in_block * buf_idx];
 3567|      0|      tmp_buffer[buf_idx].stride = bw;
 3568|      0|      tmp_buffer[buf_idx].in_use = 0;
 3569|      0|    }
 3570|      0|    tmp_buffer[3].data = pd->dst.buf;
 3571|      0|    tmp_buffer[3].stride = pd->dst.stride;
 3572|      0|    tmp_buffer[3].in_use = 0;
 3573|      0|  }
 3574|       |
 3575|   598k|  const int gf_temporal_ref = is_same_gf_and_last_scale(cm);
 3576|       |
 3577|       |  // If the lower spatial layer uses an averaging filter for downsampling
 3578|       |  // (phase = 8), the target decimated pixel is shifted by (1/2, 1/2) relative
 3579|       |  // to source, so use subpel motion vector to compensate. The nonzero motion
 3580|       |  // is half pixel shifted to left and top, so (-4, -4). This has more effect
 3581|       |  // on higher resolutions, so condition it on that for now.
 3582|       |  // Exclude quality layers, which have the same resolution and hence no shift.
 3583|   598k|  if (cpi->ppi->use_svc && svc->spatial_layer_id > 0 &&
  ------------------
  |  Branch (3583:7): [True: 0, False: 598k]
  |  Branch (3583:28): [True: 0, False: 0]
  ------------------
 3584|      0|      !svc->has_lower_quality_layer &&
  ------------------
  |  Branch (3584:7): [True: 0, False: 0]
  ------------------
 3585|      0|      svc->downsample_filter_phase[svc->spatial_layer_id - 1] == 8 &&
  ------------------
  |  Branch (3585:7): [True: 0, False: 0]
  ------------------
 3586|      0|      cm->width * cm->height > 640 * 480) {
  ------------------
  |  Branch (3586:7): [True: 0, False: 0]
  ------------------
 3587|      0|    svc_mv.as_mv.row = -4;
 3588|      0|    svc_mv.as_mv.col = -4;
 3589|      0|  }
 3590|       |
 3591|       |  // Setup parameters used for inter mode evaluation.
 3592|   598k|  set_params_nonrd_pick_inter_mode(cpi, x, &search_state, rd_cost,
 3593|   598k|                                   &force_skip_low_temp_var, mi_row, mi_col,
 3594|   598k|                                   gf_temporal_ref, segment_id, bsize
 3595|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3596|       |                                   ,
 3597|       |                                   ctx, denoise_svc_pickmode
 3598|       |#endif
 3599|   598k|  );
 3600|       |
 3601|   598k|  if (rt_sf->use_comp_ref_nonrd && is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (3601:7): [True: 523k, False: 75.4k]
  |  Branch (3601:36): [True: 522k, False: 25]
  ------------------
 3602|       |    // Only search compound if bsize \gt BLOCK_16X16.
 3603|   523k|    if (bsize > BLOCK_16X16) {
  ------------------
  |  Branch (3603:9): [True: 8.96k, False: 514k]
  ------------------
 3604|  8.96k|      comp_use_zero_zeromv_only = rt_sf->check_only_zero_zeromv_on_large_blocks;
 3605|   514k|    } else {
 3606|   514k|      tot_num_comp_modes = 0;
 3607|   514k|    }
 3608|   523k|  } else {
 3609|  75.2k|    tot_num_comp_modes = 0;
 3610|  75.2k|  }
 3611|       |
 3612|       |  // No compound if SEG_LVL_REF_FRAME is set.
 3613|   598k|  if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME))
  ------------------
  |  Branch (3613:7): [True: 0, False: 598k]
  ------------------
 3614|      0|    tot_num_comp_modes = 0;
 3615|       |
 3616|   598k|  if (x->pred_mv_sad[LAST_FRAME] != INT_MAX) {
  ------------------
  |  Branch (3616:7): [True: 67.2k, False: 531k]
  ------------------
 3617|  67.2k|    thresh_sad_pred = ((int64_t)x->pred_mv_sad[LAST_FRAME]) << 1;
 3618|       |    // Increase threshold for less aggressive pruning.
 3619|  67.2k|    if (rt_sf->nonrd_prune_ref_frame_search == 1)
  ------------------
  |  Branch (3619:9): [True: 31.9k, False: 35.3k]
  ------------------
 3620|  31.9k|      thresh_sad_pred += (x->pred_mv_sad[LAST_FRAME] >> 2);
 3621|  67.2k|  }
 3622|       |
 3623|   598k|  const int use_model_yrd_large = get_model_rd_flag(cpi, xd, bsize);
 3624|       |
 3625|       |  // decide block-level interp filter search flags:
 3626|       |  // filter_search_enabled_blk:
 3627|       |  // 0: disabled
 3628|       |  // 1: filter search depends on mode properties
 3629|       |  // 2: filter search forced since prediction is unreliable
 3630|       |  // cb_pred_filter_search 0: disabled cb prediction
 3631|   598k|  InterpFilter filt_select = EIGHTTAP_REGULAR;
 3632|   598k|  const int cb_pred_filter_search =
 3633|   598k|      x->content_state_sb.source_sad_nonrd > kVeryLowSad
  ------------------
  |  Branch (3633:7): [True: 598k, False: 276]
  ------------------
 3634|   598k|          ? cpi->sf.interp_sf.cb_pred_filter_search
 3635|   598k|          : 0;
 3636|   598k|  const int filter_search_enabled_blk =
 3637|   598k|      is_filter_search_enabled_blk(cpi, x, mi_row, mi_col, bsize, segment_id,
 3638|   598k|                                   cb_pred_filter_search, &filt_select);
 3639|       |
 3640|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3641|       |  x->ms_stat_nonrd.num_blocks[bsize]++;
 3642|       |#endif
 3643|   598k|  init_mbmi_nonrd(mi, DC_PRED, NONE_FRAME, NONE_FRAME, cm);
 3644|   598k|  mi->tx_size = AOMMIN(
  ------------------
  |  |   34|  1.19M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 444k, False: 153k]
  |  |  |  Branch (34:25): [True: 566k, False: 31.7k]
  |  |  |  Branch (34:38): [True: 413k, False: 31.0k]
  |  |  ------------------
  ------------------
 3645|   598k|      AOMMIN(max_txsize_lookup[bsize],
 3646|   598k|             tx_mode_to_biggest_tx_size[txfm_params->tx_mode_search_type]),
 3647|   598k|      TX_16X16);
 3648|       |
 3649|   598k|  if (!is_one_pass_rt_lag_params(cpi))
  ------------------
  |  Branch (3649:7): [True: 597k, False: 764]
  ------------------
 3650|   597k|    fill_single_inter_mode_costs(search_state.single_inter_mode_costs,
 3651|   597k|                                 num_inter_modes, ref_mode_set, mode_costs,
 3652|   597k|                                 mbmi_ext->mode_context);
 3653|    764|  else
 3654|    764|    fill_single_inter_mode_costs(search_state.single_inter_mode_costs,
 3655|    764|                                 num_inter_modes, ref_mode_set_full, mode_costs,
 3656|    764|                                 mbmi_ext->mode_context);
 3657|       |
 3658|   598k|  MV_REFERENCE_FRAME last_comp_ref_frame = NONE_FRAME;
 3659|       |
 3660|       |  // Initialize inter prediction params at block level for single reference
 3661|       |  // mode.
 3662|   598k|  InterPredParams inter_pred_params_sr;
 3663|   598k|  init_inter_block_params(&inter_pred_params_sr, pd->width, pd->height,
 3664|   598k|                          mi_row * MI_SIZE, mi_col * MI_SIZE, pd->subsampling_x,
  ------------------
  |  |   40|   598k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   598k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                                        mi_row * MI_SIZE, mi_col * MI_SIZE, pd->subsampling_x,
  ------------------
  |  |   40|   598k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   598k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3665|   598k|                          pd->subsampling_y, xd->bd, is_cur_buf_hbd(xd),
 3666|   598k|                          /*is_intrabc=*/0);
 3667|   598k|  inter_pred_params_sr.conv_params =
 3668|   598k|      get_conv_params(/*do_average=*/0, AOM_PLANE_Y, xd->bd);
  ------------------
  |  |  281|   598k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 3669|       |
 3670|   598k|  x->block_is_zero_sad = x->content_state_sb.source_sad_nonrd == kZeroSad ||
  ------------------
  |  Branch (3670:26): [True: 372, False: 598k]
  ------------------
 3671|   598k|                         segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP);
  ------------------
  |  Branch (3671:26): [True: 169, False: 597k]
  ------------------
 3672|   598k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (3672:7): [True: 0, False: 598k]
  ------------------
 3673|      0|      !x->force_zeromv_skip_for_blk &&
  ------------------
  |  Branch (3673:7): [True: 0, False: 0]
  ------------------
 3674|      0|      x->content_state_sb.source_sad_nonrd != kZeroSad &&
  ------------------
  |  Branch (3674:7): [True: 0, False: 0]
  ------------------
 3675|      0|      x->source_variance == 0 && bsize < cm->seq_params->sb_size &&
  ------------------
  |  Branch (3675:7): [True: 0, False: 0]
  |  Branch (3675:34): [True: 0, False: 0]
  ------------------
 3676|      0|      search_state.use_ref_frame_mask[LAST_FRAME] &&
  ------------------
  |  Branch (3676:7): [True: 0, False: 0]
  ------------------
 3677|      0|      search_state.yv12_mb[LAST_FRAME][0].width == cm->width &&
  ------------------
  |  Branch (3677:7): [True: 0, False: 0]
  ------------------
 3678|      0|      search_state.yv12_mb[LAST_FRAME][0].height == cm->height) {
  ------------------
  |  Branch (3678:7): [True: 0, False: 0]
  ------------------
 3679|      0|    set_block_source_sad(cpi, x, bsize, &search_state.yv12_mb[LAST_FRAME][0]);
 3680|      0|  }
 3681|       |
 3682|   598k|  int sb_me_has_been_tested = 0;
 3683|   598k|  x->sb_me_block = x->sb_me_partition;
 3684|       |  // Only use this feature (force testing of superblock motion) if coding
 3685|       |  // block size is large.
 3686|   598k|  if (x->sb_me_block) {
  ------------------
  |  Branch (3686:7): [True: 0, False: 598k]
  ------------------
 3687|      0|    if (cm->seq_params->sb_size == BLOCK_128X128 && bsize < BLOCK_64X64)
  ------------------
  |  Branch (3687:9): [True: 0, False: 0]
  |  Branch (3687:53): [True: 0, False: 0]
  ------------------
 3688|      0|      x->sb_me_block = 0;
 3689|      0|    else if (cm->seq_params->sb_size == BLOCK_64X64 && bsize < BLOCK_32X32)
  ------------------
  |  Branch (3689:14): [True: 0, False: 0]
  |  Branch (3689:56): [True: 0, False: 0]
  ------------------
 3690|      0|      x->sb_me_block = 0;
 3691|      0|  }
 3692|       |
 3693|   598k|  x->min_dist_inter_uv = INT64_MAX;
 3694|  7.77M|  for (int idx = 0; idx < num_inter_modes + tot_num_comp_modes; ++idx) {
  ------------------
  |  Branch (3694:21): [True: 7.17M, False: 598k]
  ------------------
 3695|       |    // If we are at the first compound mode, and the single modes already
 3696|       |    // perform well, then end the search.
 3697|  7.17M|    if (rt_sf->skip_compound_based_on_var && idx == num_inter_modes &&
  ------------------
  |  Branch (3697:9): [True: 7.17M, False: 512]
  |  Branch (3697:46): [True: 8.94k, False: 7.16M]
  ------------------
 3698|  8.94k|        skip_comp_based_on_var(search_state.vars, bsize)) {
  ------------------
  |  Branch (3698:9): [True: 0, False: 8.94k]
  ------------------
 3699|      0|      break;
 3700|      0|    }
 3701|       |
 3702|  7.17M|    int is_single_pred = 1;
 3703|  7.17M|    PREDICTION_MODE this_mode;
 3704|       |
 3705|  7.17M|    if (idx == 0 && !x->force_zeromv_skip_for_blk) {
  ------------------
  |  Branch (3705:9): [True: 597k, False: 6.57M]
  |  Branch (3705:21): [True: 597k, False: 18.4E]
  ------------------
 3706|       |      // Set color sensitivity on first tested mode only.
 3707|       |      // Use y-sad already computed in find_predictors: take the sad with motion
 3708|       |      // vector closest to 0; the uv-sad computed below in set_color_sensitivity
 3709|       |      // is for zeromv.
 3710|       |      // For screen: first check if golden reference is being used, if so,
 3711|       |      // force color_sensitivity on (=1) if the color sensitivity for sb_g is 1.
 3712|       |      // The check in set_color_sensitivity() will then follow and check for
 3713|       |      // setting the flag if the level is still 2 or 0.
 3714|   598k|      if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (3714:11): [True: 0, False: 598k]
  ------------------
 3715|      0|          search_state.use_ref_frame_mask[GOLDEN_FRAME]) {
  ------------------
  |  Branch (3715:11): [True: 0, False: 0]
  ------------------
 3716|      0|        if (x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_U)] == 1)
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3716:13): [True: 0, False: 0]
  ------------------
 3717|      0|          x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] = 1;
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 3718|      0|        if (x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3718:13): [True: 0, False: 0]
  ------------------
 3719|      0|          x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] = 1;
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 3720|      0|      }
 3721|   598k|      if (search_state.use_ref_frame_mask[LAST_FRAME] &&
  ------------------
  |  Branch (3721:11): [True: 597k, False: 69]
  ------------------
 3722|   597k|          x->pred_mv0_sad[LAST_FRAME] != INT_MAX) {
  ------------------
  |  Branch (3722:11): [True: 67.2k, False: 530k]
  ------------------
 3723|  67.2k|        int y_sad = x->pred_mv0_sad[LAST_FRAME];
 3724|  67.2k|        if (x->pred_mv1_sad[LAST_FRAME] != INT_MAX &&
  ------------------
  |  Branch (3724:13): [True: 59.9k, False: 7.28k]
  ------------------
 3725|  59.9k|            (abs(search_state.frame_mv[NEARMV][LAST_FRAME].as_mv.col) +
  ------------------
  |  Branch (3725:13): [True: 34.1k, False: 25.8k]
  ------------------
 3726|  59.9k|             abs(search_state.frame_mv[NEARMV][LAST_FRAME].as_mv.row)) <
 3727|  59.9k|                (abs(search_state.frame_mv[NEARESTMV][LAST_FRAME].as_mv.col) +
 3728|  59.9k|                 abs(search_state.frame_mv[NEARESTMV][LAST_FRAME].as_mv.row)))
 3729|  34.1k|          y_sad = x->pred_mv1_sad[LAST_FRAME];
 3730|  67.2k|        set_color_sensitivity(cpi, x, bsize, y_sad, x->source_variance,
 3731|  67.2k|                              search_state.yv12_mb[LAST_FRAME]);
 3732|  67.2k|      }
 3733|   598k|    }
 3734|       |
 3735|       |    // Check the inter mode can be skipped based on mode statistics and speed
 3736|       |    // features settings.
 3737|  7.17M|    if (skip_inter_mode_nonrd(cpi, x, &search_state, &thresh_sad_pred,
  ------------------
  |  Branch (3737:9): [True: 5.07M, False: 2.09M]
  ------------------
 3738|  7.17M|                              &force_mv_inter_layer, &is_single_pred,
 3739|  7.17M|                              &this_mode, &last_comp_ref_frame, &ref_frame,
 3740|  7.17M|                              &ref_frame2, idx, svc_mv, force_skip_low_temp_var,
 3741|  7.17M|                              sse_zeromv_norm, num_inter_modes, segment_id,
 3742|  7.17M|                              bsize, comp_use_zero_zeromv_only, check_globalmv))
 3743|  5.07M|      continue;
 3744|       |
 3745|       |    // Select prediction reference frames.
 3746|  8.44M|    for (int plane = 0; plane < MAX_MB_PLANE; plane++) {
  ------------------
  |  |   36|  8.44M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (3746:25): [True: 6.34M, False: 2.09M]
  ------------------
 3747|  6.34M|      xd->plane[plane].pre[0] = search_state.yv12_mb[ref_frame][plane];
 3748|  6.34M|      if (!is_single_pred)
  ------------------
  |  Branch (3748:11): [True: 0, False: 6.34M]
  ------------------
 3749|      0|        xd->plane[plane].pre[1] = search_state.yv12_mb[ref_frame2][plane];
 3750|  6.34M|    }
 3751|       |
 3752|  2.09M|    mi->ref_frame[0] = ref_frame;
 3753|  2.09M|    mi->ref_frame[1] = ref_frame2;
 3754|  2.09M|    set_ref_ptrs(cm, xd, ref_frame, ref_frame2);
 3755|       |
 3756|       |    // Check if the scaled reference frame should be used. This is set in the
 3757|       |    // find_predictors() for each usable reference. If so, set the
 3758|       |    // block_ref_scale_factors[] to no reference scaling.
 3759|  2.09M|    if (search_state.use_scaled_ref_frame[ref_frame]) {
  ------------------
  |  Branch (3759:9): [True: 1.86M, False: 232k]
  ------------------
 3760|  1.86M|      xd->block_ref_scale_factors[0] = &sf_no_scale;
 3761|  1.86M|    }
 3762|  2.09M|    if (!is_single_pred && search_state.use_scaled_ref_frame[ref_frame2]) {
  ------------------
  |  Branch (3762:9): [True: 0, False: 2.09M]
  |  Branch (3762:28): [True: 0, False: 0]
  ------------------
 3763|      0|      xd->block_ref_scale_factors[1] = &sf_no_scale;
 3764|      0|    }
 3765|       |
 3766|       |    // Perform inter mode evaluation for non-rd
 3767|  2.09M|    if (!handle_inter_mode_nonrd(
  ------------------
  |  Branch (3767:9): [True: 49, False: 2.09M]
  ------------------
 3768|  2.09M|            cpi, x, &search_state, ctx, &this_mode_pred, tmp_buffer,
 3769|  2.09M|            inter_pred_params_sr, &best_early_term, &sse_zeromv_norm,
 3770|  2.09M|            &check_globalmv,
 3771|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3772|       |            &zero_last_cost_orig, denoise_svc_pickmode,
 3773|       |#endif
 3774|  2.09M|            idx, force_mv_inter_layer, is_single_pred, gf_temporal_ref,
 3775|  2.09M|            use_model_yrd_large, filter_search_enabled_blk, bsize, this_mode,
 3776|  2.09M|            filt_select, cb_pred_filter_search, reuse_inter_pred,
 3777|  2.09M|            &sb_me_has_been_tested)) {
 3778|     49|      break;
 3779|     49|    }
 3780|  2.09M|  }
 3781|       |
 3782|       |  // Restore mode data of best inter mode
 3783|   598k|  mi->mode = best_pickmode->best_mode;
 3784|   598k|  mi->motion_mode = best_pickmode->best_motion_mode;
 3785|   598k|  mi->wm_params = best_pickmode->wm_params;
 3786|   598k|  mi->num_proj_ref = best_pickmode->num_proj_ref;
 3787|   598k|  mi->interp_filters = best_pickmode->best_pred_filter;
 3788|   598k|  mi->tx_size = best_pickmode->best_tx_size;
 3789|   598k|  memset(mi->inter_tx_size, mi->tx_size, sizeof(mi->inter_tx_size));
 3790|   598k|  mi->ref_frame[0] = best_pickmode->best_ref_frame;
 3791|   598k|  mi->mv[0].as_int = search_state
 3792|   598k|                         .frame_mv_best[best_pickmode->best_mode]
 3793|   598k|                                       [best_pickmode->best_ref_frame]
 3794|   598k|                         .as_int;
 3795|   598k|  mi->mv[1].as_int = 0;
 3796|   598k|  if (best_pickmode->best_second_ref_frame > INTRA_FRAME) {
  ------------------
  |  Branch (3796:7): [True: 0, False: 598k]
  ------------------
 3797|      0|    mi->ref_frame[1] = best_pickmode->best_second_ref_frame;
 3798|      0|    mi->mv[1].as_int = search_state
 3799|      0|                           .frame_mv_best[best_pickmode->best_mode]
 3800|      0|                                         [best_pickmode->best_second_ref_frame]
 3801|      0|                           .as_int;
 3802|      0|  }
 3803|       |  // Perform intra prediction search, if the best SAD is above a certain
 3804|       |  // threshold.
 3805|   598k|  mi->angle_delta[PLANE_TYPE_Y] = 0;
 3806|   598k|  mi->angle_delta[PLANE_TYPE_UV] = 0;
 3807|   598k|  mi->filter_intra_mode_info.use_filter_intra = 0;
 3808|       |
 3809|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3810|       |  aom_usec_timer_start(&x->ms_stat_nonrd.timer1);
 3811|       |  x->ms_stat_nonrd.num_searches[bsize][DC_PRED]++;
 3812|       |  x->ms_stat_nonrd.num_nonskipped_searches[bsize][DC_PRED]++;
 3813|       |#endif
 3814|       |
 3815|   598k|  int force_palette_test = 0;
 3816|   598k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (3816:7): [True: 0, False: 598k]
  ------------------
 3817|      0|      x->content_state_sb.source_sad_nonrd != kZeroSad &&
  ------------------
  |  Branch (3817:7): [True: 0, False: 0]
  ------------------
 3818|      0|      bsize <= BLOCK_16X16) {
  ------------------
  |  Branch (3818:7): [True: 0, False: 0]
  ------------------
 3819|      0|    unsigned int thresh_sse = cpi->rc.high_source_sad ? 15000 : 100000;
  ------------------
  |  Branch (3819:31): [True: 0, False: 0]
  ------------------
 3820|      0|    unsigned int thresh_source_var = cpi->rc.high_source_sad ? 50 : 200;
  ------------------
  |  Branch (3820:38): [True: 0, False: 0]
  ------------------
 3821|      0|    unsigned int best_sse_inter_motion =
 3822|      0|        (unsigned int)(search_state.best_rdc.sse >>
 3823|      0|                       (b_width_log2_lookup[bsize] +
 3824|      0|                        b_height_log2_lookup[bsize]));
 3825|      0|    if (best_sse_inter_motion > thresh_sse &&
  ------------------
  |  Branch (3825:9): [True: 0, False: 0]
  ------------------
 3826|      0|        x->source_variance > thresh_source_var)
  ------------------
  |  Branch (3826:9): [True: 0, False: 0]
  ------------------
 3827|      0|      force_palette_test = 1;
 3828|      0|  }
 3829|       |
 3830|       |  // For the SEG_LVL_REF_FRAME inter_mode must be selected if reference set is
 3831|       |  // not INTRA_FRAME, so skip all intra mode (and palette below).
 3832|   598k|  const int inter_forced_on_segment =
 3833|   598k|      segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
  ------------------
  |  Branch (3833:7): [True: 0, False: 598k]
  ------------------
 3834|      0|      get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != INTRA_FRAME;
  ------------------
  |  Branch (3834:7): [True: 0, False: 0]
  ------------------
 3835|       |
 3836|       |  // Evaluate Intra modes in inter frame
 3837|   598k|  unsigned int best_intra_sad_norm = UINT_MAX;
 3838|   598k|  if (!x->force_zeromv_skip_for_blk && !inter_forced_on_segment)
  ------------------
  |  Branch (3838:7): [True: 597k, False: 1.27k]
  |  Branch (3838:40): [True: 597k, False: 97]
  ------------------
 3839|   597k|    av1_estimate_intra_mode(cpi, x, bsize, best_early_term,
 3840|   597k|                            search_state.ref_costs_single[INTRA_FRAME],
 3841|   597k|                            reuse_inter_pred, &orig_dst, tmp_buffer,
 3842|   597k|                            &this_mode_pred, &search_state.best_rdc,
 3843|   597k|                            best_pickmode, &best_intra_sad_norm);
 3844|       |
 3845|   598k|  int skip_idtx_palette = (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|   598k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3845:28): [True: 184k, False: 414k]
  ------------------
 3846|   414k|                           x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]) &&
  ------------------
  |  |   50|   414k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3846:28): [True: 992, False: 413k]
  ------------------
 3847|   185k|                          x->content_state_sb.source_sad_nonrd != kZeroSad &&
  ------------------
  |  Branch (3847:27): [True: 185k, False: 18.4E]
  ------------------
 3848|   185k|                          !cpi->rc.high_source_sad &&
  ------------------
  |  Branch (3848:27): [True: 185k, False: 18.4E]
  ------------------
 3849|   185k|                          (cpi->rc.high_motion_content_screen_rtc ||
  ------------------
  |  Branch (3849:28): [True: 39, False: 185k]
  ------------------
 3850|   185k|                           cpi->rc.frame_source_sad < 1000);
  ------------------
  |  Branch (3850:28): [True: 18.4E, False: 185k]
  ------------------
 3851|       |
 3852|   598k|  bool try_palette = enable_palette(
 3853|   598k|      cpi, is_mode_intra(best_pickmode->best_mode), bsize, x->source_variance,
 3854|   598k|      x->force_zeromv_skip_for_blk, skip_idtx_palette, force_palette_test,
 3855|   598k|      best_intra_sad_norm);
 3856|       |
 3857|   598k|  if (try_palette && prune_palette_testing_inter(cpi, x->source_variance))
  ------------------
  |  Branch (3857:7): [True: 0, False: 598k]
  |  Branch (3857:22): [True: 0, False: 0]
  ------------------
 3858|      0|    x->color_palette_thresh =
 3859|      0|        cpi->sf.rt_sf.prune_palette_search_nonrd > 2 ? 20 : 32;
  ------------------
  |  Branch (3859:9): [True: 0, False: 0]
  ------------------
 3860|       |
 3861|   598k|  if (!inter_forced_on_segment) {
  ------------------
  |  Branch (3861:7): [True: 598k, False: 283]
  ------------------
 3862|       |    // Perform screen content mode evaluation for non-rd
 3863|   598k|    handle_screen_content_mode_nonrd(cpi, x, &search_state, this_mode_pred, ctx,
 3864|   598k|                                     tmp_buffer, &orig_dst, skip_idtx_palette,
 3865|   598k|                                     try_palette, bsize, reuse_inter_pred,
 3866|   598k|                                     mi_col, mi_row);
 3867|   598k|  }
 3868|       |
 3869|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3870|       |  aom_usec_timer_mark(&x->ms_stat_nonrd.timer1);
 3871|       |  x->ms_stat_nonrd.nonskipped_search_times[bsize][DC_PRED] +=
 3872|       |      aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer1);
 3873|       |#endif
 3874|       |
 3875|   598k|  pd->dst = orig_dst;
 3876|       |  // Best mode is finalized. Restore the mode data to mbmi
 3877|   598k|  if (try_palette) mi->palette_mode_info = best_pickmode->pmi;
  ------------------
  |  Branch (3877:7): [True: 0, False: 598k]
  ------------------
 3878|   598k|  mi->mode = best_pickmode->best_mode;
 3879|   598k|  mi->ref_frame[0] = best_pickmode->best_ref_frame;
 3880|   598k|  mi->ref_frame[1] = best_pickmode->best_second_ref_frame;
 3881|       |  // For lossless: always force the skip flags off.
 3882|   598k|  if (is_lossless_requested(&cpi->oxcf.rc_cfg)) {
  ------------------
  |  Branch (3882:7): [True: 31.0k, False: 567k]
  ------------------
 3883|  31.0k|    txfm_info->skip_txfm = 0;
 3884|   567k|  } else {
 3885|   567k|    txfm_info->skip_txfm = best_pickmode->best_mode_skip_txfm;
 3886|   567k|  }
 3887|   598k|  if (has_second_ref(mi)) {
  ------------------
  |  Branch (3887:7): [True: 0, False: 598k]
  ------------------
 3888|      0|    mi->comp_group_idx = 0;
 3889|      0|    mi->compound_idx = 1;
 3890|      0|    mi->interinter_comp.type = COMPOUND_AVERAGE;
 3891|      0|  }
 3892|       |
 3893|   598k|  if (!is_inter_block(mi)) {
  ------------------
  |  Branch (3893:7): [True: 199k, False: 398k]
  ------------------
 3894|   199k|    mi->interp_filters = av1_broadcast_interp_filter(SWITCHABLE_FILTERS);
 3895|   398k|  } else {
 3896|       |    // If inter mode is selected and ref_frame was one that uses the
 3897|       |    // scaled reference frame, then we can't use reuse_inter_pred.
 3898|   398k|    if (search_state.use_scaled_ref_frame[best_pickmode->best_ref_frame] ||
  ------------------
  |  Branch (3898:9): [True: 358k, False: 40.7k]
  ------------------
 3899|  40.7k|        (has_second_ref(mi) &&
  ------------------
  |  Branch (3899:10): [True: 0, False: 40.7k]
  ------------------
 3900|      0|         search_state
  ------------------
  |  Branch (3900:10): [True: 0, False: 0]
  ------------------
 3901|      0|             .use_scaled_ref_frame[best_pickmode->best_second_ref_frame]))
 3902|   358k|      x->reuse_inter_pred = 0;
 3903|   398k|  }
 3904|       |
 3905|       |  // Restore the predicted samples of best mode to final buffer
 3906|   598k|  if (reuse_inter_pred && best_pickmode->best_pred != NULL) {
  ------------------
  |  Branch (3906:7): [True: 0, False: 598k]
  |  Branch (3906:27): [True: 0, False: 0]
  ------------------
 3907|      0|    PRED_BUFFER *const best_pred = best_pickmode->best_pred;
 3908|      0|    if (best_pred->data != orig_dst.buf && is_inter_mode(mi->mode)) {
  ------------------
  |  Branch (3908:9): [True: 0, False: 0]
  |  Branch (3908:44): [True: 0, False: 0]
  ------------------
 3909|      0|      aom_convolve_copy(best_pred->data, best_pred->stride, pd->dst.buf,
 3910|      0|                        pd->dst.stride, bw, bh);
 3911|      0|    }
 3912|      0|  }
 3913|       |
 3914|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3915|       |  if (cpi->oxcf.noise_sensitivity > 0 && resize_pending == 0 &&
 3916|       |      denoise_svc_pickmode && cpi->denoiser.denoising_level > kDenLowLow &&
 3917|       |      cpi->denoiser.reset == 0) {
 3918|       |    AV1_DENOISER_DECISION decision = COPY_BLOCK;
 3919|       |    ctx->sb_skip_denoising = 0;
 3920|       |    av1_pickmode_ctx_den_update(
 3921|       |        &ctx_den, zero_last_cost_orig, search_state.ref_costs_single,
 3922|       |        search_state.frame_mv, reuse_inter_pred, best_pickmode);
 3923|       |    av1_denoiser_denoise(cpi, x, mi_row, mi_col, bsize, ctx, &decision,
 3924|       |                         gf_temporal_ref);
 3925|       |    if (denoise_recheck_zeromv)
 3926|       |      recheck_zeromv_after_denoising(
 3927|       |          cpi, mi, x, xd, decision, &ctx_den, search_state.yv12_mb,
 3928|       |          &search_state.best_rdc, best_pickmode, bsize, mi_row, mi_col);
 3929|       |    best_pickmode->best_ref_frame = ctx_den.best_ref_frame;
 3930|       |  }
 3931|       |#endif
 3932|       |
 3933|       |  // Update the factors used for RD thresholding for all modes.
 3934|   598k|  if (cpi->sf.inter_sf.adaptive_rd_thresh && !has_second_ref(mi)) {
  ------------------
  |  Branch (3934:7): [True: 597k, False: 956]
  |  Branch (3934:46): [True: 597k, False: 311]
  ------------------
 3935|   597k|    THR_MODES best_mode_idx =
 3936|   597k|        mode_idx[best_pickmode->best_ref_frame][mode_offset(mi->mode)];
 3937|   597k|    if (best_pickmode->best_ref_frame == INTRA_FRAME) {
  ------------------
  |  Branch (3937:9): [True: 199k, False: 397k]
  ------------------
 3938|       |      // Only consider the modes that are included in the intra_mode_list.
 3939|   199k|      int intra_modes = sizeof(intra_mode_list) / sizeof(PREDICTION_MODE);
 3940|   997k|      for (int mode_index = 0; mode_index < intra_modes; mode_index++) {
  ------------------
  |  Branch (3940:32): [True: 797k, False: 199k]
  ------------------
 3941|   797k|        update_thresh_freq_fact(cpi, x, bsize, INTRA_FRAME, best_mode_idx,
 3942|   797k|                                intra_mode_list[mode_index]);
 3943|   797k|      }
 3944|   397k|    } else {
 3945|   397k|      PREDICTION_MODE this_mode;
 3946|  1.99M|      for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
  ------------------
  |  Branch (3946:35): [True: 1.59M, False: 397k]
  ------------------
 3947|  1.59M|        update_thresh_freq_fact(cpi, x, bsize, best_pickmode->best_ref_frame,
 3948|  1.59M|                                best_mode_idx, this_mode);
 3949|  1.59M|      }
 3950|   397k|    }
 3951|   597k|  }
 3952|       |
 3953|       |#if CONFIG_INTERNAL_STATS
 3954|       |  store_coding_context_nonrd(x, ctx, mi->mode);
 3955|       |#else
 3956|   598k|  store_coding_context_nonrd(x, ctx);
 3957|   598k|#endif  // CONFIG_INTERNAL_STATS
 3958|       |
 3959|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3960|       |  aom_usec_timer_mark(&x->ms_stat_nonrd.bsize_timer);
 3961|       |  x->ms_stat_nonrd.total_block_times[bsize] +=
 3962|       |      aom_usec_timer_elapsed(&x->ms_stat_nonrd.bsize_timer);
 3963|       |  print_time(&x->ms_stat_nonrd, bsize, cm->mi_params.mi_rows,
 3964|       |             cm->mi_params.mi_cols, mi_row, mi_col);
 3965|       |#endif  // COLLECT_NONRD_PICK_MODE_STAT
 3966|       |
 3967|   598k|  *rd_cost = search_state.best_rdc;
 3968|       |
 3969|   598k|  mi->num_proj_ref = 0;
 3970|   598k|  if (warped_motion_update_num_proj_ref(cpi, mi)) {
  ------------------
  |  Branch (3970:7): [True: 399k, False: 198k]
  ------------------
 3971|   399k|    int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 3972|   399k|    mi->num_proj_ref = av1_findSamples(cm, xd, pts, pts_inref);
 3973|   399k|  }
 3974|       |
 3975|       |  // Reset the xd->block_ref_scale_factors[i], as they may have
 3976|       |  // been set to pointer &sf_no_scale, which becomes invalid afer
 3977|       |  // this function.
 3978|   598k|  set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]);
 3979|   598k|}
nonrd_pickmode.c:should_prune_intra_modes_using_neighbors:
 1572|  20.3k|    PREDICTION_MODE left_mode) {
 1573|  20.3k|  if (!enable_intra_mode_pruning_using_neighbors) return false;
  ------------------
  |  Branch (1573:7): [True: 20.3k, False: 0]
  ------------------
 1574|       |
 1575|       |  // Avoid pruning of DC_PRED as it is the most probable mode to win as per the
 1576|       |  // statistics generated for nonrd intra mode evaluations.
 1577|      0|  if (this_mode == DC_PRED) return false;
  ------------------
  |  Branch (1577:7): [True: 0, False: 0]
  ------------------
 1578|       |
 1579|       |  // Enable the pruning for current mode only if it is not the winner mode of
 1580|       |  // both the neighboring blocks (left/top).
 1581|      0|  return xd->up_available && this_mode != above_mode && xd->left_available &&
  ------------------
  |  Branch (1581:10): [True: 0, False: 0]
  |  Branch (1581:30): [True: 0, False: 0]
  |  Branch (1581:57): [True: 0, False: 0]
  ------------------
 1582|      0|         this_mode != left_mode;
  ------------------
  |  Branch (1582:10): [True: 0, False: 0]
  ------------------
 1583|      0|}
nonrd_pickmode.c:is_same_gf_and_last_scale:
 1977|   598k|static inline int is_same_gf_and_last_scale(AV1_COMMON *cm) {
 1978|   598k|  struct scale_factors *const sf_last = get_ref_scale_factors(cm, LAST_FRAME);
 1979|   598k|  struct scale_factors *const sf_golden =
 1980|   598k|      get_ref_scale_factors(cm, GOLDEN_FRAME);
 1981|   598k|  return ((sf_last->x_scale_fp == sf_golden->x_scale_fp) &&
  ------------------
  |  Branch (1981:11): [True: 598k, False: 166]
  ------------------
 1982|   598k|          (sf_last->y_scale_fp == sf_golden->y_scale_fp));
  ------------------
  |  Branch (1982:11): [True: 598k, False: 18.4E]
  ------------------
 1983|   598k|}
nonrd_pickmode.c:set_params_nonrd_pick_inter_mode:
 2576|   598k|) {
 2577|   598k|  AV1_COMMON *const cm = &cpi->common;
 2578|   598k|  MACROBLOCKD *const xd = &x->e_mbd;
 2579|   598k|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 2580|   598k|  MB_MODE_INFO *const mi = xd->mi[0];
 2581|   598k|  const ModeCosts *mode_costs = &x->mode_costs;
 2582|   598k|  int skip_pred_mv = 0;
 2583|       |
 2584|       |  // Initialize variance and distortion (chroma) for all modes and reference
 2585|       |  // frames
 2586|  2.99M|  for (int idx = 0; idx < RTC_INTER_MODES; idx++) {
  ------------------
  |  |   19|  2.99M|#define RTC_INTER_MODES (4)
  ------------------
  |  Branch (2586:21): [True: 2.39M, False: 598k]
  ------------------
 2587|  21.5M|    for (int ref = 0; ref < REF_FRAMES; ref++) {
  ------------------
  |  Branch (2587:23): [True: 19.1M, False: 2.39M]
  ------------------
 2588|  19.1M|      search_state->vars[idx][ref] = UINT_MAX;
 2589|  19.1M|      search_state->uv_dist[idx][ref] = INT64_MAX;
 2590|  19.1M|    }
 2591|  2.39M|  }
 2592|       |
 2593|       |  // Initialize values of color sensitivity with sb level color sensitivity
 2594|   598k|  av1_copy(x->color_sensitivity, x->color_sensitivity_sb);
  ------------------
  |  |   31|   598k|  do {                                              \
  |  |   32|   598k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|   598k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|   598k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 598k]
  |  |  ------------------
  ------------------
 2595|       |
 2596|   598k|  init_best_pickmode(&search_state->best_pickmode);
 2597|       |
 2598|       |  // Estimate cost for single reference frames
 2599|   598k|  estimate_single_ref_frame_costs(cm, xd, mode_costs, segment_id, bsize,
 2600|   598k|                                  search_state->ref_costs_single,
 2601|   598k|                                  is_one_pass_rt_lag_params(cpi));
 2602|       |
 2603|       |  // Reset flag to indicate modes evaluated
 2604|   598k|  av1_zero(search_state->mode_checked);
  ------------------
  |  |   43|   598k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2605|       |
 2606|   598k|  txfm_info->skip_txfm = 0;
 2607|       |
 2608|       |  // Initialize mode decisions
 2609|   598k|  av1_invalid_rd_stats(&search_state->best_rdc);
 2610|   598k|  av1_invalid_rd_stats(&search_state->this_rdc);
 2611|   598k|  av1_invalid_rd_stats(rd_cost);
 2612|  5.38M|  for (int ref_idx = 0; ref_idx < REF_FRAMES; ++ref_idx) {
  ------------------
  |  Branch (2612:25): [True: 4.78M, False: 598k]
  ------------------
 2613|  4.78M|    x->warp_sample_info[ref_idx].num = -1;
 2614|  4.78M|  }
 2615|       |
 2616|   598k|  mi->bsize = bsize;
 2617|   598k|  mi->ref_frame[0] = NONE_FRAME;
 2618|   598k|  mi->ref_frame[1] = NONE_FRAME;
 2619|       |
 2620|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 2621|       |  if (cpi->oxcf.noise_sensitivity > 0) {
 2622|       |    // if (cpi->ppi->use_svc) denoise_svc_pickmode =
 2623|       |    // av1_denoise_svc_non_key(cpi);
 2624|       |    if (cpi->denoiser.denoising_level > kDenLowLow && denoise_svc_pickmode)
 2625|       |      av1_denoiser_reset_frame_stats(ctx);
 2626|       |  }
 2627|       |#endif
 2628|       |
 2629|       |  // Populate predicated motion vectors for LAST_FRAME
 2630|   598k|  if (cpi->ref_frame_flags & AOM_LAST_FLAG) {
  ------------------
  |  Branch (2630:7): [True: 598k, False: 701]
  ------------------
 2631|   598k|    find_predictors(cpi, x, LAST_FRAME, search_state->frame_mv,
 2632|   598k|                    search_state->yv12_mb, bsize, *force_skip_low_temp_var,
 2633|   598k|                    x->force_zeromv_skip_for_blk,
 2634|   598k|                    &search_state->use_scaled_ref_frame[LAST_FRAME]);
 2635|   598k|  }
 2636|       |  // Update mask to use all reference frame
 2637|   598k|  if (!is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (2637:7): [True: 598k, False: 18.4E]
  ------------------
 2638|   598k|    get_ref_frame_use_mask(cpi, x, mi, mi_row, mi_col, bsize, gf_temporal_ref,
 2639|   598k|                           search_state->use_ref_frame_mask,
 2640|   598k|                           force_skip_low_temp_var);
 2641|  18.4E|  } else {
 2642|  18.4E|    for (MV_REFERENCE_FRAME ref_frame_iter = LAST_FRAME;
 2643|  18.4E|         ref_frame_iter <= ALTREF_FRAME; ++ref_frame_iter) {
  ------------------
  |  Branch (2643:10): [True: 0, False: 18.4E]
  ------------------
 2644|      0|      search_state->use_ref_frame_mask[ref_frame_iter] =
 2645|      0|          cpi->ref_frame_flags & (1 << (ref_frame_iter - 1));
 2646|      0|    }
 2647|  18.4E|  }
 2648|       |
 2649|   598k|  skip_pred_mv = x->force_zeromv_skip_for_blk ||
  ------------------
  |  Branch (2649:18): [True: 170, False: 598k]
  ------------------
 2650|   598k|                 (x->nonrd_prune_ref_frame_search > 2 &&
  ------------------
  |  Branch (2650:19): [True: 0, False: 598k]
  ------------------
 2651|      0|                  x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] != 2 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2651:19): [True: 0, False: 0]
  ------------------
 2652|      0|                  x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] != 2);
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2652:19): [True: 0, False: 0]
  ------------------
 2653|       |
 2654|       |  // Populate predicated motion vectors for other single reference frame
 2655|       |  // Start at LAST_FRAME + 1.
 2656|   598k|  for (MV_REFERENCE_FRAME ref_frame_iter = LAST_FRAME + 1;
 2657|  4.18M|       ref_frame_iter <= ALTREF_FRAME; ++ref_frame_iter) {
  ------------------
  |  Branch (2657:8): [True: 3.59M, False: 598k]
  ------------------
 2658|  3.59M|    if (search_state->use_ref_frame_mask[ref_frame_iter]) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 3.59M]
  ------------------
 2659|      0|      find_predictors(cpi, x, ref_frame_iter, search_state->frame_mv,
 2660|      0|                      search_state->yv12_mb, bsize, *force_skip_low_temp_var,
 2661|      0|                      skip_pred_mv,
 2662|      0|                      &search_state->use_scaled_ref_frame[ref_frame_iter]);
 2663|      0|    }
 2664|  3.59M|  }
 2665|   598k|}
nonrd_pickmode.c:init_best_pickmode:
   63|   598k|static inline void init_best_pickmode(BEST_PICKMODE *bp) {
   64|   598k|  bp->best_sse = INT64_MAX;
   65|   598k|  bp->best_mode = NEARESTMV;
   66|   598k|  bp->best_ref_frame = LAST_FRAME;
   67|   598k|  bp->best_second_ref_frame = NONE_FRAME;
   68|   598k|  bp->best_tx_size = TX_8X8;
   69|   598k|  bp->tx_type = DCT_DCT;
   70|   598k|  bp->best_pred_filter = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
   71|   598k|  bp->best_mode_skip_txfm = 0;
   72|   598k|  bp->best_mode_initial_skip_flag = 0;
   73|   598k|  bp->best_pred = NULL;
   74|   598k|  bp->best_motion_mode = SIMPLE_TRANSLATION;
   75|   598k|  bp->num_proj_ref = 0;
   76|   598k|  av1_zero(bp->wm_params);
  ------------------
  |  |   43|   598k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   77|   598k|  av1_zero(bp->pmi);
  ------------------
  |  |   43|   598k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   78|   598k|}
nonrd_pickmode.c:estimate_single_ref_frame_costs:
  387|   598k|                                            int is_one_pass_rt_lag) {
  388|   598k|  int seg_ref_active =
  389|   598k|      segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
  390|   598k|  if (seg_ref_active) {
  ------------------
  |  Branch (390:7): [True: 0, False: 598k]
  ------------------
  391|      0|    memset(ref_costs_single, 0, REF_FRAMES * sizeof(*ref_costs_single));
  392|   598k|  } else {
  393|   598k|    int intra_inter_ctx = av1_get_intra_inter_context(xd);
  394|   598k|    ref_costs_single[INTRA_FRAME] =
  395|   598k|        mode_costs->intra_inter_cost[intra_inter_ctx][0];
  396|   598k|    unsigned int base_cost = mode_costs->intra_inter_cost[intra_inter_ctx][1];
  397|   598k|    if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT &&
  ------------------
  |  Branch (397:9): [True: 522k, False: 75.5k]
  ------------------
  398|   522k|        is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (398:9): [True: 522k, False: 18.4E]
  ------------------
  399|   522k|      const int comp_ref_type_ctx = av1_get_comp_reference_type_context(xd);
  400|   522k|      base_cost += mode_costs->comp_ref_type_cost[comp_ref_type_ctx][1];
  401|   522k|    }
  402|   598k|    ref_costs_single[LAST_FRAME] = base_cost;
  403|   598k|    ref_costs_single[GOLDEN_FRAME] = base_cost;
  404|   598k|    ref_costs_single[ALTREF_FRAME] = base_cost;
  405|       |    // add cost for last, golden, altref
  406|   598k|    ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[0][0][0];
  407|   598k|    ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[0][0][1];
  408|   598k|    ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[0][1][0];
  409|   598k|    ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[0][0][1];
  410|   598k|    ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[0][2][0];
  411|   598k|    if (is_one_pass_rt_lag) {
  ------------------
  |  Branch (411:9): [True: 0, False: 598k]
  ------------------
  412|      0|      ref_costs_single[ALTREF2_FRAME] = base_cost;
  413|      0|      ref_costs_single[BWDREF_FRAME] = base_cost;
  414|      0|      ref_costs_single[LAST2_FRAME] = base_cost;
  415|      0|      ref_costs_single[LAST3_FRAME] = base_cost;
  416|      0|      ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[0][0][0];
  417|      0|      ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[0][0][0];
  418|      0|      ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[0][0][1];
  419|      0|      ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[0][1][0];
  420|      0|      ref_costs_single[ALTREF2_FRAME] += mode_costs->single_ref_cost[0][0][1];
  421|      0|      ref_costs_single[ALTREF2_FRAME] += mode_costs->single_ref_cost[0][2][0];
  422|      0|    }
  423|   598k|  }
  424|   598k|}
nonrd_pickmode.c:get_ref_frame_use_mask:
 1990|   598k|                                          int *force_skip_low_temp_var) {
 1991|   598k|  AV1_COMMON *const cm = &cpi->common;
 1992|   598k|  const struct segmentation *const seg = &cm->seg;
 1993|   598k|  const int is_small_sb = (cm->seq_params->sb_size == BLOCK_64X64);
 1994|       |
 1995|       |  // When the ref_frame_config is used to set the reference frame structure
 1996|       |  // then the usage of alt_ref is determined by the ref_frame_flags
 1997|       |  // (and not the speed feature use_nonrd_altref_frame).
 1998|   598k|  int use_alt_ref_frame = cpi->ppi->rtc_ref.set_ref_frame_config ||
  ------------------
  |  Branch (1998:27): [True: 18.4E, False: 598k]
  ------------------
 1999|   598k|                          cpi->sf.rt_sf.use_nonrd_altref_frame;
  ------------------
  |  Branch (1999:27): [True: 291k, False: 306k]
  ------------------
 2000|       |
 2001|   598k|  int use_golden_ref_frame = 1;
 2002|   598k|  int use_last_ref_frame = 1;
 2003|       |
 2004|       |  // When the ref_frame_config is used to set the reference frame structure:
 2005|       |  // check if LAST is used as a reference. And only remove golden and altref
 2006|       |  // references below if last is used as a reference.
 2007|   598k|  if (cpi->ppi->rtc_ref.set_ref_frame_config)
  ------------------
  |  Branch (2007:7): [True: 0, False: 598k]
  ------------------
 2008|      0|    use_last_ref_frame =
 2009|      0|        cpi->ref_frame_flags & AOM_LAST_FLAG ? use_last_ref_frame : 0;
  ------------------
  |  Branch (2009:9): [True: 0, False: 0]
  ------------------
 2010|       |
 2011|       |  // frame_since_golden is not used when user sets the referene structure.
 2012|   598k|  if (!cpi->ppi->rtc_ref.set_ref_frame_config && use_last_ref_frame &&
  ------------------
  |  Branch (2012:7): [True: 598k, False: 122]
  |  Branch (2012:50): [True: 598k, False: 0]
  ------------------
 2013|   598k|      cpi->rc.frames_since_golden == 0 && gf_temporal_ref) {
  ------------------
  |  Branch (2013:7): [True: 125k, False: 472k]
  |  Branch (2013:43): [True: 125k, False: 18.4E]
  ------------------
 2014|   125k|    use_golden_ref_frame = 0;
 2015|   125k|  }
 2016|       |
 2017|   598k|  if (use_last_ref_frame && cpi->sf.rt_sf.short_circuit_low_temp_var &&
  ------------------
  |  Branch (2017:7): [True: 598k, False: 18.4E]
  |  Branch (2017:29): [True: 306k, False: 291k]
  ------------------
 2018|   306k|      x->nonrd_prune_ref_frame_search) {
  ------------------
  |  Branch (2018:7): [True: 306k, False: 18.4E]
  ------------------
 2019|   306k|    if (is_small_sb)
  ------------------
  |  Branch (2019:9): [True: 306k, False: 18.4E]
  ------------------
 2020|   306k|      *force_skip_low_temp_var = av1_get_force_skip_low_temp_var_small_sb(
 2021|   306k|          &x->part_search_info.variance_low[0], mi_row, mi_col, bsize);
 2022|  18.4E|    else
 2023|  18.4E|      *force_skip_low_temp_var = av1_get_force_skip_low_temp_var(
 2024|  18.4E|          &x->part_search_info.variance_low[0], mi_row, mi_col, bsize);
 2025|       |    // If force_skip_low_temp_var is set, skip golden reference.
 2026|   306k|    if (*force_skip_low_temp_var) {
  ------------------
  |  Branch (2026:9): [True: 64, False: 306k]
  ------------------
 2027|     64|      use_golden_ref_frame = 0;
 2028|     64|      use_alt_ref_frame = 0;
 2029|     64|    }
 2030|   306k|  }
 2031|       |
 2032|   598k|  if (use_last_ref_frame &&
  ------------------
  |  Branch (2032:7): [True: 598k, False: 152]
  ------------------
 2033|   598k|      (x->nonrd_prune_ref_frame_search > 2 || x->force_zeromv_skip_for_blk ||
  ------------------
  |  Branch (2033:8): [True: 18.4E, False: 598k]
  |  Branch (2033:47): [True: 18.4E, False: 598k]
  ------------------
 2034|   598k|       (x->nonrd_prune_ref_frame_search > 1 && bsize > BLOCK_64X64))) {
  ------------------
  |  Branch (2034:9): [True: 306k, False: 291k]
  |  Branch (2034:48): [True: 0, False: 306k]
  ------------------
 2035|      0|    use_golden_ref_frame = 0;
 2036|      0|    use_alt_ref_frame = 0;
 2037|      0|  }
 2038|       |
 2039|   598k|  if (segfeature_active(seg, mi->segment_id, SEG_LVL_REF_FRAME) &&
  ------------------
  |  Branch (2039:7): [True: 0, False: 598k]
  ------------------
 2040|      0|      get_segdata(seg, mi->segment_id, SEG_LVL_REF_FRAME) == GOLDEN_FRAME) {
  ------------------
  |  Branch (2040:7): [True: 0, False: 0]
  ------------------
 2041|      0|    use_ref_frame[GOLDEN_FRAME] = 1;
 2042|      0|    use_ref_frame[ALTREF_FRAME] = 0;
 2043|      0|    return;
 2044|   598k|  } else if (segfeature_active(seg, mi->segment_id, SEG_LVL_REF_FRAME) &&
  ------------------
  |  Branch (2044:14): [True: 0, False: 598k]
  ------------------
 2045|      0|             get_segdata(seg, mi->segment_id, SEG_LVL_REF_FRAME) ==
  ------------------
  |  Branch (2045:14): [True: 0, False: 0]
  ------------------
 2046|      0|                 ALTREF_FRAME) {
 2047|      0|    use_ref_frame[GOLDEN_FRAME] = 0;
 2048|      0|    use_ref_frame[ALTREF_FRAME] = 1;
 2049|      0|    return;
 2050|      0|  }
 2051|       |
 2052|       |  // Skip golden/altref reference if color is set, on flat blocks with motion.
 2053|       |  // For screen: always skip golden/alt (if color_sensitivity_sb_g/alt is set)
 2054|       |  // except when x->nonrd_prune_ref_frame_search = 0. This latter flag
 2055|       |  // may be set in the variance partition when golden is a much better
 2056|       |  // reference than last, in which case it may not be worth skipping
 2057|       |  // golden/altref completely.
 2058|       |  // Condition on use_last_ref to make sure there remains at least one
 2059|       |  // reference.
 2060|   598k|  if (use_last_ref_frame &&
  ------------------
  |  Branch (2060:7): [True: 598k, False: 180]
  ------------------
 2061|   598k|      ((cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (2061:9): [True: 0, False: 598k]
  ------------------
 2062|      0|        x->nonrd_prune_ref_frame_search != 0) ||
  ------------------
  |  Branch (2062:9): [True: 0, False: 0]
  ------------------
 2063|   598k|       (x->source_variance < 200 &&
  ------------------
  |  Branch (2063:9): [True: 2.82k, False: 595k]
  ------------------
 2064|  2.82k|        x->content_state_sb.source_sad_nonrd >= kLowSad))) {
  ------------------
  |  Branch (2064:9): [True: 2.80k, False: 26]
  ------------------
 2065|  2.80k|    if (x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|  2.80k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2065:9): [True: 0, False: 2.80k]
  ------------------
 2066|  2.80k|        x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)
  ------------------
  |  |   50|  2.80k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2066:9): [True: 0, False: 2.80k]
  ------------------
 2067|      0|      use_golden_ref_frame = 0;
 2068|  2.80k|    if (x->color_sensitivity_sb_alt[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|  2.80k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2068:9): [True: 0, False: 2.80k]
  ------------------
 2069|  2.80k|        x->color_sensitivity_sb_alt[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)
  ------------------
  |  |   50|  2.80k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2069:9): [True: 0, False: 2.80k]
  ------------------
 2070|      0|      use_alt_ref_frame = 0;
 2071|  2.80k|  }
 2072|       |
 2073|       |  // For non-screen: if golden and altref are not being selected as references
 2074|       |  // (use_golden_ref_frame/use_alt_ref_frame = 0) check to allow golden back
 2075|       |  // based on the sad of nearest/nearmv of LAST ref. If this block sad is large,
 2076|       |  // keep golden as reference. Only do this for the agrressive pruning mode and
 2077|       |  // avoid it when color is set for golden reference.
 2078|   598k|  if (cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (2078:7): [True: 598k, False: 203]
  ------------------
 2079|   598k|      (cpi->ref_frame_flags & AOM_LAST_FLAG) && !use_golden_ref_frame &&
  ------------------
  |  Branch (2079:7): [True: 598k, False: 18.4E]
  |  Branch (2079:49): [True: 125k, False: 472k]
  ------------------
 2080|   125k|      !use_alt_ref_frame && x->pred_mv_sad[LAST_FRAME] != INT_MAX &&
  ------------------
  |  Branch (2080:7): [True: 65.2k, False: 60.6k]
  |  Branch (2080:29): [True: 10.5k, False: 54.7k]
  ------------------
 2081|  10.5k|      x->nonrd_prune_ref_frame_search > 2 &&
  ------------------
  |  Branch (2081:7): [True: 0, False: 10.5k]
  ------------------
 2082|      0|      x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2082:7): [True: 0, False: 0]
  ------------------
 2083|      0|      x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_V)] == 0) {
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2083:7): [True: 0, False: 0]
  ------------------
 2084|      0|    int thr = (cm->width * cm->height > RESOLUTION_288P) ? 100 : 150;
  ------------------
  |  |   62|      0|#define RESOLUTION_288P 352 * 288
  ------------------
  |  Branch (2084:15): [True: 0, False: 0]
  ------------------
 2085|      0|    int pred = x->pred_mv_sad[LAST_FRAME] >>
 2086|      0|               (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
 2087|      0|    if (pred > thr) use_golden_ref_frame = 1;
  ------------------
  |  Branch (2087:9): [True: 0, False: 0]
  ------------------
 2088|      0|  }
 2089|       |
 2090|   598k|  use_alt_ref_frame =
 2091|   598k|      cpi->ref_frame_flags & AOM_ALT_FLAG ? use_alt_ref_frame : 0;
  ------------------
  |  Branch (2091:7): [True: 0, False: 598k]
  ------------------
 2092|   598k|  use_golden_ref_frame =
 2093|   598k|      cpi->ref_frame_flags & AOM_GOLD_FLAG ? use_golden_ref_frame : 0;
  ------------------
  |  Branch (2093:7): [True: 0, False: 598k]
  ------------------
 2094|       |
 2095|       |  // For spatial layers: enable golden ref if it is set by user and
 2096|       |  // corresponds to the lower spatial layer.
 2097|   598k|  if (cpi->svc.spatial_layer_id > 0 && (cpi->ref_frame_flags & AOM_GOLD_FLAG) &&
  ------------------
  |  Branch (2097:7): [True: 0, False: 598k]
  |  Branch (2097:40): [True: 0, False: 0]
  ------------------
 2098|      0|      x->content_state_sb.source_sad_nonrd < kHighSad) {
  ------------------
  |  Branch (2098:7): [True: 0, False: 0]
  ------------------
 2099|      0|    const int buffslot_golden =
 2100|      0|        cpi->ppi->rtc_ref.ref_idx[GOLDEN_FRAME - LAST_FRAME];
 2101|      0|    if (cpi->ppi->rtc_ref.buffer_time_index[buffslot_golden] ==
  ------------------
  |  Branch (2101:9): [True: 0, False: 0]
  ------------------
 2102|      0|        cpi->svc.current_superframe)
 2103|      0|      use_golden_ref_frame = 1;
 2104|      0|  }
 2105|       |
 2106|   598k|  use_ref_frame[ALTREF_FRAME] = use_alt_ref_frame;
 2107|   598k|  use_ref_frame[GOLDEN_FRAME] = use_golden_ref_frame;
 2108|   598k|  use_ref_frame[LAST_FRAME] = use_last_ref_frame;
 2109|       |  // Keep this assert on, as only 3 references are used in nonrd_pickmode
 2110|       |  // (LAST, GOLDEN, ALTREF), and if all 3 are not set by user then this
 2111|       |  // frame must be an intra-only frame and hence should never enter the
 2112|       |  // pickmode here for inter frames.
 2113|       |  assert(use_last_ref_frame || use_golden_ref_frame || use_alt_ref_frame);
 2114|   598k|}
nonrd_pickmode.c:is_filter_search_enabled_blk:
 2120|   598k|                                               InterpFilter *filt_select) {
 2121|   598k|  const AV1_COMMON *const cm = &cpi->common;
 2122|       |  // filt search disabled
 2123|   598k|  if (!cpi->sf.rt_sf.use_nonrd_filter_search) return 0;
  ------------------
  |  Branch (2123:7): [True: 0, False: 598k]
  ------------------
 2124|       |  // filt search purely based on mode properties
 2125|   598k|  if (!cb_pred_filter_search) return 1;
  ------------------
  |  Branch (2125:7): [True: 598k, False: 18.4E]
  ------------------
 2126|  18.4E|  MACROBLOCKD *const xd = &x->e_mbd;
 2127|  18.4E|  int enable_interp_search = 0;
 2128|  18.4E|  if (!(xd->left_mbmi && xd->above_mbmi)) {
  ------------------
  |  Branch (2128:9): [True: 0, False: 18.4E]
  |  Branch (2128:26): [True: 0, False: 0]
  ------------------
 2129|       |    // neighbors info unavailable
 2130|      0|    enable_interp_search = 2;
 2131|  18.4E|  } else if (!(is_inter_block(xd->left_mbmi) &&
  ------------------
  |  Branch (2131:16): [True: 0, False: 18.4E]
  ------------------
 2132|      0|               is_inter_block(xd->above_mbmi))) {
  ------------------
  |  Branch (2132:16): [True: 0, False: 0]
  ------------------
 2133|       |    // neighbor is INTRA
 2134|      0|    enable_interp_search = 2;
 2135|  18.4E|  } else if (xd->left_mbmi->interp_filters.as_int !=
  ------------------
  |  Branch (2135:14): [True: 0, False: 18.4E]
  ------------------
 2136|  18.4E|             xd->above_mbmi->interp_filters.as_int) {
 2137|       |    // filters are different
 2138|      0|    enable_interp_search = 2;
 2139|  18.4E|  } else if ((cb_pred_filter_search == 1) &&
  ------------------
  |  Branch (2139:14): [True: 0, False: 18.4E]
  ------------------
 2140|      0|             (xd->left_mbmi->interp_filters.as_filters.x_filter !=
  ------------------
  |  Branch (2140:14): [True: 0, False: 0]
  ------------------
 2141|      0|              EIGHTTAP_REGULAR)) {
 2142|       |    // not regular
 2143|      0|    enable_interp_search = 2;
 2144|  18.4E|  } else {
 2145|       |    // enable prediction based on chessboard pattern
 2146|  18.4E|    if (xd->left_mbmi->interp_filters.as_filters.x_filter == EIGHTTAP_SMOOTH)
  ------------------
  |  Branch (2146:9): [True: 0, False: 18.4E]
  ------------------
 2147|      0|      *filt_select = EIGHTTAP_SMOOTH;
 2148|  18.4E|    const int bsl = mi_size_wide_log2[bsize];
 2149|  18.4E|    enable_interp_search =
 2150|  18.4E|        (bool)((((mi_row + mi_col) >> bsl) +
 2151|  18.4E|                get_chessboard_index(cm->current_frame.frame_number)) &
 2152|  18.4E|               0x1);
 2153|  18.4E|    if (cyclic_refresh_segment_id_boosted(segment_id)) enable_interp_search = 1;
  ------------------
  |  Branch (2153:9): [True: 0, False: 18.4E]
  ------------------
 2154|  18.4E|  }
 2155|  18.4E|  return enable_interp_search;
 2156|   598k|}
nonrd_pickmode.c:fill_single_inter_mode_costs:
 2415|   597k|    const int16_t *mode_context) {
 2416|   597k|  bool ref_frame_used[REF_FRAMES] = { false };
 2417|  7.76M|  for (int idx = 0; idx < num_inter_modes; idx++) {
  ------------------
  |  Branch (2417:21): [True: 7.16M, False: 597k]
  ------------------
 2418|  7.16M|    ref_frame_used[reference_mode_set[idx].ref_frame] = true;
 2419|  7.16M|  }
 2420|       |
 2421|  4.77M|  for (int this_ref_frame = LAST_FRAME; this_ref_frame < REF_FRAMES;
  ------------------
  |  Branch (2421:41): [True: 4.17M, False: 597k]
  ------------------
 2422|  4.17M|       this_ref_frame++) {
 2423|  4.17M|    if (!ref_frame_used[this_ref_frame]) {
  ------------------
  |  Branch (2423:9): [True: 2.38M, False: 1.78M]
  ------------------
 2424|  2.38M|      continue;
 2425|  2.38M|    }
 2426|       |
 2427|  1.78M|    const MV_REFERENCE_FRAME rf[2] = { this_ref_frame, NONE_FRAME };
 2428|  1.78M|    const int16_t mode_ctx = av1_mode_context_analyzer(mode_context, rf);
 2429|  8.94M|    for (PREDICTION_MODE this_mode = NEARESTMV; this_mode <= NEWMV;
  ------------------
  |  Branch (2429:49): [True: 7.15M, False: 1.78M]
  ------------------
 2430|  7.15M|         this_mode++) {
 2431|  7.15M|      single_inter_mode_costs[INTER_OFFSET(this_mode)][this_ref_frame] =
  ------------------
  |  |   28|  7.15M|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 2432|  7.15M|          cost_mv_ref(mode_costs, this_mode, mode_ctx);
 2433|  7.15M|    }
 2434|  1.78M|  }
 2435|   597k|}
nonrd_pickmode.c:cost_mv_ref:
  961|  7.15M|                       int16_t mode_context) {
  962|  7.15M|  if (is_inter_compound_mode(mode)) {
  ------------------
  |  Branch (962:7): [True: 0, False: 7.15M]
  ------------------
  963|      0|    return mode_costs
  964|      0|        ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)];
  ------------------
  |  |   29|      0|#define INTER_COMPOUND_OFFSET(mode) (uint8_t)((mode) - NEAREST_NEARESTMV)
  ------------------
  965|      0|  }
  966|       |
  967|  7.15M|  int mode_cost = 0;
  968|  7.15M|  int16_t mode_ctx = mode_context & NEWMV_CTX_MASK;
  ------------------
  |  |  490|  7.15M|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|  7.15M|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  969|       |
  970|  7.15M|  assert(is_inter_mode(mode));
  971|       |
  972|  7.15M|  if (mode == NEWMV) {
  ------------------
  |  Branch (972:7): [True: 1.79M, False: 5.36M]
  ------------------
  973|  1.79M|    mode_cost = mode_costs->newmv_mode_cost[mode_ctx][0];
  974|  1.79M|    return mode_cost;
  975|  5.36M|  } else {
  976|  5.36M|    mode_cost = mode_costs->newmv_mode_cost[mode_ctx][1];
  977|  5.36M|    mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  487|  5.36M|#define GLOBALMV_OFFSET 3
  ------------------
                  mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  491|  5.36M|#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  5.36M|#define REFMV_OFFSET 4
  |  |  ------------------
  |  |               #define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  487|  5.36M|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  978|       |
  979|  5.36M|    if (mode == GLOBALMV) {
  ------------------
  |  Branch (979:9): [True: 1.79M, False: 3.57M]
  ------------------
  980|  1.79M|      mode_cost += mode_costs->zeromv_mode_cost[mode_ctx][0];
  981|  1.79M|      return mode_cost;
  982|  3.57M|    } else {
  983|  3.57M|      mode_cost += mode_costs->zeromv_mode_cost[mode_ctx][1];
  984|  3.57M|      mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|  3.57M|#define REFMV_OFFSET 4
  ------------------
                    mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|  3.57M|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  3.57M|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  985|  3.57M|      mode_cost += mode_costs->refmv_mode_cost[mode_ctx][mode != NEARESTMV];
  986|  3.57M|      return mode_cost;
  987|  3.57M|    }
  988|  5.36M|  }
  989|  7.15M|}
nonrd_pickmode.c:skip_comp_based_on_var:
 2391|  8.93k|    const unsigned int (*single_vars)[REF_FRAMES], BLOCK_SIZE bsize) {
 2392|  8.93k|  unsigned int best_var = UINT_MAX;
 2393|  44.6k|  for (int cur_mode_idx = 0; cur_mode_idx < RTC_INTER_MODES; cur_mode_idx++) {
  ------------------
  |  |   19|  44.6k|#define RTC_INTER_MODES (4)
  ------------------
  |  Branch (2393:30): [True: 35.7k, False: 8.93k]
  ------------------
 2394|   321k|    for (int ref_idx = 0; ref_idx < REF_FRAMES; ref_idx++) {
  ------------------
  |  Branch (2394:27): [True: 285k, False: 35.7k]
  ------------------
 2395|   285k|      best_var = AOMMIN(best_var, single_vars[cur_mode_idx][ref_idx]);
  ------------------
  |  |   34|   285k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 253k, False: 31.8k]
  |  |  ------------------
  ------------------
 2396|   285k|    }
 2397|  35.7k|  }
 2398|  8.93k|  const unsigned int thresh_64 = (unsigned int)(0.57356805f * 8659);
 2399|  8.93k|  const unsigned int thresh_32 = (unsigned int)(0.23964763f * 4281);
 2400|       |
 2401|       |  // Currently, the thresh for 128 and 16 are not well-tuned. We are using the
 2402|       |  // results from 64 and 32 as an heuristic.
 2403|  8.93k|  switch (bsize) {
 2404|      0|    case BLOCK_128X128: return best_var < 4 * thresh_64;
  ------------------
  |  Branch (2404:5): [True: 0, False: 8.93k]
  ------------------
 2405|     64|    case BLOCK_64X64: return best_var < thresh_64;
  ------------------
  |  Branch (2405:5): [True: 64, False: 8.87k]
  ------------------
 2406|  8.53k|    case BLOCK_32X32: return best_var < thresh_32;
  ------------------
  |  Branch (2406:5): [True: 8.53k, False: 397]
  ------------------
 2407|      0|    case BLOCK_16X16: return best_var < thresh_32 / 4;
  ------------------
  |  Branch (2407:5): [True: 0, False: 8.93k]
  ------------------
 2408|    340|    default: return false;
  ------------------
  |  Branch (2408:5): [True: 340, False: 8.59k]
  ------------------
 2409|  8.93k|  }
 2410|  8.93k|}
nonrd_pickmode.c:set_color_sensitivity:
 2241|  67.2k|                                  struct buf_2d yv12_mb[MAX_MB_PLANE]) {
 2242|  67.2k|  const int subsampling_x = cpi->common.seq_params->subsampling_x;
 2243|  67.2k|  const int subsampling_y = cpi->common.seq_params->subsampling_y;
 2244|  67.2k|  const int source_sad_nonrd = x->content_state_sb.source_sad_nonrd;
 2245|  67.2k|  const int high_res = cpi->common.width * cpi->common.height >= 640 * 360;
 2246|  67.2k|  if (bsize == cpi->common.seq_params->sb_size &&
  ------------------
  |  Branch (2246:7): [True: 10, False: 67.2k]
  ------------------
 2247|     10|      !x->force_color_check_block_level) {
  ------------------
  |  Branch (2247:7): [True: 10, False: 0]
  ------------------
 2248|       |    // At superblock level color_sensitivity is already set to 0, 1, or 2.
 2249|       |    // 2 is middle/uncertain level. To avoid additional sad
 2250|       |    // computations when bsize = sb_size force level 2 to 1 (certain color)
 2251|       |    // for motion areas. Avoid this shortcut if x->force_color_check_block_level
 2252|       |    // is set.
 2253|     10|    if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 2) {
  ------------------
  |  |   50|     10|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2253:9): [True: 4, False: 6]
  ------------------
 2254|      4|      x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] =
  ------------------
  |  |   50|      4|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2255|      4|          source_sad_nonrd >= kMedSad ? 1 : 0;
  ------------------
  |  Branch (2255:11): [True: 4, False: 0]
  ------------------
 2256|      4|    }
 2257|     10|    if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 2) {
  ------------------
  |  |   50|     10|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2257:9): [True: 4, False: 6]
  ------------------
 2258|      4|      x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] =
  ------------------
  |  |   50|      4|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2259|      4|          source_sad_nonrd >= kMedSad ? 1 : 0;
  ------------------
  |  Branch (2259:11): [True: 4, False: 0]
  ------------------
 2260|      4|    }
 2261|     10|    return;
 2262|     10|  }
 2263|       |  // Divide factor for comparing uv_sad to y_sad.
 2264|  67.2k|  int shift = 3;
 2265|       |  // Threshold for the block spatial source variance.
 2266|  67.2k|  unsigned int source_var_thr = 50;
 2267|       |  // Thresholds for normalized uv_sad, the first one is used for
 2268|       |  // low source_varaince.
 2269|  67.2k|  int norm_uv_sad_thresh = 100;
 2270|  67.2k|  int norm_uv_sad_thresh2 = 40;
 2271|  67.2k|  if (source_sad_nonrd >= kMedSad && x->source_variance > 0 && high_res)
  ------------------
  |  Branch (2271:7): [True: 67.1k, False: 96]
  |  Branch (2271:38): [True: 66.8k, False: 337]
  |  Branch (2271:64): [True: 0, False: 66.8k]
  ------------------
 2272|      0|    shift = 4;
 2273|  67.2k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (2273:7): [True: 0, False: 67.2k]
  ------------------
 2274|      0|    if (cpi->rc.high_source_sad) shift = 6;
  ------------------
  |  Branch (2274:9): [True: 0, False: 0]
  ------------------
 2275|      0|    if (source_sad_nonrd > kMedSad) {
  ------------------
  |  Branch (2275:9): [True: 0, False: 0]
  ------------------
 2276|      0|      source_var_thr = 1200;
 2277|      0|      norm_uv_sad_thresh = 10;
 2278|      0|    }
 2279|      0|    if (cpi->rc.percent_blocks_with_motion > 90 &&
  ------------------
  |  Branch (2279:9): [True: 0, False: 0]
  ------------------
 2280|      0|        cpi->rc.frame_source_sad > 10000 && source_sad_nonrd > kLowSad) {
  ------------------
  |  Branch (2280:9): [True: 0, False: 0]
  |  Branch (2280:45): [True: 0, False: 0]
  ------------------
 2281|       |      // Aggressive setting for color_sensitivity for this content.
 2282|      0|      shift = 10;
 2283|      0|      norm_uv_sad_thresh = 0;
 2284|      0|      norm_uv_sad_thresh2 = 0;
 2285|      0|    }
 2286|      0|  }
 2287|  67.2k|  NOISE_LEVEL noise_level = kLow;
 2288|  67.2k|  int norm_sad =
 2289|  67.2k|      y_sad >> (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
 2290|  67.2k|  unsigned int thresh_spatial = (cpi->common.width > 1920) ? 5000 : 1000;
  ------------------
  |  Branch (2290:33): [True: 0, False: 67.2k]
  ------------------
 2291|       |  // If the spatial source variance is high and the normalized y_sad
 2292|       |  // is low, then y-channel is likely good for mode estimation, so keep
 2293|       |  // color_sensitivity off. For low noise content for now, since there is
 2294|       |  // some bdrate regression for noisy color clip.
 2295|  67.2k|  if (cpi->noise_estimate.enabled)
  ------------------
  |  Branch (2295:7): [True: 0, False: 67.2k]
  ------------------
 2296|      0|    noise_level = av1_noise_estimate_extract_level(&cpi->noise_estimate);
 2297|  67.2k|  if (noise_level == kLow && source_variance > thresh_spatial &&
  ------------------
  |  Branch (2297:7): [True: 67.2k, False: 27]
  |  Branch (2297:30): [True: 59.2k, False: 8.00k]
  ------------------
 2298|  59.2k|      cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN && norm_sad < 50) {
  ------------------
  |  Branch (2298:7): [True: 59.2k, False: 18.4E]
  |  Branch (2298:59): [True: 0, False: 59.2k]
  ------------------
 2299|      0|    x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] = 0;
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2300|      0|    x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] = 0;
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2301|      0|    return;
 2302|      0|  }
 2303|  67.2k|  const int num_planes = av1_num_planes(&cpi->common);
 2304|       |
 2305|   110k|  for (int plane = AOM_PLANE_U; plane < num_planes; ++plane) {
  ------------------
  |  |  282|  67.2k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  |  Branch (2305:33): [True: 43.5k, False: 67.2k]
  ------------------
 2306|       |    // Always check if level = 2. If level = 0 check again for
 2307|       |    // motion areas for higher resolns, where color artifacts
 2308|       |    // are more noticeable. Always check if
 2309|       |    // x->force_color_check_block_level is set.
 2310|  43.5k|    if (x->color_sensitivity[COLOR_SENS_IDX(plane)] == 2 ||
  ------------------
  |  |   50|  43.5k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2310:9): [True: 31.9k, False: 11.6k]
  ------------------
 2311|  11.6k|        x->force_color_check_block_level ||
  ------------------
  |  Branch (2311:9): [True: 1, False: 11.6k]
  ------------------
 2312|  11.6k|        (x->color_sensitivity[COLOR_SENS_IDX(plane)] == 0 &&
  ------------------
  |  |   50|  11.6k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2312:10): [True: 639, False: 10.9k]
  ------------------
 2313|  31.9k|         source_sad_nonrd >= kMedSad && high_res)) {
  ------------------
  |  Branch (2313:10): [True: 636, False: 3]
  |  Branch (2313:41): [True: 0, False: 636]
  ------------------
 2314|  31.9k|      struct macroblock_plane *const p = &x->plane[plane];
 2315|  31.9k|      const BLOCK_SIZE bs =
 2316|  31.9k|          get_plane_block_size(bsize, subsampling_x, subsampling_y);
 2317|       |
 2318|  31.9k|      const int uv_sad = cpi->ppi->fn_ptr[bs].sdf(
 2319|  31.9k|          p->src.buf, p->src.stride, yv12_mb[plane].buf, yv12_mb[plane].stride);
 2320|       |
 2321|  31.9k|      const int norm_uv_sad =
 2322|  31.9k|          uv_sad >> (b_width_log2_lookup[bs] + b_height_log2_lookup[bs]);
 2323|  31.9k|      x->color_sensitivity[COLOR_SENS_IDX(plane)] =
  ------------------
  |  |   50|  31.9k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2324|  31.9k|          uv_sad > (y_sad >> shift) && norm_uv_sad > norm_uv_sad_thresh2;
  ------------------
  |  Branch (2324:11): [True: 31.6k, False: 305]
  |  Branch (2324:40): [True: 31.6k, False: 1]
  ------------------
 2325|  31.9k|      if (source_variance < source_var_thr && norm_uv_sad > norm_uv_sad_thresh)
  ------------------
  |  Branch (2325:11): [True: 180, False: 31.8k]
  |  Branch (2325:47): [True: 145, False: 35]
  ------------------
 2326|    145|        x->color_sensitivity[COLOR_SENS_IDX(plane)] = 1;
  ------------------
  |  |   50|    145|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 2327|  31.9k|    }
 2328|  43.5k|  }
 2329|  67.2k|}
nonrd_pickmode.c:skip_inter_mode_nonrd:
 2676|  7.17M|    bool comp_use_zero_zeromv_only, bool check_globalmv) {
 2677|  7.17M|  AV1_COMMON *const cm = &cpi->common;
 2678|  7.17M|  const struct segmentation *const seg = &cm->seg;
 2679|  7.17M|  const SVC *const svc = &cpi->svc;
 2680|  7.17M|  MACROBLOCKD *const xd = &x->e_mbd;
 2681|  7.17M|  MB_MODE_INFO *const mi = xd->mi[0];
 2682|  7.17M|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
 2683|       |
 2684|       |  // Skip compound mode based on reference frame mask and type of the mode and
 2685|       |  // for allowed compound modes, setup ref mv stack and reference frame.
 2686|  7.17M|  if (idx >= num_inter_modes) {
  ------------------
  |  Branch (2686:7): [True: 53.6k, False: 7.11M]
  ------------------
 2687|  53.6k|    const int comp_index = idx - num_inter_modes;
 2688|  53.6k|    const COMP_REF_MODE *const comp_modes = is_one_pass_rt_lag_params(cpi)
  ------------------
  |  Branch (2688:45): [True: 0, False: 53.6k]
  ------------------
 2689|  53.6k|                                                ? comp_ref_mode_set_full
 2690|  53.6k|                                                : comp_ref_mode_set;
 2691|  53.6k|    const MV_REFERENCE_FRAME *rf = comp_modes[comp_index].ref_frame;
 2692|  53.6k|    *this_mode = comp_modes[comp_index].pred_mode;
 2693|  53.6k|    *ref_frame = rf[0];
 2694|  53.6k|    *ref_frame2 = rf[1];
 2695|  53.6k|    assert(*ref_frame == LAST_FRAME);
 2696|  53.6k|    assert(*this_mode == GLOBAL_GLOBALMV || *this_mode == NEAREST_NEARESTMV);
 2697|  53.6k|    if (!setup_compound_params_from_comp_idx(
  ------------------
  |  Branch (2697:9): [True: 53.6k, False: 7]
  ------------------
 2698|  53.6k|            cpi, x, search_state->yv12_mb, this_mode, ref_frame, ref_frame2,
 2699|  53.6k|            search_state->frame_mv, search_state->use_ref_frame_mask,
 2700|  53.6k|            comp_index, comp_use_zero_zeromv_only, last_comp_ref_frame,
 2701|  53.6k|            bsize)) {
 2702|  53.6k|      return true;
 2703|  53.6k|    }
 2704|      7|    *is_single_pred = 0;
 2705|  7.11M|  } else {
 2706|  7.11M|    *ref_frame2 = NONE_FRAME;
 2707|  7.11M|    const REF_MODE *const single_modes =
 2708|  7.11M|        is_one_pass_rt_lag_params(cpi) ? ref_mode_set_full : ref_mode_set;
  ------------------
  |  Branch (2708:9): [True: 0, False: 7.11M]
  ------------------
 2709|  7.11M|    *this_mode = single_modes[idx].pred_mode;
 2710|  7.11M|    *ref_frame = single_modes[idx].ref_frame;
 2711|  7.11M|  }
 2712|       |
 2713|  7.11M|  if (is_one_pass_rt_lag_params(cpi) && cpi->rc.is_src_frame_alt_ref) {
  ------------------
  |  Branch (2713:7): [True: 0, False: 7.11M]
  |  Branch (2713:41): [True: 0, False: 0]
  ------------------
 2714|      0|    if (*this_mode != GLOBALMV || *ref_frame != ALTREF_FRAME) return true;
  ------------------
  |  Branch (2714:9): [True: 0, False: 0]
  |  Branch (2714:35): [True: 0, False: 0]
  ------------------
 2715|      0|  }
 2716|       |
 2717|  7.11M|  if (cpi->sf.rt_sf.skip_newmv_mode_sad_screen && cpi->rc.high_source_sad &&
  ------------------
  |  Branch (2717:7): [True: 0, False: 7.11M]
  |  Branch (2717:51): [True: 0, False: 0]
  ------------------
 2718|      0|      x->content_state_sb.source_sad_nonrd >= kMedSad && bsize <= BLOCK_16X16 &&
  ------------------
  |  Branch (2718:7): [True: 0, False: 0]
  |  Branch (2718:58): [True: 0, False: 0]
  ------------------
 2719|      0|      !x->sb_me_block && (*ref_frame != LAST_FRAME || *this_mode == NEWMV))
  ------------------
  |  Branch (2719:7): [True: 0, False: 0]
  |  Branch (2719:27): [True: 0, False: 0]
  |  Branch (2719:55): [True: 0, False: 0]
  ------------------
 2720|      0|    return true;
 2721|       |
 2722|  7.11M|  if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) &&
  ------------------
  |  Branch (2722:7): [True: 0, False: 7.11M]
  ------------------
 2723|      0|      (*this_mode != GLOBALMV || *ref_frame != LAST_FRAME))
  ------------------
  |  Branch (2723:8): [True: 0, False: 0]
  |  Branch (2723:34): [True: 0, False: 0]
  ------------------
 2724|      0|    return true;
 2725|       |
 2726|       |  // Skip the mode if use reference frame mask flag is not set.
 2727|  7.11M|  if (!search_state->use_ref_frame_mask[*ref_frame]) return true;
  ------------------
  |  Branch (2727:7): [True: 4.76M, False: 2.35M]
  ------------------
 2728|       |
 2729|  2.35M|  *force_mv_inter_layer = 0;
 2730|  2.35M|  if (cpi->ppi->use_svc && svc->spatial_layer_id > 0 &&
  ------------------
  |  Branch (2730:7): [True: 0, False: 2.35M]
  |  Branch (2730:28): [True: 0, False: 0]
  ------------------
 2731|      0|      ((*ref_frame == LAST_FRAME && svc->skip_mvsearch_last) ||
  ------------------
  |  Branch (2731:9): [True: 0, False: 0]
  |  Branch (2731:37): [True: 0, False: 0]
  ------------------
 2732|      0|       (*ref_frame == GOLDEN_FRAME && svc->skip_mvsearch_gf) ||
  ------------------
  |  Branch (2732:9): [True: 0, False: 0]
  |  Branch (2732:39): [True: 0, False: 0]
  ------------------
 2733|      0|       (*ref_frame == ALTREF_FRAME && svc->skip_mvsearch_altref))) {
  ------------------
  |  Branch (2733:9): [True: 0, False: 0]
  |  Branch (2733:39): [True: 0, False: 0]
  ------------------
 2734|       |    // Only test mode if NEARESTMV/NEARMV is (svc_mv.mv.col, svc_mv.mv.row),
 2735|       |    // otherwise set NEWMV to (svc_mv.mv.col, svc_mv.mv.row).
 2736|       |    // Skip newmv and filter search.
 2737|      0|    *force_mv_inter_layer = 1;
 2738|      0|    if (*this_mode == NEWMV) {
  ------------------
  |  Branch (2738:9): [True: 0, False: 0]
  ------------------
 2739|      0|      search_state->frame_mv[*this_mode][*ref_frame] = svc_mv;
 2740|      0|    } else if (search_state->frame_mv[*this_mode][*ref_frame].as_int !=
  ------------------
  |  Branch (2740:16): [True: 0, False: 0]
  ------------------
 2741|      0|               svc_mv.as_int) {
 2742|      0|      return true;
 2743|      0|    }
 2744|      0|  }
 2745|       |
 2746|       |  // If the segment reference frame feature is enabled then do nothing if the
 2747|       |  // current ref frame is not allowed.
 2748|  2.35M|  if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (2748:7): [True: 0, False: 2.35M]
  ------------------
 2749|      0|    if (get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)(*ref_frame))
  ------------------
  |  Branch (2749:9): [True: 0, False: 0]
  ------------------
 2750|      0|      return true;
 2751|      0|    return false;
 2752|      0|  }
 2753|       |
 2754|       |  // Don't skip non_last references if LAST is not used a reference.
 2755|  2.35M|  if (!(cpi->ref_frame_flags & AOM_LAST_FLAG) &&
  ------------------
  |  Branch (2755:7): [True: 0, False: 2.35M]
  ------------------
 2756|      0|      (*ref_frame == GOLDEN_FRAME || *ref_frame == ALTREF_FRAME))
  ------------------
  |  Branch (2756:8): [True: 0, False: 0]
  |  Branch (2756:38): [True: 0, False: 0]
  ------------------
 2757|      0|    return false;
 2758|       |
 2759|       |  // Skip mode for some modes and reference frames when
 2760|       |  // force_zeromv_skip_for_blk flag is true.
 2761|  2.35M|  if (x->force_zeromv_skip_for_blk &&
  ------------------
  |  Branch (2761:7): [True: 0, False: 2.35M]
  ------------------
 2762|      0|      ((!(*this_mode == NEARESTMV &&
  ------------------
  |  Branch (2762:11): [True: 0, False: 0]
  ------------------
 2763|      0|          search_state->frame_mv[*this_mode][*ref_frame].as_int == 0) &&
  ------------------
  |  Branch (2763:11): [True: 0, False: 0]
  ------------------
 2764|      0|        *this_mode != GLOBALMV) ||
  ------------------
  |  Branch (2764:9): [True: 0, False: 0]
  ------------------
 2765|      0|       *ref_frame != LAST_FRAME))
  ------------------
  |  Branch (2765:8): [True: 0, False: 0]
  ------------------
 2766|      0|    return true;
 2767|       |
 2768|  2.35M|  if (x->sb_me_block && *ref_frame == LAST_FRAME) {
  ------------------
  |  Branch (2768:7): [True: 0, False: 2.35M]
  |  Branch (2768:25): [True: 0, False: 0]
  ------------------
 2769|       |    // We want to make sure to test the superblock MV:
 2770|       |    // so don't skip (return false) for NEAREST_LAST or NEAR_LAST if they
 2771|       |    // have this sb MV. And don't skip NEWMV_LAST: this will be set to
 2772|       |    // sb MV in handle_inter_mode_nonrd(), in case NEAREST or NEAR don't
 2773|       |    // have it.
 2774|      0|    if (*this_mode == NEARESTMV &&
  ------------------
  |  Branch (2774:9): [True: 0, False: 0]
  ------------------
 2775|      0|        search_state->frame_mv[NEARESTMV][LAST_FRAME].as_int ==
  ------------------
  |  Branch (2775:9): [True: 0, False: 0]
  ------------------
 2776|      0|            x->sb_me_mv.as_int) {
 2777|      0|      return false;
 2778|      0|    }
 2779|      0|    if (*this_mode == NEARMV &&
  ------------------
  |  Branch (2779:9): [True: 0, False: 0]
  ------------------
 2780|      0|        search_state->frame_mv[NEARMV][LAST_FRAME].as_int ==
  ------------------
  |  Branch (2780:9): [True: 0, False: 0]
  ------------------
 2781|      0|            x->sb_me_mv.as_int) {
 2782|      0|      return false;
 2783|      0|    }
 2784|      0|    if (*this_mode == NEWMV) {
  ------------------
  |  Branch (2784:9): [True: 0, False: 0]
  ------------------
 2785|      0|      return false;
 2786|      0|    }
 2787|      0|  }
 2788|       |
 2789|       |  // Skip the single reference mode for which mode check flag is set.
 2790|  2.37M|  if (*is_single_pred && search_state->mode_checked[*this_mode][*ref_frame]) {
  ------------------
  |  Branch (2790:7): [True: 2.37M, False: 18.4E]
  |  Branch (2790:26): [True: 5.60k, False: 2.37M]
  ------------------
 2791|  5.60k|    return true;
 2792|  5.60k|  }
 2793|       |
 2794|       |  // Skip GLOBALMV mode if check_globalmv flag is not enabled.
 2795|  2.34M|  if (!check_globalmv && *this_mode == GLOBALMV) {
  ------------------
  |  Branch (2795:7): [True: 903k, False: 1.44M]
  |  Branch (2795:26): [True: 243k, False: 660k]
  ------------------
 2796|   243k|    return true;
 2797|   243k|  }
 2798|       |
 2799|       |#if COLLECT_NONRD_PICK_MODE_STAT
 2800|       |  aom_usec_timer_start(&x->ms_stat_nonrd.timer1);
 2801|       |  x->ms_stat_nonrd.num_searches[bsize][*this_mode]++;
 2802|       |#endif
 2803|  2.10M|  mi->mode = *this_mode;
 2804|  2.10M|  mi->ref_frame[0] = *ref_frame;
 2805|  2.10M|  mi->ref_frame[1] = *ref_frame2;
 2806|       |
 2807|       |  // Skip compound mode based on variance of previously evaluated single
 2808|       |  // reference modes.
 2809|  2.10M|  if (rt_sf->prune_compoundmode_with_singlemode_var && !*is_single_pred &&
  ------------------
  |  Branch (2809:7): [True: 1.03M, False: 1.06M]
  |  Branch (2809:56): [True: 0, False: 1.03M]
  ------------------
 2810|      0|      !is_one_pass_rt_lag_params(cpi) &&
  ------------------
  |  Branch (2810:7): [True: 0, False: 0]
  ------------------
 2811|      0|      prune_compoundmode_with_singlemode_var(
  ------------------
  |  Branch (2811:7): [True: 0, False: 0]
  ------------------
 2812|      0|          *this_mode, *ref_frame, *ref_frame2, search_state->frame_mv,
 2813|      0|          search_state->mode_checked, search_state->vars,
 2814|      0|          search_state->uv_dist)) {
 2815|      0|    return true;
 2816|      0|  }
 2817|       |
 2818|       |  // For screen content: skip mode testing based on source_sad.
 2819|  2.10M|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (2819:7): [True: 0, False: 2.10M]
  ------------------
 2820|      0|      !x->force_zeromv_skip_for_blk) {
  ------------------
  |  Branch (2820:7): [True: 0, False: 0]
  ------------------
 2821|       |    // If source_sad is computed: skip non-zero motion
 2822|       |    // check for stationary (super)blocks. Otherwise if superblock
 2823|       |    // has motion skip the modes with zero motion on last reference
 2824|       |    // for flat blocks, and color is not set.
 2825|       |    // For the latter condition: the same condition should apply
 2826|       |    // to newmv if (0, 0), so this latter condition is repeated
 2827|       |    // below after search_new_mv.
 2828|      0|    if (rt_sf->source_metrics_sb_nonrd) {
  ------------------
  |  Branch (2828:9): [True: 0, False: 0]
  ------------------
 2829|      0|      if ((search_state->frame_mv[*this_mode][*ref_frame].as_int != 0 &&
  ------------------
  |  Branch (2829:12): [True: 0, False: 0]
  ------------------
 2830|      0|           x->content_state_sb.source_sad_nonrd == kZeroSad) ||
  ------------------
  |  Branch (2830:12): [True: 0, False: 0]
  ------------------
 2831|      0|          (search_state->frame_mv[*this_mode][*ref_frame].as_int == 0 &&
  ------------------
  |  Branch (2831:12): [True: 0, False: 0]
  ------------------
 2832|      0|           x->block_is_zero_sad == 0 && *ref_frame == LAST_FRAME &&
  ------------------
  |  Branch (2832:12): [True: 0, False: 0]
  |  Branch (2832:41): [True: 0, False: 0]
  ------------------
 2833|      0|           ((x->color_sensitivity_sb[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2833:14): [True: 0, False: 0]
  ------------------
 2834|      0|             x->color_sensitivity_sb[COLOR_SENS_IDX(AOM_PLANE_V)] == 0) ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2834:14): [True: 0, False: 0]
  ------------------
 2835|      0|            cpi->rc.high_source_sad) &&
  ------------------
  |  Branch (2835:13): [True: 0, False: 0]
  ------------------
 2836|      0|           x->source_variance == 0))
  ------------------
  |  Branch (2836:12): [True: 0, False: 0]
  ------------------
 2837|      0|        return true;
 2838|      0|    }
 2839|       |    // Skip NEWMV search for flat blocks.
 2840|      0|    if (rt_sf->skip_newmv_flat_blocks_screen && *this_mode == NEWMV &&
  ------------------
  |  Branch (2840:9): [True: 0, False: 0]
  |  Branch (2840:49): [True: 0, False: 0]
  ------------------
 2841|      0|        x->source_variance < 100)
  ------------------
  |  Branch (2841:9): [True: 0, False: 0]
  ------------------
 2842|      0|      return true;
 2843|       |    // Skip non-LAST for color on flat blocks.
 2844|      0|    if (*ref_frame > LAST_FRAME && x->source_variance == 0 &&
  ------------------
  |  Branch (2844:9): [True: 0, False: 0]
  |  Branch (2844:36): [True: 0, False: 0]
  ------------------
 2845|      0|        (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2845:10): [True: 0, False: 0]
  ------------------
 2846|      0|         x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 1))
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2846:10): [True: 0, False: 0]
  ------------------
 2847|      0|      return true;
 2848|      0|  }
 2849|       |
 2850|  2.10M|  if (is_one_pass_rt_lag_params(cpi)) return false;
  ------------------
  |  Branch (2850:7): [True: 0, False: 2.10M]
  ------------------
 2851|       |
 2852|       |  // Skip mode based on block size, reference frame mode and other block
 2853|       |  // properties.
 2854|  2.10M|  if (skip_mode_by_bsize_and_ref_frame(
  ------------------
  |  Branch (2854:7): [True: 9.28k, False: 2.09M]
  ------------------
 2855|  2.10M|          *this_mode, *ref_frame, bsize, x->nonrd_prune_ref_frame_search,
 2856|  2.10M|          sse_zeromv_norm, rt_sf->nonrd_aggressive_skip,
 2857|  2.10M|          rt_sf->increase_source_sad_thresh))
 2858|  9.28k|    return true;
 2859|       |
 2860|       |  // Skip mode based on low temporal variance and souce sad.
 2861|  2.09M|  if (skip_mode_by_low_temp(*this_mode, *ref_frame, bsize, x->content_state_sb,
  ------------------
  |  Branch (2861:7): [True: 0, False: 2.09M]
  ------------------
 2862|  2.09M|                            search_state->frame_mv[*this_mode][*ref_frame],
 2863|  2.09M|                            force_skip_low_temp_var))
 2864|      0|    return true;
 2865|       |
 2866|       |  // Disable this drop out case if the ref frame segment level feature is
 2867|       |  // enabled for this segment. This is to prevent the possibility that we
 2868|       |  // end up unable to pick any mode.
 2869|  2.11M|  if (!segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (2869:7): [True: 2.11M, False: 18.4E]
  ------------------
 2870|       |    // Check for skipping GOLDEN and ALTREF based pred_mv_sad.
 2871|  2.11M|    if (rt_sf->nonrd_prune_ref_frame_search > 0 &&
  ------------------
  |  Branch (2871:9): [True: 2.11M, False: 18.4E]
  ------------------
 2872|  2.11M|        x->pred_mv_sad[*ref_frame] != INT_MAX && *ref_frame != LAST_FRAME) {
  ------------------
  |  Branch (2872:9): [True: 249k, False: 1.86M]
  |  Branch (2872:50): [True: 0, False: 249k]
  ------------------
 2873|      0|      if ((int64_t)(x->pred_mv_sad[*ref_frame]) > *thresh_sad_pred) return true;
  ------------------
  |  Branch (2873:11): [True: 0, False: 0]
  ------------------
 2874|      0|    }
 2875|  2.11M|  }
 2876|       |
 2877|       |  // Check for skipping NEARMV based on pred_mv_sad.
 2878|  2.09M|  if (*this_mode == NEARMV && x->pred_mv1_sad[*ref_frame] != INT_MAX &&
  ------------------
  |  Branch (2878:7): [True: 588k, False: 1.50M]
  |  Branch (2878:31): [True: 59.4k, False: 528k]
  ------------------
 2879|  59.4k|      x->pred_mv1_sad[*ref_frame] > (x->pred_mv0_sad[*ref_frame] << 1))
  ------------------
  |  Branch (2879:7): [True: 75, False: 59.3k]
  ------------------
 2880|     75|    return true;
 2881|       |
 2882|       |  // Skip single reference mode based on rd threshold.
 2883|  2.11M|  if (*is_single_pred) {
  ------------------
  |  Branch (2883:7): [True: 2.11M, False: 18.4E]
  ------------------
 2884|  2.11M|    if (skip_mode_by_threshold(
  ------------------
  |  Branch (2884:9): [True: 89, False: 2.11M]
  ------------------
 2885|  2.11M|            *this_mode, *ref_frame,
 2886|  2.11M|            search_state->frame_mv[*this_mode][*ref_frame],
 2887|  2.11M|            cpi->rc.frames_since_golden, cpi->rd.threshes[segment_id][bsize],
 2888|  2.11M|            x->thresh_freq_fact[bsize], search_state->best_rdc.rdcost,
 2889|  2.11M|            search_state->best_pickmode.best_mode_skip_txfm,
 2890|  2.11M|            (rt_sf->nonrd_aggressive_skip ? 1 : 0)))
  ------------------
  |  Branch (2890:14): [True: 236k, False: 1.87M]
  ------------------
 2891|     89|      return true;
 2892|  2.11M|  }
 2893|  2.09M|  return false;
 2894|  2.09M|}
nonrd_pickmode.c:setup_compound_params_from_comp_idx:
 2462|  53.6k|    BLOCK_SIZE bsize) {
 2463|  53.6k|  const MV_REFERENCE_FRAME *rf =
 2464|  53.6k|      is_one_pass_rt_lag_params(cpi)
  ------------------
  |  Branch (2464:7): [True: 0, False: 53.6k]
  ------------------
 2465|  53.6k|          ? comp_ref_mode_set_full[comp_index].ref_frame
 2466|  53.6k|          : comp_ref_mode_set[comp_index].ref_frame;
 2467|  53.6k|  int skip_gf = 0;
 2468|  53.6k|  int skip_alt = 0;
 2469|  53.6k|  if (x->source_variance < 50 && bsize > BLOCK_16X16) {
  ------------------
  |  Branch (2469:7): [True: 12, False: 53.6k]
  |  Branch (2469:34): [True: 12, False: 0]
  ------------------
 2470|     12|    if (x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|     12|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2470:9): [True: 0, False: 12]
  ------------------
 2471|     12|        x->color_sensitivity_sb_g[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)
  ------------------
  |  |   50|     12|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2471:9): [True: 0, False: 12]
  ------------------
 2472|      0|      skip_gf = 1;
 2473|     12|    if (x->color_sensitivity_sb_alt[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 ||
  ------------------
  |  |   50|     12|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2473:9): [True: 0, False: 12]
  ------------------
 2474|     12|        x->color_sensitivity_sb_alt[COLOR_SENS_IDX(AOM_PLANE_V)] == 1)
  ------------------
  |  |   50|     12|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2474:9): [True: 0, False: 12]
  ------------------
 2475|      0|      skip_alt = 1;
 2476|     12|  }
 2477|  53.6k|  if (comp_use_zero_zeromv_only && *this_mode != GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (2477:7): [True: 53.6k, False: 1]
  |  Branch (2477:36): [True: 26.8k, False: 26.8k]
  ------------------
 2478|  26.8k|    return 0;
 2479|  26.8k|  }
 2480|  26.8k|  if (*ref_frame2 == GOLDEN_FRAME &&
  ------------------
  |  Branch (2480:7): [True: 8.93k, False: 17.8k]
  ------------------
 2481|  8.93k|      (cpi->sf.rt_sf.ref_frame_comp_nonrd[0] == 0 || skip_gf ||
  ------------------
  |  Branch (2481:8): [True: 8.93k, False: 0]
  |  Branch (2481:54): [True: 0, False: 0]
  ------------------
 2482|  8.93k|       !(cpi->ref_frame_flags & AOM_GOLD_FLAG))) {
  ------------------
  |  Branch (2482:8): [True: 0, False: 0]
  ------------------
 2483|  8.93k|    return 0;
 2484|  17.8k|  } else if (*ref_frame2 == LAST2_FRAME &&
  ------------------
  |  Branch (2484:14): [True: 8.94k, False: 8.91k]
  ------------------
 2485|  8.94k|             (cpi->sf.rt_sf.ref_frame_comp_nonrd[1] == 0 ||
  ------------------
  |  Branch (2485:15): [True: 8.94k, False: 0]
  ------------------
 2486|  8.94k|              !(cpi->ref_frame_flags & AOM_LAST2_FLAG))) {
  ------------------
  |  Branch (2486:15): [True: 0, False: 0]
  ------------------
 2487|  8.94k|    return 0;
 2488|  8.94k|  } else if (*ref_frame2 == ALTREF_FRAME &&
  ------------------
  |  Branch (2488:14): [True: 8.94k, False: 18.4E]
  ------------------
 2489|  8.94k|             (cpi->sf.rt_sf.ref_frame_comp_nonrd[2] == 0 || skip_alt ||
  ------------------
  |  Branch (2489:15): [True: 6, False: 8.93k]
  |  Branch (2489:61): [True: 18.4E, False: 8.93k]
  ------------------
 2490|  8.93k|              !(cpi->ref_frame_flags & AOM_ALT_FLAG))) {
  ------------------
  |  Branch (2490:15): [True: 8.93k, False: 0]
  ------------------
 2491|  8.93k|    return 0;
 2492|  8.93k|  }
 2493|  18.4E|  int ref_mv_idx = 0;
 2494|  18.4E|  if (*last_comp_ref_frame != rf[1]) {
  ------------------
  |  Branch (2494:7): [True: 0, False: 18.4E]
  ------------------
 2495|       |    // Only needs to be done once per reference pair.
 2496|      0|    setup_compound_prediction(&cpi->common, x, yv12_mb, use_ref_frame_mask, rf,
 2497|      0|                              &ref_mv_idx);
 2498|      0|    *last_comp_ref_frame = rf[1];
 2499|      0|  }
 2500|  18.4E|  set_compound_mode(x, *ref_frame, *ref_frame2, ref_mv_idx, frame_mv,
 2501|  18.4E|                    *this_mode);
 2502|  18.4E|  if (*this_mode != GLOBAL_GLOBALMV &&
  ------------------
  |  Branch (2502:7): [True: 0, False: 18.4E]
  ------------------
 2503|      0|      frame_mv[*this_mode][*ref_frame].as_int == 0 &&
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|      frame_mv[*this_mode][*ref_frame2].as_int == 0) {
  ------------------
  |  Branch (2504:7): [True: 0, False: 0]
  ------------------
 2505|      0|    return 0;
 2506|      0|  }
 2507|       |
 2508|  18.4E|  return 1;
 2509|  18.4E|}
nonrd_pickmode.c:skip_mode_by_bsize_and_ref_frame:
 2206|  2.12M|    int skip_nearmv) {
 2207|  2.12M|  const unsigned int thresh_skip_golden = 500;
 2208|       |
 2209|  2.12M|  if (ref_frame != LAST_FRAME && sse_zeromv_norm < thresh_skip_golden &&
  ------------------
  |  Branch (2209:7): [True: 0, False: 2.12M]
  |  Branch (2209:34): [True: 0, False: 0]
  ------------------
 2210|      0|      mode == NEWMV)
  ------------------
  |  Branch (2210:7): [True: 0, False: 0]
  ------------------
 2211|      0|    return 1;
 2212|       |
 2213|  2.12M|  if ((bsize == BLOCK_128X128 && mode == NEWMV) ||
  ------------------
  |  Branch (2213:8): [True: 0, False: 2.12M]
  |  Branch (2213:34): [True: 0, False: 0]
  ------------------
 2214|  2.12M|      (skip_nearmv && mode == NEARMV))
  ------------------
  |  Branch (2214:8): [True: 0, False: 2.12M]
  |  Branch (2214:23): [True: 0, False: 0]
  ------------------
 2215|      0|    return 1;
 2216|       |
 2217|       |  // Skip testing non-LAST if this flag is set.
 2218|  2.12M|  if (extra_prune) {
  ------------------
  |  Branch (2218:7): [True: 2.12M, False: 50]
  ------------------
 2219|  2.12M|    if (extra_prune > 1 && ref_frame != LAST_FRAME &&
  ------------------
  |  Branch (2219:9): [True: 1.09M, False: 1.03M]
  |  Branch (2219:28): [True: 0, False: 1.09M]
  ------------------
 2220|      0|        (bsize > BLOCK_16X16 && mode == NEWMV))
  ------------------
  |  Branch (2220:10): [True: 0, False: 0]
  |  Branch (2220:33): [True: 0, False: 0]
  ------------------
 2221|      0|      return 1;
 2222|       |
 2223|  2.12M|    if (ref_frame != LAST_FRAME && mode == NEARMV) return 1;
  ------------------
  |  Branch (2223:9): [True: 0, False: 2.12M]
  |  Branch (2223:36): [True: 0, False: 0]
  ------------------
 2224|       |
 2225|  2.12M|    if (more_prune && bsize >= BLOCK_32X32 && mode == NEARMV) return 1;
  ------------------
  |  Branch (2225:9): [True: 245k, False: 1.87M]
  |  Branch (2225:23): [True: 30.9k, False: 214k]
  |  Branch (2225:47): [True: 9.28k, False: 21.6k]
  ------------------
 2226|  2.12M|  }
 2227|  2.11M|  return 0;
 2228|  2.12M|}
nonrd_pickmode.c:skip_mode_by_low_temp:
 2188|  2.11M|    CONTENT_STATE_SB content_state_sb, int_mv mv, int force_skip_low_temp_var) {
 2189|       |  // Skip non-zeromv mode search for non-LAST frame if force_skip_low_temp_var
 2190|       |  // is set. If nearestmv for golden frame is 0, zeromv mode will be skipped
 2191|       |  // later.
 2192|  2.11M|  if (force_skip_low_temp_var && ref_frame != LAST_FRAME && mv.as_int != 0) {
  ------------------
  |  Branch (2192:7): [True: 194, False: 2.11M]
  |  Branch (2192:34): [True: 0, False: 194]
  |  Branch (2192:61): [True: 0, False: 0]
  ------------------
 2193|      0|    return 1;
 2194|      0|  }
 2195|       |
 2196|  2.11M|  if (content_state_sb.source_sad_nonrd != kHighSad && bsize >= BLOCK_64X64 &&
  ------------------
  |  Branch (2196:7): [True: 1.13M, False: 975k]
  |  Branch (2196:56): [True: 0, False: 1.13M]
  ------------------
 2197|      0|      force_skip_low_temp_var && mode == NEWMV) {
  ------------------
  |  Branch (2197:7): [True: 0, False: 0]
  |  Branch (2197:34): [True: 0, False: 0]
  ------------------
 2198|      0|    return 1;
 2199|      0|  }
 2200|  2.11M|  return 0;
 2201|  2.11M|}
nonrd_pickmode.c:skip_mode_by_threshold:
 2164|  2.11M|                                         int extra_shift) {
 2165|  2.11M|  int skip_this_mode = 0;
 2166|  2.11M|  const THR_MODES mode_index = mode_idx[ref_frame][INTER_OFFSET(mode)];
  ------------------
  |  |   28|  2.11M|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 2167|  2.11M|  int64_t mode_rd_thresh =
 2168|  2.11M|      best_skip ? ((int64_t)rd_threshes[mode_index]) << (extra_shift + 1)
  ------------------
  |  Branch (2168:7): [True: 6.17k, False: 2.10M]
  ------------------
 2169|  2.11M|                : ((int64_t)rd_threshes[mode_index]) << extra_shift;
 2170|       |
 2171|       |  // Increase mode_rd_thresh value for non-LAST for improved encoding
 2172|       |  // speed
 2173|  2.11M|  if (ref_frame != LAST_FRAME) {
  ------------------
  |  Branch (2173:7): [True: 0, False: 2.11M]
  ------------------
 2174|      0|    mode_rd_thresh = mode_rd_thresh << 1;
 2175|      0|    if (ref_frame == GOLDEN_FRAME && frames_since_golden > 4)
  ------------------
  |  Branch (2175:9): [True: 0, False: 0]
  |  Branch (2175:38): [True: 0, False: 0]
  ------------------
 2176|      0|      mode_rd_thresh = mode_rd_thresh << (extra_shift + 1);
 2177|      0|  }
 2178|       |
 2179|  2.11M|  if (rd_less_than_thresh(best_cost, mode_rd_thresh,
  ------------------
  |  Branch (2179:7): [True: 226, False: 2.11M]
  ------------------
 2180|  2.11M|                          rd_thresh_freq_fact[mode_index]))
 2181|    226|    if (mv.as_int != 0) skip_this_mode = 1;
  ------------------
  |  Branch (2181:9): [True: 89, False: 137]
  ------------------
 2182|       |
 2183|  2.11M|  return skip_this_mode;
 2184|  2.11M|}
nonrd_pickmode.c:handle_inter_mode_nonrd:
 2909|  2.11M|    int *sb_me_has_been_tested) {
 2910|  2.11M|  AV1_COMMON *const cm = &cpi->common;
 2911|  2.11M|  MACROBLOCKD *const xd = &x->e_mbd;
 2912|  2.11M|  MB_MODE_INFO *const mi = xd->mi[0];
 2913|  2.11M|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 2914|  2.11M|  const int mi_row = xd->mi_row;
 2915|  2.11M|  const int mi_col = xd->mi_col;
 2916|  2.11M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  2.11M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2917|  2.11M|  const int bw = block_size_wide[bsize];
 2918|  2.11M|  const InterpFilter filter_ref = cm->features.interp_filter;
 2919|  2.11M|  const InterpFilter default_interp_filter = EIGHTTAP_REGULAR;
 2920|  2.11M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 2921|  2.11M|  const ModeCosts *mode_costs = &x->mode_costs;
 2922|  2.11M|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
 2923|  2.11M|  BEST_PICKMODE *const best_pickmode = &search_state->best_pickmode;
 2924|       |
 2925|  2.11M|  MV_REFERENCE_FRAME ref_frame = mi->ref_frame[0];
 2926|  2.11M|  MV_REFERENCE_FRAME ref_frame2 = mi->ref_frame[1];
 2927|  2.11M|  int_mv *const this_mv = &search_state->frame_mv[this_mode][ref_frame];
 2928|  2.11M|  unsigned int var = UINT_MAX;
 2929|  2.11M|  int this_early_term = 0;
 2930|  2.11M|  int rate_mv = 0;
 2931|  2.11M|  int is_skippable;
 2932|  2.11M|  int skip_this_mv = 0;
 2933|  2.11M|  unsigned int var_threshold = UINT_MAX;
 2934|  2.11M|  PREDICTION_MODE this_best_mode;
 2935|  2.11M|  RD_STATS nonskip_rdc;
 2936|  2.11M|  av1_invalid_rd_stats(&nonskip_rdc);
 2937|       |
 2938|  2.11M|  (void)ctx;
 2939|       |
 2940|  2.11M|  if (x->sb_me_block && this_mode == NEWMV && ref_frame == LAST_FRAME) {
  ------------------
  |  Branch (2940:7): [True: 0, False: 2.11M]
  |  Branch (2940:25): [True: 0, False: 0]
  |  Branch (2940:47): [True: 0, False: 0]
  ------------------
 2941|       |    // Set the NEWMV_LAST to the sb MV.
 2942|      0|    search_state->frame_mv[NEWMV][LAST_FRAME].as_int = x->sb_me_mv.as_int;
 2943|  2.11M|  } else if (this_mode == NEWMV && !force_mv_inter_layer) {
  ------------------
  |  Branch (2943:14): [True: 598k, False: 1.52M]
  |  Branch (2943:36): [True: 598k, False: 18.4E]
  ------------------
 2944|       |#if COLLECT_NONRD_PICK_MODE_STAT
 2945|       |    aom_usec_timer_start(&x->ms_stat_nonrd.timer2);
 2946|       |#endif
 2947|       |    // Find the best motion vector for single/compound mode.
 2948|   598k|    const bool skip_newmv = search_new_mv(
 2949|   598k|        cpi, x, search_state->frame_mv, ref_frame, gf_temporal_ref, bsize,
 2950|   598k|        mi_row, mi_col, &rate_mv, &search_state->best_rdc);
 2951|       |#if COLLECT_NONRD_PICK_MODE_STAT
 2952|       |    aom_usec_timer_mark(&x->ms_stat_nonrd.timer2);
 2953|       |    x->ms_stat_nonrd.ms_time[bsize][this_mode] +=
 2954|       |        aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer2);
 2955|       |#endif
 2956|       |    // Skip NEWMV mode,
 2957|       |    //   (i). For bsize smaller than 16X16
 2958|       |    //  (ii). Based on sad of the predicted mv w.r.t LAST_FRAME
 2959|       |    // (iii). When motion vector is same as that of reference mv
 2960|   598k|    if (skip_newmv) {
  ------------------
  |  Branch (2960:9): [True: 17.4k, False: 581k]
  ------------------
 2961|  17.4k|      return true;
 2962|  17.4k|    }
 2963|   598k|  }
 2964|       |
 2965|       |  // Check the current motion vector is same as that of previously evaluated
 2966|       |  // motion vectors.
 2967|  10.1M|  for (PREDICTION_MODE inter_mv_mode = NEARESTMV; inter_mv_mode <= NEWMV;
  ------------------
  |  Branch (2967:51): [True: 8.11M, False: 2.00M]
  ------------------
 2968|  8.11M|       inter_mv_mode++) {
 2969|  8.11M|    if (inter_mv_mode == this_mode) continue;
  ------------------
  |  Branch (2969:9): [True: 2.00M, False: 6.10M]
  ------------------
 2970|  6.10M|    if (is_single_pred &&
  ------------------
  |  Branch (2970:9): [True: 6.11M, False: 18.4E]
  ------------------
 2971|  6.11M|        search_state->mode_checked[inter_mv_mode][ref_frame] &&
  ------------------
  |  Branch (2971:9): [True: 2.58M, False: 3.53M]
  ------------------
 2972|  2.58M|        this_mv->as_int ==
  ------------------
  |  Branch (2972:9): [True: 99.2k, False: 2.48M]
  ------------------
 2973|  2.58M|            search_state->frame_mv[inter_mv_mode][ref_frame].as_int) {
 2974|  99.2k|      skip_this_mv = 1;
 2975|  99.2k|      break;
 2976|  99.2k|    }
 2977|  6.10M|  }
 2978|       |
 2979|       |  // Skip single mode if current motion vector is same that of previously
 2980|       |  // evaluated motion vectors.
 2981|  2.10M|  if (skip_this_mv && is_single_pred) return true;
  ------------------
  |  Branch (2981:7): [True: 99.2k, False: 2.00M]
  |  Branch (2981:23): [True: 99.2k, False: 3]
  ------------------
 2982|       |
 2983|       |  // For screen: for spatially flat blocks with non-zero motion,
 2984|       |  // skip newmv if the motion vector is (0, 0)-LAST, and color is not set.
 2985|  2.00M|  if (this_mode == NEWMV && cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (2985:7): [True: 580k, False: 1.42M]
  |  Branch (2985:29): [True: 0, False: 580k]
  ------------------
 2986|      0|      cpi->svc.spatial_layer_id == 0 && rt_sf->source_metrics_sb_nonrd) {
  ------------------
  |  Branch (2986:7): [True: 0, False: 0]
  |  Branch (2986:41): [True: 0, False: 0]
  ------------------
 2987|      0|    if (this_mv->as_int == 0 && ref_frame == LAST_FRAME &&
  ------------------
  |  Branch (2987:9): [True: 0, False: 0]
  |  Branch (2987:33): [True: 0, False: 0]
  ------------------
 2988|      0|        x->block_is_zero_sad == 0 &&
  ------------------
  |  Branch (2988:9): [True: 0, False: 0]
  ------------------
 2989|      0|        ((x->color_sensitivity_sb[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2989:11): [True: 0, False: 0]
  ------------------
 2990|      0|          x->color_sensitivity_sb[COLOR_SENS_IDX(AOM_PLANE_V)] == 0) ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2990:11): [True: 0, False: 0]
  ------------------
 2991|      0|         cpi->rc.high_source_sad) &&
  ------------------
  |  Branch (2991:10): [True: 0, False: 0]
  ------------------
 2992|      0|        x->source_variance == 0)
  ------------------
  |  Branch (2992:9): [True: 0, False: 0]
  ------------------
 2993|      0|      return true;
 2994|      0|  }
 2995|       |
 2996|  2.00M|  mi->mode = this_mode;
 2997|  2.00M|  mi->mv[0].as_int = this_mv->as_int;
 2998|  2.00M|  mi->mv[1].as_int = 0;
 2999|  2.00M|  if (!is_single_pred)
  ------------------
  |  Branch (2999:7): [True: 0, False: 2.00M]
  ------------------
 3000|      0|    mi->mv[1].as_int = search_state->frame_mv[this_mode][ref_frame2].as_int;
 3001|       |
 3002|       |  // Set buffers to store predicted samples for reuse
 3003|  2.00M|  if (reuse_inter_pred) {
  ------------------
  |  Branch (3003:7): [True: 0, False: 2.00M]
  ------------------
 3004|      0|    if (!*this_mode_pred) {
  ------------------
  |  Branch (3004:9): [True: 0, False: 0]
  ------------------
 3005|      0|      *this_mode_pred = &tmp_buffer[3];
 3006|      0|    } else {
 3007|      0|      *this_mode_pred = &tmp_buffer[get_pred_buffer(tmp_buffer, 3)];
 3008|      0|      pd->dst.buf = (*this_mode_pred)->data;
 3009|      0|      pd->dst.stride = bw;
 3010|      0|    }
 3011|      0|  }
 3012|       |
 3013|  2.00M|  mi->motion_mode = SIMPLE_TRANSLATION;
 3014|  2.00M|#if !CONFIG_REALTIME_ONLY
 3015|  2.00M|  if (cpi->oxcf.motion_mode_cfg.allow_warped_motion) {
  ------------------
  |  Branch (3015:7): [True: 2.00M, False: 18.4E]
  ------------------
 3016|  2.00M|    calc_num_proj_ref(cpi, x, mi);
 3017|  2.00M|  }
 3018|  2.00M|#endif
 3019|       |  // set variance threshold for compound mode pruning
 3020|  2.00M|  if (rt_sf->prune_compoundmode_with_singlecompound_var && !is_single_pred &&
  ------------------
  |  Branch (3020:7): [True: 2.00M, False: 18.4E]
  |  Branch (3020:60): [True: 0, False: 2.00M]
  ------------------
 3021|      0|      use_model_yrd_large) {
  ------------------
  |  Branch (3021:7): [True: 0, False: 0]
  ------------------
 3022|      0|    const PREDICTION_MODE single_mode0 = compound_ref0_mode(this_mode);
 3023|      0|    const PREDICTION_MODE single_mode1 = compound_ref1_mode(this_mode);
 3024|      0|    var_threshold =
 3025|      0|        AOMMIN(var_threshold,
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3026|      0|               search_state->vars[INTER_OFFSET(single_mode0)][ref_frame]);
 3027|      0|    var_threshold =
 3028|      0|        AOMMIN(var_threshold,
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3029|      0|               search_state->vars[INTER_OFFSET(single_mode1)][ref_frame2]);
 3030|      0|  }
 3031|       |
 3032|       |  // decide interpolation filter, build prediction signal, get sse
 3033|  2.00M|  const bool is_mv_subpel =
 3034|  2.00M|      (mi->mv[0].as_mv.row & 0x07) || (mi->mv[0].as_mv.col & 0x07);
  ------------------
  |  Branch (3034:7): [True: 1.25M, False: 750k]
  |  Branch (3034:39): [True: 110k, False: 640k]
  ------------------
 3035|  2.00M|  const bool enable_filt_search_this_mode =
 3036|  2.00M|      (filter_search_enabled_blk == 2)
  ------------------
  |  Branch (3036:7): [True: 0, False: 2.00M]
  ------------------
 3037|  2.00M|          ? true
 3038|  2.00M|          : (filter_search_enabled_blk && !force_mv_inter_layer &&
  ------------------
  |  Branch (3038:14): [True: 2.00M, False: 18.4E]
  |  Branch (3038:43): [True: 2.00M, False: 18.4E]
  ------------------
 3039|  2.00M|             is_single_pred &&
  ------------------
  |  Branch (3039:14): [True: 2.00M, False: 18.4E]
  ------------------
 3040|  2.00M|             (ref_frame == LAST_FRAME || !x->nonrd_prune_ref_frame_search));
  ------------------
  |  Branch (3040:15): [True: 2.00M, False: 0]
  |  Branch (3040:42): [True: 0, False: 0]
  ------------------
 3041|  2.00M|  if (is_mv_subpel && enable_filt_search_this_mode) {
  ------------------
  |  Branch (3041:7): [True: 1.37M, False: 628k]
  |  Branch (3041:23): [True: 1.37M, False: 18.4E]
  ------------------
 3042|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3043|       |    aom_usec_timer_start(&x->ms_stat_nonrd.timer2);
 3044|       |#endif
 3045|  1.37M|    search_filter_ref(
 3046|  1.37M|        cpi, x, &search_state->this_rdc, &inter_pred_params_sr, mi_row, mi_col,
 3047|  1.37M|        tmp_buffer, bsize, reuse_inter_pred, this_mode_pred, &this_early_term,
 3048|  1.37M|        &var, use_model_yrd_large, best_pickmode->best_sse, is_single_pred);
 3049|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3050|       |    aom_usec_timer_mark(&x->ms_stat_nonrd.timer2);
 3051|       |    x->ms_stat_nonrd.ifs_time[bsize][this_mode] +=
 3052|       |        aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer2);
 3053|       |#endif
 3054|  1.37M|#if !CONFIG_REALTIME_ONLY
 3055|  1.37M|  } else if (cpi->oxcf.motion_mode_cfg.allow_warped_motion &&
  ------------------
  |  Branch (3055:14): [True: 640k, False: 18.4E]
  ------------------
 3056|   640k|             this_mode == NEWMV) {
  ------------------
  |  Branch (3056:14): [True: 13.4k, False: 627k]
  ------------------
 3057|       |    // Find the best motion mode when current mode is NEWMV
 3058|  13.4k|    search_motion_mode(cpi, x, &search_state->this_rdc, mi_row, mi_col, bsize,
 3059|  13.4k|                       &this_early_term, use_model_yrd_large, &rate_mv,
 3060|  13.4k|                       best_pickmode->best_sse);
 3061|  13.4k|    if (this_mode == NEWMV) {
  ------------------
  |  Branch (3061:9): [True: 13.4k, False: 1]
  ------------------
 3062|  13.4k|      this_mv[0] = mi->mv[0];
 3063|  13.4k|    }
 3064|  13.4k|#endif
 3065|   614k|  } else {
 3066|   614k|    mi->interp_filters =
 3067|   614k|        (filter_ref == SWITCHABLE)
  ------------------
  |  Branch (3067:9): [True: 627k, False: 18.4E]
  ------------------
 3068|   627k|            ? av1_broadcast_interp_filter(default_interp_filter)
 3069|  18.4E|            : av1_broadcast_interp_filter(filter_ref);
 3070|   614k|    if (force_mv_inter_layer)
  ------------------
  |  Branch (3070:9): [True: 0, False: 614k]
  ------------------
 3071|      0|      mi->interp_filters = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
 3072|       |
 3073|       |    // If it is sub-pel motion and cb_pred_filter_search is enabled, select
 3074|       |    // the pre-decided filter
 3075|   614k|    if (is_mv_subpel && cb_pred_filter_search)
  ------------------
  |  Branch (3075:9): [True: 0, False: 614k]
  |  Branch (3075:25): [True: 0, False: 0]
  ------------------
 3076|      0|      mi->interp_filters = av1_broadcast_interp_filter(filt_select);
 3077|       |
 3078|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3079|       |    aom_usec_timer_start(&x->ms_stat_nonrd.timer2);
 3080|       |#endif
 3081|   626k|    if (is_single_pred) {
  ------------------
  |  Branch (3081:9): [True: 626k, False: 18.4E]
  ------------------
 3082|   626k|      SubpelParams subpel_params;
 3083|       |      // Initialize inter mode level params for single reference mode.
 3084|   626k|      init_inter_mode_params(&mi->mv[0].as_mv, &inter_pred_params_sr,
 3085|   626k|                             &subpel_params, xd->block_ref_scale_factors[0],
 3086|   626k|                             pd->pre->width, pd->pre->height);
 3087|   626k|      av1_enc_build_inter_predictor_y_nonrd(xd, &inter_pred_params_sr,
 3088|   626k|                                            &subpel_params);
 3089|  18.4E|    } else {
 3090|  18.4E|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3091|  18.4E|                                    AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  18.4E|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  18.4E|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 3092|  18.4E|    }
 3093|       |
 3094|   614k|    if (use_model_yrd_large) {
  ------------------
  |  Branch (3094:9): [True: 18.1k, False: 596k]
  ------------------
 3095|  18.1k|      model_skip_for_sb_y_large(cpi, bsize, mi_row, mi_col, x, xd,
 3096|  18.1k|                                &search_state->this_rdc, &this_early_term, 0,
 3097|  18.1k|                                best_pickmode->best_sse, &var, var_threshold);
 3098|   596k|    } else {
 3099|   596k|      model_rd_for_sb_y(cpi, bsize, x, xd, &search_state->this_rdc, &var, 0,
 3100|   596k|                        &this_early_term);
 3101|   596k|    }
 3102|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3103|       |    aom_usec_timer_mark(&x->ms_stat_nonrd.timer2);
 3104|       |    x->ms_stat_nonrd.model_rd_time[bsize][this_mode] +=
 3105|       |        aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer2);
 3106|       |#endif
 3107|   614k|  }
 3108|       |
 3109|       |  // update variance for single mode
 3110|  2.01M|  if (is_single_pred) {
  ------------------
  |  Branch (3110:7): [True: 2.01M, False: 18.4E]
  ------------------
 3111|  2.01M|    search_state->vars[INTER_OFFSET(this_mode)][ref_frame] = var;
  ------------------
  |  |   28|  2.01M|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 3112|  2.01M|    if (this_mv->as_int == 0) {
  ------------------
  |  Branch (3112:9): [True: 610k, False: 1.40M]
  ------------------
 3113|   610k|      search_state->vars[INTER_OFFSET(GLOBALMV)][ref_frame] = var;
  ------------------
  |  |   28|   610k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 3114|   610k|    }
 3115|  2.01M|  }
 3116|       |  // prune compound mode based on single mode var threshold
 3117|  2.00M|  if (!is_single_pred && var > var_threshold) {
  ------------------
  |  Branch (3117:7): [True: 0, False: 2.00M]
  |  Branch (3117:26): [True: 0, False: 0]
  ------------------
 3118|      0|    if (reuse_inter_pred) free_pred_buffer(*this_mode_pred);
  ------------------
  |  Branch (3118:9): [True: 0, False: 0]
  ------------------
 3119|      0|    return true;
 3120|      0|  }
 3121|       |
 3122|  2.01M|  if (ref_frame == LAST_FRAME && this_mv->as_int == 0) {
  ------------------
  |  Branch (3122:7): [True: 2.01M, False: 18.4E]
  |  Branch (3122:34): [True: 610k, False: 1.40M]
  ------------------
 3123|   610k|    *sse_zeromv_norm = (unsigned int)(search_state->this_rdc.sse >>
 3124|   610k|                                      (b_width_log2_lookup[bsize] +
 3125|   610k|                                       b_height_log2_lookup[bsize]));
 3126|   610k|  }
 3127|       |
 3128|       |  // Perform early termination based on sse.
 3129|  2.00M|  if (rt_sf->sse_early_term_inter_search &&
  ------------------
  |  Branch (3129:7): [True: 2.01M, False: 18.4E]
  ------------------
 3130|  2.01M|      early_term_inter_search_with_sse(rt_sf->sse_early_term_inter_search,
  ------------------
  |  Branch (3130:7): [True: 95.3k, False: 1.91M]
  ------------------
 3131|  2.01M|                                       bsize, search_state->this_rdc.sse,
 3132|  2.01M|                                       best_pickmode->best_sse, this_mode)) {
 3133|  95.3k|    if (reuse_inter_pred) free_pred_buffer(*this_mode_pred);
  ------------------
  |  Branch (3133:9): [True: 0, False: 95.3k]
  ------------------
 3134|  95.3k|    return true;
 3135|  95.3k|  }
 3136|       |
 3137|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3138|       |  x->ms_stat_nonrd.num_nonskipped_searches[bsize][this_mode]++;
 3139|       |#endif
 3140|       |
 3141|  1.90M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 3142|  1.90M|  const int skip_txfm_cost = mode_costs->skip_txfm_cost[skip_ctx][1];
 3143|  1.90M|  const int no_skip_txfm_cost = mode_costs->skip_txfm_cost[skip_ctx][0];
 3144|  1.90M|  const int64_t sse_y = search_state->this_rdc.sse;
 3145|       |
 3146|  1.90M|  if (this_early_term) {
  ------------------
  |  Branch (3146:7): [True: 84, False: 1.90M]
  ------------------
 3147|     84|    search_state->this_rdc.skip_txfm = 1;
 3148|     84|    search_state->this_rdc.rate = skip_txfm_cost;
 3149|     84|    search_state->this_rdc.dist = search_state->this_rdc.sse << 4;
 3150|  1.90M|  } else {
 3151|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3152|       |    aom_usec_timer_start(&x->ms_stat_nonrd.timer2);
 3153|       |#endif
 3154|       |    // Calculates RD Cost using Hadamard transform.
 3155|  1.90M|    av1_block_yrd(x, &search_state->this_rdc, &is_skippable, bsize,
 3156|  1.90M|                  mi->tx_size);
 3157|  1.90M|    if (search_state->this_rdc.skip_txfm ||
  ------------------
  |  Branch (3157:9): [True: 18.4E, False: 1.91M]
  ------------------
 3158|  1.91M|        RDCOST(x->rdmult, search_state->this_rdc.rate,
  ------------------
  |  |   33|  1.91M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.91M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.91M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.91M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (3158:9): [True: 4.81k, False: 1.91M]
  ------------------
 3159|  1.91M|               search_state->this_rdc.dist) >=
 3160|  1.91M|            RDCOST(x->rdmult, 0, search_state->this_rdc.sse)) {
  ------------------
  |  |   33|  1.91M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.91M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.91M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.91M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3161|  6.68k|      if (!search_state->this_rdc.skip_txfm) {
  ------------------
  |  Branch (3161:11): [True: 5.25k, False: 1.43k]
  ------------------
 3162|       |        // Need to store "real" rdc for possible future use if UV rdc
 3163|       |        // disallows tx skip
 3164|  5.25k|        nonskip_rdc = search_state->this_rdc;
 3165|  5.25k|        nonskip_rdc.rate += no_skip_txfm_cost;
 3166|  5.25k|      }
 3167|  6.68k|      search_state->this_rdc.rate = skip_txfm_cost;
 3168|  6.68k|      search_state->this_rdc.skip_txfm = 1;
 3169|  6.68k|      search_state->this_rdc.dist = search_state->this_rdc.sse;
 3170|  1.89M|    } else {
 3171|  1.89M|      search_state->this_rdc.rate += no_skip_txfm_cost;
 3172|  1.89M|    }
 3173|       |
 3174|       |    // Populate predicted sample for chroma planes based on color sensitivity.
 3175|  1.90M|    if ((x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|  1.90M|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3175:10): [True: 575k, False: 1.33M]
  ------------------
 3176|  1.33M|         x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)])) {
  ------------------
  |  |   50|  1.33M|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3176:10): [True: 2.56k, False: 1.32M]
  ------------------
 3177|   590k|      RD_STATS rdc_uv;
 3178|   590k|      const BLOCK_SIZE uv_bsize =
 3179|   590k|          get_plane_block_size(bsize, xd->plane[AOM_PLANE_U].subsampling_x,
  ------------------
  |  |  282|   590k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3180|   590k|                               xd->plane[AOM_PLANE_U].subsampling_y);
  ------------------
  |  |  282|   590k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3181|   590k|      if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)]) {
  ------------------
  |  |   50|   590k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3181:11): [True: 587k, False: 2.98k]
  ------------------
 3182|   587k|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3183|   587k|                                      AOM_PLANE_U, AOM_PLANE_U);
  ------------------
  |  |  282|   587k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                                                    AOM_PLANE_U, AOM_PLANE_U);
  ------------------
  |  |  282|   587k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3184|   587k|      }
 3185|   590k|      if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]) {
  ------------------
  |  |   50|   590k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3185:11): [True: 586k, False: 3.82k]
  ------------------
 3186|   586k|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3187|   586k|                                      AOM_PLANE_V, AOM_PLANE_V);
  ------------------
  |  |  283|   586k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
                                                    AOM_PLANE_V, AOM_PLANE_V);
  ------------------
  |  |  283|   586k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 3188|   586k|      }
 3189|       |      // Compute sse for chroma planes.
 3190|   590k|      const int64_t sse_uv = av1_model_rd_for_sb_uv(
 3191|   590k|          cpi, uv_bsize, x, xd, &rdc_uv, AOM_PLANE_U, AOM_PLANE_V);
  ------------------
  |  |  282|   590k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                        cpi, uv_bsize, x, xd, &rdc_uv, AOM_PLANE_U, AOM_PLANE_V);
  ------------------
  |  |  283|   590k|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 3192|   590k|      if (rdc_uv.dist < x->min_dist_inter_uv)
  ------------------
  |  Branch (3192:11): [True: 333k, False: 256k]
  ------------------
 3193|   333k|        x->min_dist_inter_uv = rdc_uv.dist;
 3194|   590k|      search_state->this_rdc.sse += sse_uv;
 3195|       |      // Restore Y rdc if UV rdc disallows txfm skip
 3196|   590k|      if (search_state->this_rdc.skip_txfm && !rdc_uv.skip_txfm &&
  ------------------
  |  Branch (3196:11): [True: 817, False: 589k]
  |  Branch (3196:47): [True: 363, False: 454]
  ------------------
 3197|    363|          nonskip_rdc.rate != INT_MAX)
  ------------------
  |  Branch (3197:11): [True: 225, False: 138]
  ------------------
 3198|    225|        search_state->this_rdc = nonskip_rdc;
 3199|   590k|      if (is_single_pred) {
  ------------------
  |  Branch (3199:11): [True: 588k, False: 1.55k]
  ------------------
 3200|   588k|        search_state->uv_dist[INTER_OFFSET(this_mode)][ref_frame] = rdc_uv.dist;
  ------------------
  |  |   28|   588k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 3201|   588k|      }
 3202|   590k|      search_state->this_rdc.rate += rdc_uv.rate;
 3203|   590k|      search_state->this_rdc.dist += rdc_uv.dist;
 3204|   590k|      search_state->this_rdc.skip_txfm =
 3205|   590k|          search_state->this_rdc.skip_txfm && rdc_uv.skip_txfm;
  ------------------
  |  Branch (3205:11): [True: 592, False: 589k]
  |  Branch (3205:47): [True: 454, False: 138]
  ------------------
 3206|   590k|    }
 3207|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3208|       |    aom_usec_timer_mark(&x->ms_stat_nonrd.timer2);
 3209|       |    x->ms_stat_nonrd.txfm_time[bsize][this_mode] +=
 3210|       |        aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer2);
 3211|       |#endif
 3212|  1.90M|  }
 3213|       |
 3214|  1.90M|  this_best_mode = this_mode;
 3215|       |  // TODO(kyslov) account for UV prediction cost
 3216|  1.90M|  search_state->this_rdc.rate += rate_mv;
 3217|  1.90M|  if (!is_single_pred) {
  ------------------
  |  Branch (3217:7): [True: 0, False: 1.90M]
  ------------------
 3218|      0|    const int16_t mode_ctx =
 3219|      0|        av1_mode_context_analyzer(mbmi_ext->mode_context, mi->ref_frame);
 3220|      0|    search_state->this_rdc.rate += cost_mv_ref(mode_costs, this_mode, mode_ctx);
 3221|  1.90M|  } else {
 3222|       |    // If the current mode has zeromv but is not GLOBALMV, compare the rate
 3223|       |    // cost. If GLOBALMV is cheaper, use GLOBALMV instead.
 3224|  1.90M|    if (this_mode != GLOBALMV &&
  ------------------
  |  Branch (3224:9): [True: 1.64M, False: 258k]
  ------------------
 3225|  1.64M|        this_mv->as_int == search_state->frame_mv[GLOBALMV][ref_frame].as_int) {
  ------------------
  |  Branch (3225:9): [True: 249k, False: 1.39M]
  ------------------
 3226|   249k|      if (is_globalmv_better(this_mode, ref_frame, rate_mv, mode_costs,
  ------------------
  |  Branch (3226:11): [True: 5.60k, False: 243k]
  ------------------
 3227|   249k|                             search_state->single_inter_mode_costs, mbmi_ext)) {
 3228|  5.60k|        this_best_mode = GLOBALMV;
 3229|  5.60k|      }
 3230|   249k|    }
 3231|       |
 3232|  1.90M|    search_state->this_rdc.rate +=
 3233|  1.90M|        search_state
 3234|  1.90M|            ->single_inter_mode_costs[INTER_OFFSET(this_best_mode)][ref_frame];
  ------------------
  |  |   28|  1.90M|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 3235|  1.90M|  }
 3236|       |
 3237|  1.91M|  if (is_single_pred && this_mv->as_int == 0 && var < UINT_MAX) {
  ------------------
  |  Branch (3237:7): [True: 1.91M, False: 18.4E]
  |  Branch (3237:25): [True: 520k, False: 1.39M]
  |  Branch (3237:49): [True: 520k, False: 18.4E]
  ------------------
 3238|   520k|    search_state->vars[INTER_OFFSET(GLOBALMV)][ref_frame] = var;
  ------------------
  |  |   28|   520k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 3239|   520k|  }
 3240|       |
 3241|  1.90M|  search_state->this_rdc.rate += search_state->ref_costs_single[ref_frame];
 3242|       |
 3243|  1.90M|  search_state->this_rdc.rdcost = RDCOST(x->rdmult, search_state->this_rdc.rate,
  ------------------
  |  |   33|  1.90M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.90M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.90M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.90M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3244|  1.90M|                                         search_state->this_rdc.dist);
 3245|  1.91M|  if (cpi->oxcf.rc_cfg.mode == AOM_CBR && is_single_pred) {
  ------------------
  |  Branch (3245:7): [True: 1.91M, False: 18.4E]
  |  Branch (3245:43): [True: 1.91M, False: 18.4E]
  ------------------
 3246|  1.91M|    newmv_diff_bias(xd, this_best_mode, &search_state->this_rdc, bsize,
 3247|  1.91M|                    search_state->frame_mv[this_best_mode][ref_frame].as_mv.row,
 3248|  1.91M|                    search_state->frame_mv[this_best_mode][ref_frame].as_mv.col,
 3249|  1.91M|                    cpi->speed, x->source_variance, x->content_state_sb);
 3250|  1.91M|  }
 3251|       |
 3252|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 3253|       |  if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc_pickmode &&
 3254|       |      cpi->denoiser.denoising_level > kDenLowLow) {
 3255|       |    av1_denoiser_update_frame_stats(mi, sse_y, this_mode, ctx);
 3256|       |    // Keep track of zero_last cost.
 3257|       |    if (ref_frame == LAST_FRAME && this_mv->as_int == 0)
 3258|       |      *zero_last_cost_orig = search_state->this_rdc.rdcost;
 3259|       |  }
 3260|       |#else
 3261|  1.90M|  (void)(sse_y);
 3262|  1.90M|#endif
 3263|       |
 3264|  1.90M|  search_state->mode_checked[this_mode][ref_frame] = 1;
 3265|  1.90M|  search_state->mode_checked[this_best_mode][ref_frame] = 1;
 3266|       |
 3267|  1.90M|  if (*check_globalmv) {
  ------------------
  |  Branch (3267:7): [True: 1.38M, False: 525k]
  ------------------
 3268|  1.38M|    int32_t abs_mv =
 3269|  1.38M|        abs(search_state->frame_mv[this_best_mode][ref_frame].as_mv.row) +
 3270|  1.38M|        abs(search_state->frame_mv[this_best_mode][ref_frame].as_mv.col);
 3271|       |    // Early exit check: if the magnitude of this_best_mode's mv is small
 3272|       |    // enough, we skip GLOBALMV check in the next loop iteration.
 3273|  1.38M|    if (abs_mv < 2) {
  ------------------
  |  Branch (3273:9): [True: 520k, False: 861k]
  ------------------
 3274|   520k|      *check_globalmv = false;
 3275|   520k|    }
 3276|  1.38M|  }
 3277|       |#if COLLECT_NONRD_PICK_MODE_STAT
 3278|       |  aom_usec_timer_mark(&x->ms_stat_nonrd.timer1);
 3279|       |  x->ms_stat_nonrd.nonskipped_search_times[bsize][this_mode] +=
 3280|       |      aom_usec_timer_elapsed(&x->ms_stat_nonrd.timer1);
 3281|       |#endif
 3282|       |
 3283|  1.90M|  if (x->sb_me_block && ref_frame == LAST_FRAME &&
  ------------------
  |  Branch (3283:7): [True: 0, False: 1.90M]
  |  Branch (3283:25): [True: 0, False: 0]
  ------------------
 3284|      0|      search_state->frame_mv[this_best_mode][ref_frame].as_int ==
  ------------------
  |  Branch (3284:7): [True: 0, False: 0]
  ------------------
 3285|      0|          x->sb_me_mv.as_int)
 3286|      0|    *sb_me_has_been_tested = 1;
 3287|       |
 3288|       |  // Copy best mode params to search state
 3289|  1.90M|  if (search_state->this_rdc.rdcost < search_state->best_rdc.rdcost) {
  ------------------
  |  Branch (3289:7): [True: 1.19M, False: 708k]
  ------------------
 3290|  1.19M|    search_state->best_rdc = search_state->this_rdc;
 3291|  1.19M|    *best_early_term = this_early_term;
 3292|  1.19M|    update_search_state_nonrd(search_state, mi, txfm_info, &nonskip_rdc,
 3293|  1.19M|                              this_best_mode, sse_y);
 3294|       |
 3295|       |    // This is needed for the compound modes.
 3296|  1.19M|    search_state->frame_mv_best[this_best_mode][ref_frame].as_int =
 3297|  1.19M|        search_state->frame_mv[this_best_mode][ref_frame].as_int;
 3298|  1.19M|    if (ref_frame2 > NONE_FRAME) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 1.19M]
  ------------------
 3299|      0|      search_state->frame_mv_best[this_best_mode][ref_frame2].as_int =
 3300|      0|          search_state->frame_mv[this_best_mode][ref_frame2].as_int;
 3301|      0|    }
 3302|       |
 3303|  1.19M|    if (reuse_inter_pred) {
  ------------------
  |  Branch (3303:9): [True: 0, False: 1.19M]
  ------------------
 3304|      0|      free_pred_buffer(best_pickmode->best_pred);
 3305|      0|      best_pickmode->best_pred = *this_mode_pred;
 3306|      0|    }
 3307|  1.19M|  } else {
 3308|   708k|    if (reuse_inter_pred) free_pred_buffer(*this_mode_pred);
  ------------------
  |  Branch (3308:9): [True: 0, False: 708k]
  ------------------
 3309|   708k|  }
 3310|       |
 3311|  1.90M|  if (*best_early_term && (idx > 0 || rt_sf->nonrd_aggressive_skip)) {
  ------------------
  |  Branch (3311:7): [True: 81, False: 1.90M]
  |  Branch (3311:28): [True: 15, False: 66]
  |  Branch (3311:39): [True: 34, False: 32]
  ------------------
 3312|     49|    txfm_info->skip_txfm = 1;
 3313|     49|    if (!x->sb_me_block || *sb_me_has_been_tested) return false;
  ------------------
  |  Branch (3313:9): [True: 49, False: 0]
  |  Branch (3313:28): [True: 0, False: 0]
  ------------------
 3314|     49|  }
 3315|  1.90M|  return true;
 3316|  1.90M|}
nonrd_pickmode.c:search_new_mv:
  318|   598k|                         RD_STATS *best_rdc) {
  319|   598k|  MACROBLOCKD *const xd = &x->e_mbd;
  320|   598k|  MB_MODE_INFO *const mi = xd->mi[0];
  321|   598k|  AV1_COMMON *cm = &cpi->common;
  322|   598k|  int_mv *this_ref_frm_newmv = &frame_mv[NEWMV][ref_frame];
  323|   598k|  unsigned int y_sad_zero;
  324|   598k|  if (ref_frame > LAST_FRAME && cpi->oxcf.rc_cfg.mode == AOM_CBR &&
  ------------------
  |  Branch (324:7): [True: 0, False: 598k]
  |  Branch (324:33): [True: 0, False: 0]
  ------------------
  325|      0|      (cpi->ref_frame_flags & AOM_LAST_FLAG) && gf_temporal_ref &&
  ------------------
  |  Branch (325:7): [True: 0, False: 0]
  |  Branch (325:49): [True: 0, False: 0]
  ------------------
  326|      0|      !is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (326:7): [True: 0, False: 0]
  ------------------
  327|      0|    int tmp_sad;
  328|      0|    int dis;
  329|       |
  330|      0|    if (bsize < BLOCK_16X16) return -1;
  ------------------
  |  Branch (330:9): [True: 0, False: 0]
  ------------------
  331|       |
  332|      0|    int me_search_size_col = block_size_wide[bsize] >> 1;
  333|      0|    int me_search_size_row = block_size_high[bsize] >> 1;
  334|      0|    MV ref_mv = av1_get_ref_mv(x, 0).as_mv;
  335|      0|    tmp_sad = av1_int_pro_motion_estimation(
  336|      0|        cpi, x, bsize, mi_row, mi_col, &ref_mv, &y_sad_zero, me_search_size_col,
  337|      0|        me_search_size_row, 0, 0);
  338|       |
  339|      0|    if (tmp_sad > x->pred_mv_sad[LAST_FRAME]) return -1;
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|       |
  341|      0|    this_ref_frm_newmv->as_int = mi->mv[0].as_int;
  342|      0|    int_mv best_mv = mi->mv[0];
  343|      0|    best_mv.as_mv.row >>= 3;
  344|      0|    best_mv.as_mv.col >>= 3;
  345|      0|    this_ref_frm_newmv->as_mv.row >>= 3;
  346|      0|    this_ref_frm_newmv->as_mv.col >>= 3;
  347|       |
  348|      0|    SUBPEL_MOTION_SEARCH_PARAMS ms_params;
  349|      0|    av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize, &ref_mv, NULL);
  350|      0|    if (cpi->sf.rt_sf.reduce_mv_pel_precision_highmotion ||
  ------------------
  |  Branch (350:9): [True: 0, False: 0]
  ------------------
  351|      0|        cpi->sf.rt_sf.reduce_mv_pel_precision_lowcomplex) {
  ------------------
  |  Branch (351:9): [True: 0, False: 0]
  ------------------
  352|      0|      FULLPEL_MV start_mv = { .row = 0, .col = 0 };
  353|      0|      ms_params.forced_stop =
  354|      0|          subpel_select(cpi, x, bsize, &best_mv, ref_mv, start_mv, false);
  355|      0|    }
  356|      0|    MV start_mv = get_mv_from_fullmv(&best_mv.as_fullmv);
  357|      0|    assert(av1_is_subpelmv_in_range(&ms_params.mv_limits, start_mv));
  358|      0|    cpi->mv_search_params.find_fractional_mv_step(
  359|      0|        xd, cm, &ms_params, start_mv, NULL, &best_mv.as_mv, &dis,
  360|      0|        &x->pred_sse[ref_frame], NULL);
  361|      0|    this_ref_frm_newmv->as_int = best_mv.as_int;
  362|       |
  363|       |    // When NEWMV is same as ref_mv from the drl, it is preferred to code the
  364|       |    // MV as NEARESTMV or NEARMV. In this case, NEWMV needs to be skipped to
  365|       |    // avoid an assert failure at a later stage. The scenario can occur if
  366|       |    // NEARESTMV was not evaluated for ALTREF.
  367|      0|    if (this_ref_frm_newmv->as_mv.col == ref_mv.col &&
  ------------------
  |  Branch (367:9): [True: 0, False: 0]
  ------------------
  368|      0|        this_ref_frm_newmv->as_mv.row == ref_mv.row)
  ------------------
  |  Branch (368:9): [True: 0, False: 0]
  ------------------
  369|      0|      return -1;
  370|       |
  371|      0|    *rate_mv = av1_mv_bit_cost(&this_ref_frm_newmv->as_mv, &ref_mv,
  372|      0|                               x->mv_costs->nmv_joint_cost,
  373|      0|                               x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
  374|   598k|  } else if (!combined_motion_search(cpi, x, bsize, &frame_mv[NEWMV][ref_frame],
  ------------------
  |  Branch (374:14): [True: 17.4k, False: 581k]
  ------------------
  375|   598k|                                     rate_mv, best_rdc->rdcost, 0)) {
  376|  17.4k|    return -1;
  377|  17.4k|  }
  378|       |
  379|   581k|  return 0;
  380|   598k|}
nonrd_pickmode.c:combined_motion_search:
  196|   598k|                                  int use_base_mv) {
  197|   598k|  MACROBLOCKD *xd = &x->e_mbd;
  198|   598k|  const AV1_COMMON *cm = &cpi->common;
  199|   598k|  const SPEED_FEATURES *sf = &cpi->sf;
  200|   598k|  MB_MODE_INFO *mi = xd->mi[0];
  201|   598k|  int step_param = (sf->rt_sf.fullpel_search_step_param)
  ------------------
  |  Branch (201:20): [True: 0, False: 598k]
  ------------------
  202|   598k|                       ? sf->rt_sf.fullpel_search_step_param
  203|   598k|                       : cpi->mv_search_params.mv_step_param;
  204|   598k|  FULLPEL_MV start_mv;
  205|   598k|  const int ref = mi->ref_frame[0];
  206|   598k|  const MV ref_mv = av1_get_ref_mv(x, mi->ref_mv_idx).as_mv;
  207|   598k|  MV center_mv;
  208|   598k|  int dis;
  209|   598k|  int rv = 0;
  210|   598k|  int cost_list[5];
  211|   598k|  int search_subpel = 1;
  212|       |
  213|   598k|  if (av1_is_scaled(get_ref_scale_factors_const(cm, ref))) {
  ------------------
  |  Branch (213:7): [True: 531k, False: 67.3k]
  ------------------
  214|   531k|    const YV12_BUFFER_CONFIG *scaled_ref = av1_get_scaled_ref_frame(cpi, ref);
  215|   531k|    (void)scaled_ref;
  216|   531k|    assert(scaled_ref != NULL);
  217|   531k|    assert(scaled_ref->y_crop_width == cm->width &&
  218|   531k|           scaled_ref->y_crop_height == cm->height);
  219|   531k|  }
  220|       |
  221|   598k|  start_mv = get_fullmv_from_mv(&ref_mv);
  222|       |
  223|   598k|  if (!use_base_mv)
  ------------------
  |  Branch (223:7): [True: 598k, False: 287]
  ------------------
  224|   598k|    center_mv = ref_mv;
  225|    287|  else
  226|    287|    center_mv = tmp_mv->as_mv;
  227|       |
  228|   598k|  const SEARCH_METHODS search_method =
  229|   598k|      av1_get_default_mv_search_method(x, &cpi->sf.mv_sf, bsize);
  230|   598k|  const search_site_config *src_search_sites =
  231|   598k|      av1_get_search_site_config(cpi, x, search_method);
  232|   598k|  FULLPEL_MOTION_SEARCH_PARAMS full_ms_params;
  233|   598k|  FULLPEL_MV_STATS best_mv_stats;
  234|   598k|  av1_make_default_fullpel_ms_params(&full_ms_params, cpi, x, bsize, &center_mv,
  235|   598k|                                     start_mv, src_search_sites, search_method,
  236|   598k|                                     /*fine_search_interval=*/0);
  237|       |
  238|   598k|  const unsigned int full_var_rd = av1_full_pixel_search(
  239|   598k|      start_mv, &full_ms_params, step_param, cond_cost_list(cpi, cost_list),
  240|   598k|      &tmp_mv->as_fullmv, &best_mv_stats, NULL);
  241|       |
  242|       |  // calculate the bit cost on motion vector
  243|   598k|  MV mvp_full = get_mv_from_fullmv(&tmp_mv->as_fullmv);
  244|       |
  245|   598k|  *rate_mv = av1_mv_bit_cost(&mvp_full, &ref_mv, x->mv_costs->nmv_joint_cost,
  246|   598k|                             x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|   598k|#define MV_COST_WEIGHT 108
  ------------------
  247|       |
  248|       |  // TODO(kyslov) Account for Rate Mode!
  249|   598k|  rv = !(RDCOST(x->rdmult, (*rate_mv), 0) > best_rd_sofar);
  ------------------
  |  |   33|   598k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   598k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   598k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   598k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  250|       |
  251|   598k|  if (rv && search_subpel) {
  ------------------
  |  Branch (251:7): [True: 597k, False: 449]
  |  Branch (251:13): [True: 597k, False: 18.4E]
  ------------------
  252|   597k|    SUBPEL_MOTION_SEARCH_PARAMS ms_params;
  253|   597k|    av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize, &ref_mv,
  254|   597k|                                      cost_list);
  255|   597k|    const bool fullpel_performed_well =
  256|   597k|        (bsize == BLOCK_64X64 && full_var_rd * 40 < 62267 * 7) ||
  ------------------
  |  Branch (256:10): [True: 65, False: 597k]
  |  Branch (256:34): [True: 0, False: 65]
  ------------------
  257|   598k|        (bsize == BLOCK_32X32 && full_var_rd * 8 < 42380) ||
  ------------------
  |  Branch (257:10): [True: 17.8k, False: 580k]
  |  Branch (257:34): [True: 0, False: 17.8k]
  ------------------
  258|   598k|        (bsize == BLOCK_16X16 && full_var_rd * 8 < 10127);
  ------------------
  |  Branch (258:10): [True: 137k, False: 460k]
  |  Branch (258:34): [True: 0, False: 137k]
  ------------------
  259|   597k|    if (sf->rt_sf.reduce_mv_pel_precision_highmotion ||
  ------------------
  |  Branch (259:9): [True: 18.4E, False: 598k]
  ------------------
  260|   598k|        sf->rt_sf.reduce_mv_pel_precision_lowcomplex)
  ------------------
  |  Branch (260:9): [True: 18.4E, False: 598k]
  ------------------
  261|      0|      ms_params.forced_stop = subpel_select(cpi, x, bsize, tmp_mv, ref_mv,
  262|      0|                                            start_mv, fullpel_performed_well);
  263|       |
  264|   597k|    MV subpel_start_mv = get_mv_from_fullmv(&tmp_mv->as_fullmv);
  265|   597k|    assert(av1_is_subpelmv_in_range(&ms_params.mv_limits, subpel_start_mv));
  266|       |    // adaptively downgrade subpel search method based on block properties
  267|   597k|    if (use_aggressive_subpel_search_method(
  ------------------
  |  Branch (267:9): [True: 925, False: 597k]
  ------------------
  268|   597k|            x, sf->rt_sf.use_adaptive_subpel_search, fullpel_performed_well))
  269|    925|      av1_find_best_sub_pixel_tree_pruned_more(
  270|    925|          xd, cm, &ms_params, subpel_start_mv, &best_mv_stats, &tmp_mv->as_mv,
  271|    925|          &dis, &x->pred_sse[ref], NULL);
  272|   597k|    else
  273|   597k|      cpi->mv_search_params.find_fractional_mv_step(
  274|   597k|          xd, cm, &ms_params, subpel_start_mv, &best_mv_stats, &tmp_mv->as_mv,
  275|   597k|          &dis, &x->pred_sse[ref], NULL);
  276|   597k|    *rate_mv =
  277|   597k|        av1_mv_bit_cost(&tmp_mv->as_mv, &ref_mv, x->mv_costs->nmv_joint_cost,
  278|   597k|                        x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|   597k|#define MV_COST_WEIGHT 108
  ------------------
  279|   597k|  }
  280|       |  // The final MV can not be equal to the reference MV as this will trigger an
  281|       |  // assert later. This can happen if both NEAREST and NEAR modes were skipped.
  282|   598k|  rv = (tmp_mv->as_mv.col != ref_mv.col || tmp_mv->as_mv.row != ref_mv.row);
  ------------------
  |  Branch (282:9): [True: 523k, False: 74.4k]
  |  Branch (282:44): [True: 57.0k, False: 17.4k]
  ------------------
  283|   598k|  return rv;
  284|   598k|}
nonrd_pickmode.c:use_aggressive_subpel_search_method:
  160|   598k|                                                bool fullpel_performed_well) {
  161|   598k|  if (!use_adaptive_subpel_search) return false;
  ------------------
  |  Branch (161:7): [True: 75.2k, False: 522k]
  ------------------
  162|   522k|  const int qband = x->qindex >> (QINDEX_BITS - 2);
  ------------------
  |  |   28|   522k|#define QINDEX_BITS 8
  ------------------
  163|   522k|  assert(qband < 4);
  164|   522k|  if ((qband > 0) && (fullpel_performed_well ||
  ------------------
  |  Branch (164:7): [True: 367k, False: 155k]
  |  Branch (164:23): [True: 18.4E, False: 367k]
  ------------------
  165|   367k|                      (x->content_state_sb.source_sad_nonrd <= kLowSad) ||
  ------------------
  |  Branch (165:23): [True: 27, False: 367k]
  ------------------
  166|   367k|                      (x->source_variance < 100)))
  ------------------
  |  Branch (166:23): [True: 812, False: 366k]
  ------------------
  167|    925|    return true;
  168|   522k|  return false;
  169|   522k|}
nonrd_pickmode.c:calc_num_proj_ref:
 1321|  2.00M|static void calc_num_proj_ref(AV1_COMP *cpi, MACROBLOCK *x, MB_MODE_INFO *mi) {
 1322|  2.00M|  AV1_COMMON *const cm = &cpi->common;
 1323|  2.00M|  MACROBLOCKD *const xd = &x->e_mbd;
 1324|  2.00M|  const FeatureFlags *const features = &cm->features;
 1325|       |
 1326|  2.00M|  mi->num_proj_ref = 1;
 1327|  2.00M|  WARP_SAMPLE_INFO *const warp_sample_info =
 1328|  2.00M|      &x->warp_sample_info[mi->ref_frame[0]];
 1329|  2.00M|  int *pts0 = warp_sample_info->pts;
 1330|  2.00M|  int *pts_inref0 = warp_sample_info->pts_inref;
 1331|  2.00M|  MOTION_MODE last_motion_mode_allowed = SIMPLE_TRANSLATION;
 1332|       |
 1333|  2.00M|  if (features->switchable_motion_mode) {
  ------------------
  |  Branch (1333:7): [True: 2.00M, False: 18.4E]
  ------------------
 1334|       |    // Determine which motion modes to search if more than SIMPLE_TRANSLATION
 1335|       |    // is allowed.
 1336|  2.00M|    last_motion_mode_allowed = motion_mode_allowed(
 1337|  2.00M|        xd->global_motion, xd, mi, features->allow_warped_motion);
 1338|  2.00M|  }
 1339|       |
 1340|  2.00M|  if (last_motion_mode_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1340:7): [True: 1.58M, False: 417k]
  ------------------
 1341|  1.58M|    if (warp_sample_info->num < 0) {
  ------------------
  |  Branch (1341:9): [True: 442k, False: 1.14M]
  ------------------
 1342|   442k|      warp_sample_info->num = av1_findSamples(cm, xd, pts0, pts_inref0);
 1343|   442k|    }
 1344|  1.58M|    mi->num_proj_ref = warp_sample_info->num;
 1345|  1.58M|  }
 1346|  2.00M|}
nonrd_pickmode.c:search_filter_ref:
 1203|  1.37M|                              int is_single_pred) {
 1204|  1.37M|  AV1_COMMON *const cm = &cpi->common;
 1205|  1.37M|  MACROBLOCKD *const xd = &x->e_mbd;
 1206|  1.37M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  1.37M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1207|  1.37M|  MB_MODE_INFO *const mi = xd->mi[0];
 1208|  1.37M|  const int bw = block_size_wide[bsize];
 1209|  1.37M|  int dim_factor =
 1210|  1.37M|      (cpi->sf.interp_sf.disable_dual_filter == 0) ? FILTER_SEARCH_SIZE : 1;
  ------------------
  |  |   30|      0|#define FILTER_SEARCH_SIZE 2
  ------------------
  |  Branch (1210:7): [True: 0, False: 1.37M]
  ------------------
 1211|  1.37M|  RD_STATS pf_rd_stats[FILTER_SEARCH_SIZE * FILTER_SEARCH_SIZE] = { 0 };
 1212|  1.37M|  TX_SIZE pf_tx_size[FILTER_SEARCH_SIZE * FILTER_SEARCH_SIZE] = { 0 };
 1213|  1.37M|  PRED_BUFFER *current_pred = *this_mode_pred;
 1214|  1.37M|  int best_skip = 0;
 1215|  1.37M|  int best_early_term = 0;
 1216|  1.37M|  int64_t best_cost = INT64_MAX;
 1217|  1.37M|  int best_filter_index = -1;
 1218|       |
 1219|  1.37M|  SubpelParams subpel_params;
 1220|       |  // Initialize inter prediction params at mode level for single reference
 1221|       |  // mode.
 1222|  1.37M|  if (is_single_pred)
  ------------------
  |  Branch (1222:7): [True: 1.37M, False: 18.4E]
  ------------------
 1223|  1.37M|    init_inter_mode_params(&mi->mv[0].as_mv, inter_pred_params_sr,
 1224|  1.37M|                           &subpel_params, xd->block_ref_scale_factors[0],
 1225|  1.37M|                           pd->pre->width, pd->pre->height);
 1226|  6.83M|  for (int filter_idx = 0; filter_idx < FILTER_SEARCH_SIZE * FILTER_SEARCH_SIZE;
  ------------------
  |  |   30|  6.83M|#define FILTER_SEARCH_SIZE 2
  ------------------
                for (int filter_idx = 0; filter_idx < FILTER_SEARCH_SIZE * FILTER_SEARCH_SIZE;
  ------------------
  |  |   30|  6.83M|#define FILTER_SEARCH_SIZE 2
  ------------------
  |  Branch (1226:28): [True: 5.45M, False: 1.37M]
  ------------------
 1227|  5.45M|       ++filter_idx) {
 1228|  5.45M|    int64_t cost;
 1229|  5.45M|    if (cpi->sf.interp_sf.disable_dual_filter &&
  ------------------
  |  Branch (1229:9): [True: 5.45M, False: 18.4E]
  ------------------
 1230|  5.45M|        filters_ref_set[filter_idx].as_filters.x_filter !=
  ------------------
  |  Branch (1230:9): [True: 2.75M, False: 2.70M]
  ------------------
 1231|  5.45M|            filters_ref_set[filter_idx].as_filters.y_filter)
 1232|  2.75M|      continue;
 1233|       |
 1234|  2.70M|    mi->interp_filters.as_int = filters_ref_set[filter_idx].as_int;
 1235|  2.70M|    if (is_single_pred)
  ------------------
  |  Branch (1235:9): [True: 2.73M, False: 18.4E]
  ------------------
 1236|  2.73M|      av1_enc_build_inter_predictor_y_nonrd(xd, inter_pred_params_sr,
 1237|  2.73M|                                            &subpel_params);
 1238|  18.4E|    else
 1239|  18.4E|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1240|  18.4E|                                    AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  18.4E|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  18.4E|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1241|  2.70M|    unsigned int curr_var = UINT_MAX;
 1242|  2.70M|    if (use_model_yrd_large)
  ------------------
  |  Branch (1242:9): [True: 46.8k, False: 2.65M]
  ------------------
 1243|  46.8k|      model_skip_for_sb_y_large(cpi, bsize, mi_row, mi_col, x, xd,
 1244|  46.8k|                                &pf_rd_stats[filter_idx], this_early_term, 1,
 1245|  46.8k|                                best_sse, &curr_var, UINT_MAX);
 1246|  2.65M|    else
 1247|  2.65M|      model_rd_for_sb_y(cpi, bsize, x, xd, &pf_rd_stats[filter_idx], &curr_var,
 1248|  2.65M|                        1, NULL);
 1249|  2.70M|    pf_rd_stats[filter_idx].rate += av1_get_switchable_rate(
 1250|  2.70M|        x, xd, cm->features.interp_filter, cm->seq_params->enable_dual_filter);
 1251|  2.70M|    cost = RDCOST(x->rdmult, pf_rd_stats[filter_idx].rate,
  ------------------
  |  |   33|  2.70M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  2.70M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  2.70M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  2.70M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1252|  2.70M|                  pf_rd_stats[filter_idx].dist);
 1253|  2.70M|    pf_tx_size[filter_idx] = mi->tx_size;
 1254|  2.70M|    if (cost < best_cost) {
  ------------------
  |  Branch (1254:9): [True: 2.48M, False: 216k]
  ------------------
 1255|  2.48M|      *var = curr_var;
 1256|  2.48M|      best_filter_index = filter_idx;
 1257|  2.48M|      best_cost = cost;
 1258|  2.48M|      best_skip = pf_rd_stats[filter_idx].skip_txfm;
 1259|  2.48M|      best_early_term = *this_early_term;
 1260|  2.48M|      if (reuse_inter_pred) {
  ------------------
  |  Branch (1260:11): [True: 0, False: 2.48M]
  ------------------
 1261|      0|        if (*this_mode_pred != current_pred) {
  ------------------
  |  Branch (1261:13): [True: 0, False: 0]
  ------------------
 1262|      0|          free_pred_buffer(*this_mode_pred);
 1263|      0|          *this_mode_pred = current_pred;
 1264|      0|        }
 1265|      0|        current_pred = &tmp_buffer[get_pred_buffer(tmp_buffer, 3)];
 1266|      0|        pd->dst.buf = current_pred->data;
 1267|      0|        pd->dst.stride = bw;
 1268|      0|      }
 1269|  2.48M|    }
 1270|  2.70M|  }
 1271|  1.37M|  assert(best_filter_index >= 0 &&
 1272|  1.37M|         best_filter_index < dim_factor * FILTER_SEARCH_SIZE);
 1273|  1.37M|  if (reuse_inter_pred && *this_mode_pred != current_pred)
  ------------------
  |  Branch (1273:7): [True: 0, False: 1.37M]
  |  Branch (1273:27): [True: 0, False: 0]
  ------------------
 1274|      0|    free_pred_buffer(current_pred);
 1275|       |
 1276|  1.37M|  mi->interp_filters.as_int = filters_ref_set[best_filter_index].as_int;
 1277|  1.37M|  mi->tx_size = pf_tx_size[best_filter_index];
 1278|  1.37M|  this_rdc->rate = pf_rd_stats[best_filter_index].rate;
 1279|  1.37M|  this_rdc->dist = pf_rd_stats[best_filter_index].dist;
 1280|  1.37M|  this_rdc->sse = pf_rd_stats[best_filter_index].sse;
 1281|  1.37M|  this_rdc->skip_txfm = (best_skip || best_early_term);
  ------------------
  |  Branch (1281:26): [True: 18.4E, False: 1.37M]
  |  Branch (1281:39): [True: 18.4E, False: 1.37M]
  ------------------
 1282|  1.37M|  *this_early_term = best_early_term;
 1283|  1.37M|  if (reuse_inter_pred) {
  ------------------
  |  Branch (1283:7): [True: 0, False: 1.37M]
  ------------------
 1284|      0|    pd->dst.buf = (*this_mode_pred)->data;
 1285|      0|    pd->dst.stride = (*this_mode_pred)->stride;
 1286|  1.37M|  } else if (best_filter_index < dim_factor * FILTER_SEARCH_SIZE - 1) {
  ------------------
  |  |   30|  1.37M|#define FILTER_SEARCH_SIZE 2
  ------------------
  |  Branch (1286:14): [True: 255k, False: 1.11M]
  ------------------
 1287|   255k|    if (is_single_pred)
  ------------------
  |  Branch (1287:9): [True: 254k, False: 20]
  ------------------
 1288|   254k|      av1_enc_build_inter_predictor_y_nonrd(xd, inter_pred_params_sr,
 1289|   254k|                                            &subpel_params);
 1290|     20|    else
 1291|     20|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1292|     20|                                    AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|     20|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|     20|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1293|   255k|  }
 1294|  1.37M|}
nonrd_pickmode.c:search_motion_mode:
 1351|  13.4k|                               int *rate_mv, int64_t best_sse) {
 1352|  13.4k|  AV1_COMMON *const cm = &cpi->common;
 1353|  13.4k|  MACROBLOCKD *const xd = &x->e_mbd;
 1354|  13.4k|  const FeatureFlags *const features = &cm->features;
 1355|  13.4k|  MB_MODE_INFO *const mi = xd->mi[0];
 1356|  13.4k|  RD_STATS pf_rd_stats[MOTION_MODE_SEARCH_SIZE] = { 0 };
 1357|  13.4k|  int best_skip = 0;
 1358|  13.4k|  int best_early_term = 0;
 1359|  13.4k|  int64_t best_cost = INT64_MAX;
 1360|  13.4k|  int best_mode_index = -1;
 1361|  13.4k|  const int interp_filter = features->interp_filter;
 1362|       |
 1363|  13.4k|  const MOTION_MODE motion_modes[MOTION_MODE_SEARCH_SIZE] = {
 1364|  13.4k|    SIMPLE_TRANSLATION, WARPED_CAUSAL
 1365|  13.4k|  };
 1366|  13.4k|  int mode_search_size = is_warped_mode_allowed(cpi, x, mi) ? 2 : 1;
  ------------------
  |  Branch (1366:26): [True: 0, False: 13.4k]
  ------------------
 1367|       |
 1368|  13.4k|  WARP_SAMPLE_INFO *const warp_sample_info =
 1369|  13.4k|      &x->warp_sample_info[mi->ref_frame[0]];
 1370|  13.4k|  int *pts0 = warp_sample_info->pts;
 1371|  13.4k|  int *pts_inref0 = warp_sample_info->pts_inref;
 1372|       |
 1373|  13.4k|  const int total_samples = mi->num_proj_ref;
 1374|  13.4k|  if (total_samples == 0) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 13.4k]
  ------------------
 1375|       |    // Do not search WARPED_CAUSAL if there are no samples to use to determine
 1376|       |    // warped parameters.
 1377|      0|    mode_search_size = 1;
 1378|      0|  }
 1379|       |
 1380|  13.4k|  const MB_MODE_INFO base_mbmi = *mi;
 1381|  13.4k|  MB_MODE_INFO best_mbmi;
 1382|       |
 1383|  26.9k|  for (int mode_index = 0; mode_index < mode_search_size; ++mode_index) {
  ------------------
  |  Branch (1383:28): [True: 13.4k, False: 13.4k]
  ------------------
 1384|  13.4k|    int64_t cost = INT64_MAX;
 1385|  13.4k|    MOTION_MODE motion_mode = motion_modes[mode_index];
 1386|  13.4k|    *mi = base_mbmi;
 1387|  13.4k|    mi->motion_mode = motion_mode;
 1388|  13.4k|    if (motion_mode == SIMPLE_TRANSLATION) {
  ------------------
  |  Branch (1388:9): [True: 13.4k, False: 18.4E]
  ------------------
 1389|  13.4k|      mi->interp_filters = av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
 1390|       |
 1391|  13.4k|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1392|  13.4k|                                    AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  13.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  13.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1393|  13.4k|      if (use_model_yrd_large)
  ------------------
  |  Branch (1393:11): [True: 457, False: 13.0k]
  ------------------
 1394|    457|        model_skip_for_sb_y_large(cpi, bsize, mi_row, mi_col, x, xd,
 1395|    457|                                  &pf_rd_stats[mode_index], this_early_term, 1,
 1396|    457|                                  best_sse, NULL, UINT_MAX);
 1397|  13.0k|      else
 1398|  13.0k|        model_rd_for_sb_y(cpi, bsize, x, xd, &pf_rd_stats[mode_index], NULL, 1,
 1399|  13.0k|                          NULL);
 1400|  13.4k|      pf_rd_stats[mode_index].rate +=
 1401|  13.4k|          av1_get_switchable_rate(x, xd, cm->features.interp_filter,
 1402|  13.4k|                                  cm->seq_params->enable_dual_filter);
 1403|  13.4k|      cost = RDCOST(x->rdmult, pf_rd_stats[mode_index].rate,
  ------------------
  |  |   33|  13.4k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  13.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  13.4k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  13.4k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1404|  13.4k|                    pf_rd_stats[mode_index].dist);
 1405|  18.4E|    } else if (motion_mode == WARPED_CAUSAL) {
  ------------------
  |  Branch (1405:16): [True: 0, False: 18.4E]
  ------------------
 1406|      0|      int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 1407|      0|      const ModeCosts *mode_costs = &x->mode_costs;
 1408|      0|      mi->wm_params.wmtype = DEFAULT_WMTYPE;
  ------------------
  |  |   32|      0|#define DEFAULT_WMTYPE AFFINE
  ------------------
 1409|      0|      mi->interp_filters =
 1410|      0|          av1_broadcast_interp_filter(av1_unswitchable_filter(interp_filter));
 1411|       |
 1412|      0|      memcpy(pts, pts0, total_samples * 2 * sizeof(*pts0));
 1413|      0|      memcpy(pts_inref, pts_inref0, total_samples * 2 * sizeof(*pts_inref0));
 1414|       |      // Select the samples according to motion vector difference
 1415|      0|      if (mi->num_proj_ref > 1) {
  ------------------
  |  Branch (1415:11): [True: 0, False: 0]
  ------------------
 1416|      0|        mi->num_proj_ref = av1_selectSamples(&mi->mv[0].as_mv, pts, pts_inref,
 1417|      0|                                             mi->num_proj_ref, bsize);
 1418|      0|      }
 1419|       |
 1420|       |      // Compute the warped motion parameters with a least squares fit
 1421|       |      //  using the collected samples
 1422|      0|      if (!av1_find_projection(mi->num_proj_ref, pts, pts_inref, bsize,
  ------------------
  |  Branch (1422:11): [True: 0, False: 0]
  ------------------
 1423|      0|                               mi->mv[0].as_mv.row, mi->mv[0].as_mv.col,
 1424|      0|                               &mi->wm_params, mi_row, mi_col)) {
 1425|      0|        if (mi->mode == NEWMV) {
  ------------------
  |  Branch (1425:13): [True: 0, False: 0]
  ------------------
 1426|      0|          const int_mv mv0 = mi->mv[0];
 1427|      0|          const WarpedMotionParams wm_params0 = mi->wm_params;
 1428|      0|          const int num_proj_ref0 = mi->num_proj_ref;
 1429|       |
 1430|      0|          const int_mv ref_mv = av1_get_ref_mv(x, 0);
 1431|      0|          SUBPEL_MOTION_SEARCH_PARAMS ms_params;
 1432|      0|          av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize,
 1433|      0|                                            &ref_mv.as_mv, NULL);
 1434|       |
 1435|       |          // Refine MV in a small range.
 1436|      0|          av1_refine_warped_mv(xd, cm, &ms_params, bsize, pts0, pts_inref0,
 1437|      0|                               total_samples, cpi->sf.mv_sf.warp_search_method,
 1438|      0|                               cpi->sf.mv_sf.warp_search_iters);
 1439|      0|          if (mi->mv[0].as_int == ref_mv.as_int) {
  ------------------
  |  Branch (1439:15): [True: 0, False: 0]
  ------------------
 1440|      0|            continue;
 1441|      0|          }
 1442|       |
 1443|      0|          if (mv0.as_int != mi->mv[0].as_int) {
  ------------------
  |  Branch (1443:15): [True: 0, False: 0]
  ------------------
 1444|       |            // Keep the refined MV and WM parameters.
 1445|      0|            int tmp_rate_mv = av1_mv_bit_cost(
 1446|      0|                &mi->mv[0].as_mv, &ref_mv.as_mv, x->mv_costs->nmv_joint_cost,
 1447|      0|                x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
 1448|      0|            *rate_mv = tmp_rate_mv;
 1449|      0|          } else {
 1450|       |            // Restore the old MV and WM parameters.
 1451|      0|            mi->mv[0] = mv0;
 1452|      0|            mi->wm_params = wm_params0;
 1453|      0|            mi->num_proj_ref = num_proj_ref0;
 1454|      0|          }
 1455|      0|        }
 1456|       |        // Build the warped predictor
 1457|      0|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1458|      0|                                      AOM_PLANE_Y, av1_num_planes(cm) - 1);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1459|      0|        if (use_model_yrd_large)
  ------------------
  |  Branch (1459:13): [True: 0, False: 0]
  ------------------
 1460|      0|          model_skip_for_sb_y_large(cpi, bsize, mi_row, mi_col, x, xd,
 1461|      0|                                    &pf_rd_stats[mode_index], this_early_term,
 1462|      0|                                    1, best_sse, NULL, UINT_MAX);
 1463|      0|        else
 1464|      0|          model_rd_for_sb_y(cpi, bsize, x, xd, &pf_rd_stats[mode_index], NULL,
 1465|      0|                            1, NULL);
 1466|       |
 1467|      0|        pf_rd_stats[mode_index].rate +=
 1468|      0|            mode_costs->motion_mode_cost[bsize][mi->motion_mode];
 1469|      0|        cost = RDCOST(x->rdmult, pf_rd_stats[mode_index].rate,
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1470|      0|                      pf_rd_stats[mode_index].dist);
 1471|      0|      } else {
 1472|      0|        cost = INT64_MAX;
 1473|      0|      }
 1474|      0|    }
 1475|  13.4k|    if (cost < best_cost) {
  ------------------
  |  Branch (1475:9): [True: 13.4k, False: 0]
  ------------------
 1476|  13.4k|      best_mode_index = mode_index;
 1477|  13.4k|      best_cost = cost;
 1478|  13.4k|      best_skip = pf_rd_stats[mode_index].skip_txfm;
 1479|  13.4k|      best_early_term = *this_early_term;
 1480|  13.4k|      best_mbmi = *mi;
 1481|  13.4k|    }
 1482|  13.4k|  }
 1483|  13.4k|  assert(best_mode_index >= 0 && best_mode_index < FILTER_SEARCH_SIZE);
 1484|       |
 1485|  13.4k|  *mi = best_mbmi;
 1486|  13.4k|  this_rdc->rate = pf_rd_stats[best_mode_index].rate;
 1487|  13.4k|  this_rdc->dist = pf_rd_stats[best_mode_index].dist;
 1488|  13.4k|  this_rdc->sse = pf_rd_stats[best_mode_index].sse;
 1489|  13.4k|  this_rdc->skip_txfm = (best_skip || best_early_term);
  ------------------
  |  Branch (1489:26): [True: 69, False: 13.4k]
  |  Branch (1489:39): [True: 3, False: 13.4k]
  ------------------
 1490|  13.4k|  *this_early_term = best_early_term;
 1491|  13.4k|  if (best_mode_index < FILTER_SEARCH_SIZE - 1) {
  ------------------
  |  |   30|  13.4k|#define FILTER_SEARCH_SIZE 2
  ------------------
  |  Branch (1491:7): [True: 13.4k, False: 0]
  ------------------
 1492|  13.4k|    av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 1493|  13.4k|                                  AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  13.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                                AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  13.4k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1494|  13.4k|  }
 1495|  13.4k|}
nonrd_pickmode.c:is_warped_mode_allowed:
 1299|  13.4k|                                         const MB_MODE_INFO *mbmi) {
 1300|  13.4k|  const FeatureFlags *const features = &cpi->common.features;
 1301|  13.4k|  const MACROBLOCKD *xd = &x->e_mbd;
 1302|       |
 1303|  13.4k|  if (cpi->sf.inter_sf.extra_prune_warped) return 0;
  ------------------
  |  Branch (1303:7): [True: 13.4k, False: 0]
  ------------------
 1304|      0|  if (has_second_ref(mbmi)) return 0;
  ------------------
  |  Branch (1304:7): [True: 0, False: 0]
  ------------------
 1305|      0|  MOTION_MODE last_motion_mode_allowed = SIMPLE_TRANSLATION;
 1306|       |
 1307|      0|  if (features->switchable_motion_mode) {
  ------------------
  |  Branch (1307:7): [True: 0, False: 0]
  ------------------
 1308|       |    // Determine which motion modes to search if more than SIMPLE_TRANSLATION
 1309|       |    // is allowed.
 1310|      0|    last_motion_mode_allowed = motion_mode_allowed(
 1311|      0|        xd->global_motion, xd, mbmi, features->allow_warped_motion);
 1312|      0|  }
 1313|       |
 1314|      0|  if (last_motion_mode_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1314:7): [True: 0, False: 0]
  ------------------
 1315|      0|    return 1;
 1316|      0|  }
 1317|       |
 1318|      0|  return 0;
 1319|      0|}
nonrd_pickmode.c:model_skip_for_sb_y_large:
  780|  65.4k|                                      unsigned int var_prune_threshold) {
  781|  65.4k|  if (x->force_zeromv_skip_for_blk) {
  ------------------
  |  Branch (781:7): [True: 0, False: 65.4k]
  ------------------
  782|      0|    *early_term = 1;
  783|      0|    rd_stats->rate = 0;
  784|      0|    rd_stats->dist = 0;
  785|      0|    rd_stats->sse = 0;
  786|      0|    return;
  787|      0|  }
  788|       |
  789|       |  // For block sizes greater than 32x32, the transform size is always 16x16.
  790|       |  // This function avoids calling calculate_variance() for tx_size 16x16 cases
  791|       |  // by directly populating variance at tx_size level from
  792|       |  // block_variance_16x16_dual() function.
  793|  65.4k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  794|  65.4k|  if (CAP_TX_SIZE_FOR_BSIZE_GT32(txfm_params->tx_mode_search_type, bsize)) {
  ------------------
  |  |  447|  65.4k|  (((tx_mode_search_type) != ONLY_4X4 && (bsize) > BLOCK_32X32) ? true : false)
  |  |  ------------------
  |  |  |  Branch (447:3): [True: 154, False: 65.3k]
  |  |  |  Branch (447:5): [True: 65.4k, False: 18.4E]
  |  |  |  Branch (447:42): [True: 154, False: 65.3k]
  |  |  ------------------
  ------------------
  795|    154|    xd->mi[0]->tx_size = TX_SIZE_FOR_BSIZE_GT32;
  ------------------
  |  |  448|    154|#define TX_SIZE_FOR_BSIZE_GT32 (TX_16X16)
  ------------------
  796|    154|    model_skip_for_sb_y_large_64(cpi, bsize, mi_row, mi_col, x, xd, rd_stats,
  797|    154|                                 early_term, calculate_rd, best_sse, var_output,
  798|    154|                                 var_prune_threshold);
  799|    154|    return;
  800|    154|  }
  801|       |
  802|       |  // Note our transform coeffs are 8 times an orthogonal transform.
  803|       |  // Hence quantizer step is also 8 times. To get effective quantizer
  804|       |  // we need to divide by 8 before sending to modeling function.
  805|  65.3k|  unsigned int sse;
  806|  65.3k|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  65.3k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  807|  65.3k|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  65.3k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  808|  65.3k|  int test_skip = 1;
  809|  65.3k|  unsigned int var;
  810|  65.3k|  int sum;
  811|       |
  812|  65.3k|  const int bw = b_width_log2_lookup[bsize];
  813|  65.3k|  const int bh = b_height_log2_lookup[bsize];
  814|  65.3k|  unsigned int sse8x8[256] = { 0 };
  815|  65.3k|  int sum8x8[256] = { 0 };
  816|  65.3k|  unsigned int var8x8[256] = { 0 };
  817|  65.3k|  TX_SIZE tx_size;
  818|       |
  819|       |  // Calculate variance for whole partition, and also save 8x8 blocks' variance
  820|       |  // to be used in following transform skipping test.
  821|  65.3k|  block_variance(p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride,
  822|  65.3k|                 4 << bw, 4 << bh, &sse, &sum, 8, sse8x8, sum8x8, var8x8);
  823|  65.3k|  var = sse - (unsigned int)(((int64_t)sum * sum) >> (bw + bh + 4));
  824|  65.3k|  if (var_output) {
  ------------------
  |  Branch (824:7): [True: 64.9k, False: 393]
  ------------------
  825|  64.9k|    *var_output = var;
  826|  64.9k|    if (*var_output > var_prune_threshold) {
  ------------------
  |  Branch (826:9): [True: 0, False: 64.9k]
  ------------------
  827|      0|      return;
  828|      0|    }
  829|  64.9k|  }
  830|       |
  831|  65.3k|  rd_stats->sse = sse;
  832|       |  // Skipping test
  833|  65.3k|  *early_term = 0;
  834|  65.3k|  tx_size = calculate_tx_size(cpi, bsize, x, var, sse, early_term);
  835|  65.3k|  assert(tx_size <= TX_16X16);
  836|       |  // The code below for setting skip flag assumes transform size of at least
  837|       |  // 8x8, so force this lower limit on transform.
  838|  65.3k|  if (tx_size < TX_8X8) tx_size = TX_8X8;
  ------------------
  |  Branch (838:7): [True: 0, False: 65.3k]
  ------------------
  839|  65.3k|  xd->mi[0]->tx_size = tx_size;
  840|       |
  841|  65.3k|  MB_MODE_INFO *const mi = xd->mi[0];
  842|  65.3k|  if (!calculate_rd && cpi->sf.rt_sf.sse_early_term_inter_search &&
  ------------------
  |  Branch (842:7): [True: 18.1k, False: 47.1k]
  |  Branch (842:24): [True: 18.1k, False: 0]
  ------------------
  843|  18.1k|      early_term_inter_search_with_sse(
  ------------------
  |  Branch (843:7): [True: 275, False: 17.8k]
  ------------------
  844|  18.1k|          cpi->sf.rt_sf.sse_early_term_inter_search, bsize, sse, best_sse,
  845|  18.1k|          mi->mode))
  846|    275|    test_skip = 0;
  847|       |
  848|  65.3k|  if (*early_term) test_skip = 0;
  ------------------
  |  Branch (848:7): [True: 0, False: 65.3k]
  ------------------
  849|       |
  850|       |  // Evaluate if the partition block is a skippable block in Y plane.
  851|  65.3k|  if (test_skip) {
  ------------------
  |  Branch (851:7): [True: 65.0k, False: 244]
  ------------------
  852|  65.0k|    unsigned int sse16x16[64] = { 0 };
  853|  65.0k|    int sum16x16[64] = { 0 };
  854|  65.0k|    unsigned int var16x16[64] = { 0 };
  855|  65.0k|    const unsigned int *sse_tx = sse8x8;
  856|  65.0k|    const unsigned int *var_tx = var8x8;
  857|  65.0k|    unsigned int num_blks = 1 << (bw + bh - 2);
  858|       |
  859|  65.0k|    if (tx_size >= TX_16X16) {
  ------------------
  |  Branch (859:9): [True: 10, False: 65.0k]
  ------------------
  860|     10|      calculate_variance(bw, bh, TX_8X8, sse8x8, sum8x8, var16x16, sse16x16,
  861|     10|                         sum16x16);
  862|     10|      sse_tx = sse16x16;
  863|     10|      var_tx = var16x16;
  864|     10|      num_blks = num_blks >> 2;
  865|     10|    }
  866|  65.0k|    set_early_term_based_on_uv_plane(cpi, x, bsize, xd, mi_row, mi_col,
  867|  65.0k|                                     early_term, num_blks, sse_tx, var_tx, sum,
  868|  65.0k|                                     var, sse);
  869|  65.0k|  }
  870|  65.3k|  calc_rate_dist_block_param(cpi, x, rd_stats, calculate_rd, early_term, bsize,
  871|  65.3k|                             sse);
  872|  65.3k|}
nonrd_pickmode.c:model_skip_for_sb_y_large_64:
  715|    154|                                         unsigned int var_prune_threshold) {
  716|       |  // Note our transform coeffs are 8 times an orthogonal transform.
  717|       |  // Hence quantizer step is also 8 times. To get effective quantizer
  718|       |  // we need to divide by 8 before sending to modeling function.
  719|    154|  unsigned int sse;
  720|    154|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|    154|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  721|    154|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|    154|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  722|    154|  int test_skip = 1;
  723|    154|  unsigned int var;
  724|    154|  int sum;
  725|    154|  const int bw = b_width_log2_lookup[bsize];
  726|    154|  const int bh = b_height_log2_lookup[bsize];
  727|    154|  unsigned int sse16x16[64] = { 0 };
  728|    154|  unsigned int var16x16[64] = { 0 };
  729|    154|  assert(xd->mi[0]->tx_size == TX_16X16);
  730|    154|  assert(bsize > BLOCK_32X32);
  731|       |
  732|       |  // Calculate variance for whole partition, and also save 16x16 blocks'
  733|       |  // variance to be used in following transform skipping test.
  734|    154|  block_variance_16x16_dual(p->src.buf, p->src.stride, pd->dst.buf,
  735|    154|                            pd->dst.stride, 4 << bw, 4 << bh, &sse, &sum, 16,
  736|    154|                            sse16x16, var16x16);
  737|       |
  738|    154|  var = sse - (unsigned int)(((int64_t)sum * sum) >> (bw + bh + 4));
  739|    154|  if (var_output) {
  ------------------
  |  Branch (739:7): [True: 149, False: 5]
  ------------------
  740|    149|    *var_output = var;
  741|    149|    if (*var_output > var_prune_threshold) {
  ------------------
  |  Branch (741:9): [True: 0, False: 149]
  ------------------
  742|      0|      return;
  743|      0|    }
  744|    149|  }
  745|       |
  746|    154|  rd_stats->sse = sse;
  747|       |  // Skipping test
  748|    154|  *early_term = 0;
  749|    154|  set_force_skip_flag(cpi, x, sse, early_term);
  750|       |  // The code below for setting skip flag assumes transform size of at least
  751|       |  // 8x8, so force this lower limit on transform.
  752|    154|  MB_MODE_INFO *const mi = xd->mi[0];
  753|    154|  if (!calculate_rd && cpi->sf.rt_sf.sse_early_term_inter_search &&
  ------------------
  |  Branch (753:7): [True: 69, False: 85]
  |  Branch (753:24): [True: 69, False: 0]
  ------------------
  754|     69|      early_term_inter_search_with_sse(
  ------------------
  |  Branch (754:7): [True: 0, False: 69]
  ------------------
  755|     69|          cpi->sf.rt_sf.sse_early_term_inter_search, bsize, sse, best_sse,
  756|     69|          mi->mode))
  757|      0|    test_skip = 0;
  758|       |
  759|    154|  if (*early_term) test_skip = 0;
  ------------------
  |  Branch (759:7): [True: 0, False: 154]
  ------------------
  760|       |
  761|       |  // Evaluate if the partition block is a skippable block in Y plane.
  762|    154|  if (test_skip) {
  ------------------
  |  Branch (762:7): [True: 153, False: 1]
  ------------------
  763|    153|    const unsigned int *sse_tx = sse16x16;
  764|    153|    const unsigned int *var_tx = var16x16;
  765|    153|    const unsigned int num_block = (1 << (bw + bh - 2)) >> 2;
  766|    153|    set_early_term_based_on_uv_plane(cpi, x, bsize, xd, mi_row, mi_col,
  767|    153|                                     early_term, num_block, sse_tx, var_tx, sum,
  768|    153|                                     var, sse);
  769|    153|  }
  770|    154|  calc_rate_dist_block_param(cpi, x, rd_stats, calculate_rd, early_term, bsize,
  771|    154|                             sse);
  772|    154|}
nonrd_pickmode.c:block_variance_16x16_dual:
  539|    154|                                      uint32_t *var16x16) {
  540|    154|  int k = 0;
  541|    154|  *sse = 0;
  542|    154|  *sum = 0;
  543|       |  // This function is called for block sizes >= BLOCK_32x32. As per the design
  544|       |  // the aom_get_var_sse_sum_16x16_dual() processes four 16x16 blocks (in a
  545|       |  // 16x32) per call. Hence the width and height of the block need to be at
  546|       |  // least 16 and 32 samples respectively.
  547|    154|  assert(w >= 32);
  548|    154|  assert(h >= 16);
  549|    761|  for (int row = 0; row < h; row += block_size) {
  ------------------
  |  Branch (549:21): [True: 607, False: 154]
  ------------------
  550|  1.81k|    for (int col = 0; col < w; col += 32) {
  ------------------
  |  Branch (550:23): [True: 1.20k, False: 607]
  ------------------
  551|  1.20k|      aom_get_var_sse_sum_16x16_dual(src + src_stride * row + col, src_stride,
  552|  1.20k|                                     ref + ref_stride * row + col, ref_stride,
  553|  1.20k|                                     &sse16x16[k], sse, sum, &var16x16[k]);
  554|  1.20k|      k += 2;
  555|  1.20k|    }
  556|    607|  }
  557|    154|}
nonrd_pickmode.c:set_force_skip_flag:
  428|    153|                                       int *force_skip) {
  429|    153|  if (x->txfm_search_params.tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (429:7): [True: 153, False: 0]
  ------------------
  430|    153|      cpi->sf.rt_sf.tx_size_level_based_on_qstep &&
  ------------------
  |  Branch (430:7): [True: 6, False: 147]
  ------------------
  431|      6|      cpi->sf.rt_sf.tx_size_level_based_on_qstep >= 2) {
  ------------------
  |  Branch (431:7): [True: 0, False: 6]
  ------------------
  432|      0|    const int qstep = x->plane[AOM_PLANE_Y].dequant_QTX[1] >> (x->e_mbd.bd - 5);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  433|      0|    const unsigned int qstep_sq = qstep * qstep;
  434|       |    // If the sse is low for low source variance blocks, mark those as
  435|       |    // transform skip.
  436|       |    // Note: Though qstep_sq is based on ac qstep, the threshold is kept
  437|       |    // low so that reliable early estimate of tx skip can be obtained
  438|       |    // through its comparison with sse.
  439|      0|    if (sse < qstep_sq && x->source_variance < qstep_sq &&
  ------------------
  |  Branch (439:9): [True: 0, False: 0]
  |  Branch (439:27): [True: 0, False: 0]
  ------------------
  440|      0|        x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (440:9): [True: 0, False: 0]
  ------------------
  441|      0|        x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 0)
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (441:9): [True: 0, False: 0]
  ------------------
  442|      0|      *force_skip = 1;
  443|      0|  }
  444|    153|}
nonrd_pickmode.c:block_variance:
  513|  65.4k|                           uint32_t *sse8x8, int *sum8x8, uint32_t *var8x8) {
  514|  65.4k|  int k = 0;
  515|  65.4k|  *sse = 0;
  516|  65.4k|  *sum = 0;
  517|       |
  518|       |  // This function is called for block sizes >= BLOCK_32x32. As per the design
  519|       |  // the aom_get_var_sse_sum_8x8_quad() processes four 8x8 blocks (in a 8x32)
  520|       |  // per call. Hence the width and height of the block need to be at least 8 and
  521|       |  // 32 samples respectively.
  522|  65.4k|  assert(w >= 32);
  523|  65.4k|  assert(h >= 8);
  524|   326k|  for (int row = 0; row < h; row += block_size) {
  ------------------
  |  Branch (524:21): [True: 261k, False: 65.4k]
  ------------------
  525|   522k|    for (int col = 0; col < w; col += 32) {
  ------------------
  |  Branch (525:23): [True: 261k, False: 261k]
  ------------------
  526|   261k|      aom_get_var_sse_sum_8x8_quad(src + src_stride * row + col, src_stride,
  527|   261k|                                   ref + ref_stride * row + col, ref_stride,
  528|   261k|                                   &sse8x8[k], &sum8x8[k], sse, sum,
  529|   261k|                                   &var8x8[k]);
  530|   261k|      k += 4;
  531|   261k|    }
  532|   261k|  }
  533|  65.4k|}
nonrd_pickmode.c:calculate_tx_size:
  452|  3.35M|                                 unsigned int sse, int *force_skip) {
  453|  3.35M|  MACROBLOCKD *const xd = &x->e_mbd;
  454|  3.35M|  TX_SIZE tx_size;
  455|  3.35M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  456|  3.35M|  if (txfm_params->tx_mode_search_type == TX_MODE_SELECT) {
  ------------------
  |  Branch (456:7): [True: 3.15M, False: 196k]
  ------------------
  457|  3.15M|    int multiplier = 8;
  458|  3.15M|    unsigned int var_thresh = 0;
  459|  3.15M|    unsigned int is_high_var = 1;
  460|       |    // Use quantizer based thresholds to determine transform size.
  461|  3.15M|    if (cpi->sf.rt_sf.tx_size_level_based_on_qstep) {
  ------------------
  |  Branch (461:9): [True: 1.63M, False: 1.51M]
  ------------------
  462|  1.63M|      const int qband = x->qindex >> (QINDEX_BITS - 2);
  ------------------
  |  |   28|  1.63M|#define QINDEX_BITS 8
  ------------------
  463|  1.63M|      const int mult[4] = { 8, 7, 6, 5 };
  464|  1.63M|      assert(qband < 4);
  465|  1.63M|      multiplier = mult[qband];
  466|  1.63M|      const int qstep = x->plane[AOM_PLANE_Y].dequant_QTX[1] >> (xd->bd - 5);
  ------------------
  |  |  281|  1.63M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  467|  1.63M|      const unsigned int qstep_sq = qstep * qstep;
  468|  1.63M|      var_thresh = qstep_sq * 2;
  469|  1.63M|      if (cpi->sf.rt_sf.tx_size_level_based_on_qstep >= 2) {
  ------------------
  |  Branch (469:11): [True: 0, False: 1.63M]
  ------------------
  470|       |        // If the sse is low for low source variance blocks, mark those as
  471|       |        // transform skip.
  472|       |        // Note: Though qstep_sq is based on ac qstep, the threshold is kept
  473|       |        // low so that reliable early estimate of tx skip can be obtained
  474|       |        // through its comparison with sse.
  475|      0|        if (sse < qstep_sq && x->source_variance < qstep_sq &&
  ------------------
  |  Branch (475:13): [True: 0, False: 0]
  |  Branch (475:31): [True: 0, False: 0]
  ------------------
  476|      0|            x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 0 &&
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (476:13): [True: 0, False: 0]
  ------------------
  477|      0|            x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)] == 0)
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (477:13): [True: 0, False: 0]
  ------------------
  478|      0|          *force_skip = 1;
  479|       |        // Further lower transform size based on aq mode only if residual
  480|       |        // variance is high.
  481|      0|        is_high_var = (var >= var_thresh);
  482|      0|      }
  483|  1.63M|    }
  484|       |    // Choose larger transform size for blocks where dc component is dominant or
  485|       |    // the ac component is low.
  486|  3.15M|    if (sse > ((var * multiplier) >> 2) || (var < var_thresh))
  ------------------
  |  Branch (486:9): [True: 33.0k, False: 3.12M]
  |  Branch (486:44): [True: 4, False: 3.12M]
  ------------------
  487|  34.4k|      tx_size =
  488|  34.4k|          AOMMIN(max_txsize_lookup[bsize],
  ------------------
  |  |   34|  34.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 34.4k, False: 0]
  |  |  ------------------
  ------------------
  489|  3.15M|                 tx_mode_to_biggest_tx_size[txfm_params->tx_mode_search_type]);
  490|  3.12M|    else
  491|  3.12M|      tx_size = TX_8X8;
  492|       |
  493|  3.15M|    if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (493:9): [True: 0, False: 3.15M]
  ------------------
  494|      0|        cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) && is_high_var)
  ------------------
  |  Branch (494:9): [True: 0, False: 0]
  |  Branch (494:69): [True: 0, False: 0]
  ------------------
  495|      0|      tx_size = TX_8X8;
  496|  3.15M|    else if (tx_size > TX_16X16)
  ------------------
  |  Branch (496:14): [True: 10, False: 3.15M]
  ------------------
  497|     10|      tx_size = TX_16X16;
  498|  3.15M|  } else {
  499|   196k|    tx_size =
  500|   196k|        AOMMIN(max_txsize_lookup[bsize],
  ------------------
  |  |   34|   196k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 196k]
  |  |  ------------------
  ------------------
  501|   196k|               tx_mode_to_biggest_tx_size[txfm_params->tx_mode_search_type]);
  502|   196k|  }
  503|       |
  504|  3.35M|  if (CAP_TX_SIZE_FOR_BSIZE_GT32(txfm_params->tx_mode_search_type, bsize))
  ------------------
  |  |  447|  3.35M|  (((tx_mode_search_type) != ONLY_4X4 && (bsize) > BLOCK_32X32) ? true : false)
  |  |  ------------------
  |  |  |  Branch (447:3): [True: 0, False: 3.35M]
  |  |  |  Branch (447:5): [True: 3.15M, False: 194k]
  |  |  |  Branch (447:42): [True: 0, False: 3.15M]
  |  |  ------------------
  ------------------
  505|      0|    tx_size = TX_SIZE_FOR_BSIZE_GT32;
  ------------------
  |  |  448|      0|#define TX_SIZE_FOR_BSIZE_GT32 (TX_16X16)
  ------------------
  506|       |
  507|  3.35M|  return AOMMIN(tx_size, TX_16X16);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.35M, False: 18.4E]
  |  |  ------------------
  ------------------
  508|  3.35M|}
nonrd_pickmode.c:calculate_variance:
  562|     10|                               int *sum_o) {
  563|     10|  const BLOCK_SIZE unit_size = txsize_to_bsize[tx_size];
  564|     10|  const int nw = 1 << (bw - b_width_log2_lookup[unit_size]);
  565|     10|  const int nh = 1 << (bh - b_height_log2_lookup[unit_size]);
  566|     10|  int row, col, k = 0;
  567|       |
  568|     30|  for (row = 0; row < nh; row += 2) {
  ------------------
  |  Branch (568:17): [True: 20, False: 10]
  ------------------
  569|     60|    for (col = 0; col < nw; col += 2) {
  ------------------
  |  Branch (569:19): [True: 40, False: 20]
  ------------------
  570|     40|      sse_o[k] = sse_i[row * nw + col] + sse_i[row * nw + col + 1] +
  571|     40|                 sse_i[(row + 1) * nw + col] + sse_i[(row + 1) * nw + col + 1];
  572|     40|      sum_o[k] = sum_i[row * nw + col] + sum_i[row * nw + col + 1] +
  573|     40|                 sum_i[(row + 1) * nw + col] + sum_i[(row + 1) * nw + col + 1];
  574|     40|      var_o[k] = sse_o[k] - (uint32_t)(((int64_t)sum_o[k] * sum_o[k]) >>
  575|     40|                                       (b_width_log2_lookup[unit_size] +
  576|     40|                                        b_height_log2_lookup[unit_size] + 6));
  577|     40|      k++;
  578|     40|    }
  579|     20|  }
  580|     10|}
nonrd_pickmode.c:set_early_term_based_on_uv_plane:
  597|  65.2k|    const unsigned int *var_tx, int sum, unsigned int var, unsigned int sse) {
  598|  65.2k|  AV1_COMMON *const cm = &cpi->common;
  599|  65.2k|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  65.2k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  600|  65.2k|  const uint32_t dc_quant = p->dequant_QTX[0];
  601|  65.2k|  const uint32_t ac_quant = p->dequant_QTX[1];
  602|  65.2k|  int64_t dc_thr = dc_quant * dc_quant >> 6;
  603|  65.2k|  int64_t ac_thr = ac_quant * ac_quant >> 6;
  604|  65.2k|  const int bw = b_width_log2_lookup[bsize];
  605|  65.2k|  const int bh = b_height_log2_lookup[bsize];
  606|  65.2k|  int ac_test = 1;
  607|  65.2k|  int dc_test = 1;
  608|  65.2k|  const int norm_sum = abs(sum) >> (bw + bh);
  609|       |
  610|       |#if CONFIG_AV1_TEMPORAL_DENOISING
  611|       |  if (cpi->oxcf.noise_sensitivity > 0 && denoise_svc(cpi) &&
  612|       |      cpi->oxcf.speed > 5)
  613|       |    ac_thr = av1_scale_acskip_thresh(ac_thr, cpi->denoiser.denoising_level,
  614|       |                                     norm_sum, cpi->svc.temporal_layer_id);
  615|       |  else
  616|       |    ac_thr *= ac_thr_factor(cpi->oxcf.speed, cm->width, cm->height, norm_sum);
  617|       |#else
  618|  65.2k|  ac_thr *= ac_thr_factor(cpi->oxcf.speed, cm->width, cm->height, norm_sum);
  619|       |
  620|  65.2k|#endif
  621|       |
  622|  65.2k|  if (cpi->sf.rt_sf.increase_source_sad_thresh) {
  ------------------
  |  Branch (622:7): [True: 0, False: 65.2k]
  ------------------
  623|      0|    dc_thr = dc_thr << 1;
  624|      0|    ac_thr = ac_thr << 2;
  625|      0|  }
  626|       |
  627|  65.2k|  if (cpi->common.width * cpi->common.height >= 1280 * 720 &&
  ------------------
  |  Branch (627:7): [True: 0, False: 65.2k]
  ------------------
  628|      0|      cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (628:7): [True: 0, False: 0]
  ------------------
  629|      0|      x->content_state_sb.source_sad_nonrd > kLowSad &&
  ------------------
  |  Branch (629:7): [True: 0, False: 0]
  ------------------
  630|      0|      (sse >> (bw + bh)) > 1000) {
  ------------------
  |  Branch (630:7): [True: 0, False: 0]
  ------------------
  631|      0|    dc_thr = dc_thr >> 4;
  632|      0|    ac_thr = ac_thr >> 4;
  633|      0|  }
  634|       |
  635|  69.5k|  for (int k = 0; k < num_blk; k++) {
  ------------------
  |  Branch (635:19): [True: 69.4k, False: 164]
  ------------------
  636|       |    // Check if all ac coefficients can be quantized to zero.
  637|  69.4k|    if (!(var_tx[k] < ac_thr || var == 0)) {
  ------------------
  |  Branch (637:11): [True: 4.46k, False: 64.9k]
  |  Branch (637:33): [True: 18.4E, False: 64.9k]
  ------------------
  638|  64.9k|      ac_test = 0;
  639|  64.9k|      break;
  640|  64.9k|    }
  641|       |    // Check if dc coefficient can be quantized to zero.
  642|  4.45k|    if (!(sse_tx[k] - var_tx[k] < dc_thr || sse == var)) {
  ------------------
  |  Branch (642:11): [True: 4.27k, False: 179]
  |  Branch (642:45): [True: 37, False: 142]
  ------------------
  643|    142|      dc_test = 0;
  644|    142|      break;
  645|    142|    }
  646|  4.45k|  }
  647|       |
  648|       |  // Check if chroma can be skipped based on ac and dc test flags.
  649|  65.2k|  if (ac_test && dc_test) {
  ------------------
  |  Branch (649:7): [True: 310, False: 64.9k]
  |  Branch (649:18): [True: 168, False: 142]
  ------------------
  650|    168|    int skip_uv[2] = { 0 };
  651|    168|    unsigned int var_uv[2];
  652|    168|    unsigned int sse_uv[2];
  653|       |    // Transform skipping test in UV planes.
  654|    390|    for (int plane = AOM_PLANE_U; plane <= AOM_PLANE_V; plane++) {
  ------------------
  |  |  282|    168|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                  for (int plane = AOM_PLANE_U; plane <= AOM_PLANE_V; plane++) {
  ------------------
  |  |  283|    390|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
  |  Branch (654:35): [True: 282, False: 108]
  ------------------
  655|    282|      int j = plane - 1;
  656|    282|      skip_uv[j] = 1;
  657|    282|      if (x->color_sensitivity[COLOR_SENS_IDX(plane)]) {
  ------------------
  |  |   50|    282|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (657:11): [True: 94, False: 188]
  ------------------
  658|     94|        skip_uv[j] = 0;
  659|     94|        struct macroblock_plane *const puv = &x->plane[plane];
  660|     94|        struct macroblockd_plane *const puvd = &xd->plane[plane];
  661|     94|        const BLOCK_SIZE uv_bsize = get_plane_block_size(
  662|     94|            bsize, puvd->subsampling_x, puvd->subsampling_y);
  663|       |        // Adjust these thresholds for UV.
  664|     94|        const int shift_ac = cpi->sf.rt_sf.increase_source_sad_thresh ? 5 : 3;
  ------------------
  |  Branch (664:30): [True: 0, False: 94]
  ------------------
  665|     94|        const int shift_dc = cpi->sf.rt_sf.increase_source_sad_thresh ? 4 : 3;
  ------------------
  |  Branch (665:30): [True: 0, False: 94]
  ------------------
  666|     94|        const int64_t uv_dc_thr =
  667|     94|            (puv->dequant_QTX[0] * puv->dequant_QTX[0]) >> shift_dc;
  668|     94|        const int64_t uv_ac_thr =
  669|     94|            (puv->dequant_QTX[1] * puv->dequant_QTX[1]) >> shift_ac;
  670|     94|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
  671|     94|                                      plane, plane);
  672|     94|        var_uv[j] = cpi->ppi->fn_ptr[uv_bsize].vf(puv->src.buf, puv->src.stride,
  673|     94|                                                  puvd->dst.buf,
  674|     94|                                                  puvd->dst.stride, &sse_uv[j]);
  675|     94|        if ((var_uv[j] < uv_ac_thr || var_uv[j] == 0) &&
  ------------------
  |  Branch (675:14): [True: 34, False: 60]
  |  Branch (675:39): [True: 0, False: 60]
  ------------------
  676|     34|            (sse_uv[j] - var_uv[j] < uv_dc_thr || sse_uv[j] == var_uv[j]))
  ------------------
  |  Branch (676:14): [True: 34, False: 0]
  |  Branch (676:51): [True: 0, False: 0]
  ------------------
  677|     34|          skip_uv[j] = 1;
  678|     60|        else
  679|     60|          break;
  680|     94|      }
  681|    282|    }
  682|    168|    if (skip_uv[0] & skip_uv[1]) {
  ------------------
  |  Branch (682:9): [True: 108, False: 60]
  ------------------
  683|    108|      *early_term = 1;
  684|    108|    }
  685|    168|  }
  686|  65.2k|}
nonrd_pickmode.c:ac_thr_factor:
  583|  65.2k|static int ac_thr_factor(int speed, int width, int height, int norm_sum) {
  584|  65.2k|  if (speed >= 8 && norm_sum < 5) {
  ------------------
  |  Branch (584:7): [True: 38.1k, False: 27.0k]
  |  Branch (584:21): [True: 3.29k, False: 34.8k]
  ------------------
  585|  3.29k|    if (width <= 640 && height <= 480)
  ------------------
  |  Branch (585:9): [True: 3.29k, False: 0]
  |  Branch (585:25): [True: 3.29k, False: 0]
  ------------------
  586|  3.29k|      return 4;
  587|      0|    else
  588|      0|      return 2;
  589|  3.29k|  }
  590|  61.9k|  return 1;
  591|  65.2k|}
nonrd_pickmode.c:calc_rate_dist_block_param:
  692|  65.5k|                                              unsigned int sse) {
  693|  65.5k|  if (calculate_rd) {
  ------------------
  |  Branch (693:7): [True: 47.3k, False: 18.1k]
  ------------------
  694|  47.3k|    if (!*early_term) {
  ------------------
  |  Branch (694:9): [True: 47.3k, False: 41]
  ------------------
  695|  47.3k|      const int bw = block_size_wide[bsize];
  696|  47.3k|      const int bh = block_size_high[bsize];
  697|       |
  698|  47.3k|      model_rd_with_curvfit(cpi, x, bsize, AOM_PLANE_Y, rd_stats->sse, bw * bh,
  ------------------
  |  |  281|  47.3k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  699|  47.3k|                            &rd_stats->rate, &rd_stats->dist);
  700|  47.3k|    }
  701|       |
  702|  47.3k|    if (*early_term) {
  ------------------
  |  Branch (702:9): [True: 42, False: 47.3k]
  ------------------
  703|     42|      rd_stats->rate = 0;
  704|     42|      rd_stats->dist = sse << 4;
  705|     42|    }
  706|  47.3k|  }
  707|  65.5k|}
nonrd_pickmode.c:model_rd_for_sb_y:
  877|  3.29M|                              int calculate_rd, int *early_term) {
  878|  3.29M|  if (x->force_zeromv_skip_for_blk && early_term != NULL) {
  ------------------
  |  Branch (878:7): [True: 0, False: 3.29M]
  |  Branch (878:39): [True: 0, False: 0]
  ------------------
  879|      0|    *early_term = 1;
  880|      0|    rd_stats->rate = 0;
  881|      0|    rd_stats->dist = 0;
  882|      0|    rd_stats->sse = 0;
  883|      0|  }
  884|       |
  885|       |  // Note our transform coeffs are 8 times an orthogonal transform.
  886|       |  // Hence quantizer step is also 8 times. To get effective quantizer
  887|       |  // we need to divide by 8 before sending to modeling function.
  888|  3.29M|  const int ref = xd->mi[0]->ref_frame[0];
  889|       |
  890|  3.29M|  assert(bsize < BLOCK_SIZES_ALL);
  891|       |
  892|  3.29M|  struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  3.29M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  893|  3.29M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  3.29M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  894|  3.29M|  unsigned int sse;
  895|  3.29M|  int rate;
  896|  3.29M|  int64_t dist;
  897|       |
  898|  3.29M|  unsigned int var = cpi->ppi->fn_ptr[bsize].vf(
  899|  3.29M|      p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride, &sse);
  900|  3.29M|  int force_skip = 0;
  901|  3.29M|  xd->mi[0]->tx_size = calculate_tx_size(cpi, bsize, x, var, sse, &force_skip);
  902|  3.29M|  if (var_out) {
  ------------------
  |  Branch (902:7): [True: 3.27M, False: 16.9k]
  ------------------
  903|  3.27M|    *var_out = var;
  904|  3.27M|  }
  905|       |
  906|  3.29M|  if (calculate_rd && (!force_skip || ref == INTRA_FRAME)) {
  ------------------
  |  Branch (906:7): [True: 2.69M, False: 601k]
  |  Branch (906:24): [True: 2.69M, False: 0]
  |  Branch (906:39): [True: 0, False: 0]
  ------------------
  907|  2.69M|    const int bwide = block_size_wide[bsize];
  908|  2.69M|    const int bhigh = block_size_high[bsize];
  909|  2.69M|    model_rd_with_curvfit(cpi, x, bsize, AOM_PLANE_Y, sse, bwide * bhigh, &rate,
  ------------------
  |  |  281|  2.69M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  910|  2.69M|                          &dist);
  911|  2.69M|  } else {
  912|   601k|    rate = INT_MAX;  // this will be overwritten later with av1_block_yrd
  913|   601k|    dist = INT_MAX;
  914|   601k|  }
  915|  3.29M|  rd_stats->sse = sse;
  916|  3.29M|  x->pred_sse[ref] = (unsigned int)AOMMIN(sse, UINT_MAX);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.29M, False: 18.4E]
  |  |  ------------------
  ------------------
  917|       |
  918|  3.29M|  if (force_skip && ref > INTRA_FRAME) {
  ------------------
  |  Branch (918:7): [True: 0, False: 3.29M]
  |  Branch (918:21): [True: 0, False: 0]
  ------------------
  919|      0|    rate = 0;
  920|      0|    dist = (int64_t)sse << 4;
  921|      0|  }
  922|       |
  923|  3.29M|  assert(rate >= 0);
  924|       |
  925|  3.29M|  rd_stats->skip_txfm = (rate == 0);
  926|  3.29M|  rate = AOMMIN(rate, INT_MAX);
  ------------------
  |  |   34|  3.29M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.69M, False: 597k]
  |  |  ------------------
  ------------------
  927|  3.29M|  rd_stats->rate = rate;
  928|  3.29M|  rd_stats->dist = dist;
  929|  3.29M|}
nonrd_pickmode.c:early_term_inter_search_with_sse:
   37|  2.02M|                                                   PREDICTION_MODE this_mode) {
   38|       |  // Aggressiveness to terminate inter mode search early is adjusted based on
   39|       |  // speed and block size.
   40|  2.02M|  static const double early_term_thresh[4][4] = { { 0.65, 0.65, 0.65, 0.7 },
   41|  2.02M|                                                  { 0.6, 0.65, 0.85, 0.9 },
   42|  2.02M|                                                  { 0.5, 0.5, 0.55, 0.6 },
   43|  2.02M|                                                  { 0.6, 0.75, 0.85, 0.85 } };
   44|  2.02M|  static const double early_term_thresh_newmv_nearestmv[4] = { 0.3, 0.3, 0.3,
   45|  2.02M|                                                               0.3 };
   46|       |
   47|  2.02M|  const int size_group = size_group_lookup[bsize];
   48|  2.02M|  assert(size_group < 4);
   49|  2.02M|  assert((early_term_idx > 0) && (early_term_idx < EARLY_TERM_INDICES));
   50|  2.02M|  const double threshold =
   51|  2.02M|      ((early_term_idx == EARLY_TERM_IDX_4) &&
  ------------------
  |  Branch (51:8): [True: 0, False: 2.02M]
  ------------------
   52|      0|       (this_mode == NEWMV || this_mode == NEARESTMV))
  ------------------
  |  Branch (52:9): [True: 0, False: 0]
  |  Branch (52:31): [True: 0, False: 0]
  ------------------
   53|  2.02M|          ? early_term_thresh_newmv_nearestmv[size_group]
   54|  2.02M|          : early_term_thresh[early_term_idx - 1][size_group];
   55|       |
   56|       |  // Terminate inter mode search early based on best sse so far.
   57|  2.02M|  if ((early_term_idx > 0) && (threshold * this_sse > best_sse)) {
  ------------------
  |  Branch (57:7): [True: 2.02M, False: 91]
  |  Branch (57:31): [True: 95.6k, False: 1.93M]
  ------------------
   58|  95.6k|    return 1;
   59|  95.6k|  }
   60|  1.93M|  return 0;
   61|  2.02M|}
nonrd_pickmode.c:is_globalmv_better:
 2441|   249k|    const MB_MODE_INFO_EXT *mbmi_ext) {
 2442|   249k|  const int globalmv_mode_cost =
 2443|   249k|      single_inter_mode_costs[INTER_OFFSET(GLOBALMV)][ref_frame];
  ------------------
  |  |   28|   249k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 2444|   249k|  int this_mode_cost =
 2445|   249k|      rate_mv + single_inter_mode_costs[INTER_OFFSET(this_mode)][ref_frame];
  ------------------
  |  |   28|   249k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
 2446|   249k|  if (this_mode == NEWMV || this_mode == NEARMV) {
  ------------------
  |  Branch (2446:7): [True: 18.4E, False: 249k]
  |  Branch (2446:29): [True: 107k, False: 141k]
  ------------------
 2447|   107k|    const MV_REFERENCE_FRAME rf[2] = { ref_frame, NONE_FRAME };
 2448|   107k|    this_mode_cost += get_drl_cost(
 2449|   107k|        NEWMV, 0, mbmi_ext, mode_costs->drl_mode_cost0, av1_ref_frame_type(rf));
 2450|   107k|  }
 2451|   249k|  return this_mode_cost > globalmv_mode_cost;
 2452|   249k|}
nonrd_pickmode.c:get_drl_cost:
  934|   107k|                               int8_t ref_frame_type) {
  935|   107k|  int cost = 0;
  936|   107k|  if (this_mode == NEWMV || this_mode == NEW_NEWMV) {
  ------------------
  |  Branch (936:7): [True: 107k, False: 0]
  |  Branch (936:29): [True: 0, False: 0]
  ------------------
  937|   251k|    for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (937:23): [True: 179k, False: 71.9k]
  ------------------
  938|   179k|      if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (938:11): [True: 35.6k, False: 143k]
  ------------------
  939|  35.6k|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
  940|  35.6k|        cost += drl_mode_cost0[drl_ctx][ref_mv_idx != idx];
  941|  35.6k|        if (ref_mv_idx == idx) return cost;
  ------------------
  |  Branch (941:13): [True: 35.6k, False: 4]
  ------------------
  942|  35.6k|      }
  943|   179k|    }
  944|  71.9k|    return cost;
  945|   107k|  }
  946|       |
  947|      0|  if (have_nearmv_in_inter_mode(this_mode)) {
  ------------------
  |  Branch (947:7): [True: 0, False: 0]
  ------------------
  948|      0|    for (int idx = 1; idx < 3; ++idx) {
  ------------------
  |  Branch (948:23): [True: 0, False: 0]
  ------------------
  949|      0|      if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (949:11): [True: 0, False: 0]
  ------------------
  950|      0|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
  951|      0|        cost += drl_mode_cost0[drl_ctx][ref_mv_idx != (idx - 1)];
  952|      0|        if (ref_mv_idx == (idx - 1)) return cost;
  ------------------
  |  Branch (952:13): [True: 0, False: 0]
  ------------------
  953|      0|      }
  954|      0|    }
  955|      0|    return cost;
  956|      0|  }
  957|      0|  return cost;
  958|      0|}
nonrd_pickmode.c:newmv_diff_bias:
  994|  1.91M|                            CONTENT_STATE_SB content_state_sb) {
  995|       |  // Bias against MVs associated with NEWMV mode that are very different from
  996|       |  // top/left neighbors.
  997|  1.91M|  if (this_mode == NEWMV) {
  ------------------
  |  Branch (997:7): [True: 579k, False: 1.33M]
  ------------------
  998|   579k|    int al_mv_average_row;
  999|   579k|    int al_mv_average_col;
 1000|   579k|    int row_diff, col_diff;
 1001|   579k|    int above_mv_valid = 0;
 1002|   579k|    int left_mv_valid = 0;
 1003|   579k|    int above_row = INVALID_MV_ROW_COL, above_col = INVALID_MV_ROW_COL;
  ------------------
  |  |   27|   579k|#define INVALID_MV_ROW_COL -32768
  ------------------
                  int above_row = INVALID_MV_ROW_COL, above_col = INVALID_MV_ROW_COL;
  ------------------
  |  |   27|   579k|#define INVALID_MV_ROW_COL -32768
  ------------------
 1004|   579k|    int left_row = INVALID_MV_ROW_COL, left_col = INVALID_MV_ROW_COL;
  ------------------
  |  |   27|   579k|#define INVALID_MV_ROW_COL -32768
  ------------------
                  int left_row = INVALID_MV_ROW_COL, left_col = INVALID_MV_ROW_COL;
  ------------------
  |  |   27|   579k|#define INVALID_MV_ROW_COL -32768
  ------------------
 1005|   579k|    if (bsize >= BLOCK_64X64 && content_state_sb.source_sad_nonrd != kHighSad &&
  ------------------
  |  Branch (1005:9): [True: 38, False: 579k]
  |  Branch (1005:33): [True: 0, False: 38]
  ------------------
 1006|      0|        spatial_variance < 300 &&
  ------------------
  |  Branch (1006:9): [True: 0, False: 0]
  ------------------
 1007|      0|        (mv_row > 16 || mv_row < -16 || mv_col > 16 || mv_col < -16)) {
  ------------------
  |  Branch (1007:10): [True: 0, False: 0]
  |  Branch (1007:25): [True: 0, False: 0]
  |  Branch (1007:41): [True: 0, False: 0]
  |  Branch (1007:56): [True: 0, False: 0]
  ------------------
 1008|      0|      this_rdc->rdcost = this_rdc->rdcost << 2;
 1009|      0|      return;
 1010|      0|    }
 1011|   579k|    if (xd->above_mbmi) {
  ------------------
  |  Branch (1011:9): [True: 452k, False: 127k]
  ------------------
 1012|   452k|      above_mv_valid = xd->above_mbmi->mv[0].as_int != INVALID_MV;
  ------------------
  |  |   26|   452k|#define INVALID_MV 0x80008000
  ------------------
 1013|   452k|      above_row = xd->above_mbmi->mv[0].as_mv.row;
 1014|   452k|      above_col = xd->above_mbmi->mv[0].as_mv.col;
 1015|   452k|    }
 1016|   579k|    if (xd->left_mbmi) {
  ------------------
  |  Branch (1016:9): [True: 449k, False: 129k]
  ------------------
 1017|   449k|      left_mv_valid = xd->left_mbmi->mv[0].as_int != INVALID_MV;
  ------------------
  |  |   26|   449k|#define INVALID_MV 0x80008000
  ------------------
 1018|   449k|      left_row = xd->left_mbmi->mv[0].as_mv.row;
 1019|   449k|      left_col = xd->left_mbmi->mv[0].as_mv.col;
 1020|   449k|    }
 1021|   579k|    if (above_mv_valid && left_mv_valid) {
  ------------------
  |  Branch (1021:9): [True: 294k, False: 285k]
  |  Branch (1021:27): [True: 161k, False: 132k]
  ------------------
 1022|   161k|      al_mv_average_row = (above_row + left_row + 1) >> 1;
 1023|   161k|      al_mv_average_col = (above_col + left_col + 1) >> 1;
 1024|   417k|    } else if (above_mv_valid) {
  ------------------
  |  Branch (1024:16): [True: 132k, False: 285k]
  ------------------
 1025|   132k|      al_mv_average_row = above_row;
 1026|   132k|      al_mv_average_col = above_col;
 1027|   285k|    } else if (left_mv_valid) {
  ------------------
  |  Branch (1027:16): [True: 130k, False: 154k]
  ------------------
 1028|   130k|      al_mv_average_row = left_row;
 1029|   130k|      al_mv_average_col = left_col;
 1030|   154k|    } else {
 1031|   154k|      al_mv_average_row = al_mv_average_col = 0;
 1032|   154k|    }
 1033|   579k|    row_diff = al_mv_average_row - mv_row;
 1034|   579k|    col_diff = al_mv_average_col - mv_col;
 1035|   579k|    if (row_diff > 80 || row_diff < -80 || col_diff > 80 || col_diff < -80) {
  ------------------
  |  Branch (1035:9): [True: 2.50k, False: 577k]
  |  Branch (1035:26): [True: 2.00k, False: 575k]
  |  Branch (1035:44): [True: 2.48k, False: 572k]
  |  Branch (1035:61): [True: 1.87k, False: 570k]
  ------------------
 1036|  8.87k|      if (bsize >= BLOCK_32X32)
  ------------------
  |  Branch (1036:11): [True: 233, False: 8.63k]
  ------------------
 1037|    233|        this_rdc->rdcost = this_rdc->rdcost << 1;
 1038|  8.63k|      else
 1039|  8.63k|        this_rdc->rdcost = 5 * this_rdc->rdcost >> 2;
 1040|  8.87k|    }
 1041|  1.33M|  } else {
 1042|       |    // Bias for speed >= 8 for low spatial variance.
 1043|  1.33M|    if (speed >= 8 && spatial_variance < 150 &&
  ------------------
  |  Branch (1043:9): [True: 689k, False: 647k]
  |  Branch (1043:23): [True: 1.99k, False: 687k]
  ------------------
 1044|  1.99k|        (mv_row > 64 || mv_row < -64 || mv_col > 64 || mv_col < -64))
  ------------------
  |  Branch (1044:10): [True: 19, False: 1.97k]
  |  Branch (1044:25): [True: 18, False: 1.95k]
  |  Branch (1044:41): [True: 8, False: 1.94k]
  |  Branch (1044:56): [True: 24, False: 1.92k]
  ------------------
 1045|     69|      this_rdc->rdcost = 5 * this_rdc->rdcost >> 2;
 1046|  1.33M|  }
 1047|  1.91M|}
nonrd_pickmode.c:update_search_state_nonrd:
   84|  1.20M|    PREDICTION_MODE this_best_mode, const int64_t sse_y) {
   85|  1.20M|  (void)txfm_info;
   86|  1.20M|  BEST_PICKMODE *const best_pickmode = &search_state->best_pickmode;
   87|       |
   88|  1.20M|  best_pickmode->best_sse = sse_y;
   89|  1.20M|  best_pickmode->best_mode = this_best_mode;
   90|  1.20M|  best_pickmode->best_motion_mode = mi->motion_mode;
   91|  1.20M|  best_pickmode->wm_params = mi->wm_params;
   92|  1.20M|  best_pickmode->num_proj_ref = mi->num_proj_ref;
   93|  1.20M|  best_pickmode->best_pred_filter = mi->interp_filters;
   94|  1.20M|  best_pickmode->best_tx_size = mi->tx_size;
   95|  1.20M|  best_pickmode->best_ref_frame = mi->ref_frame[0];
   96|  1.20M|  best_pickmode->best_second_ref_frame = mi->ref_frame[1];
   97|  1.20M|  best_pickmode->best_mode_skip_txfm = search_state->this_rdc.skip_txfm;
   98|  1.20M|  best_pickmode->best_mode_initial_skip_flag =
   99|  1.20M|      (nonskip_rdc->rate == INT_MAX && search_state->this_rdc.skip_txfm);
  ------------------
  |  Branch (99:8): [True: 1.19M, False: 4.00k]
  |  Branch (99:40): [True: 955, False: 1.19M]
  ------------------
  100|  1.20M|}
nonrd_pickmode.c:enable_palette:
 3440|   598k|                                  unsigned int best_intra_sad_norm) {
 3441|   598k|  const unsigned int sad_thresh =
 3442|   598k|      cpi->sf.rt_sf.prune_palette_search_nonrd > 2
  ------------------
  |  Branch (3442:7): [True: 0, False: 598k]
  ------------------
 3443|   598k|          ? (cpi->oxcf.frm_dim_cfg.width * cpi->oxcf.frm_dim_cfg.height <=
  ------------------
  |  Branch (3443:13): [True: 0, False: 0]
  ------------------
 3444|      0|             1280 * 720)
 3445|      0|                ? 6
 3446|      0|                : 12
 3447|   598k|          : 10;
 3448|   598k|  if (!cpi->oxcf.tool_cfg.enable_palette) return false;
  ------------------
  |  Branch (3448:7): [True: 0, False: 598k]
  ------------------
 3449|   598k|  if (!av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  ------------------
  |  Branch (3449:7): [True: 598k, False: 100]
  ------------------
 3450|   598k|                         bsize)) {
 3451|   598k|    return false;
 3452|   598k|  }
 3453|    100|  if (skip_idtx_palette) return false;
  ------------------
  |  Branch (3453:7): [True: 0, False: 100]
  ------------------
 3454|       |
 3455|    100|  if (cpi->sf.rt_sf.prune_palette_search_nonrd > 1 &&
  ------------------
  |  Branch (3455:7): [True: 0, False: 100]
  ------------------
 3456|      0|      ((cpi->rc.high_source_sad && cpi->ppi->rtc_ref.non_reference_frame) ||
  ------------------
  |  Branch (3456:9): [True: 0, False: 0]
  |  Branch (3456:36): [True: 0, False: 0]
  ------------------
 3457|      0|       bsize > BLOCK_16X16)) {
  ------------------
  |  Branch (3457:8): [True: 0, False: 0]
  ------------------
 3458|      0|    return false;
 3459|      0|  }
 3460|       |
 3461|    100|  if (prune_palette_testing_inter(cpi, source_variance) &&
  ------------------
  |  Branch (3461:7): [True: 0, False: 100]
  ------------------
 3462|      0|      best_intra_sad_norm < sad_thresh)
  ------------------
  |  Branch (3462:7): [True: 0, False: 0]
  ------------------
 3463|      0|    return false;
 3464|       |
 3465|    100|  if ((is_mode_intra || force_palette_test) && source_variance > 0 &&
  ------------------
  |  Branch (3465:8): [True: 100, False: 0]
  |  Branch (3465:25): [True: 0, False: 0]
  |  Branch (3465:48): [True: 0, False: 0]
  ------------------
 3466|      0|      !force_zeromv_skip &&
  ------------------
  |  Branch (3466:7): [True: 0, False: 0]
  ------------------
 3467|      0|      (cpi->rc.high_source_sad || source_variance > 300)) {
  ------------------
  |  Branch (3467:8): [True: 0, False: 0]
  |  Branch (3467:35): [True: 0, False: 0]
  ------------------
 3468|      0|    return true;
 3469|    100|  } else {
 3470|       |    return false;
 3471|    100|  }
 3472|    100|}
nonrd_pickmode.c:handle_screen_content_mode_nonrd:
 3324|   598k|    int mi_row) {
 3325|   598k|  AV1_COMMON *const cm = &cpi->common;
 3326|   598k|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
 3327|   598k|  MACROBLOCKD *const xd = &x->e_mbd;
 3328|   598k|  MB_MODE_INFO *const mi = xd->mi[0];
 3329|   598k|  struct macroblockd_plane *const pd = &xd->plane[0];
 3330|   598k|  const int bw = block_size_wide[bsize];
 3331|   598k|  const int bh = block_size_high[bsize];
 3332|   598k|  BEST_PICKMODE *const best_pickmode = &search_state->best_pickmode;
 3333|       |
 3334|       |  // TODO(marpan): Only allow for 8 bit-depth for now, re-enable for 10/12 bit
 3335|       |  // when issue 3359 is fixed.
 3336|   598k|  if (cm->seq_params->bit_depth == 8 && rt_sf->use_idtx_nonrd &&
  ------------------
  |  Branch (3336:7): [True: 563k, False: 34.1k]
  |  Branch (3336:41): [True: 0, False: 563k]
  ------------------
 3337|      0|      !skip_idtx_palette && !cpi->oxcf.txfm_cfg.use_inter_dct_only &&
  ------------------
  |  Branch (3337:7): [True: 0, False: 0]
  |  Branch (3337:29): [True: 0, False: 0]
  ------------------
 3338|      0|      !x->force_zeromv_skip_for_blk &&
  ------------------
  |  Branch (3338:7): [True: 0, False: 0]
  ------------------
 3339|      0|      is_inter_mode(best_pickmode->best_mode) &&
  ------------------
  |  Branch (3339:7): [True: 0, False: 0]
  ------------------
 3340|      0|      best_pickmode->best_pred != NULL &&
  ------------------
  |  Branch (3340:7): [True: 0, False: 0]
  ------------------
 3341|      0|      (!rt_sf->prune_idtx_nonrd ||
  ------------------
  |  Branch (3341:8): [True: 0, False: 0]
  ------------------
 3342|      0|       (rt_sf->prune_idtx_nonrd && bsize <= BLOCK_32X32 &&
  ------------------
  |  Branch (3342:9): [True: 0, False: 0]
  |  Branch (3342:36): [True: 0, False: 0]
  ------------------
 3343|      0|        best_pickmode->best_mode_skip_txfm != 1 && x->source_variance > 200))) {
  ------------------
  |  Branch (3343:9): [True: 0, False: 0]
  |  Branch (3343:52): [True: 0, False: 0]
  ------------------
 3344|      0|    RD_STATS idtx_rdc;
 3345|      0|    av1_init_rd_stats(&idtx_rdc);
 3346|      0|    int is_skippable;
 3347|      0|    this_mode_pred = &tmp_buffer[get_pred_buffer(tmp_buffer, 3)];
 3348|      0|    pd->dst.buf = this_mode_pred->data;
 3349|      0|    pd->dst.stride = bw;
 3350|      0|    const PRED_BUFFER *const best_pred = best_pickmode->best_pred;
 3351|      0|    av1_block_yrd_idtx(x, best_pred->data, best_pred->stride, &idtx_rdc,
 3352|      0|                       &is_skippable, bsize, mi->tx_size);
 3353|      0|    int64_t idx_rdcost_y = RDCOST(x->rdmult, idtx_rdc.rate, idtx_rdc.dist);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3354|      0|    int allow_idtx = 1;
 3355|       |    // Incorporate color into rd cost.
 3356|      0|    if ((x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3356:10): [True: 0, False: 0]
  ------------------
 3357|      0|         x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)])) {
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3357:10): [True: 0, False: 0]
  ------------------
 3358|      0|      RD_STATS rdc_uv;
 3359|      0|      const BLOCK_SIZE uv_bsize =
 3360|      0|          get_plane_block_size(bsize, xd->plane[AOM_PLANE_U].subsampling_x,
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3361|      0|                               xd->plane[AOM_PLANE_U].subsampling_y);
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3362|      0|      if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)]) {
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3362:11): [True: 0, False: 0]
  ------------------
 3363|      0|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3364|      0|                                      AOM_PLANE_U, AOM_PLANE_U);
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                                                    AOM_PLANE_U, AOM_PLANE_U);
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3365|      0|      }
 3366|      0|      if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]) {
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3366:11): [True: 0, False: 0]
  ------------------
 3367|      0|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
 3368|      0|                                      AOM_PLANE_V, AOM_PLANE_V);
  ------------------
  |  |  283|      0|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
                                                    AOM_PLANE_V, AOM_PLANE_V);
  ------------------
  |  |  283|      0|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 3369|      0|      }
 3370|      0|      av1_model_rd_for_sb_uv(cpi, uv_bsize, x, xd, &rdc_uv, AOM_PLANE_U,
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3371|      0|                             AOM_PLANE_V);
  ------------------
  |  |  283|      0|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 3372|      0|      if (rdc_uv.dist < x->min_dist_inter_uv)
  ------------------
  |  Branch (3372:11): [True: 0, False: 0]
  ------------------
 3373|      0|        x->min_dist_inter_uv = rdc_uv.dist;
 3374|      0|      idtx_rdc.rate += rdc_uv.rate;
 3375|      0|      idtx_rdc.dist += rdc_uv.dist;
 3376|      0|      idtx_rdc.skip_txfm = idtx_rdc.skip_txfm && rdc_uv.skip_txfm;
  ------------------
  |  Branch (3376:28): [True: 0, False: 0]
  |  Branch (3376:50): [True: 0, False: 0]
  ------------------
 3377|      0|      if (idx_rdcost_y == 0 && rdc_uv.dist > 0 && x->source_variance < 3000 &&
  ------------------
  |  Branch (3377:11): [True: 0, False: 0]
  |  Branch (3377:32): [True: 0, False: 0]
  |  Branch (3377:51): [True: 0, False: 0]
  ------------------
 3378|      0|          x->content_state_sb.source_sad_nonrd > kMedSad)
  ------------------
  |  Branch (3378:11): [True: 0, False: 0]
  ------------------
 3379|      0|        allow_idtx = 0;
 3380|      0|    }
 3381|      0|    int64_t idx_rdcost = RDCOST(x->rdmult, idtx_rdc.rate, idtx_rdc.dist);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3382|      0|    if (allow_idtx && idx_rdcost < search_state->best_rdc.rdcost) {
  ------------------
  |  Branch (3382:9): [True: 0, False: 0]
  |  Branch (3382:23): [True: 0, False: 0]
  ------------------
 3383|      0|      best_pickmode->tx_type = IDTX;
 3384|      0|      search_state->best_rdc.rdcost = idx_rdcost;
 3385|      0|      best_pickmode->best_mode_skip_txfm = idtx_rdc.skip_txfm;
 3386|      0|      xd->tx_type_map[0] = best_pickmode->tx_type;
 3387|      0|      memset(ctx->tx_type_map, best_pickmode->tx_type, ctx->num_4x4_blk);
 3388|      0|      memset(xd->tx_type_map, best_pickmode->tx_type, ctx->num_4x4_blk);
 3389|      0|    }
 3390|      0|    pd->dst = *orig_dst;
 3391|      0|  }
 3392|       |
 3393|   598k|  if (!try_palette) return;
  ------------------
  |  Branch (3393:7): [True: 598k, False: 68]
  ------------------
 3394|     68|  const unsigned int intra_ref_frame_cost =
 3395|     68|      search_state->ref_costs_single[INTRA_FRAME];
 3396|       |
 3397|     68|  if (!is_mode_intra(best_pickmode->best_mode)) {
  ------------------
  |  Branch (3397:7): [True: 0, False: 68]
  ------------------
 3398|      0|    PRED_BUFFER *const best_pred = best_pickmode->best_pred;
 3399|      0|    if (reuse_inter_pred && best_pred != NULL) {
  ------------------
  |  Branch (3399:9): [True: 0, False: 0]
  |  Branch (3399:29): [True: 0, False: 0]
  ------------------
 3400|      0|      if (best_pred->data == orig_dst->buf) {
  ------------------
  |  Branch (3400:11): [True: 0, False: 0]
  ------------------
 3401|      0|        this_mode_pred = &tmp_buffer[get_pred_buffer(tmp_buffer, 3)];
 3402|      0|        aom_convolve_copy(best_pred->data, best_pred->stride,
 3403|      0|                          this_mode_pred->data, this_mode_pred->stride, bw, bh);
 3404|      0|        best_pickmode->best_pred = this_mode_pred;
 3405|      0|      }
 3406|      0|    }
 3407|      0|    pd->dst = *orig_dst;
 3408|      0|  }
 3409|       |  // Search palette mode for Luma plane in inter frame.
 3410|     68|  av1_search_palette_mode_luma(cpi, x, bsize, intra_ref_frame_cost, ctx,
 3411|     68|                               &search_state->this_rdc,
 3412|     68|                               search_state->best_rdc.rdcost);
 3413|       |  // Update best mode data in search_state
 3414|     68|  if (search_state->this_rdc.rdcost < search_state->best_rdc.rdcost) {
  ------------------
  |  Branch (3414:7): [True: 0, False: 68]
  ------------------
 3415|      0|    best_pickmode->pmi = mi->palette_mode_info;
 3416|      0|    best_pickmode->best_mode = DC_PRED;
 3417|      0|    mi->mv[0].as_int = INVALID_MV;
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
 3418|      0|    mi->mv[1].as_int = INVALID_MV;
  ------------------
  |  |   26|      0|#define INVALID_MV 0x80008000
  ------------------
 3419|      0|    best_pickmode->best_ref_frame = INTRA_FRAME;
 3420|      0|    best_pickmode->best_second_ref_frame = NONE;
 3421|      0|    search_state->best_rdc.rate = search_state->this_rdc.rate;
 3422|      0|    search_state->best_rdc.dist = search_state->this_rdc.dist;
 3423|      0|    search_state->best_rdc.rdcost = search_state->this_rdc.rdcost;
 3424|      0|    best_pickmode->best_mode_skip_txfm = search_state->this_rdc.skip_txfm;
 3425|       |    // Keep the skip_txfm off if the color_sensitivity is set.
 3426|      0|    if (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3426:9): [True: 0, False: 0]
  ------------------
 3427|      0|        x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)])
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (3427:9): [True: 0, False: 0]
  ------------------
 3428|      0|      search_state->this_rdc.skip_txfm = 0;
 3429|       |
 3430|      0|    if (xd->tx_type_map[0] != DCT_DCT)
  ------------------
  |  Branch (3430:9): [True: 0, False: 0]
  ------------------
 3431|       |      av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|      0|  do {                                                    \
  |  |   39|      0|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|      0|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3432|      0|  }
 3433|     68|}
nonrd_pickmode.c:update_thresh_freq_fact:
 1053|  2.38M|                                           PREDICTION_MODE mode) {
 1054|  2.38M|  const THR_MODES thr_mode_idx = mode_idx[ref_frame][mode_offset(mode)];
 1055|  2.38M|  const BLOCK_SIZE min_size = AOMMAX(bsize - 3, BLOCK_4X4);
  ------------------
  |  |   35|  2.38M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 725k, False: 1.66M]
  |  |  ------------------
  ------------------
 1056|  2.38M|  const BLOCK_SIZE max_size = AOMMIN(bsize + 6, BLOCK_128X128);
  ------------------
  |  |   34|  2.38M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.31M, False: 71.1k]
  |  |  ------------------
  ------------------
 1057|  11.9M|  for (BLOCK_SIZE bs = min_size; bs <= max_size; bs += 3) {
  ------------------
  |  Branch (1057:34): [True: 9.53M, False: 2.38M]
  ------------------
 1058|  9.53M|    int *freq_fact = &x->thresh_freq_fact[bs][thr_mode_idx];
 1059|  9.53M|    if (thr_mode_idx == best_mode_idx) {
  ------------------
  |  Branch (1059:9): [True: 2.39M, False: 7.14M]
  ------------------
 1060|  2.39M|      *freq_fact -= (*freq_fact >> 4);
 1061|  7.14M|    } else {
 1062|  7.14M|      *freq_fact =
 1063|  7.14M|          AOMMIN(*freq_fact + RD_THRESH_INC,
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.15M, False: 18.4E]
  |  |  ------------------
  ------------------
 1064|  7.14M|                 cpi->sf.inter_sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
 1065|  7.14M|    }
 1066|  9.53M|  }
 1067|  2.38M|}

av1_index_color_cache:
   93|   932k|                          uint8_t *cache_color_found, int *out_cache_colors) {
   94|   932k|  if (n_cache <= 0) {
  ------------------
  |  Branch (94:7): [True: 470k, False: 462k]
  ------------------
   95|  2.60M|    for (int i = 0; i < n_colors; ++i) out_cache_colors[i] = colors[i];
  ------------------
  |  Branch (95:21): [True: 2.13M, False: 470k]
  ------------------
   96|   470k|    return n_colors;
   97|   470k|  }
   98|   462k|  memset(cache_color_found, 0, n_cache * sizeof(*cache_color_found));
   99|   462k|  int n_in_cache = 0;
  100|   462k|  int in_cache_flags[PALETTE_MAX_SIZE];
  101|   462k|  memset(in_cache_flags, 0, sizeof(in_cache_flags));
  102|  3.07M|  for (int i = 0; i < n_cache && n_in_cache < n_colors; ++i) {
  ------------------
  |  Branch (102:19): [True: 2.61M, False: 458k]
  |  Branch (102:34): [True: 2.61M, False: 3.22k]
  ------------------
  103|  12.3M|    for (int j = 0; j < n_colors; ++j) {
  ------------------
  |  Branch (103:21): [True: 10.4M, False: 1.87M]
  ------------------
  104|  10.4M|      if (colors[j] == color_cache[i]) {
  ------------------
  |  Branch (104:11): [True: 731k, False: 9.76M]
  ------------------
  105|   731k|        in_cache_flags[j] = 1;
  106|   731k|        cache_color_found[i] = 1;
  107|   731k|        ++n_in_cache;
  108|   731k|        break;
  109|   731k|      }
  110|  10.4M|    }
  111|  2.61M|  }
  112|   462k|  int j = 0;
  113|  2.53M|  for (int i = 0; i < n_colors; ++i)
  ------------------
  |  Branch (113:19): [True: 2.07M, False: 462k]
  ------------------
  114|  2.07M|    if (!in_cache_flags[i]) out_cache_colors[j++] = colors[i];
  ------------------
  |  Branch (114:9): [True: 1.34M, False: 731k]
  ------------------
  115|       |  assert(j == n_colors - n_in_cache);
  116|   462k|  return j;
  117|   932k|}
av1_get_palette_delta_bits_v:
  121|   393k|                                 int *min_bits) {
  122|   393k|  const int n = pmi->palette_size[1];
  123|   393k|  const int max_val = 1 << bit_depth;
  124|   393k|  int max_d = 0;
  125|   393k|  *min_bits = bit_depth - 4;
  126|   393k|  *zero_count = 0;
  127|  1.76M|  for (int i = 1; i < n; ++i) {
  ------------------
  |  Branch (127:19): [True: 1.37M, False: 393k]
  ------------------
  128|  1.37M|    const int delta = pmi->palette_colors[2 * PALETTE_MAX_SIZE + i] -
  ------------------
  |  |   63|  1.37M|#define PALETTE_MAX_SIZE 8
  ------------------
  129|  1.37M|                      pmi->palette_colors[2 * PALETTE_MAX_SIZE + i - 1];
  ------------------
  |  |   63|  1.37M|#define PALETTE_MAX_SIZE 8
  ------------------
  130|  1.37M|    const int v = abs(delta);
  131|  1.37M|    const int d = AOMMIN(v, max_val - v);
  ------------------
  |  |   34|  1.37M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 799k, False: 572k]
  |  |  ------------------
  ------------------
  132|  1.37M|    if (d > max_d) max_d = d;
  ------------------
  |  Branch (132:9): [True: 683k, False: 688k]
  ------------------
  133|  1.37M|    if (d == 0) ++(*zero_count);
  ------------------
  |  Branch (133:9): [True: 35.1k, False: 1.33M]
  ------------------
  134|  1.37M|  }
  135|   393k|  return AOMMAX(aom_ceil_log2(max_d + 1), *min_bits);
  ------------------
  |  |   35|   393k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 370k, False: 22.2k]
  |  |  ------------------
  ------------------
  136|   393k|}
av1_palette_color_cost_y:
  140|   497k|                             int bit_depth) {
  141|   497k|  const int n = pmi->palette_size[0];
  142|   497k|  int out_cache_colors[PALETTE_MAX_SIZE];
  143|   497k|  uint8_t cache_color_found[2 * PALETTE_MAX_SIZE];
  144|   497k|  const int n_out_cache =
  145|   497k|      av1_index_color_cache(color_cache, n_cache, pmi->palette_colors, n,
  146|   497k|                            cache_color_found, out_cache_colors);
  147|   497k|  const int total_bits =
  148|   497k|      n_cache + delta_encode_cost(out_cache_colors, n_out_cache, bit_depth, 1);
  149|   497k|  return av1_cost_literal(total_bits);
  ------------------
  |  |   29|   497k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   497k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  150|   497k|}
av1_palette_color_cost_uv:
  154|   368k|                              int bit_depth) {
  155|   368k|  const int n = pmi->palette_size[1];
  156|   368k|  int total_bits = 0;
  157|       |  // U channel palette color cost.
  158|   368k|  int out_cache_colors[PALETTE_MAX_SIZE];
  159|   368k|  uint8_t cache_color_found[2 * PALETTE_MAX_SIZE];
  160|   368k|  const int n_out_cache = av1_index_color_cache(
  161|   368k|      color_cache, n_cache, pmi->palette_colors + PALETTE_MAX_SIZE, n,
  ------------------
  |  |   63|   368k|#define PALETTE_MAX_SIZE 8
  ------------------
  162|   368k|      cache_color_found, out_cache_colors);
  163|   368k|  total_bits +=
  164|   368k|      n_cache + delta_encode_cost(out_cache_colors, n_out_cache, bit_depth, 0);
  165|       |
  166|       |  // V channel palette color cost.
  167|   368k|  int zero_count = 0, min_bits_v = 0;
  168|   368k|  const int bits_v =
  169|   368k|      av1_get_palette_delta_bits_v(pmi, bit_depth, &zero_count, &min_bits_v);
  170|   368k|  const int bits_using_delta =
  171|   368k|      2 + bit_depth + (bits_v + 1) * (n - 1) - zero_count;
  172|   368k|  const int bits_using_raw = bit_depth * n;
  173|   368k|  total_bits += 1 + AOMMIN(bits_using_delta, bits_using_raw);
  ------------------
  |  |   34|   368k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 66.0k, False: 302k]
  |  |  ------------------
  ------------------
  174|   368k|  return av1_cost_literal(total_bits);
  ------------------
  |  |   29|   368k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   368k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  175|   368k|}
av1_rd_pick_palette_intra_sby:
  544|  93.1k|    int *beat_best_rd, PICK_MODE_CONTEXT *ctx, uint8_t *tx_type_map) {
  545|  93.1k|  MACROBLOCKD *const xd = &x->e_mbd;
  546|  93.1k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  547|  93.1k|  assert(!is_inter_block(mbmi));
  548|  93.1k|  assert(av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  549|  93.1k|                           bsize));
  550|  93.1k|  assert(PALETTE_MAX_SIZE == 8);
  551|  93.1k|  assert(PALETTE_MIN_SIZE == 2);
  552|       |
  553|  93.1k|  const int src_stride = x->plane[0].src.stride;
  554|  93.1k|  const uint8_t *const src = x->plane[0].src.buf;
  555|  93.1k|  int block_width, block_height, rows, cols;
  556|  93.1k|  av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows,
  557|  93.1k|                           &cols);
  558|  93.1k|  const SequenceHeader *const seq_params = cpi->common.seq_params;
  559|  93.1k|  const int is_hbd = seq_params->use_highbitdepth;
  560|  93.1k|  const int bit_depth = seq_params->bit_depth;
  561|  93.1k|  const int discount_color_cost = cpi->sf.rt_sf.discount_color_cost;
  562|  93.1k|  int unused;
  563|       |
  564|  93.1k|  int count_buf[1 << 12];  // Maximum (1 << 12) color levels.
  565|  93.1k|  int colors, colors_threshold = 0;
  566|  93.1k|  if (is_hbd) {
  ------------------
  |  Branch (566:7): [True: 93.1k, False: 18.4E]
  ------------------
  567|  93.1k|    int count_buf_8bit[1 << 8];  // Maximum (1 << 8) bins for hbd path.
  568|  93.1k|    av1_count_colors_highbd(src, src_stride, rows, cols, bit_depth, count_buf,
  569|  93.1k|                            count_buf_8bit, &colors_threshold, &colors);
  570|  18.4E|  } else {
  571|  18.4E|    av1_count_colors(src, src_stride, rows, cols, count_buf, &colors);
  572|  18.4E|    colors_threshold = colors;
  573|  18.4E|  }
  574|       |
  575|  93.1k|  uint8_t *const color_map = xd->plane[0].color_index_map;
  576|  93.1k|  int color_thresh_palette = x->color_palette_thresh;
  577|       |  // Allow for larger color_threshold for palette search, based on color,
  578|       |  // scene_change, and block source variance.
  579|       |  // Since palette is Y based, only allow larger threshold if block
  580|       |  // color_dist is below threshold.
  581|  93.1k|  if (cpi->sf.rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (581:7): [True: 0, False: 93.1k]
  ------------------
  582|      0|      cpi->sf.rt_sf.increase_color_thresh_palette && cpi->rc.high_source_sad &&
  ------------------
  |  Branch (582:7): [True: 0, False: 0]
  |  Branch (582:54): [True: 0, False: 0]
  ------------------
  583|      0|      x->source_variance > 50) {
  ------------------
  |  Branch (583:7): [True: 0, False: 0]
  ------------------
  584|      0|    int64_t norm_color_dist = 0;
  585|      0|    if (x->color_sensitivity[0] || x->color_sensitivity[1]) {
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  |  Branch (585:36): [True: 0, False: 0]
  ------------------
  586|      0|      norm_color_dist = x->min_dist_inter_uv >>
  587|      0|                        (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]);
  588|      0|      if (x->color_sensitivity[0] && x->color_sensitivity[1])
  ------------------
  |  Branch (588:11): [True: 0, False: 0]
  |  Branch (588:38): [True: 0, False: 0]
  ------------------
  589|      0|        norm_color_dist = norm_color_dist >> 1;
  590|      0|    }
  591|      0|    if (norm_color_dist < 8000) color_thresh_palette += 20;
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|  }
  593|  93.1k|  if (colors_threshold > 1 && colors_threshold <= color_thresh_palette) {
  ------------------
  |  Branch (593:7): [True: 92.8k, False: 311]
  |  Branch (593:31): [True: 86.4k, False: 6.37k]
  ------------------
  594|  86.4k|    int16_t *const data = x->palette_buffer->kmeans_data_buf;
  595|  86.4k|    int16_t centroids[PALETTE_MAX_SIZE];
  596|  86.4k|    int lower_bound, upper_bound;
  597|  86.4k|    fill_data_and_get_bounds(src, src_stride, rows, cols, is_hbd, data,
  598|  86.4k|                             &lower_bound, &upper_bound);
  599|       |
  600|  86.4k|    mbmi->mode = DC_PRED;
  601|  86.4k|    mbmi->filter_intra_mode_info.use_filter_intra = 0;
  602|       |
  603|  86.4k|    uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  604|  86.4k|    const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
  605|       |
  606|       |    // Find the dominant colors, stored in top_colors[].
  607|  86.4k|    int16_t top_colors[PALETTE_MAX_SIZE] = { 0 };
  608|  86.4k|    find_top_colors(count_buf, bit_depth, AOMMIN(colors, PALETTE_MAX_SIZE),
  ------------------
  |  |   34|  86.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 13.0k, False: 73.4k]
  |  |  ------------------
  ------------------
  609|  86.4k|                    top_colors);
  610|       |
  611|       |    // The following are the approaches used for header rdcost based gating
  612|       |    // for early termination for different values of prune_palette_search_level.
  613|       |    // 0: Pruning based on header rdcost for ascending order palette_size
  614|       |    // search.
  615|       |    // 1: When colors > PALETTE_MIN_SIZE, enabled only for coarse palette_size
  616|       |    // search and for finer search do_header_rd_based_gating parameter is
  617|       |    // explicitly passed as 'false'.
  618|       |    // 2: Enabled only for ascending order palette_size search and for
  619|       |    // descending order search do_header_rd_based_gating parameter is explicitly
  620|       |    // passed as 'false'.
  621|  86.4k|    const bool do_header_rd_based_gating =
  622|  86.4k|        cpi->sf.intra_sf.prune_luma_palette_size_search_level != 0;
  623|       |
  624|       |    // TODO(huisu@google.com): Try to avoid duplicate computation in cases
  625|       |    // where the dominant colors and the k-means results are similar.
  626|  86.4k|    if ((cpi->sf.intra_sf.prune_palette_search_level == 1) &&
  ------------------
  |  Branch (626:9): [True: 0, False: 86.4k]
  ------------------
  627|      0|        (colors > PALETTE_MIN_SIZE)) {
  ------------------
  |  |   65|      0|#define PALETTE_MIN_SIZE 2
  ------------------
  |  Branch (627:9): [True: 0, False: 0]
  ------------------
  628|       |      // Start index and step size below are chosen to evaluate unique
  629|       |      // candidates in neighbor search, in case a winner candidate is found in
  630|       |      // coarse search. Example,
  631|       |      // 1) 8 colors (end_n = 8): 2,3,4,5,6,7,8. start_n is chosen as 2 and step
  632|       |      // size is chosen as 3. Therefore, coarse search will evaluate 2, 5 and 8.
  633|       |      // If winner is found at 5, then 4 and 6 are evaluated. Similarly, for 2
  634|       |      // (3) and 8 (7).
  635|       |      // 2) 7 colors (end_n = 7): 2,3,4,5,6,7. If start_n is chosen as 2 (same
  636|       |      // as for 8 colors) then step size should also be 2, to cover all
  637|       |      // candidates. Coarse search will evaluate 2, 4 and 6. If winner is either
  638|       |      // 2 or 4, 3 will be evaluated. Instead, if start_n=3 and step_size=3,
  639|       |      // coarse search will evaluate 3 and 6. For the winner, unique neighbors
  640|       |      // (3: 2,4 or 6: 5,7) would be evaluated.
  641|       |
  642|       |      // Start index for coarse palette search for dominant colors and k-means
  643|      0|      const uint8_t start_n_lookup_table[PALETTE_MAX_SIZE + 1] = { 0, 0, 0,
  644|      0|                                                                   3, 3, 2,
  645|      0|                                                                   3, 3, 2 };
  646|       |      // Step size for coarse palette search for dominant colors and k-means
  647|      0|      const uint8_t step_size_lookup_table[PALETTE_MAX_SIZE + 1] = { 0, 0, 0,
  648|      0|                                                                     3, 3, 3,
  649|      0|                                                                     3, 3, 3 };
  650|       |
  651|       |      // Choose the start index and step size for coarse search based on number
  652|       |      // of colors
  653|      0|      const int max_n = AOMMIN(colors, PALETTE_MAX_SIZE);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  654|      0|      const int min_n = start_n_lookup_table[max_n];
  655|      0|      const int step_size = step_size_lookup_table[max_n];
  656|      0|      assert(min_n >= PALETTE_MIN_SIZE);
  657|       |      // Perform top color coarse palette search to find the winner candidate
  658|      0|      const int top_color_winner = perform_top_color_palette_search(
  659|      0|          cpi, x, mbmi, bsize, dc_mode_cost, data, top_colors, min_n, max_n + 1,
  660|      0|          step_size, do_header_rd_based_gating, &unused, color_cache, n_cache,
  661|      0|          best_mbmi, best_palette_color_map, best_rd, rate, rate_tokenonly,
  662|      0|          distortion, skippable, beat_best_rd, ctx, tx_type_map,
  663|      0|          discount_color_cost);
  664|       |      // Evaluate neighbors for the winner color (if winner is found) in the
  665|       |      // above coarse search for dominant colors
  666|      0|      if (top_color_winner <= max_n) {
  ------------------
  |  Branch (666:11): [True: 0, False: 0]
  ------------------
  667|      0|        int stage2_min_n, stage2_max_n, stage2_step_size;
  668|      0|        set_stage2_params(&stage2_min_n, &stage2_max_n, &stage2_step_size,
  669|      0|                          top_color_winner, max_n);
  670|       |        // perform finer search for the winner candidate
  671|      0|        perform_top_color_palette_search(
  672|      0|            cpi, x, mbmi, bsize, dc_mode_cost, data, top_colors, stage2_min_n,
  673|      0|            stage2_max_n + 1, stage2_step_size,
  674|      0|            /*do_header_rd_based_gating=*/false, &unused, color_cache, n_cache,
  675|      0|            best_mbmi, best_palette_color_map, best_rd, rate, rate_tokenonly,
  676|      0|            distortion, skippable, beat_best_rd, ctx, tx_type_map,
  677|      0|            discount_color_cost);
  678|      0|      }
  679|       |      // K-means clustering.
  680|       |      // Perform k-means coarse palette search to find the winner candidate
  681|      0|      const int k_means_winner = perform_k_means_palette_search(
  682|      0|          cpi, x, mbmi, bsize, dc_mode_cost, data, lower_bound, upper_bound,
  683|      0|          min_n, max_n + 1, step_size, do_header_rd_based_gating, &unused,
  684|      0|          color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd,
  685|      0|          rate, rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
  686|      0|          tx_type_map, color_map, rows * cols, discount_color_cost);
  687|       |      // Evaluate neighbors for the winner color (if winner is found) in the
  688|       |      // above coarse search for k-means
  689|      0|      if (k_means_winner <= max_n) {
  ------------------
  |  Branch (689:11): [True: 0, False: 0]
  ------------------
  690|      0|        int start_n_stage2, end_n_stage2, step_size_stage2;
  691|      0|        set_stage2_params(&start_n_stage2, &end_n_stage2, &step_size_stage2,
  692|      0|                          k_means_winner, max_n);
  693|       |        // perform finer search for the winner candidate
  694|      0|        perform_k_means_palette_search(
  695|      0|            cpi, x, mbmi, bsize, dc_mode_cost, data, lower_bound, upper_bound,
  696|      0|            start_n_stage2, end_n_stage2 + 1, step_size_stage2,
  697|      0|            /*do_header_rd_based_gating=*/false, &unused, color_cache, n_cache,
  698|      0|            best_mbmi, best_palette_color_map, best_rd, rate, rate_tokenonly,
  699|      0|            distortion, skippable, beat_best_rd, ctx, tx_type_map, color_map,
  700|      0|            rows * cols, discount_color_cost);
  701|      0|      }
  702|  86.4k|    } else {
  703|  86.4k|      const int max_n = AOMMIN(colors, PALETTE_MAX_SIZE),
  ------------------
  |  |   34|  86.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 13.0k, False: 73.4k]
  |  |  ------------------
  ------------------
  704|  86.4k|                min_n = PALETTE_MIN_SIZE;
  ------------------
  |  |   65|  86.4k|#define PALETTE_MIN_SIZE 2
  ------------------
  705|       |      // Perform top color palette search in ascending order
  706|  86.4k|      int last_n_searched = min_n;
  707|  86.4k|      perform_top_color_palette_search(
  708|  86.4k|          cpi, x, mbmi, bsize, dc_mode_cost, data, top_colors, min_n, max_n + 1,
  709|  86.4k|          1, do_header_rd_based_gating, &last_n_searched, color_cache, n_cache,
  710|  86.4k|          best_mbmi, best_palette_color_map, best_rd, rate, rate_tokenonly,
  711|  86.4k|          distortion, skippable, beat_best_rd, ctx, tx_type_map,
  712|  86.4k|          discount_color_cost);
  713|  86.4k|      if (last_n_searched < max_n) {
  ------------------
  |  Branch (713:11): [True: 84.3k, False: 2.08k]
  ------------------
  714|       |        // Search in descending order until we get to the previous best
  715|  84.3k|        perform_top_color_palette_search(
  716|  84.3k|            cpi, x, mbmi, bsize, dc_mode_cost, data, top_colors, max_n,
  717|  84.3k|            last_n_searched, -1, /*do_header_rd_based_gating=*/false, &unused,
  718|  84.3k|            color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd,
  719|  84.3k|            rate, rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
  720|  84.3k|            tx_type_map, discount_color_cost);
  721|  84.3k|      }
  722|       |      // K-means clustering.
  723|  86.4k|      if (colors == PALETTE_MIN_SIZE) {
  ------------------
  |  |   65|  86.4k|#define PALETTE_MIN_SIZE 2
  ------------------
  |  Branch (723:11): [True: 311, False: 86.1k]
  ------------------
  724|       |        // Special case: These colors automatically become the centroids.
  725|    311|        assert(colors == 2);
  726|    311|        centroids[0] = lower_bound;
  727|    311|        centroids[1] = upper_bound;
  728|    311|        palette_rd_y(cpi, x, mbmi, bsize, dc_mode_cost, data, centroids, colors,
  729|    311|                     color_cache, n_cache, /*do_header_rd_based_gating=*/false,
  730|    311|                     best_mbmi, best_palette_color_map, best_rd, rate,
  731|    311|                     rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
  732|    311|                     tx_type_map, NULL, NULL, discount_color_cost);
  733|  86.1k|      } else {
  734|       |        // Perform k-means palette search in ascending order
  735|  86.1k|        last_n_searched = min_n;
  736|  86.1k|        perform_k_means_palette_search(
  737|  86.1k|            cpi, x, mbmi, bsize, dc_mode_cost, data, lower_bound, upper_bound,
  738|  86.1k|            min_n, max_n + 1, 1, do_header_rd_based_gating, &last_n_searched,
  739|  86.1k|            color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd,
  740|  86.1k|            rate, rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
  741|  86.1k|            tx_type_map, color_map, rows * cols, discount_color_cost);
  742|  86.1k|        if (last_n_searched < max_n) {
  ------------------
  |  Branch (742:13): [True: 85.6k, False: 474]
  ------------------
  743|       |          // Search in descending order until we get to the previous best
  744|  85.6k|          perform_k_means_palette_search(
  745|  85.6k|              cpi, x, mbmi, bsize, dc_mode_cost, data, lower_bound, upper_bound,
  746|  85.6k|              max_n, last_n_searched, -1, /*do_header_rd_based_gating=*/false,
  747|  85.6k|              &unused, color_cache, n_cache, best_mbmi, best_palette_color_map,
  748|  85.6k|              best_rd, rate, rate_tokenonly, distortion, skippable,
  749|  85.6k|              beat_best_rd, ctx, tx_type_map, color_map, rows * cols,
  750|  85.6k|              discount_color_cost);
  751|  85.6k|        }
  752|  86.1k|      }
  753|  86.4k|    }
  754|  86.4k|  }
  755|       |
  756|  93.1k|  if (best_mbmi->palette_mode_info.palette_size[0] > 0) {
  ------------------
  |  Branch (756:7): [True: 69.7k, False: 23.3k]
  ------------------
  757|  69.7k|    memcpy(color_map, best_palette_color_map,
  758|  69.7k|           block_width * block_height * sizeof(best_palette_color_map[0]));
  759|  69.7k|  }
  760|  93.1k|  *mbmi = *best_mbmi;
  761|  93.1k|}
av1_rd_pick_palette_intra_sbuv:
  769|  76.6k|                                    uint8_t *skippable) {
  770|  76.6k|  MACROBLOCKD *const xd = &x->e_mbd;
  771|  76.6k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  772|  76.6k|  assert(!is_inter_block(mbmi));
  773|  76.6k|  assert(av1_allow_palette(cpi->common.features.allow_screen_content_tools,
  774|  76.6k|                           mbmi->bsize));
  775|  76.6k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  776|  76.6k|  const BLOCK_SIZE bsize = mbmi->bsize;
  777|  76.6k|  const SequenceHeader *const seq_params = cpi->common.seq_params;
  778|  76.6k|  int this_rate;
  779|  76.6k|  int64_t this_rd;
  780|  76.6k|  int colors_u, colors_v;
  781|  76.6k|  int colors_threshold_u = 0, colors_threshold_v = 0, colors_threshold = 0;
  782|  76.6k|  const int src_stride = x->plane[1].src.stride;
  783|  76.6k|  const uint8_t *const src_u = x->plane[1].src.buf;
  784|  76.6k|  const uint8_t *const src_v = x->plane[2].src.buf;
  785|  76.6k|  uint8_t *const color_map = xd->plane[1].color_index_map;
  786|  76.6k|  RD_STATS tokenonly_rd_stats;
  787|  76.6k|  int plane_block_width, plane_block_height, rows, cols;
  788|  76.6k|  av1_get_block_dimensions(bsize, 1, xd, &plane_block_width,
  789|  76.6k|                           &plane_block_height, &rows, &cols);
  790|       |
  791|  76.6k|  mbmi->uv_mode = UV_DC_PRED;
  792|  76.6k|  if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (792:7): [True: 76.6k, False: 18.4E]
  ------------------
  793|  76.6k|    int count_buf[1 << 12];      // Maximum (1 << 12) color levels.
  794|  76.6k|    int count_buf_8bit[1 << 8];  // Maximum (1 << 8) bins for hbd path.
  795|  76.6k|    av1_count_colors_highbd(src_u, src_stride, rows, cols,
  796|  76.6k|                            seq_params->bit_depth, count_buf, count_buf_8bit,
  797|  76.6k|                            &colors_threshold_u, &colors_u);
  798|  76.6k|    av1_count_colors_highbd(src_v, src_stride, rows, cols,
  799|  76.6k|                            seq_params->bit_depth, count_buf, count_buf_8bit,
  800|  76.6k|                            &colors_threshold_v, &colors_v);
  801|  18.4E|  } else {
  802|  18.4E|    int count_buf[1 << 8];
  803|  18.4E|    av1_count_colors(src_u, src_stride, rows, cols, count_buf, &colors_u);
  804|  18.4E|    av1_count_colors(src_v, src_stride, rows, cols, count_buf, &colors_v);
  805|  18.4E|    colors_threshold_u = colors_u;
  806|  18.4E|    colors_threshold_v = colors_v;
  807|  18.4E|  }
  808|       |
  809|  76.6k|  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
  810|  76.6k|  const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
  811|       |
  812|  76.6k|  colors_threshold = colors_threshold_u > colors_threshold_v
  ------------------
  |  Branch (812:22): [True: 26.9k, False: 49.6k]
  ------------------
  813|  76.6k|                         ? colors_threshold_u
  814|  76.6k|                         : colors_threshold_v;
  815|  76.6k|  if (colors_threshold > 1 && colors_threshold <= 64) {
  ------------------
  |  Branch (815:7): [True: 76.2k, False: 382]
  |  Branch (815:31): [True: 73.0k, False: 3.20k]
  ------------------
  816|  73.0k|    int r, c, n, i, j;
  817|  73.0k|    const int max_itr = 50;
  818|  73.0k|    int lb_u, ub_u, val_u;
  819|  73.0k|    int lb_v, ub_v, val_v;
  820|  73.0k|    int16_t *const data = x->palette_buffer->kmeans_data_buf;
  821|  73.0k|    int16_t centroids[2 * PALETTE_MAX_SIZE];
  822|       |
  823|  73.0k|    uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u);
  ------------------
  |  |   79|  73.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  824|  73.0k|    uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v);
  ------------------
  |  |   79|  73.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  825|  73.0k|    if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (825:9): [True: 73.0k, False: 1]
  ------------------
  826|  73.0k|      lb_u = src_u16[0];
  827|  73.0k|      ub_u = src_u16[0];
  828|  73.0k|      lb_v = src_v16[0];
  829|  73.0k|      ub_v = src_v16[0];
  830|  73.0k|    } else {
  831|      1|      lb_u = src_u[0];
  832|      1|      ub_u = src_u[0];
  833|      1|      lb_v = src_v[0];
  834|      1|      ub_v = src_v[0];
  835|      1|    }
  836|       |
  837|   572k|    for (r = 0; r < rows; ++r) {
  ------------------
  |  Branch (837:17): [True: 499k, False: 73.0k]
  ------------------
  838|  3.52M|      for (c = 0; c < cols; ++c) {
  ------------------
  |  Branch (838:19): [True: 3.02M, False: 499k]
  ------------------
  839|  3.02M|        if (seq_params->use_highbitdepth) {
  ------------------
  |  Branch (839:13): [True: 3.02M, False: 18.4E]
  ------------------
  840|  3.02M|          val_u = src_u16[r * src_stride + c];
  841|  3.02M|          val_v = src_v16[r * src_stride + c];
  842|  3.02M|          data[(r * cols + c) * 2] = val_u;
  843|  3.02M|          data[(r * cols + c) * 2 + 1] = val_v;
  844|  18.4E|        } else {
  845|  18.4E|          val_u = src_u[r * src_stride + c];
  846|  18.4E|          val_v = src_v[r * src_stride + c];
  847|  18.4E|          data[(r * cols + c) * 2] = val_u;
  848|  18.4E|          data[(r * cols + c) * 2 + 1] = val_v;
  849|  18.4E|        }
  850|  3.02M|        if (val_u < lb_u)
  ------------------
  |  Branch (850:13): [True: 129k, False: 2.89M]
  ------------------
  851|   129k|          lb_u = val_u;
  852|  2.89M|        else if (val_u > ub_u)
  ------------------
  |  Branch (852:18): [True: 140k, False: 2.75M]
  ------------------
  853|   140k|          ub_u = val_u;
  854|  3.02M|        if (val_v < lb_v)
  ------------------
  |  Branch (854:13): [True: 127k, False: 2.89M]
  ------------------
  855|   127k|          lb_v = val_v;
  856|  2.89M|        else if (val_v > ub_v)
  ------------------
  |  Branch (856:18): [True: 141k, False: 2.75M]
  ------------------
  857|   141k|          ub_v = val_v;
  858|  3.02M|      }
  859|   499k|    }
  860|       |
  861|  73.0k|    const int colors = colors_u > colors_v ? colors_u : colors_v;
  ------------------
  |  Branch (861:24): [True: 22.2k, False: 50.7k]
  ------------------
  862|  73.0k|    const int max_colors =
  863|  73.0k|        colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors;
  ------------------
  |  |   63|  73.0k|#define PALETTE_MAX_SIZE 8
  ------------------
                      colors > PALETTE_MAX_SIZE ? PALETTE_MAX_SIZE : colors;
  ------------------
  |  |   63|  46.6k|#define PALETTE_MAX_SIZE 8
  ------------------
  |  Branch (863:9): [True: 46.6k, False: 26.4k]
  ------------------
  864|   372k|    for (n = PALETTE_MIN_SIZE; n <= max_colors; ++n) {
  ------------------
  |  |   65|  73.0k|#define PALETTE_MIN_SIZE 2
  ------------------
  |  Branch (864:32): [True: 338k, False: 34.5k]
  ------------------
  865|  1.83M|      for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (865:19): [True: 1.49M, False: 338k]
  ------------------
  866|  1.49M|        centroids[i * 2] = lb_u + (2 * i + 1) * (ub_u - lb_u) / n / 2;
  867|  1.49M|        centroids[i * 2 + 1] = lb_v + (2 * i + 1) * (ub_v - lb_v) / n / 2;
  868|  1.49M|      }
  869|   338k|      av1_k_means(data, centroids, color_map, rows * cols, n, 2, max_itr);
  870|   338k|      optimize_palette_colors(color_cache, n_cache, n, 2, centroids,
  871|   338k|                              cpi->common.seq_params->bit_depth);
  872|       |      // Sort the U channel colors in ascending order.
  873|  1.49M|      for (i = 0; i < 2 * (n - 1); i += 2) {
  ------------------
  |  Branch (873:19): [True: 1.15M, False: 338k]
  ------------------
  874|  1.15M|        int min_idx = i;
  875|  1.15M|        int min_val = centroids[i];
  876|  4.34M|        for (j = i + 2; j < 2 * n; j += 2)
  ------------------
  |  Branch (876:25): [True: 3.18M, False: 1.15M]
  ------------------
  877|  3.18M|          if (centroids[j] < min_val) min_val = centroids[j], min_idx = j;
  ------------------
  |  Branch (877:15): [True: 646k, False: 2.53M]
  ------------------
  878|  1.15M|        if (min_idx != i) {
  ------------------
  |  Branch (878:13): [True: 550k, False: 603k]
  ------------------
  879|   550k|          int temp_u = centroids[i], temp_v = centroids[i + 1];
  880|   550k|          centroids[i] = centroids[min_idx];
  881|   550k|          centroids[i + 1] = centroids[min_idx + 1];
  882|   550k|          centroids[min_idx] = temp_u, centroids[min_idx + 1] = temp_v;
  883|   550k|        }
  884|  1.15M|      }
  885|   338k|      av1_calc_indices(data, centroids, color_map, rows * cols, n, 2);
  886|   338k|      extend_palette_color_map(color_map, cols, rows, plane_block_width,
  887|   338k|                               plane_block_height);
  888|   338k|      pmi->palette_size[1] = n;
  889|  1.01M|      for (i = 1; i < 3; ++i) {
  ------------------
  |  Branch (889:19): [True: 676k, False: 338k]
  ------------------
  890|  3.66M|        for (j = 0; j < n; ++j) {
  ------------------
  |  Branch (890:21): [True: 2.98M, False: 676k]
  ------------------
  891|  2.98M|          if (seq_params->use_highbitdepth)
  ------------------
  |  Branch (891:15): [True: 2.98M, False: 18.4E]
  ------------------
  892|  2.98M|            pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd(
  ------------------
  |  |   63|  2.98M|#define PALETTE_MAX_SIZE 8
  ------------------
  893|  2.98M|                (int)centroids[j * 2 + i - 1], seq_params->bit_depth);
  894|  18.4E|          else
  895|  18.4E|            pmi->palette_colors[i * PALETTE_MAX_SIZE + j] =
  ------------------
  |  |   63|  18.4E|#define PALETTE_MAX_SIZE 8
  ------------------
  896|  18.4E|                clip_pixel((int)centroids[j * 2 + i - 1]);
  897|  2.98M|        }
  898|   676k|      }
  899|       |
  900|   338k|      if (cpi->sf.intra_sf.early_term_chroma_palette_size_search) {
  ------------------
  |  Branch (900:11): [True: 338k, False: 3]
  ------------------
  901|   338k|        const int palette_mode_rate =
  902|   338k|            intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost);
  903|   338k|        const int64_t header_rd = RDCOST(x->rdmult, palette_mode_rate, 0);
  ------------------
  |  |   33|   338k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   338k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   338k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   338k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  904|       |        // Terminate further palette_size search, if header cost corresponding
  905|       |        // to lower palette_size is more than the best_rd.
  906|   338k|        if (header_rd >= *best_rd) break;
  ------------------
  |  Branch (906:13): [True: 38.5k, False: 299k]
  ------------------
  907|   299k|        av1_txfm_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd);
  908|   299k|        if (tokenonly_rd_stats.rate == INT_MAX) continue;
  ------------------
  |  Branch (908:13): [True: 13.8k, False: 285k]
  ------------------
  909|   285k|        this_rate = tokenonly_rd_stats.rate + palette_mode_rate;
  910|   285k|      } else {
  911|      3|        av1_txfm_uvrd(cpi, x, &tokenonly_rd_stats, bsize, *best_rd);
  912|      3|        if (tokenonly_rd_stats.rate == INT_MAX) continue;
  ------------------
  |  Branch (912:13): [True: 0, False: 3]
  ------------------
  913|      3|        this_rate = tokenonly_rd_stats.rate +
  914|      3|                    intra_mode_info_cost_uv(cpi, x, mbmi, bsize, dc_mode_cost);
  915|      3|      }
  916|       |
  917|   285k|      this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist);
  ------------------
  |  |   33|   285k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   285k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   285k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   285k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  918|   285k|      if (this_rd < *best_rd) {
  ------------------
  |  Branch (918:11): [True: 83.5k, False: 202k]
  ------------------
  919|  83.5k|        *best_rd = this_rd;
  920|  83.5k|        *best_mbmi = *mbmi;
  921|  83.5k|        memcpy(best_palette_color_map, color_map,
  922|  83.5k|               plane_block_width * plane_block_height *
  923|  83.5k|                   sizeof(best_palette_color_map[0]));
  924|  83.5k|        *rate = this_rate;
  925|  83.5k|        *distortion = tokenonly_rd_stats.dist;
  926|  83.5k|        *rate_tokenonly = tokenonly_rd_stats.rate;
  927|  83.5k|        *skippable = tokenonly_rd_stats.skip_txfm;
  928|  83.5k|      }
  929|   285k|    }
  930|  73.0k|  }
  931|  76.6k|  if (best_mbmi->palette_mode_info.palette_size[1] > 0) {
  ------------------
  |  Branch (931:7): [True: 33.1k, False: 43.4k]
  ------------------
  932|  33.1k|    memcpy(color_map, best_palette_color_map,
  933|  33.1k|           plane_block_width * plane_block_height *
  934|  33.1k|               sizeof(best_palette_color_map[0]));
  935|  33.1k|  }
  936|  76.6k|}
av1_restore_uv_color_map:
  938|  28.0k|void av1_restore_uv_color_map(const AV1_COMP *cpi, MACROBLOCK *x) {
  939|  28.0k|  MACROBLOCKD *const xd = &x->e_mbd;
  940|  28.0k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  941|  28.0k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  942|  28.0k|  const BLOCK_SIZE bsize = mbmi->bsize;
  943|  28.0k|  int src_stride = x->plane[1].src.stride;
  944|  28.0k|  const uint8_t *const src_u = x->plane[1].src.buf;
  945|  28.0k|  const uint8_t *const src_v = x->plane[2].src.buf;
  946|  28.0k|  int16_t *const data = x->palette_buffer->kmeans_data_buf;
  947|  28.0k|  int16_t centroids[2 * PALETTE_MAX_SIZE];
  948|  28.0k|  uint8_t *const color_map = xd->plane[1].color_index_map;
  949|  28.0k|  int r, c;
  950|  28.0k|  const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u);
  ------------------
  |  |   79|  28.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  951|  28.0k|  const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v);
  ------------------
  |  |   79|  28.0k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  952|  28.0k|  int plane_block_width, plane_block_height, rows, cols;
  953|  28.0k|  av1_get_block_dimensions(bsize, 1, xd, &plane_block_width,
  954|  28.0k|                           &plane_block_height, &rows, &cols);
  955|       |
  956|   227k|  for (r = 0; r < rows; ++r) {
  ------------------
  |  Branch (956:15): [True: 199k, False: 28.0k]
  ------------------
  957|  1.36M|    for (c = 0; c < cols; ++c) {
  ------------------
  |  Branch (957:17): [True: 1.16M, False: 199k]
  ------------------
  958|  1.16M|      if (cpi->common.seq_params->use_highbitdepth) {
  ------------------
  |  Branch (958:11): [True: 1.16M, False: 0]
  ------------------
  959|  1.16M|        data[(r * cols + c) * 2] = src_u16[r * src_stride + c];
  960|  1.16M|        data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c];
  961|  1.16M|      } else {
  962|      0|        data[(r * cols + c) * 2] = src_u[r * src_stride + c];
  963|      0|        data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c];
  964|      0|      }
  965|  1.16M|    }
  966|   199k|  }
  967|       |
  968|  84.2k|  for (r = 1; r < 3; ++r) {
  ------------------
  |  Branch (968:15): [True: 56.1k, False: 28.0k]
  ------------------
  969|   336k|    for (c = 0; c < pmi->palette_size[1]; ++c) {
  ------------------
  |  Branch (969:17): [True: 280k, False: 56.1k]
  ------------------
  970|   280k|      centroids[c * 2 + r - 1] = pmi->palette_colors[r * PALETTE_MAX_SIZE + c];
  ------------------
  |  |   63|   280k|#define PALETTE_MAX_SIZE 8
  ------------------
  971|   280k|    }
  972|  56.1k|  }
  973|       |
  974|  28.0k|  av1_calc_indices(data, centroids, color_map, rows * cols,
  975|  28.0k|                   pmi->palette_size[1], 2);
  976|  28.0k|  extend_palette_color_map(color_map, cols, rows, plane_block_width,
  977|  28.0k|                           plane_block_height);
  978|  28.0k|}
palette.c:delta_encode_cost:
   66|   865k|                             int min_val) {
   67|   865k|  if (num <= 0) return 0;
  ------------------
  |  Branch (67:7): [True: 41.5k, False: 824k]
  ------------------
   68|   824k|  int bits_cost = bit_depth;
   69|   824k|  if (num == 1) return bits_cost;
  ------------------
  |  Branch (69:7): [True: 51.3k, False: 773k]
  ------------------
   70|   773k|  bits_cost += 2;
   71|   773k|  int max_delta = 0;
   72|   773k|  int deltas[PALETTE_MAX_SIZE];
   73|   773k|  const int min_bits = bit_depth - 3;
   74|  3.23M|  for (int i = 1; i < num; ++i) {
  ------------------
  |  Branch (74:19): [True: 2.45M, False: 773k]
  ------------------
   75|  2.45M|    const int delta = colors[i] - colors[i - 1];
   76|  2.45M|    deltas[i - 1] = delta;
   77|  2.45M|    assert(delta >= min_val);
   78|  2.45M|    if (delta > max_delta) max_delta = delta;
  ------------------
  |  Branch (78:9): [True: 1.38M, False: 1.07M]
  ------------------
   79|  2.45M|  }
   80|   773k|  int bits_per_delta = AOMMAX(aom_ceil_log2(max_delta + 1 - min_val), min_bits);
  ------------------
  |  |   35|   773k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 667k, False: 105k]
  |  |  ------------------
  ------------------
   81|   773k|  assert(bits_per_delta <= bit_depth);
   82|   773k|  int range = (1 << bit_depth) - colors[0] - min_val;
   83|  3.23M|  for (int i = 0; i < num - 1; ++i) {
  ------------------
  |  Branch (83:19): [True: 2.45M, False: 773k]
  ------------------
   84|  2.45M|    bits_cost += bits_per_delta;
   85|  2.45M|    range -= deltas[i];
   86|  2.45M|    bits_per_delta = AOMMIN(bits_per_delta, aom_ceil_log2(range));
  ------------------
  |  |   34|  2.45M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.42M, False: 1.03M]
  |  |  ------------------
  ------------------
   87|  2.45M|  }
   88|   773k|  return bits_cost;
   89|   824k|}
palette.c:fill_data_and_get_bounds:
  453|  86.4k|                                            int *upper_bound) {
  454|  86.4k|  if (is_high_bitdepth) {
  ------------------
  |  Branch (454:7): [True: 86.4k, False: 1]
  ------------------
  455|  86.4k|    const uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src);
  ------------------
  |  |   79|  86.4k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  456|  86.4k|    *lower_bound = *upper_bound = src_ptr[0];
  457|   799k|    for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (457:21): [True: 712k, False: 86.4k]
  ------------------
  458|  6.64M|      for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (458:23): [True: 5.92M, False: 712k]
  ------------------
  459|  5.92M|        const int val = src_ptr[c];
  460|  5.92M|        data[c] = (int16_t)val;
  461|  5.92M|        *lower_bound = AOMMIN(*lower_bound, val);
  ------------------
  |  |   34|  5.92M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.73M, False: 1.19M]
  |  |  ------------------
  ------------------
  462|  5.92M|        *upper_bound = AOMMAX(*upper_bound, val);
  ------------------
  |  |   35|  5.92M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 4.78M, False: 1.14M]
  |  |  ------------------
  ------------------
  463|  5.92M|      }
  464|   712k|      src_ptr += src_stride;
  465|   712k|      data += cols;
  466|   712k|    }
  467|  86.4k|    return;
  468|  86.4k|  }
  469|       |
  470|       |  // low bit depth
  471|      1|  *lower_bound = *upper_bound = src[0];
  472|      1|  for (int r = 0; r < rows; ++r) {
  ------------------
  |  Branch (472:19): [True: 0, False: 1]
  ------------------
  473|      0|    for (int c = 0; c < cols; ++c) {
  ------------------
  |  Branch (473:21): [True: 0, False: 0]
  ------------------
  474|      0|      const int val = src[c];
  475|      0|      data[c] = (int16_t)val;
  476|      0|      *lower_bound = AOMMIN(*lower_bound, val);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  477|      0|      *upper_bound = AOMMAX(*upper_bound, val);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  478|      0|    }
  479|      0|    src += src_stride;
  480|      0|    data += cols;
  481|      0|  }
  482|      1|}
palette.c:find_top_colors:
  503|  86.4k|                            int n_colors, int16_t *top_colors) {
  504|       |  // Top color array, serving as a priority queue if more than n_colors are
  505|       |  // found.
  506|  86.4k|  struct ColorCount top_color_counts[PALETTE_MAX_SIZE] = { { 0 } };
  507|  86.4k|  int n_color_count = 0;
  508|   223M|  for (int i = 0; i < (1 << bit_depth); ++i) {
  ------------------
  |  Branch (508:19): [True: 223M, False: 86.4k]
  ------------------
  509|   223M|    if (count_buf[i] > 0) {
  ------------------
  |  Branch (509:9): [True: 2.32M, False: 220M]
  ------------------
  510|  2.32M|      if (n_color_count < n_colors) {
  ------------------
  |  Branch (510:11): [True: 654k, False: 1.66M]
  ------------------
  511|       |        // Keep adding to the top colors.
  512|   654k|        top_color_counts[n_color_count].index = i;
  513|   654k|        top_color_counts[n_color_count].count = count_buf[i];
  514|   654k|        ++n_color_count;
  515|   654k|        if (n_color_count == n_colors) {
  ------------------
  |  Branch (515:13): [True: 86.4k, False: 568k]
  ------------------
  516|  86.4k|          qsort(top_color_counts, n_colors, sizeof(top_color_counts[0]),
  517|  86.4k|                color_count_comp);
  518|  86.4k|        }
  519|  1.66M|      } else {
  520|       |        // Check the worst in the sorted top.
  521|  1.66M|        if (count_buf[i] > top_color_counts[n_colors - 1].count) {
  ------------------
  |  Branch (521:13): [True: 188k, False: 1.47M]
  ------------------
  522|   188k|          int j = n_colors - 1;
  523|       |          // Move up to the best one.
  524|   837k|          while (j >= 1 && count_buf[i] > top_color_counts[j - 1].count) --j;
  ------------------
  |  Branch (524:18): [True: 819k, False: 17.3k]
  |  Branch (524:28): [True: 648k, False: 171k]
  ------------------
  525|   188k|          memmove(top_color_counts + j + 1, top_color_counts + j,
  526|   188k|                  (n_colors - j - 1) * sizeof(top_color_counts[0]));
  527|   188k|          top_color_counts[j].index = i;
  528|   188k|          top_color_counts[j].count = count_buf[i];
  529|   188k|        }
  530|  1.66M|      }
  531|  2.32M|    }
  532|   223M|  }
  533|  86.4k|  assert(n_color_count == n_colors);
  534|       |
  535|   741k|  for (int i = 0; i < n_colors; ++i) {
  ------------------
  |  Branch (535:19): [True: 654k, False: 86.4k]
  ------------------
  536|   654k|    top_colors[i] = top_color_counts[i].index;
  537|   654k|  }
  538|  86.4k|}
palette.c:color_count_comp:
  493|  1.04M|static int color_count_comp(const void *c1, const void *c2) {
  494|  1.04M|  const struct ColorCount *color_count1 = (const struct ColorCount *)c1;
  495|  1.04M|  const struct ColorCount *color_count2 = (const struct ColorCount *)c2;
  496|  1.04M|  if (color_count1->count > color_count2->count) return -1;
  ------------------
  |  Branch (496:7): [True: 279k, False: 766k]
  ------------------
  497|   766k|  if (color_count1->count < color_count2->count) return 1;
  ------------------
  |  Branch (497:7): [True: 158k, False: 607k]
  ------------------
  498|   607k|  if (color_count1->index < color_count2->index) return -1;
  ------------------
  |  Branch (498:7): [True: 607k, False: 18.4E]
  ------------------
  499|  18.4E|  return 1;
  500|   607k|}
palette.c:perform_top_color_palette_search:
  343|   170k|    uint8_t *tx_type_map, int discount_color_cost) {
  344|   170k|  int16_t centroids[PALETTE_MAX_SIZE];
  345|   170k|  int n = start_n;
  346|   170k|  int top_color_winner = end_n;
  347|       |  /* clang-format off */
  348|   170k|  assert(IMPLIES(step_size < 0, start_n > end_n));
  349|       |  /* clang-format on */
  350|   170k|  assert(IMPLIES(step_size > 0, start_n < end_n));
  351|   272k|  while (!is_iter_over(n, end_n, step_size)) {
  ------------------
  |  Branch (351:10): [True: 269k, False: 2.93k]
  ------------------
  352|   269k|    int beat_best_palette_rd = 0;
  353|   269k|    bool do_header_rd_based_breakout = false;
  354|   269k|    memcpy(centroids, top_colors, n * sizeof(top_colors[0]));
  355|   269k|    palette_rd_y(cpi, x, mbmi, bsize, dc_mode_cost, data, centroids, n,
  356|   269k|                 color_cache, n_cache, do_header_rd_based_gating, best_mbmi,
  357|   269k|                 best_palette_color_map, best_rd, rate, rate_tokenonly,
  358|   269k|                 distortion, skippable, beat_best_rd, ctx, tx_type_map,
  359|   269k|                 &beat_best_palette_rd, &do_header_rd_based_breakout,
  360|   269k|                 discount_color_cost);
  361|   269k|    *last_n_searched = n;
  362|   269k|    if (do_header_rd_based_breakout) {
  ------------------
  |  Branch (362:9): [True: 0, False: 269k]
  ------------------
  363|       |      // Terminate palette_size search by setting last_n_searched to end_n.
  364|      0|      *last_n_searched = end_n;
  365|      0|      break;
  366|      0|    }
  367|   269k|    if (beat_best_palette_rd) {
  ------------------
  |  Branch (367:9): [True: 102k, False: 167k]
  ------------------
  368|   102k|      top_color_winner = n;
  369|   167k|    } else if (cpi->sf.intra_sf.prune_palette_search_level == 2) {
  ------------------
  |  Branch (369:16): [True: 167k, False: 18.4E]
  ------------------
  370|       |      // At search level 2, we return immediately if we don't see an improvement
  371|   167k|      return top_color_winner;
  372|   167k|    }
  373|   102k|    n += step_size;
  374|   102k|  }
  375|  2.93k|  return top_color_winner;
  376|   170k|}
palette.c:is_iter_over:
  326|   525k|static inline int is_iter_over(int curr_idx, int end_idx, int step_size) {
  327|   525k|  assert(step_size != 0);
  328|   525k|  return (step_size > 0) ? curr_idx >= end_idx : curr_idx <= end_idx;
  ------------------
  |  Branch (328:10): [True: 288k, False: 237k]
  ------------------
  329|   525k|}
palette.c:perform_k_means_palette_search:
  391|   171k|    int discount_color_cost) {
  392|   171k|  int16_t centroids[PALETTE_MAX_SIZE];
  393|   171k|  const int max_itr = 50;
  394|   171k|  int n = start_n;
  395|   171k|  int top_color_winner = end_n;
  396|       |  /* clang-format off */
  397|   171k|  assert(IMPLIES(step_size < 0, start_n > end_n));
  398|       |  /* clang-format on */
  399|   171k|  assert(IMPLIES(step_size > 0, start_n < end_n));
  400|   252k|  while (!is_iter_over(n, end_n, step_size)) {
  ------------------
  |  Branch (400:10): [True: 252k, False: 433]
  ------------------
  401|   252k|    int beat_best_palette_rd = 0;
  402|   252k|    bool do_header_rd_based_breakout = false;
  403|  1.44M|    for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (403:21): [True: 1.19M, False: 252k]
  ------------------
  404|  1.19M|      centroids[i] =
  405|  1.19M|          lower_bound + (2 * i + 1) * (upper_bound - lower_bound) / n / 2;
  406|  1.19M|    }
  407|   252k|    av1_k_means(data, centroids, color_map, data_points, n, 1, max_itr);
  408|   252k|    palette_rd_y(cpi, x, mbmi, bsize, dc_mode_cost, data, centroids, n,
  409|   252k|                 color_cache, n_cache, do_header_rd_based_gating, best_mbmi,
  410|   252k|                 best_palette_color_map, best_rd, rate, rate_tokenonly,
  411|   252k|                 distortion, skippable, beat_best_rd, ctx, tx_type_map,
  412|   252k|                 &beat_best_palette_rd, &do_header_rd_based_breakout,
  413|   252k|                 discount_color_cost);
  414|   252k|    *last_n_searched = n;
  415|   252k|    if (do_header_rd_based_breakout) {
  ------------------
  |  Branch (415:9): [True: 0, False: 252k]
  ------------------
  416|       |      // Terminate palette_size search by setting last_n_searched to end_n.
  417|      0|      *last_n_searched = end_n;
  418|      0|      break;
  419|      0|    }
  420|   252k|    if (beat_best_palette_rd) {
  ------------------
  |  Branch (420:9): [True: 81.0k, False: 171k]
  ------------------
  421|  81.0k|      top_color_winner = n;
  422|   171k|    } else if (cpi->sf.intra_sf.prune_palette_search_level == 2) {
  ------------------
  |  Branch (422:16): [True: 171k, False: 18.4E]
  ------------------
  423|       |      // At search level 2, we return immediately if we don't see an improvement
  424|   171k|      return top_color_winner;
  425|   171k|    }
  426|  80.9k|    n += step_size;
  427|  80.9k|  }
  428|    433|  return top_color_winner;
  429|   171k|}
palette.c:palette_rd_y:
  237|   522k|    int discount_color_cost) {
  238|   522k|  if (do_header_rd_based_breakout != NULL) *do_header_rd_based_breakout = false;
  ------------------
  |  Branch (238:7): [True: 522k, False: 307]
  ------------------
  239|   522k|  optimize_palette_colors(color_cache, n_cache, n, 1, centroids,
  240|   522k|                          cpi->common.seq_params->bit_depth);
  241|   522k|  const int num_unique_colors = remove_duplicates(centroids, n);
  242|   522k|  if (num_unique_colors < PALETTE_MIN_SIZE) {
  ------------------
  |  |   65|   522k|#define PALETTE_MIN_SIZE 2
  ------------------
  |  Branch (242:7): [True: 10.0k, False: 512k]
  ------------------
  243|       |    // Too few unique colors to create a palette. And DC_PRED will work
  244|       |    // well for that case anyway. So skip.
  245|  10.0k|    return;
  246|  10.0k|  }
  247|   512k|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  248|   512k|  if (cpi->common.seq_params->use_highbitdepth) {
  ------------------
  |  Branch (248:7): [True: 512k, False: 18.4E]
  ------------------
  249|  2.79M|    for (int i = 0; i < num_unique_colors; ++i) {
  ------------------
  |  Branch (249:21): [True: 2.28M, False: 512k]
  ------------------
  250|  2.28M|      pmi->palette_colors[i] = clip_pixel_highbd(
  251|  2.28M|          (int)centroids[i], cpi->common.seq_params->bit_depth);
  252|  2.28M|    }
  253|  18.4E|  } else {
  254|  18.4E|    for (int i = 0; i < num_unique_colors; ++i) {
  ------------------
  |  Branch (254:21): [True: 0, False: 18.4E]
  ------------------
  255|      0|      pmi->palette_colors[i] = clip_pixel(centroids[i]);
  256|      0|    }
  257|  18.4E|  }
  258|   512k|  pmi->palette_size[0] = num_unique_colors;
  259|   512k|  MACROBLOCKD *const xd = &x->e_mbd;
  260|   512k|  uint8_t *const color_map = xd->plane[0].color_index_map;
  261|   512k|  int block_width, block_height, rows, cols;
  262|   512k|  av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows,
  263|   512k|                           &cols);
  264|   512k|  av1_calc_indices(data, centroids, color_map, rows * cols, num_unique_colors,
  265|   512k|                   1);
  266|   512k|  extend_palette_color_map(color_map, cols, rows, block_width, block_height);
  267|       |
  268|   512k|  RD_STATS tokenonly_rd_stats;
  269|   512k|  int this_rate;
  270|       |
  271|   512k|  if (do_header_rd_based_gating) {
  ------------------
  |  Branch (271:7): [True: 0, False: 512k]
  ------------------
  272|      0|    assert(do_header_rd_based_breakout != NULL);
  273|      0|    const int palette_mode_rate = intra_mode_info_cost_y(
  274|      0|        cpi, x, mbmi, bsize, dc_mode_cost, discount_color_cost);
  275|      0|    const int64_t header_rd = RDCOST(x->rdmult, palette_mode_rate, 0);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  276|       |    // Less aggressive pruning when prune_luma_palette_size_search_level == 1.
  277|      0|    const int header_rd_shift =
  278|      0|        (cpi->sf.intra_sf.prune_luma_palette_size_search_level == 1) ? 1 : 0;
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  ------------------
  279|       |    // Terminate further palette_size search, if the header cost corresponding
  280|       |    // to lower palette_size is more than *best_rd << header_rd_shift. This
  281|       |    // logic is implemented with a right shift in the LHS to prevent a possible
  282|       |    // overflow with the left shift in RHS.
  283|      0|    if ((header_rd >> header_rd_shift) > *best_rd) {
  ------------------
  |  Branch (283:9): [True: 0, False: 0]
  ------------------
  284|      0|      *do_header_rd_based_breakout = true;
  285|      0|      return;
  286|      0|    }
  287|      0|    av1_pick_uniform_tx_size_type_yrd(cpi, x, &tokenonly_rd_stats, bsize,
  288|      0|                                      *best_rd);
  289|      0|    if (tokenonly_rd_stats.rate == INT_MAX) return;
  ------------------
  |  Branch (289:9): [True: 0, False: 0]
  ------------------
  290|      0|    this_rate = tokenonly_rd_stats.rate + palette_mode_rate;
  291|   512k|  } else {
  292|   512k|    av1_pick_uniform_tx_size_type_yrd(cpi, x, &tokenonly_rd_stats, bsize,
  293|   512k|                                      *best_rd);
  294|   512k|    if (tokenonly_rd_stats.rate == INT_MAX) return;
  ------------------
  |  Branch (294:9): [True: 19.2k, False: 493k]
  ------------------
  295|   493k|    this_rate = tokenonly_rd_stats.rate +
  296|   493k|                intra_mode_info_cost_y(cpi, x, mbmi, bsize, dc_mode_cost,
  297|   493k|                                       discount_color_cost);
  298|   493k|  }
  299|       |
  300|   493k|  int64_t this_rd = RDCOST(x->rdmult, this_rate, tokenonly_rd_stats.dist);
  ------------------
  |  |   33|   493k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   493k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   493k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   493k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  301|   493k|  if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(mbmi->bsize)) {
  ------------------
  |  Branch (301:7): [True: 493k, False: 10]
  |  Branch (301:42): [True: 493k, False: 4]
  ------------------
  302|   493k|    tokenonly_rd_stats.rate -= tx_size_cost(x, bsize, mbmi->tx_size);
  303|   493k|  }
  304|       |  // Collect mode stats for multiwinner mode processing
  305|   493k|  const int txfm_search_done = 1;
  306|   493k|  store_winner_mode_stats(
  307|   493k|      cpi, x, mbmi, NULL, NULL, NULL, THR_DC, color_map, bsize, this_rd,
  308|   493k|      cpi->sf.winner_mode_sf.multi_winner_mode_type, txfm_search_done);
  309|   493k|  if (this_rd < *best_rd) {
  ------------------
  |  Branch (309:7): [True: 183k, False: 310k]
  ------------------
  310|   183k|    *best_rd = this_rd;
  311|       |    // Setting beat_best_rd flag because current mode rd is better than best_rd.
  312|       |    // This flag need to be updated only for palette evaluation in key frames
  313|   183k|    if (beat_best_rd) *beat_best_rd = 1;
  ------------------
  |  Branch (313:9): [True: 11.6k, False: 171k]
  ------------------
  314|   183k|    memcpy(best_palette_color_map, color_map,
  315|   183k|           block_width * block_height * sizeof(color_map[0]));
  316|   183k|    *best_mbmi = *mbmi;
  317|   183k|    av1_copy_array(tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   183k|  do {                                                    \
  |  |   39|   183k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   183k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   183k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 183k]
  |  |  ------------------
  ------------------
  318|   183k|    if (rate) *rate = this_rate;
  ------------------
  |  Branch (318:9): [True: 183k, False: 18.4E]
  ------------------
  319|   183k|    if (rate_tokenonly) *rate_tokenonly = tokenonly_rd_stats.rate;
  ------------------
  |  Branch (319:9): [True: 11.6k, False: 171k]
  ------------------
  320|   183k|    if (distortion) *distortion = tokenonly_rd_stats.dist;
  ------------------
  |  Branch (320:9): [True: 183k, False: 18.4E]
  ------------------
  321|   183k|    if (skippable) *skippable = tokenonly_rd_stats.skip_txfm;
  ------------------
  |  Branch (321:9): [True: 183k, False: 18.4E]
  ------------------
  322|   183k|    if (beat_best_palette_rd) *beat_best_palette_rd = 1;
  ------------------
  |  Branch (322:9): [True: 183k, False: 18.4E]
  ------------------
  323|   183k|  }
  324|   493k|}
palette.c:remove_duplicates:
   51|   522k|static int remove_duplicates(int16_t *centroids, int num_centroids) {
   52|   522k|  int num_unique;  // number of unique centroids
   53|   522k|  int i;
   54|   522k|  qsort(centroids, num_centroids, sizeof(*centroids), int16_comparer);
   55|       |  // Remove duplicates.
   56|   522k|  num_unique = 1;
   57|  2.43M|  for (i = 1; i < num_centroids; ++i) {
  ------------------
  |  Branch (57:15): [True: 1.91M, False: 522k]
  ------------------
   58|  1.91M|    if (centroids[i] != centroids[i - 1]) {  // found a new unique centroid
  ------------------
  |  Branch (58:9): [True: 1.77M, False: 137k]
  ------------------
   59|  1.77M|      centroids[num_unique++] = centroids[i];
   60|  1.77M|    }
   61|  1.91M|  }
   62|   522k|  return num_unique;
   63|   522k|}
palette.c:int16_comparer:
   35|  3.22M|static int int16_comparer(const void *a, const void *b) {
   36|  3.22M|  return (*(int16_t *)a - *(int16_t *)b);
   37|  3.22M|}
palette.c:optimize_palette_colors:
  205|   860k|                                           int16_t *centroids, int bit_depth) {
  206|   860k|  if (n_cache <= 0) return;
  ------------------
  |  Branch (206:7): [True: 454k, False: 406k]
  ------------------
  207|  2.28M|  for (int i = 0; i < n_colors * stride; i += stride) {
  ------------------
  |  Branch (207:19): [True: 1.87M, False: 406k]
  ------------------
  208|  1.87M|    int min_diff = abs((int)centroids[i] - (int)color_cache[0]);
  209|  1.87M|    int idx = 0;
  210|  10.9M|    for (int j = 1; j < n_cache; ++j) {
  ------------------
  |  Branch (210:21): [True: 9.05M, False: 1.87M]
  ------------------
  211|  9.05M|      const int this_diff = abs((int)centroids[i] - (int)color_cache[j]);
  212|  9.05M|      if (this_diff < min_diff) {
  ------------------
  |  Branch (212:11): [True: 3.82M, False: 5.22M]
  ------------------
  213|  3.82M|        min_diff = this_diff;
  214|  3.82M|        idx = j;
  215|  3.82M|      }
  216|  9.05M|    }
  217|  1.87M|    const int min_threshold = 4 << (bit_depth - 8);
  218|  1.87M|    if (min_diff <= min_threshold) centroids[i] = color_cache[idx];
  ------------------
  |  Branch (218:9): [True: 779k, False: 1.09M]
  ------------------
  219|  1.87M|  }
  220|   406k|}
palette.c:extend_palette_color_map:
  182|   878k|                                            int new_width, int new_height) {
  183|   878k|  int j;
  184|   878k|  assert(new_width >= orig_width);
  185|   878k|  assert(new_height >= orig_height);
  186|   878k|  if (new_width == orig_width && new_height == orig_height) return;
  ------------------
  |  Branch (186:7): [True: 875k, False: 3.66k]
  |  Branch (186:34): [True: 872k, False: 3.13k]
  ------------------
  187|       |
  188|   107k|  for (j = orig_height - 1; j >= 0; --j) {
  ------------------
  |  Branch (188:29): [True: 100k, False: 6.79k]
  ------------------
  189|   100k|    memmove(color_map + j * new_width, color_map + j * orig_width, orig_width);
  190|       |    // Copy last column to extra columns.
  191|   100k|    memset(color_map + j * new_width + orig_width,
  192|   100k|           color_map[j * new_width + orig_width - 1], new_width - orig_width);
  193|   100k|  }
  194|       |  // Copy last row to extra rows.
  195|  50.8k|  for (j = orig_height; j < new_height; ++j) {
  ------------------
  |  Branch (195:25): [True: 44.0k, False: 6.79k]
  ------------------
  196|  44.0k|    memcpy(color_map + j * new_width, color_map + (orig_height - 1) * new_width,
  197|  44.0k|           new_width);
  198|  44.0k|  }
  199|  6.79k|}

palette.c:av1_k_means:
   90|   590k|                               int max_itr) {
   91|   590k|  assert(n > 0);
   92|   590k|  assert(k > 0);
   93|   590k|  if (dim == 1) {
  ------------------
  |  Branch (93:7): [True: 252k, False: 338k]
  ------------------
   94|   252k|    AV1_K_MEANS_RENAME(av1_k_means, 1)(data, centroids, indices, n, k, max_itr);
  ------------------
  |  |   29|   252k|#define AV1_K_MEANS_RENAME(func, dim) func##_dim##dim
  ------------------
   95|   338k|  } else if (dim == 2) {
  ------------------
  |  Branch (95:14): [True: 338k, False: 18.4E]
  ------------------
   96|   338k|    AV1_K_MEANS_RENAME(av1_k_means, 2)(data, centroids, indices, n, k, max_itr);
  ------------------
  |  |   29|   338k|#define AV1_K_MEANS_RENAME(func, dim) func##_dim##dim
  ------------------
   97|  18.4E|  } else {
   98|       |    assert(0 && "Untemplated k means dimension");
   99|  18.4E|  }
  100|   590k|}
palette.c:av1_calc_indices:
   56|   878k|                                    int n, int k, int dim) {
   57|   878k|  assert(n > 0);
   58|   878k|  assert(k > 0);
   59|   878k|  if (dim == 1) {
  ------------------
  |  Branch (59:7): [True: 512k, False: 366k]
  ------------------
   60|   512k|    av1_calc_indices_dim1(data, centroids, indices, /*total_dist=*/NULL, n, k);
   61|   512k|  } else if (dim == 2) {
  ------------------
  |  Branch (61:14): [True: 366k, False: 18.4E]
  ------------------
   62|   366k|    av1_calc_indices_dim2(data, centroids, indices, /*total_dist=*/NULL, n, k);
   63|  18.4E|  } else {
   64|       |    assert(0 && "Untemplated k means dimension");
   65|  18.4E|  }
   66|   878k|}

av1_set_offsets_without_segment_id:
  663|  12.1M|                                        int mi_col, BLOCK_SIZE bsize) {
  664|  12.1M|  const AV1_COMMON *const cm = &cpi->common;
  665|  12.1M|  const int num_planes = av1_num_planes(cm);
  666|  12.1M|  MACROBLOCKD *const xd = &x->e_mbd;
  667|  12.1M|  assert(bsize < BLOCK_SIZES_ALL);
  668|  12.1M|  const int mi_width = mi_size_wide[bsize];
  669|  12.1M|  const int mi_height = mi_size_high[bsize];
  670|       |
  671|  12.1M|  set_mode_info_offsets(&cpi->common.mi_params, &cpi->mbmi_ext_info, x, xd,
  672|  12.1M|                        mi_row, mi_col);
  673|       |
  674|  12.1M|  set_entropy_context(xd, mi_row, mi_col, num_planes);
  675|  12.1M|  xd->above_txfm_context = cm->above_contexts.txfm[tile->tile_row] + mi_col;
  676|  12.1M|  xd->left_txfm_context =
  677|  12.1M|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  12.1M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  12.1M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  12.1M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  12.1M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  12.1M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  678|       |
  679|       |  // Set up destination pointers.
  680|  12.1M|  av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
  681|  12.1M|                       num_planes);
  682|       |
  683|       |  // Set up limit values for MV components.
  684|       |  // Mv beyond the range do not produce new/different prediction block.
  685|  12.1M|  av1_set_mv_limits(&cm->mi_params, &x->mv_limits, mi_row, mi_col, mi_height,
  686|  12.1M|                    mi_width, cpi->oxcf.border_in_pixels);
  687|       |
  688|  12.1M|  set_plane_n4(xd, mi_width, mi_height, num_planes);
  689|       |
  690|       |  // Set up distance of MB to edge of frame in 1/8th pel units.
  691|  12.1M|  assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
  692|  12.1M|  set_mi_row_col(xd, tile, mi_row, mi_height, mi_col, mi_width,
  693|  12.1M|                 cm->mi_params.mi_rows, cm->mi_params.mi_cols);
  694|       |
  695|  12.1M|  set_pixels_to_frame_edge(x, mi_width, mi_height, mi_col, mi_row,
  696|  12.1M|                           cm->mi_params.mi_cols, cm->mi_params.mi_rows,
  697|  12.1M|                           cm->width, cm->height, cpi->do_border_pad);
  698|       |
  699|       |  // Set up source buffers.
  700|  12.1M|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize);
  701|       |
  702|       |  // required by av1_append_sub8x8_mvs_for_idx() and av1_find_best_ref_mvs()
  703|  12.1M|  xd->tile = *tile;
  704|  12.1M|}
av1_set_offsets:
  708|  5.80M|                     BLOCK_SIZE bsize) {
  709|  5.80M|  const AV1_COMMON *const cm = &cpi->common;
  710|  5.80M|  const struct segmentation *const seg = &cm->seg;
  711|  5.80M|  MACROBLOCKD *const xd = &x->e_mbd;
  712|  5.80M|  MB_MODE_INFO *mbmi;
  713|       |
  714|  5.80M|  av1_set_offsets_without_segment_id(cpi, tile, x, mi_row, mi_col, bsize);
  715|       |
  716|       |  // Setup segment ID.
  717|  5.80M|  mbmi = xd->mi[0];
  718|  5.80M|  mbmi->segment_id = 0;
  719|  5.80M|  if (seg->enabled) {
  ------------------
  |  Branch (719:7): [True: 0, False: 5.80M]
  ------------------
  720|      0|    if (seg->enabled && !cpi->vaq_refresh) {
  ------------------
  |  Branch (720:9): [True: 0, False: 0]
  |  Branch (720:25): [True: 0, False: 0]
  ------------------
  721|      0|      const uint8_t *const map =
  722|      0|          seg->update_map ? cpi->enc_seg.map : cm->last_frame_seg_map;
  ------------------
  |  Branch (722:11): [True: 0, False: 0]
  ------------------
  723|      0|      mbmi->segment_id =
  724|      0|          map ? get_segment_id(&cm->mi_params, map, bsize, mi_row, mi_col) : 0;
  ------------------
  |  Branch (724:11): [True: 0, False: 0]
  ------------------
  725|      0|    }
  726|      0|    av1_init_plane_quantizers(cpi, x, mbmi->segment_id, 0);
  727|      0|  }
  728|       |#ifndef NDEBUG
  729|       |  x->last_set_offsets_loc.mi_row = mi_row;
  730|       |  x->last_set_offsets_loc.mi_col = mi_col;
  731|       |  x->last_set_offsets_loc.bsize = bsize;
  732|       |#endif  // NDEBUG
  733|  5.80M|}
av1_nonrd_use_partition:
 2972|   702k|                             BLOCK_SIZE bsize, PC_TREE *pc_tree) {
 2973|   702k|  AV1_COMMON *const cm = &cpi->common;
 2974|   702k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 2975|   702k|  TileInfo *const tile_info = &tile_data->tile_info;
 2976|   702k|  MACROBLOCK *const x = &td->mb;
 2977|   702k|  MACROBLOCKD *const xd = &x->e_mbd;
 2978|   702k|  const ModeCosts *mode_costs = &x->mode_costs;
 2979|       |  // Only square blocks from 8x8 to 128x128 are supported
 2980|   702k|  assert(bsize >= BLOCK_8X8 && bsize <= BLOCK_128X128);
 2981|   702k|  const int bs = mi_size_wide[bsize];
 2982|   702k|  const int hbs = bs / 2;
 2983|   702k|  PARTITION_TYPE partition = (bsize >= BLOCK_8X8)
  ------------------
  |  Branch (2983:30): [True: 702k, False: 20]
  ------------------
 2984|   702k|                                 ? get_partition(cm, mi_row, mi_col, bsize)
 2985|   702k|                                 : PARTITION_NONE;
 2986|   702k|  BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);
 2987|   702k|  assert(subsize <= BLOCK_LARGEST);
 2988|   702k|  const int pl = (bsize >= BLOCK_8X8)
  ------------------
  |  Branch (2988:18): [True: 702k, False: 18.4E]
  ------------------
 2989|   702k|                     ? partition_plane_context(xd, mi_row, mi_col, bsize)
 2990|  18.4E|                     : 0;
 2991|       |
 2992|   702k|  RD_STATS dummy_cost;
 2993|   702k|  av1_invalid_rd_stats(&dummy_cost);
 2994|       |
 2995|   702k|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols) return;
  ------------------
  |  Branch (2995:7): [True: 18.4E, False: 702k]
  |  Branch (2995:39): [True: 18.4E, False: 702k]
  ------------------
 2996|       |
 2997|   702k|  assert(mi_size_wide[bsize] == mi_size_high[bsize]);
 2998|       |
 2999|   702k|  xd->above_txfm_context =
 3000|   702k|      cm->above_contexts.txfm[tile_info->tile_row] + mi_col;
 3001|   702k|  xd->left_txfm_context =
 3002|   702k|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|   702k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   702k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   702k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   702k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   702k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3003|       |
 3004|       |  // Initialize default mode evaluation params
 3005|   702k|  set_mode_eval_params(cpi, x, DEFAULT_EVAL);
 3006|       |
 3007|   702k|  x->reuse_inter_pred = cpi->sf.rt_sf.reuse_inter_pred_nonrd;
 3008|       |
 3009|   702k|  int change_none_to_split = 0;
 3010|   702k|  if (partition == PARTITION_NONE &&
  ------------------
  |  Branch (3010:7): [True: 387k, False: 314k]
  ------------------
 3011|   387k|      cpi->sf.rt_sf.nonrd_check_partition_split == 1) {
  ------------------
  |  Branch (3011:7): [True: 0, False: 387k]
  ------------------
 3012|      0|    change_none_to_split =
 3013|      0|        try_split_partition(cpi, td, tile_data, tile_info, tp, x, xd, mi_params,
 3014|      0|                            mi_row, mi_col, bsize, pl, pc_tree);
 3015|      0|    if (change_none_to_split) {
  ------------------
  |  Branch (3015:9): [True: 0, False: 0]
  ------------------
 3016|      0|      partition = PARTITION_SPLIT;
 3017|      0|      subsize = get_partition_subsize(bsize, partition);
 3018|      0|      assert(subsize <= BLOCK_LARGEST);
 3019|      0|    }
 3020|      0|  }
 3021|       |
 3022|   702k|  pc_tree->partitioning = partition;
 3023|       |
 3024|   702k|  switch (partition) {
 3025|   387k|    case PARTITION_NONE:
  ------------------
  |  Branch (3025:5): [True: 387k, False: 314k]
  ------------------
 3026|   387k|      if (!pc_tree->none) {
  ------------------
  |  Branch (3026:11): [True: 236k, False: 150k]
  ------------------
 3027|   236k|        pc_tree->none = av1_alloc_pmc(cpi, bsize, &td->shared_coeff_buf);
 3028|   236k|        if (!pc_tree->none)
  ------------------
  |  Branch (3028:13): [True: 0, False: 236k]
  ------------------
 3029|      0|          aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 3030|      0|                             "Failed to allocate PICK_MODE_CONTEXT");
 3031|   236k|      } else {
 3032|   150k|        av1_reset_pmc(pc_tree->none);
 3033|   150k|      }
 3034|   387k|      pick_sb_modes_nonrd(cpi, tile_data, x, mi_row, mi_col, &dummy_cost, bsize,
 3035|   387k|                          pc_tree->none);
 3036|   387k|      encode_b_nonrd(cpi, tile_data, td, tp, mi_row, mi_col, 0, bsize,
 3037|   387k|                     partition, pc_tree->none, NULL);
 3038|   387k|      break;
 3039|  14.0k|    case PARTITION_VERT:
  ------------------
  |  Branch (3039:5): [True: 14.0k, False: 688k]
  ------------------
 3040|  42.0k|      for (int i = 0; i < SUB_PARTITIONS_RECT; ++i) {
  ------------------
  |  |   46|  42.0k|#define SUB_PARTITIONS_RECT 2
  ------------------
  |  Branch (3040:23): [True: 28.0k, False: 14.0k]
  ------------------
 3041|  28.0k|        if (!pc_tree->vertical[i]) {
  ------------------
  |  Branch (3041:13): [True: 22.7k, False: 5.30k]
  ------------------
 3042|  22.7k|          pc_tree->vertical[i] =
 3043|  22.7k|              av1_alloc_pmc(cpi, subsize, &td->shared_coeff_buf);
 3044|  22.7k|          if (!pc_tree->vertical[i])
  ------------------
  |  Branch (3044:15): [True: 0, False: 22.7k]
  ------------------
 3045|      0|            aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 3046|      0|                               "Failed to allocate PICK_MODE_CONTEXT");
 3047|  22.7k|        } else {
 3048|  5.30k|          av1_reset_pmc(pc_tree->vertical[i]);
 3049|  5.30k|        }
 3050|  28.0k|      }
 3051|  14.0k|      pick_sb_modes_nonrd(cpi, tile_data, x, mi_row, mi_col, &dummy_cost,
 3052|  14.0k|                          subsize, pc_tree->vertical[0]);
 3053|  14.0k|      encode_b_nonrd(cpi, tile_data, td, tp, mi_row, mi_col, 0, subsize,
 3054|  14.0k|                     PARTITION_VERT, pc_tree->vertical[0], NULL);
 3055|  14.0k|      if (mi_col + hbs < mi_params->mi_cols && bsize > BLOCK_8X8) {
  ------------------
  |  Branch (3055:11): [True: 18, False: 14.0k]
  |  Branch (3055:48): [True: 18, False: 0]
  ------------------
 3056|     18|        pick_sb_modes_nonrd(cpi, tile_data, x, mi_row, mi_col + hbs,
 3057|     18|                            &dummy_cost, subsize, pc_tree->vertical[1]);
 3058|     18|        encode_b_nonrd(cpi, tile_data, td, tp, mi_row, mi_col + hbs, 0, subsize,
 3059|     18|                       PARTITION_VERT, pc_tree->vertical[1], NULL);
 3060|     18|      }
 3061|  14.0k|      break;
 3062|  14.8k|    case PARTITION_HORZ:
  ------------------
  |  Branch (3062:5): [True: 14.8k, False: 687k]
  ------------------
 3063|  44.5k|      for (int i = 0; i < SUB_PARTITIONS_RECT; ++i) {
  ------------------
  |  |   46|  44.5k|#define SUB_PARTITIONS_RECT 2
  ------------------
  |  Branch (3063:23): [True: 29.7k, False: 14.8k]
  ------------------
 3064|  29.7k|        if (!pc_tree->horizontal[i]) {
  ------------------
  |  Branch (3064:13): [True: 23.9k, False: 5.74k]
  ------------------
 3065|  23.9k|          pc_tree->horizontal[i] =
 3066|  23.9k|              av1_alloc_pmc(cpi, subsize, &td->shared_coeff_buf);
 3067|  23.9k|          if (!pc_tree->horizontal[i])
  ------------------
  |  Branch (3067:15): [True: 0, False: 23.9k]
  ------------------
 3068|      0|            aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 3069|      0|                               "Failed to allocate PICK_MODE_CONTEXT");
 3070|  23.9k|        } else {
 3071|  5.74k|          av1_reset_pmc(pc_tree->horizontal[i]);
 3072|  5.74k|        }
 3073|  29.7k|      }
 3074|  14.8k|      pick_sb_modes_nonrd(cpi, tile_data, x, mi_row, mi_col, &dummy_cost,
 3075|  14.8k|                          subsize, pc_tree->horizontal[0]);
 3076|  14.8k|      encode_b_nonrd(cpi, tile_data, td, tp, mi_row, mi_col, 0, subsize,
 3077|  14.8k|                     PARTITION_HORZ, pc_tree->horizontal[0], NULL);
 3078|       |
 3079|  14.8k|      if (mi_row + hbs < mi_params->mi_rows && bsize > BLOCK_8X8) {
  ------------------
  |  Branch (3079:11): [True: 24, False: 14.8k]
  |  Branch (3079:48): [True: 24, False: 0]
  ------------------
 3080|     24|        pick_sb_modes_nonrd(cpi, tile_data, x, mi_row + hbs, mi_col,
 3081|     24|                            &dummy_cost, subsize, pc_tree->horizontal[1]);
 3082|     24|        encode_b_nonrd(cpi, tile_data, td, tp, mi_row + hbs, mi_col, 0, subsize,
 3083|     24|                       PARTITION_HORZ, pc_tree->horizontal[1], NULL);
 3084|     24|      }
 3085|  14.8k|      break;
 3086|   286k|    case PARTITION_SPLIT:
  ------------------
  |  Branch (3086:5): [True: 286k, False: 416k]
  ------------------
 3087|  1.42M|      for (int i = 0; i < SUB_PARTITIONS_SPLIT; ++i) {
  ------------------
  |  |   49|  1.42M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (3087:23): [True: 1.14M, False: 286k]
  ------------------
 3088|  1.14M|        if (!pc_tree->split[i]) {
  ------------------
  |  Branch (3088:13): [True: 736k, False: 406k]
  ------------------
 3089|   736k|          pc_tree->split[i] = av1_alloc_pc_tree_node(subsize);
 3090|   736k|          if (!pc_tree->split[i])
  ------------------
  |  Branch (3090:15): [True: 0, False: 736k]
  ------------------
 3091|      0|            aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 3092|      0|                               "Failed to allocate PC_TREE");
 3093|   736k|        }
 3094|  1.14M|        pc_tree->split[i]->index = i;
 3095|  1.14M|      }
 3096|   286k|      if (cpi->sf.rt_sf.nonrd_check_partition_merge_mode &&
  ------------------
  |  Branch (3096:11): [True: 119k, False: 166k]
  ------------------
 3097|   119k|          av1_is_leaf_split_partition(cm, mi_row, mi_col, bsize) &&
  ------------------
  |  Branch (3097:11): [True: 56.4k, False: 63.2k]
  ------------------
 3098|  56.4k|          !frame_is_intra_only(cm) && bsize <= BLOCK_64X64) {
  ------------------
  |  Branch (3098:11): [True: 51.6k, False: 4.75k]
  |  Branch (3098:39): [True: 51.6k, False: 0]
  ------------------
 3099|  51.6k|        try_merge(cpi, td, tile_data, mib, tp, mi_row, mi_col, bsize, pc_tree,
 3100|  51.6k|                  partition, subsize, pl);
 3101|   234k|      } else {
 3102|  1.17M|        for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|  1.17M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (3102:25): [True: 938k, False: 234k]
  ------------------
 3103|   938k|          int x_idx = (i & 1) * hbs;
 3104|   938k|          int y_idx = (i >> 1) * hbs;
 3105|   938k|          int jj = i >> 1, ii = i & 0x01;
 3106|   938k|          if ((mi_row + y_idx >= mi_params->mi_rows) ||
  ------------------
  |  Branch (3106:15): [True: 159k, False: 778k]
  ------------------
 3107|   778k|              (mi_col + x_idx >= mi_params->mi_cols))
  ------------------
  |  Branch (3107:15): [True: 124k, False: 653k]
  ------------------
 3108|   285k|            continue;
 3109|   653k|          av1_nonrd_use_partition(
 3110|   653k|              cpi, td, tile_data,
 3111|   653k|              mib + jj * hbs * mi_params->mi_stride + ii * hbs, tp,
 3112|   653k|              mi_row + y_idx, mi_col + x_idx, subsize, pc_tree->split[i]);
 3113|   653k|        }
 3114|       |
 3115|   234k|        if (!change_none_to_split) {
  ------------------
  |  Branch (3115:13): [True: 234k, False: 18.4E]
  ------------------
 3116|       |          // Note: Palette, cfl are not supported.
 3117|   234k|          if (!frame_is_intra_only(cm) && !tile_data->allow_update_cdf &&
  ------------------
  |  Branch (3117:15): [True: 191k, False: 43.5k]
  |  Branch (3117:43): [True: 0, False: 191k]
  ------------------
 3118|      0|              cpi->sf.rt_sf.partition_direct_merging &&
  ------------------
  |  Branch (3118:15): [True: 0, False: 0]
  ------------------
 3119|      0|              mode_costs->partition_cost[pl][PARTITION_NONE] <
  ------------------
  |  Branch (3119:15): [True: 0, False: 0]
  ------------------
 3120|      0|                  mode_costs->partition_cost[pl][PARTITION_SPLIT] &&
 3121|      0|              (mi_row + bs <= mi_params->mi_rows) &&
  ------------------
  |  Branch (3121:15): [True: 0, False: 0]
  ------------------
 3122|      0|              (mi_col + bs <= mi_params->mi_cols)) {
  ------------------
  |  Branch (3122:15): [True: 0, False: 0]
  ------------------
 3123|      0|            direct_partition_merging(cpi, td, tile_data, mib, mi_row, mi_col,
 3124|      0|                                     bsize);
 3125|      0|          }
 3126|   234k|        }
 3127|   234k|      }
 3128|   286k|      break;
 3129|      0|    case PARTITION_VERT_A:
  ------------------
  |  Branch (3129:5): [True: 0, False: 702k]
  ------------------
 3130|      0|    case PARTITION_VERT_B:
  ------------------
  |  Branch (3130:5): [True: 0, False: 702k]
  ------------------
 3131|      0|    case PARTITION_HORZ_A:
  ------------------
  |  Branch (3131:5): [True: 0, False: 702k]
  ------------------
 3132|      0|    case PARTITION_HORZ_B:
  ------------------
  |  Branch (3132:5): [True: 0, False: 702k]
  ------------------
 3133|      0|    case PARTITION_HORZ_4:
  ------------------
  |  Branch (3133:5): [True: 0, False: 702k]
  ------------------
 3134|      0|    case PARTITION_VERT_4:
  ------------------
  |  Branch (3134:5): [True: 0, False: 702k]
  ------------------
 3135|      0|      assert(0 && "Cannot handle extended partition types");
 3136|      0|    default: assert(0); break;
  ------------------
  |  Branch (3136:5): [True: 0, False: 702k]
  ------------------
 3137|   702k|  }
 3138|   702k|}
av1_rd_pick_partition:
 5670|  2.70M|                           RD_RECT_PART_WIN_INFO *rect_part_win_info) {
 5671|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 5672|  2.70M|  const int num_planes = av1_num_planes(cm);
 5673|  2.70M|  TileInfo *const tile_info = &tile_data->tile_info;
 5674|  2.70M|  MACROBLOCK *const x = &td->mb;
 5675|  2.70M|  MACROBLOCKD *const xd = &x->e_mbd;
 5676|  2.70M|  RD_SEARCH_MACROBLOCK_CONTEXT x_ctx;
 5677|  2.70M|  const TokenExtra *const tp_orig = *tp;
 5678|  2.70M|  PartitionSearchState part_search_state;
 5679|       |
 5680|       |  // Initialization of state variables used in partition search.
 5681|  2.70M|  init_partition_search_state_params(x, cpi, &part_search_state, mi_row, mi_col,
 5682|  2.70M|                                     bsize);
 5683|  2.70M|  PartitionBlkParams blk_params = part_search_state.part_blk_params;
 5684|       |
 5685|  2.70M|  set_sms_tree_partitioning(sms_tree, PARTITION_NONE);
 5686|  2.70M|  if (best_rdc.rdcost < 0) {
  ------------------
  |  Branch (5686:7): [True: 0, False: 2.70M]
  ------------------
 5687|      0|    av1_invalid_rd_stats(rd_cost);
 5688|      0|    return part_search_state.found_best_partition;
 5689|      0|  }
 5690|  2.70M|  if (bsize == cm->seq_params->sb_size) x->must_find_valid_partition = 0;
  ------------------
  |  Branch (5690:7): [True: 88.3k, False: 2.61M]
  ------------------
 5691|       |
 5692|       |  // Override skipping rectangular partition operations for edge blocks.
 5693|  2.70M|  if (none_rd) *none_rd = 0;
  ------------------
  |  Branch (5693:7): [True: 2.61M, False: 89.7k]
  ------------------
 5694|  2.70M|  (void)tp_orig;
 5695|       |
 5696|       |#if CONFIG_COLLECT_PARTITION_STATS
 5697|       |  // Stats at the current quad tree
 5698|       |  PartitionTimingStats *part_timing_stats =
 5699|       |      &part_search_state.part_timing_stats;
 5700|       |  // Stats aggregated at frame level
 5701|       |  FramePartitionTimingStats *fr_part_timing_stats = &cpi->partition_stats;
 5702|       |#endif  // CONFIG_COLLECT_PARTITION_STATS
 5703|       |
 5704|       |  // Override partition costs at the edges of the frame in the same
 5705|       |  // way as in read_partition (see decodeframe.c).
 5706|  2.70M|  if (!av1_blk_has_rows_and_cols(&blk_params))
  ------------------
  |  Branch (5706:7): [True: 304k, False: 2.40M]
  ------------------
 5707|   304k|    set_partition_cost_for_edge_blk(cm, &part_search_state);
 5708|       |
 5709|       |  // Disable rectangular partitions for inner blocks when the current block is
 5710|       |  // forced to only use square partitions.
 5711|  2.70M|  if (bsize > cpi->sf.part_sf.use_square_partition_only_threshold) {
  ------------------
  |  Branch (5711:7): [True: 269k, False: 2.43M]
  ------------------
 5712|   269k|    part_search_state.partition_rect_allowed[HORZ] &= !blk_params.has_rows;
 5713|   269k|    part_search_state.partition_rect_allowed[VERT] &= !blk_params.has_cols;
 5714|   269k|  }
 5715|       |
 5716|  2.70M|  assert(mi_size_wide[bsize] == mi_size_high[bsize]);
 5717|       |
 5718|       |  // Set buffers and offsets.
 5719|  2.70M|  av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize);
 5720|       |
 5721|  2.70M|  if (cpi->oxcf.mode == ALLINTRA) {
  ------------------
  |  Branch (5721:7): [True: 0, False: 2.70M]
  ------------------
 5722|      0|    if (bsize == cm->seq_params->sb_size) {
  ------------------
  |  Branch (5722:9): [True: 0, False: 0]
  ------------------
 5723|      0|      double var_min, var_max;
 5724|      0|      log_sub_block_var(cpi, x, bsize, &var_min, &var_max);
 5725|       |
 5726|      0|      x->intra_sb_rdmult_modifier = 128;
 5727|      0|      if ((var_min < 2.0) && (var_max > 4.0)) {
  ------------------
  |  Branch (5727:11): [True: 0, False: 0]
  |  Branch (5727:30): [True: 0, False: 0]
  ------------------
 5728|      0|        if ((var_max - var_min) > 8.0) {
  ------------------
  |  Branch (5728:13): [True: 0, False: 0]
  ------------------
 5729|      0|          x->intra_sb_rdmult_modifier -= 48;
 5730|      0|        } else {
 5731|      0|          x->intra_sb_rdmult_modifier -= (int)((var_max - var_min) * 6);
 5732|      0|        }
 5733|      0|      }
 5734|      0|    }
 5735|      0|  }
 5736|       |
 5737|       |  // Save rdmult before it might be changed, so it can be restored later.
 5738|  2.70M|  const int orig_rdmult = x->rdmult;
 5739|  2.70M|  setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, NO_AQ, NULL);
 5740|       |
 5741|       |  // Apply simple motion search for the entire super block with fixed block
 5742|       |  // size, e.g., 16x16, to collect features and write to files for the
 5743|       |  // external ML model.
 5744|       |  // TODO(chengchen): reduce motion search. This function is similar to
 5745|       |  // av1_get_max_min_partition_features().
 5746|       |#if COLLECT_MOTION_SEARCH_FEATURE_SB
 5747|       |  if (!frame_is_intra_only(cm) && bsize == cm->seq_params->sb_size) {
 5748|       |    av1_collect_motion_search_features_sb(cpi, td, tile_data, mi_row, mi_col,
 5749|       |                                          bsize, /*features=*/NULL);
 5750|       |    collect_tpl_stats_sb(cpi, bsize, mi_row, mi_col, /*features=*/NULL);
 5751|       |  }
 5752|       |#endif  // !COLLECT_MOTION_SEARCH_FEATURE_SB
 5753|       |
 5754|       |  // Update rd cost of the bound using the current multiplier.
 5755|  2.70M|  av1_rd_cost_update(x->rdmult, &best_rdc);
 5756|       |
 5757|  2.70M|  if (bsize == BLOCK_16X16 && cpi->vaq_refresh)
  ------------------
  |  Branch (5757:7): [True: 491k, False: 2.21M]
  |  Branch (5757:31): [True: 0, False: 491k]
  ------------------
 5758|      0|    x->mb_energy = av1_log_block_var(cpi, x, bsize);
 5759|       |
 5760|       |  // Set the context.
 5761|  2.70M|  xd->above_txfm_context =
 5762|  2.70M|      cm->above_contexts.txfm[tile_info->tile_row] + mi_col;
 5763|  2.70M|  xd->left_txfm_context =
 5764|  2.70M|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  2.70M|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  2.70M|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.70M|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  2.70M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  2.70M|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5765|  2.70M|  av1_save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);
 5766|       |
 5767|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5768|       |  start_timing(cpi, av1_prune_partitions_time);
 5769|       |#endif
 5770|       |  // Pruning: before searching any partition type, using source and simple
 5771|       |  // motion search results to prune out unlikely partitions.
 5772|  2.70M|  av1_prune_partitions_before_search(cpi, x, sms_tree, &part_search_state);
 5773|       |
 5774|       |  // Pruning: eliminating partition types leading to coding block sizes outside
 5775|       |  // the min and max bsize limitations set from the encoder.
 5776|  2.70M|  av1_prune_partitions_by_max_min_bsize(&x->sb_enc, &part_search_state);
 5777|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5778|       |  end_timing(cpi, av1_prune_partitions_time);
 5779|       |#endif
 5780|       |
 5781|       |  // Partition search
 5782|  2.70M|BEGIN_PARTITION_SEARCH:
 5783|       |  // If a valid partition is required, usually when the first round cannot find
 5784|       |  // a valid one under the cost limit after pruning, reset the limitations on
 5785|       |  // partition types and intra cnn output.
 5786|  2.70M|  if (x->must_find_valid_partition) {
  ------------------
  |  Branch (5786:7): [True: 0, False: 2.70M]
  ------------------
 5787|      0|    reset_part_limitations(cpi, &part_search_state);
 5788|      0|    av1_prune_partitions_by_max_min_bsize(&x->sb_enc, &part_search_state);
 5789|       |    // Invalidate intra cnn output for key frames.
 5790|      0|    if (frame_is_intra_only(cm) && bsize == BLOCK_64X64) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 0]
  |  Branch (5790:36): [True: 0, False: 0]
  ------------------
 5791|      0|      part_search_state.intra_part_info->quad_tree_idx = 0;
 5792|      0|      part_search_state.intra_part_info->cnn_output_valid = 0;
 5793|      0|    }
 5794|      0|  }
 5795|       |  // Partition block source pixel variance.
 5796|  2.70M|  unsigned int pb_source_variance = UINT_MAX;
 5797|       |
 5798|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5799|       |  start_timing(cpi, none_partition_search_time);
 5800|       |#endif
 5801|       |
 5802|  2.70M|  if (cpi->oxcf.mode == ALLINTRA) {
  ------------------
  |  Branch (5802:7): [True: 0, False: 2.70M]
  ------------------
 5803|      0|    const bool bsize_at_least_16x16 = (bsize >= BLOCK_16X16);
 5804|      0|    const bool prune_rect_part_using_4x4_var_deviation =
 5805|      0|        (cpi->sf.part_sf.prune_rect_part_using_4x4_var_deviation &&
  ------------------
  |  Branch (5805:10): [True: 0, False: 0]
  ------------------
 5806|      0|         !x->must_find_valid_partition);
  ------------------
  |  Branch (5806:10): [True: 0, False: 0]
  ------------------
 5807|       |
 5808|      0|    if (bsize_at_least_16x16 || prune_rect_part_using_4x4_var_deviation) {
  ------------------
  |  Branch (5808:9): [True: 0, False: 0]
  |  Branch (5808:33): [True: 0, False: 0]
  ------------------
 5809|      0|      double var_min, var_max;
 5810|      0|      log_sub_block_var(cpi, x, bsize, &var_min, &var_max);
 5811|       |
 5812|       |      // Further pruning or in some cases reverse pruning when allintra is set.
 5813|       |      // This code helps visual and in some cases metrics quality where the
 5814|       |      // current block comprises at least one very low variance sub-block and at
 5815|       |      // least one where the variance is much higher.
 5816|       |      //
 5817|       |      // The idea is that in such cases there is danger of ringing and other
 5818|       |      // visual artifacts from a high variance feature such as an edge into a
 5819|       |      // very low variance region.
 5820|       |      //
 5821|       |      // The approach taken is to force break down / split to a smaller block
 5822|       |      // size to try and separate out the low variance and well predicted blocks
 5823|       |      // from the more complex ones and to prevent propagation of ringing over a
 5824|       |      // large region.
 5825|      0|      if (bsize_at_least_16x16 && (var_min < 0.272) &&
  ------------------
  |  Branch (5825:11): [True: 0, False: 0]
  |  Branch (5825:35): [True: 0, False: 0]
  ------------------
 5826|      0|          ((var_max - var_min) > 3.0)) {
  ------------------
  |  Branch (5826:11): [True: 0, False: 0]
  ------------------
 5827|      0|        part_search_state.partition_none_allowed = 0;
 5828|      0|        part_search_state.terminate_partition_search = 0;
 5829|      0|        part_search_state.do_square_split = 1;
 5830|      0|      } else if (prune_rect_part_using_4x4_var_deviation &&
  ------------------
  |  Branch (5830:18): [True: 0, False: 0]
  ------------------
 5831|      0|                 (var_max - var_min < 3.0)) {
  ------------------
  |  Branch (5831:18): [True: 0, False: 0]
  ------------------
 5832|       |        // Prune rectangular partitions if the variance deviation of 4x4
 5833|       |        // sub-blocks within the block is less than a threshold (derived
 5834|       |        // empirically).
 5835|      0|        part_search_state.do_rectangular_split = 0;
 5836|      0|      }
 5837|      0|    }
 5838|      0|  }
 5839|       |
 5840|       |  // PARTITION_NONE search stage.
 5841|  2.70M|  int64_t part_none_rd = INT64_MAX;
 5842|  2.70M|  none_partition_search(cpi, td, tile_data, x, pc_tree, sms_tree, &x_ctx,
 5843|  2.70M|                        &part_search_state, &best_rdc, &pb_source_variance,
 5844|  2.70M|                        none_rd, &part_none_rd);
 5845|       |
 5846|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5847|       |  end_timing(cpi, none_partition_search_time);
 5848|       |#endif
 5849|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5850|       |  start_timing(cpi, split_partition_search_time);
 5851|       |#endif
 5852|       |  // PARTITION_SPLIT search stage.
 5853|  2.70M|  int64_t part_split_rd = INT64_MAX;
 5854|  2.70M|  split_partition_search(cpi, td, tile_data, tp, x, pc_tree, sms_tree, &x_ctx,
 5855|  2.70M|                         &part_search_state, &best_rdc, multi_pass_mode,
 5856|  2.70M|                         &part_split_rd);
 5857|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5858|       |  end_timing(cpi, split_partition_search_time);
 5859|       |#endif
 5860|       |  // Terminate partition search for child partition,
 5861|       |  // when NONE and SPLIT partition rd_costs are INT64_MAX.
 5862|  2.70M|  if (cpi->sf.part_sf.early_term_after_none_split &&
  ------------------
  |  Branch (5862:7): [True: 2.70M, False: 18.4E]
  ------------------
 5863|  2.70M|      part_none_rd == INT64_MAX && part_split_rd == INT64_MAX &&
  ------------------
  |  Branch (5863:7): [True: 779k, False: 1.92M]
  |  Branch (5863:36): [True: 111k, False: 667k]
  ------------------
 5864|   111k|      !x->must_find_valid_partition && (bsize != cm->seq_params->sb_size)) {
  ------------------
  |  Branch (5864:7): [True: 111k, False: 18.4E]
  |  Branch (5864:40): [True: 111k, False: 1]
  ------------------
 5865|   111k|    part_search_state.terminate_partition_search = 1;
 5866|   111k|  }
 5867|       |
 5868|       |  // Do not evaluate non-square partitions if NONE partition did not choose a
 5869|       |  // newmv mode and is skippable.
 5870|  2.70M|  if ((cpi->sf.part_sf.skip_non_sq_part_based_on_none >= 2) &&
  ------------------
  |  Branch (5870:7): [True: 0, False: 2.70M]
  ------------------
 5871|      0|      (pc_tree->none != NULL)) {
  ------------------
  |  Branch (5871:7): [True: 0, False: 0]
  ------------------
 5872|      0|    if (x->qindex <= 200 && is_inter_mode(pc_tree->none->mic.mode) &&
  ------------------
  |  Branch (5872:9): [True: 0, False: 0]
  |  Branch (5872:29): [True: 0, False: 0]
  ------------------
 5873|      0|        !have_newmv_in_inter_mode(pc_tree->none->mic.mode) &&
  ------------------
  |  Branch (5873:9): [True: 0, False: 0]
  ------------------
 5874|      0|        pc_tree->none->skippable && !x->must_find_valid_partition &&
  ------------------
  |  Branch (5874:9): [True: 0, False: 0]
  |  Branch (5874:37): [True: 0, False: 0]
  ------------------
 5875|      0|        bsize >= BLOCK_16X16)
  ------------------
  |  Branch (5875:9): [True: 0, False: 0]
  ------------------
 5876|      0|      part_search_state.do_rectangular_split = 0;
 5877|      0|  }
 5878|       |
 5879|       |  // Prune partitions based on PARTITION_NONE and PARTITION_SPLIT.
 5880|  2.70M|  prune_partitions_after_split(cpi, x, sms_tree, &part_search_state, &best_rdc,
 5881|  2.70M|                               part_none_rd, part_split_rd);
 5882|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5883|       |  start_timing(cpi, rectangular_partition_search_time);
 5884|       |#endif
 5885|       |  // Rectangular partitions search stage.
 5886|  2.70M|  rectangular_partition_search(cpi, td, tile_data, tp, x, pc_tree, &x_ctx,
 5887|  2.70M|                               &part_search_state, &best_rdc,
 5888|  2.70M|                               rect_part_win_info, HORZ, VERT);
 5889|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5890|       |  end_timing(cpi, rectangular_partition_search_time);
 5891|       |#endif
 5892|       |
 5893|  2.70M|  if (pb_source_variance == UINT_MAX) {
  ------------------
  |  Branch (5893:7): [True: 670k, False: 2.03M]
  ------------------
 5894|   670k|    av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize);
 5895|   670k|    pb_source_variance = av1_get_perpixel_variance_facade(
 5896|   670k|        cpi, xd, &x->plane[0].src, bsize, AOM_PLANE_Y);
  ------------------
  |  |  281|   670k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 5897|   670k|  }
 5898|       |
 5899|  2.70M|  assert(IMPLIES(!cpi->oxcf.part_cfg.enable_rect_partitions,
 5900|  2.70M|                 !part_search_state.do_rectangular_split));
 5901|       |
 5902|  2.70M|  const int prune_ext_part_state = prune_ext_part_none_skippable(
 5903|  2.70M|      pc_tree->none, x->must_find_valid_partition,
 5904|  2.70M|      cpi->sf.part_sf.skip_non_sq_part_based_on_none, bsize);
 5905|       |
 5906|  2.70M|  const int ab_partition_allowed = allow_ab_partition_search(
 5907|  2.70M|      &part_search_state, &cpi->sf.part_sf, pc_tree->partitioning,
 5908|  2.70M|      x->must_find_valid_partition, prune_ext_part_state, best_rdc.rdcost);
 5909|       |
 5910|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5911|       |  start_timing(cpi, ab_partitions_search_time);
 5912|       |#endif
 5913|       |  // AB partitions search stage.
 5914|  2.70M|  ab_partitions_search(cpi, td, tile_data, tp, x, &x_ctx, pc_tree,
 5915|  2.70M|                       &part_search_state, &best_rdc, rect_part_win_info,
 5916|  2.70M|                       pb_source_variance, ab_partition_allowed, HORZ_A,
 5917|  2.70M|                       VERT_B);
 5918|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5919|       |  end_timing(cpi, ab_partitions_search_time);
 5920|       |#endif
 5921|       |
 5922|       |  // 4-way partitions search stage.
 5923|  2.70M|  int part4_search_allowed[NUM_PART4_TYPES] = { 1, 1 };
 5924|       |  // Prune 4-way partition search.
 5925|  2.70M|  prune_4_way_partition_search(cpi, x, pc_tree, &part_search_state, sms_tree,
 5926|  2.70M|                               &best_rdc, pb_source_variance,
 5927|  2.70M|                               prune_ext_part_state, mi_row, mi_col,
 5928|  2.70M|                               part4_search_allowed);
 5929|       |
 5930|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5931|       |  start_timing(cpi, rd_pick_4partition_time);
 5932|       |#endif
 5933|       |  // PARTITION_HORZ_4
 5934|  2.70M|  assert(IMPLIES(!cpi->oxcf.part_cfg.enable_rect_partitions,
 5935|  2.70M|                 !part4_search_allowed[HORZ4]));
 5936|  2.70M|  if (!part_search_state.terminate_partition_search &&
  ------------------
  |  Branch (5936:7): [True: 2.59M, False: 112k]
  ------------------
 5937|  2.59M|      part4_search_allowed[HORZ4]) {
  ------------------
  |  Branch (5937:7): [True: 0, False: 2.59M]
  ------------------
 5938|      0|    const int inc_step[NUM_PART4_TYPES] = { mi_size_high[blk_params.bsize] / 4,
 5939|      0|                                            0 };
 5940|       |    // Evaluation of Horz4 partition type.
 5941|      0|    rd_pick_4partition(cpi, td, tile_data, tp, x, &x_ctx, pc_tree,
 5942|      0|                       pc_tree->horizontal4, &part_search_state, &best_rdc,
 5943|      0|                       inc_step, PARTITION_HORZ_4);
 5944|      0|  }
 5945|       |
 5946|       |  // PARTITION_VERT_4
 5947|  2.70M|  assert(IMPLIES(!cpi->oxcf.part_cfg.enable_rect_partitions,
 5948|  2.70M|                 !part4_search_allowed[VERT4]));
 5949|  2.70M|  if (!part_search_state.terminate_partition_search &&
  ------------------
  |  Branch (5949:7): [True: 2.59M, False: 112k]
  ------------------
 5950|  2.59M|      part4_search_allowed[VERT4] && blk_params.has_cols) {
  ------------------
  |  Branch (5950:7): [True: 0, False: 2.59M]
  |  Branch (5950:38): [True: 0, False: 0]
  ------------------
 5951|      0|    const int inc_step[NUM_PART4_TYPES] = { 0, mi_size_wide[blk_params.bsize] /
 5952|      0|                                                   4 };
 5953|       |    // Evaluation of Vert4 partition type.
 5954|      0|    rd_pick_4partition(cpi, td, tile_data, tp, x, &x_ctx, pc_tree,
 5955|      0|                       pc_tree->vertical4, &part_search_state, &best_rdc,
 5956|      0|                       inc_step, PARTITION_VERT_4);
 5957|      0|  }
 5958|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 5959|       |  end_timing(cpi, rd_pick_4partition_time);
 5960|       |#endif
 5961|       |
 5962|  2.70M|  if (bsize == cm->seq_params->sb_size &&
  ------------------
  |  Branch (5962:7): [True: 88.3k, False: 2.61M]
  ------------------
 5963|  88.3k|      !part_search_state.found_best_partition) {
  ------------------
  |  Branch (5963:7): [True: 0, False: 88.3k]
  ------------------
 5964|       |    // Did not find a valid partition, go back and search again, with less
 5965|       |    // constraint on which partition types to search.
 5966|      0|    x->must_find_valid_partition = 1;
 5967|       |#if CONFIG_COLLECT_PARTITION_STATS
 5968|       |    fr_part_timing_stats->partition_redo += 1;
 5969|       |#endif  // CONFIG_COLLECT_PARTITION_STATS
 5970|      0|    goto BEGIN_PARTITION_SEARCH;
 5971|      0|  }
 5972|       |
 5973|       |  // Store the final rd cost
 5974|  2.70M|  *rd_cost = best_rdc;
 5975|       |
 5976|       |  // Also record the best partition in simple motion data tree because it is
 5977|       |  // necessary for the related speed features.
 5978|  2.70M|  set_sms_tree_partitioning(sms_tree, pc_tree->partitioning);
 5979|       |
 5980|       |#if CONFIG_COLLECT_PARTITION_STATS
 5981|       |  if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX) {
 5982|       |    part_timing_stats->partition_decisions[pc_tree->partitioning] += 1;
 5983|       |  }
 5984|       |
 5985|       |  // If CONFIG_COLLECT_PARTITION_STATS is 1, then print out the stats for each
 5986|       |  // prediction block.
 5987|       |  print_partition_timing_stats_with_rdcost(
 5988|       |      part_timing_stats, mi_row, mi_col, bsize,
 5989|       |      cpi->ppi->gf_group.update_type[cpi->gf_frame_index],
 5990|       |      cm->current_frame.frame_number, &best_rdc, "part_timing.csv");
 5991|       |  const bool print_timing_stats = false;
 5992|       |  if (print_timing_stats) {
 5993|       |    print_partition_timing_stats(part_timing_stats, cm->show_frame,
 5994|       |                                 frame_is_intra_only(cm), bsize,
 5995|       |                                 "part_timing_data.csv");
 5996|       |  }
 5997|       |  // If CONFIG_COLLECTION_PARTITION_STATS is 2, then we print out the stats for
 5998|       |  // the whole clip. So we need to pass the information upstream to the encoder.
 5999|       |  accumulate_partition_timing_stats(fr_part_timing_stats, part_timing_stats,
 6000|       |                                    bsize);
 6001|       |#endif  // CONFIG_COLLECT_PARTITION_STATS
 6002|       |
 6003|       |  // Reset the PC_TREE deallocation flag.
 6004|  2.70M|  int pc_tree_dealloc = 0;
 6005|       |
 6006|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6007|       |  start_timing(cpi, encode_sb_time);
 6008|       |#endif
 6009|  2.70M|  if (part_search_state.found_best_partition) {
  ------------------
  |  Branch (6009:7): [True: 2.58M, False: 122k]
  ------------------
 6010|  2.58M|    if (bsize == cm->seq_params->sb_size) {
  ------------------
  |  Branch (6010:9): [True: 88.3k, False: 2.49M]
  ------------------
 6011|       |      // Encode the superblock.
 6012|  88.3k|      const int emit_output = multi_pass_mode != SB_DRY_PASS;
 6013|  18.4E|      const RUN_TYPE run_type = emit_output ? OUTPUT_ENABLED : DRY_RUN_NORMAL;
  ------------------
  |  Branch (6013:33): [True: 88.3k, False: 18.4E]
  ------------------
 6014|       |
 6015|       |#if COLLECT_MOTION_SEARCH_FEATURE_SB
 6016|       |      // Write partition tree to file. Not used by default.
 6017|       |      write_partition_tree(cpi, pc_tree, bsize, mi_row, mi_col);
 6018|       |      ++cpi->sb_counter;
 6019|       |#endif  // COLLECT_MOTION_SEARCH_FEATURE_SB
 6020|  88.3k|      set_cb_offsets(x->cb_offset, 0, 0);
 6021|  88.3k|      encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, run_type, bsize,
 6022|  88.3k|                pc_tree, NULL);
 6023|  88.3k|      assert(pc_tree == td->pc_root);
 6024|       |      // Dealloc the whole PC_TREE after a superblock is done.
 6025|  88.3k|      av1_free_pc_tree_recursive(pc_tree, num_planes, 0, 0,
 6026|  88.3k|                                 cpi->sf.part_sf.partition_search_type);
 6027|  88.3k|      pc_tree = NULL;
 6028|  88.3k|      td->pc_root = NULL;
 6029|  88.3k|      pc_tree_dealloc = 1;
 6030|  2.49M|    } else if (should_do_dry_run_encode_for_current_block(
  ------------------
  |  Branch (6030:16): [True: 2.08M, False: 411k]
  ------------------
 6031|  2.49M|                   cm->seq_params->sb_size, x->sb_enc.max_partition_size,
 6032|  2.49M|                   pc_tree->index, bsize)) {
 6033|       |      // Encode the smaller blocks in DRY_RUN mode.
 6034|  2.08M|      encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, DRY_RUN_NORMAL, bsize,
 6035|  2.08M|                pc_tree, NULL);
 6036|  2.08M|    }
 6037|  2.58M|  }
 6038|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6039|       |  end_timing(cpi, encode_sb_time);
 6040|       |#endif
 6041|       |
 6042|       |  // If the tree still exists (non-superblock), dealloc most nodes, only keep
 6043|       |  // nodes for the best partition and PARTITION_NONE.
 6044|  2.70M|  if (pc_tree_dealloc == 0)
  ------------------
  |  Branch (6044:7): [True: 2.61M, False: 87.9k]
  ------------------
 6045|  2.61M|    av1_free_pc_tree_recursive(pc_tree, num_planes, 1, 1,
 6046|  2.61M|                               cpi->sf.part_sf.partition_search_type);
 6047|       |
 6048|  2.70M|  if (bsize == cm->seq_params->sb_size) {
  ------------------
  |  Branch (6048:7): [True: 88.3k, False: 2.61M]
  ------------------
 6049|  88.3k|    assert(best_rdc.rate < INT_MAX);
 6050|  88.3k|    assert(best_rdc.dist < INT64_MAX);
 6051|  2.61M|  } else {
 6052|  2.61M|    assert(tp_orig == *tp);
 6053|  2.61M|  }
 6054|       |
 6055|       |  // Restore the rd multiplier.
 6056|  2.70M|  x->rdmult = orig_rdmult;
 6057|  2.70M|  return part_search_state.found_best_partition;
 6058|  2.70M|}
partition_search.c:setup_block_rdmult:
  598|  11.9M|                               AQ_MODE aq_mode, MB_MODE_INFO *mbmi) {
  599|  11.9M|  x->rdmult = cpi->rd.RDMULT;
  600|       |
  601|  11.9M|  if (aq_mode != NO_AQ) {
  ------------------
  |  Branch (601:7): [True: 0, False: 11.9M]
  ------------------
  602|      0|    assert(mbmi != NULL);
  603|      0|    if (aq_mode == VARIANCE_AQ) {
  ------------------
  |  Branch (603:9): [True: 0, False: 0]
  ------------------
  604|      0|      if (cpi->vaq_refresh) {
  ------------------
  |  Branch (604:11): [True: 0, False: 0]
  ------------------
  605|      0|        const int energy = bsize <= BLOCK_16X16
  ------------------
  |  Branch (605:28): [True: 0, False: 0]
  ------------------
  606|      0|                               ? x->mb_energy
  607|      0|                               : av1_log_block_var(cpi, x, bsize);
  608|      0|        mbmi->segment_id = energy;
  609|      0|      }
  610|      0|      x->rdmult = set_rdmult(cpi, x, mbmi->segment_id);
  611|      0|    } else if (aq_mode == COMPLEXITY_AQ) {
  ------------------
  |  Branch (611:16): [True: 0, False: 0]
  ------------------
  612|      0|      x->rdmult = set_rdmult(cpi, x, mbmi->segment_id);
  613|      0|    } else if (aq_mode == CYCLIC_REFRESH_AQ) {
  ------------------
  |  Branch (613:16): [True: 0, False: 0]
  ------------------
  614|       |      // If segment is boosted, use rdmult for that segment.
  615|      0|      if (cyclic_refresh_segment_id_boosted(mbmi->segment_id))
  ------------------
  |  Branch (615:11): [True: 0, False: 0]
  ------------------
  616|      0|        x->rdmult = av1_cyclic_refresh_get_rdmult(cpi->cyclic_refresh);
  617|      0|    }
  618|      0|  }
  619|       |
  620|  11.9M|#if !CONFIG_REALTIME_ONLY
  621|  11.9M|  if (cpi->cb_delta_rdmult_enabled && !cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (621:7): [True: 8.25M, False: 3.68M]
  |  Branch (621:39): [True: 7.37M, False: 880k]
  ------------------
  622|  7.37M|    x->rdmult = av1_get_cb_rdmult(cpi, x, bsize, mi_row, mi_col);
  623|  7.37M|  }
  624|  11.9M|#endif  // !CONFIG_REALTIME_ONLY
  625|       |
  626|  11.9M|  if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIM ||
  ------------------
  |  Branch (626:7): [True: 2.98k, False: 11.9M]
  ------------------
  627|  11.9M|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (627:7): [True: 8.25M, False: 3.68M]
  ------------------
  628|  8.25M|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (628:7): [True: 18.4E, False: 3.68M]
  ------------------
  629|  8.25M|    av1_set_ssim_rdmult(cpi, &x->errorperbit, bsize, mi_row, mi_col,
  630|  8.25M|                        &x->rdmult);
  631|  8.25M|  }
  632|       |#if CONFIG_SALIENCY_MAP
  633|       |  else if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_SALIENCY_MAP) {
  634|       |    av1_set_saliency_map_vmaf_rdmult(cpi, &x->errorperbit,
  635|       |                                     cpi->common.seq_params->sb_size, mi_row,
  636|       |                                     mi_col, &x->rdmult);
  637|       |  }
  638|       |#endif
  639|       |#if CONFIG_TUNE_VMAF
  640|       |  else if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_WITHOUT_PREPROCESSING ||
  641|       |           cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_MAX_GAIN ||
  642|       |           cpi->oxcf.tune_cfg.tuning == AOM_TUNE_VMAF_NEG_MAX_GAIN) {
  643|       |    av1_set_vmaf_rdmult(cpi, x, bsize, mi_row, mi_col, &x->rdmult);
  644|       |  }
  645|       |#endif
  646|       |#if CONFIG_TUNE_BUTTERAUGLI
  647|       |  else if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_BUTTERAUGLI) {
  648|       |    av1_set_butteraugli_rdmult(cpi, x, bsize, mi_row, mi_col, &x->rdmult);
  649|       |  }
  650|       |#endif
  651|  11.9M|  if (cpi->oxcf.mode == ALLINTRA) {
  ------------------
  |  Branch (651:7): [True: 0, False: 11.9M]
  ------------------
  652|      0|    x->rdmult = (int)(((int64_t)x->rdmult * x->intra_sb_rdmult_modifier) >> 7);
  653|      0|  }
  654|       |
  655|       |  // Check to make sure that the adjustments above have not caused the
  656|       |  // rd multiplier to be truncated to 0.
  657|  18.4E|  x->rdmult = (x->rdmult > 0) ? x->rdmult : 1;
  ------------------
  |  Branch (657:15): [True: 11.9M, False: 18.4E]
  ------------------
  658|  11.9M|}
partition_search.c:pick_sb_modes:
  847|  2.28M|                          RD_STATS best_rd) {
  848|  2.28M|  if (cpi->sf.part_sf.use_best_rd_for_pruning && best_rd.rdcost < 0) {
  ------------------
  |  Branch (848:7): [True: 2.28M, False: 18.4E]
  |  Branch (848:50): [True: 90, False: 2.28M]
  ------------------
  849|     90|    ctx->rd_stats.rdcost = INT64_MAX;
  850|     90|    ctx->rd_stats.skip_txfm = 0;
  851|     90|    av1_invalid_rd_stats(rd_cost);
  852|     90|    return;
  853|     90|  }
  854|       |
  855|  2.28M|  av1_set_offsets(cpi, &tile_data->tile_info, x, mi_row, mi_col, bsize);
  856|       |
  857|  2.28M|  if (cpi->sf.part_sf.reuse_prev_rd_results_for_part_ab &&
  ------------------
  |  Branch (857:7): [True: 2.28M, False: 584]
  ------------------
  858|  2.28M|      ctx->rd_mode_is_ready) {
  ------------------
  |  Branch (858:7): [True: 0, False: 2.28M]
  ------------------
  859|      0|    assert(ctx->mic.bsize == bsize);
  860|      0|    assert(ctx->mic.partition == partition);
  861|      0|    rd_cost->rate = ctx->rd_stats.rate;
  862|      0|    rd_cost->dist = ctx->rd_stats.dist;
  863|      0|    rd_cost->rdcost = ctx->rd_stats.rdcost;
  864|      0|    return;
  865|      0|  }
  866|       |
  867|  2.28M|  AV1_COMMON *const cm = &cpi->common;
  868|  2.28M|  const int num_planes = av1_num_planes(cm);
  869|  2.28M|  MACROBLOCKD *const xd = &x->e_mbd;
  870|  2.28M|  MB_MODE_INFO *mbmi;
  871|  2.28M|  struct macroblock_plane *const p = x->plane;
  872|  2.28M|  struct macroblockd_plane *const pd = xd->plane;
  873|  2.28M|  const AQ_MODE aq_mode = cpi->oxcf.q_cfg.aq_mode;
  874|  2.28M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
  875|       |
  876|  2.28M|  int i;
  877|       |
  878|       |  // This is only needed for real time/allintra row-mt enabled multi-threaded
  879|       |  // encoding with cost update frequency set to COST_UPD_TILE/COST_UPD_OFF.
  880|  2.28M|  wait_for_top_right_sb(&cpi->mt_info.enc_row_mt, &tile_data->row_mt_sync,
  881|  2.28M|                        &tile_data->tile_info, cm->seq_params->sb_size,
  882|  2.28M|                        cm->seq_params->mib_size_log2, bsize, mi_row, mi_col);
  883|       |
  884|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  885|       |  start_timing(cpi, rd_pick_sb_modes_time);
  886|       |#endif
  887|       |
  888|  2.28M|  mbmi = xd->mi[0];
  889|  2.28M|  mbmi->bsize = bsize;
  890|  2.28M|  mbmi->partition = partition;
  891|       |
  892|       |#if CONFIG_RD_DEBUG
  893|       |  mbmi->mi_row = mi_row;
  894|       |  mbmi->mi_col = mi_col;
  895|       |#endif
  896|       |
  897|       |  // Sets up the tx_type_map buffer in MACROBLOCKD.
  898|  2.28M|  xd->tx_type_map = txfm_info->tx_type_map_;
  899|  2.28M|  xd->tx_type_map_stride = mi_size_wide[bsize];
  900|       |
  901|  6.82M|  for (i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (901:15): [True: 4.53M, False: 2.28M]
  ------------------
  902|  4.53M|    p[i].coeff = ctx->coeff[i];
  903|  4.53M|    p[i].qcoeff = ctx->qcoeff[i];
  904|  4.53M|    p[i].dqcoeff = ctx->dqcoeff[i];
  905|  4.53M|    p[i].eobs = ctx->eobs[i];
  906|  4.53M|    p[i].txb_entropy_ctx = ctx->txb_entropy_ctx[i];
  907|  4.53M|  }
  908|       |
  909|  6.86M|  for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
  ------------------
  |  Branch (909:15): [True: 4.57M, False: 2.28M]
  ------------------
  910|       |
  911|  2.28M|  ctx->skippable = 0;
  912|       |  // Set to zero to make sure we do not use the previous encoded frame stats
  913|  2.28M|  mbmi->skip_txfm = 0;
  914|       |  // Reset skip mode flag.
  915|  2.28M|  mbmi->skip_mode = 0;
  916|       |
  917|  2.28M|  x->source_variance = av1_get_perpixel_variance_facade(
  918|  2.28M|      cpi, xd, &x->plane[0].src, bsize, AOM_PLANE_Y);
  ------------------
  |  |  281|  2.28M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  919|       |
  920|       |  // Initialize default mode evaluation params
  921|  2.28M|  set_mode_eval_params(cpi, x, DEFAULT_EVAL);
  922|       |
  923|       |  // Save rdmult before it might be changed, so it can be restored later.
  924|  2.28M|  const int orig_rdmult = x->rdmult;
  925|  2.28M|  setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, aq_mode, mbmi);
  926|       |  // Set error per bit for current rdmult
  927|  2.28M|  av1_set_error_per_bit(&x->errorperbit, x->rdmult);
  928|  2.28M|  av1_rd_cost_update(x->rdmult, &best_rd);
  929|       |
  930|       |  // If set best_rd.rdcost to INT64_MAX, the encoder will not use any previous
  931|       |  // rdcost information for the following mode search.
  932|       |  // Disabling the feature could get some coding gain, with encoder slowdown.
  933|  2.28M|  if (!cpi->sf.part_sf.use_best_rd_for_pruning) {
  ------------------
  |  Branch (933:7): [True: 0, False: 2.28M]
  ------------------
  934|      0|    av1_invalid_rd_stats(&best_rd);
  935|      0|  }
  936|       |
  937|       |  // Find best coding mode & reconstruct the MB so it is available
  938|       |  // as a predictor for MBs that follow in the SB
  939|  2.28M|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (939:7): [True: 371k, False: 1.91M]
  ------------------
  940|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  941|       |    start_timing(cpi, av1_rd_pick_intra_mode_sb_time);
  942|       |#endif
  943|   371k|    av1_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, best_rd.rdcost);
  944|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  945|       |    end_timing(cpi, av1_rd_pick_intra_mode_sb_time);
  946|       |#endif
  947|  1.91M|  } else {
  948|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  949|       |    start_timing(cpi, av1_rd_pick_inter_mode_sb_time);
  950|       |#endif
  951|  1.91M|    if (segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (951:9): [True: 0, False: 1.91M]
  ------------------
  952|      0|      av1_rd_pick_inter_mode_sb_seg_skip(cpi, tile_data, x, mi_row, mi_col,
  953|      0|                                         rd_cost, bsize, ctx, best_rd.rdcost);
  954|  1.91M|    } else {
  955|  1.91M|      av1_rd_pick_inter_mode(cpi, tile_data, x, rd_cost, bsize, ctx,
  956|  1.91M|                             best_rd.rdcost);
  957|  1.91M|    }
  958|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  959|       |    end_timing(cpi, av1_rd_pick_inter_mode_sb_time);
  960|       |#endif
  961|  1.91M|  }
  962|       |
  963|       |  // Examine the resulting rate and for AQ mode 2 make a segment choice.
  964|  2.28M|  if (rd_cost->rate != INT_MAX && aq_mode == COMPLEXITY_AQ &&
  ------------------
  |  Branch (964:7): [True: 2.08M, False: 209k]
  |  Branch (964:35): [True: 0, False: 2.08M]
  ------------------
  965|      0|      bsize >= BLOCK_16X16) {
  ------------------
  |  Branch (965:7): [True: 0, False: 0]
  ------------------
  966|      0|    av1_caq_select_segment(cpi, x, bsize, mi_row, mi_col, rd_cost->rate);
  967|      0|  }
  968|       |
  969|  2.28M|  x->rdmult = orig_rdmult;
  970|       |
  971|       |  // TODO(jingning) The rate-distortion optimization flow needs to be
  972|       |  // refactored to provide proper exit/return handle.
  973|  2.28M|  if (rd_cost->rate == INT_MAX) rd_cost->rdcost = INT64_MAX;
  ------------------
  |  Branch (973:7): [True: 208k, False: 2.08M]
  ------------------
  974|       |
  975|  2.28M|  ctx->rd_stats.rate = rd_cost->rate;
  976|  2.28M|  ctx->rd_stats.dist = rd_cost->dist;
  977|  2.28M|  ctx->rd_stats.rdcost = rd_cost->rdcost;
  978|       |
  979|       |#if CONFIG_COLLECT_COMPONENT_TIMING
  980|       |  end_timing(cpi, rd_pick_sb_modes_time);
  981|       |#endif
  982|  2.28M|}
partition_search.c:wait_for_top_right_sb:
  790|  2.96M|                                         int mi_row, int mi_col) {
  791|  2.96M|  const int sb_size_in_mi = mi_size_wide[sb_size];
  792|  2.96M|  const int bw_in_mi = mi_size_wide[bsize];
  793|  2.96M|  const int blk_row_in_sb = mi_row & (sb_size_in_mi - 1);
  794|  2.96M|  const int blk_col_in_sb = mi_col & (sb_size_in_mi - 1);
  795|  2.96M|  const int top_right_block_in_sb =
  796|  2.96M|      (blk_row_in_sb == 0) && (blk_col_in_sb + bw_in_mi >= sb_size_in_mi);
  ------------------
  |  Branch (796:7): [True: 754k, False: 2.20M]
  |  Branch (796:31): [True: 78.1k, False: 676k]
  ------------------
  797|       |
  798|       |  // Don't wait if the block is the not the top-right block in the superblock.
  799|  2.96M|  if (!top_right_block_in_sb) return;
  ------------------
  |  Branch (799:7): [True: 2.88M, False: 77.8k]
  ------------------
  800|       |
  801|       |  // Wait for the top-right superblock to finish encoding.
  802|  77.8k|  const int sb_row_in_tile =
  803|  77.8k|      (mi_row - tile_info->mi_row_start) >> sb_mi_size_log2;
  804|  77.8k|  const int sb_col_in_tile =
  805|  77.8k|      (mi_col - tile_info->mi_col_start) >> sb_mi_size_log2;
  806|       |
  807|  77.8k|  enc_row_mt->sync_read_ptr(row_mt_sync, sb_row_in_tile, sb_col_in_tile);
  808|  77.8k|}
partition_search.c:encode_superblock:
  396|  6.38M|                              BLOCK_SIZE bsize, int *rate) {
  397|  6.38M|  const AV1_COMMON *const cm = &cpi->common;
  398|  6.38M|  const int num_planes = av1_num_planes(cm);
  399|  6.38M|  MACROBLOCK *const x = &td->mb;
  400|  6.38M|  MACROBLOCKD *const xd = &x->e_mbd;
  401|  6.38M|  MB_MODE_INFO **mi_4x4 = xd->mi;
  402|  6.38M|  MB_MODE_INFO *mbmi = mi_4x4[0];
  403|  6.38M|  const int seg_skip =
  404|  6.38M|      segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
  405|  6.38M|  const int mis = cm->mi_params.mi_stride;
  406|  6.38M|  const int mi_width = mi_size_wide[bsize];
  407|  6.38M|  const int mi_height = mi_size_high[bsize];
  408|  6.38M|  const int is_inter = is_inter_block(mbmi);
  409|       |
  410|       |  // Initialize tx_mode and tx_size_search_method
  411|  6.38M|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
  412|  6.38M|  set_tx_size_search_method(
  413|  6.38M|      cm, &cpi->winner_mode_params, txfm_params,
  414|  6.38M|      cpi->sf.winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1);
  415|       |
  416|  6.38M|  const int mi_row = xd->mi_row;
  417|  6.38M|  const int mi_col = xd->mi_col;
  418|  6.38M|  if (!is_inter) {
  ------------------
  |  Branch (418:7): [True: 5.25M, False: 1.13M]
  ------------------
  419|  5.25M|    xd->cfl.store_y = store_cfl_required(cm, xd);
  420|  15.4M|    for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (420:25): [True: 10.1M, False: 5.25M]
  ------------------
  421|  10.1M|      av1_encode_intra_block_plane(cpi, x, bsize, plane, dry_run,
  422|  10.1M|                                   cpi->optimize_seg_arr[mbmi->segment_id]);
  423|  10.1M|    }
  424|       |
  425|       |    // If there is at least one lossless segment, force the skip for intra
  426|       |    // block to be 0, in order to avoid the segment_id to be changed by in
  427|       |    // write_segment_id().
  428|  5.25M|    if (!cpi->common.seg.segid_preskip && cpi->common.seg.update_map &&
  ------------------
  |  Branch (428:9): [True: 5.25M, False: 45]
  |  Branch (428:43): [True: 0, False: 5.25M]
  ------------------
  429|      0|        cpi->enc_seg.has_lossless_segment)
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|      mbmi->skip_txfm = 0;
  431|       |
  432|  5.25M|    xd->cfl.store_y = 0;
  433|  5.25M|    if (av1_allow_palette(cm->features.allow_screen_content_tools, bsize)) {
  ------------------
  |  Branch (433:9): [True: 235k, False: 5.01M]
  ------------------
  434|       |      // Gather the stats to determine whether to use screen content tools in
  435|       |      // function av1_determine_sc_tools_with_encoding().
  436|   235k|      if (mbmi->palette_mode_info.palette_size[0] > 0 &&
  ------------------
  |  Branch (436:11): [True: 158k, False: 76.6k]
  ------------------
  437|   158k|          dry_run == OUTPUT_ENABLED)
  ------------------
  |  Branch (437:11): [True: 42.3k, False: 116k]
  ------------------
  438|  42.3k|        x->palette_pixels += (block_size_wide[bsize] * block_size_high[bsize]);
  439|   648k|      for (int plane = 0; plane < AOMMIN(2, num_planes); ++plane) {
  ------------------
  |  |   34|   648k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 532k, False: 116k]
  |  |  ------------------
  ------------------
  |  Branch (439:27): [True: 412k, False: 235k]
  ------------------
  440|   412k|        if (mbmi->palette_mode_info.palette_size[plane] > 0) {
  ------------------
  |  Branch (440:13): [True: 252k, False: 160k]
  ------------------
  441|   252k|          if (!dry_run) {
  ------------------
  |  Branch (441:15): [True: 67.1k, False: 184k]
  ------------------
  442|  67.1k|            av1_tokenize_color_map(x, plane, t, bsize, mbmi->tx_size,
  443|  67.1k|                                   PALETTE_MAP, tile_data->allow_update_cdf,
  444|  67.1k|                                   td->counts);
  445|   184k|          } else if (dry_run == DRY_RUN_COSTCOEFFS) {
  ------------------
  |  Branch (445:22): [True: 0, False: 184k]
  ------------------
  446|      0|            *rate +=
  447|      0|                av1_cost_color_map(x, plane, bsize, mbmi->tx_size, PALETTE_MAP);
  448|      0|          }
  449|   252k|        }
  450|   412k|      }
  451|   235k|    }
  452|       |
  453|  5.25M|    av1_update_intra_mb_txb_context(cpi, td, dry_run, bsize,
  454|  5.25M|                                    tile_data->allow_update_cdf);
  455|  5.25M|  } else {
  456|  1.13M|    int ref;
  457|  1.13M|    const int is_compound = has_second_ref(mbmi);
  458|       |
  459|  1.13M|    set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
  460|  2.27M|    for (ref = 0; ref < 1 + is_compound; ++ref) {
  ------------------
  |  Branch (460:19): [True: 1.13M, False: 1.13M]
  ------------------
  461|  1.13M|      const YV12_BUFFER_CONFIG *cfg =
  462|  1.13M|          get_ref_frame_yv12_buf(cm, mbmi->ref_frame[ref]);
  463|  1.13M|      assert(IMPLIES(!is_intrabc_block(mbmi), cfg));
  464|  1.13M|      av1_setup_pre_planes(xd, ref, cfg, mi_row, mi_col,
  465|  1.13M|                           xd->block_ref_scale_factors[ref], num_planes);
  466|  1.13M|    }
  467|       |    // Predicted sample of inter mode (for Luma plane) cannot be reused if
  468|       |    // nonrd_check_partition_split speed feature is enabled, Since in such cases
  469|       |    // the buffer may not contain the predicted sample of best mode.
  470|  1.13M|    const int start_plane =
  471|  1.13M|        (x->reuse_inter_pred && (!cpi->sf.rt_sf.nonrd_check_partition_split) &&
  ------------------
  |  Branch (471:10): [True: 0, False: 1.13M]
  |  Branch (471:33): [True: 0, False: 0]
  ------------------
  472|      0|         cm->seq_params->bit_depth == AOM_BITS_8)
  ------------------
  |  Branch (472:10): [True: 0, False: 0]
  ------------------
  473|  1.13M|            ? 1
  474|  1.13M|            : 0;
  475|  1.13M|    av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize,
  476|  1.13M|                                  start_plane, av1_num_planes(cm) - 1);
  477|  1.13M|    if (mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (477:9): [True: 0, False: 1.13M]
  ------------------
  478|      0|      assert(cpi->oxcf.motion_mode_cfg.enable_obmc);
  479|      0|      av1_build_obmc_inter_predictors_sb(cm, xd);
  480|      0|    }
  481|       |
  482|       |#if CONFIG_MISMATCH_DEBUG
  483|       |    if (dry_run == OUTPUT_ENABLED) {
  484|       |      for (int plane = 0; plane < num_planes; ++plane) {
  485|       |        const struct macroblockd_plane *pd = &xd->plane[plane];
  486|       |        int pixel_c, pixel_r;
  487|       |        mi_to_pixel_loc(&pixel_c, &pixel_r, mi_col, mi_row, 0, 0,
  488|       |                        pd->subsampling_x, pd->subsampling_y);
  489|       |        if (!is_chroma_reference(mi_row, mi_col, bsize, pd->subsampling_x,
  490|       |                                 pd->subsampling_y))
  491|       |          continue;
  492|       |        mismatch_record_block_pre(pd->dst.buf, pd->dst.stride,
  493|       |                                  cm->current_frame.order_hint, plane, pixel_c,
  494|       |                                  pixel_r, pd->width, pd->height,
  495|       |                                  xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH);
  496|       |      }
  497|       |    }
  498|       |#else
  499|  1.13M|    (void)num_planes;
  500|  1.13M|#endif
  501|       |
  502|  1.13M|    av1_encode_sb(cpi, x, bsize, dry_run);
  503|  1.13M|    av1_tokenize_sb_vartx(cpi, td, dry_run, bsize, rate,
  504|  1.13M|                          tile_data->allow_update_cdf);
  505|  1.13M|  }
  506|       |
  507|  6.38M|  if (!dry_run) {
  ------------------
  |  Branch (507:7): [True: 2.04M, False: 4.34M]
  ------------------
  508|  2.04M|    if (av1_allow_intrabc(cm) && is_intrabc_block(mbmi)) td->intrabc_used = 1;
  ------------------
  |  Branch (508:9): [True: 13.0k, False: 2.03M]
  |  Branch (508:34): [True: 0, False: 13.0k]
  ------------------
  509|  2.04M|    if (txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (509:9): [True: 1.96M, False: 74.4k]
  ------------------
  510|  1.96M|        !xd->lossless[mbmi->segment_id] && mbmi->bsize > BLOCK_4X4 &&
  ------------------
  |  Branch (510:9): [True: 1.96M, False: 18.4E]
  |  Branch (510:44): [True: 1.93M, False: 38.7k]
  ------------------
  511|  1.93M|        !(is_inter && (mbmi->skip_txfm || seg_skip))) {
  ------------------
  |  Branch (511:11): [True: 470k, False: 1.45M]
  |  Branch (511:24): [True: 43.5k, False: 427k]
  |  Branch (511:43): [True: 18.4E, False: 427k]
  ------------------
  512|  1.88M|      if (is_inter) {
  ------------------
  |  Branch (512:11): [True: 427k, False: 1.45M]
  ------------------
  513|   427k|        tx_partition_count_update(cm, x, bsize, td->counts,
  514|   427k|                                  tile_data->allow_update_cdf);
  515|  1.45M|      } else {
  516|  1.45M|        if (mbmi->tx_size != max_txsize_rect_lookup[bsize])
  ------------------
  |  Branch (516:13): [True: 361k, False: 1.09M]
  ------------------
  517|   361k|          ++x->txfm_search_info.txb_split_count;
  518|  1.45M|        if (block_signals_txsize(bsize)) {
  ------------------
  |  Branch (518:13): [True: 1.45M, False: 18.4E]
  ------------------
  519|  1.45M|          const int tx_size_ctx = get_tx_size_context(xd);
  520|  1.45M|          const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
  521|  1.45M|          const int depth = tx_size_to_depth(mbmi->tx_size, bsize);
  522|  1.45M|          const int max_depths = bsize_to_max_depth(bsize);
  523|       |
  524|  1.45M|          if (tile_data->allow_update_cdf)
  ------------------
  |  Branch (524:15): [True: 1.45M, False: 132]
  ------------------
  525|  1.45M|            update_cdf(xd->tile_ctx->tx_size_cdf[tx_size_cat][tx_size_ctx],
  526|  1.45M|                       depth, max_depths + 1);
  527|       |#if CONFIG_ENTROPY_STATS
  528|       |          ++td->counts->intra_tx_size[tx_size_cat][tx_size_ctx][depth];
  529|       |#endif
  530|  1.45M|        }
  531|  1.45M|      }
  532|  1.88M|      assert(IMPLIES(is_rect_tx(mbmi->tx_size), is_rect_tx_allowed(xd, mbmi)));
  533|  1.88M|    } else {
  534|   156k|      int i, j;
  535|   156k|      TX_SIZE intra_tx_size;
  536|       |      // The new intra coding scheme requires no change of transform size
  537|   156k|      if (is_inter) {
  ------------------
  |  Branch (537:11): [True: 84.7k, False: 71.9k]
  ------------------
  538|  84.7k|        if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (538:13): [True: 37.7k, False: 47.0k]
  ------------------
  539|  37.7k|          intra_tx_size = TX_4X4;
  540|  47.0k|        } else {
  541|  47.0k|          intra_tx_size =
  542|  47.0k|              tx_size_from_tx_mode(bsize, txfm_params->tx_mode_search_type);
  543|  47.0k|        }
  544|  84.7k|      } else {
  545|  71.9k|        intra_tx_size = mbmi->tx_size;
  546|  71.9k|      }
  547|       |
  548|   156k|      const int cols = AOMMIN(cm->mi_params.mi_cols - mi_col, mi_width);
  ------------------
  |  |   34|   156k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 785, False: 155k]
  |  |  ------------------
  ------------------
  549|   156k|      const int rows = AOMMIN(cm->mi_params.mi_rows - mi_row, mi_height);
  ------------------
  |  |   34|   156k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 683, False: 156k]
  |  |  ------------------
  ------------------
  550|   464k|      for (j = 0; j < rows; j++) {
  ------------------
  |  Branch (550:19): [True: 307k, False: 156k]
  ------------------
  551|  1.05M|        for (i = 0; i < cols; i++) mi_4x4[mis * j + i]->tx_size = intra_tx_size;
  ------------------
  |  Branch (551:21): [True: 751k, False: 307k]
  ------------------
  552|   307k|      }
  553|       |
  554|   156k|      if (intra_tx_size != max_txsize_rect_lookup[bsize])
  ------------------
  |  Branch (554:11): [True: 74.5k, False: 82.1k]
  ------------------
  555|  74.5k|        ++x->txfm_search_info.txb_split_count;
  556|   156k|    }
  557|  2.04M|  }
  558|       |
  559|  6.38M|  if (txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (559:7): [True: 6.20M, False: 189k]
  ------------------
  560|  6.20M|      block_signals_txsize(mbmi->bsize) && is_inter &&
  ------------------
  |  Branch (560:7): [True: 5.81M, False: 381k]
  |  Branch (560:44): [True: 1.00M, False: 4.81M]
  ------------------
  561|  1.00M|      !(mbmi->skip_txfm || seg_skip) && !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (561:9): [True: 179k, False: 828k]
  |  Branch (561:28): [True: 18.4E, False: 828k]
  |  Branch (561:41): [True: 828k, False: 18.4E]
  ------------------
  562|   828k|    if (dry_run) tx_partition_set_contexts(cm, xd, bsize);
  ------------------
  |  Branch (562:9): [True: 401k, False: 427k]
  ------------------
  563|  5.56M|  } else {
  564|  5.56M|    TX_SIZE tx_size = mbmi->tx_size;
  565|       |    // The new intra coding scheme requires no change of transform size
  566|  5.56M|    if (is_inter) {
  ------------------
  |  Branch (566:9): [True: 310k, False: 5.25M]
  ------------------
  567|   310k|      if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (567:11): [True: 89.0k, False: 221k]
  ------------------
  568|  89.0k|        tx_size = TX_4X4;
  569|   221k|      } else {
  570|   221k|        tx_size = tx_size_from_tx_mode(bsize, txfm_params->tx_mode_search_type);
  571|   221k|      }
  572|  5.25M|    } else {
  573|  5.25M|      tx_size = (bsize > BLOCK_4X4) ? tx_size : TX_4X4;
  ------------------
  |  Branch (573:17): [True: 4.91M, False: 337k]
  ------------------
  574|  5.25M|    }
  575|  5.56M|    mbmi->tx_size = tx_size;
  576|  5.56M|    set_txfm_ctxs(tx_size, xd->width, xd->height,
  577|  5.56M|                  (mbmi->skip_txfm || seg_skip) && is_inter_block(mbmi), xd);
  ------------------
  |  Branch (577:20): [True: 195k, False: 5.36M]
  |  Branch (577:39): [True: 18.4E, False: 5.36M]
  |  Branch (577:52): [True: 198k, False: 11]
  ------------------
  578|  5.56M|  }
  579|       |
  580|  6.38M|#if !CONFIG_REALTIME_ONLY
  581|  6.38M|  if (is_inter_block(mbmi) && !xd->is_chroma_ref && is_cfl_allowed(xd)) {
  ------------------
  |  Branch (581:7): [True: 1.13M, False: 5.25M]
  |  Branch (581:31): [True: 24.8k, False: 1.11M]
  |  Branch (581:53): [True: 24.8k, False: 0]
  ------------------
  582|  24.8k|    cfl_store_block(xd, mbmi->bsize, mbmi->tx_size);
  583|  24.8k|  }
  584|  6.38M|#endif
  585|  6.38M|  if (!dry_run) {
  ------------------
  |  Branch (585:7): [True: 2.04M, False: 4.34M]
  ------------------
  586|  2.04M|    if (cpi->oxcf.pass == AOM_RC_ONE_PASS && cpi->svc.temporal_layer_id == 0 &&
  ------------------
  |  Branch (586:9): [True: 2.04M, False: 0]
  |  Branch (586:46): [True: 2.04M, False: 18.4E]
  ------------------
  587|  2.04M|        cpi->sf.rt_sf.use_temporal_noise_estimate &&
  ------------------
  |  Branch (587:9): [True: 0, False: 2.04M]
  ------------------
  588|      0|        (!cpi->ppi->use_svc ||
  ------------------
  |  Branch (588:10): [True: 0, False: 0]
  ------------------
  589|      0|         (cpi->ppi->use_svc &&
  ------------------
  |  Branch (589:11): [True: 0, False: 0]
  ------------------
  590|      0|          !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
  ------------------
  |  Branch (590:11): [True: 0, False: 0]
  ------------------
  591|      0|          cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)))
  ------------------
  |  Branch (591:11): [True: 0, False: 0]
  ------------------
  592|      0|      update_zeromv_cnt(cpi, mbmi, mi_row, mi_col, bsize);
  593|  2.04M|  }
  594|  6.38M|}
partition_search.c:tx_partition_count_update:
  283|   427k|                                      uint8_t allow_update_cdf) {
  284|   427k|  MACROBLOCKD *xd = &x->e_mbd;
  285|   427k|  const int mi_width = mi_size_wide[plane_bsize];
  286|   427k|  const int mi_height = mi_size_high[plane_bsize];
  287|   427k|  const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0);
  288|   427k|  const int bh = tx_size_high_unit[max_tx_size];
  289|   427k|  const int bw = tx_size_wide_unit[max_tx_size];
  290|       |
  291|   427k|  xd->above_txfm_context =
  292|   427k|      cm->above_contexts.txfm[xd->tile.tile_row] + xd->mi_col;
  293|   427k|  xd->left_txfm_context =
  294|   427k|      xd->left_txfm_context_buffer + (xd->mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|   427k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   427k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   427k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   427k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   427k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  295|       |
  296|   854k|  for (int idy = 0; idy < mi_height; idy += bh) {
  ------------------
  |  Branch (296:21): [True: 427k, False: 427k]
  ------------------
  297|   854k|    for (int idx = 0; idx < mi_width; idx += bw) {
  ------------------
  |  Branch (297:23): [True: 427k, False: 427k]
  ------------------
  298|   427k|      update_txfm_count(x, xd, td_counts, max_tx_size, 0, idy, idx,
  299|   427k|                        allow_update_cdf);
  300|   427k|    }
  301|   427k|  }
  302|   427k|}
partition_search.c:update_txfm_count:
  217|   819k|                              uint8_t allow_update_cdf) {
  218|   819k|  MB_MODE_INFO *mbmi = xd->mi[0];
  219|   819k|  const BLOCK_SIZE bsize = mbmi->bsize;
  220|   819k|  const int max_blocks_high = max_block_high(xd, bsize, 0);
  221|   819k|  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
  222|   819k|  int ctx = txfm_partition_context(xd->above_txfm_context + blk_col,
  223|   819k|                                   xd->left_txfm_context + blk_row, mbmi->bsize,
  224|   819k|                                   tx_size);
  225|   819k|  const int txb_size_index = av1_get_txb_size_index(bsize, blk_row, blk_col);
  226|   819k|  const TX_SIZE plane_tx_size = mbmi->inter_tx_size[txb_size_index];
  227|       |
  228|   819k|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (228:7): [True: 2.78k, False: 816k]
  |  Branch (228:37): [True: 3.47k, False: 813k]
  ------------------
  229|   819k|  assert(tx_size > TX_4X4);
  230|       |
  231|   813k|  if (depth == MAX_VARTX_DEPTH) {
  ------------------
  |  |   56|   813k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (231:7): [True: 119k, False: 693k]
  ------------------
  232|       |    // Don't add to counts in this case
  233|   119k|    mbmi->tx_size = tx_size;
  234|   119k|    txfm_partition_update(xd->above_txfm_context + blk_col,
  235|   119k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
  236|   119k|    return;
  237|   119k|  }
  238|       |
  239|   693k|  if (tx_size == plane_tx_size) {
  ------------------
  |  Branch (239:7): [True: 581k, False: 112k]
  ------------------
  240|       |#if CONFIG_ENTROPY_STATS
  241|       |    ++counts->txfm_partition[ctx][0];
  242|       |#endif
  243|   581k|    if (allow_update_cdf)
  ------------------
  |  Branch (243:9): [True: 581k, False: 18.4E]
  ------------------
  244|   581k|      update_cdf(xd->tile_ctx->txfm_partition_cdf[ctx], 0, 2);
  245|   581k|    mbmi->tx_size = tx_size;
  246|   581k|    txfm_partition_update(xd->above_txfm_context + blk_col,
  247|   581k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
  248|   581k|  } else {
  249|   112k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  250|   112k|    const int bsw = tx_size_wide_unit[sub_txs];
  251|   112k|    const int bsh = tx_size_high_unit[sub_txs];
  252|       |
  253|       |#if CONFIG_ENTROPY_STATS
  254|       |    ++counts->txfm_partition[ctx][1];
  255|       |#endif
  256|   112k|    if (allow_update_cdf)
  ------------------
  |  Branch (256:9): [True: 113k, False: 18.4E]
  ------------------
  257|   113k|      update_cdf(xd->tile_ctx->txfm_partition_cdf[ctx], 1, 2);
  258|   112k|    ++x->txfm_search_info.txb_split_count;
  259|       |
  260|   112k|    if (sub_txs == TX_4X4) {
  ------------------
  |  Branch (260:9): [True: 5.50k, False: 107k]
  ------------------
  261|  5.50k|      mbmi->inter_tx_size[txb_size_index] = TX_4X4;
  262|  5.50k|      mbmi->tx_size = TX_4X4;
  263|  5.50k|      txfm_partition_update(xd->above_txfm_context + blk_col,
  264|  5.50k|                            xd->left_txfm_context + blk_row, TX_4X4, tx_size);
  265|  5.50k|      return;
  266|  5.50k|    }
  267|       |
  268|   312k|    for (int row = 0; row < tx_size_high_unit[tx_size]; row += bsh) {
  ------------------
  |  Branch (268:23): [True: 205k, False: 107k]
  ------------------
  269|   597k|      for (int col = 0; col < tx_size_wide_unit[tx_size]; col += bsw) {
  ------------------
  |  Branch (269:25): [True: 392k, False: 205k]
  ------------------
  270|   392k|        int offsetr = row;
  271|   392k|        int offsetc = col;
  272|       |
  273|   392k|        update_txfm_count(x, xd, counts, sub_txs, depth + 1, blk_row + offsetr,
  274|   392k|                          blk_col + offsetc, allow_update_cdf);
  275|   392k|      }
  276|   205k|    }
  277|   107k|  }
  278|   693k|}
partition_search.c:tx_partition_set_contexts:
  346|   401k|                                      MACROBLOCKD *xd, BLOCK_SIZE plane_bsize) {
  347|   401k|  const int mi_width = mi_size_wide[plane_bsize];
  348|   401k|  const int mi_height = mi_size_high[plane_bsize];
  349|   401k|  const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, 0);
  350|   401k|  const int bh = tx_size_high_unit[max_tx_size];
  351|   401k|  const int bw = tx_size_wide_unit[max_tx_size];
  352|       |
  353|   401k|  xd->above_txfm_context =
  354|   401k|      cm->above_contexts.txfm[xd->tile.tile_row] + xd->mi_col;
  355|   401k|  xd->left_txfm_context =
  356|   401k|      xd->left_txfm_context_buffer + (xd->mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|   401k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   401k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   401k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   401k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   401k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|       |
  358|   803k|  for (int idy = 0; idy < mi_height; idy += bh) {
  ------------------
  |  Branch (358:21): [True: 401k, False: 401k]
  ------------------
  359|   803k|    for (int idx = 0; idx < mi_width; idx += bw) {
  ------------------
  |  Branch (359:23): [True: 401k, False: 401k]
  ------------------
  360|   401k|      set_txfm_context(xd, max_tx_size, idy, idx);
  361|   401k|    }
  362|   401k|  }
  363|   401k|}
partition_search.c:set_txfm_context:
  305|   450k|                             int blk_col) {
  306|   450k|  MB_MODE_INFO *mbmi = xd->mi[0];
  307|   450k|  const BLOCK_SIZE bsize = mbmi->bsize;
  308|   450k|  const int max_blocks_high = max_block_high(xd, bsize, 0);
  309|   450k|  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
  310|   450k|  const int txb_size_index = av1_get_txb_size_index(bsize, blk_row, blk_col);
  311|   450k|  const TX_SIZE plane_tx_size = mbmi->inter_tx_size[txb_size_index];
  312|       |
  313|   450k|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (313:7): [True: 18.4E, False: 450k]
  |  Branch (313:37): [True: 18.4E, False: 450k]
  ------------------
  314|       |
  315|   450k|  if (tx_size == plane_tx_size) {
  ------------------
  |  Branch (315:7): [True: 422k, False: 27.7k]
  ------------------
  316|   422k|    mbmi->tx_size = tx_size;
  317|   422k|    txfm_partition_update(xd->above_txfm_context + blk_col,
  318|   422k|                          xd->left_txfm_context + blk_row, tx_size, tx_size);
  319|       |
  320|   422k|  } else {
  321|  27.7k|    if (tx_size == TX_8X8) {
  ------------------
  |  Branch (321:9): [True: 14.8k, False: 12.9k]
  ------------------
  322|  14.8k|      mbmi->inter_tx_size[txb_size_index] = TX_4X4;
  323|  14.8k|      mbmi->tx_size = TX_4X4;
  324|  14.8k|      txfm_partition_update(xd->above_txfm_context + blk_col,
  325|  14.8k|                            xd->left_txfm_context + blk_row, TX_4X4, tx_size);
  326|  14.8k|      return;
  327|  14.8k|    }
  328|  12.9k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  329|  12.9k|    const int bsw = tx_size_wide_unit[sub_txs];
  330|  12.9k|    const int bsh = tx_size_high_unit[sub_txs];
  331|  12.9k|    const int row_end =
  332|  12.9k|        AOMMIN(tx_size_high_unit[tx_size], max_blocks_high - blk_row);
  ------------------
  |  |   34|  12.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 218, False: 12.7k]
  |  |  ------------------
  ------------------
  333|  12.9k|    const int col_end =
  334|  12.9k|        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
  ------------------
  |  |   34|  12.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 218, False: 12.7k]
  |  |  ------------------
  ------------------
  335|  37.9k|    for (int row = 0; row < row_end; row += bsh) {
  ------------------
  |  Branch (335:23): [True: 25.0k, False: 12.9k]
  ------------------
  336|  25.0k|      const int offsetr = blk_row + row;
  337|  73.4k|      for (int col = 0; col < col_end; col += bsw) {
  ------------------
  |  Branch (337:25): [True: 48.4k, False: 25.0k]
  ------------------
  338|  48.4k|        const int offsetc = blk_col + col;
  339|  48.4k|        set_txfm_context(xd, sub_txs, offsetr, offsetc);
  340|  48.4k|      }
  341|  25.0k|    }
  342|  12.9k|  }
  343|   450k|}
partition_search.c:encode_sb:
 1587|  8.38M|                      PC_TREE *pc_tree, int *rate) {
 1588|  8.38M|  assert(bsize < BLOCK_SIZES_ALL);
 1589|  8.38M|  const AV1_COMMON *const cm = &cpi->common;
 1590|  8.38M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1591|  8.38M|  MACROBLOCK *const x = &td->mb;
 1592|  8.38M|  MACROBLOCKD *const xd = &x->e_mbd;
 1593|  8.38M|  assert(bsize < BLOCK_SIZES_ALL);
 1594|  8.38M|  const int hbs = mi_size_wide[bsize] / 2;
 1595|  8.38M|  const int is_partition_root = bsize >= BLOCK_8X8;
 1596|  8.38M|  const int ctx = is_partition_root
  ------------------
  |  Branch (1596:19): [True: 8.00M, False: 381k]
  ------------------
 1597|  8.38M|                      ? partition_plane_context(xd, mi_row, mi_col, bsize)
 1598|  8.38M|                      : -1;
 1599|  8.38M|  const PARTITION_TYPE partition = pc_tree->partitioning;
 1600|  8.38M|  const BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);
 1601|  8.38M|#if !CONFIG_REALTIME_ONLY
 1602|  8.38M|  int quarter_step = mi_size_wide[bsize] / 4;
 1603|  8.38M|  int i;
 1604|  8.38M|  BLOCK_SIZE bsize2 = get_partition_subsize(bsize, PARTITION_SPLIT);
 1605|  8.38M|#endif
 1606|       |
 1607|  8.38M|  if (mi_row >= mi_params->mi_rows || mi_col >= mi_params->mi_cols) return;
  ------------------
  |  Branch (1607:7): [True: 740k, False: 7.64M]
  |  Branch (1607:39): [True: 561k, False: 7.08M]
  ------------------
 1608|  7.08M|  if (subsize == BLOCK_INVALID) return;
  ------------------
  |  Branch (1608:7): [True: 0, False: 7.08M]
  ------------------
 1609|       |
 1610|  7.08M|  if (!dry_run && ctx >= 0) {
  ------------------
  |  Branch (1610:7): [True: 2.13M, False: 4.94M]
  |  Branch (1610:19): [True: 2.09M, False: 38.8k]
  ------------------
 1611|  2.09M|    const int has_rows = (mi_row + hbs) < mi_params->mi_rows;
 1612|  2.09M|    const int has_cols = (mi_col + hbs) < mi_params->mi_cols;
 1613|       |
 1614|  2.09M|    if (has_rows && has_cols) {
  ------------------
  |  Branch (1614:9): [True: 1.90M, False: 186k]
  |  Branch (1614:21): [True: 1.80M, False: 106k]
  ------------------
 1615|       |#if CONFIG_ENTROPY_STATS
 1616|       |      td->counts->partition[ctx][partition]++;
 1617|       |#endif
 1618|       |
 1619|  1.80M|      if (tile_data->allow_update_cdf) {
  ------------------
  |  Branch (1619:11): [True: 1.80M, False: 18.4E]
  ------------------
 1620|  1.80M|        FRAME_CONTEXT *fc = xd->tile_ctx;
 1621|  1.80M|        update_cdf(fc->partition_cdf[ctx], partition,
 1622|  1.80M|                   partition_cdf_length(bsize));
 1623|  1.80M|      }
 1624|  1.80M|    }
 1625|  2.09M|  }
 1626|       |
 1627|  7.08M|  switch (partition) {
 1628|  5.42M|    case PARTITION_NONE:
  ------------------
  |  Branch (1628:5): [True: 5.42M, False: 1.65M]
  ------------------
 1629|  5.42M|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, subsize,
 1630|  5.42M|               partition, pc_tree->none, rate);
 1631|  5.42M|      break;
 1632|  55.2k|    case PARTITION_VERT:
  ------------------
  |  Branch (1632:5): [True: 55.2k, False: 7.02M]
  ------------------
 1633|  55.2k|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, subsize,
 1634|  55.2k|               partition, pc_tree->vertical[0], rate);
 1635|  55.2k|      if (mi_col + hbs < mi_params->mi_cols) {
  ------------------
  |  Branch (1635:11): [True: 18.7k, False: 36.5k]
  ------------------
 1636|  18.7k|        encode_b(cpi, tile_data, td, tp, mi_row, mi_col + hbs, dry_run, subsize,
 1637|  18.7k|                 partition, pc_tree->vertical[1], rate);
 1638|  18.7k|      }
 1639|  55.2k|      break;
 1640|  43.3k|    case PARTITION_HORZ:
  ------------------
  |  Branch (1640:5): [True: 43.3k, False: 7.03M]
  ------------------
 1641|  43.3k|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, subsize,
 1642|  43.3k|               partition, pc_tree->horizontal[0], rate);
 1643|  43.3k|      if (mi_row + hbs < mi_params->mi_rows) {
  ------------------
  |  Branch (1643:11): [True: 26.6k, False: 16.7k]
  ------------------
 1644|  26.6k|        encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col, dry_run, subsize,
 1645|  26.6k|                 partition, pc_tree->horizontal[1], rate);
 1646|  26.6k|      }
 1647|  43.3k|      break;
 1648|  1.55M|    case PARTITION_SPLIT:
  ------------------
  |  Branch (1648:5): [True: 1.55M, False: 5.52M]
  ------------------
 1649|  1.55M|      encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, dry_run, subsize,
 1650|  1.55M|                pc_tree->split[0], rate);
 1651|  1.55M|      encode_sb(cpi, td, tile_data, tp, mi_row, mi_col + hbs, dry_run, subsize,
 1652|  1.55M|                pc_tree->split[1], rate);
 1653|  1.55M|      encode_sb(cpi, td, tile_data, tp, mi_row + hbs, mi_col, dry_run, subsize,
 1654|  1.55M|                pc_tree->split[2], rate);
 1655|  1.55M|      encode_sb(cpi, td, tile_data, tp, mi_row + hbs, mi_col + hbs, dry_run,
 1656|  1.55M|                subsize, pc_tree->split[3], rate);
 1657|  1.55M|      break;
 1658|       |
 1659|      0|#if !CONFIG_REALTIME_ONLY
 1660|      0|    case PARTITION_HORZ_A:
  ------------------
  |  Branch (1660:5): [True: 0, False: 7.08M]
  ------------------
 1661|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, bsize2,
 1662|      0|               partition, pc_tree->horizontala[0], rate);
 1663|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col + hbs, dry_run, bsize2,
 1664|      0|               partition, pc_tree->horizontala[1], rate);
 1665|      0|      encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col, dry_run, subsize,
 1666|      0|               partition, pc_tree->horizontala[2], rate);
 1667|      0|      break;
 1668|      0|    case PARTITION_HORZ_B:
  ------------------
  |  Branch (1668:5): [True: 0, False: 7.08M]
  ------------------
 1669|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, subsize,
 1670|      0|               partition, pc_tree->horizontalb[0], rate);
 1671|      0|      encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col, dry_run, bsize2,
 1672|      0|               partition, pc_tree->horizontalb[1], rate);
 1673|      0|      encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col + hbs, dry_run,
 1674|      0|               bsize2, partition, pc_tree->horizontalb[2], rate);
 1675|      0|      break;
 1676|      0|    case PARTITION_VERT_A:
  ------------------
  |  Branch (1676:5): [True: 0, False: 7.08M]
  ------------------
 1677|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, bsize2,
 1678|      0|               partition, pc_tree->verticala[0], rate);
 1679|      0|      encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col, dry_run, bsize2,
 1680|      0|               partition, pc_tree->verticala[1], rate);
 1681|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col + hbs, dry_run, subsize,
 1682|      0|               partition, pc_tree->verticala[2], rate);
 1683|       |
 1684|      0|      break;
 1685|      0|    case PARTITION_VERT_B:
  ------------------
  |  Branch (1685:5): [True: 0, False: 7.08M]
  ------------------
 1686|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col, dry_run, subsize,
 1687|      0|               partition, pc_tree->verticalb[0], rate);
 1688|      0|      encode_b(cpi, tile_data, td, tp, mi_row, mi_col + hbs, dry_run, bsize2,
 1689|      0|               partition, pc_tree->verticalb[1], rate);
 1690|      0|      encode_b(cpi, tile_data, td, tp, mi_row + hbs, mi_col + hbs, dry_run,
 1691|      0|               bsize2, partition, pc_tree->verticalb[2], rate);
 1692|      0|      break;
 1693|      0|    case PARTITION_HORZ_4:
  ------------------
  |  Branch (1693:5): [True: 0, False: 7.08M]
  ------------------
 1694|      0|      for (i = 0; i < SUB_PARTITIONS_PART4; ++i) {
  ------------------
  |  |   55|      0|#define SUB_PARTITIONS_PART4 4
  ------------------
  |  Branch (1694:19): [True: 0, False: 0]
  ------------------
 1695|      0|        int this_mi_row = mi_row + i * quarter_step;
 1696|      0|        if (i > 0 && this_mi_row >= mi_params->mi_rows) break;
  ------------------
  |  Branch (1696:13): [True: 0, False: 0]
  |  Branch (1696:22): [True: 0, False: 0]
  ------------------
 1697|       |
 1698|      0|        encode_b(cpi, tile_data, td, tp, this_mi_row, mi_col, dry_run, subsize,
 1699|      0|                 partition, pc_tree->horizontal4[i], rate);
 1700|      0|      }
 1701|      0|      break;
 1702|      0|    case PARTITION_VERT_4:
  ------------------
  |  Branch (1702:5): [True: 0, False: 7.08M]
  ------------------
 1703|      0|      for (i = 0; i < SUB_PARTITIONS_PART4; ++i) {
  ------------------
  |  |   55|      0|#define SUB_PARTITIONS_PART4 4
  ------------------
  |  Branch (1703:19): [True: 0, False: 0]
  ------------------
 1704|      0|        int this_mi_col = mi_col + i * quarter_step;
 1705|      0|        if (i > 0 && this_mi_col >= mi_params->mi_cols) break;
  ------------------
  |  Branch (1705:13): [True: 0, False: 0]
  |  Branch (1705:22): [True: 0, False: 0]
  ------------------
 1706|      0|        encode_b(cpi, tile_data, td, tp, mi_row, this_mi_col, dry_run, subsize,
 1707|      0|                 partition, pc_tree->vertical4[i], rate);
 1708|      0|      }
 1709|      0|      break;
 1710|      0|#endif
 1711|      0|    default: assert(0 && "Invalid partition type."); break;
  ------------------
  |  Branch (1711:5): [True: 0, False: 7.08M]
  ------------------
 1712|  7.08M|  }
 1713|       |
 1714|  7.08M|  update_ext_partition_context(xd, mi_row, mi_col, subsize, bsize, partition);
 1715|  7.08M|}
partition_search.c:encode_b:
 1426|  5.57M|                     int *rate) {
 1427|  5.57M|  const AV1_COMMON *const cm = &cpi->common;
 1428|  5.57M|  TileInfo *const tile = &tile_data->tile_info;
 1429|  5.57M|  MACROBLOCK *const x = &td->mb;
 1430|  5.57M|  MACROBLOCKD *xd = &x->e_mbd;
 1431|  5.57M|  const int subsampling_x = cm->seq_params->subsampling_x;
 1432|  5.57M|  const int subsampling_y = cm->seq_params->subsampling_y;
 1433|       |
 1434|  5.57M|  av1_set_offsets_without_segment_id(cpi, tile, x, mi_row, mi_col, bsize);
 1435|  5.57M|  const int origin_mult = x->rdmult;
 1436|  5.57M|  setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, NO_AQ, NULL);
 1437|  5.57M|  MB_MODE_INFO *mbmi = xd->mi[0];
 1438|  5.57M|  mbmi->partition = partition;
 1439|  5.57M|  av1_update_state(cpi, td, ctx, mi_row, mi_col, bsize, dry_run);
 1440|       |
 1441|  5.57M|  if (!dry_run) {
  ------------------
  |  Branch (1441:7): [True: 1.47M, False: 4.09M]
  ------------------
 1442|  1.47M|    set_cb_offsets(x->mbmi_ext_frame->cb_offset, x->cb_offset[PLANE_TYPE_Y],
 1443|  1.47M|                   x->cb_offset[PLANE_TYPE_UV]);
 1444|  1.47M|    assert(x->cb_offset[PLANE_TYPE_Y] <
 1445|  1.47M|           (1 << num_pels_log2_lookup[cpi->common.seq_params->sb_size]));
 1446|  1.47M|    assert(x->cb_offset[PLANE_TYPE_UV] <
 1447|  1.47M|           ((1 << num_pels_log2_lookup[cpi->common.seq_params->sb_size]) >>
 1448|  1.47M|            (subsampling_x + subsampling_y)));
 1449|  1.47M|  }
 1450|       |
 1451|  5.57M|  encode_superblock(cpi, tile_data, td, tp, dry_run, bsize, rate);
 1452|       |
 1453|  5.57M|  if (!dry_run) {
  ------------------
  |  Branch (1453:7): [True: 1.47M, False: 4.09M]
  ------------------
 1454|  1.47M|    update_cb_offsets(x, bsize, subsampling_x, subsampling_y);
 1455|  1.47M|    if (bsize == cpi->common.seq_params->sb_size && mbmi->skip_txfm == 1 &&
  ------------------
  |  Branch (1455:9): [True: 1.80k, False: 1.47M]
  |  Branch (1455:53): [True: 138, False: 1.66k]
  ------------------
 1456|    138|        cm->delta_q_info.delta_lf_present_flag) {
  ------------------
  |  Branch (1456:9): [True: 0, False: 138]
  ------------------
 1457|      0|      const int frame_lf_count =
 1458|      0|          av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
                        av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (1458:11): [True: 0, False: 0]
  ------------------
 1459|      0|      for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id)
  ------------------
  |  Branch (1459:27): [True: 0, False: 0]
  ------------------
 1460|      0|        mbmi->delta_lf[lf_id] = xd->delta_lf[lf_id];
 1461|      0|      mbmi->delta_lf_from_base = xd->delta_lf_from_base;
 1462|      0|    }
 1463|  1.47M|    if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1463:9): [True: 0, False: 1.47M]
  ------------------
 1464|      0|      if (mbmi->compound_idx == 0 ||
  ------------------
  |  Branch (1464:11): [True: 0, False: 0]
  ------------------
 1465|      0|          mbmi->interinter_comp.type == COMPOUND_AVERAGE)
  ------------------
  |  Branch (1465:11): [True: 0, False: 0]
  ------------------
 1466|      0|        mbmi->comp_group_idx = 0;
 1467|      0|      else
 1468|      0|        mbmi->comp_group_idx = 1;
 1469|      0|    }
 1470|       |
 1471|       |    // delta quant applies to both intra and inter
 1472|  1.47M|    const int super_block_upper_left =
 1473|  1.47M|        ((mi_row & (cm->seq_params->mib_size - 1)) == 0) &&
  ------------------
  |  Branch (1473:9): [True: 335k, False: 1.14M]
  ------------------
 1474|   335k|        ((mi_col & (cm->seq_params->mib_size - 1)) == 0);
  ------------------
  |  Branch (1474:9): [True: 88.3k, False: 247k]
  ------------------
 1475|  1.47M|    const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
 1476|  1.47M|    if (delta_q_info->delta_q_present_flag &&
  ------------------
  |  Branch (1476:9): [True: 989k, False: 486k]
  ------------------
 1477|   989k|        (bsize != cm->seq_params->sb_size || !mbmi->skip_txfm) &&
  ------------------
  |  Branch (1477:10): [True: 988k, False: 918]
  |  Branch (1477:46): [True: 885, False: 33]
  ------------------
 1478|   989k|        super_block_upper_left) {
  ------------------
  |  Branch (1478:9): [True: 59.9k, False: 929k]
  ------------------
 1479|  59.9k|      xd->current_base_qindex = mbmi->current_qindex;
 1480|  59.9k|      if (delta_q_info->delta_lf_present_flag) {
  ------------------
  |  Branch (1480:11): [True: 0, False: 59.9k]
  ------------------
 1481|      0|        if (delta_q_info->delta_lf_multi) {
  ------------------
  |  Branch (1481:13): [True: 0, False: 0]
  ------------------
 1482|      0|          const int frame_lf_count =
 1483|      0|              av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
                            av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
  ------------------
  |  |   72|      0|#define FRAME_LF_COUNT 4
  ------------------
  |  Branch (1483:15): [True: 0, False: 0]
  ------------------
 1484|      0|          for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) {
  ------------------
  |  Branch (1484:31): [True: 0, False: 0]
  ------------------
 1485|      0|            xd->delta_lf[lf_id] = mbmi->delta_lf[lf_id];
 1486|      0|          }
 1487|      0|        } else {
 1488|      0|          xd->delta_lf_from_base = mbmi->delta_lf_from_base;
 1489|      0|        }
 1490|      0|      }
 1491|  59.9k|    }
 1492|       |
 1493|  1.47M|    RD_COUNTS *rdc = &td->rd_counts;
 1494|  1.47M|    if (mbmi->skip_mode) {
  ------------------
  |  Branch (1494:9): [True: 0, False: 1.47M]
  ------------------
 1495|      0|      assert(!frame_is_intra_only(cm));
 1496|      0|      rdc->skip_mode_used_flag = 1;
 1497|      0|      if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (1497:11): [True: 0, False: 0]
  ------------------
 1498|      0|        assert(has_second_ref(mbmi));
 1499|      0|        rdc->compound_ref_used_flag = 1;
 1500|      0|      }
 1501|      0|      set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 1502|  1.47M|    } else {
 1503|  1.47M|      const int seg_ref_active =
 1504|  1.47M|          segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
 1505|  1.47M|      if (!seg_ref_active) {
  ------------------
  |  Branch (1505:11): [True: 1.47M, False: 160]
  ------------------
 1506|       |        // If the segment reference feature is enabled we have only a single
 1507|       |        // reference frame allowed for the segment so exclude it from
 1508|       |        // the reference frame counts used to work out probabilities.
 1509|  1.47M|        if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (1509:13): [True: 179k, False: 1.29M]
  ------------------
 1510|   179k|          av1_collect_neighbors_ref_counts(xd);
 1511|   179k|          if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (1511:15): [True: 179k, False: 46]
  ------------------
 1512|   179k|            if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1512:17): [True: 0, False: 179k]
  ------------------
 1513|       |              // This flag is also updated for 4x4 blocks
 1514|      0|              rdc->compound_ref_used_flag = 1;
 1515|      0|            }
 1516|   179k|          }
 1517|   179k|          set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 1518|   179k|        }
 1519|  1.47M|      }
 1520|  1.47M|    }
 1521|       |
 1522|  1.47M|    if (tile_data->allow_update_cdf) update_stats(&cpi->common, td);
  ------------------
  |  Branch (1522:9): [True: 1.47M, False: 344]
  ------------------
 1523|       |
 1524|       |    // Gather obmc and warped motion count to update the probability.
 1525|  1.47M|    if ((cpi->sf.inter_sf.prune_obmc_prob_thresh > 0 &&
  ------------------
  |  Branch (1525:10): [True: 1.47M, False: 151]
  ------------------
 1526|  1.47M|         cpi->sf.inter_sf.prune_obmc_prob_thresh < INT_MAX) ||
  ------------------
  |  Branch (1526:10): [True: 0, False: 1.47M]
  ------------------
 1527|  1.47M|        (cm->features.allow_warped_motion &&
  ------------------
  |  Branch (1527:10): [True: 1.38M, False: 90.5k]
  ------------------
 1528|  1.38M|         cpi->sf.inter_sf.prune_warped_prob_thresh > 0)) {
  ------------------
  |  Branch (1528:10): [True: 0, False: 1.38M]
  ------------------
 1529|      0|      const int inter_block = is_inter_block(mbmi);
 1530|      0|      const int seg_ref_active =
 1531|      0|          segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
 1532|      0|      if (!seg_ref_active && inter_block) {
  ------------------
  |  Branch (1532:11): [True: 0, False: 0]
  |  Branch (1532:30): [True: 0, False: 0]
  ------------------
 1533|      0|        const MOTION_MODE motion_allowed =
 1534|      0|            cm->features.switchable_motion_mode
  ------------------
  |  Branch (1534:13): [True: 0, False: 0]
  ------------------
 1535|      0|                ? motion_mode_allowed(xd->global_motion, xd, mbmi,
 1536|      0|                                      cm->features.allow_warped_motion)
 1537|      0|                : SIMPLE_TRANSLATION;
 1538|       |
 1539|      0|        if (mbmi->ref_frame[1] != INTRA_FRAME) {
  ------------------
  |  Branch (1539:13): [True: 0, False: 0]
  ------------------
 1540|      0|          if (motion_allowed >= OBMC_CAUSAL) {
  ------------------
  |  Branch (1540:15): [True: 0, False: 0]
  ------------------
 1541|      0|            td->rd_counts.obmc_used[bsize][mbmi->motion_mode == OBMC_CAUSAL]++;
 1542|      0|          }
 1543|      0|          if (motion_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1543:15): [True: 0, False: 0]
  ------------------
 1544|      0|            td->rd_counts.warped_used[mbmi->motion_mode == WARPED_CAUSAL]++;
 1545|      0|          }
 1546|      0|        }
 1547|      0|      }
 1548|      0|    }
 1549|  1.47M|  }
 1550|       |  // TODO(Ravi/Remya): Move this copy function to a better logical place
 1551|       |  // This function will copy the best mode information from block
 1552|       |  // level (x->mbmi_ext) to frame level (cpi->mbmi_ext_info.frame_base). This
 1553|       |  // frame level buffer (cpi->mbmi_ext_info.frame_base) will be used during
 1554|       |  // bitstream preparation.
 1555|  5.57M|  av1_copy_mbmi_ext_to_mbmi_ext_frame(x->mbmi_ext_frame, &x->mbmi_ext,
 1556|  5.57M|                                      av1_ref_frame_type(xd->mi[0]->ref_frame));
 1557|  5.57M|  x->rdmult = origin_mult;
 1558|  5.57M|}
partition_search.c:update_stats:
  984|  2.04M|static void update_stats(const AV1_COMMON *const cm, ThreadData *td) {
  985|  2.04M|  MACROBLOCK *x = &td->mb;
  986|  2.04M|  MACROBLOCKD *const xd = &x->e_mbd;
  987|  2.04M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  988|  2.04M|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
  989|  2.04M|  const CurrentFrame *const current_frame = &cm->current_frame;
  990|  2.04M|  const BLOCK_SIZE bsize = mbmi->bsize;
  991|  2.04M|  FRAME_CONTEXT *fc = xd->tile_ctx;
  992|  2.04M|  const int seg_ref_active =
  993|  2.04M|      segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
  994|       |
  995|  2.04M|  if (current_frame->skip_mode_info.skip_mode_flag && !seg_ref_active &&
  ------------------
  |  Branch (995:7): [True: 0, False: 2.04M]
  |  Branch (995:55): [True: 0, False: 0]
  ------------------
  996|      0|      is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|    const int skip_mode_ctx = av1_get_skip_mode_context(xd);
  998|       |#if CONFIG_ENTROPY_STATS
  999|       |    td->counts->skip_mode[skip_mode_ctx][mbmi->skip_mode]++;
 1000|       |#endif
 1001|      0|    update_cdf(fc->skip_mode_cdfs[skip_mode_ctx], mbmi->skip_mode, 2);
 1002|      0|  }
 1003|       |
 1004|  2.04M|  if (!mbmi->skip_mode && !seg_ref_active) {
  ------------------
  |  Branch (1004:7): [True: 2.04M, False: 187]
  |  Branch (1004:27): [True: 2.04M, False: 18.4E]
  ------------------
 1005|  2.04M|    const int skip_ctx = av1_get_skip_txfm_context(xd);
 1006|       |#if CONFIG_ENTROPY_STATS
 1007|       |    td->counts->skip_txfm[skip_ctx][mbmi->skip_txfm]++;
 1008|       |#endif
 1009|  2.04M|    update_cdf(fc->skip_txfm_cdfs[skip_ctx], mbmi->skip_txfm, 2);
 1010|  2.04M|  }
 1011|       |
 1012|       |#if CONFIG_ENTROPY_STATS
 1013|       |  // delta quant applies to both intra and inter
 1014|       |  const int super_block_upper_left =
 1015|       |      ((xd->mi_row & (cm->seq_params->mib_size - 1)) == 0) &&
 1016|       |      ((xd->mi_col & (cm->seq_params->mib_size - 1)) == 0);
 1017|       |  const DeltaQInfo *const delta_q_info = &cm->delta_q_info;
 1018|       |  if (delta_q_info->delta_q_present_flag &&
 1019|       |      (bsize != cm->seq_params->sb_size || !mbmi->skip_txfm) &&
 1020|       |      super_block_upper_left) {
 1021|       |    const int dq = (mbmi->current_qindex - xd->current_base_qindex) /
 1022|       |                   delta_q_info->delta_q_res;
 1023|       |    const int absdq = abs(dq);
 1024|       |    for (int i = 0; i < AOMMIN(absdq, DELTA_Q_SMALL); ++i) {
 1025|       |      td->counts->delta_q[i][1]++;
 1026|       |    }
 1027|       |    if (absdq < DELTA_Q_SMALL) td->counts->delta_q[absdq][0]++;
 1028|       |    if (delta_q_info->delta_lf_present_flag) {
 1029|       |      if (delta_q_info->delta_lf_multi) {
 1030|       |        const int frame_lf_count =
 1031|       |            av1_num_planes(cm) > 1 ? FRAME_LF_COUNT : FRAME_LF_COUNT - 2;
 1032|       |        for (int lf_id = 0; lf_id < frame_lf_count; ++lf_id) {
 1033|       |          const int delta_lf = (mbmi->delta_lf[lf_id] - xd->delta_lf[lf_id]) /
 1034|       |                               delta_q_info->delta_lf_res;
 1035|       |          const int abs_delta_lf = abs(delta_lf);
 1036|       |          for (int i = 0; i < AOMMIN(abs_delta_lf, DELTA_LF_SMALL); ++i) {
 1037|       |            td->counts->delta_lf_multi[lf_id][i][1]++;
 1038|       |          }
 1039|       |          if (abs_delta_lf < DELTA_LF_SMALL)
 1040|       |            td->counts->delta_lf_multi[lf_id][abs_delta_lf][0]++;
 1041|       |        }
 1042|       |      } else {
 1043|       |        const int delta_lf =
 1044|       |            (mbmi->delta_lf_from_base - xd->delta_lf_from_base) /
 1045|       |            delta_q_info->delta_lf_res;
 1046|       |        const int abs_delta_lf = abs(delta_lf);
 1047|       |        for (int i = 0; i < AOMMIN(abs_delta_lf, DELTA_LF_SMALL); ++i) {
 1048|       |          td->counts->delta_lf[i][1]++;
 1049|       |        }
 1050|       |        if (abs_delta_lf < DELTA_LF_SMALL)
 1051|       |          td->counts->delta_lf[abs_delta_lf][0]++;
 1052|       |      }
 1053|       |    }
 1054|       |  }
 1055|       |#endif
 1056|       |
 1057|  2.04M|  if (!is_inter_block(mbmi)) {
  ------------------
  |  Branch (1057:7): [True: 1.53M, False: 510k]
  ------------------
 1058|  1.53M|    av1_sum_intra_stats(cm, td->counts, xd, mbmi, xd->above_mbmi, xd->left_mbmi,
 1059|  1.53M|                        frame_is_intra_only(cm));
 1060|  1.53M|  }
 1061|       |
 1062|  2.04M|  if (av1_allow_intrabc(cm)) {
  ------------------
  |  Branch (1062:7): [True: 13.0k, False: 2.02M]
  ------------------
 1063|  13.0k|    const int is_intrabc = is_intrabc_block(mbmi);
 1064|  13.0k|    update_cdf(fc->intrabc_cdf, is_intrabc, 2);
 1065|       |#if CONFIG_ENTROPY_STATS
 1066|       |    ++td->counts->intrabc[is_intrabc];
 1067|       |#endif  // CONFIG_ENTROPY_STATS
 1068|  13.0k|    if (is_intrabc) {
  ------------------
  |  Branch (1068:9): [True: 0, False: 13.0k]
  ------------------
 1069|      0|      const int8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 1070|      0|      const int_mv dv_ref = mbmi_ext->ref_mv_stack[ref_frame_type][0].this_mv;
 1071|      0|      av1_update_mv_stats(&mbmi->mv[0].as_mv, &dv_ref.as_mv, &fc->ndvc,
 1072|      0|                          MV_SUBPEL_NONE);
 1073|      0|    }
 1074|  13.0k|  }
 1075|       |
 1076|  2.04M|  if (frame_is_intra_only(cm) || mbmi->skip_mode) return;
  ------------------
  |  Branch (1076:7): [True: 163k, False: 1.87M]
  |  Branch (1076:34): [True: 18.4E, False: 1.87M]
  ------------------
 1077|       |
 1078|  1.87M|  FRAME_COUNTS *const counts = td->counts;
 1079|  1.87M|  const int inter_block = is_inter_block(mbmi);
 1080|       |
 1081|  1.87M|  if (!seg_ref_active) {
  ------------------
  |  Branch (1081:7): [True: 1.87M, False: 18.4E]
  ------------------
 1082|       |#if CONFIG_ENTROPY_STATS
 1083|       |    counts->intra_inter[av1_get_intra_inter_context(xd)][inter_block]++;
 1084|       |#endif
 1085|  1.87M|    update_cdf(fc->intra_inter_cdf[av1_get_intra_inter_context(xd)],
 1086|  1.87M|               inter_block, 2);
 1087|       |    // If the segment reference feature is enabled we have only a single
 1088|       |    // reference frame allowed for the segment so exclude it from
 1089|       |    // the reference frame counts used to work out probabilities.
 1090|  1.87M|    if (inter_block) {
  ------------------
  |  Branch (1090:9): [True: 511k, False: 1.36M]
  ------------------
 1091|   511k|      const MV_REFERENCE_FRAME ref0 = mbmi->ref_frame[0];
 1092|   511k|      const MV_REFERENCE_FRAME ref1 = mbmi->ref_frame[1];
 1093|   511k|      if (current_frame->reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (1093:11): [True: 469k, False: 42.0k]
  ------------------
 1094|   469k|        if (is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (1094:13): [True: 463k, False: 5.24k]
  ------------------
 1095|       |#if CONFIG_ENTROPY_STATS
 1096|       |          counts->comp_inter[av1_get_reference_mode_context(xd)]
 1097|       |                            [has_second_ref(mbmi)]++;
 1098|       |#endif  // CONFIG_ENTROPY_STATS
 1099|   463k|          update_cdf(av1_get_reference_mode_cdf(xd), has_second_ref(mbmi), 2);
 1100|   463k|        }
 1101|   469k|      }
 1102|       |
 1103|   511k|      if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1103:11): [True: 0, False: 511k]
  ------------------
 1104|      0|        const COMP_REFERENCE_TYPE comp_ref_type = has_uni_comp_refs(mbmi)
  ------------------
  |  Branch (1104:51): [True: 0, False: 0]
  ------------------
 1105|      0|                                                      ? UNIDIR_COMP_REFERENCE
 1106|      0|                                                      : BIDIR_COMP_REFERENCE;
 1107|      0|        update_cdf(av1_get_comp_reference_type_cdf(xd), comp_ref_type,
 1108|      0|                   COMP_REFERENCE_TYPES);
 1109|       |#if CONFIG_ENTROPY_STATS
 1110|       |        counts->comp_ref_type[av1_get_comp_reference_type_context(xd)]
 1111|       |                             [comp_ref_type]++;
 1112|       |#endif  // CONFIG_ENTROPY_STATS
 1113|       |
 1114|      0|        if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
  ------------------
  |  Branch (1114:13): [True: 0, False: 0]
  ------------------
 1115|      0|          const int bit = (ref0 == BWDREF_FRAME);
 1116|      0|          update_cdf(av1_get_pred_cdf_uni_comp_ref_p(xd), bit, 2);
 1117|       |#if CONFIG_ENTROPY_STATS
 1118|       |          counts
 1119|       |              ->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p(xd)][0][bit]++;
 1120|       |#endif  // CONFIG_ENTROPY_STATS
 1121|      0|          if (!bit) {
  ------------------
  |  Branch (1121:15): [True: 0, False: 0]
  ------------------
 1122|      0|            const int bit1 = (ref1 == LAST3_FRAME || ref1 == GOLDEN_FRAME);
  ------------------
  |  Branch (1122:31): [True: 0, False: 0]
  |  Branch (1122:54): [True: 0, False: 0]
  ------------------
 1123|      0|            update_cdf(av1_get_pred_cdf_uni_comp_ref_p1(xd), bit1, 2);
 1124|       |#if CONFIG_ENTROPY_STATS
 1125|       |            counts->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p1(xd)][1]
 1126|       |                                [bit1]++;
 1127|       |#endif  // CONFIG_ENTROPY_STATS
 1128|      0|            if (bit1) {
  ------------------
  |  Branch (1128:17): [True: 0, False: 0]
  ------------------
 1129|      0|              update_cdf(av1_get_pred_cdf_uni_comp_ref_p2(xd),
 1130|      0|                         ref1 == GOLDEN_FRAME, 2);
 1131|       |#if CONFIG_ENTROPY_STATS
 1132|       |              counts->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p2(xd)][2]
 1133|       |                                  [ref1 == GOLDEN_FRAME]++;
 1134|       |#endif  // CONFIG_ENTROPY_STATS
 1135|      0|            }
 1136|      0|          }
 1137|      0|        } else {
 1138|      0|          const int bit = (ref0 == GOLDEN_FRAME || ref0 == LAST3_FRAME);
  ------------------
  |  Branch (1138:28): [True: 0, False: 0]
  |  Branch (1138:52): [True: 0, False: 0]
  ------------------
 1139|      0|          update_cdf(av1_get_pred_cdf_comp_ref_p(xd), bit, 2);
 1140|       |#if CONFIG_ENTROPY_STATS
 1141|       |          counts->comp_ref[av1_get_pred_context_comp_ref_p(xd)][0][bit]++;
 1142|       |#endif  // CONFIG_ENTROPY_STATS
 1143|      0|          if (!bit) {
  ------------------
  |  Branch (1143:15): [True: 0, False: 0]
  ------------------
 1144|      0|            update_cdf(av1_get_pred_cdf_comp_ref_p1(xd), ref0 == LAST2_FRAME,
 1145|      0|                       2);
 1146|       |#if CONFIG_ENTROPY_STATS
 1147|       |            counts->comp_ref[av1_get_pred_context_comp_ref_p1(xd)][1]
 1148|       |                            [ref0 == LAST2_FRAME]++;
 1149|       |#endif  // CONFIG_ENTROPY_STATS
 1150|      0|          } else {
 1151|      0|            update_cdf(av1_get_pred_cdf_comp_ref_p2(xd), ref0 == GOLDEN_FRAME,
 1152|      0|                       2);
 1153|       |#if CONFIG_ENTROPY_STATS
 1154|       |            counts->comp_ref[av1_get_pred_context_comp_ref_p2(xd)][2]
 1155|       |                            [ref0 == GOLDEN_FRAME]++;
 1156|       |#endif  // CONFIG_ENTROPY_STATS
 1157|      0|          }
 1158|      0|          update_cdf(av1_get_pred_cdf_comp_bwdref_p(xd), ref1 == ALTREF_FRAME,
 1159|      0|                     2);
 1160|       |#if CONFIG_ENTROPY_STATS
 1161|       |          counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p(xd)][0]
 1162|       |                             [ref1 == ALTREF_FRAME]++;
 1163|       |#endif  // CONFIG_ENTROPY_STATS
 1164|      0|          if (ref1 != ALTREF_FRAME) {
  ------------------
  |  Branch (1164:15): [True: 0, False: 0]
  ------------------
 1165|      0|            update_cdf(av1_get_pred_cdf_comp_bwdref_p1(xd),
 1166|      0|                       ref1 == ALTREF2_FRAME, 2);
 1167|       |#if CONFIG_ENTROPY_STATS
 1168|       |            counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p1(xd)][1]
 1169|       |                               [ref1 == ALTREF2_FRAME]++;
 1170|       |#endif  // CONFIG_ENTROPY_STATS
 1171|      0|          }
 1172|      0|        }
 1173|   511k|      } else {
 1174|   511k|        const int bit = (ref0 >= BWDREF_FRAME);
 1175|   511k|        update_cdf(av1_get_pred_cdf_single_ref_p1(xd), bit, 2);
 1176|       |#if CONFIG_ENTROPY_STATS
 1177|       |        counts->single_ref[av1_get_pred_context_single_ref_p1(xd)][0][bit]++;
 1178|       |#endif  // CONFIG_ENTROPY_STATS
 1179|   511k|        if (bit) {
  ------------------
  |  Branch (1179:13): [True: 0, False: 511k]
  ------------------
 1180|      0|          assert(ref0 <= ALTREF_FRAME);
 1181|      0|          update_cdf(av1_get_pred_cdf_single_ref_p2(xd), ref0 == ALTREF_FRAME,
 1182|      0|                     2);
 1183|       |#if CONFIG_ENTROPY_STATS
 1184|       |          counts->single_ref[av1_get_pred_context_single_ref_p2(xd)][1]
 1185|       |                            [ref0 == ALTREF_FRAME]++;
 1186|       |#endif  // CONFIG_ENTROPY_STATS
 1187|      0|          if (ref0 != ALTREF_FRAME) {
  ------------------
  |  Branch (1187:15): [True: 0, False: 0]
  ------------------
 1188|      0|            update_cdf(av1_get_pred_cdf_single_ref_p6(xd),
 1189|      0|                       ref0 == ALTREF2_FRAME, 2);
 1190|       |#if CONFIG_ENTROPY_STATS
 1191|       |            counts->single_ref[av1_get_pred_context_single_ref_p6(xd)][5]
 1192|       |                              [ref0 == ALTREF2_FRAME]++;
 1193|       |#endif  // CONFIG_ENTROPY_STATS
 1194|      0|          }
 1195|   511k|        } else {
 1196|   511k|          const int bit1 = !(ref0 == LAST2_FRAME || ref0 == LAST_FRAME);
  ------------------
  |  Branch (1196:30): [True: 468, False: 510k]
  |  Branch (1196:53): [True: 510k, False: 0]
  ------------------
 1197|   511k|          update_cdf(av1_get_pred_cdf_single_ref_p3(xd), bit1, 2);
 1198|       |#if CONFIG_ENTROPY_STATS
 1199|       |          counts->single_ref[av1_get_pred_context_single_ref_p3(xd)][2][bit1]++;
 1200|       |#endif  // CONFIG_ENTROPY_STATS
 1201|   511k|          if (!bit1) {
  ------------------
  |  Branch (1201:15): [True: 510k, False: 562]
  ------------------
 1202|   510k|            update_cdf(av1_get_pred_cdf_single_ref_p4(xd), ref0 != LAST_FRAME,
 1203|   510k|                       2);
 1204|       |#if CONFIG_ENTROPY_STATS
 1205|       |            counts->single_ref[av1_get_pred_context_single_ref_p4(xd)][3]
 1206|       |                              [ref0 != LAST_FRAME]++;
 1207|       |#endif  // CONFIG_ENTROPY_STATS
 1208|   510k|          } else {
 1209|    562|            update_cdf(av1_get_pred_cdf_single_ref_p5(xd), ref0 != LAST3_FRAME,
 1210|    562|                       2);
 1211|       |#if CONFIG_ENTROPY_STATS
 1212|       |            counts->single_ref[av1_get_pred_context_single_ref_p5(xd)][4]
 1213|       |                              [ref0 != LAST3_FRAME]++;
 1214|       |#endif  // CONFIG_ENTROPY_STATS
 1215|    562|          }
 1216|   511k|        }
 1217|   511k|      }
 1218|       |
 1219|   511k|      if (cm->seq_params->enable_interintra_compound &&
  ------------------
  |  Branch (1219:11): [True: 0, False: 511k]
  ------------------
 1220|      0|          is_interintra_allowed(mbmi)) {
  ------------------
  |  Branch (1220:11): [True: 0, False: 0]
  ------------------
 1221|      0|        const int bsize_group = size_group_lookup[bsize];
 1222|      0|        if (mbmi->ref_frame[1] == INTRA_FRAME) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 0]
  ------------------
 1223|       |#if CONFIG_ENTROPY_STATS
 1224|       |          counts->interintra[bsize_group][1]++;
 1225|       |#endif
 1226|      0|          update_cdf(fc->interintra_cdf[bsize_group], 1, 2);
 1227|       |#if CONFIG_ENTROPY_STATS
 1228|       |          counts->interintra_mode[bsize_group][mbmi->interintra_mode]++;
 1229|       |#endif
 1230|      0|          update_cdf(fc->interintra_mode_cdf[bsize_group],
 1231|      0|                     mbmi->interintra_mode, INTERINTRA_MODES);
 1232|      0|          if (av1_is_wedge_used(bsize)) {
  ------------------
  |  Branch (1232:15): [True: 0, False: 0]
  ------------------
 1233|       |#if CONFIG_ENTROPY_STATS
 1234|       |            counts->wedge_interintra[bsize][mbmi->use_wedge_interintra]++;
 1235|       |#endif
 1236|      0|            update_cdf(fc->wedge_interintra_cdf[bsize],
 1237|      0|                       mbmi->use_wedge_interintra, 2);
 1238|      0|            if (mbmi->use_wedge_interintra) {
  ------------------
  |  Branch (1238:17): [True: 0, False: 0]
  ------------------
 1239|       |#if CONFIG_ENTROPY_STATS
 1240|       |              counts->wedge_idx[bsize][mbmi->interintra_wedge_index]++;
 1241|       |#endif
 1242|      0|              update_cdf(fc->wedge_idx_cdf[bsize], mbmi->interintra_wedge_index,
 1243|      0|                         16);
 1244|      0|            }
 1245|      0|          }
 1246|      0|        } else {
 1247|       |#if CONFIG_ENTROPY_STATS
 1248|       |          counts->interintra[bsize_group][0]++;
 1249|       |#endif
 1250|      0|          update_cdf(fc->interintra_cdf[bsize_group], 0, 2);
 1251|      0|        }
 1252|      0|      }
 1253|       |
 1254|   511k|      const MOTION_MODE motion_allowed =
 1255|   511k|          cm->features.switchable_motion_mode
  ------------------
  |  Branch (1255:11): [True: 510k, False: 611]
  ------------------
 1256|   511k|              ? motion_mode_allowed(xd->global_motion, xd, mbmi,
 1257|   510k|                                    cm->features.allow_warped_motion)
 1258|   511k|              : SIMPLE_TRANSLATION;
 1259|   511k|      if (mbmi->ref_frame[1] != INTRA_FRAME) {
  ------------------
  |  Branch (1259:11): [True: 511k, False: 206]
  ------------------
 1260|   511k|        if (motion_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1260:13): [True: 38.1k, False: 472k]
  ------------------
 1261|       |#if CONFIG_ENTROPY_STATS
 1262|       |          counts->motion_mode[bsize][mbmi->motion_mode]++;
 1263|       |#endif
 1264|  38.1k|          update_cdf(fc->motion_mode_cdf[bsize], mbmi->motion_mode,
 1265|  38.1k|                     MOTION_MODES);
 1266|   472k|        } else if (motion_allowed == OBMC_CAUSAL) {
  ------------------
  |  Branch (1266:20): [True: 326k, False: 146k]
  ------------------
 1267|       |#if CONFIG_ENTROPY_STATS
 1268|       |          counts->obmc[bsize][mbmi->motion_mode == OBMC_CAUSAL]++;
 1269|       |#endif
 1270|   326k|          update_cdf(fc->obmc_cdf[bsize], mbmi->motion_mode == OBMC_CAUSAL, 2);
 1271|   326k|        }
 1272|   511k|      }
 1273|       |
 1274|   511k|      if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1274:11): [True: 0, False: 511k]
  ------------------
 1275|      0|        assert(current_frame->reference_mode != SINGLE_REFERENCE &&
 1276|      0|               is_inter_compound_mode(mbmi->mode) &&
 1277|      0|               mbmi->motion_mode == SIMPLE_TRANSLATION);
 1278|       |
 1279|      0|        const int masked_compound_used = is_any_masked_compound_used(bsize) &&
  ------------------
  |  Branch (1279:42): [True: 0, False: 0]
  ------------------
 1280|      0|                                         cm->seq_params->enable_masked_compound;
  ------------------
  |  Branch (1280:42): [True: 0, False: 0]
  ------------------
 1281|      0|        if (masked_compound_used) {
  ------------------
  |  Branch (1281:13): [True: 0, False: 0]
  ------------------
 1282|      0|          const int comp_group_idx_ctx = get_comp_group_idx_context(xd);
 1283|       |#if CONFIG_ENTROPY_STATS
 1284|       |          ++counts->comp_group_idx[comp_group_idx_ctx][mbmi->comp_group_idx];
 1285|       |#endif
 1286|      0|          update_cdf(fc->comp_group_idx_cdf[comp_group_idx_ctx],
 1287|      0|                     mbmi->comp_group_idx, 2);
 1288|      0|        }
 1289|       |
 1290|      0|        if (mbmi->comp_group_idx == 0) {
  ------------------
  |  Branch (1290:13): [True: 0, False: 0]
  ------------------
 1291|      0|          const int comp_index_ctx = get_comp_index_context(cm, xd);
 1292|       |#if CONFIG_ENTROPY_STATS
 1293|       |          ++counts->compound_index[comp_index_ctx][mbmi->compound_idx];
 1294|       |#endif
 1295|      0|          update_cdf(fc->compound_index_cdf[comp_index_ctx], mbmi->compound_idx,
 1296|      0|                     2);
 1297|      0|        } else {
 1298|      0|          assert(masked_compound_used);
 1299|      0|          if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
  ------------------
  |  Branch (1299:15): [True: 0, False: 0]
  ------------------
 1300|       |#if CONFIG_ENTROPY_STATS
 1301|       |            ++counts->compound_type[bsize][mbmi->interinter_comp.type -
 1302|       |                                           COMPOUND_WEDGE];
 1303|       |#endif
 1304|      0|            update_cdf(fc->compound_type_cdf[bsize],
 1305|      0|                       mbmi->interinter_comp.type - COMPOUND_WEDGE,
 1306|      0|                       MASKED_COMPOUND_TYPES);
 1307|      0|          }
 1308|      0|        }
 1309|      0|      }
 1310|   511k|      if (mbmi->interinter_comp.type == COMPOUND_WEDGE) {
  ------------------
  |  Branch (1310:11): [True: 0, False: 511k]
  ------------------
 1311|      0|        if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
  ------------------
  |  Branch (1311:13): [True: 0, False: 0]
  ------------------
 1312|       |#if CONFIG_ENTROPY_STATS
 1313|       |          counts->wedge_idx[bsize][mbmi->interinter_comp.wedge_index]++;
 1314|       |#endif
 1315|      0|          update_cdf(fc->wedge_idx_cdf[bsize],
 1316|      0|                     mbmi->interinter_comp.wedge_index, 16);
 1317|      0|        }
 1318|      0|      }
 1319|   511k|    }
 1320|  1.87M|  }
 1321|       |
 1322|  1.87M|  if (inter_block && cm->features.interp_filter == SWITCHABLE &&
  ------------------
  |  Branch (1322:7): [True: 511k, False: 1.36M]
  |  Branch (1322:22): [True: 510k, False: 37]
  ------------------
 1323|   510k|      av1_is_interp_needed(xd)) {
  ------------------
  |  Branch (1323:7): [True: 490k, False: 20.7k]
  ------------------
 1324|   490k|    update_filter_type_cdf(xd, mbmi, cm->seq_params->enable_dual_filter);
 1325|   490k|  }
 1326|  1.87M|  if (inter_block &&
  ------------------
  |  Branch (1326:7): [True: 511k, False: 1.36M]
  ------------------
 1327|   511k|      !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
  ------------------
  |  Branch (1327:7): [True: 511k, False: 19]
  ------------------
 1328|   511k|    const PREDICTION_MODE mode = mbmi->mode;
 1329|   511k|    const int16_t mode_ctx =
 1330|   511k|        av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
 1331|   511k|    if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (1331:9): [True: 0, False: 511k]
  ------------------
 1332|       |#if CONFIG_ENTROPY_STATS
 1333|       |      ++counts->inter_compound_mode[mode_ctx][INTER_COMPOUND_OFFSET(mode)];
 1334|       |#endif
 1335|      0|      update_cdf(fc->inter_compound_mode_cdf[mode_ctx],
 1336|      0|                 INTER_COMPOUND_OFFSET(mode), INTER_COMPOUND_MODES);
  ------------------
  |  |   29|      0|#define INTER_COMPOUND_OFFSET(mode) (uint8_t)((mode) - NEAREST_NEARESTMV)
  ------------------
                               INTER_COMPOUND_OFFSET(mode), INTER_COMPOUND_MODES);
  ------------------
  |  |  472|      0|#define INTER_COMPOUND_MODES (1 + NEW_NEWMV - NEAREST_NEARESTMV)
  ------------------
 1337|   511k|    } else {
 1338|   511k|      av1_update_inter_mode_stats(fc, counts, mode, mode_ctx);
 1339|   511k|    }
 1340|       |
 1341|   511k|    const int new_mv = mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV;
  ------------------
  |  Branch (1341:24): [True: 275k, False: 235k]
  |  Branch (1341:47): [True: 18.4E, False: 235k]
  ------------------
 1342|   511k|    if (new_mv) {
  ------------------
  |  Branch (1342:9): [True: 276k, False: 234k]
  ------------------
 1343|   276k|      const uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 1344|   497k|      for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (1344:25): [True: 390k, False: 107k]
  ------------------
 1345|   390k|        if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (1345:13): [True: 186k, False: 203k]
  ------------------
 1346|   186k|          const uint8_t drl_ctx =
 1347|   186k|              av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
 1348|   186k|          update_cdf(fc->drl_cdf[drl_ctx], mbmi->ref_mv_idx != idx, 2);
 1349|       |#if CONFIG_ENTROPY_STATS
 1350|       |          ++counts->drl_mode[drl_ctx][mbmi->ref_mv_idx != idx];
 1351|       |#endif
 1352|   186k|          if (mbmi->ref_mv_idx == idx) break;
  ------------------
  |  Branch (1352:15): [True: 168k, False: 18.0k]
  ------------------
 1353|   186k|        }
 1354|   390k|      }
 1355|   276k|    }
 1356|       |
 1357|   511k|    if (have_nearmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (1357:9): [True: 58.9k, False: 452k]
  ------------------
 1358|  58.9k|      const uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 1359|   110k|      for (int idx = 1; idx < 3; ++idx) {
  ------------------
  |  Branch (1359:25): [True: 85.3k, False: 25.5k]
  ------------------
 1360|  85.3k|        if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (1360:13): [True: 36.2k, False: 49.0k]
  ------------------
 1361|  36.2k|          const uint8_t drl_ctx =
 1362|  36.2k|              av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
 1363|  36.2k|          update_cdf(fc->drl_cdf[drl_ctx], mbmi->ref_mv_idx != idx - 1, 2);
 1364|       |#if CONFIG_ENTROPY_STATS
 1365|       |          ++counts->drl_mode[drl_ctx][mbmi->ref_mv_idx != idx - 1];
 1366|       |#endif
 1367|  36.2k|          if (mbmi->ref_mv_idx == idx - 1) break;
  ------------------
  |  Branch (1367:15): [True: 33.3k, False: 2.85k]
  ------------------
 1368|  36.2k|        }
 1369|  85.3k|      }
 1370|  58.9k|    }
 1371|   511k|    if (have_newmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (1371:9): [True: 276k, False: 234k]
  ------------------
 1372|   276k|      const int allow_hp = cm->features.cur_frame_force_integer_mv
  ------------------
  |  Branch (1372:28): [True: 0, False: 276k]
  ------------------
 1373|   276k|                               ? MV_SUBPEL_NONE
 1374|   276k|                               : cm->features.allow_high_precision_mv;
 1375|   276k|      if (new_mv) {
  ------------------
  |  Branch (1375:11): [True: 276k, False: 3]
  ------------------
 1376|   552k|        for (int ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
  ------------------
  |  Branch (1376:27): [True: 276k, False: 276k]
  ------------------
 1377|   276k|          const int_mv ref_mv = av1_get_ref_mv(x, ref);
 1378|   276k|          av1_update_mv_stats(&mbmi->mv[ref].as_mv, &ref_mv.as_mv, &fc->nmvc,
 1379|   276k|                              allow_hp);
 1380|   276k|        }
 1381|   276k|      } else if (mbmi->mode == NEAREST_NEWMV || mbmi->mode == NEAR_NEWMV) {
  ------------------
  |  Branch (1381:18): [True: 3, False: 0]
  |  Branch (1381:49): [True: 0, False: 0]
  ------------------
 1382|      0|        const int ref = 1;
 1383|      0|        const int_mv ref_mv = av1_get_ref_mv(x, ref);
 1384|      0|        av1_update_mv_stats(&mbmi->mv[ref].as_mv, &ref_mv.as_mv, &fc->nmvc,
 1385|      0|                            allow_hp);
 1386|      3|      } else if (mbmi->mode == NEW_NEARESTMV || mbmi->mode == NEW_NEARMV) {
  ------------------
  |  Branch (1386:18): [True: 3, False: 0]
  |  Branch (1386:49): [True: 0, False: 0]
  ------------------
 1387|      0|        const int ref = 0;
 1388|      0|        const int_mv ref_mv = av1_get_ref_mv(x, ref);
 1389|      0|        av1_update_mv_stats(&mbmi->mv[ref].as_mv, &ref_mv.as_mv, &fc->nmvc,
 1390|      0|                            allow_hp);
 1391|      0|      }
 1392|   276k|    }
 1393|   511k|  }
 1394|  1.87M|}
partition_search.c:pick_sb_modes_nonrd:
 2260|   673k|                                PICK_MODE_CONTEXT *ctx) {
 2261|       |  // For nonrd mode, av1_set_offsets is already called at the superblock level
 2262|       |  // in encode_nonrd_sb when we determine the partitioning.
 2263|   673k|  if (bsize != cpi->common.seq_params->sb_size ||
  ------------------
  |  Branch (2263:7): [True: 673k, False: 65]
  ------------------
 2264|   673k|      cpi->sf.rt_sf.nonrd_check_partition_split == 1) {
  ------------------
  |  Branch (2264:7): [True: 0, False: 65]
  ------------------
 2265|   673k|    av1_set_offsets(cpi, &tile_data->tile_info, x, mi_row, mi_col, bsize);
 2266|   673k|  }
 2267|   673k|  assert(x->last_set_offsets_loc.mi_row == mi_row &&
 2268|   673k|         x->last_set_offsets_loc.mi_col == mi_col &&
 2269|   673k|         x->last_set_offsets_loc.bsize == bsize);
 2270|   673k|  AV1_COMMON *const cm = &cpi->common;
 2271|   673k|  const int num_planes = av1_num_planes(cm);
 2272|   673k|  MACROBLOCKD *const xd = &x->e_mbd;
 2273|   673k|  MB_MODE_INFO *mbmi = xd->mi[0];
 2274|   673k|  struct macroblock_plane *const p = x->plane;
 2275|   673k|  struct macroblockd_plane *const pd = xd->plane;
 2276|   673k|  const AQ_MODE aq_mode = cpi->oxcf.q_cfg.aq_mode;
 2277|   673k|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 2278|   673k|  int i;
 2279|   673k|  const int seg_skip =
 2280|   673k|      segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
 2281|       |
 2282|       |  // This is only needed for real time/allintra row-mt enabled multi-threaded
 2283|       |  // encoding with cost update frequency set to COST_UPD_TILE/COST_UPD_OFF.
 2284|   673k|  wait_for_top_right_sb(&cpi->mt_info.enc_row_mt, &tile_data->row_mt_sync,
 2285|   673k|                        &tile_data->tile_info, cm->seq_params->sb_size,
 2286|   673k|                        cm->seq_params->mib_size_log2, bsize, mi_row, mi_col);
 2287|       |
 2288|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2289|       |  start_timing(cpi, pick_sb_modes_nonrd_time);
 2290|       |#endif
 2291|       |  // Sets up the tx_type_map buffer in MACROBLOCKD.
 2292|   673k|  xd->tx_type_map = txfm_info->tx_type_map_;
 2293|   673k|  xd->tx_type_map_stride = mi_size_wide[bsize];
 2294|  1.76M|  for (i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (2294:15): [True: 1.08M, False: 673k]
  ------------------
 2295|  1.08M|    p[i].coeff = ctx->coeff[i];
 2296|  1.08M|    p[i].qcoeff = ctx->qcoeff[i];
 2297|  1.08M|    p[i].dqcoeff = ctx->dqcoeff[i];
 2298|  1.08M|    p[i].eobs = ctx->eobs[i];
 2299|  1.08M|    p[i].txb_entropy_ctx = ctx->txb_entropy_ctx[i];
 2300|  1.08M|  }
 2301|  2.01M|  for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
  ------------------
  |  Branch (2301:15): [True: 1.34M, False: 673k]
  ------------------
 2302|       |
 2303|   673k|  if (!seg_skip) {
  ------------------
  |  Branch (2303:7): [True: 673k, False: 518]
  ------------------
 2304|   673k|    x->force_zeromv_skip_for_blk =
 2305|   673k|        get_force_zeromv_skip_flag_for_blk(cpi, x, bsize);
 2306|       |
 2307|       |    // Source variance may be already compute at superblock level, so no need
 2308|       |    // to recompute, unless bsize < sb_size or source_variance is not yet set.
 2309|   673k|    if (!x->force_zeromv_skip_for_blk &&
  ------------------
  |  Branch (2309:9): [True: 672k, False: 282]
  ------------------
 2310|   672k|        (x->source_variance == UINT_MAX || bsize < cm->seq_params->sb_size))
  ------------------
  |  Branch (2310:10): [True: 75, False: 672k]
  |  Branch (2310:44): [True: 672k, False: 65]
  ------------------
 2311|   672k|      x->source_variance = av1_get_perpixel_variance_facade(
 2312|   672k|          cpi, xd, &x->plane[0].src, bsize, AOM_PLANE_Y);
  ------------------
  |  |  281|   672k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2313|   673k|  }
 2314|       |
 2315|       |  // Save rdmult before it might be changed, so it can be restored later.
 2316|   673k|  const int orig_rdmult = x->rdmult;
 2317|   673k|  setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, aq_mode, mbmi);
 2318|   673k|  if (cpi->roi.enabled && cpi->roi.delta_qp_enabled && mbmi->segment_id)
  ------------------
  |  Branch (2318:7): [True: 0, False: 673k]
  |  Branch (2318:27): [True: 0, False: 0]
  |  Branch (2318:56): [True: 0, False: 0]
  ------------------
 2319|      0|    x->rdmult = cpi->roi.rdmult_delta_qp;
 2320|       |  // Set error per bit for current rdmult
 2321|   673k|  av1_set_error_per_bit(&x->errorperbit, x->rdmult);
 2322|       |  // Find best coding mode & reconstruct the MB so it is available
 2323|       |  // as a predictor for MBs that follow in the SB
 2324|   673k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (2324:7): [True: 73.8k, False: 599k]
  ------------------
 2325|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2326|       |    start_timing(cpi, hybrid_intra_mode_search_time);
 2327|       |#endif
 2328|  73.8k|    hybrid_intra_mode_search(cpi, x, rd_cost, bsize, ctx);
 2329|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2330|       |    end_timing(cpi, hybrid_intra_mode_search_time);
 2331|       |#endif
 2332|   599k|  } else {
 2333|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2334|       |    start_timing(cpi, nonrd_pick_inter_mode_sb_time);
 2335|       |#endif
 2336|   599k|    if (seg_skip) {
  ------------------
  |  Branch (2336:9): [True: 0, False: 599k]
  ------------------
 2337|      0|      x->force_zeromv_skip_for_blk = 1;
 2338|       |      // TODO(marpan): Consider adding a function for nonrd:
 2339|       |      // av1_nonrd_pick_inter_mode_sb_seg_skip(), instead of setting
 2340|       |      // x->force_zeromv_skip flag and entering av1_nonrd_pick_inter_mode_sb().
 2341|      0|    }
 2342|   599k|    av1_nonrd_pick_inter_mode_sb(cpi, tile_data, x, rd_cost, bsize, ctx);
 2343|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2344|       |    end_timing(cpi, nonrd_pick_inter_mode_sb_time);
 2345|       |#endif
 2346|   599k|  }
 2347|   673k|  if (cpi->sf.rt_sf.skip_cdef_sb) {
  ------------------
  |  Branch (2347:7): [True: 0, False: 673k]
  ------------------
 2348|       |    // cdef_strength is initialized to 1 which means skip_cdef, and is updated
 2349|       |    // here. Check to see is skipping cdef is allowed. Never skip on slide/scene
 2350|       |    // change, near a key frame, or when color sensitivity is set. Always allow
 2351|       |    // cdef_skip for seg_skip = 1.
 2352|      0|    const int allow_cdef_skipping =
 2353|      0|        seg_skip ||
  ------------------
  |  Branch (2353:9): [True: 0, False: 0]
  ------------------
 2354|      0|        (cpi->rc.frames_since_key > 10 && !cpi->rc.high_source_sad &&
  ------------------
  |  Branch (2354:10): [True: 0, False: 0]
  |  Branch (2354:43): [True: 0, False: 0]
  ------------------
 2355|      0|         !(x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] ||
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2355:12): [True: 0, False: 0]
  ------------------
 2356|      0|           x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_V)]));
  ------------------
  |  |   50|      0|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
  |  Branch (2356:12): [True: 0, False: 0]
  ------------------
 2357|       |
 2358|       |    // Find the corresponding 64x64 block. It'll be the 128x128 block if that's
 2359|       |    // the block size.
 2360|      0|    const int mi_row_sb = mi_row - mi_row % MI_SIZE_64X64;
  ------------------
  |  |   58|      0|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 2361|      0|    const int mi_col_sb = mi_col - mi_col % MI_SIZE_64X64;
  ------------------
  |  |   58|      0|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|      0|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 2362|      0|    MB_MODE_INFO **mi_sb =
 2363|      0|        cm->mi_params.mi_grid_base +
 2364|      0|        get_mi_grid_idx(&cm->mi_params, mi_row_sb, mi_col_sb);
 2365|      0|    const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2366|      0|    unsigned int thresh_spatial_var =
 2367|      0|        (cpi->oxcf.speed >= 11 && !is_720p_or_larger &&
  ------------------
  |  Branch (2367:10): [True: 0, False: 0]
  |  Branch (2367:35): [True: 0, False: 0]
  ------------------
 2368|      0|         cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN)
  ------------------
  |  Branch (2368:10): [True: 0, False: 0]
  ------------------
 2369|      0|            ? 400
 2370|      0|            : UINT_MAX;
 2371|       |    // For skip_cdef_sb = 1: do not skip if allow_cdef_skipping is false or
 2372|       |    // intra or new mv is picked, with possible conidition on spatial variance.
 2373|       |    // For skip_cdef_sb >= 2: more aggressive mode to always skip unless
 2374|       |    // allow_cdef_skipping is false and source_variance is non-zero.
 2375|      0|    if (cpi->sf.rt_sf.skip_cdef_sb >= 2) {
  ------------------
  |  Branch (2375:9): [True: 0, False: 0]
  ------------------
 2376|      0|      mi_sb[0]->cdef_strength =
 2377|      0|          mi_sb[0]->cdef_strength &&
  ------------------
  |  Branch (2377:11): [True: 0, False: 0]
  ------------------
 2378|      0|          (allow_cdef_skipping || x->source_variance == 0);
  ------------------
  |  Branch (2378:12): [True: 0, False: 0]
  |  Branch (2378:35): [True: 0, False: 0]
  ------------------
 2379|      0|    } else {
 2380|      0|      mi_sb[0]->cdef_strength =
 2381|      0|          mi_sb[0]->cdef_strength && allow_cdef_skipping &&
  ------------------
  |  Branch (2381:11): [True: 0, False: 0]
  |  Branch (2381:38): [True: 0, False: 0]
  ------------------
 2382|      0|          !(x->source_variance < thresh_spatial_var &&
  ------------------
  |  Branch (2382:13): [True: 0, False: 0]
  ------------------
 2383|      0|            (mbmi->mode < INTRA_MODES || mbmi->mode == NEWMV));
  ------------------
  |  Branch (2383:14): [True: 0, False: 0]
  |  Branch (2383:42): [True: 0, False: 0]
  ------------------
 2384|      0|    }
 2385|       |    // Store in the pickmode context.
 2386|      0|    ctx->mic.cdef_strength = mi_sb[0]->cdef_strength;
 2387|      0|  }
 2388|   673k|  x->rdmult = orig_rdmult;
 2389|   673k|  ctx->rd_stats.rate = rd_cost->rate;
 2390|   673k|  ctx->rd_stats.dist = rd_cost->dist;
 2391|   673k|  ctx->rd_stats.rdcost = rd_cost->rdcost;
 2392|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2393|       |  end_timing(cpi, pick_sb_modes_nonrd_time);
 2394|       |#endif
 2395|   673k|}
partition_search.c:get_force_zeromv_skip_flag_for_blk:
 2187|   673k|                                              BLOCK_SIZE bsize) {
 2188|       |  // Force zero MV skip based on SB level decision
 2189|   673k|  if (x->force_zeromv_skip_for_sb < 2) return x->force_zeromv_skip_for_sb;
  ------------------
  |  Branch (2189:7): [True: 672k, False: 37]
  ------------------
 2190|       |
 2191|       |  // For blocks of size equal to superblock size, the decision would have been
 2192|       |  // already done at superblock level. Hence zeromv-skip decision is skipped.
 2193|     37|  const AV1_COMMON *const cm = &cpi->common;
 2194|     37|  if (bsize == cm->seq_params->sb_size) return 0;
  ------------------
  |  Branch (2194:7): [True: 0, False: 37]
  ------------------
 2195|       |
 2196|     37|  const int num_planes = av1_num_planes(cm);
 2197|     37|  const MACROBLOCKD *const xd = &x->e_mbd;
 2198|     37|  const unsigned int thresh_exit_part_y =
 2199|     37|      cpi->zeromv_skip_thresh_exit_part[bsize];
 2200|     37|  const unsigned int thresh_exit_part_uv =
 2201|     37|      CALC_CHROMA_THRESH_FOR_ZEROMV_SKIP(thresh_exit_part_y);
  ------------------
  |  |   36|     37|  ((3 * (thresh_exit_part)) >> 2)
  ------------------
 2202|     37|  const unsigned int thresh_exit_part[MAX_MB_PLANE] = { thresh_exit_part_y,
 2203|     37|                                                        thresh_exit_part_uv,
 2204|     37|                                                        thresh_exit_part_uv };
 2205|     37|  const YV12_BUFFER_CONFIG *const yv12 = get_ref_frame_yv12_buf(cm, LAST_FRAME);
 2206|     37|  const struct scale_factors *const sf =
 2207|     37|      get_ref_scale_factors_const(cm, LAST_FRAME);
 2208|       |
 2209|     37|  struct buf_2d yv12_mb[MAX_MB_PLANE];
 2210|     37|  av1_setup_pred_block(xd, yv12_mb, yv12, sf, sf, num_planes);
 2211|       |
 2212|     37|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (2212:23): [True: 0, False: 37]
  ------------------
 2213|      0|    const struct macroblock_plane *const p = &x->plane[plane];
 2214|      0|    const struct macroblockd_plane *const pd = &xd->plane[plane];
 2215|      0|    const BLOCK_SIZE bs =
 2216|      0|        get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
 2217|      0|    const unsigned int plane_sad = cpi->ppi->fn_ptr[bs].sdf(
 2218|      0|        p->src.buf, p->src.stride, yv12_mb[plane].buf, yv12_mb[plane].stride);
 2219|      0|    assert(plane < MAX_MB_PLANE);
 2220|      0|    if (plane_sad >= thresh_exit_part[plane]) return 0;
  ------------------
  |  Branch (2220:9): [True: 0, False: 0]
  ------------------
 2221|      0|  }
 2222|     37|  return 1;
 2223|     37|}
partition_search.c:hybrid_intra_mode_search:
  760|  73.8k|                                            PICK_MODE_CONTEXT *ctx) {
  761|  73.8k|  int use_rdopt = 0;
  762|  73.8k|  const int hybrid_intra_pickmode = cpi->sf.rt_sf.hybrid_intra_pickmode;
  763|       |  // Use rd pick for intra mode search based on block size and variance.
  764|  73.8k|  if (hybrid_intra_pickmode && bsize < BLOCK_16X16) {
  ------------------
  |  Branch (764:7): [True: 73.8k, False: 0]
  |  Branch (764:32): [True: 68.7k, False: 5.08k]
  ------------------
  765|  68.7k|    unsigned int var_thresh[3] = { 0, 101, 201 };
  766|  68.7k|    assert(hybrid_intra_pickmode <= 3);
  767|  68.7k|    if (x->source_variance >= var_thresh[hybrid_intra_pickmode - 1])
  ------------------
  |  Branch (767:9): [True: 68.7k, False: 2]
  ------------------
  768|  68.7k|      use_rdopt = 1;
  769|  68.7k|  }
  770|       |
  771|  73.8k|  if (use_rdopt)
  ------------------
  |  Branch (771:7): [True: 68.7k, False: 5.09k]
  ------------------
  772|  68.7k|    av1_rd_pick_intra_mode_sb(cpi, x, rd_cost, bsize, ctx, INT64_MAX);
  773|  5.09k|  else
  774|  5.09k|    av1_nonrd_pick_intra_mode(cpi, x, rd_cost, bsize, ctx);
  775|  73.8k|}
partition_search.c:encode_b_nonrd:
 2096|   719k|                           PICK_MODE_CONTEXT *const ctx, int *rate) {
 2097|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2098|       |  start_timing((AV1_COMP *)cpi, encode_b_nonrd_time);
 2099|       |#endif
 2100|   719k|  const AV1_COMMON *const cm = &cpi->common;
 2101|   719k|  TileInfo *const tile = &tile_data->tile_info;
 2102|   719k|  MACROBLOCK *const x = &td->mb;
 2103|   719k|  MACROBLOCKD *xd = &x->e_mbd;
 2104|   719k|  av1_set_offsets_without_segment_id(cpi, tile, x, mi_row, mi_col, bsize);
 2105|   719k|  const int origin_mult = x->rdmult;
 2106|   719k|  setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, NO_AQ, NULL);
 2107|   719k|  MB_MODE_INFO *mbmi = xd->mi[0];
 2108|   719k|  mbmi->partition = partition;
 2109|   719k|  av1_update_state(cpi, td, ctx, mi_row, mi_col, bsize, dry_run);
 2110|   719k|  const int subsampling_x = cpi->common.seq_params->subsampling_x;
 2111|   719k|  const int subsampling_y = cpi->common.seq_params->subsampling_y;
 2112|   719k|  if (!dry_run) {
  ------------------
  |  Branch (2112:7): [True: 566k, False: 153k]
  ------------------
 2113|   566k|    set_cb_offsets(x->mbmi_ext_frame->cb_offset, x->cb_offset[PLANE_TYPE_Y],
 2114|   566k|                   x->cb_offset[PLANE_TYPE_UV]);
 2115|   566k|    assert(x->cb_offset[PLANE_TYPE_Y] <
 2116|   566k|           (1 << num_pels_log2_lookup[cpi->common.seq_params->sb_size]));
 2117|   566k|    assert(x->cb_offset[PLANE_TYPE_UV] <
 2118|   566k|           ((1 << num_pels_log2_lookup[cpi->common.seq_params->sb_size]) >>
 2119|   566k|            (subsampling_x + subsampling_y)));
 2120|   566k|  }
 2121|       |
 2122|   719k|  if (!is_inter_block(xd->mi[0])) xd->mi[0]->skip_txfm = 0;
  ------------------
  |  Branch (2122:7): [True: 281k, False: 438k]
  ------------------
 2123|   719k|  encode_superblock(cpi, tile_data, td, tp, dry_run, bsize, rate);
 2124|   719k|  if (!dry_run) {
  ------------------
  |  Branch (2124:7): [True: 567k, False: 152k]
  ------------------
 2125|   567k|    update_cb_offsets(x, bsize, subsampling_x, subsampling_y);
 2126|   567k|    if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (2126:9): [True: 0, False: 567k]
  ------------------
 2127|      0|      if (mbmi->compound_idx == 0 ||
  ------------------
  |  Branch (2127:11): [True: 0, False: 0]
  ------------------
 2128|      0|          mbmi->interinter_comp.type == COMPOUND_AVERAGE)
  ------------------
  |  Branch (2128:11): [True: 0, False: 0]
  ------------------
 2129|      0|        mbmi->comp_group_idx = 0;
 2130|      0|      else
 2131|      0|        mbmi->comp_group_idx = 1;
 2132|      0|      mbmi->compound_idx = 1;
 2133|      0|    }
 2134|   567k|    RD_COUNTS *const rdc = &td->rd_counts;
 2135|   567k|    if (mbmi->skip_mode) {
  ------------------
  |  Branch (2135:9): [True: 0, False: 567k]
  ------------------
 2136|      0|      assert(!frame_is_intra_only(cm));
 2137|      0|      rdc->skip_mode_used_flag = 1;
 2138|      0|      if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT &&
  ------------------
  |  Branch (2138:11): [True: 0, False: 0]
  ------------------
 2139|      0|          has_second_ref(mbmi)) {
  ------------------
  |  Branch (2139:11): [True: 0, False: 0]
  ------------------
 2140|      0|        rdc->compound_ref_used_flag = 1;
 2141|      0|      }
 2142|      0|      set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 2143|   567k|    } else {
 2144|   567k|      const int seg_ref_active =
 2145|   567k|          segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
 2146|   567k|      if (!seg_ref_active) {
  ------------------
  |  Branch (2146:11): [True: 567k, False: 106]
  ------------------
 2147|       |        // If the segment reference feature is enabled we have only a single
 2148|       |        // reference frame allowed for the segment so exclude it from
 2149|       |        // the reference frame counts used to work out probabilities.
 2150|   567k|        if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (2150:13): [True: 331k, False: 235k]
  ------------------
 2151|   331k|          av1_collect_neighbors_ref_counts(xd);
 2152|   331k|          if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT &&
  ------------------
  |  Branch (2152:15): [True: 289k, False: 42.3k]
  ------------------
 2153|   289k|              has_second_ref(mbmi)) {
  ------------------
  |  Branch (2153:15): [True: 0, False: 289k]
  ------------------
 2154|       |            // This flag is also updated for 4x4 blocks
 2155|      0|            rdc->compound_ref_used_flag = 1;
 2156|      0|          }
 2157|   331k|          set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 2158|   331k|        }
 2159|   567k|      }
 2160|   567k|    }
 2161|   567k|    if (cpi->oxcf.algo_cfg.loopfilter_control == LOOPFILTER_SELECTIVELY &&
  ------------------
  |  Branch (2161:9): [True: 0, False: 567k]
  ------------------
 2162|      0|        (mbmi->mode == NEWMV || mbmi->mode < INTRA_MODE_END)) {
  ------------------
  |  Branch (2162:10): [True: 0, False: 0]
  |  Branch (2162:33): [True: 0, False: 0]
  ------------------
 2163|      0|      int32_t blocks = mi_size_high[bsize] * mi_size_wide[bsize];
 2164|      0|      rdc->newmv_or_intra_blocks += blocks;
 2165|      0|    }
 2166|   567k|    if (tile_data->allow_update_cdf) update_stats(&cpi->common, td);
  ------------------
  |  Branch (2166:9): [True: 566k, False: 637]
  ------------------
 2167|   567k|  }
 2168|   719k|  if ((cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ ||
  ------------------
  |  Branch (2168:8): [True: 18.4E, False: 720k]
  ------------------
 2169|   720k|       cpi->active_map.enabled || cpi->roi.enabled) &&
  ------------------
  |  Branch (2169:8): [True: 18.4E, False: 720k]
  |  Branch (2169:35): [True: 18.4E, False: 720k]
  ------------------
 2170|      0|      mbmi->skip_txfm && !cpi->rc.rtc_external_ratectrl && cm->seg.enabled)
  ------------------
  |  Branch (2170:7): [True: 0, False: 0]
  |  Branch (2170:26): [True: 0, False: 0]
  |  Branch (2170:60): [True: 0, False: 0]
  ------------------
 2171|      0|    av1_cyclic_reset_segment_skip(cpi, x, mi_row, mi_col, bsize, dry_run);
 2172|       |  // TODO(Ravi/Remya): Move this copy function to a better logical place
 2173|       |  // This function will copy the best mode information from block
 2174|       |  // level (x->mbmi_ext) to frame level (cpi->mbmi_ext_info.frame_base). This
 2175|       |  // frame level buffer (cpi->mbmi_ext_info.frame_base) will be used during
 2176|       |  // bitstream preparation.
 2177|   719k|  av1_copy_mbmi_ext_to_mbmi_ext_frame(x->mbmi_ext_frame, &x->mbmi_ext,
 2178|   719k|                                      av1_ref_frame_type(xd->mi[0]->ref_frame));
 2179|   719k|  x->rdmult = origin_mult;
 2180|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 2181|       |  end_timing((AV1_COMP *)cpi, encode_b_nonrd_time);
 2182|       |#endif
 2183|   719k|}
partition_search.c:try_merge:
 2610|  51.6k|                      const int pl) {
 2611|  51.6k|  AV1_COMMON *const cm = &cpi->common;
 2612|  51.6k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 2613|  51.6k|  TileInfo *const tile_info = &tile_data->tile_info;
 2614|  51.6k|  MACROBLOCK *const x = &td->mb;
 2615|  51.6k|  MACROBLOCKD *const xd = &x->e_mbd;
 2616|  51.6k|  const ModeCosts *mode_costs = &x->mode_costs;
 2617|  51.6k|  const int num_planes = av1_num_planes(cm);
 2618|       |  // Only square blocks from 8x8 to 128x128 are supported
 2619|  51.6k|  assert(bsize >= BLOCK_8X8 && bsize <= BLOCK_128X128);
 2620|  51.6k|  const int bs = mi_size_wide[bsize];
 2621|  51.6k|  const int hbs = bs / 2;
 2622|  51.6k|  bool do_split = false;
 2623|  51.6k|  RD_SEARCH_MACROBLOCK_CONTEXT x_ctx;
 2624|  51.6k|  RD_STATS split_rdc, none_rdc;
 2625|  51.6k|  av1_invalid_rd_stats(&split_rdc);
 2626|  51.6k|  av1_invalid_rd_stats(&none_rdc);
 2627|  51.6k|  av1_save_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);
 2628|  51.6k|  xd->above_txfm_context =
 2629|  51.6k|      cm->above_contexts.txfm[tile_info->tile_row] + mi_col;
 2630|  51.6k|  xd->left_txfm_context =
 2631|  51.6k|      xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
  ------------------
  |  |   50|  51.6k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|  51.6k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  51.6k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|  51.6k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  51.6k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2632|  51.6k|  pc_tree->partitioning = PARTITION_NONE;
 2633|  51.6k|  if (!pc_tree->none) {
  ------------------
  |  Branch (2633:7): [True: 29.8k, False: 21.8k]
  ------------------
 2634|  29.8k|    pc_tree->none = av1_alloc_pmc(cpi, bsize, &td->shared_coeff_buf);
 2635|  29.8k|    if (!pc_tree->none)
  ------------------
  |  Branch (2635:9): [True: 0, False: 29.8k]
  ------------------
 2636|      0|      aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 2637|      0|                         "Failed to allocate PICK_MODE_CONTEXT");
 2638|  29.8k|  } else {
 2639|  21.8k|    av1_reset_pmc(pc_tree->none);
 2640|  21.8k|  }
 2641|  51.6k|  pick_sb_modes_nonrd(cpi, tile_data, x, mi_row, mi_col, &none_rdc, bsize,
 2642|  51.6k|                      pc_tree->none);
 2643|  51.6k|  none_rdc.rate += mode_costs->partition_cost[pl][PARTITION_NONE];
 2644|  51.6k|  none_rdc.rdcost = RDCOST(x->rdmult, none_rdc.rate, none_rdc.dist);
  ------------------
  |  |   33|  51.6k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  51.6k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  51.6k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  51.6k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2645|  51.6k|  av1_restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);
 2646|       |
 2647|  51.6k|  if (cpi->sf.rt_sf.nonrd_check_partition_merge_mode < 2 ||
  ------------------
  |  Branch (2647:7): [True: 43, False: 51.6k]
  ------------------
 2648|  51.6k|      none_rdc.skip_txfm != 1 || pc_tree->none->mic.mode == NEWMV) {
  ------------------
  |  Branch (2648:7): [True: 51.3k, False: 259]
  |  Branch (2648:34): [True: 97, False: 162]
  ------------------
 2649|  51.4k|    do_split = calc_do_split_flag(cpi, x, pc_tree, &none_rdc, mi_params, mi_row,
 2650|  51.4k|                                  mi_col, hbs, bsize, partition);
 2651|  51.4k|    if (do_split) {
  ------------------
  |  Branch (2651:9): [True: 51.4k, False: 45]
  ------------------
 2652|  51.4k|      av1_init_rd_stats(&split_rdc);
 2653|  51.4k|      split_rdc.rate += mode_costs->partition_cost[pl][PARTITION_SPLIT];
 2654|   238k|      for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|   238k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (2654:23): [True: 205k, False: 33.0k]
  ------------------
 2655|   205k|        RD_STATS block_rdc;
 2656|   205k|        av1_invalid_rd_stats(&block_rdc);
 2657|   205k|        int x_idx = (i & 1) * hbs;
 2658|   205k|        int y_idx = (i >> 1) * hbs;
 2659|   205k|        if ((mi_row + y_idx >= mi_params->mi_rows) ||
  ------------------
  |  Branch (2659:13): [True: 21, False: 205k]
  ------------------
 2660|   205k|            (mi_col + x_idx >= mi_params->mi_cols))
  ------------------
  |  Branch (2660:13): [True: 18.4E, False: 205k]
  ------------------
 2661|      0|          continue;
 2662|   205k|        xd->above_txfm_context =
 2663|   205k|            cm->above_contexts.txfm[tile_info->tile_row] + mi_col + x_idx;
 2664|   205k|        xd->left_txfm_context =
 2665|   205k|            xd->left_txfm_context_buffer + ((mi_row + y_idx) & MAX_MIB_MASK);
  ------------------
  |  |   50|   205k|#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
  |  |  ------------------
  |  |  |  |   44|   205k|#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   205k|#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|   205k|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   205k|#define MI_SIZE_LOG2 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2666|   205k|        if (!pc_tree->split[i]->none) {
  ------------------
  |  Branch (2666:13): [True: 121k, False: 83.7k]
  ------------------
 2667|   121k|          pc_tree->split[i]->none =
 2668|   121k|              av1_alloc_pmc(cpi, subsize, &td->shared_coeff_buf);
 2669|   121k|          if (!pc_tree->split[i]->none)
  ------------------
  |  Branch (2669:15): [True: 0, False: 121k]
  ------------------
 2670|      0|            aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 2671|      0|                               "Failed to allocate PICK_MODE_CONTEXT");
 2672|   121k|        } else {
 2673|  83.7k|          av1_reset_pmc(pc_tree->split[i]->none);
 2674|  83.7k|        }
 2675|   205k|        pc_tree->split[i]->partitioning = PARTITION_NONE;
 2676|   205k|        pick_sb_modes_nonrd(cpi, tile_data, x, mi_row + y_idx, mi_col + x_idx,
 2677|   205k|                            &block_rdc, subsize, pc_tree->split[i]->none);
 2678|       |        // TODO(yunqingwang): The rate here did not include the cost of
 2679|       |        // signaling PARTITION_NONE token in the sub-blocks.
 2680|   205k|        split_rdc.rate += block_rdc.rate;
 2681|   205k|        split_rdc.dist += block_rdc.dist;
 2682|       |
 2683|   205k|        av1_rd_cost_update(x->rdmult, &split_rdc);
 2684|       |
 2685|   205k|        if (none_rdc.rdcost < split_rdc.rdcost) {
  ------------------
  |  Branch (2685:13): [True: 18.3k, False: 186k]
  ------------------
 2686|  18.3k|          break;
 2687|  18.3k|        }
 2688|       |
 2689|   186k|        if (i != SUB_PARTITIONS_SPLIT - 1)
  ------------------
  |  |   49|   186k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (2689:13): [True: 153k, False: 32.8k]
  ------------------
 2690|   153k|          encode_b_nonrd(cpi, tile_data, td, tp, mi_row + y_idx, mi_col + x_idx,
 2691|   153k|                         1, subsize, PARTITION_NONE, pc_tree->split[i]->none,
 2692|   153k|                         NULL);
 2693|   186k|      }
 2694|  51.4k|      av1_restore_context(x, &x_ctx, mi_row, mi_col, bsize, num_planes);
 2695|  51.4k|      split_rdc.rdcost = RDCOST(x->rdmult, split_rdc.rate, split_rdc.dist);
  ------------------
  |  |   33|  51.4k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  51.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  51.4k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  51.4k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2696|  51.4k|    }
 2697|  51.4k|  }
 2698|       |
 2699|  51.6k|  if (none_rdc.rdcost < split_rdc.rdcost) {
  ------------------
  |  Branch (2699:7): [True: 18.5k, False: 33.1k]
  ------------------
 2700|       |    /* Predicted samples can not be reused for PARTITION_NONE since same
 2701|       |     * buffer is being used to store the reconstructed samples of
 2702|       |     * PARTITION_SPLIT block. */
 2703|  18.5k|    if (do_split) x->reuse_inter_pred = false;
  ------------------
  |  Branch (2703:9): [True: 18.3k, False: 217]
  ------------------
 2704|       |
 2705|  18.5k|    mib[0]->bsize = bsize;
 2706|  18.5k|    pc_tree->partitioning = PARTITION_NONE;
 2707|  18.5k|    encode_b_nonrd(cpi, tile_data, td, tp, mi_row, mi_col, 0, bsize, partition,
 2708|  18.5k|                   pc_tree->none, NULL);
 2709|  33.1k|  } else {
 2710|  33.1k|    mib[0]->bsize = subsize;
 2711|  33.1k|    pc_tree->partitioning = PARTITION_SPLIT;
 2712|       |    /* Predicted samples can not be reused for PARTITION_SPLIT since same
 2713|       |     * buffer is being used to write the reconstructed samples. */
 2714|       |    // TODO(Cherma): Store and reuse predicted samples generated by
 2715|       |    // encode_b_nonrd() in DRY_RUN_NORMAL mode.
 2716|  33.1k|    x->reuse_inter_pred = false;
 2717|       |
 2718|   165k|    for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|   165k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (2718:21): [True: 132k, False: 33.1k]
  ------------------
 2719|   132k|      int x_idx = (i & 1) * hbs;
 2720|   132k|      int y_idx = (i >> 1) * hbs;
 2721|   132k|      if ((mi_row + y_idx >= mi_params->mi_rows) ||
  ------------------
  |  Branch (2721:11): [True: 18.4E, False: 132k]
  ------------------
 2722|   132k|          (mi_col + x_idx >= mi_params->mi_cols))
  ------------------
  |  Branch (2722:11): [True: 18.4E, False: 132k]
  ------------------
 2723|      0|        continue;
 2724|       |
 2725|       |      // Note: We don't reset pc_tree->split[i]->none here because it
 2726|       |      // could contain results from the additional check. Instead, it is
 2727|       |      // reset before we enter the nonrd_check_partition_merge_mode
 2728|       |      // condition.
 2729|   132k|      if (!pc_tree->split[i]->none) {
  ------------------
  |  Branch (2729:11): [True: 0, False: 132k]
  ------------------
 2730|      0|        pc_tree->split[i]->none =
 2731|      0|            av1_alloc_pmc(cpi, subsize, &td->shared_coeff_buf);
 2732|      0|        if (!pc_tree->split[i]->none)
  ------------------
  |  Branch (2732:13): [True: 0, False: 0]
  ------------------
 2733|      0|          aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
 2734|      0|                             "Failed to allocate PICK_MODE_CONTEXT");
 2735|      0|      }
 2736|   132k|      encode_b_nonrd(cpi, tile_data, td, tp, mi_row + y_idx, mi_col + x_idx, 0,
 2737|       |                     subsize, PARTITION_NONE, pc_tree->split[i]->none, NULL);
 2738|   132k|    }
 2739|  33.1k|  }
 2740|  51.6k|}
partition_search.c:calc_do_split_flag:
 2527|  51.4k|                               BLOCK_SIZE bsize, PARTITION_TYPE partition) {
 2528|  51.4k|  const AV1_COMMON *const cm = &cpi->common;
 2529|  51.4k|  const int is_larger_qindex = cm->quant_params.base_qindex > 100;
 2530|  51.4k|  const MACROBLOCKD *const xd = &x->e_mbd;
 2531|  51.4k|  bool do_split =
 2532|  51.4k|      (cpi->sf.rt_sf.nonrd_check_partition_merge_mode == 3)
  ------------------
  |  Branch (2532:7): [True: 0, False: 51.4k]
  ------------------
 2533|  51.4k|          ? (bsize <= BLOCK_32X32 || (is_larger_qindex && bsize <= BLOCK_64X64))
  ------------------
  |  Branch (2533:14): [True: 0, False: 0]
  |  Branch (2533:39): [True: 0, False: 0]
  |  Branch (2533:59): [True: 0, False: 0]
  ------------------
 2534|  51.4k|          : true;
 2535|  51.4k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN ||
  ------------------
  |  Branch (2535:7): [True: 0, False: 51.4k]
  ------------------
 2536|  51.4k|      cpi->sf.rt_sf.nonrd_check_partition_merge_mode < 2 ||
  ------------------
  |  Branch (2536:7): [True: 18.4E, False: 51.4k]
  ------------------
 2537|  51.4k|      cyclic_refresh_segment_id_boosted(xd->mi[0]->segment_id) ||
  ------------------
  |  Branch (2537:7): [True: 18.4E, False: 51.4k]
  ------------------
 2538|  51.4k|      !none_rdc->skip_txfm)
  ------------------
  |  Branch (2538:7): [True: 51.3k, False: 97]
  ------------------
 2539|  51.3k|    return do_split;
 2540|       |
 2541|     79|  const int use_model_yrd_large = get_model_rd_flag(cpi, xd, bsize);
 2542|       |
 2543|       |  // When model based skip is not used (i.e.,use_model_yrd_large = 0), skip_txfm
 2544|       |  // would have been populated based on Hadamard transform and skip_txfm flag is
 2545|       |  // more reliable. Hence SPLIT evaluation is disabled at all quantizers for 8x8
 2546|       |  // and 16x16 blocks.
 2547|       |  // When model based skip is used (i.e.,use_model_yrd_large = 1), skip_txfm may
 2548|       |  // not be reliable. Hence SPLIT evaluation is disabled only at lower
 2549|       |  // quantizers for blocks >= 32x32.
 2550|     79|  if ((!use_model_yrd_large) || (!is_larger_qindex)) return false;
  ------------------
  |  Branch (2550:7): [True: 32, False: 47]
  |  Branch (2550:33): [True: 0, False: 47]
  ------------------
 2551|       |
 2552|       |  // Use residual statistics to decide if SPLIT partition should be evaluated
 2553|       |  // for 32x32 blocks. The pruning logic is avoided for larger block size to
 2554|       |  // avoid the visual artifacts
 2555|     47|  if (pc_tree->none->mic.mode == NEWMV && bsize == BLOCK_32X32 && do_split) {
  ------------------
  |  Branch (2555:7): [True: 47, False: 18.4E]
  |  Branch (2555:43): [True: 44, False: 3]
  |  Branch (2555:67): [True: 44, False: 0]
  ------------------
 2556|     44|    const BLOCK_SIZE subsize = get_partition_subsize(bsize, partition);
 2557|     44|    assert(subsize < BLOCK_SIZES_ALL);
 2558|     44|    double min_per_pixel_error = DBL_MAX;
 2559|     44|    double max_per_pixel_error = 0.;
 2560|     44|    int i;
 2561|    220|    for (i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|    220|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (2561:17): [True: 176, False: 44]
  ------------------
 2562|    176|      const int x_idx = (i & 1) * hbs;
 2563|    176|      const int y_idx = (i >> 1) * hbs;
 2564|    176|      if ((mi_row + y_idx >= mi_params->mi_rows) ||
  ------------------
  |  Branch (2564:11): [True: 0, False: 176]
  ------------------
 2565|    176|          (mi_col + x_idx >= mi_params->mi_cols)) {
  ------------------
  |  Branch (2565:11): [True: 0, False: 176]
  ------------------
 2566|      0|        break;
 2567|      0|      }
 2568|       |
 2569|       |      // Populate the appropriate buffer pointers.
 2570|       |      // Pass scale factors as NULL as the base pointer of the block would have
 2571|       |      // been calculated appropriately.
 2572|    176|      struct buf_2d src_split_buf_2d, pred_split_buf_2d;
 2573|    176|      const struct buf_2d *src_none_buf_2d = &x->plane[AOM_PLANE_Y].src;
  ------------------
  |  |  281|    176|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2574|    176|      setup_pred_plane(&src_split_buf_2d, subsize, src_none_buf_2d->buf,
 2575|    176|                       src_none_buf_2d->width, src_none_buf_2d->height,
 2576|    176|                       src_none_buf_2d->stride, y_idx, x_idx, NULL, 0, 0);
 2577|    176|      const struct buf_2d *pred_none_buf_2d = &xd->plane[AOM_PLANE_Y].dst;
  ------------------
  |  |  281|    176|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2578|    176|      setup_pred_plane(&pred_split_buf_2d, subsize, pred_none_buf_2d->buf,
 2579|    176|                       pred_none_buf_2d->width, pred_none_buf_2d->height,
 2580|    176|                       pred_none_buf_2d->stride, y_idx, x_idx, NULL, 0, 0);
 2581|       |
 2582|    176|      unsigned int curr_uint_mse;
 2583|    176|      const unsigned int curr_uint_var = cpi->ppi->fn_ptr[subsize].vf(
 2584|    176|          src_split_buf_2d.buf, src_split_buf_2d.stride, pred_split_buf_2d.buf,
 2585|    176|          pred_split_buf_2d.stride, &curr_uint_mse);
 2586|    176|      const double curr_per_pixel_error =
 2587|    176|          sqrt((double)curr_uint_var / block_size_wide[subsize] /
 2588|    176|               block_size_high[subsize]);
 2589|    176|      if (curr_per_pixel_error < min_per_pixel_error)
  ------------------
  |  Branch (2589:11): [True: 95, False: 81]
  ------------------
 2590|     95|        min_per_pixel_error = curr_per_pixel_error;
 2591|    176|      if (curr_per_pixel_error > max_per_pixel_error)
  ------------------
  |  Branch (2591:11): [True: 94, False: 82]
  ------------------
 2592|     94|        max_per_pixel_error = curr_per_pixel_error;
 2593|    176|    }
 2594|       |
 2595|       |    // Prune based on residual statistics only if all the sub-partitions are
 2596|       |    // valid.
 2597|     44|    if (i == SUB_PARTITIONS_SPLIT) {
  ------------------
  |  |   49|     44|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (2597:9): [True: 44, False: 0]
  ------------------
 2598|     44|      if (max_per_pixel_error - min_per_pixel_error <= 1.5) do_split = false;
  ------------------
  |  Branch (2598:11): [True: 5, False: 39]
  ------------------
 2599|     44|    }
 2600|     44|  }
 2601|       |
 2602|     29|  return do_split;
 2603|     79|}
partition_search.c:init_partition_search_state_params:
 3322|  2.70M|    int mi_row, int mi_col, BLOCK_SIZE bsize) {
 3323|  2.70M|  MACROBLOCKD *const xd = &x->e_mbd;
 3324|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 3325|  2.70M|  PartitionBlkParams *blk_params = &part_search_state->part_blk_params;
 3326|  2.70M|  const CommonModeInfoParams *const mi_params = &cpi->common.mi_params;
 3327|       |
 3328|       |  // Initialization of block size related parameters.
 3329|  2.70M|  blk_params->mi_step = mi_size_wide[bsize] / 2;
 3330|  2.70M|  blk_params->mi_row = mi_row;
 3331|  2.70M|  blk_params->mi_col = mi_col;
 3332|  2.70M|  blk_params->mi_row_edge = mi_row + blk_params->mi_step;
 3333|  2.70M|  blk_params->mi_col_edge = mi_col + blk_params->mi_step;
 3334|  2.70M|  blk_params->width = block_size_wide[bsize];
 3335|  2.70M|  blk_params->min_partition_size_1d =
 3336|  2.70M|      block_size_wide[x->sb_enc.min_partition_size];
 3337|  2.70M|  blk_params->subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
 3338|  2.70M|  blk_params->split_bsize2 = blk_params->subsize;
 3339|  2.70M|  blk_params->bsize_at_least_8x8 = (bsize >= BLOCK_8X8);
 3340|  2.70M|  blk_params->bsize = bsize;
 3341|       |
 3342|       |  // Check if the partition corresponds to edge block.
 3343|  2.70M|  blk_params->has_rows = (blk_params->mi_row_edge < mi_params->mi_rows);
 3344|  2.70M|  blk_params->has_cols = (blk_params->mi_col_edge < mi_params->mi_cols);
 3345|       |
 3346|       |  // Update intra partitioning related info.
 3347|  2.70M|  part_search_state->intra_part_info = &x->part_search_info;
 3348|       |  // Prepare for segmentation CNN-based partitioning for intra-frame.
 3349|  2.70M|  if (frame_is_intra_only(cm) && bsize == BLOCK_64X64) {
  ------------------
  |  Branch (3349:7): [True: 317k, False: 2.38M]
  |  Branch (3349:34): [True: 16.3k, False: 300k]
  ------------------
 3350|  16.3k|    part_search_state->intra_part_info->quad_tree_idx = 0;
 3351|  16.3k|    part_search_state->intra_part_info->cnn_output_valid = 0;
 3352|  16.3k|  }
 3353|       |
 3354|       |  // Set partition plane context index.
 3355|  2.70M|  part_search_state->pl_ctx_idx =
 3356|  2.70M|      blk_params->bsize_at_least_8x8
  ------------------
  |  Branch (3356:7): [True: 2.38M, False: 321k]
  ------------------
 3357|  2.70M|          ? partition_plane_context(xd, mi_row, mi_col, bsize)
 3358|  2.70M|          : 0;
 3359|       |
 3360|       |  // Partition cost buffer update
 3361|  2.70M|  ModeCosts *mode_costs = &x->mode_costs;
 3362|  2.70M|  part_search_state->partition_cost =
 3363|  2.70M|      mode_costs->partition_cost[part_search_state->pl_ctx_idx];
 3364|       |
 3365|       |  // Initialize HORZ and VERT win flags as true for all split partitions.
 3366|  13.5M|  for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|  13.5M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (3366:19): [True: 10.8M, False: 2.70M]
  ------------------
 3367|  10.8M|    part_search_state->split_part_rect_win[i].rect_part_win[HORZ] = true;
 3368|  10.8M|    part_search_state->split_part_rect_win[i].rect_part_win[VERT] = true;
 3369|  10.8M|  }
 3370|       |
 3371|       |  // Initialize the rd cost.
 3372|  2.70M|  av1_init_rd_stats(&part_search_state->this_rdc);
 3373|       |
 3374|       |  // Initialize RD costs for partition types to 0.
 3375|  2.70M|  part_search_state->none_rd = 0;
 3376|  2.70M|  av1_zero(part_search_state->split_rd);
  ------------------
  |  |   43|  2.70M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3377|  2.70M|  av1_zero(part_search_state->rect_part_rd);
  ------------------
  |  |   43|  2.70M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3378|       |
 3379|       |  // Initialize SPLIT partition to be not ready.
 3380|  2.70M|  av1_zero(part_search_state->is_split_ctx_is_ready);
  ------------------
  |  |   43|  2.70M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3381|       |  // Initialize HORZ and VERT partitions to be not ready.
 3382|  2.70M|  av1_zero(part_search_state->is_rect_ctx_is_ready);
  ------------------
  |  |   43|  2.70M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3383|       |
 3384|       |  // Chroma subsampling.
 3385|  2.70M|  part_search_state->ss_x = x->e_mbd.plane[1].subsampling_x;
 3386|  2.70M|  part_search_state->ss_y = x->e_mbd.plane[1].subsampling_y;
 3387|       |
 3388|       |  // Initialize partition search flags to defaults.
 3389|  2.70M|  part_search_state->terminate_partition_search = 0;
 3390|  2.70M|  part_search_state->do_square_split = blk_params->bsize_at_least_8x8;
 3391|  2.70M|  part_search_state->do_rectangular_split =
 3392|  2.70M|      cpi->oxcf.part_cfg.enable_rect_partitions &&
  ------------------
  |  Branch (3392:7): [True: 2.70M, False: 780]
  ------------------
 3393|  2.70M|      blk_params->bsize_at_least_8x8;
  ------------------
  |  Branch (3393:7): [True: 2.38M, False: 320k]
  ------------------
 3394|  2.70M|  av1_zero(part_search_state->prune_rect_part);
  ------------------
  |  |   43|  2.70M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3395|       |
 3396|       |  // Initialize allowed partition types for the partition block.
 3397|  2.70M|  part_search_state->partition_none_allowed =
 3398|  2.70M|      av1_blk_has_rows_and_cols(blk_params);
 3399|  2.70M|  part_search_state->partition_rect_allowed[HORZ] =
 3400|  2.70M|      part_search_state->do_rectangular_split && blk_params->has_cols &&
  ------------------
  |  Branch (3400:7): [True: 2.38M, False: 321k]
  |  Branch (3400:50): [True: 2.18M, False: 193k]
  ------------------
 3401|  2.18M|      get_plane_block_size(get_partition_subsize(bsize, PARTITION_HORZ),
  ------------------
  |  Branch (3401:7): [True: 2.18M, False: 127]
  ------------------
 3402|  2.18M|                           part_search_state->ss_x,
 3403|  2.18M|                           part_search_state->ss_y) != BLOCK_INVALID;
 3404|  2.70M|  part_search_state->partition_rect_allowed[VERT] =
 3405|  2.70M|      part_search_state->do_rectangular_split && blk_params->has_rows &&
  ------------------
  |  Branch (3405:7): [True: 2.38M, False: 321k]
  |  Branch (3405:50): [True: 2.19M, False: 192k]
  ------------------
 3406|  2.19M|      get_plane_block_size(get_partition_subsize(bsize, PARTITION_VERT),
  ------------------
  |  Branch (3406:7): [True: 1.94M, False: 241k]
  ------------------
 3407|  2.19M|                           part_search_state->ss_x,
 3408|  2.19M|                           part_search_state->ss_y) != BLOCK_INVALID;
 3409|       |
 3410|       |  // Reset the flag indicating whether a partition leading to a rdcost lower
 3411|       |  // than the bound best_rdc has been found.
 3412|  2.70M|  part_search_state->found_best_partition = false;
 3413|       |
 3414|       |#if CONFIG_COLLECT_PARTITION_STATS
 3415|       |  init_partition_block_timing_stats(&part_search_state->part_timing_stats);
 3416|       |#endif  // CONFIG_COLLECT_PARTITION_STATS
 3417|  2.70M|}
partition_search.c:set_sms_tree_partitioning:
 5620|  5.40M|                                             PARTITION_TYPE partition) {
 5621|  5.40M|  if (sms_tree == NULL) return;
  ------------------
  |  Branch (5621:7): [True: 0, False: 5.40M]
  ------------------
 5622|  5.40M|  sms_tree->partitioning = partition;
 5623|  5.40M|}
partition_search.c:set_partition_cost_for_edge_blk:
 3421|   304k|    AV1_COMMON const *cm, PartitionSearchState *part_search_state) {
 3422|   304k|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 3423|   304k|  assert(blk_params.bsize_at_least_8x8 && part_search_state->pl_ctx_idx >= 0);
 3424|   304k|  const aom_cdf_prob *partition_cdf =
 3425|   304k|      cm->fc->partition_cdf[part_search_state->pl_ctx_idx];
 3426|   304k|  const int max_cost = av1_cost_symbol(0);
 3427|  1.52M|  for (PARTITION_TYPE i = 0; i < PARTITION_TYPES; ++i)
  ------------------
  |  Branch (3427:30): [True: 1.21M, False: 304k]
  ------------------
 3428|  1.21M|    part_search_state->tmp_partition_cost[i] = max_cost;
 3429|   304k|  if (blk_params.has_cols) {
  ------------------
  |  Branch (3429:7): [True: 110k, False: 193k]
  ------------------
 3430|       |    // At the bottom, the two possibilities are HORZ and SPLIT.
 3431|   110k|    aom_cdf_prob bot_cdf[2];
 3432|   110k|    partition_gather_vert_alike(bot_cdf, partition_cdf, blk_params.bsize);
 3433|   110k|    static const int bot_inv_map[2] = { PARTITION_HORZ, PARTITION_SPLIT };
 3434|   110k|    av1_cost_tokens_from_cdf(part_search_state->tmp_partition_cost, bot_cdf,
 3435|   110k|                             bot_inv_map);
 3436|   193k|  } else if (blk_params.has_rows) {
  ------------------
  |  Branch (3436:14): [True: 112k, False: 81.5k]
  ------------------
 3437|       |    // At the right, the two possibilities are VERT and SPLIT.
 3438|   112k|    aom_cdf_prob rhs_cdf[2];
 3439|   112k|    partition_gather_horz_alike(rhs_cdf, partition_cdf, blk_params.bsize);
 3440|   112k|    static const int rhs_inv_map[2] = { PARTITION_VERT, PARTITION_SPLIT };
 3441|   112k|    av1_cost_tokens_from_cdf(part_search_state->tmp_partition_cost, rhs_cdf,
 3442|   112k|                             rhs_inv_map);
 3443|   112k|  } else {
 3444|       |    // At the bottom right, we always split.
 3445|  81.5k|    part_search_state->tmp_partition_cost[PARTITION_SPLIT] = 0;
 3446|  81.5k|  }
 3447|       |  // Override the partition cost buffer.
 3448|   304k|  part_search_state->partition_cost = part_search_state->tmp_partition_cost;
 3449|   304k|}
partition_search.c:none_partition_search:
 4415|  2.70M|    unsigned int *pb_source_variance, int64_t *none_rd, int64_t *part_none_rd) {
 4416|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 4417|  2.70M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4418|  2.70M|  RD_STATS *this_rdc = &part_search_state->this_rdc;
 4419|  2.70M|  const int mi_row = blk_params.mi_row;
 4420|  2.70M|  const int mi_col = blk_params.mi_col;
 4421|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4422|  2.70M|  assert(bsize < BLOCK_SIZES_ALL);
 4423|       |
 4424|  2.70M|  if (part_search_state->terminate_partition_search ||
  ------------------
  |  Branch (4424:7): [True: 18.4E, False: 2.70M]
  ------------------
 4425|  2.70M|      !part_search_state->partition_none_allowed)
  ------------------
  |  Branch (4425:7): [True: 669k, False: 2.03M]
  ------------------
 4426|   669k|    return;
 4427|       |
 4428|  2.03M|  int pt_cost = 0;
 4429|  2.03M|  RD_STATS best_remain_rdcost;
 4430|  2.03M|  av1_invalid_rd_stats(&best_remain_rdcost);
 4431|       |
 4432|       |  // Set PARTITION_NONE context and cost.
 4433|  2.03M|  set_none_partition_params(cpi, td, x, pc_tree, part_search_state,
 4434|  2.03M|                            &best_remain_rdcost, best_rdc, &pt_cost);
 4435|       |
 4436|       |#if CONFIG_COLLECT_PARTITION_STATS
 4437|       |  // Timer start for partition None.
 4438|       |  PartitionTimingStats *part_timing_stats =
 4439|       |      &part_search_state->part_timing_stats;
 4440|       |  if (best_remain_rdcost.rdcost >= 0) {
 4441|       |    start_partition_block_timer(part_timing_stats, PARTITION_NONE);
 4442|       |  }
 4443|       |#endif
 4444|       |  // PARTITION_NONE evaluation and cost update.
 4445|  2.03M|  pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, this_rdc, PARTITION_NONE,
 4446|  2.03M|                bsize, pc_tree->none, best_remain_rdcost);
 4447|       |
 4448|  2.03M|  av1_rd_cost_update(x->rdmult, this_rdc);
 4449|       |
 4450|       |#if CONFIG_COLLECT_PARTITION_STATS
 4451|       |  // Timer end for partition None.
 4452|       |  if (part_timing_stats->timer_is_on) {
 4453|       |    RD_STATS tmp_rdc;
 4454|       |    av1_init_rd_stats(&tmp_rdc);
 4455|       |    if (this_rdc->rate != INT_MAX) {
 4456|       |      tmp_rdc.rate = this_rdc->rate;
 4457|       |      tmp_rdc.dist = this_rdc->dist;
 4458|       |      tmp_rdc.rdcost = this_rdc->rdcost;
 4459|       |      if (blk_params.bsize_at_least_8x8) {
 4460|       |        tmp_rdc.rate += pt_cost;
 4461|       |        tmp_rdc.rdcost = RDCOST(x->rdmult, tmp_rdc.rate, tmp_rdc.dist);
 4462|       |      }
 4463|       |    }
 4464|       |    end_partition_block_timer(part_timing_stats, PARTITION_NONE,
 4465|       |                              tmp_rdc.rdcost);
 4466|       |  }
 4467|       |#endif
 4468|  2.03M|  *pb_source_variance = x->source_variance;
 4469|  2.03M|  if (none_rd) *none_rd = this_rdc->rdcost;
  ------------------
  |  Branch (4469:7): [True: 2.02M, False: 7.11k]
  ------------------
 4470|  2.03M|  part_search_state->none_rd = this_rdc->rdcost;
 4471|  2.03M|  if (this_rdc->rate != INT_MAX) {
  ------------------
  |  Branch (4471:7): [True: 1.92M, False: 108k]
  ------------------
 4472|       |    // Record picked ref frame to prune ref frames for other partition types.
 4473|  1.92M|    if (cpi->sf.inter_sf.prune_ref_frame_for_rect_partitions) {
  ------------------
  |  Branch (4473:9): [True: 1.39M, False: 533k]
  ------------------
 4474|  1.39M|      const int ref_type = av1_ref_frame_type(pc_tree->none->mic.ref_frame);
 4475|  1.39M|      av1_update_picked_ref_frames_mask(
 4476|  1.39M|          x, ref_type, bsize, cm->seq_params->mib_size, mi_row, mi_col);
 4477|  1.39M|    }
 4478|       |
 4479|       |    // Calculate the total cost and update the best partition.
 4480|  1.92M|    if (blk_params.bsize_at_least_8x8) {
  ------------------
  |  Branch (4480:9): [True: 1.67M, False: 251k]
  ------------------
 4481|  1.67M|      this_rdc->rate += pt_cost;
 4482|  1.67M|      this_rdc->rdcost = RDCOST(x->rdmult, this_rdc->rate, this_rdc->dist);
  ------------------
  |  |   33|  1.67M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.67M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.67M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.67M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 4483|  1.67M|    }
 4484|  1.92M|    *part_none_rd = this_rdc->rdcost;
 4485|  1.92M|    if (this_rdc->rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (4485:9): [True: 1.91M, False: 10.6k]
  ------------------
 4486|  1.91M|      *best_rdc = *this_rdc;
 4487|  1.91M|      part_search_state->found_best_partition = true;
 4488|  1.91M|      if (blk_params.bsize_at_least_8x8) {
  ------------------
  |  Branch (4488:11): [True: 1.66M, False: 247k]
  ------------------
 4489|  1.66M|        pc_tree->partitioning = PARTITION_NONE;
 4490|  1.66M|      }
 4491|       |
 4492|       |      // Disable split and rectangular partition search
 4493|       |      // based on PARTITION_NONE cost.
 4494|  1.91M|      prune_partitions_after_none(cpi, x, sms_tree, pc_tree->none,
 4495|  1.91M|                                  part_search_state, best_rdc,
 4496|  1.91M|                                  pb_source_variance);
 4497|  1.91M|    }
 4498|       |
 4499|  1.92M|    if (cpi->sf.part_sf.prune_rect_part_using_none_pred_mode)
  ------------------
  |  Branch (4499:9): [True: 0, False: 1.92M]
  ------------------
 4500|      0|      prune_rect_part_using_none_pred_mode(&x->e_mbd, part_search_state,
 4501|      0|                                           pc_tree->none->mic.mode, bsize);
 4502|  1.92M|  }
 4503|  2.03M|  av1_restore_context(x, x_ctx, mi_row, mi_col, bsize, av1_num_planes(cm));
 4504|  2.03M|}
partition_search.c:set_none_partition_params:
 4230|  2.03M|                                      RD_STATS *best_rdc, int *pt_cost) {
 4231|  2.03M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4232|  2.03M|  RD_STATS partition_rdcost;
 4233|       |  // Set PARTITION_NONE context.
 4234|  2.03M|  if (pc_tree->none == NULL)
  ------------------
  |  Branch (4234:7): [True: 2.03M, False: 18.4E]
  ------------------
 4235|  2.03M|    pc_tree->none = av1_alloc_pmc(cpi, blk_params.bsize, &td->shared_coeff_buf);
 4236|  2.03M|  if (!pc_tree->none)
  ------------------
  |  Branch (4236:7): [True: 0, False: 2.03M]
  ------------------
 4237|      0|    aom_internal_error(x->e_mbd.error_info, AOM_CODEC_MEM_ERROR,
 4238|      0|                       "Failed to allocate PICK_MODE_CONTEXT");
 4239|       |
 4240|       |  // Set PARTITION_NONE type cost.
 4241|  2.03M|  if (part_search_state->partition_none_allowed) {
  ------------------
  |  Branch (4241:7): [True: 2.03M, False: 18.4E]
  ------------------
 4242|  2.03M|    if (blk_params.bsize_at_least_8x8) {
  ------------------
  |  Branch (4242:9): [True: 1.71M, False: 320k]
  ------------------
 4243|  1.71M|      *pt_cost = part_search_state->partition_cost[PARTITION_NONE] < INT_MAX
  ------------------
  |  Branch (4243:18): [True: 1.71M, False: 18.4E]
  ------------------
 4244|  1.71M|                     ? part_search_state->partition_cost[PARTITION_NONE]
 4245|  18.4E|                     : 0;
 4246|  1.71M|    }
 4247|       |
 4248|       |    // Initialize the RD stats structure.
 4249|  2.03M|    av1_init_rd_stats(&partition_rdcost);
 4250|  2.03M|    partition_rdcost.rate = *pt_cost;
 4251|  2.03M|    av1_rd_cost_update(x->rdmult, &partition_rdcost);
 4252|  2.03M|    av1_rd_stats_subtraction(x->rdmult, best_rdc, &partition_rdcost,
 4253|  2.03M|                             best_remain_rdcost);
 4254|  2.03M|  }
 4255|  2.03M|}
partition_search.c:prune_partitions_after_none:
 4263|  1.91M|                                        unsigned int *pb_source_variance) {
 4264|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 4265|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 4266|  1.91M|  const PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4267|  1.91M|  RD_STATS *this_rdc = &part_search_state->this_rdc;
 4268|  1.91M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4269|  1.91M|  assert(bsize < BLOCK_SIZES_ALL);
 4270|       |
 4271|  1.91M|  if (!frame_is_intra_only(cm) &&
  ------------------
  |  Branch (4271:7): [True: 1.69M, False: 220k]
  ------------------
 4272|  1.69M|      (part_search_state->do_square_split ||
  ------------------
  |  Branch (4272:8): [True: 116k, False: 1.57M]
  ------------------
 4273|  1.57M|       part_search_state->do_rectangular_split) &&
  ------------------
  |  Branch (4273:8): [True: 11.2k, False: 1.56M]
  ------------------
 4274|   127k|      !x->e_mbd.lossless[xd->mi[0]->segment_id] && ctx_none->skippable) {
  ------------------
  |  Branch (4274:7): [True: 127k, False: 552]
  |  Branch (4274:52): [True: 2.52k, False: 124k]
  ------------------
 4275|  2.52k|    const int use_ml_based_breakout =
 4276|  2.52k|        bsize <= cpi->sf.part_sf.use_square_partition_only_threshold &&
  ------------------
  |  Branch (4276:9): [True: 2.04k, False: 479]
  ------------------
 4277|  2.04k|        bsize > BLOCK_4X4 && cpi->sf.part_sf.ml_predict_breakout_level >= 1;
  ------------------
  |  Branch (4277:9): [True: 2.04k, False: 0]
  |  Branch (4277:30): [True: 2.04k, False: 0]
  ------------------
 4278|  2.52k|    if (use_ml_based_breakout) {
  ------------------
  |  Branch (4278:9): [True: 2.04k, False: 479]
  ------------------
 4279|  2.04k|      av1_ml_predict_breakout(cpi, x, this_rdc, *pb_source_variance, xd->bd,
 4280|  2.04k|                              part_search_state);
 4281|  2.04k|    }
 4282|       |
 4283|       |    // Adjust dist breakout threshold according to the partition size.
 4284|  2.52k|    const int64_t dist_breakout_thr =
 4285|  2.52k|        cpi->sf.part_sf.partition_search_breakout_dist_thr >>
 4286|  2.52k|        ((2 * (MAX_SB_SIZE_LOG2 - 2)) -
  ------------------
  |  |   31|  2.52k|#define MAX_SB_SIZE_LOG2 7
  ------------------
 4287|  2.52k|         (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]));
 4288|  2.52k|    const int rate_breakout_thr =
 4289|  2.52k|        cpi->sf.part_sf.partition_search_breakout_rate_thr *
 4290|  2.52k|        num_pels_log2_lookup[bsize];
 4291|       |    // If all y, u, v transform blocks in this partition are skippable,
 4292|       |    // and the dist & rate are within the thresholds, the partition
 4293|       |    // search is terminated for current branch of the partition search
 4294|       |    // tree. The dist & rate thresholds are set to 0 at speed 0 to
 4295|       |    // disable the early termination at that speed.
 4296|  2.52k|    if (best_rdc->dist < dist_breakout_thr &&
  ------------------
  |  Branch (4296:9): [True: 62, False: 2.46k]
  ------------------
 4297|     62|        best_rdc->rate < rate_breakout_thr) {
  ------------------
  |  Branch (4297:9): [True: 0, False: 62]
  ------------------
 4298|      0|      part_search_state->do_square_split = 0;
 4299|      0|      part_search_state->do_rectangular_split = 0;
 4300|      0|    }
 4301|  2.52k|  }
 4302|       |
 4303|       |  // Early termination: using simple_motion_search features and the
 4304|       |  // rate, distortion, and rdcost of PARTITION_NONE, a DNN will make a
 4305|       |  // decision on early terminating at PARTITION_NONE.
 4306|  1.91M|  if (cpi->sf.part_sf.simple_motion_search_early_term_none && cm->show_frame &&
  ------------------
  |  Branch (4306:7): [True: 1.91M, False: 26]
  |  Branch (4306:63): [True: 1.91M, False: 18]
  ------------------
 4307|  1.91M|      !frame_is_intra_only(cm) && bsize >= BLOCK_16X16 &&
  ------------------
  |  Branch (4307:7): [True: 1.69M, False: 220k]
  |  Branch (4307:35): [True: 48.8k, False: 1.64M]
  ------------------
 4308|  48.8k|      av1_blk_has_rows_and_cols(&blk_params) && this_rdc->rdcost < INT64_MAX &&
  ------------------
  |  Branch (4308:7): [True: 48.8k, False: 3]
  |  Branch (4308:49): [True: 48.8k, False: 18.4E]
  ------------------
 4309|  48.8k|      this_rdc->rdcost >= 0 && this_rdc->rate < INT_MAX &&
  ------------------
  |  Branch (4309:7): [True: 48.8k, False: 0]
  |  Branch (4309:32): [True: 48.8k, False: 0]
  ------------------
 4310|  48.8k|      this_rdc->rate >= 0 &&
  ------------------
  |  Branch (4310:7): [True: 48.8k, False: 0]
  ------------------
 4311|  48.8k|      (part_search_state->do_square_split ||
  ------------------
  |  Branch (4311:8): [True: 37.4k, False: 11.3k]
  ------------------
 4312|  48.6k|       part_search_state->do_rectangular_split)) {
  ------------------
  |  Branch (4312:8): [True: 11.1k, False: 168]
  ------------------
 4313|  48.6k|    av1_simple_motion_search_early_term_none(cpi, x, sms_tree, this_rdc,
 4314|  48.6k|                                             part_search_state);
 4315|  48.6k|  }
 4316|  1.91M|}
partition_search.c:split_partition_search:
 4528|  2.70M|    SB_MULTI_PASS_MODE multi_pass_mode, int64_t *part_split_rd) {
 4529|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 4530|  2.70M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4531|  2.70M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 4532|  2.70M|  const int mi_row = blk_params.mi_row;
 4533|  2.70M|  const int mi_col = blk_params.mi_col;
 4534|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4535|  2.70M|  assert(bsize < BLOCK_SIZES_ALL);
 4536|  2.70M|  RD_STATS sum_rdc = part_search_state->sum_rdc;
 4537|  2.70M|  const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
 4538|       |
 4539|       |  // Check if partition split is allowed.
 4540|  2.70M|  if (part_search_state->terminate_partition_search ||
  ------------------
  |  Branch (4540:7): [True: 1.23k, False: 2.70M]
  ------------------
 4541|  2.70M|      !part_search_state->do_square_split)
  ------------------
  |  Branch (4541:7): [True: 1.86M, False: 837k]
  ------------------
 4542|  1.86M|    return;
 4543|       |
 4544|  4.18M|  for (int i = 0; i < SUB_PARTITIONS_SPLIT; ++i) {
  ------------------
  |  |   49|  4.18M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (4544:19): [True: 3.34M, False: 836k]
  ------------------
 4545|  3.34M|    if (pc_tree->split[i] == NULL)
  ------------------
  |  Branch (4545:9): [True: 3.34M, False: 18.4E]
  ------------------
 4546|  3.34M|      pc_tree->split[i] = av1_alloc_pc_tree_node(subsize);
 4547|  3.34M|    if (!pc_tree->split[i])
  ------------------
  |  Branch (4547:9): [True: 0, False: 3.34M]
  ------------------
 4548|      0|      aom_internal_error(x->e_mbd.error_info, AOM_CODEC_MEM_ERROR,
 4549|      0|                         "Failed to allocate PC_TREE");
 4550|  3.34M|    pc_tree->split[i]->index = i;
 4551|  3.34M|  }
 4552|       |
 4553|       |  // Initialization of this partition RD stats.
 4554|   836k|  av1_init_rd_stats(&sum_rdc);
 4555|   836k|  sum_rdc.rate = part_search_state->partition_cost[PARTITION_SPLIT];
 4556|   836k|  sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, 0);
  ------------------
  |  |   33|   836k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   836k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   836k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   836k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 4557|       |
 4558|   836k|  int idx;
 4559|       |#if CONFIG_COLLECT_PARTITION_STATS
 4560|       |  PartitionTimingStats *part_timing_stats =
 4561|       |      &part_search_state->part_timing_stats;
 4562|       |  if (best_rdc->rdcost - sum_rdc.rdcost >= 0) {
 4563|       |    start_partition_block_timer(part_timing_stats, PARTITION_SPLIT);
 4564|       |  }
 4565|       |#endif
 4566|       |  // Recursive partition search on 4 sub-blocks.
 4567|  4.01M|  for (idx = 0; idx < SUB_PARTITIONS_SPLIT && sum_rdc.rdcost < best_rdc->rdcost;
  ------------------
  |  |   49|  8.03M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (4567:17): [True: 3.30M, False: 714k]
  |  Branch (4567:47): [True: 3.30M, False: 18.4E]
  ------------------
 4568|  3.30M|       ++idx) {
 4569|  3.30M|    const int x_idx = (idx & 1) * blk_params.mi_step;
 4570|  3.30M|    const int y_idx = (idx >> 1) * blk_params.mi_step;
 4571|       |
 4572|  3.30M|    if (mi_row + y_idx >= mi_params->mi_rows ||
  ------------------
  |  Branch (4572:9): [True: 382k, False: 2.92M]
  ------------------
 4573|  2.92M|        mi_col + x_idx >= mi_params->mi_cols)
  ------------------
  |  Branch (4573:9): [True: 304k, False: 2.61M]
  ------------------
 4574|   686k|      continue;
 4575|       |
 4576|  2.61M|    pc_tree->split[idx]->index = idx;
 4577|  2.61M|    int64_t *p_split_rd = &part_search_state->split_rd[idx];
 4578|  2.61M|    RD_STATS best_remain_rdcost;
 4579|  2.61M|    av1_rd_stats_subtraction(x->rdmult, best_rdc, &sum_rdc,
 4580|  2.61M|                             &best_remain_rdcost);
 4581|       |
 4582|  2.61M|    int curr_quad_tree_idx = 0;
 4583|  2.61M|    if (frame_is_intra_only(cm) && bsize <= BLOCK_64X64) {
  ------------------
  |  Branch (4583:9): [True: 300k, False: 2.31M]
  |  Branch (4583:36): [True: 300k, False: 1]
  ------------------
 4584|   300k|      curr_quad_tree_idx = part_search_state->intra_part_info->quad_tree_idx;
 4585|   300k|      part_search_state->intra_part_info->quad_tree_idx =
 4586|   300k|          4 * curr_quad_tree_idx + idx + 1;
 4587|   300k|    }
 4588|       |    // Split partition evaluation of corresponding idx.
 4589|       |    // If the RD cost exceeds the best cost then do not
 4590|       |    // evaluate other split sub-partitions.
 4591|  2.61M|    SIMPLE_MOTION_DATA_TREE *const sms_tree_split =
 4592|  2.61M|        (sms_tree == NULL) ? NULL : sms_tree->split[idx];
  ------------------
  |  Branch (4592:9): [True: 0, False: 2.61M]
  ------------------
 4593|  2.61M|    if (!av1_rd_pick_partition(
  ------------------
  |  Branch (4593:9): [True: 122k, False: 2.49M]
  ------------------
 4594|  2.61M|            cpi, td, tile_data, tp, mi_row + y_idx, mi_col + x_idx, subsize,
 4595|  2.61M|            &part_search_state->this_rdc, best_remain_rdcost,
 4596|  2.61M|            pc_tree->split[idx], sms_tree_split, p_split_rd, multi_pass_mode,
 4597|  2.61M|            &part_search_state->split_part_rect_win[idx])) {
 4598|   122k|      av1_invalid_rd_stats(&sum_rdc);
 4599|   122k|      break;
 4600|   122k|    }
 4601|  2.49M|    if (frame_is_intra_only(cm) && bsize <= BLOCK_64X64) {
  ------------------
  |  Branch (4601:9): [True: 267k, False: 2.22M]
  |  Branch (4601:36): [True: 267k, False: 18.4E]
  ------------------
 4602|   267k|      part_search_state->intra_part_info->quad_tree_idx = curr_quad_tree_idx;
 4603|   267k|    }
 4604|       |
 4605|  2.49M|    sum_rdc.rate += part_search_state->this_rdc.rate;
 4606|  2.49M|    sum_rdc.dist += part_search_state->this_rdc.dist;
 4607|  2.49M|    av1_rd_cost_update(x->rdmult, &sum_rdc);
 4608|       |
 4609|       |    // Set split ctx as ready for use.
 4610|  2.49M|    if (idx <= 1 && (bsize <= BLOCK_8X8 ||
  ------------------
  |  Branch (4610:9): [True: 1.46M, False: 1.02M]
  |  Branch (4610:22): [True: 167k, False: 1.29M]
  ------------------
 4611|  1.29M|                     pc_tree->split[idx]->partitioning == PARTITION_NONE)) {
  ------------------
  |  Branch (4611:22): [True: 897k, False: 401k]
  ------------------
 4612|  1.06M|      const MB_MODE_INFO *const mbmi = &pc_tree->split[idx]->none->mic;
 4613|  1.06M|      const PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 4614|       |      // Neither palette mode nor cfl predicted.
 4615|  1.06M|      if (pmi->palette_size[0] == 0 && pmi->palette_size[1] == 0) {
  ------------------
  |  Branch (4615:11): [True: 1.04M, False: 23.7k]
  |  Branch (4615:40): [True: 1.04M, False: 957]
  ------------------
 4616|  1.04M|        if (mbmi->uv_mode != UV_CFL_PRED)
  ------------------
  |  Branch (4616:13): [True: 910k, False: 129k]
  ------------------
 4617|   910k|          part_search_state->is_split_ctx_is_ready[idx] = 1;
 4618|  1.04M|      }
 4619|  1.06M|    }
 4620|  2.49M|  }
 4621|       |#if CONFIG_COLLECT_PARTITION_STATS
 4622|       |  if (part_timing_stats->timer_is_on) {
 4623|       |    end_partition_block_timer(part_timing_stats, PARTITION_SPLIT,
 4624|       |                              sum_rdc.rdcost);
 4625|       |  }
 4626|       |#endif
 4627|   836k|  const int reached_last_index = (idx == SUB_PARTITIONS_SPLIT);
  ------------------
  |  |   49|   836k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
 4628|       |
 4629|       |  // Calculate the total cost and update the best partition.
 4630|   836k|  *part_split_rd = sum_rdc.rdcost;
 4631|   836k|  if (reached_last_index && sum_rdc.rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (4631:7): [True: 714k, False: 122k]
  |  Branch (4631:29): [True: 714k, False: 18.4E]
  ------------------
 4632|   714k|    sum_rdc.rdcost = RDCOST(x->rdmult, sum_rdc.rate, sum_rdc.dist);
  ------------------
  |  |   33|   714k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   714k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   714k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   714k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 4633|   714k|    const double penalty_factor = get_split_partition_penalty(
 4634|   714k|        bsize, cpi->sf.part_sf.split_partition_penalty_level);
 4635|   714k|    const int64_t this_rdcost = (int64_t)(sum_rdc.rdcost * penalty_factor);
 4636|   714k|    if (this_rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (4636:9): [True: 714k, False: 10]
  ------------------
 4637|   714k|      *best_rdc = sum_rdc;
 4638|   714k|      part_search_state->found_best_partition = true;
 4639|   714k|      pc_tree->partitioning = PARTITION_SPLIT;
 4640|   714k|    }
 4641|   714k|  } else if (cpi->sf.part_sf.less_rectangular_check_level > 0) {
  ------------------
  |  Branch (4641:14): [True: 122k, False: 18.4E]
  ------------------
 4642|       |    // Skip rectangular partition test when partition type none gives better
 4643|       |    // rd than partition type split.
 4644|   122k|    if (cpi->sf.part_sf.less_rectangular_check_level == 2 || idx <= 2) {
  ------------------
  |  Branch (4644:9): [True: 122k, False: 0]
  |  Branch (4644:62): [True: 0, False: 0]
  ------------------
 4645|   122k|      const int partition_none_valid = part_search_state->none_rd > 0;
 4646|   122k|      const int partition_none_better =
 4647|   122k|          part_search_state->none_rd < sum_rdc.rdcost;
 4648|   122k|      part_search_state->do_rectangular_split &=
 4649|   122k|          !(partition_none_valid && partition_none_better);
  ------------------
  |  Branch (4649:13): [True: 119k, False: 3.21k]
  |  Branch (4649:37): [True: 116k, False: 3.24k]
  ------------------
 4650|   122k|    }
 4651|   122k|  }
 4652|       |  // Restore the context for the following cases:
 4653|       |  // 1) Current block size not more than maximum partition size as dry run
 4654|       |  // encode happens for these cases
 4655|       |  // 2) Current block size same as superblock size as the final encode
 4656|       |  // happens for this case
 4657|   836k|  if (bsize <= x->sb_enc.max_partition_size || bsize == cm->seq_params->sb_size)
  ------------------
  |  Branch (4657:7): [True: 836k, False: 0]
  |  Branch (4657:48): [True: 0, False: 0]
  ------------------
 4658|   837k|    av1_restore_context(x, x_ctx, mi_row, mi_col, bsize, av1_num_planes(cm));
 4659|   836k|}
partition_search.c:get_split_partition_penalty:
 4507|   714k|    BLOCK_SIZE bsize, int split_partition_penalty_level) {
 4508|   714k|  if (!split_partition_penalty_level) return 1.00;
  ------------------
  |  Branch (4508:7): [True: 714k, False: 2]
  ------------------
 4509|       |
 4510|       |  // Higher penalty for smaller block sizes.
 4511|      2|  static const double penalty_factors[2][SQR_BLOCK_SIZES - 1] = {
 4512|      2|    { 1.080, 1.040, 1.020, 1.010, 1.000 },
 4513|      2|    { 1.100, 1.075, 1.050, 1.025, 1.000 },
 4514|      2|  };
 4515|      2|  const int sqr_bsize_idx = get_sqr_bsize_idx(bsize);
 4516|       |  assert(sqr_bsize_idx > 0 && sqr_bsize_idx < SQR_BLOCK_SIZES);
 4517|      2|  const double this_penalty_factor =
 4518|      2|      penalty_factors[split_partition_penalty_level - 1][sqr_bsize_idx - 1];
 4519|      2|  return this_penalty_factor;
 4520|   714k|}
partition_search.c:prune_partitions_after_split:
 4323|  2.70M|    int64_t part_none_rd, int64_t part_split_rd) {
 4324|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 4325|  2.70M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4326|  2.70M|  const int mi_row = blk_params.mi_row;
 4327|  2.70M|  const int mi_col = blk_params.mi_col;
 4328|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4329|  2.70M|  assert(bsize < BLOCK_SIZES_ALL);
 4330|       |
 4331|       |  // Early termination: using the rd costs of PARTITION_NONE and subblocks
 4332|       |  // from PARTITION_SPLIT to determine an early breakout.
 4333|  2.70M|  if (cpi->sf.part_sf.ml_early_term_after_part_split_level &&
  ------------------
  |  Branch (4333:7): [True: 0, False: 2.70M]
  ------------------
 4334|      0|      !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (4334:7): [True: 0, False: 0]
  ------------------
 4335|      0|      !part_search_state->terminate_partition_search &&
  ------------------
  |  Branch (4335:7): [True: 0, False: 0]
  ------------------
 4336|      0|      part_search_state->do_rectangular_split &&
  ------------------
  |  Branch (4336:7): [True: 0, False: 0]
  ------------------
 4337|      0|      (part_search_state->partition_rect_allowed[HORZ] ||
  ------------------
  |  Branch (4337:8): [True: 0, False: 0]
  ------------------
 4338|      0|       part_search_state->partition_rect_allowed[VERT])) {
  ------------------
  |  Branch (4338:8): [True: 0, False: 0]
  ------------------
 4339|      0|    av1_ml_early_term_after_split(
 4340|      0|        cpi, x, sms_tree, best_rdc->rdcost, part_none_rd, part_split_rd,
 4341|      0|        part_search_state->split_rd, part_search_state);
 4342|      0|  }
 4343|       |
 4344|       |  // Use the rd costs of PARTITION_NONE and subblocks from PARTITION_SPLIT
 4345|       |  // to prune out rectangular partitions in some directions.
 4346|  2.70M|  if (!cpi->sf.part_sf.ml_early_term_after_part_split_level &&
  ------------------
  |  Branch (4346:7): [True: 2.70M, False: 32]
  ------------------
 4347|  2.70M|      cpi->sf.part_sf.ml_prune_partition && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (4347:7): [True: 2.70M, False: 18.4E]
  |  Branch (4347:45): [True: 2.38M, False: 317k]
  ------------------
 4348|  2.38M|      (part_search_state->partition_rect_allowed[HORZ] ||
  ------------------
  |  Branch (4348:8): [True: 190k, False: 2.19M]
  ------------------
 4349|  2.19M|       part_search_state->partition_rect_allowed[VERT]) &&
  ------------------
  |  Branch (4349:8): [True: 73.1k, False: 2.12M]
  ------------------
 4350|   263k|      !(part_search_state->prune_rect_part[HORZ] ||
  ------------------
  |  Branch (4350:9): [True: 177k, False: 86.0k]
  ------------------
 4351|  86.0k|        part_search_state->prune_rect_part[VERT]) &&
  ------------------
  |  Branch (4351:9): [True: 4.73k, False: 81.3k]
  ------------------
 4352|  81.3k|      !part_search_state->terminate_partition_search) {
  ------------------
  |  Branch (4352:7): [True: 80.5k, False: 785]
  ------------------
 4353|  80.5k|    av1_setup_src_planes(x, cpi->source, mi_row, mi_col, av1_num_planes(cm),
 4354|  80.5k|                         bsize);
 4355|  80.5k|    av1_ml_prune_rect_partition(cpi, x, best_rdc->rdcost,
 4356|  80.5k|                                part_search_state->none_rd,
 4357|  80.5k|                                part_search_state->split_rd, part_search_state);
 4358|  80.5k|  }
 4359|  2.70M|}
partition_search.c:rectangular_partition_search:
 3535|  2.70M|    const RECT_PART_TYPE end_type) {
 3536|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 3537|  2.70M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 3538|  2.70M|  RD_STATS *sum_rdc = &part_search_state->sum_rdc;
 3539|  2.70M|  const int rect_partition_type[NUM_RECT_PARTS] = { PARTITION_HORZ,
 3540|  2.70M|                                                    PARTITION_VERT };
 3541|       |
 3542|       |  // mi_pos_rect[NUM_RECT_PARTS][SUB_PARTITIONS_RECT][0]: mi_row postion of
 3543|       |  //                                           HORZ and VERT partition types.
 3544|       |  // mi_pos_rect[NUM_RECT_PARTS][SUB_PARTITIONS_RECT][1]: mi_col postion of
 3545|       |  //                                           HORZ and VERT partition types.
 3546|  2.70M|  const int mi_pos_rect[NUM_RECT_PARTS][SUB_PARTITIONS_RECT][2] = {
 3547|  2.70M|    { { blk_params.mi_row, blk_params.mi_col },
 3548|  2.70M|      { blk_params.mi_row_edge, blk_params.mi_col } },
 3549|  2.70M|    { { blk_params.mi_row, blk_params.mi_col },
 3550|  2.70M|      { blk_params.mi_row, blk_params.mi_col_edge } }
 3551|  2.70M|  };
 3552|       |
 3553|       |  // Initialize active edge_type function pointer
 3554|       |  // for HOZR and VERT partition types.
 3555|  2.70M|  active_edge_info active_edge_type[NUM_RECT_PARTS] = { av1_active_h_edge,
 3556|  2.70M|                                                        av1_active_v_edge };
 3557|       |
 3558|       |  // Indicates edge blocks for HORZ and VERT partition types.
 3559|  2.70M|  const int is_not_edge_block[NUM_RECT_PARTS] = { blk_params.has_rows,
 3560|  2.70M|                                                  blk_params.has_cols };
 3561|       |
 3562|       |  // Initialize pc tree context for HORZ and VERT partition types.
 3563|  2.70M|  PICK_MODE_CONTEXT **cur_ctx[NUM_RECT_PARTS][SUB_PARTITIONS_RECT] = {
 3564|  2.70M|    { &pc_tree->horizontal[0], &pc_tree->horizontal[1] },
 3565|  2.70M|    { &pc_tree->vertical[0], &pc_tree->vertical[1] }
 3566|  2.70M|  };
 3567|       |
 3568|       |  // Loop over rectangular partition types.
 3569|  8.11M|  for (RECT_PART_TYPE i = start_type; i <= end_type; i++) {
  ------------------
  |  Branch (3569:39): [True: 5.40M, False: 2.70M]
  ------------------
 3570|  5.40M|    assert(IMPLIES(!cpi->oxcf.part_cfg.enable_rect_partitions,
 3571|  5.40M|                   !part_search_state->partition_rect_allowed[i]));
 3572|       |
 3573|       |    // Check if the HORZ / VERT partition search is to be performed.
 3574|  5.40M|    if (!is_rect_part_allowed(cpi, part_search_state, active_edge_type, i,
  ------------------
  |  Branch (3574:9): [True: 5.24M, False: 159k]
  ------------------
 3575|  5.40M|                              mi_pos_rect[i][0][i]))
 3576|  5.24M|      continue;
 3577|       |
 3578|       |    // Sub-partition idx.
 3579|   159k|    int sub_part_idx = 0;
 3580|   159k|    PARTITION_TYPE partition_type = rect_partition_type[i];
 3581|   159k|    blk_params.subsize =
 3582|   159k|        get_partition_subsize(blk_params.bsize, partition_type);
 3583|   159k|    assert(blk_params.subsize <= BLOCK_LARGEST);
 3584|   159k|    av1_init_rd_stats(sum_rdc);
 3585|   479k|    for (int j = 0; j < SUB_PARTITIONS_RECT; j++) {
  ------------------
  |  |   46|   479k|#define SUB_PARTITIONS_RECT 2
  ------------------
  |  Branch (3585:21): [True: 319k, False: 159k]
  ------------------
 3586|   319k|      if (cur_ctx[i][j][0] == NULL) {
  ------------------
  |  Branch (3586:11): [True: 319k, False: 0]
  ------------------
 3587|   319k|        cur_ctx[i][j][0] =
 3588|   319k|            av1_alloc_pmc(cpi, blk_params.subsize, &td->shared_coeff_buf);
 3589|   319k|        if (!cur_ctx[i][j][0])
  ------------------
  |  Branch (3589:13): [True: 0, False: 319k]
  ------------------
 3590|      0|          aom_internal_error(x->e_mbd.error_info, AOM_CODEC_MEM_ERROR,
 3591|      0|                             "Failed to allocate PICK_MODE_CONTEXT");
 3592|   319k|      }
 3593|   319k|    }
 3594|   159k|    sum_rdc->rate = part_search_state->partition_cost[partition_type];
 3595|   159k|    sum_rdc->rdcost = RDCOST(x->rdmult, sum_rdc->rate, 0);
  ------------------
  |  |   33|   159k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   159k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   159k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   159k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3596|       |#if CONFIG_COLLECT_PARTITION_STATS
 3597|       |    PartitionTimingStats *part_timing_stats =
 3598|       |        &part_search_state->part_timing_stats;
 3599|       |    if (best_rdc->rdcost - sum_rdc->rdcost >= 0) {
 3600|       |      start_partition_block_timer(part_timing_stats, partition_type);
 3601|       |    }
 3602|       |#endif
 3603|       |
 3604|       |    // First sub-partition evaluation in HORZ / VERT partition type.
 3605|   159k|    rd_pick_rect_partition(
 3606|   159k|        cpi, tile_data, x, cur_ctx[i][sub_part_idx][0], part_search_state,
 3607|   159k|        best_rdc, 0, mi_pos_rect[i][sub_part_idx][0],
 3608|   159k|        mi_pos_rect[i][sub_part_idx][1], blk_params.subsize, partition_type);
 3609|       |
 3610|       |    // Start of second sub-partition evaluation.
 3611|       |    // Evaluate second sub-partition if the first sub-partition cost
 3612|       |    // is less than the best cost and if it is not an edge block.
 3613|   159k|    if (sum_rdc->rdcost < best_rdc->rdcost && is_not_edge_block[i]) {
  ------------------
  |  Branch (3613:9): [True: 116k, False: 43.0k]
  |  Branch (3613:47): [True: 94.5k, False: 22.1k]
  ------------------
 3614|  94.5k|      const MB_MODE_INFO *const mbmi = &cur_ctx[i][sub_part_idx][0]->mic;
 3615|  94.5k|      const PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 3616|       |      // Neither palette mode nor cfl predicted.
 3617|  94.5k|      if (pmi->palette_size[PLANE_TYPE_Y] == 0 &&
  ------------------
  |  Branch (3617:11): [True: 94.3k, False: 222]
  ------------------
 3618|  94.3k|          pmi->palette_size[PLANE_TYPE_UV] == 0) {
  ------------------
  |  Branch (3618:11): [True: 94.2k, False: 90]
  ------------------
 3619|  94.2k|        if (mbmi->uv_mode != UV_CFL_PRED)
  ------------------
  |  Branch (3619:13): [True: 79.1k, False: 15.1k]
  ------------------
 3620|  79.1k|          part_search_state->is_rect_ctx_is_ready[i] = 1;
 3621|  94.2k|      }
 3622|  94.5k|      av1_update_state(cpi, td, cur_ctx[i][sub_part_idx][0], blk_params.mi_row,
 3623|  94.5k|                       blk_params.mi_col, blk_params.subsize, DRY_RUN_NORMAL);
 3624|  94.5k|      encode_superblock(cpi, tile_data, td, tp, DRY_RUN_NORMAL,
 3625|  94.5k|                        blk_params.subsize, NULL);
 3626|       |
 3627|       |      // Second sub-partition evaluation in HORZ / VERT partition type.
 3628|  94.5k|      sub_part_idx = 1;
 3629|  94.5k|      rd_pick_rect_partition(
 3630|  94.5k|          cpi, tile_data, x, cur_ctx[i][sub_part_idx][0], part_search_state,
 3631|  94.5k|          best_rdc, 1, mi_pos_rect[i][sub_part_idx][0],
 3632|  94.5k|          mi_pos_rect[i][sub_part_idx][1], blk_params.subsize, partition_type);
 3633|  94.5k|    }
 3634|       |    // Update HORZ / VERT best partition.
 3635|   159k|    if (sum_rdc->rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (3635:9): [True: 36.4k, False: 123k]
  ------------------
 3636|  36.4k|      sum_rdc->rdcost = RDCOST(x->rdmult, sum_rdc->rate, sum_rdc->dist);
  ------------------
  |  |   33|  36.4k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  36.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  36.4k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  36.4k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3637|  36.4k|      if (sum_rdc->rdcost < best_rdc->rdcost) {
  ------------------
  |  Branch (3637:11): [True: 36.4k, False: 1]
  ------------------
 3638|  36.4k|        *best_rdc = *sum_rdc;
 3639|  36.4k|        part_search_state->found_best_partition = true;
 3640|  36.4k|        pc_tree->partitioning = partition_type;
 3641|  36.4k|      }
 3642|   123k|    } else {
 3643|       |      // Update HORZ / VERT win flag.
 3644|   123k|      if (rect_part_win_info != NULL)
  ------------------
  |  Branch (3644:11): [True: 118k, False: 4.66k]
  ------------------
 3645|   118k|        rect_part_win_info->rect_part_win[i] = false;
 3646|   123k|    }
 3647|       |#if CONFIG_COLLECT_PARTITION_STATS
 3648|       |    if (part_timing_stats->timer_is_on) {
 3649|       |      end_partition_block_timer(part_timing_stats, partition_type,
 3650|       |                                sum_rdc->rdcost);
 3651|       |    }
 3652|       |#endif
 3653|   159k|    av1_restore_context(x, x_ctx, blk_params.mi_row, blk_params.mi_col,
 3654|   159k|                        blk_params.bsize, av1_num_planes(cm));
 3655|   159k|  }
 3656|  2.70M|}
partition_search.c:is_rect_part_allowed:
 3518|  5.40M|    const int mi_pos) {
 3519|  5.40M|  const PartitionBlkParams *blk_params = &part_search_state->part_blk_params;
 3520|  5.40M|  const int is_part_allowed =
 3521|  5.40M|      (!part_search_state->terminate_partition_search &&
  ------------------
  |  Branch (3521:8): [True: 5.18M, False: 225k]
  ------------------
 3522|  5.18M|       part_search_state->partition_rect_allowed[rect_part] &&
  ------------------
  |  Branch (3522:8): [True: 457k, False: 4.72M]
  ------------------
 3523|   457k|       !part_search_state->prune_rect_part[rect_part] &&
  ------------------
  |  Branch (3523:8): [True: 251k, False: 205k]
  ------------------
 3524|   251k|       (part_search_state->do_rectangular_split ||
  ------------------
  |  Branch (3524:9): [True: 108k, False: 143k]
  ------------------
 3525|   143k|        active_edge[rect_part](cpi, mi_pos, blk_params->mi_step)));
  ------------------
  |  Branch (3525:9): [True: 51.7k, False: 91.9k]
  ------------------
 3526|  5.40M|  return is_part_allowed;
 3527|  5.40M|}
partition_search.c:rd_pick_rect_partition:
 3486|   254k|                                   PARTITION_TYPE partition_type) {
 3487|       |  // Obtain the remainder from the best rd cost
 3488|       |  // for further processing of partition.
 3489|   254k|  RD_STATS best_remain_rdcost;
 3490|   254k|  av1_rd_stats_subtraction(x->rdmult, best_rdc, &part_search_state->sum_rdc,
 3491|   254k|                           &best_remain_rdcost);
 3492|       |
 3493|       |  // Obtain the best mode for the partition sub-block.
 3494|   254k|  pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &part_search_state->this_rdc,
 3495|   254k|                partition_type, bsize, cur_partition_ctx, best_remain_rdcost);
 3496|   254k|  av1_rd_cost_update(x->rdmult, &part_search_state->this_rdc);
 3497|       |
 3498|       |  // Update the partition rd cost with the current sub-block rd.
 3499|   254k|  if (part_search_state->this_rdc.rate == INT_MAX) {
  ------------------
  |  Branch (3499:7): [True: 99.4k, False: 155k]
  ------------------
 3500|  99.4k|    part_search_state->sum_rdc.rdcost = INT64_MAX;
 3501|   155k|  } else {
 3502|   155k|    part_search_state->sum_rdc.rate += part_search_state->this_rdc.rate;
 3503|   155k|    part_search_state->sum_rdc.dist += part_search_state->this_rdc.dist;
 3504|   155k|    av1_rd_cost_update(x->rdmult, &part_search_state->sum_rdc);
 3505|   155k|  }
 3506|   254k|  const RECT_PART_TYPE rect_part =
 3507|   254k|      partition_type == PARTITION_HORZ ? HORZ : VERT;
  ------------------
  |  Branch (3507:7): [True: 131k, False: 122k]
  ------------------
 3508|   254k|  part_search_state->rect_part_rd[rect_part][idx] =
 3509|   254k|      part_search_state->this_rdc.rdcost;
 3510|   254k|}
partition_search.c:prune_ext_part_none_skippable:
 3990|  2.70M|    int skip_non_sq_part_based_on_none, BLOCK_SIZE bsize) {
 3991|  2.70M|  if ((skip_non_sq_part_based_on_none >= 1) && (part_none != NULL)) {
  ------------------
  |  Branch (3991:7): [True: 2.38M, False: 317k]
  |  Branch (3991:48): [True: 1.78M, False: 605k]
  ------------------
 3992|  1.78M|    if (part_none->skippable && !must_find_valid_partition &&
  ------------------
  |  Branch (3992:9): [True: 16.7k, False: 1.76M]
  |  Branch (3992:33): [True: 16.7k, False: 0]
  ------------------
 3993|  16.7k|        bsize >= BLOCK_16X16) {
  ------------------
  |  Branch (3993:9): [True: 2.40k, False: 14.3k]
  ------------------
 3994|  2.40k|      return 1;
 3995|  2.40k|    }
 3996|  1.78M|  }
 3997|  2.70M|  return 0;
 3998|  2.70M|}
partition_search.c:allow_ab_partition_search:
 4006|  2.70M|                                     int64_t best_rdcost) {
 4007|  2.70M|  const PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4008|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4009|       |
 4010|       |  // Do not prune if there is no valid partition
 4011|  2.70M|  if (best_rdcost == INT64_MAX) return 1;
  ------------------
  |  Branch (4011:7): [True: 0, False: 2.70M]
  ------------------
 4012|       |
 4013|       |  // Determine bsize threshold to evaluate ab partitions
 4014|  2.70M|  BLOCK_SIZE ab_bsize_thresh = part_sf->ext_partition_eval_thresh;
 4015|  2.70M|  if (part_sf->ext_part_eval_based_on_cur_best && !must_find_valid_partition &&
  ------------------
  |  Branch (4015:7): [True: 0, False: 2.70M]
  |  Branch (4015:51): [True: 0, False: 0]
  ------------------
 4016|      0|      !(curr_best_part == PARTITION_HORZ || curr_best_part == PARTITION_VERT))
  ------------------
  |  Branch (4016:9): [True: 0, False: 0]
  |  Branch (4016:45): [True: 0, False: 0]
  ------------------
 4017|      0|    ab_bsize_thresh = BLOCK_128X128;
 4018|       |
 4019|       |  // ab partitions are only allowed for square block sizes BLOCK_16X16 or
 4020|       |  // higher, so ab_bsize_thresh must be large enough to exclude BLOCK_4X4 and
 4021|       |  // BLOCK_8X8.
 4022|  2.70M|  assert(ab_bsize_thresh >= BLOCK_8X8);
 4023|       |
 4024|  2.70M|  int ab_partition_allowed =
 4025|  2.70M|      part_search_state->do_rectangular_split && bsize > ab_bsize_thresh &&
  ------------------
  |  Branch (4025:7): [True: 342k, False: 2.36M]
  |  Branch (4025:50): [True: 0, False: 342k]
  ------------------
 4026|      0|      av1_blk_has_rows_and_cols(&blk_params) && !prune_ext_part_state;
  ------------------
  |  Branch (4026:7): [True: 0, False: 0]
  |  Branch (4026:49): [True: 0, False: 0]
  ------------------
 4027|       |
 4028|  2.70M|  return ab_partition_allowed;
 4029|  2.70M|}
partition_search.c:ab_partitions_search:
 3777|  2.70M|    const AB_PART_TYPE start_type, const AB_PART_TYPE end_type) {
 3778|  2.70M|  PartitionBlkParams blk_params = part_search_state->part_blk_params;
 3779|  2.70M|  const int mi_row = blk_params.mi_row;
 3780|  2.70M|  const int mi_col = blk_params.mi_col;
 3781|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 3782|       |
 3783|  2.70M|  if (part_search_state->terminate_partition_search) {
  ------------------
  |  Branch (3783:7): [True: 112k, False: 2.59M]
  ------------------
 3784|   112k|    return;
 3785|   112k|  }
 3786|       |
 3787|  2.59M|  int ab_partitions_allowed[NUM_AB_PARTS];
 3788|       |  // Prune AB partitions
 3789|  2.59M|  av1_prune_ab_partitions(cpi, x, pc_tree, pb_source_variance, best_rdc->rdcost,
 3790|  2.59M|                          rect_part_win_info, ext_partition_allowed,
 3791|  2.59M|                          part_search_state, ab_partitions_allowed);
 3792|       |
 3793|       |  // Flags to indicate whether the mode search is done.
 3794|  2.59M|  const int is_ctx_ready[NUM_AB_PARTS][2] = {
 3795|  2.59M|    { part_search_state->is_split_ctx_is_ready[0],
 3796|  2.59M|      part_search_state->is_split_ctx_is_ready[1] },
 3797|  2.59M|    { part_search_state->is_rect_ctx_is_ready[HORZ], 0 },
 3798|  2.59M|    { part_search_state->is_split_ctx_is_ready[0], 0 },
 3799|  2.59M|    { part_search_state->is_rect_ctx_is_ready[VERT], 0 }
 3800|  2.59M|  };
 3801|       |
 3802|       |  // Current partition context.
 3803|  2.59M|  PICK_MODE_CONTEXT **cur_part_ctxs[NUM_AB_PARTS] = { pc_tree->horizontala,
 3804|  2.59M|                                                      pc_tree->horizontalb,
 3805|  2.59M|                                                      pc_tree->verticala,
 3806|  2.59M|                                                      pc_tree->verticalb };
 3807|       |
 3808|       |  // Context of already evaluted partition types.
 3809|  2.59M|  PICK_MODE_CONTEXT **mode_srch_ctx[NUM_AB_PARTS][2];
 3810|       |  // Set context of already evaluted partition types.
 3811|  2.59M|  set_mode_search_ctx(pc_tree, is_ctx_ready, mode_srch_ctx);
 3812|       |
 3813|       |  // Array of sub-partition size of AB partition types.
 3814|  2.59M|  const BLOCK_SIZE ab_subsize[NUM_AB_PARTS][SUB_PARTITIONS_AB] = {
 3815|  2.59M|    { blk_params.split_bsize2, blk_params.split_bsize2,
 3816|  2.59M|      get_partition_subsize(bsize, PARTITION_HORZ_A) },
 3817|  2.59M|    { get_partition_subsize(bsize, PARTITION_HORZ_B), blk_params.split_bsize2,
 3818|  2.59M|      blk_params.split_bsize2 },
 3819|  2.59M|    { blk_params.split_bsize2, blk_params.split_bsize2,
 3820|  2.59M|      get_partition_subsize(bsize, PARTITION_VERT_A) },
 3821|  2.59M|    { get_partition_subsize(bsize, PARTITION_VERT_B), blk_params.split_bsize2,
 3822|  2.59M|      blk_params.split_bsize2 }
 3823|  2.59M|  };
 3824|       |
 3825|       |  // Array of mi_row, mi_col positions corresponds to each sub-partition in AB
 3826|       |  // partition types.
 3827|  2.59M|  const int ab_mi_pos[NUM_AB_PARTS][SUB_PARTITIONS_AB][2] = {
 3828|  2.59M|    { { mi_row, mi_col },
 3829|  2.59M|      { mi_row, blk_params.mi_col_edge },
 3830|  2.59M|      { blk_params.mi_row_edge, mi_col } },
 3831|  2.59M|    { { mi_row, mi_col },
 3832|  2.59M|      { blk_params.mi_row_edge, mi_col },
 3833|  2.59M|      { blk_params.mi_row_edge, blk_params.mi_col_edge } },
 3834|  2.59M|    { { mi_row, mi_col },
 3835|  2.59M|      { blk_params.mi_row_edge, mi_col },
 3836|  2.59M|      { mi_row, blk_params.mi_col_edge } },
 3837|  2.59M|    { { mi_row, mi_col },
 3838|  2.59M|      { mi_row, blk_params.mi_col_edge },
 3839|  2.59M|      { blk_params.mi_row_edge, blk_params.mi_col_edge } }
 3840|  2.59M|  };
 3841|       |
 3842|       |  // Loop over AB partition types.
 3843|  12.9M|  for (AB_PART_TYPE ab_part_type = start_type; ab_part_type <= end_type;
  ------------------
  |  Branch (3843:48): [True: 10.3M, False: 2.59M]
  ------------------
 3844|  10.3M|       ab_part_type++) {
 3845|  10.3M|    const PARTITION_TYPE part_type = ab_part_type + PARTITION_HORZ_A;
 3846|       |
 3847|       |    // Check if the AB partition search is to be performed.
 3848|  10.3M|    if (!ab_partitions_allowed[ab_part_type]) {
  ------------------
  |  Branch (3848:9): [True: 10.3M, False: 18.4E]
  ------------------
 3849|  10.3M|      continue;
 3850|  10.3M|    }
 3851|       |
 3852|  18.4E|    blk_params.subsize = get_partition_subsize(bsize, part_type);
 3853|  18.4E|    for (int i = 0; i < SUB_PARTITIONS_AB; i++) {
  ------------------
  |  |   52|  18.4E|#define SUB_PARTITIONS_AB 3
  ------------------
  |  Branch (3853:21): [True: 0, False: 18.4E]
  ------------------
 3854|       |      // Set AB partition context.
 3855|      0|      cur_part_ctxs[ab_part_type][i] = av1_alloc_pmc(
 3856|      0|          cpi, ab_subsize[ab_part_type][i], &td->shared_coeff_buf);
 3857|      0|      if (!cur_part_ctxs[ab_part_type][i])
  ------------------
  |  Branch (3857:11): [True: 0, False: 0]
  ------------------
 3858|      0|        aom_internal_error(x->e_mbd.error_info, AOM_CODEC_MEM_ERROR,
 3859|      0|                           "Failed to allocate PICK_MODE_CONTEXT");
 3860|       |      // Set mode as not ready.
 3861|      0|      cur_part_ctxs[ab_part_type][i]->rd_mode_is_ready = 0;
 3862|      0|    }
 3863|       |
 3864|  18.4E|    if (cpi->sf.part_sf.reuse_prev_rd_results_for_part_ab) {
  ------------------
  |  Branch (3864:9): [True: 0, False: 18.4E]
  ------------------
 3865|       |      // We can copy directly the mode search results if we have already
 3866|       |      // searched the current block and the contexts match.
 3867|      0|      if (is_ctx_ready[ab_part_type][0]) {
  ------------------
  |  Branch (3867:11): [True: 0, False: 0]
  ------------------
 3868|      0|        av1_copy_tree_context(cur_part_ctxs[ab_part_type][0],
 3869|      0|                              mode_srch_ctx[ab_part_type][0][0]);
 3870|      0|        cur_part_ctxs[ab_part_type][0]->mic.partition = part_type;
 3871|      0|        cur_part_ctxs[ab_part_type][0]->rd_mode_is_ready = 1;
 3872|      0|        if (is_ctx_ready[ab_part_type][1]) {
  ------------------
  |  Branch (3872:13): [True: 0, False: 0]
  ------------------
 3873|      0|          av1_copy_tree_context(cur_part_ctxs[ab_part_type][1],
 3874|      0|                                mode_srch_ctx[ab_part_type][1][0]);
 3875|      0|          cur_part_ctxs[ab_part_type][1]->mic.partition = part_type;
 3876|      0|          cur_part_ctxs[ab_part_type][1]->rd_mode_is_ready = 1;
 3877|      0|        }
 3878|      0|      }
 3879|      0|    }
 3880|       |
 3881|       |    // Even if the contexts don't match, we can still speed up by reusing the
 3882|       |    // previous prediction mode.
 3883|  18.4E|    const MB_MODE_INFO *mode_cache[3] = { NULL, NULL, NULL };
 3884|  18.4E|    if (cpi->sf.part_sf.reuse_best_prediction_for_part_ab) {
  ------------------
  |  Branch (3884:9): [True: 0, False: 18.4E]
  ------------------
 3885|      0|      set_mode_cache_for_partition_ab(mode_cache, pc_tree, ab_part_type);
 3886|      0|    }
 3887|       |
 3888|       |    // Evaluation of AB partition type.
 3889|  18.4E|    rd_pick_ab_part(cpi, td, tile_data, tp, x, x_ctx, pc_tree,
 3890|  18.4E|                    cur_part_ctxs[ab_part_type], part_search_state, best_rdc,
 3891|  18.4E|                    ab_subsize[ab_part_type], ab_mi_pos[ab_part_type],
 3892|  18.4E|                    part_type, mode_cache);
 3893|  18.4E|  }
 3894|  2.59M|}
partition_search.c:set_mode_search_ctx:
 3706|  2.59M|    PICK_MODE_CONTEXT **mode_srch_ctx[NUM_AB_PARTS][2]) {
 3707|  2.59M|  mode_srch_ctx[HORZ_B][0] = &pc_tree->horizontal[0];
 3708|  2.59M|  mode_srch_ctx[VERT_B][0] = &pc_tree->vertical[0];
 3709|       |
 3710|  2.59M|  if (is_ctx_ready[HORZ_A][0])
  ------------------
  |  Branch (3710:7): [True: 492k, False: 2.09M]
  ------------------
 3711|   492k|    mode_srch_ctx[HORZ_A][0] = &pc_tree->split[0]->none;
 3712|       |
 3713|  2.59M|  if (is_ctx_ready[VERT_A][0])
  ------------------
  |  Branch (3713:7): [True: 492k, False: 2.09M]
  ------------------
 3714|   492k|    mode_srch_ctx[VERT_A][0] = &pc_tree->split[0]->none;
 3715|       |
 3716|  2.59M|  if (is_ctx_ready[HORZ_A][1])
  ------------------
  |  Branch (3716:7): [True: 411k, False: 2.18M]
  ------------------
 3717|   411k|    mode_srch_ctx[HORZ_A][1] = &pc_tree->split[1]->none;
 3718|  2.59M|}
partition_search.c:prune_4_way_partition_search:
 4135|  2.70M|    int mi_row, int mi_col, int part4_search_allowed[NUM_PART4_TYPES]) {
 4136|  2.70M|  const PartitionBlkParams blk_params = part_search_state->part_blk_params;
 4137|  2.70M|  const BLOCK_SIZE bsize = blk_params.bsize;
 4138|       |
 4139|  2.70M|  const PartitionCfg *const part_cfg = &cpi->oxcf.part_cfg;
 4140|       |
 4141|       |  // Do not prune if there is no valid partition
 4142|  2.70M|  if (best_rdc->rdcost == INT64_MAX && part_cfg->enable_1to4_partitions &&
  ------------------
  |  Branch (4142:7): [True: 0, False: 2.70M]
  |  Branch (4142:40): [True: 0, False: 0]
  ------------------
 4143|      0|      bsize != BLOCK_128X128)
  ------------------
  |  Branch (4143:7): [True: 0, False: 0]
  ------------------
 4144|      0|    return;
 4145|       |
 4146|       |  // Determine bsize threshold to evaluate 4-way partitions
 4147|  2.70M|  BLOCK_SIZE part4_bsize_thresh = cpi->sf.part_sf.ext_partition_eval_thresh;
 4148|  2.70M|  if (cpi->sf.part_sf.ext_part_eval_based_on_cur_best &&
  ------------------
  |  Branch (4148:7): [True: 0, False: 2.70M]
  ------------------
 4149|      0|      !x->must_find_valid_partition && pc_tree->partitioning == PARTITION_NONE)
  ------------------
  |  Branch (4149:7): [True: 0, False: 0]
  |  Branch (4149:40): [True: 0, False: 0]
  ------------------
 4150|      0|    part4_bsize_thresh = BLOCK_128X128;
 4151|       |
 4152|       |  // 4-way partitions are only allowed for BLOCK_16X16, BLOCK_32X32, and
 4153|       |  // BLOCK_64X64, so part4_bsize_thresh must be large enough to exclude
 4154|       |  // BLOCK_4X4 and BLOCK_8X8.
 4155|  2.70M|  assert(part4_bsize_thresh >= BLOCK_8X8);
 4156|       |
 4157|  2.70M|  bool partition4_allowed =
 4158|  2.70M|      part_search_state->do_rectangular_split && bsize > part4_bsize_thresh &&
  ------------------
  |  Branch (4158:7): [True: 342k, False: 2.36M]
  |  Branch (4158:50): [True: 0, False: 342k]
  ------------------
 4159|      0|      av1_blk_has_rows_and_cols(&blk_params) && !prune_ext_part_state;
  ------------------
  |  Branch (4159:7): [True: 0, False: 0]
  |  Branch (4159:49): [True: 0, False: 0]
  ------------------
 4160|       |
 4161|       |  // Disable 4-way partition search flags for width less than a multiple of the
 4162|       |  // minimum partition width.
 4163|  2.70M|  if (blk_params.width < (blk_params.min_partition_size_1d
  ------------------
  |  Branch (4163:7): [True: 2.43M, False: 269k]
  ------------------
 4164|  2.70M|                          << cpi->sf.part_sf.prune_part4_search)) {
 4165|  2.43M|    part4_search_allowed[HORZ4] = 0;
 4166|  2.43M|    part4_search_allowed[VERT4] = 0;
 4167|  2.43M|    return;
 4168|  2.43M|  }
 4169|       |
 4170|   269k|  PARTITION_TYPE cur_part[NUM_PART4_TYPES] = { PARTITION_HORZ_4,
 4171|   269k|                                               PARTITION_VERT_4 };
 4172|       |  // partition4_allowed is 1 if we can use a PARTITION_HORZ_4 or
 4173|       |  // PARTITION_VERT_4 for this block. This is almost the same as
 4174|       |  // partition4_allowed, except that we don't allow 128x32 or 32x128
 4175|       |  // blocks, so we require that bsize is not BLOCK_128X128.
 4176|   269k|  partition4_allowed &=
 4177|   269k|      part_cfg->enable_1to4_partitions && bsize != BLOCK_128X128;
  ------------------
  |  Branch (4177:7): [True: 269k, False: 18.4E]
  |  Branch (4177:43): [True: 269k, False: 18.4E]
  ------------------
 4178|       |
 4179|   809k|  for (PART4_TYPES i = HORZ4; i < NUM_PART4_TYPES; i++) {
  ------------------
  |  Branch (4179:31): [True: 539k, False: 269k]
  ------------------
 4180|   539k|    part4_search_allowed[i] =
 4181|   539k|        partition4_allowed && part_search_state->partition_rect_allowed[i] &&
  ------------------
  |  Branch (4181:9): [True: 0, False: 539k]
  |  Branch (4181:31): [True: 0, False: 0]
  ------------------
 4182|      0|        get_plane_block_size(get_partition_subsize(bsize, cur_part[i]),
  ------------------
  |  Branch (4182:9): [True: 0, False: 0]
  ------------------
 4183|      0|                             part_search_state->ss_x,
 4184|      0|                             part_search_state->ss_y) != BLOCK_INVALID;
 4185|   539k|  }
 4186|       |  // Pruning: pruning out 4-way partitions based on the current best partition.
 4187|   269k|  if (cpi->sf.part_sf.prune_ext_partition_types_search_level == 2) {
  ------------------
  |  Branch (4187:7): [True: 0, False: 269k]
  ------------------
 4188|      0|    part4_search_allowed[HORZ4] &= (pc_tree->partitioning == PARTITION_HORZ ||
  ------------------
  |  Branch (4188:37): [True: 0, False: 0]
  ------------------
 4189|      0|                                    pc_tree->partitioning == PARTITION_HORZ_A ||
  ------------------
  |  Branch (4189:37): [True: 0, False: 0]
  ------------------
 4190|      0|                                    pc_tree->partitioning == PARTITION_HORZ_B ||
  ------------------
  |  Branch (4190:37): [True: 0, False: 0]
  ------------------
 4191|      0|                                    pc_tree->partitioning == PARTITION_SPLIT ||
  ------------------
  |  Branch (4191:37): [True: 0, False: 0]
  ------------------
 4192|      0|                                    pc_tree->partitioning == PARTITION_NONE);
  ------------------
  |  Branch (4192:37): [True: 0, False: 0]
  ------------------
 4193|      0|    part4_search_allowed[VERT4] &= (pc_tree->partitioning == PARTITION_VERT ||
  ------------------
  |  Branch (4193:37): [True: 0, False: 0]
  ------------------
 4194|      0|                                    pc_tree->partitioning == PARTITION_VERT_A ||
  ------------------
  |  Branch (4194:37): [True: 0, False: 0]
  ------------------
 4195|      0|                                    pc_tree->partitioning == PARTITION_VERT_B ||
  ------------------
  |  Branch (4195:37): [True: 0, False: 0]
  ------------------
 4196|      0|                                    pc_tree->partitioning == PARTITION_SPLIT ||
  ------------------
  |  Branch (4196:37): [True: 0, False: 0]
  ------------------
 4197|      0|                                    pc_tree->partitioning == PARTITION_NONE);
  ------------------
  |  Branch (4197:37): [True: 0, False: 0]
  ------------------
 4198|      0|  }
 4199|       |
 4200|       |  // Pruning: pruning out some 4-way partitions using a DNN taking rd costs of
 4201|       |  // sub-blocks from basic partition types.
 4202|   269k|  if (cpi->sf.part_sf.ml_prune_partition && partition4_allowed &&
  ------------------
  |  Branch (4202:7): [True: 269k, False: 18.4E]
  |  Branch (4202:45): [True: 0, False: 269k]
  ------------------
 4203|      0|      part_search_state->partition_rect_allowed[HORZ] &&
  ------------------
  |  Branch (4203:7): [True: 0, False: 0]
  ------------------
 4204|      0|      part_search_state->partition_rect_allowed[VERT]) {
  ------------------
  |  Branch (4204:7): [True: 0, False: 0]
  ------------------
 4205|      0|    av1_ml_prune_4_partition(cpi, x, pc_tree->partitioning, best_rdc->rdcost,
 4206|      0|                             part_search_state, part4_search_allowed,
 4207|      0|                             pb_source_variance);
 4208|      0|  }
 4209|       |
 4210|       |  // Pruning: pruning out 4-way partitions based on the number of horz/vert wins
 4211|       |  // in the current block and sub-blocks in PARTITION_SPLIT.
 4212|   269k|  prune_4_partition_using_split_info(cpi, x, part_search_state,
 4213|   269k|                                     part4_search_allowed);
 4214|       |
 4215|   269k|  if (cpi->sf.part_sf.prune_h_or_v_4part_using_sms_info && partition4_allowed &&
  ------------------
  |  Branch (4215:7): [True: 269k, False: 18.4E]
  |  Branch (4215:60): [True: 0, False: 269k]
  ------------------
 4216|      0|      best_rdc->rdcost != INT64_MAX &&
  ------------------
  |  Branch (4216:7): [True: 0, False: 0]
  ------------------
 4217|      0|      av1_is_whole_blk_in_frame(&part_search_state->part_blk_params,
  ------------------
  |  Branch (4217:7): [True: 0, False: 0]
  ------------------
 4218|      0|                                &cpi->common.mi_params) &&
 4219|      0|      !frame_is_intra_only(&cpi->common)) {
  ------------------
  |  Branch (4219:7): [True: 0, False: 0]
  ------------------
 4220|      0|    prune_part4_using_sms(cpi, x, part_search_state, sms_tree, mi_row, mi_col,
 4221|      0|                          bsize, part4_search_allowed);
 4222|      0|  }
 4223|   269k|}
partition_search.c:prune_4_partition_using_split_info:
 4035|   269k|    int part4_search_allowed[NUM_PART4_TYPES]) {
 4036|   269k|  PART4_TYPES cur_part[NUM_PART4_TYPES] = { HORZ4, VERT4 };
 4037|       |  // Count of child blocks in which HORZ or VERT partition has won
 4038|   269k|  int num_child_rect_win[NUM_RECT_PARTS] = { 0, 0 };
 4039|       |  // Prune HORZ4/VERT4 partitions based on number of HORZ/VERT winners of
 4040|       |  // split partiitons.
 4041|       |  // Conservative pruning for high quantizers.
 4042|   269k|  const int num_win_thresh = AOMMIN(3 * (MAXQ - x->qindex) / MAXQ + 1, 3);
  ------------------
  |  |   34|   269k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 188k, False: 80.7k]
  |  |  ------------------
  ------------------
 4043|       |
 4044|   809k|  for (RECT_PART_TYPE i = HORZ; i < NUM_RECT_PARTS; i++) {
  ------------------
  |  Branch (4044:33): [True: 539k, False: 269k]
  ------------------
 4045|   539k|    if (!(cpi->sf.part_sf.prune_ext_part_using_split_info &&
  ------------------
  |  Branch (4045:11): [True: 539k, False: 18.4E]
  ------------------
 4046|   539k|          part4_search_allowed[cur_part[i]]))
  ------------------
  |  Branch (4046:11): [True: 0, False: 539k]
  ------------------
 4047|   539k|      continue;
 4048|       |    // Loop over split partitions.
 4049|       |    // Get rectangular partitions winner info of split partitions.
 4050|  18.4E|    for (int idx = 0; idx < SUB_PARTITIONS_SPLIT; idx++)
  ------------------
  |  |   49|  18.4E|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (4050:23): [True: 0, False: 18.4E]
  ------------------
 4051|      0|      num_child_rect_win[i] +=
 4052|      0|          (part_search_state->split_part_rect_win[idx].rect_part_win[i]) ? 1
  ------------------
  |  Branch (4052:11): [True: 0, False: 0]
  ------------------
 4053|      0|                                                                         : 0;
 4054|  18.4E|    if (num_child_rect_win[i] < num_win_thresh) {
  ------------------
  |  Branch (4054:9): [True: 0, False: 18.4E]
  ------------------
 4055|      0|      part4_search_allowed[cur_part[i]] = 0;
 4056|      0|    }
 4057|  18.4E|  }
 4058|   269k|}
partition_search.c:should_do_dry_run_encode_for_current_block:
 5569|  2.49M|    BLOCK_SIZE bsize) {
 5570|  2.49M|  if (bsize > max_partition_size) return false;
  ------------------
  |  Branch (5570:7): [True: 0, False: 2.49M]
  ------------------
 5571|       |
 5572|       |  // Enable the reconstruction with dry-run for the 4th sub-block only if its
 5573|       |  // parent block's reconstruction with dry-run is skipped. If
 5574|       |  // max_partition_size is the same as immediate split of superblock, then avoid
 5575|       |  // reconstruction of the 4th sub-block, as this data is not consumed.
 5576|  2.49M|  if (curr_block_index != 3) return true;
  ------------------
  |  Branch (5576:7): [True: 2.08M, False: 412k]
  ------------------
 5577|       |
 5578|   412k|  const BLOCK_SIZE sub_sb_size =
 5579|   412k|      get_partition_subsize(sb_size, PARTITION_SPLIT);
 5580|   412k|  return bsize == max_partition_size && sub_sb_size != max_partition_size;
  ------------------
  |  Branch (5580:10): [True: 0, False: 412k]
  |  Branch (5580:41): [True: 0, False: 0]
  ------------------
 5581|  2.49M|}

encodeframe.c:set_cb_offsets:
   65|  49.0k|                                  const uint16_t cb_offset_uv) {
   66|  49.0k|  cb_offset[PLANE_TYPE_Y] = cb_offset_y;
   67|  49.0k|  cb_offset[PLANE_TYPE_UV] = cb_offset_uv;
   68|  49.0k|}
partition_search.c:update_cb_offsets:
   72|  2.04M|                                     const int subsampling_y) {
   73|  2.04M|  x->cb_offset[PLANE_TYPE_Y] += block_size_wide[bsize] * block_size_high[bsize];
   74|  2.04M|  if (x->e_mbd.is_chroma_ref) {
  ------------------
  |  Branch (74:7): [True: 2.02M, False: 20.9k]
  ------------------
   75|  2.02M|    const BLOCK_SIZE plane_bsize =
   76|  2.02M|        get_plane_block_size(bsize, subsampling_x, subsampling_y);
   77|       |    assert(plane_bsize != BLOCK_INVALID);
   78|  2.02M|    x->cb_offset[PLANE_TYPE_UV] +=
   79|  2.02M|        block_size_wide[plane_bsize] * block_size_high[plane_bsize];
   80|  2.02M|  }
   81|  2.04M|}
partition_search.c:set_cb_offsets:
   65|  2.13M|                                  const uint16_t cb_offset_uv) {
   66|  2.13M|  cb_offset[PLANE_TYPE_Y] = cb_offset_y;
   67|  2.13M|  cb_offset[PLANE_TYPE_UV] = cb_offset_uv;
   68|  2.13M|}

av1_simple_motion_search_early_term_none:
  741|  48.6k|    const RD_STATS *none_rdc, PartitionSearchState *part_state) {
  742|  48.6k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
  743|  48.6k|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
  744|  48.6k|  const BLOCK_SIZE bsize = blk_params->bsize;
  745|       |
  746|  48.6k|  float features[FEATURE_SIZE_SMS_TERM_NONE] = { 0.0f };
  747|  48.6k|  simple_motion_search_prune_part_features(cpi, x, sms_tree, mi_row, mi_col,
  748|  48.6k|                                           bsize, features,
  749|  48.6k|                                           FEATURE_SMS_PRUNE_PART_FLAG);
  ------------------
  |  |   41|  48.6k|  (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   36|  48.6k|#define FEATURE_SMS_NONE_FLAG 1
  |  |  ------------------
  |  |                 (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   37|  48.6k|#define FEATURE_SMS_SPLIT_FLAG (1 << 1)
  |  |  ------------------
  |  |                 (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   38|  48.6k|#define FEATURE_SMS_RECT_FLAG (1 << 2)
  |  |  ------------------
  ------------------
  750|  48.6k|  int f_idx = FEATURE_SIZE_SMS_PRUNE_PART;
  ------------------
  |  |   30|  48.6k|#define FEATURE_SIZE_SMS_PRUNE_PART 25
  ------------------
  751|       |
  752|  48.6k|  features[f_idx++] = log1pf((float)none_rdc->rate);
  753|  48.6k|  features[f_idx++] = log1pf((float)none_rdc->dist);
  754|  48.6k|  features[f_idx++] = log1pf((float)none_rdc->rdcost);
  755|       |
  756|  48.6k|  assert(f_idx == FEATURE_SIZE_SMS_TERM_NONE);
  757|       |
  758|  48.6k|  const float *ml_mean = NULL;
  759|  48.6k|  const float *ml_std = NULL;
  760|  48.6k|  const float *ml_model = NULL;
  761|       |
  762|  48.6k|  if (bsize == BLOCK_128X128) {
  ------------------
  |  Branch (762:7): [True: 0, False: 48.6k]
  ------------------
  763|      0|    ml_mean = av1_simple_motion_search_term_none_mean_128;
  764|      0|    ml_std = av1_simple_motion_search_term_none_std_128;
  765|      0|    ml_model = av1_simple_motion_search_term_none_model_128;
  766|  48.6k|  } else if (bsize == BLOCK_64X64) {
  ------------------
  |  Branch (766:14): [True: 7.04k, False: 41.6k]
  ------------------
  767|  7.04k|    ml_mean = av1_simple_motion_search_term_none_mean_64;
  768|  7.04k|    ml_std = av1_simple_motion_search_term_none_std_64;
  769|  7.04k|    ml_model = av1_simple_motion_search_term_none_model_64;
  770|  41.6k|  } else if (bsize == BLOCK_32X32) {
  ------------------
  |  Branch (770:14): [True: 11.3k, False: 30.2k]
  ------------------
  771|  11.3k|    ml_mean = av1_simple_motion_search_term_none_mean_32;
  772|  11.3k|    ml_std = av1_simple_motion_search_term_none_std_32;
  773|  11.3k|    ml_model = av1_simple_motion_search_term_none_model_32;
  774|  30.3k|  } else if (bsize == BLOCK_16X16) {
  ------------------
  |  Branch (774:14): [True: 30.3k, False: 18.4E]
  ------------------
  775|  30.3k|    ml_mean = av1_simple_motion_search_term_none_mean_16;
  776|  30.3k|    ml_std = av1_simple_motion_search_term_none_std_16;
  777|  30.3k|    ml_model = av1_simple_motion_search_term_none_model_16;
  778|  18.4E|  } else {
  779|  18.4E|    assert(0 && "Unexpected block size in simple_motion_term_none");
  780|  18.4E|  }
  781|       |
  782|       |  // Write features to file
  783|  48.6k|  write_features_to_file(cpi->oxcf.partition_info_path,
  784|  48.6k|                         cpi->ext_part_controller.test_mode, features,
  785|  48.6k|                         FEATURE_SIZE_SMS_TERM_NONE, 3, bsize, mi_row, mi_col);
  ------------------
  |  |   31|  48.6k|#define FEATURE_SIZE_SMS_TERM_NONE 28
  ------------------
  786|       |
  787|  48.6k|  if (ext_ml_model_decision_after_none_part2(
  ------------------
  |  Branch (787:7): [True: 0, False: 48.6k]
  ------------------
  788|  48.6k|          cpi, features, &part_state->terminate_partition_search)) {
  789|      0|    return;
  790|      0|  }
  791|       |
  792|  48.6k|  if (ml_model) {
  ------------------
  |  Branch (792:7): [True: 48.6k, False: 5]
  ------------------
  793|  48.6k|    float score = 0.0f;
  794|  1.41M|    for (f_idx = 0; f_idx < FEATURE_SIZE_SMS_TERM_NONE; f_idx++) {
  ------------------
  |  |   31|  1.41M|#define FEATURE_SIZE_SMS_TERM_NONE 28
  ------------------
  |  Branch (794:21): [True: 1.36M, False: 48.6k]
  ------------------
  795|  1.36M|      score +=
  796|  1.36M|          ml_model[f_idx] * (features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx];
  797|  1.36M|    }
  798|  48.6k|    score += ml_model[FEATURE_SIZE_SMS_TERM_NONE];
  ------------------
  |  |   31|  48.6k|#define FEATURE_SIZE_SMS_TERM_NONE 28
  ------------------
  799|       |
  800|  48.6k|    if (score >= 0.0f) {
  ------------------
  |  Branch (800:9): [True: 877, False: 47.7k]
  ------------------
  801|    877|      part_state->terminate_partition_search = 1;
  802|    877|    }
  803|  48.6k|  }
  804|  48.6k|}
av1_ml_prune_rect_partition:
 1127|  80.5k|                                 PartitionSearchState *part_state) {
 1128|  80.5k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
 1129|  80.5k|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
 1130|  80.5k|  const BLOCK_SIZE bsize = blk_params->bsize;
 1131|       |
 1132|  80.5k|  if (bsize < BLOCK_8X8 || best_rd >= 1000000000) return;
  ------------------
  |  Branch (1132:7): [True: 18.4E, False: 80.5k]
  |  Branch (1132:28): [True: 14.8k, False: 65.7k]
  ------------------
 1133|  65.7k|  best_rd = AOMMAX(best_rd, 1);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 65.7k, False: 18.4E]
  |  |  ------------------
  ------------------
 1134|  65.7k|  const NN_CONFIG *nn_config = NULL;
 1135|  65.7k|  const float prob_thresholds[5] = { 0.01f, 0.01f, 0.004f, 0.002f, 0.002f };
 1136|  65.7k|  float cur_thresh = 0.0f;
 1137|  65.7k|  switch (bsize) {
 1138|  65.3k|    case BLOCK_8X8:
  ------------------
  |  Branch (1138:5): [True: 65.3k, False: 309]
  ------------------
 1139|  65.3k|      nn_config = &av1_rect_partition_nnconfig_8;
 1140|  65.3k|      cur_thresh = prob_thresholds[0];
 1141|  65.3k|      break;
 1142|    311|    case BLOCK_16X16:
  ------------------
  |  Branch (1142:5): [True: 311, False: 65.3k]
  ------------------
 1143|    311|      nn_config = &av1_rect_partition_nnconfig_16;
 1144|    311|      cur_thresh = prob_thresholds[1];
 1145|    311|      break;
 1146|      0|    case BLOCK_32X32:
  ------------------
  |  Branch (1146:5): [True: 0, False: 65.7k]
  ------------------
 1147|      0|      nn_config = &av1_rect_partition_nnconfig_32;
 1148|      0|      cur_thresh = prob_thresholds[2];
 1149|      0|      break;
 1150|      0|    case BLOCK_64X64:
  ------------------
  |  Branch (1150:5): [True: 0, False: 65.7k]
  ------------------
 1151|      0|      nn_config = &av1_rect_partition_nnconfig_64;
 1152|      0|      cur_thresh = prob_thresholds[3];
 1153|      0|      break;
 1154|      0|    case BLOCK_128X128:
  ------------------
  |  Branch (1154:5): [True: 0, False: 65.7k]
  ------------------
 1155|      0|      nn_config = &av1_rect_partition_nnconfig_128;
 1156|      0|      cur_thresh = prob_thresholds[4];
 1157|      0|      break;
 1158|      0|    default: assert(0 && "Unexpected bsize.");
  ------------------
  |  Branch (1158:5): [True: 0, False: 65.7k]
  ------------------
 1159|  65.7k|  }
 1160|  65.7k|  if (!nn_config) return;
  ------------------
  |  Branch (1160:7): [True: 0, False: 65.7k]
  ------------------
 1161|       |
 1162|       |  // 1. Compute input features
 1163|  65.7k|  float features[9];
 1164|       |
 1165|       |  // RD cost ratios
 1166|   394k|  for (int i = 0; i < 5; i++) features[i] = 1.0f;
  ------------------
  |  Branch (1166:19): [True: 328k, False: 65.7k]
  ------------------
 1167|  65.7k|  if (none_rd > 0 && none_rd < 1000000000)
  ------------------
  |  Branch (1167:7): [True: 65.6k, False: 13]
  |  Branch (1167:22): [True: 65.6k, False: 50]
  ------------------
 1168|  65.6k|    features[0] = (float)none_rd / (float)best_rd;
 1169|   328k|  for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++) {
  ------------------
  |  |   49|   328k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (1169:19): [True: 262k, False: 65.7k]
  ------------------
 1170|   262k|    if (split_rd[i] > 0 && split_rd[i] < 1000000000)
  ------------------
  |  Branch (1170:9): [True: 235k, False: 27.8k]
  |  Branch (1170:28): [True: 182k, False: 52.2k]
  ------------------
 1171|   182k|      features[1 + i] = (float)split_rd[i] / (float)best_rd;
 1172|   262k|  }
 1173|       |
 1174|       |  // Variance ratios
 1175|  65.7k|  const MACROBLOCKD *const xd = &x->e_mbd;
 1176|  65.7k|  int whole_block_variance;
 1177|  65.7k|  whole_block_variance = av1_get_perpixel_variance_facade(
 1178|  65.7k|      cpi, xd, &x->plane[0].src, bsize, AOM_PLANE_Y);
  ------------------
  |  |  281|  65.7k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1179|  65.7k|  whole_block_variance = AOMMAX(whole_block_variance, 1);
  ------------------
  |  |   35|  65.7k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 65.4k, False: 302]
  |  |  ------------------
  ------------------
 1180|       |
 1181|  65.7k|  int split_variance[SUB_PARTITIONS_SPLIT];
 1182|  65.7k|  const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
 1183|  65.7k|  struct buf_2d buf;
 1184|  65.7k|  buf.stride = x->plane[0].src.stride;
 1185|  65.7k|  const int bw = block_size_wide[bsize];
 1186|   328k|  for (int i = 0; i < SUB_PARTITIONS_SPLIT; ++i) {
  ------------------
  |  |   49|   328k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (1186:19): [True: 262k, False: 65.7k]
  ------------------
 1187|   262k|    const int x_idx = (i & 1) * bw / 2;
 1188|   262k|    const int y_idx = (i >> 1) * bw / 2;
 1189|   262k|    buf.buf = x->plane[0].src.buf + x_idx + y_idx * buf.stride;
 1190|   262k|    split_variance[i] =
 1191|   262k|        av1_get_perpixel_variance_facade(cpi, xd, &buf, subsize, AOM_PLANE_Y);
  ------------------
  |  |  281|   262k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1192|   262k|  }
 1193|       |
 1194|   328k|  for (int i = 0; i < SUB_PARTITIONS_SPLIT; i++)
  ------------------
  |  |   49|   328k|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (1194:19): [True: 262k, False: 65.7k]
  ------------------
 1195|   262k|    features[5 + i] = (float)split_variance[i] / (float)whole_block_variance;
 1196|       |
 1197|       |  // Write features to file
 1198|  65.7k|  write_features_to_file(cpi->oxcf.partition_info_path,
 1199|  65.7k|                         cpi->ext_part_controller.test_mode, features,
 1200|  65.7k|                         /*feature_size=*/9, 5, bsize, mi_row, mi_col);
 1201|       |
 1202|  65.7k|  if (ext_ml_model_decision_after_split_part2(
  ------------------
  |  Branch (1202:7): [True: 0, False: 65.7k]
  ------------------
 1203|  65.7k|          &cpi->ext_part_controller, frame_is_intra_only(&cpi->common),
 1204|  65.7k|          features, &part_state->prune_rect_part[HORZ],
 1205|  65.7k|          &part_state->prune_rect_part[VERT])) {
 1206|      0|    return;
 1207|      0|  }
 1208|       |
 1209|       |  // 2. Do the prediction and prune 0-2 partitions based on their probabilities
 1210|  65.7k|  float raw_scores[3] = { 0.0f };
 1211|  65.7k|  av1_nn_predict(features, nn_config, 1, raw_scores);
 1212|  65.7k|  float probs[3] = { 0.0f };
 1213|  65.7k|  av1_nn_softmax(raw_scores, probs, 3);
 1214|       |
 1215|       |  // probs[0] is the probability of the fact that both rectangular partitions
 1216|       |  // are worse than current best_rd
 1217|  65.7k|  if (probs[1] <= cur_thresh) part_state->prune_rect_part[HORZ] = 1;
  ------------------
  |  Branch (1217:7): [True: 15.8k, False: 49.8k]
  ------------------
 1218|  65.7k|  if (probs[2] <= cur_thresh) part_state->prune_rect_part[VERT] = 1;
  ------------------
  |  Branch (1218:7): [True: 13.7k, False: 51.9k]
  ------------------
 1219|  65.7k|}
av1_ml_predict_breakout:
 1532|  2.04k|                             PartitionSearchState *part_state) {
 1533|  2.04k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
 1534|  2.04k|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
 1535|  2.04k|  const BLOCK_SIZE bsize = blk_params->bsize;
 1536|       |
 1537|  2.04k|  const int bsize_idx = convert_bsize_to_idx(bsize);
 1538|  2.04k|  if (bsize_idx < 0) return;
  ------------------
  |  Branch (1538:7): [True: 0, False: 2.04k]
  ------------------
 1539|  2.04k|  const float *ml_mean = av1_hd_partition_breakout_nn_mean[bsize_idx];
 1540|  2.04k|  const float *ml_std = av1_hd_partition_breakout_nn_std[bsize_idx];
 1541|       |
 1542|  2.04k|  const NN_CONFIG *nn_config = NULL;
 1543|  2.04k|  float thresh = 0;
 1544|  2.04k|  switch (bsize) {
 1545|    172|    case BLOCK_8X8:
  ------------------
  |  Branch (1545:5): [True: 172, False: 1.87k]
  ------------------
 1546|    172|      nn_config =
 1547|    172|          &av1_partition_breakout_nnconfig_8
 1548|    172|              [cpi->sf.part_sf.ml_partition_search_breakout_model_index];
 1549|    172|      thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[bsize_idx];
 1550|    172|      break;
 1551|  1.87k|    case BLOCK_16X16:
  ------------------
  |  Branch (1551:5): [True: 1.87k, False: 172]
  ------------------
 1552|  1.87k|      nn_config =
 1553|  1.87k|          &av1_partition_breakout_nnconfig_16
 1554|  1.87k|              [cpi->sf.part_sf.ml_partition_search_breakout_model_index];
 1555|  1.87k|      thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[bsize_idx];
 1556|  1.87k|      break;
 1557|      0|    case BLOCK_32X32:
  ------------------
  |  Branch (1557:5): [True: 0, False: 2.04k]
  ------------------
 1558|      0|      nn_config =
 1559|      0|          &av1_partition_breakout_nnconfig_32
 1560|      0|              [cpi->sf.part_sf.ml_partition_search_breakout_model_index];
 1561|      0|      thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[bsize_idx];
 1562|      0|      break;
 1563|      0|    case BLOCK_64X64:
  ------------------
  |  Branch (1563:5): [True: 0, False: 2.04k]
  ------------------
 1564|      0|      nn_config =
 1565|      0|          &av1_partition_breakout_nnconfig_64
 1566|      0|              [cpi->sf.part_sf.ml_partition_search_breakout_model_index];
 1567|      0|      thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[bsize_idx];
 1568|      0|      break;
 1569|      0|    case BLOCK_128X128:
  ------------------
  |  Branch (1569:5): [True: 0, False: 2.04k]
  ------------------
 1570|      0|      nn_config =
 1571|      0|          &av1_partition_breakout_nnconfig_128
 1572|      0|              [cpi->sf.part_sf.ml_partition_search_breakout_model_index];
 1573|      0|      thresh = cpi->sf.part_sf.ml_partition_search_breakout_thresh[bsize_idx];
 1574|      0|      break;
 1575|      0|    default: assert(0 && "Unexpected bsize.");
  ------------------
  |  Branch (1575:5): [True: 0, False: 2.04k]
  ------------------
 1576|  2.04k|  }
 1577|  2.04k|  if (!nn_config || thresh < 0) return;
  ------------------
  |  Branch (1577:7): [True: 0, False: 2.04k]
  |  Branch (1577:21): [True: 0, False: 2.04k]
  ------------------
 1578|       |
 1579|  2.04k|  const float ml_predict_breakout_thresh_scale[3] = { 1.15f, 1.05f, 1.0f };
 1580|  2.04k|  thresh = thresh * ml_predict_breakout_thresh_scale
 1581|  2.04k|                        [cpi->sf.part_sf.ml_predict_breakout_level - 1];
 1582|       |
 1583|       |  // Generate feature values.
 1584|  2.04k|  float features[FEATURES];
 1585|  2.04k|  int feature_index = 0;
 1586|       |
 1587|  2.04k|  const int num_pels_log2 = num_pels_log2_lookup[bsize];
 1588|  2.04k|  float rate_f = (float)AOMMIN(rd_stats->rate, INT_MAX);
  ------------------
  |  |   34|  2.04k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.04k, False: 0]
  |  |  ------------------
  ------------------
 1589|  2.04k|  rate_f = ((float)x->rdmult / 128.0f / 512.0f / (float)(1 << num_pels_log2)) *
 1590|  2.04k|           rate_f;
 1591|  2.04k|  features[feature_index++] =
 1592|  2.04k|      cpi->sf.part_sf.ml_partition_search_breakout_model_index
  ------------------
  |  Branch (1592:7): [True: 0, False: 2.04k]
  ------------------
 1593|  2.04k|          ? log1pf((float)rate_f)
 1594|  2.04k|          : rate_f;
 1595|       |
 1596|  2.04k|  const float dist_f =
 1597|  2.04k|      (float)(AOMMIN(rd_stats->dist, INT_MAX) >> num_pels_log2);
  ------------------
  |  |   34|  2.04k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.04k, False: 0]
  |  |  ------------------
  ------------------
 1598|  2.04k|  features[feature_index++] =
 1599|  2.04k|      cpi->sf.part_sf.ml_partition_search_breakout_model_index
  ------------------
  |  Branch (1599:7): [True: 0, False: 2.04k]
  ------------------
 1600|  2.04k|          ? log1pf((float)dist_f)
 1601|  2.04k|          : dist_f;
 1602|       |
 1603|  2.04k|  features[feature_index++] =
 1604|  2.04k|      cpi->sf.part_sf.ml_partition_search_breakout_model_index
  ------------------
  |  Branch (1604:7): [True: 0, False: 2.04k]
  ------------------
 1605|  2.04k|          ? log1pf((float)pb_source_variance)
 1606|  2.04k|          : (float)pb_source_variance;
 1607|       |
 1608|  2.04k|  const int dc_q = (int)x->plane[0].dequant_QTX[0] >> (bit_depth - 8);
 1609|  2.04k|  features[feature_index++] =
 1610|  2.04k|      cpi->sf.part_sf.ml_partition_search_breakout_model_index
  ------------------
  |  Branch (1610:7): [True: 0, False: 2.04k]
  ------------------
 1611|  2.04k|          ? log1pf((float)(dc_q * dc_q) / 256.0f)
 1612|  2.04k|          : (float)(dc_q * dc_q) / 256.0f;
 1613|       |
 1614|  2.04k|  assert(feature_index == FEATURES);
 1615|       |
 1616|  2.04k|  if (cpi->sf.part_sf.ml_partition_search_breakout_model_index) {
  ------------------
  |  Branch (1616:7): [True: 0, False: 2.04k]
  ------------------
 1617|      0|    for (int idx = 0; idx < FEATURES; idx++) {
  ------------------
  |  | 1528|      0|#define FEATURES 4
  ------------------
  |  Branch (1617:23): [True: 0, False: 0]
  ------------------
 1618|      0|      features[idx] = (features[idx] - ml_mean[idx]) / ml_std[idx];
 1619|      0|    }
 1620|      0|  }
 1621|       |
 1622|       |  // Write features to file
 1623|  2.04k|  write_features_to_file(cpi->oxcf.partition_info_path,
 1624|  2.04k|                         cpi->ext_part_controller.test_mode, features, FEATURES,
  ------------------
  |  | 1528|  2.04k|#define FEATURES 4
  ------------------
 1625|  2.04k|                         2, bsize, mi_row, mi_col);
 1626|       |
 1627|  2.04k|  if (ext_ml_model_decision_after_none(&cpi->ext_part_controller,
  ------------------
  |  Branch (1627:7): [True: 0, False: 2.04k]
  ------------------
 1628|  2.04k|                                       frame_is_intra_only(&cpi->common),
 1629|  2.04k|                                       features, &part_state->do_square_split,
 1630|  2.04k|                                       &part_state->do_rectangular_split)) {
 1631|      0|    return;
 1632|      0|  }
 1633|       |
 1634|       |  // Calculate score using the NN model.
 1635|  2.04k|  float score = 0.0f;
 1636|  2.04k|  av1_nn_predict(features, nn_config, 1, &score);
 1637|       |
 1638|  2.04k|  float thresh_score = (float)log(thresh / (1 - thresh));
 1639|       |
 1640|       |  // Make decision.
 1641|  2.04k|  if (score >= thresh_score) {
  ------------------
  |  Branch (1641:7): [True: 94, False: 1.95k]
  ------------------
 1642|     94|    part_state->do_square_split = 0;
 1643|     94|    part_state->do_rectangular_split = 0;
 1644|     94|  }
 1645|  2.04k|}
av1_prune_partitions_before_search:
 1651|  2.70M|                                        PartitionSearchState *part_state) {
 1652|  2.70M|  const AV1_COMMON *const cm = &cpi->common;
 1653|  2.70M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
 1654|       |
 1655|  2.70M|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
 1656|  2.70M|  const BLOCK_SIZE bsize = blk_params->bsize;
 1657|       |
 1658|       |#if CONFIG_THREE_PASS
 1659|       |  if (cpi->third_pass_ctx) {
 1660|       |    int mi_row = blk_params->mi_row;
 1661|       |    int mi_col = blk_params->mi_col;
 1662|       |    double ratio_h, ratio_w;
 1663|       |    av1_get_third_pass_ratio(cpi->third_pass_ctx, 0, cm->height, cm->width,
 1664|       |                             &ratio_h, &ratio_w);
 1665|       |    THIRD_PASS_MI_INFO *this_mi = av1_get_third_pass_mi(
 1666|       |        cpi->third_pass_ctx, 0, mi_row, mi_col, ratio_h, ratio_w);
 1667|       |    BLOCK_SIZE third_pass_bsize =
 1668|       |        av1_get_third_pass_adjusted_blk_size(this_mi, ratio_h, ratio_w);
 1669|       |    // check the actual partition of this block in the second pass
 1670|       |    PARTITION_TYPE third_pass_part =
 1671|       |        av1_third_pass_get_sb_part_type(cpi->third_pass_ctx, this_mi);
 1672|       |
 1673|       |    int is_edge = (mi_row + mi_size_high[bsize] >= cm->mi_params.mi_rows) ||
 1674|       |                  (mi_col + mi_size_wide[bsize] >= cm->mi_params.mi_cols);
 1675|       |
 1676|       |    if (!is_edge && block_size_wide[bsize] >= 16) {
 1677|       |      // If in second pass we used rectangular partition, then do not search for
 1678|       |      // rectangular partition in the different direction.
 1679|       |      if (third_pass_part != PARTITION_NONE) {
 1680|       |        if (third_pass_part == PARTITION_HORZ ||
 1681|       |            third_pass_part == PARTITION_HORZ_4 ||
 1682|       |            third_pass_part == PARTITION_HORZ_A ||
 1683|       |            third_pass_part == PARTITION_HORZ_B) {
 1684|       |          part_state->partition_rect_allowed[VERT] = 0;
 1685|       |        } else if (third_pass_part == PARTITION_VERT ||
 1686|       |                   third_pass_part == PARTITION_VERT_4 ||
 1687|       |                   third_pass_part == PARTITION_VERT_A ||
 1688|       |                   third_pass_part == PARTITION_VERT_B) {
 1689|       |          part_state->partition_rect_allowed[HORZ] = 0;
 1690|       |        }
 1691|       |      }
 1692|       |
 1693|       |      int minSize = AOMMIN(block_size_wide[third_pass_bsize],
 1694|       |                           block_size_high[third_pass_bsize]);
 1695|       |      int maxSize = AOMMAX(block_size_wide[third_pass_bsize],
 1696|       |                           block_size_high[third_pass_bsize]);
 1697|       |      if (block_size_wide[bsize] < minSize / 4) {
 1698|       |        // Current partition is too small, just terminate
 1699|       |        part_state->terminate_partition_search = 1;
 1700|       |        return;
 1701|       |      } else if (block_size_wide[bsize] < minSize / 2) {
 1702|       |        if (third_pass_part != PARTITION_NONE) {
 1703|       |          // Current partition is very small, and in second pass we used
 1704|       |          // rectangular partition. Terminate the search here then.
 1705|       |          part_state->terminate_partition_search = 1;
 1706|       |          return;
 1707|       |        } else {
 1708|       |          // Partition is small, but we still check this partition, only disable
 1709|       |          // further splits.
 1710|       |          // TODO(any): check why this is not covered by the termination for <
 1711|       |          // minSize/4.
 1712|       |          av1_disable_square_split_partition(part_state);
 1713|       |          av1_disable_rect_partitions(part_state);
 1714|       |          return;
 1715|       |        }
 1716|       |      } else if (block_size_wide[bsize] > maxSize) {
 1717|       |        // Partition is larger than in the second pass. Only allow split.
 1718|       |        av1_set_square_split_only(part_state);
 1719|       |        return;
 1720|       |      } else if (block_size_wide[bsize] >= minSize &&
 1721|       |                 block_size_wide[bsize] <= maxSize) {
 1722|       |        // Partition is within a range where it is very likely to find a good
 1723|       |        // choice, so do not prune anything.
 1724|       |        return;
 1725|       |      }
 1726|       |    }
 1727|       |  }
 1728|       |#endif  // CONFIG_THREE_PASS
 1729|       |
 1730|       |  // Prune rectangular partitions for larger blocks.
 1731|  2.70M|  if (bsize > cpi->sf.part_sf.rect_partition_eval_thresh) {
  ------------------
  |  Branch (1731:7): [True: 0, False: 2.70M]
  ------------------
 1732|      0|    part_state->do_rectangular_split = 0;
 1733|      0|    part_state->partition_rect_allowed[HORZ] = 0;
 1734|      0|    part_state->partition_rect_allowed[VERT] = 0;
 1735|      0|  }
 1736|       |
 1737|       |  // Prune rectangular, AB and 4-way partition based on q index and block size
 1738|  2.70M|  if (cpi->sf.part_sf.prune_rectangular_split_based_on_qidx == 1) {
  ------------------
  |  Branch (1738:7): [True: 0, False: 2.70M]
  ------------------
 1739|      0|    if (bsize == BLOCK_8X8 && x->qindex < 35)
  ------------------
  |  Branch (1739:9): [True: 0, False: 0]
  |  Branch (1739:31): [True: 0, False: 0]
  ------------------
 1740|      0|      av1_disable_rect_partitions(part_state);
 1741|       |
 1742|  2.70M|  } else if (cpi->sf.part_sf.prune_rectangular_split_based_on_qidx == 2) {
  ------------------
  |  Branch (1742:14): [True: 1.96M, False: 735k]
  ------------------
 1743|       |    // Enumeration difference between two square partitions
 1744|  1.96M|    const int sqr_bsize_step = BLOCK_32X32 - BLOCK_16X16;
 1745|  1.96M|    int max_bsize =
 1746|  1.96M|        BLOCK_32X32 - (x->qindex * 3 / QINDEX_RANGE) * sqr_bsize_step;
  ------------------
  |  |   27|  1.96M|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  1.96M|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  1.96M|#define MINQ 0
  |  |  ------------------
  ------------------
 1747|  1.96M|    max_bsize = AOMMAX(max_bsize, BLOCK_4X4);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.96M, False: 18.4E]
  |  |  ------------------
  ------------------
 1748|  1.96M|    const BLOCK_SIZE max_prune_bsize =
 1749|  1.96M|        (BLOCK_SIZE)AOMMIN(max_bsize, BLOCK_32X32);
  ------------------
  |  |   34|  1.96M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.41M, False: 553k]
  |  |  ------------------
  ------------------
 1750|       |
 1751|       |    // Prune partition
 1752|       |    // qidx 0 to 85: prune bsize below BLOCK_32X32
 1753|       |    // qidx 86 to 170: prune bsize below BLOCK_16X16
 1754|       |    // qidx 171 to 255: prune bsize below BLOCK_8X8
 1755|  1.96M|    if (bsize < max_prune_bsize) {
  ------------------
  |  Branch (1755:9): [True: 786k, False: 1.18M]
  ------------------
 1756|   786k|      av1_disable_rect_partitions(part_state);
 1757|   786k|    }
 1758|  1.96M|  }
 1759|       |
 1760|  2.70M|  if (cpi->sf.part_sf.prune_sub_8x8_partition_level && (bsize == BLOCK_8X8)) {
  ------------------
  |  Branch (1760:7): [True: 2.51M, False: 186k]
  |  Branch (1760:56): [True: 1.58M, False: 929k]
  ------------------
 1761|  1.58M|    const MACROBLOCKD *const xd = &x->e_mbd;
 1762|  1.58M|    int prune_sub_8x8;
 1763|  1.58M|    if (cpi->sf.part_sf.prune_sub_8x8_partition_level == 2) {
  ------------------
  |  Branch (1763:9): [True: 1.53M, False: 55.4k]
  ------------------
 1764|  1.53M|      prune_sub_8x8 = 1;
 1765|  1.53M|    } else {
 1766|  55.4k|      assert(cpi->sf.part_sf.prune_sub_8x8_partition_level == 1);
 1767|       |      // Prune if both neighbors are available and either is > BLOCK_8X8
 1768|  55.4k|      prune_sub_8x8 = xd->left_available && xd->up_available &&
  ------------------
  |  Branch (1768:23): [True: 35.6k, False: 19.8k]
  |  Branch (1768:45): [True: 20.1k, False: 15.4k]
  ------------------
 1769|  20.1k|                      (xd->left_mbmi->bsize > BLOCK_8X8 ||
  ------------------
  |  Branch (1769:24): [True: 998, False: 19.1k]
  ------------------
 1770|  19.1k|                       xd->above_mbmi->bsize > BLOCK_8X8);
  ------------------
  |  Branch (1770:24): [True: 599, False: 18.5k]
  ------------------
 1771|  55.4k|    }
 1772|  1.58M|    if (prune_sub_8x8) {
  ------------------
  |  Branch (1772:9): [True: 1.53M, False: 53.8k]
  ------------------
 1773|  1.53M|      av1_disable_all_splits(part_state);
 1774|  1.53M|    }
 1775|  1.58M|  }
 1776|       |
 1777|       |  // A CNN-based speed feature pruning out either split or all non-split
 1778|       |  // partition in INTRA frame coding.
 1779|  2.70M|  const int try_intra_cnn_based_part_prune =
 1780|  2.70M|      frame_is_intra_only(cm) &&
  ------------------
  |  Branch (1780:7): [True: 317k, False: 2.38M]
  ------------------
 1781|   317k|      cpi->sf.part_sf.intra_cnn_based_part_prune_level &&
  ------------------
  |  Branch (1781:7): [True: 263k, False: 53.3k]
  ------------------
 1782|   263k|      cm->seq_params->sb_size >= BLOCK_64X64 && bsize <= BLOCK_64X64 &&
  ------------------
  |  Branch (1782:7): [True: 263k, False: 18.4E]
  |  Branch (1782:49): [True: 263k, False: 18.4E]
  ------------------
 1783|   263k|      blk_params->bsize_at_least_8x8 &&
  ------------------
  |  Branch (1783:7): [True: 263k, False: 15]
  ------------------
 1784|   263k|      av1_is_whole_blk_in_frame(blk_params, mi_params);
  ------------------
  |  Branch (1784:7): [True: 208k, False: 55.6k]
  ------------------
 1785|       |
 1786|  2.70M|  if (try_intra_cnn_based_part_prune) {
  ------------------
  |  Branch (1786:7): [True: 208k, False: 2.49M]
  ------------------
 1787|   208k|    assert(x->e_mbd.error_info->setjmp);
 1788|   208k|    intra_mode_cnn_partition(&cpi->common, x, x->part_search_info.quad_tree_idx,
 1789|   208k|                             cpi->sf.part_sf.intra_cnn_based_part_prune_level,
 1790|   208k|                             part_state);
 1791|   208k|  }
 1792|       |
 1793|       |  // Use simple motion search to prune out split or non-split partitions. This
 1794|       |  // must be done prior to PARTITION_SPLIT to propagate the initial mvs to a
 1795|       |  // smaller blocksize.
 1796|  2.70M|  const int try_split_only =
 1797|  2.70M|      cpi->sf.part_sf.simple_motion_search_split &&
  ------------------
  |  Branch (1797:7): [True: 2.70M, False: 18.4E]
  ------------------
 1798|  2.70M|      part_state->do_square_split && blk_params->bsize_at_least_8x8 &&
  ------------------
  |  Branch (1798:7): [True: 849k, False: 1.85M]
  |  Branch (1798:38): [True: 849k, False: 18.4E]
  ------------------
 1799|   849k|      av1_is_whole_blk_in_frame(blk_params, mi_params) &&
  ------------------
  |  Branch (1799:7): [True: 523k, False: 325k]
  ------------------
 1800|   523k|      !frame_is_intra_only(cm) && !av1_superres_scaled(cm);
  ------------------
  |  Branch (1800:7): [True: 475k, False: 48.4k]
  |  Branch (1800:35): [True: 475k, False: 12]
  ------------------
 1801|       |
 1802|  2.70M|  if (try_split_only) {
  ------------------
  |  Branch (1802:7): [True: 475k, False: 2.22M]
  ------------------
 1803|   475k|    simple_motion_search_based_split(cpi, x, sms_tree, part_state);
 1804|   475k|  }
 1805|       |
 1806|       |  // Use simple motion search to prune out rectangular partition in some
 1807|       |  // direction. The results are stored in prune_horz and prune_vert in order to
 1808|       |  // bypass future related pruning checks if a pruning decision has been made.
 1809|       |
 1810|       |  // We want to search at least one partition mode, so don't prune if NONE and
 1811|       |  // SPLIT are disabled.
 1812|  2.70M|  const int non_rect_part_allowed =
 1813|  2.70M|      part_state->do_square_split || part_state->partition_none_allowed;
  ------------------
  |  Branch (1813:7): [True: 837k, False: 1.86M]
  |  Branch (1813:38): [True: 1.86M, False: 0]
  ------------------
 1814|       |  // Only run the model if the partitions are not already pruned.
 1815|  2.70M|  const int rect_part_allowed = part_state->do_rectangular_split &&
  ------------------
  |  Branch (1815:33): [True: 455k, False: 2.24M]
  ------------------
 1816|   455k|                                ((part_state->partition_rect_allowed[HORZ] &&
  ------------------
  |  Branch (1816:35): [True: 249k, False: 206k]
  ------------------
 1817|   249k|                                  !part_state->prune_rect_part[HORZ]) ||
  ------------------
  |  Branch (1817:35): [True: 249k, False: 18.4E]
  ------------------
 1818|   206k|                                 (part_state->partition_rect_allowed[VERT] &&
  ------------------
  |  Branch (1818:35): [True: 91.0k, False: 115k]
  ------------------
 1819|  91.0k|                                  !part_state->prune_rect_part[VERT]));
  ------------------
  |  Branch (1819:35): [True: 91.0k, False: 18.4E]
  ------------------
 1820|       |
 1821|  2.70M|  const int try_prune_rect = cpi->sf.part_sf.simple_motion_search_prune_rect &&
  ------------------
  |  Branch (1821:30): [True: 2.70M, False: 18.4E]
  ------------------
 1822|  2.70M|                             !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (1822:30): [True: 2.38M, False: 317k]
  ------------------
 1823|  2.38M|                             non_rect_part_allowed && rect_part_allowed &&
  ------------------
  |  Branch (1823:30): [True: 2.38M, False: 18.4E]
  |  Branch (1823:55): [True: 261k, False: 2.12M]
  ------------------
 1824|   261k|                             !av1_superres_scaled(cm);
  ------------------
  |  Branch (1824:30): [True: 261k, False: 6]
  ------------------
 1825|       |
 1826|  2.70M|  if (try_prune_rect) {
  ------------------
  |  Branch (1826:7): [True: 261k, False: 2.44M]
  ------------------
 1827|   261k|    simple_motion_search_prune_rect(cpi, x, sms_tree, part_state);
 1828|   261k|  }
 1829|  2.70M|}
av1_prune_partitions_by_max_min_bsize:
 1838|  2.70M|                                           PartitionSearchState *part_state) {
 1839|  2.70M|  assert(is_bsize_square(sb_enc->max_partition_size));
 1840|  2.70M|  assert(is_bsize_square(sb_enc->min_partition_size));
 1841|  2.70M|  assert(sb_enc->min_partition_size <= sb_enc->max_partition_size);
 1842|  2.70M|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
 1843|  2.70M|  const BLOCK_SIZE bsize = blk_params->bsize;
 1844|  2.70M|  assert(is_bsize_square(bsize));
 1845|  2.70M|  const int max_partition_size_1d = block_size_wide[sb_enc->max_partition_size];
 1846|  2.70M|  const int min_partition_size_1d = block_size_wide[sb_enc->min_partition_size];
 1847|  2.70M|  const int bsize_1d = block_size_wide[bsize];
 1848|  2.70M|  assert(min_partition_size_1d <= max_partition_size_1d);
 1849|  2.70M|  const int is_le_min_sq_part = bsize_1d <= min_partition_size_1d;
 1850|  2.70M|  const int is_gt_max_sq_part = bsize_1d > max_partition_size_1d;
 1851|  2.70M|  if (is_gt_max_sq_part) {
  ------------------
  |  Branch (1851:7): [True: 0, False: 2.70M]
  ------------------
 1852|       |    // If current block size is larger than max, only allow split.
 1853|      0|    av1_set_square_split_only(part_state);
 1854|  2.70M|  } else if (is_le_min_sq_part) {
  ------------------
  |  Branch (1854:14): [True: 320k, False: 2.38M]
  ------------------
 1855|       |    // If current block size is less or equal to min, only allow none if valid
 1856|       |    // block large enough; only allow split otherwise.
 1857|   320k|    av1_disable_rect_partitions(part_state);
 1858|       |
 1859|       |    // only disable square split when current block is not at the picture
 1860|       |    // boundary. otherwise, inherit the square split flag from previous logic
 1861|   320k|    if (av1_blk_has_rows_and_cols(blk_params)) {
  ------------------
  |  Branch (1861:9): [True: 320k, False: 18.4E]
  ------------------
 1862|   320k|      part_state->do_square_split = 0;
 1863|   320k|    }
 1864|   320k|    part_state->partition_none_allowed = !(part_state->do_square_split);
 1865|   320k|  }
 1866|  2.70M|}
av1_prune_ab_partitions:
 1907|  2.59M|                             int *ab_partitions_allowed) {
 1908|  2.59M|  int64_t *horz_rd = part_state->rect_part_rd[HORZ];
 1909|  2.59M|  int64_t *vert_rd = part_state->rect_part_rd[VERT];
 1910|  2.59M|  int64_t *split_rd = part_state->split_rd;
 1911|  2.59M|  const PartitionCfg *const part_cfg = &cpi->oxcf.part_cfg;
 1912|       |  // The standard AB partitions are allowed initially if ext-partition-types are
 1913|       |  // allowed.
 1914|  2.59M|  int horzab_partition_allowed = ext_partition_allowed &&
  ------------------
  |  Branch (1914:34): [True: 0, False: 2.59M]
  ------------------
 1915|      0|                                 part_cfg->enable_ab_partitions &&
  ------------------
  |  Branch (1915:34): [True: 0, False: 0]
  ------------------
 1916|      0|                                 part_state->partition_rect_allowed[HORZ];
  ------------------
  |  Branch (1916:34): [True: 0, False: 0]
  ------------------
 1917|  2.59M|  int vertab_partition_allowed = ext_partition_allowed &&
  ------------------
  |  Branch (1917:34): [True: 0, False: 2.59M]
  ------------------
 1918|      0|                                 part_cfg->enable_ab_partitions &&
  ------------------
  |  Branch (1918:34): [True: 0, False: 0]
  ------------------
 1919|      0|                                 part_state->partition_rect_allowed[VERT];
  ------------------
  |  Branch (1919:34): [True: 0, False: 0]
  ------------------
 1920|       |
 1921|       |  // Pruning: pruning out AB partitions on one main direction based on the
 1922|       |  // current best partition and source variance.
 1923|  2.59M|  if (cpi->sf.part_sf.prune_ext_partition_types_search_level) {
  ------------------
  |  Branch (1923:7): [True: 2.59M, False: 18.4E]
  ------------------
 1924|  2.59M|    if (cpi->sf.part_sf.prune_ext_partition_types_search_level == 1) {
  ------------------
  |  Branch (1924:9): [True: 2.59M, False: 18.4E]
  ------------------
 1925|       |      // TODO(debargha,huisu@google.com): may need to tune the threshold for
 1926|       |      // pb_source_variance.
 1927|  2.59M|      horzab_partition_allowed &= (pc_tree->partitioning == PARTITION_HORZ ||
  ------------------
  |  Branch (1927:36): [True: 15.4k, False: 2.57M]
  ------------------
 1928|  2.57M|                                   (pc_tree->partitioning == PARTITION_NONE &&
  ------------------
  |  Branch (1928:37): [True: 1.87M, False: 703k]
  ------------------
 1929|  1.87M|                                    pb_source_variance < 32) ||
  ------------------
  |  Branch (1929:37): [True: 8.17k, False: 1.86M]
  ------------------
 1930|  2.56M|                                   pc_tree->partitioning == PARTITION_SPLIT);
  ------------------
  |  Branch (1930:36): [True: 683k, False: 1.88M]
  ------------------
 1931|  2.59M|      vertab_partition_allowed &= (pc_tree->partitioning == PARTITION_VERT ||
  ------------------
  |  Branch (1931:36): [True: 20.2k, False: 2.57M]
  ------------------
 1932|  2.57M|                                   (pc_tree->partitioning == PARTITION_NONE &&
  ------------------
  |  Branch (1932:37): [True: 1.87M, False: 698k]
  ------------------
 1933|  1.87M|                                    pb_source_variance < 32) ||
  ------------------
  |  Branch (1933:37): [True: 8.17k, False: 1.86M]
  ------------------
 1934|  2.56M|                                   pc_tree->partitioning == PARTITION_SPLIT);
  ------------------
  |  Branch (1934:36): [True: 683k, False: 1.87M]
  ------------------
 1935|  18.4E|    } else {
 1936|  18.4E|      horzab_partition_allowed &= (pc_tree->partitioning == PARTITION_HORZ ||
  ------------------
  |  Branch (1936:36): [True: 18.4E, False: 0]
  ------------------
 1937|      0|                                   pc_tree->partitioning == PARTITION_SPLIT);
  ------------------
  |  Branch (1937:36): [True: 0, False: 0]
  ------------------
 1938|  18.4E|      vertab_partition_allowed &= (pc_tree->partitioning == PARTITION_VERT ||
  ------------------
  |  Branch (1938:36): [True: 18.4E, False: 0]
  ------------------
 1939|      0|                                   pc_tree->partitioning == PARTITION_SPLIT);
  ------------------
  |  Branch (1939:36): [True: 0, False: 0]
  ------------------
 1940|  18.4E|    }
 1941|  2.59M|    horz_rd[0] = (horz_rd[0] < INT64_MAX ? horz_rd[0] : 0);
  ------------------
  |  Branch (1941:19): [True: 2.57M, False: 12.9k]
  ------------------
 1942|  2.59M|    horz_rd[1] = (horz_rd[1] < INT64_MAX ? horz_rd[1] : 0);
  ------------------
  |  Branch (1942:19): [True: 2.55M, False: 34.5k]
  ------------------
 1943|  2.59M|    vert_rd[0] = (vert_rd[0] < INT64_MAX ? vert_rd[0] : 0);
  ------------------
  |  Branch (1943:19): [True: 2.57M, False: 20.1k]
  ------------------
 1944|  2.59M|    vert_rd[1] = (vert_rd[1] < INT64_MAX ? vert_rd[1] : 0);
  ------------------
  |  Branch (1944:19): [True: 2.56M, False: 28.8k]
  ------------------
 1945|  2.59M|    split_rd[0] = (split_rd[0] < INT64_MAX ? split_rd[0] : 0);
  ------------------
  |  Branch (1945:20): [True: 2.59M, False: 781]
  ------------------
 1946|  2.59M|    split_rd[1] = (split_rd[1] < INT64_MAX ? split_rd[1] : 0);
  ------------------
  |  Branch (1946:20): [True: 2.58M, False: 6.18k]
  ------------------
 1947|  2.59M|    split_rd[2] = (split_rd[2] < INT64_MAX ? split_rd[2] : 0);
  ------------------
  |  Branch (1947:20): [True: 2.57M, False: 16.8k]
  ------------------
 1948|  2.59M|    split_rd[3] = (split_rd[3] < INT64_MAX ? split_rd[3] : 0);
  ------------------
  |  Branch (1948:20): [True: 2.51M, False: 76.9k]
  ------------------
 1949|  2.59M|  }
 1950|       |
 1951|       |  // Pruning: pruning out horz_a or horz_b if the combined rdcost of its
 1952|       |  // subblocks estimated from previous partitions is much higher than the best
 1953|       |  // rd so far.
 1954|  2.59M|  ab_partitions_allowed[HORZ_A] = horzab_partition_allowed;
 1955|  2.59M|  ab_partitions_allowed[HORZ_B] = horzab_partition_allowed;
 1956|  2.59M|  if (cpi->sf.part_sf.prune_ext_partition_types_search_level) {
  ------------------
  |  Branch (1956:7): [True: 2.59M, False: 18.4E]
  ------------------
 1957|  2.59M|    const int64_t horz_a_rd = horz_rd[1] + split_rd[0] + split_rd[1];
 1958|  2.59M|    const int64_t horz_b_rd = horz_rd[0] + split_rd[2] + split_rd[3];
 1959|  2.59M|    switch (cpi->sf.part_sf.prune_ext_partition_types_search_level) {
 1960|  2.59M|      case 1:
  ------------------
  |  Branch (1960:7): [True: 2.59M, False: 18.4E]
  ------------------
 1961|  2.59M|        ab_partitions_allowed[HORZ_A] &= (horz_a_rd / 16 * 14 < best_rdcost);
 1962|  2.59M|        ab_partitions_allowed[HORZ_B] &= (horz_b_rd / 16 * 14 < best_rdcost);
 1963|  2.59M|        break;
 1964|      0|      case 2:
  ------------------
  |  Branch (1964:7): [True: 0, False: 2.59M]
  ------------------
 1965|      0|      default:
  ------------------
  |  Branch (1965:7): [True: 0, False: 2.59M]
  ------------------
 1966|      0|        ab_partitions_allowed[HORZ_A] &= (horz_a_rd / 16 * 15 < best_rdcost);
 1967|      0|        ab_partitions_allowed[HORZ_B] &= (horz_b_rd / 16 * 15 < best_rdcost);
 1968|      0|        break;
 1969|  2.59M|    }
 1970|  2.59M|  }
 1971|       |
 1972|       |  // Pruning: pruning out vert_a or vert_b if the combined rdcost of its
 1973|       |  // subblocks estimated from previous partitions is much higher than the best
 1974|       |  // rd so far.
 1975|  2.59M|  ab_partitions_allowed[VERT_A] = vertab_partition_allowed;
 1976|  2.59M|  ab_partitions_allowed[VERT_B] = vertab_partition_allowed;
 1977|  2.59M|  if (cpi->sf.part_sf.prune_ext_partition_types_search_level) {
  ------------------
  |  Branch (1977:7): [True: 2.59M, False: 18.4E]
  ------------------
 1978|  2.59M|    const int64_t vert_a_rd = vert_rd[1] + split_rd[0] + split_rd[2];
 1979|  2.59M|    const int64_t vert_b_rd = vert_rd[0] + split_rd[1] + split_rd[3];
 1980|  2.59M|    switch (cpi->sf.part_sf.prune_ext_partition_types_search_level) {
 1981|  2.59M|      case 1:
  ------------------
  |  Branch (1981:7): [True: 2.59M, False: 18.4E]
  ------------------
 1982|  2.59M|        ab_partitions_allowed[VERT_A] &= (vert_a_rd / 16 * 14 < best_rdcost);
 1983|  2.59M|        ab_partitions_allowed[VERT_B] &= (vert_b_rd / 16 * 14 < best_rdcost);
 1984|  2.59M|        break;
 1985|      0|      case 2:
  ------------------
  |  Branch (1985:7): [True: 0, False: 2.59M]
  ------------------
 1986|      0|      default:
  ------------------
  |  Branch (1986:7): [True: 0, False: 2.59M]
  ------------------
 1987|      0|        ab_partitions_allowed[VERT_A] &= (vert_a_rd / 16 * 15 < best_rdcost);
 1988|      0|        ab_partitions_allowed[VERT_B] &= (vert_b_rd / 16 * 15 < best_rdcost);
 1989|      0|        break;
 1990|  2.59M|    }
 1991|  2.59M|  }
 1992|       |
 1993|       |  // Pruning: pruning out some ab partitions using a DNN taking rd costs of
 1994|       |  // sub-blocks from previous basic partition types.
 1995|  2.59M|  if (cpi->sf.part_sf.ml_prune_partition && ext_partition_allowed &&
  ------------------
  |  Branch (1995:7): [True: 2.59M, False: 18.4E]
  |  Branch (1995:45): [True: 0, False: 2.59M]
  ------------------
 1996|      0|      part_cfg->enable_ab_partitions &&
  ------------------
  |  Branch (1996:7): [True: 0, False: 0]
  ------------------
 1997|      0|      part_state->partition_rect_allowed[HORZ] &&
  ------------------
  |  Branch (1997:7): [True: 0, False: 0]
  ------------------
 1998|      0|      part_state->partition_rect_allowed[VERT]) {
  ------------------
  |  Branch (1998:7): [True: 0, False: 0]
  ------------------
 1999|       |    // TODO(huisu@google.com): x->source_variance may not be the current
 2000|       |    // block's variance. The correct one to use is pb_source_variance. Need to
 2001|       |    // re-train the model to fix it.
 2002|      0|    ml_prune_ab_partition(cpi, pc_tree->partitioning,
 2003|      0|                          get_unsigned_bits(x->source_variance), best_rdcost,
 2004|      0|                          part_state, ab_partitions_allowed);
 2005|      0|  }
 2006|       |
 2007|       |  // Pruning: pruning AB partitions based on the number of horz/vert wins
 2008|       |  // in the current block and sub-blocks in PARTITION_SPLIT.
 2009|  2.59M|  if (cpi->sf.part_sf.prune_ext_part_using_split_info >= 2 &&
  ------------------
  |  Branch (2009:7): [True: 2.59M, False: 18.4E]
  ------------------
 2010|  2.59M|      ab_partitions_allowed[HORZ_A]) {
  ------------------
  |  Branch (2010:7): [True: 0, False: 2.59M]
  ------------------
 2011|      0|    ab_partitions_allowed[HORZ_A] &= evaluate_ab_partition_based_on_split(
 2012|      0|        pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 0, 1);
 2013|      0|  }
 2014|  2.59M|  if (cpi->sf.part_sf.prune_ext_part_using_split_info >= 2 &&
  ------------------
  |  Branch (2014:7): [True: 2.59M, False: 18.4E]
  ------------------
 2015|  2.59M|      ab_partitions_allowed[HORZ_B]) {
  ------------------
  |  Branch (2015:7): [True: 0, False: 2.59M]
  ------------------
 2016|      0|    ab_partitions_allowed[HORZ_B] &= evaluate_ab_partition_based_on_split(
 2017|      0|        pc_tree, PARTITION_HORZ, rect_part_win_info, x->qindex, 2, 3);
 2018|      0|  }
 2019|  2.59M|  if (cpi->sf.part_sf.prune_ext_part_using_split_info >= 2 &&
  ------------------
  |  Branch (2019:7): [True: 2.59M, False: 18.4E]
  ------------------
 2020|  2.59M|      ab_partitions_allowed[VERT_A]) {
  ------------------
  |  Branch (2020:7): [True: 0, False: 2.59M]
  ------------------
 2021|      0|    ab_partitions_allowed[VERT_A] &= evaluate_ab_partition_based_on_split(
 2022|      0|        pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 0, 2);
 2023|      0|  }
 2024|  2.59M|  if (cpi->sf.part_sf.prune_ext_part_using_split_info >= 2 &&
  ------------------
  |  Branch (2024:7): [True: 2.59M, False: 18.4E]
  ------------------
 2025|  2.59M|      ab_partitions_allowed[VERT_B]) {
  ------------------
  |  Branch (2025:7): [True: 0, False: 2.59M]
  ------------------
 2026|      0|    ab_partitions_allowed[VERT_B] &= evaluate_ab_partition_based_on_split(
 2027|      0|        pc_tree, PARTITION_VERT, rect_part_win_info, x->qindex, 1, 3);
 2028|      0|  }
 2029|  2.59M|}
av1_init_simple_motion_search_mvs_for_sb:
 2655|  71.9k|                                              int mi_row, int mi_col) {
 2656|       |  // Use the NEARESTMV of the sb as the start mv
 2657|  71.9k|  const AV1_COMMON *cm = &cpi->common;
 2658|  71.9k|  MACROBLOCKD *const xd = &x->e_mbd;
 2659|  71.9k|  FULLPEL_MV ref_mvs[REF_FRAMES];
 2660|  71.9k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
 2661|  71.9k|  av1_zero(ref_mvs);
  ------------------
  |  |   43|  71.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2662|       |  // If tile_info is NULL, assume that the offsets have already been set.
 2663|  71.9k|  if (tile_info) {
  ------------------
  |  Branch (2663:7): [True: 71.9k, False: 18.4E]
  ------------------
 2664|  71.9k|    av1_set_offsets_without_segment_id(cpi, tile_info, x, mi_row, mi_col,
 2665|  71.9k|                                       sb_size);
 2666|  71.9k|  }
 2667|       |
 2668|  71.9k|  MB_MODE_INFO_EXT mbmi_ext;
 2669|  71.9k|  const int ref_frame =
 2670|  71.9k|      cpi->rc.is_src_frame_alt_ref ? ALTREF_FRAME : LAST_FRAME;
  ------------------
  |  Branch (2670:7): [True: 0, False: 71.9k]
  ------------------
 2671|  71.9k|  av1_find_mv_refs(cm, xd, xd->mi[0], ref_frame, mbmi_ext.ref_mv_count,
 2672|  71.9k|                   xd->ref_mv_stack, xd->weight, NULL, mbmi_ext.global_mvs,
 2673|  71.9k|                   mbmi_ext.mode_context);
 2674|  71.9k|  if (mbmi_ext.ref_mv_count[ref_frame] > 0) {
  ------------------
  |  Branch (2674:7): [True: 9.03k, False: 62.9k]
  ------------------
 2675|  9.03k|    ref_mvs[ref_frame] =
 2676|  9.03k|        get_fullmv_from_mv(&xd->ref_mv_stack[ref_frame][0].this_mv.as_mv);
 2677|  62.9k|  } else {
 2678|  62.9k|    ref_mvs[ref_frame] =
 2679|  62.9k|        get_fullmv_from_mv(&mbmi_ext.global_mvs[ref_frame].as_mv);
 2680|  62.9k|  }
 2681|       |
 2682|  71.9k|  init_simple_motion_search_mvs(sms_root, ref_mvs);
 2683|  71.9k|}
partition_strategy.c:simple_motion_search_prune_part_features:
  535|   707k|    int features_to_get) {
  536|   707k|  const int w_mi = mi_size_wide[bsize];
  537|   707k|  const int h_mi = mi_size_high[bsize];
  538|   707k|  assert(mi_size_wide[bsize] == mi_size_high[bsize]);
  539|   707k|  assert(bsize >= BLOCK_8X8);
  540|   707k|  assert(cpi->ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME] ||
  541|   707k|         cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]);
  542|       |
  543|       |  // Setting up motion search
  544|   707k|  const int ref_list[] = { cpi->rc.is_src_frame_alt_ref ? ALTREF_FRAME
  ------------------
  |  Branch (544:28): [True: 0, False: 707k]
  ------------------
  545|   707k|                                                        : LAST_FRAME };
  546|   707k|  const int num_refs = 1;
  547|   707k|  const int use_subpixel = 1;
  548|       |
  549|       |  // Doing whole block first to update the mv
  550|   707k|  if (!sms_tree->sms_none_valid && features_to_get & FEATURE_SMS_NONE_FLAG) {
  ------------------
  |  |   36|  73.5k|#define FEATURE_SMS_NONE_FLAG 1
  ------------------
  |  Branch (550:7): [True: 73.5k, False: 634k]
  |  Branch (550:36): [True: 73.5k, False: 18.4E]
  ------------------
  551|  73.5k|    simple_motion_search_get_best_ref(cpi, x, sms_tree, mi_row, mi_col, bsize,
  552|  73.5k|                                      ref_list, num_refs, use_subpixel, 1,
  553|  73.5k|                                      &sms_tree->sms_none_feat[0],
  554|  73.5k|                                      &sms_tree->sms_none_feat[1]);
  555|  73.5k|    sms_tree->sms_none_valid = 1;
  556|  73.5k|  }
  557|       |
  558|       |  // Split subblocks
  559|   707k|  if (features_to_get & FEATURE_SMS_SPLIT_FLAG) {
  ------------------
  |  |   37|   707k|#define FEATURE_SMS_SPLIT_FLAG (1 << 1)
  ------------------
  |  Branch (559:7): [True: 707k, False: 18.4E]
  ------------------
  560|   707k|    const BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_SPLIT);
  561|  3.53M|    for (int r_idx = 0; r_idx < SUB_PARTITIONS_SPLIT; r_idx++) {
  ------------------
  |  |   49|  3.53M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (561:25): [True: 2.82M, False: 707k]
  ------------------
  562|  2.82M|      const int sub_mi_col = mi_col + (r_idx & 1) * w_mi / 2;
  563|  2.82M|      const int sub_mi_row = mi_row + (r_idx >> 1) * h_mi / 2;
  564|  2.82M|      SIMPLE_MOTION_DATA_TREE *sub_tree = sms_tree->split[r_idx];
  565|       |
  566|  2.82M|      if (!sub_tree->sms_none_valid) {
  ------------------
  |  Branch (566:11): [True: 2.58M, False: 246k]
  ------------------
  567|  2.58M|        simple_motion_search_get_best_ref(
  568|  2.58M|            cpi, x, sub_tree, sub_mi_row, sub_mi_col, subsize, ref_list,
  569|  2.58M|            num_refs, use_subpixel, 1, &sub_tree->sms_none_feat[0],
  570|  2.58M|            &sub_tree->sms_none_feat[1]);
  571|  2.58M|        sub_tree->sms_none_valid = 1;
  572|  2.58M|      }
  573|  2.82M|    }
  574|   707k|  }
  575|       |
  576|       |  // Rectangular subblocks
  577|   707k|  if (!sms_tree->sms_rect_valid && features_to_get & FEATURE_SMS_RECT_FLAG) {
  ------------------
  |  |   38|   677k|#define FEATURE_SMS_RECT_FLAG (1 << 2)
  ------------------
  |  Branch (577:7): [True: 677k, False: 29.9k]
  |  Branch (577:36): [True: 202k, False: 475k]
  ------------------
  578|       |    // Horz subblock
  579|   202k|    BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_HORZ);
  580|   606k|    for (int r_idx = 0; r_idx < SUB_PARTITIONS_RECT; r_idx++) {
  ------------------
  |  |   46|   606k|#define SUB_PARTITIONS_RECT 2
  ------------------
  |  Branch (580:25): [True: 404k, False: 202k]
  ------------------
  581|   404k|      const int sub_mi_col = mi_col + 0;
  582|   404k|      const int sub_mi_row = mi_row + r_idx * h_mi / 2;
  583|       |
  584|   404k|      simple_motion_search_get_best_ref(
  585|   404k|          cpi, x, sms_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs,
  586|   404k|          use_subpixel, 0, &sms_tree->sms_rect_feat[2 * r_idx],
  587|   404k|          &sms_tree->sms_rect_feat[2 * r_idx + 1]);
  588|   404k|    }
  589|       |
  590|       |    // Vert subblock
  591|   202k|    subsize = get_partition_subsize(bsize, PARTITION_VERT);
  592|   606k|    for (int r_idx = 0; r_idx < SUB_PARTITIONS_RECT; r_idx++) {
  ------------------
  |  |   46|   606k|#define SUB_PARTITIONS_RECT 2
  ------------------
  |  Branch (592:25): [True: 404k, False: 202k]
  ------------------
  593|   404k|      const int sub_mi_col = mi_col + r_idx * w_mi / 2;
  594|   404k|      const int sub_mi_row = mi_row + 0;
  595|       |
  596|   404k|      simple_motion_search_get_best_ref(
  597|   404k|          cpi, x, sms_tree, sub_mi_row, sub_mi_col, subsize, ref_list, num_refs,
  598|   404k|          use_subpixel, 0, &sms_tree->sms_rect_feat[4 + 2 * r_idx],
  599|   404k|          &sms_tree->sms_rect_feat[4 + 2 * r_idx + 1]);
  600|   404k|    }
  601|   202k|    sms_tree->sms_rect_valid = 1;
  602|   202k|  }
  603|       |
  604|   707k|  if (!features) return;
  ------------------
  |  Branch (604:7): [True: 0, False: 707k]
  ------------------
  605|       |
  606|   707k|  int f_idx = 0;
  607|   707k|  if (features_to_get & FEATURE_SMS_NONE_FLAG) {
  ------------------
  |  |   36|   707k|#define FEATURE_SMS_NONE_FLAG 1
  ------------------
  |  Branch (607:7): [True: 707k, False: 18.4E]
  ------------------
  608|  2.12M|    for (int sub_idx = 0; sub_idx < 2; sub_idx++) {
  ------------------
  |  Branch (608:27): [True: 1.41M, False: 707k]
  ------------------
  609|  1.41M|      features[f_idx++] = log1pf((float)sms_tree->sms_none_feat[sub_idx]);
  610|  1.41M|    }
  611|   707k|  }
  612|       |
  613|   707k|  if (features_to_get & FEATURE_SMS_SPLIT_FLAG) {
  ------------------
  |  |   37|   707k|#define FEATURE_SMS_SPLIT_FLAG (1 << 1)
  ------------------
  |  Branch (613:7): [True: 707k, False: 18.4E]
  ------------------
  614|  3.53M|    for (int sub_idx = 0; sub_idx < SUB_PARTITIONS_SPLIT; sub_idx++) {
  ------------------
  |  |   49|  3.53M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (614:27): [True: 2.83M, False: 707k]
  ------------------
  615|  2.83M|      SIMPLE_MOTION_DATA_TREE *sub_tree = sms_tree->split[sub_idx];
  616|  2.83M|      features[f_idx++] = log1pf((float)sub_tree->sms_none_feat[0]);
  617|  2.83M|      features[f_idx++] = log1pf((float)sub_tree->sms_none_feat[1]);
  618|  2.83M|    }
  619|   707k|  }
  620|       |
  621|   707k|  if (features_to_get & FEATURE_SMS_RECT_FLAG) {
  ------------------
  |  |   38|   707k|#define FEATURE_SMS_RECT_FLAG (1 << 2)
  ------------------
  |  Branch (621:7): [True: 232k, False: 475k]
  ------------------
  622|  2.09M|    for (int sub_idx = 0; sub_idx < 8; sub_idx++) {
  ------------------
  |  Branch (622:27): [True: 1.86M, False: 232k]
  ------------------
  623|  1.86M|      features[f_idx++] = log1pf((float)sms_tree->sms_rect_feat[sub_idx]);
  624|  1.86M|    }
  625|   232k|  }
  626|       |
  627|   707k|  const MACROBLOCKD *xd = &x->e_mbd;
  628|   707k|  set_offsets_for_motion_search(cpi, x, mi_row, mi_col, bsize);
  629|       |
  630|       |  // Q_INDEX
  631|   707k|  const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd) >> (xd->bd - 8);
  632|   707k|  features[f_idx++] = log1pf((float)(dc_q * dc_q) / 256.0f);
  633|       |
  634|       |  // Neighbor stuff
  635|   707k|  const int has_above = !!xd->above_mbmi;
  636|   707k|  const int has_left = !!xd->left_mbmi;
  637|   707k|  const BLOCK_SIZE above_bsize = has_above ? xd->above_mbmi->bsize : bsize;
  ------------------
  |  Branch (637:34): [True: 403k, False: 304k]
  ------------------
  638|   707k|  const BLOCK_SIZE left_bsize = has_left ? xd->left_mbmi->bsize : bsize;
  ------------------
  |  Branch (638:33): [True: 411k, False: 295k]
  ------------------
  639|   707k|  features[f_idx++] = (float)has_above;
  640|   707k|  features[f_idx++] = (float)mi_size_wide_log2[above_bsize];
  641|   707k|  features[f_idx++] = (float)mi_size_high_log2[above_bsize];
  642|   707k|  features[f_idx++] = (float)has_left;
  643|   707k|  features[f_idx++] = (float)mi_size_wide_log2[left_bsize];
  644|   707k|  features[f_idx++] = (float)mi_size_high_log2[left_bsize];
  645|   707k|}
partition_strategy.c:write_features_to_file:
  116|   775k|                                   const int mi_col) {
  117|   775k|  if (!WRITE_FEATURE_TO_FILE && !is_test_mode) return;
  ------------------
  |  |   26|  1.55M|#define WRITE_FEATURE_TO_FILE 0
  ------------------
  |  Branch (117:7): [True: 775k, Folded]
  |  Branch (117:33): [True: 775k, False: 18.4E]
  ------------------
  118|       |
  119|  18.4E|  char filename[256];
  120|  18.4E|  snprintf(filename, sizeof(filename), "%s/%s", path,
  121|  18.4E|           get_feature_file_name(id));
  122|  18.4E|  FILE *pfile = fopen(filename, "a");
  123|  18.4E|  if (pfile == NULL) return;
  ------------------
  |  Branch (123:7): [True: 0, False: 18.4E]
  ------------------
  124|  18.4E|  if (!is_test_mode) {
  ------------------
  |  Branch (124:7): [True: 0, False: 18.4E]
  ------------------
  125|      0|    fprintf(pfile, "%d,%d,%d,%d,%d\n", id, (int)bsize, mi_row, mi_col,
  126|      0|            feature_size);
  127|      0|  }
  128|  18.4E|  for (int i = 0; i < feature_size; ++i) {
  ------------------
  |  Branch (128:19): [True: 0, False: 18.4E]
  ------------------
  129|      0|    fprintf(pfile, "%.6f", features[i]);
  130|      0|    if (i < feature_size - 1) fprintf(pfile, ",");
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|  }
  132|  18.4E|  fprintf(pfile, "\n");
  133|  18.4E|  fclose(pfile);
  134|  18.4E|}
partition_strategy.c:convert_bsize_to_idx:
   85|   946k|static inline int convert_bsize_to_idx(BLOCK_SIZE bsize) {
   86|   946k|  switch (bsize) {
   87|      0|    case BLOCK_128X128: return 0;
  ------------------
  |  Branch (87:5): [True: 0, False: 946k]
  ------------------
   88|  39.6k|    case BLOCK_64X64: return 1;
  ------------------
  |  Branch (88:5): [True: 39.6k, False: 906k]
  ------------------
   89|   124k|    case BLOCK_32X32: return 2;
  ------------------
  |  Branch (89:5): [True: 124k, False: 822k]
  ------------------
   90|   456k|    case BLOCK_16X16: return 3;
  ------------------
  |  Branch (90:5): [True: 456k, False: 490k]
  ------------------
   91|   326k|    case BLOCK_8X8: return 4;
  ------------------
  |  Branch (91:5): [True: 326k, False: 619k]
  ------------------
   92|      0|    default: assert(0 && "Invalid bsize"); return -1;
  ------------------
  |  Branch (92:5): [True: 0, False: 946k]
  ------------------
   93|   946k|  }
   94|   946k|}
partition_strategy.c:intra_mode_cnn_partition:
  145|   208k|                                     PartitionSearchState *part_state) {
  146|   208k|  assert(cm->seq_params->sb_size >= BLOCK_64X64 &&
  147|   208k|         "Invalid sb_size for intra_cnn!");
  148|   208k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
  149|   208k|  const BLOCK_SIZE bsize = blk_params->bsize;
  150|       |
  151|   208k|  const int bsize_idx = convert_bsize_to_idx(bsize);
  152|       |
  153|   208k|  if (bsize == BLOCK_128X128) {
  ------------------
  |  Branch (153:7): [True: 0, False: 208k]
  ------------------
  154|      0|    return;
  155|      0|  }
  156|       |
  157|   208k|  PartitionSearchInfo *part_info = &x->part_search_info;
  158|       |
  159|       |  // Precompute the CNN part and cache the result in MACROBLOCK
  160|   208k|  if (bsize == BLOCK_64X64 && !part_info->cnn_output_valid) {
  ------------------
  |  Branch (160:7): [True: 777, False: 207k]
  |  Branch (160:31): [True: 777, False: 0]
  ------------------
  161|    777|    const CNN_CONFIG *cnn_config = &av1_intra_mode_cnn_partition_cnn_config;
  162|       |
  163|       |    // Prepare the output
  164|    777|    const CNN_THREAD_DATA thread_data = { .num_workers = 1, .workers = NULL };
  165|    777|    const int num_outputs = 4;
  166|    777|    const int output_dims[4] = { 1, 2, 4, 8 };
  167|    777|    const int out_chs[4] = { CNN_BRANCH_0_OUT_CH, CNN_BRANCH_1_OUT_CH,
  ------------------
  |  |   22|    777|#define CNN_BRANCH_0_OUT_CH 20
  ------------------
                  const int out_chs[4] = { CNN_BRANCH_0_OUT_CH, CNN_BRANCH_1_OUT_CH,
  ------------------
  |  |   23|    777|#define CNN_BRANCH_1_OUT_CH 4
  ------------------
  168|    777|                             CNN_BRANCH_2_OUT_CH, CNN_BRANCH_3_OUT_CH };
  ------------------
  |  |   24|    777|#define CNN_BRANCH_2_OUT_CH 20
  ------------------
                                           CNN_BRANCH_2_OUT_CH, CNN_BRANCH_3_OUT_CH };
  ------------------
  |  |   25|    777|#define CNN_BRANCH_3_OUT_CH 20
  ------------------
  169|    777|    float *output_buffer[CNN_TOT_OUT_CH];
  170|       |
  171|    777|    float **cur_output_buf = output_buffer;
  172|    777|    float *curr_buf_ptr = part_info->cnn_buffer;
  173|  3.88k|    for (int output_idx = 0; output_idx < num_outputs; output_idx++) {
  ------------------
  |  Branch (173:30): [True: 3.10k, False: 777]
  ------------------
  174|  3.10k|      const int num_chs = out_chs[output_idx];
  175|  3.10k|      const int ch_size = output_dims[output_idx] * output_dims[output_idx];
  176|  52.8k|      for (int ch = 0; ch < num_chs; ch++) {
  ------------------
  |  Branch (176:24): [True: 49.7k, False: 3.10k]
  ------------------
  177|  49.7k|        cur_output_buf[ch] = curr_buf_ptr;
  178|  49.7k|        curr_buf_ptr += ch_size;
  179|  49.7k|      }
  180|  3.10k|      cur_output_buf += num_chs;
  181|  3.10k|    }
  182|       |
  183|    777|    CNN_MULTI_OUT output = {
  184|    777|      .num_outputs = 4,
  185|    777|      .output_channels = out_chs,
  186|    777|      .output_strides = output_dims,
  187|    777|      .output_buffer = output_buffer,
  188|    777|    };
  189|       |
  190|       |    // Prepare the input
  191|    777|    const MACROBLOCKD *xd = &x->e_mbd;
  192|    777|    const int bit_depth = xd->bd;
  193|    777|    const int dc_q =
  194|    777|        av1_dc_quant_QTX(x->qindex, 0, bit_depth) >> (bit_depth - 8);
  195|    777|    part_info->log_q = log1pf((float)(dc_q * dc_q) / 256.0f);
  196|    777|    part_info->log_q =
  197|    777|        (part_info->log_q - av1_intra_mode_cnn_partition_mean[0]) /
  198|    777|        av1_intra_mode_cnn_partition_std[0];
  199|       |
  200|    777|    const int width = 65, height = 65,
  201|    777|              stride = x->plane[AOM_PLANE_Y].src.stride;
  ------------------
  |  |  281|    777|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  202|       |
  203|    777|    if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|    777|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (203:9): [True: 2, False: 775]
  ------------------
  204|      2|      uint16_t *image[1] = {
  205|      2|        CONVERT_TO_SHORTPTR(x->plane[AOM_PLANE_Y].src.buf) - stride - 1
  ------------------
  |  |   79|      2|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  206|      2|      };
  207|       |
  208|      2|      if (!av1_cnn_predict_img_multi_out_highbd(image, width, height, stride,
  ------------------
  |  Branch (208:11): [True: 0, False: 2]
  ------------------
  209|      2|                                                cnn_config, &thread_data,
  210|      2|                                                bit_depth, &output)) {
  211|      0|        aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  212|      0|                           "Error allocating CNN data");
  213|      0|      }
  214|    775|    } else {
  215|    775|      uint8_t *image[1] = { x->plane[AOM_PLANE_Y].src.buf - stride - 1 };
  ------------------
  |  |  281|    775|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  216|       |
  217|    775|      if (!av1_cnn_predict_img_multi_out(image, width, height, stride,
  ------------------
  |  Branch (217:11): [True: 0, False: 775]
  ------------------
  218|    775|                                         cnn_config, &thread_data, &output)) {
  219|      0|        aom_internal_error(xd->error_info, AOM_CODEC_MEM_ERROR,
  220|      0|                           "Error allocating CNN data");
  221|      0|      }
  222|    775|    }
  223|       |
  224|    777|    part_info->cnn_output_valid = 1;
  225|    777|  }
  226|       |
  227|   208k|  if (!part_info->cnn_output_valid) {
  ------------------
  |  Branch (227:7): [True: 145k, False: 62.6k]
  ------------------
  228|   145k|    return;
  229|   145k|  }
  230|       |
  231|  62.6k|  const NN_CONFIG *dnn_configs[5] = {
  232|  62.6k|    NULL,
  233|  62.6k|    &av1_intra_mode_cnn_partition_branch_0_dnn_config,
  234|  62.6k|    &av1_intra_mode_cnn_partition_branch_1_dnn_config,
  235|  62.6k|    &av1_intra_mode_cnn_partition_branch_2_dnn_config,
  236|  62.6k|    &av1_intra_mode_cnn_partition_branch_3_dnn_config,
  237|  62.6k|  };
  238|       |
  239|  62.6k|  const NN_CONFIG *dnn_config = dnn_configs[bsize_idx];
  240|       |
  241|  62.6k|  float dnn_features[100];
  242|  62.6k|  float logits[4] = { 0.0f };
  243|       |
  244|  62.6k|  const float *branch_0 = part_info->cnn_buffer;
  245|  62.6k|  const float *branch_1 = branch_0 + CNN_BRANCH_0_OUT_SIZE;
  ------------------
  |  |   29|  62.6k|#define CNN_BRANCH_0_OUT_SIZE (CNN_BRANCH_0_OUT_CH)
  |  |  ------------------
  |  |  |  |   22|  62.6k|#define CNN_BRANCH_0_OUT_CH 20
  |  |  ------------------
  ------------------
  246|  62.6k|  const float *branch_2 = branch_1 + CNN_BRANCH_1_OUT_SIZE;
  ------------------
  |  |   30|  62.6k|#define CNN_BRANCH_1_OUT_SIZE ((CNN_BRANCH_1_OUT_CH) * 2 * 2)
  |  |  ------------------
  |  |  |  |   23|  62.6k|#define CNN_BRANCH_1_OUT_CH 4
  |  |  ------------------
  ------------------
  247|  62.6k|  const float *branch_3 = branch_2 + CNN_BRANCH_2_OUT_SIZE;
  ------------------
  |  |   31|  62.6k|#define CNN_BRANCH_2_OUT_SIZE ((CNN_BRANCH_2_OUT_CH) * 4 * 4)
  |  |  ------------------
  |  |  |  |   24|  62.6k|#define CNN_BRANCH_2_OUT_CH 20
  |  |  ------------------
  ------------------
  248|       |
  249|  62.6k|  if (bsize == BLOCK_64X64) {
  ------------------
  |  Branch (249:7): [True: 781, False: 61.8k]
  ------------------
  250|    781|    int f_idx = 0;
  251|  16.4k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_0_OUT_CH; ch_idx++) {
  ------------------
  |  |   22|  16.4k|#define CNN_BRANCH_0_OUT_CH 20
  ------------------
  |  Branch (251:26): [True: 15.6k, False: 781]
  ------------------
  252|  15.6k|      dnn_features[f_idx++] = branch_0[ch_idx];
  253|  15.6k|    }
  254|       |
  255|    781|    const int spa_stride = 2 * 2;
  256|  3.90k|    for (int lin_idx = 0; lin_idx < spa_stride; lin_idx++) {
  ------------------
  |  Branch (256:27): [True: 3.12k, False: 781]
  ------------------
  257|  15.6k|      for (int ch_idx = 0; ch_idx < CNN_BRANCH_1_OUT_CH; ch_idx++) {
  ------------------
  |  |   23|  15.6k|#define CNN_BRANCH_1_OUT_CH 4
  ------------------
  |  Branch (257:28): [True: 12.4k, False: 3.12k]
  ------------------
  258|  12.4k|        dnn_features[f_idx++] = branch_1[lin_idx + ch_idx * spa_stride];
  259|  12.4k|      }
  260|  3.12k|    }
  261|    781|    dnn_features[f_idx++] = part_info->log_q;
  262|  61.8k|  } else if (bsize == BLOCK_32X32) {
  ------------------
  |  Branch (262:14): [True: 3.12k, False: 58.7k]
  ------------------
  263|  3.12k|    int f_idx = 0;
  264|  65.5k|    for (int idx = 0; idx < CNN_BRANCH_0_OUT_CH; idx++) {
  ------------------
  |  |   22|  65.5k|#define CNN_BRANCH_0_OUT_CH 20
  ------------------
  |  Branch (264:23): [True: 62.4k, False: 3.12k]
  ------------------
  265|  62.4k|      dnn_features[f_idx++] = branch_0[idx];
  266|  62.4k|    }
  267|       |
  268|  3.12k|    const int curr_lin_idx = quad_to_linear_1[quad_tree_idx - 1];
  269|  3.12k|    const int spa_stride = 2 * 2;
  270|  15.6k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_1_OUT_CH; ch_idx++) {
  ------------------
  |  |   23|  15.6k|#define CNN_BRANCH_1_OUT_CH 4
  ------------------
  |  Branch (270:26): [True: 12.4k, False: 3.12k]
  ------------------
  271|  12.4k|      dnn_features[f_idx++] = branch_1[curr_lin_idx + ch_idx * spa_stride];
  272|  12.4k|    }
  273|  3.12k|    dnn_features[f_idx++] = part_info->log_q;
  274|  58.7k|  } else if (bsize == BLOCK_16X16) {
  ------------------
  |  Branch (274:14): [True: 11.8k, False: 46.8k]
  ------------------
  275|  11.8k|    int f_idx = 0;
  276|  11.8k|    const int prev_quad_idx = (quad_tree_idx - 1) / 4;
  277|  11.8k|    const int prev_lin_idx = quad_to_linear_1[prev_quad_idx - 1];
  278|  11.8k|    const int prev_spa_stride = 2 * 2;
  279|  59.1k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_1_OUT_CH; ch_idx++) {
  ------------------
  |  |   23|  59.1k|#define CNN_BRANCH_1_OUT_CH 4
  ------------------
  |  Branch (279:26): [True: 47.3k, False: 11.8k]
  ------------------
  280|  47.3k|      dnn_features[f_idx++] = branch_1[prev_lin_idx + ch_idx * prev_spa_stride];
  281|  47.3k|    }
  282|       |
  283|  11.8k|    const int curr_lin_idx = quad_to_linear_2[quad_tree_idx - 5];
  284|  11.8k|    const int spa_stride = 4 * 4;
  285|   248k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_2_OUT_CH; ch_idx++) {
  ------------------
  |  |   24|   248k|#define CNN_BRANCH_2_OUT_CH 20
  ------------------
  |  Branch (285:26): [True: 236k, False: 11.8k]
  ------------------
  286|   236k|      dnn_features[f_idx++] = branch_2[curr_lin_idx + ch_idx * spa_stride];
  287|   236k|    }
  288|  11.8k|    dnn_features[f_idx++] = part_info->log_q;
  289|  46.8k|  } else if (bsize == BLOCK_8X8) {
  ------------------
  |  Branch (289:14): [True: 46.8k, False: 18.4E]
  ------------------
  290|  46.8k|    int f_idx = 0;
  291|  46.8k|    const int prev_quad_idx = (quad_tree_idx - 1) / 4;
  292|  46.8k|    const int prev_lin_idx = quad_to_linear_2[prev_quad_idx - 5];
  293|  46.8k|    const int prev_spa_stride = 4 * 4;
  294|   984k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_2_OUT_CH; ch_idx++) {
  ------------------
  |  |   24|   984k|#define CNN_BRANCH_2_OUT_CH 20
  ------------------
  |  Branch (294:26): [True: 937k, False: 46.8k]
  ------------------
  295|   937k|      dnn_features[f_idx++] = branch_2[prev_lin_idx + ch_idx * prev_spa_stride];
  296|   937k|    }
  297|       |
  298|  46.8k|    const int curr_lin_idx = quad_to_linear_3[quad_tree_idx - 21];
  299|  46.8k|    const int spa_stride = 8 * 8;
  300|   984k|    for (int ch_idx = 0; ch_idx < CNN_BRANCH_3_OUT_CH; ch_idx++) {
  ------------------
  |  |   25|   984k|#define CNN_BRANCH_3_OUT_CH 20
  ------------------
  |  Branch (300:26): [True: 937k, False: 46.8k]
  ------------------
  301|   937k|      dnn_features[f_idx++] = branch_3[curr_lin_idx + ch_idx * spa_stride];
  302|   937k|    }
  303|  46.8k|    dnn_features[f_idx++] = part_info->log_q;
  304|  18.4E|  } else {
  305|  18.4E|    assert(0 && "Invalid bsize in intra_cnn partition");
  306|  18.4E|  }
  307|       |
  308|       |  // Make decision
  309|  62.6k|  av1_nn_predict(dnn_features, dnn_config, 1, logits);
  310|       |
  311|  62.6k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|  62.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 31.2k, False: 31.3k]
  |  |  ------------------
  ------------------
  312|  62.6k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|  62.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 31.2k, False: 31.3k]
  |  |  ------------------
  ------------------
  313|  62.6k|  float split_only_thresh = 100.0f, no_split_thresh = -100.0f;
  314|  62.6k|  if (is_720p_or_larger) {
  ------------------
  |  Branch (314:7): [True: 0, False: 62.6k]
  ------------------
  315|      0|    split_only_thresh =
  316|      0|        av1_intra_mode_cnn_partition_split_thresh_hdres[bsize_idx];
  317|      0|    no_split_thresh =
  318|      0|        av1_intra_mode_cnn_partition_no_split_thresh_hdres[bsize_idx];
  319|  62.6k|  } else if (is_480p_or_larger) {
  ------------------
  |  Branch (319:14): [True: 0, False: 62.6k]
  ------------------
  320|      0|    split_only_thresh =
  321|      0|        av1_intra_mode_cnn_partition_split_thresh_midres[bsize_idx];
  322|      0|    no_split_thresh =
  323|      0|        av1_intra_mode_cnn_partition_no_split_thresh_midres[bsize_idx];
  324|  62.6k|  } else {
  325|  62.6k|    split_only_thresh =
  326|  62.6k|        av1_intra_mode_cnn_partition_split_thresh_lowres[bsize_idx];
  327|  62.6k|    no_split_thresh =
  328|  62.6k|        av1_intra_mode_cnn_partition_no_split_thresh_lowres[bsize_idx];
  329|  62.6k|  }
  330|       |
  331|  62.6k|  if (logits[0] > split_only_thresh) {
  ------------------
  |  Branch (331:7): [True: 1.48k, False: 61.1k]
  ------------------
  332|       |    // As screen contents tend to choose larger partitions, do not prune
  333|       |    // PARTITION_NONE when intra_cnn_based_part_prune_level=1.
  334|  1.48k|    if (intra_cnn_based_part_prune_level != 1) {
  ------------------
  |  Branch (334:9): [True: 1.48k, False: 0]
  ------------------
  335|  1.48k|      part_state->partition_none_allowed = 0;
  336|  1.48k|    }
  337|  1.48k|    part_state->do_square_split = 1;
  338|  1.48k|    av1_disable_rect_partitions(part_state);
  339|  1.48k|  }
  340|       |
  341|  62.6k|  if (logits[0] < no_split_thresh) {
  ------------------
  |  Branch (341:7): [True: 39.9k, False: 22.6k]
  ------------------
  342|  39.9k|    av1_disable_square_split_partition(part_state);
  343|  39.9k|  }
  344|  62.6k|}
partition_strategy.c:simple_motion_search_based_split:
  374|   475k|                                             PartitionSearchState *part_state) {
  375|   475k|  const AV1_COMMON *const cm = &cpi->common;
  376|   475k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
  377|   475k|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
  378|   475k|  const BLOCK_SIZE bsize = blk_params->bsize;
  379|       |
  380|   475k|  const int bsize_idx = convert_bsize_to_idx(bsize);
  381|   475k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|   475k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 220k, False: 254k]
  |  |  ------------------
  ------------------
  382|   475k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|   475k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 220k, False: 254k]
  |  |  ------------------
  ------------------
  383|       |  // res_idx is 0 for res < 480p, 1 for 480p, 2 for 720p+
  384|   475k|  const int res_idx = is_480p_or_larger + is_720p_or_larger;
  385|       |
  386|   475k|  assert(bsize_idx >= 0 && bsize_idx <= 4 &&
  387|   475k|         "Invalid bsize in simple_motion_search_based_split");
  388|       |
  389|   475k|  const int agg = get_simple_motion_search_prune_agg(
  390|   475k|      x->qindex, cpi->sf.part_sf.simple_motion_search_prune_agg, 0);
  391|   475k|  if (agg < 0) {
  ------------------
  |  Branch (391:7): [True: 0, False: 475k]
  ------------------
  392|      0|    return;
  393|      0|  }
  394|       |
  395|   475k|  int ml_model_index = (agg == SIMPLE_AGG_LVL1 || agg == SIMPLE_AGG_LVL2);
  ------------------
  |  Branch (395:25): [True: 69, False: 475k]
  |  Branch (395:51): [True: 18.4E, False: 475k]
  ------------------
  396|       |
  397|   475k|  const float *ml_mean =
  398|   475k|      av1_simple_motion_search_split_mean[ml_model_index][bsize_idx];
  399|   475k|  const float *ml_std =
  400|   475k|      av1_simple_motion_search_split_std[ml_model_index][bsize_idx];
  401|   475k|  const NN_CONFIG *nn_config =
  402|   475k|      av1_simple_motion_search_split_nn_config[ml_model_index][bsize_idx];
  403|       |
  404|   475k|  const float split_only_thresh =
  405|   475k|      av1_simple_motion_search_split_thresh[agg][res_idx][bsize_idx];
  406|   475k|  const float no_split_thresh =
  407|   475k|      av1_simple_motion_search_no_split_thresh[agg][res_idx][bsize_idx];
  408|       |
  409|   475k|  float features[FEATURE_SIZE_SMS_SPLIT] = { 0.0f };
  410|   475k|  simple_motion_search_prune_part_features(cpi, x, sms_tree, mi_row, mi_col,
  411|   475k|                                           bsize, features,
  412|   475k|                                           FEATURE_SMS_SPLIT_MODEL_FLAG);
  ------------------
  |  |   43|   475k|  (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG)
  |  |  ------------------
  |  |  |  |   36|   475k|#define FEATURE_SMS_NONE_FLAG 1
  |  |  ------------------
  |  |                 (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG)
  |  |  ------------------
  |  |  |  |   37|   475k|#define FEATURE_SMS_SPLIT_FLAG (1 << 1)
  |  |  ------------------
  ------------------
  413|       |
  414|       |  // Write features to file
  415|   475k|  write_features_to_file(cpi->oxcf.partition_info_path,
  416|   475k|                         cpi->ext_part_controller.test_mode, features,
  417|   475k|                         FEATURE_SIZE_SMS_SPLIT, 0, bsize, mi_row, mi_col);
  ------------------
  |  |   29|   475k|#define FEATURE_SIZE_SMS_SPLIT 17
  ------------------
  418|       |
  419|       |  // Note: it is intended to not normalize the features here, to keep it
  420|       |  // consistent for all features collected and passed to the external model.
  421|   475k|  if (ext_ml_model_decision_before_none(
  ------------------
  |  Branch (421:7): [True: 0, False: 475k]
  ------------------
  422|   475k|          cpi, features, &part_state->partition_none_allowed,
  423|   475k|          &part_state->partition_rect_allowed[HORZ],
  424|   475k|          &part_state->partition_rect_allowed[VERT],
  425|   475k|          &part_state->do_rectangular_split, &part_state->do_square_split)) {
  426|      0|    return;
  427|      0|  }
  428|       |
  429|  8.55M|  for (int idx = 0; idx < FEATURE_SIZE_SMS_SPLIT; idx++) {
  ------------------
  |  |   29|  8.55M|#define FEATURE_SIZE_SMS_SPLIT 17
  ------------------
  |  Branch (429:21): [True: 8.08M, False: 475k]
  ------------------
  430|  8.08M|    features[idx] = (features[idx] - ml_mean[idx]) / ml_std[idx];
  431|  8.08M|  }
  432|       |
  433|   475k|  float score = 0.0f;
  434|       |
  435|   475k|  av1_nn_predict(features, nn_config, 1, &score);
  436|       |
  437|   475k|  if (score > split_only_thresh) {
  ------------------
  |  Branch (437:7): [True: 363k, False: 111k]
  ------------------
  438|   363k|    av1_set_square_split_only(part_state);
  439|   363k|  }
  440|       |
  441|   475k|  if (cpi->sf.part_sf.simple_motion_search_split >= 2 &&
  ------------------
  |  Branch (441:7): [True: 379k, False: 95.6k]
  ------------------
  442|   379k|      score < no_split_thresh) {
  ------------------
  |  Branch (442:7): [True: 11.6k, False: 367k]
  ------------------
  443|  11.6k|    av1_disable_square_split_partition(part_state);
  444|  11.6k|  }
  445|       |
  446|       |  // If the score is very low, prune rectangular split since it is unlikely to
  447|       |  // occur.
  448|   475k|  if (cpi->sf.part_sf.simple_motion_search_rect_split) {
  ------------------
  |  Branch (448:7): [True: 475k, False: 18.4E]
  ------------------
  449|   475k|    const float scale = res_idx >= 2 ? 3.0f : 2.0f;
  ------------------
  |  Branch (449:25): [True: 0, False: 475k]
  ------------------
  450|   475k|    const float rect_split_thresh =
  451|   475k|        scale * av1_simple_motion_search_no_split_thresh[SIMPLE_AGG_LVL3]
  452|   475k|                                                        [res_idx][bsize_idx];
  453|   475k|    if (score < rect_split_thresh) {
  ------------------
  |  Branch (453:9): [True: 2.81k, False: 472k]
  ------------------
  454|  2.81k|      part_state->do_rectangular_split = 0;
  455|  2.81k|    }
  456|   475k|  }
  457|   475k|}
partition_strategy.c:get_simple_motion_search_prune_agg:
  348|   736k|                                                     int is_rect_part) {
  349|   736k|  assert(prune_level < TOTAL_AGG_LVLS);
  350|   736k|  if (prune_level == NO_PRUNING) {
  ------------------
  |  Branch (350:7): [True: 0, False: 736k]
  ------------------
  351|      0|    return -1;
  352|      0|  }
  353|       |
  354|       |  // Aggressiveness value for SIMPLE_MOTION_SEARCH_PRUNE_LEVEL except
  355|       |  // QIDX_BASED_AGG_LVL
  356|   736k|  const int sms_prune_agg_levels[TOTAL_SIMPLE_AGG_LVLS] = { 0, 1, 2, 3, 4, 5 };
  357|   736k|  if (prune_level < TOTAL_SIMPLE_AGG_LVLS) {
  ------------------
  |  Branch (357:7): [True: 736k, False: 18.4E]
  ------------------
  358|   736k|    return sms_prune_agg_levels[prune_level];
  359|   736k|  }
  360|       |
  361|       |  // Map the QIDX_BASED_AGG_LVL to corresponding aggressiveness value.
  362|       |  // Aggressive pruning for lower quantizers in non-boosted frames to prune
  363|       |  // rectangular partitions.
  364|  18.4E|  const int qband = is_rect_part ? (qindex <= 90 ? 1 : 0) : 0;
  ------------------
  |  Branch (364:21): [True: 0, False: 18.4E]
  |  Branch (364:37): [True: 0, False: 0]
  ------------------
  365|  18.4E|  const int sms_prune_agg_qindex_based[2] = { 3, 4 };
  366|  18.4E|  return sms_prune_agg_qindex_based[qband];
  367|   736k|}
partition_strategy.c:ext_ml_model_decision_before_none:
 2139|   475k|    int *do_square_split) {
 2140|   475k|  ExtPartController *const ext_part_controller = &cpi->ext_part_controller;
 2141|   475k|  if (!ext_part_controller->ready) return false;
  ------------------
  |  Branch (2141:7): [True: 475k, False: 18.4E]
  ------------------
 2142|       |
 2143|       |  // Setup features.
 2144|  18.4E|  aom_partition_features_t features;
 2145|  18.4E|  features.id = AOM_EXT_PART_FEATURE_BEFORE_NONE;
 2146|  18.4E|  for (int i = 0; i < FEATURE_SIZE_SMS_SPLIT; ++i) {
  ------------------
  |  |   29|  18.4E|#define FEATURE_SIZE_SMS_SPLIT 17
  ------------------
  |  Branch (2146:19): [True: 0, False: 18.4E]
  ------------------
 2147|      0|    features.before_part_none.f[i] = features_from_motion[i];
 2148|      0|  }
 2149|       |
 2150|       |  // Send necessary features to the external model.
 2151|  18.4E|  av1_ext_part_send_features(ext_part_controller, &features);
 2152|       |
 2153|       |  // Get partition decisions from the external model.
 2154|  18.4E|  aom_partition_decision_t decision;
 2155|  18.4E|  const bool valid_decision =
 2156|  18.4E|      av1_ext_part_get_partition_decision(ext_part_controller, &decision);
 2157|  18.4E|  if (!valid_decision) return false;
  ------------------
  |  Branch (2157:7): [True: 0, False: 18.4E]
  ------------------
 2158|       |
 2159|       |  // Populate decisions
 2160|  18.4E|  *partition_none_allowed = decision.partition_none_allowed;
 2161|  18.4E|  *partition_horz_allowed = decision.partition_rect_allowed[HORZ];
 2162|  18.4E|  *partition_vert_allowed = decision.partition_rect_allowed[VERT];
 2163|  18.4E|  *do_rectangular_split = decision.do_rectangular_split;
 2164|  18.4E|  *do_square_split = decision.do_square_split;
 2165|       |
 2166|       |  return true;
 2167|  18.4E|}
partition_strategy.c:simple_motion_search_prune_rect:
  652|   261k|                                            PartitionSearchState *part_state) {
  653|   261k|  const AV1_COMMON *const cm = &cpi->common;
  654|   261k|  const PartitionBlkParams *blk_params = &part_state->part_blk_params;
  655|   261k|  const int mi_row = blk_params->mi_row, mi_col = blk_params->mi_col;
  656|   261k|  const BLOCK_SIZE bsize = blk_params->bsize;
  657|       |
  658|   261k|  const int bsize_idx = convert_bsize_to_idx(bsize);
  659|   261k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|   261k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 126k, False: 134k]
  |  |  ------------------
  ------------------
  660|   261k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|   261k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 126k, False: 134k]
  |  |  ------------------
  ------------------
  661|       |  // res_idx is 0 for lowres, 1 for 48p, 2 for 720p+
  662|   261k|  const int res_idx = is_480p_or_larger + is_720p_or_larger;
  663|       |
  664|       |  // Get model parameters
  665|   261k|  const NN_CONFIG *nn_config =
  666|   261k|      av1_simple_motion_search_prune_rect_nn_config[bsize_idx];
  667|   261k|  const float *ml_mean = av1_simple_motion_search_prune_rect_mean[bsize_idx],
  668|   261k|              *ml_std = av1_simple_motion_search_prune_rect_std[bsize_idx];
  669|       |
  670|   261k|  const int agg = get_simple_motion_search_prune_agg(
  671|   261k|      x->qindex, cpi->sf.part_sf.simple_motion_search_prune_agg, 1);
  672|   261k|  if (agg < 0) {
  ------------------
  |  Branch (672:7): [True: 0, False: 261k]
  ------------------
  673|      0|    return;
  674|      0|  }
  675|       |
  676|   261k|  const float prune_thresh =
  677|   261k|      av1_simple_motion_search_prune_rect_thresh[agg][res_idx][bsize_idx];
  678|       |
  679|       |  // If there is no valid threshold, return immediately.
  680|   261k|  if (!nn_config || prune_thresh == 0.0f) {
  ------------------
  |  Branch (680:7): [True: 64, False: 261k]
  |  Branch (680:21): [True: 77.2k, False: 183k]
  ------------------
  681|  77.2k|    return;
  682|  77.2k|  }
  683|       |
  684|       |  // Get features
  685|   183k|  float features[FEATURE_SIZE_SMS_PRUNE_PART] = { 0.0f };
  686|   183k|  simple_motion_search_prune_part_features(cpi, x, sms_tree, mi_row, mi_col,
  687|   183k|                                           bsize, features,
  688|   183k|                                           FEATURE_SMS_PRUNE_PART_FLAG);
  ------------------
  |  |   41|   183k|  (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   36|   183k|#define FEATURE_SMS_NONE_FLAG 1
  |  |  ------------------
  |  |                 (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   37|   183k|#define FEATURE_SMS_SPLIT_FLAG (1 << 1)
  |  |  ------------------
  |  |                 (FEATURE_SMS_NONE_FLAG | FEATURE_SMS_SPLIT_FLAG | FEATURE_SMS_RECT_FLAG)
  |  |  ------------------
  |  |  |  |   38|   183k|#define FEATURE_SMS_RECT_FLAG (1 << 2)
  |  |  ------------------
  ------------------
  689|       |
  690|       |  // Note: it is intended to not normalize the features here, to keep it
  691|       |  // consistent for all features collected and passed to the external model.
  692|   183k|  if (cpi->sf.part_sf.simple_motion_search_prune_rect &&
  ------------------
  |  Branch (692:7): [True: 183k, False: 32]
  ------------------
  693|   183k|      !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (693:7): [True: 183k, False: 18.4E]
  ------------------
  694|   183k|      (part_state->partition_rect_allowed[HORZ] ||
  ------------------
  |  Branch (694:8): [True: 110k, False: 73.2k]
  ------------------
  695|  73.2k|       part_state->partition_rect_allowed[VERT]) &&
  ------------------
  |  Branch (695:8): [True: 73.2k, False: 0]
  ------------------
  696|   183k|      bsize >= BLOCK_8X8 && !av1_superres_scaled(cm)) {
  ------------------
  |  Branch (696:7): [True: 183k, False: 18.4E]
  |  Branch (696:29): [True: 183k, False: 1]
  ------------------
  697|       |    // Write features to file
  698|   183k|    write_features_to_file(
  699|   183k|        cpi->oxcf.partition_info_path, cpi->ext_part_controller.test_mode,
  700|   183k|        features, FEATURE_SIZE_SMS_PRUNE_PART, 1, bsize, mi_row, mi_col);
  ------------------
  |  |   30|   183k|#define FEATURE_SIZE_SMS_PRUNE_PART 25
  ------------------
  701|       |
  702|   183k|    if (ext_ml_model_decision_before_none_part2(
  ------------------
  |  Branch (702:9): [True: 0, False: 183k]
  ------------------
  703|   183k|            cpi, features, &part_state->prune_rect_part[HORZ],
  704|   183k|            &part_state->prune_rect_part[VERT])) {
  705|      0|      return;
  706|      0|    }
  707|   183k|  }
  708|       |
  709|  4.77M|  for (int f_idx = 0; f_idx < FEATURE_SIZE_SMS_PRUNE_PART; f_idx++) {
  ------------------
  |  |   30|  4.77M|#define FEATURE_SIZE_SMS_PRUNE_PART 25
  ------------------
  |  Branch (709:23): [True: 4.59M, False: 183k]
  ------------------
  710|  4.59M|    features[f_idx] = (features[f_idx] - ml_mean[f_idx]) / ml_std[f_idx];
  711|  4.59M|  }
  712|       |
  713|       |  // Get probabilities
  714|   183k|  float scores[EXT_PARTITION_TYPES] = { 0.0f },
  715|   183k|        probs[EXT_PARTITION_TYPES] = { 0.0f };
  716|   183k|  const int num_classes = (bsize == BLOCK_128X128 || bsize == BLOCK_8X8)
  ------------------
  |  Branch (716:28): [True: 52, False: 183k]
  |  Branch (716:54): [True: 18.4E, False: 183k]
  ------------------
  717|   183k|                              ? PARTITION_TYPES
  718|   183k|                              : EXT_PARTITION_TYPES;
  719|       |
  720|   183k|  av1_nn_predict(features, nn_config, 1, scores);
  721|       |
  722|   183k|  av1_nn_softmax(scores, probs, num_classes);
  723|       |
  724|       |  // Determine if we should prune rectangular partitions.
  725|   183k|  if (probs[PARTITION_HORZ] <= prune_thresh) {
  ------------------
  |  Branch (725:7): [True: 177k, False: 5.94k]
  ------------------
  726|   177k|    part_state->prune_rect_part[HORZ] = 1;
  727|   177k|  }
  728|   183k|  if (probs[PARTITION_VERT] <= prune_thresh) {
  ------------------
  |  Branch (728:7): [True: 162k, False: 21.2k]
  ------------------
  729|   162k|    part_state->prune_rect_part[VERT] = 1;
  730|   162k|  }
  731|   183k|}
partition_strategy.c:ext_ml_model_decision_before_none_part2:
 2176|   183k|    int *prune_horz, int *prune_vert) {
 2177|   183k|  ExtPartController *const ext_part_controller = &cpi->ext_part_controller;
 2178|   183k|  if (!ext_part_controller->ready) return false;
  ------------------
  |  Branch (2178:7): [True: 183k, False: 18.4E]
  ------------------
 2179|       |
 2180|       |  // Setup features.
 2181|  18.4E|  aom_partition_features_t features;
 2182|  18.4E|  features.id = AOM_EXT_PART_FEATURE_BEFORE_NONE_PART2;
 2183|  18.4E|  for (int i = 0; i < FEATURE_SIZE_SMS_PRUNE_PART; ++i) {
  ------------------
  |  |   30|  18.4E|#define FEATURE_SIZE_SMS_PRUNE_PART 25
  ------------------
  |  Branch (2183:19): [True: 0, False: 18.4E]
  ------------------
 2184|      0|    features.before_part_none.f_part2[i] = features_from_motion[i];
 2185|      0|  }
 2186|       |
 2187|       |  // Send necessary features to the external model.
 2188|  18.4E|  av1_ext_part_send_features(ext_part_controller, &features);
 2189|       |
 2190|       |  // Get partition decisions from the external model.
 2191|  18.4E|  aom_partition_decision_t decision;
 2192|  18.4E|  const bool valid_decision =
 2193|  18.4E|      av1_ext_part_get_partition_decision(ext_part_controller, &decision);
 2194|  18.4E|  if (!valid_decision) return false;
  ------------------
  |  Branch (2194:7): [True: 0, False: 18.4E]
  ------------------
 2195|       |
 2196|       |  // Populate decisions
 2197|  18.4E|  *prune_horz = decision.prune_rect_part[HORZ];
 2198|  18.4E|  *prune_vert = decision.prune_rect_part[VERT];
 2199|       |
 2200|       |  return true;
 2201|  18.4E|}
partition_strategy.c:ext_ml_model_decision_after_none:
 2210|  2.04k|    int *do_rectangular_split) {
 2211|  2.04k|  if (!ext_part_controller->ready || is_intra_frame) return false;
  ------------------
  |  Branch (2211:7): [True: 2.04k, False: 0]
  |  Branch (2211:38): [True: 0, False: 0]
  ------------------
 2212|       |
 2213|       |  // Setup features.
 2214|      0|  aom_partition_features_t features;
 2215|      0|  features.id = AOM_EXT_PART_FEATURE_AFTER_NONE;
 2216|      0|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (2216:19): [True: 0, False: 0]
  ------------------
 2217|      0|    features.after_part_none.f[i] = features_after_none[i];
 2218|      0|  }
 2219|       |
 2220|       |  // Send necessary features to the external model.
 2221|      0|  av1_ext_part_send_features(ext_part_controller, &features);
 2222|       |
 2223|       |  // Get partition decisions from the external model.
 2224|      0|  aom_partition_decision_t decision;
 2225|      0|  const bool valid_decision =
 2226|      0|      av1_ext_part_get_partition_decision(ext_part_controller, &decision);
 2227|      0|  if (!valid_decision) return false;
  ------------------
  |  Branch (2227:7): [True: 0, False: 0]
  ------------------
 2228|       |
 2229|       |  // Populate decisions
 2230|      0|  *do_square_split = decision.do_square_split;
 2231|      0|  *do_rectangular_split = decision.do_rectangular_split;
 2232|       |
 2233|       |  return true;
 2234|      0|}
partition_strategy.c:ext_ml_model_decision_after_none_part2:
 2241|  48.6k|    int *terminate_partition_search) {
 2242|  48.6k|  AV1_COMMON *const cm = &cpi->common;
 2243|  48.6k|  ExtPartController *const ext_part_controller = &cpi->ext_part_controller;
 2244|  48.6k|  if (!ext_part_controller->ready || frame_is_intra_only(cm)) return false;
  ------------------
  |  Branch (2244:7): [True: 48.6k, False: 0]
  |  Branch (2244:38): [True: 0, False: 0]
  ------------------
 2245|       |
 2246|       |  // Setup features.
 2247|      0|  aom_partition_features_t features;
 2248|      0|  features.id = AOM_EXT_PART_FEATURE_AFTER_NONE_PART2;
 2249|      0|  for (int i = 0; i < FEATURE_SIZE_SMS_TERM_NONE; ++i) {
  ------------------
  |  |   31|      0|#define FEATURE_SIZE_SMS_TERM_NONE 28
  ------------------
  |  Branch (2249:19): [True: 0, False: 0]
  ------------------
 2250|      0|    features.after_part_none.f_terminate[i] = features_terminate[i];
 2251|      0|  }
 2252|       |
 2253|       |  // Send necessary features to the external model.
 2254|      0|  av1_ext_part_send_features(ext_part_controller, &features);
 2255|       |
 2256|       |  // Get partition decisions from the external model.
 2257|      0|  aom_partition_decision_t decision;
 2258|      0|  const bool valid_decision =
 2259|      0|      av1_ext_part_get_partition_decision(ext_part_controller, &decision);
 2260|      0|  if (!valid_decision) return false;
  ------------------
  |  Branch (2260:7): [True: 0, False: 0]
  ------------------
 2261|       |
 2262|       |  // Populate decisions
 2263|      0|  *terminate_partition_search = decision.terminate_partition_search;
 2264|       |
 2265|       |  return true;
 2266|      0|}
partition_strategy.c:ext_ml_model_decision_after_split_part2:
 2309|  65.7k|    int *prune_rect_part_vert) {
 2310|  65.7k|  if (is_intra_frame || !ext_part_controller->ready) {
  ------------------
  |  Branch (2310:7): [True: 0, False: 65.7k]
  |  Branch (2310:25): [True: 65.7k, False: 0]
  ------------------
 2311|  65.7k|    return false;
 2312|  65.7k|  }
 2313|       |
 2314|       |  // Setup features.
 2315|      0|  aom_partition_features_t features;
 2316|      0|  features.id = AOM_EXT_PART_FEATURE_AFTER_SPLIT_PART2;
 2317|      0|  for (int i = 0; i < 9; ++i) {
  ------------------
  |  Branch (2317:19): [True: 0, False: 0]
  ------------------
 2318|      0|    features.after_part_split.f_prune_rect[i] = features_prune[i];
 2319|      0|  }
 2320|       |
 2321|       |  // Send necessary features to the external model.
 2322|      0|  av1_ext_part_send_features(ext_part_controller, &features);
 2323|       |
 2324|       |  // Get partition decisions from the external model.
 2325|      0|  aom_partition_decision_t decision;
 2326|      0|  const bool valid_decision =
 2327|      0|      av1_ext_part_get_partition_decision(ext_part_controller, &decision);
 2328|      0|  if (!valid_decision) return false;
  ------------------
  |  Branch (2328:7): [True: 0, False: 0]
  ------------------
 2329|       |
 2330|       |  // Populate decisions
 2331|      0|  *prune_rect_part_horz = decision.prune_rect_part[0];
 2332|      0|  *prune_rect_part_vert = decision.prune_rect_part[1];
 2333|       |
 2334|       |  return true;
 2335|      0|}
partition_strategy.c:simple_motion_search_get_best_ref:
  469|  3.46M|    unsigned int *best_var) {
  470|  3.46M|  const AV1_COMMON *const cm = &cpi->common;
  471|  3.46M|  int best_ref = -1;
  472|       |
  473|  3.46M|  if (mi_col >= cm->mi_params.mi_cols || mi_row >= cm->mi_params.mi_rows) {
  ------------------
  |  Branch (473:7): [True: 219k, False: 3.24M]
  |  Branch (473:42): [True: 239k, False: 3.00M]
  ------------------
  474|       |    // If the whole block is outside of the image, set the var and sse to 0.
  475|   459k|    *best_var = 0;
  476|   459k|    *best_sse = 0;
  477|       |
  478|   459k|    return best_ref;
  479|   459k|  }
  480|       |
  481|       |  // Otherwise do loop through the reference frames and find the one with the
  482|       |  // minimum SSE
  483|  3.00M|  const int num_planes = 1;
  484|       |
  485|  3.00M|  *best_sse = INT_MAX;
  486|       |
  487|  6.01M|  for (int ref_idx = 0; ref_idx < num_refs; ref_idx++) {
  ------------------
  |  Branch (487:25): [True: 3.00M, False: 3.00M]
  ------------------
  488|  3.00M|    const int ref = refs[ref_idx];
  489|       |
  490|  3.00M|    if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ref]) {
  ------------------
  |  Branch (490:9): [True: 3.00M, False: 18.4E]
  ------------------
  491|  3.00M|      const FULLPEL_MV *start_mvs = sms_tree->start_mvs;
  492|  3.00M|      unsigned int curr_sse = 0, curr_var = 0;
  493|  3.00M|      const int_mv best_mv = av1_simple_motion_search_sse_var(
  494|  3.00M|          cpi, x, mi_row, mi_col, bsize, ref, start_mvs[ref], num_planes,
  495|  3.00M|          use_subpixel, &curr_sse, &curr_var);
  496|  3.00M|      if (curr_sse < *best_sse) {
  ------------------
  |  Branch (496:11): [True: 3.00M, False: 18.4E]
  ------------------
  497|  3.00M|        *best_sse = curr_sse;
  498|  3.00M|        *best_var = curr_var;
  499|  3.00M|        best_ref = ref;
  500|  3.00M|      }
  501|       |
  502|  3.00M|      if (save_mv) {
  ------------------
  |  Branch (502:11): [True: 2.35M, False: 654k]
  ------------------
  503|  2.35M|        sms_tree->start_mvs[ref].row = best_mv.as_mv.row / 8;
  504|  2.35M|        sms_tree->start_mvs[ref].col = best_mv.as_mv.col / 8;
  505|       |
  506|  2.35M|        if (bsize >= BLOCK_8X8) {
  ------------------
  |  Branch (506:13): [True: 2.03M, False: 319k]
  ------------------
  507|  10.1M|          for (int r_idx = 0; r_idx < SUB_PARTITIONS_SPLIT; r_idx++) {
  ------------------
  |  |   49|  10.1M|#define SUB_PARTITIONS_SPLIT 4
  ------------------
  |  Branch (507:31): [True: 8.12M, False: 2.03M]
  ------------------
  508|       |            // Propagate the new motion vectors to a lower level
  509|  8.12M|            SIMPLE_MOTION_DATA_TREE *sub_tree = sms_tree->split[r_idx];
  510|  8.12M|            sub_tree->start_mvs[ref] = sms_tree->start_mvs[ref];
  511|  8.12M|          }
  512|  2.03M|        }
  513|  2.35M|      }
  514|  3.00M|    }
  515|  3.00M|  }
  516|       |
  517|  3.00M|  return best_ref;
  518|  3.46M|}
partition_strategy.c:init_simple_motion_search_mvs:
 2636|  24.2M|    SIMPLE_MOTION_DATA_TREE *sms_tree, const FULLPEL_MV *start_mvs) {
 2637|  24.2M|  memcpy(sms_tree->start_mvs, start_mvs, sizeof(sms_tree->start_mvs));
 2638|  24.2M|  av1_zero(sms_tree->sms_none_feat);
  ------------------
  |  |   43|  24.2M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2639|  24.2M|  av1_zero(sms_tree->sms_rect_feat);
  ------------------
  |  |   43|  24.2M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2640|  24.2M|  av1_zero(sms_tree->sms_none_valid);
  ------------------
  |  |   43|  24.2M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2641|  24.2M|  av1_zero(sms_tree->sms_rect_valid);
  ------------------
  |  |   43|  24.2M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2642|       |
 2643|  24.2M|  if (sms_tree->block_size >= BLOCK_8X8) {
  ------------------
  |  Branch (2643:7): [True: 6.05M, False: 18.1M]
  ------------------
 2644|  6.05M|    init_simple_motion_search_mvs(sms_tree->split[0], start_mvs);
 2645|  6.05M|    init_simple_motion_search_mvs(sms_tree->split[1], start_mvs);
 2646|  6.05M|    init_simple_motion_search_mvs(sms_tree->split[2], start_mvs);
 2647|  6.05M|    init_simple_motion_search_mvs(sms_tree->split[3], start_mvs);
 2648|  6.05M|  }
 2649|  24.2M|}

encodeframe.c:set_max_min_partition_size:
  218|  88.3k|                                              int mi_col) {
  219|  88.3k|  const AV1_COMMON *cm = &cpi->common;
  220|       |
  221|  88.3k|  sb_enc->max_partition_size =
  222|  88.3k|      AOMMIN(sf->part_sf.default_max_partition_size,
  ------------------
  |  |   34|  88.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 88.3k]
  |  |  ------------------
  ------------------
  223|  88.3k|             dim_to_size(cpi->oxcf.part_cfg.max_partition_size));
  224|  88.3k|  sb_enc->min_partition_size =
  225|  88.3k|      AOMMAX(sf->part_sf.default_min_partition_size,
  ------------------
  |  |   35|  88.3k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 88.3k]
  |  |  ------------------
  ------------------
  226|  88.3k|             dim_to_size(cpi->oxcf.part_cfg.min_partition_size));
  227|  88.3k|  sb_enc->max_partition_size =
  228|  88.3k|      AOMMIN(sb_enc->max_partition_size, cm->seq_params->sb_size);
  ------------------
  |  |   34|  88.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 88.3k]
  |  |  ------------------
  ------------------
  229|  88.3k|  sb_enc->min_partition_size =
  230|  88.3k|      AOMMIN(sb_enc->min_partition_size, cm->seq_params->sb_size);
  ------------------
  |  |   34|  88.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 88.2k, False: 131]
  |  |  ------------------
  ------------------
  231|       |
  232|  88.3k|  if (use_auto_max_partition(cpi, sb_size, mi_row, mi_col)) {
  ------------------
  |  Branch (232:7): [True: 0, False: 88.3k]
  ------------------
  233|      0|    float features[FEATURE_SIZE_MAX_MIN_PART_PRED] = { 0.0f };
  234|       |
  235|      0|    av1_get_max_min_partition_features(cpi, x, mi_row, mi_col, features);
  236|      0|    sb_enc->max_partition_size =
  237|      0|        AOMMAX(AOMMIN(av1_predict_max_partition(cpi, x, features),
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  |  Branch (35:25): [True: 0, False: 0]
  |  |  |  Branch (35:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  238|      0|                      sb_enc->max_partition_size),
  239|      0|               sb_enc->min_partition_size);
  240|      0|  }
  241|  88.3k|}
encodeframe.c:dim_to_size:
  202|   352k|static BLOCK_SIZE dim_to_size(int dim) {
  203|   352k|  switch (dim) {
  204|   176k|    case 4: return BLOCK_4X4;
  ------------------
  |  Branch (204:5): [True: 176k, False: 176k]
  ------------------
  205|      0|    case 8: return BLOCK_8X8;
  ------------------
  |  Branch (205:5): [True: 0, False: 352k]
  ------------------
  206|      0|    case 16: return BLOCK_16X16;
  ------------------
  |  Branch (206:5): [True: 0, False: 352k]
  ------------------
  207|      0|    case 32: return BLOCK_32X32;
  ------------------
  |  Branch (207:5): [True: 0, False: 352k]
  ------------------
  208|      0|    case 64: return BLOCK_64X64;
  ------------------
  |  Branch (208:5): [True: 0, False: 352k]
  ------------------
  209|   176k|    case 128: return BLOCK_128X128;
  ------------------
  |  Branch (209:5): [True: 176k, False: 176k]
  ------------------
  210|      0|    default: assert(0); return 0;
  ------------------
  |  Branch (210:5): [True: 0, False: 352k]
  ------------------
  211|   352k|  }
  212|   352k|}
encodeframe.c:use_auto_max_partition:
  187|  88.2k|                                         int mi_col) {
  188|  88.2k|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
  189|  88.2k|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
  190|  88.2k|  const AV1_COMMON *const cm = &cpi->common;
  191|  88.2k|  return !frame_is_intra_only(cm) && !cpi->use_screen_content_tools &&
  ------------------
  |  Branch (191:10): [True: 71.8k, False: 16.4k]
  |  Branch (191:38): [True: 62.6k, False: 9.20k]
  ------------------
  192|  62.6k|         cpi->sf.part_sf.auto_max_partition_based_on_simple_motion !=
  ------------------
  |  Branch (192:10): [True: 62.6k, False: 18.4E]
  ------------------
  193|  62.6k|             NOT_IN_USE &&
  194|  62.6k|         sb_size == BLOCK_128X128 &&
  ------------------
  |  Branch (194:10): [True: 0, False: 62.6k]
  ------------------
  195|      0|         is_full_sb(&cm->mi_params, mi_row, mi_col, sb_size) &&
  ------------------
  |  Branch (195:10): [True: 0, False: 0]
  ------------------
  196|      0|         cpi->ppi->gf_group.update_type[cpi->gf_frame_index] !=
  ------------------
  |  Branch (196:10): [True: 0, False: 0]
  ------------------
  197|      0|             OVERLAY_UPDATE &&
  198|      0|         cpi->ppi->gf_group.update_type[cpi->gf_frame_index] !=
  ------------------
  |  Branch (198:10): [True: 0, False: 0]
  ------------------
  199|      0|             INTNL_OVERLAY_UPDATE;
  200|  88.2k|}
partition_strategy.c:set_offsets_for_motion_search:
  128|   708k|                                                 BLOCK_SIZE bsize) {
  129|   708k|  const AV1_COMMON *const cm = &cpi->common;
  130|   708k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  131|   708k|  const int num_planes = av1_num_planes(cm);
  132|   708k|  MACROBLOCKD *const xd = &x->e_mbd;
  133|   708k|  const int mi_width = mi_size_wide[bsize];
  134|   708k|  const int mi_height = mi_size_high[bsize];
  135|       |
  136|   708k|  set_mode_info_offsets(&cpi->common.mi_params, &cpi->mbmi_ext_info, x, xd,
  137|   708k|                        mi_row, mi_col);
  138|       |
  139|       |  // Set up destination pointers.
  140|   708k|  av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
  141|   708k|                       num_planes);
  142|       |
  143|       |  // Set up limit values for MV components.
  144|       |  // Mv beyond the range do not produce new/different prediction block.
  145|   708k|  av1_set_mv_limits(mi_params, &x->mv_limits, mi_row, mi_col, mi_height,
  146|   708k|                    mi_width, cpi->oxcf.border_in_pixels);
  147|       |
  148|   708k|  set_plane_n4(xd, mi_width, mi_height, num_planes);
  149|       |
  150|   708k|  xd->mi_row = mi_row;
  151|   708k|  xd->mi_col = mi_col;
  152|       |
  153|       |  // Set up distance of MB to edge of frame in 1/8th pel units.
  154|   708k|  assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
  155|   708k|  xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE);
  ------------------
  |  |   29|   708k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  156|   708k|  xd->mb_to_bottom_edge =
  157|   708k|      GET_MV_SUBPEL((mi_params->mi_rows - mi_height - mi_row) * MI_SIZE);
  ------------------
  |  |   29|   708k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  158|   708k|  xd->mb_to_left_edge = -GET_MV_SUBPEL(mi_col * MI_SIZE);
  ------------------
  |  |   29|   708k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  159|   708k|  xd->mb_to_right_edge =
  160|   708k|      GET_MV_SUBPEL((mi_params->mi_cols - mi_width - mi_col) * MI_SIZE);
  ------------------
  |  |   29|   708k|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  161|       |
  162|       |  // Set up source buffers.
  163|   708k|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize);
  164|   708k|}
motion_search_facade.c:set_offsets_for_motion_search:
  128|  3.00M|                                                 BLOCK_SIZE bsize) {
  129|  3.00M|  const AV1_COMMON *const cm = &cpi->common;
  130|  3.00M|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  131|  3.00M|  const int num_planes = av1_num_planes(cm);
  132|  3.00M|  MACROBLOCKD *const xd = &x->e_mbd;
  133|  3.00M|  const int mi_width = mi_size_wide[bsize];
  134|  3.00M|  const int mi_height = mi_size_high[bsize];
  135|       |
  136|  3.00M|  set_mode_info_offsets(&cpi->common.mi_params, &cpi->mbmi_ext_info, x, xd,
  137|  3.00M|                        mi_row, mi_col);
  138|       |
  139|       |  // Set up destination pointers.
  140|  3.00M|  av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
  141|  3.00M|                       num_planes);
  142|       |
  143|       |  // Set up limit values for MV components.
  144|       |  // Mv beyond the range do not produce new/different prediction block.
  145|  3.00M|  av1_set_mv_limits(mi_params, &x->mv_limits, mi_row, mi_col, mi_height,
  146|  3.00M|                    mi_width, cpi->oxcf.border_in_pixels);
  147|       |
  148|  3.00M|  set_plane_n4(xd, mi_width, mi_height, num_planes);
  149|       |
  150|  3.00M|  xd->mi_row = mi_row;
  151|  3.00M|  xd->mi_col = mi_col;
  152|       |
  153|       |  // Set up distance of MB to edge of frame in 1/8th pel units.
  154|  3.00M|  assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
  155|  3.00M|  xd->mb_to_top_edge = -GET_MV_SUBPEL(mi_row * MI_SIZE);
  ------------------
  |  |   29|  3.00M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  156|  3.00M|  xd->mb_to_bottom_edge =
  157|  3.00M|      GET_MV_SUBPEL((mi_params->mi_rows - mi_height - mi_row) * MI_SIZE);
  ------------------
  |  |   29|  3.00M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  158|  3.00M|  xd->mb_to_left_edge = -GET_MV_SUBPEL(mi_col * MI_SIZE);
  ------------------
  |  |   29|  3.00M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  159|  3.00M|  xd->mb_to_right_edge =
  160|  3.00M|      GET_MV_SUBPEL((mi_params->mi_cols - mi_width - mi_col) * MI_SIZE);
  ------------------
  |  |   29|  3.00M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
  161|       |
  162|       |  // Set up source buffers.
  163|  3.00M|  av1_setup_src_planes(x, cpi->source, mi_row, mi_col, num_planes, bsize);
  164|  3.00M|}

av1_calc_arf_boost:
  738|  49.2k|                       int project_gfu_boost, const bool scale_max_boost) {
  739|  49.2k|  int i;
  740|  49.2k|  GF_GROUP_STATS gf_stats;
  741|  49.2k|  init_gf_stats(&gf_stats);
  742|  49.2k|  double boost_score = (double)NORMAL_BOOST;
  ------------------
  |  |   26|  49.2k|#define NORMAL_BOOST 100
  ------------------
  743|  49.2k|  int arf_boost;
  744|  49.2k|  int flash_detected = 0;
  745|  49.2k|  if (num_fpstats_used) *num_fpstats_used = 0;
  ------------------
  |  Branch (745:7): [True: 0, False: 49.2k]
  ------------------
  746|       |
  747|       |  // Search forward from the proposed arf/next gf position.
  748|  49.2k|  for (i = 0; i < f_frames; ++i) {
  ------------------
  |  Branch (748:15): [True: 49.2k, False: 0]
  ------------------
  749|  49.2k|    const FIRSTPASS_STATS *this_frame =
  750|  49.2k|        read_frame_stats(twopass, twopass_frame, i + offset);
  751|  49.2k|    if (this_frame == NULL) break;
  ------------------
  |  Branch (751:9): [True: 49.2k, False: 0]
  ------------------
  752|       |
  753|       |    // Update the motion related elements to the boost calculation.
  754|      0|    accumulate_frame_motion_stats(this_frame, &gf_stats,
  755|      0|                                  frame_info->frame_width,
  756|      0|                                  frame_info->frame_height);
  757|       |
  758|       |    // We want to discount the flash frame itself and the recovery
  759|       |    // frame that follows as both will have poor scores.
  760|      0|    flash_detected = detect_flash(twopass, twopass_frame, i + offset) ||
  ------------------
  |  Branch (760:22): [True: 0, False: 0]
  ------------------
  761|      0|                     detect_flash(twopass, twopass_frame, i + offset + 1);
  ------------------
  |  Branch (761:22): [True: 0, False: 0]
  ------------------
  762|       |
  763|       |    // Accumulate the effect of prediction quality decay.
  764|      0|    if (!flash_detected) {
  ------------------
  |  Branch (764:9): [True: 0, False: 0]
  ------------------
  765|      0|      gf_stats.decay_accumulator *= get_prediction_decay_rate(this_frame);
  766|      0|      gf_stats.decay_accumulator = gf_stats.decay_accumulator < MIN_DECAY_FACTOR
  ------------------
  |  |  732|      0|#define MIN_DECAY_FACTOR 0.01
  ------------------
  |  Branch (766:36): [True: 0, False: 0]
  ------------------
  767|      0|                                       ? MIN_DECAY_FACTOR
  ------------------
  |  |  732|      0|#define MIN_DECAY_FACTOR 0.01
  ------------------
  768|      0|                                       : gf_stats.decay_accumulator;
  769|      0|    }
  770|       |
  771|      0|    boost_score += gf_stats.decay_accumulator *
  772|      0|                   calc_frame_boost(p_rc, frame_info, this_frame,
  773|      0|                                    gf_stats.this_frame_mv_in_out, GF_MAX_BOOST,
  ------------------
  |  |  730|      0|#define GF_MAX_BOOST 90.0
  ------------------
  774|      0|                                    scale_max_boost);
  775|      0|    if (num_fpstats_used) (*num_fpstats_used)++;
  ------------------
  |  Branch (775:9): [True: 0, False: 0]
  ------------------
  776|      0|  }
  777|       |
  778|  49.2k|  arf_boost = (int)boost_score;
  779|       |
  780|       |  // Reset for backward looking loop.
  781|  49.2k|  boost_score = 0.0;
  782|  49.2k|  init_gf_stats(&gf_stats);
  783|       |  // Search backward towards last gf position.
  784|  49.2k|  for (i = -1; i >= -b_frames; --i) {
  ------------------
  |  Branch (784:16): [True: 0, False: 49.2k]
  ------------------
  785|      0|    const FIRSTPASS_STATS *this_frame =
  786|      0|        read_frame_stats(twopass, twopass_frame, i + offset);
  787|      0|    if (this_frame == NULL) break;
  ------------------
  |  Branch (787:9): [True: 0, False: 0]
  ------------------
  788|       |
  789|       |    // Update the motion related elements to the boost calculation.
  790|      0|    accumulate_frame_motion_stats(this_frame, &gf_stats,
  791|      0|                                  frame_info->frame_width,
  792|      0|                                  frame_info->frame_height);
  793|       |
  794|       |    // We want to discount the the flash frame itself and the recovery
  795|       |    // frame that follows as both will have poor scores.
  796|      0|    flash_detected = detect_flash(twopass, twopass_frame, i + offset) ||
  ------------------
  |  Branch (796:22): [True: 0, False: 0]
  ------------------
  797|      0|                     detect_flash(twopass, twopass_frame, i + offset + 1);
  ------------------
  |  Branch (797:22): [True: 0, False: 0]
  ------------------
  798|       |
  799|       |    // Cumulative effect of prediction quality decay.
  800|      0|    if (!flash_detected) {
  ------------------
  |  Branch (800:9): [True: 0, False: 0]
  ------------------
  801|      0|      gf_stats.decay_accumulator *= get_prediction_decay_rate(this_frame);
  802|      0|      gf_stats.decay_accumulator = gf_stats.decay_accumulator < MIN_DECAY_FACTOR
  ------------------
  |  |  732|      0|#define MIN_DECAY_FACTOR 0.01
  ------------------
  |  Branch (802:36): [True: 0, False: 0]
  ------------------
  803|      0|                                       ? MIN_DECAY_FACTOR
  ------------------
  |  |  732|      0|#define MIN_DECAY_FACTOR 0.01
  ------------------
  804|      0|                                       : gf_stats.decay_accumulator;
  805|      0|    }
  806|       |
  807|      0|    boost_score += gf_stats.decay_accumulator *
  808|      0|                   calc_frame_boost(p_rc, frame_info, this_frame,
  809|      0|                                    gf_stats.this_frame_mv_in_out, GF_MAX_BOOST,
  ------------------
  |  |  730|      0|#define GF_MAX_BOOST 90.0
  ------------------
  810|      0|                                    scale_max_boost);
  811|      0|    if (num_fpstats_used) (*num_fpstats_used)++;
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|      0|  }
  813|  49.2k|  arf_boost += (int)boost_score;
  814|       |
  815|  49.2k|  if (project_gfu_boost) {
  ------------------
  |  Branch (815:7): [True: 0, False: 49.2k]
  ------------------
  816|      0|    assert(num_fpstats_required != NULL);
  817|      0|    assert(num_fpstats_used != NULL);
  818|      0|    *num_fpstats_required = f_frames + b_frames;
  819|      0|    arf_boost = get_projected_gfu_boost(p_rc, arf_boost, *num_fpstats_required,
  820|      0|                                        *num_fpstats_used);
  821|      0|  }
  822|       |
  823|  49.2k|  if (arf_boost < ((b_frames + f_frames) * GF_MIN_BOOST))
  ------------------
  |  |  731|  49.2k|#define GF_MIN_BOOST 50
  ------------------
  |  Branch (823:7): [True: 0, False: 49.2k]
  ------------------
  824|      0|    arf_boost = ((b_frames + f_frames) * GF_MIN_BOOST);
  ------------------
  |  |  731|      0|#define GF_MIN_BOOST 50
  ------------------
  825|       |
  826|  49.2k|  return arf_boost;
  827|  49.2k|}
av1_setup_target_rate:
 3717|  86.1k|void av1_setup_target_rate(AV1_COMP *cpi) {
 3718|  86.1k|  RATE_CONTROL *const rc = &cpi->rc;
 3719|  86.1k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 3720|       |
 3721|  86.1k|  int target_rate = gf_group->bit_allocation[cpi->gf_frame_index];
 3722|       |
 3723|  86.1k|  if (has_no_stats_stage(cpi)) {
  ------------------
  |  Branch (3723:7): [True: 86.1k, False: 0]
  ------------------
 3724|  86.1k|    av1_rc_set_frame_target(cpi, target_rate, cpi->common.width,
 3725|  86.1k|                            cpi->common.height);
 3726|  86.1k|  }
 3727|       |
 3728|  86.1k|  rc->base_frame_target = target_rate;
 3729|  86.1k|}
av1_get_second_pass_params:
 4005|  49.2k|                                unsigned int frame_flags) {
 4006|  49.2k|  RATE_CONTROL *const rc = &cpi->rc;
 4007|  49.2k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 4008|  49.2k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
 4009|  49.2k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 4010|  49.2k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 4011|       |
 4012|  49.2k|  if (is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (4012:7): [True: 0, False: 49.2k]
  ------------------
 4013|      0|    get_one_pass_rt_lag_params(cpi, frame_flags, frame_params);
 4014|      0|    return;
 4015|      0|  }
 4016|       |
 4017|  49.2k|  if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (4017:7): [True: 0, False: 49.2k]
  ------------------
 4018|      0|      (cpi->ext_ratectrl.funcs.rc_type & AOM_RC_GOP) != 0 &&
  ------------------
  |  Branch (4018:7): [True: 0, False: 0]
  ------------------
 4019|      0|      cpi->ext_ratectrl.funcs.get_gop_decision != NULL) {
  ------------------
  |  Branch (4019:7): [True: 0, False: 0]
  ------------------
 4020|      0|    frame_params->show_frame =
 4021|      0|        !(gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE ||
  ------------------
  |  Branch (4021:11): [True: 0, False: 0]
  ------------------
 4022|      0|          gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE);
  ------------------
  |  Branch (4022:11): [True: 0, False: 0]
  ------------------
 4023|      0|  }
 4024|       |
 4025|  49.2k|  if (cpi->use_ducky_encode &&
  ------------------
  |  Branch (4025:7): [True: 0, False: 49.2k]
  ------------------
 4026|      0|      cpi->ducky_encode_info.frame_info.gop_mode == DUCKY_ENCODE_GOP_MODE_RCL) {
  ------------------
  |  Branch (4026:7): [True: 0, False: 0]
  ------------------
 4027|      0|    frame_params->frame_type = gf_group->frame_type[cpi->gf_frame_index];
 4028|      0|    frame_params->show_frame =
 4029|      0|        !(gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE ||
  ------------------
  |  Branch (4029:11): [True: 0, False: 0]
  ------------------
 4030|      0|          gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE);
  ------------------
  |  Branch (4030:11): [True: 0, False: 0]
  ------------------
 4031|      0|    if (cpi->gf_frame_index == 0) {
  ------------------
  |  Branch (4031:9): [True: 0, False: 0]
  ------------------
 4032|      0|      av1_tf_info_reset(&cpi->ppi->tf_info);
 4033|      0|      av1_tf_info_filtering(&cpi->ppi->tf_info, cpi, gf_group);
 4034|      0|    }
 4035|      0|    return;
 4036|      0|  }
 4037|       |
 4038|  49.2k|  if (cpi->common.current_frame.frame_number == 0 &&
  ------------------
  |  Branch (4038:7): [True: 12.3k, False: 36.9k]
  ------------------
 4039|  12.3k|      cpi->ext_ratectrl.funcs.send_firstpass_stats != NULL) {
  ------------------
  |  Branch (4039:7): [True: 0, False: 12.3k]
  ------------------
 4040|      0|    const aom_codec_err_t codec_status = av1_extrc_send_firstpass_stats(
 4041|      0|        &cpi->ext_ratectrl, &cpi->ppi->twopass.firstpass_info);
 4042|      0|    if (codec_status != AOM_CODEC_OK) {
  ------------------
  |  Branch (4042:9): [True: 0, False: 0]
  ------------------
 4043|      0|      aom_internal_error(cpi->common.error, codec_status,
 4044|      0|                         "av1_extrc_send_firstpass_stats() failed");
 4045|      0|    }
 4046|      0|  }
 4047|       |
 4048|  49.2k|  const FIRSTPASS_STATS *const start_pos = cpi->twopass_frame.stats_in;
 4049|  49.2k|  int update_total_stats = 0;
 4050|       |
 4051|  49.2k|  if (is_stat_consumption_stage(cpi) && !cpi->twopass_frame.stats_in) return;
  ------------------
  |  Branch (4051:7): [True: 0, False: 49.2k]
  |  Branch (4051:41): [True: 0, False: 0]
  ------------------
 4052|       |
 4053|       |  // Check forced key frames.
 4054|  49.2k|  const int frames_to_next_forced_key = detect_app_forced_key(cpi);
 4055|  49.2k|  if (frames_to_next_forced_key == 0) {
  ------------------
  |  Branch (4055:7): [True: 0, False: 49.2k]
  ------------------
 4056|      0|    rc->frames_to_key = 0;
 4057|      0|    frame_flags &= FRAMEFLAGS_KEY;
 4058|  49.2k|  } else if (frames_to_next_forced_key > 0 &&
  ------------------
  |  Branch (4058:14): [True: 0, False: 49.2k]
  ------------------
 4059|      0|             frames_to_next_forced_key < rc->frames_to_key) {
  ------------------
  |  Branch (4059:14): [True: 0, False: 0]
  ------------------
 4060|      0|    rc->frames_to_key = frames_to_next_forced_key;
 4061|      0|  }
 4062|       |
 4063|  49.2k|  assert(cpi->twopass_frame.stats_in != NULL);
 4064|  49.2k|  const int update_type = gf_group->update_type[cpi->gf_frame_index];
 4065|  49.2k|  frame_params->frame_type = gf_group->frame_type[cpi->gf_frame_index];
 4066|       |
 4067|  49.2k|  if (cpi->gf_frame_index < gf_group->size && !(frame_flags & FRAMEFLAGS_KEY)) {
  ------------------
  |  Branch (4067:7): [True: 36.9k, False: 12.3k]
  |  Branch (4067:47): [True: 36.9k, False: 0]
  ------------------
 4068|  36.9k|    assert(cpi->gf_frame_index < gf_group->size);
 4069|       |
 4070|  36.9k|    av1_setup_target_rate(cpi);
 4071|       |
 4072|       |    // If this is an arf frame then we dont want to read the stats file or
 4073|       |    // advance the input pointer as we already have what we need.
 4074|  36.9k|    if (update_type == ARF_UPDATE || update_type == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (4074:9): [True: 0, False: 36.9k]
  |  Branch (4074:38): [True: 0, False: 36.9k]
  ------------------
 4075|      0|      const FIRSTPASS_STATS *const this_frame_ptr =
 4076|      0|          read_frame_stats(twopass, &cpi->twopass_frame,
 4077|      0|                           gf_group->arf_src_offset[cpi->gf_frame_index]);
 4078|      0|      set_twopass_params_based_on_fp_stats(cpi, this_frame_ptr);
 4079|      0|      return;
 4080|      0|    }
 4081|  36.9k|  }
 4082|       |
 4083|  49.2k|  if (oxcf->rc_cfg.mode == AOM_Q)
  ------------------
  |  Branch (4083:7): [True: 49.2k, False: 0]
  ------------------
 4084|  49.2k|    rc->active_worst_quality = oxcf->rc_cfg.cq_level;
 4085|       |
 4086|  49.2k|  if (cpi->gf_frame_index == gf_group->size) {
  ------------------
  |  Branch (4086:7): [True: 12.3k, False: 36.9k]
  ------------------
 4087|  12.3k|    if (cpi->ppi->lap_enabled && cpi->ppi->p_rc.enable_scenecut_detection) {
  ------------------
  |  Branch (4087:9): [True: 0, False: 12.3k]
  |  Branch (4087:34): [True: 0, False: 0]
  ------------------
 4088|      0|      const int num_frames_to_detect_scenecut = MAX_GF_LENGTH_LAP + 1;
  ------------------
  |  |   47|      0|#define MAX_GF_LENGTH_LAP 16
  ------------------
 4089|      0|      const int frames_to_key = define_kf_interval(
 4090|      0|          cpi, &twopass->firstpass_info, num_frames_to_detect_scenecut,
 4091|      0|          /*search_start_idx=*/0);
 4092|      0|      if (frames_to_key != -1)
  ------------------
  |  Branch (4092:11): [True: 0, False: 0]
  ------------------
 4093|      0|        rc->frames_to_key = AOMMIN(rc->frames_to_key, frames_to_key);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4094|      0|    }
 4095|  12.3k|  }
 4096|       |
 4097|  49.2k|  FIRSTPASS_STATS this_frame;
 4098|  49.2k|  av1_zero(this_frame);
  ------------------
  |  |   43|  49.2k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4099|       |  // call above fn
 4100|  49.2k|  if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (4100:7): [True: 0, False: 49.2k]
  ------------------
 4101|      0|    if (cpi->gf_frame_index < gf_group->size || rc->frames_to_key == 0) {
  ------------------
  |  Branch (4101:9): [True: 0, False: 0]
  |  Branch (4101:49): [True: 0, False: 0]
  ------------------
 4102|      0|      process_first_pass_stats(cpi, &this_frame);
 4103|      0|      update_total_stats = 1;
 4104|      0|    }
 4105|  49.2k|  } else {
 4106|  49.2k|    rc->active_worst_quality = oxcf->rc_cfg.cq_level;
 4107|  49.2k|  }
 4108|       |
 4109|       |  // Keyframe and section processing.
 4110|  49.2k|  FIRSTPASS_STATS this_frame_copy;
 4111|  49.2k|  this_frame_copy = this_frame;
 4112|  49.2k|  if (rc->frames_to_key <= 0) {
  ------------------
  |  Branch (4112:7): [True: 12.3k, False: 36.9k]
  ------------------
 4113|  12.3k|    assert(rc->frames_to_key == 0);
 4114|       |    // Define next KF group and assign bits to it.
 4115|  12.3k|    frame_params->frame_type = KEY_FRAME;
 4116|  12.3k|    find_next_key_frame(cpi, &this_frame);
 4117|  12.3k|    this_frame = this_frame_copy;
 4118|       |    // Mark prev gop arf source as unusable
 4119|  12.3k|    cpi->ppi->tpl_data.prev_gop_arf_disp_order = -1;
 4120|  12.3k|  }
 4121|       |
 4122|  49.2k|  if (rc->frames_to_fwd_kf <= 0)
  ------------------
  |  Branch (4122:7): [True: 49.2k, False: 0]
  ------------------
 4123|  49.2k|    rc->frames_to_fwd_kf = oxcf->kf_cfg.fwd_kf_dist;
 4124|       |
 4125|       |  // Define a new GF/ARF group. (Should always enter here for key frames).
 4126|  49.2k|  if (cpi->gf_frame_index == gf_group->size) {
  ------------------
  |  Branch (4126:7): [True: 12.3k, False: 36.9k]
  ------------------
 4127|  12.3k|    av1_tf_info_reset(&cpi->ppi->tf_info);
 4128|       |#if CONFIG_BITRATE_ACCURACY && !CONFIG_THREE_PASS
 4129|       |    vbr_rc_reset_gop_data(&cpi->vbr_rc_info);
 4130|       |#endif  // CONFIG_BITRATE_ACCURACY
 4131|  12.3k|    int max_gop_length =
 4132|  12.3k|        (oxcf->gf_cfg.lag_in_frames >= 32)
  ------------------
  |  Branch (4132:9): [True: 0, False: 12.3k]
  ------------------
 4133|  12.3k|            ? AOMMIN(MAX_GF_INTERVAL, oxcf->gf_cfg.lag_in_frames -
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4134|  12.3k|                                          oxcf->algo_cfg.arnr_max_frames / 2)
 4135|  12.3k|            : MAX_GF_LENGTH_LAP;
  ------------------
  |  |   47|  12.3k|#define MAX_GF_LENGTH_LAP 16
  ------------------
 4136|       |
 4137|       |    // Handle forward key frame when enabled.
 4138|  12.3k|    if (oxcf->kf_cfg.fwd_kf_dist > 0)
  ------------------
  |  Branch (4138:9): [True: 0, False: 12.3k]
  ------------------
 4139|      0|      max_gop_length = AOMMIN(rc->frames_to_fwd_kf + 1, max_gop_length);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4140|       |
 4141|       |    // Use the provided gop size in low delay setting
 4142|  12.3k|    if (oxcf->gf_cfg.lag_in_frames == 0) max_gop_length = rc->max_gf_interval;
  ------------------
  |  Branch (4142:9): [True: 12.3k, False: 0]
  ------------------
 4143|       |
 4144|       |    // Limit the max gop length for the last gop in 1 pass setting.
 4145|  12.3k|    max_gop_length = AOMMIN(max_gop_length, rc->frames_to_key);
  ------------------
  |  |   34|  12.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 12.3k]
  |  |  ------------------
  ------------------
 4146|       |
 4147|       |    // Identify regions if needed.
 4148|       |    // TODO(bohanli): identify regions for all stats available.
 4149|  12.3k|    if (rc->frames_since_key == 0 || rc->frames_since_key == 1 ||
  ------------------
  |  Branch (4149:9): [True: 12.3k, False: 0]
  |  Branch (4149:38): [True: 0, False: 0]
  ------------------
 4150|      0|        (p_rc->frames_till_regions_update - rc->frames_since_key <
  ------------------
  |  Branch (4150:10): [True: 0, False: 0]
  ------------------
 4151|      0|             rc->frames_to_key &&
 4152|      0|         p_rc->frames_till_regions_update - rc->frames_since_key <
  ------------------
  |  Branch (4152:10): [True: 0, False: 0]
  ------------------
 4153|  12.3k|             max_gop_length + 1)) {
 4154|       |      // how many frames we can analyze from this frame
 4155|  12.3k|      int rest_frames =
 4156|  12.3k|          AOMMIN(rc->frames_to_key, MAX_FIRSTPASS_ANALYSIS_FRAMES);
  ------------------
  |  |   34|  12.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 12.3k, False: 0]
  |  |  ------------------
  ------------------
 4157|  12.3k|      int available_frames = (int)(twopass->stats_buf_ctx->stats_in_end -
 4158|  12.3k|                                   cpi->twopass_frame.stats_in);
 4159|  12.3k|      if (!cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (4159:11): [True: 12.3k, False: 0]
  ------------------
 4160|  12.3k|        available_frames += (rc->frames_since_key == 0);
 4161|  12.3k|      }
 4162|  12.3k|      rest_frames = AOMMIN(rest_frames, available_frames);
  ------------------
  |  |   34|  12.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 12.3k]
  |  |  ------------------
  ------------------
 4163|  12.3k|      p_rc->frames_till_regions_update = rest_frames;
 4164|       |
 4165|  12.3k|      int ret;
 4166|  12.3k|      if (cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (4166:11): [True: 0, False: 12.3k]
  ------------------
 4167|      0|        mark_flashes(twopass->stats_buf_ctx->stats_in_start,
 4168|      0|                     twopass->stats_buf_ctx->stats_in_end);
 4169|      0|        estimate_noise(twopass->stats_buf_ctx->stats_in_start,
 4170|      0|                       twopass->stats_buf_ctx->stats_in_end, cpi->common.error);
 4171|      0|        estimate_coeff(twopass->stats_buf_ctx->stats_in_start,
 4172|      0|                       twopass->stats_buf_ctx->stats_in_end);
 4173|      0|        ret = identify_regions(cpi->twopass_frame.stats_in, rest_frames, 0,
 4174|      0|                               p_rc->regions, &p_rc->num_regions);
 4175|  12.3k|      } else {
 4176|  12.3k|        ret = identify_regions(
 4177|  12.3k|            cpi->twopass_frame.stats_in - (rc->frames_since_key == 0),
 4178|  12.3k|            rest_frames, 0, p_rc->regions, &p_rc->num_regions);
 4179|  12.3k|      }
 4180|  12.3k|      if (ret == -1) {
  ------------------
  |  Branch (4180:11): [True: 0, False: 12.3k]
  ------------------
 4181|      0|        aom_internal_error(cpi->common.error, AOM_CODEC_MEM_ERROR,
 4182|      0|                           "Error allocating buffers in identify_regions");
 4183|      0|      }
 4184|  12.3k|    }
 4185|       |
 4186|  12.3k|    int cur_region_idx =
 4187|  12.3k|        find_regions_index(p_rc->regions, p_rc->num_regions,
 4188|  12.3k|                           rc->frames_since_key - p_rc->regions_offset);
 4189|  12.3k|    if ((cur_region_idx >= 0 &&
  ------------------
  |  Branch (4189:10): [True: 0, False: 12.3k]
  ------------------
 4190|      0|         p_rc->regions[cur_region_idx].type == SCENECUT_REGION) ||
  ------------------
  |  Branch (4190:10): [True: 0, False: 0]
  ------------------
 4191|  12.3k|        rc->frames_since_key == 0) {
  ------------------
  |  Branch (4191:9): [True: 12.3k, False: 0]
  ------------------
 4192|       |      // If we start from a scenecut, then the last GOP's arf boost is not
 4193|       |      // needed for this GOP.
 4194|  12.3k|      cpi->ppi->gf_state.arf_gf_boost_lst = 0;
 4195|  12.3k|    }
 4196|       |
 4197|  12.3k|    int need_gf_len = 1;
 4198|       |#if CONFIG_THREE_PASS
 4199|       |    if (cpi->third_pass_ctx && oxcf->pass == AOM_RC_THIRD_PASS) {
 4200|       |      // set up bitstream to read
 4201|       |      if (!cpi->third_pass_ctx->input_file_name && oxcf->two_pass_output) {
 4202|       |        cpi->third_pass_ctx->input_file_name = oxcf->two_pass_output;
 4203|       |      }
 4204|       |      av1_open_second_pass_log(cpi, 1);
 4205|       |      THIRD_PASS_GOP_INFO *gop_info = &cpi->third_pass_ctx->gop_info;
 4206|       |      // Read in GOP information from the second pass file.
 4207|       |      av1_read_second_pass_gop_info(cpi->second_pass_log_stream, gop_info,
 4208|       |                                    cpi->common.error);
 4209|       |#if CONFIG_BITRATE_ACCURACY
 4210|       |      TPL_INFO *tpl_info;
 4211|       |      AOM_CHECK_MEM_ERROR(cpi->common.error, tpl_info,
 4212|       |                          aom_malloc(sizeof(*tpl_info)));
 4213|       |      av1_read_tpl_info(tpl_info, cpi->second_pass_log_stream,
 4214|       |                        cpi->common.error);
 4215|       |      aom_free(tpl_info);
 4216|       |#if CONFIG_THREE_PASS
 4217|       |      // TODO(angiebird): Put this part into a func
 4218|       |      cpi->vbr_rc_info.cur_gop_idx++;
 4219|       |#endif  // CONFIG_THREE_PASS
 4220|       |#endif  // CONFIG_BITRATE_ACCURACY
 4221|       |      // Read in third_pass_info from the bitstream.
 4222|       |      av1_set_gop_third_pass(cpi->third_pass_ctx);
 4223|       |      // Read in per-frame info from second-pass encoding
 4224|       |      av1_read_second_pass_per_frame_info(
 4225|       |          cpi->second_pass_log_stream, cpi->third_pass_ctx->frame_info,
 4226|       |          gop_info->num_frames, cpi->common.error);
 4227|       |
 4228|       |      p_rc->cur_gf_index = 0;
 4229|       |      p_rc->gf_intervals[0] = cpi->third_pass_ctx->gop_info.gf_length;
 4230|       |      need_gf_len = 0;
 4231|       |    }
 4232|       |#endif  // CONFIG_THREE_PASS
 4233|       |
 4234|  12.3k|    if (need_gf_len) {
  ------------------
  |  Branch (4234:9): [True: 12.3k, False: 0]
  ------------------
 4235|       |      // If we cannot obtain GF group length from second_pass_file
 4236|       |      // TODO(jingning): Resolve the redundant calls here.
 4237|  12.3k|      if (rc->intervals_till_gf_calculate_due == 0 || 1) {
  ------------------
  |  Branch (4237:11): [True: 12.3k, False: 0]
  |  Branch (4237:55): [True: 0, Folded]
  ------------------
 4238|  12.3k|        calculate_gf_length(cpi, max_gop_length, MAX_NUM_GF_INTERVALS);
  ------------------
  |  |   52|  12.3k|#define MAX_NUM_GF_INTERVALS 15
  ------------------
 4239|  12.3k|      }
 4240|  12.3k|      if (max_gop_length > 16 && oxcf->algo_cfg.enable_tpl_model &&
  ------------------
  |  Branch (4240:11): [True: 0, False: 12.3k]
  |  Branch (4240:34): [True: 0, False: 0]
  ------------------
 4241|      0|          oxcf->gf_cfg.lag_in_frames >= 32 &&
  ------------------
  |  Branch (4241:11): [True: 0, False: 0]
  ------------------
 4242|      0|          cpi->sf.tpl_sf.gop_length_decision_method != 3) {
  ------------------
  |  Branch (4242:11): [True: 0, False: 0]
  ------------------
 4243|      0|        int this_idx = rc->frames_since_key +
 4244|      0|                       p_rc->gf_intervals[p_rc->cur_gf_index] -
 4245|      0|                       p_rc->regions_offset - 1;
 4246|      0|        int this_region =
 4247|      0|            find_regions_index(p_rc->regions, p_rc->num_regions, this_idx);
 4248|      0|        int next_region =
 4249|      0|            find_regions_index(p_rc->regions, p_rc->num_regions, this_idx + 1);
 4250|       |        // TODO(angiebird): Figure out why this_region and next_region are -1 in
 4251|       |        // unit test like AltRefFramePresenceTestLarge (aomedia:3134)
 4252|      0|        int is_last_scenecut =
 4253|      0|            p_rc->gf_intervals[p_rc->cur_gf_index] >= rc->frames_to_key ||
  ------------------
  |  Branch (4253:13): [True: 0, False: 0]
  ------------------
 4254|      0|            (this_region != -1 &&
  ------------------
  |  Branch (4254:14): [True: 0, False: 0]
  ------------------
 4255|      0|             p_rc->regions[this_region].type == SCENECUT_REGION) ||
  ------------------
  |  Branch (4255:14): [True: 0, False: 0]
  ------------------
 4256|      0|            (next_region != -1 &&
  ------------------
  |  Branch (4256:14): [True: 0, False: 0]
  ------------------
 4257|      0|             p_rc->regions[next_region].type == SCENECUT_REGION);
  ------------------
  |  Branch (4257:14): [True: 0, False: 0]
  ------------------
 4258|       |
 4259|      0|        int ori_gf_int = p_rc->gf_intervals[p_rc->cur_gf_index];
 4260|       |
 4261|      0|        if (p_rc->gf_intervals[p_rc->cur_gf_index] > 16 &&
  ------------------
  |  Branch (4261:13): [True: 0, False: 0]
  ------------------
 4262|      0|            rc->min_gf_interval <= 16) {
  ------------------
  |  Branch (4262:13): [True: 0, False: 0]
  ------------------
 4263|       |          // The calculate_gf_length function is previously used with
 4264|       |          // max_gop_length = 32 with look-ahead gf intervals.
 4265|      0|          define_gf_group(cpi, frame_params, 0);
 4266|      0|          av1_tf_info_filtering(&cpi->ppi->tf_info, cpi, gf_group);
 4267|      0|          this_frame = this_frame_copy;
 4268|       |
 4269|      0|          if (is_shorter_gf_interval_better(cpi, frame_params)) {
  ------------------
  |  Branch (4269:15): [True: 0, False: 0]
  ------------------
 4270|       |            // A shorter gf interval is better.
 4271|       |            // TODO(jingning): Remove redundant computations here.
 4272|      0|            max_gop_length = 16;
 4273|      0|            calculate_gf_length(cpi, max_gop_length, 1);
 4274|      0|            if (is_last_scenecut &&
  ------------------
  |  Branch (4274:17): [True: 0, False: 0]
  ------------------
 4275|      0|                (ori_gf_int - p_rc->gf_intervals[p_rc->cur_gf_index] < 4)) {
  ------------------
  |  Branch (4275:17): [True: 0, False: 0]
  ------------------
 4276|      0|              p_rc->gf_intervals[p_rc->cur_gf_index] = ori_gf_int;
 4277|      0|            }
 4278|      0|          }
 4279|      0|        }
 4280|      0|      }
 4281|  12.3k|    }
 4282|       |
 4283|  12.3k|    define_gf_group(cpi, frame_params, 0);
 4284|       |
 4285|  12.3k|    if (gf_group->update_type[cpi->gf_frame_index] != ARF_UPDATE &&
  ------------------
  |  Branch (4285:9): [True: 12.3k, False: 0]
  ------------------
 4286|  12.3k|        rc->frames_since_key > 0)
  ------------------
  |  Branch (4286:9): [True: 0, False: 12.3k]
  ------------------
 4287|      0|      process_first_pass_stats(cpi, &this_frame);
 4288|       |
 4289|  12.3k|    define_gf_group(cpi, frame_params, 1);
 4290|       |
 4291|       |#if CONFIG_THREE_PASS
 4292|       |    // write gop info if needed for third pass. Per-frame info is written after
 4293|       |    // each frame is encoded.
 4294|       |    av1_write_second_pass_gop_info(cpi);
 4295|       |#endif  // CONFIG_THREE_PASS
 4296|       |
 4297|  12.3k|    av1_tf_info_filtering(&cpi->ppi->tf_info, cpi, gf_group);
 4298|       |
 4299|  12.3k|    rc->frames_till_gf_update_due = p_rc->baseline_gf_interval;
 4300|  12.3k|    assert(cpi->gf_frame_index == 0);
 4301|       |#if ARF_STATS_OUTPUT
 4302|       |    {
 4303|       |      FILE *fpfile;
 4304|       |      fpfile = fopen("arf.stt", "a");
 4305|       |      ++arf_count;
 4306|       |      fprintf(fpfile, "%10d %10d %10d %10d %10d\n",
 4307|       |              cpi->common.current_frame.frame_number,
 4308|       |              rc->frames_till_gf_update_due, cpi->ppi->p_rc.kf_boost, arf_count,
 4309|       |              p_rc->gfu_boost);
 4310|       |
 4311|       |      fclose(fpfile);
 4312|       |    }
 4313|       |#endif
 4314|  12.3k|  }
 4315|  49.2k|  assert(cpi->gf_frame_index < gf_group->size);
 4316|       |
 4317|  49.2k|  if (gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE ||
  ------------------
  |  Branch (4317:7): [True: 0, False: 49.2k]
  ------------------
 4318|  49.2k|      gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE) {
  ------------------
  |  Branch (4318:7): [True: 0, False: 49.2k]
  ------------------
 4319|      0|    reset_fpf_position(&cpi->twopass_frame, start_pos);
 4320|       |
 4321|      0|    const FIRSTPASS_STATS *const this_frame_ptr =
 4322|      0|        read_frame_stats(twopass, &cpi->twopass_frame,
 4323|      0|                         gf_group->arf_src_offset[cpi->gf_frame_index]);
 4324|      0|    set_twopass_params_based_on_fp_stats(cpi, this_frame_ptr);
 4325|  49.2k|  } else {
 4326|       |    // Back up this frame's stats for updating total stats during post encode.
 4327|  49.2k|    cpi->twopass_frame.this_frame = update_total_stats ? start_pos : NULL;
  ------------------
  |  Branch (4327:37): [True: 0, False: 49.2k]
  ------------------
 4328|  49.2k|  }
 4329|       |
 4330|  49.2k|  frame_params->frame_type = gf_group->frame_type[cpi->gf_frame_index];
 4331|  49.2k|  av1_setup_target_rate(cpi);
 4332|  49.2k|}
pass2_strategy.c:read_frame_stats:
  142|  49.2k|                                               int offset) {
  143|  49.2k|  if ((offset >= 0 &&
  ------------------
  |  Branch (143:8): [True: 49.2k, False: 0]
  ------------------
  144|  49.2k|       p_frame->stats_in + offset >= p->stats_buf_ctx->stats_in_end) ||
  ------------------
  |  Branch (144:8): [True: 49.2k, False: 0]
  ------------------
  145|      0|      (offset < 0 &&
  ------------------
  |  Branch (145:8): [True: 0, False: 0]
  ------------------
  146|  49.2k|       p_frame->stats_in + offset < p->stats_buf_ctx->stats_in_start)) {
  ------------------
  |  Branch (146:8): [True: 0, False: 0]
  ------------------
  147|  49.2k|    return NULL;
  148|  49.2k|  }
  149|       |
  150|      0|  return &p_frame->stats_in[offset];
  151|  49.2k|}
pass2_strategy.c:init_gf_stats:
 2337|  98.4k|static void init_gf_stats(GF_GROUP_STATS *gf_stats) {
 2338|  98.4k|  gf_stats->gf_group_err = 0.0;
 2339|  98.4k|  gf_stats->gf_group_raw_error = 0.0;
 2340|  98.4k|  gf_stats->gf_group_skip_pct = 0.0;
 2341|  98.4k|  gf_stats->gf_group_inactive_zone_rows = 0.0;
 2342|       |
 2343|  98.4k|  gf_stats->mv_ratio_accumulator = 0.0;
 2344|  98.4k|  gf_stats->decay_accumulator = 1.0;
 2345|  98.4k|  gf_stats->zero_motion_accumulator = 1.0;
 2346|  98.4k|  gf_stats->loop_decay_rate = 1.0;
 2347|  98.4k|  gf_stats->last_loop_decay_rate = 1.0;
 2348|  98.4k|  gf_stats->this_frame_mv_in_out = 0.0;
 2349|  98.4k|  gf_stats->mv_in_out_accumulator = 0.0;
 2350|  98.4k|  gf_stats->abs_mv_in_out_accumulator = 0.0;
 2351|       |
 2352|  98.4k|  gf_stats->avg_sr_coded_error = 0.0;
 2353|  98.4k|  gf_stats->avg_pcnt_second_ref = 0.0;
 2354|  98.4k|  gf_stats->avg_new_mv_count = 0.0;
 2355|  98.4k|  gf_stats->avg_wavelet_energy = 0.0;
 2356|  98.4k|  gf_stats->avg_raw_err_stdev = 0.0;
 2357|  98.4k|  gf_stats->non_zero_stdev_count = 0;
 2358|  98.4k|}
pass2_strategy.c:correct_frames_to_key:
 2235|  36.9k|static void correct_frames_to_key(AV1_COMP *cpi) {
 2236|  36.9k|  int lookahead_size =
 2237|  36.9k|      av1_lookahead_depth(cpi->ppi->lookahead, cpi->compressor_stage);
 2238|  36.9k|  if (lookahead_size <
  ------------------
  |  Branch (2238:7): [True: 0, False: 36.9k]
  ------------------
 2239|  36.9k|      av1_lookahead_pop_sz(cpi->ppi->lookahead, cpi->compressor_stage)) {
 2240|      0|    assert(
 2241|      0|        IMPLIES(cpi->oxcf.pass != AOM_RC_ONE_PASS && cpi->ppi->frames_left > 0,
 2242|      0|                lookahead_size == cpi->ppi->frames_left));
 2243|      0|    cpi->rc.frames_to_key = AOMMIN(cpi->rc.frames_to_key, lookahead_size);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2244|  36.9k|  } else if (cpi->ppi->frames_left > 0) {
  ------------------
  |  Branch (2244:14): [True: 36.9k, False: 0]
  ------------------
 2245|       |    // Correct frames to key based on limit
 2246|  36.9k|    cpi->rc.frames_to_key =
 2247|  36.9k|        AOMMIN(cpi->rc.frames_to_key, cpi->ppi->frames_left);
  ------------------
  |  |   34|  36.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 36.9k]
  |  |  ------------------
  ------------------
 2248|  36.9k|  }
 2249|  36.9k|}
pass2_strategy.c:detect_app_forced_key:
 3058|  61.5k|static int detect_app_forced_key(AV1_COMP *cpi) {
 3059|  61.5k|  int num_frames_to_app_forced_key = is_forced_keyframe_pending(
 3060|  61.5k|      cpi->ppi->lookahead, cpi->ppi->lookahead->max_sz, cpi->compressor_stage);
 3061|  61.5k|  return num_frames_to_app_forced_key;
 3062|  61.5k|}
pass2_strategy.c:find_next_key_frame:
 3375|  12.3k|static void find_next_key_frame(AV1_COMP *cpi, FIRSTPASS_STATS *this_frame) {
 3376|  12.3k|  RATE_CONTROL *const rc = &cpi->rc;
 3377|  12.3k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 3378|  12.3k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
 3379|  12.3k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 3380|  12.3k|  FRAME_INFO *const frame_info = &cpi->frame_info;
 3381|  12.3k|  AV1_COMMON *const cm = &cpi->common;
 3382|  12.3k|  CurrentFrame *const current_frame = &cm->current_frame;
 3383|  12.3k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 3384|  12.3k|  const KeyFrameCfg *const kf_cfg = &oxcf->kf_cfg;
 3385|  12.3k|  const FIRSTPASS_STATS first_frame = *this_frame;
 3386|  12.3k|  FIRSTPASS_STATS next_frame;
 3387|  12.3k|  const FIRSTPASS_INFO *firstpass_info = &twopass->firstpass_info;
 3388|  12.3k|  av1_zero(next_frame);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3389|       |
 3390|  12.3k|  rc->frames_since_key = 0;
 3391|       |  // Use arfs if possible.
 3392|  12.3k|  p_rc->use_arf_in_this_kf_group = is_altref_enabled(
 3393|  12.3k|      oxcf->gf_cfg.lag_in_frames, oxcf->gf_cfg.enable_auto_arf);
 3394|       |
 3395|       |  // Reset the GF group data structures.
 3396|  12.3k|  av1_zero(*gf_group);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3397|  12.3k|  cpi->gf_frame_index = 0;
 3398|       |
 3399|       |  // KF is always a GF so clear frames till next gf counter.
 3400|  12.3k|  rc->frames_till_gf_update_due = 0;
 3401|       |
 3402|  12.3k|  if (has_no_stats_stage(cpi)) {
  ------------------
  |  Branch (3402:7): [True: 12.3k, False: 0]
  ------------------
 3403|  12.3k|    int num_frames_to_app_forced_key = detect_app_forced_key(cpi);
 3404|  12.3k|    p_rc->this_key_frame_forced =
 3405|  12.3k|        current_frame->frame_number != 0 && rc->frames_to_key == 0;
  ------------------
  |  Branch (3405:9): [True: 0, False: 12.3k]
  |  Branch (3405:45): [True: 0, False: 0]
  ------------------
 3406|  12.3k|    if (num_frames_to_app_forced_key != -1)
  ------------------
  |  Branch (3406:9): [True: 0, False: 12.3k]
  ------------------
 3407|      0|      rc->frames_to_key = num_frames_to_app_forced_key;
 3408|  12.3k|    else
 3409|  12.3k|      rc->frames_to_key = AOMMAX(1, kf_cfg->key_freq_max);
  ------------------
  |  |   35|  12.3k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 12.3k]
  |  |  ------------------
  ------------------
 3410|  12.3k|    correct_frames_to_key(cpi);
 3411|  12.3k|    p_rc->kf_boost = DEFAULT_KF_BOOST;
  ------------------
  |  |   47|  12.3k|#define DEFAULT_KF_BOOST 2300
  ------------------
 3412|  12.3k|    gf_group->update_type[0] = KF_UPDATE;
 3413|  12.3k|    return;
 3414|  12.3k|  }
 3415|      0|  int i;
 3416|      0|  const FIRSTPASS_STATS *const start_position = cpi->twopass_frame.stats_in;
 3417|      0|  int kf_bits = 0;
 3418|      0|  double zero_motion_accumulator = 1.0;
 3419|      0|  double boost_score = 0.0;
 3420|      0|  double kf_raw_err = 0.0;
 3421|      0|  double kf_mod_err = 0.0;
 3422|      0|  double sr_accumulator = 0.0;
 3423|      0|  double kf_group_avg_error = 0.0;
 3424|      0|  int frames_to_key, frames_to_key_clipped = INT_MAX;
 3425|      0|  int64_t kf_group_bits_clipped = INT64_MAX;
 3426|       |
 3427|       |  // Is this a forced key frame by interval.
 3428|      0|  p_rc->this_key_frame_forced = p_rc->next_key_frame_forced;
 3429|       |
 3430|      0|  twopass->kf_group_bits = 0;        // Total bits available to kf group
 3431|      0|  twopass->kf_group_error_left = 0;  // Group modified error score.
 3432|       |
 3433|      0|  kf_raw_err = this_frame->intra_error;
 3434|      0|  kf_mod_err = calculate_modified_err(frame_info, twopass, oxcf, this_frame);
 3435|       |
 3436|      0|  if (cpi->ext_ratectrl.ready &&
  ------------------
  |  Branch (3436:7): [True: 0, False: 0]
  ------------------
 3437|      0|      (cpi->ext_ratectrl.funcs.rc_type & AOM_RC_GOP) != 0 &&
  ------------------
  |  Branch (3437:7): [True: 0, False: 0]
  ------------------
 3438|      0|      cpi->ext_ratectrl.funcs.get_key_frame_decision != NULL) {
  ------------------
  |  Branch (3438:7): [True: 0, False: 0]
  ------------------
 3439|      0|    aom_rc_key_frame_decision_t key_frame_decision;
 3440|      0|    aom_codec_err_t codec_status = av1_extrc_get_key_frame_decision(
 3441|      0|        &cpi->ext_ratectrl, &key_frame_decision);
 3442|      0|    if (codec_status == AOM_CODEC_OK) {
  ------------------
  |  Branch (3442:9): [True: 0, False: 0]
  ------------------
 3443|      0|      rc->frames_to_key = key_frame_decision.key_frame_group_size;
 3444|      0|    } else {
 3445|      0|      aom_internal_error(cpi->common.error, codec_status,
 3446|      0|                         "av1_extrc_get_key_frame_decision() failed");
 3447|      0|    }
 3448|      0|  } else {
 3449|       |    // We assume the current frame is a key frame and we are looking for the
 3450|       |    // next key frame. Therefore search_start_idx = 1
 3451|      0|    frames_to_key =
 3452|      0|        define_kf_interval(cpi, firstpass_info, kf_cfg->key_freq_max,
 3453|      0|                           /*search_start_idx=*/1);
 3454|       |
 3455|      0|    if (frames_to_key != -1) {
  ------------------
  |  Branch (3455:9): [True: 0, False: 0]
  ------------------
 3456|      0|      rc->frames_to_key = AOMMIN(kf_cfg->key_freq_max, frames_to_key);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3457|      0|    } else {
 3458|      0|      rc->frames_to_key = kf_cfg->key_freq_max;
 3459|      0|    }
 3460|      0|  }
 3461|       |
 3462|      0|  if (cpi->ppi->lap_enabled) correct_frames_to_key(cpi);
  ------------------
  |  Branch (3462:7): [True: 0, False: 0]
  ------------------
 3463|       |
 3464|       |  // If there is a max kf interval set by the user we must obey it.
 3465|       |  // We already breakout of the loop above at 2x max.
 3466|       |  // This code centers the extra kf if the actual natural interval
 3467|       |  // is between 1x and 2x.
 3468|      0|  if (kf_cfg->auto_key && rc->frames_to_key > kf_cfg->key_freq_max) {
  ------------------
  |  Branch (3468:7): [True: 0, False: 0]
  |  Branch (3468:27): [True: 0, False: 0]
  ------------------
 3469|      0|    FIRSTPASS_STATS tmp_frame = first_frame;
 3470|       |
 3471|      0|    rc->frames_to_key /= 2;
 3472|       |
 3473|       |    // Reset to the start of the group.
 3474|      0|    reset_fpf_position(&cpi->twopass_frame, start_position);
 3475|       |    // Rescan to get the correct error data for the forced kf group.
 3476|      0|    for (i = 0; i < rc->frames_to_key; ++i) {
  ------------------
  |  Branch (3476:17): [True: 0, False: 0]
  ------------------
 3477|      0|      if (EOF == input_stats(twopass, &cpi->twopass_frame, &tmp_frame)) break;
  ------------------
  |  Branch (3477:11): [True: 0, False: 0]
  ------------------
 3478|      0|    }
 3479|      0|    p_rc->next_key_frame_forced = 1;
 3480|      0|  } else if ((cpi->twopass_frame.stats_in ==
  ------------------
  |  Branch (3480:15): [True: 0, False: 0]
  ------------------
 3481|      0|                  twopass->stats_buf_ctx->stats_in_end &&
 3482|      0|              is_stat_consumption_stage_twopass(cpi)) ||
  ------------------
  |  Branch (3482:15): [True: 0, False: 0]
  ------------------
 3483|      0|             rc->frames_to_key >= kf_cfg->key_freq_max) {
  ------------------
  |  Branch (3483:14): [True: 0, False: 0]
  ------------------
 3484|      0|    p_rc->next_key_frame_forced = 1;
 3485|      0|  } else {
 3486|      0|    p_rc->next_key_frame_forced = 0;
 3487|      0|  }
 3488|       |
 3489|      0|  double kf_group_err = 0;
 3490|      0|  for (i = 0; i < rc->frames_to_key; ++i) {
  ------------------
  |  Branch (3490:15): [True: 0, False: 0]
  ------------------
 3491|      0|    const FIRSTPASS_STATS *this_stats =
 3492|      0|        av1_firstpass_info_peek(&twopass->firstpass_info, i);
 3493|      0|    if (this_stats != NULL) {
  ------------------
  |  Branch (3493:9): [True: 0, False: 0]
  ------------------
 3494|       |      // Accumulate kf group error.
 3495|      0|      kf_group_err += calculate_modified_err_new(
 3496|      0|          frame_info, &firstpass_info->total_stats, this_stats,
 3497|      0|          oxcf->rc_cfg.vbrbias, twopass->modified_error_min,
 3498|      0|          twopass->modified_error_max);
 3499|      0|      ++p_rc->num_stats_used_for_kf_boost;
 3500|      0|    }
 3501|      0|  }
 3502|       |
 3503|       |  // Calculate the number of bits that should be assigned to the kf group.
 3504|      0|  if ((twopass->bits_left > 0 && twopass->modified_error_left > 0.0) ||
  ------------------
  |  Branch (3504:8): [True: 0, False: 0]
  |  Branch (3504:34): [True: 0, False: 0]
  ------------------
 3505|      0|      (cpi->ppi->lap_enabled && oxcf->rc_cfg.mode != AOM_Q)) {
  ------------------
  |  Branch (3505:8): [True: 0, False: 0]
  |  Branch (3505:33): [True: 0, False: 0]
  ------------------
 3506|       |    // Maximum number of bits for a single normal frame (not key frame).
 3507|      0|    const int max_bits = frame_max_bits(rc, oxcf);
 3508|       |
 3509|       |    // Maximum number of bits allocated to the key frame group.
 3510|      0|    int64_t max_grp_bits;
 3511|       |
 3512|      0|    if (oxcf->rc_cfg.vbr_corpus_complexity_lap) {
  ------------------
  |  Branch (3512:9): [True: 0, False: 0]
  ------------------
 3513|      0|      kf_group_avg_error =
 3514|      0|          get_kf_group_avg_error(twopass, &cpi->twopass_frame, &first_frame,
 3515|      0|                                 start_position, rc->frames_to_key);
 3516|      0|    }
 3517|       |
 3518|       |    // Default allocation based on bits left and relative
 3519|       |    // complexity of the section.
 3520|      0|    twopass->kf_group_bits =
 3521|      0|        get_kf_group_bits(cpi, kf_group_err, kf_group_avg_error);
 3522|       |    // Clip based on maximum per frame rate defined by the user.
 3523|      0|    max_grp_bits = (int64_t)max_bits * (int64_t)rc->frames_to_key;
 3524|      0|    if (twopass->kf_group_bits > max_grp_bits)
  ------------------
  |  Branch (3524:9): [True: 0, False: 0]
  ------------------
 3525|      0|      twopass->kf_group_bits = max_grp_bits;
 3526|      0|  } else {
 3527|      0|    twopass->kf_group_bits = 0;
 3528|      0|  }
 3529|      0|  twopass->kf_group_bits = AOMMAX(0, twopass->kf_group_bits);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3530|       |
 3531|      0|  if (cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (3531:7): [True: 0, False: 0]
  ------------------
 3532|       |    // In the case of single pass based on LAP, frames to  key may have an
 3533|       |    // inaccurate value, and hence should be clipped to an appropriate
 3534|       |    // interval.
 3535|      0|    frames_to_key_clipped =
 3536|      0|        (int)(MAX_KF_BITS_INTERVAL_SINGLE_PASS * cpi->framerate);
  ------------------
  |  | 3364|      0|#define MAX_KF_BITS_INTERVAL_SINGLE_PASS 5
  ------------------
 3537|       |
 3538|       |    // This variable calculates the bits allocated to kf_group with a clipped
 3539|       |    // frames_to_key.
 3540|      0|    if (rc->frames_to_key > frames_to_key_clipped) {
  ------------------
  |  Branch (3540:9): [True: 0, False: 0]
  ------------------
 3541|      0|      kf_group_bits_clipped =
 3542|      0|          (int64_t)((double)twopass->kf_group_bits * frames_to_key_clipped /
 3543|      0|                    rc->frames_to_key);
 3544|      0|    }
 3545|      0|  }
 3546|       |
 3547|       |  // Reset the first pass file position.
 3548|      0|  reset_fpf_position(&cpi->twopass_frame, start_position);
 3549|       |
 3550|       |  // Scan through the kf group collating various stats used to determine
 3551|       |  // how many bits to spend on it.
 3552|      0|  boost_score = get_kf_boost_score(cpi, kf_raw_err, &zero_motion_accumulator,
 3553|      0|                                   &sr_accumulator, 0);
 3554|      0|  reset_fpf_position(&cpi->twopass_frame, start_position);
 3555|       |  // Store the zero motion percentage
 3556|      0|  twopass->kf_zeromotion_pct = (int)(zero_motion_accumulator * 100.0);
 3557|       |
 3558|       |  // Calculate a section intra ratio used in setting max loop filter.
 3559|      0|  twopass->section_intra_rating = calculate_section_intra_ratio(
 3560|      0|      start_position, twopass->stats_buf_ctx->stats_in_end, rc->frames_to_key);
 3561|       |
 3562|      0|  p_rc->kf_boost = (int)boost_score;
 3563|       |
 3564|      0|  if (cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (3564:7): [True: 0, False: 0]
  ------------------
 3565|      0|    if (oxcf->rc_cfg.mode == AOM_Q) {
  ------------------
  |  Branch (3565:9): [True: 0, False: 0]
  ------------------
 3566|      0|      p_rc->kf_boost = get_projected_kf_boost(cpi);
 3567|      0|    } else {
 3568|       |      // TODO(any): Explore using average frame stats for AOM_Q as well.
 3569|      0|      boost_score = get_kf_boost_score(
 3570|      0|          cpi, kf_raw_err, &zero_motion_accumulator, &sr_accumulator, 1);
 3571|      0|      reset_fpf_position(&cpi->twopass_frame, start_position);
 3572|      0|      p_rc->kf_boost += (int)boost_score;
 3573|      0|    }
 3574|      0|  }
 3575|       |
 3576|       |  // Special case for static / slide show content but don't apply
 3577|       |  // if the kf group is very short.
 3578|      0|  if ((zero_motion_accumulator > STATIC_KF_GROUP_FLOAT_THRESH) &&
  ------------------
  |  |   39|      0|#define STATIC_KF_GROUP_FLOAT_THRESH 0.99
  ------------------
  |  Branch (3578:7): [True: 0, False: 0]
  ------------------
 3579|      0|      (rc->frames_to_key > 8)) {
  ------------------
  |  Branch (3579:7): [True: 0, False: 0]
  ------------------
 3580|      0|    p_rc->kf_boost = AOMMAX(p_rc->kf_boost, MIN_STATIC_KF_BOOST);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3581|      0|  } else {
 3582|       |    // Apply various clamps for min and max boost
 3583|      0|    p_rc->kf_boost = AOMMAX(p_rc->kf_boost, (rc->frames_to_key * 3));
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3584|      0|    p_rc->kf_boost = AOMMAX(p_rc->kf_boost, MIN_KF_BOOST);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3585|       |#ifdef STRICT_RC
 3586|       |    p_rc->kf_boost = AOMMIN(p_rc->kf_boost, MAX_KF_BOOST);
 3587|       |#endif
 3588|      0|  }
 3589|       |
 3590|       |  // Work out how many bits to allocate for the key frame itself.
 3591|       |  // In case of LAP enabled for VBR, if the frames_to_key value is
 3592|       |  // very high, we calculate the bits based on a clipped value of
 3593|       |  // frames_to_key.
 3594|      0|  kf_bits = calculate_boost_bits(
 3595|      0|      AOMMIN(rc->frames_to_key, frames_to_key_clipped) - 1, p_rc->kf_boost,
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3596|      0|      AOMMIN(twopass->kf_group_bits, kf_group_bits_clipped));
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3597|      0|  kf_bits = adjust_boost_bits_for_target_level(cpi, rc, kf_bits,
 3598|      0|                                               twopass->kf_group_bits, 0);
 3599|       |
 3600|      0|  twopass->kf_group_bits -= kf_bits;
 3601|       |
 3602|       |  // Save the bits to spend on the key frame.
 3603|      0|  gf_group->bit_allocation[0] = kf_bits;
 3604|      0|  gf_group->update_type[0] = KF_UPDATE;
 3605|       |
 3606|       |  // Note the total error score of the kf group minus the key frame itself.
 3607|      0|  if (cpi->ppi->lap_enabled)
  ------------------
  |  Branch (3607:7): [True: 0, False: 0]
  ------------------
 3608|       |    // As we don't have enough stats to know the actual error of the group,
 3609|       |    // we assume the complexity of each frame to be equal to 1, and set the
 3610|       |    // error as the number of frames in the group(minus the keyframe).
 3611|      0|    twopass->kf_group_error_left = (double)(rc->frames_to_key - 1);
 3612|      0|  else
 3613|      0|    twopass->kf_group_error_left = kf_group_err - kf_mod_err;
 3614|       |
 3615|       |  // Adjust the count of total modified error left.
 3616|       |  // The count of bits left is adjusted elsewhere based on real coded frame
 3617|       |  // sizes.
 3618|      0|  twopass->modified_error_left -= kf_group_err;
 3619|      0|}
pass2_strategy.c:identify_regions:
 1850|  12.3k|                            int *total_regions) {
 1851|  12.3k|  int k;
 1852|  12.3k|  if (total_frames <= 1) return 0;
  ------------------
  |  Branch (1852:7): [True: 12.3k, False: 0]
  ------------------
 1853|       |
 1854|       |  // store the initial decisions
 1855|      0|  REGIONS *temp_regions =
 1856|      0|      (REGIONS *)aom_malloc(total_frames * sizeof(temp_regions[0]));
 1857|       |  // buffers for filtered stats
 1858|      0|  double *filt_intra_err =
 1859|      0|      (double *)aom_calloc(total_frames, sizeof(*filt_intra_err));
 1860|      0|  double *filt_coded_err =
 1861|      0|      (double *)aom_calloc(total_frames, sizeof(*filt_coded_err));
 1862|      0|  double *grad_coded = (double *)aom_calloc(total_frames, sizeof(*grad_coded));
 1863|      0|  if (!(temp_regions && filt_intra_err && filt_coded_err && grad_coded)) {
  ------------------
  |  Branch (1863:9): [True: 0, False: 0]
  |  Branch (1863:25): [True: 0, False: 0]
  |  Branch (1863:43): [True: 0, False: 0]
  |  Branch (1863:61): [True: 0, False: 0]
  ------------------
 1864|      0|    free_firstpass_stats_buffers(temp_regions, filt_intra_err, filt_coded_err,
 1865|      0|                                 grad_coded);
 1866|      0|    return -1;
 1867|      0|  }
 1868|      0|  av1_zero_array(temp_regions, total_frames);
  ------------------
  |  |   44|      0|#define av1_zero_array(dest, n) memset(dest, 0, n * sizeof(*(dest)))
  ------------------
 1869|       |
 1870|      0|  int cur_region = 0, this_start = 0, this_last;
 1871|       |
 1872|      0|  int next_scenecut = -1;
 1873|      0|  do {
 1874|       |    // first get the obvious scenecuts
 1875|      0|    next_scenecut =
 1876|      0|        find_next_scenecut(stats_start, this_start, total_frames - 1);
 1877|      0|    this_last = (next_scenecut >= 0) ? (next_scenecut - 1) : total_frames - 1;
  ------------------
  |  Branch (1877:17): [True: 0, False: 0]
  ------------------
 1878|       |
 1879|       |    // low-pass filter the needed stats
 1880|      0|    smooth_filter_stats(stats_start, this_start, this_last, filt_intra_err,
 1881|      0|                        filt_coded_err);
 1882|      0|    get_gradient(filt_coded_err, this_start, this_last, grad_coded);
 1883|       |
 1884|       |    // find tentative stable regions and unstable regions
 1885|      0|    int num_regions = find_stable_regions(stats_start, grad_coded, this_start,
 1886|      0|                                          this_last, temp_regions);
 1887|       |
 1888|      0|    adjust_unstable_region_bounds(stats_start, temp_regions, &num_regions);
 1889|       |
 1890|      0|    get_region_stats(stats_start, temp_regions, num_regions);
 1891|       |
 1892|       |    // Try to identify blending regions in the unstable regions
 1893|      0|    find_blending_regions(stats_start, temp_regions, &num_regions);
 1894|      0|    cleanup_blendings(temp_regions, &num_regions);
 1895|       |
 1896|       |    // The flash points should all be considered high variance points
 1897|      0|    k = 0;
 1898|      0|    while (k < num_regions) {
  ------------------
  |  Branch (1898:12): [True: 0, False: 0]
  ------------------
 1899|      0|      if (temp_regions[k].type != STABLE_REGION) {
  ------------------
  |  Branch (1899:11): [True: 0, False: 0]
  ------------------
 1900|      0|        k++;
 1901|      0|        continue;
 1902|      0|      }
 1903|      0|      int start = temp_regions[k].start;
 1904|      0|      int last = temp_regions[k].last;
 1905|      0|      for (int i = start; i <= last; i++) {
  ------------------
  |  Branch (1905:27): [True: 0, False: 0]
  ------------------
 1906|      0|        if (stats_start[i].is_flash) {
  ------------------
  |  Branch (1906:13): [True: 0, False: 0]
  ------------------
 1907|      0|          insert_region(i, i, HIGH_VAR_REGION, temp_regions, &num_regions, &k);
 1908|      0|        }
 1909|      0|      }
 1910|      0|      k++;
 1911|      0|    }
 1912|      0|    cleanup_regions(temp_regions, &num_regions);
 1913|       |
 1914|       |    // copy the regions in the scenecut group
 1915|      0|    for (k = 0; k < num_regions; k++) {
  ------------------
  |  Branch (1915:17): [True: 0, False: 0]
  ------------------
 1916|      0|      if (temp_regions[k].last < temp_regions[k].start &&
  ------------------
  |  Branch (1916:11): [True: 0, False: 0]
  ------------------
 1917|      0|          k == num_regions - 1) {
  ------------------
  |  Branch (1917:11): [True: 0, False: 0]
  ------------------
 1918|      0|        num_regions--;
 1919|      0|        break;
 1920|      0|      }
 1921|      0|      regions[k + cur_region] = temp_regions[k];
 1922|      0|    }
 1923|      0|    cur_region += num_regions;
 1924|       |
 1925|       |    // add the scenecut region
 1926|      0|    if (next_scenecut > -1) {
  ------------------
  |  Branch (1926:9): [True: 0, False: 0]
  ------------------
 1927|       |      // add the scenecut region, and find the next scenecut
 1928|      0|      regions[cur_region].type = SCENECUT_REGION;
 1929|      0|      regions[cur_region].start = next_scenecut;
 1930|      0|      regions[cur_region].last = next_scenecut;
 1931|      0|      cur_region++;
 1932|      0|      this_start = next_scenecut + 1;
 1933|      0|    }
 1934|      0|  } while (next_scenecut >= 0);
  ------------------
  |  Branch (1934:12): [True: 0, False: 0]
  ------------------
 1935|       |
 1936|      0|  *total_regions = cur_region;
 1937|      0|  get_region_stats(stats_start, regions, *total_regions);
 1938|       |
 1939|      0|  for (k = 0; k < *total_regions; k++) {
  ------------------
  |  Branch (1939:15): [True: 0, False: 0]
  ------------------
 1940|       |    // If scenecuts are very minor, mark them as high variance.
 1941|      0|    if (regions[k].type != SCENECUT_REGION ||
  ------------------
  |  Branch (1941:9): [True: 0, False: 0]
  ------------------
 1942|      0|        regions[k].avg_cor_coeff *
  ------------------
  |  Branch (1942:9): [True: 0, False: 0]
  ------------------
 1943|      0|                (1 - stats_start[regions[k].start].noise_var /
 1944|      0|                         regions[k].avg_intra_err) <
 1945|      0|            0.8) {
 1946|      0|      continue;
 1947|      0|    }
 1948|      0|    regions[k].type = HIGH_VAR_REGION;
 1949|      0|  }
 1950|      0|  cleanup_regions(regions, total_regions);
 1951|      0|  get_region_stats(stats_start, regions, *total_regions);
 1952|       |
 1953|      0|  for (k = 0; k < *total_regions; k++) {
  ------------------
  |  Branch (1953:15): [True: 0, False: 0]
  ------------------
 1954|      0|    regions[k].start += offset;
 1955|      0|    regions[k].last += offset;
 1956|      0|  }
 1957|       |
 1958|      0|  free_firstpass_stats_buffers(temp_regions, filt_intra_err, filt_coded_err,
 1959|      0|                               grad_coded);
 1960|      0|  return 0;
 1961|      0|}
pass2_strategy.c:find_regions_index:
 1964|  12.3k|                              int frame_idx) {
 1965|  12.3k|  for (int k = 0; k < num_regions; k++) {
  ------------------
  |  Branch (1965:19): [True: 0, False: 12.3k]
  ------------------
 1966|      0|    if (regions[k].start <= frame_idx && regions[k].last >= frame_idx) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 0]
  |  Branch (1966:42): [True: 0, False: 0]
  ------------------
 1967|      0|      return k;
 1968|      0|    }
 1969|      0|  }
 1970|  12.3k|  return -1;
 1971|  12.3k|}
pass2_strategy.c:calculate_gf_length:
 1986|  12.3k|                                int max_intervals) {
 1987|  12.3k|  RATE_CONTROL *const rc = &cpi->rc;
 1988|  12.3k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 1989|  12.3k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
 1990|  12.3k|  FIRSTPASS_STATS next_frame;
 1991|  12.3k|  const FIRSTPASS_STATS *const start_pos = cpi->twopass_frame.stats_in;
 1992|  12.3k|  const FIRSTPASS_STATS *const stats = start_pos - (rc->frames_since_key == 0);
 1993|       |
 1994|  12.3k|  const int f_w = cpi->common.width;
 1995|  12.3k|  const int f_h = cpi->common.height;
 1996|  12.3k|  int i;
 1997|       |
 1998|  12.3k|  int flash_detected;
 1999|       |
 2000|  12.3k|  av1_zero(next_frame);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2001|       |
 2002|  12.3k|  if (has_no_stats_stage(cpi)) {
  ------------------
  |  Branch (2002:7): [True: 12.3k, False: 0]
  ------------------
 2003|   196k|    for (i = 0; i < MAX_NUM_GF_INTERVALS; i++) {
  ------------------
  |  |   52|   196k|#define MAX_NUM_GF_INTERVALS 15
  ------------------
  |  Branch (2003:17): [True: 184k, False: 12.3k]
  ------------------
 2004|   184k|      p_rc->gf_intervals[i] = AOMMIN(rc->max_gf_interval, max_gop_length);
  ------------------
  |  |   34|   184k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 184k]
  |  |  ------------------
  ------------------
 2005|   184k|    }
 2006|  12.3k|    p_rc->cur_gf_index = 0;
 2007|  12.3k|    rc->intervals_till_gf_calculate_due = MAX_NUM_GF_INTERVALS;
  ------------------
  |  |   52|  12.3k|#define MAX_NUM_GF_INTERVALS 15
  ------------------
 2008|  12.3k|    return;
 2009|  12.3k|  }
 2010|       |
 2011|       |  // TODO(urvang): Try logic to vary min and max interval based on q.
 2012|      0|  const int active_min_gf_interval = rc->min_gf_interval;
 2013|      0|  const int active_max_gf_interval =
 2014|      0|      AOMMIN(rc->max_gf_interval, max_gop_length);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2015|      0|  const int min_shrink_int = AOMMAX(MIN_SHRINK_LEN, active_min_gf_interval);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2016|       |
 2017|      0|  i = (rc->frames_since_key == 0);
 2018|      0|  max_intervals = cpi->ppi->lap_enabled ? 1 : max_intervals;
  ------------------
  |  Branch (2018:19): [True: 0, False: 0]
  ------------------
 2019|      0|  int count_cuts = 1;
 2020|       |  // If cpi->gf_state.arf_gf_boost_lst is 0, we are starting with a KF or GF.
 2021|      0|  int cur_start = -1 + !cpi->ppi->gf_state.arf_gf_boost_lst, cur_last;
 2022|      0|  int cut_pos[MAX_NUM_GF_INTERVALS + 1] = { -1 };
 2023|      0|  int cut_here;
 2024|      0|  GF_GROUP_STATS gf_stats;
 2025|      0|  init_gf_stats(&gf_stats);
 2026|      0|  while (count_cuts < max_intervals + 1) {
  ------------------
  |  Branch (2026:10): [True: 0, False: 0]
  ------------------
 2027|       |    // reaches next key frame, break here
 2028|      0|    if (i >= rc->frames_to_key) {
  ------------------
  |  Branch (2028:9): [True: 0, False: 0]
  ------------------
 2029|      0|      cut_here = 2;
 2030|      0|    } else if (i - cur_start >= rc->static_scene_max_gf_interval) {
  ------------------
  |  Branch (2030:16): [True: 0, False: 0]
  ------------------
 2031|       |      // reached maximum len, but nothing special yet (almost static)
 2032|       |      // let's look at the next interval
 2033|      0|      cut_here = 1;
 2034|      0|    } else if (EOF == input_stats(twopass, &cpi->twopass_frame, &next_frame)) {
  ------------------
  |  Branch (2034:16): [True: 0, False: 0]
  ------------------
 2035|       |      // reaches last frame, break
 2036|      0|      cut_here = 2;
 2037|      0|    } else {
 2038|       |      // Test for the case where there is a brief flash but the prediction
 2039|       |      // quality back to an earlier frame is then restored.
 2040|      0|      flash_detected = detect_flash(twopass, &cpi->twopass_frame, 0);
 2041|       |      // TODO(bohanli): remove redundant accumulations here, or unify
 2042|       |      // this and the ones in define_gf_group
 2043|      0|      accumulate_next_frame_stats(&next_frame, flash_detected,
 2044|      0|                                  rc->frames_since_key, i, &gf_stats, f_w, f_h);
 2045|       |
 2046|      0|      cut_here = detect_gf_cut(cpi, i, cur_start, flash_detected,
 2047|      0|                               active_max_gf_interval, active_min_gf_interval,
 2048|      0|                               &gf_stats);
 2049|      0|    }
 2050|      0|    if (cut_here) {
  ------------------
  |  Branch (2050:9): [True: 0, False: 0]
  ------------------
 2051|      0|      cur_last = i - 1;  // the current last frame in the gf group
 2052|      0|      int ori_last = cur_last;
 2053|       |      // The region frame idx does not start from the same frame as cur_start
 2054|       |      // and cur_last. Need to offset them.
 2055|      0|      int offset = rc->frames_since_key - p_rc->regions_offset;
 2056|      0|      REGIONS *regions = p_rc->regions;
 2057|      0|      int num_regions = p_rc->num_regions;
 2058|       |
 2059|      0|      int scenecut_idx = -1;
 2060|       |      // only try shrinking if interval smaller than active_max_gf_interval
 2061|      0|      if (cur_last - cur_start <= active_max_gf_interval &&
  ------------------
  |  Branch (2061:11): [True: 0, False: 0]
  ------------------
 2062|      0|          cur_last > cur_start) {
  ------------------
  |  Branch (2062:11): [True: 0, False: 0]
  ------------------
 2063|       |        // find the region indices of where the first and last frame belong.
 2064|      0|        int k_start =
 2065|      0|            find_regions_index(regions, num_regions, cur_start + offset);
 2066|      0|        int k_last =
 2067|      0|            find_regions_index(regions, num_regions, cur_last + offset);
 2068|      0|        if (cur_start + offset == 0) k_start = 0;
  ------------------
  |  Branch (2068:13): [True: 0, False: 0]
  ------------------
 2069|       |
 2070|       |        // See if we have a scenecut in between
 2071|      0|        for (int r = k_start + 1; r <= k_last; r++) {
  ------------------
  |  Branch (2071:35): [True: 0, False: 0]
  ------------------
 2072|      0|          if (regions[r].type == SCENECUT_REGION &&
  ------------------
  |  Branch (2072:15): [True: 0, False: 0]
  ------------------
 2073|      0|              regions[r].last - offset - cur_start > active_min_gf_interval) {
  ------------------
  |  Branch (2073:15): [True: 0, False: 0]
  ------------------
 2074|      0|            scenecut_idx = r;
 2075|      0|            break;
 2076|      0|          }
 2077|      0|        }
 2078|       |
 2079|       |        // if the found scenecut is very close to the end, ignore it.
 2080|      0|        if (regions[num_regions - 1].last - regions[scenecut_idx].last < 4) {
  ------------------
  |  Branch (2080:13): [True: 0, False: 0]
  ------------------
 2081|      0|          scenecut_idx = -1;
 2082|      0|        }
 2083|       |
 2084|      0|        if (scenecut_idx != -1) {
  ------------------
  |  Branch (2084:13): [True: 0, False: 0]
  ------------------
 2085|       |          // If we have a scenecut, then stop at it.
 2086|       |          // TODO(bohanli): add logic here to stop before the scenecut and for
 2087|       |          // the next gop start from the scenecut with GF
 2088|      0|          int is_minor_sc =
 2089|      0|              (regions[scenecut_idx].avg_cor_coeff *
 2090|      0|                   (1 - stats[regions[scenecut_idx].start - offset].noise_var /
 2091|      0|                            regions[scenecut_idx].avg_intra_err) >
 2092|      0|               0.6);
 2093|      0|          cur_last = regions[scenecut_idx].last - offset - !is_minor_sc;
 2094|      0|        } else {
 2095|      0|          int is_last_analysed = (k_last == num_regions - 1) &&
  ------------------
  |  Branch (2095:34): [True: 0, False: 0]
  ------------------
 2096|      0|                                 (cur_last + offset == regions[k_last].last);
  ------------------
  |  Branch (2096:34): [True: 0, False: 0]
  ------------------
 2097|      0|          int not_enough_regions =
 2098|      0|              k_last - k_start <=
 2099|      0|              1 + (regions[k_start].type == SCENECUT_REGION);
 2100|       |          // if we are very close to the end, then do not shrink since it may
 2101|       |          // introduce intervals that are too short
 2102|      0|          if (!(is_last_analysed && not_enough_regions)) {
  ------------------
  |  Branch (2102:17): [True: 0, False: 0]
  |  Branch (2102:37): [True: 0, False: 0]
  ------------------
 2103|      0|            const double arf_length_factor = 0.1;
 2104|      0|            double best_score = 0;
 2105|      0|            int best_j = -1;
 2106|      0|            const int first_frame = regions[0].start - offset;
 2107|      0|            const int last_frame = regions[num_regions - 1].last - offset;
 2108|       |            // score of how much the arf helps the whole GOP
 2109|      0|            double base_score = 0.0;
 2110|      0|            int count_base = 0;
 2111|      0|            bool static_frames = false;
 2112|       |
 2113|       |            // Accumulate base_score in
 2114|      0|            for (int j = cur_start + 1; j < cur_start + min_shrink_int; j++) {
  ------------------
  |  Branch (2114:41): [True: 0, False: 0]
  ------------------
 2115|      0|              if (stats + j >= twopass->stats_buf_ctx->stats_in_end) break;
  ------------------
  |  Branch (2115:19): [True: 0, False: 0]
  ------------------
 2116|      0|              base_score = (base_score + 1.0) * stats[j].cor_coeff;
 2117|      0|              count_base++;
 2118|      0|            }
 2119|       |
 2120|      0|            if (count_base && base_score / count_base > 0.992) {
  ------------------
  |  Branch (2120:17): [True: 0, False: 0]
  |  Branch (2120:31): [True: 0, False: 0]
  ------------------
 2121|      0|              static_frames = true;
 2122|      0|            }
 2123|       |
 2124|      0|            int met_blending = 0;   // Whether we have met blending areas before
 2125|      0|            int last_blending = 0;  // Whether the previous frame if blending
 2126|      0|            for (int j = cur_start + min_shrink_int; j <= cur_last; j++) {
  ------------------
  |  Branch (2126:54): [True: 0, False: 0]
  ------------------
 2127|      0|              if (stats + j >= twopass->stats_buf_ctx->stats_in_end) break;
  ------------------
  |  Branch (2127:19): [True: 0, False: 0]
  ------------------
 2128|      0|              base_score = (base_score + 1.0) * stats[j].cor_coeff;
 2129|      0|              int this_reg =
 2130|      0|                  find_regions_index(regions, num_regions, j + offset);
 2131|      0|              if (this_reg < 0) continue;
  ------------------
  |  Branch (2131:19): [True: 0, False: 0]
  ------------------
 2132|       |              // A GOP should include at most 1 blending region.
 2133|      0|              if (regions[this_reg].type == BLENDING_REGION) {
  ------------------
  |  Branch (2133:19): [True: 0, False: 0]
  ------------------
 2134|      0|                last_blending = 1;
 2135|      0|                if (met_blending) {
  ------------------
  |  Branch (2135:21): [True: 0, False: 0]
  ------------------
 2136|      0|                  break;
 2137|      0|                } else {
 2138|      0|                  base_score = 0;
 2139|      0|                  continue;
 2140|      0|                }
 2141|      0|              } else {
 2142|      0|                if (last_blending) met_blending = 1;
  ------------------
  |  Branch (2142:21): [True: 0, False: 0]
  ------------------
 2143|      0|                last_blending = 0;
 2144|      0|              }
 2145|       |
 2146|       |              // Add the factor of how good the neighborhood is for this
 2147|       |              // candidate arf.
 2148|      0|              double this_score = arf_length_factor * base_score;
 2149|      0|              double temp_accu_coeff = 1.0;
 2150|       |              // following frames
 2151|      0|              int count_f = 0;
 2152|      0|              for (int n = j + 1; n <= j + 3 && n <= last_frame; n++) {
  ------------------
  |  Branch (2152:35): [True: 0, False: 0]
  |  Branch (2152:49): [True: 0, False: 0]
  ------------------
 2153|      0|                if (stats + n >= twopass->stats_buf_ctx->stats_in_end) break;
  ------------------
  |  Branch (2153:21): [True: 0, False: 0]
  ------------------
 2154|      0|                temp_accu_coeff *= stats[n].cor_coeff;
 2155|      0|                this_score +=
 2156|      0|                    temp_accu_coeff *
 2157|      0|                    sqrt(AOMMAX(0.5,
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  |  Branch (35:31): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2158|      0|                                1 - stats[n].noise_var /
 2159|      0|                                        AOMMAX(stats[n].intra_error, 0.001)));
 2160|      0|                count_f++;
 2161|      0|              }
 2162|       |              // preceding frames
 2163|      0|              temp_accu_coeff = 1.0;
 2164|      0|              for (int n = j; n > j - 3 * 2 + count_f && n > first_frame; n--) {
  ------------------
  |  Branch (2164:31): [True: 0, False: 0]
  |  Branch (2164:58): [True: 0, False: 0]
  ------------------
 2165|      0|                if (stats + n < twopass->stats_buf_ctx->stats_in_start) break;
  ------------------
  |  Branch (2165:21): [True: 0, False: 0]
  ------------------
 2166|      0|                temp_accu_coeff *= stats[n].cor_coeff;
 2167|      0|                this_score +=
 2168|      0|                    temp_accu_coeff *
 2169|      0|                    sqrt(AOMMAX(0.5,
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  |  Branch (35:31): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2170|      0|                                1 - stats[n].noise_var /
 2171|      0|                                        AOMMAX(stats[n].intra_error, 0.001)));
 2172|      0|              }
 2173|       |
 2174|       |              // Slightly relax the condition for videos starting with frozen
 2175|       |              // frames.
 2176|      0|              if (this_score + (static_frames ? 0.5 : 0) > best_score) {
  ------------------
  |  Branch (2176:19): [True: 0, False: 0]
  |  Branch (2176:33): [True: 0, False: 0]
  ------------------
 2177|      0|                best_score = this_score;
 2178|      0|                best_j = j;
 2179|      0|              }
 2180|      0|            }
 2181|       |
 2182|       |            // For blending areas, move one more frame in case we missed the
 2183|       |            // first blending frame.
 2184|      0|            int best_reg =
 2185|      0|                find_regions_index(regions, num_regions, best_j + offset);
 2186|      0|            if (best_reg < num_regions - 1 && best_reg > 0) {
  ------------------
  |  Branch (2186:17): [True: 0, False: 0]
  |  Branch (2186:47): [True: 0, False: 0]
  ------------------
 2187|      0|              if (regions[best_reg - 1].type == BLENDING_REGION &&
  ------------------
  |  Branch (2187:19): [True: 0, False: 0]
  ------------------
 2188|      0|                  regions[best_reg + 1].type == BLENDING_REGION) {
  ------------------
  |  Branch (2188:19): [True: 0, False: 0]
  ------------------
 2189|      0|                if (best_j + offset == regions[best_reg].start &&
  ------------------
  |  Branch (2189:21): [True: 0, False: 0]
  ------------------
 2190|      0|                    best_j + offset < regions[best_reg].last) {
  ------------------
  |  Branch (2190:21): [True: 0, False: 0]
  ------------------
 2191|      0|                  best_j += 1;
 2192|      0|                } else if (best_j + offset == regions[best_reg].last &&
  ------------------
  |  Branch (2192:28): [True: 0, False: 0]
  ------------------
 2193|      0|                           best_j + offset > regions[best_reg].start) {
  ------------------
  |  Branch (2193:28): [True: 0, False: 0]
  ------------------
 2194|      0|                  best_j -= 1;
 2195|      0|                }
 2196|      0|              }
 2197|      0|            }
 2198|       |
 2199|      0|            if (cur_last - best_j < 2) best_j = cur_last;
  ------------------
  |  Branch (2199:17): [True: 0, False: 0]
  ------------------
 2200|      0|            if (best_j > 0 && best_score > 0.1) cur_last = best_j;
  ------------------
  |  Branch (2200:17): [True: 0, False: 0]
  |  Branch (2200:31): [True: 0, False: 0]
  ------------------
 2201|       |            // if cannot find anything, just cut at the original place.
 2202|      0|          }
 2203|      0|        }
 2204|      0|      }
 2205|      0|      cut_pos[count_cuts] = cur_last;
 2206|      0|      count_cuts++;
 2207|       |
 2208|       |      // reset pointers to the shrunken location
 2209|      0|      cpi->twopass_frame.stats_in = start_pos + cur_last;
 2210|      0|      cur_start = cur_last;
 2211|      0|      int cur_region_idx =
 2212|      0|          find_regions_index(regions, num_regions, cur_start + 1 + offset);
 2213|      0|      if (cur_region_idx >= 0)
  ------------------
  |  Branch (2213:11): [True: 0, False: 0]
  ------------------
 2214|      0|        if (regions[cur_region_idx].type == SCENECUT_REGION) cur_start++;
  ------------------
  |  Branch (2214:13): [True: 0, False: 0]
  ------------------
 2215|       |
 2216|      0|      i = cur_last;
 2217|       |
 2218|      0|      if (cut_here > 1 && cur_last == ori_last) break;
  ------------------
  |  Branch (2218:11): [True: 0, False: 0]
  |  Branch (2218:27): [True: 0, False: 0]
  ------------------
 2219|       |
 2220|       |      // reset accumulators
 2221|      0|      init_gf_stats(&gf_stats);
 2222|      0|    }
 2223|      0|    ++i;
 2224|      0|  }
 2225|       |
 2226|       |  // save intervals
 2227|      0|  rc->intervals_till_gf_calculate_due = count_cuts - 1;
 2228|      0|  for (int n = 1; n < count_cuts; n++) {
  ------------------
  |  Branch (2228:19): [True: 0, False: 0]
  ------------------
 2229|      0|    p_rc->gf_intervals[n - 1] = cut_pos[n] - cut_pos[n - 1];
 2230|      0|  }
 2231|      0|  p_rc->cur_gf_index = 0;
 2232|      0|  cpi->twopass_frame.stats_in = start_pos;
 2233|      0|}
pass2_strategy.c:define_gf_group:
 2659|  24.6k|                            int is_final_pass) {
 2660|  24.6k|  AV1_COMMON *const cm = &cpi->common;
 2661|  24.6k|  RATE_CONTROL *const rc = &cpi->rc;
 2662|  24.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2663|  24.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2664|  24.6k|  TWO_PASS *const twopass = &cpi->ppi->twopass;
 2665|  24.6k|  FIRSTPASS_STATS next_frame;
 2666|  24.6k|  const FIRSTPASS_STATS *const start_pos = cpi->twopass_frame.stats_in;
 2667|  24.6k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
 2668|  24.6k|  const GFConfig *const gf_cfg = &oxcf->gf_cfg;
 2669|  24.6k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
 2670|  24.6k|  const int f_w = cm->width;
 2671|  24.6k|  const int f_h = cm->height;
 2672|  24.6k|  int i;
 2673|  24.6k|  const int is_intra_only = rc->frames_since_key == 0;
 2674|       |
 2675|  24.6k|  cpi->ppi->internal_altref_allowed = (gf_cfg->gf_max_pyr_height > 1);
 2676|       |
 2677|       |  // Reset the GF group data structures unless this is a key
 2678|       |  // frame in which case it will already have been done.
 2679|  24.6k|  if (!is_intra_only) {
  ------------------
  |  Branch (2679:7): [True: 0, False: 24.6k]
  ------------------
 2680|      0|    av1_zero(cpi->ppi->gf_group);
  ------------------
  |  |   43|      0|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 2681|      0|    cpi->gf_frame_index = 0;
 2682|      0|  }
 2683|       |
 2684|  24.6k|  if (has_no_stats_stage(cpi)) {
  ------------------
  |  Branch (2684:7): [True: 24.6k, False: 0]
  ------------------
 2685|  24.6k|    define_gf_group_pass0(cpi, is_final_pass);
 2686|  24.6k|    return;
 2687|  24.6k|  }
 2688|       |
 2689|       |#if CONFIG_THREE_PASS
 2690|       |  if (cpi->third_pass_ctx && oxcf->pass == AOM_RC_THIRD_PASS) {
 2691|       |    int ret = define_gf_group_pass3(cpi, frame_params, is_final_pass);
 2692|       |    if (ret == 0) return;
 2693|       |
 2694|       |    av1_free_thirdpass_ctx(cpi->third_pass_ctx);
 2695|       |    cpi->third_pass_ctx = NULL;
 2696|       |  }
 2697|       |#endif  // CONFIG_THREE_PASS
 2698|       |
 2699|       |  // correct frames_to_key when lookahead queue is emptying
 2700|      0|  if (cpi->ppi->lap_enabled) {
  ------------------
  |  Branch (2700:7): [True: 0, False: 0]
  ------------------
 2701|      0|    correct_frames_to_key(cpi);
 2702|      0|  }
 2703|       |
 2704|      0|  GF_GROUP_STATS gf_stats;
 2705|      0|  accumulate_gop_stats(cpi, is_intra_only, f_w, f_h, &next_frame, start_pos,
 2706|      0|                       &gf_stats, &i);
 2707|       |
 2708|      0|  const int can_disable_arf = !gf_cfg->gf_min_pyr_height;
 2709|       |
 2710|       |  // If this is a key frame or the overlay from a previous arf then
 2711|       |  // the error score / cost of this frame has already been accounted for.
 2712|      0|  const int active_min_gf_interval = rc->min_gf_interval;
 2713|       |
 2714|       |  // Disable internal ARFs for "still" gf groups.
 2715|       |  //   zero_motion_accumulator: minimum percentage of (0,0) motion;
 2716|       |  //   avg_sr_coded_error:      average of the SSE per pixel of each frame;
 2717|       |  //   avg_raw_err_stdev:       average of the standard deviation of (0,0)
 2718|       |  //                            motion error per block of each frame.
 2719|      0|  const int can_disable_internal_arfs = gf_cfg->gf_min_pyr_height <= 1;
 2720|      0|  if (can_disable_internal_arfs &&
  ------------------
  |  Branch (2720:7): [True: 0, False: 0]
  ------------------
 2721|      0|      gf_stats.zero_motion_accumulator > MIN_ZERO_MOTION &&
  ------------------
  |  |   28|      0|#define MIN_ZERO_MOTION 0.95
  ------------------
  |  Branch (2721:7): [True: 0, False: 0]
  ------------------
 2722|      0|      gf_stats.avg_sr_coded_error < MAX_SR_CODED_ERROR &&
  ------------------
  |  |   29|      0|#define MAX_SR_CODED_ERROR 40
  ------------------
  |  Branch (2722:7): [True: 0, False: 0]
  ------------------
 2723|      0|      gf_stats.avg_raw_err_stdev < MAX_RAW_ERR_VAR) {
  ------------------
  |  |   30|      0|#define MAX_RAW_ERR_VAR 2000
  ------------------
  |  Branch (2723:7): [True: 0, False: 0]
  ------------------
 2724|      0|    cpi->ppi->internal_altref_allowed = 0;
 2725|      0|  }
 2726|       |
 2727|      0|  int use_alt_ref;
 2728|      0|  if (can_disable_arf) {
  ------------------
  |  Branch (2728:7): [True: 0, False: 0]
  ------------------
 2729|      0|    use_alt_ref =
 2730|      0|        p_rc->use_arf_in_this_kf_group && (i < gf_cfg->lag_in_frames) &&
  ------------------
  |  Branch (2730:9): [True: 0, False: 0]
  |  Branch (2730:43): [True: 0, False: 0]
  ------------------
 2731|      0|        (i >= MIN_GF_INTERVAL) &&
  ------------------
  |  |   44|      0|#define MIN_GF_INTERVAL 4
  ------------------
  |  Branch (2731:9): [True: 0, False: 0]
  ------------------
 2732|      0|        ((cpi->oxcf.mode != REALTIME) ||
  ------------------
  |  Branch (2732:10): [True: 0, False: 0]
  ------------------
 2733|      0|         !is_almost_static(gf_stats.zero_motion_accumulator,
  ------------------
  |  Branch (2733:10): [True: 0, False: 0]
  ------------------
 2734|      0|                           twopass->kf_zeromotion_pct, cpi->ppi->lap_enabled));
 2735|      0|  } else {
 2736|      0|    use_alt_ref = p_rc->use_arf_in_this_kf_group &&
  ------------------
  |  Branch (2736:19): [True: 0, False: 0]
  ------------------
 2737|      0|                  (i < gf_cfg->lag_in_frames) && (i > 2);
  ------------------
  |  Branch (2737:19): [True: 0, False: 0]
  |  Branch (2737:50): [True: 0, False: 0]
  ------------------
 2738|      0|  }
 2739|      0|  if (use_alt_ref) {
  ------------------
  |  Branch (2739:7): [True: 0, False: 0]
  ------------------
 2740|      0|    gf_group->max_layer_depth_allowed = gf_cfg->gf_max_pyr_height;
 2741|      0|  } else {
 2742|      0|    gf_group->max_layer_depth_allowed = 0;
 2743|      0|  }
 2744|       |
 2745|      0|  int alt_offset = 0;
 2746|       |  // The length reduction strategy is tweaked for certain cases, and doesn't
 2747|       |  // work well for certain other cases.
 2748|      0|  const int allow_gf_length_reduction =
 2749|      0|      ((rc_cfg->mode == AOM_Q && rc_cfg->cq_level <= 128) ||
  ------------------
  |  Branch (2749:9): [True: 0, False: 0]
  |  Branch (2749:34): [True: 0, False: 0]
  ------------------
 2750|      0|       !cpi->ppi->internal_altref_allowed) &&
  ------------------
  |  Branch (2750:8): [True: 0, False: 0]
  ------------------
 2751|      0|      !is_lossless_requested(rc_cfg);
  ------------------
  |  Branch (2751:7): [True: 0, False: 0]
  ------------------
 2752|       |
 2753|      0|  if (allow_gf_length_reduction && use_alt_ref) {
  ------------------
  |  Branch (2753:7): [True: 0, False: 0]
  |  Branch (2753:36): [True: 0, False: 0]
  ------------------
 2754|       |    // adjust length of this gf group if one of the following condition met
 2755|       |    // 1: only one overlay frame left and this gf is too long
 2756|       |    // 2: next gf group is too short to have arf compared to the current gf
 2757|       |
 2758|       |    // maximum length of next gf group
 2759|      0|    const int next_gf_len = rc->frames_to_key - i;
 2760|      0|    const int single_overlay_left =
 2761|      0|        next_gf_len == 0 && i > REDUCE_GF_LENGTH_THRESH;
  ------------------
  |  | 2474|      0|#define REDUCE_GF_LENGTH_THRESH 4
  ------------------
  |  Branch (2761:9): [True: 0, False: 0]
  |  Branch (2761:29): [True: 0, False: 0]
  ------------------
 2762|       |    // the next gf is probably going to have a ARF but it will be shorter than
 2763|       |    // this gf
 2764|      0|    const int unbalanced_gf =
 2765|      0|        i > REDUCE_GF_LENGTH_TO_KEY_THRESH &&
  ------------------
  |  | 2475|      0|#define REDUCE_GF_LENGTH_TO_KEY_THRESH 9
  ------------------
  |  Branch (2765:9): [True: 0, False: 0]
  ------------------
 2766|      0|        next_gf_len + 1 < REDUCE_GF_LENGTH_TO_KEY_THRESH &&
  ------------------
  |  | 2475|      0|#define REDUCE_GF_LENGTH_TO_KEY_THRESH 9
  ------------------
  |  Branch (2766:9): [True: 0, False: 0]
  ------------------
 2767|      0|        next_gf_len + 1 >= rc->min_gf_interval;
  ------------------
  |  Branch (2767:9): [True: 0, False: 0]
  ------------------
 2768|       |
 2769|      0|    if (single_overlay_left || unbalanced_gf) {
  ------------------
  |  Branch (2769:9): [True: 0, False: 0]
  |  Branch (2769:32): [True: 0, False: 0]
  ------------------
 2770|      0|      const int roll_back = REDUCE_GF_LENGTH_BY;
  ------------------
  |  | 2476|      0|#define REDUCE_GF_LENGTH_BY 1
  ------------------
 2771|       |      // Reduce length only if active_min_gf_interval will be respected later.
 2772|      0|      if (i - roll_back >= active_min_gf_interval + 1) {
  ------------------
  |  Branch (2772:11): [True: 0, False: 0]
  ------------------
 2773|      0|        alt_offset = -roll_back;
 2774|      0|        i -= roll_back;
 2775|      0|        if (is_final_pass) rc->intervals_till_gf_calculate_due = 0;
  ------------------
  |  Branch (2775:13): [True: 0, False: 0]
  ------------------
 2776|      0|        p_rc->gf_intervals[p_rc->cur_gf_index] -= roll_back;
 2777|      0|        reset_fpf_position(&cpi->twopass_frame, start_pos);
 2778|      0|        accumulate_gop_stats(cpi, is_intra_only, f_w, f_h, &next_frame,
 2779|      0|                             start_pos, &gf_stats, &i);
 2780|      0|      }
 2781|      0|    }
 2782|      0|  }
 2783|       |
 2784|      0|  update_gop_length(rc, p_rc, i, is_final_pass);
 2785|       |
 2786|       |  // Set up the structure of this Group-Of-Pictures (same as GF_GROUP)
 2787|      0|  av1_gop_setup_structure(cpi, is_final_pass);
 2788|       |
 2789|      0|  set_gop_bits_boost(cpi, i, is_intra_only, is_final_pass, use_alt_ref,
 2790|      0|                     alt_offset, start_pos, &gf_stats);
 2791|       |
 2792|      0|  frame_params->frame_type =
 2793|      0|      rc->frames_since_key == 0 ? KEY_FRAME : INTER_FRAME;
  ------------------
  |  Branch (2793:7): [True: 0, False: 0]
  ------------------
 2794|      0|  frame_params->show_frame =
 2795|      0|      !(gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE ||
  ------------------
  |  Branch (2795:9): [True: 0, False: 0]
  ------------------
 2796|      0|        gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE);
  ------------------
  |  Branch (2796:9): [True: 0, False: 0]
  ------------------
 2797|      0|}
pass2_strategy.c:define_gf_group_pass0:
 2265|  24.6k|static void define_gf_group_pass0(AV1_COMP *cpi, const int is_final_pass) {
 2266|  24.6k|  RATE_CONTROL *const rc = &cpi->rc;
 2267|  24.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2268|  24.6k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 2269|  24.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2270|  24.6k|  const GFConfig *const gf_cfg = &oxcf->gf_cfg;
 2271|  24.6k|  int target;
 2272|       |
 2273|  24.6k|  p_rc->baseline_gf_interval = p_rc->gf_intervals[p_rc->cur_gf_index];
 2274|  24.6k|  rc->intervals_till_gf_calculate_due--;
 2275|  24.6k|  p_rc->cur_gf_index++;
 2276|       |
 2277|       |  // correct frames_to_key when lookahead queue is flushing
 2278|  24.6k|  correct_frames_to_key(cpi);
 2279|       |
 2280|  24.6k|  if (p_rc->baseline_gf_interval > rc->frames_to_key)
  ------------------
  |  Branch (2280:7): [True: 0, False: 24.6k]
  ------------------
 2281|      0|    p_rc->baseline_gf_interval = rc->frames_to_key;
 2282|       |
 2283|  24.6k|  p_rc->gfu_boost = DEFAULT_GF_BOOST;
  ------------------
  |  |   48|  24.6k|#define DEFAULT_GF_BOOST 2000
  ------------------
 2284|  24.6k|  p_rc->constrained_gf_group =
 2285|  24.6k|      (p_rc->baseline_gf_interval >= rc->frames_to_key) ? 1 : 0;
  ------------------
  |  Branch (2285:7): [True: 24.6k, False: 0]
  ------------------
 2286|       |
 2287|       |  // Default for pyr_height if inputs not set.
 2288|  24.6k|  if (oxcf->gf_cfg.gf_max_pyr_height == 0 ||
  ------------------
  |  Branch (2288:7): [True: 0, False: 24.6k]
  ------------------
 2289|  24.6k|      oxcf->gf_cfg.gf_min_pyr_height == 0) {
  ------------------
  |  Branch (2289:7): [True: 24.6k, False: 0]
  ------------------
 2290|  24.6k|    gf_group->max_layer_depth_allowed = 1;
 2291|  24.6k|  } else {
 2292|      0|    gf_group->max_layer_depth_allowed = oxcf->gf_cfg.gf_max_pyr_height;
 2293|      0|  }
 2294|       |
 2295|       |  // Rare case when the look-ahead is less than the target GOP length, can't
 2296|       |  // generate ARF frame.
 2297|       |  // Also disable ARF frame if the motion content (source_sad) is high in
 2298|       |  // lookahead buffer.
 2299|  24.6k|  const uint64_t thresh_sad = 8 * 64 * 64;
 2300|  24.6k|  if (p_rc->baseline_gf_interval > gf_cfg->lag_in_frames ||
  ------------------
  |  Branch (2300:7): [True: 24.6k, False: 0]
  ------------------
 2301|      0|      !is_altref_enabled(gf_cfg->lag_in_frames, gf_cfg->enable_auto_arf) ||
  ------------------
  |  Branch (2301:7): [True: 0, False: 0]
  ------------------
 2302|      0|      p_rc->baseline_gf_interval < rc->min_gf_interval ||
  ------------------
  |  Branch (2302:7): [True: 0, False: 0]
  ------------------
 2303|  24.6k|      rc->frame_source_sad_lag[0] > thresh_sad) {
  ------------------
  |  Branch (2303:7): [True: 0, False: 0]
  ------------------
 2304|  24.6k|    gf_group->max_layer_depth_allowed = 0;
 2305|  24.6k|  }
 2306|       |
 2307|       |  // Set up the structure of this Group-Of-Pictures (same as GF_GROUP)
 2308|  24.6k|  av1_gop_setup_structure(cpi, is_final_pass);
 2309|       |
 2310|       |  // Allocate bits to each of the frames in the GF group.
 2311|       |  // TODO(sarahparker) Extend this to work with pyramid structure.
 2312|   123k|  for (int cur_index = 0; cur_index < gf_group->size; ++cur_index) {
  ------------------
  |  Branch (2312:27): [True: 98.4k, False: 24.6k]
  ------------------
 2313|  98.4k|    const FRAME_UPDATE_TYPE cur_update_type = gf_group->update_type[cur_index];
 2314|  98.4k|    if (oxcf->rc_cfg.mode == AOM_CBR) {
  ------------------
  |  Branch (2314:9): [True: 0, False: 98.4k]
  ------------------
 2315|      0|      if (cur_update_type == KF_UPDATE) {
  ------------------
  |  Branch (2315:11): [True: 0, False: 0]
  ------------------
 2316|      0|        target = av1_calc_iframe_target_size_one_pass_cbr(cpi);
 2317|      0|      } else {
 2318|      0|        target = av1_calc_pframe_target_size_one_pass_cbr(cpi, cur_update_type);
 2319|      0|      }
 2320|  98.4k|    } else {
 2321|  98.4k|      if (cur_update_type == KF_UPDATE) {
  ------------------
  |  Branch (2321:11): [True: 24.6k, False: 73.8k]
  ------------------
 2322|  24.6k|        target = av1_calc_iframe_target_size_one_pass_vbr(cpi);
 2323|  73.8k|      } else {
 2324|  73.8k|        target = av1_calc_pframe_target_size_one_pass_vbr(cpi, cur_update_type);
 2325|  73.8k|      }
 2326|  98.4k|    }
 2327|  98.4k|    gf_group->bit_allocation[cur_index] = target;
 2328|  98.4k|  }
 2329|  24.6k|}

av1_cdef_mse_calc_block:
  520|  75.1k|                             int adaptive_cdef_mode) {
  521|       |  // TODO(aomedia:3276): Pass error_info to the low-level functions as required
  522|       |  // in future to handle error propagation.
  523|  75.1k|  (void)error_info;
  524|  75.1k|  const CommonModeInfoParams *const mi_params = cdef_search_ctx->mi_params;
  525|  75.1k|  const YV12_BUFFER_CONFIG *ref = cdef_search_ctx->ref;
  526|  75.1k|  const int coeff_shift = cdef_search_ctx->coeff_shift;
  527|  75.1k|  const int *mi_wide_l2 = cdef_search_ctx->mi_wide_l2;
  528|  75.1k|  const int *mi_high_l2 = cdef_search_ctx->mi_high_l2;
  529|       |
  530|       |  // Declare and initialize the temporary buffers.
  531|  75.1k|  DECLARE_ALIGNED(32, uint16_t, inbuf[CDEF_INBUF_SIZE]);
  ------------------
  |  |   19|  75.1k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  532|  75.1k|  cdef_list dlist[MI_SIZE_128X128 * MI_SIZE_128X128];
  533|  75.1k|  int dir[CDEF_NBLOCKS][CDEF_NBLOCKS] = { { 0 } };
  534|  75.1k|  int var[CDEF_NBLOCKS][CDEF_NBLOCKS] = { { 0 } };
  535|  75.1k|  uint16_t *const in = inbuf + CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   23|  75.1k|#define CDEF_VBORDER (2)
  ------------------
                uint16_t *const in = inbuf + CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   28|  75.1k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  75.1k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                uint16_t *const in = inbuf + CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   26|  75.1k|#define CDEF_HBORDER (8)
  ------------------
  536|  75.1k|  int nhb = AOMMIN(MI_SIZE_64X64, mi_params->mi_cols - MI_SIZE_64X64 * fbc);
  ------------------
  |  |   34|  75.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 21.2k, False: 53.9k]
  |  |  ------------------
  ------------------
  537|  75.1k|  int nvb = AOMMIN(MI_SIZE_64X64, mi_params->mi_rows - MI_SIZE_64X64 * fbr);
  ------------------
  |  |   34|  75.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 21.1k, False: 54.0k]
  |  |  ------------------
  ------------------
  538|  75.1k|  int hb_step = 1, vb_step = 1;
  539|  75.1k|  BLOCK_SIZE bs;
  540|       |
  541|  75.1k|  const MB_MODE_INFO *const mbmi =
  542|  75.1k|      mi_params->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  543|  75.1k|                              MI_SIZE_64X64 * fbc];
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  544|       |
  545|  75.1k|  uint8_t *ref_buffer[MAX_MB_PLANE] = { ref->y_buffer, ref->u_buffer,
  546|  75.1k|                                        ref->v_buffer };
  547|  75.1k|  int ref_stride[MAX_MB_PLANE] = { ref->y_stride, ref->uv_stride,
  548|  75.1k|                                   ref->uv_stride };
  549|       |
  550|  75.1k|  if (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_128X64 ||
  ------------------
  |  Branch (550:7): [True: 30, False: 75.1k]
  |  Branch (550:39): [True: 2, False: 75.1k]
  ------------------
  551|  75.1k|      mbmi->bsize == BLOCK_64X128) {
  ------------------
  |  Branch (551:7): [True: 18.4E, False: 75.1k]
  ------------------
  552|      0|    bs = mbmi->bsize;
  553|      0|    if (bs == BLOCK_128X128 || bs == BLOCK_128X64) {
  ------------------
  |  Branch (553:9): [True: 0, False: 0]
  |  Branch (553:32): [True: 0, False: 0]
  ------------------
  554|      0|      nhb = AOMMIN(MI_SIZE_128X128, mi_params->mi_cols - MI_SIZE_64X64 * fbc);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  555|      0|      hb_step = 2;
  556|      0|    }
  557|      0|    if (bs == BLOCK_128X128 || bs == BLOCK_64X128) {
  ------------------
  |  Branch (557:9): [True: 0, False: 0]
  |  Branch (557:32): [True: 0, False: 0]
  ------------------
  558|      0|      nvb = AOMMIN(MI_SIZE_128X128, mi_params->mi_rows - MI_SIZE_64X64 * fbr);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  559|      0|      vb_step = 2;
  560|      0|    }
  561|  75.1k|  } else {
  562|  75.1k|    bs = BLOCK_64X64;
  563|  75.1k|  }
  564|       |  // Get number of 8x8 blocks which are not skip. Cdef processing happens for
  565|       |  // 8x8 blocks which are not skip.
  566|  75.1k|  const int cdef_count = av1_cdef_compute_sb_list(
  567|  75.1k|      mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64, dlist, bs);
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64, dlist, bs);
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  568|  75.1k|  const bool is_fb_on_frm_left_boundary = (fbc == 0);
  569|  75.1k|  const bool is_fb_on_frm_right_boundary =
  570|  75.1k|      (fbc + hb_step == cdef_search_ctx->nhfb);
  571|  75.1k|  const bool is_fb_on_frm_top_boundary = (fbr == 0);
  572|  75.1k|  const bool is_fb_on_frm_bottom_boundary =
  573|  75.1k|      (fbr + vb_step == cdef_search_ctx->nvfb);
  574|  75.1k|  const int yoff = CDEF_VBORDER * (!is_fb_on_frm_top_boundary);
  ------------------
  |  |   23|  75.1k|#define CDEF_VBORDER (2)
  ------------------
  575|  75.1k|  const int xoff = CDEF_HBORDER * (!is_fb_on_frm_left_boundary);
  ------------------
  |  |   26|  75.1k|#define CDEF_HBORDER (8)
  ------------------
  576|  75.1k|  int dirinit = 0;
  577|   209k|  for (int pli = 0; pli < cdef_search_ctx->num_planes; pli++) {
  ------------------
  |  Branch (577:21): [True: 134k, False: 75.1k]
  ------------------
  578|       |    // To disable CDEF filter of chroma, set MSE of chroma strength index 0 to
  579|       |    // zero and all non-zero strength indices to 1, such that the joint
  580|       |    // luma-chroma strength search always chooses filter strength 0 for chroma
  581|       |    // due to least cost.
  582|   134k|    if (adaptive_cdef_mode > 0 && pli > 0) {
  ------------------
  |  Branch (582:9): [True: 0, False: 134k]
  |  Branch (582:35): [True: 0, False: 0]
  ------------------
  583|      0|      cdef_search_ctx->mse[pli][sb_count][0] = 0;
  584|      0|      for (int gi = 1; gi < cdef_search_ctx->total_strengths; gi++)
  ------------------
  |  Branch (584:24): [True: 0, False: 0]
  ------------------
  585|      0|        cdef_search_ctx->mse[pli][sb_count][gi] = 1;
  586|      0|      break;
  587|      0|    }
  588|       |
  589|       |    /* We avoid filtering the pixels for which some of the pixels to
  590|       |    average are outside the frame. We could change the filter instead,
  591|       |    but it would add special cases for any future vectorization. */
  592|   134k|    const int hfilt_size = (nhb << mi_wide_l2[pli]);
  593|   134k|    const int vfilt_size = (nvb << mi_high_l2[pli]);
  594|   134k|    const int ysize =
  595|   134k|        vfilt_size + CDEF_VBORDER * (!is_fb_on_frm_bottom_boundary) + yoff;
  ------------------
  |  |   23|   134k|#define CDEF_VBORDER (2)
  ------------------
  596|   134k|    const int xsize =
  597|   134k|        hfilt_size + CDEF_HBORDER * (!is_fb_on_frm_right_boundary) + xoff;
  ------------------
  |  |   26|   134k|#define CDEF_HBORDER (8)
  ------------------
  598|   134k|    const int row = fbr * MI_SIZE_64X64 << mi_high_l2[pli];
  ------------------
  |  |   58|   134k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   134k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  599|   134k|    const int col = fbc * MI_SIZE_64X64 << mi_wide_l2[pli];
  ------------------
  |  |   58|   134k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|   134k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  600|   134k|    struct macroblockd_plane pd = cdef_search_ctx->plane[pli];
  601|   134k|    cdef_search_ctx->copy_fn(&in[(-yoff * CDEF_BSTRIDE - xoff)], CDEF_BSTRIDE,
  ------------------
  |  |   28|   134k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   134k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  cdef_search_ctx->copy_fn(&in[(-yoff * CDEF_BSTRIDE - xoff)], CDEF_BSTRIDE,
  ------------------
  |  |   28|   134k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   134k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  602|   134k|                             pd.dst.buf, row - yoff, col - xoff, pd.dst.stride,
  603|   134k|                             ysize, xsize);
  604|   134k|    fill_borders_for_fbs_on_frame_boundary(
  605|   134k|        inbuf, hfilt_size, vfilt_size, is_fb_on_frm_left_boundary,
  606|   134k|        is_fb_on_frm_right_boundary, is_fb_on_frm_top_boundary,
  607|   134k|        is_fb_on_frm_bottom_boundary);
  608|   671k|    for (int gi = 0; gi < cdef_search_ctx->total_strengths; gi++) {
  ------------------
  |  Branch (608:22): [True: 537k, False: 134k]
  ------------------
  609|   537k|      int pri_strength, sec_strength;
  610|   537k|      get_cdef_filter_strengths(cdef_search_ctx->pick_method, &pri_strength,
  611|   537k|                                &sec_strength, gi);
  612|   537k|      const uint64_t curr_mse = get_filt_error(
  613|   537k|          cdef_search_ctx, &pd, dlist, dir, &dirinit, var, in, ref_buffer[pli],
  614|   537k|          ref_stride[pli], row, col, pri_strength, sec_strength, cdef_count,
  615|   537k|          pli, coeff_shift, bs);
  616|   537k|      if (pli < 2)
  ------------------
  |  Branch (616:11): [True: 418k, False: 118k]
  ------------------
  617|   418k|        cdef_search_ctx->mse[pli][sb_count][gi] = curr_mse;
  618|   118k|      else
  619|   118k|        cdef_search_ctx->mse[1][sb_count][gi] += curr_mse;
  620|   537k|    }
  621|   134k|  }
  622|  75.1k|  cdef_search_ctx->sb_index[sb_count] =
  623|  75.1k|      MI_SIZE_64X64 * fbr * mi_params->mi_stride + MI_SIZE_64X64 * fbc;
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    MI_SIZE_64X64 * fbr * mi_params->mi_stride + MI_SIZE_64X64 * fbc;
  ------------------
  |  |   58|  75.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  75.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  624|  75.1k|}
av1_cdef_dealloc_data:
  674|  60.5k|void av1_cdef_dealloc_data(CdefSearchCtx *cdef_search_ctx) {
  675|  60.5k|  if (cdef_search_ctx) {
  ------------------
  |  Branch (675:7): [True: 52.7k, False: 7.86k]
  ------------------
  676|  52.7k|    aom_free(cdef_search_ctx->mse[0]);
  677|  52.7k|    cdef_search_ctx->mse[0] = NULL;
  678|  52.7k|    aom_free(cdef_search_ctx->mse[1]);
  679|  52.7k|    cdef_search_ctx->mse[1] = NULL;
  680|  52.7k|    aom_free(cdef_search_ctx->sb_index);
  681|       |    cdef_search_ctx->sb_index = NULL;
  682|  52.7k|  }
  683|  60.5k|}
av1_pick_cdef_from_qp:
  748|  23.2k|                           int is_screen_content, bool avoid_uv_cdef) {
  749|  23.2k|  const int bd = cm->seq_params->bit_depth;
  750|  23.2k|  const int q =
  751|  23.2k|      av1_ac_quant_QTX(cm->quant_params.base_qindex, 0, bd) >> (bd - 8);
  752|  23.2k|  CdefInfo *const cdef_info = &cm->cdef_info;
  753|       |  // Check the speed feature to avoid extra signaling.
  754|  23.2k|  if (skip_cdef) {
  ------------------
  |  Branch (754:7): [True: 0, False: 23.2k]
  ------------------
  755|      0|    cdef_info->cdef_bits = 1;
  756|      0|    cdef_info->nb_cdef_strengths = 2;
  757|  23.2k|  } else {
  758|  23.2k|    cdef_info->cdef_bits = 0;
  759|  23.2k|    cdef_info->nb_cdef_strengths = 1;
  760|  23.2k|  }
  761|  23.2k|  cdef_info->cdef_damping = 3 + (cm->quant_params.base_qindex >> 6);
  762|       |
  763|  23.2k|  int predicted_y_f1 = 0;
  764|  23.2k|  int predicted_y_f2 = 0;
  765|  23.2k|  int predicted_uv_f1 = 0;
  766|  23.2k|  int predicted_uv_f2 = 0;
  767|  23.2k|  if (is_screen_content) {
  ------------------
  |  Branch (767:7): [True: 0, False: 23.2k]
  ------------------
  768|      0|    predicted_y_f1 =
  769|      0|        (int)(5.88217781e-06 * q * q + 6.10391455e-03 * q + 9.95043102e-02);
  770|      0|    predicted_y_f2 =
  771|      0|        (int)(-7.79934857e-06 * q * q + 6.58957830e-03 * q + 8.81045025e-01);
  772|      0|    predicted_uv_f1 =
  773|      0|        (int)(-6.79500136e-06 * q * q + 1.02695586e-02 * q + 1.36126802e-01);
  774|      0|    predicted_uv_f2 =
  775|      0|        (int)(-9.99613695e-08 * q * q - 1.79361339e-05 * q + 1.17022324e+0);
  776|      0|    predicted_y_f1 = clamp(predicted_y_f1, 0, 15);
  777|      0|    predicted_y_f2 = clamp(predicted_y_f2, 0, 3);
  778|      0|    predicted_uv_f1 = clamp(predicted_uv_f1, 0, 15);
  779|      0|    predicted_uv_f2 = clamp(predicted_uv_f2, 0, 3);
  780|  23.2k|  } else {
  781|  23.2k|    if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (781:9): [True: 17.5k, False: 5.62k]
  ------------------
  782|  17.5k|      predicted_y_f1 = clamp((int)roundf(q * q * -0.0000023593946f +
  783|  17.5k|                                         q * 0.0068615186f + 0.02709886f),
  784|  17.5k|                             0, 15);
  785|  17.5k|      predicted_y_f2 = clamp((int)roundf(q * q * -0.00000057629734f +
  786|  17.5k|                                         q * 0.0013993345f + 0.03831067f),
  787|  17.5k|                             0, 3);
  788|  17.5k|      predicted_uv_f1 = clamp((int)roundf(q * q * -0.0000007095069f +
  789|  17.5k|                                          q * 0.0034628846f + 0.00887099f),
  790|  17.5k|                              0, 15);
  791|  17.5k|      predicted_uv_f2 = clamp((int)roundf(q * q * 0.00000023874085f +
  792|  17.5k|                                          q * 0.00028223585f + 0.05576307f),
  793|  17.5k|                              0, 3);
  794|  17.5k|    } else {
  795|  5.62k|      predicted_y_f1 = clamp(
  796|  5.62k|          (int)roundf(q * q * 0.0000033731974f + q * 0.008070594f + 0.0187634f),
  797|  5.62k|          0, 15);
  798|  5.62k|      predicted_y_f2 = clamp((int)roundf(q * q * 0.0000029167343f +
  799|  5.62k|                                         q * 0.0027798624f + 0.0079405f),
  800|  5.62k|                             0, 3);
  801|  5.62k|      predicted_uv_f1 = clamp((int)roundf(q * q * -0.0000130790995f +
  802|  5.62k|                                          q * 0.012892405f - 0.00748388f),
  803|  5.62k|                              0, 15);
  804|  5.62k|      predicted_uv_f2 = clamp((int)roundf(q * q * 0.0000032651783f +
  805|  5.62k|                                          q * 0.00035520183f + 0.00228092f),
  806|  5.62k|                              0, 3);
  807|  5.62k|    }
  808|  23.2k|  }
  809|  23.2k|  cdef_info->cdef_strengths[0] =
  810|  23.2k|      predicted_y_f1 * CDEF_SEC_STRENGTHS + predicted_y_f2;
  ------------------
  |  |   17|  23.2k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  811|  23.2k|  cdef_info->cdef_uv_strengths[0] =
  812|  23.2k|      avoid_uv_cdef ? 0
  ------------------
  |  Branch (812:7): [True: 0, False: 23.2k]
  ------------------
  813|  23.2k|                    : predicted_uv_f1 * CDEF_SEC_STRENGTHS + predicted_uv_f2;
  ------------------
  |  |   17|  23.2k|#define CDEF_SEC_STRENGTHS 4
  ------------------
  814|       |
  815|       |  // mbmi->cdef_strength is already set in the encoding stage. We don't need to
  816|       |  // set it again here.
  817|  23.2k|  if (skip_cdef) {
  ------------------
  |  Branch (817:7): [True: 0, False: 23.2k]
  ------------------
  818|      0|    cdef_info->cdef_strengths[1] = 0;
  819|      0|    cdef_info->cdef_uv_strengths[1] = 0;
  820|      0|    return;
  821|      0|  }
  822|       |
  823|  23.2k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  824|  23.2k|  const int nvfb = (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  23.2k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  23.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nvfb = (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  23.2k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  23.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  825|  23.2k|  const int nhfb = (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  23.2k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  23.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                const int nhfb = (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  23.2k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  23.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  826|  23.2k|  MB_MODE_INFO **mbmi = mi_params->mi_grid_base;
  827|       |  // mbmi is NULL when real-time rate control library is used.
  828|  23.2k|  if (!mbmi) return;
  ------------------
  |  Branch (828:7): [True: 0, False: 23.2k]
  ------------------
  829|  54.6k|  for (int r = 0; r < nvfb; ++r) {
  ------------------
  |  Branch (829:19): [True: 31.4k, False: 23.2k]
  ------------------
  830|  78.5k|    for (int c = 0; c < nhfb; ++c) {
  ------------------
  |  Branch (830:21): [True: 47.0k, False: 31.4k]
  ------------------
  831|  47.0k|      MB_MODE_INFO *current_mbmi = mbmi[MI_SIZE_64X64 * c];
  ------------------
  |  |   58|  47.0k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  47.0k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  832|  47.0k|      current_mbmi->cdef_strength = 0;
  833|  47.0k|    }
  834|  31.4k|    mbmi += MI_SIZE_64X64 * mi_params->mi_stride;
  ------------------
  |  |   58|  31.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  31.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  835|  31.4k|  }
  836|  23.2k|}
av1_cdef_search:
  838|  70.2k|void av1_cdef_search(AV1_COMP *cpi) {
  839|  70.2k|  AV1_COMMON *cm = &cpi->common;
  840|  70.2k|  CDEF_CONTROL cdef_control = cpi->oxcf.tool_cfg.cdef_control;
  841|  70.2k|  const bool apply_adaptive_cdef =
  842|  70.2k|      cdef_control == CDEF_ADAPTIVE &&
  ------------------
  |  Branch (842:7): [True: 52.1k, False: 18.0k]
  ------------------
  843|  52.1k|      (cpi->oxcf.rc_cfg.mode == AOM_Q || cpi->oxcf.rc_cfg.mode == AOM_CQ);
  ------------------
  |  Branch (843:8): [True: 34.4k, False: 17.6k]
  |  Branch (843:42): [True: 0, False: 17.6k]
  ------------------
  844|       |
  845|  70.2k|  assert(cdef_control != CDEF_NONE);
  846|       |  // For CDEF_ADAPTIVE, turning off CDEF around qindex 32 was best for still
  847|       |  // pictures
  848|  70.2k|  if ((cdef_control == CDEF_REFERENCE &&
  ------------------
  |  Branch (848:8): [True: 0, False: 70.2k]
  ------------------
  849|      0|       cpi->ppi->rtc_ref.non_reference_frame) ||
  ------------------
  |  Branch (849:8): [True: 0, False: 0]
  ------------------
  850|  70.2k|      (apply_adaptive_cdef && cpi->oxcf.rc_cfg.cq_level <= 32)) {
  ------------------
  |  Branch (850:8): [True: 34.4k, False: 35.7k]
  |  Branch (850:31): [True: 4.84k, False: 29.6k]
  ------------------
  851|  4.84k|    CdefInfo *const cdef_info = &cm->cdef_info;
  852|  4.84k|    cdef_info->nb_cdef_strengths = 1;
  853|  4.84k|    cdef_info->cdef_bits = 0;
  854|  4.84k|    cdef_info->cdef_strengths[0] = 0;
  855|  4.84k|    cdef_info->cdef_uv_strengths[0] = 0;
  856|  4.84k|    return;
  857|  4.84k|  }
  858|       |
  859|       |  // Indicate if external RC is used for testing
  860|  65.3k|  const int rtc_ext_rc = cpi->rc.rtc_external_ratectrl;
  861|  65.3k|  if (rtc_ext_rc) {
  ------------------
  |  Branch (861:7): [True: 0, False: 65.3k]
  ------------------
  862|      0|    av1_pick_cdef_from_qp(cm, /*skip_cdef=*/0, /*is_screen_content=*/0,
  863|      0|                          /*avoid_uv_cdef=*/false);
  864|      0|    return;
  865|      0|  }
  866|  65.3k|  CDEF_PICK_METHOD pick_method = cpi->sf.lpf_sf.cdef_pick_method;
  867|  65.3k|  if (pick_method == CDEF_PICK_FROM_Q) {
  ------------------
  |  Branch (867:7): [True: 23.2k, False: 42.1k]
  ------------------
  868|  23.2k|    const int use_screen_content_model =
  869|  23.2k|        cm->quant_params.base_qindex >
  ------------------
  |  Branch (869:9): [True: 12.2k, False: 10.9k]
  ------------------
  870|  23.2k|            AOMMAX(cpi->sf.rt_sf.screen_content_cdef_filter_qindex_thresh,
  ------------------
  |  |   35|  46.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 23.2k]
  |  |  ------------------
  ------------------
  871|  23.2k|                   cpi->rc.best_quality + 5) &&
  872|  12.2k|        cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN;
  ------------------
  |  Branch (872:9): [True: 0, False: 12.2k]
  ------------------
  873|       |
  874|       |    // For adaptive CDEF, do not apply CDEF to chroma channels.
  875|       |    // This is done to reduce decode time, as CDEF is a relatively-expensive
  876|       |    // filter to compute.
  877|  23.2k|    const bool avoid_uv_cdef = apply_adaptive_cdef;
  878|       |
  879|  23.2k|    av1_pick_cdef_from_qp(cm, cpi->sf.rt_sf.skip_cdef_sb != 0,
  880|  23.2k|                          use_screen_content_model, avoid_uv_cdef);
  881|  23.2k|    return;
  882|  23.2k|  }
  883|  42.1k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  884|  42.1k|  const int damping = 3 + (cm->quant_params.base_qindex >> 6);
  885|  42.1k|  const int fast = (pick_method >= CDEF_FAST_SEARCH_LVL1 &&
  ------------------
  |  Branch (885:21): [True: 42.1k, False: 0]
  ------------------
  886|  42.1k|                    pick_method <= CDEF_FAST_SEARCH_LVL5);
  ------------------
  |  Branch (886:21): [True: 42.1k, False: 0]
  ------------------
  887|  42.1k|  const int adaptive_cdef_mode = cpi->sf.lpf_sf.adaptive_cdef_mode;
  888|  42.1k|  const int num_planes = av1_num_planes(cm);
  889|  42.1k|  MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
  890|       |
  891|  42.1k|  if (!cpi->cdef_search_ctx)
  ------------------
  |  Branch (891:7): [True: 10.5k, False: 31.6k]
  ------------------
  892|  42.1k|    CHECK_MEM_ERROR(cm, cpi->cdef_search_ctx,
  ------------------
  |  |   51|  10.5k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  10.5k|  do {                                                    \
  |  |  |  |   72|  10.5k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  10.5k|    lval = (expr);                                        \
  |  |  |  |   74|  10.5k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  |  |   75|  10.5k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  10.5k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  893|  42.1k|                    aom_calloc(1, sizeof(*cpi->cdef_search_ctx)));
  894|  42.1k|  CdefSearchCtx *cdef_search_ctx = cpi->cdef_search_ctx;
  895|       |
  896|       |  // Initialize parameters related to CDEF search context.
  897|  42.1k|  cdef_params_init(&cm->cur_frame->buf, cpi->source, cm, xd, cdef_search_ctx,
  898|  42.1k|                   pick_method);
  899|       |  // Allocate CDEF search context buffers.
  900|  42.1k|  cdef_alloc_data(cm, cdef_search_ctx);
  901|       |  // Frame level mse calculation.
  902|  42.1k|  if (cpi->mt_info.num_workers > 1) {
  ------------------
  |  Branch (902:7): [True: 31.9k, False: 10.2k]
  ------------------
  903|  31.9k|    av1_cdef_mse_calc_frame_mt(cpi);
  904|  31.9k|  } else {
  905|  10.2k|    cdef_mse_calc_frame(cdef_search_ctx, cm->error, adaptive_cdef_mode);
  906|  10.2k|  }
  907|       |
  908|       |  /* Search for different number of signaling bits. */
  909|  42.1k|  int nb_strength_bits = 0;
  910|  42.1k|  uint64_t best_rd = UINT64_MAX;
  911|  42.1k|  CdefInfo *const cdef_info = &cm->cdef_info;
  912|  42.1k|  int sb_count = cdef_search_ctx->sb_count;
  913|  42.1k|  uint64_t(*mse[2])[TOTAL_STRENGTHS];
  914|  42.1k|  mse[0] = cdef_search_ctx->mse[0];
  915|  42.1k|  mse[1] = cdef_search_ctx->mse[1];
  916|       |  /* Calculate the maximum number of bits required to signal CDEF strengths at
  917|       |   * block level */
  918|  42.1k|  const int total_strengths = nb_cdef_strengths[pick_method];
  919|  42.1k|  const int joint_strengths =
  920|  42.1k|      num_planes > 1 ? total_strengths * total_strengths : total_strengths;
  ------------------
  |  Branch (920:7): [True: 16.1k, False: 26.0k]
  ------------------
  921|  42.1k|  const int max_signaling_bits =
  922|  42.1k|      joint_strengths == 1 ? 0 : get_msb(joint_strengths - 1) + 1;
  ------------------
  |  Branch (922:7): [True: 0, False: 42.1k]
  ------------------
  923|  42.1k|  int rdmult = cpi->td.mb.rdmult;
  924|       |
  925|       |  // For adaptive CDEF, reduce primary and secondary CDEF strengths for
  926|       |  // qindexes up to 220.
  927|  42.1k|  const bool should_reduce_cdef_strengths =
  928|  42.1k|      apply_adaptive_cdef && cpi->oxcf.rc_cfg.cq_level <= 220;
  ------------------
  |  Branch (928:7): [True: 29.6k, False: 12.5k]
  |  Branch (928:30): [True: 18.8k, False: 10.7k]
  ------------------
  929|       |  // For adaptive CDEF with strength reduction, zero out CDEF strengths with
  930|       |  // low values (luma and/or chroma). This is done to reduce decode time, as
  931|       |  // CDEF is a relatively-expensive filter to compute.
  932|  42.1k|  const bool should_zero_cdef_strengths =
  933|  42.1k|      should_reduce_cdef_strengths && cpi->sf.lpf_sf.zero_low_cdef_strengths;
  ------------------
  |  Branch (933:7): [True: 18.8k, False: 23.3k]
  |  Branch (933:39): [True: 8.47k, False: 10.3k]
  ------------------
  934|       |  // If running adaptive CDEF with strength zeroing, let search derive at least
  935|       |  // two CDEF strengths (i.e. at least 1 CDEF signaling bit), unless search was
  936|       |  // explicitly set to search for 1 strength only (i.e. 0 CDEF signaling bits).
  937|       |  // Doing so will help find opportunities to zero out low strengths to reduce
  938|       |  // overall decode time.
  939|  42.1k|  const int min_signaling_bits =
  940|  42.1k|      (should_zero_cdef_strengths && max_signaling_bits > 0) ? 1 : 0;
  ------------------
  |  Branch (940:8): [True: 8.47k, False: 33.6k]
  |  Branch (940:38): [True: 8.47k, False: 0]
  ------------------
  941|       |
  942|   176k|  for (int i = min_signaling_bits; i <= 3; i++) {
  ------------------
  |  Branch (942:36): [True: 160k, False: 16.1k]
  ------------------
  943|   160k|    if (i > max_signaling_bits) break;
  ------------------
  |  Branch (943:9): [True: 26.0k, False: 134k]
  ------------------
  944|   134k|    int best_lev0[CDEF_MAX_STRENGTHS] = { 0 };
  945|   134k|    int best_lev1[CDEF_MAX_STRENGTHS] = { 0 };
  946|   134k|    const int nb_strengths = 1 << i;
  947|   134k|    uint64_t tot_mse;
  948|   134k|    if (num_planes > 1) {
  ------------------
  |  Branch (948:9): [True: 59.9k, False: 74.2k]
  ------------------
  949|  59.9k|      tot_mse = joint_strength_search_dual(best_lev0, best_lev1, nb_strengths,
  950|  59.9k|                                           mse, sb_count, pick_method);
  951|  74.2k|    } else {
  952|  74.2k|      tot_mse = joint_strength_search(best_lev0, nb_strengths, mse[0], sb_count,
  953|  74.2k|                                      pick_method);
  954|  74.2k|    }
  955|       |
  956|   134k|    const int total_bits = sb_count * i + nb_strengths * CDEF_STRENGTH_BITS *
  ------------------
  |  |   14|   134k|#define CDEF_STRENGTH_BITS 6
  ------------------
  957|   134k|                                              (num_planes > 1 ? 2 : 1);
  ------------------
  |  Branch (957:48): [True: 59.9k, False: 74.2k]
  ------------------
  958|   134k|    const int rate_cost = av1_cost_literal(total_bits);
  ------------------
  |  |   29|   134k|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   134k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  959|   134k|    const uint64_t dist = tot_mse * 16;
  960|   134k|    const uint64_t rd = RDCOST(rdmult, rate_cost, dist);
  ------------------
  |  |   33|   134k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   134k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   134k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   134k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  961|   134k|    if (rd < best_rd) {
  ------------------
  |  Branch (961:9): [True: 43.6k, False: 90.4k]
  ------------------
  962|  43.6k|      best_rd = rd;
  963|  43.6k|      nb_strength_bits = i;
  964|  43.6k|      memcpy(cdef_info->cdef_strengths, best_lev0,
  965|  43.6k|             nb_strengths * sizeof(best_lev0[0]));
  966|  43.6k|      if (num_planes > 1) {
  ------------------
  |  Branch (966:11): [True: 16.5k, False: 27.0k]
  ------------------
  967|  16.5k|        memcpy(cdef_info->cdef_uv_strengths, best_lev1,
  968|  16.5k|               nb_strengths * sizeof(best_lev1[0]));
  969|  16.5k|      }
  970|  43.6k|    }
  971|   134k|  }
  972|       |
  973|  42.1k|  cdef_info->cdef_bits = nb_strength_bits;
  974|  42.1k|  cdef_info->nb_cdef_strengths = 1 << nb_strength_bits;
  975|  42.1k|  uint64_t tot_best_mse_y = 0, tot_zero_mse_y = 0;
  976|   117k|  for (int i = 0; i < sb_count; i++) {
  ------------------
  |  Branch (976:19): [True: 75.2k, False: 42.1k]
  ------------------
  977|  75.2k|    uint64_t best_mse = UINT64_MAX;
  978|  75.2k|    int best_gi = 0;
  979|  75.2k|    tot_zero_mse_y += mse[0][i][0];
  980|   176k|    for (int gi = 0; gi < cdef_info->nb_cdef_strengths; gi++) {
  ------------------
  |  Branch (980:22): [True: 101k, False: 75.2k]
  ------------------
  981|   101k|      uint64_t curr = mse[0][i][cdef_info->cdef_strengths[gi]];
  982|   101k|      if (num_planes > 1) curr += mse[1][i][cdef_info->cdef_uv_strengths[gi]];
  ------------------
  |  Branch (982:11): [True: 41.9k, False: 59.2k]
  ------------------
  983|   101k|      if (curr < best_mse) {
  ------------------
  |  Branch (983:11): [True: 81.9k, False: 19.2k]
  ------------------
  984|  81.9k|        best_gi = gi;
  985|  81.9k|        best_mse = curr;
  986|  81.9k|      }
  987|   101k|    }
  988|       |    // When adaptive_cdef_mode is enabled, CDEF filter of chroma is disabled by
  989|       |    // setting the MSE at chroma strength index 0 to zero, ensuring zero filter
  990|       |    // strength always wins for chroma. Hence, best_mse reflects luma MSE only.
  991|  75.2k|    tot_best_mse_y += best_mse;
  992|  75.2k|    mi_params->mi_grid_base[cdef_search_ctx->sb_index[i]]->cdef_strength =
  993|  75.2k|        best_gi;
  994|  75.2k|  }
  995|       |
  996|       |  // Disable CDEF filter of luma if the MSE improvement over zero filter
  997|       |  // strength is below the threshold.
  998|  42.1k|  if (cm->current_frame.pyramid_level > 1 &&
  ------------------
  |  Branch (998:7): [True: 21.0k, False: 21.0k]
  ------------------
  999|  21.0k|      cpi->sf.lpf_sf.adaptive_cdef_mode > 0 && sb_count > 0) {
  ------------------
  |  Branch (999:7): [True: 0, False: 21.0k]
  |  Branch (999:48): [True: 0, False: 0]
  ------------------
 1000|      0|    const double cdef_mse_pct_imp_thresh = 4.0;
 1001|      0|    double luma_mse_gain_pct = 0.0;
 1002|       |    // Percentage reduction in luma MSE with best CDEF strength vs zero
 1003|       |    // strength.
 1004|      0|    luma_mse_gain_pct =
 1005|      0|        (tot_zero_mse_y - tot_best_mse_y) * 100.0 / tot_zero_mse_y;
 1006|      0|    if (luma_mse_gain_pct < cdef_mse_pct_imp_thresh) {
  ------------------
  |  Branch (1006:9): [True: 0, False: 0]
  ------------------
 1007|      0|      cdef_info->nb_cdef_strengths = 1;
 1008|      0|      cdef_info->cdef_bits = 0;
 1009|      0|      cdef_info->cdef_strengths[0] = 0;
 1010|      0|      cdef_info->cdef_uv_strengths[0] = 0;
 1011|      0|      for (int i = 0; i < sb_count; i++) {
  ------------------
  |  Branch (1011:23): [True: 0, False: 0]
  ------------------
 1012|      0|        mi_params->mi_grid_base[cdef_search_ctx->sb_index[i]]->cdef_strength =
 1013|      0|            0;
 1014|      0|      }
 1015|      0|    }
 1016|      0|  }
 1017|       |
 1018|  42.1k|  if (fast) {
  ------------------
  |  Branch (1018:7): [True: 42.1k, False: 0]
  ------------------
 1019|  94.4k|    for (int j = 0; j < cdef_info->nb_cdef_strengths; j++) {
  ------------------
  |  Branch (1019:21): [True: 52.2k, False: 42.1k]
  ------------------
 1020|  52.2k|      const int luma_strength = cdef_info->cdef_strengths[j];
 1021|  52.2k|      int pri_strength, sec_strength;
 1022|       |
 1023|  52.2k|      STORE_CDEF_FILTER_STRENGTH(cdef_info->cdef_strengths[j], pick_method,
  ------------------
  |  |   78|  52.2k|  do {                                                                       \
  |  |   79|  52.2k|    get_cdef_filter_strengths((pick_method), &pri_strength, &sec_strength,   \
  |  |   80|  52.2k|                              (strength_idx));                               \
  |  |   81|  52.2k|    cdef_strength = pri_strength * CDEF_SEC_STRENGTHS + sec_strength;        \
  |  |  ------------------
  |  |  |  |   17|  52.2k|#define CDEF_SEC_STRENGTHS 4
  |  |  ------------------
  |  |   82|  52.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
 1024|  52.2k|                                 luma_strength);
 1025|  52.2k|      if (num_planes > 1) {
  ------------------
  |  Branch (1025:11): [True: 21.2k, False: 31.0k]
  ------------------
 1026|  21.2k|        const int chroma_strength = cdef_info->cdef_uv_strengths[j];
 1027|  21.2k|        STORE_CDEF_FILTER_STRENGTH(cdef_info->cdef_uv_strengths[j], pick_method,
  ------------------
  |  |   78|  21.2k|  do {                                                                       \
  |  |   79|  21.2k|    get_cdef_filter_strengths((pick_method), &pri_strength, &sec_strength,   \
  |  |   80|  21.2k|                              (strength_idx));                               \
  |  |   81|  21.2k|    cdef_strength = pri_strength * CDEF_SEC_STRENGTHS + sec_strength;        \
  |  |  ------------------
  |  |  |  |   17|  21.2k|#define CDEF_SEC_STRENGTHS 4
  |  |  ------------------
  |  |   82|  21.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (82:12): [Folded, False: 21.2k]
  |  |  ------------------
  ------------------
 1028|  21.2k|                                   chroma_strength);
 1029|  21.2k|      }
 1030|  52.2k|    }
 1031|  42.1k|  }
 1032|       |
 1033|       |  // Perform CDEF strength reduction.
 1034|       |  // Note 1: for odd strengths, the 0.5 discarded by ">> 1" is a significant
 1035|       |  // part of the strength when the strength is small, and because there are
 1036|       |  // few strength levels, odd strengths are reduced significantly more than a
 1037|       |  // half. This is intended behavior for reduced strength.
 1038|       |  // For example: a pri strength of 3 becomes 1, and a sec strength of 1
 1039|       |  // becomes 0.
 1040|       |  // Note 2: a (signaled) sec strength value of 3 is special as it results in an
 1041|       |  // actual sec strength of 4. We tried adding +1 to the sec strength 3 so it
 1042|       |  // maps to a reduced sec strength of 2. However, on Daala's subset1, the
 1043|       |  // resulting SSIMULACRA 2 scores were either exactly the same (at cpu-used 6),
 1044|       |  // or within noise level (at cpu-used 3). Given that there were no discernible
 1045|       |  // improvements, this special mapping was left out for reduced strength.
 1046|  42.1k|  if (should_reduce_cdef_strengths) {
  ------------------
  |  Branch (1046:7): [True: 18.8k, False: 23.3k]
  ------------------
 1047|  46.7k|    for (int j = 0; j < cdef_info->nb_cdef_strengths; j++) {
  ------------------
  |  Branch (1047:21): [True: 27.9k, False: 18.8k]
  ------------------
 1048|  27.9k|      const int luma_strength = cdef_info->cdef_strengths[j];
 1049|  27.9k|      const int new_pri_luma_strength =
 1050|  27.9k|          (luma_strength / CDEF_SEC_STRENGTHS) >> 1;
  ------------------
  |  |   17|  27.9k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1051|  27.9k|      const int new_sec_luma_strength =
 1052|  27.9k|          (luma_strength % CDEF_SEC_STRENGTHS) >> 1;
  ------------------
  |  |   17|  27.9k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1053|       |
 1054|  27.9k|      cdef_info->cdef_strengths[j] =
 1055|  27.9k|          new_pri_luma_strength * CDEF_SEC_STRENGTHS + new_sec_luma_strength;
  ------------------
  |  |   17|  27.9k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1056|       |
 1057|  27.9k|      int new_pri_chroma_strength;
 1058|  27.9k|      int new_sec_chroma_strength;
 1059|       |
 1060|  27.9k|      if (num_planes > 1) {
  ------------------
  |  Branch (1060:11): [True: 15.3k, False: 12.5k]
  ------------------
 1061|  15.3k|        const int chroma_strength = cdef_info->cdef_uv_strengths[j];
 1062|  15.3k|        new_pri_chroma_strength = (chroma_strength / CDEF_SEC_STRENGTHS) >> 1;
  ------------------
  |  |   17|  15.3k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1063|  15.3k|        new_sec_chroma_strength = (chroma_strength % CDEF_SEC_STRENGTHS) >> 1;
  ------------------
  |  |   17|  15.3k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1064|       |
 1065|  15.3k|        cdef_info->cdef_uv_strengths[j] =
 1066|  15.3k|            new_pri_chroma_strength * CDEF_SEC_STRENGTHS +
  ------------------
  |  |   17|  15.3k|#define CDEF_SEC_STRENGTHS 4
  ------------------
 1067|  15.3k|            new_sec_chroma_strength;
 1068|  15.3k|      }
 1069|       |
 1070|       |      // Zero out entries with low CDEF luma (and optional chroma) strengths.
 1071|       |      // The low-strength thresholds were empirically derived from subjective
 1072|       |      // testing and SSIMULACRA 2 scores. These strike a balance between
 1073|       |      // perceptual quality gains and a reasonable single-threaded decode time
 1074|       |      // increase (~10%) over --enable-cdef 0. There's an overall 0.18 point
 1075|       |      // loss in SSIMULACRA 2 scores over no CDEF strength zeroing at speed 6,
 1076|       |      // QP 30 on the CLIC 2020 dataset.
 1077|  27.9k|      if (should_zero_cdef_strengths) {
  ------------------
  |  Branch (1077:11): [True: 17.0k, False: 10.8k]
  ------------------
 1078|  17.0k|        const bool is_low_luma_strength =
 1079|  17.0k|            new_pri_luma_strength <= 4 && new_sec_luma_strength <= 1;
  ------------------
  |  Branch (1079:13): [True: 11.2k, False: 5.74k]
  |  Branch (1079:43): [True: 11.2k, False: 0]
  ------------------
 1080|       |
 1081|  17.0k|        if (is_low_luma_strength) {
  ------------------
  |  Branch (1081:13): [True: 11.2k, False: 5.74k]
  ------------------
 1082|  11.2k|          cdef_info->cdef_strengths[j] = 0;
 1083|  11.2k|        }
 1084|  17.0k|        if (num_planes > 1) {
  ------------------
  |  Branch (1084:13): [True: 9.31k, False: 7.72k]
  ------------------
 1085|  9.31k|          const bool is_low_chroma_strength =
 1086|  9.31k|              new_pri_chroma_strength <= 4 && new_sec_chroma_strength <= 1;
  ------------------
  |  Branch (1086:15): [True: 5.65k, False: 3.65k]
  |  Branch (1086:47): [True: 5.65k, False: 0]
  ------------------
 1087|       |
 1088|  9.31k|          if (is_low_luma_strength || is_low_chroma_strength) {
  ------------------
  |  Branch (1088:15): [True: 6.07k, False: 3.23k]
  |  Branch (1088:39): [True: 686, False: 2.55k]
  ------------------
 1089|       |            // Disable CDEF on chroma if we've disabled it on luma
 1090|  6.75k|            cdef_info->cdef_uv_strengths[j] = 0;
 1091|  6.75k|          }
 1092|  9.31k|        }
 1093|  17.0k|      }
 1094|  27.9k|    }
 1095|  18.8k|  }
 1096|       |
 1097|  42.1k|  cdef_info->cdef_damping = damping;
 1098|       |  // Deallocate CDEF search context buffers.
 1099|  42.1k|  av1_cdef_dealloc_data(cdef_search_ctx);
 1100|  42.1k|}
pickcdef.c:fill_borders_for_fbs_on_frame_boundary:
  320|   134k|    bool is_fb_on_frm_top_boundary, bool is_fb_on_frm_bottom_boundary) {
  321|   134k|  if (!is_fb_on_frm_left_boundary && !is_fb_on_frm_right_boundary &&
  ------------------
  |  Branch (321:7): [True: 39.2k, False: 95.2k]
  |  Branch (321:38): [True: 16.8k, False: 22.4k]
  ------------------
  322|  16.8k|      !is_fb_on_frm_top_boundary && !is_fb_on_frm_bottom_boundary)
  ------------------
  |  Branch (322:7): [True: 7.00k, False: 9.87k]
  |  Branch (322:37): [True: 3.27k, False: 3.72k]
  ------------------
  323|  3.27k|    return;
  324|   131k|  if (is_fb_on_frm_bottom_boundary) {
  ------------------
  |  Branch (324:7): [True: 97.0k, False: 34.1k]
  ------------------
  325|       |    // Fill bottom region of the block
  326|  97.0k|    const int buf_offset =
  327|  97.0k|        (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   23|  97.0k|#define CDEF_VBORDER (2)
  ------------------
                      (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   28|  97.0k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  97.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                      (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + CDEF_HBORDER;
  ------------------
  |  |   26|  97.0k|#define CDEF_HBORDER (8)
  ------------------
  328|  97.0k|    fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, hfilt_size,
  ------------------
  |  |   28|  97.0k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  97.0k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, hfilt_size,
  ------------------
  |  |   23|  97.0k|#define CDEF_VBORDER (2)
  ------------------
  329|  97.0k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|  97.0k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  330|  97.0k|  }
  331|   131k|  if (is_fb_on_frm_bottom_boundary || is_fb_on_frm_left_boundary) {
  ------------------
  |  Branch (331:7): [True: 96.9k, False: 34.2k]
  |  Branch (331:39): [True: 22.3k, False: 11.8k]
  ------------------
  332|   119k|    const int buf_offset = (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE;
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                  const int buf_offset = (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE;
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  333|       |    // Fill bottom-left region of the block
  334|   119k|    fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
  335|   119k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   119k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  336|   119k|  }
  337|   131k|  if (is_fb_on_frm_bottom_boundary || is_fb_on_frm_right_boundary) {
  ------------------
  |  Branch (337:7): [True: 96.9k, False: 34.2k]
  |  Branch (337:39): [True: 22.4k, False: 11.8k]
  ------------------
  338|   119k|    const int buf_offset =
  339|   119k|        (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + hfilt_size + CDEF_HBORDER;
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                      (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + hfilt_size + CDEF_HBORDER;
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                      (vfilt_size + CDEF_VBORDER) * CDEF_BSTRIDE + hfilt_size + CDEF_HBORDER;
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
  340|       |    // Fill bottom-right region of the block
  341|   119k|    fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
  342|   119k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   119k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  343|   119k|  }
  344|   131k|  if (is_fb_on_frm_top_boundary) {
  ------------------
  |  Branch (344:7): [True: 96.8k, False: 34.4k]
  ------------------
  345|       |    // Fill top region of the block
  346|  96.8k|    fill_rect(&inbuf[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hfilt_size,
  ------------------
  |  |   26|  96.8k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&inbuf[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hfilt_size,
  ------------------
  |  |   28|  96.8k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  96.8k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hfilt_size,
  ------------------
  |  |   23|  96.8k|#define CDEF_VBORDER (2)
  ------------------
  347|  96.8k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|  96.8k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  348|  96.8k|  }
  349|   131k|  if (is_fb_on_frm_top_boundary || is_fb_on_frm_left_boundary) {
  ------------------
  |  Branch (349:7): [True: 96.6k, False: 34.5k]
  |  Branch (349:36): [True: 22.5k, False: 11.9k]
  ------------------
  350|       |    // Fill top-left region of the block
  351|   119k|    fill_rect(inbuf, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(inbuf, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(inbuf, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(inbuf, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|   119k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  352|   119k|  }
  353|   131k|  if (is_fb_on_frm_top_boundary || is_fb_on_frm_right_boundary) {
  ------------------
  |  Branch (353:7): [True: 96.7k, False: 34.4k]
  |  Branch (353:36): [True: 22.5k, False: 11.9k]
  ------------------
  354|   119k|    const int buf_offset = hfilt_size + CDEF_HBORDER;
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
  355|       |    // Fill top-right region of the block
  356|   119k|    fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   28|   119k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   119k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   23|   119k|#define CDEF_VBORDER (2)
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
  ------------------
  |  |   26|   119k|#define CDEF_HBORDER (8)
  ------------------
  357|   119k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|   119k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  358|   119k|  }
  359|   131k|  if (is_fb_on_frm_left_boundary) {
  ------------------
  |  Branch (359:7): [True: 95.2k, False: 35.9k]
  ------------------
  360|  95.2k|    const int buf_offset = CDEF_VBORDER * CDEF_BSTRIDE;
  ------------------
  |  |   23|  95.2k|#define CDEF_VBORDER (2)
  ------------------
                  const int buf_offset = CDEF_VBORDER * CDEF_BSTRIDE;
  ------------------
  |  |   28|  95.2k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  95.2k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  361|       |    // Fill left region of the block
  362|  95.2k|    fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, vfilt_size, CDEF_HBORDER,
  ------------------
  |  |   28|  95.2k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  95.2k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
                  fill_rect(&inbuf[buf_offset], CDEF_BSTRIDE, vfilt_size, CDEF_HBORDER,
  ------------------
  |  |   26|  95.2k|#define CDEF_HBORDER (8)
  ------------------
  363|  95.2k|              CDEF_VERY_LARGE);
  ------------------
  |  |   30|  95.2k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  364|  95.2k|  }
  365|   131k|  if (is_fb_on_frm_right_boundary) {
  ------------------
  |  Branch (365:7): [True: 95.4k, False: 35.7k]
  ------------------
  366|  95.4k|    const int buf_offset = CDEF_VBORDER * CDEF_BSTRIDE;
  ------------------
  |  |   23|  95.4k|#define CDEF_VBORDER (2)
  ------------------
                  const int buf_offset = CDEF_VBORDER * CDEF_BSTRIDE;
  ------------------
  |  |   28|  95.4k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  95.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  367|       |    // Fill right region of the block
  368|  95.4k|    fill_rect(&inbuf[buf_offset + hfilt_size + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   26|  95.4k|#define CDEF_HBORDER (8)
  ------------------
                  fill_rect(&inbuf[buf_offset + hfilt_size + CDEF_HBORDER], CDEF_BSTRIDE,
  ------------------
  |  |   28|  95.4k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|  95.4k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  369|  95.4k|              vfilt_size, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   26|  95.4k|#define CDEF_HBORDER (8)
  ------------------
                            vfilt_size, CDEF_HBORDER, CDEF_VERY_LARGE);
  ------------------
  |  |   30|  95.4k|#define CDEF_VERY_LARGE (0x4000)
  ------------------
  370|  95.4k|  }
  371|   131k|}
pickcdef.c:get_cdef_filter_strengths:
   32|   610k|                                             int strength_idx) {
   33|   610k|  const int tot_sec_filter =
   34|   610k|      (pick_method == CDEF_FAST_SEARCH_LVL5)
  ------------------
  |  Branch (34:7): [True: 0, False: 610k]
  ------------------
   35|   610k|          ? REDUCED_SEC_STRENGTHS_LVL5
  ------------------
  |  |   37|      0|#define REDUCED_SEC_STRENGTHS_LVL5 1
  ------------------
   36|   610k|          : ((pick_method >= CDEF_FAST_SEARCH_LVL3) ? REDUCED_SEC_STRENGTHS_LVL3
  ------------------
  |  |   36|   610k|#define REDUCED_SEC_STRENGTHS_LVL3 2
  ------------------
  |  Branch (36:14): [True: 610k, False: 18.4E]
  ------------------
   37|  18.4E|                                                    : CDEF_SEC_STRENGTHS);
  ------------------
  |  |   17|  18.4E|#define CDEF_SEC_STRENGTHS 4
  ------------------
   38|   610k|  const int pri_idx = strength_idx / tot_sec_filter;
   39|   610k|  const int sec_idx = strength_idx % tot_sec_filter;
   40|   610k|  *pri_strength = pri_idx;
   41|   610k|  *sec_strength = sec_idx;
   42|   610k|  if (pick_method == CDEF_FULL_SEARCH) return;
  ------------------
  |  Branch (42:7): [True: 0, False: 610k]
  ------------------
   43|       |
   44|   610k|  switch (pick_method) {
   45|      0|    case CDEF_FAST_SEARCH_LVL1:
  ------------------
  |  Branch (45:5): [True: 0, False: 610k]
  ------------------
   46|      0|      assert(pri_idx < REDUCED_PRI_STRENGTHS_LVL1);
   47|      0|      *pri_strength = priconv_lvl1[pri_idx];
   48|      0|      break;
   49|      0|    case CDEF_FAST_SEARCH_LVL2:
  ------------------
  |  Branch (49:5): [True: 0, False: 610k]
  ------------------
   50|      0|      assert(pri_idx < REDUCED_PRI_STRENGTHS_LVL2);
   51|      0|      *pri_strength = priconv_lvl2[pri_idx];
   52|      0|      break;
   53|      0|    case CDEF_FAST_SEARCH_LVL3:
  ------------------
  |  Branch (53:5): [True: 0, False: 610k]
  ------------------
   54|      0|      assert(pri_idx < REDUCED_PRI_STRENGTHS_LVL2);
   55|      0|      assert(sec_idx < REDUCED_SEC_STRENGTHS_LVL3);
   56|      0|      *pri_strength = priconv_lvl2[pri_idx];
   57|      0|      *sec_strength = secconv_lvl3[sec_idx];
   58|      0|      break;
   59|   610k|    case CDEF_FAST_SEARCH_LVL4:
  ------------------
  |  Branch (59:5): [True: 610k, False: 18.4E]
  ------------------
   60|   610k|      assert(pri_idx < REDUCED_PRI_STRENGTHS_LVL4);
   61|   610k|      assert(sec_idx < REDUCED_SEC_STRENGTHS_LVL3);
   62|   610k|      *pri_strength = priconv_lvl4[pri_idx];
   63|   610k|      *sec_strength = secconv_lvl3[sec_idx];
   64|   610k|      break;
   65|      0|    case CDEF_FAST_SEARCH_LVL5:
  ------------------
  |  Branch (65:5): [True: 0, False: 610k]
  ------------------
   66|      0|      assert(pri_idx < REDUCED_PRI_STRENGTHS_LVL4);
   67|      0|      assert(sec_idx < REDUCED_SEC_STRENGTHS_LVL5);
   68|      0|      *pri_strength = priconv_lvl5[pri_idx];
   69|      0|      *sec_strength = secconv_lvl5[sec_idx];
   70|      0|      break;
   71|      0|    default: assert(0 && "Invalid CDEF search method");
  ------------------
  |  Branch (71:5): [True: 0, False: 610k]
  ------------------
   72|   610k|  }
   73|   610k|}
pickcdef.c:get_filt_error:
  406|   537k|    int cdef_count, int pli, int coeff_shift, BLOCK_SIZE bs) {
  407|   537k|  uint64_t curr_sse = 0;
  408|   537k|  const BLOCK_SIZE plane_bsize =
  409|   537k|      get_plane_block_size(bs, pd->subsampling_x, pd->subsampling_y);
  410|   537k|  const int bw_log2 = 3 - pd->subsampling_x;
  411|   537k|  const int bh_log2 = 3 - pd->subsampling_y;
  412|       |
  413|       |  // TODO(Ranjit): Extend this optimization for HBD
  414|   537k|  if (!cdef_search_ctx->use_highbitdepth) {
  ------------------
  |  Branch (414:7): [True: 382k, False: 154k]
  ------------------
  415|       |    // If all 8x8/4x4 blocks in CDEF block need to be filtered, calculate the
  416|       |    // error at CDEF block level
  417|   382k|    const int tot_blk_count =
  418|   382k|        (block_size_wide[plane_bsize] * block_size_high[plane_bsize]) >>
  419|   382k|        (bw_log2 + bh_log2);
  420|   382k|    if (cdef_count == tot_blk_count) {
  ------------------
  |  Branch (420:9): [True: 71.8k, False: 310k]
  ------------------
  421|  71.8k|      const ptrdiff_t buf_offset = (ptrdiff_t)row * ref_stride + col;
  422|  71.8k|      const ptrdiff_t dst_offset = (ptrdiff_t)row * pd->dst.stride + col;
  423|  71.8k|      if (pri_strength == 0 && sec_strength == 0) {
  ------------------
  |  Branch (423:11): [True: 35.9k, False: 35.9k]
  |  Branch (423:32): [True: 17.9k, False: 17.9k]
  ------------------
  424|       |        // When CDEF strength is zero, filtering is not applied. Hence
  425|       |        // error is calculated between source and unfiltered pixels
  426|  17.9k|        curr_sse =
  427|  17.9k|            aom_sse(&ref_buffer[buf_offset], ref_stride,
  428|  17.9k|                    &pd->dst.buf[dst_offset], pd->dst.stride,
  429|  17.9k|                    block_size_wide[plane_bsize], block_size_high[plane_bsize]);
  430|  53.8k|      } else {
  431|  53.8k|        DECLARE_ALIGNED(32, uint8_t, tmp_dst8[1 << (MAX_SB_SIZE_LOG2 * 2)]);
  ------------------
  |  |   19|  53.8k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  432|       |
  433|  53.8k|        av1_cdef_filter_fb(tmp_dst8, NULL, (1 << MAX_SB_SIZE_LOG2), in,
  ------------------
  |  |   31|  53.8k|#define MAX_SB_SIZE_LOG2 7
  ------------------
  434|  53.8k|                           cdef_search_ctx->xdec[pli],
  435|  53.8k|                           cdef_search_ctx->ydec[pli], dir, dirinit, var, pli,
  436|  53.8k|                           dlist, cdef_count, pri_strength,
  437|  53.8k|                           sec_strength + (sec_strength == 3),
  438|  53.8k|                           cdef_search_ctx->damping, coeff_shift);
  439|  53.8k|        curr_sse =
  440|  53.8k|            aom_sse(&ref_buffer[buf_offset], ref_stride, tmp_dst8,
  441|  53.8k|                    (1 << MAX_SB_SIZE_LOG2), block_size_wide[plane_bsize],
  ------------------
  |  |   31|  53.8k|#define MAX_SB_SIZE_LOG2 7
  ------------------
  442|  53.8k|                    block_size_high[plane_bsize]);
  443|  53.8k|      }
  444|   310k|    } else {
  445|       |      // If few 8x8/4x4 blocks in CDEF block need to be filtered, filtering
  446|       |      // functions produce 8-bit output and the error is calculated in 8-bit
  447|       |      // domain
  448|   310k|      if (pri_strength == 0 && sec_strength == 0) {
  ------------------
  |  Branch (448:11): [True: 155k, False: 155k]
  |  Branch (448:32): [True: 77.8k, False: 77.6k]
  ------------------
  449|  77.8k|        int num_error_calc_filt_units = 1;
  450|   626k|        for (int bi = 0; bi < cdef_count; bi = bi + num_error_calc_filt_units) {
  ------------------
  |  Branch (450:26): [True: 548k, False: 77.8k]
  ------------------
  451|   548k|          const uint8_t by = dlist[bi].by;
  452|   548k|          const uint8_t bx = dlist[bi].bx;
  453|   548k|          const int by_pos = by << bh_log2;
  454|   548k|          const int bx_pos = bx << bw_log2;
  455|   548k|          const ptrdiff_t buf_offset =
  456|   548k|              (ptrdiff_t)(row + by_pos) * ref_stride + (col + bx_pos);
  457|   548k|          const ptrdiff_t dst_offset =
  458|   548k|              (ptrdiff_t)(row + by_pos) * pd->dst.stride + (col + bx_pos);
  459|   548k|          num_error_calc_filt_units = get_error_calc_width_in_filt_units(
  460|   548k|              dlist, cdef_count, bi, pd->subsampling_x, pd->subsampling_y);
  461|   548k|          curr_sse +=
  462|   548k|              aom_sse(&ref_buffer[buf_offset], ref_stride,
  463|   548k|                      &pd->dst.buf[dst_offset], pd->dst.stride,
  464|   548k|                      num_error_calc_filt_units * (1 << bw_log2), 1 << bh_log2);
  465|   548k|        }
  466|   232k|      } else {
  467|   232k|        DECLARE_ALIGNED(32, uint8_t, tmp_dst8[1 << (MAX_SB_SIZE_LOG2 * 2)]);
  ------------------
  |  |   19|   232k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  468|   232k|        av1_cdef_filter_fb(tmp_dst8, NULL, (1 << MAX_SB_SIZE_LOG2), in,
  ------------------
  |  |   31|   232k|#define MAX_SB_SIZE_LOG2 7
  ------------------
  469|   232k|                           cdef_search_ctx->xdec[pli],
  470|   232k|                           cdef_search_ctx->ydec[pli], dir, dirinit, var, pli,
  471|   232k|                           dlist, cdef_count, pri_strength,
  472|   232k|                           sec_strength + (sec_strength == 3),
  473|   232k|                           cdef_search_ctx->damping, coeff_shift);
  474|   232k|        int num_error_calc_filt_units = 1;
  475|  1.87M|        for (int bi = 0; bi < cdef_count; bi = bi + num_error_calc_filt_units) {
  ------------------
  |  Branch (475:26): [True: 1.64M, False: 232k]
  ------------------
  476|  1.64M|          const uint8_t by = dlist[bi].by;
  477|  1.64M|          const uint8_t bx = dlist[bi].bx;
  478|  1.64M|          const int by_pos = by << bh_log2;
  479|  1.64M|          const int bx_pos = bx << bw_log2;
  480|  1.64M|          const ptrdiff_t buf_offset =
  481|  1.64M|              (ptrdiff_t)(row + by_pos) * ref_stride + (col + bx_pos);
  482|  1.64M|          const ptrdiff_t tmp_buf_offset =
  483|  1.64M|              by_pos * (1 << MAX_SB_SIZE_LOG2) + bx_pos;
  ------------------
  |  |   31|  1.64M|#define MAX_SB_SIZE_LOG2 7
  ------------------
  484|  1.64M|          num_error_calc_filt_units = get_error_calc_width_in_filt_units(
  485|  1.64M|              dlist, cdef_count, bi, pd->subsampling_x, pd->subsampling_y);
  486|  1.64M|          curr_sse += aom_sse(
  487|  1.64M|              &ref_buffer[buf_offset], ref_stride, &tmp_dst8[tmp_buf_offset],
  488|  1.64M|              (1 << MAX_SB_SIZE_LOG2),
  ------------------
  |  |   31|  1.64M|#define MAX_SB_SIZE_LOG2 7
  ------------------
  489|  1.64M|              num_error_calc_filt_units * (1 << bw_log2), (1 << bh_log2));
  490|  1.64M|        }
  491|   232k|      }
  492|   310k|    }
  493|   382k|  } else {
  494|   154k|    DECLARE_ALIGNED(32, uint16_t, tmp_dst[1 << (MAX_SB_SIZE_LOG2 * 2)]);
  ------------------
  |  |   19|   154k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  495|       |
  496|   154k|    av1_cdef_filter_fb(NULL, tmp_dst, CDEF_BSTRIDE, in,
  ------------------
  |  |   28|   154k|  ALIGN_POWER_OF_TWO((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_HBORDER, 3)
  |  |  ------------------
  |  |  |  |   69|   154k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  |  |  ------------------
  ------------------
  497|   154k|                       cdef_search_ctx->xdec[pli], cdef_search_ctx->ydec[pli],
  498|   154k|                       dir, dirinit, var, pli, dlist, cdef_count, pri_strength,
  499|   154k|                       sec_strength + (sec_strength == 3),
  500|   154k|                       cdef_search_ctx->damping, coeff_shift);
  501|   154k|    curr_sse = cdef_search_ctx->compute_cdef_dist_fn(
  502|   154k|        ref_buffer, ref_stride, tmp_dst, dlist, cdef_count,
  503|   154k|        cdef_search_ctx->bsize[pli], coeff_shift, row, col);
  504|   154k|  }
  505|   537k|  return curr_sse;
  506|   537k|}
pickcdef.c:get_error_calc_width_in_filt_units:
  377|  2.18M|    int subsampling_y) {
  378|       |  // TODO(Ranjit): Extend the optimization for 422
  379|  2.18M|  if (subsampling_x != subsampling_y) return 1;
  ------------------
  |  Branch (379:7): [True: 569k, False: 1.61M]
  ------------------
  380|       |
  381|       |  // Combining more blocks seems to increase encode time due to increase in
  382|       |  // control code
  383|  1.61M|  if (bi + 3 < cdef_count && dlist[bi].by == dlist[bi + 3].by &&
  ------------------
  |  Branch (383:7): [True: 1.30M, False: 305k]
  |  Branch (383:30): [True: 677k, False: 632k]
  ------------------
  384|   677k|      dlist[bi].bx + 3 == dlist[bi + 3].bx) {
  ------------------
  |  Branch (384:7): [True: 667k, False: 9.59k]
  ------------------
  385|       |    /* Calculate error for four 8x8/4x4 blocks using 32x8/16x4 block specific
  386|       |     * logic if y co-ordinates match and x co-ordinates are
  387|       |     * separated by 3 for first and fourth 8x8/4x4 blocks in dlist[]. */
  388|   667k|    return 4;
  389|   667k|  }
  390|   947k|  if (bi + 1 < cdef_count && dlist[bi].by == dlist[bi + 1].by &&
  ------------------
  |  Branch (390:7): [True: 823k, False: 123k]
  |  Branch (390:30): [True: 455k, False: 368k]
  ------------------
  391|   455k|      dlist[bi].bx + 1 == dlist[bi + 1].bx) {
  ------------------
  |  Branch (391:7): [True: 443k, False: 12.4k]
  ------------------
  392|       |    /* Calculate error for two 8x8/4x4 blocks using 16x8/8x4 block specific
  393|       |     * logic if their y co-ordinates match and x co-ordinates are
  394|       |     * separated by 1 for first and second 8x8/4x4 blocks in dlist[]. */
  395|   443k|    return 2;
  396|   443k|  }
  397|   504k|  return 1;
  398|   947k|}
pickcdef.c:cdef_params_init:
  700|  42.1k|                                    CDEF_PICK_METHOD pick_method) {
  701|  42.1k|  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  702|  42.1k|  const int num_planes = av1_num_planes(cm);
  703|  42.1k|  cdef_search_ctx->mi_params = &cm->mi_params;
  704|  42.1k|  cdef_search_ctx->ref = ref;
  705|  42.1k|  cdef_search_ctx->nvfb =
  706|  42.1k|      (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  42.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  42.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  707|  42.1k|  cdef_search_ctx->nhfb =
  708|  42.1k|      (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  42.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                    (mi_params->mi_cols + MI_SIZE_64X64 - 1) / MI_SIZE_64X64;
  ------------------
  |  |   58|  42.1k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  42.1k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  709|  42.1k|  cdef_search_ctx->coeff_shift = AOMMAX(cm->seq_params->bit_depth - 8, 0);
  ------------------
  |  |   35|  42.1k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 13.6k, False: 28.5k]
  |  |  ------------------
  ------------------
  710|  42.1k|  cdef_search_ctx->damping = 3 + (cm->quant_params.base_qindex >> 6);
  711|  42.1k|  cdef_search_ctx->total_strengths = nb_cdef_strengths[pick_method];
  712|  42.1k|  cdef_search_ctx->num_planes = num_planes;
  713|  42.1k|  cdef_search_ctx->pick_method = pick_method;
  714|  42.1k|  cdef_search_ctx->sb_count = 0;
  715|  42.1k|  cdef_search_ctx->use_highbitdepth = cm->seq_params->use_highbitdepth;
  716|  42.1k|  av1_setup_dst_planes(xd->plane, cm->seq_params->sb_size, frame, 0, 0, 0,
  717|  42.1k|                       num_planes);
  718|       |  // Initialize plane wise information.
  719|   116k|  for (int pli = 0; pli < num_planes; pli++) {
  ------------------
  |  Branch (719:21): [True: 74.4k, False: 42.1k]
  ------------------
  720|  74.4k|    cdef_search_ctx->xdec[pli] = xd->plane[pli].subsampling_x;
  721|  74.4k|    cdef_search_ctx->ydec[pli] = xd->plane[pli].subsampling_y;
  722|  74.4k|    cdef_search_ctx->bsize[pli] =
  723|  74.4k|        cdef_search_ctx->ydec[pli]
  ------------------
  |  Branch (723:9): [True: 16.0k, False: 58.3k]
  ------------------
  724|  74.4k|            ? (cdef_search_ctx->xdec[pli] ? BLOCK_4X4 : BLOCK_8X4)
  ------------------
  |  Branch (724:16): [True: 16.0k, False: 0]
  ------------------
  725|  74.4k|            : (cdef_search_ctx->xdec[pli] ? BLOCK_4X8 : BLOCK_8X8);
  ------------------
  |  Branch (725:16): [True: 8.72k, False: 49.6k]
  ------------------
  726|  74.4k|    cdef_search_ctx->mi_wide_l2[pli] =
  727|  74.4k|        MI_SIZE_LOG2 - xd->plane[pli].subsampling_x;
  ------------------
  |  |   39|  74.4k|#define MI_SIZE_LOG2 2
  ------------------
  728|  74.4k|    cdef_search_ctx->mi_high_l2[pli] =
  729|  74.4k|        MI_SIZE_LOG2 - xd->plane[pli].subsampling_y;
  ------------------
  |  |   39|  74.4k|#define MI_SIZE_LOG2 2
  ------------------
  730|  74.4k|    cdef_search_ctx->plane[pli] = xd->plane[pli];
  731|  74.4k|  }
  732|       |  // Function pointer initialization.
  733|  42.1k|#if CONFIG_AV1_HIGHBITDEPTH
  734|  42.1k|  if (cm->seq_params->use_highbitdepth) {
  ------------------
  |  Branch (734:7): [True: 13.6k, False: 28.5k]
  ------------------
  735|  13.6k|    cdef_search_ctx->copy_fn = av1_cdef_copy_sb8_16_highbd;
  736|  13.6k|    cdef_search_ctx->compute_cdef_dist_fn = compute_cdef_dist_highbd;
  737|  28.5k|  } else {
  738|  28.5k|    cdef_search_ctx->copy_fn = av1_cdef_copy_sb8_16_lowbd;
  739|  28.5k|    cdef_search_ctx->compute_cdef_dist_fn = compute_cdef_dist;
  740|  28.5k|  }
  741|       |#else
  742|       |  cdef_search_ctx->copy_fn = av1_cdef_copy_sb8_16_lowbd;
  743|       |  cdef_search_ctx->compute_cdef_dist_fn = compute_cdef_dist;
  744|       |#endif
  745|  42.1k|}
pickcdef.c:compute_cdef_dist_highbd:
  240|   154k|                                         int row, int col) {
  241|   154k|  assert(bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 ||
  242|   154k|         bsize == BLOCK_8X8);
  243|   154k|  uint64_t sum = 0;
  244|   154k|  int bi, bx, by;
  245|   154k|  uint16_t *dst16 = CONVERT_TO_SHORTPTR((uint8_t *)dst);
  ------------------
  |  |   79|   154k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  246|   154k|  uint16_t *dst_buff = &dst16[row * dstride + col];
  247|   154k|  int src_stride, width, height, width_log2, height_log2;
  248|   154k|  init_src_params(&src_stride, &width, &height, &width_log2, &height_log2,
  249|   154k|                  bsize);
  250|  1.41M|  for (bi = 0; bi < cdef_count; bi++) {
  ------------------
  |  Branch (250:16): [True: 1.26M, False: 154k]
  ------------------
  251|  1.26M|    by = dlist[bi].by;
  252|  1.26M|    bx = dlist[bi].bx;
  253|  1.26M|    sum += aom_mse_wxh_16bit_highbd(
  254|  1.26M|        &dst_buff[(by << height_log2) * dstride + (bx << width_log2)], dstride,
  255|  1.26M|        &src[bi << (height_log2 + width_log2)], src_stride, width, height);
  256|  1.26M|  }
  257|   154k|  return sum >> 2 * coeff_shift;
  258|   154k|}
pickcdef.c:init_src_params:
  228|   154k|                                   BLOCK_SIZE bsize) {
  229|   154k|  *src_stride = block_size_wide[bsize];
  230|   154k|  *width = block_size_wide[bsize];
  231|   154k|  *height = block_size_high[bsize];
  232|   154k|  *width_log2 = MI_SIZE_LOG2 + mi_size_wide_log2[bsize];
  ------------------
  |  |   39|   154k|#define MI_SIZE_LOG2 2
  ------------------
  233|   154k|  *height_log2 = MI_SIZE_LOG2 + mi_size_high_log2[bsize];
  ------------------
  |  |   39|   154k|#define MI_SIZE_LOG2 2
  ------------------
  234|   154k|}
pickcdef.c:cdef_alloc_data:
  655|  42.1k|static void cdef_alloc_data(AV1_COMMON *cm, CdefSearchCtx *cdef_search_ctx) {
  656|  42.1k|  const int nvfb = cdef_search_ctx->nvfb;
  657|  42.1k|  const int nhfb = cdef_search_ctx->nhfb;
  658|  42.1k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  42.1k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  42.1k|  do {                                                    \
  |  |  |  |   72|  42.1k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  42.1k|    lval = (expr);                                        \
  |  |  |  |   74|  42.1k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 42.1k]
  |  |  |  |  ------------------
  |  |  |  |   75|  42.1k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  42.1k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  659|  42.1k|      cm, cdef_search_ctx->sb_index,
  660|  42.1k|      aom_malloc(nvfb * nhfb * sizeof(cdef_search_ctx->sb_index[0])));
  661|  42.1k|  cdef_search_ctx->sb_count = 0;
  662|  42.1k|  CHECK_MEM_ERROR(cm, cdef_search_ctx->mse[0],
  ------------------
  |  |   51|  42.1k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  42.1k|  do {                                                    \
  |  |  |  |   72|  42.1k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  42.1k|    lval = (expr);                                        \
  |  |  |  |   74|  42.1k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 42.1k]
  |  |  |  |  ------------------
  |  |  |  |   75|  42.1k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  42.1k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  663|  42.1k|                  aom_malloc(sizeof(**cdef_search_ctx->mse) * nvfb * nhfb));
  664|       |  CHECK_MEM_ERROR(cm, cdef_search_ctx->mse[1],
  ------------------
  |  |   51|  42.1k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  42.1k|  do {                                                    \
  |  |  |  |   72|  42.1k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  42.1k|    lval = (expr);                                        \
  |  |  |  |   74|  42.1k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 42.1k]
  |  |  |  |  ------------------
  |  |  |  |   75|  42.1k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  42.1k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 42.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  665|  42.1k|                  aom_malloc(sizeof(**cdef_search_ctx->mse) * nvfb * nhfb));
  666|  42.1k|}
pickcdef.c:cdef_mse_calc_frame:
  635|  10.2k|                                int adaptive_cdef_mode) {
  636|       |  // Loop over each sb.
  637|  22.2k|  for (int fbr = 0; fbr < cdef_search_ctx->nvfb; ++fbr) {
  ------------------
  |  Branch (637:21): [True: 12.0k, False: 10.2k]
  ------------------
  638|  27.4k|    for (int fbc = 0; fbc < cdef_search_ctx->nhfb; ++fbc) {
  ------------------
  |  Branch (638:23): [True: 15.4k, False: 12.0k]
  ------------------
  639|       |      // Checks if cdef processing can be skipped for particular sb.
  640|  15.4k|      if (cdef_sb_skip(cdef_search_ctx->mi_params, fbr, fbc)) continue;
  ------------------
  |  Branch (640:11): [True: 673, False: 14.7k]
  ------------------
  641|       |      // Calculate mse for each sb and store the relevant sb index.
  642|  14.7k|      av1_cdef_mse_calc_block(cdef_search_ctx, error_info, fbr, fbc,
  643|  14.7k|                              cdef_search_ctx->sb_count, adaptive_cdef_mode);
  644|  14.7k|      cdef_search_ctx->sb_count++;
  645|  14.7k|    }
  646|  12.0k|  }
  647|  10.2k|}
pickcdef.c:joint_strength_search_dual:
  203|  59.9k|                                           CDEF_PICK_METHOD pick_method) {
  204|  59.9k|  uint64_t best_tot_mse;
  205|  59.9k|  int i;
  206|  59.9k|  best_tot_mse = (uint64_t)1 << 63;
  207|       |  /* Greedy search: add one strength options at a time. */
  208|   297k|  for (i = 0; i < nb_strengths; i++) {
  ------------------
  |  Branch (208:15): [True: 237k, False: 59.9k]
  ------------------
  209|   237k|    best_tot_mse =
  210|   237k|        search_one_dual(best_lev0, best_lev1, i, mse, sb_count, pick_method);
  211|   237k|  }
  212|       |  /* Trying to refine the greedy search by reconsidering each
  213|       |     already-selected option. */
  214|  1.00M|  for (i = 0; i < 4 * nb_strengths; i++) {
  ------------------
  |  Branch (214:15): [True: 949k, False: 59.9k]
  ------------------
  215|   949k|    int j;
  216|  5.46M|    for (j = 0; j < nb_strengths - 1; j++) {
  ------------------
  |  Branch (216:17): [True: 4.51M, False: 949k]
  ------------------
  217|  4.51M|      best_lev0[j] = best_lev0[j + 1];
  218|  4.51M|      best_lev1[j] = best_lev1[j + 1];
  219|  4.51M|    }
  220|   949k|    best_tot_mse = search_one_dual(best_lev0, best_lev1, nb_strengths - 1, mse,
  221|   949k|                                   sb_count, pick_method);
  222|   949k|  }
  223|  59.9k|  return best_tot_mse;
  224|  59.9k|}
pickcdef.c:search_one_dual:
  125|  1.18M|                                CDEF_PICK_METHOD pick_method) {
  126|  1.18M|  uint64_t tot_mse[TOTAL_STRENGTHS][TOTAL_STRENGTHS];
  127|  1.18M|  int i, j;
  128|  1.18M|  uint64_t best_tot_mse = (uint64_t)1 << 63;
  129|  1.18M|  int best_id0 = 0;
  130|  1.18M|  int best_id1 = 0;
  131|  1.18M|  const int total_strengths = nb_cdef_strengths[pick_method];
  132|  1.18M|  memset(tot_mse, 0, sizeof(tot_mse));
  133|  3.37M|  for (i = 0; i < sb_count; i++) {
  ------------------
  |  Branch (133:15): [True: 2.18M, False: 1.18M]
  ------------------
  134|  2.18M|    int gi;
  135|  2.18M|    uint64_t best_mse = (uint64_t)1 << 63;
  136|       |    /* Find best mse among already selected options. */
  137|  11.5M|    for (gi = 0; gi < nb_strengths; gi++) {
  ------------------
  |  Branch (137:18): [True: 9.36M, False: 2.18M]
  ------------------
  138|  9.36M|      uint64_t curr = mse[0][i][lev0[gi]];
  139|  9.36M|      curr += mse[1][i][lev1[gi]];
  140|  9.36M|      if (curr < best_mse) {
  ------------------
  |  Branch (140:11): [True: 3.26M, False: 6.09M]
  ------------------
  141|  3.26M|        best_mse = curr;
  142|  3.26M|      }
  143|  9.36M|    }
  144|       |    /* Find best mse when adding each possible new option. */
  145|  10.9M|    for (j = 0; j < total_strengths; j++) {
  ------------------
  |  Branch (145:17): [True: 8.75M, False: 2.18M]
  ------------------
  146|  8.75M|      int k;
  147|  43.7M|      for (k = 0; k < total_strengths; k++) {
  ------------------
  |  Branch (147:19): [True: 35.0M, False: 8.75M]
  ------------------
  148|  35.0M|        uint64_t best = best_mse;
  149|  35.0M|        uint64_t curr = mse[0][i][j];
  150|  35.0M|        curr += mse[1][i][k];
  151|  35.0M|        if (curr < best) best = curr;
  ------------------
  |  Branch (151:13): [True: 5.84M, False: 29.1M]
  ------------------
  152|  35.0M|        tot_mse[j][k] += best;
  153|  35.0M|      }
  154|  8.75M|    }
  155|  2.18M|  }
  156|  5.93M|  for (j = 0; j < total_strengths; j++) {
  ------------------
  |  Branch (156:15): [True: 4.74M, False: 1.18M]
  ------------------
  157|  4.74M|    int k;
  158|  23.7M|    for (k = 0; k < total_strengths; k++) {
  ------------------
  |  Branch (158:17): [True: 18.9M, False: 4.74M]
  ------------------
  159|  18.9M|      if (tot_mse[j][k] < best_tot_mse) {
  ------------------
  |  Branch (159:11): [True: 2.61M, False: 16.3M]
  ------------------
  160|  2.61M|        best_tot_mse = tot_mse[j][k];
  161|  2.61M|        best_id0 = j;
  162|  2.61M|        best_id1 = k;
  163|  2.61M|      }
  164|  18.9M|    }
  165|  4.74M|  }
  166|  1.18M|  lev0[nb_strengths] = best_id0;
  167|  1.18M|  lev1[nb_strengths] = best_id1;
  168|  1.18M|  return best_tot_mse;
  169|  1.18M|}
pickcdef.c:joint_strength_search:
  175|  74.2k|                                      CDEF_PICK_METHOD pick_method) {
  176|  74.2k|  uint64_t best_tot_mse;
  177|  74.2k|  int fast = (pick_method >= CDEF_FAST_SEARCH_LVL1 &&
  ------------------
  |  Branch (177:15): [True: 74.2k, False: 0]
  ------------------
  178|  74.2k|              pick_method <= CDEF_FAST_SEARCH_LVL5);
  ------------------
  |  Branch (178:15): [True: 74.2k, False: 0]
  ------------------
  179|  74.2k|  int i;
  180|  74.2k|  best_tot_mse = (uint64_t)1 << 63;
  181|       |  /* Greedy search: add one strength options at a time. */
  182|   252k|  for (i = 0; i < nb_strengths; i++) {
  ------------------
  |  Branch (182:15): [True: 178k, False: 74.2k]
  ------------------
  183|   178k|    best_tot_mse = search_one(best_lev, i, mse, sb_count, pick_method);
  184|   178k|  }
  185|       |  /* Trying to refine the greedy search by reconsidering each
  186|       |     already-selected option. */
  187|  74.2k|  if (!fast) {
  ------------------
  |  Branch (187:7): [True: 0, False: 74.2k]
  ------------------
  188|      0|    for (i = 0; i < 4 * nb_strengths; i++) {
  ------------------
  |  Branch (188:17): [True: 0, False: 0]
  ------------------
  189|      0|      int j;
  190|      0|      for (j = 0; j < nb_strengths - 1; j++) best_lev[j] = best_lev[j + 1];
  ------------------
  |  Branch (190:19): [True: 0, False: 0]
  ------------------
  191|      0|      best_tot_mse =
  192|      0|          search_one(best_lev, nb_strengths - 1, mse, sb_count, pick_method);
  193|      0|    }
  194|      0|  }
  195|  74.2k|  return best_tot_mse;
  196|  74.2k|}
pickcdef.c:search_one:
   88|   178k|                           CDEF_PICK_METHOD pick_method) {
   89|   178k|  uint64_t tot_mse[TOTAL_STRENGTHS];
   90|   178k|  const int total_strengths = nb_cdef_strengths[pick_method];
   91|   178k|  int i, j;
   92|   178k|  uint64_t best_tot_mse = (uint64_t)1 << 63;
   93|   178k|  int best_id = 0;
   94|   178k|  memset(tot_mse, 0, sizeof(tot_mse));
   95|   490k|  for (i = 0; i < sb_count; i++) {
  ------------------
  |  Branch (95:15): [True: 311k, False: 178k]
  ------------------
   96|   311k|    int gi;
   97|   311k|    uint64_t best_mse = (uint64_t)1 << 63;
   98|       |    /* Find best mse among already selected options. */
   99|   629k|    for (gi = 0; gi < nb_strengths; gi++) {
  ------------------
  |  Branch (99:18): [True: 318k, False: 311k]
  ------------------
  100|   318k|      if (mse[i][lev[gi]] < best_mse) {
  ------------------
  |  Branch (100:11): [True: 198k, False: 119k]
  ------------------
  101|   198k|        best_mse = mse[i][lev[gi]];
  102|   198k|      }
  103|   318k|    }
  104|       |    /* Find best mse when adding each possible new option. */
  105|  1.55M|    for (j = 0; j < total_strengths; j++) {
  ------------------
  |  Branch (105:17): [True: 1.24M, False: 311k]
  ------------------
  106|  1.24M|      uint64_t best = best_mse;
  107|  1.24M|      if (mse[i][j] < best) best = mse[i][j];
  ------------------
  |  Branch (107:11): [True: 550k, False: 695k]
  ------------------
  108|  1.24M|      tot_mse[j] += best;
  109|  1.24M|    }
  110|   311k|  }
  111|   891k|  for (j = 0; j < total_strengths; j++) {
  ------------------
  |  Branch (111:15): [True: 713k, False: 178k]
  ------------------
  112|   713k|    if (tot_mse[j] < best_tot_mse) {
  ------------------
  |  Branch (112:9): [True: 305k, False: 408k]
  ------------------
  113|   305k|      best_tot_mse = tot_mse[j];
  114|   305k|      best_id = j;
  115|   305k|    }
  116|   713k|  }
  117|   178k|  lev[nb_strengths] = best_id;
  118|   178k|  return best_tot_mse;
  119|   178k|}

ethread.c:cdef_sb_skip:
  199|  61.9k|                               int fbr, int fbc) {
  200|  61.9k|  const MB_MODE_INFO *const mbmi =
  201|  61.9k|      mi_params->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
  ------------------
  |  |   58|  61.9k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  61.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  202|  61.9k|                              MI_SIZE_64X64 * fbc];
  ------------------
  |  |   58|  61.9k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  61.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  203|       |  // No filtering if the entire filter block is skipped.
  204|  61.9k|  if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
  ------------------
  |  |   58|  61.9k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  61.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
  ------------------
  |  |   58|  61.9k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  61.9k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (204:7): [True: 1.50k, False: 60.4k]
  ------------------
  205|  1.50k|    return 1;
  206|       |  // Skip odd numbered 64x64 block rows(cols) when bsize is BLOCK_128X128,
  207|       |  // BLOCK_64X128(BLOCK_128X128, BLOCK_128X64) as for such blocks CDEF filtering
  208|       |  // is done at the corresponding block sizes.
  209|  60.4k|  if (((fbc & 1) &&
  ------------------
  |  Branch (209:8): [True: 12.5k, False: 47.9k]
  ------------------
  210|  12.5k|       (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_128X64)) ||
  ------------------
  |  Branch (210:9): [True: 0, False: 12.5k]
  |  Branch (210:41): [True: 0, False: 12.5k]
  ------------------
  211|  60.4k|      ((fbr & 1) &&
  ------------------
  |  Branch (211:8): [True: 12.8k, False: 47.5k]
  ------------------
  212|  12.8k|       (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_64X128)))
  ------------------
  |  Branch (212:9): [True: 0, False: 12.8k]
  |  Branch (212:41): [True: 0, False: 12.8k]
  ------------------
  213|      0|    return 1;
  214|  60.4k|  return 0;
  215|  60.4k|}
ethread.c:sb_all_skip:
  176|  61.9k|                              int mi_row, int mi_col) {
  177|  61.9k|  const int maxr = AOMMIN(mi_params->mi_rows - mi_row, MI_SIZE_64X64);
  ------------------
  |  |   34|  61.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 40.3k, False: 21.5k]
  |  |  ------------------
  ------------------
  178|  61.9k|  const int maxc = AOMMIN(mi_params->mi_cols - mi_col, MI_SIZE_64X64);
  ------------------
  |  |   34|  61.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 40.9k, False: 20.9k]
  |  |  ------------------
  ------------------
  179|  61.9k|  const int stride = mi_params->mi_stride;
  180|  61.9k|  MB_MODE_INFO **mbmi = mi_params->mi_grid_base + mi_row * stride + mi_col;
  181|  77.8k|  for (int r = 0; r < maxr; ++r, mbmi += stride) {
  ------------------
  |  Branch (181:19): [True: 76.3k, False: 1.50k]
  ------------------
  182|   226k|    for (int c = 0; c < maxc; ++c) {
  ------------------
  |  Branch (182:21): [True: 210k, False: 15.9k]
  ------------------
  183|   210k|      if (!mbmi[c]->skip_txfm) return 0;
  ------------------
  |  Branch (183:11): [True: 60.4k, False: 150k]
  ------------------
  184|   210k|    }
  185|  76.3k|  }
  186|  1.50k|  return 1;
  187|  61.9k|}
pickcdef.c:cdef_sb_skip:
  199|  15.4k|                               int fbr, int fbc) {
  200|  15.4k|  const MB_MODE_INFO *const mbmi =
  201|  15.4k|      mi_params->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
  ------------------
  |  |   58|  15.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  15.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  202|  15.4k|                              MI_SIZE_64X64 * fbc];
  ------------------
  |  |   58|  15.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  15.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  203|       |  // No filtering if the entire filter block is skipped.
  204|  15.4k|  if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
  ------------------
  |  |   58|  15.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  15.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
                if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
  ------------------
  |  |   58|  15.4k|#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  15.4k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  |  Branch (204:7): [True: 673, False: 14.7k]
  ------------------
  205|    673|    return 1;
  206|       |  // Skip odd numbered 64x64 block rows(cols) when bsize is BLOCK_128X128,
  207|       |  // BLOCK_64X128(BLOCK_128X128, BLOCK_128X64) as for such blocks CDEF filtering
  208|       |  // is done at the corresponding block sizes.
  209|  14.7k|  if (((fbc & 1) &&
  ------------------
  |  Branch (209:8): [True: 2.23k, False: 12.5k]
  ------------------
  210|  2.23k|       (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_128X64)) ||
  ------------------
  |  Branch (210:9): [True: 0, False: 2.23k]
  |  Branch (210:41): [True: 0, False: 2.23k]
  ------------------
  211|  14.7k|      ((fbr & 1) &&
  ------------------
  |  Branch (211:8): [True: 1.94k, False: 12.8k]
  ------------------
  212|  1.94k|       (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_64X128)))
  ------------------
  |  Branch (212:9): [True: 0, False: 1.94k]
  |  Branch (212:41): [True: 0, False: 1.94k]
  ------------------
  213|      0|    return 1;
  214|  14.7k|  return 0;
  215|  14.7k|}
pickcdef.c:sb_all_skip:
  176|  15.4k|                              int mi_row, int mi_col) {
  177|  15.4k|  const int maxr = AOMMIN(mi_params->mi_rows - mi_row, MI_SIZE_64X64);
  ------------------
  |  |   34|  15.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.8k, False: 3.62k]
  |  |  ------------------
  ------------------
  178|  15.4k|  const int maxc = AOMMIN(mi_params->mi_cols - mi_col, MI_SIZE_64X64);
  ------------------
  |  |   34|  15.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.5k, False: 3.91k]
  |  |  ------------------
  ------------------
  179|  15.4k|  const int stride = mi_params->mi_stride;
  180|  15.4k|  MB_MODE_INFO **mbmi = mi_params->mi_grid_base + mi_row * stride + mi_col;
  181|  20.8k|  for (int r = 0; r < maxr; ++r, mbmi += stride) {
  ------------------
  |  Branch (181:19): [True: 20.1k, False: 673]
  ------------------
  182|  45.2k|    for (int c = 0; c < maxc; ++c) {
  ------------------
  |  Branch (182:21): [True: 39.8k, False: 5.38k]
  ------------------
  183|  39.8k|      if (!mbmi[c]->skip_txfm) return 0;
  ------------------
  |  Branch (183:11): [True: 14.7k, False: 25.0k]
  ------------------
  184|  39.8k|    }
  185|  20.1k|  }
  186|    673|  return 1;
  187|  15.4k|}

av1_pick_filter_level:
  212|  70.2k|                           LPF_PICK_METHOD method) {
  213|  70.2k|  AV1_COMMON *const cm = &cpi->common;
  214|  70.2k|  const SequenceHeader *const seq_params = cm->seq_params;
  215|  70.2k|  const int num_planes = av1_num_planes(cm);
  216|  70.2k|  struct loopfilter *const lf = &cm->lf;
  217|  70.2k|  int disable_filter_rt_screen = 0;
  218|  70.2k|  (void)sd;
  219|       |
  220|       |  // Enable loop filter sharpness only for all-intra encoding mode,
  221|       |  // or tune IQ or SSIMULACRA2. This is because:
  222|       |  // - All-intra: frames do not have to serve as references to others
  223|       |  // - Tune IQ/SSIMULACRA2: enabling loop filter sharpness has been found to
  224|       |  //   be beneficial for sharpness perception
  225|  70.2k|  if (cpi->oxcf.mode == ALLINTRA || cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (225:7): [True: 0, False: 70.2k]
  |  Branch (225:37): [True: 52.1k, False: 18.0k]
  ------------------
  226|  52.1k|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (226:7): [True: 0, False: 18.0k]
  ------------------
  227|  52.1k|    lf->sharpness_level = cpi->oxcf.algo_cfg.sharpness;
  228|  52.1k|  } else {
  229|  18.0k|    lf->sharpness_level = 0;
  230|  18.0k|  }
  231|       |
  232|  70.2k|  if (cpi->oxcf.algo_cfg.enable_adaptive_sharpness) {
  ------------------
  |  Branch (232:7): [True: 52.1k, False: 18.0k]
  ------------------
  233|       |    // Loop filter sharpness levels are highly nonlinear. Visually, lf sharpness
  234|       |    // 1 is closer to 7 than it is to 0, so in practice adaptive sharpness is
  235|       |    // written to pick levels 0, 1 and 7 to keep it simple.
  236|  52.1k|    int max_lf_sharpness;
  237|       |
  238|  52.1k|    if (cm->quant_params.base_qindex <= 112) {
  ------------------
  |  Branch (238:9): [True: 16.9k, False: 35.2k]
  ------------------
  239|  16.9k|      max_lf_sharpness = 7;
  240|  35.2k|    } else if (cm->quant_params.base_qindex <= 160) {
  ------------------
  |  Branch (240:16): [True: 6.50k, False: 28.7k]
  ------------------
  241|  6.50k|      max_lf_sharpness = 1;
  242|  28.7k|    } else {
  243|  28.7k|      max_lf_sharpness = 0;
  244|  28.7k|    }
  245|       |
  246|  52.1k|    lf->sharpness_level = AOMMIN(lf->sharpness_level, max_lf_sharpness);
  ------------------
  |  |   34|  52.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 52.1k]
  |  |  ------------------
  ------------------
  247|  52.1k|  }
  248|       |
  249|  70.2k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (249:7): [True: 0, False: 70.2k]
  ------------------
  250|      0|      cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (250:7): [True: 0, False: 0]
  ------------------
  251|      0|      cpi->sf.rt_sf.skip_lf_screen)
  ------------------
  |  Branch (251:7): [True: 0, False: 0]
  ------------------
  252|      0|    disable_filter_rt_screen = av1_cyclic_refresh_disable_lf_cdef(cpi);
  253|       |
  254|  70.2k|  if (disable_filter_rt_screen ||
  ------------------
  |  Branch (254:7): [True: 0, False: 70.2k]
  ------------------
  255|  70.2k|      cpi->oxcf.algo_cfg.loopfilter_control == LOOPFILTER_NONE ||
  ------------------
  |  Branch (255:7): [True: 0, False: 70.2k]
  ------------------
  256|  70.2k|      (cpi->oxcf.algo_cfg.loopfilter_control == LOOPFILTER_REFERENCE &&
  ------------------
  |  Branch (256:8): [True: 0, False: 70.2k]
  ------------------
  257|      0|       cpi->ppi->rtc_ref.non_reference_frame)) {
  ------------------
  |  Branch (257:8): [True: 0, False: 0]
  ------------------
  258|      0|    lf->filter_level[0] = 0;
  259|      0|    lf->filter_level[1] = 0;
  260|      0|    return;
  261|      0|  }
  262|       |
  263|  70.2k|  if (method == LPF_PICK_MINIMAL_LPF) {
  ------------------
  |  Branch (263:7): [True: 0, False: 70.2k]
  ------------------
  264|      0|    lf->filter_level[0] = 0;
  265|      0|    lf->filter_level[1] = 0;
  266|  70.2k|  } else if (method >= LPF_PICK_FROM_Q) {
  ------------------
  |  Branch (266:14): [True: 23.2k, False: 47.0k]
  ------------------
  267|  23.2k|    const int min_filter_level = 0;
  268|  23.2k|    const int max_filter_level = get_max_filter_level(cpi);
  269|  23.2k|    const int q = av1_ac_quant_QTX(cm->quant_params.base_qindex, 0,
  270|  23.2k|                                   seq_params->bit_depth);
  271|       |    // based on tests result for rtc test set
  272|       |    // 0.04590 boosted or 0.02295 non-booseted in 18-bit fixed point
  273|  23.2k|    const int strength_boost_q_treshold = 0;
  274|  23.2k|    int inter_frame_multiplier =
  275|  23.2k|        (q > strength_boost_q_treshold ||
  ------------------
  |  Branch (275:10): [True: 23.2k, False: 0]
  ------------------
  276|      0|         (cpi->sf.rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (276:11): [True: 0, False: 0]
  ------------------
  277|      0|          cpi->common.width * cpi->common.height > 352 * 288))
  ------------------
  |  Branch (277:11): [True: 0, False: 0]
  ------------------
  278|  23.2k|            ? 12034
  279|  23.2k|            : 6017;
  280|       |    // Increase strength on base TL0 for temporal layers, for low-resoln,
  281|       |    // based on frame source_sad.
  282|  23.2k|    if (cpi->svc.number_temporal_layers > 1 &&
  ------------------
  |  Branch (282:9): [True: 0, False: 23.2k]
  ------------------
  283|      0|        cpi->svc.temporal_layer_id == 0 &&
  ------------------
  |  Branch (283:9): [True: 0, False: 0]
  ------------------
  284|      0|        cpi->common.width * cpi->common.height <= 352 * 288 &&
  ------------------
  |  Branch (284:9): [True: 0, False: 0]
  ------------------
  285|      0|        cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (285:9): [True: 0, False: 0]
  ------------------
  286|      0|      if (cpi->rc.frame_source_sad > 100000)
  ------------------
  |  Branch (286:11): [True: 0, False: 0]
  ------------------
  287|      0|        inter_frame_multiplier = inter_frame_multiplier << 1;
  288|      0|      else if (cpi->rc.frame_source_sad > 50000)
  ------------------
  |  Branch (288:16): [True: 0, False: 0]
  ------------------
  289|      0|        inter_frame_multiplier = 3 * (inter_frame_multiplier >> 1);
  290|  23.2k|    } else if (cpi->sf.rt_sf.use_fast_fixed_part) {
  ------------------
  |  Branch (290:16): [True: 0, False: 23.2k]
  ------------------
  291|      0|      inter_frame_multiplier = inter_frame_multiplier << 1;
  292|      0|    }
  293|       |    // These values were determined by linear fitting the result of the
  294|       |    // searched level for 8 bit depth:
  295|       |    // Keyframes: filt_guess = q * 0.06699 - 1.60817
  296|       |    // Other frames: filt_guess = q * inter_frame_multiplier + 2.48225
  297|       |    //
  298|       |    // 10 bit depth:
  299|       |    // filt_guess = q * 0.01976 + 3.87252
  300|       |    //
  301|       |    // 12 bit depth:
  302|       |    // filt_guess = q * 0.00494 + 3.87252
  303|  23.2k|    int filt_guess;
  304|  23.2k|    switch (seq_params->bit_depth) {
  305|  18.8k|      case AOM_BITS_8:
  ------------------
  |  Branch (305:7): [True: 18.8k, False: 4.40k]
  ------------------
  306|  18.8k|        filt_guess =
  307|  18.8k|            (cm->current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (307:13): [True: 4.54k, False: 14.2k]
  ------------------
  308|  18.8k|                ? ROUND_POWER_OF_TWO(q * 17563 - 421574, 18)
  ------------------
  |  |   41|  4.54k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  309|  18.8k|                : ROUND_POWER_OF_TWO(q * inter_frame_multiplier + 650707, 18);
  ------------------
  |  |   41|  33.0k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  310|  18.8k|        break;
  311|  2.11k|      case AOM_BITS_10:
  ------------------
  |  Branch (311:7): [True: 2.11k, False: 21.0k]
  ------------------
  312|  2.11k|        filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 4060632, 20);
  ------------------
  |  |   41|  2.11k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  313|  2.11k|        break;
  314|  2.29k|      case AOM_BITS_12:
  ------------------
  |  Branch (314:7): [True: 2.29k, False: 20.9k]
  ------------------
  315|  2.29k|        filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 16242526, 22);
  ------------------
  |  |   41|  2.29k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  316|  2.29k|        break;
  317|      0|      default:
  ------------------
  |  Branch (317:7): [True: 0, False: 23.2k]
  ------------------
  318|      0|        assert(0 &&
  319|      0|               "bit_depth should be AOM_BITS_8, AOM_BITS_10 "
  320|      0|               "or AOM_BITS_12");
  321|      0|        return;
  322|  23.2k|    }
  323|  23.2k|    if (seq_params->bit_depth != AOM_BITS_8 &&
  ------------------
  |  Branch (323:9): [True: 4.40k, False: 18.8k]
  ------------------
  324|  4.40k|        cm->current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (324:9): [True: 1.07k, False: 3.32k]
  ------------------
  325|  1.07k|      filt_guess -= 4;
  326|       |    // TODO(chengchen): retrain the model for Y, U, V filter levels
  327|  23.2k|    lf->filter_level[0] = clamp(filt_guess, min_filter_level, max_filter_level);
  328|  23.2k|    lf->filter_level[1] = clamp(filt_guess, min_filter_level, max_filter_level);
  329|  23.2k|    lf->filter_level_u = clamp(filt_guess, min_filter_level, max_filter_level);
  330|  23.2k|    lf->filter_level_v = clamp(filt_guess, min_filter_level, max_filter_level);
  331|  23.2k|    if (cpi->oxcf.algo_cfg.loopfilter_control == LOOPFILTER_SELECTIVELY &&
  ------------------
  |  Branch (331:9): [True: 0, False: 23.2k]
  ------------------
  332|      0|        !frame_is_intra_only(cm) && !cpi->rc.high_source_sad) {
  ------------------
  |  Branch (332:9): [True: 0, False: 0]
  |  Branch (332:37): [True: 0, False: 0]
  ------------------
  333|      0|      if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (333:11): [True: 0, False: 0]
  ------------------
  334|      0|        lf->filter_level[0] = 0;
  335|      0|        lf->filter_level[1] = 0;
  336|      0|      } else {
  337|      0|        const int num4x4 = (cm->width >> 2) * (cm->height >> 2);
  338|      0|        const int newmv_thresh = 7;
  339|      0|        const int distance_since_key_thresh = 5;
  340|      0|        if ((cpi->td.rd_counts.newmv_or_intra_blocks * 100 / num4x4) <
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|                newmv_thresh &&
  342|      0|            cpi->rc.frames_since_key > distance_since_key_thresh) {
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|          lf->filter_level[0] = 0;
  344|      0|          lf->filter_level[1] = 0;
  345|      0|        }
  346|      0|      }
  347|      0|    }
  348|  47.0k|  } else {
  349|  47.0k|    int last_frame_filter_level[4] = { 0 };
  350|  47.0k|    if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (350:9): [True: 35.2k, False: 11.7k]
  ------------------
  351|  35.2k|      last_frame_filter_level[0] = cpi->ppi->filter_level[0];
  352|  35.2k|      last_frame_filter_level[1] = cpi->ppi->filter_level[1];
  353|  35.2k|      last_frame_filter_level[2] = cpi->ppi->filter_level_u;
  354|  35.2k|      last_frame_filter_level[3] = cpi->ppi->filter_level_v;
  355|  35.2k|    }
  356|       |    // The frame buffer last_frame_uf is used to store the non-loop filtered
  357|       |    // reconstructed frame in search_filter_level().
  358|  47.0k|    if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (358:9): [True: 0, False: 47.0k]
  ------------------
  359|  47.0k|            &cpi->last_frame_uf, cm->width, cm->height,
  360|  47.0k|            seq_params->subsampling_x, seq_params->subsampling_y,
  361|  47.0k|            seq_params->use_highbitdepth, cpi->oxcf.border_in_pixels,
  362|  47.0k|            cm->features.byte_alignment, NULL, NULL, NULL, false, 0))
  363|      0|      aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
  364|      0|                         "Failed to allocate last frame buffer");
  365|       |
  366|  47.0k|    int64_t zero_filter_sse[MAX_MB_PLANE] = { 0 };
  367|  47.0k|    int64_t best_filter_sse[MAX_MB_PLANE] = { 0 };
  368|       |
  369|  47.0k|    if (cpi->sf.lpf_sf.skip_loop_filter_using_filt_error >= 1) {
  ------------------
  |  Branch (369:9): [True: 0, False: 47.0k]
  ------------------
  370|      0|      for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (370:27): [True: 0, False: 0]
  ------------------
  371|      0|        zero_filter_sse[plane] = aom_get_sse_plane(
  372|      0|            sd, &cm->cur_frame->buf, plane, cm->seq_params->use_highbitdepth);
  373|      0|      }
  374|      0|    }
  375|       |
  376|  47.0k|    lf->filter_level[0] = lf->filter_level[1] =
  377|  47.0k|        search_filter_level(sd, cpi, method == LPF_PICK_FROM_SUBIMAGE,
  378|  47.0k|                            last_frame_filter_level, 0, 2, &best_filter_sse[0]);
  379|  47.0k|    if (method != LPF_PICK_FROM_FULL_IMAGE_NON_DUAL) {
  ------------------
  |  Branch (379:9): [True: 0, False: 47.0k]
  ------------------
  380|      0|      lf->filter_level[0] = search_filter_level(
  381|      0|          sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, 0,
  382|      0|          0, &best_filter_sse[0]);
  383|      0|      lf->filter_level[1] = search_filter_level(
  384|      0|          sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, 0,
  385|      0|          1, &best_filter_sse[0]);
  386|      0|    }
  387|       |
  388|  47.0k|    if (num_planes > 1) {
  ------------------
  |  Branch (388:9): [True: 18.6k, False: 28.4k]
  ------------------
  389|  18.6k|      lf->filter_level_u = search_filter_level(
  390|  18.6k|          sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, 1,
  391|  18.6k|          0, &best_filter_sse[1]);
  392|  18.6k|      lf->filter_level_v = search_filter_level(
  393|  18.6k|          sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, last_frame_filter_level, 2,
  394|  18.6k|          0, &best_filter_sse[2]);
  395|  18.6k|    }
  396|       |
  397|  47.0k|    lf->backup_filter_level[0] = lf->filter_level[0];
  398|  47.0k|    lf->backup_filter_level[1] = lf->filter_level[1];
  399|  47.0k|    lf->backup_filter_level_u = lf->filter_level_u;
  400|  47.0k|    lf->backup_filter_level_v = lf->filter_level_v;
  401|       |
  402|  47.0k|    if (cpi->sf.lpf_sf.adaptive_luma_loop_filter_skip >= 1) {
  ------------------
  |  Branch (402:9): [True: 0, False: 47.0k]
  ------------------
  403|      0|      int32_t min_ref_filter_level[2] = { MAX_LOOP_FILTER, MAX_LOOP_FILTER };
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
                    int32_t min_ref_filter_level[2] = { MAX_LOOP_FILTER, MAX_LOOP_FILTER };
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  404|       |      // Find the minimum luma filter levels across all reference frames.
  405|      0|      for (int ref = LAST_FRAME; ref <= ALTREF_FRAME; ++ref) {
  ------------------
  |  Branch (405:34): [True: 0, False: 0]
  ------------------
  406|      0|        const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref);
  407|      0|        if (buf == NULL) continue;
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|       |
  409|      0|        if (buf->filter_level[0] != -1)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|          min_ref_filter_level[0] =
  411|      0|              AOMMIN(min_ref_filter_level[0], buf->filter_level[0]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  412|      0|        if (buf->filter_level[1] != -1)
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|          min_ref_filter_level[1] =
  414|      0|              AOMMIN(min_ref_filter_level[1], buf->filter_level[1]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  415|      0|      }
  416|       |
  417|       |      // Reset luma filter levels to zero based on minimum filter levels of
  418|       |      // reference frames and current frame's pyramid level.
  419|      0|      unsigned int pyramid_level = cm->current_frame.pyramid_level;
  420|      0|      if (pyramid_level > 1) {
  ------------------
  |  Branch (420:11): [True: 0, False: 0]
  ------------------
  421|      0|        int filter_threshold;
  422|      0|        if (pyramid_level >= 4)
  ------------------
  |  Branch (422:13): [True: 0, False: 0]
  ------------------
  423|      0|          filter_threshold = 16;
  424|      0|        else
  425|      0|          filter_threshold = 8;
  426|       |
  427|      0|        const bool reset_filter_level_y =
  428|      0|            lf->filter_level[0] < filter_threshold &&
  ------------------
  |  Branch (428:13): [True: 0, False: 0]
  ------------------
  429|      0|            lf->filter_level[1] < filter_threshold &&
  ------------------
  |  Branch (429:13): [True: 0, False: 0]
  ------------------
  430|      0|            lf->filter_level_u < filter_threshold &&
  ------------------
  |  Branch (430:13): [True: 0, False: 0]
  ------------------
  431|      0|            lf->filter_level_v < filter_threshold &&
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            min_ref_filter_level[0] == 0 && min_ref_filter_level[1] == 0;
  ------------------
  |  Branch (432:13): [True: 0, False: 0]
  |  Branch (432:45): [True: 0, False: 0]
  ------------------
  433|      0|        if (reset_filter_level_y) {
  ------------------
  |  Branch (433:13): [True: 0, False: 0]
  ------------------
  434|      0|          lf->filter_level[0] = 0;
  435|      0|          lf->filter_level[1] = 0;
  436|      0|        }
  437|      0|      }
  438|      0|    }
  439|       |
  440|  47.0k|    if (lf->filter_level[0] != 0 && lf->filter_level[1] != 0 &&
  ------------------
  |  Branch (440:9): [True: 4.74k, False: 42.2k]
  |  Branch (440:37): [True: 4.74k, False: 0]
  ------------------
  441|  4.74k|        cpi->sf.lpf_sf.skip_loop_filter_using_filt_error >= 1) {
  ------------------
  |  Branch (441:9): [True: 0, False: 4.74k]
  ------------------
  442|      0|      const double pct_improvement_thresh = 2.0;
  443|      0|      bool reset_filter_level_y = true;
  444|       |
  445|       |      // Calculate the percentage improvement in SSE for each plane. This
  446|       |      // measures the relative reduction in error when applying the filter
  447|       |      // compared to no filtering.
  448|      0|      for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (448:27): [True: 0, False: 0]
  ------------------
  449|      0|        const double pct_improvement_sse =
  450|      0|            ((zero_filter_sse[plane] - best_filter_sse[plane]) * 100.0) /
  451|      0|            zero_filter_sse[plane];
  452|      0|        reset_filter_level_y &= pct_improvement_sse < pct_improvement_thresh;
  453|      0|      }
  454|       |
  455|      0|      if (reset_filter_level_y) {
  ------------------
  |  Branch (455:11): [True: 0, False: 0]
  ------------------
  456|      0|        lf->filter_level[0] = 0;
  457|      0|        lf->filter_level[1] = 0;
  458|      0|      }
  459|      0|    }
  460|       |
  461|       |    // Store the current frame's filter levels to be referenced
  462|       |    // while determining the minimum filter level from reference frames.
  463|  47.0k|    cm->cur_frame->filter_level[0] = lf->filter_level[0];
  464|  47.0k|    cm->cur_frame->filter_level[1] = lf->filter_level[1];
  465|  47.0k|  }
  466|  70.2k|}
picklpf.c:get_max_filter_level:
   53|   107k|static int get_max_filter_level(const AV1_COMP *cpi) {
   54|   107k|  if (is_stat_consumption_stage_twopass(cpi)) {
  ------------------
  |  Branch (54:7): [True: 0, False: 107k]
  ------------------
   55|      0|    return cpi->ppi->twopass.section_intra_rating > 8 ? MAX_LOOP_FILTER * 3 / 4
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
  |  Branch (55:12): [True: 0, False: 0]
  ------------------
   56|      0|                                                      : MAX_LOOP_FILTER;
  ------------------
  |  |   27|      0|#define MAX_LOOP_FILTER 63
  ------------------
   57|   107k|  } else {
   58|   107k|    return MAX_LOOP_FILTER;
  ------------------
  |  |   27|   107k|#define MAX_LOOP_FILTER 63
  ------------------
   59|   107k|  }
   60|   107k|}
picklpf.c:search_filter_level:
  105|  84.2k|                               int dir, int64_t *best_filter_sse) {
  106|  84.2k|  const AV1_COMMON *const cm = &cpi->common;
  107|  84.2k|  const int min_filter_level = 0;
  108|  84.2k|  const int max_filter_level = get_max_filter_level(cpi);
  109|  84.2k|  int filt_direction = 0;
  110|  84.2k|  int64_t best_err;
  111|  84.2k|  int filt_best;
  112|       |
  113|       |  // Start the search at the previous frame filter level unless it is now out of
  114|       |  // range.
  115|  84.2k|  int lvl;
  116|  84.2k|  switch (plane) {
  117|  47.0k|    case 0:
  ------------------
  |  Branch (117:5): [True: 47.0k, False: 37.2k]
  ------------------
  118|  47.0k|      switch (dir) {
  119|  47.0k|        case 2:
  ------------------
  |  Branch (119:9): [True: 47.0k, False: 0]
  ------------------
  120|  47.0k|          lvl = (last_frame_filter_level[0] + last_frame_filter_level[1] + 1) >>
  121|  47.0k|                1;
  122|  47.0k|          break;
  123|      0|        case 0:
  ------------------
  |  Branch (123:9): [True: 0, False: 47.0k]
  ------------------
  124|      0|        case 1: lvl = last_frame_filter_level[dir]; break;
  ------------------
  |  Branch (124:9): [True: 0, False: 47.0k]
  ------------------
  125|      0|        default: assert(dir >= 0 && dir <= 2); return 0;
  ------------------
  |  Branch (125:9): [True: 0, False: 47.0k]
  ------------------
  126|  47.0k|      }
  127|  47.0k|      break;
  128|  47.0k|    case 1: lvl = last_frame_filter_level[2]; break;
  ------------------
  |  Branch (128:5): [True: 18.6k, False: 65.6k]
  ------------------
  129|  18.6k|    case 2: lvl = last_frame_filter_level[3]; break;
  ------------------
  |  Branch (129:5): [True: 18.6k, False: 65.6k]
  ------------------
  130|      0|    default: assert(plane >= 0 && plane <= 2); return 0;
  ------------------
  |  Branch (130:5): [True: 0, False: 84.2k]
  ------------------
  131|  84.2k|  }
  132|  84.2k|  int filt_mid = clamp(lvl, min_filter_level, max_filter_level);
  133|  84.2k|  int filter_step = filt_mid < 16 ? 4 : filt_mid / 4;
  ------------------
  |  Branch (133:21): [True: 83.7k, False: 536]
  ------------------
  134|       |  // Sum squared error at each filter level
  135|  84.2k|  int64_t ss_err[MAX_LOOP_FILTER + 1];
  136|       |
  137|  84.2k|  const int use_coarse_search = cpi->sf.lpf_sf.use_coarse_filter_level_search;
  138|  84.2k|  assert(use_coarse_search <= 1);
  139|  84.2k|  static const int min_filter_step_lookup[2] = { 0, 2 };
  140|       |  // min_filter_step_thesh determines the stopping criteria for the search.
  141|       |  // The search is terminated when filter_step equals min_filter_step_thesh.
  142|  84.2k|  const int min_filter_step_thesh = min_filter_step_lookup[use_coarse_search];
  143|       |
  144|       |  // Set each entry to -1
  145|  84.2k|  memset(ss_err, 0xFF, sizeof(ss_err));
  146|  84.2k|  yv12_copy_plane(&cm->cur_frame->buf, &cpi->last_frame_uf, plane);
  147|  84.2k|  best_err = try_filter_frame(sd, cpi, filt_mid, partial_frame, plane, dir);
  148|  84.2k|  filt_best = filt_mid;
  149|  84.2k|  ss_err[filt_mid] = best_err;
  150|       |
  151|   229k|  while (filter_step > min_filter_step_thesh) {
  ------------------
  |  Branch (151:10): [True: 145k, False: 84.2k]
  ------------------
  152|   145k|    const int filt_high = AOMMIN(filt_mid + filter_step, max_filter_level);
  ------------------
  |  |   34|   145k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 145k, False: 0]
  |  |  ------------------
  ------------------
  153|   145k|    const int filt_low = AOMMAX(filt_mid - filter_step, min_filter_level);
  ------------------
  |  |   35|   145k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 13.3k, False: 131k]
  |  |  ------------------
  ------------------
  154|       |
  155|       |    // Bias against raising loop filter in favor of lowering it.
  156|   145k|    int64_t bias = (best_err >> (15 - (filt_mid / 8))) * filter_step;
  157|       |
  158|   145k|    if ((is_stat_consumption_stage_twopass(cpi)) &&
  ------------------
  |  Branch (158:9): [True: 0, False: 145k]
  ------------------
  159|      0|        (cpi->ppi->twopass.section_intra_rating < 20))
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|      bias = (bias * cpi->ppi->twopass.section_intra_rating) / 20;
  161|       |
  162|       |    // yx, bias less for large block size
  163|   145k|    if (cm->features.tx_mode != ONLY_4X4) bias >>= 1;
  ------------------
  |  Branch (163:9): [True: 145k, False: 0]
  ------------------
  164|       |
  165|   145k|    if (filt_direction <= 0 && filt_low != filt_mid) {
  ------------------
  |  Branch (165:9): [True: 133k, False: 11.9k]
  |  Branch (165:32): [True: 12.5k, False: 120k]
  ------------------
  166|       |      // Get Low filter error score
  167|  12.5k|      if (ss_err[filt_low] < 0) {
  ------------------
  |  Branch (167:11): [True: 11.6k, False: 955]
  ------------------
  168|  11.6k|        ss_err[filt_low] =
  169|  11.6k|            try_filter_frame(sd, cpi, filt_low, partial_frame, plane, dir);
  170|  11.6k|      }
  171|       |      // If value is close to the best so far then bias towards a lower loop
  172|       |      // filter value.
  173|  12.5k|      if (ss_err[filt_low] < (best_err + bias)) {
  ------------------
  |  Branch (173:11): [True: 7.54k, False: 5.02k]
  ------------------
  174|       |        // Was it actually better than the previous best?
  175|  7.54k|        if (ss_err[filt_low] < best_err) {
  ------------------
  |  Branch (175:13): [True: 3.55k, False: 3.98k]
  ------------------
  176|  3.55k|          best_err = ss_err[filt_low];
  177|  3.55k|        }
  178|  7.54k|        filt_best = filt_low;
  179|  7.54k|      }
  180|  12.5k|    }
  181|       |
  182|       |    // Now look at filt_high
  183|   145k|    if (filt_direction >= 0 && filt_high != filt_mid) {
  ------------------
  |  Branch (183:9): [True: 138k, False: 6.66k]
  |  Branch (183:32): [True: 138k, False: 0]
  ------------------
  184|   138k|      if (ss_err[filt_high] < 0) {
  ------------------
  |  Branch (184:11): [True: 137k, False: 690]
  ------------------
  185|   137k|        ss_err[filt_high] =
  186|   137k|            try_filter_frame(sd, cpi, filt_high, partial_frame, plane, dir);
  187|   137k|      }
  188|       |      // If value is significantly better than previous best, bias added against
  189|       |      // raising filter value
  190|   138k|      if (ss_err[filt_high] < (best_err - bias)) {
  ------------------
  |  Branch (190:11): [True: 11.9k, False: 126k]
  ------------------
  191|  11.9k|        best_err = ss_err[filt_high];
  192|  11.9k|        filt_best = filt_high;
  193|  11.9k|      }
  194|   138k|    }
  195|       |
  196|       |    // Half the step distance if the best filter value was the same as last time
  197|   145k|    if (filt_best == filt_mid) {
  ------------------
  |  Branch (197:9): [True: 126k, False: 18.6k]
  ------------------
  198|   126k|      filter_step /= 2;
  199|   126k|      filt_direction = 0;
  200|   126k|    } else {
  201|  18.6k|      filt_direction = (filt_best < filt_mid) ? -1 : 1;
  ------------------
  |  Branch (201:24): [True: 6.66k, False: 11.9k]
  ------------------
  202|  18.6k|      filt_mid = filt_best;
  203|  18.6k|    }
  204|   145k|  }
  205|       |
  206|  84.2k|  *best_filter_sse = ss_err[filt_best];
  207|       |
  208|  84.2k|  return filt_best;
  209|  84.2k|}
picklpf.c:yv12_copy_plane:
   44|   317k|                            YV12_BUFFER_CONFIG *dst_bc, int plane) {
   45|   317k|  switch (plane) {
   46|   176k|    case 0: aom_yv12_copy_y(src_bc, dst_bc, 0); break;
  ------------------
  |  |   46|   176k|#define aom_yv12_copy_y aom_yv12_copy_y_c
  ------------------
  |  Branch (46:5): [True: 176k, False: 141k]
  ------------------
   47|  70.8k|    case 1: aom_yv12_copy_u(src_bc, dst_bc, 0); break;
  ------------------
  |  |   40|  70.8k|#define aom_yv12_copy_u aom_yv12_copy_u_c
  ------------------
  |  Branch (47:5): [True: 70.8k, False: 246k]
  ------------------
   48|  70.7k|    case 2: aom_yv12_copy_v(src_bc, dst_bc, 0); break;
  ------------------
  |  |   43|  70.7k|#define aom_yv12_copy_v aom_yv12_copy_v_c
  ------------------
  |  Branch (48:5): [True: 70.7k, False: 247k]
  ------------------
   49|      0|    default: assert(plane >= 0 && plane <= 2); break;
  ------------------
  |  Branch (49:5): [True: 0, False: 317k]
  ------------------
   50|   317k|  }
   51|   317k|}
picklpf.c:try_filter_frame:
   64|   233k|                                int partial_frame, int plane, int dir) {
   65|   233k|  MultiThreadInfo *const mt_info = &cpi->mt_info;
   66|   233k|  int num_workers = mt_info->num_mod_workers[MOD_LPF];
   67|   233k|  AV1_COMMON *const cm = &cpi->common;
   68|   233k|  int64_t filt_err;
   69|       |
   70|   233k|  assert(plane >= 0 && plane <= 2);
   71|   233k|  int filter_level[2] = { filt_level, filt_level };
   72|   233k|  if (plane == 0 && dir == 0) filter_level[1] = cm->lf.filter_level[1];
  ------------------
  |  Branch (72:7): [True: 129k, False: 104k]
  |  Branch (72:21): [True: 0, False: 129k]
  ------------------
   73|   233k|  if (plane == 0 && dir == 1) filter_level[0] = cm->lf.filter_level[0];
  ------------------
  |  Branch (73:7): [True: 129k, False: 104k]
  |  Branch (73:21): [True: 0, False: 129k]
  ------------------
   74|       |
   75|       |  // set base filters for use of get_filter_level (av1_loopfilter.c) when in
   76|       |  // DELTA_LF mode
   77|   233k|  switch (plane) {
  ------------------
  |  Branch (77:11): [True: 233k, False: 0]
  ------------------
   78|   129k|    case 0:
  ------------------
  |  Branch (78:5): [True: 129k, False: 104k]
  ------------------
   79|   129k|      cm->lf.filter_level[0] = filter_level[0];
   80|   129k|      cm->lf.filter_level[1] = filter_level[1];
   81|   129k|      break;
   82|  52.2k|    case 1: cm->lf.filter_level_u = filter_level[0]; break;
  ------------------
  |  Branch (82:5): [True: 52.2k, False: 181k]
  ------------------
   83|  52.1k|    case 2: cm->lf.filter_level_v = filter_level[0]; break;
  ------------------
  |  Branch (83:5): [True: 52.1k, False: 181k]
  ------------------
   84|   233k|  }
   85|       |
   86|       |  // lpf_opt_level = 1 : Enables dual/quad loop-filtering.
   87|   233k|  int lpf_opt_level = is_inter_tx_size_search_level_one(&cpi->sf.tx_sf);
   88|       |
   89|   233k|  av1_loop_filter_frame_mt(&cm->cur_frame->buf, cm, &cpi->td.mb.e_mbd, plane,
   90|   233k|                           plane + 1, partial_frame, mt_info->workers,
   91|   233k|                           num_workers, &mt_info->lf_row_sync, lpf_opt_level);
   92|       |
   93|   233k|  filt_err = aom_get_sse_plane(sd, &cm->cur_frame->buf, plane,
   94|   233k|                               cm->seq_params->use_highbitdepth);
   95|       |
   96|       |  // Re-instate the unfiltered frame
   97|   233k|  yv12_copy_plane(&cpi->last_frame_uf, &cm->cur_frame->buf, plane);
   98|       |
   99|   233k|  return filt_err;
  100|   233k|}

av1_calc_proj_params_c:
  638|  1.26k|                            const sgr_params_type *params) {
  639|  1.26k|  if ((params->r[0] > 0) && (params->r[1] > 0)) {
  ------------------
  |  Branch (639:7): [True: 1.26k, False: 0]
  |  Branch (639:29): [True: 1.26k, False: 0]
  ------------------
  640|  1.26k|    calc_proj_params_r0_r1_c(src8, width, height, src_stride, dat8, dat_stride,
  641|  1.26k|                             flt0, flt0_stride, flt1, flt1_stride, H, C);
  642|  1.26k|  } else if (params->r[0] > 0) {
  ------------------
  |  Branch (642:14): [True: 0, False: 0]
  ------------------
  643|      0|    calc_proj_params_r0_c(src8, width, height, src_stride, dat8, dat_stride,
  644|      0|                          flt0, flt0_stride, H, C);
  645|      0|  } else if (params->r[1] > 0) {
  ------------------
  |  Branch (645:14): [True: 0, False: 0]
  ------------------
  646|      0|    calc_proj_params_r1_c(src8, width, height, src_stride, dat8, dat_stride,
  647|      0|                          flt1, flt1_stride, H, C);
  648|      0|  }
  649|  1.26k|}
av1_calc_proj_params_high_bd_c:
  658|  1.18k|                                    const sgr_params_type *params) {
  659|  1.18k|  if ((params->r[0] > 0) && (params->r[1] > 0)) {
  ------------------
  |  Branch (659:7): [True: 1.18k, False: 0]
  |  Branch (659:29): [True: 1.18k, False: 0]
  ------------------
  660|  1.18k|    calc_proj_params_r0_r1_high_bd_c(src8, width, height, src_stride, dat8,
  661|  1.18k|                                     dat_stride, flt0, flt0_stride, flt1,
  662|  1.18k|                                     flt1_stride, H, C);
  663|  1.18k|  } else if (params->r[0] > 0) {
  ------------------
  |  Branch (663:14): [True: 0, False: 0]
  ------------------
  664|      0|    calc_proj_params_r0_high_bd_c(src8, width, height, src_stride, dat8,
  665|      0|                                  dat_stride, flt0, flt0_stride, H, C);
  666|      0|  } else if (params->r[1] > 0) {
  ------------------
  |  Branch (666:14): [True: 0, False: 0]
  ------------------
  667|      0|    calc_proj_params_r1_high_bd_c(src8, width, height, src_stride, dat8,
  668|      0|                                  dat_stride, flt1, flt1_stride, H, C);
  669|      0|  }
  670|  1.18k|}
av1_pick_filter_restoration:
 2045|  10.1k|void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *src, AV1_COMP *cpi) {
 2046|  10.1k|  AV1_COMMON *const cm = &cpi->common;
 2047|  10.1k|  MACROBLOCK *const x = &cpi->td.mb;
 2048|  10.1k|  const SequenceHeader *const seq_params = cm->seq_params;
 2049|  10.1k|  const LOOP_FILTER_SPEED_FEATURES *lpf_sf = &cpi->sf.lpf_sf;
 2050|  10.1k|  const int num_planes = av1_num_planes(cm);
 2051|  10.1k|  const int highbd = cm->seq_params->use_highbitdepth;
 2052|  10.1k|  assert(!cm->features.all_lossless);
 2053|       |
 2054|  10.1k|  av1_fill_lr_rates(&x->mode_costs, x->e_mbd.tile_ctx);
 2055|       |
 2056|       |  // Select unit size based on speed feature settings, and allocate
 2057|       |  // rui structs based on this size
 2058|  10.1k|  int min_lr_unit_size = cpi->sf.lpf_sf.min_lr_unit_size;
 2059|  10.1k|  int max_lr_unit_size = cpi->sf.lpf_sf.max_lr_unit_size;
 2060|       |
 2061|       |  // The minimum allowed unit size at a syntax level is 1 superblock.
 2062|       |  // Apply this constraint here so that the speed features code which sets
 2063|       |  // cpi->sf.lpf_sf.min_lr_unit_size does not need to know the superblock size
 2064|  10.1k|  min_lr_unit_size =
 2065|  10.1k|      AOMMAX(min_lr_unit_size, block_size_wide[cm->seq_params->sb_size]);
  ------------------
  |  |   35|  10.1k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 10.1k, False: 0]
  |  |  ------------------
  ------------------
 2066|       |
 2067|  10.1k|  max_lr_unit_size = AOMMAX(min_lr_unit_size, max_lr_unit_size);
  ------------------
  |  |   35|  10.1k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 10.1k]
  |  |  ------------------
  ------------------
 2068|       |
 2069|  27.7k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (2069:23): [True: 17.6k, False: 10.1k]
  ------------------
 2070|  17.6k|    cpi->pick_lr_ctxt.rusi[plane] = allocate_search_structs(
 2071|  17.6k|        cm, &cm->rst_info[plane], plane > 0, min_lr_unit_size);
 2072|  17.6k|  }
 2073|       |
 2074|  10.1k|  x->rdmult = cpi->rd.RDMULT;
 2075|       |
 2076|       |  // Allocate the frame buffer trial_frame_rst, which is used to temporarily
 2077|       |  // store the loop restored frame.
 2078|  10.1k|  if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (2078:7): [True: 0, False: 10.1k]
  ------------------
 2079|  10.1k|          &cpi->trial_frame_rst, cm->superres_upscaled_width,
 2080|  10.1k|          cm->superres_upscaled_height, seq_params->subsampling_x,
 2081|  10.1k|          seq_params->subsampling_y, highbd, AOM_RESTORATION_FRAME_BORDER,
  ------------------
  |  |   30|  10.1k|#define AOM_RESTORATION_FRAME_BORDER 32
  ------------------
 2082|  10.1k|          cm->features.byte_alignment, NULL, NULL, NULL, false, 0))
 2083|      0|    aom_internal_error(cm->error, AOM_CODEC_MEM_ERROR,
 2084|      0|                       "Failed to allocate trial restored frame buffer");
 2085|       |
 2086|  10.1k|  RestSearchCtxt rsc;
 2087|       |
 2088|       |  // The buffers 'src_avg' and 'dgd_avg' are used to compute H and M buffers.
 2089|       |  // These buffers are only required for the AVX2 and NEON implementations of
 2090|       |  // av1_compute_stats. The buffer size required is calculated based on maximum
 2091|       |  // width and height of the LRU (i.e., from foreach_rest_unit_in_plane() 1.5
 2092|       |  // times the RESTORATION_UNITSIZE_MAX) allowed for Wiener filtering. The width
 2093|       |  // and height aligned to multiple of 16 is considered for intrinsic purpose.
 2094|  10.1k|  rsc.dgd_avg = NULL;
 2095|  10.1k|  rsc.src_avg = NULL;
 2096|  10.1k|#if HAVE_AVX2 || HAVE_NEON || HAVE_SVE
 2097|       |  // The buffers allocated below are used during Wiener filter processing.
 2098|       |  // Hence, allocate the same when Wiener filter is enabled. Make sure to
 2099|       |  // allocate these buffers only for the SIMD extensions that make use of them
 2100|       |  // (i.e. AVX2 for low bitdepth and NEON and SVE for low and high bitdepth).
 2101|  10.1k|#if HAVE_AVX2
 2102|  10.1k|  bool allocate_buffers = !cpi->sf.lpf_sf.disable_wiener_filter && !highbd;
  ------------------
  |  Branch (2102:27): [True: 10.1k, False: 0]
  |  Branch (2102:68): [True: 8.10k, False: 2.05k]
  ------------------
 2103|       |#elif HAVE_NEON || HAVE_SVE
 2104|       |  bool allocate_buffers = !cpi->sf.lpf_sf.disable_wiener_filter;
 2105|       |#endif
 2106|  10.1k|  if (allocate_buffers) {
  ------------------
  |  Branch (2106:7): [True: 8.10k, False: 2.05k]
  ------------------
 2107|  8.10k|    const int buf_size = sizeof(*cpi->pick_lr_ctxt.dgd_avg) * 6 *
 2108|  8.10k|                         RESTORATION_UNITSIZE_MAX * RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  8.10k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
                                       RESTORATION_UNITSIZE_MAX * RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  8.10k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 2109|  8.10k|    CHECK_MEM_ERROR(cm, cpi->pick_lr_ctxt.dgd_avg,
  ------------------
  |  |   51|  8.10k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  8.10k|  do {                                                    \
  |  |  |  |   72|  8.10k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  8.10k|    lval = (expr);                                        \
  |  |  |  |   74|  8.10k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 8.10k]
  |  |  |  |  ------------------
  |  |  |  |   75|  8.10k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  8.10k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 8.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2110|  8.10k|                    (int16_t *)aom_memalign(32, buf_size));
 2111|       |
 2112|  8.10k|    rsc.dgd_avg = cpi->pick_lr_ctxt.dgd_avg;
 2113|       |    // When LRU width isn't multiple of 16, the 256 bits load instruction used
 2114|       |    // in AVX2 intrinsic can read data beyond valid LRU. Hence, in order to
 2115|       |    // silence Valgrind warning this buffer is initialized with zero. Overhead
 2116|       |    // due to this initialization is negligible since it is done at frame level.
 2117|  8.10k|    memset(rsc.dgd_avg, 0, buf_size);
 2118|  8.10k|    rsc.src_avg =
 2119|  8.10k|        rsc.dgd_avg + 3 * RESTORATION_UNITSIZE_MAX * RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  8.10k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
                      rsc.dgd_avg + 3 * RESTORATION_UNITSIZE_MAX * RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  8.10k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 2120|       |    // Asserts the starting address of src_avg is always 32-bytes aligned.
 2121|  8.10k|    assert(!((intptr_t)rsc.src_avg % 32));
 2122|  8.10k|  }
 2123|  10.1k|#endif
 2124|       |
 2125|       |  // Initialize all planes, so that any planes we skip searching will still have
 2126|       |  // valid data
 2127|  27.7k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (2127:23): [True: 17.6k, False: 10.1k]
  ------------------
 2128|  17.6k|    cm->rst_info[plane].frame_restoration_type = RESTORE_NONE;
 2129|  17.6k|  }
 2130|       |
 2131|       |  // Decide which planes to search
 2132|  10.1k|  int plane_start, plane_end;
 2133|       |
 2134|  10.1k|  if (lpf_sf->disable_loop_restoration_luma) {
  ------------------
  |  Branch (2134:7): [True: 0, False: 10.1k]
  ------------------
 2135|      0|    plane_start = AOM_PLANE_U;
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 2136|  10.1k|  } else {
 2137|  10.1k|    plane_start = AOM_PLANE_Y;
  ------------------
  |  |  281|  10.1k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2138|  10.1k|  }
 2139|       |
 2140|  10.1k|  if (num_planes == 1 || lpf_sf->disable_loop_restoration_chroma) {
  ------------------
  |  Branch (2140:7): [True: 6.42k, False: 3.73k]
  |  Branch (2140:26): [True: 2.79k, False: 933]
  ------------------
 2141|  9.22k|    plane_end = AOM_PLANE_Y;
  ------------------
  |  |  281|  9.22k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2142|  9.22k|  } else {
 2143|    933|    plane_end = AOM_PLANE_V;
  ------------------
  |  |  283|    933|#define AOM_PLANE_V 2      /**< V (Chroma) plane */
  ------------------
 2144|    933|  }
 2145|       |
 2146|       |  // Derive the flags to enable/disable Loop restoration filters based on the
 2147|       |  // speed features 'disable_wiener_filter' and 'disable_sgr_filter'.
 2148|  10.1k|  bool disable_lr_filter[RESTORE_TYPES] = { false };
 2149|  10.1k|  av1_derive_flags_for_lr_processing(lpf_sf, disable_lr_filter);
 2150|       |
 2151|  22.1k|  for (int plane = plane_start; plane <= plane_end; plane++) {
  ------------------
  |  Branch (2151:33): [True: 12.0k, False: 10.1k]
  ------------------
 2152|  12.0k|    const YV12_BUFFER_CONFIG *dgd = &cm->cur_frame->buf;
 2153|  12.0k|    const int is_uv = plane != AOM_PLANE_Y;
  ------------------
  |  |  281|  12.0k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2154|  12.0k|    int plane_w, plane_h;
 2155|  12.0k|    av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 2156|  12.0k|    av1_extend_frame(dgd->buffers[plane], plane_w, plane_h, dgd->strides[is_uv],
 2157|  12.0k|                     RESTORATION_BORDER, RESTORATION_BORDER, highbd);
  ------------------
  |  |   62|  12.0k|#define RESTORATION_BORDER 3
  ------------------
                                   RESTORATION_BORDER, RESTORATION_BORDER, highbd);
  ------------------
  |  |   62|  12.0k|#define RESTORATION_BORDER 3
  ------------------
 2158|  12.0k|  }
 2159|       |
 2160|  10.1k|  double best_cost = DBL_MAX;
 2161|  10.1k|  int best_luma_unit_size = max_lr_unit_size;
 2162|  10.1k|  for (int luma_unit_size = max_lr_unit_size;
 2163|  10.8k|       luma_unit_size >= min_lr_unit_size; luma_unit_size >>= 1) {
  ------------------
  |  Branch (2163:8): [True: 10.1k, False: 739]
  ------------------
 2164|  10.1k|    int64_t bits_this_size = 0;
 2165|  10.1k|    int64_t sse_this_size = 0;
 2166|  10.1k|    RestorationType best_rtype[MAX_MB_PLANE] = { RESTORE_NONE, RESTORE_NONE,
 2167|  10.1k|                                                 RESTORE_NONE };
 2168|  22.1k|    for (int plane = plane_start; plane <= plane_end; ++plane) {
  ------------------
  |  Branch (2168:35): [True: 12.0k, False: 10.1k]
  ------------------
 2169|  12.0k|      set_restoration_unit_size(cm, &cm->rst_info[plane], plane > 0,
 2170|  12.0k|                                luma_unit_size);
 2171|  12.0k|      init_rsc(src, &cpi->common, x, lpf_sf, plane,
 2172|  12.0k|               cpi->pick_lr_ctxt.rusi[plane], &cpi->trial_frame_rst, &rsc);
 2173|       |
 2174|  12.0k|      restoration_search(cm, plane, &rsc, disable_lr_filter);
 2175|       |
 2176|  12.0k|      const int plane_num_units = cm->rst_info[plane].num_rest_units;
 2177|  12.0k|      const RestorationType num_rtypes =
 2178|  12.0k|          (plane_num_units > 1) ? RESTORE_TYPES : RESTORE_SWITCHABLE_TYPES;
  ------------------
  |  Branch (2178:11): [True: 176, False: 11.8k]
  ------------------
 2179|  12.0k|      double best_cost_this_plane = DBL_MAX;
 2180|  48.2k|      for (RestorationType r = 0; r < num_rtypes; ++r) {
  ------------------
  |  Branch (2180:35): [True: 36.2k, False: 12.0k]
  ------------------
 2181|       |        // Disable Loop restoration filter based on the flags set using speed
 2182|       |        // feature 'disable_wiener_filter' and 'disable_sgr_filter'.
 2183|  36.2k|        if (disable_lr_filter[r]) continue;
  ------------------
  |  Branch (2183:13): [True: 5.70k, False: 30.5k]
  ------------------
 2184|       |
 2185|       |        // Restrict loop restoration search to RESTORE_SWITCHABLE by skipping
 2186|       |        // WIENER and SGRPROJ.
 2187|  30.5k|        if (lpf_sf->switchable_lr_with_bias_level > 0 &&
  ------------------
  |  Branch (2187:13): [True: 0, False: 30.5k]
  ------------------
 2188|      0|            (r == RESTORE_WIENER || r == RESTORE_SGRPROJ))
  ------------------
  |  Branch (2188:14): [True: 0, False: 0]
  |  Branch (2188:37): [True: 0, False: 0]
  ------------------
 2189|      0|          continue;
 2190|       |
 2191|  30.5k|        double cost_this_plane = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|  30.5k|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|  30.5k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|  30.5k|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  30.5k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2192|  30.5k|            x->rdmult, rsc.total_bits[r] >> 4, rsc.total_sse[r],
 2193|  30.5k|            cm->seq_params->bit_depth);
 2194|       |
 2195|  30.5k|        if (cost_this_plane < best_cost_this_plane) {
  ------------------
  |  Branch (2195:13): [True: 12.8k, False: 17.6k]
  ------------------
 2196|  12.8k|          best_cost_this_plane = cost_this_plane;
 2197|  12.8k|          best_rtype[plane] = r;
 2198|  12.8k|        }
 2199|  30.5k|      }
 2200|       |
 2201|  12.0k|      bits_this_size += rsc.total_bits[best_rtype[plane]];
 2202|  12.0k|      sse_this_size += rsc.total_sse[best_rtype[plane]];
 2203|  12.0k|    }
 2204|       |
 2205|  10.1k|    double cost_this_size = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|  10.1k|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|  10.1k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|  10.1k|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  10.1k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2206|  10.1k|        x->rdmult, bits_this_size >> 4, sse_this_size,
 2207|  10.1k|        cm->seq_params->bit_depth);
 2208|       |
 2209|  10.1k|    if (cost_this_size < best_cost) {
  ------------------
  |  Branch (2209:9): [True: 10.1k, False: 0]
  ------------------
 2210|  10.1k|      best_cost = cost_this_size;
 2211|  10.1k|      best_luma_unit_size = luma_unit_size;
 2212|       |      // Copy parameters out of rusi struct, before we overwrite it at
 2213|       |      // the start of the next iteration
 2214|  10.1k|      bool all_none = true;
 2215|  22.1k|      for (int plane = plane_start; plane <= plane_end; ++plane) {
  ------------------
  |  Branch (2215:37): [True: 12.0k, False: 10.1k]
  ------------------
 2216|  12.0k|        cm->rst_info[plane].frame_restoration_type = best_rtype[plane];
 2217|  12.0k|        if (best_rtype[plane] != RESTORE_NONE) {
  ------------------
  |  Branch (2217:13): [True: 794, False: 11.2k]
  ------------------
 2218|    794|          all_none = false;
 2219|    794|          const int plane_num_units = cm->rst_info[plane].num_rest_units;
 2220|  1.67k|          for (int u = 0; u < plane_num_units; ++u) {
  ------------------
  |  Branch (2220:27): [True: 882, False: 794]
  ------------------
 2221|    882|            copy_unit_info(best_rtype[plane], &cpi->pick_lr_ctxt.rusi[plane][u],
 2222|    882|                           &cm->rst_info[plane].unit_info[u]);
 2223|    882|          }
 2224|    794|        }
 2225|  12.0k|      }
 2226|       |      // Heuristic: If all best_rtype entries are RESTORE_NONE, this means we
 2227|       |      // couldn't find any good filters at this size. So we likely won't find
 2228|       |      // any good filters at a smaller size either, so skip
 2229|  10.1k|      if (all_none) {
  ------------------
  |  Branch (2229:11): [True: 9.42k, False: 739]
  ------------------
 2230|  9.42k|        break;
 2231|  9.42k|      }
 2232|  10.1k|    } else {
 2233|       |      // Heuristic: If this size is worse than the previous (larger) size, then
 2234|       |      // the next size down will likely be even worse, so skip
 2235|      0|      break;
 2236|      0|    }
 2237|  10.1k|  }
 2238|       |
 2239|       |  // Final fixup to set the correct unit size
 2240|       |  // We set this for all planes, even ones we have skipped searching,
 2241|       |  // so that other code does not need to care which planes were and weren't
 2242|       |  // searched
 2243|  27.7k|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (2243:23): [True: 17.6k, False: 10.1k]
  ------------------
 2244|  17.6k|    set_restoration_unit_size(cm, &cm->rst_info[plane], plane > 0,
 2245|  17.6k|                              best_luma_unit_size);
 2246|  17.6k|  }
 2247|       |
 2248|  10.1k|#if HAVE_AVX2 || HAVE_NEON || HAVE_SVE
 2249|  10.1k|#if HAVE_AVX2
 2250|  10.1k|  bool free_buffers = !cpi->sf.lpf_sf.disable_wiener_filter && !highbd;
  ------------------
  |  Branch (2250:23): [True: 10.1k, False: 0]
  |  Branch (2250:64): [True: 8.10k, False: 2.05k]
  ------------------
 2251|       |#elif HAVE_NEON || HAVE_SVE
 2252|       |  bool free_buffers = !cpi->sf.lpf_sf.disable_wiener_filter;
 2253|       |#endif
 2254|  10.1k|  if (free_buffers) {
  ------------------
  |  Branch (2254:7): [True: 8.10k, False: 2.05k]
  ------------------
 2255|  8.10k|    aom_free(cpi->pick_lr_ctxt.dgd_avg);
 2256|  8.10k|    cpi->pick_lr_ctxt.dgd_avg = NULL;
 2257|  8.10k|  }
 2258|  10.1k|#endif
 2259|  27.7k|  for (int plane = 0; plane < num_planes; plane++) {
  ------------------
  |  Branch (2259:23): [True: 17.6k, False: 10.1k]
  ------------------
 2260|  17.6k|    aom_free(cpi->pick_lr_ctxt.rusi[plane]);
 2261|       |    cpi->pick_lr_ctxt.rusi[plane] = NULL;
 2262|  17.6k|  }
 2263|  10.1k|}
pickrst.c:calc_proj_params_r0_r1_c:
  480|  1.26k|                                            int64_t H[2][2], int64_t C[2]) {
  481|  1.26k|  const int size = width * height;
  482|  1.26k|  const uint8_t *src = src8;
  483|  1.26k|  const uint8_t *dat = dat8;
  484|  85.3k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (484:19): [True: 84.1k, False: 1.26k]
  ------------------
  485|  8.94M|    for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (485:21): [True: 8.85M, False: 84.1k]
  ------------------
  486|  8.85M|      const int32_t u = (int32_t)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  8.85M|#define SGRPROJ_RST_BITS 4
  ------------------
  487|  8.85M|      const int32_t s =
  488|  8.85M|          (int32_t)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
  ------------------
  |  |  101|  8.85M|#define SGRPROJ_RST_BITS 4
  ------------------
  489|  8.85M|      const int32_t f1 = (int32_t)flt0[i * flt0_stride + j] - u;
  490|  8.85M|      const int32_t f2 = (int32_t)flt1[i * flt1_stride + j] - u;
  491|  8.85M|      H[0][0] += (int64_t)f1 * f1;
  492|  8.85M|      H[1][1] += (int64_t)f2 * f2;
  493|  8.85M|      H[0][1] += (int64_t)f1 * f2;
  494|  8.85M|      C[0] += (int64_t)f1 * s;
  495|  8.85M|      C[1] += (int64_t)f2 * s;
  496|  8.85M|    }
  497|  84.1k|  }
  498|  1.26k|  H[0][0] /= size;
  499|  1.26k|  H[0][1] /= size;
  500|  1.26k|  H[1][1] /= size;
  501|  1.26k|  H[1][0] = H[0][1];
  502|  1.26k|  C[0] /= size;
  503|  1.26k|  C[1] /= size;
  504|  1.26k|}
pickrst.c:calc_proj_params_r0_r1_high_bd_c:
  510|  1.18k|    int32_t *flt1, int flt1_stride, int64_t H[2][2], int64_t C[2]) {
  511|  1.18k|  const int size = width * height;
  512|  1.18k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  1.18k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  513|  1.18k|  const uint16_t *dat = CONVERT_TO_SHORTPTR(dat8);
  ------------------
  |  |   79|  1.18k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  514|  25.1k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (514:19): [True: 23.9k, False: 1.18k]
  ------------------
  515|   547k|    for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (515:21): [True: 523k, False: 23.9k]
  ------------------
  516|   523k|      const int32_t u = (int32_t)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   523k|#define SGRPROJ_RST_BITS 4
  ------------------
  517|   523k|      const int32_t s =
  518|   523k|          (int32_t)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
  ------------------
  |  |  101|   523k|#define SGRPROJ_RST_BITS 4
  ------------------
  519|   523k|      const int32_t f1 = (int32_t)flt0[i * flt0_stride + j] - u;
  520|   523k|      const int32_t f2 = (int32_t)flt1[i * flt1_stride + j] - u;
  521|   523k|      H[0][0] += (int64_t)f1 * f1;
  522|   523k|      H[1][1] += (int64_t)f2 * f2;
  523|   523k|      H[0][1] += (int64_t)f1 * f2;
  524|   523k|      C[0] += (int64_t)f1 * s;
  525|   523k|      C[1] += (int64_t)f2 * s;
  526|   523k|    }
  527|  23.9k|  }
  528|  1.18k|  H[0][0] /= size;
  529|  1.18k|  H[0][1] /= size;
  530|  1.18k|  H[1][1] /= size;
  531|  1.18k|  H[1][0] = H[0][1];
  532|  1.18k|  C[0] /= size;
  533|  1.18k|  C[1] /= size;
  534|  1.18k|}
pickrst.c:allocate_search_structs:
 1985|  17.6k|                                                   int min_luma_unit_size) {
 1986|       |#if COUPLED_CHROMA_FROM_LUMA_RESTORATION
 1987|       |  int sx = cm->seq_params.subsampling_x;
 1988|       |  int sy = cm->seq_params.subsampling_y;
 1989|       |  int s = (p > 0) ? AOMMIN(sx, sy) : 0;
 1990|       |#else
 1991|  17.6k|  int s = 0;
 1992|  17.6k|#endif  // !COUPLED_CHROMA_FROM_LUMA_RESTORATION
 1993|  17.6k|  int min_unit_size = min_luma_unit_size >> s;
 1994|       |
 1995|  17.6k|  int plane_w, plane_h;
 1996|  17.6k|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 1997|       |
 1998|  17.6k|  const int max_horz_units = av1_lr_count_units(min_unit_size, plane_w);
 1999|  17.6k|  const int max_vert_units = av1_lr_count_units(min_unit_size, plane_h);
 2000|  17.6k|  const int max_num_units = max_horz_units * max_vert_units;
 2001|       |
 2002|  17.6k|  aom_free(rsi->unit_info);
 2003|  17.6k|  CHECK_MEM_ERROR(cm, rsi->unit_info,
  ------------------
  |  |   51|  17.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  17.6k|  do {                                                    \
  |  |  |  |   72|  17.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  17.6k|    lval = (expr);                                        \
  |  |  |  |   74|  17.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  17.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  17.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2004|  17.6k|                  (RestorationUnitInfo *)aom_memalign(
 2005|  17.6k|                      16, sizeof(*rsi->unit_info) * max_num_units));
 2006|       |
 2007|  17.6k|  RestUnitSearchInfo *rusi;
 2008|  17.6k|  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  17.6k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  17.6k|  do {                                                    \
  |  |  |  |   72|  17.6k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  17.6k|    lval = (expr);                                        \
  |  |  |  |   74|  17.6k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 17.6k]
  |  |  |  |  ------------------
  |  |  |  |   75|  17.6k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  17.6k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2009|  17.6k|      cm, rusi,
 2010|  17.6k|      (RestUnitSearchInfo *)aom_memalign(16, sizeof(*rusi) * max_num_units));
 2011|       |
 2012|       |  // If the restoration unit dimensions are not multiples of
 2013|       |  // rsi->restoration_unit_size then some elements of the rusi array may be
 2014|       |  // left uninitialised when we reach copy_unit_info(...). This is not a
 2015|       |  // problem, as these elements are ignored later, but in order to quiet
 2016|       |  // Valgrind's warnings we initialise the array below.
 2017|  17.6k|  memset(rusi, 0, sizeof(*rusi) * max_num_units);
 2018|       |
 2019|  17.6k|  return rusi;
 2020|  17.6k|}
pickrst.c:av1_derive_flags_for_lr_processing:
 1960|  10.1k|    const LOOP_FILTER_SPEED_FEATURES *lpf_sf, bool *disable_lr_filter) {
 1961|  10.1k|  const bool is_wiener_disabled = lpf_sf->disable_wiener_filter;
 1962|  10.1k|  const bool is_sgr_disabled = lpf_sf->disable_sgr_filter;
 1963|       |
 1964|       |  // Enable None Loop restoration filter if either of Wiener or Self-guided is
 1965|       |  // enabled.
 1966|  10.1k|  disable_lr_filter[RESTORE_NONE] = (is_wiener_disabled && is_sgr_disabled);
  ------------------
  |  Branch (1966:38): [True: 0, False: 10.1k]
  |  Branch (1966:60): [True: 0, False: 0]
  ------------------
 1967|       |
 1968|  10.1k|  disable_lr_filter[RESTORE_WIENER] = is_wiener_disabled;
 1969|  10.1k|  disable_lr_filter[RESTORE_SGRPROJ] = is_sgr_disabled;
 1970|       |
 1971|       |  // Enable Swicthable Loop restoration filter if both of the Wiener and
 1972|       |  // Self-guided are enabled.
 1973|  10.1k|  disable_lr_filter[RESTORE_SWITCHABLE] =
 1974|  10.1k|      (is_wiener_disabled || is_sgr_disabled);
  ------------------
  |  Branch (1974:8): [True: 0, False: 10.1k]
  |  Branch (1974:30): [True: 5.54k, False: 4.61k]
  ------------------
 1975|  10.1k|}
pickrst.c:set_restoration_unit_size:
 2023|  29.6k|                                      int is_uv, int luma_unit_size) {
 2024|       |#if COUPLED_CHROMA_FROM_LUMA_RESTORATION
 2025|       |  int sx = cm->seq_params.subsampling_x;
 2026|       |  int sy = cm->seq_params.subsampling_y;
 2027|       |  int s = (p > 0) ? AOMMIN(sx, sy) : 0;
 2028|       |#else
 2029|  29.6k|  int s = 0;
 2030|  29.6k|#endif  // !COUPLED_CHROMA_FROM_LUMA_RESTORATION
 2031|  29.6k|  int unit_size = luma_unit_size >> s;
 2032|       |
 2033|  29.6k|  int plane_w, plane_h;
 2034|  29.6k|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 2035|       |
 2036|  29.6k|  const int horz_units = av1_lr_count_units(unit_size, plane_w);
 2037|  29.6k|  const int vert_units = av1_lr_count_units(unit_size, plane_h);
 2038|       |
 2039|  29.6k|  rsi->restoration_unit_size = unit_size;
 2040|  29.6k|  rsi->num_rest_units = horz_units * vert_units;
 2041|  29.6k|  rsi->horz_units = horz_units;
 2042|  29.6k|  rsi->vert_units = vert_units;
 2043|  29.6k|}
pickrst.c:init_rsc:
  179|  12.0k|                            RestSearchCtxt *rsc) {
  180|  12.0k|  rsc->src = src;
  181|  12.0k|  rsc->dst = dst;
  182|  12.0k|  rsc->cm = cm;
  183|  12.0k|  rsc->x = x;
  184|  12.0k|  rsc->plane = plane;
  185|  12.0k|  rsc->rusi = rusi;
  186|  12.0k|  rsc->lpf_sf = lpf_sf;
  187|       |
  188|  12.0k|  const YV12_BUFFER_CONFIG *dgd = &cm->cur_frame->buf;
  189|  12.0k|  const int is_uv = plane != AOM_PLANE_Y;
  ------------------
  |  |  281|  12.0k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  190|  12.0k|  int plane_w, plane_h;
  191|  12.0k|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
  192|  12.0k|  assert(plane_w == src->crop_widths[is_uv]);
  193|  12.0k|  assert(plane_h == src->crop_heights[is_uv]);
  194|  12.0k|  assert(src->crop_widths[is_uv] == dgd->crop_widths[is_uv]);
  195|  12.0k|  assert(src->crop_heights[is_uv] == dgd->crop_heights[is_uv]);
  196|       |
  197|  12.0k|  rsc->plane_w = plane_w;
  198|  12.0k|  rsc->plane_h = plane_h;
  199|  12.0k|  rsc->src_buffer = src->buffers[plane];
  200|  12.0k|  rsc->src_stride = src->strides[is_uv];
  201|  12.0k|  rsc->dgd_buffer = dgd->buffers[plane];
  202|  12.0k|  rsc->dgd_stride = dgd->strides[is_uv];
  203|  12.0k|}
pickrst.c:restoration_search:
 1868|  12.0k|                               bool *disable_lr_filter) {
 1869|  12.0k|  const BLOCK_SIZE sb_size = cm->seq_params->sb_size;
 1870|  12.0k|  const int mib_size_log2 = cm->seq_params->mib_size_log2;
 1871|  12.0k|  const CommonTileParams *tiles = &cm->tiles;
 1872|  12.0k|  const int is_uv = plane > 0;
 1873|  12.0k|  const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (1873:20): [True: 1.86k, False: 10.1k]
  |  Branch (1873:29): [True: 866, False: 1.00k]
  ------------------
 1874|  12.0k|  RestorationInfo *rsi = &cm->rst_info[plane];
 1875|  12.0k|  const int ru_size = rsi->restoration_unit_size;
 1876|  12.0k|  const int ext_size = ru_size * 3 / 2;
 1877|       |
 1878|  12.0k|  int plane_w, plane_h;
 1879|  12.0k|  av1_get_upsampled_plane_size(cm, is_uv, &plane_w, &plane_h);
 1880|       |
 1881|  12.0k|  static const rest_unit_visitor_t funs[RESTORE_TYPES] = {
 1882|  12.0k|    search_norestore, search_wiener, search_sgrproj, search_switchable
 1883|  12.0k|  };
 1884|       |
 1885|  12.0k|  const int plane_num_units = rsi->num_rest_units;
 1886|  12.0k|  const RestorationType num_rtypes =
 1887|  12.0k|      (plane_num_units > 1) ? RESTORE_TYPES : RESTORE_SWITCHABLE_TYPES;
  ------------------
  |  Branch (1887:7): [True: 176, False: 11.8k]
  ------------------
 1888|       |
 1889|  12.0k|  reset_rsc(rsc);
 1890|       |
 1891|       |  // Iterate over restoration units in encoding order, so that each RU gets
 1892|       |  // the correct reference parameters when we cost it up. This is effectively
 1893|       |  // a nested iteration over:
 1894|       |  // * Each tile, order does not matter
 1895|       |  //   * Each superblock within that tile, in raster order
 1896|       |  //     * Each LR unit which is coded within that superblock, in raster order
 1897|  25.6k|  for (int tile_row = 0; tile_row < tiles->rows; tile_row++) {
  ------------------
  |  Branch (1897:26): [True: 13.5k, False: 12.0k]
  ------------------
 1898|  13.5k|    int sb_row_start = tiles->row_start_sb[tile_row];
 1899|  13.5k|    int sb_row_end = tiles->row_start_sb[tile_row + 1];
 1900|  29.0k|    for (int tile_col = 0; tile_col < tiles->cols; tile_col++) {
  ------------------
  |  Branch (1900:28): [True: 15.5k, False: 13.5k]
  ------------------
 1901|  15.5k|      int sb_col_start = tiles->col_start_sb[tile_col];
 1902|  15.5k|      int sb_col_end = tiles->col_start_sb[tile_col + 1];
 1903|       |
 1904|       |      // Reset reference parameters for delta-coding at the start of each tile
 1905|  15.5k|      rsc_on_tile(rsc);
 1906|       |
 1907|  31.6k|      for (int sb_row = sb_row_start; sb_row < sb_row_end; sb_row++) {
  ------------------
  |  Branch (1907:39): [True: 16.1k, False: 15.5k]
  ------------------
 1908|  16.1k|        int mi_row = sb_row << mib_size_log2;
 1909|  33.7k|        for (int sb_col = sb_col_start; sb_col < sb_col_end; sb_col++) {
  ------------------
  |  Branch (1909:41): [True: 17.6k, False: 16.1k]
  ------------------
 1910|  17.6k|          int mi_col = sb_col << mib_size_log2;
 1911|       |
 1912|  17.6k|          int rcol0, rcol1, rrow0, rrow1;
 1913|  17.6k|          int has_lr_info = av1_loop_restoration_corners_in_sb(
 1914|  17.6k|              cm, plane, mi_row, mi_col, sb_size, &rcol0, &rcol1, &rrow0,
 1915|  17.6k|              &rrow1);
 1916|       |
 1917|  17.6k|          if (!has_lr_info) continue;
  ------------------
  |  Branch (1917:15): [True: 5.37k, False: 12.2k]
  ------------------
 1918|       |
 1919|  12.2k|          RestorationTileLimits limits;
 1920|  24.4k|          for (int rrow = rrow0; rrow < rrow1; rrow++) {
  ------------------
  |  Branch (1920:34): [True: 12.2k, False: 12.2k]
  ------------------
 1921|  12.2k|            int y0 = rrow * ru_size;
 1922|  12.2k|            int remaining_h = plane_h - y0;
 1923|  12.2k|            int h = (remaining_h < ext_size) ? remaining_h : ru_size;
  ------------------
  |  Branch (1923:21): [True: 12.1k, False: 135]
  ------------------
 1924|       |
 1925|  12.2k|            limits.v_start = y0;
 1926|  12.2k|            limits.v_end = y0 + h;
 1927|  12.2k|            assert(limits.v_end <= plane_h);
 1928|       |            // Offset upwards to align with the restoration processing stripe
 1929|  12.2k|            const int voffset = RESTORATION_UNIT_OFFSET >> ss_y;
  ------------------
  |  |   37|  12.2k|#define RESTORATION_UNIT_OFFSET 8
  ------------------
 1930|  12.2k|            limits.v_start = AOMMAX(0, limits.v_start - voffset);
  ------------------
  |  |   35|  12.2k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 12.1k, False: 135]
  |  |  ------------------
  ------------------
 1931|  12.2k|            if (limits.v_end < plane_h) limits.v_end -= voffset;
  ------------------
  |  Branch (1931:17): [True: 135, False: 12.1k]
  ------------------
 1932|       |
 1933|  24.4k|            for (int rcol = rcol0; rcol < rcol1; rcol++) {
  ------------------
  |  Branch (1933:36): [True: 12.2k, False: 12.2k]
  ------------------
 1934|  12.2k|              int x0 = rcol * ru_size;
 1935|  12.2k|              int remaining_w = plane_w - x0;
 1936|  12.2k|              int w = (remaining_w < ext_size) ? remaining_w : ru_size;
  ------------------
  |  Branch (1936:23): [True: 12.1k, False: 107]
  ------------------
 1937|       |
 1938|  12.2k|              limits.h_start = x0;
 1939|  12.2k|              limits.h_end = x0 + w;
 1940|  12.2k|              assert(limits.h_end <= plane_w);
 1941|       |
 1942|  12.2k|              const int unit_idx = rrow * rsi->horz_units + rcol;
 1943|       |
 1944|  12.2k|              rsc->skip_sgr_eval = 0;
 1945|  49.3k|              for (RestorationType r = RESTORE_NONE; r < num_rtypes; r++) {
  ------------------
  |  Branch (1945:54): [True: 37.1k, False: 12.2k]
  ------------------
 1946|  37.1k|                if (disable_lr_filter[r]) continue;
  ------------------
  |  Branch (1946:21): [True: 6.10k, False: 31.0k]
  ------------------
 1947|       |
 1948|  31.0k|                funs[r](&limits, unit_idx, rsc, rsc->cm->rst_tmpbuf, NULL,
 1949|  31.0k|                        cm->error);
 1950|  31.0k|              }
 1951|  12.2k|            }
 1952|  12.2k|          }
 1953|  12.2k|        }
 1954|  16.1k|      }
 1955|  15.5k|    }
 1956|  13.5k|  }
 1957|  12.0k|}
pickrst.c:search_norestore:
 1757|  12.2k|    struct aom_internal_error_info *error_info) {
 1758|  12.2k|  (void)rest_unit_idx;
 1759|  12.2k|  (void)tmpbuf;
 1760|  12.2k|  (void)rlbs;
 1761|  12.2k|  (void)error_info;
 1762|       |
 1763|  12.2k|  RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
 1764|       |
 1765|  12.2k|  const int highbd = rsc->cm->seq_params->use_highbitdepth;
 1766|  12.2k|  rsc->sse[RESTORE_NONE] = sse_restoration_unit(
 1767|  12.2k|      limits, rsc->src, &rsc->cm->cur_frame->buf, rsc->plane, highbd);
 1768|       |
 1769|  12.2k|  rsc->total_sse[RESTORE_NONE] += rsc->sse[RESTORE_NONE];
 1770|  12.2k|}
pickrst.c:sse_restoration_unit:
   96|  19.7k|                                    int highbd) {
   97|  19.7k|  return sse_part_extractors[3 * highbd + plane](
   98|  19.7k|      src, dst, limits->h_start, limits->h_end - limits->h_start,
   99|  19.7k|      limits->v_start, limits->v_end - limits->v_start);
  100|  19.7k|}
pickrst.c:search_wiener:
 1611|  12.2k|                                 struct aom_internal_error_info *error_info) {
 1612|  12.2k|  (void)tmpbuf;
 1613|  12.2k|  (void)rlbs;
 1614|  12.2k|  (void)error_info;
 1615|  12.2k|  RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
 1616|  12.2k|  RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx];
 1617|       |
 1618|  12.2k|  const MACROBLOCK *const x = rsc->x;
 1619|  12.2k|  const int64_t bits_none = x->mode_costs.wiener_restore_cost[0];
 1620|       |
 1621|       |  // Skip Wiener search for low variance contents
 1622|  12.2k|  if (rsc->lpf_sf->prune_wiener_based_on_src_var) {
  ------------------
  |  Branch (1622:7): [True: 12.2k, False: 0]
  ------------------
 1623|  12.2k|    const int scale[3] = { 0, 1, 2 };
 1624|       |    // Obtain the normalized Qscale
 1625|  12.2k|    const int qs = av1_dc_quant_QTX(rsc->cm->quant_params.base_qindex, 0,
 1626|  12.2k|                                    rsc->cm->seq_params->bit_depth) >>
 1627|  12.2k|                   3;
 1628|       |    // Derive threshold as sqr(normalized Qscale) * scale / 16,
 1629|  12.2k|    const uint64_t thresh =
 1630|  12.2k|        (qs * qs * scale[rsc->lpf_sf->prune_wiener_based_on_src_var]) >> 4;
 1631|  12.2k|    const int highbd = rsc->cm->seq_params->use_highbitdepth;
 1632|  12.2k|    const uint64_t src_var =
 1633|  12.2k|        var_restoration_unit(limits, rsc->src, rsc->plane, highbd);
 1634|       |    // Do not perform Wiener search if source variance is lower than threshold
 1635|       |    // or if the reconstruction error is zero
 1636|  12.2k|    int prune_wiener = (src_var < thresh) || (rsc->sse[RESTORE_NONE] == 0);
  ------------------
  |  Branch (1636:24): [True: 2.55k, False: 9.68k]
  |  Branch (1636:46): [True: 141, False: 9.54k]
  ------------------
 1637|  12.2k|    if (prune_wiener) {
  ------------------
  |  Branch (1637:9): [True: 2.69k, False: 9.54k]
  ------------------
 1638|  2.69k|      rsc->total_bits[RESTORE_WIENER] += bits_none;
 1639|  2.69k|      rsc->total_sse[RESTORE_WIENER] += rsc->sse[RESTORE_NONE];
 1640|  2.69k|      rusi->best_rtype[RESTORE_WIENER - 1] = RESTORE_NONE;
 1641|  2.69k|      rsc->sse[RESTORE_WIENER] = INT64_MAX;
 1642|  2.69k|      if (rsc->lpf_sf->prune_sgr_based_on_wiener == 2) rsc->skip_sgr_eval = 1;
  ------------------
  |  Branch (1642:11): [True: 2.60k, False: 90]
  ------------------
 1643|  2.69k|      return;
 1644|  2.69k|    }
 1645|  12.2k|  }
 1646|       |
 1647|  9.54k|  const int wiener_win =
 1648|  9.54k|      (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  281|  9.54k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                    (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  121|  8.39k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  8.39k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
                    (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  128|  1.15k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  1.15k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.15k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1648:7): [True: 8.39k, False: 1.15k]
  ------------------
 1649|       |
 1650|  9.54k|  int reduced_wiener_win = wiener_win;
 1651|  9.54k|  if (rsc->lpf_sf->reduce_wiener_window_size) {
  ------------------
  |  Branch (1651:7): [True: 9.54k, False: 0]
  ------------------
 1652|  9.54k|    reduced_wiener_win =
 1653|  9.54k|        (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN_REDUCED : WIENER_WIN_CHROMA;
  ------------------
  |  |  281|  9.54k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                      (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN_REDUCED : WIENER_WIN_CHROMA;
  ------------------
  |  |  129|  8.39k|#define WIENER_WIN_REDUCED (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  8.39k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  8.39k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN_REDUCED : WIENER_WIN_CHROMA;
  ------------------
  |  |  128|  10.7k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  1.15k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.15k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1653:9): [True: 8.39k, False: 1.15k]
  ------------------
 1654|  9.54k|  }
 1655|       |
 1656|  9.54k|  int64_t M[WIENER_WIN2];
 1657|  9.54k|  int64_t H[WIENER_WIN2 * WIENER_WIN2];
 1658|  9.54k|  int32_t vfilter[WIENER_WIN], hfilter[WIENER_WIN];
 1659|       |
 1660|  9.54k|#if CONFIG_AV1_HIGHBITDEPTH
 1661|  9.54k|  const AV1_COMMON *const cm = rsc->cm;
 1662|  9.54k|  if (cm->seq_params->use_highbitdepth) {
  ------------------
  |  Branch (1662:7): [True: 2.04k, False: 7.50k]
  ------------------
 1663|       |    // TODO(any) : Add support for use_downsampled_wiener_stats SF in HBD
 1664|       |    // functions. Optimize intrinsics of HBD design similar to LBD (i.e.,
 1665|       |    // pre-calculate d and s buffers and avoid most of the C operations).
 1666|  2.04k|    av1_compute_stats_highbd(reduced_wiener_win, rsc->dgd_buffer,
 1667|  2.04k|                             rsc->src_buffer, rsc->dgd_avg, rsc->src_avg,
 1668|  2.04k|                             limits->h_start, limits->h_end, limits->v_start,
 1669|  2.04k|                             limits->v_end, rsc->dgd_stride, rsc->src_stride, M,
 1670|  2.04k|                             H, cm->seq_params->bit_depth);
 1671|  7.50k|  } else {
 1672|  7.50k|    av1_compute_stats(reduced_wiener_win, rsc->dgd_buffer, rsc->src_buffer,
 1673|  7.50k|                      rsc->dgd_avg, rsc->src_avg, limits->h_start,
 1674|  7.50k|                      limits->h_end, limits->v_start, limits->v_end,
 1675|  7.50k|                      rsc->dgd_stride, rsc->src_stride, M, H,
 1676|  7.50k|                      rsc->lpf_sf->use_downsampled_wiener_stats);
 1677|  7.50k|  }
 1678|       |#else
 1679|       |  av1_compute_stats(reduced_wiener_win, rsc->dgd_buffer, rsc->src_buffer,
 1680|       |                    rsc->dgd_avg, rsc->src_avg, limits->h_start, limits->h_end,
 1681|       |                    limits->v_start, limits->v_end, rsc->dgd_stride,
 1682|       |                    rsc->src_stride, M, H,
 1683|       |                    rsc->lpf_sf->use_downsampled_wiener_stats);
 1684|       |#endif
 1685|       |
 1686|  9.54k|  wiener_decompose_sep_sym(reduced_wiener_win, M, H, vfilter, hfilter);
 1687|       |
 1688|  9.54k|  RestorationUnitInfo rui;
 1689|  9.54k|  memset(&rui, 0, sizeof(rui));
 1690|  9.54k|  rui.restoration_type = RESTORE_WIENER;
 1691|  9.54k|  finalize_sym_filter(reduced_wiener_win, vfilter, rui.wiener_info.vfilter);
 1692|  9.54k|  finalize_sym_filter(reduced_wiener_win, hfilter, rui.wiener_info.hfilter);
 1693|       |
 1694|       |  // Filter score computes the value of the function x'*A*x - x'*b for the
 1695|       |  // learned filter and compares it against identity filer. If there is no
 1696|       |  // reduction in the function, the filter is reverted back to identity
 1697|  9.54k|  if (compute_score(reduced_wiener_win, M, H, rui.wiener_info.vfilter,
  ------------------
  |  Branch (1697:7): [True: 2.81k, False: 6.73k]
  ------------------
 1698|  9.54k|                    rui.wiener_info.hfilter) > 0) {
 1699|  2.81k|    rsc->total_bits[RESTORE_WIENER] += bits_none;
 1700|  2.81k|    rsc->total_sse[RESTORE_WIENER] += rsc->sse[RESTORE_NONE];
 1701|  2.81k|    rusi->best_rtype[RESTORE_WIENER - 1] = RESTORE_NONE;
 1702|  2.81k|    rsc->sse[RESTORE_WIENER] = INT64_MAX;
 1703|  2.81k|    if (rsc->lpf_sf->prune_sgr_based_on_wiener == 2) rsc->skip_sgr_eval = 1;
  ------------------
  |  Branch (1703:9): [True: 2.64k, False: 165]
  ------------------
 1704|  2.81k|    return;
 1705|  2.81k|  }
 1706|       |
 1707|  6.73k|  rsc->sse[RESTORE_WIENER] =
 1708|  6.73k|      finer_search_wiener(rsc, limits, &rui, reduced_wiener_win);
 1709|  6.73k|  rusi->wiener = rui.wiener_info;
 1710|       |
 1711|  6.73k|  if (reduced_wiener_win != WIENER_WIN) {
  ------------------
  |  |  121|  6.73k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  6.73k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1711:7): [True: 6.73k, False: 0]
  ------------------
 1712|  6.73k|    assert(rui.wiener_info.vfilter[0] == 0 &&
 1713|  6.73k|           rui.wiener_info.vfilter[WIENER_WIN - 1] == 0);
 1714|  6.73k|    assert(rui.wiener_info.hfilter[0] == 0 &&
 1715|  6.73k|           rui.wiener_info.hfilter[WIENER_WIN - 1] == 0);
 1716|  6.73k|  }
 1717|       |
 1718|  6.73k|  const int64_t bits_wiener =
 1719|  6.73k|      x->mode_costs.wiener_restore_cost[1] +
 1720|  6.73k|      (count_wiener_bits(wiener_win, &rusi->wiener, &rsc->ref_wiener)
 1721|  6.73k|       << AV1_PROB_COST_SHIFT);
  ------------------
  |  |   25|  6.73k|#define AV1_PROB_COST_SHIFT 9
  ------------------
 1722|       |
 1723|  6.73k|  double cost_none = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|  6.73k|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|  6.73k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|  6.73k|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  6.73k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1724|  6.73k|      x->rdmult, bits_none >> 4, rsc->sse[RESTORE_NONE],
 1725|  6.73k|      rsc->cm->seq_params->bit_depth);
 1726|  6.73k|  double cost_wiener = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|  6.73k|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|  6.73k|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|  6.73k|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  6.73k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1727|  6.73k|      x->rdmult, bits_wiener >> 4, rsc->sse[RESTORE_WIENER],
 1728|  6.73k|      rsc->cm->seq_params->bit_depth);
 1729|       |
 1730|  6.73k|  RestorationType rtype =
 1731|  6.73k|      (cost_wiener < cost_none) ? RESTORE_WIENER : RESTORE_NONE;
  ------------------
  |  Branch (1731:7): [True: 844, False: 5.89k]
  ------------------
 1732|  6.73k|  rusi->best_rtype[RESTORE_WIENER - 1] = rtype;
 1733|       |
 1734|       |  // Set 'skip_sgr_eval' based on rdcost ratio of RESTORE_WIENER and
 1735|       |  // RESTORE_NONE or based on best_rtype
 1736|  6.73k|  if (rsc->lpf_sf->prune_sgr_based_on_wiener == 1) {
  ------------------
  |  Branch (1736:7): [True: 223, False: 6.51k]
  ------------------
 1737|    223|    rsc->skip_sgr_eval = cost_wiener > (1.01 * cost_none);
 1738|  6.51k|  } else if (rsc->lpf_sf->prune_sgr_based_on_wiener == 2) {
  ------------------
  |  Branch (1738:14): [True: 6.51k, False: 0]
  ------------------
 1739|  6.51k|    rsc->skip_sgr_eval = rusi->best_rtype[RESTORE_WIENER - 1] == RESTORE_NONE;
 1740|  6.51k|  }
 1741|       |
 1742|       |#if DEBUG_LR_COSTING
 1743|       |  // Store ref params for later checking
 1744|       |  lr_ref_params[RESTORE_WIENER][rsc->plane][rest_unit_idx].wiener_info =
 1745|       |      rsc->ref_wiener;
 1746|       |#endif  // DEBUG_LR_COSTING
 1747|       |
 1748|  6.73k|  rsc->total_sse[RESTORE_WIENER] += rsc->sse[rtype];
 1749|  6.73k|  rsc->total_bits[RESTORE_WIENER] +=
 1750|  6.73k|      (cost_wiener < cost_none) ? bits_wiener : bits_none;
  ------------------
  |  Branch (1750:7): [True: 844, False: 5.89k]
  ------------------
 1751|  6.73k|  if (cost_wiener < cost_none) rsc->ref_wiener = rusi->wiener;
  ------------------
  |  Branch (1751:7): [True: 844, False: 5.89k]
  ------------------
 1752|  6.73k|}
pickrst.c:var_restoration_unit:
  104|  12.2k|                                     int highbd) {
  105|  12.2k|  return var_part_extractors[3 * highbd + plane](
  106|  12.2k|      src, limits->h_start, limits->h_end - limits->h_start, limits->v_start,
  107|  12.2k|      limits->v_end - limits->v_start);
  108|  12.2k|}
pickrst.c:wiener_decompose_sep_sym:
 1359|  9.54k|                                     int32_t *a, int32_t *b) {
 1360|  9.54k|  static const int32_t init_filt[WIENER_WIN] = {
 1361|  9.54k|    WIENER_FILT_TAP0_MIDV, WIENER_FILT_TAP1_MIDV, WIENER_FILT_TAP2_MIDV,
  ------------------
  |  |  137|  9.54k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
                  WIENER_FILT_TAP0_MIDV, WIENER_FILT_TAP1_MIDV, WIENER_FILT_TAP2_MIDV,
  ------------------
  |  |  138|  9.54k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
                  WIENER_FILT_TAP0_MIDV, WIENER_FILT_TAP1_MIDV, WIENER_FILT_TAP2_MIDV,
  ------------------
  |  |  139|  9.54k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
 1362|  9.54k|    WIENER_FILT_TAP3_MIDV, WIENER_FILT_TAP2_MIDV, WIENER_FILT_TAP1_MIDV,
  ------------------
  |  |  141|  9.54k|  (WIENER_FILT_STEP - 2 * (WIENER_FILT_TAP0_MIDV + WIENER_FILT_TAP1_MIDV + \
  |  |  ------------------
  |  |  |  |  134|  9.54k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  133|  9.54k|#define WIENER_FILT_PREC_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (WIENER_FILT_STEP - 2 * (WIENER_FILT_TAP0_MIDV + WIENER_FILT_TAP1_MIDV + \
  |  |  ------------------
  |  |  |  |  137|  9.54k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_STEP - 2 * (WIENER_FILT_TAP0_MIDV + WIENER_FILT_TAP1_MIDV + \
  |  |  ------------------
  |  |  |  |  138|  9.54k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |  142|  9.54k|                           WIENER_FILT_TAP2_MIDV))
  |  |  ------------------
  |  |  |  |  139|  9.54k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  ------------------
                  WIENER_FILT_TAP3_MIDV, WIENER_FILT_TAP2_MIDV, WIENER_FILT_TAP1_MIDV,
  ------------------
  |  |  139|  9.54k|#define WIENER_FILT_TAP2_MIDV (15)
  ------------------
                  WIENER_FILT_TAP3_MIDV, WIENER_FILT_TAP2_MIDV, WIENER_FILT_TAP1_MIDV,
  ------------------
  |  |  138|  9.54k|#define WIENER_FILT_TAP1_MIDV (-7)
  ------------------
 1363|  9.54k|    WIENER_FILT_TAP0_MIDV,
  ------------------
  |  |  137|  9.54k|#define WIENER_FILT_TAP0_MIDV (3)
  ------------------
 1364|  9.54k|  };
 1365|  9.54k|  int64_t *Hc[WIENER_WIN2];
 1366|  9.54k|  int64_t *Mc[WIENER_WIN];
 1367|  9.54k|  int i, j, iter;
 1368|  9.54k|  const int plane_off = (WIENER_WIN - wiener_win) >> 1;
  ------------------
  |  |  121|  9.54k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  9.54k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1369|  9.54k|  const int wiener_win2 = wiener_win * wiener_win;
 1370|  57.2k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1370:15): [True: 47.7k, False: 9.54k]
  ------------------
 1371|  47.7k|    a[i] = b[i] =
 1372|  47.7k|        WIENER_TAP_SCALE_FACTOR / WIENER_FILT_STEP * init_filt[i + plane_off];
  ------------------
  |  |   45|  47.7k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
                      WIENER_TAP_SCALE_FACTOR / WIENER_FILT_STEP * init_filt[i + plane_off];
  ------------------
  |  |  134|  47.7k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  47.7k|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1373|  47.7k|  }
 1374|  57.2k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1374:15): [True: 47.7k, False: 9.54k]
  ------------------
 1375|  47.7k|    Mc[i] = M + i * wiener_win;
 1376|   286k|    for (j = 0; j < wiener_win; j++) {
  ------------------
  |  Branch (1376:17): [True: 238k, False: 47.7k]
  ------------------
 1377|   238k|      Hc[i * wiener_win + j] =
 1378|   238k|          H + i * wiener_win * wiener_win2 + j * wiener_win;
 1379|   238k|    }
 1380|  47.7k|  }
 1381|       |
 1382|  9.54k|  iter = 1;
 1383|  47.7k|  while (iter < NUM_WIENER_ITERS) {
  ------------------
  |  |   36|  47.7k|#define NUM_WIENER_ITERS 5
  ------------------
  |  Branch (1383:10): [True: 38.1k, False: 9.54k]
  ------------------
 1384|  38.1k|    update_a_sep_sym(wiener_win, Mc, Hc, a, b);
 1385|  38.1k|    update_b_sep_sym(wiener_win, Mc, Hc, a, b);
 1386|  38.1k|    iter++;
 1387|  38.1k|  }
 1388|  9.54k|}
pickrst.c:update_a_sep_sym:
 1220|  38.1k|                                    int32_t *a, const int32_t *b) {
 1221|  38.1k|  int i, j;
 1222|  38.1k|  int64_t S[WIENER_WIN];
 1223|  38.1k|  int64_t A[WIENER_HALFWIN1], B[WIENER_HALFWIN1 * WIENER_HALFWIN1];
 1224|  38.1k|  int32_t b1[WIENER_WIN], b2[WIENER_WIN];
 1225|  38.1k|  const int wiener_win2 = wiener_win * wiener_win;
 1226|  38.1k|  const int wiener_halfwin1 = (wiener_win >> 1) + 1;
 1227|  38.1k|  memset(A, 0, sizeof(A));
 1228|  38.1k|  memset(B, 0, sizeof(B));
 1229|   229k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1229:15): [True: 190k, False: 38.1k]
  ------------------
 1230|  1.14M|    for (j = 0; j < wiener_win; ++j) {
  ------------------
  |  Branch (1230:17): [True: 954k, False: 190k]
  ------------------
 1231|   954k|      const int jj = wrap_index(j, wiener_win);
 1232|   954k|      A[jj] += Mc[i][j] * b[i] / WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|   954k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1233|   954k|    }
 1234|   190k|  }
 1235|  38.1k|  split_wiener_filter_coefficients(wiener_win, b, b1, b2);
 1236|       |
 1237|   229k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1237:15): [True: 190k, False: 38.1k]
  ------------------
 1238|  1.14M|    for (j = 0; j < wiener_win; j++) {
  ------------------
  |  Branch (1238:17): [True: 954k, False: 190k]
  ------------------
 1239|   954k|      int k, l;
 1240|  5.72M|      for (k = 0; k < wiener_win; ++k) {
  ------------------
  |  Branch (1240:19): [True: 4.77M, False: 954k]
  ------------------
 1241|  4.77M|        const int kk = wrap_index(k, wiener_win);
 1242|  28.6M|        for (l = 0; l < wiener_win; ++l) {
  ------------------
  |  Branch (1242:21): [True: 23.8M, False: 4.77M]
  ------------------
 1243|  23.8M|          const int ll = wrap_index(l, wiener_win);
 1244|       |          // Calculate
 1245|       |          // B[ll * wiener_halfwin1 + kk] +=
 1246|       |          //    Hc[j * wiener_win + i][k * wiener_win2 + l] * b[i] /
 1247|       |          //    WIENER_TAP_SCALE_FACTOR * b[j] / WIENER_TAP_SCALE_FACTOR;
 1248|       |          //
 1249|       |          // The last multiplication may overflow, so we combine the last
 1250|       |          // multiplication with the last division.
 1251|  23.8M|          const int64_t x = Hc[j * wiener_win + i][k * wiener_win2 + l] * b[i] /
 1252|  23.8M|                            WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  23.8M|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1253|       |          // b[j] = b1[j] * WIENER_TAP_SCALE_FACTOR + b2[j]
 1254|  23.8M|          B[ll * wiener_halfwin1 + kk] += multiply_and_scale(x, b1[j], b2[j]);
 1255|  23.8M|        }
 1256|  4.77M|      }
 1257|   954k|    }
 1258|   190k|  }
 1259|       |  // Normalization enforcement in the system of equations itself
 1260|   114k|  for (i = 0; i < wiener_halfwin1 - 1; ++i) {
  ------------------
  |  Branch (1260:15): [True: 76.3k, False: 38.1k]
  ------------------
 1261|  76.3k|    A[i] -=
 1262|  76.3k|        A[wiener_halfwin1 - 1] * 2 +
 1263|  76.3k|        B[i * wiener_halfwin1 + wiener_halfwin1 - 1] -
 1264|  76.3k|        2 * B[(wiener_halfwin1 - 1) * wiener_halfwin1 + (wiener_halfwin1 - 1)];
 1265|  76.3k|  }
 1266|   114k|  for (i = 0; i < wiener_halfwin1 - 1; ++i) {
  ------------------
  |  Branch (1266:15): [True: 76.3k, False: 38.1k]
  ------------------
 1267|   229k|    for (j = 0; j < wiener_halfwin1 - 1; ++j) {
  ------------------
  |  Branch (1267:17): [True: 152k, False: 76.3k]
  ------------------
 1268|   152k|      B[i * wiener_halfwin1 + j] -=
 1269|   152k|          2 * (B[i * wiener_halfwin1 + (wiener_halfwin1 - 1)] +
 1270|   152k|               B[(wiener_halfwin1 - 1) * wiener_halfwin1 + j] -
 1271|   152k|               2 * B[(wiener_halfwin1 - 1) * wiener_halfwin1 +
 1272|   152k|                     (wiener_halfwin1 - 1)]);
 1273|   152k|    }
 1274|  76.3k|  }
 1275|  38.1k|  if (linsolve_wiener(wiener_halfwin1 - 1, B, wiener_halfwin1, A, S)) {
  ------------------
  |  Branch (1275:7): [True: 31.7k, False: 6.48k]
  ------------------
 1276|  31.7k|    S[wiener_halfwin1 - 1] = WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  31.7k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1277|  95.1k|    for (i = wiener_halfwin1; i < wiener_win; ++i) {
  ------------------
  |  Branch (1277:31): [True: 63.4k, False: 31.7k]
  ------------------
 1278|  63.4k|      S[i] = S[wiener_win - 1 - i];
 1279|  63.4k|      S[wiener_halfwin1 - 1] -= 2 * S[i];
 1280|  63.4k|    }
 1281|   190k|    for (i = 0; i < wiener_win; ++i) {
  ------------------
  |  Branch (1281:17): [True: 158k, False: 31.7k]
  ------------------
 1282|   158k|      a[i] = (int32_t)CLIP(S[i], -(1 << (WIENER_FILT_BITS - 1)),
  ------------------
  |  |   31|   158k|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 0, False: 158k]
  |  |  |  Branch (31:46): [True: 0, False: 158k]
  |  |  ------------------
  ------------------
 1283|   158k|                           (1 << (WIENER_FILT_BITS - 1)) - 1);
 1284|   158k|    }
 1285|  31.7k|  }
 1286|  38.1k|}
pickrst.c:wrap_index:
 1114|  30.9M|static inline int wrap_index(int i, int wiener_win) {
 1115|  30.9M|  const int wiener_halfwin1 = (wiener_win >> 1) + 1;
 1116|  30.9M|  return (i >= wiener_halfwin1 ? wiener_win - 1 - i : i);
  ------------------
  |  Branch (1116:11): [True: 12.3M, False: 18.5M]
  ------------------
 1117|  30.9M|}
pickrst.c:split_wiener_filter_coefficients:
 1123|  76.3k|                                                    int32_t *w1, int32_t *w2) {
 1124|   458k|  for (int i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1124:19): [True: 381k, False: 76.3k]
  ------------------
 1125|   381k|    w1[i] = w[i] / WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|   381k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1126|   381k|    w2[i] = w[i] - w1[i] * WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|   381k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1127|       |    assert(w[i] == w1[i] * WIENER_TAP_SCALE_FACTOR + w2[i]);
 1128|   381k|  }
 1129|  76.3k|}
pickrst.c:multiply_and_scale:
 1136|  47.7M|static inline int64_t multiply_and_scale(int64_t x, int32_t w1, int32_t w2) {
 1137|       |  // Let y = x * w / WIENER_TAP_SCALE_FACTOR
 1138|       |  //       = x * (w1 * WIENER_TAP_SCALE_FACTOR + w2) / WIENER_TAP_SCALE_FACTOR
 1139|  47.7M|  const int64_t y = x * w1 + x * w2 / WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  47.7M|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1140|  47.7M|  return y;
 1141|  47.7M|}
pickrst.c:linsolve_wiener:
 1146|  76.3k|                           int64_t *x) {
 1147|   147k|  for (int k = 0; k < n - 1; k++) {
  ------------------
  |  Branch (1147:19): [True: 76.3k, False: 71.4k]
  ------------------
 1148|       |    // Partial pivoting: bring the row with the largest pivot to the top
 1149|   152k|    for (int i = n - 1; i > k; i--) {
  ------------------
  |  Branch (1149:25): [True: 76.3k, False: 76.3k]
  ------------------
 1150|       |      // If row i has a better (bigger) pivot than row (i-1), swap them
 1151|  76.3k|      if (llabs(A[(i - 1) * stride + k]) < llabs(A[i * stride + k])) {
  ------------------
  |  Branch (1151:11): [True: 2.23k, False: 74.1k]
  ------------------
 1152|  6.71k|        for (int j = 0; j < n; j++) {
  ------------------
  |  Branch (1152:25): [True: 4.47k, False: 2.23k]
  ------------------
 1153|  4.47k|          const int64_t c = A[i * stride + j];
 1154|  4.47k|          A[i * stride + j] = A[(i - 1) * stride + j];
 1155|  4.47k|          A[(i - 1) * stride + j] = c;
 1156|  4.47k|        }
 1157|  2.23k|        const int64_t c = b[i];
 1158|  2.23k|        b[i] = b[i - 1];
 1159|  2.23k|        b[i - 1] = c;
 1160|  2.23k|      }
 1161|  76.3k|    }
 1162|       |
 1163|       |    // b/278065963: The multiplies
 1164|       |    //   c / 256 * A[k * stride + j] / cd * 256
 1165|       |    // and
 1166|       |    //   c / 256 * b[k] / cd * 256
 1167|       |    // within Gaussian elimination can cause a signed integer overflow.
 1168|       |    //
 1169|       |    // Precision guidance:
 1170|       |    //   scale_threshold: Pick as high as possible.
 1171|       |    // For max_abs_akj >= scale_threshold scenario, use double-precision
 1172|       |    // floating-point numbers.
 1173|  76.3k|    int64_t max_abs_akj = 0;
 1174|   229k|    for (int j = 0; j < n; j++) {
  ------------------
  |  Branch (1174:21): [True: 152k, False: 76.3k]
  ------------------
 1175|   152k|      const int64_t abs_akj = llabs(A[k * stride + j]);
 1176|   152k|      if (abs_akj > max_abs_akj) max_abs_akj = abs_akj;
  ------------------
  |  Branch (1176:11): [True: 73.6k, False: 79.1k]
  ------------------
 1177|   152k|    }
 1178|  76.3k|    const int scale_threshold = 1 << 22;
 1179|       |
 1180|       |    // Forward elimination (convert A to row-echelon form)
 1181|  76.3k|    if (max_abs_akj < scale_threshold) {
  ------------------
  |  Branch (1181:9): [True: 56.6k, False: 19.7k]
  ------------------
 1182|   108k|      for (int i = k; i < n - 1; i++) {
  ------------------
  |  Branch (1182:23): [True: 56.6k, False: 51.7k]
  ------------------
 1183|  56.6k|        if (A[k * stride + k] == 0) return 0;
  ------------------
  |  Branch (1183:13): [True: 4.96k, False: 51.7k]
  ------------------
 1184|  51.7k|        const int64_t c = A[(i + 1) * stride + k];
 1185|  51.7k|        const int64_t cd = A[k * stride + k];
 1186|   155k|        for (int j = 0; j < n; j++) {
  ------------------
  |  Branch (1186:25): [True: 103k, False: 51.7k]
  ------------------
 1187|   103k|          A[(i + 1) * stride + j] -= A[k * stride + j] * c / cd;
 1188|   103k|        }
 1189|  51.7k|        b[i + 1] -= c * b[k] / cd;
 1190|  51.7k|      }
 1191|  56.6k|    } else {
 1192|       |      // Use floating-point arithmetic.
 1193|  39.4k|      for (int i = k; i < n - 1; i++) {
  ------------------
  |  Branch (1193:23): [True: 19.7k, False: 19.7k]
  ------------------
 1194|  19.7k|        if (A[k * stride + k] == 0) return 0;
  ------------------
  |  Branch (1194:13): [True: 0, False: 19.7k]
  ------------------
 1195|  19.7k|        const double c = (double)A[(i + 1) * stride + k];
 1196|  19.7k|        const double cd = (double)A[k * stride + k];
 1197|  59.1k|        for (int j = 0; j < n; j++) {
  ------------------
  |  Branch (1197:25): [True: 39.4k, False: 19.7k]
  ------------------
 1198|  39.4k|          A[(i + 1) * stride + j] -= (int64_t)(A[k * stride + j] * c / cd);
 1199|  39.4k|        }
 1200|  19.7k|        b[i + 1] -= (int64_t)(c * b[k] / cd);
 1201|  19.7k|      }
 1202|  19.7k|    }
 1203|  76.3k|  }
 1204|       |  // Back-substitution
 1205|   203k|  for (int i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (1205:23): [True: 137k, False: 66.0k]
  ------------------
 1206|   137k|    if (A[i * stride + i] == 0) return 0;
  ------------------
  |  Branch (1206:9): [True: 5.39k, False: 132k]
  ------------------
 1207|   132k|    int64_t c = 0;
 1208|   198k|    for (int j = i + 1; j <= n - 1; j++) {
  ------------------
  |  Branch (1208:25): [True: 66.0k, False: 132k]
  ------------------
 1209|  66.0k|      c += A[i * stride + j] * x[j] / WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  66.0k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1210|  66.0k|    }
 1211|       |    // Store filter taps x in scaled form.
 1212|   132k|    x[i] = WIENER_TAP_SCALE_FACTOR * (b[i] - c) / A[i * stride + i];
  ------------------
  |  |   45|   132k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1213|   132k|  }
 1214|       |
 1215|  66.0k|  return 1;
 1216|  71.4k|}
pickrst.c:update_b_sep_sym:
 1290|  38.1k|                                    const int32_t *a, int32_t *b) {
 1291|  38.1k|  int i, j;
 1292|  38.1k|  int64_t S[WIENER_WIN];
 1293|  38.1k|  int64_t A[WIENER_HALFWIN1], B[WIENER_HALFWIN1 * WIENER_HALFWIN1];
 1294|  38.1k|  int32_t a1[WIENER_WIN], a2[WIENER_WIN];
 1295|  38.1k|  const int wiener_win2 = wiener_win * wiener_win;
 1296|  38.1k|  const int wiener_halfwin1 = (wiener_win >> 1) + 1;
 1297|  38.1k|  memset(A, 0, sizeof(A));
 1298|  38.1k|  memset(B, 0, sizeof(B));
 1299|   229k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1299:15): [True: 190k, False: 38.1k]
  ------------------
 1300|   190k|    const int ii = wrap_index(i, wiener_win);
 1301|  1.14M|    for (j = 0; j < wiener_win; j++) {
  ------------------
  |  Branch (1301:17): [True: 954k, False: 190k]
  ------------------
 1302|   954k|      A[ii] += Mc[i][j] * a[j] / WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|   954k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1303|   954k|    }
 1304|   190k|  }
 1305|  38.1k|  split_wiener_filter_coefficients(wiener_win, a, a1, a2);
 1306|       |
 1307|   229k|  for (i = 0; i < wiener_win; i++) {
  ------------------
  |  Branch (1307:15): [True: 190k, False: 38.1k]
  ------------------
 1308|   190k|    const int ii = wrap_index(i, wiener_win);
 1309|  1.14M|    for (j = 0; j < wiener_win; j++) {
  ------------------
  |  Branch (1309:17): [True: 954k, False: 190k]
  ------------------
 1310|   954k|      const int jj = wrap_index(j, wiener_win);
 1311|   954k|      int k, l;
 1312|  5.72M|      for (k = 0; k < wiener_win; ++k) {
  ------------------
  |  Branch (1312:19): [True: 4.77M, False: 954k]
  ------------------
 1313|  28.6M|        for (l = 0; l < wiener_win; ++l) {
  ------------------
  |  Branch (1313:21): [True: 23.8M, False: 4.77M]
  ------------------
 1314|       |          // Calculate
 1315|       |          // B[jj * wiener_halfwin1 + ii] +=
 1316|       |          //     Hc[i * wiener_win + j][k * wiener_win2 + l] * a[k] /
 1317|       |          //     WIENER_TAP_SCALE_FACTOR * a[l] / WIENER_TAP_SCALE_FACTOR;
 1318|       |          //
 1319|       |          // The last multiplication may overflow, so we combine the last
 1320|       |          // multiplication with the last division.
 1321|  23.8M|          const int64_t x = Hc[i * wiener_win + j][k * wiener_win2 + l] * a[k] /
 1322|  23.8M|                            WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  23.8M|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1323|       |          // a[l] = a1[l] * WIENER_TAP_SCALE_FACTOR + a2[l]
 1324|  23.8M|          B[jj * wiener_halfwin1 + ii] += multiply_and_scale(x, a1[l], a2[l]);
 1325|  23.8M|        }
 1326|  4.77M|      }
 1327|   954k|    }
 1328|   190k|  }
 1329|       |  // Normalization enforcement in the system of equations itself
 1330|   114k|  for (i = 0; i < wiener_halfwin1 - 1; ++i) {
  ------------------
  |  Branch (1330:15): [True: 76.3k, False: 38.1k]
  ------------------
 1331|  76.3k|    A[i] -=
 1332|  76.3k|        A[wiener_halfwin1 - 1] * 2 +
 1333|  76.3k|        B[i * wiener_halfwin1 + wiener_halfwin1 - 1] -
 1334|  76.3k|        2 * B[(wiener_halfwin1 - 1) * wiener_halfwin1 + (wiener_halfwin1 - 1)];
 1335|  76.3k|  }
 1336|   114k|  for (i = 0; i < wiener_halfwin1 - 1; ++i) {
  ------------------
  |  Branch (1336:15): [True: 76.3k, False: 38.1k]
  ------------------
 1337|   229k|    for (j = 0; j < wiener_halfwin1 - 1; ++j) {
  ------------------
  |  Branch (1337:17): [True: 152k, False: 76.3k]
  ------------------
 1338|   152k|      B[i * wiener_halfwin1 + j] -=
 1339|   152k|          2 * (B[i * wiener_halfwin1 + (wiener_halfwin1 - 1)] +
 1340|   152k|               B[(wiener_halfwin1 - 1) * wiener_halfwin1 + j] -
 1341|   152k|               2 * B[(wiener_halfwin1 - 1) * wiener_halfwin1 +
 1342|   152k|                     (wiener_halfwin1 - 1)]);
 1343|   152k|    }
 1344|  76.3k|  }
 1345|  38.1k|  if (linsolve_wiener(wiener_halfwin1 - 1, B, wiener_halfwin1, A, S)) {
  ------------------
  |  Branch (1345:7): [True: 34.3k, False: 3.87k]
  ------------------
 1346|  34.3k|    S[wiener_halfwin1 - 1] = WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  34.3k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1347|   102k|    for (i = wiener_halfwin1; i < wiener_win; ++i) {
  ------------------
  |  Branch (1347:31): [True: 68.6k, False: 34.3k]
  ------------------
 1348|  68.6k|      S[i] = S[wiener_win - 1 - i];
 1349|  68.6k|      S[wiener_halfwin1 - 1] -= 2 * S[i];
 1350|  68.6k|    }
 1351|   205k|    for (i = 0; i < wiener_win; ++i) {
  ------------------
  |  Branch (1351:17): [True: 171k, False: 34.3k]
  ------------------
 1352|   171k|      b[i] = (int32_t)CLIP(S[i], -(1 << (WIENER_FILT_BITS - 1)),
  ------------------
  |  |   31|   171k|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 0, False: 171k]
  |  |  |  Branch (31:46): [True: 0, False: 171k]
  |  |  ------------------
  ------------------
 1353|   171k|                           (1 << (WIENER_FILT_BITS - 1)) - 1);
 1354|   171k|    }
 1355|  34.3k|  }
 1356|  38.1k|}
pickrst.c:finalize_sym_filter:
 1433|  19.0k|                                       InterpKernel fi) {
 1434|  19.0k|  int i;
 1435|  19.0k|  const int wiener_halfwin = (wiener_win >> 1);
 1436|       |
 1437|  57.2k|  for (i = 0; i < wiener_halfwin; ++i) {
  ------------------
  |  Branch (1437:15): [True: 38.1k, False: 19.0k]
  ------------------
 1438|  38.1k|    const int64_t dividend = (int64_t)f[i] * WIENER_FILT_STEP;
  ------------------
  |  |  134|  38.1k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  38.1k|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1439|  38.1k|    const int64_t divisor = WIENER_TAP_SCALE_FACTOR;
  ------------------
  |  |   45|  38.1k|#define WIENER_TAP_SCALE_FACTOR ((int64_t)1 << 16)
  ------------------
 1440|       |    // Perform this division with proper rounding rather than truncation
 1441|  38.1k|    if (dividend < 0) {
  ------------------
  |  Branch (1441:9): [True: 20.8k, False: 17.3k]
  ------------------
 1442|  20.8k|      fi[i] = (int16_t)((dividend - (divisor / 2)) / divisor);
 1443|  20.8k|    } else {
 1444|  17.3k|      fi[i] = (int16_t)((dividend + (divisor / 2)) / divisor);
 1445|  17.3k|    }
 1446|  38.1k|  }
 1447|       |  // Specialize for 7-tap filter
 1448|  19.0k|  if (wiener_win == WIENER_WIN) {
  ------------------
  |  |  121|  19.0k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  19.0k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1448:7): [True: 0, False: 19.0k]
  ------------------
 1449|      0|    fi[0] = CLIP(fi[0], WIENER_FILT_TAP0_MINV, WIENER_FILT_TAP0_MAXV);
  ------------------
  |  |   31|      0|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 0, False: 0]
  |  |  |  Branch (31:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1450|      0|    fi[1] = CLIP(fi[1], WIENER_FILT_TAP1_MINV, WIENER_FILT_TAP1_MAXV);
  ------------------
  |  |   31|      0|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 0, False: 0]
  |  |  |  Branch (31:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1451|      0|    fi[2] = CLIP(fi[2], WIENER_FILT_TAP2_MINV, WIENER_FILT_TAP2_MAXV);
  ------------------
  |  |   31|      0|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 0, False: 0]
  |  |  |  Branch (31:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1452|  19.0k|  } else {
 1453|  19.0k|    fi[2] = CLIP(fi[1], WIENER_FILT_TAP2_MINV, WIENER_FILT_TAP2_MAXV);
  ------------------
  |  |   31|  19.0k|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 1.41k, False: 17.6k]
  |  |  |  Branch (31:46): [True: 576, False: 17.1k]
  |  |  ------------------
  ------------------
 1454|  19.0k|    fi[1] = CLIP(fi[0], WIENER_FILT_TAP1_MINV, WIENER_FILT_TAP1_MAXV);
  ------------------
  |  |   31|  19.0k|#define CLIP(x, lo, hi) ((x) < (lo) ? (lo) : (x) > (hi) ? (hi) : (x))
  |  |  ------------------
  |  |  |  Branch (31:26): [True: 868, False: 18.2k]
  |  |  |  Branch (31:46): [True: 1.89k, False: 16.3k]
  |  |  ------------------
  ------------------
 1455|  19.0k|    fi[0] = 0;
 1456|  19.0k|  }
 1457|       |  // Satisfy filter constraints
 1458|  19.0k|  fi[WIENER_WIN - 1] = fi[0];
  ------------------
  |  |  121|  19.0k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  19.0k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1459|  19.0k|  fi[WIENER_WIN - 2] = fi[1];
  ------------------
  |  |  121|  19.0k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  19.0k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1460|  19.0k|  fi[WIENER_WIN - 3] = fi[2];
  ------------------
  |  |  121|  19.0k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  19.0k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1461|       |  // The central element has an implicit +WIENER_FILT_STEP
 1462|  19.0k|  fi[3] = -2 * (fi[0] + fi[1] + fi[2]);
 1463|  19.0k|}
pickrst.c:compute_score:
 1394|  9.54k|                             InterpKernel vfilt, InterpKernel hfilt) {
 1395|  9.54k|  int32_t ab[WIENER_WIN * WIENER_WIN];
 1396|  9.54k|  int16_t a[WIENER_WIN], b[WIENER_WIN];
 1397|  9.54k|  int64_t P = 0, Q = 0;
 1398|  9.54k|  int64_t iP = 0, iQ = 0;
 1399|  9.54k|  int64_t Score, iScore;
 1400|  9.54k|  int i, k, l;
 1401|  9.54k|  const int plane_off = (WIENER_WIN - wiener_win) >> 1;
  ------------------
  |  |  121|  9.54k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  9.54k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1402|  9.54k|  const int wiener_win2 = wiener_win * wiener_win;
 1403|       |
 1404|  9.54k|  a[WIENER_HALFWIN] = b[WIENER_HALFWIN] = WIENER_FILT_STEP;
  ------------------
  |  |   43|  9.54k|#define WIENER_HALFWIN 3
  ------------------
                a[WIENER_HALFWIN] = b[WIENER_HALFWIN] = WIENER_FILT_STEP;
  ------------------
  |  |   43|  9.54k|#define WIENER_HALFWIN 3
  ------------------
                a[WIENER_HALFWIN] = b[WIENER_HALFWIN] = WIENER_FILT_STEP;
  ------------------
  |  |  134|  9.54k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  9.54k|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1405|  38.1k|  for (i = 0; i < WIENER_HALFWIN; ++i) {
  ------------------
  |  |   43|  38.1k|#define WIENER_HALFWIN 3
  ------------------
  |  Branch (1405:15): [True: 28.6k, False: 9.54k]
  ------------------
 1406|  28.6k|    a[i] = a[WIENER_WIN - i - 1] = vfilt[i];
  ------------------
  |  |  121|  28.6k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  28.6k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1407|  28.6k|    b[i] = b[WIENER_WIN - i - 1] = hfilt[i];
  ------------------
  |  |  121|  28.6k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  28.6k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1408|  28.6k|    a[WIENER_HALFWIN] -= 2 * a[i];
  ------------------
  |  |   43|  28.6k|#define WIENER_HALFWIN 3
  ------------------
 1409|  28.6k|    b[WIENER_HALFWIN] -= 2 * b[i];
  ------------------
  |  |   43|  28.6k|#define WIENER_HALFWIN 3
  ------------------
 1410|  28.6k|  }
 1411|  9.54k|  memset(ab, 0, sizeof(ab));
 1412|  57.2k|  for (k = 0; k < wiener_win; ++k) {
  ------------------
  |  Branch (1412:15): [True: 47.7k, False: 9.54k]
  ------------------
 1413|   286k|    for (l = 0; l < wiener_win; ++l)
  ------------------
  |  Branch (1413:17): [True: 238k, False: 47.7k]
  ------------------
 1414|   238k|      ab[k * wiener_win + l] = a[l + plane_off] * b[k + plane_off];
 1415|  47.7k|  }
 1416|   248k|  for (k = 0; k < wiener_win2; ++k) {
  ------------------
  |  Branch (1416:15): [True: 238k, False: 9.54k]
  ------------------
 1417|   238k|    P += ab[k] * M[k] / WIENER_FILT_STEP / WIENER_FILT_STEP;
  ------------------
  |  |  134|   238k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|   238k|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
                  P += ab[k] * M[k] / WIENER_FILT_STEP / WIENER_FILT_STEP;
  ------------------
  |  |  134|   238k|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|   238k|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1418|  6.20M|    for (l = 0; l < wiener_win2; ++l) {
  ------------------
  |  Branch (1418:17): [True: 5.96M, False: 238k]
  ------------------
 1419|  5.96M|      Q += ab[k] * H[k * wiener_win2 + l] * ab[l] / WIENER_FILT_STEP /
  ------------------
  |  |  134|  5.96M|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  5.96M|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1420|  5.96M|           WIENER_FILT_STEP / WIENER_FILT_STEP / WIENER_FILT_STEP;
  ------------------
  |  |  134|  5.96M|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  5.96M|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
                         WIENER_FILT_STEP / WIENER_FILT_STEP / WIENER_FILT_STEP;
  ------------------
  |  |  134|  5.96M|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  5.96M|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
                         WIENER_FILT_STEP / WIENER_FILT_STEP / WIENER_FILT_STEP;
  ------------------
  |  |  134|  5.96M|#define WIENER_FILT_STEP (1 << WIENER_FILT_PREC_BITS)
  |  |  ------------------
  |  |  |  |  133|  5.96M|#define WIENER_FILT_PREC_BITS 7
  |  |  ------------------
  ------------------
 1421|  5.96M|    }
 1422|   238k|  }
 1423|  9.54k|  Score = Q - 2 * P;
 1424|       |
 1425|  9.54k|  iP = M[wiener_win2 >> 1];
 1426|  9.54k|  iQ = H[(wiener_win2 >> 1) * wiener_win2 + (wiener_win2 >> 1)];
 1427|  9.54k|  iScore = iQ - 2 * iP;
 1428|       |
 1429|  9.54k|  return Score - iScore;
 1430|  9.54k|}
pickrst.c:finer_search_wiener:
 1505|  6.73k|                                   RestorationUnitInfo *rui, int wiener_win) {
 1506|  6.73k|  const int plane_off = (WIENER_WIN - wiener_win) >> 1;
  ------------------
  |  |  121|  6.73k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  6.73k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1507|  6.73k|  int64_t err = try_restoration_unit(rsc, limits, rui);
 1508|       |
 1509|  6.73k|  if (rsc->lpf_sf->disable_wiener_coeff_refine_search) return err;
  ------------------
  |  Branch (1509:7): [True: 6.73k, False: 0]
  ------------------
 1510|       |
 1511|       |  // Refinement search around the wiener filter coefficients.
 1512|      0|  int64_t err2;
 1513|      0|  int tap_min[] = { WIENER_FILT_TAP0_MINV, WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  152|      0|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|      0|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|      0|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                int tap_min[] = { WIENER_FILT_TAP0_MINV, WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  154|      0|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|      0|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|      0|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1514|      0|                    WIENER_FILT_TAP2_MINV };
  ------------------
  |  |  156|      0|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|      0|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|      0|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1515|      0|  int tap_max[] = { WIENER_FILT_TAP0_MAXV, WIENER_FILT_TAP1_MAXV,
  ------------------
  |  |  159|      0|  (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|      0|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|      0|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                int tap_max[] = { WIENER_FILT_TAP0_MAXV, WIENER_FILT_TAP1_MAXV,
  ------------------
  |  |  161|      0|  (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|      0|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|      0|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1516|      0|                    WIENER_FILT_TAP2_MAXV };
  ------------------
  |  |  163|      0|  (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|      0|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|      0|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1517|       |
 1518|      0|  WienerInfo *plane_wiener = &rui->wiener_info;
 1519|       |
 1520|      0|  const int start_step = 4;
 1521|      0|  for (int s = start_step; s >= 1; s >>= 1) {
  ------------------
  |  Branch (1521:28): [True: 0, False: 0]
  ------------------
 1522|      0|    for (int p = plane_off; p < WIENER_HALFWIN; ++p) {
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
  |  Branch (1522:29): [True: 0, False: 0]
  ------------------
 1523|      0|      int skip = 0;
 1524|      0|      do {
 1525|      0|        if (plane_wiener->hfilter[p] - s >= tap_min[p]) {
  ------------------
  |  Branch (1525:13): [True: 0, False: 0]
  ------------------
 1526|      0|          plane_wiener->hfilter[p] -= s;
 1527|      0|          plane_wiener->hfilter[WIENER_WIN - p - 1] -= s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1528|      0|          plane_wiener->hfilter[WIENER_HALFWIN] += 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1529|      0|          err2 = try_restoration_unit(rsc, limits, rui);
 1530|      0|          if (err2 > err) {
  ------------------
  |  Branch (1530:15): [True: 0, False: 0]
  ------------------
 1531|      0|            plane_wiener->hfilter[p] += s;
 1532|      0|            plane_wiener->hfilter[WIENER_WIN - p - 1] += s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1533|      0|            plane_wiener->hfilter[WIENER_HALFWIN] -= 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1534|      0|          } else {
 1535|      0|            err = err2;
 1536|      0|            skip = 1;
 1537|       |            // At the highest step size continue moving in the same direction
 1538|      0|            if (s == start_step) continue;
  ------------------
  |  Branch (1538:17): [True: 0, False: 0]
  ------------------
 1539|      0|          }
 1540|      0|        }
 1541|      0|        break;
 1542|      0|      } while (1);
  ------------------
  |  Branch (1542:16): [True: 0, Folded]
  ------------------
 1543|      0|      if (skip) break;
  ------------------
  |  Branch (1543:11): [True: 0, False: 0]
  ------------------
 1544|      0|      do {
 1545|      0|        if (plane_wiener->hfilter[p] + s <= tap_max[p]) {
  ------------------
  |  Branch (1545:13): [True: 0, False: 0]
  ------------------
 1546|      0|          plane_wiener->hfilter[p] += s;
 1547|      0|          plane_wiener->hfilter[WIENER_WIN - p - 1] += s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1548|      0|          plane_wiener->hfilter[WIENER_HALFWIN] -= 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1549|      0|          err2 = try_restoration_unit(rsc, limits, rui);
 1550|      0|          if (err2 > err) {
  ------------------
  |  Branch (1550:15): [True: 0, False: 0]
  ------------------
 1551|      0|            plane_wiener->hfilter[p] -= s;
 1552|      0|            plane_wiener->hfilter[WIENER_WIN - p - 1] -= s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1553|      0|            plane_wiener->hfilter[WIENER_HALFWIN] += 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1554|      0|          } else {
 1555|      0|            err = err2;
 1556|       |            // At the highest step size continue moving in the same direction
 1557|      0|            if (s == start_step) continue;
  ------------------
  |  Branch (1557:17): [True: 0, False: 0]
  ------------------
 1558|      0|          }
 1559|      0|        }
 1560|      0|        break;
 1561|      0|      } while (1);
  ------------------
  |  Branch (1561:16): [True: 0, Folded]
  ------------------
 1562|      0|    }
 1563|      0|    for (int p = plane_off; p < WIENER_HALFWIN; ++p) {
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
  |  Branch (1563:29): [True: 0, False: 0]
  ------------------
 1564|      0|      int skip = 0;
 1565|      0|      do {
 1566|      0|        if (plane_wiener->vfilter[p] - s >= tap_min[p]) {
  ------------------
  |  Branch (1566:13): [True: 0, False: 0]
  ------------------
 1567|      0|          plane_wiener->vfilter[p] -= s;
 1568|      0|          plane_wiener->vfilter[WIENER_WIN - p - 1] -= s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1569|      0|          plane_wiener->vfilter[WIENER_HALFWIN] += 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1570|      0|          err2 = try_restoration_unit(rsc, limits, rui);
 1571|      0|          if (err2 > err) {
  ------------------
  |  Branch (1571:15): [True: 0, False: 0]
  ------------------
 1572|      0|            plane_wiener->vfilter[p] += s;
 1573|      0|            plane_wiener->vfilter[WIENER_WIN - p - 1] += s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1574|      0|            plane_wiener->vfilter[WIENER_HALFWIN] -= 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1575|      0|          } else {
 1576|      0|            err = err2;
 1577|      0|            skip = 1;
 1578|       |            // At the highest step size continue moving in the same direction
 1579|      0|            if (s == start_step) continue;
  ------------------
  |  Branch (1579:17): [True: 0, False: 0]
  ------------------
 1580|      0|          }
 1581|      0|        }
 1582|      0|        break;
 1583|      0|      } while (1);
  ------------------
  |  Branch (1583:16): [True: 0, Folded]
  ------------------
 1584|      0|      if (skip) break;
  ------------------
  |  Branch (1584:11): [True: 0, False: 0]
  ------------------
 1585|      0|      do {
 1586|      0|        if (plane_wiener->vfilter[p] + s <= tap_max[p]) {
  ------------------
  |  Branch (1586:13): [True: 0, False: 0]
  ------------------
 1587|      0|          plane_wiener->vfilter[p] += s;
 1588|      0|          plane_wiener->vfilter[WIENER_WIN - p - 1] += s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1589|      0|          plane_wiener->vfilter[WIENER_HALFWIN] -= 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1590|      0|          err2 = try_restoration_unit(rsc, limits, rui);
 1591|      0|          if (err2 > err) {
  ------------------
  |  Branch (1591:15): [True: 0, False: 0]
  ------------------
 1592|      0|            plane_wiener->vfilter[p] -= s;
 1593|      0|            plane_wiener->vfilter[WIENER_WIN - p - 1] -= s;
  ------------------
  |  |  121|      0|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|      0|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
 1594|      0|            plane_wiener->vfilter[WIENER_HALFWIN] += 2 * s;
  ------------------
  |  |   43|      0|#define WIENER_HALFWIN 3
  ------------------
 1595|      0|          } else {
 1596|      0|            err = err2;
 1597|       |            // At the highest step size continue moving in the same direction
 1598|      0|            if (s == start_step) continue;
  ------------------
  |  Branch (1598:17): [True: 0, False: 0]
  ------------------
 1599|      0|          }
 1600|      0|        }
 1601|      0|        break;
 1602|      0|      } while (1);
  ------------------
  |  Branch (1602:16): [True: 0, Folded]
  ------------------
 1603|      0|    }
 1604|      0|  }
 1605|      0|  return err;
 1606|  6.73k|}
pickrst.c:try_restoration_unit:
  207|  7.48k|                                    const RestorationUnitInfo *rui) {
  208|  7.48k|  const AV1_COMMON *const cm = rsc->cm;
  209|  7.48k|  const int plane = rsc->plane;
  210|  7.48k|  const int is_uv = plane > 0;
  211|  7.48k|  const RestorationInfo *rsi = &cm->rst_info[plane];
  212|  7.48k|  RestorationLineBuffers rlbs;
  213|  7.48k|  const int bit_depth = cm->seq_params->bit_depth;
  214|  7.48k|  const int highbd = cm->seq_params->use_highbitdepth;
  215|       |
  216|  7.48k|  const YV12_BUFFER_CONFIG *fts = &cm->cur_frame->buf;
  217|       |  // TODO(yunqing): For now, only use optimized LR filter in decoder. Can be
  218|       |  // also used in encoder.
  219|  7.48k|  const int optimized_lr = 0;
  220|       |
  221|  7.48k|  av1_loop_restoration_filter_unit(
  222|  7.48k|      limits, rui, &rsi->boundaries, &rlbs, rsc->plane_w, rsc->plane_h,
  223|  7.48k|      is_uv && cm->seq_params->subsampling_x,
  ------------------
  |  Branch (223:7): [True: 1.05k, False: 6.43k]
  |  Branch (223:16): [True: 627, False: 426]
  ------------------
  224|  7.48k|      is_uv && cm->seq_params->subsampling_y, highbd, bit_depth,
  ------------------
  |  Branch (224:7): [True: 1.05k, False: 6.43k]
  |  Branch (224:16): [True: 375, False: 678]
  ------------------
  225|  7.48k|      fts->buffers[plane], fts->strides[is_uv], rsc->dst->buffers[plane],
  226|  7.48k|      rsc->dst->strides[is_uv], cm->rst_tmpbuf, optimized_lr, cm->error);
  227|       |
  228|  7.48k|  return sse_restoration_unit(limits, rsc->src, rsc->dst, plane, highbd);
  229|  7.48k|}
pickrst.c:count_wiener_bits:
 1466|  6.75k|                             WienerInfo *ref_wiener_info) {
 1467|  6.75k|  int bits = 0;
 1468|  6.75k|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|  6.75k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  6.75k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1468:7): [True: 5.95k, False: 801]
  ------------------
 1469|  5.95k|    bits += aom_count_primitive_refsubexpfin(
 1470|  5.95k|        WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  159|  5.95k|  (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                      WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1471|  5.95k|        WIENER_FILT_TAP0_SUBEXP_K,
  ------------------
  |  |  165|  5.95k|#define WIENER_FILT_TAP0_SUBEXP_K 1
  ------------------
 1472|  5.95k|        ref_wiener_info->vfilter[0] - WIENER_FILT_TAP0_MINV,
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1473|  5.95k|        wiener_info->vfilter[0] - WIENER_FILT_TAP0_MINV);
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1474|  6.75k|  bits += aom_count_primitive_refsubexpfin(
 1475|  6.75k|      WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  161|  6.75k|  (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
                    WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1476|  6.75k|      WIENER_FILT_TAP1_SUBEXP_K,
  ------------------
  |  |  166|  6.75k|#define WIENER_FILT_TAP1_SUBEXP_K 2
  ------------------
 1477|  6.75k|      ref_wiener_info->vfilter[1] - WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1478|  6.75k|      wiener_info->vfilter[1] - WIENER_FILT_TAP1_MINV);
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1479|  6.75k|  bits += aom_count_primitive_refsubexpfin(
 1480|  6.75k|      WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  163|  6.75k|  (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
                    WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1481|  6.75k|      WIENER_FILT_TAP2_SUBEXP_K,
  ------------------
  |  |  167|  6.75k|#define WIENER_FILT_TAP2_SUBEXP_K 3
  ------------------
 1482|  6.75k|      ref_wiener_info->vfilter[2] - WIENER_FILT_TAP2_MINV,
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1483|  6.75k|      wiener_info->vfilter[2] - WIENER_FILT_TAP2_MINV);
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1484|  6.75k|  if (wiener_win == WIENER_WIN)
  ------------------
  |  |  121|  6.75k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  6.75k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1484:7): [True: 5.95k, False: 801]
  ------------------
 1485|  5.95k|    bits += aom_count_primitive_refsubexpfin(
 1486|  5.95k|        WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  159|  5.95k|  (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - 1 + (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
                      WIENER_FILT_TAP0_MAXV - WIENER_FILT_TAP0_MINV + 1,
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1487|  5.95k|        WIENER_FILT_TAP0_SUBEXP_K,
  ------------------
  |  |  165|  5.95k|#define WIENER_FILT_TAP0_SUBEXP_K 1
  ------------------
 1488|  5.95k|        ref_wiener_info->hfilter[0] - WIENER_FILT_TAP0_MINV,
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1489|  5.95k|        wiener_info->hfilter[0] - WIENER_FILT_TAP0_MINV);
  ------------------
  |  |  152|  5.95k|  (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  137|  5.95k|#define WIENER_FILT_TAP0_MIDV (3)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP0_MIDV - (1 << WIENER_FILT_TAP0_BITS) / 2)
  |  |  ------------------
  |  |  |  |  144|  5.95k|#define WIENER_FILT_TAP0_BITS 4
  |  |  ------------------
  ------------------
 1490|  6.75k|  bits += aom_count_primitive_refsubexpfin(
 1491|  6.75k|      WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  161|  6.75k|  (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - 1 + (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
                    WIENER_FILT_TAP1_MAXV - WIENER_FILT_TAP1_MINV + 1,
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1492|  6.75k|      WIENER_FILT_TAP1_SUBEXP_K,
  ------------------
  |  |  166|  6.75k|#define WIENER_FILT_TAP1_SUBEXP_K 2
  ------------------
 1493|  6.75k|      ref_wiener_info->hfilter[1] - WIENER_FILT_TAP1_MINV,
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1494|  6.75k|      wiener_info->hfilter[1] - WIENER_FILT_TAP1_MINV);
  ------------------
  |  |  154|  6.75k|  (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  138|  6.75k|#define WIENER_FILT_TAP1_MIDV (-7)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP1_MIDV - (1 << WIENER_FILT_TAP1_BITS) / 2)
  |  |  ------------------
  |  |  |  |  145|  6.75k|#define WIENER_FILT_TAP1_BITS 5
  |  |  ------------------
  ------------------
 1495|  6.75k|  bits += aom_count_primitive_refsubexpfin(
 1496|  6.75k|      WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  163|  6.75k|  (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - 1 + (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
                    WIENER_FILT_TAP2_MAXV - WIENER_FILT_TAP2_MINV + 1,
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1497|  6.75k|      WIENER_FILT_TAP2_SUBEXP_K,
  ------------------
  |  |  167|  6.75k|#define WIENER_FILT_TAP2_SUBEXP_K 3
  ------------------
 1498|  6.75k|      ref_wiener_info->hfilter[2] - WIENER_FILT_TAP2_MINV,
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1499|  6.75k|      wiener_info->hfilter[2] - WIENER_FILT_TAP2_MINV);
  ------------------
  |  |  156|  6.75k|  (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  139|  6.75k|#define WIENER_FILT_TAP2_MIDV (15)
  |  |  ------------------
  |  |                 (WIENER_FILT_TAP2_MIDV - (1 << WIENER_FILT_TAP2_BITS) / 2)
  |  |  ------------------
  |  |  |  |  146|  6.75k|#define WIENER_FILT_TAP2_BITS 6
  |  |  ------------------
  ------------------
 1500|  6.75k|  return bits;
 1501|  6.75k|}
pickrst.c:search_sgrproj:
  902|  6.50k|                                  struct aom_internal_error_info *error_info) {
  903|  6.50k|  (void)rlbs;
  904|  6.50k|  RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
  905|  6.50k|  RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx];
  906|       |
  907|  6.50k|  const MACROBLOCK *const x = rsc->x;
  908|  6.50k|  const AV1_COMMON *const cm = rsc->cm;
  909|  6.50k|  const int highbd = cm->seq_params->use_highbitdepth;
  910|  6.50k|  const int bit_depth = cm->seq_params->bit_depth;
  911|       |
  912|  6.50k|  const int64_t bits_none = x->mode_costs.sgrproj_restore_cost[0];
  913|       |  // Prune evaluation of RESTORE_SGRPROJ if 'skip_sgr_eval' is set
  914|  6.50k|  if (rsc->skip_sgr_eval) {
  ------------------
  |  Branch (914:7): [True: 5.74k, False: 753]
  ------------------
  915|  5.74k|    rsc->total_bits[RESTORE_SGRPROJ] += bits_none;
  916|  5.74k|    rsc->total_sse[RESTORE_SGRPROJ] += rsc->sse[RESTORE_NONE];
  917|  5.74k|    rusi->best_rtype[RESTORE_SGRPROJ - 1] = RESTORE_NONE;
  918|  5.74k|    rsc->sse[RESTORE_SGRPROJ] = INT64_MAX;
  919|  5.74k|    return;
  920|  5.74k|  }
  921|       |
  922|    753|  uint8_t *dgd_start =
  923|    753|      rsc->dgd_buffer + limits->v_start * rsc->dgd_stride + limits->h_start;
  924|    753|  const uint8_t *src_start =
  925|    753|      rsc->src_buffer + limits->v_start * rsc->src_stride + limits->h_start;
  926|       |
  927|    753|  const int is_uv = rsc->plane > 0;
  928|    753|  const int ss_x = is_uv && cm->seq_params->subsampling_x;
  ------------------
  |  Branch (928:20): [True: 256, False: 497]
  |  Branch (928:29): [True: 130, False: 126]
  ------------------
  929|    753|  const int ss_y = is_uv && cm->seq_params->subsampling_y;
  ------------------
  |  Branch (929:20): [True: 256, False: 497]
  |  Branch (929:29): [True: 67, False: 189]
  ------------------
  930|    753|  const int procunit_width = RESTORATION_PROC_UNIT_SIZE >> ss_x;
  ------------------
  |  |   34|    753|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
  931|    753|  const int procunit_height = RESTORATION_PROC_UNIT_SIZE >> ss_y;
  ------------------
  |  |   34|    753|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
  932|       |
  933|    753|  rusi->sgrproj = search_selfguided_restoration(
  934|    753|      dgd_start, limits->h_end - limits->h_start,
  935|    753|      limits->v_end - limits->v_start, rsc->dgd_stride, src_start,
  936|    753|      rsc->src_stride, highbd, bit_depth, procunit_width, procunit_height,
  937|    753|      tmpbuf, rsc->lpf_sf->enable_sgr_ep_pruning, error_info);
  938|       |
  939|    753|  RestorationUnitInfo rui;
  940|    753|  rui.restoration_type = RESTORE_SGRPROJ;
  941|    753|  rui.sgrproj_info = rusi->sgrproj;
  942|       |
  943|    753|  rsc->sse[RESTORE_SGRPROJ] = try_restoration_unit(rsc, limits, &rui);
  944|       |
  945|    753|  const int64_t bits_sgr =
  946|    753|      x->mode_costs.sgrproj_restore_cost[1] +
  947|    753|      (count_sgrproj_bits(&rusi->sgrproj, &rsc->ref_sgrproj)
  948|    753|       << AV1_PROB_COST_SHIFT);
  ------------------
  |  |   25|    753|#define AV1_PROB_COST_SHIFT 9
  ------------------
  949|    753|  double cost_none = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|    753|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|    753|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|    753|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|    753|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  950|    753|      x->rdmult, bits_none >> 4, rsc->sse[RESTORE_NONE], bit_depth);
  951|    753|  double cost_sgr = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|    753|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|    753|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|    753|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|    753|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  952|    753|      x->rdmult, bits_sgr >> 4, rsc->sse[RESTORE_SGRPROJ], bit_depth);
  953|    753|  if (rusi->sgrproj.ep < 10)
  ------------------
  |  Branch (953:7): [True: 753, False: 0]
  ------------------
  954|    753|    cost_sgr *=
  955|    753|        (1 + DUAL_SGR_PENALTY_MULT * rsc->lpf_sf->dual_sgr_penalty_level);
  ------------------
  |  |   39|    753|#define DUAL_SGR_PENALTY_MULT 0.01
  ------------------
  956|       |
  957|    753|  RestorationType rtype =
  958|    753|      (cost_sgr < cost_none) ? RESTORE_SGRPROJ : RESTORE_NONE;
  ------------------
  |  Branch (958:7): [True: 155, False: 598]
  ------------------
  959|    753|  rusi->best_rtype[RESTORE_SGRPROJ - 1] = rtype;
  960|       |
  961|       |#if DEBUG_LR_COSTING
  962|       |  // Store ref params for later checking
  963|       |  lr_ref_params[RESTORE_SGRPROJ][rsc->plane][rest_unit_idx].sgrproj_info =
  964|       |      rsc->ref_sgrproj;
  965|       |#endif  // DEBUG_LR_COSTING
  966|       |
  967|    753|  rsc->total_sse[RESTORE_SGRPROJ] += rsc->sse[rtype];
  968|    753|  rsc->total_bits[RESTORE_SGRPROJ] +=
  969|    753|      (cost_sgr < cost_none) ? bits_sgr : bits_none;
  ------------------
  |  Branch (969:7): [True: 155, False: 598]
  ------------------
  970|    753|  if (cost_sgr < cost_none) rsc->ref_sgrproj = rusi->sgrproj;
  ------------------
  |  Branch (970:7): [True: 155, False: 598]
  ------------------
  971|    753|}
pickrst.c:search_selfguided_restoration:
  822|    753|    struct aom_internal_error_info *error_info) {
  823|    753|  int32_t *flt0 = rstbuf;
  824|    753|  int32_t *flt1 = flt0 + RESTORATION_UNITPELS_MAX;
  ------------------
  |  |   87|    753|  (RESTORATION_UNITPELS_HORZ_MAX * RESTORATION_UNITPELS_VERT_MAX)
  |  |  ------------------
  |  |  |  |   82|    753|  (RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_HORZ + 16)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    753|#define RESTORATION_UNITSIZE_MAX 256
  |  |  |  |  ------------------
  |  |  |  |                 (RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_HORZ + 16)
  |  |  |  |  ------------------
  |  |  |  |  |  |   56|    753|#define RESTORATION_BORDER_HORZ (SGRPROJ_BORDER_HORZ)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|    753|#define SGRPROJ_BORDER_HORZ 3  // Horizontal border used for Sgr
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (RESTORATION_UNITPELS_HORZ_MAX * RESTORATION_UNITPELS_VERT_MAX)
  |  |  ------------------
  |  |  |  |   84|    753|  ((RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_VERT + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|    753|#define RESTORATION_UNITSIZE_MAX 256
  |  |  |  |  ------------------
  |  |  |  |                 ((RESTORATION_UNITSIZE_MAX * 3 / 2 + 2 * RESTORATION_BORDER_VERT + \
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    753|#define RESTORATION_BORDER_VERT (SGRPROJ_BORDER_VERT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|    753|#define SGRPROJ_BORDER_VERT 3  // Vertical border used for Sgr
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|    753|    RESTORATION_UNIT_OFFSET))
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    753|#define RESTORATION_UNIT_OFFSET 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  825|    753|  int ep, idx, bestep = 0;
  826|    753|  int64_t besterr = -1;
  827|    753|  int exqd[2], bestxqd[2] = { 0, 0 };
  828|    753|  int flt_stride = ((width + 7) & ~7) + 8;
  829|    753|  assert(pu_width == (RESTORATION_PROC_UNIT_SIZE >> 1) ||
  830|    753|         pu_width == RESTORATION_PROC_UNIT_SIZE);
  831|    753|  assert(pu_height == (RESTORATION_PROC_UNIT_SIZE >> 1) ||
  832|    753|         pu_height == RESTORATION_PROC_UNIT_SIZE);
  833|    753|  if (!enable_sgr_ep_pruning) {
  ------------------
  |  Branch (833:7): [True: 0, False: 753]
  ------------------
  834|      0|    for (ep = 0; ep < SGRPROJ_PARAMS; ep++) {
  ------------------
  |  |   96|      0|#define SGRPROJ_PARAMS (1 << SGRPROJ_PARAMS_BITS)
  |  |  ------------------
  |  |  |  |   95|      0|#define SGRPROJ_PARAMS_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (834:18): [True: 0, False: 0]
  ------------------
  835|      0|      int64_t err;
  836|      0|      compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride,
  837|      0|                          use_highbitdepth, bit_depth, pu_width, pu_height, ep,
  838|      0|                          flt0, flt1, flt_stride, exqd, &err, error_info);
  839|      0|      get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
  840|      0|    }
  841|    753|  } else {
  842|       |    // evaluate first four seed ep in first group
  843|  3.76k|    for (idx = 0; idx < SGRPROJ_EP_GRP1_SEARCH_COUNT; idx++) {
  ------------------
  |  |   49|  3.76k|#define SGRPROJ_EP_GRP1_SEARCH_COUNT 4
  ------------------
  |  Branch (843:19): [True: 3.01k, False: 753]
  ------------------
  844|  3.01k|      ep = sgproj_ep_grp1_seed[idx];
  845|  3.01k|      int64_t err;
  846|  3.01k|      compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride,
  847|  3.01k|                          use_highbitdepth, bit_depth, pu_width, pu_height, ep,
  848|  3.01k|                          flt0, flt1, flt_stride, exqd, &err, error_info);
  849|  3.01k|      get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
  850|  3.01k|    }
  851|    753|    if (enable_sgr_ep_pruning < 2) {
  ------------------
  |  Branch (851:9): [True: 0, False: 753]
  ------------------
  852|       |      // evaluate left and right ep of winner in seed ep
  853|      0|      int bestep_ref = bestep;
  854|      0|      for (ep = bestep_ref - 1; ep < bestep_ref + 2; ep += 2) {
  ------------------
  |  Branch (854:33): [True: 0, False: 0]
  ------------------
  855|      0|        if (ep < SGRPROJ_EP_GRP1_START_IDX || ep > SGRPROJ_EP_GRP1_END_IDX)
  ------------------
  |  |   47|      0|#define SGRPROJ_EP_GRP1_START_IDX 0
  ------------------
                      if (ep < SGRPROJ_EP_GRP1_START_IDX || ep > SGRPROJ_EP_GRP1_END_IDX)
  ------------------
  |  |   48|      0|#define SGRPROJ_EP_GRP1_END_IDX 9
  ------------------
  |  Branch (855:13): [True: 0, False: 0]
  |  Branch (855:47): [True: 0, False: 0]
  ------------------
  856|      0|          continue;
  857|      0|        int64_t err;
  858|      0|        compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride,
  859|      0|                            use_highbitdepth, bit_depth, pu_width, pu_height,
  860|      0|                            ep, flt0, flt1, flt_stride, exqd, &err, error_info);
  861|      0|        get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
  862|      0|      }
  863|       |      // evaluate last two group
  864|      0|      for (idx = 0; idx < SGRPROJ_EP_GRP2_3_SEARCH_COUNT; idx++) {
  ------------------
  |  |   50|      0|#define SGRPROJ_EP_GRP2_3_SEARCH_COUNT 2
  ------------------
  |  Branch (864:21): [True: 0, False: 0]
  ------------------
  865|      0|        ep = sgproj_ep_grp2_3[idx][bestep];
  866|      0|        int64_t err;
  867|      0|        compute_sgrproj_err(dat8, width, height, dat_stride, src8, src_stride,
  868|      0|                            use_highbitdepth, bit_depth, pu_width, pu_height,
  869|      0|                            ep, flt0, flt1, flt_stride, exqd, &err, error_info);
  870|      0|        get_best_error(&besterr, err, exqd, bestxqd, &bestep, ep);
  871|      0|      }
  872|      0|    }
  873|    753|  }
  874|       |
  875|    753|  SgrprojInfo ret;
  876|    753|  ret.ep = bestep;
  877|    753|  ret.xqd[0] = bestxqd[0];
  878|    753|  ret.xqd[1] = bestxqd[1];
  879|    753|  return ret;
  880|    753|}
pickrst.c:compute_sgrproj_err:
  793|  3.01k|    struct aom_internal_error_info *error_info) {
  794|  3.01k|  int exq[2];
  795|  3.01k|  apply_sgr(ep, dat8, width, height, dat_stride, use_highbitdepth, bit_depth,
  796|  3.01k|            pu_width, pu_height, flt0, flt1, flt_stride, error_info);
  797|  3.01k|  const sgr_params_type *const params = &av1_sgr_params[ep];
  798|  3.01k|  get_proj_subspace(src8, width, height, src_stride, dat8, dat_stride,
  799|  3.01k|                    use_highbitdepth, flt0, flt_stride, flt1, flt_stride, exq,
  800|  3.01k|                    params);
  801|  3.01k|  encode_xq(exq, exqd, params);
  802|  3.01k|  *err = finer_search_pixel_proj_error(
  803|  3.01k|      src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0,
  804|  3.01k|      flt_stride, flt1, flt_stride, 2, exqd, params);
  805|  3.01k|}
pickrst.c:apply_sgr:
  766|  3.01k|                             struct aom_internal_error_info *error_info) {
  767|  7.52k|  for (int i = 0; i < height; i += pu_height) {
  ------------------
  |  Branch (767:19): [True: 4.50k, False: 3.01k]
  ------------------
  768|  4.50k|    const int h = AOMMIN(pu_height, height - i);
  ------------------
  |  |   34|  4.50k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.49k, False: 3.01k]
  |  |  ------------------
  ------------------
  769|  4.50k|    int32_t *flt0_row = flt0 + i * flt_stride;
  770|  4.50k|    int32_t *flt1_row = flt1 + i * flt_stride;
  771|  4.50k|    const uint8_t *dat8_row = dat8 + i * dat_stride;
  772|       |
  773|       |    // Iterate over the stripe in blocks of width pu_width
  774|  12.2k|    for (int j = 0; j < width; j += pu_width) {
  ------------------
  |  Branch (774:21): [True: 7.76k, False: 4.50k]
  ------------------
  775|  7.76k|      const int w = AOMMIN(pu_width, width - j);
  ------------------
  |  |   34|  7.76k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 3.25k, False: 4.50k]
  |  |  ------------------
  ------------------
  776|  7.76k|      if (av1_selfguided_restoration(
  ------------------
  |  Branch (776:11): [True: 0, False: 7.76k]
  ------------------
  777|  7.76k|              dat8_row + j, w, h, dat_stride, flt0_row + j, flt1_row + j,
  778|  7.76k|              flt_stride, sgr_params_idx, bit_depth, use_highbd) != 0) {
  779|      0|        aom_internal_error(
  780|      0|            error_info, AOM_CODEC_MEM_ERROR,
  781|      0|            "Error allocating buffer in av1_selfguided_restoration");
  782|      0|      }
  783|  7.76k|    }
  784|  4.50k|  }
  785|  3.01k|}
pickrst.c:get_proj_subspace:
  678|  3.01k|                                     const sgr_params_type *params) {
  679|  3.01k|  int64_t H[2][2] = { { 0, 0 }, { 0, 0 } };
  680|  3.01k|  int64_t C[2] = { 0, 0 };
  681|       |
  682|       |  // Default values to be returned if the problem becomes ill-posed
  683|  3.01k|  xq[0] = 0;
  684|  3.01k|  xq[1] = 0;
  685|       |
  686|  3.01k|  if (!use_highbitdepth) {
  ------------------
  |  Branch (686:7): [True: 1.68k, False: 1.33k]
  ------------------
  687|  1.68k|    if ((width & 0x7) == 0) {
  ------------------
  |  Branch (687:9): [True: 416, False: 1.26k]
  ------------------
  688|    416|      av1_calc_proj_params(src8, width, height, src_stride, dat8, dat_stride,
  689|    416|                           flt0, flt0_stride, flt1, flt1_stride, H, C, params);
  690|  1.26k|    } else {
  691|  1.26k|      av1_calc_proj_params_c(src8, width, height, src_stride, dat8, dat_stride,
  692|  1.26k|                             flt0, flt0_stride, flt1, flt1_stride, H, C,
  693|  1.26k|                             params);
  694|  1.26k|    }
  695|  1.68k|  }
  696|  1.33k|#if CONFIG_AV1_HIGHBITDEPTH
  697|  1.33k|  else {  // NOLINT
  698|  1.33k|    if ((width & 0x7) == 0) {
  ------------------
  |  Branch (698:9): [True: 148, False: 1.18k]
  ------------------
  699|    148|      av1_calc_proj_params_high_bd(src8, width, height, src_stride, dat8,
  700|    148|                                   dat_stride, flt0, flt0_stride, flt1,
  701|    148|                                   flt1_stride, H, C, params);
  702|  1.18k|    } else {
  703|  1.18k|      av1_calc_proj_params_high_bd_c(src8, width, height, src_stride, dat8,
  704|  1.18k|                                     dat_stride, flt0, flt0_stride, flt1,
  705|  1.18k|                                     flt1_stride, H, C, params);
  706|  1.18k|    }
  707|  1.33k|  }
  708|  3.01k|#endif
  709|       |
  710|  3.01k|  if (params->r[0] == 0) {
  ------------------
  |  Branch (710:7): [True: 0, False: 3.01k]
  ------------------
  711|       |    // H matrix is now only the scalar H[1][1]
  712|       |    // C vector is now only the scalar C[1]
  713|      0|    const int64_t Det = H[1][1];
  714|      0|    if (Det == 0) return;  // ill-posed, return default values
  ------------------
  |  Branch (714:9): [True: 0, False: 0]
  ------------------
  715|      0|    xq[0] = 0;
  716|      0|    xq[1] = (int)signed_rounded_divide(C[1] * (1 << SGRPROJ_PRJ_BITS), Det);
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
  717|  3.01k|  } else if (params->r[1] == 0) {
  ------------------
  |  Branch (717:14): [True: 0, False: 3.01k]
  ------------------
  718|       |    // H matrix is now only the scalar H[0][0]
  719|       |    // C vector is now only the scalar C[0]
  720|      0|    const int64_t Det = H[0][0];
  721|      0|    if (Det == 0) return;  // ill-posed, return default values
  ------------------
  |  Branch (721:9): [True: 0, False: 0]
  ------------------
  722|      0|    xq[0] = (int)signed_rounded_divide(C[0] * (1 << SGRPROJ_PRJ_BITS), Det);
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
  723|      0|    xq[1] = 0;
  724|  3.01k|  } else {
  725|  3.01k|    const int64_t Det = H[0][0] * H[1][1] - H[0][1] * H[1][0];
  726|  3.01k|    if (Det == 0) return;  // ill-posed, return default values
  ------------------
  |  Branch (726:9): [True: 349, False: 2.66k]
  ------------------
  727|       |
  728|       |    // If scaling up dividend would overflow, instead scale down the divisor
  729|  2.66k|    const int64_t div1 = H[1][1] * C[0] - H[0][1] * C[1];
  730|  2.66k|    if ((div1 > 0 && INT64_MAX / (1 << SGRPROJ_PRJ_BITS) < div1) ||
  ------------------
  |  |   99|  1.13k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  |  Branch (730:10): [True: 1.13k, False: 1.53k]
  |  Branch (730:22): [True: 0, False: 1.13k]
  ------------------
  731|  2.66k|        (div1 < 0 && INT64_MIN / (1 << SGRPROJ_PRJ_BITS) > div1))
  ------------------
  |  |   99|  1.43k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  |  Branch (731:10): [True: 1.43k, False: 1.23k]
  |  Branch (731:22): [True: 0, False: 1.43k]
  ------------------
  732|      0|      xq[0] = (int)signed_rounded_divide(div1, Det / (1 << SGRPROJ_PRJ_BITS));
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
  733|  2.66k|    else
  734|  2.66k|      xq[0] = (int)signed_rounded_divide(div1 * (1 << SGRPROJ_PRJ_BITS), Det);
  ------------------
  |  |   99|  2.66k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  735|       |
  736|  2.66k|    const int64_t div2 = H[0][0] * C[1] - H[1][0] * C[0];
  737|  2.66k|    if ((div2 > 0 && INT64_MAX / (1 << SGRPROJ_PRJ_BITS) < div2) ||
  ------------------
  |  |   99|    735|#define SGRPROJ_PRJ_BITS 7
  ------------------
  |  Branch (737:10): [True: 735, False: 1.92k]
  |  Branch (737:22): [True: 0, False: 735]
  ------------------
  738|  2.66k|        (div2 < 0 && INT64_MIN / (1 << SGRPROJ_PRJ_BITS) > div2))
  ------------------
  |  |   99|  1.83k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  |  Branch (738:10): [True: 1.83k, False: 825]
  |  Branch (738:22): [True: 0, False: 1.83k]
  ------------------
  739|      0|      xq[1] = (int)signed_rounded_divide(div2, Det / (1 << SGRPROJ_PRJ_BITS));
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
  740|  2.66k|    else
  741|  2.66k|      xq[1] = (int)signed_rounded_divide(div2 * (1 << SGRPROJ_PRJ_BITS), Det);
  ------------------
  |  |   99|  2.66k|#define SGRPROJ_PRJ_BITS 7
  ------------------
  742|  2.66k|  }
  743|  3.01k|}
pickrst.c:signed_rounded_divide:
  468|  5.32k|static int64_t signed_rounded_divide(int64_t dividend, int64_t divisor) {
  469|  5.32k|  if (dividend < 0)
  ------------------
  |  Branch (469:7): [True: 3.27k, False: 2.05k]
  ------------------
  470|  3.27k|    return (dividend - divisor / 2) / divisor;
  471|  2.05k|  else
  472|  2.05k|    return (dividend + divisor / 2) / divisor;
  473|  5.32k|}
pickrst.c:encode_xq:
  745|  3.01k|static inline void encode_xq(int *xq, int *xqd, const sgr_params_type *params) {
  746|  3.01k|  if (params->r[0] == 0) {
  ------------------
  |  Branch (746:7): [True: 0, False: 3.01k]
  ------------------
  747|      0|    xqd[0] = 0;
  748|      0|    xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xq[1], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
                  xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xq[1], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  749|      0|                   SGRPROJ_PRJ_MAX1);
  ------------------
  |  |  109|      0|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  750|  3.01k|  } else if (params->r[1] == 0) {
  ------------------
  |  Branch (750:14): [True: 0, False: 3.01k]
  ------------------
  751|      0|    xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0);
  ------------------
  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                  xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0);
  ------------------
  |  |  107|      0|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|      0|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  752|      0|    xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  ------------------
                  xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  753|      0|                   SGRPROJ_PRJ_MAX1);
  ------------------
  |  |  109|      0|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|      0|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|      0|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  754|  3.01k|  } else {
  755|  3.01k|    xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0);
  ------------------
  |  |  106|  3.01k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                  xqd[0] = clamp(xq[0], SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MAX0);
  ------------------
  |  |  107|  3.01k|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|  3.01k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  756|  3.01k|    xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0] - xq[1], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  ------------------
                  xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xqd[0] - xq[1], SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|  3.01k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  757|  3.01k|                   SGRPROJ_PRJ_MAX1);
  ------------------
  |  |  109|  3.01k|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|  3.01k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  758|  3.01k|  }
  759|  3.01k|}
pickrst.c:finer_search_pixel_proj_error:
  411|  3.01k|    const sgr_params_type *params) {
  412|  3.01k|  int64_t err = get_pixel_proj_error(
  413|  3.01k|      src8, width, height, src_stride, dat8, dat_stride, use_highbitdepth, flt0,
  414|  3.01k|      flt0_stride, flt1, flt1_stride, xqd, params);
  415|  3.01k|  (void)start_step;
  416|  3.01k|#if USE_SGRPROJ_REFINEMENT_SEARCH
  417|  3.01k|  int64_t err2;
  418|  3.01k|  int tap_min[] = { SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MIN1 };
  ------------------
  |  |  106|  3.01k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                int tap_min[] = { SGRPROJ_PRJ_MIN0, SGRPROJ_PRJ_MIN1 };
  ------------------
  |  |  108|  3.01k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  419|  3.01k|  int tap_max[] = { SGRPROJ_PRJ_MAX0, SGRPROJ_PRJ_MAX1 };
  ------------------
  |  |  107|  3.01k|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|  3.01k|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                int tap_max[] = { SGRPROJ_PRJ_MAX0, SGRPROJ_PRJ_MAX1 };
  ------------------
  |  |  109|  3.01k|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|  3.01k|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|  3.01k|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  420|  9.03k|  for (int s = start_step; s >= 1; s >>= 1) {
  ------------------
  |  Branch (420:28): [True: 6.02k, False: 3.01k]
  ------------------
  421|  11.4k|    for (int p = 0; p < 2; ++p) {
  ------------------
  |  Branch (421:21): [True: 9.61k, False: 1.83k]
  ------------------
  422|  9.61k|      if ((params->r[0] == 0 && p == 0) || (params->r[1] == 0 && p == 1)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 9.61k]
  |  Branch (422:33): [True: 0, False: 0]
  |  Branch (422:45): [True: 0, False: 9.61k]
  |  Branch (422:66): [True: 0, False: 0]
  ------------------
  423|      0|        continue;
  424|      0|      }
  425|  9.61k|      int skip = 0;
  426|  44.0k|      do {
  427|  44.0k|        if (xqd[p] - s >= tap_min[p]) {
  ------------------
  |  Branch (427:13): [True: 41.0k, False: 3.04k]
  ------------------
  428|  41.0k|          xqd[p] -= s;
  429|  41.0k|          err2 =
  430|  41.0k|              get_pixel_proj_error(src8, width, height, src_stride, dat8,
  431|  41.0k|                                   dat_stride, use_highbitdepth, flt0,
  432|  41.0k|                                   flt0_stride, flt1, flt1_stride, xqd, params);
  433|  41.0k|          if (err2 > err) {
  ------------------
  |  Branch (433:15): [True: 4.34k, False: 36.6k]
  ------------------
  434|  4.34k|            xqd[p] += s;
  435|  36.6k|          } else {
  436|  36.6k|            err = err2;
  437|  36.6k|            skip = 1;
  438|       |            // At the highest step size continue moving in the same direction
  439|  36.6k|            if (s == start_step) continue;
  ------------------
  |  Branch (439:17): [True: 34.4k, False: 2.21k]
  ------------------
  440|  36.6k|          }
  441|  41.0k|        }
  442|  9.61k|        break;
  443|  44.0k|      } while (1);
  ------------------
  |  Branch (443:16): [True: 34.4k, Folded]
  ------------------
  444|  9.61k|      if (skip) break;
  ------------------
  |  Branch (444:11): [True: 4.18k, False: 5.42k]
  ------------------
  445|  24.9k|      do {
  446|  24.9k|        if (xqd[p] + s <= tap_max[p]) {
  ------------------
  |  Branch (446:13): [True: 23.4k, False: 1.51k]
  ------------------
  447|  23.4k|          xqd[p] += s;
  448|  23.4k|          err2 =
  449|  23.4k|              get_pixel_proj_error(src8, width, height, src_stride, dat8,
  450|  23.4k|                                   dat_stride, use_highbitdepth, flt0,
  451|  23.4k|                                   flt0_stride, flt1, flt1_stride, xqd, params);
  452|  23.4k|          if (err2 > err) {
  ------------------
  |  Branch (452:15): [True: 2.83k, False: 20.6k]
  ------------------
  453|  2.83k|            xqd[p] -= s;
  454|  20.6k|          } else {
  455|  20.6k|            err = err2;
  456|       |            // At the highest step size continue moving in the same direction
  457|  20.6k|            if (s == start_step) continue;
  ------------------
  |  Branch (457:17): [True: 19.5k, False: 1.07k]
  ------------------
  458|  20.6k|          }
  459|  23.4k|        }
  460|  5.42k|        break;
  461|  24.9k|      } while (1);
  ------------------
  |  Branch (461:16): [True: 19.5k, Folded]
  ------------------
  462|  5.42k|    }
  463|  6.02k|  }
  464|  3.01k|#endif  // USE_SGRPROJ_REFINEMENT_SEARCH
  465|  3.01k|  return err;
  466|  3.01k|}
pickrst.c:get_pixel_proj_error:
  383|  67.4k|                                    const sgr_params_type *params) {
  384|  67.4k|  int xq[2];
  385|  67.4k|  av1_decode_xq(xqd, xq, params);
  386|       |
  387|  67.4k|#if CONFIG_AV1_HIGHBITDEPTH
  388|  67.4k|  if (use_highbitdepth) {
  ------------------
  |  Branch (388:7): [True: 20.2k, False: 47.2k]
  ------------------
  389|  20.2k|    return av1_highbd_pixel_proj_error(src8, width, height, src_stride, dat8,
  390|  20.2k|                                       dat_stride, flt0, flt0_stride, flt1,
  391|  20.2k|                                       flt1_stride, xq, params);
  392|       |
  393|  47.2k|  } else {
  394|  47.2k|    return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8,
  395|  47.2k|                                      dat_stride, flt0, flt0_stride, flt1,
  396|  47.2k|                                      flt1_stride, xq, params);
  397|  47.2k|  }
  398|       |#else
  399|       |  (void)use_highbitdepth;
  400|       |  return av1_lowbd_pixel_proj_error(src8, width, height, src_stride, dat8,
  401|       |                                    dat_stride, flt0, flt0_stride, flt1,
  402|       |                                    flt1_stride, xq, params);
  403|       |#endif
  404|  67.4k|}
pickrst.c:get_best_error:
  809|  3.01k|                                  const int ep) {
  810|  3.01k|  if (*besterr == -1 || err < *besterr) {
  ------------------
  |  Branch (810:7): [True: 753, False: 2.25k]
  |  Branch (810:25): [True: 1.46k, False: 792]
  ------------------
  811|  2.22k|    *bestep = ep;
  812|  2.22k|    *besterr = err;
  813|  2.22k|    bestxqd[0] = exqd[0];
  814|  2.22k|    bestxqd[1] = exqd[1];
  815|  2.22k|  }
  816|  3.01k|}
pickrst.c:count_sgrproj_bits:
  883|    772|                              SgrprojInfo *ref_sgrproj_info) {
  884|    772|  int bits = SGRPROJ_PARAMS_BITS;
  ------------------
  |  |   95|    772|#define SGRPROJ_PARAMS_BITS 4
  ------------------
  885|    772|  const sgr_params_type *params = &av1_sgr_params[sgrproj_info->ep];
  886|    772|  if (params->r[0] > 0)
  ------------------
  |  Branch (886:7): [True: 772, False: 0]
  ------------------
  887|    772|    bits += aom_count_primitive_refsubexpfin(
  888|    772|        SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  107|    772|#define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  106|    772|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX0 (SGRPROJ_PRJ_MIN0 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  106|    772|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      SGRPROJ_PRJ_MAX0 - SGRPROJ_PRJ_MIN0 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|    772|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
  889|    772|        ref_sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0,
  ------------------
  |  |  106|    772|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  890|    772|        sgrproj_info->xqd[0] - SGRPROJ_PRJ_MIN0);
  ------------------
  |  |  106|    772|#define SGRPROJ_PRJ_MIN0 (-(1 << SGRPROJ_PRJ_BITS) * 3 / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  891|    772|  if (params->r[1] > 0)
  ------------------
  |  Branch (891:7): [True: 772, False: 0]
  ------------------
  892|    772|    bits += aom_count_primitive_refsubexpfin(
  893|    772|        SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  109|    772|#define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |  108|    772|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SGRPROJ_PRJ_MAX1 (SGRPROJ_PRJ_MIN1 + (1 << SGRPROJ_PRJ_BITS) - 1)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  108|    772|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
                      SGRPROJ_PRJ_MAX1 - SGRPROJ_PRJ_MIN1 + 1, SGRPROJ_PRJ_SUBEXP_K,
  ------------------
  |  |  111|    772|#define SGRPROJ_PRJ_SUBEXP_K 4
  ------------------
  894|    772|        ref_sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1,
  ------------------
  |  |  108|    772|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  895|    772|        sgrproj_info->xqd[1] - SGRPROJ_PRJ_MIN1);
  ------------------
  |  |  108|    772|#define SGRPROJ_PRJ_MIN1 (-(1 << SGRPROJ_PRJ_BITS) / 4)
  |  |  ------------------
  |  |  |  |   99|    772|#define SGRPROJ_PRJ_BITS 7
  |  |  ------------------
  ------------------
  896|    772|  return bits;
  897|    772|}
pickrst.c:search_switchable:
 1775|     34|    struct aom_internal_error_info *error_info) {
 1776|     34|  (void)limits;
 1777|     34|  (void)tmpbuf;
 1778|     34|  (void)rlbs;
 1779|     34|  (void)error_info;
 1780|     34|  RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
 1781|     34|  RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx];
 1782|       |
 1783|     34|  const MACROBLOCK *const x = rsc->x;
 1784|       |
 1785|     34|  const int wiener_win =
 1786|     34|      (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  281|     34|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                    (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  121|     30|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|     30|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
                    (rsc->plane == AOM_PLANE_Y) ? WIENER_WIN : WIENER_WIN_CHROMA;
  ------------------
  |  |  128|      4|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|      4|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      4|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1786:7): [True: 30, False: 4]
  ------------------
 1787|       |
 1788|     34|  double best_cost = 0;
 1789|     34|  int64_t best_bits = 0;
 1790|     34|  RestorationType best_rtype = RESTORE_NONE;
 1791|       |
 1792|    136|  for (RestorationType r = 0; r < RESTORE_SWITCHABLE_TYPES; ++r) {
  ------------------
  |  Branch (1792:31): [True: 102, False: 34]
  ------------------
 1793|       |    // If this restoration mode was skipped, or could not find a solution
 1794|       |    // that was better than RESTORE_NONE, then we can't select it here either.
 1795|       |    //
 1796|       |    // Note: It is possible for the restoration search functions to find a
 1797|       |    // filter which is better than RESTORE_NONE when looking purely at SSE, but
 1798|       |    // for it to be rejected overall due to its rate cost. In this case, there
 1799|       |    // is a chance that it may be have a lower rate cost when looking at
 1800|       |    // RESTORE_SWITCHABLE, and so it might be acceptable here.
 1801|       |    //
 1802|       |    // Therefore we prune based on SSE, rather than on whether or not the
 1803|       |    // previous search function selected this mode.
 1804|    102|    if (r > RESTORE_NONE) {
  ------------------
  |  Branch (1804:9): [True: 68, False: 34]
  ------------------
 1805|     68|      if (rsc->sse[r] > rsc->sse[RESTORE_NONE]) continue;
  ------------------
  |  Branch (1805:11): [True: 27, False: 41]
  ------------------
 1806|     68|    }
 1807|       |
 1808|     75|    const int64_t sse = rsc->sse[r];
 1809|     75|    int64_t coeff_pcost = 0;
 1810|     75|    switch (r) {
 1811|     34|      case RESTORE_NONE: coeff_pcost = 0; break;
  ------------------
  |  Branch (1811:7): [True: 34, False: 41]
  ------------------
 1812|     22|      case RESTORE_WIENER:
  ------------------
  |  Branch (1812:7): [True: 22, False: 53]
  ------------------
 1813|     22|        coeff_pcost = count_wiener_bits(wiener_win, &rusi->wiener,
 1814|     22|                                        &rsc->switchable_ref_wiener);
 1815|     22|        break;
 1816|     19|      case RESTORE_SGRPROJ:
  ------------------
  |  Branch (1816:7): [True: 19, False: 56]
  ------------------
 1817|     19|        coeff_pcost =
 1818|     19|            count_sgrproj_bits(&rusi->sgrproj, &rsc->switchable_ref_sgrproj);
 1819|     19|        break;
 1820|      0|      default: assert(0); break;
  ------------------
  |  Branch (1820:7): [True: 0, False: 75]
  ------------------
 1821|     75|    }
 1822|     75|    const int64_t coeff_bits = coeff_pcost << AV1_PROB_COST_SHIFT;
  ------------------
  |  |   25|     75|#define AV1_PROB_COST_SHIFT 9
  ------------------
 1823|     75|    const int64_t bits = x->mode_costs.switchable_restore_cost[r] + coeff_bits;
 1824|     75|    double cost = RDCOST_DBL_WITH_NATIVE_BD_DIST(
  ------------------
  |  |   41|     75|  (((((double)(R)) * (RM)) / (double)(1 << AV1_PROB_COST_SHIFT)) + \
  |  |  ------------------
  |  |  |  |   25|     75|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  |  |   42|     75|   ((double)((D) >> (2 * (BD - 8))) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|     75|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1825|     75|        x->rdmult, bits >> 4, sse, rsc->cm->seq_params->bit_depth);
 1826|     75|    if (r == RESTORE_SGRPROJ && rusi->sgrproj.ep < 10)
  ------------------
  |  Branch (1826:9): [True: 19, False: 56]
  |  Branch (1826:33): [True: 19, False: 0]
  ------------------
 1827|     19|      cost *= (1 + DUAL_SGR_PENALTY_MULT * rsc->lpf_sf->dual_sgr_penalty_level);
  ------------------
  |  |   39|     19|#define DUAL_SGR_PENALTY_MULT 0.01
  ------------------
 1828|       |
 1829|     75|    if (r == RESTORE_WIENER || r == RESTORE_SGRPROJ)
  ------------------
  |  Branch (1829:9): [True: 22, False: 53]
  |  Branch (1829:32): [True: 19, False: 34]
  ------------------
 1830|     41|      cost *= (1 + WIENER_SGR_PENALTY_MULT *
  ------------------
  |  |   42|     41|#define WIENER_SGR_PENALTY_MULT 0.005
  ------------------
 1831|     41|                       rsc->lpf_sf->switchable_lr_with_bias_level);
 1832|     75|    if (r == 0 || cost < best_cost) {
  ------------------
  |  Branch (1832:9): [True: 34, False: 41]
  |  Branch (1832:19): [True: 20, False: 21]
  ------------------
 1833|     54|      best_cost = cost;
 1834|     54|      best_bits = bits;
 1835|     54|      best_rtype = r;
 1836|     54|    }
 1837|     75|  }
 1838|       |
 1839|     34|  rusi->best_rtype[RESTORE_SWITCHABLE - 1] = best_rtype;
 1840|       |
 1841|       |#if DEBUG_LR_COSTING
 1842|       |  // Store ref params for later checking
 1843|       |  lr_ref_params[RESTORE_SWITCHABLE][rsc->plane][rest_unit_idx].wiener_info =
 1844|       |      rsc->switchable_ref_wiener;
 1845|       |  lr_ref_params[RESTORE_SWITCHABLE][rsc->plane][rest_unit_idx].sgrproj_info =
 1846|       |      rsc->switchable_ref_sgrproj;
 1847|       |#endif  // DEBUG_LR_COSTING
 1848|       |
 1849|     34|  rsc->total_sse[RESTORE_SWITCHABLE] += rsc->sse[best_rtype];
 1850|     34|  rsc->total_bits[RESTORE_SWITCHABLE] += best_bits;
 1851|     34|  if (best_rtype == RESTORE_WIENER) rsc->switchable_ref_wiener = rusi->wiener;
  ------------------
  |  Branch (1851:7): [True: 18, False: 16]
  ------------------
 1852|     34|  if (best_rtype == RESTORE_SGRPROJ)
  ------------------
  |  Branch (1852:7): [True: 1, False: 33]
  ------------------
 1853|      1|    rsc->switchable_ref_sgrproj = rusi->sgrproj;
 1854|     34|}
pickrst.c:reset_rsc:
  170|  12.0k|static inline void reset_rsc(RestSearchCtxt *rsc) {
  171|  12.0k|  memset(rsc->total_sse, 0, sizeof(rsc->total_sse));
  172|  12.0k|  memset(rsc->total_bits, 0, sizeof(rsc->total_bits));
  173|  12.0k|}
pickrst.c:rsc_on_tile:
  162|  15.5k|static inline void rsc_on_tile(void *priv) {
  163|  15.5k|  RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
  164|  15.5k|  set_default_wiener(&rsc->ref_wiener);
  165|  15.5k|  set_default_sgrproj(&rsc->ref_sgrproj);
  166|  15.5k|  set_default_wiener(&rsc->switchable_ref_wiener);
  167|  15.5k|  set_default_sgrproj(&rsc->switchable_ref_sgrproj);
  168|  15.5k|}
pickrst.c:copy_unit_info:
 1858|    882|                                  RestorationUnitInfo *rui) {
 1859|    882|  assert(frame_rtype > 0);
 1860|    882|  rui->restoration_type = rusi->best_rtype[frame_rtype - 1];
 1861|    882|  if (rui->restoration_type == RESTORE_WIENER)
  ------------------
  |  Branch (1861:7): [True: 795, False: 87]
  ------------------
 1862|    795|    rui->wiener_info = rusi->wiener;
 1863|     87|  else
 1864|     87|    rui->sgrproj_info = rusi->sgrproj;
 1865|    882|}

pickrst_avx2.c:find_average_highbd:
   75|  2.04k|                                           int stride) {
   76|  2.04k|  uint64_t sum = 0;
   77|  57.2k|  for (int i = v_start; i < v_end; i++) {
  ------------------
  |  Branch (77:25): [True: 55.1k, False: 2.04k]
  ------------------
   78|   768k|    for (int j = h_start; j < h_end; j++) {
  ------------------
  |  Branch (78:27): [True: 713k, False: 55.1k]
  ------------------
   79|   713k|      sum += src[i * stride + j];
   80|   713k|    }
   81|  55.1k|  }
   82|  2.04k|  uint64_t avg = sum / ((v_end - v_start) * (h_end - h_start));
   83|  2.04k|  return (uint16_t)avg;
   84|  2.04k|}

palette.c:lcg_rand16:
   31|   360k|static inline uint32_t lcg_rand16(uint32_t *state) {
   32|   360k|  return (lcg_next(state) / 65536) % 32768;
   33|   360k|}
palette.c:lcg_next:
   25|   360k|static inline uint32_t lcg_next(uint32_t *state) {
   26|   360k|  *state = (uint32_t)(*state * 1103515245ULL + 12345);
   27|   360k|  return *state;
   28|   360k|}
ransac.c:lcg_pick:
   59|  5.38k|static inline void lcg_pick(int n, int k, int *out, unsigned int *seed) {
   60|  5.38k|  assert(0 <= k && k <= n);
   61|  16.1k|  for (int i = 0; i < k; i++) {
  ------------------
  |  Branch (61:19): [True: 10.7k, False: 5.39k]
  ------------------
   62|  10.7k|    int v;
   63|       |
   64|       |  // Inner resampling loop
   65|       |  // We have to use a goto here because C does not have a multi-level continue
   66|       |  // statement
   67|  11.0k|  resample:
   68|  11.0k|    v = (int)lcg_randint(seed, n);
   69|  16.4k|    for (int j = 0; j < i; j++) {
  ------------------
  |  Branch (69:21): [True: 5.68k, False: 10.7k]
  ------------------
   70|  5.68k|      if (v == out[j]) {
  ------------------
  |  Branch (70:11): [True: 318, False: 5.36k]
  ------------------
   71|       |        // Repeated v, resample
   72|    318|        goto resample;
   73|    318|      }
   74|  5.68k|    }
   75|       |
   76|       |    // New v, accept
   77|  10.7k|    out[i] = v;
   78|  10.7k|  }
   79|  5.38k|}
ransac.c:lcg_randint:
   40|  11.0k|static inline uint32_t lcg_randint(uint32_t *state, uint32_t n) {
   41|  11.0k|  uint64_t v = ((uint64_t)lcg_next(state) * n) >> 32;
   42|  11.0k|  return (uint32_t)v;
   43|  11.0k|}
ransac.c:lcg_next:
   25|  11.0k|static inline uint32_t lcg_next(uint32_t *state) {
   26|  11.0k|  *state = (uint32_t)(*state * 1103515245ULL + 12345);
   27|  11.0k|  return *state;
   28|  11.0k|}

av1_rc_init_minq_luts:
  194|  18.4k|void av1_rc_init_minq_luts(void) { aom_once(rc_init_minq_luts); }
av1_convert_qindex_to_q:
  199|  13.7M|double av1_convert_qindex_to_q(int qindex, aom_bit_depth_t bit_depth) {
  200|       |  // Convert the index to a real Q value (scaled down to match old Q values)
  201|  13.7M|  switch (bit_depth) {
  202|  10.7M|    case AOM_BITS_8: return av1_ac_quant_QTX(qindex, 0, bit_depth) / 4.0;
  ------------------
  |  Branch (202:5): [True: 10.7M, False: 3.01M]
  ------------------
  203|  1.47M|    case AOM_BITS_10: return av1_ac_quant_QTX(qindex, 0, bit_depth) / 16.0;
  ------------------
  |  Branch (203:5): [True: 1.47M, False: 12.2M]
  ------------------
  204|  1.54M|    case AOM_BITS_12: return av1_ac_quant_QTX(qindex, 0, bit_depth) / 64.0;
  ------------------
  |  Branch (204:5): [True: 1.54M, False: 12.1M]
  ------------------
  205|      0|    default:
  ------------------
  |  Branch (205:5): [True: 0, False: 13.7M]
  ------------------
  206|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  207|      0|      return -1.0;
  208|  13.7M|  }
  209|  13.7M|}
av1_convert_q_to_qindex:
  211|  93.8k|int av1_convert_q_to_qindex(double q, aom_bit_depth_t bit_depth) {
  212|  93.8k|  int qindex = MINQ;
  ------------------
  |  |   25|  93.8k|#define MINQ 0
  ------------------
  213|       |
  214|       |  // Find the first qindex that matches or exceeds q.
  215|       |  // Note: this operation can also be done with a binary search, as
  216|       |  // av1_convert_qindex_to_q() is monotonically increasing with respect to
  217|       |  // increasing qindex.
  218|  13.1M|  while (qindex < MAXQ && av1_convert_qindex_to_q(qindex, bit_depth) < q) {
  ------------------
  |  |   26|  26.2M|#define MAXQ 255
  ------------------
  |  Branch (218:10): [True: 13.1M, False: 2.64k]
  |  Branch (218:27): [True: 13.0M, False: 90.8k]
  ------------------
  219|  13.0M|    qindex++;
  220|  13.0M|  }
  221|       |
  222|  93.8k|  return qindex;
  223|  93.8k|}
av1_rc_bits_per_mb:
  274|   309k|                       double correction_factor, int accurate_estimate) {
  275|   309k|  const AV1_COMMON *const cm = &cpi->common;
  276|   309k|  const int is_screen_content_type = cpi->is_screen_content_type;
  277|   309k|  const aom_bit_depth_t bit_depth = cm->seq_params->bit_depth;
  278|   309k|  const double q = av1_convert_qindex_to_q(qindex, bit_depth);
  279|   309k|  int enumerator = get_bpmb_enumerator(frame_type, is_screen_content_type);
  280|       |
  281|   309k|  assert(correction_factor <= MAX_BPB_FACTOR &&
  282|   309k|         correction_factor >= MIN_BPB_FACTOR);
  283|       |
  284|   309k|  if (cpi->oxcf.rc_cfg.mode == AOM_CBR && frame_type != KEY_FRAME &&
  ------------------
  |  Branch (284:7): [True: 259k, False: 49.2k]
  |  Branch (284:43): [True: 144k, False: 115k]
  ------------------
  285|   144k|      accurate_estimate && cpi->rec_sse != UINT64_MAX) {
  ------------------
  |  Branch (285:7): [True: 0, False: 144k]
  |  Branch (285:28): [True: 0, False: 0]
  ------------------
  286|      0|    const int mbs = cm->mi_params.MBs;
  287|      0|    const double sse_sqrt =
  288|      0|        (double)((int)sqrt((double)(cpi->rec_sse)) << BPER_MB_NORMBITS) /
  ------------------
  |  |   30|      0|#define BPER_MB_NORMBITS 9
  ------------------
  289|      0|        (double)mbs;
  290|      0|    const int ratio = (cpi->rc.bit_est_ratio == 0) ? get_init_ratio(sse_sqrt)
  ------------------
  |  Branch (290:23): [True: 0, False: 0]
  ------------------
  291|      0|                                                   : cpi->rc.bit_est_ratio;
  292|       |    // Clamp the enumerator to lower the q fluctuations.
  293|      0|    enumerator = clamp((int)(ratio * sse_sqrt), 20000, 170000);
  294|   309k|  } else if (cpi->oxcf.rc_cfg.mode == AOM_CBR && frame_type == KEY_FRAME &&
  ------------------
  |  Branch (294:14): [True: 259k, False: 49.2k]
  |  Branch (294:50): [True: 115k, False: 144k]
  ------------------
  295|   115k|             cpi->sf.rt_sf.rc_adjust_keyframe && bit_depth == 8 &&
  ------------------
  |  Branch (295:14): [True: 0, False: 115k]
  |  Branch (295:50): [True: 0, False: 0]
  ------------------
  296|      0|             cpi->oxcf.rc_cfg.max_intra_bitrate_pct > 0 &&
  ------------------
  |  Branch (296:14): [True: 0, False: 0]
  ------------------
  297|      0|             cpi->svc.spatial_layer_id == 0) {
  ------------------
  |  Branch (297:14): [True: 0, False: 0]
  ------------------
  298|      0|    enumerator = adjust_rtc_keyframe(&cpi->rc, enumerator);
  299|      0|  }
  300|       |  // q based adjustment to baseline enumerator
  301|   309k|  return (int)(enumerator * correction_factor / q);
  302|   309k|}
av1_estimate_bits_at_q:
  305|  73.6k|                           double correction_factor) {
  306|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
  307|  73.6k|  const FRAME_TYPE frame_type = cm->current_frame.frame_type;
  308|  73.6k|  const int mbs = cm->mi_params.MBs;
  309|  73.6k|  const int bpm =
  310|  73.6k|      (int)(av1_rc_bits_per_mb(cpi, frame_type, q, correction_factor,
  311|  73.6k|                               cpi->sf.hl_sf.accurate_bit_estimate));
  312|  73.6k|  return AOMMAX(FRAME_OVERHEAD_BITS,
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 29.2k, False: 44.3k]
  |  |  ------------------
  ------------------
  313|  73.6k|                (int)((uint64_t)bpm * mbs) >> BPER_MB_NORMBITS);
  314|  73.6k|}
av1_rc_get_default_min_gf_interval:
  432|   266k|                                       double framerate) {
  433|       |  // Assume we do not need any constraint lower than 4K 20 fps
  434|   266k|  static const double factor_safe = 3840 * 2160 * 20.0;
  435|   266k|  const double factor = (double)width * height * framerate;
  436|   266k|  const int default_interval =
  437|   266k|      clamp((int)(framerate * 0.125), MIN_GF_INTERVAL, MAX_GF_INTERVAL);
  ------------------
  |  |   44|   266k|#define MIN_GF_INTERVAL 4
  ------------------
                    clamp((int)(framerate * 0.125), MIN_GF_INTERVAL, MAX_GF_INTERVAL);
  ------------------
  |  |   45|   266k|#define MAX_GF_INTERVAL 32
  ------------------
  438|       |
  439|   266k|  if (factor <= factor_safe)
  ------------------
  |  Branch (439:7): [True: 266k, False: 0]
  ------------------
  440|   266k|    return default_interval;
  441|      0|  else
  442|      0|    return AOMMAX(default_interval,
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  443|   266k|                  (int)(MIN_GF_INTERVAL * factor / factor_safe + 0.5));
  444|       |  // Note this logic makes:
  445|       |  // 4K24: 5
  446|       |  // 4K30: 6
  447|       |  // 4K60: 12
  448|   266k|}
av1_primary_rc_init:
  461|  18.4k|                         PRIMARY_RATE_CONTROL *p_rc) {
  462|  18.4k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
  463|       |
  464|  18.4k|  int worst_allowed_q = rc_cfg->worst_allowed_q;
  465|       |
  466|  18.4k|  int min_gf_interval = oxcf->gf_cfg.min_gf_interval;
  467|  18.4k|  int max_gf_interval = oxcf->gf_cfg.max_gf_interval;
  468|  18.4k|  if (min_gf_interval == 0)
  ------------------
  |  Branch (468:7): [True: 18.4k, False: 0]
  ------------------
  469|  18.4k|    min_gf_interval = av1_rc_get_default_min_gf_interval(
  470|  18.4k|        oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height,
  471|  18.4k|        oxcf->input_cfg.init_framerate);
  472|  18.4k|  if (max_gf_interval == 0)
  ------------------
  |  Branch (472:7): [True: 18.4k, False: 0]
  ------------------
  473|  18.4k|    max_gf_interval = get_default_max_gf_interval(
  474|  18.4k|        oxcf->input_cfg.init_framerate, min_gf_interval);
  475|  18.4k|  p_rc->baseline_gf_interval = (min_gf_interval + max_gf_interval) / 2;
  476|  18.4k|  p_rc->this_key_frame_forced = 0;
  477|  18.4k|  p_rc->next_key_frame_forced = 0;
  478|  18.4k|  p_rc->ni_frames = 0;
  479|       |
  480|  18.4k|  p_rc->tot_q = 0.0;
  481|  18.4k|  p_rc->total_actual_bits = 0;
  482|  18.4k|  p_rc->total_target_bits = 0;
  483|  18.4k|  p_rc->buffer_level = p_rc->starting_buffer_level;
  484|       |
  485|  18.4k|  if (oxcf->target_seq_level_idx[0] < SEQ_LEVELS) {
  ------------------
  |  Branch (485:7): [True: 0, False: 18.4k]
  ------------------
  486|      0|    worst_allowed_q = 255;
  487|      0|  }
  488|  18.4k|  if (oxcf->pass == AOM_RC_ONE_PASS && rc_cfg->mode == AOM_CBR) {
  ------------------
  |  Branch (488:7): [True: 18.4k, False: 0]
  |  Branch (488:40): [True: 6.10k, False: 12.3k]
  ------------------
  489|  6.10k|    p_rc->avg_frame_qindex[KEY_FRAME] = worst_allowed_q;
  490|  6.10k|    p_rc->avg_frame_qindex[INTER_FRAME] = worst_allowed_q;
  491|  12.3k|  } else {
  492|  12.3k|    p_rc->avg_frame_qindex[KEY_FRAME] =
  493|  12.3k|        (worst_allowed_q + rc_cfg->best_allowed_q) / 2;
  494|  12.3k|    p_rc->avg_frame_qindex[INTER_FRAME] =
  495|  12.3k|        (worst_allowed_q + rc_cfg->best_allowed_q) / 2;
  496|  12.3k|  }
  497|  18.4k|  p_rc->avg_q = av1_convert_qindex_to_q(rc_cfg->worst_allowed_q,
  498|  18.4k|                                        oxcf->tool_cfg.bit_depth);
  499|  18.4k|  p_rc->last_q[KEY_FRAME] = rc_cfg->best_allowed_q;
  500|  18.4k|  p_rc->last_q[INTER_FRAME] = rc_cfg->worst_allowed_q;
  501|       |
  502|  92.0k|  for (int i = 0; i < RATE_FACTOR_LEVELS; ++i) {
  ------------------
  |  Branch (502:19): [True: 73.6k, False: 18.4k]
  ------------------
  503|  73.6k|    p_rc->rate_correction_factors[i] = 0.7;
  504|  73.6k|  }
  505|  18.4k|  p_rc->rate_correction_factors[KF_STD] = 1.0;
  506|  18.4k|  p_rc->bits_off_target = p_rc->starting_buffer_level;
  507|       |
  508|  18.4k|  const double bits_per_frame =
  509|  18.4k|      oxcf->rc_cfg.target_bandwidth / oxcf->input_cfg.init_framerate;
  510|  18.4k|  p_rc->rolling_target_bits =
  511|  18.4k|      AOMMAX(1, bits_per_frame > INT_MAX ? INT_MAX : (int)bits_per_frame);
  ------------------
  |  |   35|  36.8k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 18.4k]
  |  |  |  Branch (35:31): [True: 0, False: 18.4k]
  |  |  |  Branch (35:44): [True: 0, False: 18.4k]
  |  |  ------------------
  ------------------
  512|  18.4k|  p_rc->rolling_actual_bits = p_rc->rolling_target_bits;
  513|  18.4k|}
av1_rc_init:
  515|  18.4k|void av1_rc_init(const AV1EncoderConfig *oxcf, RATE_CONTROL *rc) {
  516|  18.4k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
  517|       |
  518|  18.4k|  rc->frames_since_key = 8;  // Sensible default for first frame.
  519|  18.4k|  rc->frames_to_fwd_kf = oxcf->kf_cfg.fwd_kf_dist;
  520|       |
  521|  18.4k|  rc->frames_till_gf_update_due = 0;
  522|  18.4k|  rc->ni_av_qi = rc_cfg->worst_allowed_q;
  523|  18.4k|  rc->ni_tot_qi = 0;
  524|       |
  525|  18.4k|  rc->min_gf_interval = oxcf->gf_cfg.min_gf_interval;
  526|  18.4k|  rc->max_gf_interval = oxcf->gf_cfg.max_gf_interval;
  527|  18.4k|  if (rc->min_gf_interval == 0)
  ------------------
  |  Branch (527:7): [True: 18.4k, False: 0]
  ------------------
  528|  18.4k|    rc->min_gf_interval = av1_rc_get_default_min_gf_interval(
  529|  18.4k|        oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height,
  530|  18.4k|        oxcf->input_cfg.init_framerate);
  531|  18.4k|  if (rc->max_gf_interval == 0)
  ------------------
  |  Branch (531:7): [True: 18.4k, False: 0]
  ------------------
  532|  18.4k|    rc->max_gf_interval = get_default_max_gf_interval(
  533|  18.4k|        oxcf->input_cfg.init_framerate, rc->min_gf_interval);
  534|  18.4k|  rc->avg_frame_low_motion = 0;
  535|       |
  536|  18.4k|  rc->resize_state = ORIG;
  537|  18.4k|  rc->resize_avg_qp = 0;
  538|  18.4k|  rc->resize_buffer_underflow = 0;
  539|  18.4k|  rc->resize_count = 0;
  540|  18.4k|  rc->rtc_external_ratectrl = 0;
  541|  18.4k|  rc->frame_level_fast_extra_bits = 0;
  542|  18.4k|  rc->use_external_qp_one_pass = 0;
  543|  18.4k|  rc->percent_blocks_inactive = 0;
  544|  18.4k|  rc->force_max_q = 0;
  545|  18.4k|  rc->postencode_drop = 0;
  546|  18.4k|  rc->frames_since_scene_change = 0;
  547|  18.4k|  rc->last_frame_low_source_sad = 0;
  548|  18.4k|}
av1_rc_drop_frame:
  576|  24.4k|int av1_rc_drop_frame(AV1_COMP *cpi) {
  577|  24.4k|  const AV1EncoderConfig *oxcf = &cpi->oxcf;
  578|  24.4k|  RATE_CONTROL *const rc = &cpi->rc;
  579|  24.4k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  580|       |#if CONFIG_FPMT_TEST
  581|       |  const int simulate_parallel_frame =
  582|       |      cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
  583|       |      cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
  584|       |  int64_t buffer_level =
  585|       |      simulate_parallel_frame ? p_rc->temp_buffer_level : p_rc->buffer_level;
  586|       |#else
  587|  24.4k|  int64_t buffer_level = p_rc->buffer_level;
  588|  24.4k|#endif
  589|       |  // Never drop on key frame, or for frame whose base layer is key.
  590|       |  // If drop_count_consec hits or exceeds max_consec_drop then don't drop.
  591|  24.4k|  if (cpi->common.current_frame.frame_type == KEY_FRAME ||
  ------------------
  |  Branch (591:7): [True: 6.10k, False: 18.3k]
  ------------------
  592|  18.3k|      (cpi->ppi->use_svc &&
  ------------------
  |  Branch (592:8): [True: 0, False: 18.3k]
  ------------------
  593|      0|       cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame) ||
  ------------------
  |  Branch (593:8): [True: 0, False: 0]
  ------------------
  594|  18.3k|      !oxcf->rc_cfg.drop_frames_water_mark ||
  ------------------
  |  Branch (594:7): [True: 18.3k, False: 0]
  ------------------
  595|      0|      (rc->max_consec_drop > 0 &&
  ------------------
  |  Branch (595:8): [True: 0, False: 0]
  ------------------
  596|  24.4k|       rc->drop_count_consec >= rc->max_consec_drop)) {
  ------------------
  |  Branch (596:8): [True: 0, False: 0]
  ------------------
  597|  24.4k|    return 0;
  598|  24.4k|  } else {
  599|      0|    SVC *svc = &cpi->svc;
  600|       |    // In the full_superframe framedrop mode for svc, if the previous spatial
  601|       |    // layer was dropped, drop the current spatial layer.
  602|      0|    if (cpi->ppi->use_svc && svc->spatial_layer_id > 0 &&
  ------------------
  |  Branch (602:9): [True: 0, False: 0]
  |  Branch (602:30): [True: 0, False: 0]
  ------------------
  603|      0|        svc->drop_spatial_layer[svc->spatial_layer_id - 1] &&
  ------------------
  |  Branch (603:9): [True: 0, False: 0]
  ------------------
  604|      0|        svc->framedrop_mode == AOM_FULL_SUPERFRAME_DROP)
  ------------------
  |  Branch (604:9): [True: 0, False: 0]
  ------------------
  605|      0|      return 1;
  606|       |    // -1 is passed here for drop_mark since we are checking if
  607|       |    // buffer goes below 0 (<= -1).
  608|      0|    if (check_buffer_below_thresh(cpi, buffer_level, -1)) {
  ------------------
  |  Branch (608:9): [True: 0, False: 0]
  ------------------
  609|       |      // Always drop if buffer is below 0.
  610|      0|      rc->drop_count_consec++;
  611|      0|      return 1;
  612|      0|    } else {
  613|       |      // If buffer is below drop_mark, for now just drop every other frame
  614|       |      // (starting with the next frame) until it increases back over drop_mark.
  615|      0|      const int drop_mark = (int)(oxcf->rc_cfg.drop_frames_water_mark *
  616|      0|                                  p_rc->optimal_buffer_level / 100);
  617|      0|      const bool buffer_below_thresh =
  618|      0|          check_buffer_below_thresh(cpi, buffer_level, drop_mark);
  619|      0|      if (!buffer_below_thresh && rc->decimation_factor > 0) {
  ------------------
  |  Branch (619:11): [True: 0, False: 0]
  |  Branch (619:35): [True: 0, False: 0]
  ------------------
  620|      0|        --rc->decimation_factor;
  621|      0|      } else if (buffer_below_thresh && rc->decimation_factor == 0) {
  ------------------
  |  Branch (621:18): [True: 0, False: 0]
  |  Branch (621:41): [True: 0, False: 0]
  ------------------
  622|      0|        rc->decimation_factor = 1;
  623|      0|      }
  624|      0|      if (rc->decimation_factor > 0) {
  ------------------
  |  Branch (624:11): [True: 0, False: 0]
  ------------------
  625|      0|        if (rc->decimation_count > 0) {
  ------------------
  |  Branch (625:13): [True: 0, False: 0]
  ------------------
  626|      0|          --rc->decimation_count;
  627|      0|          rc->drop_count_consec++;
  628|      0|          return 1;
  629|      0|        } else {
  630|      0|          rc->decimation_count = rc->decimation_factor;
  631|      0|          return 0;
  632|      0|        }
  633|      0|      } else {
  634|      0|        rc->decimation_count = 0;
  635|      0|        return 0;
  636|      0|      }
  637|      0|    }
  638|      0|  }
  639|  24.4k|}
av1_rc_update_rate_correction_factors:
  941|  73.6k|                                           int width, int height) {
  942|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
  943|  73.6k|  double correction_factor = 1.0;
  944|  73.6k|  double rate_correction_factor =
  945|  73.6k|      get_rate_correction_factor(cpi, width, height);
  946|  73.6k|  double adjustment_limit;
  947|  73.6k|  int projected_size_based_on_q = 0;
  948|  73.6k|  int cyclic_refresh_active =
  949|  73.6k|      cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ && cpi->common.seg.enabled;
  ------------------
  |  Branch (949:7): [True: 0, False: 73.6k]
  |  Branch (949:55): [True: 0, False: 0]
  ------------------
  950|       |
  951|       |  // Do not update the rate factors for arf overlay frames.
  952|  73.6k|  if (cpi->rc.is_src_frame_alt_ref) return;
  ------------------
  |  Branch (952:7): [True: 0, False: 73.6k]
  ------------------
  953|       |
  954|       |  // Don't update rate correction factors here on scene changes as
  955|       |  // it is already reset in av1_encodedframe_overshoot_cbr(),
  956|       |  // but reset variables related to previous frame q and size.
  957|       |  // Note that the counter of frames since the last scene change
  958|       |  // is only valid when cyclic refresh mode is enabled and that
  959|       |  // this break out only applies to scene changes that are not
  960|       |  // recorded as INTRA only key frames.
  961|       |  // Note that av1_encodedframe_overshoot_cbr() is only entered
  962|       |  // if cpi->sf.rt_sf.overshoot_detection_cbr == FAST_DETECTION_MAXQ
  963|       |  // and cpi->rc.high_source_sad = 1.
  964|  73.6k|  if ((cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ) &&
  ------------------
  |  Branch (964:7): [True: 0, False: 73.6k]
  ------------------
  965|      0|      (cpi->sf.rt_sf.overshoot_detection_cbr == FAST_DETECTION_MAXQ) &&
  ------------------
  |  Branch (965:7): [True: 0, False: 0]
  ------------------
  966|      0|      cpi->rc.high_source_sad &&
  ------------------
  |  Branch (966:7): [True: 0, False: 0]
  ------------------
  967|      0|      (cpi->cyclic_refresh->counter_encode_maxq_scene_change == 0) &&
  ------------------
  |  Branch (967:7): [True: 0, False: 0]
  ------------------
  968|      0|      !frame_is_intra_only(cm) && !cpi->ppi->use_svc) {
  ------------------
  |  Branch (968:7): [True: 0, False: 0]
  |  Branch (968:35): [True: 0, False: 0]
  ------------------
  969|      0|    cpi->rc.q_2_frame = cm->quant_params.base_qindex;
  970|      0|    cpi->rc.q_1_frame = cm->quant_params.base_qindex;
  971|      0|    cpi->rc.rc_2_frame = 0;
  972|      0|    cpi->rc.rc_1_frame = 0;
  973|      0|    return;
  974|      0|  }
  975|       |
  976|       |  // Clear down mmx registers to allow floating point in what follows
  977|       |
  978|       |  // Work out how big we would have expected the frame to be at this Q given
  979|       |  // the current correction factor.
  980|       |  // Stay in double to avoid int overflow when values are large
  981|  73.6k|  if (cyclic_refresh_active) {
  ------------------
  |  Branch (981:7): [True: 0, False: 73.6k]
  ------------------
  982|      0|    projected_size_based_on_q =
  983|      0|        av1_cyclic_refresh_estimate_bits_at_q(cpi, rate_correction_factor);
  984|  73.6k|  } else {
  985|  73.6k|    projected_size_based_on_q = av1_estimate_bits_at_q(
  986|  73.6k|        cpi, cm->quant_params.base_qindex, rate_correction_factor);
  987|  73.6k|  }
  988|       |  // Work out a size correction factor.
  989|  73.6k|  if (projected_size_based_on_q > FRAME_OVERHEAD_BITS)
  ------------------
  |  |   59|  73.6k|#define FRAME_OVERHEAD_BITS 200
  ------------------
  |  Branch (989:7): [True: 44.2k, False: 29.3k]
  ------------------
  990|  44.2k|    correction_factor = (double)cpi->rc.projected_frame_size /
  991|  44.2k|                        (double)projected_size_based_on_q;
  992|       |
  993|       |  // Clamp correction factor to prevent anything too extreme
  994|  73.6k|  correction_factor = AOMMAX(correction_factor, 0.25);
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 66.9k, False: 6.71k]
  |  |  ------------------
  ------------------
  995|       |
  996|  73.6k|  cpi->rc.q_2_frame = cpi->rc.q_1_frame;
  997|  73.6k|  cpi->rc.q_1_frame = cm->quant_params.base_qindex;
  998|  73.6k|  cpi->rc.rc_2_frame = cpi->rc.rc_1_frame;
  999|  73.6k|  if (correction_factor > 1.1)
  ------------------
  |  Branch (999:7): [True: 26.6k, False: 46.9k]
  ------------------
 1000|  26.6k|    cpi->rc.rc_1_frame = -1;
 1001|  46.9k|  else if (correction_factor < 0.9)
  ------------------
  |  Branch (1001:12): [True: 15.4k, False: 31.4k]
  ------------------
 1002|  15.4k|    cpi->rc.rc_1_frame = 1;
 1003|  31.4k|  else
 1004|  31.4k|    cpi->rc.rc_1_frame = 0;
 1005|       |
 1006|       |  // Decide how heavily to dampen the adjustment
 1007|  73.6k|  if (correction_factor > 0.0) {
  ------------------
  |  Branch (1007:7): [True: 73.6k, False: 0]
  ------------------
 1008|  73.6k|    if (cpi->is_screen_content_type) {
  ------------------
  |  Branch (1008:9): [True: 7.92k, False: 65.7k]
  ------------------
 1009|  7.92k|      adjustment_limit =
 1010|  7.92k|          0.25 + 0.5 * AOMMIN(0.5, fabs(log10(correction_factor)));
  ------------------
  |  |   34|  7.92k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.52k, False: 6.39k]
  |  |  ------------------
  ------------------
 1011|  65.7k|    } else {
 1012|  65.7k|      adjustment_limit =
 1013|  65.7k|          0.25 + 0.75 * AOMMIN(0.5, fabs(log10(correction_factor)));
  ------------------
  |  |   34|  65.7k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 16.6k, False: 49.0k]
  |  |  ------------------
  ------------------
 1014|  65.7k|    }
 1015|  73.6k|  } else {
 1016|      0|    adjustment_limit = 0.75;
 1017|      0|  }
 1018|       |
 1019|       |  // Adjustment to delta Q and number of blocks updated in cyclic refresh
 1020|       |  // based on over or under shoot of target in current frame.
 1021|  73.6k|  if (cyclic_refresh_active && cpi->rc.this_frame_target > 0) {
  ------------------
  |  Branch (1021:7): [True: 0, False: 73.6k]
  |  Branch (1021:32): [True: 0, False: 0]
  ------------------
 1022|      0|    CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
 1023|      0|    if (correction_factor > 1.25) {
  ------------------
  |  Branch (1023:9): [True: 0, False: 0]
  ------------------
 1024|      0|      cr->percent_refresh_adjustment =
 1025|      0|          AOMMAX(cr->percent_refresh_adjustment - 1, -5);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|      0|      cr->rate_ratio_qdelta_adjustment =
 1027|      0|          AOMMAX(cr->rate_ratio_qdelta_adjustment - 0.05, -0.0);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1028|      0|    } else if (correction_factor < 0.5) {
  ------------------
  |  Branch (1028:16): [True: 0, False: 0]
  ------------------
 1029|      0|      cr->percent_refresh_adjustment =
 1030|      0|          AOMMIN(cr->percent_refresh_adjustment + 1, 5);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1031|      0|      cr->rate_ratio_qdelta_adjustment =
 1032|      0|          AOMMIN(cr->rate_ratio_qdelta_adjustment + 0.05, 0.25);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1033|      0|    }
 1034|      0|  }
 1035|       |
 1036|  73.6k|  if (correction_factor > 1.01) {
  ------------------
  |  Branch (1036:7): [True: 27.6k, False: 45.9k]
  ------------------
 1037|       |    // We are not already at the worst allowable quality
 1038|  27.6k|    correction_factor = (1.0 + ((correction_factor - 1.0) * adjustment_limit));
 1039|  27.6k|    rate_correction_factor = rate_correction_factor * correction_factor;
 1040|       |    // Keep rate_correction_factor within limits
 1041|  27.6k|    if (rate_correction_factor > MAX_BPB_FACTOR)
  ------------------
  |  |   53|  27.6k|#define MAX_BPB_FACTOR 50
  ------------------
  |  Branch (1041:9): [True: 39, False: 27.6k]
  ------------------
 1042|     39|      rate_correction_factor = MAX_BPB_FACTOR;
  ------------------
  |  |   53|     39|#define MAX_BPB_FACTOR 50
  ------------------
 1043|  45.9k|  } else if (correction_factor < 0.99) {
  ------------------
  |  Branch (1043:14): [True: 16.4k, False: 29.5k]
  ------------------
 1044|       |    // We are not already at the best allowable quality
 1045|  16.4k|    correction_factor = 1.0 / correction_factor;
 1046|  16.4k|    correction_factor = (1.0 + ((correction_factor - 1.0) * adjustment_limit));
 1047|  16.4k|    correction_factor = 1.0 / correction_factor;
 1048|       |
 1049|  16.4k|    rate_correction_factor = rate_correction_factor * correction_factor;
 1050|       |
 1051|       |    // Keep rate_correction_factor within limits
 1052|  16.4k|    if (rate_correction_factor < MIN_BPB_FACTOR)
  ------------------
  |  |   52|  16.4k|#define MIN_BPB_FACTOR 0.005
  ------------------
  |  Branch (1052:9): [True: 0, False: 16.4k]
  ------------------
 1053|      0|      rate_correction_factor = MIN_BPB_FACTOR;
  ------------------
  |  |   52|      0|#define MIN_BPB_FACTOR 0.005
  ------------------
 1054|  16.4k|  }
 1055|       |
 1056|  73.6k|  set_rate_correction_factor(cpi, is_encode_stage, rate_correction_factor,
 1057|  73.6k|                             width, height);
 1058|  73.6k|}
av1_rc_regulate_q:
 1140|  39.5k|                      int width, int height) {
 1141|  39.5k|  const int MBs = av1_get_MBs(width, height);
 1142|  39.5k|  const double correction_factor =
 1143|  39.5k|      get_rate_correction_factor(cpi, width, height);
 1144|  39.5k|  const int target_bits_per_mb =
 1145|  39.5k|      (int)(((uint64_t)target_bits_per_frame << BPER_MB_NORMBITS) / MBs);
  ------------------
  |  |   30|  39.5k|#define BPER_MB_NORMBITS 9
  ------------------
 1146|       |
 1147|  39.5k|  int q =
 1148|  39.5k|      find_closest_qindex_by_rate(target_bits_per_mb, cpi, correction_factor,
 1149|  39.5k|                                  active_best_quality, active_worst_quality);
 1150|  39.5k|  if (cpi->oxcf.rc_cfg.mode == AOM_CBR && has_no_stats_stage(cpi))
  ------------------
  |  Branch (1150:7): [True: 39.5k, False: 0]
  |  Branch (1150:43): [True: 39.5k, False: 0]
  ------------------
 1151|  39.5k|    return adjust_q_cbr(cpi, q, active_worst_quality, width, height);
 1152|       |
 1153|      0|  return q;
 1154|  39.5k|}
av1_rc_pick_q_and_bounds:
 2351|  24.4k|                             int *bottom_index, int *top_index) {
 2352|  24.4k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2353|  24.4k|  int q;
 2354|       |  // TODO(sarahparker) merge no-stats vbr and altref q computation
 2355|       |  // with rc_pick_q_and_bounds().
 2356|  24.4k|  const GF_GROUP *gf_group = &cpi->ppi->gf_group;
 2357|  24.4k|  if ((cpi->oxcf.rc_cfg.mode != AOM_Q ||
  ------------------
  |  Branch (2357:8): [True: 24.4k, False: 0]
  ------------------
 2358|      0|       gf_group->update_type[gf_index] == ARF_UPDATE) &&
  ------------------
  |  Branch (2358:8): [True: 0, False: 0]
  ------------------
 2359|  24.4k|      has_no_stats_stage(cpi)) {
  ------------------
  |  Branch (2359:7): [True: 24.4k, False: 0]
  ------------------
 2360|  24.4k|    if (cpi->oxcf.rc_cfg.mode == AOM_CBR) {
  ------------------
  |  Branch (2360:9): [True: 24.4k, False: 0]
  ------------------
 2361|       |      // TODO(yunqing): the results could be used for encoder optimization.
 2362|  24.4k|      cpi->rec_sse = UINT64_MAX;
 2363|  24.4k|      if (cpi->sf.hl_sf.accurate_bit_estimate &&
  ------------------
  |  Branch (2363:11): [True: 0, False: 24.4k]
  ------------------
 2364|      0|          cpi->common.current_frame.frame_type != KEY_FRAME)
  ------------------
  |  Branch (2364:11): [True: 0, False: 0]
  ------------------
 2365|      0|        rc_compute_variance_onepass_rt(cpi);
 2366|       |
 2367|  24.4k|      q = rc_pick_q_and_bounds_no_stats_cbr(cpi, width, height, bottom_index,
 2368|  24.4k|                                            top_index);
 2369|       |      // preserve copy of active worst quality selected.
 2370|  24.4k|      cpi->rc.active_worst_quality = *top_index;
 2371|       |
 2372|       |#if USE_UNRESTRICTED_Q_IN_CQ_MODE
 2373|       |    } else if (cpi->oxcf.rc_cfg.mode == AOM_CQ) {
 2374|       |      q = rc_pick_q_and_bounds_no_stats_cq(cpi, width, height, bottom_index,
 2375|       |                                           top_index);
 2376|       |#endif  // USE_UNRESTRICTED_Q_IN_CQ_MODE
 2377|  24.4k|    } else {
 2378|      0|      q = rc_pick_q_and_bounds_no_stats(cpi, width, height, bottom_index,
 2379|      0|                                        top_index);
 2380|      0|    }
 2381|  24.4k|  } else {
 2382|      0|    q = rc_pick_q_and_bounds(cpi, width, height, gf_index, bottom_index,
 2383|      0|                             top_index);
 2384|      0|  }
 2385|  24.4k|  if (gf_group->update_type[gf_index] == ARF_UPDATE) p_rc->arf_q = q;
  ------------------
  |  Branch (2385:7): [True: 0, False: 24.4k]
  ------------------
 2386|       |
 2387|  24.4k|  return q;
 2388|  24.4k|}
av1_rc_set_frame_target:
 2408|   110k|void av1_rc_set_frame_target(AV1_COMP *cpi, int target, int width, int height) {
 2409|   110k|  const AV1_COMMON *const cm = &cpi->common;
 2410|   110k|  RATE_CONTROL *const rc = &cpi->rc;
 2411|       |
 2412|   110k|  rc->this_frame_target = target;
 2413|       |
 2414|       |  // Modify frame size target when down-scaled.
 2415|   110k|  if (av1_frame_scaled(cm) && cpi->oxcf.rc_cfg.mode != AOM_CBR) {
  ------------------
  |  Branch (2415:7): [True: 92.1k, False: 18.4k]
  |  Branch (2415:31): [True: 73.8k, False: 18.3k]
  ------------------
 2416|  73.8k|    rc->this_frame_target = saturate_cast_double_to_int(
 2417|  73.8k|        rc->this_frame_target *
 2418|  73.8k|        resize_rate_factor(&cpi->oxcf.frm_dim_cfg, width, height));
 2419|  73.8k|  }
 2420|       |
 2421|       |  // Target rate per SB64 (including partial SB64s.
 2422|   110k|  const int64_t sb64_target_rate =
 2423|   110k|      ((int64_t)rc->this_frame_target << 12) / (width * height);
 2424|   110k|  rc->sb64_target_rate = (int)AOMMIN(sb64_target_rate, INT_MAX);
  ------------------
  |  |   34|   110k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 110k, False: 0]
  |  |  ------------------
  ------------------
 2425|   110k|}
av1_rc_postencode_update:
 2444|  73.6k|void av1_rc_postencode_update(AV1_COMP *cpi, uint64_t bytes_used) {
 2445|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
 2446|  73.6k|  const CurrentFrame *const current_frame = &cm->current_frame;
 2447|  73.6k|  RATE_CONTROL *const rc = &cpi->rc;
 2448|  73.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2449|  73.6k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 2450|  73.6k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
 2451|       |
 2452|  73.6k|  const int is_intrnl_arf =
 2453|  73.6k|      gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE;
 2454|       |
 2455|  73.6k|  const int qindex = cm->quant_params.base_qindex;
 2456|       |
 2457|       |#if RT_PASSIVE_STRATEGY
 2458|       |  const int frame_number = current_frame->frame_number % MAX_Q_HISTORY;
 2459|       |  p_rc->q_history[frame_number] = qindex;
 2460|       |#endif  // RT_PASSIVE_STRATEGY
 2461|       |
 2462|       |  // Update rate control heuristics
 2463|  73.6k|  rc->projected_frame_size = (int)(bytes_used << 3);
 2464|       |
 2465|       |  // Post encode loop adjustment of Q prediction.
 2466|  73.6k|  av1_rc_update_rate_correction_factors(cpi, 0, cm->width, cm->height);
 2467|       |
 2468|       |  // Update bit estimation ratio.
 2469|  73.6k|  if (cpi->oxcf.rc_cfg.mode == AOM_CBR &&
  ------------------
  |  Branch (2469:7): [True: 24.4k, False: 49.2k]
  ------------------
 2470|  24.4k|      cm->current_frame.frame_type != KEY_FRAME &&
  ------------------
  |  Branch (2470:7): [True: 18.3k, False: 6.10k]
  ------------------
 2471|  18.3k|      cpi->sf.hl_sf.accurate_bit_estimate) {
  ------------------
  |  Branch (2471:7): [True: 0, False: 18.3k]
  ------------------
 2472|      0|    const double q = av1_convert_qindex_to_q(cm->quant_params.base_qindex,
 2473|      0|                                             cm->seq_params->bit_depth);
 2474|      0|    const int this_bit_est_ratio =
 2475|      0|        (int)(rc->projected_frame_size * q / sqrt((double)cpi->rec_sse));
 2476|      0|    cpi->rc.bit_est_ratio =
 2477|      0|        cpi->rc.bit_est_ratio == 0
  ------------------
  |  Branch (2477:9): [True: 0, False: 0]
  ------------------
 2478|      0|            ? this_bit_est_ratio
 2479|      0|            : (7 * cpi->rc.bit_est_ratio + this_bit_est_ratio) / 8;
 2480|      0|  }
 2481|       |
 2482|       |  // Keep a record of last Q and ambient average Q.
 2483|  73.6k|  if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (2483:7): [True: 18.4k, False: 55.2k]
  ------------------
 2484|  18.4k|    p_rc->last_q[KEY_FRAME] = qindex;
 2485|  18.4k|    p_rc->avg_frame_qindex[KEY_FRAME] =
 2486|  18.4k|        ROUND_POWER_OF_TWO(3 * p_rc->avg_frame_qindex[KEY_FRAME] + qindex, 2);
  ------------------
  |  |   41|  18.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2487|  18.4k|    if (cpi->svc.spatial_layer_id == 0) {
  ------------------
  |  Branch (2487:9): [True: 18.4k, False: 0]
  ------------------
 2488|  18.4k|      rc->last_encoded_size_keyframe = rc->projected_frame_size;
 2489|  18.4k|      rc->last_target_size_keyframe = rc->this_frame_target;
 2490|  18.4k|    }
 2491|  55.2k|  } else {
 2492|  55.2k|    if ((cpi->ppi->use_svc && cpi->oxcf.rc_cfg.mode == AOM_CBR) ||
  ------------------
  |  Branch (2492:10): [True: 0, False: 55.2k]
  |  Branch (2492:31): [True: 0, False: 0]
  ------------------
 2493|  55.2k|        cpi->rc.rtc_external_ratectrl ||
  ------------------
  |  Branch (2493:9): [True: 0, False: 55.2k]
  ------------------
 2494|  55.2k|        (!rc->is_src_frame_alt_ref &&
  ------------------
  |  Branch (2494:10): [True: 55.2k, False: 0]
  ------------------
 2495|  55.2k|         !(refresh_frame->golden_frame || is_intrnl_arf ||
  ------------------
  |  Branch (2495:12): [True: 0, False: 55.2k]
  |  Branch (2495:43): [True: 0, False: 55.2k]
  ------------------
 2496|  55.2k|           refresh_frame->alt_ref_frame))) {
  ------------------
  |  Branch (2496:12): [True: 0, False: 55.2k]
  ------------------
 2497|  55.2k|      p_rc->last_q[INTER_FRAME] = qindex;
 2498|  55.2k|      p_rc->avg_frame_qindex[INTER_FRAME] = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  55.2k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2499|  55.2k|          3 * p_rc->avg_frame_qindex[INTER_FRAME] + qindex, 2);
 2500|  55.2k|      p_rc->ni_frames++;
 2501|  55.2k|      p_rc->tot_q += av1_convert_qindex_to_q(qindex, cm->seq_params->bit_depth);
 2502|  55.2k|      p_rc->avg_q = p_rc->tot_q / p_rc->ni_frames;
 2503|       |      // Calculate the average Q for normal inter frames (not key or GFU
 2504|       |      // frames).
 2505|  55.2k|      rc->ni_tot_qi += qindex;
 2506|  55.2k|      rc->ni_av_qi = rc->ni_tot_qi / p_rc->ni_frames;
 2507|  55.2k|    }
 2508|  55.2k|  }
 2509|       |  // Keep record of last boosted (KF/GF/ARF) Q value.
 2510|       |  // If the current frame is coded at a lower Q then we also update it.
 2511|       |  // If all mbs in this group are skipped only update if the Q value is
 2512|       |  // better than that already stored.
 2513|       |  // This is used to help set quality in forced key frames to reduce popping
 2514|  73.6k|  if ((qindex < p_rc->last_boosted_qindex) ||
  ------------------
  |  Branch (2514:7): [True: 16, False: 73.6k]
  ------------------
 2515|  73.6k|      (current_frame->frame_type == KEY_FRAME) ||
  ------------------
  |  Branch (2515:7): [True: 18.4k, False: 55.1k]
  ------------------
 2516|  55.1k|      (!p_rc->constrained_gf_group &&
  ------------------
  |  Branch (2516:8): [True: 18.2k, False: 36.9k]
  ------------------
 2517|  18.2k|       (refresh_frame->alt_ref_frame || is_intrnl_arf ||
  ------------------
  |  Branch (2517:9): [True: 0, False: 18.2k]
  |  Branch (2517:41): [True: 0, False: 18.2k]
  ------------------
 2518|  18.4k|        (refresh_frame->golden_frame && !rc->is_src_frame_alt_ref)))) {
  ------------------
  |  Branch (2518:10): [True: 0, False: 18.2k]
  |  Branch (2518:41): [True: 0, False: 0]
  ------------------
 2519|  18.4k|    p_rc->last_boosted_qindex = qindex;
 2520|  18.4k|  }
 2521|  73.6k|  if (current_frame->frame_type == KEY_FRAME) p_rc->last_kf_qindex = qindex;
  ------------------
  |  Branch (2521:7): [True: 18.4k, False: 55.2k]
  ------------------
 2522|       |
 2523|  73.6k|  update_buffer_level(cpi, rc->projected_frame_size);
 2524|  73.6k|  rc->prev_avg_frame_bandwidth = rc->avg_frame_bandwidth;
 2525|       |
 2526|       |  // Rolling monitors of whether we are over or underspending used to help
 2527|       |  // regulate min and Max Q in two pass.
 2528|  73.6k|  if (av1_frame_scaled(cm))
  ------------------
  |  Branch (2528:7): [True: 55.2k, False: 18.4k]
  ------------------
 2529|  55.2k|    rc->this_frame_target = saturate_cast_double_to_int(
 2530|  55.2k|        rc->this_frame_target /
 2531|  55.2k|        resize_rate_factor(&cpi->oxcf.frm_dim_cfg, cm->width, cm->height));
 2532|  73.6k|  if (current_frame->frame_type != KEY_FRAME) {
  ------------------
  |  Branch (2532:7): [True: 55.2k, False: 18.4k]
  ------------------
 2533|  55.2k|    p_rc->rolling_target_bits = (int)ROUND_POWER_OF_TWO_64(
  ------------------
  |  |   53|  55.2k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  ------------------
 2534|  55.2k|        (int64_t)p_rc->rolling_target_bits * 3 + rc->this_frame_target, 2);
 2535|  55.2k|    p_rc->rolling_actual_bits = (int)ROUND_POWER_OF_TWO_64(
  ------------------
  |  |   53|  55.2k|  (((value) + ((((int64_t)1 << (n)) >> 1))) >> (n))
  ------------------
 2536|  55.2k|        (int64_t)p_rc->rolling_actual_bits * 3 + rc->projected_frame_size, 2);
 2537|  55.2k|  }
 2538|       |
 2539|       |  // Actual bits spent
 2540|  73.6k|  p_rc->total_actual_bits += rc->projected_frame_size;
 2541|  73.6k|  p_rc->total_target_bits += cm->show_frame ? rc->avg_frame_bandwidth : 0;
  ------------------
  |  Branch (2541:30): [True: 73.6k, False: 0]
  ------------------
 2542|       |
 2543|  73.6k|  if (is_altref_enabled(cpi->oxcf.gf_cfg.lag_in_frames,
  ------------------
  |  Branch (2543:7): [True: 0, False: 73.6k]
  ------------------
 2544|  73.6k|                        cpi->oxcf.gf_cfg.enable_auto_arf) &&
 2545|      0|      refresh_frame->alt_ref_frame &&
  ------------------
  |  Branch (2545:7): [True: 0, False: 0]
  ------------------
 2546|      0|      (current_frame->frame_type != KEY_FRAME && !frame_is_sframe(cm)))
  ------------------
  |  Branch (2546:8): [True: 0, False: 0]
  |  Branch (2546:50): [True: 0, False: 0]
  ------------------
 2547|       |    // Update the alternate reference frame stats as appropriate.
 2548|      0|    update_alt_ref_frame_stats(cpi);
 2549|  73.6k|  else
 2550|       |    // Update the Golden frame stats as appropriate.
 2551|  73.6k|    update_golden_frame_stats(cpi);
 2552|       |
 2553|       |#if CONFIG_FPMT_TEST
 2554|       |  /*The variables temp_avg_frame_qindex, temp_last_q, temp_avg_q,
 2555|       |   * temp_last_boosted_qindex are introduced only for quality simulation
 2556|       |   * purpose, it retains the value previous to the parallel encode frames. The
 2557|       |   * variables are updated based on the update flag.
 2558|       |   *
 2559|       |   * If there exist show_existing_frames between parallel frames, then to
 2560|       |   * retain the temp state do not update it. */
 2561|       |  int show_existing_between_parallel_frames =
 2562|       |      (cpi->ppi->gf_group.update_type[cpi->gf_frame_index] ==
 2563|       |           INTNL_OVERLAY_UPDATE &&
 2564|       |       cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index + 1] == 2);
 2565|       |
 2566|       |  if (cpi->do_frame_data_update && !show_existing_between_parallel_frames &&
 2567|       |      cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
 2568|       |    for (int i = 0; i < FRAME_TYPES; i++) {
 2569|       |      p_rc->temp_last_q[i] = p_rc->last_q[i];
 2570|       |    }
 2571|       |    p_rc->temp_avg_q = p_rc->avg_q;
 2572|       |    p_rc->temp_last_boosted_qindex = p_rc->last_boosted_qindex;
 2573|       |    p_rc->temp_total_actual_bits = p_rc->total_actual_bits;
 2574|       |    p_rc->temp_projected_frame_size = rc->projected_frame_size;
 2575|       |    for (int i = 0; i < RATE_FACTOR_LEVELS; i++)
 2576|       |      p_rc->temp_rate_correction_factors[i] = p_rc->rate_correction_factors[i];
 2577|       |  }
 2578|       |#endif
 2579|  73.6k|  if (current_frame->frame_type == KEY_FRAME) {
  ------------------
  |  Branch (2579:7): [True: 18.4k, False: 55.2k]
  ------------------
 2580|  18.4k|    rc->frames_since_key = 0;
 2581|  18.4k|    rc->frames_since_scene_change = 0;
 2582|  18.4k|  }
 2583|  73.6k|  if (cpi->refresh_frame.golden_frame)
  ------------------
  |  Branch (2583:7): [True: 18.4k, False: 55.2k]
  ------------------
 2584|  18.4k|    rc->frame_num_last_gf_refresh = current_frame->frame_number;
 2585|       |
 2586|  73.6k|  if (rc->frame_source_sad < 10000)
  ------------------
  |  Branch (2586:7): [True: 55.3k, False: 18.3k]
  ------------------
 2587|  55.3k|    rc->last_frame_low_source_sad = rc->frame_number_encoded;
 2588|       |
 2589|  73.6k|  rc->prev_coded_width = cm->width;
 2590|  73.6k|  rc->prev_coded_height = cm->height;
 2591|  73.6k|  rc->frame_number_encoded++;
 2592|  73.6k|  rc->prev_frame_is_dropped = 0;
 2593|  73.6k|  rc->drop_count_consec = 0;
 2594|  73.6k|}
av1_find_qindex:
 2620|  16.8k|                    int best_qindex, int worst_qindex) {
 2621|  16.8k|  assert(best_qindex <= worst_qindex);
 2622|  16.8k|  int low = best_qindex;
 2623|  16.8k|  int high = worst_qindex;
 2624|   152k|  while (low < high) {
  ------------------
  |  Branch (2624:10): [True: 135k, False: 16.8k]
  ------------------
 2625|   135k|    const int mid = (low + high) >> 1;
 2626|   135k|    const double mid_q = av1_convert_qindex_to_q(mid, bit_depth);
 2627|   135k|    if (mid_q < desired_q) {
  ------------------
  |  Branch (2627:9): [True: 61.0k, False: 74.0k]
  ------------------
 2628|  61.0k|      low = mid + 1;
 2629|  74.0k|    } else {
 2630|  74.0k|      high = mid;
 2631|  74.0k|    }
 2632|   135k|  }
 2633|  16.8k|  assert(low == high);
 2634|       |  assert(av1_convert_qindex_to_q(low, bit_depth) >= desired_q ||
 2635|  16.8k|         low == worst_qindex);
 2636|  16.8k|  return low;
 2637|  16.8k|}
av1_rc_update_framerate:
 2721|   229k|void av1_rc_update_framerate(AV1_COMP *cpi, int width, int height) {
 2722|   229k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2723|   229k|  RATE_CONTROL *const rc = &cpi->rc;
 2724|   229k|  const int MBs = av1_get_MBs(width, height);
 2725|       |
 2726|   229k|  rc->avg_frame_bandwidth = saturate_cast_double_to_int(
 2727|   229k|      round(oxcf->rc_cfg.target_bandwidth / cpi->framerate));
 2728|       |
 2729|   229k|  int64_t vbr_min_bits =
 2730|   229k|      (int64_t)rc->avg_frame_bandwidth * oxcf->rc_cfg.vbrmin_section / 100;
 2731|   229k|  vbr_min_bits = AOMMIN(vbr_min_bits, INT_MAX);
  ------------------
  |  |   34|   229k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 229k, False: 0]
  |  |  ------------------
  ------------------
 2732|       |
 2733|   229k|  rc->min_frame_bandwidth = AOMMAX((int)vbr_min_bits, FRAME_OVERHEAD_BITS);
  ------------------
  |  |   35|   229k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 229k]
  |  |  ------------------
  ------------------
 2734|       |
 2735|       |  // A maximum bitrate for a frame is defined.
 2736|       |  // The baseline for this aligns with HW implementations that
 2737|       |  // can support decode of 1080P content up to a bitrate of MAX_MB_RATE bits
 2738|       |  // per 16x16 MB (averaged over a frame). However this limit is extended if
 2739|       |  // a very high rate is given on the command line or the rate cannot
 2740|       |  // be achieved because of a user specified max q (e.g. when the user
 2741|       |  // specifies lossless encode.
 2742|   229k|  int64_t vbr_max_bits =
 2743|   229k|      (int64_t)rc->avg_frame_bandwidth * oxcf->rc_cfg.vbrmax_section / 100;
 2744|   229k|  vbr_max_bits = AOMMIN(vbr_max_bits, INT_MAX);
  ------------------
  |  |   34|   229k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 229k, False: 0]
  |  |  ------------------
  ------------------
 2745|       |
 2746|   229k|  rc->max_frame_bandwidth =
 2747|   229k|      AOMMAX(AOMMAX((MBs * MAX_MB_RATE), MAXRATE_1080P), (int)vbr_max_bits);
  ------------------
  |  |   35|   458k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 229k, False: 0]
  |  |  |  Branch (35:25): [True: 0, False: 229k]
  |  |  |  Branch (35:38): [True: 0, False: 229k]
  |  |  ------------------
  ------------------
 2748|       |
 2749|   229k|  set_gf_interval_range(cpi, rc);
 2750|   229k|}
av1_calc_pframe_target_size_one_pass_vbr:
 2842|  73.8k|    const AV1_COMP *const cpi, FRAME_UPDATE_TYPE frame_update_type) {
 2843|  73.8k|  const int af_ratio = is_one_pass_rt_lag_params(cpi) ? 6 : 10;
  ------------------
  |  Branch (2843:24): [True: 0, False: 73.8k]
  ------------------
 2844|  73.8k|  const RATE_CONTROL *const rc = &cpi->rc;
 2845|  73.8k|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2846|  73.8k|  int64_t target;
 2847|  73.8k|#if USE_ALTREF_FOR_ONE_PASS
 2848|  73.8k|  if (frame_update_type == KF_UPDATE || frame_update_type == GF_UPDATE ||
  ------------------
  |  Branch (2848:7): [True: 0, False: 73.8k]
  |  Branch (2848:41): [True: 0, False: 73.8k]
  ------------------
 2849|  73.8k|      frame_update_type == ARF_UPDATE) {
  ------------------
  |  Branch (2849:7): [True: 0, False: 73.8k]
  ------------------
 2850|      0|    target = ((int64_t)rc->avg_frame_bandwidth * p_rc->baseline_gf_interval *
 2851|      0|              af_ratio) /
 2852|      0|             (p_rc->baseline_gf_interval + af_ratio - 1);
 2853|  73.8k|  } else {
 2854|  73.8k|    target = ((int64_t)rc->avg_frame_bandwidth * p_rc->baseline_gf_interval) /
 2855|  73.8k|             (p_rc->baseline_gf_interval + af_ratio - 1);
 2856|  73.8k|  }
 2857|       |#else
 2858|       |  target = rc->avg_frame_bandwidth;
 2859|       |#endif
 2860|  73.8k|  return clamp_pframe_target_size(cpi, target, frame_update_type);
 2861|  73.8k|}
av1_calc_iframe_target_size_one_pass_vbr:
 2863|  24.6k|int av1_calc_iframe_target_size_one_pass_vbr(const AV1_COMP *const cpi) {
 2864|  24.6k|  static const int kf_ratio = 25;
 2865|  24.6k|  const RATE_CONTROL *rc = &cpi->rc;
 2866|  24.6k|  const int64_t target = (int64_t)rc->avg_frame_bandwidth * kf_ratio;
 2867|  24.6k|  return clamp_iframe_target_size(cpi, target);
 2868|  24.6k|}
av1_calc_pframe_target_size_one_pass_cbr:
 2871|  33.4k|    const AV1_COMP *cpi, FRAME_UPDATE_TYPE frame_update_type) {
 2872|  33.4k|  const AV1EncoderConfig *oxcf = &cpi->oxcf;
 2873|  33.4k|  const RATE_CONTROL *rc = &cpi->rc;
 2874|  33.4k|  const PRIMARY_RATE_CONTROL *p_rc = &cpi->ppi->p_rc;
 2875|  33.4k|  const RateControlCfg *rc_cfg = &oxcf->rc_cfg;
 2876|  33.4k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
 2877|  33.4k|  int64_t diff = p_rc->optimal_buffer_level - p_rc->buffer_level;
 2878|       |  // For refresh alt or golden: keep diff negative to force setting
 2879|       |  // higher target bandwidth on these frames.
 2880|       |  // Only realtime mode with lookahead.
 2881|  33.4k|  if (is_one_pass_rt_lag_params(cpi) &&
  ------------------
  |  Branch (2881:7): [True: 0, False: 33.4k]
  ------------------
 2882|      0|      (refresh_frame->alt_ref_frame || refresh_frame->golden_frame))
  ------------------
  |  Branch (2882:8): [True: 0, False: 0]
  |  Branch (2882:40): [True: 0, False: 0]
  ------------------
 2883|      0|    diff = AOMMIN(diff, -p_rc->optimal_buffer_level);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2884|  33.4k|  const int64_t one_pct_bits = 1 + p_rc->optimal_buffer_level / 100;
 2885|  33.4k|  int min_frame_target =
 2886|  33.4k|      AOMMAX(rc->avg_frame_bandwidth >> 4, FRAME_OVERHEAD_BITS);
  ------------------
  |  |   35|  33.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 33.4k, False: 0]
  |  |  ------------------
  ------------------
 2887|  33.4k|  int64_t target;
 2888|       |
 2889|  33.4k|  if (rc_cfg->gf_cbr_boost_pct) {
  ------------------
  |  Branch (2889:7): [True: 0, False: 33.4k]
  ------------------
 2890|      0|    const int af_ratio_pct = rc_cfg->gf_cbr_boost_pct + 100;
 2891|      0|    if (frame_update_type == GF_UPDATE || frame_update_type == OVERLAY_UPDATE) {
  ------------------
  |  Branch (2891:9): [True: 0, False: 0]
  |  Branch (2891:43): [True: 0, False: 0]
  ------------------
 2892|      0|      target = ((int64_t)rc->avg_frame_bandwidth * p_rc->baseline_gf_interval *
 2893|      0|                af_ratio_pct) /
 2894|      0|               (p_rc->baseline_gf_interval * 100 + af_ratio_pct - 100);
 2895|      0|    } else {
 2896|      0|      target = ((int64_t)rc->avg_frame_bandwidth * p_rc->baseline_gf_interval *
 2897|      0|                100) /
 2898|      0|               (p_rc->baseline_gf_interval * 100 + af_ratio_pct - 100);
 2899|      0|    }
 2900|  33.4k|  } else {
 2901|  33.4k|    target = rc->avg_frame_bandwidth;
 2902|  33.4k|  }
 2903|  33.4k|  if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (2903:7): [True: 0, False: 33.4k]
  ------------------
 2904|       |    // Note that for layers, avg_frame_bandwidth is the cumulative
 2905|       |    // per-frame-bandwidth. For the target size of this frame, use the
 2906|       |    // layer average frame size (i.e., non-cumulative per-frame-bw).
 2907|      0|    int layer =
 2908|      0|        LAYER_IDS_TO_IDX(cpi->svc.spatial_layer_id, cpi->svc.temporal_layer_id,
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 2909|      0|                         cpi->svc.number_temporal_layers);
 2910|      0|    const LAYER_CONTEXT *lc = &cpi->svc.layer_context[layer];
 2911|      0|    target = lc->avg_frame_size;
 2912|      0|    min_frame_target = AOMMAX(lc->avg_frame_size >> 4, FRAME_OVERHEAD_BITS);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2913|      0|  }
 2914|  33.4k|  if (diff > 0) {
  ------------------
  |  Branch (2914:7): [True: 1.18k, False: 32.2k]
  ------------------
 2915|       |    // Lower the target bandwidth for this frame.
 2916|  1.18k|    const int pct_low =
 2917|  1.18k|        (int)AOMMIN(diff / one_pct_bits, rc_cfg->under_shoot_pct);
  ------------------
  |  |   34|  1.18k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 927, False: 262]
  |  |  ------------------
  ------------------
 2918|  1.18k|    target -= (target * pct_low) / 200;
 2919|  32.2k|  } else if (diff < 0) {
  ------------------
  |  Branch (2919:14): [True: 8.09k, False: 24.1k]
  ------------------
 2920|       |    // Increase the target bandwidth for this frame.
 2921|  8.09k|    const int pct_high =
 2922|  8.09k|        (int)AOMMIN(-diff / one_pct_bits, rc_cfg->over_shoot_pct);
  ------------------
  |  |   34|  8.09k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 8.09k, False: 0]
  |  |  ------------------
  ------------------
 2923|  8.09k|    target += (target * pct_high) / 200;
 2924|  8.09k|  }
 2925|  33.4k|  if (rc_cfg->max_inter_bitrate_pct) {
  ------------------
  |  Branch (2925:7): [True: 0, False: 33.4k]
  ------------------
 2926|      0|    const int64_t max_rate =
 2927|      0|        (int64_t)rc->avg_frame_bandwidth * rc_cfg->max_inter_bitrate_pct / 100;
 2928|      0|    target = AOMMIN(target, max_rate);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2929|      0|  }
 2930|  33.4k|  if (target > INT_MAX) target = INT_MAX;
  ------------------
  |  Branch (2930:7): [True: 0, False: 33.4k]
  ------------------
 2931|  33.4k|  return AOMMAX(min_frame_target, (int)target);
  ------------------
  |  |   35|  33.4k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 33.4k]
  |  |  ------------------
  ------------------
 2932|  33.4k|}
av1_calc_iframe_target_size_one_pass_cbr:
 2934|  6.10k|int av1_calc_iframe_target_size_one_pass_cbr(const AV1_COMP *cpi) {
 2935|  6.10k|  const RATE_CONTROL *rc = &cpi->rc;
 2936|  6.10k|  const PRIMARY_RATE_CONTROL *p_rc = &cpi->ppi->p_rc;
 2937|  6.10k|  int64_t target;
 2938|  6.10k|  if (cpi->common.current_frame.frame_number == 0) {
  ------------------
  |  Branch (2938:7): [True: 6.10k, False: 0]
  ------------------
 2939|  6.10k|    target = ((p_rc->starting_buffer_level / 2) > INT_MAX)
  ------------------
  |  Branch (2939:14): [True: 0, False: 6.10k]
  ------------------
 2940|  6.10k|                 ? INT_MAX
 2941|  6.10k|                 : (int)(p_rc->starting_buffer_level / 2);
 2942|  6.10k|    if (cpi->svc.number_temporal_layers > 1 && target < (INT_MAX >> 2)) {
  ------------------
  |  Branch (2942:9): [True: 0, False: 6.10k]
  |  Branch (2942:48): [True: 0, False: 0]
  ------------------
 2943|      0|      target = target << AOMMIN(2, (cpi->svc.number_temporal_layers - 1));
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2944|      0|    }
 2945|  6.10k|  } else {
 2946|      0|    int kf_boost = 32;
 2947|      0|    double framerate = cpi->framerate;
 2948|       |
 2949|      0|    kf_boost = AOMMAX(kf_boost, (int)round(2 * framerate - 16));
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2950|      0|    if (rc->frames_since_key < framerate / 2) {
  ------------------
  |  Branch (2950:9): [True: 0, False: 0]
  ------------------
 2951|      0|      kf_boost = (int)(kf_boost * rc->frames_since_key / (framerate / 2));
 2952|      0|    }
 2953|      0|    target = ((int64_t)(16 + kf_boost) * rc->avg_frame_bandwidth) >> 4;
 2954|      0|  }
 2955|  6.10k|  return clamp_iframe_target_size(cpi, target);
 2956|  6.10k|}
av1_adjust_gf_refresh_qp_one_pass_rt:
 3022|  18.3k|void av1_adjust_gf_refresh_qp_one_pass_rt(AV1_COMP *cpi) {
 3023|  18.3k|  AV1_COMMON *const cm = &cpi->common;
 3024|  18.3k|  RATE_CONTROL *const rc = &cpi->rc;
 3025|  18.3k|  RTC_REF *const rtc_ref = &cpi->ppi->rtc_ref;
 3026|  18.3k|  const int resize_pending = is_frame_resize_pending(cpi);
 3027|  18.3k|  if (!resize_pending && !rc->high_source_sad) {
  ------------------
  |  Branch (3027:7): [True: 18.3k, False: 0]
  |  Branch (3027:26): [True: 18.3k, False: 0]
  ------------------
 3028|       |    // Check if we should disable GF refresh (if period is up),
 3029|       |    // or force a GF refresh update (if we are at least halfway through
 3030|       |    // period) based on QP. Look into add info on segment deltaq.
 3031|  18.3k|    PRIMARY_RATE_CONTROL *p_rc = &cpi->ppi->p_rc;
 3032|  18.3k|    const int avg_qp = p_rc->avg_frame_qindex[INTER_FRAME];
 3033|  18.3k|    const int allow_gf_update =
 3034|  18.3k|        rc->frames_till_gf_update_due <= (p_rc->baseline_gf_interval - 10);
 3035|  18.3k|    int gf_update_changed = 0;
 3036|  18.3k|    int thresh = 87;
 3037|  18.3k|    if ((cm->current_frame.frame_number - cpi->rc.frame_num_last_gf_refresh) <
  ------------------
  |  Branch (3037:9): [True: 18.3k, False: 0]
  ------------------
 3038|  18.3k|            FIXED_GF_INTERVAL_RT &&
  ------------------
  |  |   49|  36.6k|#define FIXED_GF_INTERVAL_RT 80
  ------------------
 3039|  18.3k|        rc->frames_till_gf_update_due == 1 &&
  ------------------
  |  Branch (3039:9): [True: 0, False: 18.3k]
  ------------------
 3040|      0|        cm->quant_params.base_qindex > avg_qp) {
  ------------------
  |  Branch (3040:9): [True: 0, False: 0]
  ------------------
 3041|       |      // Disable GF refresh since QP is above the running average QP.
 3042|      0|      rtc_ref->refresh[rtc_ref->gld_idx_1layer] = 0;
 3043|      0|      gf_update_changed = 1;
 3044|      0|      cpi->refresh_frame.golden_frame = 0;
 3045|  18.3k|    } else if (allow_gf_update &&
  ------------------
  |  Branch (3045:16): [True: 0, False: 18.3k]
  ------------------
 3046|      0|               ((cm->quant_params.base_qindex < thresh * avg_qp / 100) ||
  ------------------
  |  Branch (3046:17): [True: 0, False: 0]
  ------------------
 3047|      0|                (rc->avg_frame_low_motion && rc->avg_frame_low_motion < 20))) {
  ------------------
  |  Branch (3047:18): [True: 0, False: 0]
  |  Branch (3047:46): [True: 0, False: 0]
  ------------------
 3048|       |      // Force refresh since QP is well below average QP or this is a high
 3049|       |      // motion frame.
 3050|      0|      rtc_ref->refresh[rtc_ref->gld_idx_1layer] = 1;
 3051|      0|      gf_update_changed = 1;
 3052|      0|      cpi->refresh_frame.golden_frame = 1;
 3053|      0|    }
 3054|  18.3k|    if (gf_update_changed) {
  ------------------
  |  Branch (3054:9): [True: 0, False: 18.3k]
  ------------------
 3055|      0|      set_baseline_gf_interval(cpi, INTER_FRAME);
 3056|      0|      int refresh_mask = 0;
 3057|      0|      for (unsigned int i = 0; i < INTER_REFS_PER_FRAME; i++) {
  ------------------
  |  Branch (3057:32): [True: 0, False: 0]
  ------------------
 3058|      0|        int ref_frame_map_idx = rtc_ref->ref_idx[i];
 3059|      0|        refresh_mask |= rtc_ref->refresh[ref_frame_map_idx]
 3060|      0|                        << ref_frame_map_idx;
 3061|      0|      }
 3062|      0|      cm->current_frame.refresh_frame_flags = refresh_mask;
 3063|      0|    }
 3064|  18.3k|  }
 3065|  18.3k|}
av1_rc_scene_detection_onepass_rt:
 3271|  18.3k|                                       const EncodeFrameInput *frame_input) {
 3272|  18.3k|  AV1_COMMON *const cm = &cpi->common;
 3273|  18.3k|  RATE_CONTROL *const rc = &cpi->rc;
 3274|  18.3k|  YV12_BUFFER_CONFIG const *const unscaled_src = frame_input->source;
 3275|  18.3k|  YV12_BUFFER_CONFIG const *const unscaled_last_src = frame_input->last_source;
 3276|  18.3k|  uint8_t *src_y;
 3277|  18.3k|  int src_ystride;
 3278|  18.3k|  int src_width;
 3279|  18.3k|  int src_height;
 3280|  18.3k|  uint8_t *last_src_y;
 3281|  18.3k|  int last_src_ystride;
 3282|  18.3k|  int last_src_width;
 3283|  18.3k|  int last_src_height;
 3284|  18.3k|  int width = cm->width;
 3285|  18.3k|  int height = cm->height;
 3286|  18.3k|  if (cpi->svc.number_spatial_layers > 1) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 18.3k]
  ------------------
 3287|      0|    width = cpi->oxcf.frm_dim_cfg.width;
 3288|      0|    height = cpi->oxcf.frm_dim_cfg.height;
 3289|      0|  }
 3290|       |  // Set src_sad_blk_64x64 to NULL also for number_spatial layers > 1, as
 3291|       |  // it is never allocated for number_spatial_layers > 1 (see the condition
 3292|       |  // under which we allocate cpi->src_sad_blk_64x64 later in this function).
 3293|       |  // This is guard against the case where the number_spatial_layers
 3294|       |  // is changed dynamically without re-alloc of encoder.
 3295|  18.3k|  if (width != cm->render_width || height != cm->render_height ||
  ------------------
  |  Branch (3295:7): [True: 18.3k, False: 0]
  |  Branch (3295:36): [True: 0, False: 0]
  ------------------
 3296|      0|      cpi->svc.number_spatial_layers > 1 || unscaled_src == NULL ||
  ------------------
  |  Branch (3296:7): [True: 0, False: 0]
  |  Branch (3296:45): [True: 0, False: 0]
  ------------------
 3297|  18.3k|      unscaled_last_src == NULL || is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (3297:7): [True: 0, False: 0]
  |  Branch (3297:36): [True: 0, False: 0]
  ------------------
 3298|  18.3k|    aom_free(cpi->src_sad_blk_64x64);
 3299|  18.3k|    cpi->src_sad_blk_64x64 = NULL;
 3300|  18.3k|    cpi->src_sad_blk_alloc_size = 0;
 3301|  18.3k|  }
 3302|  18.3k|  if (unscaled_src == NULL || unscaled_last_src == NULL) return;
  ------------------
  |  Branch (3302:7): [True: 0, False: 18.3k]
  |  Branch (3302:31): [True: 0, False: 18.3k]
  ------------------
 3303|  18.3k|  src_y = unscaled_src->y_buffer;
 3304|  18.3k|  src_ystride = unscaled_src->y_stride;
 3305|  18.3k|  src_width = unscaled_src->y_width;
 3306|  18.3k|  src_height = unscaled_src->y_height;
 3307|  18.3k|  last_src_y = unscaled_last_src->y_buffer;
 3308|  18.3k|  last_src_ystride = unscaled_last_src->y_stride;
 3309|  18.3k|  last_src_width = unscaled_last_src->y_width;
 3310|  18.3k|  last_src_height = unscaled_last_src->y_height;
 3311|  18.3k|  if (src_width != last_src_width || src_height != last_src_height) {
  ------------------
  |  Branch (3311:7): [True: 0, False: 18.3k]
  |  Branch (3311:38): [True: 0, False: 18.3k]
  ------------------
 3312|      0|    aom_free(cpi->src_sad_blk_64x64);
 3313|      0|    cpi->src_sad_blk_64x64 = NULL;
 3314|      0|    cpi->src_sad_blk_alloc_size = 0;
 3315|      0|    return;
 3316|      0|  }
 3317|  18.3k|  rc->high_source_sad = 0;
 3318|  18.3k|  rc->percent_blocks_with_motion = 0;
 3319|  18.3k|  rc->max_block_source_sad = 0;
 3320|  18.3k|  rc->prev_avg_source_sad = rc->avg_source_sad;
 3321|  18.3k|  int num_mi_cols = cm->mi_params.mi_cols;
 3322|  18.3k|  int num_mi_rows = cm->mi_params.mi_rows;
 3323|  18.3k|  if (cpi->svc.number_spatial_layers > 1) {
  ------------------
  |  Branch (3323:7): [True: 0, False: 18.3k]
  ------------------
 3324|      0|    num_mi_cols = size_in_mi(src_width);
 3325|      0|    num_mi_rows = size_in_mi(src_height);
 3326|      0|  }
 3327|  18.3k|  int num_zero_temp_sad = 0;
 3328|  18.3k|  uint32_t min_thresh =
 3329|  18.3k|      (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) ? 8000 : 10000;
  ------------------
  |  Branch (3329:7): [True: 0, False: 18.3k]
  ------------------
 3330|  18.3k|  if (cpi->sf.rt_sf.higher_thresh_scene_detection) {
  ------------------
  |  Branch (3330:7): [True: 18.3k, False: 0]
  ------------------
 3331|  18.3k|    min_thresh = cm->width * cm->height <= 320 * 240 && cpi->framerate < 10.0
  ------------------
  |  Branch (3331:18): [True: 18.3k, False: 0]
  |  Branch (3331:57): [True: 0, False: 18.3k]
  ------------------
 3332|  18.3k|                     ? 50000
 3333|  18.3k|                     : 100000;
 3334|  18.3k|  }
 3335|  18.3k|  const BLOCK_SIZE bsize = BLOCK_64X64;
 3336|       |  // Loop over sub-sample of frame, compute average sad over 64x64 blocks.
 3337|  18.3k|  uint64_t avg_sad = 0;
 3338|  18.3k|  uint64_t tmp_sad = 0;
 3339|  18.3k|  int num_samples = 0;
 3340|  18.3k|  const int thresh =
 3341|  18.3k|      ((cm->width * cm->height <= 320 * 240 && cpi->framerate < 10.0) ||
  ------------------
  |  Branch (3341:9): [True: 18.3k, False: 0]
  |  Branch (3341:48): [True: 0, False: 18.3k]
  ------------------
 3342|  18.3k|       (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN))
  ------------------
  |  Branch (3342:8): [True: 0, False: 18.3k]
  ------------------
 3343|  18.3k|          ? 5
 3344|  18.3k|          : 6;
 3345|       |  // SAD is computed on 64x64 blocks
 3346|  18.3k|  const int sb_size_by_mb = (cm->seq_params->sb_size == BLOCK_128X128)
  ------------------
  |  Branch (3346:29): [True: 0, False: 18.3k]
  ------------------
 3347|  18.3k|                                ? (cm->seq_params->mib_size >> 1)
 3348|  18.3k|                                : cm->seq_params->mib_size;
 3349|  18.3k|  const int sb_cols = (num_mi_cols + sb_size_by_mb - 1) / sb_size_by_mb;
 3350|  18.3k|  const int sb_rows = (num_mi_rows + sb_size_by_mb - 1) / sb_size_by_mb;
 3351|  18.3k|  uint64_t sum_sq_thresh = 10000;  // sum = sqrt(thresh / 64*64)) ~1.5
 3352|  18.3k|  int num_low_var_high_sumdiff = 0;
 3353|  18.3k|  int light_change = 0;
 3354|       |  // Flag to check light change or not.
 3355|  18.3k|  const int check_light_change = 0;
 3356|       |  // TODO(marpan): There seems some difference along the bottom border when
 3357|       |  // using the source_last_tl0 for last_source (used for temporal layers or
 3358|       |  // when previous frame is dropped).
 3359|       |  // Remove this border parameter when issue is resolved: difference is that
 3360|       |  // non-zero sad exists along bottom border even though source is static.
 3361|  18.3k|  const int border =
 3362|  18.3k|      rc->prev_frame_is_dropped || cpi->svc.number_temporal_layers > 1;
  ------------------
  |  Branch (3362:7): [True: 0, False: 18.3k]
  |  Branch (3362:36): [True: 0, False: 18.3k]
  ------------------
 3363|       |  // Store blkwise SAD for later use. Disable for spatial layers for now.
 3364|  18.3k|  if (width == cm->render_width && height == cm->render_height &&
  ------------------
  |  Branch (3364:7): [True: 0, False: 18.3k]
  |  Branch (3364:36): [True: 0, False: 0]
  ------------------
 3365|      0|      cpi->svc.number_spatial_layers == 1 && !is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (3365:7): [True: 0, False: 0]
  |  Branch (3365:46): [True: 0, False: 0]
  ------------------
 3366|      0|    if (cpi->src_sad_blk_alloc_size != sb_cols * sb_rows) {
  ------------------
  |  Branch (3366:9): [True: 0, False: 0]
  ------------------
 3367|      0|      aom_free(cpi->src_sad_blk_64x64);
 3368|      0|      CHECK_MEM_ERROR(cm, cpi->src_sad_blk_64x64,
  ------------------
  |  |   51|      0|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|      0|  do {                                                    \
  |  |  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|      0|    lval = (expr);                                        \
  |  |  |  |   74|      0|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3369|      0|                      (uint64_t *)aom_calloc(sb_cols * sb_rows,
 3370|      0|                                             sizeof(*cpi->src_sad_blk_64x64)));
 3371|      0|      cpi->src_sad_blk_alloc_size = sb_cols * sb_rows;
 3372|      0|    }
 3373|      0|  }
 3374|  18.3k|  const CommonModeInfoParams *const mi_params = &cpi->common.mi_params;
 3375|  18.3k|  const int mi_cols = mi_params->mi_cols;
 3376|  18.3k|  const int mi_rows = mi_params->mi_rows;
 3377|  18.3k|  unsigned char *const active_map_4x4 = cpi->active_map.map;
 3378|       |  // Avoid bottom and right border.
 3379|  41.5k|  for (int sbi_row = 0; sbi_row < sb_rows - border; ++sbi_row) {
  ------------------
  |  Branch (3379:25): [True: 23.2k, False: 18.3k]
  ------------------
 3380|  54.8k|    for (int sbi_col = 0; sbi_col < sb_cols; ++sbi_col) {
  ------------------
  |  Branch (3380:27): [True: 31.5k, False: 23.2k]
  ------------------
 3381|  31.5k|      int block_is_active = 1;
 3382|  31.5k|      if (cpi->active_map.enabled && rc->percent_blocks_inactive > 0) {
  ------------------
  |  Branch (3382:11): [True: 0, False: 31.5k]
  |  Branch (3382:38): [True: 0, False: 0]
  ------------------
 3383|       |        // Fix this to include skip feature via ROI.
 3384|      0|        block_is_active = set_block_is_active(active_map_4x4, mi_cols, mi_rows,
 3385|      0|                                              sbi_col, sbi_row);
 3386|      0|      }
 3387|  31.5k|      if (block_is_active) {
  ------------------
  |  Branch (3387:11): [True: 31.5k, False: 0]
  ------------------
 3388|  31.5k|        tmp_sad = cpi->ppi->fn_ptr[bsize].sdf(src_y, src_ystride, last_src_y,
 3389|  31.5k|                                              last_src_ystride);
 3390|  31.5k|      } else {
 3391|      0|        tmp_sad = 0;
 3392|      0|      }
 3393|  31.5k|      if (cpi->src_sad_blk_64x64 != NULL)
  ------------------
  |  Branch (3393:11): [True: 0, False: 31.5k]
  ------------------
 3394|      0|        cpi->src_sad_blk_64x64[sbi_col + sbi_row * sb_cols] = tmp_sad;
 3395|  31.5k|      if (check_light_change) {
  ------------------
  |  Branch (3395:11): [Folded, False: 31.5k]
  ------------------
 3396|      0|        unsigned int sse, variance;
 3397|      0|        variance = cpi->ppi->fn_ptr[bsize].vf(src_y, src_ystride, last_src_y,
 3398|      0|                                              last_src_ystride, &sse);
 3399|       |        // Note: sse - variance = ((sum * sum) >> 12)
 3400|       |        // Detect large lighting change.
 3401|      0|        if (variance < (sse >> 1) && (sse - variance) > sum_sq_thresh) {
  ------------------
  |  Branch (3401:13): [True: 0, False: 0]
  |  Branch (3401:38): [True: 0, False: 0]
  ------------------
 3402|      0|          num_low_var_high_sumdiff++;
 3403|      0|        }
 3404|      0|      }
 3405|  31.5k|      avg_sad += tmp_sad;
 3406|  31.5k|      num_samples++;
 3407|  31.5k|      if (tmp_sad == 0) num_zero_temp_sad++;
  ------------------
  |  Branch (3407:11): [True: 0, False: 31.5k]
  ------------------
 3408|  31.5k|      if (tmp_sad > rc->max_block_source_sad)
  ------------------
  |  Branch (3408:11): [True: 22.7k, False: 8.76k]
  ------------------
 3409|  22.7k|        rc->max_block_source_sad = tmp_sad;
 3410|       |
 3411|  31.5k|      src_y += 64;
 3412|  31.5k|      last_src_y += 64;
 3413|  31.5k|    }
 3414|  23.2k|    src_y += (src_ystride << 6) - (sb_cols << 6);
 3415|  23.2k|    last_src_y += (last_src_ystride << 6) - (sb_cols << 6);
 3416|  23.2k|  }
 3417|  18.3k|  if (check_light_change && num_samples > 0 &&
  ------------------
  |  Branch (3417:7): [Folded, False: 18.3k]
  |  Branch (3417:29): [True: 0, False: 0]
  ------------------
 3418|      0|      num_low_var_high_sumdiff > (num_samples >> 1))
  ------------------
  |  Branch (3418:7): [True: 0, False: 0]
  ------------------
 3419|      0|    light_change = 1;
 3420|  18.3k|  if (num_samples > 0) avg_sad = avg_sad / num_samples;
  ------------------
  |  Branch (3420:7): [True: 18.3k, False: 0]
  ------------------
 3421|       |  // Set high_source_sad flag if we detect very high increase in avg_sad
 3422|       |  // between current and previous frame value(s). Use minimum threshold
 3423|       |  // for cases where there is small change from content that is completely
 3424|       |  // static.
 3425|  18.3k|  const int thresh_zero_sad_samples =
 3426|  18.3k|      avg_sad > 8 * min_thresh ? 3 * (num_samples >> 2) : num_samples >> 1;
  ------------------
  |  Branch (3426:7): [True: 519, False: 17.7k]
  ------------------
 3427|  18.3k|  if (!light_change &&
  ------------------
  |  Branch (3427:7): [True: 18.3k, False: 0]
  ------------------
 3428|  18.3k|      avg_sad >
  ------------------
  |  Branch (3428:7): [True: 7.15k, False: 11.1k]
  ------------------
 3429|  18.3k|          AOMMAX(min_thresh, (unsigned int)(rc->avg_source_sad * thresh)) &&
  ------------------
  |  |   35|  36.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 6.12k, False: 12.1k]
  |  |  ------------------
  ------------------
 3430|  7.15k|      rc->frames_since_key > 1 + cpi->svc.number_spatial_layers &&
  ------------------
  |  Branch (3430:7): [True: 229, False: 6.92k]
  ------------------
 3431|    229|      num_zero_temp_sad < thresh_zero_sad_samples)
  ------------------
  |  Branch (3431:7): [True: 0, False: 229]
  ------------------
 3432|      0|    rc->high_source_sad = 1;
 3433|  18.3k|  else
 3434|  18.3k|    rc->high_source_sad = 0;
 3435|  18.3k|  rc->avg_source_sad = (3 * rc->avg_source_sad + avg_sad) >> 2;
 3436|  18.3k|  rc->frame_source_sad = avg_sad;
 3437|  18.3k|  if (num_samples > 0)
  ------------------
  |  Branch (3437:7): [True: 18.3k, False: 0]
  ------------------
 3438|  18.3k|    rc->percent_blocks_with_motion =
 3439|  18.3k|        ((num_samples - num_zero_temp_sad) * 100) / num_samples;
 3440|  18.3k|  if (rc->frame_source_sad > 0) rc->static_since_last_scene_change = 0;
  ------------------
  |  Branch (3440:7): [True: 18.3k, False: 0]
  ------------------
 3441|  18.3k|  if (rc->high_source_sad) {
  ------------------
  |  Branch (3441:7): [True: 0, False: 18.3k]
  ------------------
 3442|      0|    cpi->rc.frames_since_scene_change = 0;
 3443|      0|    rc->static_since_last_scene_change = 1;
 3444|      0|  }
 3445|       |  // Update the high_motion_content_screen_rtc flag on TL0. Avoid the update
 3446|       |  // if too many consecutive frame drops occurred.
 3447|       |  // The threshold_high_motion is kept to a large value, to account for
 3448|       |  // mis-detection for scroll for scaled input (where scroll motion can be
 3449|       |  // subpel and not detected below). The threshold may be improved when better
 3450|       |  // scroll detection (for subpel) is added.
 3451|  18.3k|  const int scale =
 3452|  18.3k|      (unscaled_src->y_width * unscaled_src->y_height > 1920 * 1080) ? 30 : 10;
  ------------------
  |  Branch (3452:7): [True: 0, False: 18.3k]
  ------------------
 3453|  18.3k|  const uint64_t thresh_high_motion = scale * 64 * 64;
 3454|  18.3k|  if (cpi->svc.temporal_layer_id == 0 && rc->drop_count_consec < 3) {
  ------------------
  |  Branch (3454:7): [True: 18.3k, False: 0]
  |  Branch (3454:42): [True: 18.3k, False: 0]
  ------------------
 3455|  18.3k|    cpi->rc.high_motion_content_screen_rtc = 0;
 3456|  18.3k|    if (cpi->oxcf.speed >= 11 && !is_one_pass_rt_lag_params(cpi) &&
  ------------------
  |  Branch (3456:9): [True: 0, False: 18.3k]
  |  Branch (3456:34): [True: 0, False: 0]
  ------------------
 3457|      0|        cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (3457:9): [True: 0, False: 0]
  ------------------
 3458|      0|        rc->num_col_blscroll_last_tl0 < 5 &&
  ------------------
  |  Branch (3458:9): [True: 0, False: 0]
  ------------------
 3459|      0|        rc->num_row_blscroll_last_tl0 < 5 &&
  ------------------
  |  Branch (3459:9): [True: 0, False: 0]
  ------------------
 3460|      0|        rc->percent_blocks_with_motion > 40 &&
  ------------------
  |  Branch (3460:9): [True: 0, False: 0]
  ------------------
 3461|      0|        rc->prev_avg_source_sad > thresh_high_motion &&
  ------------------
  |  Branch (3461:9): [True: 0, False: 0]
  ------------------
 3462|      0|        rc->avg_source_sad > thresh_high_motion &&
  ------------------
  |  Branch (3462:9): [True: 0, False: 0]
  ------------------
 3463|      0|        rc->frame_number_encoded - rc->last_frame_low_source_sad > 12 &&
  ------------------
  |  Branch (3463:9): [True: 0, False: 0]
  ------------------
 3464|      0|        rc->avg_frame_low_motion < 60 && unscaled_src->y_width >= 1280 &&
  ------------------
  |  Branch (3464:9): [True: 0, False: 0]
  |  Branch (3464:42): [True: 0, False: 0]
  ------------------
 3465|      0|        unscaled_src->y_height >= 720) {
  ------------------
  |  Branch (3465:9): [True: 0, False: 0]
  ------------------
 3466|      0|      cpi->rc.high_motion_content_screen_rtc = 1;
 3467|       |      // Compute fast coarse/global motion for 128x128 superblock centered
 3468|       |      // at middle of frame, and one to the upper left and one to lower right.
 3469|       |      // to determine if motion is scroll. Only test 3 points (pts) for now.
 3470|       |      // TODO(marpan): Only allow for 8 bit-depth for now.
 3471|      0|      if (cm->seq_params->bit_depth == 8) {
  ------------------
  |  Branch (3471:11): [True: 0, False: 0]
  ------------------
 3472|      0|        int sw_row = (cpi->rc.frame_source_sad > 20000) ? 512 : 192;
  ------------------
  |  Branch (3472:22): [True: 0, False: 0]
  ------------------
 3473|      0|        int sw_col = (cpi->rc.frame_source_sad > 20000) ? 512 : 160;
  ------------------
  |  Branch (3473:22): [True: 0, False: 0]
  ------------------
 3474|      0|        if (cm->width * cm->height >= 3840 * 2160 &&
  ------------------
  |  Branch (3474:13): [True: 0, False: 0]
  ------------------
 3475|      0|            cpi->svc.number_temporal_layers > 1) {
  ------------------
  |  Branch (3475:13): [True: 0, False: 0]
  ------------------
 3476|      0|          sw_row = sw_row << 1;
 3477|      0|          sw_col = sw_col << 1;
 3478|      0|        }
 3479|      0|        const int num_pts =
 3480|      0|            unscaled_src->y_width * unscaled_src->y_height >= 1920 * 1080 ? 3
  ------------------
  |  Branch (3480:13): [True: 0, False: 0]
  ------------------
 3481|      0|                                                                          : 1;
 3482|      0|        for (int pts = 0; pts < num_pts; pts++) {
  ------------------
  |  Branch (3482:27): [True: 0, False: 0]
  ------------------
 3483|       |          // fac and shift are used to move the center block for the other
 3484|       |          // two points (pts).
 3485|      0|          int fac = 1;
 3486|      0|          int shift = 1;
 3487|      0|          if (pts == 1) {
  ------------------
  |  Branch (3487:15): [True: 0, False: 0]
  ------------------
 3488|      0|            fac = 1;
 3489|      0|            shift = 2;
 3490|      0|          } else if (pts == 2) {
  ------------------
  |  Branch (3490:22): [True: 0, False: 0]
  ------------------
 3491|      0|            fac = 3;
 3492|      0|            shift = 2;
 3493|      0|          }
 3494|      0|          int pos_col = (fac * unscaled_src->y_width >> shift) - 64;
 3495|      0|          int pos_row = (fac * unscaled_src->y_height >> shift) - 64;
 3496|      0|          pos_col = AOMMAX(sw_col,
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  |  Branch (35:31): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3497|      0|                           AOMMIN(unscaled_src->y_width - sw_col - 1, pos_col));
 3498|      0|          pos_row = AOMMAX(
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  |  Branch (35:31): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3499|      0|              sw_row, AOMMIN(unscaled_src->y_height - sw_row - 1, pos_row));
 3500|      0|          if (pos_col >= 0 && pos_col < unscaled_src->y_width - 64 &&
  ------------------
  |  Branch (3500:15): [True: 0, False: 0]
  |  Branch (3500:31): [True: 0, False: 0]
  ------------------
 3501|      0|              pos_row >= 0 && pos_row < unscaled_src->y_height - 64) {
  ------------------
  |  Branch (3501:15): [True: 0, False: 0]
  |  Branch (3501:31): [True: 0, False: 0]
  ------------------
 3502|      0|            src_y = unscaled_src->y_buffer + pos_row * src_ystride + pos_col;
 3503|      0|            last_src_y = unscaled_last_src->y_buffer +
 3504|      0|                         pos_row * last_src_ystride + pos_col;
 3505|      0|            int best_intmv_col = 0;
 3506|      0|            int best_intmv_row = 0;
 3507|      0|            unsigned int y_sad = estimate_scroll_motion(
 3508|      0|                cpi, src_y, last_src_y, src_ystride, last_src_ystride,
 3509|      0|                BLOCK_128X128, pos_col, pos_row, &best_intmv_col,
 3510|      0|                &best_intmv_row, sw_col, sw_row);
 3511|      0|            unsigned int sad_thresh =
 3512|      0|                (abs(best_intmv_col) > 150 || abs(best_intmv_row) > 150) ? 300
  ------------------
  |  Branch (3512:18): [True: 0, False: 0]
  |  Branch (3512:47): [True: 0, False: 0]
  ------------------
 3513|      0|                                                                         : 150;
 3514|      0|            if (y_sad < sad_thresh &&
  ------------------
  |  Branch (3514:17): [True: 0, False: 0]
  ------------------
 3515|      0|                (abs(best_intmv_col) > 16 || abs(best_intmv_row) > 16)) {
  ------------------
  |  Branch (3515:18): [True: 0, False: 0]
  |  Branch (3515:46): [True: 0, False: 0]
  ------------------
 3516|      0|              cpi->rc.high_motion_content_screen_rtc = 0;
 3517|      0|              break;
 3518|      0|            }
 3519|      0|          }
 3520|      0|        }
 3521|      0|      }
 3522|      0|    }
 3523|       |    // Pass the flag value to all layer frames.
 3524|  18.3k|    if (cpi->svc.number_spatial_layers > 1 ||
  ------------------
  |  Branch (3524:9): [True: 0, False: 18.3k]
  ------------------
 3525|  18.3k|        cpi->svc.number_temporal_layers > 1) {
  ------------------
  |  Branch (3525:9): [True: 0, False: 18.3k]
  ------------------
 3526|      0|      SVC *svc = &cpi->svc;
 3527|      0|      for (int sl = 0; sl < svc->number_spatial_layers; ++sl) {
  ------------------
  |  Branch (3527:24): [True: 0, False: 0]
  ------------------
 3528|      0|        for (int tl = 1; tl < svc->number_temporal_layers; ++tl) {
  ------------------
  |  Branch (3528:26): [True: 0, False: 0]
  ------------------
 3529|      0|          const int layer =
 3530|      0|              LAYER_IDS_TO_IDX(sl, tl, svc->number_temporal_layers);
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 3531|      0|          LAYER_CONTEXT *lc = &svc->layer_context[layer];
 3532|      0|          RATE_CONTROL *lrc = &lc->rc;
 3533|      0|          lrc->high_motion_content_screen_rtc =
 3534|      0|              rc->high_motion_content_screen_rtc;
 3535|      0|        }
 3536|      0|      }
 3537|      0|    }
 3538|  18.3k|  }
 3539|       |  // Scene detection is only on base SLO, and using full/original resolution.
 3540|       |  // Pass the state to the upper spatial layers.
 3541|  18.3k|  if (cpi->svc.number_spatial_layers > 1) {
  ------------------
  |  Branch (3541:7): [True: 0, False: 18.3k]
  ------------------
 3542|      0|    SVC *svc = &cpi->svc;
 3543|      0|    for (int sl = 0; sl < svc->number_spatial_layers; ++sl) {
  ------------------
  |  Branch (3543:22): [True: 0, False: 0]
  ------------------
 3544|      0|      int tl = svc->temporal_layer_id;
 3545|      0|      const int layer = LAYER_IDS_TO_IDX(sl, tl, svc->number_temporal_layers);
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 3546|      0|      LAYER_CONTEXT *lc = &svc->layer_context[layer];
 3547|      0|      RATE_CONTROL *lrc = &lc->rc;
 3548|      0|      lrc->high_source_sad = rc->high_source_sad;
 3549|      0|      lrc->frame_source_sad = rc->frame_source_sad;
 3550|      0|      lrc->avg_source_sad = rc->avg_source_sad;
 3551|      0|      lrc->percent_blocks_with_motion = rc->percent_blocks_with_motion;
 3552|      0|      lrc->max_block_source_sad = rc->max_block_source_sad;
 3553|      0|    }
 3554|      0|  }
 3555|  18.3k|}
av1_get_one_pass_rt_params:
 3854|  24.4k|                                unsigned int frame_flags) {
 3855|  24.4k|  RATE_CONTROL *const rc = &cpi->rc;
 3856|  24.4k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 3857|  24.4k|  AV1_COMMON *const cm = &cpi->common;
 3858|  24.4k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 3859|  24.4k|  SVC *const svc = &cpi->svc;
 3860|  24.4k|  ResizePendingParams *const resize_pending_params =
 3861|  24.4k|      &cpi->resize_pending_params;
 3862|  24.4k|  int target;
 3863|  24.4k|  const int layer =
 3864|  24.4k|      LAYER_IDS_TO_IDX(svc->spatial_layer_id, svc->temporal_layer_id,
  ------------------
  |  | 4254|  24.4k|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 3865|  24.4k|                       svc->number_temporal_layers);
 3866|  24.4k|  if (cpi->oxcf.rc_cfg.max_consec_drop_ms > 0) {
  ------------------
  |  Branch (3866:7): [True: 0, False: 24.4k]
  ------------------
 3867|      0|    double framerate =
 3868|      0|        cpi->framerate > 1 ? round(cpi->framerate) : cpi->framerate;
  ------------------
  |  Branch (3868:9): [True: 0, False: 0]
  ------------------
 3869|      0|    rc->max_consec_drop = saturate_cast_double_to_int(
 3870|      0|        ceil(cpi->oxcf.rc_cfg.max_consec_drop_ms * framerate / 1000));
 3871|      0|  }
 3872|  24.4k|  if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (3872:7): [True: 0, False: 24.4k]
  ------------------
 3873|      0|    av1_update_temporal_layer_framerate(cpi);
 3874|      0|    av1_restore_layer_context(cpi);
 3875|      0|  }
 3876|  24.4k|  cpi->ppi->rtc_ref.bias_recovery_frame = set_flag_rps_bias_recovery_frame(cpi);
 3877|       |  // Set frame type.
 3878|  24.4k|  if (set_key_frame(cpi, frame_flags)) {
  ------------------
  |  Branch (3878:7): [True: 6.10k, False: 18.3k]
  ------------------
 3879|  6.10k|    *frame_type = KEY_FRAME;
 3880|  6.10k|    p_rc->this_key_frame_forced =
 3881|  6.10k|        cm->current_frame.frame_number != 0 && rc->frames_to_key == 0;
  ------------------
  |  Branch (3881:9): [True: 0, False: 6.10k]
  |  Branch (3881:48): [True: 0, False: 0]
  ------------------
 3882|  6.10k|    rc->frames_to_key = cpi->oxcf.kf_cfg.key_freq_max;
 3883|  6.10k|    p_rc->kf_boost = DEFAULT_KF_BOOST_RT;
  ------------------
  |  |   57|  6.10k|#define DEFAULT_KF_BOOST_RT 2300
  ------------------
 3884|  6.10k|    gf_group->update_type[cpi->gf_frame_index] = KF_UPDATE;
 3885|  6.10k|    gf_group->frame_type[cpi->gf_frame_index] = KEY_FRAME;
 3886|  6.10k|    gf_group->refbuf_state[cpi->gf_frame_index] = REFBUF_RESET;
 3887|  6.10k|    if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (3887:9): [True: 0, False: 6.10k]
  ------------------
 3888|      0|      if (cm->current_frame.frame_number > 0)
  ------------------
  |  Branch (3888:11): [True: 0, False: 0]
  ------------------
 3889|      0|        av1_svc_reset_temporal_layers(cpi, 1);
 3890|      0|      svc->layer_context[layer].is_key_frame = 1;
 3891|      0|    }
 3892|  6.10k|    rc->frame_number_encoded = 0;
 3893|  6.10k|    cpi->ppi->rtc_ref.non_reference_frame = 0;
 3894|  6.10k|    rc->static_since_last_scene_change = 0;
 3895|  18.3k|  } else {
 3896|  18.3k|    *frame_type = INTER_FRAME;
 3897|  18.3k|    gf_group->update_type[cpi->gf_frame_index] = LF_UPDATE;
 3898|  18.3k|    gf_group->frame_type[cpi->gf_frame_index] = INTER_FRAME;
 3899|  18.3k|    gf_group->refbuf_state[cpi->gf_frame_index] = REFBUF_UPDATE;
 3900|  18.3k|    if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (3900:9): [True: 0, False: 18.3k]
  ------------------
 3901|      0|      LAYER_CONTEXT *lc = &svc->layer_context[layer];
 3902|      0|      lc->is_key_frame =
 3903|      0|          svc->spatial_layer_id == 0
  ------------------
  |  Branch (3903:11): [True: 0, False: 0]
  ------------------
 3904|      0|              ? 0
 3905|      0|              : svc->layer_context[svc->temporal_layer_id].is_key_frame;
 3906|      0|    }
 3907|       |    // If the user is setting the reference structure with
 3908|       |    // set_ref_frame_config and did not set any references, set the
 3909|       |    // frame type to Intra-only.
 3910|  18.3k|    if (cpi->ppi->rtc_ref.set_ref_frame_config) {
  ------------------
  |  Branch (3910:9): [True: 0, False: 18.3k]
  ------------------
 3911|      0|      int no_references_set = 1;
 3912|      0|      for (int i = 0; i < INTER_REFS_PER_FRAME; i++) {
  ------------------
  |  Branch (3912:23): [True: 0, False: 0]
  ------------------
 3913|      0|        if (cpi->ppi->rtc_ref.reference[i]) {
  ------------------
  |  Branch (3913:13): [True: 0, False: 0]
  ------------------
 3914|      0|          no_references_set = 0;
 3915|      0|          break;
 3916|      0|        }
 3917|      0|      }
 3918|       |
 3919|       |      // Set to intra_only_frame if no references are set.
 3920|       |      // The stream can start decoding on INTRA_ONLY_FRAME so long as the
 3921|       |      // layer with the intra_only_frame doesn't signal a reference to a slot
 3922|       |      // that hasn't been set yet.
 3923|      0|      if (no_references_set) *frame_type = INTRA_ONLY_FRAME;
  ------------------
  |  Branch (3923:11): [True: 0, False: 0]
  ------------------
 3924|      0|    }
 3925|  18.3k|  }
 3926|  24.4k|  if (cpi->active_map.enabled && cpi->rc.percent_blocks_inactive == 100) {
  ------------------
  |  Branch (3926:7): [True: 0, False: 24.4k]
  |  Branch (3926:34): [True: 0, False: 0]
  ------------------
 3927|      0|    rc->frame_source_sad = 0;
 3928|      0|    rc->avg_source_sad = (3 * rc->avg_source_sad + rc->frame_source_sad) >> 2;
 3929|      0|    rc->percent_blocks_with_motion = 0;
 3930|      0|    rc->high_source_sad = 0;
 3931|  24.4k|  } else if (cpi->sf.rt_sf.check_scene_detection &&
  ------------------
  |  Branch (3931:14): [True: 24.4k, False: 0]
  ------------------
 3932|  24.4k|             svc->spatial_layer_id == 0) {
  ------------------
  |  Branch (3932:14): [True: 24.4k, False: 0]
  ------------------
 3933|  24.4k|    if (rc->prev_coded_width == cm->width &&
  ------------------
  |  Branch (3933:9): [True: 18.3k, False: 6.10k]
  ------------------
 3934|  18.3k|        rc->prev_coded_height == cm->height) {
  ------------------
  |  Branch (3934:9): [True: 18.3k, False: 0]
  ------------------
 3935|  18.3k|      av1_rc_scene_detection_onepass_rt(cpi, frame_input);
 3936|  18.3k|    } else {
 3937|  6.10k|      aom_free(cpi->src_sad_blk_64x64);
 3938|  6.10k|      cpi->src_sad_blk_64x64 = NULL;
 3939|  6.10k|      cpi->src_sad_blk_alloc_size = 0;
 3940|  6.10k|    }
 3941|  24.4k|  }
 3942|  24.4k|  if (cpi->sf.rt_sf.rc_compute_spatial_var_sc_kf &&
  ------------------
  |  Branch (3942:7): [True: 0, False: 24.4k]
  ------------------
 3943|      0|      (*frame_type == KEY_FRAME || rc->high_source_sad) &&
  ------------------
  |  Branch (3943:8): [True: 0, False: 0]
  |  Branch (3943:36): [True: 0, False: 0]
  ------------------
 3944|      0|      svc->spatial_layer_id == 0 && !cm->seq_params->use_highbitdepth &&
  ------------------
  |  Branch (3944:7): [True: 0, False: 0]
  |  Branch (3944:37): [True: 0, False: 0]
  ------------------
 3945|      0|      cpi->oxcf.rc_cfg.max_intra_bitrate_pct > 0)
  ------------------
  |  Branch (3945:7): [True: 0, False: 0]
  ------------------
 3946|      0|    rc_spatial_act_onepass_rt(cpi, frame_input->source->y_buffer,
 3947|      0|                              frame_input->source->y_stride);
 3948|       |  // Check for dynamic resize, for single spatial layer for now.
 3949|       |  // For temporal layers only check on base temporal layer.
 3950|  24.4k|  if (cpi->oxcf.resize_cfg.resize_mode == RESIZE_DYNAMIC) {
  ------------------
  |  Branch (3950:7): [True: 0, False: 24.4k]
  ------------------
 3951|      0|    if (svc->number_spatial_layers == 1 && svc->temporal_layer_id == 0)
  ------------------
  |  Branch (3951:9): [True: 0, False: 0]
  |  Branch (3951:44): [True: 0, False: 0]
  ------------------
 3952|      0|      dynamic_resize_one_pass_cbr(cpi, /*one_half_only=*/1);
 3953|      0|    if (rc->resize_state == THREE_QUARTER) {
  ------------------
  |  Branch (3953:9): [True: 0, False: 0]
  ------------------
 3954|      0|      resize_pending_params->width = (3 + cpi->oxcf.frm_dim_cfg.width * 3) >> 2;
 3955|      0|      resize_pending_params->height =
 3956|      0|          (3 + cpi->oxcf.frm_dim_cfg.height * 3) >> 2;
 3957|      0|    } else if (rc->resize_state == ONE_HALF) {
  ------------------
  |  Branch (3957:16): [True: 0, False: 0]
  ------------------
 3958|      0|      resize_pending_params->width = (1 + cpi->oxcf.frm_dim_cfg.width) >> 1;
 3959|      0|      resize_pending_params->height = (1 + cpi->oxcf.frm_dim_cfg.height) >> 1;
 3960|      0|    } else {
 3961|      0|      resize_pending_params->width = cpi->oxcf.frm_dim_cfg.width;
 3962|      0|      resize_pending_params->height = cpi->oxcf.frm_dim_cfg.height;
 3963|      0|    }
 3964|  24.4k|  } else if (is_frame_resize_pending(cpi)) {
  ------------------
  |  Branch (3964:14): [True: 15.1k, False: 9.28k]
  ------------------
 3965|  15.1k|    resize_reset_rc(cpi, resize_pending_params->width,
 3966|  15.1k|                    resize_pending_params->height, cm->width, cm->height);
 3967|  15.1k|  }
 3968|       |  // Set the GF interval and update flag.
 3969|  24.4k|  if (!rc->rtc_external_ratectrl)
  ------------------
  |  Branch (3969:7): [True: 24.4k, False: 0]
  ------------------
 3970|  24.4k|    set_gf_interval_update_onepass_rt(cpi, *frame_type);
 3971|       |  // Set target size.
 3972|  24.4k|  if (cpi->oxcf.rc_cfg.mode == AOM_CBR) {
  ------------------
  |  Branch (3972:7): [True: 24.4k, False: 0]
  ------------------
 3973|  24.4k|    if (*frame_type == KEY_FRAME || *frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (3973:9): [True: 6.10k, False: 18.3k]
  |  Branch (3973:37): [True: 0, False: 18.3k]
  ------------------
 3974|  6.10k|      target = av1_calc_iframe_target_size_one_pass_cbr(cpi);
 3975|  18.3k|    } else {
 3976|  18.3k|      target = av1_calc_pframe_target_size_one_pass_cbr(
 3977|  18.3k|          cpi, gf_group->update_type[cpi->gf_frame_index]);
 3978|  18.3k|    }
 3979|  24.4k|  } else {
 3980|      0|    if (*frame_type == KEY_FRAME || *frame_type == INTRA_ONLY_FRAME) {
  ------------------
  |  Branch (3980:9): [True: 0, False: 0]
  |  Branch (3980:37): [True: 0, False: 0]
  ------------------
 3981|      0|      target = av1_calc_iframe_target_size_one_pass_vbr(cpi);
 3982|      0|    } else {
 3983|      0|      target = av1_calc_pframe_target_size_one_pass_vbr(
 3984|      0|          cpi, gf_group->update_type[cpi->gf_frame_index]);
 3985|      0|    }
 3986|      0|  }
 3987|  24.4k|  if (cpi->oxcf.rc_cfg.mode == AOM_Q)
  ------------------
  |  Branch (3987:7): [True: 0, False: 24.4k]
  ------------------
 3988|      0|    rc->active_worst_quality = cpi->oxcf.rc_cfg.cq_level;
 3989|       |
 3990|  24.4k|  av1_rc_set_frame_target(cpi, target, cm->width, cm->height);
 3991|  24.4k|  rc->base_frame_target = target;
 3992|  24.4k|  cm->current_frame.frame_type = *frame_type;
 3993|       |  // For fixed mode SVC: if KSVC is enabled remove inter layer
 3994|       |  // prediction on spatial enhancement layer frames for frames
 3995|       |  // whose base is not KEY frame.
 3996|  24.4k|  if (cpi->ppi->use_svc && !svc->use_flexible_mode && svc->ksvc_fixed_mode &&
  ------------------
  |  Branch (3996:7): [True: 0, False: 24.4k]
  |  Branch (3996:28): [True: 0, False: 0]
  |  Branch (3996:55): [True: 0, False: 0]
  ------------------
 3997|      0|      svc->number_spatial_layers > 1 &&
  ------------------
  |  Branch (3997:7): [True: 0, False: 0]
  ------------------
 3998|      0|      !svc->layer_context[layer].is_key_frame) {
  ------------------
  |  Branch (3998:7): [True: 0, False: 0]
  ------------------
 3999|      0|    ExternalFlags *const ext_flags = &cpi->ext_flags;
 4000|      0|    ext_flags->ref_frame_flags ^= AOM_GOLD_FLAG;
 4001|      0|  }
 4002|  24.4k|}
ratectrl.c:rc_init_minq_luts:
  182|      1|static void rc_init_minq_luts(void) {
  183|      1|  init_minq_luts(kf_low_motion_minq_8, kf_high_motion_minq_8,
  184|      1|                 arfgf_low_motion_minq_8, arfgf_high_motion_minq_8,
  185|      1|                 inter_minq_8, rtc_minq_8, AOM_BITS_8);
  186|      1|  init_minq_luts(kf_low_motion_minq_10, kf_high_motion_minq_10,
  187|      1|                 arfgf_low_motion_minq_10, arfgf_high_motion_minq_10,
  188|      1|                 inter_minq_10, rtc_minq_10, AOM_BITS_10);
  189|      1|  init_minq_luts(kf_low_motion_minq_12, kf_high_motion_minq_12,
  190|      1|                 arfgf_low_motion_minq_12, arfgf_high_motion_minq_12,
  191|      1|                 inter_minq_12, rtc_minq_12, AOM_BITS_12);
  192|      1|}
ratectrl.c:init_minq_luts:
  160|      3|                           aom_bit_depth_t bit_depth) {
  161|      3|  int i;
  162|      9|  for (int mode = 0; mode < MODE_NUM; mode++) {
  ------------------
  |  |   45|      9|#define MODE_NUM 2
  ------------------
  |  Branch (162:22): [True: 6, False: 3]
  ------------------
  163|     18|    for (int res = 0; res < RES_NUM; res++) {
  ------------------
  |  |   44|     18|#define RES_NUM 2
  ------------------
  |  Branch (163:23): [True: 12, False: 6]
  ------------------
  164|  3.08k|      for (i = 0; i < QINDEX_RANGE; i++) {
  ------------------
  |  |   27|  3.08k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  3.08k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  3.08k|#define MINQ 0
  |  |  ------------------
  ------------------
  |  Branch (164:19): [True: 3.07k, False: 12]
  ------------------
  165|  3.07k|        const double maxq = av1_convert_qindex_to_q(i, bit_depth);
  166|  3.07k|        kf_low_m[mode][res][i] = get_minq_index(maxq, 0.000001, -0.0004,
  167|  3.07k|                                                x1[mode][res][0], bit_depth);
  168|  3.07k|        kf_high_m[mode][res][i] = get_minq_index(maxq, 0.0000021, -0.00125,
  169|  3.07k|                                                 x1[mode][res][1], bit_depth);
  170|  3.07k|        arfgf_low[mode][res][i] = get_minq_index(maxq, 0.0000015, -0.0009,
  171|  3.07k|                                                 x1[mode][res][2], bit_depth);
  172|  3.07k|        arfgf_high[mode][res][i] = get_minq_index(maxq, 0.0000021, -0.00125,
  173|  3.07k|                                                  x1[mode][res][3], bit_depth);
  174|  3.07k|        inter[mode][res][i] = get_minq_index(maxq, 0.00000271, -0.00113,
  175|  3.07k|                                             x1[mode][res][4], bit_depth);
  176|  3.07k|        rtc[i] = get_minq_index(maxq, 0.00000271, -0.00113, 0.70, bit_depth);
  177|  3.07k|      }
  178|     12|    }
  179|      6|  }
  180|      3|}
ratectrl.c:get_minq_index:
  134|  18.4k|                          aom_bit_depth_t bit_depth) {
  135|  18.4k|  const double minqtarget = AOMMIN(((x3 * maxq + x2) * maxq + x1) * maxq, maxq);
  ------------------
  |  |   34|  18.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 16.8k, False: 1.53k]
  |  |  ------------------
  ------------------
  136|       |
  137|       |  // Special case handling to deal with the step from q2.0
  138|       |  // down to lossless mode represented by q 1.0.
  139|  18.4k|  if (minqtarget <= 2.0) return 0;
  ------------------
  |  Branch (139:7): [True: 1.53k, False: 16.8k]
  ------------------
  140|       |
  141|  16.8k|  return av1_find_qindex(minqtarget, bit_depth, 0, QINDEX_RANGE - 1);
  ------------------
  |  |   27|  16.8k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  16.8k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  16.8k|#define MINQ 0
  |  |  ------------------
  ------------------
  142|  18.4k|}
ratectrl.c:get_bpmb_enumerator:
  227|   309k|                               const int is_screen_content_type) {
  228|   309k|  int enumerator;
  229|       |
  230|   309k|  if (is_screen_content_type) {
  ------------------
  |  Branch (230:7): [True: 7.92k, False: 301k]
  ------------------
  231|  7.92k|    enumerator = (frame_type == KEY_FRAME) ? 1000000 : 750000;
  ------------------
  |  Branch (231:18): [True: 1.98k, False: 5.94k]
  ------------------
  232|   301k|  } else {
  233|   301k|    enumerator = (frame_type == KEY_FRAME) ? 2000000 : 1500000;
  ------------------
  |  Branch (233:18): [True: 125k, False: 175k]
  ------------------
  234|   301k|  }
  235|       |
  236|   309k|  return enumerator;
  237|   309k|}
ratectrl.c:get_default_max_gf_interval:
  453|   266k|static int get_default_max_gf_interval(double framerate, int min_gf_interval) {
  454|   266k|  int interval = AOMMIN(MAX_GF_INTERVAL, (int)(framerate * 0.75));
  ------------------
  |  |   34|   266k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 266k]
  |  |  ------------------
  ------------------
  455|   266k|  interval += (interval & 0x01);  // Round to even value
  456|   266k|  interval = AOMMAX(MAX_GF_INTERVAL, interval);
  ------------------
  |  |   35|   266k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 266k, False: 0]
  |  |  ------------------
  ------------------
  457|   266k|  return AOMMAX(interval, min_gf_interval);
  ------------------
  |  |   35|   266k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 266k, False: 0]
  |  |  ------------------
  ------------------
  458|   266k|}
ratectrl.c:get_rate_correction_factor:
  839|   113k|                                         int height) {
  840|   113k|  const RATE_CONTROL *const rc = &cpi->rc;
  841|   113k|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  842|   113k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
  843|   113k|  double rcf;
  844|   113k|  double rate_correction_factors_kfstd;
  845|   113k|  double rate_correction_factors_gfarfstd;
  846|   113k|  double rate_correction_factors_internormal;
  847|       |
  848|   113k|  rate_correction_factors_kfstd =
  849|   113k|      (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (849:7): [True: 0, False: 113k]
  ------------------
  850|   113k|          ? rc->frame_level_rate_correction_factors[KF_STD]
  851|   113k|          : p_rc->rate_correction_factors[KF_STD];
  852|   113k|  rate_correction_factors_gfarfstd =
  853|   113k|      (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (853:7): [True: 0, False: 113k]
  ------------------
  854|   113k|          ? rc->frame_level_rate_correction_factors[GF_ARF_STD]
  855|   113k|          : p_rc->rate_correction_factors[GF_ARF_STD];
  856|   113k|  rate_correction_factors_internormal =
  857|   113k|      (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (857:7): [True: 0, False: 113k]
  ------------------
  858|   113k|          ? rc->frame_level_rate_correction_factors[INTER_NORMAL]
  859|   113k|          : p_rc->rate_correction_factors[INTER_NORMAL];
  860|       |
  861|   113k|  if (cpi->common.current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (861:7): [True: 35.2k, False: 77.8k]
  ------------------
  862|  35.2k|    rcf = rate_correction_factors_kfstd;
  863|  77.8k|  } else if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (863:14): [True: 0, False: 77.8k]
  ------------------
  864|      0|    const RATE_FACTOR_LEVEL rf_lvl =
  865|      0|        get_rate_factor_level(&cpi->ppi->gf_group, cpi->gf_frame_index);
  866|      0|    double rate_correction_factors_rflvl =
  867|      0|        (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
  ------------------
  |  Branch (867:9): [True: 0, False: 0]
  ------------------
  868|      0|            ? rc->frame_level_rate_correction_factors[rf_lvl]
  869|      0|            : p_rc->rate_correction_factors[rf_lvl];
  870|      0|    rcf = rate_correction_factors_rflvl;
  871|  77.8k|  } else {
  872|  77.8k|    if ((refresh_frame->alt_ref_frame || refresh_frame->golden_frame) &&
  ------------------
  |  Branch (872:10): [True: 0, False: 77.8k]
  |  Branch (872:42): [True: 0, False: 77.8k]
  ------------------
  873|      0|        !rc->is_src_frame_alt_ref && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (873:9): [True: 0, False: 0]
  |  Branch (873:38): [True: 0, False: 0]
  ------------------
  874|      0|        (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
  ------------------
  |  Branch (874:10): [True: 0, False: 0]
  ------------------
  875|      0|         cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20))
  ------------------
  |  Branch (875:10): [True: 0, False: 0]
  ------------------
  876|      0|      rcf = rate_correction_factors_gfarfstd;
  877|  77.8k|    else
  878|  77.8k|      rcf = rate_correction_factors_internormal;
  879|  77.8k|  }
  880|   113k|  rcf *= resize_rate_factor(&cpi->oxcf.frm_dim_cfg, width, height);
  881|   113k|  return fclamp(rcf, MIN_BPB_FACTOR, MAX_BPB_FACTOR);
  ------------------
  |  |   52|   113k|#define MIN_BPB_FACTOR 0.005
  ------------------
                return fclamp(rcf, MIN_BPB_FACTOR, MAX_BPB_FACTOR);
  ------------------
  |  |   53|   113k|#define MAX_BPB_FACTOR 50
  ------------------
  882|   113k|}
ratectrl.c:set_rate_correction_factor:
  901|  73.6k|                                       double factor, int width, int height) {
  902|  73.6k|  RATE_CONTROL *const rc = &cpi->rc;
  903|  73.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  904|  73.6k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
  905|  73.6k|  int update_default_rcf = 1;
  906|       |  // Normalize RCF to account for the size-dependent scaling factor.
  907|  73.6k|  factor /= resize_rate_factor(&cpi->oxcf.frm_dim_cfg, width, height);
  908|       |
  909|  73.6k|  factor = fclamp(factor, MIN_BPB_FACTOR, MAX_BPB_FACTOR);
  ------------------
  |  |   52|  73.6k|#define MIN_BPB_FACTOR 0.005
  ------------------
                factor = fclamp(factor, MIN_BPB_FACTOR, MAX_BPB_FACTOR);
  ------------------
  |  |   53|  73.6k|#define MAX_BPB_FACTOR 50
  ------------------
  910|       |
  911|  73.6k|  if (cpi->common.current_frame.frame_type == KEY_FRAME) {
  ------------------
  |  Branch (911:7): [True: 18.4k, False: 55.2k]
  ------------------
  912|  18.4k|    p_rc->rate_correction_factors[KF_STD] = factor;
  913|  55.2k|  } else if (is_stat_consumption_stage(cpi)) {
  ------------------
  |  Branch (913:14): [True: 0, False: 55.2k]
  ------------------
  914|      0|    const RATE_FACTOR_LEVEL rf_lvl =
  915|      0|        get_rate_factor_level(&cpi->ppi->gf_group, cpi->gf_frame_index);
  916|      0|    if (is_encode_stage &&
  ------------------
  |  Branch (916:9): [True: 0, False: 0]
  ------------------
  917|      0|        cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (917:9): [True: 0, False: 0]
  ------------------
  918|      0|      rc->frame_level_rate_correction_factors[rf_lvl] = factor;
  919|      0|      update_default_rcf = 0;
  920|      0|    }
  921|      0|    if (update_default_rcf) p_rc->rate_correction_factors[rf_lvl] = factor;
  ------------------
  |  Branch (921:9): [True: 0, False: 0]
  ------------------
  922|  55.2k|  } else {
  923|  55.2k|    if ((refresh_frame->alt_ref_frame || refresh_frame->golden_frame) &&
  ------------------
  |  Branch (923:10): [True: 0, False: 55.2k]
  |  Branch (923:42): [True: 0, False: 55.2k]
  ------------------
  924|      0|        !rc->is_src_frame_alt_ref && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (924:9): [True: 0, False: 0]
  |  Branch (924:38): [True: 0, False: 0]
  ------------------
  925|      0|        (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
  ------------------
  |  Branch (925:10): [True: 0, False: 0]
  ------------------
  926|      0|         cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20)) {
  ------------------
  |  Branch (926:10): [True: 0, False: 0]
  ------------------
  927|      0|      p_rc->rate_correction_factors[GF_ARF_STD] = factor;
  928|  55.2k|    } else {
  929|  55.2k|      if (is_encode_stage &&
  ------------------
  |  Branch (929:11): [True: 0, False: 55.2k]
  ------------------
  930|      0|          cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
  ------------------
  |  Branch (930:11): [True: 0, False: 0]
  ------------------
  931|      0|        rc->frame_level_rate_correction_factors[INTER_NORMAL] = factor;
  932|      0|        update_default_rcf = 0;
  933|      0|      }
  934|  55.2k|      if (update_default_rcf)
  ------------------
  |  Branch (934:11): [True: 55.2k, False: 0]
  ------------------
  935|  55.2k|        p_rc->rate_correction_factors[INTER_NORMAL] = factor;
  936|  55.2k|    }
  937|  55.2k|  }
  938|  73.6k|}
ratectrl.c:find_closest_qindex_by_rate:
 1091|  39.5k|                                       int best_qindex, int worst_qindex) {
 1092|  39.5k|  const int use_cyclic_refresh = cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (1092:34): [True: 0, False: 39.5k]
  ------------------
 1093|      0|                                 cpi->cyclic_refresh->apply_cyclic_refresh;
  ------------------
  |  Branch (1093:34): [True: 0, False: 0]
  ------------------
 1094|       |
 1095|       |  // Find 'qindex' based on 'desired_bits_per_mb'.
 1096|  39.5k|  assert(best_qindex <= worst_qindex);
 1097|  39.5k|  int low = best_qindex;
 1098|  39.5k|  int high = worst_qindex;
 1099|   233k|  while (low < high) {
  ------------------
  |  Branch (1099:10): [True: 194k, False: 39.5k]
  ------------------
 1100|   194k|    const int mid = (low + high) >> 1;
 1101|   194k|    const int mid_bits_per_mb =
 1102|   194k|        get_bits_per_mb(cpi, use_cyclic_refresh, correction_factor, mid);
 1103|   194k|    if (mid_bits_per_mb > desired_bits_per_mb) {
  ------------------
  |  Branch (1103:9): [True: 14.4k, False: 179k]
  ------------------
 1104|  14.4k|      low = mid + 1;
 1105|   179k|    } else {
 1106|   179k|      high = mid;
 1107|   179k|    }
 1108|   194k|  }
 1109|  39.5k|  assert(low == high);
 1110|       |
 1111|       |  // Calculate rate difference of this q index from the desired rate.
 1112|  39.5k|  const int curr_q = low;
 1113|  39.5k|  const int curr_bits_per_mb =
 1114|  39.5k|      get_bits_per_mb(cpi, use_cyclic_refresh, correction_factor, curr_q);
 1115|  39.5k|  const int curr_bit_diff = (curr_bits_per_mb <= desired_bits_per_mb)
  ------------------
  |  Branch (1115:29): [True: 35.8k, False: 3.62k]
  ------------------
 1116|  39.5k|                                ? desired_bits_per_mb - curr_bits_per_mb
 1117|  39.5k|                                : INT_MAX;
 1118|  39.5k|  assert((curr_bit_diff != INT_MAX && curr_bit_diff >= 0) ||
 1119|  39.5k|         curr_q == worst_qindex);
 1120|       |
 1121|       |  // Calculate rate difference for previous q index too.
 1122|  39.5k|  const int prev_q = curr_q - 1;
 1123|  39.5k|  int prev_bit_diff;
 1124|  39.5k|  if (curr_bit_diff == INT_MAX || curr_q == best_qindex) {
  ------------------
  |  Branch (1124:7): [True: 3.62k, False: 35.8k]
  |  Branch (1124:35): [True: 34.1k, False: 1.71k]
  ------------------
 1125|  37.7k|    prev_bit_diff = INT_MAX;
 1126|  37.7k|  } else {
 1127|  1.71k|    const int prev_bits_per_mb =
 1128|  1.71k|        get_bits_per_mb(cpi, use_cyclic_refresh, correction_factor, prev_q);
 1129|  1.71k|    assert(prev_bits_per_mb > desired_bits_per_mb);
 1130|  1.71k|    prev_bit_diff = prev_bits_per_mb - desired_bits_per_mb;
 1131|  1.71k|  }
 1132|       |
 1133|       |  // Pick one of the two q indices, depending on which one has rate closer to
 1134|       |  // the desired rate.
 1135|  39.5k|  return (curr_bit_diff <= prev_bit_diff) ? curr_q : prev_q;
  ------------------
  |  Branch (1135:10): [True: 38.7k, False: 812]
  ------------------
 1136|  39.5k|}
ratectrl.c:get_bits_per_mb:
 1062|   235k|                           double correction_factor, int q) {
 1063|   235k|  const AV1_COMMON *const cm = &cpi->common;
 1064|   235k|  return use_cyclic_refresh
  ------------------
  |  Branch (1064:10): [True: 0, False: 235k]
  ------------------
 1065|   235k|             ? av1_cyclic_refresh_rc_bits_per_mb(cpi, q, correction_factor)
 1066|   235k|             : av1_rc_bits_per_mb(cpi, cm->current_frame.frame_type, q,
 1067|   235k|                                  correction_factor,
 1068|   235k|                                  cpi->sf.hl_sf.accurate_bit_estimate);
 1069|   235k|}
ratectrl.c:adjust_q_cbr:
  642|  39.5k|                        int width, int height) {
  643|  39.5k|  const RATE_CONTROL *const rc = &cpi->rc;
  644|  39.5k|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  645|  39.5k|  const AV1_COMMON *const cm = &cpi->common;
  646|  39.5k|  const SVC *const svc = &cpi->svc;
  647|  39.5k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
  648|       |  // Flag to indicate previous frame has overshoot, and buffer level
  649|       |  // for current frame is low (less than ~half of optimal). For such
  650|       |  // (inter) frames, if the source_sad is non-zero, relax the max_delta_up
  651|       |  // and clamp applied below.
  652|  39.5k|  const bool overshoot_buffer_low =
  653|  39.5k|      cpi->rc.rc_1_frame == -1 && rc->frame_source_sad > 1000 &&
  ------------------
  |  Branch (653:7): [True: 8.31k, False: 31.1k]
  |  Branch (653:35): [True: 8.31k, False: 0]
  ------------------
  654|  8.31k|      p_rc->buffer_level < (p_rc->optimal_buffer_level >> 1) &&
  ------------------
  |  Branch (654:7): [True: 203, False: 8.11k]
  ------------------
  655|    203|      rc->frames_since_key > 4;
  ------------------
  |  Branch (655:7): [True: 0, False: 203]
  ------------------
  656|  39.5k|  int max_delta_down;
  657|  39.5k|  int max_delta_up = overshoot_buffer_low ? 120 : 20;
  ------------------
  |  Branch (657:22): [True: 0, False: 39.5k]
  ------------------
  658|  39.5k|  const int change_avg_frame_bandwidth =
  659|  39.5k|      abs(rc->avg_frame_bandwidth - rc->prev_avg_frame_bandwidth) >
  660|  39.5k|      0.1 * (rc->avg_frame_bandwidth);
  661|       |
  662|       |  // Set the maximum adjustment down for Q for this frame.
  663|  39.5k|  if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (663:7): [True: 0, False: 39.5k]
  ------------------
  664|      0|      cpi->cyclic_refresh->apply_cyclic_refresh) {
  ------------------
  |  Branch (664:7): [True: 0, False: 0]
  ------------------
  665|       |    // For static screen type content limit the Q drop till the start of the
  666|       |    // next refresh cycle.
  667|      0|    if (cpi->is_screen_content_type &&
  ------------------
  |  Branch (667:9): [True: 0, False: 0]
  ------------------
  668|      0|        (cpi->cyclic_refresh->sb_index > cpi->cyclic_refresh->last_sb_index)) {
  ------------------
  |  Branch (668:9): [True: 0, False: 0]
  ------------------
  669|      0|      max_delta_down = clamp(rc->q_1_frame / 32, 1, 8);
  670|      0|    } else {
  671|      0|      max_delta_down = clamp(rc->q_1_frame / 8, 1, 16);
  672|      0|    }
  673|      0|    if (!cpi->ppi->use_svc && cpi->is_screen_content_type) {
  ------------------
  |  Branch (673:9): [True: 0, False: 0]
  |  Branch (673:31): [True: 0, False: 0]
  ------------------
  674|       |      // Link max_delta_up to max_delta_down and buffer status.
  675|      0|      if (p_rc->buffer_level > p_rc->optimal_buffer_level) {
  ------------------
  |  Branch (675:11): [True: 0, False: 0]
  ------------------
  676|      0|        max_delta_up = AOMMAX(4, max_delta_down);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  677|      0|      } else if (!overshoot_buffer_low) {
  ------------------
  |  Branch (677:18): [True: 0, False: 0]
  ------------------
  678|      0|        max_delta_up = AOMMAX(8, max_delta_down);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  679|      0|      }
  680|      0|    }
  681|  39.5k|  } else {
  682|  39.5k|    max_delta_down = cpi->is_screen_content_type
  ------------------
  |  Branch (682:22): [True: 0, False: 39.5k]
  ------------------
  683|  39.5k|                         ? clamp(rc->q_1_frame / 16, 1, 8)
  684|  39.5k|                         : clamp(rc->q_1_frame / 8, 1, 16);
  685|  39.5k|  }
  686|       |  // For screen static content with stable buffer level: relax the
  687|       |  // limit on max_delta_down and apply bias qp, based on buffer fullness.
  688|       |  // Only for high speeds levels for now to avoid bdrate regression.
  689|  39.5k|  if (cpi->sf.rt_sf.rc_faster_convergence_static == 1 &&
  ------------------
  |  Branch (689:7): [True: 0, False: 39.5k]
  ------------------
  690|      0|      cpi->sf.rt_sf.check_scene_detection && rc->frame_source_sad == 0 &&
  ------------------
  |  Branch (690:7): [True: 0, False: 0]
  |  Branch (690:46): [True: 0, False: 0]
  ------------------
  691|      0|      rc->static_since_last_scene_change &&
  ------------------
  |  Branch (691:7): [True: 0, False: 0]
  ------------------
  692|      0|      p_rc->buffer_level > (p_rc->optimal_buffer_level >> 1) &&
  ------------------
  |  Branch (692:7): [True: 0, False: 0]
  ------------------
  693|      0|      cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ &&
  ------------------
  |  Branch (693:7): [True: 0, False: 0]
  ------------------
  694|      0|      cpi->cyclic_refresh->counter_encode_maxq_scene_change > 4) {
  ------------------
  |  Branch (694:7): [True: 0, False: 0]
  ------------------
  695|      0|    int qp_delta = 32;
  696|      0|    int qp_bias = 16;
  697|      0|    if (p_rc->buffer_level > p_rc->optimal_buffer_level) {
  ------------------
  |  Branch (697:9): [True: 0, False: 0]
  ------------------
  698|      0|      qp_delta = 60;
  699|      0|      qp_bias = 32;
  700|      0|    }
  701|      0|    if (cpi->rc.rc_1_frame == 1) q = q - qp_bias;
  ------------------
  |  Branch (701:9): [True: 0, False: 0]
  ------------------
  702|      0|    max_delta_down = AOMMAX(max_delta_down, qp_delta);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  703|      0|    max_delta_up = AOMMIN(max_delta_up, 4);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  704|      0|  }
  705|       |
  706|       |  // If resolution changes or avg_frame_bandwidth significantly changed,
  707|       |  // then set this flag to indicate change in target bits per macroblock.
  708|  39.5k|  const int change_target_bits_mb =
  709|  39.5k|      cm->prev_frame &&
  ------------------
  |  Branch (709:7): [True: 22.6k, False: 16.8k]
  ------------------
  710|  22.6k|      (width != cm->prev_frame->width || height != cm->prev_frame->height ||
  ------------------
  |  Branch (710:8): [True: 16.1k, False: 6.46k]
  |  Branch (710:42): [True: 3.28k, False: 3.18k]
  ------------------
  711|  3.18k|       change_avg_frame_bandwidth);
  ------------------
  |  Branch (711:8): [True: 0, False: 3.18k]
  ------------------
  712|       |  // Apply some control/clamp to QP under certain conditions.
  713|       |  // Delay the use of the clamping for svc until after num_temporal_layers,
  714|       |  // to make they have been set for each temporal layer.
  715|       |  // Check for rc->q_1/2_frame > 0 in case they have not been set due to
  716|       |  // dropped frames.
  717|  39.5k|  if (!frame_is_intra_only(cm) && rc->frames_since_key > 1 &&
  ------------------
  |  Branch (717:7): [True: 22.6k, False: 16.8k]
  |  Branch (717:35): [True: 16.5k, False: 6.10k]
  ------------------
  718|  16.5k|      rc->q_1_frame > 0 && rc->q_2_frame > 0 &&
  ------------------
  |  Branch (718:7): [True: 15.9k, False: 627]
  |  Branch (718:28): [True: 15.5k, False: 399]
  ------------------
  719|  15.5k|      (!cpi->ppi->use_svc ||
  ------------------
  |  Branch (719:8): [True: 15.5k, False: 0]
  ------------------
  720|      0|       svc->current_superframe > (unsigned int)svc->number_temporal_layers) &&
  ------------------
  |  Branch (720:8): [True: 0, False: 0]
  ------------------
  721|  15.5k|      !change_target_bits_mb && !cpi->rc.rtc_external_ratectrl &&
  ------------------
  |  Branch (721:7): [True: 1.60k, False: 13.9k]
  |  Branch (721:33): [True: 1.60k, False: 0]
  ------------------
  722|  1.60k|      (!cpi->oxcf.rc_cfg.gf_cbr_boost_pct ||
  ------------------
  |  Branch (722:8): [True: 1.60k, False: 0]
  ------------------
  723|  1.60k|       !(refresh_frame->alt_ref_frame || refresh_frame->golden_frame))) {
  ------------------
  |  Branch (723:10): [True: 0, False: 0]
  |  Branch (723:42): [True: 0, False: 0]
  ------------------
  724|       |    // If in the previous two frames we have seen both overshoot and undershoot
  725|       |    // clamp Q between the two.
  726|  1.60k|    if (rc->rc_1_frame * rc->rc_2_frame == -1 &&
  ------------------
  |  Branch (726:9): [True: 337, False: 1.27k]
  ------------------
  727|    337|        rc->q_1_frame != rc->q_2_frame && !overshoot_buffer_low) {
  ------------------
  |  Branch (727:9): [True: 322, False: 15]
  |  Branch (727:43): [True: 322, False: 0]
  ------------------
  728|    322|      int qclamp = clamp(q, AOMMIN(rc->q_1_frame, rc->q_2_frame),
  ------------------
  |  |   34|    322|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1, False: 321]
  |  |  ------------------
  ------------------
  729|    322|                         AOMMAX(rc->q_1_frame, rc->q_2_frame));
  ------------------
  |  |   35|    322|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 321, False: 1]
  |  |  ------------------
  ------------------
  730|       |      // If the previous frame had overshoot and the current q needs to
  731|       |      // increase above the clamped value, reduce the clamp for faster reaction
  732|       |      // to overshoot.
  733|    322|      if (cpi->rc.rc_1_frame == -1 && q > qclamp && rc->frames_since_key > 10)
  ------------------
  |  Branch (733:11): [True: 321, False: 1]
  |  Branch (733:39): [True: 80, False: 241]
  |  Branch (733:53): [True: 0, False: 80]
  ------------------
  734|      0|        q = (q + qclamp) >> 1;
  735|    322|      else
  736|    322|        q = qclamp;
  737|    322|    }
  738|       |    // Adjust Q base on source content change from scene detection.
  739|  1.60k|    if (cpi->sf.rt_sf.check_scene_detection && rc->prev_avg_source_sad > 0 &&
  ------------------
  |  Branch (739:9): [True: 1.60k, False: 0]
  |  Branch (739:48): [True: 1.60k, False: 0]
  ------------------
  740|  1.60k|        rc->frames_since_key > 10 && rc->frame_source_sad > 0 &&
  ------------------
  |  Branch (740:9): [True: 0, False: 1.60k]
  |  Branch (740:38): [True: 0, False: 0]
  ------------------
  741|      0|        !cpi->rc.rtc_external_ratectrl) {
  ------------------
  |  Branch (741:9): [True: 0, False: 0]
  ------------------
  742|      0|      const int bit_depth = cm->seq_params->bit_depth;
  743|      0|      double delta =
  744|      0|          (double)rc->avg_source_sad / (double)rc->prev_avg_source_sad - 1.0;
  745|       |      // Push Q downwards if content change is decreasing and buffer level
  746|       |      // is stable (at least 1/4-optimal level), so not overshooting. Do so
  747|       |      // only for high Q to avoid excess overshoot.
  748|       |      // Else reduce decrease in Q from previous frame if content change is
  749|       |      // increasing and buffer is below max (so not undershooting).
  750|      0|      if (delta < 0.0 &&
  ------------------
  |  Branch (750:11): [True: 0, False: 0]
  ------------------
  751|      0|          p_rc->buffer_level > (p_rc->optimal_buffer_level >> 2) &&
  ------------------
  |  Branch (751:11): [True: 0, False: 0]
  ------------------
  752|      0|          q > (rc->worst_quality >> 1)) {
  ------------------
  |  Branch (752:11): [True: 0, False: 0]
  ------------------
  753|      0|        double q_adj_factor = 1.0 + 0.5 * tanh(4.0 * delta);
  754|      0|        double q_val = av1_convert_qindex_to_q(q, bit_depth);
  755|      0|        q += av1_compute_qdelta(rc, q_val, q_val * q_adj_factor, bit_depth);
  756|      0|      } else if (rc->q_1_frame - q > 0 && delta > 0.1 &&
  ------------------
  |  Branch (756:18): [True: 0, False: 0]
  |  Branch (756:43): [True: 0, False: 0]
  ------------------
  757|      0|                 p_rc->buffer_level < AOMMIN(p_rc->maximum_buffer_size,
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (757:18): [True: 0, False: 0]
  ------------------
  758|      0|                                             p_rc->optimal_buffer_level << 1)) {
  759|      0|        q = (3 * q + rc->q_1_frame) >> 2;
  760|      0|      }
  761|      0|    }
  762|       |    // Limit the decrease in Q from previous frame.
  763|  1.60k|    if (rc->q_1_frame - q > max_delta_down) q = rc->q_1_frame - max_delta_down;
  ------------------
  |  Branch (763:9): [True: 153, False: 1.45k]
  ------------------
  764|       |    // Limit the increase in Q from previous frame.
  765|  1.45k|    else if (q - rc->q_1_frame > max_delta_up)
  ------------------
  |  Branch (765:14): [True: 29, False: 1.42k]
  ------------------
  766|     29|      q = rc->q_1_frame + max_delta_up;
  767|  1.60k|  }
  768|       |  // Adjustment for temporal layers.
  769|  39.5k|  if (svc->number_temporal_layers > 1 && svc->spatial_layer_id == 0 &&
  ------------------
  |  Branch (769:7): [True: 0, False: 39.5k]
  |  Branch (769:42): [True: 0, False: 0]
  ------------------
  770|      0|      !change_target_bits_mb && !cpi->rc.rtc_external_ratectrl &&
  ------------------
  |  Branch (770:7): [True: 0, False: 0]
  |  Branch (770:33): [True: 0, False: 0]
  ------------------
  771|      0|      cpi->oxcf.resize_cfg.resize_mode != RESIZE_DYNAMIC) {
  ------------------
  |  Branch (771:7): [True: 0, False: 0]
  ------------------
  772|      0|    if (svc->temporal_layer_id > 0) {
  ------------------
  |  Branch (772:9): [True: 0, False: 0]
  ------------------
  773|       |      // Constrain enhancement relative to the previous base TL0.
  774|       |      // Get base temporal layer TL0.
  775|      0|      const int layer = LAYER_IDS_TO_IDX(0, 0, svc->number_temporal_layers);
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
  776|      0|      LAYER_CONTEXT *lc = &svc->layer_context[layer];
  777|       |      // lc->rc.avg_frame_bandwidth and lc->p_rc.last_q correspond to the
  778|       |      // last TL0 frame.
  779|      0|      const int last_qindex_tl0 =
  780|      0|          rc->frames_since_key < svc->number_temporal_layers
  ------------------
  |  Branch (780:11): [True: 0, False: 0]
  ------------------
  781|      0|              ? lc->p_rc.last_q[KEY_FRAME]
  782|      0|              : lc->p_rc.last_q[INTER_FRAME];
  783|      0|      if (rc->avg_frame_bandwidth < lc->rc.avg_frame_bandwidth &&
  ------------------
  |  Branch (783:11): [True: 0, False: 0]
  ------------------
  784|      0|          q < last_qindex_tl0 - 4)
  ------------------
  |  Branch (784:11): [True: 0, False: 0]
  ------------------
  785|      0|        q = last_qindex_tl0 - 4;
  786|      0|    } else if (cpi->svc.temporal_layer_id == 0 && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (786:16): [True: 0, False: 0]
  |  Branch (786:51): [True: 0, False: 0]
  ------------------
  787|      0|               p_rc->buffer_level > (p_rc->optimal_buffer_level >> 2) &&
  ------------------
  |  Branch (787:16): [True: 0, False: 0]
  ------------------
  788|      0|               rc->frame_source_sad < 100000) {
  ------------------
  |  Branch (788:16): [True: 0, False: 0]
  ------------------
  789|       |      // Push base TL0 Q down if buffer is stable and frame_source_sad
  790|       |      // is below threshold.
  791|      0|      int delta = (svc->number_temporal_layers == 2) ? 4 : 10;
  ------------------
  |  Branch (791:19): [True: 0, False: 0]
  ------------------
  792|      0|      q = q - delta;
  793|      0|    }
  794|      0|  }
  795|       |  // For non-svc (single layer): if resolution has increased push q closer
  796|       |  // to the active_worst to avoid excess overshoot.
  797|  39.5k|  if (!cpi->ppi->use_svc && cm->prev_frame &&
  ------------------
  |  Branch (797:7): [True: 39.5k, False: 0]
  |  Branch (797:29): [True: 22.6k, False: 16.8k]
  ------------------
  798|  22.6k|      (width * height > 1.5 * cm->prev_frame->width * cm->prev_frame->height))
  ------------------
  |  Branch (798:7): [True: 14.9k, False: 7.71k]
  ------------------
  799|  14.9k|    q = (q + active_worst_quality) >> 1;
  800|       |  // For single layer RPS: Bias Q based on distance of closest reference.
  801|  39.5k|  if (cpi->ppi->rtc_ref.bias_recovery_frame) {
  ------------------
  |  Branch (801:7): [True: 0, False: 39.5k]
  ------------------
  802|      0|    const int min_dist = av1_svc_get_min_ref_dist(cpi);
  803|      0|    q = q - AOMMIN(min_dist, 20);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  804|      0|  }
  805|  39.5k|  return clamp(q, cpi->rc.best_quality, cpi->rc.worst_quality);
  806|  39.5k|}
ratectrl.c:rc_pick_q_and_bounds_no_stats_cbr:
 1481|  24.4k|                                             int *top_index) {
 1482|  24.4k|  const AV1_COMMON *const cm = &cpi->common;
 1483|  24.4k|  const RATE_CONTROL *const rc = &cpi->rc;
 1484|  24.4k|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 1485|  24.4k|  const CurrentFrame *const current_frame = &cm->current_frame;
 1486|  24.4k|  int q;
 1487|  24.4k|  int active_worst_quality = calc_active_worst_quality_no_stats_cbr(cpi);
 1488|  24.4k|  int active_best_quality = calc_active_best_quality_no_stats_cbr(
 1489|  24.4k|      cpi, active_worst_quality, width, height);
 1490|  24.4k|  assert(has_no_stats_stage(cpi));
 1491|  24.4k|  assert(cpi->oxcf.rc_cfg.mode == AOM_CBR);
 1492|       |
 1493|       |  // Clip the active best and worst quality values to limits
 1494|  24.4k|  active_best_quality =
 1495|  24.4k|      clamp(active_best_quality, rc->best_quality, rc->worst_quality);
 1496|  24.4k|  active_worst_quality =
 1497|  24.4k|      clamp(active_worst_quality, active_best_quality, rc->worst_quality);
 1498|       |
 1499|  24.4k|  *top_index = active_worst_quality;
 1500|  24.4k|  *bottom_index = active_best_quality;
 1501|       |
 1502|       |  // Limit Q range for the adaptive loop.
 1503|  24.4k|  if (current_frame->frame_type == KEY_FRAME && !p_rc->this_key_frame_forced &&
  ------------------
  |  Branch (1503:7): [True: 6.10k, False: 18.3k]
  |  Branch (1503:49): [True: 6.10k, False: 0]
  ------------------
 1504|  6.10k|      current_frame->frame_number != 0) {
  ------------------
  |  Branch (1504:7): [True: 0, False: 6.10k]
  ------------------
 1505|      0|    int qdelta = 0;
 1506|      0|    qdelta = av1_compute_qdelta_by_rate(cpi, current_frame->frame_type,
 1507|      0|                                        active_worst_quality, 2.0);
 1508|      0|    *top_index = active_worst_quality + qdelta;
 1509|      0|    *top_index = AOMMAX(*top_index, *bottom_index);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1510|      0|  }
 1511|       |
 1512|  24.4k|  q = av1_rc_regulate_q(cpi, rc->this_frame_target, active_best_quality,
 1513|  24.4k|                        active_worst_quality, width, height);
 1514|       |#if RT_PASSIVE_STRATEGY
 1515|       |  if (current_frame->frame_type != KEY_FRAME &&
 1516|       |      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
 1517|       |    q = get_q_passive_strategy(cpi, q, 50);
 1518|       |  }
 1519|       |#endif  // RT_PASSIVE_STRATEGY
 1520|  24.4k|  if (q > *top_index) {
  ------------------
  |  Branch (1520:7): [True: 0, False: 24.4k]
  ------------------
 1521|       |    // Special case when we are targeting the max allowed rate
 1522|      0|    if (rc->this_frame_target >= rc->max_frame_bandwidth)
  ------------------
  |  Branch (1522:9): [True: 0, False: 0]
  ------------------
 1523|      0|      *top_index = q;
 1524|      0|    else
 1525|      0|      q = *top_index;
 1526|      0|  }
 1527|       |
 1528|  24.4k|  assert(*top_index <= rc->worst_quality && *top_index >= rc->best_quality);
 1529|  24.4k|  assert(*bottom_index <= rc->worst_quality &&
 1530|  24.4k|         *bottom_index >= rc->best_quality);
 1531|       |  assert(q <= rc->worst_quality && q >= rc->best_quality);
 1532|  24.4k|  return q;
 1533|  24.4k|}
ratectrl.c:calc_active_worst_quality_no_stats_cbr:
 1265|  39.5k|static int calc_active_worst_quality_no_stats_cbr(const AV1_COMP *cpi) {
 1266|       |  // Adjust active_worst_quality: If buffer is above the optimal/target level,
 1267|       |  // bring active_worst_quality down depending on fullness of buffer.
 1268|       |  // If buffer is below the optimal level, let the active_worst_quality go from
 1269|       |  // ambient Q (at buffer = optimal level) to worst_quality level
 1270|       |  // (at buffer = critical level).
 1271|  39.5k|  const AV1_COMMON *const cm = &cpi->common;
 1272|  39.5k|  const RATE_CONTROL *rc = &cpi->rc;
 1273|  39.5k|  const PRIMARY_RATE_CONTROL *p_rc = &cpi->ppi->p_rc;
 1274|  39.5k|  const SVC *const svc = &cpi->svc;
 1275|  39.5k|  unsigned int num_frames_weight_key = 5 * cpi->svc.number_temporal_layers;
 1276|       |  // Buffer level below which we push active_worst to worst_quality.
 1277|  39.5k|  int64_t critical_level = p_rc->optimal_buffer_level >> 3;
 1278|  39.5k|  int64_t buff_lvl_step = 0;
 1279|  39.5k|  int adjustment = 0;
 1280|  39.5k|  int active_worst_quality;
 1281|  39.5k|  int ambient_qp;
 1282|  39.5k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (1282:7): [True: 16.8k, False: 22.6k]
  ------------------
 1283|       |    // Allow for active_worst_quality to go lower than rc->worst_quality (max)
 1284|       |    // under certain conditions: that the frame spatial variance is below
 1285|       |    // threshold and the buffer is full/stable. Also check the encoded vs target
 1286|       |    // size for the last keyframe.
 1287|  16.8k|    if (cpi->sf.rt_sf.rc_compute_spatial_var_sc_kf &&
  ------------------
  |  Branch (1287:9): [True: 0, False: 16.8k]
  ------------------
 1288|      0|        svc->number_spatial_layers == 1 && rc->frame_spatial_variance < 1000 &&
  ------------------
  |  Branch (1288:9): [True: 0, False: 0]
  |  Branch (1288:44): [True: 0, False: 0]
  ------------------
 1289|      0|        p_rc->buffer_level > p_rc->optimal_buffer_level &&
  ------------------
  |  Branch (1289:9): [True: 0, False: 0]
  ------------------
 1290|      0|        p_rc->optimal_buffer_level > (rc->avg_frame_bandwidth << 3) &&
  ------------------
  |  Branch (1290:9): [True: 0, False: 0]
  ------------------
 1291|      0|        rc->last_encoded_size_keyframe < (rc->last_target_size_keyframe << 3)) {
  ------------------
  |  Branch (1291:9): [True: 0, False: 0]
  ------------------
 1292|      0|      if (p_rc->buffer_level > ((9 * p_rc->optimal_buffer_level) >> 3))
  ------------------
  |  Branch (1292:11): [True: 0, False: 0]
  ------------------
 1293|      0|        ambient_qp = p_rc->avg_frame_qindex[INTER_FRAME];
 1294|      0|      else
 1295|      0|        ambient_qp =
 1296|      0|            (rc->worst_quality + p_rc->avg_frame_qindex[INTER_FRAME]) >> 1;
 1297|      0|      return AOMMIN(rc->worst_quality, AOMMAX(ambient_qp, rc->best_quality));
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  |  Branch (34:31): [True: 0, False: 0]
  |  |  |  Branch (34:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1298|  16.8k|    } else {
 1299|  16.8k|      return rc->worst_quality;
 1300|  16.8k|    }
 1301|  16.8k|  }
 1302|       |  // For ambient_qp we use minimum of avg_frame_qindex[KEY_FRAME/INTER_FRAME]
 1303|       |  // for the first few frames following key frame. These are both initialized
 1304|       |  // to worst_quality and updated with (3/4, 1/4) average in postencode_update.
 1305|       |  // So for first few frames following key, the qp of that key frame is weighted
 1306|       |  // into the active_worst_quality setting. For SVC the key frame should
 1307|       |  // correspond to layer (0, 0), so use that for layer context.
 1308|  22.6k|  int avg_qindex_key = p_rc->avg_frame_qindex[KEY_FRAME];
 1309|  22.6k|  if (svc->number_temporal_layers > 1) {
  ------------------
  |  Branch (1309:7): [True: 0, False: 22.6k]
  ------------------
 1310|      0|    int layer = LAYER_IDS_TO_IDX(0, 0, svc->number_temporal_layers);
  ------------------
  |  | 4254|      0|#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
  ------------------
 1311|      0|    const LAYER_CONTEXT *lc = &svc->layer_context[layer];
 1312|      0|    const PRIMARY_RATE_CONTROL *const lp_rc = &lc->p_rc;
 1313|      0|    avg_qindex_key =
 1314|      0|        AOMMIN(lp_rc->avg_frame_qindex[KEY_FRAME], lp_rc->last_q[KEY_FRAME]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1315|      0|  }
 1316|  22.6k|  if (svc->temporal_layer_id > 0 &&
  ------------------
  |  Branch (1316:7): [True: 0, False: 22.6k]
  ------------------
 1317|      0|      rc->frames_since_key < 2 * svc->number_temporal_layers) {
  ------------------
  |  Branch (1317:7): [True: 0, False: 0]
  ------------------
 1318|      0|    ambient_qp = avg_qindex_key;
 1319|  22.6k|  } else {
 1320|  22.6k|    ambient_qp =
 1321|  22.6k|        (cm->current_frame.frame_number < num_frames_weight_key)
  ------------------
  |  Branch (1321:9): [True: 22.6k, False: 0]
  ------------------
 1322|  22.6k|            ? AOMMIN(p_rc->avg_frame_qindex[INTER_FRAME], avg_qindex_key)
  ------------------
  |  |   34|  22.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.66k, False: 19.9k]
  |  |  ------------------
  ------------------
 1323|  22.6k|            : p_rc->avg_frame_qindex[INTER_FRAME];
 1324|  22.6k|  }
 1325|  22.6k|  ambient_qp = AOMMIN(rc->worst_quality, ambient_qp);
  ------------------
  |  |   34|  22.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 22.6k]
  |  |  ------------------
  ------------------
 1326|       |
 1327|  22.6k|  if (p_rc->buffer_level > p_rc->optimal_buffer_level) {
  ------------------
  |  Branch (1327:7): [True: 8.09k, False: 14.5k]
  ------------------
 1328|       |    // Adjust down.
 1329|  8.09k|    int max_adjustment_down;  // Maximum adjustment down for Q
 1330|       |
 1331|  8.09k|    if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (1331:9): [True: 0, False: 8.09k]
  |  Branch (1331:57): [True: 0, False: 0]
  ------------------
 1332|      0|        (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN)) {
  ------------------
  |  Branch (1332:9): [True: 0, False: 0]
  ------------------
 1333|      0|      active_worst_quality = AOMMIN(rc->worst_quality, ambient_qp);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1334|      0|      max_adjustment_down = AOMMIN(4, active_worst_quality / 16);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1335|  8.09k|    } else {
 1336|  8.09k|      active_worst_quality = AOMMIN(rc->worst_quality, ambient_qp * 5 / 4);
  ------------------
  |  |   34|  8.09k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.18k, False: 915]
  |  |  ------------------
  ------------------
 1337|  8.09k|      max_adjustment_down = active_worst_quality / 3;
 1338|  8.09k|    }
 1339|       |
 1340|  8.09k|    if (max_adjustment_down) {
  ------------------
  |  Branch (1340:9): [True: 7.80k, False: 290]
  ------------------
 1341|  7.80k|      buff_lvl_step =
 1342|  7.80k|          ((p_rc->maximum_buffer_size - p_rc->optimal_buffer_level) /
 1343|  7.80k|           max_adjustment_down);
 1344|  7.80k|      if (buff_lvl_step)
  ------------------
  |  Branch (1344:11): [True: 7.80k, False: 0]
  ------------------
 1345|  7.80k|        adjustment = (int)((p_rc->buffer_level - p_rc->optimal_buffer_level) /
 1346|  7.80k|                           buff_lvl_step);
 1347|  7.80k|      active_worst_quality -= adjustment;
 1348|  7.80k|    }
 1349|  14.5k|  } else if (p_rc->buffer_level > critical_level) {
  ------------------
  |  Branch (1349:14): [True: 14.3k, False: 140]
  ------------------
 1350|       |    // Adjust up from ambient Q.
 1351|  14.3k|    active_worst_quality = AOMMIN(rc->worst_quality, ambient_qp);
  ------------------
  |  |   34|  14.3k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 14.3k]
  |  |  ------------------
  ------------------
 1352|  14.3k|    if (critical_level) {
  ------------------
  |  Branch (1352:9): [True: 14.3k, False: 0]
  ------------------
 1353|  14.3k|      buff_lvl_step = (p_rc->optimal_buffer_level - critical_level);
 1354|  14.3k|      if (buff_lvl_step) {
  ------------------
  |  Branch (1354:11): [True: 14.3k, False: 0]
  ------------------
 1355|  14.3k|        adjustment = (int)((rc->worst_quality - ambient_qp) *
 1356|  14.3k|                           (p_rc->optimal_buffer_level - p_rc->buffer_level) /
 1357|  14.3k|                           buff_lvl_step);
 1358|  14.3k|      }
 1359|  14.3k|      active_worst_quality += adjustment;
 1360|  14.3k|    }
 1361|  14.3k|  } else {
 1362|       |    // Set to worst_quality if buffer is below critical level.
 1363|    140|    active_worst_quality = rc->worst_quality;
 1364|    140|  }
 1365|  22.6k|  return active_worst_quality;
 1366|  39.5k|}
ratectrl.c:calc_active_best_quality_no_stats_cbr:
 1371|  24.4k|                                                 int width, int height) {
 1372|  24.4k|  const AV1_COMMON *const cm = &cpi->common;
 1373|  24.4k|  const RATE_CONTROL *const rc = &cpi->rc;
 1374|  24.4k|  const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 1375|  24.4k|  const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
 1376|  24.4k|  const CurrentFrame *const current_frame = &cm->current_frame;
 1377|  24.4k|  int *rtc_minq;
 1378|  24.4k|  const int bit_depth = cm->seq_params->bit_depth;
 1379|  24.4k|  int active_best_quality = rc->best_quality;
 1380|  24.4k|  ASSIGN_MINQ_TABLE(bit_depth, rtc_minq);
  ------------------
  |  |   61|  24.4k|  do {                                                       \
  |  |   62|  24.4k|    switch (bit_depth) {                                     \
  |  |   63|  19.7k|      case AOM_BITS_8: name = name##_8; break;               \
  |  |  ------------------
  |  |  |  Branch (63:7): [True: 19.7k, False: 4.67k]
  |  |  ------------------
  |  |   64|  2.21k|      case AOM_BITS_10: name = name##_10; break;             \
  |  |  ------------------
  |  |  |  Branch (64:7): [True: 2.21k, False: 22.1k]
  |  |  ------------------
  |  |   65|  2.46k|      case AOM_BITS_12: name = name##_12; break;             \
  |  |  ------------------
  |  |  |  Branch (65:7): [True: 2.46k, False: 21.9k]
  |  |  ------------------
  |  |   66|      0|      default:                                               \
  |  |  ------------------
  |  |  |  Branch (66:7): [True: 0, False: 24.4k]
  |  |  ------------------
  |  |   67|      0|        assert(0 &&                                          \
  |  |   68|      0|               "bit_depth should be AOM_BITS_8, AOM_BITS_10" \
  |  |   69|      0|               " or AOM_BITS_12");                           \
  |  |   70|      0|        name = NULL;                                         \
  |  |   71|  24.4k|    }                                                        \
  |  |   72|  24.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded, False: 24.4k]
  |  |  ------------------
  ------------------
 1381|       |
 1382|  24.4k|  const int is_608p_or_larger = AOMMIN(cm->width, cm->height) >= 608;
  ------------------
  |  |   34|  24.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.4k, False: 13.9k]
  |  |  ------------------
  ------------------
 1383|  24.4k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|  24.4k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 10.4k, False: 13.9k]
  |  |  ------------------
  ------------------
 1384|       |  // res_idx is 0 for res < 480p, 1 for 480p, 2 for 608p+
 1385|  24.4k|  const int res_idx = is_480p_or_larger + is_608p_or_larger;
 1386|  24.4k|  const bool rtc_mode = (cpi->oxcf.mode == REALTIME);
 1387|       |
 1388|  24.4k|  if (frame_is_intra_only(cm)) {
  ------------------
  |  Branch (1388:7): [True: 6.10k, False: 18.3k]
  ------------------
 1389|       |    // Handle the special case for key frames forced when we have reached
 1390|       |    // the maximum key frame interval. Here force the Q to a range
 1391|       |    // based on the ambient Q to reduce the risk of popping.
 1392|  6.10k|    if (p_rc->this_key_frame_forced) {
  ------------------
  |  Branch (1392:9): [True: 0, False: 6.10k]
  ------------------
 1393|      0|      int qindex = p_rc->last_boosted_qindex;
 1394|      0|      double last_boosted_q = av1_convert_qindex_to_q(qindex, bit_depth);
 1395|      0|      int delta_qindex = av1_compute_qdelta(rc, last_boosted_q,
 1396|      0|                                            (last_boosted_q * 0.75), bit_depth);
 1397|      0|      active_best_quality = AOMMAX(qindex + delta_qindex, rc->best_quality);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1398|  6.10k|    } else if (current_frame->frame_number > 0) {
  ------------------
  |  Branch (1398:16): [True: 0, False: 6.10k]
  ------------------
 1399|       |      // not first frame of one pass and kf_boost is set
 1400|      0|      double q_adj_factor = 1.0;
 1401|      0|      double q_val;
 1402|      0|      active_best_quality =
 1403|      0|          get_kf_active_quality(p_rc, p_rc->avg_frame_qindex[KEY_FRAME],
 1404|      0|                                bit_depth, res_idx, rtc_mode);
 1405|       |      // Allow somewhat lower kf minq with small image formats.
 1406|      0|      if ((width * height) <= (352 * 288)) {
  ------------------
  |  Branch (1406:11): [True: 0, False: 0]
  ------------------
 1407|      0|        q_adj_factor -= 0.25;
 1408|      0|      }
 1409|       |      // Convert the adjustment factor to a qindex delta
 1410|       |      // on active_best_quality.
 1411|      0|      q_val = av1_convert_qindex_to_q(active_best_quality, bit_depth);
 1412|      0|      active_best_quality +=
 1413|      0|          av1_compute_qdelta(rc, q_val, q_val * q_adj_factor, bit_depth);
 1414|      0|    }
 1415|  18.3k|  } else if (!rc->is_src_frame_alt_ref && !cpi->ppi->use_svc &&
  ------------------
  |  Branch (1415:14): [True: 18.3k, False: 0]
  |  Branch (1415:43): [True: 18.3k, False: 0]
  ------------------
 1416|  18.3k|             cpi->oxcf.rc_cfg.gf_cbr_boost_pct &&
  ------------------
  |  Branch (1416:14): [True: 0, False: 18.3k]
  ------------------
 1417|      0|             (refresh_frame->golden_frame || refresh_frame->alt_ref_frame)) {
  ------------------
  |  Branch (1417:15): [True: 0, False: 0]
  |  Branch (1417:46): [True: 0, False: 0]
  ------------------
 1418|       |    // Use the lower of active_worst_quality and recent
 1419|       |    // average Q as basis for GF/ARF best Q limit unless last frame was
 1420|       |    // a key frame.
 1421|      0|    int q = active_worst_quality;
 1422|      0|    if (rc->frames_since_key > 1 &&
  ------------------
  |  Branch (1422:9): [True: 0, False: 0]
  ------------------
 1423|      0|        p_rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) {
  ------------------
  |  Branch (1423:9): [True: 0, False: 0]
  ------------------
 1424|      0|      q = p_rc->avg_frame_qindex[INTER_FRAME];
 1425|      0|    }
 1426|      0|    active_best_quality =
 1427|      0|        get_gf_active_quality(p_rc, q, bit_depth, res_idx, rtc_mode);
 1428|  18.3k|  } else {
 1429|       |    // Use the lower of active_worst_quality and recent/average Q.
 1430|  18.3k|    FRAME_TYPE frame_type =
 1431|  18.3k|        (current_frame->frame_number > 1) ? INTER_FRAME : KEY_FRAME;
  ------------------
  |  Branch (1431:9): [True: 12.2k, False: 6.10k]
  ------------------
 1432|  18.3k|    if (p_rc->avg_frame_qindex[frame_type] < active_worst_quality)
  ------------------
  |  Branch (1432:9): [True: 5.91k, False: 12.3k]
  ------------------
 1433|  5.91k|      active_best_quality = rtc_minq[p_rc->avg_frame_qindex[frame_type]];
 1434|  12.3k|    else
 1435|  12.3k|      active_best_quality = rtc_minq[active_worst_quality];
 1436|  18.3k|  }
 1437|  24.4k|  return active_best_quality;
 1438|  24.4k|}
ratectrl.c:resize_rate_factor:
  125|   315k|                                 int width, int height) {
  126|   315k|  return (double)(frm_dim_cfg->width * frm_dim_cfg->height) / (width * height);
  127|   315k|}
ratectrl.c:update_buffer_level:
  386|  73.6k|static void update_buffer_level(AV1_COMP *cpi, int encoded_frame_size) {
  387|  73.6k|  const AV1_COMMON *const cm = &cpi->common;
  388|  73.6k|  RATE_CONTROL *const rc = &cpi->rc;
  389|  73.6k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
  390|       |
  391|       |  // Non-viewable frames are a special case and are treated as pure overhead.
  392|  73.6k|  if (!cm->show_frame)
  ------------------
  |  Branch (392:7): [True: 0, False: 73.6k]
  ------------------
  393|      0|    p_rc->bits_off_target -= encoded_frame_size;
  394|  73.6k|  else
  395|  73.6k|    p_rc->bits_off_target += rc->avg_frame_bandwidth - encoded_frame_size;
  396|       |
  397|       |  // Clip the buffer level to the maximum specified buffer size.
  398|  73.6k|  p_rc->bits_off_target =
  399|  73.6k|      AOMMIN(p_rc->bits_off_target, p_rc->maximum_buffer_size);
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
  400|       |  // For screen-content mode: don't let buffer level go below threshold,
  401|       |  // given here as -rc->maximum_ buffer_size, to allow buffer to come back
  402|       |  // up sooner after slide change with big overshoot.
  403|  73.6k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN)
  ------------------
  |  Branch (403:7): [True: 0, False: 73.6k]
  ------------------
  404|      0|    p_rc->bits_off_target =
  405|      0|        AOMMAX(p_rc->bits_off_target, -p_rc->maximum_buffer_size);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  406|  73.6k|  p_rc->buffer_level = p_rc->bits_off_target;
  407|       |
  408|  73.6k|  if (cpi->ppi->use_svc)
  ------------------
  |  Branch (408:7): [True: 0, False: 73.6k]
  ------------------
  409|      0|    update_layer_buffer_level(&cpi->svc, encoded_frame_size,
  410|      0|                              cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN);
  411|       |
  412|       |#if CONFIG_FPMT_TEST
  413|       |  /* The variable temp_buffer_level is introduced for quality
  414|       |   * simulation purpose, it retains the value previous to the parallel
  415|       |   * encode frames. The variable is updated based on the update flag.
  416|       |   *
  417|       |   * If there exist show_existing_frames between parallel frames, then to
  418|       |   * retain the temp state do not update it. */
  419|       |  int show_existing_between_parallel_frames =
  420|       |      (cpi->ppi->gf_group.update_type[cpi->gf_frame_index] ==
  421|       |           INTNL_OVERLAY_UPDATE &&
  422|       |       cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index + 1] == 2);
  423|       |
  424|       |  if (cpi->do_frame_data_update && !show_existing_between_parallel_frames &&
  425|       |      cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
  426|       |    p_rc->temp_buffer_level = p_rc->buffer_level;
  427|       |  }
  428|       |#endif
  429|  73.6k|}
ratectrl.c:update_golden_frame_stats:
 2433|  73.6k|static void update_golden_frame_stats(AV1_COMP *cpi) {
 2434|  73.6k|  RATE_CONTROL *const rc = &cpi->rc;
 2435|       |
 2436|       |  // Update the Golden frame usage counts.
 2437|  73.6k|  if (cpi->refresh_frame.golden_frame || rc->is_src_frame_alt_ref) {
  ------------------
  |  Branch (2437:7): [True: 18.4k, False: 55.2k]
  |  Branch (2437:42): [True: 0, False: 55.2k]
  ------------------
 2438|  18.4k|    rc->frames_since_golden = 0;
 2439|  55.2k|  } else if (cpi->common.show_frame) {
  ------------------
  |  Branch (2439:14): [True: 55.2k, False: 0]
  ------------------
 2440|  55.2k|    rc->frames_since_golden++;
 2441|  55.2k|  }
 2442|  73.6k|}
ratectrl.c:set_gf_interval_range:
 2693|   229k|                                  RATE_CONTROL *const rc) {
 2694|   229k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2695|       |  // Set Maximum gf/arf interval
 2696|   229k|  rc->max_gf_interval = oxcf->gf_cfg.max_gf_interval;
 2697|   229k|  rc->min_gf_interval = oxcf->gf_cfg.min_gf_interval;
 2698|   229k|  if (rc->min_gf_interval == 0)
  ------------------
  |  Branch (2698:7): [True: 229k, False: 0]
  ------------------
 2699|   229k|    rc->min_gf_interval = av1_rc_get_default_min_gf_interval(
 2700|   229k|        oxcf->frm_dim_cfg.width, oxcf->frm_dim_cfg.height, cpi->framerate);
 2701|   229k|  if (rc->max_gf_interval == 0)
  ------------------
  |  Branch (2701:7): [True: 229k, False: 0]
  ------------------
 2702|   229k|    rc->max_gf_interval =
 2703|   229k|        get_default_max_gf_interval(cpi->framerate, rc->min_gf_interval);
 2704|       |  /*
 2705|       |   * Extended max interval for genuinely static scenes like slide shows.
 2706|       |   * The no.of.stats available in the case of LAP is limited,
 2707|       |   * hence setting to max_gf_interval.
 2708|       |   */
 2709|   229k|  if (cpi->ppi->lap_enabled)
  ------------------
  |  Branch (2709:7): [True: 0, False: 229k]
  ------------------
 2710|      0|    rc->static_scene_max_gf_interval = rc->max_gf_interval + 1;
 2711|   229k|  else
 2712|   229k|    rc->static_scene_max_gf_interval = MAX_STATIC_GF_GROUP_LENGTH;
  ------------------
  |  |   42|   229k|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
 2713|       |
 2714|   229k|  if (rc->max_gf_interval > rc->static_scene_max_gf_interval)
  ------------------
  |  Branch (2714:7): [True: 0, False: 229k]
  ------------------
 2715|      0|    rc->max_gf_interval = rc->static_scene_max_gf_interval;
 2716|       |
 2717|       |  // Clamp min to max
 2718|   229k|  rc->min_gf_interval = AOMMIN(rc->min_gf_interval, rc->max_gf_interval);
  ------------------
  |  |   34|   229k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 229k, False: 0]
  |  |  ------------------
  ------------------
 2719|   229k|}
ratectrl.c:clamp_pframe_target_size:
  317|  73.8k|                                    FRAME_UPDATE_TYPE frame_update_type) {
  318|  73.8k|  const RATE_CONTROL *rc = &cpi->rc;
  319|  73.8k|  const RateControlCfg *const rc_cfg = &cpi->oxcf.rc_cfg;
  320|  73.8k|  const int min_frame_target =
  321|  73.8k|      AOMMAX(rc->min_frame_bandwidth, rc->avg_frame_bandwidth >> 5);
  ------------------
  |  |   35|  73.8k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 73.8k]
  |  |  ------------------
  ------------------
  322|       |  // Clip the frame target to the minimum setup value.
  323|  73.8k|  if (frame_update_type == OVERLAY_UPDATE ||
  ------------------
  |  Branch (323:7): [True: 0, False: 73.8k]
  ------------------
  324|  73.8k|      frame_update_type == INTNL_OVERLAY_UPDATE) {
  ------------------
  |  Branch (324:7): [True: 0, False: 73.8k]
  ------------------
  325|       |    // If there is an active ARF at this location use the minimum
  326|       |    // bits on this frame even if it is a constructed arf.
  327|       |    // The active maximum quantizer insures that an appropriate
  328|       |    // number of bits will be spent if needed for constructed ARFs.
  329|      0|    target = min_frame_target;
  330|  73.8k|  } else if (target < min_frame_target) {
  ------------------
  |  Branch (330:14): [True: 0, False: 73.8k]
  ------------------
  331|      0|    target = min_frame_target;
  332|      0|  }
  333|       |
  334|       |  // Clip the frame target to the maximum allowed value.
  335|  73.8k|  if (target > rc->max_frame_bandwidth) target = rc->max_frame_bandwidth;
  ------------------
  |  Branch (335:7): [True: 0, False: 73.8k]
  ------------------
  336|  73.8k|  if (rc_cfg->max_inter_bitrate_pct) {
  ------------------
  |  Branch (336:7): [True: 0, False: 73.8k]
  ------------------
  337|      0|    const int64_t max_rate =
  338|      0|        (int64_t)rc->avg_frame_bandwidth * rc_cfg->max_inter_bitrate_pct / 100;
  339|      0|    target = AOMMIN(target, max_rate);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  340|      0|  }
  341|       |
  342|  73.8k|  return (int)target;
  343|  73.8k|}
ratectrl.c:clamp_iframe_target_size:
  345|  30.7k|static int clamp_iframe_target_size(const AV1_COMP *const cpi, int64_t target) {
  346|  30.7k|  const RATE_CONTROL *rc = &cpi->rc;
  347|  30.7k|  const RateControlCfg *const rc_cfg = &cpi->oxcf.rc_cfg;
  348|  30.7k|  if (rc_cfg->max_intra_bitrate_pct) {
  ------------------
  |  Branch (348:7): [True: 0, False: 30.7k]
  ------------------
  349|      0|    const int64_t max_rate =
  350|      0|        (int64_t)rc->avg_frame_bandwidth * rc_cfg->max_intra_bitrate_pct / 100;
  351|      0|    target = AOMMIN(target, max_rate);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  352|      0|  }
  353|  30.7k|  if (target > rc->max_frame_bandwidth) target = rc->max_frame_bandwidth;
  ------------------
  |  Branch (353:7): [True: 0, False: 30.7k]
  ------------------
  354|  30.7k|  return (int)target;
  355|  30.7k|}
ratectrl.c:set_baseline_gf_interval:
 2979|  15.1k|static void set_baseline_gf_interval(AV1_COMP *cpi, FRAME_TYPE frame_type) {
 2980|  15.1k|  RATE_CONTROL *const rc = &cpi->rc;
 2981|  15.1k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2982|  15.1k|  GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 2983|       |
 2984|  15.1k|  set_golden_update(cpi);
 2985|       |
 2986|  15.1k|  if (p_rc->baseline_gf_interval > rc->frames_to_key &&
  ------------------
  |  Branch (2986:7): [True: 0, False: 15.1k]
  ------------------
 2987|      0|      cpi->oxcf.kf_cfg.auto_key)
  ------------------
  |  Branch (2987:7): [True: 0, False: 0]
  ------------------
 2988|      0|    p_rc->baseline_gf_interval = rc->frames_to_key;
 2989|  15.1k|  p_rc->gfu_boost = DEFAULT_GF_BOOST_RT;
  ------------------
  |  |   58|  15.1k|#define DEFAULT_GF_BOOST_RT 2000
  ------------------
 2990|  15.1k|  p_rc->constrained_gf_group =
 2991|  15.1k|      (p_rc->baseline_gf_interval >= rc->frames_to_key &&
  ------------------
  |  Branch (2991:8): [True: 0, False: 15.1k]
  ------------------
 2992|      0|       cpi->oxcf.kf_cfg.auto_key)
  ------------------
  |  Branch (2992:8): [True: 0, False: 0]
  ------------------
 2993|  15.1k|          ? 1
 2994|  15.1k|          : 0;
 2995|  15.1k|  rc->frames_till_gf_update_due = p_rc->baseline_gf_interval;
 2996|  15.1k|  cpi->gf_frame_index = 0;
 2997|       |  // SVC does not use GF as periodic boost.
 2998|       |  // TODO(marpan): Find better way to disable this for SVC.
 2999|  15.1k|  if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (2999:7): [True: 0, False: 15.1k]
  ------------------
 3000|      0|    SVC *const svc = &cpi->svc;
 3001|      0|    p_rc->baseline_gf_interval = MAX_STATIC_GF_GROUP_LENGTH - 1;
  ------------------
  |  |   42|      0|#define MAX_STATIC_GF_GROUP_LENGTH 250
  ------------------
 3002|      0|    p_rc->gfu_boost = 1;
 3003|      0|    p_rc->constrained_gf_group = 0;
 3004|      0|    rc->frames_till_gf_update_due = p_rc->baseline_gf_interval;
 3005|      0|    for (int layer = 0;
 3006|      0|         layer < svc->number_spatial_layers * svc->number_temporal_layers;
  ------------------
  |  Branch (3006:10): [True: 0, False: 0]
  ------------------
 3007|      0|         ++layer) {
 3008|      0|      LAYER_CONTEXT *const lc = &svc->layer_context[layer];
 3009|      0|      lc->p_rc.baseline_gf_interval = p_rc->baseline_gf_interval;
 3010|      0|      lc->p_rc.gfu_boost = p_rc->gfu_boost;
 3011|      0|      lc->p_rc.constrained_gf_group = p_rc->constrained_gf_group;
 3012|      0|      lc->rc.frames_till_gf_update_due = rc->frames_till_gf_update_due;
 3013|      0|      lc->group_index = 0;
 3014|      0|    }
 3015|      0|  }
 3016|  15.1k|  gf_group->size = p_rc->baseline_gf_interval;
 3017|  15.1k|  gf_group->update_type[0] = (frame_type == KEY_FRAME) ? KF_UPDATE : GF_UPDATE;
  ------------------
  |  Branch (3017:30): [True: 6.10k, False: 9.01k]
  ------------------
 3018|  15.1k|  gf_group->refbuf_state[cpi->gf_frame_index] =
 3019|  15.1k|      (frame_type == KEY_FRAME) ? REFBUF_RESET : REFBUF_UPDATE;
  ------------------
  |  Branch (3019:7): [True: 6.10k, False: 9.01k]
  ------------------
 3020|  15.1k|}
ratectrl.c:set_golden_update:
 2958|  15.1k|static void set_golden_update(AV1_COMP *const cpi) {
 2959|  15.1k|  RATE_CONTROL *const rc = &cpi->rc;
 2960|  15.1k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 2961|  15.1k|  int divisor = 10;
 2962|  15.1k|  if (cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ)
  ------------------
  |  Branch (2962:7): [True: 0, False: 15.1k]
  ------------------
 2963|      0|    divisor = cpi->cyclic_refresh->percent_refresh;
 2964|       |
 2965|       |  // Set minimum gf_interval for GF update to a multiple of the refresh period,
 2966|       |  // with some max limit. Depending on past encoding stats, GF flag may be
 2967|       |  // reset and update may not occur until next baseline_gf_interval.
 2968|  15.1k|  const int gf_length_mult[2] = { 8, 4 };
 2969|  15.1k|  if (divisor > 0)
  ------------------
  |  Branch (2969:7): [True: 15.1k, False: 0]
  ------------------
 2970|  15.1k|    p_rc->baseline_gf_interval =
 2971|  15.1k|        AOMMIN(gf_length_mult[cpi->sf.rt_sf.gf_length_lvl] * (100 / divisor),
  ------------------
  |  |   34|  15.1k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.1k, False: 0]
  |  |  ------------------
  ------------------
 2972|  15.1k|               MAX_GF_INTERVAL_RT);
 2973|      0|  else
 2974|      0|    p_rc->baseline_gf_interval = FIXED_GF_INTERVAL_RT;
  ------------------
  |  |   49|      0|#define FIXED_GF_INTERVAL_RT 80
  ------------------
 2975|  15.1k|  if (rc->avg_frame_low_motion && rc->avg_frame_low_motion < 40)
  ------------------
  |  Branch (2975:7): [True: 2.57k, False: 12.5k]
  |  Branch (2975:35): [True: 1.21k, False: 1.35k]
  ------------------
 2976|  1.21k|    p_rc->baseline_gf_interval = 16;
 2977|  15.1k|}
ratectrl.c:set_flag_rps_bias_recovery_frame:
 3839|  24.4k|static bool set_flag_rps_bias_recovery_frame(const AV1_COMP *const cpi) {
 3840|  24.4k|  if (cpi->ppi->rtc_ref.set_ref_frame_config &&
  ------------------
  |  Branch (3840:7): [True: 0, False: 24.4k]
  ------------------
 3841|      0|      cpi->svc.number_temporal_layers == 1 &&
  ------------------
  |  Branch (3841:7): [True: 0, False: 0]
  ------------------
 3842|      0|      cpi->svc.number_spatial_layers == 1 &&
  ------------------
  |  Branch (3842:7): [True: 0, False: 0]
  ------------------
 3843|      0|      cpi->ppi->rtc_ref.reference_was_previous_frame) {
  ------------------
  |  Branch (3843:7): [True: 0, False: 0]
  ------------------
 3844|      0|    int min_dist = av1_svc_get_min_ref_dist(cpi);
 3845|       |    // Only consider boost for this frame if its closest reference is further
 3846|       |    // than or equal to x frames away, using x = 4 for now.
 3847|      0|    if (min_dist != INT_MAX && min_dist >= 4) return true;
  ------------------
  |  Branch (3847:9): [True: 0, False: 0]
  |  Branch (3847:32): [True: 0, False: 0]
  ------------------
 3848|      0|  }
 3849|  24.4k|  return false;
 3850|  24.4k|}
ratectrl.c:set_key_frame:
 3809|  24.4k|static inline int set_key_frame(AV1_COMP *cpi, unsigned int frame_flags) {
 3810|  24.4k|  RATE_CONTROL *const rc = &cpi->rc;
 3811|  24.4k|  AV1_COMMON *const cm = &cpi->common;
 3812|  24.4k|  SVC *const svc = &cpi->svc;
 3813|       |
 3814|       |  // Very first frame has to be key frame.
 3815|  24.4k|  if (cm->current_frame.frame_number == 0) return 1;
  ------------------
  |  Branch (3815:7): [True: 6.10k, False: 18.3k]
  ------------------
 3816|       |  // Set key frame if forced by frame flags.
 3817|  18.3k|  if (frame_flags & FRAMEFLAGS_KEY) return 1;
  ------------------
  |  Branch (3817:7): [True: 0, False: 18.3k]
  ------------------
 3818|  18.3k|  if (!cpi->ppi->use_svc) {
  ------------------
  |  Branch (3818:7): [True: 18.3k, False: 0]
  ------------------
 3819|       |    // Non-SVC
 3820|  18.3k|    if (cpi->oxcf.kf_cfg.auto_key && rc->frames_to_key == 0) return 1;
  ------------------
  |  Branch (3820:9): [True: 18.3k, False: 0]
  |  Branch (3820:38): [True: 0, False: 18.3k]
  ------------------
 3821|  18.3k|  } else {
 3822|       |    // SVC
 3823|      0|    if (svc->spatial_layer_id == 0 &&
  ------------------
  |  Branch (3823:9): [True: 0, False: 0]
  ------------------
 3824|      0|        (cpi->oxcf.kf_cfg.auto_key &&
  ------------------
  |  Branch (3824:10): [True: 0, False: 0]
  ------------------
 3825|      0|         (cpi->oxcf.kf_cfg.key_freq_max == 0 ||
  ------------------
  |  Branch (3825:11): [True: 0, False: 0]
  ------------------
 3826|      0|          svc->current_superframe % cpi->oxcf.kf_cfg.key_freq_max == 0)))
  ------------------
  |  Branch (3826:11): [True: 0, False: 0]
  ------------------
 3827|      0|      return 1;
 3828|      0|  }
 3829|       |
 3830|  18.3k|  return 0;
 3831|  18.3k|}
ratectrl.c:resize_reset_rc:
 3645|  15.1k|                            int prev_width, int prev_height) {
 3646|  15.1k|  RATE_CONTROL *const rc = &cpi->rc;
 3647|  15.1k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
 3648|  15.1k|  SVC *const svc = &cpi->svc;
 3649|  15.1k|  int target_bits_per_frame;
 3650|  15.1k|  int active_worst_quality;
 3651|  15.1k|  int qindex;
 3652|  15.1k|  double tot_scale_change = (double)(resize_width * resize_height) /
 3653|  15.1k|                            (double)(prev_width * prev_height);
 3654|       |  // Disable the skip mv search for svc on resize frame.
 3655|  15.1k|  svc->skip_mvsearch_last = 0;
 3656|  15.1k|  svc->skip_mvsearch_gf = 0;
 3657|  15.1k|  svc->skip_mvsearch_altref = 0;
 3658|       |  // Reset buffer level to optimal, update target size.
 3659|  15.1k|  p_rc->buffer_level = p_rc->optimal_buffer_level;
 3660|  15.1k|  p_rc->bits_off_target = p_rc->optimal_buffer_level;
 3661|  15.1k|  rc->this_frame_target =
 3662|  15.1k|      av1_calc_pframe_target_size_one_pass_cbr(cpi, INTER_FRAME);
 3663|  15.1k|  target_bits_per_frame = rc->this_frame_target;
 3664|  15.1k|  if (tot_scale_change > 4.0)
  ------------------
  |  Branch (3664:7): [True: 2.11k, False: 12.9k]
  ------------------
 3665|  2.11k|    p_rc->avg_frame_qindex[INTER_FRAME] = rc->worst_quality;
 3666|  12.9k|  else if (tot_scale_change > 1.0)
  ------------------
  |  Branch (3666:12): [True: 6.89k, False: 6.10k]
  ------------------
 3667|  6.89k|    p_rc->avg_frame_qindex[INTER_FRAME] =
 3668|  6.89k|        (p_rc->avg_frame_qindex[INTER_FRAME] + rc->worst_quality) >> 1;
 3669|  15.1k|  active_worst_quality = calc_active_worst_quality_no_stats_cbr(cpi);
 3670|  15.1k|  qindex = av1_rc_regulate_q(cpi, target_bits_per_frame, rc->best_quality,
 3671|  15.1k|                             active_worst_quality, resize_width, resize_height);
 3672|       |  // If resize is down, check if projected q index is close to worst_quality,
 3673|       |  // and if so, reduce the rate correction factor (since likely can afford
 3674|       |  // lower q for resized frame).
 3675|  15.1k|  if (tot_scale_change < 1.0 && qindex > 90 * rc->worst_quality / 100)
  ------------------
  |  Branch (3675:7): [True: 6.10k, False: 9.01k]
  |  Branch (3675:33): [True: 1.61k, False: 4.48k]
  ------------------
 3676|  1.61k|    p_rc->rate_correction_factors[INTER_NORMAL] *= 0.85;
 3677|       |  // If resize is back up: check if projected q index is too much above the
 3678|       |  // previous index, and if so, reduce the rate correction factor
 3679|       |  // (since prefer to keep q for resized frame at least closet to previous q).
 3680|       |  // Also check if projected qindex is close to previous qindex, if so
 3681|       |  // increase correction factor (to push qindex higher and avoid overshoot).
 3682|  15.1k|  if (tot_scale_change >= 1.0) {
  ------------------
  |  Branch (3682:7): [True: 9.01k, False: 6.10k]
  ------------------
 3683|  9.01k|    if (tot_scale_change < 4.0 &&
  ------------------
  |  Branch (3683:9): [True: 6.66k, False: 2.34k]
  ------------------
 3684|  6.66k|        qindex > 130 * p_rc->last_q[INTER_FRAME] / 100)
  ------------------
  |  Branch (3684:9): [True: 16, False: 6.65k]
  ------------------
 3685|     16|      p_rc->rate_correction_factors[INTER_NORMAL] *= 0.8;
 3686|  9.01k|    if (qindex <= 120 * p_rc->last_q[INTER_FRAME] / 100)
  ------------------
  |  Branch (3686:9): [True: 8.93k, False: 80]
  ------------------
 3687|  8.93k|      p_rc->rate_correction_factors[INTER_NORMAL] *= 1.5;
 3688|  9.01k|  }
 3689|  15.1k|  if (svc->number_temporal_layers > 1) {
  ------------------
  |  Branch (3689:7): [True: 0, False: 15.1k]
  ------------------
 3690|       |    // Apply the same rate control reset to all temporal layers.
 3691|      0|    for (int tl = 0; tl < svc->number_temporal_layers; tl++) {
  ------------------
  |  Branch (3691:22): [True: 0, False: 0]
  ------------------
 3692|       |      LAYER_CONTEXT *lc = NULL;
 3693|      0|      lc = &svc->layer_context[svc->spatial_layer_id *
 3694|      0|                                   svc->number_temporal_layers +
 3695|      0|                               tl];
 3696|      0|      lc->rc.resize_state = rc->resize_state;
 3697|      0|      lc->p_rc.buffer_level = lc->p_rc.optimal_buffer_level;
 3698|      0|      lc->p_rc.bits_off_target = lc->p_rc.optimal_buffer_level;
 3699|      0|      lc->p_rc.rate_correction_factors[INTER_NORMAL] =
 3700|      0|          p_rc->rate_correction_factors[INTER_NORMAL];
 3701|      0|      lc->p_rc.avg_frame_qindex[INTER_FRAME] =
 3702|      0|          p_rc->avg_frame_qindex[INTER_FRAME];
 3703|      0|    }
 3704|      0|  }
 3705|  15.1k|}
ratectrl.c:set_gf_interval_update_onepass_rt:
 3629|  24.4k|                                             FRAME_TYPE frame_type) {
 3630|  24.4k|  RATE_CONTROL *const rc = &cpi->rc;
 3631|  24.4k|  int gf_update = 0;
 3632|  24.4k|  const int resize_pending = is_frame_resize_pending(cpi);
 3633|       |  // GF update based on frames_till_gf_update_due, also
 3634|       |  // force update on resize pending frame or for scene change.
 3635|  24.4k|  if ((resize_pending || rc->high_source_sad ||
  ------------------
  |  Branch (3635:8): [True: 15.1k, False: 9.28k]
  |  Branch (3635:26): [True: 0, False: 9.28k]
  ------------------
 3636|  9.28k|       rc->frames_till_gf_update_due == 0) &&
  ------------------
  |  Branch (3636:8): [True: 0, False: 9.28k]
  ------------------
 3637|  15.1k|      cpi->svc.temporal_layer_id == 0 && cpi->svc.spatial_layer_id == 0) {
  ------------------
  |  Branch (3637:7): [True: 15.1k, False: 0]
  |  Branch (3637:42): [True: 15.1k, False: 0]
  ------------------
 3638|  15.1k|    set_baseline_gf_interval(cpi, frame_type);
 3639|  15.1k|    gf_update = 1;
 3640|  15.1k|  }
 3641|  24.4k|  return gf_update;
 3642|  24.4k|}

encoder.c:set_primary_rc_buffer_sizes:
   42|   155k|                                               AV1_PRIMARY *ppi) {
   43|   155k|  PRIMARY_RATE_CONTROL *p_rc = &ppi->p_rc;
   44|   155k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
   45|       |
   46|   155k|  const int64_t bandwidth = rc_cfg->target_bandwidth;
   47|   155k|  const int64_t starting = rc_cfg->starting_buffer_level_ms;
   48|   155k|  const int64_t optimal = rc_cfg->optimal_buffer_level_ms;
   49|   155k|  const int64_t maximum = rc_cfg->maximum_buffer_size_ms;
   50|       |
   51|   155k|  p_rc->starting_buffer_level = starting * bandwidth / 1000;
   52|   155k|  p_rc->optimal_buffer_level =
   53|   155k|      (optimal == 0) ? bandwidth / 8 : optimal * bandwidth / 1000;
  ------------------
  |  Branch (53:7): [True: 0, False: 155k]
  ------------------
   54|   155k|  p_rc->maximum_buffer_size =
   55|   155k|      (maximum == 0) ? bandwidth / 8 : maximum * bandwidth / 1000;
  ------------------
  |  Branch (55:7): [True: 0, False: 155k]
  ------------------
   56|       |
   57|       |  // Under a configuration change, where maximum_buffer_size may change,
   58|       |  // keep buffer level clipped to the maximum allowed buffer size.
   59|   155k|  p_rc->bits_off_target =
   60|   155k|      AOMMIN(p_rc->bits_off_target, p_rc->maximum_buffer_size);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
   61|   155k|  p_rc->buffer_level = AOMMIN(p_rc->buffer_level, p_rc->maximum_buffer_size);
  ------------------
  |  |   34|   155k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
   62|   155k|}
encoder.c:check_reset_rc_flag:
   22|   155k|static inline void check_reset_rc_flag(AV1_COMP *cpi) {
   23|   155k|  RATE_CONTROL *rc = &cpi->rc;
   24|   155k|  PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
   25|   155k|  if (cpi->common.current_frame.frame_number >
  ------------------
  |  Branch (25:7): [True: 0, False: 155k]
  ------------------
   26|   155k|      (unsigned int)cpi->svc.number_spatial_layers) {
   27|      0|    if (cpi->ppi->use_svc) {
  ------------------
  |  Branch (27:9): [True: 0, False: 0]
  ------------------
   28|      0|      av1_svc_check_reset_layer_rc_flag(cpi);
   29|      0|    } else {
   30|      0|      if (rc->avg_frame_bandwidth / 3 > (rc->prev_avg_frame_bandwidth >> 1) ||
  ------------------
  |  Branch (30:11): [True: 0, False: 0]
  ------------------
   31|      0|          rc->avg_frame_bandwidth < (rc->prev_avg_frame_bandwidth >> 1)) {
  ------------------
  |  Branch (31:11): [True: 0, False: 0]
  ------------------
   32|      0|        rc->rc_1_frame = 0;
   33|      0|        rc->rc_2_frame = 0;
   34|      0|        p_rc->bits_off_target = p_rc->optimal_buffer_level;
   35|      0|        p_rc->buffer_level = p_rc->optimal_buffer_level;
   36|      0|      }
   37|      0|    }
   38|      0|  }
   39|   155k|}

av1_fill_mode_rates:
   83|   196k|                         FRAME_CONTEXT *fc) {
   84|   196k|  int i, j;
   85|       |
   86|  4.08M|  for (i = 0; i < PARTITION_CONTEXTS; ++i)
  ------------------
  |  |  171|  4.08M|#define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  170|  4.08M|#define PARTITION_BLOCK_SIZES 5
  |  |  ------------------
  |  |               #define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
  |  |  ------------------
  |  |  |  |  169|  4.08M|#define PARTITION_PLOFFSET 4  // number of probability models per block size
  |  |  ------------------
  ------------------
  |  Branch (86:15): [True: 3.88M, False: 196k]
  ------------------
   87|  3.88M|    av1_cost_tokens_from_cdf(mode_costs->partition_cost[i],
   88|  3.88M|                             fc->partition_cdf[i], NULL);
   89|       |
   90|   196k|  if (cm->current_frame.skip_mode_info.skip_mode_flag) {
  ------------------
  |  Branch (90:7): [True: 0, False: 196k]
  ------------------
   91|      0|    for (i = 0; i < SKIP_MODE_CONTEXTS; ++i) {
  ------------------
  |  |  475|      0|#define SKIP_MODE_CONTEXTS 3
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  ------------------
   92|      0|      av1_cost_tokens_from_cdf(mode_costs->skip_mode_cost[i],
   93|      0|                               fc->skip_mode_cdfs[i], NULL);
   94|      0|    }
   95|   196k|  } else {
   96|   196k|    av1_zero(mode_costs->skip_mode_cost);
  ------------------
  |  |   43|   196k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
   97|   196k|  }
   98|       |
   99|   785k|  for (i = 0; i < SKIP_CONTEXTS; ++i) {
  ------------------
  |  |  474|   785k|#define SKIP_CONTEXTS 3
  ------------------
  |  Branch (99:15): [True: 588k, False: 196k]
  ------------------
  100|   588k|    av1_cost_tokens_from_cdf(mode_costs->skip_txfm_cost[i],
  101|   588k|                             fc->skip_txfm_cdfs[i], NULL);
  102|   588k|  }
  103|       |
  104|  1.17M|  for (i = 0; i < KF_MODE_CONTEXTS; ++i)
  ------------------
  |  |   62|  1.17M|#define KF_MODE_CONTEXTS 5
  ------------------
  |  Branch (104:15): [True: 978k, False: 196k]
  ------------------
  105|  5.81M|    for (j = 0; j < KF_MODE_CONTEXTS; ++j)
  ------------------
  |  |   62|  5.81M|#define KF_MODE_CONTEXTS 5
  ------------------
  |  Branch (105:17): [True: 4.84M, False: 978k]
  ------------------
  106|  4.84M|      av1_cost_tokens_from_cdf(mode_costs->y_mode_costs[i][j],
  107|  4.84M|                               fc->kf_y_cdf[i][j], NULL);
  108|       |
  109|   979k|  for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
  ------------------
  |  |   24|   979k|#define BLOCK_SIZE_GROUPS 4
  ------------------
  |  Branch (109:15): [True: 783k, False: 196k]
  ------------------
  110|   783k|    av1_cost_tokens_from_cdf(mode_costs->mbmode_cost[i], fc->y_mode_cdf[i],
  111|   783k|                             NULL);
  112|   589k|  for (i = 0; i < CFL_ALLOWED_TYPES; ++i)
  ------------------
  |  Branch (112:15): [True: 392k, False: 196k]
  ------------------
  113|  5.42M|    for (j = 0; j < INTRA_MODES; ++j)
  ------------------
  |  Branch (113:17): [True: 5.03M, False: 392k]
  ------------------
  114|  5.03M|      av1_cost_tokens_from_cdf(mode_costs->intra_uv_mode_cost[i][j],
  115|  5.03M|                               fc->uv_mode_cdf[i][j], NULL);
  116|       |
  117|   196k|  av1_cost_tokens_from_cdf(mode_costs->filter_intra_mode_cost,
  118|   196k|                           fc->filter_intra_mode_cdf, NULL);
  119|  4.50M|  for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
  ------------------
  |  Branch (119:15): [True: 4.30M, False: 196k]
  ------------------
  120|  4.30M|    if (av1_filter_intra_allowed_bsize(cm, i))
  ------------------
  |  Branch (120:9): [True: 2.74M, False: 1.56M]
  ------------------
  121|  2.74M|      av1_cost_tokens_from_cdf(mode_costs->filter_intra_cost[i],
  122|  2.74M|                               fc->filter_intra_cdfs[i], NULL);
  123|  4.30M|  }
  124|       |
  125|  3.32M|  for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
  ------------------
  |  |  101|  3.32M|#define SWITCHABLE_FILTER_CONTEXTS ((SWITCHABLE_FILTERS + 1) * 4)
  ------------------
  |  Branch (125:15): [True: 3.12M, False: 196k]
  ------------------
  126|  3.12M|    av1_cost_tokens_from_cdf(mode_costs->switchable_interp_costs[i],
  127|  3.12M|                             fc->switchable_interp_cdf[i], NULL);
  128|       |
  129|  1.56M|  for (i = 0; i < PALATTE_BSIZE_CTXS; ++i) {
  ------------------
  |  |   56|  1.56M|#define PALATTE_BSIZE_CTXS 7
  ------------------
  |  Branch (129:15): [True: 1.36M, False: 196k]
  ------------------
  130|  1.36M|    av1_cost_tokens_from_cdf(mode_costs->palette_y_size_cost[i],
  131|  1.36M|                             fc->palette_y_size_cdf[i], NULL);
  132|  1.36M|    av1_cost_tokens_from_cdf(mode_costs->palette_uv_size_cost[i],
  133|  1.36M|                             fc->palette_uv_size_cdf[i], NULL);
  134|  5.46M|    for (j = 0; j < PALETTE_Y_MODE_CONTEXTS; ++j) {
  ------------------
  |  |   43|  5.46M|#define PALETTE_Y_MODE_CONTEXTS 3
  ------------------
  |  Branch (134:17): [True: 4.09M, False: 1.36M]
  ------------------
  135|  4.09M|      av1_cost_tokens_from_cdf(mode_costs->palette_y_mode_cost[i][j],
  136|  4.09M|                               fc->palette_y_mode_cdf[i][j], NULL);
  137|  4.09M|    }
  138|  1.36M|  }
  139|       |
  140|   589k|  for (i = 0; i < PALETTE_UV_MODE_CONTEXTS; ++i) {
  ------------------
  |  |   49|   589k|#define PALETTE_UV_MODE_CONTEXTS 2
  ------------------
  |  Branch (140:15): [True: 392k, False: 196k]
  ------------------
  141|   392k|    av1_cost_tokens_from_cdf(mode_costs->palette_uv_mode_cost[i],
  142|   392k|                             fc->palette_uv_mode_cdf[i], NULL);
  143|   392k|  }
  144|       |
  145|  1.56M|  for (i = 0; i < PALETTE_SIZES; ++i) {
  ------------------
  |  Branch (145:15): [True: 1.36M, False: 196k]
  ------------------
  146|  8.14M|    for (j = 0; j < PALETTE_COLOR_INDEX_CONTEXTS; ++j) {
  ------------------
  |  |   35|  8.14M|#define PALETTE_COLOR_INDEX_CONTEXTS 5
  ------------------
  |  Branch (146:17): [True: 6.78M, False: 1.36M]
  ------------------
  147|  6.78M|      av1_cost_tokens_from_cdf(mode_costs->palette_y_color_cost[i][j],
  148|  6.78M|                               fc->palette_y_color_index_cdf[i][j], NULL);
  149|  6.78M|      av1_cost_tokens_from_cdf(mode_costs->palette_uv_color_cost[i][j],
  150|  6.78M|                               fc->palette_uv_color_index_cdf[i][j], NULL);
  151|  6.78M|    }
  152|  1.36M|  }
  153|       |
  154|   196k|  int sign_cost[CFL_JOINT_SIGNS];
  155|   196k|  av1_cost_tokens_from_cdf(sign_cost, fc->cfl_sign_cdf, NULL);
  156|  1.76M|  for (int joint_sign = 0; joint_sign < CFL_JOINT_SIGNS; joint_sign++) {
  ------------------
  |  |  279|  1.76M|#define CFL_JOINT_SIGNS (CFL_SIGNS * CFL_SIGNS - 1)
  ------------------
  |  Branch (156:28): [True: 1.56M, False: 196k]
  ------------------
  157|  1.56M|    int *cost_u = mode_costs->cfl_cost[joint_sign][CFL_PRED_U];
  158|  1.56M|    int *cost_v = mode_costs->cfl_cost[joint_sign][CFL_PRED_V];
  159|  1.56M|    if (CFL_SIGN_U(joint_sign) == CFL_SIGN_ZERO) {
  ------------------
  |  |  281|  1.56M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  ------------------
  |  Branch (159:9): [True: 392k, False: 1.17M]
  ------------------
  160|   392k|      memset(cost_u, 0, CFL_ALPHABET_SIZE * sizeof(*cost_u));
  ------------------
  |  |  257|   392k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   392k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  161|  1.17M|    } else {
  162|  1.17M|      const aom_cdf_prob *cdf_u = fc->cfl_alpha_cdf[CFL_CONTEXT_U(joint_sign)];
  ------------------
  |  |  288|  1.17M|#define CFL_CONTEXT_U(js) (js + 1 - CFL_SIGNS)
  ------------------
  163|  1.17M|      av1_cost_tokens_from_cdf(cost_u, cdf_u, NULL);
  164|  1.17M|    }
  165|  1.56M|    if (CFL_SIGN_V(joint_sign) == CFL_SIGN_ZERO) {
  ------------------
  |  |  283|  1.56M|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  ------------------
  |  |  |  |  281|  1.56M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  |  Branch (165:9): [True: 392k, False: 1.17M]
  ------------------
  166|   392k|      memset(cost_v, 0, CFL_ALPHABET_SIZE * sizeof(*cost_v));
  ------------------
  |  |  257|   392k|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|   392k|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  167|  1.17M|    } else {
  168|  1.17M|      const aom_cdf_prob *cdf_v = fc->cfl_alpha_cdf[CFL_CONTEXT_V(joint_sign)];
  ------------------
  |  |  291|  1.17M|  (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  283|  1.17M|#define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
  |  |  |  |  ------------------
  |  |  |  |  |  |  281|  1.17M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
  |  |  ------------------
  |  |  |  |  281|  1.17M|#define CFL_SIGN_U(js) (((js + 1) * 11) >> 5)
  |  |  ------------------
  ------------------
  169|  1.17M|      av1_cost_tokens_from_cdf(cost_v, cdf_v, NULL);
  170|  1.17M|    }
  171|  26.5M|    for (int u = 0; u < CFL_ALPHABET_SIZE; u++)
  ------------------
  |  |  257|  26.5M|#define CFL_ALPHABET_SIZE (1 << CFL_ALPHABET_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  256|  26.5M|#define CFL_ALPHABET_SIZE_LOG2 4
  |  |  ------------------
  ------------------
  |  Branch (171:21): [True: 25.0M, False: 1.56M]
  ------------------
  172|  25.0M|      cost_u[u] += sign_cost[joint_sign];
  173|  1.56M|  }
  174|       |
  175|   981k|  for (i = 0; i < MAX_TX_CATS; ++i)
  ------------------
  |  |  179|   981k|#define MAX_TX_CATS (TX_SIZES - TX_SIZE_CTX_MIN)
  |  |  ------------------
  |  |  |  |  176|   981k|#define TX_SIZE_CTX_MIN (TX_SIZE_LUMA_MIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  173|   981k|#define TX_SIZE_LUMA_MIN (TX_4X4)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:15): [True: 785k, False: 196k]
  ------------------
  176|  3.13M|    for (j = 0; j < TX_SIZE_CONTEXTS; ++j)
  ------------------
  |  |   26|  3.13M|#define TX_SIZE_CONTEXTS 3
  ------------------
  |  Branch (176:17): [True: 2.35M, False: 785k]
  ------------------
  177|  2.35M|      av1_cost_tokens_from_cdf(mode_costs->tx_size_cost[i][j],
  178|  2.35M|                               fc->tx_size_cdf[i][j], NULL);
  179|       |
  180|  4.30M|  for (i = 0; i < TXFM_PARTITION_CONTEXTS; ++i) {
  ------------------
  |  |  521|  4.30M|#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 3)
  ------------------
  |  Branch (180:15): [True: 4.11M, False: 196k]
  ------------------
  181|  4.11M|    av1_cost_tokens_from_cdf(mode_costs->txfm_partition_cost[i],
  182|  4.11M|                             fc->txfm_partition_cdf[i], NULL);
  183|  4.11M|  }
  184|       |
  185|   981k|  for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
  ------------------
  |  |  233|   981k|#define EXT_TX_SIZES 4       // number of sizes that use extended transforms
  ------------------
  |  Branch (185:20): [True: 784k, False: 196k]
  ------------------
  186|   784k|    int s;
  187|  3.13M|    for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
  ------------------
  |  |  234|  3.13M|#define EXT_TX_SETS_INTER 4  // Sets of transform selections for INTER
  ------------------
  |  Branch (187:17): [True: 2.35M, False: 784k]
  ------------------
  188|  2.35M|      if (use_inter_ext_tx_for_txsize[s][i]) {
  ------------------
  |  Branch (188:11): [True: 1.17M, False: 1.17M]
  ------------------
  189|  1.17M|        av1_cost_tokens_from_cdf(
  190|  1.17M|            mode_costs->inter_tx_type_costs[s][i], fc->inter_ext_tx_cdf[s][i],
  191|  1.17M|            av1_ext_tx_inv[av1_ext_tx_set_idx_to_type[1][s]]);
  192|  1.17M|      }
  193|  2.35M|    }
  194|  2.35M|    for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
  ------------------
  |  |  235|  2.35M|#define EXT_TX_SETS_INTRA 3  // Sets of transform selections for INTRA
  ------------------
  |  Branch (194:17): [True: 1.56M, False: 784k]
  ------------------
  195|  1.56M|      if (use_intra_ext_tx_for_txsize[s][i]) {
  ------------------
  |  Branch (195:11): [True: 588k, False: 978k]
  ------------------
  196|  8.14M|        for (j = 0; j < INTRA_MODES; ++j) {
  ------------------
  |  Branch (196:21): [True: 7.56M, False: 588k]
  ------------------
  197|  7.56M|          av1_cost_tokens_from_cdf(
  198|  7.56M|              mode_costs->intra_tx_type_costs[s][i][j],
  199|  7.56M|              fc->intra_ext_tx_cdf[s][i][j],
  200|  7.56M|              av1_ext_tx_inv[av1_ext_tx_set_idx_to_type[0][s]]);
  201|  7.56M|        }
  202|   588k|      }
  203|  1.56M|    }
  204|   784k|  }
  205|  1.76M|  for (i = 0; i < DIRECTIONAL_MODES; ++i) {
  ------------------
  |  |  466|  1.76M|#define DIRECTIONAL_MODES 8
  ------------------
  |  Branch (205:15): [True: 1.56M, False: 196k]
  ------------------
  206|  1.56M|    av1_cost_tokens_from_cdf(mode_costs->angle_delta_cost[i],
  207|  1.56M|                             fc->angle_delta_cdf[i], NULL);
  208|  1.56M|  }
  209|   196k|  av1_cost_tokens_from_cdf(mode_costs->intrabc_cost, fc->intrabc_cdf, NULL);
  210|       |
  211|   785k|  for (i = 0; i < SPATIAL_PREDICTION_PROBS; ++i) {
  ------------------
  |  |   27|   785k|#define SPATIAL_PREDICTION_PROBS 3
  ------------------
  |  Branch (211:15): [True: 588k, False: 196k]
  ------------------
  212|   588k|    av1_cost_tokens_from_cdf(mode_costs->spatial_pred_cost[i],
  213|   588k|                             fc->seg.spatial_pred_seg_cdf[i], NULL);
  214|   588k|  }
  215|       |
  216|   785k|  for (i = 0; i < SEG_TEMPORAL_PRED_CTXS; ++i) {
  ------------------
  |  |   26|   785k|#define SEG_TEMPORAL_PRED_CTXS 3
  ------------------
  |  Branch (216:15): [True: 589k, False: 196k]
  ------------------
  217|   589k|    av1_cost_tokens_from_cdf(mode_costs->tmp_pred_cost[i], fc->seg.pred_cdf[i],
  218|   589k|                             NULL);
  219|   589k|  }
  220|       |
  221|   196k|  if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (221:7): [True: 153k, False: 42.7k]
  ------------------
  222|   921k|    for (i = 0; i < COMP_INTER_CONTEXTS; ++i) {
  ------------------
  |  |  515|   921k|#define COMP_INTER_CONTEXTS 5
  ------------------
  |  Branch (222:17): [True: 768k, False: 153k]
  ------------------
  223|   768k|      av1_cost_tokens_from_cdf(mode_costs->comp_inter_cost[i],
  224|   768k|                               fc->comp_inter_cdf[i], NULL);
  225|   768k|    }
  226|       |
  227|   614k|    for (i = 0; i < REF_CONTEXTS; ++i) {
  ------------------
  |  |  516|   614k|#define REF_CONTEXTS 3
  ------------------
  |  Branch (227:17): [True: 460k, False: 153k]
  ------------------
  228|  3.21M|      for (j = 0; j < SINGLE_REFS - 1; ++j) {
  ------------------
  |  Branch (228:19): [True: 2.75M, False: 460k]
  ------------------
  229|  2.75M|        av1_cost_tokens_from_cdf(mode_costs->single_ref_cost[i][j],
  230|  2.75M|                                 fc->single_ref_cdf[i][j], NULL);
  231|  2.75M|      }
  232|   460k|    }
  233|       |
  234|   921k|    for (i = 0; i < COMP_REF_TYPE_CONTEXTS; ++i) {
  ------------------
  |  |  518|   921k|#define COMP_REF_TYPE_CONTEXTS 5
  ------------------
  |  Branch (234:17): [True: 768k, False: 153k]
  ------------------
  235|   768k|      av1_cost_tokens_from_cdf(mode_costs->comp_ref_type_cost[i],
  236|   768k|                               fc->comp_ref_type_cdf[i], NULL);
  237|   768k|    }
  238|       |
  239|   614k|    for (i = 0; i < UNI_COMP_REF_CONTEXTS; ++i) {
  ------------------
  |  |  519|   614k|#define UNI_COMP_REF_CONTEXTS 3
  ------------------
  |  Branch (239:17): [True: 460k, False: 153k]
  ------------------
  240|  1.84M|      for (j = 0; j < UNIDIR_COMP_REFS - 1; ++j) {
  ------------------
  |  Branch (240:19): [True: 1.38M, False: 460k]
  ------------------
  241|  1.38M|        av1_cost_tokens_from_cdf(mode_costs->uni_comp_ref_cost[i][j],
  242|  1.38M|                                 fc->uni_comp_ref_cdf[i][j], NULL);
  243|  1.38M|      }
  244|   460k|    }
  245|       |
  246|   614k|    for (i = 0; i < REF_CONTEXTS; ++i) {
  ------------------
  |  |  516|   614k|#define REF_CONTEXTS 3
  ------------------
  |  Branch (246:17): [True: 460k, False: 153k]
  ------------------
  247|  1.84M|      for (j = 0; j < FWD_REFS - 1; ++j) {
  ------------------
  |  Branch (247:19): [True: 1.38M, False: 460k]
  ------------------
  248|  1.38M|        av1_cost_tokens_from_cdf(mode_costs->comp_ref_cost[i][j],
  249|  1.38M|                                 fc->comp_ref_cdf[i][j], NULL);
  250|  1.38M|      }
  251|   460k|    }
  252|       |
  253|   614k|    for (i = 0; i < REF_CONTEXTS; ++i) {
  ------------------
  |  |  516|   614k|#define REF_CONTEXTS 3
  ------------------
  |  Branch (253:17): [True: 460k, False: 153k]
  ------------------
  254|  1.38M|      for (j = 0; j < BWD_REFS - 1; ++j) {
  ------------------
  |  Branch (254:19): [True: 921k, False: 460k]
  ------------------
  255|   921k|        av1_cost_tokens_from_cdf(mode_costs->comp_bwdref_cost[i][j],
  256|   921k|                                 fc->comp_bwdref_cdf[i][j], NULL);
  257|   921k|      }
  258|   460k|    }
  259|       |
  260|   768k|    for (i = 0; i < INTRA_INTER_CONTEXTS; ++i) {
  ------------------
  |  |  514|   768k|#define INTRA_INTER_CONTEXTS 4
  ------------------
  |  Branch (260:17): [True: 614k, False: 153k]
  ------------------
  261|   614k|      av1_cost_tokens_from_cdf(mode_costs->intra_inter_cost[i],
  262|   614k|                               fc->intra_inter_cdf[i], NULL);
  263|   614k|    }
  264|       |
  265|  1.07M|    for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i) {
  ------------------
  |  |  482|  1.07M|#define NEWMV_MODE_CONTEXTS 6
  ------------------
  |  Branch (265:17): [True: 921k, False: 153k]
  ------------------
  266|   921k|      av1_cost_tokens_from_cdf(mode_costs->newmv_mode_cost[i], fc->newmv_cdf[i],
  267|   921k|                               NULL);
  268|   921k|    }
  269|       |
  270|   461k|    for (i = 0; i < GLOBALMV_MODE_CONTEXTS; ++i) {
  ------------------
  |  |  483|   461k|#define GLOBALMV_MODE_CONTEXTS 2
  ------------------
  |  Branch (270:17): [True: 307k, False: 153k]
  ------------------
  271|   307k|      av1_cost_tokens_from_cdf(mode_costs->zeromv_mode_cost[i],
  272|   307k|                               fc->zeromv_cdf[i], NULL);
  273|   307k|    }
  274|       |
  275|  1.07M|    for (i = 0; i < REFMV_MODE_CONTEXTS; ++i) {
  ------------------
  |  |  484|  1.07M|#define REFMV_MODE_CONTEXTS 6
  ------------------
  |  Branch (275:17): [True: 921k, False: 153k]
  ------------------
  276|   921k|      av1_cost_tokens_from_cdf(mode_costs->refmv_mode_cost[i], fc->refmv_cdf[i],
  277|   921k|                               NULL);
  278|   921k|    }
  279|       |
  280|   614k|    for (i = 0; i < DRL_MODE_CONTEXTS; ++i) {
  ------------------
  |  |  485|   614k|#define DRL_MODE_CONTEXTS 3
  ------------------
  |  Branch (280:17): [True: 461k, False: 153k]
  ------------------
  281|   461k|      av1_cost_tokens_from_cdf(mode_costs->drl_mode_cost0[i], fc->drl_cdf[i],
  282|   461k|                               NULL);
  283|   461k|    }
  284|  1.37M|    for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
  ------------------
  |  |  495|  1.37M|#define INTER_MODE_CONTEXTS 8
  ------------------
  |  Branch (284:17): [True: 1.22M, False: 153k]
  ------------------
  285|  1.22M|      av1_cost_tokens_from_cdf(mode_costs->inter_compound_mode_cost[i],
  286|  1.22M|                               fc->inter_compound_mode_cdf[i], NULL);
  287|  3.52M|    for (i = 0; i < BLOCK_SIZES_ALL; ++i)
  ------------------
  |  Branch (287:17): [True: 3.36M, False: 153k]
  ------------------
  288|  3.36M|      av1_cost_tokens_from_cdf(mode_costs->compound_type_cost[i],
  289|  3.36M|                               fc->compound_type_cdf[i], NULL);
  290|  3.51M|    for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
  ------------------
  |  Branch (290:17): [True: 3.36M, False: 153k]
  ------------------
  291|  3.36M|      if (av1_is_wedge_used(i)) {
  ------------------
  |  Branch (291:11): [True: 1.37M, False: 1.98M]
  ------------------
  292|  1.37M|        av1_cost_tokens_from_cdf(mode_costs->wedge_idx_cost[i],
  293|  1.37M|                                 fc->wedge_idx_cdf[i], NULL);
  294|  1.37M|      }
  295|  3.36M|    }
  296|   767k|    for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) {
  ------------------
  |  |   24|   767k|#define BLOCK_SIZE_GROUPS 4
  ------------------
  |  Branch (296:17): [True: 614k, False: 153k]
  ------------------
  297|   614k|      av1_cost_tokens_from_cdf(mode_costs->interintra_cost[i],
  298|   614k|                               fc->interintra_cdf[i], NULL);
  299|   614k|      av1_cost_tokens_from_cdf(mode_costs->interintra_mode_cost[i],
  300|   614k|                               fc->interintra_mode_cdf[i], NULL);
  301|   614k|    }
  302|  3.52M|    for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
  ------------------
  |  Branch (302:17): [True: 3.36M, False: 153k]
  ------------------
  303|  3.36M|      av1_cost_tokens_from_cdf(mode_costs->wedge_interintra_cost[i],
  304|  3.36M|                               fc->wedge_interintra_cdf[i], NULL);
  305|  3.36M|    }
  306|  3.06M|    for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; i++) {
  ------------------
  |  Branch (306:25): [True: 2.90M, False: 153k]
  ------------------
  307|  2.90M|      av1_cost_tokens_from_cdf(mode_costs->motion_mode_cost[i],
  308|  2.90M|                               fc->motion_mode_cdf[i], NULL);
  309|  2.90M|    }
  310|  3.06M|    for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; i++) {
  ------------------
  |  Branch (310:25): [True: 2.91M, False: 153k]
  ------------------
  311|  2.91M|      av1_cost_tokens_from_cdf(mode_costs->motion_mode_cost1[i],
  312|  2.91M|                               fc->obmc_cdf[i], NULL);
  313|  2.91M|    }
  314|  1.07M|    for (i = 0; i < COMP_INDEX_CONTEXTS; ++i) {
  ------------------
  |  |  477|  1.07M|#define COMP_INDEX_CONTEXTS 6
  ------------------
  |  Branch (314:17): [True: 921k, False: 153k]
  ------------------
  315|   921k|      av1_cost_tokens_from_cdf(mode_costs->comp_idx_cost[i],
  316|   921k|                               fc->compound_index_cdf[i], NULL);
  317|   921k|    }
  318|  1.07M|    for (i = 0; i < COMP_GROUP_IDX_CONTEXTS; ++i) {
  ------------------
  |  |  478|  1.07M|#define COMP_GROUP_IDX_CONTEXTS 6
  ------------------
  |  Branch (318:17): [True: 921k, False: 153k]
  ------------------
  319|   921k|      av1_cost_tokens_from_cdf(mode_costs->comp_group_idx_cost[i],
  320|       |                               fc->comp_group_idx_cdf[i], NULL);
  321|   921k|    }
  322|   153k|  }
  323|   196k|}
av1_fill_lr_rates:
  326|  10.1k|void av1_fill_lr_rates(ModeCosts *mode_costs, FRAME_CONTEXT *fc) {
  327|  10.1k|  av1_cost_tokens_from_cdf(mode_costs->switchable_restore_cost,
  328|  10.1k|                           fc->switchable_restore_cdf, NULL);
  329|  10.1k|  av1_cost_tokens_from_cdf(mode_costs->wiener_restore_cost,
  330|  10.1k|                           fc->wiener_restore_cdf, NULL);
  331|  10.1k|  av1_cost_tokens_from_cdf(mode_costs->sgrproj_restore_cost,
  332|       |                           fc->sgrproj_restore_cdf, NULL);
  333|  10.1k|}
av1_init_me_luts:
  359|  18.4k|void av1_init_me_luts(void) { aom_once(init_me_luts); }
av1_compute_rd_mult_based_on_qindex:
  392|  7.61M|                                        MODE mode) {
  393|  7.61M|  const int q = av1_dc_quant_QTX(qindex, 0, bit_depth);
  394|  7.61M|  int64_t rdmult = q * q;
  395|  7.61M|  if (update_type == KF_UPDATE) {
  ------------------
  |  Branch (395:7): [True: 882k, False: 6.73M]
  ------------------
  396|   882k|    double def_rd_q_mult = def_kf_rd_multiplier(q);
  397|   882k|    rdmult = (int64_t)((double)rdmult * def_rd_q_mult);
  398|  6.73M|  } else if ((update_type == GF_UPDATE) || (update_type == ARF_UPDATE)) {
  ------------------
  |  Branch (398:14): [True: 30.8k, False: 6.70M]
  |  Branch (398:44): [True: 80, False: 6.70M]
  ------------------
  399|  30.3k|    double def_rd_q_mult = def_arf_rd_multiplier(q);
  400|  30.3k|    rdmult = (int64_t)((double)rdmult * def_rd_q_mult);
  401|  6.70M|  } else {
  402|  6.70M|    double def_rd_q_mult = def_inter_rd_multiplier(q);
  403|  6.70M|    rdmult = (int64_t)((double)rdmult * def_rd_q_mult);
  404|  6.70M|  }
  405|       |
  406|  7.61M|  if (tuning == AOM_TUNE_IQ || tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (406:7): [True: 7.57M, False: 42.5k]
  |  Branch (406:32): [True: 0, False: 42.5k]
  ------------------
  407|  7.57M|    int weight;
  408|       |
  409|       |    // Weight terms were determined by iteratively testing various weights
  410|       |    // on CID22 and Daala's subset1, and observing its effects on visual
  411|       |    // quality and SSIMULACRA 2 scores along the usable (0-100) range.
  412|  7.57M|    if (mode == REALTIME) {
  ------------------
  |  Branch (412:9): [True: 69.7k, False: 7.50M]
  ------------------
  413|       |      // Realtime mode: further multiply rdmult by a fourth (32/128 = 0.25)
  414|       |      // to improve image quality.
  415|       |      // The most noticeable effect is that for inter frames, there's a
  416|       |      // stronger bias towards choosing inter prediction modes with encoded
  417|       |      // coefficient residuals (i.e. no skip mode).
  418|  69.7k|      weight = 32;
  419|  7.50M|    } else {
  420|       |      // All-intra and good-quality modes: Further multiply rdmult (by up to
  421|       |      // 200/128 = 1.5625) to improve image quality.
  422|       |      // The most noticeable effect is a mild bias towards choosing larger
  423|       |      // transform sizes (e.g. one 16x16 transform instead of 4 8x8 transforms).
  424|       |      // For very high qindexes, start progressively reducing the weight towards
  425|       |      // unity (128/128), as transforms are large enough and making them even
  426|       |      // larger actually harms subjective quality and SSIMULACRA 2 scores.
  427|       |      // The ramp-down part of the equation was determined by choosing a fixed
  428|       |      // initial qindex point [qindex 159 = (255 - 159) * 3 / 4] where
  429|       |      // SSIMULACRA 2 scores for encodes with qindexes greater than 159 scored
  430|       |      // at or above their equivalents with no rdmult adjustment.
  431|  7.50M|      weight = clamp(((255 - qindex) * 3) / 4, 0, 72) + 128;
  432|  7.50M|    }
  433|  7.57M|    rdmult = (int64_t)((double)rdmult * weight / 128.0);
  434|  7.57M|  }
  435|       |
  436|  7.61M|  switch (bit_depth) {
  437|  5.47M|    case AOM_BITS_8: break;
  ------------------
  |  Branch (437:5): [True: 5.47M, False: 2.13M]
  ------------------
  438|  1.05M|    case AOM_BITS_10: rdmult = ROUND_POWER_OF_TWO(rdmult, 4); break;
  ------------------
  |  |   41|  1.05M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  |  Branch (438:5): [True: 1.05M, False: 6.55M]
  ------------------
  439|  1.07M|    case AOM_BITS_12: rdmult = ROUND_POWER_OF_TWO(rdmult, 8); break;
  ------------------
  |  |   41|  1.07M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  |  Branch (439:5): [True: 1.07M, False: 6.53M]
  ------------------
  440|      0|    default:
  ------------------
  |  Branch (440:5): [True: 0, False: 7.61M]
  ------------------
  441|      0|      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  442|      0|      return -1;
  443|  7.61M|  }
  444|  7.61M|  return rdmult > 0 ? (int)AOMMIN(rdmult, INT_MAX) : 1;
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.61M, False: 18.4E]
  |  |  ------------------
  ------------------
  |  Branch (444:10): [True: 7.61M, False: 775]
  ------------------
  445|  7.61M|}
av1_compute_rd_mult:
  453|  7.61M|                        const aom_tune_metric tuning, const MODE mode) {
  454|  7.61M|  int64_t rdmult = av1_compute_rd_mult_based_on_qindex(bit_depth, update_type,
  455|  7.61M|                                                       qindex, tuning, mode);
  456|  7.61M|  if (is_stat_consumption_stage && (use_fixed_qp_offsets == 0) &&
  ------------------
  |  Branch (456:7): [True: 0, False: 7.61M]
  |  Branch (456:36): [True: 0, False: 0]
  ------------------
  457|      0|      (frame_type != KEY_FRAME)) {
  ------------------
  |  Branch (457:7): [True: 0, False: 0]
  ------------------
  458|       |    // Layer depth adjustment
  459|      0|    rdmult = (rdmult * rd_layer_depth_factor[layer_depth]) >> 7;
  460|       |    // ARF boost adjustment
  461|      0|    rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7);
  462|      0|  }
  463|  7.61M|  return rdmult > 0 ? (int)AOMMIN(rdmult, INT_MAX) : 1;
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.61M, False: 18.4E]
  |  |  ------------------
  ------------------
  |  Branch (463:10): [True: 7.61M, False: 1.28k]
  ------------------
  464|  7.61M|}
av1_adjust_q_from_delta_q_res:
  495|  93.8k|                                  int curr_qindex) {
  496|  93.8k|  curr_qindex = clamp(curr_qindex, delta_q_res, 256 - delta_q_res);
  497|  93.8k|  const int sign_deltaq_index = curr_qindex - prev_qindex >= 0 ? 1 : -1;
  ------------------
  |  Branch (497:33): [True: 54.2k, False: 39.5k]
  ------------------
  498|  93.8k|  const int deltaq_deadzone = delta_q_res / 4;
  499|  93.8k|  const int qmask = ~(delta_q_res - 1);
  500|  93.8k|  int abs_deltaq_index = abs(curr_qindex - prev_qindex);
  501|  93.8k|  abs_deltaq_index = (abs_deltaq_index + deltaq_deadzone) & qmask;
  502|  93.8k|  int adjust_qindex = prev_qindex + sign_deltaq_index * abs_deltaq_index;
  503|  93.8k|  adjust_qindex = AOMMAX(adjust_qindex, MINQ + 1);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 93.8k, False: 18.4E]
  |  |  ------------------
  ------------------
  504|  93.8k|  return adjust_qindex;
  505|  93.8k|}
av1_set_sad_per_bit:
  547|   241k|void av1_set_sad_per_bit(const AV1_COMP *cpi, int *sadperbit, int qindex) {
  548|   241k|  switch (cpi->common.seq_params->bit_depth) {
  549|   177k|    case AOM_BITS_8: *sadperbit = sad_per_bit_lut_8[qindex]; break;
  ------------------
  |  Branch (549:5): [True: 177k, False: 63.2k]
  ------------------
  550|  30.6k|    case AOM_BITS_10: *sadperbit = sad_per_bit_lut_10[qindex]; break;
  ------------------
  |  Branch (550:5): [True: 30.6k, False: 210k]
  ------------------
  551|  32.6k|    case AOM_BITS_12: *sadperbit = sad_per_bit_lut_12[qindex]; break;
  ------------------
  |  Branch (551:5): [True: 32.6k, False: 208k]
  ------------------
  552|      0|    default:
  ------------------
  |  Branch (552:5): [True: 0, False: 241k]
  ------------------
  553|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  554|   241k|  }
  555|   241k|}
av1_fill_coeff_costs:
  603|   191k|                          const int num_planes) {
  604|   191k|  const int nplanes = AOMMIN(num_planes, PLANE_TYPES);
  ------------------
  |  |   34|   191k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 117k, False: 73.9k]
  |  |  ------------------
  ------------------
  605|  1.52M|  for (int eob_multi_size = 0; eob_multi_size < 7; ++eob_multi_size) {
  ------------------
  |  Branch (605:32): [True: 1.33M, False: 195k]
  ------------------
  606|  3.17M|    for (int plane = 0; plane < nplanes; ++plane) {
  ------------------
  |  Branch (606:25): [True: 1.83M, False: 1.33M]
  ------------------
  607|  1.83M|      LV_MAP_EOB_COST *pcost = &coeff_costs->eob_costs[eob_multi_size][plane];
  608|       |
  609|  5.49M|      for (int ctx = 0; ctx < 2; ++ctx) {
  ------------------
  |  Branch (609:25): [True: 3.65M, False: 1.84M]
  ------------------
  610|  3.65M|        aom_cdf_prob *pcdf;
  611|  3.65M|        switch (eob_multi_size) {
  612|   529k|          case 0: pcdf = fc->eob_flag_cdf16[plane][ctx]; break;
  ------------------
  |  Branch (612:11): [True: 529k, False: 3.12M]
  ------------------
  613|   528k|          case 1: pcdf = fc->eob_flag_cdf32[plane][ctx]; break;
  ------------------
  |  Branch (613:11): [True: 528k, False: 3.12M]
  ------------------
  614|   528k|          case 2: pcdf = fc->eob_flag_cdf64[plane][ctx]; break;
  ------------------
  |  Branch (614:11): [True: 528k, False: 3.12M]
  ------------------
  615|   528k|          case 3: pcdf = fc->eob_flag_cdf128[plane][ctx]; break;
  ------------------
  |  Branch (615:11): [True: 528k, False: 3.12M]
  ------------------
  616|   528k|          case 4: pcdf = fc->eob_flag_cdf256[plane][ctx]; break;
  ------------------
  |  Branch (616:11): [True: 528k, False: 3.12M]
  ------------------
  617|   528k|          case 5: pcdf = fc->eob_flag_cdf512[plane][ctx]; break;
  ------------------
  |  Branch (617:11): [True: 528k, False: 3.12M]
  ------------------
  618|   529k|          case 6:
  ------------------
  |  Branch (618:11): [True: 529k, False: 3.12M]
  ------------------
  619|   529k|          default: pcdf = fc->eob_flag_cdf1024[plane][ctx]; break;
  ------------------
  |  Branch (619:11): [True: 0, False: 3.65M]
  ------------------
  620|  3.65M|        }
  621|  3.65M|        av1_cost_tokens_from_cdf(pcost->eob_cost[ctx], pcdf, NULL);
  622|  3.65M|      }
  623|  1.83M|    }
  624|  1.33M|  }
  625|  1.15M|  for (int tx_size = 0; tx_size < TX_SIZES; ++tx_size) {
  ------------------
  |  Branch (625:25): [True: 959k, False: 195k]
  ------------------
  626|  2.28M|    for (int plane = 0; plane < nplanes; ++plane) {
  ------------------
  |  Branch (626:25): [True: 1.33M, False: 959k]
  ------------------
  627|  1.33M|      LV_MAP_COEFF_COST *pcost = &coeff_costs->coeff_costs[tx_size][plane];
  628|       |
  629|  18.4M|      for (int ctx = 0; ctx < TXB_SKIP_CONTEXTS; ++ctx)
  ------------------
  |  |   30|  18.4M|#define TXB_SKIP_CONTEXTS 13
  ------------------
  |  Branch (629:25): [True: 17.1M, False: 1.33M]
  ------------------
  630|  17.1M|        av1_cost_tokens_from_cdf(pcost->txb_skip_cost[ctx],
  631|  17.1M|                                 fc->txb_skip_cdf[tx_size][ctx], NULL);
  632|       |
  633|  6.62M|      for (int ctx = 0; ctx < SIG_COEF_CONTEXTS_EOB; ++ctx)
  ------------------
  |  |   36|  6.62M|#define SIG_COEF_CONTEXTS_EOB 4
  ------------------
  |  Branch (633:25): [True: 5.29M, False: 1.33M]
  ------------------
  634|  5.29M|        av1_cost_tokens_from_cdf(pcost->base_eob_cost[ctx],
  635|  5.29M|                                 fc->coeff_base_eob_cdf[tx_size][plane][ctx],
  636|  5.29M|                                 NULL);
  637|  55.2M|      for (int ctx = 0; ctx < SIG_COEF_CONTEXTS; ++ctx)
  ------------------
  |  |   37|  55.2M|#define SIG_COEF_CONTEXTS (SIG_COEF_CONTEXTS_2D + SIG_COEF_CONTEXTS_1D)
  |  |  ------------------
  |  |  |  |   34|  55.2M|#define SIG_COEF_CONTEXTS_2D 26
  |  |  ------------------
  |  |               #define SIG_COEF_CONTEXTS (SIG_COEF_CONTEXTS_2D + SIG_COEF_CONTEXTS_1D)
  |  |  ------------------
  |  |  |  |   35|  55.2M|#define SIG_COEF_CONTEXTS_1D 16
  |  |  ------------------
  ------------------
  |  Branch (637:25): [True: 53.9M, False: 1.33M]
  ------------------
  638|  53.9M|        av1_cost_tokens_from_cdf(pcost->base_cost[ctx],
  639|  53.9M|                                 fc->coeff_base_cdf[tx_size][plane][ctx], NULL);
  640|       |
  641|  57.0M|      for (int ctx = 0; ctx < SIG_COEF_CONTEXTS; ++ctx) {
  ------------------
  |  |   37|  57.0M|#define SIG_COEF_CONTEXTS (SIG_COEF_CONTEXTS_2D + SIG_COEF_CONTEXTS_1D)
  |  |  ------------------
  |  |  |  |   34|  57.0M|#define SIG_COEF_CONTEXTS_2D 26
  |  |  ------------------
  |  |               #define SIG_COEF_CONTEXTS (SIG_COEF_CONTEXTS_2D + SIG_COEF_CONTEXTS_1D)
  |  |  ------------------
  |  |  |  |   35|  57.0M|#define SIG_COEF_CONTEXTS_1D 16
  |  |  ------------------
  ------------------
  |  Branch (641:25): [True: 55.7M, False: 1.33M]
  ------------------
  642|  55.7M|        pcost->base_cost[ctx][4] = 0;
  643|  55.7M|        pcost->base_cost[ctx][5] = pcost->base_cost[ctx][1] +
  644|  55.7M|                                   av1_cost_literal(1) -
  ------------------
  |  |   29|  55.7M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  55.7M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  645|  55.7M|                                   pcost->base_cost[ctx][0];
  646|  55.7M|        pcost->base_cost[ctx][6] =
  647|  55.7M|            pcost->base_cost[ctx][2] - pcost->base_cost[ctx][1];
  648|  55.7M|        pcost->base_cost[ctx][7] =
  649|  55.7M|            pcost->base_cost[ctx][3] - pcost->base_cost[ctx][2];
  650|  55.7M|      }
  651|       |
  652|  13.2M|      for (int ctx = 0; ctx < EOB_COEF_CONTEXTS; ++ctx)
  ------------------
  |  |   32|  13.2M|#define EOB_COEF_CONTEXTS 9
  ------------------
  |  Branch (652:25): [True: 11.9M, False: 1.33M]
  ------------------
  653|  11.9M|        av1_cost_tokens_from_cdf(pcost->eob_extra_cost[ctx],
  654|  11.9M|                                 fc->eob_extra_cdf[tx_size][plane][ctx], NULL);
  655|       |
  656|  5.30M|      for (int ctx = 0; ctx < DC_SIGN_CONTEXTS; ++ctx)
  ------------------
  |  |   40|  5.30M|#define DC_SIGN_CONTEXTS 3
  ------------------
  |  Branch (656:25): [True: 3.97M, False: 1.33M]
  ------------------
  657|  3.97M|        av1_cost_tokens_from_cdf(pcost->dc_sign_cost[ctx],
  658|  3.97M|                                 fc->dc_sign_cdf[plane][ctx], NULL);
  659|       |
  660|  29.1M|      for (int ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
  ------------------
  |  |   44|  29.1M|#define LEVEL_CONTEXTS 21
  ------------------
  |  Branch (660:25): [True: 27.8M, False: 1.33M]
  ------------------
  661|  27.8M|        int br_rate[BR_CDF_SIZE];
  662|  27.8M|        int prev_cost = 0;
  663|  27.8M|        int i, j;
  664|  27.8M|        av1_cost_tokens_from_cdf(
  665|  27.8M|            br_rate, fc->coeff_br_cdf[AOMMIN(tx_size, TX_32X32)][plane][ctx],
  ------------------
  |  |   34|  27.8M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 16.7M, False: 11.1M]
  |  |  ------------------
  ------------------
  666|  27.8M|            NULL);
  667|   137M|        for (i = 0; i < COEFF_BASE_RANGE; i += BR_CDF_SIZE - 1) {
  ------------------
  |  |   49|   137M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   137M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                      for (i = 0; i < COEFF_BASE_RANGE; i += BR_CDF_SIZE - 1) {
  ------------------
  |  |   48|   109M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (667:21): [True: 109M, False: 27.8M]
  ------------------
  668|   436M|          for (j = 0; j < BR_CDF_SIZE - 1; j++) {
  ------------------
  |  |   48|   436M|#define BR_CDF_SIZE (4)
  ------------------
  |  Branch (668:23): [True: 326M, False: 109M]
  ------------------
  669|   326M|            pcost->lps_cost[ctx][i + j] = prev_cost + br_rate[j];
  670|   326M|          }
  671|   109M|          prev_cost += br_rate[j];
  672|   109M|        }
  673|  27.8M|        pcost->lps_cost[ctx][i] = prev_cost;
  674|  27.8M|      }
  675|  29.1M|      for (int ctx = 0; ctx < LEVEL_CONTEXTS; ++ctx) {
  ------------------
  |  |   44|  29.1M|#define LEVEL_CONTEXTS 21
  ------------------
  |  Branch (675:25): [True: 27.8M, False: 1.33M]
  ------------------
  676|  27.8M|        pcost->lps_cost[ctx][0 + COEFF_BASE_RANGE + 1] =
  ------------------
  |  |   49|  27.8M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  27.8M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
  677|  27.8M|            pcost->lps_cost[ctx][0];
  678|   361M|        for (int i = 1; i <= COEFF_BASE_RANGE; ++i) {
  ------------------
  |  |   49|   361M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   361M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
  |  Branch (678:25): [True: 333M, False: 27.8M]
  ------------------
  679|   333M|          pcost->lps_cost[ctx][i + COEFF_BASE_RANGE + 1] =
  ------------------
  |  |   49|   333M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   333M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
  680|   333M|              pcost->lps_cost[ctx][i] - pcost->lps_cost[ctx][i - 1];
  681|   333M|        }
  682|  27.8M|      }
  683|  1.33M|    }
  684|   959k|  }
  685|   195k|}
av1_fill_mv_costs:
  688|   163k|                       MvCosts *mv_costs) {
  689|       |  // Avoid accessing 'mv_costs' when it is not allocated.
  690|   163k|  if (mv_costs == NULL) return;
  ------------------
  |  Branch (690:7): [True: 0, False: 163k]
  ------------------
  691|       |
  692|   163k|  mv_costs->nmv_cost[0] = &mv_costs->nmv_cost_alloc[0][MV_MAX];
  ------------------
  |  |   71|   163k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   163k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   163k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   163k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|   163k|  mv_costs->nmv_cost[1] = &mv_costs->nmv_cost_alloc[1][MV_MAX];
  ------------------
  |  |   71|   163k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   163k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   163k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   163k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  694|   163k|  mv_costs->nmv_cost_hp[0] = &mv_costs->nmv_cost_hp_alloc[0][MV_MAX];
  ------------------
  |  |   71|   163k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   163k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   163k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   163k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|   163k|  mv_costs->nmv_cost_hp[1] = &mv_costs->nmv_cost_hp_alloc[1][MV_MAX];
  ------------------
  |  |   71|   163k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|   163k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|   163k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   163k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|   163k|  if (integer_mv) {
  ------------------
  |  Branch (696:7): [True: 0, False: 163k]
  ------------------
  697|      0|    mv_costs->mv_cost_stack = (int **)&mv_costs->nmv_cost;
  698|      0|    av1_build_nmv_cost_table(mv_costs->nmv_joint_cost, mv_costs->mv_cost_stack,
  699|      0|                             nmvc, MV_SUBPEL_NONE);
  700|   163k|  } else {
  701|   163k|    mv_costs->mv_cost_stack =
  702|   163k|        usehp ? mv_costs->nmv_cost_hp : mv_costs->nmv_cost;
  ------------------
  |  Branch (702:9): [True: 74.1k, False: 88.9k]
  ------------------
  703|   163k|    av1_build_nmv_cost_table(mv_costs->nmv_joint_cost, mv_costs->mv_cost_stack,
  704|   163k|                             nmvc, usehp);
  705|   163k|  }
  706|   163k|}
av1_fill_dv_costs:
  708|  4.30k|void av1_fill_dv_costs(const nmv_context *ndvc, IntraBCMVCosts *dv_costs) {
  709|  4.30k|  dv_costs->dv_costs[0] = &dv_costs->dv_costs_alloc[0][MV_MAX];
  ------------------
  |  |   71|  4.30k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  4.30k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  4.30k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  4.30k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|  4.30k|  dv_costs->dv_costs[1] = &dv_costs->dv_costs_alloc[1][MV_MAX];
  ------------------
  |  |   71|  4.30k|#define MV_MAX ((1 << MV_MAX_BITS) - 1)
  |  |  ------------------
  |  |  |  |   70|  4.30k|#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  4.30k|#define MV_CLASSES 11
  |  |  |  |  ------------------
  |  |  |  |               #define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  4.30k|#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  711|  4.30k|  av1_build_nmv_cost_table(dv_costs->joint_mv, dv_costs->dv_costs, ndvc,
  712|  4.30k|                           MV_SUBPEL_NONE);
  713|  4.30k|}
av1_initialize_rd_consts:
  789|  73.6k|void av1_initialize_rd_consts(AV1_COMP *cpi) {
  790|  73.6k|  AV1_COMMON *const cm = &cpi->common;
  791|  73.6k|  MACROBLOCK *const x = &cpi->td.mb;
  792|  73.6k|  SPEED_FEATURES *const sf = &cpi->sf;
  793|  73.6k|  RD_OPT *const rd = &cpi->rd;
  794|  73.6k|  int use_nonrd_pick_mode = cpi->sf.rt_sf.use_nonrd_pick_mode;
  795|  73.6k|  int frames_since_key = cpi->rc.frames_since_key;
  796|       |
  797|  73.6k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  798|  73.6k|  const int boost_index = AOMMIN(15, (cpi->ppi->p_rc.gfu_boost / 100));
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
  799|  73.6k|  const int layer_depth = AOMMIN(gf_group->layer_depth[cpi->gf_frame_index], 6);
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
  800|  73.6k|  const FRAME_TYPE frame_type = cm->current_frame.frame_type;
  801|       |
  802|  73.6k|  const int qindex_rdmult =
  803|  73.6k|      cm->quant_params.base_qindex + cm->quant_params.y_dc_delta_q;
  804|  73.6k|  rd->RDMULT = av1_compute_rd_mult(
  805|  73.6k|      qindex_rdmult, cm->seq_params->bit_depth,
  806|  73.6k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index], layer_depth,
  807|  73.6k|      boost_index, frame_type, cpi->oxcf.q_cfg.use_fixed_qp_offsets,
  808|  73.6k|      is_stat_consumption_stage(cpi), cpi->oxcf.tune_cfg.tuning,
  809|  73.6k|      cpi->oxcf.mode);
  810|       |#if CONFIG_RD_COMMAND
  811|       |  if (cpi->oxcf.pass == 2) {
  812|       |    const RD_COMMAND *rd_command = &cpi->rd_command;
  813|       |    if (rd_command->option_ls[rd_command->frame_index] ==
  814|       |        RD_OPTION_SET_Q_RDMULT) {
  815|       |      rd->RDMULT = rd_command->rdmult_ls[rd_command->frame_index];
  816|       |    }
  817|       |  }
  818|       |#endif  // CONFIG_RD_COMMAND
  819|       |
  820|  73.6k|  av1_set_error_per_bit(&x->errorperbit, rd->RDMULT);
  821|       |
  822|  73.6k|  set_block_thresholds(cm, rd, cpi->sf.rt_sf.use_nonrd_pick_mode);
  823|       |
  824|  73.6k|  populate_unified_cost_update_freq(cpi->oxcf.cost_upd_freq, sf);
  825|  73.6k|  const INTER_MODE_SPEED_FEATURES *const inter_sf = &cpi->sf.inter_sf;
  826|       |  // Frame level mv cost update
  827|  73.6k|  if (is_frame_level_cost_upd_freq_set(cm, inter_sf->mv_cost_upd_level,
  ------------------
  |  Branch (827:7): [True: 61.4k, False: 12.2k]
  ------------------
  828|  73.6k|                                       use_nonrd_pick_mode, frames_since_key))
  829|  61.4k|    av1_fill_mv_costs(&cm->fc->nmvc, cm->features.cur_frame_force_integer_mv,
  830|  61.4k|                      cm->features.allow_high_precision_mv, x->mv_costs);
  831|       |
  832|       |  // Frame level coefficient cost update
  833|  73.6k|  if (is_frame_level_cost_upd_freq_set(cm, inter_sf->coeff_cost_upd_level,
  ------------------
  |  Branch (833:7): [True: 61.4k, False: 12.2k]
  ------------------
  834|  73.6k|                                       use_nonrd_pick_mode, frames_since_key))
  835|  61.4k|    av1_fill_coeff_costs(&x->coeff_costs, cm->fc, av1_num_planes(cm));
  836|       |
  837|       |  // Frame level mode cost update
  838|  73.6k|  if (should_force_mode_cost_update(cpi) ||
  ------------------
  |  Branch (838:7): [True: 9.01k, False: 64.6k]
  ------------------
  839|  64.6k|      is_frame_level_cost_upd_freq_set(cm, inter_sf->mode_cost_upd_level,
  ------------------
  |  Branch (839:7): [True: 56.9k, False: 7.69k]
  ------------------
  840|  64.6k|                                       use_nonrd_pick_mode, frames_since_key))
  841|  65.9k|    av1_fill_mode_rates(cm, &x->mode_costs, cm->fc);
  842|       |
  843|       |  // Frame level dv cost update
  844|  73.6k|  if (av1_need_dv_costs(cpi)) {
  ------------------
  |  Branch (844:7): [True: 1.98k, False: 71.6k]
  ------------------
  845|  1.98k|    if (cpi->td.dv_costs_alloc == NULL) {
  ------------------
  |  Branch (845:9): [True: 1.98k, False: 0]
  ------------------
  846|       |      CHECK_MEM_ERROR(
  ------------------
  |  |   51|  1.98k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  1.98k|  do {                                                    \
  |  |  |  |   72|  1.98k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  1.98k|    lval = (expr);                                        \
  |  |  |  |   74|  1.98k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 1.98k]
  |  |  |  |  ------------------
  |  |  |  |   75|  1.98k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  1.98k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 1.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  847|  1.98k|          cm, cpi->td.dv_costs_alloc,
  848|  1.98k|          (IntraBCMVCosts *)aom_malloc(sizeof(*cpi->td.dv_costs_alloc)));
  849|  1.98k|      cpi->td.mb.dv_costs = cpi->td.dv_costs_alloc;
  850|  1.98k|    }
  851|  1.98k|    av1_fill_dv_costs(&cm->fc->ndvc, x->dv_costs);
  852|  1.98k|  }
  853|  73.6k|}
av1_model_rd_from_var_lapndz:
  923|  4.51M|                                  int64_t *dist) {
  924|       |  // This function models the rate and distortion for a Laplacian
  925|       |  // source with given variance when quantized with a uniform quantizer
  926|       |  // with given stepsize. The closed form expressions are in:
  927|       |  // Hang and Chen, "Source Model for transform video coder and its
  928|       |  // application - Part I: Fundamental Theory", IEEE Trans. Circ.
  929|       |  // Sys. for Video Tech., April 1997.
  930|  4.51M|  if (var == 0) {
  ------------------
  |  Branch (930:7): [True: 19.5k, False: 4.49M]
  ------------------
  931|  19.5k|    *rate = 0;
  932|  19.5k|    *dist = 0;
  933|  4.49M|  } else {
  934|  4.49M|    int d_q10, r_q10;
  935|  4.49M|    static const uint32_t MAX_XSQ_Q10 = 245727;
  936|  4.49M|    const uint64_t xsq_q10_64 =
  937|  4.49M|        (((uint64_t)qstep * qstep << (n_log2 + 10)) + (var >> 1)) / var;
  938|  4.49M|    const int xsq_q10 = (int)AOMMIN(xsq_q10_64, MAX_XSQ_Q10);
  ------------------
  |  |   34|  4.49M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.23M, False: 258k]
  |  |  ------------------
  ------------------
  939|  4.49M|    model_rd_norm(xsq_q10, &r_q10, &d_q10);
  940|  4.49M|    *rate = ROUND_POWER_OF_TWO(r_q10 << n_log2, 10 - AV1_PROB_COST_SHIFT);
  ------------------
  |  |   41|  4.49M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  941|  4.49M|    *dist = (var * (int64_t)d_q10 + 512) >> 10;
  942|  4.49M|  }
  943|  4.51M|}
av1_model_rd_curvfit:
 1071|  2.76M|                          double rate_dist_f[2]) {
 1072|  2.76M|  const double x_start = -15.5;
 1073|  2.76M|  const double x_end = 16.5;
 1074|  2.76M|  const double x_step = 0.5;
 1075|  2.76M|  const double epsilon = 1e-6;
 1076|  2.76M|  const int rcat = bsize_curvfit_model_cat_lookup[bsize];
 1077|  2.76M|  const int dcat = sse_norm_curvfit_model_cat_lookup(sse_norm);
 1078|  2.76M|  (void)x_end;
 1079|       |
 1080|  2.76M|  xqr = AOMMAX(xqr, x_start + x_step + epsilon);
  ------------------
  |  |   35|  18.4E|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.77M, False: 18.4E]
  |  |  ------------------
  ------------------
 1081|  2.76M|  xqr = AOMMIN(xqr, x_end - x_step - epsilon);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.77M, False: 18.4E]
  |  |  ------------------
  ------------------
 1082|  2.76M|  const double x = (xqr - x_start) / x_step;
 1083|  2.76M|  const int xi = (int)floor(x);
 1084|  2.76M|  const double xo = x - xi;
 1085|       |
 1086|  2.76M|  assert(xi > 0);
 1087|       |
 1088|  2.76M|  const double *prate = &interp_rgrid_curv[rcat][(xi - 1)];
 1089|  2.76M|  const double *pdist = &interp_dgrid_curv[dcat][(xi - 1)];
 1090|  2.76M|  av1_interp_cubic_rate_dist(prate, pdist, xo, rate_dist_f);
  ------------------
  |  |  529|  2.76M|#define av1_interp_cubic_rate_dist av1_interp_cubic_rate_dist_sse2
  ------------------
 1091|  2.76M|}
av1_get_entropy_contexts:
 1109|  69.9M|                              ENTROPY_CONTEXT t_left[MAX_MIB_SIZE]) {
 1110|       |  assert(plane_bsize < BLOCK_SIZES_ALL);
 1111|  69.9M|  get_entropy_contexts_plane(plane_bsize, pd, t_above, t_left);
 1112|  69.9M|}
av1_mv_pred:
 1155|  1.97M|                 int ref_y_stride, int ref_frame, BLOCK_SIZE block_size) {
 1156|  1.97M|  const MV_REFERENCE_FRAME ref_frames[2] = { ref_frame, NONE_FRAME };
 1157|  1.97M|  const int_mv ref_mv =
 1158|  1.97M|      av1_get_ref_mv_from_stack(0, ref_frames, 0, &x->mbmi_ext);
 1159|  1.97M|  const int_mv ref_mv1 =
 1160|  1.97M|      av1_get_ref_mv_from_stack(0, ref_frames, 1, &x->mbmi_ext);
 1161|  1.97M|  MV pred_mv[MAX_MV_REF_CANDIDATES + 1];
 1162|  1.97M|  int num_mv_refs = 0;
 1163|  1.97M|  pred_mv[num_mv_refs++] = ref_mv.as_mv;
 1164|  1.97M|  if (ref_mv.as_int != ref_mv1.as_int) {
  ------------------
  |  Branch (1164:7): [True: 387k, False: 1.59M]
  ------------------
 1165|   387k|    pred_mv[num_mv_refs++] = ref_mv1.as_mv;
 1166|   387k|  }
 1167|       |
 1168|  1.97M|  assert(num_mv_refs <= (int)(sizeof(pred_mv) / sizeof(pred_mv[0])));
 1169|       |
 1170|  1.97M|  const uint8_t *const src_y_ptr = x->plane[0].src.buf;
 1171|  1.97M|  int zero_seen = 0;
 1172|  1.97M|  int best_sad = INT_MAX;
 1173|  1.97M|  int max_mv = 0;
 1174|       |  // Get the sad for each candidate reference mv.
 1175|  4.34M|  for (int i = 0; i < num_mv_refs; ++i) {
  ------------------
  |  Branch (1175:19): [True: 2.36M, False: 1.97M]
  ------------------
 1176|  2.36M|    MV *this_mv = &pred_mv[i];
 1177|  2.36M|    enc_clamp_mv(&cpi->common, &x->e_mbd, this_mv);
 1178|       |
 1179|  2.36M|    const int fp_row = (this_mv->row + 3 + (this_mv->row >= 0)) >> 3;
 1180|  2.36M|    const int fp_col = (this_mv->col + 3 + (this_mv->col >= 0)) >> 3;
 1181|  2.36M|    max_mv = AOMMAX(max_mv, AOMMAX(abs(this_mv->row), abs(this_mv->col)) >> 3);
  ------------------
  |  |   35|  4.73M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 254k, False: 2.11M]
  |  |  |  Branch (35:31): [True: 272k, False: 2.09M]
  |  |  |  Branch (35:44): [True: 233k, False: 1.87M]
  |  |  ------------------
  ------------------
 1182|       |
 1183|  2.36M|    if (fp_row == 0 && fp_col == 0 && zero_seen) continue;
  ------------------
  |  Branch (1183:9): [True: 1.86M, False: 498k]
  |  Branch (1183:24): [True: 1.80M, False: 59.3k]
  |  Branch (1183:39): [True: 4.04k, False: 1.80M]
  ------------------
 1184|  2.36M|    zero_seen |= (fp_row == 0 && fp_col == 0);
  ------------------
  |  Branch (1184:19): [True: 1.86M, False: 498k]
  |  Branch (1184:34): [True: 1.80M, False: 59.3k]
  ------------------
 1185|       |
 1186|  2.36M|    const uint8_t *const ref_y_ptr =
 1187|  2.36M|        &ref_y_buffer[ref_y_stride * fp_row + fp_col];
 1188|       |    // Find sad for current vector.
 1189|  2.36M|    const int this_sad = cpi->ppi->fn_ptr[block_size].sdf(
 1190|  2.36M|        src_y_ptr, x->plane[0].src.stride, ref_y_ptr, ref_y_stride);
 1191|       |    // Note if it is the best so far.
 1192|  2.36M|    if (this_sad < best_sad) {
  ------------------
  |  Branch (1192:9): [True: 2.16M, False: 196k]
  ------------------
 1193|  2.16M|      best_sad = this_sad;
 1194|  2.16M|    }
 1195|  2.36M|    if (i == 0)
  ------------------
  |  Branch (1195:9): [True: 1.97M, False: 382k]
  ------------------
 1196|  1.97M|      x->pred_mv0_sad[ref_frame] = this_sad;
 1197|   382k|    else if (i == 1)
  ------------------
  |  Branch (1197:14): [True: 383k, False: 18.4E]
  ------------------
 1198|   383k|      x->pred_mv1_sad[ref_frame] = this_sad;
 1199|  2.36M|  }
 1200|       |
 1201|       |  // Note the index of the mv that worked best in the reference list.
 1202|  1.97M|  x->max_mv_context[ref_frame] = max_mv;
 1203|  1.97M|  x->pred_mv_sad[ref_frame] = best_sad;
 1204|  1.97M|}
av1_setup_pred_block:
 1211|  4.27M|                          const int num_planes) {
 1212|  4.27M|  dst[0].buf = src->y_buffer;
 1213|  4.27M|  dst[0].stride = src->y_stride;
 1214|  4.27M|  dst[1].buf = src->u_buffer;
 1215|  4.27M|  dst[2].buf = src->v_buffer;
 1216|  4.27M|  dst[1].stride = dst[2].stride = src->uv_stride;
 1217|       |
 1218|  4.27M|  const int mi_row = xd->mi_row;
 1219|  4.27M|  const int mi_col = xd->mi_col;
 1220|  12.6M|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (1220:19): [True: 8.32M, False: 4.27M]
  ------------------
 1221|  8.32M|    setup_pred_plane(dst + i, xd->mi[0]->bsize, dst[i].buf,
 1222|  8.32M|                     i ? src->uv_crop_width : src->y_crop_width,
  ------------------
  |  Branch (1222:22): [True: 4.05M, False: 4.27M]
  ------------------
 1223|  8.32M|                     i ? src->uv_crop_height : src->y_crop_height,
  ------------------
  |  Branch (1223:22): [True: 4.05M, False: 4.27M]
  ------------------
 1224|  8.32M|                     dst[i].stride, mi_row, mi_col, i ? scale_uv : scale,
  ------------------
  |  Branch (1224:53): [True: 4.05M, False: 4.27M]
  ------------------
 1225|  8.32M|                     xd->plane[i].subsampling_x, xd->plane[i].subsampling_y);
 1226|  8.32M|  }
 1227|  4.27M|}
av1_get_scaled_ref_frame:
 1230|  8.26M|                                             int ref_frame) {
 1231|  8.26M|  assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
 1232|  8.26M|  RefCntBuffer *const scaled_buf = cpi->scaled_ref_buf[ref_frame - 1];
 1233|  8.26M|  const RefCntBuffer *const ref_buf =
 1234|  8.26M|      get_ref_frame_buf(&cpi->common, ref_frame);
 1235|  8.26M|  return (scaled_buf != ref_buf && scaled_buf != NULL) ? &scaled_buf->buf
  ------------------
  |  Branch (1235:11): [True: 7.34M, False: 924k]
  |  Branch (1235:36): [True: 7.34M, False: 18.4E]
  ------------------
 1236|       |                                                       : NULL;
 1237|  8.26M|}
av1_get_switchable_rate:
 1240|  11.6M|                            InterpFilter interp_filter, int dual_filter) {
 1241|  11.6M|  if (interp_filter == SWITCHABLE) {
  ------------------
  |  Branch (1241:7): [True: 11.6M, False: 114]
  ------------------
 1242|  11.6M|    const MB_MODE_INFO *const mbmi = xd->mi[0];
 1243|  11.6M|    int inter_filter_cost = 0;
 1244|  23.3M|    for (int dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (1244:23): [True: 23.3M, False: 18.4E]
  ------------------
 1245|  23.3M|      if (dir && !dual_filter) break;
  ------------------
  |  Branch (1245:11): [True: 11.6M, False: 11.6M]
  |  Branch (1245:18): [True: 11.6M, False: 0]
  ------------------
 1246|  11.6M|      const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
 1247|  11.6M|      const InterpFilter filter =
 1248|  11.6M|          av1_extract_interp_filter(mbmi->interp_filters, dir);
 1249|  11.6M|      inter_filter_cost += x->mode_costs.switchable_interp_costs[ctx][filter];
 1250|  11.6M|    }
 1251|  11.6M|    return SWITCHABLE_INTERP_RATE_FACTOR * inter_filter_cost;
  ------------------
  |  |   58|  11.6M|#define SWITCHABLE_INTERP_RATE_FACTOR 1
  ------------------
 1252|  11.6M|  } else {
 1253|    114|    return 0;
 1254|    114|  }
 1255|  11.6M|}
av1_set_rd_speed_thresholds:
 1257|  73.6k|void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
 1258|  73.6k|  RD_OPT *const rd = &cpi->rd;
 1259|       |
 1260|       |  // Set baseline threshold values.
 1261|  73.6k|  av1_zero(rd->thresh_mult);
  ------------------
  |  |   43|  73.6k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1262|       |
 1263|  73.6k|  rd->thresh_mult[THR_NEARESTMV] = 300;
 1264|  73.6k|  rd->thresh_mult[THR_NEARESTL2] = 300;
 1265|  73.6k|  rd->thresh_mult[THR_NEARESTL3] = 300;
 1266|  73.6k|  rd->thresh_mult[THR_NEARESTB] = 300;
 1267|  73.6k|  rd->thresh_mult[THR_NEARESTA2] = 300;
 1268|  73.6k|  rd->thresh_mult[THR_NEARESTA] = 300;
 1269|  73.6k|  rd->thresh_mult[THR_NEARESTG] = 300;
 1270|       |
 1271|  73.6k|  rd->thresh_mult[THR_NEWMV] = 1000;
 1272|  73.6k|  rd->thresh_mult[THR_NEWL2] = 1000;
 1273|  73.6k|  rd->thresh_mult[THR_NEWL3] = 1000;
 1274|  73.6k|  rd->thresh_mult[THR_NEWB] = 1000;
 1275|  73.6k|  rd->thresh_mult[THR_NEWA2] = 1100;
 1276|  73.6k|  rd->thresh_mult[THR_NEWA] = 1000;
 1277|  73.6k|  rd->thresh_mult[THR_NEWG] = 1000;
 1278|       |
 1279|  73.6k|  rd->thresh_mult[THR_NEARMV] = 1000;
 1280|  73.6k|  rd->thresh_mult[THR_NEARL2] = 1000;
 1281|  73.6k|  rd->thresh_mult[THR_NEARL3] = 1000;
 1282|  73.6k|  rd->thresh_mult[THR_NEARB] = 1000;
 1283|  73.6k|  rd->thresh_mult[THR_NEARA2] = 1000;
 1284|  73.6k|  rd->thresh_mult[THR_NEARA] = 1000;
 1285|  73.6k|  rd->thresh_mult[THR_NEARG] = 1000;
 1286|       |
 1287|  73.6k|  rd->thresh_mult[THR_GLOBALMV] = 2200;
 1288|  73.6k|  rd->thresh_mult[THR_GLOBALL2] = 2000;
 1289|  73.6k|  rd->thresh_mult[THR_GLOBALL3] = 2000;
 1290|  73.6k|  rd->thresh_mult[THR_GLOBALB] = 2400;
 1291|  73.6k|  rd->thresh_mult[THR_GLOBALA2] = 2000;
 1292|  73.6k|  rd->thresh_mult[THR_GLOBALG] = 2000;
 1293|  73.6k|  rd->thresh_mult[THR_GLOBALA] = 2400;
 1294|       |
 1295|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLA] = 1100;
 1296|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL2A] = 1000;
 1297|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL3A] = 800;
 1298|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTGA] = 900;
 1299|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLB] = 1000;
 1300|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL2B] = 1000;
 1301|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL3B] = 1000;
 1302|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTGB] = 1000;
 1303|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLA2] = 1000;
 1304|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL2A2] = 1000;
 1305|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTL3A2] = 1000;
 1306|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTGA2] = 1000;
 1307|       |
 1308|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLL2] = 2000;
 1309|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLL3] = 2000;
 1310|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTLG] = 2000;
 1311|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEARESTBA] = 2000;
 1312|       |
 1313|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLA] = 1200;
 1314|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLA] = 1500;
 1315|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLA] = 1500;
 1316|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLA] = 1530;
 1317|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLA] = 1870;
 1318|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLA] = 2400;
 1319|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLA] = 2750;
 1320|       |
 1321|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL2A] = 1200;
 1322|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL2A] = 1500;
 1323|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL2A] = 1500;
 1324|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL2A] = 1870;
 1325|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL2A] = 1700;
 1326|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL2A] = 1800;
 1327|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2A] = 2500;
 1328|       |
 1329|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL3A] = 1200;
 1330|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL3A] = 1500;
 1331|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL3A] = 1500;
 1332|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL3A] = 1700;
 1333|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL3A] = 1700;
 1334|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL3A] = 2000;
 1335|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3A] = 3000;
 1336|       |
 1337|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARGA] = 1320;
 1338|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWGA] = 1500;
 1339|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTGA] = 1500;
 1340|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWGA] = 2040;
 1341|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARGA] = 1700;
 1342|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWGA] = 2000;
 1343|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGA] = 2250;
 1344|       |
 1345|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLB] = 1200;
 1346|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLB] = 1500;
 1347|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLB] = 1500;
 1348|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLB] = 1360;
 1349|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLB] = 1700;
 1350|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLB] = 2400;
 1351|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLB] = 2250;
 1352|       |
 1353|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL2B] = 1200;
 1354|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL2B] = 1500;
 1355|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL2B] = 1500;
 1356|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL2B] = 1700;
 1357|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL2B] = 1700;
 1358|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL2B] = 2000;
 1359|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2B] = 2500;
 1360|       |
 1361|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL3B] = 1200;
 1362|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL3B] = 1500;
 1363|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL3B] = 1500;
 1364|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL3B] = 1870;
 1365|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL3B] = 1700;
 1366|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL3B] = 2000;
 1367|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3B] = 2500;
 1368|       |
 1369|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARGB] = 1200;
 1370|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWGB] = 1500;
 1371|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTGB] = 1500;
 1372|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWGB] = 1700;
 1373|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARGB] = 1700;
 1374|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWGB] = 2000;
 1375|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGB] = 2500;
 1376|       |
 1377|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLA2] = 1200;
 1378|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLA2] = 1800;
 1379|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLA2] = 1500;
 1380|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLA2] = 1700;
 1381|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLA2] = 1700;
 1382|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLA2] = 2000;
 1383|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLA2] = 2500;
 1384|       |
 1385|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL2A2] = 1200;
 1386|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL2A2] = 1500;
 1387|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL2A2] = 1500;
 1388|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL2A2] = 1700;
 1389|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL2A2] = 1700;
 1390|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL2A2] = 2000;
 1391|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2A2] = 2500;
 1392|       |
 1393|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARL3A2] = 1440;
 1394|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWL3A2] = 1500;
 1395|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTL3A2] = 1500;
 1396|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWL3A2] = 1700;
 1397|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARL3A2] = 1700;
 1398|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWL3A2] = 2000;
 1399|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3A2] = 2500;
 1400|       |
 1401|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARGA2] = 1200;
 1402|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWGA2] = 1500;
 1403|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTGA2] = 1500;
 1404|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWGA2] = 1700;
 1405|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARGA2] = 1700;
 1406|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWGA2] = 2000;
 1407|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGA2] = 2750;
 1408|       |
 1409|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLL2] = 1600;
 1410|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLL2] = 2000;
 1411|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLL2] = 2000;
 1412|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLL2] = 2640;
 1413|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLL2] = 2200;
 1414|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLL2] = 2400;
 1415|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLL2] = 3200;
 1416|       |
 1417|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLL3] = 1600;
 1418|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLL3] = 2000;
 1419|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLL3] = 1800;
 1420|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLL3] = 2200;
 1421|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLL3] = 2200;
 1422|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLL3] = 2400;
 1423|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLL3] = 3200;
 1424|       |
 1425|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARLG] = 1760;
 1426|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWLG] = 2400;
 1427|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTLG] = 2000;
 1428|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWLG] = 1760;
 1429|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARLG] = 2640;
 1430|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWLG] = 2400;
 1431|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLG] = 3200;
 1432|       |
 1433|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEARBA] = 1600;
 1434|  73.6k|  rd->thresh_mult[THR_COMP_NEAREST_NEWBA] = 2000;
 1435|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARESTBA] = 2000;
 1436|  73.6k|  rd->thresh_mult[THR_COMP_NEAR_NEWBA] = 2200;
 1437|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEARBA] = 1980;
 1438|  73.6k|  rd->thresh_mult[THR_COMP_NEW_NEWBA] = 2640;
 1439|  73.6k|  rd->thresh_mult[THR_COMP_GLOBAL_GLOBALBA] = 3200;
 1440|       |
 1441|  73.6k|  rd->thresh_mult[THR_DC] = 1000;
 1442|  73.6k|  rd->thresh_mult[THR_PAETH] = 1000;
 1443|  73.6k|  rd->thresh_mult[THR_SMOOTH] = 2200;
 1444|  73.6k|  rd->thresh_mult[THR_SMOOTH_V] = 2000;
 1445|  73.6k|  rd->thresh_mult[THR_SMOOTH_H] = 2000;
 1446|  73.6k|  rd->thresh_mult[THR_H_PRED] = 2000;
 1447|  73.6k|  rd->thresh_mult[THR_V_PRED] = 1800;
 1448|  73.6k|  rd->thresh_mult[THR_D135_PRED] = 2500;
 1449|  73.6k|  rd->thresh_mult[THR_D203_PRED] = 2000;
 1450|  73.6k|  rd->thresh_mult[THR_D157_PRED] = 2500;
 1451|  73.6k|  rd->thresh_mult[THR_D67_PRED] = 2000;
 1452|  73.6k|  rd->thresh_mult[THR_D113_PRED] = 2500;
 1453|  73.6k|  rd->thresh_mult[THR_D45_PRED] = 2500;
 1454|  73.6k|}
av1_update_rd_thresh_fact:
 1477|  1.76M|    THR_MODES intra_mode_start, THR_MODES intra_mode_end) {
 1478|  1.76M|  assert(use_adaptive_rd_thresh > 0);
 1479|  1.76M|  const int max_rd_thresh_factor = use_adaptive_rd_thresh * RD_THRESH_MAX_FACT;
  ------------------
  |  |   53|  1.76M|#define RD_THRESH_MAX_FACT ((RD_THRESH_FAC_FRAC_VAL) << 1)
  |  |  ------------------
  |  |  |  |   52|  1.76M|#define RD_THRESH_FAC_FRAC_VAL (1 << (RD_THRESH_FAC_FRAC_BITS))
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  1.76M|#define RD_THRESH_FAC_FRAC_BITS (5)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1480|       |
 1481|  1.76M|  const int bsize_is_1_to_4 = bsize > cm->seq_params->sb_size;
 1482|  1.76M|  BLOCK_SIZE min_size, max_size;
 1483|  1.76M|  if (bsize_is_1_to_4) {
  ------------------
  |  Branch (1483:7): [True: 0, False: 1.76M]
  ------------------
 1484|       |    // This part handles block sizes with 1:4 and 4:1 aspect ratios
 1485|       |    // TODO(any): Experiment with threshold update for parent/child blocks
 1486|      0|    min_size = bsize;
 1487|      0|    max_size = bsize;
 1488|  1.76M|  } else {
 1489|  1.76M|    min_size = AOMMAX(bsize - 2, BLOCK_4X4);
  ------------------
  |  |   35|  1.76M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 1.48M, False: 281k]
  |  |  ------------------
  ------------------
 1490|  1.76M|    max_size = AOMMIN(bsize + 2, (int)cm->seq_params->sb_size);
  ------------------
  |  |   34|  1.76M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.76M, False: 7.24k]
  |  |  ------------------
  ------------------
 1491|  1.76M|  }
 1492|       |
 1493|  1.76M|  update_thr_fact(factor_buf, best_mode_index, inter_mode_start, inter_mode_end,
 1494|  1.76M|                  min_size, max_size, max_rd_thresh_factor);
 1495|  1.76M|  update_thr_fact(factor_buf, best_mode_index, intra_mode_start, intra_mode_end,
 1496|  1.76M|                  min_size, max_size, max_rd_thresh_factor);
 1497|  1.76M|}
av1_get_intra_cost_penalty:
 1500|   597k|                               aom_bit_depth_t bit_depth) {
 1501|   597k|  const int q = av1_dc_quant_QTX(qindex, qdelta, bit_depth);
 1502|   597k|  switch (bit_depth) {
 1503|   563k|    case AOM_BITS_8: return 20 * q;
  ------------------
  |  Branch (1503:5): [True: 563k, False: 34.2k]
  ------------------
 1504|  15.1k|    case AOM_BITS_10: return 5 * q;
  ------------------
  |  Branch (1504:5): [True: 15.1k, False: 582k]
  ------------------
 1505|  19.0k|    case AOM_BITS_12: return ROUND_POWER_OF_TWO(5 * q, 2);
  ------------------
  |  |   41|  19.0k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  |  Branch (1505:5): [True: 19.0k, False: 578k]
  ------------------
 1506|      0|    default:
  ------------------
  |  Branch (1506:5): [True: 0, False: 597k]
  ------------------
 1507|       |      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
 1508|      0|      return -1;
 1509|   597k|  }
 1510|   597k|}
rd.c:init_me_luts:
  353|      1|static void init_me_luts(void) {
  354|      1|  init_me_luts_bd(sad_per_bit_lut_8, QINDEX_RANGE, AOM_BITS_8);
  ------------------
  |  |   27|      1|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|      1|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|      1|#define MINQ 0
  |  |  ------------------
  ------------------
  355|      1|  init_me_luts_bd(sad_per_bit_lut_10, QINDEX_RANGE, AOM_BITS_10);
  ------------------
  |  |   27|      1|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|      1|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|      1|#define MINQ 0
  |  |  ------------------
  ------------------
  356|      1|  init_me_luts_bd(sad_per_bit_lut_12, QINDEX_RANGE, AOM_BITS_12);
  ------------------
  |  |   27|      1|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|      1|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|      1|#define MINQ 0
  |  |  ------------------
  ------------------
  357|      1|}
rd.c:init_me_luts_bd:
  342|      3|                            aom_bit_depth_t bit_depth) {
  343|      3|  int i;
  344|       |  // Initialize the sad lut tables using a formulaic calculation for now.
  345|       |  // This is to make it easier to resolve the impact of experimental changes
  346|       |  // to the quantizer tables.
  347|    771|  for (i = 0; i < range; i++) {
  ------------------
  |  Branch (347:15): [True: 768, False: 3]
  ------------------
  348|    768|    const double q = av1_convert_qindex_to_q(i, bit_depth);
  349|    768|    bit16lut[i] = (int)(0.0418 * q + 2.4107);
  350|    768|  }
  351|      3|}
rd.c:def_kf_rd_multiplier:
  385|   882k|static double def_kf_rd_multiplier(int qindex) {
  386|   882k|  return 3.3 + (0.0015 * (double)qindex);
  387|   882k|}
rd.c:def_arf_rd_multiplier:
  378|  30.3k|static double def_arf_rd_multiplier(int qindex) {
  379|  30.3k|  return 3.25 + (0.0015 * (double)qindex);
  380|  30.3k|}
rd.c:def_inter_rd_multiplier:
  371|  6.70M|static double def_inter_rd_multiplier(int qindex) {
  372|  6.70M|  return 3.2 + (0.0015 * (double)qindex);
  373|  6.70M|}
rd.c:set_block_thresholds:
  558|  73.6k|                                 int use_nonrd_pick_mode) {
  559|  73.6k|  int i, bsize, segment_id;
  560|  73.6k|  THR_MODES mode_indices[RTC_REFS * RTC_MODES] = { 0 };
  561|  73.6k|  int num_modes_count = use_nonrd_pick_mode ? 0 : MAX_MODES;
  ------------------
  |  Branch (561:25): [True: 24.4k, False: 49.2k]
  ------------------
  562|       |
  563|  73.6k|  if (use_nonrd_pick_mode) {
  ------------------
  |  Branch (563:7): [True: 24.4k, False: 49.2k]
  ------------------
  564|   122k|    for (int r_idx = 0; r_idx < RTC_REFS; r_idx++) {
  ------------------
  |  |   70|   122k|#define RTC_REFS 4
  ------------------
  |  Branch (564:25): [True: 97.6k, False: 24.4k]
  ------------------
  565|  97.6k|      const MV_REFERENCE_FRAME ref = real_time_ref_combos[r_idx][0];
  566|  97.6k|      if (ref != INTRA_FRAME) {
  ------------------
  |  Branch (566:11): [True: 73.2k, False: 24.4k]
  ------------------
  567|   366k|        for (i = 0; i < RTC_INTER_MODES; i++)
  ------------------
  |  |   19|   366k|#define RTC_INTER_MODES (4)
  ------------------
  |  Branch (567:21): [True: 292k, False: 73.2k]
  ------------------
  568|   292k|          mode_indices[num_modes_count++] =
  569|   292k|              mode_idx[ref][mode_offset(inter_mode_list[i])];
  570|  73.2k|      } else {
  571|   122k|        for (i = 0; i < RTC_INTRA_MODES; i++)
  ------------------
  |  |   20|   122k|#define RTC_INTRA_MODES (4)
  ------------------
  |  Branch (571:21): [True: 97.6k, False: 24.4k]
  ------------------
  572|  97.6k|          mode_indices[num_modes_count++] =
  573|  97.6k|              mode_idx[ref][mode_offset(intra_mode_list[i])];
  574|  24.4k|      }
  575|  97.6k|    }
  576|  24.4k|  }
  577|       |
  578|   662k|  for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) {
  ------------------
  |  |   23|   662k|#define MAX_SEGMENTS 8
  ------------------
  |  Branch (578:24): [True: 588k, False: 73.6k]
  ------------------
  579|   588k|    const int qindex = clamp(
  580|   588k|        av1_get_qindex(&cm->seg, segment_id, cm->quant_params.base_qindex) +
  581|   588k|            cm->quant_params.y_dc_delta_q,
  582|   588k|        0, MAXQ);
  ------------------
  |  |   26|   588k|#define MAXQ 255
  ------------------
  583|   588k|    const int q = compute_rd_thresh_factor(qindex, cm->seq_params->bit_depth);
  584|       |
  585|  13.5M|    for (bsize = 0; bsize < BLOCK_SIZES_ALL; ++bsize) {
  ------------------
  |  Branch (585:21): [True: 12.9M, False: 588k]
  ------------------
  586|       |      // Threshold here seems unnecessarily harsh but fine given actual
  587|       |      // range of values used for cpi->sf.thresh_mult[].
  588|  12.9M|      const int t = q * rd_thresh_block_size_factor[bsize];
  589|  12.9M|      const int thresh_max = INT_MAX / t;
  590|       |
  591|  1.54G|      for (i = 0; i < num_modes_count; ++i) {
  ------------------
  |  Branch (591:19): [True: 1.53G, False: 12.9M]
  ------------------
  592|  1.53G|        const int mode_index = use_nonrd_pick_mode ? mode_indices[i] : i;
  ------------------
  |  Branch (592:32): [True: 68.7M, False: 1.46G]
  ------------------
  593|  1.53G|        rd->threshes[segment_id][bsize][mode_index] =
  594|  1.53G|            rd->thresh_mult[mode_index] < thresh_max
  ------------------
  |  Branch (594:13): [True: 1.53G, False: 0]
  ------------------
  595|  1.53G|                ? rd->thresh_mult[mode_index] * t / 4
  596|       |                : INT_MAX;
  597|  1.53G|      }
  598|  12.9M|    }
  599|   588k|  }
  600|  73.6k|}
rd.c:compute_rd_thresh_factor:
  529|   588k|static int compute_rd_thresh_factor(int qindex, aom_bit_depth_t bit_depth) {
  530|   588k|  double q;
  531|   588k|  switch (bit_depth) {
  532|   425k|    case AOM_BITS_8: q = av1_dc_quant_QTX(qindex, 0, AOM_BITS_8) / 4.0; break;
  ------------------
  |  Branch (532:5): [True: 425k, False: 163k]
  ------------------
  533|  78.5k|    case AOM_BITS_10:
  ------------------
  |  Branch (533:5): [True: 78.5k, False: 510k]
  ------------------
  534|  78.5k|      q = av1_dc_quant_QTX(qindex, 0, AOM_BITS_10) / 16.0;
  535|  78.5k|      break;
  536|  85.3k|    case AOM_BITS_12:
  ------------------
  |  Branch (536:5): [True: 85.3k, False: 503k]
  ------------------
  537|  85.3k|      q = av1_dc_quant_QTX(qindex, 0, AOM_BITS_12) / 64.0;
  538|  85.3k|      break;
  539|      0|    default:
  ------------------
  |  Branch (539:5): [True: 0, False: 588k]
  ------------------
  540|      0|      assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
  541|      0|      return -1;
  542|   588k|  }
  543|       |  // TODO(debargha): Adjust the function below.
  544|   588k|  return AOMMAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8);
  ------------------
  |  |   35|   588k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 554k, False: 34.2k]
  |  |  ------------------
  ------------------
  545|   588k|}
rd.c:populate_unified_cost_update_freq:
  724|  73.6k|    const CostUpdateFreq cost_upd_freq, SPEED_FEATURES *const sf) {
  725|  73.6k|  INTER_MODE_SPEED_FEATURES *const inter_sf = &sf->inter_sf;
  726|       |  // Mapping of entropy cost update frequency from the encoder's codec control
  727|       |  // settings of type COST_UPDATE_TYPE to speed features of type
  728|       |  // INTERNAL_COST_UPDATE_TYPE.
  729|  73.6k|  static const INTERNAL_COST_UPDATE_TYPE
  730|  73.6k|      map_cost_upd_to_internal_cost_upd[NUM_COST_UPDATE_TYPES] = {
  731|  73.6k|        INTERNAL_COST_UPD_SB, INTERNAL_COST_UPD_SBROW, INTERNAL_COST_UPD_TILE,
  732|  73.6k|        INTERNAL_COST_UPD_OFF
  733|  73.6k|      };
  734|       |
  735|  73.6k|  inter_sf->mv_cost_upd_level =
  736|  73.6k|      AOMMIN(inter_sf->mv_cost_upd_level,
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 73.6k, False: 0]
  |  |  ------------------
  ------------------
  737|  73.6k|             map_cost_upd_to_internal_cost_upd[cost_upd_freq.mv]);
  738|  73.6k|  inter_sf->coeff_cost_upd_level =
  739|  73.6k|      AOMMIN(inter_sf->coeff_cost_upd_level,
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 49.2k, False: 24.4k]
  |  |  ------------------
  ------------------
  740|  73.6k|             map_cost_upd_to_internal_cost_upd[cost_upd_freq.coeff]);
  741|  73.6k|  inter_sf->mode_cost_upd_level =
  742|  73.6k|      AOMMIN(inter_sf->mode_cost_upd_level,
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 49.2k, False: 24.4k]
  |  |  ------------------
  ------------------
  743|  73.6k|             map_cost_upd_to_internal_cost_upd[cost_upd_freq.mode]);
  744|  73.6k|  sf->intra_sf.dv_cost_upd_level =
  745|  73.6k|      AOMMIN(sf->intra_sf.dv_cost_upd_level,
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 24.4k, False: 49.2k]
  |  |  ------------------
  ------------------
  746|  73.6k|             map_cost_upd_to_internal_cost_upd[cost_upd_freq.dv]);
  747|  73.6k|}
rd.c:is_frame_level_cost_upd_freq_set:
  752|   211k|    const int use_nonrd_pick_mode, const int frames_since_key) {
  753|   211k|  const int fill_costs =
  754|   211k|      frame_is_intra_only(cm) ||
  ------------------
  |  Branch (754:7): [True: 52.9k, False: 158k]
  ------------------
  755|   158k|      (use_nonrd_pick_mode ? frames_since_key < 2
  ------------------
  |  Branch (755:7): [True: 52.9k, False: 105k]
  |  Branch (755:8): [True: 48.1k, False: 110k]
  ------------------
  756|   158k|                           : (cm->current_frame.frame_number & 0x07) == 1);
  757|   211k|  return ((!use_nonrd_pick_mode && cost_upd_level != INTERNAL_COST_UPD_OFF) ||
  ------------------
  |  Branch (757:12): [True: 147k, False: 64.1k]
  |  Branch (757:36): [True: 147k, False: 0]
  ------------------
  758|  64.1k|          cost_upd_level == INTERNAL_COST_UPD_TILE || fill_costs);
  ------------------
  |  Branch (758:11): [True: 0, False: 64.1k]
  |  Branch (758:55): [True: 32.0k, False: 32.0k]
  ------------------
  759|   211k|}
rd.c:should_force_mode_cost_update:
  763|  73.6k|static inline int should_force_mode_cost_update(const AV1_COMP *cpi) {
  764|  73.6k|  const REAL_TIME_SPEED_FEATURES *const rt_sf = &cpi->sf.rt_sf;
  765|  73.6k|  if (!rt_sf->frame_level_mode_cost_update) {
  ------------------
  |  Branch (765:7): [True: 64.6k, False: 9.01k]
  ------------------
  766|  64.6k|    return false;
  767|  64.6k|  }
  768|       |
  769|  9.01k|  if (cpi->oxcf.algo_cfg.cdf_update_mode == 2) {
  ------------------
  |  Branch (769:7): [True: 0, False: 9.01k]
  ------------------
  770|      0|    return cpi->frames_since_last_update == 1;
  771|  9.01k|  } else if (cpi->oxcf.algo_cfg.cdf_update_mode == 1) {
  ------------------
  |  Branch (771:14): [True: 9.01k, False: 0]
  ------------------
  772|  9.01k|    if (cpi->svc.number_spatial_layers == 1 &&
  ------------------
  |  Branch (772:9): [True: 9.01k, False: 0]
  ------------------
  773|  9.01k|        cpi->svc.number_temporal_layers == 1) {
  ------------------
  |  Branch (773:9): [True: 9.01k, False: 0]
  ------------------
  774|  9.01k|      const AV1_COMMON *const cm = &cpi->common;
  775|  9.01k|      const RATE_CONTROL *const rc = &cpi->rc;
  776|       |
  777|  9.01k|      return frame_is_intra_only(cm) || is_frame_resize_pending(cpi) ||
  ------------------
  |  Branch (777:14): [True: 2.25k, False: 6.76k]
  |  Branch (777:41): [True: 0, False: 6.76k]
  ------------------
  778|  6.76k|             rc->high_source_sad || rc->frames_since_key < 10 ||
  ------------------
  |  Branch (778:14): [True: 0, False: 6.76k]
  |  Branch (778:37): [True: 6.76k, False: 0]
  ------------------
  779|      0|             cpi->cyclic_refresh->counter_encode_maxq_scene_change < 10 ||
  ------------------
  |  Branch (779:14): [True: 0, False: 0]
  ------------------
  780|      0|             cm->current_frame.frame_number % 8 == 0;
  ------------------
  |  Branch (780:14): [True: 0, False: 0]
  ------------------
  781|  9.01k|    } else if (cpi->svc.number_temporal_layers > 1) {
  ------------------
  |  Branch (781:16): [True: 0, False: 0]
  ------------------
  782|      0|      return cpi->svc.temporal_layer_id != cpi->svc.number_temporal_layers - 1;
  783|      0|    }
  784|  9.01k|  }
  785|       |
  786|      0|  return false;
  787|  9.01k|}
rd.c:model_rd_norm:
  855|  4.49M|static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) {
  856|       |  // NOTE: The tables below must be of the same size.
  857|       |
  858|       |  // The functions described below are sampled at the four most significant
  859|       |  // bits of x^2 + 8 / 256.
  860|       |
  861|       |  // Normalized rate:
  862|       |  // This table models the rate for a Laplacian source with given variance
  863|       |  // when quantized with a uniform quantizer with given stepsize. The
  864|       |  // closed form expression is:
  865|       |  // Rn(x) = H(sqrt(r)) + sqrt(r)*[1 + H(r)/(1 - r)],
  866|       |  // where r = exp(-sqrt(2) * x) and x = qpstep / sqrt(variance),
  867|       |  // and H(x) is the binary entropy function.
  868|  4.49M|  static const int rate_tab_q10[] = {
  869|  4.49M|    65536, 6086, 5574, 5275, 5063, 4899, 4764, 4651, 4553, 4389, 4255, 4142,
  870|  4.49M|    4044,  3958, 3881, 3811, 3748, 3635, 3538, 3453, 3376, 3307, 3244, 3186,
  871|  4.49M|    3133,  3037, 2952, 2877, 2809, 2747, 2690, 2638, 2589, 2501, 2423, 2353,
  872|  4.49M|    2290,  2232, 2179, 2130, 2084, 2001, 1928, 1862, 1802, 1748, 1698, 1651,
  873|  4.49M|    1608,  1530, 1460, 1398, 1342, 1290, 1243, 1199, 1159, 1086, 1021, 963,
  874|  4.49M|    911,   864,  821,  781,  745,  680,  623,  574,  530,  490,  455,  424,
  875|  4.49M|    395,   345,  304,  269,  239,  213,  190,  171,  154,  126,  104,  87,
  876|  4.49M|    73,    61,   52,   44,   38,   28,   21,   16,   12,   10,   8,    6,
  877|  4.49M|    5,     3,    2,    1,    1,    1,    0,    0,
  878|  4.49M|  };
  879|       |  // Normalized distortion:
  880|       |  // This table models the normalized distortion for a Laplacian source
  881|       |  // with given variance when quantized with a uniform quantizer
  882|       |  // with given stepsize. The closed form expression is:
  883|       |  // Dn(x) = 1 - 1/sqrt(2) * x / sinh(x/sqrt(2))
  884|       |  // where x = qpstep / sqrt(variance).
  885|       |  // Note the actual distortion is Dn * variance.
  886|  4.49M|  static const int dist_tab_q10[] = {
  887|  4.49M|    0,    0,    1,    1,    1,    2,    2,    2,    3,    3,    4,    5,
  888|  4.49M|    5,    6,    7,    7,    8,    9,    11,   12,   13,   15,   16,   17,
  889|  4.49M|    18,   21,   24,   26,   29,   31,   34,   36,   39,   44,   49,   54,
  890|  4.49M|    59,   64,   69,   73,   78,   88,   97,   106,  115,  124,  133,  142,
  891|  4.49M|    151,  167,  184,  200,  215,  231,  245,  260,  274,  301,  327,  351,
  892|  4.49M|    375,  397,  418,  439,  458,  495,  528,  559,  587,  613,  637,  659,
  893|  4.49M|    680,  717,  749,  777,  801,  823,  842,  859,  874,  899,  919,  936,
  894|  4.49M|    949,  960,  969,  977,  983,  994,  1001, 1006, 1010, 1013, 1015, 1017,
  895|  4.49M|    1018, 1020, 1022, 1022, 1023, 1023, 1023, 1024,
  896|  4.49M|  };
  897|  4.49M|  static const int xsq_iq_q10[] = {
  898|  4.49M|    0,      4,      8,      12,     16,     20,     24,     28,     32,
  899|  4.49M|    40,     48,     56,     64,     72,     80,     88,     96,     112,
  900|  4.49M|    128,    144,    160,    176,    192,    208,    224,    256,    288,
  901|  4.49M|    320,    352,    384,    416,    448,    480,    544,    608,    672,
  902|  4.49M|    736,    800,    864,    928,    992,    1120,   1248,   1376,   1504,
  903|  4.49M|    1632,   1760,   1888,   2016,   2272,   2528,   2784,   3040,   3296,
  904|  4.49M|    3552,   3808,   4064,   4576,   5088,   5600,   6112,   6624,   7136,
  905|  4.49M|    7648,   8160,   9184,   10208,  11232,  12256,  13280,  14304,  15328,
  906|  4.49M|    16352,  18400,  20448,  22496,  24544,  26592,  28640,  30688,  32736,
  907|  4.49M|    36832,  40928,  45024,  49120,  53216,  57312,  61408,  65504,  73696,
  908|  4.49M|    81888,  90080,  98272,  106464, 114656, 122848, 131040, 147424, 163808,
  909|  4.49M|    180192, 196576, 212960, 229344, 245728,
  910|  4.49M|  };
  911|  4.49M|  const int tmp = (xsq_q10 >> 2) + 8;
  912|  4.49M|  const int k = get_msb(tmp) - 3;
  913|  4.49M|  const int xq = (k << 3) + ((tmp >> k) & 0x7);
  914|  4.49M|  const int one_q10 = 1 << 10;
  915|  4.49M|  const int a_q10 = ((xsq_q10 - xsq_iq_q10[xq]) << 10) >> (2 + k);
  916|  4.49M|  const int b_q10 = one_q10 - a_q10;
  917|  4.49M|  *r_q10 = (rate_tab_q10[xq] * b_q10 + rate_tab_q10[xq + 1] * a_q10) >> 10;
  918|  4.49M|  *d_q10 = (dist_tab_q10[xq] * b_q10 + dist_tab_q10[xq + 1] * a_q10) >> 10;
  919|  4.49M|}
rd.c:sse_norm_curvfit_model_cat_lookup:
  974|  2.76M|static int sse_norm_curvfit_model_cat_lookup(double sse_norm) {
  975|  2.76M|  return (sse_norm > 16.0);
  976|  2.76M|}
rd.c:get_entropy_contexts_plane:
 1096|  69.9M|                                       ENTROPY_CONTEXT t_left[MAX_MIB_SIZE]) {
 1097|  69.9M|  const int num_4x4_w = mi_size_wide[plane_bsize];
 1098|  69.9M|  const int num_4x4_h = mi_size_high[plane_bsize];
 1099|  69.9M|  const ENTROPY_CONTEXT *const above = pd->above_entropy_context;
 1100|  69.9M|  const ENTROPY_CONTEXT *const left = pd->left_entropy_context;
 1101|       |
 1102|  69.9M|  memcpy(t_above, above, sizeof(ENTROPY_CONTEXT) * num_4x4_w);
 1103|  69.9M|  memcpy(t_left, left, sizeof(ENTROPY_CONTEXT) * num_4x4_h);
 1104|  69.9M|}
rd.c:enc_clamp_mv:
 1136|  2.36M|                                MV *mv) {
 1137|  2.36M|  int bw = xd->width << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1138|  2.36M|  int bh = xd->height << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1139|       |
 1140|  2.36M|  int px_to_left_edge = xd->mi_col << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1141|  2.36M|  int px_to_right_edge = (cm->mi_params.mi_cols - xd->mi_col) << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1142|  2.36M|  int px_to_top_edge = xd->mi_row << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1143|  2.36M|  int px_to_bottom_edge = (cm->mi_params.mi_rows - xd->mi_row) << MI_SIZE_LOG2;
  ------------------
  |  |   39|  2.36M|#define MI_SIZE_LOG2 2
  ------------------
 1144|       |
 1145|  2.36M|  const SubpelMvLimits mv_limits = {
 1146|  2.36M|    .col_min = -GET_MV_SUBPEL(px_to_left_edge + bw + AOM_INTERP_EXTEND),
  ------------------
  |  |   29|  2.36M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1147|  2.36M|    .col_max = GET_MV_SUBPEL(px_to_right_edge + AOM_INTERP_EXTEND),
  ------------------
  |  |   29|  2.36M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1148|  2.36M|    .row_min = -GET_MV_SUBPEL(px_to_top_edge + bh + AOM_INTERP_EXTEND),
  ------------------
  |  |   29|  2.36M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1149|  2.36M|    .row_max = GET_MV_SUBPEL(px_to_bottom_edge + AOM_INTERP_EXTEND)
  ------------------
  |  |   29|  2.36M|#define GET_MV_SUBPEL(x) ((x) * 8)
  ------------------
 1150|  2.36M|  };
 1151|  2.36M|  clamp_mv(mv, &mv_limits);
 1152|  2.36M|}
rd.c:update_thr_fact:
 1460|  3.53M|                                   int max_rd_thresh_factor) {
 1461|   301M|  for (THR_MODES mode = mode_start; mode < mode_end; ++mode) {
  ------------------
  |  Branch (1461:37): [True: 298M, False: 3.53M]
  ------------------
 1462|  1.70G|    for (BLOCK_SIZE bs = min_size; bs <= max_size; ++bs) {
  ------------------
  |  Branch (1462:36): [True: 1.40G, False: 298M]
  ------------------
 1463|  1.40G|      int *const fact = &factor_buf[bs][mode];
 1464|  1.40G|      if (mode == best_mode_index) {
  ------------------
  |  Branch (1464:11): [True: 8.36M, False: 1.40G]
  ------------------
 1465|  8.36M|        *fact -= (*fact >> RD_THRESH_LOG_DEC_FACTOR);
  ------------------
  |  |   54|  8.36M|#define RD_THRESH_LOG_DEC_FACTOR (4)
  ------------------
 1466|  1.40G|      } else {
 1467|  1.40G|        *fact = AOMMIN(*fact + RD_THRESH_INC, max_rd_thresh_factor);
  ------------------
  |  |   34|  1.40G|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 871M, False: 528M]
  |  |  ------------------
  ------------------
 1468|  1.40G|      }
 1469|  1.40G|    }
 1470|   298M|  }
 1471|  3.53M|}

av1_quantize.c:av1_set_error_per_bit:
  348|   167k|static inline void av1_set_error_per_bit(int *errorperbit, int rdmult) {
  349|   167k|  *errorperbit = AOMMAX(rdmult >> RD_EPB_SHIFT, 1);
  ------------------
  |  |   35|   167k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 161k, False: 5.77k]
  |  |  ------------------
  ------------------
  350|   167k|}
context_tree.c:av1_invalid_rd_stats:
  137|  3.10M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  3.10M|  rd_stats->rate = INT_MAX;
  142|  3.10M|  rd_stats->dist = INT64_MAX;
  143|  3.10M|  rd_stats->rdcost = INT64_MAX;
  144|  3.10M|  rd_stats->sse = INT64_MAX;
  145|  3.10M|  rd_stats->skip_txfm = 0;
  146|  3.10M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  3.10M|}
encodeframe.c:reset_thresh_freq_fact:
  330|   126k|static inline void reset_thresh_freq_fact(MACROBLOCK *const x) {
  331|  2.89M|  for (int i = 0; i < BLOCK_SIZES_ALL; ++i) {
  ------------------
  |  Branch (331:19): [True: 2.76M, False: 126k]
  ------------------
  332|   453M|    for (int j = 0; j < MAX_MODES; ++j) {
  ------------------
  |  Branch (332:21): [True: 450M, False: 2.76M]
  ------------------
  333|   450M|      x->thresh_freq_fact[i][j] = RD_THRESH_FAC_FRAC_VAL;
  ------------------
  |  |   52|   450M|#define RD_THRESH_FAC_FRAC_VAL (1 << (RD_THRESH_FAC_FRAC_BITS))
  |  |  ------------------
  |  |  |  |   51|   450M|#define RD_THRESH_FAC_FRAC_BITS (5)
  |  |  ------------------
  ------------------
  334|   450M|    }
  335|  2.76M|  }
  336|   126k|}
encodeframe.c:reset_mb_rd_record:
  384|  88.2k|static inline void reset_mb_rd_record(MB_RD_RECORD *const mb_rd_record) {
  385|  88.2k|  if (!mb_rd_record) return;
  ------------------
  |  Branch (385:7): [True: 0, False: 88.2k]
  ------------------
  386|       |
  387|       |  // Reset the state for use_mb_rd_hash
  388|  88.2k|  mb_rd_record->num = mb_rd_record->index_start = 0;
  389|  88.2k|}
encodeframe.c:av1_invalid_rd_stats:
  137|  88.0k|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  88.0k|  rd_stats->rate = INT_MAX;
  142|  88.0k|  rd_stats->dist = INT64_MAX;
  143|  88.0k|  rd_stats->rdcost = INT64_MAX;
  144|  88.0k|  rd_stats->sse = INT64_MAX;
  145|  88.0k|  rd_stats->skip_txfm = 0;
  146|  88.0k|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  88.0k|}
encodeframe_utils.c:av1_set_error_per_bit:
  348|  8.26M|static inline void av1_set_error_per_bit(int *errorperbit, int rdmult) {
  349|  8.26M|  *errorperbit = AOMMAX(rdmult >> RD_EPB_SHIFT, 1);
  ------------------
  |  |   35|  8.26M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 8.21M, False: 52.4k]
  |  |  ------------------
  ------------------
  350|  8.26M|}
partition_search.c:av1_invalid_rd_stats:
  137|  8.82M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  8.82M|  rd_stats->rate = INT_MAX;
  142|  8.82M|  rd_stats->dist = INT64_MAX;
  143|  8.82M|  rd_stats->rdcost = INT64_MAX;
  144|  8.82M|  rd_stats->sse = INT64_MAX;
  145|  8.82M|  rd_stats->skip_txfm = 0;
  146|  8.82M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  8.82M|}
partition_search.c:av1_set_error_per_bit:
  348|  2.96M|static inline void av1_set_error_per_bit(int *errorperbit, int rdmult) {
  349|  2.96M|  *errorperbit = AOMMAX(rdmult >> RD_EPB_SHIFT, 1);
  ------------------
  |  |   35|  2.96M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 2.86M, False: 99.5k]
  |  |  ------------------
  ------------------
  350|  2.96M|}
partition_search.c:av1_init_rd_stats:
  118|  5.78M|static inline void av1_init_rd_stats(RD_STATS *rd_stats) {
  119|       |#if CONFIG_RD_DEBUG
  120|       |  int plane;
  121|       |#endif
  122|  5.78M|  rd_stats->rate = 0;
  123|  5.78M|  rd_stats->dist = 0;
  124|  5.78M|  rd_stats->rdcost = 0;
  125|  5.78M|  rd_stats->sse = 0;
  126|  5.78M|  rd_stats->skip_txfm = 1;
  127|  5.78M|  rd_stats->zero_rate = 0;
  128|       |#if CONFIG_RD_DEBUG
  129|       |  // This may run into problems when monochrome video is
  130|       |  // encoded, as there will only be 1 plane
  131|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  132|       |    rd_stats->txb_coeff_cost[plane] = 0;
  133|       |  }
  134|       |#endif
  135|  5.78M|}
partition_search.c:get_rd_opt_coeff_thresh:
  357|  2.99M|    int is_winner_mode) {
  358|  2.99M|  if (!enable_winner_mode_for_coeff_opt) {
  ------------------
  |  Branch (358:7): [True: 2.99M, False: 0]
  ------------------
  359|       |    // Default initialization of threshold
  360|  2.99M|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[DEFAULT_EVAL][0];
  361|  2.99M|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[DEFAULT_EVAL][1];
  362|  2.99M|    return;
  363|  2.99M|  }
  364|       |  // TODO(any): Experiment with coeff_opt_dist_threshold values when
  365|       |  // enable_winner_mode_for_coeff_opt is ON
  366|       |  // TODO(any): Skip the winner mode processing for blocks with lower residual
  367|       |  // energy as R-D optimization of coefficients would have been enabled during
  368|       |  // mode decision
  369|       |
  370|       |  // Use conservative threshold during mode decision and perform R-D
  371|       |  // optimization of coeffs always for winner modes
  372|      0|  if (is_winner_mode) {
  ------------------
  |  Branch (372:7): [True: 0, False: 0]
  ------------------
  373|      0|    txfm_params->coeff_opt_thresholds[0] =
  374|      0|        coeff_opt_threshold[WINNER_MODE_EVAL][0];
  375|      0|    txfm_params->coeff_opt_thresholds[1] =
  376|      0|        coeff_opt_threshold[WINNER_MODE_EVAL][1];
  377|      0|  } else {
  378|      0|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[MODE_EVAL][0];
  379|      0|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[MODE_EVAL][1];
  380|      0|  }
  381|      0|}
partition_search.c:av1_rd_cost_update:
  227|  12.1M|static inline void av1_rd_cost_update(int mult, RD_STATS *rd_cost) {
  228|  12.1M|  if (rd_cost->rate < INT_MAX && rd_cost->dist < INT64_MAX &&
  ------------------
  |  Branch (228:7): [True: 9.18M, False: 2.97M]
  |  Branch (228:34): [True: 9.18M, False: 18.4E]
  ------------------
  229|  9.18M|      rd_cost->rdcost < INT64_MAX) {
  ------------------
  |  Branch (229:7): [True: 9.18M, False: 18.4E]
  ------------------
  230|  9.18M|    rd_cost->rdcost = av1_calculate_rd_cost(mult, rd_cost->rate, rd_cost->dist);
  231|  9.18M|  } else {
  232|  2.97M|    av1_invalid_rd_stats(rd_cost);
  233|  2.97M|  }
  234|  12.1M|}
partition_search.c:av1_calculate_rd_cost:
  219|  11.4M|static inline int64_t av1_calculate_rd_cost(int mult, int rate, int64_t dist) {
  220|  11.4M|  assert(mult >= 0);
  221|  11.4M|  if (rate >= 0) {
  ------------------
  |  Branch (221:7): [True: 10.7M, False: 625k]
  ------------------
  222|  10.7M|    return RDCOST(mult, rate, dist);
  ------------------
  |  |   33|  10.7M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  10.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  10.7M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  10.7M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  223|  10.7M|  }
  224|   625k|  return RDCOST_NEG_R(mult, -rate, dist);
  ------------------
  |  |   37|   625k|  (((D) * (1 << RDDIV_BITS)) - \
  |  |  ------------------
  |  |  |  |   29|   625k|#define RDDIV_BITS 7
  |  |  ------------------
  |  |   38|   625k|   ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   41|   625k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  225|  11.4M|}
partition_search.c:av1_rd_stats_subtraction:
  239|  4.90M|                                            RD_STATS *result) {
  240|  4.90M|  if (left->rate == INT_MAX || right->rate == INT_MAX ||
  ------------------
  |  Branch (240:7): [True: 2.68M, False: 2.22M]
  |  Branch (240:32): [True: 18.4E, False: 2.22M]
  ------------------
  241|  2.22M|      left->dist == INT64_MAX || right->dist == INT64_MAX ||
  ------------------
  |  Branch (241:7): [True: 18.4E, False: 2.22M]
  |  Branch (241:34): [True: 18.4E, False: 2.22M]
  ------------------
  242|  2.68M|      left->rdcost == INT64_MAX || right->rdcost == INT64_MAX) {
  ------------------
  |  Branch (242:7): [True: 18.4E, False: 2.22M]
  |  Branch (242:36): [True: 18.4E, False: 2.22M]
  ------------------
  243|  2.68M|    av1_invalid_rd_stats(result);
  244|  2.68M|  } else {
  245|  2.22M|    result->rate = left->rate - right->rate;
  246|  2.22M|    result->dist = left->dist - right->dist;
  247|  2.22M|    result->rdcost = av1_calculate_rd_cost(mult, result->rate, result->dist);
  248|  2.22M|  }
  249|  4.90M|}
rd.c:av1_set_error_per_bit:
  348|  73.6k|static inline void av1_set_error_per_bit(int *errorperbit, int rdmult) {
  349|  73.6k|  *errorperbit = AOMMAX(rdmult >> RD_EPB_SHIFT, 1);
  ------------------
  |  |   35|  73.6k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 69.2k, False: 4.34k]
  |  |  ------------------
  ------------------
  350|  73.6k|}
rd.c:mode_offset:
   78|   390k|static inline int mode_offset(const PREDICTION_MODE mode) {
   79|   390k|  if (mode >= NEARESTMV) {
  ------------------
  |  Branch (79:7): [True: 292k, False: 97.6k]
  ------------------
   80|   292k|    return INTER_OFFSET(mode);
  ------------------
  |  |   28|   292k|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
   81|   292k|  } else {
   82|  97.6k|    switch (mode) {
   83|  24.4k|      case DC_PRED: return 0;
  ------------------
  |  Branch (83:7): [True: 24.4k, False: 73.2k]
  ------------------
   84|  24.4k|      case V_PRED: return 1;
  ------------------
  |  Branch (84:7): [True: 24.4k, False: 73.2k]
  ------------------
   85|  24.4k|      case H_PRED: return 2;
  ------------------
  |  Branch (85:7): [True: 24.4k, False: 73.2k]
  ------------------
   86|  24.4k|      case SMOOTH_PRED: return 3;
  ------------------
  |  Branch (86:7): [True: 24.4k, False: 73.2k]
  ------------------
   87|      0|      default: assert(0); return -1;
  ------------------
  |  Branch (87:7): [True: 0, False: 97.6k]
  ------------------
   88|  97.6k|    }
   89|  97.6k|  }
   90|   390k|}
rdopt.c:get_rd_opt_coeff_thresh:
  357|  6.09M|    int is_winner_mode) {
  358|  6.09M|  if (!enable_winner_mode_for_coeff_opt) {
  ------------------
  |  Branch (358:7): [True: 2.35M, False: 3.73M]
  ------------------
  359|       |    // Default initialization of threshold
  360|  2.35M|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[DEFAULT_EVAL][0];
  361|  2.35M|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[DEFAULT_EVAL][1];
  362|  2.35M|    return;
  363|  2.35M|  }
  364|       |  // TODO(any): Experiment with coeff_opt_dist_threshold values when
  365|       |  // enable_winner_mode_for_coeff_opt is ON
  366|       |  // TODO(any): Skip the winner mode processing for blocks with lower residual
  367|       |  // energy as R-D optimization of coefficients would have been enabled during
  368|       |  // mode decision
  369|       |
  370|       |  // Use conservative threshold during mode decision and perform R-D
  371|       |  // optimization of coeffs always for winner modes
  372|  3.73M|  if (is_winner_mode) {
  ------------------
  |  Branch (372:7): [True: 1.82M, False: 1.91M]
  ------------------
  373|  1.82M|    txfm_params->coeff_opt_thresholds[0] =
  374|  1.82M|        coeff_opt_threshold[WINNER_MODE_EVAL][0];
  375|  1.82M|    txfm_params->coeff_opt_thresholds[1] =
  376|  1.82M|        coeff_opt_threshold[WINNER_MODE_EVAL][1];
  377|  1.91M|  } else {
  378|  1.91M|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[MODE_EVAL][0];
  379|  1.91M|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[MODE_EVAL][1];
  380|  1.91M|  }
  381|  3.73M|}
rdopt.c:reset_mb_rd_record:
  384|  6.09M|static inline void reset_mb_rd_record(MB_RD_RECORD *const mb_rd_record) {
  385|  6.09M|  if (!mb_rd_record) return;
  ------------------
  |  Branch (385:7): [True: 68.8k, False: 6.02M]
  ------------------
  386|       |
  387|       |  // Reset the state for use_mb_rd_hash
  388|  6.02M|  mb_rd_record->num = mb_rd_record->index_start = 0;
  389|  6.02M|}
rdopt.c:av1_invalid_rd_stats:
  137|  18.5M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  18.5M|  rd_stats->rate = INT_MAX;
  142|  18.5M|  rd_stats->dist = INT64_MAX;
  143|  18.5M|  rd_stats->rdcost = INT64_MAX;
  144|  18.5M|  rd_stats->sse = INT64_MAX;
  145|  18.5M|  rd_stats->skip_txfm = 0;
  146|  18.5M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  18.5M|}
rdopt.c:av1_init_rd_stats:
  118|  29.5M|static inline void av1_init_rd_stats(RD_STATS *rd_stats) {
  119|       |#if CONFIG_RD_DEBUG
  120|       |  int plane;
  121|       |#endif
  122|  29.5M|  rd_stats->rate = 0;
  123|  29.5M|  rd_stats->dist = 0;
  124|  29.5M|  rd_stats->rdcost = 0;
  125|  29.5M|  rd_stats->sse = 0;
  126|  29.5M|  rd_stats->skip_txfm = 1;
  127|  29.5M|  rd_stats->zero_rate = 0;
  128|       |#if CONFIG_RD_DEBUG
  129|       |  // This may run into problems when monochrome video is
  130|       |  // encoded, as there will only be 1 plane
  131|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  132|       |    rd_stats->txb_coeff_cost[plane] = 0;
  133|       |  }
  134|       |#endif
  135|  29.5M|}
nonrd_pickmode.c:av1_invalid_rd_stats:
  137|  3.91M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  3.91M|  rd_stats->rate = INT_MAX;
  142|  3.91M|  rd_stats->dist = INT64_MAX;
  143|  3.91M|  rd_stats->rdcost = INT64_MAX;
  144|  3.91M|  rd_stats->sse = INT64_MAX;
  145|  3.91M|  rd_stats->skip_txfm = 0;
  146|  3.91M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  3.91M|}
nonrd_pickmode.c:rd_less_than_thresh:
  339|  2.11M|                                      int thresh_fact) {
  340|  2.11M|  return best_rd < (thresh * thresh_fact >> 5) || thresh == INT_MAX;
  ------------------
  |  Branch (340:10): [True: 18.4E, False: 2.11M]
  |  Branch (340:51): [True: 18.4E, False: 2.11M]
  ------------------
  341|  2.11M|}
nonrd_pickmode.c:mode_offset:
   78|  2.98M|static inline int mode_offset(const PREDICTION_MODE mode) {
   79|  2.98M|  if (mode >= NEARESTMV) {
  ------------------
  |  Branch (79:7): [True: 1.99M, False: 987k]
  ------------------
   80|  1.99M|    return INTER_OFFSET(mode);
  ------------------
  |  |   28|  1.99M|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
   81|  1.99M|  } else {
   82|   987k|    switch (mode) {
   83|   375k|      case DC_PRED: return 0;
  ------------------
  |  Branch (83:7): [True: 375k, False: 612k]
  ------------------
   84|   211k|      case V_PRED: return 1;
  ------------------
  |  Branch (84:7): [True: 211k, False: 776k]
  ------------------
   85|   210k|      case H_PRED: return 2;
  ------------------
  |  Branch (85:7): [True: 210k, False: 776k]
  ------------------
   86|   199k|      case SMOOTH_PRED: return 3;
  ------------------
  |  Branch (86:7): [True: 199k, False: 788k]
  ------------------
   87|      0|      default: assert(0); return -1;
  ------------------
  |  Branch (87:7): [True: 0, False: 987k]
  ------------------
   88|   987k|    }
   89|   987k|  }
   90|  2.98M|}
nonrd_opt.c:av1_invalid_rd_stats:
  137|  2.41M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  2.41M|  rd_stats->rate = INT_MAX;
  142|  2.41M|  rd_stats->dist = INT64_MAX;
  143|  2.41M|  rd_stats->rdcost = INT64_MAX;
  144|  2.41M|  rd_stats->sse = INT64_MAX;
  145|  2.41M|  rd_stats->skip_txfm = 0;
  146|  2.41M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  2.41M|}
nonrd_opt.c:mode_offset:
   78|  2.38M|static inline int mode_offset(const PREDICTION_MODE mode) {
   79|  2.38M|  if (mode >= NEARESTMV) {
  ------------------
  |  Branch (79:7): [True: 0, False: 2.38M]
  ------------------
   80|      0|    return INTER_OFFSET(mode);
  ------------------
  |  |   28|      0|#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
  ------------------
   81|  2.38M|  } else {
   82|  2.38M|    switch (mode) {
   83|   596k|      case DC_PRED: return 0;
  ------------------
  |  Branch (83:7): [True: 596k, False: 1.78M]
  ------------------
   84|   598k|      case V_PRED: return 1;
  ------------------
  |  Branch (84:7): [True: 598k, False: 1.78M]
  ------------------
   85|   598k|      case H_PRED: return 2;
  ------------------
  |  Branch (85:7): [True: 598k, False: 1.78M]
  ------------------
   86|   598k|      case SMOOTH_PRED: return 3;
  ------------------
  |  Branch (86:7): [True: 598k, False: 1.78M]
  ------------------
   87|      0|      default: assert(0); return -1;
  ------------------
  |  Branch (87:7): [True: 0, False: 2.38M]
  ------------------
   88|  2.38M|    }
   89|  2.38M|  }
   90|  2.38M|}
nonrd_opt.c:rd_less_than_thresh:
  339|  1.28M|                                      int thresh_fact) {
  340|  1.28M|  return best_rd < (thresh * thresh_fact >> 5) || thresh == INT_MAX;
  ------------------
  |  Branch (340:10): [True: 616, False: 1.28M]
  |  Branch (340:51): [True: 18.4E, False: 1.28M]
  ------------------
  341|  1.28M|}
tx_search.c:av1_init_rd_stats:
  118|   171M|static inline void av1_init_rd_stats(RD_STATS *rd_stats) {
  119|       |#if CONFIG_RD_DEBUG
  120|       |  int plane;
  121|       |#endif
  122|   171M|  rd_stats->rate = 0;
  123|   171M|  rd_stats->dist = 0;
  124|   171M|  rd_stats->rdcost = 0;
  125|   171M|  rd_stats->sse = 0;
  126|   171M|  rd_stats->skip_txfm = 1;
  127|   171M|  rd_stats->zero_rate = 0;
  128|       |#if CONFIG_RD_DEBUG
  129|       |  // This may run into problems when monochrome video is
  130|       |  // encoded, as there will only be 1 plane
  131|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  132|       |    rd_stats->txb_coeff_cost[plane] = 0;
  133|       |  }
  134|       |#endif
  135|   171M|}
tx_search.c:av1_merge_rd_stats:
  157|  93.1M|                                      const RD_STATS *rd_stats_src) {
  158|  93.1M|  if (rd_stats_dst->rate == INT_MAX || rd_stats_src->rate == INT_MAX) {
  ------------------
  |  Branch (158:7): [True: 32.4k, False: 93.1M]
  |  Branch (158:40): [True: 18.4E, False: 93.1M]
  ------------------
  159|       |    // If rd_stats_dst or rd_stats_src has invalid rate, we will make
  160|       |    // rd_stats_dst invalid.
  161|      0|    av1_invalid_rd_stats(rd_stats_dst);
  162|      0|    return;
  163|      0|  }
  164|  93.1M|  rd_stats_dst->rate = (int)AOMMIN(
  ------------------
  |  |   34|  93.1M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 93.1M, False: 9.75k]
  |  |  ------------------
  ------------------
  165|  93.1M|      ((int64_t)rd_stats_dst->rate + (int64_t)rd_stats_src->rate), INT_MAX);
  166|  93.1M|  if (!rd_stats_dst->zero_rate)
  ------------------
  |  Branch (166:7): [True: 92.8M, False: 271k]
  ------------------
  167|  92.8M|    rd_stats_dst->zero_rate = rd_stats_src->zero_rate;
  168|  93.1M|  rd_stats_dst->dist += rd_stats_src->dist;
  169|  93.2M|  if (rd_stats_dst->sse < INT64_MAX && rd_stats_src->sse < INT64_MAX) {
  ------------------
  |  Branch (169:7): [True: 93.2M, False: 18.4E]
  |  Branch (169:40): [True: 93.2M, False: 18.4E]
  ------------------
  170|  93.2M|    rd_stats_dst->sse += rd_stats_src->sse;
  171|  93.2M|  }
  172|  93.1M|  rd_stats_dst->skip_txfm &= rd_stats_src->skip_txfm;
  173|       |#if CONFIG_RD_DEBUG
  174|       |  // This may run into problems when monochrome video is
  175|       |  // encoded, as there will only be 1 plane
  176|       |  for (int plane = 0; plane < MAX_MB_PLANE; ++plane) {
  177|       |    rd_stats_dst->txb_coeff_cost[plane] += rd_stats_src->txb_coeff_cost[plane];
  178|       |  }
  179|       |#endif
  180|  93.1M|}
tx_search.c:av1_invalid_rd_stats:
  137|   190M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|   190M|  rd_stats->rate = INT_MAX;
  142|   190M|  rd_stats->dist = INT64_MAX;
  143|   190M|  rd_stats->rdcost = INT64_MAX;
  144|   190M|  rd_stats->sse = INT64_MAX;
  145|   190M|  rd_stats->skip_txfm = 0;
  146|   190M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|   190M|}
intra_mode_search.c:av1_merge_rd_stats:
  157|  22.3M|                                      const RD_STATS *rd_stats_src) {
  158|  22.3M|  if (rd_stats_dst->rate == INT_MAX || rd_stats_src->rate == INT_MAX) {
  ------------------
  |  Branch (158:7): [True: 14, False: 22.3M]
  |  Branch (158:40): [True: 0, False: 22.3M]
  ------------------
  159|       |    // If rd_stats_dst or rd_stats_src has invalid rate, we will make
  160|       |    // rd_stats_dst invalid.
  161|      0|    av1_invalid_rd_stats(rd_stats_dst);
  162|      0|    return;
  163|      0|  }
  164|  22.3M|  rd_stats_dst->rate = (int)AOMMIN(
  ------------------
  |  |   34|  22.3M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 22.3M, False: 21]
  |  |  ------------------
  ------------------
  165|  22.3M|      ((int64_t)rd_stats_dst->rate + (int64_t)rd_stats_src->rate), INT_MAX);
  166|  22.3M|  if (!rd_stats_dst->zero_rate)
  ------------------
  |  Branch (166:7): [True: 22.3M, False: 8]
  ------------------
  167|  22.3M|    rd_stats_dst->zero_rate = rd_stats_src->zero_rate;
  168|  22.3M|  rd_stats_dst->dist += rd_stats_src->dist;
  169|  22.3M|  if (rd_stats_dst->sse < INT64_MAX && rd_stats_src->sse < INT64_MAX) {
  ------------------
  |  Branch (169:7): [True: 22.3M, False: 12]
  |  Branch (169:40): [True: 22.3M, False: 17]
  ------------------
  170|  22.3M|    rd_stats_dst->sse += rd_stats_src->sse;
  171|  22.3M|  }
  172|  22.3M|  rd_stats_dst->skip_txfm &= rd_stats_src->skip_txfm;
  173|       |#if CONFIG_RD_DEBUG
  174|       |  // This may run into problems when monochrome video is
  175|       |  // encoded, as there will only be 1 plane
  176|       |  for (int plane = 0; plane < MAX_MB_PLANE; ++plane) {
  177|       |    rd_stats_dst->txb_coeff_cost[plane] += rd_stats_src->txb_coeff_cost[plane];
  178|       |  }
  179|       |#endif
  180|  22.3M|}
intra_mode_search.c:av1_rd_cost_update:
  227|  31.4M|static inline void av1_rd_cost_update(int mult, RD_STATS *rd_cost) {
  228|  31.4M|  if (rd_cost->rate < INT_MAX && rd_cost->dist < INT64_MAX &&
  ------------------
  |  Branch (228:7): [True: 31.4M, False: 18.4E]
  |  Branch (228:34): [True: 31.4M, False: 18.4E]
  ------------------
  229|  31.4M|      rd_cost->rdcost < INT64_MAX) {
  ------------------
  |  Branch (229:7): [True: 31.4M, False: 18.4E]
  ------------------
  230|  31.4M|    rd_cost->rdcost = av1_calculate_rd_cost(mult, rd_cost->rate, rd_cost->dist);
  231|  18.4E|  } else {
  232|  18.4E|    av1_invalid_rd_stats(rd_cost);
  233|  18.4E|  }
  234|  31.4M|}
intra_mode_search.c:av1_calculate_rd_cost:
  219|  31.4M|static inline int64_t av1_calculate_rd_cost(int mult, int rate, int64_t dist) {
  220|  31.4M|  assert(mult >= 0);
  221|  31.4M|  if (rate >= 0) {
  ------------------
  |  Branch (221:7): [True: 31.4M, False: 18.4E]
  ------------------
  222|  31.4M|    return RDCOST(mult, rate, dist);
  ------------------
  |  |   33|  31.4M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  31.4M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  31.4M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  31.4M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  223|  31.4M|  }
  224|  18.4E|  return RDCOST_NEG_R(mult, -rate, dist);
  ------------------
  |  |   37|  18.4E|  (((D) * (1 << RDDIV_BITS)) - \
  |  |  ------------------
  |  |  |  |   29|  18.4E|#define RDDIV_BITS 7
  |  |  ------------------
  |  |   38|  18.4E|   ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   41|  18.4E|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  ------------------
  225|  31.4M|}
intra_mode_search.c:av1_invalid_rd_stats:
  137|  62.0M|static inline void av1_invalid_rd_stats(RD_STATS *rd_stats) {
  138|       |#if CONFIG_RD_DEBUG
  139|       |  int plane;
  140|       |#endif
  141|  62.0M|  rd_stats->rate = INT_MAX;
  142|  62.0M|  rd_stats->dist = INT64_MAX;
  143|  62.0M|  rd_stats->rdcost = INT64_MAX;
  144|  62.0M|  rd_stats->sse = INT64_MAX;
  145|  62.0M|  rd_stats->skip_txfm = 0;
  146|  62.0M|  rd_stats->zero_rate = 0;
  147|       |#if CONFIG_RD_DEBUG
  148|       |  // This may run into problems when monochrome video is
  149|       |  // encoded, as there will only be 1 plane
  150|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  151|       |    rd_stats->txb_coeff_cost[plane] = INT_MAX;
  152|       |  }
  153|       |#endif
  154|  62.0M|}
intra_mode_search.c:av1_init_rd_stats:
  118|  14.8M|static inline void av1_init_rd_stats(RD_STATS *rd_stats) {
  119|       |#if CONFIG_RD_DEBUG
  120|       |  int plane;
  121|       |#endif
  122|  14.8M|  rd_stats->rate = 0;
  123|  14.8M|  rd_stats->dist = 0;
  124|  14.8M|  rd_stats->rdcost = 0;
  125|  14.8M|  rd_stats->sse = 0;
  126|  14.8M|  rd_stats->skip_txfm = 1;
  127|  14.8M|  rd_stats->zero_rate = 0;
  128|       |#if CONFIG_RD_DEBUG
  129|       |  // This may run into problems when monochrome video is
  130|       |  // encoded, as there will only be 1 plane
  131|       |  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
  132|       |    rd_stats->txb_coeff_cost[plane] = 0;
  133|       |  }
  134|       |#endif
  135|  14.8M|}
intra_mode_search.c:get_rd_opt_coeff_thresh:
  357|   820k|    int is_winner_mode) {
  358|   820k|  if (!enable_winner_mode_for_coeff_opt) {
  ------------------
  |  Branch (358:7): [True: 137k, False: 683k]
  ------------------
  359|       |    // Default initialization of threshold
  360|   137k|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[DEFAULT_EVAL][0];
  361|   137k|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[DEFAULT_EVAL][1];
  362|   137k|    return;
  363|   137k|  }
  364|       |  // TODO(any): Experiment with coeff_opt_dist_threshold values when
  365|       |  // enable_winner_mode_for_coeff_opt is ON
  366|       |  // TODO(any): Skip the winner mode processing for blocks with lower residual
  367|       |  // energy as R-D optimization of coefficients would have been enabled during
  368|       |  // mode decision
  369|       |
  370|       |  // Use conservative threshold during mode decision and perform R-D
  371|       |  // optimization of coeffs always for winner modes
  372|   683k|  if (is_winner_mode) {
  ------------------
  |  Branch (372:7): [True: 312k, False: 370k]
  ------------------
  373|   312k|    txfm_params->coeff_opt_thresholds[0] =
  374|   312k|        coeff_opt_threshold[WINNER_MODE_EVAL][0];
  375|   312k|    txfm_params->coeff_opt_thresholds[1] =
  376|   312k|        coeff_opt_threshold[WINNER_MODE_EVAL][1];
  377|   370k|  } else {
  378|   370k|    txfm_params->coeff_opt_thresholds[0] = coeff_opt_threshold[MODE_EVAL][0];
  379|   370k|    txfm_params->coeff_opt_thresholds[1] = coeff_opt_threshold[MODE_EVAL][1];
  380|   370k|  }
  381|   683k|}
intra_mode_search.c:reset_mb_rd_record:
  384|   820k|static inline void reset_mb_rd_record(MB_RD_RECORD *const mb_rd_record) {
  385|   820k|  if (!mb_rd_record) return;
  ------------------
  |  Branch (385:7): [True: 137k, False: 683k]
  ------------------
  386|       |
  387|       |  // Reset the state for use_mb_rd_hash
  388|   683k|  mb_rd_record->num = mb_rd_record->index_start = 0;
  389|   683k|}

av1_inter_mode_data_init:
  353|   111k|void av1_inter_mode_data_init(TileDataEnc *tile_data) {
  354|  2.56M|  for (int i = 0; i < BLOCK_SIZES_ALL; ++i) {
  ------------------
  |  Branch (354:19): [True: 2.44M, False: 111k]
  ------------------
  355|  2.44M|    InterModeRdModel *md = &tile_data->inter_mode_rd_models[i];
  356|  2.44M|    md->ready = 0;
  357|  2.44M|    md->num = 0;
  358|  2.44M|    md->dist_sum = 0;
  359|  2.44M|    md->ld_sum = 0;
  360|  2.44M|    md->sse_sum = 0;
  361|  2.44M|    md->sse_sse_sum = 0;
  362|  2.44M|    md->sse_ld_sum = 0;
  363|  2.44M|  }
  364|   111k|}
av1_inter_mode_data_fit:
  400|  4.29k|void av1_inter_mode_data_fit(TileDataEnc *tile_data, int rdmult) {
  401|  98.7k|  for (int bsize = 0; bsize < BLOCK_SIZES_ALL; ++bsize) {
  ------------------
  |  Branch (401:23): [True: 94.4k, False: 4.29k]
  ------------------
  402|  94.4k|    const int block_idx = inter_mode_data_block_idx(bsize);
  403|  94.4k|    InterModeRdModel *md = &tile_data->inter_mode_rd_models[bsize];
  404|  94.4k|    if (block_idx == -1) continue;
  ------------------
  |  Branch (404:9): [True: 21.4k, False: 72.9k]
  ------------------
  405|  72.9k|    if ((md->ready == 0 && md->num < 200) || (md->ready == 1 && md->num < 64)) {
  ------------------
  |  Branch (405:10): [True: 72.9k, False: 26]
  |  Branch (405:28): [True: 72.9k, False: 7]
  |  Branch (405:47): [True: 26, False: 7]
  |  Branch (405:65): [True: 17, False: 9]
  ------------------
  406|  72.9k|      continue;
  407|  72.9k|    } else {
  408|     16|      if (md->ready == 0) {
  ------------------
  |  Branch (408:11): [True: 7, False: 9]
  ------------------
  409|      7|        md->dist_mean = md->dist_sum / md->num;
  410|      7|        md->ld_mean = md->ld_sum / md->num;
  411|      7|        md->sse_mean = md->sse_sum / md->num;
  412|      7|        md->sse_sse_mean = md->sse_sse_sum / md->num;
  413|      7|        md->sse_ld_mean = md->sse_ld_sum / md->num;
  414|      9|      } else {
  415|      9|        const double factor = 3;
  416|      9|        md->dist_mean =
  417|      9|            (md->dist_mean * factor + (md->dist_sum / md->num)) / (factor + 1);
  418|      9|        md->ld_mean =
  419|      9|            (md->ld_mean * factor + (md->ld_sum / md->num)) / (factor + 1);
  420|      9|        md->sse_mean =
  421|      9|            (md->sse_mean * factor + (md->sse_sum / md->num)) / (factor + 1);
  422|      9|        md->sse_sse_mean =
  423|      9|            (md->sse_sse_mean * factor + (md->sse_sse_sum / md->num)) /
  424|      9|            (factor + 1);
  425|      9|        md->sse_ld_mean =
  426|      9|            (md->sse_ld_mean * factor + (md->sse_ld_sum / md->num)) /
  427|      9|            (factor + 1);
  428|      9|      }
  429|       |
  430|     16|      const double my = md->ld_mean;
  431|     16|      const double mx = md->sse_mean;
  432|     16|      const double dx = sqrt(md->sse_sse_mean);
  433|     16|      const double dxy = md->sse_ld_mean;
  434|       |
  435|     16|      md->a = (dxy - mx * my) / (dx * dx - mx * mx);
  436|     16|      md->b = my - md->a * mx;
  437|     16|      md->ready = 1;
  438|       |
  439|     16|      md->num = 0;
  440|     16|      md->dist_sum = 0;
  441|     16|      md->ld_sum = 0;
  442|     16|      md->sse_sum = 0;
  443|     16|      md->sse_sse_sum = 0;
  444|     16|      md->sse_ld_sum = 0;
  445|     16|    }
  446|     16|    (void)rdmult;
  447|     16|  }
  448|  4.29k|}
av1_rd_pick_intra_mode_sb:
 3518|   439k|                               PICK_MODE_CONTEXT *ctx, int64_t best_rd) {
 3519|   439k|  const AV1_COMMON *const cm = &cpi->common;
 3520|   439k|  MACROBLOCKD *const xd = &x->e_mbd;
 3521|   439k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3522|   439k|  const int num_planes = av1_num_planes(cm);
 3523|   439k|  int rate_y = 0, rate_uv = 0, rate_y_tokenonly = 0, rate_uv_tokenonly = 0;
 3524|   439k|  uint8_t y_skip_txfm = 0, uv_skip_txfm = 0;
 3525|   439k|  int64_t dist_y = 0, dist_uv = 0;
 3526|       |
 3527|   439k|  ctx->rd_stats.skip_txfm = 0;
 3528|   439k|  mbmi->ref_frame[0] = INTRA_FRAME;
 3529|   439k|  mbmi->ref_frame[1] = NONE_FRAME;
 3530|   439k|  mbmi->use_intrabc = 0;
 3531|   439k|  mbmi->mv[0].as_int = 0;
 3532|   439k|  mbmi->skip_mode = 0;
 3533|       |
 3534|   439k|  const int64_t intra_yrd =
 3535|   439k|      av1_rd_pick_intra_sby_mode(cpi, x, &rate_y, &rate_y_tokenonly, &dist_y,
 3536|   439k|                                 &y_skip_txfm, bsize, best_rd, ctx);
 3537|       |
 3538|       |  // Initialize default mode evaluation params
 3539|   439k|  set_mode_eval_params(cpi, x, DEFAULT_EVAL);
 3540|       |
 3541|   439k|  if (intra_yrd < best_rd) {
  ------------------
  |  Branch (3541:7): [True: 381k, False: 58.5k]
  ------------------
 3542|       |    // Search intra modes for uv planes if needed
 3543|   381k|    if (num_planes > 1) {
  ------------------
  |  Branch (3543:9): [True: 186k, False: 194k]
  ------------------
 3544|       |      // Set up the tx variables for reproducing the y predictions in case we
 3545|       |      // need it for chroma-from-luma.
 3546|   186k|      if (xd->is_chroma_ref && store_cfl_required_rdo(cm, x)) {
  ------------------
  |  Branch (3546:11): [True: 171k, False: 14.9k]
  |  Branch (3546:32): [True: 166k, False: 5.48k]
  ------------------
 3547|   166k|        av1_copy_array(xd->tx_type_map, ctx->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   166k|  do {                                                    \
  |  |   39|   166k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   166k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   166k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 166k]
  |  |  ------------------
  ------------------
 3548|   166k|      }
 3549|   186k|      const TX_SIZE max_uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd);
  ------------------
  |  |  282|   186k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3550|   186k|      av1_rd_pick_intra_sbuv_mode(cpi, x, &rate_uv, &rate_uv_tokenonly,
 3551|   186k|                                  &dist_uv, &uv_skip_txfm, bsize,
 3552|   186k|                                  max_uv_tx_size);
 3553|   186k|    }
 3554|       |
 3555|       |    // Intra block is always coded as non-skip
 3556|   381k|    rd_cost->rate =
 3557|   381k|        rate_y + rate_uv +
 3558|   381k|        x->mode_costs.skip_txfm_cost[av1_get_skip_txfm_context(xd)][0];
 3559|   381k|    rd_cost->dist = dist_y + dist_uv;
 3560|   381k|    rd_cost->rdcost = RDCOST(x->rdmult, rd_cost->rate, rd_cost->dist);
  ------------------
  |  |   33|   381k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   381k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   381k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   381k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3561|   381k|    rd_cost->skip_txfm = 0;
 3562|   381k|  } else {
 3563|  58.5k|    rd_cost->rate = INT_MAX;
 3564|  58.5k|  }
 3565|       |
 3566|   439k|  if (rd_cost->rate != INT_MAX && rd_cost->rdcost < best_rd)
  ------------------
  |  Branch (3566:7): [True: 381k, False: 58.5k]
  |  Branch (3566:35): [True: 346k, False: 34.8k]
  ------------------
 3567|   346k|    best_rd = rd_cost->rdcost;
 3568|   439k|  if (rd_pick_intrabc_mode_sb(cpi, x, ctx, rd_cost, bsize, best_rd) < best_rd) {
  ------------------
  |  Branch (3568:7): [True: 0, False: 439k]
  ------------------
 3569|      0|    ctx->rd_stats.skip_txfm = mbmi->skip_txfm;
 3570|      0|    assert(rd_cost->rate != INT_MAX);
 3571|      0|  }
 3572|   439k|  if (rd_cost->rate == INT_MAX) return;
  ------------------
  |  Branch (3572:7): [True: 58.6k, False: 381k]
  ------------------
 3573|       |
 3574|   381k|  ctx->mic = *mbmi;
 3575|   381k|  av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, &x->mbmi_ext,
 3576|   381k|                                      av1_ref_frame_type(xd->mi[0]->ref_frame));
 3577|       |  av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   381k|  do {                                                    \
  |  |   39|   381k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   381k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   381k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 381k]
  |  |  ------------------
  ------------------
 3578|   381k|}
av1_rd_pick_inter_mode:
 5994|  1.91M|                            int64_t best_rd_so_far) {
 5995|  1.91M|  AV1_COMMON *const cm = &cpi->common;
 5996|  1.91M|  const FeatureFlags *const features = &cm->features;
 5997|  1.91M|  const int num_planes = av1_num_planes(cm);
 5998|  1.91M|  const SPEED_FEATURES *const sf = &cpi->sf;
 5999|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 6000|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 6001|  1.91M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 6002|  1.91M|  int i;
 6003|  1.91M|  const ModeCosts *mode_costs = &x->mode_costs;
 6004|  1.91M|  const int *comp_inter_cost =
 6005|  1.91M|      mode_costs->comp_inter_cost[av1_get_reference_mode_context(xd)];
 6006|       |
 6007|  1.91M|  InterModeSearchState search_state;
 6008|  1.91M|  init_inter_mode_search_state(&search_state, cpi, x, bsize, best_rd_so_far);
 6009|  1.91M|  INTERINTRA_MODE interintra_modes[REF_FRAMES] = {
 6010|  1.91M|    INTERINTRA_MODES, INTERINTRA_MODES, INTERINTRA_MODES, INTERINTRA_MODES,
 6011|  1.91M|    INTERINTRA_MODES, INTERINTRA_MODES, INTERINTRA_MODES, INTERINTRA_MODES
 6012|  1.91M|  };
 6013|       |
 6014|  1.91M|  init_top_tx_no_split_rd_for_inter_modes(
 6015|  1.91M|      x, sf->tx_sf.prune_inter_tx_split_rd_eval_lvl);
 6016|       |
 6017|  1.91M|  HandleInterModeArgs args = { { NULL },
 6018|  1.91M|                               { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                                             { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                                             { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 6019|  1.91M|                               { NULL },
 6020|  1.91M|                               { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                                             { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 6021|  1.91M|                                 MAX_SB_SIZE >> 1 },
  ------------------
  |  |   32|  1.91M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  1.91M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 6022|  1.91M|                               NULL,
 6023|  1.91M|                               NULL,
 6024|  1.91M|                               NULL,
 6025|  1.91M|                               search_state.modelled_rd,
 6026|  1.91M|                               INT_MAX,
 6027|  1.91M|                               INT_MAX,
 6028|  1.91M|                               search_state.simple_rd,
 6029|  1.91M|                               0,
 6030|  1.91M|                               false,
 6031|  1.91M|                               interintra_modes,
 6032|  1.91M|                               { { { 0 }, { { 0 } }, { 0 }, 0, 0, 0, 0 } },
 6033|  1.91M|                               { { 0, 0 } },
 6034|  1.91M|                               { 0 },
 6035|  1.91M|                               0,
 6036|  1.91M|                               0,
 6037|  1.91M|                               -1,
 6038|  1.91M|                               -1,
 6039|  1.91M|                               -1,
 6040|  1.91M|                               { 0 },
 6041|  1.91M|                               { 0 },
 6042|  1.91M|                               UINT_MAX };
 6043|       |  // Currently, is_low_temp_var is used in real time encoding.
 6044|  1.91M|  const int is_low_temp_var = get_block_temp_var(cpi, x, bsize);
 6045|       |
 6046|  57.5M|  for (i = 0; i < MODE_CTX_REF_FRAMES; ++i) args.cmp_mode[i] = -1;
  ------------------
  |  |  598|  57.5M|#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
  |  |  ------------------
  |  |  |  |  591|  57.5M|#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
  |  |  ------------------
  ------------------
  |  Branch (6046:15): [True: 55.6M, False: 1.91M]
  ------------------
 6047|       |  // Indicates the appropriate number of simple translation winner modes for
 6048|       |  // exhaustive motion mode evaluation
 6049|  1.91M|  const int max_winner_motion_mode_cand =
 6050|  1.91M|      num_winner_motion_modes[sf->winner_mode_sf.motion_mode_for_winner_cand];
 6051|  1.91M|  assert(max_winner_motion_mode_cand <= MAX_WINNER_MOTION_MODES);
 6052|  1.91M|  motion_mode_candidate motion_mode_cand;
 6053|  1.91M|  motion_mode_best_st_candidate best_motion_mode_cands;
 6054|       |  // Initializing the number of motion mode candidates to zero.
 6055|  1.91M|  best_motion_mode_cands.num_motion_mode_cand = 0;
 6056|  21.0M|  for (i = 0; i < MAX_WINNER_MOTION_MODES; ++i)
  ------------------
  |  |   32|  21.0M|#define MAX_WINNER_MOTION_MODES 10
  ------------------
  |  Branch (6056:15): [True: 19.1M, False: 1.91M]
  ------------------
 6057|  19.1M|    best_motion_mode_cands.motion_mode_cand[i].rd_cost = INT64_MAX;
 6058|       |
 6059|  17.2M|  for (i = 0; i < REF_FRAMES; ++i) x->pred_sse[i] = INT_MAX;
  ------------------
  |  Branch (6059:15): [True: 15.3M, False: 1.91M]
  ------------------
 6060|       |
 6061|  1.91M|  av1_invalid_rd_stats(rd_cost);
 6062|       |
 6063|  17.2M|  for (i = 0; i < REF_FRAMES; ++i) {
  ------------------
  |  Branch (6063:15): [True: 15.3M, False: 1.91M]
  ------------------
 6064|  15.3M|    x->warp_sample_info[i].num = -1;
 6065|  15.3M|  }
 6066|       |
 6067|       |  // Ref frames that are selected by square partition blocks.
 6068|  1.91M|  int picked_ref_frames_mask = 0;
 6069|  1.91M|  if (sf->inter_sf.prune_ref_frame_for_rect_partitions &&
  ------------------
  |  Branch (6069:7): [True: 1.42M, False: 491k]
  ------------------
 6070|  1.42M|      mbmi->partition != PARTITION_NONE) {
  ------------------
  |  Branch (6070:7): [True: 15.4k, False: 1.41M]
  ------------------
 6071|       |    // prune_ref_frame_for_rect_partitions = 1 implies prune only extended
 6072|       |    // partition blocks. prune_ref_frame_for_rect_partitions >=2
 6073|       |    // implies prune for vert, horiz and extended partition blocks.
 6074|  15.4k|    if ((mbmi->partition != PARTITION_VERT &&
  ------------------
  |  Branch (6074:10): [True: 169, False: 15.3k]
  ------------------
 6075|    169|         mbmi->partition != PARTITION_HORZ) ||
  ------------------
  |  Branch (6075:10): [True: 0, False: 169]
  ------------------
 6076|  15.4k|        sf->inter_sf.prune_ref_frame_for_rect_partitions >= 2) {
  ------------------
  |  Branch (6076:9): [True: 15.4k, False: 0]
  ------------------
 6077|  15.4k|      picked_ref_frames_mask =
 6078|  15.4k|          fetch_picked_ref_frames_mask(x, bsize, cm->seq_params->mib_size);
 6079|  15.4k|    }
 6080|  15.4k|  }
 6081|       |
 6082|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6083|       |  start_timing(cpi, set_params_rd_pick_inter_mode_time);
 6084|       |#endif
 6085|       |  // Skip ref frames that never selected by square blocks.
 6086|  1.91M|  const int skip_ref_frame_mask =
 6087|  1.91M|      picked_ref_frames_mask ? ~picked_ref_frames_mask : 0;
  ------------------
  |  Branch (6087:7): [True: 15.4k, False: 1.90M]
  ------------------
 6088|  1.91M|  mode_skip_mask_t mode_skip_mask;
 6089|  1.91M|  unsigned int ref_costs_single[REF_FRAMES];
 6090|  1.91M|  unsigned int ref_costs_comp[REF_FRAMES][REF_FRAMES];
 6091|  1.91M|  struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE];
 6092|       |  // init params, set frame modes, speed features
 6093|  1.91M|  set_params_rd_pick_inter_mode(cpi, x, &args, bsize, &mode_skip_mask,
 6094|  1.91M|                                skip_ref_frame_mask, ref_costs_single,
 6095|  1.91M|                                ref_costs_comp, yv12_mb);
 6096|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6097|       |  end_timing(cpi, set_params_rd_pick_inter_mode_time);
 6098|       |#endif
 6099|       |
 6100|  1.91M|  int64_t best_est_rd = INT64_MAX;
 6101|  1.91M|  const InterModeRdModel *md = &tile_data->inter_mode_rd_models[bsize];
 6102|       |  // If do_tx_search is 0, only estimated RD should be computed.
 6103|       |  // If do_tx_search is 1, all modes have TX search performed.
 6104|  1.91M|  const int do_tx_search =
 6105|  1.91M|      !((sf->inter_sf.inter_mode_rd_model_estimation == 1 && md->ready) ||
  ------------------
  |  Branch (6105:10): [True: 60.4k, False: 1.85M]
  |  Branch (6105:62): [True: 872, False: 59.5k]
  ------------------
 6106|  1.91M|        (sf->inter_sf.inter_mode_rd_model_estimation == 2 &&
  ------------------
  |  Branch (6106:10): [True: 456k, False: 1.46M]
  ------------------
 6107|   456k|         num_pels_log2_lookup[bsize] > 8));
  ------------------
  |  Branch (6107:10): [True: 6.71k, False: 449k]
  ------------------
 6108|  1.91M|  InterModesInfo *inter_modes_info = x->inter_modes_info;
 6109|  1.91M|  inter_modes_info->num = 0;
 6110|       |
 6111|       |  // Temporary buffers used by handle_inter_mode().
 6112|  1.91M|  uint8_t *const tmp_buf = get_buf_by_bd(xd, x->tmp_pred_bufs[0]);
 6113|       |
 6114|       |  // The best RD found for the reference frame, among single reference modes.
 6115|       |  // Note that the 0-th element will contain a cut-off that is later used
 6116|       |  // to determine if we should skip a compound mode.
 6117|  1.91M|  int64_t ref_frame_rd[REF_FRAMES] = { INT64_MAX, INT64_MAX, INT64_MAX,
 6118|  1.91M|                                       INT64_MAX, INT64_MAX, INT64_MAX,
 6119|  1.91M|                                       INT64_MAX, INT64_MAX };
 6120|       |
 6121|       |  // Prepared stats used later to check if we could skip intra mode eval.
 6122|  1.91M|  int64_t inter_cost = -1;
 6123|  1.91M|  int64_t intra_cost = -1;
 6124|       |  // Need to tweak the threshold for hdres speed 0 & 1.
 6125|  1.91M|  const int mi_row = xd->mi_row;
 6126|  1.91M|  const int mi_col = xd->mi_col;
 6127|       |
 6128|       |  // Obtain the relevant tpl stats for pruning inter modes
 6129|  1.91M|  PruneInfoFromTpl inter_cost_info_from_tpl;
 6130|  1.91M|#if !CONFIG_REALTIME_ONLY
 6131|  1.91M|  if (sf->inter_sf.prune_inter_modes_based_on_tpl) {
  ------------------
  |  Branch (6131:7): [True: 1.91M, False: 18.4E]
  ------------------
 6132|       |    // x->tpl_keep_ref_frame[id] = 1 => no pruning in
 6133|       |    // prune_ref_by_selective_ref_frame()
 6134|       |    // x->tpl_keep_ref_frame[id] = 0  => ref frame can be pruned in
 6135|       |    // prune_ref_by_selective_ref_frame()
 6136|       |    // Populating valid_refs[idx] = 1 ensures that
 6137|       |    // 'inter_cost_info_from_tpl.best_inter_cost' does not correspond to a
 6138|       |    // pruned ref frame.
 6139|  1.91M|    int valid_refs[INTER_REFS_PER_FRAME];
 6140|  15.3M|    for (MV_REFERENCE_FRAME frame = LAST_FRAME; frame < REF_FRAMES; frame++) {
  ------------------
  |  Branch (6140:49): [True: 13.4M, False: 1.91M]
  ------------------
 6141|  13.4M|      const MV_REFERENCE_FRAME refs[2] = { frame, NONE_FRAME };
 6142|  13.4M|      valid_refs[frame - 1] =
 6143|  13.4M|          x->tpl_keep_ref_frame[frame] ||
  ------------------
  |  Branch (6143:11): [True: 18.4E, False: 13.4M]
  ------------------
 6144|  13.4M|          !prune_ref_by_selective_ref_frame(
  ------------------
  |  Branch (6144:11): [True: 13.4M, False: 0]
  ------------------
 6145|  13.4M|              cpi, x, refs, cm->cur_frame->ref_display_order_hint);
 6146|  13.4M|    }
 6147|  1.91M|    av1_zero(inter_cost_info_from_tpl);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 6148|  1.91M|    get_block_level_tpl_stats(cpi, bsize, mi_row, mi_col, valid_refs,
 6149|  1.91M|                              &inter_cost_info_from_tpl);
 6150|  1.91M|  }
 6151|       |
 6152|  1.91M|  const int do_pruning =
 6153|  1.91M|      (AOMMIN(cm->width, cm->height) > 480 && cpi->speed <= 1) ? 0 : 1;
  ------------------
  |  |   34|  1.91M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 905k, False: 1.01M]
  |  |  ------------------
  ------------------
  |  Branch (6153:8): [True: 0, False: 1.91M]
  |  Branch (6153:47): [True: 0, False: 0]
  ------------------
 6154|  1.91M|  if (do_pruning && sf->intra_sf.skip_intra_in_interframe &&
  ------------------
  |  Branch (6154:7): [True: 1.91M, False: 74]
  |  Branch (6154:21): [True: 516k, False: 1.40M]
  ------------------
 6155|   516k|      cpi->oxcf.algo_cfg.enable_tpl_model)
  ------------------
  |  Branch (6155:7): [True: 0, False: 516k]
  ------------------
 6156|      0|    calculate_cost_from_tpl_data(cpi, x, bsize, mi_row, mi_col, &inter_cost,
 6157|      0|                                 &intra_cost);
 6158|  1.91M|#endif  // !CONFIG_REALTIME_ONLY
 6159|       |
 6160|       |  // Initialize best mode stats for winner mode processing.
 6161|  1.91M|  const int max_winner_mode_count =
 6162|  1.91M|      winner_mode_count_allowed[sf->winner_mode_sf.multi_winner_mode_type];
 6163|  1.91M|  zero_winner_mode_stats(bsize, max_winner_mode_count, x->winner_mode_stats);
 6164|  1.91M|  x->winner_mode_count = 0;
 6165|  1.91M|  store_winner_mode_stats(cpi, x, mbmi, NULL, NULL, NULL, THR_INVALID, NULL,
 6166|  1.91M|                          bsize, best_rd_so_far,
 6167|  1.91M|                          sf->winner_mode_sf.multi_winner_mode_type, 0);
 6168|       |
 6169|  1.91M|  int mode_thresh_mul_fact = (1 << MODE_THRESH_QBITS);
  ------------------
  |  |   83|  1.91M|#define MODE_THRESH_QBITS 12
  ------------------
 6170|  1.91M|  if (sf->inter_sf.prune_inter_modes_if_skippable) {
  ------------------
  |  Branch (6170:7): [True: 1.91M, False: 133]
  ------------------
 6171|       |    // Higher multiplication factor values for lower quantizers.
 6172|  1.91M|    mode_thresh_mul_fact = mode_threshold_mul_factor[x->qindex];
 6173|  1.91M|  }
 6174|       |
 6175|       |  // Initialize arguments for mode loop speed features
 6176|  1.91M|  InterModeSFArgs sf_args = { &args.skip_motion_mode,
 6177|  1.91M|                              &mode_skip_mask,
 6178|  1.91M|                              &search_state,
 6179|  1.91M|                              skip_ref_frame_mask,
 6180|  1.91M|                              0,
 6181|  1.91M|                              mode_thresh_mul_fact,
 6182|  1.91M|                              0,
 6183|  1.91M|                              0 };
 6184|  1.91M|  int64_t best_inter_yrd = INT64_MAX;
 6185|       |
 6186|       |  // This is the main loop of this function. It loops over all possible inter
 6187|       |  // modes and calls handle_inter_mode() to compute the RD for each.
 6188|       |  // Here midx is just an iterator index that should not be used by itself
 6189|       |  // except to keep track of the number of modes searched. It should be used
 6190|       |  // with av1_default_mode_order to get the enum that defines the mode, which
 6191|       |  // can be used with av1_mode_defs to get the prediction mode and the ref
 6192|       |  // frames.
 6193|       |  // TODO(yunqing, any): Setting mode_start and mode_end outside for-loop brings
 6194|       |  // good speedup for real time case. If we decide to use compound mode in real
 6195|       |  // time, maybe we can modify av1_default_mode_order table.
 6196|  1.91M|  THR_MODES mode_start = THR_INTER_MODE_START;
 6197|  1.91M|  THR_MODES mode_end = THR_INTER_MODE_END;
 6198|  1.91M|  const CurrentFrame *const current_frame = &cm->current_frame;
 6199|  1.91M|  if (current_frame->reference_mode == SINGLE_REFERENCE) {
  ------------------
  |  Branch (6199:7): [True: 0, False: 1.91M]
  ------------------
 6200|      0|    mode_start = SINGLE_REF_MODE_START;
 6201|      0|    mode_end = SINGLE_REF_MODE_END;
 6202|      0|  }
 6203|  1.91M|  init_comp_avg_est_rd(x, sf->inter_sf.skip_cmp_using_top_cmp_avg_est_rd_lvl);
 6204|   299M|  for (THR_MODES midx = mode_start; midx < mode_end; ++midx) {
  ------------------
  |  Branch (6204:37): [True: 298M, False: 1.91M]
  ------------------
 6205|       |    // Get the actual prediction mode we are trying in this iteration
 6206|   298M|    const THR_MODES mode_enum = av1_default_mode_order[midx];
 6207|   298M|    const MODE_DEFINITION *mode_def = &av1_mode_defs[mode_enum];
 6208|   298M|    const PREDICTION_MODE this_mode = mode_def->mode;
 6209|   298M|    const MV_REFERENCE_FRAME *ref_frames = mode_def->ref_frame;
 6210|       |
 6211|   298M|    const MV_REFERENCE_FRAME ref_frame = ref_frames[0];
 6212|   298M|    const MV_REFERENCE_FRAME second_ref_frame = ref_frames[1];
 6213|   298M|    const int is_single_pred =
 6214|   298M|        ref_frame > INTRA_FRAME && second_ref_frame == NONE_FRAME;
  ------------------
  |  Branch (6214:9): [True: 298M, False: 18.4E]
  |  Branch (6214:36): [True: 53.5M, False: 244M]
  ------------------
 6215|   298M|    const int comp_pred = second_ref_frame > INTRA_FRAME;
 6216|       |
 6217|   298M|    txfm_info->skip_txfm = 0;
 6218|   298M|    sf_args.num_single_modes_processed += is_single_pred;
 6219|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6220|       |    start_timing(cpi, skip_inter_mode_time);
 6221|       |#endif
 6222|       |    // Apply speed features to decide if this inter mode can be skipped
 6223|   298M|    const int is_skip_inter_mode = skip_inter_mode(
 6224|   298M|        cpi, x, bsize, ref_frame_rd, midx, &sf_args, is_low_temp_var);
 6225|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6226|       |    end_timing(cpi, skip_inter_mode_time);
 6227|       |#endif
 6228|   298M|    if (is_skip_inter_mode) continue;
  ------------------
  |  Branch (6228:9): [True: 291M, False: 6.91M]
  ------------------
 6229|       |
 6230|  6.91M|    init_mbmi(mbmi, this_mode, ref_frames, cm);
 6231|  6.91M|    set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
 6232|       |
 6233|       |    // Select prediction reference frames.
 6234|  20.8M|    for (i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (6234:17): [True: 13.9M, False: 6.91M]
  ------------------
 6235|  13.9M|      xd->plane[i].pre[0] = yv12_mb[ref_frame][i];
 6236|  13.9M|      if (comp_pred) xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i];
  ------------------
  |  Branch (6236:11): [True: 0, False: 13.9M]
  ------------------
 6237|  13.9M|    }
 6238|       |
 6239|  6.91M|    mbmi->angle_delta[PLANE_TYPE_Y] = 0;
 6240|  6.91M|    mbmi->angle_delta[PLANE_TYPE_UV] = 0;
 6241|  6.91M|    mbmi->filter_intra_mode_info.use_filter_intra = 0;
 6242|  6.91M|    mbmi->ref_mv_idx = 0;
 6243|       |
 6244|  6.91M|    const int64_t ref_best_rd = search_state.best_rd;
 6245|  6.91M|    RD_STATS rd_stats, rd_stats_y, rd_stats_uv;
 6246|  6.91M|    av1_init_rd_stats(&rd_stats);
 6247|       |
 6248|  6.91M|    const int ref_frame_cost = comp_pred
  ------------------
  |  Branch (6248:32): [True: 0, False: 6.91M]
  ------------------
 6249|  6.91M|                                   ? ref_costs_comp[ref_frame][second_ref_frame]
 6250|  6.91M|                                   : ref_costs_single[ref_frame];
 6251|  6.91M|    const int compmode_cost =
 6252|  6.91M|        is_comp_ref_allowed(mbmi->bsize) ? comp_inter_cost[comp_pred] : 0;
  ------------------
  |  Branch (6252:9): [True: 5.53M, False: 1.38M]
  ------------------
 6253|  6.91M|    const int real_compmode_cost =
 6254|  6.91M|        cm->current_frame.reference_mode == REFERENCE_MODE_SELECT
  ------------------
  |  Branch (6254:9): [True: 6.99M, False: 18.4E]
  ------------------
 6255|  6.99M|            ? compmode_cost
 6256|  18.4E|            : 0;
 6257|       |    // Point to variables that are maintained between loop iterations
 6258|  6.91M|    args.single_newmv = search_state.single_newmv;
 6259|  6.91M|    args.single_newmv_rate = search_state.single_newmv_rate;
 6260|  6.91M|    args.single_newmv_valid = search_state.single_newmv_valid;
 6261|  6.91M|    args.single_comp_cost = real_compmode_cost;
 6262|  6.91M|    args.ref_frame_cost = ref_frame_cost;
 6263|  6.91M|    args.best_pred_sse = search_state.best_pred_sse;
 6264|  6.91M|    args.skip_ifs = skip_interp_filter_search(cpi, is_single_pred);
 6265|  6.91M|    int64_t skip_rd[2] = { search_state.best_skip_rd[0],
 6266|  6.91M|                           search_state.best_skip_rd[1] };
 6267|  6.91M|    int64_t this_yrd = INT64_MAX;
 6268|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6269|       |    start_timing(cpi, handle_inter_mode_time);
 6270|       |#endif
 6271|  6.91M|    int64_t this_rd = handle_inter_mode(
 6272|  6.91M|        cpi, tile_data, x, bsize, &rd_stats, &rd_stats_y, &rd_stats_uv, &args,
 6273|  6.91M|        ref_best_rd, tmp_buf, &x->comp_rd_buffer, &best_est_rd, do_tx_search,
 6274|  6.91M|        inter_modes_info, &motion_mode_cand, skip_rd, &inter_cost_info_from_tpl,
 6275|  6.91M|        &this_yrd);
 6276|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6277|       |    end_timing(cpi, handle_inter_mode_time);
 6278|       |#endif
 6279|  6.99M|    if (current_frame->reference_mode != SINGLE_REFERENCE) {
  ------------------
  |  Branch (6279:9): [True: 6.99M, False: 18.4E]
  ------------------
 6280|  6.99M|      if (!args.skip_ifs &&
  ------------------
  |  Branch (6280:11): [True: 0, False: 6.99M]
  ------------------
 6281|      0|          sf->inter_sf.prune_comp_search_by_single_result > 0 &&
  ------------------
  |  Branch (6281:11): [True: 0, False: 0]
  ------------------
 6282|      0|          is_inter_singleref_mode(this_mode)) {
  ------------------
  |  Branch (6282:11): [True: 0, False: 0]
  ------------------
 6283|      0|        collect_single_states(x, &search_state, mbmi);
 6284|      0|      }
 6285|       |
 6286|  6.99M|      if (sf->inter_sf.prune_comp_using_best_single_mode_ref > 0 &&
  ------------------
  |  Branch (6286:11): [True: 6.99M, False: 107]
  ------------------
 6287|  6.99M|          is_inter_singleref_mode(this_mode))
  ------------------
  |  Branch (6287:11): [True: 6.99M, False: 18.4E]
  ------------------
 6288|  6.99M|        update_best_single_mode(&search_state, this_mode, ref_frame, this_rd);
 6289|  6.99M|    }
 6290|       |
 6291|  6.91M|    if (this_rd == INT64_MAX) continue;
  ------------------
  |  Branch (6291:9): [True: 3.23M, False: 3.68M]
  ------------------
 6292|       |
 6293|  3.68M|    if (mbmi->skip_txfm) {
  ------------------
  |  Branch (6293:9): [True: 378k, False: 3.30M]
  ------------------
 6294|   378k|      rd_stats_y.rate = 0;
 6295|   378k|      rd_stats_uv.rate = 0;
 6296|   378k|    }
 6297|       |
 6298|  3.75M|    if (sf->inter_sf.prune_compound_using_single_ref && is_single_pred &&
  ------------------
  |  Branch (6298:9): [True: 3.75M, False: 18.4E]
  |  Branch (6298:57): [True: 3.75M, False: 18.4E]
  ------------------
 6299|  3.75M|        this_rd < ref_frame_rd[ref_frame]) {
  ------------------
  |  Branch (6299:9): [True: 2.60M, False: 1.15M]
  ------------------
 6300|  2.60M|      ref_frame_rd[ref_frame] = this_rd;
 6301|  2.60M|    }
 6302|       |
 6303|  3.68M|    adjust_cost(cpi, x, &this_rd, /*is_inter_pred=*/true);
 6304|  3.68M|    adjust_rdcost(cpi, x, &rd_stats, /*is_inter_pred=*/true);
 6305|       |
 6306|       |    // Did this mode help, i.e., is it the new best mode
 6307|  3.68M|    if (this_rd < search_state.best_rd) {
  ------------------
  |  Branch (6307:9): [True: 2.56M, False: 1.12M]
  ------------------
 6308|  2.56M|      assert(IMPLIES(comp_pred,
 6309|  2.56M|                     cm->current_frame.reference_mode != SINGLE_REFERENCE));
 6310|  2.56M|      search_state.best_pred_sse = x->pred_sse[ref_frame];
 6311|  2.56M|      best_inter_yrd = this_yrd;
 6312|  2.56M|      update_search_state(cpi, &search_state, rd_cost, ctx, &rd_stats,
 6313|  2.56M|                          &rd_stats_y, &rd_stats_uv, mode_enum, x,
 6314|  2.56M|                          do_tx_search);
 6315|  2.56M|      if (do_tx_search) search_state.best_skip_rd[0] = skip_rd[0];
  ------------------
  |  Branch (6315:11): [True: 2.55M, False: 12.6k]
  ------------------
 6316|       |      // skip_rd[0] is the best total rd for a skip mode so far.
 6317|       |      // skip_rd[1] is the best total rd for a skip mode so far in luma.
 6318|       |      // When do_tx_search = 1, both skip_rd[0] and skip_rd[1] are updated.
 6319|       |      // When do_tx_search = 0, skip_rd[1] is updated.
 6320|  2.56M|      search_state.best_skip_rd[1] = skip_rd[1];
 6321|  2.56M|    }
 6322|  3.75M|    if (sf->winner_mode_sf.motion_mode_for_winner_cand) {
  ------------------
  |  Branch (6322:9): [True: 3.75M, False: 18.4E]
  ------------------
 6323|       |      // Add this mode to motion mode candidate list for motion mode search
 6324|       |      // if using motion_mode_for_winner_cand speed feature
 6325|  3.75M|      handle_winner_cand(mbmi, &best_motion_mode_cands,
 6326|  3.75M|                         max_winner_motion_mode_cand, this_rd,
 6327|  3.75M|                         &motion_mode_cand, args.skip_motion_mode);
 6328|  3.75M|    }
 6329|       |
 6330|       |    /* keep record of best compound/single-only prediction */
 6331|  3.68M|    record_best_compound(cm->current_frame.reference_mode, &rd_stats, comp_pred,
 6332|  3.68M|                         x->rdmult, &search_state, compmode_cost);
 6333|  3.68M|  }
 6334|       |
 6335|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6336|       |  start_timing(cpi, evaluate_motion_mode_for_winner_candidates_time);
 6337|       |#endif
 6338|  1.91M|  if (sf->winner_mode_sf.motion_mode_for_winner_cand) {
  ------------------
  |  Branch (6338:7): [True: 1.91M, False: 18.4E]
  ------------------
 6339|       |    // For the single ref winner candidates, evaluate other motion modes (non
 6340|       |    // simple translation).
 6341|  1.91M|    evaluate_motion_mode_for_winner_candidates(
 6342|  1.91M|        cpi, x, rd_cost, &args, tile_data, ctx, yv12_mb,
 6343|  1.91M|        &best_motion_mode_cands, do_tx_search, bsize, &best_est_rd,
 6344|  1.91M|        &search_state, &best_inter_yrd);
 6345|  1.91M|  }
 6346|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6347|       |  end_timing(cpi, evaluate_motion_mode_for_winner_candidates_time);
 6348|       |#endif
 6349|       |
 6350|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6351|       |  start_timing(cpi, do_tx_search_time);
 6352|       |#endif
 6353|  1.91M|  if (do_tx_search != 1) {
  ------------------
  |  Branch (6353:7): [True: 7.59k, False: 1.90M]
  ------------------
 6354|       |    // A full tx search has not yet been done, do tx search for
 6355|       |    // top mode candidates
 6356|  7.59k|    tx_search_best_inter_candidates(cpi, tile_data, x, best_rd_so_far, bsize,
 6357|  7.59k|                                    yv12_mb, mi_row, mi_col, &search_state,
 6358|  7.59k|                                    rd_cost, ctx, &best_inter_yrd);
 6359|  7.59k|  }
 6360|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6361|       |  end_timing(cpi, do_tx_search_time);
 6362|       |#endif
 6363|       |
 6364|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6365|       |  start_timing(cpi, handle_intra_mode_time);
 6366|       |#endif
 6367|       |  // Gate intra mode evaluation if best of inter is skip except when source
 6368|       |  // variance is extremely low and also based on max intra bsize.
 6369|  1.91M|  skip_intra_modes_in_interframe(cm, x, bsize, &search_state, sf, inter_cost,
 6370|  1.91M|                                 intra_cost);
 6371|       |
 6372|  1.91M|  const unsigned int intra_ref_frame_cost = ref_costs_single[INTRA_FRAME];
 6373|  1.91M|  search_intra_modes_in_interframe(&search_state, cpi, x, rd_cost, bsize, ctx,
 6374|  1.91M|                                   &sf_args, intra_ref_frame_cost,
 6375|  1.91M|                                   best_inter_yrd);
 6376|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6377|       |  end_timing(cpi, handle_intra_mode_time);
 6378|       |#endif
 6379|       |
 6380|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6381|       |  start_timing(cpi, refine_winner_mode_tx_time);
 6382|       |#endif
 6383|  1.91M|  int winner_mode_count =
 6384|  1.91M|      sf->winner_mode_sf.multi_winner_mode_type ? x->winner_mode_count : 1;
  ------------------
  |  Branch (6384:7): [True: 0, False: 1.91M]
  ------------------
 6385|       |  // In effect only when fast tx search speed features are enabled.
 6386|  1.91M|  refine_winner_mode_tx(
 6387|  1.91M|      cpi, x, rd_cost, bsize, ctx, &search_state.best_mode_index,
 6388|  1.91M|      &search_state.best_mbmode, yv12_mb, search_state.best_rate_y,
 6389|  1.91M|      search_state.best_rate_uv, &search_state.best_skip2, winner_mode_count);
 6390|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6391|       |  end_timing(cpi, refine_winner_mode_tx_time);
 6392|       |#endif
 6393|       |
 6394|       |  // Initialize default mode evaluation params
 6395|  1.91M|  set_mode_eval_params(cpi, x, DEFAULT_EVAL);
 6396|       |
 6397|       |  // Only try palette mode when the best mode so far is an intra mode.
 6398|  1.91M|  const int try_palette =
 6399|  1.91M|      cpi->oxcf.tool_cfg.enable_palette &&
  ------------------
  |  Branch (6399:7): [True: 1.91M, False: 18.4E]
  ------------------
 6400|  1.91M|      av1_allow_palette(features->allow_screen_content_tools, mbmi->bsize) &&
  ------------------
  |  Branch (6400:7): [True: 95.0k, False: 1.82M]
  ------------------
 6401|  95.0k|      !is_inter_mode(search_state.best_mbmode.mode) && rd_cost->rate != INT_MAX;
  ------------------
  |  Branch (6401:7): [True: 84.9k, False: 10.1k]
  |  Branch (6401:56): [True: 76.3k, False: 8.56k]
  ------------------
 6402|  1.91M|  RD_STATS this_rd_cost;
 6403|  1.91M|  int this_skippable = 0;
 6404|  1.91M|  if (try_palette) {
  ------------------
  |  Branch (6404:7): [True: 76.3k, False: 1.84M]
  ------------------
 6405|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6406|       |    start_timing(cpi, av1_search_palette_mode_time);
 6407|       |#endif
 6408|  76.3k|    this_skippable = av1_search_palette_mode(
 6409|  76.3k|        &search_state.intra_search_state, cpi, x, bsize, intra_ref_frame_cost,
 6410|  76.3k|        ctx, &this_rd_cost, search_state.best_rd);
 6411|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 6412|       |    end_timing(cpi, av1_search_palette_mode_time);
 6413|       |#endif
 6414|  76.3k|    if (this_rd_cost.rdcost < search_state.best_rd) {
  ------------------
  |  Branch (6414:9): [True: 48.9k, False: 27.3k]
  ------------------
 6415|  48.9k|      search_state.best_mode_index = THR_DC;
 6416|  48.9k|      mbmi->mv[0].as_int = 0;
 6417|  48.9k|      rd_cost->rate = this_rd_cost.rate;
 6418|  48.9k|      rd_cost->dist = this_rd_cost.dist;
 6419|  48.9k|      rd_cost->rdcost = this_rd_cost.rdcost;
 6420|  48.9k|      search_state.best_rd = rd_cost->rdcost;
 6421|  48.9k|      search_state.best_mbmode = *mbmi;
 6422|  48.9k|      search_state.best_skip2 = 0;
 6423|  48.9k|      search_state.best_mode_skippable = this_skippable;
 6424|  48.9k|      av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  48.9k|  do {                                                    \
  |  |   39|  48.9k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  48.9k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  48.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 48.9k]
  |  |  ------------------
  ------------------
 6425|  48.9k|    }
 6426|  76.3k|  }
 6427|       |
 6428|  1.91M|  search_state.best_mbmode.skip_mode = 0;
 6429|  1.91M|  if (cm->current_frame.skip_mode_info.skip_mode_flag &&
  ------------------
  |  Branch (6429:7): [True: 0, False: 1.91M]
  ------------------
 6430|      0|      cpi->oxcf.algo_cfg.sharpness != 3 && is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (6430:7): [True: 0, False: 0]
  |  Branch (6430:44): [True: 0, False: 0]
  ------------------
 6431|      0|    const struct segmentation *const seg = &cm->seg;
 6432|      0|    unsigned char segment_id = mbmi->segment_id;
 6433|      0|    if (!segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (6433:9): [True: 0, False: 0]
  ------------------
 6434|      0|      rd_pick_skip_mode(rd_cost, &search_state, cpi, x, bsize, yv12_mb);
 6435|      0|    }
 6436|      0|  }
 6437|       |
 6438|       |  // Make sure that the ref_mv_idx is only nonzero when we're
 6439|       |  // using a mode which can support ref_mv_idx
 6440|  1.91M|  if (search_state.best_mbmode.ref_mv_idx != 0 &&
  ------------------
  |  Branch (6440:7): [True: 18.2k, False: 1.89M]
  ------------------
 6441|  18.2k|      !(search_state.best_mbmode.mode == NEWMV ||
  ------------------
  |  Branch (6441:9): [True: 15.8k, False: 2.45k]
  ------------------
 6442|  2.45k|        search_state.best_mbmode.mode == NEW_NEWMV ||
  ------------------
  |  Branch (6442:9): [True: 0, False: 2.45k]
  ------------------
 6443|  2.45k|        have_nearmv_in_inter_mode(search_state.best_mbmode.mode))) {
  ------------------
  |  Branch (6443:9): [True: 2.45k, False: 0]
  ------------------
 6444|      0|    search_state.best_mbmode.ref_mv_idx = 0;
 6445|      0|  }
 6446|       |
 6447|  1.91M|  if (search_state.best_mode_index == THR_INVALID ||
  ------------------
  |  Branch (6447:7): [True: 149k, False: 1.76M]
  ------------------
 6448|  1.76M|      search_state.best_rd >= best_rd_so_far) {
  ------------------
  |  Branch (6448:7): [True: 18.4E, False: 1.76M]
  ------------------
 6449|   149k|    rd_cost->rate = INT_MAX;
 6450|   149k|    rd_cost->rdcost = INT64_MAX;
 6451|   149k|    return;
 6452|   149k|  }
 6453|       |
 6454|  1.76M|  const InterpFilter interp_filter = features->interp_filter;
 6455|  1.76M|  assert((interp_filter == SWITCHABLE) ||
 6456|  1.76M|         (interp_filter ==
 6457|  1.76M|          search_state.best_mbmode.interp_filters.as_filters.y_filter) ||
 6458|  1.76M|         !is_inter_block(&search_state.best_mbmode));
 6459|  1.76M|  assert((interp_filter == SWITCHABLE) ||
 6460|  1.76M|         (interp_filter ==
 6461|  1.76M|          search_state.best_mbmode.interp_filters.as_filters.x_filter) ||
 6462|  1.76M|         !is_inter_block(&search_state.best_mbmode));
 6463|       |
 6464|  1.76M|  if (!cpi->rc.is_src_frame_alt_ref && sf->inter_sf.adaptive_rd_thresh) {
  ------------------
  |  Branch (6464:7): [True: 1.76M, False: 18.4E]
  |  Branch (6464:40): [True: 1.76M, False: 18.4E]
  ------------------
 6465|  1.76M|    av1_update_rd_thresh_fact(
 6466|  1.76M|        cm, x->thresh_freq_fact, sf->inter_sf.adaptive_rd_thresh, bsize,
 6467|  1.76M|        search_state.best_mode_index, mode_start, mode_end, THR_DC, MAX_MODES);
 6468|  1.76M|  }
 6469|       |
 6470|       |  // macroblock modes
 6471|  1.76M|  *mbmi = search_state.best_mbmode;
 6472|  1.76M|  txfm_info->skip_txfm |= search_state.best_skip2;
 6473|       |
 6474|       |  // Note: this section is needed since the mode may have been forced to
 6475|       |  // GLOBALMV by the all-zero mode handling of ref-mv.
 6476|  1.76M|  if (mbmi->mode == GLOBALMV || mbmi->mode == GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (6476:7): [True: 18.4E, False: 1.76M]
  |  Branch (6476:33): [True: 18.4E, False: 1.76M]
  ------------------
 6477|       |    // Correct the interp filters for GLOBALMV
 6478|    279|    if (is_nontrans_global_motion(xd, xd->mi[0])) {
  ------------------
  |  Branch (6478:9): [True: 245, False: 34]
  ------------------
 6479|    245|      int_interpfilters filters =
 6480|    245|          av1_broadcast_interp_filter(av1_unswitchable_filter(interp_filter));
 6481|    245|      assert(mbmi->interp_filters.as_int == filters.as_int);
 6482|    245|      (void)filters;
 6483|    245|    }
 6484|    279|  }
 6485|       |
 6486|  1.76M|  txfm_info->skip_txfm |= search_state.best_mode_skippable;
 6487|       |
 6488|  1.76M|  assert(search_state.best_mode_index != THR_INVALID);
 6489|       |
 6490|       |#if CONFIG_INTERNAL_STATS
 6491|       |  store_coding_context(x, ctx, search_state.best_mode_index,
 6492|       |                       search_state.best_mode_skippable);
 6493|       |#else
 6494|  1.76M|  store_coding_context(x, ctx, search_state.best_mode_skippable);
 6495|  1.76M|#endif  // CONFIG_INTERNAL_STATS
 6496|       |
 6497|  1.76M|  if (mbmi->palette_mode_info.palette_size[1] > 0) {
  ------------------
  |  Branch (6497:7): [True: 28.0k, False: 1.73M]
  ------------------
 6498|       |    assert(try_palette);
 6499|  28.0k|    av1_restore_uv_color_map(cpi, x);
 6500|  28.0k|  }
 6501|  1.76M|}
rdopt.c:rd_pick_intrabc_mode_sb:
 3309|   439k|                                       int64_t best_rd) {
 3310|   439k|  const AV1_COMMON *const cm = &cpi->common;
 3311|   439k|  if (!av1_allow_intrabc(cm) || !cpi->oxcf.kf_cfg.enable_intrabc ||
  ------------------
  |  Branch (3311:7): [True: 367k, False: 72.2k]
  |  Branch (3311:33): [True: 0, False: 72.2k]
  ------------------
 3312|  72.2k|      !cpi->sf.mv_sf.use_intrabc ||
  ------------------
  |  Branch (3312:7): [True: 0, False: 72.2k]
  ------------------
 3313|  72.2k|      (cpi->sf.rt_sf.use_nonrd_pick_mode && !cpi->sf.rt_sf.rt_use_intrabc))
  ------------------
  |  Branch (3313:8): [True: 0, False: 72.2k]
  |  Branch (3313:45): [True: 0, False: 0]
  ------------------
 3314|   367k|    return INT64_MAX;
 3315|  72.2k|  if (cpi->sf.mv_sf.intrabc_search_level >= 1 && bsize != BLOCK_4X4 &&
  ------------------
  |  Branch (3315:7): [True: 0, False: 72.2k]
  |  Branch (3315:50): [True: 0, False: 0]
  ------------------
 3316|      0|      bsize != BLOCK_8X8 && bsize != BLOCK_16X16) {
  ------------------
  |  Branch (3316:7): [True: 0, False: 0]
  |  Branch (3316:29): [True: 0, False: 0]
  ------------------
 3317|      0|    return INT64_MAX;
 3318|      0|  }
 3319|  72.2k|  const int num_planes = av1_num_planes(cm);
 3320|       |
 3321|  72.2k|  MACROBLOCKD *const xd = &x->e_mbd;
 3322|  72.2k|  const TileInfo *tile = &xd->tile;
 3323|  72.2k|  MB_MODE_INFO *mbmi = xd->mi[0];
 3324|       |
 3325|  72.2k|  const int mi_row = xd->mi_row;
 3326|  72.2k|  const int mi_col = xd->mi_col;
 3327|  72.2k|  const int w = block_size_wide[bsize];
 3328|  72.2k|  const int h = block_size_high[bsize];
 3329|  72.2k|  const int sb_row = mi_row >> cm->seq_params->mib_size_log2;
 3330|  72.2k|  const int sb_col = mi_col >> cm->seq_params->mib_size_log2;
 3331|       |
 3332|  72.2k|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 3333|  72.2k|  const MV_REFERENCE_FRAME ref_frame = INTRA_FRAME;
 3334|  72.2k|  av1_find_mv_refs(cm, xd, mbmi, ref_frame, mbmi_ext->ref_mv_count,
 3335|  72.2k|                   xd->ref_mv_stack, xd->weight, NULL, mbmi_ext->global_mvs,
 3336|  72.2k|                   mbmi_ext->mode_context);
 3337|       |  // TODO(Ravi): Populate mbmi_ext->ref_mv_stack[ref_frame][4] and
 3338|       |  // mbmi_ext->weight[ref_frame][4] inside av1_find_mv_refs.
 3339|  72.2k|  av1_copy_usable_ref_mv_stack_and_weight(xd, mbmi_ext, ref_frame);
 3340|  72.2k|  int_mv nearestmv, nearmv;
 3341|  72.2k|  av1_find_best_ref_mvs_from_stack(0, mbmi_ext, ref_frame, &nearestmv, &nearmv,
 3342|  72.2k|                                   0);
 3343|       |
 3344|  72.2k|  if (nearestmv.as_int == INVALID_MV) {
  ------------------
  |  |   26|  72.2k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (3344:7): [True: 72.2k, False: 5]
  ------------------
 3345|  72.2k|    nearestmv.as_int = 0;
 3346|  72.2k|  }
 3347|  72.2k|  if (nearmv.as_int == INVALID_MV) {
  ------------------
  |  |   26|  72.2k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (3347:7): [True: 72.2k, False: 5]
  ------------------
 3348|  72.2k|    nearmv.as_int = 0;
 3349|  72.2k|  }
 3350|       |
 3351|  72.2k|  int_mv dv_ref = nearestmv.as_int == 0 ? nearmv : nearestmv;
  ------------------
  |  Branch (3351:19): [True: 72.2k, False: 3]
  ------------------
 3352|  72.2k|  if (dv_ref.as_int == 0) {
  ------------------
  |  Branch (3352:7): [True: 72.2k, False: 2]
  ------------------
 3353|  72.2k|    av1_find_ref_dv(&dv_ref, tile, cm->seq_params->mib_size, mi_row);
 3354|  72.2k|  }
 3355|       |  // Ref DV should not have sub-pel.
 3356|  72.2k|  assert((dv_ref.as_mv.col & 7) == 0);
 3357|  72.2k|  assert((dv_ref.as_mv.row & 7) == 0);
 3358|  72.2k|  mbmi_ext->ref_mv_stack[INTRA_FRAME][0].this_mv = dv_ref;
 3359|       |
 3360|  72.2k|  struct buf_2d yv12_mb[MAX_MB_PLANE];
 3361|  72.2k|  av1_setup_pred_block(xd, yv12_mb, xd->cur_buf, NULL, NULL, num_planes);
 3362|   254k|  for (int i = 0; i < num_planes; ++i) {
  ------------------
  |  Branch (3362:19): [True: 182k, False: 72.2k]
  ------------------
 3363|   182k|    xd->plane[i].pre[0] = yv12_mb[i];
 3364|   182k|  }
 3365|       |
 3366|  72.2k|  enum IntrabcMotionDirection {
 3367|  72.2k|    IBC_MOTION_ABOVE,
 3368|  72.2k|    IBC_MOTION_LEFT,
 3369|  72.2k|    IBC_MOTION_DIRECTIONS
 3370|  72.2k|  };
 3371|       |
 3372|  72.2k|  MB_MODE_INFO best_mbmi = *mbmi;
 3373|  72.2k|  RD_STATS best_rdstats = *rd_stats;
 3374|  72.2k|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 3375|  72.2k|  av1_copy_array(best_tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  72.2k|  do {                                                    \
  |  |   39|  72.2k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  72.2k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  72.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 72.2k]
  |  |  ------------------
  ------------------
 3376|       |
 3377|  72.2k|  FULLPEL_MOTION_SEARCH_PARAMS fullms_params;
 3378|  72.2k|  const SEARCH_METHODS search_method =
 3379|  72.2k|      av1_get_default_mv_search_method(x, &cpi->sf.mv_sf, bsize);
 3380|  72.2k|  const search_site_config *src_search_sites =
 3381|  72.2k|      av1_get_search_site_config(cpi, x, search_method);
 3382|  72.2k|  const FULLPEL_MV start_mv = get_fullmv_from_mv(&dv_ref.as_mv);
 3383|  72.2k|  av1_make_default_fullpel_ms_params(&fullms_params, cpi, x, bsize,
 3384|  72.2k|                                     &dv_ref.as_mv, start_mv, src_search_sites,
 3385|  72.2k|                                     search_method,
 3386|  72.2k|                                     /*fine_search_interval=*/0);
 3387|  72.2k|  const IntraBCMVCosts *const dv_costs = x->dv_costs;
 3388|  72.2k|  av1_set_ms_to_intra_mode(&fullms_params, dv_costs);
 3389|       |
 3390|  72.2k|  const enum IntrabcMotionDirection max_dir = cpi->sf.mv_sf.intrabc_search_level
  ------------------
  |  Branch (3390:47): [True: 0, False: 72.2k]
  ------------------
 3391|  72.2k|                                                  ? IBC_MOTION_LEFT
 3392|  72.2k|                                                  : IBC_MOTION_DIRECTIONS;
 3393|       |
 3394|   216k|  for (enum IntrabcMotionDirection dir = IBC_MOTION_ABOVE; dir < max_dir;
  ------------------
  |  Branch (3394:60): [True: 144k, False: 72.2k]
  ------------------
 3395|   144k|       ++dir) {
 3396|   144k|    switch (dir) {
 3397|  72.2k|      case IBC_MOTION_ABOVE:
  ------------------
  |  Branch (3397:7): [True: 72.2k, False: 72.2k]
  ------------------
 3398|  72.2k|        fullms_params.mv_limits.col_min =
 3399|  72.2k|            (tile->mi_col_start - mi_col) * MI_SIZE;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3400|  72.2k|        fullms_params.mv_limits.col_max =
 3401|  72.2k|            (tile->mi_col_end - mi_col) * MI_SIZE - w;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3402|  72.2k|        fullms_params.mv_limits.row_min =
 3403|  72.2k|            (tile->mi_row_start - mi_row) * MI_SIZE;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3404|  72.2k|        fullms_params.mv_limits.row_max =
 3405|  72.2k|            (sb_row * cm->seq_params->mib_size - mi_row) * MI_SIZE - h;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3406|  72.2k|        break;
 3407|  72.2k|      case IBC_MOTION_LEFT:
  ------------------
  |  Branch (3407:7): [True: 72.2k, False: 72.2k]
  ------------------
 3408|  72.2k|        fullms_params.mv_limits.col_min =
 3409|  72.2k|            (tile->mi_col_start - mi_col) * MI_SIZE;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3410|  72.2k|        fullms_params.mv_limits.col_max =
 3411|  72.2k|            (sb_col * cm->seq_params->mib_size - mi_col) * MI_SIZE - w;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3412|       |        // TODO(aconverse@google.com): Minimize the overlap between above and
 3413|       |        // left areas.
 3414|  72.2k|        fullms_params.mv_limits.row_min =
 3415|  72.2k|            (tile->mi_row_start - mi_row) * MI_SIZE;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3416|  72.2k|        int bottom_coded_mi_edge =
 3417|  72.2k|            AOMMIN((sb_row + 1) * cm->seq_params->mib_size, tile->mi_row_end);
  ------------------
  |  |   34|  72.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.63k, False: 69.5k]
  |  |  ------------------
  ------------------
 3418|  72.2k|        fullms_params.mv_limits.row_max =
 3419|  72.2k|            (bottom_coded_mi_edge - mi_row) * MI_SIZE - h;
  ------------------
  |  |   40|  72.2k|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  72.2k|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
 3420|  72.2k|        break;
 3421|      0|      default: assert(0);
  ------------------
  |  Branch (3421:7): [True: 0, False: 144k]
  ------------------
 3422|   144k|    }
 3423|   144k|    assert(fullms_params.mv_limits.col_min >= fullms_params.mv_limits.col_min);
 3424|   144k|    assert(fullms_params.mv_limits.col_max <= fullms_params.mv_limits.col_max);
 3425|   144k|    assert(fullms_params.mv_limits.row_min >= fullms_params.mv_limits.row_min);
 3426|   144k|    assert(fullms_params.mv_limits.row_max <= fullms_params.mv_limits.row_max);
 3427|       |
 3428|   144k|    av1_set_mv_search_range(&fullms_params.mv_limits, &dv_ref.as_mv);
 3429|       |
 3430|   144k|    if (fullms_params.mv_limits.col_max < fullms_params.mv_limits.col_min ||
  ------------------
  |  Branch (3430:9): [True: 18.4E, False: 144k]
  ------------------
 3431|   144k|        fullms_params.mv_limits.row_max < fullms_params.mv_limits.row_min) {
  ------------------
  |  Branch (3431:9): [True: 4, False: 144k]
  ------------------
 3432|      0|      continue;
 3433|      0|    }
 3434|       |
 3435|   144k|    const int step_param = cpi->mv_search_params.mv_step_param;
 3436|   144k|    IntraBCHashInfo *intrabc_hash_info = &x->intrabc_hash_info;
 3437|   144k|    int_mv best_mv;
 3438|   144k|    FULLPEL_MV_STATS best_mv_stats;
 3439|   144k|    int bestsme = INT_MAX;
 3440|       |
 3441|       |    // Perform a hash search first, and see if we get any matches.
 3442|   144k|    if (!cpi->sf.mv_sf.hash_max_8x8_intrabc_blocks || bsize <= BLOCK_8X8) {
  ------------------
  |  Branch (3442:9): [True: 144k, False: 0]
  |  Branch (3442:55): [True: 0, False: 0]
  ------------------
 3443|   144k|      bestsme = av1_intrabc_hash_search(cpi, xd, &fullms_params,
 3444|   144k|                                        intrabc_hash_info, &best_mv.as_fullmv);
 3445|   144k|    }
 3446|       |
 3447|       |    // If intrabc_search_level is not 0 and we found a hash search match, do
 3448|       |    // not proceed with pixel search as the hash match is very likely to be the
 3449|       |    // best intrabc candidate anyway.
 3450|   144k|    if (bestsme == INT_MAX || cpi->sf.mv_sf.intrabc_search_level == 0) {
  ------------------
  |  Branch (3450:9): [True: 144k, False: 0]
  |  Branch (3450:31): [True: 0, False: 0]
  ------------------
 3451|   144k|      int_mv best_pixel_mv;
 3452|   144k|      const int pixelsme =
 3453|   144k|          av1_full_pixel_search(start_mv, &fullms_params, step_param, NULL,
 3454|   144k|                                &best_pixel_mv.as_fullmv, &best_mv_stats, NULL);
 3455|   144k|      if (pixelsme < bestsme) {
  ------------------
  |  Branch (3455:11): [True: 144k, False: 13]
  ------------------
 3456|   144k|        bestsme = pixelsme;
 3457|   144k|        best_mv = best_pixel_mv;
 3458|   144k|      }
 3459|   144k|    }
 3460|   144k|    if (bestsme == INT_MAX) continue;
  ------------------
  |  Branch (3460:9): [True: 0, False: 144k]
  ------------------
 3461|   144k|    const MV dv = get_mv_from_fullmv(&best_mv.as_fullmv);
 3462|   144k|    if (!av1_is_fullmv_in_range(&fullms_params.mv_limits,
  ------------------
  |  Branch (3462:9): [True: 0, False: 144k]
  ------------------
 3463|   144k|                                get_fullmv_from_mv(&dv)))
 3464|      0|      continue;
 3465|   144k|    if (!av1_is_dv_valid(dv, cm, xd, mi_row, mi_col, bsize,
  ------------------
  |  Branch (3465:9): [True: 144k, False: 10]
  ------------------
 3466|   144k|                         cm->seq_params->mib_size_log2))
 3467|   144k|      continue;
 3468|       |
 3469|       |    // DV should not have sub-pel.
 3470|   144k|    assert((dv.col & 7) == 0);
 3471|     10|    assert((dv.row & 7) == 0);
 3472|     10|    memset(&mbmi->palette_mode_info, 0, sizeof(mbmi->palette_mode_info));
 3473|     10|    mbmi->filter_intra_mode_info.use_filter_intra = 0;
 3474|     10|    mbmi->use_intrabc = 1;
 3475|     10|    mbmi->mode = DC_PRED;
 3476|     10|    mbmi->uv_mode = UV_DC_PRED;
 3477|     10|    mbmi->motion_mode = SIMPLE_TRANSLATION;
 3478|     10|    mbmi->mv[0].as_mv = dv;
 3479|     10|    mbmi->interp_filters = av1_broadcast_interp_filter(BILINEAR);
 3480|     10|    mbmi->skip_txfm = 0;
 3481|     10|    av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize, 0,
 3482|     10|                                  av1_num_planes(cm) - 1);
 3483|       |
 3484|       |    // TODO(aconverse@google.com): The full motion field defining discount
 3485|       |    // in MV_COST_WEIGHT is too large. Explore other values.
 3486|     10|    const int rate_mv = av1_mv_bit_cost(&dv, &dv_ref.as_mv, dv_costs->joint_mv,
 3487|     10|                                        dv_costs->dv_costs, MV_COST_WEIGHT_SUB);
  ------------------
  |  |   47|     10|#define MV_COST_WEIGHT_SUB 120
  ------------------
 3488|     10|    const int rate_mode = x->mode_costs.intrabc_cost[1];
 3489|     10|    RD_STATS rd_stats_yuv, rd_stats_y, rd_stats_uv;
 3490|     10|    if (!av1_txfm_search(cpi, x, bsize, &rd_stats_yuv, &rd_stats_y,
  ------------------
  |  Branch (3490:9): [True: 0, False: 10]
  ------------------
 3491|     10|                         &rd_stats_uv, rate_mode + rate_mv, INT64_MAX))
 3492|      0|      continue;
 3493|     10|    rd_stats_yuv.rdcost =
 3494|     10|        RDCOST(x->rdmult, rd_stats_yuv.rate, rd_stats_yuv.dist);
  ------------------
  |  |   33|     10|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|     10|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|     10|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|     10|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3495|     10|    if (rd_stats_yuv.rdcost < best_rd) {
  ------------------
  |  Branch (3495:9): [True: 0, False: 10]
  ------------------
 3496|      0|      best_rd = rd_stats_yuv.rdcost;
 3497|      0|      best_mbmi = *mbmi;
 3498|      0|      best_rdstats = rd_stats_yuv;
 3499|      0|      av1_copy_array(best_tx_type_map, xd->tx_type_map, xd->height * xd->width);
  ------------------
  |  |   38|      0|  do {                                                    \
  |  |   39|      0|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|      0|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3500|      0|    }
 3501|     10|  }
 3502|  72.2k|  *mbmi = best_mbmi;
 3503|  72.2k|  *rd_stats = best_rdstats;
 3504|  72.2k|  av1_copy_array(xd->tx_type_map, best_tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  72.2k|  do {                                                    \
  |  |   39|  72.2k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  72.2k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  72.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 72.2k]
  |  |  ------------------
  ------------------
 3505|       |#if CONFIG_RD_DEBUG
 3506|       |  mbmi->rd_stats = *rd_stats;
 3507|       |#endif
 3508|  72.2k|  return best_rd;
 3509|  72.2k|}
rdopt.c:init_inter_mode_search_state:
 4390|  1.91M|    const MACROBLOCK *x, BLOCK_SIZE bsize, int64_t best_rd_so_far) {
 4391|  1.91M|  init_intra_mode_search_state(&search_state->intra_search_state);
 4392|  1.91M|  av1_invalid_rd_stats(&search_state->best_y_rdcost);
 4393|       |
 4394|  1.91M|  search_state->best_rd = best_rd_so_far;
 4395|  1.91M|  search_state->best_skip_rd[0] = INT64_MAX;
 4396|  1.91M|  search_state->best_skip_rd[1] = INT64_MAX;
 4397|       |
 4398|  1.91M|  av1_zero(search_state->best_mbmode);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4399|       |
 4400|  1.91M|  search_state->best_rate_y = INT_MAX;
 4401|       |
 4402|  1.91M|  search_state->best_rate_uv = INT_MAX;
 4403|       |
 4404|  1.91M|  search_state->best_mode_skippable = 0;
 4405|       |
 4406|  1.91M|  search_state->best_skip2 = 0;
 4407|       |
 4408|  1.91M|  search_state->best_mode_index = THR_INVALID;
 4409|       |
 4410|  1.91M|  const MACROBLOCKD *const xd = &x->e_mbd;
 4411|  1.91M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 4412|  1.91M|  const unsigned char segment_id = mbmi->segment_id;
 4413|       |
 4414|  1.91M|  search_state->num_available_refs = 0;
 4415|  1.91M|  memset(search_state->dist_refs, -1, sizeof(search_state->dist_refs));
 4416|  1.91M|  memset(search_state->dist_order_refs, -1,
 4417|  1.91M|         sizeof(search_state->dist_order_refs));
 4418|       |
 4419|  15.3M|  for (int i = 0; i <= LAST_NEW_MV_INDEX; ++i)
  ------------------
  |  |   78|  15.3M|#define LAST_NEW_MV_INDEX 6
  ------------------
  |  Branch (4419:19): [True: 13.4M, False: 1.91M]
  ------------------
 4420|  13.4M|    search_state->mode_threshold[i] = 0;
 4421|  1.91M|  const int *const rd_threshes = cpi->rd.threshes[segment_id][bsize];
 4422|  42.1M|  for (int i = LAST_NEW_MV_INDEX + 1; i < SINGLE_REF_MODE_END; ++i)
  ------------------
  |  |   78|  1.91M|#define LAST_NEW_MV_INDEX 6
  ------------------
  |  Branch (4422:39): [True: 40.2M, False: 1.91M]
  ------------------
 4423|  40.2M|    search_state->mode_threshold[i] =
 4424|  40.2M|        ((int64_t)rd_threshes[i] * x->thresh_freq_fact[bsize][i]) >>
 4425|  40.2M|        RD_THRESH_FAC_FRAC_BITS;
  ------------------
  |  |   51|  40.2M|#define RD_THRESH_FAC_FRAC_BITS (5)
  ------------------
 4426|       |
 4427|  1.91M|  search_state->best_intra_rd = INT64_MAX;
 4428|       |
 4429|  1.91M|  search_state->best_pred_sse = UINT_MAX;
 4430|       |
 4431|  1.91M|  av1_zero(search_state->single_newmv);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4432|  1.91M|  av1_zero(search_state->single_newmv_rate);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4433|  1.91M|  av1_zero(search_state->single_newmv_valid);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4434|  9.58M|  for (int i = SINGLE_INTER_MODE_START; i < SINGLE_INTER_MODE_END; ++i) {
  ------------------
  |  Branch (4434:41): [True: 7.67M, False: 1.91M]
  ------------------
 4435|  30.6M|    for (int j = 0; j < MAX_REF_MV_SEARCH; ++j) {
  ------------------
  |  |   25|  30.6M|#define MAX_REF_MV_SEARCH 3
  ------------------
  |  Branch (4435:21): [True: 23.0M, False: 7.67M]
  ------------------
 4436|   206M|      for (int ref_frame = 0; ref_frame < REF_FRAMES; ++ref_frame) {
  ------------------
  |  Branch (4436:31): [True: 183M, False: 23.0M]
  ------------------
 4437|   183M|        search_state->modelled_rd[i][j][ref_frame] = INT64_MAX;
 4438|   183M|        search_state->simple_rd[i][j][ref_frame] = INT64_MAX;
 4439|   183M|      }
 4440|  23.0M|    }
 4441|  7.67M|  }
 4442|       |
 4443|  7.67M|  for (int i = 0; i < REFERENCE_MODES; ++i) {
  ------------------
  |  Branch (4443:19): [True: 5.75M, False: 1.91M]
  ------------------
 4444|  5.75M|    search_state->best_pred_rd[i] = INT64_MAX;
 4445|  5.75M|  }
 4446|       |
 4447|  1.91M|  if (cpi->common.current_frame.reference_mode != SINGLE_REFERENCE) {
  ------------------
  |  Branch (4447:7): [True: 1.91M, False: 18.4E]
  ------------------
 4448|   247M|    for (int i = SINGLE_REF_MODE_END; i < THR_INTER_MODE_END; ++i)
  ------------------
  |  Branch (4448:39): [True: 245M, False: 1.91M]
  ------------------
 4449|   245M|      search_state->mode_threshold[i] =
 4450|   245M|          ((int64_t)rd_threshes[i] * x->thresh_freq_fact[bsize][i]) >>
 4451|   245M|          RD_THRESH_FAC_FRAC_BITS;
  ------------------
  |  |   51|   245M|#define RD_THRESH_FAC_FRAC_BITS (5)
  ------------------
 4452|       |
 4453|  17.2M|    for (int i = COMP_INTER_MODE_START; i < COMP_INTER_MODE_END; ++i) {
  ------------------
  |  Branch (4453:41): [True: 15.3M, False: 1.91M]
  ------------------
 4454|  61.3M|      for (int j = 0; j < MAX_REF_MV_SEARCH; ++j) {
  ------------------
  |  |   25|  61.3M|#define MAX_REF_MV_SEARCH 3
  ------------------
  |  Branch (4454:23): [True: 45.9M, False: 15.3M]
  ------------------
 4455|   413M|        for (int ref_frame = 0; ref_frame < REF_FRAMES; ++ref_frame) {
  ------------------
  |  Branch (4455:33): [True: 367M, False: 45.9M]
  ------------------
 4456|   367M|          search_state->modelled_rd[i][j][ref_frame] = INT64_MAX;
 4457|   367M|          search_state->simple_rd[i][j][ref_frame] = INT64_MAX;
 4458|   367M|        }
 4459|  45.9M|      }
 4460|  15.3M|    }
 4461|       |
 4462|  1.91M|    init_single_inter_mode_search_state(search_state);
 4463|  1.91M|  }
 4464|  1.91M|}
rdopt.c:init_single_inter_mode_search_state:
 4361|  1.91M|    InterModeSearchState *search_state) {
 4362|  5.75M|  for (int dir = 0; dir < 2; ++dir) {
  ------------------
  |  Branch (4362:21): [True: 3.83M, False: 1.91M]
  ------------------
 4363|  19.1M|    for (int mode = 0; mode < SINGLE_INTER_MODE_NUM; ++mode) {
  ------------------
  |  Branch (4363:24): [True: 15.3M, False: 3.83M]
  ------------------
 4364|  76.7M|      for (int ref_frame = 0; ref_frame < FWD_REFS; ++ref_frame) {
  ------------------
  |  Branch (4364:31): [True: 61.3M, False: 15.3M]
  ------------------
 4365|  61.3M|        SingleInterModeState *state;
 4366|       |
 4367|  61.3M|        state = &search_state->single_state[dir][mode][ref_frame];
 4368|  61.3M|        state->ref_frame = NONE_FRAME;
 4369|  61.3M|        state->rd = INT64_MAX;
 4370|       |
 4371|  61.3M|        state = &search_state->single_state_modelled[dir][mode][ref_frame];
 4372|  61.3M|        state->ref_frame = NONE_FRAME;
 4373|  61.3M|        state->rd = INT64_MAX;
 4374|       |
 4375|  61.3M|        search_state->single_rd_order[dir][mode][ref_frame] = NONE_FRAME;
 4376|  61.3M|      }
 4377|  15.3M|    }
 4378|  3.83M|  }
 4379|       |
 4380|  17.2M|  for (int ref_frame = 0; ref_frame < REF_FRAMES; ++ref_frame) {
  ------------------
  |  Branch (4380:27): [True: 15.3M, False: 1.91M]
  ------------------
 4381|  15.3M|    search_state->best_single_rd[ref_frame] = INT64_MAX;
 4382|  15.3M|    search_state->best_single_mode[ref_frame] = PRED_MODE_INVALID;
 4383|  15.3M|  }
 4384|  1.91M|  av1_zero(search_state->single_state_cnt);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4385|  1.91M|  av1_zero(search_state->single_state_modelled_cnt);
  ------------------
  |  |   43|  1.91M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 4386|  1.91M|}
rdopt.c:init_top_tx_no_split_rd_for_inter_modes:
 5832|  1.91M|    MACROBLOCK *x, int prune_inter_tx_split_rd_eval_lvl) {
 5833|  1.91M|  if (!prune_inter_tx_split_rd_eval_lvl) return;
  ------------------
  |  Branch (5833:7): [True: 0, False: 1.91M]
  ------------------
 5834|       |
 5835|  9.59M|  for (int i = 0; i < MAX_TX_BLOCKS_IN_MAX_SB; i++) {
  ------------------
  |  |  202|  9.59M|#define MAX_TX_BLOCKS_IN_MAX_SB (1 << MAX_TX_BLOCKS_IN_MAX_SB_LOG2)
  |  |  ------------------
  |  |  |  |  201|  9.59M|#define MAX_TX_BLOCKS_IN_MAX_SB_LOG2 ((MAX_SB_SIZE_LOG2 - MAX_TX_SIZE_LOG2) * 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  9.59M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_TX_BLOCKS_IN_MAX_SB_LOG2 ((MAX_SB_SIZE_LOG2 - MAX_TX_SIZE_LOG2) * 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  9.59M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5835:19): [True: 7.67M, False: 1.91M]
  ------------------
 5836|  38.3M|    for (int j = 0; j < TOP_INTER_TX_NO_SPLIT_COUNT; j++) {
  ------------------
  |  |   47|  38.3M|#define TOP_INTER_TX_NO_SPLIT_COUNT 4
  ------------------
  |  Branch (5836:21): [True: 30.6M, False: 7.67M]
  ------------------
 5837|       |      x->top_inter_tx_no_split_rd[i][j] = INT64_MAX;
 5838|  30.6M|    }
 5839|  7.67M|  }
 5840|  1.91M|}
rdopt.c:get_block_temp_var:
 5966|  1.91M|                                     BLOCK_SIZE bsize) {
 5967|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 5968|  1.91M|  const SPEED_FEATURES *const sf = &cpi->sf;
 5969|       |
 5970|  1.91M|  if (sf->part_sf.partition_search_type != VAR_BASED_PARTITION ||
  ------------------
  |  Branch (5970:7): [True: 1.91M, False: 0]
  ------------------
 5971|      0|      !sf->rt_sf.short_circuit_low_temp_var ||
  ------------------
  |  Branch (5971:7): [True: 0, False: 0]
  ------------------
 5972|  1.91M|      !sf->rt_sf.prune_inter_modes_using_temp_var) {
  ------------------
  |  Branch (5972:7): [True: 0, False: 0]
  ------------------
 5973|  1.91M|    return 0;
 5974|  1.91M|  }
 5975|       |
 5976|  18.4E|  const int mi_row = x->e_mbd.mi_row;
 5977|  18.4E|  const int mi_col = x->e_mbd.mi_col;
 5978|  18.4E|  int is_low_temp_var = 0;
 5979|       |
 5980|  18.4E|  if (cm->seq_params->sb_size == BLOCK_64X64)
  ------------------
  |  Branch (5980:7): [True: 0, False: 18.4E]
  ------------------
 5981|      0|    is_low_temp_var = av1_get_force_skip_low_temp_var_small_sb(
 5982|      0|        &x->part_search_info.variance_low[0], mi_row, mi_col, bsize);
 5983|  18.4E|  else
 5984|  18.4E|    is_low_temp_var = av1_get_force_skip_low_temp_var(
 5985|  18.4E|        &x->part_search_info.variance_low[0], mi_row, mi_col, bsize);
 5986|       |
 5987|  18.4E|  return is_low_temp_var;
 5988|  1.91M|}
rdopt.c:fetch_picked_ref_frames_mask:
 4509|  15.4k|                                        BLOCK_SIZE bsize, int mib_size) {
 4510|  15.4k|  const int sb_size_mask = mib_size - 1;
 4511|  15.4k|  const MACROBLOCKD *const xd = &x->e_mbd;
 4512|  15.4k|  const int mi_row = xd->mi_row;
 4513|  15.4k|  const int mi_col = xd->mi_col;
 4514|  15.4k|  const int mi_row_in_sb = mi_row & sb_size_mask;
 4515|  15.4k|  const int mi_col_in_sb = mi_col & sb_size_mask;
 4516|  15.4k|  const int mi_w = mi_size_wide[bsize];
 4517|  15.4k|  const int mi_h = mi_size_high[bsize];
 4518|  15.4k|  int picked_ref_frames_mask = 0;
 4519|  79.1k|  for (int i = mi_row_in_sb; i < mi_row_in_sb + mi_h; ++i) {
  ------------------
  |  Branch (4519:30): [True: 63.6k, False: 15.4k]
  ------------------
 4520|   210k|    for (int j = mi_col_in_sb; j < mi_col_in_sb + mi_w; ++j) {
  ------------------
  |  Branch (4520:32): [True: 146k, False: 63.6k]
  ------------------
 4521|   146k|      picked_ref_frames_mask |= x->picked_ref_frames_mask[i * 32 + j];
 4522|   146k|    }
 4523|  63.6k|  }
 4524|  15.4k|  return picked_ref_frames_mask;
 4525|  15.4k|}
rdopt.c:set_params_rd_pick_inter_mode:
 4230|  1.91M|    struct buf_2d (*yv12_mb)[MAX_MB_PLANE]) {
 4231|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 4232|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 4233|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 4234|  1.91M|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 4235|  1.91M|  unsigned char segment_id = mbmi->segment_id;
 4236|       |
 4237|  1.91M|  init_neighbor_pred_buf(&x->obmc_buffer, args, is_cur_buf_hbd(&x->e_mbd));
 4238|  1.91M|  av1_collect_neighbors_ref_counts(xd);
 4239|  1.91M|  estimate_ref_frame_costs(cm, xd, &x->mode_costs, segment_id, ref_costs_single,
 4240|  1.91M|                           ref_costs_comp);
 4241|       |
 4242|  1.91M|  const int mi_row = xd->mi_row;
 4243|  1.91M|  const int mi_col = xd->mi_col;
 4244|  1.91M|  x->best_pred_mv_sad[0] = INT_MAX;
 4245|  1.91M|  x->best_pred_mv_sad[1] = INT_MAX;
 4246|       |
 4247|  15.3M|  for (MV_REFERENCE_FRAME ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME;
  ------------------
  |  Branch (4247:51): [True: 13.4M, False: 1.91M]
  ------------------
 4248|  13.4M|       ++ref_frame) {
 4249|  13.4M|    x->pred_mv_sad[ref_frame] = INT_MAX;
 4250|  13.4M|    mbmi_ext->mode_context[ref_frame] = 0;
 4251|  13.4M|    mbmi_ext->ref_mv_count[ref_frame] = UINT8_MAX;
 4252|  13.4M|    if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
  ------------------
  |  Branch (4252:9): [True: 1.91M, False: 11.5M]
  ------------------
 4253|       |      // Skip the ref frame if the mask says skip and the ref is not used by
 4254|       |      // compound ref.
 4255|  1.91M|      if (skip_ref_frame_mask & (1 << ref_frame) &&
  ------------------
  |  Branch (4255:11): [True: 6.67k, False: 1.91M]
  ------------------
 4256|  6.67k|          !is_ref_frame_used_by_compound_ref(ref_frame, skip_ref_frame_mask) &&
  ------------------
  |  Branch (4256:11): [True: 6.67k, False: 0]
  ------------------
 4257|  6.67k|          !is_ref_frame_used_in_cache(ref_frame, x->mb_mode_cache)) {
  ------------------
  |  Branch (4257:11): [True: 6.67k, False: 0]
  ------------------
 4258|  6.67k|        continue;
 4259|  6.67k|      }
 4260|  1.91M|      assert(get_ref_frame_yv12_buf(cm, ref_frame) != NULL);
 4261|  1.91M|      setup_buffer_ref_mvs_inter(cpi, x, ref_frame, bsize, yv12_mb);
 4262|  1.91M|    }
 4263|  13.4M|    if (cpi->sf.inter_sf.alt_ref_search_fp ||
  ------------------
  |  Branch (4263:9): [True: 13.4M, False: 0]
  ------------------
 4264|      0|        cpi->sf.inter_sf.prune_single_ref ||
  ------------------
  |  Branch (4264:9): [True: 0, False: 0]
  ------------------
 4265|  13.4M|        cpi->sf.rt_sf.prune_inter_modes_wrt_gf_arf_based_on_sad) {
  ------------------
  |  Branch (4265:9): [True: 0, False: 0]
  ------------------
 4266|       |      // Store the best pred_mv_sad across all past frames
 4267|  13.4M|      if (cpi->ref_frame_dist_info.ref_relative_dist[ref_frame - LAST_FRAME] <
  ------------------
  |  Branch (4267:11): [True: 1.91M, False: 11.5M]
  ------------------
 4268|  13.4M|          0)
 4269|  1.91M|        x->best_pred_mv_sad[0] =
 4270|  1.91M|            AOMMIN(x->best_pred_mv_sad[0], x->pred_mv_sad[ref_frame]);
  ------------------
  |  |   34|  1.91M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.91M]
  |  |  ------------------
  ------------------
 4271|  11.5M|      else
 4272|       |        // Store the best pred_mv_sad across all future frames
 4273|  11.5M|        x->best_pred_mv_sad[1] =
 4274|  11.5M|            AOMMIN(x->best_pred_mv_sad[1], x->pred_mv_sad[ref_frame]);
  ------------------
  |  |   34|  11.5M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 11.5M]
  |  |  ------------------
  ------------------
 4275|  13.4M|    }
 4276|  13.4M|  }
 4277|       |
 4278|  1.91M|  if (!cpi->sf.rt_sf.use_real_time_ref_set && is_comp_ref_allowed(bsize)) {
  ------------------
  |  Branch (4278:7): [True: 1.91M, False: 18.4E]
  |  Branch (4278:47): [True: 1.52M, False: 396k]
  ------------------
 4279|       |    // No second reference on RT ref set, so no need to initialize
 4280|  1.52M|    for (MV_REFERENCE_FRAME ref_frame = EXTREF_FRAME;
 4281|  33.4M|         ref_frame < MODE_CTX_REF_FRAMES; ++ref_frame) {
  ------------------
  |  |  598|  33.4M|#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
  |  |  ------------------
  |  |  |  |  591|  33.4M|#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
  |  |  ------------------
  ------------------
  |  Branch (4281:10): [True: 31.9M, False: 1.52M]
  ------------------
 4282|  31.9M|      mbmi_ext->mode_context[ref_frame] = 0;
 4283|  31.9M|      mbmi_ext->ref_mv_count[ref_frame] = UINT8_MAX;
 4284|  31.9M|      const MV_REFERENCE_FRAME *rf = ref_frame_map[ref_frame - REF_FRAMES];
 4285|  31.9M|      if (!((cpi->ref_frame_flags & av1_ref_frame_flag_list[rf[0]]) &&
  ------------------
  |  Branch (4285:13): [True: 9.13M, False: 22.8M]
  ------------------
 4286|  31.9M|            (cpi->ref_frame_flags & av1_ref_frame_flag_list[rf[1]]))) {
  ------------------
  |  Branch (4286:13): [True: 0, False: 9.13M]
  ------------------
 4287|  31.9M|        continue;
 4288|  31.9M|      }
 4289|       |
 4290|  2.38k|      if (skip_ref_frame_mask & (1 << ref_frame) &&
  ------------------
  |  Branch (4290:11): [True: 0, False: 2.38k]
  ------------------
 4291|      0|          !is_ref_frame_used_in_cache(ref_frame, x->mb_mode_cache)) {
  ------------------
  |  Branch (4291:11): [True: 0, False: 0]
  ------------------
 4292|      0|        continue;
 4293|      0|      }
 4294|       |      // Ref mv list population is not required, when compound references are
 4295|       |      // pruned.
 4296|  2.38k|      if (prune_ref_frame(cpi, x, ref_frame)) continue;
  ------------------
  |  Branch (4296:11): [True: 0, False: 2.38k]
  ------------------
 4297|       |
 4298|  2.38k|      av1_find_mv_refs(cm, xd, mbmi, ref_frame, mbmi_ext->ref_mv_count,
 4299|  2.38k|                       xd->ref_mv_stack, xd->weight, NULL, mbmi_ext->global_mvs,
 4300|  2.38k|                       mbmi_ext->mode_context);
 4301|       |      // TODO(Ravi): Populate mbmi_ext->ref_mv_stack[ref_frame][4] and
 4302|       |      // mbmi_ext->weight[ref_frame][4] inside av1_find_mv_refs.
 4303|  2.38k|      av1_copy_usable_ref_mv_stack_and_weight(xd, mbmi_ext, ref_frame);
 4304|  2.38k|    }
 4305|  1.52M|  }
 4306|       |
 4307|  1.91M|  av1_count_overlappable_neighbors(cm, xd);
 4308|  1.91M|  const FRAME_UPDATE_TYPE update_type =
 4309|  1.91M|      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 4310|  1.91M|  int use_actual_frame_probs = 1;
 4311|  1.91M|  int prune_obmc;
 4312|       |#if CONFIG_FPMT_TEST
 4313|       |  use_actual_frame_probs =
 4314|       |      (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
 4315|       |  if (!use_actual_frame_probs) {
 4316|       |    prune_obmc = cpi->ppi->temp_frame_probs.obmc_probs[update_type][bsize] <
 4317|       |                 cpi->sf.inter_sf.prune_obmc_prob_thresh;
 4318|       |  }
 4319|       |#endif
 4320|  1.91M|  if (use_actual_frame_probs) {
  ------------------
  |  Branch (4320:7): [True: 1.91M, False: 18.4E]
  ------------------
 4321|  1.91M|    prune_obmc = cpi->ppi->frame_probs.obmc_probs[update_type][bsize] <
 4322|  1.91M|                 cpi->sf.inter_sf.prune_obmc_prob_thresh;
 4323|  1.91M|  }
 4324|  1.91M|  if (cpi->oxcf.motion_mode_cfg.enable_obmc && !prune_obmc) {
  ------------------
  |  Branch (4324:7): [True: 1.91M, False: 18.4E]
  |  Branch (4324:48): [True: 0, False: 1.91M]
  ------------------
 4325|      0|    if (check_num_overlappable_neighbors(mbmi) &&
  ------------------
  |  Branch (4325:9): [True: 0, False: 0]
  ------------------
 4326|      0|        is_motion_variation_allowed_bsize(bsize)) {
  ------------------
  |  Branch (4326:9): [True: 0, False: 0]
  ------------------
 4327|      0|      int dst_width1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_width1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_width1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4328|      0|      int dst_width2[MAX_MB_PLANE] = { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_width2[MAX_MB_PLANE] = { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4329|      0|                                       MAX_SB_SIZE >> 1 };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4330|      0|      int dst_height1[MAX_MB_PLANE] = { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_height1[MAX_MB_PLANE] = { MAX_SB_SIZE >> 1, MAX_SB_SIZE >> 1,
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4331|      0|                                        MAX_SB_SIZE >> 1 };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4332|      0|      int dst_height2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_height2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                    int dst_height2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 4333|      0|      av1_build_prediction_by_above_preds(cm, xd, args->above_pred_buf,
 4334|      0|                                          dst_width1, dst_height1,
 4335|      0|                                          args->above_pred_stride);
 4336|      0|      av1_build_prediction_by_left_preds(cm, xd, args->left_pred_buf,
 4337|      0|                                         dst_width2, dst_height2,
 4338|      0|                                         args->left_pred_stride);
 4339|      0|      const int num_planes = av1_num_planes(cm);
 4340|      0|      av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row,
 4341|      0|                           mi_col, 0, num_planes);
 4342|      0|      calc_target_weighted_pred(
 4343|      0|          cm, x, xd, args->above_pred_buf[0], args->above_pred_stride[0],
 4344|      0|          args->left_pred_buf[0], args->left_pred_stride[0]);
 4345|      0|    }
 4346|      0|  }
 4347|       |
 4348|  1.91M|  init_mode_skip_mask(mode_skip_mask, cpi, x, bsize);
 4349|       |
 4350|       |  // Set params for mode evaluation
 4351|  1.91M|  set_mode_eval_params(cpi, x, MODE_EVAL);
 4352|       |
 4353|  1.91M|  x->comp_rd_stats_idx = 0;
 4354|       |
 4355|  17.2M|  for (int idx = 0; idx < REF_FRAMES; idx++) {
  ------------------
  |  Branch (4355:21): [True: 15.3M, False: 1.91M]
  ------------------
 4356|       |    args->best_single_sse_in_refs[idx] = INT32_MAX;
 4357|  15.3M|  }
 4358|  1.91M|}
rdopt.c:init_neighbor_pred_buf:
 4156|  1.91M|                                          int is_hbd) {
 4157|  1.91M|  if (is_hbd) {
  ------------------
  |  Branch (4157:7): [True: 596k, False: 1.32M]
  ------------------
 4158|   596k|    const int len = sizeof(uint16_t);
 4159|   596k|    args->above_pred_buf[0] = CONVERT_TO_BYTEPTR(obmc_buffer->above_pred);
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4160|   596k|    args->above_pred_buf[1] = CONVERT_TO_BYTEPTR(obmc_buffer->above_pred +
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4161|   596k|                                                 (MAX_SB_SQUARE >> 1) * len);
 4162|   596k|    args->above_pred_buf[2] =
 4163|   596k|        CONVERT_TO_BYTEPTR(obmc_buffer->above_pred + MAX_SB_SQUARE * len);
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4164|   596k|    args->left_pred_buf[0] = CONVERT_TO_BYTEPTR(obmc_buffer->left_pred);
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4165|   596k|    args->left_pred_buf[1] =
 4166|   596k|        CONVERT_TO_BYTEPTR(obmc_buffer->left_pred + (MAX_SB_SQUARE >> 1) * len);
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4167|   596k|    args->left_pred_buf[2] =
 4168|   596k|        CONVERT_TO_BYTEPTR(obmc_buffer->left_pred + MAX_SB_SQUARE * len);
  ------------------
  |  |   80|   596k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 4169|  1.32M|  } else {
 4170|  1.32M|    args->above_pred_buf[0] = obmc_buffer->above_pred;
 4171|  1.32M|    args->above_pred_buf[1] = obmc_buffer->above_pred + (MAX_SB_SQUARE >> 1);
  ------------------
  |  |   33|  1.32M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4172|  1.32M|    args->above_pred_buf[2] = obmc_buffer->above_pred + MAX_SB_SQUARE;
  ------------------
  |  |   33|  1.32M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4173|  1.32M|    args->left_pred_buf[0] = obmc_buffer->left_pred;
 4174|  1.32M|    args->left_pred_buf[1] = obmc_buffer->left_pred + (MAX_SB_SQUARE >> 1);
  ------------------
  |  |   33|  1.32M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4175|  1.32M|    args->left_pred_buf[2] = obmc_buffer->left_pred + MAX_SB_SQUARE;
  ------------------
  |  |   33|  1.32M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  1.32M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  1.32M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4176|  1.32M|  }
 4177|  1.91M|}
rdopt.c:is_ref_frame_used_by_compound_ref:
 4196|  33.3k|                                                    int skip_ref_frame_mask) {
 4197|   733k|  for (int r = ALTREF_FRAME + 1; r < MODE_CTX_REF_FRAMES; ++r) {
  ------------------
  |  |  598|   733k|#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
  |  |  ------------------
  |  |  |  |  591|   733k|#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
  |  |  ------------------
  ------------------
  |  Branch (4197:34): [True: 700k, False: 33.3k]
  ------------------
 4198|   700k|    if (!(skip_ref_frame_mask & (1 << r))) {
  ------------------
  |  Branch (4198:9): [True: 0, False: 700k]
  ------------------
 4199|      0|      const MV_REFERENCE_FRAME *rf = ref_frame_map[r - REF_FRAMES];
 4200|      0|      if (rf[0] == ref_frame || rf[1] == ref_frame) {
  ------------------
  |  Branch (4200:11): [True: 0, False: 0]
  |  Branch (4200:33): [True: 0, False: 0]
  ------------------
 4201|      0|        return 1;
 4202|      0|      }
 4203|      0|    }
 4204|   700k|  }
 4205|  33.3k|  return 0;
 4206|  33.3k|}
rdopt.c:is_ref_frame_used_in_cache:
 4209|   527k|                                             const MB_MODE_INFO *mi_cache) {
 4210|   527k|  if (!mi_cache) {
  ------------------
  |  Branch (4210:7): [True: 527k, False: 18.4E]
  ------------------
 4211|   527k|    return 0;
 4212|   527k|  }
 4213|       |
 4214|  18.4E|  if (ref_frame < REF_FRAMES) {
  ------------------
  |  Branch (4214:7): [True: 0, False: 18.4E]
  ------------------
 4215|      0|    return (ref_frame == mi_cache->ref_frame[0] ||
  ------------------
  |  Branch (4215:13): [True: 0, False: 0]
  ------------------
 4216|      0|            ref_frame == mi_cache->ref_frame[1]);
  ------------------
  |  Branch (4216:13): [True: 0, False: 0]
  ------------------
 4217|      0|  }
 4218|       |
 4219|       |  // if we are here, then the current mode is compound.
 4220|  18.4E|  MV_REFERENCE_FRAME cached_ref_type = av1_ref_frame_type(mi_cache->ref_frame);
 4221|  18.4E|  return ref_frame == cached_ref_type;
 4222|  18.4E|}
rdopt.c:setup_buffer_ref_mvs_inter:
 1049|  1.91M|    BLOCK_SIZE block_size, struct buf_2d yv12_mb[REF_FRAMES][MAX_MB_PLANE]) {
 1050|  1.91M|  const AV1_COMMON *cm = &cpi->common;
 1051|  1.91M|  const int num_planes = av1_num_planes(cm);
 1052|  1.91M|  const YV12_BUFFER_CONFIG *scaled_ref_frame =
 1053|  1.91M|      av1_get_scaled_ref_frame(cpi, ref_frame);
 1054|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 1055|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1056|  1.91M|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 1057|  1.91M|  const struct scale_factors *const sf =
 1058|  1.91M|      get_ref_scale_factors_const(cm, ref_frame);
 1059|  1.91M|  const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_yv12_buf(cm, ref_frame);
 1060|  1.91M|  assert(yv12 != NULL);
 1061|       |
 1062|  1.91M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (1062:7): [True: 1.69M, False: 219k]
  ------------------
 1063|       |    // Setup pred block based on scaled reference, because av1_mv_pred() doesn't
 1064|       |    // support scaling.
 1065|  1.69M|    av1_setup_pred_block(xd, yv12_mb[ref_frame], scaled_ref_frame, NULL, NULL,
 1066|  1.69M|                         num_planes);
 1067|  1.69M|  } else {
 1068|   219k|    av1_setup_pred_block(xd, yv12_mb[ref_frame], yv12, sf, sf, num_planes);
 1069|   219k|  }
 1070|       |
 1071|       |  // Gets an initial list of candidate vectors from neighbours and orders them
 1072|  1.91M|  av1_find_mv_refs(cm, xd, mbmi, ref_frame, mbmi_ext->ref_mv_count,
 1073|  1.91M|                   xd->ref_mv_stack, xd->weight, NULL, mbmi_ext->global_mvs,
 1074|  1.91M|                   mbmi_ext->mode_context);
 1075|       |  // TODO(Ravi): Populate mbmi_ext->ref_mv_stack[ref_frame][4] and
 1076|       |  // mbmi_ext->weight[ref_frame][4] inside av1_find_mv_refs.
 1077|  1.91M|  av1_copy_usable_ref_mv_stack_and_weight(xd, mbmi_ext, ref_frame);
 1078|       |  // Further refinement that is encode side only to test the top few candidates
 1079|       |  // in full and choose the best as the center point for subsequent searches.
 1080|       |  // The current implementation doesn't support scaling.
 1081|  1.91M|  av1_mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12_mb[ref_frame][0].stride,
 1082|  1.91M|              ref_frame, block_size);
 1083|       |
 1084|       |  // Go back to unscaled reference.
 1085|  1.91M|  if (scaled_ref_frame) {
  ------------------
  |  Branch (1085:7): [True: 1.69M, False: 219k]
  ------------------
 1086|       |    // We had temporarily setup pred block based on scaled reference above. Go
 1087|       |    // back to unscaled reference now, for subsequent use.
 1088|  1.69M|    av1_setup_pred_block(xd, yv12_mb[ref_frame], yv12, sf, sf, num_planes);
 1089|  1.69M|  }
 1090|  1.91M|}
rdopt.c:prune_ref_frame:
 4180|  7.66M|                                  MV_REFERENCE_FRAME ref_frame) {
 4181|  7.66M|  const AV1_COMMON *const cm = &cpi->common;
 4182|  7.66M|  MV_REFERENCE_FRAME rf[2];
 4183|  7.66M|  av1_set_ref_frame(rf, ref_frame);
 4184|       |
 4185|  7.66M|  if ((cpi->prune_ref_frame_mask >> ref_frame) & 1) return 1;
  ------------------
  |  Branch (4185:7): [True: 0, False: 7.66M]
  ------------------
 4186|       |
 4187|  7.66M|  if (prune_ref_by_selective_ref_frame(cpi, x, rf,
  ------------------
  |  Branch (4187:7): [True: 0, False: 7.66M]
  ------------------
 4188|  7.66M|                                       cm->cur_frame->ref_display_order_hint)) {
 4189|      0|    return 1;
 4190|      0|  }
 4191|       |
 4192|  7.66M|  return 0;
 4193|  7.66M|}
rdopt.c:init_mode_skip_mask:
 3979|  1.91M|                                       BLOCK_SIZE bsize) {
 3980|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 3981|  1.91M|  const struct segmentation *const seg = &cm->seg;
 3982|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 3983|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3984|  1.91M|  unsigned char segment_id = mbmi->segment_id;
 3985|  1.91M|  const SPEED_FEATURES *const sf = &cpi->sf;
 3986|  1.91M|  const INTER_MODE_SPEED_FEATURES *const inter_sf = &sf->inter_sf;
 3987|  1.91M|  REF_SET ref_set = REF_SET_FULL;
 3988|       |
 3989|  1.91M|  if (sf->rt_sf.use_real_time_ref_set)
  ------------------
  |  Branch (3989:7): [True: 0, False: 1.91M]
  ------------------
 3990|      0|    ref_set = REF_SET_REALTIME;
 3991|  1.91M|  else if (cpi->oxcf.ref_frm_cfg.enable_reduced_reference_set)
  ------------------
  |  Branch (3991:12): [True: 0, False: 1.91M]
  ------------------
 3992|      0|    ref_set = REF_SET_REDUCED;
 3993|       |
 3994|  1.91M|  default_skip_mask(mask, ref_set);
 3995|       |
 3996|  1.91M|  int min_pred_mv_sad = INT_MAX;
 3997|  1.91M|  MV_REFERENCE_FRAME ref_frame;
 3998|  1.91M|  if (ref_set == REF_SET_REALTIME) {
  ------------------
  |  Branch (3998:7): [True: 0, False: 1.91M]
  ------------------
 3999|       |    // For real-time encoding, we only look at a subset of ref frames. So the
 4000|       |    // threshold for pruning should be computed from this subset as well.
 4001|      0|    const int num_rt_refs =
 4002|      0|        sizeof(real_time_ref_combos) / sizeof(*real_time_ref_combos);
 4003|      0|    for (int r_idx = 0; r_idx < num_rt_refs; r_idx++) {
  ------------------
  |  Branch (4003:25): [True: 0, False: 0]
  ------------------
 4004|      0|      const MV_REFERENCE_FRAME ref = real_time_ref_combos[r_idx][0];
 4005|      0|      if (ref != INTRA_FRAME) {
  ------------------
  |  Branch (4005:11): [True: 0, False: 0]
  ------------------
 4006|      0|        const MV_REFERENCE_FRAME ref_frames[2] = { ref, NONE_FRAME };
 4007|      0|        const int_mv ref_mv =
 4008|      0|            av1_get_ref_mv_from_stack(0, ref_frames, 0, &x->mbmi_ext);
 4009|      0|        const FULLPEL_MV full_mv = get_fullmv_from_mv(&ref_mv.as_mv);
 4010|      0|        if (av1_is_fullmv_in_range(&x->mv_limits, full_mv)) {
  ------------------
  |  Branch (4010:13): [True: 0, False: 0]
  ------------------
 4011|      0|          min_pred_mv_sad = AOMMIN(min_pred_mv_sad, x->pred_mv_sad[ref]);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4012|      0|        }
 4013|      0|      }
 4014|      0|    }
 4015|  1.91M|  } else {
 4016|  15.3M|    for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame)
  ------------------
  |  Branch (4016:34): [True: 13.4M, False: 1.91M]
  ------------------
 4017|  13.4M|      min_pred_mv_sad = AOMMIN(min_pred_mv_sad, x->pred_mv_sad[ref_frame]);
  ------------------
  |  |   34|  13.4M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 11.4M, False: 1.95M]
  |  |  ------------------
  ------------------
 4018|  1.91M|  }
 4019|       |
 4020|  15.3M|  for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (4020:32): [True: 13.4M, False: 1.91M]
  ------------------
 4021|  13.4M|    if (!(cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frame])) {
  ------------------
  |  Branch (4021:9): [True: 11.5M, False: 1.91M]
  ------------------
 4022|       |      // Skip checking missing reference in both single and compound reference
 4023|       |      // modes.
 4024|  11.5M|      disable_reference(ref_frame, mask->ref_combo);
 4025|  11.5M|    } else {
 4026|       |      // Skip fixed mv modes for poor references
 4027|  1.91M|      if ((x->pred_mv_sad[ref_frame] >> 2) > min_pred_mv_sad) {
  ------------------
  |  Branch (4027:11): [True: 0, False: 1.91M]
  ------------------
 4028|      0|        mask->pred_modes[ref_frame] |= INTER_NEAREST_NEAR_ZERO;
 4029|      0|      }
 4030|  1.91M|    }
 4031|  13.4M|    if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
  ------------------
  |  Branch (4031:9): [True: 0, False: 13.4M]
  ------------------
 4032|      0|        get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) {
  ------------------
  |  Branch (4032:9): [True: 0, False: 0]
  ------------------
 4033|       |      // Reference not used for the segment.
 4034|      0|      disable_reference(ref_frame, mask->ref_combo);
 4035|      0|    }
 4036|  13.4M|  }
 4037|       |  // Note: We use the following drop-out only if the SEG_LVL_REF_FRAME feature
 4038|       |  // is disabled for this segment. This is to prevent the possibility that we
 4039|       |  // end up unable to pick any mode.
 4040|  1.91M|  if (!segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
  ------------------
  |  Branch (4040:7): [True: 1.91M, False: 89]
  ------------------
 4041|       |    // Only consider GLOBALMV/ALTREF_FRAME for alt ref frame,
 4042|       |    // unless ARNR filtering is enabled in which case we want
 4043|       |    // an unfiltered alternative. We allow near/nearest as well
 4044|       |    // because they may result in zero-zero MVs but be cheaper.
 4045|  1.91M|    if (cpi->rc.is_src_frame_alt_ref &&
  ------------------
  |  Branch (4045:9): [True: 0, False: 1.91M]
  ------------------
 4046|      0|        (cpi->oxcf.algo_cfg.arnr_max_frames == 0)) {
  ------------------
  |  Branch (4046:9): [True: 0, False: 0]
  ------------------
 4047|      0|      disable_inter_references_except_altref(mask->ref_combo);
 4048|       |
 4049|      0|      mask->pred_modes[ALTREF_FRAME] = ~INTER_NEAREST_NEAR_ZERO;
 4050|      0|      const MV_REFERENCE_FRAME tmp_ref_frames[2] = { ALTREF_FRAME, NONE_FRAME };
 4051|      0|      int_mv near_mv, nearest_mv, global_mv;
 4052|      0|      get_this_mv(&nearest_mv, NEARESTMV, 0, 0, 0, tmp_ref_frames,
 4053|      0|                  &x->mbmi_ext);
 4054|      0|      get_this_mv(&near_mv, NEARMV, 0, 0, 0, tmp_ref_frames, &x->mbmi_ext);
 4055|      0|      get_this_mv(&global_mv, GLOBALMV, 0, 0, 0, tmp_ref_frames, &x->mbmi_ext);
 4056|       |
 4057|      0|      if (near_mv.as_int != global_mv.as_int)
  ------------------
  |  Branch (4057:11): [True: 0, False: 0]
  ------------------
 4058|      0|        mask->pred_modes[ALTREF_FRAME] |= (1 << NEARMV);
 4059|      0|      if (nearest_mv.as_int != global_mv.as_int)
  ------------------
  |  Branch (4059:11): [True: 0, False: 0]
  ------------------
 4060|      0|        mask->pred_modes[ALTREF_FRAME] |= (1 << NEARESTMV);
 4061|      0|    }
 4062|  1.91M|  }
 4063|       |
 4064|  1.91M|  if (cpi->rc.is_src_frame_alt_ref) {
  ------------------
  |  Branch (4064:7): [True: 0, False: 1.91M]
  ------------------
 4065|      0|    if (inter_sf->alt_ref_search_fp &&
  ------------------
  |  Branch (4065:9): [True: 0, False: 0]
  ------------------
 4066|      0|        (cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME])) {
  ------------------
  |  Branch (4066:9): [True: 0, False: 0]
  ------------------
 4067|      0|      mask->pred_modes[ALTREF_FRAME] = 0;
 4068|      0|      disable_inter_references_except_altref(mask->ref_combo);
 4069|      0|      disable_reference(INTRA_FRAME, mask->ref_combo);
 4070|      0|    }
 4071|      0|  }
 4072|       |
 4073|  1.91M|  if (inter_sf->alt_ref_search_fp) {
  ------------------
  |  Branch (4073:7): [True: 1.91M, False: 823]
  ------------------
 4074|  1.91M|    if (!cm->show_frame && x->best_pred_mv_sad[0] < INT_MAX) {
  ------------------
  |  Branch (4074:9): [True: 0, False: 1.91M]
  |  Branch (4074:28): [True: 0, False: 0]
  ------------------
 4075|      0|      int sad_thresh = x->best_pred_mv_sad[0] + (x->best_pred_mv_sad[0] >> 3);
 4076|       |      // Conservatively skip the modes w.r.t. BWDREF, ALTREF2 and ALTREF, if
 4077|       |      // those are past frames
 4078|      0|      MV_REFERENCE_FRAME start_frame =
 4079|      0|          inter_sf->alt_ref_search_fp == 1 ? ALTREF2_FRAME : BWDREF_FRAME;
  ------------------
  |  Branch (4079:11): [True: 0, False: 0]
  ------------------
 4080|      0|      for (ref_frame = start_frame; ref_frame <= ALTREF_FRAME; ref_frame++) {
  ------------------
  |  Branch (4080:37): [True: 0, False: 0]
  ------------------
 4081|      0|        if (cpi->ref_frame_dist_info.ref_relative_dist[ref_frame - LAST_FRAME] <
  ------------------
  |  Branch (4081:13): [True: 0, False: 0]
  ------------------
 4082|      0|            0) {
 4083|       |          // Prune inter modes when relative dist of ALTREF2 and ALTREF is close
 4084|       |          // to the relative dist of LAST_FRAME.
 4085|      0|          if (abs(cpi->ref_frame_dist_info
  ------------------
  |  Branch (4085:15): [True: 0, False: 0]
  ------------------
 4086|      0|                      .ref_relative_dist[ref_frame - LAST_FRAME] -
 4087|      0|                  cpi->ref_frame_dist_info
 4088|      0|                      .ref_relative_dist[LAST_FRAME - LAST_FRAME]) > 4) {
 4089|      0|            continue;
 4090|      0|          }
 4091|      0|          if (x->pred_mv_sad[ref_frame] > sad_thresh)
  ------------------
  |  Branch (4091:15): [True: 0, False: 0]
  ------------------
 4092|      0|            mask->pred_modes[ref_frame] |= INTER_ALL;
 4093|      0|        }
 4094|      0|      }
 4095|      0|    }
 4096|  1.91M|  }
 4097|       |
 4098|  1.91M|  if (sf->rt_sf.prune_inter_modes_wrt_gf_arf_based_on_sad) {
  ------------------
  |  Branch (4098:7): [True: 0, False: 1.91M]
  ------------------
 4099|      0|    if (x->best_pred_mv_sad[0] < INT_MAX) {
  ------------------
  |  Branch (4099:9): [True: 0, False: 0]
  ------------------
 4100|      0|      int sad_thresh = x->best_pred_mv_sad[0] + (x->best_pred_mv_sad[0] >> 1);
 4101|      0|      const int prune_ref_list[2] = { GOLDEN_FRAME, ALTREF_FRAME };
 4102|       |
 4103|       |      // Conservatively skip the modes w.r.t. GOLDEN and ALTREF references
 4104|      0|      for (int ref_idx = 0; ref_idx < 2; ref_idx++) {
  ------------------
  |  Branch (4104:29): [True: 0, False: 0]
  ------------------
 4105|      0|        ref_frame = prune_ref_list[ref_idx];
 4106|      0|        if (x->pred_mv_sad[ref_frame] > sad_thresh)
  ------------------
  |  Branch (4106:13): [True: 0, False: 0]
  ------------------
 4107|      0|          mask->pred_modes[ref_frame] |= INTER_NEAREST_NEAR_ZERO;
 4108|      0|      }
 4109|      0|    }
 4110|      0|  }
 4111|       |
 4112|  1.91M|  if (bsize > sf->part_sf.max_intra_bsize) {
  ------------------
  |  Branch (4112:7): [True: 7.45k, False: 1.91M]
  ------------------
 4113|  7.45k|    disable_reference(INTRA_FRAME, mask->ref_combo);
 4114|  7.45k|  }
 4115|       |
 4116|  1.91M|  if (!cpi->oxcf.tool_cfg.enable_global_motion) {
  ------------------
  |  Branch (4116:7): [True: 0, False: 1.91M]
  ------------------
 4117|      0|    for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (4117:34): [True: 0, False: 0]
  ------------------
 4118|      0|      mask->pred_modes[ref_frame] |= (1 << GLOBALMV);
 4119|      0|      mask->pred_modes[ref_frame] |= (1 << GLOBAL_GLOBALMV);
 4120|      0|    }
 4121|      0|  }
 4122|       |
 4123|  1.91M|  mask->pred_modes[INTRA_FRAME] |=
 4124|  1.91M|      ~(uint32_t)sf->intra_sf.intra_y_mode_mask[max_txsize_lookup[bsize]];
 4125|       |
 4126|       |  // Prune reference frames which are not the closest to the current
 4127|       |  // frame and with large pred_mv_sad.
 4128|  1.91M|  if (inter_sf->prune_single_ref) {
  ------------------
  |  Branch (4128:7): [True: 1.91M, False: 847]
  ------------------
 4129|  1.91M|    assert(inter_sf->prune_single_ref > 0 && inter_sf->prune_single_ref < 5);
 4130|  1.91M|    const double prune_thresh = (inter_sf->prune_single_ref <= 3) ? 1.20 : 1.05;
  ------------------
  |  Branch (4130:33): [True: 0, False: 1.91M]
  ------------------
 4131|       |
 4132|  15.3M|    for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
  ------------------
  |  Branch (4132:34): [True: 13.4M, False: 1.91M]
  ------------------
 4133|  13.4M|      const RefFrameDistanceInfo *const ref_frame_dist_info =
 4134|  13.4M|          &cpi->ref_frame_dist_info;
 4135|  13.4M|      const int is_closest_ref =
 4136|  13.4M|          (ref_frame == ref_frame_dist_info->nearest_past_ref) ||
  ------------------
  |  Branch (4136:11): [True: 1.91M, False: 11.5M]
  ------------------
 4137|  11.5M|          (ref_frame == ref_frame_dist_info->nearest_future_ref);
  ------------------
  |  Branch (4137:11): [True: 18.4E, False: 11.5M]
  ------------------
 4138|  13.4M|      const int ref_idx = ref_frame - LAST_FRAME;
 4139|       |
 4140|  13.4M|      if (!(cpi->keep_single_ref_frame_mask & (1 << ref_idx) ||
  ------------------
  |  Branch (4140:13): [True: 18.4E, False: 13.4M]
  ------------------
 4141|  13.4M|            is_closest_ref)) {
  ------------------
  |  Branch (4141:13): [True: 1.91M, False: 11.5M]
  ------------------
 4142|  11.5M|        const int dir =
 4143|  11.5M|            (ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME] < 0)
  ------------------
  |  Branch (4143:13): [True: 0, False: 11.5M]
  ------------------
 4144|  11.5M|                ? 0
 4145|  11.5M|                : 1;
 4146|  11.5M|        if (x->best_pred_mv_sad[dir] < INT_MAX &&
  ------------------
  |  Branch (4146:13): [True: 0, False: 11.5M]
  ------------------
 4147|      0|            x->pred_mv_sad[ref_frame] > prune_thresh * x->best_pred_mv_sad[dir])
  ------------------
  |  Branch (4147:13): [True: 0, False: 0]
  ------------------
 4148|      0|          mask->pred_modes[ref_frame] |= INTER_SINGLE_ALL;
 4149|  11.5M|      }
 4150|  13.4M|    }
 4151|  1.91M|  }
 4152|  1.91M|}
rdopt.c:default_skip_mask:
 3939|  1.91M|static inline void default_skip_mask(mode_skip_mask_t *mask, REF_SET ref_set) {
 3940|  1.91M|  if (ref_set == REF_SET_FULL) {
  ------------------
  |  Branch (3940:7): [True: 1.91M, False: 0]
  ------------------
 3941|       |    // Everything available by default.
 3942|  1.91M|    memset(mask, 0, sizeof(*mask));
 3943|  1.91M|  } else {
 3944|       |    // All modes available by default.
 3945|      0|    memset(mask->pred_modes, 0, sizeof(mask->pred_modes));
 3946|       |    // All references disabled first.
 3947|      0|    for (MV_REFERENCE_FRAME ref1 = INTRA_FRAME; ref1 < REF_FRAMES; ++ref1) {
  ------------------
  |  Branch (3947:49): [True: 0, False: 0]
  ------------------
 3948|      0|      for (MV_REFERENCE_FRAME ref2 = NONE_FRAME; ref2 < REF_FRAMES; ++ref2) {
  ------------------
  |  Branch (3948:50): [True: 0, False: 0]
  ------------------
 3949|      0|        mask->ref_combo[ref1][ref2 + 1] = true;
 3950|      0|      }
 3951|      0|    }
 3952|      0|    const MV_REFERENCE_FRAME(*ref_set_combos)[2];
 3953|      0|    int num_ref_combos;
 3954|       |
 3955|       |    // Then enable reduced set of references explicitly.
 3956|      0|    switch (ref_set) {
 3957|      0|      case REF_SET_REDUCED:
  ------------------
  |  Branch (3957:7): [True: 0, False: 0]
  ------------------
 3958|      0|        ref_set_combos = reduced_ref_combos;
 3959|      0|        num_ref_combos =
 3960|      0|            (int)sizeof(reduced_ref_combos) / sizeof(reduced_ref_combos[0]);
 3961|      0|        break;
 3962|      0|      case REF_SET_REALTIME:
  ------------------
  |  Branch (3962:7): [True: 0, False: 0]
  ------------------
 3963|      0|        ref_set_combos = real_time_ref_combos;
 3964|      0|        num_ref_combos =
 3965|      0|            (int)sizeof(real_time_ref_combos) / sizeof(real_time_ref_combos[0]);
 3966|      0|        break;
 3967|      0|      default: assert(0); num_ref_combos = 0;
  ------------------
  |  Branch (3967:7): [True: 0, False: 0]
  ------------------
 3968|      0|    }
 3969|       |
 3970|      0|    for (int i = 0; i < num_ref_combos; ++i) {
  ------------------
  |  Branch (3970:21): [True: 0, False: 0]
  ------------------
 3971|      0|      const MV_REFERENCE_FRAME *const this_combo = ref_set_combos[i];
 3972|       |      mask->ref_combo[this_combo[0]][this_combo[1] + 1] = false;
 3973|      0|    }
 3974|      0|  }
 3975|  1.91M|}
rdopt.c:disable_reference:
 3909|  11.5M|    MV_REFERENCE_FRAME ref, bool ref_combo[REF_FRAMES][REF_FRAMES + 1]) {
 3910|   115M|  for (MV_REFERENCE_FRAME ref2 = NONE_FRAME; ref2 < REF_FRAMES; ++ref2) {
  ------------------
  |  Branch (3910:46): [True: 103M, False: 11.5M]
  ------------------
 3911|       |    ref_combo[ref][ref2 + 1] = true;
 3912|   103M|  }
 3913|  11.5M|}
rdopt.c:get_this_mv:
 1913|  7.29M|                              const MB_MODE_INFO_EXT *mbmi_ext) {
 1914|  7.29M|  const PREDICTION_MODE single_mode = get_single_mode(this_mode, ref_idx);
 1915|  7.29M|  assert(is_inter_singleref_mode(single_mode));
 1916|  7.29M|  if (single_mode == NEWMV) {
  ------------------
  |  Branch (1916:7): [True: 2.15M, False: 5.14M]
  ------------------
 1917|  2.15M|    this_mv->as_int = INVALID_MV;
  ------------------
  |  |   26|  2.15M|#define INVALID_MV 0x80008000
  ------------------
 1918|  5.14M|  } else if (single_mode == GLOBALMV) {
  ------------------
  |  Branch (1918:14): [True: 1.89M, False: 3.24M]
  ------------------
 1919|  1.89M|    if (skip_repeated_ref_mv &&
  ------------------
  |  Branch (1919:9): [True: 0, False: 1.89M]
  ------------------
 1920|      0|        check_repeat_ref_mv(mbmi_ext, ref_idx, ref_frame, single_mode))
  ------------------
  |  Branch (1920:9): [True: 0, False: 0]
  ------------------
 1921|      0|      return 0;
 1922|  1.89M|    *this_mv = mbmi_ext->global_mvs[ref_frame[ref_idx]];
 1923|  3.24M|  } else {
 1924|  3.24M|    assert(single_mode == NEARMV || single_mode == NEARESTMV);
 1925|  3.24M|    const uint8_t ref_frame_type = av1_ref_frame_type(ref_frame);
 1926|  3.24M|    const int ref_mv_offset = single_mode == NEARESTMV ? 0 : ref_mv_idx + 1;
  ------------------
  |  Branch (1926:31): [True: 1.91M, False: 1.33M]
  ------------------
 1927|  3.24M|    if (ref_mv_offset < mbmi_ext->ref_mv_count[ref_frame_type]) {
  ------------------
  |  Branch (1927:9): [True: 665k, False: 2.57M]
  ------------------
 1928|   665k|      assert(ref_mv_offset >= 0);
 1929|   665k|      if (ref_idx == 0) {
  ------------------
  |  Branch (1929:11): [True: 665k, False: 18.4E]
  ------------------
 1930|   665k|        *this_mv =
 1931|   665k|            mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_offset].this_mv;
 1932|  18.4E|      } else {
 1933|  18.4E|        *this_mv =
 1934|  18.4E|            mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_offset].comp_mv;
 1935|  18.4E|      }
 1936|  2.57M|    } else {
 1937|  2.57M|      if (skip_repeated_ref_mv &&
  ------------------
  |  Branch (1937:11): [True: 0, False: 2.57M]
  ------------------
 1938|      0|          check_repeat_ref_mv(mbmi_ext, ref_idx, ref_frame, single_mode))
  ------------------
  |  Branch (1938:11): [True: 0, False: 0]
  ------------------
 1939|      0|        return 0;
 1940|  2.57M|      *this_mv = mbmi_ext->global_mvs[ref_frame[ref_idx]];
 1941|  2.57M|    }
 1942|  3.24M|  }
 1943|  7.29M|  return 1;
 1944|  7.29M|}
rdopt.c:get_single_mode:
  859|  14.5M|                                              int ref_idx) {
  860|  14.5M|  return ref_idx ? compound_ref1_mode(this_mode)
  ------------------
  |  Branch (860:10): [True: 0, False: 14.5M]
  ------------------
  861|  14.5M|                 : compound_ref0_mode(this_mode);
  862|  14.5M|}
rdopt.c:get_block_level_tpl_stats:
 2424|  1.91M|    PruneInfoFromTpl *inter_cost_info_from_tpl) {
 2425|  1.91M|  AV1_COMMON *const cm = &cpi->common;
 2426|       |
 2427|  1.91M|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
 2428|  1.91M|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
 2429|  1.91M|  const int tpl_idx = cpi->gf_frame_index;
 2430|  1.91M|  TplParams *const tpl_data = &cpi->ppi->tpl_data;
 2431|  1.91M|  if (!av1_tpl_stats_ready(tpl_data, tpl_idx)) return;
  ------------------
  |  Branch (2431:7): [True: 1.91M, False: 294]
  ------------------
 2432|    294|  const TplDepFrame *tpl_frame = &tpl_data->tpl_frame[tpl_idx];
 2433|    294|  const TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr;
 2434|    294|  const int mi_wide = mi_size_wide[bsize];
 2435|    294|  const int mi_high = mi_size_high[bsize];
 2436|    294|  const int tpl_stride = tpl_frame->stride;
 2437|    294|  const int step = 1 << tpl_data->tpl_stats_block_mis_log2;
 2438|    294|  const int mi_col_sr =
 2439|    294|      coded_to_superres_mi(mi_col, cm->superres_scale_denominator);
 2440|    294|  const int mi_col_end_sr =
 2441|    294|      coded_to_superres_mi(mi_col + mi_wide, cm->superres_scale_denominator);
 2442|    294|  const int mi_cols_sr = av1_pixels_to_mi(cm->superres_upscaled_width);
 2443|       |
 2444|    294|  const int row_step = step;
 2445|    294|  const int col_step_sr =
 2446|    294|      coded_to_superres_mi(step, cm->superres_scale_denominator);
 2447|    294|  for (int row = mi_row; row < AOMMIN(mi_row + mi_high, cm->mi_params.mi_rows);
  ------------------
  |  |   34|    294|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 294]
  |  |  ------------------
  ------------------
  |  Branch (2447:26): [True: 0, False: 294]
  ------------------
 2448|    294|       row += row_step) {
 2449|      0|    for (int col = mi_col_sr; col < AOMMIN(mi_col_end_sr, mi_cols_sr);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2449:31): [True: 0, False: 0]
  ------------------
 2450|      0|         col += col_step_sr) {
 2451|      0|      const TplDepStats *this_stats = &tpl_stats[av1_tpl_ptr_pos(
 2452|      0|          row, col, tpl_stride, tpl_data->tpl_stats_block_mis_log2)];
 2453|       |
 2454|       |      // Sums up the inter cost of corresponding ref frames
 2455|      0|      for (int ref_idx = 0; ref_idx < INTER_REFS_PER_FRAME; ref_idx++) {
  ------------------
  |  Branch (2455:29): [True: 0, False: 0]
  ------------------
 2456|      0|        inter_cost_info_from_tpl->ref_inter_cost[ref_idx] +=
 2457|      0|            this_stats->pred_error[ref_idx];
 2458|      0|      }
 2459|      0|    }
 2460|      0|  }
 2461|       |
 2462|       |  // Computes the best inter cost (minimum inter_cost)
 2463|    294|  int64_t best_inter_cost = INT64_MAX;
 2464|    294|  for (int ref_idx = 0; ref_idx < INTER_REFS_PER_FRAME; ref_idx++) {
  ------------------
  |  Branch (2464:25): [True: 0, False: 294]
  ------------------
 2465|      0|    const int64_t cur_inter_cost =
 2466|      0|        inter_cost_info_from_tpl->ref_inter_cost[ref_idx];
 2467|       |    // For invalid ref frames, cur_inter_cost = 0 and has to be handled while
 2468|       |    // calculating the minimum inter_cost
 2469|      0|    if (cur_inter_cost != 0 && (cur_inter_cost < best_inter_cost) &&
  ------------------
  |  Branch (2469:9): [True: 0, False: 0]
  |  Branch (2469:32): [True: 0, False: 0]
  ------------------
 2470|      0|        valid_refs[ref_idx])
  ------------------
  |  Branch (2470:9): [True: 0, False: 0]
  ------------------
 2471|      0|      best_inter_cost = cur_inter_cost;
 2472|      0|  }
 2473|    294|  inter_cost_info_from_tpl->best_inter_cost = best_inter_cost;
 2474|    294|}
rdopt.c:init_comp_avg_est_rd:
  517|  1.91M|    struct macroblock *x, int skip_cmp_using_top_cmp_avg_est_rd_lvl) {
  518|  1.91M|  if (!skip_cmp_using_top_cmp_avg_est_rd_lvl) return;
  ------------------
  |  Branch (518:7): [True: 0, False: 1.91M]
  ------------------
  519|       |
  520|  11.5M|  for (int j = 0; j < TOP_COMP_AVG_EST_RD_COUNT; j++) {
  ------------------
  |  |  880|  11.5M|#define TOP_COMP_AVG_EST_RD_COUNT 5
  ------------------
  |  Branch (520:19): [True: 9.58M, False: 1.91M]
  ------------------
  521|       |    x->top_comp_avg_est_rd[j] = INT64_MAX;
  522|  9.58M|  }
  523|  1.91M|}
rdopt.c:skip_inter_mode:
 5202|   298M|                                            int is_low_temp_var) {
 5203|   298M|  const SPEED_FEATURES *const sf = &cpi->sf;
 5204|   298M|  MACROBLOCKD *const xd = &x->e_mbd;
 5205|       |  // Get the actual prediction mode we are trying in this iteration
 5206|   298M|  const THR_MODES mode_enum = av1_default_mode_order[midx];
 5207|   298M|  const MODE_DEFINITION *mode_def = &av1_mode_defs[mode_enum];
 5208|   298M|  const PREDICTION_MODE this_mode = mode_def->mode;
 5209|   298M|  const MV_REFERENCE_FRAME *ref_frames = mode_def->ref_frame;
 5210|   298M|  const MV_REFERENCE_FRAME ref_frame = ref_frames[0];
 5211|   298M|  const MV_REFERENCE_FRAME second_ref_frame = ref_frames[1];
 5212|   298M|  const int comp_pred = second_ref_frame > INTRA_FRAME;
 5213|       |
 5214|   298M|  if (ref_frame == INTRA_FRAME) return 1;
  ------------------
  |  Branch (5214:7): [True: 0, False: 298M]
  ------------------
 5215|       |
 5216|   298M|  const FRAME_UPDATE_TYPE update_type =
 5217|   298M|      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 5218|   298M|  if (sf->inter_sf.skip_arf_compound && update_type == ARF_UPDATE &&
  ------------------
  |  Branch (5218:7): [True: 298M, False: 850]
  |  Branch (5218:41): [True: 0, False: 298M]
  ------------------
 5219|      0|      comp_pred) {
  ------------------
  |  Branch (5219:7): [True: 0, False: 0]
  ------------------
 5220|      0|    return 1;
 5221|      0|  }
 5222|       |
 5223|       |  // This is for real time encoding.
 5224|   298M|  if (is_low_temp_var && !comp_pred && ref_frame != LAST_FRAME &&
  ------------------
  |  Branch (5224:7): [True: 0, False: 298M]
  |  Branch (5224:26): [True: 0, False: 0]
  |  Branch (5224:40): [True: 0, False: 0]
  ------------------
 5225|      0|      this_mode != NEARESTMV)
  ------------------
  |  Branch (5225:7): [True: 0, False: 0]
  ------------------
 5226|      0|    return 1;
 5227|       |
 5228|       |  // Check if this mode should be skipped because it is incompatible with the
 5229|       |  // current frame
 5230|   298M|  if (inter_mode_compatible_skip(cpi, x, bsize, this_mode, ref_frames))
  ------------------
  |  Branch (5230:7): [True: 244M, False: 53.2M]
  ------------------
 5231|   244M|    return 1;
 5232|  53.2M|  const int ret = inter_mode_search_order_independent_skip(
 5233|  53.2M|      cpi, x, args->mode_skip_mask, args->search_state,
 5234|  53.2M|      args->skip_ref_frame_mask, this_mode, mode_def->ref_frame);
 5235|  53.2M|  if (ret == 1) return 1;
  ------------------
  |  Branch (5235:7): [True: 46.5M, False: 6.77M]
  ------------------
 5236|  6.77M|  *(args->skip_motion_mode) = (ret == 2);
 5237|       |
 5238|       |  // We've reached the first compound prediction mode, get stats from the
 5239|       |  // single reference predictors to help with pruning.
 5240|       |  // Disable this pruning logic if interpolation filter search was skipped for
 5241|       |  // single prediction modes as it can result in aggressive pruning of compound
 5242|       |  // prediction modes due to the absence of modelled_rd populated by
 5243|       |  // av1_interpolation_filter_search().
 5244|       |  // TODO(Remya): Check the impact of the sf
 5245|       |  // 'prune_comp_search_by_single_result' if compound prediction modes are
 5246|       |  // enabled in future for REALTIME encode.
 5247|  6.77M|  if (!sf->interp_sf.skip_interp_filter_search &&
  ------------------
  |  Branch (5247:7): [True: 0, False: 6.77M]
  ------------------
 5248|      0|      sf->inter_sf.prune_comp_search_by_single_result > 0 && comp_pred &&
  ------------------
  |  Branch (5248:7): [True: 0, False: 0]
  |  Branch (5248:62): [True: 0, False: 0]
  ------------------
 5249|      0|      args->reach_first_comp_mode == 0) {
  ------------------
  |  Branch (5249:7): [True: 0, False: 0]
  ------------------
 5250|      0|    analyze_single_states(cpi, args->search_state);
 5251|      0|    args->reach_first_comp_mode = 1;
 5252|      0|  }
 5253|       |
 5254|       |  // Prune aggressively when best mode is skippable.
 5255|  6.77M|  int mul_fact = args->search_state->best_mode_skippable
  ------------------
  |  Branch (5255:18): [True: 192k, False: 6.58M]
  ------------------
 5256|  6.77M|                     ? args->mode_thresh_mul_fact
 5257|  6.77M|                     : (1 << MODE_THRESH_QBITS);
  ------------------
  |  |   83|  6.58M|#define MODE_THRESH_QBITS 12
  ------------------
 5258|  6.77M|  int64_t mode_threshold =
 5259|  6.77M|      (args->search_state->mode_threshold[mode_enum] * mul_fact) >>
 5260|  6.77M|      MODE_THRESH_QBITS;
  ------------------
  |  |   83|  6.77M|#define MODE_THRESH_QBITS 12
  ------------------
 5261|       |
 5262|  6.77M|  if (args->search_state->best_rd < mode_threshold) return 1;
  ------------------
  |  Branch (5262:7): [True: 16.7k, False: 6.76M]
  ------------------
 5263|       |
 5264|       |  // Skip this compound mode based on the RD results from the single prediction
 5265|       |  // modes
 5266|  6.76M|  if (!sf->interp_sf.skip_interp_filter_search &&
  ------------------
  |  Branch (5266:7): [True: 0, False: 6.76M]
  ------------------
 5267|      0|      sf->inter_sf.prune_comp_search_by_single_result > 0 && comp_pred) {
  ------------------
  |  Branch (5267:7): [True: 0, False: 0]
  |  Branch (5267:62): [True: 0, False: 0]
  ------------------
 5268|      0|    if (compound_skip_by_single_states(cpi, args->search_state, this_mode,
  ------------------
  |  Branch (5268:9): [True: 0, False: 0]
  ------------------
 5269|      0|                                       ref_frame, second_ref_frame, x))
 5270|      0|      return 1;
 5271|      0|  }
 5272|       |
 5273|  7.07M|  if (sf->inter_sf.prune_compound_using_single_ref && comp_pred) {
  ------------------
  |  Branch (5273:7): [True: 7.07M, False: 18.4E]
  |  Branch (5273:55): [True: 0, False: 7.07M]
  ------------------
 5274|       |    // After we done with single reference modes, find the 2nd best RD
 5275|       |    // for a reference frame. Only search compound modes that have a reference
 5276|       |    // frame at least as good as the 2nd best.
 5277|      0|    if (!args->prune_cpd_using_sr_stats_ready &&
  ------------------
  |  Branch (5277:9): [True: 0, False: 0]
  ------------------
 5278|      0|        args->num_single_modes_processed == NUM_SINGLE_REF_MODES) {
  ------------------
  |  Branch (5278:9): [True: 0, False: 0]
  ------------------
 5279|      0|      find_top_ref(ref_frame_rd);
 5280|      0|      args->prune_cpd_using_sr_stats_ready = 1;
 5281|      0|    }
 5282|      0|    if (args->prune_cpd_using_sr_stats_ready &&
  ------------------
  |  Branch (5282:9): [True: 0, False: 0]
  ------------------
 5283|      0|        !in_single_ref_cutoff(ref_frame_rd, ref_frame, second_ref_frame))
  ------------------
  |  Branch (5283:9): [True: 0, False: 0]
  ------------------
 5284|      0|      return 1;
 5285|      0|  }
 5286|       |
 5287|       |  // Skip NEW_NEARMV and NEAR_NEWMV extended compound modes
 5288|  6.76M|  if (sf->inter_sf.skip_ext_comp_nearmv_mode &&
  ------------------
  |  Branch (5288:7): [True: 7.07M, False: 18.4E]
  ------------------
 5289|  7.07M|      (this_mode == NEW_NEARMV || this_mode == NEAR_NEWMV)) {
  ------------------
  |  Branch (5289:8): [True: 18.4E, False: 7.07M]
  |  Branch (5289:35): [True: 18.4E, False: 7.07M]
  ------------------
 5290|      0|    return 1;
 5291|      0|  }
 5292|       |
 5293|  7.07M|  if (sf->inter_sf.prune_ext_comp_using_neighbors && comp_pred) {
  ------------------
  |  Branch (5293:7): [True: 7.07M, False: 18.4E]
  |  Branch (5293:54): [True: 0, False: 7.07M]
  ------------------
 5294|      0|    if (compound_skip_using_neighbor_refs(
  ------------------
  |  Branch (5294:9): [True: 0, False: 0]
  ------------------
 5295|      0|            xd, this_mode, ref_frames,
 5296|      0|            sf->inter_sf.prune_ext_comp_using_neighbors))
 5297|      0|      return 1;
 5298|      0|  }
 5299|       |
 5300|  7.07M|  if (sf->inter_sf.prune_comp_using_best_single_mode_ref && comp_pred) {
  ------------------
  |  Branch (5300:7): [True: 7.07M, False: 18.4E]
  |  Branch (5300:61): [True: 0, False: 7.07M]
  ------------------
 5301|      0|    if (skip_compound_using_best_single_mode_ref(
  ------------------
  |  Branch (5301:9): [True: 0, False: 0]
  ------------------
 5302|      0|            this_mode, ref_frames, args->search_state->best_single_mode,
 5303|      0|            sf->inter_sf.prune_comp_using_best_single_mode_ref))
 5304|      0|      return 1;
 5305|      0|  }
 5306|       |
 5307|  6.76M|  if (sf->inter_sf.prune_nearest_near_mv_using_refmv_weight && !comp_pred) {
  ------------------
  |  Branch (5307:7): [True: 5.25M, False: 1.50M]
  |  Branch (5307:64): [True: 5.25M, False: 18.4E]
  ------------------
 5308|  5.25M|    const int8_t ref_frame_type = av1_ref_frame_type(ref_frames);
 5309|  5.25M|    if (skip_nearest_near_mv_using_refmv_weight(
  ------------------
  |  Branch (5309:9): [True: 80.8k, False: 5.17M]
  ------------------
 5310|  5.25M|            x, this_mode, ref_frame_type,
 5311|  5.25M|            args->search_state->best_mbmode.mode)) {
 5312|       |      // Ensure the mode is pruned only when the current block has obtained a
 5313|       |      // valid inter mode.
 5314|  80.8k|      assert(is_inter_mode(args->search_state->best_mbmode.mode));
 5315|  80.8k|      return 1;
 5316|  80.8k|    }
 5317|  5.25M|  }
 5318|       |
 5319|  6.67M|  if (sf->rt_sf.prune_inter_modes_with_golden_ref &&
  ------------------
  |  Branch (5319:7): [True: 0, False: 6.67M]
  ------------------
 5320|      0|      ref_frame == GOLDEN_FRAME && !comp_pred) {
  ------------------
  |  Branch (5320:7): [True: 0, False: 0]
  |  Branch (5320:36): [True: 0, False: 0]
  ------------------
 5321|      0|    const int subgop_size = AOMMIN(cpi->ppi->gf_group.size, FIXED_GF_INTERVAL);
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5322|      0|    if (cpi->rc.frames_since_golden > (subgop_size >> 2) &&
  ------------------
  |  Branch (5322:9): [True: 0, False: 0]
  ------------------
 5323|      0|        args->search_state->best_mbmode.ref_frame[0] != GOLDEN_FRAME) {
  ------------------
  |  Branch (5323:9): [True: 0, False: 0]
  ------------------
 5324|      0|      if ((bsize > BLOCK_16X16 && this_mode == NEWMV) || this_mode == NEARMV)
  ------------------
  |  Branch (5324:12): [True: 0, False: 0]
  |  Branch (5324:35): [True: 0, False: 0]
  |  Branch (5324:58): [True: 0, False: 0]
  ------------------
 5325|      0|        return 1;
 5326|      0|    }
 5327|      0|  }
 5328|       |
 5329|  6.67M|  return 0;
 5330|  6.67M|}
rdopt.c:inter_mode_compatible_skip:
 4478|   298M|    PREDICTION_MODE curr_mode, const MV_REFERENCE_FRAME *ref_frames) {
 4479|   298M|  const int comp_pred = ref_frames[1] > INTRA_FRAME;
 4480|   298M|  if (comp_pred) {
  ------------------
  |  Branch (4480:7): [True: 244M, False: 53.3M]
  ------------------
 4481|   244M|    if (!is_comp_ref_allowed(bsize)) return 1;
  ------------------
  |  Branch (4481:9): [True: 50.6M, False: 194M]
  ------------------
 4482|   194M|    if (!(cpi->ref_frame_flags & av1_ref_frame_flag_list[ref_frames[1]])) {
  ------------------
  |  Branch (4482:9): [True: 194M, False: 18.4E]
  ------------------
 4483|   194M|      return 1;
 4484|   194M|    }
 4485|       |
 4486|  18.4E|    const AV1_COMMON *const cm = &cpi->common;
 4487|  18.4E|    if (frame_is_intra_only(cm)) return 1;
  ------------------
  |  Branch (4487:9): [True: 0, False: 18.4E]
  ------------------
 4488|       |
 4489|  18.4E|    const CurrentFrame *const current_frame = &cm->current_frame;
 4490|  18.4E|    if (current_frame->reference_mode == SINGLE_REFERENCE) return 1;
  ------------------
  |  Branch (4490:9): [True: 0, False: 18.4E]
  ------------------
 4491|       |
 4492|  18.4E|    const struct segmentation *const seg = &cm->seg;
 4493|  18.4E|    const unsigned char segment_id = x->e_mbd.mi[0]->segment_id;
 4494|       |    // Do not allow compound prediction if the segment level reference frame
 4495|       |    // feature is in use as in this case there can only be one reference.
 4496|  18.4E|    if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) return 1;
  ------------------
  |  Branch (4496:9): [True: 0, False: 18.4E]
  ------------------
 4497|  18.4E|  }
 4498|       |
 4499|  53.5M|  if (ref_frames[0] > INTRA_FRAME && ref_frames[1] == INTRA_FRAME) {
  ------------------
  |  Branch (4499:7): [True: 53.5M, False: 18.4E]
  |  Branch (4499:38): [True: 0, False: 53.5M]
  ------------------
 4500|       |    // Mode must be compatible
 4501|      0|    if (!is_interintra_allowed_bsize(bsize)) return 1;
  ------------------
  |  Branch (4501:9): [True: 0, False: 0]
  ------------------
 4502|      0|    if (!is_interintra_allowed_mode(curr_mode)) return 1;
  ------------------
  |  Branch (4502:9): [True: 0, False: 0]
  ------------------
 4503|      0|  }
 4504|       |
 4505|  53.2M|  return 0;
 4506|  53.2M|}
rdopt.c:inter_mode_search_order_independent_skip:
 4541|  53.5M|    PREDICTION_MODE mode, const MV_REFERENCE_FRAME *ref_frame) {
 4542|  53.5M|  if (mask_says_skip(mode_skip_mask, ref_frame, mode)) {
  ------------------
  |  Branch (4542:7): [True: 45.9M, False: 7.64M]
  ------------------
 4543|  45.9M|    return 1;
 4544|  45.9M|  }
 4545|       |
 4546|  7.64M|  const int ref_type = av1_ref_frame_type(ref_frame);
 4547|  7.64M|  if (!cpi->sf.rt_sf.use_real_time_ref_set)
  ------------------
  |  Branch (4547:7): [True: 7.66M, False: 18.4E]
  ------------------
 4548|  7.66M|    if (prune_ref_frame(cpi, x, ref_type)) return 1;
  ------------------
  |  Branch (4548:9): [True: 0, False: 7.66M]
  ------------------
 4549|       |
 4550|       |  // This is only used in motion vector unit test.
 4551|  7.64M|  if (cpi->oxcf.unit_test_cfg.motion_vector_unit_test &&
  ------------------
  |  Branch (4551:7): [True: 0, False: 7.64M]
  ------------------
 4552|      0|      ref_frame[0] == INTRA_FRAME)
  ------------------
  |  Branch (4552:7): [True: 0, False: 0]
  ------------------
 4553|      0|    return 1;
 4554|       |
 4555|  7.64M|  const AV1_COMMON *const cm = &cpi->common;
 4556|  7.64M|  if (skip_repeated_mv(cm, x, mode, ref_frame, search_state)) {
  ------------------
  |  Branch (4556:7): [True: 0, False: 7.64M]
  ------------------
 4557|      0|    return 1;
 4558|      0|  }
 4559|       |
 4560|       |  // Reuse the prediction mode in cache
 4561|  7.64M|  if (x->use_mb_mode_cache) {
  ------------------
  |  Branch (4561:7): [True: 0, False: 7.64M]
  ------------------
 4562|      0|    const MB_MODE_INFO *cached_mi = x->mb_mode_cache;
 4563|      0|    const PREDICTION_MODE cached_mode = cached_mi->mode;
 4564|      0|    const MV_REFERENCE_FRAME *cached_frame = cached_mi->ref_frame;
 4565|      0|    const int cached_mode_is_single = cached_frame[1] <= INTRA_FRAME;
 4566|       |
 4567|       |    // If the cached mode is intra, then we just need to match the mode.
 4568|      0|    if (is_mode_intra(cached_mode) && mode != cached_mode) {
  ------------------
  |  Branch (4568:9): [True: 0, False: 0]
  |  Branch (4568:39): [True: 0, False: 0]
  ------------------
 4569|      0|      return 1;
 4570|      0|    }
 4571|       |
 4572|       |    // If the cached mode is single inter mode, then we match the mode and
 4573|       |    // reference frame.
 4574|      0|    if (cached_mode_is_single) {
  ------------------
  |  Branch (4574:9): [True: 0, False: 0]
  ------------------
 4575|      0|      if (mode != cached_mode || ref_frame[0] != cached_frame[0]) {
  ------------------
  |  Branch (4575:11): [True: 0, False: 0]
  |  Branch (4575:34): [True: 0, False: 0]
  ------------------
 4576|      0|        return 1;
 4577|      0|      }
 4578|      0|    } else {
 4579|       |      // If the cached mode is compound, then we need to consider several cases.
 4580|      0|      const int mode_is_single = ref_frame[1] <= INTRA_FRAME;
 4581|      0|      if (mode_is_single) {
  ------------------
  |  Branch (4581:11): [True: 0, False: 0]
  ------------------
 4582|       |        // If the mode is single, we know the modes can't match. But we might
 4583|       |        // still want to search it if compound mode depends on the current mode.
 4584|      0|        int skip_motion_mode_only = 0;
 4585|      0|        if (cached_mode == NEW_NEARMV || cached_mode == NEW_NEARESTMV) {
  ------------------
  |  Branch (4585:13): [True: 0, False: 0]
  |  Branch (4585:42): [True: 0, False: 0]
  ------------------
 4586|      0|          skip_motion_mode_only = (ref_frame[0] == cached_frame[0]);
 4587|      0|        } else if (cached_mode == NEAR_NEWMV || cached_mode == NEAREST_NEWMV) {
  ------------------
  |  Branch (4587:20): [True: 0, False: 0]
  |  Branch (4587:49): [True: 0, False: 0]
  ------------------
 4588|      0|          skip_motion_mode_only = (ref_frame[0] == cached_frame[1]);
 4589|      0|        } else if (cached_mode == NEW_NEWMV) {
  ------------------
  |  Branch (4589:20): [True: 0, False: 0]
  ------------------
 4590|      0|          skip_motion_mode_only = (ref_frame[0] == cached_frame[0] ||
  ------------------
  |  Branch (4590:36): [True: 0, False: 0]
  ------------------
 4591|      0|                                   ref_frame[0] == cached_frame[1]);
  ------------------
  |  Branch (4591:36): [True: 0, False: 0]
  ------------------
 4592|      0|        }
 4593|       |
 4594|      0|        return 1 + skip_motion_mode_only;
 4595|      0|      } else {
 4596|       |        // If both modes are compound, then everything must match.
 4597|      0|        if (mode != cached_mode || ref_frame[0] != cached_frame[0] ||
  ------------------
  |  Branch (4597:13): [True: 0, False: 0]
  |  Branch (4597:36): [True: 0, False: 0]
  ------------------
 4598|      0|            ref_frame[1] != cached_frame[1]) {
  ------------------
  |  Branch (4598:13): [True: 0, False: 0]
  ------------------
 4599|      0|          return 1;
 4600|      0|        }
 4601|      0|      }
 4602|      0|    }
 4603|      0|  }
 4604|       |
 4605|  7.64M|  const MB_MODE_INFO *const mbmi = x->e_mbd.mi[0];
 4606|       |  // If no valid mode has been found so far in PARTITION_NONE when finding a
 4607|       |  // valid partition is required, do not skip mode.
 4608|  7.64M|  if (search_state->best_rd == INT64_MAX && mbmi->partition == PARTITION_NONE &&
  ------------------
  |  Branch (4608:7): [True: 1.06M, False: 6.58M]
  |  Branch (4608:45): [True: 1.06M, False: 53]
  ------------------
 4609|  1.06M|      x->must_find_valid_partition)
  ------------------
  |  Branch (4609:7): [True: 0, False: 1.06M]
  ------------------
 4610|      0|    return 0;
 4611|       |
 4612|  7.64M|  const SPEED_FEATURES *const sf = &cpi->sf;
 4613|       |  // Prune NEARMV and NEAR_NEARMV based on q index and neighbor's reference
 4614|       |  // frames
 4615|  7.64M|  if (sf->inter_sf.prune_nearmv_using_neighbors &&
  ------------------
  |  Branch (4615:7): [True: 7.66M, False: 18.4E]
  ------------------
 4616|  7.66M|      (mode == NEAR_NEARMV || mode == NEARMV)) {
  ------------------
  |  Branch (4616:8): [True: 18.4E, False: 7.66M]
  |  Branch (4616:31): [True: 1.91M, False: 5.75M]
  ------------------
 4617|  1.91M|    const MACROBLOCKD *const xd = &x->e_mbd;
 4618|  1.91M|    if (search_state->best_rd != INT64_MAX && xd->left_available &&
  ------------------
  |  Branch (4618:9): [True: 1.91M, False: 18.4E]
  |  Branch (4618:47): [True: 1.50M, False: 407k]
  ------------------
 4619|  1.50M|        xd->up_available) {
  ------------------
  |  Branch (4619:9): [True: 1.20M, False: 309k]
  ------------------
 4620|  1.20M|      const int thresholds[PRUNE_NEARMV_MAX][3] = { { 1, 0, 0 },
 4621|  1.20M|                                                    { 1, 1, 0 },
 4622|  1.20M|                                                    { 2, 1, 0 } };
 4623|  1.20M|      const int qindex_sub_range = x->qindex * 3 / QINDEX_RANGE;
  ------------------
  |  |   27|  1.20M|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  1.20M|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  1.20M|#define MINQ 0
  |  |  ------------------
  ------------------
 4624|       |
 4625|  1.20M|      assert(sf->inter_sf.prune_nearmv_using_neighbors <= PRUNE_NEARMV_MAX &&
 4626|  1.20M|             qindex_sub_range < 3);
 4627|  1.20M|      const int num_ref_frame_pair_match_thresh =
 4628|  1.20M|          thresholds[sf->inter_sf.prune_nearmv_using_neighbors - 1]
 4629|  1.20M|                    [qindex_sub_range];
 4630|       |
 4631|  1.20M|      assert(num_ref_frame_pair_match_thresh <= 2 &&
 4632|  1.20M|             num_ref_frame_pair_match_thresh >= 0);
 4633|  1.20M|      int num_ref_frame_pair_match = 0;
 4634|       |
 4635|  1.20M|      num_ref_frame_pair_match = match_ref_frame_pair(xd->left_mbmi, ref_frame);
 4636|  1.20M|      num_ref_frame_pair_match +=
 4637|  1.20M|          match_ref_frame_pair(xd->above_mbmi, ref_frame);
 4638|       |
 4639|       |      // Pruning based on ref frame pair match with neighbors.
 4640|  1.20M|      if (num_ref_frame_pair_match < num_ref_frame_pair_match_thresh) return 1;
  ------------------
  |  Branch (4640:11): [True: 550k, False: 650k]
  ------------------
 4641|  1.20M|    }
 4642|  1.91M|  }
 4643|       |
 4644|  7.09M|  int skip_motion_mode = 0;
 4645|  7.09M|  if (mbmi->partition != PARTITION_NONE) {
  ------------------
  |  Branch (4645:7): [True: 520k, False: 6.57M]
  ------------------
 4646|   520k|    assert(ref_type > NONE_FRAME);
 4647|   520k|    int skip_ref = skip_ref_frame_mask & (1 << ref_type);
 4648|   520k|    if (ref_type <= ALTREF_FRAME && skip_ref) {
  ------------------
  |  Branch (4648:9): [True: 520k, False: 18.4E]
  |  Branch (4648:37): [True: 26.6k, False: 494k]
  ------------------
 4649|       |      // Since the compound ref modes depends on the motion estimation result of
 4650|       |      // two single ref modes (best mv of single ref modes as the start point),
 4651|       |      // if current single ref mode is marked skip, we need to check if it will
 4652|       |      // be used in compound ref modes.
 4653|  26.6k|      if (is_ref_frame_used_by_compound_ref(ref_type, skip_ref_frame_mask)) {
  ------------------
  |  Branch (4653:11): [True: 0, False: 26.6k]
  ------------------
 4654|       |        // Found a not skipped compound ref mode which contains current
 4655|       |        // single ref. So this single ref can't be skipped completely
 4656|       |        // Just skip its motion mode search, still try its simple
 4657|       |        // transition mode.
 4658|      0|        skip_motion_mode = 1;
 4659|      0|        skip_ref = 0;
 4660|      0|      }
 4661|  26.6k|    }
 4662|       |    // If we are reusing the prediction from cache, and the current frame is
 4663|       |    // required by the cache, then we cannot prune it.
 4664|   520k|    if (is_ref_frame_used_in_cache(ref_type, x->mb_mode_cache)) {
  ------------------
  |  Branch (4664:9): [True: 0, False: 520k]
  ------------------
 4665|      0|      skip_ref = 0;
 4666|       |      // If the cache only needs the current reference type for compound
 4667|       |      // prediction, then we can skip motion mode search.
 4668|      0|      skip_motion_mode = (ref_type <= ALTREF_FRAME &&
  ------------------
  |  Branch (4668:27): [True: 0, False: 0]
  ------------------
 4669|      0|                          x->mb_mode_cache->ref_frame[1] > INTRA_FRAME);
  ------------------
  |  Branch (4669:27): [True: 0, False: 0]
  ------------------
 4670|      0|    }
 4671|   520k|    if (skip_ref) return 1;
  ------------------
  |  Branch (4671:9): [True: 26.6k, False: 494k]
  ------------------
 4672|   520k|  }
 4673|       |
 4674|  7.06M|  if (ref_frame[0] == INTRA_FRAME) {
  ------------------
  |  Branch (4674:7): [True: 0, False: 7.06M]
  ------------------
 4675|      0|    if (mode != DC_PRED) {
  ------------------
  |  Branch (4675:9): [True: 0, False: 0]
  ------------------
 4676|       |      // Disable intra modes other than DC_PRED for blocks with low variance
 4677|       |      // Threshold for intra skipping based on source variance
 4678|       |      // TODO(debargha): Specialize the threshold for super block sizes
 4679|      0|      const unsigned int skip_intra_var_thresh = 64;
 4680|      0|      if ((sf->rt_sf.mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) &&
  ------------------
  |  Branch (4680:11): [True: 0, False: 0]
  ------------------
 4681|      0|          x->source_variance < skip_intra_var_thresh)
  ------------------
  |  Branch (4681:11): [True: 0, False: 0]
  ------------------
 4682|      0|        return 1;
 4683|      0|    }
 4684|      0|  }
 4685|       |
 4686|  7.06M|  if (skip_motion_mode) return 2;
  ------------------
  |  Branch (4686:7): [True: 0, False: 7.06M]
  ------------------
 4687|       |
 4688|  7.06M|  return 0;
 4689|  7.06M|}
rdopt.c:mask_says_skip:
 4468|  53.5M|                           const PREDICTION_MODE this_mode) {
 4469|  53.5M|  if (mode_skip_mask->pred_modes[ref_frame[0]] & (1 << this_mode)) {
  ------------------
  |  Branch (4469:7): [True: 0, False: 53.5M]
  ------------------
 4470|      0|    return true;
 4471|      0|  }
 4472|       |
 4473|  53.5M|  return mode_skip_mask->ref_combo[ref_frame[0]][ref_frame[1] + 1];
 4474|  53.5M|}
rdopt.c:skip_repeated_mv:
 1110|  7.66M|    InterModeSearchState *search_state) {
 1111|  7.66M|  const int is_comp_pred = ref_frames[1] > INTRA_FRAME;
 1112|  7.66M|  const uint8_t ref_frame_type = av1_ref_frame_type(ref_frames);
 1113|  7.66M|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 1114|  7.66M|  const int ref_mv_count = mbmi_ext->ref_mv_count[ref_frame_type];
 1115|  7.66M|  PREDICTION_MODE compare_mode = MB_MODE_COUNT;
 1116|  7.66M|  if (!is_comp_pred) {
  ------------------
  |  Branch (1116:7): [True: 7.66M, False: 17]
  ------------------
 1117|  7.66M|    if (this_mode == NEARMV) {
  ------------------
  |  Branch (1117:9): [True: 1.91M, False: 5.74M]
  ------------------
 1118|  1.91M|      if (ref_mv_count == 0) {
  ------------------
  |  Branch (1118:11): [True: 1.38M, False: 534k]
  ------------------
 1119|       |        // NEARMV has the same motion vector as NEARESTMV
 1120|  1.38M|        compare_mode = NEARESTMV;
 1121|  1.38M|      }
 1122|  1.91M|      if (ref_mv_count == 1 &&
  ------------------
  |  Branch (1122:11): [True: 357k, False: 1.56M]
  ------------------
 1123|   357k|          cm->global_motion[ref_frames[0]].wmtype <= TRANSLATION) {
  ------------------
  |  Branch (1123:11): [True: 357k, False: 18.4E]
  ------------------
 1124|       |        // NEARMV has the same motion vector as GLOBALMV
 1125|   357k|        compare_mode = GLOBALMV;
 1126|   357k|      }
 1127|  1.91M|    }
 1128|  7.66M|    if (this_mode == GLOBALMV) {
  ------------------
  |  Branch (1128:9): [True: 1.91M, False: 5.74M]
  ------------------
 1129|  1.91M|      if (ref_mv_count == 0 &&
  ------------------
  |  Branch (1129:11): [True: 1.38M, False: 534k]
  ------------------
 1130|  1.38M|          cm->global_motion[ref_frames[0]].wmtype <= TRANSLATION) {
  ------------------
  |  Branch (1130:11): [True: 1.38M, False: 18.4E]
  ------------------
 1131|       |        // GLOBALMV has the same motion vector as NEARESTMV
 1132|  1.38M|        compare_mode = NEARESTMV;
 1133|  1.38M|      }
 1134|  1.91M|      if (ref_mv_count == 1) {
  ------------------
  |  Branch (1134:11): [True: 357k, False: 1.56M]
  ------------------
 1135|       |        // GLOBALMV has the same motion vector as NEARMV
 1136|   357k|        compare_mode = NEARMV;
 1137|   357k|      }
 1138|  1.91M|    }
 1139|       |
 1140|  7.66M|    if (compare_mode != MB_MODE_COUNT) {
  ------------------
  |  Branch (1140:9): [True: 3.47M, False: 4.18M]
  ------------------
 1141|       |      // Use modelled_rd to check whether compare mode was searched
 1142|  3.47M|      if (search_state->modelled_rd[compare_mode][0][ref_frames[0]] !=
  ------------------
  |  Branch (1142:11): [True: 0, False: 3.47M]
  ------------------
 1143|  3.47M|          INT64_MAX) {
 1144|      0|        const int16_t mode_ctx =
 1145|      0|            av1_mode_context_analyzer(mbmi_ext->mode_context, ref_frames);
 1146|      0|        const int compare_cost =
 1147|      0|            cost_mv_ref(&x->mode_costs, compare_mode, mode_ctx);
 1148|      0|        const int this_cost = cost_mv_ref(&x->mode_costs, this_mode, mode_ctx);
 1149|       |
 1150|       |        // Only skip if the mode cost is larger than compare mode cost
 1151|      0|        if (this_cost > compare_cost) {
  ------------------
  |  Branch (1151:13): [True: 0, False: 0]
  ------------------
 1152|      0|          search_state->modelled_rd[this_mode][0][ref_frames[0]] =
 1153|      0|              search_state->modelled_rd[compare_mode][0][ref_frames[0]];
 1154|      0|          return 1;
 1155|      0|        }
 1156|      0|      }
 1157|  3.47M|    }
 1158|  7.66M|  }
 1159|  7.66M|  return 0;
 1160|  7.66M|}
rdopt.c:cost_mv_ref:
  828|  6.99M|                       int16_t mode_context) {
  829|  6.99M|  if (is_inter_compound_mode(mode)) {
  ------------------
  |  Branch (829:7): [True: 0, False: 6.99M]
  ------------------
  830|      0|    return mode_costs
  831|      0|        ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)];
  ------------------
  |  |   29|      0|#define INTER_COMPOUND_OFFSET(mode) (uint8_t)((mode) - NEAREST_NEARESTMV)
  ------------------
  832|      0|  }
  833|       |
  834|  6.99M|  int mode_cost = 0;
  835|  6.99M|  int16_t mode_ctx = mode_context & NEWMV_CTX_MASK;
  ------------------
  |  |  490|  6.99M|#define NEWMV_CTX_MASK ((1 << GLOBALMV_OFFSET) - 1)
  |  |  ------------------
  |  |  |  |  487|  6.99M|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  836|       |
  837|  6.99M|  assert(is_inter_mode(mode));
  838|       |
  839|  6.99M|  if (mode == NEWMV) {
  ------------------
  |  Branch (839:7): [True: 1.90M, False: 5.08M]
  ------------------
  840|  1.90M|    mode_cost = mode_costs->newmv_mode_cost[mode_ctx][0];
  841|  1.90M|    return mode_cost;
  842|  5.08M|  } else {
  843|  5.08M|    mode_cost = mode_costs->newmv_mode_cost[mode_ctx][1];
  844|  5.08M|    mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  487|  5.08M|#define GLOBALMV_OFFSET 3
  ------------------
                  mode_ctx = (mode_context >> GLOBALMV_OFFSET) & GLOBALMV_CTX_MASK;
  ------------------
  |  |  491|  5.08M|#define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  5.08M|#define REFMV_OFFSET 4
  |  |  ------------------
  |  |               #define GLOBALMV_CTX_MASK ((1 << (REFMV_OFFSET - GLOBALMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  487|  5.08M|#define GLOBALMV_OFFSET 3
  |  |  ------------------
  ------------------
  845|       |
  846|  5.08M|    if (mode == GLOBALMV) {
  ------------------
  |  Branch (846:9): [True: 1.89M, False: 3.18M]
  ------------------
  847|  1.89M|      mode_cost += mode_costs->zeromv_mode_cost[mode_ctx][0];
  848|  1.89M|      return mode_cost;
  849|  3.18M|    } else {
  850|  3.18M|      mode_cost += mode_costs->zeromv_mode_cost[mode_ctx][1];
  851|  3.18M|      mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  488|  3.18M|#define REFMV_OFFSET 4
  ------------------
                    mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
  ------------------
  |  |  492|  3.18M|#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
  |  |  ------------------
  |  |  |  |  488|  3.18M|#define REFMV_OFFSET 4
  |  |  ------------------
  ------------------
  852|  3.18M|      mode_cost += mode_costs->refmv_mode_cost[mode_ctx][mode != NEARESTMV];
  853|  3.18M|      return mode_cost;
  854|  3.18M|    }
  855|  5.08M|  }
  856|  6.99M|}
rdopt.c:match_ref_frame_pair:
 4530|  2.40M|                                       const MV_REFERENCE_FRAME *ref_frames) {
 4531|  2.40M|  return ((ref_frames[0] == mbmi->ref_frame[0]) &&
  ------------------
  |  Branch (4531:11): [True: 313k, False: 2.08M]
  ------------------
 4532|   313k|          (ref_frames[1] == mbmi->ref_frame[1]));
  ------------------
  |  Branch (4532:11): [True: 313k, False: 18.4E]
  ------------------
 4533|  2.40M|}
rdopt.c:get_drl_refmv_count:
 2063|  6.99M|                               PREDICTION_MODE mode) {
 2064|  6.99M|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 2065|  6.99M|  const int8_t ref_frame_type = av1_ref_frame_type(ref_frame);
 2066|  6.99M|  const int has_nearmv = have_nearmv_in_inter_mode(mode) ? 1 : 0;
  ------------------
  |  Branch (2066:26): [True: 1.27M, False: 5.71M]
  ------------------
 2067|  6.99M|  const int ref_mv_count = mbmi_ext->ref_mv_count[ref_frame_type];
 2068|  6.99M|  const int only_newmv = (mode == NEWMV || mode == NEW_NEWMV);
  ------------------
  |  Branch (2068:27): [True: 1.90M, False: 5.08M]
  |  Branch (2068:44): [True: 18.4E, False: 5.08M]
  ------------------
 2069|  6.99M|  const int has_drl =
 2070|  6.99M|      (has_nearmv && ref_mv_count > 2) || (only_newmv && ref_mv_count > 1);
  ------------------
  |  Branch (2070:8): [True: 1.27M, False: 5.71M]
  |  Branch (2070:22): [True: 38.8k, False: 1.23M]
  |  Branch (2070:44): [True: 1.90M, False: 5.04M]
  |  Branch (2070:58): [True: 171k, False: 1.73M]
  ------------------
 2071|  6.99M|  const int ref_set =
 2072|  6.99M|      has_drl ? AOMMIN(MAX_REF_MV_SEARCH, ref_mv_count - has_nearmv) : 1;
  ------------------
  |  |   34|   209k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 46.4k, False: 163k]
  |  |  ------------------
  ------------------
  |  Branch (2072:7): [True: 209k, False: 6.78M]
  ------------------
 2073|       |
 2074|  6.99M|  return ref_set;
 2075|  6.99M|}
rdopt.c:skip_nearest_near_mv_using_refmv_weight:
 1950|  5.25M|    const int8_t ref_frame_type, PREDICTION_MODE best_mode) {
 1951|  5.25M|  if (this_mode != NEARESTMV && this_mode != NEARMV) return 0;
  ------------------
  |  Branch (1951:7): [True: 3.83M, False: 1.41M]
  |  Branch (1951:33): [True: 2.83M, False: 1.00M]
  ------------------
 1952|       |  // Do not skip the mode if the current block has not yet obtained a valid
 1953|       |  // inter mode.
 1954|  2.42M|  if (!is_inter_mode(best_mode)) return 0;
  ------------------
  |  Branch (1954:7): [True: 1.44M, False: 977k]
  ------------------
 1955|       |
 1956|   977k|  const MACROBLOCKD *xd = &x->e_mbd;
 1957|       |  // Do not skip the mode if both the top and left neighboring blocks are not
 1958|       |  // available.
 1959|   977k|  if (!xd->left_available || !xd->up_available) return 0;
  ------------------
  |  Branch (1959:7): [True: 262k, False: 715k]
  |  Branch (1959:30): [True: 207k, False: 508k]
  ------------------
 1960|   505k|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 1961|   505k|  const uint16_t *const ref_mv_weight = mbmi_ext->weight[ref_frame_type];
 1962|   505k|  const int ref_mv_count =
 1963|   505k|      AOMMIN(MAX_REF_MV_SEARCH, mbmi_ext->ref_mv_count[ref_frame_type]);
  ------------------
  |  |   34|   505k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 23.6k, False: 481k]
  |  |  ------------------
  ------------------
 1964|       |
 1965|   505k|  if (ref_mv_count == 0) return 0;
  ------------------
  |  Branch (1965:7): [True: 310k, False: 194k]
  ------------------
 1966|       |  // If ref mv list has at least one nearest candidate do not prune NEARESTMV
 1967|   194k|  if (this_mode == NEARESTMV && ref_mv_weight[0] >= REF_CAT_LEVEL) return 0;
  ------------------
  |  |  512|      0|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (1967:7): [True: 0, False: 194k]
  |  Branch (1967:33): [True: 0, False: 0]
  ------------------
 1968|       |
 1969|       |  // Count number of ref mvs populated from nearest candidates
 1970|   194k|  int nearest_refmv_count = 0;
 1971|   518k|  for (int ref_mv_idx = 0; ref_mv_idx < ref_mv_count; ref_mv_idx++) {
  ------------------
  |  Branch (1971:28): [True: 323k, False: 194k]
  ------------------
 1972|   323k|    if (ref_mv_weight[ref_mv_idx] >= REF_CAT_LEVEL) nearest_refmv_count++;
  ------------------
  |  |  512|   323k|#define REF_CAT_LEVEL 640
  ------------------
  |  Branch (1972:9): [True: 195k, False: 127k]
  ------------------
 1973|   323k|  }
 1974|       |
 1975|       |  // nearest_refmv_count indicates the closeness of block motion characteristics
 1976|       |  // with respect to its spatial neighbor. Smaller value of nearest_refmv_count
 1977|       |  // w.r.t to ref_mv_count means less correlation with its spatial neighbors.
 1978|       |  // Hence less possibility for NEARESTMV and NEARMV modes becoming the best
 1979|       |  // mode since these modes work well for blocks that shares similar motion
 1980|       |  // characteristics with its neighbor. Thus, NEARMV mode is pruned when
 1981|       |  // nearest_refmv_count is relatively smaller than ref_mv_count and NEARESTMV
 1982|       |  // mode is pruned if none of the ref mvs are populated from nearest candidate.
 1983|   194k|  const int prune_thresh = 1 + (ref_mv_count >= 2);
 1984|   194k|  if (nearest_refmv_count < prune_thresh) return 1;
  ------------------
  |  Branch (1984:7): [True: 80.8k, False: 113k]
  ------------------
 1985|   113k|  return 0;
 1986|   194k|}
rdopt.c:init_mbmi:
 4693|  94.2M|                             const AV1_COMMON *cm) {
 4694|  94.2M|  PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
 4695|  94.2M|  mbmi->ref_mv_idx = 0;
 4696|  94.2M|  mbmi->mode = curr_mode;
 4697|  94.2M|  mbmi->uv_mode = UV_DC_PRED;
 4698|  94.2M|  mbmi->ref_frame[0] = ref_frames[0];
 4699|  94.2M|  mbmi->ref_frame[1] = ref_frames[1];
 4700|  94.2M|  pmi->palette_size[0] = 0;
 4701|  94.2M|  pmi->palette_size[1] = 0;
 4702|  94.2M|  mbmi->filter_intra_mode_info.use_filter_intra = 0;
 4703|  94.2M|  mbmi->mv[0].as_int = mbmi->mv[1].as_int = 0;
 4704|  94.2M|  mbmi->motion_mode = SIMPLE_TRANSLATION;
 4705|  94.2M|  mbmi->interintra_mode = (INTERINTRA_MODE)(II_DC_PRED - 1);
 4706|  94.2M|  set_default_interp_filters(mbmi, cm->features.interp_filter);
 4707|  94.2M|}
rdopt.c:skip_interp_filter_search:
 5952|  6.99M|                                             int is_single_pred) {
 5953|  6.99M|  const MODE encoding_mode = cpi->oxcf.mode;
 5954|  6.99M|  if (encoding_mode == REALTIME) {
  ------------------
  |  Branch (5954:7): [True: 0, False: 6.99M]
  ------------------
 5955|      0|    return (cpi->common.current_frame.reference_mode == SINGLE_REFERENCE &&
  ------------------
  |  Branch (5955:13): [True: 0, False: 0]
  ------------------
 5956|      0|            (cpi->sf.interp_sf.skip_interp_filter_search ||
  ------------------
  |  Branch (5956:14): [True: 0, False: 0]
  ------------------
 5957|      0|             cpi->sf.winner_mode_sf.winner_mode_ifs));
  ------------------
  |  Branch (5957:14): [True: 0, False: 0]
  ------------------
 5958|  6.99M|  } else if (encoding_mode == GOOD) {
  ------------------
  |  Branch (5958:14): [True: 6.99M, False: 18.4E]
  ------------------
 5959|       |    // Skip interpolation filter search for single prediction modes.
 5960|  6.99M|    return (cpi->sf.interp_sf.skip_interp_filter_search && is_single_pred);
  ------------------
  |  Branch (5960:13): [True: 6.99M, False: 18.4E]
  |  Branch (5960:60): [True: 6.99M, False: 18.4E]
  ------------------
 5961|  6.99M|  }
 5962|  18.4E|  return false;
 5963|  6.99M|}
rdopt.c:handle_inter_mode:
 2950|  6.99M|    int64_t *yrd) {
 2951|  6.99M|  const AV1_COMMON *cm = &cpi->common;
 2952|  6.99M|  const int num_planes = av1_num_planes(cm);
 2953|  6.99M|  MACROBLOCKD *xd = &x->e_mbd;
 2954|  6.99M|  MB_MODE_INFO *mbmi = xd->mi[0];
 2955|  6.99M|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 2956|  6.99M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 2957|  6.99M|  const int is_comp_pred = has_second_ref(mbmi);
 2958|  6.99M|  const PREDICTION_MODE this_mode = mbmi->mode;
 2959|       |
 2960|       |#if CONFIG_REALTIME_ONLY
 2961|       |  const int prune_modes_based_on_tpl = 0;
 2962|       |#else   // CONFIG_REALTIME_ONLY
 2963|  6.99M|  const TplParams *const tpl_data = &cpi->ppi->tpl_data;
 2964|  6.99M|  const int prune_modes_based_on_tpl =
 2965|  6.99M|      cpi->sf.inter_sf.prune_inter_modes_based_on_tpl &&
  ------------------
  |  Branch (2965:7): [True: 6.99M, False: 1.32k]
  ------------------
 2966|  6.99M|      av1_tpl_stats_ready(tpl_data, cpi->gf_frame_index);
  ------------------
  |  Branch (2966:7): [True: 0, False: 6.99M]
  ------------------
 2967|  6.99M|#endif  // CONFIG_REALTIME_ONLY
 2968|  6.99M|  int i;
 2969|       |  // Reference frames for this mode
 2970|  6.99M|  const int refs[2] = { mbmi->ref_frame[0],
 2971|  6.99M|                        (mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]) };
  ------------------
  |  Branch (2971:26): [True: 6.99M, False: 2.19k]
  ------------------
 2972|  6.99M|  int rate_mv = 0;
 2973|  6.99M|  int64_t rd = INT64_MAX;
 2974|       |  // Do first prediction into the destination buffer. Do the next
 2975|       |  // prediction into a temporary buffer. Then keep track of which one
 2976|       |  // of these currently holds the best predictor, and use the other
 2977|       |  // one for future predictions. In the end, copy from tmp_buf to
 2978|       |  // dst if necessary.
 2979|  6.99M|  struct macroblockd_plane *pd = xd->plane;
 2980|  6.99M|  const BUFFER_SET orig_dst = {
 2981|  6.99M|    { pd[0].dst.buf, pd[1].dst.buf, pd[2].dst.buf },
 2982|  6.99M|    { pd[0].dst.stride, pd[1].dst.stride, pd[2].dst.stride },
 2983|  6.99M|  };
 2984|  6.99M|  const BUFFER_SET tmp_dst = { { tmp_buf, tmp_buf + 1 * MAX_SB_SQUARE,
  ------------------
  |  |   33|  6.99M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2985|  6.99M|                                 tmp_buf + 2 * MAX_SB_SQUARE },
  ------------------
  |  |   33|  6.99M|#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
  |  |  ------------------
  |  |  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2986|  6.99M|                               { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE } };
  ------------------
  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                                             { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE } };
  ------------------
  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
                                             { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE } };
  ------------------
  |  |   32|  6.99M|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  6.99M|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
 2987|       |
 2988|  6.99M|  int64_t ret_val = INT64_MAX;
 2989|  6.99M|  const int8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 2990|  6.99M|  RD_STATS best_rd_stats, best_rd_stats_y, best_rd_stats_uv;
 2991|  6.99M|  int64_t best_rd = INT64_MAX;
 2992|  6.99M|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 2993|  6.99M|  int64_t best_yrd = INT64_MAX;
 2994|  6.99M|  MB_MODE_INFO best_mbmi = *mbmi;
 2995|  6.99M|  int best_xskip_txfm = 0;
 2996|  6.99M|  int64_t newmv_ret_val = INT64_MAX;
 2997|  6.99M|  inter_mode_info mode_info[MAX_REF_MV_SEARCH];
 2998|       |
 2999|       |  // Do not prune the mode based on inter cost from tpl if the current ref frame
 3000|       |  // is the winner ref in neighbouring blocks.
 3001|  6.99M|  int ref_match_found_in_above_nb = 0;
 3002|  6.99M|  int ref_match_found_in_left_nb = 0;
 3003|  6.99M|  if (prune_modes_based_on_tpl) {
  ------------------
  |  Branch (3003:7): [True: 0, False: 6.99M]
  ------------------
 3004|      0|    ref_match_found_in_above_nb =
 3005|      0|        find_ref_match_in_above_nbs(cm->mi_params.mi_cols, xd);
 3006|      0|    ref_match_found_in_left_nb =
 3007|      0|        find_ref_match_in_left_nbs(cm->mi_params.mi_rows, xd);
 3008|      0|  }
 3009|       |
 3010|       |  // First, perform a simple translation search for each of the indices. If
 3011|       |  // an index performs well, it will be fully searched in the main loop
 3012|       |  // of this function.
 3013|  6.99M|  const int ref_set = get_drl_refmv_count(x, mbmi->ref_frame, this_mode);
 3014|       |  // Save MV results from first 2 ref_mv_idx.
 3015|  6.99M|  int_mv save_mv[MAX_REF_MV_SEARCH - 1][2];
 3016|  6.99M|  int best_ref_mv_idx = -1;
 3017|  6.99M|  const int idx_mask =
 3018|  6.99M|      ref_mv_idx_to_search(cpi, x, args, ref_best_rd, bsize, ref_set);
 3019|  6.99M|  const int16_t mode_ctx =
 3020|  6.99M|      av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
 3021|  6.99M|  const ModeCosts *mode_costs = &x->mode_costs;
 3022|  6.99M|  const int ref_mv_cost = cost_mv_ref(mode_costs, this_mode, mode_ctx);
 3023|  6.99M|  const int base_rate =
 3024|  6.99M|      args->ref_frame_cost + args->single_comp_cost + ref_mv_cost;
 3025|       |
 3026|  20.9M|  for (i = 0; i < MAX_REF_MV_SEARCH - 1; ++i) {
  ------------------
  |  |   25|  20.9M|#define MAX_REF_MV_SEARCH 3
  ------------------
  |  Branch (3026:15): [True: 13.9M, False: 6.99M]
  ------------------
 3027|  13.9M|    save_mv[i][0].as_int = INVALID_MV;
  ------------------
  |  |   26|  13.9M|#define INVALID_MV 0x80008000
  ------------------
 3028|  13.9M|    save_mv[i][1].as_int = INVALID_MV;
  ------------------
  |  |   26|  13.9M|#define INVALID_MV 0x80008000
  ------------------
 3029|  13.9M|  }
 3030|  6.99M|  args->start_mv_cnt = 0;
 3031|       |
 3032|       |  // Main loop of this function. This will  iterate over all of the ref mvs
 3033|       |  // in the dynamic reference list and do the following:
 3034|       |  //    1.) Get the current MV. Create newmv MV if necessary
 3035|       |  //    2.) Search compound type and parameters if applicable
 3036|       |  //    3.) Do interpolation filter search
 3037|       |  //    4.) Build the inter predictor
 3038|       |  //    5.) Pick the motion mode (SIMPLE_TRANSLATION, OBMC_CAUSAL,
 3039|       |  //        WARPED_CAUSAL)
 3040|       |  //    6.) Update stats if best so far
 3041|  14.2M|  for (int ref_mv_idx = 0; ref_mv_idx < ref_set; ++ref_mv_idx) {
  ------------------
  |  Branch (3041:28): [True: 7.29M, False: 6.99M]
  ------------------
 3042|  7.29M|    mbmi->ref_mv_idx = ref_mv_idx;
 3043|       |
 3044|  7.29M|    mode_info[ref_mv_idx].full_search_mv.as_int = INVALID_MV;
  ------------------
  |  |   26|  7.29M|#define INVALID_MV 0x80008000
  ------------------
 3045|  7.29M|    mode_info[ref_mv_idx].full_mv_bestsme = INT_MAX;
 3046|  7.29M|    const int drl_cost = get_drl_cost(
 3047|  7.29M|        mbmi, mbmi_ext, mode_costs->drl_mode_cost0, ref_frame_type);
 3048|  7.29M|    mode_info[ref_mv_idx].drl_cost = drl_cost;
 3049|  7.29M|    mode_info[ref_mv_idx].skip = 0;
 3050|       |
 3051|  7.29M|    if (!mask_check_bit(idx_mask, ref_mv_idx)) {
  ------------------
  |  Branch (3051:9): [True: 1.25k, False: 7.29M]
  ------------------
 3052|       |      // MV did not perform well in simple translation search. Skip it.
 3053|  1.25k|      continue;
 3054|  1.25k|    }
 3055|  7.29M|    if (prune_modes_based_on_tpl && !ref_match_found_in_above_nb &&
  ------------------
  |  Branch (3055:9): [True: 0, False: 7.29M]
  |  Branch (3055:37): [True: 0, False: 0]
  ------------------
 3056|      0|        !ref_match_found_in_left_nb && (ref_best_rd != INT64_MAX)) {
  ------------------
  |  Branch (3056:9): [True: 0, False: 0]
  |  Branch (3056:40): [True: 0, False: 0]
  ------------------
 3057|       |      // Skip mode if TPL model indicates it will not be beneficial.
 3058|      0|      if (prune_modes_based_on_tpl_stats(
  ------------------
  |  Branch (3058:11): [True: 0, False: 0]
  ------------------
 3059|      0|              inter_cost_info_from_tpl, refs, ref_mv_idx, this_mode,
 3060|      0|              cpi->sf.inter_sf.prune_inter_modes_based_on_tpl))
 3061|      0|        continue;
 3062|      0|    }
 3063|  7.29M|    av1_init_rd_stats(rd_stats);
 3064|       |
 3065|       |    // Initialize compound mode data
 3066|  7.29M|    mbmi->interinter_comp.type = COMPOUND_AVERAGE;
 3067|  7.29M|    mbmi->comp_group_idx = 0;
 3068|  7.29M|    mbmi->compound_idx = 1;
 3069|  7.29M|    if (mbmi->ref_frame[1] == INTRA_FRAME) mbmi->ref_frame[1] = NONE_FRAME;
  ------------------
  |  Branch (3069:9): [True: 0, False: 7.29M]
  ------------------
 3070|       |
 3071|  7.29M|    mbmi->num_proj_ref = 0;
 3072|  7.29M|    mbmi->motion_mode = SIMPLE_TRANSLATION;
 3073|       |
 3074|       |    // Compute cost for signalling this DRL index
 3075|  7.29M|    rd_stats->rate = base_rate;
 3076|  7.29M|    rd_stats->rate += drl_cost;
 3077|       |
 3078|  7.29M|    int rs = 0;
 3079|  7.29M|    int compmode_interinter_cost = 0;
 3080|       |
 3081|  7.29M|    int_mv cur_mv[2];
 3082|       |
 3083|       |    // TODO(Cherma): Extend this speed feature to support compound mode
 3084|  7.29M|    int skip_repeated_ref_mv =
 3085|  7.29M|        is_comp_pred ? 0 : cpi->sf.inter_sf.skip_repeated_ref_mv;
  ------------------
  |  Branch (3085:9): [True: 0, False: 7.29M]
  ------------------
 3086|       |    // Generate the current mv according to the prediction mode
 3087|  7.29M|    if (!build_cur_mv(cur_mv, this_mode, cm, x, skip_repeated_ref_mv)) {
  ------------------
  |  Branch (3087:9): [True: 5.62k, False: 7.28M]
  ------------------
 3088|  5.62k|      continue;
 3089|  5.62k|    }
 3090|       |
 3091|       |    // The above call to build_cur_mv does not handle NEWMV modes. Build
 3092|       |    // the mv here if we have NEWMV for any predictors.
 3093|  7.28M|    if (have_newmv_in_inter_mode(this_mode)) {
  ------------------
  |  Branch (3093:9): [True: 2.15M, False: 5.13M]
  ------------------
 3094|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3095|       |      start_timing(cpi, handle_newmv_time);
 3096|       |#endif
 3097|  2.15M|      newmv_ret_val =
 3098|  2.15M|          handle_newmv(cpi, x, bsize, cur_mv, &rate_mv, args, mode_info);
 3099|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3100|       |      end_timing(cpi, handle_newmv_time);
 3101|       |#endif
 3102|       |
 3103|  2.15M|      if (newmv_ret_val != 0) continue;
  ------------------
  |  Branch (3103:11): [True: 133k, False: 2.01M]
  ------------------
 3104|       |
 3105|  2.01M|      if (is_inter_singleref_mode(this_mode) &&
  ------------------
  |  Branch (3105:11): [True: 2.01M, False: 18.4E]
  ------------------
 3106|  2.01M|          cur_mv[0].as_int != INVALID_MV) {
  ------------------
  |  |   26|  2.01M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (3106:11): [True: 2.01M, False: 18.4E]
  ------------------
 3107|  2.01M|        const MV_REFERENCE_FRAME ref = refs[0];
 3108|  2.01M|        const unsigned int this_sse = x->pred_sse[ref];
 3109|  2.01M|        if (this_sse < args->best_single_sse_in_refs[ref]) {
  ------------------
  |  Branch (3109:13): [True: 1.97M, False: 46.6k]
  ------------------
 3110|  1.97M|          args->best_single_sse_in_refs[ref] = this_sse;
 3111|  1.97M|        }
 3112|       |
 3113|  2.01M|        if (cpi->sf.rt_sf.skip_newmv_mode_based_on_sse) {
  ------------------
  |  Branch (3113:13): [True: 0, False: 2.01M]
  ------------------
 3114|      0|          const int th_idx = cpi->sf.rt_sf.skip_newmv_mode_based_on_sse - 1;
 3115|      0|          const int pix_idx = num_pels_log2_lookup[bsize] - 4;
 3116|      0|          const double scale_factor[3][11] = {
 3117|      0|            { 0.7, 0.7, 0.7, 0.7, 0.7, 0.8, 0.8, 0.9, 0.9, 0.9, 0.9 },
 3118|      0|            { 0.7, 0.7, 0.7, 0.7, 0.8, 0.8, 1, 1, 1, 1, 1 },
 3119|      0|            { 0.7, 0.7, 0.7, 0.7, 1, 1, 1, 1, 1, 1, 1 }
 3120|      0|          };
 3121|      0|          assert(pix_idx >= 0);
 3122|      0|          assert(th_idx <= 2);
 3123|      0|          if (args->best_pred_sse < scale_factor[th_idx][pix_idx] * this_sse)
  ------------------
  |  Branch (3123:15): [True: 0, False: 0]
  ------------------
 3124|      0|            continue;
 3125|      0|        }
 3126|  2.01M|      }
 3127|       |
 3128|  2.01M|      rd_stats->rate += rate_mv;
 3129|  2.01M|    }
 3130|       |    // Copy the motion vector for this mode into mbmi struct
 3131|  14.3M|    for (i = 0; i < is_comp_pred + 1; ++i) {
  ------------------
  |  Branch (3131:17): [True: 7.15M, False: 7.15M]
  ------------------
 3132|  7.15M|      mbmi->mv[i].as_int = cur_mv[i].as_int;
 3133|  7.15M|    }
 3134|       |
 3135|  7.15M|    if (RDCOST(x->rdmult, rd_stats->rate, 0) > ref_best_rd &&
  ------------------
  |  |   33|  7.15M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  7.15M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  7.15M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  7.15M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (3135:9): [True: 21.9k, False: 7.13M]
  ------------------
 3136|  21.9k|        mbmi->mode != NEARESTMV && mbmi->mode != NEAREST_NEARESTMV) {
  ------------------
  |  Branch (3136:9): [True: 17.7k, False: 4.19k]
  |  Branch (3136:36): [True: 17.7k, False: 0]
  ------------------
 3137|  17.7k|      continue;
 3138|  17.7k|    }
 3139|       |
 3140|       |    // Skip the rest of the search if prune_ref_mv_idx_search speed feature
 3141|       |    // is enabled, and the current MV is similar to a previous one.
 3142|  7.13M|    if (cpi->sf.inter_sf.prune_ref_mv_idx_search && is_comp_pred &&
  ------------------
  |  Branch (3142:9): [True: 7.13M, False: 18.4E]
  |  Branch (3142:53): [True: 0, False: 7.13M]
  ------------------
 3143|      0|        prune_ref_mv_idx_search(ref_mv_idx, best_ref_mv_idx, save_mv, mbmi,
  ------------------
  |  Branch (3143:9): [True: 0, False: 0]
  ------------------
 3144|      0|                                cpi->sf.inter_sf.prune_ref_mv_idx_search))
 3145|      0|      continue;
 3146|       |
 3147|  7.13M|    if (cpi->sf.gm_sf.prune_zero_mv_with_sse &&
  ------------------
  |  Branch (3147:9): [True: 7.13M, False: 18.4E]
  ------------------
 3148|  7.13M|        (this_mode == GLOBALMV || this_mode == GLOBAL_GLOBALMV)) {
  ------------------
  |  Branch (3148:10): [True: 1.89M, False: 5.24M]
  |  Branch (3148:35): [True: 18.4E, False: 5.24M]
  ------------------
 3149|  1.89M|      if (prune_zero_mv_with_sse(cpi->ppi->fn_ptr, x, bsize, args,
  ------------------
  |  Branch (3149:11): [True: 1.61M, False: 280k]
  ------------------
 3150|  1.89M|                                 cpi->sf.gm_sf.prune_zero_mv_with_sse)) {
 3151|  1.61M|        continue;
 3152|  1.61M|      }
 3153|  1.89M|    }
 3154|       |
 3155|       |    // Flag to indicate whether to skip av1_enc_build_inter_predictor() after
 3156|       |    // interpolation filter search
 3157|  5.52M|    int skip_build_pred = INTERP_EVAL_LUMA_EVAL_CHROMA;
 3158|  5.52M|    const int mi_row = xd->mi_row;
 3159|  5.52M|    const int mi_col = xd->mi_col;
 3160|       |
 3161|       |    // Handle a compound predictor, continue if it is determined this
 3162|       |    // cannot be the best compound mode
 3163|  5.52M|    if (is_comp_pred) {
  ------------------
  |  Branch (3163:9): [True: 0, False: 5.52M]
  ------------------
 3164|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3165|       |      start_timing(cpi, compound_type_rd_time);
 3166|       |#endif
 3167|      0|      const int not_best_mode = process_compound_inter_mode(
 3168|      0|          cpi, x, args, ref_best_rd, cur_mv, bsize, &compmode_interinter_cost,
 3169|      0|          rd_buffers, &orig_dst, &tmp_dst, &rate_mv, rd_stats, skip_rd,
 3170|      0|          &skip_build_pred);
 3171|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3172|       |      end_timing(cpi, compound_type_rd_time);
 3173|       |#endif
 3174|      0|      if (not_best_mode) continue;
  ------------------
  |  Branch (3174:11): [True: 0, False: 0]
  ------------------
 3175|      0|    }
 3176|       |
 3177|  5.52M|    if (!args->skip_ifs) {
  ------------------
  |  Branch (3177:9): [True: 0, False: 5.52M]
  ------------------
 3178|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3179|       |      start_timing(cpi, interpolation_filter_search_time);
 3180|       |#endif
 3181|       |      // Determine the interpolation filter for this mode
 3182|      0|      ret_val = av1_interpolation_filter_search(
 3183|      0|          x, cpi, tile_data, bsize, &tmp_dst, &orig_dst, &rd, &rs,
 3184|      0|          &skip_build_pred, args, ref_best_rd);
 3185|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3186|       |      end_timing(cpi, interpolation_filter_search_time);
 3187|       |#endif
 3188|      0|      if (args->modelled_rd != NULL && !is_comp_pred) {
  ------------------
  |  Branch (3188:11): [True: 0, False: 0]
  |  Branch (3188:40): [True: 0, False: 0]
  ------------------
 3189|      0|        args->modelled_rd[this_mode][ref_mv_idx][refs[0]] = rd;
 3190|      0|      }
 3191|      0|      if (ret_val != 0) {
  ------------------
  |  Branch (3191:11): [True: 0, False: 0]
  ------------------
 3192|      0|        restore_dst_buf(xd, orig_dst, num_planes);
 3193|      0|        continue;
 3194|      0|      } else if (cpi->sf.inter_sf.model_based_post_interp_filter_breakout &&
  ------------------
  |  Branch (3194:18): [True: 0, False: 0]
  ------------------
 3195|      0|                 ref_best_rd != INT64_MAX && (rd >> 3) * 3 > ref_best_rd) {
  ------------------
  |  Branch (3195:18): [True: 0, False: 0]
  |  Branch (3195:46): [True: 0, False: 0]
  ------------------
 3196|      0|        restore_dst_buf(xd, orig_dst, num_planes);
 3197|      0|        continue;
 3198|      0|      }
 3199|       |
 3200|       |      // Compute modelled RD if enabled
 3201|      0|      if (args->modelled_rd != NULL) {
  ------------------
  |  Branch (3201:11): [True: 0, False: 0]
  ------------------
 3202|      0|        if (is_comp_pred) {
  ------------------
  |  Branch (3202:13): [True: 0, False: 0]
  ------------------
 3203|      0|          const int mode0 = compound_ref0_mode(this_mode);
 3204|      0|          const int mode1 = compound_ref1_mode(this_mode);
 3205|      0|          const int64_t mrd =
 3206|      0|              AOMMIN(args->modelled_rd[mode0][ref_mv_idx][refs[0]],
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3207|      0|                     args->modelled_rd[mode1][ref_mv_idx][refs[1]]);
 3208|      0|          if ((rd >> 3) * 6 > mrd && ref_best_rd < INT64_MAX) {
  ------------------
  |  Branch (3208:15): [True: 0, False: 0]
  |  Branch (3208:38): [True: 0, False: 0]
  ------------------
 3209|      0|            restore_dst_buf(xd, orig_dst, num_planes);
 3210|      0|            continue;
 3211|      0|          }
 3212|      0|        }
 3213|      0|      }
 3214|      0|    }
 3215|       |
 3216|  5.52M|    rd_stats->rate += compmode_interinter_cost;
 3217|  5.52M|    if (skip_build_pred != INTERP_SKIP_LUMA_SKIP_CHROMA) {
  ------------------
  |  Branch (3217:9): [True: 5.52M, False: 18.4E]
  ------------------
 3218|       |      // Chroma plane of COMPOUND_DIFFWTD mode shares the segment mask of luma
 3219|       |      // which is stored in xd->seg_mask. Hence, the predictor is populated for
 3220|       |      // all planes. This should avoid usage of incorrect segment mask when the
 3221|       |      // call is made only for chroma.
 3222|  5.52M|      const int skip_luma_plane =
 3223|  5.52M|          skip_build_pred == INTERP_SKIP_LUMA_EVAL_CHROMA &&
  ------------------
  |  Branch (3223:11): [True: 0, False: 5.52M]
  ------------------
 3224|      0|          mbmi->interinter_comp.type != COMPOUND_DIFFWTD;
  ------------------
  |  Branch (3224:11): [True: 0, False: 0]
  ------------------
 3225|  5.52M|      const int start_plane = skip_luma_plane ? AOM_PLANE_U : AOM_PLANE_Y;
  ------------------
  |  |  282|      0|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                    const int start_plane = skip_luma_plane ? AOM_PLANE_U : AOM_PLANE_Y;
  ------------------
  |  |  281|  5.52M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (3225:31): [True: 0, False: 5.52M]
  ------------------
 3226|       |      // Build this inter predictor if it has not been previously built
 3227|  5.52M|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, &orig_dst, bsize,
 3228|  5.52M|                                    start_plane, num_planes - 1);
 3229|  5.52M|    }
 3230|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3231|       |    start_timing(cpi, motion_mode_rd_time);
 3232|       |#endif
 3233|  5.52M|    int rate2_nocoeff = rd_stats->rate;
 3234|       |    // Determine the motion mode. This will be one of SIMPLE_TRANSLATION,
 3235|       |    // OBMC_CAUSAL or WARPED_CAUSAL
 3236|  5.52M|    int64_t this_yrd;
 3237|  5.52M|    ret_val = motion_mode_rd(cpi, tile_data, x, bsize, rd_stats, rd_stats_y,
 3238|  5.52M|                             rd_stats_uv, args, ref_best_rd, skip_rd, &rate_mv,
 3239|  5.52M|                             &orig_dst, best_est_rd, do_tx_search,
 3240|  5.52M|                             inter_modes_info, 0, &this_yrd);
 3241|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 3242|       |    end_timing(cpi, motion_mode_rd_time);
 3243|       |#endif
 3244|  5.52M|    assert(
 3245|  5.52M|        IMPLIES(!av1_check_newmv_joint_nonzero(cm, x), ret_val == INT64_MAX));
 3246|       |
 3247|  5.52M|    if (ret_val != INT64_MAX) {
  ------------------
  |  Branch (3247:9): [True: 3.80M, False: 1.72M]
  ------------------
 3248|  3.80M|      int64_t tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|  3.80M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.80M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.80M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.80M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3249|  3.80M|      const THR_MODES mode_enum = get_prediction_mode_idx(
 3250|  3.80M|          mbmi->mode, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 3251|       |      // Collect mode stats for multiwinner mode processing
 3252|  3.80M|      store_winner_mode_stats(cpi, x, mbmi, rd_stats, rd_stats_y, rd_stats_uv,
 3253|  3.80M|                              mode_enum, NULL, bsize, tmp_rd,
 3254|  3.80M|                              cpi->sf.winner_mode_sf.multi_winner_mode_type,
 3255|  3.80M|                              do_tx_search);
 3256|  3.80M|      if (tmp_rd < best_rd) {
  ------------------
  |  Branch (3256:11): [True: 3.79M, False: 11.0k]
  ------------------
 3257|  3.79M|        best_yrd = this_yrd;
 3258|       |        // Update the best rd stats if we found the best mode so far
 3259|  3.79M|        best_rd_stats = *rd_stats;
 3260|  3.79M|        best_rd_stats_y = *rd_stats_y;
 3261|  3.79M|        best_rd_stats_uv = *rd_stats_uv;
 3262|  3.79M|        best_rd = tmp_rd;
 3263|  3.79M|        best_mbmi = *mbmi;
 3264|  3.79M|        best_xskip_txfm = txfm_info->skip_txfm;
 3265|  3.79M|        av1_copy_array(best_tx_type_map, xd->tx_type_map,
  ------------------
  |  |   38|  3.79M|  do {                                                    \
  |  |   39|  3.79M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  3.79M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  3.79M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 3.79M]
  |  |  ------------------
  ------------------
 3266|  3.79M|                       xd->height * xd->width);
 3267|  3.79M|        motion_mode_cand->rate_mv = rate_mv;
 3268|  3.79M|        motion_mode_cand->rate2_nocoeff = rate2_nocoeff;
 3269|  3.79M|      }
 3270|       |
 3271|  3.80M|      if (tmp_rd < ref_best_rd) {
  ------------------
  |  Branch (3271:11): [True: 3.69M, False: 114k]
  ------------------
 3272|  3.69M|        ref_best_rd = tmp_rd;
 3273|  3.69M|        best_ref_mv_idx = ref_mv_idx;
 3274|  3.69M|      }
 3275|  3.80M|    }
 3276|  5.52M|    restore_dst_buf(xd, orig_dst, num_planes);
 3277|  5.52M|  }
 3278|       |
 3279|  6.99M|  if (best_rd == INT64_MAX) return INT64_MAX;
  ------------------
  |  Branch (3279:7): [True: 3.23M, False: 3.75M]
  ------------------
 3280|       |
 3281|       |  // re-instate status of the best choice
 3282|  3.75M|  *rd_stats = best_rd_stats;
 3283|  3.75M|  *rd_stats_y = best_rd_stats_y;
 3284|  3.75M|  *rd_stats_uv = best_rd_stats_uv;
 3285|  3.75M|  *yrd = best_yrd;
 3286|  3.75M|  *mbmi = best_mbmi;
 3287|  3.75M|  txfm_info->skip_txfm = best_xskip_txfm;
 3288|  3.75M|  assert(IMPLIES(mbmi->comp_group_idx == 1,
 3289|  3.75M|                 mbmi->interinter_comp.type != COMPOUND_AVERAGE));
 3290|  3.75M|  av1_copy_array(xd->tx_type_map, best_tx_type_map, xd->height * xd->width);
  ------------------
  |  |   38|  3.75M|  do {                                                    \
  |  |   39|  3.75M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  3.75M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  3.75M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 3.75M]
  |  |  ------------------
  ------------------
 3291|       |
 3292|  3.75M|  rd_stats->rdcost = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|  3.75M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.75M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.75M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3293|       |
 3294|  3.75M|  return rd_stats->rdcost;
 3295|  6.99M|}
rdopt.c:ref_mv_idx_to_search:
 2239|  6.99M|                                const int ref_set) {
 2240|       |  // If the number of ref mv count is equal to 1, do not prune the same. It
 2241|       |  // is better to evaluate the same than to prune it.
 2242|  6.99M|  if (ref_set == 1) return 1;
  ------------------
  |  Branch (2242:7): [True: 6.78M, False: 209k]
  ------------------
 2243|   209k|  AV1_COMMON *const cm = &cpi->common;
 2244|   209k|  const MACROBLOCKD *const xd = &x->e_mbd;
 2245|   209k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
 2246|   209k|  const PREDICTION_MODE this_mode = mbmi->mode;
 2247|       |
 2248|       |  // Only search indices if they have some chance of being good.
 2249|   209k|  int good_indices = 0;
 2250|   724k|  for (int i = 0; i < ref_set; ++i) {
  ------------------
  |  Branch (2250:19): [True: 515k, False: 209k]
  ------------------
 2251|   515k|    if (ref_mv_idx_early_breakout(&cpi->sf, &cpi->ref_frame_dist_info, x, args,
  ------------------
  |  Branch (2251:9): [True: 49, False: 515k]
  ------------------
 2252|   515k|                                  ref_best_rd, i)) {
 2253|     49|      continue;
 2254|     49|    }
 2255|   515k|    mask_set_bit(&good_indices, i);
 2256|   515k|  }
 2257|       |
 2258|       |  // Only prune in NEARMV mode, if the speed feature is set, and the block size
 2259|       |  // is large enough. If these conditions are not met, return all good indices
 2260|       |  // found so far.
 2261|   209k|  if (!cpi->sf.inter_sf.prune_mode_search_simple_translation)
  ------------------
  |  Branch (2261:7): [True: 0, False: 209k]
  ------------------
 2262|      0|    return good_indices;
 2263|   209k|  if (!have_nearmv_in_inter_mode(this_mode)) return good_indices;
  ------------------
  |  Branch (2263:7): [True: 171k, False: 38.1k]
  ------------------
 2264|  38.1k|  if (num_pels_log2_lookup[bsize] <= 6) return good_indices;
  ------------------
  |  Branch (2264:7): [True: 36.8k, False: 1.28k]
  ------------------
 2265|       |  // Do not prune when there is internal resizing. TODO(elliottk) fix this
 2266|       |  // so b/2384 can be resolved.
 2267|  1.28k|  if (av1_is_scaled(get_ref_scale_factors(cm, mbmi->ref_frame[0])) ||
  ------------------
  |  Branch (2267:7): [True: 505, False: 779]
  ------------------
 2268|    779|      (mbmi->ref_frame[1] > 0 &&
  ------------------
  |  Branch (2268:8): [True: 0, False: 779]
  ------------------
 2269|  1.18k|       av1_is_scaled(get_ref_scale_factors(cm, mbmi->ref_frame[1])))) {
  ------------------
  |  Branch (2269:8): [True: 0, False: 0]
  ------------------
 2270|  1.18k|    return good_indices;
 2271|  1.18k|  }
 2272|       |
 2273|       |  // Calculate the RD cost for the motion vectors using simple translation.
 2274|    101|  int64_t idx_rdcost[] = { INT64_MAX, INT64_MAX, INT64_MAX };
 2275|  2.10k|  for (int ref_mv_idx = 0; ref_mv_idx < ref_set; ++ref_mv_idx) {
  ------------------
  |  Branch (2275:28): [True: 2.00k, False: 101]
  ------------------
 2276|       |    // If this index is bad, ignore it.
 2277|  2.00k|    if (!mask_check_bit(good_indices, ref_mv_idx)) {
  ------------------
  |  Branch (2277:9): [True: 0, False: 2.00k]
  ------------------
 2278|      0|      continue;
 2279|      0|    }
 2280|  2.00k|    idx_rdcost[ref_mv_idx] = simple_translation_pred_rd(
 2281|  2.00k|        cpi, x, args, ref_mv_idx, ref_best_rd, bsize);
 2282|  2.00k|  }
 2283|       |  // Find the index with the best RD cost.
 2284|    101|  int best_idx = 0;
 2285|  1.65k|  for (int i = 1; i < MAX_REF_MV_SEARCH; ++i) {
  ------------------
  |  |   25|  1.65k|#define MAX_REF_MV_SEARCH 3
  ------------------
  |  Branch (2285:19): [True: 1.55k, False: 101]
  ------------------
 2286|  1.55k|    if (idx_rdcost[i] < idx_rdcost[best_idx]) {
  ------------------
  |  Branch (2286:9): [True: 453, False: 1.10k]
  ------------------
 2287|    453|      best_idx = i;
 2288|    453|    }
 2289|  1.55k|  }
 2290|       |  // Only include indices that are good and within a % of the best.
 2291|    101|  const double dth = has_second_ref(mbmi) ? 1.05 : 1.001;
  ------------------
  |  Branch (2291:22): [True: 0, False: 101]
  ------------------
 2292|       |  // If the simple translation cost is not within this multiple of the
 2293|       |  // best RD, skip it. Note that the cutoff is derived experimentally.
 2294|    101|  const double ref_dth = 5;
 2295|    101|  int result = 0;
 2296|  2.10k|  for (int i = 0; i < ref_set; ++i) {
  ------------------
  |  Branch (2296:19): [True: 2.00k, False: 101]
  ------------------
 2297|  2.00k|    if (mask_check_bit(good_indices, i) &&
  ------------------
  |  Branch (2297:9): [True: 2.00k, False: 0]
  ------------------
 2298|  2.00k|        (1.0 * idx_rdcost[i]) / idx_rdcost[best_idx] < dth &&
  ------------------
  |  Branch (2298:9): [True: 810, False: 1.19k]
  ------------------
 2299|    810|        (1.0 * idx_rdcost[i]) / ref_best_rd < ref_dth) {
  ------------------
  |  Branch (2299:9): [True: 802, False: 8]
  ------------------
 2300|    802|      mask_set_bit(&result, i);
 2301|    802|    }
 2302|  2.00k|  }
 2303|    101|  return result;
 2304|  1.28k|}
rdopt.c:ref_mv_idx_early_breakout:
 2099|   515k|    int ref_mv_idx) {
 2100|   515k|  MACROBLOCKD *xd = &x->e_mbd;
 2101|   515k|  MB_MODE_INFO *mbmi = xd->mi[0];
 2102|   515k|  const MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 2103|   515k|  const int8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 2104|   515k|  const int is_comp_pred = has_second_ref(mbmi);
 2105|   515k|  if (sf->inter_sf.reduce_inter_modes && ref_mv_idx > 0) {
  ------------------
  |  Branch (2105:7): [True: 515k, False: 11]
  |  Branch (2105:42): [True: 305k, False: 209k]
  ------------------
 2106|   305k|    if (mbmi->ref_frame[0] == LAST2_FRAME ||
  ------------------
  |  Branch (2106:9): [True: 2, False: 305k]
  ------------------
 2107|   305k|        mbmi->ref_frame[0] == LAST3_FRAME ||
  ------------------
  |  Branch (2107:9): [True: 18.4E, False: 305k]
  ------------------
 2108|   305k|        mbmi->ref_frame[1] == LAST2_FRAME ||
  ------------------
  |  Branch (2108:9): [True: 18.4E, False: 305k]
  ------------------
 2109|   305k|        mbmi->ref_frame[1] == LAST3_FRAME) {
  ------------------
  |  Branch (2109:9): [True: 18.4E, False: 305k]
  ------------------
 2110|      0|      const int has_nearmv = have_nearmv_in_inter_mode(mbmi->mode) ? 1 : 0;
  ------------------
  |  Branch (2110:30): [True: 0, False: 0]
  ------------------
 2111|      0|      if (mbmi_ext->weight[ref_frame_type][ref_mv_idx + has_nearmv] <
  ------------------
  |  Branch (2111:11): [True: 0, False: 0]
  ------------------
 2112|      0|          REF_CAT_LEVEL) {
  ------------------
  |  |  512|      0|#define REF_CAT_LEVEL 640
  ------------------
 2113|      0|        return true;
 2114|      0|      }
 2115|      0|    }
 2116|       |    // TODO(any): Experiment with reduce_inter_modes for compound prediction
 2117|   305k|    if (sf->inter_sf.reduce_inter_modes >= 2 && !is_comp_pred &&
  ------------------
  |  Branch (2117:9): [True: 305k, False: 18.4E]
  |  Branch (2117:49): [True: 305k, False: 1]
  ------------------
 2118|   305k|        have_newmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (2118:9): [True: 245k, False: 60.2k]
  ------------------
 2119|   245k|      if (mbmi->ref_frame[0] != ref_frame_dist_info->nearest_past_ref &&
  ------------------
  |  Branch (2119:11): [True: 0, False: 245k]
  ------------------
 2120|      0|          mbmi->ref_frame[0] != ref_frame_dist_info->nearest_future_ref) {
  ------------------
  |  Branch (2120:11): [True: 0, False: 0]
  ------------------
 2121|      0|        const int has_nearmv = have_nearmv_in_inter_mode(mbmi->mode) ? 1 : 0;
  ------------------
  |  Branch (2121:32): [True: 0, False: 0]
  ------------------
 2122|      0|        const int do_prune = prune_ref_mv_idx_using_qindex(
 2123|      0|            sf->inter_sf.reduce_inter_modes, x->qindex, ref_mv_idx);
 2124|      0|        if (do_prune &&
  ------------------
  |  Branch (2124:13): [True: 0, False: 0]
  ------------------
 2125|      0|            (mbmi_ext->weight[ref_frame_type][ref_mv_idx + has_nearmv] <
  ------------------
  |  Branch (2125:13): [True: 0, False: 0]
  ------------------
 2126|      0|             REF_CAT_LEVEL)) {
  ------------------
  |  |  512|      0|#define REF_CAT_LEVEL 640
  ------------------
 2127|      0|          return true;
 2128|      0|        }
 2129|      0|      }
 2130|   245k|    }
 2131|   305k|  }
 2132|       |
 2133|   515k|  mbmi->ref_mv_idx = ref_mv_idx;
 2134|   515k|  if (is_comp_pred && (!is_single_newmv_valid(args, mbmi, mbmi->mode))) {
  ------------------
  |  Branch (2134:7): [True: 0, False: 515k]
  |  Branch (2134:23): [True: 0, False: 0]
  ------------------
 2135|      0|    return true;
 2136|      0|  }
 2137|   515k|  size_t est_rd_rate = args->ref_frame_cost + args->single_comp_cost;
 2138|   515k|  const int drl_cost = get_drl_cost(
 2139|   515k|      mbmi, mbmi_ext, x->mode_costs.drl_mode_cost0, ref_frame_type);
 2140|   515k|  est_rd_rate += drl_cost;
 2141|   515k|  if (RDCOST(x->rdmult, est_rd_rate, 0) > ref_best_rd &&
  ------------------
  |  |   33|   515k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   515k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   515k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   515k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2141:7): [True: 49, False: 515k]
  ------------------
 2142|     49|      mbmi->mode != NEARESTMV && mbmi->mode != NEAREST_NEARESTMV) {
  ------------------
  |  Branch (2142:7): [True: 49, False: 0]
  |  Branch (2142:34): [True: 49, False: 0]
  ------------------
 2143|     49|    return true;
 2144|     49|  }
 2145|   515k|  return false;
 2146|   515k|}
rdopt.c:mask_set_bit:
 2226|   516k|static inline void mask_set_bit(int *mask, int index) { *mask |= (1 << index); }
rdopt.c:simple_translation_pred_rd:
 2152|  2.00k|                                          BLOCK_SIZE bsize) {
 2153|  2.00k|  MACROBLOCKD *xd = &x->e_mbd;
 2154|  2.00k|  MB_MODE_INFO *mbmi = xd->mi[0];
 2155|  2.00k|  MB_MODE_INFO_EXT *const mbmi_ext = &x->mbmi_ext;
 2156|  2.00k|  const int8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 2157|  2.00k|  const AV1_COMMON *cm = &cpi->common;
 2158|  2.00k|  const int is_comp_pred = has_second_ref(mbmi);
 2159|  2.00k|  const ModeCosts *mode_costs = &x->mode_costs;
 2160|       |
 2161|  2.00k|  struct macroblockd_plane *p = xd->plane;
 2162|  2.00k|  const BUFFER_SET orig_dst = {
 2163|  2.00k|    { p[0].dst.buf, p[1].dst.buf, p[2].dst.buf },
 2164|  2.00k|    { p[0].dst.stride, p[1].dst.stride, p[2].dst.stride },
 2165|  2.00k|  };
 2166|  2.00k|  RD_STATS rd_stats;
 2167|  2.00k|  av1_init_rd_stats(&rd_stats);
 2168|       |
 2169|  2.00k|  mbmi->interinter_comp.type = COMPOUND_AVERAGE;
 2170|  2.00k|  mbmi->comp_group_idx = 0;
 2171|  2.00k|  mbmi->compound_idx = 1;
 2172|  2.00k|  if (mbmi->ref_frame[1] == INTRA_FRAME) {
  ------------------
  |  Branch (2172:7): [True: 0, False: 2.00k]
  ------------------
 2173|      0|    mbmi->ref_frame[1] = NONE_FRAME;
 2174|      0|  }
 2175|  2.00k|  int16_t mode_ctx =
 2176|  2.00k|      av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
 2177|       |
 2178|  2.00k|  mbmi->num_proj_ref = 0;
 2179|  2.00k|  mbmi->motion_mode = SIMPLE_TRANSLATION;
 2180|  2.00k|  mbmi->ref_mv_idx = ref_mv_idx;
 2181|       |
 2182|  2.00k|  rd_stats.rate += args->ref_frame_cost + args->single_comp_cost;
 2183|  2.00k|  const int drl_cost =
 2184|  2.00k|      get_drl_cost(mbmi, mbmi_ext, mode_costs->drl_mode_cost0, ref_frame_type);
 2185|  2.00k|  rd_stats.rate += drl_cost;
 2186|       |
 2187|  2.00k|  int_mv cur_mv[2];
 2188|  2.00k|  if (!build_cur_mv(cur_mv, mbmi->mode, cm, x, 0)) {
  ------------------
  |  Branch (2188:7): [True: 56, False: 1.95k]
  ------------------
 2189|     56|    return INT64_MAX;
 2190|     56|  }
 2191|  2.00k|  assert(have_nearmv_in_inter_mode(mbmi->mode));
 2192|  3.90k|  for (int i = 0; i < is_comp_pred + 1; ++i) {
  ------------------
  |  Branch (2192:19): [True: 1.95k, False: 1.95k]
  ------------------
 2193|  1.95k|    mbmi->mv[i].as_int = cur_mv[i].as_int;
 2194|  1.95k|  }
 2195|  1.95k|  const int ref_mv_cost = cost_mv_ref(mode_costs, mbmi->mode, mode_ctx);
 2196|  1.95k|  rd_stats.rate += ref_mv_cost;
 2197|       |
 2198|  1.95k|  if (RDCOST(x->rdmult, rd_stats.rate, 0) > ref_best_rd) {
  ------------------
  |  |   33|  1.95k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.95k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.95k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.95k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2198:7): [True: 2, False: 1.94k]
  ------------------
 2199|      2|    return INT64_MAX;
 2200|      2|  }
 2201|       |
 2202|  1.94k|  mbmi->motion_mode = SIMPLE_TRANSLATION;
 2203|  1.94k|  mbmi->num_proj_ref = 0;
 2204|  1.94k|  if (is_comp_pred) {
  ------------------
  |  Branch (2204:7): [True: 0, False: 1.94k]
  ------------------
 2205|       |    // Only compound_average
 2206|      0|    mbmi->interinter_comp.type = COMPOUND_AVERAGE;
 2207|      0|    mbmi->comp_group_idx = 0;
 2208|      0|    mbmi->compound_idx = 1;
 2209|      0|  }
 2210|  1.94k|  set_default_interp_filters(mbmi, cm->features.interp_filter);
 2211|       |
 2212|  1.94k|  const int mi_row = xd->mi_row;
 2213|  1.94k|  const int mi_col = xd->mi_col;
 2214|  1.94k|  av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, &orig_dst, bsize,
 2215|  1.94k|                                AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  1.94k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                                              AOM_PLANE_Y, AOM_PLANE_Y);
  ------------------
  |  |  281|  1.94k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2216|  1.94k|  int est_rate;
 2217|  1.94k|  int64_t est_dist;
 2218|  1.94k|  model_rd_sb_fn[MODELRD_CURVFIT](cpi, bsize, x, xd, 0, 0, &est_rate, &est_dist,
 2219|  1.94k|                                  NULL, NULL, NULL, NULL, NULL);
 2220|  1.94k|  return RDCOST(x->rdmult, rd_stats.rate + est_rate, est_dist);
  ------------------
  |  |   33|  1.94k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.94k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.94k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.94k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2221|  1.95k|}
rdopt.c:get_drl_cost:
 2021|  7.81M|                               int8_t ref_frame_type) {
 2022|  7.81M|  int cost = 0;
 2023|  7.81M|  if (mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV) {
  ------------------
  |  Branch (2023:7): [True: 2.56M, False: 5.24M]
  |  Branch (2023:30): [True: 18.4E, False: 5.24M]
  ------------------
 2024|  6.87M|    for (int idx = 0; idx < 2; ++idx) {
  ------------------
  |  Branch (2024:23): [True: 4.79M, False: 2.07M]
  ------------------
 2025|  4.79M|      if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (2025:11): [True: 1.12M, False: 3.66M]
  ------------------
 2026|  1.12M|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
 2027|  1.12M|        cost += drl_mode_cost0[drl_ctx][mbmi->ref_mv_idx != idx];
 2028|  1.12M|        if (mbmi->ref_mv_idx == idx) return cost;
  ------------------
  |  Branch (2028:13): [True: 490k, False: 638k]
  ------------------
 2029|  1.12M|      }
 2030|  4.79M|    }
 2031|  2.07M|    return cost;
 2032|  2.56M|  }
 2033|       |
 2034|  5.24M|  if (have_nearmv_in_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (2034:7): [True: 1.43M, False: 3.80M]
  ------------------
 2035|  4.11M|    for (int idx = 1; idx < 3; ++idx) {
  ------------------
  |  Branch (2035:23): [True: 2.79M, False: 1.31M]
  ------------------
 2036|  2.79M|      if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
  ------------------
  |  Branch (2036:11): [True: 287k, False: 2.51M]
  ------------------
 2037|   287k|        uint8_t drl_ctx = av1_drl_ctx(mbmi_ext->weight[ref_frame_type], idx);
 2038|   287k|        cost += drl_mode_cost0[drl_ctx][mbmi->ref_mv_idx != (idx - 1)];
 2039|   287k|        if (mbmi->ref_mv_idx == (idx - 1)) return cost;
  ------------------
  |  Branch (2039:13): [True: 121k, False: 165k]
  ------------------
 2040|   287k|      }
 2041|  2.79M|    }
 2042|  1.31M|    return cost;
 2043|  1.43M|  }
 2044|  3.80M|  return cost;
 2045|  5.24M|}
rdopt.c:mask_check_bit:
 2228|  7.30M|static inline bool mask_check_bit(int mask, int index) {
 2229|  7.30M|  return (mask >> index) & 0x1;
 2230|  7.30M|}
rdopt.c:build_cur_mv:
 1991|  7.29M|                               int skip_repeated_ref_mv) {
 1992|  7.29M|  const MACROBLOCKD *xd = &x->e_mbd;
 1993|  7.29M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 1994|  7.29M|  const int is_comp_pred = has_second_ref(mbmi);
 1995|       |
 1996|  7.29M|  int ret = 1;
 1997|  14.5M|  for (int i = 0; i < is_comp_pred + 1; ++i) {
  ------------------
  |  Branch (1997:19): [True: 7.29M, False: 7.29M]
  ------------------
 1998|  7.29M|    int_mv this_mv;
 1999|  7.29M|    this_mv.as_int = INVALID_MV;
  ------------------
  |  |   26|  7.29M|#define INVALID_MV 0x80008000
  ------------------
 2000|  7.29M|    ret = get_this_mv(&this_mv, this_mode, i, mbmi->ref_mv_idx,
 2001|  7.29M|                      skip_repeated_ref_mv, mbmi->ref_frame, &x->mbmi_ext);
 2002|  7.29M|    if (!ret) return 0;
  ------------------
  |  Branch (2002:9): [True: 0, False: 7.29M]
  ------------------
 2003|  7.29M|    const PREDICTION_MODE single_mode = get_single_mode(this_mode, i);
 2004|  7.29M|    if (single_mode == NEWMV) {
  ------------------
  |  Branch (2004:9): [True: 2.15M, False: 5.14M]
  ------------------
 2005|  2.15M|      const uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
 2006|  2.15M|      cur_mv[i] =
 2007|  2.15M|          (i == 0) ? x->mbmi_ext.ref_mv_stack[ref_frame_type][mbmi->ref_mv_idx]
  ------------------
  |  Branch (2007:11): [True: 2.15M, False: 18.4E]
  ------------------
 2008|  2.15M|                         .this_mv
 2009|  18.4E|                   : x->mbmi_ext.ref_mv_stack[ref_frame_type][mbmi->ref_mv_idx]
 2010|  18.4E|                         .comp_mv;
 2011|  5.14M|    } else {
 2012|  5.14M|      ret &= clamp_and_check_mv(cur_mv + i, this_mv, cm, x);
 2013|  5.14M|    }
 2014|  7.29M|  }
 2015|  7.29M|  return ret;
 2016|  7.29M|}
rdopt.c:clamp_and_check_mv:
 1164|  5.14M|                                     const MACROBLOCK *x) {
 1165|  5.14M|  const MACROBLOCKD *const xd = &x->e_mbd;
 1166|  5.14M|  *out_mv = in_mv;
 1167|  5.14M|  lower_mv_precision(&out_mv->as_mv, cm->features.allow_high_precision_mv,
 1168|  5.14M|                     cm->features.cur_frame_force_integer_mv);
 1169|  5.14M|  clamp_mv2(&out_mv->as_mv, xd);
 1170|  5.14M|  return av1_is_fullmv_in_range(&x->mv_limits,
 1171|  5.14M|                                get_fullmv_from_mv(&out_mv->as_mv));
 1172|  5.14M|}
rdopt.c:clamp_mv2:
 1096|  5.14M|static inline void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
 1097|  5.14M|  const SubpelMvLimits mv_limits = { xd->mb_to_left_edge - LEFT_TOP_MARGIN,
  ------------------
  |  | 1092|  5.14M|#define LEFT_TOP_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   32|  5.14M|#define AOM_BORDER_IN_PIXELS 288
  |  |  ------------------
  |  |               #define LEFT_TOP_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   31|  5.14M|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 1098|  5.14M|                                     xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN,
  ------------------
  |  | 1093|  5.14M|#define RIGHT_BOTTOM_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   32|  5.14M|#define AOM_BORDER_IN_PIXELS 288
  |  |  ------------------
  |  |               #define RIGHT_BOTTOM_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   31|  5.14M|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 1099|  5.14M|                                     xd->mb_to_top_edge - LEFT_TOP_MARGIN,
  ------------------
  |  | 1092|  5.14M|#define LEFT_TOP_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   32|  5.14M|#define AOM_BORDER_IN_PIXELS 288
  |  |  ------------------
  |  |               #define LEFT_TOP_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   31|  5.14M|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 1100|  5.14M|                                     xd->mb_to_bottom_edge +
 1101|  5.14M|                                         RIGHT_BOTTOM_MARGIN };
  ------------------
  |  | 1093|  5.14M|#define RIGHT_BOTTOM_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   32|  5.14M|#define AOM_BORDER_IN_PIXELS 288
  |  |  ------------------
  |  |               #define RIGHT_BOTTOM_MARGIN ((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << 3)
  |  |  ------------------
  |  |  |  |   31|  5.14M|#define AOM_INTERP_EXTEND 4
  |  |  ------------------
  ------------------
 1102|  5.14M|  clamp_mv(mv, &mv_limits);
 1103|  5.14M|}
rdopt.c:handle_newmv:
 1189|  2.15M|                            inter_mode_info *mode_info) {
 1190|  2.15M|  MACROBLOCKD *const xd = &x->e_mbd;
 1191|  2.15M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 1192|  2.15M|  const int is_comp_pred = has_second_ref(mbmi);
 1193|  2.15M|  const PREDICTION_MODE this_mode = mbmi->mode;
 1194|  2.15M|  const int refs[2] = { mbmi->ref_frame[0],
 1195|  18.4E|                        mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1] };
  ------------------
  |  Branch (1195:25): [True: 2.15M, False: 18.4E]
  ------------------
 1196|  2.15M|  const int ref_mv_idx = mbmi->ref_mv_idx;
 1197|       |
 1198|  2.15M|  if (is_comp_pred) {
  ------------------
  |  Branch (1198:7): [True: 0, False: 2.15M]
  ------------------
 1199|      0|    const int valid_mv0 = args->single_newmv_valid[ref_mv_idx][refs[0]];
 1200|      0|    const int valid_mv1 = args->single_newmv_valid[ref_mv_idx][refs[1]];
 1201|      0|    if (this_mode == NEW_NEWMV) {
  ------------------
  |  Branch (1201:9): [True: 0, False: 0]
  ------------------
 1202|      0|      if (valid_mv0) {
  ------------------
  |  Branch (1202:11): [True: 0, False: 0]
  ------------------
 1203|      0|        cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int;
 1204|      0|        clamp_mv_in_range(x, &cur_mv[0], 0);
 1205|      0|      }
 1206|      0|      if (valid_mv1) {
  ------------------
  |  Branch (1206:11): [True: 0, False: 0]
  ------------------
 1207|      0|        cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int;
 1208|      0|        clamp_mv_in_range(x, &cur_mv[1], 1);
 1209|      0|      }
 1210|      0|      *rate_mv = 0;
 1211|      0|      for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (1211:23): [True: 0, False: 0]
  ------------------
 1212|      0|        const int_mv ref_mv = av1_get_ref_mv(x, i);
 1213|      0|        *rate_mv += av1_mv_bit_cost(&cur_mv[i].as_mv, &ref_mv.as_mv,
 1214|      0|                                    x->mv_costs->nmv_joint_cost,
 1215|      0|                                    x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
 1216|      0|      }
 1217|      0|    } else if (this_mode == NEAREST_NEWMV || this_mode == NEAR_NEWMV) {
  ------------------
  |  Branch (1217:16): [True: 0, False: 0]
  |  Branch (1217:46): [True: 0, False: 0]
  ------------------
 1218|      0|      if (valid_mv1) {
  ------------------
  |  Branch (1218:11): [True: 0, False: 0]
  ------------------
 1219|      0|        cur_mv[1].as_int = args->single_newmv[ref_mv_idx][refs[1]].as_int;
 1220|      0|        clamp_mv_in_range(x, &cur_mv[1], 1);
 1221|      0|      }
 1222|      0|      const int_mv ref_mv = av1_get_ref_mv(x, 1);
 1223|      0|      *rate_mv = av1_mv_bit_cost(&cur_mv[1].as_mv, &ref_mv.as_mv,
 1224|      0|                                 x->mv_costs->nmv_joint_cost,
 1225|      0|                                 x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
 1226|      0|    } else {
 1227|      0|      assert(this_mode == NEW_NEARESTMV || this_mode == NEW_NEARMV);
 1228|      0|      if (valid_mv0) {
  ------------------
  |  Branch (1228:11): [True: 0, False: 0]
  ------------------
 1229|      0|        cur_mv[0].as_int = args->single_newmv[ref_mv_idx][refs[0]].as_int;
 1230|      0|        clamp_mv_in_range(x, &cur_mv[0], 0);
 1231|      0|      }
 1232|      0|      const int_mv ref_mv = av1_get_ref_mv(x, 0);
 1233|      0|      *rate_mv = av1_mv_bit_cost(&cur_mv[0].as_mv, &ref_mv.as_mv,
 1234|      0|                                 x->mv_costs->nmv_joint_cost,
 1235|      0|                                 x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|      0|#define MV_COST_WEIGHT 108
  ------------------
 1236|      0|    }
 1237|  2.15M|  } else {
 1238|       |    // Single ref case.
 1239|  2.15M|    const int ref_idx = 0;
 1240|  2.15M|    int search_range = INT_MAX;
 1241|       |
 1242|  2.15M|    if (cpi->sf.mv_sf.reduce_search_range && mbmi->ref_mv_idx > 0) {
  ------------------
  |  Branch (1242:9): [True: 2.15M, False: 152]
  |  Branch (1242:46): [True: 245k, False: 1.90M]
  ------------------
 1243|   245k|      const MV ref_mv = av1_get_ref_mv(x, ref_idx).as_mv;
 1244|   245k|      int min_mv_diff = INT_MAX;
 1245|   245k|      int best_match = -1;
 1246|   245k|      MV prev_ref_mv[2] = { { 0 } };
 1247|   564k|      for (int idx = 0; idx < mbmi->ref_mv_idx; ++idx) {
  ------------------
  |  Branch (1247:25): [True: 319k, False: 245k]
  ------------------
 1248|   319k|        prev_ref_mv[idx] = av1_get_ref_mv_from_stack(ref_idx, mbmi->ref_frame,
 1249|   319k|                                                     idx, &x->mbmi_ext)
 1250|   319k|                               .as_mv;
 1251|   319k|        const int ref_mv_diff = AOMMAX(abs(ref_mv.row - prev_ref_mv[idx].row),
  ------------------
  |  |   35|   319k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 156k, False: 163k]
  |  |  ------------------
  ------------------
 1252|   319k|                                       abs(ref_mv.col - prev_ref_mv[idx].col));
 1253|       |
 1254|   319k|        if (min_mv_diff > ref_mv_diff) {
  ------------------
  |  Branch (1254:13): [True: 280k, False: 39.3k]
  ------------------
 1255|   280k|          min_mv_diff = ref_mv_diff;
 1256|   280k|          best_match = idx;
 1257|   280k|        }
 1258|   319k|      }
 1259|       |
 1260|   245k|      if (min_mv_diff < (16 << 3)) {
  ------------------
  |  Branch (1260:11): [True: 158k, False: 87.1k]
  ------------------
 1261|   158k|        if (args->single_newmv_valid[best_match][refs[0]]) {
  ------------------
  |  Branch (1261:13): [True: 148k, False: 9.49k]
  ------------------
 1262|   148k|          search_range = min_mv_diff;
 1263|   148k|          search_range +=
 1264|   148k|              AOMMAX(abs(args->single_newmv[best_match][refs[0]].as_mv.row -
  ------------------
  |  |   35|   148k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 67.0k, False: 81.6k]
  |  |  ------------------
  ------------------
 1265|   148k|                         prev_ref_mv[best_match].row),
 1266|   148k|                     abs(args->single_newmv[best_match][refs[0]].as_mv.col -
 1267|   148k|                         prev_ref_mv[best_match].col));
 1268|       |          // Get full pixel search range.
 1269|   148k|          search_range = (search_range + 4) >> 3;
 1270|   148k|        }
 1271|   158k|      }
 1272|   245k|    }
 1273|       |
 1274|  2.15M|    int_mv best_mv;
 1275|  2.15M|    av1_single_motion_search(cpi, x, bsize, ref_idx, rate_mv, search_range,
 1276|  2.15M|                             mode_info, &best_mv, args);
 1277|  2.15M|    if (best_mv.as_int == INVALID_MV) return INT64_MAX;
  ------------------
  |  |   26|  2.15M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (1277:9): [True: 132k, False: 2.02M]
  ------------------
 1278|       |
 1279|  2.02M|    args->single_newmv[ref_mv_idx][refs[0]] = best_mv;
 1280|  2.02M|    args->single_newmv_rate[ref_mv_idx][refs[0]] = *rate_mv;
 1281|  2.02M|    args->single_newmv_valid[ref_mv_idx][refs[0]] = 1;
 1282|  2.02M|    cur_mv[0].as_int = best_mv.as_int;
 1283|       |
 1284|       |    // Return after single_newmv is set.
 1285|  2.02M|    if (mode_info[mbmi->ref_mv_idx].skip) return INT64_MAX;
  ------------------
  |  Branch (1285:9): [True: 1.17k, False: 2.01M]
  ------------------
 1286|  2.02M|  }
 1287|       |
 1288|  2.01M|  return 0;
 1289|  2.15M|}
rdopt.c:prune_zero_mv_with_sse:
 2691|  1.89M|                                         int prune_zero_mv_with_sse) {
 2692|  1.89M|  const MACROBLOCKD *xd = &x->e_mbd;
 2693|  1.89M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 2694|       |
 2695|  1.89M|  const int is_comp_pred = has_second_ref(mbmi);
 2696|  1.89M|  const MV_REFERENCE_FRAME *refs = mbmi->ref_frame;
 2697|       |
 2698|  3.78M|  for (int idx = 0; idx < 1 + is_comp_pred; idx++) {
  ------------------
  |  Branch (2698:21): [True: 1.89M, False: 1.89M]
  ------------------
 2699|  1.89M|    if (xd->global_motion[refs[idx]].wmtype != IDENTITY) {
  ------------------
  |  Branch (2699:9): [True: 0, False: 1.89M]
  ------------------
 2700|       |      // Pruning logic only works for IDENTITY type models
 2701|       |      // Note: In theory we could apply similar logic for TRANSLATION
 2702|       |      // type models, but we do not code these due to a spec bug
 2703|       |      // (see comments in gm_get_motion_vector() in av1/common/mv.h)
 2704|      0|      assert(xd->global_motion[refs[idx]].wmtype != TRANSLATION);
 2705|      0|      return 0;
 2706|      0|    }
 2707|       |
 2708|       |    // Don't prune if we have invalid data
 2709|  1.89M|    assert(mbmi->mv[idx].as_int == 0);
 2710|  1.89M|    if (args->best_single_sse_in_refs[refs[idx]] == INT32_MAX) {
  ------------------
  |  Branch (2710:9): [True: 0, False: 1.89M]
  ------------------
 2711|      0|      return 0;
 2712|      0|    }
 2713|  1.89M|  }
 2714|       |
 2715|       |  // Sum up the sse of ZEROMV and best NEWMV
 2716|  1.89M|  unsigned int this_sse_sum = 0;
 2717|  1.89M|  unsigned int best_sse_sum = 0;
 2718|  3.78M|  for (int idx = 0; idx < 1 + is_comp_pred; idx++) {
  ------------------
  |  Branch (2718:21): [True: 1.89M, False: 1.89M]
  ------------------
 2719|  1.89M|    const struct macroblock_plane *const p = &x->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  1.89M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2720|  1.89M|    const struct macroblockd_plane *pd = xd->plane;
 2721|  1.89M|    const struct buf_2d *src_buf = &p->src;
 2722|  1.89M|    const struct buf_2d *ref_buf = &pd->pre[idx];
 2723|  1.89M|    const uint8_t *src = src_buf->buf;
 2724|  1.89M|    const uint8_t *ref = ref_buf->buf;
 2725|  1.89M|    const int src_stride = src_buf->stride;
 2726|  1.89M|    const int ref_stride = ref_buf->stride;
 2727|       |
 2728|  1.89M|    unsigned int this_sse;
 2729|  1.89M|    fn_ptr[bsize].vf(ref, ref_stride, src, src_stride, &this_sse);
 2730|  1.89M|    this_sse_sum += this_sse;
 2731|       |
 2732|  1.89M|    const unsigned int best_sse = args->best_single_sse_in_refs[refs[idx]];
 2733|  1.89M|    best_sse_sum += best_sse;
 2734|  1.89M|  }
 2735|       |
 2736|  1.89M|  const double mul = prune_zero_mv_with_sse > 1 ? 1.00 : 1.25;
  ------------------
  |  Branch (2736:22): [True: 1.89M, False: 538]
  ------------------
 2737|  1.89M|  if ((double)this_sse_sum > (mul * (double)best_sse_sum)) {
  ------------------
  |  Branch (2737:7): [True: 1.61M, False: 280k]
  ------------------
 2738|  1.61M|    return 1;
 2739|  1.61M|  }
 2740|       |
 2741|   280k|  return 0;
 2742|  1.89M|}
rdopt.c:motion_mode_rd:
 1421|  9.26M|    int eval_motion_mode, int64_t *yrd) {
 1422|  9.26M|  const AV1_COMMON *const cm = &cpi->common;
 1423|  9.26M|  const FeatureFlags *const features = &cm->features;
 1424|  9.26M|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 1425|  9.26M|  const int num_planes = av1_num_planes(cm);
 1426|  9.26M|  MACROBLOCKD *xd = &x->e_mbd;
 1427|  9.26M|  MB_MODE_INFO *mbmi = xd->mi[0];
 1428|  9.26M|  const int is_comp_pred = has_second_ref(mbmi);
 1429|  9.26M|  const PREDICTION_MODE this_mode = mbmi->mode;
 1430|  9.26M|  const int rate2_nocoeff = rd_stats->rate;
 1431|  9.26M|  int best_xskip_txfm = 0;
 1432|  9.26M|  RD_STATS best_rd_stats, best_rd_stats_y, best_rd_stats_uv;
 1433|  9.26M|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 1434|  9.26M|  const int rate_mv0 = *rate_mv;
 1435|  9.26M|  const int interintra_allowed = cm->seq_params->enable_interintra_compound &&
  ------------------
  |  Branch (1435:34): [True: 0, False: 9.26M]
  ------------------
 1436|      0|                                 is_interintra_allowed(mbmi) &&
  ------------------
  |  Branch (1436:34): [True: 0, False: 0]
  ------------------
 1437|      0|                                 mbmi->compound_idx;
  ------------------
  |  Branch (1437:34): [True: 0, False: 0]
  ------------------
 1438|  9.26M|  WARP_SAMPLE_INFO *const warp_sample_info =
 1439|  9.26M|      &x->warp_sample_info[mbmi->ref_frame[0]];
 1440|  9.26M|  int *pts0 = warp_sample_info->pts;
 1441|  9.26M|  int *pts_inref0 = warp_sample_info->pts_inref;
 1442|       |
 1443|  9.26M|  assert(mbmi->ref_frame[1] != INTRA_FRAME);
 1444|  9.26M|  const MV_REFERENCE_FRAME ref_frame_1 = mbmi->ref_frame[1];
 1445|  9.26M|  av1_invalid_rd_stats(&best_rd_stats);
 1446|  9.26M|  mbmi->num_proj_ref = 1;  // assume num_proj_ref >=1
 1447|  9.26M|  MOTION_MODE last_motion_mode_allowed = SIMPLE_TRANSLATION;
 1448|  9.26M|  *yrd = INT64_MAX;
 1449|  9.26M|  if (features->switchable_motion_mode) {
  ------------------
  |  Branch (1449:7): [True: 9.26M, False: 1.30k]
  ------------------
 1450|       |    // Determine which motion modes to search if more than SIMPLE_TRANSLATION
 1451|       |    // is allowed.
 1452|  9.26M|    last_motion_mode_allowed = motion_mode_allowed(
 1453|  9.26M|        xd->global_motion, xd, mbmi, features->allow_warped_motion);
 1454|  9.26M|  }
 1455|       |
 1456|  9.26M|  if (last_motion_mode_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1456:7): [True: 180k, False: 9.08M]
  ------------------
 1457|       |    // Collect projection samples used in least squares approximation of
 1458|       |    // the warped motion parameters if WARPED_CAUSAL is going to be searched.
 1459|   180k|    if (warp_sample_info->num < 0) {
  ------------------
  |  Branch (1459:9): [True: 32.8k, False: 147k]
  ------------------
 1460|  32.8k|      warp_sample_info->num = av1_findSamples(cm, xd, pts0, pts_inref0);
 1461|  32.8k|    }
 1462|   180k|    mbmi->num_proj_ref = warp_sample_info->num;
 1463|   180k|  }
 1464|  9.26M|  const int total_samples = mbmi->num_proj_ref;
 1465|  9.26M|  if (total_samples == 0) {
  ------------------
  |  Branch (1465:7): [True: 0, False: 9.26M]
  ------------------
 1466|       |    // Do not search WARPED_CAUSAL if there are no samples to use to determine
 1467|       |    // warped parameters.
 1468|      0|    last_motion_mode_allowed = OBMC_CAUSAL;
 1469|      0|  }
 1470|       |
 1471|  9.26M|  const MB_MODE_INFO base_mbmi = *mbmi;
 1472|  9.26M|  MB_MODE_INFO best_mbmi;
 1473|  9.26M|  const int interp_filter = features->interp_filter;
 1474|  9.26M|  const int switchable_rate =
 1475|  9.26M|      av1_is_interp_needed(xd)
  ------------------
  |  Branch (1475:7): [True: 8.93M, False: 326k]
  ------------------
 1476|  9.26M|          ? av1_get_switchable_rate(x, xd, interp_filter,
 1477|  8.93M|                                    cm->seq_params->enable_dual_filter)
 1478|  9.26M|          : 0;
 1479|  9.26M|  int64_t best_rd = INT64_MAX;
 1480|  9.26M|  int best_rate_mv = rate_mv0;
 1481|  9.26M|  const int mi_row = xd->mi_row;
 1482|  9.26M|  const int mi_col = xd->mi_col;
 1483|  9.26M|  int mode_index_start, mode_index_end;
 1484|  9.26M|  const int txfm_rd_gate_level =
 1485|  9.26M|      get_txfm_rd_gate_level(cm->seq_params->enable_masked_compound,
 1486|  9.26M|                             cpi->sf.inter_sf.txfm_rd_gate_level, bsize,
 1487|  9.26M|                             TX_SEARCH_MOTION_MODE, eval_motion_mode);
 1488|       |
 1489|       |  // Modify the start and end index according to speed features. For example,
 1490|       |  // if SIMPLE_TRANSLATION has already been searched according to
 1491|       |  // the motion_mode_for_winner_cand speed feature, update the mode_index_start
 1492|       |  // to avoid searching it again.
 1493|  9.26M|  update_mode_start_end_index(cpi, mbmi, &mode_index_start, &mode_index_end,
 1494|  9.26M|                              last_motion_mode_allowed, interintra_allowed,
 1495|  9.26M|                              eval_motion_mode);
 1496|       |  // Main function loop. This loops over all of the possible motion modes and
 1497|       |  // computes RD to determine the best one. This process includes computing
 1498|       |  // any necessary side information for the motion mode and performing the
 1499|       |  // transform search.
 1500|  15.2M|  for (int mode_index = mode_index_start; mode_index <= mode_index_end;
  ------------------
  |  Branch (1500:43): [True: 6.02M, False: 9.26M]
  ------------------
 1501|  9.26M|       mode_index++) {
 1502|  6.02M|    if (args->skip_motion_mode && mode_index) continue;
  ------------------
  |  Branch (1502:9): [True: 0, False: 6.02M]
  |  Branch (1502:35): [True: 0, False: 0]
  ------------------
 1503|  6.02M|    int tmp_rate2 = rate2_nocoeff;
 1504|  6.02M|    const int is_interintra_mode = mode_index > (int)last_motion_mode_allowed;
 1505|  6.02M|    int tmp_rate_mv = rate_mv0;
 1506|       |
 1507|  6.02M|    *mbmi = base_mbmi;
 1508|  6.02M|    if (is_interintra_mode) {
  ------------------
  |  Branch (1508:9): [True: 0, False: 6.02M]
  ------------------
 1509|       |      // Only use SIMPLE_TRANSLATION for interintra
 1510|      0|      mbmi->motion_mode = SIMPLE_TRANSLATION;
 1511|  6.02M|    } else {
 1512|  6.02M|      mbmi->motion_mode = (MOTION_MODE)mode_index;
 1513|  6.02M|      assert(mbmi->ref_frame[1] != INTRA_FRAME);
 1514|  6.02M|    }
 1515|       |
 1516|  6.02M|    if (cpi->oxcf.algo_cfg.sharpness == 3 &&
  ------------------
  |  Branch (1516:9): [True: 0, False: 6.02M]
  ------------------
 1517|      0|        (mbmi->motion_mode == OBMC_CAUSAL ||
  ------------------
  |  Branch (1517:10): [True: 0, False: 0]
  ------------------
 1518|      0|         mbmi->motion_mode == WARPED_CAUSAL))
  ------------------
  |  Branch (1518:10): [True: 0, False: 0]
  ------------------
 1519|      0|      continue;
 1520|       |
 1521|       |    // Do not search OBMC if the probability of selecting it is below a
 1522|       |    // predetermined threshold for this update_type and block size.
 1523|  6.02M|    const FRAME_UPDATE_TYPE update_type =
 1524|  6.02M|        get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 1525|  6.02M|    int use_actual_frame_probs = 1;
 1526|  6.02M|    int prune_obmc;
 1527|       |#if CONFIG_FPMT_TEST
 1528|       |    use_actual_frame_probs =
 1529|       |        (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
 1530|       |    if (!use_actual_frame_probs) {
 1531|       |      prune_obmc = cpi->ppi->temp_frame_probs.obmc_probs[update_type][bsize] <
 1532|       |                   cpi->sf.inter_sf.prune_obmc_prob_thresh;
 1533|       |    }
 1534|       |#endif
 1535|  6.02M|    if (use_actual_frame_probs) {
  ------------------
  |  Branch (1535:9): [True: 6.02M, False: 18.4E]
  ------------------
 1536|  6.02M|      prune_obmc = cpi->ppi->frame_probs.obmc_probs[update_type][bsize] <
 1537|  6.02M|                   cpi->sf.inter_sf.prune_obmc_prob_thresh;
 1538|  6.02M|    }
 1539|  6.02M|    if ((!cpi->oxcf.motion_mode_cfg.enable_obmc || prune_obmc) &&
  ------------------
  |  Branch (1539:10): [True: 18.4E, False: 6.02M]
  |  Branch (1539:52): [True: 6.02M, False: 0]
  ------------------
 1540|  6.02M|        mbmi->motion_mode == OBMC_CAUSAL)
  ------------------
  |  Branch (1540:9): [True: 442k, False: 5.58M]
  ------------------
 1541|   442k|      continue;
 1542|       |
 1543|  5.58M|    if (mbmi->motion_mode == SIMPLE_TRANSLATION && !is_interintra_mode) {
  ------------------
  |  Branch (1543:9): [True: 5.52M, False: 57.5k]
  |  Branch (1543:52): [True: 5.52M, False: 18.4E]
  ------------------
 1544|       |      // SIMPLE_TRANSLATION mode: no need to recalculate.
 1545|       |      // The prediction is calculated before motion_mode_rd() is called in
 1546|       |      // handle_inter_mode()
 1547|  5.52M|    } else if (mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (1547:16): [True: 0, False: 57.1k]
  ------------------
 1548|      0|      const uint32_t cur_mv = mbmi->mv[0].as_int;
 1549|       |      // OBMC_CAUSAL not allowed for compound prediction
 1550|      0|      assert(!is_comp_pred);
 1551|      0|      if (have_newmv_in_inter_mode(this_mode)) {
  ------------------
  |  Branch (1551:11): [True: 0, False: 0]
  ------------------
 1552|      0|        av1_single_motion_search(cpi, x, bsize, 0, &tmp_rate_mv, INT_MAX, NULL,
 1553|      0|                                 &mbmi->mv[0], NULL);
 1554|      0|        tmp_rate2 = rate2_nocoeff - rate_mv0 + tmp_rate_mv;
 1555|      0|      }
 1556|      0|      if ((mbmi->mv[0].as_int != cur_mv) || eval_motion_mode) {
  ------------------
  |  Branch (1556:11): [True: 0, False: 0]
  |  Branch (1556:45): [True: 0, False: 0]
  ------------------
 1557|       |        // Build the predictor according to the current motion vector if it has
 1558|       |        // not already been built
 1559|      0|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, orig_dst, bsize,
 1560|      0|                                      0, av1_num_planes(cm) - 1);
 1561|      0|      }
 1562|       |      // Build the inter predictor by blending the predictor corresponding to
 1563|       |      // this MV, and the neighboring blocks using the OBMC model
 1564|      0|      av1_build_obmc_inter_prediction(
 1565|      0|          cm, xd, args->above_pred_buf, args->above_pred_stride,
 1566|      0|          args->left_pred_buf, args->left_pred_stride);
 1567|      0|#if !CONFIG_REALTIME_ONLY
 1568|  58.3k|    } else if (mbmi->motion_mode == WARPED_CAUSAL) {
  ------------------
  |  Branch (1568:16): [True: 58.3k, False: 18.4E]
  ------------------
 1569|  58.3k|      int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 1570|  58.3k|      mbmi->motion_mode = WARPED_CAUSAL;
 1571|  58.3k|      mbmi->wm_params.wmtype = DEFAULT_WMTYPE;
  ------------------
  |  |   32|  58.3k|#define DEFAULT_WMTYPE AFFINE
  ------------------
 1572|  58.3k|      mbmi->interp_filters =
 1573|  58.3k|          av1_broadcast_interp_filter(av1_unswitchable_filter(interp_filter));
 1574|       |
 1575|  58.3k|      memcpy(pts, pts0, total_samples * 2 * sizeof(*pts0));
 1576|  58.3k|      memcpy(pts_inref, pts_inref0, total_samples * 2 * sizeof(*pts_inref0));
 1577|       |      // Select the samples according to motion vector difference
 1578|  58.3k|      if (mbmi->num_proj_ref > 1) {
  ------------------
  |  Branch (1578:11): [True: 28.1k, False: 30.2k]
  ------------------
 1579|  28.1k|        mbmi->num_proj_ref = av1_selectSamples(
 1580|  28.1k|            &mbmi->mv[0].as_mv, pts, pts_inref, mbmi->num_proj_ref, bsize);
 1581|  28.1k|      }
 1582|       |
 1583|       |      // Compute the warped motion parameters with a least squares fit
 1584|       |      //  using the collected samples
 1585|  58.3k|      if (!av1_find_projection(mbmi->num_proj_ref, pts, pts_inref, bsize,
  ------------------
  |  Branch (1585:11): [True: 47.2k, False: 11.1k]
  ------------------
 1586|  58.3k|                               mbmi->mv[0].as_mv.row, mbmi->mv[0].as_mv.col,
 1587|  58.3k|                               &mbmi->wm_params, mi_row, mi_col)) {
 1588|  47.2k|        assert(!is_comp_pred);
 1589|  47.2k|        if (have_newmv_in_inter_mode(this_mode)) {
  ------------------
  |  Branch (1589:13): [True: 9.38k, False: 37.8k]
  ------------------
 1590|       |          // Refine MV for NEWMV mode
 1591|  9.38k|          const int_mv mv0 = mbmi->mv[0];
 1592|  9.38k|          const WarpedMotionParams wm_params0 = mbmi->wm_params;
 1593|  9.38k|          const int num_proj_ref0 = mbmi->num_proj_ref;
 1594|       |
 1595|  9.38k|          const int_mv ref_mv = av1_get_ref_mv(x, 0);
 1596|  9.38k|          SUBPEL_MOTION_SEARCH_PARAMS ms_params;
 1597|  9.38k|          av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize,
 1598|  9.38k|                                            &ref_mv.as_mv, NULL);
 1599|       |
 1600|       |          // Refine MV in a small range.
 1601|  9.38k|          av1_refine_warped_mv(xd, cm, &ms_params, bsize, pts0, pts_inref0,
 1602|  9.38k|                               total_samples, cpi->sf.mv_sf.warp_search_method,
 1603|  9.38k|                               cpi->sf.mv_sf.warp_search_iters);
 1604|       |
 1605|  9.38k|          if (mv0.as_int != mbmi->mv[0].as_int) {
  ------------------
  |  Branch (1605:15): [True: 6.73k, False: 2.64k]
  ------------------
 1606|       |            // Keep the refined MV and WM parameters.
 1607|  6.73k|            tmp_rate_mv = av1_mv_bit_cost(
 1608|  6.73k|                &mbmi->mv[0].as_mv, &ref_mv.as_mv, x->mv_costs->nmv_joint_cost,
 1609|  6.73k|                x->mv_costs->mv_cost_stack, MV_COST_WEIGHT);
  ------------------
  |  |   46|  6.73k|#define MV_COST_WEIGHT 108
  ------------------
 1610|  6.73k|            tmp_rate2 = rate2_nocoeff - rate_mv0 + tmp_rate_mv;
 1611|  6.73k|          } else {
 1612|       |            // Restore the old MV and WM parameters.
 1613|  2.64k|            mbmi->mv[0] = mv0;
 1614|  2.64k|            mbmi->wm_params = wm_params0;
 1615|  2.64k|            mbmi->num_proj_ref = num_proj_ref0;
 1616|  2.64k|          }
 1617|  9.38k|        }
 1618|       |
 1619|       |        // Build the warped predictor
 1620|  47.2k|        av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize, 0,
 1621|  47.2k|                                      av1_num_planes(cm) - 1);
 1622|  47.2k|      } else {
 1623|  11.1k|        continue;
 1624|  11.1k|      }
 1625|  58.3k|#endif  // !CONFIG_REALTIME_ONLY
 1626|  18.4E|    } else if (is_interintra_mode) {
  ------------------
  |  Branch (1626:16): [True: 0, False: 18.4E]
  ------------------
 1627|      0|      const int ret =
 1628|      0|          av1_handle_inter_intra_mode(cpi, x, bsize, mbmi, args, ref_best_rd,
 1629|      0|                                      &tmp_rate_mv, &tmp_rate2, orig_dst);
 1630|      0|      if (ret < 0) continue;
  ------------------
  |  Branch (1630:11): [True: 0, False: 0]
  ------------------
 1631|      0|    }
 1632|       |
 1633|       |    // If we are searching newmv and the mv is the same as refmv, skip the
 1634|       |    // current mode
 1635|  5.57M|    if (!av1_check_newmv_joint_nonzero(cm, x)) continue;
  ------------------
  |  Branch (1635:9): [True: 376k, False: 5.19M]
  ------------------
 1636|       |
 1637|       |    // Update rd_stats for the current motion mode
 1638|  5.19M|    txfm_info->skip_txfm = 0;
 1639|  5.19M|    rd_stats->dist = 0;
 1640|  5.19M|    rd_stats->sse = 0;
 1641|  5.19M|    rd_stats->skip_txfm = 1;
 1642|  5.19M|    rd_stats->rate = tmp_rate2;
 1643|  5.19M|    const ModeCosts *mode_costs = &x->mode_costs;
 1644|  5.19M|    if (mbmi->motion_mode != WARPED_CAUSAL) rd_stats->rate += switchable_rate;
  ------------------
  |  Branch (1644:9): [True: 5.15M, False: 47.1k]
  ------------------
 1645|  5.19M|    if (interintra_allowed) {
  ------------------
  |  Branch (1645:9): [True: 0, False: 5.19M]
  ------------------
 1646|      0|      rd_stats->rate +=
 1647|      0|          mode_costs->interintra_cost[size_group_lookup[bsize]]
 1648|      0|                                     [mbmi->ref_frame[1] == INTRA_FRAME];
 1649|      0|    }
 1650|  5.19M|    if ((last_motion_mode_allowed > SIMPLE_TRANSLATION) &&
  ------------------
  |  Branch (1650:9): [True: 898k, False: 4.29M]
  ------------------
 1651|   898k|        (mbmi->ref_frame[1] != INTRA_FRAME)) {
  ------------------
  |  Branch (1651:9): [True: 898k, False: 18.4E]
  ------------------
 1652|   898k|      if (last_motion_mode_allowed == WARPED_CAUSAL) {
  ------------------
  |  Branch (1652:11): [True: 157k, False: 741k]
  ------------------
 1653|   157k|        rd_stats->rate +=
 1654|   157k|            mode_costs->motion_mode_cost[bsize][mbmi->motion_mode];
 1655|   741k|      } else {
 1656|   741k|        rd_stats->rate +=
 1657|   741k|            mode_costs->motion_mode_cost1[bsize][mbmi->motion_mode];
 1658|   741k|      }
 1659|   898k|    }
 1660|       |
 1661|  5.19M|    int64_t this_yrd = INT64_MAX;
 1662|       |
 1663|  5.19M|    if (!do_tx_search) {
  ------------------
  |  Branch (1663:9): [True: 24.4k, False: 5.17M]
  ------------------
 1664|       |      // Avoid doing a transform search here to speed up the overall mode
 1665|       |      // search. It will be done later in the mode search if the current
 1666|       |      // motion mode seems promising.
 1667|  24.4k|      int64_t curr_sse = -1;
 1668|  24.4k|      int64_t sse_y = -1;
 1669|  24.4k|      int est_residue_cost = 0;
 1670|  24.4k|      int64_t est_dist = 0;
 1671|  24.4k|      int64_t est_rd = 0;
 1672|  24.4k|      if (cpi->sf.inter_sf.inter_mode_rd_model_estimation == 1) {
  ------------------
  |  Branch (1672:11): [True: 2.48k, False: 21.9k]
  ------------------
 1673|  2.48k|        curr_sse = get_sse(cpi, x, &sse_y);
 1674|  2.48k|        const int has_est_rd = get_est_rate_dist(tile_data, bsize, curr_sse,
 1675|  2.48k|                                                 &est_residue_cost, &est_dist);
 1676|  2.48k|        (void)has_est_rd;
 1677|  2.48k|        assert(has_est_rd);
 1678|  21.9k|      } else if (cpi->sf.inter_sf.inter_mode_rd_model_estimation == 2 ||
  ------------------
  |  Branch (1678:18): [True: 21.9k, False: 0]
  ------------------
 1679|  21.9k|                 cpi->sf.rt_sf.use_nonrd_pick_mode) {
  ------------------
  |  Branch (1679:18): [True: 0, False: 0]
  ------------------
 1680|  21.9k|        model_rd_sb_fn[MODELRD_TYPE_MOTION_MODE_RD](
  ------------------
  |  |   36|  21.9k|#define MODELRD_TYPE_MOTION_MODE_RD 1
  ------------------
 1681|  21.9k|            cpi, bsize, x, xd, 0, num_planes - 1, &est_residue_cost, &est_dist,
 1682|  21.9k|            NULL, &curr_sse, NULL, NULL, NULL);
 1683|  21.9k|        sse_y = x->pred_sse[xd->mi[0]->ref_frame[0]];
 1684|  21.9k|      }
 1685|  24.4k|      est_rd = RDCOST(x->rdmult, rd_stats->rate + est_residue_cost, est_dist);
  ------------------
  |  |   33|  24.4k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  24.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  24.4k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  24.4k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1686|  24.4k|      if (est_rd * 0.80 > *best_est_rd) {
  ------------------
  |  Branch (1686:11): [True: 34, False: 24.3k]
  ------------------
 1687|     34|        mbmi->ref_frame[1] = ref_frame_1;
 1688|     34|        continue;
 1689|     34|      }
 1690|  24.3k|      const int mode_rate = rd_stats->rate;
 1691|  24.3k|      rd_stats->rate += est_residue_cost;
 1692|  24.3k|      rd_stats->dist = est_dist;
 1693|  24.3k|      rd_stats->rdcost = est_rd;
 1694|  24.3k|      if (rd_stats->rdcost < *best_est_rd) {
  ------------------
  |  Branch (1694:11): [True: 13.5k, False: 10.8k]
  ------------------
 1695|  13.5k|        *best_est_rd = rd_stats->rdcost;
 1696|  13.5k|        assert(sse_y >= 0);
 1697|  13.5k|        ref_skip_rd[1] = txfm_rd_gate_level
  ------------------
  |  Branch (1697:26): [True: 13.5k, False: 0]
  ------------------
 1698|  13.5k|                             ? RDCOST(x->rdmult, mode_rate, (sse_y << 4))
  ------------------
  |  |   33|  13.5k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  13.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  13.5k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  13.5k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1699|  13.5k|                             : INT64_MAX;
 1700|  13.5k|      }
 1701|  24.3k|      if (cm->current_frame.reference_mode == SINGLE_REFERENCE) {
  ------------------
  |  Branch (1701:11): [True: 0, False: 24.3k]
  ------------------
 1702|      0|        if (!is_comp_pred) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 0]
  ------------------
 1703|      0|          assert(curr_sse >= 0);
 1704|      0|          inter_modes_info_push(inter_modes_info, mode_rate, curr_sse,
 1705|      0|                                rd_stats->rdcost, rd_stats, rd_stats_y,
 1706|      0|                                rd_stats_uv, mbmi);
 1707|      0|        }
 1708|  24.3k|      } else {
 1709|  24.3k|        assert(curr_sse >= 0);
 1710|  24.3k|        inter_modes_info_push(inter_modes_info, mode_rate, curr_sse,
 1711|  24.3k|                              rd_stats->rdcost, rd_stats, rd_stats_y,
 1712|  24.3k|                              rd_stats_uv, mbmi);
 1713|  24.3k|      }
 1714|  24.3k|      mbmi->skip_txfm = 0;
 1715|  24.3k|      increase_motion_mode_rdstats(cpi, mbmi, rd_stats, NULL, NULL);
 1716|       |
 1717|  5.17M|    } else {
 1718|       |      // Perform full transform search
 1719|  5.17M|      int64_t skip_rd = INT64_MAX;
 1720|  5.17M|      int64_t skip_rdy = INT64_MAX;
 1721|  5.17M|      if (txfm_rd_gate_level) {
  ------------------
  |  Branch (1721:11): [True: 5.17M, False: 391]
  ------------------
 1722|       |        // Check if the mode is good enough based on skip RD
 1723|  5.17M|        int64_t sse_y = INT64_MAX;
 1724|  5.17M|        int64_t curr_sse = get_sse(cpi, x, &sse_y);
 1725|  5.17M|        skip_rd = RDCOST(x->rdmult, rd_stats->rate, curr_sse);
  ------------------
  |  |   33|  5.17M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  5.17M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  5.17M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  5.17M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1726|  5.17M|        skip_rdy = RDCOST(x->rdmult, rd_stats->rate, (sse_y << 4));
  ------------------
  |  |   33|  5.17M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  5.17M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  5.17M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  5.17M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1727|  5.17M|        int eval_txfm = check_txfm_eval(x, bsize, ref_skip_rd[0], skip_rd,
 1728|  5.17M|                                        txfm_rd_gate_level, 0);
 1729|  5.17M|        if (!eval_txfm) continue;
  ------------------
  |  Branch (1729:13): [True: 324k, False: 4.84M]
  ------------------
 1730|  5.17M|      }
 1731|       |
 1732|       |      // Do transform search
 1733|  4.85M|      const int mode_rate = rd_stats->rate;
 1734|  4.85M|      if (!av1_txfm_search(cpi, x, bsize, rd_stats, rd_stats_y, rd_stats_uv,
  ------------------
  |  Branch (1734:11): [True: 1.04M, False: 3.80M]
  ------------------
 1735|  4.85M|                           rd_stats->rate, ref_best_rd)) {
 1736|  1.04M|        if (rd_stats_y->rate == INT_MAX && mode_index == 0) {
  ------------------
  |  Branch (1736:13): [True: 5.60k, False: 1.04M]
  |  Branch (1736:44): [True: 5.60k, False: 3]
  ------------------
 1737|  5.60k|          return INT64_MAX;
 1738|  5.60k|        }
 1739|  1.04M|        continue;
 1740|  1.04M|      }
 1741|  3.80M|      const int skip_ctx = av1_get_skip_txfm_context(xd);
 1742|  3.80M|      const int *skip_txfm_cost_ptr = mode_costs->skip_txfm_cost[skip_ctx];
 1743|       |
 1744|  3.80M|      if (cpi->sf.inter_sf.inter_mode_rd_model_estimation == 1) {
  ------------------
  |  Branch (1744:11): [True: 89.6k, False: 3.71M]
  ------------------
 1745|  89.6k|        inter_mode_data_push(tile_data, mbmi->bsize, rd_stats->sse,
 1746|  89.6k|                             rd_stats->dist,
 1747|  89.6k|                             rd_stats_y->rate + rd_stats_uv->rate +
 1748|  89.6k|                                 skip_txfm_cost_ptr[mbmi->skip_txfm]);
 1749|  89.6k|      }
 1750|       |      // Scale RD_STATS after mode stats are collected. Thus unscaled metrics
 1751|       |      // are used for model generation
 1752|  3.80M|      increase_motion_mode_rdstats(cpi, mbmi, rd_stats, rd_stats_y,
 1753|  3.80M|                                   rd_stats_uv);
 1754|  3.80M|      const int skip_rate =
 1755|  3.80M|          rd_stats->skip_txfm ? skip_txfm_cost_ptr[1] : skip_txfm_cost_ptr[0];
  ------------------
  |  Branch (1755:11): [True: 130k, False: 3.67M]
  ------------------
 1756|       |
 1757|  3.80M|      const int32_t scaled_skip_rate =
 1758|  3.80M|          increase_motion_mode_rate(cpi, mbmi, skip_rate);
 1759|  3.80M|      const int y_rate =
 1760|  3.80M|          scaled_skip_rate + (rd_stats->skip_txfm ? 0 : rd_stats_y->rate);
  ------------------
  |  Branch (1760:31): [True: 130k, False: 3.67M]
  ------------------
 1761|  3.80M|      this_yrd = RDCOST(x->rdmult, y_rate + mode_rate, rd_stats_y->dist);
  ------------------
  |  |   33|  3.80M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.80M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.80M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.80M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1762|       |
 1763|  3.80M|      const int64_t curr_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|  3.80M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.80M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.80M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.80M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1764|  3.80M|      if (curr_rd < ref_best_rd) {
  ------------------
  |  Branch (1764:11): [True: 3.80M, False: 559]
  ------------------
 1765|  3.80M|        ref_best_rd = curr_rd;
 1766|  3.80M|        ref_skip_rd[0] = skip_rd;
 1767|  3.80M|        ref_skip_rd[1] = skip_rdy;
 1768|  3.80M|      }
 1769|  3.80M|    }
 1770|       |
 1771|  3.82M|    if (this_mode == GLOBALMV || this_mode == GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (1771:9): [True: 143k, False: 3.68M]
  |  Branch (1771:34): [True: 32, False: 3.68M]
  ------------------
 1772|   144k|      if (is_nontrans_global_motion(xd, xd->mi[0])) {
  ------------------
  |  Branch (1772:11): [True: 117k, False: 26.5k]
  ------------------
 1773|   117k|        mbmi->interp_filters =
 1774|   117k|            av1_broadcast_interp_filter(av1_unswitchable_filter(interp_filter));
 1775|   117k|      }
 1776|   144k|    }
 1777|       |
 1778|  3.82M|    if (this_yrd < INT64_MAX) {
  ------------------
  |  Branch (1778:9): [True: 3.80M, False: 24.3k]
  ------------------
 1779|  3.80M|      adjust_cost(cpi, x, &this_yrd, /*is_inter_pred=*/true);
 1780|  3.80M|    }
 1781|  3.82M|    adjust_rdcost(cpi, x, rd_stats, /*is_inter_pred=*/true);
 1782|       |    // Bug 494653438: If do_tx_search is 0, rd_stats_y is uninitialized, so
 1783|       |    // valgrind will warn if we use rd_stats_y->rdcost in a conditional.
 1784|  3.82M|    if (!do_tx_search || rd_stats_y->rdcost < INT64_MAX) {
  ------------------
  |  Branch (1784:9): [True: 24.1k, False: 3.80M]
  |  Branch (1784:26): [True: 3.80M, False: 0]
  ------------------
 1785|  3.82M|      adjust_rdcost(cpi, x, rd_stats_y, /*is_inter_pred=*/true);
 1786|  3.82M|    }
 1787|       |
 1788|  3.82M|    const int64_t tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|  3.82M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.82M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.82M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.82M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 1789|  3.82M|    if (mode_index == 0) {
  ------------------
  |  Branch (1789:9): [True: 3.80M, False: 24.0k]
  ------------------
 1790|  3.80M|      args->simple_rd[this_mode][mbmi->ref_mv_idx][mbmi->ref_frame[0]] = tmp_rd;
 1791|  3.80M|    }
 1792|  3.82M|    if (mode_index == 0 || tmp_rd < best_rd) {
  ------------------
  |  Branch (1792:9): [True: 3.80M, False: 23.4k]
  |  Branch (1792:28): [True: 23.4k, False: 0]
  ------------------
 1793|       |      // Update best_rd data if this is the best motion mode so far
 1794|  3.82M|      best_mbmi = *mbmi;
 1795|  3.82M|      best_rd = tmp_rd;
 1796|  3.82M|      best_rd_stats = *rd_stats;
 1797|  3.82M|      best_rd_stats_y = *rd_stats_y;
 1798|  3.82M|      best_rate_mv = tmp_rate_mv;
 1799|  3.82M|      *yrd = this_yrd;
 1800|  3.82M|      if (num_planes > 1) best_rd_stats_uv = *rd_stats_uv;
  ------------------
  |  Branch (1800:11): [True: 2.00M, False: 1.82M]
  ------------------
 1801|  3.82M|      av1_copy_array(best_tx_type_map, xd->tx_type_map, xd->height * xd->width);
  ------------------
  |  |   38|  3.82M|  do {                                                    \
  |  |   39|  3.82M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  3.82M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  3.82M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 3.82M]
  |  |  ------------------
  ------------------
 1802|  3.82M|      best_xskip_txfm = mbmi->skip_txfm;
 1803|  3.82M|    }
 1804|  3.82M|  }
 1805|       |  // Update RD and mbmi stats for selected motion mode
 1806|  9.26M|  mbmi->ref_frame[1] = ref_frame_1;
 1807|  9.26M|  *rate_mv = best_rate_mv;
 1808|  9.26M|  if (best_rd == INT64_MAX || !av1_check_newmv_joint_nonzero(cm, x)) {
  ------------------
  |  Branch (1808:7): [True: 5.43M, False: 3.82M]
  |  Branch (1808:31): [True: 584, False: 3.82M]
  ------------------
 1809|  5.44M|    av1_invalid_rd_stats(rd_stats);
 1810|  5.44M|    restore_dst_buf(xd, *orig_dst, num_planes);
 1811|  5.44M|    return INT64_MAX;
 1812|  5.44M|  }
 1813|  3.81M|  *mbmi = best_mbmi;
 1814|  3.81M|  *rd_stats = best_rd_stats;
 1815|  3.81M|  *rd_stats_y = best_rd_stats_y;
 1816|  3.81M|  if (num_planes > 1) *rd_stats_uv = best_rd_stats_uv;
  ------------------
  |  Branch (1816:7): [True: 2.00M, False: 1.81M]
  ------------------
 1817|  3.81M|  av1_copy_array(xd->tx_type_map, best_tx_type_map, xd->height * xd->width);
  ------------------
  |  |   38|  3.81M|  do {                                                    \
  |  |   39|  3.81M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  3.81M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  3.81M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 3.81M]
  |  |  ------------------
  ------------------
 1818|  3.81M|  txfm_info->skip_txfm = best_xskip_txfm;
 1819|       |
 1820|  3.81M|  restore_dst_buf(xd, *orig_dst, num_planes);
 1821|  3.81M|  return 0;
 1822|  9.26M|}
rdopt.c:update_mode_start_end_index:
 1294|  9.27M|    int interintra_allowed, int eval_motion_mode) {
 1295|  9.27M|  *mode_index_start = (int)SIMPLE_TRANSLATION;
 1296|  9.27M|  *mode_index_end = (int)last_motion_mode_allowed + interintra_allowed;
 1297|  9.27M|  if (cpi->sf.winner_mode_sf.motion_mode_for_winner_cand) {
  ------------------
  |  Branch (1297:7): [True: 9.27M, False: 18.4E]
  ------------------
 1298|  9.27M|    if (!eval_motion_mode) {
  ------------------
  |  Branch (1298:9): [True: 5.52M, False: 3.74M]
  ------------------
 1299|  5.52M|      *mode_index_end = (int)SIMPLE_TRANSLATION;
 1300|  5.52M|    } else {
 1301|       |      // Set the start index appropriately to process motion modes other than
 1302|       |      // simple translation
 1303|  3.74M|      *mode_index_start = 1;
 1304|  3.74M|    }
 1305|  9.27M|  }
 1306|  9.27M|  if (cpi->sf.inter_sf.extra_prune_warped && mbmi->bsize > BLOCK_16X16)
  ------------------
  |  Branch (1306:7): [True: 0, False: 9.27M]
  |  Branch (1306:46): [True: 0, False: 0]
  ------------------
 1307|      0|    *mode_index_end = SIMPLE_TRANSLATION;
 1308|  9.27M|}
rdopt.c:get_sse:
  731|  5.17M|                       int64_t *sse_y) {
  732|  5.17M|  const AV1_COMMON *cm = &cpi->common;
  733|  5.17M|  const int num_planes = av1_num_planes(cm);
  734|  5.17M|  const MACROBLOCKD *xd = &x->e_mbd;
  735|  5.17M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  736|  5.17M|  int64_t total_sse = 0;
  737|  14.7M|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (737:23): [True: 9.93M, False: 4.85M]
  ------------------
  738|  9.93M|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (738:9): [True: 4.76M, False: 5.17M]
  |  Branch (738:18): [True: 323k, False: 4.43M]
  ------------------
  739|  9.60M|    const struct macroblock_plane *const p = &x->plane[plane];
  740|  9.60M|    const struct macroblockd_plane *const pd = &xd->plane[plane];
  741|  9.60M|    const BLOCK_SIZE bs =
  742|  9.60M|        get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
  743|  9.60M|    unsigned int sse;
  744|  9.60M|    int bw, bh;
  745|  9.60M|    const int block_width = block_size_wide[bs];
  746|  9.60M|    const int block_height = block_size_high[bs];
  747|       |
  748|  9.60M|    get_visible_dimensions(x, plane, bs, 0, 0, block_width, block_height,
  749|  9.60M|                           cpi->do_border_pad, &bw, &bh);
  750|       |
  751|  9.60M|    sse = pixel_dist_visible_only(cpi, x, p->src.buf, p->src.stride,
  752|  9.60M|                                  pd->dst.buf, pd->dst.stride, bs, block_height,
  753|  9.60M|                                  block_width, bh, bw);
  754|  9.60M|    total_sse += sse;
  755|  9.60M|    if (!plane && sse_y) *sse_y = sse;
  ------------------
  |  Branch (755:9): [True: 5.17M, False: 4.43M]
  |  Branch (755:19): [True: 5.17M, False: 104]
  ------------------
  756|  9.60M|  }
  757|  5.17M|  total_sse <<= 4;
  758|  5.17M|  return total_sse;
  759|  5.17M|}
rdopt.c:get_est_rate_dist:
  368|  2.48k|                             int64_t *est_dist) {
  369|  2.48k|  const InterModeRdModel *md = &tile_data->inter_mode_rd_models[bsize];
  370|  2.48k|  if (md->ready) {
  ------------------
  |  Branch (370:7): [True: 2.48k, False: 0]
  ------------------
  371|  2.48k|    if (sse < md->dist_mean) {
  ------------------
  |  Branch (371:9): [True: 0, False: 2.48k]
  ------------------
  372|      0|      *est_residue_cost = 0;
  373|      0|      *est_dist = sse;
  374|  2.48k|    } else {
  375|  2.48k|      *est_dist = (int64_t)round(md->dist_mean);
  376|  2.48k|      const double est_ld = md->a * sse + md->b;
  377|       |      // Clamp estimated rate cost by INT_MAX / 2.
  378|       |      // TODO(angiebird@google.com): find better solution than clamping.
  379|  2.48k|      if (fabs(est_ld) < 1e-2) {
  ------------------
  |  Branch (379:11): [True: 0, False: 2.48k]
  ------------------
  380|      0|        *est_residue_cost = INT_MAX / 2;
  381|  2.48k|      } else {
  382|  2.48k|        double est_residue_cost_dbl = ((sse - md->dist_mean) / est_ld);
  383|  2.48k|        if (est_residue_cost_dbl < 0) {
  ------------------
  |  Branch (383:13): [True: 0, False: 2.48k]
  ------------------
  384|      0|          *est_residue_cost = 0;
  385|  2.48k|        } else {
  386|  2.48k|          *est_residue_cost =
  387|  2.48k|              (int)AOMMIN((int64_t)round(est_residue_cost_dbl), INT_MAX / 2);
  ------------------
  |  |   34|  2.48k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.48k, False: 0]
  |  |  ------------------
  ------------------
  388|  2.48k|        }
  389|  2.48k|      }
  390|  2.48k|      if (*est_residue_cost <= 0) {
  ------------------
  |  Branch (390:11): [True: 0, False: 2.48k]
  ------------------
  391|      0|        *est_residue_cost = 0;
  392|      0|        *est_dist = sse;
  393|      0|      }
  394|  2.48k|    }
  395|  2.48k|    return 1;
  396|  2.48k|  }
  397|      0|  return 0;
  398|  2.48k|}
rdopt.c:inter_modes_info_push:
  472|  24.3k|                                         const MB_MODE_INFO *mbmi) {
  473|  24.3k|  const int num = inter_modes_info->num;
  474|       |  assert(num < MAX_INTER_MODES);
  475|  24.3k|  inter_modes_info->mbmi_arr[num] = *mbmi;
  476|  24.3k|  inter_modes_info->mode_rate_arr[num] = mode_rate;
  477|  24.3k|  inter_modes_info->sse_arr[num] = sse;
  478|  24.3k|  inter_modes_info->est_rd_arr[num] = rd;
  479|  24.3k|  inter_modes_info->rd_cost_arr[num] = *rd_cost;
  480|  24.3k|  inter_modes_info->rd_cost_y_arr[num] = *rd_cost_y;
  481|  24.3k|  inter_modes_info->rd_cost_uv_arr[num] = *rd_cost_uv;
  482|  24.3k|  ++inter_modes_info->num;
  483|  24.3k|}
rdopt.c:increase_motion_mode_rdstats:
 1325|  5.46M|                                                RD_STATS *rd_stats_uv) {
 1326|  5.46M|  if (rd_stats->rate == INT_MAX ||
  ------------------
  |  Branch (1326:7): [True: 18.4E, False: 5.46M]
  ------------------
 1327|  5.46M|      (rd_stats_y != NULL && rd_stats_y->rate == INT_MAX) ||
  ------------------
  |  Branch (1327:8): [True: 5.44M, False: 24.1k]
  |  Branch (1327:30): [True: 0, False: 5.44M]
  ------------------
 1328|  5.46M|      (rd_stats_uv != NULL && rd_stats_uv->rate == INT_MAX))
  ------------------
  |  Branch (1328:8): [True: 5.44M, False: 24.2k]
  |  Branch (1328:31): [True: 0, False: 5.44M]
  ------------------
 1329|      0|    return;
 1330|  5.46M|  const INTER_MODE_SPEED_FEATURES *const inter_sf = &cpi->sf.inter_sf;
 1331|  5.46M|  double rd_bias_scale = 0.0;
 1332|  5.46M|  if (this_mbmi->motion_mode == WARPED_CAUSAL) {
  ------------------
  |  Branch (1332:7): [True: 28.1k, False: 5.44M]
  ------------------
 1333|  28.1k|    rd_bias_scale = inter_sf->bias_warp_mode_rd_scale_pct / 100.0;
 1334|  5.44M|  } else if (this_mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (1334:14): [True: 0, False: 5.44M]
  ------------------
 1335|      0|    rd_bias_scale = inter_sf->bias_obmc_mode_rd_scale_pct / 100.0;
 1336|  5.44M|  } else if (this_mbmi->mode == GLOBALMV ||
  ------------------
  |  Branch (1336:14): [True: 143k, False: 5.29M]
  ------------------
 1337|  5.29M|             this_mbmi->mode == GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (1337:14): [True: 18.4E, False: 5.29M]
  ------------------
 1338|   143k|    rd_bias_scale = get_global_mv_mode_bias(cpi, this_mbmi);
 1339|   143k|  }
 1340|  5.46M|  if (rd_bias_scale <= 0.0) return;
  ------------------
  |  Branch (1340:7): [True: 5.46M, False: 18.4E]
  ------------------
 1341|       |
 1342|  18.4E|  scale_rdstats(rd_stats, rd_bias_scale);
 1343|  18.4E|  scale_rdstats(rd_stats_y, rd_bias_scale);
 1344|  18.4E|  scale_rdstats(rd_stats_uv, rd_bias_scale);
 1345|  18.4E|}
rdopt.c:inter_mode_data_push:
  452|  90.8k|                                        int64_t dist, int residue_cost) {
  453|  90.8k|  if (residue_cost == 0 || sse == dist) return;
  ------------------
  |  Branch (453:7): [True: 0, False: 90.8k]
  |  Branch (453:28): [True: 10.9k, False: 79.8k]
  ------------------
  454|  79.8k|  const int block_idx = inter_mode_data_block_idx(bsize);
  455|  79.8k|  if (block_idx == -1) return;
  ------------------
  |  Branch (455:7): [True: 0, False: 79.8k]
  ------------------
  456|  79.8k|  InterModeRdModel *rd_model = &tile_data->inter_mode_rd_models[bsize];
  457|  79.8k|  if (rd_model->num < INTER_MODE_RD_DATA_OVERALL_SIZE) {
  ------------------
  |  | 1256|  79.8k|#define INTER_MODE_RD_DATA_OVERALL_SIZE 6400
  ------------------
  |  Branch (457:7): [True: 79.8k, False: 0]
  ------------------
  458|  79.8k|    const double ld = (sse - dist) * 1. / residue_cost;
  459|  79.8k|    ++rd_model->num;
  460|  79.8k|    rd_model->dist_sum += dist;
  461|  79.8k|    rd_model->ld_sum += ld;
  462|  79.8k|    rd_model->sse_sum += sse;
  463|  79.8k|    rd_model->sse_sse_sum += (double)sse * (double)sse;
  464|  79.8k|    rd_model->sse_ld_sum += sse * ld;
  465|  79.8k|  }
  466|  79.8k|}
rdopt.c:update_best_single_mode:
 4990|  6.99M|                                           int64_t this_rd) {
 4991|  6.99M|  if (this_rd < search_state->best_single_rd[ref_frame]) {
  ------------------
  |  Branch (4991:7): [True: 2.60M, False: 4.38M]
  ------------------
 4992|  2.60M|    search_state->best_single_rd[ref_frame] = this_rd;
 4993|  2.60M|    search_state->best_single_mode[ref_frame] = this_mode;
 4994|  2.60M|  }
 4995|  6.99M|}
rdopt.c:adjust_cost:
  708|  12.3M|                        int64_t *rd_cost, bool is_inter_pred) {
  709|  12.3M|  if ((cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (709:8): [True: 10.2M, False: 2.13M]
  ------------------
  710|  2.13M|       cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) &&
  ------------------
  |  Branch (710:8): [True: 18.4E, False: 2.13M]
  ------------------
  711|  10.2M|      is_inter_pred) {
  ------------------
  |  Branch (711:7): [True: 5.97M, False: 4.22M]
  ------------------
  712|  5.97M|    *rd_cost += *rd_cost >> 3;
  713|  5.97M|    return;
  714|  5.97M|  }
  715|       |
  716|  6.36M|  if (cpi->oxcf.algo_cfg.sharpness != 3) return;
  ------------------
  |  Branch (716:7): [True: 6.36M, False: 18.4E]
  ------------------
  717|       |
  718|  18.4E|  if (frame_is_kf_gf_arf(cpi)) return;
  ------------------
  |  Branch (718:7): [True: 0, False: 18.4E]
  ------------------
  719|       |
  720|  18.4E|  int64_t src_var, rec_var;
  721|  18.4E|  get_variance_stats(x, &src_var, &rec_var);
  722|       |
  723|  18.4E|  if (src_var <= rec_var) return;
  ------------------
  |  Branch (723:7): [True: 0, False: 18.4E]
  ------------------
  724|       |
  725|  18.4E|  int64_t var_offset = src_var - rec_var;
  726|       |
  727|  18.4E|  *rd_cost += RDCOST(x->rdmult, 0, var_offset);
  ------------------
  |  |   33|  18.4E|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  18.4E|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  18.4E|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  18.4E|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  728|  18.4E|}
rdopt.c:adjust_rdcost:
  669|  12.9M|                          RD_STATS *rd_cost, bool is_inter_pred) {
  670|  12.9M|  if ((cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (670:8): [True: 10.2M, False: 2.76M]
  ------------------
  671|  2.76M|       cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) &&
  ------------------
  |  Branch (671:8): [True: 18.4E, False: 2.76M]
  ------------------
  672|  10.2M|      is_inter_pred) {
  ------------------
  |  Branch (672:7): [True: 8.98M, False: 1.22M]
  ------------------
  673|       |    // Tune IQ and SSIMULACRA2 can be used to encode layered images, where
  674|       |    // keyframes could be encoded at a lower or similar quality (i.e. higher
  675|       |    // QP) than inter-coded frames.
  676|       |    // In this case, libaom tends to underestimate the true RD cost of inter
  677|       |    // prediction candidates, causing encoded file size to increase without a
  678|       |    // corresponding increase in quality.
  679|       |    // When both intra and inter encoded block candidates are available (with
  680|       |    // rdcosts close to each other), the intra-coded candidate was subjectively
  681|       |    // observed to be a bit less blurry, with a corresponding increase in
  682|       |    // SSIMULACRA 2 scores.
  683|       |    // Apply a 1.125x inter block bias to increase overall perceptual
  684|       |    // compression efficiency, while still allowing the encoder to pick inter
  685|       |    // prediction when it's beneficial.
  686|  8.98M|    rd_cost->dist += rd_cost->dist >> 3;
  687|  8.98M|    rd_cost->rdcost += rd_cost->rdcost >> 3;
  688|  8.98M|    return;
  689|  8.98M|  }
  690|       |
  691|  3.99M|  if (cpi->oxcf.algo_cfg.sharpness != 3) return;
  ------------------
  |  Branch (691:7): [True: 3.99M, False: 18.4E]
  ------------------
  692|       |
  693|  18.4E|  if (frame_is_kf_gf_arf(cpi)) return;
  ------------------
  |  Branch (693:7): [True: 0, False: 18.4E]
  ------------------
  694|       |
  695|  18.4E|  int64_t src_var, rec_var;
  696|  18.4E|  get_variance_stats(x, &src_var, &rec_var);
  697|       |
  698|  18.4E|  if (src_var <= rec_var) return;
  ------------------
  |  Branch (698:7): [True: 0, False: 18.4E]
  ------------------
  699|       |
  700|  18.4E|  int64_t var_offset = src_var - rec_var;
  701|       |
  702|  18.4E|  rd_cost->dist += var_offset;
  703|       |
  704|  18.4E|  rd_cost->rdcost = RDCOST(x->rdmult, rd_cost->rate, rd_cost->dist);
  ------------------
  |  |   33|  18.4E|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  18.4E|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  18.4E|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  18.4E|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  705|  18.4E|}
rdopt.c:update_search_state:
 5047|  4.09M|    const MACROBLOCK *x, int txfm_search_done) {
 5048|  4.09M|  const MACROBLOCKD *xd = &x->e_mbd;
 5049|  4.09M|  const MB_MODE_INFO *mbmi = xd->mi[0];
 5050|  4.09M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 5051|  4.09M|  const int skip_txfm =
 5052|  4.09M|      mbmi->skip_txfm && !is_mode_intra(av1_mode_defs[new_best_mode].mode);
  ------------------
  |  Branch (5052:7): [True: 201k, False: 3.89M]
  |  Branch (5052:26): [True: 201k, False: 10]
  ------------------
 5053|       |
 5054|  4.09M|  search_state->best_rd = new_best_rd_stats->rdcost;
 5055|  4.09M|  search_state->best_mode_index = new_best_mode;
 5056|  4.09M|  *best_rd_stats_dst = *new_best_rd_stats;
 5057|  4.09M|  search_state->best_mbmode = *mbmi;
 5058|  4.09M|  search_state->best_skip2 = skip_txfm;
 5059|  4.09M|  search_state->best_mode_skippable = new_best_rd_stats->skip_txfm;
 5060|       |  // When !txfm_search_done, new_best_rd_stats won't provide correct rate_y and
 5061|       |  // rate_uv because av1_txfm_search process is replaced by rd estimation.
 5062|       |  // Therefore, we should avoid updating best_rate_y and best_rate_uv here.
 5063|       |  // These two values will be updated when av1_txfm_search is called.
 5064|  4.09M|  if (txfm_search_done) {
  ------------------
  |  Branch (5064:7): [True: 4.08M, False: 12.9k]
  ------------------
 5065|  4.08M|    const int32_t skip_rate =
 5066|  4.08M|        x->mode_costs.skip_txfm_cost[skip_ctx]
 5067|  4.08M|                                    [new_best_rd_stats->skip_txfm || skip_txfm];
  ------------------
  |  Branch (5067:38): [True: 66.9k, False: 4.01M]
  |  Branch (5067:70): [True: 134k, False: 3.88M]
  ------------------
 5068|  4.08M|    const int32_t scaled_skip_rate =
 5069|  4.08M|        increase_motion_mode_rate(cpi, mbmi, skip_rate);
 5070|  4.08M|    search_state->best_rate_y = new_best_rd_stats_y->rate + scaled_skip_rate;
 5071|  4.08M|    search_state->best_rate_uv = new_best_rd_stats_uv->rate;
 5072|  4.08M|  }
 5073|  4.09M|  search_state->best_y_rdcost = *new_best_rd_stats_y;
 5074|       |  av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|  4.09M|  do {                                                    \
  |  |   39|  4.09M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  4.09M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  4.09M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4.09M]
  |  |  ------------------
  ------------------
 5075|  4.09M|}
rdopt.c:handle_winner_cand:
 5565|  3.75M|    motion_mode_candidate *motion_mode_cand, int skip_motion_mode) {
 5566|       |  // Number of current motion mode candidates in list
 5567|  3.75M|  const int num_motion_mode_cand = best_motion_mode_cands->num_motion_mode_cand;
 5568|  3.75M|  int valid_motion_mode_cand_loc = num_motion_mode_cand;
 5569|       |
 5570|       |  // find the best location to insert new motion mode candidate
 5571|  5.29M|  for (int j = 0; j < num_motion_mode_cand; j++) {
  ------------------
  |  Branch (5571:19): [True: 2.57M, False: 2.71M]
  ------------------
 5572|  2.57M|    if (this_rd < best_motion_mode_cands->motion_mode_cand[j].rd_cost) {
  ------------------
  |  Branch (5572:9): [True: 1.04M, False: 1.53M]
  ------------------
 5573|  1.04M|      valid_motion_mode_cand_loc = j;
 5574|  1.04M|      break;
 5575|  1.04M|    }
 5576|  2.57M|  }
 5577|       |
 5578|       |  // Insert motion mode if location is found
 5579|  3.75M|  if (valid_motion_mode_cand_loc < max_winner_motion_mode_cand) {
  ------------------
  |  Branch (5579:7): [True: 3.74M, False: 9.02k]
  ------------------
 5580|  3.74M|    if (num_motion_mode_cand > 0 &&
  ------------------
  |  Branch (5580:9): [True: 2.00M, False: 1.74M]
  ------------------
 5581|  2.00M|        valid_motion_mode_cand_loc < max_winner_motion_mode_cand - 1)
  ------------------
  |  Branch (5581:9): [True: 1.64M, False: 364k]
  ------------------
 5582|  1.64M|      memmove(
 5583|  1.64M|          &best_motion_mode_cands
 5584|  1.64M|               ->motion_mode_cand[valid_motion_mode_cand_loc + 1],
 5585|  1.64M|          &best_motion_mode_cands->motion_mode_cand[valid_motion_mode_cand_loc],
 5586|  1.64M|          (AOMMIN(num_motion_mode_cand, max_winner_motion_mode_cand - 1) -
  ------------------
  |  |   34|  1.64M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.44M, False: 194k]
  |  |  ------------------
  ------------------
 5587|  1.64M|           valid_motion_mode_cand_loc) *
 5588|  1.64M|              sizeof(best_motion_mode_cands->motion_mode_cand[0]));
 5589|  3.74M|    motion_mode_cand->mbmi = *mbmi;
 5590|  3.74M|    motion_mode_cand->rd_cost = this_rd;
 5591|  3.74M|    motion_mode_cand->skip_motion_mode = skip_motion_mode;
 5592|  3.74M|    best_motion_mode_cands->motion_mode_cand[valid_motion_mode_cand_loc] =
 5593|  3.74M|        *motion_mode_cand;
 5594|  3.74M|    best_motion_mode_cands->num_motion_mode_cand =
 5595|  3.74M|        AOMMIN(max_winner_motion_mode_cand,
  ------------------
  |  |   34|  3.74M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.74k, False: 3.74M]
  |  |  ------------------
  ------------------
 5596|  3.74M|               best_motion_mode_cands->num_motion_mode_cand + 1);
 5597|  3.74M|  }
 5598|  3.75M|}
rdopt.c:record_best_compound:
 5335|  3.75M|                                 int compmode_cost) {
 5336|  3.75M|  int64_t single_rd, hybrid_rd, single_rate, hybrid_rate;
 5337|       |
 5338|  3.75M|  if (reference_mode == REFERENCE_MODE_SELECT) {
  ------------------
  |  Branch (5338:7): [True: 3.75M, False: 18.4E]
  ------------------
 5339|  3.75M|    single_rate = rd_stats->rate - compmode_cost;
 5340|  3.75M|    hybrid_rate = rd_stats->rate;
 5341|  18.4E|  } else {
 5342|  18.4E|    single_rate = rd_stats->rate;
 5343|  18.4E|    hybrid_rate = rd_stats->rate + compmode_cost;
 5344|  18.4E|  }
 5345|       |
 5346|  3.75M|  single_rd = RDCOST(rdmult, single_rate, rd_stats->dist);
  ------------------
  |  |   33|  3.75M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.75M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.75M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5347|  3.75M|  hybrid_rd = RDCOST(rdmult, hybrid_rate, rd_stats->dist);
  ------------------
  |  |   33|  3.75M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.75M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.75M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.75M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5348|       |
 5349|  3.75M|  if (!comp_pred) {
  ------------------
  |  Branch (5349:7): [True: 3.75M, False: 18.4E]
  ------------------
 5350|  3.75M|    if (single_rd < search_state->best_pred_rd[SINGLE_REFERENCE])
  ------------------
  |  Branch (5350:9): [True: 2.60M, False: 1.15M]
  ------------------
 5351|  2.60M|      search_state->best_pred_rd[SINGLE_REFERENCE] = single_rd;
 5352|  18.4E|  } else {
 5353|  18.4E|    if (single_rd < search_state->best_pred_rd[COMPOUND_REFERENCE])
  ------------------
  |  Branch (5353:9): [True: 0, False: 18.4E]
  ------------------
 5354|      0|      search_state->best_pred_rd[COMPOUND_REFERENCE] = single_rd;
 5355|  18.4E|  }
 5356|  3.75M|  if (hybrid_rd < search_state->best_pred_rd[REFERENCE_MODE_SELECT])
  ------------------
  |  Branch (5356:7): [True: 2.60M, False: 1.15M]
  ------------------
 5357|  2.60M|    search_state->best_pred_rd[REFERENCE_MODE_SELECT] = hybrid_rd;
 5358|  3.75M|}
rdopt.c:evaluate_motion_mode_for_winner_candidates:
 5111|  1.91M|    InterModeSearchState *const search_state, int64_t *yrd) {
 5112|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 5113|  1.91M|  const int num_planes = av1_num_planes(cm);
 5114|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 5115|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 5116|  1.91M|  InterModesInfo *const inter_modes_info = x->inter_modes_info;
 5117|  1.91M|  const int num_best_cand = best_motion_mode_cands->num_motion_mode_cand;
 5118|       |
 5119|  5.66M|  for (int cand = 0; cand < num_best_cand; cand++) {
  ------------------
  |  Branch (5119:22): [True: 3.74M, False: 1.91M]
  ------------------
 5120|  3.74M|    RD_STATS rd_stats;
 5121|  3.74M|    RD_STATS rd_stats_y;
 5122|  3.74M|    RD_STATS rd_stats_uv;
 5123|  3.74M|    av1_init_rd_stats(&rd_stats);
 5124|  3.74M|    av1_init_rd_stats(&rd_stats_y);
 5125|  3.74M|    av1_init_rd_stats(&rd_stats_uv);
 5126|  3.74M|    int rate_mv;
 5127|       |
 5128|  3.74M|    rate_mv = best_motion_mode_cands->motion_mode_cand[cand].rate_mv;
 5129|  3.74M|    args->skip_motion_mode =
 5130|  3.74M|        best_motion_mode_cands->motion_mode_cand[cand].skip_motion_mode;
 5131|  3.74M|    *mbmi = best_motion_mode_cands->motion_mode_cand[cand].mbmi;
 5132|  3.74M|    rd_stats.rate =
 5133|  3.74M|        best_motion_mode_cands->motion_mode_cand[cand].rate2_nocoeff;
 5134|       |
 5135|       |    // Continue if the best candidate is compound.
 5136|  3.74M|    if (!is_inter_singleref_mode(mbmi->mode)) continue;
  ------------------
  |  Branch (5136:9): [True: 0, False: 3.74M]
  ------------------
 5137|       |
 5138|  3.74M|    x->txfm_search_info.skip_txfm = 0;
 5139|  3.74M|    struct macroblockd_plane *pd = xd->plane;
 5140|  3.74M|    const BUFFER_SET orig_dst = {
 5141|  3.74M|      { pd[0].dst.buf, pd[1].dst.buf, pd[2].dst.buf },
 5142|  3.74M|      { pd[0].dst.stride, pd[1].dst.stride, pd[2].dst.stride },
 5143|  3.74M|    };
 5144|       |
 5145|  3.74M|    set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 5146|       |    // Initialize motion mode to simple translation
 5147|       |    // Calculation of switchable rate depends on it.
 5148|  3.74M|    mbmi->motion_mode = 0;
 5149|  3.74M|    const int is_comp_pred = mbmi->ref_frame[1] > INTRA_FRAME;
 5150|  11.4M|    for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (5150:21): [True: 7.68M, False: 3.74M]
  ------------------
 5151|  7.68M|      xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
 5152|  7.68M|      if (is_comp_pred) xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
  ------------------
  |  Branch (5152:11): [True: 0, False: 7.68M]
  ------------------
 5153|  7.68M|    }
 5154|       |
 5155|  3.74M|    int64_t skip_rd[2] = { search_state->best_skip_rd[0],
 5156|  3.74M|                           search_state->best_skip_rd[1] };
 5157|  3.74M|    int64_t this_yrd = INT64_MAX;
 5158|  3.74M|    int64_t ret_value = motion_mode_rd(
 5159|  3.74M|        cpi, tile_data, x, bsize, &rd_stats, &rd_stats_y, &rd_stats_uv, args,
 5160|  3.74M|        search_state->best_rd, skip_rd, &rate_mv, &orig_dst, best_est_rd,
 5161|  3.74M|        do_tx_search, inter_modes_info, 1, &this_yrd);
 5162|       |
 5163|  3.74M|    if (ret_value != INT64_MAX) {
  ------------------
  |  Branch (5163:9): [True: 23.4k, False: 3.72M]
  ------------------
 5164|  23.4k|      rd_stats.rdcost = RDCOST(x->rdmult, rd_stats.rate, rd_stats.dist);
  ------------------
  |  |   33|  23.4k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  23.4k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  23.4k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  23.4k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5165|  23.4k|      const THR_MODES mode_enum = get_prediction_mode_idx(
 5166|  23.4k|          mbmi->mode, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 5167|       |      // Collect mode stats for multiwinner mode processing
 5168|  23.4k|      store_winner_mode_stats(
 5169|  23.4k|          cpi, x, mbmi, &rd_stats, &rd_stats_y, &rd_stats_uv, mode_enum, NULL,
 5170|  23.4k|          bsize, rd_stats.rdcost, cpi->sf.winner_mode_sf.multi_winner_mode_type,
 5171|  23.4k|          do_tx_search);
 5172|       |
 5173|  23.4k|      if (rd_stats.rdcost < search_state->best_rd) {
  ------------------
  |  Branch (5173:11): [True: 17.7k, False: 5.66k]
  ------------------
 5174|  17.7k|        *yrd = this_yrd;
 5175|  17.7k|        update_search_state(cpi, search_state, rd_cost, ctx, &rd_stats,
 5176|  17.7k|                            &rd_stats_y, &rd_stats_uv, mode_enum, x,
 5177|  17.7k|                            do_tx_search);
 5178|  17.7k|        if (do_tx_search) search_state->best_skip_rd[0] = skip_rd[0];
  ------------------
  |  Branch (5178:13): [True: 17.7k, False: 1]
  ------------------
 5179|  17.7k|      }
 5180|  23.4k|    }
 5181|  3.74M|  }
 5182|  1.91M|}
rdopt.c:tx_search_best_inter_candidates:
 5368|  7.59k|    PICK_MODE_CONTEXT *ctx, int64_t *yrd) {
 5369|  7.59k|  AV1_COMMON *const cm = &cpi->common;
 5370|  7.59k|  MACROBLOCKD *const xd = &x->e_mbd;
 5371|  7.59k|  TxfmSearchInfo *txfm_info = &x->txfm_search_info;
 5372|  7.59k|  const ModeCosts *mode_costs = &x->mode_costs;
 5373|  7.59k|  const int num_planes = av1_num_planes(cm);
 5374|  7.59k|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 5375|  7.59k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 5376|  7.59k|  InterModesInfo *inter_modes_info = x->inter_modes_info;
 5377|  7.59k|  inter_modes_info_sort(inter_modes_info, inter_modes_info->rd_idx_pair_arr);
 5378|  7.59k|  search_state->best_rd = best_rd_so_far;
 5379|  7.59k|  search_state->best_mode_index = THR_INVALID;
 5380|       |  // Initialize best mode stats for winner mode processing
 5381|  7.59k|  x->winner_mode_count = 0;
 5382|  7.59k|  store_winner_mode_stats(cpi, x, mbmi, NULL, NULL, NULL, THR_INVALID, NULL,
 5383|  7.59k|                          bsize, best_rd_so_far,
 5384|  7.59k|                          cpi->sf.winner_mode_sf.multi_winner_mode_type, 0);
 5385|  7.59k|  inter_modes_info->num =
 5386|  7.59k|      inter_modes_info->num < cpi->sf.rt_sf.num_inter_modes_for_tx_search
  ------------------
  |  Branch (5386:7): [True: 7.59k, False: 1]
  ------------------
 5387|  7.59k|          ? inter_modes_info->num
 5388|  7.59k|          : cpi->sf.rt_sf.num_inter_modes_for_tx_search;
 5389|  7.59k|  const int64_t top_est_rd =
 5390|  7.59k|      inter_modes_info->num > 0
  ------------------
  |  Branch (5390:7): [True: 7.59k, False: 2]
  ------------------
 5391|  7.59k|          ? inter_modes_info
 5392|  7.59k|                ->est_rd_arr[inter_modes_info->rd_idx_pair_arr[0].idx]
 5393|  7.59k|          : INT64_MAX;
 5394|  7.59k|  *yrd = INT64_MAX;
 5395|  7.59k|  int64_t best_rd_in_this_partition = INT64_MAX;
 5396|  7.59k|  int num_inter_mode_cands = inter_modes_info->num;
 5397|  7.59k|  int newmv_mode_evaled = 0;
 5398|  7.59k|  int max_allowed_cands = INT_MAX;
 5399|  7.59k|  if (cpi->sf.inter_sf.limit_inter_mode_cands) {
  ------------------
  |  Branch (5399:7): [True: 7.59k, False: 1]
  ------------------
 5400|       |    // The bound on the no. of inter mode candidates, beyond which the
 5401|       |    // candidates are limited if a newmv mode got evaluated, is set as
 5402|       |    // max_allowed_cands + 1.
 5403|  7.59k|    const int num_allowed_cands[5] = { INT_MAX, 10, 9, 6, 2 };
 5404|  7.59k|    assert(cpi->sf.inter_sf.limit_inter_mode_cands <= 4);
 5405|  7.59k|    max_allowed_cands =
 5406|  7.59k|        num_allowed_cands[cpi->sf.inter_sf.limit_inter_mode_cands];
 5407|  7.59k|  }
 5408|       |
 5409|  7.59k|  int num_mode_thresh = INT_MAX;
 5410|  7.59k|  if (cpi->sf.inter_sf.limit_txfm_eval_per_mode) {
  ------------------
  |  Branch (5410:7): [True: 7.59k, False: 1]
  ------------------
 5411|       |    // Bound the no. of transform searches per prediction mode beyond a
 5412|       |    // threshold.
 5413|  7.59k|    const int num_mode_thresh_ary[4] = { INT_MAX, 4, 3, 0 };
 5414|  7.59k|    assert(cpi->sf.inter_sf.limit_txfm_eval_per_mode <= 3);
 5415|  7.59k|    num_mode_thresh =
 5416|  7.59k|        num_mode_thresh_ary[cpi->sf.inter_sf.limit_txfm_eval_per_mode];
 5417|  7.59k|  }
 5418|       |
 5419|  7.59k|  int num_tx_cands = 0;
 5420|  7.59k|  int num_tx_search_modes[INTER_MODE_END - INTER_MODE_START] = { 0 };
 5421|       |  // Iterate over best inter mode candidates and perform tx search
 5422|  31.9k|  for (int j = 0; j < num_inter_mode_cands; ++j) {
  ------------------
  |  Branch (5422:19): [True: 24.3k, False: 7.55k]
  ------------------
 5423|  24.3k|    const int data_idx = inter_modes_info->rd_idx_pair_arr[j].idx;
 5424|  24.3k|    *mbmi = inter_modes_info->mbmi_arr[data_idx];
 5425|  24.3k|    const PREDICTION_MODE prediction_mode = mbmi->mode;
 5426|  24.3k|    int64_t curr_est_rd = inter_modes_info->est_rd_arr[data_idx];
 5427|  24.3k|    if (curr_est_rd * 0.80 > top_est_rd) break;
  ------------------
  |  Branch (5427:9): [True: 35, False: 24.3k]
  ------------------
 5428|       |
 5429|  24.3k|    if (num_tx_cands > num_mode_thresh) {
  ------------------
  |  Branch (5429:9): [True: 832, False: 23.5k]
  ------------------
 5430|    832|      if ((prediction_mode != NEARESTMV &&
  ------------------
  |  Branch (5430:12): [True: 629, False: 203]
  ------------------
 5431|    629|           num_tx_search_modes[prediction_mode - INTER_MODE_START] >= 1) ||
  ------------------
  |  Branch (5431:12): [True: 556, False: 73]
  ------------------
 5432|    277|          (prediction_mode == NEARESTMV &&
  ------------------
  |  Branch (5432:12): [True: 203, False: 74]
  ------------------
 5433|    203|           num_tx_search_modes[prediction_mode - INTER_MODE_START] >= 2))
  ------------------
  |  Branch (5433:12): [True: 0, False: 203]
  ------------------
 5434|    556|        continue;
 5435|    832|    }
 5436|       |
 5437|  23.7k|    txfm_info->skip_txfm = 0;
 5438|  23.7k|    set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 5439|       |
 5440|       |    // Select prediction reference frames.
 5441|  23.7k|    const int is_comp_pred = mbmi->ref_frame[1] > INTRA_FRAME;
 5442|  49.2k|    for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (5442:21): [True: 25.4k, False: 23.7k]
  ------------------
 5443|  25.4k|      xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
 5444|  25.4k|      if (is_comp_pred) xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
  ------------------
  |  Branch (5444:11): [True: 0, False: 25.4k]
  ------------------
 5445|  25.4k|    }
 5446|       |
 5447|  23.7k|    bool is_predictor_built = false;
 5448|       |
 5449|       |    // Initialize RD stats
 5450|  23.7k|    RD_STATS rd_stats;
 5451|  23.7k|    RD_STATS rd_stats_y;
 5452|  23.7k|    RD_STATS rd_stats_uv;
 5453|  23.7k|    const int mode_rate = inter_modes_info->mode_rate_arr[data_idx];
 5454|  23.7k|    int64_t skip_rd = INT64_MAX;
 5455|  23.7k|    const int txfm_rd_gate_level = get_txfm_rd_gate_level(
 5456|  23.7k|        cm->seq_params->enable_masked_compound,
 5457|  23.7k|        cpi->sf.inter_sf.txfm_rd_gate_level, bsize, TX_SEARCH_DEFAULT,
 5458|  23.7k|        /*eval_motion_mode=*/0);
 5459|  23.7k|    if (txfm_rd_gate_level) {
  ------------------
  |  Branch (5459:9): [True: 23.7k, False: 0]
  ------------------
 5460|       |      // Check if the mode is good enough based on skip RD
 5461|  23.7k|      int64_t curr_sse = inter_modes_info->sse_arr[data_idx];
 5462|  23.7k|      skip_rd = RDCOST(x->rdmult, mode_rate, curr_sse);
  ------------------
  |  |   33|  23.7k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  23.7k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  23.7k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  23.7k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5463|  23.7k|      int eval_txfm = check_txfm_eval(x, bsize, search_state->best_skip_rd[0],
 5464|  23.7k|                                      skip_rd, txfm_rd_gate_level, 0);
 5465|  23.7k|      if (!eval_txfm) continue;
  ------------------
  |  Branch (5465:11): [True: 5.39k, False: 18.3k]
  ------------------
 5466|  23.7k|    }
 5467|       |
 5468|       |    // Build the prediction for this mode
 5469|  18.3k|    if (!is_predictor_built) {
  ------------------
  |  Branch (5469:9): [True: 18.3k, False: 18.4E]
  ------------------
 5470|  18.3k|      av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize, 0,
 5471|  18.3k|                                    av1_num_planes(cm) - 1);
 5472|  18.3k|    }
 5473|  18.3k|    if (mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (5473:9): [True: 0, False: 18.3k]
  ------------------
 5474|      0|      av1_build_obmc_inter_predictors_sb(cm, xd);
 5475|      0|    }
 5476|       |
 5477|  18.3k|    num_tx_cands++;
 5478|  18.3k|    if (have_newmv_in_inter_mode(prediction_mode)) newmv_mode_evaled = 1;
  ------------------
  |  Branch (5478:9): [True: 7.13k, False: 11.2k]
  ------------------
 5479|  18.3k|    num_tx_search_modes[prediction_mode - INTER_MODE_START]++;
 5480|  18.3k|    int64_t this_yrd = INT64_MAX;
 5481|       |    // Do the transform search
 5482|  18.3k|    if (!av1_txfm_search(cpi, x, bsize, &rd_stats, &rd_stats_y, &rd_stats_uv,
  ------------------
  |  Branch (5482:9): [True: 9.34k, False: 9.05k]
  ------------------
 5483|  18.3k|                         mode_rate, search_state->best_rd)) {
 5484|  9.34k|      continue;
 5485|  9.34k|    } else {
 5486|  9.05k|      if (cpi->sf.inter_sf.inter_mode_rd_model_estimation == 1) {
  ------------------
  |  Branch (5486:11): [True: 1.14k, False: 7.90k]
  ------------------
 5487|  1.14k|        inter_mode_data_push(
 5488|  1.14k|            tile_data, mbmi->bsize, rd_stats.sse, rd_stats.dist,
 5489|  1.14k|            rd_stats_y.rate + rd_stats_uv.rate +
 5490|  1.14k|                mode_costs->skip_txfm_cost[skip_ctx][mbmi->skip_txfm]);
 5491|  1.14k|      }
 5492|  9.05k|      increase_motion_mode_rdstats(cpi, mbmi, &rd_stats, &rd_stats_y,
 5493|  9.05k|                                   &rd_stats_uv);
 5494|  9.05k|      const int *skip_txfm_cost_ptr = mode_costs->skip_txfm_cost[skip_ctx];
 5495|  9.05k|      const int skip_rate =
 5496|  9.05k|          rd_stats.skip_txfm ? skip_txfm_cost_ptr[1] : skip_txfm_cost_ptr[0];
  ------------------
  |  Branch (5496:11): [True: 331, False: 8.72k]
  ------------------
 5497|  9.05k|      const int32_t scaled_skip_rate =
 5498|  9.05k|          increase_motion_mode_rate(cpi, mbmi, skip_rate);
 5499|  9.05k|      const int y_rate =
 5500|  9.05k|          scaled_skip_rate + (rd_stats.skip_txfm ? 0 : rd_stats_y.rate);
  ------------------
  |  Branch (5500:31): [True: 331, False: 8.72k]
  ------------------
 5501|  9.05k|      this_yrd = RDCOST(x->rdmult, y_rate + mode_rate, rd_stats_y.dist);
  ------------------
  |  |   33|  9.05k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  9.05k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  9.05k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  9.05k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5502|  9.05k|    }
 5503|       |
 5504|  9.05k|    rd_stats.rdcost = RDCOST(x->rdmult, rd_stats.rate, rd_stats.dist);
  ------------------
  |  |   33|  9.05k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  9.05k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  9.05k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  9.05k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5505|       |
 5506|  9.05k|    const THR_MODES mode_enum = get_prediction_mode_idx(
 5507|  9.05k|        prediction_mode, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 5508|       |
 5509|       |    // Collect mode stats for multiwinner mode processing
 5510|  9.05k|    const int txfm_search_done = 1;
 5511|  9.05k|    store_winner_mode_stats(cpi, x, mbmi, &rd_stats, &rd_stats_y, &rd_stats_uv,
 5512|  9.05k|                            mode_enum, NULL, bsize, rd_stats.rdcost,
 5513|  9.05k|                            cpi->sf.winner_mode_sf.multi_winner_mode_type,
 5514|  9.05k|                            txfm_search_done);
 5515|       |
 5516|  9.05k|    if (rd_stats.rdcost < best_rd_in_this_partition) {
  ------------------
  |  Branch (5516:9): [True: 9.04k, False: 3]
  ------------------
 5517|  9.04k|      best_rd_in_this_partition = rd_stats.rdcost;
 5518|  9.04k|      *yrd = this_yrd;
 5519|  9.04k|    }
 5520|       |
 5521|  9.05k|    if (rd_stats.rdcost < search_state->best_rd) {
  ------------------
  |  Branch (5521:9): [True: 9.05k, False: 0]
  ------------------
 5522|  9.05k|      update_search_state(cpi, search_state, rd_cost, ctx, &rd_stats,
 5523|  9.05k|                          &rd_stats_y, &rd_stats_uv, mode_enum, x,
 5524|  9.05k|                          txfm_search_done);
 5525|  9.05k|      search_state->best_skip_rd[0] = skip_rd;
 5526|       |      // Limit the total number of modes to be evaluated if the first is valid
 5527|       |      // and transform skip or compound
 5528|  9.05k|      if (cpi->sf.inter_sf.inter_mode_txfm_breakout) {
  ------------------
  |  Branch (5528:11): [True: 9.05k, False: 1]
  ------------------
 5529|  9.05k|        if (!j && (search_state->best_mbmode.skip_txfm || rd_stats.skip_txfm)) {
  ------------------
  |  Branch (5529:13): [True: 7.42k, False: 1.62k]
  |  Branch (5529:20): [True: 641, False: 6.78k]
  |  Branch (5529:59): [True: 0, False: 6.78k]
  ------------------
 5530|       |          // Evaluate more candidates at high quantizers where occurrence of
 5531|       |          // transform skip is high.
 5532|    641|          const int max_cands_cap[5] = { 2, 3, 5, 7, 9 };
 5533|    641|          const int qindex_band = (5 * x->qindex) >> QINDEX_BITS;
  ------------------
  |  |   28|    641|#define QINDEX_BITS 8
  ------------------
 5534|    641|          num_inter_mode_cands =
 5535|    641|              AOMMIN(max_cands_cap[qindex_band], inter_modes_info->num);
  ------------------
  |  |   34|    641|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 641]
  |  |  ------------------
  ------------------
 5536|  8.40k|        } else if (!j && has_second_ref(&search_state->best_mbmode)) {
  ------------------
  |  Branch (5536:20): [True: 6.78k, False: 1.62k]
  |  Branch (5536:26): [True: 0, False: 6.78k]
  ------------------
 5537|      0|          const int aggr = cpi->sf.inter_sf.inter_mode_txfm_breakout - 1;
 5538|       |          // Evaluate more candidates at low quantizers where occurrence of
 5539|       |          // single reference mode is high.
 5540|      0|          const int max_cands_cap_cmp[2][4] = { { 10, 7, 5, 4 },
 5541|      0|                                                { 10, 7, 5, 3 } };
 5542|      0|          const int qindex_band_cmp = (4 * x->qindex) >> QINDEX_BITS;
  ------------------
  |  |   28|      0|#define QINDEX_BITS 8
  ------------------
 5543|      0|          num_inter_mode_cands = AOMMIN(
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5544|      0|              max_cands_cap_cmp[aggr][qindex_band_cmp], inter_modes_info->num);
 5545|      0|        }
 5546|  9.05k|      }
 5547|  9.05k|    }
 5548|       |    // If the number of candidates evaluated exceeds max_allowed_cands, break if
 5549|       |    // a newmv mode was evaluated already.
 5550|  9.05k|    if ((num_tx_cands > max_allowed_cands) && newmv_mode_evaled) break;
  ------------------
  |  Branch (5550:9): [True: 0, False: 9.05k]
  |  Branch (5550:47): [True: 0, False: 0]
  ------------------
 5551|  9.05k|  }
 5552|  7.59k|}
rdopt.c:inter_modes_info_sort:
  503|  7.59k|                                         RdIdxPair *rd_idx_pair_arr) {
  504|  7.59k|  if (inter_modes_info->num == 0) {
  ------------------
  |  Branch (504:7): [True: 1, False: 7.59k]
  ------------------
  505|      1|    return;
  506|      1|  }
  507|  31.9k|  for (int i = 0; i < inter_modes_info->num; ++i) {
  ------------------
  |  Branch (507:19): [True: 24.3k, False: 7.59k]
  ------------------
  508|  24.3k|    rd_idx_pair_arr[i].idx = i;
  509|  24.3k|    rd_idx_pair_arr[i].rd = inter_modes_info->est_rd_arr[i];
  510|  24.3k|  }
  511|  7.59k|  qsort(rd_idx_pair_arr, inter_modes_info->num, sizeof(rd_idx_pair_arr[0]),
  512|  7.59k|        compare_rd_idx_pair);
  513|  7.59k|}
rdopt.c:compare_rd_idx_pair:
  485|  24.3k|static int compare_rd_idx_pair(const void *a, const void *b) {
  486|  24.3k|  if (((RdIdxPair *)a)->rd == ((RdIdxPair *)b)->rd) {
  ------------------
  |  Branch (486:7): [True: 6, False: 24.3k]
  ------------------
  487|       |    // To avoid inconsistency in qsort() ordering when two elements are equal,
  488|       |    // using idx as tie breaker. Refer aomedia:2928
  489|      6|    if (((RdIdxPair *)a)->idx == ((RdIdxPair *)b)->idx)
  ------------------
  |  Branch (489:9): [True: 0, False: 6]
  ------------------
  490|      0|      return 0;
  491|      6|    else if (((RdIdxPair *)a)->idx > ((RdIdxPair *)b)->idx)
  ------------------
  |  Branch (491:14): [True: 0, False: 6]
  ------------------
  492|      0|      return 1;
  493|      6|    else
  494|      6|      return -1;
  495|  24.3k|  } else if (((const RdIdxPair *)a)->rd > ((const RdIdxPair *)b)->rd) {
  ------------------
  |  Branch (495:14): [True: 9.64k, False: 14.7k]
  ------------------
  496|  9.64k|    return 1;
  497|  14.7k|  } else {
  498|  14.7k|    return -1;
  499|  14.7k|  }
  500|  24.3k|}
rdopt.c:skip_intra_modes_in_interframe:
 5887|  1.91M|    int64_t inter_cost, int64_t intra_cost) {
 5888|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 5889|  1.91M|  const int comp_pred = search_state->best_mbmode.ref_frame[1] > INTRA_FRAME;
 5890|  1.91M|  if (sf->rt_sf.prune_intra_mode_based_on_mv_range &&
  ------------------
  |  Branch (5890:7): [True: 0, False: 1.91M]
  ------------------
 5891|      0|      bsize > sf->part_sf.max_intra_bsize && !comp_pred) {
  ------------------
  |  Branch (5891:7): [True: 0, False: 0]
  |  Branch (5891:46): [True: 0, False: 0]
  ------------------
 5892|      0|    const MV best_mv = search_state->best_mbmode.mv[0].as_mv;
 5893|      0|    const int mv_thresh = 16 << sf->rt_sf.prune_intra_mode_based_on_mv_range;
 5894|      0|    if (abs(best_mv.row) < mv_thresh && abs(best_mv.col) < mv_thresh &&
  ------------------
  |  Branch (5894:9): [True: 0, False: 0]
  |  Branch (5894:41): [True: 0, False: 0]
  ------------------
 5895|      0|        x->source_variance > 128) {
  ------------------
  |  Branch (5895:9): [True: 0, False: 0]
  ------------------
 5896|      0|      search_state->intra_search_state.skip_intra_modes = 1;
 5897|      0|      return;
 5898|      0|    }
 5899|      0|  }
 5900|       |
 5901|  1.91M|  const unsigned int src_var_thresh_intra_skip = 1;
 5902|  1.91M|  const int skip_intra_in_interframe = sf->intra_sf.skip_intra_in_interframe;
 5903|  1.91M|  if (!(skip_intra_in_interframe &&
  ------------------
  |  Branch (5903:9): [True: 516k, False: 1.40M]
  ------------------
 5904|   516k|        (x->source_variance > src_var_thresh_intra_skip)))
  ------------------
  |  Branch (5904:9): [True: 516k, False: 450]
  ------------------
 5905|  1.40M|    return;
 5906|       |
 5907|       |  // Prune intra search based on best inter mode being transfrom skip.
 5908|   516k|  if ((skip_intra_in_interframe >= 2) && search_state->best_mbmode.skip_txfm) {
  ------------------
  |  Branch (5908:7): [True: 516k, False: 44]
  |  Branch (5908:42): [True: 57.3k, False: 459k]
  ------------------
 5909|  57.3k|    const int qindex_thresh[2] = { 200, MAXQ };
  ------------------
  |  |   26|  57.3k|#define MAXQ 255
  ------------------
 5910|  57.3k|    const int ind = (skip_intra_in_interframe >= 3) ? 1 : 0;
  ------------------
  |  Branch (5910:21): [True: 57.3k, False: 2]
  ------------------
 5911|  57.3k|    if (!have_newmv_in_inter_mode(search_state->best_mbmode.mode) &&
  ------------------
  |  Branch (5911:9): [True: 50.7k, False: 6.53k]
  ------------------
 5912|  50.7k|        (x->qindex <= qindex_thresh[ind])) {
  ------------------
  |  Branch (5912:9): [True: 50.7k, False: 1]
  ------------------
 5913|  50.7k|      search_state->intra_search_state.skip_intra_modes = 1;
 5914|  50.7k|      return;
 5915|  50.7k|    } else if ((skip_intra_in_interframe >= 4) &&
  ------------------
  |  Branch (5915:16): [True: 6.52k, False: 5]
  ------------------
 5916|  6.52k|               (inter_cost < 0 || intra_cost < 0)) {
  ------------------
  |  Branch (5916:17): [True: 6.52k, False: 0]
  |  Branch (5916:35): [True: 0, False: 0]
  ------------------
 5917|  6.52k|      search_state->intra_search_state.skip_intra_modes = 1;
 5918|  6.52k|      return;
 5919|  6.52k|    }
 5920|  57.3k|  }
 5921|       |  // Use ML model to prune intra search.
 5922|   459k|  if (inter_cost >= 0 && intra_cost >= 0) {
  ------------------
  |  Branch (5922:7): [True: 0, False: 459k]
  |  Branch (5922:26): [True: 0, False: 0]
  ------------------
 5923|      0|    const NN_CONFIG *nn_config = (AOMMIN(cm->width, cm->height) <= 480)
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5923:34): [True: 0, False: 0]
  ------------------
 5924|      0|                                     ? &av1_intrap_nn_config
 5925|      0|                                     : &av1_intrap_hd_nn_config;
 5926|      0|    float nn_features[6];
 5927|      0|    float scores[2] = { 0.0f };
 5928|       |
 5929|      0|    nn_features[0] = (float)search_state->best_mbmode.skip_txfm;
 5930|      0|    nn_features[1] = (float)mi_size_wide_log2[bsize];
 5931|      0|    nn_features[2] = (float)mi_size_high_log2[bsize];
 5932|      0|    nn_features[3] = (float)intra_cost;
 5933|      0|    nn_features[4] = (float)inter_cost;
 5934|      0|    const int ac_q = av1_ac_quant_QTX(x->qindex, 0, xd->bd);
 5935|      0|    const int ac_q_max = av1_ac_quant_QTX(255, 0, xd->bd);
 5936|      0|    nn_features[5] = (float)(ac_q_max / ac_q);
 5937|       |
 5938|      0|    av1_nn_predict(nn_features, nn_config, 1, scores);
 5939|       |
 5940|       |    // For two parameters, the max prob returned from av1_nn_softmax equals
 5941|       |    // 1.0 / (1.0 + e^(-|diff_score|)). Here use scores directly to avoid the
 5942|       |    // calling of av1_nn_softmax.
 5943|      0|    const float thresh[5] = { 1.4f, 1.4f, 1.4f, 1.4f, 1.4f };
 5944|      0|    assert(skip_intra_in_interframe <= 5);
 5945|      0|    if (scores[1] > scores[0] + thresh[skip_intra_in_interframe - 1]) {
  ------------------
  |  Branch (5945:9): [True: 0, False: 0]
  ------------------
 5946|      0|      search_state->intra_search_state.skip_intra_modes = 1;
 5947|      0|    }
 5948|      0|  }
 5949|   459k|}
rdopt.c:search_intra_modes_in_interframe:
 5642|  1.91M|    int64_t yrd_threshold) {
 5643|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 5644|  1.91M|  const SPEED_FEATURES *const sf = &cpi->sf;
 5645|  1.91M|  const IntraModeCfg *const intra_mode_cfg = &cpi->oxcf.intra_mode_cfg;
 5646|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 5647|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 5648|  1.91M|  IntraModeSearchState *intra_search_state = &search_state->intra_search_state;
 5649|       |
 5650|  1.91M|  int is_best_y_mode_intra = 0;
 5651|  1.91M|  RD_STATS best_intra_rd_stats_y;
 5652|  1.91M|  int64_t best_rd_y = INT64_MAX;
 5653|  1.91M|  int best_mode_cost_y = -1;
 5654|  1.91M|  MB_MODE_INFO best_mbmi = *xd->mi[0];
 5655|  1.91M|  THR_MODES best_mode_enum = THR_INVALID;
 5656|  1.91M|  uint8_t best_tx_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 5657|  1.91M|  const int num_4x4 = bsize_to_num_blk(bsize);
 5658|       |
 5659|       |  // Performs luma search
 5660|  1.91M|  int64_t best_model_rd = INT64_MAX;
 5661|  1.91M|  int64_t top_intra_model_rd[TOP_INTRA_MODEL_COUNT];
 5662|  9.58M|  for (int i = 0; i < TOP_INTRA_MODEL_COUNT; i++) {
  ------------------
  |  |  391|  9.58M|#define TOP_INTRA_MODEL_COUNT 4
  ------------------
  |  Branch (5662:19): [True: 7.67M, False: 1.91M]
  ------------------
 5663|  7.67M|    top_intra_model_rd[i] = INT64_MAX;
 5664|  7.67M|  }
 5665|       |
 5666|  1.91M|  if (cpi->oxcf.algo_cfg.sharpness) {
  ------------------
  |  Branch (5666:7): [True: 1.40M, False: 517k]
  ------------------
 5667|  1.40M|    int bh = mi_size_high[bsize];
 5668|  1.40M|    int bw = mi_size_wide[bsize];
 5669|  1.40M|    if (bh > 4 || bw > 4) return;
  ------------------
  |  Branch (5669:9): [True: 11.7k, False: 1.38M]
  |  Branch (5669:19): [True: 66, False: 1.38M]
  ------------------
 5670|  1.40M|  }
 5671|       |
 5672|  1.90M|  mbmi->skip_txfm = 0;
 5673|       |
 5674|   114M|  for (int mode_idx = 0; mode_idx < LUMA_MODE_COUNT; ++mode_idx) {
  ------------------
  |  |  395|   114M|#define LUMA_MODE_COUNT (PAETH_PRED - DC_PRED + 1 + 6 * 8)
  ------------------
  |  Branch (5674:26): [True: 112M, False: 1.84M]
  ------------------
 5675|   112M|    if (sf->intra_sf.skip_intra_in_interframe &&
  ------------------
  |  Branch (5675:9): [True: 27.9M, False: 84.4M]
  ------------------
 5676|  27.9M|        search_state->intra_search_state.skip_intra_modes)
  ------------------
  |  Branch (5676:9): [True: 57.9k, False: 27.8M]
  ------------------
 5677|  57.9k|      break;
 5678|   112M|    set_y_mode_and_delta_angle(
 5679|   112M|        mode_idx, mbmi, sf->intra_sf.prune_luma_odd_delta_angles_in_intra);
 5680|   112M|    assert(mbmi->mode < INTRA_MODE_END);
 5681|       |
 5682|       |    // Use intra_y_mode_mask speed feature to skip intra mode evaluation.
 5683|   112M|    if (sf_args->mode_skip_mask->pred_modes[INTRA_FRAME] & (1 << mbmi->mode))
  ------------------
  |  Branch (5683:9): [True: 410k, False: 111M]
  ------------------
 5684|   410k|      continue;
 5685|       |
 5686|   111M|    const THR_MODES mode_enum =
 5687|   111M|        get_prediction_mode_idx(mbmi->mode, INTRA_FRAME, NONE_FRAME);
 5688|   111M|    if ((!intra_mode_cfg->enable_smooth_intra ||
  ------------------
  |  Branch (5688:10): [True: 21.7k, False: 111M]
  ------------------
 5689|   111M|         cpi->sf.intra_sf.disable_smooth_intra) &&
  ------------------
  |  Branch (5689:10): [True: 111M, False: 0]
  ------------------
 5690|   111M|        (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED ||
  ------------------
  |  Branch (5690:10): [True: 1.83M, False: 110M]
  |  Branch (5690:39): [True: 1.83M, False: 108M]
  ------------------
 5691|   108M|         mbmi->mode == SMOOTH_V_PRED))
  ------------------
  |  Branch (5691:10): [True: 1.82M, False: 106M]
  ------------------
 5692|  5.52M|      continue;
 5693|   106M|    if (!intra_mode_cfg->enable_paeth_intra && mbmi->mode == PAETH_PRED)
  ------------------
  |  Branch (5693:9): [True: 0, False: 106M]
  |  Branch (5693:48): [True: 0, False: 0]
  ------------------
 5694|      0|      continue;
 5695|   106M|    if (av1_is_directional_mode(mbmi->mode) &&
  ------------------
  |  Branch (5695:9): [True: 102M, False: 3.66M]
  ------------------
 5696|   102M|        !(av1_use_angle_delta(bsize) && intra_mode_cfg->enable_angle_delta) &&
  ------------------
  |  Branch (5696:11): [True: 80.5M, False: 22.1M]
  |  Branch (5696:41): [True: 80.5M, False: 18.4E]
  ------------------
 5697|  22.1M|        mbmi->angle_delta[PLANE_TYPE_Y] != 0)
  ------------------
  |  Branch (5697:9): [True: 19.0M, False: 3.16M]
  ------------------
 5698|  19.0M|      continue;
 5699|  87.3M|    const PREDICTION_MODE this_mode = mbmi->mode;
 5700|       |
 5701|  87.3M|    assert(av1_mode_defs[mode_enum].ref_frame[0] == INTRA_FRAME);
 5702|  87.3M|    assert(av1_mode_defs[mode_enum].ref_frame[1] == NONE_FRAME);
 5703|  87.3M|    init_mbmi(mbmi, this_mode, av1_mode_defs[mode_enum].ref_frame, cm);
 5704|  87.3M|    x->txfm_search_info.skip_txfm = 0;
 5705|       |
 5706|  87.3M|    if (this_mode != DC_PRED) {
  ------------------
  |  Branch (5706:9): [True: 85.5M, False: 1.86M]
  ------------------
 5707|       |      // Only search the oblique modes if the best so far is
 5708|       |      // one of the neighboring directional modes
 5709|  85.5M|      if ((sf->rt_sf.mode_search_skip_flags & FLAG_SKIP_INTRA_BESTINTER) &&
  ------------------
  |  Branch (5709:11): [True: 0, False: 85.5M]
  ------------------
 5710|      0|          (this_mode >= D45_PRED && this_mode <= PAETH_PRED)) {
  ------------------
  |  Branch (5710:12): [True: 0, False: 0]
  |  Branch (5710:37): [True: 0, False: 0]
  ------------------
 5711|      0|        if (search_state->best_mode_index != THR_INVALID &&
  ------------------
  |  Branch (5711:13): [True: 0, False: 0]
  ------------------
 5712|      0|            search_state->best_mbmode.ref_frame[0] > INTRA_FRAME)
  ------------------
  |  Branch (5712:13): [True: 0, False: 0]
  ------------------
 5713|      0|          continue;
 5714|      0|      }
 5715|  85.5M|      if (sf->rt_sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) {
  ------------------
  |  Branch (5715:11): [True: 0, False: 85.5M]
  ------------------
 5716|      0|        if (conditional_skipintra(
  ------------------
  |  Branch (5716:13): [True: 0, False: 0]
  ------------------
 5717|      0|                this_mode, search_state->intra_search_state.best_intra_mode))
 5718|      0|          continue;
 5719|      0|      }
 5720|  85.5M|    }
 5721|       |
 5722|  87.3M|    RD_STATS intra_rd_stats_y;
 5723|  87.3M|    int mode_cost_y;
 5724|  87.3M|    int64_t intra_rd_y = INT64_MAX;
 5725|  87.3M|    const int is_luma_result_valid = av1_handle_intra_y_mode(
 5726|  87.3M|        intra_search_state, cpi, x, bsize, intra_ref_frame_cost, ctx,
 5727|  87.3M|        &intra_rd_stats_y, search_state->best_rd, &mode_cost_y, &intra_rd_y,
 5728|  87.3M|        &best_model_rd, top_intra_model_rd);
 5729|       |
 5730|  87.3M|    if (intra_rd_y < INT64_MAX) {
  ------------------
  |  Branch (5730:9): [True: 4.78M, False: 82.5M]
  ------------------
 5731|  4.78M|      adjust_cost(cpi, x, &intra_rd_y, /*is_inter_pred=*/false);
 5732|  4.78M|    }
 5733|       |
 5734|  87.3M|    if (is_luma_result_valid && intra_rd_y < yrd_threshold) {
  ------------------
  |  Branch (5734:9): [True: 4.76M, False: 82.6M]
  |  Branch (5734:33): [True: 4.07M, False: 691k]
  ------------------
 5735|  4.07M|      is_best_y_mode_intra = 1;
 5736|  4.07M|      if (intra_rd_y < best_rd_y) {
  ------------------
  |  Branch (5736:11): [True: 1.80M, False: 2.27M]
  ------------------
 5737|  1.80M|        best_intra_rd_stats_y = intra_rd_stats_y;
 5738|  1.80M|        best_mode_cost_y = mode_cost_y;
 5739|  1.80M|        best_rd_y = intra_rd_y;
 5740|  1.80M|        best_mbmi = *mbmi;
 5741|  1.80M|        best_mode_enum = mode_enum;
 5742|  1.80M|        av1_copy_array(best_tx_type_map, xd->tx_type_map, num_4x4);
  ------------------
  |  |   38|  1.80M|  do {                                                    \
  |  |   39|  1.80M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  1.80M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  1.80M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.80M]
  |  |  ------------------
  ------------------
 5743|  1.80M|      }
 5744|  4.07M|    }
 5745|  87.3M|  }
 5746|       |
 5747|  1.90M|  if (!is_best_y_mode_intra) {
  ------------------
  |  Branch (5747:7): [True: 292k, False: 1.61M]
  ------------------
 5748|   292k|    return;
 5749|   292k|  }
 5750|       |
 5751|  1.90M|  assert(best_rd_y < INT64_MAX);
 5752|       |
 5753|       |  // Restores the best luma mode
 5754|  1.61M|  *mbmi = best_mbmi;
 5755|  1.61M|  av1_copy_array(xd->tx_type_map, best_tx_type_map, num_4x4);
  ------------------
  |  |   38|  1.61M|  do {                                                    \
  |  |   39|  1.61M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  1.61M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  1.61M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.61M]
  |  |  ------------------
  ------------------
 5756|       |
 5757|       |  // Performs chroma search
 5758|  1.61M|  RD_STATS intra_rd_stats, intra_rd_stats_uv;
 5759|  1.61M|  av1_init_rd_stats(&intra_rd_stats);
 5760|  1.61M|  av1_init_rd_stats(&intra_rd_stats_uv);
 5761|  1.61M|  const int num_planes = av1_num_planes(cm);
 5762|  1.61M|  if (num_planes > 1) {
  ------------------
  |  Branch (5762:7): [True: 865k, False: 747k]
  ------------------
 5763|   865k|    const int intra_uv_mode_valid = av1_search_intra_uv_modes_in_interframe(
 5764|   865k|        intra_search_state, cpi, x, bsize, &intra_rd_stats,
 5765|   865k|        &best_intra_rd_stats_y, &intra_rd_stats_uv, search_state->best_rd);
 5766|       |
 5767|   865k|    if (!intra_uv_mode_valid) {
  ------------------
  |  Branch (5767:9): [True: 32.0k, False: 833k]
  ------------------
 5768|  32.0k|      return;
 5769|  32.0k|    }
 5770|   865k|  }
 5771|       |
 5772|       |  // Merge the luma and chroma rd stats
 5773|  1.61M|  assert(best_mode_cost_y >= 0);
 5774|  1.58M|  intra_rd_stats.rate = best_intra_rd_stats_y.rate + best_mode_cost_y;
 5775|  1.58M|  if (!xd->lossless[mbmi->segment_id] && block_signals_txsize(bsize)) {
  ------------------
  |  Branch (5775:7): [True: 1.56M, False: 21.3k]
  |  Branch (5775:42): [True: 1.34M, False: 214k]
  ------------------
 5776|       |    // av1_pick_uniform_tx_size_type_yrd above includes the cost of the tx_size
 5777|       |    // in the tokenonly rate, but for intra blocks, tx_size is always coded
 5778|       |    // (prediction granularity), so we account for it in the full rate,
 5779|       |    // not the tokenonly rate.
 5780|  1.34M|    best_intra_rd_stats_y.rate -= tx_size_cost(x, bsize, mbmi->tx_size);
 5781|  1.34M|  }
 5782|       |
 5783|  1.58M|  const ModeCosts *mode_costs = &x->mode_costs;
 5784|  1.58M|  const PREDICTION_MODE mode = mbmi->mode;
 5785|  1.58M|  if (num_planes > 1 && xd->is_chroma_ref) {
  ------------------
  |  Branch (5785:7): [True: 833k, False: 747k]
  |  Branch (5785:25): [True: 730k, False: 102k]
  ------------------
 5786|   730k|    const int uv_mode_cost =
 5787|   730k|        mode_costs->intra_uv_mode_cost[is_cfl_allowed(xd)][mode][mbmi->uv_mode];
 5788|   730k|    intra_rd_stats.rate +=
 5789|   730k|        intra_rd_stats_uv.rate +
 5790|   730k|        intra_mode_info_cost_uv(cpi, x, mbmi, bsize, uv_mode_cost);
 5791|   730k|  }
 5792|       |
 5793|       |  // Intra block is always coded as non-skip
 5794|  1.58M|  intra_rd_stats.skip_txfm = 0;
 5795|  1.58M|  intra_rd_stats.dist = best_intra_rd_stats_y.dist + intra_rd_stats_uv.dist;
 5796|       |  // Add in the cost of the no skip flag.
 5797|  1.58M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 5798|  1.58M|  intra_rd_stats.rate += mode_costs->skip_txfm_cost[skip_ctx][0];
 5799|       |  // Calculate the final RD estimate for this mode.
 5800|  1.58M|  const int64_t this_rd =
 5801|  1.58M|      RDCOST(x->rdmult, intra_rd_stats.rate, intra_rd_stats.dist);
  ------------------
  |  |   33|  1.58M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.58M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.58M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.58M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 5802|       |  // Keep record of best intra rd
 5803|  1.58M|  if (this_rd < search_state->best_intra_rd) {
  ------------------
  |  Branch (5803:7): [True: 1.58M, False: 159]
  ------------------
 5804|  1.58M|    search_state->best_intra_rd = this_rd;
 5805|  1.58M|    intra_search_state->best_intra_mode = mode;
 5806|  1.58M|  }
 5807|       |
 5808|  6.32M|  for (int i = 0; i < REFERENCE_MODES; ++i) {
  ------------------
  |  Branch (5808:19): [True: 4.74M, False: 1.58M]
  ------------------
 5809|  4.74M|    search_state->best_pred_rd[i] =
 5810|  4.74M|        AOMMIN(search_state->best_pred_rd[i], this_rd);
  ------------------
  |  |   34|  4.74M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 84.6k, False: 4.65M]
  |  |  ------------------
  ------------------
 5811|  4.74M|  }
 5812|       |
 5813|  1.58M|  intra_rd_stats.rdcost = this_rd;
 5814|       |
 5815|  1.58M|  adjust_rdcost(cpi, x, &intra_rd_stats, /*is_inter_pred=*/false);
 5816|       |
 5817|       |  // Collect mode stats for multiwinner mode processing
 5818|  1.58M|  const int txfm_search_done = 1;
 5819|  1.58M|  store_winner_mode_stats(
 5820|  1.58M|      cpi, x, mbmi, &intra_rd_stats, &best_intra_rd_stats_y, &intra_rd_stats_uv,
 5821|  1.58M|      best_mode_enum, NULL, bsize, intra_rd_stats.rdcost,
 5822|  1.58M|      cpi->sf.winner_mode_sf.multi_winner_mode_type, txfm_search_done);
 5823|  1.58M|  if (intra_rd_stats.rdcost < search_state->best_rd) {
  ------------------
  |  Branch (5823:7): [True: 1.50M, False: 73.7k]
  ------------------
 5824|  1.50M|    update_search_state(cpi, search_state, rd_cost, ctx, &intra_rd_stats,
 5825|  1.50M|                        &best_intra_rd_stats_y, &intra_rd_stats_uv,
 5826|  1.50M|                        best_mode_enum, x, txfm_search_done);
 5827|  1.50M|  }
 5828|  1.58M|}
rdopt.c:refine_winner_mode_tx:
 3750|  1.91M|    int best_rate_y, int best_rate_uv, int *best_skip2, int winner_mode_count) {
 3751|  1.91M|  const AV1_COMMON *const cm = &cpi->common;
 3752|  1.91M|  MACROBLOCKD *const xd = &x->e_mbd;
 3753|  1.91M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3754|  1.91M|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
 3755|  1.91M|  int64_t best_rd;
 3756|  1.91M|  const int num_planes = av1_num_planes(cm);
 3757|       |
 3758|  1.91M|  if (!is_winner_mode_processing_enabled(cpi, x, best_mbmode,
  ------------------
  |  Branch (3758:7): [True: 93.9k, False: 1.82M]
  ------------------
 3759|  1.91M|                                         rd_cost->skip_txfm))
 3760|  93.9k|    return;
 3761|       |
 3762|       |  // Set params for winner mode evaluation
 3763|  1.82M|  set_mode_eval_params(cpi, x, WINNER_MODE_EVAL);
 3764|       |
 3765|       |  // No best mode identified so far
 3766|  1.82M|  if (*best_mode_index == THR_INVALID) return;
  ------------------
  |  Branch (3766:7): [True: 149k, False: 1.67M]
  ------------------
 3767|       |
 3768|  1.67M|  best_rd = RDCOST(x->rdmult, rd_cost->rate, rd_cost->dist);
  ------------------
  |  |   33|  1.67M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.67M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.67M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.67M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3769|  3.34M|  for (int mode_idx = 0; mode_idx < winner_mode_count; mode_idx++) {
  ------------------
  |  Branch (3769:26): [True: 1.67M, False: 1.67M]
  ------------------
 3770|  1.67M|    RD_STATS *winner_rd_stats = NULL;
 3771|  1.67M|    int winner_rate_y = 0, winner_rate_uv = 0;
 3772|  1.67M|    THR_MODES winner_mode_index = 0;
 3773|       |
 3774|       |    // TODO(any): Combine best mode and multi-winner mode processing paths
 3775|       |    // Get winner mode stats for current mode index
 3776|  1.67M|    MB_MODE_INFO *winner_mbmi = get_winner_mode_stats(
 3777|  1.67M|        x, best_mbmode, rd_cost, best_rate_y, best_rate_uv, best_mode_index,
 3778|  1.67M|        &winner_rd_stats, &winner_rate_y, &winner_rate_uv, &winner_mode_index,
 3779|  1.67M|        cpi->sf.winner_mode_sf.multi_winner_mode_type, mode_idx);
 3780|       |
 3781|  1.67M|    if (xd->lossless[winner_mbmi->segment_id] == 0 &&
  ------------------
  |  Branch (3781:9): [True: 1.63M, False: 39.2k]
  ------------------
 3782|  1.63M|        winner_mode_index != THR_INVALID &&
  ------------------
  |  Branch (3782:9): [True: 1.63M, False: 18.4E]
  ------------------
 3783|  1.63M|        is_winner_mode_processing_enabled(cpi, x, winner_mbmi,
  ------------------
  |  Branch (3783:9): [True: 1.63M, False: 18.4E]
  ------------------
 3784|  1.63M|                                          rd_cost->skip_txfm)) {
 3785|  1.63M|      RD_STATS rd_stats = *winner_rd_stats;
 3786|  1.63M|      int skip_blk = 0;
 3787|  1.63M|      RD_STATS rd_stats_y, rd_stats_uv;
 3788|  1.63M|      const int skip_ctx = av1_get_skip_txfm_context(xd);
 3789|       |
 3790|  1.63M|      *mbmi = *winner_mbmi;
 3791|       |
 3792|  1.63M|      set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 3793|       |
 3794|       |      // Select prediction reference frames.
 3795|  4.86M|      for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (3795:23): [True: 3.22M, False: 1.63M]
  ------------------
 3796|  3.22M|        xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
 3797|  3.22M|        if (has_second_ref(mbmi))
  ------------------
  |  Branch (3797:13): [True: 0, False: 3.22M]
  ------------------
 3798|      0|          xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
 3799|  3.22M|      }
 3800|       |
 3801|  1.63M|      if (is_inter_mode(mbmi->mode)) {
  ------------------
  |  Branch (3801:11): [True: 147k, False: 1.48M]
  ------------------
 3802|   147k|        const int mi_row = xd->mi_row;
 3803|   147k|        const int mi_col = xd->mi_col;
 3804|   147k|        bool is_predictor_built = false;
 3805|   147k|        const PREDICTION_MODE prediction_mode = mbmi->mode;
 3806|       |        // Do interpolation filter search for realtime mode if applicable.
 3807|   147k|        if (cpi->sf.winner_mode_sf.winner_mode_ifs &&
  ------------------
  |  Branch (3807:13): [True: 0, False: 147k]
  ------------------
 3808|      0|            cpi->oxcf.mode == REALTIME &&
  ------------------
  |  Branch (3808:13): [True: 0, False: 0]
  ------------------
 3809|      0|            cm->current_frame.reference_mode == SINGLE_REFERENCE &&
  ------------------
  |  Branch (3809:13): [True: 0, False: 0]
  ------------------
 3810|      0|            is_inter_mode(prediction_mode) &&
  ------------------
  |  Branch (3810:13): [True: 0, False: 0]
  ------------------
 3811|      0|            mbmi->motion_mode == SIMPLE_TRANSLATION &&
  ------------------
  |  Branch (3811:13): [True: 0, False: 0]
  ------------------
 3812|      0|            !is_inter_compound_mode(prediction_mode)) {
  ------------------
  |  Branch (3812:13): [True: 0, False: 0]
  ------------------
 3813|      0|          is_predictor_built =
 3814|      0|              fast_interp_search(cpi, x, mi_row, mi_col, bsize);
 3815|      0|        }
 3816|   147k|        if (!is_predictor_built) {
  ------------------
  |  Branch (3816:13): [True: 147k, False: 5]
  ------------------
 3817|   147k|          av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL, bsize, 0,
 3818|   147k|                                        av1_num_planes(cm) - 1);
 3819|   147k|        }
 3820|   147k|        if (mbmi->motion_mode == OBMC_CAUSAL)
  ------------------
  |  Branch (3820:13): [True: 0, False: 147k]
  ------------------
 3821|      0|          av1_build_obmc_inter_predictors_sb(cm, xd);
 3822|       |
 3823|   147k|        av1_subtract_plane(x, bsize, PLANE_TYPE_Y, cpi->do_border_pad);
 3824|   147k|        if (txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (3824:13): [True: 147k, False: 2]
  ------------------
 3825|   147k|            !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (3825:13): [True: 147k, False: 2]
  ------------------
 3826|   147k|          av1_pick_recursive_tx_size_type_yrd(cpi, x, &rd_stats_y, bsize,
 3827|   147k|                                              INT64_MAX);
 3828|   147k|          assert(rd_stats_y.rate != INT_MAX);
 3829|   147k|        } else {
 3830|      4|          av1_pick_uniform_tx_size_type_yrd(cpi, x, &rd_stats_y, bsize,
 3831|      4|                                            INT64_MAX);
 3832|      4|          memset(mbmi->inter_tx_size, mbmi->tx_size,
 3833|      4|                 sizeof(mbmi->inter_tx_size));
 3834|      4|        }
 3835|  1.48M|      } else {
 3836|  1.48M|        av1_pick_uniform_tx_size_type_yrd(cpi, x, &rd_stats_y, bsize,
 3837|  1.48M|                                          INT64_MAX);
 3838|  1.48M|      }
 3839|       |
 3840|  1.63M|      if (num_planes > 1) {
  ------------------
  |  Branch (3840:11): [True: 797k, False: 838k]
  ------------------
 3841|   797k|        av1_txfm_uvrd(cpi, x, &rd_stats_uv, bsize, INT64_MAX);
 3842|   838k|      } else {
 3843|   838k|        av1_init_rd_stats(&rd_stats_uv);
 3844|   838k|      }
 3845|       |
 3846|  1.63M|      const int comp_pred = mbmi->ref_frame[1] > INTRA_FRAME;
 3847|       |
 3848|  1.63M|      const ModeCosts *mode_costs = &x->mode_costs;
 3849|  1.63M|      int64_t this_dist = rd_stats_y.dist + rd_stats_uv.dist;
 3850|  1.63M|      int64_t this_sse = rd_stats_y.sse + rd_stats_uv.sse;
 3851|  1.63M|      if (cpi->sf.hl_sf.weighted_chroma_distortion) {
  ------------------
  |  Branch (3851:11): [True: 0, False: 1.63M]
  ------------------
 3852|      0|        this_dist = rd_stats_y.dist + rd_stats_uv.dist * 15 / 16;
 3853|      0|        this_sse = rd_stats_y.sse + rd_stats_uv.sse * 15 / 16;
 3854|      0|      }
 3855|       |
 3856|  1.63M|      if (is_inter_mode(mbmi->mode) &&
  ------------------
  |  Branch (3856:11): [True: 147k, False: 1.48M]
  ------------------
 3857|   147k|          (!cpi->oxcf.algo_cfg.sharpness || !comp_pred) &&
  ------------------
  |  Branch (3857:12): [True: 85.5k, False: 62.1k]
  |  Branch (3857:45): [True: 62.1k, False: 0]
  ------------------
 3858|   147k|          RDCOST(x->rdmult,
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (3858:11): [True: 788, False: 146k]
  ------------------
 3859|   147k|                 mode_costs->skip_txfm_cost[skip_ctx][0] + rd_stats_y.rate +
 3860|   147k|                     rd_stats_uv.rate,
 3861|   147k|                 this_dist) > RDCOST(x->rdmult,
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3862|  1.63M|                                     mode_costs->skip_txfm_cost[skip_ctx][1],
 3863|  1.63M|                                     this_sse)) {
 3864|    788|        skip_blk = 1;
 3865|    788|        rd_stats_y.rate = mode_costs->skip_txfm_cost[skip_ctx][1];
 3866|    788|        rd_stats_uv.rate = 0;
 3867|    788|        rd_stats_y.dist = rd_stats_y.sse;
 3868|    788|        rd_stats_uv.dist = rd_stats_uv.sse;
 3869|    788|        this_dist = this_sse;
 3870|  1.63M|      } else {
 3871|  1.63M|        skip_blk = 0;
 3872|  1.63M|        rd_stats_y.rate += mode_costs->skip_txfm_cost[skip_ctx][0];
 3873|  1.63M|      }
 3874|  1.63M|      increase_motion_mode_rdstats(cpi, mbmi, &rd_stats, &rd_stats_y,
 3875|  1.63M|                                   &rd_stats_uv);
 3876|  1.63M|      int this_rate = rd_stats.rate + rd_stats_y.rate + rd_stats_uv.rate -
 3877|  1.63M|                      winner_rate_y - winner_rate_uv;
 3878|  1.63M|      int64_t this_rd = RDCOST(x->rdmult, this_rate, this_dist);
  ------------------
  |  |   33|  1.63M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.63M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.63M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.63M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3879|  1.63M|      if (best_rd > this_rd) {
  ------------------
  |  Branch (3879:11): [True: 895k, False: 739k]
  ------------------
 3880|   895k|        *best_mbmode = *mbmi;
 3881|   895k|        *best_mode_index = winner_mode_index;
 3882|       |        av1_copy_array(ctx->tx_type_map, xd->tx_type_map, ctx->num_4x4_blk);
  ------------------
  |  |   38|   895k|  do {                                                    \
  |  |   39|   895k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   895k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   895k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 895k]
  |  |  ------------------
  ------------------
 3883|   895k|        rd_cost->rate = this_rate;
 3884|   895k|        rd_cost->dist = this_dist;
 3885|   895k|        rd_cost->sse = this_sse;
 3886|   895k|        rd_cost->rdcost = this_rd;
 3887|   895k|        best_rd = this_rd;
 3888|   895k|        *best_skip2 = skip_blk;
 3889|   895k|      }
 3890|  1.63M|    }
 3891|  1.67M|  }
 3892|  1.67M|}
rdopt.c:get_winner_mode_stats:
 3720|  1.67M|    int mode_idx) {
 3721|  1.67M|  MB_MODE_INFO *winner_mbmi;
 3722|  1.67M|  if (multi_winner_mode_type) {
  ------------------
  |  Branch (3722:7): [True: 0, False: 1.67M]
  ------------------
 3723|      0|    assert(mode_idx >= 0 && mode_idx < x->winner_mode_count);
 3724|      0|    WinnerModeStats *winner_mode_stat = &x->winner_mode_stats[mode_idx];
 3725|      0|    winner_mbmi = &winner_mode_stat->mbmi;
 3726|       |
 3727|      0|    *winner_rd_cost = &winner_mode_stat->rd_cost;
 3728|      0|    *winner_rate_y = winner_mode_stat->rate_y;
 3729|      0|    *winner_rate_uv = winner_mode_stat->rate_uv;
 3730|      0|    *winner_mode_index = winner_mode_stat->mode_index;
 3731|  1.67M|  } else {
 3732|  1.67M|    winner_mbmi = best_mbmode;
 3733|  1.67M|    *winner_rd_cost = best_rd_cost;
 3734|  1.67M|    *winner_rate_y = best_rate_y;
 3735|  1.67M|    *winner_rate_uv = best_rate_uv;
 3736|  1.67M|    *winner_mode_index = *best_mode_index;
 3737|  1.67M|  }
 3738|  1.67M|  return winner_mbmi;
 3739|  1.67M|}
rdopt.c:store_coding_context:
 1032|  1.76M|    int skippable) {
 1033|  1.76M|  MACROBLOCKD *const xd = &x->e_mbd;
 1034|       |
 1035|       |  // Take a snapshot of the coding context so it can be
 1036|       |  // restored if we decide to encode this way
 1037|  1.76M|  ctx->rd_stats.skip_txfm = x->txfm_search_info.skip_txfm;
 1038|  1.76M|  ctx->skippable = skippable;
 1039|       |#if CONFIG_INTERNAL_STATS
 1040|       |  ctx->best_mode_index = mode_index;
 1041|       |#endif  // CONFIG_INTERNAL_STATS
 1042|  1.76M|  ctx->mic = *xd->mi[0];
 1043|  1.76M|  av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, &x->mbmi_ext,
 1044|  1.76M|                                      av1_ref_frame_type(xd->mi[0]->ref_frame));
 1045|  1.76M|}
rdopt.c:estimate_ref_frame_costs:
  867|  1.91M|    unsigned int (*ref_costs_comp)[REF_FRAMES]) {
  868|  1.91M|  int seg_ref_active =
  869|  1.91M|      segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
  870|  1.91M|  if (seg_ref_active) {
  ------------------
  |  Branch (870:7): [True: 0, False: 1.91M]
  ------------------
  871|      0|    memset(ref_costs_single, 0, REF_FRAMES * sizeof(*ref_costs_single));
  872|      0|    int ref_frame;
  873|      0|    for (ref_frame = 0; ref_frame < REF_FRAMES; ++ref_frame)
  ------------------
  |  Branch (873:25): [True: 0, False: 0]
  ------------------
  874|      0|      memset(ref_costs_comp[ref_frame], 0,
  875|      0|             REF_FRAMES * sizeof((*ref_costs_comp)[0]));
  876|  1.91M|  } else {
  877|  1.91M|    int intra_inter_ctx = av1_get_intra_inter_context(xd);
  878|  1.91M|    ref_costs_single[INTRA_FRAME] =
  879|  1.91M|        mode_costs->intra_inter_cost[intra_inter_ctx][0];
  880|  1.91M|    unsigned int base_cost = mode_costs->intra_inter_cost[intra_inter_ctx][1];
  881|       |
  882|  15.3M|    for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
  ------------------
  |  Branch (882:30): [True: 13.4M, False: 1.91M]
  ------------------
  883|  13.4M|      ref_costs_single[i] = base_cost;
  884|       |
  885|  1.91M|    const int ctx_p1 = av1_get_pred_context_single_ref_p1(xd);
  886|  1.91M|    const int ctx_p2 = av1_get_pred_context_single_ref_p2(xd);
  887|  1.91M|    const int ctx_p3 = av1_get_pred_context_single_ref_p3(xd);
  888|  1.91M|    const int ctx_p4 = av1_get_pred_context_single_ref_p4(xd);
  889|  1.91M|    const int ctx_p5 = av1_get_pred_context_single_ref_p5(xd);
  890|  1.91M|    const int ctx_p6 = av1_get_pred_context_single_ref_p6(xd);
  891|       |
  892|       |    // Determine cost of a single ref frame, where frame types are represented
  893|       |    // by a tree:
  894|       |    // Level 0: add cost whether this ref is a forward or backward ref
  895|  1.91M|    ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
  896|  1.91M|    ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
  897|  1.91M|    ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
  898|  1.91M|    ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
  899|  1.91M|    ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][1];
  900|  1.91M|    ref_costs_single[ALTREF2_FRAME] +=
  901|  1.91M|        mode_costs->single_ref_cost[ctx_p1][0][1];
  902|  1.91M|    ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][1];
  903|       |
  904|       |    // Level 1: if this ref is forward ref,
  905|       |    // add cost whether it is last/last2 or last3/golden
  906|  1.91M|    ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][0];
  907|  1.91M|    ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][0];
  908|  1.91M|    ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][1];
  909|  1.91M|    ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][1];
  910|       |
  911|       |    // Level 1: if this ref is backward ref
  912|       |    // then add cost whether this ref is altref or backward ref
  913|  1.91M|    ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p2][1][0];
  914|  1.91M|    ref_costs_single[ALTREF2_FRAME] +=
  915|  1.91M|        mode_costs->single_ref_cost[ctx_p2][1][0];
  916|  1.91M|    ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[ctx_p2][1][1];
  917|       |
  918|       |    // Level 2: further add cost whether this ref is last or last2
  919|  1.91M|    ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p4][3][0];
  920|  1.91M|    ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p4][3][1];
  921|       |
  922|       |    // Level 2: last3 or golden
  923|  1.91M|    ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p5][4][0];
  924|  1.91M|    ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p5][4][1];
  925|       |
  926|       |    // Level 2: bwdref or altref2
  927|  1.91M|    ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p6][5][0];
  928|  1.91M|    ref_costs_single[ALTREF2_FRAME] +=
  929|  1.91M|        mode_costs->single_ref_cost[ctx_p6][5][1];
  930|       |
  931|  1.91M|    if (cm->current_frame.reference_mode != SINGLE_REFERENCE) {
  ------------------
  |  Branch (931:9): [True: 1.91M, False: 18.4E]
  ------------------
  932|       |      // Similar to single ref, determine cost of compound ref frames.
  933|       |      // cost_compound_refs = cost_first_ref + cost_second_ref
  934|  1.91M|      const int bwdref_comp_ctx_p = av1_get_pred_context_comp_bwdref_p(xd);
  935|  1.91M|      const int bwdref_comp_ctx_p1 = av1_get_pred_context_comp_bwdref_p1(xd);
  936|  1.91M|      const int ref_comp_ctx_p = av1_get_pred_context_comp_ref_p(xd);
  937|  1.91M|      const int ref_comp_ctx_p1 = av1_get_pred_context_comp_ref_p1(xd);
  938|  1.91M|      const int ref_comp_ctx_p2 = av1_get_pred_context_comp_ref_p2(xd);
  939|       |
  940|  1.91M|      const int comp_ref_type_ctx = av1_get_comp_reference_type_context(xd);
  941|  1.91M|      unsigned int ref_bicomp_costs[REF_FRAMES] = { 0 };
  942|       |
  943|  1.91M|      ref_bicomp_costs[LAST_FRAME] = ref_bicomp_costs[LAST2_FRAME] =
  944|  1.91M|          ref_bicomp_costs[LAST3_FRAME] = ref_bicomp_costs[GOLDEN_FRAME] =
  945|  1.91M|              base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][1];
  946|  1.91M|      ref_bicomp_costs[BWDREF_FRAME] = ref_bicomp_costs[ALTREF2_FRAME] = 0;
  947|  1.91M|      ref_bicomp_costs[ALTREF_FRAME] = 0;
  948|       |
  949|       |      // cost of first ref frame
  950|  1.91M|      ref_bicomp_costs[LAST_FRAME] +=
  951|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p][0][0];
  952|  1.91M|      ref_bicomp_costs[LAST2_FRAME] +=
  953|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p][0][0];
  954|  1.91M|      ref_bicomp_costs[LAST3_FRAME] +=
  955|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p][0][1];
  956|  1.91M|      ref_bicomp_costs[GOLDEN_FRAME] +=
  957|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p][0][1];
  958|       |
  959|  1.91M|      ref_bicomp_costs[LAST_FRAME] +=
  960|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p1][1][0];
  961|  1.91M|      ref_bicomp_costs[LAST2_FRAME] +=
  962|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p1][1][1];
  963|       |
  964|  1.91M|      ref_bicomp_costs[LAST3_FRAME] +=
  965|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p2][2][0];
  966|  1.91M|      ref_bicomp_costs[GOLDEN_FRAME] +=
  967|  1.91M|          mode_costs->comp_ref_cost[ref_comp_ctx_p2][2][1];
  968|       |
  969|       |      // cost of second ref frame
  970|  1.91M|      ref_bicomp_costs[BWDREF_FRAME] +=
  971|  1.91M|          mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
  972|  1.91M|      ref_bicomp_costs[ALTREF2_FRAME] +=
  973|  1.91M|          mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
  974|  1.91M|      ref_bicomp_costs[ALTREF_FRAME] +=
  975|  1.91M|          mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][1];
  976|       |
  977|  1.91M|      ref_bicomp_costs[BWDREF_FRAME] +=
  978|  1.91M|          mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p1][1][0];
  979|  1.91M|      ref_bicomp_costs[ALTREF2_FRAME] +=
  980|  1.91M|          mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p1][1][1];
  981|       |
  982|       |      // cost: if one ref frame is forward ref, the other ref is backward ref
  983|  1.91M|      int ref0, ref1;
  984|  9.59M|      for (ref0 = LAST_FRAME; ref0 <= GOLDEN_FRAME; ++ref0) {
  ------------------
  |  Branch (984:31): [True: 7.67M, False: 1.91M]
  ------------------
  985|  30.6M|        for (ref1 = BWDREF_FRAME; ref1 <= ALTREF_FRAME; ++ref1) {
  ------------------
  |  Branch (985:35): [True: 23.0M, False: 7.67M]
  ------------------
  986|  23.0M|          ref_costs_comp[ref0][ref1] =
  987|  23.0M|              ref_bicomp_costs[ref0] + ref_bicomp_costs[ref1];
  988|  23.0M|        }
  989|  7.67M|      }
  990|       |
  991|       |      // cost: if both ref frames are the same side.
  992|  1.91M|      const int uni_comp_ref_ctx_p = av1_get_pred_context_uni_comp_ref_p(xd);
  993|  1.91M|      const int uni_comp_ref_ctx_p1 = av1_get_pred_context_uni_comp_ref_p1(xd);
  994|  1.91M|      const int uni_comp_ref_ctx_p2 = av1_get_pred_context_uni_comp_ref_p2(xd);
  995|  1.91M|      ref_costs_comp[LAST_FRAME][LAST2_FRAME] =
  996|  1.91M|          base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
  997|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
  998|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][0];
  999|  1.91M|      ref_costs_comp[LAST_FRAME][LAST3_FRAME] =
 1000|  1.91M|          base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
 1001|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
 1002|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][1] +
 1003|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p2][2][0];
 1004|  1.91M|      ref_costs_comp[LAST_FRAME][GOLDEN_FRAME] =
 1005|  1.91M|          base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
 1006|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
 1007|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][1] +
 1008|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p2][2][1];
 1009|  1.91M|      ref_costs_comp[BWDREF_FRAME][ALTREF_FRAME] =
 1010|  1.91M|          base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
 1011|  1.91M|          mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][1];
 1012|  18.4E|    } else {
 1013|  18.4E|      int ref0, ref1;
 1014|  18.4E|      for (ref0 = LAST_FRAME; ref0 <= GOLDEN_FRAME; ++ref0) {
  ------------------
  |  Branch (1014:31): [True: 0, False: 18.4E]
  ------------------
 1015|      0|        for (ref1 = BWDREF_FRAME; ref1 <= ALTREF_FRAME; ++ref1)
  ------------------
  |  Branch (1015:35): [True: 0, False: 0]
  ------------------
 1016|      0|          ref_costs_comp[ref0][ref1] = 512;
 1017|      0|      }
 1018|  18.4E|      ref_costs_comp[LAST_FRAME][LAST2_FRAME] = 512;
 1019|  18.4E|      ref_costs_comp[LAST_FRAME][LAST3_FRAME] = 512;
 1020|  18.4E|      ref_costs_comp[LAST_FRAME][GOLDEN_FRAME] = 512;
 1021|  18.4E|      ref_costs_comp[BWDREF_FRAME][ALTREF_FRAME] = 512;
 1022|  18.4E|    }
 1023|  1.91M|  }
 1024|  1.91M|}

encodeframe.c:av1_encoder_get_relative_dist:
  173|   484k|static inline int av1_encoder_get_relative_dist(int a, int b) {
  174|       |  assert(a >= 0 && b >= 0);
  175|   484k|  return (a - b);
  176|   484k|}
encoder.c:coded_to_superres_mi:
  169|   219k|static inline int coded_to_superres_mi(int mi_col, int denom) {
  170|   219k|  return (mi_col * denom + SCALE_NUMERATOR / 2) / SCALE_NUMERATOR;
  ------------------
  |  |   22|   219k|#define SCALE_NUMERATOR 8
  ------------------
                return (mi_col * denom + SCALE_NUMERATOR / 2) / SCALE_NUMERATOR;
  ------------------
  |  |   22|   219k|#define SCALE_NUMERATOR 8
  ------------------
  171|   219k|}
global_motion_facade.c:prune_ref_by_selective_ref_frame:
  239|   258k|    const unsigned int *const ref_display_order_hint) {
  240|   258k|  const SPEED_FEATURES *const sf = &cpi->sf;
  241|   258k|  if (!sf->inter_sf.selective_ref_frame) return 0;
  ------------------
  |  Branch (241:7): [True: 0, False: 258k]
  ------------------
  242|       |
  243|   258k|  const int comp_pred = ref_frame[1] > INTRA_FRAME;
  244|       |
  245|   258k|  if (sf->inter_sf.selective_ref_frame >= 2 ||
  ------------------
  |  Branch (245:7): [True: 258k, False: 0]
  ------------------
  246|   258k|      (sf->inter_sf.selective_ref_frame == 1 && comp_pred)) {
  ------------------
  |  Branch (246:8): [True: 0, False: 0]
  |  Branch (246:49): [True: 0, False: 0]
  ------------------
  247|   258k|    int ref_frame_list[2] = { LAST3_FRAME, LAST2_FRAME };
  248|       |
  249|   258k|    if (x != NULL) {
  ------------------
  |  Branch (249:9): [True: 0, False: 258k]
  ------------------
  250|       |      // Disable pruning if either tpl suggests that we keep the frame or
  251|       |      // the pred_mv gives us the best sad
  252|      0|      if (x->tpl_keep_ref_frame[LAST3_FRAME] ||
  ------------------
  |  Branch (252:11): [True: 0, False: 0]
  ------------------
  253|      0|          x->pred_mv_sad[LAST3_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (253:11): [True: 0, False: 0]
  ------------------
  254|      0|        ref_frame_list[0] = NONE_FRAME;
  255|      0|      }
  256|      0|      if (x->tpl_keep_ref_frame[LAST2_FRAME] ||
  ------------------
  |  Branch (256:11): [True: 0, False: 0]
  ------------------
  257|      0|          x->pred_mv_sad[LAST2_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (257:11): [True: 0, False: 0]
  ------------------
  258|      0|        ref_frame_list[1] = NONE_FRAME;
  259|      0|      }
  260|      0|    }
  261|       |
  262|   258k|    if (prune_ref(ref_frame, ref_display_order_hint,
  ------------------
  |  Branch (262:9): [True: 0, False: 258k]
  ------------------
  263|   258k|                  ref_display_order_hint[GOLDEN_FRAME - LAST_FRAME],
  264|   258k|                  ref_frame_list))
  265|      0|      return 1;
  266|   258k|  }
  267|       |
  268|   258k|  if (sf->inter_sf.selective_ref_frame >= 3) {
  ------------------
  |  Branch (268:7): [True: 258k, False: 0]
  ------------------
  269|   258k|    int ref_frame_list[2] = { ALTREF2_FRAME, BWDREF_FRAME };
  270|       |
  271|   258k|    if (x != NULL) {
  ------------------
  |  Branch (271:9): [True: 0, False: 258k]
  ------------------
  272|       |      // Disable pruning if either tpl suggests that we keep the frame or
  273|       |      // the pred_mv gives us the best sad
  274|      0|      if (x->tpl_keep_ref_frame[ALTREF2_FRAME] ||
  ------------------
  |  Branch (274:11): [True: 0, False: 0]
  ------------------
  275|      0|          x->pred_mv_sad[ALTREF2_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (275:11): [True: 0, False: 0]
  ------------------
  276|      0|        ref_frame_list[0] = NONE_FRAME;
  277|      0|      }
  278|      0|      if (x->tpl_keep_ref_frame[BWDREF_FRAME] ||
  ------------------
  |  Branch (278:11): [True: 0, False: 0]
  ------------------
  279|      0|          x->pred_mv_sad[BWDREF_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (279:11): [True: 0, False: 0]
  ------------------
  280|      0|        ref_frame_list[1] = NONE_FRAME;
  281|      0|      }
  282|      0|    }
  283|       |
  284|   258k|    if (prune_ref(ref_frame, ref_display_order_hint,
  ------------------
  |  Branch (284:9): [True: 0, False: 258k]
  ------------------
  285|   258k|                  ref_display_order_hint[LAST_FRAME - LAST_FRAME],
  286|   258k|                  ref_frame_list))
  287|      0|      return 1;
  288|   258k|  }
  289|       |
  290|   258k|  if (x != NULL && sf->inter_sf.prune_comp_ref_frames && comp_pred) {
  ------------------
  |  Branch (290:7): [True: 0, False: 258k]
  |  Branch (290:20): [True: 0, False: 0]
  |  Branch (290:58): [True: 0, False: 0]
  ------------------
  291|      0|    int closest_ref_frames = has_closest_ref_frames(
  292|      0|        ref_frame, cpi->ref_frame_dist_info.nearest_past_ref,
  293|      0|        cpi->ref_frame_dist_info.nearest_future_ref);
  294|      0|    const int ref_idx0 = ref_frame[0] - LAST_FRAME;
  295|      0|    const int ref_idx1 = ref_frame[1] - LAST_FRAME;
  296|      0|    const int keep_comp_ref_pair_mask =
  297|      0|        (cpi->keep_comp_ref_frame_mask & (1 << ref_idx0)) &&
  ------------------
  |  Branch (297:9): [True: 0, False: 0]
  ------------------
  298|      0|        (cpi->keep_comp_ref_frame_mask & (1 << ref_idx1));
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|       |
  300|       |    // Don't prune references frame pairs which are important or closest.
  301|      0|    if (!(keep_comp_ref_pair_mask || closest_ref_frames)) {
  ------------------
  |  Branch (301:11): [True: 0, False: 0]
  |  Branch (301:38): [True: 0, False: 0]
  ------------------
  302|       |      // Prune reference frames which are not the closest to the current frame.
  303|      0|      if (sf->inter_sf.prune_comp_ref_frames >= 3) {
  ------------------
  |  Branch (303:11): [True: 0, False: 0]
  ------------------
  304|      0|        return 1;
  305|      0|      } else if (sf->inter_sf.prune_comp_ref_frames >= 1) {
  ------------------
  |  Branch (305:18): [True: 0, False: 0]
  ------------------
  306|       |        // Prune reference frames with non minimum pred_mv_sad.
  307|      0|        if (has_best_pred_mv_sad(ref_frame, x) == 0) return 1;
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  ------------------
  308|      0|      }
  309|      0|    }
  310|      0|  }
  311|       |
  312|   258k|  return 0;
  313|   258k|}
global_motion_facade.c:prune_ref:
  196|   516k|                            const int *ref_frame_list) {
  197|  1.55M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (197:19): [True: 1.03M, False: 516k]
  ------------------
  198|  1.03M|    if (ref_frame_list[i] == NONE_FRAME) continue;
  ------------------
  |  Branch (198:9): [True: 0, False: 1.03M]
  ------------------
  199|       |
  200|  1.03M|    if (ref_frame[0] == ref_frame_list[i] ||
  ------------------
  |  Branch (200:9): [True: 147k, False: 885k]
  ------------------
  201|   885k|        ref_frame[1] == ref_frame_list[i]) {
  ------------------
  |  Branch (201:9): [True: 0, False: 885k]
  ------------------
  202|   147k|      if (av1_encoder_get_relative_dist(
  ------------------
  |  Branch (202:11): [True: 0, False: 147k]
  ------------------
  203|   147k|              ref_display_order_hint[ref_frame_list[i] - LAST_FRAME],
  204|   147k|              frame_display_order_hint) < 0)
  205|      0|        return 1;
  206|   147k|    }
  207|  1.03M|  }
  208|   516k|  return 0;
  209|   516k|}
global_motion_facade.c:av1_encoder_get_relative_dist:
  173|   173k|static inline int av1_encoder_get_relative_dist(int a, int b) {
  174|       |  assert(a >= 0 && b >= 0);
  175|   173k|  return (a - b);
  176|   173k|}
partition_search.c:av1_copy_mbmi_ext_to_mbmi_ext_frame:
  319|  6.29M|    const MB_MODE_INFO_EXT *const mbmi_ext, uint8_t ref_frame_type) {
  320|  6.29M|  memcpy(mbmi_ext_best->ref_mv_stack, mbmi_ext->ref_mv_stack[ref_frame_type],
  321|  6.29M|         sizeof(mbmi_ext->ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  6.29M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  322|  6.29M|  memcpy(mbmi_ext_best->weight, mbmi_ext->weight[ref_frame_type],
  323|  6.29M|         sizeof(mbmi_ext->weight[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  6.29M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  324|  6.29M|  mbmi_ext_best->mode_context = mbmi_ext->mode_context[ref_frame_type];
  325|  6.29M|  mbmi_ext_best->ref_mv_count = mbmi_ext->ref_mv_count[ref_frame_type];
  326|  6.29M|  memcpy(mbmi_ext_best->global_mvs, mbmi_ext->global_mvs,
  327|  6.29M|         sizeof(mbmi_ext->global_mvs));
  328|  6.29M|}
rdopt.c:av1_copy_mbmi_ext_to_mbmi_ext_frame:
  319|  2.14M|    const MB_MODE_INFO_EXT *const mbmi_ext, uint8_t ref_frame_type) {
  320|  2.14M|  memcpy(mbmi_ext_best->ref_mv_stack, mbmi_ext->ref_mv_stack[ref_frame_type],
  321|  2.14M|         sizeof(mbmi_ext->ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  2.14M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  322|  2.14M|  memcpy(mbmi_ext_best->weight, mbmi_ext->weight[ref_frame_type],
  323|  2.14M|         sizeof(mbmi_ext->weight[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|  2.14M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  324|  2.14M|  mbmi_ext_best->mode_context = mbmi_ext->mode_context[ref_frame_type];
  325|  2.14M|  mbmi_ext_best->ref_mv_count = mbmi_ext->ref_mv_count[ref_frame_type];
  326|  2.14M|  memcpy(mbmi_ext_best->global_mvs, mbmi_ext->global_mvs,
  327|  2.14M|         sizeof(mbmi_ext->global_mvs));
  328|  2.14M|}
rdopt.c:prune_ref_by_selective_ref_frame:
  239|  21.0M|    const unsigned int *const ref_display_order_hint) {
  240|  21.0M|  const SPEED_FEATURES *const sf = &cpi->sf;
  241|  21.0M|  if (!sf->inter_sf.selective_ref_frame) return 0;
  ------------------
  |  Branch (241:7): [True: 0, False: 21.0M]
  ------------------
  242|       |
  243|  21.0M|  const int comp_pred = ref_frame[1] > INTRA_FRAME;
  244|       |
  245|  21.0M|  if (sf->inter_sf.selective_ref_frame >= 2 ||
  ------------------
  |  Branch (245:7): [True: 21.0M, False: 0]
  ------------------
  246|  21.0M|      (sf->inter_sf.selective_ref_frame == 1 && comp_pred)) {
  ------------------
  |  Branch (246:8): [True: 0, False: 0]
  |  Branch (246:49): [True: 0, False: 0]
  ------------------
  247|  21.0M|    int ref_frame_list[2] = { LAST3_FRAME, LAST2_FRAME };
  248|       |
  249|  21.0M|    if (x != NULL) {
  ------------------
  |  Branch (249:9): [True: 21.0M, False: 25]
  ------------------
  250|       |      // Disable pruning if either tpl suggests that we keep the frame or
  251|       |      // the pred_mv gives us the best sad
  252|  21.0M|      if (x->tpl_keep_ref_frame[LAST3_FRAME] ||
  ------------------
  |  Branch (252:11): [True: 18.4E, False: 21.0M]
  ------------------
  253|  21.0M|          x->pred_mv_sad[LAST3_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (253:11): [True: 72.4k, False: 21.0M]
  ------------------
  254|  73.4k|        ref_frame_list[0] = NONE_FRAME;
  255|  73.4k|      }
  256|  21.0M|      if (x->tpl_keep_ref_frame[LAST2_FRAME] ||
  ------------------
  |  Branch (256:11): [True: 18.4E, False: 21.0M]
  ------------------
  257|  21.0M|          x->pred_mv_sad[LAST2_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (257:11): [True: 73.8k, False: 21.0M]
  ------------------
  258|  73.4k|        ref_frame_list[1] = NONE_FRAME;
  259|  73.4k|      }
  260|  21.0M|    }
  261|       |
  262|  21.0M|    if (prune_ref(ref_frame, ref_display_order_hint,
  ------------------
  |  Branch (262:9): [True: 0, False: 21.0M]
  ------------------
  263|  21.0M|                  ref_display_order_hint[GOLDEN_FRAME - LAST_FRAME],
  264|  21.0M|                  ref_frame_list))
  265|      0|      return 1;
  266|  21.0M|  }
  267|       |
  268|  21.0M|  if (sf->inter_sf.selective_ref_frame >= 3) {
  ------------------
  |  Branch (268:7): [True: 21.0M, False: 18.4E]
  ------------------
  269|  21.0M|    int ref_frame_list[2] = { ALTREF2_FRAME, BWDREF_FRAME };
  270|       |
  271|  21.0M|    if (x != NULL) {
  ------------------
  |  Branch (271:9): [True: 21.0M, False: 18.4E]
  ------------------
  272|       |      // Disable pruning if either tpl suggests that we keep the frame or
  273|       |      // the pred_mv gives us the best sad
  274|  21.0M|      if (x->tpl_keep_ref_frame[ALTREF2_FRAME] ||
  ------------------
  |  Branch (274:11): [True: 18.4E, False: 21.0M]
  ------------------
  275|  21.0M|          x->pred_mv_sad[ALTREF2_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (275:11): [True: 73.0k, False: 21.0M]
  ------------------
  276|  73.4k|        ref_frame_list[0] = NONE_FRAME;
  277|  73.4k|      }
  278|  21.0M|      if (x->tpl_keep_ref_frame[BWDREF_FRAME] ||
  ------------------
  |  Branch (278:11): [True: 18.4E, False: 21.0M]
  ------------------
  279|  21.0M|          x->pred_mv_sad[BWDREF_FRAME] == x->best_pred_mv_sad[0]) {
  ------------------
  |  Branch (279:11): [True: 73.1k, False: 21.0M]
  ------------------
  280|  73.4k|        ref_frame_list[1] = NONE_FRAME;
  281|  73.4k|      }
  282|  21.0M|    }
  283|       |
  284|  21.0M|    if (prune_ref(ref_frame, ref_display_order_hint,
  ------------------
  |  Branch (284:9): [True: 0, False: 21.0M]
  ------------------
  285|  21.0M|                  ref_display_order_hint[LAST_FRAME - LAST_FRAME],
  286|  21.0M|                  ref_frame_list))
  287|      0|      return 1;
  288|  21.0M|  }
  289|       |
  290|  21.0M|  if (x != NULL && sf->inter_sf.prune_comp_ref_frames && comp_pred) {
  ------------------
  |  Branch (290:7): [True: 21.0M, False: 18.4E]
  |  Branch (290:20): [True: 21.0M, False: 18.4E]
  |  Branch (290:58): [True: 0, False: 21.0M]
  ------------------
  291|      0|    int closest_ref_frames = has_closest_ref_frames(
  292|      0|        ref_frame, cpi->ref_frame_dist_info.nearest_past_ref,
  293|      0|        cpi->ref_frame_dist_info.nearest_future_ref);
  294|      0|    const int ref_idx0 = ref_frame[0] - LAST_FRAME;
  295|      0|    const int ref_idx1 = ref_frame[1] - LAST_FRAME;
  296|      0|    const int keep_comp_ref_pair_mask =
  297|      0|        (cpi->keep_comp_ref_frame_mask & (1 << ref_idx0)) &&
  ------------------
  |  Branch (297:9): [True: 0, False: 0]
  ------------------
  298|      0|        (cpi->keep_comp_ref_frame_mask & (1 << ref_idx1));
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|       |
  300|       |    // Don't prune references frame pairs which are important or closest.
  301|      0|    if (!(keep_comp_ref_pair_mask || closest_ref_frames)) {
  ------------------
  |  Branch (301:11): [True: 0, False: 0]
  |  Branch (301:38): [True: 0, False: 0]
  ------------------
  302|       |      // Prune reference frames which are not the closest to the current frame.
  303|      0|      if (sf->inter_sf.prune_comp_ref_frames >= 3) {
  ------------------
  |  Branch (303:11): [True: 0, False: 0]
  ------------------
  304|      0|        return 1;
  305|      0|      } else if (sf->inter_sf.prune_comp_ref_frames >= 1) {
  ------------------
  |  Branch (305:18): [True: 0, False: 0]
  ------------------
  306|       |        // Prune reference frames with non minimum pred_mv_sad.
  307|      0|        if (has_best_pred_mv_sad(ref_frame, x) == 0) return 1;
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  ------------------
  308|      0|      }
  309|      0|    }
  310|      0|  }
  311|       |
  312|  21.0M|  return 0;
  313|  21.0M|}
rdopt.c:prune_ref:
  196|  42.1M|                            const int *ref_frame_list) {
  197|   126M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (197:19): [True: 84.2M, False: 42.1M]
  ------------------
  198|  84.2M|    if (ref_frame_list[i] == NONE_FRAME) continue;
  ------------------
  |  Branch (198:9): [True: 293k, False: 83.9M]
  ------------------
  199|       |
  200|  83.9M|    if (ref_frame[0] == ref_frame_list[i] ||
  ------------------
  |  Branch (200:9): [True: 7.61M, False: 76.3M]
  ------------------
  201|  76.3M|        ref_frame[1] == ref_frame_list[i]) {
  ------------------
  |  Branch (201:9): [True: 18.4E, False: 76.3M]
  ------------------
  202|  7.64M|      if (av1_encoder_get_relative_dist(
  ------------------
  |  Branch (202:11): [True: 0, False: 7.64M]
  ------------------
  203|  7.64M|              ref_display_order_hint[ref_frame_list[i] - LAST_FRAME],
  204|  7.64M|              frame_display_order_hint) < 0)
  205|      0|        return 1;
  206|  7.64M|    }
  207|  83.9M|  }
  208|  42.1M|  return 0;
  209|  42.1M|}
rdopt.c:av1_encoder_get_relative_dist:
  173|  7.64M|static inline int av1_encoder_get_relative_dist(int a, int b) {
  174|       |  assert(a >= 0 && b >= 0);
  175|  7.64M|  return (a - b);
  176|  7.64M|}
nonrd_pickmode.c:av1_copy_mbmi_ext_to_mbmi_ext_frame:
  319|   602k|    const MB_MODE_INFO_EXT *const mbmi_ext, uint8_t ref_frame_type) {
  320|   602k|  memcpy(mbmi_ext_best->ref_mv_stack, mbmi_ext->ref_mv_stack[ref_frame_type],
  321|   602k|         sizeof(mbmi_ext->ref_mv_stack[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|   602k|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  322|   602k|  memcpy(mbmi_ext_best->weight, mbmi_ext->weight[ref_frame_type],
  323|   602k|         sizeof(mbmi_ext->weight[USABLE_REF_MV_STACK_SIZE]));
  ------------------
  |  |  511|   602k|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  324|   602k|  mbmi_ext_best->mode_context = mbmi_ext->mode_context[ref_frame_type];
  325|   602k|  mbmi_ext_best->ref_mv_count = mbmi_ext->ref_mv_count[ref_frame_type];
  326|   602k|  memcpy(mbmi_ext_best->global_mvs, mbmi_ext->global_mvs,
  327|   602k|         sizeof(mbmi_ext->global_mvs));
  328|   602k|}

encodeframe.c:select_tx_mode:
  452|  73.6k|    const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) {
  453|  73.6k|  if (cm->features.coded_lossless) return ONLY_4X4;
  ------------------
  |  Branch (453:7): [True: 3.40k, False: 70.2k]
  ------------------
  454|  70.2k|  if (tx_size_search_method == USE_LARGESTALL) {
  ------------------
  |  Branch (454:7): [True: 0, False: 70.2k]
  ------------------
  455|      0|    return TX_MODE_LARGEST;
  456|  70.2k|  } else {
  457|       |    assert(tx_size_search_method == USE_FULL_RD ||
  458|  70.2k|           tx_size_search_method == USE_FAST_RD);
  459|  70.2k|    return TX_MODE_SELECT;
  460|  70.2k|  }
  461|  70.2k|}
encodemb.c:get_visible_dimensions:
  365|  3.42M|                                         int *visible_rows) {
  366|  3.42M|  if ((x->pix_to_bottom_edge >= 0 && x->pix_to_right_edge >= 0) || !clip_dims) {
  ------------------
  |  Branch (366:8): [True: 1.75M, False: 1.67M]
  |  Branch (366:38): [True: 610k, False: 1.14M]
  |  Branch (366:68): [True: 0, False: 2.82M]
  ------------------
  367|   610k|    if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (367:9): [True: 610k, False: 25]
  |  Branch (367:33): [True: 610k, False: 0]
  ------------------
  368|   610k|      *visible_rows = rows;
  369|   610k|      *visible_cols = cols;
  370|   610k|    }
  371|   610k|    return 0;
  372|   610k|  }
  373|  2.81M|  const MACROBLOCKD *const xd = &x->e_mbd;
  374|  2.81M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  375|  2.81M|  int valid_cols, valid_rows;
  376|       |
  377|  2.81M|  if (x->pix_to_bottom_edge >= 0) {
  ------------------
  |  Branch (377:7): [True: 1.14M, False: 1.67M]
  ------------------
  378|  1.14M|    valid_rows = rows;
  379|  1.67M|  } else {
  380|  1.67M|    const int block_height = block_size_high[plane_bsize];
  381|  1.67M|    const int block_rows =
  382|  1.67M|        -ROUND_POWER_OF_TWO(-x->pix_to_bottom_edge, pd->subsampling_y) +
  ------------------
  |  |   41|  1.67M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  383|  1.67M|        block_height;
  384|  1.67M|    valid_rows = clamp(block_rows - (blk_row << MI_SIZE_LOG2), 0, rows);
  ------------------
  |  |   39|  1.67M|#define MI_SIZE_LOG2 2
  ------------------
  385|  1.67M|  }
  386|       |
  387|  2.81M|  if (x->pix_to_right_edge >= 0) {
  ------------------
  |  Branch (387:7): [True: 1.15M, False: 1.66M]
  ------------------
  388|  1.15M|    valid_cols = cols;
  389|  1.66M|  } else {
  390|  1.66M|    const int block_width = block_size_wide[plane_bsize];
  391|  1.66M|    const int block_cols =
  392|  1.66M|        -ROUND_POWER_OF_TWO(-x->pix_to_right_edge, pd->subsampling_x) +
  ------------------
  |  |   41|  1.66M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  393|  1.66M|        block_width;
  394|  1.66M|    valid_cols = clamp(block_cols - (blk_col << MI_SIZE_LOG2), 0, cols);
  ------------------
  |  |   39|  1.66M|#define MI_SIZE_LOG2 2
  ------------------
  395|  1.66M|  }
  396|  2.82M|  if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (396:7): [True: 2.82M, False: 18.4E]
  |  Branch (396:31): [True: 2.82M, False: 39]
  ------------------
  397|  2.82M|    *visible_cols = valid_cols;
  398|  2.82M|    *visible_rows = valid_rows;
  399|  2.82M|  }
  400|  2.81M|  return (valid_cols < cols || valid_rows < rows);
  ------------------
  |  Branch (400:11): [True: 1.55M, False: 1.26M]
  |  Branch (400:32): [True: 1.21M, False: 56.1k]
  ------------------
  401|  3.42M|}
palette.c:store_winner_mode_stats:
  789|   493k|    int multi_winner_mode_type, int txfm_search_done) {
  790|   493k|  const AV1_COMMON *const cm = &cpi->common;
  791|   493k|  WinnerModeStats *winner_mode_stats = x->winner_mode_stats;
  792|   493k|  int mode_idx = 0;
  793|   493k|  int is_palette_mode = mbmi->palette_mode_info.palette_size[PLANE_TYPE_Y] > 0;
  794|       |  // Mode stat is not required when multiwinner mode processing is disabled
  795|   493k|  if (multi_winner_mode_type == MULTI_WINNER_MODE_OFF) return;
  ------------------
  |  Branch (795:7): [True: 493k, False: 18.4E]
  ------------------
  796|       |  // Ignore mode with maximum rd
  797|  18.4E|  if (this_rd == INT64_MAX) return;
  ------------------
  |  Branch (797:7): [True: 0, False: 18.4E]
  ------------------
  798|       |  // TODO(any): Winner mode processing is currently not applicable for palette
  799|       |  // mode in Inter frames. Clean-up the following code, once support is added
  800|  18.4E|  if (!frame_is_intra_only(cm) && is_palette_mode) return;
  ------------------
  |  Branch (800:7): [True: 0, False: 18.4E]
  |  Branch (800:35): [True: 0, False: 0]
  ------------------
  801|       |
  802|  18.4E|  int max_winner_mode_count = winner_mode_count_allowed[multi_winner_mode_type];
  803|  18.4E|  assert(x->winner_mode_count >= 0 &&
  804|  18.4E|         x->winner_mode_count <= max_winner_mode_count);
  805|       |
  806|  18.4E|  if (x->winner_mode_count) {
  ------------------
  |  Branch (806:7): [True: 0, False: 18.4E]
  ------------------
  807|       |    // Find the mode which has higher rd cost than this_rd
  808|      0|    for (mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++)
  ------------------
  |  Branch (808:24): [True: 0, False: 0]
  ------------------
  809|      0|      if (winner_mode_stats[mode_idx].rd > this_rd) break;
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|       |
  811|      0|    if (mode_idx == max_winner_mode_count) {
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|       |      // No mode has higher rd cost than this_rd
  813|      0|      return;
  814|      0|    } else if (mode_idx < max_winner_mode_count - 1) {
  ------------------
  |  Branch (814:16): [True: 0, False: 0]
  ------------------
  815|       |      // Create a slot for current mode and move others to the next slot
  816|      0|      memmove(
  817|      0|          &winner_mode_stats[mode_idx + 1], &winner_mode_stats[mode_idx],
  818|      0|          (max_winner_mode_count - mode_idx - 1) * sizeof(*winner_mode_stats));
  819|      0|    }
  820|      0|  }
  821|       |  // Add a mode stat for winner mode processing
  822|  18.4E|  winner_mode_stats[mode_idx].mbmi = *mbmi;
  823|  18.4E|  winner_mode_stats[mode_idx].rd = this_rd;
  824|  18.4E|  winner_mode_stats[mode_idx].mode_index = mode_index;
  825|       |
  826|       |  // Update rd stats required for inter frame
  827|  18.4E|  if (!frame_is_intra_only(cm) && rd_cost && rd_cost_y && rd_cost_uv) {
  ------------------
  |  Branch (827:7): [True: 0, False: 18.4E]
  |  Branch (827:35): [True: 0, False: 0]
  |  Branch (827:46): [True: 0, False: 0]
  |  Branch (827:59): [True: 0, False: 0]
  ------------------
  828|      0|    const MACROBLOCKD *xd = &x->e_mbd;
  829|      0|    const int skip_ctx = av1_get_skip_txfm_context(xd);
  830|      0|    const int is_intra_mode = av1_mode_defs[mode_index].mode < INTRA_MODE_END;
  831|      0|    const int skip_txfm = mbmi->skip_txfm && !is_intra_mode;
  ------------------
  |  Branch (831:27): [True: 0, False: 0]
  |  Branch (831:46): [True: 0, False: 0]
  ------------------
  832|       |
  833|      0|    winner_mode_stats[mode_idx].rd_cost = *rd_cost;
  834|      0|    if (txfm_search_done) {
  ------------------
  |  Branch (834:9): [True: 0, False: 0]
  ------------------
  835|      0|      const int skip_rate =
  836|      0|          x->mode_costs
  837|      0|              .skip_txfm_cost[skip_ctx][rd_cost->skip_txfm || skip_txfm];
  ------------------
  |  Branch (837:41): [True: 0, False: 0]
  |  Branch (837:63): [True: 0, False: 0]
  ------------------
  838|      0|      const int scaled_skip_rate =
  839|      0|          increase_motion_mode_rate(cpi, mbmi, skip_rate);
  840|      0|      winner_mode_stats[mode_idx].rate_y = rd_cost_y->rate + scaled_skip_rate;
  841|      0|      winner_mode_stats[mode_idx].rate_uv = rd_cost_uv->rate;
  842|      0|    }
  843|      0|  }
  844|       |
  845|  18.4E|  if (color_map) {
  ------------------
  |  Branch (845:7): [True: 0, False: 18.4E]
  ------------------
  846|       |    // Store color_index_map for palette mode
  847|      0|    const MACROBLOCKD *const xd = &x->e_mbd;
  848|      0|    int block_width, block_height;
  849|      0|    av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  850|      0|                             &block_height, NULL, NULL);
  851|      0|    memcpy(winner_mode_stats[mode_idx].color_index_map, color_map,
  852|      0|           block_width * block_height * sizeof(color_map[0]));
  853|      0|  }
  854|       |
  855|  18.4E|  x->winner_mode_count =
  856|  18.4E|      AOMMIN(x->winner_mode_count + 1, max_winner_mode_count);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  857|  18.4E|}
partition_search.c:set_tx_size_search_method:
  542|  9.37M|    int is_winner_mode) {
  543|       |  // Populate transform size search method/transform mode appropriately
  544|  9.37M|  txfm_params->tx_size_search_method =
  545|  9.37M|      winner_mode_params->tx_size_search_methods[DEFAULT_EVAL];
  546|  9.37M|  if (enable_winner_mode_for_tx_size_srch) {
  ------------------
  |  Branch (546:7): [True: 6.38M, False: 2.98M]
  ------------------
  547|  6.38M|    if (is_winner_mode)
  ------------------
  |  Branch (547:9): [True: 6.38M, False: 0]
  ------------------
  548|  6.38M|      txfm_params->tx_size_search_method =
  549|  6.38M|          winner_mode_params->tx_size_search_methods[WINNER_MODE_EVAL];
  550|      0|    else
  551|      0|      txfm_params->tx_size_search_method =
  552|      0|          winner_mode_params->tx_size_search_methods[MODE_EVAL];
  553|  6.38M|  }
  554|  9.37M|  txfm_params->tx_mode_search_type =
  555|  9.37M|      select_tx_mode(cm, txfm_params->tx_size_search_method);
  556|  9.37M|}
partition_search.c:select_tx_mode:
  452|  9.37M|    const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) {
  453|  9.37M|  if (cm->features.coded_lossless) return ONLY_4X4;
  ------------------
  |  Branch (453:7): [True: 273k, False: 9.09M]
  ------------------
  454|  9.09M|  if (tx_size_search_method == USE_LARGESTALL) {
  ------------------
  |  Branch (454:7): [True: 0, False: 9.09M]
  ------------------
  455|      0|    return TX_MODE_LARGEST;
  456|  9.09M|  } else {
  457|       |    assert(tx_size_search_method == USE_FULL_RD ||
  458|  9.09M|           tx_size_search_method == USE_FAST_RD);
  459|  9.09M|    return TX_MODE_SELECT;
  460|  9.09M|  }
  461|  9.09M|}
partition_search.c:set_mode_eval_params:
  609|  2.99M|                                        MODE_EVAL_TYPE mode_eval_type) {
  610|  2.99M|  const AV1_COMMON *cm = &cpi->common;
  611|  2.99M|  const SPEED_FEATURES *sf = &cpi->sf;
  612|  2.99M|  const WinnerModeParams *winner_mode_params = &cpi->winner_mode_params;
  613|  2.99M|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
  614|       |
  615|  2.99M|  txfm_params->use_qm_dist_metric =
  616|  2.99M|      cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR;
  617|       |
  618|  2.99M|  switch (mode_eval_type) {
  619|  2.99M|    case DEFAULT_EVAL:
  ------------------
  |  Branch (619:5): [True: 2.99M, False: 18.4E]
  ------------------
  620|  2.99M|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  621|  2.99M|      txfm_params->use_default_intra_tx_type = 0;
  622|  2.99M|      txfm_params->use_derived_intra_tx_type_set = 0;
  623|  2.99M|      txfm_params->skip_txfm_level =
  624|  2.99M|          winner_mode_params->skip_txfm_level[DEFAULT_EVAL];
  625|  2.99M|      txfm_params->predict_dc_level =
  626|  2.99M|          winner_mode_params->predict_dc_level[DEFAULT_EVAL];
  627|       |      // Set default transform domain distortion type
  628|  2.99M|      set_tx_domain_dist_params(winner_mode_params, txfm_params, 0, 0);
  629|       |
  630|       |      // Get default threshold for R-D optimization of coefficients
  631|  2.99M|      get_rd_opt_coeff_thresh(winner_mode_params->coeff_opt_thresholds,
  632|  2.99M|                              txfm_params, 0, 0);
  633|       |
  634|       |      // Set default transform size search method
  635|  2.99M|      set_tx_size_search_method(cm, winner_mode_params, txfm_params, 0, 0);
  636|       |      // Set default transform type prune
  637|  2.99M|      set_tx_type_prune(sf, txfm_params, 0, 0);
  638|  2.99M|      break;
  639|      0|    case MODE_EVAL:
  ------------------
  |  Branch (639:5): [True: 0, False: 2.99M]
  ------------------
  640|      0|      txfm_params->use_default_intra_tx_type =
  641|      0|          (cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 2 ||
  ------------------
  |  Branch (641:12): [True: 0, False: 0]
  ------------------
  642|      0|           cpi->oxcf.txfm_cfg.use_intra_default_tx_only);
  ------------------
  |  Branch (642:12): [True: 0, False: 0]
  ------------------
  643|      0|      txfm_params->use_derived_intra_tx_type_set =
  644|      0|          cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 1;
  645|      0|      txfm_params->default_inter_tx_type_prob_thresh =
  646|      0|          cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh;
  647|      0|      txfm_params->skip_txfm_level =
  648|      0|          winner_mode_params->skip_txfm_level[MODE_EVAL];
  649|      0|      txfm_params->predict_dc_level =
  650|      0|          winner_mode_params->predict_dc_level[MODE_EVAL];
  651|       |      // Set transform domain distortion type for mode evaluation
  652|      0|      set_tx_domain_dist_params(
  653|      0|          winner_mode_params, txfm_params,
  654|      0|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 0);
  655|       |
  656|       |      // Get threshold for R-D optimization of coefficients during mode
  657|       |      // evaluation
  658|      0|      get_rd_opt_coeff_thresh(
  659|      0|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  660|      0|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 0);
  661|       |
  662|       |      // Set the transform size search method for mode evaluation
  663|      0|      set_tx_size_search_method(
  664|      0|          cm, winner_mode_params, txfm_params,
  665|      0|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 0);
  666|       |      // Set transform type prune for mode evaluation
  667|      0|      set_tx_type_prune(sf, txfm_params,
  668|      0|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  669|      0|                        0);
  670|      0|      break;
  671|      0|    case WINNER_MODE_EVAL:
  ------------------
  |  Branch (671:5): [True: 0, False: 2.99M]
  ------------------
  672|      0|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  673|      0|      txfm_params->use_default_intra_tx_type = 0;
  674|      0|      txfm_params->use_derived_intra_tx_type_set = 0;
  675|      0|      txfm_params->skip_txfm_level =
  676|      0|          winner_mode_params->skip_txfm_level[WINNER_MODE_EVAL];
  677|      0|      txfm_params->predict_dc_level =
  678|      0|          winner_mode_params->predict_dc_level[WINNER_MODE_EVAL];
  679|       |
  680|       |      // Set transform domain distortion type for winner mode evaluation
  681|      0|      set_tx_domain_dist_params(
  682|      0|          winner_mode_params, txfm_params,
  683|      0|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 1);
  684|       |
  685|       |      // Get threshold for R-D optimization of coefficients for winner mode
  686|       |      // evaluation
  687|      0|      get_rd_opt_coeff_thresh(
  688|      0|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  689|      0|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 1);
  690|       |
  691|       |      // Set the transform size search method for winner mode evaluation
  692|      0|      set_tx_size_search_method(
  693|      0|          cm, winner_mode_params, txfm_params,
  694|      0|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1);
  695|       |      // Set default transform type prune mode for winner mode evaluation
  696|      0|      set_tx_type_prune(sf, txfm_params,
  697|      0|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  698|      0|                        1);
  699|      0|      break;
  700|      0|    default: assert(0);
  ------------------
  |  Branch (700:5): [True: 0, False: 2.99M]
  ------------------
  701|  2.99M|  }
  702|       |
  703|       |  // Rd record collected at a specific mode evaluation stage can not be used
  704|       |  // across other evaluation stages as the transform parameters are different.
  705|       |  // Hence, reset mb rd record whenever mode evaluation stage type changes.
  706|  2.99M|  if (txfm_params->mode_eval_type != mode_eval_type)
  ------------------
  |  Branch (706:7): [True: 0, False: 2.99M]
  ------------------
  707|      0|    reset_mb_rd_record(x->txfm_search_info.mb_rd_record);
  708|       |
  709|  2.99M|  txfm_params->mode_eval_type = mode_eval_type;
  710|  2.99M|}
partition_search.c:set_tx_domain_dist_params:
  576|  2.99M|    int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) {
  577|  2.99M|  if (txfm_params->use_qm_dist_metric) {
  ------------------
  |  Branch (577:7): [True: 2.12M, False: 864k]
  ------------------
  578|       |    // QM-weighted PSNR is computed in transform space, so we need to forcibly
  579|       |    // enable the use of tx domain distortion.
  580|  2.12M|    txfm_params->use_transform_domain_distortion = 1;
  581|  2.12M|    txfm_params->tx_domain_dist_threshold = 0;
  582|  2.12M|    return;
  583|  2.12M|  }
  584|       |
  585|   864k|  if (!enable_winner_mode_for_tx_domain_dist) {
  ------------------
  |  Branch (585:7): [True: 864k, False: 18.4E]
  ------------------
  586|   864k|    txfm_params->use_transform_domain_distortion =
  587|   864k|        winner_mode_params->use_transform_domain_distortion[DEFAULT_EVAL];
  588|   864k|    txfm_params->tx_domain_dist_threshold =
  589|   864k|        winner_mode_params->tx_domain_dist_threshold[DEFAULT_EVAL];
  590|   864k|    return;
  591|   864k|  }
  592|       |
  593|  18.4E|  if (is_winner_mode) {
  ------------------
  |  Branch (593:7): [True: 0, False: 18.4E]
  ------------------
  594|      0|    txfm_params->use_transform_domain_distortion =
  595|      0|        winner_mode_params->use_transform_domain_distortion[WINNER_MODE_EVAL];
  596|      0|    txfm_params->tx_domain_dist_threshold =
  597|      0|        winner_mode_params->tx_domain_dist_threshold[WINNER_MODE_EVAL];
  598|  18.4E|  } else {
  599|  18.4E|    txfm_params->use_transform_domain_distortion =
  600|  18.4E|        winner_mode_params->use_transform_domain_distortion[MODE_EVAL];
  601|  18.4E|    txfm_params->tx_domain_dist_threshold =
  602|  18.4E|        winner_mode_params->tx_domain_dist_threshold[MODE_EVAL];
  603|  18.4E|  }
  604|  18.4E|}
partition_search.c:set_tx_type_prune:
  561|  2.99M|                                     int is_winner_mode) {
  562|       |  // Populate prune transform mode appropriately
  563|  2.99M|  txfm_params->prune_2d_txfm_mode = sf->tx_sf.tx_type_search.prune_2d_txfm_mode;
  564|  2.99M|  if (!winner_mode_tx_type_pruning) return;
  ------------------
  |  Branch (564:7): [True: 2.99M, False: 0]
  ------------------
  565|       |
  566|      0|  const int prune_mode[4][2] = { { TX_TYPE_PRUNE_3, TX_TYPE_PRUNE_0 },
  567|      0|                                 { TX_TYPE_PRUNE_4, TX_TYPE_PRUNE_0 },
  568|      0|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_2 },
  569|      0|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_3 } };
  570|      0|  txfm_params->prune_2d_txfm_mode =
  571|      0|      prune_mode[winner_mode_tx_type_pruning - 1][is_winner_mode];
  572|      0|}
rdopt.c:inter_mode_data_block_idx:
  298|   174k|static inline int inter_mode_data_block_idx(BLOCK_SIZE bsize) {
  299|   174k|  if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 ||
  ------------------
  |  Branch (299:7): [True: 4.29k, False: 170k]
  |  Branch (299:29): [True: 4.29k, False: 165k]
  |  Branch (299:51): [True: 4.29k, False: 161k]
  ------------------
  300|   161k|      bsize == BLOCK_4X16 || bsize == BLOCK_16X4) {
  ------------------
  |  Branch (300:7): [True: 4.29k, False: 157k]
  |  Branch (300:30): [True: 4.29k, False: 152k]
  ------------------
  301|  21.4k|    return -1;
  302|  21.4k|  }
  303|   152k|  return 1;
  304|   174k|}
rdopt.c:set_mode_eval_params:
  609|  6.09M|                                        MODE_EVAL_TYPE mode_eval_type) {
  610|  6.09M|  const AV1_COMMON *cm = &cpi->common;
  611|  6.09M|  const SPEED_FEATURES *sf = &cpi->sf;
  612|  6.09M|  const WinnerModeParams *winner_mode_params = &cpi->winner_mode_params;
  613|  6.09M|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
  614|       |
  615|  6.09M|  txfm_params->use_qm_dist_metric =
  616|  6.09M|      cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR;
  617|       |
  618|  6.09M|  switch (mode_eval_type) {
  619|  2.35M|    case DEFAULT_EVAL:
  ------------------
  |  Branch (619:5): [True: 2.35M, False: 3.73M]
  ------------------
  620|  2.35M|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  621|  2.35M|      txfm_params->use_default_intra_tx_type = 0;
  622|  2.35M|      txfm_params->use_derived_intra_tx_type_set = 0;
  623|  2.35M|      txfm_params->skip_txfm_level =
  624|  2.35M|          winner_mode_params->skip_txfm_level[DEFAULT_EVAL];
  625|  2.35M|      txfm_params->predict_dc_level =
  626|  2.35M|          winner_mode_params->predict_dc_level[DEFAULT_EVAL];
  627|       |      // Set default transform domain distortion type
  628|  2.35M|      set_tx_domain_dist_params(winner_mode_params, txfm_params, 0, 0);
  629|       |
  630|       |      // Get default threshold for R-D optimization of coefficients
  631|  2.35M|      get_rd_opt_coeff_thresh(winner_mode_params->coeff_opt_thresholds,
  632|  2.35M|                              txfm_params, 0, 0);
  633|       |
  634|       |      // Set default transform size search method
  635|  2.35M|      set_tx_size_search_method(cm, winner_mode_params, txfm_params, 0, 0);
  636|       |      // Set default transform type prune
  637|  2.35M|      set_tx_type_prune(sf, txfm_params, 0, 0);
  638|  2.35M|      break;
  639|  1.91M|    case MODE_EVAL:
  ------------------
  |  Branch (639:5): [True: 1.91M, False: 4.17M]
  ------------------
  640|  1.91M|      txfm_params->use_default_intra_tx_type =
  641|  1.91M|          (cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 2 ||
  ------------------
  |  Branch (641:12): [True: 18.4E, False: 1.91M]
  ------------------
  642|  1.91M|           cpi->oxcf.txfm_cfg.use_intra_default_tx_only);
  ------------------
  |  Branch (642:12): [True: 18.4E, False: 1.91M]
  ------------------
  643|  1.91M|      txfm_params->use_derived_intra_tx_type_set =
  644|  1.91M|          cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 1;
  645|  1.91M|      txfm_params->default_inter_tx_type_prob_thresh =
  646|  1.91M|          cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh;
  647|  1.91M|      txfm_params->skip_txfm_level =
  648|  1.91M|          winner_mode_params->skip_txfm_level[MODE_EVAL];
  649|  1.91M|      txfm_params->predict_dc_level =
  650|  1.91M|          winner_mode_params->predict_dc_level[MODE_EVAL];
  651|       |      // Set transform domain distortion type for mode evaluation
  652|  1.91M|      set_tx_domain_dist_params(
  653|  1.91M|          winner_mode_params, txfm_params,
  654|  1.91M|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 0);
  655|       |
  656|       |      // Get threshold for R-D optimization of coefficients during mode
  657|       |      // evaluation
  658|  1.91M|      get_rd_opt_coeff_thresh(
  659|  1.91M|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  660|  1.91M|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 0);
  661|       |
  662|       |      // Set the transform size search method for mode evaluation
  663|  1.91M|      set_tx_size_search_method(
  664|  1.91M|          cm, winner_mode_params, txfm_params,
  665|  1.91M|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 0);
  666|       |      // Set transform type prune for mode evaluation
  667|  1.91M|      set_tx_type_prune(sf, txfm_params,
  668|  1.91M|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  669|  1.91M|                        0);
  670|  1.91M|      break;
  671|  1.82M|    case WINNER_MODE_EVAL:
  ------------------
  |  Branch (671:5): [True: 1.82M, False: 4.27M]
  ------------------
  672|  1.82M|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  673|  1.82M|      txfm_params->use_default_intra_tx_type = 0;
  674|  1.82M|      txfm_params->use_derived_intra_tx_type_set = 0;
  675|  1.82M|      txfm_params->skip_txfm_level =
  676|  1.82M|          winner_mode_params->skip_txfm_level[WINNER_MODE_EVAL];
  677|  1.82M|      txfm_params->predict_dc_level =
  678|  1.82M|          winner_mode_params->predict_dc_level[WINNER_MODE_EVAL];
  679|       |
  680|       |      // Set transform domain distortion type for winner mode evaluation
  681|  1.82M|      set_tx_domain_dist_params(
  682|  1.82M|          winner_mode_params, txfm_params,
  683|  1.82M|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 1);
  684|       |
  685|       |      // Get threshold for R-D optimization of coefficients for winner mode
  686|       |      // evaluation
  687|  1.82M|      get_rd_opt_coeff_thresh(
  688|  1.82M|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  689|  1.82M|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 1);
  690|       |
  691|       |      // Set the transform size search method for winner mode evaluation
  692|  1.82M|      set_tx_size_search_method(
  693|  1.82M|          cm, winner_mode_params, txfm_params,
  694|  1.82M|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1);
  695|       |      // Set default transform type prune mode for winner mode evaluation
  696|  1.82M|      set_tx_type_prune(sf, txfm_params,
  697|  1.82M|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  698|  1.82M|                        1);
  699|  1.82M|      break;
  700|      0|    default: assert(0);
  ------------------
  |  Branch (700:5): [True: 0, False: 6.09M]
  ------------------
  701|  6.09M|  }
  702|       |
  703|       |  // Rd record collected at a specific mode evaluation stage can not be used
  704|       |  // across other evaluation stages as the transform parameters are different.
  705|       |  // Hence, reset mb rd record whenever mode evaluation stage type changes.
  706|  6.09M|  if (txfm_params->mode_eval_type != mode_eval_type)
  ------------------
  |  Branch (706:7): [True: 6.09M, False: 31]
  ------------------
  707|  6.09M|    reset_mb_rd_record(x->txfm_search_info.mb_rd_record);
  708|       |
  709|  6.09M|  txfm_params->mode_eval_type = mode_eval_type;
  710|  6.09M|}
rdopt.c:set_tx_domain_dist_params:
  576|  6.09M|    int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) {
  577|  6.09M|  if (txfm_params->use_qm_dist_metric) {
  ------------------
  |  Branch (577:7): [True: 4.47M, False: 1.61M]
  ------------------
  578|       |    // QM-weighted PSNR is computed in transform space, so we need to forcibly
  579|       |    // enable the use of tx domain distortion.
  580|  4.47M|    txfm_params->use_transform_domain_distortion = 1;
  581|  4.47M|    txfm_params->tx_domain_dist_threshold = 0;
  582|  4.47M|    return;
  583|  4.47M|  }
  584|       |
  585|  1.61M|  if (!enable_winner_mode_for_tx_domain_dist) {
  ------------------
  |  Branch (585:7): [True: 642k, False: 974k]
  ------------------
  586|   642k|    txfm_params->use_transform_domain_distortion =
  587|   642k|        winner_mode_params->use_transform_domain_distortion[DEFAULT_EVAL];
  588|   642k|    txfm_params->tx_domain_dist_threshold =
  589|   642k|        winner_mode_params->tx_domain_dist_threshold[DEFAULT_EVAL];
  590|   642k|    return;
  591|   642k|  }
  592|       |
  593|   974k|  if (is_winner_mode) {
  ------------------
  |  Branch (593:7): [True: 459k, False: 515k]
  ------------------
  594|   459k|    txfm_params->use_transform_domain_distortion =
  595|   459k|        winner_mode_params->use_transform_domain_distortion[WINNER_MODE_EVAL];
  596|   459k|    txfm_params->tx_domain_dist_threshold =
  597|   459k|        winner_mode_params->tx_domain_dist_threshold[WINNER_MODE_EVAL];
  598|   515k|  } else {
  599|   515k|    txfm_params->use_transform_domain_distortion =
  600|   515k|        winner_mode_params->use_transform_domain_distortion[MODE_EVAL];
  601|   515k|    txfm_params->tx_domain_dist_threshold =
  602|   515k|        winner_mode_params->tx_domain_dist_threshold[MODE_EVAL];
  603|   515k|  }
  604|   974k|}
rdopt.c:set_tx_size_search_method:
  542|  6.09M|    int is_winner_mode) {
  543|       |  // Populate transform size search method/transform mode appropriately
  544|  6.09M|  txfm_params->tx_size_search_method =
  545|  6.09M|      winner_mode_params->tx_size_search_methods[DEFAULT_EVAL];
  546|  6.09M|  if (enable_winner_mode_for_tx_size_srch) {
  ------------------
  |  Branch (546:7): [True: 3.74M, False: 2.35M]
  ------------------
  547|  3.74M|    if (is_winner_mode)
  ------------------
  |  Branch (547:9): [True: 1.82M, False: 1.91M]
  ------------------
  548|  1.82M|      txfm_params->tx_size_search_method =
  549|  1.82M|          winner_mode_params->tx_size_search_methods[WINNER_MODE_EVAL];
  550|  1.91M|    else
  551|  1.91M|      txfm_params->tx_size_search_method =
  552|  1.91M|          winner_mode_params->tx_size_search_methods[MODE_EVAL];
  553|  3.74M|  }
  554|  6.09M|  txfm_params->tx_mode_search_type =
  555|  6.09M|      select_tx_mode(cm, txfm_params->tx_size_search_method);
  556|  6.09M|}
rdopt.c:select_tx_mode:
  452|  6.09M|    const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) {
  453|  6.09M|  if (cm->features.coded_lossless) return ONLY_4X4;
  ------------------
  |  Branch (453:7): [True: 131k, False: 5.96M]
  ------------------
  454|  5.96M|  if (tx_size_search_method == USE_LARGESTALL) {
  ------------------
  |  Branch (454:7): [True: 1.87M, False: 4.08M]
  ------------------
  455|  1.87M|    return TX_MODE_LARGEST;
  456|  4.08M|  } else {
  457|       |    assert(tx_size_search_method == USE_FULL_RD ||
  458|  4.08M|           tx_size_search_method == USE_FAST_RD);
  459|  4.08M|    return TX_MODE_SELECT;
  460|  4.08M|  }
  461|  5.96M|}
rdopt.c:set_tx_type_prune:
  561|  6.09M|                                     int is_winner_mode) {
  562|       |  // Populate prune transform mode appropriately
  563|  6.09M|  txfm_params->prune_2d_txfm_mode = sf->tx_sf.tx_type_search.prune_2d_txfm_mode;
  564|  6.09M|  if (!winner_mode_tx_type_pruning) return;
  ------------------
  |  Branch (564:7): [True: 2.35M, False: 3.73M]
  ------------------
  565|       |
  566|  3.73M|  const int prune_mode[4][2] = { { TX_TYPE_PRUNE_3, TX_TYPE_PRUNE_0 },
  567|  3.73M|                                 { TX_TYPE_PRUNE_4, TX_TYPE_PRUNE_0 },
  568|  3.73M|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_2 },
  569|  3.73M|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_3 } };
  570|  3.73M|  txfm_params->prune_2d_txfm_mode =
  571|  3.73M|      prune_mode[winner_mode_tx_type_pruning - 1][is_winner_mode];
  572|  3.73M|}
rdopt.c:store_cfl_required_rdo:
  760|   171k|                                                      const MACROBLOCK *x) {
  761|   171k|  const MACROBLOCKD *xd = &x->e_mbd;
  762|       |
  763|   171k|  if (cm->seq_params->monochrome || !xd->is_chroma_ref) return CFL_DISALLOWED;
  ------------------
  |  Branch (763:7): [True: 13, False: 171k]
  |  Branch (763:37): [True: 0, False: 171k]
  ------------------
  764|       |
  765|   171k|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (765:7): [True: 0, False: 171k]
  ------------------
  766|       |    // For non-chroma-reference blocks, we should always store the luma pixels,
  767|       |    // in case the corresponding chroma-reference block uses CfL.
  768|       |    // Note that this can only happen for block sizes which are <8 on
  769|       |    // their shortest side, as otherwise they would be chroma reference
  770|       |    // blocks.
  771|      0|    return CFL_ALLOWED;
  772|      0|  }
  773|       |
  774|       |  // For chroma reference blocks, we should store data in the encoder iff we're
  775|       |  // allowed to try out CfL.
  776|   171k|  return is_cfl_allowed(xd);
  777|   171k|}
rdopt.c:av1_copy_usable_ref_mv_stack_and_weight:
  879|  1.98M|    MV_REFERENCE_FRAME ref_frame) {
  880|  1.98M|  memcpy(mbmi_ext->weight[ref_frame], xd->weight[ref_frame],
  881|  1.98M|         USABLE_REF_MV_STACK_SIZE * sizeof(xd->weight[0][0]));
  ------------------
  |  |  511|  1.98M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  882|  1.98M|  memcpy(mbmi_ext->ref_mv_stack[ref_frame], xd->ref_mv_stack[ref_frame],
  883|  1.98M|         USABLE_REF_MV_STACK_SIZE * sizeof(xd->ref_mv_stack[0][0]));
  ------------------
  |  |  511|  1.98M|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  884|  1.98M|}
rdopt.c:store_winner_mode_stats:
  789|  7.33M|    int multi_winner_mode_type, int txfm_search_done) {
  790|  7.33M|  const AV1_COMMON *const cm = &cpi->common;
  791|  7.33M|  WinnerModeStats *winner_mode_stats = x->winner_mode_stats;
  792|  7.33M|  int mode_idx = 0;
  793|  7.33M|  int is_palette_mode = mbmi->palette_mode_info.palette_size[PLANE_TYPE_Y] > 0;
  794|       |  // Mode stat is not required when multiwinner mode processing is disabled
  795|  7.33M|  if (multi_winner_mode_type == MULTI_WINNER_MODE_OFF) return;
  ------------------
  |  Branch (795:7): [True: 7.33M, False: 18.4E]
  ------------------
  796|       |  // Ignore mode with maximum rd
  797|  18.4E|  if (this_rd == INT64_MAX) return;
  ------------------
  |  Branch (797:7): [True: 0, False: 18.4E]
  ------------------
  798|       |  // TODO(any): Winner mode processing is currently not applicable for palette
  799|       |  // mode in Inter frames. Clean-up the following code, once support is added
  800|  18.4E|  if (!frame_is_intra_only(cm) && is_palette_mode) return;
  ------------------
  |  Branch (800:7): [True: 0, False: 18.4E]
  |  Branch (800:35): [True: 0, False: 0]
  ------------------
  801|       |
  802|  18.4E|  int max_winner_mode_count = winner_mode_count_allowed[multi_winner_mode_type];
  803|  18.4E|  assert(x->winner_mode_count >= 0 &&
  804|  18.4E|         x->winner_mode_count <= max_winner_mode_count);
  805|       |
  806|  18.4E|  if (x->winner_mode_count) {
  ------------------
  |  Branch (806:7): [True: 0, False: 18.4E]
  ------------------
  807|       |    // Find the mode which has higher rd cost than this_rd
  808|      0|    for (mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++)
  ------------------
  |  Branch (808:24): [True: 0, False: 0]
  ------------------
  809|      0|      if (winner_mode_stats[mode_idx].rd > this_rd) break;
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|       |
  811|      0|    if (mode_idx == max_winner_mode_count) {
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|       |      // No mode has higher rd cost than this_rd
  813|      0|      return;
  814|      0|    } else if (mode_idx < max_winner_mode_count - 1) {
  ------------------
  |  Branch (814:16): [True: 0, False: 0]
  ------------------
  815|       |      // Create a slot for current mode and move others to the next slot
  816|      0|      memmove(
  817|      0|          &winner_mode_stats[mode_idx + 1], &winner_mode_stats[mode_idx],
  818|      0|          (max_winner_mode_count - mode_idx - 1) * sizeof(*winner_mode_stats));
  819|      0|    }
  820|      0|  }
  821|       |  // Add a mode stat for winner mode processing
  822|  18.4E|  winner_mode_stats[mode_idx].mbmi = *mbmi;
  823|  18.4E|  winner_mode_stats[mode_idx].rd = this_rd;
  824|  18.4E|  winner_mode_stats[mode_idx].mode_index = mode_index;
  825|       |
  826|       |  // Update rd stats required for inter frame
  827|  18.4E|  if (!frame_is_intra_only(cm) && rd_cost && rd_cost_y && rd_cost_uv) {
  ------------------
  |  Branch (827:7): [True: 0, False: 18.4E]
  |  Branch (827:35): [True: 0, False: 0]
  |  Branch (827:46): [True: 0, False: 0]
  |  Branch (827:59): [True: 0, False: 0]
  ------------------
  828|      0|    const MACROBLOCKD *xd = &x->e_mbd;
  829|      0|    const int skip_ctx = av1_get_skip_txfm_context(xd);
  830|      0|    const int is_intra_mode = av1_mode_defs[mode_index].mode < INTRA_MODE_END;
  831|      0|    const int skip_txfm = mbmi->skip_txfm && !is_intra_mode;
  ------------------
  |  Branch (831:27): [True: 0, False: 0]
  |  Branch (831:46): [True: 0, False: 0]
  ------------------
  832|       |
  833|      0|    winner_mode_stats[mode_idx].rd_cost = *rd_cost;
  834|      0|    if (txfm_search_done) {
  ------------------
  |  Branch (834:9): [True: 0, False: 0]
  ------------------
  835|      0|      const int skip_rate =
  836|      0|          x->mode_costs
  837|      0|              .skip_txfm_cost[skip_ctx][rd_cost->skip_txfm || skip_txfm];
  ------------------
  |  Branch (837:41): [True: 0, False: 0]
  |  Branch (837:63): [True: 0, False: 0]
  ------------------
  838|      0|      const int scaled_skip_rate =
  839|      0|          increase_motion_mode_rate(cpi, mbmi, skip_rate);
  840|      0|      winner_mode_stats[mode_idx].rate_y = rd_cost_y->rate + scaled_skip_rate;
  841|      0|      winner_mode_stats[mode_idx].rate_uv = rd_cost_uv->rate;
  842|      0|    }
  843|      0|  }
  844|       |
  845|  18.4E|  if (color_map) {
  ------------------
  |  Branch (845:7): [True: 0, False: 18.4E]
  ------------------
  846|       |    // Store color_index_map for palette mode
  847|      0|    const MACROBLOCKD *const xd = &x->e_mbd;
  848|      0|    int block_width, block_height;
  849|      0|    av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  850|      0|                             &block_height, NULL, NULL);
  851|      0|    memcpy(winner_mode_stats[mode_idx].color_index_map, color_map,
  852|      0|           block_width * block_height * sizeof(color_map[0]));
  853|      0|  }
  854|       |
  855|  18.4E|  x->winner_mode_count =
  856|  18.4E|      AOMMIN(x->winner_mode_count + 1, max_winner_mode_count);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  857|  18.4E|}
rdopt.c:increase_motion_mode_rate:
  739|  7.89M|                                            int rate) {
  740|  7.89M|  const INTER_MODE_SPEED_FEATURES *const inter_sf = &cpi->sf.inter_sf;
  741|  7.89M|  double rd_bias_scale = 0.0;
  742|  7.89M|  if (this_mbmi->motion_mode == WARPED_CAUSAL) {
  ------------------
  |  Branch (742:7): [True: 40.5k, False: 7.85M]
  ------------------
  743|  40.5k|    rd_bias_scale = inter_sf->bias_warp_mode_rd_scale_pct / 100.0;
  744|  7.85M|  } else if (this_mbmi->motion_mode == OBMC_CAUSAL) {
  ------------------
  |  Branch (744:14): [True: 0, False: 7.85M]
  ------------------
  745|      0|    rd_bias_scale = inter_sf->bias_obmc_mode_rd_scale_pct / 100.0;
  746|  7.85M|  } else if (this_mbmi->mode == GLOBALMV ||
  ------------------
  |  Branch (746:14): [True: 142k, False: 7.70M]
  ------------------
  747|  7.70M|             this_mbmi->mode == GLOBAL_GLOBALMV) {
  ------------------
  |  Branch (747:14): [True: 18.4E, False: 7.70M]
  ------------------
  748|   143k|    rd_bias_scale = get_global_mv_mode_bias(cpi, this_mbmi);
  749|   143k|  }
  750|  7.89M|  if (rd_bias_scale <= 0.0) return rate;
  ------------------
  |  Branch (750:7): [True: 7.89M, False: 18.4E]
  ------------------
  751|       |
  752|  18.4E|  int scaled_rate = rate;
  753|  18.4E|  scaled_rate += (int)(rd_bias_scale * rate + 0.5);
  754|  18.4E|  return scaled_rate;
  755|  7.89M|}
rdopt.c:get_global_mv_mode_bias:
  715|   286k|                                            const MB_MODE_INFO *mbmi) {
  716|   286k|  if (cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct <= 0.0f) return 0.0f;
  ------------------
  |  Branch (716:7): [True: 286k, False: 18.4E]
  ------------------
  717|  18.4E|  if (cpi->common.features.cur_frame_force_integer_mv) return 0.0f;
  ------------------
  |  Branch (717:7): [True: 0, False: 18.4E]
  ------------------
  718|       |
  719|  18.4E|  assert(mbmi->mode == GLOBALMV || mbmi->mode == GLOBAL_GLOBALMV);
  720|       |
  721|  18.4E|  TransformationType ref_trans_type =
  722|  18.4E|      cpi->common.global_motion[mbmi->ref_frame[0]].wmtype;
  723|  18.4E|  if (is_global_mv_block(mbmi, ref_trans_type)) {
  ------------------
  |  Branch (723:7): [True: 0, False: 18.4E]
  ------------------
  724|      0|    return cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct / 100.0f;
  725|      0|  }
  726|       |
  727|  18.4E|  if (has_second_ref(mbmi)) {
  ------------------
  |  Branch (727:7): [True: 0, False: 18.4E]
  ------------------
  728|      0|    ref_trans_type = cpi->common.global_motion[mbmi->ref_frame[1]].wmtype;
  729|      0|    if (is_global_mv_block(mbmi, ref_trans_type)) {
  ------------------
  |  Branch (729:9): [True: 0, False: 0]
  ------------------
  730|      0|      return cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct / 100.0f;
  731|      0|    }
  732|      0|  }
  733|       |
  734|  18.4E|  return 0.0f;
  735|  18.4E|}
rdopt.c:is_mode_intra:
  870|   201k|static inline int is_mode_intra(PREDICTION_MODE mode) {
  871|   201k|  return mode < INTRA_MODE_END;
  872|   201k|}
rdopt.c:get_visible_dimensions:
  365|  9.63M|                                         int *visible_rows) {
  366|  9.63M|  if ((x->pix_to_bottom_edge >= 0 && x->pix_to_right_edge >= 0) || !clip_dims) {
  ------------------
  |  Branch (366:8): [True: 9.57M, False: 55.7k]
  |  Branch (366:38): [True: 9.52M, False: 49.6k]
  |  Branch (366:68): [True: 82.2k, False: 23.6k]
  ------------------
  367|  9.61M|    if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (367:9): [True: 9.61M, False: 18.4E]
  |  Branch (367:33): [True: 9.61M, False: 167]
  ------------------
  368|  9.61M|      *visible_rows = rows;
  369|  9.61M|      *visible_cols = cols;
  370|  9.61M|    }
  371|  9.61M|    return 0;
  372|  9.61M|  }
  373|  23.0k|  const MACROBLOCKD *const xd = &x->e_mbd;
  374|  23.0k|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  375|  23.0k|  int valid_cols, valid_rows;
  376|       |
  377|  23.0k|  if (x->pix_to_bottom_edge >= 0) {
  ------------------
  |  Branch (377:7): [True: 11.4k, False: 11.5k]
  ------------------
  378|  11.4k|    valid_rows = rows;
  379|  11.5k|  } else {
  380|  11.5k|    const int block_height = block_size_high[plane_bsize];
  381|  11.5k|    const int block_rows =
  382|  11.5k|        -ROUND_POWER_OF_TWO(-x->pix_to_bottom_edge, pd->subsampling_y) +
  ------------------
  |  |   41|  11.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  383|  11.5k|        block_height;
  384|  11.5k|    valid_rows = clamp(block_rows - (blk_row << MI_SIZE_LOG2), 0, rows);
  ------------------
  |  |   39|  11.5k|#define MI_SIZE_LOG2 2
  ------------------
  385|  11.5k|  }
  386|       |
  387|  23.0k|  if (x->pix_to_right_edge >= 0) {
  ------------------
  |  Branch (387:7): [True: 9.93k, False: 13.1k]
  ------------------
  388|  9.93k|    valid_cols = cols;
  389|  13.1k|  } else {
  390|  13.1k|    const int block_width = block_size_wide[plane_bsize];
  391|  13.1k|    const int block_cols =
  392|  13.1k|        -ROUND_POWER_OF_TWO(-x->pix_to_right_edge, pd->subsampling_x) +
  ------------------
  |  |   41|  13.1k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  393|  13.1k|        block_width;
  394|  13.1k|    valid_cols = clamp(block_cols - (blk_col << MI_SIZE_LOG2), 0, cols);
  ------------------
  |  |   39|  13.1k|#define MI_SIZE_LOG2 2
  ------------------
  395|  13.1k|  }
  396|  23.6k|  if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (396:7): [True: 23.6k, False: 18.4E]
  |  Branch (396:31): [True: 23.6k, False: 0]
  ------------------
  397|  23.6k|    *visible_cols = valid_cols;
  398|  23.6k|    *visible_rows = valid_rows;
  399|  23.6k|  }
  400|  23.0k|  return (valid_cols < cols || valid_rows < rows);
  ------------------
  |  Branch (400:11): [True: 13.1k, False: 9.93k]
  |  Branch (400:32): [True: 9.93k, False: 0]
  ------------------
  401|  9.63M|}
rdopt.c:restore_dst_buf:
  243|  14.7M|                                   const int num_planes) {
  244|  44.3M|  for (int i = 0; i < num_planes; i++) {
  ------------------
  |  Branch (244:19): [True: 29.5M, False: 14.7M]
  ------------------
  245|  29.5M|    xd->plane[i].dst.buf = dst.plane[i];
  246|  29.5M|    xd->plane[i].dst.stride = dst.stride[i];
  247|  29.5M|  }
  248|  14.7M|}
rdopt.c:get_txfm_rd_gate_level:
  890|  9.29M|    TX_SEARCH_CASE tx_search_case, int eval_motion_mode) {
  891|  9.29M|  assert(tx_search_case < TX_SEARCH_CASES);
  892|  9.29M|  if (tx_search_case == TX_SEARCH_MOTION_MODE && !eval_motion_mode &&
  ------------------
  |  Branch (892:7): [True: 9.27M, False: 23.8k]
  |  Branch (892:50): [True: 5.52M, False: 3.74M]
  ------------------
  893|  5.52M|      num_pels_log2_lookup[bsize] > 8)
  ------------------
  |  Branch (893:7): [True: 61.7k, False: 5.46M]
  ------------------
  894|  61.7k|    return txfm_rd_gate_level[TX_SEARCH_MOTION_MODE];
  895|       |  // Enable aggressive gating of transform search only when masked compound type
  896|       |  // is enabled.
  897|  9.23M|  else if (tx_search_case == TX_SEARCH_COMP_TYPE_MODE &&
  ------------------
  |  Branch (897:12): [True: 0, False: 9.23M]
  ------------------
  898|      0|           is_masked_compound_enabled)
  ------------------
  |  Branch (898:12): [True: 0, False: 0]
  ------------------
  899|      0|    return txfm_rd_gate_level[TX_SEARCH_COMP_TYPE_MODE];
  900|       |
  901|  9.23M|  return txfm_rd_gate_level[TX_SEARCH_DEFAULT];
  902|  9.29M|}
rdopt.c:check_txfm_eval:
  410|  5.19M|                                  int level, int is_luma_only) {
  411|  5.19M|  int eval_txfm = 1;
  412|       |  // Derive aggressiveness factor for gating the transform search
  413|       |  // Lower value indicates more aggressiveness. Be more conservative (high
  414|       |  // value) for (i) low quantizers (ii) regions where prediction is poor
  415|  5.19M|  const int scale[MAX_TX_RD_GATE_LEVEL + 1] = { INT_MAX, 4, 3, 2, 2, 1 };
  416|  5.19M|  const int qslope = 2 * (!is_luma_only);
  417|  5.19M|  const int level_to_qindex_map[MAX_TX_RD_GATE_LEVEL + 1] = { 0,  0,   0,
  418|  5.19M|                                                              80, 100, 140 };
  419|  5.19M|  int aggr_factor = 4;
  420|  5.19M|  assert(level <= MAX_TX_RD_GATE_LEVEL);
  421|  5.19M|  const int pred_qindex_thresh = level_to_qindex_map[level];
  422|  5.19M|  if (!is_luma_only && level <= 2) {
  ------------------
  |  Branch (422:7): [True: 5.19M, False: 18.4E]
  |  Branch (422:24): [True: 0, False: 5.19M]
  ------------------
  423|      0|    aggr_factor = 4 * AOMMAX(1, ROUND_POWER_OF_TWO((MAXQ - x->qindex) * qslope,
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  424|      0|                                                   QINDEX_BITS));
  425|      0|  }
  426|  5.19M|  if ((best_skip_rd >
  ------------------
  |  Branch (426:7): [True: 5.19M, False: 18.4E]
  ------------------
  427|  5.19M|       (x->source_variance << (num_pels_log2_lookup[bsize] + RDDIV_BITS))) &&
  ------------------
  |  |   29|  5.19M|#define RDDIV_BITS 7
  ------------------
  428|  5.19M|      (x->qindex >= pred_qindex_thresh))
  ------------------
  |  Branch (428:7): [True: 3.71M, False: 1.47M]
  ------------------
  429|  3.71M|    aggr_factor *= scale[level];
  430|       |  // For level setting 1, be more conservative for non-luma-only case even when
  431|       |  // prediction is good.
  432|  1.47M|  else if ((level <= 1) && !is_luma_only)
  ------------------
  |  Branch (432:12): [True: 0, False: 1.47M]
  |  Branch (432:28): [True: 0, False: 0]
  ------------------
  433|      0|    aggr_factor = (aggr_factor >> 2) * 6;
  434|       |
  435|       |  // Be more conservative for luma only cases (called from compound type rd)
  436|       |  // since best_skip_rd is computed after and skip_rd is computed (with 8-bit
  437|       |  // prediction signals blended for WEDGE/DIFFWTD rather than 16-bit) before
  438|       |  // interpolation filter search
  439|  5.19M|  const int luma_mul[MAX_TX_RD_GATE_LEVEL + 1] = {
  440|  5.19M|    INT_MAX, 32, 29, 17, 17, 17
  441|  5.19M|  };
  442|  5.19M|  int mul_factor = is_luma_only ? luma_mul[level] : 16;
  ------------------
  |  Branch (442:20): [True: 0, False: 5.19M]
  ------------------
  443|  5.19M|  int64_t rd_thresh =
  444|  5.19M|      (best_skip_rd == INT64_MAX)
  ------------------
  |  Branch (444:7): [True: 2.22M, False: 2.97M]
  ------------------
  445|  5.19M|          ? best_skip_rd
  446|  5.19M|          : (int64_t)(best_skip_rd * aggr_factor * mul_factor >> 6);
  447|  5.19M|  if (skip_rd > rd_thresh) eval_txfm = 0;
  ------------------
  |  Branch (447:7): [True: 329k, False: 4.86M]
  ------------------
  448|  5.19M|  return eval_txfm;
  449|  5.19M|}
rdopt.c:get_prediction_mode_idx:
  274|   115M|    MV_REFERENCE_FRAME second_ref_frame) {
  275|   115M|  if (this_mode < INTRA_MODE_END) {
  ------------------
  |  Branch (275:7): [True: 111M, False: 3.79M]
  ------------------
  276|   111M|    assert(ref_frame == INTRA_FRAME);
  277|   111M|    assert(second_ref_frame == NONE_FRAME);
  278|   111M|    return intra_to_mode_idx[this_mode - INTRA_MODE_START];
  279|   111M|  }
  280|  3.79M|  if (this_mode >= SINGLE_INTER_MODE_START &&
  ------------------
  |  Branch (280:7): [True: 3.83M, False: 18.4E]
  ------------------
  281|  3.83M|      this_mode < SINGLE_INTER_MODE_END) {
  ------------------
  |  Branch (281:7): [True: 3.83M, False: 18.4E]
  ------------------
  282|  3.83M|    assert((ref_frame > INTRA_FRAME) && (ref_frame <= ALTREF_FRAME));
  283|  3.83M|    return single_inter_to_mode_idx[this_mode - SINGLE_INTER_MODE_START]
  284|  3.83M|                                   [ref_frame];
  285|  3.83M|  }
  286|  18.4E|  if (this_mode >= COMP_INTER_MODE_START && this_mode < COMP_INTER_MODE_END &&
  ------------------
  |  Branch (286:7): [True: 0, False: 18.4E]
  |  Branch (286:45): [True: 0, False: 0]
  ------------------
  287|      0|      second_ref_frame != NONE_FRAME) {
  ------------------
  |  Branch (287:7): [True: 0, False: 0]
  ------------------
  288|      0|    assert((ref_frame > INTRA_FRAME) && (ref_frame <= ALTREF_FRAME));
  289|      0|    assert((second_ref_frame > INTRA_FRAME) &&
  290|      0|           (second_ref_frame <= ALTREF_FRAME));
  291|      0|    return comp_inter_to_mode_idx[this_mode - COMP_INTER_MODE_START][ref_frame]
  292|      0|                                 [second_ref_frame];
  293|      0|  }
  294|  18.4E|  assert(0);
  295|  18.4E|  return THR_INVALID;
  296|  18.4E|}
rdopt.c:bsize_to_num_blk:
  403|  1.91M|static inline int bsize_to_num_blk(BLOCK_SIZE bsize) {
  404|  1.91M|  int num_blk = 1 << (num_pels_log2_lookup[bsize] - 2 * MI_SIZE_LOG2);
  ------------------
  |  |   39|  1.91M|#define MI_SIZE_LOG2 2
  ------------------
  405|  1.91M|  return num_blk;
  406|  1.91M|}
rdopt.c:is_winner_mode_processing_enabled:
  508|  3.55M|                                                    int actual_txfm_skip) {
  509|  3.55M|  const SPEED_FEATURES *sf = &cpi->sf;
  510|  3.55M|  const PREDICTION_MODE best_mode = mbmi->mode;
  511|       |
  512|  3.55M|  if (bypass_winner_mode_processing(x, sf, mbmi->skip_txfm, actual_txfm_skip,
  ------------------
  |  Branch (512:7): [True: 94.0k, False: 3.45M]
  ------------------
  513|  3.55M|                                    best_mode))
  514|  94.0k|    return 0;
  515|       |
  516|       |  // TODO(any): Move block independent condition checks to frame level
  517|  3.45M|  if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (517:7): [True: 314k, False: 3.14M]
  ------------------
  518|   314k|    if (is_inter_mode(best_mode) &&
  ------------------
  |  Branch (518:9): [True: 314k, False: 18.4E]
  ------------------
  519|   314k|        (sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh != INT_MAX) &&
  ------------------
  |  Branch (519:9): [True: 314k, False: 0]
  ------------------
  520|   314k|        !cpi->oxcf.txfm_cfg.use_inter_dct_only)
  ------------------
  |  Branch (520:9): [True: 314k, False: 1]
  ------------------
  521|   314k|      return 1;
  522|  3.14M|  } else {
  523|  3.14M|    if (sf->tx_sf.tx_type_search.fast_intra_tx_type_search &&
  ------------------
  |  Branch (523:9): [True: 3.14M, False: 18.4E]
  ------------------
  524|  3.14M|        !cpi->oxcf.txfm_cfg.use_intra_default_tx_only &&
  ------------------
  |  Branch (524:9): [True: 3.14M, False: 18.4E]
  ------------------
  525|  3.14M|        !cpi->oxcf.txfm_cfg.use_intra_dct_only)
  ------------------
  |  Branch (525:9): [True: 3.14M, False: 18.4E]
  ------------------
  526|  3.14M|      return 1;
  527|  3.14M|  }
  528|       |
  529|       |  // Check speed feature related to winner mode processing
  530|  18.4E|  if (sf->winner_mode_sf.enable_winner_mode_for_coeff_opt &&
  ------------------
  |  Branch (530:7): [True: 0, False: 18.4E]
  ------------------
  531|      0|      cpi->optimize_seg_arr[mbmi->segment_id] != NO_TRELLIS_OPT &&
  ------------------
  |  Branch (531:7): [True: 0, False: 0]
  ------------------
  532|      0|      cpi->optimize_seg_arr[mbmi->segment_id] != FINAL_PASS_TRELLIS_OPT)
  ------------------
  |  Branch (532:7): [True: 0, False: 0]
  ------------------
  533|      0|    return 1;
  534|  18.4E|  if (sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch) return 1;
  ------------------
  |  Branch (534:7): [True: 0, False: 18.4E]
  ------------------
  535|       |
  536|  18.4E|  return 0;
  537|  18.4E|}
rdopt.c:bypass_winner_mode_processing:
  468|  3.55M|                                                PREDICTION_MODE best_mode) {
  469|  3.55M|  const int prune_winner_mode_eval_level =
  470|  3.55M|      sf->winner_mode_sf.prune_winner_mode_eval_level;
  471|       |
  472|       |  // Disable winner mode processing for blocks with low source variance.
  473|       |  // The aggressiveness of this pruning logic reduces as qindex increases.
  474|       |  // The threshold decreases linearly from 64 as qindex varies from 0 to 255.
  475|  3.55M|  if (prune_winner_mode_eval_level == 1) {
  ------------------
  |  Branch (475:7): [True: 0, False: 3.55M]
  ------------------
  476|      0|    const unsigned int src_var_thresh = 64 - 48 * x->qindex / (MAXQ + 1);
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
  477|      0|    if (x->source_variance < src_var_thresh) return 1;
  ------------------
  |  Branch (477:9): [True: 0, False: 0]
  ------------------
  478|  3.55M|  } else if (prune_winner_mode_eval_level == 2) {
  ------------------
  |  Branch (478:14): [True: 0, False: 3.55M]
  ------------------
  479|       |    // Skip winner mode processing of blocks for which transform turns out to be
  480|       |    // skip due to nature of eob alone except NEWMV mode.
  481|      0|    if (!have_newmv_in_inter_mode(best_mode) && actual_txfm_skip) return 1;
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  |  Branch (481:49): [True: 0, False: 0]
  ------------------
  482|  3.55M|  } else if (prune_winner_mode_eval_level == 3) {
  ------------------
  |  Branch (482:14): [True: 0, False: 3.55M]
  ------------------
  483|       |    // Skip winner mode processing of blocks for which transform turns out to be
  484|       |    // skip except NEWMV mode and considered based on the quantizer.
  485|       |    // At high quantizers: Take conservative approach by considering transform
  486|       |    // skip based on eob alone.
  487|       |    // At low quantizers: Consider transform skip based on eob nature or RD cost
  488|       |    // evaluation.
  489|      0|    const int is_txfm_skip =
  490|      0|        x->qindex > 127 ? actual_txfm_skip : actual_txfm_skip || use_txfm_skip;
  ------------------
  |  Branch (490:9): [True: 0, False: 0]
  |  Branch (490:46): [True: 0, False: 0]
  |  Branch (490:66): [True: 0, False: 0]
  ------------------
  491|       |
  492|      0|    if (!have_newmv_in_inter_mode(best_mode) && is_txfm_skip) return 1;
  ------------------
  |  Branch (492:9): [True: 0, False: 0]
  |  Branch (492:49): [True: 0, False: 0]
  ------------------
  493|  3.55M|  } else if (prune_winner_mode_eval_level >= 4) {
  ------------------
  |  Branch (493:14): [True: 3.55M, False: 18.4E]
  ------------------
  494|       |    // Do not skip winner mode evaluation at low quantizers if normal mode's
  495|       |    // transform search was too aggressive.
  496|  3.55M|    if (sf->rd_sf.perform_coeff_opt >= 5 && x->qindex <= 70) return 0;
  ------------------
  |  Branch (496:9): [True: 3.55M, False: 18.4E]
  |  Branch (496:45): [True: 833k, False: 2.71M]
  ------------------
  497|       |
  498|  2.71M|    if (use_txfm_skip || actual_txfm_skip) return 1;
  ------------------
  |  Branch (498:9): [True: 93.7k, False: 2.62M]
  |  Branch (498:26): [True: 103, False: 2.62M]
  ------------------
  499|  2.71M|  }
  500|       |
  501|  2.62M|  return 0;
  502|  3.55M|}
nonrd_pickmode.c:av1_copy_usable_ref_mv_stack_and_weight:
  879|   599k|    MV_REFERENCE_FRAME ref_frame) {
  880|   599k|  memcpy(mbmi_ext->weight[ref_frame], xd->weight[ref_frame],
  881|   599k|         USABLE_REF_MV_STACK_SIZE * sizeof(xd->weight[0][0]));
  ------------------
  |  |  511|   599k|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  882|   599k|  memcpy(mbmi_ext->ref_mv_stack[ref_frame], xd->ref_mv_stack[ref_frame],
  883|   599k|         USABLE_REF_MV_STACK_SIZE * sizeof(xd->ref_mv_stack[0][0]));
  ------------------
  |  |  511|   599k|#define USABLE_REF_MV_STACK_SIZE 4
  ------------------
  884|   599k|}
nonrd_pickmode.c:is_mode_intra:
  870|   598k|static inline int is_mode_intra(PREDICTION_MODE mode) {
  871|   598k|  return mode < INTRA_MODE_END;
  872|   598k|}
tx_search.c:get_visible_dimensions:
  365|   129M|                                         int *visible_rows) {
  366|   129M|  if ((x->pix_to_bottom_edge >= 0 && x->pix_to_right_edge >= 0) || !clip_dims) {
  ------------------
  |  Branch (366:8): [True: 127M, False: 1.80M]
  |  Branch (366:38): [True: 126M, False: 1.23M]
  |  Branch (366:68): [True: 0, False: 3.12M]
  ------------------
  367|   126M|    if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (367:9): [True: 125M, False: 836k]
  |  Branch (367:33): [True: 125M, False: 18.4E]
  ------------------
  368|   125M|      *visible_rows = rows;
  369|   125M|      *visible_cols = cols;
  370|   125M|    }
  371|   126M|    return 0;
  372|   126M|  }
  373|  3.01M|  const MACROBLOCKD *const xd = &x->e_mbd;
  374|  3.01M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  375|  3.01M|  int valid_cols, valid_rows;
  376|       |
  377|  3.01M|  if (x->pix_to_bottom_edge >= 0) {
  ------------------
  |  Branch (377:7): [True: 1.27M, False: 1.74M]
  ------------------
  378|  1.27M|    valid_rows = rows;
  379|  1.74M|  } else {
  380|  1.74M|    const int block_height = block_size_high[plane_bsize];
  381|  1.74M|    const int block_rows =
  382|  1.74M|        -ROUND_POWER_OF_TWO(-x->pix_to_bottom_edge, pd->subsampling_y) +
  ------------------
  |  |   41|  1.74M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  383|  1.74M|        block_height;
  384|  1.74M|    valid_rows = clamp(block_rows - (blk_row << MI_SIZE_LOG2), 0, rows);
  ------------------
  |  |   39|  1.74M|#define MI_SIZE_LOG2 2
  ------------------
  385|  1.74M|  }
  386|       |
  387|  3.01M|  if (x->pix_to_right_edge >= 0) {
  ------------------
  |  Branch (387:7): [True: 1.35M, False: 1.66M]
  ------------------
  388|  1.35M|    valid_cols = cols;
  389|  1.66M|  } else {
  390|  1.66M|    const int block_width = block_size_wide[plane_bsize];
  391|  1.66M|    const int block_cols =
  392|  1.66M|        -ROUND_POWER_OF_TWO(-x->pix_to_right_edge, pd->subsampling_x) +
  ------------------
  |  |   41|  1.66M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  393|  1.66M|        block_width;
  394|  1.66M|    valid_cols = clamp(block_cols - (blk_col << MI_SIZE_LOG2), 0, cols);
  ------------------
  |  |   39|  1.66M|#define MI_SIZE_LOG2 2
  ------------------
  395|  1.66M|  }
  396|  3.01M|  if (visible_cols != NULL && visible_rows != NULL) {
  ------------------
  |  Branch (396:7): [True: 2.28M, False: 733k]
  |  Branch (396:31): [True: 2.28M, False: 18.4E]
  ------------------
  397|  2.28M|    *visible_cols = valid_cols;
  398|  2.28M|    *visible_rows = valid_rows;
  399|  2.28M|  }
  400|  3.01M|  return (valid_cols < cols || valid_rows < rows);
  ------------------
  |  Branch (400:11): [True: 1.06M, False: 1.95M]
  |  Branch (400:32): [True: 954k, False: 998k]
  ------------------
  401|   129M|}
tx_search.c:bsize_to_num_blk:
  403|  27.7M|static inline int bsize_to_num_blk(BLOCK_SIZE bsize) {
  404|  27.7M|  int num_blk = 1 << (num_pels_log2_lookup[bsize] - 2 * MI_SIZE_LOG2);
  ------------------
  |  |   39|  27.7M|#define MI_SIZE_LOG2 2
  ------------------
  405|  27.7M|  return num_blk;
  406|  27.7M|}
intra_mode_search.c:init_sbuv_mode:
  779|  1.05M|static inline void init_sbuv_mode(MB_MODE_INFO *const mbmi) {
  780|  1.05M|  mbmi->uv_mode = UV_DC_PRED;
  781|  1.05M|  mbmi->palette_mode_info.palette_size[1] = 0;
  782|  1.05M|}
intra_mode_search.c:store_cfl_required_rdo:
  760|   934k|                                                      const MACROBLOCK *x) {
  761|   934k|  const MACROBLOCKD *xd = &x->e_mbd;
  762|       |
  763|   934k|  if (cm->seq_params->monochrome || !xd->is_chroma_ref) return CFL_DISALLOWED;
  ------------------
  |  Branch (763:7): [True: 52, False: 934k]
  |  Branch (763:37): [True: 0, False: 934k]
  ------------------
  764|       |
  765|   934k|  if (!xd->is_chroma_ref) {
  ------------------
  |  Branch (765:7): [True: 0, False: 934k]
  ------------------
  766|       |    // For non-chroma-reference blocks, we should always store the luma pixels,
  767|       |    // in case the corresponding chroma-reference block uses CfL.
  768|       |    // Note that this can only happen for block sizes which are <8 on
  769|       |    // their shortest side, as otherwise they would be chroma reference
  770|       |    // blocks.
  771|      0|    return CFL_ALLOWED;
  772|      0|  }
  773|       |
  774|       |  // For chroma reference blocks, we should store data in the encoder iff we're
  775|       |  // allowed to try out CfL.
  776|   934k|  return is_cfl_allowed(xd);
  777|   934k|}
intra_mode_search.c:set_mode_eval_params:
  609|   820k|                                        MODE_EVAL_TYPE mode_eval_type) {
  610|   820k|  const AV1_COMMON *cm = &cpi->common;
  611|   820k|  const SPEED_FEATURES *sf = &cpi->sf;
  612|   820k|  const WinnerModeParams *winner_mode_params = &cpi->winner_mode_params;
  613|   820k|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
  614|       |
  615|   820k|  txfm_params->use_qm_dist_metric =
  616|   820k|      cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR;
  617|       |
  618|   820k|  switch (mode_eval_type) {
  619|      0|    case DEFAULT_EVAL:
  ------------------
  |  Branch (619:5): [True: 0, False: 820k]
  ------------------
  620|      0|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  621|      0|      txfm_params->use_default_intra_tx_type = 0;
  622|      0|      txfm_params->use_derived_intra_tx_type_set = 0;
  623|      0|      txfm_params->skip_txfm_level =
  624|      0|          winner_mode_params->skip_txfm_level[DEFAULT_EVAL];
  625|      0|      txfm_params->predict_dc_level =
  626|      0|          winner_mode_params->predict_dc_level[DEFAULT_EVAL];
  627|       |      // Set default transform domain distortion type
  628|      0|      set_tx_domain_dist_params(winner_mode_params, txfm_params, 0, 0);
  629|       |
  630|       |      // Get default threshold for R-D optimization of coefficients
  631|      0|      get_rd_opt_coeff_thresh(winner_mode_params->coeff_opt_thresholds,
  632|      0|                              txfm_params, 0, 0);
  633|       |
  634|       |      // Set default transform size search method
  635|      0|      set_tx_size_search_method(cm, winner_mode_params, txfm_params, 0, 0);
  636|       |      // Set default transform type prune
  637|      0|      set_tx_type_prune(sf, txfm_params, 0, 0);
  638|      0|      break;
  639|   439k|    case MODE_EVAL:
  ------------------
  |  Branch (639:5): [True: 439k, False: 381k]
  ------------------
  640|   439k|      txfm_params->use_default_intra_tx_type =
  641|   439k|          (cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 2 ||
  ------------------
  |  Branch (641:12): [True: 68.7k, False: 371k]
  ------------------
  642|   371k|           cpi->oxcf.txfm_cfg.use_intra_default_tx_only);
  ------------------
  |  Branch (642:12): [True: 18.4E, False: 371k]
  ------------------
  643|   439k|      txfm_params->use_derived_intra_tx_type_set =
  644|   439k|          cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 1;
  645|   439k|      txfm_params->default_inter_tx_type_prob_thresh =
  646|   439k|          cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh;
  647|   439k|      txfm_params->skip_txfm_level =
  648|   439k|          winner_mode_params->skip_txfm_level[MODE_EVAL];
  649|   439k|      txfm_params->predict_dc_level =
  650|   439k|          winner_mode_params->predict_dc_level[MODE_EVAL];
  651|       |      // Set transform domain distortion type for mode evaluation
  652|   439k|      set_tx_domain_dist_params(
  653|   439k|          winner_mode_params, txfm_params,
  654|   439k|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 0);
  655|       |
  656|       |      // Get threshold for R-D optimization of coefficients during mode
  657|       |      // evaluation
  658|   439k|      get_rd_opt_coeff_thresh(
  659|   439k|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  660|   439k|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 0);
  661|       |
  662|       |      // Set the transform size search method for mode evaluation
  663|   439k|      set_tx_size_search_method(
  664|   439k|          cm, winner_mode_params, txfm_params,
  665|   439k|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 0);
  666|       |      // Set transform type prune for mode evaluation
  667|   439k|      set_tx_type_prune(sf, txfm_params,
  668|   439k|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  669|   439k|                        0);
  670|   439k|      break;
  671|   381k|    case WINNER_MODE_EVAL:
  ------------------
  |  Branch (671:5): [True: 381k, False: 439k]
  ------------------
  672|   381k|      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
  673|   381k|      txfm_params->use_default_intra_tx_type = 0;
  674|   381k|      txfm_params->use_derived_intra_tx_type_set = 0;
  675|   381k|      txfm_params->skip_txfm_level =
  676|   381k|          winner_mode_params->skip_txfm_level[WINNER_MODE_EVAL];
  677|   381k|      txfm_params->predict_dc_level =
  678|   381k|          winner_mode_params->predict_dc_level[WINNER_MODE_EVAL];
  679|       |
  680|       |      // Set transform domain distortion type for winner mode evaluation
  681|   381k|      set_tx_domain_dist_params(
  682|   381k|          winner_mode_params, txfm_params,
  683|   381k|          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 1);
  684|       |
  685|       |      // Get threshold for R-D optimization of coefficients for winner mode
  686|       |      // evaluation
  687|   381k|      get_rd_opt_coeff_thresh(
  688|   381k|          winner_mode_params->coeff_opt_thresholds, txfm_params,
  689|   381k|          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 1);
  690|       |
  691|       |      // Set the transform size search method for winner mode evaluation
  692|   381k|      set_tx_size_search_method(
  693|   381k|          cm, winner_mode_params, txfm_params,
  694|   381k|          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1);
  695|       |      // Set default transform type prune mode for winner mode evaluation
  696|   381k|      set_tx_type_prune(sf, txfm_params,
  697|   381k|                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
  698|   381k|                        1);
  699|   381k|      break;
  700|      0|    default: assert(0);
  ------------------
  |  Branch (700:5): [True: 0, False: 820k]
  ------------------
  701|   820k|  }
  702|       |
  703|       |  // Rd record collected at a specific mode evaluation stage can not be used
  704|       |  // across other evaluation stages as the transform parameters are different.
  705|       |  // Hence, reset mb rd record whenever mode evaluation stage type changes.
  706|   820k|  if (txfm_params->mode_eval_type != mode_eval_type)
  ------------------
  |  Branch (706:7): [True: 820k, False: 18.4E]
  ------------------
  707|   820k|    reset_mb_rd_record(x->txfm_search_info.mb_rd_record);
  708|       |
  709|   820k|  txfm_params->mode_eval_type = mode_eval_type;
  710|   820k|}
intra_mode_search.c:set_tx_domain_dist_params:
  576|   820k|    int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) {
  577|   820k|  if (txfm_params->use_qm_dist_metric) {
  ------------------
  |  Branch (577:7): [True: 594k, False: 226k]
  ------------------
  578|       |    // QM-weighted PSNR is computed in transform space, so we need to forcibly
  579|       |    // enable the use of tx domain distortion.
  580|   594k|    txfm_params->use_transform_domain_distortion = 1;
  581|   594k|    txfm_params->tx_domain_dist_threshold = 0;
  582|   594k|    return;
  583|   594k|  }
  584|       |
  585|   226k|  if (!enable_winner_mode_for_tx_domain_dist) {
  ------------------
  |  Branch (585:7): [True: 51.6k, False: 174k]
  ------------------
  586|  51.6k|    txfm_params->use_transform_domain_distortion =
  587|  51.6k|        winner_mode_params->use_transform_domain_distortion[DEFAULT_EVAL];
  588|  51.6k|    txfm_params->tx_domain_dist_threshold =
  589|  51.6k|        winner_mode_params->tx_domain_dist_threshold[DEFAULT_EVAL];
  590|  51.6k|    return;
  591|  51.6k|  }
  592|       |
  593|   174k|  if (is_winner_mode) {
  ------------------
  |  Branch (593:7): [True: 74.6k, False: 100k]
  ------------------
  594|  74.6k|    txfm_params->use_transform_domain_distortion =
  595|  74.6k|        winner_mode_params->use_transform_domain_distortion[WINNER_MODE_EVAL];
  596|  74.6k|    txfm_params->tx_domain_dist_threshold =
  597|  74.6k|        winner_mode_params->tx_domain_dist_threshold[WINNER_MODE_EVAL];
  598|   100k|  } else {
  599|   100k|    txfm_params->use_transform_domain_distortion =
  600|   100k|        winner_mode_params->use_transform_domain_distortion[MODE_EVAL];
  601|   100k|    txfm_params->tx_domain_dist_threshold =
  602|   100k|        winner_mode_params->tx_domain_dist_threshold[MODE_EVAL];
  603|   100k|  }
  604|   174k|}
intra_mode_search.c:set_tx_size_search_method:
  542|   820k|    int is_winner_mode) {
  543|       |  // Populate transform size search method/transform mode appropriately
  544|   820k|  txfm_params->tx_size_search_method =
  545|   820k|      winner_mode_params->tx_size_search_methods[DEFAULT_EVAL];
  546|   820k|  if (enable_winner_mode_for_tx_size_srch) {
  ------------------
  |  Branch (546:7): [True: 820k, False: 18.4E]
  ------------------
  547|   820k|    if (is_winner_mode)
  ------------------
  |  Branch (547:9): [True: 381k, False: 439k]
  ------------------
  548|   381k|      txfm_params->tx_size_search_method =
  549|   381k|          winner_mode_params->tx_size_search_methods[WINNER_MODE_EVAL];
  550|   439k|    else
  551|   439k|      txfm_params->tx_size_search_method =
  552|   439k|          winner_mode_params->tx_size_search_methods[MODE_EVAL];
  553|   820k|  }
  554|   820k|  txfm_params->tx_mode_search_type =
  555|   820k|      select_tx_mode(cm, txfm_params->tx_size_search_method);
  556|   820k|}
intra_mode_search.c:select_tx_mode:
  452|   820k|    const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) {
  453|   820k|  if (cm->features.coded_lossless) return ONLY_4X4;
  ------------------
  |  Branch (453:7): [True: 27.7k, False: 792k]
  ------------------
  454|   792k|  if (tx_size_search_method == USE_LARGESTALL) {
  ------------------
  |  Branch (454:7): [True: 425k, False: 367k]
  ------------------
  455|   425k|    return TX_MODE_LARGEST;
  456|   425k|  } else {
  457|       |    assert(tx_size_search_method == USE_FULL_RD ||
  458|   367k|           tx_size_search_method == USE_FAST_RD);
  459|   367k|    return TX_MODE_SELECT;
  460|   367k|  }
  461|   792k|}
intra_mode_search.c:set_tx_type_prune:
  561|   820k|                                     int is_winner_mode) {
  562|       |  // Populate prune transform mode appropriately
  563|   820k|  txfm_params->prune_2d_txfm_mode = sf->tx_sf.tx_type_search.prune_2d_txfm_mode;
  564|   820k|  if (!winner_mode_tx_type_pruning) return;
  ------------------
  |  Branch (564:7): [True: 0, False: 820k]
  ------------------
  565|       |
  566|   820k|  const int prune_mode[4][2] = { { TX_TYPE_PRUNE_3, TX_TYPE_PRUNE_0 },
  567|   820k|                                 { TX_TYPE_PRUNE_4, TX_TYPE_PRUNE_0 },
  568|   820k|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_2 },
  569|   820k|                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_3 } };
  570|   820k|  txfm_params->prune_2d_txfm_mode =
  571|   820k|      prune_mode[winner_mode_tx_type_pruning - 1][is_winner_mode];
  572|   820k|}
intra_mode_search.c:store_winner_mode_stats:
  789|  1.81M|    int multi_winner_mode_type, int txfm_search_done) {
  790|  1.81M|  const AV1_COMMON *const cm = &cpi->common;
  791|  1.81M|  WinnerModeStats *winner_mode_stats = x->winner_mode_stats;
  792|  1.81M|  int mode_idx = 0;
  793|  1.81M|  int is_palette_mode = mbmi->palette_mode_info.palette_size[PLANE_TYPE_Y] > 0;
  794|       |  // Mode stat is not required when multiwinner mode processing is disabled
  795|  1.81M|  if (multi_winner_mode_type == MULTI_WINNER_MODE_OFF) return;
  ------------------
  |  Branch (795:7): [True: 1.81M, False: 18.4E]
  ------------------
  796|       |  // Ignore mode with maximum rd
  797|  18.4E|  if (this_rd == INT64_MAX) return;
  ------------------
  |  Branch (797:7): [True: 0, False: 18.4E]
  ------------------
  798|       |  // TODO(any): Winner mode processing is currently not applicable for palette
  799|       |  // mode in Inter frames. Clean-up the following code, once support is added
  800|  18.4E|  if (!frame_is_intra_only(cm) && is_palette_mode) return;
  ------------------
  |  Branch (800:7): [True: 0, False: 18.4E]
  |  Branch (800:35): [True: 0, False: 0]
  ------------------
  801|       |
  802|  18.4E|  int max_winner_mode_count = winner_mode_count_allowed[multi_winner_mode_type];
  803|  18.4E|  assert(x->winner_mode_count >= 0 &&
  804|  18.4E|         x->winner_mode_count <= max_winner_mode_count);
  805|       |
  806|  18.4E|  if (x->winner_mode_count) {
  ------------------
  |  Branch (806:7): [True: 0, False: 18.4E]
  ------------------
  807|       |    // Find the mode which has higher rd cost than this_rd
  808|      0|    for (mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++)
  ------------------
  |  Branch (808:24): [True: 0, False: 0]
  ------------------
  809|      0|      if (winner_mode_stats[mode_idx].rd > this_rd) break;
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|       |
  811|      0|    if (mode_idx == max_winner_mode_count) {
  ------------------
  |  Branch (811:9): [True: 0, False: 0]
  ------------------
  812|       |      // No mode has higher rd cost than this_rd
  813|      0|      return;
  814|      0|    } else if (mode_idx < max_winner_mode_count - 1) {
  ------------------
  |  Branch (814:16): [True: 0, False: 0]
  ------------------
  815|       |      // Create a slot for current mode and move others to the next slot
  816|      0|      memmove(
  817|      0|          &winner_mode_stats[mode_idx + 1], &winner_mode_stats[mode_idx],
  818|      0|          (max_winner_mode_count - mode_idx - 1) * sizeof(*winner_mode_stats));
  819|      0|    }
  820|      0|  }
  821|       |  // Add a mode stat for winner mode processing
  822|  18.4E|  winner_mode_stats[mode_idx].mbmi = *mbmi;
  823|  18.4E|  winner_mode_stats[mode_idx].rd = this_rd;
  824|  18.4E|  winner_mode_stats[mode_idx].mode_index = mode_index;
  825|       |
  826|       |  // Update rd stats required for inter frame
  827|  18.4E|  if (!frame_is_intra_only(cm) && rd_cost && rd_cost_y && rd_cost_uv) {
  ------------------
  |  Branch (827:7): [True: 0, False: 18.4E]
  |  Branch (827:35): [True: 0, False: 0]
  |  Branch (827:46): [True: 0, False: 0]
  |  Branch (827:59): [True: 0, False: 0]
  ------------------
  828|      0|    const MACROBLOCKD *xd = &x->e_mbd;
  829|      0|    const int skip_ctx = av1_get_skip_txfm_context(xd);
  830|      0|    const int is_intra_mode = av1_mode_defs[mode_index].mode < INTRA_MODE_END;
  831|      0|    const int skip_txfm = mbmi->skip_txfm && !is_intra_mode;
  ------------------
  |  Branch (831:27): [True: 0, False: 0]
  |  Branch (831:46): [True: 0, False: 0]
  ------------------
  832|       |
  833|      0|    winner_mode_stats[mode_idx].rd_cost = *rd_cost;
  834|      0|    if (txfm_search_done) {
  ------------------
  |  Branch (834:9): [True: 0, False: 0]
  ------------------
  835|      0|      const int skip_rate =
  836|      0|          x->mode_costs
  837|      0|              .skip_txfm_cost[skip_ctx][rd_cost->skip_txfm || skip_txfm];
  ------------------
  |  Branch (837:41): [True: 0, False: 0]
  |  Branch (837:63): [True: 0, False: 0]
  ------------------
  838|      0|      const int scaled_skip_rate =
  839|      0|          increase_motion_mode_rate(cpi, mbmi, skip_rate);
  840|      0|      winner_mode_stats[mode_idx].rate_y = rd_cost_y->rate + scaled_skip_rate;
  841|      0|      winner_mode_stats[mode_idx].rate_uv = rd_cost_uv->rate;
  842|      0|    }
  843|      0|  }
  844|       |
  845|  18.4E|  if (color_map) {
  ------------------
  |  Branch (845:7): [True: 0, False: 18.4E]
  ------------------
  846|       |    // Store color_index_map for palette mode
  847|      0|    const MACROBLOCKD *const xd = &x->e_mbd;
  848|      0|    int block_width, block_height;
  849|      0|    av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  850|      0|                             &block_height, NULL, NULL);
  851|      0|    memcpy(winner_mode_stats[mode_idx].color_index_map, color_map,
  852|      0|           block_width * block_height * sizeof(color_map[0]));
  853|      0|  }
  854|       |
  855|  18.4E|  x->winner_mode_count =
  856|  18.4E|      AOMMIN(x->winner_mode_count + 1, max_winner_mode_count);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  857|  18.4E|}
intra_mode_search.c:is_winner_mode_processing_enabled:
  508|   381k|                                                    int actual_txfm_skip) {
  509|   381k|  const SPEED_FEATURES *sf = &cpi->sf;
  510|   381k|  const PREDICTION_MODE best_mode = mbmi->mode;
  511|       |
  512|   381k|  if (bypass_winner_mode_processing(x, sf, mbmi->skip_txfm, actual_txfm_skip,
  ------------------
  |  Branch (512:7): [True: 0, False: 381k]
  ------------------
  513|   381k|                                    best_mode))
  514|      0|    return 0;
  515|       |
  516|       |  // TODO(any): Move block independent condition checks to frame level
  517|   381k|  if (is_inter_block(mbmi)) {
  ------------------
  |  Branch (517:7): [True: 0, False: 381k]
  ------------------
  518|      0|    if (is_inter_mode(best_mode) &&
  ------------------
  |  Branch (518:9): [True: 0, False: 0]
  ------------------
  519|      0|        (sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh != INT_MAX) &&
  ------------------
  |  Branch (519:9): [True: 0, False: 0]
  ------------------
  520|      0|        !cpi->oxcf.txfm_cfg.use_inter_dct_only)
  ------------------
  |  Branch (520:9): [True: 0, False: 0]
  ------------------
  521|      0|      return 1;
  522|   381k|  } else {
  523|   381k|    if (sf->tx_sf.tx_type_search.fast_intra_tx_type_search &&
  ------------------
  |  Branch (523:9): [True: 381k, False: 18.4E]
  ------------------
  524|   381k|        !cpi->oxcf.txfm_cfg.use_intra_default_tx_only &&
  ------------------
  |  Branch (524:9): [True: 381k, False: 18.4E]
  ------------------
  525|   381k|        !cpi->oxcf.txfm_cfg.use_intra_dct_only)
  ------------------
  |  Branch (525:9): [True: 381k, False: 18.4E]
  ------------------
  526|   381k|      return 1;
  527|   381k|  }
  528|       |
  529|       |  // Check speed feature related to winner mode processing
  530|  18.4E|  if (sf->winner_mode_sf.enable_winner_mode_for_coeff_opt &&
  ------------------
  |  Branch (530:7): [True: 0, False: 18.4E]
  ------------------
  531|      0|      cpi->optimize_seg_arr[mbmi->segment_id] != NO_TRELLIS_OPT &&
  ------------------
  |  Branch (531:7): [True: 0, False: 0]
  ------------------
  532|      0|      cpi->optimize_seg_arr[mbmi->segment_id] != FINAL_PASS_TRELLIS_OPT)
  ------------------
  |  Branch (532:7): [True: 0, False: 0]
  ------------------
  533|      0|    return 1;
  534|  18.4E|  if (sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch) return 1;
  ------------------
  |  Branch (534:7): [True: 0, False: 18.4E]
  ------------------
  535|       |
  536|  18.4E|  return 0;
  537|  18.4E|}
intra_mode_search.c:bypass_winner_mode_processing:
  468|   381k|                                                PREDICTION_MODE best_mode) {
  469|   381k|  const int prune_winner_mode_eval_level =
  470|   381k|      sf->winner_mode_sf.prune_winner_mode_eval_level;
  471|       |
  472|       |  // Disable winner mode processing for blocks with low source variance.
  473|       |  // The aggressiveness of this pruning logic reduces as qindex increases.
  474|       |  // The threshold decreases linearly from 64 as qindex varies from 0 to 255.
  475|   381k|  if (prune_winner_mode_eval_level == 1) {
  ------------------
  |  Branch (475:7): [True: 0, False: 381k]
  ------------------
  476|      0|    const unsigned int src_var_thresh = 64 - 48 * x->qindex / (MAXQ + 1);
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
  477|      0|    if (x->source_variance < src_var_thresh) return 1;
  ------------------
  |  Branch (477:9): [True: 0, False: 0]
  ------------------
  478|   381k|  } else if (prune_winner_mode_eval_level == 2) {
  ------------------
  |  Branch (478:14): [True: 0, False: 381k]
  ------------------
  479|       |    // Skip winner mode processing of blocks for which transform turns out to be
  480|       |    // skip due to nature of eob alone except NEWMV mode.
  481|      0|    if (!have_newmv_in_inter_mode(best_mode) && actual_txfm_skip) return 1;
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  |  Branch (481:49): [True: 0, False: 0]
  ------------------
  482|   381k|  } else if (prune_winner_mode_eval_level == 3) {
  ------------------
  |  Branch (482:14): [True: 0, False: 381k]
  ------------------
  483|       |    // Skip winner mode processing of blocks for which transform turns out to be
  484|       |    // skip except NEWMV mode and considered based on the quantizer.
  485|       |    // At high quantizers: Take conservative approach by considering transform
  486|       |    // skip based on eob alone.
  487|       |    // At low quantizers: Consider transform skip based on eob nature or RD cost
  488|       |    // evaluation.
  489|      0|    const int is_txfm_skip =
  490|      0|        x->qindex > 127 ? actual_txfm_skip : actual_txfm_skip || use_txfm_skip;
  ------------------
  |  Branch (490:9): [True: 0, False: 0]
  |  Branch (490:46): [True: 0, False: 0]
  |  Branch (490:66): [True: 0, False: 0]
  ------------------
  491|       |
  492|      0|    if (!have_newmv_in_inter_mode(best_mode) && is_txfm_skip) return 1;
  ------------------
  |  Branch (492:9): [True: 0, False: 0]
  |  Branch (492:49): [True: 0, False: 0]
  ------------------
  493|   381k|  } else if (prune_winner_mode_eval_level >= 4) {
  ------------------
  |  Branch (493:14): [True: 0, False: 381k]
  ------------------
  494|       |    // Do not skip winner mode evaluation at low quantizers if normal mode's
  495|       |    // transform search was too aggressive.
  496|      0|    if (sf->rd_sf.perform_coeff_opt >= 5 && x->qindex <= 70) return 0;
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  |  Branch (496:45): [True: 0, False: 0]
  ------------------
  497|       |
  498|      0|    if (use_txfm_skip || actual_txfm_skip) return 1;
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  |  Branch (498:26): [True: 0, False: 0]
  ------------------
  499|      0|  }
  500|       |
  501|   381k|  return 0;
  502|   381k|}

av1_enc_build_one_inter_predictor:
   50|  41.5M|                                       InterPredParams *inter_pred_params) {
   51|  41.5M|  build_one_inter_predictor(dst, dst_stride, src_mv, inter_pred_params);
   52|  41.5M|}
av1_enc_build_inter_predictor_y_nonrd:
   87|  3.60M|                                           const SubpelParams *subpel_params) {
   88|  3.60M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
  ------------------
  |  |  281|  3.60M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
   89|       |
   90|  3.60M|  const MB_MODE_INFO *mbmi = xd->mi[0];
   91|  3.60M|  struct buf_2d *const dst_buf = &pd->dst;
   92|  3.60M|  const struct buf_2d *pre_buf = &pd->pre[0];
   93|  3.60M|  const uint8_t *src =
   94|  3.60M|      pre_buf->buf0 +
   95|  3.60M|      (subpel_params->pos_y >> SCALE_SUBPEL_BITS) * pre_buf->stride +
  ------------------
  |  |   28|  3.60M|#define SCALE_SUBPEL_BITS 10
  ------------------
   96|  3.60M|      (subpel_params->pos_x >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|  3.60M|#define SCALE_SUBPEL_BITS 10
  ------------------
   97|  3.60M|  uint8_t *const dst = dst_buf->buf;
   98|  3.60M|  int src_stride = pre_buf->stride;
   99|  3.60M|  int dst_stride = dst_buf->stride;
  100|  3.60M|  inter_pred_params->ref_frame_buf = *pre_buf;
  101|       |
  102|       |  // Initialize interp filter for single reference mode.
  103|  3.60M|  init_interp_filter_params(inter_pred_params->interp_filter_params,
  104|  3.60M|                            &mbmi->interp_filters.as_filters, pd->width,
  105|  3.60M|                            pd->height, /*is_intrabc=*/0);
  106|       |
  107|  3.60M|  av1_make_inter_predictor(src, src_stride, dst, dst_stride, inter_pred_params,
  108|  3.60M|                           subpel_params);
  109|  3.60M|}
av1_enc_build_inter_predictor:
  114|  8.17M|                                   int plane_from, int plane_to) {
  115|  21.7M|  for (int plane = plane_from; plane <= plane_to; ++plane) {
  ------------------
  |  Branch (115:32): [True: 13.9M, False: 7.80M]
  ------------------
  116|  13.9M|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (116:9): [True: 6.92M, False: 6.99M]
  |  Branch (116:18): [True: 368k, False: 6.55M]
  ------------------
  117|  13.5M|    const int mi_x = mi_col * MI_SIZE;
  ------------------
  |  |   40|  13.5M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  13.5M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  118|  13.5M|    const int mi_y = mi_row * MI_SIZE;
  ------------------
  |  |   40|  13.5M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  13.5M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  119|  13.5M|    enc_build_inter_predictors(cm, xd, plane, xd->mi[0], xd->plane[plane].width,
  120|  13.5M|                               xd->plane[plane].height, mi_x, mi_y);
  121|       |
  122|  13.5M|    if (is_interintra_pred(xd->mi[0])) {
  ------------------
  |  Branch (122:9): [True: 0, False: 13.5M]
  ------------------
  123|      0|      BUFFER_SET default_ctx = {
  124|      0|        { xd->plane[0].dst.buf, xd->plane[1].dst.buf, xd->plane[2].dst.buf },
  125|      0|        { xd->plane[0].dst.stride, xd->plane[1].dst.stride,
  126|      0|          xd->plane[2].dst.stride }
  127|      0|      };
  128|      0|      if (!ctx) {
  ------------------
  |  Branch (128:11): [True: 0, False: 0]
  ------------------
  129|      0|        ctx = &default_ctx;
  130|      0|      }
  131|      0|      av1_build_interintra_predictor(cm, xd, xd->plane[plane].dst.buf,
  132|      0|                                     xd->plane[plane].dst.stride, ctx, plane,
  133|      0|                                     bsize);
  134|      0|    }
  135|  13.5M|  }
  136|  8.17M|}
aom_upsampled_pred_scaled:
  426|  41.5M|                               uint8_t *comp_pred, int width, int height) {
  427|       |  // expect xd == NULL only in tests
  428|  41.5M|  if (xd != NULL) {
  ------------------
  |  Branch (428:7): [True: 41.5M, False: 18.4E]
  ------------------
  429|  41.5M|    const MB_MODE_INFO *mi = xd->mi[0];
  430|  41.5M|    const int ref_num = 0;
  431|  41.5M|    const int is_intrabc = is_intrabc_block(mi);
  432|  41.5M|    const struct scale_factors *const sf =
  433|  41.5M|        is_intrabc ? &cm->sf_identity : xd->block_ref_scale_factors[ref_num];
  ------------------
  |  Branch (433:9): [True: 0, False: 41.5M]
  ------------------
  434|  41.5M|    const int is_scaled = av1_is_scaled(sf);
  435|       |
  436|  41.5M|    if (is_scaled) {
  ------------------
  |  Branch (436:9): [True: 41.4M, False: 29.3k]
  ------------------
  437|  41.4M|      int plane = 0;
  438|  41.4M|      const int mi_x = mi_col * MI_SIZE;
  ------------------
  |  |   40|  41.4M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  41.4M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  439|  41.4M|      const int mi_y = mi_row * MI_SIZE;
  ------------------
  |  |   40|  41.4M|#define MI_SIZE (1 << MI_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   39|  41.4M|#define MI_SIZE_LOG2 2
  |  |  ------------------
  ------------------
  440|  41.4M|      const struct macroblockd_plane *const pd = &xd->plane[plane];
  441|  41.4M|      const struct buf_2d *const dst_buf = &pd->dst;
  442|  41.4M|      const struct buf_2d *const pre_buf =
  443|  41.4M|          is_intrabc ? dst_buf : &pd->pre[ref_num];
  ------------------
  |  Branch (443:11): [True: 0, False: 41.4M]
  ------------------
  444|       |
  445|  41.4M|      InterPredParams inter_pred_params;
  446|  41.4M|      inter_pred_params.conv_params = get_conv_params(0, plane, xd->bd);
  447|  41.4M|      const int_interpfilters filters =
  448|  41.4M|          av1_broadcast_interp_filter(EIGHTTAP_REGULAR);
  449|  41.4M|      av1_init_inter_params(
  450|  41.4M|          &inter_pred_params, width, height, mi_y >> pd->subsampling_y,
  451|  41.4M|          mi_x >> pd->subsampling_x, pd->subsampling_x, pd->subsampling_y,
  452|  41.4M|          xd->bd, is_cur_buf_hbd(xd), is_intrabc, sf, pre_buf, filters);
  453|  41.4M|      av1_enc_build_one_inter_predictor(comp_pred, width, mv,
  454|  41.4M|                                        &inter_pred_params);
  455|  41.4M|      return true;
  456|  41.4M|    }
  457|  41.5M|  }
  458|  27.0k|  return false;
  459|  41.5M|}
reconinter_enc.c:enc_calc_subpel_params:
   34|  55.0M|    uint8_t **pre, SubpelParams *subpel_params, int *src_stride) {
   35|  55.0M|  struct buf_2d *pre_buf = &inter_pred_params->ref_frame_buf;
   36|  55.0M|  init_subpel_params(src_mv, inter_pred_params, subpel_params, pre_buf->width,
   37|  55.0M|                     pre_buf->height);
   38|  55.0M|  *pre = pre_buf->buf0 +
   39|  55.0M|         (subpel_params->pos_y >> SCALE_SUBPEL_BITS) * pre_buf->stride +
  ------------------
  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  ------------------
   40|  55.0M|         (subpel_params->pos_x >> SCALE_SUBPEL_BITS);
  ------------------
  |  |   28|  55.0M|#define SCALE_SUBPEL_BITS 10
  ------------------
   41|  55.0M|  *src_stride = pre_buf->stride;
   42|  55.0M|}
reconinter_enc.c:enc_build_inter_predictors:
   56|  13.5M|                                       int bw, int bh, int mi_x, int mi_y) {
   57|  13.5M|  build_inter_predictors(cm, xd, plane, mi, /*build_for_obmc=*/0, bw, bh, mi_x,
   58|  13.5M|                         mi_y);
   59|  13.5M|}

av1_disable_segfeature:
   37|   368k|                            SEG_LVL_FEATURES feature_id) {
   38|   368k|  seg->feature_mask[segment_id] &= ~(1u << feature_id);
   39|   368k|}
av1_reset_segment_features:
   46|   174k|void av1_reset_segment_features(AV1_COMMON *cm) {
   47|   174k|  struct segmentation *seg = &cm->seg;
   48|       |
   49|       |  // Set up default state for MB feature flags
   50|   174k|  seg->enabled = 0;
   51|   174k|  seg->update_map = 0;
   52|   174k|  seg->update_data = 0;
   53|   174k|  av1_clearall_segfeatures(seg);
   54|   174k|}

tx_search.c:av1_sort_fi32_8:
  118|   927k|static inline void av1_sort_fi32_8(float k[], int32_t v[]) {
  119|   927k|  SWAP(0, 1);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 598k, False: 329k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 598k, False: 329k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 598k, False: 329k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 598k, False: 329k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  120|   927k|  SWAP(2, 3);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 734k, False: 192k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 734k, False: 192k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 734k, False: 192k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 734k, False: 192k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  121|   927k|  SWAP(4, 5);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 881k, False: 46.5k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 881k, False: 46.5k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 881k, False: 46.5k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 881k, False: 46.5k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  122|   927k|  SWAP(6, 7);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 918k, False: 9.55k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 918k, False: 9.55k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 918k, False: 9.54k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 918k, False: 9.54k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  123|   927k|  SWAP(0, 2);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 662k, False: 265k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 662k, False: 265k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 662k, False: 265k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 662k, False: 265k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  124|   927k|  SWAP(1, 3);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 745k, False: 182k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 745k, False: 182k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 744k, False: 182k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 744k, False: 182k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  125|   927k|  SWAP(4, 6);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 912k, False: 15.6k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 912k, False: 15.6k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 912k, False: 15.6k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 912k, False: 15.6k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  126|   927k|  SWAP(5, 7);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 913k, False: 14.4k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 913k, False: 14.4k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 913k, False: 14.4k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 913k, False: 14.4k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  127|   927k|  SWAP(1, 2);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 588k, False: 339k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 588k, False: 339k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 588k, False: 339k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 588k, False: 339k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  128|   927k|  SWAP(5, 6);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 890k, False: 37.4k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 890k, False: 37.4k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 890k, False: 37.4k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 890k, False: 37.4k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  129|   927k|  SWAP(0, 4);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 877k, False: 49.7k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 877k, False: 49.7k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 877k, False: 49.7k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 877k, False: 49.7k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  130|   927k|  SWAP(3, 7);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 915k, False: 11.7k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 915k, False: 11.7k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 916k, False: 11.6k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 916k, False: 11.6k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  131|   927k|  SWAP(1, 5);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 884k, False: 43.3k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 884k, False: 43.3k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 884k, False: 43.3k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 884k, False: 43.3k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  132|   927k|  SWAP(2, 6);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 901k, False: 26.3k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 901k, False: 26.3k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 901k, False: 26.3k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 901k, False: 26.3k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  133|   927k|  SWAP(1, 4);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 864k, False: 63.6k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 864k, False: 63.6k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 864k, False: 63.6k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 864k, False: 63.6k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  134|   927k|  SWAP(3, 6);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 895k, False: 32.1k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 895k, False: 32.1k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 895k, False: 32.1k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 895k, False: 32.1k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  135|   927k|  SWAP(2, 4);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 823k, False: 103k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 823k, False: 103k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 823k, False: 103k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 823k, False: 103k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  136|   927k|  SWAP(3, 5);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 849k, False: 78.6k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 849k, False: 78.6k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 849k, False: 78.6k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 849k, False: 78.6k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  137|   927k|  SWAP(3, 4);
  ------------------
  |  |   26|   927k|  do {                                               \
  |  |   27|   927k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 839k, False: 88.5k]
  |  |  ------------------
  |  |   28|   927k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 839k, False: 88.5k]
  |  |  ------------------
  |  |   29|   927k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 839k, False: 88.5k]
  |  |  ------------------
  |  |   30|   927k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 839k, False: 88.5k]
  |  |  ------------------
  |  |   31|   927k|    k[i] = maxf;                                     \
  |  |   32|   927k|    k[j] = minf;                                     \
  |  |   33|   927k|    v[i] = maxi;                                     \
  |  |   34|   927k|    v[j] = mini;                                     \
  |  |   35|   927k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 927k]
  |  |  ------------------
  ------------------
  138|   927k|}
tx_search.c:av1_sort_fi32_16:
   44|  12.3k|static inline void av1_sort_fi32_16(float k[], int32_t v[]) {
   45|  12.3k|  SWAP(0, 1);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 10.6k, False: 1.70k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 10.6k, False: 1.70k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 10.6k, False: 1.70k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 10.6k, False: 1.70k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   46|  12.3k|  SWAP(2, 3);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 6.87k, False: 5.48k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 6.87k, False: 5.48k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 6.87k, False: 5.48k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 6.87k, False: 5.48k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   47|  12.3k|  SWAP(4, 5);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   48|  12.3k|  SWAP(6, 7);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 7.14k, False: 5.21k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 7.14k, False: 5.21k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 7.14k, False: 5.21k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 7.14k, False: 5.21k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   49|  12.3k|  SWAP(8, 9);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 11.7k, False: 591]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 11.7k, False: 591]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 11.7k, False: 591]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 11.7k, False: 591]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   50|  12.3k|  SWAP(10, 11);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 44]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 44]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 44]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 44]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   51|  12.3k|  SWAP(12, 13);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   52|  12.3k|  SWAP(14, 15);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   53|  12.3k|  SWAP(0, 2);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 9.58k, False: 2.77k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 9.58k, False: 2.77k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 9.58k, False: 2.77k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 9.58k, False: 2.77k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   54|  12.3k|  SWAP(1, 3);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 10.3k, False: 2.05k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 10.3k, False: 2.05k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 10.3k, False: 2.05k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 10.3k, False: 2.05k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   55|  12.3k|  SWAP(4, 6);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 4.07k, False: 8.28k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 4.07k, False: 8.28k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 4.07k, False: 8.28k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 4.07k, False: 8.28k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   56|  12.3k|  SWAP(5, 7);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 4.96k, False: 7.39k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 4.96k, False: 7.39k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 4.96k, False: 7.39k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 4.96k, False: 7.39k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   57|  12.3k|  SWAP(8, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.2k, False: 68]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.2k, False: 68]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.2k, False: 68]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.2k, False: 68]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   58|  12.3k|  SWAP(9, 11);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 31]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 31]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 31]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 31]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   59|  12.3k|  SWAP(12, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   60|  12.3k|  SWAP(13, 15);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   61|  12.3k|  SWAP(1, 2);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 8.22k, False: 4.13k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 8.22k, False: 4.13k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 8.22k, False: 4.13k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 8.22k, False: 4.13k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   62|  12.3k|  SWAP(5, 6);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 5.76k, False: 6.58k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 5.76k, False: 6.58k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 5.76k, False: 6.58k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 5.76k, False: 6.58k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   63|  12.3k|  SWAP(0, 4);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 7.47k, False: 4.88k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 7.47k, False: 4.88k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 7.47k, False: 4.88k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 7.47k, False: 4.88k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   64|  12.3k|  SWAP(3, 7);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 8.74k, False: 3.61k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 8.74k, False: 3.61k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 8.74k, False: 3.61k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 8.74k, False: 3.61k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   65|  12.3k|  SWAP(9, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.2k, False: 138]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.2k, False: 138]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.2k, False: 138]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.2k, False: 138]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   66|  12.3k|  SWAP(13, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   67|  12.3k|  SWAP(8, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   68|  12.3k|  SWAP(11, 15);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   69|  12.3k|  SWAP(1, 5);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 8.37k, False: 3.97k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 8.37k, False: 3.97k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 8.37k, False: 3.97k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 8.37k, False: 3.97k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   70|  12.3k|  SWAP(2, 6);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 8.97k, False: 3.37k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 8.97k, False: 3.37k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 8.97k, False: 3.37k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 8.97k, False: 3.37k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   71|  12.3k|  SWAP(9, 13);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   72|  12.3k|  SWAP(10, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   73|  12.3k|  SWAP(0, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 11.7k, False: 568]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 11.7k, False: 568]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 11.7k, False: 568]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 11.7k, False: 568]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   74|  12.3k|  SWAP(7, 15);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   75|  12.3k|  SWAP(1, 4);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 7.60k, False: 4.75k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 7.60k, False: 4.75k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 7.60k, False: 4.75k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 7.60k, False: 4.75k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   76|  12.3k|  SWAP(3, 6);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 6.45k, False: 5.90k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 6.45k, False: 5.90k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 6.45k, False: 5.90k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 6.45k, False: 5.90k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   77|  12.3k|  SWAP(9, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   78|  12.3k|  SWAP(11, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   79|  12.3k|  SWAP(2, 4);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 3.61k, False: 8.74k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 3.61k, False: 8.74k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 3.61k, False: 8.74k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 3.61k, False: 8.74k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   80|  12.3k|  SWAP(3, 5);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 3.26k, False: 9.09k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 3.26k, False: 9.09k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 3.26k, False: 9.09k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 3.26k, False: 9.09k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   81|  12.3k|  SWAP(10, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   82|  12.3k|  SWAP(11, 13);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   83|  12.3k|  SWAP(1, 9);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.2k, False: 108]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.2k, False: 108]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.2k, False: 108]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.2k, False: 108]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   84|  12.3k|  SWAP(6, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   85|  12.3k|  SWAP(3, 4);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 7.42k, False: 4.93k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 7.42k, False: 4.93k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 7.42k, False: 4.93k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 7.42k, False: 4.93k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   86|  12.3k|  SWAP(11, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   87|  12.3k|  SWAP(1, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 10.8k, False: 1.55k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 10.8k, False: 1.55k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 10.8k, False: 1.55k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 10.8k, False: 1.55k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   88|  12.3k|  SWAP(2, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 25]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 25]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 25]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 25]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   89|  12.3k|  SWAP(5, 13);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   90|  12.3k|  SWAP(7, 14);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   91|  12.3k|  SWAP(3, 11);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 8]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 8]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 8]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 8]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   92|  12.3k|  SWAP(2, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 9.98k, False: 2.36k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 9.98k, False: 2.36k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 9.98k, False: 2.36k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 9.98k, False: 2.36k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   93|  12.3k|  SWAP(4, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   94|  12.3k|  SWAP(7, 13);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   95|  12.3k|  SWAP(3, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 45]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 45]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 45]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 45]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   96|  12.3k|  SWAP(5, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   97|  12.3k|  SWAP(3, 9);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 11.5k, False: 776]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 11.5k, False: 776]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 11.5k, False: 776]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 11.5k, False: 776]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   98|  12.3k|  SWAP(6, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
   99|  12.3k|  SWAP(3, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 8.64k, False: 3.70k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 8.64k, False: 3.70k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 8.64k, False: 3.70k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 8.64k, False: 3.70k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  100|  12.3k|  SWAP(7, 12);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 0]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  101|  12.3k|  SWAP(5, 9);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 10.8k, False: 1.47k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 10.8k, False: 1.47k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 10.8k, False: 1.47k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 10.8k, False: 1.47k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  102|  12.3k|  SWAP(6, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.2k, False: 151]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.2k, False: 151]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.2k, False: 151]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.2k, False: 151]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  103|  12.3k|  SWAP(4, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 6.90k, False: 5.45k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 6.90k, False: 5.45k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 6.90k, False: 5.45k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 6.90k, False: 5.45k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  104|  12.3k|  SWAP(7, 11);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.3k, False: 47]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.3k, False: 47]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.3k, False: 47]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.3k, False: 47]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  105|  12.3k|  SWAP(5, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 6.85k, False: 5.49k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  106|  12.3k|  SWAP(7, 10);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 12.2k, False: 148]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 12.2k, False: 148]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 12.2k, False: 148]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 12.2k, False: 148]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  107|  12.3k|  SWAP(6, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 4.05k, False: 8.30k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 4.05k, False: 8.30k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 4.05k, False: 8.30k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 4.05k, False: 8.30k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  108|  12.3k|  SWAP(7, 9);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 10.1k, False: 2.25k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 10.1k, False: 2.25k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 10.1k, False: 2.25k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 10.1k, False: 2.25k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  109|  12.3k|  SWAP(7, 8);
  ------------------
  |  |   26|  12.3k|  do {                                               \
  |  |   27|  12.3k|    const float maxf = (k[i] >= k[j]) ? k[i] : k[j]; \
  |  |  ------------------
  |  |  |  Branch (27:24): [True: 4.53k, False: 7.82k]
  |  |  ------------------
  |  |   28|  12.3k|    const float minf = (k[i] >= k[j]) ? k[j] : k[i]; \
  |  |  ------------------
  |  |  |  Branch (28:24): [True: 4.53k, False: 7.82k]
  |  |  ------------------
  |  |   29|  12.3k|    const int maxi = (k[i] >= k[j]) ? v[i] : v[j];   \
  |  |  ------------------
  |  |  |  Branch (29:22): [True: 4.53k, False: 7.82k]
  |  |  ------------------
  |  |   30|  12.3k|    const int mini = (k[i] >= k[j]) ? v[j] : v[i];   \
  |  |  ------------------
  |  |  |  Branch (30:22): [True: 4.53k, False: 7.82k]
  |  |  ------------------
  |  |   31|  12.3k|    k[i] = maxf;                                     \
  |  |   32|  12.3k|    k[j] = minf;                                     \
  |  |   33|  12.3k|    v[i] = maxi;                                     \
  |  |   34|  12.3k|    v[j] = mini;                                     \
  |  |   35|  12.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (35:12): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
  110|  12.3k|}

av1_set_speed_features_framesize_dependent:
 2671|   110k|void av1_set_speed_features_framesize_dependent(AV1_COMP *cpi, int speed) {
 2672|   110k|  SPEED_FEATURES *const sf = &cpi->sf;
 2673|   110k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2674|       |
 2675|   110k|  switch (oxcf->mode) {
  ------------------
  |  Branch (2675:11): [True: 110k, False: 0]
  ------------------
 2676|  73.8k|    case GOOD:
  ------------------
  |  Branch (2676:5): [True: 73.8k, False: 36.6k]
  ------------------
 2677|  73.8k|      set_good_speed_feature_framesize_dependent(cpi, sf, speed);
 2678|  73.8k|      break;
 2679|      0|    case ALLINTRA:
  ------------------
  |  Branch (2679:5): [True: 0, False: 110k]
  ------------------
 2680|      0|      set_allintra_speed_feature_framesize_dependent(cpi, sf, speed);
 2681|      0|      break;
 2682|  36.6k|    case REALTIME:
  ------------------
  |  Branch (2682:5): [True: 36.6k, False: 73.8k]
  ------------------
 2683|  36.6k|      set_rt_speed_feature_framesize_dependent(cpi, sf, speed);
 2684|  36.6k|      break;
 2685|   110k|  }
 2686|       |
 2687|   110k|  if (!cpi->ppi->seq_params_locked) {
  ------------------
  |  Branch (2687:7): [True: 55.2k, False: 55.2k]
  ------------------
 2688|  55.2k|    cpi->common.seq_params->enable_masked_compound &=
 2689|  55.2k|        !sf->inter_sf.disable_masked_comp;
 2690|  55.2k|    cpi->common.seq_params->enable_interintra_compound &=
 2691|  55.2k|        (sf->inter_sf.disable_interintra_wedge_var_thresh != UINT_MAX);
 2692|  55.2k|  }
 2693|       |
 2694|   110k|  set_subpel_search_method(&cpi->mv_search_params,
 2695|   110k|                           cpi->oxcf.unit_test_cfg.motion_vector_unit_test,
 2696|   110k|                           sf->mv_sf.subpel_search_method);
 2697|       |
 2698|       |  // For multi-thread use case with row_mt enabled, cost update for a set of
 2699|       |  // SB rows is not desirable. Hence, the sf mv_cost_upd_level is set to
 2700|       |  // INTERNAL_COST_UPD_SBROW in such cases.
 2701|   110k|  if ((cpi->oxcf.row_mt == 1) && (cpi->mt_info.num_workers > 1)) {
  ------------------
  |  Branch (2701:7): [True: 110k, False: 0]
  |  Branch (2701:34): [True: 56.0k, False: 54.3k]
  ------------------
 2702|  56.0k|    if (sf->inter_sf.mv_cost_upd_level == INTERNAL_COST_UPD_SBROW_SET) {
  ------------------
  |  Branch (2702:9): [True: 37.1k, False: 18.9k]
  ------------------
 2703|       |      // Set mv_cost_upd_level to use row level update.
 2704|  37.1k|      sf->inter_sf.mv_cost_upd_level = INTERNAL_COST_UPD_SBROW;
 2705|  37.1k|    }
 2706|  56.0k|  }
 2707|   110k|}
av1_set_speed_features_framesize_independent:
 2709|   110k|void av1_set_speed_features_framesize_independent(AV1_COMP *cpi, int speed) {
 2710|   110k|  SPEED_FEATURES *const sf = &cpi->sf;
 2711|   110k|  WinnerModeParams *const winner_mode_params = &cpi->winner_mode_params;
 2712|   110k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
 2713|   110k|  int i;
 2714|       |
 2715|   110k|  init_hl_sf(&sf->hl_sf);
 2716|   110k|  init_fp_sf(&sf->fp_sf);
 2717|   110k|  init_tpl_sf(&sf->tpl_sf);
 2718|   110k|  init_gm_sf(&sf->gm_sf);
 2719|   110k|  init_part_sf(&sf->part_sf);
 2720|   110k|  init_mv_sf(&sf->mv_sf);
 2721|   110k|  init_inter_sf(&sf->inter_sf);
 2722|   110k|  init_interp_sf(&sf->interp_sf);
 2723|   110k|  init_intra_sf(&sf->intra_sf);
 2724|   110k|  init_tx_sf(&sf->tx_sf);
 2725|   110k|  init_rd_sf(&sf->rd_sf, oxcf);
 2726|   110k|  init_winner_mode_sf(&sf->winner_mode_sf);
 2727|   110k|  init_lpf_sf(&sf->lpf_sf);
 2728|   110k|  init_rt_sf(&sf->rt_sf);
 2729|       |
 2730|   110k|  switch (oxcf->mode) {
  ------------------
  |  Branch (2730:11): [True: 110k, False: 0]
  ------------------
 2731|  73.8k|    case GOOD:
  ------------------
  |  Branch (2731:5): [True: 73.8k, False: 36.6k]
  ------------------
 2732|  73.8k|      set_good_speed_features_framesize_independent(cpi, sf, speed);
 2733|  73.8k|      break;
 2734|      0|    case ALLINTRA:
  ------------------
  |  Branch (2734:5): [True: 0, False: 110k]
  ------------------
 2735|      0|      set_allintra_speed_features_framesize_independent(cpi, sf, speed);
 2736|      0|      break;
 2737|  36.6k|    case REALTIME:
  ------------------
  |  Branch (2737:5): [True: 36.6k, False: 73.8k]
  ------------------
 2738|  36.6k|      set_rt_speed_features_framesize_independent(cpi, sf, speed);
 2739|  36.6k|      break;
 2740|   110k|  }
 2741|       |
 2742|       |  // Note: when use_nonrd_pick_mode is true, the transform size is the
 2743|       |  // minimum of 16x16 and the largest possible size of the current block,
 2744|       |  // which conflicts with the speed feature "enable_tx_size_search".
 2745|   110k|  if (!oxcf->txfm_cfg.enable_tx_size_search &&
  ------------------
  |  Branch (2745:7): [True: 0, False: 110k]
  ------------------
 2746|      0|      sf->rt_sf.use_nonrd_pick_mode == 0) {
  ------------------
  |  Branch (2746:7): [True: 0, False: 0]
  ------------------
 2747|      0|    sf->winner_mode_sf.tx_size_search_level = 3;
 2748|      0|  }
 2749|       |
 2750|   110k|  if (cpi->mt_info.num_workers > 1) {
  ------------------
  |  Branch (2750:7): [True: 56.0k, False: 54.3k]
  ------------------
 2751|       |    // Loop restoration stage is conditionally disabled for speed 5, 6 when
 2752|       |    // num_workers > 1. Since av1_pick_filter_restoration() is not
 2753|       |    // multi-threaded, enabling the Loop restoration stage will cause an
 2754|       |    // increase in encode time (3% to 7% increase depends on frame
 2755|       |    // resolution).
 2756|       |    // TODO(aomedia:3446): Implement multi-threading of
 2757|       |    // av1_pick_filter_restoration() and enable Wiener filter for speed 5, 6
 2758|       |    // similar to single thread encoding path.
 2759|  56.0k|    if (speed >= 5) {
  ------------------
  |  Branch (2759:9): [True: 56.0k, False: 0]
  ------------------
 2760|  56.0k|      sf->lpf_sf.disable_sgr_filter = true;
 2761|  56.0k|      sf->lpf_sf.disable_wiener_filter = true;
 2762|  56.0k|    }
 2763|  56.0k|  }
 2764|       |
 2765|   110k|  if (!cpi->ppi->seq_params_locked) {
  ------------------
  |  Branch (2765:7): [True: 55.2k, False: 55.2k]
  ------------------
 2766|  55.2k|    cpi->common.seq_params->order_hint_info.enable_dist_wtd_comp &=
 2767|  55.2k|        (sf->inter_sf.use_dist_wtd_comp_flag != DIST_WTD_COMP_DISABLED);
 2768|  55.2k|    cpi->common.seq_params->enable_dual_filter &=
 2769|  55.2k|        !sf->interp_sf.disable_dual_filter;
 2770|       |    // Set the flag 'enable_restoration', if one the Loop restoration filters
 2771|       |    // (i.e., Wiener or Self-guided) is enabled.
 2772|  55.2k|    cpi->common.seq_params->enable_restoration &=
 2773|  55.2k|        (!sf->lpf_sf.disable_wiener_filter || !sf->lpf_sf.disable_sgr_filter);
  ------------------
  |  Branch (2773:10): [True: 27.6k, False: 27.5k]
  |  Branch (2773:47): [True: 0, False: 27.5k]
  ------------------
 2774|       |
 2775|  55.2k|    cpi->common.seq_params->enable_interintra_compound &=
 2776|  55.2k|        (sf->inter_sf.disable_interintra_wedge_var_thresh != UINT_MAX);
 2777|  55.2k|  }
 2778|       |
 2779|   110k|  const int mesh_speed = AOMMIN(speed, MAX_MESH_SPEED);
  ------------------
  |  |   34|   110k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.4k, False: 92.0k]
  |  |  ------------------
  ------------------
 2780|   552k|  for (i = 0; i < MAX_MESH_STEP; ++i) {
  ------------------
  |  |   27|   552k|#define MAX_MESH_STEP 4
  ------------------
  |  Branch (2780:15): [True: 441k, False: 110k]
  ------------------
 2781|   441k|    sf->mv_sf.mesh_patterns[i].range =
 2782|   441k|        good_quality_mesh_patterns[mesh_speed][i].range;
 2783|   441k|    sf->mv_sf.mesh_patterns[i].interval =
 2784|   441k|        good_quality_mesh_patterns[mesh_speed][i].interval;
 2785|   441k|  }
 2786|       |
 2787|       |  // Update the mesh pattern of exhaustive motion search for intraBC
 2788|       |  // Though intraBC mesh pattern is populated for all frame types, it is used
 2789|       |  // only for intra frames of screen contents
 2790|   552k|  for (i = 0; i < MAX_MESH_STEP; ++i) {
  ------------------
  |  |   27|   552k|#define MAX_MESH_STEP 4
  ------------------
  |  Branch (2790:15): [True: 441k, False: 110k]
  ------------------
 2791|   441k|    sf->mv_sf.intrabc_mesh_patterns[i].range =
 2792|   441k|        intrabc_mesh_patterns[mesh_speed][i].range;
 2793|   441k|    sf->mv_sf.intrabc_mesh_patterns[i].interval =
 2794|   441k|        intrabc_mesh_patterns[mesh_speed][i].interval;
 2795|   441k|  }
 2796|       |
 2797|       |  // Slow quant, dct and trellis not worthwhile for first pass
 2798|       |  // so make sure they are always turned off.
 2799|   110k|  if (is_stat_generation_stage(cpi))
  ------------------
  |  Branch (2799:7): [True: 0, False: 110k]
  ------------------
 2800|      0|    sf->rd_sf.optimize_coefficients = NO_TRELLIS_OPT;
 2801|       |
 2802|       |  // No recode for 1 pass.
 2803|   110k|  if (oxcf->pass == AOM_RC_ONE_PASS && has_no_stats_stage(cpi))
  ------------------
  |  Branch (2803:7): [True: 110k, False: 0]
  |  Branch (2803:40): [True: 110k, False: 0]
  ------------------
 2804|   110k|    sf->hl_sf.recode_loop = DISALLOW_RECODE;
 2805|       |
 2806|   110k|  set_subpel_search_method(&cpi->mv_search_params,
 2807|   110k|                           cpi->oxcf.unit_test_cfg.motion_vector_unit_test,
 2808|   110k|                           sf->mv_sf.subpel_search_method);
 2809|       |
 2810|       |  // assert ensures that tx_domain_dist_level is accessed correctly
 2811|   110k|  assert(cpi->sf.rd_sf.tx_domain_dist_thres_level >= 0 &&
 2812|   110k|         cpi->sf.rd_sf.tx_domain_dist_thres_level < 4);
 2813|   110k|  memcpy(winner_mode_params->tx_domain_dist_threshold,
 2814|   110k|         tx_domain_dist_thresholds[cpi->sf.rd_sf.tx_domain_dist_thres_level],
 2815|   110k|         sizeof(winner_mode_params->tx_domain_dist_threshold));
 2816|       |
 2817|   110k|  assert(cpi->sf.rd_sf.tx_domain_dist_level >= 0 &&
 2818|   110k|         cpi->sf.rd_sf.tx_domain_dist_level < TX_DOMAIN_DIST_LEVELS);
 2819|   110k|  memcpy(winner_mode_params->use_transform_domain_distortion,
 2820|   110k|         tx_domain_dist_types[cpi->sf.rd_sf.tx_domain_dist_level],
 2821|   110k|         sizeof(winner_mode_params->use_transform_domain_distortion));
 2822|       |
 2823|       |  // assert ensures that coeff_opt_thresholds is accessed correctly
 2824|   110k|  assert(cpi->sf.rd_sf.perform_coeff_opt >= 0 &&
 2825|   110k|         cpi->sf.rd_sf.perform_coeff_opt < 9);
 2826|   110k|  memcpy(winner_mode_params->coeff_opt_thresholds,
 2827|   110k|         &coeff_opt_thresholds[cpi->sf.rd_sf.perform_coeff_opt],
 2828|   110k|         sizeof(winner_mode_params->coeff_opt_thresholds));
 2829|       |
 2830|       |  // assert ensures that predict_skip_levels is accessed correctly
 2831|   110k|  assert(cpi->sf.tx_sf.tx_type_search.use_skip_flag_prediction >= 0 &&
 2832|   110k|         cpi->sf.tx_sf.tx_type_search.use_skip_flag_prediction < 3);
 2833|   110k|  memcpy(winner_mode_params->skip_txfm_level,
 2834|   110k|         predict_skip_levels[cpi->sf.tx_sf.tx_type_search
 2835|   110k|                                 .use_skip_flag_prediction],
 2836|   110k|         sizeof(winner_mode_params->skip_txfm_level));
 2837|       |
 2838|       |  // assert ensures that tx_size_search_level is accessed correctly
 2839|   110k|  assert(cpi->sf.winner_mode_sf.tx_size_search_level >= 0 &&
 2840|   110k|         cpi->sf.winner_mode_sf.tx_size_search_level <= 3);
 2841|   110k|  memcpy(winner_mode_params->tx_size_search_methods,
 2842|   110k|         tx_size_search_methods[cpi->sf.winner_mode_sf.tx_size_search_level],
 2843|   110k|         sizeof(winner_mode_params->tx_size_search_methods));
 2844|   110k|  memcpy(winner_mode_params->predict_dc_level,
 2845|   110k|         predict_dc_levels[cpi->sf.winner_mode_sf.dc_blk_pred_level],
 2846|   110k|         sizeof(winner_mode_params->predict_dc_level));
 2847|       |
 2848|   110k|  if (cpi->oxcf.row_mt == 1 && (cpi->mt_info.num_workers > 1)) {
  ------------------
  |  Branch (2848:7): [True: 110k, False: 0]
  |  Branch (2848:32): [True: 56.0k, False: 54.3k]
  ------------------
 2849|  56.0k|    if (sf->inter_sf.inter_mode_rd_model_estimation == 1) {
  ------------------
  |  Branch (2849:9): [True: 10.5k, False: 45.5k]
  ------------------
 2850|       |      // Revert to type 2
 2851|  10.5k|      sf->inter_sf.inter_mode_rd_model_estimation = 2;
 2852|  10.5k|    }
 2853|       |
 2854|  56.0k|#if !CONFIG_FPMT_TEST
 2855|       |    // Disable the speed feature 'prune_ref_frame_for_gm_search' to achieve
 2856|       |    // better parallelism when number of threads available are greater than or
 2857|       |    // equal to maximum number of reference frames allowed for global motion.
 2858|  56.0k|    if (sf->gm_sf.gm_search_type != GM_DISABLE_SEARCH &&
  ------------------
  |  Branch (2858:9): [True: 37.1k, False: 18.9k]
  ------------------
 2859|  37.1k|        (cpi->mt_info.num_workers >=
  ------------------
  |  Branch (2859:9): [True: 32.0k, False: 5.10k]
  ------------------
 2860|  37.1k|         gm_available_reference_frames[sf->gm_sf.gm_search_type]))
 2861|  32.0k|      sf->gm_sf.prune_ref_frame_for_gm_search = 0;
 2862|  56.0k|#endif
 2863|  56.0k|  }
 2864|       |
 2865|       |  // This only applies to the real time mode. Adaptive gf refresh is disabled if
 2866|       |  // gf_cbr_boost_pct that is set by the user is larger than 0.
 2867|   110k|  if (cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 0)
  ------------------
  |  Branch (2867:7): [True: 0, False: 110k]
  ------------------
 2868|      0|    sf->rt_sf.gf_refresh_based_on_qp = 0;
 2869|   110k|}
av1_set_speed_features_qindex_dependent:
 2892|  73.6k|void av1_set_speed_features_qindex_dependent(AV1_COMP *cpi, int speed) {
 2893|  73.6k|  AV1_COMMON *const cm = &cpi->common;
 2894|  73.6k|  SPEED_FEATURES *const sf = &cpi->sf;
 2895|  73.6k|  WinnerModeParams *const winner_mode_params = &cpi->winner_mode_params;
 2896|  73.6k|  const int boosted = frame_is_boosted(cpi);
 2897|  73.6k|  const int is_480p_or_lesser = AOMMIN(cm->width, cm->height) <= 480;
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 40.8k]
  |  |  ------------------
  ------------------
 2898|  73.6k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 40.8k]
  |  |  ------------------
  ------------------
 2899|  73.6k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 40.8k]
  |  |  ------------------
  ------------------
 2900|  73.6k|  const int is_1080p_or_larger = AOMMIN(cm->width, cm->height) >= 1080;
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 40.8k]
  |  |  ------------------
  ------------------
 2901|  73.6k|  const int is_1440p_or_larger = AOMMIN(cm->width, cm->height) >= 1440;
  ------------------
  |  |   34|  73.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 40.8k]
  |  |  ------------------
  ------------------
 2902|  73.6k|  const int is_arf2_bwd_type =
 2903|  73.6k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE;
 2904|       |
 2905|  73.6k|  if (cpi->oxcf.mode == ALLINTRA || cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (2905:7): [True: 0, False: 73.6k]
  |  Branch (2905:37): [True: 52.3k, False: 21.2k]
  ------------------
 2906|  52.3k|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (2906:7): [True: 0, False: 21.2k]
  ------------------
 2907|  52.3k|    if (cm->quant_params.base_qindex <= 140) {
  ------------------
  |  Branch (2907:9): [True: 20.3k, False: 32.0k]
  ------------------
 2908|  20.3k|      sf->lpf_sf.zero_low_cdef_strengths = 1;
 2909|  20.3k|    }
 2910|  52.3k|  }
 2911|       |
 2912|  73.6k|  if (cpi->oxcf.mode == REALTIME) {
  ------------------
  |  Branch (2912:7): [True: 24.4k, False: 49.2k]
  ------------------
 2913|  24.4k|    if (speed >= 6) {
  ------------------
  |  Branch (2913:9): [True: 24.4k, False: 0]
  ------------------
 2914|  24.4k|      const int qindex_thresh = boosted ? 190 : (is_720p_or_larger ? 120 : 150);
  ------------------
  |  Branch (2914:33): [True: 15.1k, False: 9.28k]
  |  Branch (2914:50): [True: 0, False: 9.28k]
  ------------------
 2915|  24.4k|      sf->part_sf.adjust_var_based_rd_partitioning =
 2916|  24.4k|          frame_is_intra_only(cm)
  ------------------
  |  Branch (2916:11): [True: 6.10k, False: 18.3k]
  ------------------
 2917|  24.4k|              ? 0
 2918|  24.4k|              : cm->quant_params.base_qindex > qindex_thresh;
 2919|  24.4k|    }
 2920|  24.4k|    return;
 2921|  24.4k|  }
 2922|       |
 2923|  49.2k|  if (speed == 0) {
  ------------------
  |  Branch (2923:7): [True: 0, False: 49.2k]
  ------------------
 2924|       |    // qindex_thresh for resolution < 720p
 2925|      0|    const int qindex_thresh = boosted ? 70 : (is_arf2_bwd_type ? 110 : 140);
  ------------------
  |  Branch (2925:31): [True: 0, False: 0]
  |  Branch (2925:47): [True: 0, False: 0]
  ------------------
 2926|      0|    if (!is_720p_or_larger && cm->quant_params.base_qindex <= qindex_thresh) {
  ------------------
  |  Branch (2926:9): [True: 0, False: 0]
  |  Branch (2926:31): [True: 0, False: 0]
  ------------------
 2927|      0|      sf->part_sf.simple_motion_search_split =
 2928|      0|          cm->features.allow_screen_content_tools ? 1 : 2;
  ------------------
  |  Branch (2928:11): [True: 0, False: 0]
  ------------------
 2929|      0|      sf->part_sf.simple_motion_search_early_term_none = 1;
 2930|      0|      sf->tx_sf.model_based_prune_tx_search_level = 0;
 2931|      0|    }
 2932|       |
 2933|      0|    if (is_720p_or_larger && cm->quant_params.base_qindex <= 128) {
  ------------------
  |  Branch (2933:9): [True: 0, False: 0]
  |  Branch (2933:30): [True: 0, False: 0]
  ------------------
 2934|      0|      sf->rd_sf.perform_coeff_opt = 2 + is_1080p_or_larger;
 2935|      0|      memcpy(winner_mode_params->coeff_opt_thresholds,
 2936|      0|             &coeff_opt_thresholds[sf->rd_sf.perform_coeff_opt],
 2937|      0|             sizeof(winner_mode_params->coeff_opt_thresholds));
 2938|      0|      sf->part_sf.simple_motion_search_split =
 2939|      0|          cm->features.allow_screen_content_tools ? 1 : 2;
  ------------------
  |  Branch (2939:11): [True: 0, False: 0]
  ------------------
 2940|      0|      sf->tx_sf.inter_tx_size_search_init_depth_rect = 1;
 2941|      0|      sf->tx_sf.inter_tx_size_search_init_depth_sqr = 1;
 2942|      0|      sf->tx_sf.intra_tx_size_search_init_depth_rect = 1;
 2943|      0|      sf->tx_sf.model_based_prune_tx_search_level = 0;
 2944|       |
 2945|      0|      if (is_1080p_or_larger && cm->quant_params.base_qindex <= 108) {
  ------------------
  |  Branch (2945:11): [True: 0, False: 0]
  |  Branch (2945:33): [True: 0, False: 0]
  ------------------
 2946|      0|        sf->inter_sf.selective_ref_frame = 2;
 2947|      0|        sf->rd_sf.tx_domain_dist_level = boosted ? 1 : 2;
  ------------------
  |  Branch (2947:42): [True: 0, False: 0]
  ------------------
 2948|      0|        sf->rd_sf.tx_domain_dist_thres_level = 1;
 2949|      0|        sf->part_sf.simple_motion_search_early_term_none = 1;
 2950|      0|        sf->tx_sf.tx_type_search.ml_tx_split_thresh = 4000;
 2951|      0|        sf->interp_sf.cb_pred_filter_search = 0;
 2952|      0|        sf->tx_sf.tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_2;
 2953|      0|        sf->tx_sf.tx_type_search.skip_tx_search = 1;
 2954|      0|      }
 2955|      0|    }
 2956|      0|  }
 2957|       |
 2958|  49.2k|  if (speed >= 2) {
  ------------------
  |  Branch (2958:7): [True: 49.2k, False: 0]
  ------------------
 2959|       |    // Disable extended partitions for lower quantizers
 2960|  49.2k|    const int aggr = AOMMIN(4, speed - 2);
  ------------------
  |  |   34|  49.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 49.2k]
  |  |  ------------------
  ------------------
 2961|  49.2k|    const int qindex_thresh1[4] = { 50, 50, 80, 100 };
 2962|  49.2k|    const int qindex_thresh2[4] = { 80, 100, 120, 160 };
 2963|  49.2k|    int qindex_thresh;
 2964|  49.2k|    if (aggr <= 1) {
  ------------------
  |  Branch (2964:9): [True: 0, False: 49.2k]
  ------------------
 2965|      0|      const int qthresh2 =
 2966|      0|          (!aggr && !is_480p_or_larger) ? 70 : qindex_thresh2[aggr];
  ------------------
  |  Branch (2966:12): [True: 0, False: 0]
  |  Branch (2966:21): [True: 0, False: 0]
  ------------------
 2967|      0|      qindex_thresh = cm->features.allow_screen_content_tools
  ------------------
  |  Branch (2967:23): [True: 0, False: 0]
  ------------------
 2968|      0|                          ? qindex_thresh1[aggr]
 2969|      0|                          : qthresh2;
 2970|      0|      if (cm->quant_params.base_qindex <= qindex_thresh && !boosted)
  ------------------
  |  Branch (2970:11): [True: 0, False: 0]
  |  Branch (2970:60): [True: 0, False: 0]
  ------------------
 2971|      0|        sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2972|  49.2k|    } else if (aggr <= 2) {
  ------------------
  |  Branch (2972:16): [True: 0, False: 49.2k]
  ------------------
 2973|      0|      qindex_thresh = boosted ? qindex_thresh1[aggr] : qindex_thresh2[aggr];
  ------------------
  |  Branch (2973:23): [True: 0, False: 0]
  ------------------
 2974|      0|      if (cm->quant_params.base_qindex <= qindex_thresh &&
  ------------------
  |  Branch (2974:11): [True: 0, False: 0]
  ------------------
 2975|      0|          !frame_is_intra_only(cm))
  ------------------
  |  Branch (2975:11): [True: 0, False: 0]
  ------------------
 2976|      0|        sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2977|  49.2k|    } else if (aggr <= 3) {
  ------------------
  |  Branch (2977:16): [True: 0, False: 49.2k]
  ------------------
 2978|      0|      if (!is_480p_or_larger) {
  ------------------
  |  Branch (2978:11): [True: 0, False: 0]
  ------------------
 2979|      0|        sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2980|      0|      } else if (!is_720p_or_larger && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (2980:18): [True: 0, False: 0]
  |  Branch (2980:40): [True: 0, False: 0]
  ------------------
 2981|      0|                 !cm->features.allow_screen_content_tools) {
  ------------------
  |  Branch (2981:18): [True: 0, False: 0]
  ------------------
 2982|      0|        sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2983|      0|      } else {
 2984|      0|        qindex_thresh = boosted ? qindex_thresh1[aggr] : qindex_thresh2[aggr];
  ------------------
  |  Branch (2984:25): [True: 0, False: 0]
  ------------------
 2985|      0|        if (cm->quant_params.base_qindex <= qindex_thresh &&
  ------------------
  |  Branch (2985:13): [True: 0, False: 0]
  ------------------
 2986|      0|            !frame_is_intra_only(cm))
  ------------------
  |  Branch (2986:13): [True: 0, False: 0]
  ------------------
 2987|      0|          sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2988|      0|      }
 2989|  49.2k|    } else {
 2990|  49.2k|      sf->part_sf.ext_partition_eval_thresh = BLOCK_128X128;
 2991|  49.2k|    }
 2992|  49.2k|  }
 2993|       |
 2994|  49.2k|  if (speed >= 3) {
  ------------------
  |  Branch (2994:7): [True: 49.2k, False: 0]
  ------------------
 2995|       |    // Disable rectangular partitions for lower quantizers
 2996|  49.2k|    const int aggr = (speed <= 4) ? 0 : 1;
  ------------------
  |  Branch (2996:22): [True: 0, False: 49.2k]
  ------------------
 2997|  49.2k|    const int qindex_thresh[2] = { 65, 80 };
 2998|  49.2k|    int disable_rect_part;
 2999|  49.2k|    disable_rect_part = !boosted;
 3000|  49.2k|    if (cm->quant_params.base_qindex <= qindex_thresh[aggr] &&
  ------------------
  |  Branch (3000:9): [True: 14.3k, False: 34.9k]
  ------------------
 3001|  14.3k|        disable_rect_part && is_480p_or_larger) {
  ------------------
  |  Branch (3001:9): [True: 10.7k, False: 3.57k]
  |  Branch (3001:30): [True: 0, False: 10.7k]
  ------------------
 3002|      0|      sf->part_sf.rect_partition_eval_thresh = BLOCK_8X8;
 3003|      0|    }
 3004|  49.2k|  }
 3005|       |
 3006|  49.2k|  if (speed <= 2) {
  ------------------
  |  Branch (3006:7): [True: 0, False: 49.2k]
  ------------------
 3007|      0|    if (!is_stat_generation_stage(cpi)) {
  ------------------
  |  Branch (3007:9): [True: 0, False: 0]
  ------------------
 3008|       |      // Use faster full-pel motion search for high quantizers.
 3009|       |      // Also use reduced total search range for low resolutions at high
 3010|       |      // quantizers.
 3011|      0|      const int aggr = speed;
 3012|       |
 3013|       |      // For < 720p resolutions:
 3014|      0|      if (!is_720p_or_larger) {
  ------------------
  |  Branch (3014:11): [True: 0, False: 0]
  ------------------
 3015|       |        // For < 720p resolutions:
 3016|      0|        const int ms_qindex_thresh[3][2] = { { 200, 70 },
 3017|      0|                                             { 170, 50 },
 3018|      0|                                             { 170, 40 } };
 3019|      0|        const int qindex_thresh1 = ms_qindex_thresh[aggr][0];
 3020|      0|        const int qindex_thresh2 = ms_qindex_thresh[aggr][1];
 3021|      0|        if (cm->quant_params.base_qindex > qindex_thresh1) {
  ------------------
  |  Branch (3021:13): [True: 0, False: 0]
  ------------------
 3022|      0|          sf->mv_sf.search_method = CLAMPED_DIAMOND;
 3023|      0|          sf->tpl_sf.search_method = CLAMPED_DIAMOND;
 3024|      0|        } else if (cm->quant_params.base_qindex > qindex_thresh2) {
  ------------------
  |  Branch (3024:20): [True: 0, False: 0]
  ------------------
 3025|      0|          sf->mv_sf.search_method = NSTEP_8PT;
 3026|      0|        }
 3027|      0|      } else {
 3028|       |        // For >= 720p resolutions:
 3029|      0|        const int ms_qindex_thresh[3][2] = { { MAXQ, 200 },
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
 3030|      0|                                             { MAXQ, -1 },
  ------------------
  |  |   26|      0|#define MAXQ 255
  ------------------
 3031|      0|                                             { 200, -1 } };
 3032|      0|        const SEARCH_METHODS motion_search_method[3][2] = {
 3033|      0|          { NSTEP_8PT, NSTEP_8PT },
 3034|      0|          { NSTEP_8PT, DIAMOND },
 3035|      0|          { NSTEP_8PT, DIAMOND }
 3036|      0|        };
 3037|      0|        const int qindex_thresh1 = ms_qindex_thresh[aggr][0];
 3038|      0|        const int qindex_thresh2 = ms_qindex_thresh[aggr][1];
 3039|      0|        if (cm->quant_params.base_qindex > qindex_thresh1) {
  ------------------
  |  Branch (3039:13): [True: 0, False: 0]
  ------------------
 3040|      0|          sf->mv_sf.search_method = DIAMOND;
 3041|      0|          sf->tpl_sf.search_method = DIAMOND;
 3042|      0|        } else if (cm->quant_params.base_qindex > qindex_thresh2) {
  ------------------
  |  Branch (3042:20): [True: 0, False: 0]
  ------------------
 3043|      0|          sf->mv_sf.search_method = motion_search_method[aggr][0];
 3044|      0|          sf->tpl_sf.search_method = motion_search_method[aggr][1];
 3045|      0|        }
 3046|      0|      }
 3047|      0|    }
 3048|      0|    sf->part_sf.less_rectangular_check_level = 1;
 3049|      0|  }
 3050|       |
 3051|  49.2k|  if (speed == 3)
  ------------------
  |  Branch (3051:7): [True: 0, False: 49.2k]
  ------------------
 3052|      0|    sf->part_sf.less_rectangular_check_level =
 3053|      0|        (cm->quant_params.base_qindex >= 170) ? 1 : 2;
  ------------------
  |  Branch (3053:9): [True: 0, False: 0]
  ------------------
 3054|       |
 3055|  49.2k|  if (speed >= 4) {
  ------------------
  |  Branch (3055:7): [True: 49.2k, False: 0]
  ------------------
 3056|       |    // Disable LR search at low and high quantizers and enable only for
 3057|       |    // mid-quantizer range.
 3058|  49.2k|    if (!boosted && !is_arf2_bwd_type) {
  ------------------
  |  Branch (3058:9): [True: 36.9k, False: 12.3k]
  |  Branch (3058:21): [True: 36.9k, False: 0]
  ------------------
 3059|  36.9k|      const int qindex_low[2] = { 100, 60 };
 3060|  36.9k|      const int qindex_high[2] = { 180, 160 };
 3061|  36.9k|      if (cm->quant_params.base_qindex <= qindex_low[is_720p_or_larger] ||
  ------------------
  |  Branch (3061:11): [True: 12.3k, False: 24.5k]
  ------------------
 3062|  29.0k|          cm->quant_params.base_qindex > qindex_high[is_720p_or_larger]) {
  ------------------
  |  Branch (3062:11): [True: 16.6k, False: 7.90k]
  ------------------
 3063|  29.0k|        sf->lpf_sf.disable_sgr_filter = true;
 3064|  29.0k|        sf->lpf_sf.disable_wiener_coeff_refine_search = true;
 3065|  29.0k|      }
 3066|  36.9k|    }
 3067|  49.2k|    sf->part_sf.less_rectangular_check_level = 2;
 3068|  49.2k|  }
 3069|       |
 3070|  49.2k|  if (speed == 1) {
  ------------------
  |  Branch (3070:7): [True: 0, False: 49.2k]
  ------------------
 3071|       |    // Reuse interinter wedge mask search from first search for non-boosted
 3072|       |    // non-internal-arf frames, except at very high quantizers.
 3073|      0|    if (cm->quant_params.base_qindex <= 200) {
  ------------------
  |  Branch (3073:9): [True: 0, False: 0]
  ------------------
 3074|      0|      if (!boosted && !is_arf2_bwd_type)
  ------------------
  |  Branch (3074:11): [True: 0, False: 0]
  |  Branch (3074:23): [True: 0, False: 0]
  ------------------
 3075|      0|        sf->inter_sf.reuse_mask_search_results = 1;
 3076|      0|    }
 3077|      0|  }
 3078|       |
 3079|  49.2k|  if (speed == 5) {
  ------------------
  |  Branch (3079:7): [True: 0, False: 49.2k]
  ------------------
 3080|      0|    if (!(frame_is_intra_only(&cpi->common) ||
  ------------------
  |  Branch (3080:11): [True: 0, False: 0]
  ------------------
 3081|      0|          cm->features.allow_screen_content_tools)) {
  ------------------
  |  Branch (3081:11): [True: 0, False: 0]
  ------------------
 3082|      0|      const int qindex[2] = { 256, 128 };
 3083|       |      // Set the sf value as 3 for low resolution and
 3084|       |      // for higher resolutions with low quantizers.
 3085|      0|      if (cm->quant_params.base_qindex < qindex[is_480p_or_larger])
  ------------------
  |  Branch (3085:11): [True: 0, False: 0]
  ------------------
 3086|      0|        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = 3;
 3087|      0|    }
 3088|      0|  }
 3089|       |
 3090|  49.2k|  if (speed >= 5) {
  ------------------
  |  Branch (3090:7): [True: 49.2k, False: 0]
  ------------------
 3091|       |    // Disable the sf for low quantizers in case of low resolution screen
 3092|       |    // contents.
 3093|  49.2k|    if (cm->features.allow_screen_content_tools &&
  ------------------
  |  Branch (3093:9): [True: 7.92k, False: 41.3k]
  ------------------
 3094|  7.92k|        cm->quant_params.base_qindex < 128 && is_480p_or_lesser) {
  ------------------
  |  Branch (3094:9): [True: 3.19k, False: 4.72k]
  |  Branch (3094:47): [True: 3.19k, False: 0]
  ------------------
 3095|  3.19k|      sf->part_sf.prune_sub_8x8_partition_level = 0;
 3096|  3.19k|    }
 3097|  49.2k|  }
 3098|       |
 3099|       |  // Loop restoration size search
 3100|       |  // At speed 0, always search all available sizes for the maximum possible gain
 3101|  49.2k|  sf->lpf_sf.min_lr_unit_size = RESTORATION_PROC_UNIT_SIZE;
  ------------------
  |  |   34|  49.2k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
 3102|  49.2k|  sf->lpf_sf.max_lr_unit_size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  49.2k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3103|       |
 3104|  49.2k|  if (speed >= 1) {
  ------------------
  |  Branch (3104:7): [True: 49.2k, False: 0]
  ------------------
 3105|       |    // For large frames, small restoration units are almost never useful,
 3106|       |    // so prune them away
 3107|  49.2k|    if (is_1440p_or_larger) {
  ------------------
  |  Branch (3107:9): [True: 0, False: 49.2k]
  ------------------
 3108|      0|      sf->lpf_sf.min_lr_unit_size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|      0|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3109|  49.2k|    } else if (is_720p_or_larger) {
  ------------------
  |  Branch (3109:16): [True: 0, False: 49.2k]
  ------------------
 3110|      0|      sf->lpf_sf.min_lr_unit_size = RESTORATION_UNITSIZE_MAX >> 1;
  ------------------
  |  |   80|      0|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3111|      0|    }
 3112|  49.2k|  }
 3113|       |
 3114|  49.2k|  if (speed >= 3 || (cpi->oxcf.mode == ALLINTRA && speed >= 1)) {
  ------------------
  |  Branch (3114:7): [True: 49.2k, False: 0]
  |  Branch (3114:22): [True: 0, False: 0]
  |  Branch (3114:52): [True: 0, False: 0]
  ------------------
 3115|       |    // At this speed, a full search is too expensive. Instead, pick a single
 3116|       |    // size based on size and qindex. Note that, in general, higher quantizers
 3117|       |    // (== lower quality) and larger frames generally want to use larger
 3118|       |    // restoration units.
 3119|  49.2k|    int qindex_thresh = 96;
 3120|  49.2k|    if (cm->quant_params.base_qindex <= qindex_thresh && !is_1440p_or_larger) {
  ------------------
  |  Branch (3120:9): [True: 16.1k, False: 33.1k]
  |  Branch (3120:58): [True: 16.1k, False: 0]
  ------------------
 3121|  16.1k|      sf->lpf_sf.min_lr_unit_size = RESTORATION_UNITSIZE_MAX >> 1;
  ------------------
  |  |   80|  16.1k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3122|  16.1k|      sf->lpf_sf.max_lr_unit_size = RESTORATION_UNITSIZE_MAX >> 1;
  ------------------
  |  |   80|  16.1k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3123|  33.1k|    } else {
 3124|  33.1k|      sf->lpf_sf.min_lr_unit_size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  33.1k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3125|  33.1k|      sf->lpf_sf.max_lr_unit_size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|  33.1k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 3126|  33.1k|    }
 3127|  49.2k|  }
 3128|       |
 3129|  49.2k|  set_subpel_search_method(&cpi->mv_search_params,
 3130|  49.2k|                           cpi->oxcf.unit_test_cfg.motion_vector_unit_test,
 3131|  49.2k|                           sf->mv_sf.subpel_search_method);
 3132|       |
 3133|  49.2k|  if (cpi->oxcf.enable_low_complexity_decode && cpi->oxcf.mode == GOOD)
  ------------------
  |  Branch (3133:7): [True: 0, False: 49.2k]
  |  Branch (3133:49): [True: 0, False: 0]
  ------------------
 3134|      0|    set_good_speed_features_lc_dec_qindex_dependent(cpi, sf, speed);
 3135|  49.2k|}
speed_features.c:set_good_speed_feature_framesize_dependent:
  714|  73.8k|    const AV1_COMP *const cpi, SPEED_FEATURES *const sf, int speed) {
  715|  73.8k|  const AV1_COMMON *const cm = &cpi->common;
  716|  73.8k|  const int is_480p_or_lesser = AOMMIN(cm->width, cm->height) <= 480;
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 41.1k]
  |  |  ------------------
  ------------------
  717|  73.8k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 41.1k]
  |  |  ------------------
  ------------------
  718|  73.8k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 41.1k]
  |  |  ------------------
  ------------------
  719|  73.8k|  const int is_1080p_or_larger = AOMMIN(cm->width, cm->height) >= 1080;
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 41.1k]
  |  |  ------------------
  ------------------
  720|  73.8k|  const int is_4k_or_larger = AOMMIN(cm->width, cm->height) >= 2160;
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 32.7k, False: 41.1k]
  |  |  ------------------
  ------------------
  721|  73.8k|  const bool use_hbd = cpi->oxcf.use_highbitdepth;
  722|       |  // Speed features applicable for temporal filtering and tpl modules may be
  723|       |  // changed based on frame type at places where the sf is applied (Example :
  724|       |  // use_downsampled_sad). This is because temporal filtering and tpl modules
  725|       |  // are called before this function (except for the first key frame).
  726|       |  // TODO(deepa.kg@ittiam.com): For the speed features applicable to temporal
  727|       |  // filtering and tpl modules, modify the sf initialization appropriately
  728|       |  // before calling the modules.
  729|  73.8k|  const int boosted = frame_is_boosted(cpi);
  730|  73.8k|  const int is_boosted_arf2_bwd_type =
  731|  73.8k|      boosted ||
  ------------------
  |  Branch (731:7): [True: 36.9k, False: 36.9k]
  ------------------
  732|  36.9k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE;
  ------------------
  |  Branch (732:7): [True: 0, False: 36.9k]
  ------------------
  733|  73.8k|  const int is_lf_frame =
  734|  73.8k|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index] == LF_UPDATE;
  735|  73.8k|  const int allow_screen_content_tools =
  736|  73.8k|      cm->features.allow_screen_content_tools;
  737|       |
  738|  73.8k|  if (is_480p_or_larger) {
  ------------------
  |  Branch (738:7): [True: 0, False: 73.8k]
  ------------------
  739|      0|    sf->part_sf.use_square_partition_only_threshold = BLOCK_128X128;
  740|      0|    if (is_720p_or_larger)
  ------------------
  |  Branch (740:9): [True: 0, False: 0]
  ------------------
  741|      0|      sf->part_sf.auto_max_partition_based_on_simple_motion = ADAPT_PRED;
  742|      0|    else
  743|      0|      sf->part_sf.auto_max_partition_based_on_simple_motion = RELAXED_PRED;
  744|  73.8k|  } else {
  745|  73.8k|    sf->part_sf.use_square_partition_only_threshold = BLOCK_64X64;
  746|  73.8k|    sf->part_sf.auto_max_partition_based_on_simple_motion = DIRECT_PRED;
  747|  73.8k|    if (use_hbd) sf->tx_sf.prune_tx_size_level = 1;
  ------------------
  |  Branch (747:9): [True: 23.7k, False: 50.1k]
  ------------------
  748|  73.8k|  }
  749|       |
  750|  73.8k|  if (is_4k_or_larger) {
  ------------------
  |  Branch (750:7): [True: 0, False: 73.8k]
  ------------------
  751|      0|    sf->part_sf.default_min_partition_size = BLOCK_8X8;
  752|      0|  }
  753|       |
  754|       |  // TODO(huisu@google.com): train models for 720P and above.
  755|  73.8k|  if (!is_720p_or_larger) {
  ------------------
  |  Branch (755:7): [True: 73.8k, False: 0]
  ------------------
  756|  73.8k|    sf->part_sf.ml_partition_search_breakout_thresh[0] = -1.0f;
  757|  73.8k|    sf->part_sf.ml_partition_search_breakout_thresh[1] = 0.993307f;
  758|  73.8k|    sf->part_sf.ml_partition_search_breakout_thresh[2] = 0.952574f;
  759|  73.8k|    sf->part_sf.ml_partition_search_breakout_thresh[3] = 0.924142f;
  760|  73.8k|    sf->part_sf.ml_partition_search_breakout_thresh[4] = 0.880797f;
  761|  73.8k|    sf->part_sf.ml_early_term_after_part_split_level = 1;
  762|  73.8k|  }
  763|       |
  764|  73.8k|  sf->part_sf.ml_partition_search_breakout_model_index = 0;
  765|       |
  766|  73.8k|  if (is_720p_or_larger) {
  ------------------
  |  Branch (766:7): [True: 0, False: 73.8k]
  ------------------
  767|       |    // TODO(chiyotsai@google.com): make this speed feature adaptive based on
  768|       |    // current block's vertical texture instead of hardcoded with resolution
  769|      0|    sf->mv_sf.use_downsampled_sad = 2;
  770|      0|  }
  771|       |
  772|  73.8k|  if (!is_720p_or_larger) {
  ------------------
  |  Branch (772:7): [True: 73.8k, False: 0]
  ------------------
  773|  73.8k|    const RateControlCfg *const rc_cfg = &cpi->oxcf.rc_cfg;
  774|  73.8k|    const int rate_tolerance =
  775|  73.8k|        AOMMIN(rc_cfg->under_shoot_pct, rc_cfg->over_shoot_pct);
  ------------------
  |  |   34|  73.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 73.8k]
  |  |  ------------------
  ------------------
  776|  73.8k|    sf->hl_sf.recode_tolerance = 25 + (rate_tolerance >> 2);
  777|  73.8k|  }
  778|       |
  779|  73.8k|  if (speed >= 1) {
  ------------------
  |  Branch (779:7): [True: 61.5k, False: 12.3k]
  ------------------
  780|  61.5k|    sf->part_sf.ml_4_partition_search_level_index = 1;
  781|  61.5k|    sf->inter_sf.skip_newmv_in_drl = 1;
  782|       |
  783|  61.5k|    if (is_480p_or_lesser) {
  ------------------
  |  Branch (783:9): [True: 61.5k, False: 0]
  ------------------
  784|  61.5k|      sf->inter_sf.skip_cmp_using_top_cmp_avg_est_rd_lvl = 1;
  785|  61.5k|    } else {
  786|      0|      sf->inter_sf.skip_cmp_using_top_cmp_avg_est_rd_lvl = 2;
  787|      0|    }
  788|       |
  789|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (789:9): [True: 0, False: 61.5k]
  ------------------
  790|      0|      sf->part_sf.use_square_partition_only_threshold = BLOCK_128X128;
  791|  61.5k|    } else if (is_480p_or_larger) {
  ------------------
  |  Branch (791:16): [True: 0, False: 61.5k]
  ------------------
  792|      0|      sf->part_sf.use_square_partition_only_threshold = BLOCK_64X64;
  793|  61.5k|    } else {
  794|  61.5k|      sf->part_sf.use_square_partition_only_threshold = BLOCK_32X32;
  795|  61.5k|    }
  796|       |
  797|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (797:9): [True: 0, False: 61.5k]
  ------------------
  798|      0|      sf->part_sf.ml_partition_search_breakout_thresh[0] = 0.5f;
  799|      0|      sf->part_sf.ml_partition_search_breakout_thresh[1] = 0.5042595622791082f;
  800|      0|      sf->part_sf.ml_partition_search_breakout_thresh[2] = 0.5f;
  801|      0|      sf->part_sf.ml_partition_search_breakout_thresh[3] = 0.8378425823517456f;
  802|      0|      sf->part_sf.ml_partition_search_breakout_thresh[4] = 0.8047585616503903f;
  803|      0|      sf->part_sf.ml_partition_search_breakout_model_index = 1;
  804|  61.5k|    } else {
  805|  61.5k|      sf->part_sf.ml_partition_search_breakout_thresh[0] = -1.0f;
  806|  61.5k|      sf->part_sf.ml_partition_search_breakout_thresh[1] = 0.952574f;
  807|  61.5k|      sf->part_sf.ml_partition_search_breakout_thresh[2] = 0.952574f;
  808|  61.5k|      sf->part_sf.ml_partition_search_breakout_thresh[3] = 0.924142f;
  809|  61.5k|      sf->part_sf.ml_partition_search_breakout_thresh[4] = 0.880797f;
  810|  61.5k|    }
  811|  61.5k|    sf->part_sf.ml_early_term_after_part_split_level = 2;
  812|       |
  813|  61.5k|    sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL1;
  814|  61.5k|  }
  815|       |
  816|  73.8k|  if (speed >= 2) {
  ------------------
  |  Branch (816:7): [True: 61.5k, False: 12.3k]
  ------------------
  817|  61.5k|    sf->part_sf.ml_4_partition_search_level_index = 2;
  818|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (818:9): [True: 0, False: 61.5k]
  ------------------
  819|      0|      sf->part_sf.use_square_partition_only_threshold = BLOCK_64X64;
  820|  61.5k|    } else {
  821|  61.5k|      sf->part_sf.use_square_partition_only_threshold = BLOCK_32X32;
  822|  61.5k|    }
  823|       |
  824|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (824:9): [True: 0, False: 61.5k]
  ------------------
  825|      0|      sf->part_sf.ml_partition_search_breakout_thresh[0] = 0.5f;
  826|      0|      sf->part_sf.ml_partition_search_breakout_thresh[1] = 0.5042595622791082f;
  827|      0|      sf->part_sf.ml_partition_search_breakout_thresh[2] = 0.5f;
  828|      0|      sf->part_sf.ml_partition_search_breakout_thresh[3] = 0.8378425823517456f;
  829|      0|      sf->part_sf.ml_partition_search_breakout_thresh[4] = 0.8047585616503903f;
  830|      0|      sf->part_sf.ml_partition_search_breakout_model_index = 1;
  831|      0|    }
  832|       |
  833|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (833:9): [True: 0, False: 61.5k]
  ------------------
  834|      0|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 24);
  835|      0|      sf->part_sf.partition_search_breakout_rate_thr = 120;
  836|  61.5k|    } else {
  837|  61.5k|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 22);
  838|  61.5k|      sf->part_sf.partition_search_breakout_rate_thr = 100;
  839|  61.5k|    }
  840|       |
  841|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (841:9): [True: 0, False: 61.5k]
  ------------------
  842|      0|      sf->inter_sf.prune_obmc_prob_thresh = 16;
  843|  61.5k|    } else {
  844|  61.5k|      sf->inter_sf.prune_obmc_prob_thresh = 8;
  845|  61.5k|    }
  846|       |
  847|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (847:9): [True: 0, False: 61.5k]
  ------------------
  848|      0|      sf->inter_sf.disable_interintra_wedge_var_thresh = 100;
  849|  61.5k|    } else {
  850|  61.5k|      sf->inter_sf.disable_interintra_wedge_var_thresh = UINT_MAX;
  851|  61.5k|    }
  852|       |
  853|  61.5k|    if (is_480p_or_lesser) sf->inter_sf.skip_ext_comp_nearmv_mode = 1;
  ------------------
  |  Branch (853:9): [True: 61.5k, False: 0]
  ------------------
  854|       |
  855|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (855:9): [True: 0, False: 61.5k]
  ------------------
  856|      0|      sf->inter_sf.limit_inter_mode_cands = is_lf_frame ? 1 : 0;
  ------------------
  |  Branch (856:45): [True: 0, False: 0]
  ------------------
  857|  61.5k|    } else {
  858|  61.5k|      sf->inter_sf.limit_inter_mode_cands = is_lf_frame ? 2 : 0;
  ------------------
  |  Branch (858:45): [True: 36.9k, False: 24.6k]
  ------------------
  859|  61.5k|    }
  860|       |
  861|  61.5k|    sf->inter_sf.skip_cmp_using_top_cmp_avg_est_rd_lvl = 3;
  862|       |
  863|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (863:9): [True: 0, False: 61.5k]
  ------------------
  864|      0|      sf->tx_sf.tx_type_search.prune_tx_type_using_stats = 1;
  865|      0|      if (use_hbd) sf->tx_sf.prune_tx_size_level = 2;
  ------------------
  |  Branch (865:11): [True: 0, False: 0]
  ------------------
  866|  61.5k|    } else {
  867|  61.5k|      if (use_hbd) sf->tx_sf.prune_tx_size_level = 3;
  ------------------
  |  Branch (867:11): [True: 19.7k, False: 41.7k]
  ------------------
  868|  61.5k|      sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = boosted ? 0 : 1;
  ------------------
  |  Branch (868:62): [True: 24.6k, False: 36.9k]
  ------------------
  869|  61.5k|      sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch = boosted ? 0 : 1;
  ------------------
  |  Branch (869:64): [True: 24.6k, False: 36.9k]
  ------------------
  870|  61.5k|    }
  871|       |
  872|  61.5k|    if (!is_720p_or_larger) {
  ------------------
  |  Branch (872:9): [True: 61.5k, False: 0]
  ------------------
  873|  61.5k|      sf->mv_sf.disable_second_mv = 1;
  874|  61.5k|      sf->mv_sf.auto_mv_step_size = 2;
  875|  61.5k|    } else {
  876|      0|      sf->mv_sf.disable_second_mv = boosted ? 0 : 2;
  ------------------
  |  Branch (876:37): [True: 0, False: 0]
  ------------------
  877|      0|      sf->mv_sf.auto_mv_step_size = 1;
  878|      0|    }
  879|       |
  880|  61.5k|    if (!is_720p_or_larger) {
  ------------------
  |  Branch (880:9): [True: 61.5k, False: 0]
  ------------------
  881|  61.5k|      sf->hl_sf.recode_tolerance = 50;
  882|  61.5k|      sf->inter_sf.disable_interinter_wedge_newmv_search =
  883|  61.5k|          is_boosted_arf2_bwd_type ? 0 : 1;
  ------------------
  |  Branch (883:11): [True: 24.6k, False: 36.9k]
  ------------------
  884|  61.5k|      sf->inter_sf.enable_fast_wedge_mask_search = 1;
  885|  61.5k|    }
  886|  61.5k|  }
  887|       |
  888|  73.8k|  if (speed >= 3) {
  ------------------
  |  Branch (888:7): [True: 61.5k, False: 12.3k]
  ------------------
  889|  61.5k|    sf->inter_sf.enable_fast_wedge_mask_search = 1;
  890|  61.5k|    sf->inter_sf.skip_newmv_in_drl = 2;
  891|  61.5k|    sf->inter_sf.skip_ext_comp_nearmv_mode = 1;
  892|  61.5k|    sf->inter_sf.limit_inter_mode_cands = is_lf_frame ? 3 : 0;
  ------------------
  |  Branch (892:43): [True: 36.9k, False: 24.6k]
  ------------------
  893|  61.5k|    sf->inter_sf.disable_interinter_wedge_newmv_search = boosted ? 0 : 1;
  ------------------
  |  Branch (893:58): [True: 24.6k, False: 36.9k]
  ------------------
  894|  61.5k|    sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = 1;
  895|  61.5k|    sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch =
  896|  61.5k|        frame_is_intra_only(&cpi->common) ? 0 : 1;
  ------------------
  |  Branch (896:9): [True: 24.6k, False: 36.9k]
  ------------------
  897|       |
  898|  61.5k|    sf->part_sf.ml_early_term_after_part_split_level = 0;
  899|       |
  900|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (900:9): [True: 0, False: 61.5k]
  ------------------
  901|      0|      for (int i = 0; i < PARTITION_BLOCK_SIZES; ++i) {
  ------------------
  |  |  170|      0|#define PARTITION_BLOCK_SIZES 5
  ------------------
  |  Branch (901:23): [True: 0, False: 0]
  ------------------
  902|      0|        sf->part_sf.ml_partition_search_breakout_thresh[i] =
  903|      0|            -1;  // -1 means not enabled.
  904|      0|      }
  905|      0|      sf->part_sf.ml_partition_search_breakout_model_index = 0;
  906|      0|    }
  907|       |
  908|  61.5k|    sf->part_sf.ml_4_partition_search_level_index = 3;
  909|       |
  910|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (910:9): [True: 0, False: 61.5k]
  ------------------
  911|      0|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 25);
  912|      0|      sf->part_sf.partition_search_breakout_rate_thr = 200;
  913|      0|      sf->part_sf.skip_non_sq_part_based_on_none = is_lf_frame ? 2 : 0;
  ------------------
  |  Branch (913:52): [True: 0, False: 0]
  ------------------
  914|  61.5k|    } else {
  915|  61.5k|      sf->part_sf.max_intra_bsize = BLOCK_32X32;
  916|  61.5k|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 23);
  917|  61.5k|      sf->part_sf.partition_search_breakout_rate_thr = 120;
  918|  61.5k|      sf->part_sf.skip_non_sq_part_based_on_none = is_lf_frame ? 1 : 0;
  ------------------
  |  Branch (918:52): [True: 36.9k, False: 24.6k]
  ------------------
  919|  61.5k|    }
  920|  61.5k|    if (use_hbd) sf->tx_sf.prune_tx_size_level = 3;
  ------------------
  |  Branch (920:9): [True: 19.7k, False: 41.7k]
  ------------------
  921|       |
  922|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (922:9): [True: 0, False: 61.5k]
  ------------------
  923|      0|      sf->part_sf.early_term_after_none_split = 1;
  924|  61.5k|    } else {
  925|  61.5k|      sf->part_sf.early_term_after_none_split = 0;
  926|  61.5k|    }
  927|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (927:9): [True: 0, False: 61.5k]
  ------------------
  928|      0|      sf->intra_sf.skip_intra_in_interframe = boosted ? 1 : 2;
  ------------------
  |  Branch (928:47): [True: 0, False: 0]
  ------------------
  929|  61.5k|    } else {
  930|  61.5k|      sf->intra_sf.skip_intra_in_interframe = boosted ? 1 : 3;
  ------------------
  |  Branch (930:47): [True: 24.6k, False: 36.9k]
  ------------------
  931|  61.5k|    }
  932|       |
  933|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (933:9): [True: 0, False: 61.5k]
  ------------------
  934|      0|      sf->inter_sf.disable_interinter_wedge_var_thresh = 100;
  935|      0|      sf->inter_sf.skip_interinter_wedge_search_based_on_mse = 1;
  936|      0|      sf->inter_sf.limit_txfm_eval_per_mode = boosted ? 0 : 1;
  ------------------
  |  Branch (936:47): [True: 0, False: 0]
  ------------------
  937|  61.5k|    } else {
  938|  61.5k|      sf->inter_sf.disable_interinter_wedge_var_thresh = UINT_MAX;
  939|  61.5k|      sf->inter_sf.limit_txfm_eval_per_mode = boosted ? 0 : 2;
  ------------------
  |  Branch (939:47): [True: 24.6k, False: 36.9k]
  ------------------
  940|  61.5k|      sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL2;
  941|  61.5k|    }
  942|       |
  943|  61.5k|    if (is_480p_or_lesser) {
  ------------------
  |  Branch (943:9): [True: 61.5k, False: 0]
  ------------------
  944|  61.5k|      sf->inter_sf.prune_comp_ref_frames = 0;
  945|  61.5k|    } else {
  946|      0|      sf->inter_sf.prune_comp_ref_frames = 1;
  947|      0|    }
  948|       |
  949|  61.5k|    sf->inter_sf.disable_interintra_wedge_var_thresh = UINT_MAX;
  950|  61.5k|  }
  951|       |
  952|  73.8k|  if (speed >= 4) {
  ------------------
  |  Branch (952:7): [True: 61.5k, False: 12.3k]
  ------------------
  953|  61.5k|    sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = 2;
  954|  61.5k|    sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch = 1;
  955|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (955:9): [True: 0, False: 61.5k]
  ------------------
  956|      0|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 26);
  957|  61.5k|    } else {
  958|  61.5k|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 24);
  959|  61.5k|    }
  960|  61.5k|    sf->part_sf.early_term_after_none_split = 1;
  961|       |
  962|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (962:9): [True: 0, False: 61.5k]
  ------------------
  963|      0|      sf->tx_sf.tx_type_search.prune_tx_type_using_stats = 2;
  964|  61.5k|    } else {
  965|  61.5k|      sf->mv_sf.skip_fullpel_search_using_startmv_refmv = boosted ? 0 : 1;
  ------------------
  |  Branch (965:59): [True: 24.6k, False: 36.9k]
  ------------------
  966|  61.5k|    }
  967|       |
  968|  61.5k|    sf->inter_sf.disable_interinter_wedge_var_thresh = UINT_MAX;
  969|  61.5k|    sf->inter_sf.prune_obmc_prob_thresh = INT_MAX;
  970|  61.5k|    sf->inter_sf.limit_txfm_eval_per_mode = boosted ? 0 : 2;
  ------------------
  |  Branch (970:45): [True: 24.6k, False: 36.9k]
  ------------------
  971|  61.5k|    if (is_480p_or_lesser) sf->inter_sf.skip_newmv_in_drl = 3;
  ------------------
  |  Branch (971:9): [True: 61.5k, False: 0]
  ------------------
  972|       |
  973|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (973:9): [True: 0, False: 61.5k]
  ------------------
  974|      0|      sf->inter_sf.prune_comp_ref_frames = 2;
  975|  61.5k|    } else if (is_480p_or_larger) {
  ------------------
  |  Branch (975:16): [True: 0, False: 61.5k]
  ------------------
  976|      0|      sf->inter_sf.prune_comp_ref_frames = is_boosted_arf2_bwd_type ? 0 : 2;
  ------------------
  |  Branch (976:44): [True: 0, False: 0]
  ------------------
  977|      0|    }
  978|       |
  979|  61.5k|    if (is_720p_or_larger)
  ------------------
  |  Branch (979:9): [True: 0, False: 61.5k]
  ------------------
  980|      0|      sf->hl_sf.recode_tolerance = 32;
  981|  61.5k|    else
  982|  61.5k|      sf->hl_sf.recode_tolerance = 55;
  983|       |
  984|  61.5k|    sf->intra_sf.skip_intra_in_interframe = 4;
  985|       |
  986|  61.5k|    sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL3;
  987|  61.5k|  }
  988|       |
  989|  73.8k|  if (speed >= 5) {
  ------------------
  |  Branch (989:7): [True: 61.5k, False: 12.3k]
  ------------------
  990|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (990:9): [True: 0, False: 61.5k]
  ------------------
  991|      0|      sf->inter_sf.prune_warped_prob_thresh = 16;
  992|  61.5k|    } else if (is_480p_or_larger) {
  ------------------
  |  Branch (992:16): [True: 0, False: 61.5k]
  ------------------
  993|      0|      sf->inter_sf.prune_warped_prob_thresh = 8;
  994|      0|    }
  995|  61.5k|    if (is_720p_or_larger) sf->hl_sf.recode_tolerance = 40;
  ------------------
  |  Branch (995:9): [True: 0, False: 61.5k]
  ------------------
  996|       |
  997|  61.5k|    sf->inter_sf.skip_newmv_in_drl = 4;
  998|  61.5k|    sf->inter_sf.prune_comp_ref_frames = 2;
  999|  61.5k|    sf->mv_sf.skip_fullpel_search_using_startmv_refmv = boosted ? 0 : 1;
  ------------------
  |  Branch (999:57): [True: 24.6k, False: 36.9k]
  ------------------
 1000|       |
 1001|  61.5k|    if (!is_720p_or_larger) {
  ------------------
  |  Branch (1001:9): [True: 61.5k, False: 0]
  ------------------
 1002|  61.5k|      sf->inter_sf.mv_cost_upd_level = INTERNAL_COST_UPD_SBROW_SET;
 1003|  61.5k|      sf->inter_sf.prune_nearest_near_mv_using_refmv_weight =
 1004|  61.5k|          (boosted || allow_screen_content_tools) ? 0 : 1;
  ------------------
  |  Branch (1004:12): [True: 24.6k, False: 36.9k]
  |  Branch (1004:23): [True: 5.94k, False: 30.9k]
  ------------------
 1005|  61.5k|      sf->mv_sf.use_downsampled_sad = 1;
 1006|  61.5k|    }
 1007|       |
 1008|  61.5k|    if (!is_480p_or_larger) {
  ------------------
  |  Branch (1008:9): [True: 61.5k, False: 0]
  ------------------
 1009|  61.5k|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 26);
 1010|  61.5k|    }
 1011|       |
 1012|  61.5k|    if (is_480p_or_lesser) {
  ------------------
  |  Branch (1012:9): [True: 61.5k, False: 0]
  ------------------
 1013|  61.5k|      sf->inter_sf.prune_nearmv_using_neighbors = PRUNE_NEARMV_LEVEL1;
 1014|  61.5k|    } else {
 1015|      0|      sf->inter_sf.prune_nearmv_using_neighbors = PRUNE_NEARMV_LEVEL2;
 1016|      0|    }
 1017|       |
 1018|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (1018:9): [True: 0, False: 61.5k]
  ------------------
 1019|      0|      sf->part_sf.ext_part_eval_based_on_cur_best =
 1020|      0|          (allow_screen_content_tools || frame_is_intra_only(cm)) ? 0 : 1;
  ------------------
  |  Branch (1020:12): [True: 0, False: 0]
  |  Branch (1020:42): [True: 0, False: 0]
  ------------------
 1021|      0|      sf->part_sf.auto_max_partition_based_on_simple_motion = NOT_IN_USE;
 1022|      0|    }
 1023|       |
 1024|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 61.5k]
  ------------------
 1025|      0|      sf->tpl_sf.reduce_num_frames = 1;
 1026|      0|    }
 1027|  61.5k|  }
 1028|       |
 1029|  73.8k|  if (speed >= 6) {
  ------------------
  |  Branch (1029:7): [True: 61.5k, False: 12.3k]
  ------------------
 1030|  61.5k|    sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = 4;
 1031|  61.5k|    sf->inter_sf.prune_nearmv_using_neighbors = PRUNE_NEARMV_LEVEL3;
 1032|  61.5k|    sf->inter_sf.prune_comp_ref_frames = 3;
 1033|  61.5k|    sf->inter_sf.prune_nearest_near_mv_using_refmv_weight =
 1034|  61.5k|        (boosted || allow_screen_content_tools) ? 0 : 1;
  ------------------
  |  Branch (1034:10): [True: 24.6k, False: 36.9k]
  |  Branch (1034:21): [True: 5.94k, False: 30.9k]
  ------------------
 1035|  61.5k|    sf->mv_sf.skip_fullpel_search_using_startmv_refmv = boosted ? 0 : 2;
  ------------------
  |  Branch (1035:57): [True: 24.6k, False: 36.9k]
  ------------------
 1036|       |
 1037|  61.5k|    if (is_480p_or_larger && !is_720p_or_larger) {
  ------------------
  |  Branch (1037:9): [True: 0, False: 61.5k]
  |  Branch (1037:30): [True: 0, False: 0]
  ------------------
 1038|      0|      sf->part_sf.auto_max_partition_based_on_simple_motion = DIRECT_PRED;
 1039|      0|    }
 1040|       |
 1041|  61.5k|    if (is_480p_or_larger) {
  ------------------
  |  Branch (1041:9): [True: 0, False: 61.5k]
  ------------------
 1042|      0|      sf->hl_sf.allow_sub_blk_me_in_tf = 1;
 1043|      0|    }
 1044|       |
 1045|  61.5k|    if (is_1080p_or_larger) {
  ------------------
  |  Branch (1045:9): [True: 0, False: 61.5k]
  ------------------
 1046|      0|      sf->part_sf.default_min_partition_size = BLOCK_8X8;
 1047|      0|    }
 1048|       |
 1049|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (1049:9): [True: 0, False: 61.5k]
  ------------------
 1050|      0|      sf->inter_sf.disable_masked_comp = 1;
 1051|      0|    }
 1052|       |
 1053|  61.5k|    if (!is_720p_or_larger) {
  ------------------
  |  Branch (1053:9): [True: 61.5k, False: 0]
  ------------------
 1054|  61.5k|      sf->inter_sf.coeff_cost_upd_level = INTERNAL_COST_UPD_SBROW;
 1055|  61.5k|      sf->inter_sf.mode_cost_upd_level = INTERNAL_COST_UPD_SBROW;
 1056|  61.5k|    }
 1057|       |
 1058|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 61.5k]
  ------------------
 1059|      0|      sf->part_sf.use_square_partition_only_threshold = BLOCK_32X32;
 1060|      0|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 28);
 1061|  61.5k|    } else {
 1062|  61.5k|      sf->part_sf.use_square_partition_only_threshold = BLOCK_16X16;
 1063|  61.5k|      sf->part_sf.partition_search_breakout_dist_thr = (1 << 26);
 1064|  61.5k|    }
 1065|       |
 1066|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (1066:9): [True: 0, False: 61.5k]
  ------------------
 1067|      0|      sf->inter_sf.prune_ref_mv_idx_search = 2;
 1068|  61.5k|    } else {
 1069|  61.5k|      sf->inter_sf.prune_ref_mv_idx_search = 1;
 1070|  61.5k|    }
 1071|       |
 1072|  61.5k|    if (is_720p_or_larger) {
  ------------------
  |  Branch (1072:9): [True: 0, False: 61.5k]
  ------------------
 1073|      0|      sf->mv_sf.use_bsize_dependent_search_method = 1;
 1074|  61.5k|    } else {
 1075|  61.5k|      sf->mv_sf.use_bsize_dependent_search_method = 2;
 1076|  61.5k|    }
 1077|       |
 1078|  61.5k|    if (!is_720p_or_larger) {
  ------------------
  |  Branch (1078:9): [True: 61.5k, False: 0]
  ------------------
 1079|  61.5k|      sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh =
 1080|  61.5k|          is_boosted_arf2_bwd_type ? 450 : 150;
  ------------------
  |  Branch (1080:11): [True: 24.6k, False: 36.9k]
  ------------------
 1081|  61.5k|    }
 1082|       |
 1083|  61.5k|    sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL4;
 1084|       |
 1085|  61.5k|    sf->hl_sf.recode_tolerance = 55;
 1086|  61.5k|  }
 1087|       |
 1088|  73.8k|  if (cpi->oxcf.enable_low_complexity_decode)
  ------------------
  |  Branch (1088:7): [True: 0, False: 73.8k]
  ------------------
 1089|      0|    set_good_speed_features_lc_dec_framesize_dependent(cpi, sf, speed);
 1090|       |
 1091|  73.8k|  if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (1091:7): [True: 43.0k, False: 30.7k]
  ------------------
 1092|  43.0k|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (1092:7): [True: 0, False: 30.7k]
  ------------------
 1093|  43.0k|    sf->intra_sf.skip_intra_in_interframe = 0;
 1094|  43.0k|  }
 1095|  73.8k|}
speed_features.c:set_rt_speed_feature_framesize_dependent:
 1547|  36.6k|                                                     int speed) {
 1548|  36.6k|  const AV1_COMMON *const cm = &cpi->common;
 1549|  36.6k|  const int boosted = frame_is_boosted(cpi);
 1550|  36.6k|  const int is_1080p_or_larger = AOMMIN(cm->width, cm->height) >= 1080;
  ------------------
  |  |   34|  36.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.3k, False: 21.2k]
  |  |  ------------------
  ------------------
 1551|  36.6k|  const int is_720p_or_larger = AOMMIN(cm->width, cm->height) >= 720;
  ------------------
  |  |   34|  36.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.3k, False: 21.2k]
  |  |  ------------------
  ------------------
 1552|  36.6k|  const int is_480p_or_larger = AOMMIN(cm->width, cm->height) >= 480;
  ------------------
  |  |   34|  36.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.3k, False: 21.2k]
  |  |  ------------------
  ------------------
 1553|  36.6k|  const int is_360p_or_larger = AOMMIN(cm->width, cm->height) >= 360;
  ------------------
  |  |   34|  36.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.3k, False: 21.2k]
  |  |  ------------------
  ------------------
 1554|       |
 1555|  36.6k|  if (!is_360p_or_larger) {
  ------------------
  |  Branch (1555:7): [True: 36.6k, False: 0]
  ------------------
 1556|  36.6k|    sf->rt_sf.prune_intra_mode_based_on_mv_range = 1;
 1557|  36.6k|    sf->rt_sf.prune_inter_modes_wrt_gf_arf_based_on_sad = 1;
 1558|  36.6k|    if (speed >= 6)
  ------------------
  |  Branch (1558:9): [True: 30.5k, False: 6.10k]
  ------------------
 1559|  30.5k|      sf->winner_mode_sf.prune_winner_mode_eval_level = boosted ? 0 : 2;
  ------------------
  |  Branch (1559:57): [True: 21.2k, False: 9.28k]
  ------------------
 1560|  36.6k|    if (speed == 7) sf->rt_sf.prefer_large_partition_blocks = 2;
  ------------------
  |  Branch (1560:9): [True: 10.6k, False: 25.9k]
  ------------------
 1561|  36.6k|    if (speed >= 7) {
  ------------------
  |  Branch (1561:9): [True: 30.5k, False: 6.10k]
  ------------------
 1562|  30.5k|      sf->lpf_sf.cdef_pick_method = CDEF_PICK_FROM_Q;
 1563|  30.5k|      sf->rt_sf.check_only_zero_zeromv_on_large_blocks = true;
 1564|  30.5k|      sf->rt_sf.use_rtc_tf = 2;
 1565|  30.5k|    }
 1566|  36.6k|    if (speed == 8) sf->rt_sf.prefer_large_partition_blocks = 1;
  ------------------
  |  Branch (1566:9): [True: 8.59k, False: 28.0k]
  ------------------
 1567|  36.6k|    if (speed >= 8) {
  ------------------
  |  Branch (1567:9): [True: 19.8k, False: 16.7k]
  ------------------
 1568|  19.8k|      sf->rt_sf.use_nonrd_filter_search = 1;
 1569|  19.8k|      sf->rt_sf.tx_size_level_based_on_qstep = 1;
 1570|  19.8k|    }
 1571|  36.6k|    if (speed >= 9) {
  ------------------
  |  Branch (1571:9): [True: 11.2k, False: 25.3k]
  ------------------
 1572|  11.2k|      sf->rt_sf.use_comp_ref_nonrd = 0;
 1573|  11.2k|      sf->rt_sf.nonrd_aggressive_skip = 1;
 1574|  11.2k|      sf->rt_sf.skip_intra_pred = 1;
 1575|       |      // Only turn on enable_ref_short_signaling for low resolution when only
 1576|       |      // LAST and GOLDEN ref frames are used.
 1577|  11.2k|      sf->rt_sf.enable_ref_short_signaling =
 1578|  11.2k|          (!sf->rt_sf.use_nonrd_altref_frame &&
  ------------------
  |  Branch (1578:12): [True: 11.2k, False: 0]
  ------------------
 1579|  11.2k|           (!sf->rt_sf.use_comp_ref_nonrd ||
  ------------------
  |  Branch (1579:13): [True: 11.2k, False: 0]
  ------------------
 1580|      0|            (!sf->rt_sf.ref_frame_comp_nonrd[1] &&
  ------------------
  |  Branch (1580:14): [True: 0, False: 0]
  ------------------
 1581|      0|             !sf->rt_sf.ref_frame_comp_nonrd[2])));
  ------------------
  |  Branch (1581:14): [True: 0, False: 0]
  ------------------
 1582|       |
 1583|       |// TODO(kyslov) Re-enable when AV1 models are trained
 1584|       |#if 0
 1585|       |#if CONFIG_RT_ML_PARTITIONING
 1586|       |      if (!frame_is_intra_only(cm)) {
 1587|       |        sf->part_sf.partition_search_type = ML_BASED_PARTITION;
 1588|       |        sf->rt_sf.reuse_inter_pred_nonrd = 0;
 1589|       |      }
 1590|       |#endif
 1591|       |#endif
 1592|  11.2k|      sf->rt_sf.use_adaptive_subpel_search = false;
 1593|  11.2k|    }
 1594|  36.6k|    if (speed >= 10) {
  ------------------
  |  Branch (1594:9): [True: 0, False: 36.6k]
  ------------------
 1595|       |      // TODO(yunqingwang@google.com): To be conservative, disable
 1596|       |      // sf->rt_sf.estimate_motion_for_var_based_partition = 3 for speed 10/qvga
 1597|       |      // for now. May enable it in the future.
 1598|      0|      sf->rt_sf.estimate_motion_for_var_based_partition = 0;
 1599|      0|      sf->rt_sf.skip_intra_pred = 2;
 1600|      0|      sf->rt_sf.hybrid_intra_pickmode = 3;
 1601|      0|      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 1;
 1602|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
 1603|      0|      sf->rt_sf.use_nonrd_filter_search = 0;
 1604|      0|    }
 1605|  36.6k|  } else {
 1606|      0|    sf->rt_sf.prune_intra_mode_based_on_mv_range = 2;
 1607|      0|    sf->intra_sf.skip_filter_intra_in_inter_frames = 1;
 1608|      0|    if (speed <= 5) {
  ------------------
  |  Branch (1608:9): [True: 0, False: 0]
  ------------------
 1609|      0|      sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh =
 1610|      0|          boosted ? INT_MAX : 350;
  ------------------
  |  Branch (1610:11): [True: 0, False: 0]
  ------------------
 1611|      0|      sf->winner_mode_sf.prune_winner_mode_eval_level = boosted ? 0 : 2;
  ------------------
  |  Branch (1611:57): [True: 0, False: 0]
  ------------------
 1612|      0|    }
 1613|      0|    if (speed == 6) sf->part_sf.disable_8x8_part_based_on_qidx = 1;
  ------------------
  |  Branch (1613:9): [True: 0, False: 0]
  ------------------
 1614|      0|    if (speed >= 6) sf->rt_sf.skip_newmv_mode_based_on_sse = 2;
  ------------------
  |  Branch (1614:9): [True: 0, False: 0]
  ------------------
 1615|      0|    if (speed == 7) {
  ------------------
  |  Branch (1615:9): [True: 0, False: 0]
  ------------------
 1616|      0|      sf->rt_sf.prefer_large_partition_blocks = 1;
 1617|       |      // Enable this feature for [360p, 720p] resolution range initially.
 1618|       |      // Only enable for low bitdepth to mitigate issue: b/303023614.
 1619|      0|      if (!cpi->rc.rtc_external_ratectrl &&
  ------------------
  |  Branch (1619:11): [True: 0, False: 0]
  ------------------
 1620|      0|          AOMMIN(cm->width, cm->height) <= 720 && !cpi->oxcf.use_highbitdepth)
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1620:11): [True: 0, False: 0]
  |  Branch (1620:51): [True: 0, False: 0]
  ------------------
 1621|      0|        sf->hl_sf.accurate_bit_estimate = cpi->oxcf.q_cfg.aq_mode == NO_AQ;
 1622|      0|    }
 1623|      0|    if (speed >= 7) {
  ------------------
  |  Branch (1623:9): [True: 0, False: 0]
  ------------------
 1624|      0|      sf->rt_sf.use_rtc_tf = 1;
 1625|      0|    }
 1626|      0|    if (speed == 8 && !cpi->ppi->use_svc) {
  ------------------
  |  Branch (1626:9): [True: 0, False: 0]
  |  Branch (1626:23): [True: 0, False: 0]
  ------------------
 1627|      0|      sf->rt_sf.short_circuit_low_temp_var = 0;
 1628|      0|      sf->rt_sf.use_nonrd_altref_frame = 1;
 1629|      0|    }
 1630|      0|    if (speed >= 8) sf->rt_sf.tx_size_level_based_on_qstep = 2;
  ------------------
  |  Branch (1630:9): [True: 0, False: 0]
  ------------------
 1631|      0|    if (speed >= 9) {
  ------------------
  |  Branch (1631:9): [True: 0, False: 0]
  ------------------
 1632|      0|      sf->rt_sf.gf_length_lvl = 1;
 1633|      0|      sf->rt_sf.skip_cdef_sb = 1;
 1634|      0|      sf->rt_sf.sad_based_adp_altref_lag = 2;
 1635|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
 1636|      0|      sf->rt_sf.use_adaptive_subpel_search = true;
 1637|      0|      sf->interp_sf.cb_pred_filter_search = 1;
 1638|      0|    }
 1639|      0|    if (speed >= 10) {
  ------------------
  |  Branch (1639:9): [True: 0, False: 0]
  ------------------
 1640|      0|      sf->rt_sf.hybrid_intra_pickmode = 2;
 1641|      0|      sf->rt_sf.sad_based_adp_altref_lag = 4;
 1642|      0|      sf->rt_sf.tx_size_level_based_on_qstep = 0;
 1643|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
 1644|      0|      sf->rt_sf.use_adaptive_subpel_search = false;
 1645|      0|      sf->interp_sf.cb_pred_filter_search = 2;
 1646|      0|    }
 1647|      0|  }
 1648|  36.6k|  if (!is_480p_or_larger) {
  ------------------
  |  Branch (1648:7): [True: 36.6k, False: 0]
  ------------------
 1649|  36.6k|    if (speed == 7) {
  ------------------
  |  Branch (1649:9): [True: 10.6k, False: 25.9k]
  ------------------
 1650|  10.6k|      sf->rt_sf.nonrd_check_partition_merge_mode = 2;
 1651|  10.6k|    }
 1652|  36.6k|  }
 1653|  36.6k|  if (!is_720p_or_larger) {
  ------------------
  |  Branch (1653:7): [True: 36.6k, False: 0]
  ------------------
 1654|  36.6k|    if (speed >= 9) {
  ------------------
  |  Branch (1654:9): [True: 11.2k, False: 25.3k]
  ------------------
 1655|  11.2k|      sf->rt_sf.force_large_partition_blocks_intra = 1;
 1656|  11.2k|    }
 1657|  36.6k|  } else {
 1658|      0|    if (speed >= 6) sf->rt_sf.skip_newmv_mode_based_on_sse = 3;
  ------------------
  |  Branch (1658:9): [True: 0, False: 0]
  ------------------
 1659|      0|    if (speed == 7) sf->rt_sf.prefer_large_partition_blocks = 0;
  ------------------
  |  Branch (1659:9): [True: 0, False: 0]
  ------------------
 1660|      0|    if (speed >= 7) {
  ------------------
  |  Branch (1660:9): [True: 0, False: 0]
  ------------------
 1661|      0|      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 2;
 1662|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 1;
 1663|      0|    }
 1664|      0|    if (speed >= 9) {
  ------------------
  |  Branch (1664:9): [True: 0, False: 0]
  ------------------
 1665|      0|      sf->rt_sf.sad_based_adp_altref_lag = 1;
 1666|      0|      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 0;
 1667|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
 1668|      0|    }
 1669|      0|    if (speed >= 10) {
  ------------------
  |  Branch (1669:9): [True: 0, False: 0]
  ------------------
 1670|      0|      sf->rt_sf.sad_based_adp_altref_lag = 3;
 1671|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
 1672|      0|    }
 1673|      0|  }
 1674|       |  // TODO(Any): Check/Tune settings of other sfs for 1080p.
 1675|  36.6k|  if (is_1080p_or_larger) {
  ------------------
  |  Branch (1675:7): [True: 0, False: 36.6k]
  ------------------
 1676|      0|    if (speed >= 7) {
  ------------------
  |  Branch (1676:9): [True: 0, False: 0]
  ------------------
 1677|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
 1678|      0|      sf->rt_sf.use_adaptive_subpel_search = 0;
 1679|      0|    }
 1680|      0|    if (speed >= 9) sf->interp_sf.cb_pred_filter_search = 0;
  ------------------
  |  Branch (1680:9): [True: 0, False: 0]
  ------------------
 1681|  36.6k|  } else {
 1682|  36.6k|    if (speed >= 9) sf->lpf_sf.cdef_pick_method = CDEF_PICK_FROM_Q;
  ------------------
  |  Branch (1682:9): [True: 11.2k, False: 25.3k]
  ------------------
 1683|  36.6k|    if (speed >= 10) sf->rt_sf.nonrd_aggressive_skip = 1;
  ------------------
  |  Branch (1683:9): [True: 0, False: 36.6k]
  ------------------
 1684|  36.6k|  }
 1685|       |  // TODO(marpan): Tune settings for speed 11 video mode,
 1686|  36.6k|  if (speed >= 11 && cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (1686:7): [True: 0, False: 36.6k]
  |  Branch (1686:22): [True: 0, False: 0]
  ------------------
 1687|      0|    sf->rt_sf.skip_cdef_sb = 1;
 1688|      0|    sf->rt_sf.force_only_last_ref = 1;
 1689|      0|    sf->rt_sf.selective_cdf_update = 1;
 1690|      0|    sf->rt_sf.use_nonrd_filter_search = 0;
 1691|      0|    if (is_360p_or_larger) {
  ------------------
  |  Branch (1691:9): [True: 0, False: 0]
  ------------------
 1692|      0|      sf->part_sf.fixed_partition_size = BLOCK_32X32;
 1693|      0|      sf->rt_sf.use_fast_fixed_part = 1;
 1694|      0|      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 2;
 1695|      0|    }
 1696|      0|    sf->rt_sf.increase_source_sad_thresh = 1;
 1697|      0|    sf->rt_sf.part_early_exit_zeromv = 2;
 1698|      0|    sf->rt_sf.set_zeromv_skip_based_on_source_sad = 2;
 1699|      0|    for (int i = 0; i < BLOCK_SIZES; ++i) {
  ------------------
  |  Branch (1699:21): [True: 0, False: 0]
  ------------------
 1700|      0|      sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC;
 1701|      0|    }
 1702|      0|    sf->rt_sf.hybrid_intra_pickmode = 0;
 1703|      0|  }
 1704|       |  // Setting for SVC, or when the ref_frame_config control is
 1705|       |  // used to set the reference structure.
 1706|  36.6k|  if (cpi->ppi->use_svc || cpi->ppi->rtc_ref.set_ref_frame_config) {
  ------------------
  |  Branch (1706:7): [True: 0, False: 36.6k]
  |  Branch (1706:28): [True: 0, False: 36.6k]
  ------------------
 1707|      0|    const RTC_REF *const rtc_ref = &cpi->ppi->rtc_ref;
 1708|       |    // For SVC: for greater than 2 temporal layers, use better mv search on
 1709|       |    // base temporal layers, and only on base spatial layer if highest
 1710|       |    // resolution is above 640x360.
 1711|      0|    if (cpi->svc.number_temporal_layers >= 2 &&
  ------------------
  |  Branch (1711:9): [True: 0, False: 0]
  ------------------
 1712|      0|        cpi->svc.temporal_layer_id == 0 &&
  ------------------
  |  Branch (1712:9): [True: 0, False: 0]
  ------------------
 1713|      0|        (cpi->svc.spatial_layer_id == 0 ||
  ------------------
  |  Branch (1713:10): [True: 0, False: 0]
  ------------------
 1714|      0|         cpi->oxcf.frm_dim_cfg.width * cpi->oxcf.frm_dim_cfg.height <=
  ------------------
  |  Branch (1714:10): [True: 0, False: 0]
  ------------------
 1715|      0|             640 * 360)) {
 1716|      0|      sf->mv_sf.search_method = NSTEP;
 1717|      0|      sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED;
 1718|      0|      sf->rt_sf.fullpel_search_step_param = 10;
 1719|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
 1720|      0|      if (cm->width * cm->height <= 352 * 288)
  ------------------
  |  Branch (1720:11): [True: 0, False: 0]
  ------------------
 1721|      0|        sf->rt_sf.nonrd_prune_ref_frame_search = 2;
 1722|      0|      sf->rt_sf.force_large_partition_blocks_intra = 0;
 1723|      0|    }
 1724|      0|    if (speed >= 8) {
  ------------------
  |  Branch (1724:9): [True: 0, False: 0]
  ------------------
 1725|      0|      if (cpi->svc.number_temporal_layers > 2)
  ------------------
  |  Branch (1725:11): [True: 0, False: 0]
  ------------------
 1726|      0|        sf->rt_sf.disable_cdf_update_non_reference_frame = true;
 1727|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
 1728|      0|      if (rtc_ref->non_reference_frame) {
  ------------------
  |  Branch (1728:11): [True: 0, False: 0]
  ------------------
 1729|      0|        sf->rt_sf.nonrd_aggressive_skip = 1;
 1730|      0|        sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
 1731|      0|      }
 1732|      0|    }
 1733|      0|    if (speed <= 9 && cpi->svc.number_temporal_layers > 2 &&
  ------------------
  |  Branch (1733:9): [True: 0, False: 0]
  |  Branch (1733:23): [True: 0, False: 0]
  ------------------
 1734|      0|        cpi->svc.temporal_layer_id == 0)
  ------------------
  |  Branch (1734:9): [True: 0, False: 0]
  ------------------
 1735|      0|      sf->rt_sf.check_only_zero_zeromv_on_large_blocks = false;
 1736|      0|    else
 1737|      0|      sf->rt_sf.check_only_zero_zeromv_on_large_blocks = true;
 1738|      0|    sf->rt_sf.frame_level_mode_cost_update = false;
 1739|       |
 1740|       |    // Compound mode enabling.
 1741|      0|    if (rtc_ref->ref_frame_comp[0] || rtc_ref->ref_frame_comp[1] ||
  ------------------
  |  Branch (1741:9): [True: 0, False: 0]
  |  Branch (1741:39): [True: 0, False: 0]
  ------------------
 1742|      0|        rtc_ref->ref_frame_comp[2]) {
  ------------------
  |  Branch (1742:9): [True: 0, False: 0]
  ------------------
 1743|      0|      sf->rt_sf.use_comp_ref_nonrd = 1;
 1744|      0|      sf->rt_sf.ref_frame_comp_nonrd[0] =
 1745|      0|          rtc_ref->ref_frame_comp[0] && rtc_ref->reference[GOLDEN_FRAME - 1];
  ------------------
  |  Branch (1745:11): [True: 0, False: 0]
  |  Branch (1745:41): [True: 0, False: 0]
  ------------------
 1746|      0|      sf->rt_sf.ref_frame_comp_nonrd[1] =
 1747|      0|          rtc_ref->ref_frame_comp[1] && rtc_ref->reference[LAST2_FRAME - 1];
  ------------------
  |  Branch (1747:11): [True: 0, False: 0]
  |  Branch (1747:41): [True: 0, False: 0]
  ------------------
 1748|      0|      sf->rt_sf.ref_frame_comp_nonrd[2] =
 1749|      0|          rtc_ref->ref_frame_comp[2] && rtc_ref->reference[ALTREF_FRAME - 1];
  ------------------
  |  Branch (1749:11): [True: 0, False: 0]
  |  Branch (1749:41): [True: 0, False: 0]
  ------------------
 1750|      0|    } else {
 1751|      0|      sf->rt_sf.use_comp_ref_nonrd = 0;
 1752|      0|    }
 1753|       |
 1754|      0|    if (cpi->svc.number_spatial_layers > 1 ||
  ------------------
  |  Branch (1754:9): [True: 0, False: 0]
  ------------------
 1755|      0|        cpi->svc.number_temporal_layers > 1)
  ------------------
  |  Branch (1755:9): [True: 0, False: 0]
  ------------------
 1756|      0|      sf->hl_sf.accurate_bit_estimate = 0;
 1757|       |
 1758|      0|    sf->rt_sf.estimate_motion_for_var_based_partition = 1;
 1759|       |
 1760|       |    // For single layers RPS: bias/adjustment for recovery frame.
 1761|      0|    if (cpi->ppi->rtc_ref.bias_recovery_frame) {
  ------------------
  |  Branch (1761:9): [True: 0, False: 0]
  ------------------
 1762|      0|      sf->mv_sf.search_method = NSTEP;
 1763|      0|      sf->mv_sf.subpel_search_method = SUBPEL_TREE;
 1764|      0|      sf->rt_sf.fullpel_search_step_param = 8;
 1765|      0|      sf->rt_sf.nonrd_aggressive_skip = 0;
 1766|      0|    }
 1767|      0|  }
 1768|       |  // Screen settings.
 1769|  36.6k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (1769:7): [True: 0, False: 36.6k]
  ------------------
 1770|      0|    sf->rt_sf.rt_use_intrabc = 1;
 1771|      0|    sf->rt_sf.rt_prune_intrabc_nonrd = 1;
 1772|      0|    sf->mv_sf.intrabc_search_level = 1;
 1773|      0|    sf->mv_sf.hash_max_8x8_intrabc_blocks = 1;
 1774|      0|    sf->mv_sf.prune_intrabc_candidate_block_hash_search = 1;
 1775|      0|    if (speed >= 7) {
  ------------------
  |  Branch (1775:9): [True: 0, False: 0]
  ------------------
 1776|      0|      sf->rt_sf.rt_intrabc_miss_mode = 2;
 1777|      0|      sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
 1778|      0|      sf->mv_sf.use_bsize_dependent_search_method = 0;
 1779|      0|      sf->rt_sf.skip_cdef_sb = 1;
 1780|      0|      sf->rt_sf.increase_color_thresh_palette = 1;
 1781|      0|      if (!frame_is_intra_only(cm)) sf->rt_sf.dct_only_palette_nonrd = 1;
  ------------------
  |  Branch (1781:11): [True: 0, False: 0]
  ------------------
 1782|      0|    }
 1783|      0|    if (speed >= 8) {
  ------------------
  |  Branch (1783:9): [True: 0, False: 0]
  ------------------
 1784|      0|      sf->rt_sf.nonrd_check_partition_merge_mode = 3;
 1785|      0|      sf->rt_sf.nonrd_prune_ref_frame_search = 1;
 1786|      0|      sf->rt_sf.use_nonrd_filter_search = 0;
 1787|      0|      sf->rt_sf.prune_hv_pred_modes_using_src_sad = false;
 1788|      0|    }
 1789|      0|    if (speed >= 9) {
  ------------------
  |  Branch (1789:9): [True: 0, False: 0]
  ------------------
 1790|      0|      sf->rt_sf.prune_idtx_nonrd = 1;
 1791|      0|      sf->rt_sf.part_early_exit_zeromv = 2;
 1792|      0|      sf->rt_sf.skip_lf_screen = 1;
 1793|      0|      sf->rt_sf.nonrd_prune_ref_frame_search = 3;
 1794|      0|      sf->rt_sf.var_part_split_threshold_shift = 10;
 1795|      0|      sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
 1796|      0|      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 1;
 1797|      0|      sf->lpf_sf.cdef_pick_method = CDEF_PICK_FROM_Q;
 1798|      0|      sf->rt_sf.nonrd_check_partition_merge_mode = 0;
 1799|      0|      sf->interp_sf.cb_pred_filter_search = 0;
 1800|      0|    }
 1801|      0|    if (speed >= 10) {
  ------------------
  |  Branch (1801:9): [True: 0, False: 0]
  ------------------
 1802|      0|      if (cm->width * cm->height > 1920 * 1080)
  ------------------
  |  Branch (1802:11): [True: 0, False: 0]
  ------------------
 1803|      0|        sf->part_sf.disable_8x8_part_based_on_qidx = 1;
 1804|      0|      sf->rt_sf.screen_content_cdef_filter_qindex_thresh = 80;
 1805|      0|      sf->rt_sf.part_early_exit_zeromv = 1;
 1806|      0|      sf->rt_sf.nonrd_aggressive_skip = 1;
 1807|      0|      sf->rt_sf.thresh_active_maps_skip_lf_cdef = 90;
 1808|      0|      sf->rt_sf.hybrid_intra_pickmode = 0;
 1809|      0|      sf->rt_sf.dct_only_palette_nonrd = 1;
 1810|      0|      sf->rt_sf.prune_palette_search_nonrd = 1;
 1811|      0|      sf->rt_sf.prune_intra_mode_using_best_sad_so_far = true;
 1812|      0|      sf->rt_sf.rc_faster_convergence_static = 1;
 1813|      0|      sf->rt_sf.rc_compute_spatial_var_sc_kf = 1;
 1814|      0|    }
 1815|      0|    if (speed >= 11) {
  ------------------
  |  Branch (1815:9): [True: 0, False: 0]
  ------------------
 1816|      0|      sf->rt_sf.skip_lf_screen = 2;
 1817|      0|      sf->rt_sf.skip_cdef_sb = 2;
 1818|      0|      sf->rt_sf.prune_palette_search_nonrd = 2;
 1819|      0|      sf->rt_sf.increase_color_thresh_palette = 0;
 1820|      0|      sf->rt_sf.prune_h_pred_using_best_mode_so_far = true;
 1821|      0|      sf->rt_sf.enable_intra_mode_pruning_using_neighbors = true;
 1822|      0|    }
 1823|      0|    if (speed >= 12) {
  ------------------
  |  Branch (1823:9): [True: 0, False: 0]
  ------------------
 1824|      0|      if (cpi->rc.high_source_sad && cpi->rc.frame_source_sad > 40000 &&
  ------------------
  |  Branch (1824:11): [True: 0, False: 0]
  |  Branch (1824:38): [True: 0, False: 0]
  ------------------
 1825|      0|          cpi->rc.prev_avg_source_sad < 1000 &&
  ------------------
  |  Branch (1825:11): [True: 0, False: 0]
  ------------------
 1826|      0|          cpi->oxcf.frm_dim_cfg.width * cpi->oxcf.frm_dim_cfg.height >=
  ------------------
  |  Branch (1826:11): [True: 0, False: 0]
  ------------------
 1827|      0|              1280 * 720) {
 1828|      0|        sf->rt_sf.prune_palette_search_nonrd = 3;
 1829|      0|        sf->rt_sf.skip_newmv_mode_sad_screen = 1;
 1830|      0|      }
 1831|      0|    }
 1832|      0|    sf->rt_sf.skip_encoding_non_reference_slide_change =
 1833|      0|        cpi->oxcf.rc_cfg.drop_frames_water_mark > 0 ? 1 : 0;
  ------------------
  |  Branch (1833:9): [True: 0, False: 0]
  ------------------
 1834|      0|    sf->rt_sf.skip_newmv_flat_blocks_screen = 1;
 1835|      0|    sf->rt_sf.use_idtx_nonrd = 1;
 1836|      0|    sf->rt_sf.higher_thresh_scene_detection = 0;
 1837|      0|    sf->rt_sf.use_nonrd_altref_frame = 0;
 1838|      0|    sf->rt_sf.use_rtc_tf = 0;
 1839|      0|    sf->rt_sf.use_comp_ref_nonrd = 0;
 1840|      0|    sf->rt_sf.source_metrics_sb_nonrd = 1;
 1841|      0|    if (cpi->rc.high_source_sad == 1) {
  ------------------
  |  Branch (1841:9): [True: 0, False: 0]
  ------------------
 1842|      0|      sf->rt_sf.prefer_large_partition_blocks = 0;
 1843|      0|      sf->part_sf.max_intra_bsize = BLOCK_128X128;
 1844|      0|      for (int i = 0; i < BLOCK_SIZES; ++i) {
  ------------------
  |  Branch (1844:23): [True: 0, False: 0]
  ------------------
 1845|      0|        if (i > BLOCK_32X32)
  ------------------
  |  Branch (1845:13): [True: 0, False: 0]
  ------------------
 1846|      0|          sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC;
 1847|      0|        else
 1848|      0|          sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC_H_V;
 1849|      0|      }
 1850|      0|    }
 1851|      0|    if (speed >= 11 && cpi->rc.high_motion_content_screen_rtc) {
  ------------------
  |  Branch (1851:9): [True: 0, False: 0]
  |  Branch (1851:24): [True: 0, False: 0]
  ------------------
 1852|      0|      sf->rt_sf.higher_thresh_scene_detection = 1;
 1853|      0|      sf->rt_sf.force_only_last_ref = 1;
 1854|      0|      sf->rt_sf.use_nonrd_filter_search = 0;
 1855|      0|      sf->part_sf.fixed_partition_size = BLOCK_32X32;
 1856|      0|      sf->rt_sf.use_fast_fixed_part = 1;
 1857|      0|      sf->rt_sf.increase_source_sad_thresh = 1;
 1858|      0|      sf->rt_sf.selective_cdf_update = 1;
 1859|      0|      sf->mv_sf.search_method = FAST_DIAMOND;
 1860|      0|    } else if (cpi->rc.max_block_source_sad > 20000 &&
  ------------------
  |  Branch (1860:16): [True: 0, False: 0]
  ------------------
 1861|      0|               cpi->rc.frame_source_sad > 100 && speed >= 6 &&
  ------------------
  |  Branch (1861:16): [True: 0, False: 0]
  |  Branch (1861:50): [True: 0, False: 0]
  ------------------
 1862|      0|               (cpi->rc.percent_blocks_with_motion > 1 ||
  ------------------
  |  Branch (1862:17): [True: 0, False: 0]
  ------------------
 1863|      0|                cpi->svc.last_layer_dropped[0])) {
  ------------------
  |  Branch (1863:17): [True: 0, False: 0]
  ------------------
 1864|      0|      sf->mv_sf.search_method = NSTEP;
 1865|      0|      sf->rt_sf.fullpel_search_step_param = 2;
 1866|      0|    }
 1867|      0|    if (cpi->rc.high_source_sad && cpi->ppi->rtc_ref.non_reference_frame) {
  ------------------
  |  Branch (1867:9): [True: 0, False: 0]
  |  Branch (1867:36): [True: 0, False: 0]
  ------------------
 1868|      0|      sf->rt_sf.use_idtx_nonrd = 0;
 1869|      0|      sf->rt_sf.prefer_large_partition_blocks = 1;
 1870|      0|      sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
 1871|      0|      sf->rt_sf.fullpel_search_step_param = 10;
 1872|      0|    }
 1873|      0|    sf->rt_sf.partition_direct_merging = 0;
 1874|      0|    sf->hl_sf.accurate_bit_estimate = 0;
 1875|       |    // This feature is for nonrd_pickmode.
 1876|      0|    if (sf->rt_sf.use_nonrd_pick_mode)
  ------------------
  |  Branch (1876:9): [True: 0, False: 0]
  ------------------
 1877|      0|      sf->rt_sf.estimate_motion_for_var_based_partition = 1;
 1878|      0|    else
 1879|      0|      sf->rt_sf.estimate_motion_for_var_based_partition = 0;
 1880|      0|  }
 1881|  36.6k|  if (is_lossless_requested(&cpi->oxcf.rc_cfg)) {
  ------------------
  |  Branch (1881:7): [True: 1.41k, False: 35.1k]
  ------------------
 1882|  1.41k|    sf->rt_sf.use_rtc_tf = 0;
 1883|       |    // TODO(aomedia:3412): The setting accurate_bit_estimate = 0
 1884|       |    // can be removed once it's fixed for lossless mode.
 1885|  1.41k|    sf->hl_sf.accurate_bit_estimate = 0;
 1886|  1.41k|  }
 1887|  36.6k|  if (cpi->oxcf.use_highbitdepth) {
  ------------------
  |  Branch (1887:7): [True: 7.01k, False: 29.5k]
  ------------------
 1888|       |    // Disable for use_highbitdepth = 1 to mitigate issue: b/303023614.
 1889|  7.01k|    sf->rt_sf.estimate_motion_for_var_based_partition = 0;
 1890|  7.01k|  }
 1891|  36.6k|  if (cpi->oxcf.superres_cfg.enable_superres) {
  ------------------
  |  Branch (1891:7): [True: 0, False: 36.6k]
  ------------------
 1892|      0|    sf->rt_sf.use_rtc_tf = 0;
 1893|      0|    sf->rt_sf.nonrd_prune_ref_frame_search = 1;
 1894|      0|  }
 1895|       |  // rtc_tf feature allocates new source because of possible
 1896|       |  // temporal filtering which may change the input source during encoding:
 1897|       |  // this causes an issue on resized frames when psnr is calculated,
 1898|       |  // so disable it here for frames that are resized (encoding width/height
 1899|       |  // different from configured width/height). Also disable for spatial layers.
 1900|       |  // Bug: 491358681
 1901|  36.6k|  if ((is_psnr_calc_enabled(cpi) &&
  ------------------
  |  Branch (1901:8): [True: 0, False: 36.6k]
  ------------------
 1902|      0|       (cpi->oxcf.frm_dim_cfg.width != cm->width ||
  ------------------
  |  Branch (1902:9): [True: 0, False: 0]
  ------------------
 1903|      0|        cpi->oxcf.frm_dim_cfg.height != cm->height)) ||
  ------------------
  |  Branch (1903:9): [True: 0, False: 0]
  ------------------
 1904|  36.6k|      cpi->svc.number_spatial_layers > 1)
  ------------------
  |  Branch (1904:7): [True: 0, False: 36.6k]
  ------------------
 1905|      0|    sf->rt_sf.use_rtc_tf = 0;
 1906|       |
 1907|       |  // This speed feature is causing artifacts with active_maps enabled, so
 1908|       |  // disable for now.
 1909|  36.6k|  if (cpi->active_map.enabled)
  ------------------
  |  Branch (1909:7): [True: 0, False: 36.6k]
  ------------------
 1910|      0|    sf->rt_sf.set_zeromv_skip_based_on_source_sad = 0;
 1911|       |
 1912|  36.6k|  if (is_one_pass_rt_lag_params(cpi)) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 36.6k]
  ------------------
 1913|      0|    const RefreshFrameInfo *const refresh_frame = &cpi->refresh_frame;
 1914|      0|    if (refresh_frame->alt_ref_frame) {
  ------------------
  |  Branch (1914:9): [True: 0, False: 0]
  ------------------
 1915|      0|      sf->rt_sf.source_metrics_sb_nonrd = 0;
 1916|      0|      sf->rt_sf.var_part_based_on_qidx = 0;
 1917|      0|    }
 1918|      0|    sf->rt_sf.use_nonrd_altref_frame = 1;
 1919|       |    // For non-zero lag: disable the 3 speed features below for now,
 1920|       |    // until further testing.
 1921|      0|    sf->rt_sf.use_rtc_tf = 0;
 1922|      0|    sf->rt_sf.nonrd_check_partition_merge_mode = 0;
 1923|      0|    sf->rt_sf.nonrd_check_partition_split = 0;
 1924|       |    // These (nonrd) speed features that force zeromv-LAST early in partition
 1925|       |    // are disabled since for src_frame_alt_ref frame the zeromv-ALTREF_FRAME
 1926|       |    // mode is forced in the nonrd_pickmode.
 1927|      0|    if (cpi->rc.is_src_frame_alt_ref) {
  ------------------
  |  Branch (1927:9): [True: 0, False: 0]
  ------------------
 1928|      0|      sf->rt_sf.increase_source_sad_thresh = 0;
 1929|      0|      sf->rt_sf.part_early_exit_zeromv = 0;
 1930|      0|    }
 1931|       |    // This feature is for CBR mode, turning if off means the gop interval
 1932|       |    // will not be changed after encoding.
 1933|      0|    sf->rt_sf.gf_refresh_based_on_qp = 0;
 1934|      0|  }
 1935|  36.6k|}
speed_features.c:set_subpel_search_method:
 2659|   270k|    SUBPEL_SEARCH_METHOD subpel_search_method) {
 2660|   270k|  assert(subpel_search_method <= SUBPEL_TREE_PRUNED_MORE);
 2661|   270k|  mv_search_params->find_fractional_mv_step =
 2662|   270k|      fractional_mv_search[subpel_search_method];
 2663|       |
 2664|       |  // This is only used in motion vector unit test.
 2665|   270k|  if (motion_vector_unit_test == 1)
  ------------------
  |  Branch (2665:7): [True: 0, False: 270k]
  ------------------
 2666|      0|    mv_search_params->find_fractional_mv_step = av1_return_max_sub_pixel_mv;
 2667|   270k|  else if (motion_vector_unit_test == 2)
  ------------------
  |  Branch (2667:12): [True: 0, False: 270k]
  ------------------
 2668|      0|    mv_search_params->find_fractional_mv_step = av1_return_min_sub_pixel_mv;
 2669|   270k|}
speed_features.c:init_hl_sf:
 2244|   110k|static inline void init_hl_sf(HIGH_LEVEL_SPEED_FEATURES *hl_sf) {
 2245|       |  // best quality defaults
 2246|   110k|  hl_sf->frame_parameter_update = 1;
 2247|   110k|  hl_sf->recode_loop = ALLOW_RECODE;
 2248|       |  // Recode loop tolerance %.
 2249|   110k|  hl_sf->recode_tolerance = 25;
 2250|   110k|  hl_sf->high_precision_mv_usage = CURRENT_Q;
 2251|   110k|  hl_sf->superres_auto_search_type = SUPERRES_AUTO_ALL;
 2252|   110k|  hl_sf->disable_extra_sc_testing = 0;
 2253|   110k|  hl_sf->second_alt_ref_filtering = 1;
 2254|   110k|  hl_sf->adjust_num_frames_for_arf_filtering = 0;
 2255|   110k|  hl_sf->accurate_bit_estimate = 0;
 2256|   110k|  hl_sf->weight_calc_level_in_tf = 0;
 2257|   110k|  hl_sf->allow_sub_blk_me_in_tf = 0;
 2258|   110k|  hl_sf->ref_frame_mvs_lvl = 0;
 2259|   110k|  hl_sf->screen_detection_mode2_fast_detection = 0;
 2260|   110k|  hl_sf->weighted_chroma_distortion = 0;
 2261|   110k|}
speed_features.c:init_fp_sf:
 2263|   110k|static inline void init_fp_sf(FIRST_PASS_SPEED_FEATURES *fp_sf) {
 2264|   110k|  fp_sf->reduce_mv_step_param = 3;
 2265|   110k|  fp_sf->skip_motion_search_threshold = 0;
 2266|   110k|  fp_sf->disable_recon = 0;
 2267|   110k|  fp_sf->skip_zeromv_motion_search = 0;
 2268|   110k|}
speed_features.c:init_tpl_sf:
 2270|   110k|static inline void init_tpl_sf(TPL_SPEED_FEATURES *tpl_sf) {
 2271|   110k|  tpl_sf->gop_length_decision_method = 1;
 2272|   110k|  tpl_sf->prune_intra_modes = 0;
 2273|   110k|  tpl_sf->prune_starting_mv = 0;
 2274|   110k|  tpl_sf->reduce_first_step_size = 0;
 2275|   110k|  tpl_sf->skip_alike_starting_mv = 0;
 2276|   110k|  tpl_sf->subpel_force_stop = EIGHTH_PEL;
 2277|   110k|  tpl_sf->search_method = NSTEP;
 2278|   110k|  tpl_sf->prune_ref_frames_in_tpl = 0;
 2279|   110k|  tpl_sf->allow_compound_pred = 1;
 2280|   110k|  tpl_sf->use_y_only_rate_distortion = 0;
 2281|   110k|  tpl_sf->use_sad_for_mode_decision = 0;
 2282|   110k|  tpl_sf->reduce_num_frames = 0;
 2283|   110k|}
speed_features.c:init_gm_sf:
 2285|   110k|static inline void init_gm_sf(GLOBAL_MOTION_SPEED_FEATURES *gm_sf) {
 2286|   110k|  gm_sf->gm_search_type = GM_FULL_SEARCH;
 2287|   110k|  gm_sf->prune_ref_frame_for_gm_search = 0;
 2288|   110k|  gm_sf->prune_zero_mv_with_sse = 0;
 2289|   110k|  gm_sf->disable_gm_search_based_on_stats = 0;
 2290|   110k|  gm_sf->downsample_level = 0;
 2291|   110k|  gm_sf->num_refinement_steps = GM_MAX_REFINEMENT_STEPS;
  ------------------
  |  |   25|   110k|#define GM_MAX_REFINEMENT_STEPS 5
  ------------------
 2292|   110k|  gm_sf->gm_erroradv_tr_level = 0;
 2293|   110k|}
speed_features.c:init_part_sf:
 2295|   110k|static inline void init_part_sf(PARTITION_SPEED_FEATURES *part_sf) {
 2296|   110k|  part_sf->partition_search_type = SEARCH_PARTITION;
 2297|   110k|  part_sf->less_rectangular_check_level = 0;
 2298|   110k|  part_sf->use_square_partition_only_threshold = BLOCK_128X128;
 2299|   110k|  part_sf->auto_max_partition_based_on_simple_motion = NOT_IN_USE;
 2300|   110k|  part_sf->default_max_partition_size = BLOCK_LARGEST;
 2301|   110k|  part_sf->default_min_partition_size = BLOCK_4X4;
 2302|   110k|  part_sf->adjust_var_based_rd_partitioning = 0;
 2303|   110k|  part_sf->max_intra_bsize = BLOCK_LARGEST;
 2304|       |  // This setting only takes effect when partition_search_type is set
 2305|       |  // to FIXED_PARTITION.
 2306|   110k|  part_sf->fixed_partition_size = BLOCK_16X16;
 2307|       |  // Recode loop tolerance %.
 2308|   110k|  part_sf->partition_search_breakout_dist_thr = 0;
 2309|   110k|  part_sf->partition_search_breakout_rate_thr = 0;
 2310|   110k|  part_sf->prune_ext_partition_types_search_level = 0;
 2311|   110k|  part_sf->prune_part4_search = 0;
 2312|   110k|  part_sf->ml_prune_partition = 0;
 2313|   110k|  part_sf->ml_early_term_after_part_split_level = 0;
 2314|   662k|  for (int i = 0; i < PARTITION_BLOCK_SIZES; ++i) {
  ------------------
  |  |  170|   662k|#define PARTITION_BLOCK_SIZES 5
  ------------------
  |  Branch (2314:19): [True: 552k, False: 110k]
  ------------------
 2315|   552k|    part_sf->ml_partition_search_breakout_thresh[i] =
 2316|   552k|        -1;  // -1 means not enabled.
 2317|   552k|  }
 2318|   110k|  part_sf->ml_partition_search_breakout_model_index = 0;
 2319|   110k|  part_sf->ml_4_partition_search_level_index = 0;
 2320|   110k|  part_sf->simple_motion_search_prune_agg = SIMPLE_AGG_LVL0;
 2321|   110k|  part_sf->simple_motion_search_split = 0;
 2322|   110k|  part_sf->simple_motion_search_prune_rect = 0;
 2323|   110k|  part_sf->simple_motion_search_early_term_none = 0;
 2324|   110k|  part_sf->simple_motion_search_reduce_search_steps = 0;
 2325|   110k|  part_sf->intra_cnn_based_part_prune_level = 0;
 2326|   110k|  part_sf->ext_partition_eval_thresh = BLOCK_8X8;
 2327|   110k|  part_sf->rect_partition_eval_thresh = BLOCK_128X128;
 2328|   110k|  part_sf->ext_part_eval_based_on_cur_best = 0;
 2329|   110k|  part_sf->prune_ext_part_using_split_info = 0;
 2330|   110k|  part_sf->prune_rectangular_split_based_on_qidx = 0;
 2331|   110k|  part_sf->prune_rect_part_using_4x4_var_deviation = false;
 2332|   110k|  part_sf->prune_rect_part_using_none_pred_mode = false;
 2333|   110k|  part_sf->early_term_after_none_split = 0;
 2334|   110k|  part_sf->ml_predict_breakout_level = 0;
 2335|   110k|  part_sf->prune_sub_8x8_partition_level = 0;
 2336|   110k|  part_sf->simple_motion_search_rect_split = 0;
 2337|   110k|  part_sf->reuse_prev_rd_results_for_part_ab = 0;
 2338|   110k|  part_sf->reuse_best_prediction_for_part_ab = 0;
 2339|   110k|  part_sf->use_best_rd_for_pruning = 0;
 2340|   110k|  part_sf->skip_non_sq_part_based_on_none = 0;
 2341|   110k|  part_sf->disable_8x8_part_based_on_qidx = 0;
 2342|   110k|  part_sf->split_partition_penalty_level = 0;
 2343|       |  part_sf->prune_h_or_v_4part_using_sms_info = false;
 2344|   110k|}
speed_features.c:init_mv_sf:
 2346|   110k|static inline void init_mv_sf(MV_SPEED_FEATURES *mv_sf) {
 2347|   110k|  mv_sf->full_pixel_search_level = 0;
 2348|   110k|  mv_sf->auto_mv_step_size = 0;
 2349|   110k|  mv_sf->exhaustive_searches_thresh = 0;
 2350|   110k|  mv_sf->obmc_full_pixel_search_level = 0;
 2351|   110k|  mv_sf->prune_mesh_search = PRUNE_MESH_SEARCH_DISABLED;
 2352|   110k|  mv_sf->reduce_search_range = 0;
 2353|   110k|  mv_sf->search_method = NSTEP;
 2354|   110k|  mv_sf->simple_motion_subpel_force_stop = EIGHTH_PEL;
 2355|   110k|  mv_sf->subpel_force_stop = EIGHTH_PEL;
 2356|   110k|  mv_sf->subpel_iters_per_step = 2;
 2357|   110k|  mv_sf->subpel_search_method = SUBPEL_TREE;
 2358|   110k|  mv_sf->use_accurate_subpel_search = USE_8_TAPS;
 2359|   110k|  mv_sf->use_bsize_dependent_search_method = 0;
 2360|   110k|  mv_sf->use_fullpel_costlist = 0;
 2361|   110k|  mv_sf->use_downsampled_sad = 0;
 2362|   110k|  mv_sf->disable_extensive_joint_motion_search = 0;
 2363|   110k|  mv_sf->disable_second_mv = 0;
 2364|   110k|  mv_sf->skip_fullpel_search_using_startmv_refmv = 0;
 2365|   110k|  mv_sf->warp_search_method = WARP_SEARCH_SQUARE;
 2366|   110k|  mv_sf->warp_search_iters = 8;
 2367|   110k|  mv_sf->use_intrabc = 1;
 2368|   110k|  mv_sf->prune_intrabc_candidate_block_hash_search = 0;
 2369|   110k|  mv_sf->intrabc_search_level = 0;
 2370|   110k|  mv_sf->hash_max_8x8_intrabc_blocks = 0;
 2371|   110k|}
speed_features.c:init_inter_sf:
 2373|   110k|static inline void init_inter_sf(INTER_MODE_SPEED_FEATURES *inter_sf) {
 2374|   110k|  inter_sf->adaptive_rd_thresh = 0;
 2375|   110k|  inter_sf->model_based_post_interp_filter_breakout = 0;
 2376|   110k|  inter_sf->reduce_inter_modes = 0;
 2377|   110k|  inter_sf->alt_ref_search_fp = 0;
 2378|   110k|  inter_sf->prune_single_ref = 0;
 2379|   110k|  inter_sf->prune_comp_ref_frames = 0;
 2380|   110k|  inter_sf->selective_ref_frame = 0;
 2381|   110k|  inter_sf->prune_ref_frame_for_rect_partitions = 0;
 2382|   110k|  inter_sf->fast_wedge_sign_estimate = 0;
 2383|   110k|  inter_sf->use_dist_wtd_comp_flag = DIST_WTD_COMP_ENABLED;
 2384|   110k|  inter_sf->reuse_inter_intra_mode = 0;
 2385|   110k|  inter_sf->mv_cost_upd_level = INTERNAL_COST_UPD_SB;
 2386|   110k|  inter_sf->coeff_cost_upd_level = INTERNAL_COST_UPD_SB;
 2387|   110k|  inter_sf->mode_cost_upd_level = INTERNAL_COST_UPD_SB;
 2388|   110k|  inter_sf->prune_inter_modes_based_on_tpl = 0;
 2389|   110k|  inter_sf->prune_nearmv_using_neighbors = PRUNE_NEARMV_OFF;
 2390|   110k|  inter_sf->prune_comp_search_by_single_result = 0;
 2391|   110k|  inter_sf->skip_repeated_ref_mv = 0;
 2392|   110k|  inter_sf->skip_newmv_in_drl = 0;
 2393|   110k|  inter_sf->inter_mode_rd_model_estimation = 0;
 2394|   110k|  inter_sf->prune_compound_using_single_ref = 0;
 2395|   110k|  inter_sf->prune_ext_comp_using_neighbors = 0;
 2396|   110k|  inter_sf->skip_ext_comp_nearmv_mode = 0;
 2397|   110k|  inter_sf->prune_comp_using_best_single_mode_ref = 0;
 2398|   110k|  inter_sf->prune_nearest_near_mv_using_refmv_weight = 0;
 2399|   110k|  inter_sf->disable_onesided_comp = 0;
 2400|   110k|  inter_sf->prune_mode_search_simple_translation = 0;
 2401|   110k|  inter_sf->prune_comp_type_by_comp_avg = 0;
 2402|   110k|  inter_sf->disable_interinter_wedge_newmv_search = 0;
 2403|   110k|  inter_sf->fast_interintra_wedge_search = 0;
 2404|   110k|  inter_sf->prune_comp_type_by_model_rd = 0;
 2405|   110k|  inter_sf->perform_best_rd_based_gating_for_chroma = 0;
 2406|   110k|  inter_sf->prune_obmc_prob_thresh = 0;
 2407|   110k|  inter_sf->disable_interinter_wedge_var_thresh = 0;
 2408|   110k|  inter_sf->disable_interintra_wedge_var_thresh = 0;
 2409|   110k|  inter_sf->prune_ref_mv_idx_search = 0;
 2410|   110k|  inter_sf->prune_warped_prob_thresh = 0;
 2411|   110k|  inter_sf->reuse_compound_type_decision = 0;
 2412|   110k|  inter_sf->prune_inter_modes_if_skippable = 0;
 2413|   110k|  inter_sf->disable_masked_comp = 0;
 2414|   110k|  inter_sf->enable_fast_compound_mode_search = 0;
 2415|   110k|  inter_sf->reuse_mask_search_results = 0;
 2416|   110k|  inter_sf->enable_fast_wedge_mask_search = 0;
 2417|   110k|  inter_sf->inter_mode_txfm_breakout = 0;
 2418|   110k|  inter_sf->limit_inter_mode_cands = 0;
 2419|   110k|  inter_sf->limit_txfm_eval_per_mode = 0;
 2420|   110k|  inter_sf->skip_arf_compound = 0;
 2421|   110k|  inter_sf->bias_warp_mode_rd_scale_pct = 0.0f;
 2422|   110k|  inter_sf->bias_obmc_mode_rd_scale_pct = 0.0f;
 2423|   110k|  inter_sf->bias_gm_mode_rd_scale_pct = 0.0f;
 2424|   110k|  inter_sf->skip_cmp_using_top_cmp_avg_est_rd_lvl = 0;
 2425|   110k|  inter_sf->skip_interinter_wedge_search_based_on_mse = 0;
 2426|   110k|  inter_sf->enable_comp_wedge_search_using_model_rd = 0;
 2427|   110k|  set_txfm_rd_gate_level(inter_sf->txfm_rd_gate_level, 0);
 2428|   110k|}
speed_features.c:set_txfm_rd_gate_level:
  160|   270k|    int txfm_rd_gate_level[TX_SEARCH_CASES], int level) {
  161|   270k|  assert(level <= MAX_TX_RD_GATE_LEVEL);
  162|  1.08M|  for (int idx = 0; idx < TX_SEARCH_CASES; idx++)
  ------------------
  |  Branch (162:21): [True: 810k, False: 270k]
  ------------------
  163|   810k|    txfm_rd_gate_level[idx] = level;
  164|   270k|}
speed_features.c:init_interp_sf:
 2430|   110k|static inline void init_interp_sf(INTERP_FILTER_SPEED_FEATURES *interp_sf) {
 2431|   110k|  interp_sf->adaptive_interp_filter_search = 0;
 2432|   110k|  interp_sf->cb_pred_filter_search = 0;
 2433|   110k|  interp_sf->disable_dual_filter = 0;
 2434|   110k|  interp_sf->skip_sharp_interp_filter_search = 0;
 2435|   110k|  interp_sf->use_fast_interpolation_filter_search = 0;
 2436|   110k|  interp_sf->use_interp_filter = 0;
 2437|   110k|  interp_sf->skip_interp_filter_search = 0;
 2438|   110k|  interp_sf->use_more_sharp_interp = 0;
 2439|   110k|  interp_sf->skip_model_rd_uv = 0;
 2440|   110k|}
speed_features.c:init_intra_sf:
 2442|   110k|static inline void init_intra_sf(INTRA_MODE_SPEED_FEATURES *intra_sf) {
 2443|   110k|  intra_sf->dv_cost_upd_level = INTERNAL_COST_UPD_SB;
 2444|   110k|  intra_sf->skip_intra_in_interframe = 1;
 2445|   110k|  intra_sf->intra_pruning_with_hog = 0;
 2446|   110k|  intra_sf->chroma_intra_pruning_with_hog = 0;
 2447|   110k|  intra_sf->prune_palette_search_level = 0;
 2448|   110k|  intra_sf->prune_luma_palette_size_search_level = 0;
 2449|       |
 2450|   662k|  for (int i = 0; i < TX_SIZES; i++) {
  ------------------
  |  Branch (2450:19): [True: 552k, False: 110k]
  ------------------
 2451|   552k|    intra_sf->intra_y_mode_mask[i] = INTRA_ALL;
 2452|   552k|    intra_sf->intra_uv_mode_mask[i] = UV_INTRA_ALL;
 2453|   552k|  }
 2454|   110k|  intra_sf->disable_smooth_intra = 0;
 2455|   110k|  intra_sf->prune_smooth_intra_mode_for_chroma = 0;
 2456|   110k|  intra_sf->prune_filter_intra_level = 0;
 2457|   110k|  intra_sf->prune_chroma_modes_using_luma_winner = 0;
 2458|   110k|  intra_sf->cfl_search_range = 3;
 2459|   110k|  intra_sf->top_intra_model_count_allowed = TOP_INTRA_MODEL_COUNT;
  ------------------
  |  |  391|   110k|#define TOP_INTRA_MODEL_COUNT 4
  ------------------
 2460|   110k|  intra_sf->adapt_top_model_rd_count_using_neighbors = 0;
 2461|   110k|  intra_sf->early_term_chroma_palette_size_search = 0;
 2462|   110k|  intra_sf->skip_filter_intra_in_inter_frames = 0;
 2463|   110k|  intra_sf->prune_luma_odd_delta_angles_in_intra = 0;
 2464|   110k|}
speed_features.c:init_tx_sf:
 2466|   110k|static inline void init_tx_sf(TX_SPEED_FEATURES *tx_sf) {
 2467|   110k|  tx_sf->inter_tx_size_search_init_depth_sqr = 0;
 2468|   110k|  tx_sf->inter_tx_size_search_init_depth_rect = 0;
 2469|   110k|  tx_sf->intra_tx_size_search_init_depth_rect = 0;
 2470|   110k|  tx_sf->intra_tx_size_search_init_depth_sqr = 0;
 2471|   110k|  tx_sf->tx_size_search_lgr_block = 0;
 2472|   110k|  tx_sf->model_based_prune_tx_search_level = 0;
 2473|   110k|  tx_sf->tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_1;
 2474|   110k|  tx_sf->tx_type_search.ml_tx_split_thresh = 8500;
 2475|   110k|  tx_sf->tx_type_search.use_skip_flag_prediction = 1;
 2476|   110k|  tx_sf->tx_type_search.use_reduced_intra_txset = 0;
 2477|   110k|  tx_sf->tx_type_search.fast_intra_tx_type_search = 0;
 2478|   110k|  tx_sf->tx_type_search.fast_inter_tx_type_prob_thresh = INT_MAX;
 2479|   110k|  tx_sf->tx_type_search.skip_tx_search = 0;
 2480|   110k|  tx_sf->tx_type_search.prune_tx_type_using_stats = 0;
 2481|   110k|  tx_sf->tx_type_search.prune_tx_type_est_rd = 0;
 2482|   110k|  tx_sf->tx_type_search.winner_mode_tx_type_pruning = 0;
 2483|   110k|  tx_sf->txb_split_cap = 1;
 2484|   110k|  tx_sf->adaptive_txb_search_level = 0;
 2485|   110k|  tx_sf->refine_fast_tx_search_results = 1;
 2486|   110k|  tx_sf->prune_tx_size_level = 0;
 2487|   110k|  tx_sf->prune_intra_tx_depths_using_nn = false;
 2488|       |  tx_sf->use_rd_based_breakout_for_intra_tx_search = false;
 2489|   110k|  tx_sf->prune_inter_tx_split_rd_eval_lvl = 0;
 2490|   110k|  tx_sf->use_chroma_trellis_rd_mult = 0;
 2491|   110k|}
speed_features.c:init_rd_sf:
 2494|   110k|                              const AV1EncoderConfig *oxcf) {
 2495|   110k|  const int disable_trellis_quant = oxcf->algo_cfg.disable_trellis_quant;
 2496|   110k|  if (disable_trellis_quant == 3) {
  ------------------
  |  Branch (2496:7): [True: 110k, False: 0]
  ------------------
 2497|   110k|    rd_sf->optimize_coefficients = !is_lossless_requested(&oxcf->rc_cfg)
  ------------------
  |  Branch (2497:36): [True: 106k, False: 4.17k]
  ------------------
 2498|   110k|                                       ? NO_ESTIMATE_YRD_TRELLIS_OPT
 2499|   110k|                                       : NO_TRELLIS_OPT;
 2500|   110k|  } else if (disable_trellis_quant == 2) {
  ------------------
  |  Branch (2500:14): [True: 0, False: 0]
  ------------------
 2501|      0|    rd_sf->optimize_coefficients = !is_lossless_requested(&oxcf->rc_cfg)
  ------------------
  |  Branch (2501:36): [True: 0, False: 0]
  ------------------
 2502|      0|                                       ? FINAL_PASS_TRELLIS_OPT
 2503|      0|                                       : NO_TRELLIS_OPT;
 2504|      0|  } else if (disable_trellis_quant == 0) {
  ------------------
  |  Branch (2504:14): [True: 0, False: 0]
  ------------------
 2505|      0|    if (is_lossless_requested(&oxcf->rc_cfg)) {
  ------------------
  |  Branch (2505:9): [True: 0, False: 0]
  ------------------
 2506|      0|      rd_sf->optimize_coefficients = NO_TRELLIS_OPT;
 2507|      0|    } else {
 2508|      0|      rd_sf->optimize_coefficients = FULL_TRELLIS_OPT;
 2509|      0|    }
 2510|      0|  } else if (disable_trellis_quant == 1) {
  ------------------
  |  Branch (2510:14): [True: 0, False: 0]
  ------------------
 2511|      0|    rd_sf->optimize_coefficients = NO_TRELLIS_OPT;
 2512|      0|  } else {
 2513|       |    assert(0 && "Invalid disable_trellis_quant value");
 2514|      0|  }
 2515|   110k|  rd_sf->use_mb_rd_hash = 0;
 2516|   110k|  rd_sf->simple_model_rd_from_var = 0;
 2517|   110k|  rd_sf->tx_domain_dist_level = 0;
 2518|   110k|  rd_sf->tx_domain_dist_thres_level = 0;
 2519|   110k|  rd_sf->perform_coeff_opt = 0;
 2520|   110k|}
speed_features.c:init_winner_mode_sf:
 2523|   110k|    WINNER_MODE_SPEED_FEATURES *winner_mode_sf) {
 2524|   110k|  winner_mode_sf->motion_mode_for_winner_cand = 0;
 2525|       |  // Set this at the appropriate speed levels
 2526|   110k|  winner_mode_sf->tx_size_search_level = 0;
 2527|   110k|  winner_mode_sf->enable_winner_mode_for_coeff_opt = 0;
 2528|   110k|  winner_mode_sf->enable_winner_mode_for_tx_size_srch = 0;
 2529|   110k|  winner_mode_sf->enable_winner_mode_for_use_tx_domain_dist = 0;
 2530|   110k|  winner_mode_sf->multi_winner_mode_type = 0;
 2531|   110k|  winner_mode_sf->dc_blk_pred_level = 0;
 2532|   110k|  winner_mode_sf->winner_mode_ifs = 0;
 2533|   110k|  winner_mode_sf->prune_winner_mode_eval_level = 0;
 2534|   110k|}
speed_features.c:init_lpf_sf:
 2536|   110k|static inline void init_lpf_sf(LOOP_FILTER_SPEED_FEATURES *lpf_sf) {
 2537|   110k|  lpf_sf->disable_loop_restoration_chroma = 0;
 2538|   110k|  lpf_sf->disable_loop_restoration_luma = 0;
 2539|   110k|  lpf_sf->min_lr_unit_size = RESTORATION_PROC_UNIT_SIZE;
  ------------------
  |  |   34|   110k|#define RESTORATION_PROC_UNIT_SIZE 64
  ------------------
 2540|   110k|  lpf_sf->max_lr_unit_size = RESTORATION_UNITSIZE_MAX;
  ------------------
  |  |   80|   110k|#define RESTORATION_UNITSIZE_MAX 256
  ------------------
 2541|   110k|  lpf_sf->prune_wiener_based_on_src_var = 0;
 2542|   110k|  lpf_sf->prune_sgr_based_on_wiener = 0;
 2543|   110k|  lpf_sf->enable_sgr_ep_pruning = 0;
 2544|   110k|  lpf_sf->reduce_wiener_window_size = 0;
 2545|   110k|  lpf_sf->adaptive_luma_loop_filter_skip = 0;
 2546|   110k|  lpf_sf->skip_loop_filter_using_filt_error = 0;
 2547|   110k|  lpf_sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
 2548|   110k|  lpf_sf->use_coarse_filter_level_search = 0;
 2549|   110k|  lpf_sf->cdef_pick_method = CDEF_FULL_SEARCH;
 2550|   110k|  lpf_sf->zero_low_cdef_strengths = 0;
 2551|       |  // Set decoder side speed feature to use less dual sgr modes
 2552|   110k|  lpf_sf->dual_sgr_penalty_level = 0;
 2553|       |  // Enable Wiener and Self-guided Loop restoration filters by default.
 2554|   110k|  lpf_sf->disable_wiener_filter = false;
 2555|   110k|  lpf_sf->disable_sgr_filter = false;
 2556|       |  lpf_sf->disable_wiener_coeff_refine_search = false;
 2557|   110k|  lpf_sf->use_downsampled_wiener_stats = 0;
 2558|   110k|  lpf_sf->switchable_lr_with_bias_level = 0;
 2559|   110k|  lpf_sf->adaptive_cdef_mode = 0;
 2560|   110k|}
speed_features.c:init_rt_sf:
 2562|   110k|static inline void init_rt_sf(REAL_TIME_SPEED_FEATURES *rt_sf) {
 2563|   110k|  rt_sf->check_intra_pred_nonrd = 0;
 2564|   110k|  rt_sf->skip_intra_pred = 0;
 2565|   110k|  rt_sf->estimate_motion_for_var_based_partition = 0;
 2566|   110k|  rt_sf->nonrd_check_partition_merge_mode = 0;
 2567|   110k|  rt_sf->nonrd_check_partition_split = 0;
 2568|   110k|  rt_sf->mode_search_skip_flags = 0;
 2569|   110k|  rt_sf->nonrd_prune_ref_frame_search = 0;
 2570|   110k|  rt_sf->use_nonrd_pick_mode = 0;
 2571|   110k|  rt_sf->discount_color_cost = 0;
 2572|   110k|  rt_sf->use_nonrd_altref_frame = 0;
 2573|   110k|  rt_sf->use_comp_ref_nonrd = 0;
 2574|   110k|  rt_sf->use_real_time_ref_set = 0;
 2575|   110k|  rt_sf->short_circuit_low_temp_var = 0;
 2576|   110k|  rt_sf->reuse_inter_pred_nonrd = 0;
 2577|   110k|  rt_sf->num_inter_modes_for_tx_search = INT_MAX;
 2578|   110k|  rt_sf->use_nonrd_filter_search = 0;
 2579|   110k|  rt_sf->use_simple_rd_model = 0;
 2580|   110k|  rt_sf->hybrid_intra_pickmode = 0;
 2581|   110k|  rt_sf->prune_palette_search_nonrd = 0;
 2582|   110k|  rt_sf->source_metrics_sb_nonrd = 0;
 2583|   110k|  rt_sf->overshoot_detection_cbr = NO_DETECTION;
 2584|   110k|  rt_sf->check_scene_detection = 0;
 2585|   110k|  rt_sf->rc_adjust_keyframe = 0;
 2586|   110k|  rt_sf->rc_compute_spatial_var_sc_kf = 0;
 2587|   110k|  rt_sf->prefer_large_partition_blocks = 0;
 2588|   110k|  rt_sf->use_temporal_noise_estimate = 0;
 2589|   110k|  rt_sf->fullpel_search_step_param = 0;
 2590|  1.87M|  for (int i = 0; i < BLOCK_SIZES; ++i)
  ------------------
  |  Branch (2590:19): [True: 1.76M, False: 110k]
  ------------------
 2591|  1.76M|    rt_sf->intra_y_mode_bsize_mask_nrd[i] = INTRA_ALL;
 2592|   110k|  rt_sf->prune_hv_pred_modes_using_src_sad = false;
 2593|   110k|  rt_sf->nonrd_aggressive_skip = 0;
 2594|   110k|  rt_sf->skip_cdef_sb = 0;
 2595|   110k|  rt_sf->force_large_partition_blocks_intra = 0;
 2596|   110k|  rt_sf->skip_tx_no_split_var_based_partition = 0;
 2597|   110k|  rt_sf->skip_newmv_mode_based_on_sse = 0;
 2598|   110k|  rt_sf->gf_length_lvl = 0;
 2599|   110k|  rt_sf->prune_inter_modes_with_golden_ref = 0;
 2600|   110k|  rt_sf->prune_inter_modes_wrt_gf_arf_based_on_sad = 0;
 2601|   110k|  rt_sf->prune_inter_modes_using_temp_var = 0;
 2602|   110k|  rt_sf->reduce_mv_pel_precision_highmotion = 0;
 2603|   110k|  rt_sf->reduce_mv_pel_precision_lowcomplex = 0;
 2604|   110k|  rt_sf->prune_intra_mode_based_on_mv_range = 0;
 2605|   110k|  rt_sf->var_part_split_threshold_shift = 7;
 2606|   110k|  rt_sf->gf_refresh_based_on_qp = 0;
 2607|   110k|  rt_sf->use_rtc_tf = 0;
 2608|   110k|  rt_sf->use_idtx_nonrd = 0;
 2609|   110k|  rt_sf->prune_idtx_nonrd = 0;
 2610|   110k|  rt_sf->dct_only_palette_nonrd = 0;
 2611|   110k|  rt_sf->part_early_exit_zeromv = 0;
 2612|   110k|  rt_sf->sse_early_term_inter_search = EARLY_TERM_DISABLED;
 2613|   110k|  rt_sf->skip_lf_screen = 0;
 2614|   110k|  rt_sf->thresh_active_maps_skip_lf_cdef = 100;
 2615|   110k|  rt_sf->sad_based_adp_altref_lag = 0;
 2616|   110k|  rt_sf->partition_direct_merging = 0;
 2617|   110k|  rt_sf->var_part_based_on_qidx = 0;
 2618|   110k|  rt_sf->tx_size_level_based_on_qstep = 0;
 2619|   110k|  rt_sf->vbp_prune_16x16_split_using_min_max_sub_blk_var = false;
 2620|   110k|  rt_sf->prune_compoundmode_with_singlecompound_var = false;
 2621|   110k|  rt_sf->frame_level_mode_cost_update = false;
 2622|   110k|  rt_sf->prune_h_pred_using_best_mode_so_far = false;
 2623|   110k|  rt_sf->enable_intra_mode_pruning_using_neighbors = false;
 2624|   110k|  rt_sf->prune_intra_mode_using_best_sad_so_far = false;
 2625|   110k|  rt_sf->check_only_zero_zeromv_on_large_blocks = false;
 2626|   110k|  rt_sf->disable_cdf_update_non_reference_frame = false;
 2627|   110k|  rt_sf->prune_compoundmode_with_singlemode_var = false;
 2628|   110k|  rt_sf->skip_compound_based_on_var = false;
 2629|   110k|  rt_sf->set_zeromv_skip_based_on_source_sad = 1;
 2630|   110k|  rt_sf->use_adaptive_subpel_search = false;
 2631|   110k|  rt_sf->screen_content_cdef_filter_qindex_thresh = 0;
 2632|   110k|  rt_sf->enable_ref_short_signaling = false;
 2633|   110k|  rt_sf->check_globalmv_on_single_ref = true;
 2634|       |  rt_sf->increase_color_thresh_palette = false;
 2635|   110k|  rt_sf->selective_cdf_update = 0;
 2636|   110k|  rt_sf->rt_use_intrabc = 0;
 2637|   110k|  rt_sf->rt_prune_intrabc_nonrd = 0;
 2638|   110k|  rt_sf->rt_intrabc_miss_mode = 0;
 2639|   110k|  rt_sf->force_only_last_ref = 0;
 2640|   110k|  rt_sf->higher_thresh_scene_detection = 1;
 2641|   110k|  rt_sf->skip_newmv_flat_blocks_screen = 0;
 2642|   110k|  rt_sf->skip_encoding_non_reference_slide_change = 0;
 2643|   110k|  rt_sf->rc_faster_convergence_static = 0;
 2644|   110k|  rt_sf->skip_newmv_mode_sad_screen = 0;
 2645|   110k|}
speed_features.c:set_good_speed_features_framesize_independent:
 1098|  73.8k|    const AV1_COMP *const cpi, SPEED_FEATURES *const sf, int speed) {
 1099|  73.8k|  const AV1_COMMON *const cm = &cpi->common;
 1100|  73.8k|  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 1101|  73.8k|  const int boosted = frame_is_boosted(cpi);
 1102|  73.8k|  const int is_boosted_arf2_bwd_type =
 1103|  73.8k|      boosted || gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE;
  ------------------
  |  Branch (1103:7): [True: 36.9k, False: 36.9k]
  |  Branch (1103:18): [True: 0, False: 36.9k]
  ------------------
 1104|  73.8k|  const int is_inter_frame =
 1105|  73.8k|      gf_group->frame_type[cpi->gf_frame_index] == INTER_FRAME;
 1106|  73.8k|  const int allow_screen_content_tools =
 1107|  73.8k|      cm->features.allow_screen_content_tools;
 1108|  73.8k|  const int use_hbd = cpi->oxcf.use_highbitdepth;
 1109|  73.8k|  if (!cpi->oxcf.tile_cfg.enable_large_scale_tile) {
  ------------------
  |  Branch (1109:7): [True: 73.8k, False: 0]
  ------------------
 1110|  73.8k|    sf->hl_sf.high_precision_mv_usage = LAST_MV_DATA;
 1111|  73.8k|  }
 1112|       |
 1113|       |  // Speed 0 for all speed features that give neutral coding performance change.
 1114|  73.8k|  sf->gm_sf.gm_search_type = boosted ? GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2
  ------------------
  |  Branch (1114:30): [True: 36.9k, False: 36.9k]
  ------------------
 1115|  73.8k|                                     : GM_SEARCH_CLOSEST_REFS_ONLY;
 1116|  73.8k|  sf->gm_sf.prune_ref_frame_for_gm_search = boosted ? 0 : 1;
  ------------------
  |  Branch (1116:45): [True: 36.9k, False: 36.9k]
  ------------------
 1117|  73.8k|  sf->gm_sf.disable_gm_search_based_on_stats = 1;
 1118|       |
 1119|  73.8k|  sf->part_sf.ml_prune_partition = 1;
 1120|  73.8k|  sf->part_sf.prune_ext_partition_types_search_level = 1;
 1121|  73.8k|  sf->part_sf.prune_part4_search = 2;
 1122|  73.8k|  sf->part_sf.simple_motion_search_prune_rect = 1;
 1123|  73.8k|  sf->part_sf.ml_predict_breakout_level = use_hbd ? 1 : 3;
  ------------------
  |  Branch (1123:43): [True: 23.7k, False: 50.1k]
  ------------------
 1124|  73.8k|  sf->part_sf.reuse_prev_rd_results_for_part_ab = 1;
 1125|  73.8k|  sf->part_sf.use_best_rd_for_pruning = 1;
 1126|  73.8k|  sf->part_sf.simple_motion_search_prune_agg =
 1127|  73.8k|      allow_screen_content_tools ? NO_PRUNING : SIMPLE_AGG_LVL0;
  ------------------
  |  Branch (1127:7): [True: 7.92k, False: 65.9k]
  ------------------
 1128|       |
 1129|  73.8k|  sf->inter_sf.inter_mode_rd_model_estimation =
 1130|  73.8k|      cpi->oxcf.algo_cfg.sharpness ? 0 : 1;
  ------------------
  |  Branch (1130:7): [True: 43.0k, False: 30.7k]
  ------------------
 1131|  73.8k|  sf->inter_sf.model_based_post_interp_filter_breakout = 1;
 1132|  73.8k|  sf->inter_sf.prune_compound_using_single_ref = 1;
 1133|  73.8k|  sf->inter_sf.prune_mode_search_simple_translation = 1;
 1134|  73.8k|  sf->inter_sf.prune_ref_frame_for_rect_partitions =
 1135|  73.8k|      (boosted || (allow_screen_content_tools))
  ------------------
  |  Branch (1135:8): [True: 36.9k, False: 36.9k]
  |  Branch (1135:19): [True: 5.94k, False: 30.9k]
  ------------------
 1136|  73.8k|          ? 0
 1137|  73.8k|          : (is_boosted_arf2_bwd_type ? 1 : 2);
  ------------------
  |  Branch (1137:14): [True: 0, False: 30.9k]
  ------------------
 1138|  73.8k|  sf->inter_sf.reduce_inter_modes = boosted ? 1 : 2;
  ------------------
  |  Branch (1138:37): [True: 36.9k, False: 36.9k]
  ------------------
 1139|  73.8k|  sf->inter_sf.selective_ref_frame = 1;
 1140|  73.8k|  sf->inter_sf.use_dist_wtd_comp_flag = DIST_WTD_COMP_SKIP_MV_SEARCH;
 1141|  73.8k|  sf->inter_sf.enable_fast_compound_mode_search = 1;
 1142|  73.8k|  sf->inter_sf.prune_inter_modes_based_on_tpl = 1;
 1143|       |
 1144|  73.8k|  sf->interp_sf.use_fast_interpolation_filter_search = 1;
 1145|  73.8k|  sf->interp_sf.disable_dual_filter = 1;
 1146|  73.8k|  sf->interp_sf.use_more_sharp_interp = boosted ? 0 : 1;
  ------------------
  |  Branch (1146:41): [True: 36.9k, False: 36.9k]
  ------------------
 1147|       |
 1148|  73.8k|  sf->intra_sf.intra_pruning_with_hog = 1;
 1149|       |
 1150|  73.8k|  sf->tx_sf.adaptive_txb_search_level = 1;
 1151|  73.8k|  sf->tx_sf.intra_tx_size_search_init_depth_sqr = 1;
 1152|  73.8k|  sf->tx_sf.model_based_prune_tx_search_level = 1;
 1153|  73.8k|  sf->tx_sf.tx_type_search.use_reduced_intra_txset = 1;
 1154|       |
 1155|  73.8k|  sf->tpl_sf.search_method = NSTEP_8PT;
 1156|       |
 1157|  73.8k|  sf->rt_sf.use_nonrd_pick_mode = 0;
 1158|  73.8k|  sf->rt_sf.discount_color_cost = 0;
 1159|  73.8k|  sf->rt_sf.use_real_time_ref_set = 0;
 1160|       |
 1161|  73.8k|  if (cpi->twopass_frame.fr_content_type == FC_GRAPHICS_ANIMATION ||
  ------------------
  |  Branch (1161:7): [True: 0, False: 73.8k]
  ------------------
 1162|  73.8k|      cpi->use_screen_content_tools) {
  ------------------
  |  Branch (1162:7): [True: 7.92k, False: 65.9k]
  ------------------
 1163|  7.92k|    sf->mv_sf.exhaustive_searches_thresh = (1 << 20);
 1164|  65.9k|  } else {
 1165|  65.9k|    sf->mv_sf.exhaustive_searches_thresh = (1 << 25);
 1166|  65.9k|  }
 1167|  73.8k|  sf->mv_sf.disable_extensive_joint_motion_search = 1;
 1168|       |
 1169|  73.8k|  sf->rd_sf.perform_coeff_opt = 1;
 1170|  73.8k|  sf->hl_sf.superres_auto_search_type = SUPERRES_AUTO_DUAL;
 1171|       |
 1172|  73.8k|  sf->lpf_sf.reduce_wiener_window_size = 1;
 1173|       |
 1174|  73.8k|  if (speed >= 1) {
  ------------------
  |  Branch (1174:7): [True: 61.5k, False: 12.3k]
  ------------------
 1175|  61.5k|    sf->hl_sf.adjust_num_frames_for_arf_filtering =
 1176|  61.5k|        allow_screen_content_tools ? 0 : 1;
  ------------------
  |  Branch (1176:9): [True: 7.92k, False: 53.6k]
  ------------------
 1177|       |
 1178|  61.5k|    sf->part_sf.intra_cnn_based_part_prune_level =
 1179|  61.5k|        allow_screen_content_tools ? 0 : 2;
  ------------------
  |  Branch (1179:9): [True: 7.92k, False: 53.6k]
  ------------------
 1180|       |
 1181|  61.5k|    sf->part_sf.simple_motion_search_prune_agg =
 1182|  61.5k|        allow_screen_content_tools ? NO_PRUNING : SIMPLE_AGG_LVL1;
  ------------------
  |  Branch (1182:9): [True: 7.92k, False: 53.6k]
  ------------------
 1183|  61.5k|    sf->part_sf.simple_motion_search_early_term_none = 1;
 1184|       |    // TODO(Venkat): Clean-up frame type dependency for
 1185|       |    // simple_motion_search_split in partition search function and set the
 1186|       |    // speed feature accordingly
 1187|  61.5k|    sf->part_sf.simple_motion_search_split = allow_screen_content_tools ? 1 : 2;
  ------------------
  |  Branch (1187:46): [True: 7.92k, False: 53.6k]
  ------------------
 1188|  61.5k|    sf->part_sf.ml_predict_breakout_level = use_hbd ? 2 : 3;
  ------------------
  |  Branch (1188:45): [True: 19.7k, False: 41.7k]
  ------------------
 1189|  61.5k|    sf->part_sf.prune_h_or_v_4part_using_sms_info = boosted ? false : true;
  ------------------
  |  Branch (1189:53): [True: 24.6k, False: 36.9k]
  ------------------
 1190|       |
 1191|  61.5k|    sf->mv_sf.exhaustive_searches_thresh <<= 1;
 1192|  61.5k|    sf->mv_sf.obmc_full_pixel_search_level = 1;
 1193|  61.5k|    sf->mv_sf.use_accurate_subpel_search = USE_4_TAPS;
 1194|       |
 1195|  61.5k|    sf->inter_sf.prune_comp_search_by_single_result = boosted ? 2 : 1;
  ------------------
  |  Branch (1195:55): [True: 24.6k, False: 36.9k]
  ------------------
 1196|  61.5k|    sf->inter_sf.prune_comp_type_by_comp_avg = 1;
 1197|  61.5k|    sf->inter_sf.prune_comp_type_by_model_rd = boosted ? 0 : 1;
  ------------------
  |  Branch (1197:48): [True: 24.6k, False: 36.9k]
  ------------------
 1198|  61.5k|    sf->inter_sf.prune_ref_frame_for_rect_partitions =
 1199|  61.5k|        (frame_is_intra_only(&cpi->common) || (allow_screen_content_tools))
  ------------------
  |  Branch (1199:10): [True: 24.6k, False: 36.9k]
  |  Branch (1199:47): [True: 5.94k, False: 30.9k]
  ------------------
 1200|  61.5k|            ? 0
 1201|  61.5k|            : (boosted ? 1 : 2);
  ------------------
  |  Branch (1201:16): [True: 0, False: 30.9k]
  ------------------
 1202|  61.5k|    sf->inter_sf.reduce_inter_modes = boosted ? 1 : 3;
  ------------------
  |  Branch (1202:39): [True: 24.6k, False: 36.9k]
  ------------------
 1203|  61.5k|    sf->inter_sf.reuse_inter_intra_mode = 1;
 1204|  61.5k|    sf->inter_sf.selective_ref_frame = 2;
 1205|  61.5k|    sf->inter_sf.skip_arf_compound = 1;
 1206|  61.5k|    sf->inter_sf.prune_comp_using_best_single_mode_ref = 2;
 1207|  61.5k|    sf->inter_sf.use_dist_wtd_comp_flag = DIST_WTD_COMP_DISABLED;
 1208|  61.5k|    sf->inter_sf.enable_comp_wedge_search_using_model_rd = 1;
 1209|       |
 1210|  61.5k|    sf->interp_sf.use_interp_filter = 1;
 1211|  61.5k|    sf->interp_sf.skip_model_rd_uv = 1;
 1212|       |
 1213|  61.5k|    sf->intra_sf.prune_palette_search_level = 1;
 1214|       |
 1215|  61.5k|    sf->tx_sf.adaptive_txb_search_level = 2;
 1216|  61.5k|    sf->tx_sf.inter_tx_size_search_init_depth_rect = 1;
 1217|  61.5k|    sf->tx_sf.inter_tx_size_search_init_depth_sqr = 1;
 1218|  61.5k|    sf->tx_sf.intra_tx_size_search_init_depth_rect = 1;
 1219|  61.5k|    sf->tx_sf.model_based_prune_tx_search_level = 0;
 1220|  61.5k|    sf->tx_sf.tx_type_search.ml_tx_split_thresh = 4000;
 1221|  61.5k|    sf->tx_sf.tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_2;
 1222|  61.5k|    sf->tx_sf.tx_type_search.skip_tx_search = 1;
 1223|  61.5k|    sf->tx_sf.prune_inter_tx_split_rd_eval_lvl = 1;
 1224|       |
 1225|  61.5k|    sf->rd_sf.perform_coeff_opt = boosted ? 2 : 3;
  ------------------
  |  Branch (1225:35): [True: 24.6k, False: 36.9k]
  ------------------
 1226|  61.5k|    sf->rd_sf.tx_domain_dist_level = boosted ? 1 : 2;
  ------------------
  |  Branch (1226:38): [True: 24.6k, False: 36.9k]
  ------------------
 1227|  61.5k|    sf->rd_sf.tx_domain_dist_thres_level = 1;
 1228|       |
 1229|  61.5k|    sf->lpf_sf.dual_sgr_penalty_level = 1;
 1230|  61.5k|    sf->lpf_sf.enable_sgr_ep_pruning = 1;
 1231|       |
 1232|       |    // TODO(any, yunqing): move this feature to speed 0.
 1233|  61.5k|    sf->tpl_sf.skip_alike_starting_mv = 1;
 1234|  61.5k|  }
 1235|       |
 1236|  73.8k|  if (speed >= 2) {
  ------------------
  |  Branch (1236:7): [True: 61.5k, False: 12.3k]
  ------------------
 1237|  61.5k|    sf->hl_sf.recode_loop = ALLOW_RECODE_KFARFGF;
 1238|       |
 1239|  61.5k|    sf->part_sf.simple_motion_search_prune_agg =
 1240|  61.5k|        allow_screen_content_tools ? NO_PRUNING : SIMPLE_AGG_LVL2;
  ------------------
  |  Branch (1240:9): [True: 7.92k, False: 53.6k]
  ------------------
 1241|  61.5k|    sf->fp_sf.skip_motion_search_threshold = 25;
 1242|       |
 1243|  61.5k|    sf->gm_sf.num_refinement_steps = 2;
 1244|       |
 1245|  61.5k|    sf->part_sf.reuse_best_prediction_for_part_ab =
 1246|  61.5k|        !frame_is_intra_only(&cpi->common);
 1247|       |
 1248|  61.5k|    sf->mv_sf.simple_motion_subpel_force_stop = QUARTER_PEL;
 1249|  61.5k|    sf->mv_sf.subpel_iters_per_step = 1;
 1250|  61.5k|    sf->mv_sf.reduce_search_range = 1;
 1251|       |
 1252|       |    // TODO(chiyotsai@google.com): We can get 10% speed up if we move
 1253|       |    // adaptive_rd_thresh to speed 1. But currently it performs poorly on some
 1254|       |    // clips (e.g. 5% loss on dinner_1080p). We need to examine the sequence a
 1255|       |    // bit more closely to figure out why.
 1256|  61.5k|    sf->inter_sf.adaptive_rd_thresh = 1;
 1257|  61.5k|    sf->inter_sf.disable_interinter_wedge_var_thresh = 100;
 1258|  61.5k|    sf->inter_sf.fast_interintra_wedge_search = 1;
 1259|  61.5k|    sf->inter_sf.prune_comp_search_by_single_result = boosted ? 4 : 1;
  ------------------
  |  Branch (1259:55): [True: 24.6k, False: 36.9k]
  ------------------
 1260|  61.5k|    sf->inter_sf.prune_ext_comp_using_neighbors = 1;
 1261|  61.5k|    sf->inter_sf.prune_comp_type_by_comp_avg = 2;
 1262|  61.5k|    sf->inter_sf.selective_ref_frame = 3;
 1263|  61.5k|    sf->inter_sf.reuse_mask_search_results = 1;
 1264|  61.5k|    set_txfm_rd_gate_level(sf->inter_sf.txfm_rd_gate_level, boosted ? 0 : 1);
  ------------------
  |  Branch (1264:61): [True: 24.6k, False: 36.9k]
  ------------------
 1265|  61.5k|    sf->inter_sf.inter_mode_txfm_breakout = boosted ? 0 : 1;
  ------------------
  |  Branch (1265:45): [True: 24.6k, False: 36.9k]
  ------------------
 1266|  61.5k|    sf->inter_sf.alt_ref_search_fp = 1;
 1267|  61.5k|    sf->inter_sf.prune_single_ref = boosted ? 1 : 2;
  ------------------
  |  Branch (1267:37): [True: 24.6k, False: 36.9k]
  ------------------
 1268|       |
 1269|  61.5k|    sf->interp_sf.adaptive_interp_filter_search = 1;
 1270|       |
 1271|  61.5k|    sf->intra_sf.intra_pruning_with_hog = 2;
 1272|  61.5k|    sf->intra_sf.skip_intra_in_interframe = is_inter_frame ? 2 : 1;
  ------------------
  |  Branch (1272:45): [True: 36.9k, False: 24.6k]
  ------------------
 1273|  61.5k|    sf->intra_sf.skip_filter_intra_in_inter_frames = 1;
 1274|       |
 1275|  61.5k|    sf->tpl_sf.prune_starting_mv = 1;
 1276|  61.5k|    sf->tpl_sf.search_method = DIAMOND;
 1277|       |
 1278|  61.5k|    sf->rd_sf.perform_coeff_opt = is_boosted_arf2_bwd_type ? 3 : 4;
  ------------------
  |  Branch (1278:35): [True: 24.6k, False: 36.9k]
  ------------------
 1279|  61.5k|    sf->rd_sf.use_mb_rd_hash = 1;
 1280|       |
 1281|  61.5k|    sf->lpf_sf.prune_wiener_based_on_src_var = 1;
 1282|  61.5k|    sf->lpf_sf.prune_sgr_based_on_wiener = 1;
 1283|  61.5k|    sf->lpf_sf.disable_loop_restoration_chroma = boosted ? 0 : 1;
  ------------------
  |  Branch (1283:50): [True: 24.6k, False: 36.9k]
  ------------------
 1284|       |
 1285|       |    // TODO(any): Re-evaluate this feature set to 1 in speed 2.
 1286|  61.5k|    sf->tpl_sf.allow_compound_pred = 0;
 1287|  61.5k|    sf->tpl_sf.prune_ref_frames_in_tpl = 1;
 1288|       |
 1289|  61.5k|    sf->tx_sf.prune_inter_tx_split_rd_eval_lvl = 2;
 1290|  61.5k|  }
 1291|       |
 1292|  73.8k|  if (speed >= 3) {
  ------------------
  |  Branch (1292:7): [True: 61.5k, False: 12.3k]
  ------------------
 1293|  61.5k|    sf->hl_sf.high_precision_mv_usage = CURRENT_Q;
 1294|  61.5k|    sf->hl_sf.weight_calc_level_in_tf = 1;
 1295|       |
 1296|  61.5k|    sf->gm_sf.prune_ref_frame_for_gm_search = 1;
 1297|  61.5k|    sf->gm_sf.prune_zero_mv_with_sse = 1;
 1298|  61.5k|    sf->gm_sf.num_refinement_steps = 0;
 1299|       |
 1300|  61.5k|    sf->part_sf.simple_motion_search_prune_agg =
 1301|  61.5k|        allow_screen_content_tools
  ------------------
  |  Branch (1301:9): [True: 7.92k, False: 53.6k]
  ------------------
 1302|  61.5k|            ? SIMPLE_AGG_LVL0
 1303|  61.5k|            : (boosted ? SIMPLE_AGG_LVL3 : QIDX_BASED_AGG_LVL1);
  ------------------
  |  Branch (1303:16): [True: 22.6k, False: 30.9k]
  ------------------
 1304|  61.5k|    sf->part_sf.prune_ext_part_using_split_info = 1;
 1305|  61.5k|    sf->part_sf.simple_motion_search_rect_split = 1;
 1306|  61.5k|    sf->part_sf.prune_h_or_v_4part_using_sms_info = true;
 1307|       |
 1308|  61.5k|    sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED;
 1309|  61.5k|    sf->mv_sf.search_method = DIAMOND;
 1310|  61.5k|    sf->mv_sf.disable_second_mv = 2;
 1311|  61.5k|    sf->mv_sf.prune_mesh_search = PRUNE_MESH_SEARCH_LVL_1;
 1312|  61.5k|    sf->mv_sf.use_intrabc = 0;
 1313|       |
 1314|  61.5k|    sf->inter_sf.disable_interinter_wedge_newmv_search = boosted ? 0 : 1;
  ------------------
  |  Branch (1314:58): [True: 24.6k, False: 36.9k]
  ------------------
 1315|  61.5k|    sf->inter_sf.mv_cost_upd_level = INTERNAL_COST_UPD_SBROW;
 1316|  61.5k|    sf->inter_sf.disable_onesided_comp = 1;
 1317|  61.5k|    sf->inter_sf.disable_interintra_wedge_var_thresh = UINT_MAX;
 1318|       |    // TODO(any): Experiment with the early exit mechanism for speeds 0, 1 and 2
 1319|       |    // and clean-up the speed feature
 1320|  61.5k|    sf->inter_sf.perform_best_rd_based_gating_for_chroma = 1;
 1321|  61.5k|    sf->inter_sf.prune_inter_modes_based_on_tpl = boosted ? 1 : 2;
  ------------------
  |  Branch (1321:51): [True: 24.6k, False: 36.9k]
  ------------------
 1322|  61.5k|    sf->inter_sf.prune_comp_search_by_single_result = boosted ? 4 : 2;
  ------------------
  |  Branch (1322:55): [True: 24.6k, False: 36.9k]
  ------------------
 1323|  61.5k|    sf->inter_sf.selective_ref_frame = 5;
 1324|  61.5k|    sf->inter_sf.reuse_compound_type_decision = 1;
 1325|  61.5k|    set_txfm_rd_gate_level(sf->inter_sf.txfm_rd_gate_level,
 1326|  61.5k|                           boosted ? 0 : (is_boosted_arf2_bwd_type ? 1 : 2));
  ------------------
  |  Branch (1326:28): [True: 24.6k, False: 36.9k]
  |  Branch (1326:43): [True: 0, False: 36.9k]
  ------------------
 1327|  61.5k|    sf->inter_sf.inter_mode_txfm_breakout = boosted ? 0 : 2;
  ------------------
  |  Branch (1327:45): [True: 24.6k, False: 36.9k]
  ------------------
 1328|  61.5k|    sf->inter_sf.prune_single_ref = 2;
 1329|       |
 1330|  61.5k|    sf->interp_sf.adaptive_interp_filter_search = 2;
 1331|       |
 1332|       |    // TODO(chiyotsai@google.com): the thresholds chosen for intra hog are
 1333|       |    // inherited directly from luma hog with some minor tweaking. Eventually we
 1334|       |    // should run this with a bayesian optimizer to find the Pareto frontier.
 1335|  61.5k|    sf->intra_sf.chroma_intra_pruning_with_hog = 2;
 1336|  61.5k|    sf->intra_sf.intra_pruning_with_hog = 3;
 1337|  61.5k|    sf->intra_sf.prune_palette_search_level = 2;
 1338|  61.5k|    sf->intra_sf.top_intra_model_count_allowed = 2;
 1339|       |
 1340|  61.5k|    sf->tpl_sf.prune_starting_mv = 2;
 1341|  61.5k|    sf->tpl_sf.skip_alike_starting_mv = 2;
 1342|  61.5k|    sf->tpl_sf.prune_intra_modes = 1;
 1343|  61.5k|    sf->tpl_sf.reduce_first_step_size = 6;
 1344|  61.5k|    sf->tpl_sf.subpel_force_stop = QUARTER_PEL;
 1345|       |
 1346|  61.5k|    sf->tx_sf.adaptive_txb_search_level = boosted ? 2 : 3;
  ------------------
  |  Branch (1346:43): [True: 24.6k, False: 36.9k]
  ------------------
 1347|  61.5k|    sf->tx_sf.tx_type_search.use_skip_flag_prediction = 2;
 1348|  61.5k|    sf->tx_sf.tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_3;
 1349|       |
 1350|       |    // TODO(any): Refactor the code related to following winner mode speed
 1351|       |    // features
 1352|  61.5k|    sf->winner_mode_sf.enable_winner_mode_for_coeff_opt = 1;
 1353|  61.5k|    sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist = 1;
 1354|  61.5k|    sf->winner_mode_sf.motion_mode_for_winner_cand =
 1355|  61.5k|        boosted                                                          ? 0
  ------------------
  |  Branch (1355:9): [True: 24.6k, False: 36.9k]
  ------------------
 1356|  61.5k|        : gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE ? 1
  ------------------
  |  Branch (1356:11): [True: 0, False: 36.9k]
  ------------------
 1357|  36.9k|                                                                         : 2;
 1358|  61.5k|    sf->winner_mode_sf.prune_winner_mode_eval_level = boosted ? 0 : 4;
  ------------------
  |  Branch (1358:55): [True: 24.6k, False: 36.9k]
  ------------------
 1359|       |
 1360|       |    // For screen content, "prune_sgr_based_on_wiener = 2" cause large quality
 1361|       |    // loss.
 1362|  61.5k|    sf->lpf_sf.prune_sgr_based_on_wiener = allow_screen_content_tools ? 1 : 2;
  ------------------
  |  Branch (1362:44): [True: 7.92k, False: 53.6k]
  ------------------
 1363|  61.5k|    sf->lpf_sf.prune_wiener_based_on_src_var = 2;
 1364|  61.5k|    sf->lpf_sf.use_coarse_filter_level_search =
 1365|  61.5k|        frame_is_intra_only(&cpi->common) ? 0 : 1;
  ------------------
  |  Branch (1365:9): [True: 24.6k, False: 36.9k]
  ------------------
 1366|  61.5k|    sf->lpf_sf.use_downsampled_wiener_stats = 1;
 1367|  61.5k|  }
 1368|       |
 1369|  73.8k|  if (speed >= 4) {
  ------------------
  |  Branch (1369:7): [True: 61.5k, False: 12.3k]
  ------------------
 1370|  61.5k|    sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
 1371|       |
 1372|  61.5k|    sf->gm_sf.prune_zero_mv_with_sse = 2;
 1373|  61.5k|    sf->gm_sf.downsample_level = 1;
 1374|       |
 1375|  61.5k|    sf->part_sf.simple_motion_search_prune_agg =
 1376|  61.5k|        allow_screen_content_tools ? SIMPLE_AGG_LVL0 : SIMPLE_AGG_LVL4;
  ------------------
  |  Branch (1376:9): [True: 7.92k, False: 53.6k]
  ------------------
 1377|  61.5k|    sf->part_sf.simple_motion_search_reduce_search_steps = 4;
 1378|  61.5k|    sf->part_sf.prune_ext_part_using_split_info = 2;
 1379|  61.5k|    sf->part_sf.ml_predict_breakout_level = 3;
 1380|  61.5k|    sf->part_sf.prune_rectangular_split_based_on_qidx =
 1381|  61.5k|        (allow_screen_content_tools || frame_is_intra_only(&cpi->common)) ? 0
  ------------------
  |  Branch (1381:10): [True: 7.92k, False: 53.6k]
  |  Branch (1381:40): [True: 22.6k, False: 30.9k]
  ------------------
 1382|  61.5k|                                                                          : 1;
 1383|       |
 1384|  61.5k|    sf->inter_sf.alt_ref_search_fp = 2;
 1385|  61.5k|    sf->inter_sf.txfm_rd_gate_level[TX_SEARCH_DEFAULT] = boosted ? 0 : 3;
  ------------------
  |  Branch (1385:58): [True: 24.6k, False: 36.9k]
  ------------------
 1386|  61.5k|    sf->inter_sf.txfm_rd_gate_level[TX_SEARCH_MOTION_MODE] = boosted ? 0 : 5;
  ------------------
  |  Branch (1386:62): [True: 24.6k, False: 36.9k]
  ------------------
 1387|  61.5k|    sf->inter_sf.txfm_rd_gate_level[TX_SEARCH_COMP_TYPE_MODE] = boosted ? 0 : 3;
  ------------------
  |  Branch (1387:65): [True: 24.6k, False: 36.9k]
  ------------------
 1388|       |
 1389|  61.5k|    sf->inter_sf.prune_inter_modes_based_on_tpl = boosted ? 1 : 3;
  ------------------
  |  Branch (1389:51): [True: 24.6k, False: 36.9k]
  ------------------
 1390|  61.5k|    sf->inter_sf.prune_ext_comp_using_neighbors = 2;
 1391|  61.5k|    sf->inter_sf.prune_obmc_prob_thresh = INT_MAX;
 1392|  61.5k|    sf->inter_sf.disable_interinter_wedge_var_thresh = UINT_MAX;
 1393|       |
 1394|  61.5k|    sf->interp_sf.cb_pred_filter_search = 1;
 1395|  61.5k|    sf->interp_sf.skip_sharp_interp_filter_search = 1;
 1396|  61.5k|    sf->interp_sf.use_interp_filter = 2;
 1397|  61.5k|    sf->interp_sf.use_more_sharp_interp = 0;
 1398|       |
 1399|  61.5k|    sf->intra_sf.intra_uv_mode_mask[TX_16X16] = UV_INTRA_DC_H_V_CFL;
 1400|  61.5k|    sf->intra_sf.intra_uv_mode_mask[TX_32X32] = UV_INTRA_DC_H_V_CFL;
 1401|  61.5k|    sf->intra_sf.intra_uv_mode_mask[TX_64X64] = UV_INTRA_DC_H_V_CFL;
 1402|       |    // TODO(any): "intra_y_mode_mask" doesn't help much at speed 4.
 1403|       |    // sf->intra_sf.intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
 1404|       |    // sf->intra_sf.intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
 1405|       |    // sf->intra_sf.intra_y_mode_mask[TX_64X64] = INTRA_DC_H_V;
 1406|  61.5k|    sf->intra_sf.skip_intra_in_interframe = 4;
 1407|       |
 1408|  61.5k|    sf->mv_sf.simple_motion_subpel_force_stop = HALF_PEL;
 1409|  61.5k|    sf->mv_sf.prune_mesh_search = PRUNE_MESH_SEARCH_LVL_2;
 1410|       |
 1411|  61.5k|    sf->tpl_sf.subpel_force_stop = HALF_PEL;
 1412|  61.5k|    sf->tpl_sf.search_method = FAST_BIGDIA;
 1413|  61.5k|    sf->tpl_sf.use_sad_for_mode_decision = 1;
 1414|       |
 1415|  61.5k|    sf->tx_sf.tx_type_search.fast_intra_tx_type_search = 1;
 1416|       |
 1417|  61.5k|    sf->rd_sf.perform_coeff_opt = is_boosted_arf2_bwd_type ? 5 : 7;
  ------------------
  |  Branch (1417:35): [True: 24.6k, False: 36.9k]
  ------------------
 1418|       |
 1419|       |    // TODO(any): Extend multi-winner mode processing support for inter frames
 1420|  61.5k|    sf->winner_mode_sf.multi_winner_mode_type =
 1421|  61.5k|        frame_is_intra_only(&cpi->common) ? MULTI_WINNER_MODE_DEFAULT
  ------------------
  |  Branch (1421:9): [True: 24.6k, False: 36.9k]
  ------------------
 1422|  61.5k|                                          : MULTI_WINNER_MODE_OFF;
 1423|  61.5k|    sf->winner_mode_sf.dc_blk_pred_level = boosted ? 0 : 2;
  ------------------
  |  Branch (1423:44): [True: 24.6k, False: 36.9k]
  ------------------
 1424|       |
 1425|  61.5k|    sf->lpf_sf.lpf_pick = LPF_PICK_FROM_FULL_IMAGE_NON_DUAL;
 1426|  61.5k|  }
 1427|       |
 1428|  73.8k|  if (speed >= 5) {
  ------------------
  |  Branch (1428:7): [True: 61.5k, False: 12.3k]
  ------------------
 1429|  61.5k|    sf->hl_sf.adjust_num_frames_for_arf_filtering =
 1430|  61.5k|        allow_screen_content_tools ? 0 : 2;
  ------------------
  |  Branch (1430:9): [True: 7.92k, False: 53.6k]
  ------------------
 1431|       |
 1432|  61.5k|    sf->fp_sf.reduce_mv_step_param = 4;
 1433|       |
 1434|  61.5k|    sf->part_sf.simple_motion_search_prune_agg =
 1435|  61.5k|        allow_screen_content_tools ? SIMPLE_AGG_LVL0 : SIMPLE_AGG_LVL5;
  ------------------
  |  Branch (1435:9): [True: 7.92k, False: 53.6k]
  ------------------
 1436|  61.5k|    sf->part_sf.ext_partition_eval_thresh =
 1437|  61.5k|        allow_screen_content_tools ? BLOCK_8X8 : BLOCK_16X16;
  ------------------
  |  Branch (1437:9): [True: 7.92k, False: 53.6k]
  ------------------
 1438|  61.5k|    sf->part_sf.prune_sub_8x8_partition_level =
 1439|  61.5k|        allow_screen_content_tools ? 1 : 2;
  ------------------
  |  Branch (1439:9): [True: 7.92k, False: 53.6k]
  ------------------
 1440|       |
 1441|  61.5k|    sf->mv_sf.warp_search_method = WARP_SEARCH_DIAMOND;
 1442|       |
 1443|  61.5k|    sf->inter_sf.prune_inter_modes_if_skippable = 1;
 1444|  61.5k|    sf->inter_sf.prune_single_ref = is_boosted_arf2_bwd_type ? 0 : 3;
  ------------------
  |  Branch (1444:37): [True: 24.6k, False: 36.9k]
  ------------------
 1445|  61.5k|    sf->inter_sf.txfm_rd_gate_level[TX_SEARCH_DEFAULT] = boosted ? 0 : 4;
  ------------------
  |  Branch (1445:58): [True: 24.6k, False: 36.9k]
  ------------------
 1446|  61.5k|    sf->inter_sf.txfm_rd_gate_level[TX_SEARCH_COMP_TYPE_MODE] = boosted ? 0 : 5;
  ------------------
  |  Branch (1446:65): [True: 24.6k, False: 36.9k]
  ------------------
 1447|  61.5k|    sf->inter_sf.enable_fast_compound_mode_search = 2;
 1448|       |
 1449|  61.5k|    sf->interp_sf.skip_interp_filter_search = boosted ? 0 : 1;
  ------------------
  |  Branch (1449:47): [True: 24.6k, False: 36.9k]
  ------------------
 1450|       |
 1451|  61.5k|    sf->intra_sf.chroma_intra_pruning_with_hog = 3;
 1452|  61.5k|    sf->intra_sf.disable_smooth_intra = 1;
 1453|       |
 1454|       |    // TODO(any): Extend multi-winner mode processing support for inter frames
 1455|  61.5k|    sf->winner_mode_sf.multi_winner_mode_type =
 1456|  61.5k|        frame_is_intra_only(&cpi->common) ? MULTI_WINNER_MODE_FAST
  ------------------
  |  Branch (1456:9): [True: 24.6k, False: 36.9k]
  ------------------
 1457|  61.5k|                                          : MULTI_WINNER_MODE_OFF;
 1458|       |
 1459|       |    // Disable Self-guided Loop restoration filter.
 1460|  61.5k|    sf->lpf_sf.enable_sgr_ep_pruning = 2;
 1461|  61.5k|    sf->lpf_sf.disable_wiener_coeff_refine_search = true;
 1462|       |
 1463|  61.5k|    sf->tpl_sf.prune_starting_mv = 3;
 1464|  61.5k|    sf->tpl_sf.use_y_only_rate_distortion = 1;
 1465|  61.5k|    sf->tpl_sf.subpel_force_stop = FULL_PEL;
 1466|  61.5k|    sf->tpl_sf.gop_length_decision_method = 2;
 1467|  61.5k|    sf->tpl_sf.use_sad_for_mode_decision = 2;
 1468|       |
 1469|  61.5k|    sf->winner_mode_sf.dc_blk_pred_level = 2;
 1470|       |
 1471|  61.5k|    sf->fp_sf.disable_recon = 1;
 1472|  61.5k|  }
 1473|       |
 1474|  73.8k|  if (speed >= 6) {
  ------------------
  |  Branch (1474:7): [True: 61.5k, False: 12.3k]
  ------------------
 1475|  61.5k|    sf->hl_sf.disable_extra_sc_testing = 1;
 1476|  61.5k|    sf->hl_sf.second_alt_ref_filtering = 0;
 1477|       |
 1478|  61.5k|    sf->gm_sf.downsample_level = 2;
 1479|       |
 1480|  61.5k|    sf->inter_sf.prune_inter_modes_based_on_tpl = boosted ? 1 : 4;
  ------------------
  |  Branch (1480:51): [True: 24.6k, False: 36.9k]
  ------------------
 1481|  61.5k|    sf->inter_sf.selective_ref_frame = 6;
 1482|  61.5k|    sf->inter_sf.prune_single_ref = is_boosted_arf2_bwd_type ? 0 : 4;
  ------------------
  |  Branch (1482:37): [True: 24.6k, False: 36.9k]
  ------------------
 1483|  61.5k|    sf->inter_sf.prune_ext_comp_using_neighbors = 3;
 1484|       |
 1485|  61.5k|    sf->intra_sf.chroma_intra_pruning_with_hog = 4;
 1486|  61.5k|    sf->intra_sf.intra_pruning_with_hog = 4;
 1487|  61.5k|    sf->intra_sf.intra_uv_mode_mask[TX_32X32] = UV_INTRA_DC;
 1488|  61.5k|    sf->intra_sf.intra_uv_mode_mask[TX_64X64] = UV_INTRA_DC;
 1489|  61.5k|    sf->intra_sf.intra_y_mode_mask[TX_32X32] = INTRA_DC;
 1490|  61.5k|    sf->intra_sf.intra_y_mode_mask[TX_64X64] = INTRA_DC;
 1491|  61.5k|    sf->intra_sf.early_term_chroma_palette_size_search = 1;
 1492|       |
 1493|  61.5k|    sf->part_sf.prune_rectangular_split_based_on_qidx =
 1494|  61.5k|        boosted || allow_screen_content_tools ? 0 : 2;
  ------------------
  |  Branch (1494:9): [True: 24.6k, False: 36.9k]
  |  Branch (1494:20): [True: 5.94k, False: 30.9k]
  ------------------
 1495|       |
 1496|  61.5k|    sf->part_sf.prune_part4_search = 3;
 1497|       |
 1498|  61.5k|    sf->mv_sf.simple_motion_subpel_force_stop = FULL_PEL;
 1499|       |
 1500|  61.5k|    sf->tpl_sf.gop_length_decision_method = 3;
 1501|       |
 1502|  61.5k|    sf->rd_sf.perform_coeff_opt = is_boosted_arf2_bwd_type ? 6 : 8;
  ------------------
  |  Branch (1502:35): [True: 24.6k, False: 36.9k]
  ------------------
 1503|       |
 1504|  61.5k|    sf->winner_mode_sf.dc_blk_pred_level = 3;
 1505|  61.5k|    sf->winner_mode_sf.multi_winner_mode_type = MULTI_WINNER_MODE_OFF;
 1506|       |
 1507|  61.5k|    sf->fp_sf.skip_zeromv_motion_search = 1;
 1508|  61.5k|  }
 1509|       |
 1510|  73.8k|  if (cpi->oxcf.enable_low_complexity_decode)
  ------------------
  |  Branch (1510:7): [True: 0, False: 73.8k]
  ------------------
 1511|      0|    set_good_speed_features_lc_dec_framesize_independent(cpi, sf, speed);
 1512|       |
 1513|  73.8k|  if (cpi->oxcf.algo_cfg.sharpness == 3) {
  ------------------
  |  Branch (1513:7): [True: 0, False: 73.8k]
  ------------------
 1514|      0|    sf->tx_sf.adaptive_txb_search_level = 0;
 1515|      0|    sf->tx_sf.tx_type_search.use_skip_flag_prediction = 0;
 1516|      0|  }
 1517|       |
 1518|       |  // Set speed features for the IQ and SSIMULACRA2 tuning modes
 1519|       |  // Layered image encoding has different requirements than regular video
 1520|       |  // coding.
 1521|       |  // Mainly, most of these speed features undo an implicit assumption that
 1522|       |  // keyframes are encoded at a better quality than inter-coded frames.
 1523|       |  // This means the encoder needs to be more thorough at considering and
 1524|       |  // performing RDO on intra block candidates vs. inter block candidates for
 1525|       |  // the best compression efficiency.
 1526|       |  // Finally, enabling certain coding tools are beneficial for layered image
 1527|       |  // encoding in general.
 1528|  73.8k|  if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (1528:7): [True: 43.0k, False: 30.7k]
  ------------------
 1529|  43.0k|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (1529:7): [True: 0, False: 30.7k]
  ------------------
 1530|  43.0k|    sf->intra_sf.skip_intra_in_interframe = 0;
 1531|  43.0k|    sf->inter_sf.inter_mode_rd_model_estimation = 0;
 1532|  43.0k|    sf->mv_sf.use_intrabc = 1;
 1533|       |
 1534|       |    // Don't prune intra candidates too aggressively, as it can cause more
 1535|       |    // expensive inter candidates to be chosen instead
 1536|  43.0k|    if (sf->intra_sf.intra_pruning_with_hog > 3) {
  ------------------
  |  Branch (1536:9): [True: 43.0k, False: 0]
  ------------------
 1537|  43.0k|      sf->intra_sf.intra_pruning_with_hog = 3;
 1538|  43.0k|    }
 1539|  43.0k|    if (sf->intra_sf.chroma_intra_pruning_with_hog > 3) {
  ------------------
  |  Branch (1539:9): [True: 43.0k, False: 0]
  ------------------
 1540|  43.0k|      sf->intra_sf.chroma_intra_pruning_with_hog = 3;
 1541|  43.0k|    }
 1542|  43.0k|  }
 1543|  73.8k|}
speed_features.c:set_rt_speed_features_framesize_independent:
 1939|  36.6k|                                                        int speed) {
 1940|  36.6k|  AV1_COMMON *const cm = &cpi->common;
 1941|  36.6k|  const int boosted = frame_is_boosted(cpi);
 1942|       |
 1943|       |  // Currently, rt speed 0, 1, 2, 3, 4, 5 are the same.
 1944|       |  // Following set of speed features are not impacting encoder's decisions as
 1945|       |  // the relevant tools are disabled by default.
 1946|  36.6k|  sf->gm_sf.gm_search_type = GM_DISABLE_SEARCH;
 1947|  36.6k|  sf->hl_sf.recode_loop = ALLOW_RECODE_KFARFGF;
 1948|  36.6k|  sf->inter_sf.reuse_inter_intra_mode = 1;
 1949|  36.6k|  sf->inter_sf.prune_compound_using_single_ref = 0;
 1950|  36.6k|  sf->inter_sf.prune_comp_search_by_single_result = 2;
 1951|  36.6k|  sf->inter_sf.prune_comp_type_by_comp_avg = 2;
 1952|  36.6k|  sf->inter_sf.fast_wedge_sign_estimate = 1;
 1953|  36.6k|  sf->inter_sf.use_dist_wtd_comp_flag = DIST_WTD_COMP_DISABLED;
 1954|  36.6k|  sf->inter_sf.mv_cost_upd_level = INTERNAL_COST_UPD_SBROW;
 1955|  36.6k|  sf->inter_sf.disable_interinter_wedge_var_thresh = 100;
 1956|  36.6k|  sf->interp_sf.cb_pred_filter_search = 0;
 1957|  36.6k|  sf->interp_sf.skip_interp_filter_search = 1;
 1958|  36.6k|  sf->part_sf.ml_prune_partition = 1;
 1959|  36.6k|  sf->part_sf.reuse_prev_rd_results_for_part_ab = 1;
 1960|  36.6k|  sf->part_sf.prune_ext_partition_types_search_level = 2;
 1961|  36.6k|  sf->part_sf.less_rectangular_check_level = 2;
 1962|  36.6k|  sf->mv_sf.obmc_full_pixel_search_level = 1;
 1963|  36.6k|  sf->intra_sf.dv_cost_upd_level = INTERNAL_COST_UPD_OFF;
 1964|  36.6k|  sf->tx_sf.model_based_prune_tx_search_level = 0;
 1965|  36.6k|  sf->lpf_sf.dual_sgr_penalty_level = 1;
 1966|       |  // Disable Wiener and Self-guided Loop restoration filters.
 1967|  36.6k|  sf->lpf_sf.disable_wiener_filter = true;
 1968|  36.6k|  sf->lpf_sf.disable_sgr_filter = true;
 1969|  36.6k|  sf->intra_sf.prune_palette_search_level = 2;
 1970|  36.6k|  sf->intra_sf.prune_luma_palette_size_search_level = 2;
 1971|  36.6k|  sf->intra_sf.early_term_chroma_palette_size_search = 1;
 1972|       |
 1973|       |  // End of set
 1974|       |
 1975|       |  // TODO(any, yunqing): tune these features for real-time use cases.
 1976|  36.6k|  sf->hl_sf.superres_auto_search_type = SUPERRES_AUTO_SOLO;
 1977|  36.6k|  sf->hl_sf.frame_parameter_update = 0;
 1978|       |
 1979|  36.6k|  sf->inter_sf.model_based_post_interp_filter_breakout = 1;
 1980|       |  // TODO(any): As per the experiments, this speed feature is doing redundant
 1981|       |  // computation since the model rd based pruning logic is similar to model rd
 1982|       |  // based gating when inter_mode_rd_model_estimation = 2. Enable this SF if
 1983|       |  // either of the condition becomes true.
 1984|       |  //    (1) inter_mode_rd_model_estimation != 2
 1985|       |  //    (2) skip_interp_filter_search == 0
 1986|       |  //    (3) Motion mode or compound mode is enabled */
 1987|  36.6k|  sf->inter_sf.prune_mode_search_simple_translation = 0;
 1988|  36.6k|  sf->inter_sf.prune_ref_frame_for_rect_partitions = !boosted;
 1989|  36.6k|  sf->inter_sf.disable_interintra_wedge_var_thresh = UINT_MAX;
 1990|  36.6k|  sf->inter_sf.selective_ref_frame = 4;
 1991|  36.6k|  sf->inter_sf.alt_ref_search_fp = 2;
 1992|  36.6k|  set_txfm_rd_gate_level(sf->inter_sf.txfm_rd_gate_level, boosted ? 0 : 4);
  ------------------
  |  Branch (1992:59): [True: 27.3k, False: 9.28k]
  ------------------
 1993|  36.6k|  sf->inter_sf.limit_txfm_eval_per_mode = 3;
 1994|       |
 1995|  36.6k|  sf->inter_sf.adaptive_rd_thresh = 4;
 1996|  36.6k|  sf->inter_sf.inter_mode_rd_model_estimation = 2;
 1997|  36.6k|  sf->inter_sf.prune_inter_modes_if_skippable = 1;
 1998|  36.6k|  sf->inter_sf.prune_nearmv_using_neighbors = PRUNE_NEARMV_LEVEL3;
 1999|  36.6k|  sf->inter_sf.reduce_inter_modes = boosted ? 1 : 3;
  ------------------
  |  Branch (1999:37): [True: 27.3k, False: 9.28k]
  ------------------
 2000|  36.6k|  sf->inter_sf.skip_newmv_in_drl = 4;
 2001|       |
 2002|  36.6k|  sf->interp_sf.use_fast_interpolation_filter_search = 1;
 2003|  36.6k|  sf->interp_sf.use_interp_filter = 1;
 2004|  36.6k|  sf->interp_sf.adaptive_interp_filter_search = 1;
 2005|  36.6k|  sf->interp_sf.disable_dual_filter = 1;
 2006|       |
 2007|  36.6k|  sf->part_sf.default_max_partition_size = BLOCK_128X128;
 2008|  36.6k|  sf->part_sf.default_min_partition_size = BLOCK_8X8;
 2009|  36.6k|  sf->part_sf.use_best_rd_for_pruning = 1;
 2010|  36.6k|  sf->part_sf.early_term_after_none_split = 1;
 2011|  36.6k|  sf->part_sf.partition_search_breakout_dist_thr = (1 << 25);
 2012|  36.6k|  sf->part_sf.max_intra_bsize = BLOCK_16X16;
 2013|  36.6k|  sf->part_sf.partition_search_breakout_rate_thr = 500;
 2014|  36.6k|  sf->part_sf.partition_search_type = VAR_BASED_PARTITION;
 2015|  36.6k|  sf->part_sf.adjust_var_based_rd_partitioning = 2;
 2016|       |
 2017|  36.6k|  sf->mv_sf.full_pixel_search_level = 1;
 2018|  36.6k|  sf->mv_sf.exhaustive_searches_thresh = INT_MAX;
 2019|  36.6k|  sf->mv_sf.auto_mv_step_size = 1;
 2020|  36.6k|  sf->mv_sf.subpel_iters_per_step = 1;
 2021|  36.6k|  sf->mv_sf.use_accurate_subpel_search = USE_2_TAPS;
 2022|  36.6k|  sf->mv_sf.search_method = FAST_DIAMOND;
 2023|  36.6k|  sf->mv_sf.subpel_force_stop = EIGHTH_PEL;
 2024|  36.6k|  sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED;
 2025|       |
 2026|   219k|  for (int i = 0; i < TX_SIZES; ++i) {
  ------------------
  |  Branch (2026:19): [True: 183k, False: 36.6k]
  ------------------
 2027|   183k|    sf->intra_sf.intra_y_mode_mask[i] = INTRA_DC;
 2028|   183k|    sf->intra_sf.intra_uv_mode_mask[i] = UV_INTRA_DC_CFL;
 2029|   183k|  }
 2030|  36.6k|  sf->intra_sf.skip_intra_in_interframe = 5;
 2031|  36.6k|  sf->intra_sf.disable_smooth_intra = 1;
 2032|  36.6k|  sf->intra_sf.skip_filter_intra_in_inter_frames = 1;
 2033|       |
 2034|  36.6k|  sf->tx_sf.intra_tx_size_search_init_depth_sqr = 1;
 2035|  36.6k|  sf->tx_sf.tx_type_search.use_reduced_intra_txset = 1;
 2036|  36.6k|  sf->tx_sf.adaptive_txb_search_level = 2;
 2037|  36.6k|  sf->tx_sf.intra_tx_size_search_init_depth_rect = 1;
 2038|  36.6k|  sf->tx_sf.tx_size_search_lgr_block = 1;
 2039|  36.6k|  sf->tx_sf.tx_type_search.ml_tx_split_thresh = 4000;
 2040|  36.6k|  sf->tx_sf.tx_type_search.skip_tx_search = 1;
 2041|  36.6k|  sf->tx_sf.inter_tx_size_search_init_depth_rect = 1;
 2042|  36.6k|  sf->tx_sf.inter_tx_size_search_init_depth_sqr = 1;
 2043|  36.6k|  sf->tx_sf.tx_type_search.prune_2d_txfm_mode = TX_TYPE_PRUNE_3;
 2044|  36.6k|  sf->tx_sf.refine_fast_tx_search_results = 0;
 2045|  36.6k|  sf->tx_sf.tx_type_search.fast_intra_tx_type_search = 2;
 2046|  36.6k|  sf->tx_sf.tx_type_search.use_skip_flag_prediction = 2;
 2047|  36.6k|  sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning = 4;
 2048|  36.6k|  sf->tx_sf.use_chroma_trellis_rd_mult = 1;
 2049|       |
 2050|  36.6k|  sf->rd_sf.optimize_coefficients = NO_TRELLIS_OPT;
 2051|  36.6k|  sf->rd_sf.simple_model_rd_from_var = 1;
 2052|  36.6k|  sf->rd_sf.tx_domain_dist_level = 2;
 2053|  36.6k|  sf->rd_sf.tx_domain_dist_thres_level = 2;
 2054|       |
 2055|  36.6k|  sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL4;
 2056|  36.6k|  sf->lpf_sf.lpf_pick = LPF_PICK_FROM_Q;
 2057|       |
 2058|  36.6k|  sf->winner_mode_sf.dc_blk_pred_level = frame_is_intra_only(cm) ? 0 : 3;
  ------------------
  |  Branch (2058:42): [True: 18.3k, False: 18.3k]
  ------------------
 2059|  36.6k|  sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch = 1;
 2060|  36.6k|  sf->winner_mode_sf.tx_size_search_level = 1;
 2061|  36.6k|  sf->winner_mode_sf.winner_mode_ifs = 1;
 2062|       |
 2063|  36.6k|  sf->rt_sf.check_intra_pred_nonrd = 1;
 2064|  36.6k|  sf->rt_sf.estimate_motion_for_var_based_partition = 2;
 2065|  36.6k|  sf->rt_sf.hybrid_intra_pickmode = 1;
 2066|  36.6k|  sf->rt_sf.use_comp_ref_nonrd = 0;
 2067|  36.6k|  sf->rt_sf.ref_frame_comp_nonrd[0] = 0;
 2068|  36.6k|  sf->rt_sf.ref_frame_comp_nonrd[1] = 0;
 2069|  36.6k|  sf->rt_sf.ref_frame_comp_nonrd[2] = 0;
 2070|  36.6k|  sf->rt_sf.use_nonrd_filter_search = 1;
 2071|  36.6k|  sf->rt_sf.mode_search_skip_flags |= FLAG_SKIP_INTRA_DIRMISMATCH;
 2072|  36.6k|  sf->rt_sf.num_inter_modes_for_tx_search = 5;
 2073|  36.6k|  sf->rt_sf.prune_inter_modes_using_temp_var = 1;
 2074|  36.6k|  sf->rt_sf.use_real_time_ref_set = is_one_pass_rt_lag_params(cpi) ? 0 : 1;
  ------------------
  |  Branch (2074:37): [True: 0, False: 36.6k]
  ------------------
 2075|  36.6k|  sf->rt_sf.use_simple_rd_model = 1;
 2076|  36.6k|  sf->rt_sf.prune_inter_modes_with_golden_ref = boosted ? 0 : 1;
  ------------------
  |  Branch (2076:49): [True: 27.3k, False: 9.28k]
  ------------------
 2077|       |  // TODO(any): This sf could be removed.
 2078|  36.6k|  sf->rt_sf.short_circuit_low_temp_var = 1;
 2079|  36.6k|  sf->rt_sf.check_scene_detection = 1;
 2080|  36.6k|  if (cpi->rc.rtc_external_ratectrl) sf->rt_sf.check_scene_detection = 0;
  ------------------
  |  Branch (2080:7): [True: 0, False: 36.6k]
  ------------------
 2081|  36.6k|  if (cm->current_frame.frame_type != KEY_FRAME &&
  ------------------
  |  Branch (2081:7): [True: 18.3k, False: 18.3k]
  ------------------
 2082|  18.3k|      cpi->oxcf.rc_cfg.mode == AOM_CBR)
  ------------------
  |  Branch (2082:7): [True: 18.3k, False: 0]
  ------------------
 2083|  18.3k|    sf->rt_sf.overshoot_detection_cbr = FAST_DETECTION_MAXQ;
 2084|       |  // Enable noise estimation only for high resolutions for now.
 2085|       |  //
 2086|       |  // Since use_temporal_noise_estimate has no effect for all-intra frame
 2087|       |  // encoding, it is disabled for this case.
 2088|  36.6k|  if (cpi->oxcf.kf_cfg.key_freq_max != 0 && cm->width * cm->height > 640 * 480)
  ------------------
  |  Branch (2088:7): [True: 36.6k, False: 0]
  |  Branch (2088:45): [True: 0, False: 36.6k]
  ------------------
 2089|      0|    sf->rt_sf.use_temporal_noise_estimate = 1;
 2090|  36.6k|  sf->rt_sf.skip_tx_no_split_var_based_partition = 1;
 2091|  36.6k|  sf->rt_sf.skip_newmv_mode_based_on_sse = 1;
 2092|  36.6k|  sf->rt_sf.mode_search_skip_flags =
 2093|  36.6k|      (cm->current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (2093:7): [True: 18.3k, False: 18.3k]
  ------------------
 2094|  36.6k|          ? 0
 2095|  36.6k|          : FLAG_SKIP_INTRA_DIRMISMATCH | FLAG_SKIP_INTRA_BESTINTER |
 2096|  18.3k|                FLAG_SKIP_COMP_BESTINTRA | FLAG_SKIP_INTRA_LOWVAR |
 2097|  18.3k|                FLAG_EARLY_TERMINATE;
 2098|  36.6k|  sf->rt_sf.var_part_split_threshold_shift = 5;
 2099|  36.6k|  if (!frame_is_intra_only(&cpi->common)) sf->rt_sf.var_part_based_on_qidx = 1;
  ------------------
  |  Branch (2099:7): [True: 18.3k, False: 18.3k]
  ------------------
 2100|  36.6k|  sf->rt_sf.use_fast_fixed_part = 0;
 2101|  36.6k|  sf->rt_sf.increase_source_sad_thresh = 0;
 2102|       |
 2103|  36.6k|  if (is_one_pass_rt_lag_params(cpi) && speed <= 6) {
  ------------------
  |  Branch (2103:7): [True: 0, False: 36.6k]
  |  Branch (2103:41): [True: 0, False: 0]
  ------------------
 2104|      0|    sf->hl_sf.frame_parameter_update = 1;
 2105|      0|    sf->inter_sf.use_dist_wtd_comp_flag = 0;
 2106|      0|    sf->inter_sf.disable_masked_comp = 1;
 2107|      0|    sf->inter_sf.disable_onesided_comp = 1;
 2108|      0|  }
 2109|       |
 2110|  36.6k|  if (speed >= 6) {
  ------------------
  |  Branch (2110:7): [True: 30.5k, False: 6.10k]
  ------------------
 2111|  30.5k|    sf->mv_sf.use_fullpel_costlist = 1;
 2112|       |
 2113|  30.5k|    sf->rd_sf.tx_domain_dist_thres_level = 3;
 2114|       |
 2115|  30.5k|    sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh = 0;
 2116|  30.5k|    sf->inter_sf.limit_inter_mode_cands = 4;
 2117|  30.5k|    sf->inter_sf.prune_warped_prob_thresh = 8;
 2118|  30.5k|    sf->inter_sf.extra_prune_warped = 1;
 2119|       |
 2120|  30.5k|    sf->rt_sf.gf_refresh_based_on_qp = 1;
 2121|  30.5k|    sf->rt_sf.prune_inter_modes_wrt_gf_arf_based_on_sad = 1;
 2122|  30.5k|    sf->rt_sf.var_part_split_threshold_shift = 7;
 2123|  30.5k|    if (!frame_is_intra_only(&cpi->common))
  ------------------
  |  Branch (2123:9): [True: 18.3k, False: 12.2k]
  ------------------
 2124|  18.3k|      sf->rt_sf.var_part_based_on_qidx = 2;
 2125|       |
 2126|  30.5k|    sf->winner_mode_sf.prune_winner_mode_eval_level = boosted ? 0 : 3;
  ------------------
  |  Branch (2126:55): [True: 21.2k, False: 9.28k]
  ------------------
 2127|  30.5k|  }
 2128|       |
 2129|  36.6k|  if (speed >= 7) {
  ------------------
  |  Branch (2129:7): [True: 30.5k, False: 6.10k]
  ------------------
 2130|  30.5k|    sf->rt_sf.sse_early_term_inter_search = EARLY_TERM_IDX_1;
 2131|  30.5k|    sf->rt_sf.use_comp_ref_nonrd = 1;
 2132|  30.5k|    sf->rt_sf.ref_frame_comp_nonrd[2] = 1;  // LAST_ALTREF
 2133|  30.5k|    sf->tx_sf.intra_tx_size_search_init_depth_sqr = 2;
 2134|  30.5k|    sf->part_sf.partition_search_type = VAR_BASED_PARTITION;
 2135|  30.5k|    sf->part_sf.max_intra_bsize = BLOCK_32X32;
 2136|       |
 2137|  30.5k|    sf->mv_sf.search_method = FAST_DIAMOND;
 2138|  30.5k|    sf->mv_sf.subpel_force_stop = QUARTER_PEL;
 2139|       |
 2140|  30.5k|    sf->inter_sf.inter_mode_rd_model_estimation = 2;
 2141|       |    // This sf is not applicable in non-rd path.
 2142|  30.5k|    sf->inter_sf.skip_newmv_in_drl = 0;
 2143|       |
 2144|  30.5k|    sf->interp_sf.skip_interp_filter_search = 0;
 2145|       |
 2146|       |    // Disable intra_y_mode_mask pruning since the performance at speed 7 isn't
 2147|       |    // good. May need more study.
 2148|   183k|    for (int i = 0; i < TX_SIZES; ++i) {
  ------------------
  |  Branch (2148:21): [True: 152k, False: 30.5k]
  ------------------
 2149|   152k|      sf->intra_sf.intra_y_mode_mask[i] = INTRA_ALL;
 2150|   152k|    }
 2151|       |
 2152|  30.5k|    sf->lpf_sf.lpf_pick = LPF_PICK_FROM_Q;
 2153|  30.5k|    sf->lpf_sf.cdef_pick_method = CDEF_FAST_SEARCH_LVL5;
 2154|       |
 2155|  30.5k|    sf->rt_sf.mode_search_skip_flags |= FLAG_SKIP_INTRA_DIRMISMATCH;
 2156|  30.5k|    sf->rt_sf.nonrd_prune_ref_frame_search = 1;
 2157|       |    // This is for rd path only.
 2158|  30.5k|    sf->rt_sf.prune_inter_modes_using_temp_var = 0;
 2159|  30.5k|    sf->rt_sf.prune_inter_modes_wrt_gf_arf_based_on_sad = 0;
 2160|  30.5k|    sf->rt_sf.prune_intra_mode_based_on_mv_range = 0;
 2161|  30.5k|#if !CONFIG_REALTIME_ONLY
 2162|  30.5k|    sf->rt_sf.reuse_inter_pred_nonrd =
 2163|  30.5k|        (cpi->oxcf.motion_mode_cfg.enable_warped_motion == 0);
 2164|       |#else
 2165|       |    sf->rt_sf.reuse_inter_pred_nonrd = 1;
 2166|       |#endif
 2167|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 2168|       |    sf->rt_sf.reuse_inter_pred_nonrd = (cpi->oxcf.noise_sensitivity == 0);
 2169|       |#endif
 2170|  30.5k|    sf->rt_sf.short_circuit_low_temp_var = 0;
 2171|       |    // For spatial layers, only LAST and GOLDEN are currently used in the SVC
 2172|       |    // for nonrd. The flag use_nonrd_altref_frame can disable GOLDEN in the
 2173|       |    // get_ref_frame_flags() for some patterns, so disable it here for
 2174|       |    // spatial layers.
 2175|  30.5k|    sf->rt_sf.use_nonrd_altref_frame =
 2176|  30.5k|        (cpi->svc.number_spatial_layers > 1) ? 0 : 1;
  ------------------
  |  Branch (2176:9): [True: 0, False: 30.5k]
  ------------------
 2177|  30.5k|    sf->rt_sf.use_nonrd_pick_mode = 1;
 2178|  30.5k|    sf->rt_sf.discount_color_cost = 1;
 2179|  30.5k|    sf->rt_sf.nonrd_check_partition_merge_mode = 3;
 2180|  30.5k|    sf->rt_sf.skip_intra_pred = 1;
 2181|  30.5k|    sf->rt_sf.source_metrics_sb_nonrd = 1;
 2182|       |    // Set mask for intra modes.
 2183|   518k|    for (int i = 0; i < BLOCK_SIZES; ++i)
  ------------------
  |  Branch (2183:21): [True: 488k, False: 30.5k]
  ------------------
 2184|   488k|      if (i >= BLOCK_32X32)
  ------------------
  |  Branch (2184:11): [True: 213k, False: 274k]
  ------------------
 2185|   213k|        sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC;
 2186|   274k|      else
 2187|       |        // Use DC, H, V intra mode for block sizes < 32X32.
 2188|   274k|        sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC_H_V;
 2189|       |
 2190|  30.5k|    sf->winner_mode_sf.dc_blk_pred_level = 0;
 2191|  30.5k|    sf->rt_sf.var_part_based_on_qidx = 3;
 2192|  30.5k|    sf->rt_sf.prune_compoundmode_with_singlecompound_var = true;
 2193|  30.5k|    sf->rt_sf.prune_compoundmode_with_singlemode_var = true;
 2194|  30.5k|    sf->rt_sf.skip_compound_based_on_var = true;
 2195|  30.5k|    sf->rt_sf.use_adaptive_subpel_search = true;
 2196|  30.5k|  }
 2197|       |
 2198|  36.6k|  if (speed >= 8) {
  ------------------
  |  Branch (2198:7): [True: 19.8k, False: 16.7k]
  ------------------
 2199|  19.8k|    sf->rt_sf.sse_early_term_inter_search = EARLY_TERM_IDX_2;
 2200|  19.8k|    sf->intra_sf.intra_pruning_with_hog = 1;
 2201|  19.8k|    sf->rt_sf.short_circuit_low_temp_var = 1;
 2202|  19.8k|    sf->rt_sf.use_nonrd_altref_frame = 0;
 2203|  19.8k|    sf->rt_sf.nonrd_prune_ref_frame_search = 2;
 2204|  19.8k|    sf->rt_sf.nonrd_check_partition_merge_mode = 0;
 2205|  19.8k|    sf->rt_sf.var_part_split_threshold_shift = 8;
 2206|  19.8k|    sf->rt_sf.var_part_based_on_qidx = 4;
 2207|  19.8k|    sf->rt_sf.partition_direct_merging = 1;
 2208|  19.8k|    sf->rt_sf.prune_compoundmode_with_singlemode_var = false;
 2209|  19.8k|    sf->mv_sf.use_bsize_dependent_search_method = 4;
 2210|  19.8k|    sf->rt_sf.prune_hv_pred_modes_using_src_sad = true;
 2211|  19.8k|  }
 2212|  36.6k|  if (speed >= 9) {
  ------------------
  |  Branch (2212:7): [True: 11.2k, False: 25.3k]
  ------------------
 2213|  11.2k|    sf->rt_sf.sse_early_term_inter_search = EARLY_TERM_IDX_3;
 2214|  11.2k|    sf->rt_sf.estimate_motion_for_var_based_partition = 3;
 2215|  11.2k|    sf->rt_sf.prefer_large_partition_blocks = 3;
 2216|  11.2k|    sf->rt_sf.skip_intra_pred = 2;
 2217|  11.2k|    sf->rt_sf.var_part_split_threshold_shift = 9;
 2218|   191k|    for (int i = 0; i < BLOCK_SIZES; ++i)
  ------------------
  |  Branch (2218:21): [True: 180k, False: 11.2k]
  ------------------
 2219|   180k|      sf->rt_sf.intra_y_mode_bsize_mask_nrd[i] = INTRA_DC;
 2220|  11.2k|    sf->rt_sf.var_part_based_on_qidx = 0;
 2221|  11.2k|    sf->rt_sf.frame_level_mode_cost_update = true;
 2222|  11.2k|    sf->rt_sf.check_only_zero_zeromv_on_large_blocks = true;
 2223|  11.2k|    sf->rt_sf.reduce_mv_pel_precision_highmotion = 0;
 2224|  11.2k|    sf->rt_sf.use_adaptive_subpel_search = true;
 2225|  11.2k|    sf->mv_sf.use_bsize_dependent_search_method = 0;
 2226|  11.2k|  }
 2227|  36.6k|  if (speed >= 10) {
  ------------------
  |  Branch (2227:7): [True: 0, False: 36.6k]
  ------------------
 2228|      0|    sf->rt_sf.sse_early_term_inter_search = EARLY_TERM_IDX_4;
 2229|      0|    sf->rt_sf.nonrd_prune_ref_frame_search = 3;
 2230|      0|    sf->rt_sf.var_part_split_threshold_shift = 10;
 2231|      0|    sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
 2232|      0|  }
 2233|  36.6k|  if (speed >= 11 && !frame_is_intra_only(cm) &&
  ------------------
  |  Branch (2233:7): [True: 0, False: 36.6k]
  |  Branch (2233:22): [True: 0, False: 0]
  ------------------
 2234|      0|      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (2234:7): [True: 0, False: 0]
  ------------------
 2235|      0|    sf->winner_mode_sf.dc_blk_pred_level = 3;
 2236|      0|  }
 2237|       |
 2238|  36.6k|  if (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (2238:7): [True: 22.3k, False: 14.2k]
  ------------------
 2239|  22.3k|      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2) {
  ------------------
  |  Branch (2239:7): [True: 0, False: 14.2k]
  ------------------
 2240|  22.3k|    sf->intra_sf.skip_intra_in_interframe = 0;
 2241|  22.3k|  }
 2242|  36.6k|}
speed_features.c:frame_is_boosted:
  154|   294k|static int frame_is_boosted(const AV1_COMP *cpi) {
  155|   294k|  return frame_is_kf_gf_arf(cpi);
  156|   294k|}

av1_superres_in_recode_allowed:
   98|  73.6k|int av1_superres_in_recode_allowed(const AV1_COMP *const cpi) {
   99|  73.6k|  const AV1EncoderConfig *const oxcf = &cpi->oxcf;
  100|       |  // Empirically found to not be beneficial for image coding.
  101|  73.6k|  return oxcf->superres_cfg.superres_mode == AOM_SUPERRES_AUTO &&
  ------------------
  |  Branch (101:10): [True: 0, False: 73.6k]
  ------------------
  102|      0|         cpi->sf.hl_sf.superres_auto_search_type != SUPERRES_AUTO_SOLO &&
  ------------------
  |  Branch (102:10): [True: 0, False: 0]
  ------------------
  103|      0|         cpi->rc.frames_to_key > 1;
  ------------------
  |  Branch (103:10): [True: 0, False: 0]
  ------------------
  104|  73.6k|}
av1_setup_frame_size:
  390|  73.6k|void av1_setup_frame_size(AV1_COMP *cpi) {
  391|  73.6k|  AV1_COMMON *cm = &cpi->common;
  392|       |  // Reset superres params from previous frame.
  393|  73.6k|  cm->superres_scale_denominator = SCALE_NUMERATOR;
  ------------------
  |  |   22|  73.6k|#define SCALE_NUMERATOR 8
  ------------------
  394|  73.6k|  const size_params_type rsz = calculate_next_size_params(cpi);
  395|  73.6k|  setup_frame_size_from_params(cpi, &rsz);
  396|       |
  397|       |  assert(av1_is_min_tile_width_satisfied(cm));
  398|  73.6k|}
superres_scale.c:calculate_next_size_params:
  342|  73.6k|static size_params_type calculate_next_size_params(AV1_COMP *cpi) {
  343|  73.6k|  const AV1EncoderConfig *oxcf = &cpi->oxcf;
  344|  73.6k|  ResizePendingParams *resize_pending_params = &cpi->resize_pending_params;
  345|  73.6k|  const FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
  346|  73.6k|  size_params_type rsz = { frm_dim_cfg->width, frm_dim_cfg->height,
  347|  73.6k|                           SCALE_NUMERATOR };
  ------------------
  |  |   22|  73.6k|#define SCALE_NUMERATOR 8
  ------------------
  348|  73.6k|  int resize_denom = SCALE_NUMERATOR;
  ------------------
  |  |   22|  73.6k|#define SCALE_NUMERATOR 8
  ------------------
  349|  73.6k|  if (has_no_stats_stage(cpi) && cpi->ppi->use_svc &&
  ------------------
  |  Branch (349:7): [True: 73.6k, False: 0]
  |  Branch (349:34): [True: 0, False: 73.6k]
  ------------------
  350|      0|      (cpi->common.width != cpi->oxcf.frm_dim_cfg.width ||
  ------------------
  |  Branch (350:8): [True: 0, False: 0]
  ------------------
  351|      0|       cpi->common.height != cpi->oxcf.frm_dim_cfg.height)) {
  ------------------
  |  Branch (351:8): [True: 0, False: 0]
  ------------------
  352|      0|    rsz.resize_width = cpi->common.width;
  353|      0|    rsz.resize_height = cpi->common.height;
  354|      0|    return rsz;
  355|      0|  }
  356|  73.6k|  if (is_stat_generation_stage(cpi)) return rsz;
  ------------------
  |  Branch (356:7): [True: 0, False: 73.6k]
  ------------------
  357|  73.6k|  if (resize_pending_params->width && resize_pending_params->height) {
  ------------------
  |  Branch (357:7): [True: 55.2k, False: 18.4k]
  |  Branch (357:39): [True: 55.2k, False: 0]
  ------------------
  358|  55.2k|    rsz.resize_width = resize_pending_params->width;
  359|  55.2k|    rsz.resize_height = resize_pending_params->height;
  360|  55.2k|    resize_pending_params->width = resize_pending_params->height = 0;
  361|  55.2k|    if (oxcf->superres_cfg.superres_mode == AOM_SUPERRES_NONE) return rsz;
  ------------------
  |  Branch (361:9): [True: 55.2k, False: 0]
  ------------------
  362|  55.2k|  } else {
  363|  18.4k|    resize_denom = calculate_next_resize_scale(cpi);
  364|  18.4k|    rsz.resize_width = frm_dim_cfg->width;
  365|  18.4k|    rsz.resize_height = frm_dim_cfg->height;
  366|  18.4k|    av1_calculate_scaled_size(&rsz.resize_width, &rsz.resize_height,
  367|  18.4k|                              resize_denom);
  368|  18.4k|  }
  369|  18.4k|  rsz.superres_denom = calculate_next_superres_scale(cpi);
  370|  18.4k|  if (!validate_size_scales(oxcf->resize_cfg.resize_mode, cpi->superres_mode,
  ------------------
  |  Branch (370:7): [True: 0, False: 18.4k]
  ------------------
  371|  18.4k|                            frm_dim_cfg->width, frm_dim_cfg->height, &rsz))
  372|       |    assert(0 && "Invalid scale parameters");
  373|  18.4k|  return rsz;
  374|  73.6k|}
superres_scale.c:calculate_next_resize_scale:
   76|  18.4k|static uint8_t calculate_next_resize_scale(const AV1_COMP *cpi) {
   77|       |  // Choose an arbitrary random number
   78|  18.4k|  static unsigned int seed = 56789;
   79|  18.4k|  const ResizeCfg *resize_cfg = &cpi->oxcf.resize_cfg;
   80|  18.4k|  if (is_stat_generation_stage(cpi)) return SCALE_NUMERATOR;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (80:7): [True: 0, False: 18.4k]
  ------------------
   81|  18.4k|  uint8_t new_denom = SCALE_NUMERATOR;
  ------------------
  |  |   22|  18.4k|#define SCALE_NUMERATOR 8
  ------------------
   82|       |
   83|  18.4k|  if (cpi->common.seq_params->reduced_still_picture_hdr) return SCALE_NUMERATOR;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (83:7): [True: 0, False: 18.4k]
  ------------------
   84|  18.4k|  switch (resize_cfg->resize_mode) {
   85|      0|    case RESIZE_NONE: new_denom = SCALE_NUMERATOR; break;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (85:5): [True: 0, False: 18.4k]
  ------------------
   86|  18.4k|    case RESIZE_FIXED:
  ------------------
  |  Branch (86:5): [True: 18.4k, False: 0]
  ------------------
   87|  18.4k|      if (cpi->common.current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (87:11): [True: 0, False: 18.4k]
  ------------------
   88|      0|        new_denom = resize_cfg->resize_kf_scale_denominator;
   89|  18.4k|      else
   90|  18.4k|        new_denom = resize_cfg->resize_scale_denominator;
   91|  18.4k|      break;
   92|      0|    case RESIZE_RANDOM: new_denom = lcg_rand16(&seed) % 9 + 8; break;
  ------------------
  |  Branch (92:5): [True: 0, False: 18.4k]
  ------------------
   93|      0|    default: assert(0);
  ------------------
  |  Branch (93:5): [True: 0, False: 18.4k]
  ------------------
   94|  18.4k|  }
   95|  18.4k|  return new_denom;
   96|  18.4k|}
superres_scale.c:calculate_next_superres_scale:
  184|  18.4k|static uint8_t calculate_next_superres_scale(AV1_COMP *cpi) {
  185|       |  // Choose an arbitrary random number
  186|  18.4k|  static unsigned int seed = 34567;
  187|  18.4k|  const AV1EncoderConfig *oxcf = &cpi->oxcf;
  188|  18.4k|  const SuperResCfg *const superres_cfg = &oxcf->superres_cfg;
  189|  18.4k|  const FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
  190|  18.4k|  const RateControlCfg *const rc_cfg = &oxcf->rc_cfg;
  191|       |
  192|  18.4k|  if (is_stat_generation_stage(cpi)) return SCALE_NUMERATOR;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (192:7): [True: 0, False: 18.4k]
  ------------------
  193|  18.4k|  uint8_t new_denom = SCALE_NUMERATOR;
  ------------------
  |  |   22|  18.4k|#define SCALE_NUMERATOR 8
  ------------------
  194|       |
  195|       |  // Make sure that superres mode of the frame is consistent with the
  196|       |  // sequence-level flag.
  197|  18.4k|  assert(IMPLIES(superres_cfg->superres_mode != AOM_SUPERRES_NONE,
  198|  18.4k|                 cpi->common.seq_params->enable_superres));
  199|  18.4k|  assert(IMPLIES(!cpi->common.seq_params->enable_superres,
  200|  18.4k|                 superres_cfg->superres_mode == AOM_SUPERRES_NONE));
  201|       |  // Make sure that superres mode for current encoding is consistent with user
  202|       |  // provided superres mode.
  203|  18.4k|  assert(IMPLIES(superres_cfg->superres_mode != AOM_SUPERRES_AUTO,
  204|  18.4k|                 cpi->superres_mode == superres_cfg->superres_mode));
  205|       |
  206|       |  // Note: we must look at the current superres_mode to be tried in 'cpi' here,
  207|       |  // not the user given mode in 'oxcf'.
  208|  18.4k|  switch (cpi->superres_mode) {
  209|  18.4k|    case AOM_SUPERRES_NONE: new_denom = SCALE_NUMERATOR; break;
  ------------------
  |  |   22|  18.4k|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (209:5): [True: 18.4k, False: 0]
  ------------------
  210|      0|    case AOM_SUPERRES_FIXED:
  ------------------
  |  Branch (210:5): [True: 0, False: 18.4k]
  ------------------
  211|      0|      if (cpi->common.current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (211:11): [True: 0, False: 0]
  ------------------
  212|      0|        new_denom = superres_cfg->superres_kf_scale_denominator;
  213|      0|      else
  214|      0|        new_denom = superres_cfg->superres_scale_denominator;
  215|      0|      break;
  216|      0|    case AOM_SUPERRES_RANDOM: new_denom = lcg_rand16(&seed) % 9 + 8; break;
  ------------------
  |  Branch (216:5): [True: 0, False: 18.4k]
  ------------------
  217|      0|    case AOM_SUPERRES_QTHRESH: {
  ------------------
  |  Branch (217:5): [True: 0, False: 18.4k]
  ------------------
  218|       |      // Do not use superres when screen content tools are used.
  219|      0|      if (cpi->common.features.allow_screen_content_tools) break;
  ------------------
  |  Branch (219:11): [True: 0, False: 0]
  ------------------
  220|      0|      if (rc_cfg->mode == AOM_VBR || rc_cfg->mode == AOM_CQ)
  ------------------
  |  Branch (220:11): [True: 0, False: 0]
  |  Branch (220:38): [True: 0, False: 0]
  ------------------
  221|      0|        av1_set_target_rate(cpi, frm_dim_cfg->width, frm_dim_cfg->height);
  222|       |
  223|       |      // Now decide the use of superres based on 'q'.
  224|      0|      int bottom_index, top_index;
  225|      0|      const int q = av1_rc_pick_q_and_bounds(
  226|      0|          cpi, frm_dim_cfg->width, frm_dim_cfg->height, cpi->gf_frame_index,
  227|      0|          &bottom_index, &top_index);
  228|       |
  229|      0|      const int qthresh = (frame_is_intra_only(&cpi->common))
  ------------------
  |  Branch (229:27): [True: 0, False: 0]
  ------------------
  230|      0|                              ? superres_cfg->superres_kf_qthresh
  231|      0|                              : superres_cfg->superres_qthresh;
  232|      0|      if (q <= qthresh) {
  ------------------
  |  Branch (232:11): [True: 0, False: 0]
  ------------------
  233|      0|        new_denom = SCALE_NUMERATOR;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  234|      0|      } else {
  235|      0|        new_denom = get_superres_denom_for_qindex(cpi, q, 1, 1);
  236|      0|      }
  237|      0|      break;
  238|      0|    }
  239|      0|    case AOM_SUPERRES_AUTO: {
  ------------------
  |  Branch (239:5): [True: 0, False: 18.4k]
  ------------------
  240|      0|      if (cpi->common.features.allow_screen_content_tools) break;
  ------------------
  |  Branch (240:11): [True: 0, False: 0]
  ------------------
  241|      0|      if (rc_cfg->mode == AOM_VBR || rc_cfg->mode == AOM_CQ)
  ------------------
  |  Branch (241:11): [True: 0, False: 0]
  |  Branch (241:38): [True: 0, False: 0]
  ------------------
  242|      0|        av1_set_target_rate(cpi, frm_dim_cfg->width, frm_dim_cfg->height);
  243|       |
  244|       |      // Now decide the use of superres based on 'q'.
  245|      0|      int bottom_index, top_index;
  246|      0|      const int q = av1_rc_pick_q_and_bounds(
  247|      0|          cpi, frm_dim_cfg->width, frm_dim_cfg->height, cpi->gf_frame_index,
  248|      0|          &bottom_index, &top_index);
  249|       |
  250|      0|      const SUPERRES_AUTO_SEARCH_TYPE sr_search_type =
  251|      0|          cpi->sf.hl_sf.superres_auto_search_type;
  252|      0|      const int qthresh = (sr_search_type == SUPERRES_AUTO_SOLO) ? 128 : 0;
  ------------------
  |  Branch (252:27): [True: 0, False: 0]
  ------------------
  253|      0|      if (q <= qthresh) {
  ------------------
  |  Branch (253:11): [True: 0, False: 0]
  ------------------
  254|      0|        new_denom = SCALE_NUMERATOR;  // Don't use superres.
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  255|      0|      } else {
  256|      0|        if (sr_search_type == SUPERRES_AUTO_ALL) {
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|          if (cpi->common.current_frame.frame_type == KEY_FRAME)
  ------------------
  |  Branch (257:15): [True: 0, False: 0]
  ------------------
  258|      0|            new_denom = superres_cfg->superres_kf_scale_denominator;
  259|      0|          else
  260|      0|            new_denom = superres_cfg->superres_scale_denominator;
  261|      0|        } else {
  262|      0|          new_denom = get_superres_denom_for_qindex(cpi, q, 1, 1);
  263|      0|        }
  264|      0|      }
  265|      0|      break;
  266|      0|    }
  267|      0|    default: assert(0);
  ------------------
  |  Branch (267:5): [True: 0, False: 18.4k]
  ------------------
  268|  18.4k|  }
  269|  18.4k|  return new_denom;
  270|  18.4k|}
superres_scale.c:validate_size_scales:
  284|  18.4k|                                int oheight, size_params_type *rsz) {
  285|  18.4k|  if (dimensions_are_ok(owidth, oheight, rsz)) {  // Nothing to do.
  ------------------
  |  Branch (285:7): [True: 18.4k, False: 0]
  ------------------
  286|  18.4k|    return 1;
  287|  18.4k|  }
  288|       |
  289|       |  // Calculate current resize scale.
  290|      0|  int resize_denom =
  291|      0|      AOMMAX(DIVIDE_AND_ROUND(owidth * SCALE_NUMERATOR, rsz->resize_width),
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  292|      0|             DIVIDE_AND_ROUND(oheight * SCALE_NUMERATOR, rsz->resize_height));
  293|       |
  294|      0|  if (resize_mode != RESIZE_RANDOM && superres_mode == AOM_SUPERRES_RANDOM) {
  ------------------
  |  Branch (294:7): [True: 0, False: 0]
  |  Branch (294:39): [True: 0, False: 0]
  ------------------
  295|       |    // Alter superres scale as needed to enforce conformity.
  296|      0|    rsz->superres_denom =
  297|      0|        (2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / resize_denom;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
                      (2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / resize_denom;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  298|      0|    if (!dimensions_are_ok(owidth, oheight, rsz)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|      0|      if (rsz->superres_denom > SCALE_NUMERATOR) --rsz->superres_denom;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (299:11): [True: 0, False: 0]
  ------------------
  300|      0|    }
  301|      0|  } else if (resize_mode == RESIZE_RANDOM &&
  ------------------
  |  Branch (301:14): [True: 0, False: 0]
  ------------------
  302|      0|             superres_mode != AOM_SUPERRES_RANDOM) {
  ------------------
  |  Branch (302:14): [True: 0, False: 0]
  ------------------
  303|       |    // Alter resize scale as needed to enforce conformity.
  304|      0|    resize_denom =
  305|      0|        (2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / rsz->superres_denom;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
                      (2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / rsz->superres_denom;
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  306|      0|    rsz->resize_width = owidth;
  307|      0|    rsz->resize_height = oheight;
  308|      0|    av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
  309|      0|                              resize_denom);
  310|      0|    if (!dimensions_are_ok(owidth, oheight, rsz)) {
  ------------------
  |  Branch (310:9): [True: 0, False: 0]
  ------------------
  311|      0|      if (resize_denom > SCALE_NUMERATOR) {
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (311:11): [True: 0, False: 0]
  ------------------
  312|      0|        --resize_denom;
  313|      0|        rsz->resize_width = owidth;
  314|      0|        rsz->resize_height = oheight;
  315|      0|        av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
  316|      0|                                  resize_denom);
  317|      0|      }
  318|      0|    }
  319|      0|  } else if (resize_mode == RESIZE_RANDOM &&
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|             superres_mode == AOM_SUPERRES_RANDOM) {
  ------------------
  |  Branch (320:14): [True: 0, False: 0]
  ------------------
  321|       |    // Alter both resize and superres scales as needed to enforce conformity.
  322|      0|    do {
  323|      0|      if (resize_denom > rsz->superres_denom)
  ------------------
  |  Branch (323:11): [True: 0, False: 0]
  ------------------
  324|      0|        --resize_denom;
  325|      0|      else
  326|      0|        --rsz->superres_denom;
  327|      0|      rsz->resize_width = owidth;
  328|      0|      rsz->resize_height = oheight;
  329|      0|      av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
  330|      0|                                resize_denom);
  331|      0|    } while (!dimensions_are_ok(owidth, oheight, rsz) &&
  ------------------
  |  Branch (331:14): [True: 0, False: 0]
  ------------------
  332|      0|             (resize_denom > SCALE_NUMERATOR ||
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (332:15): [True: 0, False: 0]
  ------------------
  333|      0|              rsz->superres_denom > SCALE_NUMERATOR));
  ------------------
  |  |   22|      0|#define SCALE_NUMERATOR 8
  ------------------
  |  Branch (333:15): [True: 0, False: 0]
  ------------------
  334|      0|  } else {  // We are allowed to alter neither resize scale nor superres
  335|       |            // scale.
  336|      0|    return 0;
  337|      0|  }
  338|      0|  return dimensions_are_ok(owidth, oheight, rsz);
  339|      0|}
superres_scale.c:dimensions_are_ok:
  276|  18.4k|static int dimensions_are_ok(int owidth, int oheight, size_params_type *rsz) {
  277|       |  // Only need to check the width, as scaling is horizontal only.
  278|  18.4k|  (void)oheight;
  279|  18.4k|  return dimension_is_ok(owidth, rsz->resize_width, rsz->superres_denom);
  280|  18.4k|}
superres_scale.c:dimension_is_ok:
  272|  18.4k|static int dimension_is_ok(int orig_dim, int resized_dim, int denom) {
  273|  18.4k|  return (resized_dim * SCALE_NUMERATOR >= orig_dim * denom / 2);
  ------------------
  |  |   22|  18.4k|#define SCALE_NUMERATOR 8
  ------------------
  274|  18.4k|}
superres_scale.c:setup_frame_size_from_params:
  377|  73.6k|                                         const size_params_type *rsz) {
  378|  73.6k|  int encode_width = rsz->resize_width;
  379|  73.6k|  int encode_height = rsz->resize_height;
  380|       |
  381|  73.6k|  AV1_COMMON *cm = &cpi->common;
  382|  73.6k|  cm->superres_upscaled_width = encode_width;
  383|  73.6k|  cm->superres_upscaled_height = encode_height;
  384|  73.6k|  cm->superres_scale_denominator = rsz->superres_denom;
  385|  73.6k|  av1_calculate_scaled_superres_size(&encode_width, &encode_height,
  386|  73.6k|                                     rsz->superres_denom);
  387|  73.6k|  av1_set_frame_size(cpi, encode_width, encode_height);
  388|  73.6k|}

av1_is_temporal_filter_on:
 1653|  67.6k|int av1_is_temporal_filter_on(const AV1EncoderConfig *oxcf) {
 1654|  67.6k|  return oxcf->algo_cfg.arnr_max_frames > 0 && oxcf->gf_cfg.lag_in_frames > 1;
  ------------------
  |  Branch (1654:10): [True: 67.6k, False: 0]
  |  Branch (1654:48): [True: 0, False: 67.6k]
  ------------------
 1655|  67.6k|}
av1_tf_info_alloc:
 1657|  18.4k|bool av1_tf_info_alloc(TEMPORAL_FILTER_INFO *tf_info, const AV1_COMP *cpi) {
 1658|  18.4k|  const AV1EncoderConfig *oxcf = &cpi->oxcf;
 1659|  18.4k|  tf_info->is_temporal_filter_on = av1_is_temporal_filter_on(oxcf);
 1660|  18.4k|  if (tf_info->is_temporal_filter_on == 0) return true;
  ------------------
  |  Branch (1660:7): [True: 18.4k, False: 0]
  ------------------
 1661|       |
 1662|      0|  const AV1_COMMON *cm = &cpi->common;
 1663|      0|  const SequenceHeader *const seq_params = cm->seq_params;
 1664|      0|  for (int i = 0; i < TF_INFO_BUF_COUNT; ++i) {
  ------------------
  |  |  159|      0|#define TF_INFO_BUF_COUNT 2
  ------------------
  |  Branch (1664:19): [True: 0, False: 0]
  ------------------
 1665|      0|    if (aom_realloc_frame_buffer(
  ------------------
  |  Branch (1665:9): [True: 0, False: 0]
  ------------------
 1666|      0|            &tf_info->tf_buf[i], oxcf->frm_dim_cfg.width,
 1667|      0|            oxcf->frm_dim_cfg.height, seq_params->subsampling_x,
 1668|      0|            seq_params->subsampling_y, seq_params->use_highbitdepth,
 1669|      0|            cpi->oxcf.border_in_pixels, cm->features.byte_alignment, NULL, NULL,
 1670|      0|            NULL, cpi->alloc_pyramid, 0)) {
 1671|      0|      return false;
 1672|      0|    }
 1673|      0|  }
 1674|      0|  return true;
 1675|      0|}
av1_tf_info_free:
 1677|  18.4k|void av1_tf_info_free(TEMPORAL_FILTER_INFO *tf_info) {
 1678|  18.4k|  if (tf_info->is_temporal_filter_on == 0) return;
  ------------------
  |  Branch (1678:7): [True: 18.4k, False: 0]
  ------------------
 1679|      0|  for (int i = 0; i < TF_INFO_BUF_COUNT; ++i) {
  ------------------
  |  |  159|      0|#define TF_INFO_BUF_COUNT 2
  ------------------
  |  Branch (1679:19): [True: 0, False: 0]
  ------------------
 1680|      0|    aom_free_frame_buffer(&tf_info->tf_buf[i]);
 1681|      0|  }
 1682|      0|  aom_free_frame_buffer(&tf_info->tf_buf_second_arf);
 1683|      0|}
av1_tf_info_reset:
 1685|  12.3k|void av1_tf_info_reset(TEMPORAL_FILTER_INFO *tf_info) {
 1686|  12.3k|  av1_zero(tf_info->tf_buf_valid);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1687|  12.3k|  av1_zero(tf_info->tf_buf_gf_index);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1688|  12.3k|  av1_zero(tf_info->tf_buf_display_index_offset);
  ------------------
  |  |   43|  12.3k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1689|  12.3k|}
av1_tf_info_filtering:
 1692|  12.3k|                           const GF_GROUP *gf_group) {
 1693|  12.3k|  if (tf_info->is_temporal_filter_on == 0) return;
  ------------------
  |  Branch (1693:7): [True: 12.3k, False: 0]
  ------------------
 1694|      0|  const AV1_COMMON *const cm = &cpi->common;
 1695|      0|  for (int gf_index = 0; gf_index < gf_group->size; ++gf_index) {
  ------------------
  |  Branch (1695:26): [True: 0, False: 0]
  ------------------
 1696|      0|    int update_type = gf_group->update_type[gf_index];
 1697|      0|    if (update_type == KF_UPDATE || update_type == ARF_UPDATE) {
  ------------------
  |  Branch (1697:9): [True: 0, False: 0]
  |  Branch (1697:37): [True: 0, False: 0]
  ------------------
 1698|      0|      int buf_idx = gf_group->frame_type[gf_index] == INTER_FRAME;
 1699|      0|      int lookahead_idx = gf_group->arf_src_offset[gf_index] +
 1700|      0|                          gf_group->cur_frame_idx[gf_index];
 1701|       |      // This function is designed to be called multiple times after
 1702|       |      // av1_tf_info_reset(). It will only generate the filtered frame that does
 1703|       |      // not exist yet.
 1704|      0|      if (tf_info->tf_buf_valid[buf_idx] == 0 ||
  ------------------
  |  Branch (1704:11): [True: 0, False: 0]
  ------------------
 1705|      0|          tf_info->tf_buf_display_index_offset[buf_idx] != lookahead_idx) {
  ------------------
  |  Branch (1705:11): [True: 0, False: 0]
  ------------------
 1706|      0|        YV12_BUFFER_CONFIG *out_buf = &tf_info->tf_buf[buf_idx];
 1707|      0|        av1_temporal_filter(cpi, lookahead_idx, gf_index,
 1708|      0|                            &tf_info->frame_diff[buf_idx], out_buf);
 1709|      0|        aom_extend_frame_borders(out_buf, av1_num_planes(cm));
  ------------------
  |  |   31|      0|#define aom_extend_frame_borders aom_extend_frame_borders_c
  ------------------
 1710|      0|        tf_info->tf_buf_gf_index[buf_idx] = gf_index;
 1711|      0|        tf_info->tf_buf_display_index_offset[buf_idx] = lookahead_idx;
 1712|      0|        tf_info->tf_buf_valid[buf_idx] = 1;
 1713|      0|      }
 1714|      0|    }
 1715|      0|  }
 1716|      0|}

encoder.c:tf_dealloc_data:
  411|  35.3k|                                   int is_high_bitdepth) {
  412|  35.3k|  if (is_high_bitdepth)
  ------------------
  |  Branch (412:7): [True: 3.33k, False: 32.0k]
  ------------------
  413|  3.33k|    tf_data->pred = (uint8_t *)CONVERT_TO_SHORTPTR(tf_data->pred);
  ------------------
  |  |   79|  3.33k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  414|  35.3k|  aom_free(tf_data->tmp_mbmi);
  415|  35.3k|  tf_data->tmp_mbmi = NULL;
  416|  35.3k|  aom_free(tf_data->accum);
  417|  35.3k|  tf_data->accum = NULL;
  418|  35.3k|  aom_free(tf_data->count);
  419|  35.3k|  tf_data->count = NULL;
  420|  35.3k|  aom_free(tf_data->pred);
  421|       |  tf_data->pred = NULL;
  422|  35.3k|}

av1_cost_color_map:
  258|   865k|                       TX_SIZE tx_size, COLOR_MAP_TYPE type) {
  259|   865k|  assert(plane == 0 || plane == 1);
  260|   865k|  Av1ColorMapParam color_map_params;
  261|   865k|  get_color_map_params(x, plane, bsize, tx_size, type, &color_map_params);
  262|   865k|  return cost_and_tokenize_map(&color_map_params, NULL, plane, 1, 0, NULL);
  263|   865k|}
av1_tokenize_color_map:
  268|  67.1k|                            FRAME_COUNTS *counts) {
  269|  67.1k|  assert(plane == 0 || plane == 1);
  270|  67.1k|  Av1ColorMapParam color_map_params;
  271|  67.1k|  get_color_map_params(x, plane, bsize, tx_size, type, &color_map_params);
  272|       |  // The first color index does not use context or entropy.
  273|  67.1k|  (*t)->token = color_map_params.color_map[0];
  274|  67.1k|  (*t)->color_ctx = -1;
  275|  67.1k|  ++(*t);
  276|  67.1k|  cost_and_tokenize_map(&color_map_params, t, plane, 0, allow_update_cdf,
  277|  67.1k|                        counts);
  278|  67.1k|}
av1_tokenize_sb_vartx:
  338|  1.13M|                           uint8_t allow_update_cdf) {
  339|  1.13M|  assert(bsize < BLOCK_SIZES_ALL);
  340|  1.13M|  const AV1_COMMON *const cm = &cpi->common;
  341|  1.13M|  MACROBLOCK *const x = &td->mb;
  342|  1.13M|  MACROBLOCKD *const xd = &x->e_mbd;
  343|  1.13M|  const int mi_row = xd->mi_row;
  344|  1.13M|  const int mi_col = xd->mi_col;
  345|  1.13M|  if (mi_row >= cm->mi_params.mi_rows || mi_col >= cm->mi_params.mi_cols)
  ------------------
  |  Branch (345:7): [True: 18.4E, False: 1.13M]
  |  Branch (345:42): [True: 179, False: 1.13M]
  ------------------
  346|      0|    return;
  347|       |
  348|  1.13M|  const int num_planes = av1_num_planes(cm);
  349|  1.13M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  350|  1.13M|  struct tokenize_b_args arg = { cpi, td, 0, allow_update_cdf, dry_run };
  351|       |
  352|  1.13M|  if (mbmi->skip_txfm) {
  ------------------
  |  Branch (352:7): [True: 197k, False: 940k]
  ------------------
  353|   197k|    av1_reset_entropy_context(xd, bsize, num_planes);
  354|   197k|    return;
  355|   197k|  }
  356|       |
  357|  2.36M|  for (int plane = 0; plane < num_planes; ++plane) {
  ------------------
  |  Branch (357:23): [True: 1.43M, False: 929k]
  ------------------
  358|  1.43M|    if (plane && !xd->is_chroma_ref) break;
  ------------------
  |  Branch (358:9): [True: 497k, False: 940k]
  |  Branch (358:18): [True: 10.5k, False: 487k]
  ------------------
  359|  1.42M|    const struct macroblockd_plane *const pd = &xd->plane[plane];
  360|  1.42M|    const int ss_x = pd->subsampling_x;
  361|  1.42M|    const int ss_y = pd->subsampling_y;
  362|  1.42M|    const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y);
  363|  1.42M|    assert(plane_bsize < BLOCK_SIZES_ALL);
  364|  1.42M|    const int mi_width = mi_size_wide[plane_bsize];
  365|  1.42M|    const int mi_height = mi_size_high[plane_bsize];
  366|  1.42M|    const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, plane_bsize, plane);
  367|  1.42M|    const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size];
  368|  1.42M|    const int bw = mi_size_wide[txb_size];
  369|  1.42M|    const int bh = mi_size_high[txb_size];
  370|  1.42M|    int block = 0;
  371|  1.42M|    const int step =
  372|  1.42M|        tx_size_wide_unit[max_tx_size] * tx_size_high_unit[max_tx_size];
  373|       |
  374|  1.42M|    const BLOCK_SIZE max_unit_bsize =
  375|  1.42M|        get_plane_block_size(BLOCK_64X64, ss_x, ss_y);
  376|  1.42M|    int mu_blocks_wide = mi_size_wide[max_unit_bsize];
  377|  1.42M|    int mu_blocks_high = mi_size_high[max_unit_bsize];
  378|       |
  379|  1.42M|    mu_blocks_wide = AOMMIN(mi_width, mu_blocks_wide);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.42M, False: 1.69k]
  |  |  ------------------
  ------------------
  380|  1.42M|    mu_blocks_high = AOMMIN(mi_height, mu_blocks_high);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.42M, False: 1.64k]
  |  |  ------------------
  ------------------
  381|       |
  382|  2.85M|    for (int idy = 0; idy < mi_height; idy += mu_blocks_high) {
  ------------------
  |  Branch (382:23): [True: 1.42M, False: 1.42M]
  ------------------
  383|  2.85M|      for (int idx = 0; idx < mi_width; idx += mu_blocks_wide) {
  ------------------
  |  Branch (383:25): [True: 1.42M, False: 1.42M]
  ------------------
  384|  1.42M|        const int unit_height = AOMMIN(mu_blocks_high + idy, mi_height);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.42M]
  |  |  ------------------
  ------------------
  385|  1.42M|        const int unit_width = AOMMIN(mu_blocks_wide + idx, mi_width);
  ------------------
  |  |   34|  1.42M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1.42M]
  |  |  ------------------
  ------------------
  386|  2.97M|        for (int blk_row = idy; blk_row < unit_height; blk_row += bh) {
  ------------------
  |  Branch (386:33): [True: 1.55M, False: 1.42M]
  ------------------
  387|  3.32M|          for (int blk_col = idx; blk_col < unit_width; blk_col += bw) {
  ------------------
  |  Branch (387:35): [True: 1.77M, False: 1.55M]
  ------------------
  388|  1.77M|            tokenize_vartx(td, max_tx_size, plane_bsize, blk_row, blk_col,
  389|  1.77M|                           block, plane, &arg);
  390|  1.77M|            block += step;
  391|  1.77M|          }
  392|  1.55M|        }
  393|  1.42M|      }
  394|  1.42M|    }
  395|  1.42M|  }
  396|   940k|  if (rate) *rate += arg.this_rate;
  ------------------
  |  Branch (396:7): [True: 0, False: 940k]
  ------------------
  397|   940k|}
tokenize.c:get_color_map_params:
  248|   932k|                                 Av1ColorMapParam *params) {
  249|   932k|  (void)tx_size;
  250|   932k|  memset(params, 0, sizeof(*params));
  251|   932k|  switch (type) {
  252|   932k|    case PALETTE_MAP: get_palette_params(x, plane, bsize, params); break;
  ------------------
  |  Branch (252:5): [True: 932k, False: 18.4E]
  ------------------
  253|      0|    default: assert(0 && "Invalid color map type"); return;
  ------------------
  |  Branch (253:5): [True: 0, False: 932k]
  ------------------
  254|   932k|  }
  255|   932k|}
tokenize.c:get_palette_params:
  230|   932k|                               BLOCK_SIZE bsize, Av1ColorMapParam *params) {
  231|   932k|  const MACROBLOCKD *const xd = &x->e_mbd;
  232|   932k|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  233|   932k|  const PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
  234|   932k|  params->color_map = xd->plane[plane].color_index_map;
  235|   932k|  params->map_cdf = plane ? xd->tile_ctx->palette_uv_color_index_cdf
  ------------------
  |  Branch (235:21): [True: 393k, False: 539k]
  ------------------
  236|   932k|                          : xd->tile_ctx->palette_y_color_index_cdf;
  237|   932k|  params->color_cost = plane ? x->mode_costs.palette_uv_color_cost
  ------------------
  |  Branch (237:24): [True: 393k, False: 539k]
  ------------------
  238|   932k|                             : x->mode_costs.palette_y_color_cost;
  239|   932k|  params->n_colors = pmi->palette_size[plane];
  240|       |  av1_get_block_dimensions(bsize, plane, xd, &params->plane_width, NULL,
  241|   932k|                           &params->rows, &params->cols);
  242|   932k|}
tokenize.c:cost_and_tokenize_map:
  184|   933k|                                 FRAME_COUNTS *counts) {
  185|   933k|  const uint8_t *const color_map = param->color_map;
  186|   933k|  MapCdf map_cdf = param->map_cdf;
  187|   933k|  ColorCost color_cost = param->color_cost;
  188|   933k|  const int plane_block_width = param->plane_width;
  189|   933k|  const int rows = param->rows;
  190|   933k|  const int cols = param->cols;
  191|   933k|  const int n = param->n_colors;
  192|   933k|  const int palette_size_idx = n - PALETTE_MIN_SIZE;
  ------------------
  |  |   65|   933k|#define PALETTE_MIN_SIZE 2
  ------------------
  193|   933k|  int this_rate = 0;
  194|       |
  195|   933k|  (void)plane;
  196|   933k|  (void)counts;
  197|       |
  198|  12.9M|  for (int k = 1; k < rows + cols - 1; ++k) {
  ------------------
  |  Branch (198:19): [True: 12.0M, False: 933k]
  ------------------
  199|  64.3M|    for (int j = AOMMIN(k, cols - 1); j >= AOMMAX(0, k - rows + 1); --j) {
  ------------------
  |  |   34|  12.0M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.86M, False: 7.18M]
  |  |  ------------------
  ------------------
                  for (int j = AOMMIN(k, cols - 1); j >= AOMMAX(0, k - rows + 1); --j) {
  ------------------
  |  |   35|  64.3M|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 28.7M, False: 35.6M]
  |  |  ------------------
  ------------------
  |  Branch (199:39): [True: 52.3M, False: 12.0M]
  ------------------
  200|  52.3M|      int i = k - j;
  201|  52.3M|      int color_new_idx;
  202|  52.3M|      const int color_ctx = av1_fast_palette_color_index_context(
  203|  52.3M|          color_map, plane_block_width, i, j, &color_new_idx);
  204|  52.3M|      assert(color_new_idx >= 0 && color_new_idx < n);
  205|  52.3M|      if (calc_rate) {
  ------------------
  |  Branch (205:11): [True: 48.7M, False: 3.63M]
  ------------------
  206|  48.7M|        this_rate += color_cost[palette_size_idx][color_ctx][color_new_idx];
  207|  48.7M|      } else {
  208|  3.63M|        (*t)->token = color_new_idx;
  209|  3.63M|        (*t)->color_ctx = color_ctx;
  210|  3.63M|        ++(*t);
  211|  3.63M|        if (allow_update_cdf)
  ------------------
  |  Branch (211:13): [True: 3.65M, False: 18.4E]
  ------------------
  212|  3.65M|          update_cdf(map_cdf[palette_size_idx][color_ctx], color_new_idx, n);
  213|       |#if CONFIG_ENTROPY_STATS
  214|       |        if (plane) {
  215|       |          ++counts->palette_uv_color_index[palette_size_idx][color_ctx]
  216|       |                                          [color_new_idx];
  217|       |        } else {
  218|       |          ++counts->palette_y_color_index[palette_size_idx][color_ctx]
  219|       |                                         [color_new_idx];
  220|       |        }
  221|       |#endif
  222|  3.63M|      }
  223|  52.3M|    }
  224|  12.0M|  }
  225|   933k|  if (calc_rate) return this_rate;
  ------------------
  |  Branch (225:7): [True: 865k, False: 67.0k]
  ------------------
  226|  67.0k|  return 0;
  227|   933k|}
tokenize.c:av1_fast_palette_color_index_context:
   80|  52.3M|                                                       int *color_idx) {
   81|  52.3M|  assert(r > 0 || c > 0);
   82|       |
   83|  52.3M|  const bool has_above = (r - 1 >= 0);
   84|  52.3M|  const bool has_left = (c - 1 >= 0);
   85|  52.3M|  assert(has_above || has_left);
   86|  52.3M|  if (has_above ^ has_left) {
  ------------------
  |  Branch (86:7): [True: 12.0M, False: 40.2M]
  ------------------
   87|  12.0M|    return av1_fast_palette_color_index_context_on_edge(color_map, stride, r, c,
   88|  12.0M|                                                        color_idx);
   89|  12.0M|  }
   90|       |
   91|       |  // This goes in the order of left, top, and top-left. This has the advantage
   92|       |  // that unless anything here are not distinct or invalid, this will already
   93|       |  // be in sorted order. Furthermore, if either of the first two is
   94|       |  // invalid, we know the last one is also invalid.
   95|  40.2M|  uint8_t color_neighbors[NUM_PALETTE_NEIGHBORS];
   96|  40.2M|  color_neighbors[0] = color_map[(r - 0) * stride + (c - 1)];
   97|  40.2M|  color_neighbors[1] = color_map[(r - 1) * stride + (c - 0)];
   98|  40.2M|  color_neighbors[2] = color_map[(r - 1) * stride + (c - 1)];
   99|       |
  100|       |  // Aggregate duplicated values.
  101|       |  // Since our array is so small, using a couple if statements is faster
  102|  40.2M|  uint8_t scores[NUM_PALETTE_NEIGHBORS] = { 2, 2, 1 };
  103|  40.2M|  uint8_t num_invalid_colors = 0;
  104|  40.2M|  if (color_neighbors[0] == color_neighbors[1]) {
  ------------------
  |  Branch (104:7): [True: 14.9M, False: 25.3M]
  ------------------
  105|  14.9M|    scores[0] += scores[1];
  106|  14.9M|    color_neighbors[1] = INVALID_COLOR_IDX;
  ------------------
  |  |   74|  14.9M|#define INVALID_COLOR_IDX (UINT8_MAX)
  ------------------
  107|  14.9M|    num_invalid_colors += 1;
  108|       |
  109|  14.9M|    if (color_neighbors[0] == color_neighbors[2]) {
  ------------------
  |  Branch (109:9): [True: 10.6M, False: 4.32M]
  ------------------
  110|  10.6M|      scores[0] += scores[2];
  111|  10.6M|      num_invalid_colors += 1;
  112|  10.6M|    }
  113|  25.3M|  } else if (color_neighbors[0] == color_neighbors[2]) {
  ------------------
  |  Branch (113:14): [True: 10.0M, False: 15.3M]
  ------------------
  114|  10.0M|    scores[0] += scores[2];
  115|  10.0M|    num_invalid_colors += 1;
  116|  15.3M|  } else if (color_neighbors[1] == color_neighbors[2]) {
  ------------------
  |  Branch (116:14): [True: 9.55M, False: 5.76M]
  ------------------
  117|  9.55M|    scores[1] += scores[2];
  118|  9.55M|    num_invalid_colors += 1;
  119|  9.55M|  }
  120|       |
  121|  40.2M|  const uint8_t num_valid_colors = NUM_PALETTE_NEIGHBORS - num_invalid_colors;
  ------------------
  |  |   60|  40.2M|#define NUM_PALETTE_NEIGHBORS 3  // left, top-left and top.
  ------------------
  122|       |
  123|  40.2M|  uint8_t *color_rank = color_neighbors;
  124|  40.2M|  uint8_t *score_rank = scores;
  125|       |
  126|       |  // Sort everything
  127|  40.2M|  if (num_valid_colors > 1) {
  ------------------
  |  Branch (127:7): [True: 29.7M, False: 10.5M]
  ------------------
  128|  29.7M|    if (color_neighbors[1] == INVALID_COLOR_IDX) {
  ------------------
  |  |   74|  29.7M|#define INVALID_COLOR_IDX (UINT8_MAX)
  ------------------
  |  Branch (128:9): [True: 4.33M, False: 25.3M]
  ------------------
  129|  4.33M|      scores[1] = scores[2];
  130|  4.33M|      color_neighbors[1] = color_neighbors[2];
  131|  4.33M|    }
  132|       |
  133|       |    // We need to swap the first two elements if they have the same score but
  134|       |    // the color indices are not in the right order
  135|  29.7M|    if (score_rank[0] < score_rank[1] ||
  ------------------
  |  Branch (135:9): [True: 9.55M, False: 20.1M]
  ------------------
  136|  20.1M|        (score_rank[0] == score_rank[1] && color_rank[0] > color_rank[1])) {
  ------------------
  |  Branch (136:10): [True: 5.82M, False: 14.3M]
  |  Branch (136:44): [True: 2.90M, False: 2.92M]
  ------------------
  137|  12.4M|      SWAP(0, 1);
  ------------------
  |  |   66|  12.4M|  do {                                       \
  |  |   67|  12.4M|    const uint8_t tmp_score = score_rank[i]; \
  |  |   68|  12.4M|    const uint8_t tmp_color = color_rank[i]; \
  |  |   69|  12.4M|    score_rank[i] = score_rank[j];           \
  |  |   70|  12.4M|    color_rank[i] = color_rank[j];           \
  |  |   71|  12.4M|    score_rank[j] = tmp_score;               \
  |  |   72|  12.4M|    color_rank[j] = tmp_color;               \
  |  |   73|  12.4M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (73:12): [Folded, False: 12.4M]
  |  |  ------------------
  ------------------
  138|  12.4M|    }
  139|  29.7M|    if (num_valid_colors > 2) {
  ------------------
  |  Branch (139:9): [True: 5.82M, False: 23.8M]
  ------------------
  140|  5.82M|      if (score_rank[0] < score_rank[2]) {
  ------------------
  |  Branch (140:11): [True: 0, False: 5.82M]
  ------------------
  141|      0|        SWAP(0, 2);
  ------------------
  |  |   66|      0|  do {                                       \
  |  |   67|      0|    const uint8_t tmp_score = score_rank[i]; \
  |  |   68|      0|    const uint8_t tmp_color = color_rank[i]; \
  |  |   69|      0|    score_rank[i] = score_rank[j];           \
  |  |   70|      0|    color_rank[i] = color_rank[j];           \
  |  |   71|      0|    score_rank[j] = tmp_score;               \
  |  |   72|      0|    color_rank[j] = tmp_color;               \
  |  |   73|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|      }
  143|  5.82M|      if (score_rank[1] < score_rank[2]) {
  ------------------
  |  Branch (143:11): [True: 0, False: 5.82M]
  ------------------
  144|      0|        SWAP(1, 2);
  ------------------
  |  |   66|      0|  do {                                       \
  |  |   67|      0|    const uint8_t tmp_score = score_rank[i]; \
  |  |   68|      0|    const uint8_t tmp_color = color_rank[i]; \
  |  |   69|      0|    score_rank[i] = score_rank[j];           \
  |  |   70|      0|    color_rank[i] = color_rank[j];           \
  |  |   71|      0|    score_rank[j] = tmp_score;               \
  |  |   72|      0|    color_rank[j] = tmp_color;               \
  |  |   73|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  145|      0|      }
  146|  5.82M|    }
  147|  29.7M|  }
  148|       |
  149|       |  // If any of the neighbor colors has higher index than current color index,
  150|       |  // then we move up by 1 unless the current color is the same as one of the
  151|       |  // neighbors.
  152|  40.2M|  const uint8_t current_color = *color_idx = color_map[r * stride + c];
  153|  74.1M|  for (int idx = 0; idx < num_valid_colors; idx++) {
  ------------------
  |  Branch (153:21): [True: 66.4M, False: 7.71M]
  ------------------
  154|  66.4M|    if (color_rank[idx] > current_color) {
  ------------------
  |  Branch (154:9): [True: 16.0M, False: 50.3M]
  ------------------
  155|  16.0M|      (*color_idx)++;
  156|  50.3M|    } else if (color_rank[idx] == current_color) {
  ------------------
  |  Branch (156:16): [True: 32.5M, False: 17.7M]
  ------------------
  157|  32.5M|      *color_idx = idx;
  158|  32.5M|      break;
  159|  32.5M|    }
  160|  66.4M|  }
  161|       |
  162|       |  // Get hash value of context.
  163|  40.2M|  uint8_t color_index_ctx_hash = 0;
  164|  40.2M|  static const uint8_t hash_multipliers[NUM_PALETTE_NEIGHBORS] = { 1, 2, 2 };
  165|   116M|  for (int idx = 0; idx < num_valid_colors; ++idx) {
  ------------------
  |  Branch (165:21): [True: 75.8M, False: 40.2M]
  ------------------
  166|  75.8M|    color_index_ctx_hash += score_rank[idx] * hash_multipliers[idx];
  167|  75.8M|  }
  168|  40.2M|  assert(color_index_ctx_hash > 0);
  169|  40.2M|  assert(color_index_ctx_hash <= MAX_COLOR_CONTEXT_HASH);
  170|       |
  171|       |  // Lookup context from hash.
  172|  40.2M|  const int color_index_ctx = 9 - color_index_ctx_hash;
  173|  40.2M|  assert(color_index_ctx ==
  174|  40.2M|         av1_palette_color_index_context_lookup[color_index_ctx_hash]);
  175|  40.2M|  assert(color_index_ctx >= 0);
  176|       |  assert(color_index_ctx < PALETTE_COLOR_INDEX_CONTEXTS);
  177|  40.2M|  return color_index_ctx;
  178|  52.3M|}
tokenize.c:av1_fast_palette_color_index_context_on_edge:
   31|  12.0M|    const uint8_t *color_map, int stride, int r, int c, int *color_idx) {
   32|  12.0M|  const bool has_left = (c - 1 >= 0);
   33|  12.0M|  const bool has_above = (r - 1 >= 0);
   34|  12.0M|  assert(r > 0 || c > 0);
   35|  12.0M|  assert(has_above ^ has_left);
   36|  12.0M|  assert(color_idx);
   37|  12.0M|  (void)has_left;
   38|       |
   39|  12.0M|  const uint8_t color_neighbor = has_above
  ------------------
  |  Branch (39:34): [True: 6.26M, False: 5.78M]
  ------------------
   40|  12.0M|                                     ? color_map[(r - 1) * stride + (c - 0)]
   41|  12.0M|                                     : color_map[(r - 0) * stride + (c - 1)];
   42|       |  // If the neighbor color has higher index than current color index, then we
   43|       |  // move up by 1.
   44|  12.0M|  const uint8_t current_color = *color_idx = color_map[r * stride + c];
   45|  12.0M|  if (color_neighbor > current_color) {
  ------------------
  |  Branch (45:7): [True: 3.04M, False: 9.01M]
  ------------------
   46|  3.04M|    (*color_idx)++;
   47|  9.01M|  } else if (color_neighbor == current_color) {
  ------------------
  |  Branch (47:14): [True: 5.97M, False: 3.04M]
  ------------------
   48|  5.97M|    *color_idx = 0;
   49|  5.97M|  }
   50|       |
   51|       |  // Get hash value of context.
   52|       |  // The non-diagonal neighbors get a weight of 2.
   53|  12.0M|  const uint8_t color_score = 2;
   54|  12.0M|  const uint8_t hash_multiplier = 1;
   55|  12.0M|  const uint8_t color_index_ctx_hash = color_score * hash_multiplier;
   56|       |
   57|       |  // Lookup context from hash.
   58|  12.0M|  const int color_index_ctx =
   59|  12.0M|      av1_palette_color_index_context_lookup[color_index_ctx_hash];
   60|       |  assert(color_index_ctx == 0);
   61|  12.0M|  (void)color_index_ctx;
   62|  12.0M|  return 0;
   63|  12.0M|}
tokenize.c:tokenize_vartx:
  282|  2.29M|                           int block, int plane, void *arg) {
  283|  2.29M|  MACROBLOCK *const x = &td->mb;
  284|  2.29M|  MACROBLOCKD *const xd = &x->e_mbd;
  285|  2.29M|  MB_MODE_INFO *const mbmi = xd->mi[0];
  286|  2.29M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
  287|  2.29M|  const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
  288|  2.29M|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
  289|       |
  290|  2.29M|  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
  ------------------
  |  Branch (290:7): [True: 3.35k, False: 2.28M]
  |  Branch (290:37): [True: 2.70k, False: 2.28M]
  ------------------
  291|       |
  292|  2.28M|  const TX_SIZE plane_tx_size =
  293|  2.28M|      plane ? av1_get_max_uv_txsize(mbmi->bsize, pd->subsampling_x,
  ------------------
  |  Branch (293:7): [True: 544k, False: 1.74M]
  ------------------
  294|   544k|                                    pd->subsampling_y)
  295|  2.28M|            : mbmi->inter_tx_size[av1_get_txb_size_index(plane_bsize, blk_row,
  296|  1.74M|                                                         blk_col)];
  297|       |
  298|  2.28M|  if (tx_size == plane_tx_size || plane) {
  ------------------
  |  Branch (298:7): [True: 2.05M, False: 227k]
  |  Branch (298:35): [True: 86.5k, False: 140k]
  ------------------
  299|  2.14M|    plane_bsize =
  300|  2.14M|        get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
  301|       |
  302|  2.14M|    struct tokenize_b_args *args = arg;
  303|  2.14M|    if (args->allow_update_cdf)
  ------------------
  |  Branch (303:9): [True: 2.14M, False: 715]
  ------------------
  304|  2.14M|      av1_update_and_record_txb_context(plane, block, blk_row, blk_col,
  305|  2.14M|                                        plane_bsize, tx_size, arg);
  306|    715|    else
  307|    715|      av1_record_txb_context(plane, block, blk_row, blk_col, plane_bsize,
  308|    715|                             tx_size, arg);
  309|       |
  310|  2.14M|  } else {
  311|       |    // Half the block size in transform block unit.
  312|   140k|    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
  313|   140k|    const int bsw = tx_size_wide_unit[sub_txs];
  314|   140k|    const int bsh = tx_size_high_unit[sub_txs];
  315|   140k|    const int step = bsw * bsh;
  316|   140k|    const int row_end =
  317|   140k|        AOMMIN(tx_size_high_unit[tx_size], max_blocks_high - blk_row);
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.0k, False: 125k]
  |  |  ------------------
  ------------------
  318|   140k|    const int col_end =
  319|   140k|        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
  ------------------
  |  |   34|   140k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.2k, False: 125k]
  |  |  ------------------
  ------------------
  320|       |
  321|   140k|    assert(bsw > 0 && bsh > 0);
  322|       |
  323|   410k|    for (int row = 0; row < row_end; row += bsh) {
  ------------------
  |  Branch (323:23): [True: 269k, False: 140k]
  ------------------
  324|   269k|      const int offsetr = blk_row + row;
  325|   784k|      for (int col = 0; col < col_end; col += bsw) {
  ------------------
  |  Branch (325:25): [True: 515k, False: 269k]
  ------------------
  326|   515k|        const int offsetc = blk_col + col;
  327|       |
  328|   515k|        tokenize_vartx(td, sub_txs, plane_bsize, offsetr, offsetc, block, plane,
  329|   515k|                       arg);
  330|   515k|        block += step;
  331|   515k|      }
  332|   269k|    }
  333|   140k|  }
  334|  2.28M|}

bitstream.c:is_token_info_allocated:
  139|   126k|static inline bool is_token_info_allocated(const TokenInfo *token_info) {
  140|   126k|  return ((token_info->tile_tok[0][0] != NULL) &&
  ------------------
  |  Branch (140:11): [True: 11.1k, False: 115k]
  ------------------
  141|  11.1k|          (token_info->tplist[0][0] != NULL));
  ------------------
  |  Branch (141:11): [True: 11.1k, False: 18.4E]
  ------------------
  142|   126k|}
encodeframe.c:get_token_alloc:
  107|  29.8k|                                           const int num_planes) {
  108|       |  // Calculate the maximum number of max superblocks in the image.
  109|  29.8k|  const int shift = sb_size_log2 - 4;
  110|  29.8k|  const int sb_size = 1 << sb_size_log2;
  111|  29.8k|  const int sb_size_square = sb_size * sb_size;
  112|  29.8k|  const int sb_rows = CEIL_POWER_OF_TWO(mb_rows, shift);
  ------------------
  |  |   62|  29.8k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  113|  29.8k|  const int sb_cols = CEIL_POWER_OF_TWO(mb_cols, shift);
  ------------------
  |  |   62|  29.8k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  114|       |
  115|       |  // One palette token for each pixel. There can be palettes on two planes.
  116|  29.8k|  const int sb_palette_toks = AOMMIN(2, num_planes) * sb_size_square;
  ------------------
  |  |   34|  29.8k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 21.7k, False: 8.13k]
  |  |  ------------------
  ------------------
  117|       |
  118|  29.8k|  return sb_rows * sb_cols * sb_palette_toks;
  119|  29.8k|}
encodeframe.c:free_token_info:
  145|  2.33k|static inline void free_token_info(TokenInfo *token_info) {
  146|  2.33k|  aom_free(token_info->tile_tok[0][0]);
  147|  2.33k|  token_info->tile_tok[0][0] = NULL;
  148|       |
  149|  2.33k|  aom_free(token_info->tplist[0][0]);
  150|  2.33k|  token_info->tplist[0][0] = NULL;
  151|       |
  152|  2.33k|  token_info->tokens_allocated = 0;
  153|  2.33k|}
encodeframe.c:alloc_token_info:
  123|  2.33k|                                    unsigned int tokens_required) {
  124|  2.33k|  int sb_rows =
  125|  2.33k|      CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, cm->seq_params->mib_size_log2);
  ------------------
  |  |   62|  2.33k|#define CEIL_POWER_OF_TWO(value, n) (((value) + (1 << (n)) - 1) >> (n))
  ------------------
  126|  2.33k|  token_info->tokens_allocated = tokens_required;
  127|       |
  128|  2.33k|  CHECK_MEM_ERROR(cm, token_info->tile_tok[0][0],
  ------------------
  |  |   51|  2.33k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  2.33k|  do {                                                    \
  |  |  |  |   72|  2.33k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  2.33k|    lval = (expr);                                        \
  |  |  |  |   74|  2.33k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 2.33k]
  |  |  |  |  ------------------
  |  |  |  |   75|  2.33k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  2.33k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 2.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|  2.33k|                  (TokenExtra *)aom_calloc(
  130|  2.33k|                      tokens_required, sizeof(*token_info->tile_tok[0][0])));
  131|       |
  132|       |  CHECK_MEM_ERROR(
  ------------------
  |  |   51|  2.33k|  AOM_CHECK_MEM_ERROR((cm)->error, lval, expr)
  |  |  ------------------
  |  |  |  |   71|  2.33k|  do {                                                    \
  |  |  |  |   72|  2.33k|    assert((error_info)->setjmp);                         \
  |  |  |  |   73|  2.33k|    lval = (expr);                                        \
  |  |  |  |   74|  2.33k|    if (!lval)                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (74:9): [True: 0, False: 2.33k]
  |  |  |  |  ------------------
  |  |  |  |   75|  2.33k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |  |  |   77|  2.33k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:12): [Folded, False: 2.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|  2.33k|      cm, token_info->tplist[0][0],
  134|  2.33k|      (TokenList *)aom_calloc(sb_rows * MAX_TILE_ROWS * MAX_TILE_COLS,
  135|  2.33k|                              sizeof(*token_info->tplist[0][0])));
  136|  2.33k|}
encodeframe.c:is_token_info_allocated:
  139|   370k|static inline bool is_token_info_allocated(const TokenInfo *token_info) {
  140|   370k|  return ((token_info->tile_tok[0][0] != NULL) &&
  ------------------
  |  Branch (140:11): [True: 33.1k, False: 337k]
  ------------------
  141|  33.1k|          (token_info->tplist[0][0] != NULL));
  ------------------
  |  Branch (141:11): [True: 33.1k, False: 18.4E]
  ------------------
  142|   370k|}
encoder.c:free_token_info:
  145|  18.4k|static inline void free_token_info(TokenInfo *token_info) {
  146|  18.4k|  aom_free(token_info->tile_tok[0][0]);
  147|  18.4k|  token_info->tile_tok[0][0] = NULL;
  148|       |
  149|  18.4k|  aom_free(token_info->tplist[0][0]);
  150|  18.4k|  token_info->tplist[0][0] = NULL;
  151|       |
  152|  18.4k|  token_info->tokens_allocated = 0;
  153|  18.4k|}
encodetxb.c:av1_get_tx_eob:
   99|  4.99M|                                 TX_SIZE tx_size) {
  100|  4.99M|  const int eob_max = av1_get_max_eob(tx_size);
  101|  4.99M|  return segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max;
  ------------------
  |  Branch (101:10): [True: 0, False: 4.99M]
  ------------------
  102|  4.99M|}

av1_setup_tpl_buffers:
  154|  73.6k|                           int height, int byte_alignment, int lag_in_frames) {
  155|  73.6k|  SequenceHeader *const seq_params = &ppi->seq_params;
  156|  73.6k|  TplParams *const tpl_data = &ppi->tpl_data;
  157|  73.6k|  set_tpl_stats_block_size(&tpl_data->tpl_stats_block_mis_log2,
  158|  73.6k|                           &tpl_data->tpl_bsize_1d);
  159|  73.6k|  const uint8_t block_mis_log2 = tpl_data->tpl_stats_block_mis_log2;
  160|  73.6k|  tpl_data->border_in_pixels =
  161|  73.6k|      ALIGN_POWER_OF_TWO(tpl_data->tpl_bsize_1d + 2 * AOM_INTERP_EXTEND, 5);
  ------------------
  |  |   69|  73.6k|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  162|       |
  163|  73.6k|  const int alloc_y_plane_only =
  164|  73.6k|      ppi->cpi->sf.tpl_sf.use_y_only_rate_distortion ? 1 : 0;
  ------------------
  |  Branch (164:7): [True: 49.2k, False: 24.4k]
  ------------------
  165|  7.80M|  for (int frame = 0; frame < MAX_LENGTH_TPL_FRAME_STATS; ++frame) {
  ------------------
  |  |  104|  7.80M|#define MAX_LENGTH_TPL_FRAME_STATS (MAX_TPL_FRAME_IDX + REF_FRAMES + 1)
  |  |  ------------------
  |  |  |  |  101|  7.80M|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  7.80M|#define MAX_LAG_BUFFERS 48
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (165:23): [True: 7.73M, False: 73.6k]
  ------------------
  166|  7.73M|    const int mi_cols =
  167|  7.73M|        ALIGN_POWER_OF_TWO(mi_params->mi_cols, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|  7.73M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  168|  7.73M|    const int mi_rows =
  169|  7.73M|        ALIGN_POWER_OF_TWO(mi_params->mi_rows, MAX_MIB_SIZE_LOG2);
  ------------------
  |  |   69|  7.73M|  (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
  ------------------
  170|  7.73M|    TplDepFrame *tpl_frame = &tpl_data->tpl_stats_buffer[frame];
  171|  7.73M|    tpl_frame->is_valid = 0;
  172|  7.73M|    tpl_frame->width = mi_cols >> block_mis_log2;
  173|  7.73M|    tpl_frame->height = mi_rows >> block_mis_log2;
  174|  7.73M|    tpl_frame->stride = tpl_data->tpl_stats_buffer[frame].width;
  175|  7.73M|    tpl_frame->mi_rows = mi_params->mi_rows;
  176|  7.73M|    tpl_frame->mi_cols = mi_params->mi_cols;
  177|  7.73M|  }
  178|  73.6k|  tpl_data->tpl_frame = &tpl_data->tpl_stats_buffer[REF_FRAMES + 1];
  179|       |
  180|       |  // If lag_in_frames <= 1, TPL module is not invoked. Hence dynamic memory
  181|       |  // allocations are avoided for buffers in tpl_data.
  182|  73.6k|  if (lag_in_frames <= 1) return;
  ------------------
  |  Branch (182:7): [True: 73.6k, False: 0]
  ------------------
  183|       |
  184|      0|  AOM_CHECK_MEM_ERROR(&ppi->error, tpl_data->txfm_stats_list,
  ------------------
  |  |   71|      0|  do {                                                    \
  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |   73|      0|    lval = (expr);                                        \
  |  |   74|      0|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  185|      0|                      aom_calloc(MAX_LENGTH_TPL_FRAME_STATS,
  186|      0|                                 sizeof(*tpl_data->txfm_stats_list)));
  187|       |
  188|      0|  for (int frame = 0; frame < lag_in_frames; ++frame) {
  ------------------
  |  Branch (188:23): [True: 0, False: 0]
  ------------------
  189|      0|    AOM_CHECK_MEM_ERROR(
  ------------------
  |  |   71|      0|  do {                                                    \
  |  |   72|      0|    assert((error_info)->setjmp);                         \
  |  |   73|      0|    lval = (expr);                                        \
  |  |   74|      0|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  190|      0|        &ppi->error, tpl_data->tpl_stats_pool[frame],
  191|      0|        aom_calloc(tpl_data->tpl_stats_buffer[frame].width *
  192|      0|                       tpl_data->tpl_stats_buffer[frame].height,
  193|      0|                   sizeof(*tpl_data->tpl_stats_buffer[frame].tpl_stats_ptr)));
  194|       |
  195|      0|    if (aom_alloc_frame_buffer(
  ------------------
  |  Branch (195:9): [True: 0, False: 0]
  ------------------
  196|      0|            &tpl_data->tpl_rec_pool[frame], width, height,
  197|      0|            seq_params->subsampling_x, seq_params->subsampling_y,
  198|      0|            seq_params->use_highbitdepth, tpl_data->border_in_pixels,
  199|      0|            byte_alignment, false, alloc_y_plane_only))
  200|      0|      aom_internal_error(&ppi->error, AOM_CODEC_MEM_ERROR,
  201|      0|                         "Failed to allocate frame buffer");
  202|      0|  }
  203|       |
  204|      0|  if (aom_alloc_frame_buffer(
  ------------------
  |  Branch (204:7): [True: 0, False: 0]
  ------------------
  205|      0|          &tpl_data->prev_gop_arf_src, width, height, seq_params->subsampling_x,
  206|      0|          seq_params->subsampling_y, seq_params->use_highbitdepth,
  207|      0|          tpl_data->border_in_pixels, byte_alignment, false,
  208|      0|          alloc_y_plane_only))
  209|      0|    aom_internal_error(&ppi->error, AOM_CODEC_MEM_ERROR,
  210|      0|                       "Failed to allocate prev gop arf buffer");
  211|       |
  212|      0|  tpl_data->prev_gop_arf_disp_order = -1;
  213|      0|}
av1_init_tpl_stats:
 1893|  12.3k|void av1_init_tpl_stats(TplParams *const tpl_data) {
 1894|  12.3k|  tpl_data->ready = 0;
 1895|  12.3k|  set_tpl_stats_block_size(&tpl_data->tpl_stats_block_mis_log2,
 1896|  12.3k|                           &tpl_data->tpl_bsize_1d);
 1897|  1.30M|  for (int frame_idx = 0; frame_idx < MAX_LENGTH_TPL_FRAME_STATS; ++frame_idx) {
  ------------------
  |  |  104|  1.30M|#define MAX_LENGTH_TPL_FRAME_STATS (MAX_TPL_FRAME_IDX + REF_FRAMES + 1)
  |  |  ------------------
  |  |  |  |  101|  1.30M|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  1.30M|#define MAX_LAG_BUFFERS 48
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1897:27): [True: 1.29M, False: 12.3k]
  ------------------
 1898|  1.29M|    TplDepFrame *tpl_frame = &tpl_data->tpl_stats_buffer[frame_idx];
 1899|  1.29M|    tpl_frame->is_valid = 0;
 1900|  1.29M|  }
 1901|   602k|  for (int frame_idx = 0; frame_idx < MAX_LAG_BUFFERS; ++frame_idx) {
  ------------------
  |  |   28|   602k|#define MAX_LAG_BUFFERS 48
  ------------------
  |  Branch (1901:27): [True: 590k, False: 12.3k]
  ------------------
 1902|   590k|    TplDepFrame *tpl_frame = &tpl_data->tpl_stats_buffer[frame_idx];
 1903|   590k|    if (tpl_data->tpl_stats_pool[frame_idx] == NULL) continue;
  ------------------
  |  Branch (1903:9): [True: 590k, False: 0]
  ------------------
 1904|      0|    memset(tpl_data->tpl_stats_pool[frame_idx], 0,
 1905|      0|           tpl_frame->height * tpl_frame->width *
 1906|      0|               sizeof(*tpl_frame->tpl_stats_ptr));
 1907|      0|  }
 1908|  12.3k|}
av1_tpl_stats_ready:
 1910|  16.3M|int av1_tpl_stats_ready(const TplParams *tpl_data, int gf_frame_index) {
 1911|  16.3M|  if (tpl_data->ready == 0) {
  ------------------
  |  Branch (1911:7): [True: 16.3M, False: 18.4E]
  ------------------
 1912|  16.3M|    return 0;
 1913|  16.3M|  }
 1914|  18.4E|  if (gf_frame_index >= MAX_TPL_FRAME_IDX) {
  ------------------
  |  |  101|  18.4E|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  ------------------
  |  |  |  |   28|  18.4E|#define MAX_LAG_BUFFERS 48
  |  |  ------------------
  ------------------
  |  Branch (1914:7): [True: 0, False: 18.4E]
  ------------------
 1915|       |    // The sub-GOP length exceeds the TPL buffer capacity.
 1916|       |    // Hence the TPL related functions are disabled hereafter.
 1917|      0|    return 0;
 1918|      0|  }
 1919|  18.4E|  return tpl_data->tpl_frame[gf_frame_index].is_valid;
 1920|  18.4E|}
av1_free_tpl_gop_stats:
 2025|  18.4k|void av1_free_tpl_gop_stats(AomTplGopStats *extrc_tpl_gop_stats) {
 2026|  18.4k|  if (extrc_tpl_gop_stats == NULL ||
  ------------------
  |  Branch (2026:7): [True: 0, False: 18.4k]
  ------------------
 2027|  18.4k|      extrc_tpl_gop_stats->frame_stats_list == NULL) {
  ------------------
  |  Branch (2027:7): [True: 18.4k, False: 0]
  ------------------
 2028|  18.4k|    return;
 2029|  18.4k|  }
 2030|      0|  for (int frame_index = 0; frame_index < extrc_tpl_gop_stats->size;
  ------------------
  |  Branch (2030:29): [True: 0, False: 0]
  ------------------
 2031|      0|       ++frame_index) {
 2032|      0|    AomTplFrameStats *this_frame_stats =
 2033|      0|        &extrc_tpl_gop_stats->frame_stats_list[frame_index];
 2034|      0|    aom_free(this_frame_stats->block_stats_list);
 2035|      0|    this_frame_stats->block_stats_list = NULL;
 2036|      0|  }
 2037|      0|  aom_free(extrc_tpl_gop_stats->frame_stats_list);
 2038|       |  extrc_tpl_gop_stats->frame_stats_list = NULL;
 2039|      0|  extrc_tpl_gop_stats->size = 0;
 2040|      0|}
av1_tpl_rdmult_setup_sb:
 2324|  59.8k|                             BLOCK_SIZE sb_size, int mi_row, int mi_col) {
 2325|  59.8k|  AV1_COMMON *const cm = &cpi->common;
 2326|  59.8k|  GF_GROUP *gf_group = &cpi->ppi->gf_group;
 2327|  59.8k|  assert(IMPLIES(cpi->ppi->gf_group.size > 0,
 2328|  59.8k|                 cpi->gf_frame_index < cpi->ppi->gf_group.size));
 2329|  59.8k|  const int tpl_idx = cpi->gf_frame_index;
 2330|       |
 2331|  59.8k|  const int boost_index = AOMMIN(15, (cpi->ppi->p_rc.gfu_boost / 100));
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 59.8k, False: 18.4E]
  |  |  ------------------
  ------------------
 2332|  59.8k|  const int layer_depth = AOMMIN(gf_group->layer_depth[cpi->gf_frame_index], 6);
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 59.9k, False: 18.4E]
  |  |  ------------------
  ------------------
 2333|  59.8k|  const FRAME_TYPE frame_type = cm->current_frame.frame_type;
 2334|       |
 2335|  59.8k|  if (tpl_idx >= MAX_TPL_FRAME_IDX) return;
  ------------------
  |  |  101|  59.8k|#define MAX_TPL_FRAME_IDX (2 * MAX_LAG_BUFFERS)
  |  |  ------------------
  |  |  |  |   28|  59.8k|#define MAX_LAG_BUFFERS 48
  |  |  ------------------
  ------------------
  |  Branch (2335:7): [True: 0, False: 59.8k]
  ------------------
 2336|  59.8k|  TplDepFrame *tpl_frame = &cpi->ppi->tpl_data.tpl_frame[tpl_idx];
 2337|  59.8k|  if (!tpl_frame->is_valid) return;
  ------------------
  |  Branch (2337:7): [True: 59.8k, False: 18.4E]
  ------------------
 2338|  18.4E|  if (!is_frame_tpl_eligible(gf_group, cpi->gf_frame_index)) return;
  ------------------
  |  Branch (2338:7): [True: 0, False: 18.4E]
  ------------------
 2339|  18.4E|  if (cpi->oxcf.q_cfg.aq_mode != NO_AQ) return;
  ------------------
  |  Branch (2339:7): [True: 0, False: 18.4E]
  ------------------
 2340|       |
 2341|  18.4E|  const int mi_col_sr =
 2342|  18.4E|      coded_to_superres_mi(mi_col, cm->superres_scale_denominator);
 2343|  18.4E|  const int mi_cols_sr = av1_pixels_to_mi(cm->superres_upscaled_width);
 2344|  18.4E|  const int sb_mi_width_sr = coded_to_superres_mi(
 2345|  18.4E|      mi_size_wide[sb_size], cm->superres_scale_denominator);
 2346|       |
 2347|  18.4E|  const int bsize_base = BLOCK_16X16;
 2348|  18.4E|  const int num_mi_w = mi_size_wide[bsize_base];
 2349|  18.4E|  const int num_mi_h = mi_size_high[bsize_base];
 2350|  18.4E|  const int num_cols = (mi_cols_sr + num_mi_w - 1) / num_mi_w;
 2351|  18.4E|  const int num_rows = (cm->mi_params.mi_rows + num_mi_h - 1) / num_mi_h;
 2352|  18.4E|  const int num_bcols = (sb_mi_width_sr + num_mi_w - 1) / num_mi_w;
 2353|  18.4E|  const int num_brows = (mi_size_high[sb_size] + num_mi_h - 1) / num_mi_h;
 2354|  18.4E|  int row, col;
 2355|       |
 2356|  18.4E|  double base_block_count = 0.0;
 2357|  18.4E|  double log_sum = 0.0;
 2358|       |
 2359|  18.4E|  for (row = mi_row / num_mi_w;
 2360|  18.4E|       row < num_rows && row < mi_row / num_mi_w + num_brows; ++row) {
  ------------------
  |  Branch (2360:8): [True: 0, False: 18.4E]
  |  Branch (2360:26): [True: 0, False: 0]
  ------------------
 2361|      0|    for (col = mi_col_sr / num_mi_h;
 2362|      0|         col < num_cols && col < mi_col_sr / num_mi_h + num_bcols; ++col) {
  ------------------
  |  Branch (2362:10): [True: 0, False: 0]
  |  Branch (2362:28): [True: 0, False: 0]
  ------------------
 2363|      0|      const int index = row * num_cols + col;
 2364|      0|      log_sum += log(cpi->tpl_rdmult_scaling_factors[index]);
 2365|      0|      base_block_count += 1.0;
 2366|      0|    }
 2367|      0|  }
 2368|       |
 2369|  18.4E|  const CommonQuantParams *quant_params = &cm->quant_params;
 2370|       |
 2371|  18.4E|  const int orig_qindex_rdmult =
 2372|  18.4E|      quant_params->base_qindex + quant_params->y_dc_delta_q;
 2373|  18.4E|  const int orig_rdmult = av1_compute_rd_mult(
 2374|  18.4E|      orig_qindex_rdmult, cm->seq_params->bit_depth,
 2375|  18.4E|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index], layer_depth,
 2376|  18.4E|      boost_index, frame_type, cpi->oxcf.q_cfg.use_fixed_qp_offsets,
 2377|  18.4E|      is_stat_consumption_stage(cpi), cpi->oxcf.tune_cfg.tuning,
 2378|  18.4E|      cpi->oxcf.mode);
 2379|       |
 2380|  18.4E|  const int new_qindex_rdmult = quant_params->base_qindex +
 2381|  18.4E|                                x->rdmult_delta_qindex +
 2382|  18.4E|                                quant_params->y_dc_delta_q;
 2383|  18.4E|  const int new_rdmult = av1_compute_rd_mult(
 2384|  18.4E|      new_qindex_rdmult, cm->seq_params->bit_depth,
 2385|  18.4E|      cpi->ppi->gf_group.update_type[cpi->gf_frame_index], layer_depth,
 2386|  18.4E|      boost_index, frame_type, cpi->oxcf.q_cfg.use_fixed_qp_offsets,
 2387|  18.4E|      is_stat_consumption_stage(cpi), cpi->oxcf.tune_cfg.tuning,
 2388|  18.4E|      cpi->oxcf.mode);
 2389|       |
 2390|  18.4E|  const double scaling_factor = (double)new_rdmult / (double)orig_rdmult;
 2391|       |
 2392|  18.4E|  double scale_adj = log(scaling_factor) - log_sum / base_block_count;
 2393|  18.4E|  scale_adj = exp_bounded(scale_adj);
 2394|       |
 2395|  18.4E|  for (row = mi_row / num_mi_w;
 2396|  18.4E|       row < num_rows && row < mi_row / num_mi_w + num_brows; ++row) {
  ------------------
  |  Branch (2396:8): [True: 0, False: 18.4E]
  |  Branch (2396:26): [True: 0, False: 0]
  ------------------
 2397|      0|    for (col = mi_col_sr / num_mi_h;
 2398|      0|         col < num_cols && col < mi_col_sr / num_mi_h + num_bcols; ++col) {
  ------------------
  |  Branch (2398:10): [True: 0, False: 0]
  |  Branch (2398:28): [True: 0, False: 0]
  ------------------
 2399|      0|      const int index = row * num_cols + col;
 2400|      0|      cpi->ppi->tpl_sb_rdmult_scaling_factors[index] =
 2401|      0|          scale_adj * cpi->tpl_rdmult_scaling_factors[index];
 2402|      0|    }
 2403|      0|  }
 2404|  18.4E|}
tpl_model.c:set_tpl_stats_block_size:
  143|  85.9k|                                            uint8_t *tpl_bsize_1d) {
  144|       |  // tpl stats bsize: 2 means 16x16
  145|  85.9k|  *block_mis_log2 = 2;
  146|       |  // Block size used in tpl motion estimation
  147|  85.9k|  *tpl_bsize_1d = 16;
  148|       |  // MIN_TPL_BSIZE_1D = 16;
  149|       |  assert(*tpl_bsize_1d >= 16);
  150|  85.9k|}

encoder.c:tpl_dealloc_temp_buffers:
  441|  35.3k|static inline void tpl_dealloc_temp_buffers(TplBuffers *tpl_tmp_buffers) {
  442|  35.3k|  aom_free(tpl_tmp_buffers->predictor8);
  443|  35.3k|  tpl_tmp_buffers->predictor8 = NULL;
  444|  35.3k|  aom_free(tpl_tmp_buffers->src_diff);
  445|  35.3k|  tpl_tmp_buffers->src_diff = NULL;
  446|  35.3k|  aom_free(tpl_tmp_buffers->coeff);
  447|  35.3k|  tpl_tmp_buffers->coeff = NULL;
  448|  35.3k|  aom_free(tpl_tmp_buffers->qcoeff);
  449|  35.3k|  tpl_tmp_buffers->qcoeff = NULL;
  450|  35.3k|  aom_free(tpl_tmp_buffers->dqcoeff);
  451|       |  tpl_tmp_buffers->dqcoeff = NULL;
  452|  35.3k|}

av1_pixel_diff_dist:
  128|  5.91M|                            unsigned int *block_mse_q8) {
  129|  5.91M|  int visible_rows, visible_cols;
  130|  5.91M|  const int txb_cols = block_size_wide[tx_bsize];
  131|  5.91M|  const int txb_rows = block_size_high[tx_bsize];
  132|  5.91M|  get_visible_dimensions(x, plane, plane_bsize, blk_col, blk_row, txb_cols,
  133|  5.91M|                         txb_rows, /*clip_dims=*/true, &visible_cols,
  134|  5.91M|                         &visible_rows);
  135|       |
  136|  5.91M|  uint64_t sse = 0;
  137|  5.92M|  if (visible_cols > 0 && visible_rows > 0) {
  ------------------
  |  Branch (137:7): [True: 5.91M, False: 6]
  |  Branch (137:27): [True: 5.91M, False: 18.4E]
  ------------------
  138|  5.92M|    const int diff_stride = block_size_wide[plane_bsize];
  139|  5.92M|    const int16_t *diff = x->plane[plane].src_diff;
  140|       |
  141|  5.92M|    diff += ((blk_row * diff_stride + blk_col) << MI_SIZE_LOG2);
  ------------------
  |  |   39|  5.92M|#define MI_SIZE_LOG2 2
  ------------------
  142|  5.92M|    sse = aom_sum_squares_2d_i16(diff, diff_stride, visible_cols, visible_rows);
  143|  5.92M|    if (block_mse_q8 != NULL) {
  ------------------
  |  Branch (143:9): [True: 1.78M, False: 4.13M]
  ------------------
  144|  1.78M|      *block_mse_q8 =
  145|  1.78M|          (unsigned int)((256 * sse) / (visible_cols * visible_rows));
  146|  1.78M|    }
  147|  18.4E|  } else {
  148|  18.4E|    if (block_mse_q8 != NULL) *block_mse_q8 = 0;
  ------------------
  |  Branch (148:9): [True: 0, False: 18.4E]
  ------------------
  149|  18.4E|  }
  150|  5.91M|  return sse;
  151|  5.91M|}
av1_pick_recursive_tx_size_type_yrd:
 3561|   147k|                                         int64_t ref_best_rd) {
 3562|   147k|  MACROBLOCKD *const xd = &x->e_mbd;
 3563|   147k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 3564|   147k|  assert(is_inter_block(xd->mi[0]));
 3565|       |
 3566|   147k|  av1_invalid_rd_stats(rd_stats);
 3567|       |
 3568|       |  // If modeled RD cost is a lot worse than the best so far, terminate early.
 3569|   147k|  if (cpi->sf.tx_sf.model_based_prune_tx_search_level &&
  ------------------
  |  Branch (3569:7): [True: 0, False: 147k]
  ------------------
 3570|      0|      ref_best_rd != INT64_MAX) {
  ------------------
  |  Branch (3570:7): [True: 0, False: 0]
  ------------------
 3571|      0|    if (model_based_tx_search_prune(cpi, x, bsize, ref_best_rd)) return;
  ------------------
  |  Branch (3571:9): [True: 0, False: 0]
  ------------------
 3572|      0|  }
 3573|       |
 3574|       |  // Hashing based speed feature. If the hash of the prediction residue block is
 3575|       |  // found in the hash table, use previous search results and terminate early.
 3576|   147k|  uint32_t hash = 0;
 3577|   147k|  MB_RD_RECORD *mb_rd_record = NULL;
 3578|   147k|  const int mi_row = x->e_mbd.mi_row;
 3579|   147k|  const int mi_col = x->e_mbd.mi_col;
 3580|   147k|  const int within_border =
 3581|   147k|      mi_row >= xd->tile.mi_row_start &&
  ------------------
  |  Branch (3581:7): [True: 147k, False: 6]
  ------------------
 3582|   147k|      (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) &&
  ------------------
  |  Branch (3582:7): [True: 109k, False: 38.6k]
  ------------------
 3583|   109k|      mi_col >= xd->tile.mi_col_start &&
  ------------------
  |  Branch (3583:7): [True: 109k, False: 18.4E]
  ------------------
 3584|   109k|      (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end);
  ------------------
  |  Branch (3584:7): [True: 83.2k, False: 25.8k]
  ------------------
 3585|   147k|  const int is_mb_rd_hash_enabled =
 3586|   147k|      (within_border && cpi->sf.rd_sf.use_mb_rd_hash);
  ------------------
  |  Branch (3586:8): [True: 83.2k, False: 64.4k]
  |  Branch (3586:25): [True: 83.2k, False: 0]
  ------------------
 3587|   147k|  const int n4 = bsize_to_num_blk(bsize);
 3588|   147k|  if (is_mb_rd_hash_enabled) {
  ------------------
  |  Branch (3588:7): [True: 83.2k, False: 64.4k]
  ------------------
 3589|  83.2k|    hash = get_block_residue_hash(x, bsize);
 3590|  83.2k|    mb_rd_record = x->txfm_search_info.mb_rd_record;
 3591|  83.2k|    const int match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash);
 3592|  83.2k|    if (match_index != -1) {
  ------------------
  |  Branch (3592:9): [True: 0, False: 83.2k]
  ------------------
 3593|      0|      MB_RD_INFO *mb_rd_info = &mb_rd_record->mb_rd_info[match_index];
 3594|      0|      fetch_mb_rd_info(n4, mb_rd_info, rd_stats, x);
 3595|      0|      return;
 3596|      0|    }
 3597|  83.2k|  }
 3598|       |
 3599|       |  // If we predict that skip is the optimal RD decision - set the respective
 3600|       |  // context and terminate early.
 3601|   147k|  int64_t dist;
 3602|   147k|  if (txfm_params->skip_txfm_level &&
  ------------------
  |  Branch (3602:7): [True: 147k, False: 18.4E]
  ------------------
 3603|   147k|      predict_skip_txfm(x, bsize, &dist,
  ------------------
  |  Branch (3603:7): [True: 196, False: 147k]
  ------------------
 3604|   147k|                        cpi->common.features.reduced_tx_set_used)) {
 3605|    196|    set_skip_txfm(x, rd_stats, bsize, dist);
 3606|       |    // Save the RD search results into mb_rd_record.
 3607|    196|    if (is_mb_rd_hash_enabled)
  ------------------
  |  Branch (3607:9): [True: 39, False: 157]
  ------------------
 3608|     39|      save_mb_rd_info(n4, hash, x, rd_stats, mb_rd_record);
 3609|    196|    return;
 3610|    196|  }
 3611|       |#if CONFIG_SPEED_STATS
 3612|       |  ++x->txfm_search_info.tx_search_count;
 3613|       |#endif  // CONFIG_SPEED_STATS
 3614|       |
 3615|   147k|  const int64_t rd =
 3616|   147k|      select_tx_size_and_type(cpi, x, rd_stats, bsize, ref_best_rd);
 3617|       |
 3618|   147k|  if (rd == INT64_MAX) {
  ------------------
  |  Branch (3618:7): [True: 0, False: 147k]
  ------------------
 3619|       |    // We should always find at least one candidate unless ref_best_rd is less
 3620|       |    // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type
 3621|       |    // might have failed to find something better)
 3622|      0|    assert(ref_best_rd != INT64_MAX);
 3623|      0|    av1_invalid_rd_stats(rd_stats);
 3624|      0|    return;
 3625|      0|  }
 3626|       |
 3627|       |  // Save the RD search results into mb_rd_record.
 3628|   147k|  if (is_mb_rd_hash_enabled) {
  ------------------
  |  Branch (3628:7): [True: 83.1k, False: 64.3k]
  ------------------
 3629|       |    assert(mb_rd_record != NULL);
 3630|  83.1k|    save_mb_rd_info(n4, hash, x, rd_stats, mb_rd_record);
 3631|  83.1k|  }
 3632|   147k|}
av1_pick_uniform_tx_size_type_yrd:
 3636|  25.3M|                                       int64_t ref_best_rd) {
 3637|  25.3M|  MACROBLOCKD *const xd = &x->e_mbd;
 3638|  25.3M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3639|  25.3M|  const TxfmSearchParams *tx_params = &x->txfm_search_params;
 3640|  25.3M|  assert(bs == mbmi->bsize);
 3641|  25.3M|  const int is_inter = is_inter_block(mbmi);
 3642|  25.3M|  const int mi_row = xd->mi_row;
 3643|  25.3M|  const int mi_col = xd->mi_col;
 3644|       |
 3645|  25.3M|  av1_init_rd_stats(rd_stats);
 3646|       |
 3647|       |  // Hashing based speed feature for inter blocks. If the hash of the residue
 3648|       |  // block is found in the table, use previously saved search results and
 3649|       |  // terminate early.
 3650|  25.3M|  uint32_t hash = 0;
 3651|  25.3M|  MB_RD_RECORD *mb_rd_record = NULL;
 3652|  25.3M|  const int num_blks = bsize_to_num_blk(bs);
 3653|  25.3M|  if (is_inter && cpi->sf.rd_sf.use_mb_rd_hash) {
  ------------------
  |  Branch (3653:7): [True: 4.86M, False: 20.4M]
  |  Branch (3653:19): [True: 4.86M, False: 18.4E]
  ------------------
 3654|  4.86M|    const int within_border =
 3655|  4.86M|        mi_row >= xd->tile.mi_row_start &&
  ------------------
  |  Branch (3655:9): [True: 4.86M, False: 18.4E]
  ------------------
 3656|  4.86M|        (mi_row + mi_size_high[bs] < xd->tile.mi_row_end) &&
  ------------------
  |  Branch (3656:9): [True: 3.90M, False: 951k]
  ------------------
 3657|  3.90M|        mi_col >= xd->tile.mi_col_start &&
  ------------------
  |  Branch (3657:9): [True: 3.90M, False: 18.4E]
  ------------------
 3658|  3.90M|        (mi_col + mi_size_wide[bs] < xd->tile.mi_col_end);
  ------------------
  |  Branch (3658:9): [True: 3.14M, False: 759k]
  ------------------
 3659|  4.86M|    if (within_border) {
  ------------------
  |  Branch (3659:9): [True: 3.14M, False: 1.71M]
  ------------------
 3660|  3.14M|      hash = get_block_residue_hash(x, bs);
 3661|  3.14M|      mb_rd_record = x->txfm_search_info.mb_rd_record;
 3662|  3.14M|      const int match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash);
 3663|  3.14M|      if (match_index != -1) {
  ------------------
  |  Branch (3663:11): [True: 785k, False: 2.36M]
  ------------------
 3664|   785k|        MB_RD_INFO *mb_rd_info = &mb_rd_record->mb_rd_info[match_index];
 3665|   785k|        fetch_mb_rd_info(num_blks, mb_rd_info, rd_stats, x);
 3666|   785k|        return;
 3667|   785k|      }
 3668|  3.14M|    }
 3669|  4.86M|  }
 3670|       |
 3671|       |  // If we predict that skip is the optimal RD decision - set the respective
 3672|       |  // context and terminate early.
 3673|  24.5M|  int64_t dist;
 3674|  24.5M|  if (tx_params->skip_txfm_level && is_inter &&
  ------------------
  |  Branch (3674:7): [True: 24.5M, False: 12.3k]
  |  Branch (3674:37): [True: 4.07M, False: 20.4M]
  ------------------
 3675|  4.07M|      !xd->lossless[mbmi->segment_id] &&
  ------------------
  |  Branch (3675:7): [True: 3.98M, False: 90.5k]
  ------------------
 3676|  3.98M|      predict_skip_txfm(x, bs, &dist,
  ------------------
  |  Branch (3676:7): [True: 336, False: 3.98M]
  ------------------
 3677|  3.98M|                        cpi->common.features.reduced_tx_set_used)) {
 3678|       |    // Populate rdstats as per skip decision
 3679|    336|    set_skip_txfm(x, rd_stats, bs, dist);
 3680|       |    // Save the RD search results into mb_rd_record.
 3681|    336|    if (mb_rd_record) {
  ------------------
  |  Branch (3681:9): [True: 38, False: 298]
  ------------------
 3682|     38|      save_mb_rd_info(num_blks, hash, x, rd_stats, mb_rd_record);
 3683|     38|    }
 3684|    336|    return;
 3685|    336|  }
 3686|       |
 3687|  24.5M|  if (xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (3687:7): [True: 476k, False: 24.0M]
  ------------------
 3688|       |    // Lossless mode can only pick the smallest (4x4) transform size.
 3689|   476k|    choose_smallest_tx_size(cpi, x, rd_stats, ref_best_rd, bs);
 3690|  24.0M|  } else if (tx_params->tx_size_search_method == USE_LARGESTALL) {
  ------------------
  |  Branch (3690:14): [True: 21.7M, False: 2.30M]
  ------------------
 3691|  21.7M|    choose_largest_tx_size(cpi, x, rd_stats, ref_best_rd, bs);
 3692|  21.7M|  } else {
 3693|  2.30M|    choose_tx_size_type_from_rd(cpi, x, rd_stats, ref_best_rd, bs);
 3694|  2.30M|  }
 3695|       |
 3696|       |  // Save the RD search results into mb_rd_record for possible reuse in future.
 3697|  24.5M|  if (mb_rd_record) {
  ------------------
  |  Branch (3697:7): [True: 2.36M, False: 22.1M]
  ------------------
 3698|  2.36M|    save_mb_rd_info(num_blks, hash, x, rd_stats, mb_rd_record);
 3699|  2.36M|  }
 3700|  24.5M|}
av1_txfm_uvrd:
 3703|  11.4M|                  BLOCK_SIZE bsize, int64_t ref_best_rd) {
 3704|  11.4M|  av1_init_rd_stats(rd_stats);
 3705|  11.4M|  if (ref_best_rd < 0) return 0;
  ------------------
  |  Branch (3705:7): [True: 0, False: 11.4M]
  ------------------
 3706|  11.4M|  if (!x->e_mbd.is_chroma_ref) return 1;
  ------------------
  |  Branch (3706:7): [True: 356k, False: 11.0M]
  ------------------
 3707|       |
 3708|  11.0M|  MACROBLOCKD *const xd = &x->e_mbd;
 3709|  11.0M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3710|  11.0M|  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U];
  ------------------
  |  |  282|  11.0M|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3711|  11.0M|  const int is_inter = is_inter_block(mbmi);
 3712|  11.0M|  int64_t this_rd = 0, skip_txfm_rd = 0;
 3713|  11.0M|  const BLOCK_SIZE plane_bsize =
 3714|  11.0M|      get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
 3715|       |
 3716|  11.0M|  if (is_inter) {
  ------------------
  |  Branch (3716:7): [True: 2.07M, False: 8.97M]
  ------------------
 3717|  6.22M|    for (int plane = 1; plane < MAX_MB_PLANE; ++plane)
  ------------------
  |  |   36|  6.22M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (3717:25): [True: 4.14M, False: 2.07M]
  ------------------
 3718|  4.14M|      av1_subtract_plane(x, plane_bsize, plane, cpi->do_border_pad);
 3719|  2.07M|  }
 3720|       |
 3721|  11.0M|  const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd);
  ------------------
  |  |  282|  11.0M|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
 3722|  11.0M|  int is_cost_valid = 1;
 3723|  27.6M|  for (int plane = 1; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|  27.6M|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (3723:23): [True: 21.6M, False: 5.95M]
  ------------------
 3724|  21.6M|    RD_STATS this_rd_stats;
 3725|  21.6M|    int64_t chroma_ref_best_rd = ref_best_rd;
 3726|       |    // For inter blocks, refined ref_best_rd is used for early exit
 3727|       |    // For intra blocks, even though current rd crosses ref_best_rd, early
 3728|       |    // exit is not recommended as current rd is used for gating subsequent
 3729|       |    // modes as well (say, for angular modes)
 3730|       |    // TODO(any): Extend the early exit mechanism for intra modes as well
 3731|  21.6M|    if (cpi->sf.inter_sf.perform_best_rd_based_gating_for_chroma && is_inter &&
  ------------------
  |  Branch (3731:9): [True: 21.6M, False: 38.8k]
  |  Branch (3731:69): [True: 4.03M, False: 17.5M]
  ------------------
 3732|  4.03M|        chroma_ref_best_rd != INT64_MAX)
  ------------------
  |  Branch (3732:9): [True: 3.09M, False: 944k]
  ------------------
 3733|  3.09M|      chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_txfm_rd);
  ------------------
  |  |   34|  3.09M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.15M, False: 1.94M]
  |  |  ------------------
  ------------------
 3734|  21.6M|    av1_txfm_rd_in_plane(x, cpi, &this_rd_stats, chroma_ref_best_rd, 0, plane,
 3735|  21.6M|                         plane_bsize, uv_tx_size, FTXS_NONE);
 3736|  21.6M|    if (this_rd_stats.rate == INT_MAX) {
  ------------------
  |  Branch (3736:9): [True: 372k, False: 21.2M]
  ------------------
 3737|   372k|      is_cost_valid = 0;
 3738|   372k|      break;
 3739|   372k|    }
 3740|  21.2M|    av1_merge_rd_stats(rd_stats, &this_rd_stats);
 3741|  21.2M|    this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|  21.2M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  21.2M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  21.2M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  21.2M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3742|  21.2M|    skip_txfm_rd = RDCOST(x->rdmult, 0, rd_stats->sse);
  ------------------
  |  |   33|  21.2M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  21.2M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  21.2M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  21.2M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3743|  21.2M|    if (AOMMIN(this_rd, skip_txfm_rd) > ref_best_rd) {
  ------------------
  |  |   34|  21.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 18.0M, False: 3.22M]
  |  |  ------------------
  ------------------
  |  Branch (3743:9): [True: 4.72M, False: 16.5M]
  ------------------
 3744|  4.72M|      is_cost_valid = 0;
 3745|  4.72M|      break;
 3746|  4.72M|    }
 3747|  21.2M|  }
 3748|       |
 3749|  11.0M|  if (!is_cost_valid) {
  ------------------
  |  Branch (3749:7): [True: 5.09M, False: 5.95M]
  ------------------
 3750|       |    // reset cost value
 3751|  5.09M|    av1_invalid_rd_stats(rd_stats);
 3752|  5.09M|  }
 3753|       |
 3754|  11.0M|  return is_cost_valid;
 3755|  11.4M|}
av1_txfm_rd_in_plane:
 3760|  57.0M|                          TX_SIZE tx_size, FAST_TX_SEARCH_MODE ftxs_mode) {
 3761|  57.0M|  assert(IMPLIES(plane == 0, x->e_mbd.mi[0]->tx_size == tx_size));
 3762|       |
 3763|  57.0M|  if (!cpi->oxcf.txfm_cfg.enable_tx64 &&
  ------------------
  |  Branch (3763:7): [True: 0, False: 57.0M]
  ------------------
 3764|      0|      txsize_sqr_up_map[tx_size] == TX_64X64) {
  ------------------
  |  Branch (3764:7): [True: 0, False: 0]
  ------------------
 3765|      0|    av1_invalid_rd_stats(rd_stats);
 3766|      0|    return;
 3767|      0|  }
 3768|       |
 3769|  57.0M|  if (current_rd > ref_best_rd) {
  ------------------
  |  Branch (3769:7): [True: 60, False: 57.0M]
  ------------------
 3770|     60|    av1_invalid_rd_stats(rd_stats);
 3771|     60|    return;
 3772|     60|  }
 3773|       |
 3774|  57.0M|  MACROBLOCKD *const xd = &x->e_mbd;
 3775|  57.0M|  const struct macroblockd_plane *const pd = &xd->plane[plane];
 3776|  57.0M|  struct rdcost_block_args args;
 3777|  57.0M|  av1_zero(args);
  ------------------
  |  |   43|  57.0M|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 3778|  57.0M|  args.x = x;
 3779|  57.0M|  args.cpi = cpi;
 3780|  57.0M|  args.best_rd = ref_best_rd;
 3781|  57.0M|  args.current_rd = current_rd;
 3782|  57.0M|  args.ftxs_mode = ftxs_mode;
 3783|  57.0M|  args.skip_trellis = 0;
 3784|  57.0M|  av1_init_rd_stats(&args.rd_stats);
 3785|       |
 3786|  57.0M|  av1_get_entropy_contexts(plane_bsize, pd, args.t_above, args.t_left);
 3787|  57.0M|  av1_foreach_transformed_block_in_plane(xd, plane_bsize, plane, block_rd_txfm,
 3788|  57.0M|                                         &args);
 3789|       |
 3790|  57.0M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3791|  57.0M|  const int is_inter = is_inter_block(mbmi);
 3792|  57.0M|  const int invalid_rd = is_inter ? args.incomplete_exit : args.exit_early;
  ------------------
  |  Branch (3792:26): [True: 8.10M, False: 48.9M]
  ------------------
 3793|       |
 3794|  57.0M|  if (invalid_rd) {
  ------------------
  |  Branch (3794:7): [True: 4.55M, False: 52.4M]
  ------------------
 3795|  4.55M|    av1_invalid_rd_stats(rd_stats);
 3796|  52.4M|  } else {
 3797|  52.4M|    *rd_stats = args.rd_stats;
 3798|  52.4M|  }
 3799|  57.0M|}
av1_txfm_search:
 3803|  4.86M|                    RD_STATS *rd_stats_uv, int mode_rate, int64_t ref_best_rd) {
 3804|  4.86M|  MACROBLOCKD *const xd = &x->e_mbd;
 3805|  4.86M|  TxfmSearchParams *txfm_params = &x->txfm_search_params;
 3806|  4.86M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 3807|  4.86M|  const int skip_txfm_cost[2] = { x->mode_costs.skip_txfm_cost[skip_ctx][0],
 3808|  4.86M|                                  x->mode_costs.skip_txfm_cost[skip_ctx][1] };
 3809|  4.86M|  const int64_t min_header_rate =
 3810|  4.86M|      mode_rate + AOMMIN(skip_txfm_cost[0], skip_txfm_cost[1]);
  ------------------
  |  |   34|  4.86M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.67M, False: 187k]
  |  |  ------------------
  ------------------
 3811|       |  // Account for minimum skip and non_skip rd.
 3812|       |  // Eventually either one of them will be added to mode_rate
 3813|  4.86M|  const int64_t min_header_rd_possible = RDCOST(x->rdmult, min_header_rate, 0);
  ------------------
  |  |   33|  4.86M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.86M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.86M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.86M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3814|  4.86M|  if (min_header_rd_possible > ref_best_rd) {
  ------------------
  |  Branch (3814:7): [True: 5.42k, False: 4.85M]
  ------------------
 3815|  5.42k|    av1_invalid_rd_stats(rd_stats_y);
 3816|  5.42k|    return 0;
 3817|  5.42k|  }
 3818|       |
 3819|  4.85M|  const AV1_COMMON *cm = &cpi->common;
 3820|  4.85M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 3821|  4.85M|  const int64_t mode_rd = RDCOST(x->rdmult, mode_rate, 0);
  ------------------
  |  |   33|  4.85M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.85M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.85M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.85M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3822|  4.85M|  const int64_t rd_thresh =
 3823|  4.85M|      ref_best_rd == INT64_MAX ? INT64_MAX : ref_best_rd - mode_rd;
  ------------------
  |  Branch (3823:7): [True: 1.06M, False: 3.79M]
  ------------------
 3824|  4.85M|  av1_init_rd_stats(rd_stats);
 3825|  4.85M|  av1_init_rd_stats(rd_stats_y);
 3826|  4.85M|  rd_stats->rate = mode_rate;
 3827|       |
 3828|       |  // cost and distortion
 3829|  4.85M|  av1_subtract_plane(x, bsize, PLANE_TYPE_Y, cpi->do_border_pad);
 3830|  4.85M|  if (txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (3830:7): [True: 0, False: 4.85M]
  ------------------
 3831|      0|      !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (3831:7): [True: 0, False: 0]
  ------------------
 3832|      0|    av1_pick_recursive_tx_size_type_yrd(cpi, x, rd_stats_y, bsize, rd_thresh);
 3833|       |#if CONFIG_COLLECT_RD_STATS == 2
 3834|       |    PrintPredictionUnitStats(cpi, tile_data, x, rd_stats_y, bsize);
 3835|       |#endif  // CONFIG_COLLECT_RD_STATS == 2
 3836|  4.85M|  } else {
 3837|  4.85M|    av1_pick_uniform_tx_size_type_yrd(cpi, x, rd_stats_y, bsize, rd_thresh);
 3838|  4.85M|    memset(mbmi->inter_tx_size, mbmi->tx_size, sizeof(mbmi->inter_tx_size));
 3839|  4.85M|  }
 3840|       |
 3841|  4.85M|  if (rd_stats_y->rate == INT_MAX) return 0;
  ------------------
  |  Branch (3841:7): [True: 177, False: 4.85M]
  ------------------
 3842|       |
 3843|  4.85M|  av1_merge_rd_stats(rd_stats, rd_stats_y);
 3844|       |
 3845|  4.85M|  const int64_t non_skip_txfm_rdcosty =
 3846|  4.85M|      RDCOST(x->rdmult, rd_stats->rate + skip_txfm_cost[0], rd_stats->dist);
  ------------------
  |  |   33|  4.85M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.85M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.85M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.85M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3847|  4.85M|  const int64_t skip_txfm_rdcosty =
 3848|  4.85M|      RDCOST(x->rdmult, mode_rate + skip_txfm_cost[1], rd_stats->sse);
  ------------------
  |  |   33|  4.85M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.85M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.85M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.85M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3849|  4.85M|  const int64_t min_rdcosty = AOMMIN(non_skip_txfm_rdcosty, skip_txfm_rdcosty);
  ------------------
  |  |   34|  4.85M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.32M, False: 531k]
  |  |  ------------------
  ------------------
 3850|  4.85M|  if (min_rdcosty > ref_best_rd) return 0;
  ------------------
  |  Branch (3850:7): [True: 764k, False: 4.09M]
  ------------------
 3851|       |
 3852|  4.09M|  av1_init_rd_stats(rd_stats_uv);
 3853|  4.09M|  const int num_planes = av1_num_planes(cm);
 3854|  4.09M|  if (num_planes > 1) {
  ------------------
  |  Branch (3854:7): [True: 2.29M, False: 1.80M]
  ------------------
 3855|  2.29M|    int64_t ref_best_chroma_rd = ref_best_rd;
 3856|       |    // Calculate best rd cost possible for chroma
 3857|  2.29M|    if (cpi->sf.inter_sf.perform_best_rd_based_gating_for_chroma &&
  ------------------
  |  Branch (3857:9): [True: 2.29M, False: 18.4E]
  ------------------
 3858|  2.29M|        (ref_best_chroma_rd != INT64_MAX)) {
  ------------------
  |  Branch (3858:9): [True: 1.85M, False: 437k]
  ------------------
 3859|  1.85M|      ref_best_chroma_rd = (ref_best_chroma_rd -
 3860|  1.85M|                            AOMMIN(non_skip_txfm_rdcosty, skip_txfm_rdcosty));
  ------------------
  |  |   34|  1.85M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.63M, False: 220k]
  |  |  ------------------
  ------------------
 3861|  1.85M|    }
 3862|  2.29M|    const int is_cost_valid_uv =
 3863|  2.29M|        av1_txfm_uvrd(cpi, x, rd_stats_uv, bsize, ref_best_chroma_rd);
 3864|  2.29M|    if (!is_cost_valid_uv) return 0;
  ------------------
  |  Branch (3864:9): [True: 286k, False: 2.00M]
  ------------------
 3865|       |
 3866|  2.00M|    if (cpi->sf.hl_sf.weighted_chroma_distortion) {
  ------------------
  |  Branch (3866:9): [True: 0, False: 2.00M]
  ------------------
 3867|       |      // Apply weighted distortion/SSE accumulation while merging uv rd stats to
 3868|       |      // y rd stats.
 3869|      0|      av1_merge_rd_stats_weighted(rd_stats, rd_stats_uv);
 3870|  2.00M|    } else {
 3871|  2.00M|      av1_merge_rd_stats(rd_stats, rd_stats_uv);
 3872|  2.00M|    }
 3873|  2.00M|  }
 3874|       |
 3875|  3.80M|  int choose_skip_txfm = rd_stats->skip_txfm;
 3876|  3.80M|  if (!choose_skip_txfm && !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (3876:7): [True: 3.68M, False: 127k]
  |  Branch (3876:28): [True: 3.60M, False: 71.6k]
  ------------------
 3877|  3.60M|    const int64_t rdcost_no_skip_txfm = RDCOST(
  ------------------
  |  |   33|  3.60M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.60M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.60M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.60M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3878|  3.60M|        x->rdmult, rd_stats_y->rate + rd_stats_uv->rate + skip_txfm_cost[0],
 3879|  3.60M|        rd_stats->dist);
 3880|  3.60M|    const int64_t rdcost_skip_txfm =
 3881|  3.60M|        RDCOST(x->rdmult, skip_txfm_cost[1], rd_stats->sse);
  ------------------
  |  |   33|  3.60M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.60M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.60M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.60M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3882|  3.60M|    if (rdcost_no_skip_txfm >= rdcost_skip_txfm) choose_skip_txfm = 1;
  ------------------
  |  Branch (3882:9): [True: 259k, False: 3.34M]
  ------------------
 3883|  3.60M|  }
 3884|  3.80M|  if (choose_skip_txfm) {
  ------------------
  |  Branch (3884:7): [True: 391k, False: 3.41M]
  ------------------
 3885|   391k|    rd_stats_y->rate = 0;
 3886|   391k|    rd_stats_uv->rate = 0;
 3887|   391k|    rd_stats->rate = mode_rate + skip_txfm_cost[1];
 3888|   391k|    rd_stats->dist = rd_stats->sse;
 3889|   391k|    rd_stats_y->dist = rd_stats_y->sse;
 3890|   391k|    rd_stats_uv->dist = rd_stats_uv->sse;
 3891|   391k|    mbmi->skip_txfm = 1;
 3892|   391k|    if (rd_stats->skip_txfm) {
  ------------------
  |  Branch (3892:9): [True: 131k, False: 259k]
  ------------------
 3893|   131k|      const int64_t tmprd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|   131k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   131k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   131k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   131k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3894|   131k|      if (tmprd > ref_best_rd) return 0;
  ------------------
  |  Branch (3894:11): [True: 742, False: 130k]
  ------------------
 3895|   131k|    }
 3896|  3.41M|  } else {
 3897|  3.41M|    rd_stats->rate += skip_txfm_cost[0];
 3898|  3.41M|    mbmi->skip_txfm = 0;
 3899|  3.41M|  }
 3900|       |
 3901|  3.80M|  return 1;
 3902|  3.80M|}
tx_search.c:cost_coeffs:
 1947|  74.2M|                              int reduced_tx_set_used) {
 1948|       |#if TXCOEFF_COST_TIMER
 1949|       |  struct aom_usec_timer timer;
 1950|       |  aom_usec_timer_start(&timer);
 1951|       |#endif
 1952|  74.2M|  const int cost = av1_cost_coeffs_txb(x, plane, block, tx_size, tx_type,
 1953|  74.2M|                                       txb_ctx, reduced_tx_set_used);
 1954|       |#if TXCOEFF_COST_TIMER
 1955|       |  AV1_COMMON *tmp_cm = (AV1_COMMON *)&cpi->common;
 1956|       |  aom_usec_timer_mark(&timer);
 1957|       |  const int64_t elapsed_time = aom_usec_timer_elapsed(&timer);
 1958|       |  tmp_cm->txcoeff_cost_timer += elapsed_time;
 1959|       |  ++tmp_cm->txcoeff_cost_count;
 1960|       |#endif
 1961|  74.2M|  return cost;
 1962|  74.2M|}
tx_search.c:dist_block_tx_domain:
 1119|   100M|                                        int64_t *out_sse) {
 1120|   100M|  const struct macroblock_plane *const p = &x->plane[plane];
 1121|       |  // Transform domain distortion computation is more efficient as it does
 1122|       |  // not involve an inverse transform, but it is less accurate.
 1123|   100M|  const int buffer_length = av1_get_max_eob(tx_size);
 1124|   100M|  int64_t this_sse;
 1125|       |  // TX-domain results need to shift down to Q2/D10 to match pixel
 1126|       |  // domain distortion values which are in Q2^2
 1127|   100M|  int shift = (MAX_TX_SCALE - av1_get_tx_scale(tx_size)) * 2;
  ------------------
  |  |   34|   100M|#define MAX_TX_SCALE 1
  ------------------
 1128|   100M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|   100M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
 1129|   100M|  tran_low_t *const coeff = p->coeff + block_offset;
 1130|   100M|  tran_low_t *const dqcoeff = p->dqcoeff + block_offset;
 1131|   100M|#if CONFIG_AV1_HIGHBITDEPTH
 1132|   100M|  MACROBLOCKD *const xd = &x->e_mbd;
 1133|   100M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (1133:7): [True: 32.2M, False: 67.8M]
  ------------------
 1134|  32.2M|    if (qmatrix == NULL || !x->txfm_search_params.use_qm_dist_metric) {
  ------------------
  |  Branch (1134:9): [True: 6.57M, False: 25.6M]
  |  Branch (1134:28): [True: 405, False: 25.6M]
  ------------------
 1135|  6.60M|      *out_dist = av1_highbd_block_error(coeff, dqcoeff, buffer_length,
 1136|  6.60M|                                         &this_sse, xd->bd);
 1137|  25.6M|    } else {
 1138|  25.6M|      *out_dist = av1_block_error_qm(coeff, dqcoeff, buffer_length, qmatrix,
 1139|  25.6M|                                     scan, &this_sse, xd->bd);
 1140|  25.6M|    }
 1141|  67.8M|  } else {
 1142|  67.8M|#endif
 1143|  67.8M|    if (qmatrix == NULL || !x->txfm_search_params.use_qm_dist_metric) {
  ------------------
  |  Branch (1143:9): [True: 23.1M, False: 44.7M]
  |  Branch (1143:28): [True: 18.4E, False: 44.7M]
  ------------------
 1144|  23.1M|      *out_dist = av1_block_error(coeff, dqcoeff, buffer_length, &this_sse);
 1145|  44.7M|    } else {
 1146|  44.7M|      *out_dist = av1_block_error_qm(coeff, dqcoeff, buffer_length, qmatrix,
 1147|  44.7M|                                     scan, &this_sse, 8);
 1148|  44.7M|    }
 1149|  67.8M|#if CONFIG_AV1_HIGHBITDEPTH
 1150|  67.8M|  }
 1151|   100M|#endif
 1152|       |
 1153|   100M|  *out_dist = RIGHT_SIGNED_SHIFT(*out_dist, shift);
  ------------------
  |  |   66|   100M|  ((n) < 0 ? ((value) << (-(n))) : ((value) >> (n)))
  |  |  ------------------
  |  |  |  Branch (66:4): [True: 26.6k, False: 100M]
  |  |  ------------------
  ------------------
 1154|   100M|  *out_sse = RIGHT_SIGNED_SHIFT(this_sse, shift);
  ------------------
  |  |   66|   100M|  ((n) < 0 ? ((value) << (-(n))) : ((value) >> (n)))
  |  |  ------------------
  |  |  |  Branch (66:4): [True: 26.6k, False: 100M]
  |  |  ------------------
  ------------------
 1155|   100M|}
tx_search.c:av1_block_error_qm:
 1086|  70.3M|    const qm_val_t *qmatrix, const int16_t *scan, int64_t *ssz, int bd) {
 1087|  70.3M|  int i;
 1088|  70.3M|  int64_t error = 0, sqcoeff = 0;
 1089|  70.3M|  int shift = 2 * (bd - 8);
 1090|  70.3M|  int rounding = (1 << shift) >> 1;
 1091|       |
 1092|  2.96G|  for (i = 0; i < block_size; i++) {
  ------------------
  |  Branch (1092:15): [True: 2.89G, False: 70.3M]
  ------------------
 1093|  2.89G|    int64_t weight = qmatrix[scan[i]];
 1094|  2.89G|    int64_t dd = coeff[i] - dqcoeff[i];
 1095|  2.89G|    dd *= weight;
 1096|  2.89G|    int64_t cc = coeff[i];
 1097|  2.89G|    cc *= weight;
 1098|       |    // The ranges of coeff and dqcoeff are
 1099|       |    //  bd8 : 18 bits (including sign)
 1100|       |    //  bd10: 20 bits (including sign)
 1101|       |    //  bd12: 22 bits (including sign)
 1102|       |    // As AOM_QM_BITS is 5, the intermediate quantities in the calculation
 1103|       |    // below should fit in 54 bits, thus no overflow should happen.
 1104|  2.89G|    error += (dd * dd + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|  2.89G|#define AOM_QM_BITS 5
  ------------------
                  error += (dd * dd + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|  2.89G|#define AOM_QM_BITS 5
  ------------------
 1105|  2.89G|    sqcoeff += (cc * cc + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|  2.89G|#define AOM_QM_BITS 5
  ------------------
                  sqcoeff += (cc * cc + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|  2.89G|#define AOM_QM_BITS 5
  ------------------
 1106|  2.89G|  }
 1107|       |
 1108|  70.3M|  error = (error + rounding) >> shift;
 1109|  70.3M|  sqcoeff = (sqcoeff + rounding) >> shift;
 1110|       |
 1111|  70.3M|  *ssz = sqcoeff;
 1112|  70.3M|  return error;
 1113|  70.3M|}
tx_search.c:get_block_residue_hash:
   86|  3.23M|static inline uint32_t get_block_residue_hash(MACROBLOCK *x, BLOCK_SIZE bsize) {
   87|  3.23M|  const int rows = block_size_high[bsize];
   88|  3.23M|  const int cols = block_size_wide[bsize];
   89|  3.23M|  const int16_t *diff = x->plane[0].src_diff;
   90|  3.23M|  const uint32_t hash =
   91|  3.23M|      av1_get_crc32c_value(&x->txfm_search_info.mb_rd_record->crc_calculator,
   92|  3.23M|                           (uint8_t *)diff, 2 * rows * cols);
   93|  3.23M|  return (hash << 5) + bsize;
   94|  3.23M|}
tx_search.c:find_mb_rd_info:
   98|  3.23M|                                      const uint32_t hash) {
   99|  3.23M|  int32_t match_index = -1;
  100|  3.23M|  if (ref_best_rd != INT64_MAX) {
  ------------------
  |  Branch (100:7): [True: 2.48M, False: 745k]
  ------------------
  101|  3.91M|    for (int i = 0; i < mb_rd_record->num; ++i) {
  ------------------
  |  Branch (101:21): [True: 2.21M, False: 1.70M]
  ------------------
  102|  2.21M|      const int index = (mb_rd_record->index_start + i) % RD_RECORD_BUFFER_LEN;
  ------------------
  |  |   41|  2.21M|#define RD_RECORD_BUFFER_LEN 8
  ------------------
  103|       |      // If there is a match in the mb_rd_record, fetch the RD decision and
  104|       |      // terminate early.
  105|  2.21M|      if (mb_rd_record->mb_rd_info[index].hash_value == hash) {
  ------------------
  |  Branch (105:11): [True: 785k, False: 1.42M]
  ------------------
  106|   785k|        match_index = index;
  107|   785k|        break;
  108|   785k|      }
  109|  2.21M|    }
  110|  2.48M|  }
  111|  3.23M|  return match_index;
  112|  3.23M|}
tx_search.c:fetch_mb_rd_info:
  116|   785k|                                    MACROBLOCK *const x) {
  117|   785k|  MACROBLOCKD *const xd = &x->e_mbd;
  118|   785k|  MB_MODE_INFO *const mbmi = xd->mi[0];
  119|   785k|  mbmi->tx_size = mb_rd_info->tx_size;
  120|   785k|  av1_copy(mbmi->inter_tx_size, mb_rd_info->inter_tx_size);
  ------------------
  |  |   31|   785k|  do {                                              \
  |  |   32|   785k|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|   785k|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|   785k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 785k]
  |  |  ------------------
  ------------------
  121|       |  av1_copy_array(xd->tx_type_map, mb_rd_info->tx_type_map, n4);
  ------------------
  |  |   38|   785k|  do {                                                    \
  |  |   39|   785k|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|   785k|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|   785k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 785k]
  |  |  ------------------
  ------------------
  122|   785k|  *rd_stats = mb_rd_info->rd_stats;
  123|   785k|}
tx_search.c:predict_skip_txfm:
  194|  4.13M|                             int reduced_tx_set) {
  195|  4.13M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  196|  4.13M|  const int bw = block_size_wide[bsize];
  197|  4.13M|  const int bh = block_size_high[bsize];
  198|  4.13M|  const MACROBLOCKD *xd = &x->e_mbd;
  199|  4.13M|  const int16_t dc_q = av1_dc_quant_QTX(x->qindex, 0, xd->bd);
  200|       |
  201|  4.13M|  *dist = av1_pixel_diff_dist(x, 0, 0, 0, bsize, bsize, NULL);
  202|       |
  203|  4.13M|  const int64_t mse = *dist / bw / bh;
  204|       |  // Normalized quantizer takes the transform upscaling factor (8 for tx size
  205|       |  // smaller than 32) into account.
  206|  4.13M|  const int16_t normalized_dc_q = dc_q >> 3;
  207|  4.13M|  const int64_t mse_thresh = (int64_t)normalized_dc_q * normalized_dc_q / 8;
  208|       |  // For faster early skip decision, use dist to compare against threshold so
  209|       |  // that quality risk is less for the skip=1 decision. Otherwise, use mse
  210|       |  // since the fwd_txfm coeff checks will take care of quality
  211|       |  // TODO(any): Use dist to return 0 when skip_txfm_level is 1
  212|  4.13M|  int64_t pred_err = (txfm_params->skip_txfm_level >= 2) ? *dist : mse;
  ------------------
  |  Branch (212:22): [True: 3.98M, False: 148k]
  ------------------
  213|       |  // Predict not to skip when error is larger than threshold.
  214|  4.13M|  if (pred_err > mse_thresh) return 0;
  ------------------
  |  Branch (214:7): [True: 4.13M, False: 3.61k]
  ------------------
  215|       |  // Return as skip otherwise for aggressive early skip
  216|  3.61k|  else if (txfm_params->skip_txfm_level >= 2)
  ------------------
  |  Branch (216:12): [True: 336, False: 3.27k]
  ------------------
  217|    336|    return 1;
  218|       |
  219|  3.27k|  const int max_tx_size = max_predict_sf_tx_size[bsize];
  220|  3.27k|  const int tx_h = tx_size_high[max_tx_size];
  221|  3.27k|  const int tx_w = tx_size_wide[max_tx_size];
  222|  3.27k|  DECLARE_ALIGNED(32, tran_low_t, coefs[32 * 32]);
  ------------------
  |  |   19|  3.27k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  223|  3.27k|  TxfmParam param;
  224|  3.27k|  param.tx_type = DCT_DCT;
  225|  3.27k|  param.tx_size = max_tx_size;
  226|  3.27k|  param.bd = xd->bd;
  227|  3.27k|  param.is_hbd = is_cur_buf_hbd(xd);
  228|  3.27k|  param.lossless = 0;
  229|  3.27k|  param.tx_set_type = av1_get_ext_tx_set_type(
  230|  3.27k|      param.tx_size, is_inter_block(xd->mi[0]), reduced_tx_set);
  231|  3.27k|  const int bd_idx = (xd->bd == 8) ? 0 : ((xd->bd == 10) ? 1 : 2);
  ------------------
  |  Branch (231:22): [True: 2.41k, False: 861]
  |  Branch (231:43): [True: 270, False: 591]
  ------------------
  232|  3.27k|  const uint32_t max_qcoef_thresh = skip_pred_threshold[bd_idx][bsize];
  233|  3.27k|  const int16_t *src_diff = x->plane[0].src_diff;
  234|  3.27k|  const int n_coeff = tx_w * tx_h;
  235|  3.27k|  const int16_t ac_q = av1_ac_quant_QTX(x->qindex, 0, xd->bd);
  236|  3.27k|  const uint32_t dc_thresh = max_qcoef_thresh * dc_q;
  237|  3.27k|  const uint32_t ac_thresh = max_qcoef_thresh * ac_q;
  238|  3.51k|  for (int row = 0; row < bh; row += tx_h) {
  ------------------
  |  Branch (238:21): [True: 2.82k, False: 688]
  ------------------
  239|  3.17k|    for (int col = 0; col < bw; col += tx_w) {
  ------------------
  |  Branch (239:23): [True: 2.94k, False: 235]
  ------------------
  240|  2.94k|      av1_fwd_txfm(src_diff + col, coefs, bw, &param);
  241|       |      // Operating on TX domain, not pixels; we want the QTX quantizers
  242|  2.94k|      const uint32_t dc_coef = (((uint32_t)abs(coefs[0])) << 7);
  243|  2.94k|      if (dc_coef >= dc_thresh) return 0;
  ------------------
  |  Branch (243:11): [True: 1.61k, False: 1.32k]
  ------------------
  244|  68.5k|      for (int i = 1; i < n_coeff; ++i) {
  ------------------
  |  Branch (244:23): [True: 68.1k, False: 351]
  ------------------
  245|  68.1k|        const uint32_t ac_coef = (((uint32_t)abs(coefs[i])) << 7);
  246|  68.1k|        if (ac_coef >= ac_thresh) return 0;
  ------------------
  |  Branch (246:13): [True: 977, False: 67.1k]
  ------------------
  247|  68.1k|      }
  248|  1.32k|    }
  249|    235|    src_diff += tx_h * bw;
  250|    235|  }
  251|    688|  return 1;
  252|  3.27k|}
tx_search.c:set_skip_txfm:
  256|    532|                                 BLOCK_SIZE bsize, int64_t dist) {
  257|    532|  MACROBLOCKD *const xd = &x->e_mbd;
  258|    532|  MB_MODE_INFO *const mbmi = xd->mi[0];
  259|    532|  const int n4 = bsize_to_num_blk(bsize);
  260|    532|  const TX_SIZE tx_size = max_txsize_rect_lookup[bsize];
  261|    532|  memset(xd->tx_type_map, DCT_DCT, sizeof(xd->tx_type_map[0]) * n4);
  262|    532|  memset(mbmi->inter_tx_size, tx_size, sizeof(mbmi->inter_tx_size));
  263|    532|  mbmi->tx_size = tx_size;
  264|    532|  rd_stats->skip_txfm = 1;
  265|    532|  if (is_cur_buf_hbd(xd)) dist = ROUND_POWER_OF_TWO(dist, (xd->bd - 8) * 2);
  ------------------
  |  |   41|    368|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  |  Branch (265:7): [True: 368, False: 164]
  ------------------
  266|    532|  rd_stats->dist = rd_stats->sse = (dist << 4);
  267|       |  // Though decision is to make the block as skip based on luma stats,
  268|       |  // it is possible that block becomes non skip after chroma rd. In addition
  269|       |  // intermediate non skip costs calculated by caller function will be
  270|       |  // incorrect, if rate is set as  zero (i.e., if zero_blk_rate is not
  271|       |  // accounted). Hence intermediate rate is populated to code the luma tx blks
  272|       |  // as skip, the caller function based on final rd decision (i.e., skip vs
  273|       |  // non-skip) sets the final rate accordingly. Here the rate populated
  274|       |  // corresponds to coding all the tx blocks with zero_blk_rate (based on max tx
  275|       |  // size possible) in the current block. Eg: For 128*128 block, rate would be
  276|       |  // 4 * zero_blk_rate where zero_blk_rate corresponds to coding of one 64x64 tx
  277|       |  // block as 'all zeros'
  278|    532|  ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
  279|    532|  ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
  280|    532|  av1_get_entropy_contexts(bsize, &xd->plane[0], ctxa, ctxl);
  281|    532|  ENTROPY_CONTEXT *ta = ctxa;
  282|    532|  ENTROPY_CONTEXT *tl = ctxl;
  283|    532|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  284|    532|  TXB_CTX txb_ctx;
  285|    532|  get_txb_ctx(bsize, tx_size, 0, ta, tl, &txb_ctx);
  286|    532|  const int zero_blk_rate = x->coeff_costs.coeff_costs[txs_ctx][PLANE_TYPE_Y]
  287|    532|                                .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
  288|    532|  rd_stats->rate = zero_blk_rate *
  289|    532|                   (block_size_wide[bsize] >> tx_size_wide_log2[tx_size]) *
  290|    532|                   (block_size_high[bsize] >> tx_size_high_log2[tx_size]);
  291|    532|}
tx_search.c:save_mb_rd_info:
  296|  2.44M|                                   MB_RD_RECORD *mb_rd_record) {
  297|  2.44M|  int index;
  298|  2.44M|  if (mb_rd_record->num < RD_RECORD_BUFFER_LEN) {
  ------------------
  |  |   41|  2.44M|#define RD_RECORD_BUFFER_LEN 8
  ------------------
  |  Branch (298:7): [True: 2.44M, False: 308]
  ------------------
  299|  2.44M|    index =
  300|  2.44M|        (mb_rd_record->index_start + mb_rd_record->num) % RD_RECORD_BUFFER_LEN;
  ------------------
  |  |   41|  2.44M|#define RD_RECORD_BUFFER_LEN 8
  ------------------
  301|  2.44M|    ++mb_rd_record->num;
  302|  2.44M|  } else {
  303|    308|    index = mb_rd_record->index_start;
  304|    308|    mb_rd_record->index_start =
  305|    308|        (mb_rd_record->index_start + 1) % RD_RECORD_BUFFER_LEN;
  ------------------
  |  |   41|    308|#define RD_RECORD_BUFFER_LEN 8
  ------------------
  306|    308|  }
  307|  2.44M|  MB_RD_INFO *const mb_rd_info = &mb_rd_record->mb_rd_info[index];
  308|  2.44M|  const MACROBLOCKD *const xd = &x->e_mbd;
  309|  2.44M|  const MB_MODE_INFO *const mbmi = xd->mi[0];
  310|  2.44M|  mb_rd_info->hash_value = hash;
  311|  2.44M|  mb_rd_info->tx_size = mbmi->tx_size;
  312|  2.44M|  av1_copy(mb_rd_info->inter_tx_size, mbmi->inter_tx_size);
  ------------------
  |  |   31|  2.44M|  do {                                              \
  |  |   32|  2.44M|    static_assert(sizeof(dest) == sizeof(src), ""); \
  |  |   33|  2.44M|    memcpy(dest, src, sizeof(src));                 \
  |  |   34|  2.44M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (34:12): [Folded, False: 2.44M]
  |  |  ------------------
  ------------------
  313|       |  av1_copy_array(mb_rd_info->tx_type_map, xd->tx_type_map, n4);
  ------------------
  |  |   38|  2.44M|  do {                                                    \
  |  |   39|  2.44M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  2.44M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  2.44M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.44M]
  |  |  ------------------
  ------------------
  314|  2.44M|  mb_rd_info->rd_stats = *rd_stats;
  315|  2.44M|}
tx_search.c:select_tx_size_and_type:
 3441|   147k|                                       int64_t ref_best_rd) {
 3442|   147k|  MACROBLOCKD *const xd = &x->e_mbd;
 3443|   147k|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 3444|   147k|  assert(is_inter_block(xd->mi[0]));
 3445|   147k|  assert(bsize < BLOCK_SIZES_ALL);
 3446|   147k|  const int fast_tx_search = txfm_params->tx_size_search_method > USE_FULL_RD;
 3447|   147k|  int64_t rd_thresh = ref_best_rd;
 3448|   147k|  if (rd_thresh == 0) {
  ------------------
  |  Branch (3448:7): [True: 0, False: 147k]
  ------------------
 3449|      0|    av1_invalid_rd_stats(rd_stats);
 3450|      0|    return INT64_MAX;
 3451|      0|  }
 3452|   147k|  if (fast_tx_search && rd_thresh < INT64_MAX) {
  ------------------
  |  Branch (3452:7): [True: 0, False: 147k]
  |  Branch (3452:25): [True: 0, False: 0]
  ------------------
 3453|      0|    if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3);
  ------------------
  |  Branch (3453:9): [True: 0, False: 0]
  ------------------
 3454|      0|  }
 3455|   147k|  assert(rd_thresh > 0);
 3456|   147k|  const FAST_TX_SEARCH_MODE ftxs_mode =
 3457|   147k|      fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE;
  ------------------
  |  Branch (3457:7): [True: 0, False: 147k]
  ------------------
 3458|   147k|  const struct macroblockd_plane *const pd = &xd->plane[0];
 3459|   147k|  assert(bsize < BLOCK_SIZES_ALL);
 3460|   147k|  const int mi_width = mi_size_wide[bsize];
 3461|   147k|  const int mi_height = mi_size_high[bsize];
 3462|   147k|  ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
 3463|   147k|  ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
 3464|   147k|  TXFM_CONTEXT tx_above[MAX_MIB_SIZE];
 3465|   147k|  TXFM_CONTEXT tx_left[MAX_MIB_SIZE];
 3466|   147k|  av1_get_entropy_contexts(bsize, pd, ctxa, ctxl);
 3467|   147k|  memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width);
 3468|   147k|  memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height);
 3469|   147k|  const int init_depth = get_search_init_depth(
 3470|   147k|      mi_width, mi_height, 1, &cpi->sf, txfm_params->tx_size_search_method);
 3471|   147k|  const TX_SIZE max_tx_size = max_txsize_rect_lookup[bsize];
 3472|   147k|  const int bh = tx_size_high_unit[max_tx_size];
 3473|   147k|  const int bw = tx_size_wide_unit[max_tx_size];
 3474|   147k|  const int step = bw * bh;
 3475|   147k|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 3476|   147k|  const int no_skip_txfm_cost = x->mode_costs.skip_txfm_cost[skip_ctx][0];
 3477|   147k|  const int skip_txfm_cost = x->mode_costs.skip_txfm_cost[skip_ctx][1];
 3478|   147k|  int64_t skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_cost, 0);
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3479|   147k|  int64_t no_skip_txfm_rd = RDCOST(x->rdmult, no_skip_txfm_cost, 0);
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3480|   147k|  int block = 0;
 3481|   147k|  int blk_idx = 0;
 3482|       |
 3483|   147k|  av1_init_rd_stats(rd_stats);
 3484|   295k|  for (int idy = 0; idy < max_block_high(xd, bsize, 0); idy += bh) {
  ------------------
  |  Branch (3484:21): [True: 147k, False: 147k]
  ------------------
 3485|   295k|    for (int idx = 0; idx < max_block_wide(xd, bsize, 0); idx += bw) {
  ------------------
  |  Branch (3485:23): [True: 147k, False: 147k]
  ------------------
 3486|   147k|      const int64_t best_rd_sofar =
 3487|   147k|          (rd_thresh == INT64_MAX)
  ------------------
  |  Branch (3487:11): [True: 147k, False: 1]
  ------------------
 3488|   147k|              ? INT64_MAX
 3489|   147k|              : (rd_thresh - (AOMMIN(skip_txfm_rd, no_skip_txfm_rd)));
  ------------------
  |  |   34|      1|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 3490|   147k|      int is_cost_valid = 1;
 3491|   147k|      RD_STATS pn_rd_stats;
 3492|       |      // Search for the best transform block size and type for the sub-block.
 3493|   147k|      select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, bsize,
 3494|   147k|                      ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, INT64_MAX,
 3495|   147k|                      best_rd_sofar, &is_cost_valid, ftxs_mode, blk_idx);
 3496|   147k|      blk_idx++;
 3497|   147k|      if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) {
  ------------------
  |  Branch (3497:11): [True: 7, False: 147k]
  |  Branch (3497:29): [True: 18.4E, False: 147k]
  ------------------
 3498|      0|        av1_invalid_rd_stats(rd_stats);
 3499|      0|        return INT64_MAX;
 3500|      0|      }
 3501|   147k|      av1_merge_rd_stats(rd_stats, &pn_rd_stats);
 3502|   147k|      skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse);
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3503|   147k|      no_skip_txfm_rd =
 3504|   147k|          RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_cost, rd_stats->dist);
  ------------------
  |  |   33|   147k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   147k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   147k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   147k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3505|   147k|      block += step;
 3506|   147k|    }
 3507|   147k|  }
 3508|       |
 3509|   147k|  if (rd_stats->rate == INT_MAX) return INT64_MAX;
  ------------------
  |  Branch (3509:7): [True: 0, False: 147k]
  ------------------
 3510|       |
 3511|   147k|  rd_stats->skip_txfm = (skip_txfm_rd <= no_skip_txfm_rd);
 3512|       |
 3513|       |  // If fast_tx_search is true, only DCT and 1D DCT were tested in
 3514|       |  // select_inter_block_yrd() above. Do a better search for tx type with
 3515|       |  // tx sizes already decided.
 3516|   147k|  if (fast_tx_search && cpi->sf.tx_sf.refine_fast_tx_search_results) {
  ------------------
  |  Branch (3516:7): [True: 0, False: 147k]
  |  Branch (3516:25): [True: 0, False: 0]
  ------------------
 3517|      0|    if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE))
  ------------------
  |  Branch (3517:9): [True: 0, False: 0]
  ------------------
 3518|      0|      return INT64_MAX;
 3519|      0|  }
 3520|       |
 3521|   147k|  int64_t final_rd;
 3522|   147k|  if (rd_stats->skip_txfm) {
  ------------------
  |  Branch (3522:7): [True: 990, False: 146k]
  ------------------
 3523|    990|    final_rd = RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse);
  ------------------
  |  |   33|    990|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|    990|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|    990|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|    990|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3524|   146k|  } else {
 3525|   146k|    final_rd =
 3526|   146k|        RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_cost, rd_stats->dist);
  ------------------
  |  |   33|   146k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   146k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   146k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   146k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3527|   146k|    if (!xd->lossless[xd->mi[0]->segment_id]) {
  ------------------
  |  Branch (3527:9): [True: 146k, False: 4]
  ------------------
 3528|   146k|      final_rd =
 3529|   146k|          AOMMIN(final_rd, RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse));
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 146k, False: 18.4E]
  |  |  ------------------
  ------------------
 3530|   146k|    }
 3531|   146k|  }
 3532|       |
 3533|   147k|  return final_rd;
 3534|   147k|}
tx_search.c:get_search_init_depth:
  375|  2.45M|                                 int tx_size_search_method) {
  376|  2.45M|  if (tx_size_search_method == USE_LARGESTALL) return MAX_VARTX_DEPTH;
  ------------------
  |  |   56|      0|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (376:7): [True: 0, False: 2.45M]
  ------------------
  377|       |
  378|  2.45M|  if (sf->tx_sf.tx_size_search_lgr_block) {
  ------------------
  |  Branch (378:7): [True: 63.7k, False: 2.38M]
  ------------------
  379|  63.7k|    if (mi_width > mi_size_wide[BLOCK_64X64] ||
  ------------------
  |  Branch (379:9): [True: 0, False: 63.7k]
  ------------------
  380|  63.7k|        mi_height > mi_size_high[BLOCK_64X64])
  ------------------
  |  Branch (380:9): [True: 18.4E, False: 63.7k]
  ------------------
  381|      0|      return MAX_VARTX_DEPTH;
  ------------------
  |  |   56|      0|#define MAX_VARTX_DEPTH 2
  ------------------
  382|  63.7k|  }
  383|       |
  384|  2.45M|  if (is_inter) {
  ------------------
  |  Branch (384:7): [True: 147k, False: 2.30M]
  ------------------
  385|   147k|    return (mi_height != mi_width)
  ------------------
  |  Branch (385:12): [True: 4.89k, False: 142k]
  ------------------
  386|   147k|               ? sf->tx_sf.inter_tx_size_search_init_depth_rect
  387|   147k|               : sf->tx_sf.inter_tx_size_search_init_depth_sqr;
  388|  2.30M|  } else {
  389|  2.30M|    return (mi_height != mi_width)
  ------------------
  |  Branch (389:12): [True: 147k, False: 2.15M]
  ------------------
  390|  2.30M|               ? sf->tx_sf.intra_tx_size_search_init_depth_rect
  391|  2.30M|               : sf->tx_sf.intra_tx_size_search_init_depth_sqr;
  392|  2.30M|  }
  393|  2.45M|}
tx_search.c:select_tx_block:
 2609|   237k|    int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, int blk_idx) {
 2610|   237k|  assert(tx_size < TX_SIZES_ALL);
 2611|   237k|  av1_init_rd_stats(rd_stats);
 2612|   237k|  if (ref_best_rd < 0) {
  ------------------
  |  Branch (2612:7): [True: 0, False: 237k]
  ------------------
 2613|      0|    *is_cost_valid = 0;
 2614|      0|    return;
 2615|      0|  }
 2616|       |
 2617|   237k|  MACROBLOCKD *const xd = &x->e_mbd;
 2618|   237k|  assert(blk_row < max_block_high(xd, plane_bsize, 0) &&
 2619|   237k|         blk_col < max_block_wide(xd, plane_bsize, 0));
 2620|   237k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2621|   237k|  const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row,
 2622|   237k|                                         mbmi->bsize, tx_size);
 2623|   237k|  struct macroblock_plane *const p = &x->plane[0];
 2624|       |
 2625|   237k|  int try_no_split = (cpi->oxcf.txfm_cfg.enable_tx64 ||
  ------------------
  |  Branch (2625:23): [True: 237k, False: 0]
  ------------------
 2626|      0|                      txsize_sqr_up_map[tx_size] != TX_64X64) &&
  ------------------
  |  Branch (2626:23): [True: 0, False: 0]
  ------------------
 2627|   237k|                     (cpi->oxcf.txfm_cfg.enable_rect_tx ||
  ------------------
  |  Branch (2627:23): [True: 237k, False: 0]
  ------------------
 2628|      0|                      tx_size_wide[tx_size] == tx_size_high[tx_size]);
  ------------------
  |  Branch (2628:23): [True: 0, False: 0]
  ------------------
 2629|   237k|  int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH;
  ------------------
  |  |   56|   158k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (2629:19): [True: 158k, False: 78.5k]
  |  Branch (2629:39): [True: 136k, False: 22.0k]
  ------------------
 2630|   237k|  TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES };
 2631|       |
 2632|       |  // Prune tx_split and no-split based on sub-block properties.
 2633|   237k|  if (tx_size != TX_4X4 && try_split == 1 && try_no_split == 1 &&
  ------------------
  |  Branch (2633:7): [True: 158k, False: 78.5k]
  |  Branch (2633:28): [True: 136k, False: 22.1k]
  |  Branch (2633:46): [True: 136k, False: 18.4E]
  ------------------
 2634|   136k|      cpi->sf.tx_sf.prune_tx_size_level > 0) {
  ------------------
  |  Branch (2634:7): [True: 20.5k, False: 116k]
  ------------------
 2635|  20.5k|    prune_tx_split_no_split(x, plane_bsize, blk_row, blk_col, tx_size,
 2636|  20.5k|                            &try_no_split, &try_split,
 2637|  20.5k|                            cpi->sf.tx_sf.prune_tx_size_level);
 2638|  20.5k|  }
 2639|       |
 2640|   237k|  if (cpi->sf.rt_sf.skip_tx_no_split_var_based_partition) {
  ------------------
  |  Branch (2640:7): [True: 0, False: 237k]
  ------------------
 2641|      0|    if (x->try_merge_partition && try_split && p->eobs[block]) try_no_split = 0;
  ------------------
  |  Branch (2641:9): [True: 0, False: 0]
  |  Branch (2641:35): [True: 0, False: 0]
  |  Branch (2641:48): [True: 0, False: 0]
  ------------------
 2642|      0|  }
 2643|       |
 2644|       |  // Try using current block as a single transform block without split.
 2645|   237k|  if (try_no_split) {
  ------------------
  |  Branch (2645:7): [True: 235k, False: 2.18k]
  ------------------
 2646|   235k|    try_tx_block_no_split(cpi, x, blk_row, blk_col, block, tx_size, depth,
 2647|   235k|                          plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd,
 2648|   235k|                          ftxs_mode, &no_split);
 2649|       |
 2650|   235k|    push_inter_block_tx_no_split_rd(
 2651|   235k|        x, mbmi, no_split.rd, blk_idx,
 2652|   235k|        cpi->sf.tx_sf.prune_inter_tx_split_rd_eval_lvl);
 2653|       |
 2654|       |    // Speed features for early termination.
 2655|   235k|    const int search_level = cpi->sf.tx_sf.adaptive_txb_search_level;
 2656|   235k|    if (search_level) {
  ------------------
  |  Branch (2656:9): [True: 235k, False: 18.4E]
  ------------------
 2657|   235k|      if ((no_split.rd - (no_split.rd >> (1 + search_level))) > ref_best_rd) {
  ------------------
  |  Branch (2657:11): [True: 11.8k, False: 223k]
  ------------------
 2658|  11.8k|        *is_cost_valid = 0;
 2659|  11.8k|        return;
 2660|  11.8k|      }
 2661|   223k|      if (no_split.rd - (no_split.rd >> (2 + search_level)) > prev_level_rd) {
  ------------------
  |  Branch (2661:11): [True: 31.4k, False: 192k]
  ------------------
 2662|  31.4k|        try_split = 0;
 2663|  31.4k|      }
 2664|   223k|    }
 2665|   223k|    if (cpi->sf.tx_sf.txb_split_cap) {
  ------------------
  |  Branch (2665:9): [True: 223k, False: 18.4E]
  ------------------
 2666|   223k|      if (p->eobs[block] == 0) try_split = 0;
  ------------------
  |  Branch (2666:11): [True: 7.10k, False: 216k]
  ------------------
 2667|   223k|    }
 2668|   223k|    if (prune_tx_split_eval_using_no_split_rd(
  ------------------
  |  Branch (2668:9): [True: 0, False: 223k]
  ------------------
 2669|   223k|            x, mbmi, no_split.rd, blk_idx,
 2670|   223k|            cpi->sf.tx_sf.prune_inter_tx_split_rd_eval_lvl)) {
 2671|      0|      try_split = 0;
 2672|      0|    }
 2673|   223k|  }
 2674|       |
 2675|       |  // ML based speed feature to skip searching for split transform blocks.
 2676|   225k|  if (x->e_mbd.bd == 8 && try_split &&
  ------------------
  |  Branch (2676:7): [True: 135k, False: 90.2k]
  |  Branch (2676:27): [True: 115k, False: 19.8k]
  ------------------
 2677|   115k|      !(ref_best_rd == INT64_MAX && no_split.rd == INT64_MAX)) {
  ------------------
  |  Branch (2677:9): [True: 115k, False: 0]
  |  Branch (2677:37): [True: 0, False: 115k]
  ------------------
 2678|   115k|    const int threshold = cpi->sf.tx_sf.tx_type_search.ml_tx_split_thresh;
 2679|   115k|    if (threshold >= 0) {
  ------------------
  |  Branch (2679:9): [True: 115k, False: 0]
  ------------------
 2680|   115k|      const int split_score =
 2681|   115k|          ml_predict_tx_split(x, plane_bsize, blk_row, blk_col, tx_size);
 2682|   115k|      if (split_score < -threshold) try_split = 0;
  ------------------
  |  Branch (2682:11): [True: 109k, False: 5.97k]
  ------------------
 2683|   115k|    }
 2684|   115k|  }
 2685|       |
 2686|   225k|  RD_STATS split_rd_stats;
 2687|   225k|  split_rd_stats.rdcost = INT64_MAX;
 2688|       |  // Try splitting current block into smaller transform blocks.
 2689|   225k|  if (try_split) {
  ------------------
  |  Branch (2689:7): [True: 26.2k, False: 199k]
  ------------------
 2690|  26.2k|    try_tx_block_split(cpi, x, blk_row, blk_col, block, tx_size, depth,
 2691|  26.2k|                       plane_bsize, ta, tl, tx_above, tx_left, ctx, no_split.rd,
 2692|  26.2k|                       AOMMIN(no_split.rd, ref_best_rd), ftxs_mode,
  ------------------
  |  |   34|  26.2k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 24.0k, False: 2.18k]
  |  |  ------------------
  ------------------
 2693|  26.2k|                       &split_rd_stats);
 2694|  26.2k|  }
 2695|       |
 2696|   225k|  if (no_split.rd < split_rd_stats.rdcost) {
  ------------------
  |  Branch (2696:7): [True: 212k, False: 13.0k]
  ------------------
 2697|   212k|    ENTROPY_CONTEXT *pta = ta + blk_col;
 2698|   212k|    ENTROPY_CONTEXT *ptl = tl + blk_row;
 2699|   212k|    p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx;
 2700|   212k|    av1_set_txb_context(x, 0, block, tx_size, pta, ptl);
 2701|   212k|    txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size,
 2702|   212k|                          tx_size);
 2703|   725k|    for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idy) {
  ------------------
  |  Branch (2703:23): [True: 513k, False: 212k]
  ------------------
 2704|  2.87M|      for (int idx = 0; idx < tx_size_wide_unit[tx_size]; ++idx) {
  ------------------
  |  Branch (2704:25): [True: 2.36M, False: 513k]
  ------------------
 2705|  2.36M|        const int index =
 2706|  2.36M|            av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx);
 2707|  2.36M|        mbmi->inter_tx_size[index] = tx_size;
 2708|  2.36M|      }
 2709|   513k|    }
 2710|   212k|    mbmi->tx_size = tx_size;
 2711|   212k|    update_txk_array(xd, blk_row, blk_col, tx_size, no_split.tx_type);
 2712|   212k|  } else {
 2713|  13.0k|    *rd_stats = split_rd_stats;
 2714|  13.0k|    if (split_rd_stats.rdcost == INT64_MAX) *is_cost_valid = 0;
  ------------------
  |  Branch (2714:9): [True: 0, False: 13.0k]
  ------------------
 2715|  13.0k|  }
 2716|   225k|}
tx_search.c:prune_tx_split_no_split:
 2572|  20.5k|                                    int pruning_level) {
 2573|  20.5k|  const int diff_stride = block_size_wide[bsize];
 2574|  20.5k|  const int16_t *diff =
 2575|  20.5k|      x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col;
 2576|  20.5k|  const int bw = tx_size_wide[tx_size];
 2577|  20.5k|  const int bh = tx_size_high[tx_size];
 2578|  20.5k|  float dev_of_means = 0.0f;
 2579|  20.5k|  float var_of_vars = 0.0f;
 2580|       |
 2581|       |  // This function calculates the deviation of means, and the variance of pixel
 2582|       |  // variances of the block as well as it's sub-blocks.
 2583|  20.5k|  get_blk_var_dev(diff, diff_stride, bw, bh, &dev_of_means, &var_of_vars);
 2584|  20.5k|  const int dc_q = x->plane[0].dequant_QTX[0] >> 3;
 2585|  20.5k|  const int ac_q = x->plane[0].dequant_QTX[1] >> 3;
 2586|  20.5k|  const int no_split_thresh_scales[4] = { 0, 24, 8, 8 };
 2587|  20.5k|  const int no_split_thresh_scale = no_split_thresh_scales[pruning_level];
 2588|  20.5k|  const int split_thresh_scales[4] = { 0, 24, 10, 8 };
 2589|  20.5k|  const int split_thresh_scale = split_thresh_scales[pruning_level];
 2590|       |
 2591|  20.5k|  if ((dev_of_means <= dc_q) &&
  ------------------
  |  Branch (2591:7): [True: 12.2k, False: 8.31k]
  ------------------
 2592|  12.2k|      (split_thresh_scale * var_of_vars <= ac_q * ac_q)) {
  ------------------
  |  Branch (2592:7): [True: 206, False: 12.0k]
  ------------------
 2593|    206|    *try_split = 0;
 2594|    206|  }
 2595|  20.5k|  if ((dev_of_means > no_split_thresh_scale * dc_q) &&
  ------------------
  |  Branch (2595:7): [True: 2.18k, False: 18.3k]
  ------------------
 2596|  2.18k|      (var_of_vars > no_split_thresh_scale * ac_q * ac_q)) {
  ------------------
  |  Branch (2596:7): [True: 2.18k, False: 6]
  ------------------
 2597|  2.18k|    *try_no_split = 0;
 2598|  2.18k|  }
 2599|  20.5k|}
tx_search.c:get_blk_var_dev:
 2519|  20.5k|                                   float *var_of_vars) {
 2520|  20.5k|  const int16_t *const data_ptr = &data[0];
 2521|  20.5k|  const int subh = (bh >= bw) ? (bh >> 1) : bh;
  ------------------
  |  Branch (2521:20): [True: 17.7k, False: 2.75k]
  ------------------
 2522|  20.5k|  const int subw = (bw >= bh) ? (bw >> 1) : bw;
  ------------------
  |  Branch (2522:20): [True: 18.8k, False: 1.65k]
  ------------------
 2523|  20.5k|  const int num = bw * bh;
 2524|  20.5k|  const int sub_num = subw * subh;
 2525|  20.5k|  int total_x_sum = 0;
 2526|  20.5k|  int64_t total_x2_sum = 0;
 2527|  20.5k|  int blk_idx = 0;
 2528|  20.5k|  float var_sum = 0.0f;
 2529|  20.5k|  float mean_sum = 0.0f;
 2530|  20.5k|  double var2_sum = 0.0f;
 2531|  20.5k|  double mean2_sum = 0.0f;
 2532|       |
 2533|  58.8k|  for (int row = 0; row < bh; row += subh) {
  ------------------
  |  Branch (2533:21): [True: 38.3k, False: 20.5k]
  ------------------
 2534|   111k|    for (int col = 0; col < bw; col += subw) {
  ------------------
  |  Branch (2534:23): [True: 73.3k, False: 38.3k]
  ------------------
 2535|  73.3k|      int x_sum;
 2536|  73.3k|      int64_t x2_sum;
 2537|  73.3k|      aom_get_blk_sse_sum(data_ptr + row * stride + col, stride, subw, subh,
 2538|  73.3k|                          &x_sum, &x2_sum);
 2539|  73.3k|      total_x_sum += x_sum;
 2540|  73.3k|      total_x2_sum += x2_sum;
 2541|       |
 2542|  73.3k|      const float mean = (float)x_sum / sub_num;
 2543|  73.3k|      const float var = get_var(mean, (double)x2_sum, sub_num);
 2544|  73.3k|      mean_sum += mean;
 2545|  73.3k|      mean2_sum += (double)(mean * mean);
 2546|  73.3k|      var_sum += var;
 2547|  73.3k|      var2_sum += var * var;
 2548|  73.3k|      blk_idx++;
 2549|  73.3k|    }
 2550|  38.3k|  }
 2551|       |
 2552|  20.5k|  const float lvl0_mean = (float)total_x_sum / num;
 2553|  20.5k|  const float block_var = get_var(lvl0_mean, (double)total_x2_sum, num);
 2554|  20.5k|  mean_sum += lvl0_mean;
 2555|  20.5k|  mean2_sum += (double)(lvl0_mean * lvl0_mean);
 2556|  20.5k|  var_sum += block_var;
 2557|  20.5k|  var2_sum += block_var * block_var;
 2558|  20.5k|  const float av_mean = mean_sum / 5;
 2559|       |
 2560|  20.5k|  if (blk_idx > 1) {
  ------------------
  |  Branch (2560:7): [True: 20.5k, False: 18.4E]
  ------------------
 2561|       |    // Deviation of means.
 2562|  20.5k|    *dev_of_mean = get_dev(av_mean, mean2_sum, (blk_idx + 1));
 2563|       |    // Variance of variances.
 2564|  20.5k|    const float mean_var = var_sum / (blk_idx + 1);
 2565|  20.5k|    *var_of_vars = get_var(mean_var, var2_sum, (blk_idx + 1));
 2566|  20.5k|  }
 2567|  20.5k|}
tx_search.c:get_var:
 2511|   114k|static float get_var(float mean, double x2_sum, int num) {
 2512|   114k|  const float e_x2 = (float)(x2_sum / num);
 2513|   114k|  const float diff = e_x2 - mean * mean;
 2514|   114k|  return diff;
 2515|   114k|}
tx_search.c:get_dev:
 1681|   712k|static float get_dev(float mean, double x2_sum, int num) {
 1682|   712k|  const float e_x2 = (float)(x2_sum / num);
 1683|   712k|  const float diff = e_x2 - mean * mean;
 1684|   712k|  const float dev = (diff > 0) ? sqrtf(diff) : 0;
  ------------------
  |  Branch (1684:21): [True: 710k, False: 2.51k]
  ------------------
 1685|   712k|  return dev;
 1686|   712k|}
tx_search.c:try_tx_block_no_split:
 2414|   235k|    FAST_TX_SEARCH_MODE ftxs_mode, TxCandidateInfo *no_split) {
 2415|   235k|  MACROBLOCKD *const xd = &x->e_mbd;
 2416|   235k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2417|   235k|  struct macroblock_plane *const p = &x->plane[0];
 2418|   235k|  const ENTROPY_CONTEXT *const pta = ta + blk_col;
 2419|   235k|  const ENTROPY_CONTEXT *const ptl = tl + blk_row;
 2420|   235k|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
 2421|   235k|  TXB_CTX txb_ctx;
 2422|   235k|  get_txb_ctx(plane_bsize, tx_size, 0, pta, ptl, &txb_ctx);
 2423|   235k|  const int zero_blk_rate = x->coeff_costs.coeff_costs[txs_ctx][PLANE_TYPE_Y]
 2424|   235k|                                .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
 2425|   235k|  rd_stats->zero_rate = zero_blk_rate;
 2426|   235k|  const int index = av1_get_txb_size_index(plane_bsize, blk_row, blk_col);
 2427|   235k|  mbmi->inter_tx_size[index] = tx_size;
 2428|   235k|  tx_type_rd(cpi, x, tx_size, blk_row, blk_col, block, plane_bsize, &txb_ctx,
 2429|   235k|             rd_stats, ftxs_mode, ref_best_rd);
 2430|   235k|  assert(rd_stats->rate < INT_MAX);
 2431|       |
 2432|   235k|  const int pick_skip_txfm =
 2433|   235k|      !xd->lossless[mbmi->segment_id] &&
  ------------------
  |  Branch (2433:7): [True: 235k, False: 18.4E]
  ------------------
 2434|   235k|      (rd_stats->skip_txfm == 1 ||
  ------------------
  |  Branch (2434:8): [True: 4.36k, False: 230k]
  ------------------
 2435|   230k|       RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >=
  ------------------
  |  |   33|   230k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   230k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   230k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   230k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2435:8): [True: 4.55k, False: 226k]
  ------------------
 2436|   230k|           RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse));
  ------------------
  |  |   33|   230k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   230k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   230k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   230k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2437|   235k|  if (pick_skip_txfm) {
  ------------------
  |  Branch (2437:7): [True: 8.92k, False: 226k]
  ------------------
 2438|       |#if CONFIG_RD_DEBUG
 2439|       |    update_txb_coeff_cost(rd_stats, 0, zero_blk_rate - rd_stats->rate);
 2440|       |#endif  // CONFIG_RD_DEBUG
 2441|  8.92k|    rd_stats->rate = zero_blk_rate;
 2442|  8.92k|    rd_stats->dist = rd_stats->sse;
 2443|  8.92k|    p->eobs[block] = 0;
 2444|  8.92k|    update_txk_array(xd, blk_row, blk_col, tx_size, DCT_DCT);
 2445|  8.92k|  }
 2446|   235k|  rd_stats->skip_txfm = pick_skip_txfm;
 2447|       |
 2448|   235k|  if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH)
  ------------------
  |  |   56|   156k|#define MAX_VARTX_DEPTH 2
  ------------------
  |  Branch (2448:7): [True: 156k, False: 78.5k]
  |  Branch (2448:27): [True: 134k, False: 22.1k]
  ------------------
 2449|   134k|    rd_stats->rate += x->mode_costs.txfm_partition_cost[txfm_partition_ctx][0];
 2450|       |
 2451|   235k|  no_split->rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
  ------------------
  |  |   33|   235k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   235k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   235k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   235k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2452|   235k|  no_split->txb_entropy_ctx = p->txb_entropy_ctx[block];
 2453|   235k|  no_split->tx_type =
 2454|   235k|      xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
 2455|   235k|}
tx_search.c:tx_type_rd:
 2400|   235k|                              int64_t ref_rdcost) {
 2401|   235k|  assert(is_inter_block(x->e_mbd.mi[0]));
 2402|   235k|  RD_STATS this_rd_stats;
 2403|   235k|  search_tx_type(cpi, x, 0, block, blk_row, blk_col, plane_bsize, tx_size,
 2404|   235k|                 txb_ctx, ftxs_mode, ref_rdcost, &this_rd_stats);
 2405|       |
 2406|   235k|  av1_merge_rd_stats(rd_stats, &this_rd_stats);
 2407|   235k|}
tx_search.c:search_tx_type:
 2068|  65.3M|                           RD_STATS *best_rd_stats) {
 2069|  65.3M|  const AV1_COMMON *cm = &cpi->common;
 2070|  65.3M|  MACROBLOCKD *xd = &x->e_mbd;
 2071|  65.3M|  MB_MODE_INFO *mbmi = xd->mi[0];
 2072|  65.3M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 2073|  65.3M|  int64_t best_rd = INT64_MAX;
 2074|  65.3M|  uint16_t best_eob = 0;
 2075|  65.3M|  TX_TYPE best_tx_type = DCT_DCT;
 2076|  65.3M|  int rate_cost = 0;
 2077|  65.3M|  struct macroblock_plane *const p = &x->plane[plane];
 2078|  65.3M|  tran_low_t *orig_dqcoeff = p->dqcoeff;
 2079|  65.3M|  tran_low_t *best_dqcoeff = x->dqcoeff_buf;
 2080|  65.3M|  const int tx_type_map_idx =
 2081|  65.3M|      plane ? 0 : blk_row * xd->tx_type_map_stride + blk_col;
  ------------------
  |  Branch (2081:7): [True: 31.2M, False: 34.1M]
  ------------------
 2082|  65.3M|  av1_invalid_rd_stats(best_rd_stats);
 2083|       |
 2084|  65.3M|  int skip_trellis = !is_trellis_used(
 2085|  65.3M|      cpi->optimize_seg_arr[xd->mi[0]->segment_id], DRY_RUN_NORMAL);
 2086|       |
 2087|  65.3M|  uint8_t best_txb_ctx = 0;
 2088|       |  // txk_allowed = TX_TYPES: >1 tx types are allowed
 2089|       |  // txk_allowed < TX_TYPES: only that specific tx type is allowed.
 2090|  65.3M|  TX_TYPE txk_allowed = TX_TYPES;
 2091|  65.3M|  int txk_map[TX_TYPES] = {
 2092|  65.3M|    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
 2093|  65.3M|  };
 2094|  65.3M|  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  ------------------
  |  Branch (2094:29): [True: 22.0M, False: 43.3M]
  ------------------
 2095|  65.3M|  const int qstep = x->plane[plane].dequant_QTX[1] >> dequant_shift;
 2096|       |
 2097|  65.3M|  const uint8_t txw = tx_size_wide[tx_size];
 2098|  65.3M|  const uint8_t txh = tx_size_high[tx_size];
 2099|  65.3M|  int64_t block_sse;
 2100|  65.3M|  unsigned int block_mse_q8;
 2101|  65.3M|  int dc_only_blk = 0;
 2102|  65.3M|  const bool predict_dc_block =
 2103|  65.3M|      txfm_params->predict_dc_level >= 1 && txw != 64 && txh != 64;
  ------------------
  |  Branch (2103:7): [True: 63.5M, False: 1.81M]
  |  Branch (2103:45): [True: 63.5M, False: 24.3k]
  |  Branch (2103:58): [True: 63.5M, False: 2.34k]
  ------------------
 2104|  65.3M|  int64_t per_px_mean = INT64_MAX;
 2105|       |
 2106|  65.3M|  int is_border_block = 0;
 2107|  65.3M|  if (cpi->do_border_pad) {
  ------------------
  |  Branch (2107:7): [True: 1.69M, False: 63.6M]
  ------------------
 2108|  1.69M|    is_border_block =
 2109|  1.69M|        get_visible_dimensions(x, plane, plane_bsize, blk_col, blk_row, txw,
 2110|  1.69M|                               txh, /*clip_dims=*/true, NULL, NULL);
 2111|  1.69M|    if (is_border_block)
  ------------------
  |  Branch (2111:9): [True: 636k, False: 1.05M]
  ------------------
 2112|   636k|      av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size,
 2113|   636k|                       best_tx_type, cpi->do_border_pad);
 2114|  1.69M|  }
 2115|       |
 2116|  65.3M|  if (predict_dc_block) {
  ------------------
  |  Branch (2116:7): [True: 63.5M, False: 1.82M]
  ------------------
 2117|  63.5M|    predict_dc_only_block(x, plane, plane_bsize, tx_size, block, blk_row,
 2118|  63.5M|                          blk_col, best_rd_stats, &block_sse, &block_mse_q8,
 2119|  63.5M|                          &per_px_mean, &dc_only_blk);
 2120|  63.5M|    if (best_rd_stats->skip_txfm == 1) {
  ------------------
  |  Branch (2120:9): [True: 1.26M, False: 62.2M]
  ------------------
 2121|  1.26M|      const TX_TYPE tx_type = DCT_DCT;
 2122|  1.26M|      if (plane == 0) xd->tx_type_map[tx_type_map_idx] = tx_type;
  ------------------
  |  Branch (2122:11): [True: 865k, False: 400k]
  ------------------
 2123|  1.26M|      return;
 2124|  1.26M|    }
 2125|  63.5M|  } else {
 2126|  1.82M|    block_sse = av1_pixel_diff_dist(x, plane, blk_row, blk_col, plane_bsize,
 2127|  1.82M|                                    txsize_to_bsize[tx_size], &block_mse_q8);
 2128|  1.82M|    assert(block_mse_q8 != UINT_MAX);
 2129|  1.82M|  }
 2130|       |
 2131|       |  // Bit mask to indicate which transform types are allowed in the RD search.
 2132|  64.1M|  uint16_t tx_mask;
 2133|       |
 2134|       |  // Use DCT_DCT transform for DC only block.
 2135|  64.1M|  if (dc_only_blk || cpi->sf.rt_sf.dct_only_palette_nonrd == 1)
  ------------------
  |  Branch (2135:7): [True: 2.11M, False: 61.9M]
  |  Branch (2135:22): [True: 18.4E, False: 61.9M]
  ------------------
 2136|  2.01M|    tx_mask = 1 << DCT_DCT;
 2137|  62.0M|  else
 2138|  62.0M|    tx_mask = get_tx_mask(cpi, x, plane, block, blk_row, blk_col, plane_bsize,
 2139|  62.0M|                          tx_size, txb_ctx, ftxs_mode, ref_best_rd,
 2140|  62.0M|                          &txk_allowed, txk_map);
 2141|  64.1M|  const uint16_t allowed_tx_mask = tx_mask;
 2142|       |
 2143|  64.1M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (2143:7): [True: 21.2M, False: 42.8M]
  ------------------
 2144|  21.2M|    block_sse = ROUND_POWER_OF_TWO(block_sse, (xd->bd - 8) * 2);
  ------------------
  |  |   41|  21.2M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2145|  21.2M|    block_mse_q8 = ROUND_POWER_OF_TWO(block_mse_q8, (xd->bd - 8) * 2);
  ------------------
  |  |   41|  21.2M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2146|  21.2M|  }
 2147|  64.1M|  block_sse *= 16;
 2148|       |  // Use mse / qstep^2 based threshold logic to take decision of R-D
 2149|       |  // optimization of coeffs. For smaller residuals, coeff optimization
 2150|       |  // would be helpful. For larger residuals, R-D optimization may not be
 2151|       |  // effective.
 2152|       |  // TODO(any): Experiment with variance and mean based thresholds
 2153|  64.1M|  const int perform_block_coeff_opt =
 2154|  64.1M|      ((uint64_t)block_mse_q8 <=
 2155|  64.1M|       (uint64_t)txfm_params->coeff_opt_thresholds[0] * qstep * qstep);
 2156|  64.1M|  skip_trellis |= !perform_block_coeff_opt;
 2157|       |
 2158|       |  // Flag to indicate if distortion should be calculated in transform domain or
 2159|       |  // not during iterating through transform type candidates.
 2160|       |  // Transform domain distortion is accurate for higher residuals.
 2161|       |  // TODO(any): Experiment with variance and mean based thresholds
 2162|  64.1M|  int use_transform_domain_distortion =
 2163|  64.1M|      (txfm_params->use_transform_domain_distortion > 0) &&
  ------------------
  |  Branch (2163:7): [True: 61.7M, False: 2.40M]
  ------------------
 2164|  61.7M|      (block_mse_q8 >= txfm_params->tx_domain_dist_threshold) &&
  ------------------
  |  Branch (2164:7): [True: 61.5M, False: 137k]
  ------------------
 2165|       |      // Any 64-pt transforms only preserves half the coefficients.
 2166|       |      // Therefore transform domain distortion is not valid for these
 2167|       |      // transform sizes.
 2168|  61.5M|      (txsize_sqr_up_map[tx_size] != TX_64X64) &&
  ------------------
  |  Branch (2168:7): [True: 61.5M, False: 21.3k]
  ------------------
 2169|       |      // Use pixel domain distortion for DC only blocks
 2170|  61.5M|      !dc_only_blk;
  ------------------
  |  Branch (2170:7): [True: 59.7M, False: 1.84M]
  ------------------
 2171|       |  // Flag to indicate if an extra calculation of distortion in the pixel domain
 2172|       |  // should be performed at the end, after the best transform type has been
 2173|       |  // decided.
 2174|  64.1M|  int calc_pixel_domain_distortion_final =
 2175|  64.1M|      txfm_params->use_transform_domain_distortion == 1 &&
  ------------------
  |  Branch (2175:7): [True: 54.4M, False: 9.69M]
  ------------------
 2176|  54.4M|      use_transform_domain_distortion && x->rd_model != LOW_TXFM_RD;
  ------------------
  |  Branch (2176:7): [True: 52.5M, False: 1.82M]
  |  Branch (2176:42): [True: 52.6M, False: 18.4E]
  ------------------
 2177|  64.1M|  if (calc_pixel_domain_distortion_final &&
  ------------------
  |  Branch (2177:7): [True: 52.6M, False: 11.5M]
  ------------------
 2178|  52.6M|      (txk_allowed < TX_TYPES || allowed_tx_mask == 0x0001))
  ------------------
  |  Branch (2178:8): [True: 32.7M, False: 19.8M]
  |  Branch (2178:34): [True: 72.2k, False: 19.8M]
  ------------------
 2179|  32.9M|    calc_pixel_domain_distortion_final = use_transform_domain_distortion = 0;
 2180|       |
 2181|  64.1M|  const uint16_t *eobs_ptr = x->plane[plane].eobs;
 2182|       |
 2183|  64.1M|  TxfmParam txfm_param;
 2184|  64.1M|  QUANT_PARAM quant_param;
 2185|  64.1M|  int skip_trellis_based_on_satd[TX_TYPES] = { 0 };
 2186|  64.1M|  av1_setup_xform(cm, x, tx_size, DCT_DCT, &txfm_param);
 2187|  64.1M|  av1_setup_quant(tx_size, !skip_trellis,
 2188|  64.1M|                  skip_trellis ? (USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B
  ------------------
  |  |   34|  50.6M|#define USE_B_QUANT_NO_TRELLIS 1
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 63.7M, Folded]
  |  |  ------------------
  ------------------
  |  Branch (2188:19): [True: 50.6M, False: 13.4M]
  ------------------
 2189|  18.4E|                                                         : AV1_XFORM_QUANT_FP)
 2190|  64.1M|                               : AV1_XFORM_QUANT_FP,
 2191|  64.1M|                  cpi->oxcf.q_cfg.quant_b_adapt, &quant_param);
 2192|       |
 2193|       |  // Iterate through all transform type candidates.
 2194|   984M|  for (int idx = 0; idx < TX_TYPES; ++idx) {
  ------------------
  |  Branch (2194:21): [True: 926M, False: 58.0M]
  ------------------
 2195|   926M|    const TX_TYPE tx_type = (TX_TYPE)txk_map[idx];
 2196|   926M|    if (tx_type == TX_TYPE_INVALID || !check_bit_mask(allowed_tx_mask, tx_type))
  ------------------
  |  Branch (2196:9): [True: 10.7M, False: 916M]
  |  Branch (2196:39): [True: 800M, False: 115M]
  ------------------
 2197|   815M|      continue;
 2198|   111M|    txfm_param.tx_type = tx_type;
 2199|   111M|    if (av1_use_qmatrix(&cm->quant_params, xd, mbmi->segment_id)) {
  ------------------
  |  Branch (2199:9): [True: 94.8M, False: 16.8M]
  ------------------
 2200|  94.8M|      av1_setup_qmatrix(&cm->quant_params, xd, plane, tx_size, tx_type,
 2201|  94.8M|                        &quant_param);
 2202|  94.8M|    }
 2203|   111M|    if (plane == 0) xd->tx_type_map[tx_type_map_idx] = tx_type;
  ------------------
  |  Branch (2203:9): [True: 85.2M, False: 26.4M]
  ------------------
 2204|   111M|    RD_STATS this_rd_stats;
 2205|   111M|    av1_invalid_rd_stats(&this_rd_stats);
 2206|       |
 2207|   111M|    if (is_border_block)
  ------------------
  |  Branch (2207:9): [True: 882k, False: 110M]
  ------------------
 2208|   882k|      av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size,
 2209|   882k|                       tx_type, cpi->do_border_pad);
 2210|       |
 2211|   111M|    if (!dc_only_blk)
  ------------------
  |  Branch (2211:9): [True: 113M, False: 18.4E]
  ------------------
 2212|   113M|      av1_xform(x, plane, block, blk_row, blk_col, plane_bsize, &txfm_param);
 2213|  18.4E|    else
 2214|  18.4E|      av1_xform_dc_only(x, plane, block, &txfm_param, per_px_mean);
 2215|       |
 2216|   111M|    skip_trellis_based_on_satd[tx_type] = skip_trellis_opt_based_on_satd(
 2217|   111M|        x, &quant_param, plane, block, tx_size, cpi->oxcf.q_cfg.quant_b_adapt,
 2218|   111M|        qstep, txfm_params->coeff_opt_thresholds[1], skip_trellis, dc_only_blk);
 2219|       |
 2220|   111M|    av1_quant(x, plane, block, &txfm_param, &quant_param);
 2221|       |
 2222|       |    // Calculate rate cost of quantized coefficients.
 2223|   111M|    if (quant_param.use_optimize_b) {
  ------------------
  |  Branch (2223:9): [True: 42.3M, False: 69.4M]
  ------------------
 2224|       |      // TODO(aomedia:3209): update Trellis quantization to take into account
 2225|       |      // quantization matrices.
 2226|  42.3M|      av1_optimize_b(cpi, x, plane, block, tx_size, tx_type, txb_ctx,
 2227|  42.3M|                     &rate_cost);
 2228|  69.4M|    } else {
 2229|  69.4M|      rate_cost = cost_coeffs(x, plane, block, tx_size, tx_type, txb_ctx,
 2230|  69.4M|                              cm->features.reduced_tx_set_used);
 2231|  69.4M|    }
 2232|       |
 2233|       |    // If rd cost based on coeff rate alone is already more than best_rd,
 2234|       |    // terminate early.
 2235|   111M|    if (RDCOST(x->rdmult, rate_cost, 0) > best_rd) continue;
  ------------------
  |  |   33|   111M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   111M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   111M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   111M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2235:9): [True: 7.06M, False: 104M]
  ------------------
 2236|       |
 2237|       |    // Calculate distortion.
 2238|   104M|    if (eobs_ptr[block] == 0) {
  ------------------
  |  Branch (2238:9): [True: 4.94M, False: 99.7M]
  ------------------
 2239|       |      // When eob is 0, pixel domain distortion is more efficient and accurate.
 2240|  4.94M|      this_rd_stats.dist = this_rd_stats.sse = block_sse;
 2241|  99.7M|    } else if (dc_only_blk) {
  ------------------
  |  Branch (2241:16): [True: 992k, False: 98.7M]
  ------------------
 2242|   992k|      this_rd_stats.sse = block_sse;
 2243|   992k|      this_rd_stats.dist = dist_block_px_domain(
 2244|   992k|          cpi, x, plane, plane_bsize, block, blk_row, blk_col, tx_size);
 2245|  98.7M|    } else if (use_transform_domain_distortion) {
  ------------------
  |  Branch (2245:16): [True: 63.9M, False: 34.8M]
  ------------------
 2246|  63.9M|      const SCAN_ORDER *const scan_order =
 2247|  63.9M|          get_scan(txfm_param.tx_size, txfm_param.tx_type);
 2248|  63.9M|      dist_block_tx_domain(x, plane, block, tx_size, quant_param.qmatrix,
 2249|  63.9M|                           scan_order->scan, &this_rd_stats.dist,
 2250|  63.9M|                           &this_rd_stats.sse);
 2251|  63.9M|    } else {
 2252|  34.8M|      int64_t sse_diff = INT64_MAX;
 2253|       |      // high_energy threshold assumes that every pixel within a txfm block
 2254|       |      // has a residue energy of at least 25% of the maximum, i.e. 128 * 128
 2255|       |      // for 8 bit.
 2256|  34.8M|      const int64_t high_energy_thresh =
 2257|  34.8M|          ((int64_t)128 * 128 * tx_size_2d[tx_size]);
 2258|  34.8M|      const int is_high_energy = (block_sse >= high_energy_thresh);
 2259|  39.5M|      if (tx_size == TX_64X64 || is_high_energy) {
  ------------------
  |  Branch (2259:11): [True: 18.4E, False: 39.5M]
  |  Branch (2259:34): [True: 36.5M, False: 3.01M]
  ------------------
 2260|       |        // Because 3 out 4 quadrants of transform coefficients are forced to
 2261|       |        // zero, the inverse transform has a tendency to overflow. sse_diff
 2262|       |        // is effectively the energy of those 3 quadrants, here we use it
 2263|       |        // to decide if we should do pixel domain distortion. If the energy
 2264|       |        // is mostly in first quadrant, then it is unlikely that we have
 2265|       |        // overflow issue in inverse transform.
 2266|  36.5M|        const SCAN_ORDER *const scan_order =
 2267|  36.5M|            get_scan(txfm_param.tx_size, txfm_param.tx_type);
 2268|  36.5M|        dist_block_tx_domain(x, plane, block, tx_size, quant_param.qmatrix,
 2269|  36.5M|                             scan_order->scan, &this_rd_stats.dist,
 2270|  36.5M|                             &this_rd_stats.sse);
 2271|  36.5M|        sse_diff = block_sse - this_rd_stats.sse;
 2272|  36.5M|      }
 2273|  34.8M|      if (tx_size != TX_64X64 || !is_high_energy ||
  ------------------
  |  Branch (2273:11): [True: 34.7M, False: 25.4k]
  |  Branch (2273:34): [True: 2.71k, False: 22.7k]
  ------------------
 2274|  39.6M|          (sse_diff * 2) < this_rd_stats.sse) {
  ------------------
  |  Branch (2274:11): [True: 4.80k, False: 17.8k]
  ------------------
 2275|  39.6M|        const int64_t tx_domain_dist = this_rd_stats.dist;
 2276|  39.6M|        this_rd_stats.dist = dist_block_px_domain(
 2277|  39.6M|            cpi, x, plane, plane_bsize, block, blk_row, blk_col, tx_size);
 2278|       |        // For high energy blocks, occasionally, the pixel domain distortion
 2279|       |        // can be artificially low due to clamping at reconstruction stage
 2280|       |        // even when inverse transform output is hugely different from the
 2281|       |        // actual residue.
 2282|  39.6M|        if (is_high_energy && this_rd_stats.dist < tx_domain_dist)
  ------------------
  |  Branch (2282:13): [True: 36.4M, False: 3.14M]
  |  Branch (2282:31): [True: 6.01M, False: 30.4M]
  ------------------
 2283|  6.01M|          this_rd_stats.dist = tx_domain_dist;
 2284|  18.4E|      } else {
 2285|  18.4E|        assert(sse_diff < INT64_MAX);
 2286|  18.4E|        this_rd_stats.dist += sse_diff;
 2287|  18.4E|      }
 2288|  34.8M|      this_rd_stats.sse = block_sse;
 2289|  34.8M|    }
 2290|       |
 2291|   104M|    this_rd_stats.rate = rate_cost;
 2292|       |
 2293|   104M|    const int64_t rd =
 2294|   104M|        RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);
  ------------------
  |  |   33|   104M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   104M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   104M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   104M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2295|       |
 2296|   104M|    if (rd < best_rd) {
  ------------------
  |  Branch (2296:9): [True: 80.2M, False: 24.4M]
  ------------------
 2297|  80.2M|      best_rd = rd;
 2298|  80.2M|      *best_rd_stats = this_rd_stats;
 2299|  80.2M|      best_tx_type = tx_type;
 2300|  80.2M|      best_txb_ctx = x->plane[plane].txb_entropy_ctx[block];
 2301|  80.2M|      best_eob = x->plane[plane].eobs[block];
 2302|       |      // Swap dqcoeff buffers
 2303|  80.2M|      tran_low_t *const tmp_dqcoeff = best_dqcoeff;
 2304|  80.2M|      best_dqcoeff = p->dqcoeff;
 2305|  80.2M|      p->dqcoeff = tmp_dqcoeff;
 2306|  80.2M|    }
 2307|       |
 2308|       |#if CONFIG_COLLECT_RD_STATS == 1
 2309|       |    if (plane == 0) {
 2310|       |      PrintTransformUnitStats(cpi, x, &this_rd_stats, blk_row, blk_col,
 2311|       |                              plane_bsize, tx_size, tx_type, rd);
 2312|       |    }
 2313|       |#endif  // CONFIG_COLLECT_RD_STATS == 1
 2314|       |
 2315|       |#if COLLECT_TX_SIZE_DATA
 2316|       |    // Generate small sample to restrict output size.
 2317|       |    static unsigned int seed = 21743;
 2318|       |    if (lcg_rand16(&seed) % 200 == 0) {
 2319|       |      FILE *fp = NULL;
 2320|       |
 2321|       |      if (within_border) {
 2322|       |        fp = fopen(av1_tx_size_data_output_file, "a");
 2323|       |      }
 2324|       |
 2325|       |      if (fp) {
 2326|       |        // Transform info and RD
 2327|       |        const int txb_w = tx_size_wide[tx_size];
 2328|       |        const int txb_h = tx_size_high[tx_size];
 2329|       |
 2330|       |        // Residue signal.
 2331|       |        const int diff_stride = block_size_wide[plane_bsize];
 2332|       |        struct macroblock_plane *const p = &x->plane[plane];
 2333|       |        const int16_t *src_diff =
 2334|       |            &p->src_diff[(blk_row * diff_stride + blk_col) * 4];
 2335|       |
 2336|       |        for (int r = 0; r < txb_h; ++r) {
 2337|       |          for (int c = 0; c < txb_w; ++c) {
 2338|       |            fprintf(fp, "%d,", src_diff[c]);
 2339|       |          }
 2340|       |          src_diff += diff_stride;
 2341|       |        }
 2342|       |
 2343|       |        fprintf(fp, "%d,%d,%d,%" PRId64, txb_w, txb_h, tx_type, rd);
 2344|       |        fprintf(fp, "\n");
 2345|       |        fclose(fp);
 2346|       |      }
 2347|       |    }
 2348|       |#endif  // COLLECT_TX_SIZE_DATA
 2349|       |
 2350|       |    // If the current best RD cost is much worse than the reference RD cost,
 2351|       |    // terminate early.
 2352|   109M|    if (cpi->sf.tx_sf.adaptive_txb_search_level) {
  ------------------
  |  Branch (2352:9): [True: 109M, False: 18.4E]
  ------------------
 2353|   109M|      if ((best_rd - (best_rd >> cpi->sf.tx_sf.adaptive_txb_search_level)) >
  ------------------
  |  Branch (2353:11): [True: 1.57M, False: 108M]
  ------------------
 2354|   109M|          ref_best_rd) {
 2355|  1.57M|        break;
 2356|  1.57M|      }
 2357|   109M|    }
 2358|       |
 2359|       |    // Terminate transform type search if the block has been quantized to
 2360|       |    // all zero.
 2361|   108M|    if (cpi->sf.tx_sf.tx_type_search.skip_tx_search && !best_eob) break;
  ------------------
  |  Branch (2361:9): [True: 108M, False: 18.4E]
  |  Branch (2361:56): [True: 4.51M, False: 103M]
  ------------------
 2362|   103M|  }
 2363|       |
 2364|  64.1M|  assert(best_rd != INT64_MAX);
 2365|       |
 2366|  64.1M|  best_rd_stats->skip_txfm = best_eob == 0;
 2367|  64.1M|  if (plane == 0) update_txk_array(xd, blk_row, blk_col, tx_size, best_tx_type);
  ------------------
  |  Branch (2367:7): [True: 33.3M, False: 30.7M]
  ------------------
 2368|  64.1M|  x->plane[plane].txb_entropy_ctx[block] = best_txb_ctx;
 2369|  64.1M|  x->plane[plane].eobs[block] = best_eob;
 2370|  64.1M|  skip_trellis = skip_trellis_based_on_satd[best_tx_type];
 2371|       |
 2372|       |  // Point dqcoeff to the quantized coefficients corresponding to the best
 2373|       |  // transform type, then we can skip transform and quantization, e.g. in the
 2374|       |  // final pixel domain distortion calculation and recon_intra().
 2375|  64.1M|  p->dqcoeff = best_dqcoeff;
 2376|       |
 2377|  64.1M|  if (calc_pixel_domain_distortion_final && best_eob) {
  ------------------
  |  Branch (2377:7): [True: 19.8M, False: 44.2M]
  |  Branch (2377:45): [True: 19.0M, False: 733k]
  ------------------
 2378|  19.0M|    best_rd_stats->dist = dist_block_px_domain(
 2379|  19.0M|        cpi, x, plane, plane_bsize, block, blk_row, blk_col, tx_size);
 2380|  19.0M|    best_rd_stats->sse = block_sse;
 2381|  19.0M|  }
 2382|       |
 2383|  64.1M|  if (is_border_block)
  ------------------
  |  Branch (2383:7): [True: 593k, False: 63.5M]
  ------------------
 2384|   593k|    av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size,
 2385|   593k|                     best_tx_type, cpi->do_border_pad);
 2386|       |
 2387|       |  // Intra mode needs decoded pixels such that the next transform block
 2388|       |  // can use them for prediction.
 2389|  64.1M|  recon_intra(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
 2390|  64.1M|              txb_ctx, skip_trellis, best_tx_type, 0, &rate_cost, best_eob);
 2391|  64.1M|  p->dqcoeff = orig_dqcoeff;
 2392|  64.1M|}
tx_search.c:predict_dc_only_block:
 2002|  63.5M|    int *dc_only_blk) {
 2003|  63.5M|  MACROBLOCKD *xd = &x->e_mbd;
 2004|  63.5M|  MB_MODE_INFO *mbmi = xd->mi[0];
 2005|  63.5M|  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  ------------------
  |  Branch (2005:29): [True: 21.8M, False: 41.6M]
  ------------------
 2006|  63.5M|  const int qstep = x->plane[plane].dequant_QTX[1] >> dequant_shift;
 2007|  63.5M|  uint64_t block_var = UINT64_MAX;
 2008|  63.5M|  const int dc_qstep = x->plane[plane].dequant_QTX[0] >> 3;
 2009|  63.5M|  *block_sse = pixel_diff_stats(x, plane, blk_row, blk_col, plane_bsize,
 2010|  63.5M|                                txsize_to_bsize[tx_size], block_mse_q8,
 2011|  63.5M|                                per_px_mean, &block_var);
 2012|  63.5M|  assert((*block_mse_q8) != UINT_MAX);
 2013|  63.5M|  uint64_t var_threshold = (uint64_t)(1.8 * qstep * qstep);
 2014|  63.5M|  if (is_cur_buf_hbd(xd))
  ------------------
  |  Branch (2014:7): [True: 21.8M, False: 41.6M]
  ------------------
 2015|  21.8M|    block_var = ROUND_POWER_OF_TWO(block_var, (xd->bd - 8) * 2);
  ------------------
  |  |   41|  21.8M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2016|       |
 2017|  63.5M|  if (block_var >= var_threshold) return;
  ------------------
  |  Branch (2017:7): [True: 58.2M, False: 5.25M]
  ------------------
 2018|  5.25M|  const unsigned int predict_dc_level = x->txfm_search_params.predict_dc_level;
 2019|  5.25M|  assert(predict_dc_level != 0);
 2020|       |
 2021|       |  // Prediction of skip block if residual mean and variance are less
 2022|       |  // than qstep based threshold
 2023|  5.25M|  if ((llabs(*per_px_mean) * dc_coeff_scale[tx_size]) < (dc_qstep << 12)) {
  ------------------
  |  Branch (2023:7): [True: 1.26M, False: 3.98M]
  ------------------
 2024|       |    // If the normalized mean of residual block is less than the dc qstep and
 2025|       |    // the  normalized block variance is less than ac qstep, then the block is
 2026|       |    // assumed to be a skip block and its rdcost is updated accordingly.
 2027|  1.26M|    best_rd_stats->skip_txfm = 1;
 2028|       |
 2029|  1.26M|    x->plane[plane].eobs[block] = 0;
 2030|       |
 2031|  1.26M|    if (is_cur_buf_hbd(xd))
  ------------------
  |  Branch (2031:9): [True: 751k, False: 514k]
  ------------------
 2032|   751k|      *block_sse = ROUND_POWER_OF_TWO((*block_sse), (xd->bd - 8) * 2);
  ------------------
  |  |   41|   751k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2033|       |
 2034|  1.26M|    best_rd_stats->dist = (*block_sse) << 4;
 2035|  1.26M|    best_rd_stats->sse = best_rd_stats->dist;
 2036|       |
 2037|  1.26M|    ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
 2038|  1.26M|    ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
 2039|  1.26M|    av1_get_entropy_contexts(plane_bsize, &xd->plane[plane], ctxa, ctxl);
 2040|  1.26M|    ENTROPY_CONTEXT *ta = ctxa;
 2041|  1.26M|    ENTROPY_CONTEXT *tl = ctxl;
 2042|  1.26M|    const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
 2043|  1.26M|    TXB_CTX txb_ctx_tmp;
 2044|  1.26M|    const PLANE_TYPE plane_type = get_plane_type(plane);
 2045|  1.26M|    get_txb_ctx(plane_bsize, tx_size, plane, ta, tl, &txb_ctx_tmp);
 2046|  1.26M|    const int zero_blk_rate = x->coeff_costs.coeff_costs[txs_ctx][plane_type]
 2047|  1.26M|                                  .txb_skip_cost[txb_ctx_tmp.txb_skip_ctx][1];
 2048|  1.26M|    best_rd_stats->rate = zero_blk_rate;
 2049|       |
 2050|  1.26M|    best_rd_stats->rdcost =
 2051|  1.26M|        RDCOST(x->rdmult, best_rd_stats->rate, best_rd_stats->sse);
  ------------------
  |  |   33|  1.26M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  1.26M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  1.26M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  1.26M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2052|       |
 2053|  1.26M|    x->plane[plane].txb_entropy_ctx[block] = 0;
 2054|  3.98M|  } else if (predict_dc_level > 1) {
  ------------------
  |  Branch (2054:14): [True: 3.95M, False: 27.5k]
  ------------------
 2055|       |    // Predict DC only blocks based on residual variance.
 2056|       |    // For chroma plane, this prediction is disabled for intra blocks.
 2057|  3.95M|    if ((plane == 0) || (plane > 0 && is_inter_block(mbmi))) *dc_only_blk = 1;
  ------------------
  |  Branch (2057:9): [True: 1.77M, False: 2.17M]
  |  Branch (2057:26): [True: 2.17M, False: 18.4E]
  |  Branch (2057:39): [True: 233k, False: 1.94M]
  ------------------
 2058|  3.95M|  }
 2059|  5.25M|}
tx_search.c:pixel_diff_stats:
  158|  63.4M|    unsigned int *block_mse_q8, int64_t *per_px_mean, uint64_t *block_var) {
  159|  63.4M|  int visible_rows, visible_cols;
  160|  63.4M|  const int txb_cols = block_size_wide[tx_bsize];
  161|  63.4M|  const int txb_rows = block_size_high[tx_bsize];
  162|  63.4M|  get_visible_dimensions(x, plane, plane_bsize, blk_col, blk_row, txb_cols,
  163|  63.4M|                         txb_rows, /*clip_dims=*/true, &visible_cols,
  164|  63.4M|                         &visible_rows);
  165|       |
  166|  63.4M|  uint64_t sse = 0;
  167|  63.4M|  if (visible_cols > 0 && visible_rows > 0) {
  ------------------
  |  Branch (167:7): [True: 63.3M, False: 27.7k]
  |  Branch (167:27): [True: 63.3M, False: 56.6k]
  ------------------
  168|  63.3M|    const int diff_stride = block_size_wide[plane_bsize];
  169|  63.3M|    const int16_t *diff = x->plane[plane].src_diff;
  170|       |
  171|  63.3M|    diff += ((blk_row * diff_stride + blk_col) << MI_SIZE_LOG2);
  ------------------
  |  |   39|  63.3M|#define MI_SIZE_LOG2 2
  ------------------
  172|  63.3M|    int sum = 0;
  173|  63.3M|    sse =
  174|  63.3M|        aom_sum_sse_2d_i16(diff, diff_stride, visible_cols, visible_rows, &sum);
  175|  63.3M|    double norm_factor = 1.0 / (visible_cols * visible_rows);
  176|  63.3M|    int sign_sum = sum > 0 ? 1 : -1;
  ------------------
  |  Branch (176:20): [True: 30.9M, False: 32.3M]
  ------------------
  177|       |    // Conversion to transform domain
  178|  63.3M|    *per_px_mean = (int64_t)(norm_factor * abs(sum)) << 7;
  179|  63.3M|    *per_px_mean = sign_sum * (*per_px_mean);
  180|  63.3M|    *block_mse_q8 = (unsigned int)(norm_factor * (256 * sse));
  181|  63.3M|    *block_var = (uint64_t)(sse - (uint64_t)(norm_factor * sum * sum));
  182|  63.3M|  } else {
  183|  81.9k|    *block_mse_q8 = 0;
  184|  81.9k|    *block_var = 0;
  185|  81.9k|    *per_px_mean = 0;
  186|  81.9k|  }
  187|  63.4M|  return sse;
  188|  63.4M|}
tx_search.c:get_tx_mask:
 1764|  62.0M|    int64_t ref_best_rd, TX_TYPE *allowed_txk_types, int *txk_map) {
 1765|  62.0M|  const AV1_COMMON *cm = &cpi->common;
 1766|  62.0M|  MACROBLOCKD *xd = &x->e_mbd;
 1767|  62.0M|  MB_MODE_INFO *mbmi = xd->mi[0];
 1768|  62.0M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 1769|  62.0M|  const int is_inter = is_inter_block(mbmi);
 1770|  62.0M|  const int fast_tx_search = ftxs_mode & FTXS_DCT_AND_1D_DCT_ONLY;
 1771|       |  // if txk_allowed = TX_TYPES, >1 tx types are allowed, else, if txk_allowed <
 1772|       |  // TX_TYPES, only that specific tx type is allowed.
 1773|  62.0M|  TX_TYPE txk_allowed = TX_TYPES;
 1774|       |
 1775|  62.0M|  const FRAME_UPDATE_TYPE update_type =
 1776|  62.0M|      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
 1777|  62.0M|  int use_actual_frame_probs = 1;
 1778|  62.0M|  const int *tx_type_probs;
 1779|       |#if CONFIG_FPMT_TEST
 1780|       |  use_actual_frame_probs =
 1781|       |      (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
 1782|       |  if (!use_actual_frame_probs) {
 1783|       |    tx_type_probs =
 1784|       |        (int *)cpi->ppi->temp_frame_probs.tx_type_probs[update_type][tx_size];
 1785|       |  }
 1786|       |#endif
 1787|  62.0M|  if (use_actual_frame_probs) {
  ------------------
  |  Branch (1787:7): [True: 62.0M, False: 13.6k]
  ------------------
 1788|  62.0M|    tx_type_probs = cpi->ppi->frame_probs.tx_type_probs[update_type][tx_size];
 1789|  62.0M|  }
 1790|       |
 1791|  62.0M|  if ((!is_inter && txfm_params->use_default_intra_tx_type) ||
  ------------------
  |  Branch (1791:8): [True: 53.7M, False: 8.30M]
  |  Branch (1791:21): [True: 1.43M, False: 52.2M]
  ------------------
 1792|  60.5M|      (is_inter && txfm_params->default_inter_tx_type_prob_thresh == 0)) {
  ------------------
  |  Branch (1792:8): [True: 8.41M, False: 52.1M]
  |  Branch (1792:20): [True: 0, False: 8.41M]
  ------------------
 1793|  1.43M|    txk_allowed =
 1794|  1.43M|        get_default_tx_type(0, xd, tx_size, cpi->use_screen_content_tools);
 1795|  60.5M|  } else if (is_inter &&
  ------------------
  |  Branch (1795:14): [True: 8.41M, False: 52.1M]
  ------------------
 1796|  8.41M|             txfm_params->default_inter_tx_type_prob_thresh != INT_MAX) {
  ------------------
  |  Branch (1796:14): [True: 8.11M, False: 298k]
  ------------------
 1797|  8.11M|    if (tx_type_probs[DEFAULT_INTER_TX_TYPE] >
  ------------------
  |  |   42|  8.11M|#define DEFAULT_INTER_TX_TYPE DCT_DCT
  ------------------
  |  Branch (1797:9): [True: 6.38M, False: 1.73M]
  ------------------
 1798|  8.11M|        txfm_params->default_inter_tx_type_prob_thresh) {
 1799|  6.38M|      txk_allowed = DEFAULT_INTER_TX_TYPE;
  ------------------
  |  |   42|  6.38M|#define DEFAULT_INTER_TX_TYPE DCT_DCT
  ------------------
 1800|  6.38M|    } else {
 1801|  1.73M|      int force_tx_type = 0;
 1802|  1.73M|      int max_prob = 0;
 1803|  1.73M|      const int tx_type_prob_threshold =
 1804|  1.73M|          txfm_params->default_inter_tx_type_prob_thresh +
 1805|  1.73M|          PROB_THRESH_OFFSET_TX_TYPE;
  ------------------
  |  |   27|  1.73M|#define PROB_THRESH_OFFSET_TX_TYPE 100
  ------------------
 1806|  27.7M|      for (int i = 1; i < TX_TYPES; i++) {  // find maximum probability.
  ------------------
  |  Branch (1806:23): [True: 26.0M, False: 1.73M]
  ------------------
 1807|  26.0M|        if (tx_type_probs[i] > max_prob) {
  ------------------
  |  Branch (1807:13): [True: 0, False: 26.0M]
  ------------------
 1808|      0|          max_prob = tx_type_probs[i];
 1809|      0|          force_tx_type = i;
 1810|      0|        }
 1811|  26.0M|      }
 1812|  1.73M|      if (max_prob > tx_type_prob_threshold)  // force tx type with max prob.
  ------------------
  |  Branch (1812:11): [True: 0, False: 1.73M]
  ------------------
 1813|      0|        txk_allowed = force_tx_type;
 1814|  1.73M|      else if (x->rd_model == LOW_TXFM_RD) {
  ------------------
  |  Branch (1814:16): [True: 0, False: 1.73M]
  ------------------
 1815|      0|        if (plane == 0) txk_allowed = DCT_DCT;
  ------------------
  |  Branch (1815:13): [True: 0, False: 0]
  ------------------
 1816|      0|      }
 1817|  1.73M|    }
 1818|  52.4M|  } else if (x->rd_model == LOW_TXFM_RD) {
  ------------------
  |  Branch (1818:14): [True: 0, False: 52.4M]
  ------------------
 1819|      0|    if (plane == 0) txk_allowed = DCT_DCT;
  ------------------
  |  Branch (1819:9): [True: 0, False: 0]
  ------------------
 1820|      0|  }
 1821|       |
 1822|  62.0M|  const TxSetType tx_set_type = av1_get_ext_tx_set_type(
 1823|  62.0M|      tx_size, is_inter, cm->features.reduced_tx_set_used);
 1824|       |
 1825|  62.0M|  TX_TYPE uv_tx_type = DCT_DCT;
 1826|  62.0M|  if (plane) {
  ------------------
  |  Branch (1826:7): [True: 30.5M, False: 31.4M]
  ------------------
 1827|       |    // tx_type of PLANE_TYPE_UV should be the same as PLANE_TYPE_Y
 1828|  30.5M|    uv_tx_type = txk_allowed =
 1829|  30.5M|        av1_get_tx_type(xd, get_plane_type(plane), blk_row, blk_col, tx_size,
 1830|  30.5M|                        cm->features.reduced_tx_set_used);
 1831|  30.5M|  }
 1832|  62.0M|  PREDICTION_MODE intra_dir =
 1833|  62.0M|      mbmi->filter_intra_mode_info.use_filter_intra
  ------------------
  |  Branch (1833:7): [True: 26.8M, False: 35.1M]
  ------------------
 1834|  62.0M|          ? fimode_to_intradir[mbmi->filter_intra_mode_info.filter_intra_mode]
 1835|  62.0M|          : mbmi->mode;
 1836|  62.0M|  uint16_t ext_tx_used_flag =
 1837|  62.0M|      cpi->sf.tx_sf.tx_type_search.use_reduced_intra_txset != 0 &&
  ------------------
  |  Branch (1837:7): [True: 61.8M, False: 174k]
  ------------------
 1838|  61.8M|              tx_set_type == EXT_TX_SET_DTT4_IDTX_1DDCT
  ------------------
  |  Branch (1838:15): [True: 52.7M, False: 9.11M]
  ------------------
 1839|  62.0M|          ? av1_reduced_intra_tx_used_flag[intra_dir]
 1840|  62.0M|          : av1_ext_tx_used_flag[tx_set_type];
 1841|       |
 1842|  62.0M|  if (cpi->sf.tx_sf.tx_type_search.use_reduced_intra_txset == 2)
  ------------------
  |  Branch (1842:7): [True: 0, False: 62.0M]
  ------------------
 1843|      0|    ext_tx_used_flag &= av1_derived_intra_tx_used_flag[intra_dir];
 1844|       |
 1845|  62.0M|  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_map[tx_size] > TX_32X32 ||
  ------------------
  |  Branch (1845:7): [True: 3.27M, False: 58.7M]
  |  Branch (1845:41): [True: 39.9k, False: 58.7M]
  ------------------
 1846|  58.6M|      ext_tx_used_flag == 0x0001 ||
  ------------------
  |  Branch (1846:7): [True: 180k, False: 58.5M]
  ------------------
 1847|  58.5M|      (is_inter && cpi->oxcf.txfm_cfg.use_inter_dct_only) ||
  ------------------
  |  Branch (1847:8): [True: 7.83M, False: 50.6M]
  |  Branch (1847:20): [True: 0, False: 7.83M]
  ------------------
 1848|  58.5M|      (!is_inter && cpi->oxcf.txfm_cfg.use_intra_dct_only)) {
  ------------------
  |  Branch (1848:8): [True: 50.8M, False: 7.69M]
  |  Branch (1848:21): [True: 0, False: 50.8M]
  ------------------
 1849|  3.32M|    txk_allowed = DCT_DCT;
 1850|  3.32M|  }
 1851|       |
 1852|  62.0M|  if (cpi->oxcf.txfm_cfg.enable_flip_idtx == 0)
  ------------------
  |  Branch (1852:7): [True: 0, False: 62.0M]
  ------------------
 1853|      0|    ext_tx_used_flag &= DCT_ADST_TX_MASK;
 1854|       |
 1855|  62.0M|  uint16_t allowed_tx_mask = 0;  // 1: allow; 0: skip.
 1856|  62.0M|  if (txk_allowed < TX_TYPES) {
  ------------------
  |  Branch (1856:7): [True: 36.9M, False: 25.0M]
  ------------------
 1857|  36.9M|    allowed_tx_mask = 1 << txk_allowed;
 1858|  36.9M|    allowed_tx_mask &= ext_tx_used_flag;
 1859|  36.9M|  } else if (fast_tx_search) {
  ------------------
  |  Branch (1859:14): [True: 0, False: 25.0M]
  ------------------
 1860|      0|    allowed_tx_mask = 0x0c01;  // V_DCT, H_DCT, DCT_DCT
 1861|      0|    allowed_tx_mask &= ext_tx_used_flag;
 1862|  25.0M|  } else if (!is_inter && txfm_params->use_derived_intra_tx_type_set) {
  ------------------
  |  Branch (1862:14): [True: 23.9M, False: 1.08M]
  |  Branch (1862:27): [True: 15.7M, False: 8.14M]
  ------------------
 1863|  15.7M|    allowed_tx_mask = av1_derived_intra_tx_used_flag[intra_dir];
 1864|  15.7M|    allowed_tx_mask &= ext_tx_used_flag;
 1865|  15.7M|  } else {
 1866|  9.22M|    assert(plane == 0);
 1867|  9.22M|    allowed_tx_mask = ext_tx_used_flag;
 1868|  9.22M|    int num_allowed = 0;
 1869|  9.22M|    int i;
 1870|       |
 1871|  9.22M|    if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
  ------------------
  |  Branch (1871:9): [True: 0, False: 9.22M]
  ------------------
 1872|      0|      static const int thresh_arr[2][7] = { { 10, 15, 15, 10, 15, 15, 15 },
 1873|      0|                                            { 10, 17, 17, 10, 17, 17, 17 } };
 1874|      0|      const int thresh =
 1875|      0|          thresh_arr[cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats - 1]
 1876|      0|                    [update_type];
 1877|      0|      uint16_t prune = 0;
 1878|      0|      int max_prob = -1;
 1879|      0|      int max_idx = 0;
 1880|      0|      for (i = 0; i < TX_TYPES; i++) {
  ------------------
  |  Branch (1880:19): [True: 0, False: 0]
  ------------------
 1881|      0|        if (tx_type_probs[i] > max_prob && (allowed_tx_mask & (1 << i))) {
  ------------------
  |  Branch (1881:13): [True: 0, False: 0]
  |  Branch (1881:44): [True: 0, False: 0]
  ------------------
 1882|      0|          max_prob = tx_type_probs[i];
 1883|      0|          max_idx = i;
 1884|      0|        }
 1885|      0|        if (tx_type_probs[i] < thresh) prune |= (1 << i);
  ------------------
  |  Branch (1885:13): [True: 0, False: 0]
  ------------------
 1886|      0|      }
 1887|      0|      if ((prune >> max_idx) & 0x01) prune &= ~(1 << max_idx);
  ------------------
  |  Branch (1887:11): [True: 0, False: 0]
  ------------------
 1888|      0|      allowed_tx_mask &= (~prune);
 1889|      0|    }
 1890|   157M|    for (i = 0; i < TX_TYPES; i++) {
  ------------------
  |  Branch (1890:17): [True: 148M, False: 9.22M]
  ------------------
 1891|   148M|      if (allowed_tx_mask & (1 << i)) num_allowed++;
  ------------------
  |  Branch (1891:11): [True: 57.8M, False: 90.5M]
  ------------------
 1892|   148M|    }
 1893|  9.22M|    assert(num_allowed > 0);
 1894|       |
 1895|  9.24M|    if (num_allowed > 2 && cpi->sf.tx_sf.tx_type_search.prune_tx_type_est_rd) {
  ------------------
  |  Branch (1895:9): [True: 9.24M, False: 18.4E]
  |  Branch (1895:28): [True: 0, False: 9.24M]
  ------------------
 1896|      0|      int pf = prune_factors[txfm_params->prune_2d_txfm_mode];
 1897|      0|      int mf = mul_factors[txfm_params->prune_2d_txfm_mode];
 1898|      0|      if (num_allowed <= 7) {
  ------------------
  |  Branch (1898:11): [True: 0, False: 0]
  ------------------
 1899|      0|        const uint16_t prune =
 1900|      0|            prune_txk_type(cpi, x, plane, block, tx_size, blk_row, blk_col,
 1901|      0|                           plane_bsize, txk_map, allowed_tx_mask, pf, txb_ctx,
 1902|      0|                           cm->features.reduced_tx_set_used);
 1903|      0|        allowed_tx_mask &= (~prune);
 1904|      0|      } else {
 1905|      0|        const int num_sel = (num_allowed * mf + 50) / 100;
 1906|      0|        const uint16_t prune = prune_txk_type_separ(
 1907|      0|            cpi, x, plane, block, tx_size, blk_row, blk_col, plane_bsize,
 1908|      0|            txk_map, allowed_tx_mask, pf, txb_ctx,
 1909|      0|            cm->features.reduced_tx_set_used, ref_best_rd, num_sel);
 1910|       |
 1911|      0|        allowed_tx_mask &= (~prune);
 1912|      0|      }
 1913|  9.22M|    } else {
 1914|  9.22M|      assert(num_allowed > 0);
 1915|  9.22M|      int allowed_tx_count =
 1916|  9.22M|          (txfm_params->prune_2d_txfm_mode >= TX_TYPE_PRUNE_4) ? 1 : 5;
  ------------------
  |  Branch (1916:11): [True: 869k, False: 8.35M]
  ------------------
 1917|       |      // !fast_tx_search && txk_end != txk_start && plane == 0
 1918|  9.27M|      if (txfm_params->prune_2d_txfm_mode >= TX_TYPE_PRUNE_1 && is_inter &&
  ------------------
  |  Branch (1918:11): [True: 9.27M, False: 18.4E]
  |  Branch (1918:65): [True: 1.09M, False: 8.18M]
  ------------------
 1919|  1.09M|          num_allowed > allowed_tx_count) {
  ------------------
  |  Branch (1919:11): [True: 1.07M, False: 22.0k]
  ------------------
 1920|  1.07M|        prune_tx_2D(x, plane_bsize, tx_size, blk_row, blk_col, tx_set_type,
 1921|  1.07M|                    txfm_params->prune_2d_txfm_mode, txk_map, &allowed_tx_mask);
 1922|  1.07M|      }
 1923|  9.22M|    }
 1924|  9.22M|  }
 1925|       |
 1926|       |  // Need to have at least one transform type allowed.
 1927|  62.0M|  if (allowed_tx_mask == 0) {
  ------------------
  |  Branch (1927:7): [True: 576k, False: 61.4M]
  ------------------
 1928|   576k|    txk_allowed = (plane ? uv_tx_type : DCT_DCT);
  ------------------
  |  Branch (1928:20): [True: 367k, False: 209k]
  ------------------
 1929|   576k|    allowed_tx_mask = (1 << txk_allowed);
 1930|   576k|  }
 1931|       |
 1932|       |  assert(IMPLIES(txk_allowed < TX_TYPES, allowed_tx_mask == 1 << txk_allowed));
 1933|  62.0M|  *allowed_txk_types = txk_allowed;
 1934|  62.0M|  return allowed_tx_mask;
 1935|  62.0M|}
tx_search.c:prune_tx_2D:
 1528|  1.07M|                        uint16_t *allowed_tx_mask) {
 1529|       |  // This table is used because the search order is different from the enum
 1530|       |  // order.
 1531|  1.07M|  static const int tx_type_table_2D[16] = {
 1532|  1.07M|    DCT_DCT,      DCT_ADST,      DCT_FLIPADST,      V_DCT,
 1533|  1.07M|    ADST_DCT,     ADST_ADST,     ADST_FLIPADST,     V_ADST,
 1534|  1.07M|    FLIPADST_DCT, FLIPADST_ADST, FLIPADST_FLIPADST, V_FLIPADST,
 1535|  1.07M|    H_DCT,        H_ADST,        H_FLIPADST,        IDTX
 1536|  1.07M|  };
 1537|  1.07M|  if (tx_set_type != EXT_TX_SET_ALL16 &&
  ------------------
  |  Branch (1537:7): [True: 38.3k, False: 1.03M]
  ------------------
 1538|  38.3k|      tx_set_type != EXT_TX_SET_DTT9_IDTX_1DDCT)
  ------------------
  |  Branch (1538:7): [True: 7.23k, False: 31.1k]
  ------------------
 1539|  7.23k|    return;
 1540|       |#if CONFIG_NN_V2
 1541|       |  NN_CONFIG_V2 *nn_config_hor = av1_tx_type_nnconfig_map_hor[tx_size];
 1542|       |  NN_CONFIG_V2 *nn_config_ver = av1_tx_type_nnconfig_map_ver[tx_size];
 1543|       |#else
 1544|  1.06M|  const NN_CONFIG *nn_config_hor = av1_tx_type_nnconfig_map_hor[tx_size];
 1545|  1.06M|  const NN_CONFIG *nn_config_ver = av1_tx_type_nnconfig_map_ver[tx_size];
 1546|  1.06M|#endif
 1547|  1.06M|  if (!nn_config_hor || !nn_config_ver) return;  // Model not established yet.
  ------------------
  |  Branch (1547:7): [True: 17, False: 1.06M]
  |  Branch (1547:25): [True: 0, False: 1.06M]
  ------------------
 1548|       |
 1549|  1.06M|  float hfeatures[16], vfeatures[16];
 1550|  1.06M|  float hscores[4], vscores[4];
 1551|  1.06M|  float scores_2D_raw[16];
 1552|  1.06M|  const int bw = tx_size_wide[tx_size];
 1553|  1.06M|  const int bh = tx_size_high[tx_size];
 1554|  1.06M|  const int hfeatures_num = bw <= 8 ? bw : bw / 2;
  ------------------
  |  Branch (1554:29): [True: 1.02M, False: 38.7k]
  ------------------
 1555|  1.06M|  const int vfeatures_num = bh <= 8 ? bh : bh / 2;
  ------------------
  |  Branch (1555:29): [True: 1.01M, False: 48.4k]
  ------------------
 1556|  1.06M|  assert(hfeatures_num <= 16);
 1557|  1.06M|  assert(vfeatures_num <= 16);
 1558|       |
 1559|  1.06M|  const struct macroblock_plane *const p = &x->plane[0];
 1560|  1.06M|  const int diff_stride = block_size_wide[bsize];
 1561|  1.06M|  const int16_t *diff = p->src_diff + 4 * blk_row * diff_stride + 4 * blk_col;
 1562|  1.06M|  get_energy_distribution_finer(diff, diff_stride, bw, bh, hfeatures,
 1563|  1.06M|                                vfeatures);
 1564|       |
 1565|  1.06M|  av1_get_horver_correlation_full(diff, diff_stride, bw, bh,
 1566|  1.06M|                                  &hfeatures[hfeatures_num - 1],
 1567|  1.06M|                                  &vfeatures[vfeatures_num - 1]);
 1568|       |
 1569|       |#if CONFIG_NN_V2
 1570|       |  av1_nn_predict_v2(hfeatures, nn_config_hor, 0, hscores);
 1571|       |  av1_nn_predict_v2(vfeatures, nn_config_ver, 0, vscores);
 1572|       |#else
 1573|  1.06M|  av1_nn_predict(hfeatures, nn_config_hor, 1, hscores);
 1574|  1.06M|  av1_nn_predict(vfeatures, nn_config_ver, 1, vscores);
 1575|  1.06M|#endif
 1576|       |
 1577|  5.31M|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (1577:19): [True: 4.25M, False: 1.06M]
  ------------------
 1578|  4.25M|    float *cur_scores_2D = scores_2D_raw + i * 4;
 1579|  4.25M|    cur_scores_2D[0] = vscores[i] * hscores[0];
 1580|  4.25M|    cur_scores_2D[1] = vscores[i] * hscores[1];
 1581|  4.25M|    cur_scores_2D[2] = vscores[i] * hscores[2];
 1582|  4.25M|    cur_scores_2D[3] = vscores[i] * hscores[3];
 1583|  4.25M|  }
 1584|       |
 1585|  1.06M|  assert(TX_TYPES == 16);
 1586|       |  // This version of the function only works when there are at most 16 classes.
 1587|       |  // So we will need to change the optimization or use av1_nn_softmax instead if
 1588|       |  // this ever gets changed.
 1589|  1.06M|  av1_nn_fast_softmax_16(scores_2D_raw, scores_2D_raw);
 1590|       |
 1591|  1.06M|  const float score_thresh =
 1592|  1.06M|      get_adaptive_thresholds(tx_size, tx_set_type, prune_2d_txfm_mode);
 1593|       |
 1594|       |  // Always keep the TX type with the highest score, prune all others with
 1595|       |  // score below score_thresh.
 1596|  1.06M|  int max_score_i = 0;
 1597|  1.06M|  float max_score = 0.0f;
 1598|  1.06M|  uint16_t allow_bitmask = 0;
 1599|  1.06M|  float sum_score = 0.0;
 1600|       |  // Calculate sum of allowed tx type score and Populate allow bit mask based
 1601|       |  // on score_thresh and allowed_tx_mask
 1602|  1.06M|  int allow_count = 0;
 1603|  1.06M|  int tx_type_allowed[16] = { TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
 1604|  1.06M|                              TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
 1605|  1.06M|                              TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
 1606|  1.06M|                              TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
 1607|  1.06M|                              TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
 1608|  1.06M|                              TX_TYPE_INVALID };
 1609|  1.06M|  float scores_2D[16] = {
 1610|  1.06M|    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 1611|  1.06M|  };
 1612|  18.0M|  for (int tx_idx = 0; tx_idx < TX_TYPES; tx_idx++) {
  ------------------
  |  Branch (1612:24): [True: 17.0M, False: 1.06M]
  ------------------
 1613|  17.0M|    const int allow_tx_type =
 1614|  17.0M|        check_bit_mask(*allowed_tx_mask, tx_type_table_2D[tx_idx]);
 1615|  17.0M|    if (!allow_tx_type) {
  ------------------
  |  Branch (1615:9): [True: 124k, False: 16.8M]
  ------------------
 1616|   124k|      continue;
 1617|   124k|    }
 1618|  16.8M|    if (scores_2D_raw[tx_idx] > max_score) {
  ------------------
  |  Branch (1618:9): [True: 2.74M, False: 14.1M]
  ------------------
 1619|  2.74M|      max_score = scores_2D_raw[tx_idx];
 1620|  2.74M|      max_score_i = tx_idx;
 1621|  2.74M|    }
 1622|  16.8M|    if (scores_2D_raw[tx_idx] >= score_thresh) {
  ------------------
  |  Branch (1622:9): [True: 3.18M, False: 13.6M]
  ------------------
 1623|       |      // Set allow mask based on score_thresh
 1624|  3.18M|      set_bit_mask(&allow_bitmask, tx_type_table_2D[tx_idx]);
 1625|       |
 1626|       |      // Accumulate score of allowed tx type
 1627|  3.18M|      sum_score += scores_2D_raw[tx_idx];
 1628|       |
 1629|  3.18M|      scores_2D[allow_count] = scores_2D_raw[tx_idx];
 1630|  3.18M|      tx_type_allowed[allow_count] = tx_type_table_2D[tx_idx];
 1631|  3.18M|      allow_count += 1;
 1632|  3.18M|    }
 1633|  16.8M|  }
 1634|  1.06M|  if (!check_bit_mask(allow_bitmask, tx_type_table_2D[max_score_i])) {
  ------------------
  |  Branch (1634:7): [True: 123k, False: 939k]
  ------------------
 1635|       |    // If even the tx_type with max score is pruned, this means that no other
 1636|       |    // tx_type is feasible. When this happens, we force enable max_score_i and
 1637|       |    // end the search.
 1638|   123k|    set_bit_mask(&allow_bitmask, tx_type_table_2D[max_score_i]);
 1639|   123k|    memcpy(txk_map, tx_type_table_2D, sizeof(tx_type_table_2D));
 1640|   123k|    *allowed_tx_mask = allow_bitmask;
 1641|   123k|    return;
 1642|   123k|  }
 1643|       |
 1644|       |  // Sort tx type probability of all types
 1645|   939k|  if (allow_count <= 8) {
  ------------------
  |  Branch (1645:7): [True: 927k, False: 12.2k]
  ------------------
 1646|   927k|    av1_sort_fi32_8(scores_2D, tx_type_allowed);
 1647|   927k|  } else {
 1648|  12.2k|    av1_sort_fi32_16(scores_2D, tx_type_allowed);
 1649|  12.2k|  }
 1650|       |
 1651|       |  // Enable more pruning based on tx type probability and number of allowed tx
 1652|       |  // types
 1653|   939k|  if (prune_2d_txfm_mode >= TX_TYPE_PRUNE_4) {
  ------------------
  |  Branch (1653:7): [True: 739k, False: 200k]
  ------------------
 1654|   739k|    float temp_score = 0.0;
 1655|   739k|    float score_ratio = 0.0;
 1656|   739k|    int tx_idx, tx_count = 0;
 1657|   739k|    const float inv_sum_score = 100 / sum_score;
 1658|       |    // Get allowed tx types based on sorted probability score and tx count
 1659|  2.10M|    for (tx_idx = 0; tx_idx < allow_count; tx_idx++) {
  ------------------
  |  Branch (1659:22): [True: 1.77M, False: 325k]
  ------------------
 1660|       |      // Skip the tx type which has more than 30% of cumulative
 1661|       |      // probability and allowed tx type count is more than 2
 1662|  1.77M|      if (score_ratio > 30.0 && tx_count >= 2) break;
  ------------------
  |  Branch (1662:11): [True: 969k, False: 805k]
  |  Branch (1662:33): [True: 413k, False: 556k]
  ------------------
 1663|       |
 1664|  1.77M|      assert(check_bit_mask(allow_bitmask, tx_type_allowed[tx_idx]));
 1665|       |      // Calculate cumulative probability
 1666|  1.36M|      temp_score += scores_2D[tx_idx];
 1667|       |
 1668|       |      // Calculate percentage of cumulative probability of allowed tx type
 1669|  1.36M|      score_ratio = temp_score * inv_sum_score;
 1670|  1.36M|      tx_count++;
 1671|  1.36M|    }
 1672|       |    // Set remaining tx types as pruned
 1673|  1.36M|    for (; tx_idx < allow_count; tx_idx++)
  ------------------
  |  Branch (1673:12): [True: 620k, False: 739k]
  ------------------
 1674|   620k|      unset_bit_mask(&allow_bitmask, tx_type_allowed[tx_idx]);
 1675|   739k|  }
 1676|       |
 1677|   939k|  memcpy(txk_map, tx_type_allowed, sizeof(tx_type_table_2D));
 1678|   939k|  *allowed_tx_mask = allow_bitmask;
 1679|   939k|}
tx_search.c:get_energy_distribution_finer:
 1452|  1.06M|                                                 float *verdist) {
 1453|       |  // First compute downscaled block energy values (esq); downscale factors
 1454|       |  // are defined by w_shift and h_shift.
 1455|  1.06M|  unsigned int esq[256];
 1456|  1.06M|  const int w_shift = bw <= 8 ? 0 : 1;
  ------------------
  |  Branch (1456:23): [True: 1.02M, False: 38.8k]
  ------------------
 1457|  1.06M|  const int h_shift = bh <= 8 ? 0 : 1;
  ------------------
  |  Branch (1457:23): [True: 1.01M, False: 48.4k]
  ------------------
 1458|  1.06M|  const int esq_w = bw >> w_shift;
 1459|  1.06M|  const int esq_h = bh >> h_shift;
 1460|  1.06M|  const int esq_sz = esq_w * esq_h;
 1461|  1.06M|  int i, j;
 1462|  1.06M|  memset(esq, 0, esq_sz * sizeof(esq[0]));
 1463|  1.06M|  if (w_shift) {
  ------------------
  |  Branch (1463:7): [True: 38.8k, False: 1.02M]
  ------------------
 1464|   598k|    for (i = 0; i < bh; i++) {
  ------------------
  |  Branch (1464:17): [True: 559k, False: 38.8k]
  ------------------
 1465|   559k|      unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w;
 1466|   559k|      const int16_t *cur_diff_row = diff + i * stride;
 1467|  5.03M|      for (j = 0; j < bw; j += 2) {
  ------------------
  |  Branch (1467:19): [True: 4.47M, False: 559k]
  ------------------
 1468|  4.47M|        cur_esq_row[j >> 1] += (cur_diff_row[j] * cur_diff_row[j] +
 1469|  4.47M|                                cur_diff_row[j + 1] * cur_diff_row[j + 1]);
 1470|  4.47M|      }
 1471|   559k|    }
 1472|  1.02M|  } else {
 1473|  8.46M|    for (i = 0; i < bh; i++) {
  ------------------
  |  Branch (1473:17): [True: 7.44M, False: 1.02M]
  ------------------
 1474|  7.44M|      unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w;
 1475|  7.44M|      const int16_t *cur_diff_row = diff + i * stride;
 1476|  63.0M|      for (j = 0; j < bw; j++) {
  ------------------
  |  Branch (1476:19): [True: 55.6M, False: 7.44M]
  ------------------
 1477|  55.6M|        cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j];
 1478|  55.6M|      }
 1479|  7.44M|    }
 1480|  1.02M|  }
 1481|       |
 1482|  1.06M|  uint64_t total = 0;
 1483|  58.0M|  for (i = 0; i < esq_sz; i++) total += esq[i];
  ------------------
  |  Branch (1483:15): [True: 57.0M, False: 1.06M]
  ------------------
 1484|       |
 1485|       |  // Output hordist and verdist arrays are normalized 1D projections of esq
 1486|  1.06M|  if (total == 0) {
  ------------------
  |  Branch (1486:7): [True: 0, False: 1.06M]
  ------------------
 1487|      0|    float hor_val = 1.0f / esq_w;
 1488|      0|    for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val;
  ------------------
  |  Branch (1488:17): [True: 0, False: 0]
  ------------------
 1489|      0|    float ver_val = 1.0f / esq_h;
 1490|      0|    for (i = 0; i < esq_h - 1; i++) verdist[i] = ver_val;
  ------------------
  |  Branch (1490:17): [True: 0, False: 0]
  ------------------
 1491|      0|    return;
 1492|      0|  }
 1493|       |
 1494|  1.06M|  const float e_recip = 1.0f / (float)total;
 1495|  1.06M|  memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0]));
 1496|  1.06M|  memset(verdist, 0, (esq_h - 1) * sizeof(verdist[0]));
 1497|  1.06M|  const unsigned int *cur_esq_row;
 1498|  7.61M|  for (i = 0; i < esq_h - 1; i++) {
  ------------------
  |  Branch (1498:15): [True: 6.54M, False: 1.06M]
  ------------------
 1499|  6.54M|    cur_esq_row = esq + i * esq_w;
 1500|  49.3M|    for (j = 0; j < esq_w - 1; j++) {
  ------------------
  |  Branch (1500:17): [True: 42.7M, False: 6.54M]
  ------------------
 1501|  42.7M|      hordist[j] += (float)cur_esq_row[j];
 1502|  42.7M|      verdist[i] += (float)cur_esq_row[j];
 1503|  42.7M|    }
 1504|  6.54M|    verdist[i] += (float)cur_esq_row[j];
 1505|  6.54M|  }
 1506|  1.06M|  cur_esq_row = esq + i * esq_w;
 1507|  7.66M|  for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j];
  ------------------
  |  Branch (1507:15): [True: 6.60M, False: 1.06M]
  ------------------
 1508|       |
 1509|  7.66M|  for (j = 0; j < esq_w - 1; j++) hordist[j] *= e_recip;
  ------------------
  |  Branch (1509:15): [True: 6.60M, False: 1.06M]
  ------------------
 1510|  7.61M|  for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip;
  ------------------
  |  Branch (1510:15): [True: 6.55M, False: 1.06M]
  ------------------
 1511|  1.06M|}
tx_search.c:get_adaptive_thresholds:
 1434|  1.06M|    TX_TYPE_PRUNE_MODE prune_2d_txfm_mode) {
 1435|  1.06M|  const int prune_aggr_table[5][2] = {
 1436|  1.06M|    { 4, 1 }, { 6, 3 }, { 9, 6 }, { 9, 6 }, { 12, 9 }
 1437|  1.06M|  };
 1438|  1.06M|  int pruning_aggressiveness = 0;
 1439|  1.06M|  if (tx_set_type == EXT_TX_SET_ALL16)
  ------------------
  |  Branch (1439:7): [True: 1.03M, False: 31.1k]
  ------------------
 1440|  1.03M|    pruning_aggressiveness =
 1441|  1.03M|        prune_aggr_table[prune_2d_txfm_mode - TX_TYPE_PRUNE_1][0];
 1442|  31.1k|  else if (tx_set_type == EXT_TX_SET_DTT9_IDTX_1DDCT)
  ------------------
  |  Branch (1442:12): [True: 31.1k, False: 18.4E]
  ------------------
 1443|  31.1k|    pruning_aggressiveness =
 1444|  31.1k|        prune_aggr_table[prune_2d_txfm_mode - TX_TYPE_PRUNE_1][1];
 1445|       |
 1446|  1.06M|  return prune_2D_adaptive_thresholds[tx_size][pruning_aggressiveness];
 1447|  1.06M|}
tx_search.c:set_bit_mask:
 1517|  3.30M|static inline void set_bit_mask(uint16_t *mask, int val) {
 1518|  3.30M|  *mask |= (1 << val);
 1519|  3.30M|}
tx_search.c:unset_bit_mask:
 1521|   620k|static inline void unset_bit_mask(uint16_t *mask, int val) {
 1522|   620k|  *mask &= ~(1 << val);
 1523|   620k|}
tx_search.c:check_bit_mask:
 1513|   933M|static inline bool check_bit_mask(uint16_t mask, int val) {
 1514|   933M|  return mask & (1 << val);
 1515|   933M|}
tx_search.c:skip_trellis_opt_based_on_satd:
 1969|   116M|                                          int skip_trellis, int dc_only_blk) {
 1970|   116M|  if (skip_trellis || (coeff_opt_satd_threshold == UINT_MAX))
  ------------------
  |  Branch (1970:7): [True: 73.5M, False: 42.4M]
  |  Branch (1970:23): [True: 35.7M, False: 6.78M]
  ------------------
 1971|   109M|    return skip_trellis;
 1972|       |
 1973|  6.70M|  const struct macroblock_plane *const p = &x->plane[plane];
 1974|  6.70M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|  6.70M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
 1975|  6.70M|  tran_low_t *const coeff_ptr = p->coeff + block_offset;
 1976|  6.70M|  const int n_coeffs = av1_get_max_eob(tx_size);
 1977|  6.70M|  const int shift = (MAX_TX_SCALE - av1_get_tx_scale(tx_size));
  ------------------
  |  |   34|  6.70M|#define MAX_TX_SCALE 1
  ------------------
 1978|  6.70M|  int satd = (dc_only_blk) ? abs(coeff_ptr[0]) : aom_satd(coeff_ptr, n_coeffs);
  ------------------
  |  Branch (1978:14): [True: 633k, False: 6.07M]
  ------------------
 1979|  6.70M|  satd = RIGHT_SIGNED_SHIFT(satd, shift);
  ------------------
  |  |   66|  6.70M|  ((n) < 0 ? ((value) << (-(n))) : ((value) >> (n)))
  |  |  ------------------
  |  |  |  Branch (66:4): [True: 3.11k, False: 6.70M]
  |  |  ------------------
  ------------------
 1980|  6.70M|  satd >>= (x->e_mbd.bd - 8);
 1981|       |
 1982|  6.70M|  const int skip_block_trellis =
 1983|  6.70M|      ((uint64_t)satd >
 1984|  6.70M|       (uint64_t)coeff_opt_satd_threshold * qstep * sqrt_tx_pixels_2d[tx_size]);
 1985|       |
 1986|  6.70M|  av1_setup_quant(
 1987|  6.70M|      tx_size, !skip_block_trellis,
 1988|  6.70M|      skip_block_trellis
  ------------------
  |  Branch (1988:7): [True: 134k, False: 6.57M]
  ------------------
 1989|  18.4E|          ? (USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B : AV1_XFORM_QUANT_FP)
  ------------------
  |  |   34|   134k|#define USE_B_QUANT_NO_TRELLIS 1
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 6.77M, Folded]
  |  |  ------------------
  ------------------
 1990|  6.70M|          : AV1_XFORM_QUANT_FP,
 1991|  6.70M|      quant_b_adapt, quant_param);
 1992|       |
 1993|  6.70M|  return skip_block_trellis;
 1994|   116M|}
tx_search.c:dist_block_px_domain:
 1007|  59.6M|                                           TX_SIZE tx_size) {
 1008|  59.6M|  MACROBLOCKD *const xd = &x->e_mbd;
 1009|  59.6M|  const struct macroblock_plane *const p = &x->plane[plane];
 1010|  59.6M|  const uint16_t eob = p->eobs[block];
 1011|  59.6M|  const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
 1012|  59.6M|  const int bsw = block_size_wide[tx_bsize];
 1013|  59.6M|  const int bsh = block_size_high[tx_bsize];
 1014|  59.6M|  const int src_stride = x->plane[plane].src.stride;
 1015|  59.6M|  const int dst_stride = xd->plane[plane].dst.stride;
 1016|       |  // Scale the transform block index to pixel unit.
 1017|  59.6M|  const int src_idx = (blk_row * src_stride + blk_col) << MI_SIZE_LOG2;
  ------------------
  |  |   39|  59.6M|#define MI_SIZE_LOG2 2
  ------------------
 1018|  59.6M|  const int dst_idx = (blk_row * dst_stride + blk_col) << MI_SIZE_LOG2;
  ------------------
  |  |   39|  59.6M|#define MI_SIZE_LOG2 2
  ------------------
 1019|  59.6M|  const uint8_t *src = &x->plane[plane].src.buf[src_idx];
 1020|  59.6M|  const uint8_t *dst = &xd->plane[plane].dst.buf[dst_idx];
 1021|  59.6M|  const tran_low_t *dqcoeff = p->dqcoeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  59.6M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
 1022|       |
 1023|  59.6M|  assert(cpi != NULL);
 1024|  59.6M|  assert(tx_size_wide_log2[0] == tx_size_high_log2[0]);
 1025|       |
 1026|  59.6M|  uint8_t *recon;
 1027|  59.6M|  DECLARE_ALIGNED(16, uint16_t, recon16[MAX_TX_SQUARE]);
  ------------------
  |  |   19|  59.6M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
 1028|       |
 1029|  59.6M|#if CONFIG_AV1_HIGHBITDEPTH
 1030|  59.6M|  if (is_cur_buf_hbd(xd)) {
  ------------------
  |  Branch (1030:7): [True: 20.1M, False: 39.4M]
  ------------------
 1031|  20.1M|    recon = CONVERT_TO_BYTEPTR(recon16);
  ------------------
  |  |   80|  20.1M|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
 1032|  20.1M|    aom_highbd_convolve_copy(CONVERT_TO_SHORTPTR(dst), dst_stride,
  ------------------
  |  |   79|  20.1M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 1033|  20.1M|                             CONVERT_TO_SHORTPTR(recon), MAX_TX_SIZE, bsw, bsh);
  ------------------
  |  |   79|  20.1M|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
                                           CONVERT_TO_SHORTPTR(recon), MAX_TX_SIZE, bsw, bsh);
  ------------------
  |  |  183|  20.1M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  182|  20.1M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  ------------------
  ------------------
 1034|  39.4M|  } else {
 1035|  39.4M|    recon = (uint8_t *)recon16;
 1036|  39.4M|    aom_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, bsw, bsh);
  ------------------
  |  |  183|  39.4M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  182|  39.4M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  ------------------
  ------------------
 1037|  39.4M|  }
 1038|       |#else
 1039|       |  recon = (uint8_t *)recon16;
 1040|       |  aom_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, bsw, bsh);
 1041|       |#endif
 1042|       |
 1043|  59.6M|  const PLANE_TYPE plane_type = get_plane_type(plane);
 1044|  59.6M|  TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, blk_row, blk_col, tx_size,
 1045|  59.6M|                                    cpi->common.features.reduced_tx_set_used);
 1046|  59.6M|  av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, recon,
 1047|  59.6M|                              MAX_TX_SIZE, eob,
  ------------------
  |  |  183|  59.6M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  182|  59.6M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  ------------------
  ------------------
 1048|  59.6M|                              cpi->common.features.reduced_tx_set_used);
 1049|       |
 1050|  59.6M|  return 16 * pixel_dist(cpi, x, plane, src, src_stride, recon, MAX_TX_SIZE,
  ------------------
  |  |  183|  59.6M|#define MAX_TX_SIZE (1 << MAX_TX_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |  182|  59.6M|#define MAX_TX_SIZE_LOG2 (6)
  |  |  ------------------
  ------------------
 1051|  59.6M|                         blk_row, blk_col, plane_bsize, tx_bsize);
 1052|  59.6M|}
tx_search.c:pixel_dist:
  986|  59.5M|                           const BLOCK_SIZE tx_bsize) {
  987|  59.5M|  int txb_rows, txb_cols, visible_rows, visible_cols;
  988|  59.5M|  txb_cols = block_size_wide[tx_bsize];
  989|  59.5M|  txb_rows = block_size_high[tx_bsize];
  990|       |
  991|  59.5M|  get_visible_dimensions(x, plane, plane_bsize, blk_col, blk_row, txb_cols,
  992|  59.5M|                         txb_rows, /*clip_dims=*/true, &visible_cols,
  993|  59.5M|                         &visible_rows);
  994|  59.5M|  assert(visible_rows > 0);
  995|  59.5M|  assert(visible_cols > 0);
  996|       |
  997|  59.5M|  unsigned sse = pixel_dist_visible_only(cpi, x, src, src_stride, dst,
  998|  59.5M|                                         dst_stride, tx_bsize, txb_rows,
  999|  59.5M|                                         txb_cols, visible_rows, visible_cols);
 1000|       |
 1001|  59.5M|  return sse;
 1002|  59.5M|}
tx_search.c:recon_intra:
  935|  63.8M|                               int *rate_cost, uint16_t best_eob) {
  936|  63.8M|  const AV1_COMMON *cm = &cpi->common;
  937|  63.8M|  MACROBLOCKD *xd = &x->e_mbd;
  938|  63.8M|  MB_MODE_INFO *mbmi = xd->mi[0];
  939|  63.8M|  const int is_inter = is_inter_block(mbmi);
  940|  63.8M|  if (!is_inter && best_eob &&
  ------------------
  |  Branch (940:7): [True: 55.2M, False: 8.59M]
  |  Branch (940:20): [True: 51.3M, False: 3.88M]
  ------------------
  941|  51.4M|      (blk_row + tx_size_high_unit[tx_size] < mi_size_high[plane_bsize] ||
  ------------------
  |  Branch (941:8): [True: 4.50M, False: 46.9M]
  ------------------
  942|  46.9M|       blk_col + tx_size_wide_unit[tx_size] < mi_size_wide[plane_bsize])) {
  ------------------
  |  Branch (942:8): [True: 2.00M, False: 44.8M]
  ------------------
  943|       |    // if the quantized coefficients are stored in the dqcoeff buffer, we don't
  944|       |    // need to do transform and quantization again.
  945|  6.57M|    if (do_quant) {
  ------------------
  |  Branch (945:9): [True: 0, False: 6.57M]
  ------------------
  946|      0|      TxfmParam txfm_param_intra;
  947|      0|      QUANT_PARAM quant_param_intra;
  948|      0|      av1_setup_xform(cm, x, tx_size, best_tx_type, &txfm_param_intra);
  949|      0|      av1_setup_quant(tx_size, !skip_trellis,
  950|      0|                      skip_trellis
  ------------------
  |  Branch (950:23): [True: 0, False: 0]
  ------------------
  951|      0|                          ? (USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B
  ------------------
  |  |   34|      0|#define USE_B_QUANT_NO_TRELLIS 1
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 0, Folded]
  |  |  ------------------
  ------------------
  952|      0|                                                    : AV1_XFORM_QUANT_FP)
  953|      0|                          : AV1_XFORM_QUANT_FP,
  954|      0|                      cpi->oxcf.q_cfg.quant_b_adapt, &quant_param_intra);
  955|      0|      av1_setup_qmatrix(&cm->quant_params, xd, plane, tx_size, best_tx_type,
  956|      0|                        &quant_param_intra);
  957|      0|      av1_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
  958|      0|                      &txfm_param_intra, &quant_param_intra);
  959|      0|      if (quant_param_intra.use_optimize_b) {
  ------------------
  |  Branch (959:11): [True: 0, False: 0]
  ------------------
  960|      0|        av1_optimize_b(cpi, x, plane, block, tx_size, best_tx_type, txb_ctx,
  961|      0|                       rate_cost);
  962|      0|      }
  963|      0|    }
  964|       |
  965|  6.57M|    inverse_transform_block_facade(x, plane, block, blk_row, blk_col,
  966|  6.57M|                                   x->plane[plane].eobs[block],
  967|  6.57M|                                   cm->features.reduced_tx_set_used);
  968|       |
  969|       |    // This may happen because of hash collision. The eob stored in the hash
  970|       |    // table is non-zero, but the real eob is zero. We need to make sure tx_type
  971|       |    // is DCT_DCT in this case.
  972|  6.57M|    if (plane == 0 && x->plane[plane].eobs[block] == 0 &&
  ------------------
  |  Branch (972:9): [True: 6.18M, False: 392k]
  |  Branch (972:23): [True: 0, False: 6.18M]
  ------------------
  973|      0|        best_tx_type != DCT_DCT) {
  ------------------
  |  Branch (973:9): [True: 0, False: 0]
  ------------------
  974|      0|      update_txk_array(xd, blk_row, blk_col, tx_size, DCT_DCT);
  975|      0|    }
  976|  6.57M|  }
  977|  63.8M|}
tx_search.c:inverse_transform_block_facade:
  913|  6.57M|                                                  int eob, int reduced_tx_set) {
  914|  6.57M|  if (!eob) return;
  ------------------
  |  Branch (914:7): [True: 0, False: 6.57M]
  ------------------
  915|  6.57M|  struct macroblock_plane *const p = &x->plane[plane];
  916|  6.57M|  MACROBLOCKD *const xd = &x->e_mbd;
  917|  6.57M|  tran_low_t *dqcoeff = p->dqcoeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  6.57M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  918|  6.57M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  919|  6.57M|  const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
  920|  6.57M|  const TX_TYPE tx_type = av1_get_tx_type(xd, plane_type, blk_row, blk_col,
  921|  6.57M|                                          tx_size, reduced_tx_set);
  922|       |
  923|  6.57M|  struct macroblockd_plane *const pd = &xd->plane[plane];
  924|  6.57M|  const int dst_stride = pd->dst.stride;
  925|  6.57M|  uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << MI_SIZE_LOG2];
  ------------------
  |  |   39|  6.57M|#define MI_SIZE_LOG2 2
  ------------------
  926|  6.57M|  av1_inverse_transform_block(xd, dqcoeff, plane, tx_type, tx_size, dst,
  927|  6.57M|                              dst_stride, eob, reduced_tx_set);
  928|  6.57M|}
tx_search.c:push_inter_block_tx_no_split_rd:
  320|   235k|    int prune_inter_tx_split_rd_eval_lvl) {
  321|   235k|  assert(blk_idx < MAX_TX_BLOCKS_IN_MAX_SB);
  322|   235k|  if (!prune_inter_tx_split_rd_eval_lvl) return;
  ------------------
  |  Branch (322:7): [True: 0, False: 235k]
  ------------------
  323|       |
  324|   235k|  if (blk_idx == -1 || tmp_rd == INT64_MAX) return;
  ------------------
  |  Branch (324:7): [True: 89.9k, False: 145k]
  |  Branch (324:24): [True: 18.4E, False: 145k]
  ------------------
  325|       |
  326|       |  // Do not store for skip and intraBC modes
  327|   145k|  if (mbmi->skip_mode != 0 || is_intrabc_block(mbmi)) return;
  ------------------
  |  Branch (327:7): [True: 18.4E, False: 145k]
  |  Branch (327:31): [True: 18.4E, False: 145k]
  ------------------
  328|       |
  329|   145k|  assert(prune_inter_tx_split_rd_eval_lvl <= 2);
  330|   145k|  const int num_top_cand =
  331|   145k|      num_inter_tx_no_split_cand[prune_inter_tx_split_rd_eval_lvl - 1];
  332|   145k|  assert(num_top_cand <= TOP_INTER_TX_NO_SPLIT_COUNT);
  333|       |
  334|       |  // Insert the RD Cost in sorted order
  335|   145k|  for (int i = 0; i < num_top_cand; i++) {
  ------------------
  |  Branch (335:19): [True: 145k, False: 18.4E]
  ------------------
  336|   145k|    if (tmp_rd < x->top_inter_tx_no_split_rd[blk_idx][i]) {
  ------------------
  |  Branch (336:9): [True: 145k, False: 0]
  ------------------
  337|   436k|      for (int j = num_top_cand - 1; j > i; j--) {
  ------------------
  |  Branch (337:38): [True: 290k, False: 145k]
  ------------------
  338|   290k|        x->top_inter_tx_no_split_rd[blk_idx][j] =
  339|   290k|            x->top_inter_tx_no_split_rd[blk_idx][j - 1];
  340|   290k|      }
  341|   145k|      x->top_inter_tx_no_split_rd[blk_idx][i] = tmp_rd;
  342|   145k|      break;
  343|   145k|    }
  344|   145k|  }
  345|   145k|}
tx_search.c:prune_tx_split_eval_using_no_split_rd:
  350|   223k|    int prune_inter_tx_split_rd_eval_lvl) {
  351|   223k|  if (!prune_inter_tx_split_rd_eval_lvl) return false;
  ------------------
  |  Branch (351:7): [True: 0, False: 223k]
  ------------------
  352|       |
  353|   223k|  if (blk_idx == -1 || tmp_rd == INT64_MAX) return false;
  ------------------
  |  Branch (353:7): [True: 78.1k, False: 145k]
  |  Branch (353:24): [True: 0, False: 145k]
  ------------------
  354|       |
  355|       |  // Do not prune for skip and intraBC modes
  356|   145k|  if (mbmi->skip_mode != 0 || is_intrabc_block(mbmi)) return false;
  ------------------
  |  Branch (356:7): [True: 18.4E, False: 145k]
  |  Branch (356:31): [True: 3, False: 145k]
  ------------------
  357|       |
  358|   145k|  assert(prune_inter_tx_split_rd_eval_lvl <= 2);
  359|   145k|  const int num_top_cand =
  360|   145k|      num_inter_tx_no_split_cand[prune_inter_tx_split_rd_eval_lvl - 1];
  361|   145k|  assert(num_top_cand <= TOP_INTER_TX_NO_SPLIT_COUNT);
  362|       |
  363|       |  // Do not prune if there is no valid top RD Cost for comparison
  364|   145k|  if (x->top_inter_tx_no_split_rd[blk_idx][num_top_cand - 1] == INT64_MAX)
  ------------------
  |  Branch (364:7): [True: 145k, False: 18.4E]
  ------------------
  365|   145k|    return false;
  366|       |
  367|  18.4E|  if (tmp_rd > x->top_inter_tx_no_split_rd[blk_idx][num_top_cand - 1])
  ------------------
  |  Branch (367:7): [True: 0, False: 18.4E]
  ------------------
  368|      0|    return true;
  369|       |
  370|  18.4E|  return false;
  371|  18.4E|}
tx_search.c:ml_predict_tx_split:
 1740|   115k|                               int blk_col, TX_SIZE tx_size) {
 1741|   115k|  const NN_CONFIG *nn_config = av1_tx_split_nnconfig_map[tx_size];
 1742|   115k|  if (!nn_config) return -1;
  ------------------
  |  Branch (1742:7): [True: 0, False: 115k]
  ------------------
 1743|       |
 1744|   115k|  const int diff_stride = block_size_wide[bsize];
 1745|   115k|  const int16_t *diff =
 1746|   115k|      x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col;
 1747|   115k|  const int bw = tx_size_wide[tx_size];
 1748|   115k|  const int bh = tx_size_high[tx_size];
 1749|       |
 1750|   115k|  float features[64] = { 0.0f };
 1751|   115k|  get_mean_dev_features(diff, diff_stride, bw, bh, features);
 1752|       |
 1753|   115k|  float score = 0.0f;
 1754|   115k|  av1_nn_predict(features, nn_config, 1, &score);
 1755|       |
 1756|   115k|  int int_score = (int)(score * 10000);
 1757|   115k|  return clamp(int_score, -80000, 80000);
 1758|   115k|}
tx_search.c:get_mean_dev_features:
 1694|   115k|                                        int bh, float *features) {
 1695|   115k|  const int16_t *const data_ptr = &data[0];
 1696|   115k|  const int subh = (bh >= bw) ? (bh >> 1) : bh;
  ------------------
  |  Branch (1696:20): [True: 115k, False: 2]
  ------------------
 1697|   115k|  const int subw = (bw >= bh) ? (bw >> 1) : bw;
  ------------------
  |  Branch (1697:20): [True: 115k, False: 487]
  ------------------
 1698|   115k|  const int num = bw * bh;
 1699|   115k|  const int sub_num = subw * subh;
 1700|   115k|  int feature_idx = 2;
 1701|   115k|  int total_x_sum = 0;
 1702|   115k|  int64_t total_x2_sum = 0;
 1703|   115k|  int num_sub_blks = 0;
 1704|   115k|  double mean2_sum = 0.0f;
 1705|   115k|  float dev_sum = 0.0f;
 1706|       |
 1707|   346k|  for (int row = 0; row < bh; row += subh) {
  ------------------
  |  Branch (1707:21): [True: 231k, False: 115k]
  ------------------
 1708|   692k|    for (int col = 0; col < bw; col += subw) {
  ------------------
  |  Branch (1708:23): [True: 461k, False: 231k]
  ------------------
 1709|   461k|      int x_sum;
 1710|   461k|      int64_t x2_sum;
 1711|       |      // TODO(any): Write a SIMD version. Clear registers.
 1712|   461k|      aom_get_blk_sse_sum(data_ptr + row * stride + col, stride, subw, subh,
 1713|   461k|                          &x_sum, &x2_sum);
 1714|   461k|      total_x_sum += x_sum;
 1715|   461k|      total_x2_sum += x2_sum;
 1716|       |
 1717|   461k|      const float mean = (float)x_sum / sub_num;
 1718|   461k|      const float dev = get_dev(mean, (double)x2_sum, sub_num);
 1719|   461k|      features[feature_idx++] = mean;
 1720|   461k|      features[feature_idx++] = dev;
 1721|   461k|      mean2_sum += (double)(mean * mean);
 1722|   461k|      dev_sum += dev;
 1723|   461k|      num_sub_blks++;
 1724|   461k|    }
 1725|   231k|  }
 1726|       |
 1727|   115k|  const float lvl0_mean = (float)total_x_sum / num;
 1728|   115k|  features[0] = lvl0_mean;
 1729|   115k|  features[1] = get_dev(lvl0_mean, (double)total_x2_sum, num);
 1730|       |
 1731|       |  // Deviation of means.
 1732|   115k|  features[feature_idx++] = get_dev(lvl0_mean, mean2_sum, num_sub_blks);
 1733|       |  // Mean of deviations.
 1734|   115k|  features[feature_idx++] = dev_sum / num_sub_blks;
 1735|       |
 1736|   115k|  return feature_idx;
 1737|   115k|}
tx_search.c:try_tx_block_split:
 2462|  26.2k|    FAST_TX_SEARCH_MODE ftxs_mode, RD_STATS *split_rd_stats) {
 2463|  26.2k|  assert(tx_size < TX_SIZES_ALL);
 2464|  26.2k|  MACROBLOCKD *const xd = &x->e_mbd;
 2465|  26.2k|  const int max_blocks_high = max_block_high(xd, plane_bsize, 0);
 2466|  26.2k|  const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0);
 2467|  26.2k|  const int txb_width = tx_size_wide_unit[tx_size];
 2468|  26.2k|  const int txb_height = tx_size_high_unit[tx_size];
 2469|       |  // Transform size after splitting current block.
 2470|  26.2k|  const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
 2471|  26.2k|  const int sub_txb_width = tx_size_wide_unit[sub_txs];
 2472|  26.2k|  const int sub_txb_height = tx_size_high_unit[sub_txs];
 2473|  26.2k|  const int sub_step = sub_txb_width * sub_txb_height;
 2474|  26.2k|  const int nblks = (txb_height / sub_txb_height) * (txb_width / sub_txb_width);
 2475|  26.2k|  assert(nblks > 0);
 2476|  26.2k|  av1_init_rd_stats(split_rd_stats);
 2477|  26.2k|  split_rd_stats->rate =
 2478|  26.2k|      x->mode_costs.txfm_partition_cost[txfm_partition_ctx][1];
 2479|       |
 2480|  61.4k|  for (int r = 0, blk_idx = 0; r < txb_height; r += sub_txb_height) {
  ------------------
  |  Branch (2480:32): [True: 48.3k, False: 13.0k]
  ------------------
 2481|  48.3k|    const int offsetr = blk_row + r;
 2482|  48.3k|    if (offsetr >= max_blocks_high) break;
  ------------------
  |  Branch (2482:9): [True: 0, False: 48.3k]
  ------------------
 2483|   125k|    for (int c = 0; c < txb_width; c += sub_txb_width, ++blk_idx) {
  ------------------
  |  Branch (2483:21): [True: 89.9k, False: 35.2k]
  ------------------
 2484|  89.9k|      assert(blk_idx < 4);
 2485|  89.9k|      (void)blk_idx;
 2486|  89.9k|      const int offsetc = blk_col + c;
 2487|  89.9k|      if (offsetc >= max_blocks_wide) continue;
  ------------------
  |  Branch (2487:11): [True: 0, False: 89.9k]
  ------------------
 2488|       |
 2489|  89.9k|      RD_STATS this_rd_stats;
 2490|  89.9k|      int this_cost_valid = 1;
 2491|  89.9k|      select_tx_block(cpi, x, offsetr, offsetc, block, sub_txs, depth + 1,
 2492|  89.9k|                      plane_bsize, ta, tl, tx_above, tx_left, &this_rd_stats,
 2493|  89.9k|                      no_split_rd / nblks, ref_best_rd - split_rd_stats->rdcost,
 2494|  89.9k|                      &this_cost_valid, ftxs_mode, -1);
 2495|  89.9k|      if (!this_cost_valid) {
  ------------------
  |  Branch (2495:11): [True: 11.8k, False: 78.1k]
  ------------------
 2496|  11.8k|        split_rd_stats->rdcost = INT64_MAX;
 2497|  11.8k|        return;
 2498|  11.8k|      }
 2499|  78.1k|      av1_merge_rd_stats(split_rd_stats, &this_rd_stats);
 2500|  78.1k|      split_rd_stats->rdcost =
 2501|  78.1k|          RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist);
  ------------------
  |  |   33|  78.1k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  78.1k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  78.1k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  78.1k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2502|  78.1k|      if (split_rd_stats->rdcost > ref_best_rd) {
  ------------------
  |  Branch (2502:11): [True: 1.30k, False: 76.8k]
  ------------------
 2503|  1.30k|        split_rd_stats->rdcost = INT64_MAX;
 2504|  1.30k|        return;
 2505|  1.30k|      }
 2506|  76.8k|      block += sub_step;
 2507|  76.8k|    }
 2508|  48.3k|  }
 2509|  26.2k|}
tx_search.c:choose_smallest_tx_size:
 2815|   476k|                                           int64_t ref_best_rd, BLOCK_SIZE bs) {
 2816|   476k|  MACROBLOCKD *const xd = &x->e_mbd;
 2817|   476k|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2818|       |
 2819|   476k|  mbmi->tx_size = TX_4X4;
 2820|       |  // TODO(any) : Pass this_rd based on skip/non-skip cost
 2821|   476k|  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd, 0, 0, bs, mbmi->tx_size,
 2822|   476k|                       FTXS_NONE);
 2823|   476k|}
tx_search.c:choose_largest_tx_size:
 2720|  21.7M|                                          int64_t ref_best_rd, BLOCK_SIZE bs) {
 2721|  21.7M|  MACROBLOCKD *const xd = &x->e_mbd;
 2722|  21.7M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2723|  21.7M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 2724|  21.7M|  mbmi->tx_size = tx_size_from_tx_mode(bs, txfm_params->tx_mode_search_type);
 2725|       |
 2726|       |  // If tx64 is not enabled, we need to go down to the next available size
 2727|  21.7M|  if (!cpi->oxcf.txfm_cfg.enable_tx64 && cpi->oxcf.txfm_cfg.enable_rect_tx) {
  ------------------
  |  Branch (2727:7): [True: 0, False: 21.7M]
  |  Branch (2727:42): [True: 0, False: 0]
  ------------------
 2728|      0|    static const TX_SIZE tx_size_max_32[TX_SIZES_ALL] = {
 2729|      0|      TX_4X4,    // 4x4 transform
 2730|      0|      TX_8X8,    // 8x8 transform
 2731|      0|      TX_16X16,  // 16x16 transform
 2732|      0|      TX_32X32,  // 32x32 transform
 2733|      0|      TX_32X32,  // 64x64 transform
 2734|      0|      TX_4X8,    // 4x8 transform
 2735|      0|      TX_8X4,    // 8x4 transform
 2736|      0|      TX_8X16,   // 8x16 transform
 2737|      0|      TX_16X8,   // 16x8 transform
 2738|      0|      TX_16X32,  // 16x32 transform
 2739|      0|      TX_32X16,  // 32x16 transform
 2740|      0|      TX_32X32,  // 32x64 transform
 2741|      0|      TX_32X32,  // 64x32 transform
 2742|      0|      TX_4X16,   // 4x16 transform
 2743|      0|      TX_16X4,   // 16x4 transform
 2744|      0|      TX_8X32,   // 8x32 transform
 2745|      0|      TX_32X8,   // 32x8 transform
 2746|      0|      TX_16X32,  // 16x64 transform
 2747|      0|      TX_32X16,  // 64x16 transform
 2748|      0|    };
 2749|      0|    mbmi->tx_size = tx_size_max_32[mbmi->tx_size];
 2750|  21.7M|  } else if (cpi->oxcf.txfm_cfg.enable_tx64 &&
  ------------------
  |  Branch (2750:14): [True: 21.7M, False: 3.96k]
  ------------------
 2751|  21.7M|             !cpi->oxcf.txfm_cfg.enable_rect_tx) {
  ------------------
  |  Branch (2751:14): [True: 0, False: 21.7M]
  ------------------
 2752|      0|    static const TX_SIZE tx_size_max_square[TX_SIZES_ALL] = {
 2753|      0|      TX_4X4,    // 4x4 transform
 2754|      0|      TX_8X8,    // 8x8 transform
 2755|      0|      TX_16X16,  // 16x16 transform
 2756|      0|      TX_32X32,  // 32x32 transform
 2757|      0|      TX_64X64,  // 64x64 transform
 2758|      0|      TX_4X4,    // 4x8 transform
 2759|      0|      TX_4X4,    // 8x4 transform
 2760|      0|      TX_8X8,    // 8x16 transform
 2761|      0|      TX_8X8,    // 16x8 transform
 2762|      0|      TX_16X16,  // 16x32 transform
 2763|      0|      TX_16X16,  // 32x16 transform
 2764|      0|      TX_32X32,  // 32x64 transform
 2765|      0|      TX_32X32,  // 64x32 transform
 2766|      0|      TX_4X4,    // 4x16 transform
 2767|      0|      TX_4X4,    // 16x4 transform
 2768|      0|      TX_8X8,    // 8x32 transform
 2769|      0|      TX_8X8,    // 32x8 transform
 2770|      0|      TX_16X16,  // 16x64 transform
 2771|      0|      TX_16X16,  // 64x16 transform
 2772|      0|    };
 2773|      0|    mbmi->tx_size = tx_size_max_square[mbmi->tx_size];
 2774|  21.7M|  } else if (!cpi->oxcf.txfm_cfg.enable_tx64 &&
  ------------------
  |  Branch (2774:14): [True: 0, False: 21.7M]
  ------------------
 2775|      0|             !cpi->oxcf.txfm_cfg.enable_rect_tx) {
  ------------------
  |  Branch (2775:14): [True: 0, False: 0]
  ------------------
 2776|      0|    static const TX_SIZE tx_size_max_32_square[TX_SIZES_ALL] = {
 2777|      0|      TX_4X4,    // 4x4 transform
 2778|      0|      TX_8X8,    // 8x8 transform
 2779|      0|      TX_16X16,  // 16x16 transform
 2780|      0|      TX_32X32,  // 32x32 transform
 2781|      0|      TX_32X32,  // 64x64 transform
 2782|      0|      TX_4X4,    // 4x8 transform
 2783|      0|      TX_4X4,    // 8x4 transform
 2784|      0|      TX_8X8,    // 8x16 transform
 2785|      0|      TX_8X8,    // 16x8 transform
 2786|      0|      TX_16X16,  // 16x32 transform
 2787|      0|      TX_16X16,  // 32x16 transform
 2788|      0|      TX_32X32,  // 32x64 transform
 2789|      0|      TX_32X32,  // 64x32 transform
 2790|      0|      TX_4X4,    // 4x16 transform
 2791|      0|      TX_4X4,    // 16x4 transform
 2792|      0|      TX_8X8,    // 8x32 transform
 2793|      0|      TX_8X8,    // 32x8 transform
 2794|      0|      TX_16X16,  // 16x64 transform
 2795|      0|      TX_16X16,  // 64x16 transform
 2796|      0|    };
 2797|       |
 2798|      0|    mbmi->tx_size = tx_size_max_32_square[mbmi->tx_size];
 2799|      0|  }
 2800|       |
 2801|  21.7M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 2802|  21.7M|  const int no_skip_txfm_rate = x->mode_costs.skip_txfm_cost[skip_ctx][0];
 2803|  21.7M|  const int skip_txfm_rate = x->mode_costs.skip_txfm_cost[skip_ctx][1];
 2804|       |  // Skip RDcost is used only for Inter blocks
 2805|  21.7M|  const int64_t skip_txfm_rd =
 2806|  21.7M|      is_inter_block(mbmi) ? RDCOST(x->rdmult, skip_txfm_rate, 0) : INT64_MAX;
  ------------------
  |  |   33|  3.98M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  3.98M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  3.98M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  3.98M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2806:7): [True: 3.98M, False: 17.7M]
  ------------------
 2807|  21.7M|  const int64_t no_skip_txfm_rd = RDCOST(x->rdmult, no_skip_txfm_rate, 0);
  ------------------
  |  |   33|  21.7M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  21.7M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  21.7M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  21.7M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2808|  21.7M|  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd,
 2809|  21.7M|                       AOMMIN(no_skip_txfm_rd, skip_txfm_rd), AOM_PLANE_Y, bs,
  ------------------
  |  |   34|  21.7M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 21.6M, False: 130k]
  |  |  ------------------
  ------------------
                                     AOMMIN(no_skip_txfm_rd, skip_txfm_rd), AOM_PLANE_Y, bs,
  ------------------
  |  |  281|  21.7M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2810|  21.7M|                       mbmi->tx_size, FTXS_NONE);
 2811|  21.7M|}
tx_search.c:choose_tx_size_type_from_rd:
 2974|  2.30M|                                               BLOCK_SIZE bs) {
 2975|  2.30M|  av1_invalid_rd_stats(rd_stats);
 2976|       |
 2977|  2.30M|  MACROBLOCKD *const xd = &x->e_mbd;
 2978|  2.30M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2979|  2.30M|  TxfmSearchParams *const txfm_params = &x->txfm_search_params;
 2980|  2.30M|  const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bs];
 2981|  2.30M|  const int tx_select = txfm_params->tx_mode_search_type == TX_MODE_SELECT;
 2982|  2.30M|  int start_tx;
 2983|       |  // The split depth can be at most MAX_TX_DEPTH, so the init_depth controls
 2984|       |  // how many times of splitting is allowed during the RD search.
 2985|  2.30M|  int init_depth;
 2986|       |
 2987|  2.30M|  if (tx_select) {
  ------------------
  |  Branch (2987:7): [True: 2.30M, False: 86]
  ------------------
 2988|  2.30M|    start_tx = max_rect_tx_size;
 2989|  2.30M|    init_depth = get_search_init_depth(mi_size_wide[bs], mi_size_high[bs],
 2990|  2.30M|                                       is_inter_block(mbmi), &cpi->sf,
 2991|  2.30M|                                       txfm_params->tx_size_search_method);
 2992|  2.30M|    if (init_depth == MAX_TX_DEPTH && !cpi->oxcf.txfm_cfg.enable_tx64 &&
  ------------------
  |  |  180|  4.60M|#define MAX_TX_DEPTH 2
  ------------------
  |  Branch (2992:9): [True: 61.2k, False: 2.24M]
  |  Branch (2992:39): [True: 0, False: 61.2k]
  ------------------
 2993|      0|        txsize_sqr_up_map[start_tx] == TX_64X64) {
  ------------------
  |  Branch (2993:9): [True: 0, False: 0]
  ------------------
 2994|      0|      start_tx = sub_tx_size_map[start_tx];
 2995|      0|    }
 2996|  2.30M|  } else {
 2997|     86|    const TX_SIZE chosen_tx_size =
 2998|     86|        tx_size_from_tx_mode(bs, txfm_params->tx_mode_search_type);
 2999|     86|    start_tx = chosen_tx_size;
 3000|     86|    init_depth = MAX_TX_DEPTH;
  ------------------
  |  |  180|     86|#define MAX_TX_DEPTH 2
  ------------------
 3001|     86|  }
 3002|       |
 3003|  2.30M|  uint8_t best_txk_type_map[MAX_MIB_SIZE * MAX_MIB_SIZE];
 3004|  2.30M|  TX_SIZE best_tx_size = max_rect_tx_size;
 3005|  2.30M|  int64_t best_rd = INT64_MAX;
 3006|  2.30M|  const int num_blks = bsize_to_num_blk(bs);
 3007|  2.30M|  x->rd_model = FULL_TXFM_RD;
 3008|  2.30M|  int64_t rd[MAX_TX_DEPTH + 1] = { INT64_MAX, INT64_MAX, INT64_MAX };
 3009|  4.52M|  for (int tx_size = start_tx, depth = init_depth; depth <= MAX_TX_DEPTH;
  ------------------
  |  |  180|  4.52M|#define MAX_TX_DEPTH 2
  ------------------
  |  Branch (3009:52): [True: 4.32M, False: 203k]
  ------------------
 3010|  4.32M|       depth++, tx_size = sub_tx_size_map[tx_size]) {
 3011|  4.32M|    if ((!cpi->oxcf.txfm_cfg.enable_tx64 &&
  ------------------
  |  Branch (3011:10): [True: 0, False: 4.32M]
  ------------------
 3012|      0|         txsize_sqr_up_map[tx_size] == TX_64X64) ||
  ------------------
  |  Branch (3012:10): [True: 0, False: 0]
  ------------------
 3013|  4.32M|        (!cpi->oxcf.txfm_cfg.enable_rect_tx &&
  ------------------
  |  Branch (3013:10): [True: 0, False: 4.32M]
  ------------------
 3014|      0|         tx_size_wide[tx_size] != tx_size_high[tx_size])) {
  ------------------
  |  Branch (3014:10): [True: 0, False: 0]
  ------------------
 3015|      0|      continue;
 3016|      0|    }
 3017|       |
 3018|  4.32M|#if !CONFIG_REALTIME_ONLY
 3019|  4.32M|    if (txfm_params->nn_prune_depths_for_intra_tx == TX_PRUNE_SPLIT) break;
  ------------------
  |  Branch (3019:9): [True: 0, False: 4.32M]
  ------------------
 3020|       |
 3021|       |    // Set the flag to enable the evaluation of NN classifier to prune transform
 3022|       |    // depths. As the features are based on intra residual information of
 3023|       |    // largest transform, the evaluation of NN model is enabled only for this
 3024|       |    // case.
 3025|  4.32M|    txfm_params->enable_nn_prune_intra_tx_depths =
 3026|  4.32M|        (cpi->sf.tx_sf.prune_intra_tx_depths_using_nn && tx_size == start_tx);
  ------------------
  |  Branch (3026:10): [True: 0, False: 4.32M]
  |  Branch (3026:58): [True: 0, False: 0]
  ------------------
 3027|  4.32M|#endif
 3028|       |
 3029|  4.32M|    RD_STATS this_rd_stats;
 3030|       |    // When the speed feature use_rd_based_breakout_for_intra_tx_search is
 3031|       |    // enabled, use the known minimum best_rd for early termination.
 3032|  4.32M|    const int64_t rd_thresh =
 3033|  4.32M|        cpi->sf.tx_sf.use_rd_based_breakout_for_intra_tx_search
  ------------------
  |  Branch (3033:9): [True: 0, False: 4.32M]
  ------------------
 3034|  4.32M|            ? AOMMIN(ref_best_rd, best_rd)
  ------------------
  |  |   34|      0|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3035|  4.32M|            : ref_best_rd;
 3036|  4.32M|    rd[depth] = uniform_txfm_yrd(cpi, x, &this_rd_stats, rd_thresh, bs, tx_size,
 3037|  4.32M|                                 FTXS_NONE);
 3038|  4.32M|    if (rd[depth] < best_rd) {
  ------------------
  |  Branch (3038:9): [True: 3.05M, False: 1.26M]
  ------------------
 3039|  3.05M|      av1_copy_array(best_txk_type_map, xd->tx_type_map, num_blks);
  ------------------
  |  |   38|  3.05M|  do {                                                    \
  |  |   39|  3.05M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  3.05M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  3.05M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 3.05M]
  |  |  ------------------
  ------------------
 3040|  3.05M|      best_tx_size = tx_size;
 3041|  3.05M|      best_rd = rd[depth];
 3042|  3.05M|      *rd_stats = this_rd_stats;
 3043|  3.05M|    }
 3044|  4.32M|    if (tx_size == TX_4X4) break;
  ------------------
  |  Branch (3044:9): [True: 2.10M, False: 2.22M]
  ------------------
 3045|       |    // If we are searching three depths, prune the smallest size depending
 3046|       |    // on rd results for the first two depths for low contrast blocks.
 3047|  2.22M|    if (depth > init_depth && depth != MAX_TX_DEPTH &&
  ------------------
  |  |  180|  2.36M|#define MAX_TX_DEPTH 2
  ------------------
  |  Branch (3047:9): [True: 143k, False: 2.08M]
  |  Branch (3047:31): [True: 0, False: 143k]
  ------------------
 3048|      0|        x->source_variance < 256) {
  ------------------
  |  Branch (3048:9): [True: 0, False: 0]
  ------------------
 3049|      0|      if (rd[depth - 1] != INT64_MAX && rd[depth] > rd[depth - 1]) break;
  ------------------
  |  Branch (3049:11): [True: 0, False: 0]
  |  Branch (3049:41): [True: 0, False: 0]
  ------------------
 3050|      0|    }
 3051|  2.22M|  }
 3052|       |
 3053|  2.30M|  if (rd_stats->rate != INT_MAX) {
  ------------------
  |  Branch (3053:7): [True: 2.29M, False: 12.3k]
  ------------------
 3054|  2.29M|    mbmi->tx_size = best_tx_size;
 3055|  2.29M|    av1_copy_array(xd->tx_type_map, best_txk_type_map, num_blks);
  ------------------
  |  |   38|  2.29M|  do {                                                    \
  |  |   39|  2.29M|    static_assert(sizeof(*(dest)) == sizeof(*(src)), ""); \
  |  |   40|  2.29M|    memcpy(dest, src, n * sizeof(*(src)));                \
  |  |   41|  2.29M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.29M]
  |  |  ------------------
  ------------------
 3056|  2.29M|  }
 3057|       |
 3058|  2.30M|#if !CONFIG_REALTIME_ONLY
 3059|       |  // Reset the flags to avoid any unintentional evaluation of NN model and
 3060|       |  // consumption of prune depths.
 3061|       |  txfm_params->enable_nn_prune_intra_tx_depths = false;
 3062|  2.30M|  txfm_params->nn_prune_depths_for_intra_tx = TX_PRUNE_NONE;
 3063|  2.30M|#endif
 3064|  2.30M|}
tx_search.c:uniform_txfm_yrd:
 2911|  4.32M|                                FAST_TX_SEARCH_MODE ftxs_mode) {
 2912|  4.32M|  assert(IMPLIES(is_rect_tx(tx_size), is_rect_tx_allowed_bsize(bs)));
 2913|  4.32M|  MACROBLOCKD *const xd = &x->e_mbd;
 2914|  4.32M|  MB_MODE_INFO *const mbmi = xd->mi[0];
 2915|  4.32M|  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
 2916|  4.32M|  const ModeCosts *mode_costs = &x->mode_costs;
 2917|  4.32M|  const int is_inter = is_inter_block(mbmi);
 2918|  4.32M|  const int tx_select = txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
  ------------------
  |  Branch (2918:25): [True: 4.32M, False: 493]
  ------------------
 2919|  4.32M|                        block_signals_txsize(mbmi->bsize);
  ------------------
  |  Branch (2919:25): [True: 4.10M, False: 222k]
  ------------------
 2920|  4.32M|  int tx_size_rate = 0;
 2921|  4.32M|  if (tx_select) {
  ------------------
  |  Branch (2921:7): [True: 4.10M, False: 223k]
  ------------------
 2922|  4.10M|    const int ctx = txfm_partition_context(
 2923|  4.10M|        xd->above_txfm_context, xd->left_txfm_context, mbmi->bsize, tx_size);
 2924|  4.10M|    tx_size_rate = is_inter ? mode_costs->txfm_partition_cost[ctx][0]
  ------------------
  |  Branch (2924:20): [True: 0, False: 4.10M]
  ------------------
 2925|  4.10M|                            : tx_size_cost(x, bs, tx_size);
 2926|  4.10M|  }
 2927|  4.32M|  const int skip_ctx = av1_get_skip_txfm_context(xd);
 2928|  4.32M|  const int no_skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][0];
 2929|  4.32M|  const int skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][1];
 2930|  4.32M|  const int64_t skip_txfm_rd =
 2931|  4.32M|      is_inter ? RDCOST(x->rdmult, skip_txfm_rate, 0) : INT64_MAX;
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  |  Branch (2931:7): [True: 0, False: 4.32M]
  ------------------
 2932|  4.32M|  const int64_t no_this_rd =
 2933|  4.32M|      RDCOST(x->rdmult, no_skip_txfm_rate + tx_size_rate, 0);
  ------------------
  |  |   33|  4.32M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.32M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.32M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.32M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2934|       |
 2935|  4.32M|  mbmi->tx_size = tx_size;
 2936|  4.32M|  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd,
 2937|  4.32M|                       AOMMIN(no_this_rd, skip_txfm_rd), AOM_PLANE_Y, bs,
  ------------------
  |  |   34|  4.32M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 4.32M, False: 1.09k]
  |  |  ------------------
  ------------------
                                     AOMMIN(no_this_rd, skip_txfm_rd), AOM_PLANE_Y, bs,
  ------------------
  |  |  281|  4.32M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 2938|  4.32M|                       tx_size, ftxs_mode);
 2939|  4.32M|  if (rd_stats->rate == INT_MAX) return INT64_MAX;
  ------------------
  |  Branch (2939:7): [True: 51.5k, False: 4.27M]
  ------------------
 2940|       |
 2941|  4.27M|  int64_t rd;
 2942|       |  // rdstats->rate should include all the rate except skip/non-skip cost as the
 2943|       |  // same is accounted in the caller functions after rd evaluation of all
 2944|       |  // planes. However the decisions should be done after considering the
 2945|       |  // skip/non-skip header cost
 2946|  4.27M|  if (rd_stats->skip_txfm && is_inter) {
  ------------------
  |  Branch (2946:7): [True: 0, False: 4.27M]
  |  Branch (2946:30): [True: 0, False: 0]
  ------------------
 2947|      0|    rd = RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2948|  4.27M|  } else {
 2949|       |    // Intra blocks are always signalled as non-skip
 2950|  4.27M|    rd = RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_rate + tx_size_rate,
  ------------------
  |  |   33|  4.27M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  4.27M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  4.27M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  4.27M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2951|  4.27M|                rd_stats->dist);
 2952|  4.27M|    rd_stats->rate += tx_size_rate;
 2953|  4.27M|  }
 2954|       |  // Check if forcing the block to skip transform leads to smaller RD cost.
 2955|  4.27M|  if (is_inter && !rd_stats->skip_txfm && !xd->lossless[mbmi->segment_id]) {
  ------------------
  |  Branch (2955:7): [True: 0, False: 4.27M]
  |  Branch (2955:19): [True: 0, False: 0]
  |  Branch (2955:43): [True: 0, False: 0]
  ------------------
 2956|      0|    int64_t temp_skip_txfm_rd =
 2957|      0|        RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
  ------------------
  |  |   33|      0|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|      0|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|      0|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 2958|      0|    if (temp_skip_txfm_rd <= rd) {
  ------------------
  |  Branch (2958:9): [True: 0, False: 0]
  ------------------
 2959|      0|      rd = temp_skip_txfm_rd;
 2960|      0|      rd_stats->rate = 0;
 2961|      0|      rd_stats->dist = rd_stats->sse;
 2962|      0|      rd_stats->skip_txfm = 1;
 2963|      0|    }
 2964|      0|  }
 2965|       |
 2966|  4.27M|  return rd;
 2967|  4.32M|}
tx_search.c:block_rd_txfm:
 3070|  65.2M|                                 void *arg) {
 3071|  65.2M|  struct rdcost_block_args *args = arg;
 3072|  65.2M|  if (args->exit_early) {
  ------------------
  |  Branch (3072:7): [True: 90.2k, False: 65.1M]
  ------------------
 3073|  90.2k|    args->incomplete_exit = 1;
 3074|  90.2k|    return;
 3075|  90.2k|  }
 3076|       |
 3077|  65.1M|  MACROBLOCK *const x = args->x;
 3078|  65.1M|  MACROBLOCKD *const xd = &x->e_mbd;
 3079|  65.1M|  const int is_inter = is_inter_block(xd->mi[0]);
 3080|  65.1M|  const AV1_COMP *cpi = args->cpi;
 3081|  65.1M|  ENTROPY_CONTEXT *a = args->t_above + blk_col;
 3082|  65.1M|  ENTROPY_CONTEXT *l = args->t_left + blk_row;
 3083|  65.1M|  const AV1_COMMON *cm = &cpi->common;
 3084|  65.1M|  RD_STATS this_rd_stats;
 3085|  65.1M|  av1_init_rd_stats(&this_rd_stats);
 3086|       |
 3087|  65.1M|  if (!is_inter) {
  ------------------
  |  Branch (3087:7): [True: 56.6M, False: 8.50M]
  ------------------
 3088|  56.6M|    av1_predict_intra_block_facade(cm, xd, plane, blk_col, blk_row, tx_size);
 3089|  56.6M|    av1_subtract_txb(x, plane, plane_bsize, blk_col, blk_row, tx_size, DCT_DCT,
 3090|  56.6M|                     false);
 3091|  56.6M|#if !CONFIG_REALTIME_ONLY
 3092|  56.6M|    const TxfmSearchParams *const txfm_params = &x->txfm_search_params;
 3093|  56.6M|    if (txfm_params->enable_nn_prune_intra_tx_depths) {
  ------------------
  |  Branch (3093:9): [True: 0, False: 56.6M]
  ------------------
 3094|      0|      ml_predict_intra_tx_depth_prune(x, blk_row, blk_col, plane_bsize,
 3095|      0|                                      tx_size);
 3096|      0|      if (txfm_params->nn_prune_depths_for_intra_tx == TX_PRUNE_LARGEST) {
  ------------------
  |  Branch (3096:11): [True: 0, False: 0]
  ------------------
 3097|      0|        av1_invalid_rd_stats(&args->rd_stats);
 3098|      0|        args->exit_early = 1;
 3099|      0|        return;
 3100|      0|      }
 3101|      0|    }
 3102|  56.6M|#endif
 3103|  56.6M|  }
 3104|       |
 3105|  65.1M|  TXB_CTX txb_ctx;
 3106|  65.1M|  get_txb_ctx(plane_bsize, tx_size, plane, a, l, &txb_ctx);
 3107|  65.1M|  search_tx_type(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
 3108|  65.1M|                 &txb_ctx, args->ftxs_mode, args->best_rd - args->current_rd,
 3109|  65.1M|                 &this_rd_stats);
 3110|       |
 3111|  65.1M|#if !CONFIG_REALTIME_ONLY
 3112|  65.1M|  if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
  ------------------
  |  |  281|   130M|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
  |  Branch (3112:7): [True: 33.9M, False: 31.1M]
  |  Branch (3112:31): [True: 0, False: 33.9M]
  ------------------
 3113|      0|    assert(!is_inter || plane_bsize < BLOCK_8X8);
 3114|      0|    cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
 3115|      0|  }
 3116|  65.1M|#endif
 3117|       |
 3118|       |#if CONFIG_RD_DEBUG
 3119|       |  update_txb_coeff_cost(&this_rd_stats, plane, this_rd_stats.rate);
 3120|       |#endif  // CONFIG_RD_DEBUG
 3121|  65.1M|  av1_set_txb_context(x, plane, block, tx_size, a, l);
 3122|       |
 3123|  65.1M|  int64_t rd;
 3124|  65.1M|  if (is_inter) {
  ------------------
  |  Branch (3124:7): [True: 8.52M, False: 56.6M]
  ------------------
 3125|  8.52M|    const int64_t no_skip_txfm_rd =
 3126|  8.52M|        RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);
  ------------------
  |  |   33|  8.52M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  8.52M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  8.52M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  8.52M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3127|  8.52M|    const int64_t skip_txfm_rd = RDCOST(x->rdmult, 0, this_rd_stats.sse);
  ------------------
  |  |   33|  8.52M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  8.52M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  8.52M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  8.52M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3128|  8.52M|    rd = AOMMIN(no_skip_txfm_rd, skip_txfm_rd);
  ------------------
  |  |   34|  8.52M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.19M, False: 1.32M]
  |  |  ------------------
  ------------------
 3129|  8.52M|    this_rd_stats.skip_txfm &= !x->plane[plane].eobs[block];
 3130|  56.6M|  } else {
 3131|       |    // Signal non-skip_txfm for Intra blocks
 3132|  56.6M|    rd = RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);
  ------------------
  |  |   33|  56.6M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  56.6M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  56.6M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  56.6M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
 3133|  56.6M|    this_rd_stats.skip_txfm = 0;
 3134|  56.6M|  }
 3135|       |
 3136|  65.1M|  av1_merge_rd_stats(&args->rd_stats, &this_rd_stats);
 3137|       |
 3138|  65.1M|  args->current_rd += rd;
 3139|  65.1M|  if (args->current_rd > args->best_rd) args->exit_early = 1;
  ------------------
  |  Branch (3139:7): [True: 5.37M, False: 59.7M]
  ------------------
 3140|  65.1M|}

palette.c:tx_size_cost:
   37|   493k|                               TX_SIZE tx_size) {
   38|   493k|  assert(bsize == x->e_mbd.mi[0]->bsize);
   39|   493k|  if (x->txfm_search_params.tx_mode_search_type != TX_MODE_SELECT ||
  ------------------
  |  Branch (39:7): [True: 56.3k, False: 436k]
  ------------------
   40|   436k|      !block_signals_txsize(bsize))
  ------------------
  |  Branch (40:7): [True: 18.4E, False: 436k]
  ------------------
   41|  56.3k|    return 0;
   42|       |
   43|   436k|  const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
   44|   436k|  const int depth = tx_size_to_depth(tx_size, bsize);
   45|   436k|  const MACROBLOCKD *const xd = &x->e_mbd;
   46|   436k|  const int tx_size_ctx = get_tx_size_context(xd);
   47|   436k|  return x->mode_costs.tx_size_cost[tx_size_cat][tx_size_ctx][depth];
   48|   493k|}
rdopt.c:tx_size_cost:
   37|  1.34M|                               TX_SIZE tx_size) {
   38|  1.34M|  assert(bsize == x->e_mbd.mi[0]->bsize);
   39|  1.34M|  if (x->txfm_search_params.tx_mode_search_type != TX_MODE_SELECT ||
  ------------------
  |  Branch (39:7): [True: 1.34M, False: 0]
  ------------------
   40|      0|      !block_signals_txsize(bsize))
  ------------------
  |  Branch (40:7): [True: 0, False: 0]
  ------------------
   41|  1.34M|    return 0;
   42|       |
   43|  18.4E|  const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
   44|  18.4E|  const int depth = tx_size_to_depth(tx_size, bsize);
   45|  18.4E|  const MACROBLOCKD *const xd = &x->e_mbd;
   46|  18.4E|  const int tx_size_ctx = get_tx_size_context(xd);
   47|  18.4E|  return x->mode_costs.tx_size_cost[tx_size_cat][tx_size_ctx][depth];
   48|  1.34M|}
tx_search.c:tx_size_cost:
   37|  4.10M|                               TX_SIZE tx_size) {
   38|  4.10M|  assert(bsize == x->e_mbd.mi[0]->bsize);
   39|  4.10M|  if (x->txfm_search_params.tx_mode_search_type != TX_MODE_SELECT ||
  ------------------
  |  Branch (39:7): [True: 18.4E, False: 4.10M]
  ------------------
   40|  4.10M|      !block_signals_txsize(bsize))
  ------------------
  |  Branch (40:7): [True: 352, False: 4.10M]
  ------------------
   41|      0|    return 0;
   42|       |
   43|  4.10M|  const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
   44|  4.10M|  const int depth = tx_size_to_depth(tx_size, bsize);
   45|  4.10M|  const MACROBLOCKD *const xd = &x->e_mbd;
   46|  4.10M|  const int tx_size_ctx = get_tx_size_context(xd);
   47|  4.10M|  return x->mode_costs.tx_size_cost[tx_size_cat][tx_size_ctx][depth];
   48|  4.10M|}
intra_mode_search.c:tx_size_cost:
   37|  1.44M|                               TX_SIZE tx_size) {
   38|  1.44M|  assert(bsize == x->e_mbd.mi[0]->bsize);
   39|  1.44M|  if (x->txfm_search_params.tx_mode_search_type != TX_MODE_SELECT ||
  ------------------
  |  Branch (39:7): [True: 1.10M, False: 336k]
  ------------------
   40|   336k|      !block_signals_txsize(bsize))
  ------------------
  |  Branch (40:7): [True: 8, False: 336k]
  ------------------
   41|  1.10M|    return 0;
   42|       |
   43|   336k|  const int32_t tx_size_cat = bsize_to_tx_size_cat(bsize);
   44|   336k|  const int depth = tx_size_to_depth(tx_size, bsize);
   45|   336k|  const MACROBLOCKD *const xd = &x->e_mbd;
   46|   336k|  const int tx_size_ctx = get_tx_size_context(xd);
   47|   336k|  return x->mode_costs.tx_size_cost[tx_size_cat][tx_size_ctx][depth];
   48|  1.44M|}

av1_optimize_txb:
  403|  54.0M|                     int sharpness) {
  404|  54.0M|  MACROBLOCKD *xd = &x->e_mbd;
  405|  54.0M|  const struct macroblock_plane *p = &x->plane[plane];
  406|  54.0M|  const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type);
  407|  54.0M|  const int16_t *scan = scan_order->scan;
  408|  54.0M|  const int shift = av1_get_tx_scale(tx_size);
  409|  54.0M|  int eob = p->eobs[block];
  410|  54.0M|  const int16_t *dequant = p->dequant_QTX;
  411|  54.0M|  const qm_val_t *iqmatrix =
  412|  54.0M|      av1_get_iqmatrix(&cpi->common.quant_params, xd, plane, tx_size, tx_type);
  413|  54.0M|  const qm_val_t *qmatrix =
  414|  54.0M|      cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR
  ------------------
  |  Branch (414:7): [True: 42.1M, False: 11.8M]
  ------------------
  415|  54.0M|          ? av1_get_qmatrix(&cpi->common.quant_params, xd, plane, tx_size,
  416|  42.1M|                            tx_type)
  417|  54.0M|          : NULL;
  418|  54.0M|  const int block_offset = BLOCK_OFFSET(block);
  ------------------
  |  |  489|  54.0M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  419|  54.0M|  tran_low_t *qcoeff = p->qcoeff + block_offset;
  420|  54.0M|  tran_low_t *dqcoeff = p->dqcoeff + block_offset;
  421|  54.0M|  const tran_low_t *tcoeff = p->coeff + block_offset;
  422|  54.0M|  const CoeffCosts *coeff_costs = &x->coeff_costs;
  423|       |
  424|       |  // This function is not called if eob = 0.
  425|  54.0M|  assert(eob > 0);
  426|       |
  427|  54.0M|  const AV1_COMMON *cm = &cpi->common;
  428|  54.0M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  429|  54.0M|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  430|  54.0M|  const TX_CLASS tx_class = tx_type_to_class[tx_type];
  431|  54.0M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  432|  54.0M|  const int bhl = get_txb_bhl(tx_size);
  433|  54.0M|  const int width = get_txb_wide(tx_size);
  434|  54.0M|  const int height = get_txb_high(tx_size);
  435|  54.0M|  assert(height == (1 << bhl));
  436|  54.0M|  const int is_inter = is_inter_block(mbmi);
  437|  54.0M|  const LV_MAP_COEFF_COST *txb_costs =
  438|  54.0M|      &coeff_costs->coeff_costs[txs_ctx][plane_type];
  439|  54.0M|  const int eob_multi_size = txsize_log2_minus4[tx_size];
  440|  54.0M|  const LV_MAP_EOB_COST *txb_eob_costs =
  441|  54.0M|      &coeff_costs->eob_costs[eob_multi_size][plane_type];
  442|       |
  443|       |  // For the IQ and SSIMULACRA 2 tunings, increase rshift from 2 to 4.
  444|       |  // This biases trellis quantization towards keeping more coefficients, and
  445|       |  // together with the IQ and SSIMULACRA2 rdmult adjustment in
  446|       |  // av1_compute_rd_mult_based_on_qindex(), this helps preserve image
  447|       |  // features (like repeating patterns and camera noise/film grain), which
  448|       |  // improves SSIMULACRA 2 scores.
  449|  54.0M|  const int rshift = (cpi->oxcf.tune_cfg.tuning == AOM_TUNE_IQ ||
  ------------------
  |  Branch (449:23): [True: 42.1M, False: 11.8M]
  ------------------
  450|  11.8M|                      cpi->oxcf.tune_cfg.tuning == AOM_TUNE_SSIMULACRA2)
  ------------------
  |  Branch (450:23): [True: 18.4E, False: 11.8M]
  ------------------
  451|  54.0M|                         ? 7
  452|  54.0M|                         : 5;
  453|       |
  454|  54.0M|  const int(*trellis_rd_mult)[2] = cpi->sf.tx_sf.use_chroma_trellis_rd_mult
  ------------------
  |  Branch (454:36): [True: 0, False: 54.0M]
  ------------------
  455|  54.0M|                                       ? plane_rd_mult_chroma
  456|  54.0M|                                       : plane_rd_mult;
  457|  54.0M|  const int64_t rdmult = ROUND_POWER_OF_TWO(
  ------------------
  |  |   41|  54.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
  458|  54.0M|      (int64_t)x->rdmult * (8 - sharpness) *
  459|  54.0M|          (trellis_rd_mult[is_inter][plane_type] << (2 * (xd->bd - 8))),
  460|  54.0M|      rshift);
  461|       |
  462|  54.0M|  uint8_t levels_buf[TX_PAD_2D];
  463|  54.0M|  uint8_t *const levels = set_levels(levels_buf, height);
  464|       |
  465|  54.0M|  if (eob > 1) av1_txb_init_levels(qcoeff, width, height, levels);
  ------------------
  |  Branch (465:7): [True: 50.5M, False: 3.43M]
  ------------------
  466|       |
  467|       |  // TODO(angirbird): check iqmatrix
  468|       |
  469|  54.0M|  const int non_skip_cost = txb_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][0];
  470|  54.0M|  const int skip_cost = txb_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1];
  471|  54.0M|  const int eob_cost = get_eob_cost(eob, txb_eob_costs, txb_costs, tx_class);
  472|  54.0M|  int accu_rate = eob_cost;
  473|  54.0M|  int64_t accu_dist = 0;
  474|  54.0M|  int si = eob - 1;
  475|  54.0M|  const int ci = scan[si];
  476|  54.0M|  const tran_low_t qc = qcoeff[ci];
  477|  54.0M|  const tran_low_t abs_qc = abs(qc);
  478|  54.0M|  const int sign = qc < 0;
  479|  54.0M|  const int max_nz_num = 2;
  480|  54.0M|  int nz_num = 1;
  481|  54.0M|  int nz_ci[3] = { ci, 0, 0 };
  482|  54.0M|  if (abs_qc >= 2) {
  ------------------
  |  Branch (482:7): [True: 18.3M, False: 35.6M]
  ------------------
  483|  18.3M|    update_coeff_general(&accu_rate, &accu_dist, si, eob, tx_size, tx_class,
  484|  18.3M|                         bhl, width, rdmult, shift, txb_ctx->dc_sign_ctx,
  485|  18.3M|                         dequant, scan, txb_costs, tcoeff, qcoeff, dqcoeff,
  486|  18.3M|                         levels, iqmatrix, qmatrix);
  487|  18.3M|    --si;
  488|  35.6M|  } else {
  489|  35.6M|    assert(abs_qc == 1);
  490|  35.6M|    const int coeff_ctx = get_lower_levels_ctx_eob(bhl, width, si);
  491|  35.6M|    accu_rate +=
  492|  35.6M|        get_coeff_cost_eob(ci, abs_qc, sign, coeff_ctx, txb_ctx->dc_sign_ctx,
  493|  35.6M|                           txb_costs, bhl, tx_class);
  494|  35.6M|    const tran_low_t tqc = tcoeff[ci];
  495|  35.6M|    const tran_low_t dqc = dqcoeff[ci];
  496|  35.6M|    const int64_t dist = get_coeff_dist(tqc, dqc, shift, qmatrix, ci);
  497|  35.6M|    const int64_t dist0 = get_coeff_dist(tqc, 0, shift, qmatrix, ci);
  498|  35.6M|    accu_dist += dist - dist0;
  499|  35.6M|    --si;
  500|  35.6M|  }
  501|       |
  502|  54.0M|#define UPDATE_COEFF_EOB_CASE(tx_class_literal)                            \
  503|  54.0M|  case tx_class_literal:                                                   \
  504|  54.0M|    update_coeff_eob_facade(                                               \
  505|  54.0M|        &accu_rate, &accu_dist, &eob, &nz_num, nz_ci, &si, tx_size,        \
  506|  54.0M|        tx_class_literal, bhl, width, txb_ctx->dc_sign_ctx, rdmult, shift, \
  507|  54.0M|        dequant, scan, txb_eob_costs, txb_costs, tcoeff, qcoeff, dqcoeff,  \
  508|  54.0M|        levels, sharpness, iqmatrix, qmatrix, max_nz_num);                 \
  509|  54.0M|    break
  510|  54.0M|  switch (tx_class) {
  511|  45.0M|    UPDATE_COEFF_EOB_CASE(TX_CLASS_2D);
  ------------------
  |  |  503|  45.0M|  case tx_class_literal:                                                   \
  |  |  ------------------
  |  |  |  Branch (503:3): [True: 45.0M, False: 8.92M]
  |  |  ------------------
  |  |  504|  45.0M|    update_coeff_eob_facade(                                               \
  |  |  505|  45.0M|        &accu_rate, &accu_dist, &eob, &nz_num, nz_ci, &si, tx_size,        \
  |  |  506|  45.0M|        tx_class_literal, bhl, width, txb_ctx->dc_sign_ctx, rdmult, shift, \
  |  |  507|  45.0M|        dequant, scan, txb_eob_costs, txb_costs, tcoeff, qcoeff, dqcoeff,  \
  |  |  508|  45.0M|        levels, sharpness, iqmatrix, qmatrix, max_nz_num);                 \
  |  |  509|  45.0M|    break
  ------------------
  512|  7.39M|    UPDATE_COEFF_EOB_CASE(TX_CLASS_HORIZ);
  ------------------
  |  |  503|  7.39M|  case tx_class_literal:                                                   \
  |  |  ------------------
  |  |  |  Branch (503:3): [True: 7.39M, False: 46.6M]
  |  |  ------------------
  |  |  504|  7.39M|    update_coeff_eob_facade(                                               \
  |  |  505|  7.39M|        &accu_rate, &accu_dist, &eob, &nz_num, nz_ci, &si, tx_size,        \
  |  |  506|  7.39M|        tx_class_literal, bhl, width, txb_ctx->dc_sign_ctx, rdmult, shift, \
  |  |  507|  7.39M|        dequant, scan, txb_eob_costs, txb_costs, tcoeff, qcoeff, dqcoeff,  \
  |  |  508|  7.39M|        levels, sharpness, iqmatrix, qmatrix, max_nz_num);                 \
  |  |  509|  7.39M|    break
  ------------------
  513|  1.50M|    UPDATE_COEFF_EOB_CASE(TX_CLASS_VERT);
  ------------------
  |  |  503|  1.50M|  case tx_class_literal:                                                   \
  |  |  ------------------
  |  |  |  Branch (503:3): [True: 1.50M, False: 52.4M]
  |  |  ------------------
  |  |  504|  1.50M|    update_coeff_eob_facade(                                               \
  |  |  505|  1.50M|        &accu_rate, &accu_dist, &eob, &nz_num, nz_ci, &si, tx_size,        \
  |  |  506|  1.50M|        tx_class_literal, bhl, width, txb_ctx->dc_sign_ctx, rdmult, shift, \
  |  |  507|  1.50M|        dequant, scan, txb_eob_costs, txb_costs, tcoeff, qcoeff, dqcoeff,  \
  |  |  508|  1.50M|        levels, sharpness, iqmatrix, qmatrix, max_nz_num);                 \
  |  |  509|  1.50M|    break
  ------------------
  514|      0|#undef UPDATE_COEFF_EOB_CASE
  515|      0|    default: assert(false);
  ------------------
  |  Branch (515:5): [True: 0, False: 54.0M]
  ------------------
  516|  54.0M|  }
  517|       |
  518|  53.8M|  if (si == -1 && nz_num <= max_nz_num && sharpness == 0) {
  ------------------
  |  Branch (518:7): [True: 10.8M, False: 42.9M]
  |  Branch (518:19): [True: 8.42M, False: 2.46M]
  |  Branch (518:43): [True: 780k, False: 7.64M]
  ------------------
  519|   780k|    update_skip(&accu_rate, accu_dist, &eob, nz_num, nz_ci, rdmult, skip_cost,
  520|   780k|                non_skip_cost, qcoeff, dqcoeff);
  521|   780k|  }
  522|       |
  523|  53.8M|#define UPDATE_COEFF_SIMPLE_CASE(tx_class_literal)                            \
  524|  53.8M|  case tx_class_literal:                                                      \
  525|  53.8M|    update_coeff_simple_facade(&accu_rate, &si, eob, tx_size,                 \
  526|  53.8M|                               tx_class_literal, bhl, rdmult, shift, dequant, \
  527|  53.8M|                               scan, txb_costs, tcoeff, qcoeff, dqcoeff,      \
  528|  53.8M|                               levels, sharpness, iqmatrix, qmatrix);         \
  529|  53.8M|    break
  530|  53.8M|  switch (tx_class) {
  531|  45.0M|    UPDATE_COEFF_SIMPLE_CASE(TX_CLASS_2D);
  ------------------
  |  |  524|  45.0M|  case tx_class_literal:                                                      \
  |  |  ------------------
  |  |  |  Branch (524:3): [True: 45.0M, False: 8.72M]
  |  |  ------------------
  |  |  525|  45.0M|    update_coeff_simple_facade(&accu_rate, &si, eob, tx_size,                 \
  |  |  526|  45.0M|                               tx_class_literal, bhl, rdmult, shift, dequant, \
  |  |  527|  45.0M|                               scan, txb_costs, tcoeff, qcoeff, dqcoeff,      \
  |  |  528|  45.0M|                               levels, sharpness, iqmatrix, qmatrix);         \
  |  |  529|  45.0M|    break
  ------------------
  532|  7.39M|    UPDATE_COEFF_SIMPLE_CASE(TX_CLASS_HORIZ);
  ------------------
  |  |  524|  7.39M|  case tx_class_literal:                                                      \
  |  |  ------------------
  |  |  |  Branch (524:3): [True: 7.39M, False: 46.4M]
  |  |  ------------------
  |  |  525|  7.39M|    update_coeff_simple_facade(&accu_rate, &si, eob, tx_size,                 \
  |  |  526|  7.39M|                               tx_class_literal, bhl, rdmult, shift, dequant, \
  |  |  527|  7.39M|                               scan, txb_costs, tcoeff, qcoeff, dqcoeff,      \
  |  |  528|  7.39M|                               levels, sharpness, iqmatrix, qmatrix);         \
  |  |  529|  7.39M|    break
  ------------------
  533|  1.50M|    UPDATE_COEFF_SIMPLE_CASE(TX_CLASS_VERT);
  ------------------
  |  |  524|  1.50M|  case tx_class_literal:                                                      \
  |  |  ------------------
  |  |  |  Branch (524:3): [True: 1.50M, False: 52.3M]
  |  |  ------------------
  |  |  525|  1.50M|    update_coeff_simple_facade(&accu_rate, &si, eob, tx_size,                 \
  |  |  526|  1.50M|                               tx_class_literal, bhl, rdmult, shift, dequant, \
  |  |  527|  1.50M|                               scan, txb_costs, tcoeff, qcoeff, dqcoeff,      \
  |  |  528|  1.50M|                               levels, sharpness, iqmatrix, qmatrix);         \
  |  |  529|  1.50M|    break
  ------------------
  534|      0|#undef UPDATE_COEFF_SIMPLE_CASE
  535|      0|    default: assert(false);
  ------------------
  |  Branch (535:5): [True: 0, False: 53.8M]
  ------------------
  536|  53.8M|  }
  537|       |
  538|       |  // DC position
  539|  53.5M|  if (si == 0) {
  ------------------
  |  Branch (539:7): [True: 42.7M, False: 10.7M]
  ------------------
  540|       |    // no need to update accu_dist because it's not used after this point
  541|  42.7M|    int64_t dummy_dist = 0;
  542|  42.7M|    update_coeff_general(&accu_rate, &dummy_dist, si, eob, tx_size, tx_class,
  543|  42.7M|                         bhl, width, rdmult, shift, txb_ctx->dc_sign_ctx,
  544|  42.7M|                         dequant, scan, txb_costs, tcoeff, qcoeff, dqcoeff,
  545|  42.7M|                         levels, iqmatrix, qmatrix);
  546|  42.7M|  }
  547|       |
  548|  53.5M|  const int tx_type_cost = get_tx_type_cost(x, xd, plane, tx_size, tx_type,
  549|  53.5M|                                            cm->features.reduced_tx_set_used);
  550|  53.5M|  if (eob == 0)
  ------------------
  |  Branch (550:7): [True: 141k, False: 53.4M]
  ------------------
  551|   141k|    accu_rate += skip_cost;
  552|  53.4M|  else
  553|  53.4M|    accu_rate += non_skip_cost + tx_type_cost;
  554|       |
  555|  53.5M|  p->eobs[block] = eob;
  556|  53.5M|  p->txb_entropy_ctx[block] =
  557|  53.5M|      av1_get_txb_entropy_context(qcoeff, scan_order, p->eobs[block]);
  558|       |
  559|  53.5M|  *rate_cost = accu_rate;
  560|  53.5M|  return eob;
  561|  53.8M|}
av1_cost_coeffs_txb:
  751|  74.1M|                        const TXB_CTX *const txb_ctx, int reduced_tx_set_used) {
  752|  74.1M|  const struct macroblock_plane *p = &x->plane[plane];
  753|  74.1M|  const int eob = p->eobs[block];
  754|  74.1M|  const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
  755|  74.1M|  const PLANE_TYPE plane_type = get_plane_type(plane);
  756|  74.1M|  const LV_MAP_COEFF_COST *const coeff_costs =
  757|  74.1M|      &x->coeff_costs.coeff_costs[txs_ctx][plane_type];
  758|  74.1M|  if (eob == 0) {
  ------------------
  |  Branch (758:7): [True: 3.19M, False: 70.9M]
  ------------------
  759|  3.19M|    return coeff_costs->txb_skip_cost[txb_ctx->txb_skip_ctx][1];
  760|  3.19M|  }
  761|       |
  762|  70.9M|  const MACROBLOCKD *const xd = &x->e_mbd;
  763|  70.9M|  const TX_CLASS tx_class = tx_type_to_class[tx_type];
  764|       |
  765|  70.9M|  switch (tx_class) {
  766|  63.8M|    case TX_CLASS_2D:
  ------------------
  |  Branch (766:5): [True: 63.8M, False: 7.09M]
  ------------------
  767|  63.8M|      return warehouse_efficients_txb(x, plane, block, tx_size, txb_ctx, p, eob,
  768|  63.8M|                                      plane_type, coeff_costs, xd, tx_type,
  769|  63.8M|                                      TX_CLASS_2D, reduced_tx_set_used);
  770|       |
  771|  2.73M|    case TX_CLASS_VERT:
  ------------------
  |  Branch (771:5): [True: 2.73M, False: 68.2M]
  ------------------
  772|  2.73M|      return warehouse_efficients_txb(x, plane, block, tx_size, txb_ctx, p, eob,
  773|  2.73M|                                      plane_type, coeff_costs, xd, tx_type,
  774|  2.73M|                                      TX_CLASS_VERT, reduced_tx_set_used);
  775|       |
  776|  4.47M|    case TX_CLASS_HORIZ:
  ------------------
  |  Branch (776:5): [True: 4.47M, False: 66.4M]
  ------------------
  777|  4.47M|      return warehouse_efficients_txb(x, plane, block, tx_size, txb_ctx, p, eob,
  778|  4.47M|                                      plane_type, coeff_costs, xd, tx_type,
  779|  4.47M|                                      TX_CLASS_HORIZ, reduced_tx_set_used);
  780|       |
  781|      0|    default: assert(0 && "Invalid TX_CLASS"); return 0;
  ------------------
  |  Branch (781:5): [True: 0, False: 70.9M]
  ------------------
  782|  70.9M|  }
  783|  70.9M|}
txb_rdopt.c:update_coeff_general:
   24|  61.2M|    const qm_val_t *iqmatrix, const qm_val_t *qmatrix) {
   25|  61.2M|  const int ci = scan[si];
   26|  61.2M|  const tran_low_t qc = qcoeff[ci];
   27|  61.2M|  const int is_last = si == (eob - 1);
   28|  61.2M|  const int coeff_ctx = get_lower_levels_ctx_general(
   29|  61.2M|      is_last, si, bhl, width, levels, ci, tx_size, tx_class);
   30|  61.2M|  if (qc == 0) {
  ------------------
  |  Branch (30:7): [True: 5.10M, False: 56.1M]
  ------------------
   31|  5.10M|    *accu_rate += txb_costs->base_cost[coeff_ctx][0];
   32|  56.1M|  } else {
   33|  56.1M|    const int sign = (qc < 0) ? 1 : 0;
  ------------------
  |  Branch (33:22): [True: 28.2M, False: 27.8M]
  ------------------
   34|  56.1M|    const tran_low_t abs_qc = abs(qc);
   35|  56.1M|    const tran_low_t tqc = tcoeff[ci];
   36|  56.1M|    const tran_low_t dqc = dqcoeff[ci];
   37|  56.1M|    const int rate =
   38|  56.1M|        get_coeff_cost_general(is_last, ci, abs_qc, sign, coeff_ctx,
   39|  56.1M|                               dc_sign_ctx, txb_costs, bhl, tx_class, levels);
   40|       |
   41|  56.1M|    tran_low_t qc_low = 0, dqc_low = 0;
   42|  56.1M|    tran_low_t abs_qc_low = 0;
   43|  56.1M|    int rate_low;
   44|  56.1M|    if (abs_qc == 1) {
  ------------------
  |  Branch (44:9): [True: 7.26M, False: 48.9M]
  ------------------
   45|  7.26M|      rate_low = txb_costs->base_cost[coeff_ctx][0];
   46|  48.9M|    } else {
   47|  48.9M|      const int dqv = get_dqv(dequant, scan[si], iqmatrix);
   48|  48.9M|      get_qc_dqc_low(abs_qc, sign, dqv, shift, &qc_low, &dqc_low);
   49|  48.9M|      abs_qc_low = abs_qc - 1;
   50|  48.9M|      rate_low =
   51|  48.9M|          get_coeff_cost_general(is_last, ci, abs_qc_low, sign, coeff_ctx,
   52|  48.9M|                                 dc_sign_ctx, txb_costs, bhl, tx_class, levels);
   53|  48.9M|    }
   54|       |
   55|  56.1M|    int64_t dist_diff_0, dist_diff_low_0;
   56|  56.1M|    if (qmatrix == NULL) {
  ------------------
  |  Branch (56:9): [True: 23.0M, False: 33.1M]
  ------------------
   57|  23.0M|      const int64_t tqc2 = (int64_t)tqc * 2;
   58|  23.0M|      dist_diff_0 = ((int64_t)dqc * (dqc - tqc2)) * (1LL << (2 * shift));
   59|  23.0M|      dist_diff_low_0 =
   60|  23.0M|          (abs_qc == 1)
  ------------------
  |  Branch (60:11): [True: 3.30M, False: 19.7M]
  ------------------
   61|  23.0M|              ? 0
   62|  23.0M|              : (((int64_t)dqc_low * (dqc_low - tqc2)) * (1LL << (2 * shift)));
   63|  33.1M|    } else {
   64|  33.1M|      const int64_t dist0 = get_coeff_dist(tqc, 0, shift, qmatrix, ci);
   65|  33.1M|      dist_diff_0 = get_coeff_dist(tqc, dqc, shift, qmatrix, ci) - dist0;
   66|  33.1M|      dist_diff_low_0 =
   67|  33.1M|          (abs_qc == 1)
  ------------------
  |  Branch (67:11): [True: 3.96M, False: 29.1M]
  ------------------
   68|  33.1M|              ? 0
   69|  33.1M|              : (get_coeff_dist(tqc, dqc_low, shift, qmatrix, ci) - dist0);
   70|  33.1M|    }
   71|       |
   72|  56.1M|    const int64_t rd = RDCOST(rdmult, rate, dist_diff_0);
  ------------------
  |  |   33|  56.1M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  56.1M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  56.1M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  56.1M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
   73|  56.1M|    const int64_t rd_low = RDCOST(rdmult, rate_low, dist_diff_low_0);
  ------------------
  |  |   33|  56.1M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  56.1M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  56.1M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  56.1M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
   74|       |
   75|  56.1M|    if (rd_low < rd) {
  ------------------
  |  Branch (75:9): [True: 1.23M, False: 54.9M]
  ------------------
   76|  1.23M|      qcoeff[ci] = qc_low;
   77|  1.23M|      dqcoeff[ci] = dqc_low;
   78|  1.23M|      levels[get_padded_idx(ci, bhl)] = AOMMIN(abs_qc_low, INT8_MAX);
  ------------------
  |  |   34|  1.23M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 1.16M, False: 68.4k]
  |  |  ------------------
  ------------------
   79|  1.23M|      *accu_rate += rate_low;
   80|  1.23M|      *accu_dist += dist_diff_low_0;
   81|  54.9M|    } else {
   82|  54.9M|      *accu_rate += rate;
   83|  54.9M|      *accu_dist += dist_diff_0;
   84|  54.9M|    }
   85|  56.1M|  }
   86|  61.2M|}
txb_rdopt.c:update_coeff_eob_facade:
  377|  53.7M|    const qm_val_t *iqmatrix, const qm_val_t *qmatrix, int max_nz_num) {
  378|   357M|  for (; *si >= 0 && *nz_num <= max_nz_num; --*si) {
  ------------------
  |  Branch (378:10): [True: 344M, False: 12.7M]
  |  Branch (378:22): [True: 303M, False: 40.9M]
  ------------------
  379|   303M|    update_coeff_eob(accu_rate, accu_dist, eob, nz_num, nz_ci, *si, tx_size,
  380|   303M|                     tx_class, bhl, width, dc_sign_ctx, rdmult, shift, dequant,
  381|   303M|                     scan, txb_eob_costs, txb_costs, tcoeff, qcoeff, dqcoeff,
  382|   303M|                     levels, sharpness, iqmatrix, qmatrix);
  383|   303M|  }
  384|  53.7M|}
txb_rdopt.c:update_coeff_eob:
  193|   303M|    const qm_val_t *iqmatrix, const qm_val_t *qmatrix) {
  194|   303M|  assert(si != *eob - 1);
  195|   303M|  const int ci = scan[si];
  196|   303M|  const tran_low_t qc = qcoeff[ci];
  197|   303M|  const int coeff_ctx =
  198|   303M|      get_lower_levels_ctx(levels, ci, bhl, tx_size, tx_class);
  199|   303M|  if (qc == 0) {
  ------------------
  |  Branch (199:7): [True: 206M, False: 97.0M]
  ------------------
  200|   206M|    *accu_rate += txb_costs->base_cost[coeff_ctx][0];
  201|   206M|  } else {
  202|  97.0M|    const int dqv = get_dqv(dequant, scan[si], iqmatrix);
  203|  97.0M|    int lower_level = 0;
  204|  97.0M|    const tran_low_t abs_qc = abs(qc);
  205|  97.0M|    const tran_low_t tqc = tcoeff[ci];
  206|  97.0M|    const tran_low_t dqc = dqcoeff[ci];
  207|  97.0M|    const int sign = (qc < 0) ? 1 : 0;
  ------------------
  |  Branch (207:22): [True: 49.3M, False: 47.6M]
  ------------------
  208|       |
  209|  97.0M|    tran_low_t qc_low = 0, dqc_low = 0;
  210|  97.0M|    tran_low_t abs_qc_low = 0;
  211|  97.0M|    int rate_low;
  212|       |
  213|  97.0M|    if (abs_qc == 1) {
  ------------------
  |  Branch (213:9): [True: 58.1M, False: 38.8M]
  ------------------
  214|  58.1M|      rate_low = txb_costs->base_cost[coeff_ctx][0];
  215|  58.1M|    } else {
  216|  38.8M|      get_qc_dqc_low(abs_qc, sign, dqv, shift, &qc_low, &dqc_low);
  217|  38.8M|      abs_qc_low = abs_qc - 1;
  218|  38.8M|      rate_low =
  219|  38.8M|          get_coeff_cost_general(0, ci, abs_qc_low, sign, coeff_ctx,
  220|  38.8M|                                 dc_sign_ctx, txb_costs, bhl, tx_class, levels);
  221|  38.8M|    }
  222|       |
  223|  97.0M|    int64_t dist, dist_low;
  224|  97.0M|    if (qmatrix == NULL) {
  ------------------
  |  Branch (224:9): [True: 39.8M, False: 57.1M]
  ------------------
  225|  39.8M|      const int64_t tqc2 = (int64_t)tqc * 2;
  226|  39.8M|      dist = ((int64_t)dqc * (dqc - tqc2)) * (1LL << (2 * shift));
  227|  39.8M|      dist_low =
  228|  39.8M|          (abs_qc == 1)
  ------------------
  |  Branch (228:11): [True: 22.3M, False: 17.5M]
  ------------------
  229|  39.8M|              ? 0
  230|  39.8M|              : (((int64_t)dqc_low * (dqc_low - tqc2)) * (1LL << (2 * shift)));
  231|  57.1M|    } else {
  232|  57.1M|      const int64_t dist0 = get_coeff_dist(tqc, 0, shift, qmatrix, ci);
  233|  57.1M|      dist = get_coeff_dist(tqc, dqc, shift, qmatrix, ci) - dist0;
  234|  57.1M|      dist_low =
  235|  57.1M|          (abs_qc == 1)
  ------------------
  |  Branch (235:11): [True: 36.0M, False: 21.1M]
  ------------------
  236|  57.1M|              ? 0
  237|  57.1M|              : (get_coeff_dist(tqc, dqc_low, shift, qmatrix, ci) - dist0);
  238|  57.1M|    }
  239|       |
  240|  97.0M|    int rate =
  241|  97.0M|        get_coeff_cost_general(0, ci, abs_qc, sign, coeff_ctx, dc_sign_ctx,
  242|  97.0M|                               txb_costs, bhl, tx_class, levels);
  243|  97.0M|    int64_t rd = RDCOST(rdmult, *accu_rate + rate, *accu_dist + dist);
  ------------------
  |  |   33|  97.0M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  97.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  97.0M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  97.0M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  244|  97.0M|    int64_t rd_low =
  245|  97.0M|        RDCOST(rdmult, *accu_rate + rate_low, *accu_dist + dist_low);
  ------------------
  |  |   33|  97.0M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  97.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  97.0M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  97.0M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  246|       |
  247|  97.0M|    int lower_level_new_eob = 0;
  248|  97.0M|    const int new_eob = si + 1;
  249|  97.0M|    const int coeff_ctx_new_eob = get_lower_levels_ctx_eob(bhl, width, si);
  250|  97.0M|    const int new_eob_cost =
  251|  97.0M|        get_eob_cost(new_eob, txb_eob_costs, txb_costs, tx_class);
  252|  97.0M|    int rate_coeff_eob =
  253|  97.0M|        new_eob_cost + get_coeff_cost_eob(ci, abs_qc, sign, coeff_ctx_new_eob,
  254|  97.0M|                                          dc_sign_ctx, txb_costs, bhl,
  255|  97.0M|                                          tx_class);
  256|  97.0M|    int64_t dist_new_eob = dist;
  257|  97.0M|    int64_t rd_new_eob = RDCOST(rdmult, rate_coeff_eob, dist_new_eob);
  ------------------
  |  |   33|  97.0M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  97.0M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  97.0M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  97.0M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  258|       |
  259|  97.0M|    if (abs_qc_low > 0) {
  ------------------
  |  Branch (259:9): [True: 41.2M, False: 55.7M]
  ------------------
  260|  41.2M|      const int rate_coeff_eob_low =
  261|  41.2M|          new_eob_cost + get_coeff_cost_eob(ci, abs_qc_low, sign,
  262|  41.2M|                                            coeff_ctx_new_eob, dc_sign_ctx,
  263|  41.2M|                                            txb_costs, bhl, tx_class);
  264|  41.2M|      const int64_t dist_new_eob_low = dist_low;
  265|  41.2M|      const int64_t rd_new_eob_low =
  266|  41.2M|          RDCOST(rdmult, rate_coeff_eob_low, dist_new_eob_low);
  ------------------
  |  |   33|  41.2M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  41.2M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  41.2M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  41.2M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  267|  41.2M|      if (rd_new_eob_low < rd_new_eob) {
  ------------------
  |  Branch (267:11): [True: 1.17M, False: 40.0M]
  ------------------
  268|  1.17M|        lower_level_new_eob = 1;
  269|  1.17M|        rd_new_eob = rd_new_eob_low;
  270|  1.17M|        rate_coeff_eob = rate_coeff_eob_low;
  271|  1.17M|        dist_new_eob = dist_new_eob_low;
  272|  1.17M|      }
  273|  41.2M|    }
  274|       |
  275|  97.0M|    const int qc_threshold = (si <= 5) ? 2 : 1;
  ------------------
  |  Branch (275:30): [True: 18.2M, False: 78.7M]
  ------------------
  276|  97.0M|    const int allow_lower_qc = sharpness ? abs_qc > qc_threshold : 1;
  ------------------
  |  Branch (276:32): [True: 72.2M, False: 24.8M]
  ------------------
  277|       |
  278|  97.0M|    if (allow_lower_qc) {
  ------------------
  |  Branch (278:9): [True: 53.9M, False: 43.0M]
  ------------------
  279|  53.9M|      if (rd_low < rd) {
  ------------------
  |  Branch (279:11): [True: 3.59M, False: 50.3M]
  ------------------
  280|  3.59M|        lower_level = 1;
  281|  3.59M|        rd = rd_low;
  282|  3.59M|        rate = rate_low;
  283|  3.59M|        dist = dist_low;
  284|  3.59M|      }
  285|  53.9M|    }
  286|       |
  287|  97.0M|    if ((sharpness == 0 || new_eob >= 5) && rd_new_eob < rd) {
  ------------------
  |  Branch (287:10): [True: 24.7M, False: 72.2M]
  |  Branch (287:28): [True: 60.5M, False: 11.6M]
  |  Branch (287:45): [True: 3.40M, False: 84.3M]
  ------------------
  288|  7.00M|      for (int ni = 0; ni < *nz_num; ++ni) {
  ------------------
  |  Branch (288:24): [True: 3.59M, False: 3.40M]
  ------------------
  289|  3.59M|        int last_ci = nz_ci[ni];
  290|  3.59M|        levels[get_padded_idx(last_ci, bhl)] = 0;
  291|  3.59M|        qcoeff[last_ci] = 0;
  292|  3.59M|        dqcoeff[last_ci] = 0;
  293|  3.59M|      }
  294|  3.40M|      *eob = new_eob;
  295|  3.40M|      *nz_num = 0;
  296|  3.40M|      *accu_rate = rate_coeff_eob;
  297|  3.40M|      *accu_dist = dist_new_eob;
  298|  3.40M|      lower_level = lower_level_new_eob;
  299|  93.6M|    } else {
  300|  93.6M|      *accu_rate += rate;
  301|  93.6M|      *accu_dist += dist;
  302|  93.6M|    }
  303|       |
  304|  97.0M|    if (lower_level) {
  ------------------
  |  Branch (304:9): [True: 2.93M, False: 94.0M]
  ------------------
  305|  2.93M|      qcoeff[ci] = qc_low;
  306|  2.93M|      dqcoeff[ci] = dqc_low;
  307|  2.93M|      levels[get_padded_idx(ci, bhl)] = AOMMIN(abs_qc_low, INT8_MAX);
  ------------------
  |  |   34|  2.93M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 2.92M, False: 5.90k]
  |  |  ------------------
  ------------------
  308|  2.93M|    }
  309|  97.2M|    if (qcoeff[ci]) {
  ------------------
  |  Branch (309:9): [True: 97.2M, False: 18.4E]
  ------------------
  310|  97.2M|      nz_ci[*nz_num] = ci;
  311|  97.2M|      ++*nz_num;
  312|  97.2M|    }
  313|  97.0M|  }
  314|   303M|}
txb_rdopt.c:update_skip:
  319|   780k|                               tran_low_t *qcoeff, tran_low_t *dqcoeff) {
  320|   780k|  const int64_t rd = RDCOST(rdmult, *accu_rate + non_skip_cost, accu_dist);
  ------------------
  |  |   33|   780k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   780k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   780k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   780k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  321|   780k|  const int64_t rd_new_eob = RDCOST(rdmult, skip_cost, 0);
  ------------------
  |  |   33|   780k|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   780k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   780k|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   780k|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  322|   780k|  if (rd_new_eob < rd) {
  ------------------
  |  Branch (322:7): [True: 141k, False: 638k]
  ------------------
  323|   299k|    for (int i = 0; i < nz_num; ++i) {
  ------------------
  |  Branch (323:21): [True: 157k, False: 141k]
  ------------------
  324|   157k|      const int ci = nz_ci[i];
  325|   157k|      qcoeff[ci] = 0;
  326|   157k|      dqcoeff[ci] = 0;
  327|       |      // no need to set up levels because this is the last step
  328|       |      // levels[get_padded_idx(ci, bhl)] = 0;
  329|   157k|    }
  330|   141k|    *accu_rate = 0;
  331|   141k|    *eob = 0;
  332|   141k|  }
  333|   780k|}
txb_rdopt.c:update_coeff_simple_facade:
  392|  53.8M|    const qm_val_t *qmatrix) {
  393|  1.01G|  for (; *si >= 1; --*si) {
  ------------------
  |  Branch (393:10): [True: 956M, False: 53.8M]
  ------------------
  394|   956M|    update_coeff_simple(accu_rate, *si, eob, tx_size, tx_class, bhl, rdmult,
  395|   956M|                        shift, dequant, scan, txb_costs, tcoeff, qcoeff,
  396|   956M|                        dqcoeff, levels, sharpness, iqmatrix, qmatrix);
  397|   956M|  }
  398|  53.8M|}
txb_rdopt.c:update_coeff_simple:
   94|   956M|    const qm_val_t *qmatrix) {
   95|   956M|  (void)eob;
   96|       |  // this simple version assumes the coeff's scan_idx is not DC (scan_idx != 0)
   97|       |  // and not the last (scan_idx != eob - 1)
   98|   956M|  assert(si != eob - 1);
   99|   956M|  assert(si > 0);
  100|   956M|  const int ci = scan[si];
  101|   956M|  const tran_low_t qc = qcoeff[ci];
  102|   956M|  const int coeff_ctx =
  103|   956M|      get_lower_levels_ctx(levels, ci, bhl, tx_size, tx_class);
  104|   956M|  if (qc == 0) {
  ------------------
  |  Branch (104:7): [True: 311M, False: 644M]
  ------------------
  105|   311M|    *accu_rate += txb_costs->base_cost[coeff_ctx][0];
  106|   644M|  } else {
  107|   644M|    const tran_low_t abs_qc = abs(qc);
  108|   644M|    const tran_low_t abs_tqc = abs(tcoeff[ci]);
  109|   644M|    const tran_low_t abs_dqc = abs(dqcoeff[ci]);
  110|   644M|    if (abs_qc == 1) {
  ------------------
  |  Branch (110:9): [True: 229M, False: 415M]
  ------------------
  111|   229M|      const int *base_cost = txb_costs->base_cost[coeff_ctx];
  112|   229M|      const int rate = base_cost[1] + av1_cost_literal(1);
  ------------------
  |  |   29|   229M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   229M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  113|   229M|      if (abs_dqc < abs_tqc) {
  ------------------
  |  Branch (113:11): [True: 100M, False: 129M]
  ------------------
  114|   100M|        *accu_rate += rate;
  115|   100M|        return;
  116|   100M|      }
  117|       |
  118|   129M|      const int allow_lower_qc = sharpness ? 0 : 1;
  ------------------
  |  Branch (118:34): [True: 92.2M, False: 37.0M]
  ------------------
  119|   129M|      if (allow_lower_qc) {
  ------------------
  |  Branch (119:11): [True: 40.3M, False: 89.0M]
  ------------------
  120|  40.3M|        int64_t dist_diff_0;
  121|  40.3M|        if (qmatrix == NULL) {
  ------------------
  |  Branch (121:13): [True: 40.3M, False: 18.4E]
  ------------------
  122|  40.3M|          dist_diff_0 =
  123|  40.3M|              ((int64_t)abs_dqc * (abs_dqc - ((int64_t)abs_tqc * 2))) *
  124|  40.3M|              (1LL << (2 * shift));
  125|  18.4E|        } else {
  126|  18.4E|          const int64_t dist0 = get_coeff_dist(abs_tqc, 0, shift, qmatrix, ci);
  127|  18.4E|          dist_diff_0 =
  128|  18.4E|              get_coeff_dist(abs_tqc, abs_dqc, shift, qmatrix, ci) - dist0;
  129|  18.4E|        }
  130|  40.3M|        const int rate_low = rate - base_cost[5];
  131|  40.3M|        const int64_t rd = RDCOST(rdmult, rate, dist_diff_0);
  ------------------
  |  |   33|  40.3M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  40.3M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  40.3M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  40.3M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  132|  40.3M|        const int64_t rd_low = RDCOST(rdmult, rate_low, 0);
  ------------------
  |  |   33|  40.3M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|  40.3M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|  40.3M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|  40.3M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  133|  40.3M|        if (rd_low < rd) {
  ------------------
  |  Branch (133:13): [True: 4.12M, False: 36.1M]
  ------------------
  134|  4.12M|          qcoeff[ci] = 0;
  135|  4.12M|          dqcoeff[ci] = 0;
  136|  4.12M|          levels[get_padded_idx(ci, bhl)] = 0;
  137|  4.12M|          *accu_rate += rate_low;
  138|  4.12M|          return;
  139|  4.12M|        }
  140|  40.3M|      }
  141|   125M|      *accu_rate += rate;
  142|   415M|    } else {
  143|   415M|      int rate_low = 0;
  144|   415M|      const int rate = get_two_coeff_cost_simple(
  145|   415M|          ci, abs_qc, coeff_ctx, txb_costs, bhl, tx_class, levels, &rate_low);
  146|   415M|      if (abs_dqc < abs_tqc) {
  ------------------
  |  Branch (146:11): [True: 231M, False: 184M]
  ------------------
  147|   231M|        *accu_rate += rate;
  148|   231M|        return;
  149|   231M|      }
  150|       |
  151|   184M|      const int allow_lower_qc = sharpness ? (abs_qc > 1) : 1;
  ------------------
  |  Branch (151:34): [True: 138M, False: 45.6M]
  ------------------
  152|   211M|      if (allow_lower_qc) {
  ------------------
  |  Branch (152:11): [True: 211M, False: 18.4E]
  ------------------
  153|   211M|        const int dqv = get_dqv(dequant, scan[si], iqmatrix);
  154|   211M|        const tran_low_t abs_qc_low = abs_qc - 1;
  155|   211M|        const tran_low_t abs_dqc_low = (abs_qc_low * dqv) >> shift;
  156|   211M|        int64_t dist_diff_0, dist_diff_low_0;
  157|   211M|        if (qmatrix == NULL) {
  ------------------
  |  Branch (157:13): [True: 111M, False: 100M]
  ------------------
  158|   111M|          const int64_t abs_tqc2 = (int64_t)abs_tqc << 1;
  159|   111M|          dist_diff_0 =
  160|   111M|              ((int64_t)abs_dqc * (abs_dqc - abs_tqc2)) * (1LL << (2 * shift));
  161|   111M|          dist_diff_low_0 = ((int64_t)abs_dqc_low * (abs_dqc_low - abs_tqc2)) *
  162|   111M|                            (1LL << (2 * shift));
  163|   111M|        } else {
  164|   100M|          const int64_t dist0 = get_coeff_dist(abs_tqc, 0, shift, qmatrix, ci);
  165|   100M|          dist_diff_0 =
  166|   100M|              get_coeff_dist(abs_tqc, abs_dqc, shift, qmatrix, ci) - dist0;
  167|   100M|          dist_diff_low_0 =
  168|   100M|              get_coeff_dist(abs_tqc, abs_dqc_low, shift, qmatrix, ci) - dist0;
  169|   100M|        }
  170|   211M|        const int64_t rd = RDCOST(rdmult, rate, dist_diff_0);
  ------------------
  |  |   33|   211M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   211M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   211M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   211M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  171|   211M|        const int64_t rd_low = RDCOST(rdmult, rate_low, dist_diff_low_0);
  ------------------
  |  |   33|   211M|  (ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), AV1_PROB_COST_SHIFT) + \
  |  |  ------------------
  |  |  |  |   41|   211M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  |  |  ------------------
  |  |   34|   211M|   ((D) * (1 << RDDIV_BITS)))
  |  |  ------------------
  |  |  |  |   29|   211M|#define RDDIV_BITS 7
  |  |  ------------------
  ------------------
  172|   211M|        if (rd_low < rd) {
  ------------------
  |  Branch (172:13): [True: 7.04M, False: 204M]
  ------------------
  173|  7.04M|          const int sign = (qc < 0) ? 1 : 0;
  ------------------
  |  Branch (173:28): [True: 3.53M, False: 3.51M]
  ------------------
  174|  7.04M|          qcoeff[ci] = (-sign ^ abs_qc_low) + sign;
  175|  7.04M|          dqcoeff[ci] = (-sign ^ abs_dqc_low) + sign;
  176|  7.04M|          levels[get_padded_idx(ci, bhl)] = AOMMIN(abs_qc_low, INT8_MAX);
  ------------------
  |  |   34|  7.04M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 6.90M, False: 144k]
  |  |  ------------------
  ------------------
  177|  7.04M|          *accu_rate += rate_low;
  178|  7.04M|          return;
  179|  7.04M|        }
  180|   211M|      }
  181|   177M|      *accu_rate += rate;
  182|   177M|    }
  183|   644M|  }
  184|   956M|}
txb_rdopt.c:get_tx_type_cost:
  338|   124M|                            int reduced_tx_set_used) {
  339|   124M|  if (plane > 0) return 0;
  ------------------
  |  Branch (339:7): [True: 32.2M, False: 92.0M]
  ------------------
  340|       |
  341|  92.0M|  const TX_SIZE square_tx_size = txsize_sqr_map[tx_size];
  342|       |
  343|  92.0M|  const MB_MODE_INFO *mbmi = xd->mi[0];
  344|  92.0M|  const int is_inter = is_inter_block(mbmi);
  345|  92.0M|  const TxSetType set_type =
  346|  92.0M|      av1_get_ext_tx_set_type(tx_size, is_inter, reduced_tx_set_used);
  347|  92.0M|  if (av1_num_ext_tx_set[set_type] > 1 &&
  ------------------
  |  Branch (347:7): [True: 92.2M, False: 18.4E]
  ------------------
  348|  92.2M|      !xd->lossless[xd->mi[0]->segment_id]) {
  ------------------
  |  Branch (348:7): [True: 90.0M, False: 2.12M]
  ------------------
  349|  90.0M|    const int ext_tx_set = ext_tx_set_index[is_inter][set_type];
  350|  90.0M|    if (is_inter) {
  ------------------
  |  Branch (350:9): [True: 6.08M, False: 84.0M]
  ------------------
  351|  6.08M|      if (ext_tx_set > 0)
  ------------------
  |  Branch (351:11): [True: 6.08M, False: 18.4E]
  ------------------
  352|  6.08M|        return x->mode_costs
  353|  6.08M|            .inter_tx_type_costs[ext_tx_set][square_tx_size][tx_type];
  354|  84.0M|    } else {
  355|  84.1M|      if (ext_tx_set > 0) {
  ------------------
  |  Branch (355:11): [True: 84.1M, False: 18.4E]
  ------------------
  356|  84.1M|        PREDICTION_MODE intra_dir;
  357|  84.1M|        if (mbmi->filter_intra_mode_info.use_filter_intra)
  ------------------
  |  Branch (357:13): [True: 41.2M, False: 42.8M]
  ------------------
  358|  41.2M|          intra_dir = fimode_to_intradir[mbmi->filter_intra_mode_info
  359|  41.2M|                                             .filter_intra_mode];
  360|  42.8M|        else
  361|  42.8M|          intra_dir = mbmi->mode;
  362|  84.1M|        return x->mode_costs.intra_tx_type_costs[ext_tx_set][square_tx_size]
  363|  84.1M|                                                [intra_dir][tx_type];
  364|  84.1M|      }
  365|  84.0M|    }
  366|  90.0M|  }
  367|  1.82M|  return 0;
  368|  92.0M|}
txb_rdopt.c:warehouse_efficients_txb:
  569|  71.0M|    int reduced_tx_set_used) {
  570|  71.0M|  const tran_low_t *const qcoeff = p->qcoeff + BLOCK_OFFSET(block);
  ------------------
  |  |  489|  71.0M|#define BLOCK_OFFSET(i) ((i) << 4)
  ------------------
  571|  71.0M|  const int txb_skip_ctx = txb_ctx->txb_skip_ctx;
  572|  71.0M|  const int bhl = get_txb_bhl(tx_size);
  573|  71.0M|  const int width = get_txb_wide(tx_size);
  574|  71.0M|  const int height = get_txb_high(tx_size);
  575|  71.0M|  const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type);
  576|  71.0M|  const int16_t *const scan = scan_order->scan;
  577|  71.0M|  uint8_t levels_buf[TX_PAD_2D];
  578|  71.0M|  uint8_t *const levels = set_levels(levels_buf, height);
  579|  71.0M|  DECLARE_ALIGNED(16, int8_t, coeff_contexts[MAX_TX_SQUARE]);
  ------------------
  |  |   19|  71.0M|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  580|  71.0M|  const int eob_multi_size = txsize_log2_minus4[tx_size];
  581|  71.0M|  const LV_MAP_EOB_COST *const eob_costs =
  582|  71.0M|      &x->coeff_costs.eob_costs[eob_multi_size][plane_type];
  583|  71.0M|  int cost = coeff_costs->txb_skip_cost[txb_skip_ctx][0];
  584|       |
  585|  71.0M|  if (eob > 1) av1_txb_init_levels(qcoeff, width, height, levels);
  ------------------
  |  Branch (585:7): [True: 66.6M, False: 4.37M]
  ------------------
  586|       |
  587|  71.0M|  cost += get_tx_type_cost(x, xd, plane, tx_size, tx_type, reduced_tx_set_used);
  588|       |
  589|  71.0M|  cost += get_eob_cost(eob, eob_costs, coeff_costs, tx_class);
  590|       |
  591|  71.0M|  av1_get_nz_map_contexts(levels, scan, eob, tx_size, tx_class, coeff_contexts);
  ------------------
  |  |  390|  71.0M|#define av1_get_nz_map_contexts av1_get_nz_map_contexts_sse2
  ------------------
  592|       |
  593|  71.0M|  const int(*lps_cost)[COEFF_BASE_RANGE + 1 + COEFF_BASE_RANGE + 1] =
  594|  71.0M|      coeff_costs->lps_cost;
  595|  71.0M|  int c = eob - 1;
  596|  71.0M|  {
  597|  71.0M|    const int pos = scan[c];
  598|  71.0M|    const tran_low_t v = qcoeff[pos];
  599|       |
  600|  71.0M|    if (v) {
  ------------------
  |  Branch (600:9): [True: 70.7M, False: 286k]
  ------------------
  601|  70.7M|      const int sign = AOMSIGN(v);
  ------------------
  |  |   36|  70.7M|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 35.5M, False: 35.1M]
  |  |  ------------------
  ------------------
  602|  70.7M|      const int level = (v ^ sign) - sign;
  603|  70.7M|      const int coeff_ctx = coeff_contexts[pos];
  604|  70.7M|      cost += coeff_costs->base_eob_cost[coeff_ctx][AOMMIN(level, 3) - 1];
  ------------------
  |  |   34|  70.7M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 51.7M, False: 19.0M]
  |  |  ------------------
  ------------------
  605|       |      // sign bit cost
  606|  70.7M|      if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  70.7M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (606:11): [True: 19.1M, False: 51.5M]
  ------------------
  607|  19.1M|        const int ctx = get_br_ctx_eob(pos, bhl, tx_class);
  608|  19.1M|        cost += get_br_cost(level, lps_cost[ctx]);
  609|  19.1M|      }
  610|  70.7M|      if (c) {
  ------------------
  |  Branch (610:11): [True: 66.5M, False: 4.18M]
  ------------------
  611|  66.5M|        cost += av1_cost_literal(1);
  ------------------
  |  |   29|  66.5M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  66.5M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  612|  66.5M|      } else {
  613|  4.18M|        const int sign01 = (sign ^ sign) - sign;
  614|  4.18M|        const int dc_sign_ctx = txb_ctx->dc_sign_ctx;
  615|  4.18M|        cost += coeff_costs->dc_sign_cost[dc_sign_ctx][sign01];
  616|  4.18M|        return cost;
  617|  4.18M|      }
  618|  70.7M|    }
  619|  71.0M|  }
  620|  66.8M|  const int(*base_cost)[8] = coeff_costs->base_cost;
  621|  2.31G|  for (c = eob - 2; c >= 1; --c) {
  ------------------
  |  Branch (621:21): [True: 2.25G, False: 66.8M]
  ------------------
  622|  2.25G|    const int pos = scan[c];
  623|  2.25G|    const int coeff_ctx = coeff_contexts[pos];
  624|  2.25G|    const tran_low_t v = qcoeff[pos];
  625|  2.25G|    if (!v) {
  ------------------
  |  Branch (625:9): [True: 785M, False: 1.46G]
  ------------------
  626|   785M|      cost += base_cost[coeff_ctx][0];
  627|   785M|      continue;
  628|   785M|    }
  629|  1.46G|    const int level = abs(v);
  630|  1.46G|    cost += base_cost[coeff_ctx][AOMMIN(level, 3)];
  ------------------
  |  |   34|  1.46G|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 674M, False: 791M]
  |  |  ------------------
  ------------------
  631|       |    // sign bit cost
  632|  1.46G|    cost += av1_cost_literal(1);
  ------------------
  |  |   29|  1.46G|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|  1.46G|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  633|  1.46G|    if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  1.46G|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (633:9): [True: 791M, False: 674M]
  ------------------
  634|   791M|      const int ctx = get_br_ctx(levels, pos, bhl, tx_class);
  635|   791M|      cost += get_br_cost(level, lps_cost[ctx]);
  636|   791M|    }
  637|  1.46G|  }
  638|       |  // c == 0 after previous loop
  639|  66.8M|  {
  640|  66.8M|    const int pos = scan[c];
  641|  66.8M|    const tran_low_t v = qcoeff[pos];
  642|  66.8M|    const int coeff_ctx = coeff_contexts[pos];
  643|  66.8M|    if (!v) {
  ------------------
  |  Branch (643:9): [True: 7.64M, False: 59.2M]
  ------------------
  644|  7.64M|      cost += base_cost[coeff_ctx][0];
  645|  59.2M|    } else {
  646|  59.2M|      const int sign = AOMSIGN(v);
  ------------------
  |  |   36|  59.2M|#define AOMSIGN(x) ((x) < 0 ? -1 : 0)
  |  |  ------------------
  |  |  |  Branch (36:21): [True: 29.4M, False: 29.7M]
  |  |  ------------------
  ------------------
  647|  59.2M|      const int level = (v ^ sign) - sign;
  648|  59.2M|      cost += base_cost[coeff_ctx][AOMMIN(level, 3)];
  ------------------
  |  |   34|  59.2M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 14.7M, False: 44.5M]
  |  |  ------------------
  ------------------
  649|       |      // sign bit cost
  650|  59.2M|      const int sign01 = (sign ^ sign) - sign;
  651|  59.2M|      const int dc_sign_ctx = txb_ctx->dc_sign_ctx;
  652|  59.2M|      cost += coeff_costs->dc_sign_cost[dc_sign_ctx][sign01];
  653|  59.2M|      if (level > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|  59.2M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (653:11): [True: 44.5M, False: 14.6M]
  ------------------
  654|  44.5M|        const int ctx = get_br_ctx(levels, pos, bhl, tx_class);
  655|  44.5M|        cost += get_br_cost(level, lps_cost[ctx]);
  656|  44.5M|      }
  657|  59.2M|    }
  658|  66.8M|  }
  659|  66.8M|  return cost;
  660|  71.0M|}

txb_rdopt.c:get_eob_cost:
   67|   220M|                        const LV_MAP_COEFF_COST *txb_costs, TX_CLASS tx_class) {
   68|   220M|  int eob_extra;
   69|   220M|  const int eob_pt = av1_get_eob_pos_token(eob, &eob_extra);
   70|   220M|  int eob_cost = 0;
   71|   220M|  const int eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1;
  ------------------
  |  Branch (71:29): [True: 187M, False: 33.2M]
  ------------------
   72|   220M|  eob_cost = txb_eob_costs->eob_cost[eob_multi_ctx][eob_pt - 1];
   73|       |
   74|   220M|  if (av1_eob_offset_bits[eob_pt] > 0) {
  ------------------
  |  Branch (74:7): [True: 203M, False: 17.5M]
  ------------------
   75|   203M|    const int eob_ctx = eob_pt - 3;
   76|   203M|    const int eob_shift = av1_eob_offset_bits[eob_pt] - 1;
   77|   203M|    const int bit = (eob_extra & (1 << eob_shift)) ? 1 : 0;
  ------------------
  |  Branch (77:21): [True: 151M, False: 51.3M]
  ------------------
   78|   203M|    eob_cost += txb_costs->eob_extra_cost[eob_ctx][bit];
   79|   203M|    const int offset_bits = av1_eob_offset_bits[eob_pt];
   80|   203M|    if (offset_bits > 1) eob_cost += av1_cost_literal(offset_bits - 1);
  ------------------
  |  |   29|   193M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   193M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  |  Branch (80:9): [True: 193M, False: 9.73M]
  ------------------
   81|   203M|  }
   82|   220M|  return eob_cost;
   83|   220M|}
txb_rdopt.c:get_coeff_cost_general:
  171|   242M|                                         const uint8_t *levels) {
  172|   242M|  int cost = 0;
  173|   242M|  if (is_last) {
  ------------------
  |  Branch (173:7): [True: 36.6M, False: 205M]
  ------------------
  174|  36.6M|    cost += txb_costs->base_eob_cost[coeff_ctx][AOMMIN(abs_qc, 3) - 1];
  ------------------
  |  |   34|  36.6M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 14.4M, False: 22.1M]
  |  |  ------------------
  ------------------
  175|   205M|  } else {
  176|   205M|    cost += txb_costs->base_cost[coeff_ctx][AOMMIN(abs_qc, 3)];
  ------------------
  |  |   34|   205M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 110M, False: 95.1M]
  |  |  ------------------
  ------------------
  177|   205M|  }
  178|   242M|  if (abs_qc != 0) {
  ------------------
  |  Branch (178:7): [True: 242M, False: 18.4E]
  ------------------
  179|   242M|    if (ci == 0) {
  ------------------
  |  Branch (179:9): [True: 78.7M, False: 163M]
  ------------------
  180|  78.7M|      cost += txb_costs->dc_sign_cost[dc_sign_ctx][sign];
  181|   163M|    } else {
  182|   163M|      cost += av1_cost_literal(1);
  ------------------
  |  |   29|   163M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   163M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  183|   163M|    }
  184|   242M|    if (abs_qc > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   242M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (184:9): [True: 119M, False: 123M]
  ------------------
  185|   119M|      int br_ctx;
  186|   119M|      if (is_last)
  ------------------
  |  Branch (186:11): [True: 22.2M, False: 97.1M]
  ------------------
  187|  22.2M|        br_ctx = get_br_ctx_eob(ci, bhl, tx_class);
  188|  97.1M|      else
  189|  97.1M|        br_ctx = get_br_ctx(levels, ci, bhl, tx_class);
  190|   119M|      cost += get_br_cost(abs_qc, txb_costs->lps_cost[br_ctx]);
  191|   119M|    }
  192|   242M|  }
  193|   242M|  return cost;
  194|   242M|}
txb_rdopt.c:get_br_cost:
   94|   997M|static inline int get_br_cost(tran_low_t level, const int *coeff_lps) {
   95|   997M|  const int base_range = AOMMIN(level - 1 - NUM_BASE_LEVELS, COEFF_BASE_RANGE);
  ------------------
  |  |   34|   997M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 720M, False: 276M]
  |  |  ------------------
  ------------------
   96|   997M|  return coeff_lps[base_range] + get_golomb_cost(level);
   97|   997M|}
txb_rdopt.c:get_golomb_cost:
   85|  1.00G|static inline int get_golomb_cost(int abs_qc) {
   86|  1.00G|  if (abs_qc >= 1 + NUM_BASE_LEVELS + COEFF_BASE_RANGE) {
  ------------------
  |  |   46|  1.00G|#define NUM_BASE_LEVELS 2
  ------------------
                if (abs_qc >= 1 + NUM_BASE_LEVELS + COEFF_BASE_RANGE) {
  ------------------
  |  |   49|  1.00G|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  1.00G|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
  |  Branch (86:7): [True: 292M, False: 716M]
  ------------------
   87|   292M|    const int r = abs_qc - COEFF_BASE_RANGE - NUM_BASE_LEVELS;
  ------------------
  |  |   49|   292M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   292M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                  const int r = abs_qc - COEFF_BASE_RANGE - NUM_BASE_LEVELS;
  ------------------
  |  |   46|   292M|#define NUM_BASE_LEVELS 2
  ------------------
   88|   292M|    const int length = get_msb(r) + 1;
   89|   292M|    return av1_cost_literal(2 * length - 1);
  ------------------
  |  |   29|   292M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   292M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
   90|   292M|  }
   91|   716M|  return 0;
   92|  1.00G|}
txb_rdopt.c:get_dqv:
   40|   349M|                          const qm_val_t *iqmatrix) {
   41|   349M|  int dqv = dequant[!!coeff_idx];
   42|   349M|  if (iqmatrix != NULL)
  ------------------
  |  Branch (42:7): [True: 188M, False: 160M]
  ------------------
   43|   188M|    dqv =
   44|   188M|        ((iqmatrix[coeff_idx] * dqv) + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|   188M|#define AOM_QM_BITS 5
  ------------------
                      ((iqmatrix[coeff_idx] * dqv) + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
  ------------------
  |  |   62|   188M|#define AOM_QM_BITS 5
  ------------------
   45|   349M|  return dqv;
   46|   349M|}
txb_rdopt.c:get_qc_dqc_low:
  198|  89.5M|                                  tran_low_t *dqc_low) {
  199|  89.5M|  tran_low_t abs_qc_low = abs_qc - 1;
  200|  89.5M|  *qc_low = (-sign ^ abs_qc_low) + sign;
  201|  89.5M|  assert((sign ? -abs_qc_low : abs_qc_low) == *qc_low);
  202|  89.5M|  tran_low_t abs_dqc_low = (abs_qc_low * dqv) >> shift;
  203|  89.5M|  *dqc_low = (-sign ^ abs_dqc_low) + sign;
  204|       |  assert((sign ? -abs_dqc_low : abs_dqc_low) == *dqc_low);
  205|  89.5M|}
txb_rdopt.c:get_coeff_cost_eob:
  148|   174M|                                     int bhl, TX_CLASS tx_class) {
  149|   174M|  int cost = 0;
  150|   174M|  cost += txb_costs->base_eob_cost[coeff_ctx][AOMMIN(abs_qc, 3) - 1];
  ------------------
  |  |   34|   174M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 125M, False: 49.1M]
  |  |  ------------------
  ------------------
  151|   174M|  if (abs_qc != 0) {
  ------------------
  |  Branch (151:7): [True: 174M, False: 18.4E]
  ------------------
  152|   174M|    if (ci == 0) {
  ------------------
  |  Branch (152:9): [True: 10.0M, False: 164M]
  ------------------
  153|  10.0M|      cost += txb_costs->dc_sign_cost[dc_sign_ctx][sign];
  154|   164M|    } else {
  155|   164M|      cost += av1_cost_literal(1);
  ------------------
  |  |   29|   164M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   164M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  156|   164M|    }
  157|   174M|    if (abs_qc > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   174M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (157:9): [True: 49.9M, False: 124M]
  ------------------
  158|  49.9M|      int br_ctx;
  159|  49.9M|      br_ctx = get_br_ctx_eob(ci, bhl, tx_class);
  160|  49.9M|      cost += get_br_cost(abs_qc, txb_costs->lps_cost[br_ctx]);
  161|  49.9M|    }
  162|   174M|  }
  163|   174M|  return cost;
  164|   174M|}
txb_rdopt.c:get_coeff_dist:
   50|   605M|                                     int coeff_idx) {
   51|   605M|  int64_t diff = (tcoeff - dqcoeff) * (1 << shift);
   52|   605M|  if (qmatrix == NULL) {
  ------------------
  |  Branch (52:7): [True: 20.2M, False: 585M]
  ------------------
   53|  20.2M|    return diff * diff;
   54|  20.2M|  }
   55|       |  // When AOM_DIST_METRIC_QM_PSNR is enabled, this mirrors the rate-distortion
   56|       |  // computation done in av1_block_error_qm, improving visual quality.
   57|       |  // The maximum value of `shift` is 2, `tcoeff` and `dqcoeff` are at most 22
   58|       |  // bits, and AOM_QM_BITS is 5, so `diff` should fit in 29-bits. The
   59|       |  // multiplication `diff * diff` then does not risk overflowing.
   60|   585M|  diff *= qmatrix[coeff_idx];
   61|   585M|  const int64_t error =
   62|   585M|      (diff * diff + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|   585M|#define AOM_QM_BITS 5
  ------------------
                    (diff * diff + (1 << (2 * AOM_QM_BITS - 1))) >> (2 * AOM_QM_BITS);
  ------------------
  |  |   62|   585M|#define AOM_QM_BITS 5
  ------------------
   63|   585M|  return error;
   64|   605M|}
txb_rdopt.c:get_two_coeff_cost_simple:
  123|   431M|    const uint8_t *levels, int *cost_low) {
  124|       |  // this simple version assumes the coeff's scan_idx is not DC (scan_idx != 0)
  125|       |  // and not the last (scan_idx != eob - 1)
  126|   431M|  assert(ci > 0);
  127|   431M|  int cost = txb_costs->base_cost[coeff_ctx][AOMMIN(abs_qc, 3)];
  ------------------
  |  |   34|   431M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 102M, False: 329M]
  |  |  ------------------
  ------------------
  128|   431M|  int diff = 0;
  129|   431M|  if (abs_qc <= 3) diff = txb_costs->base_cost[coeff_ctx][abs_qc + 4];
  ------------------
  |  Branch (129:7): [True: 162M, False: 268M]
  ------------------
  130|   431M|  if (abs_qc) {
  ------------------
  |  Branch (130:7): [True: 430M, False: 711k]
  ------------------
  131|   430M|    cost += av1_cost_literal(1);
  ------------------
  |  |   29|   430M|#define av1_cost_literal(n) ((n) * (1 << AV1_PROB_COST_SHIFT))
  |  |  ------------------
  |  |  |  |   25|   430M|#define AV1_PROB_COST_SHIFT 9
  |  |  ------------------
  ------------------
  132|   430M|    if (abs_qc > NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   430M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (132:9): [True: 335M, False: 95.0M]
  ------------------
  133|   335M|      const int br_ctx = get_br_ctx(levels, ci, bhl, tx_class);
  134|   335M|      int brcost_diff = 0;
  135|   335M|      cost += get_br_cost_with_diff(abs_qc, txb_costs->lps_cost[br_ctx],
  136|   335M|                                    &brcost_diff);
  137|   335M|      diff += brcost_diff;
  138|   335M|    }
  139|   430M|  }
  140|   431M|  *cost_low = cost - diff;
  141|       |
  142|   431M|  return cost;
  143|   431M|}
txb_rdopt.c:get_br_cost_with_diff:
  100|   335M|                                        int *diff) {
  101|   335M|  const int base_range = AOMMIN(level - 1 - NUM_BASE_LEVELS, COEFF_BASE_RANGE);
  ------------------
  |  |   34|   335M|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 256M, False: 78.8M]
  |  |  ------------------
  ------------------
  102|   335M|  int golomb_bits = 0;
  103|   335M|  if (level <= COEFF_BASE_RANGE + 1 + NUM_BASE_LEVELS)
  ------------------
  |  |   49|   335M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   335M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                if (level <= COEFF_BASE_RANGE + 1 + NUM_BASE_LEVELS)
  ------------------
  |  |   46|   335M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (103:7): [True: 262M, False: 72.6M]
  ------------------
  104|   262M|    *diff += coeff_lps[base_range + COEFF_BASE_RANGE + 1];
  ------------------
  |  |   49|   262M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   262M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
  105|       |
  106|   335M|  if (level >= COEFF_BASE_RANGE + 1 + NUM_BASE_LEVELS) {
  ------------------
  |  |   49|   335M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|   335M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                if (level >= COEFF_BASE_RANGE + 1 + NUM_BASE_LEVELS) {
  ------------------
  |  |   46|   335M|#define NUM_BASE_LEVELS 2
  ------------------
  |  Branch (106:7): [True: 84.4M, False: 250M]
  ------------------
  107|  84.4M|    int r = level - COEFF_BASE_RANGE - NUM_BASE_LEVELS;
  ------------------
  |  |   49|  84.4M|#define COEFF_BASE_RANGE (4 * (BR_CDF_SIZE - 1))
  |  |  ------------------
  |  |  |  |   48|  84.4M|#define BR_CDF_SIZE (4)
  |  |  ------------------
  ------------------
                  int r = level - COEFF_BASE_RANGE - NUM_BASE_LEVELS;
  ------------------
  |  |   46|  84.4M|#define NUM_BASE_LEVELS 2
  ------------------
  108|  84.4M|    if (r < 32) {
  ------------------
  |  Branch (108:9): [True: 69.5M, False: 14.9M]
  ------------------
  109|  69.5M|      golomb_bits = golomb_bits_cost[r];
  110|  69.5M|      *diff += golomb_cost_diff[r];
  111|  69.5M|    } else {
  112|  14.9M|      golomb_bits = get_golomb_cost(level);
  113|  14.9M|      *diff += (r & (r - 1)) == 0 ? 1024 : 0;
  ------------------
  |  Branch (113:16): [True: 833k, False: 14.0M]
  ------------------
  114|  14.9M|    }
  115|  84.4M|  }
  116|       |
  117|   335M|  return coeff_lps[base_range] + golomb_bits;
  118|   335M|}

av1_get_force_skip_low_temp_var_small_sb:
  854|   306k|                                             BLOCK_SIZE bsize) {
  855|       |  // Relative indices of MB inside the superblock.
  856|   306k|  const int mi_x = mi_row & 0xF;
  857|   306k|  const int mi_y = mi_col & 0xF;
  858|       |  // Relative indices of 16x16 block inside the superblock.
  859|   306k|  const int i = mi_x >> 2;
  860|   306k|  const int j = mi_y >> 2;
  861|   306k|  int force_skip_low_temp_var = 0;
  862|       |  // Set force_skip_low_temp_var based on the block size and block offset.
  863|   306k|  switch (bsize) {
  864|      1|    case BLOCK_64X64: force_skip_low_temp_var = variance_low[0]; break;
  ------------------
  |  Branch (864:5): [True: 1, False: 306k]
  ------------------
  865|      2|    case BLOCK_64X32:
  ------------------
  |  Branch (865:5): [True: 2, False: 306k]
  ------------------
  866|      2|      if (!mi_y && !mi_x) {
  ------------------
  |  Branch (866:11): [True: 2, False: 0]
  |  Branch (866:20): [True: 2, False: 0]
  ------------------
  867|      2|        force_skip_low_temp_var = variance_low[1];
  868|      2|      } else if (!mi_y && mi_x) {
  ------------------
  |  Branch (868:18): [True: 0, False: 0]
  |  Branch (868:27): [True: 0, False: 0]
  ------------------
  869|      0|        force_skip_low_temp_var = variance_low[2];
  870|      0|      }
  871|      2|      break;
  872|      2|    case BLOCK_32X64:
  ------------------
  |  Branch (872:5): [True: 2, False: 306k]
  ------------------
  873|      2|      if (!mi_y && !mi_x) {
  ------------------
  |  Branch (873:11): [True: 2, False: 0]
  |  Branch (873:20): [True: 2, False: 0]
  ------------------
  874|      2|        force_skip_low_temp_var = variance_low[3];
  875|      2|      } else if (mi_y && !mi_x) {
  ------------------
  |  Branch (875:18): [True: 0, False: 0]
  |  Branch (875:26): [True: 0, False: 0]
  ------------------
  876|      0|        force_skip_low_temp_var = variance_low[4];
  877|      0|      }
  878|      2|      break;
  879|  11.1k|    case BLOCK_32X32:
  ------------------
  |  Branch (879:5): [True: 11.1k, False: 295k]
  ------------------
  880|  11.1k|      if (!mi_y && !mi_x) {
  ------------------
  |  Branch (880:11): [True: 6.32k, False: 4.82k]
  |  Branch (880:20): [True: 3.59k, False: 2.72k]
  ------------------
  881|  3.60k|        force_skip_low_temp_var = variance_low[5];
  882|  7.54k|      } else if (mi_y && !mi_x) {
  ------------------
  |  Branch (882:18): [True: 4.83k, False: 2.71k]
  |  Branch (882:26): [True: 2.68k, False: 2.14k]
  ------------------
  883|  2.68k|        force_skip_low_temp_var = variance_low[6];
  884|  4.86k|      } else if (!mi_y && mi_x) {
  ------------------
  |  Branch (884:18): [True: 2.72k, False: 2.13k]
  |  Branch (884:27): [True: 2.72k, False: 0]
  ------------------
  885|  2.72k|        force_skip_low_temp_var = variance_low[7];
  886|  2.72k|      } else if (mi_y && mi_x) {
  ------------------
  |  Branch (886:18): [True: 2.14k, False: 18.4E]
  |  Branch (886:26): [True: 2.14k, False: 0]
  ------------------
  887|  2.14k|        force_skip_low_temp_var = variance_low[8];
  888|  2.14k|      }
  889|  11.1k|      break;
  890|  1.12k|    case BLOCK_32X16:
  ------------------
  |  Branch (890:5): [True: 1.12k, False: 305k]
  ------------------
  891|  2.04k|    case BLOCK_16X32:
  ------------------
  |  Branch (891:5): [True: 922, False: 305k]
  ------------------
  892|  64.2k|    case BLOCK_16X16:
  ------------------
  |  Branch (892:5): [True: 62.1k, False: 244k]
  ------------------
  893|  64.2k|      force_skip_low_temp_var = variance_low[pos_shift_16x16[i][j]];
  894|  64.2k|      break;
  895|   231k|    default: break;
  ------------------
  |  Branch (895:5): [True: 231k, False: 75.2k]
  ------------------
  896|   306k|  }
  897|       |
  898|   306k|  return force_skip_low_temp_var;
  899|   306k|}
av1_set_variance_partition_thresholds:
  975|  73.6k|                                           int content_lowsumdiff) {
  976|  73.6k|  SPEED_FEATURES *const sf = &cpi->sf;
  977|  73.6k|  if (sf->part_sf.partition_search_type != VAR_BASED_PARTITION) {
  ------------------
  |  Branch (977:7): [True: 49.2k, False: 24.4k]
  ------------------
  978|  49.2k|    return;
  979|  49.2k|  } else {
  980|  24.4k|    set_vbp_thresholds(cpi, cpi->vbp_info.thresholds, 0, qindex,
  981|  24.4k|                       content_lowsumdiff, 0, 0, 0, 0);
  982|       |    // The threshold below is not changed locally.
  983|  24.4k|    cpi->vbp_info.threshold_minmax = 15 + (qindex >> 3);
  984|  24.4k|  }
  985|  73.6k|}
av1_choose_var_based_partitioning:
 1603|  48.9k|                                      int mi_col) {
 1604|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1605|       |  start_timing(cpi, choose_var_based_partitioning_time);
 1606|       |#endif
 1607|  48.9k|  AV1_COMMON *const cm = &cpi->common;
 1608|  48.9k|  MACROBLOCKD *xd = &x->e_mbd;
 1609|  48.9k|  const int64_t *const vbp_thresholds = cpi->vbp_info.thresholds;
 1610|  48.9k|  PART_EVAL_STATUS force_split[85];
 1611|  48.9k|  int avg_64x64;
 1612|  48.9k|  int max_var_32x32[4];
 1613|  48.9k|  int min_var_32x32[4];
 1614|  48.9k|  int var_32x32;
 1615|  48.9k|  int var_64x64;
 1616|  48.9k|  int min_var_64x64 = INT_MAX;
 1617|  48.9k|  int max_var_64x64 = 0;
 1618|  48.9k|  int64_t avg_16x16[4][4];
 1619|  48.9k|  int maxvar_16x16[4][4];
 1620|  48.9k|  int minvar_16x16[4][4];
 1621|  48.9k|  const uint8_t *src_buf;
 1622|  48.9k|  const uint8_t *dst_buf;
 1623|  48.9k|  int dst_stride;
 1624|  48.9k|  unsigned int uv_sad[MAX_MB_PLANE - 1];
 1625|  48.9k|  NOISE_LEVEL noise_level = kLow;
 1626|  48.9k|  bool is_zero_motion = true;
 1627|  48.9k|  bool scaled_ref_last = false;
 1628|  48.9k|  struct scale_factors sf_no_scale;
 1629|  48.9k|  av1_setup_scale_factors_for_frame(&sf_no_scale, cm->width, cm->height,
 1630|  48.9k|                                    cm->width, cm->height);
 1631|       |
 1632|  48.9k|  bool is_key_frame =
 1633|  48.9k|      (frame_is_intra_only(cm) ||
  ------------------
  |  Branch (1633:8): [True: 8.40k, False: 40.5k]
  ------------------
 1634|  40.5k|       (cpi->ppi->use_svc &&
  ------------------
  |  Branch (1634:9): [True: 0, False: 40.5k]
  ------------------
 1635|      0|        cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame));
  ------------------
  |  Branch (1635:9): [True: 0, False: 0]
  ------------------
 1636|       |
 1637|  48.9k|  assert(cm->seq_params->sb_size == BLOCK_64X64 ||
 1638|  48.9k|         cm->seq_params->sb_size == BLOCK_128X128);
 1639|  48.9k|  const bool is_small_sb = (cm->seq_params->sb_size == BLOCK_64X64);
 1640|  18.4E|  const int num_64x64_blocks = is_small_sb ? 1 : 4;
  ------------------
  |  Branch (1640:32): [True: 49.0k, False: 18.4E]
  ------------------
 1641|       |
 1642|  48.9k|  unsigned int y_sad = UINT_MAX;
 1643|  48.9k|  unsigned int y_sad_g = UINT_MAX;
 1644|  48.9k|  unsigned int y_sad_alt = UINT_MAX;
 1645|  48.9k|  unsigned int y_sad_last = UINT_MAX;
 1646|  18.4E|  BLOCK_SIZE bsize = is_small_sb ? BLOCK_64X64 : BLOCK_128X128;
  ------------------
  |  Branch (1646:22): [True: 49.0k, False: 18.4E]
  ------------------
 1647|       |
 1648|       |  // Force skip encoding for all superblocks on slide change for
 1649|       |  // non_reference_frames.
 1650|  48.9k|  if (cpi->sf.rt_sf.skip_encoding_non_reference_slide_change &&
  ------------------
  |  Branch (1650:7): [True: 0, False: 48.9k]
  ------------------
 1651|      0|      cpi->rc.high_source_sad && cpi->ppi->rtc_ref.non_reference_frame) {
  ------------------
  |  Branch (1651:7): [True: 0, False: 0]
  |  Branch (1651:34): [True: 0, False: 0]
  ------------------
 1652|      0|    MB_MODE_INFO **mi = cm->mi_params.mi_grid_base +
 1653|      0|                        get_mi_grid_idx(&cm->mi_params, mi_row, mi_col);
 1654|      0|    av1_set_fixed_partitioning(cpi, tile, mi, mi_row, mi_col, bsize);
 1655|      0|    x->force_zeromv_skip_for_sb = 1;
 1656|      0|    return 0;
 1657|      0|  }
 1658|       |
 1659|       |  // Ref frame used in partitioning.
 1660|  48.9k|  MV_REFERENCE_FRAME ref_frame_partition = LAST_FRAME;
 1661|       |
 1662|  48.9k|  int64_t thresholds[5] = { vbp_thresholds[0], vbp_thresholds[1],
 1663|  48.9k|                            vbp_thresholds[2], vbp_thresholds[3],
 1664|  48.9k|                            vbp_thresholds[4] };
 1665|       |
 1666|  48.9k|  const int segment_id = xd->mi[0]->segment_id;
 1667|  48.9k|  uint64_t blk_sad = 0;
 1668|  48.9k|  if (cpi->src_sad_blk_64x64 != NULL &&
  ------------------
  |  Branch (1668:7): [True: 0, False: 48.9k]
  ------------------
 1669|      0|      cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
  ------------------
  |  Branch (1669:7): [True: 0, False: 0]
  ------------------
 1670|      0|    const int sb_size_by_mb = (cm->seq_params->sb_size == BLOCK_128X128)
  ------------------
  |  Branch (1670:31): [True: 0, False: 0]
  ------------------
 1671|      0|                                  ? (cm->seq_params->mib_size >> 1)
 1672|      0|                                  : cm->seq_params->mib_size;
 1673|      0|    const int sb_cols =
 1674|      0|        (cm->mi_params.mi_cols + sb_size_by_mb - 1) / sb_size_by_mb;
 1675|      0|    const int sbi_col = mi_col / sb_size_by_mb;
 1676|      0|    const int sbi_row = mi_row / sb_size_by_mb;
 1677|      0|    blk_sad = cpi->src_sad_blk_64x64[sbi_col + sbi_row * sb_cols];
 1678|      0|  }
 1679|       |
 1680|  48.9k|  const bool is_segment_id_boosted =
 1681|  48.9k|      cpi->oxcf.q_cfg.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled &&
  ------------------
  |  Branch (1681:7): [True: 0, False: 48.9k]
  |  Branch (1681:55): [True: 0, False: 0]
  ------------------
 1682|      0|      cyclic_refresh_segment_id_boosted(segment_id);
  ------------------
  |  Branch (1682:7): [True: 0, False: 0]
  ------------------
 1683|  48.9k|  const int sb_qindex =
 1684|  48.9k|      clamp(cm->delta_q_info.delta_q_present_flag
  ------------------
  |  Branch (1684:13): [True: 33.9k, False: 15.0k]
  ------------------
 1685|  48.9k|                ? cm->quant_params.base_qindex + x->delta_qindex
 1686|  48.9k|                : cm->quant_params.base_qindex,
 1687|  48.9k|            0, QINDEX_RANGE - 1);
  ------------------
  |  |   27|  48.9k|#define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   26|  48.9k|#define MAXQ 255
  |  |  ------------------
  |  |               #define QINDEX_RANGE (MAXQ - MINQ + 1)
  |  |  ------------------
  |  |  |  |   25|  48.9k|#define MINQ 0
  |  |  ------------------
  ------------------
 1688|  48.9k|  const int qindex = is_segment_id_boosted || cpi->roi.delta_qp_enabled
  ------------------
  |  Branch (1688:22): [True: 18.4E, False: 48.9k]
  |  Branch (1688:47): [True: 10, False: 48.9k]
  ------------------
 1689|  48.9k|                         ? av1_get_qindex(&cm->seg, segment_id, sb_qindex)
 1690|  48.9k|                         : sb_qindex;
 1691|  48.9k|  set_vbp_thresholds(
 1692|  48.9k|      cpi, thresholds, blk_sad, qindex, x->content_state_sb.low_sumdiff,
 1693|  48.9k|      x->content_state_sb.source_sad_nonrd, x->content_state_sb.source_sad_rd,
 1694|  48.9k|      is_segment_id_boosted, x->content_state_sb.lighting_change);
 1695|       |
 1696|  48.9k|  src_buf = x->plane[AOM_PLANE_Y].src.buf;
  ------------------
  |  |  281|  48.9k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1697|  48.9k|  int src_stride = x->plane[AOM_PLANE_Y].src.stride;
  ------------------
  |  |  281|  48.9k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1698|       |
 1699|       |  // Index for force_split: 0 for 64x64, 1-4 for 32x32 blocks,
 1700|       |  // 5-20 for the 16x16 blocks.
 1701|  48.9k|  force_split[0] = PART_EVAL_ALL;
 1702|  48.9k|  memset(x->part_search_info.variance_low, 0,
 1703|  48.9k|         sizeof(x->part_search_info.variance_low));
 1704|       |
 1705|       |  // Check if LAST frame is NULL, and if so, treat this frame
 1706|       |  // as a key frame, for the purpose of the superblock partitioning.
 1707|       |  // LAST == NULL can happen in cases where enhancement spatial layers are
 1708|       |  // enabled dyanmically and the only reference is the spatial(GOLDEN).
 1709|       |  // If LAST frame has a different resolution: set the scaled_ref_last flag
 1710|       |  // and check if ref_scaled is NULL.
 1711|  48.9k|  if (!frame_is_intra_only(cm)) {
  ------------------
  |  Branch (1711:7): [True: 40.5k, False: 8.47k]
  ------------------
 1712|  40.5k|    const YV12_BUFFER_CONFIG *ref = get_ref_frame_yv12_buf(cm, LAST_FRAME);
 1713|  40.5k|    if (ref == NULL) {
  ------------------
  |  Branch (1713:9): [True: 0, False: 40.5k]
  ------------------
 1714|      0|      is_key_frame = true;
 1715|  40.5k|    } else if (ref->y_crop_height != cm->height ||
  ------------------
  |  Branch (1715:16): [True: 30.1k, False: 10.3k]
  ------------------
 1716|  35.1k|               ref->y_crop_width != cm->width) {
  ------------------
  |  Branch (1716:16): [True: 4.90k, False: 5.42k]
  ------------------
 1717|  35.1k|      scaled_ref_last = true;
 1718|  35.1k|      const YV12_BUFFER_CONFIG *ref_scaled =
 1719|  35.1k|          av1_get_scaled_ref_frame(cpi, LAST_FRAME);
 1720|  35.1k|      if (ref_scaled == NULL) is_key_frame = true;
  ------------------
  |  Branch (1720:11): [True: 0, False: 35.1k]
  ------------------
 1721|  35.1k|    }
 1722|  40.5k|  }
 1723|       |
 1724|  48.9k|  x->source_variance = UINT_MAX;
 1725|       |  // For nord_pickmode: compute source_variance, only for superblocks with
 1726|       |  // some motion for now. This input can then be used to bias the partitioning
 1727|       |  // or the chroma_check.
 1728|  48.9k|  if (cpi->sf.rt_sf.use_nonrd_pick_mode &&
  ------------------
  |  Branch (1728:7): [True: 49.0k, False: 18.4E]
  ------------------
 1729|  49.0k|      x->content_state_sb.source_sad_nonrd > kLowSad)
  ------------------
  |  Branch (1729:7): [True: 48.9k, False: 115]
  ------------------
 1730|  48.9k|    x->source_variance = av1_get_perpixel_variance_facade(
 1731|  48.9k|        cpi, xd, &x->plane[0].src, cm->seq_params->sb_size, AOM_PLANE_Y);
  ------------------
  |  |  281|  48.9k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1732|       |
 1733|  48.9k|  if (!is_key_frame) {
  ------------------
  |  Branch (1733:7): [True: 40.5k, False: 8.45k]
  ------------------
 1734|  40.5k|    setup_planes(cpi, x, &y_sad, &y_sad_g, &y_sad_alt, &y_sad_last,
 1735|  40.5k|                 &ref_frame_partition, &sf_no_scale, mi_row, mi_col,
 1736|  40.5k|                 is_small_sb, scaled_ref_last);
 1737|       |
 1738|  40.5k|    MB_MODE_INFO *mi = xd->mi[0];
 1739|       |    // Use reference SB directly for zero mv.
 1740|  40.5k|    if (mi->mv[0].as_int != 0) {
  ------------------
  |  Branch (1740:9): [True: 7.91k, False: 32.6k]
  ------------------
 1741|  7.91k|      dst_buf = xd->plane[AOM_PLANE_Y].dst.buf;
  ------------------
  |  |  281|  7.91k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1742|  7.91k|      dst_stride = xd->plane[AOM_PLANE_Y].dst.stride;
  ------------------
  |  |  281|  7.91k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1743|  7.91k|      is_zero_motion = false;
 1744|  32.6k|    } else {
 1745|  32.6k|      dst_buf = xd->plane[AOM_PLANE_Y].pre[0].buf;
  ------------------
  |  |  281|  32.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1746|  32.6k|      dst_stride = xd->plane[AOM_PLANE_Y].pre[0].stride;
  ------------------
  |  |  281|  32.6k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1747|  32.6k|    }
 1748|  40.5k|  } else {
 1749|  8.45k|    dst_buf = NULL;
 1750|  8.45k|    dst_stride = 0;
 1751|  8.45k|  }
 1752|       |
 1753|       |  // check and set the color sensitivity of sb.
 1754|  48.9k|  av1_zero(uv_sad);
  ------------------
  |  |   43|  48.9k|#define av1_zero(dest) memset(&(dest), 0, sizeof(dest))
  ------------------
 1755|  48.9k|  chroma_check(cpi, x, bsize, y_sad_last, y_sad_g, y_sad_alt, is_key_frame,
 1756|  48.9k|               is_zero_motion, uv_sad);
 1757|       |
 1758|  48.9k|  x->force_zeromv_skip_for_sb = 0;
 1759|       |
 1760|  48.9k|  VP128x128 *vt;
 1761|  48.9k|  AOM_CHECK_MEM_ERROR(xd->error_info, vt, aom_malloc(sizeof(*vt)));
  ------------------
  |  |   71|  48.9k|  do {                                                    \
  |  |   72|  48.9k|    assert((error_info)->setjmp);                         \
  |  |   73|  48.9k|    lval = (expr);                                        \
  |  |   74|  48.9k|    if (!lval)                                            \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 48.9k]
  |  |  ------------------
  |  |   75|  48.9k|      aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \
  |  |   76|      0|                         "Failed to allocate " #lval);    \
  |  |   77|  48.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (77:12): [Folded, False: 48.9k]
  |  |  ------------------
  ------------------
 1762|  48.9k|  vt->split = td->vt64x64;
 1763|       |
 1764|       |  // If the superblock is completely static (zero source sad) and
 1765|       |  // the y_sad (relative to LAST ref) is very small, take the sb_size partition
 1766|       |  // and exit, and force zeromv_last skip mode for nonrd_pickmode.
 1767|       |  // Only do this on the base segment (so the QP-boosted segment, if applied,
 1768|       |  // can still continue cleaning/ramping up the quality).
 1769|       |  // Condition on color uv_sad is also added.
 1770|  48.9k|  if (!is_key_frame && cpi->sf.rt_sf.part_early_exit_zeromv &&
  ------------------
  |  Branch (1770:7): [True: 40.6k, False: 8.37k]
  |  Branch (1770:24): [True: 0, False: 40.6k]
  ------------------
 1771|      0|      cpi->rc.frames_since_key > 30 && segment_id == CR_SEGMENT_ID_BASE &&
  ------------------
  |  |   25|  48.9k|#define CR_SEGMENT_ID_BASE 0
  ------------------
  |  Branch (1771:7): [True: 0, False: 0]
  |  Branch (1771:40): [True: 0, False: 0]
  ------------------
 1772|      0|      ref_frame_partition == LAST_FRAME && xd->mi[0]->mv[0].as_int == 0) {
  ------------------
  |  Branch (1772:7): [True: 0, False: 0]
  |  Branch (1772:44): [True: 0, False: 0]
  ------------------
 1773|       |    // Exit here, if zero mv skip flag is set at SB level.
 1774|      0|    if (set_force_zeromv_skip_for_sb(cpi, x, tile, vt, uv_sad, mi_row, mi_col,
  ------------------
  |  Branch (1774:9): [True: 0, False: 0]
  ------------------
 1775|      0|                                     y_sad, bsize))
 1776|      0|      return 0;
 1777|      0|  }
 1778|       |
 1779|  48.9k|  if (cpi->noise_estimate.enabled)
  ------------------
  |  Branch (1779:7): [True: 0, False: 48.9k]
  ------------------
 1780|      0|    noise_level = av1_noise_estimate_extract_level(&cpi->noise_estimate);
 1781|       |
 1782|       |  // Fill in the entire tree of 8x8 (for inter frames) or 4x4 (for key frames)
 1783|       |  // variances for splits.
 1784|  48.9k|  fill_variance_tree_leaves(cpi, x, vt, force_split, avg_16x16, maxvar_16x16,
 1785|  48.9k|                            minvar_16x16, thresholds, src_buf, src_stride,
 1786|  48.9k|                            dst_buf, dst_stride, is_key_frame, is_small_sb);
 1787|       |
 1788|  48.9k|  avg_64x64 = 0;
 1789|  98.0k|  for (int blk64_idx = 0; blk64_idx < num_64x64_blocks; ++blk64_idx) {
  ------------------
  |  Branch (1789:27): [True: 49.1k, False: 48.9k]
  ------------------
 1790|  49.1k|    max_var_32x32[blk64_idx] = 0;
 1791|  49.1k|    min_var_32x32[blk64_idx] = INT_MAX;
 1792|  49.1k|    const int blk64_scale_idx = blk64_idx << 2;
 1793|   245k|    for (int lvl1_idx = 0; lvl1_idx < 4; lvl1_idx++) {
  ------------------
  |  Branch (1793:28): [True: 196k, False: 49.1k]
  ------------------
 1794|   196k|      const int lvl1_scale_idx = (blk64_scale_idx + lvl1_idx) << 2;
 1795|   980k|      for (int lvl2_idx = 0; lvl2_idx < 4; lvl2_idx++) {
  ------------------
  |  Branch (1795:30): [True: 784k, False: 196k]
  ------------------
 1796|   784k|        if (!is_key_frame) continue;
  ------------------
  |  Branch (1796:13): [True: 649k, False: 134k]
  ------------------
 1797|   134k|        VP16x16 *vtemp = &vt->split[blk64_idx].split[lvl1_idx].split[lvl2_idx];
 1798|   670k|        for (int lvl3_idx = 0; lvl3_idx < 4; lvl3_idx++)
  ------------------
  |  Branch (1798:32): [True: 535k, False: 134k]
  ------------------
 1799|   535k|          fill_variance_tree(&vtemp->split[lvl3_idx], BLOCK_8X8);
 1800|   134k|        fill_variance_tree(vtemp, BLOCK_16X16);
 1801|       |        // If variance of this 16x16 block is above the threshold, force block
 1802|       |        // to split. This also forces a split on the upper levels.
 1803|   134k|        get_variance(&vtemp->part_variances.none);
 1804|   134k|        if (vtemp->part_variances.none.variance > thresholds[3]) {
  ------------------
  |  Branch (1804:13): [True: 19.9k, False: 114k]
  ------------------
 1805|  19.9k|          const int split_index = 21 + lvl1_scale_idx + lvl2_idx;
 1806|  19.9k|          force_split[split_index] =
 1807|  19.9k|              cpi->sf.rt_sf.vbp_prune_16x16_split_using_min_max_sub_blk_var
  ------------------
  |  Branch (1807:15): [True: 0, False: 19.9k]
  ------------------
 1808|  19.9k|                  ? get_part_eval_based_on_sub_blk_var(vtemp, thresholds[3])
 1809|  19.9k|                  : PART_EVAL_ONLY_SPLIT;
 1810|  19.9k|          force_split[5 + blk64_scale_idx + lvl1_idx] = PART_EVAL_ONLY_SPLIT;
 1811|  19.9k|          force_split[blk64_idx + 1] = PART_EVAL_ONLY_SPLIT;
 1812|  19.9k|          force_split[0] = PART_EVAL_ONLY_SPLIT;
 1813|  19.9k|        }
 1814|   134k|      }
 1815|   196k|      fill_variance_tree(&vt->split[blk64_idx].split[lvl1_idx], BLOCK_32X32);
 1816|       |      // If variance of this 32x32 block is above the threshold, or if its above
 1817|       |      // (some threshold of) the average variance over the sub-16x16 blocks,
 1818|       |      // then force this block to split. This also forces a split on the upper
 1819|       |      // (64x64) level.
 1820|   196k|      uint64_t frame_sad_thresh = 20000;
 1821|   196k|      const int is_360p_or_smaller = cm->width * cm->height <= RESOLUTION_360P;
  ------------------
  |  |   63|   196k|#define RESOLUTION_360P 640 * 360
  ------------------
 1822|   196k|      if (cpi->svc.number_temporal_layers > 2 &&
  ------------------
  |  Branch (1822:11): [True: 0, False: 196k]
  ------------------
 1823|      0|          cpi->svc.temporal_layer_id == 0)
  ------------------
  |  Branch (1823:11): [True: 0, False: 0]
  ------------------
 1824|      0|        frame_sad_thresh = frame_sad_thresh << 1;
 1825|   196k|      if (force_split[5 + blk64_scale_idx + lvl1_idx] == PART_EVAL_ALL) {
  ------------------
  |  Branch (1825:11): [True: 144k, False: 51.8k]
  ------------------
 1826|   144k|        get_variance(&vt->split[blk64_idx].split[lvl1_idx].part_variances.none);
 1827|   144k|        var_32x32 =
 1828|   144k|            vt->split[blk64_idx].split[lvl1_idx].part_variances.none.variance;
 1829|   144k|        max_var_32x32[blk64_idx] = AOMMAX(var_32x32, max_var_32x32[blk64_idx]);
  ------------------
  |  |   35|   144k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 39.2k, False: 105k]
  |  |  ------------------
  ------------------
 1830|   144k|        min_var_32x32[blk64_idx] = AOMMIN(var_32x32, min_var_32x32[blk64_idx]);
  ------------------
  |  |   34|   144k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 71.3k, False: 73.0k]
  |  |  ------------------
  ------------------
 1831|   144k|        const int max_min_var_16X16_diff = (maxvar_16x16[blk64_idx][lvl1_idx] -
 1832|   144k|                                            minvar_16x16[blk64_idx][lvl1_idx]);
 1833|       |
 1834|   144k|        if (var_32x32 > thresholds[2] ||
  ------------------
  |  Branch (1834:13): [True: 29.3k, False: 115k]
  ------------------
 1835|   115k|            (!is_key_frame && var_32x32 > (thresholds[2] >> 1) &&
  ------------------
  |  Branch (1835:14): [True: 90.6k, False: 24.4k]
  |  Branch (1835:31): [True: 5.42k, False: 85.2k]
  ------------------
 1836|  29.5k|             var_32x32 > (avg_16x16[blk64_idx][lvl1_idx] >> 1))) {
  ------------------
  |  Branch (1836:14): [True: 223, False: 5.20k]
  ------------------
 1837|  29.5k|          force_split[5 + blk64_scale_idx + lvl1_idx] = PART_EVAL_ONLY_SPLIT;
 1838|  29.5k|          force_split[blk64_idx + 1] = PART_EVAL_ONLY_SPLIT;
 1839|  29.5k|          force_split[0] = PART_EVAL_ONLY_SPLIT;
 1840|   114k|        } else if (!is_key_frame && is_360p_or_smaller &&
  ------------------
  |  Branch (1840:20): [True: 90.4k, False: 24.4k]
  |  Branch (1840:37): [True: 90.4k, False: 18.4E]
  ------------------
 1841|  90.4k|                   ((max_min_var_16X16_diff > (thresholds[2] >> 1) &&
  ------------------
  |  Branch (1841:22): [True: 7.94k, False: 82.4k]
  ------------------
 1842|  7.94k|                     maxvar_16x16[blk64_idx][lvl1_idx] > thresholds[2]) ||
  ------------------
  |  Branch (1842:22): [True: 4.56k, False: 3.38k]
  ------------------
 1843|  85.8k|                    (cpi->sf.rt_sf.prefer_large_partition_blocks &&
  ------------------
  |  Branch (1843:22): [True: 85.8k, False: 18.4E]
  ------------------
 1844|  85.8k|                     x->content_state_sb.source_sad_nonrd > kLowSad &&
  ------------------
  |  Branch (1844:22): [True: 85.4k, False: 418]
  ------------------
 1845|  85.4k|                     cpi->rc.frame_source_sad < frame_sad_thresh &&
  ------------------
  |  Branch (1845:22): [True: 0, False: 85.4k]
  ------------------
 1846|      0|                     maxvar_16x16[blk64_idx][lvl1_idx] > (thresholds[2] >> 4) &&
  ------------------
  |  Branch (1846:22): [True: 0, False: 0]
  ------------------
 1847|      0|                     maxvar_16x16[blk64_idx][lvl1_idx] >
  ------------------
  |  Branch (1847:22): [True: 0, False: 0]
  ------------------
 1848|  4.56k|                         (minvar_16x16[blk64_idx][lvl1_idx] << 2)))) {
 1849|  4.56k|          force_split[5 + blk64_scale_idx + lvl1_idx] = PART_EVAL_ONLY_SPLIT;
 1850|  4.56k|          force_split[blk64_idx + 1] = PART_EVAL_ONLY_SPLIT;
 1851|  4.56k|          force_split[0] = PART_EVAL_ONLY_SPLIT;
 1852|  4.56k|        }
 1853|   144k|      }
 1854|   196k|    }
 1855|  49.1k|    if (force_split[1 + blk64_idx] == PART_EVAL_ALL) {
  ------------------
  |  Branch (1855:9): [True: 9.77k, False: 39.3k]
  ------------------
 1856|  9.77k|      fill_variance_tree(&vt->split[blk64_idx], BLOCK_64X64);
 1857|  9.77k|      get_variance(&vt->split[blk64_idx].part_variances.none);
 1858|  9.77k|      var_64x64 = vt->split[blk64_idx].part_variances.none.variance;
 1859|  9.77k|      max_var_64x64 = AOMMAX(var_64x64, max_var_64x64);
  ------------------
  |  |   35|  9.77k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 9.68k, False: 98]
  |  |  ------------------
  ------------------
 1860|  9.77k|      min_var_64x64 = AOMMIN(var_64x64, min_var_64x64);
  ------------------
  |  |   34|  9.77k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 9.77k, False: 1]
  |  |  ------------------
  ------------------
 1861|       |      // If the difference of the max-min variances of sub-blocks or max
 1862|       |      // variance of a sub-block is above some threshold of then force this
 1863|       |      // block to split. Only checking this for noise level >= medium, if
 1864|       |      // encoder is in SVC or if we already forced large blocks.
 1865|  9.77k|      const int max_min_var_32x32_diff =
 1866|  9.77k|          max_var_32x32[blk64_idx] - min_var_32x32[blk64_idx];
 1867|  9.77k|      const int check_max_var = max_var_32x32[blk64_idx] > thresholds[1] >> 1;
 1868|  9.77k|      const bool check_noise_lvl = noise_level >= kMedium ||
  ------------------
  |  Branch (1868:36): [True: 2, False: 9.77k]
  ------------------
 1869|  9.77k|                                   cpi->ppi->use_svc ||
  ------------------
  |  Branch (1869:36): [True: 18.4E, False: 9.77k]
  ------------------
 1870|  9.77k|                                   cpi->sf.rt_sf.prefer_large_partition_blocks;
  ------------------
  |  Branch (1870:36): [True: 9.77k, False: 0]
  ------------------
 1871|  9.77k|      const int64_t set_threshold = 3 * (thresholds[1] >> 3);
 1872|       |
 1873|  9.77k|      if (!is_key_frame && max_min_var_32x32_diff > set_threshold &&
  ------------------
  |  Branch (1873:11): [True: 6.82k, False: 2.95k]
  |  Branch (1873:28): [True: 6.51k, False: 316]
  ------------------
 1874|  6.51k|          check_max_var && check_noise_lvl) {
  ------------------
  |  Branch (1874:11): [True: 6.45k, False: 60]
  |  Branch (1874:28): [True: 6.45k, False: 0]
  ------------------
 1875|  6.45k|        force_split[1 + blk64_idx] = PART_EVAL_ONLY_SPLIT;
 1876|  6.45k|        force_split[0] = PART_EVAL_ONLY_SPLIT;
 1877|  6.45k|      }
 1878|  9.77k|      avg_64x64 += var_64x64;
 1879|  9.77k|    }
 1880|  49.1k|    if (is_small_sb) force_split[0] = PART_EVAL_ONLY_SPLIT;
  ------------------
  |  Branch (1880:9): [True: 49.0k, False: 18]
  ------------------
 1881|  49.1k|  }
 1882|       |
 1883|  48.9k|  if (force_split[0] == PART_EVAL_ALL) {
  ------------------
  |  Branch (1883:7): [True: 0, False: 48.9k]
  ------------------
 1884|      0|    fill_variance_tree(vt, BLOCK_128X128);
 1885|      0|    get_variance(&vt->part_variances.none);
 1886|      0|    const int set_avg_64x64 = (9 * avg_64x64) >> 5;
 1887|      0|    if (!is_key_frame && vt->part_variances.none.variance > set_avg_64x64)
  ------------------
  |  Branch (1887:9): [True: 0, False: 0]
  |  Branch (1887:26): [True: 0, False: 0]
  ------------------
 1888|      0|      force_split[0] = PART_EVAL_ONLY_SPLIT;
 1889|       |
 1890|      0|    if (!is_key_frame &&
  ------------------
  |  Branch (1890:9): [True: 0, False: 0]
  ------------------
 1891|      0|        (max_var_64x64 - min_var_64x64) > 3 * (thresholds[0] >> 3) &&
  ------------------
  |  Branch (1891:9): [True: 0, False: 0]
  ------------------
 1892|      0|        max_var_64x64 > thresholds[0] >> 1)
  ------------------
  |  Branch (1892:9): [True: 0, False: 0]
  ------------------
 1893|      0|      force_split[0] = PART_EVAL_ONLY_SPLIT;
 1894|      0|  }
 1895|       |
 1896|  48.9k|  if (mi_col + 32 > tile->mi_col_end || mi_row + 32 > tile->mi_row_end ||
  ------------------
  |  Branch (1896:7): [True: 46.5k, False: 2.47k]
  |  Branch (1896:41): [True: 2.12k, False: 350]
  ------------------
 1897|    350|      !set_vt_partitioning(cpi, xd, tile, vt, BLOCK_128X128, mi_row, mi_col,
  ------------------
  |  Branch (1897:7): [True: 350, False: 0]
  ------------------
 1898|  49.0k|                           thresholds[0], BLOCK_16X16, force_split[0])) {
 1899|  98.1k|    for (int blk64_idx = 0; blk64_idx < num_64x64_blocks; ++blk64_idx) {
  ------------------
  |  Branch (1899:29): [True: 49.0k, False: 49.0k]
  ------------------
 1900|  49.0k|      const int x64_idx = GET_BLK_IDX_X(blk64_idx, 4);
  ------------------
  |  |   24|  49.0k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1901|  49.0k|      const int y64_idx = GET_BLK_IDX_Y(blk64_idx, 4);
  ------------------
  |  |   25|  49.0k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1902|  49.0k|      const int blk64_scale_idx = blk64_idx << 2;
 1903|       |
 1904|       |      // Now go through the entire structure, splitting every block size until
 1905|       |      // we get to one that's got a variance lower than our threshold.
 1906|  49.0k|      if (set_vt_partitioning(cpi, xd, tile, &vt->split[blk64_idx], BLOCK_64X64,
  ------------------
  |  Branch (1906:11): [True: 5, False: 49.0k]
  ------------------
 1907|  49.0k|                              mi_row + y64_idx, mi_col + x64_idx, thresholds[1],
 1908|  49.0k|                              BLOCK_16X16, force_split[1 + blk64_idx]))
 1909|      5|        continue;
 1910|   245k|      for (int lvl1_idx = 0; lvl1_idx < 4; ++lvl1_idx) {
  ------------------
  |  Branch (1910:30): [True: 196k, False: 49.0k]
  ------------------
 1911|   196k|        const int x32_idx = GET_BLK_IDX_X(lvl1_idx, 3);
  ------------------
  |  |   24|   196k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1912|   196k|        const int y32_idx = GET_BLK_IDX_Y(lvl1_idx, 3);
  ------------------
  |  |   25|   196k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1913|   196k|        const int lvl1_scale_idx = (blk64_scale_idx + lvl1_idx) << 2;
 1914|   196k|        if (set_vt_partitioning(
  ------------------
  |  Branch (1914:13): [True: 16.6k, False: 179k]
  ------------------
 1915|   196k|                cpi, xd, tile, &vt->split[blk64_idx].split[lvl1_idx],
 1916|   196k|                BLOCK_32X32, (mi_row + y64_idx + y32_idx),
 1917|   196k|                (mi_col + x64_idx + x32_idx), thresholds[2], BLOCK_16X16,
 1918|   196k|                force_split[5 + blk64_scale_idx + lvl1_idx]))
 1919|  16.6k|          continue;
 1920|   894k|        for (int lvl2_idx = 0; lvl2_idx < 4; ++lvl2_idx) {
  ------------------
  |  Branch (1920:32): [True: 715k, False: 179k]
  ------------------
 1921|   715k|          const int x16_idx = GET_BLK_IDX_X(lvl2_idx, 2);
  ------------------
  |  |   24|   715k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1922|   715k|          const int y16_idx = GET_BLK_IDX_Y(lvl2_idx, 2);
  ------------------
  |  |   25|   715k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1923|   715k|          const int split_index = 21 + lvl1_scale_idx + lvl2_idx;
 1924|   715k|          VP16x16 *vtemp =
 1925|   715k|              &vt->split[blk64_idx].split[lvl1_idx].split[lvl2_idx];
 1926|   715k|          if (set_vt_partitioning(cpi, xd, tile, vtemp, BLOCK_16X16,
  ------------------
  |  Branch (1926:15): [True: 120k, False: 594k]
  ------------------
 1927|   715k|                                  mi_row + y64_idx + y32_idx + y16_idx,
 1928|   715k|                                  mi_col + x64_idx + x32_idx + x16_idx,
 1929|   715k|                                  thresholds[3], BLOCK_8X8,
 1930|   715k|                                  force_split[split_index]))
 1931|   120k|            continue;
 1932|  2.97M|          for (int lvl3_idx = 0; lvl3_idx < 4; ++lvl3_idx) {
  ------------------
  |  Branch (1932:34): [True: 2.37M, False: 594k]
  ------------------
 1933|  2.37M|            const int x8_idx = GET_BLK_IDX_X(lvl3_idx, 1);
  ------------------
  |  |   24|  2.37M|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1934|  2.37M|            const int y8_idx = GET_BLK_IDX_Y(lvl3_idx, 1);
  ------------------
  |  |   25|  2.37M|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1935|  2.37M|            set_block_size(cpi, (mi_row + y64_idx + y32_idx + y16_idx + y8_idx),
 1936|  2.37M|                           (mi_col + x64_idx + x32_idx + x16_idx + x8_idx),
 1937|  2.37M|                           BLOCK_8X8);
 1938|  2.37M|          }
 1939|   594k|        }
 1940|   179k|      }
 1941|  49.0k|    }
 1942|  49.0k|  }
 1943|       |
 1944|  48.9k|  if (cpi->sf.rt_sf.short_circuit_low_temp_var) {
  ------------------
  |  Branch (1944:7): [True: 32.4k, False: 16.5k]
  ------------------
 1945|  32.4k|    set_low_temp_var_flag(cpi, &x->part_search_info, xd, vt, thresholds,
 1946|  32.4k|                          ref_frame_partition, mi_col, mi_row, is_small_sb);
 1947|  32.4k|  }
 1948|       |
 1949|  48.9k|  aom_free(vt);
 1950|       |#if CONFIG_COLLECT_COMPONENT_TIMING
 1951|       |  end_timing(cpi, choose_var_based_partitioning_time);
 1952|       |#endif
 1953|  48.9k|  return 0;
 1954|  48.9k|}
var_based_part.c:set_vbp_thresholds:
  659|  73.3k|                                      int lighting_change) {
  660|  73.3k|  AV1_COMMON *const cm = &cpi->common;
  661|  73.3k|  const int is_key_frame = frame_is_intra_only(cm);
  662|  73.3k|  const int threshold_multiplier = is_key_frame ? 120 : 1;
  ------------------
  |  Branch (662:36): [True: 14.5k, False: 58.7k]
  ------------------
  663|  73.3k|  const int ac_q = av1_ac_quant_QTX(qindex, 0, cm->seq_params->bit_depth);
  664|  73.3k|  int64_t threshold_base = (int64_t)(threshold_multiplier * ac_q);
  665|  73.3k|  const int current_qindex = cm->quant_params.base_qindex;
  666|  73.3k|  const int threshold_left_shift = cpi->sf.rt_sf.var_part_split_threshold_shift;
  667|  73.3k|  const int num_pixels = cm->width * cm->height;
  668|       |
  669|  73.3k|  if (is_key_frame) {
  ------------------
  |  Branch (669:7): [True: 14.5k, False: 58.7k]
  ------------------
  670|  14.5k|    set_vbp_thresholds_key_frame(cpi, thresholds, threshold_base,
  671|  14.5k|                                 threshold_left_shift, num_pixels);
  672|  14.5k|    return;
  673|  14.5k|  }
  674|       |
  675|  58.7k|  threshold_base = tune_base_thresh_content(
  676|  58.7k|      cpi, threshold_base, content_lowsumdiff, source_sad_nonrd, num_pixels);
  677|  58.7k|  thresholds[0] = threshold_base >> 1;
  678|  58.7k|  thresholds[1] = threshold_base;
  679|  58.7k|  thresholds[3] = threshold_base << threshold_left_shift;
  680|       |
  681|  58.7k|  tune_thresh_based_on_resolution(cpi, thresholds, threshold_base,
  682|  58.7k|                                  current_qindex, source_sad_rd, num_pixels);
  683|       |
  684|  58.7k|  tune_thresh_based_on_qindex(cpi, thresholds, blk_sad, current_qindex,
  685|  58.7k|                              num_pixels, is_segment_id_boosted,
  686|  58.7k|                              source_sad_nonrd, lighting_change);
  687|  58.7k|}
var_based_part.c:set_vbp_thresholds_key_frame:
  538|  14.5k|                                         int num_pixels) {
  539|  14.5k|  if (cpi->sf.rt_sf.force_large_partition_blocks_intra) {
  ------------------
  |  Branch (539:7): [True: 5.39k, False: 9.17k]
  ------------------
  540|  5.39k|    const int shift_steps =
  541|  5.39k|        threshold_left_shift - (cpi->oxcf.mode == ALLINTRA ? 7 : 8);
  ------------------
  |  Branch (541:33): [True: 0, False: 5.39k]
  ------------------
  542|  5.39k|    assert(shift_steps >= 0);
  543|  5.39k|    threshold_base <<= shift_steps;
  544|  5.39k|  }
  545|  14.5k|  thresholds[0] = threshold_base;
  546|  14.5k|  thresholds[1] = threshold_base;
  547|  14.5k|  if (num_pixels < RESOLUTION_720P) {
  ------------------
  |  |   65|  14.5k|#define RESOLUTION_720P 1280 * 720
  ------------------
  |  Branch (547:7): [True: 14.5k, False: 0]
  ------------------
  548|  14.5k|    thresholds[2] = threshold_base / 3;
  549|  14.5k|    thresholds[3] = threshold_base >> 1;
  550|  14.5k|  } else {
  551|      0|    int shift_val = 2;
  552|      0|    if (cpi->sf.rt_sf.force_large_partition_blocks_intra) {
  ------------------
  |  Branch (552:9): [True: 0, False: 0]
  ------------------
  553|      0|      shift_val = (cpi->oxcf.mode == ALLINTRA ? 1 : 0);
  ------------------
  |  Branch (553:20): [True: 0, False: 0]
  ------------------
  554|      0|    }
  555|       |
  556|      0|    thresholds[2] = threshold_base >> shift_val;
  557|      0|    thresholds[3] = threshold_base >> shift_val;
  558|      0|  }
  559|  14.5k|  thresholds[4] = threshold_base << 2;
  560|  14.5k|}
var_based_part.c:tune_base_thresh_content:
  632|  58.8k|                                               int num_pixels) {
  633|  58.8k|  AV1_COMMON *const cm = &cpi->common;
  634|  58.8k|  int64_t updated_thresh_base = threshold_base;
  635|  58.8k|  if (cpi->noise_estimate.enabled && content_lowsumdiff &&
  ------------------
  |  Branch (635:7): [True: 0, False: 58.8k]
  |  Branch (635:38): [True: 0, False: 0]
  ------------------
  636|      0|      num_pixels > RESOLUTION_480P && cm->current_frame.frame_number > 60) {
  ------------------
  |  |   64|  58.8k|#define RESOLUTION_480P 640 * 480
  ------------------
  |  Branch (636:7): [True: 0, False: 0]
  |  Branch (636:39): [True: 0, False: 0]
  ------------------
  637|      0|    NOISE_LEVEL noise_level =
  638|      0|        av1_noise_estimate_extract_level(&cpi->noise_estimate);
  639|      0|    if (noise_level == kHigh)
  ------------------
  |  Branch (639:9): [True: 0, False: 0]
  ------------------
  640|      0|      updated_thresh_base = (5 * updated_thresh_base) >> 1;
  641|      0|    else if (noise_level == kMedium &&
  ------------------
  |  Branch (641:14): [True: 0, False: 0]
  ------------------
  642|      0|             !cpi->sf.rt_sf.prefer_large_partition_blocks)
  ------------------
  |  Branch (642:14): [True: 0, False: 0]
  ------------------
  643|      0|      updated_thresh_base = (5 * updated_thresh_base) >> 2;
  644|      0|  }
  645|  58.8k|  updated_thresh_base = scale_part_thresh_content(
  646|  58.8k|      updated_thresh_base, cpi->oxcf.speed,
  647|  58.8k|      cpi->ppi->rtc_ref.non_reference_frame, cpi->rc.frame_source_sad == 0);
  648|  58.8k|  if (cpi->oxcf.speed >= 11 && source_sad_nonrd > kLowSad &&
  ------------------
  |  Branch (648:7): [True: 0, False: 58.8k]
  |  Branch (648:32): [True: 0, False: 0]
  ------------------
  649|      0|      cpi->rc.high_motion_content_screen_rtc)
  ------------------
  |  Branch (649:7): [True: 0, False: 0]
  ------------------
  650|      0|    updated_thresh_base = updated_thresh_base << 4;
  651|  58.8k|  return updated_thresh_base;
  652|  58.8k|}
var_based_part.c:scale_part_thresh_content:
  427|  58.8k|                                         int is_static) {
  428|  58.8k|  int64_t threshold = threshold_base;
  429|  58.8k|  if (non_reference_frame && !is_static) threshold = (3 * threshold) >> 1;
  ------------------
  |  Branch (429:7): [True: 0, False: 58.8k]
  |  Branch (429:30): [True: 0, False: 0]
  ------------------
  430|  58.8k|  if (speed >= 8) {
  ------------------
  |  Branch (430:7): [True: 38.7k, False: 20.0k]
  ------------------
  431|  38.7k|    return (5 * threshold) >> 2;
  432|  38.7k|  }
  433|  20.0k|  return threshold;
  434|  58.8k|}
var_based_part.c:tune_thresh_based_on_resolution:
  564|  58.8k|    int current_qindex, int source_sad_rd, int num_pixels) {
  565|  58.8k|  if (num_pixels >= RESOLUTION_720P) thresholds[3] = thresholds[3] << 1;
  ------------------
  |  |   65|  58.8k|#define RESOLUTION_720P 1280 * 720
  ------------------
  |  Branch (565:7): [True: 0, False: 58.8k]
  ------------------
  566|  58.8k|  if (num_pixels <= RESOLUTION_288P) {
  ------------------
  |  |   62|  58.8k|#define RESOLUTION_288P 352 * 288
  ------------------
  |  Branch (566:7): [True: 58.8k, False: 0]
  ------------------
  567|  58.8k|    const int qindex_thr[5][2] = {
  568|  58.8k|      { 200, 220 }, { 140, 170 }, { 120, 150 }, { 200, 210 }, { 170, 220 },
  569|  58.8k|    };
  570|  58.8k|    int th_idx = 0;
  571|  58.8k|    if (cpi->sf.rt_sf.var_part_based_on_qidx >= 1)
  ------------------
  |  Branch (571:9): [True: 37.1k, False: 21.6k]
  ------------------
  572|  37.1k|      th_idx =
  573|  37.1k|          (source_sad_rd <= kLowSad) ? cpi->sf.rt_sf.var_part_based_on_qidx : 0;
  ------------------
  |  Branch (573:11): [True: 11.5k, False: 25.6k]
  ------------------
  574|  58.8k|    if (cpi->sf.rt_sf.var_part_based_on_qidx >= 3)
  ------------------
  |  Branch (574:9): [True: 37.1k, False: 21.6k]
  ------------------
  575|  37.1k|      th_idx = cpi->sf.rt_sf.var_part_based_on_qidx;
  576|  58.8k|    const int qindex_low_thr = qindex_thr[th_idx][0];
  577|  58.8k|    const int qindex_high_thr = qindex_thr[th_idx][1];
  578|  58.8k|    if (current_qindex >= qindex_high_thr) {
  ------------------
  |  Branch (578:9): [True: 18.6k, False: 40.1k]
  ------------------
  579|  18.6k|      threshold_base = (5 * threshold_base) >> 1;
  580|  18.6k|      thresholds[1] = threshold_base >> 3;
  581|  18.6k|      thresholds[2] = threshold_base << 2;
  582|  18.6k|      thresholds[3] = threshold_base << 5;
  583|  40.1k|    } else if (current_qindex < qindex_low_thr) {
  ------------------
  |  Branch (583:16): [True: 34.0k, False: 6.08k]
  ------------------
  584|  34.0k|      thresholds[1] = threshold_base >> 3;
  585|  34.0k|      thresholds[2] = threshold_base >> 1;
  586|  34.0k|      thresholds[3] = threshold_base << 3;
  587|  34.0k|    } else {
  588|  6.08k|      int64_t qi_diff_low = current_qindex - qindex_low_thr;
  589|  6.08k|      int64_t qi_diff_high = qindex_high_thr - current_qindex;
  590|  6.08k|      int64_t threshold_diff = qindex_high_thr - qindex_low_thr;
  591|  6.08k|      int64_t threshold_base_high = (5 * threshold_base) >> 1;
  592|       |
  593|  18.4E|      threshold_diff = threshold_diff > 0 ? threshold_diff : 1;
  ------------------
  |  Branch (593:24): [True: 6.08k, False: 18.4E]
  ------------------
  594|  6.08k|      threshold_base =
  595|  6.08k|          (qi_diff_low * threshold_base_high + qi_diff_high * threshold_base) /
  596|  6.08k|          threshold_diff;
  597|  6.08k|      thresholds[1] = threshold_base >> 3;
  598|  6.08k|      thresholds[2] = ((qi_diff_low * threshold_base) +
  599|  6.08k|                       qi_diff_high * (threshold_base >> 1)) /
  600|  6.08k|                      threshold_diff;
  601|  6.08k|      thresholds[3] = ((qi_diff_low * (threshold_base << 5)) +
  602|  6.08k|                       qi_diff_high * (threshold_base << 3)) /
  603|  6.08k|                      threshold_diff;
  604|  6.08k|    }
  605|  58.8k|  } else if (num_pixels < RESOLUTION_720P) {
  ------------------
  |  |   65|      0|#define RESOLUTION_720P 1280 * 720
  ------------------
  |  Branch (605:14): [True: 0, False: 0]
  ------------------
  606|      0|    thresholds[2] = (5 * threshold_base) >> 2;
  607|      0|  } else if (num_pixels < RESOLUTION_1080P) {
  ------------------
  |  |   66|      0|#define RESOLUTION_1080P 1920 * 1080
  ------------------
  |  Branch (607:14): [True: 0, False: 0]
  ------------------
  608|      0|    thresholds[2] = threshold_base << 1;
  609|      0|  } else {
  610|       |    // num_pixels >= RESOLUTION_1080P
  611|      0|    if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (611:9): [True: 0, False: 0]
  ------------------
  612|      0|      if (num_pixels < RESOLUTION_1440P) {
  ------------------
  |  |   67|      0|#define RESOLUTION_1440P 2560 * 1440
  ------------------
  |  Branch (612:11): [True: 0, False: 0]
  ------------------
  613|      0|        thresholds[2] = (5 * threshold_base) >> 1;
  614|      0|      } else {
  615|      0|        thresholds[2] = (7 * threshold_base) >> 1;
  616|      0|      }
  617|      0|    } else {
  618|      0|      if (cpi->oxcf.speed > 7) {
  ------------------
  |  Branch (618:11): [True: 0, False: 0]
  ------------------
  619|      0|        thresholds[2] = 6 * threshold_base;
  620|      0|      } else {
  621|      0|        thresholds[2] = 3 * threshold_base;
  622|      0|      }
  623|      0|    }
  624|      0|  }
  625|  58.8k|}
var_based_part.c:tune_thresh_based_on_qindex:
  440|  58.8k|    int lighting_change) {
  441|  58.8k|  double weight;
  442|  58.8k|  if (cpi->sf.rt_sf.prefer_large_partition_blocks >= 3) {
  ------------------
  |  Branch (442:7): [True: 21.6k, False: 37.2k]
  ------------------
  443|  21.6k|    const int win = 20;
  444|  21.6k|    if (current_qindex < QINDEX_LARGE_BLOCK_THR - win)
  ------------------
  |  |   32|  21.6k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (444:9): [True: 4.74k, False: 16.8k]
  ------------------
  445|  4.74k|      weight = 1.0;
  446|  16.8k|    else if (current_qindex > QINDEX_LARGE_BLOCK_THR + win)
  ------------------
  |  |   32|  16.8k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (446:14): [True: 15.0k, False: 1.83k]
  ------------------
  447|  15.0k|      weight = 0.0;
  448|  1.83k|    else
  449|  1.83k|      weight =
  450|  1.83k|          1.0 - (current_qindex - QINDEX_LARGE_BLOCK_THR + win) / (2 * win);
  ------------------
  |  |   32|  1.83k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  451|  21.6k|    if (num_pixels > RESOLUTION_480P) {
  ------------------
  |  |   64|  21.6k|#define RESOLUTION_480P 640 * 480
  ------------------
  |  Branch (451:9): [True: 0, False: 21.6k]
  ------------------
  452|      0|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (452:23): [True: 0, False: 0]
  ------------------
  453|      0|        thresholds[i] <<= 1;
  454|      0|      }
  455|      0|    }
  456|  21.6k|    if (num_pixels <= RESOLUTION_288P) {
  ------------------
  |  |   62|  21.6k|#define RESOLUTION_288P 352 * 288
  ------------------
  |  Branch (456:9): [True: 21.6k, False: 4]
  ------------------
  457|  21.6k|      thresholds[3] = INT64_MAX;
  458|  21.6k|      if (is_segment_id_boosted == false) {
  ------------------
  |  Branch (458:11): [True: 21.6k, False: 1]
  ------------------
  459|  21.6k|        thresholds[1] <<= 2;
  460|  21.6k|        thresholds[2] <<= (source_sad_nonrd <= kLowSad) ? 5 : 4;
  ------------------
  |  Branch (460:27): [True: 6.80k, False: 14.8k]
  ------------------
  461|  21.6k|      } else {
  462|      1|        thresholds[1] <<= 1;
  463|      1|        thresholds[2] <<= 3;
  464|      1|      }
  465|       |      // Allow for split to 8x8 for superblocks where part of it has
  466|       |      // moving boundary. So allow for sb with source_sad above threshold,
  467|       |      // and avoid very large source_sad or high source content, to avoid
  468|       |      // too many 8x8 within superblock.
  469|  21.6k|      uint64_t avg_source_sad_thresh = 25000;
  470|  21.6k|      uint64_t block_sad_low = 25000;
  471|  21.6k|      uint64_t block_sad_high = 50000;
  472|  21.6k|      if (cpi->svc.temporal_layer_id == 0 &&
  ------------------
  |  Branch (472:11): [True: 21.6k, False: 18.4E]
  ------------------
  473|  21.6k|          cpi->svc.number_temporal_layers > 1) {
  ------------------
  |  Branch (473:11): [True: 0, False: 21.6k]
  ------------------
  474|       |        // Increase the sad thresholds for base TL0, as reference/LAST is
  475|       |        // 2/4 frames behind (for 2/3 #TL).
  476|      0|        avg_source_sad_thresh = 40000;
  477|      0|        block_sad_high = 70000;
  478|      0|      }
  479|  21.6k|      if (is_segment_id_boosted == false &&
  ------------------
  |  Branch (479:11): [True: 21.6k, False: 18.4E]
  ------------------
  480|  21.6k|          cpi->rc.avg_source_sad < avg_source_sad_thresh &&
  ------------------
  |  Branch (480:11): [True: 116, False: 21.5k]
  ------------------
  481|    116|          block_sad > block_sad_low && block_sad < block_sad_high &&
  ------------------
  |  Branch (481:11): [True: 0, False: 116]
  |  Branch (481:40): [True: 0, False: 0]
  ------------------
  482|      0|          !lighting_change) {
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|        thresholds[2] = (3 * thresholds[2]) >> 2;
  484|      0|        thresholds[3] = thresholds[2] << 3;
  485|      0|      }
  486|       |      // Condition the increase of partition thresholds on the segment
  487|       |      // and the content. Avoid the increase for superblocks which have
  488|       |      // high source sad, unless the whole frame has very high motion
  489|       |      // (i.e, cpi->rc.avg_source_sad is very large, in which case all blocks
  490|       |      // have high source sad).
  491|  21.6k|    } else if (num_pixels > RESOLUTION_480P && is_segment_id_boosted == false &&
  ------------------
  |  |   64|      8|#define RESOLUTION_480P 640 * 480
  ------------------
  |  Branch (491:16): [True: 0, False: 4]
  |  Branch (491:48): [True: 0, False: 0]
  ------------------
  492|      0|               (source_sad_nonrd != kHighSad ||
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                cpi->rc.avg_source_sad > 50000)) {
  ------------------
  |  Branch (493:17): [True: 0, False: 0]
  ------------------
  494|      0|      thresholds[0] = (3 * thresholds[0]) >> 1;
  495|      0|      thresholds[3] = INT64_MAX;
  496|      0|      if (current_qindex > QINDEX_LARGE_BLOCK_THR) {
  ------------------
  |  |   32|      0|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (496:11): [True: 0, False: 0]
  ------------------
  497|      0|        thresholds[1] =
  498|      0|            (int)((1 - weight) * (thresholds[1] << 1) + weight * thresholds[1]);
  499|      0|        thresholds[2] =
  500|      0|            (int)((1 - weight) * (thresholds[2] << 1) + weight * thresholds[2]);
  501|      0|      }
  502|      4|    } else if (current_qindex > QINDEX_LARGE_BLOCK_THR &&
  ------------------
  |  |   32|      8|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (502:16): [True: 0, False: 4]
  ------------------
  503|      0|               is_segment_id_boosted == false &&
  ------------------
  |  Branch (503:16): [True: 0, False: 0]
  ------------------
  504|      0|               (source_sad_nonrd != kHighSad ||
  ------------------
  |  Branch (504:17): [True: 0, False: 0]
  ------------------
  505|      0|                cpi->rc.avg_source_sad > 50000)) {
  ------------------
  |  Branch (505:17): [True: 0, False: 0]
  ------------------
  506|      0|      thresholds[1] =
  507|      0|          (int)((1 - weight) * (thresholds[1] << 2) + weight * thresholds[1]);
  508|      0|      thresholds[2] =
  509|      0|          (int)((1 - weight) * (thresholds[2] << 4) + weight * thresholds[2]);
  510|      0|      thresholds[3] = INT64_MAX;
  511|      0|    }
  512|  37.2k|  } else if (cpi->sf.rt_sf.prefer_large_partition_blocks >= 2) {
  ------------------
  |  Branch (512:14): [True: 20.0k, False: 17.1k]
  ------------------
  513|  20.0k|    thresholds[1] <<= (source_sad_nonrd <= kLowSad) ? 2 : 0;
  ------------------
  |  Branch (513:23): [True: 6.42k, False: 13.6k]
  ------------------
  514|  20.0k|    thresholds[2] =
  515|  20.0k|        (source_sad_nonrd <= kLowSad) ? (3 * thresholds[2]) : thresholds[2];
  ------------------
  |  Branch (515:9): [True: 6.42k, False: 13.6k]
  ------------------
  516|  20.0k|  } else if (cpi->sf.rt_sf.prefer_large_partition_blocks >= 1) {
  ------------------
  |  Branch (516:14): [True: 17.1k, False: 18.4E]
  ------------------
  517|  17.1k|    const int fac = (source_sad_nonrd <= kLowSad) ? 2 : 1;
  ------------------
  |  Branch (517:21): [True: 5.19k, False: 11.9k]
  ------------------
  518|  17.1k|    if (current_qindex < QINDEX_LARGE_BLOCK_THR - 45)
  ------------------
  |  |   32|  17.1k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (518:9): [True: 3.50k, False: 13.6k]
  ------------------
  519|  3.50k|      weight = 1.0;
  520|  13.6k|    else if (current_qindex > QINDEX_LARGE_BLOCK_THR + 45)
  ------------------
  |  |   32|  13.6k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  |  Branch (520:14): [True: 8.53k, False: 5.08k]
  ------------------
  521|  8.53k|      weight = 0.0;
  522|  5.08k|    else
  523|  5.08k|      weight = 1.0 - (current_qindex - QINDEX_LARGE_BLOCK_THR + 45) / (2 * 45);
  ------------------
  |  |   32|  5.08k|  100  // Use increased thresholds for midres for speed 9 when qindex is above
  ------------------
  524|  17.1k|    thresholds[1] =
  525|  17.1k|        (int)((1 - weight) * (thresholds[1] << 1) + weight * thresholds[1]);
  526|  17.1k|    thresholds[2] =
  527|  17.1k|        (int)((1 - weight) * (thresholds[2] << 1) + weight * thresholds[2]);
  528|  17.1k|    thresholds[3] =
  529|  17.1k|        (int)((1 - weight) * (thresholds[3] << fac) + weight * thresholds[3]);
  530|  17.1k|  }
  531|  58.8k|  if (cpi->sf.part_sf.disable_8x8_part_based_on_qidx && (current_qindex < 128))
  ------------------
  |  Branch (531:7): [True: 0, False: 58.8k]
  |  Branch (531:57): [True: 0, False: 0]
  ------------------
  532|      0|    thresholds[3] = INT64_MAX;
  533|  58.8k|}
var_based_part.c:setup_planes:
 1394|  40.5k|                         int mi_col, bool is_small_sb, bool scaled_ref_last) {
 1395|  40.5k|  AV1_COMMON *const cm = &cpi->common;
 1396|  40.5k|  MACROBLOCKD *xd = &x->e_mbd;
 1397|  40.5k|  const int num_planes = av1_num_planes(cm);
 1398|  40.5k|  bool scaled_ref_golden = false;
 1399|  40.5k|  bool scaled_ref_alt = false;
 1400|  18.4E|  BLOCK_SIZE bsize = is_small_sb ? BLOCK_64X64 : BLOCK_128X128;
  ------------------
  |  Branch (1400:22): [True: 40.5k, False: 18.4E]
  ------------------
 1401|  40.5k|  MB_MODE_INFO *mi = xd->mi[0];
 1402|  40.5k|  const YV12_BUFFER_CONFIG *yv12 =
 1403|  40.5k|      scaled_ref_last ? av1_get_scaled_ref_frame(cpi, LAST_FRAME)
  ------------------
  |  Branch (1403:7): [True: 35.1k, False: 5.41k]
  ------------------
 1404|  40.5k|                      : get_ref_frame_yv12_buf(cm, LAST_FRAME);
 1405|  40.5k|  assert(yv12 != NULL);
 1406|  40.5k|  const YV12_BUFFER_CONFIG *yv12_g = NULL;
 1407|  40.5k|  const YV12_BUFFER_CONFIG *yv12_alt = NULL;
 1408|       |  // Check if LAST is a reference. For spatial layers always use it as
 1409|       |  // reference scaling.
 1410|  40.5k|  int use_last_ref = (cpi->ref_frame_flags & AOM_LAST_FLAG) ||
  ------------------
  |  Branch (1410:22): [True: 40.5k, False: 0]
  ------------------
 1411|      0|                     cpi->svc.number_spatial_layers > 1;
  ------------------
  |  Branch (1411:22): [True: 0, False: 0]
  ------------------
 1412|  40.5k|  int use_golden_ref = cpi->ref_frame_flags & AOM_GOLD_FLAG;
 1413|  40.5k|  int use_alt_ref = cpi->ppi->rtc_ref.set_ref_frame_config ||
  ------------------
  |  Branch (1413:21): [True: 18.4E, False: 40.5k]
  ------------------
 1414|  40.5k|                    cpi->sf.rt_sf.use_nonrd_altref_frame ||
  ------------------
  |  Branch (1414:21): [True: 13.6k, False: 26.8k]
  ------------------
 1415|  26.8k|                    (cpi->sf.rt_sf.use_comp_ref_nonrd &&
  ------------------
  |  Branch (1415:22): [True: 11.9k, False: 14.8k]
  ------------------
 1416|  11.9k|                     cpi->sf.rt_sf.ref_frame_comp_nonrd[2] == 1);
  ------------------
  |  Branch (1416:22): [True: 11.9k, False: 0]
  ------------------
 1417|       |
 1418|       |  // Check if GOLDEN should be used as reference for partitioning.
 1419|       |  // Allow for spatial layers if lower layer has same resolution.
 1420|  40.5k|  if ((cpi->svc.number_spatial_layers == 1 ||
  ------------------
  |  Branch (1420:8): [True: 40.5k, False: 0]
  ------------------
 1421|      0|       cpi->svc.has_lower_quality_layer) &&
  ------------------
  |  Branch (1421:8): [True: 0, False: 0]
  ------------------
 1422|  40.5k|      use_golden_ref &&
  ------------------
  |  Branch (1422:7): [True: 0, False: 40.5k]
  ------------------
 1423|      0|      (x->content_state_sb.source_sad_nonrd != kZeroSad || !use_last_ref)) {
  ------------------
  |  Branch (1423:8): [True: 0, False: 0]
  |  Branch (1423:60): [True: 0, False: 0]
  ------------------
 1424|      0|    yv12_g = get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
 1425|      0|    if (yv12_g && (yv12_g->y_crop_height != cm->height ||
  ------------------
  |  Branch (1425:9): [True: 0, False: 0]
  |  Branch (1425:20): [True: 0, False: 0]
  ------------------
 1426|      0|                   yv12_g->y_crop_width != cm->width)) {
  ------------------
  |  Branch (1426:20): [True: 0, False: 0]
  ------------------
 1427|      0|      yv12_g = av1_get_scaled_ref_frame(cpi, GOLDEN_FRAME);
 1428|      0|      scaled_ref_golden = true;
 1429|      0|    }
 1430|      0|    if (yv12_g && (yv12_g != yv12 || !use_last_ref)) {
  ------------------
  |  Branch (1430:9): [True: 0, False: 0]
  |  Branch (1430:20): [True: 0, False: 0]
  |  Branch (1430:38): [True: 0, False: 0]
  ------------------
 1431|      0|      av1_setup_pre_planes(
 1432|      0|          xd, 0, yv12_g, mi_row, mi_col,
 1433|      0|          scaled_ref_golden ? NULL : get_ref_scale_factors(cm, GOLDEN_FRAME),
  ------------------
  |  Branch (1433:11): [True: 0, False: 0]
  ------------------
 1434|      0|          num_planes);
 1435|      0|      *y_sad_g = cpi->ppi->fn_ptr[bsize].sdf(
 1436|      0|          x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                        x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1437|      0|          xd->plane[AOM_PLANE_Y].pre[0].buf,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1438|      0|          xd->plane[AOM_PLANE_Y].pre[0].stride);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1439|      0|    }
 1440|      0|  }
 1441|       |
 1442|       |  // Check if ALTREF should be used as reference for partitioning.
 1443|       |  // Allow for spatial layers if lower layer has same resolution.
 1444|  40.5k|  if ((cpi->svc.number_spatial_layers == 1 ||
  ------------------
  |  Branch (1444:8): [True: 40.5k, False: 0]
  ------------------
 1445|      0|       cpi->svc.has_lower_quality_layer) &&
  ------------------
  |  Branch (1445:8): [True: 0, False: 0]
  ------------------
 1446|  40.5k|      use_alt_ref && (cpi->ref_frame_flags & AOM_ALT_FLAG) &&
  ------------------
  |  Branch (1446:7): [True: 25.6k, False: 14.8k]
  |  Branch (1446:22): [True: 0, False: 25.6k]
  ------------------
 1447|      0|      (x->content_state_sb.source_sad_nonrd != kZeroSad || !use_last_ref)) {
  ------------------
  |  Branch (1447:8): [True: 0, False: 0]
  |  Branch (1447:60): [True: 0, False: 0]
  ------------------
 1448|      0|    yv12_alt = get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
 1449|      0|    if (yv12_alt && (yv12_alt->y_crop_height != cm->height ||
  ------------------
  |  Branch (1449:9): [True: 0, False: 0]
  |  Branch (1449:22): [True: 0, False: 0]
  ------------------
 1450|      0|                     yv12_alt->y_crop_width != cm->width)) {
  ------------------
  |  Branch (1450:22): [True: 0, False: 0]
  ------------------
 1451|      0|      yv12_alt = av1_get_scaled_ref_frame(cpi, ALTREF_FRAME);
 1452|      0|      scaled_ref_alt = true;
 1453|      0|    }
 1454|      0|    if (yv12_alt && (yv12_alt != yv12 || !use_last_ref)) {
  ------------------
  |  Branch (1454:9): [True: 0, False: 0]
  |  Branch (1454:22): [True: 0, False: 0]
  |  Branch (1454:42): [True: 0, False: 0]
  ------------------
 1455|      0|      av1_setup_pre_planes(
 1456|      0|          xd, 0, yv12_alt, mi_row, mi_col,
 1457|      0|          scaled_ref_alt ? NULL : get_ref_scale_factors(cm, ALTREF_FRAME),
  ------------------
  |  Branch (1457:11): [True: 0, False: 0]
  ------------------
 1458|      0|          num_planes);
 1459|      0|      *y_sad_alt = cpi->ppi->fn_ptr[bsize].sdf(
 1460|      0|          x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                        x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1461|      0|          xd->plane[AOM_PLANE_Y].pre[0].buf,
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1462|      0|          xd->plane[AOM_PLANE_Y].pre[0].stride);
  ------------------
  |  |  281|      0|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1463|      0|    }
 1464|      0|  }
 1465|       |
 1466|  40.5k|  if (use_last_ref) {
  ------------------
  |  Branch (1466:7): [True: 40.5k, False: 18]
  ------------------
 1467|  40.5k|    const int source_sad_nonrd = x->content_state_sb.source_sad_nonrd;
 1468|  40.5k|    av1_setup_pre_planes(
 1469|  40.5k|        xd, 0, yv12, mi_row, mi_col,
 1470|  40.5k|        scaled_ref_last ? NULL : get_ref_scale_factors(cm, LAST_FRAME),
  ------------------
  |  Branch (1470:9): [True: 35.1k, False: 5.40k]
  ------------------
 1471|  40.5k|        num_planes);
 1472|  40.5k|    mi->ref_frame[0] = LAST_FRAME;
 1473|  40.5k|    mi->ref_frame[1] = NONE_FRAME;
 1474|  40.5k|    mi->bsize = cm->seq_params->sb_size;
 1475|  40.5k|    mi->mv[0].as_int = 0;
 1476|  40.5k|    mi->interp_filters = av1_broadcast_interp_filter(BILINEAR);
 1477|       |
 1478|  40.5k|    int est_motion = cpi->sf.rt_sf.estimate_motion_for_var_based_partition;
 1479|       |    // TODO(b/290596301): Look into adjusting this condition.
 1480|       |    // There is regression on color content when
 1481|       |    // estimate_motion_for_var_based_partition = 3 and high motion,
 1482|       |    // so for now force it to 2 based on superblock sad.
 1483|  40.5k|    if (est_motion > 2 && source_sad_nonrd > kMedSad) est_motion = 2;
  ------------------
  |  Branch (1483:9): [True: 12.3k, False: 28.1k]
  |  Branch (1483:27): [True: 7.17k, False: 5.15k]
  ------------------
 1484|       |
 1485|  40.5k|    if ((est_motion == 1 || est_motion == 2) && xd->mb_to_right_edge >= 0 &&
  ------------------
  |  Branch (1485:10): [True: 18.4E, False: 40.5k]
  |  Branch (1485:29): [True: 29.7k, False: 10.7k]
  |  Branch (1485:49): [True: 12.5k, False: 17.2k]
  ------------------
 1486|  12.5k|        xd->mb_to_bottom_edge >= 0 && x->source_variance > 100 &&
  ------------------
  |  Branch (1486:9): [True: 7.27k, False: 5.24k]
  |  Branch (1486:39): [True: 7.27k, False: 0]
  ------------------
 1487|  7.27k|        source_sad_nonrd > kLowSad) {
  ------------------
  |  Branch (1487:9): [True: 7.27k, False: 0]
  ------------------
 1488|  7.27k|      do_int_pro_motion_estimation(cpi, x, y_sad, mi_row, mi_col,
 1489|  7.27k|                                   source_sad_nonrd);
 1490|  7.27k|    }
 1491|       |
 1492|  40.5k|    if (*y_sad == UINT_MAX) {
  ------------------
  |  Branch (1492:9): [True: 33.2k, False: 7.22k]
  ------------------
 1493|  33.2k|      *y_sad = cpi->ppi->fn_ptr[bsize].sdf(
 1494|  33.2k|          x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|  33.2k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
                        x->plane[AOM_PLANE_Y].src.buf, x->plane[AOM_PLANE_Y].src.stride,
  ------------------
  |  |  281|  33.2k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1495|  33.2k|          xd->plane[AOM_PLANE_Y].pre[0].buf,
  ------------------
  |  |  281|  33.2k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1496|  33.2k|          xd->plane[AOM_PLANE_Y].pre[0].stride);
  ------------------
  |  |  281|  33.2k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1497|  33.2k|    }
 1498|       |
 1499|       |    // Evaluate if neighbours' MVs give better predictions. Zero MV is tested
 1500|       |    // already, so only non-zero MVs are tested here. Here the neighbour blocks
 1501|       |    // are the first block above or left to this superblock.
 1502|  40.5k|    if (est_motion >= 2 && (xd->up_available || xd->left_available))
  ------------------
  |  Branch (1502:9): [True: 34.9k, False: 5.51k]
  |  Branch (1502:29): [True: 3.90k, False: 31.0k]
  |  Branch (1502:49): [True: 2.80k, False: 28.2k]
  ------------------
 1503|  6.70k|      evaluate_neighbour_mvs(cpi, x, y_sad, is_small_sb, est_motion);
 1504|       |
 1505|  40.5k|    *y_sad_last = *y_sad;
 1506|  40.5k|  }
 1507|       |
 1508|       |  // Pick the ref frame for partitioning, use golden or altref frame only if
 1509|       |  // its lower sad, bias to LAST with factor 0.9.
 1510|  40.5k|  set_ref_frame_for_partition(cpi, x, xd, ref_frame_partition, mi, y_sad,
 1511|  40.5k|                              y_sad_g, y_sad_alt, yv12_g, yv12_alt, mi_row,
 1512|  40.5k|                              mi_col, num_planes);
 1513|       |
 1514|       |  // Only calculate the predictor for non-zero MV.
 1515|  40.5k|  if (mi->mv[0].as_int != 0) {
  ------------------
  |  Branch (1515:7): [True: 7.90k, False: 32.6k]
  ------------------
 1516|  7.90k|    if (!scaled_ref_last) {
  ------------------
  |  Branch (1516:9): [True: 766, False: 7.14k]
  ------------------
 1517|    766|      set_ref_ptrs(cm, xd, mi->ref_frame[0], mi->ref_frame[1]);
 1518|  7.14k|    } else {
 1519|  7.14k|      xd->block_ref_scale_factors[0] = sf_no_scale;
 1520|  7.14k|      xd->block_ref_scale_factors[1] = sf_no_scale;
 1521|  7.14k|    }
 1522|  7.90k|    av1_enc_build_inter_predictor(cm, xd, mi_row, mi_col, NULL,
 1523|  7.90k|                                  cm->seq_params->sb_size, AOM_PLANE_Y,
  ------------------
  |  |  281|  7.90k|#define AOM_PLANE_Y 0      /**< Y (Luminance) plane */
  ------------------
 1524|  7.90k|                                  num_planes - 1);
 1525|  7.90k|  }
 1526|  40.5k|}
var_based_part.c:do_int_pro_motion_estimation:
 1338|  7.27k|                                         int mi_col, int source_sad_nonrd) {
 1339|  7.27k|  AV1_COMMON *const cm = &cpi->common;
 1340|  7.27k|  MACROBLOCKD *xd = &x->e_mbd;
 1341|  7.27k|  MB_MODE_INFO *mi = xd->mi[0];
 1342|  7.27k|  const int large_search =
 1343|  7.27k|      cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN ||
  ------------------
  |  Branch (1343:7): [True: 9, False: 7.26k]
  ------------------
 1344|  7.26k|      (source_sad_nonrd > kMedSad && cm->width * cm->height > 1280 * 720 &&
  ------------------
  |  Branch (1344:8): [True: 3.77k, False: 3.49k]
  |  Branch (1344:38): [True: 0, False: 3.77k]
  ------------------
 1345|      0|       !cpi->rc.high_motion_content_screen_rtc);
  ------------------
  |  Branch (1345:8): [True: 0, False: 0]
  ------------------
 1346|  7.27k|  const int max_sw =
 1347|  7.27k|      (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN) ? 512 : 256;
  ------------------
  |  Branch (1347:7): [True: 0, False: 7.27k]
  ------------------
 1348|  7.27k|  const int increase_col_sw =
 1349|  7.27k|      source_sad_nonrd > kMedSad && !cpi->rc.high_motion_content_screen_rtc;
  ------------------
  |  Branch (1349:7): [True: 3.77k, False: 3.49k]
  |  Branch (1349:37): [True: 3.77k, False: 1]
  ------------------
 1350|  7.27k|  int me_search_size_col = large_search
  ------------------
  |  Branch (1350:28): [True: 0, False: 7.27k]
  ------------------
 1351|  7.27k|                               ? increase_col_sw ? max_sw : 96
  ------------------
  |  Branch (1351:34): [True: 0, False: 0]
  ------------------
 1352|  7.27k|                               : block_size_wide[cm->seq_params->sb_size] >> 1;
 1353|       |  // Use larger search size row motion to capture
 1354|       |  // vertical scroll, which can be larger motion.
 1355|  7.27k|  int me_search_size_row = large_search
  ------------------
  |  Branch (1355:28): [True: 0, False: 7.27k]
  ------------------
 1356|  7.27k|                               ? source_sad_nonrd > kMedSad ? max_sw : 192
  ------------------
  |  Branch (1356:34): [True: 0, False: 0]
  ------------------
 1357|  7.27k|                               : block_size_high[cm->seq_params->sb_size] >> 1;
 1358|  7.27k|  if (cm->width * cm->height >= 3840 * 2160) {
  ------------------
  |  Branch (1358:7): [True: 0, False: 7.27k]
  ------------------
 1359|      0|    me_search_size_row = me_search_size_row << 1;
 1360|      0|    me_search_size_col = me_search_size_col << 1;
 1361|      0|  }
 1362|  7.27k|  unsigned int y_sad_zero;
 1363|  7.27k|  *y_sad = av1_int_pro_motion_estimation(
 1364|  7.27k|      cpi, x, cm->seq_params->sb_size, mi_row, mi_col, &kZeroMv, &y_sad_zero,
 1365|  7.27k|      me_search_size_col, me_search_size_row, 1, large_search);
 1366|       |  // The logic below selects whether the motion estimated in the
 1367|       |  // int_pro_motion() will be used in nonrd_pickmode.
 1368|  7.27k|  if (large_search) {
  ------------------
  |  Branch (1368:7): [True: 0, False: 7.27k]
  ------------------
 1369|      0|    unsigned int thresh_sad =
 1370|      0|        (cm->seq_params->sb_size == BLOCK_128X128) ? 50000 : 20000;
  ------------------
  |  Branch (1370:9): [True: 0, False: 0]
  ------------------
 1371|      0|    if (*y_sad < (y_sad_zero >> 1) && *y_sad < thresh_sad) {
  ------------------
  |  Branch (1371:9): [True: 0, False: 0]
  |  Branch (1371:39): [True: 0, False: 0]
  ------------------
 1372|      0|      x->sb_me_partition = 1;
 1373|      0|      x->sb_me_mv.as_int = mi->mv[0].as_int;
 1374|      0|      if (cpi->svc.temporal_layer_id == 0) {
  ------------------
  |  Branch (1374:11): [True: 0, False: 0]
  ------------------
 1375|      0|        if (abs(mi->mv[0].as_mv.col) > 16 && abs(mi->mv[0].as_mv.row) == 0)
  ------------------
  |  Branch (1375:13): [True: 0, False: 0]
  |  Branch (1375:46): [True: 0, False: 0]
  ------------------
 1376|      0|          x->sb_col_scroll++;
 1377|      0|        else if (abs(mi->mv[0].as_mv.row) > 16 && abs(mi->mv[0].as_mv.col) == 0)
  ------------------
  |  Branch (1377:18): [True: 0, False: 0]
  |  Branch (1377:51): [True: 0, False: 0]
  ------------------
 1378|      0|          x->sb_row_scroll++;
 1379|      0|      }
 1380|      0|    } else {
 1381|      0|      x->sb_me_partition = 0;
 1382|       |      // Fall back to using zero motion.
 1383|      0|      *y_sad = y_sad_zero;
 1384|      0|      mi->mv[0].as_int = 0;
 1385|      0|    }
 1386|      0|  }
 1387|  7.27k|}
var_based_part.c:evaluate_neighbour_mvs:
 1266|  6.70k|                                          int est_motion) {
 1267|  6.70k|  const int source_sad_nonrd = x->content_state_sb.source_sad_nonrd;
 1268|       |  // TODO(yunqingwang@google.com): test if this condition works with other
 1269|       |  // speeds.
 1270|  6.70k|  if (est_motion > 2 && source_sad_nonrd > kMedSad) return;
  ------------------
  |  Branch (1270:7): [True: 1.12k, False: 5.58k]
  |  Branch (1270:25): [True: 0, False: 1.12k]
  ------------------
 1271|       |
 1272|  6.70k|  MACROBLOCKD *xd = &x->e_mbd;
 1273|  6.70k|  BLOCK_SIZE bsize = is_small_sb ? BLOCK_64X64 : BLOCK_128X128;
  ------------------
  |  Branch (1273:22): [True: 6.70k, False: 1]
  ------------------
 1274|  6.70k|  MB_MODE_INFO *mi = xd->mi[0];
 1275|       |
 1276|  6.70k|  unsigned int above_y_sad = UINT_MAX;
 1277|  6.70k|  unsigned int left_y_sad = UINT_MAX;
 1278|  6.70k|  FULLPEL_MV above_mv = kZeroFullMv;
 1279|  6.70k|  FULLPEL_MV left_mv = kZeroFullMv;
 1280|  6.70k|  SubpelMvLimits subpel_mv_limits;
 1281|  6.70k|  const MV dummy_mv = { 0, 0 };
 1282|  6.70k|  av1_set_subpel_mv_search_range(&subpel_mv_limits, &x->mv_limits, &dummy_mv);
 1283|       |
 1284|       |  // Current best MV
 1285|  6.70k|  FULLPEL_MV best_mv = get_fullmv_from_mv(&mi->mv[0].as_mv);
 1286|  6.70k|  const int multi = (est_motion > 2 && source_sad_nonrd > kLowSad) ? 7 : 8;
  ------------------
  |  Branch (1286:22): [True: 1.12k, False: 5.58k]
  |  Branch (1286:40): [True: 1.12k, False: 0]
  ------------------
 1287|       |
 1288|  6.70k|  if (xd->up_available) {
  ------------------
  |  Branch (1288:7): [True: 3.92k, False: 2.78k]
  ------------------
 1289|  3.92k|    const MB_MODE_INFO *above_mbmi = xd->above_mbmi;
 1290|  3.92k|    if (above_mbmi->mode >= INTRA_MODE_END &&
  ------------------
  |  Branch (1290:9): [True: 2.48k, False: 1.43k]
  ------------------
 1291|  2.48k|        above_mbmi->ref_frame[0] == LAST_FRAME) {
  ------------------
  |  Branch (1291:9): [True: 2.48k, False: 0]
  ------------------
 1292|  2.48k|      MV temp = above_mbmi->mv[0].as_mv;
 1293|  2.48k|      clamp_mv(&temp, &subpel_mv_limits);
 1294|  2.48k|      above_mv = get_fullmv_from_mv(&temp);
 1295|       |
 1296|  2.48k|      if (mv_distance(&best_mv, &above_mv) > 0) {
  ------------------
  |  Branch (1296:11): [True: 2.18k, False: 303]
  ------------------
 1297|  2.18k|        uint8_t const *ref_buf =
 1298|  2.18k|            get_buf_from_fullmv(&xd->plane[0].pre[0], &above_mv);
 1299|  2.18k|        above_y_sad = cpi->ppi->fn_ptr[bsize].sdf(
 1300|  2.18k|            x->plane[0].src.buf, x->plane[0].src.stride, ref_buf,
 1301|  2.18k|            xd->plane[0].pre[0].stride);
 1302|  2.18k|      }
 1303|  2.48k|    }
 1304|  3.92k|  }
 1305|  6.70k|  if (xd->left_available) {
  ------------------
  |  Branch (1305:7): [True: 3.57k, False: 3.12k]
  ------------------
 1306|  3.57k|    const MB_MODE_INFO *left_mbmi = xd->left_mbmi;
 1307|  3.57k|    if (left_mbmi->mode >= INTRA_MODE_END &&
  ------------------
  |  Branch (1307:9): [True: 2.24k, False: 1.33k]
  ------------------
 1308|  2.24k|        left_mbmi->ref_frame[0] == LAST_FRAME) {
  ------------------
  |  Branch (1308:9): [True: 2.24k, False: 0]
  ------------------
 1309|  2.24k|      MV temp = left_mbmi->mv[0].as_mv;
 1310|  2.24k|      clamp_mv(&temp, &subpel_mv_limits);
 1311|  2.24k|      left_mv = get_fullmv_from_mv(&temp);
 1312|       |
 1313|  2.24k|      if (mv_distance(&best_mv, &left_mv) > 0 &&
  ------------------
  |  Branch (1313:11): [True: 1.93k, False: 318]
  ------------------
 1314|  1.93k|          mv_distance(&above_mv, &left_mv) > 0) {
  ------------------
  |  Branch (1314:11): [True: 1.82k, False: 105]
  ------------------
 1315|  1.82k|        uint8_t const *ref_buf =
 1316|  1.82k|            get_buf_from_fullmv(&xd->plane[0].pre[0], &left_mv);
 1317|  1.82k|        left_y_sad = cpi->ppi->fn_ptr[bsize].sdf(
 1318|  1.82k|            x->plane[0].src.buf, x->plane[0].src.stride, ref_buf,
 1319|  1.82k|            xd->plane[0].pre[0].stride);
 1320|  1.82k|      }
 1321|  2.24k|    }
 1322|  3.57k|  }
 1323|       |
 1324|  6.70k|  if (above_y_sad < ((multi * *y_sad) >> 3) && above_y_sad < left_y_sad) {
  ------------------
  |  Branch (1324:7): [True: 647, False: 6.06k]
  |  Branch (1324:48): [True: 633, False: 14]
  ------------------
 1325|    633|    *y_sad = above_y_sad;
 1326|    633|    mi->mv[0].as_mv = get_mv_from_fullmv(&above_mv);
 1327|    633|    clamp_mv(&mi->mv[0].as_mv, &subpel_mv_limits);
 1328|    633|  }
 1329|  6.70k|  if (left_y_sad < ((multi * *y_sad) >> 3) && left_y_sad < above_y_sad) {
  ------------------
  |  Branch (1329:7): [True: 548, False: 6.15k]
  |  Branch (1329:47): [True: 548, False: 0]
  ------------------
 1330|    548|    *y_sad = left_y_sad;
 1331|    548|    mi->mv[0].as_mv = get_mv_from_fullmv(&left_mv);
 1332|    548|    clamp_mv(&mi->mv[0].as_mv, &subpel_mv_limits);
 1333|    548|  }
 1334|  6.70k|}
var_based_part.c:mv_distance:
 1260|  6.66k|                                        const FULLPEL_MV *mv1) {
 1261|  6.66k|  return abs(mv0->row - mv1->row) + abs(mv0->col - mv1->col);
 1262|  6.66k|}
var_based_part.c:set_ref_frame_for_partition:
 1224|  40.5k|    int mi_row, int mi_col, int num_planes) {
 1225|  40.5k|  AV1_COMMON *const cm = &cpi->common;
 1226|  40.5k|  const double fac =
 1227|  40.5k|      (cpi->svc.spatial_layer_id > 0 && cpi->svc.has_lower_quality_layer) ? 1.0
  ------------------
  |  Branch (1227:8): [True: 0, False: 40.5k]
  |  Branch (1227:41): [True: 0, False: 0]
  ------------------
 1228|  40.5k|                                                                          : 0.9;
 1229|  40.5k|  const bool is_set_golden_ref_frame =
 1230|  40.5k|      *y_sad_g < fac * *y_sad && *y_sad_g < *y_sad_alt;
  ------------------
  |  Branch (1230:7): [True: 0, False: 40.5k]
  |  Branch (1230:34): [True: 0, False: 0]
  ------------------
 1231|  40.5k|  const bool is_set_altref_ref_frame =
 1232|  40.5k|      *y_sad_alt < fac * *y_sad && *y_sad_alt < *y_sad_g;
  ------------------
  |  Branch (1232:7): [True: 0, False: 40.5k]
  |  Branch (1232:36): [True: 0, False: 0]
  ------------------
 1233|       |
 1234|  40.5k|  if (is_set_golden_ref_frame) {
  ------------------
  |  Branch (1234:7): [True: 0, False: 40.5k]
  ------------------
 1235|      0|    av1_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col,
 1236|      0|                         get_ref_scale_factors(cm, GOLDEN_FRAME), num_planes);
 1237|      0|    mi->ref_frame[0] = GOLDEN_FRAME;
 1238|      0|    mi->mv[0].as_int = 0;
 1239|      0|    *y_sad = *y_sad_g;
 1240|      0|    *ref_frame_partition = GOLDEN_FRAME;
 1241|      0|    x->nonrd_prune_ref_frame_search = 0;
 1242|      0|    x->sb_me_partition = 0;
 1243|  40.5k|  } else if (is_set_altref_ref_frame) {
  ------------------
  |  Branch (1243:14): [True: 0, False: 40.5k]
  ------------------
 1244|      0|    av1_setup_pre_planes(xd, 0, yv12_alt, mi_row, mi_col,
 1245|      0|                         get_ref_scale_factors(cm, ALTREF_FRAME), num_planes);
 1246|      0|    mi->ref_frame[0] = ALTREF_FRAME;
 1247|      0|    mi->mv[0].as_int = 0;
 1248|      0|    *y_sad = *y_sad_alt;
 1249|      0|    *ref_frame_partition = ALTREF_FRAME;
 1250|      0|    x->nonrd_prune_ref_frame_search = 0;
 1251|      0|    x->sb_me_partition = 0;
 1252|  40.5k|  } else {
 1253|  40.5k|    *ref_frame_partition = LAST_FRAME;
 1254|  40.5k|    x->nonrd_prune_ref_frame_search =
 1255|  40.5k|        cpi->sf.rt_sf.nonrd_prune_ref_frame_search;
 1256|  40.5k|  }
 1257|  40.5k|}
var_based_part.c:chroma_check:
  990|  49.0k|                                bool zero_motion, unsigned int *uv_sad) {
  991|  49.0k|  MACROBLOCKD *xd = &x->e_mbd;
  992|  49.0k|  const int source_sad_nonrd = x->content_state_sb.source_sad_nonrd;
  993|  49.0k|  int shift_upper_limit = 1;
  994|  49.0k|  int shift_lower_limit = 3;
  995|  49.0k|  int fac_uv = 6;
  996|  49.0k|  if (is_key_frame || cpi->oxcf.tool_cfg.enable_monochrome) return;
  ------------------
  |  Branch (996:7): [True: 8.46k, False: 40.6k]
  |  Branch (996:23): [True: 26.4k, False: 14.1k]
  ------------------
  997|       |
  998|       |  // Use lower threshold (more conservative in setting color flag) for
  999|       |  // higher resolutions non-screen, which tend to have more camera noise.
 1000|       |  // Since this may be used to skip compound mode in nonrd pickmode, which
 1001|       |  // is generally more effective for higher resolutions, better to be more
 1002|       |  // conservative.
 1003|  14.2k|  if (cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN) {
  ------------------
  |  Branch (1003:7): [True: 14.2k, False: 18.4E]
  ------------------
 1004|  14.2k|    if (cpi->common.width * cpi->common.height >= RESOLUTION_1080P)
  ------------------
  |  |   66|  14.2k|#define RESOLUTION_1080P 1920 * 1080
  ------------------
  |  Branch (1004:9): [True: 0, False: 14.2k]
  ------------------
 1005|      0|      fac_uv = 3;
 1006|  14.2k|    else
 1007|  14.2k|      fac_uv = 5;
 1008|  14.2k|  }
 1009|  14.1k|  if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (1009:7): [True: 0, False: 14.1k]
  ------------------
 1010|      0|      cpi->rc.high_source_sad) {
  ------------------
  |  Branch (1010:7): [True: 0, False: 0]
  ------------------
 1011|      0|    shift_lower_limit = 7;
 1012|  14.1k|  } else if (cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN &&
  ------------------
  |  Branch (1012:14): [True: 0, False: 14.1k]
  ------------------
 1013|      0|             cpi->rc.percent_blocks_with_motion > 90 &&
  ------------------
  |  Branch (1013:14): [True: 0, False: 0]
  ------------------
 1014|      0|             cpi->rc.frame_source_sad > 10000 && source_sad_nonrd > kLowSad) {
  ------------------
  |  Branch (1014:14): [True: 0, False: 0]
  |  Branch (1014:50): [True: 0, False: 0]
  ------------------
 1015|      0|    shift_lower_limit = 8;
 1016|      0|    shift_upper_limit = 3;
 1017|  14.1k|  } else if (source_sad_nonrd >= kMedSad && x->source_variance > 500 &&
  ------------------
  |  Branch (1017:14): [True: 14.1k, False: 45]
  |  Branch (1017:45): [True: 12.8k, False: 1.27k]
  ------------------
 1018|  12.8k|             cpi->common.width * cpi->common.height >= 640 * 360) {
  ------------------
  |  Branch (1018:14): [True: 0, False: 12.8k]
  ------------------
 1019|      0|    shift_upper_limit = 2;
 1020|      0|    shift_lower_limit = source_sad_nonrd > kMedSad ? 5 : 4;
  ------------------
  |  Branch (1020:25): [True: 0, False: 0]
  ------------------
 1021|      0|  }
 1022|       |
 1023|  14.1k|  MB_MODE_INFO *mi = xd->mi[0];
 1024|  14.1k|  const AV1_COMMON *const cm = &cpi->common;
 1025|  14.1k|  const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_yv12_buf(cm, LAST_FRAME);
 1026|  14.1k|  const YV12_BUFFER_CONFIG *yv12_g = get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
 1027|  14.1k|  const YV12_BUFFER_CONFIG *yv12_alt = get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
 1028|  14.1k|  const struct scale_factors *const sf =
 1029|  14.1k|      get_ref_scale_factors_const(cm, LAST_FRAME);
 1030|  14.1k|  const struct scale_factors *const sf_g =
 1031|  14.1k|      get_ref_scale_factors_const(cm, GOLDEN_FRAME);
 1032|  14.1k|  const struct scale_factors *const sf_alt =
 1033|  14.1k|      get_ref_scale_factors_const(cm, ALTREF_FRAME);
 1034|  14.1k|  struct buf_2d dst;
 1035|  14.1k|  unsigned int uv_sad_g = 0;
 1036|  14.1k|  unsigned int uv_sad_alt = 0;
 1037|       |
 1038|  42.5k|  for (int plane = AOM_PLANE_U; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |  282|  14.1k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
                for (int plane = AOM_PLANE_U; plane < MAX_MB_PLANE; ++plane) {
  ------------------
  |  |   36|  42.5k|#define MAX_MB_PLANE 3
  ------------------
  |  Branch (1038:33): [True: 28.3k, False: 14.1k]
  ------------------
 1039|  28.3k|    struct macroblock_plane *p = &x->plane[plane];
 1040|  28.3k|    struct macroblockd_plane *pd = &xd->plane[plane];
 1041|  28.3k|    const BLOCK_SIZE bs =
 1042|  28.3k|        get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
 1043|       |
 1044|  28.3k|    if (bs != BLOCK_INVALID) {
  ------------------
  |  Branch (1044:9): [True: 28.3k, False: 18.4E]
  ------------------
 1045|       |      // For last:
 1046|  28.3k|      if (zero_motion) {
  ------------------
  |  Branch (1046:11): [True: 23.1k, False: 5.27k]
  ------------------
 1047|  23.1k|        if (mi->ref_frame[0] == LAST_FRAME) {
  ------------------
  |  Branch (1047:13): [True: 23.1k, False: 4]
  ------------------
 1048|  23.1k|          uv_sad[plane - 1] = cpi->ppi->fn_ptr[bs].sdf(
 1049|  23.1k|              p->src.buf, p->src.stride, pd->pre[0].buf, pd->pre[0].stride);
 1050|  23.1k|        } else {
 1051|      4|          uint8_t *src = (plane == 1) ? yv12->u_buffer : yv12->v_buffer;
  ------------------
  |  Branch (1051:26): [True: 0, False: 4]
  ------------------
 1052|      4|          setup_pred_plane(&dst, xd->mi[0]->bsize, src, yv12->uv_crop_width,
 1053|      4|                           yv12->uv_crop_height, yv12->uv_stride, xd->mi_row,
 1054|      4|                           xd->mi_col, sf, xd->plane[plane].subsampling_x,
 1055|      4|                           xd->plane[plane].subsampling_y);
 1056|       |
 1057|      4|          uv_sad[plane - 1] = cpi->ppi->fn_ptr[bs].sdf(
 1058|      4|              p->src.buf, p->src.stride, dst.buf, dst.stride);
 1059|      4|        }
 1060|  23.1k|      } else {
 1061|  5.27k|        uv_sad[plane - 1] = cpi->ppi->fn_ptr[bs].sdf(
 1062|  5.27k|            p->src.buf, p->src.stride, pd->dst.buf, pd->dst.stride);
 1063|  5.27k|      }
 1064|       |
 1065|       |      // For golden:
 1066|  28.3k|      if (y_sad_g != UINT_MAX) {
  ------------------
  |  Branch (1066:11): [True: 0, False: 28.3k]
  ------------------
 1067|      0|        uint8_t *src = (plane == 1) ? yv12_g->u_buffer : yv12_g->v_buffer;
  ------------------
  |  Branch (1067:24): [True: 0, False: 0]
  ------------------
 1068|      0|        setup_pred_plane(&dst, xd->mi[0]->bsize, src, yv12_g->uv_crop_width,
 1069|      0|                         yv12_g->uv_crop_height, yv12_g->uv_stride, xd->mi_row,
 1070|      0|                         xd->mi_col, sf_g, xd->plane[plane].subsampling_x,
 1071|      0|                         xd->plane[plane].subsampling_y);
 1072|      0|        uv_sad_g = cpi->ppi->fn_ptr[bs].sdf(p->src.buf, p->src.stride, dst.buf,
 1073|      0|                                            dst.stride);
 1074|      0|      }
 1075|       |
 1076|       |      // For altref:
 1077|  28.3k|      if (y_sad_alt != UINT_MAX) {
  ------------------
  |  Branch (1077:11): [True: 0, False: 28.3k]
  ------------------
 1078|      0|        uint8_t *src = (plane == 1) ? yv12_alt->u_buffer : yv12_alt->v_buffer;
  ------------------
  |  Branch (1078:24): [True: 0, False: 0]
  ------------------
 1079|      0|        setup_pred_plane(&dst, xd->mi[0]->bsize, src, yv12_alt->uv_crop_width,
 1080|      0|                         yv12_alt->uv_crop_height, yv12_alt->uv_stride,
 1081|      0|                         xd->mi_row, xd->mi_col, sf_alt,
 1082|      0|                         xd->plane[plane].subsampling_x,
 1083|      0|                         xd->plane[plane].subsampling_y);
 1084|      0|        uv_sad_alt = cpi->ppi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
 1085|      0|                                              dst.buf, dst.stride);
 1086|      0|      }
 1087|  28.3k|    }
 1088|       |
 1089|  28.3k|    if (uv_sad[plane - 1] > (y_sad >> shift_upper_limit))
  ------------------
  |  Branch (1089:9): [True: 10.1k, False: 18.1k]
  ------------------
 1090|  10.1k|      x->color_sensitivity_sb[COLOR_SENS_IDX(plane)] = 1;
  ------------------
  |  |   50|  10.1k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 1091|  18.1k|    else if (uv_sad[plane - 1] < (y_sad >> shift_lower_limit))
  ------------------
  |  Branch (1091:14): [True: 1.13k, False: 17.0k]
  ------------------
 1092|  1.13k|      x->color_sensitivity_sb[COLOR_SENS_IDX(plane)] = 0;
  ------------------
  |  |   50|  1.13k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 1093|       |    // Borderline case: to be refined at coding block level in nonrd_pickmode,
 1094|       |    // for coding block size < sb_size.
 1095|  17.0k|    else
 1096|  17.0k|      x->color_sensitivity_sb[COLOR_SENS_IDX(plane)] = 2;
  ------------------
  |  |   50|  17.0k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 1097|       |
 1098|  28.3k|    x->color_sensitivity_sb_g[COLOR_SENS_IDX(plane)] =
  ------------------
  |  |   50|  28.3k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 1099|  28.3k|        uv_sad_g > y_sad_g / fac_uv;
 1100|  28.3k|    x->color_sensitivity_sb_alt[COLOR_SENS_IDX(plane)] =
  ------------------
  |  |   50|  28.3k|#define COLOR_SENS_IDX(plane) ((plane) - 1)
  ------------------
 1101|  28.3k|        uv_sad_alt > y_sad_alt / fac_uv;
 1102|  28.3k|  }
 1103|  14.1k|}
var_based_part.c:fill_variance_tree_leaves:
 1110|  49.0k|    const bool is_small_sb) {
 1111|  49.0k|  MACROBLOCKD *xd = &x->e_mbd;
 1112|  49.0k|  const int num_64x64_blocks = is_small_sb ? 1 : 4;
  ------------------
  |  Branch (1112:32): [True: 49.0k, False: 0]
  ------------------
 1113|       |  // TODO(kyslov) Bring back compute_minmax_variance with content type detection
 1114|  49.0k|  const int compute_minmax_variance = 0;
 1115|  49.0k|  const int segment_id = xd->mi[0]->segment_id;
 1116|  49.0k|  int pixels_wide = 128, pixels_high = 128;
 1117|  49.0k|  int border_offset_4x4 = 0;
 1118|  49.0k|  int temporal_denoising = cpi->sf.rt_sf.use_rtc_tf;
 1119|       |  // dst_buf pointer is not used for is_key_frame, so it should be NULL.
 1120|  49.0k|  assert(IMPLIES(is_key_frame, dst_buf == NULL));
 1121|  49.0k|  if (is_small_sb) {
  ------------------
  |  Branch (1121:7): [True: 49.0k, False: 0]
  ------------------
 1122|  49.0k|    pixels_wide = 64;
 1123|  49.0k|    pixels_high = 64;
 1124|  49.0k|  }
 1125|  49.0k|  if (xd->mb_to_right_edge < 0) pixels_wide += (xd->mb_to_right_edge >> 3);
  ------------------
  |  Branch (1125:7): [True: 30.9k, False: 18.1k]
  ------------------
 1126|  49.0k|  if (xd->mb_to_bottom_edge < 0) pixels_high += (xd->mb_to_bottom_edge >> 3);
  ------------------
  |  Branch (1126:7): [True: 30.2k, False: 18.8k]
  ------------------
 1127|       |#if CONFIG_AV1_TEMPORAL_DENOISING
 1128|       |  temporal_denoising |= cpi->oxcf.noise_sensitivity;
 1129|       |#endif
 1130|       |  // For temporal filtering or temporal denoiser enabled: since the source
 1131|       |  // is modified we need to avoid 4x4 avg along superblock boundary, since
 1132|       |  // simd code will load 8 pixels for 4x4 avg and so can access source
 1133|       |  // data outside superblock (while its being modified by temporal filter).
 1134|       |  // Temporal filtering is never done on key frames.
 1135|  49.0k|  if (!is_key_frame && temporal_denoising) border_offset_4x4 = 4;
  ------------------
  |  Branch (1135:7): [True: 40.6k, False: 8.48k]
  |  Branch (1135:24): [True: 39.1k, False: 1.44k]
  ------------------
 1136|  98.1k|  for (int blk64_idx = 0; blk64_idx < num_64x64_blocks; blk64_idx++) {
  ------------------
  |  Branch (1136:27): [True: 49.1k, False: 49.0k]
  ------------------
 1137|  49.1k|    const int x64_idx = GET_BLK_IDX_X(blk64_idx, 6);
  ------------------
  |  |   24|  49.1k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1138|  49.1k|    const int y64_idx = GET_BLK_IDX_Y(blk64_idx, 6);
  ------------------
  |  |   25|  49.1k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1139|  49.1k|    const int blk64_scale_idx = blk64_idx << 2;
 1140|  49.1k|    force_split[blk64_idx + 1] = PART_EVAL_ALL;
 1141|       |
 1142|   245k|    for (int lvl1_idx = 0; lvl1_idx < 4; lvl1_idx++) {
  ------------------
  |  Branch (1142:28): [True: 196k, False: 49.1k]
  ------------------
 1143|   196k|      const int x32_idx = x64_idx + GET_BLK_IDX_X(lvl1_idx, 5);
  ------------------
  |  |   24|   196k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1144|   196k|      const int y32_idx = y64_idx + GET_BLK_IDX_Y(lvl1_idx, 5);
  ------------------
  |  |   25|   196k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1145|   196k|      const int lvl1_scale_idx = (blk64_scale_idx + lvl1_idx) << 2;
 1146|   196k|      force_split[5 + blk64_scale_idx + lvl1_idx] = PART_EVAL_ALL;
 1147|   196k|      avg_16x16[blk64_idx][lvl1_idx] = 0;
 1148|   196k|      maxvar_16x16[blk64_idx][lvl1_idx] = 0;
 1149|   196k|      minvar_16x16[blk64_idx][lvl1_idx] = INT_MAX;
 1150|   977k|      for (int lvl2_idx = 0; lvl2_idx < 4; lvl2_idx++) {
  ------------------
  |  Branch (1150:30): [True: 781k, False: 196k]
  ------------------
 1151|   781k|        const int x16_idx = x32_idx + GET_BLK_IDX_X(lvl2_idx, 4);
  ------------------
  |  |   24|   781k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1152|   781k|        const int y16_idx = y32_idx + GET_BLK_IDX_Y(lvl2_idx, 4);
  ------------------
  |  |   25|   781k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1153|   781k|        const int split_index = 21 + lvl1_scale_idx + lvl2_idx;
 1154|   781k|        VP16x16 *vst = &vt->split[blk64_idx].split[lvl1_idx].split[lvl2_idx];
 1155|   781k|        force_split[split_index] = PART_EVAL_ALL;
 1156|   781k|        if (is_key_frame) {
  ------------------
  |  Branch (1156:13): [True: 134k, False: 646k]
  ------------------
 1157|       |          // Go down to 4x4 down-sampling for variance.
 1158|   665k|          for (int lvl3_idx = 0; lvl3_idx < 4; lvl3_idx++) {
  ------------------
  |  Branch (1158:34): [True: 530k, False: 134k]
  ------------------
 1159|   530k|            const int x8_idx = x16_idx + GET_BLK_IDX_X(lvl3_idx, 3);
  ------------------
  |  |   24|   530k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
 1160|   530k|            const int y8_idx = y16_idx + GET_BLK_IDX_Y(lvl3_idx, 3);
  ------------------
  |  |   25|   530k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
 1161|   530k|            VP8x8 *vst2 = &vst->split[lvl3_idx];
 1162|   530k|            fill_variance_4x4avg(src_buf, src_stride, x8_idx, y8_idx, vst2,
 1163|   530k|#if CONFIG_AV1_HIGHBITDEPTH
 1164|   530k|                                 xd->cur_buf->flags,
 1165|   530k|#endif
 1166|   530k|                                 pixels_wide, pixels_high, border_offset_4x4);
 1167|   530k|          }
 1168|   646k|        } else {
 1169|   646k|          fill_variance_8x8avg(src_buf, src_stride, dst_buf, dst_stride,
 1170|   646k|                               x16_idx, y16_idx, vst, is_cur_buf_hbd(xd),
 1171|   646k|                               pixels_wide, pixels_high);
 1172|       |
 1173|   646k|          fill_variance_tree(vst, BLOCK_16X16);
 1174|   646k|          VPartVar *none_var = &vt->split[blk64_idx]
 1175|   646k|                                    .split[lvl1_idx]
 1176|   646k|                                    .split[lvl2_idx]
 1177|   646k|                                    .part_variances.none;
 1178|   646k|          get_variance(none_var);
 1179|   646k|          const int val_none_var = none_var->variance;
 1180|   646k|          avg_16x16[blk64_idx][lvl1_idx] += val_none_var;
 1181|   646k|          minvar_16x16[blk64_idx][lvl1_idx] =
 1182|   646k|              AOMMIN(minvar_16x16[blk64_idx][lvl1_idx], val_none_var);
  ------------------
  |  |   34|   646k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 128k, False: 517k]
  |  |  ------------------
  ------------------
 1183|   646k|          maxvar_16x16[blk64_idx][lvl1_idx] =
 1184|   646k|              AOMMAX(maxvar_16x16[blk64_idx][lvl1_idx], val_none_var);
  ------------------
  |  |   35|   646k|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 209k, False: 437k]
  |  |  ------------------
  ------------------
 1185|   646k|          if (val_none_var > thresholds[3]) {
  ------------------
  |  Branch (1185:15): [True: 113k, False: 533k]
  ------------------
 1186|       |            // 16X16 variance is above threshold for split, so force split to
 1187|       |            // 8x8 for this 16x16 block (this also forces splits for upper
 1188|       |            // levels).
 1189|   113k|            force_split[split_index] = PART_EVAL_ONLY_SPLIT;
 1190|   113k|            force_split[5 + blk64_scale_idx + lvl1_idx] = PART_EVAL_ONLY_SPLIT;
 1191|   113k|            force_split[blk64_idx + 1] = PART_EVAL_ONLY_SPLIT;
 1192|   113k|            force_split[0] = PART_EVAL_ONLY_SPLIT;
 1193|   533k|          } else if (!cyclic_refresh_segment_id_boosted(segment_id) &&
  ------------------
  |  Branch (1193:22): [True: 533k, False: 18.4E]
  ------------------
 1194|   533k|                     compute_minmax_variance && val_none_var > thresholds[2]) {
  ------------------
  |  Branch (1194:22): [Folded, False: 533k]
  |  Branch (1194:49): [True: 0, False: 0]
  ------------------
 1195|       |            // We have some nominal amount of 16x16 variance (based on average),
 1196|       |            // compute the minmax over the 8x8 sub-blocks, and if above
 1197|       |            // threshold, force split to 8x8 block for this 16x16 block.
 1198|      0|            int minmax = compute_minmax_8x8(src_buf, src_stride, dst_buf,
 1199|      0|                                            dst_stride, x16_idx, y16_idx,
 1200|      0|#if CONFIG_AV1_HIGHBITDEPTH
 1201|      0|                                            xd->cur_buf->flags,
 1202|      0|#endif
 1203|      0|                                            pixels_wide, pixels_high);
 1204|      0|            const int thresh_minmax = (int)cpi->vbp_info.threshold_minmax;
 1205|      0|            if (minmax > thresh_minmax) {
  ------------------
  |  Branch (1205:17): [True: 0, False: 0]
  ------------------
 1206|      0|              force_split[split_index] = PART_EVAL_ONLY_SPLIT;
 1207|      0|              force_split[5 + blk64_scale_idx + lvl1_idx] =
 1208|      0|                  PART_EVAL_ONLY_SPLIT;
 1209|      0|              force_split[blk64_idx + 1] = PART_EVAL_ONLY_SPLIT;
 1210|      0|              force_split[0] = PART_EVAL_ONLY_SPLIT;
 1211|      0|            }
 1212|      0|          }
 1213|   646k|        }
 1214|   781k|      }
 1215|   196k|    }
 1216|  49.1k|  }
 1217|  49.0k|}
var_based_part.c:fill_variance_4x4avg:
  396|   533k|                                        int border_offset_4x4) {
  397|  2.64M|  for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (397:21): [True: 2.10M, False: 533k]
  ------------------
  398|  2.10M|    const int x4_idx = x8_idx + GET_BLK_IDX_X(idx, 2);
  ------------------
  |  |   24|  2.10M|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
  399|  2.10M|    const int y4_idx = y8_idx + GET_BLK_IDX_Y(idx, 2);
  ------------------
  |  |   25|  2.10M|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
  400|  2.10M|    unsigned int sse = 0;
  401|  2.10M|    int sum = 0;
  402|  2.10M|    if (x4_idx < pixels_wide - border_offset_4x4 &&
  ------------------
  |  Branch (402:9): [True: 875k, False: 1.23M]
  ------------------
  403|   875k|        y4_idx < pixels_high - border_offset_4x4) {
  ------------------
  |  Branch (403:9): [True: 442k, False: 433k]
  ------------------
  404|   442k|      int src_avg;
  405|   442k|      int dst_avg = 128;
  406|   442k|#if CONFIG_AV1_HIGHBITDEPTH
  407|   442k|      if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) {
  ------------------
  |  |  142|   442k|#define YV12_FLAG_HIGHBITDEPTH 8
  ------------------
  |  Branch (407:11): [True: 24.3k, False: 418k]
  ------------------
  408|  24.3k|        src_avg = aom_highbd_avg_4x4(src_buf + y4_idx * src_stride + x4_idx,
  ------------------
  |  | 2150|  24.3k|#define aom_highbd_avg_4x4 aom_highbd_avg_4x4_c
  ------------------
  409|  24.3k|                                     src_stride);
  410|   418k|      } else {
  411|   418k|        src_avg =
  412|   418k|            aom_avg_4x4(src_buf + y4_idx * src_stride + x4_idx, src_stride);
  ------------------
  |  |   38|   418k|#define aom_avg_4x4 aom_avg_4x4_sse2
  ------------------
  413|   418k|      }
  414|       |#else
  415|       |      src_avg = aom_avg_4x4(src_buf + y4_idx * src_stride + x4_idx, src_stride);
  416|       |#endif
  417|       |
  418|   442k|      sum = src_avg - dst_avg;
  419|   442k|      sse = sum * sum;
  420|   442k|    }
  421|  2.10M|    fill_variance(sse, sum, 0, &vst->split[idx].part_variances.none);
  422|  2.10M|  }
  423|   533k|}
var_based_part.c:fill_variance:
  103|  12.1M|static inline void fill_variance(uint32_t s2, int32_t s, int c, VPartVar *v) {
  104|  12.1M|  v->sum_square_error = s2;
  105|  12.1M|  v->sum_error = s;
  106|  12.1M|  v->log2_count = c;
  107|  12.1M|}
var_based_part.c:fill_variance_8x8avg:
  334|   646k|                                        int pixels_high) {
  335|   646k|#if CONFIG_AV1_HIGHBITDEPTH
  336|   646k|  if (highbd_flag) {
  ------------------
  |  Branch (336:7): [True: 89.3k, False: 557k]
  ------------------
  337|  89.3k|    fill_variance_8x8avg_highbd(src_buf, src_stride, dst_buf, dst_stride,
  338|  89.3k|                                x16_idx, y16_idx, vst, pixels_wide,
  339|  89.3k|                                pixels_high);
  340|  89.3k|    return;
  341|  89.3k|  }
  342|       |#else
  343|       |  (void)highbd_flag;
  344|       |#endif  // CONFIG_AV1_HIGHBITDEPTH
  345|   557k|  fill_variance_8x8avg_lowbd(src_buf, src_stride, dst_buf, dst_stride, x16_idx,
  346|   557k|                             y16_idx, vst, pixels_wide, pixels_high);
  347|   557k|}
var_based_part.c:fill_variance_8x8avg_highbd:
  270|  89.3k|    int pixels_high) {
  271|   445k|  for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (271:21): [True: 356k, False: 89.3k]
  ------------------
  272|   356k|    const int x8_idx = x16_idx + GET_BLK_IDX_X(idx, 3);
  ------------------
  |  |   24|   356k|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
  273|   356k|    const int y8_idx = y16_idx + GET_BLK_IDX_Y(idx, 3);
  ------------------
  |  |   25|   356k|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
  274|   356k|    unsigned int sse = 0;
  275|   356k|    int sum = 0;
  276|   356k|    if (x8_idx < pixels_wide && y8_idx < pixels_high) {
  ------------------
  |  Branch (276:9): [True: 138k, False: 217k]
  |  Branch (276:33): [True: 50.8k, False: 88.0k]
  ------------------
  277|  50.8k|      int src_avg = aom_highbd_avg_8x8(src_buf + y8_idx * src_stride + x8_idx,
  ------------------
  |  | 2153|  50.8k|#define aom_highbd_avg_8x8 aom_highbd_avg_8x8_c
  ------------------
  278|  50.8k|                                       src_stride);
  279|  50.8k|      int dst_avg = aom_highbd_avg_8x8(dst_buf + y8_idx * dst_stride + x8_idx,
  ------------------
  |  | 2153|  50.8k|#define aom_highbd_avg_8x8 aom_highbd_avg_8x8_c
  ------------------
  280|  50.8k|                                       dst_stride);
  281|       |
  282|  50.8k|      sum = src_avg - dst_avg;
  283|  50.8k|      sse = sum * sum;
  284|  50.8k|    }
  285|   356k|    fill_variance(sse, sum, 0, &vst->split[idx].part_variances.none);
  286|   356k|  }
  287|  89.3k|}
var_based_part.c:fill_variance_8x8avg_lowbd:
  293|   557k|    int pixels_high) {
  294|   557k|  unsigned int sse[4] = { 0 };
  295|   557k|  int sum[4] = { 0 };
  296|       |
  297|   557k|  if (all_blks_inside(x16_idx, y16_idx, pixels_wide, pixels_high)) {
  ------------------
  |  Branch (297:7): [True: 224k, False: 333k]
  ------------------
  298|   224k|    int src_avg[4];
  299|   224k|    int dst_avg[4];
  300|   224k|    aom_avg_8x8_quad(src_buf, src_stride, x16_idx, y16_idx, src_avg);
  301|   224k|    aom_avg_8x8_quad(dst_buf, dst_stride, x16_idx, y16_idx, dst_avg);
  302|  1.12M|    for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (302:23): [True: 896k, False: 224k]
  ------------------
  303|   896k|      sum[idx] = src_avg[idx] - dst_avg[idx];
  304|   896k|      sse[idx] = sum[idx] * sum[idx];
  305|   896k|    }
  306|   333k|  } else {
  307|  1.66M|    for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (307:23): [True: 1.33M, False: 333k]
  ------------------
  308|  1.33M|      const int x8_idx = x16_idx + GET_BLK_IDX_X(idx, 3);
  ------------------
  |  |   24|  1.33M|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
  309|  1.33M|      const int y8_idx = y16_idx + GET_BLK_IDX_Y(idx, 3);
  ------------------
  |  |   25|  1.33M|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
  310|  1.33M|      if (x8_idx < pixels_wide && y8_idx < pixels_high) {
  ------------------
  |  Branch (310:11): [True: 518k, False: 817k]
  |  Branch (310:35): [True: 86.7k, False: 431k]
  ------------------
  311|  86.7k|        int src_avg =
  312|  86.7k|            aom_avg_8x8(src_buf + y8_idx * src_stride + x8_idx, src_stride);
  ------------------
  |  |   42|  86.7k|#define aom_avg_8x8 aom_avg_8x8_sse2
  ------------------
  313|  86.7k|        int dst_avg =
  314|  86.7k|            aom_avg_8x8(dst_buf + y8_idx * dst_stride + x8_idx, dst_stride);
  ------------------
  |  |   42|  86.7k|#define aom_avg_8x8 aom_avg_8x8_sse2
  ------------------
  315|  86.7k|        sum[idx] = src_avg - dst_avg;
  316|  86.7k|        sse[idx] = sum[idx] * sum[idx];
  317|  86.7k|      }
  318|  1.33M|    }
  319|   333k|  }
  320|       |
  321|  2.77M|  for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (321:21): [True: 2.21M, False: 557k]
  ------------------
  322|  2.21M|    fill_variance(sse[idx], sum[idx], 0, &vst->split[idx].part_variances.none);
  323|  2.21M|  }
  324|   557k|}
var_based_part.c:all_blks_inside:
  256|   557k|                                  int pixels_high) {
  257|   557k|  int all_inside = 1;
  258|  2.78M|  for (int idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (258:21): [True: 2.22M, False: 557k]
  ------------------
  259|  2.22M|    all_inside &= ((x16_idx + GET_BLK_IDX_X(idx, 3)) < pixels_wide);
  ------------------
  |  |   24|  2.22M|#define GET_BLK_IDX_X(idx, level) (((idx) & (0x01)) << (level))
  ------------------
  260|  2.22M|    all_inside &= ((y16_idx + GET_BLK_IDX_Y(idx, 3)) < pixels_high);
  ------------------
  |  |   25|  2.22M|#define GET_BLK_IDX_Y(idx, level) (((idx) >> (0x01)) << (level))
  ------------------
  261|  2.22M|  }
  262|   557k|  return all_inside;
  263|   557k|}
var_based_part.c:fill_variance_tree:
  124|  1.51M|static inline void fill_variance_tree(void *data, BLOCK_SIZE bsize) {
  125|  1.51M|  variance_node node;
  126|  1.51M|  memset(&node, 0, sizeof(node));
  127|  1.51M|  tree_to_node(data, bsize, &node);
  128|  1.51M|  sum_2_variances(node.split[0], node.split[1], &node.part_variances->horz[0]);
  129|  1.51M|  sum_2_variances(node.split[2], node.split[3], &node.part_variances->horz[1]);
  130|  1.51M|  sum_2_variances(node.split[0], node.split[2], &node.part_variances->vert[0]);
  131|  1.51M|  sum_2_variances(node.split[1], node.split[3], &node.part_variances->vert[1]);
  132|  1.51M|  sum_2_variances(&node.part_variances->vert[0], &node.part_variances->vert[1],
  133|  1.51M|                  &node.part_variances->none);
  134|  1.51M|}
var_based_part.c:tree_to_node:
   53|  2.47M|                                variance_node *node) {
   54|  2.47M|  node->part_variances = NULL;
   55|  2.47M|  switch (bsize) {
   56|    350|    case BLOCK_128X128: {
  ------------------
  |  Branch (56:5): [True: 350, False: 2.46M]
  ------------------
   57|    350|      VP128x128 *vt = (VP128x128 *)data;
   58|    350|      node->part_variances = &vt->part_variances;
   59|  1.75k|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (59:31): [True: 1.40k, False: 350]
  ------------------
   60|  1.40k|        node->split[split_idx] = &vt->split[split_idx].part_variances.none;
   61|    350|      break;
   62|      0|    }
   63|  58.8k|    case BLOCK_64X64: {
  ------------------
  |  Branch (63:5): [True: 58.8k, False: 2.41M]
  ------------------
   64|  58.8k|      VP64x64 *vt = (VP64x64 *)data;
   65|  58.8k|      node->part_variances = &vt->part_variances;
   66|   294k|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (66:31): [True: 235k, False: 58.8k]
  ------------------
   67|   235k|        node->split[split_idx] = &vt->split[split_idx].part_variances.none;
   68|  58.8k|      break;
   69|      0|    }
   70|   392k|    case BLOCK_32X32: {
  ------------------
  |  Branch (70:5): [True: 392k, False: 2.07M]
  ------------------
   71|   392k|      VP32x32 *vt = (VP32x32 *)data;
   72|   392k|      node->part_variances = &vt->part_variances;
   73|  1.96M|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (73:31): [True: 1.56M, False: 392k]
  ------------------
   74|  1.56M|        node->split[split_idx] = &vt->split[split_idx].part_variances.none;
   75|   392k|      break;
   76|      0|    }
   77|  1.49M|    case BLOCK_16X16: {
  ------------------
  |  Branch (77:5): [True: 1.49M, False: 977k]
  ------------------
   78|  1.49M|      VP16x16 *vt = (VP16x16 *)data;
   79|  1.49M|      node->part_variances = &vt->part_variances;
   80|  7.46M|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (80:31): [True: 5.96M, False: 1.49M]
  ------------------
   81|  5.96M|        node->split[split_idx] = &vt->split[split_idx].part_variances.none;
   82|  1.49M|      break;
   83|      0|    }
   84|   535k|    case BLOCK_8X8: {
  ------------------
  |  Branch (84:5): [True: 535k, False: 1.93M]
  ------------------
   85|   535k|      VP8x8 *vt = (VP8x8 *)data;
   86|   535k|      node->part_variances = &vt->part_variances;
   87|  2.67M|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (87:31): [True: 2.14M, False: 535k]
  ------------------
   88|  2.14M|        node->split[split_idx] = &vt->split[split_idx].part_variances.none;
   89|   535k|      break;
   90|      0|    }
   91|      0|    default: {
  ------------------
  |  Branch (91:5): [True: 0, False: 2.47M]
  ------------------
   92|      0|      VP4x4 *vt = (VP4x4 *)data;
   93|      0|      assert(bsize == BLOCK_4X4);
   94|      0|      node->part_variances = &vt->part_variances;
   95|      0|      for (int split_idx = 0; split_idx < 4; split_idx++)
  ------------------
  |  Branch (95:31): [True: 0, False: 0]
  ------------------
   96|      0|        node->split[split_idx] = &vt->split[split_idx];
   97|      0|      break;
   98|      0|    }
   99|  2.47M|  }
  100|  2.47M|}
var_based_part.c:sum_2_variances:
  118|  7.56M|                                   VPartVar *r) {
  119|       |  assert(a->log2_count == b->log2_count);
  120|  7.56M|  fill_variance(a->sum_square_error + b->sum_square_error,
  121|  7.56M|                a->sum_error + b->sum_error, a->log2_count + 1, r);
  122|  7.56M|}
var_based_part.c:get_variance:
  109|  1.13M|static inline void get_variance(VPartVar *v) {
  110|  1.13M|  const uint32_t square_sum_error =
  111|  1.13M|      (uint32_t)(((int64_t)v->sum_error * v->sum_error) >> v->log2_count);
  112|  1.13M|  const int64_t variance =
  113|  1.13M|      (int64_t)256 * (v->sum_square_error - square_sum_error) >> v->log2_count;
  114|  1.13M|  v->variance = (int)variance;
  115|  1.13M|}
var_based_part.c:set_vt_partitioning:
  153|   959k|                               PART_EVAL_STATUS force_split) {
  154|   959k|  AV1_COMMON *const cm = &cpi->common;
  155|   959k|  variance_node vt;
  156|   959k|  const int block_width = mi_size_wide[bsize];
  157|   959k|  const int block_height = mi_size_high[bsize];
  158|   959k|  int bs_width_check = block_width;
  159|   959k|  int bs_height_check = block_height;
  160|   959k|  int bs_width_vert_check = block_width >> 1;
  161|   959k|  int bs_height_horiz_check = block_height >> 1;
  162|       |  // On the right and bottom boundary we only need to check
  163|       |  // if half the bsize fits, because boundary is extended
  164|       |  // up to 64. So do this check only for sb_size = 64X64.
  165|   960k|  if (cm->seq_params->sb_size == BLOCK_64X64) {
  ------------------
  |  Branch (165:7): [True: 960k, False: 18.4E]
  ------------------
  166|   960k|    if (tile->mi_col_end == cm->mi_params.mi_cols) {
  ------------------
  |  Branch (166:9): [True: 728k, False: 231k]
  ------------------
  167|   728k|      bs_width_check = (block_width >> 1) + 1;
  168|   728k|      bs_width_vert_check = (block_width >> 2) + 1;
  169|   728k|    }
  170|   960k|    if (tile->mi_row_end == cm->mi_params.mi_rows) {
  ------------------
  |  Branch (170:9): [True: 737k, False: 222k]
  ------------------
  171|   737k|      bs_height_check = (block_height >> 1) + 1;
  172|   737k|      bs_height_horiz_check = (block_height >> 2) + 1;
  173|   737k|    }
  174|   960k|  }
  175|       |
  176|   959k|  assert(block_height == block_width);
  177|   959k|  tree_to_node(data, bsize, &vt);
  178|       |
  179|   959k|  if (mi_col + bs_width_check <= tile->mi_col_end &&
  ------------------
  |  Branch (179:7): [True: 467k, False: 492k]
  ------------------
  180|   467k|      mi_row + bs_height_check <= tile->mi_row_end &&
  ------------------
  |  Branch (180:7): [True: 272k, False: 194k]
  ------------------
  181|   272k|      force_split == PART_EVAL_ONLY_NONE) {
  ------------------
  |  Branch (181:7): [True: 0, False: 272k]
  ------------------
  182|      0|    set_block_size(cpi, mi_row, mi_col, bsize);
  183|      0|    return 1;
  184|      0|  }
  185|   959k|  if (force_split == PART_EVAL_ONLY_SPLIT) return 0;
  ------------------
  |  Branch (185:7): [True: 265k, False: 693k]
  ------------------
  186|       |
  187|       |  // For bsize=bsize_min (16x16/8x8 for 8x8/4x4 downsampling), select if
  188|       |  // variance is below threshold, otherwise split will be selected.
  189|       |  // No check for vert/horiz split as too few samples for variance.
  190|   693k|  if (bsize == bsize_min) {
  ------------------
  |  Branch (190:7): [True: 0, False: 693k]
  ------------------
  191|       |    // Variance already computed to set the force_split.
  192|      0|    if (frame_is_intra_only(cm)) get_variance(&vt.part_variances->none);
  ------------------
  |  Branch (192:9): [True: 0, False: 0]
  ------------------
  193|      0|    if (mi_col + bs_width_check <= tile->mi_col_end &&
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|      0|        mi_row + bs_height_check <= tile->mi_row_end &&
  ------------------
  |  Branch (194:9): [True: 0, False: 0]
  ------------------
  195|      0|        vt.part_variances->none.variance < threshold) {
  ------------------
  |  Branch (195:9): [True: 0, False: 0]
  ------------------
  196|      0|      set_block_size(cpi, mi_row, mi_col, bsize);
  197|      0|      return 1;
  198|      0|    }
  199|      0|    return 0;
  200|   696k|  } else if (bsize > bsize_min) {
  ------------------
  |  Branch (200:14): [True: 696k, False: 18.4E]
  ------------------
  201|       |    // Variance already computed to set the force_split.
  202|   696k|    if (frame_is_intra_only(cm)) get_variance(&vt.part_variances->none);
  ------------------
  |  Branch (202:9): [True: 132k, False: 563k]
  ------------------
  203|       |    // For key frame: take split for bsize above 32X32 or very high variance.
  204|   696k|    if (frame_is_intra_only(cm) &&
  ------------------
  |  Branch (204:9): [True: 132k, False: 563k]
  ------------------
  205|   132k|        (bsize > BLOCK_32X32 ||
  ------------------
  |  Branch (205:10): [True: 2.94k, False: 129k]
  ------------------
  206|   129k|         vt.part_variances->none.variance > (threshold << 4))) {
  ------------------
  |  Branch (206:10): [True: 4, False: 129k]
  ------------------
  207|  2.94k|      return 0;
  208|  2.94k|    }
  209|       |    // If variance is low, take the bsize (no split).
  210|   693k|    if (mi_col + bs_width_check <= tile->mi_col_end &&
  ------------------
  |  Branch (210:9): [True: 267k, False: 426k]
  ------------------
  211|   267k|        mi_row + bs_height_check <= tile->mi_row_end &&
  ------------------
  |  Branch (211:9): [True: 109k, False: 158k]
  ------------------
  212|   109k|        vt.part_variances->none.variance < threshold) {
  ------------------
  |  Branch (212:9): [True: 108k, False: 45]
  ------------------
  213|   108k|      set_block_size(cpi, mi_row, mi_col, bsize);
  214|   108k|      return 1;
  215|   108k|    }
  216|       |    // Check vertical split.
  217|   584k|    if (mi_row + bs_height_check <= tile->mi_row_end &&
  ------------------
  |  Branch (217:9): [True: 157k, False: 427k]
  ------------------
  218|   157k|        mi_col + bs_width_vert_check <= tile->mi_col_end) {
  ------------------
  |  Branch (218:9): [True: 16.8k, False: 140k]
  ------------------
  219|  16.8k|      BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_VERT);
  220|  16.8k|      BLOCK_SIZE plane_bsize =
  221|  16.8k|          get_plane_block_size(subsize, xd->plane[AOM_PLANE_U].subsampling_x,
  ------------------
  |  |  282|  16.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  222|  16.8k|                               xd->plane[AOM_PLANE_U].subsampling_y);
  ------------------
  |  |  282|  16.8k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  223|  16.8k|      get_variance(&vt.part_variances->vert[0]);
  224|  16.8k|      get_variance(&vt.part_variances->vert[1]);
  225|  16.8k|      if (vt.part_variances->vert[0].variance < threshold &&
  ------------------
  |  Branch (225:11): [True: 15.9k, False: 915]
  ------------------
  226|  15.9k|          vt.part_variances->vert[1].variance < threshold &&
  ------------------
  |  Branch (226:11): [True: 15.9k, False: 20]
  ------------------
  227|  15.9k|          plane_bsize < BLOCK_INVALID) {
  ------------------
  |  Branch (227:11): [True: 14.0k, False: 1.87k]
  ------------------
  228|  14.0k|        set_block_size(cpi, mi_row, mi_col, subsize);
  229|  14.0k|        set_block_size(cpi, mi_row, mi_col + block_width / 2, subsize);
  230|  14.0k|        return 1;
  231|  14.0k|      }
  232|  16.8k|    }
  233|       |    // Check horizontal split.
  234|   570k|    if (mi_col + bs_width_check <= tile->mi_col_end &&
  ------------------
  |  Branch (234:9): [True: 158k, False: 412k]
  ------------------
  235|   158k|        mi_row + bs_height_horiz_check <= tile->mi_row_end) {
  ------------------
  |  Branch (235:9): [True: 15.7k, False: 142k]
  ------------------
  236|  15.7k|      BLOCK_SIZE subsize = get_partition_subsize(bsize, PARTITION_HORZ);
  237|  15.7k|      BLOCK_SIZE plane_bsize =
  238|  15.7k|          get_plane_block_size(subsize, xd->plane[AOM_PLANE_U].subsampling_x,
  ------------------
  |  |  282|  15.7k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  239|  15.7k|                               xd->plane[AOM_PLANE_U].subsampling_y);
  ------------------
  |  |  282|  15.7k|#define AOM_PLANE_U 1      /**< U (Chroma) plane */
  ------------------
  240|  15.7k|      get_variance(&vt.part_variances->horz[0]);
  241|  15.7k|      get_variance(&vt.part_variances->horz[1]);
  242|  15.7k|      if (vt.part_variances->horz[0].variance < threshold &&
  ------------------
  |  Branch (242:11): [True: 14.8k, False: 887]
  ------------------
  243|  14.8k|          vt.part_variances->horz[1].variance < threshold &&
  ------------------
  |  Branch (243:11): [True: 14.8k, False: 9]
  ------------------
  244|  14.8k|          plane_bsize < BLOCK_INVALID) {
  ------------------
  |  Branch (244:11): [True: 14.8k, False: 0]
  ------------------
  245|  14.8k|        set_block_size(cpi, mi_row, mi_col, subsize);
  246|  14.8k|        set_block_size(cpi, mi_row + block_height / 2, mi_col, subsize);
  247|  14.8k|        return 1;
  248|  14.8k|      }
  249|  15.7k|    }
  250|   555k|    return 0;
  251|   570k|  }
  252|  18.4E|  return 0;
  253|   693k|}
var_based_part.c:set_block_size:
  137|  2.54M|                                  BLOCK_SIZE bsize) {
  138|  2.54M|  if (cpi->common.mi_params.mi_cols > mi_col &&
  ------------------
  |  Branch (138:7): [True: 1.22M, False: 1.32M]
  ------------------
  139|  1.22M|      cpi->common.mi_params.mi_rows > mi_row) {
  ------------------
  |  Branch (139:7): [True: 618k, False: 603k]
  ------------------
  140|   618k|    CommonModeInfoParams *mi_params = &cpi->common.mi_params;
  141|   618k|    const int mi_grid_idx = get_mi_grid_idx(mi_params, mi_row, mi_col);
  142|   618k|    const int mi_alloc_idx = get_alloc_mi_idx(mi_params, mi_row, mi_col);
  143|   618k|    MB_MODE_INFO *mi = mi_params->mi_grid_base[mi_grid_idx] =
  144|   618k|        &mi_params->mi_alloc[mi_alloc_idx];
  145|   618k|    mi->bsize = bsize;
  146|   618k|  }
  147|  2.54M|}
var_based_part.c:set_low_temp_var_flag:
  832|  32.4k|    int mi_col, int mi_row, const bool is_small_sb) {
  833|  32.4k|  AV1_COMMON *const cm = &cpi->common;
  834|       |  // Check temporal variance for bsize >= 16x16, if LAST_FRAME was selected.
  835|       |  // If the temporal variance is small set the flag
  836|       |  // variance_low for the block. The variance threshold can be adjusted, the
  837|       |  // higher the more aggressive.
  838|  32.4k|  if (ref_frame_partition == LAST_FRAME) {
  ------------------
  |  Branch (838:7): [True: 32.4k, False: 0]
  ------------------
  839|  32.4k|    if (is_small_sb)
  ------------------
  |  Branch (839:9): [True: 32.4k, False: 0]
  ------------------
  840|  32.4k|      set_low_temp_var_flag_64x64(&cm->mi_params, part_info, xd,
  841|  32.4k|                                  &(vt->split[0]), thresholds, mi_col, mi_row);
  842|      0|    else
  843|      0|      set_low_temp_var_flag_128x128(&cm->mi_params, part_info, xd, vt,
  844|      0|                                    thresholds, mi_col, mi_row);
  845|  32.4k|  }
  846|  32.4k|}
var_based_part.c:set_low_temp_var_flag_64x64:
  695|  32.4k|                                               int mi_col, int mi_row) {
  696|  32.4k|  if (xd->mi[0]->bsize == BLOCK_64X64) {
  ------------------
  |  Branch (696:7): [True: 1, False: 32.4k]
  ------------------
  697|      1|    if ((vt->part_variances).none.variance < (thresholds[0] >> 1))
  ------------------
  |  Branch (697:9): [True: 0, False: 1]
  ------------------
  698|      0|      part_info->variance_low[0] = 1;
  699|  32.4k|  } else if (xd->mi[0]->bsize == BLOCK_64X32) {
  ------------------
  |  Branch (699:14): [True: 2, False: 32.4k]
  ------------------
  700|      6|    for (int part_idx = 0; part_idx < 2; part_idx++) {
  ------------------
  |  Branch (700:28): [True: 4, False: 2]
  ------------------
  701|      4|      if (vt->part_variances.horz[part_idx].variance < (thresholds[0] >> 2))
  ------------------
  |  Branch (701:11): [True: 2, False: 2]
  ------------------
  702|      2|        part_info->variance_low[part_idx + 1] = 1;
  703|      4|    }
  704|  32.4k|  } else if (xd->mi[0]->bsize == BLOCK_32X64) {
  ------------------
  |  Branch (704:14): [True: 2, False: 32.4k]
  ------------------
  705|      6|    for (int part_idx = 0; part_idx < 2; part_idx++) {
  ------------------
  |  Branch (705:28): [True: 4, False: 2]
  ------------------
  706|      4|      if (vt->part_variances.vert[part_idx].variance < (thresholds[0] >> 2))
  ------------------
  |  Branch (706:11): [True: 2, False: 2]
  ------------------
  707|      2|        part_info->variance_low[part_idx + 3] = 1;
  708|      4|    }
  709|  32.4k|  } else {
  710|  32.4k|    static const int idx[4][2] = { { 0, 0 }, { 0, 8 }, { 8, 0 }, { 8, 8 } };
  711|   162k|    for (int lvl1_idx = 0; lvl1_idx < 4; lvl1_idx++) {
  ------------------
  |  Branch (711:28): [True: 129k, False: 32.4k]
  ------------------
  712|   129k|      const int idx_str = mi_params->mi_stride * (mi_row + idx[lvl1_idx][0]) +
  713|   129k|                          mi_col + idx[lvl1_idx][1];
  714|   129k|      MB_MODE_INFO **this_mi = mi_params->mi_grid_base + idx_str;
  715|       |
  716|   129k|      if (mi_params->mi_cols <= mi_col + idx[lvl1_idx][1] ||
  ------------------
  |  Branch (716:11): [True: 33.6k, False: 96.0k]
  ------------------
  717|  96.0k|          mi_params->mi_rows <= mi_row + idx[lvl1_idx][0])
  ------------------
  |  Branch (717:11): [True: 22.6k, False: 73.4k]
  ------------------
  718|  56.2k|        continue;
  719|       |
  720|  73.4k|      if (*this_mi == NULL) continue;
  ------------------
  |  Branch (720:11): [True: 0, False: 73.4k]
  ------------------
  721|       |
  722|  73.4k|      if ((*this_mi)->bsize == BLOCK_32X32) {
  ------------------
  |  Branch (722:11): [True: 12.6k, False: 60.8k]
  ------------------
  723|  12.6k|        int64_t threshold_32x32 = (5 * thresholds[1]) >> 3;
  724|  12.6k|        if (vt->split[lvl1_idx].part_variances.none.variance < threshold_32x32)
  ------------------
  |  Branch (724:13): [True: 1.47k, False: 11.1k]
  ------------------
  725|  1.47k|          part_info->variance_low[lvl1_idx + 5] = 1;
  726|  60.8k|      } else {
  727|       |        // For 32x16 and 16x32 blocks, the flag is set on each 16x16 block
  728|       |        // inside.
  729|  60.8k|        if ((*this_mi)->bsize == BLOCK_16X16 ||
  ------------------
  |  Branch (729:13): [True: 20.2k, False: 40.5k]
  ------------------
  730|  40.5k|            (*this_mi)->bsize == BLOCK_32X16 ||
  ------------------
  |  Branch (730:13): [True: 1.27k, False: 39.3k]
  ------------------
  731|  39.3k|            (*this_mi)->bsize == BLOCK_16X32) {
  ------------------
  |  Branch (731:13): [True: 1.08k, False: 38.2k]
  ------------------
  732|   113k|          for (int lvl2_idx = 0; lvl2_idx < 4; lvl2_idx++) {
  ------------------
  |  Branch (732:34): [True: 90.5k, False: 22.6k]
  ------------------
  733|  90.5k|            if (vt->split[lvl1_idx]
  ------------------
  |  Branch (733:17): [True: 15.7k, False: 74.7k]
  ------------------
  734|  90.5k|                    .split[lvl2_idx]
  735|  90.5k|                    .part_variances.none.variance < (thresholds[2] >> 8))
  736|  15.7k|              part_info->variance_low[(lvl1_idx << 2) + lvl2_idx + 9] = 1;
  737|  90.5k|          }
  738|  22.6k|        }
  739|  60.8k|      }
  740|  73.4k|    }
  741|  32.4k|  }
  742|  32.4k|}

av1_fdct32_sse4_1:
   15|   204k|                       const int stride) {
   16|   204k|  __m128i buf0[32];
   17|   204k|  __m128i buf1[32];
   18|   204k|  const int32_t *cospi;
   19|       |
   20|   204k|  int startidx = 0 * stride;
   21|   204k|  int endidx = 31 * stride;
   22|       |  // stage 0
   23|       |  // stage 1
   24|   204k|  buf1[0] = _mm_add_epi32(input[startidx], input[endidx]);
   25|   204k|  buf1[31] = _mm_sub_epi32(input[startidx], input[endidx]);
   26|   204k|  startidx += stride;
   27|   204k|  endidx -= stride;
   28|   204k|  buf1[1] = _mm_add_epi32(input[startidx], input[endidx]);
   29|   204k|  buf1[30] = _mm_sub_epi32(input[startidx], input[endidx]);
   30|   204k|  startidx += stride;
   31|   204k|  endidx -= stride;
   32|   204k|  buf1[2] = _mm_add_epi32(input[startidx], input[endidx]);
   33|   204k|  buf1[29] = _mm_sub_epi32(input[startidx], input[endidx]);
   34|   204k|  startidx += stride;
   35|   204k|  endidx -= stride;
   36|   204k|  buf1[3] = _mm_add_epi32(input[startidx], input[endidx]);
   37|   204k|  buf1[28] = _mm_sub_epi32(input[startidx], input[endidx]);
   38|   204k|  startidx += stride;
   39|   204k|  endidx -= stride;
   40|   204k|  buf1[4] = _mm_add_epi32(input[startidx], input[endidx]);
   41|   204k|  buf1[27] = _mm_sub_epi32(input[startidx], input[endidx]);
   42|   204k|  startidx += stride;
   43|   204k|  endidx -= stride;
   44|   204k|  buf1[5] = _mm_add_epi32(input[startidx], input[endidx]);
   45|   204k|  buf1[26] = _mm_sub_epi32(input[startidx], input[endidx]);
   46|   204k|  startidx += stride;
   47|   204k|  endidx -= stride;
   48|   204k|  buf1[6] = _mm_add_epi32(input[startidx], input[endidx]);
   49|   204k|  buf1[25] = _mm_sub_epi32(input[startidx], input[endidx]);
   50|   204k|  startidx += stride;
   51|   204k|  endidx -= stride;
   52|   204k|  buf1[7] = _mm_add_epi32(input[startidx], input[endidx]);
   53|   204k|  buf1[24] = _mm_sub_epi32(input[startidx], input[endidx]);
   54|   204k|  startidx += stride;
   55|   204k|  endidx -= stride;
   56|   204k|  buf1[8] = _mm_add_epi32(input[startidx], input[endidx]);
   57|   204k|  buf1[23] = _mm_sub_epi32(input[startidx], input[endidx]);
   58|   204k|  startidx += stride;
   59|   204k|  endidx -= stride;
   60|   204k|  buf1[9] = _mm_add_epi32(input[startidx], input[endidx]);
   61|   204k|  buf1[22] = _mm_sub_epi32(input[startidx], input[endidx]);
   62|   204k|  startidx += stride;
   63|   204k|  endidx -= stride;
   64|   204k|  buf1[10] = _mm_add_epi32(input[startidx], input[endidx]);
   65|   204k|  buf1[21] = _mm_sub_epi32(input[startidx], input[endidx]);
   66|   204k|  startidx += stride;
   67|   204k|  endidx -= stride;
   68|   204k|  buf1[11] = _mm_add_epi32(input[startidx], input[endidx]);
   69|   204k|  buf1[20] = _mm_sub_epi32(input[startidx], input[endidx]);
   70|   204k|  startidx += stride;
   71|   204k|  endidx -= stride;
   72|   204k|  buf1[12] = _mm_add_epi32(input[startidx], input[endidx]);
   73|   204k|  buf1[19] = _mm_sub_epi32(input[startidx], input[endidx]);
   74|   204k|  startidx += stride;
   75|   204k|  endidx -= stride;
   76|   204k|  buf1[13] = _mm_add_epi32(input[startidx], input[endidx]);
   77|   204k|  buf1[18] = _mm_sub_epi32(input[startidx], input[endidx]);
   78|   204k|  startidx += stride;
   79|   204k|  endidx -= stride;
   80|   204k|  buf1[14] = _mm_add_epi32(input[startidx], input[endidx]);
   81|   204k|  buf1[17] = _mm_sub_epi32(input[startidx], input[endidx]);
   82|   204k|  startidx += stride;
   83|   204k|  endidx -= stride;
   84|   204k|  buf1[15] = _mm_add_epi32(input[startidx], input[endidx]);
   85|   204k|  buf1[16] = _mm_sub_epi32(input[startidx], input[endidx]);
   86|       |
   87|       |  // stage 2
   88|   204k|  cospi = cospi_arr(cos_bit);
   89|   204k|  buf0[0] = _mm_add_epi32(buf1[0], buf1[15]);
   90|   204k|  buf0[15] = _mm_sub_epi32(buf1[0], buf1[15]);
   91|   204k|  buf0[1] = _mm_add_epi32(buf1[1], buf1[14]);
   92|   204k|  buf0[14] = _mm_sub_epi32(buf1[1], buf1[14]);
   93|   204k|  buf0[2] = _mm_add_epi32(buf1[2], buf1[13]);
   94|   204k|  buf0[13] = _mm_sub_epi32(buf1[2], buf1[13]);
   95|   204k|  buf0[3] = _mm_add_epi32(buf1[3], buf1[12]);
   96|   204k|  buf0[12] = _mm_sub_epi32(buf1[3], buf1[12]);
   97|   204k|  buf0[4] = _mm_add_epi32(buf1[4], buf1[11]);
   98|   204k|  buf0[11] = _mm_sub_epi32(buf1[4], buf1[11]);
   99|   204k|  buf0[5] = _mm_add_epi32(buf1[5], buf1[10]);
  100|   204k|  buf0[10] = _mm_sub_epi32(buf1[5], buf1[10]);
  101|   204k|  buf0[6] = _mm_add_epi32(buf1[6], buf1[9]);
  102|   204k|  buf0[9] = _mm_sub_epi32(buf1[6], buf1[9]);
  103|   204k|  buf0[7] = _mm_add_epi32(buf1[7], buf1[8]);
  104|   204k|  buf0[8] = _mm_sub_epi32(buf1[7], buf1[8]);
  105|   204k|  buf0[16] = buf1[16];
  106|   204k|  buf0[17] = buf1[17];
  107|   204k|  buf0[18] = buf1[18];
  108|   204k|  buf0[19] = buf1[19];
  109|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf1[20], buf1[27], buf0[20],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  110|   204k|                      buf0[27], cos_bit);
  111|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  112|   204k|                      buf0[26], cos_bit);
  113|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf1[22], buf1[25], buf0[22],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  114|   204k|                      buf0[25], cos_bit);
  115|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf1[23], buf1[24], buf0[23],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  116|   204k|                      buf0[24], cos_bit);
  117|   204k|  buf0[28] = buf1[28];
  118|   204k|  buf0[29] = buf1[29];
  119|   204k|  buf0[30] = buf1[30];
  120|   204k|  buf0[31] = buf1[31];
  121|       |
  122|       |  // stage 3
  123|   204k|  cospi = cospi_arr(cos_bit);
  124|   204k|  buf1[0] = _mm_add_epi32(buf0[0], buf0[7]);
  125|   204k|  buf1[7] = _mm_sub_epi32(buf0[0], buf0[7]);
  126|   204k|  buf1[1] = _mm_add_epi32(buf0[1], buf0[6]);
  127|   204k|  buf1[6] = _mm_sub_epi32(buf0[1], buf0[6]);
  128|   204k|  buf1[2] = _mm_add_epi32(buf0[2], buf0[5]);
  129|   204k|  buf1[5] = _mm_sub_epi32(buf0[2], buf0[5]);
  130|   204k|  buf1[3] = _mm_add_epi32(buf0[3], buf0[4]);
  131|   204k|  buf1[4] = _mm_sub_epi32(buf0[3], buf0[4]);
  132|   204k|  buf1[8] = buf0[8];
  133|   204k|  buf1[9] = buf0[9];
  134|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf0[10], buf0[13], buf1[10],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  135|   204k|                      buf1[13], cos_bit);
  136|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf0[11], buf0[12], buf1[11],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  137|   204k|                      buf1[12], cos_bit);
  138|   204k|  buf1[14] = buf0[14];
  139|   204k|  buf1[15] = buf0[15];
  140|   204k|  buf1[16] = _mm_add_epi32(buf0[16], buf0[23]);
  141|   204k|  buf1[23] = _mm_sub_epi32(buf0[16], buf0[23]);
  142|   204k|  buf1[17] = _mm_add_epi32(buf0[17], buf0[22]);
  143|   204k|  buf1[22] = _mm_sub_epi32(buf0[17], buf0[22]);
  144|   204k|  buf1[18] = _mm_add_epi32(buf0[18], buf0[21]);
  145|   204k|  buf1[21] = _mm_sub_epi32(buf0[18], buf0[21]);
  146|   204k|  buf1[19] = _mm_add_epi32(buf0[19], buf0[20]);
  147|   204k|  buf1[20] = _mm_sub_epi32(buf0[19], buf0[20]);
  148|   204k|  buf1[24] = _mm_sub_epi32(buf0[31], buf0[24]);
  149|   204k|  buf1[31] = _mm_add_epi32(buf0[31], buf0[24]);
  150|   204k|  buf1[25] = _mm_sub_epi32(buf0[30], buf0[25]);
  151|   204k|  buf1[30] = _mm_add_epi32(buf0[30], buf0[25]);
  152|   204k|  buf1[26] = _mm_sub_epi32(buf0[29], buf0[26]);
  153|   204k|  buf1[29] = _mm_add_epi32(buf0[29], buf0[26]);
  154|   204k|  buf1[27] = _mm_sub_epi32(buf0[28], buf0[27]);
  155|   204k|  buf1[28] = _mm_add_epi32(buf0[28], buf0[27]);
  156|       |
  157|       |  // stage 4
  158|   204k|  cospi = cospi_arr(cos_bit);
  159|   204k|  buf0[0] = _mm_add_epi32(buf1[0], buf1[3]);
  160|   204k|  buf0[3] = _mm_sub_epi32(buf1[0], buf1[3]);
  161|   204k|  buf0[1] = _mm_add_epi32(buf1[1], buf1[2]);
  162|   204k|  buf0[2] = _mm_sub_epi32(buf1[1], buf1[2]);
  163|   204k|  buf0[4] = buf1[4];
  164|   204k|  btf_32_sse4_1_type0(-cospi[32], cospi[32], buf1[5], buf1[6], buf0[5], buf0[6],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  165|   204k|                      cos_bit);
  166|   204k|  buf0[7] = buf1[7];
  167|   204k|  buf0[8] = _mm_add_epi32(buf1[8], buf1[11]);
  168|   204k|  buf0[11] = _mm_sub_epi32(buf1[8], buf1[11]);
  169|   204k|  buf0[9] = _mm_add_epi32(buf1[9], buf1[10]);
  170|   204k|  buf0[10] = _mm_sub_epi32(buf1[9], buf1[10]);
  171|   204k|  buf0[12] = _mm_sub_epi32(buf1[15], buf1[12]);
  172|   204k|  buf0[15] = _mm_add_epi32(buf1[15], buf1[12]);
  173|   204k|  buf0[13] = _mm_sub_epi32(buf1[14], buf1[13]);
  174|   204k|  buf0[14] = _mm_add_epi32(buf1[14], buf1[13]);
  175|   204k|  buf0[16] = buf1[16];
  176|   204k|  buf0[17] = buf1[17];
  177|   204k|  btf_32_sse4_1_type0(-cospi[16], cospi[48], buf1[18], buf1[29], buf0[18],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  178|   204k|                      buf0[29], cos_bit);
  179|   204k|  btf_32_sse4_1_type0(-cospi[16], cospi[48], buf1[19], buf1[28], buf0[19],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  180|   204k|                      buf0[28], cos_bit);
  181|   204k|  btf_32_sse4_1_type0(-cospi[48], -cospi[16], buf1[20], buf1[27], buf0[20],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  182|   204k|                      buf0[27], cos_bit);
  183|   204k|  btf_32_sse4_1_type0(-cospi[48], -cospi[16], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  184|   204k|                      buf0[26], cos_bit);
  185|   204k|  buf0[22] = buf1[22];
  186|   204k|  buf0[23] = buf1[23];
  187|   204k|  buf0[24] = buf1[24];
  188|   204k|  buf0[25] = buf1[25];
  189|   204k|  buf0[30] = buf1[30];
  190|   204k|  buf0[31] = buf1[31];
  191|       |
  192|       |  // stage 5
  193|   204k|  cospi = cospi_arr(cos_bit);
  194|   204k|  btf_32_sse4_1_type0(cospi[32], cospi[32], buf0[0], buf0[1], buf1[0], buf1[1],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  195|   204k|                      cos_bit);
  196|   204k|  btf_32_sse4_1_type1(cospi[48], cospi[16], buf0[2], buf0[3], buf1[2], buf1[3],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  197|   204k|                      cos_bit);
  198|   204k|  buf1[4] = _mm_add_epi32(buf0[4], buf0[5]);
  199|   204k|  buf1[5] = _mm_sub_epi32(buf0[4], buf0[5]);
  200|   204k|  buf1[6] = _mm_sub_epi32(buf0[7], buf0[6]);
  201|   204k|  buf1[7] = _mm_add_epi32(buf0[7], buf0[6]);
  202|   204k|  buf1[8] = buf0[8];
  203|   204k|  btf_32_sse4_1_type0(-cospi[16], cospi[48], buf0[9], buf0[14], buf1[9],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  204|   204k|                      buf1[14], cos_bit);
  205|   204k|  btf_32_sse4_1_type0(-cospi[48], -cospi[16], buf0[10], buf0[13], buf1[10],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  206|   204k|                      buf1[13], cos_bit);
  207|   204k|  buf1[11] = buf0[11];
  208|   204k|  buf1[12] = buf0[12];
  209|   204k|  buf1[15] = buf0[15];
  210|   204k|  buf1[16] = _mm_add_epi32(buf0[16], buf0[19]);
  211|   204k|  buf1[19] = _mm_sub_epi32(buf0[16], buf0[19]);
  212|   204k|  buf1[17] = _mm_add_epi32(buf0[17], buf0[18]);
  213|   204k|  buf1[18] = _mm_sub_epi32(buf0[17], buf0[18]);
  214|   204k|  buf1[20] = _mm_sub_epi32(buf0[23], buf0[20]);
  215|   204k|  buf1[23] = _mm_add_epi32(buf0[23], buf0[20]);
  216|   204k|  buf1[21] = _mm_sub_epi32(buf0[22], buf0[21]);
  217|   204k|  buf1[22] = _mm_add_epi32(buf0[22], buf0[21]);
  218|   204k|  buf1[24] = _mm_add_epi32(buf0[24], buf0[27]);
  219|   204k|  buf1[27] = _mm_sub_epi32(buf0[24], buf0[27]);
  220|   204k|  buf1[25] = _mm_add_epi32(buf0[25], buf0[26]);
  221|   204k|  buf1[26] = _mm_sub_epi32(buf0[25], buf0[26]);
  222|   204k|  buf1[28] = _mm_sub_epi32(buf0[31], buf0[28]);
  223|   204k|  buf1[31] = _mm_add_epi32(buf0[31], buf0[28]);
  224|   204k|  buf1[29] = _mm_sub_epi32(buf0[30], buf0[29]);
  225|   204k|  buf1[30] = _mm_add_epi32(buf0[30], buf0[29]);
  226|       |
  227|       |  // stage 6
  228|   204k|  cospi = cospi_arr(cos_bit);
  229|   204k|  buf0[0] = buf1[0];
  230|   204k|  buf0[1] = buf1[1];
  231|   204k|  buf0[2] = buf1[2];
  232|   204k|  buf0[3] = buf1[3];
  233|   204k|  btf_32_sse4_1_type1(cospi[56], cospi[8], buf1[4], buf1[7], buf0[4], buf0[7],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  234|   204k|                      cos_bit);
  235|   204k|  btf_32_sse4_1_type1(cospi[24], cospi[40], buf1[5], buf1[6], buf0[5], buf0[6],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  236|   204k|                      cos_bit);
  237|   204k|  buf0[8] = _mm_add_epi32(buf1[8], buf1[9]);
  238|   204k|  buf0[9] = _mm_sub_epi32(buf1[8], buf1[9]);
  239|   204k|  buf0[10] = _mm_sub_epi32(buf1[11], buf1[10]);
  240|   204k|  buf0[11] = _mm_add_epi32(buf1[11], buf1[10]);
  241|   204k|  buf0[12] = _mm_add_epi32(buf1[12], buf1[13]);
  242|   204k|  buf0[13] = _mm_sub_epi32(buf1[12], buf1[13]);
  243|   204k|  buf0[14] = _mm_sub_epi32(buf1[15], buf1[14]);
  244|   204k|  buf0[15] = _mm_add_epi32(buf1[15], buf1[14]);
  245|   204k|  buf0[16] = buf1[16];
  246|   204k|  btf_32_sse4_1_type0(-cospi[8], cospi[56], buf1[17], buf1[30], buf0[17],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  247|   204k|                      buf0[30], cos_bit);
  248|   204k|  btf_32_sse4_1_type0(-cospi[56], -cospi[8], buf1[18], buf1[29], buf0[18],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  249|   204k|                      buf0[29], cos_bit);
  250|   204k|  buf0[19] = buf1[19];
  251|   204k|  buf0[20] = buf1[20];
  252|   204k|  btf_32_sse4_1_type0(-cospi[40], cospi[24], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  253|   204k|                      buf0[26], cos_bit);
  254|   204k|  btf_32_sse4_1_type0(-cospi[24], -cospi[40], buf1[22], buf1[25], buf0[22],
  ------------------
  |  |   67|   204k|  do {                                                         \
  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |   78|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  255|   204k|                      buf0[25], cos_bit);
  256|   204k|  buf0[23] = buf1[23];
  257|   204k|  buf0[24] = buf1[24];
  258|   204k|  buf0[27] = buf1[27];
  259|   204k|  buf0[28] = buf1[28];
  260|   204k|  buf0[31] = buf1[31];
  261|       |
  262|       |  // stage 7
  263|   204k|  cospi = cospi_arr(cos_bit);
  264|   204k|  buf1[0] = buf0[0];
  265|   204k|  buf1[1] = buf0[1];
  266|   204k|  buf1[2] = buf0[2];
  267|   204k|  buf1[3] = buf0[3];
  268|   204k|  buf1[4] = buf0[4];
  269|   204k|  buf1[5] = buf0[5];
  270|   204k|  buf1[6] = buf0[6];
  271|   204k|  buf1[7] = buf0[7];
  272|   204k|  btf_32_sse4_1_type1(cospi[60], cospi[4], buf0[8], buf0[15], buf1[8], buf1[15],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  273|   204k|                      cos_bit);
  274|   204k|  btf_32_sse4_1_type1(cospi[28], cospi[36], buf0[9], buf0[14], buf1[9],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  275|   204k|                      buf1[14], cos_bit);
  276|   204k|  btf_32_sse4_1_type1(cospi[44], cospi[20], buf0[10], buf0[13], buf1[10],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  277|   204k|                      buf1[13], cos_bit);
  278|   204k|  btf_32_sse4_1_type1(cospi[12], cospi[52], buf0[11], buf0[12], buf1[11],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  279|   204k|                      buf1[12], cos_bit);
  280|   204k|  buf1[16] = _mm_add_epi32(buf0[16], buf0[17]);
  281|   204k|  buf1[17] = _mm_sub_epi32(buf0[16], buf0[17]);
  282|   204k|  buf1[18] = _mm_sub_epi32(buf0[19], buf0[18]);
  283|   204k|  buf1[19] = _mm_add_epi32(buf0[19], buf0[18]);
  284|   204k|  buf1[20] = _mm_add_epi32(buf0[20], buf0[21]);
  285|   204k|  buf1[21] = _mm_sub_epi32(buf0[20], buf0[21]);
  286|   204k|  buf1[22] = _mm_sub_epi32(buf0[23], buf0[22]);
  287|   204k|  buf1[23] = _mm_add_epi32(buf0[23], buf0[22]);
  288|   204k|  buf1[24] = _mm_add_epi32(buf0[24], buf0[25]);
  289|   204k|  buf1[25] = _mm_sub_epi32(buf0[24], buf0[25]);
  290|   204k|  buf1[26] = _mm_sub_epi32(buf0[27], buf0[26]);
  291|   204k|  buf1[27] = _mm_add_epi32(buf0[27], buf0[26]);
  292|   204k|  buf1[28] = _mm_add_epi32(buf0[28], buf0[29]);
  293|   204k|  buf1[29] = _mm_sub_epi32(buf0[28], buf0[29]);
  294|   204k|  buf1[30] = _mm_sub_epi32(buf0[31], buf0[30]);
  295|   204k|  buf1[31] = _mm_add_epi32(buf0[31], buf0[30]);
  296|       |
  297|       |  // stage 8
  298|   204k|  cospi = cospi_arr(cos_bit);
  299|   204k|  buf0[0] = buf1[0];
  300|   204k|  buf0[1] = buf1[1];
  301|   204k|  buf0[2] = buf1[2];
  302|   204k|  buf0[3] = buf1[3];
  303|   204k|  buf0[4] = buf1[4];
  304|   204k|  buf0[5] = buf1[5];
  305|   204k|  buf0[6] = buf1[6];
  306|   204k|  buf0[7] = buf1[7];
  307|   204k|  buf0[8] = buf1[8];
  308|   204k|  buf0[9] = buf1[9];
  309|   204k|  buf0[10] = buf1[10];
  310|   204k|  buf0[11] = buf1[11];
  311|   204k|  buf0[12] = buf1[12];
  312|   204k|  buf0[13] = buf1[13];
  313|   204k|  buf0[14] = buf1[14];
  314|   204k|  buf0[15] = buf1[15];
  315|   204k|  btf_32_sse4_1_type1(cospi[62], cospi[2], buf1[16], buf1[31], buf0[16],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  316|   204k|                      buf0[31], cos_bit);
  317|   204k|  btf_32_sse4_1_type1(cospi[30], cospi[34], buf1[17], buf1[30], buf0[17],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  318|   204k|                      buf0[30], cos_bit);
  319|   204k|  btf_32_sse4_1_type1(cospi[46], cospi[18], buf1[18], buf1[29], buf0[18],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  320|   204k|                      buf0[29], cos_bit);
  321|   204k|  btf_32_sse4_1_type1(cospi[14], cospi[50], buf1[19], buf1[28], buf0[19],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  322|   204k|                      buf0[28], cos_bit);
  323|   204k|  btf_32_sse4_1_type1(cospi[54], cospi[10], buf1[20], buf1[27], buf0[20],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  324|   204k|                      buf0[27], cos_bit);
  325|   204k|  btf_32_sse4_1_type1(cospi[22], cospi[42], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  326|   204k|                      buf0[26], cos_bit);
  327|   204k|  btf_32_sse4_1_type1(cospi[38], cospi[26], buf1[22], buf1[25], buf0[22],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  328|   204k|                      buf0[25], cos_bit);
  329|   204k|  btf_32_sse4_1_type1(cospi[6], cospi[58], buf1[23], buf1[24], buf0[23],
  ------------------
  |  |   83|   204k|  do {                                                         \
  |  |   84|   204k|    btf_32_sse4_1_type0(w1, w0, in1, in0, out0, out1, bit);    \
  |  |  ------------------
  |  |  |  |   67|   204k|  do {                                                         \
  |  |  |  |   68|   204k|    const __m128i ww0 = _mm_set1_epi32(w0);                    \
  |  |  |  |   69|   204k|    const __m128i ww1 = _mm_set1_epi32(w1);                    \
  |  |  |  |   70|   204k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);          \
  |  |  |  |   71|   204k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);          \
  |  |  |  |   72|   204k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                      \
  |  |  |  |   73|   204k|    out0 = av1_round_shift_32_sse4_1(out0, bit);               \
  |  |  |  |   74|   204k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);          \
  |  |  |  |   75|   204k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);          \
  |  |  |  |   76|   204k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                      \
  |  |  |  |   77|   204k|    out1 = av1_round_shift_32_sse4_1(out1, bit);               \
  |  |  |  |   78|   204k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (78:12): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (85:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
  330|   204k|                      buf0[24], cos_bit);
  331|       |
  332|   204k|  startidx = 0 * stride;
  333|   204k|  endidx = 31 * stride;
  334|       |  // stage 9
  335|   204k|  output[startidx] = buf0[0];
  336|   204k|  output[endidx] = buf0[31];
  337|   204k|  startidx += stride;
  338|   204k|  endidx -= stride;
  339|   204k|  output[startidx] = buf0[16];
  340|   204k|  output[endidx] = buf0[15];
  341|   204k|  startidx += stride;
  342|   204k|  endidx -= stride;
  343|   204k|  output[startidx] = buf0[8];
  344|   204k|  output[endidx] = buf0[23];
  345|   204k|  startidx += stride;
  346|   204k|  endidx -= stride;
  347|   204k|  output[startidx] = buf0[24];
  348|   204k|  output[endidx] = buf0[7];
  349|   204k|  startidx += stride;
  350|   204k|  endidx -= stride;
  351|   204k|  output[startidx] = buf0[4];
  352|   204k|  output[endidx] = buf0[27];
  353|   204k|  startidx += stride;
  354|   204k|  endidx -= stride;
  355|   204k|  output[startidx] = buf0[20];
  356|   204k|  output[endidx] = buf0[11];
  357|   204k|  startidx += stride;
  358|   204k|  endidx -= stride;
  359|   204k|  output[startidx] = buf0[12];
  360|   204k|  output[endidx] = buf0[19];
  361|   204k|  startidx += stride;
  362|   204k|  endidx -= stride;
  363|   204k|  output[startidx] = buf0[28];
  364|   204k|  output[endidx] = buf0[3];
  365|   204k|  startidx += stride;
  366|   204k|  endidx -= stride;
  367|   204k|  output[startidx] = buf0[2];
  368|   204k|  output[endidx] = buf0[29];
  369|   204k|  startidx += stride;
  370|   204k|  endidx -= stride;
  371|   204k|  output[startidx] = buf0[18];
  372|   204k|  output[endidx] = buf0[13];
  373|   204k|  startidx += stride;
  374|   204k|  endidx -= stride;
  375|   204k|  output[startidx] = buf0[10];
  376|   204k|  output[endidx] = buf0[21];
  377|   204k|  startidx += stride;
  378|   204k|  endidx -= stride;
  379|   204k|  output[startidx] = buf0[26];
  380|   204k|  output[endidx] = buf0[5];
  381|   204k|  startidx += stride;
  382|   204k|  endidx -= stride;
  383|   204k|  output[startidx] = buf0[6];
  384|   204k|  output[endidx] = buf0[25];
  385|   204k|  startidx += stride;
  386|   204k|  endidx -= stride;
  387|   204k|  output[startidx] = buf0[22];
  388|   204k|  output[endidx] = buf0[9];
  389|   204k|  startidx += stride;
  390|   204k|  endidx -= stride;
  391|   204k|  output[startidx] = buf0[14];
  392|   204k|  output[endidx] = buf0[17];
  393|   204k|  startidx += stride;
  394|   204k|  endidx -= stride;
  395|   204k|  output[startidx] = buf0[30];
  396|   204k|  output[endidx] = buf0[1];
  397|   204k|}
av1_fdct64_sse4_1:
  400|  25.0k|                       const int instride, const int outstride) {
  401|  25.0k|  const int32_t *cospi = cospi_arr(cos_bit);
  402|  25.0k|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
  403|       |
  404|  25.0k|  __m128i cospi_m32 = _mm_set1_epi32(-cospi[32]);
  405|  25.0k|  __m128i cospi_p32 = _mm_set1_epi32(cospi[32]);
  406|  25.0k|  __m128i cospi_m16 = _mm_set1_epi32(-cospi[16]);
  407|  25.0k|  __m128i cospi_p48 = _mm_set1_epi32(cospi[48]);
  408|  25.0k|  __m128i cospi_m48 = _mm_set1_epi32(-cospi[48]);
  409|  25.0k|  __m128i cospi_p16 = _mm_set1_epi32(cospi[16]);
  410|  25.0k|  __m128i cospi_m08 = _mm_set1_epi32(-cospi[8]);
  411|  25.0k|  __m128i cospi_p56 = _mm_set1_epi32(cospi[56]);
  412|  25.0k|  __m128i cospi_m56 = _mm_set1_epi32(-cospi[56]);
  413|  25.0k|  __m128i cospi_m40 = _mm_set1_epi32(-cospi[40]);
  414|  25.0k|  __m128i cospi_p24 = _mm_set1_epi32(cospi[24]);
  415|  25.0k|  __m128i cospi_m24 = _mm_set1_epi32(-cospi[24]);
  416|  25.0k|  __m128i cospi_p08 = _mm_set1_epi32(cospi[8]);
  417|  25.0k|  __m128i cospi_p40 = _mm_set1_epi32(cospi[40]);
  418|  25.0k|  __m128i cospi_p60 = _mm_set1_epi32(cospi[60]);
  419|  25.0k|  __m128i cospi_p04 = _mm_set1_epi32(cospi[4]);
  420|  25.0k|  __m128i cospi_p28 = _mm_set1_epi32(cospi[28]);
  421|  25.0k|  __m128i cospi_p36 = _mm_set1_epi32(cospi[36]);
  422|  25.0k|  __m128i cospi_p44 = _mm_set1_epi32(cospi[44]);
  423|  25.0k|  __m128i cospi_p20 = _mm_set1_epi32(cospi[20]);
  424|  25.0k|  __m128i cospi_p12 = _mm_set1_epi32(cospi[12]);
  425|  25.0k|  __m128i cospi_p52 = _mm_set1_epi32(cospi[52]);
  426|  25.0k|  __m128i cospi_m04 = _mm_set1_epi32(-cospi[4]);
  427|  25.0k|  __m128i cospi_m60 = _mm_set1_epi32(-cospi[60]);
  428|  25.0k|  __m128i cospi_m36 = _mm_set1_epi32(-cospi[36]);
  429|  25.0k|  __m128i cospi_m28 = _mm_set1_epi32(-cospi[28]);
  430|  25.0k|  __m128i cospi_m20 = _mm_set1_epi32(-cospi[20]);
  431|  25.0k|  __m128i cospi_m44 = _mm_set1_epi32(-cospi[44]);
  432|  25.0k|  __m128i cospi_m52 = _mm_set1_epi32(-cospi[52]);
  433|  25.0k|  __m128i cospi_m12 = _mm_set1_epi32(-cospi[12]);
  434|  25.0k|  __m128i cospi_p62 = _mm_set1_epi32(cospi[62]);
  435|  25.0k|  __m128i cospi_p02 = _mm_set1_epi32(cospi[2]);
  436|  25.0k|  __m128i cospi_p30 = _mm_set1_epi32(cospi[30]);
  437|  25.0k|  __m128i cospi_p34 = _mm_set1_epi32(cospi[34]);
  438|  25.0k|  __m128i cospi_p46 = _mm_set1_epi32(cospi[46]);
  439|  25.0k|  __m128i cospi_p18 = _mm_set1_epi32(cospi[18]);
  440|  25.0k|  __m128i cospi_p14 = _mm_set1_epi32(cospi[14]);
  441|  25.0k|  __m128i cospi_p50 = _mm_set1_epi32(cospi[50]);
  442|  25.0k|  __m128i cospi_p54 = _mm_set1_epi32(cospi[54]);
  443|  25.0k|  __m128i cospi_p10 = _mm_set1_epi32(cospi[10]);
  444|  25.0k|  __m128i cospi_p22 = _mm_set1_epi32(cospi[22]);
  445|  25.0k|  __m128i cospi_p42 = _mm_set1_epi32(cospi[42]);
  446|  25.0k|  __m128i cospi_p38 = _mm_set1_epi32(cospi[38]);
  447|  25.0k|  __m128i cospi_p26 = _mm_set1_epi32(cospi[26]);
  448|  25.0k|  __m128i cospi_p06 = _mm_set1_epi32(cospi[6]);
  449|  25.0k|  __m128i cospi_p58 = _mm_set1_epi32(cospi[58]);
  450|  25.0k|  __m128i cospi_p63 = _mm_set1_epi32(cospi[63]);
  451|  25.0k|  __m128i cospi_p01 = _mm_set1_epi32(cospi[1]);
  452|  25.0k|  __m128i cospi_p31 = _mm_set1_epi32(cospi[31]);
  453|  25.0k|  __m128i cospi_p33 = _mm_set1_epi32(cospi[33]);
  454|  25.0k|  __m128i cospi_p47 = _mm_set1_epi32(cospi[47]);
  455|  25.0k|  __m128i cospi_p17 = _mm_set1_epi32(cospi[17]);
  456|  25.0k|  __m128i cospi_p15 = _mm_set1_epi32(cospi[15]);
  457|  25.0k|  __m128i cospi_p49 = _mm_set1_epi32(cospi[49]);
  458|  25.0k|  __m128i cospi_p55 = _mm_set1_epi32(cospi[55]);
  459|  25.0k|  __m128i cospi_p09 = _mm_set1_epi32(cospi[9]);
  460|  25.0k|  __m128i cospi_p23 = _mm_set1_epi32(cospi[23]);
  461|  25.0k|  __m128i cospi_p41 = _mm_set1_epi32(cospi[41]);
  462|  25.0k|  __m128i cospi_p39 = _mm_set1_epi32(cospi[39]);
  463|  25.0k|  __m128i cospi_p25 = _mm_set1_epi32(cospi[25]);
  464|  25.0k|  __m128i cospi_p07 = _mm_set1_epi32(cospi[7]);
  465|  25.0k|  __m128i cospi_p57 = _mm_set1_epi32(cospi[57]);
  466|  25.0k|  __m128i cospi_p59 = _mm_set1_epi32(cospi[59]);
  467|  25.0k|  __m128i cospi_p05 = _mm_set1_epi32(cospi[5]);
  468|  25.0k|  __m128i cospi_p27 = _mm_set1_epi32(cospi[27]);
  469|  25.0k|  __m128i cospi_p37 = _mm_set1_epi32(cospi[37]);
  470|  25.0k|  __m128i cospi_p43 = _mm_set1_epi32(cospi[43]);
  471|  25.0k|  __m128i cospi_p21 = _mm_set1_epi32(cospi[21]);
  472|  25.0k|  __m128i cospi_p11 = _mm_set1_epi32(cospi[11]);
  473|  25.0k|  __m128i cospi_p53 = _mm_set1_epi32(cospi[53]);
  474|  25.0k|  __m128i cospi_p51 = _mm_set1_epi32(cospi[51]);
  475|  25.0k|  __m128i cospi_p13 = _mm_set1_epi32(cospi[13]);
  476|  25.0k|  __m128i cospi_p19 = _mm_set1_epi32(cospi[19]);
  477|  25.0k|  __m128i cospi_p45 = _mm_set1_epi32(cospi[45]);
  478|  25.0k|  __m128i cospi_p35 = _mm_set1_epi32(cospi[35]);
  479|  25.0k|  __m128i cospi_p29 = _mm_set1_epi32(cospi[29]);
  480|  25.0k|  __m128i cospi_p03 = _mm_set1_epi32(cospi[3]);
  481|  25.0k|  __m128i cospi_p61 = _mm_set1_epi32(cospi[61]);
  482|       |
  483|  25.0k|  int startidx = 0 * instride;
  484|  25.0k|  int endidx = 63 * instride;
  485|       |  // stage 1
  486|  25.0k|  __m128i x1[64];
  487|  25.0k|  x1[0] = _mm_add_epi32(input[startidx], input[endidx]);
  488|  25.0k|  x1[63] = _mm_sub_epi32(input[startidx], input[endidx]);
  489|  25.0k|  startidx += instride;
  490|  25.0k|  endidx -= instride;
  491|  25.0k|  x1[1] = _mm_add_epi32(input[startidx], input[endidx]);
  492|  25.0k|  x1[62] = _mm_sub_epi32(input[startidx], input[endidx]);
  493|  25.0k|  startidx += instride;
  494|  25.0k|  endidx -= instride;
  495|  25.0k|  x1[2] = _mm_add_epi32(input[startidx], input[endidx]);
  496|  25.0k|  x1[61] = _mm_sub_epi32(input[startidx], input[endidx]);
  497|  25.0k|  startidx += instride;
  498|  25.0k|  endidx -= instride;
  499|  25.0k|  x1[3] = _mm_add_epi32(input[startidx], input[endidx]);
  500|  25.0k|  x1[60] = _mm_sub_epi32(input[startidx], input[endidx]);
  501|  25.0k|  startidx += instride;
  502|  25.0k|  endidx -= instride;
  503|  25.0k|  x1[4] = _mm_add_epi32(input[startidx], input[endidx]);
  504|  25.0k|  x1[59] = _mm_sub_epi32(input[startidx], input[endidx]);
  505|  25.0k|  startidx += instride;
  506|  25.0k|  endidx -= instride;
  507|  25.0k|  x1[5] = _mm_add_epi32(input[startidx], input[endidx]);
  508|  25.0k|  x1[58] = _mm_sub_epi32(input[startidx], input[endidx]);
  509|  25.0k|  startidx += instride;
  510|  25.0k|  endidx -= instride;
  511|  25.0k|  x1[6] = _mm_add_epi32(input[startidx], input[endidx]);
  512|  25.0k|  x1[57] = _mm_sub_epi32(input[startidx], input[endidx]);
  513|  25.0k|  startidx += instride;
  514|  25.0k|  endidx -= instride;
  515|  25.0k|  x1[7] = _mm_add_epi32(input[startidx], input[endidx]);
  516|  25.0k|  x1[56] = _mm_sub_epi32(input[startidx], input[endidx]);
  517|  25.0k|  startidx += instride;
  518|  25.0k|  endidx -= instride;
  519|  25.0k|  x1[8] = _mm_add_epi32(input[startidx], input[endidx]);
  520|  25.0k|  x1[55] = _mm_sub_epi32(input[startidx], input[endidx]);
  521|  25.0k|  startidx += instride;
  522|  25.0k|  endidx -= instride;
  523|  25.0k|  x1[9] = _mm_add_epi32(input[startidx], input[endidx]);
  524|  25.0k|  x1[54] = _mm_sub_epi32(input[startidx], input[endidx]);
  525|  25.0k|  startidx += instride;
  526|  25.0k|  endidx -= instride;
  527|  25.0k|  x1[10] = _mm_add_epi32(input[startidx], input[endidx]);
  528|  25.0k|  x1[53] = _mm_sub_epi32(input[startidx], input[endidx]);
  529|  25.0k|  startidx += instride;
  530|  25.0k|  endidx -= instride;
  531|  25.0k|  x1[11] = _mm_add_epi32(input[startidx], input[endidx]);
  532|  25.0k|  x1[52] = _mm_sub_epi32(input[startidx], input[endidx]);
  533|  25.0k|  startidx += instride;
  534|  25.0k|  endidx -= instride;
  535|  25.0k|  x1[12] = _mm_add_epi32(input[startidx], input[endidx]);
  536|  25.0k|  x1[51] = _mm_sub_epi32(input[startidx], input[endidx]);
  537|  25.0k|  startidx += instride;
  538|  25.0k|  endidx -= instride;
  539|  25.0k|  x1[13] = _mm_add_epi32(input[startidx], input[endidx]);
  540|  25.0k|  x1[50] = _mm_sub_epi32(input[startidx], input[endidx]);
  541|  25.0k|  startidx += instride;
  542|  25.0k|  endidx -= instride;
  543|  25.0k|  x1[14] = _mm_add_epi32(input[startidx], input[endidx]);
  544|  25.0k|  x1[49] = _mm_sub_epi32(input[startidx], input[endidx]);
  545|  25.0k|  startidx += instride;
  546|  25.0k|  endidx -= instride;
  547|  25.0k|  x1[15] = _mm_add_epi32(input[startidx], input[endidx]);
  548|  25.0k|  x1[48] = _mm_sub_epi32(input[startidx], input[endidx]);
  549|  25.0k|  startidx += instride;
  550|  25.0k|  endidx -= instride;
  551|  25.0k|  x1[16] = _mm_add_epi32(input[startidx], input[endidx]);
  552|  25.0k|  x1[47] = _mm_sub_epi32(input[startidx], input[endidx]);
  553|  25.0k|  startidx += instride;
  554|  25.0k|  endidx -= instride;
  555|  25.0k|  x1[17] = _mm_add_epi32(input[startidx], input[endidx]);
  556|  25.0k|  x1[46] = _mm_sub_epi32(input[startidx], input[endidx]);
  557|  25.0k|  startidx += instride;
  558|  25.0k|  endidx -= instride;
  559|  25.0k|  x1[18] = _mm_add_epi32(input[startidx], input[endidx]);
  560|  25.0k|  x1[45] = _mm_sub_epi32(input[startidx], input[endidx]);
  561|  25.0k|  startidx += instride;
  562|  25.0k|  endidx -= instride;
  563|  25.0k|  x1[19] = _mm_add_epi32(input[startidx], input[endidx]);
  564|  25.0k|  x1[44] = _mm_sub_epi32(input[startidx], input[endidx]);
  565|  25.0k|  startidx += instride;
  566|  25.0k|  endidx -= instride;
  567|  25.0k|  x1[20] = _mm_add_epi32(input[startidx], input[endidx]);
  568|  25.0k|  x1[43] = _mm_sub_epi32(input[startidx], input[endidx]);
  569|  25.0k|  startidx += instride;
  570|  25.0k|  endidx -= instride;
  571|  25.0k|  x1[21] = _mm_add_epi32(input[startidx], input[endidx]);
  572|  25.0k|  x1[42] = _mm_sub_epi32(input[startidx], input[endidx]);
  573|  25.0k|  startidx += instride;
  574|  25.0k|  endidx -= instride;
  575|  25.0k|  x1[22] = _mm_add_epi32(input[startidx], input[endidx]);
  576|  25.0k|  x1[41] = _mm_sub_epi32(input[startidx], input[endidx]);
  577|  25.0k|  startidx += instride;
  578|  25.0k|  endidx -= instride;
  579|  25.0k|  x1[23] = _mm_add_epi32(input[startidx], input[endidx]);
  580|  25.0k|  x1[40] = _mm_sub_epi32(input[startidx], input[endidx]);
  581|  25.0k|  startidx += instride;
  582|  25.0k|  endidx -= instride;
  583|  25.0k|  x1[24] = _mm_add_epi32(input[startidx], input[endidx]);
  584|  25.0k|  x1[39] = _mm_sub_epi32(input[startidx], input[endidx]);
  585|  25.0k|  startidx += instride;
  586|  25.0k|  endidx -= instride;
  587|  25.0k|  x1[25] = _mm_add_epi32(input[startidx], input[endidx]);
  588|  25.0k|  x1[38] = _mm_sub_epi32(input[startidx], input[endidx]);
  589|  25.0k|  startidx += instride;
  590|  25.0k|  endidx -= instride;
  591|  25.0k|  x1[26] = _mm_add_epi32(input[startidx], input[endidx]);
  592|  25.0k|  x1[37] = _mm_sub_epi32(input[startidx], input[endidx]);
  593|  25.0k|  startidx += instride;
  594|  25.0k|  endidx -= instride;
  595|  25.0k|  x1[27] = _mm_add_epi32(input[startidx], input[endidx]);
  596|  25.0k|  x1[36] = _mm_sub_epi32(input[startidx], input[endidx]);
  597|  25.0k|  startidx += instride;
  598|  25.0k|  endidx -= instride;
  599|  25.0k|  x1[28] = _mm_add_epi32(input[startidx], input[endidx]);
  600|  25.0k|  x1[35] = _mm_sub_epi32(input[startidx], input[endidx]);
  601|  25.0k|  startidx += instride;
  602|  25.0k|  endidx -= instride;
  603|  25.0k|  x1[29] = _mm_add_epi32(input[startidx], input[endidx]);
  604|  25.0k|  x1[34] = _mm_sub_epi32(input[startidx], input[endidx]);
  605|  25.0k|  startidx += instride;
  606|  25.0k|  endidx -= instride;
  607|  25.0k|  x1[30] = _mm_add_epi32(input[startidx], input[endidx]);
  608|  25.0k|  x1[33] = _mm_sub_epi32(input[startidx], input[endidx]);
  609|  25.0k|  startidx += instride;
  610|  25.0k|  endidx -= instride;
  611|  25.0k|  x1[31] = _mm_add_epi32(input[startidx], input[endidx]);
  612|  25.0k|  x1[32] = _mm_sub_epi32(input[startidx], input[endidx]);
  613|       |
  614|       |  // stage 2
  615|  25.0k|  __m128i x2[64];
  616|  25.0k|  x2[0] = _mm_add_epi32(x1[0], x1[31]);
  617|  25.0k|  x2[31] = _mm_sub_epi32(x1[0], x1[31]);
  618|  25.0k|  x2[1] = _mm_add_epi32(x1[1], x1[30]);
  619|  25.0k|  x2[30] = _mm_sub_epi32(x1[1], x1[30]);
  620|  25.0k|  x2[2] = _mm_add_epi32(x1[2], x1[29]);
  621|  25.0k|  x2[29] = _mm_sub_epi32(x1[2], x1[29]);
  622|  25.0k|  x2[3] = _mm_add_epi32(x1[3], x1[28]);
  623|  25.0k|  x2[28] = _mm_sub_epi32(x1[3], x1[28]);
  624|  25.0k|  x2[4] = _mm_add_epi32(x1[4], x1[27]);
  625|  25.0k|  x2[27] = _mm_sub_epi32(x1[4], x1[27]);
  626|  25.0k|  x2[5] = _mm_add_epi32(x1[5], x1[26]);
  627|  25.0k|  x2[26] = _mm_sub_epi32(x1[5], x1[26]);
  628|  25.0k|  x2[6] = _mm_add_epi32(x1[6], x1[25]);
  629|  25.0k|  x2[25] = _mm_sub_epi32(x1[6], x1[25]);
  630|  25.0k|  x2[7] = _mm_add_epi32(x1[7], x1[24]);
  631|  25.0k|  x2[24] = _mm_sub_epi32(x1[7], x1[24]);
  632|  25.0k|  x2[8] = _mm_add_epi32(x1[8], x1[23]);
  633|  25.0k|  x2[23] = _mm_sub_epi32(x1[8], x1[23]);
  634|  25.0k|  x2[9] = _mm_add_epi32(x1[9], x1[22]);
  635|  25.0k|  x2[22] = _mm_sub_epi32(x1[9], x1[22]);
  636|  25.0k|  x2[10] = _mm_add_epi32(x1[10], x1[21]);
  637|  25.0k|  x2[21] = _mm_sub_epi32(x1[10], x1[21]);
  638|  25.0k|  x2[11] = _mm_add_epi32(x1[11], x1[20]);
  639|  25.0k|  x2[20] = _mm_sub_epi32(x1[11], x1[20]);
  640|  25.0k|  x2[12] = _mm_add_epi32(x1[12], x1[19]);
  641|  25.0k|  x2[19] = _mm_sub_epi32(x1[12], x1[19]);
  642|  25.0k|  x2[13] = _mm_add_epi32(x1[13], x1[18]);
  643|  25.0k|  x2[18] = _mm_sub_epi32(x1[13], x1[18]);
  644|  25.0k|  x2[14] = _mm_add_epi32(x1[14], x1[17]);
  645|  25.0k|  x2[17] = _mm_sub_epi32(x1[14], x1[17]);
  646|  25.0k|  x2[15] = _mm_add_epi32(x1[15], x1[16]);
  647|  25.0k|  x2[16] = _mm_sub_epi32(x1[15], x1[16]);
  648|  25.0k|  x2[32] = x1[32];
  649|  25.0k|  x2[33] = x1[33];
  650|  25.0k|  x2[34] = x1[34];
  651|  25.0k|  x2[35] = x1[35];
  652|  25.0k|  x2[36] = x1[36];
  653|  25.0k|  x2[37] = x1[37];
  654|  25.0k|  x2[38] = x1[38];
  655|  25.0k|  x2[39] = x1[39];
  656|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[40], x1[55], x2[40], x2[55],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  657|  25.0k|                          __rounding, cos_bit);
  658|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[41], x1[54], x2[41], x2[54],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  659|  25.0k|                          __rounding, cos_bit);
  660|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[42], x1[53], x2[42], x2[53],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  661|  25.0k|                          __rounding, cos_bit);
  662|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[43], x1[52], x2[43], x2[52],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  663|  25.0k|                          __rounding, cos_bit);
  664|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[44], x1[51], x2[44], x2[51],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  665|  25.0k|                          __rounding, cos_bit);
  666|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[45], x1[50], x2[45], x2[50],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  667|  25.0k|                          __rounding, cos_bit);
  668|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[46], x1[49], x2[46], x2[49],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  669|  25.0k|                          __rounding, cos_bit);
  670|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x1[47], x1[48], x2[47], x2[48],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  671|  25.0k|                          __rounding, cos_bit);
  672|  25.0k|  x2[56] = x1[56];
  673|  25.0k|  x2[57] = x1[57];
  674|  25.0k|  x2[58] = x1[58];
  675|  25.0k|  x2[59] = x1[59];
  676|  25.0k|  x2[60] = x1[60];
  677|  25.0k|  x2[61] = x1[61];
  678|  25.0k|  x2[62] = x1[62];
  679|  25.0k|  x2[63] = x1[63];
  680|       |
  681|       |  // stage 3
  682|  25.0k|  __m128i x3[64];
  683|  25.0k|  x3[0] = _mm_add_epi32(x2[0], x2[15]);
  684|  25.0k|  x3[15] = _mm_sub_epi32(x2[0], x2[15]);
  685|  25.0k|  x3[1] = _mm_add_epi32(x2[1], x2[14]);
  686|  25.0k|  x3[14] = _mm_sub_epi32(x2[1], x2[14]);
  687|  25.0k|  x3[2] = _mm_add_epi32(x2[2], x2[13]);
  688|  25.0k|  x3[13] = _mm_sub_epi32(x2[2], x2[13]);
  689|  25.0k|  x3[3] = _mm_add_epi32(x2[3], x2[12]);
  690|  25.0k|  x3[12] = _mm_sub_epi32(x2[3], x2[12]);
  691|  25.0k|  x3[4] = _mm_add_epi32(x2[4], x2[11]);
  692|  25.0k|  x3[11] = _mm_sub_epi32(x2[4], x2[11]);
  693|  25.0k|  x3[5] = _mm_add_epi32(x2[5], x2[10]);
  694|  25.0k|  x3[10] = _mm_sub_epi32(x2[5], x2[10]);
  695|  25.0k|  x3[6] = _mm_add_epi32(x2[6], x2[9]);
  696|  25.0k|  x3[9] = _mm_sub_epi32(x2[6], x2[9]);
  697|  25.0k|  x3[7] = _mm_add_epi32(x2[7], x2[8]);
  698|  25.0k|  x3[8] = _mm_sub_epi32(x2[7], x2[8]);
  699|  25.0k|  x3[16] = x2[16];
  700|  25.0k|  x3[17] = x2[17];
  701|  25.0k|  x3[18] = x2[18];
  702|  25.0k|  x3[19] = x2[19];
  703|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x2[20], x2[27], x3[20], x3[27],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  704|  25.0k|                          __rounding, cos_bit);
  705|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x2[21], x2[26], x3[21], x3[26],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  706|  25.0k|                          __rounding, cos_bit);
  707|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x2[22], x2[25], x3[22], x3[25],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  708|  25.0k|                          __rounding, cos_bit);
  709|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x2[23], x2[24], x3[23], x3[24],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  710|  25.0k|                          __rounding, cos_bit);
  711|  25.0k|  x3[28] = x2[28];
  712|  25.0k|  x3[29] = x2[29];
  713|  25.0k|  x3[30] = x2[30];
  714|  25.0k|  x3[31] = x2[31];
  715|  25.0k|  x3[32] = _mm_add_epi32(x2[32], x2[47]);
  716|  25.0k|  x3[47] = _mm_sub_epi32(x2[32], x2[47]);
  717|  25.0k|  x3[33] = _mm_add_epi32(x2[33], x2[46]);
  718|  25.0k|  x3[46] = _mm_sub_epi32(x2[33], x2[46]);
  719|  25.0k|  x3[34] = _mm_add_epi32(x2[34], x2[45]);
  720|  25.0k|  x3[45] = _mm_sub_epi32(x2[34], x2[45]);
  721|  25.0k|  x3[35] = _mm_add_epi32(x2[35], x2[44]);
  722|  25.0k|  x3[44] = _mm_sub_epi32(x2[35], x2[44]);
  723|  25.0k|  x3[36] = _mm_add_epi32(x2[36], x2[43]);
  724|  25.0k|  x3[43] = _mm_sub_epi32(x2[36], x2[43]);
  725|  25.0k|  x3[37] = _mm_add_epi32(x2[37], x2[42]);
  726|  25.0k|  x3[42] = _mm_sub_epi32(x2[37], x2[42]);
  727|  25.0k|  x3[38] = _mm_add_epi32(x2[38], x2[41]);
  728|  25.0k|  x3[41] = _mm_sub_epi32(x2[38], x2[41]);
  729|  25.0k|  x3[39] = _mm_add_epi32(x2[39], x2[40]);
  730|  25.0k|  x3[40] = _mm_sub_epi32(x2[39], x2[40]);
  731|  25.0k|  x3[48] = _mm_sub_epi32(x2[63], x2[48]);
  732|  25.0k|  x3[63] = _mm_add_epi32(x2[63], x2[48]);
  733|  25.0k|  x3[49] = _mm_sub_epi32(x2[62], x2[49]);
  734|  25.0k|  x3[62] = _mm_add_epi32(x2[62], x2[49]);
  735|  25.0k|  x3[50] = _mm_sub_epi32(x2[61], x2[50]);
  736|  25.0k|  x3[61] = _mm_add_epi32(x2[61], x2[50]);
  737|  25.0k|  x3[51] = _mm_sub_epi32(x2[60], x2[51]);
  738|  25.0k|  x3[60] = _mm_add_epi32(x2[60], x2[51]);
  739|  25.0k|  x3[52] = _mm_sub_epi32(x2[59], x2[52]);
  740|  25.0k|  x3[59] = _mm_add_epi32(x2[59], x2[52]);
  741|  25.0k|  x3[53] = _mm_sub_epi32(x2[58], x2[53]);
  742|  25.0k|  x3[58] = _mm_add_epi32(x2[58], x2[53]);
  743|  25.0k|  x3[54] = _mm_sub_epi32(x2[57], x2[54]);
  744|  25.0k|  x3[57] = _mm_add_epi32(x2[57], x2[54]);
  745|  25.0k|  x3[55] = _mm_sub_epi32(x2[56], x2[55]);
  746|  25.0k|  x3[56] = _mm_add_epi32(x2[56], x2[55]);
  747|       |
  748|       |  // stage 4
  749|  25.0k|  __m128i x4[64];
  750|  25.0k|  x4[0] = _mm_add_epi32(x3[0], x3[7]);
  751|  25.0k|  x4[7] = _mm_sub_epi32(x3[0], x3[7]);
  752|  25.0k|  x4[1] = _mm_add_epi32(x3[1], x3[6]);
  753|  25.0k|  x4[6] = _mm_sub_epi32(x3[1], x3[6]);
  754|  25.0k|  x4[2] = _mm_add_epi32(x3[2], x3[5]);
  755|  25.0k|  x4[5] = _mm_sub_epi32(x3[2], x3[5]);
  756|  25.0k|  x4[3] = _mm_add_epi32(x3[3], x3[4]);
  757|  25.0k|  x4[4] = _mm_sub_epi32(x3[3], x3[4]);
  758|  25.0k|  x4[8] = x3[8];
  759|  25.0k|  x4[9] = x3[9];
  760|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x3[10], x3[13], x4[10], x4[13],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  761|  25.0k|                          __rounding, cos_bit);
  762|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x3[11], x3[12], x4[11], x4[12],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  763|  25.0k|                          __rounding, cos_bit);
  764|  25.0k|  x4[14] = x3[14];
  765|  25.0k|  x4[15] = x3[15];
  766|  25.0k|  x4[16] = _mm_add_epi32(x3[16], x3[23]);
  767|  25.0k|  x4[23] = _mm_sub_epi32(x3[16], x3[23]);
  768|  25.0k|  x4[17] = _mm_add_epi32(x3[17], x3[22]);
  769|  25.0k|  x4[22] = _mm_sub_epi32(x3[17], x3[22]);
  770|  25.0k|  x4[18] = _mm_add_epi32(x3[18], x3[21]);
  771|  25.0k|  x4[21] = _mm_sub_epi32(x3[18], x3[21]);
  772|  25.0k|  x4[19] = _mm_add_epi32(x3[19], x3[20]);
  773|  25.0k|  x4[20] = _mm_sub_epi32(x3[19], x3[20]);
  774|  25.0k|  x4[24] = _mm_sub_epi32(x3[31], x3[24]);
  775|  25.0k|  x4[31] = _mm_add_epi32(x3[31], x3[24]);
  776|  25.0k|  x4[25] = _mm_sub_epi32(x3[30], x3[25]);
  777|  25.0k|  x4[30] = _mm_add_epi32(x3[30], x3[25]);
  778|  25.0k|  x4[26] = _mm_sub_epi32(x3[29], x3[26]);
  779|  25.0k|  x4[29] = _mm_add_epi32(x3[29], x3[26]);
  780|  25.0k|  x4[27] = _mm_sub_epi32(x3[28], x3[27]);
  781|  25.0k|  x4[28] = _mm_add_epi32(x3[28], x3[27]);
  782|  25.0k|  x4[32] = x3[32];
  783|  25.0k|  x4[33] = x3[33];
  784|  25.0k|  x4[34] = x3[34];
  785|  25.0k|  x4[35] = x3[35];
  786|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x3[36], x3[59], x4[36], x4[59],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  787|  25.0k|                          __rounding, cos_bit);
  788|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x3[37], x3[58], x4[37], x4[58],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  789|  25.0k|                          __rounding, cos_bit);
  790|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x3[38], x3[57], x4[38], x4[57],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  791|  25.0k|                          __rounding, cos_bit);
  792|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x3[39], x3[56], x4[39], x4[56],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  793|  25.0k|                          __rounding, cos_bit);
  794|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x3[40], x3[55], x4[40], x4[55],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  795|  25.0k|                          __rounding, cos_bit);
  796|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x3[41], x3[54], x4[41], x4[54],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  797|  25.0k|                          __rounding, cos_bit);
  798|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x3[42], x3[53], x4[42], x4[53],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  799|  25.0k|                          __rounding, cos_bit);
  800|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x3[43], x3[52], x4[43], x4[52],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  801|  25.0k|                          __rounding, cos_bit);
  802|  25.0k|  x4[44] = x3[44];
  803|  25.0k|  x4[45] = x3[45];
  804|  25.0k|  x4[46] = x3[46];
  805|  25.0k|  x4[47] = x3[47];
  806|  25.0k|  x4[48] = x3[48];
  807|  25.0k|  x4[49] = x3[49];
  808|  25.0k|  x4[50] = x3[50];
  809|  25.0k|  x4[51] = x3[51];
  810|  25.0k|  x4[60] = x3[60];
  811|  25.0k|  x4[61] = x3[61];
  812|  25.0k|  x4[62] = x3[62];
  813|  25.0k|  x4[63] = x3[63];
  814|       |
  815|       |  // stage 5
  816|  25.0k|  __m128i x5[64];
  817|  25.0k|  x5[0] = _mm_add_epi32(x4[0], x4[3]);
  818|  25.0k|  x5[3] = _mm_sub_epi32(x4[0], x4[3]);
  819|  25.0k|  x5[1] = _mm_add_epi32(x4[1], x4[2]);
  820|  25.0k|  x5[2] = _mm_sub_epi32(x4[1], x4[2]);
  821|  25.0k|  x5[4] = x4[4];
  822|  25.0k|  btf_32_type0_sse4_1_new(cospi_m32, cospi_p32, x4[5], x4[6], x5[5], x5[6],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  823|  25.0k|                          __rounding, cos_bit);
  824|  25.0k|  x5[7] = x4[7];
  825|  25.0k|  x5[8] = _mm_add_epi32(x4[8], x4[11]);
  826|  25.0k|  x5[11] = _mm_sub_epi32(x4[8], x4[11]);
  827|  25.0k|  x5[9] = _mm_add_epi32(x4[9], x4[10]);
  828|  25.0k|  x5[10] = _mm_sub_epi32(x4[9], x4[10]);
  829|  25.0k|  x5[12] = _mm_sub_epi32(x4[15], x4[12]);
  830|  25.0k|  x5[15] = _mm_add_epi32(x4[15], x4[12]);
  831|  25.0k|  x5[13] = _mm_sub_epi32(x4[14], x4[13]);
  832|  25.0k|  x5[14] = _mm_add_epi32(x4[14], x4[13]);
  833|  25.0k|  x5[16] = x4[16];
  834|  25.0k|  x5[17] = x4[17];
  835|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x4[18], x4[29], x5[18], x5[29],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  836|  25.0k|                          __rounding, cos_bit);
  837|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x4[19], x4[28], x5[19], x5[28],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  838|  25.0k|                          __rounding, cos_bit);
  839|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x4[20], x4[27], x5[20], x5[27],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  840|  25.0k|                          __rounding, cos_bit);
  841|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x4[21], x4[26], x5[21], x5[26],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  842|  25.0k|                          __rounding, cos_bit);
  843|  25.0k|  x5[22] = x4[22];
  844|  25.0k|  x5[23] = x4[23];
  845|  25.0k|  x5[24] = x4[24];
  846|  25.0k|  x5[25] = x4[25];
  847|  25.0k|  x5[30] = x4[30];
  848|  25.0k|  x5[31] = x4[31];
  849|  25.0k|  x5[32] = _mm_add_epi32(x4[32], x4[39]);
  850|  25.0k|  x5[39] = _mm_sub_epi32(x4[32], x4[39]);
  851|  25.0k|  x5[33] = _mm_add_epi32(x4[33], x4[38]);
  852|  25.0k|  x5[38] = _mm_sub_epi32(x4[33], x4[38]);
  853|  25.0k|  x5[34] = _mm_add_epi32(x4[34], x4[37]);
  854|  25.0k|  x5[37] = _mm_sub_epi32(x4[34], x4[37]);
  855|  25.0k|  x5[35] = _mm_add_epi32(x4[35], x4[36]);
  856|  25.0k|  x5[36] = _mm_sub_epi32(x4[35], x4[36]);
  857|  25.0k|  x5[40] = _mm_sub_epi32(x4[47], x4[40]);
  858|  25.0k|  x5[47] = _mm_add_epi32(x4[47], x4[40]);
  859|  25.0k|  x5[41] = _mm_sub_epi32(x4[46], x4[41]);
  860|  25.0k|  x5[46] = _mm_add_epi32(x4[46], x4[41]);
  861|  25.0k|  x5[42] = _mm_sub_epi32(x4[45], x4[42]);
  862|  25.0k|  x5[45] = _mm_add_epi32(x4[45], x4[42]);
  863|  25.0k|  x5[43] = _mm_sub_epi32(x4[44], x4[43]);
  864|  25.0k|  x5[44] = _mm_add_epi32(x4[44], x4[43]);
  865|  25.0k|  x5[48] = _mm_add_epi32(x4[48], x4[55]);
  866|  25.0k|  x5[55] = _mm_sub_epi32(x4[48], x4[55]);
  867|  25.0k|  x5[49] = _mm_add_epi32(x4[49], x4[54]);
  868|  25.0k|  x5[54] = _mm_sub_epi32(x4[49], x4[54]);
  869|  25.0k|  x5[50] = _mm_add_epi32(x4[50], x4[53]);
  870|  25.0k|  x5[53] = _mm_sub_epi32(x4[50], x4[53]);
  871|  25.0k|  x5[51] = _mm_add_epi32(x4[51], x4[52]);
  872|  25.0k|  x5[52] = _mm_sub_epi32(x4[51], x4[52]);
  873|  25.0k|  x5[56] = _mm_sub_epi32(x4[63], x4[56]);
  874|  25.0k|  x5[63] = _mm_add_epi32(x4[63], x4[56]);
  875|  25.0k|  x5[57] = _mm_sub_epi32(x4[62], x4[57]);
  876|  25.0k|  x5[62] = _mm_add_epi32(x4[62], x4[57]);
  877|  25.0k|  x5[58] = _mm_sub_epi32(x4[61], x4[58]);
  878|  25.0k|  x5[61] = _mm_add_epi32(x4[61], x4[58]);
  879|  25.0k|  x5[59] = _mm_sub_epi32(x4[60], x4[59]);
  880|  25.0k|  x5[60] = _mm_add_epi32(x4[60], x4[59]);
  881|       |
  882|       |  // stage 6
  883|  25.0k|  __m128i x6[64];
  884|  25.0k|  btf_32_type0_sse4_1_new(cospi_p32, cospi_p32, x5[0], x5[1], x6[0], x6[1],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  885|  25.0k|                          __rounding, cos_bit);
  886|  25.0k|  btf_32_type1_sse4_1_new(cospi_p48, cospi_p16, x5[2], x5[3], x6[2], x6[3],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  887|  25.0k|                          __rounding, cos_bit);
  888|  25.0k|  x6[4] = _mm_add_epi32(x5[4], x5[5]);
  889|  25.0k|  x6[5] = _mm_sub_epi32(x5[4], x5[5]);
  890|  25.0k|  x6[6] = _mm_sub_epi32(x5[7], x5[6]);
  891|  25.0k|  x6[7] = _mm_add_epi32(x5[7], x5[6]);
  892|  25.0k|  x6[8] = x5[8];
  893|  25.0k|  btf_32_type0_sse4_1_new(cospi_m16, cospi_p48, x5[9], x5[14], x6[9], x6[14],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  894|  25.0k|                          __rounding, cos_bit);
  895|  25.0k|  btf_32_type0_sse4_1_new(cospi_m48, cospi_m16, x5[10], x5[13], x6[10], x6[13],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  896|  25.0k|                          __rounding, cos_bit);
  897|  25.0k|  x6[11] = x5[11];
  898|  25.0k|  x6[12] = x5[12];
  899|  25.0k|  x6[15] = x5[15];
  900|  25.0k|  x6[16] = _mm_add_epi32(x5[16], x5[19]);
  901|  25.0k|  x6[19] = _mm_sub_epi32(x5[16], x5[19]);
  902|  25.0k|  x6[17] = _mm_add_epi32(x5[17], x5[18]);
  903|  25.0k|  x6[18] = _mm_sub_epi32(x5[17], x5[18]);
  904|  25.0k|  x6[20] = _mm_sub_epi32(x5[23], x5[20]);
  905|  25.0k|  x6[23] = _mm_add_epi32(x5[23], x5[20]);
  906|  25.0k|  x6[21] = _mm_sub_epi32(x5[22], x5[21]);
  907|  25.0k|  x6[22] = _mm_add_epi32(x5[22], x5[21]);
  908|  25.0k|  x6[24] = _mm_add_epi32(x5[24], x5[27]);
  909|  25.0k|  x6[27] = _mm_sub_epi32(x5[24], x5[27]);
  910|  25.0k|  x6[25] = _mm_add_epi32(x5[25], x5[26]);
  911|  25.0k|  x6[26] = _mm_sub_epi32(x5[25], x5[26]);
  912|  25.0k|  x6[28] = _mm_sub_epi32(x5[31], x5[28]);
  913|  25.0k|  x6[31] = _mm_add_epi32(x5[31], x5[28]);
  914|  25.0k|  x6[29] = _mm_sub_epi32(x5[30], x5[29]);
  915|  25.0k|  x6[30] = _mm_add_epi32(x5[30], x5[29]);
  916|  25.0k|  x6[32] = x5[32];
  917|  25.0k|  x6[33] = x5[33];
  918|  25.0k|  btf_32_type0_sse4_1_new(cospi_m08, cospi_p56, x5[34], x5[61], x6[34], x6[61],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  919|  25.0k|                          __rounding, cos_bit);
  920|  25.0k|  btf_32_type0_sse4_1_new(cospi_m08, cospi_p56, x5[35], x5[60], x6[35], x6[60],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  921|  25.0k|                          __rounding, cos_bit);
  922|  25.0k|  btf_32_type0_sse4_1_new(cospi_m56, cospi_m08, x5[36], x5[59], x6[36], x6[59],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  923|  25.0k|                          __rounding, cos_bit);
  924|  25.0k|  btf_32_type0_sse4_1_new(cospi_m56, cospi_m08, x5[37], x5[58], x6[37], x6[58],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  925|  25.0k|                          __rounding, cos_bit);
  926|  25.0k|  x6[38] = x5[38];
  927|  25.0k|  x6[39] = x5[39];
  928|  25.0k|  x6[40] = x5[40];
  929|  25.0k|  x6[41] = x5[41];
  930|  25.0k|  btf_32_type0_sse4_1_new(cospi_m40, cospi_p24, x5[42], x5[53], x6[42], x6[53],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  931|  25.0k|                          __rounding, cos_bit);
  932|  25.0k|  btf_32_type0_sse4_1_new(cospi_m40, cospi_p24, x5[43], x5[52], x6[43], x6[52],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  933|  25.0k|                          __rounding, cos_bit);
  934|  25.0k|  btf_32_type0_sse4_1_new(cospi_m24, cospi_m40, x5[44], x5[51], x6[44], x6[51],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  935|  25.0k|                          __rounding, cos_bit);
  936|  25.0k|  btf_32_type0_sse4_1_new(cospi_m24, cospi_m40, x5[45], x5[50], x6[45], x6[50],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  937|  25.0k|                          __rounding, cos_bit);
  938|  25.0k|  x6[46] = x5[46];
  939|  25.0k|  x6[47] = x5[47];
  940|  25.0k|  x6[48] = x5[48];
  941|  25.0k|  x6[49] = x5[49];
  942|  25.0k|  x6[54] = x5[54];
  943|  25.0k|  x6[55] = x5[55];
  944|  25.0k|  x6[56] = x5[56];
  945|  25.0k|  x6[57] = x5[57];
  946|  25.0k|  x6[62] = x5[62];
  947|  25.0k|  x6[63] = x5[63];
  948|       |
  949|       |  // stage 7
  950|  25.0k|  __m128i x7[64];
  951|  25.0k|  x7[0] = x6[0];
  952|  25.0k|  x7[1] = x6[1];
  953|  25.0k|  x7[2] = x6[2];
  954|  25.0k|  x7[3] = x6[3];
  955|  25.0k|  btf_32_type1_sse4_1_new(cospi_p56, cospi_p08, x6[4], x6[7], x7[4], x7[7],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  956|  25.0k|                          __rounding, cos_bit);
  957|  25.0k|  btf_32_type1_sse4_1_new(cospi_p24, cospi_p40, x6[5], x6[6], x7[5], x7[6],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  958|  25.0k|                          __rounding, cos_bit);
  959|  25.0k|  x7[8] = _mm_add_epi32(x6[8], x6[9]);
  960|  25.0k|  x7[9] = _mm_sub_epi32(x6[8], x6[9]);
  961|  25.0k|  x7[10] = _mm_sub_epi32(x6[11], x6[10]);
  962|  25.0k|  x7[11] = _mm_add_epi32(x6[11], x6[10]);
  963|  25.0k|  x7[12] = _mm_add_epi32(x6[12], x6[13]);
  964|  25.0k|  x7[13] = _mm_sub_epi32(x6[12], x6[13]);
  965|  25.0k|  x7[14] = _mm_sub_epi32(x6[15], x6[14]);
  966|  25.0k|  x7[15] = _mm_add_epi32(x6[15], x6[14]);
  967|  25.0k|  x7[16] = x6[16];
  968|  25.0k|  btf_32_type0_sse4_1_new(cospi_m08, cospi_p56, x6[17], x6[30], x7[17], x7[30],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  969|  25.0k|                          __rounding, cos_bit);
  970|  25.0k|  btf_32_type0_sse4_1_new(cospi_m56, cospi_m08, x6[18], x6[29], x7[18], x7[29],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  971|  25.0k|                          __rounding, cos_bit);
  972|  25.0k|  x7[19] = x6[19];
  973|  25.0k|  x7[20] = x6[20];
  974|  25.0k|  btf_32_type0_sse4_1_new(cospi_m40, cospi_p24, x6[21], x6[26], x7[21], x7[26],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  975|  25.0k|                          __rounding, cos_bit);
  976|  25.0k|  btf_32_type0_sse4_1_new(cospi_m24, cospi_m40, x6[22], x6[25], x7[22], x7[25],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  977|  25.0k|                          __rounding, cos_bit);
  978|  25.0k|  x7[23] = x6[23];
  979|  25.0k|  x7[24] = x6[24];
  980|  25.0k|  x7[27] = x6[27];
  981|  25.0k|  x7[28] = x6[28];
  982|  25.0k|  x7[31] = x6[31];
  983|  25.0k|  x7[32] = _mm_add_epi32(x6[32], x6[35]);
  984|  25.0k|  x7[35] = _mm_sub_epi32(x6[32], x6[35]);
  985|  25.0k|  x7[33] = _mm_add_epi32(x6[33], x6[34]);
  986|  25.0k|  x7[34] = _mm_sub_epi32(x6[33], x6[34]);
  987|  25.0k|  x7[36] = _mm_sub_epi32(x6[39], x6[36]);
  988|  25.0k|  x7[39] = _mm_add_epi32(x6[39], x6[36]);
  989|  25.0k|  x7[37] = _mm_sub_epi32(x6[38], x6[37]);
  990|  25.0k|  x7[38] = _mm_add_epi32(x6[38], x6[37]);
  991|  25.0k|  x7[40] = _mm_add_epi32(x6[40], x6[43]);
  992|  25.0k|  x7[43] = _mm_sub_epi32(x6[40], x6[43]);
  993|  25.0k|  x7[41] = _mm_add_epi32(x6[41], x6[42]);
  994|  25.0k|  x7[42] = _mm_sub_epi32(x6[41], x6[42]);
  995|  25.0k|  x7[44] = _mm_sub_epi32(x6[47], x6[44]);
  996|  25.0k|  x7[47] = _mm_add_epi32(x6[47], x6[44]);
  997|  25.0k|  x7[45] = _mm_sub_epi32(x6[46], x6[45]);
  998|  25.0k|  x7[46] = _mm_add_epi32(x6[46], x6[45]);
  999|  25.0k|  x7[48] = _mm_add_epi32(x6[48], x6[51]);
 1000|  25.0k|  x7[51] = _mm_sub_epi32(x6[48], x6[51]);
 1001|  25.0k|  x7[49] = _mm_add_epi32(x6[49], x6[50]);
 1002|  25.0k|  x7[50] = _mm_sub_epi32(x6[49], x6[50]);
 1003|  25.0k|  x7[52] = _mm_sub_epi32(x6[55], x6[52]);
 1004|  25.0k|  x7[55] = _mm_add_epi32(x6[55], x6[52]);
 1005|  25.0k|  x7[53] = _mm_sub_epi32(x6[54], x6[53]);
 1006|  25.0k|  x7[54] = _mm_add_epi32(x6[54], x6[53]);
 1007|  25.0k|  x7[56] = _mm_add_epi32(x6[56], x6[59]);
 1008|  25.0k|  x7[59] = _mm_sub_epi32(x6[56], x6[59]);
 1009|  25.0k|  x7[57] = _mm_add_epi32(x6[57], x6[58]);
 1010|  25.0k|  x7[58] = _mm_sub_epi32(x6[57], x6[58]);
 1011|  25.0k|  x7[60] = _mm_sub_epi32(x6[63], x6[60]);
 1012|  25.0k|  x7[63] = _mm_add_epi32(x6[63], x6[60]);
 1013|  25.0k|  x7[61] = _mm_sub_epi32(x6[62], x6[61]);
 1014|  25.0k|  x7[62] = _mm_add_epi32(x6[62], x6[61]);
 1015|       |
 1016|       |  // stage 8
 1017|  25.0k|  __m128i x8[64];
 1018|  25.0k|  x8[0] = x7[0];
 1019|  25.0k|  x8[1] = x7[1];
 1020|  25.0k|  x8[2] = x7[2];
 1021|  25.0k|  x8[3] = x7[3];
 1022|  25.0k|  x8[4] = x7[4];
 1023|  25.0k|  x8[5] = x7[5];
 1024|  25.0k|  x8[6] = x7[6];
 1025|  25.0k|  x8[7] = x7[7];
 1026|  25.0k|  btf_32_type1_sse4_1_new(cospi_p60, cospi_p04, x7[8], x7[15], x8[8], x8[15],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1027|  25.0k|                          __rounding, cos_bit);
 1028|  25.0k|  btf_32_type1_sse4_1_new(cospi_p28, cospi_p36, x7[9], x7[14], x8[9], x8[14],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1029|  25.0k|                          __rounding, cos_bit);
 1030|  25.0k|  btf_32_type1_sse4_1_new(cospi_p44, cospi_p20, x7[10], x7[13], x8[10], x8[13],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1031|  25.0k|                          __rounding, cos_bit);
 1032|  25.0k|  btf_32_type1_sse4_1_new(cospi_p12, cospi_p52, x7[11], x7[12], x8[11], x8[12],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1033|  25.0k|                          __rounding, cos_bit);
 1034|  25.0k|  x8[16] = _mm_add_epi32(x7[16], x7[17]);
 1035|  25.0k|  x8[17] = _mm_sub_epi32(x7[16], x7[17]);
 1036|  25.0k|  x8[18] = _mm_sub_epi32(x7[19], x7[18]);
 1037|  25.0k|  x8[19] = _mm_add_epi32(x7[19], x7[18]);
 1038|  25.0k|  x8[20] = _mm_add_epi32(x7[20], x7[21]);
 1039|  25.0k|  x8[21] = _mm_sub_epi32(x7[20], x7[21]);
 1040|  25.0k|  x8[22] = _mm_sub_epi32(x7[23], x7[22]);
 1041|  25.0k|  x8[23] = _mm_add_epi32(x7[23], x7[22]);
 1042|  25.0k|  x8[24] = _mm_add_epi32(x7[24], x7[25]);
 1043|  25.0k|  x8[25] = _mm_sub_epi32(x7[24], x7[25]);
 1044|  25.0k|  x8[26] = _mm_sub_epi32(x7[27], x7[26]);
 1045|  25.0k|  x8[27] = _mm_add_epi32(x7[27], x7[26]);
 1046|  25.0k|  x8[28] = _mm_add_epi32(x7[28], x7[29]);
 1047|  25.0k|  x8[29] = _mm_sub_epi32(x7[28], x7[29]);
 1048|  25.0k|  x8[30] = _mm_sub_epi32(x7[31], x7[30]);
 1049|  25.0k|  x8[31] = _mm_add_epi32(x7[31], x7[30]);
 1050|  25.0k|  x8[32] = x7[32];
 1051|  25.0k|  btf_32_type0_sse4_1_new(cospi_m04, cospi_p60, x7[33], x7[62], x8[33], x8[62],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1052|  25.0k|                          __rounding, cos_bit);
 1053|  25.0k|  btf_32_type0_sse4_1_new(cospi_m60, cospi_m04, x7[34], x7[61], x8[34], x8[61],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1054|  25.0k|                          __rounding, cos_bit);
 1055|  25.0k|  x8[35] = x7[35];
 1056|  25.0k|  x8[36] = x7[36];
 1057|  25.0k|  btf_32_type0_sse4_1_new(cospi_m36, cospi_p28, x7[37], x7[58], x8[37], x8[58],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1058|  25.0k|                          __rounding, cos_bit);
 1059|  25.0k|  btf_32_type0_sse4_1_new(cospi_m28, cospi_m36, x7[38], x7[57], x8[38], x8[57],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1060|  25.0k|                          __rounding, cos_bit);
 1061|  25.0k|  x8[39] = x7[39];
 1062|  25.0k|  x8[40] = x7[40];
 1063|  25.0k|  btf_32_type0_sse4_1_new(cospi_m20, cospi_p44, x7[41], x7[54], x8[41], x8[54],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1064|  25.0k|                          __rounding, cos_bit);
 1065|  25.0k|  btf_32_type0_sse4_1_new(cospi_m44, cospi_m20, x7[42], x7[53], x8[42], x8[53],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1066|  25.0k|                          __rounding, cos_bit);
 1067|  25.0k|  x8[43] = x7[43];
 1068|  25.0k|  x8[44] = x7[44];
 1069|  25.0k|  btf_32_type0_sse4_1_new(cospi_m52, cospi_p12, x7[45], x7[50], x8[45], x8[50],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1070|  25.0k|                          __rounding, cos_bit);
 1071|  25.0k|  btf_32_type0_sse4_1_new(cospi_m12, cospi_m52, x7[46], x7[49], x8[46], x8[49],
  ------------------
  |  |   90|  25.0k|  do {                                                                  \
  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  101|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1072|  25.0k|                          __rounding, cos_bit);
 1073|  25.0k|  x8[47] = x7[47];
 1074|  25.0k|  x8[48] = x7[48];
 1075|  25.0k|  x8[51] = x7[51];
 1076|  25.0k|  x8[52] = x7[52];
 1077|  25.0k|  x8[55] = x7[55];
 1078|  25.0k|  x8[56] = x7[56];
 1079|  25.0k|  x8[59] = x7[59];
 1080|  25.0k|  x8[60] = x7[60];
 1081|  25.0k|  x8[63] = x7[63];
 1082|       |
 1083|       |  // stage 9
 1084|  25.0k|  __m128i x9[64];
 1085|  25.0k|  x9[0] = x8[0];
 1086|  25.0k|  x9[1] = x8[1];
 1087|  25.0k|  x9[2] = x8[2];
 1088|  25.0k|  x9[3] = x8[3];
 1089|  25.0k|  x9[4] = x8[4];
 1090|  25.0k|  x9[5] = x8[5];
 1091|  25.0k|  x9[6] = x8[6];
 1092|  25.0k|  x9[7] = x8[7];
 1093|  25.0k|  x9[8] = x8[8];
 1094|  25.0k|  x9[9] = x8[9];
 1095|  25.0k|  x9[10] = x8[10];
 1096|  25.0k|  x9[11] = x8[11];
 1097|  25.0k|  x9[12] = x8[12];
 1098|  25.0k|  x9[13] = x8[13];
 1099|  25.0k|  x9[14] = x8[14];
 1100|  25.0k|  x9[15] = x8[15];
 1101|  25.0k|  btf_32_type1_sse4_1_new(cospi_p62, cospi_p02, x8[16], x8[31], x9[16], x9[31],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1102|  25.0k|                          __rounding, cos_bit);
 1103|  25.0k|  btf_32_type1_sse4_1_new(cospi_p30, cospi_p34, x8[17], x8[30], x9[17], x9[30],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1104|  25.0k|                          __rounding, cos_bit);
 1105|  25.0k|  btf_32_type1_sse4_1_new(cospi_p46, cospi_p18, x8[18], x8[29], x9[18], x9[29],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1106|  25.0k|                          __rounding, cos_bit);
 1107|  25.0k|  btf_32_type1_sse4_1_new(cospi_p14, cospi_p50, x8[19], x8[28], x9[19], x9[28],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1108|  25.0k|                          __rounding, cos_bit);
 1109|  25.0k|  btf_32_type1_sse4_1_new(cospi_p54, cospi_p10, x8[20], x8[27], x9[20], x9[27],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1110|  25.0k|                          __rounding, cos_bit);
 1111|  25.0k|  btf_32_type1_sse4_1_new(cospi_p22, cospi_p42, x8[21], x8[26], x9[21], x9[26],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1112|  25.0k|                          __rounding, cos_bit);
 1113|  25.0k|  btf_32_type1_sse4_1_new(cospi_p38, cospi_p26, x8[22], x8[25], x9[22], x9[25],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1114|  25.0k|                          __rounding, cos_bit);
 1115|  25.0k|  btf_32_type1_sse4_1_new(cospi_p06, cospi_p58, x8[23], x8[24], x9[23], x9[24],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1116|  25.0k|                          __rounding, cos_bit);
 1117|  25.0k|  x9[32] = _mm_add_epi32(x8[32], x8[33]);
 1118|  25.0k|  x9[33] = _mm_sub_epi32(x8[32], x8[33]);
 1119|  25.0k|  x9[34] = _mm_sub_epi32(x8[35], x8[34]);
 1120|  25.0k|  x9[35] = _mm_add_epi32(x8[35], x8[34]);
 1121|  25.0k|  x9[36] = _mm_add_epi32(x8[36], x8[37]);
 1122|  25.0k|  x9[37] = _mm_sub_epi32(x8[36], x8[37]);
 1123|  25.0k|  x9[38] = _mm_sub_epi32(x8[39], x8[38]);
 1124|  25.0k|  x9[39] = _mm_add_epi32(x8[39], x8[38]);
 1125|  25.0k|  x9[40] = _mm_add_epi32(x8[40], x8[41]);
 1126|  25.0k|  x9[41] = _mm_sub_epi32(x8[40], x8[41]);
 1127|  25.0k|  x9[42] = _mm_sub_epi32(x8[43], x8[42]);
 1128|  25.0k|  x9[43] = _mm_add_epi32(x8[43], x8[42]);
 1129|  25.0k|  x9[44] = _mm_add_epi32(x8[44], x8[45]);
 1130|  25.0k|  x9[45] = _mm_sub_epi32(x8[44], x8[45]);
 1131|  25.0k|  x9[46] = _mm_sub_epi32(x8[47], x8[46]);
 1132|  25.0k|  x9[47] = _mm_add_epi32(x8[47], x8[46]);
 1133|  25.0k|  x9[48] = _mm_add_epi32(x8[48], x8[49]);
 1134|  25.0k|  x9[49] = _mm_sub_epi32(x8[48], x8[49]);
 1135|  25.0k|  x9[50] = _mm_sub_epi32(x8[51], x8[50]);
 1136|  25.0k|  x9[51] = _mm_add_epi32(x8[51], x8[50]);
 1137|  25.0k|  x9[52] = _mm_add_epi32(x8[52], x8[53]);
 1138|  25.0k|  x9[53] = _mm_sub_epi32(x8[52], x8[53]);
 1139|  25.0k|  x9[54] = _mm_sub_epi32(x8[55], x8[54]);
 1140|  25.0k|  x9[55] = _mm_add_epi32(x8[55], x8[54]);
 1141|  25.0k|  x9[56] = _mm_add_epi32(x8[56], x8[57]);
 1142|  25.0k|  x9[57] = _mm_sub_epi32(x8[56], x8[57]);
 1143|  25.0k|  x9[58] = _mm_sub_epi32(x8[59], x8[58]);
 1144|  25.0k|  x9[59] = _mm_add_epi32(x8[59], x8[58]);
 1145|  25.0k|  x9[60] = _mm_add_epi32(x8[60], x8[61]);
 1146|  25.0k|  x9[61] = _mm_sub_epi32(x8[60], x8[61]);
 1147|  25.0k|  x9[62] = _mm_sub_epi32(x8[63], x8[62]);
 1148|  25.0k|  x9[63] = _mm_add_epi32(x8[63], x8[62]);
 1149|       |
 1150|       |  // stage 10
 1151|  25.0k|  __m128i x10[64];
 1152|  25.0k|  x10[0] = x9[0];
 1153|  25.0k|  x10[1] = x9[1];
 1154|  25.0k|  x10[2] = x9[2];
 1155|  25.0k|  x10[3] = x9[3];
 1156|  25.0k|  x10[4] = x9[4];
 1157|  25.0k|  x10[5] = x9[5];
 1158|  25.0k|  x10[6] = x9[6];
 1159|  25.0k|  x10[7] = x9[7];
 1160|  25.0k|  x10[8] = x9[8];
 1161|  25.0k|  x10[9] = x9[9];
 1162|  25.0k|  x10[10] = x9[10];
 1163|  25.0k|  x10[11] = x9[11];
 1164|  25.0k|  x10[12] = x9[12];
 1165|  25.0k|  x10[13] = x9[13];
 1166|  25.0k|  x10[14] = x9[14];
 1167|  25.0k|  x10[15] = x9[15];
 1168|  25.0k|  x10[16] = x9[16];
 1169|  25.0k|  x10[17] = x9[17];
 1170|  25.0k|  x10[18] = x9[18];
 1171|  25.0k|  x10[19] = x9[19];
 1172|  25.0k|  x10[20] = x9[20];
 1173|  25.0k|  x10[21] = x9[21];
 1174|  25.0k|  x10[22] = x9[22];
 1175|  25.0k|  x10[23] = x9[23];
 1176|  25.0k|  x10[24] = x9[24];
 1177|  25.0k|  x10[25] = x9[25];
 1178|  25.0k|  x10[26] = x9[26];
 1179|  25.0k|  x10[27] = x9[27];
 1180|  25.0k|  x10[28] = x9[28];
 1181|  25.0k|  x10[29] = x9[29];
 1182|  25.0k|  x10[30] = x9[30];
 1183|  25.0k|  x10[31] = x9[31];
 1184|  25.0k|  btf_32_type1_sse4_1_new(cospi_p63, cospi_p01, x9[32], x9[63], x10[32],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1185|  25.0k|                          x10[63], __rounding, cos_bit);
 1186|  25.0k|  btf_32_type1_sse4_1_new(cospi_p31, cospi_p33, x9[33], x9[62], x10[33],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1187|  25.0k|                          x10[62], __rounding, cos_bit);
 1188|  25.0k|  btf_32_type1_sse4_1_new(cospi_p47, cospi_p17, x9[34], x9[61], x10[34],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1189|  25.0k|                          x10[61], __rounding, cos_bit);
 1190|  25.0k|  btf_32_type1_sse4_1_new(cospi_p15, cospi_p49, x9[35], x9[60], x10[35],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1191|  25.0k|                          x10[60], __rounding, cos_bit);
 1192|  25.0k|  btf_32_type1_sse4_1_new(cospi_p55, cospi_p09, x9[36], x9[59], x10[36],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1193|  25.0k|                          x10[59], __rounding, cos_bit);
 1194|  25.0k|  btf_32_type1_sse4_1_new(cospi_p23, cospi_p41, x9[37], x9[58], x10[37],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1195|  25.0k|                          x10[58], __rounding, cos_bit);
 1196|  25.0k|  btf_32_type1_sse4_1_new(cospi_p39, cospi_p25, x9[38], x9[57], x10[38],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1197|  25.0k|                          x10[57], __rounding, cos_bit);
 1198|  25.0k|  btf_32_type1_sse4_1_new(cospi_p07, cospi_p57, x9[39], x9[56], x10[39],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1199|  25.0k|                          x10[56], __rounding, cos_bit);
 1200|  25.0k|  btf_32_type1_sse4_1_new(cospi_p59, cospi_p05, x9[40], x9[55], x10[40],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1201|  25.0k|                          x10[55], __rounding, cos_bit);
 1202|  25.0k|  btf_32_type1_sse4_1_new(cospi_p27, cospi_p37, x9[41], x9[54], x10[41],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1203|  25.0k|                          x10[54], __rounding, cos_bit);
 1204|  25.0k|  btf_32_type1_sse4_1_new(cospi_p43, cospi_p21, x9[42], x9[53], x10[42],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1205|  25.0k|                          x10[53], __rounding, cos_bit);
 1206|  25.0k|  btf_32_type1_sse4_1_new(cospi_p11, cospi_p53, x9[43], x9[52], x10[43],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1207|  25.0k|                          x10[52], __rounding, cos_bit);
 1208|  25.0k|  btf_32_type1_sse4_1_new(cospi_p51, cospi_p13, x9[44], x9[51], x10[44],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1209|  25.0k|                          x10[51], __rounding, cos_bit);
 1210|  25.0k|  btf_32_type1_sse4_1_new(cospi_p19, cospi_p45, x9[45], x9[50], x10[45],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1211|  25.0k|                          x10[50], __rounding, cos_bit);
 1212|  25.0k|  btf_32_type1_sse4_1_new(cospi_p35, cospi_p29, x9[46], x9[49], x10[46],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1213|  25.0k|                          x10[49], __rounding, cos_bit);
 1214|  25.0k|  btf_32_type1_sse4_1_new(cospi_p03, cospi_p61, x9[47], x9[48], x10[47],
  ------------------
  |  |  106|  25.0k|  do {                                                                  \
  |  |  107|  25.0k|    btf_32_type0_sse4_1_new(ww1, ww0, in1, in0, out0, out1, r, bit);    \
  |  |  ------------------
  |  |  |  |   90|  25.0k|  do {                                                                  \
  |  |  |  |   91|  25.0k|    const __m128i in0_w0 = _mm_mullo_epi32(in0, ww0);                   \
  |  |  |  |   92|  25.0k|    const __m128i in1_w1 = _mm_mullo_epi32(in1, ww1);                   \
  |  |  |  |   93|  25.0k|    out0 = _mm_add_epi32(in0_w0, in1_w1);                               \
  |  |  |  |   94|  25.0k|    out0 = _mm_add_epi32(out0, r);                                      \
  |  |  |  |   95|  25.0k|    out0 = _mm_srai_epi32(out0, bit);                                   \
  |  |  |  |   96|  25.0k|    const __m128i in0_w1 = _mm_mullo_epi32(in0, ww1);                   \
  |  |  |  |   97|  25.0k|    const __m128i in1_w0 = _mm_mullo_epi32(in1, ww0);                   \
  |  |  |  |   98|  25.0k|    out1 = _mm_sub_epi32(in0_w1, in1_w0);                               \
  |  |  |  |   99|  25.0k|    out1 = _mm_add_epi32(out1, r);                                      \
  |  |  |  |  100|  25.0k|    out1 = _mm_srai_epi32(out1, bit);                                   \
  |  |  |  |  101|  25.0k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:12): [Folded, False: 25.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  108|  25.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (108:12): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 1215|  25.0k|                          x10[48], __rounding, cos_bit);
 1216|       |
 1217|  25.0k|  startidx = 0 * outstride;
 1218|  25.0k|  endidx = 63 * outstride;
 1219|       |  // stage 11
 1220|  25.0k|  output[startidx] = x10[0];
 1221|  25.0k|  output[endidx] = x10[63];
 1222|  25.0k|  startidx += outstride;
 1223|  25.0k|  endidx -= outstride;
 1224|  25.0k|  output[startidx] = x10[32];
 1225|  25.0k|  output[endidx] = x10[31];
 1226|  25.0k|  startidx += outstride;
 1227|  25.0k|  endidx -= outstride;
 1228|  25.0k|  output[startidx] = x10[16];
 1229|  25.0k|  output[endidx] = x10[47];
 1230|  25.0k|  startidx += outstride;
 1231|  25.0k|  endidx -= outstride;
 1232|  25.0k|  output[startidx] = x10[48];
 1233|  25.0k|  output[endidx] = x10[15];
 1234|  25.0k|  startidx += outstride;
 1235|  25.0k|  endidx -= outstride;
 1236|  25.0k|  output[startidx] = x10[8];
 1237|  25.0k|  output[endidx] = x10[55];
 1238|  25.0k|  startidx += outstride;
 1239|  25.0k|  endidx -= outstride;
 1240|  25.0k|  output[startidx] = x10[40];
 1241|  25.0k|  output[endidx] = x10[23];
 1242|  25.0k|  startidx += outstride;
 1243|  25.0k|  endidx -= outstride;
 1244|  25.0k|  output[startidx] = x10[24];
 1245|  25.0k|  output[endidx] = x10[39];
 1246|  25.0k|  startidx += outstride;
 1247|  25.0k|  endidx -= outstride;
 1248|  25.0k|  output[startidx] = x10[56];
 1249|  25.0k|  output[endidx] = x10[7];
 1250|  25.0k|  startidx += outstride;
 1251|  25.0k|  endidx -= outstride;
 1252|  25.0k|  output[startidx] = x10[4];
 1253|  25.0k|  output[endidx] = x10[59];
 1254|  25.0k|  startidx += outstride;
 1255|  25.0k|  endidx -= outstride;
 1256|  25.0k|  output[startidx] = x10[36];
 1257|  25.0k|  output[endidx] = x10[27];
 1258|  25.0k|  startidx += outstride;
 1259|  25.0k|  endidx -= outstride;
 1260|  25.0k|  output[startidx] = x10[20];
 1261|  25.0k|  output[endidx] = x10[43];
 1262|  25.0k|  startidx += outstride;
 1263|  25.0k|  endidx -= outstride;
 1264|  25.0k|  output[startidx] = x10[52];
 1265|  25.0k|  output[endidx] = x10[11];
 1266|  25.0k|  startidx += outstride;
 1267|  25.0k|  endidx -= outstride;
 1268|  25.0k|  output[startidx] = x10[12];
 1269|  25.0k|  output[endidx] = x10[51];
 1270|  25.0k|  startidx += outstride;
 1271|  25.0k|  endidx -= outstride;
 1272|  25.0k|  output[startidx] = x10[44];
 1273|  25.0k|  output[endidx] = x10[19];
 1274|  25.0k|  startidx += outstride;
 1275|  25.0k|  endidx -= outstride;
 1276|  25.0k|  output[startidx] = x10[28];
 1277|  25.0k|  output[endidx] = x10[35];
 1278|  25.0k|  startidx += outstride;
 1279|  25.0k|  endidx -= outstride;
 1280|  25.0k|  output[startidx] = x10[60];
 1281|  25.0k|  output[endidx] = x10[3];
 1282|  25.0k|  startidx += outstride;
 1283|  25.0k|  endidx -= outstride;
 1284|  25.0k|  output[startidx] = x10[2];
 1285|  25.0k|  output[endidx] = x10[61];
 1286|  25.0k|  startidx += outstride;
 1287|  25.0k|  endidx -= outstride;
 1288|  25.0k|  output[startidx] = x10[34];
 1289|  25.0k|  output[endidx] = x10[29];
 1290|  25.0k|  startidx += outstride;
 1291|  25.0k|  endidx -= outstride;
 1292|  25.0k|  output[startidx] = x10[18];
 1293|  25.0k|  output[endidx] = x10[45];
 1294|  25.0k|  startidx += outstride;
 1295|  25.0k|  endidx -= outstride;
 1296|  25.0k|  output[startidx] = x10[50];
 1297|  25.0k|  output[endidx] = x10[13];
 1298|  25.0k|  startidx += outstride;
 1299|  25.0k|  endidx -= outstride;
 1300|  25.0k|  output[startidx] = x10[10];
 1301|  25.0k|  output[endidx] = x10[53];
 1302|  25.0k|  startidx += outstride;
 1303|  25.0k|  endidx -= outstride;
 1304|  25.0k|  output[startidx] = x10[42];
 1305|  25.0k|  output[endidx] = x10[21];
 1306|  25.0k|  startidx += outstride;
 1307|  25.0k|  endidx -= outstride;
 1308|  25.0k|  output[startidx] = x10[26];
 1309|  25.0k|  output[endidx] = x10[37];
 1310|  25.0k|  startidx += outstride;
 1311|  25.0k|  endidx -= outstride;
 1312|  25.0k|  output[startidx] = x10[58];
 1313|  25.0k|  output[endidx] = x10[5];
 1314|  25.0k|  startidx += outstride;
 1315|  25.0k|  endidx -= outstride;
 1316|  25.0k|  output[startidx] = x10[6];
 1317|  25.0k|  output[endidx] = x10[57];
 1318|  25.0k|  startidx += outstride;
 1319|  25.0k|  endidx -= outstride;
 1320|  25.0k|  output[startidx] = x10[38];
 1321|  25.0k|  output[endidx] = x10[25];
 1322|  25.0k|  startidx += outstride;
 1323|  25.0k|  endidx -= outstride;
 1324|  25.0k|  output[startidx] = x10[22];
 1325|  25.0k|  output[endidx] = x10[41];
 1326|  25.0k|  startidx += outstride;
 1327|  25.0k|  endidx -= outstride;
 1328|  25.0k|  output[startidx] = x10[54];
 1329|  25.0k|  output[endidx] = x10[9];
 1330|  25.0k|  startidx += outstride;
 1331|  25.0k|  endidx -= outstride;
 1332|  25.0k|  output[startidx] = x10[14];
 1333|  25.0k|  output[endidx] = x10[49];
 1334|  25.0k|  startidx += outstride;
 1335|  25.0k|  endidx -= outstride;
 1336|  25.0k|  output[startidx] = x10[46];
 1337|  25.0k|  output[endidx] = x10[17];
 1338|  25.0k|  startidx += outstride;
 1339|  25.0k|  endidx -= outstride;
 1340|  25.0k|  output[startidx] = x10[30];
 1341|  25.0k|  output[endidx] = x10[33];
 1342|  25.0k|  startidx += outstride;
 1343|  25.0k|  endidx -= outstride;
 1344|  25.0k|  output[startidx] = x10[62];
 1345|  25.0k|  output[endidx] = x10[1];
 1346|  25.0k|}
av1_idtx32_sse4_1:
 1349|    792|                       const int col_num) {
 1350|    792|  (void)cos_bit;
 1351|  26.1k|  for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (1351:19): [True: 25.3k, False: 792]
  ------------------
 1352|  25.3k|    output[i * col_num] = _mm_slli_epi32(input[i * col_num], 2);
 1353|  25.3k|  }
 1354|    792|}

av1_lowbd_fwd_txfm_avx2:
 3002|  96.2M|                             int diff_stride, TxfmParam *txfm_param) {
 3003|  96.2M|  FwdTxfm2dFunc fwd_txfm2d_func = fwd_txfm2d_func_ls[txfm_param->tx_size];
 3004|  96.2M|  if (txfm_param->lossless && txfm_param->tx_size == TX_4X4) {
  ------------------
  |  Branch (3004:7): [True: 4.04M, False: 92.2M]
  |  Branch (3004:31): [True: 4.04M, False: 18.4E]
  ------------------
 3005|  4.03M|    av1_lowbd_fwd_txfm_c(src_diff, coeff, diff_stride, txfm_param);
 3006|  92.2M|  } else {
 3007|  92.2M|    fwd_txfm2d_func(src_diff, coeff, diff_stride, txfm_param->tx_type,
 3008|  92.2M|                    txfm_param->bd);
 3009|  92.2M|  }
 3010|  96.2M|}
av1_fwd_txfm2d_avx2.c:av1_lowbd_fwd_txfm2d_8x8_avx2:
 1774|  42.2M|                                          int stride, TX_TYPE tx_type, int bd) {
 1775|  42.2M|  (void)bd;
 1776|  42.2M|  __m128i buf0[8], buf1[8], *buf;
 1777|  42.2M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_8X8];
 1778|  42.2M|  const int txw_idx = get_txw_idx(TX_8X8);
 1779|  42.2M|  const int txh_idx = get_txh_idx(TX_8X8);
 1780|  42.2M|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1781|  42.2M|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1782|  42.2M|  const transform_1d_sse2 col_txfm = col_txfm8x8_arr[tx_type];
 1783|  42.2M|  const transform_1d_sse2 row_txfm = row_txfm8x8_arr[tx_type];
 1784|  42.2M|  int ud_flip, lr_flip;
 1785|       |
 1786|  42.2M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1787|       |  // Condition to check shift bit is avoided while round shifting, by assuming
 1788|       |  // that shift[0] will always be positive.
 1789|  42.2M|  assert(shift[0] > 0);
 1790|  42.2M|  if (ud_flip)
  ------------------
  |  Branch (1790:7): [True: 210k, False: 42.0M]
  ------------------
 1791|   210k|    load_buffer_and_flip_round_shift(input, stride, buf0, shift[0]);
 1792|  42.0M|  else
 1793|  42.0M|    load_buffer_and_round_shift(input, stride, buf0, shift[0]);
 1794|       |
 1795|  42.2M|  col_txfm(buf0, buf0, cos_bit_col);
 1796|       |  // Condition to check shift bit is avoided while round shifting, by assuming
 1797|       |  // that shift[1] will always be negative.
 1798|  42.2M|  assert(shift[1] < 0);
 1799|       |
 1800|  42.2M|  if (lr_flip) {
  ------------------
  |  Branch (1800:7): [True: 296k, False: 41.9M]
  ------------------
 1801|   296k|    transpose_round_shift_flip_8x8(buf0, buf1, shift[1]);
 1802|  41.9M|  } else {
 1803|  41.9M|    transpose_round_shift_8x8(buf0, buf1, shift[1]);
 1804|  41.9M|  }
 1805|       |
 1806|  42.2M|  buf = buf1;
 1807|  42.2M|  row_txfm(buf, buf, cos_bit_row);
 1808|       |
 1809|       |  // Round and shift operation is avoided here as the shift bit is assumed to be
 1810|       |  // zero always.
 1811|       |  assert(shift[2] == 0);
 1812|  42.2M|  store_buffer_16bit_to_32bit_w8_avx2(buf, output, 8, 8);
 1813|  42.2M|}
av1_fwd_txfm2d_avx2.c:load_buffer_and_flip_round_shift:
 1618|   210k|                                                    int bit) {
 1619|   210k|  out[7] = load_16bit_to_16bit(in + 0 * stride);
 1620|   210k|  out[6] = load_16bit_to_16bit(in + 1 * stride);
 1621|   210k|  out[5] = load_16bit_to_16bit(in + 2 * stride);
 1622|   210k|  out[4] = load_16bit_to_16bit(in + 3 * stride);
 1623|   210k|  out[3] = load_16bit_to_16bit(in + 4 * stride);
 1624|   210k|  out[2] = load_16bit_to_16bit(in + 5 * stride);
 1625|   210k|  out[1] = load_16bit_to_16bit(in + 6 * stride);
 1626|   210k|  out[0] = load_16bit_to_16bit(in + 7 * stride);
 1627|   210k|  out[7] = _mm_slli_epi16(out[7], bit);
 1628|   210k|  out[6] = _mm_slli_epi16(out[6], bit);
 1629|   210k|  out[5] = _mm_slli_epi16(out[5], bit);
 1630|   210k|  out[4] = _mm_slli_epi16(out[4], bit);
 1631|   210k|  out[3] = _mm_slli_epi16(out[3], bit);
 1632|   210k|  out[2] = _mm_slli_epi16(out[2], bit);
 1633|   210k|  out[1] = _mm_slli_epi16(out[1], bit);
 1634|   210k|  out[0] = _mm_slli_epi16(out[0], bit);
 1635|   210k|}
av1_fwd_txfm2d_avx2.c:load_buffer_and_round_shift:
 1597|  42.0M|                                               __m128i *out, int bit) {
 1598|  42.0M|  out[0] = _mm_load_si128((const __m128i *)(in + 0 * stride));
 1599|  42.0M|  out[1] = _mm_load_si128((const __m128i *)(in + 1 * stride));
 1600|  42.0M|  out[2] = _mm_load_si128((const __m128i *)(in + 2 * stride));
 1601|  42.0M|  out[3] = _mm_load_si128((const __m128i *)(in + 3 * stride));
 1602|  42.0M|  out[4] = _mm_load_si128((const __m128i *)(in + 4 * stride));
 1603|  42.0M|  out[5] = _mm_load_si128((const __m128i *)(in + 5 * stride));
 1604|  42.0M|  out[6] = _mm_load_si128((const __m128i *)(in + 6 * stride));
 1605|  42.0M|  out[7] = _mm_load_si128((const __m128i *)(in + 7 * stride));
 1606|  42.0M|  out[0] = _mm_slli_epi16(out[0], bit);
 1607|  42.0M|  out[1] = _mm_slli_epi16(out[1], bit);
 1608|  42.0M|  out[2] = _mm_slli_epi16(out[2], bit);
 1609|  42.0M|  out[3] = _mm_slli_epi16(out[3], bit);
 1610|  42.0M|  out[4] = _mm_slli_epi16(out[4], bit);
 1611|  42.0M|  out[5] = _mm_slli_epi16(out[5], bit);
 1612|  42.0M|  out[6] = _mm_slli_epi16(out[6], bit);
 1613|  42.0M|  out[7] = _mm_slli_epi16(out[7], bit);
 1614|  42.0M|}
av1_fwd_txfm2d_avx2.c:transpose_round_shift_flip_8x8:
 1667|   296k|                                                  __m128i *const out, int bit) {
 1668|   296k|  __m256i c0, c1, c2, c3;
 1669|   296k|  bit = -bit;
 1670|   296k|  const __m256i rounding = _mm256_set1_epi16(1 << (bit - 1));
 1671|   296k|  const __m256i s04 =
 1672|   296k|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[0]), in[4], 0x1);
 1673|   296k|  const __m256i s15 =
 1674|   296k|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[1]), in[5], 0x1);
 1675|   296k|  const __m256i s26 =
 1676|   296k|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[2]), in[6], 0x1);
 1677|   296k|  const __m256i s37 =
 1678|   296k|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[3]), in[7], 0x1);
 1679|       |
 1680|   296k|  const __m256i a0 = _mm256_adds_epi16(s04, rounding);
 1681|   296k|  const __m256i a1 = _mm256_adds_epi16(s15, rounding);
 1682|   296k|  const __m256i a2 = _mm256_adds_epi16(s26, rounding);
 1683|   296k|  const __m256i a3 = _mm256_adds_epi16(s37, rounding);
 1684|       |
 1685|       |  // b0: 00 01 02 03  04 05 06 07 | 40 41 42 43  44 45 46 47
 1686|       |  // b1: 10 11 12 13  14 15 16 17 | 50 51 52 53  54 55 56 57
 1687|       |  // b2: 20 21 22 23  24 25 26 27 | 60 61 62 63  64 65 66 67
 1688|       |  // b3: 30 31 32 33  34 35 36 37 | 70 71 72 73  74 75 76 77
 1689|   296k|  const __m256i b0 = _mm256_srai_epi16(a0, bit);
 1690|   296k|  const __m256i b1 = _mm256_srai_epi16(a1, bit);
 1691|   296k|  const __m256i b2 = _mm256_srai_epi16(a2, bit);
 1692|   296k|  const __m256i b3 = _mm256_srai_epi16(a3, bit);
 1693|       |
 1694|   296k|  TRANSPOSE_8X8_AVX2()
  ------------------
  |  | 1638|   296k|  {                                                                  \
  |  | 1639|   296k|    /* aa0:    00 10 01 11  02 12 03 13 | 40 50 41 51  42 52 43 53*/ \
  |  | 1640|   296k|    /* aa1:    04 14 05 15  06 16 07 17 | 44 54 45 55  46 56 47 57*/ \
  |  | 1641|   296k|    /* aa2:    20 30 21 31  22 32 23 33 | 60 70 61 71  62 72 63 73*/ \
  |  | 1642|   296k|    /* aa3:    24 34 25 35  26 36 27 37 | 64 74 65 75  66 76 67 77*/ \
  |  | 1643|   296k|    const __m256i aa0 = _mm256_unpacklo_epi16(b0, b1);               \
  |  | 1644|   296k|    const __m256i aa1 = _mm256_unpackhi_epi16(b0, b1);               \
  |  | 1645|   296k|    const __m256i aa2 = _mm256_unpacklo_epi16(b2, b3);               \
  |  | 1646|   296k|    const __m256i aa3 = _mm256_unpackhi_epi16(b2, b3);               \
  |  | 1647|   296k|    /* Unpack 32 bit elements resulting in: */                       \
  |  | 1648|   296k|    /* bb0: 00 10 20 30  01 11 21 31 | 40 50 60 70  41 51 61 71*/    \
  |  | 1649|   296k|    /* bb1: 02 12 22 32  03 13 23 33 | 42 52 62 72  43 53 63 73*/    \
  |  | 1650|   296k|    /* bb2: 04 14 24 34  05 15 25 35 | 44 54 64 74  45 55 65 75*/    \
  |  | 1651|   296k|    /* bb2: 06 16 26 36  07 17 27 37 | 46 56 66 76  47 57 67 77*/    \
  |  | 1652|   296k|    const __m256i bb0 = _mm256_unpacklo_epi32(aa0, aa2);             \
  |  | 1653|   296k|    const __m256i bb1 = _mm256_unpackhi_epi32(aa0, aa2);             \
  |  | 1654|   296k|    const __m256i bb2 = _mm256_unpacklo_epi32(aa1, aa3);             \
  |  | 1655|   296k|    const __m256i bb3 = _mm256_unpackhi_epi32(aa1, aa3);             \
  |  | 1656|   296k|    /* bb0: 00 10 20 30 40 50 60 70| 01 11 21 31 41 51 61 71*/       \
  |  | 1657|   296k|    /* bb1: 02 12 22 32 42 52 62 72| 03 13 23 33 43 53 63 73*/       \
  |  | 1658|   296k|    /* bb2: 04 14 24 34 44 54 64 74| 05 15 25 35 45 55 65 75*/       \
  |  | 1659|   296k|    /* bb2: 06 16 26 36 46 56 66 76| 07 17 27 37 47 57 67 77*/       \
  |  | 1660|   296k|    c0 = _mm256_permute4x64_epi64(bb0, 0xd8);                        \
  |  | 1661|   296k|    c1 = _mm256_permute4x64_epi64(bb1, 0xd8);                        \
  |  | 1662|   296k|    c2 = _mm256_permute4x64_epi64(bb2, 0xd8);                        \
  |  | 1663|   296k|    c3 = _mm256_permute4x64_epi64(bb3, 0xd8);                        \
  |  | 1664|   296k|  }
  ------------------
 1695|       |
 1696|       |  // Unpack 64 bit elements resulting in:
 1697|       |  // out[7]: 00 10 20 30  40 50 60 70
 1698|       |  // out[6]: 01 11 21 31  41 51 61 71
 1699|       |  // out[5]: 02 12 22 32  42 52 62 72
 1700|       |  // out[4]: 03 13 23 33  43 53 63 73
 1701|       |  // out[3]: 04 14 24 34  44 54 64 74
 1702|       |  // out[2]: 05 15 25 35  45 55 65 75
 1703|       |  // out[1]: 06 16 26 36  46 56 66 76
 1704|       |  // out[0]: 07 17 27 37  47 57 67 77
 1705|   296k|  out[7] = _mm256_castsi256_si128(c0);
 1706|   296k|  out[6] = _mm256_extractf128_si256(c0, 1);
 1707|   296k|  out[5] = _mm256_castsi256_si128(c1);
 1708|   296k|  out[4] = _mm256_extractf128_si256(c1, 1);
 1709|   296k|  out[3] = _mm256_castsi256_si128(c2);
 1710|   296k|  out[2] = _mm256_extractf128_si256(c2, 1);
 1711|   296k|  out[1] = _mm256_castsi256_si128(c3);
 1712|       |  out[0] = _mm256_extractf128_si256(c3, 1);
 1713|   296k|}
av1_fwd_txfm2d_avx2.c:transpose_round_shift_8x8:
 1716|  42.2M|                                             __m128i *const out, int bit) {
 1717|  42.2M|  __m256i c0, c1, c2, c3;
 1718|  42.2M|  bit = -bit;
 1719|  42.2M|  const __m256i rounding = _mm256_set1_epi16(1 << (bit - 1));
 1720|  42.2M|  const __m256i s04 =
 1721|  42.2M|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[0]), in[4], 0x1);
 1722|  42.2M|  const __m256i s15 =
 1723|  42.2M|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[1]), in[5], 0x1);
 1724|  42.2M|  const __m256i s26 =
 1725|  42.2M|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[2]), in[6], 0x1);
 1726|  42.2M|  const __m256i s37 =
 1727|  42.2M|      _mm256_insertf128_si256(_mm256_castsi128_si256(in[3]), in[7], 0x1);
 1728|       |
 1729|  42.2M|  const __m256i a0 = _mm256_adds_epi16(s04, rounding);
 1730|  42.2M|  const __m256i a1 = _mm256_adds_epi16(s15, rounding);
 1731|  42.2M|  const __m256i a2 = _mm256_adds_epi16(s26, rounding);
 1732|  42.2M|  const __m256i a3 = _mm256_adds_epi16(s37, rounding);
 1733|       |
 1734|       |  // b0: 00 01 02 03  04 05 06 07 | 40 41 42 43  44 45 46 47
 1735|       |  // b1: 10 11 12 13  14 15 16 17 | 50 51 52 53  54 55 56 57
 1736|       |  // b2: 20 21 22 23  24 25 26 27 | 60 61 62 63  64 65 66 67
 1737|       |  // b3: 30 31 32 33  34 35 36 37 | 70 71 72 73  74 75 76 77
 1738|  42.2M|  const __m256i b0 = _mm256_srai_epi16(a0, bit);
 1739|  42.2M|  const __m256i b1 = _mm256_srai_epi16(a1, bit);
 1740|  42.2M|  const __m256i b2 = _mm256_srai_epi16(a2, bit);
 1741|  42.2M|  const __m256i b3 = _mm256_srai_epi16(a3, bit);
 1742|       |
 1743|  42.2M|  TRANSPOSE_8X8_AVX2()
  ------------------
  |  | 1638|  42.2M|  {                                                                  \
  |  | 1639|  42.2M|    /* aa0:    00 10 01 11  02 12 03 13 | 40 50 41 51  42 52 43 53*/ \
  |  | 1640|  42.2M|    /* aa1:    04 14 05 15  06 16 07 17 | 44 54 45 55  46 56 47 57*/ \
  |  | 1641|  42.2M|    /* aa2:    20 30 21 31  22 32 23 33 | 60 70 61 71  62 72 63 73*/ \
  |  | 1642|  42.2M|    /* aa3:    24 34 25 35  26 36 27 37 | 64 74 65 75  66 76 67 77*/ \
  |  | 1643|  42.2M|    const __m256i aa0 = _mm256_unpacklo_epi16(b0, b1);               \
  |  | 1644|  42.2M|    const __m256i aa1 = _mm256_unpackhi_epi16(b0, b1);               \
  |  | 1645|  42.2M|    const __m256i aa2 = _mm256_unpacklo_epi16(b2, b3);               \
  |  | 1646|  42.2M|    const __m256i aa3 = _mm256_unpackhi_epi16(b2, b3);               \
  |  | 1647|  42.2M|    /* Unpack 32 bit elements resulting in: */                       \
  |  | 1648|  42.2M|    /* bb0: 00 10 20 30  01 11 21 31 | 40 50 60 70  41 51 61 71*/    \
  |  | 1649|  42.2M|    /* bb1: 02 12 22 32  03 13 23 33 | 42 52 62 72  43 53 63 73*/    \
  |  | 1650|  42.2M|    /* bb2: 04 14 24 34  05 15 25 35 | 44 54 64 74  45 55 65 75*/    \
  |  | 1651|  42.2M|    /* bb2: 06 16 26 36  07 17 27 37 | 46 56 66 76  47 57 67 77*/    \
  |  | 1652|  42.2M|    const __m256i bb0 = _mm256_unpacklo_epi32(aa0, aa2);             \
  |  | 1653|  42.2M|    const __m256i bb1 = _mm256_unpackhi_epi32(aa0, aa2);             \
  |  | 1654|  42.2M|    const __m256i bb2 = _mm256_unpacklo_epi32(aa1, aa3);             \
  |  | 1655|  42.2M|    const __m256i bb3 = _mm256_unpackhi_epi32(aa1, aa3);             \
  |  | 1656|  42.2M|    /* bb0: 00 10 20 30 40 50 60 70| 01 11 21 31 41 51 61 71*/       \
  |  | 1657|  42.2M|    /* bb1: 02 12 22 32 42 52 62 72| 03 13 23 33 43 53 63 73*/       \
  |  | 1658|  42.2M|    /* bb2: 04 14 24 34 44 54 64 74| 05 15 25 35 45 55 65 75*/       \
  |  | 1659|  42.2M|    /* bb2: 06 16 26 36 46 56 66 76| 07 17 27 37 47 57 67 77*/       \
  |  | 1660|  42.2M|    c0 = _mm256_permute4x64_epi64(bb0, 0xd8);                        \
  |  | 1661|  42.2M|    c1 = _mm256_permute4x64_epi64(bb1, 0xd8);                        \
  |  | 1662|  42.2M|    c2 = _mm256_permute4x64_epi64(bb2, 0xd8);                        \
  |  | 1663|  42.2M|    c3 = _mm256_permute4x64_epi64(bb3, 0xd8);                        \
  |  | 1664|  42.2M|  }
  ------------------
 1744|       |  // Unpack 64 bit elements resulting in:
 1745|       |  // out[7]: 00 10 20 30  40 50 60 70
 1746|       |  // out[6]: 01 11 21 31  41 51 61 71
 1747|       |  // out[5]: 02 12 22 32  42 52 62 72
 1748|       |  // out[4]: 03 13 23 33  43 53 63 73
 1749|       |  // out[3]: 04 14 24 34  44 54 64 74
 1750|       |  // out[2]: 05 15 25 35  45 55 65 75
 1751|       |  // out[1]: 06 16 26 36  46 56 66 76
 1752|       |  // out[0]: 07 17 27 37  47 57 67 77
 1753|  42.2M|  out[0] = _mm256_castsi256_si128(c0);
 1754|  42.2M|  out[1] = _mm256_extractf128_si256(c0, 1);
 1755|  42.2M|  out[2] = _mm256_castsi256_si128(c1);
 1756|  42.2M|  out[3] = _mm256_extractf128_si256(c1, 1);
 1757|  42.2M|  out[4] = _mm256_castsi256_si128(c2);
 1758|  42.2M|  out[5] = _mm256_extractf128_si256(c2, 1);
 1759|  42.2M|  out[6] = _mm256_castsi256_si128(c3);
 1760|       |  out[7] = _mm256_extractf128_si256(c3, 1);
 1761|  42.2M|}
av1_fwd_txfm2d_avx2.c:store_buffer_16bit_to_32bit_w8_avx2:
 1766|  42.7M|                                                       const int out_size) {
 1767|   384M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (1767:19): [True: 342M, False: 42.7M]
  ------------------
 1768|   342M|    _mm256_store_si256((__m256i *)(out + i * stride),
 1769|   342M|                       _mm256_cvtepi16_epi32(in[i]));
 1770|   342M|  }
 1771|  42.7M|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_16x16_avx2:
 1816|  1.81M|                                        int stride, TX_TYPE tx_type, int bd) {
 1817|  1.81M|  (void)bd;
 1818|  1.81M|  const TX_SIZE tx_size = TX_16X16;
 1819|  1.81M|  __m256i buf0[16], buf1[16];
 1820|  1.81M|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 1821|  1.81M|  const int txw_idx = get_txw_idx(tx_size);
 1822|  1.81M|  const int txh_idx = get_txh_idx(tx_size);
 1823|  1.81M|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1824|  1.81M|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1825|  1.81M|  const int width = tx_size_wide[tx_size];
 1826|  1.81M|  const int height = tx_size_high[tx_size];
 1827|  1.81M|  const transform_1d_avx2 col_txfm = col_txfm16x16_arr[tx_type];
 1828|  1.81M|  const transform_1d_avx2 row_txfm = row_txfm16x16_arr[tx_type];
 1829|  1.81M|  int ud_flip, lr_flip;
 1830|       |
 1831|  1.81M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1832|  1.81M|  const int32_t i = 0;
 1833|  1.81M|  if (ud_flip) {
  ------------------
  |  Branch (1833:7): [True: 2.19k, False: 1.81M]
  ------------------
 1834|  2.19k|    load_buffer_16bit_to_16bit_flip_avx2(input + 16 * i, stride, buf0, height);
 1835|  1.81M|  } else {
 1836|  1.81M|    load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 1837|  1.81M|  }
 1838|  1.81M|  round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 1839|  1.81M|  col_txfm(buf0, buf0, cos_bit_col);
 1840|  1.81M|  round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 1841|  1.81M|  transpose_16bit_16x16_avx2(buf0, buf1 + 0 * width + 16 * i);
 1842|       |
 1843|  1.81M|  __m256i *buf;
 1844|  1.81M|  if (lr_flip) {
  ------------------
  |  Branch (1844:7): [True: 2.45k, False: 1.81M]
  ------------------
 1845|  2.45k|    buf = buf0;
 1846|  2.45k|    flip_buf_avx2(buf1 + width * i, buf, width);
 1847|  1.81M|  } else {
 1848|  1.81M|    buf = buf1 + width * i;
 1849|  1.81M|  }
 1850|  1.81M|  row_txfm(buf, buf, cos_bit_row);
 1851|  1.81M|  round_shift_16bit_w16_avx2(buf, width, shift[2]);
 1852|  1.81M|  store_buffer_16bit_to_32bit_w16_avx2(buf, output + i * 16, height, width);
 1853|  1.81M|}
av1_fwd_txfm2d_avx2.c:fdct16x16_new_avx2:
   24|  2.29M|                                      int8_t cos_bit) {
   25|  2.29M|  const int32_t *cospi = cospi_arr(cos_bit);
   26|  2.29M|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
   27|       |
   28|  2.29M|  __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
   29|  2.29M|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
   30|  2.29M|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
   31|  2.29M|  __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
   32|  2.29M|  __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
   33|  2.29M|  __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
   34|  2.29M|  __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
   35|  2.29M|  __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
   36|  2.29M|  __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
   37|  2.29M|  __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
   38|  2.29M|  __m256i cospi_p60_p04 = pair_set_w16_epi16(cospi[60], cospi[4]);
   39|  2.29M|  __m256i cospi_m04_p60 = pair_set_w16_epi16(-cospi[4], cospi[60]);
   40|  2.29M|  __m256i cospi_p28_p36 = pair_set_w16_epi16(cospi[28], cospi[36]);
   41|  2.29M|  __m256i cospi_m36_p28 = pair_set_w16_epi16(-cospi[36], cospi[28]);
   42|  2.29M|  __m256i cospi_p44_p20 = pair_set_w16_epi16(cospi[44], cospi[20]);
   43|  2.29M|  __m256i cospi_m20_p44 = pair_set_w16_epi16(-cospi[20], cospi[44]);
   44|  2.29M|  __m256i cospi_p12_p52 = pair_set_w16_epi16(cospi[12], cospi[52]);
   45|  2.29M|  __m256i cospi_m52_p12 = pair_set_w16_epi16(-cospi[52], cospi[12]);
   46|       |
   47|       |  // stage 1
   48|  2.29M|  __m256i x1[16];
   49|  2.29M|  btf_16_adds_subs_out_avx2(&x1[0], &x1[15], input[0], input[15]);
   50|  2.29M|  btf_16_adds_subs_out_avx2(&x1[1], &x1[14], input[1], input[14]);
   51|  2.29M|  btf_16_adds_subs_out_avx2(&x1[2], &x1[13], input[2], input[13]);
   52|  2.29M|  btf_16_adds_subs_out_avx2(&x1[3], &x1[12], input[3], input[12]);
   53|  2.29M|  btf_16_adds_subs_out_avx2(&x1[4], &x1[11], input[4], input[11]);
   54|  2.29M|  btf_16_adds_subs_out_avx2(&x1[5], &x1[10], input[5], input[10]);
   55|  2.29M|  btf_16_adds_subs_out_avx2(&x1[6], &x1[9], input[6], input[9]);
   56|  2.29M|  btf_16_adds_subs_out_avx2(&x1[7], &x1[8], input[7], input[8]);
   57|       |
   58|       |  // stage 2
   59|  2.29M|  btf_16_adds_subs_avx2(&x1[0], &x1[7]);
   60|  2.29M|  btf_16_adds_subs_avx2(&x1[1], &x1[6]);
   61|  2.29M|  btf_16_adds_subs_avx2(&x1[2], &x1[5]);
   62|  2.29M|  btf_16_adds_subs_avx2(&x1[3], &x1[4]);
   63|  2.29M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[10], &x1[13], _r, cos_bit);
   64|  2.29M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[11], &x1[12], _r, cos_bit);
   65|       |
   66|       |  // stage 3
   67|  2.29M|  btf_16_adds_subs_avx2(&x1[0], &x1[3]);
   68|  2.29M|  btf_16_adds_subs_avx2(&x1[1], &x1[2]);
   69|  2.29M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[5], &x1[6], _r, cos_bit);
   70|  2.29M|  btf_16_adds_subs_avx2(&x1[8], &x1[11]);
   71|  2.29M|  btf_16_adds_subs_avx2(&x1[9], &x1[10]);
   72|  2.29M|  btf_16_adds_subs_avx2(&x1[15], &x1[12]);
   73|  2.29M|  btf_16_adds_subs_avx2(&x1[14], &x1[13]);
   74|       |
   75|       |  // stage 4
   76|  2.29M|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[0], &x1[1], _r, cos_bit);
   77|  2.29M|  btf_16_w16_avx2(cospi_p48_p16, cospi_m16_p48, &x1[2], &x1[3], _r, cos_bit);
   78|  2.29M|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
   79|  2.29M|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
   80|  2.29M|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[9], &x1[14], _r, cos_bit);
   81|  2.29M|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[10], &x1[13], _r, cos_bit);
   82|       |
   83|       |  // stage 5
   84|  2.29M|  btf_16_w16_avx2(cospi_p56_p08, cospi_m08_p56, &x1[4], &x1[7], _r, cos_bit);
   85|  2.29M|  btf_16_w16_avx2(cospi_p24_p40, cospi_m40_p24, &x1[5], &x1[6], _r, cos_bit);
   86|  2.29M|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
   87|  2.29M|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
   88|  2.29M|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
   89|  2.29M|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
   90|       |
   91|       |  // stage 6
   92|  2.29M|  btf_16_w16_avx2(cospi_p60_p04, cospi_m04_p60, &x1[8], &x1[15], _r, cos_bit);
   93|  2.29M|  btf_16_w16_avx2(cospi_p28_p36, cospi_m36_p28, &x1[9], &x1[14], _r, cos_bit);
   94|  2.29M|  btf_16_w16_avx2(cospi_p44_p20, cospi_m20_p44, &x1[10], &x1[13], _r, cos_bit);
   95|  2.29M|  btf_16_w16_avx2(cospi_p12_p52, cospi_m52_p12, &x1[11], &x1[12], _r, cos_bit);
   96|       |
   97|       |  // stage 7
   98|  2.29M|  output[0] = x1[0];
   99|  2.29M|  output[1] = x1[8];
  100|  2.29M|  output[2] = x1[4];
  101|  2.29M|  output[3] = x1[12];
  102|  2.29M|  output[4] = x1[2];
  103|  2.29M|  output[5] = x1[10];
  104|  2.29M|  output[6] = x1[6];
  105|  2.29M|  output[7] = x1[14];
  106|  2.29M|  output[8] = x1[1];
  107|  2.29M|  output[9] = x1[9];
  108|  2.29M|  output[10] = x1[5];
  109|  2.29M|  output[11] = x1[13];
  110|  2.29M|  output[12] = x1[3];
  111|  2.29M|  output[13] = x1[11];
  112|  2.29M|  output[14] = x1[7];
  113|  2.29M|  output[15] = x1[15];
  114|  2.29M|}
av1_fwd_txfm2d_avx2.c:fadst16x16_new_avx2:
 1282|   989k|                                       int8_t cos_bit) {
 1283|   989k|  const int32_t *cospi = cospi_arr(cos_bit);
 1284|   989k|  const __m256i __zero = _mm256_setzero_si256();
 1285|   989k|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
 1286|       |
 1287|   989k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 1288|   989k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
 1289|   989k|  __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
 1290|   989k|  __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
 1291|   989k|  __m256i cospi_m48_p16 = pair_set_w16_epi16(-cospi[48], cospi[16]);
 1292|   989k|  __m256i cospi_p08_p56 = pair_set_w16_epi16(cospi[8], cospi[56]);
 1293|   989k|  __m256i cospi_p56_m08 = pair_set_w16_epi16(cospi[56], -cospi[8]);
 1294|   989k|  __m256i cospi_p40_p24 = pair_set_w16_epi16(cospi[40], cospi[24]);
 1295|   989k|  __m256i cospi_p24_m40 = pair_set_w16_epi16(cospi[24], -cospi[40]);
 1296|   989k|  __m256i cospi_m56_p08 = pair_set_w16_epi16(-cospi[56], cospi[8]);
 1297|   989k|  __m256i cospi_m24_p40 = pair_set_w16_epi16(-cospi[24], cospi[40]);
 1298|   989k|  __m256i cospi_p02_p62 = pair_set_w16_epi16(cospi[2], cospi[62]);
 1299|   989k|  __m256i cospi_p62_m02 = pair_set_w16_epi16(cospi[62], -cospi[2]);
 1300|   989k|  __m256i cospi_p10_p54 = pair_set_w16_epi16(cospi[10], cospi[54]);
 1301|   989k|  __m256i cospi_p54_m10 = pair_set_w16_epi16(cospi[54], -cospi[10]);
 1302|   989k|  __m256i cospi_p18_p46 = pair_set_w16_epi16(cospi[18], cospi[46]);
 1303|   989k|  __m256i cospi_p46_m18 = pair_set_w16_epi16(cospi[46], -cospi[18]);
 1304|   989k|  __m256i cospi_p26_p38 = pair_set_w16_epi16(cospi[26], cospi[38]);
 1305|   989k|  __m256i cospi_p38_m26 = pair_set_w16_epi16(cospi[38], -cospi[26]);
 1306|   989k|  __m256i cospi_p34_p30 = pair_set_w16_epi16(cospi[34], cospi[30]);
 1307|   989k|  __m256i cospi_p30_m34 = pair_set_w16_epi16(cospi[30], -cospi[34]);
 1308|   989k|  __m256i cospi_p42_p22 = pair_set_w16_epi16(cospi[42], cospi[22]);
 1309|   989k|  __m256i cospi_p22_m42 = pair_set_w16_epi16(cospi[22], -cospi[42]);
 1310|   989k|  __m256i cospi_p50_p14 = pair_set_w16_epi16(cospi[50], cospi[14]);
 1311|   989k|  __m256i cospi_p14_m50 = pair_set_w16_epi16(cospi[14], -cospi[50]);
 1312|   989k|  __m256i cospi_p58_p06 = pair_set_w16_epi16(cospi[58], cospi[6]);
 1313|   989k|  __m256i cospi_p06_m58 = pair_set_w16_epi16(cospi[6], -cospi[58]);
 1314|       |
 1315|       |  // stage 1
 1316|   989k|  __m256i x1[16];
 1317|   989k|  x1[0] = input[0];
 1318|   989k|  x1[1] = _mm256_subs_epi16(__zero, input[15]);
 1319|   989k|  x1[2] = _mm256_subs_epi16(__zero, input[7]);
 1320|   989k|  x1[3] = input[8];
 1321|   989k|  x1[4] = _mm256_subs_epi16(__zero, input[3]);
 1322|   989k|  x1[5] = input[12];
 1323|   989k|  x1[6] = input[4];
 1324|   989k|  x1[7] = _mm256_subs_epi16(__zero, input[11]);
 1325|   989k|  x1[8] = _mm256_subs_epi16(__zero, input[1]);
 1326|   989k|  x1[9] = input[14];
 1327|   989k|  x1[10] = input[6];
 1328|   989k|  x1[11] = _mm256_subs_epi16(__zero, input[9]);
 1329|   989k|  x1[12] = input[2];
 1330|   989k|  x1[13] = _mm256_subs_epi16(__zero, input[13]);
 1331|   989k|  x1[14] = _mm256_subs_epi16(__zero, input[5]);
 1332|   989k|  x1[15] = input[10];
 1333|       |
 1334|       |  // stage 2
 1335|   989k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[2], &x1[3], _r, cos_bit);
 1336|   989k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[6], &x1[7], _r, cos_bit);
 1337|   989k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[10], &x1[11], _r, cos_bit);
 1338|   989k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[14], &x1[15], _r, cos_bit);
 1339|       |
 1340|       |  // stage 3
 1341|   989k|  btf_16_adds_subs_avx2(&x1[0], &x1[2]);
 1342|   989k|  btf_16_adds_subs_avx2(&x1[1], &x1[3]);
 1343|   989k|  btf_16_adds_subs_avx2(&x1[4], &x1[6]);
 1344|   989k|  btf_16_adds_subs_avx2(&x1[5], &x1[7]);
 1345|   989k|  btf_16_adds_subs_avx2(&x1[8], &x1[10]);
 1346|   989k|  btf_16_adds_subs_avx2(&x1[9], &x1[11]);
 1347|   989k|  btf_16_adds_subs_avx2(&x1[12], &x1[14]);
 1348|   989k|  btf_16_adds_subs_avx2(&x1[13], &x1[15]);
 1349|       |
 1350|       |  // stage 4
 1351|   989k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x1[4], &x1[5], _r, cos_bit);
 1352|   989k|  btf_16_w16_avx2(cospi_m48_p16, cospi_p16_p48, &x1[6], &x1[7], _r, cos_bit);
 1353|   989k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x1[12], &x1[13], _r, cos_bit);
 1354|   989k|  btf_16_w16_avx2(cospi_m48_p16, cospi_p16_p48, &x1[14], &x1[15], _r, cos_bit);
 1355|       |
 1356|       |  // stage 5
 1357|   989k|  btf_16_adds_subs_avx2(&x1[0], &x1[4]);
 1358|   989k|  btf_16_adds_subs_avx2(&x1[1], &x1[5]);
 1359|   989k|  btf_16_adds_subs_avx2(&x1[2], &x1[6]);
 1360|   989k|  btf_16_adds_subs_avx2(&x1[3], &x1[7]);
 1361|   989k|  btf_16_adds_subs_avx2(&x1[8], &x1[12]);
 1362|   989k|  btf_16_adds_subs_avx2(&x1[9], &x1[13]);
 1363|   989k|  btf_16_adds_subs_avx2(&x1[10], &x1[14]);
 1364|   989k|  btf_16_adds_subs_avx2(&x1[11], &x1[15]);
 1365|       |
 1366|       |  // stage 6
 1367|   989k|  btf_16_w16_avx2(cospi_p08_p56, cospi_p56_m08, &x1[8], &x1[9], _r, cos_bit);
 1368|   989k|  btf_16_w16_avx2(cospi_p40_p24, cospi_p24_m40, &x1[10], &x1[11], _r, cos_bit);
 1369|   989k|  btf_16_w16_avx2(cospi_m56_p08, cospi_p08_p56, &x1[12], &x1[13], _r, cos_bit);
 1370|   989k|  btf_16_w16_avx2(cospi_m24_p40, cospi_p40_p24, &x1[14], &x1[15], _r, cos_bit);
 1371|       |
 1372|       |  // stage 7
 1373|   989k|  btf_16_adds_subs_avx2(&x1[0], &x1[8]);
 1374|   989k|  btf_16_adds_subs_avx2(&x1[1], &x1[9]);
 1375|   989k|  btf_16_adds_subs_avx2(&x1[2], &x1[10]);
 1376|   989k|  btf_16_adds_subs_avx2(&x1[3], &x1[11]);
 1377|   989k|  btf_16_adds_subs_avx2(&x1[4], &x1[12]);
 1378|   989k|  btf_16_adds_subs_avx2(&x1[5], &x1[13]);
 1379|   989k|  btf_16_adds_subs_avx2(&x1[6], &x1[14]);
 1380|   989k|  btf_16_adds_subs_avx2(&x1[7], &x1[15]);
 1381|       |
 1382|       |  // stage 8
 1383|   989k|  btf_16_w16_avx2(cospi_p02_p62, cospi_p62_m02, &x1[0], &x1[1], _r, cos_bit);
 1384|   989k|  btf_16_w16_avx2(cospi_p10_p54, cospi_p54_m10, &x1[2], &x1[3], _r, cos_bit);
 1385|   989k|  btf_16_w16_avx2(cospi_p18_p46, cospi_p46_m18, &x1[4], &x1[5], _r, cos_bit);
 1386|   989k|  btf_16_w16_avx2(cospi_p26_p38, cospi_p38_m26, &x1[6], &x1[7], _r, cos_bit);
 1387|   989k|  btf_16_w16_avx2(cospi_p34_p30, cospi_p30_m34, &x1[8], &x1[9], _r, cos_bit);
 1388|   989k|  btf_16_w16_avx2(cospi_p42_p22, cospi_p22_m42, &x1[10], &x1[11], _r, cos_bit);
 1389|   989k|  btf_16_w16_avx2(cospi_p50_p14, cospi_p14_m50, &x1[12], &x1[13], _r, cos_bit);
 1390|   989k|  btf_16_w16_avx2(cospi_p58_p06, cospi_p06_m58, &x1[14], &x1[15], _r, cos_bit);
 1391|       |
 1392|       |  // stage 9
 1393|   989k|  output[0] = x1[1];
 1394|   989k|  output[1] = x1[14];
 1395|   989k|  output[2] = x1[3];
 1396|   989k|  output[3] = x1[12];
 1397|   989k|  output[4] = x1[5];
 1398|   989k|  output[5] = x1[10];
 1399|   989k|  output[6] = x1[7];
 1400|   989k|  output[7] = x1[8];
 1401|   989k|  output[8] = x1[9];
 1402|   989k|  output[9] = x1[6];
 1403|   989k|  output[10] = x1[11];
 1404|   989k|  output[11] = x1[4];
 1405|   989k|  output[12] = x1[13];
 1406|   989k|  output[13] = x1[2];
 1407|   989k|  output[14] = x1[15];
 1408|   989k|  output[15] = x1[0];
 1409|   989k|}
av1_fwd_txfm2d_avx2.c:fidentity16x16_new_avx2:
 1412|   493k|                                           __m256i *output, int8_t cos_bit) {
 1413|   493k|  (void)cos_bit;
 1414|   493k|  const __m256i one = _mm256_set1_epi16(1);
 1415|       |
 1416|  8.38M|  for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (1416:19): [True: 7.89M, False: 493k]
  ------------------
 1417|  7.89M|    const __m256i a_lo = _mm256_unpacklo_epi16(input[i], one);
 1418|  7.89M|    const __m256i a_hi = _mm256_unpackhi_epi16(input[i], one);
 1419|  7.89M|    const __m256i b_lo = scale_round_avx2(a_lo, 2 * NewSqrt2);
 1420|  7.89M|    const __m256i b_hi = scale_round_avx2(a_hi, 2 * NewSqrt2);
 1421|  7.89M|    output[i] = _mm256_packs_epi32(b_lo, b_hi);
 1422|  7.89M|  }
 1423|   493k|}
av1_fwd_txfm2d_avx2.c:store_buffer_16bit_to_32bit_w16_avx2:
 1448|  2.21M|                                                        const int out_size) {
 1449|  44.1M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (1449:19): [True: 41.9M, False: 2.21M]
  ------------------
 1450|  41.9M|    _mm256_store_si256((__m256i *)(out),
 1451|  41.9M|                       _mm256_cvtepi16_epi32(_mm256_castsi256_si128(in[i])));
 1452|  41.9M|    _mm256_store_si256(
 1453|  41.9M|        (__m256i *)(out + 8),
 1454|       |        _mm256_cvtepi16_epi32(_mm256_extracti128_si256(in[i], 1)));
 1455|  41.9M|    out += stride;
 1456|  41.9M|  }
 1457|  2.21M|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_32x32_avx2:
 1856|   200k|                                        int stride, TX_TYPE tx_type, int bd) {
 1857|   200k|  (void)bd;
 1858|   200k|  const TX_SIZE tx_size = TX_32X32;
 1859|   200k|  __m256i buf0[32], buf1[128];
 1860|   200k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 1861|   200k|  const int txw_idx = get_txw_idx(tx_size);
 1862|   200k|  const int txh_idx = get_txh_idx(tx_size);
 1863|   200k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1864|   200k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1865|   200k|  const int width = tx_size_wide[tx_size];
 1866|   200k|  const int height = tx_size_high[tx_size];
 1867|   200k|  const transform_1d_avx2 col_txfm = col_txfm16x32_arr[tx_type];
 1868|   200k|  const transform_1d_avx2 row_txfm = row_txfm16x32_arr[tx_type];
 1869|       |
 1870|   200k|  int ud_flip, lr_flip;
 1871|   200k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1872|       |
 1873|   600k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1873:19): [True: 400k, False: 200k]
  ------------------
 1874|   400k|    if (ud_flip) {
  ------------------
  |  Branch (1874:9): [True: 0, False: 400k]
  ------------------
 1875|      0|      load_buffer_16bit_to_16bit_flip_avx2(input + 16 * i, stride, buf0,
 1876|      0|                                           height);
 1877|   400k|    } else {
 1878|   400k|      load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 1879|   400k|    }
 1880|   400k|    round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 1881|   400k|    col_txfm(buf0, buf0, cos_bit_col);
 1882|   400k|    round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 1883|   400k|    transpose_16bit_16x16_avx2(buf0 + 0 * 16, buf1 + 0 * width + 16 * i);
 1884|   400k|    transpose_16bit_16x16_avx2(buf0 + 1 * 16, buf1 + 1 * width + 16 * i);
 1885|   400k|  }
 1886|       |
 1887|   600k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1887:19): [True: 400k, False: 200k]
  ------------------
 1888|   400k|    __m256i *buf;
 1889|   400k|    if (lr_flip) {
  ------------------
  |  Branch (1889:9): [True: 0, False: 400k]
  ------------------
 1890|      0|      buf = buf0;
 1891|      0|      flip_buf_avx2(buf1 + width * i, buf, width);
 1892|   400k|    } else {
 1893|   400k|      buf = buf1 + width * i;
 1894|   400k|    }
 1895|   400k|    row_txfm(buf, buf, cos_bit_row);
 1896|   400k|    round_shift_16bit_w16_avx2(buf, width, shift[2]);
 1897|   400k|    store_buffer_16bit_to_32bit_w16_avx2(buf, output + i * 16, height, width);
 1898|   400k|  }
 1899|   200k|}
av1_fwd_txfm2d_avx2.c:fdct16x32_avx2:
  117|   781k|                                  int8_t cos_bit) {
  118|   781k|  const int32_t *cospi = cospi_arr(cos_bit);
  119|   781k|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
  120|       |
  121|   781k|  __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
  122|   781k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  123|   781k|  __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  124|   781k|  __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  125|   781k|  __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  126|   781k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
  127|   781k|  __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
  128|   781k|  __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
  129|   781k|  __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
  130|   781k|  __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
  131|   781k|  __m256i cospi_m56_m08 = pair_set_w16_epi16(-cospi[56], -cospi[8]);
  132|   781k|  __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
  133|   781k|  __m256i cospi_p60_p04 = pair_set_w16_epi16(cospi[60], cospi[4]);
  134|   781k|  __m256i cospi_m04_p60 = pair_set_w16_epi16(-cospi[4], cospi[60]);
  135|   781k|  __m256i cospi_p28_p36 = pair_set_w16_epi16(cospi[28], cospi[36]);
  136|   781k|  __m256i cospi_m36_p28 = pair_set_w16_epi16(-cospi[36], cospi[28]);
  137|   781k|  __m256i cospi_p44_p20 = pair_set_w16_epi16(cospi[44], cospi[20]);
  138|   781k|  __m256i cospi_m20_p44 = pair_set_w16_epi16(-cospi[20], cospi[44]);
  139|   781k|  __m256i cospi_p12_p52 = pair_set_w16_epi16(cospi[12], cospi[52]);
  140|   781k|  __m256i cospi_m52_p12 = pair_set_w16_epi16(-cospi[52], cospi[12]);
  141|   781k|  __m256i cospi_p62_p02 = pair_set_w16_epi16(cospi[62], cospi[2]);
  142|   781k|  __m256i cospi_m02_p62 = pair_set_w16_epi16(-cospi[2], cospi[62]);
  143|   781k|  __m256i cospi_p30_p34 = pair_set_w16_epi16(cospi[30], cospi[34]);
  144|   781k|  __m256i cospi_m34_p30 = pair_set_w16_epi16(-cospi[34], cospi[30]);
  145|   781k|  __m256i cospi_p46_p18 = pair_set_w16_epi16(cospi[46], cospi[18]);
  146|   781k|  __m256i cospi_m18_p46 = pair_set_w16_epi16(-cospi[18], cospi[46]);
  147|   781k|  __m256i cospi_p14_p50 = pair_set_w16_epi16(cospi[14], cospi[50]);
  148|   781k|  __m256i cospi_m50_p14 = pair_set_w16_epi16(-cospi[50], cospi[14]);
  149|   781k|  __m256i cospi_p54_p10 = pair_set_w16_epi16(cospi[54], cospi[10]);
  150|   781k|  __m256i cospi_m10_p54 = pair_set_w16_epi16(-cospi[10], cospi[54]);
  151|   781k|  __m256i cospi_p22_p42 = pair_set_w16_epi16(cospi[22], cospi[42]);
  152|   781k|  __m256i cospi_m42_p22 = pair_set_w16_epi16(-cospi[42], cospi[22]);
  153|   781k|  __m256i cospi_p38_p26 = pair_set_w16_epi16(cospi[38], cospi[26]);
  154|   781k|  __m256i cospi_m26_p38 = pair_set_w16_epi16(-cospi[26], cospi[38]);
  155|   781k|  __m256i cospi_p06_p58 = pair_set_w16_epi16(cospi[6], cospi[58]);
  156|   781k|  __m256i cospi_m58_p06 = pair_set_w16_epi16(-cospi[58], cospi[6]);
  157|       |
  158|       |  // stage 1
  159|   781k|  __m256i x1[32];
  160|   781k|  btf_16_adds_subs_out_avx2(&x1[0], &x1[31], input[0], input[31]);
  161|   781k|  btf_16_adds_subs_out_avx2(&x1[1], &x1[30], input[1], input[30]);
  162|   781k|  btf_16_adds_subs_out_avx2(&x1[2], &x1[29], input[2], input[29]);
  163|   781k|  btf_16_adds_subs_out_avx2(&x1[3], &x1[28], input[3], input[28]);
  164|   781k|  btf_16_adds_subs_out_avx2(&x1[4], &x1[27], input[4], input[27]);
  165|   781k|  btf_16_adds_subs_out_avx2(&x1[5], &x1[26], input[5], input[26]);
  166|   781k|  btf_16_adds_subs_out_avx2(&x1[6], &x1[25], input[6], input[25]);
  167|   781k|  btf_16_adds_subs_out_avx2(&x1[7], &x1[24], input[7], input[24]);
  168|   781k|  btf_16_adds_subs_out_avx2(&x1[8], &x1[23], input[8], input[23]);
  169|   781k|  btf_16_adds_subs_out_avx2(&x1[9], &x1[22], input[9], input[22]);
  170|   781k|  btf_16_adds_subs_out_avx2(&x1[10], &x1[21], input[10], input[21]);
  171|   781k|  btf_16_adds_subs_out_avx2(&x1[11], &x1[20], input[11], input[20]);
  172|   781k|  btf_16_adds_subs_out_avx2(&x1[12], &x1[19], input[12], input[19]);
  173|   781k|  btf_16_adds_subs_out_avx2(&x1[13], &x1[18], input[13], input[18]);
  174|   781k|  btf_16_adds_subs_out_avx2(&x1[14], &x1[17], input[14], input[17]);
  175|   781k|  btf_16_adds_subs_out_avx2(&x1[15], &x1[16], input[15], input[16]);
  176|       |
  177|       |  // stage 2
  178|   781k|  btf_16_adds_subs_avx2(&x1[0], &x1[15]);
  179|   781k|  btf_16_adds_subs_avx2(&x1[1], &x1[14]);
  180|   781k|  btf_16_adds_subs_avx2(&x1[2], &x1[13]);
  181|   781k|  btf_16_adds_subs_avx2(&x1[3], &x1[12]);
  182|   781k|  btf_16_adds_subs_avx2(&x1[4], &x1[11]);
  183|   781k|  btf_16_adds_subs_avx2(&x1[5], &x1[10]);
  184|   781k|  btf_16_adds_subs_avx2(&x1[6], &x1[9]);
  185|   781k|  btf_16_adds_subs_avx2(&x1[7], &x1[8]);
  186|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[20], &x1[27], _r, cos_bit);
  187|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[21], &x1[26], _r, cos_bit);
  188|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[22], &x1[25], _r, cos_bit);
  189|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[23], &x1[24], _r, cos_bit);
  190|       |
  191|       |  // stage 3
  192|   781k|  btf_16_adds_subs_avx2(&x1[0], &x1[7]);
  193|   781k|  btf_16_adds_subs_avx2(&x1[1], &x1[6]);
  194|   781k|  btf_16_adds_subs_avx2(&x1[2], &x1[5]);
  195|   781k|  btf_16_adds_subs_avx2(&x1[3], &x1[4]);
  196|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[10], &x1[13], _r, cos_bit);
  197|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[11], &x1[12], _r, cos_bit);
  198|   781k|  btf_16_adds_subs_avx2(&x1[16], &x1[23]);
  199|   781k|  btf_16_adds_subs_avx2(&x1[17], &x1[22]);
  200|   781k|  btf_16_adds_subs_avx2(&x1[18], &x1[21]);
  201|   781k|  btf_16_adds_subs_avx2(&x1[19], &x1[20]);
  202|   781k|  btf_16_adds_subs_avx2(&x1[31], &x1[24]);
  203|   781k|  btf_16_adds_subs_avx2(&x1[30], &x1[25]);
  204|   781k|  btf_16_adds_subs_avx2(&x1[29], &x1[26]);
  205|   781k|  btf_16_adds_subs_avx2(&x1[28], &x1[27]);
  206|       |
  207|       |  // stage 4
  208|   781k|  btf_16_adds_subs_avx2(&x1[0], &x1[3]);
  209|   781k|  btf_16_adds_subs_avx2(&x1[1], &x1[2]);
  210|   781k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[5], &x1[6], _r, cos_bit);
  211|   781k|  btf_16_adds_subs_avx2(&x1[8], &x1[11]);
  212|   781k|  btf_16_adds_subs_avx2(&x1[9], &x1[10]);
  213|   781k|  btf_16_adds_subs_avx2(&x1[15], &x1[12]);
  214|   781k|  btf_16_adds_subs_avx2(&x1[14], &x1[13]);
  215|   781k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[18], &x1[29], _r, cos_bit);
  216|   781k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[19], &x1[28], _r, cos_bit);
  217|   781k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[20], &x1[27], _r, cos_bit);
  218|   781k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[21], &x1[26], _r, cos_bit);
  219|       |
  220|       |  // stage 5
  221|   781k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[0], &x1[1], _r, cos_bit);
  222|   781k|  btf_16_w16_avx2(cospi_p48_p16, cospi_m16_p48, &x1[2], &x1[3], _r, cos_bit);
  223|   781k|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
  224|   781k|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
  225|   781k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[9], &x1[14], _r, cos_bit);
  226|   781k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[10], &x1[13], _r, cos_bit);
  227|   781k|  btf_16_adds_subs_avx2(&x1[16], &x1[19]);
  228|   781k|  btf_16_adds_subs_avx2(&x1[17], &x1[18]);
  229|   781k|  btf_16_adds_subs_avx2(&x1[23], &x1[20]);
  230|   781k|  btf_16_adds_subs_avx2(&x1[22], &x1[21]);
  231|   781k|  btf_16_adds_subs_avx2(&x1[24], &x1[27]);
  232|   781k|  btf_16_adds_subs_avx2(&x1[25], &x1[26]);
  233|   781k|  btf_16_adds_subs_avx2(&x1[31], &x1[28]);
  234|   781k|  btf_16_adds_subs_avx2(&x1[30], &x1[29]);
  235|       |
  236|       |  // stage 6
  237|   781k|  btf_16_w16_avx2(cospi_p56_p08, cospi_m08_p56, &x1[4], &x1[7], _r, cos_bit);
  238|   781k|  btf_16_w16_avx2(cospi_p24_p40, cospi_m40_p24, &x1[5], &x1[6], _r, cos_bit);
  239|   781k|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
  240|   781k|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
  241|   781k|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
  242|   781k|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
  243|   781k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x1[17], &x1[30], _r, cos_bit);
  244|   781k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x1[18], &x1[29], _r, cos_bit);
  245|   781k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x1[21], &x1[26], _r, cos_bit);
  246|   781k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x1[22], &x1[25], _r, cos_bit);
  247|       |
  248|       |  // stage 7
  249|   781k|  btf_16_w16_avx2(cospi_p60_p04, cospi_m04_p60, &x1[8], &x1[15], _r, cos_bit);
  250|   781k|  btf_16_w16_avx2(cospi_p28_p36, cospi_m36_p28, &x1[9], &x1[14], _r, cos_bit);
  251|   781k|  btf_16_w16_avx2(cospi_p44_p20, cospi_m20_p44, &x1[10], &x1[13], _r, cos_bit);
  252|   781k|  btf_16_w16_avx2(cospi_p12_p52, cospi_m52_p12, &x1[11], &x1[12], _r, cos_bit);
  253|   781k|  btf_16_adds_subs_avx2(&x1[16], &x1[17]);
  254|   781k|  btf_16_adds_subs_avx2(&x1[19], &x1[18]);
  255|   781k|  btf_16_adds_subs_avx2(&x1[20], &x1[21]);
  256|   781k|  btf_16_adds_subs_avx2(&x1[23], &x1[22]);
  257|   781k|  btf_16_adds_subs_avx2(&x1[24], &x1[25]);
  258|   781k|  btf_16_adds_subs_avx2(&x1[27], &x1[26]);
  259|   781k|  btf_16_adds_subs_avx2(&x1[28], &x1[29]);
  260|   781k|  btf_16_adds_subs_avx2(&x1[31], &x1[30]);
  261|       |
  262|       |  // stage 8
  263|   781k|  btf_16_w16_avx2(cospi_p62_p02, cospi_m02_p62, &x1[16], &x1[31], _r, cos_bit);
  264|   781k|  btf_16_w16_avx2(cospi_p30_p34, cospi_m34_p30, &x1[17], &x1[30], _r, cos_bit);
  265|   781k|  btf_16_w16_avx2(cospi_p46_p18, cospi_m18_p46, &x1[18], &x1[29], _r, cos_bit);
  266|   781k|  btf_16_w16_avx2(cospi_p14_p50, cospi_m50_p14, &x1[19], &x1[28], _r, cos_bit);
  267|   781k|  btf_16_w16_avx2(cospi_p54_p10, cospi_m10_p54, &x1[20], &x1[27], _r, cos_bit);
  268|   781k|  btf_16_w16_avx2(cospi_p22_p42, cospi_m42_p22, &x1[21], &x1[26], _r, cos_bit);
  269|   781k|  btf_16_w16_avx2(cospi_p38_p26, cospi_m26_p38, &x1[22], &x1[25], _r, cos_bit);
  270|   781k|  btf_16_w16_avx2(cospi_p06_p58, cospi_m58_p06, &x1[23], &x1[24], _r, cos_bit);
  271|       |
  272|       |  // stage 9
  273|   781k|  output[0] = x1[0];
  274|   781k|  output[1] = x1[16];
  275|   781k|  output[2] = x1[8];
  276|   781k|  output[3] = x1[24];
  277|   781k|  output[4] = x1[4];
  278|   781k|  output[5] = x1[20];
  279|   781k|  output[6] = x1[12];
  280|   781k|  output[7] = x1[28];
  281|   781k|  output[8] = x1[2];
  282|   781k|  output[9] = x1[18];
  283|   781k|  output[10] = x1[10];
  284|   781k|  output[11] = x1[26];
  285|   781k|  output[12] = x1[6];
  286|   781k|  output[13] = x1[22];
  287|   781k|  output[14] = x1[14];
  288|   781k|  output[15] = x1[30];
  289|   781k|  output[16] = x1[1];
  290|   781k|  output[17] = x1[17];
  291|   781k|  output[18] = x1[9];
  292|   781k|  output[19] = x1[25];
  293|   781k|  output[20] = x1[5];
  294|   781k|  output[21] = x1[21];
  295|   781k|  output[22] = x1[13];
  296|   781k|  output[23] = x1[29];
  297|   781k|  output[24] = x1[3];
  298|   781k|  output[25] = x1[19];
  299|   781k|  output[26] = x1[11];
  300|   781k|  output[27] = x1[27];
  301|   781k|  output[28] = x1[7];
  302|   781k|  output[29] = x1[23];
  303|   781k|  output[30] = x1[15];
  304|   781k|  output[31] = x1[31];
  305|   781k|}
av1_fwd_txfm2d_avx2.c:fidentity16x32_avx2:
 1426|  99.6k|                                       int8_t cos_bit) {
 1427|  99.6k|  (void)cos_bit;
 1428|  3.28M|  for (int i = 0; i < 32; ++i) {
  ------------------
  |  Branch (1428:19): [True: 3.19M, False: 99.6k]
  ------------------
 1429|  3.19M|    output[i] = _mm256_slli_epi16(input[i], 2);
 1430|  3.19M|  }
 1431|  99.6k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_64x64_avx2:
 1902|  25.3k|                                        int stride, TX_TYPE tx_type, int bd) {
 1903|  25.3k|  (void)bd;
 1904|  25.3k|  (void)tx_type;
 1905|  25.3k|  assert(tx_type == DCT_DCT);
 1906|  25.3k|  const TX_SIZE tx_size = TX_64X64;
 1907|  25.3k|  __m256i buf0[64], buf1[256];
 1908|  25.3k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 1909|  25.3k|  const int txw_idx = get_txw_idx(tx_size);
 1910|  25.3k|  const int txh_idx = get_txh_idx(tx_size);
 1911|  25.3k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1912|  25.3k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1913|  25.3k|  const int width = tx_size_wide[tx_size];
 1914|  25.3k|  const int height = tx_size_high[tx_size];
 1915|  25.3k|  const transform_1d_avx2 col_txfm = fdct16x64_new_avx2;
 1916|  25.3k|  const int width_div16 = (width >> 4);
 1917|  25.3k|  const int height_div16 = (height >> 4);
 1918|       |
 1919|   126k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (1919:19): [True: 101k, False: 25.3k]
  ------------------
 1920|   101k|    load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 1921|   101k|    round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 1922|   101k|    col_txfm(buf0, buf0, cos_bit_col);
 1923|   101k|    round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 1924|   304k|    for (int j = 0; j < AOMMIN(2, height_div16); ++j) {
  ------------------
  |  |   34|   304k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 304k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1924:21): [True: 202k, False: 101k]
  ------------------
 1925|   202k|      transpose_16bit_16x16_avx2(buf0 + j * 16, buf1 + j * width + 16 * i);
 1926|   202k|    }
 1927|   101k|  }
 1928|       |
 1929|  76.0k|  for (int i = 0; i < AOMMIN(2, height_div16); i++) {
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 76.1k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1929:19): [True: 50.7k, False: 25.3k]
  ------------------
 1930|  50.7k|    __m256i bufA[64];
 1931|  50.7k|    __m256i bufB[64];
 1932|  50.7k|    __m128i *buf = (__m128i *)(buf1 + width * i);
 1933|  3.29M|    for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (1933:21): [True: 3.24M, False: 50.7k]
  ------------------
 1934|  3.24M|      bufA[j] = _mm256_cvtepi16_epi32(buf[j * 2]);
 1935|  3.24M|      bufB[j] = _mm256_cvtepi16_epi32(buf[j * 2 + 1]);
 1936|  3.24M|    }
 1937|  50.7k|    fdct64_new_avx2(bufA, bufA, cos_bit_row);
 1938|  50.7k|    fdct64_new_avx2(bufB, bufB, cos_bit_row);
 1939|  50.7k|    round_shift_array_32_avx2(bufA, bufA, 32, -shift[2]);
 1940|  50.7k|    round_shift_array_32_avx2(bufB, bufB, 32, -shift[2]);
 1941|  50.7k|    store_output_32bit_w16(output + i * 16, bufA, bufB, 32, 32);
 1942|  50.7k|  }
 1943|  25.3k|}
av1_fwd_txfm2d_avx2.c:fdct16x64_new_avx2:
  308|   106k|                                      int8_t cos_bit) {
  309|   106k|  const int32_t *cospi = cospi_arr(cos_bit);
  310|   106k|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
  311|       |
  312|   106k|  __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
  313|   106k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
  314|   106k|  __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
  315|   106k|  __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
  316|   106k|  __m256i cospi_m48_m16 = pair_set_w16_epi16(-cospi[48], -cospi[16]);
  317|   106k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
  318|   106k|  __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
  319|   106k|  __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
  320|   106k|  __m256i cospi_m56_m08 = pair_set_w16_epi16(-cospi[56], -cospi[8]);
  321|   106k|  __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
  322|   106k|  __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
  323|   106k|  __m256i cospi_m24_m40 = pair_set_w16_epi16(-cospi[24], -cospi[40]);
  324|   106k|  __m256i cospi_p60_p04 = pair_set_w16_epi16(cospi[60], cospi[4]);
  325|   106k|  __m256i cospi_m04_p60 = pair_set_w16_epi16(-cospi[4], cospi[60]);
  326|   106k|  __m256i cospi_p28_p36 = pair_set_w16_epi16(cospi[28], cospi[36]);
  327|   106k|  __m256i cospi_m36_p28 = pair_set_w16_epi16(-cospi[36], cospi[28]);
  328|   106k|  __m256i cospi_p44_p20 = pair_set_w16_epi16(cospi[44], cospi[20]);
  329|   106k|  __m256i cospi_m20_p44 = pair_set_w16_epi16(-cospi[20], cospi[44]);
  330|   106k|  __m256i cospi_p12_p52 = pair_set_w16_epi16(cospi[12], cospi[52]);
  331|   106k|  __m256i cospi_m52_p12 = pair_set_w16_epi16(-cospi[52], cospi[12]);
  332|   106k|  __m256i cospi_m60_m04 = pair_set_w16_epi16(-cospi[60], -cospi[4]);
  333|   106k|  __m256i cospi_m28_m36 = pair_set_w16_epi16(-cospi[28], -cospi[36]);
  334|   106k|  __m256i cospi_m44_m20 = pair_set_w16_epi16(-cospi[44], -cospi[20]);
  335|   106k|  __m256i cospi_m12_m52 = pair_set_w16_epi16(-cospi[12], -cospi[52]);
  336|   106k|  __m256i cospi_p62_p02 = pair_set_w16_epi16(cospi[62], cospi[2]);
  337|   106k|  __m256i cospi_m02_p62 = pair_set_w16_epi16(-cospi[2], cospi[62]);
  338|   106k|  __m256i cospi_p30_p34 = pair_set_w16_epi16(cospi[30], cospi[34]);
  339|   106k|  __m256i cospi_m34_p30 = pair_set_w16_epi16(-cospi[34], cospi[30]);
  340|   106k|  __m256i cospi_p46_p18 = pair_set_w16_epi16(cospi[46], cospi[18]);
  341|   106k|  __m256i cospi_m18_p46 = pair_set_w16_epi16(-cospi[18], cospi[46]);
  342|   106k|  __m256i cospi_p14_p50 = pair_set_w16_epi16(cospi[14], cospi[50]);
  343|   106k|  __m256i cospi_m50_p14 = pair_set_w16_epi16(-cospi[50], cospi[14]);
  344|   106k|  __m256i cospi_p54_p10 = pair_set_w16_epi16(cospi[54], cospi[10]);
  345|   106k|  __m256i cospi_m10_p54 = pair_set_w16_epi16(-cospi[10], cospi[54]);
  346|   106k|  __m256i cospi_p22_p42 = pair_set_w16_epi16(cospi[22], cospi[42]);
  347|   106k|  __m256i cospi_m42_p22 = pair_set_w16_epi16(-cospi[42], cospi[22]);
  348|   106k|  __m256i cospi_p38_p26 = pair_set_w16_epi16(cospi[38], cospi[26]);
  349|   106k|  __m256i cospi_m26_p38 = pair_set_w16_epi16(-cospi[26], cospi[38]);
  350|   106k|  __m256i cospi_p06_p58 = pair_set_w16_epi16(cospi[6], cospi[58]);
  351|   106k|  __m256i cospi_m58_p06 = pair_set_w16_epi16(-cospi[58], cospi[6]);
  352|   106k|  __m256i cospi_p63_p01 = pair_set_w16_epi16(cospi[63], cospi[1]);
  353|   106k|  __m256i cospi_m01_p63 = pair_set_w16_epi16(-cospi[1], cospi[63]);
  354|   106k|  __m256i cospi_p31_p33 = pair_set_w16_epi16(cospi[31], cospi[33]);
  355|   106k|  __m256i cospi_m33_p31 = pair_set_w16_epi16(-cospi[33], cospi[31]);
  356|   106k|  __m256i cospi_p47_p17 = pair_set_w16_epi16(cospi[47], cospi[17]);
  357|   106k|  __m256i cospi_m17_p47 = pair_set_w16_epi16(-cospi[17], cospi[47]);
  358|   106k|  __m256i cospi_p15_p49 = pair_set_w16_epi16(cospi[15], cospi[49]);
  359|   106k|  __m256i cospi_m49_p15 = pair_set_w16_epi16(-cospi[49], cospi[15]);
  360|   106k|  __m256i cospi_p55_p09 = pair_set_w16_epi16(cospi[55], cospi[9]);
  361|   106k|  __m256i cospi_m09_p55 = pair_set_w16_epi16(-cospi[9], cospi[55]);
  362|   106k|  __m256i cospi_p23_p41 = pair_set_w16_epi16(cospi[23], cospi[41]);
  363|   106k|  __m256i cospi_m41_p23 = pair_set_w16_epi16(-cospi[41], cospi[23]);
  364|   106k|  __m256i cospi_p39_p25 = pair_set_w16_epi16(cospi[39], cospi[25]);
  365|   106k|  __m256i cospi_m25_p39 = pair_set_w16_epi16(-cospi[25], cospi[39]);
  366|   106k|  __m256i cospi_p07_p57 = pair_set_w16_epi16(cospi[7], cospi[57]);
  367|   106k|  __m256i cospi_m57_p07 = pair_set_w16_epi16(-cospi[57], cospi[7]);
  368|   106k|  __m256i cospi_p59_p05 = pair_set_w16_epi16(cospi[59], cospi[5]);
  369|   106k|  __m256i cospi_m05_p59 = pair_set_w16_epi16(-cospi[5], cospi[59]);
  370|   106k|  __m256i cospi_p27_p37 = pair_set_w16_epi16(cospi[27], cospi[37]);
  371|   106k|  __m256i cospi_m37_p27 = pair_set_w16_epi16(-cospi[37], cospi[27]);
  372|   106k|  __m256i cospi_p43_p21 = pair_set_w16_epi16(cospi[43], cospi[21]);
  373|   106k|  __m256i cospi_m21_p43 = pair_set_w16_epi16(-cospi[21], cospi[43]);
  374|   106k|  __m256i cospi_p11_p53 = pair_set_w16_epi16(cospi[11], cospi[53]);
  375|   106k|  __m256i cospi_m53_p11 = pair_set_w16_epi16(-cospi[53], cospi[11]);
  376|   106k|  __m256i cospi_p51_p13 = pair_set_w16_epi16(cospi[51], cospi[13]);
  377|   106k|  __m256i cospi_m13_p51 = pair_set_w16_epi16(-cospi[13], cospi[51]);
  378|   106k|  __m256i cospi_p19_p45 = pair_set_w16_epi16(cospi[19], cospi[45]);
  379|   106k|  __m256i cospi_m45_p19 = pair_set_w16_epi16(-cospi[45], cospi[19]);
  380|   106k|  __m256i cospi_p35_p29 = pair_set_w16_epi16(cospi[35], cospi[29]);
  381|   106k|  __m256i cospi_m29_p35 = pair_set_w16_epi16(-cospi[29], cospi[35]);
  382|   106k|  __m256i cospi_p03_p61 = pair_set_w16_epi16(cospi[3], cospi[61]);
  383|   106k|  __m256i cospi_m61_p03 = pair_set_w16_epi16(-cospi[61], cospi[3]);
  384|       |
  385|       |  // stage 1
  386|   106k|  __m256i x1[64];
  387|   106k|  btf_16_adds_subs_out_avx2(&x1[0], &x1[63], input[0], input[63]);
  388|   106k|  btf_16_adds_subs_out_avx2(&x1[1], &x1[62], input[1], input[62]);
  389|   106k|  btf_16_adds_subs_out_avx2(&x1[2], &x1[61], input[2], input[61]);
  390|   106k|  btf_16_adds_subs_out_avx2(&x1[3], &x1[60], input[3], input[60]);
  391|   106k|  btf_16_adds_subs_out_avx2(&x1[4], &x1[59], input[4], input[59]);
  392|   106k|  btf_16_adds_subs_out_avx2(&x1[5], &x1[58], input[5], input[58]);
  393|   106k|  btf_16_adds_subs_out_avx2(&x1[6], &x1[57], input[6], input[57]);
  394|   106k|  btf_16_adds_subs_out_avx2(&x1[7], &x1[56], input[7], input[56]);
  395|   106k|  btf_16_adds_subs_out_avx2(&x1[8], &x1[55], input[8], input[55]);
  396|   106k|  btf_16_adds_subs_out_avx2(&x1[9], &x1[54], input[9], input[54]);
  397|   106k|  btf_16_adds_subs_out_avx2(&x1[10], &x1[53], input[10], input[53]);
  398|   106k|  btf_16_adds_subs_out_avx2(&x1[11], &x1[52], input[11], input[52]);
  399|   106k|  btf_16_adds_subs_out_avx2(&x1[12], &x1[51], input[12], input[51]);
  400|   106k|  btf_16_adds_subs_out_avx2(&x1[13], &x1[50], input[13], input[50]);
  401|   106k|  btf_16_adds_subs_out_avx2(&x1[14], &x1[49], input[14], input[49]);
  402|   106k|  btf_16_adds_subs_out_avx2(&x1[15], &x1[48], input[15], input[48]);
  403|   106k|  btf_16_adds_subs_out_avx2(&x1[16], &x1[47], input[16], input[47]);
  404|   106k|  btf_16_adds_subs_out_avx2(&x1[17], &x1[46], input[17], input[46]);
  405|   106k|  btf_16_adds_subs_out_avx2(&x1[18], &x1[45], input[18], input[45]);
  406|   106k|  btf_16_adds_subs_out_avx2(&x1[19], &x1[44], input[19], input[44]);
  407|   106k|  btf_16_adds_subs_out_avx2(&x1[20], &x1[43], input[20], input[43]);
  408|   106k|  btf_16_adds_subs_out_avx2(&x1[21], &x1[42], input[21], input[42]);
  409|   106k|  btf_16_adds_subs_out_avx2(&x1[22], &x1[41], input[22], input[41]);
  410|   106k|  btf_16_adds_subs_out_avx2(&x1[23], &x1[40], input[23], input[40]);
  411|   106k|  btf_16_adds_subs_out_avx2(&x1[24], &x1[39], input[24], input[39]);
  412|   106k|  btf_16_adds_subs_out_avx2(&x1[25], &x1[38], input[25], input[38]);
  413|   106k|  btf_16_adds_subs_out_avx2(&x1[26], &x1[37], input[26], input[37]);
  414|   106k|  btf_16_adds_subs_out_avx2(&x1[27], &x1[36], input[27], input[36]);
  415|   106k|  btf_16_adds_subs_out_avx2(&x1[28], &x1[35], input[28], input[35]);
  416|   106k|  btf_16_adds_subs_out_avx2(&x1[29], &x1[34], input[29], input[34]);
  417|   106k|  btf_16_adds_subs_out_avx2(&x1[30], &x1[33], input[30], input[33]);
  418|   106k|  btf_16_adds_subs_out_avx2(&x1[31], &x1[32], input[31], input[32]);
  419|       |
  420|       |  // stage 2
  421|   106k|  btf_16_adds_subs_avx2(&x1[0], &x1[31]);
  422|   106k|  btf_16_adds_subs_avx2(&x1[1], &x1[30]);
  423|   106k|  btf_16_adds_subs_avx2(&x1[2], &x1[29]);
  424|   106k|  btf_16_adds_subs_avx2(&x1[3], &x1[28]);
  425|   106k|  btf_16_adds_subs_avx2(&x1[4], &x1[27]);
  426|   106k|  btf_16_adds_subs_avx2(&x1[5], &x1[26]);
  427|   106k|  btf_16_adds_subs_avx2(&x1[6], &x1[25]);
  428|   106k|  btf_16_adds_subs_avx2(&x1[7], &x1[24]);
  429|   106k|  btf_16_adds_subs_avx2(&x1[8], &x1[23]);
  430|   106k|  btf_16_adds_subs_avx2(&x1[9], &x1[22]);
  431|   106k|  btf_16_adds_subs_avx2(&x1[10], &x1[21]);
  432|   106k|  btf_16_adds_subs_avx2(&x1[11], &x1[20]);
  433|   106k|  btf_16_adds_subs_avx2(&x1[12], &x1[19]);
  434|   106k|  btf_16_adds_subs_avx2(&x1[13], &x1[18]);
  435|   106k|  btf_16_adds_subs_avx2(&x1[14], &x1[17]);
  436|   106k|  btf_16_adds_subs_avx2(&x1[15], &x1[16]);
  437|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[40], &x1[55], _r, cos_bit);
  438|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[41], &x1[54], _r, cos_bit);
  439|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[42], &x1[53], _r, cos_bit);
  440|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[43], &x1[52], _r, cos_bit);
  441|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[44], &x1[51], _r, cos_bit);
  442|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[45], &x1[50], _r, cos_bit);
  443|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[46], &x1[49], _r, cos_bit);
  444|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[47], &x1[48], _r, cos_bit);
  445|       |
  446|       |  // stage 3
  447|   106k|  btf_16_adds_subs_avx2(&x1[0], &x1[15]);
  448|   106k|  btf_16_adds_subs_avx2(&x1[1], &x1[14]);
  449|   106k|  btf_16_adds_subs_avx2(&x1[2], &x1[13]);
  450|   106k|  btf_16_adds_subs_avx2(&x1[3], &x1[12]);
  451|   106k|  btf_16_adds_subs_avx2(&x1[4], &x1[11]);
  452|   106k|  btf_16_adds_subs_avx2(&x1[5], &x1[10]);
  453|   106k|  btf_16_adds_subs_avx2(&x1[6], &x1[9]);
  454|   106k|  btf_16_adds_subs_avx2(&x1[7], &x1[8]);
  455|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[20], &x1[27], _r, cos_bit);
  456|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[21], &x1[26], _r, cos_bit);
  457|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[22], &x1[25], _r, cos_bit);
  458|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[23], &x1[24], _r, cos_bit);
  459|   106k|  btf_16_adds_subs_avx2(&x1[32], &x1[47]);
  460|   106k|  btf_16_adds_subs_avx2(&x1[33], &x1[46]);
  461|   106k|  btf_16_adds_subs_avx2(&x1[34], &x1[45]);
  462|   106k|  btf_16_adds_subs_avx2(&x1[35], &x1[44]);
  463|   106k|  btf_16_adds_subs_avx2(&x1[36], &x1[43]);
  464|   106k|  btf_16_adds_subs_avx2(&x1[37], &x1[42]);
  465|   106k|  btf_16_adds_subs_avx2(&x1[38], &x1[41]);
  466|   106k|  btf_16_adds_subs_avx2(&x1[39], &x1[40]);
  467|   106k|  btf_16_adds_subs_avx2(&x1[63], &x1[48]);
  468|   106k|  btf_16_adds_subs_avx2(&x1[62], &x1[49]);
  469|   106k|  btf_16_adds_subs_avx2(&x1[61], &x1[50]);
  470|   106k|  btf_16_adds_subs_avx2(&x1[60], &x1[51]);
  471|   106k|  btf_16_adds_subs_avx2(&x1[59], &x1[52]);
  472|   106k|  btf_16_adds_subs_avx2(&x1[58], &x1[53]);
  473|   106k|  btf_16_adds_subs_avx2(&x1[57], &x1[54]);
  474|   106k|  btf_16_adds_subs_avx2(&x1[56], &x1[55]);
  475|       |
  476|       |  // stage 4
  477|   106k|  btf_16_adds_subs_avx2(&x1[0], &x1[7]);
  478|   106k|  btf_16_adds_subs_avx2(&x1[1], &x1[6]);
  479|   106k|  btf_16_adds_subs_avx2(&x1[2], &x1[5]);
  480|   106k|  btf_16_adds_subs_avx2(&x1[3], &x1[4]);
  481|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[10], &x1[13], _r, cos_bit);
  482|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[11], &x1[12], _r, cos_bit);
  483|   106k|  btf_16_adds_subs_avx2(&x1[16], &x1[23]);
  484|   106k|  btf_16_adds_subs_avx2(&x1[17], &x1[22]);
  485|   106k|  btf_16_adds_subs_avx2(&x1[18], &x1[21]);
  486|   106k|  btf_16_adds_subs_avx2(&x1[19], &x1[20]);
  487|   106k|  btf_16_adds_subs_avx2(&x1[31], &x1[24]);
  488|   106k|  btf_16_adds_subs_avx2(&x1[30], &x1[25]);
  489|   106k|  btf_16_adds_subs_avx2(&x1[29], &x1[26]);
  490|   106k|  btf_16_adds_subs_avx2(&x1[28], &x1[27]);
  491|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[36], &x1[59], _r, cos_bit);
  492|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[37], &x1[58], _r, cos_bit);
  493|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[38], &x1[57], _r, cos_bit);
  494|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[39], &x1[56], _r, cos_bit);
  495|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[40], &x1[55], _r, cos_bit);
  496|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[41], &x1[54], _r, cos_bit);
  497|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[42], &x1[53], _r, cos_bit);
  498|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[43], &x1[52], _r, cos_bit);
  499|       |
  500|       |  // stage 5
  501|   106k|  btf_16_adds_subs_avx2(&x1[0], &x1[3]);
  502|   106k|  btf_16_adds_subs_avx2(&x1[1], &x1[2]);
  503|   106k|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[5], &x1[6], _r, cos_bit);
  504|   106k|  btf_16_adds_subs_avx2(&x1[8], &x1[11]);
  505|   106k|  btf_16_adds_subs_avx2(&x1[9], &x1[10]);
  506|   106k|  btf_16_adds_subs_avx2(&x1[15], &x1[12]);
  507|   106k|  btf_16_adds_subs_avx2(&x1[14], &x1[13]);
  508|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[18], &x1[29], _r, cos_bit);
  509|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[19], &x1[28], _r, cos_bit);
  510|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[20], &x1[27], _r, cos_bit);
  511|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[21], &x1[26], _r, cos_bit);
  512|   106k|  btf_16_adds_subs_avx2(&x1[32], &x1[39]);
  513|   106k|  btf_16_adds_subs_avx2(&x1[33], &x1[38]);
  514|   106k|  btf_16_adds_subs_avx2(&x1[34], &x1[37]);
  515|   106k|  btf_16_adds_subs_avx2(&x1[35], &x1[36]);
  516|   106k|  btf_16_adds_subs_avx2(&x1[47], &x1[40]);
  517|   106k|  btf_16_adds_subs_avx2(&x1[46], &x1[41]);
  518|   106k|  btf_16_adds_subs_avx2(&x1[45], &x1[42]);
  519|   106k|  btf_16_adds_subs_avx2(&x1[44], &x1[43]);
  520|   106k|  btf_16_adds_subs_avx2(&x1[48], &x1[55]);
  521|   106k|  btf_16_adds_subs_avx2(&x1[49], &x1[54]);
  522|   106k|  btf_16_adds_subs_avx2(&x1[50], &x1[53]);
  523|   106k|  btf_16_adds_subs_avx2(&x1[51], &x1[52]);
  524|   106k|  btf_16_adds_subs_avx2(&x1[63], &x1[56]);
  525|   106k|  btf_16_adds_subs_avx2(&x1[62], &x1[57]);
  526|   106k|  btf_16_adds_subs_avx2(&x1[61], &x1[58]);
  527|   106k|  btf_16_adds_subs_avx2(&x1[60], &x1[59]);
  528|       |
  529|       |  // stage 6
  530|   106k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[0], &x1[1], _r, cos_bit);
  531|   106k|  btf_16_w16_avx2(cospi_p48_p16, cospi_m16_p48, &x1[2], &x1[3], _r, cos_bit);
  532|   106k|  btf_16_adds_subs_avx2(&x1[4], &x1[5]);
  533|   106k|  btf_16_adds_subs_avx2(&x1[7], &x1[6]);
  534|   106k|  btf_16_w16_avx2(cospi_m16_p48, cospi_p48_p16, &x1[9], &x1[14], _r, cos_bit);
  535|   106k|  btf_16_w16_avx2(cospi_m48_m16, cospi_m16_p48, &x1[10], &x1[13], _r, cos_bit);
  536|   106k|  btf_16_adds_subs_avx2(&x1[16], &x1[19]);
  537|   106k|  btf_16_adds_subs_avx2(&x1[17], &x1[18]);
  538|   106k|  btf_16_adds_subs_avx2(&x1[23], &x1[20]);
  539|   106k|  btf_16_adds_subs_avx2(&x1[22], &x1[21]);
  540|   106k|  btf_16_adds_subs_avx2(&x1[24], &x1[27]);
  541|   106k|  btf_16_adds_subs_avx2(&x1[25], &x1[26]);
  542|   106k|  btf_16_adds_subs_avx2(&x1[31], &x1[28]);
  543|   106k|  btf_16_adds_subs_avx2(&x1[30], &x1[29]);
  544|   106k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x1[34], &x1[61], _r, cos_bit);
  545|   106k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x1[35], &x1[60], _r, cos_bit);
  546|   106k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x1[36], &x1[59], _r, cos_bit);
  547|   106k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x1[37], &x1[58], _r, cos_bit);
  548|   106k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x1[42], &x1[53], _r, cos_bit);
  549|   106k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x1[43], &x1[52], _r, cos_bit);
  550|   106k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x1[44], &x1[51], _r, cos_bit);
  551|   106k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x1[45], &x1[50], _r, cos_bit);
  552|       |
  553|       |  // stage 7
  554|   106k|  btf_16_w16_avx2(cospi_p56_p08, cospi_m08_p56, &x1[4], &x1[7], _r, cos_bit);
  555|   106k|  btf_16_w16_avx2(cospi_p24_p40, cospi_m40_p24, &x1[5], &x1[6], _r, cos_bit);
  556|   106k|  btf_16_adds_subs_avx2(&x1[8], &x1[9]);
  557|   106k|  btf_16_adds_subs_avx2(&x1[11], &x1[10]);
  558|   106k|  btf_16_adds_subs_avx2(&x1[12], &x1[13]);
  559|   106k|  btf_16_adds_subs_avx2(&x1[15], &x1[14]);
  560|   106k|  btf_16_w16_avx2(cospi_m08_p56, cospi_p56_p08, &x1[17], &x1[30], _r, cos_bit);
  561|   106k|  btf_16_w16_avx2(cospi_m56_m08, cospi_m08_p56, &x1[18], &x1[29], _r, cos_bit);
  562|   106k|  btf_16_w16_avx2(cospi_m40_p24, cospi_p24_p40, &x1[21], &x1[26], _r, cos_bit);
  563|   106k|  btf_16_w16_avx2(cospi_m24_m40, cospi_m40_p24, &x1[22], &x1[25], _r, cos_bit);
  564|   106k|  btf_16_adds_subs_avx2(&x1[32], &x1[35]);
  565|   106k|  btf_16_adds_subs_avx2(&x1[33], &x1[34]);
  566|   106k|  btf_16_adds_subs_avx2(&x1[39], &x1[36]);
  567|   106k|  btf_16_adds_subs_avx2(&x1[38], &x1[37]);
  568|   106k|  btf_16_adds_subs_avx2(&x1[40], &x1[43]);
  569|   106k|  btf_16_adds_subs_avx2(&x1[41], &x1[42]);
  570|   106k|  btf_16_adds_subs_avx2(&x1[47], &x1[44]);
  571|   106k|  btf_16_adds_subs_avx2(&x1[46], &x1[45]);
  572|   106k|  btf_16_adds_subs_avx2(&x1[48], &x1[51]);
  573|   106k|  btf_16_adds_subs_avx2(&x1[49], &x1[50]);
  574|   106k|  btf_16_adds_subs_avx2(&x1[55], &x1[52]);
  575|   106k|  btf_16_adds_subs_avx2(&x1[54], &x1[53]);
  576|   106k|  btf_16_adds_subs_avx2(&x1[56], &x1[59]);
  577|   106k|  btf_16_adds_subs_avx2(&x1[57], &x1[58]);
  578|   106k|  btf_16_adds_subs_avx2(&x1[63], &x1[60]);
  579|   106k|  btf_16_adds_subs_avx2(&x1[62], &x1[61]);
  580|       |
  581|       |  // stage 8
  582|   106k|  btf_16_w16_avx2(cospi_p60_p04, cospi_m04_p60, &x1[8], &x1[15], _r, cos_bit);
  583|   106k|  btf_16_w16_avx2(cospi_p28_p36, cospi_m36_p28, &x1[9], &x1[14], _r, cos_bit);
  584|   106k|  btf_16_w16_avx2(cospi_p44_p20, cospi_m20_p44, &x1[10], &x1[13], _r, cos_bit);
  585|   106k|  btf_16_w16_avx2(cospi_p12_p52, cospi_m52_p12, &x1[11], &x1[12], _r, cos_bit);
  586|   106k|  btf_16_adds_subs_avx2(&x1[16], &x1[17]);
  587|   106k|  btf_16_adds_subs_avx2(&x1[19], &x1[18]);
  588|   106k|  btf_16_adds_subs_avx2(&x1[20], &x1[21]);
  589|   106k|  btf_16_adds_subs_avx2(&x1[23], &x1[22]);
  590|   106k|  btf_16_adds_subs_avx2(&x1[24], &x1[25]);
  591|   106k|  btf_16_adds_subs_avx2(&x1[27], &x1[26]);
  592|   106k|  btf_16_adds_subs_avx2(&x1[28], &x1[29]);
  593|   106k|  btf_16_adds_subs_avx2(&x1[31], &x1[30]);
  594|   106k|  btf_16_w16_avx2(cospi_m04_p60, cospi_p60_p04, &x1[33], &x1[62], _r, cos_bit);
  595|   106k|  btf_16_w16_avx2(cospi_m60_m04, cospi_m04_p60, &x1[34], &x1[61], _r, cos_bit);
  596|   106k|  btf_16_w16_avx2(cospi_m36_p28, cospi_p28_p36, &x1[37], &x1[58], _r, cos_bit);
  597|   106k|  btf_16_w16_avx2(cospi_m28_m36, cospi_m36_p28, &x1[38], &x1[57], _r, cos_bit);
  598|   106k|  btf_16_w16_avx2(cospi_m20_p44, cospi_p44_p20, &x1[41], &x1[54], _r, cos_bit);
  599|   106k|  btf_16_w16_avx2(cospi_m44_m20, cospi_m20_p44, &x1[42], &x1[53], _r, cos_bit);
  600|   106k|  btf_16_w16_avx2(cospi_m52_p12, cospi_p12_p52, &x1[45], &x1[50], _r, cos_bit);
  601|   106k|  btf_16_w16_avx2(cospi_m12_m52, cospi_m52_p12, &x1[46], &x1[49], _r, cos_bit);
  602|       |
  603|       |  // stage 9
  604|   106k|  btf_16_w16_avx2(cospi_p62_p02, cospi_m02_p62, &x1[16], &x1[31], _r, cos_bit);
  605|   106k|  btf_16_w16_avx2(cospi_p30_p34, cospi_m34_p30, &x1[17], &x1[30], _r, cos_bit);
  606|   106k|  btf_16_w16_avx2(cospi_p46_p18, cospi_m18_p46, &x1[18], &x1[29], _r, cos_bit);
  607|   106k|  btf_16_w16_avx2(cospi_p14_p50, cospi_m50_p14, &x1[19], &x1[28], _r, cos_bit);
  608|   106k|  btf_16_w16_avx2(cospi_p54_p10, cospi_m10_p54, &x1[20], &x1[27], _r, cos_bit);
  609|   106k|  btf_16_w16_avx2(cospi_p22_p42, cospi_m42_p22, &x1[21], &x1[26], _r, cos_bit);
  610|   106k|  btf_16_w16_avx2(cospi_p38_p26, cospi_m26_p38, &x1[22], &x1[25], _r, cos_bit);
  611|   106k|  btf_16_w16_avx2(cospi_p06_p58, cospi_m58_p06, &x1[23], &x1[24], _r, cos_bit);
  612|   106k|  btf_16_adds_subs_avx2(&x1[32], &x1[33]);
  613|   106k|  btf_16_adds_subs_avx2(&x1[35], &x1[34]);
  614|   106k|  btf_16_adds_subs_avx2(&x1[36], &x1[37]);
  615|   106k|  btf_16_adds_subs_avx2(&x1[39], &x1[38]);
  616|   106k|  btf_16_adds_subs_avx2(&x1[40], &x1[41]);
  617|   106k|  btf_16_adds_subs_avx2(&x1[43], &x1[42]);
  618|   106k|  btf_16_adds_subs_avx2(&x1[44], &x1[45]);
  619|   106k|  btf_16_adds_subs_avx2(&x1[47], &x1[46]);
  620|   106k|  btf_16_adds_subs_avx2(&x1[48], &x1[49]);
  621|   106k|  btf_16_adds_subs_avx2(&x1[51], &x1[50]);
  622|   106k|  btf_16_adds_subs_avx2(&x1[52], &x1[53]);
  623|   106k|  btf_16_adds_subs_avx2(&x1[55], &x1[54]);
  624|   106k|  btf_16_adds_subs_avx2(&x1[56], &x1[57]);
  625|   106k|  btf_16_adds_subs_avx2(&x1[59], &x1[58]);
  626|   106k|  btf_16_adds_subs_avx2(&x1[60], &x1[61]);
  627|   106k|  btf_16_adds_subs_avx2(&x1[63], &x1[62]);
  628|       |
  629|       |  // stage 10
  630|   106k|  btf_16_w16_avx2(cospi_p63_p01, cospi_m01_p63, &x1[32], &x1[63], _r, cos_bit);
  631|   106k|  btf_16_w16_avx2(cospi_p31_p33, cospi_m33_p31, &x1[33], &x1[62], _r, cos_bit);
  632|   106k|  btf_16_w16_avx2(cospi_p47_p17, cospi_m17_p47, &x1[34], &x1[61], _r, cos_bit);
  633|   106k|  btf_16_w16_avx2(cospi_p15_p49, cospi_m49_p15, &x1[35], &x1[60], _r, cos_bit);
  634|   106k|  btf_16_w16_avx2(cospi_p55_p09, cospi_m09_p55, &x1[36], &x1[59], _r, cos_bit);
  635|   106k|  btf_16_w16_avx2(cospi_p23_p41, cospi_m41_p23, &x1[37], &x1[58], _r, cos_bit);
  636|   106k|  btf_16_w16_avx2(cospi_p39_p25, cospi_m25_p39, &x1[38], &x1[57], _r, cos_bit);
  637|   106k|  btf_16_w16_avx2(cospi_p07_p57, cospi_m57_p07, &x1[39], &x1[56], _r, cos_bit);
  638|   106k|  btf_16_w16_avx2(cospi_p59_p05, cospi_m05_p59, &x1[40], &x1[55], _r, cos_bit);
  639|   106k|  btf_16_w16_avx2(cospi_p27_p37, cospi_m37_p27, &x1[41], &x1[54], _r, cos_bit);
  640|   106k|  btf_16_w16_avx2(cospi_p43_p21, cospi_m21_p43, &x1[42], &x1[53], _r, cos_bit);
  641|   106k|  btf_16_w16_avx2(cospi_p11_p53, cospi_m53_p11, &x1[43], &x1[52], _r, cos_bit);
  642|   106k|  btf_16_w16_avx2(cospi_p51_p13, cospi_m13_p51, &x1[44], &x1[51], _r, cos_bit);
  643|   106k|  btf_16_w16_avx2(cospi_p19_p45, cospi_m45_p19, &x1[45], &x1[50], _r, cos_bit);
  644|   106k|  btf_16_w16_avx2(cospi_p35_p29, cospi_m29_p35, &x1[46], &x1[49], _r, cos_bit);
  645|   106k|  btf_16_w16_avx2(cospi_p03_p61, cospi_m61_p03, &x1[47], &x1[48], _r, cos_bit);
  646|       |
  647|       |  // stage 11
  648|   106k|  output[0] = x1[0];
  649|   106k|  output[1] = x1[32];
  650|   106k|  output[2] = x1[16];
  651|   106k|  output[3] = x1[48];
  652|   106k|  output[4] = x1[8];
  653|   106k|  output[5] = x1[40];
  654|   106k|  output[6] = x1[24];
  655|   106k|  output[7] = x1[56];
  656|   106k|  output[8] = x1[4];
  657|   106k|  output[9] = x1[36];
  658|   106k|  output[10] = x1[20];
  659|   106k|  output[11] = x1[52];
  660|   106k|  output[12] = x1[12];
  661|   106k|  output[13] = x1[44];
  662|   106k|  output[14] = x1[28];
  663|   106k|  output[15] = x1[60];
  664|   106k|  output[16] = x1[2];
  665|   106k|  output[17] = x1[34];
  666|   106k|  output[18] = x1[18];
  667|   106k|  output[19] = x1[50];
  668|   106k|  output[20] = x1[10];
  669|   106k|  output[21] = x1[42];
  670|   106k|  output[22] = x1[26];
  671|   106k|  output[23] = x1[58];
  672|   106k|  output[24] = x1[6];
  673|   106k|  output[25] = x1[38];
  674|   106k|  output[26] = x1[22];
  675|   106k|  output[27] = x1[54];
  676|   106k|  output[28] = x1[14];
  677|   106k|  output[29] = x1[46];
  678|   106k|  output[30] = x1[30];
  679|   106k|  output[31] = x1[62];
  680|   106k|  output[32] = x1[1];
  681|   106k|  output[33] = x1[33];
  682|   106k|  output[34] = x1[17];
  683|   106k|  output[35] = x1[49];
  684|   106k|  output[36] = x1[9];
  685|   106k|  output[37] = x1[41];
  686|   106k|  output[38] = x1[25];
  687|   106k|  output[39] = x1[57];
  688|   106k|  output[40] = x1[5];
  689|   106k|  output[41] = x1[37];
  690|   106k|  output[42] = x1[21];
  691|   106k|  output[43] = x1[53];
  692|   106k|  output[44] = x1[13];
  693|   106k|  output[45] = x1[45];
  694|   106k|  output[46] = x1[29];
  695|   106k|  output[47] = x1[61];
  696|   106k|  output[48] = x1[3];
  697|   106k|  output[49] = x1[35];
  698|   106k|  output[50] = x1[19];
  699|   106k|  output[51] = x1[51];
  700|   106k|  output[52] = x1[11];
  701|   106k|  output[53] = x1[43];
  702|   106k|  output[54] = x1[27];
  703|   106k|  output[55] = x1[59];
  704|   106k|  output[56] = x1[7];
  705|   106k|  output[57] = x1[39];
  706|   106k|  output[58] = x1[23];
  707|   106k|  output[59] = x1[55];
  708|   106k|  output[60] = x1[15];
  709|   106k|  output[61] = x1[47];
  710|   106k|  output[62] = x1[31];
  711|   106k|  output[63] = x1[63];
  712|   106k|}
av1_fwd_txfm2d_avx2.c:fdct64_new_avx2:
  869|   111k|                                   int8_t cos_bit) {
  870|   111k|  const int32_t *cospi = cospi_arr(cos_bit);
  871|   111k|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
  872|       |
  873|   111k|  __m256i cospi_m32 = _mm256_set1_epi32(-cospi[32]);
  874|   111k|  __m256i cospi_p32 = _mm256_set1_epi32(cospi[32]);
  875|   111k|  __m256i cospi_m16 = _mm256_set1_epi32(-cospi[16]);
  876|   111k|  __m256i cospi_p48 = _mm256_set1_epi32(cospi[48]);
  877|   111k|  __m256i cospi_m48 = _mm256_set1_epi32(-cospi[48]);
  878|   111k|  __m256i cospi_p16 = _mm256_set1_epi32(cospi[16]);
  879|   111k|  __m256i cospi_m08 = _mm256_set1_epi32(-cospi[8]);
  880|   111k|  __m256i cospi_p56 = _mm256_set1_epi32(cospi[56]);
  881|   111k|  __m256i cospi_m56 = _mm256_set1_epi32(-cospi[56]);
  882|   111k|  __m256i cospi_m40 = _mm256_set1_epi32(-cospi[40]);
  883|   111k|  __m256i cospi_p24 = _mm256_set1_epi32(cospi[24]);
  884|   111k|  __m256i cospi_m24 = _mm256_set1_epi32(-cospi[24]);
  885|   111k|  __m256i cospi_p08 = _mm256_set1_epi32(cospi[8]);
  886|   111k|  __m256i cospi_p40 = _mm256_set1_epi32(cospi[40]);
  887|   111k|  __m256i cospi_p60 = _mm256_set1_epi32(cospi[60]);
  888|   111k|  __m256i cospi_p04 = _mm256_set1_epi32(cospi[4]);
  889|   111k|  __m256i cospi_p28 = _mm256_set1_epi32(cospi[28]);
  890|   111k|  __m256i cospi_p36 = _mm256_set1_epi32(cospi[36]);
  891|   111k|  __m256i cospi_p44 = _mm256_set1_epi32(cospi[44]);
  892|   111k|  __m256i cospi_p20 = _mm256_set1_epi32(cospi[20]);
  893|   111k|  __m256i cospi_p12 = _mm256_set1_epi32(cospi[12]);
  894|   111k|  __m256i cospi_p52 = _mm256_set1_epi32(cospi[52]);
  895|   111k|  __m256i cospi_m04 = _mm256_set1_epi32(-cospi[4]);
  896|   111k|  __m256i cospi_m60 = _mm256_set1_epi32(-cospi[60]);
  897|   111k|  __m256i cospi_m36 = _mm256_set1_epi32(-cospi[36]);
  898|   111k|  __m256i cospi_m28 = _mm256_set1_epi32(-cospi[28]);
  899|   111k|  __m256i cospi_m20 = _mm256_set1_epi32(-cospi[20]);
  900|   111k|  __m256i cospi_m44 = _mm256_set1_epi32(-cospi[44]);
  901|   111k|  __m256i cospi_m52 = _mm256_set1_epi32(-cospi[52]);
  902|   111k|  __m256i cospi_m12 = _mm256_set1_epi32(-cospi[12]);
  903|   111k|  __m256i cospi_p62 = _mm256_set1_epi32(cospi[62]);
  904|   111k|  __m256i cospi_p02 = _mm256_set1_epi32(cospi[2]);
  905|   111k|  __m256i cospi_p30 = _mm256_set1_epi32(cospi[30]);
  906|   111k|  __m256i cospi_p34 = _mm256_set1_epi32(cospi[34]);
  907|   111k|  __m256i cospi_p46 = _mm256_set1_epi32(cospi[46]);
  908|   111k|  __m256i cospi_p18 = _mm256_set1_epi32(cospi[18]);
  909|   111k|  __m256i cospi_p14 = _mm256_set1_epi32(cospi[14]);
  910|   111k|  __m256i cospi_p50 = _mm256_set1_epi32(cospi[50]);
  911|   111k|  __m256i cospi_p54 = _mm256_set1_epi32(cospi[54]);
  912|   111k|  __m256i cospi_p10 = _mm256_set1_epi32(cospi[10]);
  913|   111k|  __m256i cospi_p22 = _mm256_set1_epi32(cospi[22]);
  914|   111k|  __m256i cospi_p42 = _mm256_set1_epi32(cospi[42]);
  915|   111k|  __m256i cospi_p38 = _mm256_set1_epi32(cospi[38]);
  916|   111k|  __m256i cospi_p26 = _mm256_set1_epi32(cospi[26]);
  917|   111k|  __m256i cospi_p06 = _mm256_set1_epi32(cospi[6]);
  918|   111k|  __m256i cospi_p58 = _mm256_set1_epi32(cospi[58]);
  919|   111k|  __m256i cospi_p63 = _mm256_set1_epi32(cospi[63]);
  920|   111k|  __m256i cospi_p01 = _mm256_set1_epi32(cospi[1]);
  921|   111k|  __m256i cospi_p31 = _mm256_set1_epi32(cospi[31]);
  922|   111k|  __m256i cospi_p33 = _mm256_set1_epi32(cospi[33]);
  923|   111k|  __m256i cospi_p47 = _mm256_set1_epi32(cospi[47]);
  924|   111k|  __m256i cospi_p17 = _mm256_set1_epi32(cospi[17]);
  925|   111k|  __m256i cospi_p15 = _mm256_set1_epi32(cospi[15]);
  926|   111k|  __m256i cospi_p49 = _mm256_set1_epi32(cospi[49]);
  927|   111k|  __m256i cospi_p55 = _mm256_set1_epi32(cospi[55]);
  928|   111k|  __m256i cospi_p09 = _mm256_set1_epi32(cospi[9]);
  929|   111k|  __m256i cospi_p23 = _mm256_set1_epi32(cospi[23]);
  930|   111k|  __m256i cospi_p41 = _mm256_set1_epi32(cospi[41]);
  931|   111k|  __m256i cospi_p39 = _mm256_set1_epi32(cospi[39]);
  932|   111k|  __m256i cospi_p25 = _mm256_set1_epi32(cospi[25]);
  933|   111k|  __m256i cospi_p07 = _mm256_set1_epi32(cospi[7]);
  934|   111k|  __m256i cospi_p57 = _mm256_set1_epi32(cospi[57]);
  935|   111k|  __m256i cospi_p59 = _mm256_set1_epi32(cospi[59]);
  936|   111k|  __m256i cospi_p05 = _mm256_set1_epi32(cospi[5]);
  937|   111k|  __m256i cospi_p27 = _mm256_set1_epi32(cospi[27]);
  938|   111k|  __m256i cospi_p37 = _mm256_set1_epi32(cospi[37]);
  939|   111k|  __m256i cospi_p43 = _mm256_set1_epi32(cospi[43]);
  940|   111k|  __m256i cospi_p21 = _mm256_set1_epi32(cospi[21]);
  941|   111k|  __m256i cospi_p11 = _mm256_set1_epi32(cospi[11]);
  942|   111k|  __m256i cospi_p53 = _mm256_set1_epi32(cospi[53]);
  943|   111k|  __m256i cospi_p51 = _mm256_set1_epi32(cospi[51]);
  944|   111k|  __m256i cospi_p13 = _mm256_set1_epi32(cospi[13]);
  945|   111k|  __m256i cospi_p19 = _mm256_set1_epi32(cospi[19]);
  946|   111k|  __m256i cospi_p45 = _mm256_set1_epi32(cospi[45]);
  947|   111k|  __m256i cospi_p35 = _mm256_set1_epi32(cospi[35]);
  948|   111k|  __m256i cospi_p29 = _mm256_set1_epi32(cospi[29]);
  949|   111k|  __m256i cospi_p03 = _mm256_set1_epi32(cospi[3]);
  950|   111k|  __m256i cospi_p61 = _mm256_set1_epi32(cospi[61]);
  951|       |
  952|       |  // stage 1
  953|   111k|  __m256i x1[64];
  954|   111k|  btf_32_add_sub_out_avx2(&x1[0], &x1[63], input[0], input[63]);
  955|   111k|  btf_32_add_sub_out_avx2(&x1[1], &x1[62], input[1], input[62]);
  956|   111k|  btf_32_add_sub_out_avx2(&x1[2], &x1[61], input[2], input[61]);
  957|   111k|  btf_32_add_sub_out_avx2(&x1[3], &x1[60], input[3], input[60]);
  958|   111k|  btf_32_add_sub_out_avx2(&x1[4], &x1[59], input[4], input[59]);
  959|   111k|  btf_32_add_sub_out_avx2(&x1[5], &x1[58], input[5], input[58]);
  960|   111k|  btf_32_add_sub_out_avx2(&x1[6], &x1[57], input[6], input[57]);
  961|   111k|  btf_32_add_sub_out_avx2(&x1[7], &x1[56], input[7], input[56]);
  962|   111k|  btf_32_add_sub_out_avx2(&x1[8], &x1[55], input[8], input[55]);
  963|   111k|  btf_32_add_sub_out_avx2(&x1[9], &x1[54], input[9], input[54]);
  964|   111k|  btf_32_add_sub_out_avx2(&x1[10], &x1[53], input[10], input[53]);
  965|   111k|  btf_32_add_sub_out_avx2(&x1[11], &x1[52], input[11], input[52]);
  966|   111k|  btf_32_add_sub_out_avx2(&x1[12], &x1[51], input[12], input[51]);
  967|   111k|  btf_32_add_sub_out_avx2(&x1[13], &x1[50], input[13], input[50]);
  968|   111k|  btf_32_add_sub_out_avx2(&x1[14], &x1[49], input[14], input[49]);
  969|   111k|  btf_32_add_sub_out_avx2(&x1[15], &x1[48], input[15], input[48]);
  970|   111k|  btf_32_add_sub_out_avx2(&x1[16], &x1[47], input[16], input[47]);
  971|   111k|  btf_32_add_sub_out_avx2(&x1[17], &x1[46], input[17], input[46]);
  972|   111k|  btf_32_add_sub_out_avx2(&x1[18], &x1[45], input[18], input[45]);
  973|   111k|  btf_32_add_sub_out_avx2(&x1[19], &x1[44], input[19], input[44]);
  974|   111k|  btf_32_add_sub_out_avx2(&x1[20], &x1[43], input[20], input[43]);
  975|   111k|  btf_32_add_sub_out_avx2(&x1[21], &x1[42], input[21], input[42]);
  976|   111k|  btf_32_add_sub_out_avx2(&x1[22], &x1[41], input[22], input[41]);
  977|   111k|  btf_32_add_sub_out_avx2(&x1[23], &x1[40], input[23], input[40]);
  978|   111k|  btf_32_add_sub_out_avx2(&x1[24], &x1[39], input[24], input[39]);
  979|   111k|  btf_32_add_sub_out_avx2(&x1[25], &x1[38], input[25], input[38]);
  980|   111k|  btf_32_add_sub_out_avx2(&x1[26], &x1[37], input[26], input[37]);
  981|   111k|  btf_32_add_sub_out_avx2(&x1[27], &x1[36], input[27], input[36]);
  982|   111k|  btf_32_add_sub_out_avx2(&x1[28], &x1[35], input[28], input[35]);
  983|   111k|  btf_32_add_sub_out_avx2(&x1[29], &x1[34], input[29], input[34]);
  984|   111k|  btf_32_add_sub_out_avx2(&x1[30], &x1[33], input[30], input[33]);
  985|   111k|  btf_32_add_sub_out_avx2(&x1[31], &x1[32], input[31], input[32]);
  986|       |
  987|       |  // stage 2
  988|   111k|  btf_32_add_sub_avx2(&x1[0], &x1[31]);
  989|   111k|  btf_32_add_sub_avx2(&x1[1], &x1[30]);
  990|   111k|  btf_32_add_sub_avx2(&x1[2], &x1[29]);
  991|   111k|  btf_32_add_sub_avx2(&x1[3], &x1[28]);
  992|   111k|  btf_32_add_sub_avx2(&x1[4], &x1[27]);
  993|   111k|  btf_32_add_sub_avx2(&x1[5], &x1[26]);
  994|   111k|  btf_32_add_sub_avx2(&x1[6], &x1[25]);
  995|   111k|  btf_32_add_sub_avx2(&x1[7], &x1[24]);
  996|   111k|  btf_32_add_sub_avx2(&x1[8], &x1[23]);
  997|   111k|  btf_32_add_sub_avx2(&x1[9], &x1[22]);
  998|   111k|  btf_32_add_sub_avx2(&x1[10], &x1[21]);
  999|   111k|  btf_32_add_sub_avx2(&x1[11], &x1[20]);
 1000|   111k|  btf_32_add_sub_avx2(&x1[12], &x1[19]);
 1001|   111k|  btf_32_add_sub_avx2(&x1[13], &x1[18]);
 1002|   111k|  btf_32_add_sub_avx2(&x1[14], &x1[17]);
 1003|   111k|  btf_32_add_sub_avx2(&x1[15], &x1[16]);
 1004|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[40], &x1[55], _r, cos_bit);
 1005|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[41], &x1[54], _r, cos_bit);
 1006|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[42], &x1[53], _r, cos_bit);
 1007|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[43], &x1[52], _r, cos_bit);
 1008|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[44], &x1[51], _r, cos_bit);
 1009|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[45], &x1[50], _r, cos_bit);
 1010|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[46], &x1[49], _r, cos_bit);
 1011|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[47], &x1[48], _r, cos_bit);
 1012|       |
 1013|       |  // stage 3
 1014|   111k|  btf_32_add_sub_avx2(&x1[0], &x1[15]);
 1015|   111k|  btf_32_add_sub_avx2(&x1[1], &x1[14]);
 1016|   111k|  btf_32_add_sub_avx2(&x1[2], &x1[13]);
 1017|   111k|  btf_32_add_sub_avx2(&x1[3], &x1[12]);
 1018|   111k|  btf_32_add_sub_avx2(&x1[4], &x1[11]);
 1019|   111k|  btf_32_add_sub_avx2(&x1[5], &x1[10]);
 1020|   111k|  btf_32_add_sub_avx2(&x1[6], &x1[9]);
 1021|   111k|  btf_32_add_sub_avx2(&x1[7], &x1[8]);
 1022|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[20], &x1[27], _r, cos_bit);
 1023|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[21], &x1[26], _r, cos_bit);
 1024|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[22], &x1[25], _r, cos_bit);
 1025|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[23], &x1[24], _r, cos_bit);
 1026|   111k|  btf_32_add_sub_avx2(&x1[32], &x1[47]);
 1027|   111k|  btf_32_add_sub_avx2(&x1[33], &x1[46]);
 1028|   111k|  btf_32_add_sub_avx2(&x1[34], &x1[45]);
 1029|   111k|  btf_32_add_sub_avx2(&x1[35], &x1[44]);
 1030|   111k|  btf_32_add_sub_avx2(&x1[36], &x1[43]);
 1031|   111k|  btf_32_add_sub_avx2(&x1[37], &x1[42]);
 1032|   111k|  btf_32_add_sub_avx2(&x1[38], &x1[41]);
 1033|   111k|  btf_32_add_sub_avx2(&x1[39], &x1[40]);
 1034|   111k|  btf_32_add_sub_avx2(&x1[63], &x1[48]);
 1035|   111k|  btf_32_add_sub_avx2(&x1[62], &x1[49]);
 1036|   111k|  btf_32_add_sub_avx2(&x1[61], &x1[50]);
 1037|   111k|  btf_32_add_sub_avx2(&x1[60], &x1[51]);
 1038|   111k|  btf_32_add_sub_avx2(&x1[59], &x1[52]);
 1039|   111k|  btf_32_add_sub_avx2(&x1[58], &x1[53]);
 1040|   111k|  btf_32_add_sub_avx2(&x1[57], &x1[54]);
 1041|   111k|  btf_32_add_sub_avx2(&x1[56], &x1[55]);
 1042|       |
 1043|       |  // stage 4
 1044|   111k|  btf_32_add_sub_avx2(&x1[0], &x1[7]);
 1045|   111k|  btf_32_add_sub_avx2(&x1[1], &x1[6]);
 1046|   111k|  btf_32_add_sub_avx2(&x1[2], &x1[5]);
 1047|   111k|  btf_32_add_sub_avx2(&x1[3], &x1[4]);
 1048|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[10], &x1[13], _r, cos_bit);
 1049|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[11], &x1[12], _r, cos_bit);
 1050|   111k|  btf_32_add_sub_avx2(&x1[16], &x1[23]);
 1051|   111k|  btf_32_add_sub_avx2(&x1[17], &x1[22]);
 1052|   111k|  btf_32_add_sub_avx2(&x1[18], &x1[21]);
 1053|   111k|  btf_32_add_sub_avx2(&x1[19], &x1[20]);
 1054|   111k|  btf_32_add_sub_avx2(&x1[31], &x1[24]);
 1055|   111k|  btf_32_add_sub_avx2(&x1[30], &x1[25]);
 1056|   111k|  btf_32_add_sub_avx2(&x1[29], &x1[26]);
 1057|   111k|  btf_32_add_sub_avx2(&x1[28], &x1[27]);
 1058|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[36], &x1[59], _r, cos_bit);
 1059|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[37], &x1[58], _r, cos_bit);
 1060|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[38], &x1[57], _r, cos_bit);
 1061|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[39], &x1[56], _r, cos_bit);
 1062|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[40], &x1[55], _r, cos_bit);
 1063|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[41], &x1[54], _r, cos_bit);
 1064|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[42], &x1[53], _r, cos_bit);
 1065|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[43], &x1[52], _r, cos_bit);
 1066|       |
 1067|       |  // stage 5
 1068|   111k|  btf_32_add_sub_avx2(&x1[0], &x1[3]);
 1069|   111k|  btf_32_add_sub_avx2(&x1[1], &x1[2]);
 1070|   111k|  btf_32_avx2_type0_new(cospi_m32, cospi_p32, &x1[5], &x1[6], _r, cos_bit);
 1071|   111k|  btf_32_add_sub_avx2(&x1[8], &x1[11]);
 1072|   111k|  btf_32_add_sub_avx2(&x1[9], &x1[10]);
 1073|   111k|  btf_32_add_sub_avx2(&x1[15], &x1[12]);
 1074|   111k|  btf_32_add_sub_avx2(&x1[14], &x1[13]);
 1075|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[18], &x1[29], _r, cos_bit);
 1076|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[19], &x1[28], _r, cos_bit);
 1077|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[20], &x1[27], _r, cos_bit);
 1078|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[21], &x1[26], _r, cos_bit);
 1079|   111k|  btf_32_add_sub_avx2(&x1[32], &x1[39]);
 1080|   111k|  btf_32_add_sub_avx2(&x1[33], &x1[38]);
 1081|   111k|  btf_32_add_sub_avx2(&x1[34], &x1[37]);
 1082|   111k|  btf_32_add_sub_avx2(&x1[35], &x1[36]);
 1083|   111k|  btf_32_add_sub_avx2(&x1[47], &x1[40]);
 1084|   111k|  btf_32_add_sub_avx2(&x1[46], &x1[41]);
 1085|   111k|  btf_32_add_sub_avx2(&x1[45], &x1[42]);
 1086|   111k|  btf_32_add_sub_avx2(&x1[44], &x1[43]);
 1087|   111k|  btf_32_add_sub_avx2(&x1[48], &x1[55]);
 1088|   111k|  btf_32_add_sub_avx2(&x1[49], &x1[54]);
 1089|   111k|  btf_32_add_sub_avx2(&x1[50], &x1[53]);
 1090|   111k|  btf_32_add_sub_avx2(&x1[51], &x1[52]);
 1091|   111k|  btf_32_add_sub_avx2(&x1[63], &x1[56]);
 1092|   111k|  btf_32_add_sub_avx2(&x1[62], &x1[57]);
 1093|   111k|  btf_32_add_sub_avx2(&x1[61], &x1[58]);
 1094|   111k|  btf_32_add_sub_avx2(&x1[60], &x1[59]);
 1095|       |
 1096|       |  // stage 6
 1097|   111k|  btf_32_avx2_type0_new(cospi_p32, cospi_p32, &x1[0], &x1[1], _r, cos_bit);
 1098|   111k|  btf_32_avx2_type1_new(cospi_p48, cospi_p16, &x1[2], &x1[3], _r, cos_bit);
 1099|   111k|  btf_32_add_sub_avx2(&x1[4], &x1[5]);
 1100|   111k|  btf_32_add_sub_avx2(&x1[7], &x1[6]);
 1101|   111k|  btf_32_avx2_type0_new(cospi_m16, cospi_p48, &x1[9], &x1[14], _r, cos_bit);
 1102|   111k|  btf_32_avx2_type0_new(cospi_m48, cospi_m16, &x1[10], &x1[13], _r, cos_bit);
 1103|   111k|  btf_32_add_sub_avx2(&x1[16], &x1[19]);
 1104|   111k|  btf_32_add_sub_avx2(&x1[17], &x1[18]);
 1105|   111k|  btf_32_add_sub_avx2(&x1[23], &x1[20]);
 1106|   111k|  btf_32_add_sub_avx2(&x1[22], &x1[21]);
 1107|   111k|  btf_32_add_sub_avx2(&x1[24], &x1[27]);
 1108|   111k|  btf_32_add_sub_avx2(&x1[25], &x1[26]);
 1109|   111k|  btf_32_add_sub_avx2(&x1[31], &x1[28]);
 1110|   111k|  btf_32_add_sub_avx2(&x1[30], &x1[29]);
 1111|   111k|  btf_32_avx2_type0_new(cospi_m08, cospi_p56, &x1[34], &x1[61], _r, cos_bit);
 1112|   111k|  btf_32_avx2_type0_new(cospi_m08, cospi_p56, &x1[35], &x1[60], _r, cos_bit);
 1113|   111k|  btf_32_avx2_type0_new(cospi_m56, cospi_m08, &x1[36], &x1[59], _r, cos_bit);
 1114|   111k|  btf_32_avx2_type0_new(cospi_m56, cospi_m08, &x1[37], &x1[58], _r, cos_bit);
 1115|   111k|  btf_32_avx2_type0_new(cospi_m40, cospi_p24, &x1[42], &x1[53], _r, cos_bit);
 1116|   111k|  btf_32_avx2_type0_new(cospi_m40, cospi_p24, &x1[43], &x1[52], _r, cos_bit);
 1117|   111k|  btf_32_avx2_type0_new(cospi_m24, cospi_m40, &x1[44], &x1[51], _r, cos_bit);
 1118|   111k|  btf_32_avx2_type0_new(cospi_m24, cospi_m40, &x1[45], &x1[50], _r, cos_bit);
 1119|       |
 1120|       |  // stage 7
 1121|   111k|  btf_32_avx2_type1_new(cospi_p56, cospi_p08, &x1[4], &x1[7], _r, cos_bit);
 1122|   111k|  btf_32_avx2_type1_new(cospi_p24, cospi_p40, &x1[5], &x1[6], _r, cos_bit);
 1123|   111k|  btf_32_add_sub_avx2(&x1[8], &x1[9]);
 1124|   111k|  btf_32_add_sub_avx2(&x1[11], &x1[10]);
 1125|   111k|  btf_32_add_sub_avx2(&x1[12], &x1[13]);
 1126|   111k|  btf_32_add_sub_avx2(&x1[15], &x1[14]);
 1127|   111k|  btf_32_avx2_type0_new(cospi_m08, cospi_p56, &x1[17], &x1[30], _r, cos_bit);
 1128|   111k|  btf_32_avx2_type0_new(cospi_m56, cospi_m08, &x1[18], &x1[29], _r, cos_bit);
 1129|   111k|  btf_32_avx2_type0_new(cospi_m40, cospi_p24, &x1[21], &x1[26], _r, cos_bit);
 1130|   111k|  btf_32_avx2_type0_new(cospi_m24, cospi_m40, &x1[22], &x1[25], _r, cos_bit);
 1131|   111k|  btf_32_add_sub_avx2(&x1[32], &x1[35]);
 1132|   111k|  btf_32_add_sub_avx2(&x1[33], &x1[34]);
 1133|   111k|  btf_32_add_sub_avx2(&x1[39], &x1[36]);
 1134|   111k|  btf_32_add_sub_avx2(&x1[38], &x1[37]);
 1135|   111k|  btf_32_add_sub_avx2(&x1[40], &x1[43]);
 1136|   111k|  btf_32_add_sub_avx2(&x1[41], &x1[42]);
 1137|   111k|  btf_32_add_sub_avx2(&x1[47], &x1[44]);
 1138|   111k|  btf_32_add_sub_avx2(&x1[46], &x1[45]);
 1139|   111k|  btf_32_add_sub_avx2(&x1[48], &x1[51]);
 1140|   111k|  btf_32_add_sub_avx2(&x1[49], &x1[50]);
 1141|   111k|  btf_32_add_sub_avx2(&x1[55], &x1[52]);
 1142|   111k|  btf_32_add_sub_avx2(&x1[54], &x1[53]);
 1143|   111k|  btf_32_add_sub_avx2(&x1[56], &x1[59]);
 1144|   111k|  btf_32_add_sub_avx2(&x1[57], &x1[58]);
 1145|   111k|  btf_32_add_sub_avx2(&x1[63], &x1[60]);
 1146|   111k|  btf_32_add_sub_avx2(&x1[62], &x1[61]);
 1147|       |
 1148|       |  // stage 8
 1149|   111k|  btf_32_avx2_type1_new(cospi_p60, cospi_p04, &x1[8], &x1[15], _r, cos_bit);
 1150|   111k|  btf_32_avx2_type1_new(cospi_p28, cospi_p36, &x1[9], &x1[14], _r, cos_bit);
 1151|   111k|  btf_32_avx2_type1_new(cospi_p44, cospi_p20, &x1[10], &x1[13], _r, cos_bit);
 1152|   111k|  btf_32_avx2_type1_new(cospi_p12, cospi_p52, &x1[11], &x1[12], _r, cos_bit);
 1153|   111k|  btf_32_add_sub_avx2(&x1[16], &x1[17]);
 1154|   111k|  btf_32_add_sub_avx2(&x1[19], &x1[18]);
 1155|   111k|  btf_32_add_sub_avx2(&x1[20], &x1[21]);
 1156|   111k|  btf_32_add_sub_avx2(&x1[23], &x1[22]);
 1157|   111k|  btf_32_add_sub_avx2(&x1[24], &x1[25]);
 1158|   111k|  btf_32_add_sub_avx2(&x1[27], &x1[26]);
 1159|   111k|  btf_32_add_sub_avx2(&x1[28], &x1[29]);
 1160|   111k|  btf_32_add_sub_avx2(&x1[31], &x1[30]);
 1161|   111k|  btf_32_avx2_type0_new(cospi_m04, cospi_p60, &x1[33], &x1[62], _r, cos_bit);
 1162|   111k|  btf_32_avx2_type0_new(cospi_m60, cospi_m04, &x1[34], &x1[61], _r, cos_bit);
 1163|   111k|  btf_32_avx2_type0_new(cospi_m36, cospi_p28, &x1[37], &x1[58], _r, cos_bit);
 1164|   111k|  btf_32_avx2_type0_new(cospi_m28, cospi_m36, &x1[38], &x1[57], _r, cos_bit);
 1165|   111k|  btf_32_avx2_type0_new(cospi_m20, cospi_p44, &x1[41], &x1[54], _r, cos_bit);
 1166|   111k|  btf_32_avx2_type0_new(cospi_m44, cospi_m20, &x1[42], &x1[53], _r, cos_bit);
 1167|   111k|  btf_32_avx2_type0_new(cospi_m52, cospi_p12, &x1[45], &x1[50], _r, cos_bit);
 1168|   111k|  btf_32_avx2_type0_new(cospi_m12, cospi_m52, &x1[46], &x1[49], _r, cos_bit);
 1169|       |
 1170|       |  // stage 9
 1171|   111k|  btf_32_avx2_type1_new(cospi_p62, cospi_p02, &x1[16], &x1[31], _r, cos_bit);
 1172|   111k|  btf_32_avx2_type1_new(cospi_p30, cospi_p34, &x1[17], &x1[30], _r, cos_bit);
 1173|   111k|  btf_32_avx2_type1_new(cospi_p46, cospi_p18, &x1[18], &x1[29], _r, cos_bit);
 1174|   111k|  btf_32_avx2_type1_new(cospi_p14, cospi_p50, &x1[19], &x1[28], _r, cos_bit);
 1175|   111k|  btf_32_avx2_type1_new(cospi_p54, cospi_p10, &x1[20], &x1[27], _r, cos_bit);
 1176|   111k|  btf_32_avx2_type1_new(cospi_p22, cospi_p42, &x1[21], &x1[26], _r, cos_bit);
 1177|   111k|  btf_32_avx2_type1_new(cospi_p38, cospi_p26, &x1[22], &x1[25], _r, cos_bit);
 1178|   111k|  btf_32_avx2_type1_new(cospi_p06, cospi_p58, &x1[23], &x1[24], _r, cos_bit);
 1179|   111k|  btf_32_add_sub_avx2(&x1[32], &x1[33]);
 1180|   111k|  btf_32_add_sub_avx2(&x1[35], &x1[34]);
 1181|   111k|  btf_32_add_sub_avx2(&x1[36], &x1[37]);
 1182|   111k|  btf_32_add_sub_avx2(&x1[39], &x1[38]);
 1183|   111k|  btf_32_add_sub_avx2(&x1[40], &x1[41]);
 1184|   111k|  btf_32_add_sub_avx2(&x1[43], &x1[42]);
 1185|   111k|  btf_32_add_sub_avx2(&x1[44], &x1[45]);
 1186|   111k|  btf_32_add_sub_avx2(&x1[47], &x1[46]);
 1187|   111k|  btf_32_add_sub_avx2(&x1[48], &x1[49]);
 1188|   111k|  btf_32_add_sub_avx2(&x1[51], &x1[50]);
 1189|   111k|  btf_32_add_sub_avx2(&x1[52], &x1[53]);
 1190|   111k|  btf_32_add_sub_avx2(&x1[55], &x1[54]);
 1191|   111k|  btf_32_add_sub_avx2(&x1[56], &x1[57]);
 1192|   111k|  btf_32_add_sub_avx2(&x1[59], &x1[58]);
 1193|   111k|  btf_32_add_sub_avx2(&x1[60], &x1[61]);
 1194|   111k|  btf_32_add_sub_avx2(&x1[63], &x1[62]);
 1195|       |
 1196|       |  // stage 10
 1197|   111k|  btf_32_avx2_type1_new(cospi_p63, cospi_p01, &x1[32], &x1[63], _r, cos_bit);
 1198|   111k|  btf_32_avx2_type1_new(cospi_p31, cospi_p33, &x1[33], &x1[62], _r, cos_bit);
 1199|   111k|  btf_32_avx2_type1_new(cospi_p47, cospi_p17, &x1[34], &x1[61], _r, cos_bit);
 1200|   111k|  btf_32_avx2_type1_new(cospi_p15, cospi_p49, &x1[35], &x1[60], _r, cos_bit);
 1201|   111k|  btf_32_avx2_type1_new(cospi_p55, cospi_p09, &x1[36], &x1[59], _r, cos_bit);
 1202|   111k|  btf_32_avx2_type1_new(cospi_p23, cospi_p41, &x1[37], &x1[58], _r, cos_bit);
 1203|   111k|  btf_32_avx2_type1_new(cospi_p39, cospi_p25, &x1[38], &x1[57], _r, cos_bit);
 1204|   111k|  btf_32_avx2_type1_new(cospi_p07, cospi_p57, &x1[39], &x1[56], _r, cos_bit);
 1205|   111k|  btf_32_avx2_type1_new(cospi_p59, cospi_p05, &x1[40], &x1[55], _r, cos_bit);
 1206|   111k|  btf_32_avx2_type1_new(cospi_p27, cospi_p37, &x1[41], &x1[54], _r, cos_bit);
 1207|   111k|  btf_32_avx2_type1_new(cospi_p43, cospi_p21, &x1[42], &x1[53], _r, cos_bit);
 1208|   111k|  btf_32_avx2_type1_new(cospi_p11, cospi_p53, &x1[43], &x1[52], _r, cos_bit);
 1209|   111k|  btf_32_avx2_type1_new(cospi_p51, cospi_p13, &x1[44], &x1[51], _r, cos_bit);
 1210|   111k|  btf_32_avx2_type1_new(cospi_p19, cospi_p45, &x1[45], &x1[50], _r, cos_bit);
 1211|   111k|  btf_32_avx2_type1_new(cospi_p35, cospi_p29, &x1[46], &x1[49], _r, cos_bit);
 1212|   111k|  btf_32_avx2_type1_new(cospi_p03, cospi_p61, &x1[47], &x1[48], _r, cos_bit);
 1213|       |
 1214|       |  // stage 11
 1215|   111k|  output[0] = x1[0];
 1216|   111k|  output[1] = x1[32];
 1217|   111k|  output[2] = x1[16];
 1218|   111k|  output[3] = x1[48];
 1219|   111k|  output[4] = x1[8];
 1220|   111k|  output[5] = x1[40];
 1221|   111k|  output[6] = x1[24];
 1222|   111k|  output[7] = x1[56];
 1223|   111k|  output[8] = x1[4];
 1224|   111k|  output[9] = x1[36];
 1225|   111k|  output[10] = x1[20];
 1226|   111k|  output[11] = x1[52];
 1227|   111k|  output[12] = x1[12];
 1228|   111k|  output[13] = x1[44];
 1229|   111k|  output[14] = x1[28];
 1230|   111k|  output[15] = x1[60];
 1231|   111k|  output[16] = x1[2];
 1232|   111k|  output[17] = x1[34];
 1233|   111k|  output[18] = x1[18];
 1234|   111k|  output[19] = x1[50];
 1235|   111k|  output[20] = x1[10];
 1236|   111k|  output[21] = x1[42];
 1237|   111k|  output[22] = x1[26];
 1238|   111k|  output[23] = x1[58];
 1239|   111k|  output[24] = x1[6];
 1240|   111k|  output[25] = x1[38];
 1241|   111k|  output[26] = x1[22];
 1242|   111k|  output[27] = x1[54];
 1243|   111k|  output[28] = x1[14];
 1244|   111k|  output[29] = x1[46];
 1245|   111k|  output[30] = x1[30];
 1246|   111k|  output[31] = x1[62];
 1247|   111k|  output[32] = x1[1];
 1248|   111k|  output[33] = x1[33];
 1249|   111k|  output[34] = x1[17];
 1250|   111k|  output[35] = x1[49];
 1251|   111k|  output[36] = x1[9];
 1252|   111k|  output[37] = x1[41];
 1253|   111k|  output[38] = x1[25];
 1254|   111k|  output[39] = x1[57];
 1255|   111k|  output[40] = x1[5];
 1256|   111k|  output[41] = x1[37];
 1257|   111k|  output[42] = x1[21];
 1258|   111k|  output[43] = x1[53];
 1259|   111k|  output[44] = x1[13];
 1260|   111k|  output[45] = x1[45];
 1261|   111k|  output[46] = x1[29];
 1262|   111k|  output[47] = x1[61];
 1263|   111k|  output[48] = x1[3];
 1264|   111k|  output[49] = x1[35];
 1265|   111k|  output[50] = x1[19];
 1266|   111k|  output[51] = x1[51];
 1267|   111k|  output[52] = x1[11];
 1268|   111k|  output[53] = x1[43];
 1269|   111k|  output[54] = x1[27];
 1270|   111k|  output[55] = x1[59];
 1271|   111k|  output[56] = x1[7];
 1272|   111k|  output[57] = x1[39];
 1273|   111k|  output[58] = x1[23];
 1274|   111k|  output[59] = x1[55];
 1275|   111k|  output[60] = x1[15];
 1276|   111k|  output[61] = x1[47];
 1277|   111k|  output[62] = x1[31];
 1278|   111k|  output[63] = x1[63];
 1279|   111k|}
av1_fwd_txfm2d_avx2.c:store_output_32bit_w16:
 1437|  61.1k|                                          const int out_size) {
 1438|  2.01M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (1438:19): [True: 1.95M, False: 61.1k]
  ------------------
 1439|  1.95M|    _mm256_store_si256((__m256i *)(out + stride * i), in1[i]);
 1440|  1.95M|    _mm256_store_si256((__m256i *)(out + stride * i + 8), in2[i]);
 1441|  1.95M|  }
 1442|  61.1k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_8x16_avx2:
 2892|  1.34M|                                       int stride, TX_TYPE tx_type, int bd) {
 2893|  1.34M|  (void)bd;
 2894|  1.34M|  __m128i buf0[16], buf1[16];
 2895|  1.34M|  __m256i buf2[8];
 2896|  1.34M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_8X16];
 2897|  1.34M|  const int txw_idx = get_txw_idx(TX_8X16);
 2898|  1.34M|  const int txh_idx = get_txh_idx(TX_8X16);
 2899|  1.34M|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2900|  1.34M|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2901|  1.34M|  const int width = 8;
 2902|  1.34M|  const int height = 16;
 2903|  1.34M|  const transform_1d_sse2 col_txfm = col_txfm8x16_arr[tx_type];
 2904|  1.34M|  const transform_1d_avx2 row_txfm = row_txfm8x16_arr[tx_type];
 2905|  1.34M|  int ud_flip, lr_flip;
 2906|       |
 2907|  1.34M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2908|  1.34M|  if (ud_flip) {
  ------------------
  |  Branch (2908:7): [True: 2.11k, False: 1.33M]
  ------------------
 2909|  2.11k|    load_buffer_16bit_to_16bit_flip(input, stride, buf0, height);
 2910|  1.33M|  } else {
 2911|  1.33M|    load_buffer_16bit_to_16bit(input, stride, buf0, height);
 2912|  1.33M|  }
 2913|  1.34M|  round_shift_16bit(buf0, height, shift[0]);
 2914|  1.34M|  col_txfm(buf0, buf0, cos_bit_col);
 2915|  1.34M|  round_shift_16bit(buf0, height, shift[1]);
 2916|  1.34M|  transpose_16bit_8x8(buf0, buf1);
 2917|  1.34M|  transpose_16bit_8x8(buf0 + 8, buf1 + 8);
 2918|       |
 2919|  1.34M|  __m128i *bufl, *bufu;
 2920|  1.34M|  if (lr_flip) {
  ------------------
  |  Branch (2920:7): [True: 1.11k, False: 1.33M]
  ------------------
 2921|  1.11k|    bufl = buf0;
 2922|  1.11k|    bufu = buf0 + 8;
 2923|  1.11k|    flip_buf_sse2(buf1 + width * 0, bufl, width);
 2924|  1.11k|    flip_buf_sse2(buf1 + width * 1, bufu, width);
 2925|  1.33M|  } else {
 2926|  1.33M|    bufl = buf1 + width * 0;
 2927|  1.33M|    bufu = buf1 + width * 1;
 2928|  1.33M|  }
 2929|  1.34M|  pack_reg(bufl, bufu, buf2);
 2930|  1.34M|  row_txfm(buf2, buf2, cos_bit_row);
 2931|  1.34M|  round_shift_16bit_w16_avx2(buf2, width, shift[2]);
 2932|  1.34M|  store_rect_buffer_16bit_to_32bit_w16_avx2(buf2, output, height, width);
 2933|  1.34M|}
av1_fwd_txfm2d_avx2.c:fdct8x16_new_avx2:
 2432|  1.53M|                                     int8_t cos_bit) {
 2433|  1.53M|  const int32_t *cospi = cospi_arr(cos_bit);
 2434|  1.53M|  const __m256i __rounding_256 = _mm256_set1_epi32(1 << (cos_bit - 1));
 2435|  1.53M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
 2436|  1.53M|  __m128i temp0, temp1, temp2, temp3;
 2437|  1.53M|  __m256i in0, in1;
 2438|  1.53M|  __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2439|  1.53M|  __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2440|  1.53M|  __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2441|  1.53M|  __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2442|  1.53M|  __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2443|  1.53M|  __m128i cospi_m48_m16 = pair_set_epi16(-cospi[48], -cospi[16]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2444|  1.53M|  __m128i cospi_p56_p08 = pair_set_epi16(cospi[56], cospi[8]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2445|  1.53M|  __m128i cospi_m08_p56 = pair_set_epi16(-cospi[8], cospi[56]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2446|  1.53M|  __m128i cospi_p24_p40 = pair_set_epi16(cospi[24], cospi[40]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2447|  1.53M|  __m128i cospi_m40_p24 = pair_set_epi16(-cospi[40], cospi[24]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2448|  1.53M|  __m128i cospi_p60_p04 = pair_set_epi16(cospi[60], cospi[4]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2449|  1.53M|  __m128i cospi_m04_p60 = pair_set_epi16(-cospi[4], cospi[60]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2450|  1.53M|  __m128i cospi_p28_p36 = pair_set_epi16(cospi[28], cospi[36]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2451|  1.53M|  __m128i cospi_m36_p28 = pair_set_epi16(-cospi[36], cospi[28]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2452|  1.53M|  __m128i cospi_p44_p20 = pair_set_epi16(cospi[44], cospi[20]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2453|  1.53M|  __m128i cospi_m20_p44 = pair_set_epi16(-cospi[20], cospi[44]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2454|  1.53M|  __m128i cospi_p12_p52 = pair_set_epi16(cospi[12], cospi[52]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2455|  1.53M|  __m128i cospi_m52_p12 = pair_set_epi16(-cospi[52], cospi[12]);
  ------------------
  |  |   20|  1.53M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2456|       |
 2457|  1.53M|  __m256i cospi_arr[12];
 2458|       |
 2459|  1.53M|  cospi_arr[0] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m32_p32),
 2460|  1.53M|                                         cospi_m32_p32, 0x1);
 2461|  1.53M|  cospi_arr[1] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_p32),
 2462|  1.53M|                                         cospi_p32_p32, 0x1);
 2463|  1.53M|  cospi_arr[2] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_p32),
 2464|  1.53M|                                         cospi_p48_p16, 0x1);
 2465|  1.53M|  cospi_arr[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_m32),
 2466|  1.53M|                                         cospi_m16_p48, 0x1);
 2467|  1.53M|  cospi_arr[4] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m16_p48),
 2468|  1.53M|                                         cospi_m48_m16, 0x1);
 2469|  1.53M|  cospi_arr[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p48_p16),
 2470|  1.53M|                                         cospi_m16_p48, 0x1);
 2471|  1.53M|  cospi_arr[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p56_p08),
 2472|  1.53M|                                         cospi_p24_p40, 0x1);
 2473|  1.53M|  cospi_arr[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m08_p56),
 2474|  1.53M|                                         cospi_m40_p24, 0x1);
 2475|  1.53M|  cospi_arr[8] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p60_p04),
 2476|  1.53M|                                         cospi_p28_p36, 0x1);
 2477|  1.53M|  cospi_arr[9] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m04_p60),
 2478|  1.53M|                                         cospi_m36_p28, 0x1);
 2479|  1.53M|  cospi_arr[10] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p44_p20),
 2480|  1.53M|                                          cospi_p12_p52, 0x1);
 2481|  1.53M|  cospi_arr[11] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m20_p44),
 2482|  1.53M|                                          cospi_m52_p12, 0x1);
 2483|       |
 2484|  1.53M|  __m256i x[8];
 2485|  1.53M|  x[0] =
 2486|  1.53M|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[0]), input[1], 0x1);
 2487|  1.53M|  x[1] = _mm256_insertf128_si256(_mm256_castsi128_si256(input[15]), input[14],
 2488|  1.53M|                                 0x1);
 2489|  1.53M|  x[2] =
 2490|  1.53M|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[2]), input[3], 0x1);
 2491|  1.53M|  x[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(input[13]), input[12],
 2492|  1.53M|                                 0x1);
 2493|  1.53M|  x[4] =
 2494|  1.53M|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[5]), input[4], 0x1);
 2495|  1.53M|  x[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(input[10]), input[11],
 2496|  1.53M|                                 0x1);
 2497|  1.53M|  x[6] =
 2498|  1.53M|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[7]), input[6], 0x1);
 2499|  1.53M|  x[7] =
 2500|  1.53M|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[8]), input[9], 0x1);
 2501|       |
 2502|       |  // stage 1
 2503|  1.53M|  __m256i x1[8];
 2504|  1.53M|  x1[0] = _mm256_adds_epi16(x[0], x[1]);
 2505|  1.53M|  x1[7] = _mm256_subs_epi16(x[0], x[1]);
 2506|  1.53M|  x1[1] = _mm256_adds_epi16(x[2], x[3]);
 2507|  1.53M|  x1[6] = _mm256_subs_epi16(x[2], x[3]);
 2508|  1.53M|  x1[2] = _mm256_adds_epi16(x[4], x[5]);
 2509|  1.53M|  x1[5] = _mm256_subs_epi16(x[4], x[5]);
 2510|  1.53M|  x1[3] = _mm256_adds_epi16(x[6], x[7]);
 2511|  1.53M|  x1[4] = _mm256_subs_epi16(x[6], x[7]);
 2512|       |
 2513|       |  // stage 2
 2514|  1.53M|  __m256i x2[8];
 2515|  1.53M|  x2[0] = _mm256_adds_epi16(x1[0], x1[3]);
 2516|  1.53M|  x2[7] = _mm256_subs_epi16(x1[0], x1[3]);
 2517|  1.53M|  x2[1] = _mm256_adds_epi16(x1[1], x1[2]);
 2518|  1.53M|  x2[6] = _mm256_subs_epi16(x1[1], x1[2]);
 2519|  1.53M|  x2[2] = x1[4];
 2520|  1.53M|  x2[3] = x1[7];
 2521|  1.53M|  btf_16_avx2(&cospi_arr[0], &cospi_arr[1], &x1[5], &x1[6], &temp0, &temp1,
 2522|  1.53M|              &temp2, &temp3, &__rounding_256, &cos_bit);
 2523|  1.53M|  x2[4] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp0, 0x1);
 2524|  1.53M|  x2[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp3), temp1, 0x1);
 2525|       |
 2526|       |  // stage 3
 2527|  1.53M|  __m256i x3[8];
 2528|  1.53M|  x2[1] = _mm256_permute4x64_epi64(x2[1], 0x4e);
 2529|  1.53M|  x3[0] = _mm256_adds_epi16(x2[0], x2[1]);
 2530|  1.53M|  x3[1] = _mm256_subs_epi16(x2[0], x2[1]);
 2531|  1.53M|  x3[2] = _mm256_blend_epi32(x2[7], x2[6], 0xf0);
 2532|  1.53M|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, _mm256_castsi256_si128(x2[6]),
  ------------------
  |  |   61|  1.53M|  do {                                            \
  |  |   62|  1.53M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  1.53M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  1.53M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  1.53M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  1.53M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  1.53M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  1.53M|                                                  \
  |  |   69|  1.53M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  1.53M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  1.53M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  1.53M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  1.53M|                                                  \
  |  |   74|  1.53M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  1.53M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  1.53M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  1.53M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  1.53M|                                                  \
  |  |   79|  1.53M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  1.53M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  1.53M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 1.53M]
  |  |  ------------------
  ------------------
 2533|  1.53M|              _mm256_extractf128_si256(x2[7], 0x01), temp0, temp1);
 2534|  1.53M|  x3[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp1), temp0, 0x1);
 2535|  1.53M|  x3[3] = _mm256_adds_epi16(x2[2], x2[4]);
 2536|  1.53M|  x3[4] = _mm256_subs_epi16(x2[2], x2[4]);
 2537|  1.53M|  x3[5] = _mm256_adds_epi16(x2[3], x2[5]);
 2538|  1.53M|  x3[6] = _mm256_subs_epi16(x2[3], x2[5]);
 2539|       |
 2540|       |  // stage 4
 2541|  1.53M|  __m256i x4[8];
 2542|  1.53M|  x4[0] = _mm256_blend_epi32(x3[0], x3[1], 0xf0);
 2543|  1.53M|  x4[1] = _mm256_permute2f128_si256(x3[0], x3[1], 0x21);
 2544|  1.53M|  btf_16_avx2(&cospi_arr[2], &cospi_arr[3], &x4[0], &x4[1], &output[0],
 2545|  1.53M|              &output[8], &output[4], &output[12], &__rounding_256, &cos_bit);
 2546|  1.53M|  x4[2] = _mm256_adds_epi16(x3[2], x3[7]);
 2547|  1.53M|  x4[3] = _mm256_subs_epi16(x3[2], x3[7]);
 2548|  1.53M|  x4[4] = _mm256_permute2f128_si256(x3[3], x3[4], 0x20);
 2549|  1.53M|  x4[5] = _mm256_permute2f128_si256(x3[6], x3[5], 0x20);
 2550|  1.53M|  in0 = _mm256_permute2f128_si256(x3[3], x3[4], 0x31);
 2551|  1.53M|  in1 = _mm256_permute2f128_si256(x3[5], x3[6], 0x31);
 2552|  1.53M|  btf_16_avx2(&cospi_arr[4], &cospi_arr[5], &in0, &in1, &temp0, &temp1, &temp2,
 2553|  1.53M|              &temp3, &__rounding_256, &cos_bit);
 2554|       |
 2555|  1.53M|  x4[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp2, 0x1);
 2556|  1.53M|  x4[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp3), temp1, 0x1);
 2557|       |
 2558|       |  // stage 5
 2559|  1.53M|  __m256i x5[4];
 2560|  1.53M|  in0 = _mm256_permute2f128_si256(x4[2], x4[3], 0x31);
 2561|  1.53M|  in1 = _mm256_permute2f128_si256(x4[2], x4[3], 0x20);
 2562|  1.53M|  btf_16_avx2(&cospi_arr[6], &cospi_arr[7], &in0, &in1, &output[2], &output[14],
 2563|  1.53M|              &output[10], &output[6], &__rounding_256, &cos_bit);
 2564|  1.53M|  x5[0] = _mm256_adds_epi16(x4[4], x4[6]);
 2565|  1.53M|  x5[1] = _mm256_subs_epi16(x4[4], x4[6]);
 2566|  1.53M|  x5[2] = _mm256_adds_epi16(x4[5], x4[7]);
 2567|  1.53M|  x5[3] = _mm256_subs_epi16(x4[5], x4[7]);
 2568|       |
 2569|       |  // stage 6
 2570|  1.53M|  in0 = _mm256_permute2f128_si256(x5[0], x5[1], 0x20);
 2571|  1.53M|  in1 = _mm256_permute2f128_si256(x5[2], x5[3], 0x31);
 2572|  1.53M|  btf_16_avx2(&cospi_arr[8], &cospi_arr[9], &in0, &in1, &output[1], &output[15],
 2573|  1.53M|              &output[9], &output[7], &__rounding_256, &cos_bit);
 2574|  1.53M|  in0 = _mm256_permute2f128_si256(x5[1], x5[0], 0x31);
 2575|       |  in1 = _mm256_permute2f128_si256(x5[3], x5[2], 0x20);
 2576|  1.53M|  btf_16_avx2(&cospi_arr[10], &cospi_arr[11], &in0, &in1, &output[5],
 2577|  1.53M|              &output[11], &output[13], &output[3], &__rounding_256, &cos_bit);
 2578|  1.53M|}
av1_fwd_txfm2d_avx2.c:btf_16_avx2:
 2198|  14.4M|                               const __m256i *__rounding, int8_t *cos_bit) {
 2199|  14.4M|  __m256i t0 = _mm256_unpacklo_epi16(*in0, *in1);
 2200|  14.4M|  __m256i t1 = _mm256_unpackhi_epi16(*in0, *in1);
 2201|  14.4M|  __m256i u0 = _mm256_madd_epi16(t0, *w0);
 2202|  14.4M|  __m256i u1 = _mm256_madd_epi16(t1, *w0);
 2203|  14.4M|  __m256i v0 = _mm256_madd_epi16(t0, *w1);
 2204|  14.4M|  __m256i v1 = _mm256_madd_epi16(t1, *w1);
 2205|       |
 2206|  14.4M|  __m256i a0 = _mm256_add_epi32(u0, *__rounding);
 2207|  14.4M|  __m256i a1 = _mm256_add_epi32(u1, *__rounding);
 2208|  14.4M|  __m256i b0 = _mm256_add_epi32(v0, *__rounding);
 2209|  14.4M|  __m256i b1 = _mm256_add_epi32(v1, *__rounding);
 2210|       |
 2211|  14.4M|  __m256i c0 = _mm256_srai_epi32(a0, *cos_bit);
 2212|  14.4M|  __m256i c1 = _mm256_srai_epi32(a1, *cos_bit);
 2213|  14.4M|  __m256i d0 = _mm256_srai_epi32(b0, *cos_bit);
 2214|  14.4M|  __m256i d1 = _mm256_srai_epi32(b1, *cos_bit);
 2215|       |
 2216|  14.4M|  __m256i temp0 = _mm256_packs_epi32(c0, c1);
 2217|  14.4M|  __m256i temp1 = _mm256_packs_epi32(d0, d1);
 2218|       |
 2219|  14.4M|  *out0 = _mm256_castsi256_si128(temp0);
 2220|  14.4M|  *out1 = _mm256_castsi256_si128(temp1);
 2221|  14.4M|  *out2 = _mm256_extracti128_si256(temp0, 0x01);
 2222|       |  *out3 = _mm256_extracti128_si256(temp1, 0x01);
 2223|  14.4M|}
av1_fwd_txfm2d_avx2.c:fadst8x16_new_avx2:
 2581|   522k|                                      int8_t cos_bit) {
 2582|   522k|  const int32_t *cospi = cospi_arr(cos_bit);
 2583|   522k|  const __m256i __zero = _mm256_setzero_si256();
 2584|   522k|  const __m256i __rounding_256 = _mm256_set1_epi32(1 << (cos_bit - 1));
 2585|   522k|  __m256i in0, in1;
 2586|   522k|  __m128i temp0, temp1, temp2, temp3;
 2587|       |
 2588|   522k|  __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2589|   522k|  __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2590|   522k|  __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2591|   522k|  __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2592|   522k|  __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2593|   522k|  __m128i cospi_p08_p56 = pair_set_epi16(cospi[8], cospi[56]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2594|   522k|  __m128i cospi_p56_m08 = pair_set_epi16(cospi[56], -cospi[8]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2595|   522k|  __m128i cospi_p40_p24 = pair_set_epi16(cospi[40], cospi[24]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2596|   522k|  __m128i cospi_p24_m40 = pair_set_epi16(cospi[24], -cospi[40]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2597|   522k|  __m128i cospi_m56_p08 = pair_set_epi16(-cospi[56], cospi[8]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2598|   522k|  __m128i cospi_m24_p40 = pair_set_epi16(-cospi[24], cospi[40]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2599|   522k|  __m128i cospi_p02_p62 = pair_set_epi16(cospi[2], cospi[62]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2600|   522k|  __m128i cospi_p62_m02 = pair_set_epi16(cospi[62], -cospi[2]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2601|   522k|  __m128i cospi_p10_p54 = pair_set_epi16(cospi[10], cospi[54]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2602|   522k|  __m128i cospi_p54_m10 = pair_set_epi16(cospi[54], -cospi[10]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2603|   522k|  __m128i cospi_p18_p46 = pair_set_epi16(cospi[18], cospi[46]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2604|   522k|  __m128i cospi_p46_m18 = pair_set_epi16(cospi[46], -cospi[18]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2605|   522k|  __m128i cospi_p26_p38 = pair_set_epi16(cospi[26], cospi[38]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2606|   522k|  __m128i cospi_p38_m26 = pair_set_epi16(cospi[38], -cospi[26]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2607|   522k|  __m128i cospi_p34_p30 = pair_set_epi16(cospi[34], cospi[30]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2608|   522k|  __m128i cospi_p30_m34 = pair_set_epi16(cospi[30], -cospi[34]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2609|   522k|  __m128i cospi_p42_p22 = pair_set_epi16(cospi[42], cospi[22]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2610|   522k|  __m128i cospi_p22_m42 = pair_set_epi16(cospi[22], -cospi[42]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2611|   522k|  __m128i cospi_p50_p14 = pair_set_epi16(cospi[50], cospi[14]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2612|   522k|  __m128i cospi_p14_m50 = pair_set_epi16(cospi[14], -cospi[50]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2613|   522k|  __m128i cospi_p58_p06 = pair_set_epi16(cospi[58], cospi[6]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2614|   522k|  __m128i cospi_p06_m58 = pair_set_epi16(cospi[6], -cospi[58]);
  ------------------
  |  |   20|   522k|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 2615|       |
 2616|   522k|  __m256i cospi_arr[20];
 2617|       |
 2618|   522k|  cospi_arr[0] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_p32),
 2619|   522k|                                         cospi_p32_p32, 0x1);
 2620|   522k|  cospi_arr[1] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_m32),
 2621|   522k|                                         cospi_p32_m32, 0x1);
 2622|   522k|  cospi_arr[2] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_p32),
 2623|   522k|                                         cospi_p32_p32, 0x1);
 2624|   522k|  cospi_arr[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p32_m32),
 2625|   522k|                                         cospi_p32_m32, 0x1);
 2626|   522k|  cospi_arr[4] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p16_p48),
 2627|   522k|                                         cospi_m48_p16, 0x1);
 2628|   522k|  cospi_arr[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p48_m16),
 2629|   522k|                                         cospi_p16_p48, 0x1);
 2630|   522k|  cospi_arr[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p16_p48),
 2631|   522k|                                         cospi_m48_p16, 0x1);
 2632|   522k|  cospi_arr[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p48_m16),
 2633|   522k|                                         cospi_p16_p48, 0x1);
 2634|   522k|  cospi_arr[8] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p08_p56),
 2635|   522k|                                         cospi_p40_p24, 0x1);
 2636|   522k|  cospi_arr[9] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p56_m08),
 2637|   522k|                                         cospi_p24_m40, 0x1);
 2638|   522k|  cospi_arr[10] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_m56_p08),
 2639|   522k|                                          cospi_m24_p40, 0x1);
 2640|   522k|  cospi_arr[11] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p08_p56),
 2641|   522k|                                          cospi_p40_p24, 0x1);
 2642|   522k|  cospi_arr[12] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p02_p62),
 2643|   522k|                                          cospi_p10_p54, 0x1);
 2644|   522k|  cospi_arr[13] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p62_m02),
 2645|   522k|                                          cospi_p54_m10, 0x1);
 2646|   522k|  cospi_arr[14] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p18_p46),
 2647|   522k|                                          cospi_p26_p38, 0x1);
 2648|   522k|  cospi_arr[15] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p46_m18),
 2649|   522k|                                          cospi_p38_m26, 0x1);
 2650|   522k|  cospi_arr[16] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p34_p30),
 2651|   522k|                                          cospi_p42_p22, 0x1);
 2652|   522k|  cospi_arr[17] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p30_m34),
 2653|   522k|                                          cospi_p22_m42, 0x1);
 2654|   522k|  cospi_arr[18] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p50_p14),
 2655|   522k|                                          cospi_p58_p06, 0x1);
 2656|   522k|  cospi_arr[19] = _mm256_insertf128_si256(_mm256_castsi128_si256(cospi_p14_m50),
 2657|   522k|                                          cospi_p06_m58, 0x1);
 2658|       |
 2659|   522k|  __m256i x[8];
 2660|   522k|  x[0] =
 2661|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[0]), input[4], 0x1);
 2662|   522k|  x[1] =
 2663|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[2]), input[6], 0x1);
 2664|   522k|  x[2] =
 2665|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[8]), input[12], 0x1);
 2666|   522k|  x[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(input[10]), input[14],
 2667|   522k|                                 0x1);
 2668|   522k|  x[4] =
 2669|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[1]), input[9], 0x1);
 2670|   522k|  x[5] =
 2671|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[3]), input[11], 0x1);
 2672|   522k|  x[6] =
 2673|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[5]), input[13], 0x1);
 2674|   522k|  x[7] =
 2675|   522k|      _mm256_insertf128_si256(_mm256_castsi128_si256(input[7]), input[15], 0x1);
 2676|       |
 2677|       |  // stage 1
 2678|   522k|  __m256i x1[8];
 2679|   522k|  x1[0] = x[0];
 2680|   522k|  x1[1] = _mm256_subs_epi16(__zero, x[7]);
 2681|   522k|  x1[2] = x[2];
 2682|   522k|  x1[3] = _mm256_subs_epi16(__zero, x[5]);
 2683|   522k|  x1[4] = _mm256_subs_epi16(__zero, x[4]);
 2684|   522k|  x1[5] = x[3];
 2685|   522k|  x1[6] = _mm256_subs_epi16(__zero, x[6]);
 2686|   522k|  x1[7] = x[1];
 2687|       |
 2688|       |  // stage 2
 2689|   522k|  __m256i x2[8];
 2690|   522k|  x2[0] = _mm256_blend_epi32(x1[0], x1[1], 0xf0);
 2691|   522k|  x2[3] = _mm256_blend_epi32(x1[3], x1[2], 0xf0);
 2692|   522k|  x2[4] = _mm256_blend_epi32(x1[4], x1[5], 0xf0);
 2693|   522k|  x2[7] = _mm256_blend_epi32(x1[7], x1[6], 0xf0);
 2694|   522k|  in0 = _mm256_blend_epi32(x1[1], x1[0], 0xf0);
 2695|   522k|  in1 = _mm256_blend_epi32(x1[2], x1[3], 0xf0);
 2696|   522k|  btf_16_avx2(&cospi_arr[0], &cospi_arr[1], &in0, &in1, &temp0, &temp1, &temp2,
 2697|   522k|              &temp3, &__rounding_256, &cos_bit);
 2698|   522k|  x2[1] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2699|   522k|  x2[2] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2700|   522k|  in0 = _mm256_permute2f128_si256(x1[7], x1[6], 0x21);
 2701|   522k|  in1 = _mm256_permute2f128_si256(x1[4], x1[5], 0x21);
 2702|   522k|  btf_16_avx2(&cospi_arr[2], &cospi_arr[3], &in0, &in1, &temp0, &temp1, &temp2,
 2703|   522k|              &temp3, &__rounding_256, &cos_bit);
 2704|   522k|  x2[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2705|   522k|  x2[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2706|       |
 2707|       |  // stage 3
 2708|   522k|  __m256i x3[8];
 2709|   522k|  x3[0] = _mm256_adds_epi16(x2[0], x2[1]);
 2710|   522k|  x3[1] = _mm256_subs_epi16(x2[0], x2[1]);
 2711|   522k|  x3[2] = _mm256_adds_epi16(x2[3], x2[2]);
 2712|   522k|  x3[3] = _mm256_subs_epi16(x2[3], x2[2]);
 2713|   522k|  x3[4] = _mm256_adds_epi16(x2[4], x2[5]);
 2714|   522k|  x3[5] = _mm256_subs_epi16(x2[4], x2[5]);
 2715|   522k|  x3[6] = _mm256_adds_epi16(x2[7], x2[6]);
 2716|   522k|  x3[7] = _mm256_subs_epi16(x2[7], x2[6]);
 2717|       |
 2718|       |  // stage 4
 2719|   522k|  __m256i x4[8];
 2720|   522k|  x4[0] = x3[0];
 2721|   522k|  x4[1] = x3[1];
 2722|   522k|  x4[4] = x3[4];
 2723|   522k|  x4[5] = x3[5];
 2724|   522k|  in0 = _mm256_permute2f128_si256(x3[2], x3[3], 0x20);
 2725|   522k|  in1 = _mm256_permute2f128_si256(x3[2], x3[3], 0x31);
 2726|   522k|  btf_16_avx2(&cospi_arr[4], &cospi_arr[5], &in0, &in1, &temp0, &temp1, &temp2,
 2727|   522k|              &temp3, &__rounding_256, &cos_bit);
 2728|   522k|  x4[2] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2729|   522k|  x4[3] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2730|   522k|  in0 = _mm256_permute2f128_si256(x3[6], x3[7], 0x20);
 2731|   522k|  in1 = _mm256_permute2f128_si256(x3[6], x3[7], 0x31);
 2732|   522k|  btf_16_avx2(&cospi_arr[6], &cospi_arr[7], &in0, &in1, &temp0, &temp1, &temp2,
 2733|   522k|              &temp3, &__rounding_256, &cos_bit);
 2734|   522k|  x4[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2735|   522k|  x4[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2736|       |
 2737|       |  // stage 5
 2738|   522k|  __m256i x5[8];
 2739|   522k|  x5[0] = _mm256_adds_epi16(x4[0], x4[2]);
 2740|   522k|  x5[1] = _mm256_subs_epi16(x4[0], x4[2]);
 2741|   522k|  x5[2] = _mm256_adds_epi16(x4[1], x4[3]);
 2742|   522k|  x5[3] = _mm256_subs_epi16(x4[1], x4[3]);
 2743|   522k|  x5[4] = _mm256_adds_epi16(x4[4], x4[6]);
 2744|   522k|  x5[5] = _mm256_subs_epi16(x4[4], x4[6]);
 2745|   522k|  x5[6] = _mm256_adds_epi16(x4[5], x4[7]);
 2746|   522k|  x5[7] = _mm256_subs_epi16(x4[5], x4[7]);
 2747|       |
 2748|       |  // stage 6
 2749|   522k|  __m256i x6[8];
 2750|   522k|  x6[0] = x5[0];
 2751|   522k|  x6[1] = x5[2];
 2752|   522k|  x6[2] = x5[1];
 2753|   522k|  x6[3] = x5[3];
 2754|   522k|  in0 = _mm256_permute2f128_si256(x5[4], x5[6], 0x20);
 2755|   522k|  in1 = _mm256_permute2f128_si256(x5[4], x5[6], 0x31);
 2756|   522k|  btf_16_avx2(&cospi_arr[8], &cospi_arr[9], &in0, &in1, &temp0, &temp1, &temp2,
 2757|   522k|              &temp3, &__rounding_256, &cos_bit);
 2758|   522k|  x6[4] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2759|   522k|  x6[5] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2760|   522k|  in0 = _mm256_permute2f128_si256(x5[5], x5[7], 0x20);
 2761|   522k|  in1 = _mm256_permute2f128_si256(x5[5], x5[7], 0x31);
 2762|   522k|  btf_16_avx2(&cospi_arr[10], &cospi_arr[11], &in0, &in1, &temp0, &temp1,
 2763|   522k|              &temp2, &temp3, &__rounding_256, &cos_bit);
 2764|   522k|  x6[6] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp0), temp1, 0x1);
 2765|   522k|  x6[7] = _mm256_insertf128_si256(_mm256_castsi128_si256(temp2), temp3, 0x1);
 2766|       |
 2767|       |  // stage 7
 2768|   522k|  __m256i x7[8];
 2769|   522k|  x7[0] = _mm256_adds_epi16(x6[0], x6[4]);
 2770|   522k|  x7[1] = _mm256_subs_epi16(x6[0], x6[4]);
 2771|   522k|  x7[2] = _mm256_adds_epi16(x6[1], x6[5]);
 2772|   522k|  x7[3] = _mm256_subs_epi16(x6[1], x6[5]);
 2773|   522k|  x7[4] = _mm256_adds_epi16(x6[2], x6[6]);
 2774|   522k|  x7[5] = _mm256_subs_epi16(x6[2], x6[6]);
 2775|   522k|  x7[6] = _mm256_adds_epi16(x6[3], x6[7]);
 2776|   522k|  x7[7] = _mm256_subs_epi16(x6[3], x6[7]);
 2777|       |
 2778|       |  // stage 8
 2779|   522k|  in0 = _mm256_permute2f128_si256(x7[0], x7[2], 0x20);
 2780|   522k|  in1 = _mm256_permute2f128_si256(x7[0], x7[2], 0x31);
 2781|   522k|  btf_16_avx2(&cospi_arr[12], &cospi_arr[13], &in0, &in1, &output[15],
 2782|   522k|              &output[0], &output[13], &output[2], &__rounding_256, &cos_bit);
 2783|   522k|  in0 = _mm256_permute2f128_si256(x7[4], x7[6], 0x20);
 2784|   522k|  in1 = _mm256_permute2f128_si256(x7[4], x7[6], 0x31);
 2785|   522k|  btf_16_avx2(&cospi_arr[14], &cospi_arr[15], &in0, &in1, &output[11],
 2786|   522k|              &output[4], &output[9], &output[6], &__rounding_256, &cos_bit);
 2787|   522k|  in0 = _mm256_permute2f128_si256(x7[1], x7[3], 0x20);
 2788|   522k|  in1 = _mm256_permute2f128_si256(x7[1], x7[3], 0x31);
 2789|   522k|  btf_16_avx2(&cospi_arr[16], &cospi_arr[17], &in0, &in1, &output[7],
 2790|   522k|              &output[8], &output[5], &output[10], &__rounding_256, &cos_bit);
 2791|   522k|  in0 = _mm256_permute2f128_si256(x7[5], x7[7], 0x20);
 2792|       |  in1 = _mm256_permute2f128_si256(x7[5], x7[7], 0x31);
 2793|   522k|  btf_16_avx2(&cospi_arr[18], &cospi_arr[19], &in0, &in1, &output[3],
 2794|   522k|              &output[12], &output[1], &output[14], &__rounding_256, &cos_bit);
 2795|   522k|}
av1_fwd_txfm2d_avx2.c:fidentity8x16_new_avx2:
 2798|   187k|                                          int8_t cos_bit) {
 2799|   187k|  (void)cos_bit;
 2800|   187k|  const __m256i one = _mm256_set1_epi16(1);
 2801|   187k|  __m256i temp;
 2802|  1.68M|  for (int i = 0; i < 16; i += 2) {
  ------------------
  |  Branch (2802:19): [True: 1.49M, False: 187k]
  ------------------
 2803|  1.49M|    temp = _mm256_insertf128_si256(_mm256_castsi128_si256(input[i]),
 2804|  1.49M|                                   input[i + 1], 0x1);
 2805|  1.49M|    const __m256i a_lo = _mm256_unpacklo_epi16(temp, one);
 2806|  1.49M|    const __m256i a_hi = _mm256_unpackhi_epi16(temp, one);
 2807|  1.49M|    const __m256i b_lo = scale_round_avx2(a_lo, 2 * NewSqrt2);
 2808|  1.49M|    const __m256i b_hi = scale_round_avx2(a_hi, 2 * NewSqrt2);
 2809|  1.49M|    temp = _mm256_packs_epi32(b_lo, b_hi);
 2810|  1.49M|    output[i] = _mm256_castsi256_si128(temp);
 2811|       |    output[i + 1] = _mm256_extractf128_si256(temp, 0x1);
 2812|  1.49M|  }
 2813|   187k|}
av1_fwd_txfm2d_avx2.c:fdct8x8_new_avx2:
 2226|  1.53M|                                    int8_t cos_bit) {
 2227|  1.53M|  const int32_t *cospi = cospi_arr(cos_bit);
 2228|  1.53M|  const __m256i __rounding = _mm256_set1_epi32(1 << (cos_bit - 1));
 2229|       |
 2230|  1.53M|  __m256i cospi_m32_p32 = pair_set_w16_epi16(-cospi[32], cospi[32]);
 2231|  1.53M|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 2232|  1.53M|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
 2233|  1.53M|  __m256i cospi_p48_p16 = pair_set_w16_epi16(cospi[48], cospi[16]);
 2234|  1.53M|  __m256i cospi_m16_p48 = pair_set_w16_epi16(-cospi[16], cospi[48]);
 2235|  1.53M|  __m256i cospi_p56_p08 = pair_set_w16_epi16(cospi[56], cospi[8]);
 2236|  1.53M|  __m256i cospi_m08_p56 = pair_set_w16_epi16(-cospi[8], cospi[56]);
 2237|  1.53M|  __m256i cospi_p24_p40 = pair_set_w16_epi16(cospi[24], cospi[40]);
 2238|  1.53M|  __m256i cospi_m40_p24 = pair_set_w16_epi16(-cospi[40], cospi[24]);
 2239|       |
 2240|       |  // stage 1
 2241|  1.53M|  __m256i x1[8];
 2242|  1.53M|  x1[0] = _mm256_adds_epi16(input[0], input[7]);
 2243|  1.53M|  x1[7] = _mm256_subs_epi16(input[0], input[7]);
 2244|  1.53M|  x1[1] = _mm256_adds_epi16(input[1], input[6]);
 2245|  1.53M|  x1[6] = _mm256_subs_epi16(input[1], input[6]);
 2246|  1.53M|  x1[2] = _mm256_adds_epi16(input[2], input[5]);
 2247|  1.53M|  x1[5] = _mm256_subs_epi16(input[2], input[5]);
 2248|  1.53M|  x1[3] = _mm256_adds_epi16(input[3], input[4]);
 2249|  1.53M|  x1[4] = _mm256_subs_epi16(input[3], input[4]);
 2250|       |
 2251|       |  // stage 2
 2252|  1.53M|  __m256i x2[8];
 2253|  1.53M|  x2[0] = _mm256_adds_epi16(x1[0], x1[3]);
 2254|  1.53M|  x2[3] = _mm256_subs_epi16(x1[0], x1[3]);
 2255|  1.53M|  x2[1] = _mm256_adds_epi16(x1[1], x1[2]);
 2256|  1.53M|  x2[2] = _mm256_subs_epi16(x1[1], x1[2]);
 2257|  1.53M|  x2[4] = x1[4];
 2258|  1.53M|  btf_16_w16_avx2(cospi_m32_p32, cospi_p32_p32, &x1[5], &x1[6], __rounding,
 2259|  1.53M|                  cos_bit);
 2260|  1.53M|  x2[5] = x1[5];
 2261|  1.53M|  x2[6] = x1[6];
 2262|  1.53M|  x2[7] = x1[7];
 2263|       |
 2264|       |  // stage 3
 2265|  1.53M|  __m256i x3[8];
 2266|  1.53M|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x2[0], &x2[1], __rounding,
 2267|  1.53M|                  cos_bit);
 2268|  1.53M|  x3[0] = x2[0];
 2269|  1.53M|  x3[1] = x2[1];
 2270|  1.53M|  btf_16_w16_avx2(cospi_p48_p16, cospi_m16_p48, &x2[2], &x2[3], __rounding,
 2271|  1.53M|                  cos_bit);
 2272|  1.53M|  x3[2] = x2[2];
 2273|  1.53M|  x3[3] = x2[3];
 2274|  1.53M|  x3[4] = _mm256_adds_epi16(x2[4], x2[5]);
 2275|  1.53M|  x3[5] = _mm256_subs_epi16(x2[4], x2[5]);
 2276|  1.53M|  x3[6] = _mm256_subs_epi16(x2[7], x2[6]);
 2277|  1.53M|  x3[7] = _mm256_adds_epi16(x2[7], x2[6]);
 2278|       |
 2279|       |  // stage 4
 2280|  1.53M|  __m256i x4[8];
 2281|  1.53M|  x4[0] = x3[0];
 2282|  1.53M|  x4[1] = x3[1];
 2283|  1.53M|  x4[2] = x3[2];
 2284|  1.53M|  x4[3] = x3[3];
 2285|  1.53M|  btf_16_w16_avx2(cospi_p56_p08, cospi_m08_p56, &x3[4], &x3[7], __rounding,
 2286|  1.53M|                  cos_bit);
 2287|  1.53M|  x4[4] = x3[4];
 2288|  1.53M|  x4[7] = x3[7];
 2289|  1.53M|  btf_16_w16_avx2(cospi_p24_p40, cospi_m40_p24, &x3[5], &x3[6], __rounding,
 2290|  1.53M|                  cos_bit);
 2291|  1.53M|  x4[5] = x3[5];
 2292|  1.53M|  x4[6] = x3[6];
 2293|       |  // stage 5
 2294|  1.53M|  output[0] = x4[0];
 2295|  1.53M|  output[1] = x4[4];
 2296|  1.53M|  output[2] = x4[2];
 2297|  1.53M|  output[3] = x4[6];
 2298|  1.53M|  output[4] = x4[1];
 2299|  1.53M|  output[5] = x4[5];
 2300|  1.53M|  output[6] = x4[3];
 2301|  1.53M|  output[7] = x4[7];
 2302|  1.53M|}
av1_fwd_txfm2d_avx2.c:fadst8x8_new_avx2:
 2305|   577k|                                     int8_t cos_bit) {
 2306|   577k|  const int32_t *cospi = cospi_arr(cos_bit);
 2307|   577k|  const __m256i __zero = _mm256_setzero_si256();
 2308|   577k|  const __m256i __rounding = _mm256_set1_epi32(1 << (cos_bit - 1));
 2309|       |
 2310|   577k|  __m256i cospi_p32_p32 = pair_set_w16_epi16(cospi[32], cospi[32]);
 2311|   577k|  __m256i cospi_p32_m32 = pair_set_w16_epi16(cospi[32], -cospi[32]);
 2312|   577k|  __m256i cospi_p16_p48 = pair_set_w16_epi16(cospi[16], cospi[48]);
 2313|   577k|  __m256i cospi_p48_m16 = pair_set_w16_epi16(cospi[48], -cospi[16]);
 2314|   577k|  __m256i cospi_m48_p16 = pair_set_w16_epi16(-cospi[48], cospi[16]);
 2315|   577k|  __m256i cospi_p04_p60 = pair_set_w16_epi16(cospi[4], cospi[60]);
 2316|   577k|  __m256i cospi_p60_m04 = pair_set_w16_epi16(cospi[60], -cospi[4]);
 2317|   577k|  __m256i cospi_p20_p44 = pair_set_w16_epi16(cospi[20], cospi[44]);
 2318|   577k|  __m256i cospi_p44_m20 = pair_set_w16_epi16(cospi[44], -cospi[20]);
 2319|   577k|  __m256i cospi_p36_p28 = pair_set_w16_epi16(cospi[36], cospi[28]);
 2320|   577k|  __m256i cospi_p28_m36 = pair_set_w16_epi16(cospi[28], -cospi[36]);
 2321|   577k|  __m256i cospi_p52_p12 = pair_set_w16_epi16(cospi[52], cospi[12]);
 2322|   577k|  __m256i cospi_p12_m52 = pair_set_w16_epi16(cospi[12], -cospi[52]);
 2323|       |
 2324|       |  // stage 1
 2325|   577k|  __m256i x1[8];
 2326|   577k|  x1[0] = input[0];
 2327|   577k|  x1[1] = _mm256_subs_epi16(__zero, input[7]);
 2328|   577k|  x1[2] = _mm256_subs_epi16(__zero, input[3]);
 2329|   577k|  x1[3] = input[4];
 2330|   577k|  x1[4] = _mm256_subs_epi16(__zero, input[1]);
 2331|   577k|  x1[5] = input[6];
 2332|   577k|  x1[6] = input[2];
 2333|   577k|  x1[7] = _mm256_subs_epi16(__zero, input[5]);
 2334|       |
 2335|       |  // stage 2
 2336|   577k|  __m256i x2[8];
 2337|   577k|  x2[0] = x1[0];
 2338|   577k|  x2[1] = x1[1];
 2339|   577k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[2], &x1[3], __rounding,
 2340|   577k|                  cos_bit);
 2341|   577k|  x2[2] = x1[2];
 2342|   577k|  x2[3] = x1[3];
 2343|   577k|  x2[4] = x1[4];
 2344|   577k|  x2[5] = x1[5];
 2345|   577k|  btf_16_w16_avx2(cospi_p32_p32, cospi_p32_m32, &x1[6], &x1[7], __rounding,
 2346|   577k|                  cos_bit);
 2347|   577k|  x2[6] = x1[6];
 2348|   577k|  x2[7] = x1[7];
 2349|       |
 2350|       |  // stage 3
 2351|   577k|  __m256i x3[8];
 2352|   577k|  x3[0] = _mm256_adds_epi16(x2[0], x2[2]);
 2353|   577k|  x3[2] = _mm256_subs_epi16(x2[0], x2[2]);
 2354|   577k|  x3[1] = _mm256_adds_epi16(x2[1], x2[3]);
 2355|   577k|  x3[3] = _mm256_subs_epi16(x2[1], x2[3]);
 2356|   577k|  x3[4] = _mm256_adds_epi16(x2[4], x2[6]);
 2357|   577k|  x3[6] = _mm256_subs_epi16(x2[4], x2[6]);
 2358|   577k|  x3[5] = _mm256_adds_epi16(x2[5], x2[7]);
 2359|   577k|  x3[7] = _mm256_subs_epi16(x2[5], x2[7]);
 2360|       |
 2361|       |  // stage 4
 2362|   577k|  __m256i x4[8];
 2363|   577k|  x4[0] = x3[0];
 2364|   577k|  x4[1] = x3[1];
 2365|   577k|  x4[2] = x3[2];
 2366|   577k|  x4[3] = x3[3];
 2367|   577k|  btf_16_w16_avx2(cospi_p16_p48, cospi_p48_m16, &x3[4], &x3[5], __rounding,
 2368|   577k|                  cos_bit);
 2369|   577k|  x4[4] = x3[4];
 2370|   577k|  x4[5] = x3[5];
 2371|   577k|  btf_16_w16_avx2(cospi_m48_p16, cospi_p16_p48, &x3[6], &x3[7], __rounding,
 2372|   577k|                  cos_bit);
 2373|   577k|  x4[6] = x3[6];
 2374|   577k|  x4[7] = x3[7];
 2375|       |
 2376|       |  // stage 5
 2377|   577k|  __m256i x5[8];
 2378|   577k|  x5[0] = _mm256_adds_epi16(x4[0], x4[4]);
 2379|   577k|  x5[4] = _mm256_subs_epi16(x4[0], x4[4]);
 2380|   577k|  x5[1] = _mm256_adds_epi16(x4[1], x4[5]);
 2381|   577k|  x5[5] = _mm256_subs_epi16(x4[1], x4[5]);
 2382|   577k|  x5[2] = _mm256_adds_epi16(x4[2], x4[6]);
 2383|   577k|  x5[6] = _mm256_subs_epi16(x4[2], x4[6]);
 2384|   577k|  x5[3] = _mm256_adds_epi16(x4[3], x4[7]);
 2385|   577k|  x5[7] = _mm256_subs_epi16(x4[3], x4[7]);
 2386|       |
 2387|       |  // stage 6
 2388|   577k|  __m256i x6[8];
 2389|   577k|  btf_16_w16_avx2(cospi_p04_p60, cospi_p60_m04, &x5[0], &x5[1], __rounding,
 2390|   577k|                  cos_bit);
 2391|   577k|  x6[0] = x5[0];
 2392|   577k|  x6[1] = x5[1];
 2393|   577k|  btf_16_w16_avx2(cospi_p20_p44, cospi_p44_m20, &x5[2], &x5[3], __rounding,
 2394|   577k|                  cos_bit);
 2395|   577k|  x6[2] = x5[2];
 2396|   577k|  x6[3] = x5[3];
 2397|   577k|  btf_16_w16_avx2(cospi_p36_p28, cospi_p28_m36, &x5[4], &x5[5], __rounding,
 2398|   577k|                  cos_bit);
 2399|   577k|  x6[4] = x5[4];
 2400|   577k|  x6[5] = x5[5];
 2401|   577k|  btf_16_w16_avx2(cospi_p52_p12, cospi_p12_m52, &x5[6], &x5[7], __rounding,
 2402|   577k|                  cos_bit);
 2403|   577k|  x6[6] = x5[6];
 2404|   577k|  x6[7] = x5[7];
 2405|       |
 2406|       |  // stage 7
 2407|   577k|  output[0] = x6[1];
 2408|   577k|  output[1] = x6[6];
 2409|   577k|  output[2] = x6[3];
 2410|   577k|  output[3] = x6[4];
 2411|   577k|  output[4] = x6[5];
 2412|   577k|  output[5] = x6[2];
 2413|   577k|  output[6] = x6[7];
 2414|   577k|  output[7] = x6[0];
 2415|   577k|}
av1_fwd_txfm2d_avx2.c:fidentity8x8_new_avx2:
 2418|   131k|                                         int8_t cos_bit) {
 2419|   131k|  (void)cos_bit;
 2420|       |
 2421|   131k|  output[0] = _mm256_adds_epi16(input[0], input[0]);
 2422|   131k|  output[1] = _mm256_adds_epi16(input[1], input[1]);
 2423|   131k|  output[2] = _mm256_adds_epi16(input[2], input[2]);
 2424|   131k|  output[3] = _mm256_adds_epi16(input[3], input[3]);
 2425|   131k|  output[4] = _mm256_adds_epi16(input[4], input[4]);
 2426|   131k|  output[5] = _mm256_adds_epi16(input[5], input[5]);
 2427|   131k|  output[6] = _mm256_adds_epi16(input[6], input[6]);
 2428|   131k|  output[7] = _mm256_adds_epi16(input[7], input[7]);
 2429|   131k|}
av1_fwd_txfm2d_avx2.c:store_rect_buffer_16bit_to_32bit_w16_avx2:
 1473|  1.45M|    const int out_size) {
 1474|  14.4M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (1474:19): [True: 12.9M, False: 1.45M]
  ------------------
 1475|  12.9M|    store_rect_16bit_to_32bit_avx2(in[i], out + i * stride);
 1476|  12.9M|  }
 1477|  1.45M|}
av1_fwd_txfm2d_avx2.c:store_rect_16bit_to_32bit_avx2:
 1460|  12.9M|                                                  int32_t *const b) {
 1461|  12.9M|  const __m256i one = _mm256_set1_epi16(1);
 1462|       |  const __m256i a_reoder = _mm256_permute4x64_epi64(a, 0xd8);
 1463|  12.9M|  const __m256i a_lo = _mm256_unpacklo_epi16(a_reoder, one);
 1464|  12.9M|  const __m256i a_hi = _mm256_unpackhi_epi16(a_reoder, one);
 1465|  12.9M|  const __m256i b_lo = scale_round_avx2(a_lo, NewSqrt2);
 1466|  12.9M|  const __m256i b_hi = scale_round_avx2(a_hi, NewSqrt2);
 1467|  12.9M|  _mm256_store_si256((__m256i *)b, b_lo);
 1468|  12.9M|  _mm256_store_si256((__m256i *)(b + 8), b_hi);
 1469|  12.9M|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_16x8_avx2:
 2936|   898k|                                       int stride, TX_TYPE tx_type, int bd) {
 2937|   898k|  (void)bd;
 2938|   898k|  __m128i buf0[16], buf1[16];
 2939|   898k|  __m256i buf2[8];
 2940|   898k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_16X8];
 2941|   898k|  const int txw_idx = get_txw_idx(TX_16X8);
 2942|   898k|  const int txh_idx = get_txh_idx(TX_16X8);
 2943|   898k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2944|   898k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2945|   898k|  const int width = 16;
 2946|   898k|  const int height = 8;
 2947|   898k|  const transform_1d_avx2 col_txfm = col_txfm16x8_arr[tx_type];
 2948|   898k|  const transform_1d_sse2 row_txfm = row_txfm16x8_arr[tx_type];
 2949|   898k|  __m128i *buf;
 2950|   898k|  int ud_flip, lr_flip;
 2951|       |
 2952|   898k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2953|       |
 2954|   898k|  if (ud_flip) {
  ------------------
  |  Branch (2954:7): [True: 3, False: 898k]
  ------------------
 2955|      3|    load_buffer_16bit_to_16bit_flip(input + 8 * 0, stride, buf0, height);
 2956|      3|    load_buffer_16bit_to_16bit_flip(input + 8 * 1, stride, &buf0[8], height);
 2957|   898k|  } else {
 2958|   898k|    load_buffer_16bit_to_16bit(input + 8 * 0, stride, buf0, height);
 2959|   898k|    load_buffer_16bit_to_16bit(input + 8 * 1, stride, &buf0[8], height);
 2960|   898k|  }
 2961|   898k|  pack_reg(buf0, &buf0[8], buf2);
 2962|   898k|  round_shift_16bit_w16_avx2(buf2, height, shift[0]);
 2963|   898k|  col_txfm(buf2, buf2, cos_bit_col);
 2964|   898k|  round_shift_16bit_w16_avx2(buf2, height, shift[1]);
 2965|   898k|  transpose_16bit_16x8_avx2(buf2, buf2);
 2966|   898k|  extract_reg(buf2, buf1);
 2967|       |
 2968|   898k|  if (lr_flip) {
  ------------------
  |  Branch (2968:7): [True: 0, False: 898k]
  ------------------
 2969|      0|    buf = buf0;
 2970|      0|    flip_buf_sse2(buf1, buf, width);
 2971|   898k|  } else {
 2972|   898k|    buf = buf1;
 2973|   898k|  }
 2974|   898k|  row_txfm(buf, buf, cos_bit_row);
 2975|   898k|  round_shift_16bit(buf, width, shift[2]);
 2976|   898k|  store_rect_buffer_16bit_to_32bit_w8(buf, output, height, width);
 2977|   898k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_16x32_avx2:
 1946|  39.0k|                                        int stride, TX_TYPE tx_type, int bd) {
 1947|  39.0k|  (void)bd;
 1948|  39.0k|  const TX_SIZE tx_size = TX_16X32;
 1949|  39.0k|  __m256i buf0[32], buf1[32];
 1950|  39.0k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 1951|  39.0k|  const int txw_idx = get_txw_idx(tx_size);
 1952|  39.0k|  const int txh_idx = get_txh_idx(tx_size);
 1953|  39.0k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1954|  39.0k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1955|  39.0k|  const int width = tx_size_wide[tx_size];
 1956|  39.0k|  const int height = tx_size_high[tx_size];
 1957|  39.0k|  const transform_1d_avx2 col_txfm = col_txfm16x32_arr[tx_type];
 1958|  39.0k|  const transform_1d_avx2 row_txfm = row_txfm16x16_arr[tx_type];
 1959|       |
 1960|  39.0k|  int ud_flip, lr_flip;
 1961|  39.0k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1962|       |
 1963|  39.0k|  if (ud_flip) {
  ------------------
  |  Branch (1963:7): [True: 0, False: 39.0k]
  ------------------
 1964|      0|    load_buffer_16bit_to_16bit_flip_avx2(input, stride, buf0, height);
 1965|  39.0k|  } else {
 1966|  39.0k|    load_buffer_16bit_to_16bit_avx2(input, stride, buf0, height);
 1967|  39.0k|  }
 1968|  39.0k|  round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 1969|  39.0k|  col_txfm(buf0, buf0, cos_bit_col);
 1970|  39.0k|  round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 1971|  39.0k|  transpose_16bit_16x16_avx2(buf0, buf1);
 1972|  39.0k|  transpose_16bit_16x16_avx2(buf0 + 16, buf1 + 16);
 1973|       |
 1974|   117k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1974:19): [True: 78.1k, False: 39.0k]
  ------------------
 1975|  78.1k|    __m256i *buf;
 1976|  78.1k|    if (lr_flip) {
  ------------------
  |  Branch (1976:9): [True: 0, False: 78.1k]
  ------------------
 1977|      0|      buf = buf0;
 1978|      0|      flip_buf_avx2(buf1 + width * i, buf, width);
 1979|  78.1k|    } else {
 1980|  78.1k|      buf = buf1 + width * i;
 1981|  78.1k|    }
 1982|  78.1k|    row_txfm(buf, buf, cos_bit_row);
 1983|  78.1k|    round_shift_16bit_w16_avx2(buf, width, shift[2]);
 1984|  78.1k|    store_rect_buffer_16bit_to_32bit_w16_avx2(buf, output + i * 16, height,
 1985|  78.1k|                                              width);
 1986|  78.1k|  }
 1987|  39.0k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_32x16_avx2:
 1990|  31.4k|                                        int stride, TX_TYPE tx_type, int bd) {
 1991|  31.4k|  (void)bd;
 1992|  31.4k|  __m256i buf0[32], buf1[64];
 1993|  31.4k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_32X16];
 1994|  31.4k|  const int txw_idx = get_txw_idx(TX_32X16);
 1995|  31.4k|  const int txh_idx = get_txh_idx(TX_32X16);
 1996|  31.4k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1997|  31.4k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1998|  31.4k|  const int width = 32;
 1999|  31.4k|  const int height = 16;
 2000|  31.4k|  const transform_1d_avx2 col_txfm = col_txfm16x16_arr[tx_type];
 2001|  31.4k|  const transform_1d_avx2 row_txfm = row_txfm16x32_arr[tx_type];
 2002|       |
 2003|  31.4k|  int ud_flip, lr_flip;
 2004|  31.4k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2005|       |
 2006|  94.3k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2006:19): [True: 62.9k, False: 31.4k]
  ------------------
 2007|  62.9k|    if (ud_flip) {
  ------------------
  |  Branch (2007:9): [True: 0, False: 62.9k]
  ------------------
 2008|      0|      load_buffer_16bit_to_16bit_flip_avx2(input + 16 * i, stride, buf0,
 2009|      0|                                           height);
 2010|  62.9k|    } else {
 2011|  62.9k|      load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 2012|  62.9k|    }
 2013|  62.9k|    round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 2014|  62.9k|    col_txfm(buf0, buf0, cos_bit_col);
 2015|  62.9k|    round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 2016|  62.9k|    transpose_16bit_16x16_avx2(buf0, buf1 + 0 * width + 16 * i);
 2017|  62.9k|  }
 2018|       |
 2019|  31.4k|  __m256i *buf;
 2020|  31.4k|  if (lr_flip) {
  ------------------
  |  Branch (2020:7): [True: 0, False: 31.4k]
  ------------------
 2021|      0|    buf = buf0;
 2022|      0|    flip_buf_avx2(buf1, buf, width);
 2023|  31.4k|  } else {
 2024|  31.4k|    buf = buf1;
 2025|  31.4k|  }
 2026|  31.4k|  row_txfm(buf, buf, cos_bit_row);
 2027|  31.4k|  round_shift_16bit_w16_avx2(buf, width, shift[2]);
 2028|  31.4k|  store_rect_buffer_16bit_to_32bit_w16_avx2(buf, output, height, width);
 2029|  31.4k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_32x64_avx2:
 2075|  2.61k|                                        int stride, TX_TYPE tx_type, int bd) {
 2076|  2.61k|  (void)bd;
 2077|  2.61k|  (void)tx_type;
 2078|  2.61k|  assert(tx_type == DCT_DCT);
 2079|  2.61k|  const TX_SIZE tx_size = TX_32X64;
 2080|  2.61k|  __m256i buf0[64], buf1[256];
 2081|  2.61k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 2082|  2.61k|  const int txw_idx = get_txw_idx(tx_size);
 2083|  2.61k|  const int txh_idx = get_txh_idx(tx_size);
 2084|  2.61k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2085|  2.61k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2086|  2.61k|  const int width = tx_size_wide[tx_size];
 2087|  2.61k|  const int height = tx_size_high[tx_size];
 2088|  2.61k|  const transform_1d_avx2 col_txfm = fdct16x64_new_avx2;
 2089|  2.61k|  const int width_div16 = (width >> 4);
 2090|  2.61k|  const int height_div16 = (height >> 4);
 2091|       |
 2092|  7.84k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (2092:19): [True: 5.23k, False: 2.61k]
  ------------------
 2093|  5.23k|    load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 2094|  5.23k|    round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 2095|  5.23k|    col_txfm(buf0, buf0, cos_bit_col);
 2096|  5.23k|    round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 2097|  15.6k|    for (int j = 0; j < AOMMIN(2, height_div16); ++j) {
  ------------------
  |  |   34|  15.6k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 15.6k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (2097:21): [True: 10.4k, False: 5.23k]
  ------------------
 2098|  10.4k|      transpose_16bit_16x16_avx2(buf0 + j * 16, buf1 + j * width + 16 * i);
 2099|  10.4k|    }
 2100|  5.23k|  }
 2101|       |
 2102|  7.84k|  for (int i = 0; i < AOMMIN(2, height_div16); i++) {
  ------------------
  |  |   34|  18.4E|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 7.85k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (2102:19): [True: 5.23k, False: 2.61k]
  ------------------
 2103|  5.23k|    __m256i bufA[32];
 2104|  5.23k|    __m256i bufB[32];
 2105|  5.23k|    __m128i *buf = (__m128i *)(buf1 + width * i);
 2106|   172k|    for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (2106:21): [True: 167k, False: 5.23k]
  ------------------
 2107|   167k|      bufA[j] = _mm256_cvtepi16_epi32(buf[j * 2]);
 2108|   167k|      bufB[j] = _mm256_cvtepi16_epi32(buf[j * 2 + 1]);
 2109|   167k|    }
 2110|  5.23k|    fdct32_avx2(bufA, bufA, cos_bit_row);
 2111|  5.23k|    fdct32_avx2(bufB, bufB, cos_bit_row);
 2112|  5.23k|    round_shift_rect_array_32_avx2(bufA, bufA, 32, -shift[2], NewSqrt2);
 2113|  5.23k|    round_shift_rect_array_32_avx2(bufB, bufB, 32, -shift[2], NewSqrt2);
 2114|       |
 2115|  5.23k|    store_output_32bit_w16(output + i * 16, bufA, bufB, 32, 32);
 2116|  5.23k|  }
 2117|  2.61k|}
av1_fwd_txfm2d_avx2.c:fdct32_avx2:
  715|  10.4k|                               int8_t cos_bit) {
  716|  10.4k|  __m256i x1[32];
  717|  10.4k|  const int32_t *cospi = cospi_arr(cos_bit);
  718|  10.4k|  const __m256i _r = _mm256_set1_epi32(1 << (cos_bit - 1));
  719|       |  // stage 0
  720|       |  // stage 1
  721|  10.4k|  btf_32_add_sub_out_avx2(&x1[0], &x1[31], input[0], input[31]);
  722|  10.4k|  btf_32_add_sub_out_avx2(&x1[1], &x1[30], input[1], input[30]);
  723|  10.4k|  btf_32_add_sub_out_avx2(&x1[2], &x1[29], input[2], input[29]);
  724|  10.4k|  btf_32_add_sub_out_avx2(&x1[3], &x1[28], input[3], input[28]);
  725|  10.4k|  btf_32_add_sub_out_avx2(&x1[4], &x1[27], input[4], input[27]);
  726|  10.4k|  btf_32_add_sub_out_avx2(&x1[5], &x1[26], input[5], input[26]);
  727|  10.4k|  btf_32_add_sub_out_avx2(&x1[6], &x1[25], input[6], input[25]);
  728|  10.4k|  btf_32_add_sub_out_avx2(&x1[7], &x1[24], input[7], input[24]);
  729|  10.4k|  btf_32_add_sub_out_avx2(&x1[8], &x1[23], input[8], input[23]);
  730|  10.4k|  btf_32_add_sub_out_avx2(&x1[9], &x1[22], input[9], input[22]);
  731|  10.4k|  btf_32_add_sub_out_avx2(&x1[10], &x1[21], input[10], input[21]);
  732|  10.4k|  btf_32_add_sub_out_avx2(&x1[11], &x1[20], input[11], input[20]);
  733|  10.4k|  btf_32_add_sub_out_avx2(&x1[12], &x1[19], input[12], input[19]);
  734|  10.4k|  btf_32_add_sub_out_avx2(&x1[13], &x1[18], input[13], input[18]);
  735|  10.4k|  btf_32_add_sub_out_avx2(&x1[14], &x1[17], input[14], input[17]);
  736|  10.4k|  btf_32_add_sub_out_avx2(&x1[15], &x1[16], input[15], input[16]);
  737|       |
  738|       |  // stage 2
  739|  10.4k|  btf_32_add_sub_avx2(&x1[0], &x1[15]);
  740|  10.4k|  btf_32_add_sub_avx2(&x1[1], &x1[14]);
  741|  10.4k|  btf_32_add_sub_avx2(&x1[2], &x1[13]);
  742|  10.4k|  btf_32_add_sub_avx2(&x1[3], &x1[12]);
  743|  10.4k|  btf_32_add_sub_avx2(&x1[4], &x1[11]);
  744|  10.4k|  btf_32_add_sub_avx2(&x1[5], &x1[10]);
  745|  10.4k|  btf_32_add_sub_avx2(&x1[6], &x1[9]);
  746|  10.4k|  btf_32_add_sub_avx2(&x1[7], &x1[8]);
  747|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[20], &x1[27], _r, cos_bit);
  748|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[21], &x1[26], _r, cos_bit);
  749|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[22], &x1[25], _r, cos_bit);
  750|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[23], &x1[24], _r, cos_bit);
  751|       |
  752|       |  // stage 3
  753|  10.4k|  btf_32_add_sub_avx2(&x1[0], &x1[7]);
  754|  10.4k|  btf_32_add_sub_avx2(&x1[1], &x1[6]);
  755|  10.4k|  btf_32_add_sub_avx2(&x1[2], &x1[5]);
  756|  10.4k|  btf_32_add_sub_avx2(&x1[3], &x1[4]);
  757|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[10], &x1[13], _r, cos_bit);
  758|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[11], &x1[12], _r, cos_bit);
  759|  10.4k|  btf_32_add_sub_avx2(&x1[16], &x1[23]);
  760|  10.4k|  btf_32_add_sub_avx2(&x1[17], &x1[22]);
  761|  10.4k|  btf_32_add_sub_avx2(&x1[18], &x1[21]);
  762|  10.4k|  btf_32_add_sub_avx2(&x1[19], &x1[20]);
  763|  10.4k|  btf_32_add_sub_avx2(&x1[31], &x1[24]);
  764|  10.4k|  btf_32_add_sub_avx2(&x1[30], &x1[25]);
  765|  10.4k|  btf_32_add_sub_avx2(&x1[29], &x1[26]);
  766|  10.4k|  btf_32_add_sub_avx2(&x1[28], &x1[27]);
  767|       |
  768|       |  // stage 4
  769|  10.4k|  btf_32_add_sub_avx2(&x1[0], &x1[3]);
  770|  10.4k|  btf_32_add_sub_avx2(&x1[1], &x1[2]);
  771|  10.4k|  btf_32_avx2_type0(-cospi[32], cospi[32], &x1[5], &x1[6], _r, cos_bit);
  772|  10.4k|  btf_32_add_sub_avx2(&x1[8], &x1[11]);
  773|  10.4k|  btf_32_add_sub_avx2(&x1[9], &x1[10]);
  774|  10.4k|  btf_32_add_sub_avx2(&x1[15], &x1[12]);
  775|  10.4k|  btf_32_add_sub_avx2(&x1[14], &x1[13]);
  776|  10.4k|  btf_32_avx2_type0(-cospi[16], cospi[48], &x1[18], &x1[29], _r, cos_bit);
  777|  10.4k|  btf_32_avx2_type0(-cospi[16], cospi[48], &x1[19], &x1[28], _r, cos_bit);
  778|  10.4k|  btf_32_avx2_type0(-cospi[48], -cospi[16], &x1[20], &x1[27], _r, cos_bit);
  779|  10.4k|  btf_32_avx2_type0(-cospi[48], -cospi[16], &x1[21], &x1[26], _r, cos_bit);
  780|       |
  781|       |  // stage 5
  782|  10.4k|  btf_32_avx2_type0(cospi[32], cospi[32], &x1[0], &x1[1], _r, cos_bit);
  783|  10.4k|  btf_32_avx2_type1(cospi[48], cospi[16], &x1[2], &x1[3], _r, cos_bit);
  784|  10.4k|  btf_32_add_sub_avx2(&x1[4], &x1[5]);
  785|  10.4k|  btf_32_add_sub_avx2(&x1[7], &x1[6]);
  786|  10.4k|  btf_32_avx2_type0(-cospi[16], cospi[48], &x1[9], &x1[14], _r, cos_bit);
  787|  10.4k|  btf_32_avx2_type0(-cospi[48], -cospi[16], &x1[10], &x1[13], _r, cos_bit);
  788|  10.4k|  btf_32_add_sub_avx2(&x1[16], &x1[19]);
  789|  10.4k|  btf_32_add_sub_avx2(&x1[17], &x1[18]);
  790|  10.4k|  btf_32_add_sub_avx2(&x1[23], &x1[20]);
  791|  10.4k|  btf_32_add_sub_avx2(&x1[22], &x1[21]);
  792|  10.4k|  btf_32_add_sub_avx2(&x1[24], &x1[27]);
  793|  10.4k|  btf_32_add_sub_avx2(&x1[25], &x1[26]);
  794|  10.4k|  btf_32_add_sub_avx2(&x1[31], &x1[28]);
  795|  10.4k|  btf_32_add_sub_avx2(&x1[30], &x1[29]);
  796|       |
  797|       |  // stage 6
  798|  10.4k|  btf_32_avx2_type1(cospi[56], cospi[8], &x1[4], &x1[7], _r, cos_bit);
  799|  10.4k|  btf_32_avx2_type1(cospi[24], cospi[40], &x1[5], &x1[6], _r, cos_bit);
  800|  10.4k|  btf_32_add_sub_avx2(&x1[8], &x1[9]);
  801|  10.4k|  btf_32_add_sub_avx2(&x1[11], &x1[10]);
  802|  10.4k|  btf_32_add_sub_avx2(&x1[12], &x1[13]);
  803|  10.4k|  btf_32_add_sub_avx2(&x1[15], &x1[14]);
  804|  10.4k|  btf_32_avx2_type0(-cospi[8], cospi[56], &x1[17], &x1[30], _r, cos_bit);
  805|  10.4k|  btf_32_avx2_type0(-cospi[56], -cospi[8], &x1[18], &x1[29], _r, cos_bit);
  806|  10.4k|  btf_32_avx2_type0(-cospi[40], cospi[24], &x1[21], &x1[26], _r, cos_bit);
  807|  10.4k|  btf_32_avx2_type0(-cospi[24], -cospi[40], &x1[22], &x1[25], _r, cos_bit);
  808|       |
  809|       |  // stage 7
  810|  10.4k|  btf_32_avx2_type1(cospi[60], cospi[4], &x1[8], &x1[15], _r, cos_bit);
  811|  10.4k|  btf_32_avx2_type1(cospi[28], cospi[36], &x1[9], &x1[14], _r, cos_bit);
  812|  10.4k|  btf_32_avx2_type1(cospi[44], cospi[20], &x1[10], &x1[13], _r, cos_bit);
  813|  10.4k|  btf_32_avx2_type1(cospi[12], cospi[52], &x1[11], &x1[12], _r, cos_bit);
  814|  10.4k|  btf_32_add_sub_avx2(&x1[16], &x1[17]);
  815|  10.4k|  btf_32_add_sub_avx2(&x1[19], &x1[18]);
  816|  10.4k|  btf_32_add_sub_avx2(&x1[20], &x1[21]);
  817|  10.4k|  btf_32_add_sub_avx2(&x1[23], &x1[22]);
  818|  10.4k|  btf_32_add_sub_avx2(&x1[24], &x1[25]);
  819|  10.4k|  btf_32_add_sub_avx2(&x1[27], &x1[26]);
  820|  10.4k|  btf_32_add_sub_avx2(&x1[28], &x1[29]);
  821|  10.4k|  btf_32_add_sub_avx2(&x1[31], &x1[30]);
  822|       |
  823|       |  // stage 8
  824|  10.4k|  btf_32_avx2_type1(cospi[62], cospi[2], &x1[16], &x1[31], _r, cos_bit);
  825|  10.4k|  btf_32_avx2_type1(cospi[30], cospi[34], &x1[17], &x1[30], _r, cos_bit);
  826|  10.4k|  btf_32_avx2_type1(cospi[46], cospi[18], &x1[18], &x1[29], _r, cos_bit);
  827|  10.4k|  btf_32_avx2_type1(cospi[14], cospi[50], &x1[19], &x1[28], _r, cos_bit);
  828|  10.4k|  btf_32_avx2_type1(cospi[54], cospi[10], &x1[20], &x1[27], _r, cos_bit);
  829|  10.4k|  btf_32_avx2_type1(cospi[22], cospi[42], &x1[21], &x1[26], _r, cos_bit);
  830|  10.4k|  btf_32_avx2_type1(cospi[38], cospi[26], &x1[22], &x1[25], _r, cos_bit);
  831|  10.4k|  btf_32_avx2_type1(cospi[6], cospi[58], &x1[23], &x1[24], _r, cos_bit);
  832|       |
  833|       |  // stage 9
  834|  10.4k|  output[0] = x1[0];
  835|  10.4k|  output[1] = x1[16];
  836|  10.4k|  output[2] = x1[8];
  837|  10.4k|  output[3] = x1[24];
  838|  10.4k|  output[4] = x1[4];
  839|  10.4k|  output[5] = x1[20];
  840|  10.4k|  output[6] = x1[12];
  841|  10.4k|  output[7] = x1[28];
  842|  10.4k|  output[8] = x1[2];
  843|  10.4k|  output[9] = x1[18];
  844|  10.4k|  output[10] = x1[10];
  845|  10.4k|  output[11] = x1[26];
  846|  10.4k|  output[12] = x1[6];
  847|  10.4k|  output[13] = x1[22];
  848|  10.4k|  output[14] = x1[14];
  849|  10.4k|  output[15] = x1[30];
  850|  10.4k|  output[16] = x1[1];
  851|  10.4k|  output[17] = x1[17];
  852|  10.4k|  output[18] = x1[9];
  853|  10.4k|  output[19] = x1[25];
  854|  10.4k|  output[20] = x1[5];
  855|  10.4k|  output[21] = x1[21];
  856|  10.4k|  output[22] = x1[13];
  857|  10.4k|  output[23] = x1[29];
  858|  10.4k|  output[24] = x1[3];
  859|  10.4k|  output[25] = x1[19];
  860|  10.4k|  output[26] = x1[11];
  861|  10.4k|  output[27] = x1[27];
  862|  10.4k|  output[28] = x1[7];
  863|  10.4k|  output[29] = x1[23];
  864|  10.4k|  output[30] = x1[15];
  865|  10.4k|  output[31] = x1[31];
  866|  10.4k|}
av1_fwd_txfm2d_avx2.c:lowbd_fwd_txfm2d_64x32_avx2:
 2032|  2.57k|                                        int stride, TX_TYPE tx_type, int bd) {
 2033|  2.57k|  (void)bd;
 2034|  2.57k|  const TX_SIZE tx_size = TX_64X32;
 2035|  2.57k|  __m256i buf0[64], buf1[256];
 2036|  2.57k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 2037|  2.57k|  const int txw_idx = get_txw_idx(tx_size);
 2038|  2.57k|  const int txh_idx = get_txh_idx(tx_size);
 2039|  2.57k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2040|  2.57k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2041|  2.57k|  const int width = tx_size_wide[tx_size];
 2042|  2.57k|  const int height = tx_size_high[tx_size];
 2043|  2.57k|  const transform_1d_avx2 col_txfm = col_txfm16x32_arr[tx_type];
 2044|  2.57k|  const int width_div16 = (width >> 4);
 2045|  2.57k|  const int height_div16 = (height >> 4);
 2046|       |
 2047|  12.8k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (2047:19): [True: 10.3k, False: 2.57k]
  ------------------
 2048|  10.3k|    load_buffer_16bit_to_16bit_avx2(input + 16 * i, stride, buf0, height);
 2049|  10.3k|    round_shift_16bit_w16_avx2(buf0, height, shift[0]);
 2050|  10.3k|    col_txfm(buf0, buf0, cos_bit_col);
 2051|  10.3k|    round_shift_16bit_w16_avx2(buf0, height, shift[1]);
 2052|  30.9k|    for (int j = 0; j < AOMMIN(4, height_div16); ++j) {
  ------------------
  |  |   34|  30.9k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [Folded, False: 30.9k]
  |  |  ------------------
  ------------------
  |  Branch (2052:21): [True: 20.6k, False: 10.3k]
  ------------------
 2053|  20.6k|      transpose_16bit_16x16_avx2(buf0 + j * 16, buf1 + j * width + 16 * i);
 2054|  20.6k|    }
 2055|  10.3k|  }
 2056|  2.57k|  assert(tx_type == DCT_DCT);
 2057|  7.73k|  for (int i = 0; i < AOMMIN(2, height_div16); i++) {
  ------------------
  |  |   34|  7.73k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [Folded, False: 7.73k]
  |  |  ------------------
  ------------------
  |  Branch (2057:19): [True: 5.15k, False: 2.57k]
  ------------------
 2058|  5.15k|    __m256i bufA[64];
 2059|  5.15k|    __m256i bufB[64];
 2060|  5.15k|    __m128i *buf = (__m128i *)(buf1 + width * i);
 2061|   335k|    for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (2061:21): [True: 329k, False: 5.15k]
  ------------------
 2062|   329k|      bufA[j] = _mm256_cvtepi16_epi32(buf[j * 2]);
 2063|   329k|      bufB[j] = _mm256_cvtepi16_epi32(buf[j * 2 + 1]);
 2064|   329k|    }
 2065|  5.15k|    fdct64_new_avx2(bufA, bufA, cos_bit_row);
 2066|  5.15k|    fdct64_new_avx2(bufB, bufB, cos_bit_row);
 2067|  5.15k|    round_shift_rect_array_32_avx2(bufA, bufA, 32, -shift[2], NewSqrt2);
 2068|  5.15k|    round_shift_rect_array_32_avx2(bufB, bufB, 32, -shift[2], NewSqrt2);
 2069|       |
 2070|  5.15k|    store_output_32bit_w16(output + i * 16, bufA, bufB, 32, 32);
 2071|  5.15k|  }
 2072|  2.57k|}

av1_fwd_txfm2d_avx2.c:btf_32_avx2_type0_new:
   61|  5.58M|                                         const int32_t cos_bit) {
   62|  5.58M|  __m256i _in0 = *in0;
   63|  5.58M|  __m256i _in1 = *in1;
   64|  5.58M|  const __m256i in0_w0 = _mm256_mullo_epi32(_in0, ww0);
   65|  5.58M|  const __m256i in1_w1 = _mm256_mullo_epi32(_in1, ww1);
   66|  5.58M|  __m256i temp0 = _mm256_add_epi32(in0_w0, in1_w1);
   67|  5.58M|  temp0 = _mm256_add_epi32(temp0, _r);
   68|  5.58M|  *in0 = _mm256_srai_epi32(temp0, cos_bit);
   69|  5.58M|  const __m256i in0_w1 = _mm256_mullo_epi32(_in0, ww1);
   70|  5.58M|  const __m256i in1_w0 = _mm256_mullo_epi32(_in1, ww0);
   71|  5.58M|  __m256i temp1 = _mm256_sub_epi32(in0_w1, in1_w0);
   72|  5.58M|  temp1 = _mm256_add_epi32(temp1, _r);
   73|  5.58M|  *in1 = _mm256_srai_epi32(temp1, cos_bit);
   74|  5.58M|}
av1_fwd_txfm2d_avx2.c:btf_32_avx2_type1_new:
   81|  3.46M|                                         const int32_t cos_bit) {
   82|  3.46M|  __m256i _in0 = *in0;
   83|  3.46M|  __m256i _in1 = *in1;
   84|  3.46M|  const __m256i in0_w0 = _mm256_mullo_epi32(_in0, ww0);
   85|  3.46M|  const __m256i in1_w1 = _mm256_mullo_epi32(_in1, ww1);
   86|  3.46M|  __m256i temp0 = _mm256_add_epi32(in0_w0, in1_w1);
   87|  3.46M|  temp0 = _mm256_add_epi32(temp0, _r);
   88|  3.46M|  *in0 = _mm256_srai_epi32(temp0, cos_bit);
   89|  3.46M|  const __m256i in0_w1 = _mm256_mullo_epi32(_in0, ww1);
   90|  3.46M|  const __m256i in1_w0 = _mm256_mullo_epi32(_in1, ww0);
   91|  3.46M|  __m256i temp1 = _mm256_sub_epi32(in1_w0, in0_w1);
   92|  3.46M|  temp1 = _mm256_add_epi32(temp1, _r);
   93|  3.46M|  *in1 = _mm256_srai_epi32(temp1, cos_bit);
   94|  3.46M|}
av1_fwd_txfm2d_avx2.c:btf_32_avx2_type0:
   20|   188k|                                     const __m256i _r, const int32_t cos_bit) {
   21|   188k|  __m256i _in0 = *in0;
   22|   188k|  __m256i _in1 = *in1;
   23|   188k|  const __m256i ww0 = _mm256_set1_epi32(w0);
   24|   188k|  const __m256i ww1 = _mm256_set1_epi32(w1);
   25|   188k|  const __m256i in0_w0 = _mm256_mullo_epi32(_in0, ww0);
   26|   188k|  const __m256i in1_w1 = _mm256_mullo_epi32(_in1, ww1);
   27|   188k|  __m256i temp0 = _mm256_add_epi32(in0_w0, in1_w1);
   28|   188k|  temp0 = _mm256_add_epi32(temp0, _r);
   29|   188k|  *in0 = _mm256_srai_epi32(temp0, cos_bit);
   30|   188k|  const __m256i in0_w1 = _mm256_mullo_epi32(_in0, ww1);
   31|   188k|  const __m256i in1_w0 = _mm256_mullo_epi32(_in1, ww0);
   32|   188k|  __m256i temp1 = _mm256_sub_epi32(in0_w1, in1_w0);
   33|   188k|  temp1 = _mm256_add_epi32(temp1, _r);
   34|   188k|  *in1 = _mm256_srai_epi32(temp1, cos_bit);
   35|   188k|}
av1_fwd_txfm2d_avx2.c:btf_32_avx2_type1:
   39|   156k|                                     const __m256i _r, const int32_t cos_bit) {
   40|   156k|  __m256i _in0 = *in0;
   41|   156k|  __m256i _in1 = *in1;
   42|   156k|  const __m256i ww0 = _mm256_set1_epi32(w0);
   43|   156k|  const __m256i ww1 = _mm256_set1_epi32(w1);
   44|   156k|  const __m256i in0_w0 = _mm256_mullo_epi32(_in0, ww0);
   45|   156k|  const __m256i in1_w1 = _mm256_mullo_epi32(_in1, ww1);
   46|   156k|  __m256i temp0 = _mm256_add_epi32(in0_w0, in1_w1);
   47|   156k|  temp0 = _mm256_add_epi32(temp0, _r);
   48|   156k|  *in0 = _mm256_srai_epi32(temp0, cos_bit);
   49|   156k|  const __m256i in0_w1 = _mm256_mullo_epi32(_in0, ww1);
   50|   156k|  const __m256i in1_w0 = _mm256_mullo_epi32(_in1, ww0);
   51|   156k|  __m256i temp1 = _mm256_sub_epi32(in1_w0, in0_w1);
   52|   156k|  temp1 = _mm256_add_epi32(temp1, _r);
   53|   156k|  *in1 = _mm256_srai_epi32(temp1, cos_bit);
   54|   156k|}

av1_lowbd_fwd_txfm2d_4x4_sse2:
 1976|  39.4M|                                   int stride, TX_TYPE tx_type, int bd) {
 1977|  39.4M|  (void)bd;
 1978|  39.4M|  __m128i buf0[4], buf1[4], *buf;
 1979|  39.4M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_4X4];
 1980|  39.4M|  const int txw_idx = get_txw_idx(TX_4X4);
 1981|  39.4M|  const int txh_idx = get_txh_idx(TX_4X4);
 1982|  39.4M|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1983|  39.4M|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 1984|  39.4M|  const int width = 4;
 1985|  39.4M|  const int height = 4;
 1986|  39.4M|  const transform_1d_sse2 col_txfm = col_txfm4x4_arr[tx_type];
 1987|  39.4M|  const transform_1d_sse2 row_txfm = row_txfm4x4_arr[tx_type];
 1988|  39.4M|  int ud_flip, lr_flip;
 1989|       |
 1990|  39.4M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1991|  39.4M|  if (ud_flip) {
  ------------------
  |  Branch (1991:7): [True: 22.8k, False: 39.4M]
  ------------------
 1992|  22.8k|    load_buffer_16bit_to_16bit_w4_flip(input, stride, buf0, height);
 1993|  39.4M|  } else {
 1994|  39.4M|    load_buffer_16bit_to_16bit_w4(input, stride, buf0, height);
 1995|  39.4M|  }
 1996|  39.4M|  round_shift_16bit(buf0, height, shift[0]);
 1997|  39.4M|  col_txfm(buf0, buf0, cos_bit_col);
 1998|  39.4M|  round_shift_16bit(buf0, height, shift[1]);
 1999|  39.4M|  transpose_16bit_4x4(buf0, buf1);
 2000|       |
 2001|  39.4M|  if (lr_flip) {
  ------------------
  |  Branch (2001:7): [True: 35.5k, False: 39.4M]
  ------------------
 2002|  35.5k|    buf = buf0;
 2003|  35.5k|    flip_buf_sse2(buf1, buf, width);
 2004|  39.4M|  } else {
 2005|  39.4M|    buf = buf1;
 2006|  39.4M|  }
 2007|  39.4M|  row_txfm(buf, buf, cos_bit_row);
 2008|  39.4M|  round_shift_16bit(buf, width, shift[2]);
 2009|  39.4M|  store_buffer_16bit_to_32bit_w4(buf, output, height, width);
 2010|  39.4M|}
av1_lowbd_fwd_txfm2d_4x8_sse2:
 2013|  6.98M|                                   int stride, TX_TYPE tx_type, int bd) {
 2014|  6.98M|  (void)stride;
 2015|  6.98M|  (void)bd;
 2016|  6.98M|  __m128i buf0[8], buf1[8], *buf;
 2017|  6.98M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_4X8];
 2018|  6.98M|  const int txw_idx = get_txw_idx(TX_4X8);
 2019|  6.98M|  const int txh_idx = get_txh_idx(TX_4X8);
 2020|  6.98M|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2021|  6.98M|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2022|  6.98M|  const int width = 4;
 2023|  6.98M|  const int height = 8;
 2024|  6.98M|  const transform_1d_sse2 col_txfm = col_txfm4x8_arr[tx_type];
 2025|  6.98M|  const transform_1d_sse2 row_txfm = row_txfm8x4_arr[tx_type];
 2026|  6.98M|  int ud_flip, lr_flip;
 2027|       |
 2028|  6.98M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2029|  6.98M|  if (ud_flip) {
  ------------------
  |  Branch (2029:7): [True: 9.66k, False: 6.97M]
  ------------------
 2030|  9.66k|    load_buffer_16bit_to_16bit_w4_flip(input, stride, buf0, height);
 2031|  6.97M|  } else {
 2032|  6.97M|    load_buffer_16bit_to_16bit_w4(input, stride, buf0, height);
 2033|  6.97M|  }
 2034|  6.98M|  round_shift_16bit(buf0, height, shift[0]);
 2035|  6.98M|  col_txfm(buf0, buf0, cos_bit_col);
 2036|  6.98M|  round_shift_16bit(buf0, height, shift[1]);
 2037|  6.98M|  transpose_16bit_4x8(buf0, buf1);
 2038|       |
 2039|  6.98M|  if (lr_flip) {
  ------------------
  |  Branch (2039:7): [True: 15.1k, False: 6.97M]
  ------------------
 2040|  15.1k|    buf = buf0;
 2041|  15.1k|    flip_buf_sse2(buf1, buf, width);
 2042|  6.97M|  } else {
 2043|  6.97M|    buf = buf1;
 2044|  6.97M|  }
 2045|  6.98M|  row_txfm(buf, buf, cos_bit_row);
 2046|  6.98M|  round_shift_16bit(buf, width, shift[2]);
 2047|  6.98M|  store_rect_buffer_16bit_to_32bit_w8(buf, output, height, width);
 2048|  6.98M|}
av1_lowbd_fwd_txfm2d_8x4_sse2:
 2092|   289k|                                   int stride, TX_TYPE tx_type, int bd) {
 2093|   289k|  (void)bd;
 2094|   289k|  __m128i buf0[8], buf1[8], *buf;
 2095|   289k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_8X4];
 2096|   289k|  const int txw_idx = get_txw_idx(TX_8X4);
 2097|   289k|  const int txh_idx = get_txh_idx(TX_8X4);
 2098|   289k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2099|   289k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2100|   289k|  const int width = 8;
 2101|   289k|  const int height = 4;
 2102|   289k|  const transform_1d_sse2 col_txfm = col_txfm8x4_arr[tx_type];
 2103|   289k|  const transform_1d_sse2 row_txfm = row_txfm4x8_arr[tx_type];
 2104|   289k|  int ud_flip, lr_flip;
 2105|       |
 2106|   289k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2107|   289k|  if (ud_flip)
  ------------------
  |  Branch (2107:7): [True: 0, False: 289k]
  ------------------
 2108|      0|    load_buffer_16bit_to_16bit_flip(input, stride, buf0, height);
 2109|   289k|  else
 2110|   289k|    load_buffer_16bit_to_16bit(input, stride, buf0, height);
 2111|   289k|  round_shift_16bit(buf0, height, shift[0]);
 2112|   289k|  col_txfm(buf0, buf0, cos_bit_col);
 2113|   289k|  round_shift_16bit(buf0, height, shift[1]);
 2114|   289k|  transpose_16bit_8x8(buf0, buf1);
 2115|       |
 2116|   289k|  if (lr_flip) {
  ------------------
  |  Branch (2116:7): [True: 0, False: 289k]
  ------------------
 2117|      0|    buf = buf0;
 2118|      0|    flip_buf_sse2(buf1, buf, width);
 2119|   289k|  } else {
 2120|   289k|    buf = buf1;
 2121|   289k|  }
 2122|   289k|  row_txfm(buf, buf, cos_bit_row);
 2123|   289k|  round_shift_16bit(buf, width, shift[2]);
 2124|   289k|  store_rect_buffer_16bit_to_32bit_w4(buf, output, height, width);
 2125|   289k|}
av1_fwd_txfm_sse2.c:fdct4x4_new_sse2:
   19|  49.0M|                             int8_t cos_bit) {
   20|  49.0M|  const int32_t *cospi = cospi_arr(cos_bit);
   21|  49.0M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  49.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   22|  49.0M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  49.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   23|  49.0M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  49.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   24|  49.0M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  49.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   25|  49.0M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
   26|  49.0M|  __m128i u[4], v[4];
   27|       |
   28|  49.0M|  u[0] = _mm_unpacklo_epi16(input[0], input[1]);
   29|  49.0M|  u[1] = _mm_unpacklo_epi16(input[3], input[2]);
   30|       |
   31|  49.0M|  v[0] = _mm_add_epi16(u[0], u[1]);
   32|  49.0M|  v[1] = _mm_sub_epi16(u[0], u[1]);
   33|       |
   34|  49.0M|  u[0] = _mm_madd_epi16(v[0], cospi_p32_p32);  // 0
   35|  49.0M|  u[1] = _mm_madd_epi16(v[0], cospi_p32_m32);  // 2
   36|  49.0M|  u[2] = _mm_madd_epi16(v[1], cospi_p16_p48);  // 1
   37|  49.0M|  u[3] = _mm_madd_epi16(v[1], cospi_p48_m16);  // 3
   38|       |
   39|  49.0M|  v[0] = _mm_add_epi32(u[0], __rounding);
   40|  49.0M|  v[1] = _mm_add_epi32(u[1], __rounding);
   41|  49.0M|  v[2] = _mm_add_epi32(u[2], __rounding);
   42|  49.0M|  v[3] = _mm_add_epi32(u[3], __rounding);
   43|  49.0M|  u[0] = _mm_srai_epi32(v[0], cos_bit);
   44|  49.0M|  u[1] = _mm_srai_epi32(v[1], cos_bit);
   45|  49.0M|  u[2] = _mm_srai_epi32(v[2], cos_bit);
   46|  49.0M|  u[3] = _mm_srai_epi32(v[3], cos_bit);
   47|       |
   48|  49.0M|  output[0] = _mm_packs_epi32(u[0], u[1]);
   49|  49.0M|  output[1] = _mm_packs_epi32(u[2], u[3]);
   50|  49.0M|  output[2] = _mm_srli_si128(output[0], 8);
   51|       |  output[3] = _mm_srli_si128(output[1], 8);
   52|  49.0M|}
av1_fwd_txfm_sse2.c:fadst4x4_new_sse2:
 1356|  26.0M|                              int8_t cos_bit) {
 1357|  26.0M|  const int32_t *sinpi = sinpi_arr(cos_bit);
 1358|  26.0M|  const __m128i sinpi_p01_p02 = pair_set_epi16(sinpi[1], sinpi[2]);
  ------------------
  |  |   20|  26.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1359|  26.0M|  const __m128i sinpi_p04_m01 = pair_set_epi16(sinpi[4], -sinpi[1]);
  ------------------
  |  |   20|  26.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1360|  26.0M|  const __m128i sinpi_p03_p04 = pair_set_epi16(sinpi[3], sinpi[4]);
  ------------------
  |  |   20|  26.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1361|  26.0M|  const __m128i sinpi_m03_p02 = pair_set_epi16(-sinpi[3], sinpi[2]);
  ------------------
  |  |   20|  26.0M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1362|  26.0M|  const __m128i sinpi_p03_p03 = _mm_set1_epi16((int16_t)sinpi[3]);
 1363|  26.0M|  const __m128i __zero = _mm_setzero_si128();
 1364|  26.0M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
 1365|  26.0M|  const __m128i in7 = _mm_add_epi16(input[0], input[1]);
 1366|  26.0M|  __m128i u[8], v[8];
 1367|       |
 1368|  26.0M|  u[0] = _mm_unpacklo_epi16(input[0], input[1]);
 1369|  26.0M|  u[1] = _mm_unpacklo_epi16(input[2], input[3]);
 1370|  26.0M|  u[2] = _mm_unpacklo_epi16(in7, __zero);
 1371|  26.0M|  u[3] = _mm_unpacklo_epi16(input[2], __zero);
 1372|  26.0M|  u[4] = _mm_unpacklo_epi16(input[3], __zero);
 1373|       |
 1374|  26.0M|  v[0] = _mm_madd_epi16(u[0], sinpi_p01_p02);  // s0 + s2
 1375|  26.0M|  v[1] = _mm_madd_epi16(u[1], sinpi_p03_p04);  // s4 + s5
 1376|  26.0M|  v[2] = _mm_madd_epi16(u[2], sinpi_p03_p03);  // x1
 1377|  26.0M|  v[3] = _mm_madd_epi16(u[0], sinpi_p04_m01);  // s1 - s3
 1378|  26.0M|  v[4] = _mm_madd_epi16(u[1], sinpi_m03_p02);  // -s4 + s6
 1379|  26.0M|  v[5] = _mm_madd_epi16(u[3], sinpi_p03_p03);  // s4
 1380|  26.0M|  v[6] = _mm_madd_epi16(u[4], sinpi_p03_p03);
 1381|       |
 1382|  26.0M|  u[0] = _mm_add_epi32(v[0], v[1]);
 1383|  26.0M|  u[1] = _mm_sub_epi32(v[2], v[6]);
 1384|  26.0M|  u[2] = _mm_add_epi32(v[3], v[4]);
 1385|  26.0M|  u[3] = _mm_sub_epi32(u[2], u[0]);
 1386|  26.0M|  u[4] = _mm_slli_epi32(v[5], 2);
 1387|  26.0M|  u[5] = _mm_sub_epi32(u[4], v[5]);
 1388|  26.0M|  u[6] = _mm_add_epi32(u[3], u[5]);
 1389|       |
 1390|  26.0M|  v[0] = _mm_add_epi32(u[0], __rounding);
 1391|  26.0M|  v[1] = _mm_add_epi32(u[1], __rounding);
 1392|  26.0M|  v[2] = _mm_add_epi32(u[2], __rounding);
 1393|  26.0M|  v[3] = _mm_add_epi32(u[6], __rounding);
 1394|       |
 1395|  26.0M|  u[0] = _mm_srai_epi32(v[0], cos_bit);
 1396|  26.0M|  u[1] = _mm_srai_epi32(v[1], cos_bit);
 1397|  26.0M|  u[2] = _mm_srai_epi32(v[2], cos_bit);
 1398|  26.0M|  u[3] = _mm_srai_epi32(v[3], cos_bit);
 1399|       |
 1400|  26.0M|  output[0] = _mm_packs_epi32(u[0], u[2]);
 1401|  26.0M|  output[1] = _mm_packs_epi32(u[1], u[3]);
 1402|  26.0M|  output[2] = _mm_srli_si128(output[0], 8);
 1403|       |  output[3] = _mm_srli_si128(output[1], 8);
 1404|  26.0M|}
av1_fwd_txfm_sse2.c:fdct4x8_new_sse2:
   84|  5.79M|                             int8_t cos_bit) {
   85|  5.79M|  const int32_t *cospi = cospi_arr(cos_bit);
   86|  5.79M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
   87|       |
   88|  5.79M|  __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   89|  5.79M|  __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   90|  5.79M|  __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   91|  5.79M|  __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   92|  5.79M|  __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   93|  5.79M|  __m128i cospi_p56_p08 = pair_set_epi16(cospi[56], cospi[8]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   94|  5.79M|  __m128i cospi_m08_p56 = pair_set_epi16(-cospi[8], cospi[56]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   95|  5.79M|  __m128i cospi_p24_p40 = pair_set_epi16(cospi[24], cospi[40]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   96|  5.79M|  __m128i cospi_m40_p24 = pair_set_epi16(-cospi[40], cospi[24]);
  ------------------
  |  |   20|  5.79M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   97|       |
   98|       |  // stage 1
   99|  5.79M|  __m128i x1[8];
  100|  5.79M|  x1[0] = _mm_adds_epi16(input[0], input[7]);
  101|  5.79M|  x1[7] = _mm_subs_epi16(input[0], input[7]);
  102|  5.79M|  x1[1] = _mm_adds_epi16(input[1], input[6]);
  103|  5.79M|  x1[6] = _mm_subs_epi16(input[1], input[6]);
  104|  5.79M|  x1[2] = _mm_adds_epi16(input[2], input[5]);
  105|  5.79M|  x1[5] = _mm_subs_epi16(input[2], input[5]);
  106|  5.79M|  x1[3] = _mm_adds_epi16(input[3], input[4]);
  107|  5.79M|  x1[4] = _mm_subs_epi16(input[3], input[4]);
  108|       |
  109|       |  // stage 2
  110|  5.79M|  __m128i x2[8];
  111|  5.79M|  x2[0] = _mm_adds_epi16(x1[0], x1[3]);
  112|  5.79M|  x2[3] = _mm_subs_epi16(x1[0], x1[3]);
  113|  5.79M|  x2[1] = _mm_adds_epi16(x1[1], x1[2]);
  114|  5.79M|  x2[2] = _mm_subs_epi16(x1[1], x1[2]);
  115|  5.79M|  x2[4] = x1[4];
  116|  5.79M|  btf_16_w4_sse2(&cospi_m32_p32, &cospi_p32_p32, __rounding, cos_bit, &x1[5],
  117|  5.79M|                 &x1[6], &x2[5], &x2[6]);
  118|  5.79M|  x2[7] = x1[7];
  119|       |
  120|       |  // stage 3
  121|  5.79M|  __m128i x3[8];
  122|  5.79M|  btf_16_w4_sse2(&cospi_p32_p32, &cospi_p32_m32, __rounding, cos_bit, &x2[0],
  123|  5.79M|                 &x2[1], &x3[0], &x3[1]);
  124|  5.79M|  btf_16_w4_sse2(&cospi_p48_p16, &cospi_m16_p48, __rounding, cos_bit, &x2[2],
  125|  5.79M|                 &x2[3], &x3[2], &x3[3]);
  126|  5.79M|  x3[4] = _mm_adds_epi16(x2[4], x2[5]);
  127|  5.79M|  x3[5] = _mm_subs_epi16(x2[4], x2[5]);
  128|  5.79M|  x3[6] = _mm_subs_epi16(x2[7], x2[6]);
  129|  5.79M|  x3[7] = _mm_adds_epi16(x2[7], x2[6]);
  130|       |
  131|       |  // stage 4
  132|  5.79M|  __m128i x4[8];
  133|  5.79M|  x4[0] = x3[0];
  134|  5.79M|  x4[1] = x3[1];
  135|  5.79M|  x4[2] = x3[2];
  136|  5.79M|  x4[3] = x3[3];
  137|  5.79M|  btf_16_w4_sse2(&cospi_p56_p08, &cospi_m08_p56, __rounding, cos_bit, &x3[4],
  138|  5.79M|                 &x3[7], &x4[4], &x4[7]);
  139|  5.79M|  btf_16_w4_sse2(&cospi_p24_p40, &cospi_m40_p24, __rounding, cos_bit, &x3[5],
  140|  5.79M|                 &x3[6], &x4[5], &x4[6]);
  141|       |
  142|       |  // stage 5
  143|  5.79M|  output[0] = x4[0];
  144|  5.79M|  output[1] = x4[4];
  145|  5.79M|  output[2] = x4[2];
  146|  5.79M|  output[3] = x4[6];
  147|  5.79M|  output[4] = x4[1];
  148|  5.79M|  output[5] = x4[5];
  149|  5.79M|  output[6] = x4[3];
  150|  5.79M|  output[7] = x4[7];
  151|  5.79M|}
av1_fwd_txfm_sse2.c:fadst4x8_new_sse2:
 1407|  1.50M|                              int8_t cos_bit) {
 1408|  1.50M|  const int32_t *cospi = cospi_arr(cos_bit);
 1409|  1.50M|  const __m128i __zero = _mm_setzero_si128();
 1410|  1.50M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
 1411|       |
 1412|  1.50M|  __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1413|  1.50M|  __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1414|  1.50M|  __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1415|  1.50M|  __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1416|  1.50M|  __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1417|  1.50M|  __m128i cospi_p04_p60 = pair_set_epi16(cospi[4], cospi[60]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1418|  1.50M|  __m128i cospi_p60_m04 = pair_set_epi16(cospi[60], -cospi[4]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1419|  1.50M|  __m128i cospi_p20_p44 = pair_set_epi16(cospi[20], cospi[44]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1420|  1.50M|  __m128i cospi_p44_m20 = pair_set_epi16(cospi[44], -cospi[20]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1421|  1.50M|  __m128i cospi_p36_p28 = pair_set_epi16(cospi[36], cospi[28]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1422|  1.50M|  __m128i cospi_p28_m36 = pair_set_epi16(cospi[28], -cospi[36]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1423|  1.50M|  __m128i cospi_p52_p12 = pair_set_epi16(cospi[52], cospi[12]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1424|  1.50M|  __m128i cospi_p12_m52 = pair_set_epi16(cospi[12], -cospi[52]);
  ------------------
  |  |   20|  1.50M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1425|       |
 1426|       |  // stage 1
 1427|  1.50M|  __m128i x1[8];
 1428|  1.50M|  x1[0] = input[0];
 1429|  1.50M|  x1[1] = _mm_subs_epi16(__zero, input[7]);
 1430|  1.50M|  x1[2] = _mm_subs_epi16(__zero, input[3]);
 1431|  1.50M|  x1[3] = input[4];
 1432|  1.50M|  x1[4] = _mm_subs_epi16(__zero, input[1]);
 1433|  1.50M|  x1[5] = input[6];
 1434|  1.50M|  x1[6] = input[2];
 1435|  1.50M|  x1[7] = _mm_subs_epi16(__zero, input[5]);
 1436|       |
 1437|       |  // stage 2
 1438|  1.50M|  __m128i x2[8];
 1439|  1.50M|  x2[0] = x1[0];
 1440|  1.50M|  x2[1] = x1[1];
 1441|  1.50M|  btf_16_w4_sse2(&cospi_p32_p32, &cospi_p32_m32, __rounding, cos_bit, &x1[2],
 1442|  1.50M|                 &x1[3], &x2[2], &x2[3]);
 1443|  1.50M|  x2[4] = x1[4];
 1444|  1.50M|  x2[5] = x1[5];
 1445|  1.50M|  btf_16_w4_sse2(&cospi_p32_p32, &cospi_p32_m32, __rounding, cos_bit, &x1[6],
 1446|  1.50M|                 &x1[7], &x2[6], &x2[7]);
 1447|       |
 1448|       |  // stage 3
 1449|  1.50M|  __m128i x3[8];
 1450|  1.50M|  x3[0] = _mm_adds_epi16(x2[0], x2[2]);
 1451|  1.50M|  x3[2] = _mm_subs_epi16(x2[0], x2[2]);
 1452|  1.50M|  x3[1] = _mm_adds_epi16(x2[1], x2[3]);
 1453|  1.50M|  x3[3] = _mm_subs_epi16(x2[1], x2[3]);
 1454|  1.50M|  x3[4] = _mm_adds_epi16(x2[4], x2[6]);
 1455|  1.50M|  x3[6] = _mm_subs_epi16(x2[4], x2[6]);
 1456|  1.50M|  x3[5] = _mm_adds_epi16(x2[5], x2[7]);
 1457|  1.50M|  x3[7] = _mm_subs_epi16(x2[5], x2[7]);
 1458|       |
 1459|       |  // stage 4
 1460|  1.50M|  __m128i x4[8];
 1461|  1.50M|  x4[0] = x3[0];
 1462|  1.50M|  x4[1] = x3[1];
 1463|  1.50M|  x4[2] = x3[2];
 1464|  1.50M|  x4[3] = x3[3];
 1465|  1.50M|  btf_16_w4_sse2(&cospi_p16_p48, &cospi_p48_m16, __rounding, cos_bit, &x3[4],
 1466|  1.50M|                 &x3[5], &x4[4], &x4[5]);
 1467|  1.50M|  btf_16_w4_sse2(&cospi_m48_p16, &cospi_p16_p48, __rounding, cos_bit, &x3[6],
 1468|  1.50M|                 &x3[7], &x4[6], &x4[7]);
 1469|       |
 1470|       |  // stage 5
 1471|  1.50M|  __m128i x5[8];
 1472|  1.50M|  x5[0] = _mm_adds_epi16(x4[0], x4[4]);
 1473|  1.50M|  x5[4] = _mm_subs_epi16(x4[0], x4[4]);
 1474|  1.50M|  x5[1] = _mm_adds_epi16(x4[1], x4[5]);
 1475|  1.50M|  x5[5] = _mm_subs_epi16(x4[1], x4[5]);
 1476|  1.50M|  x5[2] = _mm_adds_epi16(x4[2], x4[6]);
 1477|  1.50M|  x5[6] = _mm_subs_epi16(x4[2], x4[6]);
 1478|  1.50M|  x5[3] = _mm_adds_epi16(x4[3], x4[7]);
 1479|  1.50M|  x5[7] = _mm_subs_epi16(x4[3], x4[7]);
 1480|       |
 1481|       |  // stage 6
 1482|  1.50M|  __m128i x6[8];
 1483|  1.50M|  btf_16_w4_sse2(&cospi_p04_p60, &cospi_p60_m04, __rounding, cos_bit, &x5[0],
 1484|  1.50M|                 &x5[1], &x6[0], &x6[1]);
 1485|  1.50M|  btf_16_w4_sse2(&cospi_p20_p44, &cospi_p44_m20, __rounding, cos_bit, &x5[2],
 1486|  1.50M|                 &x5[3], &x6[2], &x6[3]);
 1487|  1.50M|  btf_16_w4_sse2(&cospi_p36_p28, &cospi_p28_m36, __rounding, cos_bit, &x5[4],
 1488|  1.50M|                 &x5[5], &x6[4], &x6[5]);
 1489|  1.50M|  btf_16_w4_sse2(&cospi_p52_p12, &cospi_p12_m52, __rounding, cos_bit, &x5[6],
 1490|  1.50M|                 &x5[7], &x6[6], &x6[7]);
 1491|       |
 1492|       |  // stage 7
 1493|  1.50M|  output[0] = x6[1];
 1494|  1.50M|  output[1] = x6[6];
 1495|  1.50M|  output[2] = x6[3];
 1496|  1.50M|  output[3] = x6[4];
 1497|  1.50M|  output[4] = x6[5];
 1498|  1.50M|  output[5] = x6[2];
 1499|  1.50M|  output[6] = x6[7];
 1500|  1.50M|  output[7] = x6[0];
 1501|  1.50M|}
av1_fwd_txfm_sse2.c:fdct8x4_new_sse2:
   55|  5.75M|                             int8_t cos_bit) {
   56|  5.75M|  const int32_t *cospi = cospi_arr(cos_bit);
   57|  5.75M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
   58|       |
   59|  5.75M|  __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  5.75M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   60|  5.75M|  __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  5.75M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   61|  5.75M|  __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|  5.75M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   62|  5.75M|  __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|  5.75M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   63|       |
   64|       |  // stage 1
   65|  5.75M|  __m128i x1[4];
   66|  5.75M|  x1[0] = _mm_adds_epi16(input[0], input[3]);
   67|  5.75M|  x1[3] = _mm_subs_epi16(input[0], input[3]);
   68|  5.75M|  x1[1] = _mm_adds_epi16(input[1], input[2]);
   69|  5.75M|  x1[2] = _mm_subs_epi16(input[1], input[2]);
   70|       |
   71|       |  // stage 2
   72|  5.75M|  __m128i x2[4];
   73|  5.75M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x1[0], x1[1], x2[0], x2[1]);
  ------------------
  |  |   61|  5.75M|  do {                                            \
  |  |   62|  5.75M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  5.75M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  5.75M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  5.75M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  5.75M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  5.75M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  5.75M|                                                  \
  |  |   69|  5.75M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  5.75M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  5.75M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  5.75M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  5.75M|                                                  \
  |  |   74|  5.75M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  5.75M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  5.75M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  5.75M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  5.75M|                                                  \
  |  |   79|  5.75M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  5.75M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  5.75M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 5.75M]
  |  |  ------------------
  ------------------
   74|  5.75M|  btf_16_sse2(cospi_p48_p16, cospi_m16_p48, x1[2], x1[3], x2[2], x2[3]);
  ------------------
  |  |   61|  5.75M|  do {                                            \
  |  |   62|  5.75M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  5.75M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  5.75M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  5.75M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  5.75M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  5.75M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  5.75M|                                                  \
  |  |   69|  5.75M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  5.75M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  5.75M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  5.75M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  5.75M|                                                  \
  |  |   74|  5.75M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  5.75M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  5.75M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  5.75M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  5.75M|                                                  \
  |  |   79|  5.75M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  5.75M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  5.75M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 5.75M]
  |  |  ------------------
  ------------------
   75|       |
   76|       |  // stage 3
   77|  5.75M|  output[0] = x2[0];
   78|  5.75M|  output[1] = x2[2];
   79|  5.75M|  output[2] = x2[1];
   80|  5.75M|  output[3] = x2[3];
   81|  5.75M|}
av1_fwd_txfm_sse2.c:fadst8x4_new_sse2:
 1504|  1.57M|                              int8_t cos_bit) {
 1505|  1.57M|  const int32_t *sinpi = sinpi_arr(cos_bit);
 1506|  1.57M|  const __m128i sinpi_p01_p02 = pair_set_epi16(sinpi[1], sinpi[2]);
  ------------------
  |  |   20|  1.57M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1507|  1.57M|  const __m128i sinpi_p04_m01 = pair_set_epi16(sinpi[4], -sinpi[1]);
  ------------------
  |  |   20|  1.57M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1508|  1.57M|  const __m128i sinpi_p03_p04 = pair_set_epi16(sinpi[3], sinpi[4]);
  ------------------
  |  |   20|  1.57M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1509|  1.57M|  const __m128i sinpi_m03_p02 = pair_set_epi16(-sinpi[3], sinpi[2]);
  ------------------
  |  |   20|  1.57M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
 1510|  1.57M|  const __m128i sinpi_p03_p03 = _mm_set1_epi16((int16_t)sinpi[3]);
 1511|  1.57M|  const __m128i __zero = _mm_setzero_si128();
 1512|  1.57M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
 1513|  1.57M|  const __m128i in7 = _mm_add_epi16(input[0], input[1]);
 1514|  1.57M|  __m128i u_lo[8], u_hi[8], v_lo[8], v_hi[8];
 1515|       |
 1516|  1.57M|  u_lo[0] = _mm_unpacklo_epi16(input[0], input[1]);
 1517|  1.57M|  u_hi[0] = _mm_unpackhi_epi16(input[0], input[1]);
 1518|  1.57M|  u_lo[1] = _mm_unpacklo_epi16(input[2], input[3]);
 1519|  1.57M|  u_hi[1] = _mm_unpackhi_epi16(input[2], input[3]);
 1520|  1.57M|  u_lo[2] = _mm_unpacklo_epi16(in7, __zero);
 1521|  1.57M|  u_hi[2] = _mm_unpackhi_epi16(in7, __zero);
 1522|  1.57M|  u_lo[3] = _mm_unpacklo_epi16(input[2], __zero);
 1523|  1.57M|  u_hi[3] = _mm_unpackhi_epi16(input[2], __zero);
 1524|  1.57M|  u_lo[4] = _mm_unpacklo_epi16(input[3], __zero);
 1525|  1.57M|  u_hi[4] = _mm_unpackhi_epi16(input[3], __zero);
 1526|       |
 1527|  1.57M|  v_lo[0] = _mm_madd_epi16(u_lo[0], sinpi_p01_p02);  // s0 + s2
 1528|  1.57M|  v_hi[0] = _mm_madd_epi16(u_hi[0], sinpi_p01_p02);  // s0 + s2
 1529|  1.57M|  v_lo[1] = _mm_madd_epi16(u_lo[1], sinpi_p03_p04);  // s4 + s5
 1530|  1.57M|  v_hi[1] = _mm_madd_epi16(u_hi[1], sinpi_p03_p04);  // s4 + s5
 1531|  1.57M|  v_lo[2] = _mm_madd_epi16(u_lo[2], sinpi_p03_p03);  // x1
 1532|  1.57M|  v_hi[2] = _mm_madd_epi16(u_hi[2], sinpi_p03_p03);  // x1
 1533|  1.57M|  v_lo[3] = _mm_madd_epi16(u_lo[0], sinpi_p04_m01);  // s1 - s3
 1534|  1.57M|  v_hi[3] = _mm_madd_epi16(u_hi[0], sinpi_p04_m01);  // s1 - s3
 1535|  1.57M|  v_lo[4] = _mm_madd_epi16(u_lo[1], sinpi_m03_p02);  // -s4 + s6
 1536|  1.57M|  v_hi[4] = _mm_madd_epi16(u_hi[1], sinpi_m03_p02);  // -s4 + s6
 1537|  1.57M|  v_lo[5] = _mm_madd_epi16(u_lo[3], sinpi_p03_p03);  // s4
 1538|  1.57M|  v_hi[5] = _mm_madd_epi16(u_hi[3], sinpi_p03_p03);  // s4
 1539|  1.57M|  v_lo[6] = _mm_madd_epi16(u_lo[4], sinpi_p03_p03);
 1540|  1.57M|  v_hi[6] = _mm_madd_epi16(u_hi[4], sinpi_p03_p03);
 1541|       |
 1542|  1.57M|  u_lo[0] = _mm_add_epi32(v_lo[0], v_lo[1]);
 1543|  1.57M|  u_hi[0] = _mm_add_epi32(v_hi[0], v_hi[1]);
 1544|  1.57M|  u_lo[1] = _mm_sub_epi32(v_lo[2], v_lo[6]);
 1545|  1.57M|  u_hi[1] = _mm_sub_epi32(v_hi[2], v_hi[6]);
 1546|  1.57M|  u_lo[2] = _mm_add_epi32(v_lo[3], v_lo[4]);
 1547|  1.57M|  u_hi[2] = _mm_add_epi32(v_hi[3], v_hi[4]);
 1548|  1.57M|  u_lo[3] = _mm_sub_epi32(u_lo[2], u_lo[0]);
 1549|  1.57M|  u_hi[3] = _mm_sub_epi32(u_hi[2], u_hi[0]);
 1550|  1.57M|  u_lo[4] = _mm_slli_epi32(v_lo[5], 2);
 1551|  1.57M|  u_hi[4] = _mm_slli_epi32(v_hi[5], 2);
 1552|  1.57M|  u_lo[5] = _mm_sub_epi32(u_lo[4], v_lo[5]);
 1553|  1.57M|  u_hi[5] = _mm_sub_epi32(u_hi[4], v_hi[5]);
 1554|  1.57M|  u_lo[6] = _mm_add_epi32(u_lo[3], u_lo[5]);
 1555|  1.57M|  u_hi[6] = _mm_add_epi32(u_hi[3], u_hi[5]);
 1556|       |
 1557|  1.57M|  v_lo[0] = _mm_add_epi32(u_lo[0], __rounding);
 1558|  1.57M|  v_hi[0] = _mm_add_epi32(u_hi[0], __rounding);
 1559|  1.57M|  v_lo[1] = _mm_add_epi32(u_lo[1], __rounding);
 1560|  1.57M|  v_hi[1] = _mm_add_epi32(u_hi[1], __rounding);
 1561|  1.57M|  v_lo[2] = _mm_add_epi32(u_lo[2], __rounding);
 1562|  1.57M|  v_hi[2] = _mm_add_epi32(u_hi[2], __rounding);
 1563|  1.57M|  v_lo[3] = _mm_add_epi32(u_lo[6], __rounding);
 1564|  1.57M|  v_hi[3] = _mm_add_epi32(u_hi[6], __rounding);
 1565|       |
 1566|  1.57M|  u_lo[0] = _mm_srai_epi32(v_lo[0], cos_bit);
 1567|  1.57M|  u_hi[0] = _mm_srai_epi32(v_hi[0], cos_bit);
 1568|  1.57M|  u_lo[1] = _mm_srai_epi32(v_lo[1], cos_bit);
 1569|  1.57M|  u_hi[1] = _mm_srai_epi32(v_hi[1], cos_bit);
 1570|  1.57M|  u_lo[2] = _mm_srai_epi32(v_lo[2], cos_bit);
 1571|  1.57M|  u_hi[2] = _mm_srai_epi32(v_hi[2], cos_bit);
 1572|  1.57M|  u_lo[3] = _mm_srai_epi32(v_lo[3], cos_bit);
 1573|  1.57M|  u_hi[3] = _mm_srai_epi32(v_hi[3], cos_bit);
 1574|       |
 1575|  1.57M|  output[0] = _mm_packs_epi32(u_lo[0], u_hi[0]);
 1576|  1.57M|  output[1] = _mm_packs_epi32(u_lo[1], u_hi[1]);
 1577|  1.57M|  output[2] = _mm_packs_epi32(u_lo[2], u_hi[2]);
 1578|  1.57M|  output[3] = _mm_packs_epi32(u_lo[3], u_hi[3]);
 1579|  1.57M|}

av1_fwd_txfm2d_avx2.c:fdct8x8_new_sse2:
   75|  51.9M|                                    int8_t cos_bit) {
   76|  51.9M|  const int32_t *cospi = cospi_arr(cos_bit);
   77|  51.9M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
   78|       |
   79|  51.9M|  const __m128i cospi_m32_p32 = pair_set_epi16(-cospi[32], cospi[32]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   80|  51.9M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   81|  51.9M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   82|  51.9M|  const __m128i cospi_p48_p16 = pair_set_epi16(cospi[48], cospi[16]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   83|  51.9M|  const __m128i cospi_m16_p48 = pair_set_epi16(-cospi[16], cospi[48]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   84|  51.9M|  const __m128i cospi_p56_p08 = pair_set_epi16(cospi[56], cospi[8]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   85|  51.9M|  const __m128i cospi_m08_p56 = pair_set_epi16(-cospi[8], cospi[56]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   86|  51.9M|  const __m128i cospi_p24_p40 = pair_set_epi16(cospi[24], cospi[40]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   87|  51.9M|  const __m128i cospi_m40_p24 = pair_set_epi16(-cospi[40], cospi[24]);
  ------------------
  |  |   20|  51.9M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
   88|       |
   89|       |  // stage 1
   90|  51.9M|  __m128i x1[8];
   91|  51.9M|  x1[0] = _mm_adds_epi16(input[0], input[7]);
   92|  51.9M|  x1[7] = _mm_subs_epi16(input[0], input[7]);
   93|  51.9M|  x1[1] = _mm_adds_epi16(input[1], input[6]);
   94|  51.9M|  x1[6] = _mm_subs_epi16(input[1], input[6]);
   95|  51.9M|  x1[2] = _mm_adds_epi16(input[2], input[5]);
   96|  51.9M|  x1[5] = _mm_subs_epi16(input[2], input[5]);
   97|  51.9M|  x1[3] = _mm_adds_epi16(input[3], input[4]);
   98|  51.9M|  x1[4] = _mm_subs_epi16(input[3], input[4]);
   99|       |
  100|       |  // stage 2
  101|  51.9M|  __m128i x2[8];
  102|  51.9M|  x2[0] = _mm_adds_epi16(x1[0], x1[3]);
  103|  51.9M|  x2[3] = _mm_subs_epi16(x1[0], x1[3]);
  104|  51.9M|  x2[1] = _mm_adds_epi16(x1[1], x1[2]);
  105|  51.9M|  x2[2] = _mm_subs_epi16(x1[1], x1[2]);
  106|  51.9M|  x2[4] = x1[4];
  107|  51.9M|  btf_16_sse2(cospi_m32_p32, cospi_p32_p32, x1[5], x1[6], x2[5], x2[6]);
  ------------------
  |  |   61|  51.9M|  do {                                            \
  |  |   62|  51.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  51.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  51.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  51.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  51.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  51.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  51.9M|                                                  \
  |  |   69|  51.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  51.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  51.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  51.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  51.9M|                                                  \
  |  |   74|  51.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  51.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  51.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  51.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  51.9M|                                                  \
  |  |   79|  51.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  51.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  51.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 51.9M]
  |  |  ------------------
  ------------------
  108|  51.9M|  x2[7] = x1[7];
  109|       |
  110|       |  // stage 3
  111|  51.9M|  __m128i x3[8];
  112|  51.9M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x2[0], x2[1], x3[0], x3[1]);
  ------------------
  |  |   61|  51.9M|  do {                                            \
  |  |   62|  51.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  51.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  51.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  51.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  51.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  51.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  51.9M|                                                  \
  |  |   69|  51.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  51.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  51.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  51.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  51.9M|                                                  \
  |  |   74|  51.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  51.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  51.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  51.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  51.9M|                                                  \
  |  |   79|  51.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  51.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  51.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 51.9M]
  |  |  ------------------
  ------------------
  113|  51.9M|  btf_16_sse2(cospi_p48_p16, cospi_m16_p48, x2[2], x2[3], x3[2], x3[3]);
  ------------------
  |  |   61|  51.9M|  do {                                            \
  |  |   62|  51.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  51.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  51.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  51.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  51.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  51.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  51.9M|                                                  \
  |  |   69|  51.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  51.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  51.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  51.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  51.9M|                                                  \
  |  |   74|  51.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  51.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  51.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  51.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  51.9M|                                                  \
  |  |   79|  51.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  51.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  51.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 51.9M]
  |  |  ------------------
  ------------------
  114|  51.9M|  x3[4] = _mm_adds_epi16(x2[4], x2[5]);
  115|  51.9M|  x3[5] = _mm_subs_epi16(x2[4], x2[5]);
  116|  51.9M|  x3[6] = _mm_subs_epi16(x2[7], x2[6]);
  117|  51.9M|  x3[7] = _mm_adds_epi16(x2[7], x2[6]);
  118|       |
  119|       |  // stage 4 and 5
  120|  51.9M|  output[0] = x3[0];
  121|  51.9M|  output[4] = x3[1];
  122|  51.9M|  output[2] = x3[2];
  123|  51.9M|  output[6] = x3[3];
  124|  51.9M|  btf_16_sse2(cospi_p56_p08, cospi_m08_p56, x3[4], x3[7], output[1], output[7]);
  ------------------
  |  |   61|  51.9M|  do {                                            \
  |  |   62|  51.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  51.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  51.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  51.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  51.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  51.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  51.9M|                                                  \
  |  |   69|  51.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  51.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  51.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  51.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  51.9M|                                                  \
  |  |   74|  51.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  51.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  51.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  51.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  51.9M|                                                  \
  |  |   79|  51.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  51.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  51.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 51.9M]
  |  |  ------------------
  ------------------
  125|  51.9M|  btf_16_sse2(cospi_p24_p40, cospi_m40_p24, x3[5], x3[6], output[5], output[3]);
  ------------------
  |  |   61|  51.9M|  do {                                            \
  |  |   62|  51.9M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  51.9M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  51.9M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  51.9M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  51.9M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  51.9M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  51.9M|                                                  \
  |  |   69|  51.9M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  51.9M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  51.9M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  51.9M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  51.9M|                                                  \
  |  |   74|  51.9M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  51.9M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  51.9M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  51.9M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  51.9M|                                                  \
  |  |   79|  51.9M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  51.9M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  51.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 51.9M]
  |  |  ------------------
  ------------------
  126|  51.9M|}
av1_fwd_txfm2d_avx2.c:fadst8x8_new_sse2:
  129|  27.2M|                                     int8_t cos_bit) {
  130|  27.2M|  const int32_t *cospi = cospi_arr(cos_bit);
  131|  27.2M|  const __m128i __zero = _mm_setzero_si128();
  132|  27.2M|  const __m128i __rounding = _mm_set1_epi32(1 << (cos_bit - 1));
  133|       |
  134|  27.2M|  const __m128i cospi_p32_p32 = pair_set_epi16(cospi[32], cospi[32]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  135|  27.2M|  const __m128i cospi_p32_m32 = pair_set_epi16(cospi[32], -cospi[32]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  136|  27.2M|  const __m128i cospi_p16_p48 = pair_set_epi16(cospi[16], cospi[48]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  137|  27.2M|  const __m128i cospi_p48_m16 = pair_set_epi16(cospi[48], -cospi[16]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  138|  27.2M|  const __m128i cospi_m48_p16 = pair_set_epi16(-cospi[48], cospi[16]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  139|  27.2M|  const __m128i cospi_p04_p60 = pair_set_epi16(cospi[4], cospi[60]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  140|  27.2M|  const __m128i cospi_p60_m04 = pair_set_epi16(cospi[60], -cospi[4]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  141|  27.2M|  const __m128i cospi_p20_p44 = pair_set_epi16(cospi[20], cospi[44]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  142|  27.2M|  const __m128i cospi_p44_m20 = pair_set_epi16(cospi[44], -cospi[20]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  143|  27.2M|  const __m128i cospi_p36_p28 = pair_set_epi16(cospi[36], cospi[28]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  144|  27.2M|  const __m128i cospi_p28_m36 = pair_set_epi16(cospi[28], -cospi[36]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  145|  27.2M|  const __m128i cospi_p52_p12 = pair_set_epi16(cospi[52], cospi[12]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  146|  27.2M|  const __m128i cospi_p12_m52 = pair_set_epi16(cospi[12], -cospi[52]);
  ------------------
  |  |   20|  27.2M|  _mm_set1_epi32((int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)))
  ------------------
  147|       |
  148|       |  // stage 1
  149|  27.2M|  __m128i x1[8];
  150|  27.2M|  x1[0] = input[0];
  151|  27.2M|  x1[1] = _mm_subs_epi16(__zero, input[7]);
  152|  27.2M|  x1[2] = _mm_subs_epi16(__zero, input[3]);
  153|  27.2M|  x1[3] = input[4];
  154|  27.2M|  x1[4] = _mm_subs_epi16(__zero, input[1]);
  155|  27.2M|  x1[5] = input[6];
  156|  27.2M|  x1[6] = input[2];
  157|  27.2M|  x1[7] = _mm_subs_epi16(__zero, input[5]);
  158|       |
  159|       |  // stage 2
  160|  27.2M|  __m128i x2[8];
  161|  27.2M|  x2[0] = x1[0];
  162|  27.2M|  x2[1] = x1[1];
  163|  27.2M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x1[2], x1[3], x2[2], x2[3]);
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  164|  27.2M|  x2[4] = x1[4];
  165|  27.2M|  x2[5] = x1[5];
  166|  27.2M|  btf_16_sse2(cospi_p32_p32, cospi_p32_m32, x1[6], x1[7], x2[6], x2[7]);
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  167|       |
  168|       |  // stage 3
  169|  27.2M|  __m128i x3[8];
  170|  27.2M|  x3[0] = _mm_adds_epi16(x2[0], x2[2]);
  171|  27.2M|  x3[2] = _mm_subs_epi16(x2[0], x2[2]);
  172|  27.2M|  x3[1] = _mm_adds_epi16(x2[1], x2[3]);
  173|  27.2M|  x3[3] = _mm_subs_epi16(x2[1], x2[3]);
  174|  27.2M|  x3[4] = _mm_adds_epi16(x2[4], x2[6]);
  175|  27.2M|  x3[6] = _mm_subs_epi16(x2[4], x2[6]);
  176|  27.2M|  x3[5] = _mm_adds_epi16(x2[5], x2[7]);
  177|  27.2M|  x3[7] = _mm_subs_epi16(x2[5], x2[7]);
  178|       |
  179|       |  // stage 4
  180|  27.2M|  __m128i x4[8];
  181|  27.2M|  x4[0] = x3[0];
  182|  27.2M|  x4[1] = x3[1];
  183|  27.2M|  x4[2] = x3[2];
  184|  27.2M|  x4[3] = x3[3];
  185|  27.2M|  btf_16_sse2(cospi_p16_p48, cospi_p48_m16, x3[4], x3[5], x4[4], x4[5]);
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  186|  27.2M|  btf_16_sse2(cospi_m48_p16, cospi_p16_p48, x3[6], x3[7], x4[6], x4[7]);
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  187|       |
  188|       |  // stage 5, 6 and 7
  189|  27.2M|  output[7] = _mm_adds_epi16(x4[0], x4[4]);
  190|  27.2M|  output[3] = _mm_subs_epi16(x4[0], x4[4]);
  191|  27.2M|  output[0] = _mm_adds_epi16(x4[1], x4[5]);
  192|  27.2M|  output[4] = _mm_subs_epi16(x4[1], x4[5]);
  193|  27.2M|  output[5] = _mm_adds_epi16(x4[2], x4[6]);
  194|  27.2M|  output[1] = _mm_subs_epi16(x4[2], x4[6]);
  195|  27.2M|  output[2] = _mm_adds_epi16(x4[3], x4[7]);
  196|  27.2M|  output[6] = _mm_subs_epi16(x4[3], x4[7]);
  197|       |
  198|  27.2M|  btf_16_sse2(cospi_p04_p60, cospi_p60_m04, output[7], output[0], output[7],
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  199|  27.2M|              output[0]);
  200|  27.2M|  btf_16_sse2(cospi_p20_p44, cospi_p44_m20, output[5], output[2], output[5],
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  201|  27.2M|              output[2]);
  202|  27.2M|  btf_16_sse2(cospi_p36_p28, cospi_p28_m36, output[3], output[4], output[3],
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  203|  27.2M|              output[4]);
  204|  27.2M|  btf_16_sse2(cospi_p52_p12, cospi_p12_m52, output[1], output[6], output[1],
  ------------------
  |  |   61|  27.2M|  do {                                            \
  |  |   62|  27.2M|    __m128i t0 = _mm_unpacklo_epi16(in0, in1);    \
  |  |   63|  27.2M|    __m128i t1 = _mm_unpackhi_epi16(in0, in1);    \
  |  |   64|  27.2M|    __m128i u0 = _mm_madd_epi16(t0, w0);          \
  |  |   65|  27.2M|    __m128i u1 = _mm_madd_epi16(t1, w0);          \
  |  |   66|  27.2M|    __m128i v0 = _mm_madd_epi16(t0, w1);          \
  |  |   67|  27.2M|    __m128i v1 = _mm_madd_epi16(t1, w1);          \
  |  |   68|  27.2M|                                                  \
  |  |   69|  27.2M|    __m128i a0 = _mm_add_epi32(u0, __rounding);   \
  |  |   70|  27.2M|    __m128i a1 = _mm_add_epi32(u1, __rounding);   \
  |  |   71|  27.2M|    __m128i b0 = _mm_add_epi32(v0, __rounding);   \
  |  |   72|  27.2M|    __m128i b1 = _mm_add_epi32(v1, __rounding);   \
  |  |   73|  27.2M|                                                  \
  |  |   74|  27.2M|    __m128i c0 = _mm_srai_epi32(a0, cos_bit);     \
  |  |   75|  27.2M|    __m128i c1 = _mm_srai_epi32(a1, cos_bit);     \
  |  |   76|  27.2M|    __m128i d0 = _mm_srai_epi32(b0, cos_bit);     \
  |  |   77|  27.2M|    __m128i d1 = _mm_srai_epi32(b1, cos_bit);     \
  |  |   78|  27.2M|                                                  \
  |  |   79|  27.2M|    out0 = _mm_packs_epi32(c0, c1);               \
  |  |   80|  27.2M|    out1 = _mm_packs_epi32(d0, d1);               \
  |  |   81|  27.2M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded, False: 27.2M]
  |  |  ------------------
  ------------------
  205|  27.2M|              output[6]);
  206|  27.2M|}
av1_fwd_txfm2d_avx2.c:fidentity8x8_new_sse2:
   61|  6.08M|                                         int8_t cos_bit) {
   62|  6.08M|  (void)cos_bit;
   63|       |
   64|  6.08M|  output[0] = _mm_adds_epi16(input[0], input[0]);
   65|  6.08M|  output[1] = _mm_adds_epi16(input[1], input[1]);
   66|  6.08M|  output[2] = _mm_adds_epi16(input[2], input[2]);
   67|  6.08M|  output[3] = _mm_adds_epi16(input[3], input[3]);
   68|  6.08M|  output[4] = _mm_adds_epi16(input[4], input[4]);
   69|  6.08M|  output[5] = _mm_adds_epi16(input[5], input[5]);
   70|  6.08M|  output[6] = _mm_adds_epi16(input[6], input[6]);
   71|  6.08M|  output[7] = _mm_adds_epi16(input[7], input[7]);
   72|  6.08M|}
av1_fwd_txfm_sse2.c:fidentity4x4_new_sse2:
   34|  4.40M|                                         const int8_t cos_bit) {
   35|  4.40M|  (void)cos_bit;
   36|  4.40M|  const __m128i one = _mm_set1_epi16(1);
   37|       |
   38|  22.0M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (38:19): [True: 17.6M, False: 4.40M]
  ------------------
   39|  17.6M|    const __m128i a = _mm_unpacklo_epi16(input[i], one);
   40|  17.6M|    const __m128i b = scale_round_sse2(a, NewSqrt2);
   41|  17.6M|    output[i] = _mm_packs_epi32(b, b);
   42|  17.6M|  }
   43|  4.40M|}
av1_fwd_txfm_sse2.c:fidentity8x8_new_sse2:
   61|  44.8k|                                         int8_t cos_bit) {
   62|  44.8k|  (void)cos_bit;
   63|       |
   64|  44.8k|  output[0] = _mm_adds_epi16(input[0], input[0]);
   65|  44.8k|  output[1] = _mm_adds_epi16(input[1], input[1]);
   66|  44.8k|  output[2] = _mm_adds_epi16(input[2], input[2]);
   67|  44.8k|  output[3] = _mm_adds_epi16(input[3], input[3]);
   68|  44.8k|  output[4] = _mm_adds_epi16(input[4], input[4]);
   69|  44.8k|  output[5] = _mm_adds_epi16(input[5], input[5]);
   70|  44.8k|  output[6] = _mm_adds_epi16(input[6], input[6]);
   71|  44.8k|  output[7] = _mm_adds_epi16(input[7], input[7]);
   72|  44.8k|}
av1_fwd_txfm_sse2.c:fidentity8x4_new_sse2:
   47|  16.4k|                                         const int8_t cos_bit) {
   48|  16.4k|  (void)cos_bit;
   49|  16.4k|  const __m128i one = _mm_set1_epi16(1);
   50|       |
   51|  82.1k|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (51:19): [True: 65.7k, False: 16.4k]
  ------------------
   52|  65.7k|    const __m128i a_lo = _mm_unpacklo_epi16(input[i], one);
   53|  65.7k|    const __m128i a_hi = _mm_unpackhi_epi16(input[i], one);
   54|  65.7k|    const __m128i b_lo = scale_round_sse2(a_lo, NewSqrt2);
   55|  65.7k|    const __m128i b_hi = scale_round_sse2(a_hi, NewSqrt2);
   56|  65.7k|    output[i] = _mm_packs_epi32(b_lo, b_hi);
   57|  65.7k|  }
   58|  16.4k|}

av1_highbd_quantize_fp_avx2:
   95|  6.56M|    const int16_t *scan, const int16_t *iscan, int log_scale) {
   96|  6.56M|  (void)scan;
   97|  6.56M|  (void)zbin_ptr;
   98|  6.56M|  (void)quant_shift_ptr;
   99|  6.56M|  const unsigned int step = 8;
  100|  6.56M|  __m256i qp[3], coeff;
  101|       |
  102|  6.56M|  init_qp(round_ptr, quant_ptr, dequant_ptr, log_scale, qp);
  103|  6.56M|  coeff = _mm256_loadu_si256((const __m256i *)coeff_ptr);
  104|       |
  105|  6.56M|  __m256i eob = _mm256_setzero_si256();
  106|  6.56M|  quantize(qp, &coeff, iscan, log_scale, qcoeff_ptr, dqcoeff_ptr, &eob);
  107|       |
  108|  6.56M|  coeff_ptr += step;
  109|  6.56M|  qcoeff_ptr += step;
  110|  6.56M|  dqcoeff_ptr += step;
  111|  6.56M|  iscan += step;
  112|  6.56M|  n_coeffs -= step;
  113|       |
  114|  6.56M|  update_qp(qp);
  115|  28.2M|  while (n_coeffs > 0) {
  ------------------
  |  Branch (115:10): [True: 21.6M, False: 6.56M]
  ------------------
  116|  21.6M|    coeff = _mm256_loadu_si256((const __m256i *)coeff_ptr);
  117|  21.6M|    quantize(qp, &coeff, iscan, log_scale, qcoeff_ptr, dqcoeff_ptr, &eob);
  118|       |
  119|  21.6M|    coeff_ptr += step;
  120|  21.6M|    qcoeff_ptr += step;
  121|  21.6M|    dqcoeff_ptr += step;
  122|  21.6M|    iscan += step;
  123|  21.6M|    n_coeffs -= step;
  124|  21.6M|  }
  125|  6.56M|  {
  126|  6.56M|    __m256i eob_s;
  127|  6.56M|    eob_s = _mm256_shuffle_epi32(eob, 0xe);
  128|  6.56M|    eob = _mm256_max_epi16(eob, eob_s);
  129|  6.56M|    eob_s = _mm256_shufflelo_epi16(eob, 0xe);
  130|  6.56M|    eob = _mm256_max_epi16(eob, eob_s);
  131|  6.56M|    eob_s = _mm256_shufflelo_epi16(eob, 1);
  132|  6.56M|    eob = _mm256_max_epi16(eob, eob_s);
  133|  6.56M|    const __m128i final_eob = _mm_max_epi16(_mm256_castsi256_si128(eob),
  134|  6.56M|                                            _mm256_extractf128_si256(eob, 1));
  135|       |    *eob_ptr = _mm_extract_epi16(final_eob, 0);
  136|  6.56M|  }
  137|  6.56M|}
av1_highbd_quantize_avx2.c:init_qp:
   34|  6.56M|                           __m256i *qp) {
   35|  6.56M|  __m128i round = _mm_loadu_si128((const __m128i *)round_ptr);
   36|  6.56M|  if (log_scale) {
  ------------------
  |  Branch (36:7): [True: 20.8k, False: 6.54M]
  ------------------
   37|  20.8k|    const __m128i round_scale = _mm_set1_epi16(1 << (15 - log_scale));
   38|  20.8k|    round = _mm_mulhrs_epi16(round, round_scale);
   39|  20.8k|  }
   40|  6.56M|  const __m128i quant = _mm_loadu_si128((const __m128i *)quant_ptr);
   41|  6.56M|  const __m128i dequant = _mm_loadu_si128((const __m128i *)dequant_ptr);
   42|       |
   43|  6.56M|  init_one_qp(&round, &qp[0]);
   44|  6.56M|  init_one_qp(&quant, &qp[1]);
   45|  6.56M|  init_one_qp(&dequant, &qp[2]);
   46|  6.56M|}
av1_highbd_quantize_avx2.c:init_one_qp:
   19|  19.6M|static inline void init_one_qp(const __m128i *p, __m256i *qp) {
   20|  19.6M|  const __m128i zero = _mm_setzero_si128();
   21|  19.6M|  const __m128i dc = _mm_unpacklo_epi16(*p, zero);
   22|  19.6M|  const __m128i ac = _mm_unpackhi_epi16(*p, zero);
   23|       |  *qp = _mm256_insertf128_si256(_mm256_castsi128_si256(dc), ac, 1);
   24|  19.6M|}
av1_highbd_quantize_avx2.c:quantize:
   51|  28.2M|                            __m256i *eob) {
   52|  28.2M|  const __m256i abs_coeff = _mm256_abs_epi32(*c);
   53|  28.2M|  __m256i q = _mm256_add_epi32(abs_coeff, qp[0]);
   54|       |
   55|  28.2M|  __m256i q_lo = _mm256_mul_epi32(q, qp[1]);
   56|  28.2M|  __m256i q_hi = _mm256_srli_epi64(q, 32);
   57|  28.2M|  const __m256i qp_hi = _mm256_srli_epi64(qp[1], 32);
   58|  28.2M|  q_hi = _mm256_mul_epi32(q_hi, qp_hi);
   59|  28.2M|  q_lo = _mm256_srli_epi64(q_lo, 16 - log_scale);
   60|  28.2M|  q_hi = _mm256_srli_epi64(q_hi, 16 - log_scale);
   61|  28.2M|  q_hi = _mm256_slli_epi64(q_hi, 32);
   62|  28.2M|  q = _mm256_or_si256(q_lo, q_hi);
   63|  28.2M|  const __m256i abs_s = _mm256_slli_epi32(abs_coeff, 1 + log_scale);
   64|  28.2M|  const __m256i mask = _mm256_cmpgt_epi32(qp[2], abs_s);
   65|  28.2M|  q = _mm256_andnot_si256(mask, q);
   66|       |
   67|  28.2M|  __m256i dq = _mm256_mullo_epi32(q, qp[2]);
   68|  28.2M|  dq = _mm256_srai_epi32(dq, log_scale);
   69|  28.2M|  q = _mm256_sign_epi32(q, *c);
   70|  28.2M|  dq = _mm256_sign_epi32(dq, *c);
   71|       |
   72|  28.2M|  _mm256_storeu_si256((__m256i *)qcoeff, q);
   73|  28.2M|  _mm256_storeu_si256((__m256i *)dqcoeff, dq);
   74|       |
   75|  28.2M|  const __m128i isc = _mm_loadu_si128((const __m128i *)iscan_ptr);
   76|  28.2M|  const __m128i zr = _mm_setzero_si128();
   77|  28.2M|  const __m128i lo = _mm_unpacklo_epi16(isc, zr);
   78|  28.2M|  const __m128i hi = _mm_unpackhi_epi16(isc, zr);
   79|  28.2M|  const __m256i iscan =
   80|  28.2M|      _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
   81|       |
   82|  28.2M|  const __m256i zero = _mm256_setzero_si256();
   83|  28.2M|  const __m256i zc = _mm256_cmpeq_epi32(dq, zero);
   84|  28.2M|  const __m256i nz = _mm256_cmpeq_epi32(zc, zero);
   85|  28.2M|  __m256i cur_eob = _mm256_sub_epi32(iscan, nz);
   86|  28.2M|  cur_eob = _mm256_and_si256(cur_eob, nz);
   87|  28.2M|  *eob = _mm256_max_epi32(cur_eob, *eob);
   88|  28.2M|}
av1_highbd_quantize_avx2.c:update_qp:
   26|  6.56M|static inline void update_qp(__m256i *qp) {
   27|  6.56M|  qp[0] = _mm256_permute2x128_si256(qp[0], qp[0], 0x11);
   28|  6.56M|  qp[1] = _mm256_permute2x128_si256(qp[1], qp[1], 0x11);
   29|       |  qp[2] = _mm256_permute2x128_si256(qp[2], qp[2], 0x11);
   30|  6.56M|}

av1_calc_indices_dim1_avx2:
   28|  1.31M|                                int k) {
   29|  1.31M|  const __m256i v_zero = _mm256_setzero_si256();
   30|  1.31M|  __m256i sum = _mm256_setzero_si256();
   31|  1.31M|  __m256i cents[PALETTE_MAX_SIZE];
   32|  7.54M|  for (int j = 0; j < k; ++j) {
  ------------------
  |  Branch (32:19): [True: 6.23M, False: 1.31M]
  ------------------
   33|  6.23M|    cents[j] = _mm256_set1_epi16(centroids[j]);
   34|  6.23M|  }
   35|       |
   36|  6.96M|  for (int i = 0; i < n; i += 16) {
  ------------------
  |  Branch (36:19): [True: 5.65M, False: 1.31M]
  ------------------
   37|  5.65M|    const __m256i in = _mm256_loadu_si256((__m256i *)data);
   38|  5.65M|    __m256i ind = _mm256_setzero_si256();
   39|       |    // Compute the distance to the first centroid.
   40|  5.65M|    __m256i d1 = _mm256_sub_epi16(in, cents[0]);
   41|  5.65M|    __m256i dist_min = _mm256_abs_epi16(d1);
   42|       |
   43|  26.9M|    for (int j = 1; j < k; ++j) {
  ------------------
  |  Branch (43:21): [True: 21.3M, False: 5.65M]
  ------------------
   44|       |      // Compute the distance to the centroid.
   45|  21.3M|      d1 = _mm256_sub_epi16(in, cents[j]);
   46|  21.3M|      const __m256i dist = _mm256_abs_epi16(d1);
   47|       |      // Compare to the minimal one.
   48|  21.3M|      const __m256i cmp = _mm256_cmpgt_epi16(dist_min, dist);
   49|  21.3M|      dist_min = _mm256_min_epi16(dist_min, dist);
   50|  21.3M|      const __m256i ind1 = _mm256_set1_epi16(j);
   51|  21.3M|      ind = _mm256_or_si256(_mm256_andnot_si256(cmp, ind),
   52|  21.3M|                            _mm256_and_si256(cmp, ind1));
   53|  21.3M|    }
   54|       |
   55|  5.65M|    const __m256i p1 = _mm256_packus_epi16(ind, v_zero);
   56|  5.65M|    const __m256i px = _mm256_permute4x64_epi64(p1, 0x58);
   57|  5.65M|    const __m128i d2 = _mm256_extracti128_si256(px, 0);
   58|       |
   59|  5.65M|    _mm_storeu_si128((__m128i *)indices, d2);
   60|       |
   61|  5.65M|    if (total_dist) {
  ------------------
  |  Branch (61:9): [True: 3.47M, False: 2.18M]
  ------------------
   62|       |      // Square, convert to 32 bit and add together.
   63|  3.47M|      dist_min = _mm256_madd_epi16(dist_min, dist_min);
   64|       |      // Convert to 64 bit and add to sum.
   65|  3.47M|      const __m256i dist1 = _mm256_unpacklo_epi32(dist_min, v_zero);
   66|  3.47M|      const __m256i dist2 = _mm256_unpackhi_epi32(dist_min, v_zero);
   67|  3.47M|      sum = _mm256_add_epi64(sum, dist1);
   68|  3.47M|      sum = _mm256_add_epi64(sum, dist2);
   69|  3.47M|    }
   70|       |
   71|  5.65M|    indices += 16;
   72|  5.65M|    data += 16;
   73|  5.65M|  }
   74|  1.31M|  if (total_dist) {
  ------------------
  |  Branch (74:7): [True: 799k, False: 512k]
  ------------------
   75|   799k|    *total_dist = k_means_horizontal_sum_avx2(sum);
   76|   799k|  }
   77|  1.31M|}
av1_calc_indices_dim2_avx2:
   81|  1.81M|                                int k) {
   82|  1.81M|  const __m256i v_zero = _mm256_setzero_si256();
   83|  1.81M|  const __m256i permute = _mm256_set_epi32(0, 0, 0, 0, 5, 1, 4, 0);
   84|  1.81M|  __m256i sum = _mm256_setzero_si256();
   85|  1.81M|  __m256i ind[2];
   86|  1.81M|  __m256i cents[PALETTE_MAX_SIZE];
   87|  10.1M|  for (int j = 0; j < k; ++j) {
  ------------------
  |  Branch (87:19): [True: 8.36M, False: 1.81M]
  ------------------
   88|  8.36M|    const int16_t cx = centroids[2 * j], cy = centroids[2 * j + 1];
   89|  8.36M|    cents[j] = _mm256_set_epi16(cy, cx, cy, cx, cy, cx, cy, cx, cy, cx, cy, cx,
   90|  8.36M|                                cy, cx, cy, cx);
   91|  8.36M|  }
   92|       |
   93|  7.08M|  for (int i = 0; i < n; i += 16) {
  ------------------
  |  Branch (93:19): [True: 5.27M, False: 1.81M]
  ------------------
   94|  15.8M|    for (int l = 0; l < 2; ++l) {
  ------------------
  |  Branch (94:21): [True: 10.5M, False: 5.27M]
  ------------------
   95|  10.5M|      const __m256i in = _mm256_loadu_si256((__m256i *)data);
   96|  10.5M|      ind[l] = _mm256_setzero_si256();
   97|       |      // Compute the distance to the first centroid.
   98|  10.5M|      __m256i d1 = _mm256_sub_epi16(in, cents[0]);
   99|  10.5M|      __m256i dist_min = _mm256_madd_epi16(d1, d1);
  100|       |
  101|  49.3M|      for (int j = 1; j < k; ++j) {
  ------------------
  |  Branch (101:23): [True: 38.8M, False: 10.5M]
  ------------------
  102|       |        // Compute the distance to the centroid.
  103|  38.8M|        d1 = _mm256_sub_epi16(in, cents[j]);
  104|  38.8M|        const __m256i dist = _mm256_madd_epi16(d1, d1);
  105|       |        // Compare to the minimal one.
  106|  38.8M|        const __m256i cmp = _mm256_cmpgt_epi32(dist_min, dist);
  107|  38.8M|        dist_min = _mm256_min_epi32(dist_min, dist);
  108|  38.8M|        const __m256i ind1 = _mm256_set1_epi32(j);
  109|  38.8M|        ind[l] = _mm256_or_si256(_mm256_andnot_si256(cmp, ind[l]),
  110|  38.8M|                                 _mm256_and_si256(cmp, ind1));
  111|  38.8M|      }
  112|  10.5M|      if (total_dist) {
  ------------------
  |  Branch (112:11): [True: 8.58M, False: 1.95M]
  ------------------
  113|       |        // Convert to 64 bit and add to sum.
  114|  8.58M|        const __m256i dist1 = _mm256_unpacklo_epi32(dist_min, v_zero);
  115|  8.58M|        const __m256i dist2 = _mm256_unpackhi_epi32(dist_min, v_zero);
  116|  8.58M|        sum = _mm256_add_epi64(sum, dist1);
  117|  8.58M|        sum = _mm256_add_epi64(sum, dist2);
  118|  8.58M|      }
  119|  10.5M|      data += 16;
  120|  10.5M|    }
  121|       |    // Cast to 8 bit and store.
  122|  5.27M|    const __m256i d2 = _mm256_packus_epi32(ind[0], ind[1]);
  123|  5.27M|    const __m256i d3 = _mm256_packus_epi16(d2, v_zero);
  124|  5.27M|    const __m256i d4 = _mm256_permutevar8x32_epi32(d3, permute);
  125|  5.27M|    const __m128i d5 = _mm256_extracti128_si256(d4, 0);
  126|  5.27M|    _mm_storeu_si128((__m128i *)indices, d5);
  127|  5.27M|    indices += 16;
  128|  5.27M|  }
  129|  1.81M|  if (total_dist) {
  ------------------
  |  Branch (129:7): [True: 1.44M, False: 365k]
  ------------------
  130|  1.44M|    *total_dist = k_means_horizontal_sum_avx2(sum);
  131|  1.44M|  }
  132|  1.81M|}
av1_k_means_avx2.c:k_means_horizontal_sum_avx2:
   16|  2.24M|static int64_t k_means_horizontal_sum_avx2(__m256i a) {
   17|  2.24M|  const __m128i low = _mm256_castsi256_si128(a);
   18|       |  const __m128i high = _mm256_extracti128_si256(a, 1);
   19|  2.24M|  const __m128i sum = _mm_add_epi64(low, high);
   20|  2.24M|  const __m128i sum_high = _mm_unpackhi_epi64(sum, sum);
   21|  2.24M|  int64_t res;
   22|  2.24M|  _mm_storel_epi64((__m128i *)&res, _mm_add_epi64(sum, sum_high));
   23|  2.24M|  return res;
   24|  2.24M|}

av1_quantize_lp_avx2:
  151|  5.76M|                          const int16_t *scan, const int16_t *iscan) {
  152|  5.76M|  (void)scan;
  153|  5.76M|  __m256i eob256 = _mm256_setzero_si256();
  154|       |
  155|       |  // Setup global values.
  156|  5.76M|  __m256i round256 =
  157|  5.76M|      _mm256_castsi128_si256(_mm_load_si128((const __m128i *)round_ptr));
  158|  5.76M|  __m256i quant256 =
  159|  5.76M|      _mm256_castsi128_si256(_mm_load_si128((const __m128i *)quant_ptr));
  160|  5.76M|  __m256i dequant256 =
  161|  5.76M|      _mm256_castsi128_si256(_mm_load_si128((const __m128i *)dequant_ptr));
  162|       |
  163|       |  // Populate upper AC values.
  164|  5.76M|  round256 = _mm256_permute4x64_epi64(round256, 0x54);
  165|  5.76M|  quant256 = _mm256_permute4x64_epi64(quant256, 0x54);
  166|  5.76M|  dequant256 = _mm256_permute4x64_epi64(dequant256, 0x54);
  167|       |
  168|       |  // Process DC and the first 15 AC coeffs.
  169|  5.76M|  quantize_lp_16_first(coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &round256,
  170|  5.76M|                       &quant256, &dequant256, &eob256);
  171|       |
  172|  5.76M|  if (n_coeffs > 16) {
  ------------------
  |  Branch (172:7): [True: 4.80M, False: 961k]
  ------------------
  173|       |    // Overwrite the DC constants with AC constants
  174|  4.80M|    dequant256 = _mm256_permute2x128_si256(dequant256, dequant256, 0x31);
  175|  4.80M|    quant256 = _mm256_permute2x128_si256(quant256, quant256, 0x31);
  176|  4.80M|    round256 = _mm256_permute2x128_si256(round256, round256, 0x31);
  177|       |
  178|       |    // AC only loop.
  179|  24.0M|    for (int idx = 16; idx < n_coeffs; idx += 16) {
  ------------------
  |  Branch (179:24): [True: 19.1M, False: 4.80M]
  ------------------
  180|  19.1M|      quantize_lp_16(coeff_ptr, idx, iscan, qcoeff_ptr, dqcoeff_ptr, &round256,
  181|  19.1M|                     &quant256, &dequant256, &eob256);
  182|  19.1M|    }
  183|  4.80M|  }
  184|       |
  185|  5.76M|  *eob_ptr = accumulate_eob256(eob256);
  186|  5.76M|}
av1_quantize_fp_avx2:
  230|  17.9M|                          const int16_t *scan_ptr, const int16_t *iscan_ptr) {
  231|  17.9M|  (void)scan_ptr;
  232|  17.9M|  (void)zbin_ptr;
  233|  17.9M|  (void)quant_shift_ptr;
  234|       |
  235|  17.9M|  const int log_scale = 0;
  236|  17.9M|  const int step = 16;
  237|  17.9M|  __m256i qp[3], thr;
  238|  17.9M|  __m256i eob = _mm256_setzero_si256();
  239|       |
  240|  17.9M|  init_qp(round_ptr, quant_ptr, dequant_ptr, log_scale, &thr, qp);
  241|       |
  242|  17.9M|  quantize_fp_16(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr, &eob);
  243|       |
  244|  17.9M|  coeff_ptr += step;
  245|  17.9M|  qcoeff_ptr += step;
  246|  17.9M|  dqcoeff_ptr += step;
  247|  17.9M|  iscan_ptr += step;
  248|  17.9M|  n_coeffs -= step;
  249|       |
  250|  17.9M|  update_qp(&thr, qp);
  251|       |
  252|  48.1M|  while (n_coeffs > 0) {
  ------------------
  |  Branch (252:10): [True: 30.1M, False: 17.9M]
  ------------------
  253|  30.1M|    quantize_fp_16(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr,
  254|  30.1M|                   &eob);
  255|       |
  256|  30.1M|    coeff_ptr += step;
  257|  30.1M|    qcoeff_ptr += step;
  258|  30.1M|    dqcoeff_ptr += step;
  259|  30.1M|    iscan_ptr += step;
  260|  30.1M|    n_coeffs -= step;
  261|  30.1M|  }
  262|  17.9M|  *eob_ptr = quant_gather_eob(eob);
  263|  17.9M|}
av1_quantize_fp_32x32_avx2:
  298|  71.6k|    const int16_t *scan_ptr, const int16_t *iscan_ptr) {
  299|  71.6k|  (void)scan_ptr;
  300|  71.6k|  (void)zbin_ptr;
  301|  71.6k|  (void)quant_shift_ptr;
  302|       |
  303|  71.6k|  const int log_scale = 1;
  304|  71.6k|  const unsigned int step = 16;
  305|  71.6k|  __m256i qp[3], thr;
  306|  71.6k|  __m256i eob = _mm256_setzero_si256();
  307|       |
  308|  71.6k|  init_qp(round_ptr, quant_ptr, dequant_ptr, log_scale, &thr, qp);
  309|       |
  310|  71.6k|  quantize_fp_32x32(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr,
  311|  71.6k|                    &eob);
  312|       |
  313|  71.6k|  coeff_ptr += step;
  314|  71.6k|  qcoeff_ptr += step;
  315|  71.6k|  dqcoeff_ptr += step;
  316|  71.6k|  iscan_ptr += step;
  317|  71.6k|  n_coeffs -= step;
  318|       |
  319|  71.6k|  update_qp(&thr, qp);
  320|       |
  321|  3.76M|  while (n_coeffs > 0) {
  ------------------
  |  Branch (321:10): [True: 3.69M, False: 71.6k]
  ------------------
  322|  3.69M|    quantize_fp_32x32(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr,
  323|  3.69M|                      &eob);
  324|       |
  325|  3.69M|    coeff_ptr += step;
  326|  3.69M|    qcoeff_ptr += step;
  327|  3.69M|    dqcoeff_ptr += step;
  328|  3.69M|    iscan_ptr += step;
  329|  3.69M|    n_coeffs -= step;
  330|  3.69M|  }
  331|  71.6k|  *eob_ptr = quant_gather_eob(eob);
  332|  71.6k|}
av1_quantize_fp_64x64_avx2:
  380|  4.69k|    const int16_t *scan_ptr, const int16_t *iscan_ptr) {
  381|  4.69k|  (void)scan_ptr;
  382|  4.69k|  (void)zbin_ptr;
  383|  4.69k|  (void)quant_shift_ptr;
  384|       |
  385|  4.69k|  const int log_scale = 2;
  386|  4.69k|  const unsigned int step = 16;
  387|  4.69k|  __m256i qp[3], thr;
  388|  4.69k|  __m256i eob = _mm256_setzero_si256();
  389|       |
  390|  4.69k|  init_qp(round_ptr, quant_ptr, dequant_ptr, log_scale, &thr, qp);
  391|       |
  392|  4.69k|  quantize_fp_64x64(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr,
  393|  4.69k|                    &eob);
  394|       |
  395|  4.69k|  coeff_ptr += step;
  396|  4.69k|  qcoeff_ptr += step;
  397|  4.69k|  dqcoeff_ptr += step;
  398|  4.69k|  iscan_ptr += step;
  399|  4.69k|  n_coeffs -= step;
  400|       |
  401|  4.69k|  update_qp(&thr, qp);
  402|       |
  403|   300k|  while (n_coeffs > 0) {
  ------------------
  |  Branch (403:10): [True: 295k, False: 4.69k]
  ------------------
  404|   295k|    quantize_fp_64x64(&thr, qp, coeff_ptr, iscan_ptr, qcoeff_ptr, dqcoeff_ptr,
  405|   295k|                      &eob);
  406|       |
  407|   295k|    coeff_ptr += step;
  408|   295k|    qcoeff_ptr += step;
  409|   295k|    dqcoeff_ptr += step;
  410|   295k|    iscan_ptr += step;
  411|   295k|    n_coeffs -= step;
  412|   295k|  }
  413|  4.69k|  *eob_ptr = quant_gather_eob(eob);
  414|  4.69k|}
av1_quantize_avx2.c:quantize_lp_16_first:
  104|  5.76M|    __m256i *dequant256, __m256i *eob) {
  105|  5.76M|  const __m256i coeff = _mm256_loadu_si256((const __m256i *)coeff_ptr);
  106|  5.76M|  const __m256i abs_coeff = _mm256_abs_epi16(coeff);
  107|  5.76M|  const __m256i tmp_rnd = _mm256_adds_epi16(abs_coeff, *round256);
  108|  5.76M|  const __m256i abs_qcoeff = _mm256_mulhi_epi16(tmp_rnd, *quant256);
  109|  5.76M|  const __m256i qcoeff = _mm256_sign_epi16(abs_qcoeff, coeff);
  110|  5.76M|  const __m256i dqcoeff = _mm256_mullo_epi16(qcoeff, *dequant256);
  111|  5.76M|  const __m256i nz_mask =
  112|  5.76M|      _mm256_cmpgt_epi16(abs_qcoeff, _mm256_setzero_si256());
  113|       |
  114|  5.76M|  _mm256_storeu_si256((__m256i *)qcoeff_ptr, qcoeff);
  115|  5.76M|  _mm256_storeu_si256((__m256i *)dqcoeff_ptr, dqcoeff);
  116|       |
  117|  5.76M|  const __m256i iscan = _mm256_loadu_si256((const __m256i *)iscan_ptr);
  118|  5.76M|  const __m256i iscan_plus1 = _mm256_sub_epi16(iscan, nz_mask);
  119|  5.76M|  const __m256i nz_iscan = _mm256_and_si256(iscan_plus1, nz_mask);
  120|  5.76M|  *eob = _mm256_max_epi16(*eob, nz_iscan);
  121|  5.76M|}
av1_quantize_avx2.c:quantize_lp_16:
  126|  19.1M|    __m256i *quant256, __m256i *dequant256, __m256i *eob) {
  127|  19.1M|  const __m256i coeff =
  128|  19.1M|      _mm256_loadu_si256((const __m256i *)(coeff_ptr + n_coeffs));
  129|  19.1M|  const __m256i abs_coeff = _mm256_abs_epi16(coeff);
  130|  19.1M|  const __m256i tmp_rnd = _mm256_adds_epi16(abs_coeff, *round256);
  131|  19.1M|  const __m256i abs_qcoeff = _mm256_mulhi_epi16(tmp_rnd, *quant256);
  132|  19.1M|  const __m256i qcoeff = _mm256_sign_epi16(abs_qcoeff, coeff);
  133|  19.1M|  const __m256i dqcoeff = _mm256_mullo_epi16(qcoeff, *dequant256);
  134|  19.1M|  const __m256i nz_mask =
  135|  19.1M|      _mm256_cmpgt_epi16(abs_qcoeff, _mm256_setzero_si256());
  136|       |
  137|  19.1M|  _mm256_storeu_si256((__m256i *)(qcoeff_ptr + n_coeffs), qcoeff);
  138|  19.1M|  _mm256_storeu_si256((__m256i *)(dqcoeff_ptr + n_coeffs), dqcoeff);
  139|       |
  140|  19.1M|  const __m256i iscan =
  141|  19.1M|      _mm256_loadu_si256((const __m256i *)(iscan_ptr + n_coeffs));
  142|  19.1M|  const __m256i iscan_plus1 = _mm256_sub_epi16(iscan, nz_mask);
  143|  19.1M|  const __m256i nz_iscan = _mm256_and_si256(iscan_plus1, nz_mask);
  144|  19.1M|  *eob = _mm256_max_epi16(*eob, nz_iscan);
  145|  19.1M|}
av1_quantize_avx2.c:accumulate_eob256:
   88|  5.81M|static inline int16_t accumulate_eob256(__m256i eob256) {
   89|  5.81M|  const __m128i eob_lo = _mm256_castsi256_si128(eob256);
   90|  5.81M|  const __m128i eob_hi = _mm256_extractf128_si256(eob256, 1);
   91|  5.81M|  __m128i eob = _mm_max_epi16(eob_lo, eob_hi);
   92|  5.81M|  __m128i eob_shuffled = _mm_shuffle_epi32(eob, 0xe);
   93|  5.81M|  eob = _mm_max_epi16(eob, eob_shuffled);
   94|  5.81M|  eob_shuffled = _mm_shufflelo_epi16(eob, 0xe);
   95|  5.81M|  eob = _mm_max_epi16(eob, eob_shuffled);
   96|  5.81M|  eob_shuffled = _mm_shufflelo_epi16(eob, 0x1);
   97|  5.81M|  eob = _mm_max_epi16(eob, eob_shuffled);
   98|       |  return _mm_extract_epi16(eob, 1);
   99|  5.81M|}
av1_quantize_avx2.c:init_qp:
   32|  18.0M|                           __m256i *thr, __m256i *qp) {
   33|  18.0M|  __m128i round = _mm_loadu_si128((const __m128i *)round_ptr);
   34|  18.0M|  const __m128i quant = _mm_loadu_si128((const __m128i *)quant_ptr);
   35|  18.0M|  const __m128i dequant = _mm_loadu_si128((const __m128i *)dequant_ptr);
   36|       |
   37|  18.0M|  if (log_scale > 0) {
  ------------------
  |  Branch (37:7): [True: 76.3k, False: 17.9M]
  ------------------
   38|  76.3k|    const __m128i rnd = _mm_set1_epi16((int16_t)1 << (log_scale - 1));
   39|  76.3k|    round = _mm_add_epi16(round, rnd);
   40|  76.3k|    round = _mm_srai_epi16(round, log_scale);
   41|  76.3k|  }
   42|       |
   43|  18.0M|  init_one_qp(&round, &qp[0]);
   44|  18.0M|  init_one_qp(&quant, &qp[1]);
   45|       |
   46|  18.0M|  if (log_scale == 1) {
  ------------------
  |  Branch (46:7): [True: 71.6k, False: 17.9M]
  ------------------
   47|  71.6k|    qp[1] = _mm256_slli_epi16(qp[1], log_scale);
   48|  71.6k|  }
   49|       |
   50|  18.0M|  init_one_qp(&dequant, &qp[2]);
   51|  18.0M|  *thr = _mm256_srai_epi16(qp[2], 1 + log_scale);
   52|       |  // Subtracting 1 here eliminates a _mm256_cmpeq_epi16() instruction when
   53|       |  // calculating the zbin mask.
   54|  18.0M|  *thr = _mm256_sub_epi16(*thr, _mm256_set1_epi16(1));
   55|  18.0M|}
av1_quantize_avx2.c:init_one_qp:
   25|  54.1M|static inline void init_one_qp(const __m128i *p, __m256i *qp) {
   26|  54.1M|  const __m128i ac = _mm_unpackhi_epi64(*p, *p);
   27|       |  *qp = _mm256_insertf128_si256(_mm256_castsi128_si256(*p), ac, 1);
   28|  54.1M|}
av1_quantize_avx2.c:quantize_fp_16:
  201|  48.0M|    __m256i *eob) {
  202|  48.0M|  const __m256i coeff = load_coefficients_avx2(coeff_ptr);
  203|  48.0M|  const __m256i abs_coeff = _mm256_abs_epi16(coeff);
  204|  48.0M|  const __m256i mask = _mm256_cmpgt_epi16(abs_coeff, *thr);
  205|  48.0M|  const int nzflag = _mm256_movemask_epi8(mask);
  206|       |
  207|  48.0M|  if (nzflag) {
  ------------------
  |  Branch (207:7): [True: 39.5M, False: 8.46M]
  ------------------
  208|  39.5M|    const __m256i tmp_rnd = _mm256_adds_epi16(abs_coeff, qp[0]);
  209|  39.5M|    const __m256i abs_q = _mm256_mulhi_epi16(tmp_rnd, qp[1]);
  210|  39.5M|    const __m256i q = _mm256_sign_epi16(abs_q, coeff);
  211|  39.5M|    const __m256i dq = _mm256_mullo_epi16(q, qp[2]);
  212|  39.5M|    const __m256i nz_mask = _mm256_cmpgt_epi16(abs_q, _mm256_setzero_si256());
  213|       |
  214|  39.5M|    store_coefficients_avx2(q, qcoeff_ptr);
  215|  39.5M|    store_coefficients_avx2(dq, dqcoeff_ptr);
  216|       |
  217|  39.5M|    *eob = get_max_lane_eob(iscan_ptr, *eob, nz_mask);
  218|  39.5M|  } else {
  219|  8.46M|    write_zero(qcoeff_ptr);
  220|  8.46M|    write_zero(dqcoeff_ptr);
  221|  8.46M|  }
  222|  48.0M|}
av1_quantize_avx2.c:load_coefficients_avx2:
   64|  52.0M|static inline __m256i load_coefficients_avx2(const tran_low_t *coeff_ptr) {
   65|  52.0M|  const __m256i coeff1 = _mm256_load_si256((__m256i *)coeff_ptr);
   66|  52.0M|  const __m256i coeff2 = _mm256_load_si256((__m256i *)(coeff_ptr + 8));
   67|  52.0M|  return _mm256_packs_epi32(coeff1, coeff2);
   68|  52.0M|}
av1_quantize_avx2.c:store_coefficients_avx2:
   71|  84.1M|                                           tran_low_t *coeff_ptr) {
   72|  84.1M|  __m256i coeff_sign = _mm256_srai_epi16(coeff_vals, 15);
   73|  84.1M|  __m256i coeff_vals_lo = _mm256_unpacklo_epi16(coeff_vals, coeff_sign);
   74|  84.1M|  __m256i coeff_vals_hi = _mm256_unpackhi_epi16(coeff_vals, coeff_sign);
   75|  84.1M|  _mm256_store_si256((__m256i *)coeff_ptr, coeff_vals_lo);
   76|  84.1M|  _mm256_store_si256((__m256i *)(coeff_ptr + 8), coeff_vals_hi);
   77|  84.1M|}
av1_quantize_avx2.c:get_max_lane_eob:
  190|  42.0M|                                                 __m256i v_mask) {
  191|  42.0M|  const __m256i v_iscan = _mm256_loadu_si256((const __m256i *)iscan);
  192|       |  const __m256i v_iscan_perm = _mm256_permute4x64_epi64(v_iscan, 0xD8);
  193|  42.0M|  const __m256i v_iscan_plus1 = _mm256_sub_epi16(v_iscan_perm, v_mask);
  194|  42.0M|  const __m256i v_nz_iscan = _mm256_and_si256(v_iscan_plus1, v_mask);
  195|  42.0M|  return _mm256_max_epi16(v_eobmax, v_nz_iscan);
  196|  42.0M|}
av1_quantize_avx2.c:write_zero:
   19|  20.2M|static inline void write_zero(tran_low_t *qcoeff) {
   20|  20.2M|  const __m256i zero = _mm256_setzero_si256();
   21|  20.2M|  _mm256_storeu_si256((__m256i *)qcoeff, zero);
   22|  20.2M|  _mm256_storeu_si256((__m256i *)qcoeff + 1, zero);
   23|  20.2M|}
av1_quantize_avx2.c:update_qp:
   57|  18.0M|static inline void update_qp(__m256i *thr, __m256i *qp) {
   58|  18.0M|  qp[0] = _mm256_permute2x128_si256(qp[0], qp[0], 0x11);
   59|  18.0M|  qp[1] = _mm256_permute2x128_si256(qp[1], qp[1], 0x11);
   60|  18.0M|  qp[2] = _mm256_permute2x128_si256(qp[2], qp[2], 0x11);
   61|       |  *thr = _mm256_permute2x128_si256(*thr, *thr, 0x11);
   62|  18.0M|}
av1_quantize_avx2.c:quant_gather_eob:
   79|  18.0M|static inline uint16_t quant_gather_eob(__m256i eob) {
   80|  18.0M|  const __m128i eob_lo = _mm256_castsi256_si128(eob);
   81|  18.0M|  const __m128i eob_hi = _mm256_extractf128_si256(eob, 1);
   82|  18.0M|  __m128i eob_s = _mm_max_epi16(eob_lo, eob_hi);
   83|  18.0M|  eob_s = _mm_subs_epu16(_mm_set1_epi16(INT16_MAX), eob_s);
   84|  18.0M|  eob_s = _mm_minpos_epu16(eob_s);
   85|  18.0M|  return INT16_MAX - _mm_extract_epi16(eob_s, 0);
   86|  18.0M|}
av1_quantize_avx2.c:quantize_fp_32x32:
  268|  3.76M|    __m256i *eob) {
  269|  3.76M|  const __m256i coeff = load_coefficients_avx2(coeff_ptr);
  270|  3.76M|  const __m256i abs_coeff = _mm256_abs_epi16(coeff);
  271|  3.76M|  const __m256i mask = _mm256_cmpgt_epi16(abs_coeff, *thr);
  272|  3.76M|  const int nzflag = _mm256_movemask_epi8(mask);
  273|       |
  274|  3.76M|  if (nzflag) {
  ------------------
  |  Branch (274:7): [True: 2.32M, False: 1.44M]
  ------------------
  275|  2.32M|    const __m256i tmp_rnd = _mm256_adds_epi16(abs_coeff, qp[0]);
  276|  2.32M|    const __m256i abs_q = _mm256_mulhi_epu16(tmp_rnd, qp[1]);
  277|  2.32M|    const __m256i q = _mm256_sign_epi16(abs_q, coeff);
  278|  2.32M|    const __m256i abs_dq =
  279|  2.32M|        _mm256_srli_epi16(_mm256_mullo_epi16(abs_q, qp[2]), 1);
  280|  2.32M|    const __m256i nz_mask = _mm256_cmpgt_epi16(abs_q, _mm256_setzero_si256());
  281|  2.32M|    const __m256i dq = _mm256_sign_epi16(abs_dq, coeff);
  282|       |
  283|  2.32M|    store_coefficients_avx2(q, qcoeff_ptr);
  284|  2.32M|    store_coefficients_avx2(dq, dqcoeff_ptr);
  285|       |
  286|  2.32M|    *eob = get_max_lane_eob(iscan_ptr, *eob, nz_mask);
  287|  2.32M|  } else {
  288|  1.44M|    write_zero(qcoeff_ptr);
  289|  1.44M|    write_zero(dqcoeff_ptr);
  290|  1.44M|  }
  291|  3.76M|}
av1_quantize_avx2.c:quantize_fp_64x64:
  338|   300k|                                     tran_low_t *dqcoeff_ptr, __m256i *eob) {
  339|   300k|  const __m256i coeff = load_coefficients_avx2(coeff_ptr);
  340|   300k|  const __m256i abs_coeff = _mm256_abs_epi16(coeff);
  341|   300k|  const __m256i mask = _mm256_cmpgt_epi16(abs_coeff, *thr);
  342|   300k|  const int nzflag = _mm256_movemask_epi8(mask);
  343|       |
  344|   300k|  if (nzflag) {
  ------------------
  |  Branch (344:7): [True: 183k, False: 116k]
  ------------------
  345|   183k|    const __m256i tmp_rnd =
  346|   183k|        _mm256_and_si256(_mm256_adds_epi16(abs_coeff, qp[0]), mask);
  347|   183k|    const __m256i qh = _mm256_slli_epi16(_mm256_mulhi_epi16(tmp_rnd, qp[1]), 2);
  348|   183k|    const __m256i ql =
  349|   183k|        _mm256_srli_epi16(_mm256_mullo_epi16(tmp_rnd, qp[1]), 14);
  350|   183k|    const __m256i abs_q = _mm256_or_si256(qh, ql);
  351|   183k|    const __m256i dqh = _mm256_slli_epi16(_mm256_mulhi_epi16(abs_q, qp[2]), 14);
  352|   183k|    const __m256i dql = _mm256_srli_epi16(_mm256_mullo_epi16(abs_q, qp[2]), 2);
  353|   183k|    const __m256i abs_dq = _mm256_or_si256(dqh, dql);
  354|   183k|    const __m256i q = _mm256_sign_epi16(abs_q, coeff);
  355|   183k|    const __m256i dq = _mm256_sign_epi16(abs_dq, coeff);
  356|       |    // Check the signed q/dq value here instead of the absolute value. When
  357|       |    // dequant equals 4, the dequant threshold (*thr) becomes 0 after being
  358|       |    // scaled down by (1 + log_scale). See init_qp(). When *thr is 0 and the
  359|       |    // abs_coeff is 0, the nzflag will be set. As a result, the eob will be
  360|       |    // incorrectly calculated. The psign instruction corrects the error by
  361|       |    // zeroing out q/dq if coeff is zero.
  362|   183k|    const __m256i z_mask = _mm256_cmpeq_epi16(dq, _mm256_setzero_si256());
  363|   183k|    const __m256i nz_mask = _mm256_cmpeq_epi16(z_mask, _mm256_setzero_si256());
  364|       |
  365|   183k|    store_coefficients_avx2(q, qcoeff_ptr);
  366|   183k|    store_coefficients_avx2(dq, dqcoeff_ptr);
  367|       |
  368|   183k|    *eob = get_max_lane_eob(iscan_ptr, *eob, nz_mask);
  369|   183k|  } else {
  370|   116k|    write_zero(qcoeff_ptr);
  371|   116k|    write_zero(dqcoeff_ptr);
  372|   116k|  }
  373|   300k|}

av1_cnn_convolve_no_maxpool_padding_valid_avx2:
  515|  3.90k|    int start_idx, int cstep, int channel_step) {
  516|  3.90k|  if (layer_config->filter_width == 5 && layer_config->filter_height == 5 &&
  ------------------
  |  Branch (516:7): [True: 778, False: 3.12k]
  |  Branch (516:42): [True: 778, False: 0]
  ------------------
  517|    780|      layer_config->skip_width == 4 && layer_config->skip_height == 4) {
  ------------------
  |  Branch (517:7): [True: 779, False: 0]
  |  Branch (517:40): [True: 779, False: 0]
  ------------------
  518|    780|    cnn_convolve_no_maxpool_padding_valid_5x5_avx2(
  519|    780|        input, in_width, in_height, in_stride, layer_config, output, out_stride,
  520|    780|        start_idx, cstep, channel_step);
  521|  3.12k|  } else if (layer_config->filter_width == 2 &&
  ------------------
  |  Branch (521:14): [True: 3.12k, False: 18.4E]
  ------------------
  522|  3.12k|             layer_config->filter_height == 2 &&
  ------------------
  |  Branch (522:14): [True: 3.12k, False: 18.4E]
  ------------------
  523|  3.12k|             layer_config->skip_width == 2 && layer_config->skip_height == 2) {
  ------------------
  |  Branch (523:14): [True: 3.12k, False: 0]
  |  Branch (523:47): [True: 3.12k, False: 0]
  ------------------
  524|  3.12k|    cnn_convolve_no_maxpool_padding_valid_2x2_avx2(
  525|  3.12k|        input, in_width, in_height, in_stride, layer_config, output, out_stride,
  526|  3.12k|        start_idx, cstep, channel_step);
  527|  18.4E|  } else {
  528|  18.4E|    av1_cnn_convolve_no_maxpool_padding_valid_c(
  529|  18.4E|        input, in_width, in_height, in_stride, layer_config, output, out_stride,
  530|  18.4E|        start_idx, cstep, channel_step);
  531|  18.4E|  }
  532|  3.90k|}
cnn_avx2.c:cnn_convolve_no_maxpool_padding_valid_5x5_avx2:
  248|    780|    int start_idx, const int cstep, const int channel_step) {
  249|    780|  const int kFilterWidth = 5;
  250|    780|  const int kFilterHeight = 5;
  251|    780|  const int kSkipWidth = 4;
  252|    780|  const int kSkipHeight = 4;
  253|    780|  assert(layer_config->filter_width == kFilterWidth &&
  254|    780|         layer_config->filter_height == kFilterHeight);
  255|    780|  assert(layer_config->skip_width == kSkipWidth &&
  256|    780|         layer_config->skip_height == kSkipHeight);
  257|       |
  258|       |  // Load shuffle buffers needed for source.
  259|    780|  const __m256i block0_1 =
  260|    780|      _mm256_load_si256((const __m256i *)shuffle_src_layer0[0]);
  261|    780|  const __m256i block1_2 =
  262|    780|      _mm256_load_si256((const __m256i *)shuffle_src_layer0[1]);
  263|       |
  264|       |  // Load shuffle buffers needed for weight.
  265|    780|  const __m256i weight_mask_0 =
  266|    780|      _mm256_load_si256((const __m256i *)shuffle_weight_layer0[0]);
  267|    780|  const __m256i weight_mask_1 =
  268|    780|      _mm256_load_si256((const __m256i *)shuffle_weight_layer0[1]);
  269|       |
  270|       |  // Width needs to be moved to go to next iteration of processing 3 5x5 blocks.
  271|    780|  const int kSkipWidthForNextIter = kSkipWidth * 3;
  272|       |
  273|       |  // Minimum width required to process 3 5x5 blocks at a time.
  274|       |  // min width (for processing 3 5x5 block) = 2*skip_width + filter_width
  275|       |  // Here, skip_width specifies how much width we should move while processing
  276|       |  // next block convolution and filter_width specifies for how many pixels
  277|       |  // filter needs to be applied.
  278|    780|  const int kMinWidthFor3_5x5Blocks = (kSkipWidth * 2) + kFilterWidth;
  279|  16.3k|  for (int i = start_idx; i < layer_config->out_channels; i += channel_step) {
  ------------------
  |  Branch (279:27): [True: 15.5k, False: 780]
  ------------------
  280|  15.5k|    const float out_ch_bias = layer_config->bias[i];
  281|  31.1k|    for (int k = 0; k < layer_config->in_channels; ++k) {
  ------------------
  |  Branch (281:21): [True: 15.5k, False: 15.5k]
  ------------------
  282|  15.5k|      __m256 shuffle_weight[10];
  283|       |
  284|       |      // Weights needed are 5x5, for SIMD purpose made this array as 5x8.
  285|  15.5k|      float weight[5][8] = { { 0 } };
  286|  15.5k|      int off = k * layer_config->out_channels + i;
  287|       |
  288|       |      // In layer 0, the convolution process happens at 5x5.
  289|       |      // The weights needed for 5x5 block are same across the in-channels,
  290|       |      // which is why the load of weights happens once for each in-channel.
  291|  15.5k|      prepare_weights_for_5x5_convolve(layer_config->weights, off, weight,
  292|  15.5k|                                       cstep, shuffle_weight, weight_mask_0,
  293|  15.5k|                                       weight_mask_1);
  294|       |
  295|   260k|      for (int h = 0, u = 0; h < in_height - kFilterHeight + 1;
  ------------------
  |  Branch (295:30): [True: 245k, False: 15.5k]
  ------------------
  296|   245k|           h += kSkipHeight, ++u) {
  297|   245k|        const int out_h = u * out_stride;
  298|   245k|        int v = 0;
  299|   245k|        int w = 0;
  300|   245k|        int rem_width = in_width;
  301|       |        // Processing 3 5x5 blocks at a time, if sufficient width is present.
  302|  1.45M|        while (rem_width >= kMinWidthFor3_5x5Blocks) {
  ------------------
  |  Branch (302:16): [True: 1.20M, False: 245k]
  ------------------
  303|  1.20M|          __m256 load_src_0, load_src_1;
  304|  1.20M|          __m256 accum_src_0 = _mm256_setzero_ps();
  305|  1.20M|          __m256 accum_src_1 = _mm256_setzero_ps();
  306|  1.20M|          const float *input_ptr = &input[k][h * in_stride + w];
  307|  1.20M|          PERFORM_CONVOLVE_FOR_3_5X5_BLOCKS();
  ------------------
  |  |  107|  1.20M|  do {                                                                 \
  |  |  108|  7.20M|    for (int row = 0; row < 5; row++) {                                \
  |  |  ------------------
  |  |  |  Branch (108:23): [True: 5.99M, False: 1.20M]
  |  |  ------------------
  |  |  109|  5.99M|      load_src_0 = _mm256_loadu_ps(input_ptr);                         \
  |  |  110|  5.99M|      load_src_1 = _mm256_loadu_ps(input_ptr + 7);                     \
  |  |  111|  5.99M|      load_src_0 = _mm256_permutevar8x32_ps(load_src_0, block0_1);     \
  |  |  112|  5.99M|      load_src_1 = _mm256_permutevar8x32_ps(load_src_1, block1_2);     \
  |  |  113|  5.99M|      load_src_0 = _mm256_mul_ps(load_src_0, shuffle_weight[0 + row]); \
  |  |  114|  5.99M|      load_src_1 = _mm256_mul_ps(load_src_1, shuffle_weight[5 + row]); \
  |  |  115|  5.99M|      accum_src_0 = _mm256_add_ps(load_src_0, accum_src_0);            \
  |  |  116|  5.99M|      accum_src_1 = _mm256_add_ps(load_src_1, accum_src_1);            \
  |  |  117|  5.99M|      input_ptr += in_stride;                                          \
  |  |  118|  5.99M|    }                                                                  \
  |  |  119|  1.20M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (119:12): [Folded, False: 1.20M]
  |  |  ------------------
  ------------------
  308|       |
  309|       |          // Accumulate across column.
  310|  1.20M|          __m256 accum = _mm256_hadd_ps(accum_src_0, accum_src_1);
  311|  1.20M|          __m128 tmp_reg_0 = _mm256_extractf128_ps(accum_src_0, 1);
  312|  1.20M|          __m128 tmp_reg_1 = _mm256_extractf128_ps(accum_src_1, 1);
  313|       |
  314|  1.20M|          __m128 accum_l = _mm256_castps256_ps128(accum);
  315|  1.20M|          __m128 accum_h = _mm256_extractf128_ps(accum, 1);
  316|       |
  317|  1.20M|          __m128 tmp_reg_2 = _mm_add_ps(accum_l, tmp_reg_0);
  318|  1.20M|          __m128 tmp_reg_3 = _mm_add_ps(tmp_reg_0, accum_h);
  319|  1.20M|          __m128 tmp_reg_4 = _mm_add_ps(tmp_reg_1, accum_h);
  320|       |
  321|       |          // 1st 5x5 block output.
  322|  1.20M|          output[i][out_h + v] =
  323|  1.20M|              out_ch_bias + _mm_cvtss_f32(tmp_reg_2) +
  324|  1.20M|              _mm_cvtss_f32(_mm_shuffle_ps(accum_l, accum_l, 1));
  325|       |
  326|       |          // 2nd 5x5 block output.
  327|  1.20M|          output[i][out_h + v + 1] =
  328|  1.20M|              out_ch_bias +
  329|  1.20M|              _mm_cvtss_f32(_mm_shuffle_ps(tmp_reg_3, tmp_reg_3, 1)) +
  330|  1.20M|              _mm_cvtss_f32(_mm_shuffle_ps(accum_l, accum_l, 2));
  331|       |
  332|       |          // 3rd 5x5 block output.
  333|  1.20M|          output[i][out_h + v + 2] =
  334|  1.20M|              out_ch_bias +
  335|  1.20M|              _mm_cvtss_f32(_mm_shuffle_ps(tmp_reg_4, tmp_reg_4, 2)) +
  336|  1.20M|              _mm_cvtss_f32(_mm_shuffle_ps(accum_l, accum_l, 3));
  337|       |
  338|  1.20M|          v += 3;
  339|  1.20M|          w += kSkipWidthForNextIter;
  340|  1.20M|          rem_width -= kSkipWidthForNextIter;
  341|  1.20M|        }
  342|       |
  343|       |        // Process remaining blocks as single 5x5 block at a time.
  344|   491k|        while (rem_width >= kFilterWidth) {
  ------------------
  |  Branch (344:16): [True: 246k, False: 245k]
  ------------------
  345|   246k|          float last_column_sum = 0;
  346|   246k|          __m128 accum = _mm_setzero_ps();
  347|   246k|          const float *input_ptr = &input[k][h * in_stride + w];
  348|   246k|          PERFORM_CONVOLVE_FOR_1_5X5_BLOCK(shuffle_weight, accum, in_stride);
  ------------------
  |  |  154|   246k|  do {                                                                   \
  |  |  155|   246k|    __m128 load_src[5];                                                  \
  |  |  156|   246k|    load_src[0] = _mm_loadu_ps(input_ptr);                               \
  |  |  157|   246k|    last_column_sum += input_ptr[4] * weight[0][4];                      \
  |  |  158|   246k|    input_ptr += in_stride;                                              \
  |  |  159|   246k|    load_src[1] = _mm_loadu_ps(input_ptr);                               \
  |  |  160|   246k|    last_column_sum += input_ptr[4] * weight[1][4];                      \
  |  |  161|   246k|    input_ptr += in_stride;                                              \
  |  |  162|   246k|    load_src[2] = _mm_loadu_ps(input_ptr);                               \
  |  |  163|   246k|    last_column_sum += input_ptr[4] * weight[2][4];                      \
  |  |  164|   246k|    input_ptr += in_stride;                                              \
  |  |  165|   246k|    load_src[3] = _mm_loadu_ps(input_ptr);                               \
  |  |  166|   246k|    last_column_sum += input_ptr[4] * weight[3][4];                      \
  |  |  167|   246k|    input_ptr += in_stride;                                              \
  |  |  168|   246k|    load_src[4] = _mm_loadu_ps(input_ptr);                               \
  |  |  169|   246k|    last_column_sum += input_ptr[4] * weight[4][4];                      \
  |  |  170|   246k|                                                                         \
  |  |  171|   246k|    load_src[0] = _mm_mul_ps(load_src[0], _mm256_castps256_ps128(w[0])); \
  |  |  172|   246k|    load_src[1] = _mm_mul_ps(load_src[1], _mm256_castps256_ps128(w[1])); \
  |  |  173|   246k|    load_src[2] = _mm_mul_ps(load_src[2], _mm256_castps256_ps128(w[2])); \
  |  |  174|   246k|    load_src[3] = _mm_mul_ps(load_src[3], _mm256_castps256_ps128(w[3])); \
  |  |  175|   246k|    load_src[4] = _mm_mul_ps(load_src[4], _mm256_castps256_ps128(w[4])); \
  |  |  176|   246k|                                                                         \
  |  |  177|   246k|    accum0 = _mm_add_ps(load_src[0], accum0);                            \
  |  |  178|   246k|    load_src[1] = _mm_add_ps(load_src[1], load_src[2]);                  \
  |  |  179|   246k|    load_src[3] = _mm_add_ps(load_src[3], load_src[4]);                  \
  |  |  180|   246k|    load_src[1] = _mm_add_ps(load_src[1], load_src[3]);                  \
  |  |  181|   246k|    accum0 = _mm_add_ps(accum0, load_src[1]);                            \
  |  |  182|   246k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (182:12): [Folded, False: 246k]
  |  |  ------------------
  ------------------
  349|       |
  350|       |          // Accumulate across column.
  351|   246k|          accum = _mm_hadd_ps(accum, accum);
  352|   246k|          output[i][out_h + v] = out_ch_bias + last_column_sum +
  353|   246k|                                 _mm_cvtss_f32(accum) +
  354|   246k|                                 _mm_cvtss_f32(_mm_shuffle_ps(accum, accum, 1));
  355|       |
  356|   246k|          v += 1;
  357|   246k|          w += kSkipWidth;
  358|   246k|          rem_width -= kSkipWidth;
  359|   246k|        }
  360|   245k|      }
  361|  15.5k|    }
  362|  15.5k|  }
  363|    780|}
cnn_avx2.c:prepare_weights_for_5x5_convolve:
   69|  15.5k|    const __m256i weight_mask_1) {
   70|  93.5k|  for (int row = 0; row < 5; ++row) {
  ------------------
  |  Branch (70:21): [True: 77.9k, False: 15.5k]
  ------------------
   71|   467k|    for (int col = 0; col < 5; ++col) {
  ------------------
  |  Branch (71:23): [True: 389k, False: 77.9k]
  ------------------
   72|   389k|      weight[row][col] = layer_config_weights[off];
   73|   389k|      off += cstep;
   74|   389k|    }
   75|  77.9k|  }
   76|  15.5k|  shuffle_weight[0] = _mm256_loadu_ps(weight[0]);
   77|  15.5k|  shuffle_weight[1] = _mm256_loadu_ps(weight[1]);
   78|  15.5k|  shuffle_weight[2] = _mm256_loadu_ps(weight[2]);
   79|  15.5k|  shuffle_weight[3] = _mm256_loadu_ps(weight[3]);
   80|  15.5k|  shuffle_weight[4] = _mm256_loadu_ps(weight[4]);
   81|       |
   82|  15.5k|  shuffle_weight[0] =
   83|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[0], weight_mask_0);
   84|  15.5k|  shuffle_weight[1] =
   85|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[1], weight_mask_0);
   86|  15.5k|  shuffle_weight[2] =
   87|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[2], weight_mask_0);
   88|  15.5k|  shuffle_weight[3] =
   89|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[3], weight_mask_0);
   90|  15.5k|  shuffle_weight[4] =
   91|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[4], weight_mask_0);
   92|  15.5k|  shuffle_weight[5] =
   93|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[0], weight_mask_1);
   94|  15.5k|  shuffle_weight[6] =
   95|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[1], weight_mask_1);
   96|  15.5k|  shuffle_weight[7] =
   97|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[2], weight_mask_1);
   98|  15.5k|  shuffle_weight[8] =
   99|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[3], weight_mask_1);
  100|  15.5k|  shuffle_weight[9] =
  101|  15.5k|      _mm256_permutevar8x32_ps(shuffle_weight[4], weight_mask_1);
  102|  15.5k|}
cnn_avx2.c:cnn_convolve_no_maxpool_padding_valid_2x2_avx2:
  472|  3.12k|    int start_idx, const int cstep, const int channel_step) {
  473|  3.12k|  assert(layer_config->filter_width == 2 && layer_config->filter_height == 2);
  474|  3.12k|  assert(layer_config->skip_width == 2 && layer_config->skip_height == 2);
  475|       |
  476|  3.12k|  if (in_width == 16 && in_height == 16) {
  ------------------
  |  Branch (476:7): [True: 780, False: 2.34k]
  |  Branch (476:25): [True: 781, False: 18.4E]
  ------------------
  477|       |    // This case of in_width and in_height equal to 16 corresponds to layer 1.
  478|       |    // The output size of this layer is 8x8.
  479|    780|    cnn_convolve_no_maxpool_padding_valid_layer1_avx2(
  480|    780|        input, in_stride, layer_config, output, out_stride, start_idx, cstep,
  481|    780|        channel_step);
  482|  2.34k|  } else if (in_width == 8 && in_height == 8) {
  ------------------
  |  Branch (482:14): [True: 780, False: 1.56k]
  |  Branch (482:31): [True: 780, False: 0]
  ------------------
  483|       |    // This case of in_width and in_height equal to 8 corresponds to layer 2.
  484|       |    // The output size of this layer is 4x4.
  485|    780|    cnn_convolve_no_maxpool_padding_valid_layer2_avx2(
  486|    780|        input, in_stride, layer_config, output, out_stride, start_idx, cstep,
  487|    780|        channel_step);
  488|  1.56k|  } else {
  489|       |    // For layer equal to 3 and 4, the input is of size 4x4 and 2x2
  490|       |    // respectively. Implementing SIMD for these cases might not be optimal,
  491|       |    // which is why we call C path for layer >= 3.
  492|  1.56k|    av1_cnn_convolve_no_maxpool_padding_valid_c(
  493|  1.56k|        input, in_width, in_height, in_stride, layer_config, output, out_stride,
  494|  1.56k|        start_idx, cstep, channel_step);
  495|  1.56k|  }
  496|  3.12k|}
cnn_avx2.c:cnn_convolve_no_maxpool_padding_valid_layer1_avx2:
  369|    781|    int start_idx, const int cstep, const int channel_step) {
  370|    781|  __m256i weight_mask[2];
  371|    781|  __m256i shuffle_output_mask;
  372|    781|  load_shuffle_masks_for_2x2_convolve(&shuffle_output_mask, weight_mask);
  373|       |
  374|    781|  const int kInHeight = 16;
  375|    781|  const int kFilterHeight = 2;
  376|    781|  const int kSkipHeight = 2;
  377|  16.3k|  for (int i = start_idx; i < layer_config->out_channels; i += channel_step) {
  ------------------
  |  Branch (377:27): [True: 15.6k, False: 781]
  ------------------
  378|  15.6k|    __m256 bias_reg = _mm256_set1_ps(layer_config->bias[i]);
  379|       |    // out_accum registers are used to store the 2x2 convolve outputs
  380|       |    // (calculated over input block size), which are accumulated across the
  381|       |    // in_channels. As per the design, each iteration of for loop processes 8
  382|       |    // (horizontal) 2x2 blocks and stores in corresponding out_accum register
  383|       |    // (as input size is 16x16, a total of 64 2x2 blocks are present and 8
  384|       |    // out_accum registers are enough to store the outputs).
  385|       |    // Hence for loops corresponding to 'j' and 'h', below, run over the number
  386|       |    // of out_accum registers.
  387|  15.6k|    __m256 out_accum[8];
  388|   140k|    for (int j = 0; j < 8; ++j) out_accum[j] = bias_reg;
  ------------------
  |  Branch (388:21): [True: 124k, False: 15.6k]
  ------------------
  389|   323k|    for (int k = 0; k < layer_config->in_channels; ++k) {
  ------------------
  |  Branch (389:21): [True: 308k, False: 15.6k]
  ------------------
  390|   308k|      __m256 shuffle_weight[2];
  391|   308k|      int off = k * layer_config->out_channels + i;
  392|       |      // In layer 1, the convolution process happens at 2x2.
  393|       |      // The weights needed for 2x2 block are same across the in-channels,
  394|       |      // which is why the load of weights happens once for each in-channel.
  395|   308k|      prepare_weights_for_2x2_convolve(layer_config->weights, off, cstep,
  396|   308k|                                       shuffle_weight, weight_mask);
  397|       |
  398|  2.75M|      for (int h = 0, u = 0; h < kInHeight - kFilterHeight + 1;
  ------------------
  |  Branch (398:30): [True: 2.44M, False: 308k]
  ------------------
  399|  2.44M|           h += kSkipHeight, ++u) {
  400|  2.44M|        const float *input_ptr = &input[k][h * in_stride];
  401|  2.44M|        perform_convolve_for_8h_2x2_blocks(input_ptr, in_stride, shuffle_weight,
  402|  2.44M|                                           &out_accum[u], shuffle_output_mask);
  403|  2.44M|      }
  404|   308k|    }
  405|       |    // Store output of layer 1.
  406|   140k|    for (int j = 0; j < 8; ++j) {
  ------------------
  |  Branch (406:21): [True: 124k, False: 15.6k]
  ------------------
  407|   124k|      _mm256_storeu_ps(&output[i][j * out_stride], out_accum[j]);
  408|   124k|    }
  409|  15.6k|  }
  410|    781|}
cnn_avx2.c:load_shuffle_masks_for_2x2_convolve:
  123|  1.55k|                                                       __m256i *weight_mask) {
  124|       |  // Load shuffle buffer needed to sort the output.
  125|  1.55k|  *output_mask =
  126|  1.55k|      _mm256_load_si256((const __m256i *)shuffle_output_layer_1_and_2);
  127|       |
  128|       |  // Load shuffle buffers needed for weight.
  129|  1.55k|  weight_mask[0] =
  130|  1.55k|      _mm256_load_si256((const __m256i *)shuffle_weight_layer_1_and_2[0]);
  131|  1.55k|  weight_mask[1] =
  132|  1.55k|      _mm256_load_si256((const __m256i *)shuffle_weight_layer_1_and_2[1]);
  133|  1.55k|}
cnn_avx2.c:prepare_weights_for_2x2_convolve:
  139|   613k|    __m256 *shuffle_weight, __m256i *weight_mask) {
  140|       |  // Weights needed for 2x2 block.
  141|   613k|  float weight[4] = { 0 };
  142|  3.06M|  for (int i = 0; i < 4; ++i) {
  ------------------
  |  Branch (142:19): [True: 2.45M, False: 613k]
  ------------------
  143|  2.45M|    weight[i] = layer_config_weights[off];
  144|  2.45M|    off += cstep;
  145|  2.45M|  }
  146|       |
  147|   613k|  const __m256 weight_vec = _mm256_castps128_ps256(_mm_loadu_ps(weight));
  148|   613k|  shuffle_weight[0] = _mm256_permutevar8x32_ps(weight_vec, weight_mask[0]);
  149|   613k|  shuffle_weight[1] = _mm256_permutevar8x32_ps(weight_vec, weight_mask[1]);
  150|   613k|}
cnn_avx2.c:perform_convolve_for_8h_2x2_blocks:
  187|  2.44M|    __m256i shuffle_output_mask) {
  188|  2.44M|  __m256 load_src[4];
  189|       |  // Load input into source registers.
  190|  2.44M|  load_src[0] = _mm256_loadu_ps(input_ptr);
  191|  2.44M|  load_src[1] = _mm256_loadu_ps(input_ptr + 8);
  192|  2.44M|  load_src[2] = _mm256_loadu_ps(input_ptr + in_stride);
  193|  2.44M|  load_src[3] = _mm256_loadu_ps(input_ptr + in_stride + 8);
  194|       |
  195|       |  // Multiply the loaded input with corresponding weights.
  196|  2.44M|  load_src[0] = _mm256_mul_ps(load_src[0], weight[0]);
  197|  2.44M|  load_src[1] = _mm256_mul_ps(load_src[1], weight[0]);
  198|  2.44M|  load_src[2] = _mm256_mul_ps(load_src[2], weight[1]);
  199|  2.44M|  load_src[3] = _mm256_mul_ps(load_src[3], weight[1]);
  200|       |
  201|       |  // Accumulate across 2x2 blocks.
  202|  2.44M|  load_src[0] = _mm256_add_ps(load_src[0], load_src[2]);
  203|  2.44M|  load_src[1] = _mm256_add_ps(load_src[1], load_src[3]);
  204|  2.44M|  load_src[0] = _mm256_hadd_ps(load_src[0], load_src[1]);
  205|       |
  206|       |  // Sort the output in order to store into output buffer.
  207|  2.44M|  load_src[0] = _mm256_permutevar8x32_ps(load_src[0], shuffle_output_mask);
  208|  2.44M|  *out_accum = _mm256_add_ps(*out_accum, load_src[0]);
  209|  2.44M|}
cnn_avx2.c:cnn_convolve_no_maxpool_padding_valid_layer2_avx2:
  416|    780|    int start_idx, const int cstep, const int channel_step) {
  417|    780|  __m256i weight_mask[2];
  418|    780|  __m256i shuffle_output_mask;
  419|    780|  load_shuffle_masks_for_2x2_convolve(&shuffle_output_mask, weight_mask);
  420|       |
  421|    780|  const int kInHeight = 8;
  422|    780|  const int kFilterHeight = 2;
  423|    780|  const int kSkipHeight = 2;
  424|  16.3k|  for (int i = start_idx; i < layer_config->out_channels; i += channel_step) {
  ------------------
  |  Branch (424:27): [True: 15.5k, False: 780]
  ------------------
  425|  15.5k|    __m256 bias_reg = _mm256_set1_ps(layer_config->bias[i]);
  426|       |    // out_accum registers are used to store the 2x2 convolve outputs
  427|       |    // (calculated over input block size), which are accumulated across the
  428|       |    // in_channels. As per the design, each iteration of for loop processes 8
  429|       |    // (4 horizontal x 2 vertical) 2x2 blocks and stores in corresponding
  430|       |    // out_accum register (as input size is 8x8, a total of 16 2x2 blocks are
  431|       |    // present and 2 out_accum registers are enough to store the outputs).
  432|       |    // Hence for loops corresponding to 'j' and 'h', below, run over the number
  433|       |    // of out_accum registers.
  434|  15.5k|    __m256 out_accum[2];
  435|       |
  436|       |    // Height needs to be moved to go to next iteration of processing
  437|       |    // while processing 2 2x2 blocks vertically.
  438|  15.5k|    const int kSkipHeightForNextIter = kSkipHeight * 2;
  439|  46.7k|    for (int j = 0; j < 2; ++j) out_accum[j] = bias_reg;
  ------------------
  |  Branch (439:21): [True: 31.1k, False: 15.5k]
  ------------------
  440|   325k|    for (int k = 0; k < layer_config->in_channels; ++k) {
  ------------------
  |  Branch (440:21): [True: 309k, False: 15.5k]
  ------------------
  441|   309k|      __m256 shuffle_weight[2];
  442|   309k|      int off = k * layer_config->out_channels + i;
  443|       |      // In layer 2, the convolution process happens at 2x2.
  444|       |      // The weights needed for 2x2 block are same across the in-channels,
  445|       |      // which is why the load of weights happens once for each in-channel.
  446|   309k|      prepare_weights_for_2x2_convolve(layer_config->weights, off, cstep,
  447|   309k|                                       shuffle_weight, weight_mask);
  448|       |
  449|   929k|      for (int h = 0, u = 0; h < kInHeight - kFilterHeight + 1;
  ------------------
  |  Branch (449:30): [True: 619k, False: 309k]
  ------------------
  450|   619k|           h += kSkipHeightForNextIter, ++u) {
  451|   619k|        const float *input_ptr = &input[k][h * in_stride];
  452|   619k|        perform_convolve_for_4hx2v_2x2_blocks(input_ptr, in_stride,
  453|   619k|                                              shuffle_weight, &out_accum[u],
  454|   619k|                                              shuffle_output_mask);
  455|   619k|      }
  456|   309k|    }
  457|       |    // Store output of layer 2.
  458|  46.7k|    for (int j = 0; j < 2; ++j) {
  ------------------
  |  Branch (458:21): [True: 31.1k, False: 15.5k]
  ------------------
  459|  31.1k|      _mm256_storeu_ps(&output[i][j * out_stride * 2], out_accum[j]);
  460|  31.1k|    }
  461|  15.5k|  }
  462|    780|}
cnn_avx2.c:perform_convolve_for_4hx2v_2x2_blocks:
  214|   619k|    __m256i shuffle_output_mask) {
  215|   619k|  __m256 load_src[4];
  216|       |  // Load input into source registers.
  217|   619k|  load_src[0] = _mm256_loadu_ps(input_ptr);
  218|   619k|  load_src[1] = _mm256_loadu_ps(input_ptr + in_stride);
  219|   619k|  load_src[2] = _mm256_loadu_ps(input_ptr + (in_stride * 2));
  220|   619k|  load_src[3] = _mm256_loadu_ps(input_ptr + (in_stride * 3));
  221|       |
  222|       |  // Multiply the loaded input with corresponding weights.
  223|   619k|  load_src[0] = _mm256_mul_ps(load_src[0], weight[0]);
  224|   619k|  load_src[1] = _mm256_mul_ps(load_src[1], weight[1]);
  225|   619k|  load_src[2] = _mm256_mul_ps(load_src[2], weight[0]);
  226|   619k|  load_src[3] = _mm256_mul_ps(load_src[3], weight[1]);
  227|       |
  228|       |  // Accumulate across 2x2 blocks.
  229|   619k|  load_src[0] = _mm256_add_ps(load_src[0], load_src[1]);
  230|   619k|  load_src[2] = _mm256_add_ps(load_src[2], load_src[3]);
  231|   619k|  load_src[0] = _mm256_hadd_ps(load_src[0], load_src[2]);
  232|       |
  233|       |  // Sort the output in order to store into output buffer.
  234|   619k|  load_src[0] = _mm256_permutevar8x32_ps(load_src[0], shuffle_output_mask);
  235|   619k|  *out_accum = _mm256_add_ps(*out_accum, load_src[0]);
  236|   619k|}

av1_txb_init_levels_avx2:
   25|   126M|                              const int height, uint8_t *const levels) {
   26|   126M|  const int stride = height + TX_PAD_HOR;
  ------------------
  |  |  190|   126M|#define TX_PAD_HOR 4
  ------------------
   27|   126M|  const __m256i y_zeros = _mm256_setzero_si256();
   28|       |
   29|   126M|  const int32_t bottom_len = sizeof(*levels) * (TX_PAD_BOTTOM * stride);
  ------------------
  |  |  194|   126M|#define TX_PAD_BOTTOM 4
  ------------------
   30|   126M|  uint8_t *bottom_buf_end = levels + (width + TX_PAD_BOTTOM) * stride;
  ------------------
  |  |  194|   126M|#define TX_PAD_BOTTOM 4
  ------------------
   31|   126M|  uint8_t *bottom_buf = bottom_buf_end - ((bottom_len + 31) & (~31));
   32|       |
   33|   191M|  do {
   34|   191M|    yy_storeu_256(bottom_buf, y_zeros);
   35|   191M|    bottom_buf += 32;
   36|   191M|  } while (bottom_buf < bottom_buf_end);
  ------------------
  |  Branch (36:12): [True: 65.5M, False: 126M]
  ------------------
   37|       |
   38|   126M|  int i = 0;
   39|   126M|  uint8_t *ls = levels;
   40|   126M|  const tran_low_t *cf = coeff;
   41|   126M|  if (height == 4) {
  ------------------
  |  Branch (41:7): [True: 65.6M, False: 60.4M]
  ------------------
   42|  68.3M|    do {
   43|  68.3M|      const __m256i c0 = yy_loadu_256(cf);
   44|  68.3M|      const __m256i c1 = yy_loadu_256(cf + 8);
   45|  68.3M|      const __m256i abs01 = _mm256_abs_epi16(_mm256_packs_epi32(c0, c1));
   46|  68.3M|      const __m256i abs01_8 = _mm256_packs_epi16(abs01, y_zeros);
   47|  68.3M|      const __m256i res_ = _mm256_shuffle_epi32(abs01_8, 0xd8);
   48|  68.3M|      const __m256i res = _mm256_permute4x64_epi64(res_, 0xd8);
   49|  68.3M|      yy_storeu_256(ls, res);
   50|  68.3M|      ls += 32;
   51|  68.3M|      cf += 16;
   52|  68.3M|      i += 4;
   53|  68.3M|    } while (i < width);
  ------------------
  |  Branch (53:14): [True: 2.70M, False: 65.6M]
  ------------------
   54|  65.6M|  } else if (height == 8) {
  ------------------
  |  Branch (54:14): [True: 57.6M, False: 2.80M]
  ------------------
   55|   110M|    do {
   56|   110M|      const __m256i coeffA = yy_loadu_256(cf);
   57|   110M|      const __m256i coeffB = yy_loadu_256(cf + 8);
   58|   110M|      const __m256i coeffC = yy_loadu_256(cf + 16);
   59|   110M|      const __m256i coeffD = yy_loadu_256(cf + 24);
   60|   110M|      const __m256i coeffAB = _mm256_packs_epi32(coeffA, coeffB);
   61|   110M|      const __m256i coeffCD = _mm256_packs_epi32(coeffC, coeffD);
   62|   110M|      const __m256i absAB = _mm256_abs_epi16(coeffAB);
   63|   110M|      const __m256i absCD = _mm256_abs_epi16(coeffCD);
   64|   110M|      const __m256i absABCD = _mm256_packs_epi16(absAB, absCD);
   65|   110M|      const __m256i res_ = _mm256_permute4x64_epi64(absABCD, 0xd8);
   66|   110M|      const __m256i res = _mm256_shuffle_epi32(res_, 0xd8);
   67|   110M|      const __m128i res0 = _mm256_castsi256_si128(res);
   68|   110M|      const __m128i res1 = _mm256_extracti128_si256(res, 1);
   69|   110M|      xx_storel_64(ls, res0);
   70|   110M|      *(int32_t *)(ls + height) = 0;
   71|   110M|      xx_storel_64(ls + stride, _mm_srli_si128(res0, 8));
   72|   110M|      *(int32_t *)(ls + height + stride) = 0;
   73|   110M|      xx_storel_64(ls + stride * 2, res1);
   74|   110M|      *(int32_t *)(ls + height + stride * 2) = 0;
   75|   110M|      xx_storel_64(ls + stride * 3, _mm_srli_si128(res1, 8));
   76|   110M|      *(int32_t *)(ls + height + stride * 3) = 0;
   77|   110M|      cf += 32;
   78|   110M|      ls += stride << 2;
   79|   110M|      i += 4;
   80|   110M|    } while (i < width);
  ------------------
  |  Branch (80:14): [True: 52.8M, False: 57.6M]
  ------------------
   81|  57.6M|  } else if (height == 16) {
  ------------------
  |  Branch (81:14): [True: 3.34M, False: 18.4E]
  ------------------
   82|  21.2M|    do {
   83|  21.2M|      const __m256i coeffA = yy_loadu_256(cf);
   84|  21.2M|      const __m256i coeffB = yy_loadu_256(cf + 8);
   85|  21.2M|      const __m256i coeffC = yy_loadu_256(cf + 16);
   86|  21.2M|      const __m256i coeffD = yy_loadu_256(cf + 24);
   87|  21.2M|      const __m256i coeffAB = _mm256_packs_epi32(coeffA, coeffB);
   88|  21.2M|      const __m256i coeffCD = _mm256_packs_epi32(coeffC, coeffD);
   89|  21.2M|      const __m256i absAB = _mm256_abs_epi16(coeffAB);
   90|  21.2M|      const __m256i absCD = _mm256_abs_epi16(coeffCD);
   91|  21.2M|      const __m256i absABCD = _mm256_packs_epi16(absAB, absCD);
   92|  21.2M|      const __m256i res_ = _mm256_permute4x64_epi64(absABCD, 0xd8);
   93|  21.2M|      const __m256i res = _mm256_shuffle_epi32(res_, 0xd8);
   94|  21.2M|      xx_storeu_128(ls, _mm256_castsi256_si128(res));
   95|  21.2M|      xx_storeu_128(ls + stride, _mm256_extracti128_si256(res, 1));
   96|  21.2M|      cf += 32;
   97|  21.2M|      *(int32_t *)(ls + height) = 0;
   98|  21.2M|      *(int32_t *)(ls + stride + height) = 0;
   99|  21.2M|      ls += stride << 1;
  100|  21.2M|      i += 2;
  101|  21.2M|    } while (i < width);
  ------------------
  |  Branch (101:14): [True: 17.9M, False: 3.34M]
  ------------------
  102|  18.4E|  } else {
  103|  18.4E|    do {
  104|  8.36M|      const __m256i coeffA = yy_loadu_256(cf);
  105|  8.36M|      const __m256i coeffB = yy_loadu_256(cf + 8);
  106|  8.36M|      const __m256i coeffC = yy_loadu_256(cf + 16);
  107|  8.36M|      const __m256i coeffD = yy_loadu_256(cf + 24);
  108|  8.36M|      const __m256i coeffAB = _mm256_packs_epi32(coeffA, coeffB);
  109|  8.36M|      const __m256i coeffCD = _mm256_packs_epi32(coeffC, coeffD);
  110|  8.36M|      const __m256i absAB = _mm256_abs_epi16(coeffAB);
  111|  8.36M|      const __m256i absCD = _mm256_abs_epi16(coeffCD);
  112|  8.36M|      const __m256i absABCD = _mm256_packs_epi16(absAB, absCD);
  113|  8.36M|      const __m256i res_ = _mm256_permute4x64_epi64(absABCD, 0xd8);
  114|  8.36M|      const __m256i res = _mm256_shuffle_epi32(res_, 0xd8);
  115|  8.36M|      yy_storeu_256(ls, res);
  116|  8.36M|      cf += 32;
  117|  8.36M|      *(int32_t *)(ls + height) = 0;
  118|  8.36M|      ls += stride;
  119|  8.36M|      i += 1;
  120|  8.36M|    } while (i < width);
  ------------------
  |  Branch (120:14): [True: 8.91M, False: 18.4E]
  ------------------
  121|  18.4E|  }
  122|   126M|}

av1_get_nz_map_contexts_sse2:
  438|  80.4M|                                  int8_t *const coeff_contexts) {
  439|  80.4M|  const int last_idx = eob - 1;
  440|  80.4M|  if (!last_idx) {
  ------------------
  |  Branch (440:7): [True: 4.77M, False: 75.7M]
  ------------------
  441|  4.77M|    coeff_contexts[0] = 0;
  442|  4.77M|    return;
  443|  4.77M|  }
  444|       |
  445|  75.7M|  const int real_width = tx_size_wide[tx_size];
  446|  75.7M|  const int real_height = tx_size_high[tx_size];
  447|  75.7M|  const int width = get_txb_wide(tx_size);
  448|  75.7M|  const int height = get_txb_high(tx_size);
  449|  75.7M|  const int stride = height + TX_PAD_HOR;
  ------------------
  |  |  190|  75.7M|#define TX_PAD_HOR 4
  ------------------
  450|  75.7M|  ptrdiff_t offsets[3];
  451|       |
  452|       |  /* coeff_contexts must be 16 byte aligned. */
  453|  75.7M|  assert(!((intptr_t)coeff_contexts & 0xf));
  454|       |
  455|  75.7M|  if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (455:7): [True: 67.9M, False: 7.71M]
  ------------------
  456|  67.9M|    offsets[0] = 0 * stride + 2;
  457|  67.9M|    offsets[1] = 1 * stride + 1;
  458|  67.9M|    offsets[2] = 2 * stride + 0;
  459|       |
  460|  67.9M|    if (height == 4) {
  ------------------
  |  Branch (460:9): [True: 30.3M, False: 37.6M]
  ------------------
  461|  30.3M|      get_4_nz_map_contexts_2d(levels, width, offsets, coeff_contexts);
  462|  37.6M|    } else if (height == 8) {
  ------------------
  |  Branch (462:16): [True: 35.6M, False: 1.93M]
  ------------------
  463|  35.6M|      get_8_coeff_contexts_2d(levels, width, offsets, coeff_contexts);
  464|  35.6M|    } else if (height == 16) {
  ------------------
  |  Branch (464:16): [True: 1.94M, False: 18.4E]
  ------------------
  465|  1.94M|      get_16n_coeff_contexts_2d(levels, real_width, real_height, width, height,
  466|  1.94M|                                offsets, coeff_contexts);
  467|  18.4E|    } else {
  468|  18.4E|      get_16n_coeff_contexts_2d(levels, real_width, real_height, width, height,
  469|  18.4E|                                offsets, coeff_contexts);
  470|  18.4E|    }
  471|  67.9M|  } else if (tx_class == TX_CLASS_HORIZ) {
  ------------------
  |  Branch (471:14): [True: 4.93M, False: 2.78M]
  ------------------
  472|  4.93M|    offsets[0] = 2 * stride;
  473|  4.93M|    offsets[1] = 3 * stride;
  474|  4.93M|    offsets[2] = 4 * stride;
  475|  4.93M|    if (height == 4) {
  ------------------
  |  Branch (475:9): [True: 1.81M, False: 3.12M]
  ------------------
  476|  1.81M|      get_4_nz_map_contexts_hor(levels, width, offsets, coeff_contexts);
  477|  3.12M|    } else if (height == 8) {
  ------------------
  |  Branch (477:16): [True: 3.00M, False: 113k]
  ------------------
  478|  3.00M|      get_8_coeff_contexts_hor(levels, width, offsets, coeff_contexts);
  479|  3.00M|    } else {
  480|   113k|      get_16n_coeff_contexts_hor(levels, width, height, offsets,
  481|   113k|                                 coeff_contexts);
  482|   113k|    }
  483|  4.93M|  } else {  // TX_CLASS_VERT
  484|  2.78M|    offsets[0] = 2;
  485|  2.78M|    offsets[1] = 3;
  486|  2.78M|    offsets[2] = 4;
  487|  2.78M|    if (height == 4) {
  ------------------
  |  Branch (487:9): [True: 690k, False: 2.09M]
  ------------------
  488|   690k|      get_4_nz_map_contexts_ver(levels, width, offsets, coeff_contexts);
  489|  2.16M|    } else if (height == 8) {
  ------------------
  |  Branch (489:16): [True: 2.16M, False: 18.4E]
  ------------------
  490|  2.16M|      get_8_coeff_contexts_ver(levels, width, offsets, coeff_contexts);
  491|  18.4E|    } else {
  492|  18.4E|      get_16n_coeff_contexts_ver(levels, width, height, offsets,
  493|  18.4E|                                 coeff_contexts);
  494|  18.4E|    }
  495|  2.78M|  }
  496|       |
  497|  75.7M|  const int bhl = get_txb_bhl(tx_size);
  498|  75.7M|  const int pos = scan[last_idx];
  499|  75.7M|  if (last_idx <= (width << bhl) / 8)
  ------------------
  |  Branch (499:7): [True: 5.26M, False: 70.4M]
  ------------------
  500|  5.26M|    coeff_contexts[pos] = 1;
  501|  70.4M|  else if (last_idx <= (width << bhl) / 4)
  ------------------
  |  Branch (501:12): [True: 3.88M, False: 66.5M]
  ------------------
  502|  3.88M|    coeff_contexts[pos] = 2;
  503|  66.5M|  else
  504|  66.5M|    coeff_contexts[pos] = 3;
  505|  75.7M|}
encodetxb_sse2.c:get_4_nz_map_contexts_2d:
   75|  30.3M|                                            int8_t *const coeff_contexts) {
   76|  30.3M|  const int stride = 4 + TX_PAD_HOR;
  ------------------
  |  |  190|  30.3M|#define TX_PAD_HOR 4
  ------------------
   77|  30.3M|  const __m128i pos_to_offset_large = _mm_set1_epi8(21);
   78|  30.3M|  __m128i pos_to_offset =
   79|  30.3M|      (width == 4)
  ------------------
  |  Branch (79:7): [True: 28.4M, False: 1.91M]
  ------------------
   80|  30.3M|          ? _mm_setr_epi8(0, 1, 6, 6, 1, 6, 6, 21, 6, 6, 21, 21, 6, 21, 21, 21)
   81|  30.3M|          : _mm_setr_epi8(0, 16, 16, 16, 16, 16, 16, 16, 6, 6, 21, 21, 6, 21,
   82|  1.91M|                          21, 21);
   83|  30.3M|  __m128i count;
   84|  30.3M|  __m128i level[5];
   85|  30.3M|  int8_t *cc = coeff_contexts;
   86|  30.3M|  int col = width;
   87|       |
   88|  30.3M|  assert(!(width % 4));
   89|       |
   90|  32.3M|  do {
   91|  32.3M|    load_levels_4x4x5_sse2(levels, stride, offsets, level);
   92|  32.3M|    count = get_coeff_contexts_kernel_sse2(level);
   93|  32.3M|    count = _mm_add_epi8(count, pos_to_offset);
   94|  32.3M|    _mm_store_si128((__m128i *)cc, count);
   95|  32.3M|    pos_to_offset = pos_to_offset_large;
   96|  32.3M|    levels += 4 * stride;
   97|  32.3M|    cc += 16;
   98|  32.3M|    col -= 4;
   99|  32.3M|  } while (col);
  ------------------
  |  Branch (99:12): [True: 1.93M, False: 30.3M]
  ------------------
  100|       |
  101|  30.3M|  coeff_contexts[0] = 0;
  102|  30.3M|}
encodetxb_sse2.c:load_levels_4x4x5_sse2:
   23|  35.0M|                                          __m128i *const level) {
   24|  35.0M|  level[0] = load_8bit_4x4_to_1_reg_sse2(src + 1, stride);
   25|  35.0M|  level[1] = load_8bit_4x4_to_1_reg_sse2(src + stride, stride);
   26|  35.0M|  level[2] = load_8bit_4x4_to_1_reg_sse2(src + offsets[0], stride);
   27|  35.0M|  level[3] = load_8bit_4x4_to_1_reg_sse2(src + offsets[1], stride);
   28|  35.0M|  level[4] = load_8bit_4x4_to_1_reg_sse2(src + offsets[2], stride);
   29|  35.0M|}
encodetxb_sse2.c:get_coeff_contexts_kernel_sse2:
   53|   226M|static inline __m128i get_coeff_contexts_kernel_sse2(__m128i *const level) {
   54|   226M|  const __m128i const_3 = _mm_set1_epi8(3);
   55|   226M|  const __m128i const_4 = _mm_set1_epi8(4);
   56|   226M|  __m128i count;
   57|       |
   58|   226M|  count = _mm_min_epu8(level[0], const_3);
   59|   226M|  level[1] = _mm_min_epu8(level[1], const_3);
   60|   226M|  level[2] = _mm_min_epu8(level[2], const_3);
   61|   226M|  level[3] = _mm_min_epu8(level[3], const_3);
   62|   226M|  level[4] = _mm_min_epu8(level[4], const_3);
   63|   226M|  count = _mm_add_epi8(count, level[1]);
   64|   226M|  count = _mm_add_epi8(count, level[2]);
   65|   226M|  count = _mm_add_epi8(count, level[3]);
   66|   226M|  count = _mm_add_epi8(count, level[4]);
   67|   226M|  count = _mm_avg_epu8(count, _mm_setzero_si128());
   68|   226M|  count = _mm_min_epu8(count, const_4);
   69|   226M|  return count;
   70|   226M|}
encodetxb_sse2.c:get_8_coeff_contexts_2d:
  171|  35.6M|                                           int8_t *coeff_contexts) {
  172|  35.6M|  const int stride = 8 + TX_PAD_HOR;
  ------------------
  |  |  190|  35.6M|#define TX_PAD_HOR 4
  ------------------
  173|  35.6M|  int8_t *cc = coeff_contexts;
  174|  35.6M|  int col = width;
  175|  35.6M|  __m128i count;
  176|  35.6M|  __m128i level[5];
  177|  35.6M|  __m128i pos_to_offset[3];
  178|       |
  179|  35.6M|  assert(!(width % 2));
  180|       |
  181|  35.6M|  if (width == 8) {
  ------------------
  |  Branch (181:7): [True: 29.6M, False: 5.99M]
  ------------------
  182|  29.6M|    pos_to_offset[0] =
  183|  29.6M|        _mm_setr_epi8(0, 1, 6, 6, 21, 21, 21, 21, 1, 6, 6, 21, 21, 21, 21, 21);
  184|  29.6M|    pos_to_offset[1] = _mm_setr_epi8(6, 6, 21, 21, 21, 21, 21, 21, 6, 21, 21,
  185|  29.6M|                                     21, 21, 21, 21, 21);
  186|  29.6M|  } else if (width < 8) {
  ------------------
  |  Branch (186:14): [True: 5.40M, False: 581k]
  ------------------
  187|  5.40M|    pos_to_offset[0] = _mm_setr_epi8(0, 11, 6, 6, 21, 21, 21, 21, 11, 11, 6, 21,
  188|  5.40M|                                     21, 21, 21, 21);
  189|  5.40M|    pos_to_offset[1] = _mm_setr_epi8(11, 11, 21, 21, 21, 21, 21, 21, 11, 11, 21,
  190|  5.40M|                                     21, 21, 21, 21, 21);
  191|  5.40M|  } else {
  192|   581k|    pos_to_offset[0] = _mm_setr_epi8(0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  193|   581k|                                     16, 16, 16, 16, 16);
  194|   581k|    pos_to_offset[1] = _mm_setr_epi8(6, 6, 21, 21, 21, 21, 21, 21, 6, 21, 21,
  195|   581k|                                     21, 21, 21, 21, 21);
  196|   581k|  }
  197|  35.6M|  pos_to_offset[2] = _mm_set1_epi8(21);
  198|       |
  199|   134M|  do {
  200|   134M|    load_levels_8x2x5_sse2(levels, stride, offsets, level);
  201|   134M|    count = get_coeff_contexts_kernel_sse2(level);
  202|   134M|    count = _mm_add_epi8(count, pos_to_offset[0]);
  203|   134M|    _mm_store_si128((__m128i *)cc, count);
  204|   134M|    pos_to_offset[0] = pos_to_offset[1];
  205|   134M|    pos_to_offset[1] = pos_to_offset[2];
  206|   134M|    levels += 2 * stride;
  207|   134M|    cc += 16;
  208|   134M|    col -= 2;
  209|   134M|  } while (col);
  ------------------
  |  Branch (209:12): [True: 98.7M, False: 35.6M]
  ------------------
  210|       |
  211|  35.6M|  coeff_contexts[0] = 0;
  212|  35.6M|}
encodetxb_sse2.c:load_levels_8x2x5_sse2:
   34|   154M|                                          __m128i *const level) {
   35|   154M|  level[0] = load_8bit_8x2_to_1_reg_sse2(src + 1, stride);
   36|   154M|  level[1] = load_8bit_8x2_to_1_reg_sse2(src + stride, stride);
   37|   154M|  level[2] = load_8bit_8x2_to_1_reg_sse2(src + offsets[0], stride);
   38|   154M|  level[3] = load_8bit_8x2_to_1_reg_sse2(src + offsets[1], stride);
   39|   154M|  level[4] = load_8bit_8x2_to_1_reg_sse2(src + offsets[2], stride);
   40|   154M|}
encodetxb_sse2.c:get_16n_coeff_contexts_2d:
  283|  2.13M|                                             int8_t *coeff_contexts) {
  284|  2.13M|  const int stride = height + TX_PAD_HOR;
  ------------------
  |  |  190|  2.13M|#define TX_PAD_HOR 4
  ------------------
  285|  2.13M|  int8_t *cc = coeff_contexts;
  286|  2.13M|  int col = width;
  287|  2.13M|  __m128i pos_to_offset[5];
  288|  2.13M|  __m128i pos_to_offset_large[3];
  289|  2.13M|  __m128i count;
  290|  2.13M|  __m128i level[5];
  291|       |
  292|  2.13M|  assert(!(height % 16));
  293|       |
  294|  2.13M|  pos_to_offset_large[2] = _mm_set1_epi8(21);
  295|  2.13M|  if (real_width == real_height) {
  ------------------
  |  Branch (295:7): [True: 1.23M, False: 899k]
  ------------------
  296|  1.23M|    pos_to_offset[0] = _mm_setr_epi8(0, 1, 6, 6, 21, 21, 21, 21, 21, 21, 21, 21,
  297|  1.23M|                                     21, 21, 21, 21);
  298|  1.23M|    pos_to_offset[1] = _mm_setr_epi8(1, 6, 6, 21, 21, 21, 21, 21, 21, 21, 21,
  299|  1.23M|                                     21, 21, 21, 21, 21);
  300|  1.23M|    pos_to_offset[2] = _mm_setr_epi8(6, 6, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  301|  1.23M|                                     21, 21, 21, 21, 21);
  302|  1.23M|    pos_to_offset[3] = _mm_setr_epi8(6, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  303|  1.23M|                                     21, 21, 21, 21, 21);
  304|  1.23M|    pos_to_offset[4] = pos_to_offset_large[0] = pos_to_offset_large[1] =
  305|  1.23M|        pos_to_offset_large[2];
  306|  1.23M|  } else if (real_width < real_height) {
  ------------------
  |  Branch (306:14): [True: 866k, False: 33.0k]
  ------------------
  307|   866k|    pos_to_offset[0] = _mm_setr_epi8(0, 11, 6, 6, 21, 21, 21, 21, 21, 21, 21,
  308|   866k|                                     21, 21, 21, 21, 21);
  309|   866k|    pos_to_offset[1] = _mm_setr_epi8(11, 11, 6, 21, 21, 21, 21, 21, 21, 21, 21,
  310|   866k|                                     21, 21, 21, 21, 21);
  311|   866k|    pos_to_offset[2] = pos_to_offset[3] = pos_to_offset[4] = _mm_setr_epi8(
  312|   866k|        11, 11, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21);
  313|   866k|    pos_to_offset_large[0] = pos_to_offset_large[1] = pos_to_offset_large[2];
  314|   866k|  } else {  // real_width > real_height
  315|  33.0k|    pos_to_offset[0] = pos_to_offset[1] = _mm_setr_epi8(
  316|  33.0k|        16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
  317|  33.0k|    pos_to_offset[2] = _mm_setr_epi8(6, 6, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  318|  33.0k|                                     21, 21, 21, 21, 21);
  319|  33.0k|    pos_to_offset[3] = _mm_setr_epi8(6, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  320|  33.0k|                                     21, 21, 21, 21, 21);
  321|  33.0k|    pos_to_offset[4] = pos_to_offset_large[2];
  322|  33.0k|    pos_to_offset_large[0] = pos_to_offset_large[1] = _mm_set1_epi8(16);
  323|  33.0k|  }
  324|       |
  325|  30.6M|  do {
  326|  30.6M|    int h = height;
  327|       |
  328|  36.2M|    do {
  329|  36.2M|      load_levels_16x1x5_sse2(levels, stride, offsets, level);
  330|  36.2M|      count = get_coeff_contexts_kernel_sse2(level);
  331|  36.2M|      count = _mm_add_epi8(count, pos_to_offset[0]);
  332|  36.2M|      _mm_store_si128((__m128i *)cc, count);
  333|  36.2M|      levels += 16;
  334|  36.2M|      cc += 16;
  335|  36.2M|      h -= 16;
  336|  36.2M|      pos_to_offset[0] = pos_to_offset_large[0];
  337|  36.2M|    } while (h);
  ------------------
  |  Branch (337:14): [True: 5.60M, False: 30.6M]
  ------------------
  338|       |
  339|  30.6M|    pos_to_offset[0] = pos_to_offset[1];
  340|  30.6M|    pos_to_offset[1] = pos_to_offset[2];
  341|  30.6M|    pos_to_offset[2] = pos_to_offset[3];
  342|  30.6M|    pos_to_offset[3] = pos_to_offset[4];
  343|  30.6M|    pos_to_offset_large[0] = pos_to_offset_large[1];
  344|  30.6M|    pos_to_offset_large[1] = pos_to_offset_large[2];
  345|  30.6M|    levels += TX_PAD_HOR;
  ------------------
  |  |  190|  30.6M|#define TX_PAD_HOR 4
  ------------------
  346|  30.6M|  } while (--col);
  ------------------
  |  Branch (346:12): [True: 28.4M, False: 2.13M]
  ------------------
  347|       |
  348|  2.13M|  coeff_contexts[0] = 0;
  349|  2.13M|}
encodetxb_sse2.c:load_levels_16x1x5_sse2:
   45|  37.4M|                                           __m128i *const level) {
   46|  37.4M|  level[0] = _mm_loadu_si128((__m128i *)(src + 1));
   47|  37.4M|  level[1] = _mm_loadu_si128((__m128i *)(src + stride));
   48|  37.4M|  level[2] = _mm_loadu_si128((__m128i *)(src + offsets[0]));
   49|  37.4M|  level[3] = _mm_loadu_si128((__m128i *)(src + offsets[1]));
   50|  37.4M|  level[4] = _mm_loadu_si128((__m128i *)(src + offsets[2]));
   51|  37.4M|}
encodetxb_sse2.c:get_4_nz_map_contexts_hor:
  138|  1.81M|                                             int8_t *coeff_contexts) {
  139|  1.81M|  const int stride = 4 + TX_PAD_HOR;
  ------------------
  |  |  190|  1.81M|#define TX_PAD_HOR 4
  ------------------
  140|  1.81M|  const __m128i pos_to_offset_large = _mm_set1_epi8(SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  141|  1.81M|  __m128i pos_to_offset =
  142|  1.81M|      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                    _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  143|  1.81M|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  144|  1.81M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  145|  1.81M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  146|  1.81M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  147|  1.81M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  148|  1.81M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  149|  1.81M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  1.81M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  150|  1.81M|  __m128i count;
  151|  1.81M|  __m128i level[5];
  152|  1.81M|  int col = width;
  153|       |
  154|  1.81M|  assert(!(width % 4));
  155|       |
  156|  1.97M|  do {
  157|  1.97M|    load_levels_4x4x5_sse2(levels, stride, offsets, level);
  158|  1.97M|    count = get_coeff_contexts_kernel_sse2(level);
  159|  1.97M|    count = _mm_add_epi8(count, pos_to_offset);
  160|  1.97M|    _mm_store_si128((__m128i *)coeff_contexts, count);
  161|  1.97M|    pos_to_offset = pos_to_offset_large;
  162|  1.97M|    levels += 4 * stride;
  163|  1.97M|    coeff_contexts += 16;
  164|  1.97M|    col -= 4;
  165|  1.97M|  } while (col);
  ------------------
  |  Branch (165:12): [True: 163k, False: 1.81M]
  ------------------
  166|  1.81M|}
encodetxb_sse2.c:get_8_coeff_contexts_hor:
  248|  3.00M|                                            int8_t *coeff_contexts) {
  249|  3.00M|  const int stride = 8 + TX_PAD_HOR;
  ------------------
  |  |  190|  3.00M|#define TX_PAD_HOR 4
  ------------------
  250|  3.00M|  const __m128i pos_to_offset_large = _mm_set1_epi8(SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  251|  3.00M|  __m128i pos_to_offset =
  252|  3.00M|      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                    _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  253|  3.00M|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  254|  3.00M|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  255|  3.00M|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 0,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  256|  3.00M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  257|  3.00M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  258|  3.00M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  259|  3.00M|                    SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5);
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 5, SIG_COEF_CONTEXTS_2D + 5);
  ------------------
  |  |   34|  3.00M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  260|  3.00M|  int col = width;
  261|  3.00M|  __m128i count;
  262|  3.00M|  __m128i level[5];
  263|       |
  264|  3.00M|  assert(!(width % 2));
  265|       |
  266|  11.9M|  do {
  267|  11.9M|    load_levels_8x2x5_sse2(levels, stride, offsets, level);
  268|  11.9M|    count = get_coeff_contexts_kernel_sse2(level);
  269|  11.9M|    count = _mm_add_epi8(count, pos_to_offset);
  270|  11.9M|    _mm_store_si128((__m128i *)coeff_contexts, count);
  271|  11.9M|    pos_to_offset = pos_to_offset_large;
  272|  11.9M|    levels += 2 * stride;
  273|  11.9M|    coeff_contexts += 16;
  274|  11.9M|    col -= 2;
  275|  11.9M|  } while (col);
  ------------------
  |  Branch (275:12): [True: 8.94M, False: 3.00M]
  ------------------
  276|  3.00M|}
encodetxb_sse2.c:get_16n_coeff_contexts_hor:
  401|   114k|                                              int8_t *coeff_contexts) {
  402|   114k|  const int stride = height + TX_PAD_HOR;
  ------------------
  |  |  190|   114k|#define TX_PAD_HOR 4
  ------------------
  403|   114k|  __m128i pos_to_offset[3];
  404|   114k|  __m128i count;
  405|   114k|  __m128i level[5];
  406|   114k|  int col = width;
  407|       |
  408|   114k|  assert(!(height % 16));
  409|       |
  410|   114k|  pos_to_offset[0] = _mm_set1_epi8(SIG_COEF_CONTEXTS_2D + 0);
  ------------------
  |  |   34|   114k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  411|   114k|  pos_to_offset[1] = _mm_set1_epi8(SIG_COEF_CONTEXTS_2D + 5);
  ------------------
  |  |   34|   114k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  412|   114k|  pos_to_offset[2] = _mm_set1_epi8(SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|   114k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  413|       |
  414|   928k|  do {
  415|   928k|    int h = height;
  416|       |
  417|   928k|    do {
  418|   928k|      load_levels_16x1x5_sse2(levels, stride, offsets, level);
  419|   928k|      count = get_coeff_contexts_kernel_sse2(level);
  420|   928k|      count = _mm_add_epi8(count, pos_to_offset[0]);
  421|   928k|      _mm_store_si128((__m128i *)coeff_contexts, count);
  422|   928k|      levels += 16;
  423|   928k|      coeff_contexts += 16;
  424|   928k|      h -= 16;
  425|   928k|    } while (h);
  ------------------
  |  Branch (425:14): [True: 0, False: 928k]
  ------------------
  426|       |
  427|   928k|    pos_to_offset[0] = pos_to_offset[1];
  428|   928k|    pos_to_offset[1] = pos_to_offset[2];
  429|   928k|    levels += TX_PAD_HOR;
  ------------------
  |  |  190|   928k|#define TX_PAD_HOR 4
  ------------------
  430|   928k|  } while (--col);
  ------------------
  |  Branch (430:12): [True: 813k, False: 114k]
  ------------------
  431|   114k|}
encodetxb_sse2.c:get_4_nz_map_contexts_ver:
  107|   690k|                                             int8_t *coeff_contexts) {
  108|   690k|  const int stride = 4 + TX_PAD_HOR;
  ------------------
  |  |  190|   690k|#define TX_PAD_HOR 4
  ------------------
  109|   690k|  const __m128i pos_to_offset =
  110|   690k|      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                    _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  111|   690k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  112|   690k|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  113|   690k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  114|   690k|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  115|   690k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  116|   690k|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  117|   690k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|   690k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  118|   690k|  __m128i count;
  119|   690k|  __m128i level[5];
  120|   690k|  int col = width;
  121|       |
  122|   690k|  assert(!(width % 4));
  123|       |
  124|   818k|  do {
  125|   818k|    load_levels_4x4x5_sse2(levels, stride, offsets, level);
  126|   818k|    count = get_coeff_contexts_kernel_sse2(level);
  127|   818k|    count = _mm_add_epi8(count, pos_to_offset);
  128|   818k|    _mm_store_si128((__m128i *)coeff_contexts, count);
  129|   818k|    levels += 4 * stride;
  130|   818k|    coeff_contexts += 16;
  131|   818k|    col -= 4;
  132|   818k|  } while (col);
  ------------------
  |  Branch (132:12): [True: 127k, False: 690k]
  ------------------
  133|   690k|}
encodetxb_sse2.c:get_8_coeff_contexts_ver:
  217|  2.16M|                                            int8_t *coeff_contexts) {
  218|  2.16M|  const int stride = 8 + TX_PAD_HOR;
  ------------------
  |  |  190|  2.16M|#define TX_PAD_HOR 4
  ------------------
  219|  2.16M|  const __m128i pos_to_offset =
  220|  2.16M|      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                    _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  221|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  222|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  223|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  224|  2.16M|                    SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  225|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  226|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  227|  2.16M|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  2.16M|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  228|  2.16M|  int col = width;
  229|  2.16M|  __m128i count;
  230|  2.16M|  __m128i level[5];
  231|       |
  232|  2.16M|  assert(!(width % 2));
  233|       |
  234|  8.70M|  do {
  235|  8.70M|    load_levels_8x2x5_sse2(levels, stride, offsets, level);
  236|  8.70M|    count = get_coeff_contexts_kernel_sse2(level);
  237|  8.70M|    count = _mm_add_epi8(count, pos_to_offset);
  238|  8.70M|    _mm_store_si128((__m128i *)coeff_contexts, count);
  239|  8.70M|    levels += 2 * stride;
  240|  8.70M|    coeff_contexts += 16;
  241|  8.70M|    col -= 2;
  242|  8.70M|  } while (col);
  ------------------
  |  Branch (242:12): [True: 6.54M, False: 2.16M]
  ------------------
  243|  2.16M|}
encodetxb_sse2.c:get_16n_coeff_contexts_ver:
  354|  45.1k|                                              int8_t *coeff_contexts) {
  355|  45.1k|  const int stride = height + TX_PAD_HOR;
  ------------------
  |  |  190|  45.1k|#define TX_PAD_HOR 4
  ------------------
  356|  45.1k|  const __m128i pos_to_offset_large =
  357|  45.1k|      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                    _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  358|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  359|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  360|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  361|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  362|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  363|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  364|  45.1k|                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                  SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|  45.1k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  365|  45.1k|  __m128i count;
  366|  45.1k|  __m128i level[5];
  367|  45.1k|  int col = width;
  368|       |
  369|  45.1k|  assert(!(height % 16));
  370|       |
  371|   371k|  do {
  372|   371k|    __m128i pos_to_offset =
  373|   371k|        _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                      _mm_setr_epi8(SIG_COEF_CONTEXTS_2D + 0, SIG_COEF_CONTEXTS_2D + 5,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  374|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  375|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  376|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  377|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  378|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  379|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10,
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  380|   371k|                      SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
                                    SIG_COEF_CONTEXTS_2D + 10, SIG_COEF_CONTEXTS_2D + 10);
  ------------------
  |  |   34|   371k|#define SIG_COEF_CONTEXTS_2D 26
  ------------------
  381|   371k|    int h = height;
  382|       |
  383|   371k|    do {
  384|   371k|      load_levels_16x1x5_sse2(levels, stride, offsets, level);
  385|   371k|      count = get_coeff_contexts_kernel_sse2(level);
  386|   371k|      count = _mm_add_epi8(count, pos_to_offset);
  387|   371k|      _mm_store_si128((__m128i *)coeff_contexts, count);
  388|   371k|      pos_to_offset = pos_to_offset_large;
  389|   371k|      levels += 16;
  390|   371k|      coeff_contexts += 16;
  391|   371k|      h -= 16;
  392|   371k|    } while (h);
  ------------------
  |  Branch (392:14): [True: 0, False: 371k]
  ------------------
  393|       |
  394|   371k|    levels += TX_PAD_HOR;
  ------------------
  |  |  190|   371k|#define TX_PAD_HOR 4
  ------------------
  395|   371k|  } while (--col);
  ------------------
  |  Branch (395:12): [True: 326k, False: 45.1k]
  ------------------
  396|  45.1k|}

av1_block_error_lp_avx2:
  129|  5.78M|                                intptr_t block_size) {
  130|  5.78M|  assert(block_size % 16 == 0);
  131|  5.78M|  __m256i sse_256 = _mm256_setzero_si256();
  132|  5.78M|  int64_t sse;
  133|       |
  134|  5.78M|  if (block_size == 16)
  ------------------
  |  Branch (134:7): [True: 987k, False: 4.79M]
  ------------------
  135|   987k|    av1_block_error_block_size16_avx2(coeff, dqcoeff, &sse_256);
  136|  4.79M|  else if (block_size == 32)
  ------------------
  |  Branch (136:12): [True: 0, False: 4.79M]
  ------------------
  137|      0|    av1_block_error_block_size32_avx2(coeff, dqcoeff, &sse_256);
  138|  4.79M|  else
  139|  4.79M|    av1_block_error_block_size64_avx2(coeff, dqcoeff, &sse_256, block_size);
  140|       |
  141|       |  // Save the higher 64 bit of each 128 bit lane.
  142|  5.78M|  const __m256i sse_hi = _mm256_srli_si256(sse_256, 8);
  143|       |  // Add the higher 64 bit to the low 64 bit.
  144|  5.78M|  sse_256 = _mm256_add_epi64(sse_256, sse_hi);
  145|       |  // Accumulate the sse_256 register to get final sse
  146|  5.78M|  const __m128i sse_128 = _mm_add_epi64(_mm256_castsi256_si128(sse_256),
  147|  5.78M|                                        _mm256_extractf128_si256(sse_256, 1));
  148|       |
  149|       |  // Store the results.
  150|  5.78M|  _mm_storel_epi64((__m128i *)&sse, sse_128);
  151|  5.78M|  return sse;
  152|  5.78M|}
av1_block_error_avx2:
  155|  23.1M|                             intptr_t block_size, int64_t *ssz) {
  156|  23.1M|  __m256i sse_reg, ssz_reg, coeff_reg, dqcoeff_reg;
  157|  23.1M|  __m256i exp_dqcoeff_lo, exp_dqcoeff_hi, exp_coeff_lo, exp_coeff_hi;
  158|  23.1M|  __m256i sse_reg_64hi, ssz_reg_64hi;
  159|  23.1M|  __m128i sse_reg128, ssz_reg128;
  160|  23.1M|  int64_t sse;
  161|  23.1M|  int i;
  162|  23.1M|  const __m256i zero_reg = _mm256_setzero_si256();
  163|       |
  164|       |  // init sse and ssz registerd to zero
  165|  23.1M|  sse_reg = _mm256_setzero_si256();
  166|  23.1M|  ssz_reg = _mm256_setzero_si256();
  167|       |
  168|   103M|  for (i = 0; i < block_size; i += 16) {
  ------------------
  |  Branch (168:15): [True: 80.4M, False: 23.1M]
  ------------------
  169|       |    // load 32 bytes from coeff and dqcoeff
  170|  80.4M|    read_coeff(coeff, i, &coeff_reg);
  171|  80.4M|    read_coeff(dqcoeff, i, &dqcoeff_reg);
  172|       |    // dqcoeff - coeff
  173|  80.4M|    dqcoeff_reg = _mm256_sub_epi16(dqcoeff_reg, coeff_reg);
  174|       |    // madd (dqcoeff - coeff)
  175|  80.4M|    dqcoeff_reg = _mm256_madd_epi16(dqcoeff_reg, dqcoeff_reg);
  176|       |    // madd coeff
  177|  80.4M|    coeff_reg = _mm256_madd_epi16(coeff_reg, coeff_reg);
  178|       |    // expand each double word of madd (dqcoeff - coeff) to quad word
  179|  80.4M|    exp_dqcoeff_lo = _mm256_unpacklo_epi32(dqcoeff_reg, zero_reg);
  180|  80.4M|    exp_dqcoeff_hi = _mm256_unpackhi_epi32(dqcoeff_reg, zero_reg);
  181|       |    // expand each double word of madd (coeff) to quad word
  182|  80.4M|    exp_coeff_lo = _mm256_unpacklo_epi32(coeff_reg, zero_reg);
  183|  80.4M|    exp_coeff_hi = _mm256_unpackhi_epi32(coeff_reg, zero_reg);
  184|       |    // add each quad word of madd (dqcoeff - coeff) and madd (coeff)
  185|  80.4M|    sse_reg = _mm256_add_epi64(sse_reg, exp_dqcoeff_lo);
  186|  80.4M|    ssz_reg = _mm256_add_epi64(ssz_reg, exp_coeff_lo);
  187|  80.4M|    sse_reg = _mm256_add_epi64(sse_reg, exp_dqcoeff_hi);
  188|  80.4M|    ssz_reg = _mm256_add_epi64(ssz_reg, exp_coeff_hi);
  189|  80.4M|  }
  190|       |  // save the higher 64 bit of each 128 bit lane
  191|  23.1M|  sse_reg_64hi = _mm256_srli_si256(sse_reg, 8);
  192|  23.1M|  ssz_reg_64hi = _mm256_srli_si256(ssz_reg, 8);
  193|       |  // add the higher 64 bit to the low 64 bit
  194|  23.1M|  sse_reg = _mm256_add_epi64(sse_reg, sse_reg_64hi);
  195|  23.1M|  ssz_reg = _mm256_add_epi64(ssz_reg, ssz_reg_64hi);
  196|       |
  197|       |  // add each 64 bit from each of the 128 bit lane of the 256 bit
  198|  23.1M|  sse_reg128 = _mm_add_epi64(_mm256_castsi256_si128(sse_reg),
  199|  23.1M|                             _mm256_extractf128_si256(sse_reg, 1));
  200|       |
  201|  23.1M|  ssz_reg128 = _mm_add_epi64(_mm256_castsi256_si128(ssz_reg),
  202|  23.1M|                             _mm256_extractf128_si256(ssz_reg, 1));
  203|       |
  204|       |  // store the results
  205|  23.1M|  _mm_storel_epi64((__m128i *)(&sse), sse_reg128);
  206|       |
  207|  23.1M|  _mm_storel_epi64((__m128i *)(ssz), ssz_reg128);
  208|  23.1M|  _mm256_zeroupper();
  209|  23.1M|  return sse;
  210|  23.1M|}
error_intrin_avx2.c:av1_block_error_block_size16_avx2:
   34|   987k|                                                     __m256i *sse_256) {
   35|   987k|  const __m256i _coeff = _mm256_loadu_si256((const __m256i *)coeff);
   36|   987k|  const __m256i _dqcoeff = _mm256_loadu_si256((const __m256i *)dqcoeff);
   37|       |  // d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15
   38|   987k|  const __m256i diff = _mm256_sub_epi16(_dqcoeff, _coeff);
   39|       |  // r0 r1 r2 r3 r4 r5 r6 r7
   40|   987k|  const __m256i error = _mm256_madd_epi16(diff, diff);
   41|       |  // r0+r1 r2+r3 | r0+r1 r2+r3 | r4+r5 r6+r7 | r4+r5 r6+r7
   42|   987k|  const __m256i error_hi = _mm256_hadd_epi32(error, error);
   43|       |  // r0+r1 | r2+r3 | r4+r5 | r6+r7
   44|   987k|  *sse_256 = _mm256_unpacklo_epi32(error_hi, _mm256_setzero_si256());
   45|   987k|}
error_intrin_avx2.c:av1_block_error_block_size64_avx2:
   77|  4.79M|                                                     intptr_t block_size) {
   78|  4.79M|  const __m256i zero = _mm256_setzero_si256();
   79|  10.7M|  for (int i = 0; i < block_size; i += 64) {
  ------------------
  |  Branch (79:19): [True: 5.98M, False: 4.79M]
  ------------------
   80|       |    // Load 64 elements for coeff and dqcoeff.
   81|  5.98M|    const __m256i _coeff_0 = _mm256_loadu_si256((const __m256i *)coeff);
   82|  5.98M|    const __m256i _dqcoeff_0 = _mm256_loadu_si256((const __m256i *)dqcoeff);
   83|  5.98M|    const __m256i _coeff_1 = _mm256_loadu_si256((const __m256i *)(coeff + 16));
   84|  5.98M|    const __m256i _dqcoeff_1 =
   85|  5.98M|        _mm256_loadu_si256((const __m256i *)(dqcoeff + 16));
   86|  5.98M|    const __m256i _coeff_2 = _mm256_loadu_si256((const __m256i *)(coeff + 32));
   87|  5.98M|    const __m256i _dqcoeff_2 =
   88|  5.98M|        _mm256_loadu_si256((const __m256i *)(dqcoeff + 32));
   89|  5.98M|    const __m256i _coeff_3 = _mm256_loadu_si256((const __m256i *)(coeff + 48));
   90|  5.98M|    const __m256i _dqcoeff_3 =
   91|  5.98M|        _mm256_loadu_si256((const __m256i *)(dqcoeff + 48));
   92|       |
   93|       |    // d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15
   94|  5.98M|    const __m256i diff_0 = _mm256_sub_epi16(_dqcoeff_0, _coeff_0);
   95|  5.98M|    const __m256i diff_1 = _mm256_sub_epi16(_dqcoeff_1, _coeff_1);
   96|  5.98M|    const __m256i diff_2 = _mm256_sub_epi16(_dqcoeff_2, _coeff_2);
   97|  5.98M|    const __m256i diff_3 = _mm256_sub_epi16(_dqcoeff_3, _coeff_3);
   98|       |
   99|       |    // r0 r1 r2 r3 r4 r5 r6 r7
  100|  5.98M|    const __m256i error_0 = _mm256_madd_epi16(diff_0, diff_0);
  101|  5.98M|    const __m256i error_1 = _mm256_madd_epi16(diff_1, diff_1);
  102|  5.98M|    const __m256i error_2 = _mm256_madd_epi16(diff_2, diff_2);
  103|  5.98M|    const __m256i error_3 = _mm256_madd_epi16(diff_3, diff_3);
  104|       |    // r00 r01 r02 r03 r04 r05 r06 r07
  105|  5.98M|    const __m256i err_final_0 = _mm256_add_epi32(error_0, error_1);
  106|       |    // r10 r11 r12 r13 r14 r15 r16 r17
  107|  5.98M|    const __m256i err_final_1 = _mm256_add_epi32(error_2, error_3);
  108|       |
  109|       |    // For extreme input values, the accumulation needs to happen in 64 bit
  110|       |    // precision to avoid any overflow. r00 r01 r04 r05
  111|  5.98M|    const __m256i exp0_error_lo = _mm256_unpacklo_epi32(err_final_0, zero);
  112|       |    // r02 r03 r06 r07
  113|  5.98M|    const __m256i exp0_error_hi = _mm256_unpackhi_epi32(err_final_0, zero);
  114|       |    // r10 r11 r14 r15
  115|  5.98M|    const __m256i exp1_error_lo = _mm256_unpacklo_epi32(err_final_1, zero);
  116|       |    // r12 r13 r16 r17
  117|  5.98M|    const __m256i exp1_error_hi = _mm256_unpackhi_epi32(err_final_1, zero);
  118|       |
  119|  5.98M|    const __m256i sum_temp_0 = _mm256_add_epi64(exp0_error_hi, exp0_error_lo);
  120|  5.98M|    const __m256i sum_temp_1 = _mm256_add_epi64(exp1_error_hi, exp1_error_lo);
  121|  5.98M|    const __m256i sse_256_temp = _mm256_add_epi64(sum_temp_1, sum_temp_0);
  122|  5.98M|    *sse_256 = _mm256_add_epi64(*sse_256, sse_256_temp);
  123|  5.98M|    coeff += 64;
  124|  5.98M|    dqcoeff += 64;
  125|  5.98M|  }
  126|  4.79M|}
error_intrin_avx2.c:read_coeff:
   19|   160M|                              __m256i *c) {
   20|   160M|  const tran_low_t *addr = coeff + offset;
   21|       |
   22|   160M|  if (sizeof(tran_low_t) == 4) {
  ------------------
  |  Branch (22:7): [True: 160M, Folded]
  ------------------
   23|   160M|    const __m256i x0 = _mm256_loadu_si256((const __m256i *)addr);
   24|   160M|    const __m256i x1 = _mm256_loadu_si256((const __m256i *)addr + 1);
   25|   160M|    const __m256i y = _mm256_packs_epi32(x0, x1);
   26|   160M|    *c = _mm256_permute4x64_epi64(y, 0xD8);
   27|   160M|  } else {
   28|      0|    *c = _mm256_loadu_si256((const __m256i *)addr);
   29|      0|  }
   30|   160M|}

av1_get_crc32c_value_sse4_2:
   34|  3.66M|                                     size_t len) {
   35|  3.66M|  (void)crc_calculator;
   36|  3.66M|  const uint8_t *buf = p;
   37|  3.66M|  uint32_t crc = 0xFFFFFFFF;
   38|       |
   39|       |  // Align the input to the word boundary
   40|  3.66M|  for (; (len > 0) && ((intptr_t)buf & ALIGN_MASK); len--, buf++) {
  ------------------
  |  |   19|  3.66M|#define ALIGN_MASK (ALIGN_SIZE - 1)
  |  |  ------------------
  |  |  |  |   18|  3.66M|#define ALIGN_SIZE 8
  |  |  ------------------
  ------------------
  |  Branch (40:10): [True: 3.66M, False: 18.4E]
  |  Branch (40:23): [True: 0, False: 3.66M]
  ------------------
   41|      0|    crc = _mm_crc32_u8(crc, *buf);
   42|      0|  }
   43|       |
   44|  3.66M|#ifdef __x86_64__
   45|  3.66M|  uint64_t crc64 = crc;
   46|  3.66M|  CALC_CRC(_mm_crc32_u64, crc64, uint64_t, buf, len)
  ------------------
  |  |   22|  51.9M|  while ((len) >= sizeof(type)) {         \
  |  |  ------------------
  |  |  |  Branch (22:10): [True: 48.2M, False: 3.66M]
  |  |  ------------------
  |  |   23|  48.2M|    (crc) = op((crc), *(type *)(buf));    \
  |  |   24|  48.2M|    (len) -= sizeof(type);                \
  |  |   25|  48.2M|    buf += sizeof(type);                  \
  |  |   26|  48.2M|  }
  ------------------
   47|  3.66M|  crc = (uint32_t)crc64;
   48|  3.66M|#endif
   49|  3.66M|  CALC_CRC(_mm_crc32_u32, crc, uint32_t, buf, len)
  ------------------
  |  |   22|  3.66M|  while ((len) >= sizeof(type)) {         \
  |  |  ------------------
  |  |  |  Branch (22:10): [True: 0, False: 3.66M]
  |  |  ------------------
  |  |   23|      0|    (crc) = op((crc), *(type *)(buf));    \
  |  |   24|      0|    (len) -= sizeof(type);                \
  |  |   25|      0|    buf += sizeof(type);                  \
  |  |   26|      0|  }
  ------------------
   50|  3.66M|  CALC_CRC(_mm_crc32_u16, crc, uint16_t, buf, len)
  ------------------
  |  |   22|  3.66M|  while ((len) >= sizeof(type)) {         \
  |  |  ------------------
  |  |  |  Branch (22:10): [True: 0, False: 3.66M]
  |  |  ------------------
  |  |   23|      0|    (crc) = op((crc), *(type *)(buf));    \
  |  |   24|      0|    (len) -= sizeof(type);                \
  |  |   25|      0|    buf += sizeof(type);                  \
  |  |   26|      0|  }
  ------------------
   51|  3.66M|  CALC_CRC(_mm_crc32_u8, crc, uint8_t, buf, len)
  ------------------
  |  |   22|  3.66M|  while ((len) >= sizeof(type)) {         \
  |  |  ------------------
  |  |  |  Branch (22:10): [True: 0, False: 3.66M]
  |  |  ------------------
  |  |   23|      0|    (crc) = op((crc), *(type *)(buf));    \
  |  |   24|      0|    (len) -= sizeof(type);                \
  |  |   25|      0|    buf += sizeof(type);                  \
  |  |   26|      0|  }
  ------------------
   52|  3.66M|  return (crc ^ 0xFFFFFFFF);
   53|  3.66M|}

av1_highbd_block_error_avx2:
   21|  6.84M|                                    int bps) {
   22|  6.84M|  int i;
   23|  6.84M|  int64_t temp1[8];
   24|  6.84M|  int64_t error = 0, sqcoeff = 0;
   25|  6.84M|  const int shift = 2 * (bps - 8);
   26|  6.84M|  const int rounding = (1 << shift) >> 1;
   27|       |
   28|  24.7M|  for (i = 0; i < block_size; i += 16) {
  ------------------
  |  Branch (28:15): [True: 17.8M, False: 6.84M]
  ------------------
   29|  17.8M|    __m256i mm256_coeff = _mm256_loadu_si256((__m256i *)(coeff + i));
   30|  17.8M|    __m256i mm256_coeff2 = _mm256_loadu_si256((__m256i *)(coeff + i + 8));
   31|  17.8M|    __m256i mm256_dqcoeff = _mm256_loadu_si256((__m256i *)(dqcoeff + i));
   32|  17.8M|    __m256i mm256_dqcoeff2 = _mm256_loadu_si256((__m256i *)(dqcoeff + i + 8));
   33|       |
   34|  17.8M|    __m256i diff1 = _mm256_sub_epi32(mm256_coeff, mm256_dqcoeff);
   35|  17.8M|    __m256i diff2 = _mm256_sub_epi32(mm256_coeff2, mm256_dqcoeff2);
   36|  17.8M|    __m256i diff1h = _mm256_srli_epi64(diff1, 32);
   37|  17.8M|    __m256i diff2h = _mm256_srli_epi64(diff2, 32);
   38|  17.8M|    __m256i res = _mm256_mul_epi32(diff1, diff1);
   39|  17.8M|    __m256i res1 = _mm256_mul_epi32(diff1h, diff1h);
   40|  17.8M|    __m256i res2 = _mm256_mul_epi32(diff2, diff2);
   41|  17.8M|    __m256i res3 = _mm256_mul_epi32(diff2h, diff2h);
   42|  17.8M|    __m256i res_diff = _mm256_add_epi64(_mm256_add_epi64(res, res1),
   43|  17.8M|                                        _mm256_add_epi64(res2, res3));
   44|  17.8M|    __m256i mm256_coeffh = _mm256_srli_epi64(mm256_coeff, 32);
   45|  17.8M|    __m256i mm256_coeffh2 = _mm256_srli_epi64(mm256_coeff2, 32);
   46|  17.8M|    res = _mm256_mul_epi32(mm256_coeff, mm256_coeff);
   47|  17.8M|    res1 = _mm256_mul_epi32(mm256_coeffh, mm256_coeffh);
   48|  17.8M|    res2 = _mm256_mul_epi32(mm256_coeff2, mm256_coeff2);
   49|  17.8M|    res3 = _mm256_mul_epi32(mm256_coeffh2, mm256_coeffh2);
   50|  17.8M|    __m256i res_sqcoeff = _mm256_add_epi64(_mm256_add_epi64(res, res1),
   51|  17.8M|                                           _mm256_add_epi64(res2, res3));
   52|  17.8M|    _mm256_storeu_si256((__m256i *)temp1, res_diff);
   53|  17.8M|    _mm256_storeu_si256((__m256i *)temp1 + 1, res_sqcoeff);
   54|       |
   55|  17.8M|    error += temp1[0] + temp1[1] + temp1[2] + temp1[3];
   56|  17.8M|    sqcoeff += temp1[4] + temp1[5] + temp1[6] + temp1[7];
   57|  17.8M|  }
   58|  6.84M|  error = (error + rounding) >> shift;
   59|  6.84M|  sqcoeff = (sqcoeff + rounding) >> shift;
   60|       |
   61|  6.84M|  *ssz = sqcoeff;
   62|  6.84M|  return error;
   63|  6.84M|}

av1_fwd_txfm2d_8x8_avx2:
  546|  8.85M|                             TX_TYPE tx_type, int bd) {
  547|  8.85M|  __m256i in[8], out[8];
  548|  8.85M|  const TX_SIZE tx_size = TX_8X8;
  549|  8.85M|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
  550|  8.85M|  const int txw_idx = get_txw_idx(tx_size);
  551|  8.85M|  const int txh_idx = get_txh_idx(tx_size);
  552|  8.85M|  const int width = tx_size_wide[tx_size];
  553|  8.85M|  const int width_div8 = (width >> 3);
  554|       |
  555|  8.85M|  switch (tx_type) {
  556|  3.74M|    case DCT_DCT:
  ------------------
  |  Branch (556:5): [True: 3.74M, False: 5.10M]
  ------------------
  557|  3.74M|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  558|  3.74M|      fdct8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  559|  3.74M|                 width_div8);
  560|  3.74M|      col_txfm_8x8_rounding(out, -shift[1]);
  561|  3.74M|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  562|  3.74M|      fdct8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  563|  3.74M|                 width_div8);
  564|  3.74M|      store_buffer_avx2(out, coeff, 8, 8);
  565|  3.74M|      break;
  566|  1.03M|    case ADST_DCT:
  ------------------
  |  Branch (566:5): [True: 1.03M, False: 7.82M]
  ------------------
  567|  1.03M|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  568|  1.03M|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  569|  1.03M|                  width_div8);
  570|  1.03M|      col_txfm_8x8_rounding(out, -shift[1]);
  571|  1.03M|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  572|  1.03M|      fdct8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  573|  1.03M|                 width_div8);
  574|  1.03M|      store_buffer_avx2(out, coeff, 8, 8);
  575|  1.03M|      break;
  576|  1.08M|    case DCT_ADST:
  ------------------
  |  Branch (576:5): [True: 1.08M, False: 7.77M]
  ------------------
  577|  1.08M|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  578|  1.08M|      fdct8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  579|  1.08M|                 width_div8);
  580|  1.08M|      col_txfm_8x8_rounding(out, -shift[1]);
  581|  1.08M|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  582|  1.08M|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  583|  1.08M|                  width_div8);
  584|  1.08M|      store_buffer_avx2(out, coeff, 8, 8);
  585|  1.08M|      break;
  586|  1.61M|    case ADST_ADST:
  ------------------
  |  Branch (586:5): [True: 1.61M, False: 7.24M]
  ------------------
  587|  1.61M|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  588|  1.61M|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  589|  1.61M|                  width_div8);
  590|  1.61M|      col_txfm_8x8_rounding(out, -shift[1]);
  591|  1.61M|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  592|  1.61M|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  593|  1.61M|                  width_div8);
  594|  1.61M|      store_buffer_avx2(out, coeff, 8, 8);
  595|  1.61M|      break;
  596|  20.8k|    case FLIPADST_DCT:
  ------------------
  |  Branch (596:5): [True: 20.8k, False: 8.83M]
  ------------------
  597|  20.8k|      load_buffer_8x8_avx2(input, in, stride, 1, 0, shift[0]);
  598|  20.8k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  599|  20.8k|                  width_div8);
  600|  20.8k|      col_txfm_8x8_rounding(out, -shift[1]);
  601|  20.8k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  602|  20.8k|      fdct8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  603|  20.8k|                 width_div8);
  604|  20.8k|      store_buffer_avx2(out, coeff, 8, 8);
  605|  20.8k|      break;
  606|  23.6k|    case DCT_FLIPADST:
  ------------------
  |  Branch (606:5): [True: 23.6k, False: 8.83M]
  ------------------
  607|  23.6k|      load_buffer_8x8_avx2(input, in, stride, 0, 1, shift[0]);
  608|  23.6k|      fdct8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  609|  23.6k|                 width_div8);
  610|  23.6k|      col_txfm_8x8_rounding(out, -shift[1]);
  611|  23.6k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  612|  23.6k|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  613|  23.6k|                  width_div8);
  614|  23.6k|      store_buffer_avx2(out, coeff, 8, 8);
  615|  23.6k|      break;
  616|  2.89k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (616:5): [True: 2.89k, False: 8.85M]
  ------------------
  617|  2.89k|      load_buffer_8x8_avx2(input, in, stride, 1, 1, shift[0]);
  618|  2.89k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  619|  2.89k|                  width_div8);
  620|  2.89k|      col_txfm_8x8_rounding(out, -shift[1]);
  621|  2.89k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  622|  2.89k|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  623|  2.89k|                  width_div8);
  624|  2.89k|      store_buffer_avx2(out, coeff, 8, 8);
  625|  2.89k|      break;
  626|  3.49k|    case ADST_FLIPADST:
  ------------------
  |  Branch (626:5): [True: 3.49k, False: 8.85M]
  ------------------
  627|  3.49k|      load_buffer_8x8_avx2(input, in, stride, 0, 1, shift[0]);
  628|  3.49k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  629|  3.49k|                  width_div8);
  630|  3.49k|      col_txfm_8x8_rounding(out, -shift[1]);
  631|  3.49k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  632|  3.49k|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  633|  3.49k|                  width_div8);
  634|  3.49k|      store_buffer_avx2(out, coeff, 8, 8);
  635|  3.49k|      break;
  636|  4.57k|    case FLIPADST_ADST:
  ------------------
  |  Branch (636:5): [True: 4.57k, False: 8.85M]
  ------------------
  637|  4.57k|      load_buffer_8x8_avx2(input, in, stride, 1, 0, shift[0]);
  638|  4.57k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  639|  4.57k|                  width_div8);
  640|  4.57k|      col_txfm_8x8_rounding(out, -shift[1]);
  641|  4.57k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  642|  4.57k|      fadst8_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
  643|  4.57k|                  width_div8);
  644|  4.57k|      store_buffer_avx2(out, coeff, 8, 8);
  645|  4.57k|      break;
  646|  4.63k|    case IDTX:
  ------------------
  |  Branch (646:5): [True: 4.63k, False: 8.85M]
  ------------------
  647|  4.63k|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  648|  4.63k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  649|  4.63k|                 width_div8);
  650|  4.63k|      col_txfm_8x8_rounding(out, -shift[1]);
  651|  4.63k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  652|  4.63k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  653|  4.63k|                 width_div8);
  654|  4.63k|      store_buffer_avx2(out, coeff, 8, 8);
  655|  4.63k|      break;
  656|   395k|    case V_DCT:
  ------------------
  |  Branch (656:5): [True: 395k, False: 8.46M]
  ------------------
  657|   395k|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  658|   395k|      fdct8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  659|   395k|                 width_div8);
  660|   395k|      col_txfm_8x8_rounding(out, -shift[1]);
  661|   395k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  662|   395k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  663|   395k|                 width_div8);
  664|   395k|      store_buffer_avx2(out, coeff, 8, 8);
  665|   395k|      break;
  666|   908k|    case H_DCT:
  ------------------
  |  Branch (666:5): [True: 908k, False: 7.94M]
  ------------------
  667|   908k|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  668|   908k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  669|   908k|                 width_div8);
  670|   908k|      col_txfm_8x8_rounding(out, -shift[1]);
  671|   908k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  672|   908k|      fdct8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  673|   908k|                 width_div8);
  674|   908k|      store_buffer_avx2(out, coeff, 8, 8);
  675|   908k|      break;
  676|  4.24k|    case V_ADST:
  ------------------
  |  Branch (676:5): [True: 4.24k, False: 8.85M]
  ------------------
  677|  4.24k|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  678|  4.24k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  679|  4.24k|                  width_div8);
  680|  4.24k|      col_txfm_8x8_rounding(out, -shift[1]);
  681|  4.24k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  682|  4.24k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  683|  4.24k|                 width_div8);
  684|  4.24k|      store_buffer_avx2(out, coeff, 8, 8);
  685|  4.24k|      break;
  686|  14.4k|    case H_ADST:
  ------------------
  |  Branch (686:5): [True: 14.4k, False: 8.84M]
  ------------------
  687|  14.4k|      load_buffer_8x8_avx2(input, in, stride, 0, 0, shift[0]);
  688|  14.4k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  689|  14.4k|                 width_div8);
  690|  14.4k|      col_txfm_8x8_rounding(out, -shift[1]);
  691|  14.4k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  692|  14.4k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  693|  14.4k|                  width_div8);
  694|  14.4k|      store_buffer_avx2(out, coeff, 8, 8);
  695|  14.4k|      break;
  696|  3.22k|    case V_FLIPADST:
  ------------------
  |  Branch (696:5): [True: 3.22k, False: 8.85M]
  ------------------
  697|  3.22k|      load_buffer_8x8_avx2(input, in, stride, 1, 0, shift[0]);
  698|  3.22k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  699|  3.22k|                  width_div8);
  700|  3.22k|      col_txfm_8x8_rounding(out, -shift[1]);
  701|  3.22k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  702|  3.22k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  703|  3.22k|                 width_div8);
  704|  3.22k|      store_buffer_avx2(out, coeff, 8, 8);
  705|  3.22k|      break;
  706|  10.4k|    case H_FLIPADST:
  ------------------
  |  Branch (706:5): [True: 10.4k, False: 8.84M]
  ------------------
  707|  10.4k|      load_buffer_8x8_avx2(input, in, stride, 0, 1, shift[0]);
  708|  10.4k|      idtx8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  709|  10.4k|                 width_div8);
  710|  10.4k|      col_txfm_8x8_rounding(out, -shift[1]);
  711|  10.4k|      fwd_txfm_transpose_8x8_avx2(out, in, width_div8, width_div8);
  712|  10.4k|      fadst8_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
  713|  10.4k|                  width_div8);
  714|  10.4k|      store_buffer_avx2(out, coeff, 8, 8);
  715|  10.4k|      break;
  716|      0|    default: assert(0);
  ------------------
  |  Branch (716:5): [True: 0, False: 8.85M]
  ------------------
  717|  8.85M|  }
  718|  8.87M|  (void)bd;
  719|  8.87M|}
av1_fwd_txfm2d_8x16_avx2:
 1310|   423k|                              TX_TYPE tx_type, int bd) {
 1311|   423k|  __m256i in[16], out[16];
 1312|   423k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_8X16];
 1313|   423k|  const int txw_idx = get_txw_idx(TX_8X16);
 1314|   423k|  const int txh_idx = get_txh_idx(TX_8X16);
 1315|   423k|  const transform_1d_avx2 col_txfm = col_highbd_txfm8x16_arr[tx_type];
 1316|   423k|  const transform_1d_avx2 row_txfm = row_highbd_txfm8x8_arr[tx_type];
 1317|   423k|  const int8_t bit = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1318|   423k|  int ud_flip, lr_flip;
 1319|   423k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1320|       |
 1321|   423k|  load_buffer_8x16_avx2(input, in, stride, ud_flip, lr_flip, shift[0]);
 1322|   423k|  col_txfm(in, out, bit, 1, 1);
 1323|   423k|  col_txfm_8x8_rounding(out, -shift[1]);
 1324|   423k|  col_txfm_8x8_rounding(&out[8], -shift[1]);
 1325|   423k|  fwd_txfm_transpose_8x8_avx2(out, in, 1, 2);
 1326|   423k|  fwd_txfm_transpose_8x8_avx2(&out[8], &in[1], 1, 2);
 1327|   423k|  row_txfm(in, out, bit, 2, 2);
 1328|   423k|  round_shift_rect_array_32_avx2(out, in, 16, -shift[2], NewSqrt2);
 1329|   423k|  store_buffer_avx2(in, coeff, 8, 16);
 1330|   423k|  (void)bd;
 1331|   423k|}
av1_fwd_txfm2d_16x8_avx2:
 1369|   418k|                              TX_TYPE tx_type, int bd) {
 1370|   418k|  __m256i in[16], out[16];
 1371|   418k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_16X8];
 1372|   418k|  const int txw_idx = get_txw_idx(TX_16X8);
 1373|   418k|  const int txh_idx = get_txh_idx(TX_16X8);
 1374|   418k|  const transform_1d_avx2 col_txfm = col_highbd_txfm8x8_arr[tx_type];
 1375|   418k|  const transform_1d_avx2 row_txfm = row_highbd_txfm8x16_arr[tx_type];
 1376|   418k|  const int8_t bit = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 1377|   418k|  int ud_flip, lr_flip;
 1378|   418k|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 1379|       |
 1380|   418k|  load_buffer_16xn_avx2(input, in, stride, 8, 2, ud_flip, lr_flip);
 1381|   418k|  round_shift_32_8xn_avx2(in, 16, shift[0], 1);
 1382|   418k|  col_txfm(in, out, bit, 2, 2);
 1383|   418k|  round_shift_32_8xn_avx2(out, 16, shift[1], 1);
 1384|   418k|  fwd_txfm_transpose_8x8_avx2(out, in, 2, 1);
 1385|   418k|  fwd_txfm_transpose_8x8_avx2(&out[1], &in[8], 2, 1);
 1386|   418k|  row_txfm(in, out, bit, 1, 1);
 1387|   418k|  round_shift_rect_array_32_avx2(out, out, 16, -shift[2], NewSqrt2);
 1388|   418k|  store_buffer_avx2(out, coeff, 8, 16);
 1389|   418k|  (void)bd;
 1390|   418k|}
av1_fwd_txfm2d_16x16_avx2:
 1392|   188k|                               TX_TYPE tx_type, int bd) {
 1393|   188k|  __m256i in[32], out[32];
 1394|   188k|  const TX_SIZE tx_size = TX_16X16;
 1395|   188k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 1396|   188k|  const int txw_idx = get_txw_idx(tx_size);
 1397|   188k|  const int txh_idx = get_txh_idx(tx_size);
 1398|   188k|  const int width = tx_size_wide[tx_size];
 1399|   188k|  const int height = tx_size_high[tx_size];
 1400|   188k|  const int width_div8 = (width >> 3);
 1401|   188k|  const int width_div16 = (width >> 4);
 1402|   188k|  const int size = (height << 1);
 1403|   188k|  switch (tx_type) {
 1404|  79.3k|    case DCT_DCT:
  ------------------
  |  Branch (1404:5): [True: 79.3k, False: 108k]
  ------------------
 1405|  79.3k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1406|  79.3k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1407|  79.3k|      fdct16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1408|  79.3k|                  width_div8);
 1409|  79.3k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1410|  79.3k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1411|  79.3k|      fdct16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1412|  79.3k|                  width_div8);
 1413|  79.3k|      store_buffer_avx2(out, coeff, 8, 32);
 1414|  79.3k|      break;
 1415|  26.7k|    case ADST_DCT:
  ------------------
  |  Branch (1415:5): [True: 26.7k, False: 161k]
  ------------------
 1416|  26.7k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1417|  26.7k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1418|  26.7k|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1419|  26.7k|                   width_div8);
 1420|  26.7k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1421|  26.7k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1422|  26.7k|      fdct16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1423|  26.7k|                  width_div8);
 1424|  26.7k|      store_buffer_avx2(out, coeff, 8, 32);
 1425|  26.7k|      break;
 1426|  22.7k|    case DCT_ADST:
  ------------------
  |  Branch (1426:5): [True: 22.7k, False: 165k]
  ------------------
 1427|  22.7k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1428|  22.7k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1429|  22.7k|      fdct16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1430|  22.7k|                  width_div8);
 1431|  22.7k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1432|  22.7k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1433|  22.7k|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1434|  22.7k|                   width_div8);
 1435|  22.7k|      store_buffer_avx2(out, coeff, 8, 32);
 1436|  22.7k|      break;
 1437|  25.8k|    case ADST_ADST:
  ------------------
  |  Branch (1437:5): [True: 25.8k, False: 162k]
  ------------------
 1438|  25.8k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1439|  25.8k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1440|  25.8k|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1441|  25.8k|                   width_div8);
 1442|  25.8k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1443|  25.8k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1444|  25.8k|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1445|  25.8k|                   width_div8);
 1446|  25.8k|      store_buffer_avx2(out, coeff, 8, 32);
 1447|  25.8k|      break;
 1448|  3.60k|    case FLIPADST_DCT:
  ------------------
  |  Branch (1448:5): [True: 3.60k, False: 184k]
  ------------------
 1449|  3.60k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 1, 0);
 1450|  3.60k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1451|  3.60k|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1452|  3.60k|                   width_div8);
 1453|  3.60k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1454|  3.60k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1455|  3.60k|      fdct16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1456|  3.60k|                  width_div8);
 1457|  3.60k|      store_buffer_avx2(out, coeff, 8, 32);
 1458|  3.60k|      break;
 1459|  3.52k|    case DCT_FLIPADST:
  ------------------
  |  Branch (1459:5): [True: 3.52k, False: 184k]
  ------------------
 1460|  3.52k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 1);
 1461|  3.52k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1462|  3.52k|      fdct16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1463|  3.52k|                  width_div8);
 1464|  3.52k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1465|  3.52k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1466|  3.52k|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1467|  3.52k|                   width_div8);
 1468|  3.52k|      store_buffer_avx2(out, coeff, 8, 32);
 1469|  3.52k|      break;
 1470|    345|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (1470:5): [True: 345, False: 187k]
  ------------------
 1471|    345|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 1, 1);
 1472|    345|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1473|    345|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1474|    345|                   width_div8);
 1475|    345|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1476|    345|      fwd_txfm_transpose_16x16_avx2(out, in);
 1477|    345|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1478|    345|                   width_div8);
 1479|    345|      store_buffer_avx2(out, coeff, 8, 32);
 1480|    345|      break;
 1481|    488|    case ADST_FLIPADST:
  ------------------
  |  Branch (1481:5): [True: 488, False: 187k]
  ------------------
 1482|    488|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 1);
 1483|    488|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1484|    488|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1485|    488|                   width_div8);
 1486|    488|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1487|    488|      fwd_txfm_transpose_16x16_avx2(out, in);
 1488|    488|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1489|    488|                   width_div8);
 1490|    488|      store_buffer_avx2(out, coeff, 8, 32);
 1491|    488|      break;
 1492|    483|    case FLIPADST_ADST:
  ------------------
  |  Branch (1492:5): [True: 483, False: 187k]
  ------------------
 1493|    483|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 1, 0);
 1494|    483|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1495|    483|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1496|    483|                   width_div8);
 1497|    483|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1498|    483|      fwd_txfm_transpose_16x16_avx2(out, in);
 1499|    483|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1500|    483|                   width_div8);
 1501|    483|      store_buffer_avx2(out, coeff, 8, 32);
 1502|    483|      break;
 1503|  21.9k|    case IDTX:
  ------------------
  |  Branch (1503:5): [True: 21.9k, False: 166k]
  ------------------
 1504|  21.9k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1505|  21.9k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1506|  21.9k|      idtx16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1507|  21.9k|                  width_div8);
 1508|  21.9k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1509|  21.9k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1510|  21.9k|      idtx16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1511|  21.9k|                  width_div8);
 1512|  21.9k|      store_buffer_avx2(out, coeff, 8, 32);
 1513|  21.9k|      break;
 1514|  1.56k|    case V_DCT:
  ------------------
  |  Branch (1514:5): [True: 1.56k, False: 186k]
  ------------------
 1515|  1.56k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1516|  1.56k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1517|  1.56k|      fdct16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1518|  1.56k|                  width_div8);
 1519|  1.56k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1520|  1.56k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1521|  1.56k|      idtx16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1522|  1.56k|                  width_div8);
 1523|  1.56k|      store_buffer_avx2(out, coeff, 8, 32);
 1524|  1.56k|      break;
 1525|  1.73k|    case H_DCT:
  ------------------
  |  Branch (1525:5): [True: 1.73k, False: 186k]
  ------------------
 1526|  1.73k|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1527|  1.73k|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1528|  1.73k|      idtx16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1529|  1.73k|                  width_div8);
 1530|  1.73k|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1531|  1.73k|      fwd_txfm_transpose_16x16_avx2(out, in);
 1532|  1.73k|      fdct16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1533|  1.73k|                  width_div8);
 1534|  1.73k|      store_buffer_avx2(out, coeff, 8, 32);
 1535|  1.73k|      break;
 1536|      0|    case V_ADST:
  ------------------
  |  Branch (1536:5): [True: 0, False: 188k]
  ------------------
 1537|      0|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1538|      0|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1539|      0|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1540|      0|                   width_div8);
 1541|      0|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1542|      0|      fwd_txfm_transpose_16x16_avx2(out, in);
 1543|      0|      idtx16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1544|      0|                  width_div8);
 1545|      0|      store_buffer_avx2(out, coeff, 8, 32);
 1546|      0|      break;
 1547|      0|    case H_ADST:
  ------------------
  |  Branch (1547:5): [True: 0, False: 188k]
  ------------------
 1548|      0|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 0);
 1549|      0|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1550|      0|      idtx16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1551|      0|                  width_div8);
 1552|      0|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1553|      0|      fwd_txfm_transpose_16x16_avx2(out, in);
 1554|      0|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1555|      0|                   width_div8);
 1556|      0|      store_buffer_avx2(out, coeff, 8, 32);
 1557|      0|      break;
 1558|      0|    case V_FLIPADST:
  ------------------
  |  Branch (1558:5): [True: 0, False: 188k]
  ------------------
 1559|      0|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 1, 0);
 1560|      0|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1561|      0|      fadst16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1562|      0|                   width_div8);
 1563|      0|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1564|      0|      fwd_txfm_transpose_16x16_avx2(out, in);
 1565|      0|      idtx16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1566|      0|                  width_div8);
 1567|      0|      store_buffer_avx2(out, coeff, 8, 32);
 1568|      0|      break;
 1569|      0|    case H_FLIPADST:
  ------------------
  |  Branch (1569:5): [True: 0, False: 188k]
  ------------------
 1570|      0|      load_buffer_16xn_avx2(input, in, stride, height, width_div8, 0, 1);
 1571|      0|      round_shift_32_8xn_avx2(in, size, shift[0], width_div16);
 1572|      0|      idtx16_avx2(in, out, av1_fwd_cos_bit_col[txw_idx][txh_idx], width_div8,
 1573|      0|                  width_div8);
 1574|      0|      round_shift_32_8xn_avx2(out, size, shift[1], width_div16);
 1575|      0|      fwd_txfm_transpose_16x16_avx2(out, in);
 1576|      0|      fadst16_avx2(in, out, av1_fwd_cos_bit_row[txw_idx][txh_idx], width_div8,
 1577|      0|                   width_div8);
 1578|      0|      store_buffer_avx2(out, coeff, 8, 32);
 1579|      0|      break;
 1580|      0|    default: assert(0);
  ------------------
  |  Branch (1580:5): [True: 0, False: 188k]
  ------------------
 1581|   188k|  }
 1582|   188k|  (void)bd;
 1583|   188k|}
av1_fwd_txfm2d_32x32_avx2:
 2027|  20.6k|                               int stride, TX_TYPE tx_type, int bd) {
 2028|  20.6k|  (void)bd;
 2029|  20.6k|  __m256i buf0[128], buf1[128];
 2030|  20.6k|  const int tx_size = TX_32X32;
 2031|  20.6k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 2032|  20.6k|  const int txw_idx = get_txw_idx(tx_size);
 2033|  20.6k|  const int txh_idx = get_txh_idx(tx_size);
 2034|  20.6k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2035|  20.6k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2036|  20.6k|  const int width = tx_size_wide[tx_size];
 2037|  20.6k|  const int height = tx_size_high[tx_size];
 2038|  20.6k|  const transform_1d_avx2 col_txfm = col_txfm8x32_arr[tx_type];
 2039|  20.6k|  const transform_1d_avx2 row_txfm = row_txfm8x32_arr[tx_type];
 2040|  20.6k|  int r, c;
 2041|  20.6k|  const int width_div16 = (width >> 4);
 2042|  20.6k|  const int width_div8 = (width >> 3);
 2043|       |
 2044|  61.9k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (2044:19): [True: 41.3k, False: 20.6k]
  ------------------
 2045|  41.3k|    load_buffer_16xn_avx2(input + (i << 4), &buf0[(i << 1)], stride, height,
 2046|  41.3k|                          width_div8, 0, 0);
 2047|  41.3k|    round_shift_32_8xn_avx2(&buf0[(i << 1)], height, shift[0], width_div8);
 2048|  41.3k|    round_shift_32_8xn_avx2(&buf0[(i << 1) + 1], height, shift[0], width_div8);
 2049|  41.3k|    col_txfm(&buf0[(i << 1)], &buf0[(i << 1)], cos_bit_col, width_div8,
 2050|  41.3k|             width_div8);
 2051|  41.3k|    col_txfm(&buf0[(i << 1) + 1], &buf0[(i << 1) + 1], cos_bit_col, width_div8,
 2052|  41.3k|             width_div8);
 2053|  41.3k|    round_shift_32_8xn_avx2(&buf0[(i << 1)], height, shift[1], width_div8);
 2054|  41.3k|    round_shift_32_8xn_avx2(&buf0[(i << 1) + 1], height, shift[1], width_div8);
 2055|  41.3k|  }
 2056|       |
 2057|   103k|  for (r = 0; r < height; r += 8) {
  ------------------
  |  Branch (2057:15): [True: 82.5k, False: 20.6k]
  ------------------
 2058|   412k|    for (c = 0; c < width_div8; c++) {
  ------------------
  |  Branch (2058:17): [True: 330k, False: 82.5k]
  ------------------
 2059|   330k|      fwd_txfm_transpose_8x8_avx2(&buf0[r * width_div8 + c],
 2060|   330k|                                  &buf1[c * 8 * width_div8 + (r >> 3)],
 2061|   330k|                                  width_div8, width_div8);
 2062|   330k|    }
 2063|  82.5k|  }
 2064|       |
 2065|  61.9k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (2065:19): [True: 41.3k, False: 20.6k]
  ------------------
 2066|  41.3k|    row_txfm(&buf1[(i << 1)], &buf1[(i << 1)], cos_bit_row, width_div8,
 2067|  41.3k|             width_div8);
 2068|  41.3k|    row_txfm(&buf1[(i << 1) + 1], &buf1[(i << 1) + 1], cos_bit_row, width_div8,
 2069|  41.3k|             width_div8);
 2070|  41.3k|    round_shift_32_8xn_avx2(&buf1[(i << 1)], height, shift[2], width_div8);
 2071|  41.3k|    round_shift_32_8xn_avx2(&buf1[(i << 1) + 1], height, shift[2], width_div8);
 2072|  41.3k|  }
 2073|       |
 2074|  20.6k|  store_buffer_avx2(buf1, output, 8, 128);
 2075|  20.6k|}
av1_fwd_txfm2d_64x64_avx2:
 3082|  1.34k|                               int stride, TX_TYPE tx_type, int bd) {
 3083|  1.34k|  (void)bd;
 3084|  1.34k|  (void)tx_type;
 3085|  1.34k|  assert(tx_type == DCT_DCT);
 3086|  1.34k|  const TX_SIZE tx_size = TX_64X64;
 3087|  1.34k|  __m256i buf0[512], buf1[512];
 3088|  1.34k|  const int8_t *shift = av1_fwd_txfm_shift_ls[tx_size];
 3089|  1.34k|  const int txw_idx = get_txw_idx(tx_size);
 3090|  1.34k|  const int txh_idx = get_txh_idx(tx_size);
 3091|  1.34k|  const int cos_bit_col = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 3092|  1.34k|  const int cos_bit_row = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 3093|  1.34k|  const int width = tx_size_wide[tx_size];
 3094|  1.34k|  const int height = tx_size_high[tx_size];
 3095|  1.34k|  const transform_1d_avx2 col_txfm = fdct64_avx2;
 3096|  1.34k|  const transform_1d_avx2 row_txfm = fdct64_avx2;
 3097|  1.34k|  const int width_div16 = (width >> 4);
 3098|  1.34k|  const int width_div8 = (width >> 3);
 3099|  1.34k|  int r, c;
 3100|  6.70k|  for (int i = 0; i < width_div16; i++) {
  ------------------
  |  Branch (3100:19): [True: 5.36k, False: 1.34k]
  ------------------
 3101|  5.36k|    load_buffer_16xn_avx2(input + (i << 4), &buf0[i << 1], stride, height,
 3102|  5.36k|                          width_div8, 0, 0);
 3103|  5.36k|    round_shift_32_8xn_avx2(&buf0[i << 1], height, shift[0], width_div8);
 3104|  5.36k|    round_shift_32_8xn_avx2(&buf0[(i << 1) + 1], height, shift[0], width_div8);
 3105|  5.36k|    col_txfm(&buf0[i << 1], &buf0[i << 1], cos_bit_col, width_div8, width_div8);
 3106|  5.36k|    col_txfm(&buf0[(i << 1) + 1], &buf0[(i << 1) + 1], cos_bit_col, width_div8,
 3107|  5.36k|             width_div8);
 3108|  5.36k|    round_shift_32_8xn_avx2(&buf0[i << 1], height, shift[1], width_div8);
 3109|  5.36k|    round_shift_32_8xn_avx2(&buf0[(i << 1) + 1], height, shift[1], width_div8);
 3110|  5.36k|  }
 3111|       |
 3112|  12.0k|  for (r = 0; r < height; r += 8) {
  ------------------
  |  Branch (3112:15): [True: 10.6k, False: 1.34k]
  ------------------
 3113|  96.1k|    for (c = 0; c < width_div8; c++) {
  ------------------
  |  Branch (3113:17): [True: 85.5k, False: 10.6k]
  ------------------
 3114|  85.5k|      fwd_txfm_transpose_8x8_avx2(&buf0[r * width_div8 + c],
 3115|  85.5k|                                  &buf1[c * 8 * width_div8 + (r >> 3)],
 3116|  85.5k|                                  width_div8, width_div8);
 3117|  85.5k|    }
 3118|  10.6k|  }
 3119|       |
 3120|  4.02k|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (3120:19): [True: 2.68k, False: 1.34k]
  ------------------
 3121|  2.68k|    row_txfm(&buf1[i << 1], &buf0[i << 1], cos_bit_row, width_div8,
 3122|  2.68k|             width_div16);
 3123|  2.68k|    row_txfm(&buf1[(i << 1) + 1], &buf0[(i << 1) + 1], cos_bit_row, width_div8,
 3124|  2.68k|             width_div16);
 3125|  2.68k|    round_shift_32_8xn_avx2(&buf0[i << 1], (height >> 1), shift[2],
 3126|  2.68k|                            width_div16);
 3127|  2.68k|    round_shift_32_8xn_avx2(&buf0[(i << 1) + 1], (height >> 1), shift[2],
 3128|  2.68k|                            width_div16);
 3129|  2.68k|  }
 3130|       |
 3131|  1.34k|  store_buffer_avx2(buf0, output, 8, 128);
 3132|  1.34k|}
highbd_fwd_txfm_avx2.c:load_buffer_8x8_avx2:
   25|  9.69M|                                        int shift) {
   26|  9.69M|  __m128i out1[8];
   27|  9.69M|  if (!flipud) {
  ------------------
  |  Branch (27:7): [True: 9.66M, False: 35.3k]
  ------------------
   28|  9.66M|    out1[0] = _mm_load_si128((const __m128i *)(input + 0 * stride));
   29|  9.66M|    out1[1] = _mm_load_si128((const __m128i *)(input + 1 * stride));
   30|  9.66M|    out1[2] = _mm_load_si128((const __m128i *)(input + 2 * stride));
   31|  9.66M|    out1[3] = _mm_load_si128((const __m128i *)(input + 3 * stride));
   32|  9.66M|    out1[4] = _mm_load_si128((const __m128i *)(input + 4 * stride));
   33|  9.66M|    out1[5] = _mm_load_si128((const __m128i *)(input + 5 * stride));
   34|  9.66M|    out1[6] = _mm_load_si128((const __m128i *)(input + 6 * stride));
   35|  9.66M|    out1[7] = _mm_load_si128((const __m128i *)(input + 7 * stride));
   36|       |
   37|  9.66M|  } else {
   38|  35.3k|    out1[7] = _mm_load_si128((const __m128i *)(input + 0 * stride));
   39|  35.3k|    out1[6] = _mm_load_si128((const __m128i *)(input + 1 * stride));
   40|  35.3k|    out1[5] = _mm_load_si128((const __m128i *)(input + 2 * stride));
   41|  35.3k|    out1[4] = _mm_load_si128((const __m128i *)(input + 3 * stride));
   42|  35.3k|    out1[3] = _mm_load_si128((const __m128i *)(input + 4 * stride));
   43|  35.3k|    out1[2] = _mm_load_si128((const __m128i *)(input + 5 * stride));
   44|  35.3k|    out1[1] = _mm_load_si128((const __m128i *)(input + 6 * stride));
   45|  35.3k|    out1[0] = _mm_load_si128((const __m128i *)(input + 7 * stride));
   46|  35.3k|  }
   47|  9.69M|  if (!fliplr) {
  ------------------
  |  Branch (47:7): [True: 9.65M, False: 40.7k]
  ------------------
   48|  9.65M|    out[0] = _mm256_cvtepi16_epi32(out1[0]);
   49|  9.65M|    out[1] = _mm256_cvtepi16_epi32(out1[1]);
   50|  9.65M|    out[2] = _mm256_cvtepi16_epi32(out1[2]);
   51|  9.65M|    out[3] = _mm256_cvtepi16_epi32(out1[3]);
   52|  9.65M|    out[4] = _mm256_cvtepi16_epi32(out1[4]);
   53|  9.65M|    out[5] = _mm256_cvtepi16_epi32(out1[5]);
   54|  9.65M|    out[6] = _mm256_cvtepi16_epi32(out1[6]);
   55|  9.65M|    out[7] = _mm256_cvtepi16_epi32(out1[7]);
   56|       |
   57|  9.65M|  } else {
   58|  40.7k|    out[0] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[0]));
   59|  40.7k|    out[1] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[1]));
   60|  40.7k|    out[2] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[2]));
   61|  40.7k|    out[3] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[3]));
   62|  40.7k|    out[4] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[4]));
   63|  40.7k|    out[5] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[5]));
   64|  40.7k|    out[6] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[6]));
   65|  40.7k|    out[7] = _mm256_cvtepi16_epi32(mm_reverse_epi16(out1[7]));
   66|  40.7k|  }
   67|  9.69M|  out[0] = _mm256_slli_epi32(out[0], shift);
   68|  9.69M|  out[1] = _mm256_slli_epi32(out[1], shift);
   69|  9.69M|  out[2] = _mm256_slli_epi32(out[2], shift);
   70|  9.69M|  out[3] = _mm256_slli_epi32(out[3], shift);
   71|  9.69M|  out[4] = _mm256_slli_epi32(out[4], shift);
   72|  9.69M|  out[5] = _mm256_slli_epi32(out[5], shift);
   73|  9.69M|  out[6] = _mm256_slli_epi32(out[6], shift);
   74|  9.69M|  out[7] = _mm256_slli_epi32(out[7], shift);
   75|  9.69M|}
highbd_fwd_txfm_avx2.c:fdct8_avx2:
  256|  11.5M|                       const int col_num, const int outstride) {
  257|  11.5M|  const int32_t *cospi = cospi_arr(bit);
  258|  11.5M|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  259|  11.5M|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
  260|  11.5M|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  261|  11.5M|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  262|  11.5M|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
  263|  11.5M|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
  264|  11.5M|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
  265|  11.5M|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
  266|  11.5M|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
  267|  11.5M|  __m256i u[8], v[8];
  268|  23.6M|  for (int col = 0; col < col_num; ++col) {
  ------------------
  |  Branch (268:21): [True: 12.0M, False: 11.5M]
  ------------------
  269|  12.0M|    u[0] = _mm256_add_epi32(in[0 * col_num + col], in[7 * col_num + col]);
  270|  12.0M|    v[7] = _mm256_sub_epi32(in[0 * col_num + col], in[7 * col_num + col]);
  271|  12.0M|    u[1] = _mm256_add_epi32(in[1 * col_num + col], in[6 * col_num + col]);
  272|  12.0M|    u[6] = _mm256_sub_epi32(in[1 * col_num + col], in[6 * col_num + col]);
  273|  12.0M|    u[2] = _mm256_add_epi32(in[2 * col_num + col], in[5 * col_num + col]);
  274|  12.0M|    u[5] = _mm256_sub_epi32(in[2 * col_num + col], in[5 * col_num + col]);
  275|  12.0M|    u[3] = _mm256_add_epi32(in[3 * col_num + col], in[4 * col_num + col]);
  276|  12.0M|    v[4] = _mm256_sub_epi32(in[3 * col_num + col], in[4 * col_num + col]);
  277|  12.0M|    v[0] = _mm256_add_epi32(u[0], u[3]);
  278|  12.0M|    v[3] = _mm256_sub_epi32(u[0], u[3]);
  279|  12.0M|    v[1] = _mm256_add_epi32(u[1], u[2]);
  280|  12.0M|    v[2] = _mm256_sub_epi32(u[1], u[2]);
  281|       |
  282|  12.0M|    v[5] = _mm256_mullo_epi32(u[5], cospim32);
  283|  12.0M|    v[6] = _mm256_mullo_epi32(u[6], cospi32);
  284|  12.0M|    v[5] = _mm256_add_epi32(v[5], v[6]);
  285|  12.0M|    v[5] = _mm256_add_epi32(v[5], rnding);
  286|  12.0M|    v[5] = _mm256_srai_epi32(v[5], bit);
  287|       |
  288|  12.0M|    u[0] = _mm256_mullo_epi32(u[5], cospi32);
  289|  12.0M|    v[6] = _mm256_mullo_epi32(u[6], cospim32);
  290|  12.0M|    v[6] = _mm256_sub_epi32(u[0], v[6]);
  291|  12.0M|    v[6] = _mm256_add_epi32(v[6], rnding);
  292|  12.0M|    v[6] = _mm256_srai_epi32(v[6], bit);
  293|       |
  294|       |    // stage 3
  295|       |    // type 0
  296|  12.0M|    v[0] = _mm256_mullo_epi32(v[0], cospi32);
  297|  12.0M|    v[1] = _mm256_mullo_epi32(v[1], cospi32);
  298|  12.0M|    u[0] = _mm256_add_epi32(v[0], v[1]);
  299|  12.0M|    u[0] = _mm256_add_epi32(u[0], rnding);
  300|  12.0M|    u[0] = _mm256_srai_epi32(u[0], bit);
  301|       |
  302|  12.0M|    u[1] = _mm256_sub_epi32(v[0], v[1]);
  303|  12.0M|    u[1] = _mm256_add_epi32(u[1], rnding);
  304|  12.0M|    u[1] = _mm256_srai_epi32(u[1], bit);
  305|       |
  306|       |    // type 1
  307|  12.0M|    v[0] = _mm256_mullo_epi32(v[2], cospi48);
  308|  12.0M|    v[1] = _mm256_mullo_epi32(v[3], cospi16);
  309|  12.0M|    u[2] = _mm256_add_epi32(v[0], v[1]);
  310|  12.0M|    u[2] = _mm256_add_epi32(u[2], rnding);
  311|  12.0M|    u[2] = _mm256_srai_epi32(u[2], bit);
  312|       |
  313|  12.0M|    v[0] = _mm256_mullo_epi32(v[2], cospi16);
  314|  12.0M|    v[1] = _mm256_mullo_epi32(v[3], cospi48);
  315|  12.0M|    u[3] = _mm256_sub_epi32(v[1], v[0]);
  316|  12.0M|    u[3] = _mm256_add_epi32(u[3], rnding);
  317|  12.0M|    u[3] = _mm256_srai_epi32(u[3], bit);
  318|       |
  319|  12.0M|    u[4] = _mm256_add_epi32(v[4], v[5]);
  320|  12.0M|    u[5] = _mm256_sub_epi32(v[4], v[5]);
  321|  12.0M|    u[6] = _mm256_sub_epi32(v[7], v[6]);
  322|  12.0M|    u[7] = _mm256_add_epi32(v[7], v[6]);
  323|       |
  324|       |    // stage 4
  325|       |    // stage 5
  326|  12.0M|    v[0] = _mm256_mullo_epi32(u[4], cospi56);
  327|  12.0M|    v[1] = _mm256_mullo_epi32(u[7], cospi8);
  328|  12.0M|    v[0] = _mm256_add_epi32(v[0], v[1]);
  329|  12.0M|    v[0] = _mm256_add_epi32(v[0], rnding);
  330|  12.0M|    out[1 * outstride + col] = _mm256_srai_epi32(v[0], bit);  // buf0[4]
  331|       |
  332|  12.0M|    v[0] = _mm256_mullo_epi32(u[4], cospi8);
  333|  12.0M|    v[1] = _mm256_mullo_epi32(u[7], cospi56);
  334|  12.0M|    v[0] = _mm256_sub_epi32(v[1], v[0]);
  335|  12.0M|    v[0] = _mm256_add_epi32(v[0], rnding);
  336|  12.0M|    out[7 * outstride + col] = _mm256_srai_epi32(v[0], bit);  // buf0[7]
  337|       |
  338|  12.0M|    v[0] = _mm256_mullo_epi32(u[5], cospi24);
  339|  12.0M|    v[1] = _mm256_mullo_epi32(u[6], cospi40);
  340|  12.0M|    v[0] = _mm256_add_epi32(v[0], v[1]);
  341|  12.0M|    v[0] = _mm256_add_epi32(v[0], rnding);
  342|  12.0M|    out[5 * outstride + col] = _mm256_srai_epi32(v[0], bit);  // buf0[5]
  343|       |
  344|  12.0M|    v[0] = _mm256_mullo_epi32(u[5], cospi40);
  345|  12.0M|    v[1] = _mm256_mullo_epi32(u[6], cospi24);
  346|  12.0M|    v[0] = _mm256_sub_epi32(v[1], v[0]);
  347|  12.0M|    v[0] = _mm256_add_epi32(v[0], rnding);
  348|  12.0M|    out[3 * outstride + col] = _mm256_srai_epi32(v[0], bit);  // buf0[6]
  349|       |
  350|  12.0M|    out[0 * outstride + col] = u[0];  // buf0[0]
  351|  12.0M|    out[4 * outstride + col] = u[1];  // buf0[1]
  352|  12.0M|    out[2 * outstride + col] = u[2];  // buf0[2]
  353|  12.0M|    out[6 * outstride + col] = u[3];  // buf0[3]
  354|  12.0M|  }
  355|  11.5M|}
highbd_fwd_txfm_avx2.c:col_txfm_8x8_rounding:
   76|  9.71M|static inline void col_txfm_8x8_rounding(__m256i *in, int shift) {
   77|  9.71M|  const __m256i rounding = _mm256_set1_epi32(1 << (shift - 1));
   78|       |
   79|  9.71M|  in[0] = _mm256_add_epi32(in[0], rounding);
   80|  9.71M|  in[1] = _mm256_add_epi32(in[1], rounding);
   81|  9.71M|  in[2] = _mm256_add_epi32(in[2], rounding);
   82|  9.71M|  in[3] = _mm256_add_epi32(in[3], rounding);
   83|  9.71M|  in[4] = _mm256_add_epi32(in[4], rounding);
   84|  9.71M|  in[5] = _mm256_add_epi32(in[5], rounding);
   85|  9.71M|  in[6] = _mm256_add_epi32(in[6], rounding);
   86|  9.71M|  in[7] = _mm256_add_epi32(in[7], rounding);
   87|       |
   88|  9.71M|  in[0] = _mm256_srai_epi32(in[0], shift);
   89|  9.71M|  in[1] = _mm256_srai_epi32(in[1], shift);
   90|  9.71M|  in[2] = _mm256_srai_epi32(in[2], shift);
   91|  9.71M|  in[3] = _mm256_srai_epi32(in[3], shift);
   92|  9.71M|  in[4] = _mm256_srai_epi32(in[4], shift);
   93|  9.71M|  in[5] = _mm256_srai_epi32(in[5], shift);
   94|  9.71M|  in[6] = _mm256_srai_epi32(in[6], shift);
   95|  9.71M|  in[7] = _mm256_srai_epi32(in[7], shift);
   96|  9.71M|}
highbd_fwd_txfm_avx2.c:fwd_txfm_transpose_8x8_avx2:
  146|  11.7M|                                        const int outstride) {
  147|  11.7M|  __m256i u0, u1, u2, u3, u4, u5, u6, u7;
  148|  11.7M|  __m256i x0, x1;
  149|       |
  150|  11.7M|  u0 = _mm256_unpacklo_epi32(in[0 * instride], in[1 * instride]);
  151|  11.7M|  u1 = _mm256_unpackhi_epi32(in[0 * instride], in[1 * instride]);
  152|       |
  153|  11.7M|  u2 = _mm256_unpacklo_epi32(in[2 * instride], in[3 * instride]);
  154|  11.7M|  u3 = _mm256_unpackhi_epi32(in[2 * instride], in[3 * instride]);
  155|       |
  156|  11.7M|  u4 = _mm256_unpacklo_epi32(in[4 * instride], in[5 * instride]);
  157|  11.7M|  u5 = _mm256_unpackhi_epi32(in[4 * instride], in[5 * instride]);
  158|       |
  159|  11.7M|  u6 = _mm256_unpacklo_epi32(in[6 * instride], in[7 * instride]);
  160|  11.7M|  u7 = _mm256_unpackhi_epi32(in[6 * instride], in[7 * instride]);
  161|       |
  162|  11.7M|  x0 = _mm256_unpacklo_epi64(u0, u2);
  163|  11.7M|  x1 = _mm256_unpacklo_epi64(u4, u6);
  164|  11.7M|  out[0 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x20);
  165|  11.7M|  out[4 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x31);
  166|       |
  167|  11.7M|  x0 = _mm256_unpackhi_epi64(u0, u2);
  168|  11.7M|  x1 = _mm256_unpackhi_epi64(u4, u6);
  169|  11.7M|  out[1 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x20);
  170|  11.7M|  out[5 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x31);
  171|       |
  172|  11.7M|  x0 = _mm256_unpacklo_epi64(u1, u3);
  173|  11.7M|  x1 = _mm256_unpacklo_epi64(u5, u7);
  174|  11.7M|  out[2 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x20);
  175|  11.7M|  out[6 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x31);
  176|       |
  177|  11.7M|  x0 = _mm256_unpackhi_epi64(u1, u3);
  178|  11.7M|  x1 = _mm256_unpackhi_epi64(u5, u7);
  179|  11.7M|  out[3 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x20);
  180|       |  out[7 * outstride] = _mm256_permute2f128_si256(x0, x1, 0x31);
  181|  11.7M|}
highbd_fwd_txfm_avx2.c:store_buffer_avx2:
  198|  9.92M|                                     const int stride, const int out_size) {
  199|   103M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (199:19): [True: 93.3M, False: 9.92M]
  ------------------
  200|  93.3M|    _mm256_store_si256((__m256i *)(out), in[i]);
  201|  93.3M|    out += stride;
  202|  93.3M|  }
  203|  9.92M|}
highbd_fwd_txfm_avx2.c:fadst8_avx2:
  357|  5.67M|                        const int col_num, const int outstirde) {
  358|  5.67M|  (void)col_num;
  359|  5.67M|  const int32_t *cospi = cospi_arr(bit);
  360|  5.67M|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  361|  5.67M|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  362|  5.67M|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
  363|  5.67M|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  364|  5.67M|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
  365|  5.67M|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
  366|  5.67M|  const __m256i cospim4 = _mm256_set1_epi32(-cospi[4]);
  367|  5.67M|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
  368|  5.67M|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
  369|  5.67M|  const __m256i cospim20 = _mm256_set1_epi32(-cospi[20]);
  370|  5.67M|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
  371|  5.67M|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
  372|  5.67M|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
  373|  5.67M|  const __m256i cospim36 = _mm256_set1_epi32(-cospi[36]);
  374|  5.67M|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
  375|  5.67M|  const __m256i cospim52 = _mm256_set1_epi32(-cospi[52]);
  376|  5.67M|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
  377|  5.67M|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
  378|  5.67M|  const __m256i zero = _mm256_setzero_si256();
  379|  5.67M|  __m256i u0, u1, u2, u3, u4, u5, u6, u7;
  380|  5.67M|  __m256i v0, v1, v2, v3, v4, v5, v6, v7;
  381|  5.67M|  __m256i x, y;
  382|  11.5M|  for (int col = 0; col < col_num; ++col) {
  ------------------
  |  Branch (382:21): [True: 5.89M, False: 5.67M]
  ------------------
  383|  5.89M|    u0 = in[0 * col_num + col];
  384|  5.89M|    u1 = _mm256_sub_epi32(zero, in[7 * col_num + col]);
  385|  5.89M|    u2 = _mm256_sub_epi32(zero, in[3 * col_num + col]);
  386|  5.89M|    u3 = in[4 * col_num + col];
  387|  5.89M|    u4 = _mm256_sub_epi32(zero, in[1 * col_num + col]);
  388|  5.89M|    u5 = in[6 * col_num + col];
  389|  5.89M|    u6 = in[2 * col_num + col];
  390|  5.89M|    u7 = _mm256_sub_epi32(zero, in[5 * col_num + col]);
  391|       |
  392|       |    // stage 2
  393|  5.89M|    v0 = u0;
  394|  5.89M|    v1 = u1;
  395|       |
  396|  5.89M|    x = _mm256_mullo_epi32(u2, cospi32);
  397|  5.89M|    y = _mm256_mullo_epi32(u3, cospi32);
  398|  5.89M|    v2 = _mm256_add_epi32(x, y);
  399|  5.89M|    v2 = _mm256_add_epi32(v2, rnding);
  400|  5.89M|    v2 = _mm256_srai_epi32(v2, bit);
  401|       |
  402|  5.89M|    v3 = _mm256_sub_epi32(x, y);
  403|  5.89M|    v3 = _mm256_add_epi32(v3, rnding);
  404|  5.89M|    v3 = _mm256_srai_epi32(v3, bit);
  405|       |
  406|  5.89M|    v4 = u4;
  407|  5.89M|    v5 = u5;
  408|       |
  409|  5.89M|    x = _mm256_mullo_epi32(u6, cospi32);
  410|  5.89M|    y = _mm256_mullo_epi32(u7, cospi32);
  411|  5.89M|    v6 = _mm256_add_epi32(x, y);
  412|  5.89M|    v6 = _mm256_add_epi32(v6, rnding);
  413|  5.89M|    v6 = _mm256_srai_epi32(v6, bit);
  414|       |
  415|  5.89M|    v7 = _mm256_sub_epi32(x, y);
  416|  5.89M|    v7 = _mm256_add_epi32(v7, rnding);
  417|  5.89M|    v7 = _mm256_srai_epi32(v7, bit);
  418|       |
  419|       |    // stage 3
  420|  5.89M|    u0 = _mm256_add_epi32(v0, v2);
  421|  5.89M|    u1 = _mm256_add_epi32(v1, v3);
  422|  5.89M|    u2 = _mm256_sub_epi32(v0, v2);
  423|  5.89M|    u3 = _mm256_sub_epi32(v1, v3);
  424|  5.89M|    u4 = _mm256_add_epi32(v4, v6);
  425|  5.89M|    u5 = _mm256_add_epi32(v5, v7);
  426|  5.89M|    u6 = _mm256_sub_epi32(v4, v6);
  427|  5.89M|    u7 = _mm256_sub_epi32(v5, v7);
  428|       |
  429|       |    // stage 4
  430|  5.89M|    v0 = u0;
  431|  5.89M|    v1 = u1;
  432|  5.89M|    v2 = u2;
  433|  5.89M|    v3 = u3;
  434|       |
  435|  5.89M|    x = _mm256_mullo_epi32(u4, cospi16);
  436|  5.89M|    y = _mm256_mullo_epi32(u5, cospi48);
  437|  5.89M|    v4 = _mm256_add_epi32(x, y);
  438|  5.89M|    v4 = _mm256_add_epi32(v4, rnding);
  439|  5.89M|    v4 = _mm256_srai_epi32(v4, bit);
  440|       |
  441|  5.89M|    x = _mm256_mullo_epi32(u4, cospi48);
  442|  5.89M|    y = _mm256_mullo_epi32(u5, cospim16);
  443|  5.89M|    v5 = _mm256_add_epi32(x, y);
  444|  5.89M|    v5 = _mm256_add_epi32(v5, rnding);
  445|  5.89M|    v5 = _mm256_srai_epi32(v5, bit);
  446|       |
  447|  5.89M|    x = _mm256_mullo_epi32(u6, cospim48);
  448|  5.89M|    y = _mm256_mullo_epi32(u7, cospi16);
  449|  5.89M|    v6 = _mm256_add_epi32(x, y);
  450|  5.89M|    v6 = _mm256_add_epi32(v6, rnding);
  451|  5.89M|    v6 = _mm256_srai_epi32(v6, bit);
  452|       |
  453|  5.89M|    x = _mm256_mullo_epi32(u6, cospi16);
  454|  5.89M|    y = _mm256_mullo_epi32(u7, cospi48);
  455|  5.89M|    v7 = _mm256_add_epi32(x, y);
  456|  5.89M|    v7 = _mm256_add_epi32(v7, rnding);
  457|  5.89M|    v7 = _mm256_srai_epi32(v7, bit);
  458|       |
  459|       |    // stage 5
  460|  5.89M|    u0 = _mm256_add_epi32(v0, v4);
  461|  5.89M|    u1 = _mm256_add_epi32(v1, v5);
  462|  5.89M|    u2 = _mm256_add_epi32(v2, v6);
  463|  5.89M|    u3 = _mm256_add_epi32(v3, v7);
  464|  5.89M|    u4 = _mm256_sub_epi32(v0, v4);
  465|  5.89M|    u5 = _mm256_sub_epi32(v1, v5);
  466|  5.89M|    u6 = _mm256_sub_epi32(v2, v6);
  467|  5.89M|    u7 = _mm256_sub_epi32(v3, v7);
  468|       |
  469|       |    // stage 6
  470|  5.89M|    x = _mm256_mullo_epi32(u0, cospi4);
  471|  5.89M|    y = _mm256_mullo_epi32(u1, cospi60);
  472|  5.89M|    v0 = _mm256_add_epi32(x, y);
  473|  5.89M|    v0 = _mm256_add_epi32(v0, rnding);
  474|  5.89M|    v0 = _mm256_srai_epi32(v0, bit);
  475|       |
  476|  5.89M|    x = _mm256_mullo_epi32(u0, cospi60);
  477|  5.89M|    y = _mm256_mullo_epi32(u1, cospim4);
  478|  5.89M|    v1 = _mm256_add_epi32(x, y);
  479|  5.89M|    v1 = _mm256_add_epi32(v1, rnding);
  480|  5.89M|    v1 = _mm256_srai_epi32(v1, bit);
  481|       |
  482|  5.89M|    x = _mm256_mullo_epi32(u2, cospi20);
  483|  5.89M|    y = _mm256_mullo_epi32(u3, cospi44);
  484|  5.89M|    v2 = _mm256_add_epi32(x, y);
  485|  5.89M|    v2 = _mm256_add_epi32(v2, rnding);
  486|  5.89M|    v2 = _mm256_srai_epi32(v2, bit);
  487|       |
  488|  5.89M|    x = _mm256_mullo_epi32(u2, cospi44);
  489|  5.89M|    y = _mm256_mullo_epi32(u3, cospim20);
  490|  5.89M|    v3 = _mm256_add_epi32(x, y);
  491|  5.89M|    v3 = _mm256_add_epi32(v3, rnding);
  492|  5.89M|    v3 = _mm256_srai_epi32(v3, bit);
  493|       |
  494|  5.89M|    x = _mm256_mullo_epi32(u4, cospi36);
  495|  5.89M|    y = _mm256_mullo_epi32(u5, cospi28);
  496|  5.89M|    v4 = _mm256_add_epi32(x, y);
  497|  5.89M|    v4 = _mm256_add_epi32(v4, rnding);
  498|  5.89M|    v4 = _mm256_srai_epi32(v4, bit);
  499|       |
  500|  5.89M|    x = _mm256_mullo_epi32(u4, cospi28);
  501|  5.89M|    y = _mm256_mullo_epi32(u5, cospim36);
  502|  5.89M|    v5 = _mm256_add_epi32(x, y);
  503|  5.89M|    v5 = _mm256_add_epi32(v5, rnding);
  504|  5.89M|    v5 = _mm256_srai_epi32(v5, bit);
  505|       |
  506|  5.89M|    x = _mm256_mullo_epi32(u6, cospi52);
  507|  5.89M|    y = _mm256_mullo_epi32(u7, cospi12);
  508|  5.89M|    v6 = _mm256_add_epi32(x, y);
  509|  5.89M|    v6 = _mm256_add_epi32(v6, rnding);
  510|  5.89M|    v6 = _mm256_srai_epi32(v6, bit);
  511|       |
  512|  5.89M|    x = _mm256_mullo_epi32(u6, cospi12);
  513|  5.89M|    y = _mm256_mullo_epi32(u7, cospim52);
  514|  5.89M|    v7 = _mm256_add_epi32(x, y);
  515|  5.89M|    v7 = _mm256_add_epi32(v7, rnding);
  516|  5.89M|    v7 = _mm256_srai_epi32(v7, bit);
  517|       |
  518|       |    // stage 7
  519|  5.89M|    out[0 * outstirde + col] = v1;
  520|  5.89M|    out[1 * outstirde + col] = v6;
  521|  5.89M|    out[2 * outstirde + col] = v3;
  522|  5.89M|    out[3 * outstirde + col] = v4;
  523|  5.89M|    out[4 * outstirde + col] = v5;
  524|  5.89M|    out[5 * outstirde + col] = v2;
  525|  5.89M|    out[6 * outstirde + col] = v7;
  526|  5.89M|    out[7 * outstirde + col] = v0;
  527|  5.89M|  }
  528|  5.67M|}
highbd_fwd_txfm_avx2.c:idtx8_avx2:
  530|  1.38M|                       int outstride) {
  531|  1.38M|  (void)bit;
  532|  1.38M|  (void)outstride;
  533|  1.38M|  int num_iters = 8 * col_num;
  534|  2.80M|  for (int i = 0; i < num_iters; i += 8) {
  ------------------
  |  Branch (534:19): [True: 1.42M, False: 1.38M]
  ------------------
  535|  1.42M|    out[i] = _mm256_add_epi32(in[i], in[i]);
  536|  1.42M|    out[i + 1] = _mm256_add_epi32(in[i + 1], in[i + 1]);
  537|  1.42M|    out[i + 2] = _mm256_add_epi32(in[i + 2], in[i + 2]);
  538|  1.42M|    out[i + 3] = _mm256_add_epi32(in[i + 3], in[i + 3]);
  539|  1.42M|    out[i + 4] = _mm256_add_epi32(in[i + 4], in[i + 4]);
  540|  1.42M|    out[i + 5] = _mm256_add_epi32(in[i + 5], in[i + 5]);
  541|  1.42M|    out[i + 6] = _mm256_add_epi32(in[i + 6], in[i + 6]);
  542|  1.42M|    out[i + 7] = _mm256_add_epi32(in[i + 7], in[i + 7]);
  543|  1.42M|  }
  544|  1.38M|}
highbd_fwd_txfm_avx2.c:load_buffer_8x16_avx2:
   99|   423k|                                         int shift) {
  100|   423k|  const int16_t *topL = input;
  101|   423k|  const int16_t *botL = input + 8 * stride;
  102|       |
  103|   423k|  const int16_t *tmp;
  104|       |
  105|   423k|  if (flipud) {
  ------------------
  |  Branch (105:7): [True: 2.01k, False: 420k]
  ------------------
  106|  2.01k|    tmp = topL;
  107|  2.01k|    topL = botL;
  108|  2.01k|    botL = tmp;
  109|  2.01k|  }
  110|   423k|  load_buffer_8x8_avx2(topL, out, stride, flipud, fliplr, shift);
  111|   423k|  load_buffer_8x8_avx2(botL, out + 8, stride, flipud, fliplr, shift);
  112|   423k|}
highbd_fwd_txfm_avx2.c:load_buffer_16xn_avx2:
  115|   653k|                                         int flipud, int fliplr) {
  116|   653k|  __m256i out1[64];
  117|   653k|  if (!flipud) {
  ------------------
  |  Branch (117:7): [True: 648k, False: 5.08k]
  ------------------
  118|  8.59M|    for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (118:21): [True: 7.94M, False: 648k]
  ------------------
  119|  7.94M|      out1[i] = _mm256_loadu_si256((const __m256i *)(input + i * stride));
  120|  7.94M|    }
  121|   648k|  } else {
  122|  81.3k|    for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (122:21): [True: 76.2k, False: 5.08k]
  ------------------
  123|  76.2k|      out1[(height - 1) - i] =
  124|  76.2k|          _mm256_loadu_si256((const __m256i *)(input + i * stride));
  125|  76.2k|    }
  126|  5.08k|  }
  127|   653k|  if (!fliplr) {
  ------------------
  |  Branch (127:7): [True: 647k, False: 6.52k]
  ------------------
  128|  8.58M|    for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (128:21): [True: 7.93M, False: 647k]
  ------------------
  129|  7.93M|      out[i * outstride] =
  130|  7.93M|          _mm256_cvtepi16_epi32(_mm256_castsi256_si128(out1[i]));
  131|  7.93M|      out[i * outstride + 1] =
  132|  7.93M|          _mm256_cvtepi16_epi32(_mm256_extractf128_si256(out1[i], 1));
  133|  7.93M|    }
  134|   647k|  } else {
  135|  95.0k|    for (int i = 0; i < height; i++) {
  ------------------
  |  Branch (135:21): [True: 88.5k, False: 6.52k]
  ------------------
  136|  88.5k|      out[i * outstride + 1] = _mm256_cvtepi16_epi32(
  137|  88.5k|          mm_reverse_epi16(_mm256_castsi256_si128(out1[i])));
  138|  88.5k|      out[i * outstride + 0] = _mm256_cvtepi16_epi32(
  139|       |          mm_reverse_epi16(_mm256_extractf128_si256(out1[i], 1)));
  140|  88.5k|    }
  141|  6.52k|  }
  142|   653k|}
highbd_fwd_txfm_avx2.c:round_shift_32_8xn_avx2:
  183|  10.4M|                                           int stride) {
  184|  10.4M|  if (bit < 0) {
  ------------------
  |  Branch (184:7): [True: 9.64M, False: 762k]
  ------------------
  185|  9.64M|    bit = -bit;
  186|  9.64M|    __m256i round = _mm256_set1_epi32(1 << (bit - 1));
  187|  34.7M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (187:21): [True: 25.1M, False: 9.64M]
  ------------------
  188|  25.1M|      in[stride * i] = _mm256_add_epi32(in[stride * i], round);
  189|  25.1M|      in[stride * i] = _mm256_srai_epi32(in[stride * i], bit);
  190|  25.1M|    }
  191|  9.64M|  } else if (bit > 0) {
  ------------------
  |  Branch (191:14): [True: 690k, False: 72.4k]
  ------------------
  192|  16.0M|    for (int i = 0; i < size; ++i) {
  ------------------
  |  Branch (192:21): [True: 15.3M, False: 690k]
  ------------------
  193|  15.3M|      in[stride * i] = _mm256_slli_epi32(in[stride * i], bit);
  194|  15.3M|    }
  195|   690k|  }
  196|  10.4M|}
highbd_fwd_txfm_avx2.c:fdct16_avx2:
  722|   790k|                        const int col_num, const int outstride) {
  723|   790k|  const int32_t *cospi = cospi_arr(bit);
  724|   790k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
  725|   790k|  const __m256i cospim32 = _mm256_set1_epi32(-cospi[32]);
  726|   790k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
  727|   790k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
  728|   790k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
  729|   790k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
  730|   790k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
  731|   790k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
  732|   790k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
  733|   790k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
  734|   790k|  const __m256i cospi60 = _mm256_set1_epi32(cospi[60]);
  735|   790k|  const __m256i cospi4 = _mm256_set1_epi32(cospi[4]);
  736|   790k|  const __m256i cospi28 = _mm256_set1_epi32(cospi[28]);
  737|   790k|  const __m256i cospi36 = _mm256_set1_epi32(cospi[36]);
  738|   790k|  const __m256i cospi44 = _mm256_set1_epi32(cospi[44]);
  739|   790k|  const __m256i cospi20 = _mm256_set1_epi32(cospi[20]);
  740|   790k|  const __m256i cospi12 = _mm256_set1_epi32(cospi[12]);
  741|   790k|  const __m256i cospi52 = _mm256_set1_epi32(cospi[52]);
  742|   790k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
  743|   790k|  __m256i u[16], v[16], x;
  744|   790k|  int col;
  745|       |
  746|       |  // Calculate the column 0, 1, 2, 3
  747|  1.79M|  for (col = 0; col < col_num; ++col) {
  ------------------
  |  Branch (747:17): [True: 1.00M, False: 790k]
  ------------------
  748|       |    // stage 0
  749|       |    // stage 1
  750|  1.00M|    u[0] = _mm256_add_epi32(in[0 * col_num + col], in[15 * col_num + col]);
  751|  1.00M|    u[15] = _mm256_sub_epi32(in[0 * col_num + col], in[15 * col_num + col]);
  752|  1.00M|    u[1] = _mm256_add_epi32(in[1 * col_num + col], in[14 * col_num + col]);
  753|  1.00M|    u[14] = _mm256_sub_epi32(in[1 * col_num + col], in[14 * col_num + col]);
  754|  1.00M|    u[2] = _mm256_add_epi32(in[2 * col_num + col], in[13 * col_num + col]);
  755|  1.00M|    u[13] = _mm256_sub_epi32(in[2 * col_num + col], in[13 * col_num + col]);
  756|  1.00M|    u[3] = _mm256_add_epi32(in[3 * col_num + col], in[12 * col_num + col]);
  757|  1.00M|    u[12] = _mm256_sub_epi32(in[3 * col_num + col], in[12 * col_num + col]);
  758|  1.00M|    u[4] = _mm256_add_epi32(in[4 * col_num + col], in[11 * col_num + col]);
  759|  1.00M|    u[11] = _mm256_sub_epi32(in[4 * col_num + col], in[11 * col_num + col]);
  760|  1.00M|    u[5] = _mm256_add_epi32(in[5 * col_num + col], in[10 * col_num + col]);
  761|  1.00M|    u[10] = _mm256_sub_epi32(in[5 * col_num + col], in[10 * col_num + col]);
  762|  1.00M|    u[6] = _mm256_add_epi32(in[6 * col_num + col], in[9 * col_num + col]);
  763|  1.00M|    u[9] = _mm256_sub_epi32(in[6 * col_num + col], in[9 * col_num + col]);
  764|  1.00M|    u[7] = _mm256_add_epi32(in[7 * col_num + col], in[8 * col_num + col]);
  765|  1.00M|    u[8] = _mm256_sub_epi32(in[7 * col_num + col], in[8 * col_num + col]);
  766|       |
  767|       |    // stage 2
  768|  1.00M|    v[0] = _mm256_add_epi32(u[0], u[7]);
  769|  1.00M|    v[7] = _mm256_sub_epi32(u[0], u[7]);
  770|  1.00M|    v[1] = _mm256_add_epi32(u[1], u[6]);
  771|  1.00M|    v[6] = _mm256_sub_epi32(u[1], u[6]);
  772|  1.00M|    v[2] = _mm256_add_epi32(u[2], u[5]);
  773|  1.00M|    v[5] = _mm256_sub_epi32(u[2], u[5]);
  774|  1.00M|    v[3] = _mm256_add_epi32(u[3], u[4]);
  775|  1.00M|    v[4] = _mm256_sub_epi32(u[3], u[4]);
  776|  1.00M|    v[8] = u[8];
  777|  1.00M|    v[9] = u[9];
  778|       |
  779|  1.00M|    v[10] = _mm256_mullo_epi32(u[10], cospim32);
  780|  1.00M|    x = _mm256_mullo_epi32(u[13], cospi32);
  781|  1.00M|    v[10] = _mm256_add_epi32(v[10], x);
  782|  1.00M|    v[10] = _mm256_add_epi32(v[10], rnding);
  783|  1.00M|    v[10] = _mm256_srai_epi32(v[10], bit);
  784|       |
  785|  1.00M|    v[13] = _mm256_mullo_epi32(u[10], cospi32);
  786|  1.00M|    x = _mm256_mullo_epi32(u[13], cospim32);
  787|  1.00M|    v[13] = _mm256_sub_epi32(v[13], x);
  788|  1.00M|    v[13] = _mm256_add_epi32(v[13], rnding);
  789|  1.00M|    v[13] = _mm256_srai_epi32(v[13], bit);
  790|       |
  791|  1.00M|    v[11] = _mm256_mullo_epi32(u[11], cospim32);
  792|  1.00M|    x = _mm256_mullo_epi32(u[12], cospi32);
  793|  1.00M|    v[11] = _mm256_add_epi32(v[11], x);
  794|  1.00M|    v[11] = _mm256_add_epi32(v[11], rnding);
  795|  1.00M|    v[11] = _mm256_srai_epi32(v[11], bit);
  796|       |
  797|  1.00M|    v[12] = _mm256_mullo_epi32(u[11], cospi32);
  798|  1.00M|    x = _mm256_mullo_epi32(u[12], cospim32);
  799|  1.00M|    v[12] = _mm256_sub_epi32(v[12], x);
  800|  1.00M|    v[12] = _mm256_add_epi32(v[12], rnding);
  801|  1.00M|    v[12] = _mm256_srai_epi32(v[12], bit);
  802|  1.00M|    v[14] = u[14];
  803|  1.00M|    v[15] = u[15];
  804|       |
  805|       |    // stage 3
  806|  1.00M|    u[0] = _mm256_add_epi32(v[0], v[3]);
  807|  1.00M|    u[3] = _mm256_sub_epi32(v[0], v[3]);
  808|  1.00M|    u[1] = _mm256_add_epi32(v[1], v[2]);
  809|  1.00M|    u[2] = _mm256_sub_epi32(v[1], v[2]);
  810|  1.00M|    u[4] = v[4];
  811|       |
  812|  1.00M|    u[5] = _mm256_mullo_epi32(v[5], cospim32);
  813|  1.00M|    x = _mm256_mullo_epi32(v[6], cospi32);
  814|  1.00M|    u[5] = _mm256_add_epi32(u[5], x);
  815|  1.00M|    u[5] = _mm256_add_epi32(u[5], rnding);
  816|  1.00M|    u[5] = _mm256_srai_epi32(u[5], bit);
  817|       |
  818|  1.00M|    u[6] = _mm256_mullo_epi32(v[5], cospi32);
  819|  1.00M|    x = _mm256_mullo_epi32(v[6], cospim32);
  820|  1.00M|    u[6] = _mm256_sub_epi32(u[6], x);
  821|  1.00M|    u[6] = _mm256_add_epi32(u[6], rnding);
  822|  1.00M|    u[6] = _mm256_srai_epi32(u[6], bit);
  823|       |
  824|  1.00M|    u[7] = v[7];
  825|  1.00M|    u[8] = _mm256_add_epi32(v[8], v[11]);
  826|  1.00M|    u[11] = _mm256_sub_epi32(v[8], v[11]);
  827|  1.00M|    u[9] = _mm256_add_epi32(v[9], v[10]);
  828|  1.00M|    u[10] = _mm256_sub_epi32(v[9], v[10]);
  829|  1.00M|    u[12] = _mm256_sub_epi32(v[15], v[12]);
  830|  1.00M|    u[15] = _mm256_add_epi32(v[15], v[12]);
  831|  1.00M|    u[13] = _mm256_sub_epi32(v[14], v[13]);
  832|  1.00M|    u[14] = _mm256_add_epi32(v[14], v[13]);
  833|       |
  834|       |    // stage 4
  835|  1.00M|    u[0] = _mm256_mullo_epi32(u[0], cospi32);
  836|  1.00M|    u[1] = _mm256_mullo_epi32(u[1], cospi32);
  837|  1.00M|    v[0] = _mm256_add_epi32(u[0], u[1]);
  838|  1.00M|    v[0] = _mm256_add_epi32(v[0], rnding);
  839|  1.00M|    v[0] = _mm256_srai_epi32(v[0], bit);
  840|       |
  841|  1.00M|    v[1] = _mm256_sub_epi32(u[0], u[1]);
  842|  1.00M|    v[1] = _mm256_add_epi32(v[1], rnding);
  843|  1.00M|    v[1] = _mm256_srai_epi32(v[1], bit);
  844|       |
  845|  1.00M|    v[2] = _mm256_mullo_epi32(u[2], cospi48);
  846|  1.00M|    x = _mm256_mullo_epi32(u[3], cospi16);
  847|  1.00M|    v[2] = _mm256_add_epi32(v[2], x);
  848|  1.00M|    v[2] = _mm256_add_epi32(v[2], rnding);
  849|  1.00M|    v[2] = _mm256_srai_epi32(v[2], bit);
  850|       |
  851|  1.00M|    v[3] = _mm256_mullo_epi32(u[2], cospi16);
  852|  1.00M|    x = _mm256_mullo_epi32(u[3], cospi48);
  853|  1.00M|    v[3] = _mm256_sub_epi32(x, v[3]);
  854|  1.00M|    v[3] = _mm256_add_epi32(v[3], rnding);
  855|  1.00M|    v[3] = _mm256_srai_epi32(v[3], bit);
  856|       |
  857|  1.00M|    v[4] = _mm256_add_epi32(u[4], u[5]);
  858|  1.00M|    v[5] = _mm256_sub_epi32(u[4], u[5]);
  859|  1.00M|    v[6] = _mm256_sub_epi32(u[7], u[6]);
  860|  1.00M|    v[7] = _mm256_add_epi32(u[7], u[6]);
  861|  1.00M|    v[8] = u[8];
  862|       |
  863|  1.00M|    v[9] = _mm256_mullo_epi32(u[9], cospim16);
  864|  1.00M|    x = _mm256_mullo_epi32(u[14], cospi48);
  865|  1.00M|    v[9] = _mm256_add_epi32(v[9], x);
  866|  1.00M|    v[9] = _mm256_add_epi32(v[9], rnding);
  867|  1.00M|    v[9] = _mm256_srai_epi32(v[9], bit);
  868|       |
  869|  1.00M|    v[14] = _mm256_mullo_epi32(u[9], cospi48);
  870|  1.00M|    x = _mm256_mullo_epi32(u[14], cospim16);
  871|  1.00M|    v[14] = _mm256_sub_epi32(v[14], x);
  872|  1.00M|    v[14] = _mm256_add_epi32(v[14], rnding);
  873|  1.00M|    v[14] = _mm256_srai_epi32(v[14], bit);
  874|       |
  875|  1.00M|    v[10] = _mm256_mullo_epi32(u[10], cospim48);
  876|  1.00M|    x = _mm256_mullo_epi32(u[13], cospim16);
  877|  1.00M|    v[10] = _mm256_add_epi32(v[10], x);
  878|  1.00M|    v[10] = _mm256_add_epi32(v[10], rnding);
  879|  1.00M|    v[10] = _mm256_srai_epi32(v[10], bit);
  880|       |
  881|  1.00M|    v[13] = _mm256_mullo_epi32(u[10], cospim16);
  882|  1.00M|    x = _mm256_mullo_epi32(u[13], cospim48);
  883|  1.00M|    v[13] = _mm256_sub_epi32(v[13], x);
  884|  1.00M|    v[13] = _mm256_add_epi32(v[13], rnding);
  885|  1.00M|    v[13] = _mm256_srai_epi32(v[13], bit);
  886|       |
  887|  1.00M|    v[11] = u[11];
  888|  1.00M|    v[12] = u[12];
  889|  1.00M|    v[15] = u[15];
  890|       |
  891|       |    // stage 5
  892|  1.00M|    u[0] = v[0];
  893|  1.00M|    u[1] = v[1];
  894|  1.00M|    u[2] = v[2];
  895|  1.00M|    u[3] = v[3];
  896|       |
  897|  1.00M|    u[4] = _mm256_mullo_epi32(v[4], cospi56);
  898|  1.00M|    x = _mm256_mullo_epi32(v[7], cospi8);
  899|  1.00M|    u[4] = _mm256_add_epi32(u[4], x);
  900|  1.00M|    u[4] = _mm256_add_epi32(u[4], rnding);
  901|  1.00M|    u[4] = _mm256_srai_epi32(u[4], bit);
  902|       |
  903|  1.00M|    u[7] = _mm256_mullo_epi32(v[4], cospi8);
  904|  1.00M|    x = _mm256_mullo_epi32(v[7], cospi56);
  905|  1.00M|    u[7] = _mm256_sub_epi32(x, u[7]);
  906|  1.00M|    u[7] = _mm256_add_epi32(u[7], rnding);
  907|  1.00M|    u[7] = _mm256_srai_epi32(u[7], bit);
  908|       |
  909|  1.00M|    u[5] = _mm256_mullo_epi32(v[5], cospi24);
  910|  1.00M|    x = _mm256_mullo_epi32(v[6], cospi40);
  911|  1.00M|    u[5] = _mm256_add_epi32(u[5], x);
  912|  1.00M|    u[5] = _mm256_add_epi32(u[5], rnding);
  913|  1.00M|    u[5] = _mm256_srai_epi32(u[5], bit);
  914|       |
  915|  1.00M|    u[6] = _mm256_mullo_epi32(v[5], cospi40);
  916|  1.00M|    x = _mm256_mullo_epi32(v[6], cospi24);
  917|  1.00M|    u[6] = _mm256_sub_epi32(x, u[6]);
  918|  1.00M|    u[6] = _mm256_add_epi32(u[6], rnding);
  919|  1.00M|    u[6] = _mm256_srai_epi32(u[6], bit);
  920|       |
  921|  1.00M|    u[8] = _mm256_add_epi32(v[8], v[9]);
  922|  1.00M|    u[9] = _mm256_sub_epi32(v[8], v[9]);
  923|  1.00M|    u[10] = _mm256_sub_epi32(v[11], v[10]);
  924|  1.00M|    u[11] = _mm256_add_epi32(v[11], v[10]);
  925|  1.00M|    u[12] = _mm256_add_epi32(v[12], v[13]);
  926|  1.00M|    u[13] = _mm256_sub_epi32(v[12], v[13]);
  927|  1.00M|    u[14] = _mm256_sub_epi32(v[15], v[14]);
  928|  1.00M|    u[15] = _mm256_add_epi32(v[15], v[14]);
  929|       |
  930|       |    // stage 6
  931|  1.00M|    v[0] = u[0];
  932|  1.00M|    v[1] = u[1];
  933|  1.00M|    v[2] = u[2];
  934|  1.00M|    v[3] = u[3];
  935|  1.00M|    v[4] = u[4];
  936|  1.00M|    v[5] = u[5];
  937|  1.00M|    v[6] = u[6];
  938|  1.00M|    v[7] = u[7];
  939|       |
  940|  1.00M|    v[8] = _mm256_mullo_epi32(u[8], cospi60);
  941|  1.00M|    x = _mm256_mullo_epi32(u[15], cospi4);
  942|  1.00M|    v[8] = _mm256_add_epi32(v[8], x);
  943|  1.00M|    v[8] = _mm256_add_epi32(v[8], rnding);
  944|  1.00M|    v[8] = _mm256_srai_epi32(v[8], bit);
  945|       |
  946|  1.00M|    v[15] = _mm256_mullo_epi32(u[8], cospi4);
  947|  1.00M|    x = _mm256_mullo_epi32(u[15], cospi60);
  948|  1.00M|    v[15] = _mm256_sub_epi32(x, v[15]);
  949|  1.00M|    v[15] = _mm256_add_epi32(v[15], rnding);
  950|  1.00M|    v[15] = _mm256_srai_epi32(v[15], bit);
  951|       |
  952|  1.00M|    v[9] = _mm256_mullo_epi32(u[9], cospi28);
  953|  1.00M|    x = _mm256_mullo_epi32(u[14], cospi36);
  954|  1.00M|    v[9] = _mm256_add_epi32(v[9], x);
  955|  1.00M|    v[9] = _mm256_add_epi32(v[9], rnding);
  956|  1.00M|    v[9] = _mm256_srai_epi32(v[9], bit);
  957|       |
  958|  1.00M|    v[14] = _mm256_mullo_epi32(u[9], cospi36);
  959|  1.00M|    x = _mm256_mullo_epi32(u[14], cospi28);
  960|  1.00M|    v[14] = _mm256_sub_epi32(x, v[14]);
  961|  1.00M|    v[14] = _mm256_add_epi32(v[14], rnding);
  962|  1.00M|    v[14] = _mm256_srai_epi32(v[14], bit);
  963|       |
  964|  1.00M|    v[10] = _mm256_mullo_epi32(u[10], cospi44);
  965|  1.00M|    x = _mm256_mullo_epi32(u[13], cospi20);
  966|  1.00M|    v[10] = _mm256_add_epi32(v[10], x);
  967|  1.00M|    v[10] = _mm256_add_epi32(v[10], rnding);
  968|  1.00M|    v[10] = _mm256_srai_epi32(v[10], bit);
  969|       |
  970|  1.00M|    v[13] = _mm256_mullo_epi32(u[10], cospi20);
  971|  1.00M|    x = _mm256_mullo_epi32(u[13], cospi44);
  972|  1.00M|    v[13] = _mm256_sub_epi32(x, v[13]);
  973|  1.00M|    v[13] = _mm256_add_epi32(v[13], rnding);
  974|  1.00M|    v[13] = _mm256_srai_epi32(v[13], bit);
  975|       |
  976|  1.00M|    v[11] = _mm256_mullo_epi32(u[11], cospi12);
  977|  1.00M|    x = _mm256_mullo_epi32(u[12], cospi52);
  978|  1.00M|    v[11] = _mm256_add_epi32(v[11], x);
  979|  1.00M|    v[11] = _mm256_add_epi32(v[11], rnding);
  980|  1.00M|    v[11] = _mm256_srai_epi32(v[11], bit);
  981|       |
  982|  1.00M|    v[12] = _mm256_mullo_epi32(u[11], cospi52);
  983|  1.00M|    x = _mm256_mullo_epi32(u[12], cospi12);
  984|  1.00M|    v[12] = _mm256_sub_epi32(x, v[12]);
  985|  1.00M|    v[12] = _mm256_add_epi32(v[12], rnding);
  986|  1.00M|    v[12] = _mm256_srai_epi32(v[12], bit);
  987|       |
  988|  1.00M|    out[0 * outstride + col] = v[0];
  989|  1.00M|    out[1 * outstride + col] = v[8];
  990|  1.00M|    out[2 * outstride + col] = v[4];
  991|  1.00M|    out[3 * outstride + col] = v[12];
  992|  1.00M|    out[4 * outstride + col] = v[2];
  993|  1.00M|    out[5 * outstride + col] = v[10];
  994|  1.00M|    out[6 * outstride + col] = v[6];
  995|  1.00M|    out[7 * outstride + col] = v[14];
  996|  1.00M|    out[8 * outstride + col] = v[1];
  997|  1.00M|    out[9 * outstride + col] = v[9];
  998|  1.00M|    out[10 * outstride + col] = v[5];
  999|  1.00M|    out[11 * outstride + col] = v[13];
 1000|  1.00M|    out[12 * outstride + col] = v[3];
 1001|  1.00M|    out[13 * outstride + col] = v[11];
 1002|  1.00M|    out[14 * outstride + col] = v[7];
 1003|  1.00M|    out[15 * outstride + col] = v[15];
 1004|  1.00M|  }
 1005|   790k|}
highbd_fwd_txfm_avx2.c:fwd_txfm_transpose_16x16_avx2:
  205|   188k|                                                 __m256i *out) {
  206|   188k|  fwd_txfm_transpose_8x8_avx2(&in[0], &out[0], 2, 2);
  207|   188k|  fwd_txfm_transpose_8x8_avx2(&in[1], &out[16], 2, 2);
  208|   188k|  fwd_txfm_transpose_8x8_avx2(&in[16], &out[1], 2, 2);
  209|   188k|  fwd_txfm_transpose_8x8_avx2(&in[17], &out[17], 2, 2);
  210|   188k|}
highbd_fwd_txfm_avx2.c:fadst16_avx2:
 1007|   300k|                         const int num_cols, const int outstride) {
 1008|   300k|  const int32_t *cospi = cospi_arr(bit);
 1009|   300k|  const __m256i cospi32 = _mm256_set1_epi32(cospi[32]);
 1010|   300k|  const __m256i cospi48 = _mm256_set1_epi32(cospi[48]);
 1011|   300k|  const __m256i cospi16 = _mm256_set1_epi32(cospi[16]);
 1012|   300k|  const __m256i cospim16 = _mm256_set1_epi32(-cospi[16]);
 1013|   300k|  const __m256i cospim48 = _mm256_set1_epi32(-cospi[48]);
 1014|   300k|  const __m256i cospi8 = _mm256_set1_epi32(cospi[8]);
 1015|   300k|  const __m256i cospi56 = _mm256_set1_epi32(cospi[56]);
 1016|   300k|  const __m256i cospim56 = _mm256_set1_epi32(-cospi[56]);
 1017|   300k|  const __m256i cospim8 = _mm256_set1_epi32(-cospi[8]);
 1018|   300k|  const __m256i cospi24 = _mm256_set1_epi32(cospi[24]);
 1019|   300k|  const __m256i cospim24 = _mm256_set1_epi32(-cospi[24]);
 1020|   300k|  const __m256i cospim40 = _mm256_set1_epi32(-cospi[40]);
 1021|   300k|  const __m256i cospi40 = _mm256_set1_epi32(cospi[40]);
 1022|   300k|  const __m256i cospi2 = _mm256_set1_epi32(cospi[2]);
 1023|   300k|  const __m256i cospi62 = _mm256_set1_epi32(cospi[62]);
 1024|   300k|  const __m256i cospim2 = _mm256_set1_epi32(-cospi[2]);
 1025|   300k|  const __m256i cospi10 = _mm256_set1_epi32(cospi[10]);
 1026|   300k|  const __m256i cospi54 = _mm256_set1_epi32(cospi[54]);
 1027|   300k|  const __m256i cospim10 = _mm256_set1_epi32(-cospi[10]);
 1028|   300k|  const __m256i cospi18 = _mm256_set1_epi32(cospi[18]);
 1029|   300k|  const __m256i cospi46 = _mm256_set1_epi32(cospi[46]);
 1030|   300k|  const __m256i cospim18 = _mm256_set1_epi32(-cospi[18]);
 1031|   300k|  const __m256i cospi26 = _mm256_set1_epi32(cospi[26]);
 1032|   300k|  const __m256i cospi38 = _mm256_set1_epi32(cospi[38]);
 1033|   300k|  const __m256i cospim26 = _mm256_set1_epi32(-cospi[26]);
 1034|   300k|  const __m256i cospi34 = _mm256_set1_epi32(cospi[34]);
 1035|   300k|  const __m256i cospi30 = _mm256_set1_epi32(cospi[30]);
 1036|   300k|  const __m256i cospim34 = _mm256_set1_epi32(-cospi[34]);
 1037|   300k|  const __m256i cospi42 = _mm256_set1_epi32(cospi[42]);
 1038|   300k|  const __m256i cospi22 = _mm256_set1_epi32(cospi[22]);
 1039|   300k|  const __m256i cospim42 = _mm256_set1_epi32(-cospi[42]);
 1040|   300k|  const __m256i cospi50 = _mm256_set1_epi32(cospi[50]);
 1041|   300k|  const __m256i cospi14 = _mm256_set1_epi32(cospi[14]);
 1042|   300k|  const __m256i cospim50 = _mm256_set1_epi32(-cospi[50]);
 1043|   300k|  const __m256i cospi58 = _mm256_set1_epi32(cospi[58]);
 1044|   300k|  const __m256i cospi6 = _mm256_set1_epi32(cospi[6]);
 1045|   300k|  const __m256i cospim58 = _mm256_set1_epi32(-cospi[58]);
 1046|   300k|  const __m256i rnding = _mm256_set1_epi32(1 << (bit - 1));
 1047|   300k|  const __m256i zero = _mm256_setzero_si256();
 1048|       |
 1049|   300k|  __m256i u[16], v[16], x, y;
 1050|   300k|  int col;
 1051|       |
 1052|   711k|  for (col = 0; col < num_cols; ++col) {
  ------------------
  |  Branch (1052:17): [True: 411k, False: 300k]
  ------------------
 1053|       |    // stage 0
 1054|       |    // stage 1
 1055|   411k|    u[0] = in[0 * num_cols + col];
 1056|   411k|    u[1] = _mm256_sub_epi32(zero, in[15 * num_cols + col]);
 1057|   411k|    u[2] = _mm256_sub_epi32(zero, in[7 * num_cols + col]);
 1058|   411k|    u[3] = in[8 * num_cols + col];
 1059|   411k|    u[4] = _mm256_sub_epi32(zero, in[3 * num_cols + col]);
 1060|   411k|    u[5] = in[12 * num_cols + col];
 1061|   411k|    u[6] = in[4 * num_cols + col];
 1062|   411k|    u[7] = _mm256_sub_epi32(zero, in[11 * num_cols + col]);
 1063|   411k|    u[8] = _mm256_sub_epi32(zero, in[1 * num_cols + col]);
 1064|   411k|    u[9] = in[14 * num_cols + col];
 1065|   411k|    u[10] = in[6 * num_cols + col];
 1066|   411k|    u[11] = _mm256_sub_epi32(zero, in[9 * num_cols + col]);
 1067|   411k|    u[12] = in[2 * num_cols + col];
 1068|   411k|    u[13] = _mm256_sub_epi32(zero, in[13 * num_cols + col]);
 1069|   411k|    u[14] = _mm256_sub_epi32(zero, in[5 * num_cols + col]);
 1070|   411k|    u[15] = in[10 * num_cols + col];
 1071|       |
 1072|       |    // stage 2
 1073|   411k|    v[0] = u[0];
 1074|   411k|    v[1] = u[1];
 1075|       |
 1076|   411k|    x = _mm256_mullo_epi32(u[2], cospi32);
 1077|   411k|    y = _mm256_mullo_epi32(u[3], cospi32);
 1078|   411k|    v[2] = _mm256_add_epi32(x, y);
 1079|   411k|    v[2] = _mm256_add_epi32(v[2], rnding);
 1080|   411k|    v[2] = _mm256_srai_epi32(v[2], bit);
 1081|       |
 1082|   411k|    v[3] = _mm256_sub_epi32(x, y);
 1083|   411k|    v[3] = _mm256_add_epi32(v[3], rnding);
 1084|   411k|    v[3] = _mm256_srai_epi32(v[3], bit);
 1085|       |
 1086|   411k|    v[4] = u[4];
 1087|   411k|    v[5] = u[5];
 1088|       |
 1089|   411k|    x = _mm256_mullo_epi32(u[6], cospi32);
 1090|   411k|    y = _mm256_mullo_epi32(u[7], cospi32);
 1091|   411k|    v[6] = _mm256_add_epi32(x, y);
 1092|   411k|    v[6] = _mm256_add_epi32(v[6], rnding);
 1093|   411k|    v[6] = _mm256_srai_epi32(v[6], bit);
 1094|       |
 1095|   411k|    v[7] = _mm256_sub_epi32(x, y);
 1096|   411k|    v[7] = _mm256_add_epi32(v[7], rnding);
 1097|   411k|    v[7] = _mm256_srai_epi32(v[7], bit);
 1098|       |
 1099|   411k|    v[8] = u[8];
 1100|   411k|    v[9] = u[9];
 1101|       |
 1102|   411k|    x = _mm256_mullo_epi32(u[10], cospi32);
 1103|   411k|    y = _mm256_mullo_epi32(u[11], cospi32);
 1104|   411k|    v[10] = _mm256_add_epi32(x, y);
 1105|   411k|    v[10] = _mm256_add_epi32(v[10], rnding);
 1106|   411k|    v[10] = _mm256_srai_epi32(v[10], bit);
 1107|       |
 1108|   411k|    v[11] = _mm256_sub_epi32(x, y);
 1109|   411k|    v[11] = _mm256_add_epi32(v[11], rnding);
 1110|   411k|    v[11] = _mm256_srai_epi32(v[11], bit);
 1111|       |
 1112|   411k|    v[12] = u[12];
 1113|   411k|    v[13] = u[13];
 1114|       |
 1115|   411k|    x = _mm256_mullo_epi32(u[14], cospi32);
 1116|   411k|    y = _mm256_mullo_epi32(u[15], cospi32);
 1117|   411k|    v[14] = _mm256_add_epi32(x, y);
 1118|   411k|    v[14] = _mm256_add_epi32(v[14], rnding);
 1119|   411k|    v[14] = _mm256_srai_epi32(v[14], bit);
 1120|       |
 1121|   411k|    v[15] = _mm256_sub_epi32(x, y);
 1122|   411k|    v[15] = _mm256_add_epi32(v[15], rnding);
 1123|   411k|    v[15] = _mm256_srai_epi32(v[15], bit);
 1124|       |
 1125|       |    // stage 3
 1126|   411k|    u[0] = _mm256_add_epi32(v[0], v[2]);
 1127|   411k|    u[1] = _mm256_add_epi32(v[1], v[3]);
 1128|   411k|    u[2] = _mm256_sub_epi32(v[0], v[2]);
 1129|   411k|    u[3] = _mm256_sub_epi32(v[1], v[3]);
 1130|   411k|    u[4] = _mm256_add_epi32(v[4], v[6]);
 1131|   411k|    u[5] = _mm256_add_epi32(v[5], v[7]);
 1132|   411k|    u[6] = _mm256_sub_epi32(v[4], v[6]);
 1133|   411k|    u[7] = _mm256_sub_epi32(v[5], v[7]);
 1134|   411k|    u[8] = _mm256_add_epi32(v[8], v[10]);
 1135|   411k|    u[9] = _mm256_add_epi32(v[9], v[11]);
 1136|   411k|    u[10] = _mm256_sub_epi32(v[8], v[10]);
 1137|   411k|    u[11] = _mm256_sub_epi32(v[9], v[11]);
 1138|   411k|    u[12] = _mm256_add_epi32(v[12], v[14]);
 1139|   411k|    u[13] = _mm256_add_epi32(v[13], v[15]);
 1140|   411k|    u[14] = _mm256_sub_epi32(v[12], v[14]);
 1141|   411k|    u[15] = _mm256_sub_epi32(v[13], v[15]);
 1142|       |
 1143|       |    // stage 4
 1144|   411k|    v[0] = u[0];
 1145|   411k|    v[1] = u[1];
 1146|   411k|    v[2] = u[2];
 1147|   411k|    v[3] = u[3];
 1148|   411k|    v[4] = av1_half_btf_avx2(&cospi16, &u[4], &cospi48, &u[5], &rnding, bit);
 1149|   411k|    v[5] = av1_half_btf_avx2(&cospi48, &u[4], &cospim16, &u[5], &rnding, bit);
 1150|   411k|    v[6] = av1_half_btf_avx2(&cospim48, &u[6], &cospi16, &u[7], &rnding, bit);
 1151|   411k|    v[7] = av1_half_btf_avx2(&cospi16, &u[6], &cospi48, &u[7], &rnding, bit);
 1152|   411k|    v[8] = u[8];
 1153|   411k|    v[9] = u[9];
 1154|   411k|    v[10] = u[10];
 1155|   411k|    v[11] = u[11];
 1156|   411k|    v[12] = av1_half_btf_avx2(&cospi16, &u[12], &cospi48, &u[13], &rnding, bit);
 1157|   411k|    v[13] =
 1158|   411k|        av1_half_btf_avx2(&cospi48, &u[12], &cospim16, &u[13], &rnding, bit);
 1159|   411k|    v[14] =
 1160|   411k|        av1_half_btf_avx2(&cospim48, &u[14], &cospi16, &u[15], &rnding, bit);
 1161|   411k|    v[15] = av1_half_btf_avx2(&cospi16, &u[14], &cospi48, &u[15], &rnding, bit);
 1162|       |
 1163|       |    // stage 5
 1164|   411k|    u[0] = _mm256_add_epi32(v[0], v[4]);
 1165|   411k|    u[1] = _mm256_add_epi32(v[1], v[5]);
 1166|   411k|    u[2] = _mm256_add_epi32(v[2], v[6]);
 1167|   411k|    u[3] = _mm256_add_epi32(v[3], v[7]);
 1168|   411k|    u[4] = _mm256_sub_epi32(v[0], v[4]);
 1169|   411k|    u[5] = _mm256_sub_epi32(v[1], v[5]);
 1170|   411k|    u[6] = _mm256_sub_epi32(v[2], v[6]);
 1171|   411k|    u[7] = _mm256_sub_epi32(v[3], v[7]);
 1172|   411k|    u[8] = _mm256_add_epi32(v[8], v[12]);
 1173|   411k|    u[9] = _mm256_add_epi32(v[9], v[13]);
 1174|   411k|    u[10] = _mm256_add_epi32(v[10], v[14]);
 1175|   411k|    u[11] = _mm256_add_epi32(v[11], v[15]);
 1176|   411k|    u[12] = _mm256_sub_epi32(v[8], v[12]);
 1177|   411k|    u[13] = _mm256_sub_epi32(v[9], v[13]);
 1178|   411k|    u[14] = _mm256_sub_epi32(v[10], v[14]);
 1179|   411k|    u[15] = _mm256_sub_epi32(v[11], v[15]);
 1180|       |
 1181|       |    // stage 6
 1182|   411k|    v[0] = u[0];
 1183|   411k|    v[1] = u[1];
 1184|   411k|    v[2] = u[2];
 1185|   411k|    v[3] = u[3];
 1186|   411k|    v[4] = u[4];
 1187|   411k|    v[5] = u[5];
 1188|   411k|    v[6] = u[6];
 1189|   411k|    v[7] = u[7];
 1190|   411k|    v[8] = av1_half_btf_avx2(&cospi8, &u[8], &cospi56, &u[9], &rnding, bit);
 1191|   411k|    v[9] = av1_half_btf_avx2(&cospi56, &u[8], &cospim8, &u[9], &rnding, bit);
 1192|   411k|    v[10] = av1_half_btf_avx2(&cospi40, &u[10], &cospi24, &u[11], &rnding, bit);
 1193|   411k|    v[11] =
 1194|   411k|        av1_half_btf_avx2(&cospi24, &u[10], &cospim40, &u[11], &rnding, bit);
 1195|   411k|    v[12] = av1_half_btf_avx2(&cospim56, &u[12], &cospi8, &u[13], &rnding, bit);
 1196|   411k|    v[13] = av1_half_btf_avx2(&cospi8, &u[12], &cospi56, &u[13], &rnding, bit);
 1197|   411k|    v[14] =
 1198|   411k|        av1_half_btf_avx2(&cospim24, &u[14], &cospi40, &u[15], &rnding, bit);
 1199|   411k|    v[15] = av1_half_btf_avx2(&cospi40, &u[14], &cospi24, &u[15], &rnding, bit);
 1200|       |
 1201|       |    // stage 7
 1202|   411k|    u[0] = _mm256_add_epi32(v[0], v[8]);
 1203|   411k|    u[1] = _mm256_add_epi32(v[1], v[9]);
 1204|   411k|    u[2] = _mm256_add_epi32(v[2], v[10]);
 1205|   411k|    u[3] = _mm256_add_epi32(v[3], v[11]);
 1206|   411k|    u[4] = _mm256_add_epi32(v[4], v[12]);
 1207|   411k|    u[5] = _mm256_add_epi32(v[5], v[13]);
 1208|   411k|    u[6] = _mm256_add_epi32(v[6], v[14]);
 1209|   411k|    u[7] = _mm256_add_epi32(v[7], v[15]);
 1210|   411k|    u[8] = _mm256_sub_epi32(v[0], v[8]);
 1211|   411k|    u[9] = _mm256_sub_epi32(v[1], v[9]);
 1212|   411k|    u[10] = _mm256_sub_epi32(v[2], v[10]);
 1213|   411k|    u[11] = _mm256_sub_epi32(v[3], v[11]);
 1214|   411k|    u[12] = _mm256_sub_epi32(v[4], v[12]);
 1215|   411k|    u[13] = _mm256_sub_epi32(v[5], v[13]);
 1216|   411k|    u[14] = _mm256_sub_epi32(v[6], v[14]);
 1217|   411k|    u[15] = _mm256_sub_epi32(v[7], v[15]);
 1218|       |
 1219|       |    // stage 8
 1220|   411k|    v[0] = av1_half_btf_avx2(&cospi2, &u[0], &cospi62, &u[1], &rnding, bit);
 1221|   411k|    v[1] = av1_half_btf_avx2(&cospi62, &u[0], &cospim2, &u[1], &rnding, bit);
 1222|   411k|    v[2] = av1_half_btf_avx2(&cospi10, &u[2], &cospi54, &u[3], &rnding, bit);
 1223|   411k|    v[3] = av1_half_btf_avx2(&cospi54, &u[2], &cospim10, &u[3], &rnding, bit);
 1224|   411k|    v[4] = av1_half_btf_avx2(&cospi18, &u[4], &cospi46, &u[5], &rnding, bit);
 1225|   411k|    v[5] = av1_half_btf_avx2(&cospi46, &u[4], &cospim18, &u[5], &rnding, bit);
 1226|   411k|    v[6] = av1_half_btf_avx2(&cospi26, &u[6], &cospi38, &u[7], &rnding, bit);
 1227|   411k|    v[7] = av1_half_btf_avx2(&cospi38, &u[6], &cospim26, &u[7], &rnding, bit);
 1228|   411k|    v[8] = av1_half_btf_avx2(&cospi34, &u[8], &cospi30, &u[9], &rnding, bit);
 1229|   411k|    v[9] = av1_half_btf_avx2(&cospi30, &u[8], &cospim34, &u[9], &rnding, bit);
 1230|   411k|    v[10] = av1_half_btf_avx2(&cospi42, &u[10], &cospi22, &u[11], &rnding, bit);
 1231|   411k|    v[11] =
 1232|   411k|        av1_half_btf_avx2(&cospi22, &u[10], &cospim42, &u[11], &rnding, bit);
 1233|   411k|    v[12] = av1_half_btf_avx2(&cospi50, &u[12], &cospi14, &u[13], &rnding, bit);
 1234|   411k|    v[13] =
 1235|   411k|        av1_half_btf_avx2(&cospi14, &u[12], &cospim50, &u[13], &rnding, bit);
 1236|   411k|    v[14] = av1_half_btf_avx2(&cospi58, &u[14], &cospi6, &u[15], &rnding, bit);
 1237|   411k|    v[15] = av1_half_btf_avx2(&cospi6, &u[14], &cospim58, &u[15], &rnding, bit);
 1238|       |
 1239|       |    // stage 9
 1240|   411k|    out[0 * outstride + col] = v[1];
 1241|   411k|    out[1 * outstride + col] = v[14];
 1242|   411k|    out[2 * outstride + col] = v[3];
 1243|   411k|    out[3 * outstride + col] = v[12];
 1244|   411k|    out[4 * outstride + col] = v[5];
 1245|   411k|    out[5 * outstride + col] = v[10];
 1246|   411k|    out[6 * outstride + col] = v[7];
 1247|   411k|    out[7 * outstride + col] = v[8];
 1248|   411k|    out[8 * outstride + col] = v[9];
 1249|   411k|    out[9 * outstride + col] = v[6];
 1250|   411k|    out[10 * outstride + col] = v[11];
 1251|   411k|    out[11 * outstride + col] = v[4];
 1252|   411k|    out[12 * outstride + col] = v[13];
 1253|   411k|    out[13 * outstride + col] = v[2];
 1254|   411k|    out[14 * outstride + col] = v[15];
 1255|   411k|    out[15 * outstride + col] = v[0];
 1256|   411k|  }
 1257|   300k|}
highbd_fwd_txfm_avx2.c:av1_half_btf_avx2:
  214|  13.1M|                                        const __m256i *rounding, int bit) {
  215|  13.1M|  __m256i x, y;
  216|       |
  217|  13.1M|  x = _mm256_mullo_epi32(*w0, *n0);
  218|  13.1M|  y = _mm256_mullo_epi32(*w1, *n1);
  219|  13.1M|  x = _mm256_add_epi32(x, y);
  220|  13.1M|  x = _mm256_add_epi32(x, *rounding);
  221|  13.1M|  x = _mm256_srai_epi32(x, bit);
  222|  13.1M|  return x;
  223|  13.1M|}
highbd_fwd_txfm_avx2.c:idtx16_avx2:
 1259|   128k|                        int col_num, const int outstride) {
 1260|   128k|  (void)bit;
 1261|   128k|  (void)outstride;
 1262|   128k|  __m256i fact = _mm256_set1_epi32(2 * NewSqrt2);
 1263|   128k|  __m256i offset = _mm256_set1_epi32(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|   128k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1264|   128k|  __m256i a_low;
 1265|       |
 1266|   128k|  int num_iters = 16 * col_num;
 1267|  2.93M|  for (int i = 0; i < num_iters; i++) {
  ------------------
  |  Branch (1267:19): [True: 2.80M, False: 128k]
  ------------------
 1268|  2.80M|    a_low = _mm256_mullo_epi32(in[i], fact);
 1269|  2.80M|    a_low = _mm256_add_epi32(a_low, offset);
 1270|  2.80M|    out[i] = _mm256_srai_epi32(a_low, NewSqrt2Bits);
  ------------------
  |  |   42|  2.80M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1271|  2.80M|  }
 1272|   128k|}
highbd_fwd_txfm_avx2.c:fdct32_avx2:
 1586|   135k|                               const int outstride) {
 1587|   135k|  __m256i buf0[32];
 1588|   135k|  __m256i buf1[32];
 1589|   135k|  const int32_t *cospi;
 1590|   135k|  int startidx = 0 * instride;
 1591|   135k|  int endidx = 31 * instride;
 1592|       |  // stage 0
 1593|       |  // stage 1
 1594|   135k|  buf1[0] = _mm256_add_epi32(input[startidx], input[endidx]);
 1595|   135k|  buf1[31] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1596|   135k|  startidx += instride;
 1597|   135k|  endidx -= instride;
 1598|   135k|  buf1[1] = _mm256_add_epi32(input[startidx], input[endidx]);
 1599|   135k|  buf1[30] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1600|   135k|  startidx += instride;
 1601|   135k|  endidx -= instride;
 1602|   135k|  buf1[2] = _mm256_add_epi32(input[startidx], input[endidx]);
 1603|   135k|  buf1[29] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1604|   135k|  startidx += instride;
 1605|   135k|  endidx -= instride;
 1606|   135k|  buf1[3] = _mm256_add_epi32(input[startidx], input[endidx]);
 1607|   135k|  buf1[28] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1608|   135k|  startidx += instride;
 1609|   135k|  endidx -= instride;
 1610|   135k|  buf1[4] = _mm256_add_epi32(input[startidx], input[endidx]);
 1611|   135k|  buf1[27] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1612|   135k|  startidx += instride;
 1613|   135k|  endidx -= instride;
 1614|   135k|  buf1[5] = _mm256_add_epi32(input[startidx], input[endidx]);
 1615|   135k|  buf1[26] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1616|   135k|  startidx += instride;
 1617|   135k|  endidx -= instride;
 1618|   135k|  buf1[6] = _mm256_add_epi32(input[startidx], input[endidx]);
 1619|   135k|  buf1[25] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1620|   135k|  startidx += instride;
 1621|   135k|  endidx -= instride;
 1622|   135k|  buf1[7] = _mm256_add_epi32(input[startidx], input[endidx]);
 1623|   135k|  buf1[24] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1624|   135k|  startidx += instride;
 1625|   135k|  endidx -= instride;
 1626|   135k|  buf1[8] = _mm256_add_epi32(input[startidx], input[endidx]);
 1627|   135k|  buf1[23] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1628|   135k|  startidx += instride;
 1629|   135k|  endidx -= instride;
 1630|   135k|  buf1[9] = _mm256_add_epi32(input[startidx], input[endidx]);
 1631|   135k|  buf1[22] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1632|   135k|  startidx += instride;
 1633|   135k|  endidx -= instride;
 1634|   135k|  buf1[10] = _mm256_add_epi32(input[startidx], input[endidx]);
 1635|   135k|  buf1[21] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1636|   135k|  startidx += instride;
 1637|   135k|  endidx -= instride;
 1638|   135k|  buf1[11] = _mm256_add_epi32(input[startidx], input[endidx]);
 1639|   135k|  buf1[20] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1640|   135k|  startidx += instride;
 1641|   135k|  endidx -= instride;
 1642|   135k|  buf1[12] = _mm256_add_epi32(input[startidx], input[endidx]);
 1643|   135k|  buf1[19] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1644|   135k|  startidx += instride;
 1645|   135k|  endidx -= instride;
 1646|   135k|  buf1[13] = _mm256_add_epi32(input[startidx], input[endidx]);
 1647|   135k|  buf1[18] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1648|   135k|  startidx += instride;
 1649|   135k|  endidx -= instride;
 1650|   135k|  buf1[14] = _mm256_add_epi32(input[startidx], input[endidx]);
 1651|   135k|  buf1[17] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1652|   135k|  startidx += instride;
 1653|   135k|  endidx -= instride;
 1654|   135k|  buf1[15] = _mm256_add_epi32(input[startidx], input[endidx]);
 1655|   135k|  buf1[16] = _mm256_sub_epi32(input[startidx], input[endidx]);
 1656|       |
 1657|       |  // stage 2
 1658|   135k|  cospi = cospi_arr(cos_bit);
 1659|   135k|  buf0[0] = _mm256_add_epi32(buf1[0], buf1[15]);
 1660|   135k|  buf0[15] = _mm256_sub_epi32(buf1[0], buf1[15]);
 1661|   135k|  buf0[1] = _mm256_add_epi32(buf1[1], buf1[14]);
 1662|   135k|  buf0[14] = _mm256_sub_epi32(buf1[1], buf1[14]);
 1663|   135k|  buf0[2] = _mm256_add_epi32(buf1[2], buf1[13]);
 1664|   135k|  buf0[13] = _mm256_sub_epi32(buf1[2], buf1[13]);
 1665|   135k|  buf0[3] = _mm256_add_epi32(buf1[3], buf1[12]);
 1666|   135k|  buf0[12] = _mm256_sub_epi32(buf1[3], buf1[12]);
 1667|   135k|  buf0[4] = _mm256_add_epi32(buf1[4], buf1[11]);
 1668|   135k|  buf0[11] = _mm256_sub_epi32(buf1[4], buf1[11]);
 1669|   135k|  buf0[5] = _mm256_add_epi32(buf1[5], buf1[10]);
 1670|   135k|  buf0[10] = _mm256_sub_epi32(buf1[5], buf1[10]);
 1671|   135k|  buf0[6] = _mm256_add_epi32(buf1[6], buf1[9]);
 1672|   135k|  buf0[9] = _mm256_sub_epi32(buf1[6], buf1[9]);
 1673|   135k|  buf0[7] = _mm256_add_epi32(buf1[7], buf1[8]);
 1674|   135k|  buf0[8] = _mm256_sub_epi32(buf1[7], buf1[8]);
 1675|   135k|  buf0[16] = buf1[16];
 1676|   135k|  buf0[17] = buf1[17];
 1677|   135k|  buf0[18] = buf1[18];
 1678|   135k|  buf0[19] = buf1[19];
 1679|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf1[20], buf1[27], buf0[20],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1680|   135k|                    buf0[27], cos_bit);
 1681|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1682|   135k|                    buf0[26], cos_bit);
 1683|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf1[22], buf1[25], buf0[22],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1684|   135k|                    buf0[25], cos_bit);
 1685|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf1[23], buf1[24], buf0[23],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1686|   135k|                    buf0[24], cos_bit);
 1687|   135k|  buf0[28] = buf1[28];
 1688|   135k|  buf0[29] = buf1[29];
 1689|   135k|  buf0[30] = buf1[30];
 1690|   135k|  buf0[31] = buf1[31];
 1691|       |
 1692|       |  // stage 3
 1693|   135k|  cospi = cospi_arr(cos_bit);
 1694|   135k|  buf1[0] = _mm256_add_epi32(buf0[0], buf0[7]);
 1695|   135k|  buf1[7] = _mm256_sub_epi32(buf0[0], buf0[7]);
 1696|   135k|  buf1[1] = _mm256_add_epi32(buf0[1], buf0[6]);
 1697|   135k|  buf1[6] = _mm256_sub_epi32(buf0[1], buf0[6]);
 1698|   135k|  buf1[2] = _mm256_add_epi32(buf0[2], buf0[5]);
 1699|   135k|  buf1[5] = _mm256_sub_epi32(buf0[2], buf0[5]);
 1700|   135k|  buf1[3] = _mm256_add_epi32(buf0[3], buf0[4]);
 1701|   135k|  buf1[4] = _mm256_sub_epi32(buf0[3], buf0[4]);
 1702|   135k|  buf1[8] = buf0[8];
 1703|   135k|  buf1[9] = buf0[9];
 1704|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf0[10], buf0[13], buf1[10],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1705|   135k|                    buf1[13], cos_bit);
 1706|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf0[11], buf0[12], buf1[11],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1707|   135k|                    buf1[12], cos_bit);
 1708|   135k|  buf1[14] = buf0[14];
 1709|   135k|  buf1[15] = buf0[15];
 1710|   135k|  buf1[16] = _mm256_add_epi32(buf0[16], buf0[23]);
 1711|   135k|  buf1[23] = _mm256_sub_epi32(buf0[16], buf0[23]);
 1712|   135k|  buf1[17] = _mm256_add_epi32(buf0[17], buf0[22]);
 1713|   135k|  buf1[22] = _mm256_sub_epi32(buf0[17], buf0[22]);
 1714|   135k|  buf1[18] = _mm256_add_epi32(buf0[18], buf0[21]);
 1715|   135k|  buf1[21] = _mm256_sub_epi32(buf0[18], buf0[21]);
 1716|   135k|  buf1[19] = _mm256_add_epi32(buf0[19], buf0[20]);
 1717|   135k|  buf1[20] = _mm256_sub_epi32(buf0[19], buf0[20]);
 1718|   135k|  buf1[24] = _mm256_sub_epi32(buf0[31], buf0[24]);
 1719|   135k|  buf1[31] = _mm256_add_epi32(buf0[31], buf0[24]);
 1720|   135k|  buf1[25] = _mm256_sub_epi32(buf0[30], buf0[25]);
 1721|   135k|  buf1[30] = _mm256_add_epi32(buf0[30], buf0[25]);
 1722|   135k|  buf1[26] = _mm256_sub_epi32(buf0[29], buf0[26]);
 1723|   135k|  buf1[29] = _mm256_add_epi32(buf0[29], buf0[26]);
 1724|   135k|  buf1[27] = _mm256_sub_epi32(buf0[28], buf0[27]);
 1725|   135k|  buf1[28] = _mm256_add_epi32(buf0[28], buf0[27]);
 1726|       |
 1727|       |  // stage 4
 1728|   135k|  cospi = cospi_arr(cos_bit);
 1729|   135k|  buf0[0] = _mm256_add_epi32(buf1[0], buf1[3]);
 1730|   135k|  buf0[3] = _mm256_sub_epi32(buf1[0], buf1[3]);
 1731|   135k|  buf0[1] = _mm256_add_epi32(buf1[1], buf1[2]);
 1732|   135k|  buf0[2] = _mm256_sub_epi32(buf1[1], buf1[2]);
 1733|   135k|  buf0[4] = buf1[4];
 1734|   135k|  btf_32_avx2_type0(-cospi[32], cospi[32], buf1[5], buf1[6], buf0[5], buf0[6],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1735|   135k|                    cos_bit);
 1736|   135k|  buf0[7] = buf1[7];
 1737|   135k|  buf0[8] = _mm256_add_epi32(buf1[8], buf1[11]);
 1738|   135k|  buf0[11] = _mm256_sub_epi32(buf1[8], buf1[11]);
 1739|   135k|  buf0[9] = _mm256_add_epi32(buf1[9], buf1[10]);
 1740|   135k|  buf0[10] = _mm256_sub_epi32(buf1[9], buf1[10]);
 1741|   135k|  buf0[12] = _mm256_sub_epi32(buf1[15], buf1[12]);
 1742|   135k|  buf0[15] = _mm256_add_epi32(buf1[15], buf1[12]);
 1743|   135k|  buf0[13] = _mm256_sub_epi32(buf1[14], buf1[13]);
 1744|   135k|  buf0[14] = _mm256_add_epi32(buf1[14], buf1[13]);
 1745|   135k|  buf0[16] = buf1[16];
 1746|   135k|  buf0[17] = buf1[17];
 1747|   135k|  btf_32_avx2_type0(-cospi[16], cospi[48], buf1[18], buf1[29], buf0[18],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1748|   135k|                    buf0[29], cos_bit);
 1749|   135k|  btf_32_avx2_type0(-cospi[16], cospi[48], buf1[19], buf1[28], buf0[19],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1750|   135k|                    buf0[28], cos_bit);
 1751|   135k|  btf_32_avx2_type0(-cospi[48], -cospi[16], buf1[20], buf1[27], buf0[20],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1752|   135k|                    buf0[27], cos_bit);
 1753|   135k|  btf_32_avx2_type0(-cospi[48], -cospi[16], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1754|   135k|                    buf0[26], cos_bit);
 1755|   135k|  buf0[22] = buf1[22];
 1756|   135k|  buf0[23] = buf1[23];
 1757|   135k|  buf0[24] = buf1[24];
 1758|   135k|  buf0[25] = buf1[25];
 1759|   135k|  buf0[30] = buf1[30];
 1760|   135k|  buf0[31] = buf1[31];
 1761|       |
 1762|       |  // stage 5
 1763|   135k|  cospi = cospi_arr(cos_bit);
 1764|   135k|  btf_32_avx2_type0(cospi[32], cospi[32], buf0[0], buf0[1], buf1[0], buf1[1],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1765|   135k|                    cos_bit);
 1766|   135k|  btf_32_avx2_type0(cospi[16], cospi[48], buf0[3], buf0[2], buf1[2], buf1[3],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1767|   135k|                    cos_bit);
 1768|   135k|  buf1[4] = _mm256_add_epi32(buf0[4], buf0[5]);
 1769|   135k|  buf1[5] = _mm256_sub_epi32(buf0[4], buf0[5]);
 1770|   135k|  buf1[6] = _mm256_sub_epi32(buf0[7], buf0[6]);
 1771|   135k|  buf1[7] = _mm256_add_epi32(buf0[7], buf0[6]);
 1772|   135k|  buf1[8] = buf0[8];
 1773|   135k|  btf_32_avx2_type0(-cospi[16], cospi[48], buf0[9], buf0[14], buf1[9], buf1[14],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1774|   135k|                    cos_bit);
 1775|   135k|  btf_32_avx2_type0(-cospi[48], -cospi[16], buf0[10], buf0[13], buf1[10],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1776|   135k|                    buf1[13], cos_bit);
 1777|   135k|  buf1[11] = buf0[11];
 1778|   135k|  buf1[12] = buf0[12];
 1779|   135k|  buf1[15] = buf0[15];
 1780|   135k|  buf1[16] = _mm256_add_epi32(buf0[16], buf0[19]);
 1781|   135k|  buf1[19] = _mm256_sub_epi32(buf0[16], buf0[19]);
 1782|   135k|  buf1[17] = _mm256_add_epi32(buf0[17], buf0[18]);
 1783|   135k|  buf1[18] = _mm256_sub_epi32(buf0[17], buf0[18]);
 1784|   135k|  buf1[20] = _mm256_sub_epi32(buf0[23], buf0[20]);
 1785|   135k|  buf1[23] = _mm256_add_epi32(buf0[23], buf0[20]);
 1786|   135k|  buf1[21] = _mm256_sub_epi32(buf0[22], buf0[21]);
 1787|   135k|  buf1[22] = _mm256_add_epi32(buf0[22], buf0[21]);
 1788|   135k|  buf1[24] = _mm256_add_epi32(buf0[24], buf0[27]);
 1789|   135k|  buf1[27] = _mm256_sub_epi32(buf0[24], buf0[27]);
 1790|   135k|  buf1[25] = _mm256_add_epi32(buf0[25], buf0[26]);
 1791|   135k|  buf1[26] = _mm256_sub_epi32(buf0[25], buf0[26]);
 1792|   135k|  buf1[28] = _mm256_sub_epi32(buf0[31], buf0[28]);
 1793|   135k|  buf1[31] = _mm256_add_epi32(buf0[31], buf0[28]);
 1794|   135k|  buf1[29] = _mm256_sub_epi32(buf0[30], buf0[29]);
 1795|   135k|  buf1[30] = _mm256_add_epi32(buf0[30], buf0[29]);
 1796|       |
 1797|       |  // stage 6
 1798|   135k|  cospi = cospi_arr(cos_bit);
 1799|   135k|  buf0[0] = buf1[0];
 1800|   135k|  buf0[1] = buf1[1];
 1801|   135k|  buf0[2] = buf1[2];
 1802|   135k|  buf0[3] = buf1[3];
 1803|   135k|  btf_32_avx2_type0(cospi[8], cospi[56], buf1[7], buf1[4], buf0[4], buf0[7],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1804|   135k|                    cos_bit);
 1805|   135k|  btf_32_avx2_type0(cospi[40], cospi[24], buf1[6], buf1[5], buf0[5], buf0[6],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1806|   135k|                    cos_bit);
 1807|   135k|  buf0[8] = _mm256_add_epi32(buf1[8], buf1[9]);
 1808|   135k|  buf0[9] = _mm256_sub_epi32(buf1[8], buf1[9]);
 1809|   135k|  buf0[10] = _mm256_sub_epi32(buf1[11], buf1[10]);
 1810|   135k|  buf0[11] = _mm256_add_epi32(buf1[11], buf1[10]);
 1811|   135k|  buf0[12] = _mm256_add_epi32(buf1[12], buf1[13]);
 1812|   135k|  buf0[13] = _mm256_sub_epi32(buf1[12], buf1[13]);
 1813|   135k|  buf0[14] = _mm256_sub_epi32(buf1[15], buf1[14]);
 1814|   135k|  buf0[15] = _mm256_add_epi32(buf1[15], buf1[14]);
 1815|   135k|  buf0[16] = buf1[16];
 1816|   135k|  btf_32_avx2_type0(-cospi[8], cospi[56], buf1[17], buf1[30], buf0[17],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1817|   135k|                    buf0[30], cos_bit);
 1818|   135k|  btf_32_avx2_type0(-cospi[56], -cospi[8], buf1[18], buf1[29], buf0[18],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1819|   135k|                    buf0[29], cos_bit);
 1820|   135k|  buf0[19] = buf1[19];
 1821|   135k|  buf0[20] = buf1[20];
 1822|   135k|  btf_32_avx2_type0(-cospi[40], cospi[24], buf1[21], buf1[26], buf0[21],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1823|   135k|                    buf0[26], cos_bit);
 1824|   135k|  btf_32_avx2_type0(-cospi[24], -cospi[40], buf1[22], buf1[25], buf0[22],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1825|   135k|                    buf0[25], cos_bit);
 1826|   135k|  buf0[23] = buf1[23];
 1827|   135k|  buf0[24] = buf1[24];
 1828|   135k|  buf0[27] = buf1[27];
 1829|   135k|  buf0[28] = buf1[28];
 1830|   135k|  buf0[31] = buf1[31];
 1831|       |
 1832|       |  // stage 7
 1833|   135k|  cospi = cospi_arr(cos_bit);
 1834|   135k|  buf1[0] = buf0[0];
 1835|   135k|  buf1[1] = buf0[1];
 1836|   135k|  buf1[2] = buf0[2];
 1837|   135k|  buf1[3] = buf0[3];
 1838|   135k|  buf1[4] = buf0[4];
 1839|   135k|  buf1[5] = buf0[5];
 1840|   135k|  buf1[6] = buf0[6];
 1841|   135k|  buf1[7] = buf0[7];
 1842|   135k|  btf_32_avx2_type0(cospi[4], cospi[60], buf0[15], buf0[8], buf1[8], buf1[15],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1843|   135k|                    cos_bit);
 1844|   135k|  btf_32_avx2_type0(cospi[36], cospi[28], buf0[14], buf0[9], buf1[9], buf1[14],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1845|   135k|                    cos_bit);
 1846|   135k|  btf_32_avx2_type0(cospi[20], cospi[44], buf0[13], buf0[10], buf1[10],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1847|   135k|                    buf1[13], cos_bit);
 1848|   135k|  btf_32_avx2_type0(cospi[52], cospi[12], buf0[12], buf0[11], buf1[11],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1849|   135k|                    buf1[12], cos_bit);
 1850|   135k|  buf1[16] = _mm256_add_epi32(buf0[16], buf0[17]);
 1851|   135k|  buf1[17] = _mm256_sub_epi32(buf0[16], buf0[17]);
 1852|   135k|  buf1[18] = _mm256_sub_epi32(buf0[19], buf0[18]);
 1853|   135k|  buf1[19] = _mm256_add_epi32(buf0[19], buf0[18]);
 1854|   135k|  buf1[20] = _mm256_add_epi32(buf0[20], buf0[21]);
 1855|   135k|  buf1[21] = _mm256_sub_epi32(buf0[20], buf0[21]);
 1856|   135k|  buf1[22] = _mm256_sub_epi32(buf0[23], buf0[22]);
 1857|   135k|  buf1[23] = _mm256_add_epi32(buf0[23], buf0[22]);
 1858|   135k|  buf1[24] = _mm256_add_epi32(buf0[24], buf0[25]);
 1859|   135k|  buf1[25] = _mm256_sub_epi32(buf0[24], buf0[25]);
 1860|   135k|  buf1[26] = _mm256_sub_epi32(buf0[27], buf0[26]);
 1861|   135k|  buf1[27] = _mm256_add_epi32(buf0[27], buf0[26]);
 1862|   135k|  buf1[28] = _mm256_add_epi32(buf0[28], buf0[29]);
 1863|   135k|  buf1[29] = _mm256_sub_epi32(buf0[28], buf0[29]);
 1864|   135k|  buf1[30] = _mm256_sub_epi32(buf0[31], buf0[30]);
 1865|   135k|  buf1[31] = _mm256_add_epi32(buf0[31], buf0[30]);
 1866|       |
 1867|       |  // stage 8
 1868|   135k|  cospi = cospi_arr(cos_bit);
 1869|   135k|  buf0[0] = buf1[0];
 1870|   135k|  buf0[1] = buf1[1];
 1871|   135k|  buf0[2] = buf1[2];
 1872|   135k|  buf0[3] = buf1[3];
 1873|   135k|  buf0[4] = buf1[4];
 1874|   135k|  buf0[5] = buf1[5];
 1875|   135k|  buf0[6] = buf1[6];
 1876|   135k|  buf0[7] = buf1[7];
 1877|   135k|  buf0[8] = buf1[8];
 1878|   135k|  buf0[9] = buf1[9];
 1879|   135k|  buf0[10] = buf1[10];
 1880|   135k|  buf0[11] = buf1[11];
 1881|   135k|  buf0[12] = buf1[12];
 1882|   135k|  buf0[13] = buf1[13];
 1883|   135k|  buf0[14] = buf1[14];
 1884|   135k|  buf0[15] = buf1[15];
 1885|   135k|  btf_32_avx2_type0(cospi[2], cospi[62], buf1[31], buf1[16], buf0[16], buf0[31],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1886|   135k|                    cos_bit);
 1887|   135k|  btf_32_avx2_type0(cospi[34], cospi[30], buf1[30], buf1[17], buf0[17],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1888|   135k|                    buf0[30], cos_bit);
 1889|   135k|  btf_32_avx2_type0(cospi[18], cospi[46], buf1[29], buf1[18], buf0[18],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1890|   135k|                    buf0[29], cos_bit);
 1891|   135k|  btf_32_avx2_type0(cospi[50], cospi[14], buf1[28], buf1[19], buf0[19],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1892|   135k|                    buf0[28], cos_bit);
 1893|   135k|  btf_32_avx2_type0(cospi[10], cospi[54], buf1[27], buf1[20], buf0[20],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1894|   135k|                    buf0[27], cos_bit);
 1895|   135k|  btf_32_avx2_type0(cospi[42], cospi[22], buf1[26], buf1[21], buf0[21],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1896|   135k|                    buf0[26], cos_bit);
 1897|   135k|  btf_32_avx2_type0(cospi[26], cospi[38], buf1[25], buf1[22], buf0[22],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1898|   135k|                    buf0[25], cos_bit);
 1899|   135k|  btf_32_avx2_type0(cospi[58], cospi[6], buf1[24], buf1[23], buf0[23], buf0[24],
  ------------------
  |  |  225|   135k|  do {                                                       \
  |  |  226|   135k|    const __m256i ww0 = _mm256_set1_epi32(w0);               \
  |  |  227|   135k|    const __m256i ww1 = _mm256_set1_epi32(w1);               \
  |  |  228|   135k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);     \
  |  |  229|   135k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);     \
  |  |  230|   135k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                 \
  |  |  231|   135k|    round_shift_32_8xn_avx2(&out0, 1, -bit, 1);              \
  |  |  232|   135k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);     \
  |  |  233|   135k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);     \
  |  |  234|   135k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                 \
  |  |  235|   135k|    round_shift_32_8xn_avx2(&out1, 1, -bit, 1);              \
  |  |  236|   135k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (236:12): [Folded, False: 135k]
  |  |  ------------------
  ------------------
 1900|   135k|                    cos_bit);
 1901|       |
 1902|   135k|  startidx = 0 * outstride;
 1903|   135k|  endidx = 31 * outstride;
 1904|       |  // stage 9
 1905|   135k|  output[startidx] = buf0[0];
 1906|   135k|  output[endidx] = buf0[31];
 1907|   135k|  startidx += outstride;
 1908|   135k|  endidx -= outstride;
 1909|   135k|  output[startidx] = buf0[16];
 1910|   135k|  output[endidx] = buf0[15];
 1911|   135k|  startidx += outstride;
 1912|   135k|  endidx -= outstride;
 1913|   135k|  output[startidx] = buf0[8];
 1914|   135k|  output[endidx] = buf0[23];
 1915|   135k|  startidx += outstride;
 1916|   135k|  endidx -= outstride;
 1917|   135k|  output[startidx] = buf0[24];
 1918|   135k|  output[endidx] = buf0[7];
 1919|   135k|  startidx += outstride;
 1920|   135k|  endidx -= outstride;
 1921|   135k|  output[startidx] = buf0[4];
 1922|   135k|  output[endidx] = buf0[27];
 1923|   135k|  startidx += outstride;
 1924|   135k|  endidx -= outstride;
 1925|   135k|  output[startidx] = buf0[20];
 1926|   135k|  output[endidx] = buf0[11];
 1927|   135k|  startidx += outstride;
 1928|   135k|  endidx -= outstride;
 1929|   135k|  output[startidx] = buf0[12];
 1930|   135k|  output[endidx] = buf0[19];
 1931|   135k|  startidx += outstride;
 1932|   135k|  endidx -= outstride;
 1933|   135k|  output[startidx] = buf0[28];
 1934|   135k|  output[endidx] = buf0[3];
 1935|   135k|  startidx += outstride;
 1936|   135k|  endidx -= outstride;
 1937|   135k|  output[startidx] = buf0[2];
 1938|   135k|  output[endidx] = buf0[29];
 1939|   135k|  startidx += outstride;
 1940|   135k|  endidx -= outstride;
 1941|   135k|  output[startidx] = buf0[18];
 1942|   135k|  output[endidx] = buf0[13];
 1943|   135k|  startidx += outstride;
 1944|   135k|  endidx -= outstride;
 1945|   135k|  output[startidx] = buf0[10];
 1946|   135k|  output[endidx] = buf0[21];
 1947|   135k|  startidx += outstride;
 1948|   135k|  endidx -= outstride;
 1949|   135k|  output[startidx] = buf0[26];
 1950|   135k|  output[endidx] = buf0[5];
 1951|   135k|  startidx += outstride;
 1952|   135k|  endidx -= outstride;
 1953|   135k|  output[startidx] = buf0[6];
 1954|   135k|  output[endidx] = buf0[25];
 1955|   135k|  startidx += outstride;
 1956|   135k|  endidx -= outstride;
 1957|   135k|  output[startidx] = buf0[22];
 1958|   135k|  output[endidx] = buf0[9];
 1959|   135k|  startidx += outstride;
 1960|   135k|  endidx -= outstride;
 1961|   135k|  output[startidx] = buf0[14];
 1962|   135k|  output[endidx] = buf0[17];
 1963|   135k|  startidx += outstride;
 1964|   135k|  endidx -= outstride;
 1965|   135k|  output[startidx] = buf0[30];
 1966|   135k|  output[endidx] = buf0[1];
 1967|   135k|}
highbd_fwd_txfm_avx2.c:idtx32x32_avx2:
 1970|  29.5k|                                  int outstride) {
 1971|  29.5k|  (void)cos_bit;
 1972|   147k|  for (int i = 0; i < 32; i += 8) {
  ------------------
  |  Branch (1972:19): [True: 118k, False: 29.5k]
  ------------------
 1973|   118k|    output[i * outstride] = _mm256_slli_epi32(input[i * instride], 2);
 1974|   118k|    output[(i + 1) * outstride] =
 1975|   118k|        _mm256_slli_epi32(input[(i + 1) * instride], 2);
 1976|   118k|    output[(i + 2) * outstride] =
 1977|   118k|        _mm256_slli_epi32(input[(i + 2) * instride], 2);
 1978|   118k|    output[(i + 3) * outstride] =
 1979|   118k|        _mm256_slli_epi32(input[(i + 3) * instride], 2);
 1980|   118k|    output[(i + 4) * outstride] =
 1981|   118k|        _mm256_slli_epi32(input[(i + 4) * instride], 2);
 1982|   118k|    output[(i + 5) * outstride] =
 1983|   118k|        _mm256_slli_epi32(input[(i + 5) * instride], 2);
 1984|   118k|    output[(i + 6) * outstride] =
 1985|   118k|        _mm256_slli_epi32(input[(i + 6) * instride], 2);
 1986|   118k|    output[(i + 7) * outstride] =
 1987|   118k|        _mm256_slli_epi32(input[(i + 7) * instride], 2);
 1988|   118k|  }
 1989|  29.5k|}
highbd_fwd_txfm_avx2.c:fdct64_avx2:
 2775|  16.0k|                        const int instride, const int outstride) {
 2776|  16.0k|  const int32_t *cospi = cospi_arr(cos_bit);
 2777|  16.0k|  const __m256i __rounding = _mm256_set1_epi32(1 << (cos_bit - 1));
 2778|  16.0k|  __m256i cospi_m32 = _mm256_set1_epi32(-cospi[32]);
 2779|  16.0k|  __m256i cospi_p32 = _mm256_set1_epi32(cospi[32]);
 2780|  16.0k|  __m256i cospi_m16 = _mm256_set1_epi32(-cospi[16]);
 2781|  16.0k|  __m256i cospi_p48 = _mm256_set1_epi32(cospi[48]);
 2782|  16.0k|  __m256i cospi_m48 = _mm256_set1_epi32(-cospi[48]);
 2783|  16.0k|  __m256i cospi_p16 = _mm256_set1_epi32(cospi[16]);
 2784|  16.0k|  __m256i cospi_m08 = _mm256_set1_epi32(-cospi[8]);
 2785|  16.0k|  __m256i cospi_p56 = _mm256_set1_epi32(cospi[56]);
 2786|  16.0k|  __m256i cospi_m56 = _mm256_set1_epi32(-cospi[56]);
 2787|  16.0k|  __m256i cospi_m40 = _mm256_set1_epi32(-cospi[40]);
 2788|  16.0k|  __m256i cospi_p24 = _mm256_set1_epi32(cospi[24]);
 2789|  16.0k|  __m256i cospi_m24 = _mm256_set1_epi32(-cospi[24]);
 2790|  16.0k|  __m256i cospi_p08 = _mm256_set1_epi32(cospi[8]);
 2791|  16.0k|  __m256i cospi_p40 = _mm256_set1_epi32(cospi[40]);
 2792|       |
 2793|  16.0k|  int startidx = 0 * instride;
 2794|  16.0k|  int endidx = 63 * instride;
 2795|       |  // stage 1
 2796|  16.0k|  __m256i x1[64];
 2797|  16.0k|  x1[0] = _mm256_add_epi32(input[startidx], input[endidx]);
 2798|  16.0k|  x1[63] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2799|  16.0k|  startidx += instride;
 2800|  16.0k|  endidx -= instride;
 2801|  16.0k|  x1[1] = _mm256_add_epi32(input[startidx], input[endidx]);
 2802|  16.0k|  x1[62] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2803|  16.0k|  startidx += instride;
 2804|  16.0k|  endidx -= instride;
 2805|  16.0k|  x1[2] = _mm256_add_epi32(input[startidx], input[endidx]);
 2806|  16.0k|  x1[61] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2807|  16.0k|  startidx += instride;
 2808|  16.0k|  endidx -= instride;
 2809|  16.0k|  x1[3] = _mm256_add_epi32(input[startidx], input[endidx]);
 2810|  16.0k|  x1[60] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2811|  16.0k|  startidx += instride;
 2812|  16.0k|  endidx -= instride;
 2813|  16.0k|  x1[4] = _mm256_add_epi32(input[startidx], input[endidx]);
 2814|  16.0k|  x1[59] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2815|  16.0k|  startidx += instride;
 2816|  16.0k|  endidx -= instride;
 2817|  16.0k|  x1[5] = _mm256_add_epi32(input[startidx], input[endidx]);
 2818|  16.0k|  x1[58] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2819|  16.0k|  startidx += instride;
 2820|  16.0k|  endidx -= instride;
 2821|  16.0k|  x1[6] = _mm256_add_epi32(input[startidx], input[endidx]);
 2822|  16.0k|  x1[57] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2823|  16.0k|  startidx += instride;
 2824|  16.0k|  endidx -= instride;
 2825|  16.0k|  x1[7] = _mm256_add_epi32(input[startidx], input[endidx]);
 2826|  16.0k|  x1[56] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2827|  16.0k|  startidx += instride;
 2828|  16.0k|  endidx -= instride;
 2829|  16.0k|  x1[8] = _mm256_add_epi32(input[startidx], input[endidx]);
 2830|  16.0k|  x1[55] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2831|  16.0k|  startidx += instride;
 2832|  16.0k|  endidx -= instride;
 2833|  16.0k|  x1[9] = _mm256_add_epi32(input[startidx], input[endidx]);
 2834|  16.0k|  x1[54] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2835|  16.0k|  startidx += instride;
 2836|  16.0k|  endidx -= instride;
 2837|  16.0k|  x1[10] = _mm256_add_epi32(input[startidx], input[endidx]);
 2838|  16.0k|  x1[53] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2839|  16.0k|  startidx += instride;
 2840|  16.0k|  endidx -= instride;
 2841|  16.0k|  x1[11] = _mm256_add_epi32(input[startidx], input[endidx]);
 2842|  16.0k|  x1[52] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2843|  16.0k|  startidx += instride;
 2844|  16.0k|  endidx -= instride;
 2845|  16.0k|  x1[12] = _mm256_add_epi32(input[startidx], input[endidx]);
 2846|  16.0k|  x1[51] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2847|  16.0k|  startidx += instride;
 2848|  16.0k|  endidx -= instride;
 2849|  16.0k|  x1[13] = _mm256_add_epi32(input[startidx], input[endidx]);
 2850|  16.0k|  x1[50] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2851|  16.0k|  startidx += instride;
 2852|  16.0k|  endidx -= instride;
 2853|  16.0k|  x1[14] = _mm256_add_epi32(input[startidx], input[endidx]);
 2854|  16.0k|  x1[49] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2855|  16.0k|  startidx += instride;
 2856|  16.0k|  endidx -= instride;
 2857|  16.0k|  x1[15] = _mm256_add_epi32(input[startidx], input[endidx]);
 2858|  16.0k|  x1[48] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2859|  16.0k|  startidx += instride;
 2860|  16.0k|  endidx -= instride;
 2861|  16.0k|  x1[16] = _mm256_add_epi32(input[startidx], input[endidx]);
 2862|  16.0k|  x1[47] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2863|  16.0k|  startidx += instride;
 2864|  16.0k|  endidx -= instride;
 2865|  16.0k|  x1[17] = _mm256_add_epi32(input[startidx], input[endidx]);
 2866|  16.0k|  x1[46] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2867|  16.0k|  startidx += instride;
 2868|  16.0k|  endidx -= instride;
 2869|  16.0k|  x1[18] = _mm256_add_epi32(input[startidx], input[endidx]);
 2870|  16.0k|  x1[45] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2871|  16.0k|  startidx += instride;
 2872|  16.0k|  endidx -= instride;
 2873|  16.0k|  x1[19] = _mm256_add_epi32(input[startidx], input[endidx]);
 2874|  16.0k|  x1[44] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2875|  16.0k|  startidx += instride;
 2876|  16.0k|  endidx -= instride;
 2877|  16.0k|  x1[20] = _mm256_add_epi32(input[startidx], input[endidx]);
 2878|  16.0k|  x1[43] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2879|  16.0k|  startidx += instride;
 2880|  16.0k|  endidx -= instride;
 2881|  16.0k|  x1[21] = _mm256_add_epi32(input[startidx], input[endidx]);
 2882|  16.0k|  x1[42] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2883|  16.0k|  startidx += instride;
 2884|  16.0k|  endidx -= instride;
 2885|  16.0k|  x1[22] = _mm256_add_epi32(input[startidx], input[endidx]);
 2886|  16.0k|  x1[41] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2887|  16.0k|  startidx += instride;
 2888|  16.0k|  endidx -= instride;
 2889|  16.0k|  x1[23] = _mm256_add_epi32(input[startidx], input[endidx]);
 2890|  16.0k|  x1[40] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2891|  16.0k|  startidx += instride;
 2892|  16.0k|  endidx -= instride;
 2893|  16.0k|  x1[24] = _mm256_add_epi32(input[startidx], input[endidx]);
 2894|  16.0k|  x1[39] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2895|  16.0k|  startidx += instride;
 2896|  16.0k|  endidx -= instride;
 2897|  16.0k|  x1[25] = _mm256_add_epi32(input[startidx], input[endidx]);
 2898|  16.0k|  x1[38] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2899|  16.0k|  startidx += instride;
 2900|  16.0k|  endidx -= instride;
 2901|  16.0k|  x1[26] = _mm256_add_epi32(input[startidx], input[endidx]);
 2902|  16.0k|  x1[37] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2903|  16.0k|  startidx += instride;
 2904|  16.0k|  endidx -= instride;
 2905|  16.0k|  x1[27] = _mm256_add_epi32(input[startidx], input[endidx]);
 2906|  16.0k|  x1[36] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2907|  16.0k|  startidx += instride;
 2908|  16.0k|  endidx -= instride;
 2909|  16.0k|  x1[28] = _mm256_add_epi32(input[startidx], input[endidx]);
 2910|  16.0k|  x1[35] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2911|  16.0k|  startidx += instride;
 2912|  16.0k|  endidx -= instride;
 2913|  16.0k|  x1[29] = _mm256_add_epi32(input[startidx], input[endidx]);
 2914|  16.0k|  x1[34] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2915|  16.0k|  startidx += instride;
 2916|  16.0k|  endidx -= instride;
 2917|  16.0k|  x1[30] = _mm256_add_epi32(input[startidx], input[endidx]);
 2918|  16.0k|  x1[33] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2919|  16.0k|  startidx += instride;
 2920|  16.0k|  endidx -= instride;
 2921|  16.0k|  x1[31] = _mm256_add_epi32(input[startidx], input[endidx]);
 2922|  16.0k|  x1[32] = _mm256_sub_epi32(input[startidx], input[endidx]);
 2923|       |
 2924|       |  // stage 2
 2925|  16.0k|  __m256i x2[64];
 2926|  16.0k|  fdct64_stage2_avx2(x1, x2, &cospi_m32, &cospi_p32, &__rounding, cos_bit);
 2927|       |  // stage 3
 2928|  16.0k|  fdct64_stage3_avx2(x2, x1, &cospi_m32, &cospi_p32, &__rounding, cos_bit);
 2929|       |  // stage 4
 2930|  16.0k|  fdct64_stage4_avx2(x1, x2, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48,
 2931|  16.0k|                     &cospi_m48, &__rounding, cos_bit);
 2932|       |  // stage 5
 2933|  16.0k|  fdct64_stage5_avx2(x2, x1, &cospi_m32, &cospi_p32, &cospi_m16, &cospi_p48,
 2934|  16.0k|                     &cospi_m48, &__rounding, cos_bit);
 2935|       |  // stage 6
 2936|  16.0k|  fdct64_stage6_avx2(x1, x2, &cospi_p16, &cospi_p32, &cospi_m16, &cospi_p48,
 2937|  16.0k|                     &cospi_m48, &cospi_m08, &cospi_p56, &cospi_m56, &cospi_m40,
 2938|  16.0k|                     &cospi_p24, &cospi_m24, &__rounding, cos_bit);
 2939|       |  // stage 7
 2940|  16.0k|  fdct64_stage7_avx2(x2, x1, &cospi_p08, &cospi_p56, &cospi_p40, &cospi_p24,
 2941|  16.0k|                     &cospi_m08, &cospi_m56, &cospi_m40, &cospi_m24,
 2942|  16.0k|                     &__rounding, cos_bit);
 2943|       |  // stage 8
 2944|  16.0k|  fdct64_stage8_avx2(x1, x2, cospi, &__rounding, cos_bit);
 2945|       |  // stage 9
 2946|  16.0k|  fdct64_stage9_avx2(x2, x1, cospi, &__rounding, cos_bit);
 2947|       |  // stage 10
 2948|  16.0k|  fdct64_stage10_avx2(x1, x2, cospi, &__rounding, cos_bit);
 2949|       |
 2950|  16.0k|  startidx = 0 * outstride;
 2951|  16.0k|  endidx = 63 * outstride;
 2952|       |
 2953|       |  // stage 11
 2954|  16.0k|  output[startidx] = x2[0];
 2955|  16.0k|  output[endidx] = x2[63];
 2956|  16.0k|  startidx += outstride;
 2957|  16.0k|  endidx -= outstride;
 2958|  16.0k|  output[startidx] = x2[32];
 2959|  16.0k|  output[endidx] = x2[31];
 2960|  16.0k|  startidx += outstride;
 2961|  16.0k|  endidx -= outstride;
 2962|  16.0k|  output[startidx] = x2[16];
 2963|  16.0k|  output[endidx] = x2[47];
 2964|  16.0k|  startidx += outstride;
 2965|  16.0k|  endidx -= outstride;
 2966|  16.0k|  output[startidx] = x2[48];
 2967|  16.0k|  output[endidx] = x2[15];
 2968|  16.0k|  startidx += outstride;
 2969|  16.0k|  endidx -= outstride;
 2970|  16.0k|  output[startidx] = x2[8];
 2971|  16.0k|  output[endidx] = x2[55];
 2972|  16.0k|  startidx += outstride;
 2973|  16.0k|  endidx -= outstride;
 2974|  16.0k|  output[startidx] = x2[40];
 2975|  16.0k|  output[endidx] = x2[23];
 2976|  16.0k|  startidx += outstride;
 2977|  16.0k|  endidx -= outstride;
 2978|  16.0k|  output[startidx] = x2[24];
 2979|  16.0k|  output[endidx] = x2[39];
 2980|  16.0k|  startidx += outstride;
 2981|  16.0k|  endidx -= outstride;
 2982|  16.0k|  output[startidx] = x2[56];
 2983|  16.0k|  output[endidx] = x2[7];
 2984|  16.0k|  startidx += outstride;
 2985|  16.0k|  endidx -= outstride;
 2986|  16.0k|  output[startidx] = x2[4];
 2987|  16.0k|  output[endidx] = x2[59];
 2988|  16.0k|  startidx += outstride;
 2989|  16.0k|  endidx -= outstride;
 2990|  16.0k|  output[startidx] = x2[36];
 2991|  16.0k|  output[endidx] = x2[27];
 2992|  16.0k|  startidx += outstride;
 2993|  16.0k|  endidx -= outstride;
 2994|  16.0k|  output[startidx] = x2[20];
 2995|  16.0k|  output[endidx] = x2[43];
 2996|  16.0k|  startidx += outstride;
 2997|  16.0k|  endidx -= outstride;
 2998|  16.0k|  output[startidx] = x2[52];
 2999|  16.0k|  output[endidx] = x2[11];
 3000|  16.0k|  startidx += outstride;
 3001|  16.0k|  endidx -= outstride;
 3002|  16.0k|  output[startidx] = x2[12];
 3003|  16.0k|  output[endidx] = x2[51];
 3004|  16.0k|  startidx += outstride;
 3005|  16.0k|  endidx -= outstride;
 3006|  16.0k|  output[startidx] = x2[44];
 3007|  16.0k|  output[endidx] = x2[19];
 3008|  16.0k|  startidx += outstride;
 3009|  16.0k|  endidx -= outstride;
 3010|  16.0k|  output[startidx] = x2[28];
 3011|  16.0k|  output[endidx] = x2[35];
 3012|  16.0k|  startidx += outstride;
 3013|  16.0k|  endidx -= outstride;
 3014|  16.0k|  output[startidx] = x2[60];
 3015|  16.0k|  output[endidx] = x2[3];
 3016|  16.0k|  startidx += outstride;
 3017|  16.0k|  endidx -= outstride;
 3018|  16.0k|  output[startidx] = x2[2];
 3019|  16.0k|  output[endidx] = x2[61];
 3020|  16.0k|  startidx += outstride;
 3021|  16.0k|  endidx -= outstride;
 3022|  16.0k|  output[startidx] = x2[34];
 3023|  16.0k|  output[endidx] = x2[29];
 3024|  16.0k|  startidx += outstride;
 3025|  16.0k|  endidx -= outstride;
 3026|  16.0k|  output[startidx] = x2[18];
 3027|  16.0k|  output[endidx] = x2[45];
 3028|  16.0k|  startidx += outstride;
 3029|  16.0k|  endidx -= outstride;
 3030|  16.0k|  output[startidx] = x2[50];
 3031|  16.0k|  output[endidx] = x2[13];
 3032|  16.0k|  startidx += outstride;
 3033|  16.0k|  endidx -= outstride;
 3034|  16.0k|  output[startidx] = x2[10];
 3035|  16.0k|  output[endidx] = x2[53];
 3036|  16.0k|  startidx += outstride;
 3037|  16.0k|  endidx -= outstride;
 3038|  16.0k|  output[startidx] = x2[42];
 3039|  16.0k|  output[endidx] = x2[21];
 3040|  16.0k|  startidx += outstride;
 3041|  16.0k|  endidx -= outstride;
 3042|  16.0k|  output[startidx] = x2[26];
 3043|  16.0k|  output[endidx] = x2[37];
 3044|  16.0k|  startidx += outstride;
 3045|  16.0k|  endidx -= outstride;
 3046|  16.0k|  output[startidx] = x2[58];
 3047|  16.0k|  output[endidx] = x2[5];
 3048|  16.0k|  startidx += outstride;
 3049|  16.0k|  endidx -= outstride;
 3050|  16.0k|  output[startidx] = x2[6];
 3051|  16.0k|  output[endidx] = x2[57];
 3052|  16.0k|  startidx += outstride;
 3053|  16.0k|  endidx -= outstride;
 3054|  16.0k|  output[startidx] = x2[38];
 3055|  16.0k|  output[endidx] = x2[25];
 3056|  16.0k|  startidx += outstride;
 3057|  16.0k|  endidx -= outstride;
 3058|  16.0k|  output[startidx] = x2[22];
 3059|  16.0k|  output[endidx] = x2[41];
 3060|  16.0k|  startidx += outstride;
 3061|  16.0k|  endidx -= outstride;
 3062|  16.0k|  output[startidx] = x2[54];
 3063|  16.0k|  output[endidx] = x2[9];
 3064|  16.0k|  startidx += outstride;
 3065|  16.0k|  endidx -= outstride;
 3066|  16.0k|  output[startidx] = x2[14];
 3067|  16.0k|  output[endidx] = x2[49];
 3068|  16.0k|  startidx += outstride;
 3069|  16.0k|  endidx -= outstride;
 3070|  16.0k|  output[startidx] = x2[46];
 3071|  16.0k|  output[endidx] = x2[17];
 3072|  16.0k|  startidx += outstride;
 3073|  16.0k|  endidx -= outstride;
 3074|  16.0k|  output[startidx] = x2[30];
 3075|  16.0k|  output[endidx] = x2[33];
 3076|  16.0k|  startidx += outstride;
 3077|  16.0k|  endidx -= outstride;
 3078|  16.0k|  output[startidx] = x2[62];
 3079|  16.0k|  output[endidx] = x2[1];
 3080|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage2_avx2:
 2079|  16.0k|                                      int8_t cos_bit) {
 2080|  16.0k|  x2[0] = _mm256_add_epi32(x1[0], x1[31]);
 2081|  16.0k|  x2[31] = _mm256_sub_epi32(x1[0], x1[31]);
 2082|  16.0k|  x2[1] = _mm256_add_epi32(x1[1], x1[30]);
 2083|  16.0k|  x2[30] = _mm256_sub_epi32(x1[1], x1[30]);
 2084|  16.0k|  x2[2] = _mm256_add_epi32(x1[2], x1[29]);
 2085|  16.0k|  x2[29] = _mm256_sub_epi32(x1[2], x1[29]);
 2086|  16.0k|  x2[3] = _mm256_add_epi32(x1[3], x1[28]);
 2087|  16.0k|  x2[28] = _mm256_sub_epi32(x1[3], x1[28]);
 2088|  16.0k|  x2[4] = _mm256_add_epi32(x1[4], x1[27]);
 2089|  16.0k|  x2[27] = _mm256_sub_epi32(x1[4], x1[27]);
 2090|  16.0k|  x2[5] = _mm256_add_epi32(x1[5], x1[26]);
 2091|  16.0k|  x2[26] = _mm256_sub_epi32(x1[5], x1[26]);
 2092|  16.0k|  x2[6] = _mm256_add_epi32(x1[6], x1[25]);
 2093|  16.0k|  x2[25] = _mm256_sub_epi32(x1[6], x1[25]);
 2094|  16.0k|  x2[7] = _mm256_add_epi32(x1[7], x1[24]);
 2095|  16.0k|  x2[24] = _mm256_sub_epi32(x1[7], x1[24]);
 2096|  16.0k|  x2[8] = _mm256_add_epi32(x1[8], x1[23]);
 2097|  16.0k|  x2[23] = _mm256_sub_epi32(x1[8], x1[23]);
 2098|  16.0k|  x2[9] = _mm256_add_epi32(x1[9], x1[22]);
 2099|  16.0k|  x2[22] = _mm256_sub_epi32(x1[9], x1[22]);
 2100|  16.0k|  x2[10] = _mm256_add_epi32(x1[10], x1[21]);
 2101|  16.0k|  x2[21] = _mm256_sub_epi32(x1[10], x1[21]);
 2102|  16.0k|  x2[11] = _mm256_add_epi32(x1[11], x1[20]);
 2103|  16.0k|  x2[20] = _mm256_sub_epi32(x1[11], x1[20]);
 2104|  16.0k|  x2[12] = _mm256_add_epi32(x1[12], x1[19]);
 2105|  16.0k|  x2[19] = _mm256_sub_epi32(x1[12], x1[19]);
 2106|  16.0k|  x2[13] = _mm256_add_epi32(x1[13], x1[18]);
 2107|  16.0k|  x2[18] = _mm256_sub_epi32(x1[13], x1[18]);
 2108|  16.0k|  x2[14] = _mm256_add_epi32(x1[14], x1[17]);
 2109|  16.0k|  x2[17] = _mm256_sub_epi32(x1[14], x1[17]);
 2110|  16.0k|  x2[15] = _mm256_add_epi32(x1[15], x1[16]);
 2111|  16.0k|  x2[16] = _mm256_sub_epi32(x1[15], x1[16]);
 2112|  16.0k|  x2[32] = x1[32];
 2113|  16.0k|  x2[33] = x1[33];
 2114|  16.0k|  x2[34] = x1[34];
 2115|  16.0k|  x2[35] = x1[35];
 2116|  16.0k|  x2[36] = x1[36];
 2117|  16.0k|  x2[37] = x1[37];
 2118|  16.0k|  x2[38] = x1[38];
 2119|  16.0k|  x2[39] = x1[39];
 2120|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[40], x1[55], x2[40], x2[55],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2121|  16.0k|                        *__rounding, cos_bit);
 2122|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[41], x1[54], x2[41], x2[54],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2123|  16.0k|                        *__rounding, cos_bit);
 2124|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[42], x1[53], x2[42], x2[53],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2125|  16.0k|                        *__rounding, cos_bit);
 2126|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[43], x1[52], x2[43], x2[52],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2127|  16.0k|                        *__rounding, cos_bit);
 2128|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[44], x1[51], x2[44], x2[51],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2129|  16.0k|                        *__rounding, cos_bit);
 2130|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[45], x1[50], x2[45], x2[50],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2131|  16.0k|                        *__rounding, cos_bit);
 2132|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[46], x1[49], x2[46], x2[49],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2133|  16.0k|                        *__rounding, cos_bit);
 2134|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x1[47], x1[48], x2[47], x2[48],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2135|  16.0k|                        *__rounding, cos_bit);
 2136|  16.0k|  x2[56] = x1[56];
 2137|  16.0k|  x2[57] = x1[57];
 2138|  16.0k|  x2[58] = x1[58];
 2139|  16.0k|  x2[59] = x1[59];
 2140|  16.0k|  x2[60] = x1[60];
 2141|  16.0k|  x2[61] = x1[61];
 2142|  16.0k|  x2[62] = x1[62];
 2143|  16.0k|  x2[63] = x1[63];
 2144|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage3_avx2:
 2148|  16.0k|                                      int8_t cos_bit) {
 2149|  16.0k|  x3[0] = _mm256_add_epi32(x2[0], x2[15]);
 2150|  16.0k|  x3[15] = _mm256_sub_epi32(x2[0], x2[15]);
 2151|  16.0k|  x3[1] = _mm256_add_epi32(x2[1], x2[14]);
 2152|  16.0k|  x3[14] = _mm256_sub_epi32(x2[1], x2[14]);
 2153|  16.0k|  x3[2] = _mm256_add_epi32(x2[2], x2[13]);
 2154|  16.0k|  x3[13] = _mm256_sub_epi32(x2[2], x2[13]);
 2155|  16.0k|  x3[3] = _mm256_add_epi32(x2[3], x2[12]);
 2156|  16.0k|  x3[12] = _mm256_sub_epi32(x2[3], x2[12]);
 2157|  16.0k|  x3[4] = _mm256_add_epi32(x2[4], x2[11]);
 2158|  16.0k|  x3[11] = _mm256_sub_epi32(x2[4], x2[11]);
 2159|  16.0k|  x3[5] = _mm256_add_epi32(x2[5], x2[10]);
 2160|  16.0k|  x3[10] = _mm256_sub_epi32(x2[5], x2[10]);
 2161|  16.0k|  x3[6] = _mm256_add_epi32(x2[6], x2[9]);
 2162|  16.0k|  x3[9] = _mm256_sub_epi32(x2[6], x2[9]);
 2163|  16.0k|  x3[7] = _mm256_add_epi32(x2[7], x2[8]);
 2164|  16.0k|  x3[8] = _mm256_sub_epi32(x2[7], x2[8]);
 2165|  16.0k|  x3[16] = x2[16];
 2166|  16.0k|  x3[17] = x2[17];
 2167|  16.0k|  x3[18] = x2[18];
 2168|  16.0k|  x3[19] = x2[19];
 2169|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x2[20], x2[27], x3[20], x3[27],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2170|  16.0k|                        *__rounding, cos_bit);
 2171|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x2[21], x2[26], x3[21], x3[26],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2172|  16.0k|                        *__rounding, cos_bit);
 2173|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x2[22], x2[25], x3[22], x3[25],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2174|  16.0k|                        *__rounding, cos_bit);
 2175|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x2[23], x2[24], x3[23], x3[24],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2176|  16.0k|                        *__rounding, cos_bit);
 2177|  16.0k|  x3[28] = x2[28];
 2178|  16.0k|  x3[29] = x2[29];
 2179|  16.0k|  x3[30] = x2[30];
 2180|  16.0k|  x3[31] = x2[31];
 2181|  16.0k|  x3[32] = _mm256_add_epi32(x2[32], x2[47]);
 2182|  16.0k|  x3[47] = _mm256_sub_epi32(x2[32], x2[47]);
 2183|  16.0k|  x3[33] = _mm256_add_epi32(x2[33], x2[46]);
 2184|  16.0k|  x3[46] = _mm256_sub_epi32(x2[33], x2[46]);
 2185|  16.0k|  x3[34] = _mm256_add_epi32(x2[34], x2[45]);
 2186|  16.0k|  x3[45] = _mm256_sub_epi32(x2[34], x2[45]);
 2187|  16.0k|  x3[35] = _mm256_add_epi32(x2[35], x2[44]);
 2188|  16.0k|  x3[44] = _mm256_sub_epi32(x2[35], x2[44]);
 2189|  16.0k|  x3[36] = _mm256_add_epi32(x2[36], x2[43]);
 2190|  16.0k|  x3[43] = _mm256_sub_epi32(x2[36], x2[43]);
 2191|  16.0k|  x3[37] = _mm256_add_epi32(x2[37], x2[42]);
 2192|  16.0k|  x3[42] = _mm256_sub_epi32(x2[37], x2[42]);
 2193|  16.0k|  x3[38] = _mm256_add_epi32(x2[38], x2[41]);
 2194|  16.0k|  x3[41] = _mm256_sub_epi32(x2[38], x2[41]);
 2195|  16.0k|  x3[39] = _mm256_add_epi32(x2[39], x2[40]);
 2196|  16.0k|  x3[40] = _mm256_sub_epi32(x2[39], x2[40]);
 2197|  16.0k|  x3[48] = _mm256_sub_epi32(x2[63], x2[48]);
 2198|  16.0k|  x3[63] = _mm256_add_epi32(x2[63], x2[48]);
 2199|  16.0k|  x3[49] = _mm256_sub_epi32(x2[62], x2[49]);
 2200|  16.0k|  x3[62] = _mm256_add_epi32(x2[62], x2[49]);
 2201|  16.0k|  x3[50] = _mm256_sub_epi32(x2[61], x2[50]);
 2202|  16.0k|  x3[61] = _mm256_add_epi32(x2[61], x2[50]);
 2203|  16.0k|  x3[51] = _mm256_sub_epi32(x2[60], x2[51]);
 2204|  16.0k|  x3[60] = _mm256_add_epi32(x2[60], x2[51]);
 2205|  16.0k|  x3[52] = _mm256_sub_epi32(x2[59], x2[52]);
 2206|  16.0k|  x3[59] = _mm256_add_epi32(x2[59], x2[52]);
 2207|  16.0k|  x3[53] = _mm256_sub_epi32(x2[58], x2[53]);
 2208|  16.0k|  x3[58] = _mm256_add_epi32(x2[58], x2[53]);
 2209|  16.0k|  x3[54] = _mm256_sub_epi32(x2[57], x2[54]);
 2210|  16.0k|  x3[57] = _mm256_add_epi32(x2[57], x2[54]);
 2211|  16.0k|  x3[55] = _mm256_sub_epi32(x2[56], x2[55]);
 2212|  16.0k|  x3[56] = _mm256_add_epi32(x2[56], x2[55]);
 2213|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage4_avx2:
 2219|  16.0k|                                      int8_t cos_bit) {
 2220|  16.0k|  x4[0] = _mm256_add_epi32(x3[0], x3[7]);
 2221|  16.0k|  x4[7] = _mm256_sub_epi32(x3[0], x3[7]);
 2222|  16.0k|  x4[1] = _mm256_add_epi32(x3[1], x3[6]);
 2223|  16.0k|  x4[6] = _mm256_sub_epi32(x3[1], x3[6]);
 2224|  16.0k|  x4[2] = _mm256_add_epi32(x3[2], x3[5]);
 2225|  16.0k|  x4[5] = _mm256_sub_epi32(x3[2], x3[5]);
 2226|  16.0k|  x4[3] = _mm256_add_epi32(x3[3], x3[4]);
 2227|  16.0k|  x4[4] = _mm256_sub_epi32(x3[3], x3[4]);
 2228|  16.0k|  x4[8] = x3[8];
 2229|  16.0k|  x4[9] = x3[9];
 2230|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x3[10], x3[13], x4[10], x4[13],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2231|  16.0k|                        *__rounding, cos_bit);
 2232|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x3[11], x3[12], x4[11], x4[12],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2233|  16.0k|                        *__rounding, cos_bit);
 2234|  16.0k|  x4[14] = x3[14];
 2235|  16.0k|  x4[15] = x3[15];
 2236|  16.0k|  x4[16] = _mm256_add_epi32(x3[16], x3[23]);
 2237|  16.0k|  x4[23] = _mm256_sub_epi32(x3[16], x3[23]);
 2238|  16.0k|  x4[17] = _mm256_add_epi32(x3[17], x3[22]);
 2239|  16.0k|  x4[22] = _mm256_sub_epi32(x3[17], x3[22]);
 2240|  16.0k|  x4[18] = _mm256_add_epi32(x3[18], x3[21]);
 2241|  16.0k|  x4[21] = _mm256_sub_epi32(x3[18], x3[21]);
 2242|  16.0k|  x4[19] = _mm256_add_epi32(x3[19], x3[20]);
 2243|  16.0k|  x4[20] = _mm256_sub_epi32(x3[19], x3[20]);
 2244|  16.0k|  x4[24] = _mm256_sub_epi32(x3[31], x3[24]);
 2245|  16.0k|  x4[31] = _mm256_add_epi32(x3[31], x3[24]);
 2246|  16.0k|  x4[25] = _mm256_sub_epi32(x3[30], x3[25]);
 2247|  16.0k|  x4[30] = _mm256_add_epi32(x3[30], x3[25]);
 2248|  16.0k|  x4[26] = _mm256_sub_epi32(x3[29], x3[26]);
 2249|  16.0k|  x4[29] = _mm256_add_epi32(x3[29], x3[26]);
 2250|  16.0k|  x4[27] = _mm256_sub_epi32(x3[28], x3[27]);
 2251|  16.0k|  x4[28] = _mm256_add_epi32(x3[28], x3[27]);
 2252|  16.0k|  x4[32] = x3[32];
 2253|  16.0k|  x4[33] = x3[33];
 2254|  16.0k|  x4[34] = x3[34];
 2255|  16.0k|  x4[35] = x3[35];
 2256|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x3[36], x3[59], x4[36], x4[59],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2257|  16.0k|                        *__rounding, cos_bit);
 2258|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x3[37], x3[58], x4[37], x4[58],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2259|  16.0k|                        *__rounding, cos_bit);
 2260|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x3[38], x3[57], x4[38], x4[57],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2261|  16.0k|                        *__rounding, cos_bit);
 2262|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x3[39], x3[56], x4[39], x4[56],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2263|  16.0k|                        *__rounding, cos_bit);
 2264|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x3[40], x3[55], x4[40], x4[55],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2265|  16.0k|                        *__rounding, cos_bit);
 2266|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x3[41], x3[54], x4[41], x4[54],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2267|  16.0k|                        *__rounding, cos_bit);
 2268|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x3[42], x3[53], x4[42], x4[53],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2269|  16.0k|                        *__rounding, cos_bit);
 2270|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x3[43], x3[52], x4[43], x4[52],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2271|  16.0k|                        *__rounding, cos_bit);
 2272|  16.0k|  x4[44] = x3[44];
 2273|  16.0k|  x4[45] = x3[45];
 2274|  16.0k|  x4[46] = x3[46];
 2275|  16.0k|  x4[47] = x3[47];
 2276|  16.0k|  x4[48] = x3[48];
 2277|  16.0k|  x4[49] = x3[49];
 2278|  16.0k|  x4[50] = x3[50];
 2279|  16.0k|  x4[51] = x3[51];
 2280|  16.0k|  x4[60] = x3[60];
 2281|  16.0k|  x4[61] = x3[61];
 2282|  16.0k|  x4[62] = x3[62];
 2283|  16.0k|  x4[63] = x3[63];
 2284|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage5_avx2:
 2290|  16.0k|                                      int8_t cos_bit) {
 2291|  16.0k|  x5[0] = _mm256_add_epi32(x4[0], x4[3]);
 2292|  16.0k|  x5[3] = _mm256_sub_epi32(x4[0], x4[3]);
 2293|  16.0k|  x5[1] = _mm256_add_epi32(x4[1], x4[2]);
 2294|  16.0k|  x5[2] = _mm256_sub_epi32(x4[1], x4[2]);
 2295|  16.0k|  x5[4] = x4[4];
 2296|  16.0k|  btf_32_type0_avx2_new(*cospi_m32, *cospi_p32, x4[5], x4[6], x5[5], x5[6],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2297|  16.0k|                        *__rounding, cos_bit);
 2298|  16.0k|  x5[7] = x4[7];
 2299|  16.0k|  x5[8] = _mm256_add_epi32(x4[8], x4[11]);
 2300|  16.0k|  x5[11] = _mm256_sub_epi32(x4[8], x4[11]);
 2301|  16.0k|  x5[9] = _mm256_add_epi32(x4[9], x4[10]);
 2302|  16.0k|  x5[10] = _mm256_sub_epi32(x4[9], x4[10]);
 2303|  16.0k|  x5[12] = _mm256_sub_epi32(x4[15], x4[12]);
 2304|  16.0k|  x5[15] = _mm256_add_epi32(x4[15], x4[12]);
 2305|  16.0k|  x5[13] = _mm256_sub_epi32(x4[14], x4[13]);
 2306|  16.0k|  x5[14] = _mm256_add_epi32(x4[14], x4[13]);
 2307|  16.0k|  x5[16] = x4[16];
 2308|  16.0k|  x5[17] = x4[17];
 2309|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x4[18], x4[29], x5[18], x5[29],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2310|  16.0k|                        *__rounding, cos_bit);
 2311|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x4[19], x4[28], x5[19], x5[28],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2312|  16.0k|                        *__rounding, cos_bit);
 2313|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x4[20], x4[27], x5[20], x5[27],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2314|  16.0k|                        *__rounding, cos_bit);
 2315|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x4[21], x4[26], x5[21], x5[26],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2316|  16.0k|                        *__rounding, cos_bit);
 2317|  16.0k|  x5[22] = x4[22];
 2318|  16.0k|  x5[23] = x4[23];
 2319|  16.0k|  x5[24] = x4[24];
 2320|  16.0k|  x5[25] = x4[25];
 2321|  16.0k|  x5[30] = x4[30];
 2322|  16.0k|  x5[31] = x4[31];
 2323|  16.0k|  x5[32] = _mm256_add_epi32(x4[32], x4[39]);
 2324|  16.0k|  x5[39] = _mm256_sub_epi32(x4[32], x4[39]);
 2325|  16.0k|  x5[33] = _mm256_add_epi32(x4[33], x4[38]);
 2326|  16.0k|  x5[38] = _mm256_sub_epi32(x4[33], x4[38]);
 2327|  16.0k|  x5[34] = _mm256_add_epi32(x4[34], x4[37]);
 2328|  16.0k|  x5[37] = _mm256_sub_epi32(x4[34], x4[37]);
 2329|  16.0k|  x5[35] = _mm256_add_epi32(x4[35], x4[36]);
 2330|  16.0k|  x5[36] = _mm256_sub_epi32(x4[35], x4[36]);
 2331|  16.0k|  x5[40] = _mm256_sub_epi32(x4[47], x4[40]);
 2332|  16.0k|  x5[47] = _mm256_add_epi32(x4[47], x4[40]);
 2333|  16.0k|  x5[41] = _mm256_sub_epi32(x4[46], x4[41]);
 2334|  16.0k|  x5[46] = _mm256_add_epi32(x4[46], x4[41]);
 2335|  16.0k|  x5[42] = _mm256_sub_epi32(x4[45], x4[42]);
 2336|  16.0k|  x5[45] = _mm256_add_epi32(x4[45], x4[42]);
 2337|  16.0k|  x5[43] = _mm256_sub_epi32(x4[44], x4[43]);
 2338|  16.0k|  x5[44] = _mm256_add_epi32(x4[44], x4[43]);
 2339|  16.0k|  x5[48] = _mm256_add_epi32(x4[48], x4[55]);
 2340|  16.0k|  x5[55] = _mm256_sub_epi32(x4[48], x4[55]);
 2341|  16.0k|  x5[49] = _mm256_add_epi32(x4[49], x4[54]);
 2342|  16.0k|  x5[54] = _mm256_sub_epi32(x4[49], x4[54]);
 2343|  16.0k|  x5[50] = _mm256_add_epi32(x4[50], x4[53]);
 2344|  16.0k|  x5[53] = _mm256_sub_epi32(x4[50], x4[53]);
 2345|  16.0k|  x5[51] = _mm256_add_epi32(x4[51], x4[52]);
 2346|  16.0k|  x5[52] = _mm256_sub_epi32(x4[51], x4[52]);
 2347|  16.0k|  x5[56] = _mm256_sub_epi32(x4[63], x4[56]);
 2348|  16.0k|  x5[63] = _mm256_add_epi32(x4[63], x4[56]);
 2349|  16.0k|  x5[57] = _mm256_sub_epi32(x4[62], x4[57]);
 2350|  16.0k|  x5[62] = _mm256_add_epi32(x4[62], x4[57]);
 2351|  16.0k|  x5[58] = _mm256_sub_epi32(x4[61], x4[58]);
 2352|  16.0k|  x5[61] = _mm256_add_epi32(x4[61], x4[58]);
 2353|  16.0k|  x5[59] = _mm256_sub_epi32(x4[60], x4[59]);
 2354|  16.0k|  x5[60] = _mm256_add_epi32(x4[60], x4[59]);
 2355|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage6_avx2:
 2361|  16.0k|    const __m256i *__rounding, int8_t cos_bit) {
 2362|  16.0k|  btf_32_type0_avx2_new(*cospi_p32, *cospi_p32, x5[0], x5[1], x6[0], x6[1],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2363|  16.0k|                        *__rounding, cos_bit);
 2364|  16.0k|  btf_32_type0_avx2_new(*cospi_p16, *cospi_p48, x5[3], x5[2], x6[2], x6[3],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2365|  16.0k|                        *__rounding, cos_bit);
 2366|  16.0k|  x6[4] = _mm256_add_epi32(x5[4], x5[5]);
 2367|  16.0k|  x6[5] = _mm256_sub_epi32(x5[4], x5[5]);
 2368|  16.0k|  x6[6] = _mm256_sub_epi32(x5[7], x5[6]);
 2369|  16.0k|  x6[7] = _mm256_add_epi32(x5[7], x5[6]);
 2370|  16.0k|  x6[8] = x5[8];
 2371|  16.0k|  btf_32_type0_avx2_new(*cospi_m16, *cospi_p48, x5[9], x5[14], x6[9], x6[14],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2372|  16.0k|                        *__rounding, cos_bit);
 2373|  16.0k|  btf_32_type0_avx2_new(*cospi_m48, *cospi_m16, x5[10], x5[13], x6[10], x6[13],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2374|  16.0k|                        *__rounding, cos_bit);
 2375|  16.0k|  x6[11] = x5[11];
 2376|  16.0k|  x6[12] = x5[12];
 2377|  16.0k|  x6[15] = x5[15];
 2378|  16.0k|  x6[16] = _mm256_add_epi32(x5[16], x5[19]);
 2379|  16.0k|  x6[19] = _mm256_sub_epi32(x5[16], x5[19]);
 2380|  16.0k|  x6[17] = _mm256_add_epi32(x5[17], x5[18]);
 2381|  16.0k|  x6[18] = _mm256_sub_epi32(x5[17], x5[18]);
 2382|  16.0k|  x6[20] = _mm256_sub_epi32(x5[23], x5[20]);
 2383|  16.0k|  x6[23] = _mm256_add_epi32(x5[23], x5[20]);
 2384|  16.0k|  x6[21] = _mm256_sub_epi32(x5[22], x5[21]);
 2385|  16.0k|  x6[22] = _mm256_add_epi32(x5[22], x5[21]);
 2386|  16.0k|  x6[24] = _mm256_add_epi32(x5[24], x5[27]);
 2387|  16.0k|  x6[27] = _mm256_sub_epi32(x5[24], x5[27]);
 2388|  16.0k|  x6[25] = _mm256_add_epi32(x5[25], x5[26]);
 2389|  16.0k|  x6[26] = _mm256_sub_epi32(x5[25], x5[26]);
 2390|  16.0k|  x6[28] = _mm256_sub_epi32(x5[31], x5[28]);
 2391|  16.0k|  x6[31] = _mm256_add_epi32(x5[31], x5[28]);
 2392|  16.0k|  x6[29] = _mm256_sub_epi32(x5[30], x5[29]);
 2393|  16.0k|  x6[30] = _mm256_add_epi32(x5[30], x5[29]);
 2394|  16.0k|  x6[32] = x5[32];
 2395|  16.0k|  x6[33] = x5[33];
 2396|  16.0k|  btf_32_type0_avx2_new(*cospi_m08, *cospi_p56, x5[34], x5[61], x6[34], x6[61],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2397|  16.0k|                        *__rounding, cos_bit);
 2398|  16.0k|  btf_32_type0_avx2_new(*cospi_m08, *cospi_p56, x5[35], x5[60], x6[35], x6[60],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2399|  16.0k|                        *__rounding, cos_bit);
 2400|  16.0k|  btf_32_type0_avx2_new(*cospi_m56, *cospi_m08, x5[36], x5[59], x6[36], x6[59],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2401|  16.0k|                        *__rounding, cos_bit);
 2402|  16.0k|  btf_32_type0_avx2_new(*cospi_m56, *cospi_m08, x5[37], x5[58], x6[37], x6[58],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2403|  16.0k|                        *__rounding, cos_bit);
 2404|  16.0k|  x6[38] = x5[38];
 2405|  16.0k|  x6[39] = x5[39];
 2406|  16.0k|  x6[40] = x5[40];
 2407|  16.0k|  x6[41] = x5[41];
 2408|  16.0k|  btf_32_type0_avx2_new(*cospi_m40, *cospi_p24, x5[42], x5[53], x6[42], x6[53],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2409|  16.0k|                        *__rounding, cos_bit);
 2410|  16.0k|  btf_32_type0_avx2_new(*cospi_m40, *cospi_p24, x5[43], x5[52], x6[43], x6[52],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2411|  16.0k|                        *__rounding, cos_bit);
 2412|  16.0k|  btf_32_type0_avx2_new(*cospi_m24, *cospi_m40, x5[44], x5[51], x6[44], x6[51],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2413|  16.0k|                        *__rounding, cos_bit);
 2414|  16.0k|  btf_32_type0_avx2_new(*cospi_m24, *cospi_m40, x5[45], x5[50], x6[45], x6[50],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2415|  16.0k|                        *__rounding, cos_bit);
 2416|  16.0k|  x6[46] = x5[46];
 2417|  16.0k|  x6[47] = x5[47];
 2418|  16.0k|  x6[48] = x5[48];
 2419|  16.0k|  x6[49] = x5[49];
 2420|  16.0k|  x6[54] = x5[54];
 2421|  16.0k|  x6[55] = x5[55];
 2422|  16.0k|  x6[56] = x5[56];
 2423|  16.0k|  x6[57] = x5[57];
 2424|  16.0k|  x6[62] = x5[62];
 2425|  16.0k|  x6[63] = x5[63];
 2426|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage7_avx2:
 2433|  16.0k|                                      int8_t cos_bit) {
 2434|  16.0k|  x7[0] = x6[0];
 2435|  16.0k|  x7[1] = x6[1];
 2436|  16.0k|  x7[2] = x6[2];
 2437|  16.0k|  x7[3] = x6[3];
 2438|  16.0k|  btf_32_type0_avx2_new(*cospi_p08, *cospi_p56, x6[7], x6[4], x7[4], x7[7],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2439|  16.0k|                        *__rounding, cos_bit);
 2440|  16.0k|  btf_32_type0_avx2_new(*cospi_p40, *cospi_p24, x6[6], x6[5], x7[5], x7[6],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2441|  16.0k|                        *__rounding, cos_bit);
 2442|  16.0k|  x7[8] = _mm256_add_epi32(x6[8], x6[9]);
 2443|  16.0k|  x7[9] = _mm256_sub_epi32(x6[8], x6[9]);
 2444|  16.0k|  x7[10] = _mm256_sub_epi32(x6[11], x6[10]);
 2445|  16.0k|  x7[11] = _mm256_add_epi32(x6[11], x6[10]);
 2446|  16.0k|  x7[12] = _mm256_add_epi32(x6[12], x6[13]);
 2447|  16.0k|  x7[13] = _mm256_sub_epi32(x6[12], x6[13]);
 2448|  16.0k|  x7[14] = _mm256_sub_epi32(x6[15], x6[14]);
 2449|  16.0k|  x7[15] = _mm256_add_epi32(x6[15], x6[14]);
 2450|  16.0k|  x7[16] = x6[16];
 2451|  16.0k|  btf_32_type0_avx2_new(*cospi_m08, *cospi_p56, x6[17], x6[30], x7[17], x7[30],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2452|  16.0k|                        *__rounding, cos_bit);
 2453|  16.0k|  btf_32_type0_avx2_new(*cospi_m56, *cospi_m08, x6[18], x6[29], x7[18], x7[29],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2454|  16.0k|                        *__rounding, cos_bit);
 2455|  16.0k|  x7[19] = x6[19];
 2456|  16.0k|  x7[20] = x6[20];
 2457|  16.0k|  btf_32_type0_avx2_new(*cospi_m40, *cospi_p24, x6[21], x6[26], x7[21], x7[26],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2458|  16.0k|                        *__rounding, cos_bit);
 2459|  16.0k|  btf_32_type0_avx2_new(*cospi_m24, *cospi_m40, x6[22], x6[25], x7[22], x7[25],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2460|  16.0k|                        *__rounding, cos_bit);
 2461|  16.0k|  x7[23] = x6[23];
 2462|  16.0k|  x7[24] = x6[24];
 2463|  16.0k|  x7[27] = x6[27];
 2464|  16.0k|  x7[28] = x6[28];
 2465|  16.0k|  x7[31] = x6[31];
 2466|  16.0k|  x7[32] = _mm256_add_epi32(x6[32], x6[35]);
 2467|  16.0k|  x7[35] = _mm256_sub_epi32(x6[32], x6[35]);
 2468|  16.0k|  x7[33] = _mm256_add_epi32(x6[33], x6[34]);
 2469|  16.0k|  x7[34] = _mm256_sub_epi32(x6[33], x6[34]);
 2470|  16.0k|  x7[36] = _mm256_sub_epi32(x6[39], x6[36]);
 2471|  16.0k|  x7[39] = _mm256_add_epi32(x6[39], x6[36]);
 2472|  16.0k|  x7[37] = _mm256_sub_epi32(x6[38], x6[37]);
 2473|  16.0k|  x7[38] = _mm256_add_epi32(x6[38], x6[37]);
 2474|  16.0k|  x7[40] = _mm256_add_epi32(x6[40], x6[43]);
 2475|  16.0k|  x7[43] = _mm256_sub_epi32(x6[40], x6[43]);
 2476|  16.0k|  x7[41] = _mm256_add_epi32(x6[41], x6[42]);
 2477|  16.0k|  x7[42] = _mm256_sub_epi32(x6[41], x6[42]);
 2478|  16.0k|  x7[44] = _mm256_sub_epi32(x6[47], x6[44]);
 2479|  16.0k|  x7[47] = _mm256_add_epi32(x6[47], x6[44]);
 2480|  16.0k|  x7[45] = _mm256_sub_epi32(x6[46], x6[45]);
 2481|  16.0k|  x7[46] = _mm256_add_epi32(x6[46], x6[45]);
 2482|  16.0k|  x7[48] = _mm256_add_epi32(x6[48], x6[51]);
 2483|  16.0k|  x7[51] = _mm256_sub_epi32(x6[48], x6[51]);
 2484|  16.0k|  x7[49] = _mm256_add_epi32(x6[49], x6[50]);
 2485|  16.0k|  x7[50] = _mm256_sub_epi32(x6[49], x6[50]);
 2486|  16.0k|  x7[52] = _mm256_sub_epi32(x6[55], x6[52]);
 2487|  16.0k|  x7[55] = _mm256_add_epi32(x6[55], x6[52]);
 2488|  16.0k|  x7[53] = _mm256_sub_epi32(x6[54], x6[53]);
 2489|  16.0k|  x7[54] = _mm256_add_epi32(x6[54], x6[53]);
 2490|  16.0k|  x7[56] = _mm256_add_epi32(x6[56], x6[59]);
 2491|  16.0k|  x7[59] = _mm256_sub_epi32(x6[56], x6[59]);
 2492|  16.0k|  x7[57] = _mm256_add_epi32(x6[57], x6[58]);
 2493|  16.0k|  x7[58] = _mm256_sub_epi32(x6[57], x6[58]);
 2494|  16.0k|  x7[60] = _mm256_sub_epi32(x6[63], x6[60]);
 2495|  16.0k|  x7[63] = _mm256_add_epi32(x6[63], x6[60]);
 2496|  16.0k|  x7[61] = _mm256_sub_epi32(x6[62], x6[61]);
 2497|  16.0k|  x7[62] = _mm256_add_epi32(x6[62], x6[61]);
 2498|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage8_avx2:
 2502|  16.0k|                                      int8_t cos_bit) {
 2503|  16.0k|  __m256i cospi_p60 = _mm256_set1_epi32(cospi[60]);
 2504|  16.0k|  __m256i cospi_p04 = _mm256_set1_epi32(cospi[4]);
 2505|  16.0k|  __m256i cospi_p28 = _mm256_set1_epi32(cospi[28]);
 2506|  16.0k|  __m256i cospi_p36 = _mm256_set1_epi32(cospi[36]);
 2507|  16.0k|  __m256i cospi_p44 = _mm256_set1_epi32(cospi[44]);
 2508|  16.0k|  __m256i cospi_p20 = _mm256_set1_epi32(cospi[20]);
 2509|  16.0k|  __m256i cospi_p12 = _mm256_set1_epi32(cospi[12]);
 2510|  16.0k|  __m256i cospi_p52 = _mm256_set1_epi32(cospi[52]);
 2511|  16.0k|  __m256i cospi_m04 = _mm256_set1_epi32(-cospi[4]);
 2512|  16.0k|  __m256i cospi_m60 = _mm256_set1_epi32(-cospi[60]);
 2513|  16.0k|  __m256i cospi_m36 = _mm256_set1_epi32(-cospi[36]);
 2514|  16.0k|  __m256i cospi_m28 = _mm256_set1_epi32(-cospi[28]);
 2515|  16.0k|  __m256i cospi_m20 = _mm256_set1_epi32(-cospi[20]);
 2516|  16.0k|  __m256i cospi_m44 = _mm256_set1_epi32(-cospi[44]);
 2517|  16.0k|  __m256i cospi_m52 = _mm256_set1_epi32(-cospi[52]);
 2518|  16.0k|  __m256i cospi_m12 = _mm256_set1_epi32(-cospi[12]);
 2519|       |
 2520|  16.0k|  x8[0] = x7[0];
 2521|  16.0k|  x8[1] = x7[1];
 2522|  16.0k|  x8[2] = x7[2];
 2523|  16.0k|  x8[3] = x7[3];
 2524|  16.0k|  x8[4] = x7[4];
 2525|  16.0k|  x8[5] = x7[5];
 2526|  16.0k|  x8[6] = x7[6];
 2527|  16.0k|  x8[7] = x7[7];
 2528|       |
 2529|  16.0k|  btf_32_type0_avx2_new(cospi_p04, cospi_p60, x7[15], x7[8], x8[8], x8[15],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2530|  16.0k|                        *__rounding, cos_bit);
 2531|  16.0k|  btf_32_type0_avx2_new(cospi_p36, cospi_p28, x7[14], x7[9], x8[9], x8[14],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2532|  16.0k|                        *__rounding, cos_bit);
 2533|  16.0k|  btf_32_type0_avx2_new(cospi_p20, cospi_p44, x7[13], x7[10], x8[10], x8[13],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2534|  16.0k|                        *__rounding, cos_bit);
 2535|  16.0k|  btf_32_type0_avx2_new(cospi_p52, cospi_p12, x7[12], x7[11], x8[11], x8[12],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2536|  16.0k|                        *__rounding, cos_bit);
 2537|  16.0k|  x8[16] = _mm256_add_epi32(x7[16], x7[17]);
 2538|  16.0k|  x8[17] = _mm256_sub_epi32(x7[16], x7[17]);
 2539|  16.0k|  x8[18] = _mm256_sub_epi32(x7[19], x7[18]);
 2540|  16.0k|  x8[19] = _mm256_add_epi32(x7[19], x7[18]);
 2541|  16.0k|  x8[20] = _mm256_add_epi32(x7[20], x7[21]);
 2542|  16.0k|  x8[21] = _mm256_sub_epi32(x7[20], x7[21]);
 2543|  16.0k|  x8[22] = _mm256_sub_epi32(x7[23], x7[22]);
 2544|  16.0k|  x8[23] = _mm256_add_epi32(x7[23], x7[22]);
 2545|  16.0k|  x8[24] = _mm256_add_epi32(x7[24], x7[25]);
 2546|  16.0k|  x8[25] = _mm256_sub_epi32(x7[24], x7[25]);
 2547|  16.0k|  x8[26] = _mm256_sub_epi32(x7[27], x7[26]);
 2548|  16.0k|  x8[27] = _mm256_add_epi32(x7[27], x7[26]);
 2549|  16.0k|  x8[28] = _mm256_add_epi32(x7[28], x7[29]);
 2550|  16.0k|  x8[29] = _mm256_sub_epi32(x7[28], x7[29]);
 2551|  16.0k|  x8[30] = _mm256_sub_epi32(x7[31], x7[30]);
 2552|  16.0k|  x8[31] = _mm256_add_epi32(x7[31], x7[30]);
 2553|  16.0k|  x8[32] = x7[32];
 2554|  16.0k|  btf_32_type0_avx2_new(cospi_m04, cospi_p60, x7[33], x7[62], x8[33], x8[62],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2555|  16.0k|                        *__rounding, cos_bit);
 2556|  16.0k|  btf_32_type0_avx2_new(cospi_m60, cospi_m04, x7[34], x7[61], x8[34], x8[61],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2557|  16.0k|                        *__rounding, cos_bit);
 2558|  16.0k|  x8[35] = x7[35];
 2559|  16.0k|  x8[36] = x7[36];
 2560|  16.0k|  btf_32_type0_avx2_new(cospi_m36, cospi_p28, x7[37], x7[58], x8[37], x8[58],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2561|  16.0k|                        *__rounding, cos_bit);
 2562|  16.0k|  btf_32_type0_avx2_new(cospi_m28, cospi_m36, x7[38], x7[57], x8[38], x8[57],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2563|  16.0k|                        *__rounding, cos_bit);
 2564|  16.0k|  x8[39] = x7[39];
 2565|  16.0k|  x8[40] = x7[40];
 2566|  16.0k|  btf_32_type0_avx2_new(cospi_m20, cospi_p44, x7[41], x7[54], x8[41], x8[54],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2567|  16.0k|                        *__rounding, cos_bit);
 2568|  16.0k|  btf_32_type0_avx2_new(cospi_m44, cospi_m20, x7[42], x7[53], x8[42], x8[53],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2569|  16.0k|                        *__rounding, cos_bit);
 2570|  16.0k|  x8[43] = x7[43];
 2571|  16.0k|  x8[44] = x7[44];
 2572|  16.0k|  btf_32_type0_avx2_new(cospi_m52, cospi_p12, x7[45], x7[50], x8[45], x8[50],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2573|  16.0k|                        *__rounding, cos_bit);
 2574|  16.0k|  btf_32_type0_avx2_new(cospi_m12, cospi_m52, x7[46], x7[49], x8[46], x8[49],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2575|  16.0k|                        *__rounding, cos_bit);
 2576|  16.0k|  x8[47] = x7[47];
 2577|  16.0k|  x8[48] = x7[48];
 2578|  16.0k|  x8[51] = x7[51];
 2579|  16.0k|  x8[52] = x7[52];
 2580|  16.0k|  x8[55] = x7[55];
 2581|  16.0k|  x8[56] = x7[56];
 2582|  16.0k|  x8[59] = x7[59];
 2583|  16.0k|  x8[60] = x7[60];
 2584|  16.0k|  x8[63] = x7[63];
 2585|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage9_avx2:
 2589|  16.0k|                                      int8_t cos_bit) {
 2590|  16.0k|  __m256i cospi_p62 = _mm256_set1_epi32(cospi[62]);
 2591|  16.0k|  __m256i cospi_p02 = _mm256_set1_epi32(cospi[2]);
 2592|  16.0k|  __m256i cospi_p30 = _mm256_set1_epi32(cospi[30]);
 2593|  16.0k|  __m256i cospi_p34 = _mm256_set1_epi32(cospi[34]);
 2594|  16.0k|  __m256i cospi_p46 = _mm256_set1_epi32(cospi[46]);
 2595|  16.0k|  __m256i cospi_p18 = _mm256_set1_epi32(cospi[18]);
 2596|  16.0k|  __m256i cospi_p14 = _mm256_set1_epi32(cospi[14]);
 2597|  16.0k|  __m256i cospi_p50 = _mm256_set1_epi32(cospi[50]);
 2598|  16.0k|  __m256i cospi_p54 = _mm256_set1_epi32(cospi[54]);
 2599|  16.0k|  __m256i cospi_p10 = _mm256_set1_epi32(cospi[10]);
 2600|  16.0k|  __m256i cospi_p22 = _mm256_set1_epi32(cospi[22]);
 2601|  16.0k|  __m256i cospi_p42 = _mm256_set1_epi32(cospi[42]);
 2602|  16.0k|  __m256i cospi_p38 = _mm256_set1_epi32(cospi[38]);
 2603|  16.0k|  __m256i cospi_p26 = _mm256_set1_epi32(cospi[26]);
 2604|  16.0k|  __m256i cospi_p06 = _mm256_set1_epi32(cospi[6]);
 2605|  16.0k|  __m256i cospi_p58 = _mm256_set1_epi32(cospi[58]);
 2606|       |
 2607|  16.0k|  x9[0] = x8[0];
 2608|  16.0k|  x9[1] = x8[1];
 2609|  16.0k|  x9[2] = x8[2];
 2610|  16.0k|  x9[3] = x8[3];
 2611|  16.0k|  x9[4] = x8[4];
 2612|  16.0k|  x9[5] = x8[5];
 2613|  16.0k|  x9[6] = x8[6];
 2614|  16.0k|  x9[7] = x8[7];
 2615|  16.0k|  x9[8] = x8[8];
 2616|  16.0k|  x9[9] = x8[9];
 2617|  16.0k|  x9[10] = x8[10];
 2618|  16.0k|  x9[11] = x8[11];
 2619|  16.0k|  x9[12] = x8[12];
 2620|  16.0k|  x9[13] = x8[13];
 2621|  16.0k|  x9[14] = x8[14];
 2622|  16.0k|  x9[15] = x8[15];
 2623|  16.0k|  btf_32_type0_avx2_new(cospi_p02, cospi_p62, x8[31], x8[16], x9[16], x9[31],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2624|  16.0k|                        *__rounding, cos_bit);
 2625|  16.0k|  btf_32_type0_avx2_new(cospi_p34, cospi_p30, x8[30], x8[17], x9[17], x9[30],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2626|  16.0k|                        *__rounding, cos_bit);
 2627|  16.0k|  btf_32_type0_avx2_new(cospi_p18, cospi_p46, x8[29], x8[18], x9[18], x9[29],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2628|  16.0k|                        *__rounding, cos_bit);
 2629|  16.0k|  btf_32_type0_avx2_new(cospi_p50, cospi_p14, x8[28], x8[19], x9[19], x9[28],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2630|  16.0k|                        *__rounding, cos_bit);
 2631|  16.0k|  btf_32_type0_avx2_new(cospi_p10, cospi_p54, x8[27], x8[20], x9[20], x9[27],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2632|  16.0k|                        *__rounding, cos_bit);
 2633|  16.0k|  btf_32_type0_avx2_new(cospi_p42, cospi_p22, x8[26], x8[21], x9[21], x9[26],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2634|  16.0k|                        *__rounding, cos_bit);
 2635|  16.0k|  btf_32_type0_avx2_new(cospi_p26, cospi_p38, x8[25], x8[22], x9[22], x9[25],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2636|  16.0k|                        *__rounding, cos_bit);
 2637|  16.0k|  btf_32_type0_avx2_new(cospi_p58, cospi_p06, x8[24], x8[23], x9[23], x9[24],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2638|  16.0k|                        *__rounding, cos_bit);
 2639|  16.0k|  x9[32] = _mm256_add_epi32(x8[32], x8[33]);
 2640|  16.0k|  x9[33] = _mm256_sub_epi32(x8[32], x8[33]);
 2641|  16.0k|  x9[34] = _mm256_sub_epi32(x8[35], x8[34]);
 2642|  16.0k|  x9[35] = _mm256_add_epi32(x8[35], x8[34]);
 2643|  16.0k|  x9[36] = _mm256_add_epi32(x8[36], x8[37]);
 2644|  16.0k|  x9[37] = _mm256_sub_epi32(x8[36], x8[37]);
 2645|  16.0k|  x9[38] = _mm256_sub_epi32(x8[39], x8[38]);
 2646|  16.0k|  x9[39] = _mm256_add_epi32(x8[39], x8[38]);
 2647|  16.0k|  x9[40] = _mm256_add_epi32(x8[40], x8[41]);
 2648|  16.0k|  x9[41] = _mm256_sub_epi32(x8[40], x8[41]);
 2649|  16.0k|  x9[42] = _mm256_sub_epi32(x8[43], x8[42]);
 2650|  16.0k|  x9[43] = _mm256_add_epi32(x8[43], x8[42]);
 2651|  16.0k|  x9[44] = _mm256_add_epi32(x8[44], x8[45]);
 2652|  16.0k|  x9[45] = _mm256_sub_epi32(x8[44], x8[45]);
 2653|  16.0k|  x9[46] = _mm256_sub_epi32(x8[47], x8[46]);
 2654|  16.0k|  x9[47] = _mm256_add_epi32(x8[47], x8[46]);
 2655|  16.0k|  x9[48] = _mm256_add_epi32(x8[48], x8[49]);
 2656|  16.0k|  x9[49] = _mm256_sub_epi32(x8[48], x8[49]);
 2657|  16.0k|  x9[50] = _mm256_sub_epi32(x8[51], x8[50]);
 2658|  16.0k|  x9[51] = _mm256_add_epi32(x8[51], x8[50]);
 2659|  16.0k|  x9[52] = _mm256_add_epi32(x8[52], x8[53]);
 2660|  16.0k|  x9[53] = _mm256_sub_epi32(x8[52], x8[53]);
 2661|  16.0k|  x9[54] = _mm256_sub_epi32(x8[55], x8[54]);
 2662|  16.0k|  x9[55] = _mm256_add_epi32(x8[55], x8[54]);
 2663|  16.0k|  x9[56] = _mm256_add_epi32(x8[56], x8[57]);
 2664|  16.0k|  x9[57] = _mm256_sub_epi32(x8[56], x8[57]);
 2665|  16.0k|  x9[58] = _mm256_sub_epi32(x8[59], x8[58]);
 2666|  16.0k|  x9[59] = _mm256_add_epi32(x8[59], x8[58]);
 2667|  16.0k|  x9[60] = _mm256_add_epi32(x8[60], x8[61]);
 2668|  16.0k|  x9[61] = _mm256_sub_epi32(x8[60], x8[61]);
 2669|  16.0k|  x9[62] = _mm256_sub_epi32(x8[63], x8[62]);
 2670|  16.0k|  x9[63] = _mm256_add_epi32(x8[63], x8[62]);
 2671|  16.0k|}
highbd_fwd_txfm_avx2.c:fdct64_stage10_avx2:
 2675|  16.0k|                                       int8_t cos_bit) {
 2676|  16.0k|  __m256i cospi_p63 = _mm256_set1_epi32(cospi[63]);
 2677|  16.0k|  __m256i cospi_p01 = _mm256_set1_epi32(cospi[1]);
 2678|  16.0k|  __m256i cospi_p31 = _mm256_set1_epi32(cospi[31]);
 2679|  16.0k|  __m256i cospi_p33 = _mm256_set1_epi32(cospi[33]);
 2680|  16.0k|  __m256i cospi_p47 = _mm256_set1_epi32(cospi[47]);
 2681|  16.0k|  __m256i cospi_p17 = _mm256_set1_epi32(cospi[17]);
 2682|  16.0k|  __m256i cospi_p15 = _mm256_set1_epi32(cospi[15]);
 2683|  16.0k|  __m256i cospi_p49 = _mm256_set1_epi32(cospi[49]);
 2684|  16.0k|  __m256i cospi_p55 = _mm256_set1_epi32(cospi[55]);
 2685|  16.0k|  __m256i cospi_p09 = _mm256_set1_epi32(cospi[9]);
 2686|  16.0k|  __m256i cospi_p23 = _mm256_set1_epi32(cospi[23]);
 2687|  16.0k|  __m256i cospi_p41 = _mm256_set1_epi32(cospi[41]);
 2688|  16.0k|  __m256i cospi_p39 = _mm256_set1_epi32(cospi[39]);
 2689|  16.0k|  __m256i cospi_p25 = _mm256_set1_epi32(cospi[25]);
 2690|  16.0k|  __m256i cospi_p07 = _mm256_set1_epi32(cospi[7]);
 2691|  16.0k|  __m256i cospi_p57 = _mm256_set1_epi32(cospi[57]);
 2692|  16.0k|  __m256i cospi_p59 = _mm256_set1_epi32(cospi[59]);
 2693|  16.0k|  __m256i cospi_p05 = _mm256_set1_epi32(cospi[5]);
 2694|  16.0k|  __m256i cospi_p27 = _mm256_set1_epi32(cospi[27]);
 2695|  16.0k|  __m256i cospi_p37 = _mm256_set1_epi32(cospi[37]);
 2696|  16.0k|  __m256i cospi_p43 = _mm256_set1_epi32(cospi[43]);
 2697|  16.0k|  __m256i cospi_p21 = _mm256_set1_epi32(cospi[21]);
 2698|  16.0k|  __m256i cospi_p11 = _mm256_set1_epi32(cospi[11]);
 2699|  16.0k|  __m256i cospi_p53 = _mm256_set1_epi32(cospi[53]);
 2700|  16.0k|  __m256i cospi_p51 = _mm256_set1_epi32(cospi[51]);
 2701|  16.0k|  __m256i cospi_p13 = _mm256_set1_epi32(cospi[13]);
 2702|  16.0k|  __m256i cospi_p19 = _mm256_set1_epi32(cospi[19]);
 2703|  16.0k|  __m256i cospi_p45 = _mm256_set1_epi32(cospi[45]);
 2704|  16.0k|  __m256i cospi_p35 = _mm256_set1_epi32(cospi[35]);
 2705|  16.0k|  __m256i cospi_p29 = _mm256_set1_epi32(cospi[29]);
 2706|  16.0k|  __m256i cospi_p03 = _mm256_set1_epi32(cospi[3]);
 2707|  16.0k|  __m256i cospi_p61 = _mm256_set1_epi32(cospi[61]);
 2708|       |
 2709|  16.0k|  x10[0] = x9[0];
 2710|  16.0k|  x10[1] = x9[1];
 2711|  16.0k|  x10[2] = x9[2];
 2712|  16.0k|  x10[3] = x9[3];
 2713|  16.0k|  x10[4] = x9[4];
 2714|  16.0k|  x10[5] = x9[5];
 2715|  16.0k|  x10[6] = x9[6];
 2716|  16.0k|  x10[7] = x9[7];
 2717|  16.0k|  x10[8] = x9[8];
 2718|  16.0k|  x10[9] = x9[9];
 2719|  16.0k|  x10[10] = x9[10];
 2720|  16.0k|  x10[11] = x9[11];
 2721|  16.0k|  x10[12] = x9[12];
 2722|  16.0k|  x10[13] = x9[13];
 2723|  16.0k|  x10[14] = x9[14];
 2724|  16.0k|  x10[15] = x9[15];
 2725|  16.0k|  x10[16] = x9[16];
 2726|  16.0k|  x10[17] = x9[17];
 2727|  16.0k|  x10[18] = x9[18];
 2728|  16.0k|  x10[19] = x9[19];
 2729|  16.0k|  x10[20] = x9[20];
 2730|  16.0k|  x10[21] = x9[21];
 2731|  16.0k|  x10[22] = x9[22];
 2732|  16.0k|  x10[23] = x9[23];
 2733|  16.0k|  x10[24] = x9[24];
 2734|  16.0k|  x10[25] = x9[25];
 2735|  16.0k|  x10[26] = x9[26];
 2736|  16.0k|  x10[27] = x9[27];
 2737|  16.0k|  x10[28] = x9[28];
 2738|  16.0k|  x10[29] = x9[29];
 2739|  16.0k|  x10[30] = x9[30];
 2740|  16.0k|  x10[31] = x9[31];
 2741|  16.0k|  btf_32_type0_avx2_new(cospi_p01, cospi_p63, x9[63], x9[32], x10[32], x10[63],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2742|  16.0k|                        *__rounding, cos_bit);
 2743|  16.0k|  btf_32_type0_avx2_new(cospi_p33, cospi_p31, x9[62], x9[33], x10[33], x10[62],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2744|  16.0k|                        *__rounding, cos_bit);
 2745|  16.0k|  btf_32_type0_avx2_new(cospi_p17, cospi_p47, x9[61], x9[34], x10[34], x10[61],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2746|  16.0k|                        *__rounding, cos_bit);
 2747|  16.0k|  btf_32_type0_avx2_new(cospi_p49, cospi_p15, x9[60], x9[35], x10[35], x10[60],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2748|  16.0k|                        *__rounding, cos_bit);
 2749|  16.0k|  btf_32_type0_avx2_new(cospi_p09, cospi_p55, x9[59], x9[36], x10[36], x10[59],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2750|  16.0k|                        *__rounding, cos_bit);
 2751|  16.0k|  btf_32_type0_avx2_new(cospi_p41, cospi_p23, x9[58], x9[37], x10[37], x10[58],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2752|  16.0k|                        *__rounding, cos_bit);
 2753|  16.0k|  btf_32_type0_avx2_new(cospi_p25, cospi_p39, x9[57], x9[38], x10[38], x10[57],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2754|  16.0k|                        *__rounding, cos_bit);
 2755|  16.0k|  btf_32_type0_avx2_new(cospi_p57, cospi_p07, x9[56], x9[39], x10[39], x10[56],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2756|  16.0k|                        *__rounding, cos_bit);
 2757|  16.0k|  btf_32_type0_avx2_new(cospi_p05, cospi_p59, x9[55], x9[40], x10[40], x10[55],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2758|  16.0k|                        *__rounding, cos_bit);
 2759|  16.0k|  btf_32_type0_avx2_new(cospi_p37, cospi_p27, x9[54], x9[41], x10[41], x10[54],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2760|  16.0k|                        *__rounding, cos_bit);
 2761|  16.0k|  btf_32_type0_avx2_new(cospi_p21, cospi_p43, x9[53], x9[42], x10[42], x10[53],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2762|  16.0k|                        *__rounding, cos_bit);
 2763|  16.0k|  btf_32_type0_avx2_new(cospi_p53, cospi_p11, x9[52], x9[43], x10[43], x10[52],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2764|  16.0k|                        *__rounding, cos_bit);
 2765|  16.0k|  btf_32_type0_avx2_new(cospi_p13, cospi_p51, x9[51], x9[44], x10[44], x10[51],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2766|  16.0k|                        *__rounding, cos_bit);
 2767|  16.0k|  btf_32_type0_avx2_new(cospi_p45, cospi_p19, x9[50], x9[45], x10[45], x10[50],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2768|  16.0k|                        *__rounding, cos_bit);
 2769|  16.0k|  btf_32_type0_avx2_new(cospi_p29, cospi_p35, x9[49], x9[46], x10[46], x10[49],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2770|  16.0k|                        *__rounding, cos_bit);
 2771|  16.0k|  btf_32_type0_avx2_new(cospi_p61, cospi_p03, x9[48], x9[47], x10[47], x10[48],
  ------------------
  |  |  239|  16.0k|  do {                                                                \
  |  |  240|  16.0k|    const __m256i in0_w0 = _mm256_mullo_epi32(in0, ww0);              \
  |  |  241|  16.0k|    const __m256i in1_w1 = _mm256_mullo_epi32(in1, ww1);              \
  |  |  242|  16.0k|    out0 = _mm256_add_epi32(in0_w0, in1_w1);                          \
  |  |  243|  16.0k|    out0 = _mm256_add_epi32(out0, r);                                 \
  |  |  244|  16.0k|    out0 = _mm256_srai_epi32(out0, bit);                              \
  |  |  245|  16.0k|    const __m256i in0_w1 = _mm256_mullo_epi32(in0, ww1);              \
  |  |  246|  16.0k|    const __m256i in1_w0 = _mm256_mullo_epi32(in1, ww0);              \
  |  |  247|  16.0k|    out1 = _mm256_sub_epi32(in0_w1, in1_w0);                          \
  |  |  248|  16.0k|    out1 = _mm256_add_epi32(out1, r);                                 \
  |  |  249|  16.0k|    out1 = _mm256_srai_epi32(out1, bit);                              \
  |  |  250|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (250:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 2772|  16.0k|                        *__rounding, cos_bit);
 2773|  16.0k|}

av1_fwht4x4_sse4_1:
   32|  4.26M|void av1_fwht4x4_sse4_1(const int16_t *input, tran_low_t *output, int stride) {
   33|  4.26M|  __m128i in[4];
   34|  4.26M|  in[0] = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
   35|  4.26M|  in[1] = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
   36|  4.26M|  in[2] = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
   37|  4.26M|  in[3] = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
   38|       |
   39|       |  // Convert to int32_t.
   40|  4.26M|  __m128i op[4];
   41|  4.26M|  op[0] = _mm_cvtepi16_epi32(in[0]);
   42|  4.26M|  op[1] = _mm_cvtepi16_epi32(in[1]);
   43|  4.26M|  op[2] = _mm_cvtepi16_epi32(in[2]);
   44|  4.26M|  op[3] = _mm_cvtepi16_epi32(in[3]);
   45|       |
   46|  12.8M|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (46:19): [True: 8.54M, False: 4.26M]
  ------------------
   47|  8.54M|    __m128i a1 = op[0];
   48|  8.54M|    __m128i b1 = op[1];
   49|  8.54M|    __m128i c1 = op[2];
   50|  8.54M|    __m128i d1 = op[3];
   51|  8.54M|    __m128i e1;
   52|       |
   53|  8.54M|    a1 = _mm_add_epi32(a1, b1);  // a1 += b1
   54|  8.54M|    d1 = _mm_sub_epi32(d1, c1);  // d1 = d1 - c1
   55|  8.54M|    e1 = _mm_sub_epi32(a1, d1);  // e1 = (a1 - d1) >> 1
   56|  8.54M|    e1 = _mm_srai_epi32(e1, 1);
   57|  8.54M|    b1 = _mm_sub_epi32(e1, b1);  // b1 = e1 - b1
   58|  8.54M|    c1 = _mm_sub_epi32(e1, c1);  // c1 = e1 - c1
   59|  8.54M|    a1 = _mm_sub_epi32(a1, c1);  // a1 -= c1
   60|  8.54M|    d1 = _mm_add_epi32(d1, b1);  // d1 += b1
   61|       |
   62|  8.54M|    op[0] = a1;
   63|  8.54M|    op[1] = c1;
   64|  8.54M|    op[2] = d1;
   65|  8.54M|    op[3] = b1;
   66|       |
   67|  8.54M|    if (i == 0) {
  ------------------
  |  Branch (67:9): [True: 4.27M, False: 4.27M]
  ------------------
   68|  4.27M|      transpose_32bit_4x4(op, op);
   69|  4.27M|    }
   70|  8.54M|  }
   71|       |
   72|  4.26M|  op[0] = _mm_slli_epi32(op[0], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  4.26M|#define UNIT_QUANT_SHIFT 2
  ------------------
   73|  4.26M|  op[1] = _mm_slli_epi32(op[1], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  4.26M|#define UNIT_QUANT_SHIFT 2
  ------------------
   74|  4.26M|  op[2] = _mm_slli_epi32(op[2], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  4.26M|#define UNIT_QUANT_SHIFT 2
  ------------------
   75|  4.26M|  op[3] = _mm_slli_epi32(op[3], UNIT_QUANT_SHIFT);
  ------------------
  |  |   21|  4.26M|#define UNIT_QUANT_SHIFT 2
  ------------------
   76|       |
   77|  4.26M|  _mm_storeu_si128((__m128i *)(output + 0), op[0]);
   78|  4.26M|  _mm_storeu_si128((__m128i *)(output + 4), op[1]);
   79|  4.26M|  _mm_storeu_si128((__m128i *)(output + 8), op[2]);
   80|  4.26M|  _mm_storeu_si128((__m128i *)(output + 12), op[3]);
   81|  4.26M|}
av1_fwd_txfm2d_4x4_sse4_1:
  250|  27.4M|                               int input_stride, TX_TYPE tx_type, int bd) {
  251|  27.4M|  __m128i in[4];
  252|  27.4M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_4X4];
  253|  27.4M|  const int txw_idx = get_txw_idx(TX_4X4);
  254|  27.4M|  const int txh_idx = get_txh_idx(TX_4X4);
  255|       |
  256|  27.4M|  switch (tx_type) {
  257|  11.4M|    case DCT_DCT:
  ------------------
  |  Branch (257:5): [True: 11.4M, False: 15.9M]
  ------------------
  258|  11.4M|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  259|  11.4M|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  260|  11.4M|      transpose_32bit_4x4(in, in);
  261|  11.4M|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  262|  11.4M|      write_buffer_4x4(in, coeff);
  263|  11.4M|      break;
  264|  3.87M|    case ADST_DCT:
  ------------------
  |  Branch (264:5): [True: 3.87M, False: 23.5M]
  ------------------
  265|  3.87M|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  266|  3.87M|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  267|  3.87M|      transpose_32bit_4x4(in, in);
  268|  3.87M|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  269|  3.87M|      write_buffer_4x4(in, coeff);
  270|  3.87M|      break;
  271|  4.02M|    case DCT_ADST:
  ------------------
  |  Branch (271:5): [True: 4.02M, False: 23.4M]
  ------------------
  272|  4.02M|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  273|  4.02M|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  274|  4.02M|      transpose_32bit_4x4(in, in);
  275|  4.02M|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  276|  4.02M|      write_buffer_4x4(in, coeff);
  277|  4.02M|      break;
  278|  4.50M|    case ADST_ADST:
  ------------------
  |  Branch (278:5): [True: 4.50M, False: 22.9M]
  ------------------
  279|  4.50M|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  280|  4.50M|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  281|  4.50M|      transpose_32bit_4x4(in, in);
  282|  4.50M|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  283|  4.50M|      write_buffer_4x4(in, coeff);
  284|  4.50M|      break;
  285|  25.1k|    case FLIPADST_DCT:
  ------------------
  |  Branch (285:5): [True: 25.1k, False: 27.4M]
  ------------------
  286|  25.1k|      load_buffer_4x4(input, in, input_stride, 1, 0, shift[0]);
  287|  25.1k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  288|  25.1k|      transpose_32bit_4x4(in, in);
  289|  25.1k|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  290|  25.1k|      write_buffer_4x4(in, coeff);
  291|  25.1k|      break;
  292|  30.3k|    case DCT_FLIPADST:
  ------------------
  |  Branch (292:5): [True: 30.3k, False: 27.4M]
  ------------------
  293|  30.3k|      load_buffer_4x4(input, in, input_stride, 0, 1, shift[0]);
  294|  30.3k|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  295|  30.3k|      transpose_32bit_4x4(in, in);
  296|  30.3k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  297|  30.3k|      write_buffer_4x4(in, coeff);
  298|  30.3k|      break;
  299|  21.7k|    case FLIPADST_FLIPADST:
  ------------------
  |  Branch (299:5): [True: 21.7k, False: 27.4M]
  ------------------
  300|  21.7k|      load_buffer_4x4(input, in, input_stride, 1, 1, shift[0]);
  301|  21.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  302|  21.7k|      transpose_32bit_4x4(in, in);
  303|  21.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  304|  21.7k|      write_buffer_4x4(in, coeff);
  305|  21.7k|      break;
  306|  33.7k|    case ADST_FLIPADST:
  ------------------
  |  Branch (306:5): [True: 33.7k, False: 27.4M]
  ------------------
  307|  33.7k|      load_buffer_4x4(input, in, input_stride, 0, 1, shift[0]);
  308|  33.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  309|  33.7k|      transpose_32bit_4x4(in, in);
  310|  33.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  311|  33.7k|      write_buffer_4x4(in, coeff);
  312|  33.7k|      break;
  313|  42.7k|    case FLIPADST_ADST:
  ------------------
  |  Branch (313:5): [True: 42.7k, False: 27.4M]
  ------------------
  314|  42.7k|      load_buffer_4x4(input, in, input_stride, 1, 0, shift[0]);
  315|  42.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  316|  42.7k|      transpose_32bit_4x4(in, in);
  317|  42.7k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  318|  42.7k|      write_buffer_4x4(in, coeff);
  319|  42.7k|      break;
  320|   132k|    case IDTX:
  ------------------
  |  Branch (320:5): [True: 132k, False: 27.3M]
  ------------------
  321|   132k|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  322|   132k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  323|   132k|      transpose_32bit_4x4(in, in);
  324|   132k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  325|   132k|      write_buffer_4x4(in, coeff);
  326|   132k|      break;
  327|   656k|    case V_DCT:
  ------------------
  |  Branch (327:5): [True: 656k, False: 26.7M]
  ------------------
  328|   656k|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  329|   656k|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  330|   656k|      transpose_32bit_4x4(in, in);
  331|   656k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  332|   656k|      write_buffer_4x4(in, coeff);
  333|   656k|      break;
  334|  2.44M|    case H_DCT:
  ------------------
  |  Branch (334:5): [True: 2.44M, False: 25.0M]
  ------------------
  335|  2.44M|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  336|  2.44M|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  337|  2.44M|      transpose_32bit_4x4(in, in);
  338|  2.44M|      fdct4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  339|  2.44M|      write_buffer_4x4(in, coeff);
  340|  2.44M|      break;
  341|  48.8k|    case V_ADST:
  ------------------
  |  Branch (341:5): [True: 48.8k, False: 27.4M]
  ------------------
  342|  48.8k|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  343|  48.8k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  344|  48.8k|      transpose_32bit_4x4(in, in);
  345|  48.8k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  346|  48.8k|      write_buffer_4x4(in, coeff);
  347|  48.8k|      break;
  348|   125k|    case H_ADST:
  ------------------
  |  Branch (348:5): [True: 125k, False: 27.3M]
  ------------------
  349|   125k|      load_buffer_4x4(input, in, input_stride, 0, 0, shift[0]);
  350|   125k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  351|   125k|      transpose_32bit_4x4(in, in);
  352|   125k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_col[txw_idx][txh_idx], 1);
  353|   125k|      write_buffer_4x4(in, coeff);
  354|   125k|      break;
  355|  34.8k|    case V_FLIPADST:
  ------------------
  |  Branch (355:5): [True: 34.8k, False: 27.4M]
  ------------------
  356|  34.8k|      load_buffer_4x4(input, in, input_stride, 1, 0, shift[0]);
  357|  34.8k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  358|  34.8k|      transpose_32bit_4x4(in, in);
  359|  34.8k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  360|  34.8k|      write_buffer_4x4(in, coeff);
  361|  34.8k|      break;
  362|  97.6k|    case H_FLIPADST:
  ------------------
  |  Branch (362:5): [True: 97.6k, False: 27.3M]
  ------------------
  363|  97.6k|      load_buffer_4x4(input, in, input_stride, 0, 1, shift[0]);
  364|  97.6k|      idtx4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  365|  97.6k|      transpose_32bit_4x4(in, in);
  366|  97.6k|      fadst4x4_sse4_1(in, in, av1_fwd_cos_bit_row[txw_idx][txh_idx], 1);
  367|  97.6k|      write_buffer_4x4(in, coeff);
  368|  97.6k|      break;
  369|      0|    default: assert(0);
  ------------------
  |  Branch (369:5): [True: 0, False: 27.4M]
  ------------------
  370|  27.4M|  }
  371|  27.4M|  (void)bd;
  372|  27.4M|}
av1_fwd_txfm2d_16x32_sse4_1:
 2283|  16.2k|                                 int stride, TX_TYPE tx_type, int bd) {
 2284|  16.2k|  __m128i in[128];
 2285|  16.2k|  __m128i *outcoef128 = (__m128i *)coeff;
 2286|  16.2k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_16X32];
 2287|  16.2k|  const int txw_idx = get_txw_idx(TX_16X32);
 2288|  16.2k|  const int txh_idx = get_txh_idx(TX_16X32);
 2289|  16.2k|  const fwd_transform_1d_sse4_1 col_txfm = col_highbd_txfm8x32_arr[tx_type];
 2290|  16.2k|  const fwd_transform_1d_sse4_1 row_txfm = row_highbd_txfm8x32_arr[tx_type];
 2291|  16.2k|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2292|  16.2k|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2293|       |
 2294|       |  // column transform
 2295|  16.2k|  load_buffer_16x16(input, in, stride, 0, 0, shift[0]);
 2296|  16.2k|  load_buffer_16x16(input + 16 * stride, in + 64, stride, 0, 0, shift[0]);
 2297|       |
 2298|  81.0k|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (2298:19): [True: 64.8k, False: 16.2k]
  ------------------
 2299|  64.8k|    col_txfm((in + i), (in + i), bitcol, 4);
 2300|  64.8k|  }
 2301|  16.2k|  col_txfm_16x16_rounding(&in[0], -shift[1]);
 2302|  16.2k|  col_txfm_16x16_rounding(&in[64], -shift[1]);
 2303|  16.2k|  transpose_8nx8n(in, outcoef128, 16, 32);
 2304|       |
 2305|       |  // row transform
 2306|  16.2k|  row_txfm(outcoef128, in, bitrow, 8);
 2307|  16.2k|  av1_round_shift_rect_array_32_sse4_1(in, outcoef128, 128, -shift[2],
 2308|  16.2k|                                       NewSqrt2);
 2309|  16.2k|  (void)bd;
 2310|  16.2k|}
av1_fwd_txfm2d_32x64_sse4_1:
 2313|  1.47k|                                 int stride, TX_TYPE tx_type, int bd) {
 2314|  1.47k|  (void)tx_type;
 2315|  1.47k|  __m128i in[512];
 2316|  1.47k|  __m128i *outcoef128 = (__m128i *)coeff;
 2317|  1.47k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_32X64];
 2318|  1.47k|  const int txw_idx = get_txw_idx(TX_32X64);
 2319|  1.47k|  const int txh_idx = get_txh_idx(TX_32X64);
 2320|  1.47k|  const int txfm_size_col = tx_size_wide[TX_32X64];
 2321|  1.47k|  const int txfm_size_row = tx_size_high[TX_32X64];
 2322|  1.47k|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2323|  1.47k|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2324|  1.47k|  const int num_row = txfm_size_row >> 2;
 2325|  1.47k|  const int num_col = txfm_size_col >> 2;
 2326|       |
 2327|       |  // column transform
 2328|  1.47k|  load_buffer_32x8n(input, in, stride, 0, 0, shift[0], txfm_size_row);
 2329|  13.2k|  for (int i = 0; i < num_col; i++) {
  ------------------
  |  Branch (2329:19): [True: 11.7k, False: 1.47k]
  ------------------
 2330|  11.7k|    av1_fdct64_sse4_1((in + i), (in + i), bitcol, num_col, num_col);
 2331|  11.7k|  }
 2332|  13.2k|  for (int i = 0; i < num_col; i++) {
  ------------------
  |  Branch (2332:19): [True: 11.7k, False: 1.47k]
  ------------------
 2333|  11.7k|    col_txfm_16x16_rounding((in + i * txfm_size_row), -shift[1]);
 2334|  11.7k|  }
 2335|  1.47k|  transpose_8nx8n(in, outcoef128, txfm_size_col, txfm_size_row);
 2336|       |
 2337|       |  // row transform
 2338|  25.0k|  for (int i = 0; i < num_row; i++) {
  ------------------
  |  Branch (2338:19): [True: 23.5k, False: 1.47k]
  ------------------
 2339|  23.5k|    av1_fdct32_sse4_1((outcoef128 + i), (in + i), bitrow, num_row);
 2340|  23.5k|  }
 2341|  48.5k|  for (int i = 0; i < txfm_size_col; i++) {
  ------------------
  |  Branch (2341:19): [True: 47.1k, False: 1.47k]
  ------------------
 2342|  47.1k|    av1_round_shift_rect_array_32_sse4_1(in + i * 16, outcoef128 + i * 8, 8,
 2343|  47.1k|                                         -shift[2], NewSqrt2);
 2344|  47.1k|  }
 2345|  1.47k|  (void)bd;
 2346|  1.47k|}
av1_fwd_txfm2d_64x32_sse4_1:
 2349|  1.66k|                                 int stride, TX_TYPE tx_type, int bd) {
 2350|  1.66k|  (void)tx_type;
 2351|  1.66k|  __m128i in[512];
 2352|  1.66k|  __m128i *outcoef128 = (__m128i *)coeff;
 2353|  1.66k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_64X32];
 2354|  1.66k|  const int txw_idx = get_txw_idx(TX_64X32);
 2355|  1.66k|  const int txh_idx = get_txh_idx(TX_64X32);
 2356|  1.66k|  const int txfm_size_col = tx_size_wide[TX_64X32];
 2357|  1.66k|  const int txfm_size_row = tx_size_high[TX_64X32];
 2358|  1.66k|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2359|  1.66k|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2360|  1.66k|  const int num_row = txfm_size_row >> 2;
 2361|  1.66k|  const int num_col = txfm_size_col >> 2;
 2362|       |
 2363|       |  // column transform
 2364|  54.8k|  for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (2364:19): [True: 53.2k, False: 1.66k]
  ------------------
 2365|  53.2k|    load_buffer_4x4(input + 0 + i * stride, in + 0 + i * 16, 4, 0, 0, shift[0]);
 2366|  53.2k|    load_buffer_4x4(input + 16 + i * stride, in + 4 + i * 16, 4, 0, 0,
 2367|  53.2k|                    shift[0]);
 2368|  53.2k|    load_buffer_4x4(input + 32 + i * stride, in + 8 + i * 16, 4, 0, 0,
 2369|  53.2k|                    shift[0]);
 2370|  53.2k|    load_buffer_4x4(input + 48 + i * stride, in + 12 + i * 16, 4, 0, 0,
 2371|  53.2k|                    shift[0]);
 2372|  53.2k|  }
 2373|       |
 2374|  28.2k|  for (int i = 0; i < num_col; i++) {
  ------------------
  |  Branch (2374:19): [True: 26.6k, False: 1.66k]
  ------------------
 2375|  26.6k|    av1_fdct32_sse4_1((in + i), (in + i), bitcol, num_col);
 2376|  26.6k|  }
 2377|       |
 2378|  14.9k|  for (int i = 0; i < num_row; i++) {
  ------------------
  |  Branch (2378:19): [True: 13.3k, False: 1.66k]
  ------------------
 2379|  13.3k|    col_txfm_16x16_rounding((in + i * txfm_size_col), -shift[1]);
 2380|  13.3k|  }
 2381|  1.66k|  transpose_8nx8n(in, outcoef128, txfm_size_col, txfm_size_row);
 2382|       |
 2383|       |  // row transform
 2384|  14.9k|  for (int i = 0; i < num_row; i++) {
  ------------------
  |  Branch (2384:19): [True: 13.3k, False: 1.66k]
  ------------------
 2385|  13.3k|    av1_fdct64_sse4_1((outcoef128 + i), (in + i), bitrow, num_row, num_row);
 2386|  13.3k|  }
 2387|  1.66k|  av1_round_shift_rect_array_32_sse4_1(in, outcoef128, 512, -shift[2],
 2388|  1.66k|                                       NewSqrt2);
 2389|  1.66k|  (void)bd;
 2390|  1.66k|}
av1_fwd_txfm2d_32x16_sse4_1:
 2393|  22.5k|                                 int stride, TX_TYPE tx_type, int bd) {
 2394|  22.5k|  __m128i in[128];
 2395|  22.5k|  __m128i *outcoef128 = (__m128i *)coeff;
 2396|  22.5k|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_32X16];
 2397|  22.5k|  const int txw_idx = get_txw_idx(TX_32X16);
 2398|  22.5k|  const int txh_idx = get_txh_idx(TX_32X16);
 2399|  22.5k|  const fwd_transform_1d_sse4_1 col_txfm = row_highbd_txfm8x32_arr[tx_type];
 2400|  22.5k|  const fwd_transform_1d_sse4_1 row_txfm = col_highbd_txfm8x32_arr[tx_type];
 2401|  22.5k|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2402|  22.5k|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2403|       |
 2404|       |  // column transform
 2405|  22.5k|  load_buffer_32x8n(input, in, stride, 0, 0, shift[0], 16);
 2406|  22.5k|  col_txfm(in, in, bitcol, 8);
 2407|  22.5k|  col_txfm_16x16_rounding(&in[0], -shift[1]);
 2408|  22.5k|  col_txfm_16x16_rounding(&in[64], -shift[1]);
 2409|  22.5k|  transpose_8nx8n(in, outcoef128, 32, 16);
 2410|       |
 2411|       |  // row transform
 2412|   112k|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (2412:19): [True: 90.3k, False: 22.5k]
  ------------------
 2413|  90.3k|    row_txfm((outcoef128 + i), (in + i), bitrow, 4);
 2414|  90.3k|  }
 2415|  22.5k|  av1_round_shift_rect_array_32_sse4_1(in, outcoef128, 128, -shift[2],
 2416|  22.5k|                                       NewSqrt2);
 2417|  22.5k|  (void)bd;
 2418|  22.5k|}
av1_fwd_txfm2d_4x8_sse4_1:
 2489|  3.82M|                               TX_TYPE tx_type, int bd) {
 2490|  3.82M|  __m128i in[8];
 2491|  3.82M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_4X8];
 2492|  3.82M|  const int txw_idx = get_txw_idx(TX_4X8);
 2493|  3.82M|  const int txh_idx = get_txh_idx(TX_4X8);
 2494|  3.82M|  const int txfm_size_col = tx_size_wide[TX_4X8];
 2495|  3.82M|  const int txfm_size_row = tx_size_high[TX_4X8];
 2496|  3.82M|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2497|  3.82M|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2498|  3.82M|  const fwd_transform_1d_sse4_1 col_txfm = col_highbd_txfm4x8_arr[tx_type];
 2499|  3.82M|  const fwd_transform_1d_sse4_1 row_txfm = row_highbd_txfm4x4_arr[tx_type];
 2500|       |
 2501|  3.82M|  int ud_flip, lr_flip;
 2502|  3.82M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2503|       |
 2504|  3.82M|  load_buffer_4x8(input, in, stride, ud_flip, lr_flip, shift[0]);
 2505|  3.82M|  col_txfm(in, in, bitcol, 1);
 2506|  3.82M|  col_txfm_4x8_rounding(in, -shift[1]);
 2507|       |
 2508|  11.4M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2508:19): [True: 7.64M, False: 3.82M]
  ------------------
 2509|  7.64M|    __m128i *cur_in = &in[i * 4];
 2510|  7.64M|    transpose_32bit_4x4(cur_in, cur_in);
 2511|  7.64M|    row_txfm(cur_in, cur_in, bitrow, 1);
 2512|  7.64M|    av1_round_shift_rect_array_32_sse4_1(cur_in, cur_in, txfm_size_col,
 2513|  7.64M|                                         -shift[2], NewSqrt2);
 2514|  7.64M|    store_output_w4(coeff + i * 4, cur_in, txfm_size_row, 4);
 2515|  7.64M|  }
 2516|  3.82M|  (void)bd;
 2517|  3.82M|}
av1_fwd_txfm2d_8x4_sse4_1:
 2520|  2.96M|                               TX_TYPE tx_type, int bd) {
 2521|  2.96M|  __m128i in[8];
 2522|  2.96M|  __m128i *outcoeff128 = (__m128i *)coeff;
 2523|  2.96M|  const int8_t *shift = av1_fwd_txfm_shift_ls[TX_8X4];
 2524|  2.96M|  const int txw_idx = get_txw_idx(TX_8X4);
 2525|  2.96M|  const int txh_idx = get_txh_idx(TX_8X4);
 2526|  2.96M|  const int txfm_size_col = tx_size_wide[TX_8X4];
 2527|  2.96M|  const int txfm_size_row = tx_size_high[TX_8X4];
 2528|  2.96M|  int bitcol = av1_fwd_cos_bit_col[txw_idx][txh_idx];
 2529|  2.96M|  int bitrow = av1_fwd_cos_bit_row[txw_idx][txh_idx];
 2530|  2.96M|  const fwd_transform_1d_sse4_1 col_txfm = col_highbd_txfm4x4_arr[tx_type];
 2531|  2.96M|  const fwd_transform_1d_sse4_1 row_txfm = row_highbd_txfm4x8_arr[tx_type];
 2532|  2.96M|  int ud_flip, lr_flip;
 2533|  2.96M|  get_flip_cfg(tx_type, &ud_flip, &lr_flip);
 2534|       |  // col tranform
 2535|  2.96M|  load_buffer_8x4(input, in, stride, ud_flip, lr_flip, shift[0]);
 2536|  8.89M|  for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2536:19): [True: 5.93M, False: 2.96M]
  ------------------
 2537|  5.93M|    __m128i *cur_in = &in[i * txfm_size_row];
 2538|  5.93M|    col_txfm(cur_in, cur_in, bitcol, 1);
 2539|  5.93M|    transpose_32bit_4x4(cur_in, cur_in);
 2540|  5.93M|  }
 2541|  2.96M|  col_txfm_4x8_rounding(in, -shift[1]);
 2542|       |
 2543|       |  // row tranform
 2544|  2.96M|  row_txfm(in, outcoeff128, bitrow, 1);
 2545|  2.96M|  av1_round_shift_rect_array_32_sse4_1(outcoeff128, outcoeff128, txfm_size_col,
 2546|  2.96M|                                       -shift[2], NewSqrt2);
 2547|  2.96M|  (void)bd;
 2548|  2.96M|}
highbd_fwd_txfm_sse4.c:load_buffer_4x4:
   85|  42.0M|                                   int shift) {
   86|  42.0M|  if (!flipud) {
  ------------------
  |  Branch (86:7): [True: 41.8M, False: 172k]
  ------------------
   87|  41.8M|    in[0] = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
   88|  41.8M|    in[1] = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
   89|  41.8M|    in[2] = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
   90|  41.8M|    in[3] = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
   91|  41.8M|  } else {
   92|   172k|    in[0] = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
   93|   172k|    in[1] = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
   94|   172k|    in[2] = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
   95|   172k|    in[3] = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
   96|   172k|  }
   97|       |
   98|  42.0M|  if (fliplr) {
  ------------------
  |  Branch (98:7): [True: 265k, False: 41.7M]
  ------------------
   99|   265k|    in[0] = _mm_shufflelo_epi16(in[0], 0x1b);
  100|   265k|    in[1] = _mm_shufflelo_epi16(in[1], 0x1b);
  101|   265k|    in[2] = _mm_shufflelo_epi16(in[2], 0x1b);
  102|   265k|    in[3] = _mm_shufflelo_epi16(in[3], 0x1b);
  103|   265k|  }
  104|       |
  105|  42.0M|  in[0] = _mm_cvtepi16_epi32(in[0]);
  106|  42.0M|  in[1] = _mm_cvtepi16_epi32(in[1]);
  107|  42.0M|  in[2] = _mm_cvtepi16_epi32(in[2]);
  108|  42.0M|  in[3] = _mm_cvtepi16_epi32(in[3]);
  109|       |
  110|  42.0M|  in[0] = _mm_slli_epi32(in[0], shift);
  111|  42.0M|  in[1] = _mm_slli_epi32(in[1], shift);
  112|  42.0M|  in[2] = _mm_slli_epi32(in[2], shift);
  113|  42.0M|  in[3] = _mm_slli_epi32(in[3], shift);
  114|  42.0M|}
highbd_fwd_txfm_sse4.c:fdct4x4_sse4_1:
  121|  42.9M|                           const int num_col) {
  122|  42.9M|  const int32_t *cospi = cospi_arr(bit);
  123|  42.9M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
  124|  42.9M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
  125|  42.9M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
  126|  42.9M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
  127|  42.9M|  __m128i s0, s1, s2, s3;
  128|  42.9M|  __m128i u0, u1, u2, u3;
  129|  42.9M|  __m128i v0, v1, v2, v3;
  130|       |
  131|  42.9M|  int endidx = 3 * num_col;
  132|  42.9M|  s0 = _mm_add_epi32(in[0], in[endidx]);
  133|  42.9M|  s3 = _mm_sub_epi32(in[0], in[endidx]);
  134|  42.9M|  endidx -= num_col;
  135|  42.9M|  s1 = _mm_add_epi32(in[num_col], in[endidx]);
  136|  42.9M|  s2 = _mm_sub_epi32(in[num_col], in[endidx]);
  137|       |
  138|       |  // btf_32_sse4_1_type0(cospi32, cospi32, s[01], u[02], bit);
  139|  42.9M|  u0 = _mm_mullo_epi32(s0, cospi32);
  140|  42.9M|  u1 = _mm_mullo_epi32(s1, cospi32);
  141|  42.9M|  u2 = _mm_add_epi32(u0, u1);
  142|  42.9M|  v0 = _mm_sub_epi32(u0, u1);
  143|       |
  144|  42.9M|  u3 = _mm_add_epi32(u2, rnding);
  145|  42.9M|  v1 = _mm_add_epi32(v0, rnding);
  146|       |
  147|  42.9M|  u0 = _mm_srai_epi32(u3, bit);
  148|  42.9M|  u2 = _mm_srai_epi32(v1, bit);
  149|       |
  150|       |  // btf_32_sse4_1_type1(cospi48, cospi16, s[23], u[13], bit);
  151|  42.9M|  v0 = _mm_mullo_epi32(s2, cospi48);
  152|  42.9M|  v1 = _mm_mullo_epi32(s3, cospi16);
  153|  42.9M|  v2 = _mm_add_epi32(v0, v1);
  154|       |
  155|  42.9M|  v3 = _mm_add_epi32(v2, rnding);
  156|  42.9M|  u1 = _mm_srai_epi32(v3, bit);
  157|       |
  158|  42.9M|  v0 = _mm_mullo_epi32(s2, cospi16);
  159|  42.9M|  v1 = _mm_mullo_epi32(s3, cospi48);
  160|  42.9M|  v2 = _mm_sub_epi32(v1, v0);
  161|       |
  162|  42.9M|  v3 = _mm_add_epi32(v2, rnding);
  163|  42.9M|  u3 = _mm_srai_epi32(v3, bit);
  164|       |
  165|       |  // Note: shift[1] and shift[2] are zeros
  166|       |
  167|  42.9M|  out[0] = u0;
  168|  42.9M|  out[1] = u1;
  169|  42.9M|  out[2] = u2;
  170|  42.9M|  out[3] = u3;
  171|  42.9M|}
highbd_fwd_txfm_sse4.c:write_buffer_4x4:
  173|  27.4M|static inline void write_buffer_4x4(__m128i *res, int32_t *output) {
  174|  27.4M|  _mm_store_si128((__m128i *)(output + 0 * 4), res[0]);
  175|  27.4M|  _mm_store_si128((__m128i *)(output + 1 * 4), res[1]);
  176|  27.4M|  _mm_store_si128((__m128i *)(output + 2 * 4), res[2]);
  177|  27.4M|  _mm_store_si128((__m128i *)(output + 3 * 4), res[3]);
  178|  27.4M|}
highbd_fwd_txfm_sse4.c:fadst4x4_sse4_1:
  181|  21.1M|                            const int num_col) {
  182|  21.1M|  const int32_t *sinpi = sinpi_arr(bit);
  183|  21.1M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
  184|  21.1M|  const __m128i sinpi1 = _mm_set1_epi32((int)sinpi[1]);
  185|  21.1M|  const __m128i sinpi2 = _mm_set1_epi32((int)sinpi[2]);
  186|  21.1M|  const __m128i sinpi3 = _mm_set1_epi32((int)sinpi[3]);
  187|  21.1M|  const __m128i sinpi4 = _mm_set1_epi32((int)sinpi[4]);
  188|  21.1M|  __m128i t;
  189|  21.1M|  __m128i s0, s1, s2, s3, s4, s5, s6, s7;
  190|  21.1M|  __m128i x0, x1, x2, x3;
  191|  21.1M|  __m128i u0, u1, u2, u3;
  192|       |
  193|  21.1M|  int idx = 0 * num_col;
  194|  21.1M|  s0 = _mm_mullo_epi32(in[idx], sinpi1);
  195|  21.1M|  s1 = _mm_mullo_epi32(in[idx], sinpi4);
  196|  21.1M|  t = _mm_add_epi32(in[idx], in[idx + num_col]);
  197|  21.1M|  idx += num_col;
  198|  21.1M|  s2 = _mm_mullo_epi32(in[idx], sinpi2);
  199|  21.1M|  s3 = _mm_mullo_epi32(in[idx], sinpi1);
  200|  21.1M|  idx += num_col;
  201|  21.1M|  s4 = _mm_mullo_epi32(in[idx], sinpi3);
  202|  21.1M|  idx += num_col;
  203|  21.1M|  s5 = _mm_mullo_epi32(in[idx], sinpi4);
  204|  21.1M|  s6 = _mm_mullo_epi32(in[idx], sinpi2);
  205|  21.1M|  s7 = _mm_sub_epi32(t, in[idx]);
  206|       |
  207|  21.1M|  t = _mm_add_epi32(s0, s2);
  208|  21.1M|  x0 = _mm_add_epi32(t, s5);
  209|  21.1M|  x1 = _mm_mullo_epi32(s7, sinpi3);
  210|  21.1M|  t = _mm_sub_epi32(s1, s3);
  211|  21.1M|  x2 = _mm_add_epi32(t, s6);
  212|  21.1M|  x3 = s4;
  213|       |
  214|  21.1M|  s0 = _mm_add_epi32(x0, x3);
  215|  21.1M|  s1 = x1;
  216|  21.1M|  s2 = _mm_sub_epi32(x2, x3);
  217|  21.1M|  t = _mm_sub_epi32(x2, x0);
  218|  21.1M|  s3 = _mm_add_epi32(t, x3);
  219|       |
  220|  21.1M|  u0 = _mm_add_epi32(s0, rnding);
  221|  21.1M|  u0 = _mm_srai_epi32(u0, bit);
  222|       |
  223|  21.1M|  u1 = _mm_add_epi32(s1, rnding);
  224|  21.1M|  u1 = _mm_srai_epi32(u1, bit);
  225|       |
  226|  21.1M|  u2 = _mm_add_epi32(s2, rnding);
  227|  21.1M|  u2 = _mm_srai_epi32(u2, bit);
  228|       |
  229|  21.1M|  u3 = _mm_add_epi32(s3, rnding);
  230|  21.1M|  u3 = _mm_srai_epi32(u3, bit);
  231|       |
  232|  21.1M|  out[0] = u0;
  233|  21.1M|  out[1] = u1;
  234|  21.1M|  out[2] = u2;
  235|  21.1M|  out[3] = u3;
  236|  21.1M|}
highbd_fwd_txfm_sse4.c:idtx4x4_sse4_1:
  237|  4.38M|static void idtx4x4_sse4_1(__m128i *in, __m128i *out, int bit, int col_num) {
  238|  4.38M|  (void)bit;
  239|  4.38M|  __m128i fact = _mm_set1_epi32(NewSqrt2);
  240|  4.38M|  __m128i offset = _mm_set1_epi32(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|  4.38M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  241|  4.38M|  __m128i a_low;
  242|       |
  243|  21.9M|  for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (243:19): [True: 17.5M, False: 4.38M]
  ------------------
  244|  17.5M|    a_low = _mm_mullo_epi32(in[i * col_num], fact);
  245|  17.5M|    a_low = _mm_add_epi32(a_low, offset);
  246|  17.5M|    out[i] = _mm_srai_epi32(a_low, NewSqrt2Bits);
  ------------------
  |  |   42|  17.5M|#define NewSqrt2Bits ((int32_t)12)
  ------------------
  247|  17.5M|  }
  248|  4.38M|}
highbd_fwd_txfm_sse4.c:load_buffer_8x8:
  376|   129k|                                   int shift) {
  377|   129k|  __m128i u;
  378|   129k|  if (!flipud) {
  ------------------
  |  Branch (378:7): [True: 129k, False: 18.4E]
  ------------------
  379|   129k|    in[0] = _mm_load_si128((const __m128i *)(input + 0 * stride));
  380|   129k|    in[1] = _mm_load_si128((const __m128i *)(input + 1 * stride));
  381|   129k|    in[2] = _mm_load_si128((const __m128i *)(input + 2 * stride));
  382|   129k|    in[3] = _mm_load_si128((const __m128i *)(input + 3 * stride));
  383|   129k|    in[4] = _mm_load_si128((const __m128i *)(input + 4 * stride));
  384|   129k|    in[5] = _mm_load_si128((const __m128i *)(input + 5 * stride));
  385|   129k|    in[6] = _mm_load_si128((const __m128i *)(input + 6 * stride));
  386|   129k|    in[7] = _mm_load_si128((const __m128i *)(input + 7 * stride));
  387|  18.4E|  } else {
  388|  18.4E|    in[0] = _mm_load_si128((const __m128i *)(input + 7 * stride));
  389|  18.4E|    in[1] = _mm_load_si128((const __m128i *)(input + 6 * stride));
  390|  18.4E|    in[2] = _mm_load_si128((const __m128i *)(input + 5 * stride));
  391|  18.4E|    in[3] = _mm_load_si128((const __m128i *)(input + 4 * stride));
  392|  18.4E|    in[4] = _mm_load_si128((const __m128i *)(input + 3 * stride));
  393|  18.4E|    in[5] = _mm_load_si128((const __m128i *)(input + 2 * stride));
  394|  18.4E|    in[6] = _mm_load_si128((const __m128i *)(input + 1 * stride));
  395|  18.4E|    in[7] = _mm_load_si128((const __m128i *)(input + 0 * stride));
  396|  18.4E|  }
  397|       |
  398|   129k|  if (fliplr) {
  ------------------
  |  Branch (398:7): [True: 0, False: 129k]
  ------------------
  399|      0|    in[0] = mm_reverse_epi16(in[0]);
  400|      0|    in[1] = mm_reverse_epi16(in[1]);
  401|      0|    in[2] = mm_reverse_epi16(in[2]);
  402|      0|    in[3] = mm_reverse_epi16(in[3]);
  403|      0|    in[4] = mm_reverse_epi16(in[4]);
  404|      0|    in[5] = mm_reverse_epi16(in[5]);
  405|      0|    in[6] = mm_reverse_epi16(in[6]);
  406|      0|    in[7] = mm_reverse_epi16(in[7]);
  407|      0|  }
  408|       |
  409|   129k|  u = _mm_unpackhi_epi64(in[4], in[4]);
  410|   129k|  in[8] = _mm_cvtepi16_epi32(in[4]);
  411|   129k|  in[9] = _mm_cvtepi16_epi32(u);
  412|       |
  413|   129k|  u = _mm_unpackhi_epi64(in[5], in[5]);
  414|   129k|  in[10] = _mm_cvtepi16_epi32(in[5]);
  415|   129k|  in[11] = _mm_cvtepi16_epi32(u);
  416|       |
  417|   129k|  u = _mm_unpackhi_epi64(in[6], in[6]);
  418|   129k|  in[12] = _mm_cvtepi16_epi32(in[6]);
  419|   129k|  in[13] = _mm_cvtepi16_epi32(u);
  420|       |
  421|   129k|  u = _mm_unpackhi_epi64(in[7], in[7]);
  422|   129k|  in[14] = _mm_cvtepi16_epi32(in[7]);
  423|   129k|  in[15] = _mm_cvtepi16_epi32(u);
  424|       |
  425|   129k|  u = _mm_unpackhi_epi64(in[3], in[3]);
  426|   129k|  in[6] = _mm_cvtepi16_epi32(in[3]);
  427|   129k|  in[7] = _mm_cvtepi16_epi32(u);
  428|       |
  429|   129k|  u = _mm_unpackhi_epi64(in[2], in[2]);
  430|   129k|  in[4] = _mm_cvtepi16_epi32(in[2]);
  431|   129k|  in[5] = _mm_cvtepi16_epi32(u);
  432|       |
  433|   129k|  u = _mm_unpackhi_epi64(in[1], in[1]);
  434|   129k|  in[2] = _mm_cvtepi16_epi32(in[1]);
  435|   129k|  in[3] = _mm_cvtepi16_epi32(u);
  436|       |
  437|   129k|  u = _mm_unpackhi_epi64(in[0], in[0]);
  438|   129k|  in[0] = _mm_cvtepi16_epi32(in[0]);
  439|   129k|  in[1] = _mm_cvtepi16_epi32(u);
  440|       |
  441|   129k|  in[0] = _mm_slli_epi32(in[0], shift);
  442|   129k|  in[1] = _mm_slli_epi32(in[1], shift);
  443|   129k|  in[2] = _mm_slli_epi32(in[2], shift);
  444|   129k|  in[3] = _mm_slli_epi32(in[3], shift);
  445|   129k|  in[4] = _mm_slli_epi32(in[4], shift);
  446|   129k|  in[5] = _mm_slli_epi32(in[5], shift);
  447|   129k|  in[6] = _mm_slli_epi32(in[6], shift);
  448|   129k|  in[7] = _mm_slli_epi32(in[7], shift);
  449|       |
  450|   129k|  in[8] = _mm_slli_epi32(in[8], shift);
  451|   129k|  in[9] = _mm_slli_epi32(in[9], shift);
  452|   129k|  in[10] = _mm_slli_epi32(in[10], shift);
  453|   129k|  in[11] = _mm_slli_epi32(in[11], shift);
  454|   129k|  in[12] = _mm_slli_epi32(in[12], shift);
  455|   129k|  in[13] = _mm_slli_epi32(in[13], shift);
  456|   129k|  in[14] = _mm_slli_epi32(in[14], shift);
  457|   129k|  in[15] = _mm_slli_epi32(in[15], shift);
  458|   129k|}
highbd_fwd_txfm_sse4.c:fdct4x8_sse4_1:
  566|  4.60M|                           const int col_num) {
  567|  4.60M|  const int32_t *cospi = cospi_arr(bit);
  568|  4.60M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
  569|  4.60M|  const __m128i cospim32 = _mm_set1_epi32(-cospi[32]);
  570|  4.60M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
  571|  4.60M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
  572|  4.60M|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
  573|  4.60M|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
  574|  4.60M|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
  575|  4.60M|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
  576|  4.60M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
  577|  4.60M|  __m128i u[8], v[8];
  578|       |
  579|  4.60M|  int startidx = 0 * col_num;
  580|  4.60M|  int endidx = 7 * col_num;
  581|       |  // Even 8 points 0, 2, ..., 14
  582|       |  // stage 0
  583|       |  // stage 1
  584|  4.60M|  u[0] = _mm_add_epi32(in[startidx], in[endidx]);
  585|  4.60M|  v[7] = _mm_sub_epi32(in[startidx], in[endidx]);  // v[7]
  586|  4.60M|  startidx += col_num;
  587|  4.60M|  endidx -= col_num;
  588|  4.60M|  u[1] = _mm_add_epi32(in[startidx], in[endidx]);
  589|  4.60M|  u[6] = _mm_sub_epi32(in[startidx], in[endidx]);
  590|  4.60M|  startidx += col_num;
  591|  4.60M|  endidx -= col_num;
  592|  4.60M|  u[2] = _mm_add_epi32(in[startidx], in[endidx]);
  593|  4.60M|  u[5] = _mm_sub_epi32(in[startidx], in[endidx]);
  594|  4.60M|  startidx += col_num;
  595|  4.60M|  endidx -= col_num;
  596|  4.60M|  u[3] = _mm_add_epi32(in[startidx], in[endidx]);
  597|  4.60M|  v[4] = _mm_sub_epi32(in[startidx], in[endidx]);  // v[4]
  598|       |
  599|       |  // stage 2
  600|  4.60M|  v[0] = _mm_add_epi32(u[0], u[3]);
  601|  4.60M|  v[3] = _mm_sub_epi32(u[0], u[3]);
  602|  4.60M|  v[1] = _mm_add_epi32(u[1], u[2]);
  603|  4.60M|  v[2] = _mm_sub_epi32(u[1], u[2]);
  604|       |
  605|  4.60M|  v[5] = _mm_mullo_epi32(u[5], cospim32);
  606|  4.60M|  v[6] = _mm_mullo_epi32(u[6], cospi32);
  607|  4.60M|  v[5] = _mm_add_epi32(v[5], v[6]);
  608|  4.60M|  v[5] = _mm_add_epi32(v[5], rnding);
  609|  4.60M|  v[5] = _mm_srai_epi32(v[5], bit);
  610|       |
  611|  4.60M|  u[0] = _mm_mullo_epi32(u[5], cospi32);
  612|  4.60M|  v[6] = _mm_mullo_epi32(u[6], cospim32);
  613|  4.60M|  v[6] = _mm_sub_epi32(u[0], v[6]);
  614|  4.60M|  v[6] = _mm_add_epi32(v[6], rnding);
  615|  4.60M|  v[6] = _mm_srai_epi32(v[6], bit);
  616|       |
  617|       |  // stage 3
  618|       |  // type 0
  619|  4.60M|  v[0] = _mm_mullo_epi32(v[0], cospi32);
  620|  4.60M|  v[1] = _mm_mullo_epi32(v[1], cospi32);
  621|  4.60M|  u[0] = _mm_add_epi32(v[0], v[1]);
  622|  4.60M|  u[0] = _mm_add_epi32(u[0], rnding);
  623|  4.60M|  u[0] = _mm_srai_epi32(u[0], bit);
  624|       |
  625|  4.60M|  u[1] = _mm_sub_epi32(v[0], v[1]);
  626|  4.60M|  u[1] = _mm_add_epi32(u[1], rnding);
  627|  4.60M|  u[1] = _mm_srai_epi32(u[1], bit);
  628|       |
  629|       |  // type 1
  630|  4.60M|  v[0] = _mm_mullo_epi32(v[2], cospi48);
  631|  4.60M|  v[1] = _mm_mullo_epi32(v[3], cospi16);
  632|  4.60M|  u[2] = _mm_add_epi32(v[0], v[1]);
  633|  4.60M|  u[2] = _mm_add_epi32(u[2], rnding);
  634|  4.60M|  u[2] = _mm_srai_epi32(u[2], bit);
  635|       |
  636|  4.60M|  v[0] = _mm_mullo_epi32(v[2], cospi16);
  637|  4.60M|  v[1] = _mm_mullo_epi32(v[3], cospi48);
  638|  4.60M|  u[3] = _mm_sub_epi32(v[1], v[0]);
  639|  4.60M|  u[3] = _mm_add_epi32(u[3], rnding);
  640|  4.60M|  u[3] = _mm_srai_epi32(u[3], bit);
  641|       |
  642|  4.60M|  u[4] = _mm_add_epi32(v[4], v[5]);
  643|  4.60M|  u[5] = _mm_sub_epi32(v[4], v[5]);
  644|  4.60M|  u[6] = _mm_sub_epi32(v[7], v[6]);
  645|  4.60M|  u[7] = _mm_add_epi32(v[7], v[6]);
  646|       |
  647|       |  // stage 4
  648|       |  // stage 5
  649|  4.60M|  v[0] = _mm_mullo_epi32(u[4], cospi56);
  650|  4.60M|  v[1] = _mm_mullo_epi32(u[7], cospi8);
  651|  4.60M|  v[0] = _mm_add_epi32(v[0], v[1]);
  652|  4.60M|  v[0] = _mm_add_epi32(v[0], rnding);
  653|  4.60M|  out[1 * col_num] = _mm_srai_epi32(v[0], bit);  // buf0[4]
  654|       |
  655|  4.60M|  v[0] = _mm_mullo_epi32(u[4], cospi8);
  656|  4.60M|  v[1] = _mm_mullo_epi32(u[7], cospi56);
  657|  4.60M|  v[0] = _mm_sub_epi32(v[1], v[0]);
  658|  4.60M|  v[0] = _mm_add_epi32(v[0], rnding);
  659|  4.60M|  out[7 * col_num] = _mm_srai_epi32(v[0], bit);  // buf0[7]
  660|       |
  661|  4.60M|  v[0] = _mm_mullo_epi32(u[5], cospi24);
  662|  4.60M|  v[1] = _mm_mullo_epi32(u[6], cospi40);
  663|  4.60M|  v[0] = _mm_add_epi32(v[0], v[1]);
  664|  4.60M|  v[0] = _mm_add_epi32(v[0], rnding);
  665|  4.60M|  out[5 * col_num] = _mm_srai_epi32(v[0], bit);  // buf0[5]
  666|       |
  667|  4.60M|  v[0] = _mm_mullo_epi32(u[5], cospi40);
  668|  4.60M|  v[1] = _mm_mullo_epi32(u[6], cospi24);
  669|  4.60M|  v[0] = _mm_sub_epi32(v[1], v[0]);
  670|  4.60M|  v[0] = _mm_add_epi32(v[0], rnding);
  671|  4.60M|  out[3 * col_num] = _mm_srai_epi32(v[0], bit);  // buf0[6]
  672|       |
  673|  4.60M|  out[0 * col_num] = u[0];  // buf0[0]
  674|  4.60M|  out[4 * col_num] = u[1];  // buf0[1]
  675|  4.60M|  out[2 * col_num] = u[2];  // buf0[2]
  676|  4.60M|  out[6 * col_num] = u[3];  // buf0[3]
  677|  4.60M|}
highbd_fwd_txfm_sse4.c:col_txfm_8x8_rounding:
  460|   410k|static inline void col_txfm_8x8_rounding(__m128i *in, int shift) {
  461|   410k|  const __m128i rounding = _mm_set1_epi32(1 << (shift - 1));
  462|       |
  463|   410k|  in[0] = _mm_add_epi32(in[0], rounding);
  464|   410k|  in[1] = _mm_add_epi32(in[1], rounding);
  465|   410k|  in[2] = _mm_add_epi32(in[2], rounding);
  466|   410k|  in[3] = _mm_add_epi32(in[3], rounding);
  467|   410k|  in[4] = _mm_add_epi32(in[4], rounding);
  468|   410k|  in[5] = _mm_add_epi32(in[5], rounding);
  469|   410k|  in[6] = _mm_add_epi32(in[6], rounding);
  470|   410k|  in[7] = _mm_add_epi32(in[7], rounding);
  471|   410k|  in[8] = _mm_add_epi32(in[8], rounding);
  472|   410k|  in[9] = _mm_add_epi32(in[9], rounding);
  473|   410k|  in[10] = _mm_add_epi32(in[10], rounding);
  474|   410k|  in[11] = _mm_add_epi32(in[11], rounding);
  475|   410k|  in[12] = _mm_add_epi32(in[12], rounding);
  476|   410k|  in[13] = _mm_add_epi32(in[13], rounding);
  477|   410k|  in[14] = _mm_add_epi32(in[14], rounding);
  478|   410k|  in[15] = _mm_add_epi32(in[15], rounding);
  479|       |
  480|   410k|  in[0] = _mm_srai_epi32(in[0], shift);
  481|   410k|  in[1] = _mm_srai_epi32(in[1], shift);
  482|   410k|  in[2] = _mm_srai_epi32(in[2], shift);
  483|   410k|  in[3] = _mm_srai_epi32(in[3], shift);
  484|   410k|  in[4] = _mm_srai_epi32(in[4], shift);
  485|   410k|  in[5] = _mm_srai_epi32(in[5], shift);
  486|   410k|  in[6] = _mm_srai_epi32(in[6], shift);
  487|   410k|  in[7] = _mm_srai_epi32(in[7], shift);
  488|   410k|  in[8] = _mm_srai_epi32(in[8], shift);
  489|   410k|  in[9] = _mm_srai_epi32(in[9], shift);
  490|   410k|  in[10] = _mm_srai_epi32(in[10], shift);
  491|   410k|  in[11] = _mm_srai_epi32(in[11], shift);
  492|   410k|  in[12] = _mm_srai_epi32(in[12], shift);
  493|   410k|  in[13] = _mm_srai_epi32(in[13], shift);
  494|   410k|  in[14] = _mm_srai_epi32(in[14], shift);
  495|   410k|  in[15] = _mm_srai_epi32(in[15], shift);
  496|   410k|}
highbd_fwd_txfm_sse4.c:fadst8x8_sse4_1:
  686|  1.83M|                            const int col_num) {
  687|  1.83M|  const int32_t *cospi = cospi_arr(bit);
  688|  1.83M|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
  689|  1.83M|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
  690|  1.83M|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
  691|  1.83M|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
  692|  1.83M|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
  693|  1.83M|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
  694|  1.83M|  const __m128i cospim4 = _mm_set1_epi32(-cospi[4]);
  695|  1.83M|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
  696|  1.83M|  const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
  697|  1.83M|  const __m128i cospim20 = _mm_set1_epi32(-cospi[20]);
  698|  1.83M|  const __m128i cospi44 = _mm_set1_epi32(cospi[44]);
  699|  1.83M|  const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
  700|  1.83M|  const __m128i cospi36 = _mm_set1_epi32(cospi[36]);
  701|  1.83M|  const __m128i cospim36 = _mm_set1_epi32(-cospi[36]);
  702|  1.83M|  const __m128i cospi52 = _mm_set1_epi32(cospi[52]);
  703|  1.83M|  const __m128i cospim52 = _mm_set1_epi32(-cospi[52]);
  704|  1.83M|  const __m128i cospi12 = _mm_set1_epi32(cospi[12]);
  705|  1.83M|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
  706|  1.83M|  const __m128i zero = _mm_setzero_si128();
  707|  1.83M|  __m128i u0, u1, u2, u3, u4, u5, u6, u7;
  708|  1.83M|  __m128i v0, v1, v2, v3, v4, v5, v6, v7;
  709|  1.83M|  __m128i x, y;
  710|  1.83M|  int col;
  711|       |
  712|       |  // Note:
  713|       |  //  Even column: 0, 2, ..., 14
  714|       |  //  Odd column: 1, 3, ..., 15
  715|       |  //  one even column plus one odd column constructs one row (8 coeffs)
  716|       |  //  total we have 8 rows (8x8).
  717|  3.67M|  for (col = 0; col < col_num; ++col) {
  ------------------
  |  Branch (717:17): [True: 1.83M, False: 1.83M]
  ------------------
  718|       |    // stage 0
  719|       |    // stage 1
  720|  1.83M|    u0 = in[col_num * 0 + col];
  721|  1.83M|    u1 = _mm_sub_epi32(zero, in[col_num * 7 + col]);
  722|  1.83M|    u2 = _mm_sub_epi32(zero, in[col_num * 3 + col]);
  723|  1.83M|    u3 = in[col_num * 4 + col];
  724|  1.83M|    u4 = _mm_sub_epi32(zero, in[col_num * 1 + col]);
  725|  1.83M|    u5 = in[col_num * 6 + col];
  726|  1.83M|    u6 = in[col_num * 2 + col];
  727|  1.83M|    u7 = _mm_sub_epi32(zero, in[col_num * 5 + col]);
  728|       |
  729|       |    // stage 2
  730|  1.83M|    v0 = u0;
  731|  1.83M|    v1 = u1;
  732|       |
  733|  1.83M|    x = _mm_mullo_epi32(u2, cospi32);
  734|  1.83M|    y = _mm_mullo_epi32(u3, cospi32);
  735|  1.83M|    v2 = _mm_add_epi32(x, y);
  736|  1.83M|    v2 = _mm_add_epi32(v2, rnding);
  737|  1.83M|    v2 = _mm_srai_epi32(v2, bit);
  738|       |
  739|  1.83M|    v3 = _mm_sub_epi32(x, y);
  740|  1.83M|    v3 = _mm_add_epi32(v3, rnding);
  741|  1.83M|    v3 = _mm_srai_epi32(v3, bit);
  742|       |
  743|  1.83M|    v4 = u4;
  744|  1.83M|    v5 = u5;
  745|       |
  746|  1.83M|    x = _mm_mullo_epi32(u6, cospi32);
  747|  1.83M|    y = _mm_mullo_epi32(u7, cospi32);
  748|  1.83M|    v6 = _mm_add_epi32(x, y);
  749|  1.83M|    v6 = _mm_add_epi32(v6, rnding);
  750|  1.83M|    v6 = _mm_srai_epi32(v6, bit);
  751|       |
  752|  1.83M|    v7 = _mm_sub_epi32(x, y);
  753|  1.83M|    v7 = _mm_add_epi32(v7, rnding);
  754|  1.83M|    v7 = _mm_srai_epi32(v7, bit);
  755|       |
  756|       |    // stage 3
  757|  1.83M|    u0 = _mm_add_epi32(v0, v2);
  758|  1.83M|    u1 = _mm_add_epi32(v1, v3);
  759|  1.83M|    u2 = _mm_sub_epi32(v0, v2);
  760|  1.83M|    u3 = _mm_sub_epi32(v1, v3);
  761|  1.83M|    u4 = _mm_add_epi32(v4, v6);
  762|  1.83M|    u5 = _mm_add_epi32(v5, v7);
  763|  1.83M|    u6 = _mm_sub_epi32(v4, v6);
  764|  1.83M|    u7 = _mm_sub_epi32(v5, v7);
  765|       |
  766|       |    // stage 4
  767|  1.83M|    v0 = u0;
  768|  1.83M|    v1 = u1;
  769|  1.83M|    v2 = u2;
  770|  1.83M|    v3 = u3;
  771|       |
  772|  1.83M|    x = _mm_mullo_epi32(u4, cospi16);
  773|  1.83M|    y = _mm_mullo_epi32(u5, cospi48);
  774|  1.83M|    v4 = _mm_add_epi32(x, y);
  775|  1.83M|    v4 = _mm_add_epi32(v4, rnding);
  776|  1.83M|    v4 = _mm_srai_epi32(v4, bit);
  777|       |
  778|  1.83M|    x = _mm_mullo_epi32(u4, cospi48);
  779|  1.83M|    y = _mm_mullo_epi32(u5, cospim16);
  780|  1.83M|    v5 = _mm_add_epi32(x, y);
  781|  1.83M|    v5 = _mm_add_epi32(v5, rnding);
  782|  1.83M|    v5 = _mm_srai_epi32(v5, bit);
  783|       |
  784|  1.83M|    x = _mm_mullo_epi32(u6, cospim48);
  785|  1.83M|    y = _mm_mullo_epi32(u7, cospi16);
  786|  1.83M|    v6 = _mm_add_epi32(x, y);
  787|  1.83M|    v6 = _mm_add_epi32(v6, rnding);
  788|  1.83M|    v6 = _mm_srai_epi32(v6, bit);
  789|       |
  790|  1.83M|    x = _mm_mullo_epi32(u6, cospi16);
  791|  1.83M|    y = _mm_mullo_epi32(u7, cospi48);
  792|  1.83M|    v7 = _mm_add_epi32(x, y);
  793|  1.83M|    v7 = _mm_add_epi32(v7, rnding);
  794|  1.83M|    v7 = _mm_srai_epi32(v7, bit);
  795|       |
  796|       |    // stage 5
  797|  1.83M|    u0 = _mm_add_epi32(v0, v4);
  798|  1.83M|    u1 = _mm_add_epi32(v1, v5);
  799|  1.83M|    u2 = _mm_add_epi32(v2, v6);
  800|  1.83M|    u3 = _mm_add_epi32(v3, v7);
  801|  1.83M|    u4 = _mm_sub_epi32(v0, v4);
  802|  1.83M|    u5 = _mm_sub_epi32(v1, v5);
  803|  1.83M|    u6 = _mm_sub_epi32(v2, v6);
  804|  1.83M|    u7 = _mm_sub_epi32(v3, v7);
  805|       |
  806|       |    // stage 6
  807|  1.83M|    x = _mm_mullo_epi32(u0, cospi4);
  808|  1.83M|    y = _mm_mullo_epi32(u1, cospi60);
  809|  1.83M|    v0 = _mm_add_epi32(x, y);
  810|  1.83M|    v0 = _mm_add_epi32(v0, rnding);
  811|  1.83M|    v0 = _mm_srai_epi32(v0, bit);
  812|       |
  813|  1.83M|    x = _mm_mullo_epi32(u0, cospi60);
  814|  1.83M|    y = _mm_mullo_epi32(u1, cospim4);
  815|  1.83M|    v1 = _mm_add_epi32(x, y);
  816|  1.83M|    v1 = _mm_add_epi32(v1, rnding);
  817|  1.83M|    v1 = _mm_srai_epi32(v1, bit);
  818|       |
  819|  1.83M|    x = _mm_mullo_epi32(u2, cospi20);
  820|  1.83M|    y = _mm_mullo_epi32(u3, cospi44);
  821|  1.83M|    v2 = _mm_add_epi32(x, y);
  822|  1.83M|    v2 = _mm_add_epi32(v2, rnding);
  823|  1.83M|    v2 = _mm_srai_epi32(v2, bit);
  824|       |
  825|  1.83M|    x = _mm_mullo_epi32(u2, cospi44);
  826|  1.83M|    y = _mm_mullo_epi32(u3, cospim20);
  827|  1.83M|    v3 = _mm_add_epi32(x, y);
  828|  1.83M|    v3 = _mm_add_epi32(v3, rnding);
  829|  1.83M|    v3 = _mm_srai_epi32(v3, bit);
  830|       |
  831|  1.83M|    x = _mm_mullo_epi32(u4, cospi36);
  832|  1.83M|    y = _mm_mullo_epi32(u5, cospi28);
  833|  1.83M|    v4 = _mm_add_epi32(x, y);
  834|  1.83M|    v4 = _mm_add_epi32(v4, rnding);
  835|  1.83M|    v4 = _mm_srai_epi32(v4, bit);
  836|       |
  837|  1.83M|    x = _mm_mullo_epi32(u4, cospi28);
  838|  1.83M|    y = _mm_mullo_epi32(u5, cospim36);
  839|  1.83M|    v5 = _mm_add_epi32(x, y);
  840|  1.83M|    v5 = _mm_add_epi32(v5, rnding);
  841|  1.83M|    v5 = _mm_srai_epi32(v5, bit);
  842|       |
  843|  1.83M|    x = _mm_mullo_epi32(u6, cospi52);
  844|  1.83M|    y = _mm_mullo_epi32(u7, cospi12);
  845|  1.83M|    v6 = _mm_add_epi32(x, y);
  846|  1.83M|    v6 = _mm_add_epi32(v6, rnding);
  847|  1.83M|    v6 = _mm_srai_epi32(v6, bit);
  848|       |
  849|  1.83M|    x = _mm_mullo_epi32(u6, cospi12);
  850|  1.83M|    y = _mm_mullo_epi32(u7, cospim52);
  851|  1.83M|    v7 = _mm_add_epi32(x, y);
  852|  1.83M|    v7 = _mm_add_epi32(v7, rnding);
  853|  1.83M|    v7 = _mm_srai_epi32(v7, bit);
  854|       |
  855|       |    // stage 7
  856|  1.83M|    out[col_num * 0 + col] = v1;
  857|  1.83M|    out[col_num * 1 + col] = v6;
  858|  1.83M|    out[col_num * 2 + col] = v3;
  859|  1.83M|    out[col_num * 3 + col] = v4;
  860|  1.83M|    out[col_num * 4 + col] = v5;
  861|  1.83M|    out[col_num * 5 + col] = v2;
  862|  1.83M|    out[col_num * 6 + col] = v7;
  863|  1.83M|    out[col_num * 7 + col] = v0;
  864|  1.83M|  }
  865|  1.83M|}
highbd_fwd_txfm_sse4.c:idtx8x8_sse4_1:
  866|   345k|static void idtx8x8_sse4_1(__m128i *in, __m128i *out, int bit, int col_num) {
  867|   345k|  (void)bit;
  868|       |
  869|   690k|  for (int i = 0; i < col_num; i += 1) {
  ------------------
  |  Branch (869:19): [True: 345k, False: 345k]
  ------------------
  870|   345k|    out[0 + 8 * i] = _mm_add_epi32(in[0 + 8 * i], in[0 + 8 * i]);
  871|   345k|    out[1 + 8 * i] = _mm_add_epi32(in[1 + 8 * i], in[1 + 8 * i]);
  872|   345k|    out[2 + 8 * i] = _mm_add_epi32(in[2 + 8 * i], in[2 + 8 * i]);
  873|   345k|    out[3 + 8 * i] = _mm_add_epi32(in[3 + 8 * i], in[3 + 8 * i]);
  874|   345k|    out[4 + 8 * i] = _mm_add_epi32(in[4 + 8 * i], in[4 + 8 * i]);
  875|   345k|    out[5 + 8 * i] = _mm_add_epi32(in[5 + 8 * i], in[5 + 8 * i]);
  876|   345k|    out[6 + 8 * i] = _mm_add_epi32(in[6 + 8 * i], in[6 + 8 * i]);
  877|   345k|    out[7 + 8 * i] = _mm_add_epi32(in[7 + 8 * i], in[7 + 8 * i]);
  878|   345k|  }
  879|   345k|}
highbd_fwd_txfm_sse4.c:load_buffer_16x16:
 1070|  32.4k|                                     int shift) {
 1071|  32.4k|  __m128i in[64];
 1072|       |  // Load 4 8x8 blocks
 1073|  32.4k|  const int16_t *topL = input;
 1074|  32.4k|  const int16_t *topR = input + 8;
 1075|  32.4k|  const int16_t *botL = input + 8 * stride;
 1076|  32.4k|  const int16_t *botR = input + 8 * stride + 8;
 1077|       |
 1078|  32.4k|  const int16_t *tmp;
 1079|       |
 1080|  32.4k|  if (flipud) {
  ------------------
  |  Branch (1080:7): [True: 0, False: 32.4k]
  ------------------
 1081|       |    // Swap left columns
 1082|      0|    tmp = topL;
 1083|      0|    topL = botL;
 1084|      0|    botL = tmp;
 1085|       |    // Swap right columns
 1086|      0|    tmp = topR;
 1087|      0|    topR = botR;
 1088|      0|    botR = tmp;
 1089|      0|  }
 1090|       |
 1091|  32.4k|  if (fliplr) {
  ------------------
  |  Branch (1091:7): [True: 0, False: 32.4k]
  ------------------
 1092|       |    // Swap top rows
 1093|      0|    tmp = topL;
 1094|      0|    topL = topR;
 1095|      0|    topR = tmp;
 1096|       |    // Swap bottom rows
 1097|      0|    tmp = botL;
 1098|      0|    botL = botR;
 1099|      0|    botR = tmp;
 1100|      0|  }
 1101|       |
 1102|       |  // load first 8 columns
 1103|  32.4k|  load_buffer_8x8(topL, &in[0], stride, flipud, fliplr, shift);
 1104|  32.4k|  load_buffer_8x8(botL, &in[32], stride, flipud, fliplr, shift);
 1105|       |
 1106|       |  // load second 8 columns
 1107|  32.4k|  load_buffer_8x8(topR, &in[16], stride, flipud, fliplr, shift);
 1108|  32.4k|  load_buffer_8x8(botR, &in[48], stride, flipud, fliplr, shift);
 1109|       |
 1110|  32.4k|  convert_8x8_to_16x16(in, out);
 1111|  32.4k|}
highbd_fwd_txfm_sse4.c:convert_8x8_to_16x16:
 1039|  32.4k|static inline void convert_8x8_to_16x16(const __m128i *in, __m128i *out) {
 1040|  32.4k|  int row_index = 0;
 1041|  32.4k|  int dst_index = 0;
 1042|  32.4k|  int src_index = 0;
 1043|       |
 1044|       |  // row 0, 1, .., 7
 1045|   259k|  do {
 1046|   259k|    out[dst_index] = in[src_index];
 1047|   259k|    out[dst_index + 1] = in[src_index + 1];
 1048|   259k|    out[dst_index + 2] = in[src_index + 16];
 1049|   259k|    out[dst_index + 3] = in[src_index + 17];
 1050|   259k|    dst_index += 4;
 1051|   259k|    src_index += 2;
 1052|   259k|    row_index += 1;
 1053|   259k|  } while (row_index < 8);
  ------------------
  |  Branch (1053:12): [True: 226k, False: 32.4k]
  ------------------
 1054|       |
 1055|       |  // row 8, 9, ..., 15
 1056|  32.4k|  src_index += 16;
 1057|   259k|  do {
 1058|   259k|    out[dst_index] = in[src_index];
 1059|   259k|    out[dst_index + 1] = in[src_index + 1];
 1060|   259k|    out[dst_index + 2] = in[src_index + 16];
 1061|   259k|    out[dst_index + 3] = in[src_index + 17];
 1062|   259k|    dst_index += 4;
 1063|   259k|    src_index += 2;
 1064|   259k|    row_index += 1;
 1065|   259k|  } while (row_index < 16);
  ------------------
  |  Branch (1065:12): [True: 226k, False: 32.4k]
  ------------------
 1066|  32.4k|}
highbd_fwd_txfm_sse4.c:fdct16x16_sse4_1:
 1218|  38.5k|                             const int col_num) {
 1219|  38.5k|  const int32_t *cospi = cospi_arr(bit);
 1220|  38.5k|  const __m128i cospi32 = _mm_set1_epi32(cospi[32]);
 1221|  38.5k|  const __m128i cospim32 = _mm_set1_epi32(-cospi[32]);
 1222|  38.5k|  const __m128i cospi48 = _mm_set1_epi32(cospi[48]);
 1223|  38.5k|  const __m128i cospi16 = _mm_set1_epi32(cospi[16]);
 1224|  38.5k|  const __m128i cospim48 = _mm_set1_epi32(-cospi[48]);
 1225|  38.5k|  const __m128i cospim16 = _mm_set1_epi32(-cospi[16]);
 1226|  38.5k|  const __m128i cospi56 = _mm_set1_epi32(cospi[56]);
 1227|  38.5k|  const __m128i cospi8 = _mm_set1_epi32(cospi[8]);
 1228|  38.5k|  const __m128i cospi24 = _mm_set1_epi32(cospi[24]);
 1229|  38.5k|  const __m128i cospi40 = _mm_set1_epi32(cospi[40]);
 1230|  38.5k|  const __m128i cospi60 = _mm_set1_epi32(cospi[60]);
 1231|  38.5k|  const __m128i cospi4 = _mm_set1_epi32(cospi[4]);
 1232|  38.5k|  const __m128i cospi28 = _mm_set1_epi32(cospi[28]);
 1233|  38.5k|  const __m128i cospi36 = _mm_set1_epi32(cospi[36]);
 1234|  38.5k|  const __m128i cospi44 = _mm_set1_epi32(cospi[44]);
 1235|  38.5k|  const __m128i cospi20 = _mm_set1_epi32(cospi[20]);
 1236|  38.5k|  const __m128i cospi12 = _mm_set1_epi32(cospi[12]);
 1237|  38.5k|  const __m128i cospi52 = _mm_set1_epi32(cospi[52]);
 1238|  38.5k|  const __m128i rnding = _mm_set1_epi32(1 << (bit - 1));
 1239|  38.5k|  __m128i u[16], v[16], x;
 1240|  38.5k|  int col;
 1241|       |
 1242|       |  // Calculate the column 0, 1, 2, 3
 1243|   347k|  for (col = 0; col < col_num; ++col) {
  ------------------
  |  Branch (1243:17): [True: 308k, False: 38.5k]
  ------------------
 1244|       |    // stage 0
 1245|       |    // stage 1
 1246|   308k|    u[0] = _mm_add_epi32(in[0 * col_num + col], in[15 * col_num + col]);
 1247|   308k|    u[15] = _mm_sub_epi32(in[0 * col_num + col], in[15 * col_num + col]);
 1248|   308k|    u[1] = _mm_add_epi32(in[1 * col_num + col], in[14 * col_num + col]);
 1249|   308k|    u[14] = _mm_sub_epi32(in[1 * col_num + col], in[14 * col_num + col]);
 1250|   308k|    u[2] = _mm_add_epi32(in[2 * col_num + col], in[13 * col_num + col]);
 1251|   308k|    u[13] = _mm_sub_epi32(in[2 * col_num + col], in[13 * col_num + col]);
 1252|   308k|    u[3] = _mm_add_epi32(in[3 * col_num + col], in[12 * col_num + col]);
 1253|   308k|    u[12] = _mm_sub_epi32(in[3 * col_num + col], in[12 * col_num + col]);
 1254|   308k|    u[4] = _mm_add_epi32(in[4 * col_num + col], in[11 * col_num + col]);
 1255|   308k|    u[11] = _mm_sub_epi32(in[4 * col_num + col], in[11 * col_num + col]);
 1256|   308k|    u[5] = _mm_add_epi32(in[5 * col_num + col], in[10 * col_num + col]);
 1257|   308k|    u[10] = _mm_sub_epi32(in[5 * col_num + col], in[10 * col_num + col]);
 1258|   308k|    u[6] = _mm_add_epi32(in[6 * col_num + col], in[9 * col_num + col]);
 1259|   308k|    u[9] = _mm_sub_epi32(in[6 * col_num + col], in[9 * col_num + col]);
 1260|   308k|    u[7] = _mm_add_epi32(in[7 * col_num + col], in[8 * col_num + col]);
 1261|   308k|    u[8] = _mm_sub_epi32(in[7 * col_num + col], in[8 * col_num + col]);
 1262|       |
 1263|       |    // stage 2
 1264|   308k|    v[0] = _mm_add_epi32(u[0], u[7]);
 1265|   308k|    v[7] = _mm_sub_epi32(u[0], u[7]);
 1266|   308k|    v[1] = _mm_add_epi32(u[1], u[6]);
 1267|   308k|    v[6] = _mm_sub_epi32(u[1], u[6]);
 1268|   308k|    v[2] = _mm_add_epi32(u[2], u[5]);
 1269|   308k|    v[5] = _mm_sub_epi32(u[2], u[5]);
 1270|   308k|    v[3] = _mm_add_epi32(u[3], u[4]);
 1271|   308k|    v[4] = _mm_sub_epi32(u[3], u[4]);
 1272|   308k|    v[8] = u[8];
 1273|   308k|    v[9] = u[9];
 1274|       |
 1275|   308k|    v[10] = _mm_mullo_epi32(u[10], cospim32);
 1276|   308k|    x = _mm_mullo_epi32(u[13], cospi32);
 1277|   308k|    v[10] = _mm_add_epi32(v[10], x);
 1278|   308k|    v[10] = _mm_add_epi32(v[10], rnding);
 1279|   308k|    v[10] = _mm_srai_epi32(v[10], bit);
 1280|       |
 1281|   308k|    v[13] = _mm_mullo_epi32(u[10], cospi32);
 1282|   308k|    x = _mm_mullo_epi32(u[13], cospim32);
 1283|   308k|    v[13] = _mm_sub_epi32(v[13], x);
 1284|   308k|    v[13] = _mm_add_epi32(v[13], rnding);
 1285|   308k|    v[13] = _mm_srai_epi32(v[13], bit);
 1286|       |
 1287|   308k|    v[11] = _mm_mullo_epi32(u[11], cospim32);
 1288|   308k|    x = _mm_mullo_epi32(u[12], cospi32);
 1289|   308k|    v[11] = _mm_add_epi32(v[11], x);
 1290|   308k|    v[11] = _mm_add_epi32(v[11], rnding);
 1291|   308k|    v[11] = _mm_srai_epi32(v[11], bit);
 1292|       |
 1293|   308k|    v[12] = _mm_mullo_epi32(u[11], cospi32);
 1294|   308k|    x = _mm_mullo_epi32(u[12], cospim32);
 1295|   308k|    v[12] = _mm_sub_epi32(v[12], x);
 1296|   308k|    v[12] = _mm_add_epi32(v[12], rnding);
 1297|   308k|    v[12] = _mm_srai_epi32(v[12], bit);
 1298|   308k|    v[14] = u[14];
 1299|   308k|    v[15] = u[15];
 1300|       |
 1301|       |    // stage 3
 1302|   308k|    u[0] = _mm_add_epi32(v[0], v[3]);
 1303|   308k|    u[3] = _mm_sub_epi32(v[0], v[3]);
 1304|   308k|    u[1] = _mm_add_epi32(v[1], v[2]);
 1305|   308k|    u[2] = _mm_sub_epi32(v[1], v[2]);
 1306|   308k|    u[4] = v[4];
 1307|       |
 1308|   308k|    u[5] = _mm_mullo_epi32(v[5], cospim32);
 1309|   308k|    x = _mm_mullo_epi32(v[6], cospi32);
 1310|   308k|    u[5] = _mm_add_epi32(u[5], x);
 1311|   308k|    u[5] = _mm_add_epi32(u[5], rnding);
 1312|   308k|    u[5] = _mm_srai_epi32(u[5], bit);
 1313|       |
 1314|   308k|    u[6] = _mm_mullo_epi32(v[5], cospi32);
 1315|   308k|    x = _mm_mullo_epi32(v[6], cospim32);
 1316|   308k|    u[6] = _mm_sub_epi32(u[6], x);
 1317|   308k|    u[6] = _mm_add_epi32(u[6], rnding);
 1318|   308k|    u[6] = _mm_srai_epi32(u[6], bit);
 1319|       |
 1320|   308k|    u[7] = v[7];
 1321|   308k|    u[8] = _mm_add_epi32(v[8], v[11]);
 1322|   308k|    u[11] = _mm_sub_epi32(v[8], v[11]);
 1323|   308k|    u[9] = _mm_add_epi32(v[9], v[10]);
 1324|   308k|    u[10] = _mm_sub_epi32(v[9], v[10]);
 1325|   308k|    u[12] = _mm_sub_epi32(v[15], v[12]);
 1326|   308k|    u[15] = _mm_add_epi32(v[15], v[12]);
 1327|   308k|    u[13] = _mm_sub_epi32(v[14], v[13]);
 1328|   308k|    u[14] = _mm_add_epi32(v[14], v[13]);
 1329|       |
 1330|       |    // stage 4
 1331|   308k|    u[0] = _mm_mullo_epi32(u[0], cospi32);
 1332|   308k|    u[1] = _mm_mullo_epi32(u[1], cospi32);
 1333|   308k|    v[0] = _mm_add_epi32(u[0], u[1]);
 1334|   308k|    v[0] = _mm_add_epi32(v[0], rnding);
 1335|   308k|    v[0] = _mm_srai_epi32(v[0], bit);
 1336|       |
 1337|   308k|    v[1] = _mm_sub_epi32(u[0], u[1]);
 1338|   308k|    v[1] = _mm_add_epi32(v[1], rnding);
 1339|   308k|    v[1] = _mm_srai_epi32(v[1], bit);
 1340|       |
 1341|   308k|    v[2] = _mm_mullo_epi32(u[2], cospi48);
 1342|   308k|    x = _mm_mullo_epi32(u[3], cospi16);
 1343|   308k|    v[2] = _mm_add_epi32(v[2], x);
 1344|   308k|    v[2] = _mm_add_epi32(v[2], rnding);
 1345|   308k|    v[2] = _mm_srai_epi32(v[2], bit);
 1346|       |
 1347|   308k|    v[3] = _mm_mullo_epi32(u[2], cospi16);
 1348|   308k|    x = _mm_mullo_epi32(u[3], cospi48);
 1349|   308k|    v[3] = _mm_sub_epi32(x, v[3]);
 1350|   308k|    v[3] = _mm_add_epi32(v[3], rnding);
 1351|   308k|    v[3] = _mm_srai_epi32(v[3], bit);
 1352|       |
 1353|   308k|    v[4] = _mm_add_epi32(u[4], u[5]);
 1354|   308k|    v[5] = _mm_sub_epi32(u[4], u[5]);
 1355|   308k|    v[6] = _mm_sub_epi32(u[7], u[6]);
 1356|   308k|    v[7] = _mm_add_epi32(u[7], u[6]);
 1357|   308k|    v[8] = u[8];
 1358|       |
 1359|   308k|    v[9] = _mm_mullo_epi32(u[9], cospim16);
 1360|   308k|    x = _mm_mullo_epi32(u[14], cospi48);
 1361|   308k|    v[9] = _mm_add_epi32(v[9], x);
 1362|   308k|    v[9] = _mm_add_epi32(v[9], rnding);
 1363|   308k|    v[9] = _mm_srai_epi32(v[9], bit);
 1364|       |
 1365|   308k|    v[14] = _mm_mullo_epi32(u[9], cospi48);
 1366|   308k|    x = _mm_mullo_epi32(u[14], cospim16);
 1367|   308k|    v[14] = _mm_sub_epi32(v[14], x);
 1368|   308k|    v[14] = _mm_add_epi32(v[14], rnding);
 1369|   308k|    v[14] = _mm_srai_epi32(v[14], bit);
 1370|       |
 1371|   308k|    v[10] = _mm_mullo_epi32(u[10], cospim48);
 1372|   308k|    x = _mm_mullo_epi32(u[13], cospim16);
 1373|   308k|    v[10] = _mm_add_epi32(v[10], x);
 1374|   308k|    v[10] = _mm_add_epi32(v[10], rnding);
 1375|   308k|    v[10] = _mm_srai_epi32(v[10], bit);
 1376|       |
 1377|   308k|    v[13] = _mm_mullo_epi32(u[10], cospim16);
 1378|   308k|    x = _mm_mullo_epi32(u[13], cospim48);
 1379|   308k|    v[13] = _mm_sub_epi32(v[13], x);
 1380|   308k|    v[13] = _mm_add_epi32(v[13], rnding);
 1381|   308k|    v[13] = _mm_srai_epi32(v[13], bit);
 1382|       |
 1383|   308k|    v[11] = u[11];
 1384|   308k|    v[12] = u[12];
 1385|   308k|    v[15] = u[15];
 1386|       |
 1387|       |    // stage 5
 1388|   308k|    u[0] = v[0];
 1389|   308k|    u[1] = v[1];
 1390|   308k|    u[2] = v[2];
 1391|   308k|    u[3] = v[3];
 1392|       |
 1393|   308k|    u[4] = _mm_mullo_epi32(v[4], cospi56);
 1394|   308k|    x = _mm_mullo_epi32(v[7], cospi8);
 1395|   308k|    u[4] = _mm_add_epi32(u[4], x);
 1396|   308k|    u[4] = _mm_add_epi32(u[4], rnding);
 1397|   308k|    u[4] = _mm_srai_epi32(u[4], bit);
 1398|       |
 1399|   308k|    u[7] = _mm_mullo_epi32(v[4], cospi8);
 1400|   308k|    x = _mm_mullo_epi32(v[7], cospi56);
 1401|   308k|    u[7] = _mm_sub_epi32(x, u[7]);
 1402|   308k|    u[7] = _mm_add_epi32(u[7], rnding);
 1403|   308k|    u[7] = _mm_srai_epi32(u[7], bit);
 1404|       |
 1405|   308k|    u[5] = _mm_mullo_epi32(v[5], cospi24);
 1406|   308k|    x = _mm_mullo_epi32(v[6], cospi40);
 1407|   308k|    u[5] = _mm_add_epi32(u[5], x);
 1408|   308k|    u[5] = _mm_add_epi32(u[5], rnding);
 1409|   308k|    u[5] = _mm_srai_epi32(u[5], bit);
 1410|       |
 1411|   308k|    u[6] = _mm_mullo_epi32(v[5], cospi40);
 1412|   308k|    x = _mm_mullo_epi32(v[6], cospi24);
 1413|   308k|    u[6] = _mm_sub_epi32(x, u[6]);
 1414|   308k|    u[6] = _mm_add_epi32(u[6], rnding);
 1415|   308k|    u[6] = _mm_srai_epi32(u[6], bit);
 1416|       |
 1417|   308k|    u[8] = _mm_add_epi32(v[8], v[9]);
 1418|   308k|    u[9] = _mm_sub_epi32(v[8], v[9]);
 1419|   308k|    u[10] = _mm_sub_epi32(v[11], v[10]);
 1420|   308k|    u[11] = _mm_add_epi32(v[11], v[10]);
 1421|   308k|    u[12] = _mm_add_epi32(v[12], v[13]);
 1422|   308k|    u[13] = _mm_sub_epi32(v[12], v[13]);
 1423|   308k|    u[14] = _mm_sub_epi32(v[15], v[14]);
 1424|   308k|    u[15] = _mm_add_epi32(v[15], v[14]);
 1425|       |
 1426|       |    // stage 6
 1427|   308k|    v[0] = u[0];
 1428|   308k|    v[1] = u[1];
 1429|   308k|    v[2] = u[2];
 1430|   308k|    v[3] = u[3];
 1431|   308k|    v[4] = u[4];
 1432|   308k|    v[5] = u[5];
 1433|   308k|    v[6] = u[6];
 1434|   308k|    v[7] = u[7];
 1435|       |
 1436|   308k|    v[8] = _mm_mullo_epi32(u[8], cospi60);
 1437|   308k|    x = _mm_mullo_epi32(u[15], cospi4);
 1438|   308k|    v[8] = _mm_add_epi32(v[8], x);
 1439|   308k|    v[8] = _mm_add_epi32(v[8], rnding);
 1440|   308k|    v[8] = _mm_srai_epi32(v[8], bit);
 1441|       |
 1442|   308k|    v[15] = _mm_mullo_epi32(u[8], cospi4);
 1443|   308k|    x = _mm_mullo_epi32(u[15], cospi60);
 1444|   308k|    v[15] = _mm_sub_epi32(x, v[15]);
 1445|   308k|    v[15] = _mm_add_epi32(v[15], rnding);
 1446|   308k|    v[15] = _mm_srai_epi32(v[15], bit);
 1447|       |
 1448|   308k|    v[9] = _mm_mullo_epi32(u[9], cospi28);
 1449|   308k|    x = _mm_mullo_epi32(u[14], cospi36);
 1450|   308k|    v[9] = _mm_add_epi32(v[9], x);
 1451|   308k|    v[9] = _mm_add_epi32(v[9], rnding);
 1452|   308k|    v[9] = _mm_srai_epi32(v[9], bit);
 1453|       |
 1454|   308k|    v[14] = _mm_mullo_epi32(u[9], cospi36);
 1455|   308k|    x = _mm_mullo_epi32(u[14], cospi28);
 1456|   308k|    v[14] = _mm_sub_epi32(x, v[14]);
 1457|   308k|    v[14] = _mm_add_epi32(v[14], rnding);
 1458|   308k|    v[14] = _mm_srai_epi32(v[14], bit);
 1459|       |
 1460|   308k|    v[10] = _mm_mullo_epi32(u[10], cospi44);
 1461|   308k|    x = _mm_mullo_epi32(u[13], cospi20);
 1462|   308k|    v[10] = _mm_add_epi32(v[10], x);
 1463|   308k|    v[10] = _mm_add_epi32(v[10], rnding);
 1464|   308k|    v[10] = _mm_srai_epi32(v[10], bit);
 1465|       |
 1466|   308k|    v[13] = _mm_mullo_epi32(u[10], cospi20);
 1467|   308k|    x = _mm_mullo_epi32(u[13], cospi44);
 1468|   308k|    v[13] = _mm_sub_epi32(x, v[13]);
 1469|   308k|    v[13] = _mm_add_epi32(v[13], rnding);
 1470|   308k|    v[13] = _mm_srai_epi32(v[13], bit);
 1471|       |
 1472|   308k|    v[11] = _mm_mullo_epi32(u[11], cospi12);
 1473|   308k|    x = _mm_mullo_epi32(u[12], cospi52);
 1474|   308k|    v[11] = _mm_add_epi32(v[11], x);
 1475|   308k|    v[11] = _mm_add_epi32(v[11], rnding);
 1476|   308k|    v[11] = _mm_srai_epi32(v[11], bit);
 1477|       |
 1478|   308k|    v[12] = _mm_mullo_epi32(u[11], cospi52);
 1479|   308k|    x = _mm_mullo_epi32(u[12], cospi12);
 1480|   308k|    v[12] = _mm_sub_epi32(x, v[12]);
 1481|   308k|    v[12] = _mm_add_epi32(v[12], rnding);
 1482|   308k|    v[12] = _mm_srai_epi32(v[12], bit);
 1483|       |
 1484|   308k|    out[0 * col_num + col] = v[0];
 1485|   308k|    out[1 * col_num + col] = v[8];
 1486|   308k|    out[2 * col_num + col] = v[4];
 1487|   308k|    out[3 * col_num + col] = v[12];
 1488|   308k|    out[4 * col_num + col] = v[2];
 1489|   308k|    out[5 * col_num + col] = v[10];
 1490|   308k|    out[6 * col_num + col] = v[6];
 1491|   308k|    out[7 * col_num + col] = v[14];
 1492|   308k|    out[8 * col_num + col] = v[1];
 1493|   308k|    out[9 * col_num + col] = v[9];
 1494|   308k|    out[10 * col_num + col] = v[5];
 1495|   308k|    out[11 * col_num + col] = v[13];
 1496|   308k|    out[12 * col_num + col] = v[3];
 1497|   308k|    out[13 * col_num + col] = v[11];
 1498|   308k|    out[14 * col_num + col] = v[7];
 1499|   308k|    out[15 * col_num + col] = v[15];
 1500|   308k|  }
 1501|  38.5k|}
highbd_fwd_txfm_sse4.c:col_txfm_16x16_rounding:
 1750|   102k|static void col_txfm_16x16_rounding(__m128i *in, int shift) {
 1751|       |  // Note:
 1752|       |  //  We split 16x16 rounding into 4 sections of 8x8 rounding,
 1753|       |  //  instead of 4 columns
 1754|   102k|  col_txfm_8x8_rounding(&in[0], shift);
 1755|   102k|  col_txfm_8x8_rounding(&in[16], shift);
 1756|   102k|  col_txfm_8x8_rounding(&in[32], shift);
 1757|   102k|  col_txfm_8x8_rounding(&in[48], shift);
 1758|   102k|}
highbd_fwd_txfm_sse4.c:idtx16x16_sse4_1:
 1775|    198|static void idtx16x16_sse4_1(__m128i *in, __m128i *out, int bit, int col_num) {
 1776|    198|  (void)bit;
 1777|    198|  __m128i fact = _mm_set1_epi32(2 * NewSqrt2);
 1778|    198|  __m128i offset = _mm_set1_epi32(1 << (NewSqrt2Bits - 1));
  ------------------
  |  |   42|    198|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1779|    198|  __m128i a_low;
 1780|       |
 1781|    198|  int num_iters = 16 * col_num;
 1782|  25.5k|  for (int i = 0; i < num_iters; i++) {
  ------------------
  |  Branch (1782:19): [True: 25.3k, False: 198]
  ------------------
 1783|  25.3k|    a_low = _mm_mullo_epi32(in[i], fact);
 1784|  25.3k|    a_low = _mm_add_epi32(a_low, offset);
 1785|  25.3k|    out[i] = _mm_srai_epi32(a_low, NewSqrt2Bits);
  ------------------
  |  |   42|  25.3k|#define NewSqrt2Bits ((int32_t)12)
  ------------------
 1786|  25.3k|  }
 1787|    198|}
highbd_fwd_txfm_sse4.c:store_output_w4:
   26|  7.64M|                                   const int stride, const int out_size) {
   27|  38.2M|  for (int i = 0; i < out_size; ++i) {
  ------------------
  |  Branch (27:19): [True: 30.5M, False: 7.64M]
  ------------------
   28|  30.5M|    _mm_store_si128((__m128i *)(out + i * stride), in[i]);
   29|  30.5M|  }
   30|  7.64M|}
highbd_fwd_txfm_sse4.c:load_buffer_32x8n:
 1206|  24.0k|                                     int shift, const int height) {
 1207|  24.0k|  const int16_t *in = input;
 1208|  24.0k|  __m128i *output = out;
 1209|   479k|  for (int col = 0; col < height; col++) {
  ------------------
  |  Branch (1209:21): [True: 455k, False: 24.0k]
  ------------------
 1210|   455k|    in = input + col * stride;
 1211|   455k|    output = out + col * 8;
 1212|   455k|    load_buffer_4x4(in, output, 4, flipud, fliplr, shift);
 1213|   455k|    load_buffer_4x4((in + 16), (output + 4), 4, flipud, fliplr, shift);
 1214|   455k|  }
 1215|  24.0k|}
highbd_fwd_txfm_sse4.c:load_buffer_4x8:
 1169|  3.82M|                                   int shift) {
 1170|  3.82M|  const int16_t *topL = input;
 1171|  3.82M|  const int16_t *botL = input + 4 * stride;
 1172|       |
 1173|  3.82M|  const int16_t *tmp;
 1174|       |
 1175|  3.82M|  if (flipud) {
  ------------------
  |  Branch (1175:7): [True: 12.7k, False: 3.80M]
  ------------------
 1176|  12.7k|    tmp = topL;
 1177|  12.7k|    topL = botL;
 1178|  12.7k|    botL = tmp;
 1179|  12.7k|  }
 1180|       |
 1181|  3.82M|  load_buffer_4x4(topL, out, stride, flipud, fliplr, shift);
 1182|  3.82M|  load_buffer_4x4(botL, out + 4, stride, flipud, fliplr, shift);
 1183|  3.82M|}
highbd_fwd_txfm_sse4.c:col_txfm_4x8_rounding:
  498|  6.78M|static inline void col_txfm_4x8_rounding(__m128i *in, int shift) {
  499|  6.78M|  const __m128i rounding = _mm_set1_epi32(1 << (shift - 1));
  500|       |
  501|  6.78M|  in[0] = _mm_add_epi32(in[0], rounding);
  502|  6.78M|  in[1] = _mm_add_epi32(in[1], rounding);
  503|  6.78M|  in[2] = _mm_add_epi32(in[2], rounding);
  504|  6.78M|  in[3] = _mm_add_epi32(in[3], rounding);
  505|  6.78M|  in[4] = _mm_add_epi32(in[4], rounding);
  506|  6.78M|  in[5] = _mm_add_epi32(in[5], rounding);
  507|  6.78M|  in[6] = _mm_add_epi32(in[6], rounding);
  508|  6.78M|  in[7] = _mm_add_epi32(in[7], rounding);
  509|       |
  510|  6.78M|  in[0] = _mm_srai_epi32(in[0], shift);
  511|  6.78M|  in[1] = _mm_srai_epi32(in[1], shift);
  512|  6.78M|  in[2] = _mm_srai_epi32(in[2], shift);
  513|  6.78M|  in[3] = _mm_srai_epi32(in[3], shift);
  514|  6.78M|  in[4] = _mm_srai_epi32(in[4], shift);
  515|  6.78M|  in[5] = _mm_srai_epi32(in[5], shift);
  516|  6.78M|  in[6] = _mm_srai_epi32(in[6], shift);
  517|  6.78M|  in[7] = _mm_srai_epi32(in[7], shift);
  518|  6.78M|}
highbd_fwd_txfm_sse4.c:load_buffer_8x4:
 1133|  2.96M|                                   int shift) {
 1134|  2.96M|  const int16_t *topL = input;
 1135|  2.96M|  const int16_t *topR = input + 4;
 1136|       |
 1137|  2.96M|  const int16_t *tmp;
 1138|       |
 1139|  2.96M|  if (fliplr) {
  ------------------
  |  Branch (1139:7): [True: 20.2k, False: 2.94M]
  ------------------
 1140|  20.2k|    tmp = topL;
 1141|  20.2k|    topL = topR;
 1142|  20.2k|    topR = tmp;
 1143|  20.2k|  }
 1144|       |
 1145|  2.96M|  load_buffer_4x4(topL, out, stride, flipud, fliplr, shift);
 1146|  2.96M|  load_buffer_4x4(topR, out + 4, stride, flipud, fliplr, shift);
 1147|  2.96M|}

av1_nn_predict_avx2:
  142|  5.60M|                         float *const output) {
  143|  5.60M|  float buf[2][NN_MAX_NODES_PER_LAYER];
  144|  5.60M|  int buf_index = 0;
  145|  5.60M|  int num_inputs = nn_config->num_inputs;
  146|  5.60M|  assert(num_inputs > 0 && num_inputs <= NN_MAX_NODES_PER_LAYER);
  147|       |
  148|  14.3M|  for (int layer = 0; layer <= nn_config->num_hidden_layers; layer++) {
  ------------------
  |  Branch (148:23): [True: 8.70M, False: 5.60M]
  ------------------
  149|  8.70M|    const float *layer_weights = nn_config->weights[layer];
  150|  8.70M|    const float *layer_bias = nn_config->bias[layer];
  151|  8.70M|    bool is_output_layer = layer == nn_config->num_hidden_layers;
  152|  8.70M|    float *const output_nodes = is_output_layer ? output : &buf[buf_index][0];
  ------------------
  |  Branch (152:33): [True: 5.61M, False: 3.09M]
  ------------------
  153|  8.70M|    const int num_outputs = is_output_layer
  ------------------
  |  Branch (153:29): [True: 5.61M, False: 3.09M]
  ------------------
  154|  8.70M|                                ? nn_config->num_outputs
  155|  8.70M|                                : nn_config->num_hidden_nodes[layer];
  156|  8.70M|    assert(num_outputs > 0 && num_outputs <= NN_MAX_NODES_PER_LAYER);
  157|       |
  158|       |    // Process input multiple of 8 using AVX2 intrinsic.
  159|  8.70M|    if (num_inputs % 8 == 0) {
  ------------------
  |  Branch (159:9): [True: 6.74M, False: 1.96M]
  ------------------
  160|  6.74M|      nn_propagate_input_multiple_of_8(input_nodes, layer_weights, layer_bias,
  161|  6.74M|                                       num_inputs, num_inputs, is_output_layer,
  162|  6.74M|                                       num_outputs, output_nodes);
  163|  6.74M|    } else {
  164|       |      // When number of inputs is not multiple of 8, use hybrid approach of AVX2
  165|       |      // and SSE3 based on the need.
  166|  1.96M|      const int in_mul_8 = num_inputs / 8;
  167|  1.96M|      const int num_inputs_to_process = in_mul_8 * 8;
  168|  1.96M|      int bias_is_considered = 0;
  169|  1.96M|      if (in_mul_8) {
  ------------------
  |  Branch (169:11): [True: 1.52M, False: 433k]
  ------------------
  170|  1.52M|        nn_propagate_input_multiple_of_8(
  171|  1.52M|            input_nodes, layer_weights, layer_bias, num_inputs_to_process,
  172|  1.52M|            num_inputs, is_output_layer, num_outputs, output_nodes);
  173|  1.52M|        bias_is_considered = 1;
  174|  1.52M|      }
  175|       |
  176|  1.96M|      const float *out_temp = bias_is_considered ? output_nodes : layer_bias;
  ------------------
  |  Branch (176:31): [True: 1.52M, False: 433k]
  ------------------
  177|  1.96M|      const int input_remaining = num_inputs % 8;
  178|  1.96M|      if (input_remaining % 4 == 0 && num_outputs % 8 == 0) {
  ------------------
  |  Branch (178:11): [True: 1.17M, False: 784k]
  |  Branch (178:39): [True: 446k, False: 730k]
  ------------------
  179|   925k|        for (int out = 0; out < num_outputs; out += 8) {
  ------------------
  |  Branch (179:27): [True: 478k, False: 446k]
  ------------------
  180|   478k|          __m128 out_h = _mm_loadu_ps(&out_temp[out + 4]);
  181|   478k|          __m128 out_l = _mm_loadu_ps(&out_temp[out]);
  182|   957k|          for (int in = in_mul_8 * 8; in < num_inputs; in += 4) {
  ------------------
  |  Branch (182:39): [True: 478k, False: 478k]
  ------------------
  183|   478k|            av1_nn_propagate_4to8_sse3(&input_nodes[in],
  184|   478k|                                       &layer_weights[out * num_inputs + in],
  185|   478k|                                       &out_h, &out_l, num_inputs);
  186|   478k|          }
  187|   478k|          if (!is_output_layer) {
  ------------------
  |  Branch (187:15): [True: 478k, False: 2]
  ------------------
  188|   478k|            const __m128 zero = _mm_setzero_ps();
  189|   478k|            out_h = _mm_max_ps(out_h, zero);
  190|   478k|            out_l = _mm_max_ps(out_l, zero);
  191|   478k|          }
  192|   478k|          _mm_storeu_ps(&output_nodes[out + 4], out_h);
  193|   478k|          _mm_storeu_ps(&output_nodes[out], out_l);
  194|   478k|        }
  195|  1.51M|      } else if (input_remaining % 4 == 0 && num_outputs % 4 == 0) {
  ------------------
  |  Branch (195:18): [True: 730k, False: 784k]
  |  Branch (195:46): [True: 104k, False: 625k]
  ------------------
  196|   419k|        for (int out = 0; out < num_outputs; out += 4) {
  ------------------
  |  Branch (196:27): [True: 314k, False: 104k]
  ------------------
  197|   314k|          __m128 outputs = _mm_loadu_ps(&out_temp[out]);
  198|   629k|          for (int in = in_mul_8 * 8; in < num_inputs; in += 4) {
  ------------------
  |  Branch (198:39): [True: 314k, False: 314k]
  ------------------
  199|   314k|            av1_nn_propagate_4to4_sse3(&input_nodes[in],
  200|   314k|                                       &layer_weights[out * num_inputs + in],
  201|   314k|                                       &outputs, num_inputs);
  202|   314k|          }
  203|   314k|          if (!is_output_layer) outputs = _mm_max_ps(outputs, _mm_setzero_ps());
  ------------------
  |  Branch (203:15): [True: 314k, False: 18.4E]
  ------------------
  204|   314k|          _mm_storeu_ps(&output_nodes[out], outputs);
  205|   314k|        }
  206|  1.41M|      } else if (input_remaining % 4 == 0) {
  ------------------
  |  Branch (206:18): [True: 625k, False: 784k]
  ------------------
  207|  1.75M|        for (int out = 0; out < num_outputs; out++) {
  ------------------
  |  Branch (207:27): [True: 1.13M, False: 625k]
  ------------------
  208|  1.13M|          __m128 outputs = _mm_load1_ps(&out_temp[out]);
  209|  2.26M|          for (int in = in_mul_8 * 8; in < num_inputs; in += 4) {
  ------------------
  |  Branch (209:39): [True: 1.13M, False: 1.13M]
  ------------------
  210|  1.13M|            av1_nn_propagate_4to1_sse3(&input_nodes[in],
  211|  1.13M|                                       &layer_weights[out * num_inputs + in],
  212|  1.13M|                                       &outputs);
  213|  1.13M|          }
  214|  1.13M|          if (!is_output_layer) outputs = _mm_max_ps(outputs, _mm_setzero_ps());
  ------------------
  |  Branch (214:15): [True: 0, False: 1.13M]
  ------------------
  215|  1.13M|          output_nodes[out] = _mm_cvtss_f32(outputs);
  216|  1.13M|        }
  217|   784k|      } else {
  218|       |        // Use SSE instructions for scalar operations to avoid the latency
  219|       |        // of swapping between SIMD and FPU modes.
  220|  19.0M|        for (int out = 0; out < num_outputs; out++) {
  ------------------
  |  Branch (220:27): [True: 18.3M, False: 784k]
  ------------------
  221|  18.3M|          __m128 outputs = _mm_load1_ps(&out_temp[out]);
  222|  36.6M|          for (int in_node = in_mul_8 * 8; in_node < num_inputs; in_node++) {
  ------------------
  |  Branch (222:44): [True: 18.3M, False: 18.3M]
  ------------------
  223|  18.3M|            __m128 input = _mm_load1_ps(&input_nodes[in_node]);
  224|  18.3M|            __m128 weight =
  225|  18.3M|                _mm_load1_ps(&layer_weights[num_inputs * out + in_node]);
  226|  18.3M|            outputs = _mm_add_ps(outputs, _mm_mul_ps(input, weight));
  227|  18.3M|          }
  228|  18.3M|          if (!is_output_layer) outputs = _mm_max_ps(outputs, _mm_setzero_ps());
  ------------------
  |  Branch (228:15): [True: 18.3M, False: 18.4E]
  ------------------
  229|  18.3M|          output_nodes[out] = _mm_cvtss_f32(outputs);
  230|  18.3M|        }
  231|   784k|      }
  232|  1.96M|    }
  233|       |    // Before processing the next layer, treat the output of current layer as
  234|       |    // input to next layer.
  235|  8.70M|    input_nodes = output_nodes;
  236|  8.70M|    num_inputs = num_outputs;
  237|  8.70M|    buf_index = 1 - buf_index;
  238|  8.70M|  }
  239|  5.61M|  if (reduce_prec) av1_nn_output_prec_reduce(output, nn_config->num_outputs);
  ------------------
  |  Branch (239:7): [True: 5.61M, False: 18.4E]
  ------------------
  240|  5.60M|}
ml_avx2.c:nn_propagate_input_multiple_of_8:
  120|  8.26M|    bool is_output_layer, int num_outputs, float *const output_nodes) {
  121|       |  // The saturation of output is considered for hidden layer which is not equal
  122|       |  // to final hidden layer.
  123|  8.26M|  const int is_clip_required =
  124|  8.26M|      !is_output_layer && num_inputs_to_process == tot_num_inputs;
  ------------------
  |  Branch (124:7): [True: 2.65M, False: 5.60M]
  |  Branch (124:27): [True: 1.75M, False: 902k]
  ------------------
  125|  8.26M|  if (num_outputs % 8 == 0) {
  ------------------
  |  Branch (125:7): [True: 4.61M, False: 3.65M]
  ------------------
  126|  4.61M|    nn_propagate_8to8(inputs, weights, bias, num_inputs_to_process,
  127|  4.61M|                      tot_num_inputs, num_outputs, output_nodes,
  128|  4.61M|                      is_clip_required);
  129|  4.61M|  } else if (num_outputs % 4 == 0) {
  ------------------
  |  Branch (129:14): [True: 2.75M, False: 902k]
  ------------------
  130|  2.75M|    nn_propagate_8to4(inputs, weights, bias, num_inputs_to_process,
  131|  2.75M|                      tot_num_inputs, num_outputs, output_nodes,
  132|  2.75M|                      is_clip_required);
  133|  2.75M|  } else {
  134|   902k|    nn_propagate_8to1(inputs, weights, bias, num_inputs_to_process,
  135|   902k|                      tot_num_inputs, num_outputs, output_nodes,
  136|   902k|                      is_clip_required);
  137|   902k|  }
  138|  8.26M|}
ml_avx2.c:nn_propagate_8to8:
   89|  4.61M|    int num_outputs, float *const output_nodes, int is_clip_required) {
   90|  4.61M|  __m256 hadd[4];
   91|  11.7M|  for (int out = 0; out < num_outputs; out += 8) {
  ------------------
  |  Branch (91:21): [True: 7.12M, False: 4.61M]
  ------------------
   92|  7.12M|    __m256 bias_reg = _mm256_loadu_ps(&bias[out]);
   93|  7.12M|    __m256 in_result = _mm256_setzero_ps();
   94|  23.6M|    for (int in = 0; in < num_inputs_to_process; in += 8) {
  ------------------
  |  Branch (94:22): [True: 16.5M, False: 7.12M]
  ------------------
   95|  16.5M|      const __m256 inputs256 = _mm256_loadu_ps(&inputs[in]);
   96|  16.5M|      const int weight_idx = in + (out * tot_num_inputs);
   97|       |      // Process two output rows at a time.
   98|  82.6M|      for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (98:23): [True: 66.1M, False: 16.5M]
  ------------------
   99|  66.1M|        CALC_OUTPUT_FOR_2ROWS
  ------------------
  |  |   21|  66.1M|  const int index = weight_idx + (2 * i * tot_num_inputs);                  \
  |  |   22|  66.1M|  const __m256 weight0 = _mm256_loadu_ps(&weights[index]);                  \
  |  |   23|  66.1M|  const __m256 weight1 = _mm256_loadu_ps(&weights[index + tot_num_inputs]); \
  |  |   24|  66.1M|  const __m256 mul0 = _mm256_mul_ps(inputs256, weight0);                    \
  |  |   25|  66.1M|  const __m256 mul1 = _mm256_mul_ps(inputs256, weight1);                    \
  |  |   26|  66.1M|  hadd[i] = _mm256_hadd_ps(mul0, mul1);
  ------------------
  100|  66.1M|      }
  101|  16.5M|      const __m256 hh0 = _mm256_hadd_ps(hadd[0], hadd[1]);
  102|  16.5M|      const __m256 hh1 = _mm256_hadd_ps(hadd[2], hadd[3]);
  103|       |
  104|  16.5M|      __m256 ht_0 = _mm256_permute2f128_ps(hh0, hh1, 0x20);
  105|  16.5M|      __m256 ht_1 = _mm256_permute2f128_ps(hh0, hh1, 0x31);
  106|       |
  107|  16.5M|      __m256 result = _mm256_add_ps(ht_0, ht_1);
  108|  16.5M|      in_result = _mm256_add_ps(in_result, result);
  109|  16.5M|    }
  110|  7.12M|    in_result = _mm256_add_ps(in_result, bias_reg);
  111|  7.12M|    if (is_clip_required)
  ------------------
  |  Branch (111:9): [True: 3.57M, False: 3.54M]
  ------------------
  112|  3.57M|      in_result = _mm256_max_ps(in_result, _mm256_setzero_ps());
  113|  7.12M|    _mm256_storeu_ps(&output_nodes[out], in_result);
  114|  7.12M|  }
  115|  4.61M|}
ml_avx2.c:nn_propagate_8to4:
   59|  2.75M|    int num_outputs, float *const output_nodes, int is_clip_required) {
   60|  2.75M|  __m256 hadd[2];
   61|  7.91M|  for (int out = 0; out < num_outputs; out += 4) {
  ------------------
  |  Branch (61:21): [True: 5.15M, False: 2.75M]
  ------------------
   62|  5.15M|    __m128 bias_reg = _mm_loadu_ps(&bias[out]);
   63|  5.15M|    __m128 in_result = _mm_setzero_ps();
   64|  15.1M|    for (int in = 0; in < num_inputs_to_process; in += 8) {
  ------------------
  |  Branch (64:22): [True: 9.95M, False: 5.15M]
  ------------------
   65|  9.95M|      const __m256 inputs256 = _mm256_loadu_ps(&inputs[in]);
   66|  9.95M|      const int weight_idx = in + (out * tot_num_inputs);
   67|       |      // Process two output row at a time.
   68|  29.8M|      for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (68:23): [True: 19.9M, False: 9.95M]
  ------------------
   69|  19.9M|        CALC_OUTPUT_FOR_2ROWS
  ------------------
  |  |   21|  19.9M|  const int index = weight_idx + (2 * i * tot_num_inputs);                  \
  |  |   22|  19.9M|  const __m256 weight0 = _mm256_loadu_ps(&weights[index]);                  \
  |  |   23|  19.9M|  const __m256 weight1 = _mm256_loadu_ps(&weights[index + tot_num_inputs]); \
  |  |   24|  19.9M|  const __m256 mul0 = _mm256_mul_ps(inputs256, weight0);                    \
  |  |   25|  19.9M|  const __m256 mul1 = _mm256_mul_ps(inputs256, weight1);                    \
  |  |   26|  19.9M|  hadd[i] = _mm256_hadd_ps(mul0, mul1);
  ------------------
   70|  19.9M|      }
   71|       |
   72|  9.95M|      const __m256 sum_par = _mm256_hadd_ps(hadd[0], hadd[1]);
   73|  9.95M|      const __m128 low_128 = _mm256_castps256_ps128(sum_par);
   74|  9.95M|      const __m128 high_128 = _mm256_extractf128_ps(sum_par, 1);
   75|  9.95M|      const __m128 result = _mm_add_ps(low_128, high_128);
   76|       |
   77|  9.95M|      in_result = _mm_add_ps(in_result, result);
   78|  9.95M|    }
   79|       |
   80|  5.15M|    in_result = _mm_add_ps(in_result, bias_reg);
   81|  5.15M|    if (is_clip_required) in_result = _mm_max_ps(in_result, _mm_setzero_ps());
  ------------------
  |  Branch (81:9): [True: 0, False: 5.15M]
  ------------------
   82|  5.15M|    _mm_storeu_ps(&output_nodes[out], in_result);
   83|  5.15M|  }
   84|  2.75M|}
ml_avx2.c:nn_propagate_8to1:
   31|   905k|    int num_outputs, float *const output_nodes, int is_clip_required) {
   32|       |  // Process one output row at a time.
   33|  3.59M|  for (int out = 0; out < num_outputs; out++) {
  ------------------
  |  Branch (33:21): [True: 2.69M, False: 905k]
  ------------------
   34|  2.69M|    __m256 in_result = _mm256_setzero_ps();
   35|  2.69M|    float bias_val = bias[out];
   36|  11.5M|    for (int in = 0; in < num_inputs_to_process; in += 8) {
  ------------------
  |  Branch (36:22): [True: 8.87M, False: 2.69M]
  ------------------
   37|  8.87M|      const __m256 inputs256 = _mm256_loadu_ps(&inputs[in]);
   38|  8.87M|      const int weight_idx = in + (out * tot_num_inputs);
   39|  8.87M|      const __m256 weight0 = _mm256_loadu_ps(&weights[weight_idx]);
   40|  8.87M|      const __m256 mul0 = _mm256_mul_ps(inputs256, weight0);
   41|  8.87M|      in_result = _mm256_add_ps(in_result, mul0);
   42|  8.87M|    }
   43|  2.69M|    const __m128 low_128 = _mm256_castps256_ps128(in_result);
   44|  2.69M|    const __m128 high_128 = _mm256_extractf128_ps(in_result, 1);
   45|  2.69M|    const __m128 sum_par_0 = _mm_add_ps(low_128, high_128);
   46|  2.69M|    const __m128 sum_par_1 = _mm_hadd_ps(sum_par_0, sum_par_0);
   47|  2.69M|    const __m128 sum_tot =
   48|  2.69M|        _mm_add_ps(_mm_shuffle_ps(sum_par_1, sum_par_1, 0x99), sum_par_1);
   49|       |
   50|  2.69M|    bias_val += _mm_cvtss_f32(sum_tot);
   51|  2.69M|    if (is_clip_required) bias_val = AOMMAX(bias_val, 0);
  ------------------
  |  |   35|      0|#define AOMMAX(x, y) (((x) > (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (35:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 2.69M]
  ------------------
   52|  2.69M|    output_nodes[out] = bias_val;
   53|  2.69M|  }
   54|   905k|}

av1_nn_propagate_4to1_sse3:
   46|  1.13M|                                __m128 *const output) {
   47|  1.13M|  const __m128 inputs128 = _mm_loadu_ps(inputs);
   48|       |
   49|  1.13M|  const __m128 weights128 = _mm_loadu_ps(weights);
   50|       |
   51|  1.13M|  const __m128 mul = _mm_mul_ps(inputs128, weights128);
   52|       |  // [3 2 1 0] (weight and input indices)
   53|       |
   54|  1.13M|  const __m128 hadd1 = _mm_hadd_ps(mul, mul);
   55|       |  // [3+2 1+0 3+2 1+0]
   56|  1.13M|  const __m128 hadd2 = _mm_hadd_ps(hadd1, hadd1);
   57|       |  // [3+2+1+0 3+2+1+0 3+2+1+0 3+2+1+0]
   58|  1.13M|  *output = _mm_add_ps(*output, hadd2);
   59|  1.13M|}
av1_nn_propagate_4to4_sse3:
   63|   314k|                                __m128 *const outputs, const int num_inputs) {
   64|   314k|  const __m128 inputs128 = _mm_loadu_ps(inputs);
   65|       |
   66|   314k|  __m128 hadd[2];
   67|   943k|  for (int i = 0; i < 2; i++) {  // For each pair of outputs
  ------------------
  |  Branch (67:19): [True: 629k, False: 314k]
  ------------------
   68|   629k|    const __m128 weight0 = _mm_loadu_ps(&weights[2 * i * num_inputs]);
   69|   629k|    const __m128 mul0 = _mm_mul_ps(weight0, inputs128);
   70|   629k|    const __m128 weight1 = _mm_loadu_ps(&weights[(2 * i + 1) * num_inputs]);
   71|   629k|    const __m128 mul1 = _mm_mul_ps(weight1, inputs128);
   72|   629k|    hadd[i] = _mm_hadd_ps(mul0, mul1);
   73|   629k|  }
   74|       |  // hadd[0] = [7+6 5+4 3+2 1+0] (weight indices)
   75|       |  // hadd[1] = [15+14 13+12 11+10 9+8]
   76|       |
   77|   314k|  const __m128 hh = _mm_hadd_ps(hadd[0], hadd[1]);
   78|       |  // [15+14+13+12 11+10+9+8 7+6+5+4 3+2+1+0]
   79|       |
   80|   314k|  *outputs = _mm_add_ps(*outputs, hh);
   81|   314k|}
av1_nn_propagate_4to8_sse3:
   85|   478k|                                __m128 *const out_l, const int num_inputs) {
   86|   478k|  const __m128 inputs128 = _mm_loadu_ps(inputs);
   87|       |
   88|   478k|  __m128 hadd[4];
   89|  2.39M|  for (int i = 0; i < 4; i++) {  // For each pair of outputs
  ------------------
  |  Branch (89:19): [True: 1.91M, False: 478k]
  ------------------
   90|  1.91M|    const __m128 weight0 = _mm_loadu_ps(&weights[2 * i * num_inputs]);
   91|  1.91M|    const __m128 weight1 = _mm_loadu_ps(&weights[(2 * i + 1) * num_inputs]);
   92|  1.91M|    const __m128 mul0 = _mm_mul_ps(inputs128, weight0);
   93|  1.91M|    const __m128 mul1 = _mm_mul_ps(inputs128, weight1);
   94|  1.91M|    hadd[i] = _mm_hadd_ps(mul0, mul1);
   95|  1.91M|  }
   96|       |  // hadd[0] = [7+6 5+4 3+2 1+0] (weight indices)
   97|       |  // hadd[1] = [15+14 13+12 11+10 9+8]
   98|       |  // hadd[2] = [23+22 21+20 19+18 17+16]
   99|       |  // hadd[3] = [31+30 29+28 27+26 25+24]
  100|       |
  101|   478k|  const __m128 hh0 = _mm_hadd_ps(hadd[0], hadd[1]);
  102|       |  // [15+14+13+12 11+10+9+8 7+6+5+4 3+2+1+0]
  103|   478k|  const __m128 hh1 = _mm_hadd_ps(hadd[2], hadd[3]);
  104|       |  // [31+30+29+28 27+26+25+24 23+22+21+20 19+18+17+16]
  105|       |
  106|   478k|  *out_h = _mm_add_ps(*out_h, hh1);
  107|   478k|  *out_l = _mm_add_ps(*out_l, hh0);
  108|   478k|}
av1_nn_fast_softmax_16_sse3:
  288|  1.06M|void av1_nn_fast_softmax_16_sse3(const float *input, float *output) {
  289|       |  // Clips at -10 to avoid underflowing
  290|  1.06M|  const __m128 clipper = _mm_set1_ps(-10.0f);
  291|       |
  292|       |  // Load in 16 values
  293|  1.06M|  __m128 in_0 = _mm_loadu_ps(&input[0]);
  294|  1.06M|  __m128 in_1 = _mm_loadu_ps(&input[4]);
  295|  1.06M|  __m128 in_2 = _mm_loadu_ps(&input[8]);
  296|  1.06M|  __m128 in_3 = _mm_loadu_ps(&input[12]);
  297|       |
  298|       |  // Get the max
  299|  1.06M|  __m128 max_0 = _mm_max_ps(in_0, in_1);
  300|  1.06M|  __m128 max_1 = _mm_max_ps(in_2, in_3);
  301|       |
  302|  1.06M|  max_0 = _mm_max_ps(max_0, max_1);
  303|  1.06M|  max_0 = reduce_max(max_0);
  304|       |
  305|       |  // Subtract the max off and clip
  306|  1.06M|  in_0 = _mm_sub_ps(in_0, max_0);
  307|  1.06M|  in_1 = _mm_sub_ps(in_1, max_0);
  308|  1.06M|  in_2 = _mm_sub_ps(in_2, max_0);
  309|  1.06M|  in_3 = _mm_sub_ps(in_3, max_0);
  310|       |
  311|  1.06M|  in_0 = _mm_max_ps(in_0, clipper);
  312|  1.06M|  in_1 = _mm_max_ps(in_1, clipper);
  313|  1.06M|  in_2 = _mm_max_ps(in_2, clipper);
  314|  1.06M|  in_3 = _mm_max_ps(in_3, clipper);
  315|       |
  316|       |  // Exponentiate and compute the denominator
  317|  1.06M|  __m128 sum = in_0 = approx_exp(in_0);
  318|  1.06M|  in_1 = approx_exp(in_1);
  319|  1.06M|  sum = _mm_add_ps(sum, in_1);
  320|  1.06M|  in_2 = approx_exp(in_2);
  321|  1.06M|  sum = _mm_add_ps(sum, in_2);
  322|  1.06M|  in_3 = approx_exp(in_3);
  323|  1.06M|  sum = _mm_add_ps(sum, in_3);
  324|  1.06M|  sum = reduce_sum(sum);
  325|       |
  326|       |  // Divide to get the probability
  327|  1.06M|  in_0 = _mm_div_ps(in_0, sum);
  328|  1.06M|  in_1 = _mm_div_ps(in_1, sum);
  329|  1.06M|  in_2 = _mm_div_ps(in_2, sum);
  330|  1.06M|  in_3 = _mm_div_ps(in_3, sum);
  331|       |
  332|  1.06M|  _mm_storeu_ps(&output[0], in_0);
  333|  1.06M|  _mm_storeu_ps(&output[4], in_1);
  334|  1.06M|  _mm_storeu_ps(&output[8], in_2);
  335|  1.06M|  _mm_storeu_ps(&output[12], in_3);
  336|  1.06M|}
ml_sse3.c:reduce_max:
  264|  1.06M|static inline __m128 reduce_max(__m128 reg) {
  265|  1.06M|  __m128 tmp_reg;
  266|       |
  267|  1.06M|  tmp_reg = _mm_shuffle_ps(reg, reg, 0x4e);  // 01 00 11 10
  268|  1.06M|  reg = _mm_max_ps(reg, tmp_reg);
  269|       |
  270|  1.06M|  tmp_reg = _mm_shuffle_ps(reg, reg, 0xb1);  // 10 11 00 01
  271|  1.06M|  reg = _mm_max_ps(reg, tmp_reg);
  272|       |
  273|  1.06M|  return reg;
  274|  1.06M|}
ml_sse3.c:approx_exp:
  248|  4.25M|static inline __m128 approx_exp(__m128 y) {
  249|  4.25M|#define A ((1 << 23) / 0.69314718056f)  // (1 << 23) / ln(2)
  250|  4.25M|#define B \
  251|  4.25M|  127  // Offset for the exponent according to IEEE floating point standard.
  252|  4.25M|#define C 60801  // Magic number controls the accuracy of approximation
  253|  4.25M|  const __m128 multiplier = _mm_set1_ps(A);
  ------------------
  |  |  249|  4.25M|#define A ((1 << 23) / 0.69314718056f)  // (1 << 23) / ln(2)
  ------------------
  254|  4.25M|  const __m128i offset = _mm_set1_epi32(B * (1 << 23) - C);
  ------------------
  |  |  251|  4.25M|  127  // Offset for the exponent according to IEEE floating point standard.
  ------------------
                const __m128i offset = _mm_set1_epi32(B * (1 << 23) - C);
  ------------------
  |  |  252|  4.25M|#define C 60801  // Magic number controls the accuracy of approximation
  ------------------
  255|       |
  256|  4.25M|  y = _mm_mul_ps(y, multiplier);
  257|  4.25M|  y = _mm_castsi128_ps(_mm_add_epi32(_mm_cvtps_epi32(y), offset));
  258|  4.25M|  return y;
  259|  4.25M|#undef A
  260|  4.25M|#undef B
  261|  4.25M|#undef C
  262|  4.25M|}
ml_sse3.c:reduce_sum:
  276|  1.06M|static inline __m128 reduce_sum(__m128 reg) {
  277|  1.06M|  __m128 tmp_reg;
  278|       |
  279|  1.06M|  tmp_reg = _mm_shuffle_ps(reg, reg, 0x4e);  // 01 00 11 10
  280|  1.06M|  reg = _mm_add_ps(reg, tmp_reg);
  281|       |
  282|  1.06M|  tmp_reg = _mm_shuffle_ps(reg, reg, 0xb1);  // 10 11 00 01
  283|  1.06M|  reg = _mm_add_ps(reg, tmp_reg);
  284|       |
  285|  1.06M|  return reg;
  286|  1.06M|}

av1_interp_cubic_rate_dist_sse2:
   17|  2.77M|                                     double x, double rate_dist_f[2]) {
   18|  2.77M|  const __m128d half = _mm_set1_pd(0.5);
   19|  2.77M|  const __m128d two = _mm_set1_pd(2.0);
   20|  2.77M|  const __m128d three = _mm_set1_pd(3.0);
   21|  2.77M|  const __m128d four = _mm_set1_pd(4.0);
   22|  2.77M|  const __m128d five = _mm_set1_pd(5.0);
   23|       |
   24|  2.77M|  const __m128d reg_x = _mm_set1_pd(x);
   25|  2.77M|  const __m128d reg_p0 = _mm_set_pd(p2[0], p1[0]);
   26|  2.77M|  const __m128d reg_p1 = _mm_set_pd(p2[1], p1[1]);
   27|  2.77M|  const __m128d reg_p2 = _mm_set_pd(p2[2], p1[2]);
   28|  2.77M|  const __m128d reg_p3 = _mm_set_pd(p2[3], p1[3]);
   29|       |
   30|       |  // To ensure that results are bit-identical to the C code, we need to perform
   31|       |  // exactly the same sequence of operations here as in the C code.
   32|       |  // reg_res_0 = x * (3.0 * (p[1] - p[2]) + p[3] - p[0])
   33|  2.77M|  __m128d reg_res_0 = _mm_sub_pd(reg_p1, reg_p2);
   34|  2.77M|  reg_res_0 = _mm_mul_pd(three, reg_res_0);
   35|  2.77M|  reg_res_0 = _mm_add_pd(reg_res_0, reg_p3);
   36|  2.77M|  reg_res_0 = _mm_sub_pd(reg_res_0, reg_p0);
   37|  2.77M|  reg_res_0 = _mm_mul_pd(reg_x, reg_res_0);
   38|       |
   39|       |  // reg_res_1 = 2.0 * p[0] - 5.0 * p[1] + 4.0 * p[2]- p[3]
   40|  2.77M|  const __m128d regp0_x_2 = _mm_mul_pd(two, reg_p0);
   41|  2.77M|  const __m128d regp1_x_5 = _mm_mul_pd(five, reg_p1);
   42|  2.77M|  const __m128d regp2_x_4 = _mm_mul_pd(four, reg_p2);
   43|  2.77M|  __m128d reg_res_1 = _mm_sub_pd(regp0_x_2, regp1_x_5);
   44|  2.77M|  reg_res_1 = _mm_add_pd(reg_res_1, regp2_x_4);
   45|  2.77M|  reg_res_1 = _mm_sub_pd(reg_res_1, reg_p3);
   46|       |
   47|       |  // reg_res_2 = x * (reg_res_1 + reg_res_0)
   48|  2.77M|  __m128d reg_res_2 = _mm_add_pd(reg_res_1, reg_res_0);
   49|  2.77M|  reg_res_2 = _mm_mul_pd(reg_x, reg_res_2);
   50|       |
   51|       |  // reg_res_3 = p[2] - p[0] + reg_res_2
   52|  2.77M|  __m128d reg_res_3 = _mm_sub_pd(reg_p2, reg_p0);
   53|  2.77M|  reg_res_3 = _mm_add_pd(reg_res_3, reg_res_2);
   54|       |
   55|       |  // reg_res_4 = p[1] + 0.5 * x * reg_res_3
   56|  2.77M|  __m128d reg_res_4 = _mm_mul_pd(_mm_mul_pd(half, reg_x), reg_res_3);
   57|  2.77M|  reg_res_4 = _mm_add_pd(reg_p1, reg_res_4);
   58|       |
   59|  2.77M|  _mm_storeu_pd(rate_dist_f, reg_res_4);
   60|  2.77M|}

av1_compute_stats_highbd_avx2:
  352|  2.04k|                                   aom_bit_depth_t bit_depth) {
  353|  2.04k|  if (wiener_win == WIENER_WIN) {
  ------------------
  |  |  121|  2.04k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  2.04k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (353:7): [True: 0, False: 2.04k]
  ------------------
  354|      0|    (void)dgd_avg;
  355|      0|    (void)src_avg;
  356|      0|    compute_stats_highbd_win7_opt_avx2(dgd8, src8, h_start, h_end, v_start,
  357|      0|                                       v_end, dgd_stride, src_stride, M, H,
  358|      0|                                       bit_depth);
  359|  2.04k|  } else if (wiener_win == WIENER_WIN_CHROMA) {
  ------------------
  |  |  128|  2.04k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  2.04k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.04k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (359:14): [True: 2.04k, False: 0]
  ------------------
  360|  2.04k|    (void)dgd_avg;
  361|  2.04k|    (void)src_avg;
  362|  2.04k|    compute_stats_highbd_win5_opt_avx2(dgd8, src8, h_start, h_end, v_start,
  363|  2.04k|                                       v_end, dgd_stride, src_stride, M, H,
  364|  2.04k|                                       bit_depth);
  365|  2.04k|  } else {
  366|      0|    av1_compute_stats_highbd_c(wiener_win, dgd8, src8, dgd_avg, src_avg,
  367|      0|                               h_start, h_end, v_start, v_end, dgd_stride,
  368|      0|                               src_stride, M, H, bit_depth);
  369|      0|  }
  370|  2.04k|}
av1_compute_stats_avx2:
 1504|  7.50k|                            int use_downsampled_wiener_stats) {
 1505|  7.50k|  if (wiener_win != WIENER_WIN && wiener_win != WIENER_WIN_CHROMA) {
  ------------------
  |  |  121|  15.0k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  7.50k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
                if (wiener_win != WIENER_WIN && wiener_win != WIENER_WIN_CHROMA) {
  ------------------
  |  |  128|  7.50k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  7.50k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  7.50k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1505:7): [True: 7.50k, False: 0]
  |  Branch (1505:35): [True: 0, False: 7.50k]
  ------------------
 1506|       |    // Currently, libaom supports Wiener filter processing with window sizes as
 1507|       |    // WIENER_WIN_CHROMA(5) and WIENER_WIN(7). For any other window size, SIMD
 1508|       |    // support is not facilitated. Hence, invoke C function for the same.
 1509|      0|    av1_compute_stats_c(wiener_win, dgd, src, dgd_avg, src_avg, h_start, h_end,
 1510|      0|                        v_start, v_end, dgd_stride, src_stride, M, H,
 1511|      0|                        use_downsampled_wiener_stats);
 1512|      0|    return;
 1513|      0|  }
 1514|       |
 1515|  7.50k|  const int32_t wiener_halfwin = wiener_win >> 1;
 1516|  7.50k|  const uint8_t avg =
 1517|  7.50k|      calc_dgd_buf_avg_avx2(dgd, h_start, h_end, v_start, v_end, dgd_stride);
 1518|  7.50k|  const int32_t width = h_end - h_start;
 1519|  7.50k|  const int32_t height = v_end - v_start;
 1520|  7.50k|  const int32_t d_stride = (width + 2 * wiener_halfwin + 15) & ~15;
 1521|  7.50k|  const int32_t s_stride = (width + 15) & ~15;
 1522|       |
 1523|       |  // Based on the sf 'use_downsampled_wiener_stats', process either once for
 1524|       |  // UPDATE_DOWNSAMPLE_FACTOR or for each row.
 1525|  7.50k|  sub_avg_block_avx2(src + v_start * src_stride + h_start, src_stride, avg,
 1526|  7.50k|                     width, height, src_avg, s_stride,
 1527|  7.50k|                     use_downsampled_wiener_stats);
 1528|       |
 1529|       |  // Compute (dgd-avg) buffer here which is used to fill H buffer.
 1530|  7.50k|  sub_avg_block_avx2(
 1531|  7.50k|      dgd + (v_start - wiener_halfwin) * dgd_stride + h_start - wiener_halfwin,
 1532|  7.50k|      dgd_stride, avg, width + 2 * wiener_halfwin, height + 2 * wiener_halfwin,
 1533|  7.50k|      dgd_avg, d_stride, 0);
 1534|  7.50k|  if (wiener_win == WIENER_WIN) {
  ------------------
  |  |  121|  7.50k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  ------------------
  |  |  |  |   43|  7.50k|#define WIENER_HALFWIN 3
  |  |  ------------------
  ------------------
  |  Branch (1534:7): [True: 0, False: 7.50k]
  ------------------
 1535|      0|    compute_stats_win7_avx2(dgd_avg, d_stride, src_avg, s_stride, width,
 1536|      0|                            v_start, v_end, M, H, use_downsampled_wiener_stats);
 1537|  7.50k|  } else if (wiener_win == WIENER_WIN_CHROMA) {
  ------------------
  |  |  128|  7.50k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  7.50k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  7.50k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1537:14): [True: 7.50k, False: 0]
  ------------------
 1538|  7.50k|    compute_stats_win5_avx2(dgd_avg, d_stride, src_avg, s_stride, width,
 1539|  7.50k|                            v_start, v_end, M, H, use_downsampled_wiener_stats);
 1540|  7.50k|  }
 1541|  7.50k|}
av1_lowbd_pixel_proj_error_avx2:
 1596|  47.2k|    int32_t *flt1, int flt1_stride, int xq[2], const sgr_params_type *params) {
 1597|  47.2k|  int i, j, k;
 1598|  47.2k|  const int32_t shift = SGRPROJ_RST_BITS + SGRPROJ_PRJ_BITS;
  ------------------
  |  |  101|  47.2k|#define SGRPROJ_RST_BITS 4
  ------------------
                const int32_t shift = SGRPROJ_RST_BITS + SGRPROJ_PRJ_BITS;
  ------------------
  |  |   99|  47.2k|#define SGRPROJ_PRJ_BITS 7
  ------------------
 1599|  47.2k|  const __m256i rounding = _mm256_set1_epi32(1 << (shift - 1));
 1600|  47.2k|  __m256i sum64 = _mm256_setzero_si256();
 1601|  47.2k|  const uint8_t *src = src8;
 1602|  47.2k|  const uint8_t *dat = dat8;
 1603|  47.2k|  int64_t err = 0;
 1604|       |
 1605|  47.2k|  if (params->r[0] > 0 && params->r[1] > 0) {
  ------------------
  |  Branch (1605:7): [True: 47.2k, False: 0]
  |  Branch (1605:27): [True: 47.2k, False: 0]
  ------------------
 1606|  47.2k|    __m256i xq_coeff = pair_set_epi16(xq[0], xq[1]);
 1607|  47.2k|    if (width == 8) {
  ------------------
  |  Branch (1607:9): [True: 4.53k, False: 42.6k]
  ------------------
 1608|  4.53k|      __m256i sum32 = _mm256_setzero_si256();
 1609|  4.53k|      const int height_even = height & ~1;
 1610|   166k|      for (i = 0; i < height_even; i += 2) {
  ------------------
  |  Branch (1610:19): [True: 161k, False: 4.53k]
  ------------------
 1611|   161k|        const uint8_t *dat_rowB = dat + dat_stride;
 1612|   161k|        const uint8_t *src_rowB = src + src_stride;
 1613|   161k|        const int32_t *flt0_rowB = flt0 + flt0_stride;
 1614|   161k|        const int32_t *flt1_rowB = flt1 + flt1_stride;
 1615|       |
 1616|   161k|        const __m256i d0 = load_shuffled_u8_dual8_to_epi16(dat, dat_rowB);
 1617|   161k|        const __m256i s0 = load_shuffled_u8_dual8_to_epi16(src, src_rowB);
 1618|   161k|        const __m256i flt0_16b =
 1619|   161k|            _mm256_packs_epi32(yy_loadu_256(flt0), yy_loadu_256(flt0_rowB));
 1620|   161k|        const __m256i flt1_16b =
 1621|   161k|            _mm256_packs_epi32(yy_loadu_256(flt1), yy_loadu_256(flt1_rowB));
 1622|       |
 1623|   161k|        const __m256i e0 = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1624|   161k|                                                    xq_coeff, rounding, shift);
 1625|   161k|        const __m256i err0 = _mm256_madd_epi16(e0, e0);
 1626|   161k|        sum32 = _mm256_add_epi32(sum32, err0);
 1627|       |
 1628|   161k|        dat += 2 * dat_stride;
 1629|   161k|        src += 2 * src_stride;
 1630|   161k|        flt0 += 2 * flt0_stride;
 1631|   161k|        flt1 += 2 * flt1_stride;
 1632|   161k|      }
 1633|  4.53k|      if (i < height) {
  ------------------
  |  Branch (1633:11): [True: 1.82k, False: 2.71k]
  ------------------
 1634|  16.3k|        for (k = 0; k < 8; ++k) {
  ------------------
  |  Branch (1634:21): [True: 14.5k, False: 1.82k]
  ------------------
 1635|  14.5k|          const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  14.5k|#define SGRPROJ_RST_BITS 4
  ------------------
 1636|  14.5k|          int32_t v = xq[0] * (flt0[k] - u) + xq[1] * (flt1[k] - u);
 1637|  14.5k|          const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|  14.5k|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1638|  14.5k|          err += ((int64_t)e * e);
 1639|  14.5k|        }
 1640|  1.82k|      }
 1641|  4.53k|      const __m256i sum64_0 =
 1642|  4.53k|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1643|  4.53k|      const __m256i sum64_1 =
 1644|  4.53k|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1645|  4.53k|      sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1646|  42.6k|    } else if (width == 16) {
  ------------------
  |  Branch (1646:16): [True: 264, False: 42.4k]
  ------------------
 1647|    264|      __m256i sum32_A = _mm256_setzero_si256();
 1648|    264|      __m256i sum32_B = _mm256_setzero_si256();
 1649|    264|      __m256i sum32_C = _mm256_setzero_si256();
 1650|    264|      __m256i sum32_D = _mm256_setzero_si256();
 1651|    264|      const int height_v4 = height & ~3;
 1652|  1.84k|      for (i = 0; i < height_v4; i += 4) {
  ------------------
  |  Branch (1652:19): [True: 1.57k, False: 264]
  ------------------
 1653|  1.57k|        const uint8_t *dat_rowB = dat + dat_stride;
 1654|  1.57k|        const uint8_t *dat_rowC = dat_rowB + dat_stride;
 1655|  1.57k|        const uint8_t *dat_rowD = dat_rowC + dat_stride;
 1656|  1.57k|        const uint8_t *src_rowB = src + src_stride;
 1657|  1.57k|        const uint8_t *src_rowC = src_rowB + src_stride;
 1658|  1.57k|        const uint8_t *src_rowD = src_rowC + src_stride;
 1659|  1.57k|        const int32_t *flt0_rowB = flt0 + flt0_stride;
 1660|  1.57k|        const int32_t *flt0_rowC = flt0_rowB + flt0_stride;
 1661|  1.57k|        const int32_t *flt0_rowD = flt0_rowC + flt0_stride;
 1662|  1.57k|        const int32_t *flt1_rowB = flt1 + flt1_stride;
 1663|  1.57k|        const int32_t *flt1_rowC = flt1_rowB + flt1_stride;
 1664|  1.57k|        const int32_t *flt1_rowD = flt1_rowC + flt1_stride;
 1665|       |
 1666|       |        // Row A
 1667|  1.57k|        {
 1668|  1.57k|          const __m256i d0 = load_shuffled_u8_to_epi16(dat);
 1669|  1.57k|          const __m256i s0 = load_shuffled_u8_to_epi16(src);
 1670|  1.57k|          const __m256i flt0_16b =
 1671|  1.57k|              _mm256_packs_epi32(yy_loadu_256(flt0), yy_loadu_256(flt0 + 8));
 1672|  1.57k|          const __m256i flt1_16b =
 1673|  1.57k|              _mm256_packs_epi32(yy_loadu_256(flt1), yy_loadu_256(flt1 + 8));
 1674|  1.57k|          const __m256i e = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1675|  1.57k|                                                     xq_coeff, rounding, shift);
 1676|  1.57k|          sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e, e));
 1677|  1.57k|        }
 1678|       |        // Row B
 1679|  1.57k|        {
 1680|  1.57k|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowB);
 1681|  1.57k|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowB);
 1682|  1.57k|          const __m256i flt0_16b = _mm256_packs_epi32(
 1683|  1.57k|              yy_loadu_256(flt0_rowB), yy_loadu_256(flt0_rowB + 8));
 1684|  1.57k|          const __m256i flt1_16b = _mm256_packs_epi32(
 1685|  1.57k|              yy_loadu_256(flt1_rowB), yy_loadu_256(flt1_rowB + 8));
 1686|  1.57k|          const __m256i e = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1687|  1.57k|                                                     xq_coeff, rounding, shift);
 1688|  1.57k|          sum32_B = _mm256_add_epi32(sum32_B, _mm256_madd_epi16(e, e));
 1689|  1.57k|        }
 1690|       |        // Row C
 1691|  1.57k|        {
 1692|  1.57k|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowC);
 1693|  1.57k|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowC);
 1694|  1.57k|          const __m256i flt0_16b = _mm256_packs_epi32(
 1695|  1.57k|              yy_loadu_256(flt0_rowC), yy_loadu_256(flt0_rowC + 8));
 1696|  1.57k|          const __m256i flt1_16b = _mm256_packs_epi32(
 1697|  1.57k|              yy_loadu_256(flt1_rowC), yy_loadu_256(flt1_rowC + 8));
 1698|  1.57k|          const __m256i e = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1699|  1.57k|                                                     xq_coeff, rounding, shift);
 1700|  1.57k|          sum32_C = _mm256_add_epi32(sum32_C, _mm256_madd_epi16(e, e));
 1701|  1.57k|        }
 1702|       |        // Row D
 1703|  1.57k|        {
 1704|  1.57k|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowD);
 1705|  1.57k|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowD);
 1706|  1.57k|          const __m256i flt0_16b = _mm256_packs_epi32(
 1707|  1.57k|              yy_loadu_256(flt0_rowD), yy_loadu_256(flt0_rowD + 8));
 1708|  1.57k|          const __m256i flt1_16b = _mm256_packs_epi32(
 1709|  1.57k|              yy_loadu_256(flt1_rowD), yy_loadu_256(flt1_rowD + 8));
 1710|  1.57k|          const __m256i e = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1711|  1.57k|                                                     xq_coeff, rounding, shift);
 1712|  1.57k|          sum32_D = _mm256_add_epi32(sum32_D, _mm256_madd_epi16(e, e));
 1713|  1.57k|        }
 1714|       |
 1715|  1.57k|        dat += 4 * dat_stride;
 1716|  1.57k|        src += 4 * src_stride;
 1717|  1.57k|        flt0 += 4 * flt0_stride;
 1718|  1.57k|        flt1 += 4 * flt1_stride;
 1719|  1.57k|      }
 1720|    874|      for (; i < height; ++i) {
  ------------------
  |  Branch (1720:14): [True: 610, False: 264]
  ------------------
 1721|    610|        const __m256i d0 = load_shuffled_u8_to_epi16(dat);
 1722|    610|        const __m256i s0 = load_shuffled_u8_to_epi16(src);
 1723|    610|        const __m256i flt0_16b =
 1724|    610|            _mm256_packs_epi32(yy_loadu_256(flt0), yy_loadu_256(flt0 + 8));
 1725|    610|        const __m256i flt1_16b =
 1726|    610|            _mm256_packs_epi32(yy_loadu_256(flt1), yy_loadu_256(flt1 + 8));
 1727|    610|        const __m256i e = calc_proj_err_r0_r1_avx2(d0, s0, flt0_16b, flt1_16b,
 1728|    610|                                                   xq_coeff, rounding, shift);
 1729|    610|        sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e, e));
 1730|       |
 1731|    610|        dat += dat_stride;
 1732|    610|        src += src_stride;
 1733|    610|        flt0 += flt0_stride;
 1734|    610|        flt1 += flt1_stride;
 1735|    610|      }
 1736|    264|      __m256i sum32 = _mm256_add_epi32(_mm256_add_epi32(sum32_A, sum32_B),
 1737|    264|                                       _mm256_add_epi32(sum32_C, sum32_D));
 1738|    264|      const __m256i sum64_0 =
 1739|    264|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1740|    264|      const __m256i sum64_1 =
 1741|    264|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1742|    264|      sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1743|  42.4k|    } else if (width >= 32 && (width % 32 == 0)) {
  ------------------
  |  Branch (1743:16): [True: 26.4k, False: 15.9k]
  |  Branch (1743:31): [True: 2.96k, False: 23.5k]
  ------------------
 1744|  2.96k|      int rows_per_batch = 4096 / width;
 1745|  2.96k|      if (rows_per_batch < 1) rows_per_batch = 1;
  ------------------
  |  Branch (1745:11): [True: 0, False: 2.96k]
  ------------------
 1746|  8.22k|      for (i = 0; i < height;) {
  ------------------
  |  Branch (1746:19): [True: 5.25k, False: 2.96k]
  ------------------
 1747|  5.25k|        int rows_to_do = height - i;
 1748|  5.25k|        if (rows_to_do > rows_per_batch) rows_to_do = rows_per_batch;
  ------------------
  |  Branch (1748:13): [True: 2.29k, False: 2.96k]
  ------------------
 1749|  5.25k|        const int next_i = i + rows_to_do;
 1750|  5.25k|        __m256i sum32_A = _mm256_setzero_si256();
 1751|  5.25k|        __m256i sum32_B = _mm256_setzero_si256();
 1752|   161k|        for (; i < next_i; ++i) {
  ------------------
  |  Branch (1752:16): [True: 156k, False: 5.25k]
  ------------------
 1753|   636k|          for (j = 0; j <= width - 32; j += 32) {
  ------------------
  |  Branch (1753:23): [True: 480k, False: 156k]
  ------------------
 1754|   480k|            const __m256i d_A = load_shuffled_u8_to_epi16(dat + j);
 1755|   480k|            const __m256i s_A = load_shuffled_u8_to_epi16(src + j);
 1756|   480k|            const __m256i flt0_A = _mm256_packs_epi32(
 1757|   480k|                yy_loadu_256(flt0 + j), yy_loadu_256(flt0 + j + 8));
 1758|   480k|            const __m256i flt1_A = _mm256_packs_epi32(
 1759|   480k|                yy_loadu_256(flt1 + j), yy_loadu_256(flt1 + j + 8));
 1760|   480k|            const __m256i e_A = calc_proj_err_r0_r1_avx2(
 1761|   480k|                d_A, s_A, flt0_A, flt1_A, xq_coeff, rounding, shift);
 1762|   480k|            sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e_A, e_A));
 1763|       |
 1764|   480k|            const __m256i d_B = load_shuffled_u8_to_epi16(dat + j + 16);
 1765|   480k|            const __m256i s_B = load_shuffled_u8_to_epi16(src + j + 16);
 1766|   480k|            const __m256i flt0_B = _mm256_packs_epi32(
 1767|   480k|                yy_loadu_256(flt0 + j + 16), yy_loadu_256(flt0 + j + 24));
 1768|   480k|            const __m256i flt1_B = _mm256_packs_epi32(
 1769|   480k|                yy_loadu_256(flt1 + j + 16), yy_loadu_256(flt1 + j + 24));
 1770|   480k|            const __m256i e_B = calc_proj_err_r0_r1_avx2(
 1771|   480k|                d_B, s_B, flt0_B, flt1_B, xq_coeff, rounding, shift);
 1772|   480k|            sum32_B = _mm256_add_epi32(sum32_B, _mm256_madd_epi16(e_B, e_B));
 1773|   480k|          }
 1774|   156k|          dat += dat_stride;
 1775|   156k|          src += src_stride;
 1776|   156k|          flt0 += flt0_stride;
 1777|   156k|          flt1 += flt1_stride;
 1778|   156k|        }
 1779|  5.25k|        __m256i sum32 = _mm256_add_epi32(sum32_A, sum32_B);
 1780|  5.25k|        const __m256i sum64_0 =
 1781|  5.25k|            _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1782|  5.25k|        const __m256i sum64_1 =
 1783|  5.25k|            _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1784|  5.25k|        sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1785|  5.25k|      }
 1786|  39.4k|    } else {
 1787|       |      // General fallback
 1788|  2.33M|      for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (1788:19): [True: 2.29M, False: 39.4k]
  ------------------
 1789|  2.29M|        __m256i sum32 = _mm256_setzero_si256();
 1790|  16.0M|        for (j = 0; j <= width - 16; j += 16) {
  ------------------
  |  Branch (1790:21): [True: 13.7M, False: 2.29M]
  ------------------
 1791|  13.7M|          const __m256i d0 = load_shuffled_u8_to_epi16(dat + j);
 1792|  13.7M|          const __m256i s0 = load_shuffled_u8_to_epi16(src + j);
 1793|  13.7M|          const __m256i flt0_16b = _mm256_packs_epi32(
 1794|  13.7M|              yy_loadu_256(flt0 + j), yy_loadu_256(flt0 + j + 8));
 1795|  13.7M|          const __m256i flt1_16b = _mm256_packs_epi32(
 1796|  13.7M|              yy_loadu_256(flt1 + j), yy_loadu_256(flt1 + j + 8));
 1797|  13.7M|          const __m256i e0 = calc_proj_err_r0_r1_avx2(
 1798|  13.7M|              d0, s0, flt0_16b, flt1_16b, xq_coeff, rounding, shift);
 1799|  13.7M|          sum32 = _mm256_add_epi32(sum32, _mm256_madd_epi16(e0, e0));
 1800|  13.7M|        }
 1801|  19.8M|        for (k = j; k < width; ++k) {
  ------------------
  |  Branch (1801:21): [True: 17.5M, False: 2.29M]
  ------------------
 1802|  17.5M|          const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  17.5M|#define SGRPROJ_RST_BITS 4
  ------------------
 1803|  17.5M|          int32_t v = xq[0] * (flt0[k] - u) + xq[1] * (flt1[k] - u);
 1804|  17.5M|          const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|  17.5M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1805|  17.5M|          err += ((int64_t)e * e);
 1806|  17.5M|        }
 1807|  2.29M|        dat += dat_stride;
 1808|  2.29M|        src += src_stride;
 1809|  2.29M|        flt0 += flt0_stride;
 1810|  2.29M|        flt1 += flt1_stride;
 1811|  2.29M|        const __m256i sum64_0 =
 1812|  2.29M|            _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1813|  2.29M|        const __m256i sum64_1 =
 1814|  2.29M|            _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1815|  2.29M|        sum64 = _mm256_add_epi64(sum64, sum64_0);
 1816|  2.29M|        sum64 = _mm256_add_epi64(sum64, sum64_1);
 1817|  2.29M|      }
 1818|  39.4k|    }
 1819|  47.2k|  } else if (params->r[0] > 0 || params->r[1] > 0) {
  ------------------
  |  Branch (1819:14): [True: 0, False: 0]
  |  Branch (1819:34): [True: 0, False: 0]
  ------------------
 1820|      0|    const int xq_active = (params->r[0] > 0) ? xq[0] : xq[1];
  ------------------
  |  Branch (1820:27): [True: 0, False: 0]
  ------------------
 1821|      0|    const __m256i xq_coeff =
 1822|      0|        pair_set_epi16(xq_active, -xq_active * (1 << SGRPROJ_RST_BITS));
  ------------------
  |  |  101|      0|#define SGRPROJ_RST_BITS 4
  ------------------
 1823|      0|    const int32_t *flt = (params->r[0] > 0) ? flt0 : flt1;
  ------------------
  |  Branch (1823:26): [True: 0, False: 0]
  ------------------
 1824|      0|    const int flt_stride = (params->r[0] > 0) ? flt0_stride : flt1_stride;
  ------------------
  |  Branch (1824:28): [True: 0, False: 0]
  ------------------
 1825|       |
 1826|      0|    if (width == 8) {
  ------------------
  |  Branch (1826:9): [True: 0, False: 0]
  ------------------
 1827|      0|      __m256i sum32 = _mm256_setzero_si256();
 1828|      0|      const int height_even = height & ~1;
 1829|      0|      for (i = 0; i < height_even; i += 2) {
  ------------------
  |  Branch (1829:19): [True: 0, False: 0]
  ------------------
 1830|      0|        const uint8_t *dat_rowB = dat + dat_stride;
 1831|      0|        const uint8_t *src_rowB = src + src_stride;
 1832|      0|        const int32_t *flt_rowB = flt + flt_stride;
 1833|       |
 1834|      0|        const __m256i d0 = load_shuffled_u8_dual8_to_epi16(dat, dat_rowB);
 1835|      0|        const __m256i s0 = load_shuffled_u8_dual8_to_epi16(src, src_rowB);
 1836|      0|        const __m256i flt_16b =
 1837|      0|            _mm256_packs_epi32(yy_loadu_256(flt), yy_loadu_256(flt_rowB));
 1838|       |
 1839|      0|        const __m256i e0 = calc_proj_err_r0_or_r1_avx2(
 1840|      0|            d0, s0, flt_16b, xq_coeff, rounding, shift);
 1841|      0|        const __m256i err0 = _mm256_madd_epi16(e0, e0);
 1842|      0|        sum32 = _mm256_add_epi32(sum32, err0);
 1843|       |
 1844|      0|        dat += 2 * dat_stride;
 1845|      0|        src += 2 * src_stride;
 1846|      0|        flt += 2 * flt_stride;
 1847|      0|      }
 1848|      0|      if (i < height) {
  ------------------
  |  Branch (1848:11): [True: 0, False: 0]
  ------------------
 1849|      0|        for (k = 0; k < 8; ++k) {
  ------------------
  |  Branch (1849:21): [True: 0, False: 0]
  ------------------
 1850|      0|          const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|      0|#define SGRPROJ_RST_BITS 4
  ------------------
 1851|      0|          int32_t v = xq_active * (flt[k] - u);
 1852|      0|          const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1853|      0|          err += ((int64_t)e * e);
 1854|      0|        }
 1855|      0|      }
 1856|      0|      const __m256i sum64_0 =
 1857|      0|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1858|      0|      const __m256i sum64_1 =
 1859|      0|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1860|      0|      sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1861|      0|    } else if (width == 16) {
  ------------------
  |  Branch (1861:16): [True: 0, False: 0]
  ------------------
 1862|      0|      __m256i sum32_A = _mm256_setzero_si256();
 1863|      0|      __m256i sum32_B = _mm256_setzero_si256();
 1864|      0|      __m256i sum32_C = _mm256_setzero_si256();
 1865|      0|      __m256i sum32_D = _mm256_setzero_si256();
 1866|      0|      const int height_v4 = height & ~3;
 1867|      0|      for (i = 0; i < height_v4; i += 4) {
  ------------------
  |  Branch (1867:19): [True: 0, False: 0]
  ------------------
 1868|      0|        const uint8_t *dat_rowB = dat + dat_stride;
 1869|      0|        const uint8_t *dat_rowC = dat_rowB + dat_stride;
 1870|      0|        const uint8_t *dat_rowD = dat_rowC + dat_stride;
 1871|      0|        const uint8_t *src_rowB = src + src_stride;
 1872|      0|        const uint8_t *src_rowC = src_rowB + src_stride;
 1873|      0|        const uint8_t *src_rowD = src_rowC + src_stride;
 1874|      0|        const int32_t *flt_rowB = flt + flt_stride;
 1875|      0|        const int32_t *flt_rowC = flt_rowB + flt_stride;
 1876|      0|        const int32_t *flt_rowD = flt_rowC + flt_stride;
 1877|       |
 1878|       |        // Row A
 1879|      0|        {
 1880|      0|          const __m256i d0 = load_shuffled_u8_to_epi16(dat);
 1881|      0|          const __m256i s0 = load_shuffled_u8_to_epi16(src);
 1882|      0|          const __m256i flt_16b =
 1883|      0|              _mm256_packs_epi32(yy_loadu_256(flt), yy_loadu_256(flt + 8));
 1884|      0|          const __m256i e = calc_proj_err_r0_or_r1_avx2(
 1885|      0|              d0, s0, flt_16b, xq_coeff, rounding, shift);
 1886|      0|          sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e, e));
 1887|      0|        }
 1888|       |        // Row B
 1889|      0|        {
 1890|      0|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowB);
 1891|      0|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowB);
 1892|      0|          const __m256i flt_16b = _mm256_packs_epi32(
 1893|      0|              yy_loadu_256(flt_rowB), yy_loadu_256(flt_rowB + 8));
 1894|      0|          const __m256i e = calc_proj_err_r0_or_r1_avx2(
 1895|      0|              d0, s0, flt_16b, xq_coeff, rounding, shift);
 1896|      0|          sum32_B = _mm256_add_epi32(sum32_B, _mm256_madd_epi16(e, e));
 1897|      0|        }
 1898|       |        // Row C
 1899|      0|        {
 1900|      0|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowC);
 1901|      0|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowC);
 1902|      0|          const __m256i flt_16b = _mm256_packs_epi32(
 1903|      0|              yy_loadu_256(flt_rowC), yy_loadu_256(flt_rowC + 8));
 1904|      0|          const __m256i e = calc_proj_err_r0_or_r1_avx2(
 1905|      0|              d0, s0, flt_16b, xq_coeff, rounding, shift);
 1906|      0|          sum32_C = _mm256_add_epi32(sum32_C, _mm256_madd_epi16(e, e));
 1907|      0|        }
 1908|       |        // Row D
 1909|      0|        {
 1910|      0|          const __m256i d0 = load_shuffled_u8_to_epi16(dat_rowD);
 1911|      0|          const __m256i s0 = load_shuffled_u8_to_epi16(src_rowD);
 1912|      0|          const __m256i flt_16b = _mm256_packs_epi32(
 1913|      0|              yy_loadu_256(flt_rowD), yy_loadu_256(flt_rowD + 8));
 1914|      0|          const __m256i e = calc_proj_err_r0_or_r1_avx2(
 1915|      0|              d0, s0, flt_16b, xq_coeff, rounding, shift);
 1916|      0|          sum32_D = _mm256_add_epi32(sum32_D, _mm256_madd_epi16(e, e));
 1917|      0|        }
 1918|       |
 1919|      0|        dat += 4 * dat_stride;
 1920|      0|        src += 4 * src_stride;
 1921|      0|        flt += 4 * flt_stride;
 1922|      0|      }
 1923|      0|      for (; i < height; ++i) {
  ------------------
  |  Branch (1923:14): [True: 0, False: 0]
  ------------------
 1924|      0|        const __m256i d0 = load_shuffled_u8_to_epi16(dat);
 1925|      0|        const __m256i s0 = load_shuffled_u8_to_epi16(src);
 1926|      0|        const __m256i flt_16b =
 1927|      0|            _mm256_packs_epi32(yy_loadu_256(flt), yy_loadu_256(flt + 8));
 1928|      0|        const __m256i e = calc_proj_err_r0_or_r1_avx2(d0, s0, flt_16b, xq_coeff,
 1929|      0|                                                      rounding, shift);
 1930|      0|        sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e, e));
 1931|       |
 1932|      0|        dat += dat_stride;
 1933|      0|        src += src_stride;
 1934|      0|        flt += flt_stride;
 1935|      0|      }
 1936|      0|      __m256i sum32 = _mm256_add_epi32(_mm256_add_epi32(sum32_A, sum32_B),
 1937|      0|                                       _mm256_add_epi32(sum32_C, sum32_D));
 1938|      0|      const __m256i sum64_0 =
 1939|      0|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1940|      0|      const __m256i sum64_1 =
 1941|      0|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1942|      0|      sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1943|      0|    } else if (width >= 32 && (width % 32 == 0)) {
  ------------------
  |  Branch (1943:16): [True: 0, False: 0]
  |  Branch (1943:31): [True: 0, False: 0]
  ------------------
 1944|      0|      int rows_per_batch = 4096 / width;
 1945|      0|      if (rows_per_batch < 1) rows_per_batch = 1;
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      0|      for (i = 0; i < height;) {
  ------------------
  |  Branch (1946:19): [True: 0, False: 0]
  ------------------
 1947|      0|        int rows_to_do = height - i;
 1948|      0|        if (rows_to_do > rows_per_batch) rows_to_do = rows_per_batch;
  ------------------
  |  Branch (1948:13): [True: 0, False: 0]
  ------------------
 1949|      0|        const int next_i = i + rows_to_do;
 1950|      0|        __m256i sum32_A = _mm256_setzero_si256();
 1951|      0|        __m256i sum32_B = _mm256_setzero_si256();
 1952|      0|        for (; i < next_i; ++i) {
  ------------------
  |  Branch (1952:16): [True: 0, False: 0]
  ------------------
 1953|      0|          for (j = 0; j <= width - 32; j += 32) {
  ------------------
  |  Branch (1953:23): [True: 0, False: 0]
  ------------------
 1954|      0|            const __m256i d_A = load_shuffled_u8_to_epi16(dat + j);
 1955|      0|            const __m256i s_A = load_shuffled_u8_to_epi16(src + j);
 1956|      0|            const __m256i flt_A = _mm256_packs_epi32(yy_loadu_256(flt + j),
 1957|      0|                                                     yy_loadu_256(flt + j + 8));
 1958|      0|            const __m256i e_A = calc_proj_err_r0_or_r1_avx2(
 1959|      0|                d_A, s_A, flt_A, xq_coeff, rounding, shift);
 1960|      0|            sum32_A = _mm256_add_epi32(sum32_A, _mm256_madd_epi16(e_A, e_A));
 1961|       |
 1962|      0|            const __m256i d_B = load_shuffled_u8_to_epi16(dat + j + 16);
 1963|      0|            const __m256i s_B = load_shuffled_u8_to_epi16(src + j + 16);
 1964|      0|            const __m256i flt_B = _mm256_packs_epi32(
 1965|      0|                yy_loadu_256(flt + j + 16), yy_loadu_256(flt + j + 24));
 1966|      0|            const __m256i e_B = calc_proj_err_r0_or_r1_avx2(
 1967|      0|                d_B, s_B, flt_B, xq_coeff, rounding, shift);
 1968|      0|            sum32_B = _mm256_add_epi32(sum32_B, _mm256_madd_epi16(e_B, e_B));
 1969|      0|          }
 1970|      0|          dat += dat_stride;
 1971|      0|          src += src_stride;
 1972|      0|          flt += flt_stride;
 1973|      0|        }
 1974|      0|        __m256i sum32 = _mm256_add_epi32(sum32_A, sum32_B);
 1975|      0|        const __m256i sum64_0 =
 1976|      0|            _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 1977|      0|        const __m256i sum64_1 =
 1978|      0|            _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 1979|      0|        sum64 = _mm256_add_epi64(sum64, _mm256_add_epi64(sum64_0, sum64_1));
 1980|      0|      }
 1981|      0|    } else {
 1982|       |      // General fallback
 1983|      0|      for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (1983:19): [True: 0, False: 0]
  ------------------
 1984|      0|        __m256i sum32 = _mm256_setzero_si256();
 1985|      0|        for (j = 0; j <= width - 16; j += 16) {
  ------------------
  |  Branch (1985:21): [True: 0, False: 0]
  ------------------
 1986|      0|          const __m256i d0 = load_shuffled_u8_to_epi16(dat + j);
 1987|      0|          const __m256i s0 = load_shuffled_u8_to_epi16(src + j);
 1988|      0|          const __m256i flt_16b = _mm256_packs_epi32(yy_loadu_256(flt + j),
 1989|      0|                                                     yy_loadu_256(flt + j + 8));
 1990|      0|          const __m256i e0 = calc_proj_err_r0_or_r1_avx2(
 1991|      0|              d0, s0, flt_16b, xq_coeff, rounding, shift);
 1992|      0|          sum32 = _mm256_add_epi32(sum32, _mm256_madd_epi16(e0, e0));
 1993|      0|        }
 1994|      0|        for (k = j; k < width; ++k) {
  ------------------
  |  Branch (1994:21): [True: 0, False: 0]
  ------------------
 1995|      0|          const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|      0|#define SGRPROJ_RST_BITS 4
  ------------------
 1996|      0|          int32_t v = xq_active * (flt[k] - u);
 1997|      0|          const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 1998|      0|          err += ((int64_t)e * e);
 1999|      0|        }
 2000|      0|        dat += dat_stride;
 2001|      0|        src += src_stride;
 2002|      0|        flt += flt_stride;
 2003|      0|        const __m256i sum64_0 =
 2004|      0|            _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 2005|      0|        const __m256i sum64_1 =
 2006|      0|            _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 2007|      0|        sum64 = _mm256_add_epi64(sum64, sum64_0);
 2008|      0|        sum64 = _mm256_add_epi64(sum64, sum64_1);
 2009|      0|      }
 2010|      0|    }
 2011|      0|  } else {
 2012|      0|    if (width == 8) {
  ------------------
  |  Branch (2012:9): [True: 0, False: 0]
  ------------------
 2013|      0|      __m256i sum32 = _mm256_setzero_si256();
 2014|      0|      const int height_even = height & ~1;
 2015|      0|      for (i = 0; i < height_even; i += 2) {
  ------------------
  |  Branch (2015:19): [True: 0, False: 0]
  ------------------
 2016|      0|        const uint8_t *dat_rowB = dat + dat_stride;
 2017|      0|        const uint8_t *src_rowB = src + src_stride;
 2018|       |
 2019|      0|        const __m128i d_AB =
 2020|      0|            _mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i *)dat),
 2021|      0|                               _mm_loadl_epi64((const __m128i *)dat_rowB));
 2022|      0|        const __m128i s_AB =
 2023|      0|            _mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i *)src),
 2024|      0|                               _mm_loadl_epi64((const __m128i *)src_rowB));
 2025|      0|        const __m256i diff = _mm256_sub_epi16(_mm256_cvtepu8_epi16(d_AB),
 2026|      0|                                              _mm256_cvtepu8_epi16(s_AB));
 2027|      0|        sum32 = _mm256_add_epi32(sum32, _mm256_madd_epi16(diff, diff));
 2028|      0|        dat += 2 * dat_stride;
 2029|      0|        src += 2 * src_stride;
 2030|      0|      }
 2031|      0|      if (i < height) {
  ------------------
  |  Branch (2031:11): [True: 0, False: 0]
  ------------------
 2032|      0|        const __m128i d_A = _mm_loadl_epi64((const __m128i *)dat);
 2033|      0|        const __m128i s_A = _mm_loadl_epi64((const __m128i *)src);
 2034|      0|        const __m256i diff = _mm256_sub_epi16(_mm256_cvtepu8_epi16(d_A),
 2035|      0|                                              _mm256_cvtepu8_epi16(s_A));
 2036|      0|        sum32 = _mm256_add_epi32(sum32, _mm256_madd_epi16(diff, diff));
 2037|      0|      }
 2038|      0|      const __m256i sum64_0 =
 2039|      0|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 2040|      0|      const __m256i sum64_1 =
 2041|      0|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 2042|      0|      sum64 = _mm256_add_epi64(sum64_0, sum64_1);
 2043|      0|    } else if (width >= 32 && (width % 32 == 0)) {
  ------------------
  |  Branch (2043:16): [True: 0, False: 0]
  |  Branch (2043:31): [True: 0, False: 0]
  ------------------
 2044|      0|      __m256i sum32_A = _mm256_setzero_si256();
 2045|      0|      __m256i sum32_B = _mm256_setzero_si256();
 2046|      0|      for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (2046:19): [True: 0, False: 0]
  ------------------
 2047|      0|        for (j = 0; j <= width - 32; j += 32) {
  ------------------
  |  Branch (2047:21): [True: 0, False: 0]
  ------------------
 2048|      0|          const __m256i d_A = _mm256_cvtepu8_epi16(xx_loadu_128(dat + j));
 2049|      0|          const __m256i s_A = _mm256_cvtepu8_epi16(xx_loadu_128(src + j));
 2050|      0|          const __m256i diff_A = _mm256_sub_epi16(d_A, s_A);
 2051|      0|          sum32_A =
 2052|      0|              _mm256_add_epi32(sum32_A, _mm256_madd_epi16(diff_A, diff_A));
 2053|       |
 2054|      0|          const __m256i d_B = _mm256_cvtepu8_epi16(xx_loadu_128(dat + j + 16));
 2055|      0|          const __m256i s_B = _mm256_cvtepu8_epi16(xx_loadu_128(src + j + 16));
 2056|      0|          const __m256i diff_B = _mm256_sub_epi16(d_B, s_B);
 2057|      0|          sum32_B =
 2058|      0|              _mm256_add_epi32(sum32_B, _mm256_madd_epi16(diff_B, diff_B));
 2059|      0|        }
 2060|      0|        dat += dat_stride;
 2061|      0|        src += src_stride;
 2062|      0|      }
 2063|      0|      __m256i sum32 = _mm256_add_epi32(sum32_A, sum32_B);
 2064|      0|      const __m256i sum64_0 =
 2065|      0|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 2066|      0|      const __m256i sum64_1 =
 2067|      0|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 2068|      0|      sum64 = _mm256_add_epi64(sum64_0, sum64_1);
 2069|      0|    } else if (width >= 16) {
  ------------------
  |  Branch (2069:16): [True: 0, False: 0]
  ------------------
 2070|      0|      __m256i sum32_A = _mm256_setzero_si256();
 2071|      0|      __m256i sum32_B = _mm256_setzero_si256();
 2072|      0|      const int height_even = height & ~1;
 2073|      0|      for (i = 0; i < height_even; i += 2) {
  ------------------
  |  Branch (2073:19): [True: 0, False: 0]
  ------------------
 2074|      0|        const uint8_t *dat_rowB = dat + dat_stride;
 2075|      0|        const uint8_t *src_rowB = src + src_stride;
 2076|      0|        for (j = 0; j <= width - 16; j += 16) {
  ------------------
  |  Branch (2076:21): [True: 0, False: 0]
  ------------------
 2077|      0|          const __m256i d_A = _mm256_cvtepu8_epi16(xx_loadu_128(dat + j));
 2078|      0|          const __m256i s_A = _mm256_cvtepu8_epi16(xx_loadu_128(src + j));
 2079|      0|          const __m256i diff_A = _mm256_sub_epi16(d_A, s_A);
 2080|      0|          sum32_A =
 2081|      0|              _mm256_add_epi32(sum32_A, _mm256_madd_epi16(diff_A, diff_A));
 2082|       |
 2083|      0|          const __m256i d_B = _mm256_cvtepu8_epi16(xx_loadu_128(dat_rowB + j));
 2084|      0|          const __m256i s_B = _mm256_cvtepu8_epi16(xx_loadu_128(src_rowB + j));
 2085|      0|          const __m256i diff_B = _mm256_sub_epi16(d_B, s_B);
 2086|      0|          sum32_B =
 2087|      0|              _mm256_add_epi32(sum32_B, _mm256_madd_epi16(diff_B, diff_B));
 2088|      0|        }
 2089|      0|        for (k = j; k < width; ++k) {
  ------------------
  |  Branch (2089:21): [True: 0, False: 0]
  ------------------
 2090|      0|          const int32_t e_A = (int32_t)dat[k] - src[k];
 2091|      0|          err += (int64_t)e_A * e_A;
 2092|      0|          const int32_t e_B = (int32_t)dat_rowB[k] - src_rowB[k];
 2093|      0|          err += (int64_t)e_B * e_B;
 2094|      0|        }
 2095|      0|        dat += 2 * dat_stride;
 2096|      0|        src += 2 * src_stride;
 2097|      0|      }
 2098|      0|      if (i < height) {
  ------------------
  |  Branch (2098:11): [True: 0, False: 0]
  ------------------
 2099|      0|        for (j = 0; j <= width - 16; j += 16) {
  ------------------
  |  Branch (2099:21): [True: 0, False: 0]
  ------------------
 2100|      0|          const __m256i d_A = _mm256_cvtepu8_epi16(xx_loadu_128(dat + j));
 2101|      0|          const __m256i s_A = _mm256_cvtepu8_epi16(xx_loadu_128(src + j));
 2102|      0|          const __m256i diff_A = _mm256_sub_epi16(d_A, s_A);
 2103|      0|          sum32_A =
 2104|      0|              _mm256_add_epi32(sum32_A, _mm256_madd_epi16(diff_A, diff_A));
 2105|      0|        }
 2106|      0|        for (k = j; k < width; ++k) {
  ------------------
  |  Branch (2106:21): [True: 0, False: 0]
  ------------------
 2107|      0|          const int32_t e_A = (int32_t)dat[k] - src[k];
 2108|      0|          err += (int64_t)e_A * e_A;
 2109|      0|        }
 2110|      0|      }
 2111|      0|      __m256i sum32 = _mm256_add_epi32(sum32_A, sum32_B);
 2112|      0|      const __m256i sum64_0 =
 2113|      0|          _mm256_cvtepi32_epi64(_mm256_castsi256_si128(sum32));
 2114|      0|      const __m256i sum64_1 =
 2115|      0|          _mm256_cvtepi32_epi64(_mm256_extracti128_si256(sum32, 1));
 2116|      0|      sum64 = _mm256_add_epi64(sum64_0, sum64_1);
 2117|      0|    } else {
 2118|       |      // General fallback
 2119|      0|      for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (2119:19): [True: 0, False: 0]
  ------------------
 2120|      0|        for (k = 0; k < width; ++k) {
  ------------------
  |  Branch (2120:21): [True: 0, False: 0]
  ------------------
 2121|      0|          const int32_t e = (int32_t)(dat[k]) - src[k];
 2122|      0|          err += ((int64_t)e * e);
 2123|      0|        }
 2124|      0|        dat += dat_stride;
 2125|      0|        src += src_stride;
 2126|      0|      }
 2127|      0|    }
 2128|      0|  }
 2129|  47.2k|  int64_t sum[4];
 2130|  47.2k|  yy_storeu_256(sum, sum64);
 2131|  47.2k|  err += sum[0] + sum[1] + sum[2] + sum[3];
 2132|  47.2k|  return err;
 2133|  47.2k|}
av1_calc_proj_params_avx2:
 2350|    416|                               int64_t C[2], const sgr_params_type *params) {
 2351|    416|  if ((params->r[0] > 0) && (params->r[1] > 0)) {
  ------------------
  |  Branch (2351:7): [True: 416, False: 0]
  |  Branch (2351:29): [True: 416, False: 0]
  ------------------
 2352|    416|    calc_proj_params_r0_r1_avx2(src8, width, height, src_stride, dat8,
 2353|    416|                                dat_stride, flt0, flt0_stride, flt1,
 2354|    416|                                flt1_stride, H, C);
 2355|    416|  } else if (params->r[0] > 0) {
  ------------------
  |  Branch (2355:14): [True: 0, False: 0]
  ------------------
 2356|      0|    calc_proj_params_r0_avx2(src8, width, height, src_stride, dat8, dat_stride,
 2357|      0|                             flt0, flt0_stride, H, C);
 2358|      0|  } else if (params->r[1] > 0) {
  ------------------
  |  Branch (2358:14): [True: 0, False: 0]
  ------------------
 2359|      0|    calc_proj_params_r1_avx2(src8, width, height, src_stride, dat8, dat_stride,
 2360|      0|                             flt1, flt1_stride, H, C);
 2361|      0|  }
 2362|    416|}
av1_calc_proj_params_high_bd_avx2:
 2574|    148|                                       const sgr_params_type *params) {
 2575|    148|  if ((params->r[0] > 0) && (params->r[1] > 0)) {
  ------------------
  |  Branch (2575:7): [True: 148, False: 0]
  |  Branch (2575:29): [True: 148, False: 0]
  ------------------
 2576|    148|    calc_proj_params_r0_r1_high_bd_avx2(src8, width, height, src_stride, dat8,
 2577|    148|                                        dat_stride, flt0, flt0_stride, flt1,
 2578|    148|                                        flt1_stride, H, C);
 2579|    148|  } else if (params->r[0] > 0) {
  ------------------
  |  Branch (2579:14): [True: 0, False: 0]
  ------------------
 2580|      0|    calc_proj_params_r0_high_bd_avx2(src8, width, height, src_stride, dat8,
 2581|      0|                                     dat_stride, flt0, flt0_stride, H, C);
 2582|      0|  } else if (params->r[1] > 0) {
  ------------------
  |  Branch (2582:14): [True: 0, False: 0]
  ------------------
 2583|      0|    calc_proj_params_r1_high_bd_avx2(src8, width, height, src_stride, dat8,
 2584|      0|                                     dat_stride, flt1, flt1_stride, H, C);
 2585|      0|  }
 2586|    148|}
av1_highbd_pixel_proj_error_avx2:
 2591|  20.2k|    int32_t *flt1, int flt1_stride, int xq[2], const sgr_params_type *params) {
 2592|  20.2k|  int i, j, k;
 2593|  20.2k|  const int32_t shift = SGRPROJ_RST_BITS + SGRPROJ_PRJ_BITS;
  ------------------
  |  |  101|  20.2k|#define SGRPROJ_RST_BITS 4
  ------------------
                const int32_t shift = SGRPROJ_RST_BITS + SGRPROJ_PRJ_BITS;
  ------------------
  |  |   99|  20.2k|#define SGRPROJ_PRJ_BITS 7
  ------------------
 2594|  20.2k|  const __m256i rounding = _mm256_set1_epi32(1 << (shift - 1));
 2595|  20.2k|  __m256i sum64 = _mm256_setzero_si256();
 2596|  20.2k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  20.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 2597|  20.2k|  const uint16_t *dat = CONVERT_TO_SHORTPTR(dat8);
  ------------------
  |  |   79|  20.2k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 2598|  20.2k|  int64_t err = 0;
 2599|  20.2k|  if (params->r[0] > 0 && params->r[1] > 0) {  // Both filters are enabled
  ------------------
  |  Branch (2599:7): [True: 20.2k, False: 0]
  |  Branch (2599:27): [True: 20.2k, False: 0]
  ------------------
 2600|  20.2k|    const __m256i xq0 = _mm256_set1_epi32(xq[0]);
 2601|  20.2k|    const __m256i xq1 = _mm256_set1_epi32(xq[1]);
 2602|   321k|    for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (2602:17): [True: 301k, False: 20.2k]
  ------------------
 2603|   301k|      __m256i sum32 = _mm256_setzero_si256();
 2604|   538k|      for (j = 0; j <= width - 16; j += 16) {  // Process 16 pixels at a time
  ------------------
  |  Branch (2604:19): [True: 237k, False: 301k]
  ------------------
 2605|       |        // Load 16 pixels each from source image and corrupted image
 2606|   237k|        const __m256i s0 = yy_loadu_256(src + j);
 2607|   237k|        const __m256i d0 = yy_loadu_256(dat + j);
 2608|       |        // s0 = [15 14 13 12 11 10 9 8] [7 6 5 4 3 2 1 0] as u16 (indices)
 2609|       |
 2610|       |        // Shift-up each pixel to match filtered image scaling
 2611|   237k|        const __m256i u0 = _mm256_slli_epi16(d0, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   237k|#define SGRPROJ_RST_BITS 4
  ------------------
 2612|       |
 2613|       |        // Split u0 into two halves and pad each from u16 to i32
 2614|   237k|        const __m256i u0l = _mm256_cvtepu16_epi32(_mm256_castsi256_si128(u0));
 2615|   237k|        const __m256i u0h =
 2616|   237k|            _mm256_cvtepu16_epi32(_mm256_extracti128_si256(u0, 1));
 2617|       |        // u0h, u0l = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0] as u32
 2618|       |
 2619|       |        // Load 16 pixels from each filtered image
 2620|   237k|        const __m256i flt0l = yy_loadu_256(flt0 + j);
 2621|   237k|        const __m256i flt0h = yy_loadu_256(flt0 + j + 8);
 2622|   237k|        const __m256i flt1l = yy_loadu_256(flt1 + j);
 2623|   237k|        const __m256i flt1h = yy_loadu_256(flt1 + j + 8);
 2624|       |        // flt?l, flt?h = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0] as u32
 2625|       |
 2626|       |        // Subtract shifted corrupt image from each filtered image
 2627|   237k|        const __m256i flt0l_subu = _mm256_sub_epi32(flt0l, u0l);
 2628|   237k|        const __m256i flt0h_subu = _mm256_sub_epi32(flt0h, u0h);
 2629|   237k|        const __m256i flt1l_subu = _mm256_sub_epi32(flt1l, u0l);
 2630|   237k|        const __m256i flt1h_subu = _mm256_sub_epi32(flt1h, u0h);
 2631|       |
 2632|       |        // Multiply basis vectors by appropriate coefficients
 2633|   237k|        const __m256i v0l = _mm256_mullo_epi32(flt0l_subu, xq0);
 2634|   237k|        const __m256i v0h = _mm256_mullo_epi32(flt0h_subu, xq0);
 2635|   237k|        const __m256i v1l = _mm256_mullo_epi32(flt1l_subu, xq1);
 2636|   237k|        const __m256i v1h = _mm256_mullo_epi32(flt1h_subu, xq1);
 2637|       |
 2638|       |        // Add together the contributions from the two basis vectors
 2639|   237k|        const __m256i vl = _mm256_add_epi32(v0l, v1l);
 2640|   237k|        const __m256i vh = _mm256_add_epi32(v0h, v1h);
 2641|       |
 2642|       |        // Right-shift v with appropriate rounding
 2643|   237k|        const __m256i vrl =
 2644|   237k|            _mm256_srai_epi32(_mm256_add_epi32(vl, rounding), shift);
 2645|   237k|        const __m256i vrh =
 2646|   237k|            _mm256_srai_epi32(_mm256_add_epi32(vh, rounding), shift);
 2647|       |        // vrh, vrl = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0]
 2648|       |
 2649|       |        // Saturate each i32 to an i16 then combine both halves
 2650|       |        // The permute (control=[3 1 2 0]) fixes weird ordering from AVX lanes
 2651|   237k|        const __m256i vr =
 2652|   237k|            _mm256_permute4x64_epi64(_mm256_packs_epi32(vrl, vrh), 0xd8);
 2653|       |        // intermediate = [15 14 13 12 7 6 5 4] [11 10 9 8 3 2 1 0]
 2654|       |        // vr = [15 14 13 12 11 10 9 8] [7 6 5 4 3 2 1 0]
 2655|       |
 2656|       |        // Add twin-subspace-sgr-filter to corrupt image then subtract source
 2657|   237k|        const __m256i e0 = _mm256_sub_epi16(_mm256_add_epi16(vr, d0), s0);
 2658|       |
 2659|       |        // Calculate squared error and add adjacent values
 2660|   237k|        const __m256i err0 = _mm256_madd_epi16(e0, e0);
 2661|       |
 2662|   237k|        sum32 = _mm256_add_epi32(sum32, err0);
 2663|   237k|      }
 2664|       |
 2665|   301k|      const __m256i sum32l =
 2666|   301k|          _mm256_cvtepu32_epi64(_mm256_castsi256_si128(sum32));
 2667|   301k|      sum64 = _mm256_add_epi64(sum64, sum32l);
 2668|   301k|      const __m256i sum32h =
 2669|   301k|          _mm256_cvtepu32_epi64(_mm256_extracti128_si256(sum32, 1));
 2670|   301k|      sum64 = _mm256_add_epi64(sum64, sum32h);
 2671|       |
 2672|       |      // Process remaining pixels in this row (modulo 16)
 2673|  2.26M|      for (k = j; k < width; ++k) {
  ------------------
  |  Branch (2673:19): [True: 1.96M, False: 301k]
  ------------------
 2674|  1.96M|        const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  1.96M|#define SGRPROJ_RST_BITS 4
  ------------------
 2675|  1.96M|        int32_t v = xq[0] * (flt0[k] - u) + xq[1] * (flt1[k] - u);
 2676|  1.96M|        const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|  1.96M|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2677|  1.96M|        err += ((int64_t)e * e);
 2678|  1.96M|      }
 2679|   301k|      dat += dat_stride;
 2680|   301k|      src += src_stride;
 2681|   301k|      flt0 += flt0_stride;
 2682|   301k|      flt1 += flt1_stride;
 2683|   301k|    }
 2684|  20.2k|  } else if (params->r[0] > 0 || params->r[1] > 0) {  // Only one filter enabled
  ------------------
  |  Branch (2684:14): [True: 0, False: 0]
  |  Branch (2684:34): [True: 0, False: 0]
  ------------------
 2685|      0|    const int32_t xq_on = (params->r[0] > 0) ? xq[0] : xq[1];
  ------------------
  |  Branch (2685:27): [True: 0, False: 0]
  ------------------
 2686|      0|    const __m256i xq_active = _mm256_set1_epi32(xq_on);
 2687|      0|    const __m256i xq_inactive =
 2688|      0|        _mm256_set1_epi32(-xq_on * (1 << SGRPROJ_RST_BITS));
  ------------------
  |  |  101|      0|#define SGRPROJ_RST_BITS 4
  ------------------
 2689|      0|    const int32_t *flt = (params->r[0] > 0) ? flt0 : flt1;
  ------------------
  |  Branch (2689:26): [True: 0, False: 0]
  ------------------
 2690|      0|    const int flt_stride = (params->r[0] > 0) ? flt0_stride : flt1_stride;
  ------------------
  |  Branch (2690:28): [True: 0, False: 0]
  ------------------
 2691|      0|    for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (2691:17): [True: 0, False: 0]
  ------------------
 2692|      0|      __m256i sum32 = _mm256_setzero_si256();
 2693|      0|      for (j = 0; j <= width - 16; j += 16) {
  ------------------
  |  Branch (2693:19): [True: 0, False: 0]
  ------------------
 2694|       |        // Load 16 pixels from source image
 2695|      0|        const __m256i s0 = yy_loadu_256(src + j);
 2696|       |        // s0 = [15 14 13 12 11 10 9 8] [7 6 5 4 3 2 1 0] as u16
 2697|       |
 2698|       |        // Load 16 pixels from corrupted image and pad each u16 to i32
 2699|      0|        const __m256i d0 = yy_loadu_256(dat + j);
 2700|      0|        const __m256i d0h =
 2701|      0|            _mm256_cvtepu16_epi32(_mm256_extracti128_si256(d0, 1));
 2702|      0|        const __m256i d0l = _mm256_cvtepu16_epi32(_mm256_castsi256_si128(d0));
 2703|       |        // d0 = [15 14 13 12 11 10 9 8] [7 6 5 4 3 2 1 0] as u16
 2704|       |        // d0h, d0l = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0] as i32
 2705|       |
 2706|       |        // Load 16 pixels from the filtered image
 2707|      0|        const __m256i flth = yy_loadu_256(flt + j + 8);
 2708|      0|        const __m256i fltl = yy_loadu_256(flt + j);
 2709|       |        // flth, fltl = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0] as i32
 2710|       |
 2711|      0|        const __m256i flth_xq = _mm256_mullo_epi32(flth, xq_active);
 2712|      0|        const __m256i fltl_xq = _mm256_mullo_epi32(fltl, xq_active);
 2713|      0|        const __m256i d0h_xq = _mm256_mullo_epi32(d0h, xq_inactive);
 2714|      0|        const __m256i d0l_xq = _mm256_mullo_epi32(d0l, xq_inactive);
 2715|       |
 2716|      0|        const __m256i vh = _mm256_add_epi32(flth_xq, d0h_xq);
 2717|      0|        const __m256i vl = _mm256_add_epi32(fltl_xq, d0l_xq);
 2718|       |
 2719|       |        // Shift this down with appropriate rounding
 2720|      0|        const __m256i vrh =
 2721|      0|            _mm256_srai_epi32(_mm256_add_epi32(vh, rounding), shift);
 2722|      0|        const __m256i vrl =
 2723|      0|            _mm256_srai_epi32(_mm256_add_epi32(vl, rounding), shift);
 2724|       |        // vrh, vrl = [15 14 13 12] [11 10 9 8], [7 6 5 4] [3 2 1 0] as i32
 2725|       |
 2726|       |        // Saturate each i32 to an i16 then combine both halves
 2727|       |        // The permute (control=[3 1 2 0]) fixes weird ordering from AVX lanes
 2728|      0|        const __m256i vr =
 2729|      0|            _mm256_permute4x64_epi64(_mm256_packs_epi32(vrl, vrh), 0xd8);
 2730|       |        // intermediate = [15 14 13 12 7 6 5 4] [11 10 9 8 3 2 1 0] as u16
 2731|       |        // vr = [15 14 13 12 11 10 9 8] [7 6 5 4 3 2 1 0] as u16
 2732|       |
 2733|       |        // Subtract twin-subspace-sgr filtered from source image to get error
 2734|      0|        const __m256i e0 = _mm256_sub_epi16(_mm256_add_epi16(vr, d0), s0);
 2735|       |
 2736|       |        // Calculate squared error and add adjacent values
 2737|      0|        const __m256i err0 = _mm256_madd_epi16(e0, e0);
 2738|       |
 2739|      0|        sum32 = _mm256_add_epi32(sum32, err0);
 2740|      0|      }
 2741|       |
 2742|      0|      const __m256i sum32l =
 2743|      0|          _mm256_cvtepu32_epi64(_mm256_castsi256_si128(sum32));
 2744|      0|      sum64 = _mm256_add_epi64(sum64, sum32l);
 2745|      0|      const __m256i sum32h =
 2746|      0|          _mm256_cvtepu32_epi64(_mm256_extracti128_si256(sum32, 1));
 2747|      0|      sum64 = _mm256_add_epi64(sum64, sum32h);
 2748|       |
 2749|       |      // Process remaining pixels in this row (modulo 16)
 2750|      0|      for (k = j; k < width; ++k) {
  ------------------
  |  Branch (2750:19): [True: 0, False: 0]
  ------------------
 2751|      0|        const int32_t u = (int32_t)(dat[k] << SGRPROJ_RST_BITS);
  ------------------
  |  |  101|      0|#define SGRPROJ_RST_BITS 4
  ------------------
 2752|      0|        int32_t v = xq_on * (flt[k] - u);
 2753|      0|        const int32_t e = ROUND_POWER_OF_TWO(v, shift) + dat[k] - src[k];
  ------------------
  |  |   41|      0|#define ROUND_POWER_OF_TWO(value, n) (((value) + (((1 << (n)) >> 1))) >> (n))
  ------------------
 2754|      0|        err += ((int64_t)e * e);
 2755|      0|      }
 2756|      0|      dat += dat_stride;
 2757|      0|      src += src_stride;
 2758|      0|      flt += flt_stride;
 2759|      0|    }
 2760|      0|  } else {  // Neither filter is enabled
 2761|      0|    for (i = 0; i < height; ++i) {
  ------------------
  |  Branch (2761:17): [True: 0, False: 0]
  ------------------
 2762|      0|      __m256i sum32 = _mm256_setzero_si256();
 2763|      0|      for (j = 0; j <= width - 32; j += 32) {
  ------------------
  |  Branch (2763:19): [True: 0, False: 0]
  ------------------
 2764|       |        // Load 2x16 u16 from source image
 2765|      0|        const __m256i s0l = yy_loadu_256(src + j);
 2766|      0|        const __m256i s0h = yy_loadu_256(src + j + 16);
 2767|       |
 2768|       |        // Load 2x16 u16 from corrupted image
 2769|      0|        const __m256i d0l = yy_loadu_256(dat + j);
 2770|      0|        const __m256i d0h = yy_loadu_256(dat + j + 16);
 2771|       |
 2772|       |        // Subtract corrupted image from source image
 2773|      0|        const __m256i diffl = _mm256_sub_epi16(d0l, s0l);
 2774|      0|        const __m256i diffh = _mm256_sub_epi16(d0h, s0h);
 2775|       |
 2776|       |        // Square error and add adjacent values
 2777|      0|        const __m256i err0l = _mm256_madd_epi16(diffl, diffl);
 2778|      0|        const __m256i err0h = _mm256_madd_epi16(diffh, diffh);
 2779|       |
 2780|      0|        sum32 = _mm256_add_epi32(sum32, err0l);
 2781|      0|        sum32 = _mm256_add_epi32(sum32, err0h);
 2782|      0|      }
 2783|       |
 2784|      0|      const __m256i sum32l =
 2785|      0|          _mm256_cvtepu32_epi64(_mm256_castsi256_si128(sum32));
 2786|      0|      sum64 = _mm256_add_epi64(sum64, sum32l);
 2787|      0|      const __m256i sum32h =
 2788|      0|          _mm256_cvtepu32_epi64(_mm256_extracti128_si256(sum32, 1));
 2789|      0|      sum64 = _mm256_add_epi64(sum64, sum32h);
 2790|       |
 2791|       |      // Process remaining pixels (modulu 16)
 2792|      0|      for (k = j; k < width; ++k) {
  ------------------
  |  Branch (2792:19): [True: 0, False: 0]
  ------------------
 2793|      0|        const int32_t e = (int32_t)(dat[k]) - src[k];
 2794|      0|        err += ((int64_t)e * e);
 2795|      0|      }
 2796|      0|      dat += dat_stride;
 2797|      0|      src += src_stride;
 2798|      0|    }
 2799|      0|  }
 2800|       |
 2801|       |  // Sum 4 values from sum64l and sum64h into err
 2802|  20.2k|  int64_t sum[4];
 2803|  20.2k|  yy_storeu_256(sum, sum64);
 2804|  20.2k|  err += sum[0] + sum[1] + sum[2] + sum[3];
 2805|  20.2k|  return err;
 2806|  20.2k|}
pickrst_avx2.c:acc_stat_highbd_avx2:
   25|  46.0M|                                        const __m256i *dgd_ijkl) {
   26|       |  // Load two 128-bit chunks from dgd
   27|  46.0M|  const __m256i s0 = _mm256_inserti128_si256(
   28|  46.0M|      _mm256_castsi128_si256(_mm_loadu_si128((__m128i *)dgd)),
   29|  46.0M|      _mm_loadu_si128((__m128i *)(dgd + 4)), 1);
   30|       |  // s0 = [11 10 9 8 7 6 5 4] [7 6 5 4 3 2 1 0] as u16 (values are dgd indices)
   31|       |  // The weird order is so the shuffle stays within 128-bit lanes
   32|       |
   33|       |  // Shuffle 16x u16 values within lanes according to the mask:
   34|       |  // [0 1 1 2 2 3 3 4] [0 1 1 2 2 3 3 4]
   35|       |  // (Actually we shuffle u8 values as there's no 16-bit shuffle)
   36|  46.0M|  const __m256i s1 = _mm256_shuffle_epi8(s0, *shuffle);
   37|       |  // s1 = [8 7 7 6 6 5 5 4] [4 3 3 2 2 1 1 0] as u16 (values are dgd indices)
   38|       |
   39|       |  // Multiply 16x 16-bit integers in dgd_ijkl and s1, resulting in 16x 32-bit
   40|       |  // integers then horizontally add pairs of these integers resulting in 8x
   41|       |  // 32-bit integers
   42|  46.0M|  const __m256i d0 = _mm256_madd_epi16(*dgd_ijkl, s1);
   43|       |  // d0 = [a b c d] [e f g h] as u32
   44|       |
   45|       |  // Take the lower-half of d0, extend to u64, add it on to dst (H)
   46|  46.0M|  const __m256i d0l = _mm256_cvtepu32_epi64(_mm256_extracti128_si256(d0, 0));
   47|       |  // d0l = [a b] [c d] as u64
   48|  46.0M|  const __m256i dst0 = yy_load_256(dst);
   49|  46.0M|  yy_store_256(dst, _mm256_add_epi64(d0l, dst0));
   50|       |
   51|       |  // Take the upper-half of d0, extend to u64, add it on to dst (H)
   52|  46.0M|  const __m256i d0h = _mm256_cvtepu32_epi64(_mm256_extracti128_si256(d0, 1));
   53|       |  // d0h = [e f] [g h] as u64
   54|  46.0M|  const __m256i dst1 = yy_load_256(dst + 4);
   55|  46.0M|  yy_store_256(dst + 4, _mm256_add_epi64(d0h, dst1));
   56|  46.0M|}
pickrst_avx2.c:compute_stats_highbd_win5_opt_avx2:
  291|  2.04k|    int64_t *H, aom_bit_depth_t bit_depth) {
  292|  2.04k|  int i, j, k, l, m, n;
  293|  2.04k|  const int wiener_win = WIENER_WIN_CHROMA;
  ------------------
  |  |  128|  2.04k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  2.04k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  2.04k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|  2.04k|  const int pixel_count = (h_end - h_start) * (v_end - v_start);
  295|  2.04k|  const int wiener_win2 = wiener_win * wiener_win;
  296|  2.04k|  const int wiener_halfwin = (wiener_win >> 1);
  297|  2.04k|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|  2.04k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  298|  2.04k|  const uint16_t *dgd = CONVERT_TO_SHORTPTR(dgd8);
  ------------------
  |  |   79|  2.04k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  299|  2.04k|  const uint16_t avg =
  300|  2.04k|      find_average_highbd(dgd, h_start, h_end, v_start, v_end, dgd_stride);
  301|       |
  302|  2.04k|  int64_t M_int64[WIENER_WIN_CHROMA][WIENER_WIN_CHROMA] = { { 0 } };
  303|  2.04k|  DECLARE_ALIGNED(
  ------------------
  |  |   19|  2.04k|#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
  ------------------
  304|  2.04k|      32, int64_t,
  305|  2.04k|      H_int64[WIENER_WIN2_CHROMA][WIENER_WIN_CHROMA * 8]) = { { 0 } };
  306|  2.04k|  int32_t sumY[WIENER_WIN_CHROMA][WIENER_WIN_CHROMA] = { { 0 } };
  307|  2.04k|  int32_t sumX = 0;
  308|  2.04k|  const uint16_t *dgd_win = dgd - wiener_halfwin * dgd_stride - wiener_halfwin;
  309|       |
  310|  2.04k|  const __m256i shuffle = yy_loadu_256(g_shuffle_stats_highbd_data);
  311|  4.57k|  for (j = v_start; j < v_end; j += 64) {
  ------------------
  |  Branch (311:21): [True: 2.52k, False: 2.04k]
  ------------------
  312|  2.52k|    const int vert_end = AOMMIN(64, v_end - j) + j;
  ------------------
  |  |   34|  2.52k|#define AOMMIN(x, y) (((x) < (y)) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (34:23): [True: 486, False: 2.04k]
  |  |  ------------------
  ------------------
  313|  57.7k|    for (i = j; i < vert_end; i++) {
  ------------------
  |  Branch (313:17): [True: 55.1k, False: 2.52k]
  ------------------
  314|  55.1k|      acc_stat_highbd_win5_one_line_avx2(
  315|  55.1k|          dgd_win + i * dgd_stride, src + i * src_stride, h_start, h_end,
  316|  55.1k|          dgd_stride, &shuffle, &sumX, sumY, M_int64, H_int64);
  317|  55.1k|    }
  318|  2.52k|  }
  319|       |
  320|  2.04k|  uint8_t bit_depth_divider = 1;
  321|  2.04k|  if (bit_depth == AOM_BITS_12)
  ------------------
  |  Branch (321:7): [True: 0, False: 2.04k]
  ------------------
  322|      0|    bit_depth_divider = 16;
  323|  2.04k|  else if (bit_depth == AOM_BITS_10)
  ------------------
  |  Branch (323:12): [True: 2.04k, False: 0]
  ------------------
  324|  2.04k|    bit_depth_divider = 4;
  325|       |
  326|  2.04k|  const int64_t avg_square_sum = (int64_t)avg * (int64_t)avg * pixel_count;
  327|  12.2k|  for (k = 0; k < wiener_win; k++) {
  ------------------
  |  Branch (327:15): [True: 10.2k, False: 2.04k]
  ------------------
  328|  61.2k|    for (l = 0; l < wiener_win; l++) {
  ------------------
  |  Branch (328:17): [True: 51.0k, False: 10.2k]
  ------------------
  329|  51.0k|      const int32_t idx0 = l * wiener_win + k;
  330|  51.0k|      M[idx0] = (M_int64[k][l] +
  331|  51.0k|                 (avg_square_sum - (int64_t)avg * (sumX + sumY[k][l]))) /
  332|  51.0k|                bit_depth_divider;
  333|  51.0k|      int64_t *H_ = H + idx0 * wiener_win2;
  334|  51.0k|      int64_t *H_int_ = &H_int64[idx0][0];
  335|   306k|      for (m = 0; m < wiener_win; m++) {
  ------------------
  |  Branch (335:19): [True: 255k, False: 51.0k]
  ------------------
  336|  1.53M|        for (n = 0; n < wiener_win; n++) {
  ------------------
  |  Branch (336:21): [True: 1.27M, False: 255k]
  ------------------
  337|  1.27M|          H_[m * wiener_win + n] =
  338|  1.27M|              (H_int_[n * 8 + m] +
  339|  1.27M|               (avg_square_sum - (int64_t)avg * (sumY[k][l] + sumY[n][m]))) /
  340|  1.27M|              bit_depth_divider;
  341|  1.27M|        }
  342|   255k|      }
  343|  51.0k|    }
  344|  10.2k|  }
  345|  2.04k|}
pickrst_avx2.c:acc_stat_highbd_win5_one_line_avx2:
  210|  55.1k|    int64_t H_int[WIENER_WIN2_CHROMA][WIENER_WIN_CHROMA * 8]) {
  211|  55.1k|  int j, k, l;
  212|  55.1k|  const int wiener_win = WIENER_WIN_CHROMA;
  ------------------
  |  |  128|  55.1k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  55.1k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  55.1k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|       |  // Main loop handles two pixels at a time
  214|       |  // We can assume that h_start is even, since it will always be aligned to
  215|       |  // a tile edge + some number of restoration units, and both of those will
  216|       |  // be 64-pixel aligned.
  217|       |  // However, at the edge of the image, h_end may be odd, so we need to handle
  218|       |  // that case correctly.
  219|  55.1k|  assert(h_start % 2 == 0);
  220|  55.1k|  const int h_end_even = h_end & ~1;
  221|  55.1k|  const int has_odd_pixel = h_end & 1;
  222|   400k|  for (j = h_start; j < h_end_even; j += 2) {
  ------------------
  |  Branch (222:21): [True: 345k, False: 55.1k]
  ------------------
  223|   345k|    const uint16_t X1 = src[j];
  224|   345k|    const uint16_t X2 = src[j + 1];
  225|   345k|    *sumX += X1 + X2;
  226|   345k|    const uint16_t *dgd_ij = dgd + j;
  227|  2.07M|    for (k = 0; k < wiener_win; k++) {
  ------------------
  |  Branch (227:17): [True: 1.72M, False: 345k]
  ------------------
  228|  1.72M|      const uint16_t *dgd_ijk = dgd_ij + k * dgd_stride;
  229|  10.3M|      for (l = 0; l < wiener_win; l++) {
  ------------------
  |  Branch (229:19): [True: 8.63M, False: 1.72M]
  ------------------
  230|  8.63M|        int64_t *H_ = &H_int[(l * wiener_win + k)][0];
  231|  8.63M|        const uint16_t D1 = dgd_ijk[l];
  232|  8.63M|        const uint16_t D2 = dgd_ijk[l + 1];
  233|  8.63M|        sumY[k][l] += D1 + D2;
  234|  8.63M|        M_int[k][l] += D1 * X1 + D2 * X2;
  235|       |
  236|       |        // Load two u16 values from dgd_ijkl combined as a u32,
  237|       |        // then broadcast to 8x u32 slots of a 256
  238|  8.63M|        const __m256i dgd_ijkl = _mm256_set1_epi32(loadu_int32(dgd_ijk + l));
  239|       |        // dgd_ijkl = [x y x y x y x y] [x y x y x y x y] where each is a u16
  240|       |
  241|  8.63M|        acc_stat_highbd_avx2(H_ + 0 * 8, dgd_ij + 0 * dgd_stride, shuffle,
  242|  8.63M|                             &dgd_ijkl);
  243|  8.63M|        acc_stat_highbd_avx2(H_ + 1 * 8, dgd_ij + 1 * dgd_stride, shuffle,
  244|  8.63M|                             &dgd_ijkl);
  245|  8.63M|        acc_stat_highbd_avx2(H_ + 2 * 8, dgd_ij + 2 * dgd_stride, shuffle,
  246|  8.63M|                             &dgd_ijkl);
  247|  8.63M|        acc_stat_highbd_avx2(H_ + 3 * 8, dgd_ij + 3 * dgd_stride, shuffle,
  248|  8.63M|                             &dgd_ijkl);
  249|  8.63M|        acc_stat_highbd_avx2(H_ + 4 * 8, dgd_ij + 4 * dgd_stride, shuffle,
  250|  8.63M|                             &dgd_ijkl);
  251|  8.63M|      }
  252|  1.72M|    }
  253|   345k|  }
  254|       |  // If the width is odd, add in the final pixel
  255|  55.1k|  if (has_odd_pixel) {
  ------------------
  |  Branch (255:7): [True: 22.7k, False: 32.3k]
  ------------------
  256|  22.7k|    const uint16_t X1 = src[j];
  257|  22.7k|    *sumX += X1;
  258|  22.7k|    const uint16_t *dgd_ij = dgd + j;
  259|   136k|    for (k = 0; k < wiener_win; k++) {
  ------------------
  |  Branch (259:17): [True: 113k, False: 22.7k]
  ------------------
  260|   113k|      const uint16_t *dgd_ijk = dgd_ij + k * dgd_stride;
  261|   683k|      for (l = 0; l < wiener_win; l++) {
  ------------------
  |  Branch (261:19): [True: 569k, False: 113k]
  ------------------
  262|   569k|        int64_t *H_ = &H_int[(l * wiener_win + k)][0];
  263|   569k|        const uint16_t D1 = dgd_ijk[l];
  264|   569k|        sumY[k][l] += D1;
  265|   569k|        M_int[k][l] += D1 * X1;
  266|       |
  267|       |        // The `acc_stat_highbd_avx2` function wants its input to have
  268|       |        // interleaved copies of two pixels, but we only have one. However, the
  269|       |        // pixels are (effectively) used as inputs to a multiply-accumulate. So
  270|       |        // if we set the extra pixel slot to 0, then it is effectively ignored.
  271|   569k|        const __m256i dgd_ijkl = _mm256_set1_epi32((int)D1);
  272|       |
  273|   569k|        acc_stat_highbd_avx2(H_ + 0 * 8, dgd_ij + 0 * dgd_stride, shuffle,
  274|   569k|                             &dgd_ijkl);
  275|   569k|        acc_stat_highbd_avx2(H_ + 1 * 8, dgd_ij + 1 * dgd_stride, shuffle,
  276|   569k|                             &dgd_ijkl);
  277|   569k|        acc_stat_highbd_avx2(H_ + 2 * 8, dgd_ij + 2 * dgd_stride, shuffle,
  278|   569k|                             &dgd_ijkl);
  279|   569k|        acc_stat_highbd_avx2(H_ + 3 * 8, dgd_ij + 3 * dgd_stride, shuffle,
  280|   569k|                             &dgd_ijkl);
  281|   569k|        acc_stat_highbd_avx2(H_ + 4 * 8, dgd_ij + 4 * dgd_stride, shuffle,
  282|   569k|                             &dgd_ijkl);
  283|   569k|      }
  284|   113k|    }
  285|  22.7k|  }
  286|  55.1k|}
pickrst_avx2.c:calc_dgd_buf_avg_avx2:
  470|  7.50k|                                            int32_t v_end, int32_t stride) {
  471|  7.50k|  const uint8_t *src_temp = src + v_start * stride + h_start;
  472|  7.50k|  const __m256i zero = _mm256_setzero_si256();
  473|  7.50k|  const int32_t width = h_end - h_start;
  474|  7.50k|  const int32_t height = v_end - v_start;
  475|  7.50k|  const int32_t wd_beyond_mul32 = width & 31;
  476|  7.50k|  const int32_t wd_mul32 = width - wd_beyond_mul32;
  477|  7.50k|  __m128i mask_low, mask_high;
  478|  7.50k|  __m256i ss = zero;
  479|       |
  480|       |  // When width is not multiple of 32, it still loads 32 and to make the data
  481|       |  // which is extra (beyond required) as zero using the below mask.
  482|  7.50k|  if (wd_beyond_mul32 >= 16) {
  ------------------
  |  Branch (482:7): [True: 1.42k, False: 6.07k]
  ------------------
  483|  1.42k|    mask_low = _mm_set1_epi8(-1);
  484|  1.42k|    mask_high = _mm_loadu_si128((__m128i *)(&mask_8bit[32 - wd_beyond_mul32]));
  485|  6.07k|  } else {
  486|  6.07k|    mask_low = _mm_loadu_si128((__m128i *)(&mask_8bit[16 - wd_beyond_mul32]));
  487|  6.07k|    mask_high = _mm_setzero_si128();
  488|  6.07k|  }
  489|  7.50k|  const __m256i mask =
  490|  7.50k|      _mm256_inserti128_si256(_mm256_castsi128_si256(mask_low), mask_high, 1);
  491|       |
  492|  7.50k|  int32_t proc_ht = 0;
  493|   162k|  do {
  494|       |    // Process width in multiple of 32.
  495|   162k|    int32_t proc_wd = 0;
  496|   443k|    while (proc_wd < wd_mul32) {
  ------------------
  |  Branch (496:12): [True: 280k, False: 162k]
  ------------------
  497|   280k|      const __m256i s_0 = _mm256_loadu_si256((__m256i *)(src_temp + proc_wd));
  498|   280k|      const __m256i sad_0 = _mm256_sad_epu8(s_0, zero);
  499|   280k|      ss = _mm256_add_epi32(ss, sad_0);
  500|   280k|      proc_wd += 32;
  501|   280k|    }
  502|       |
  503|       |    // Process the remaining width.
  504|   162k|    if (wd_beyond_mul32) {
  ------------------
  |  Branch (504:9): [True: 147k, False: 15.0k]
  ------------------
  505|   147k|      const __m256i s_0 = _mm256_loadu_si256((__m256i *)(src_temp + proc_wd));
  506|   147k|      const __m256i s_m_0 = _mm256_and_si256(s_0, mask);
  507|   147k|      const __m256i sad_0 = _mm256_sad_epu8(s_m_0, zero);
  508|   147k|      ss = _mm256_add_epi32(ss, sad_0);
  509|   147k|    }
  510|   162k|    src_temp += stride;
  511|   162k|    proc_ht++;
  512|   162k|  } while (proc_ht < height);
  ------------------
  |  Branch (512:12): [True: 155k, False: 7.50k]
  ------------------
  513|       |
  514|  7.50k|  const uint32_t sum = calc_sum_of_register(ss);
  515|  7.50k|  const uint8_t avg = sum / (width * height);
  516|  7.50k|  return avg;
  517|  7.50k|}
pickrst_avx2.c:calc_sum_of_register:
  417|  7.50k|static inline int32_t calc_sum_of_register(__m256i src) {
  418|  7.50k|  const __m128i src_l = _mm256_castsi256_si128(src);
  419|  7.50k|  const __m128i src_h = _mm256_extracti128_si256(src, 1);
  420|  7.50k|  const __m128i sum = _mm_add_epi32(src_l, src_h);
  421|  7.50k|  const __m128i dst0 = _mm_add_epi32(sum, _mm_srli_si128(sum, 8));
  422|       |  const __m128i dst1 = _mm_add_epi32(dst0, _mm_srli_si128(dst0, 4));
  423|  7.50k|  return _mm_cvtsi128_si32(dst1);
  424|  7.50k|}
pickrst_avx2.c:sub_avg_block_avx2:
  525|  15.0k|                                      int use_downsampled_wiener_stats) {
  526|  15.0k|  const __m256i avg_reg = _mm256_set1_epi16(avg);
  527|       |
  528|  15.0k|  int32_t proc_ht = 0;
  529|   235k|  do {
  530|   235k|    int ds_factor =
  531|   235k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;
  ------------------
  |  |  131|  43.1k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  ------------------
  |  Branch (531:9): [True: 43.1k, False: 192k]
  ------------------
  532|   235k|    if (use_downsampled_wiener_stats &&
  ------------------
  |  Branch (532:9): [True: 43.1k, False: 192k]
  ------------------
  533|  43.1k|        (height - proc_ht < WIENER_STATS_DOWNSAMPLE_FACTOR)) {
  ------------------
  |  |  131|  43.1k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  ------------------
  |  Branch (533:9): [True: 4.72k, False: 38.4k]
  ------------------
  534|  4.72k|      ds_factor = height - proc_ht;
  535|  4.72k|    }
  536|       |
  537|   235k|    int32_t proc_wd = 0;
  538|  1.28M|    while (proc_wd < width) {
  ------------------
  |  Branch (538:12): [True: 1.05M, False: 235k]
  ------------------
  539|  1.05M|      const __m128i s = _mm_loadu_si128((__m128i *)(src + proc_wd));
  540|  1.05M|      const __m256i ss = _mm256_cvtepu8_epi16(s);
  541|  1.05M|      const __m256i d = _mm256_sub_epi16(ss, avg_reg);
  542|  1.05M|      _mm256_storeu_si256((__m256i *)(dst + proc_wd), d);
  543|  1.05M|      proc_wd += 16;
  544|  1.05M|    }
  545|       |
  546|   235k|    src += ds_factor * src_stride;
  547|   235k|    dst += ds_factor * dst_stride;
  548|   235k|    proc_ht += ds_factor;
  549|   235k|  } while (proc_ht < height);
  ------------------
  |  Branch (549:12): [True: 220k, False: 15.0k]
  ------------------
  550|  15.0k|}
pickrst_avx2.c:madd_and_accum_avx2:
  373|  67.3M|static inline void madd_and_accum_avx2(__m256i src, __m256i dgd, __m256i *sum) {
  374|  67.3M|  *sum = _mm256_add_epi32(*sum, _mm256_madd_epi16(src, dgd));
  375|  67.3M|}
pickrst_avx2.c:hadd_four_32_to_64_avx2:
  384|   525k|                                              __m256i *src2, __m256i *src3) {
  385|       |  // 00 01 10 11 02 03 12 13
  386|   525k|  const __m256i s_0 = _mm256_hadd_epi32(src0, src1);
  387|       |  // 20 21 30 31 22 23 32 33
  388|   525k|  const __m256i s_1 = _mm256_hadd_epi32(*src2, *src3);
  389|       |  // 00+01 10+11 20+21 30+31 02+03 12+13 22+23 32+33
  390|   525k|  const __m256i s_2 = _mm256_hadd_epi32(s_0, s_1);
  391|   525k|  return convert_and_add_avx2(s_2);
  392|   525k|}
pickrst_avx2.c:convert_32_to_64_add_avx2:
  409|   112k|static inline __m128i convert_32_to_64_add_avx2(__m256i src0, __m256i src1) {
  410|       |  // 00 01 02 03
  411|   112k|  const __m256i s0 = convert_and_add_avx2(src0);
  412|       |  // 10 11 12 13
  413|   112k|  const __m256i s1 = convert_and_add_avx2(src1);
  414|   112k|  return add_64bit_lvl_avx2(s0, s1);
  415|   112k|}
pickrst_avx2.c:convert_and_add_avx2:
  377|  1.12M|static inline __m256i convert_and_add_avx2(__m256i src) {
  378|  1.12M|  const __m256i s0 = _mm256_cvtepi32_epi64(_mm256_castsi256_si128(src));
  379|       |  const __m256i s1 = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(src, 1));
  380|  1.12M|  return _mm256_add_epi64(s0, s1);
  381|  1.12M|}
pickrst_avx2.c:add_64bit_lvl_avx2:
  394|   487k|static inline __m128i add_64bit_lvl_avx2(__m256i src0, __m256i src1) {
  395|       |  // 00 10 02 12
  396|   487k|  const __m256i t0 = _mm256_unpacklo_epi64(src0, src1);
  397|       |  // 01 11 03 13
  398|   487k|  const __m256i t1 = _mm256_unpackhi_epi64(src0, src1);
  399|       |  // 00+01 10+11 02+03 12+13
  400|   487k|  const __m256i sum = _mm256_add_epi64(t0, t1);
  401|       |  // 00+01 10+11
  402|   487k|  const __m128i sum0 = _mm256_castsi256_si128(sum);
  403|       |  // 02+03 12+13
  404|   487k|  const __m128i sum1 = _mm256_extracti128_si256(sum, 1);
  405|       |  // 00+01+02+03 10+11+12+13
  406|   487k|  return _mm_add_epi64(sum0, sum1);
  407|   487k|}
pickrst_avx2.c:fill_lower_triag_elements_avx2:
  555|  7.50k|                                                  int64_t *const H) {
  556|  52.5k|  for (int32_t i = 0; i < wiener_win2 - 1; i += 4) {
  ------------------
  |  Branch (556:23): [True: 45.0k, False: 7.50k]
  ------------------
  557|  45.0k|    __m256i in[4], out[4];
  558|       |
  559|  45.0k|    in[0] = _mm256_loadu_si256((__m256i *)(H + (i + 0) * wiener_win2 + i + 1));
  560|  45.0k|    in[1] = _mm256_loadu_si256((__m256i *)(H + (i + 1) * wiener_win2 + i + 1));
  561|  45.0k|    in[2] = _mm256_loadu_si256((__m256i *)(H + (i + 2) * wiener_win2 + i + 1));
  562|  45.0k|    in[3] = _mm256_loadu_si256((__m256i *)(H + (i + 3) * wiener_win2 + i + 1));
  563|       |
  564|  45.0k|    transpose_64bit_4x4_avx2(in, out);
  565|       |
  566|  45.0k|    _mm_storel_epi64((__m128i *)(H + (i + 1) * wiener_win2 + i),
  567|  45.0k|                     _mm256_castsi256_si128(out[0]));
  568|  45.0k|    _mm_storeu_si128((__m128i *)(H + (i + 2) * wiener_win2 + i),
  569|  45.0k|                     _mm256_castsi256_si128(out[1]));
  570|  45.0k|    _mm256_storeu_si256((__m256i *)(H + (i + 3) * wiener_win2 + i), out[2]);
  571|  45.0k|    _mm256_storeu_si256((__m256i *)(H + (i + 4) * wiener_win2 + i), out[3]);
  572|       |
  573|   157k|    for (int32_t j = i + 5; j < wiener_win2; j += 4) {
  ------------------
  |  Branch (573:29): [True: 112k, False: 45.0k]
  ------------------
  574|   112k|      in[0] = _mm256_loadu_si256((__m256i *)(H + (i + 0) * wiener_win2 + j));
  575|   112k|      in[1] = _mm256_loadu_si256((__m256i *)(H + (i + 1) * wiener_win2 + j));
  576|   112k|      in[2] = _mm256_loadu_si256((__m256i *)(H + (i + 2) * wiener_win2 + j));
  577|   112k|      in[3] = _mm256_loadu_si256((__m256i *)(H + (i + 3) * wiener_win2 + j));
  578|       |
  579|   112k|      transpose_64bit_4x4_avx2(in, out);
  580|       |
  581|   112k|      _mm256_storeu_si256((__m256i *)(H + (j + 0) * wiener_win2 + i), out[0]);
  582|   112k|      _mm256_storeu_si256((__m256i *)(H + (j + 1) * wiener_win2 + i), out[1]);
  583|   112k|      _mm256_storeu_si256((__m256i *)(H + (j + 2) * wiener_win2 + i), out[2]);
  584|   112k|      _mm256_storeu_si256((__m256i *)(H + (j + 3) * wiener_win2 + i), out[3]);
  585|   112k|    }
  586|  45.0k|  }
  587|  7.50k|}
pickrst_avx2.c:transpose_64bit_4x4_avx2:
  427|   157k|                                            __m256i *const dst) {
  428|       |  // Unpack 64 bit elements. Goes from:
  429|       |  // src[0]: 00 01 02 03
  430|       |  // src[1]: 10 11 12 13
  431|       |  // src[2]: 20 21 22 23
  432|       |  // src[3]: 30 31 32 33
  433|       |  // to:
  434|       |  // reg0:    00 10 02 12
  435|       |  // reg1:    20 30 22 32
  436|       |  // reg2:    01 11 03 13
  437|       |  // reg3:    21 31 23 33
  438|   157k|  const __m256i reg0 = _mm256_unpacklo_epi64(src[0], src[1]);
  439|   157k|  const __m256i reg1 = _mm256_unpacklo_epi64(src[2], src[3]);
  440|   157k|  const __m256i reg2 = _mm256_unpackhi_epi64(src[0], src[1]);
  441|   157k|  const __m256i reg3 = _mm256_unpackhi_epi64(src[2], src[3]);
  442|       |
  443|       |  // Unpack 64 bit elements resulting in:
  444|       |  // dst[0]: 00 10 20 30
  445|       |  // dst[1]: 01 11 21 31
  446|       |  // dst[2]: 02 12 22 32
  447|       |  // dst[3]: 03 13 23 33
  448|   157k|  dst[0] = _mm256_inserti128_si256(reg0, _mm256_castsi256_si128(reg1), 1);
  449|   157k|  dst[1] = _mm256_inserti128_si256(reg2, _mm256_castsi256_si128(reg3), 1);
  450|   157k|  dst[2] = _mm256_inserti128_si256(reg1, _mm256_extracti128_si256(reg0, 1), 0);
  451|       |  dst[3] = _mm256_inserti128_si256(reg3, _mm256_extracti128_si256(reg2, 1), 0);
  452|   157k|}
pickrst_avx2.c:compute_stats_win5_avx2:
  758|  7.50k|                                    int use_downsampled_wiener_stats) {
  759|  7.50k|  const int32_t wiener_win = WIENER_WIN_CHROMA;
  ------------------
  |  |  128|  7.50k|#define WIENER_WIN_CHROMA (WIENER_WIN - 2)
  |  |  ------------------
  |  |  |  |  121|  7.50k|#define WIENER_WIN (2 * WIENER_HALFWIN + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  7.50k|#define WIENER_HALFWIN 3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  760|  7.50k|  const int32_t wiener_win2 = wiener_win * wiener_win;
  761|       |  // Amount of width which is beyond multiple of 16. This case is handled
  762|       |  // appropriately to process only the required width towards the end.
  763|  7.50k|  const int32_t wd_mul16 = width & ~15;
  764|  7.50k|  const int32_t wd_beyond_mul16 = width - wd_mul16;
  765|  7.50k|  const __m256i mask =
  766|  7.50k|      _mm256_loadu_si256((__m256i *)(&mask_16bit[16 - wd_beyond_mul16]));
  767|  7.50k|  int downsample_factor;
  768|       |
  769|       |  // Step 1: Full M (i.e., M0 to M24) and first row H (i.e., H00 to H024)
  770|       |  // values are filled here. Here, the loop over 'j' is executed for values 0
  771|       |  // to 4 (wiener_win-1). When the loop executed for a specific 'j', 5 values of
  772|       |  // M and H are filled as shown below.
  773|       |  // j=0: M0-M4 and H00-H04, j=1: M5-M9 and H05-H09 are filled etc,.
  774|  7.50k|  int j = 0;
  775|  37.5k|  do {
  776|  37.5k|    const int16_t *s_t = s;
  777|  37.5k|    const int16_t *d_t = d;
  778|  37.5k|    __m256i sum_m[WIENER_WIN_CHROMA] = { _mm256_setzero_si256() };
  779|  37.5k|    __m256i sum_h[WIENER_WIN_CHROMA] = { _mm256_setzero_si256() };
  780|  37.5k|    downsample_factor =
  781|  37.5k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;
  ------------------
  |  |  131|  37.5k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  ------------------
  |  Branch (781:9): [True: 37.5k, False: 0]
  ------------------
  782|  37.5k|    int proc_ht = v_start;
  783|   215k|    do {
  784|   215k|      UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   215k|  int proc_wd = 0;                                            \
  |  |  621|   215k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 215k, False: 0]
  |  |  ------------------
  |  |  622|   215k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   215k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 23.6k, False: 192k]
  |  |  ------------------
  |  |  623|  23.6k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  23.6k|  }                                                           \
  |  |  625|   215k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
  785|       |
  786|       |      // Process the amount of width multiple of 16.
  787|   986k|      while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (787:14): [True: 770k, False: 215k]
  ------------------
  788|   770k|        const __m256i src = _mm256_loadu_si256((__m256i *)(s_t + proc_wd));
  789|   770k|        const __m256i dgd = _mm256_loadu_si256((__m256i *)(d_t + proc_wd));
  790|   770k|        const __m256i src_mul_df = _mm256_mullo_epi16(src, df_reg);
  791|   770k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
  792|   770k|        INIT_MH_VALUES(d_t + j + proc_wd)
  ------------------
  |  |  599|  4.62M|  for (int g = 0; g < wiener_win; g++) {                       \
  |  |  ------------------
  |  |  |  Branch (599:19): [True: 3.85M, False: 770k]
  |  |  ------------------
  |  |  600|  3.85M|    const __m256i dgds_0 =                                     \
  |  |  601|  3.85M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  602|  3.85M|    madd_and_accum_avx2(src_mul_df, dgds_0, &sum_m[g]);        \
  |  |  603|  3.85M|    madd_and_accum_avx2(dgd_mul_df, dgds_0, &sum_h[g]);        \
  |  |  604|  3.85M|  }
  ------------------
  793|       |
  794|   770k|        proc_wd += 16;
  795|   770k|      }
  796|       |
  797|       |      // Process the remaining width here.
  798|   215k|      if (wd_beyond_mul16) {
  ------------------
  |  Branch (798:11): [True: 191k, False: 23.8k]
  ------------------
  799|   191k|        const __m256i src = _mm256_loadu_si256((__m256i *)(s_t + proc_wd));
  800|   191k|        const __m256i dgd = _mm256_loadu_si256((__m256i *)(d_t + proc_wd));
  801|   191k|        const __m256i src_mask = _mm256_and_si256(src, mask);
  802|   191k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
  803|   191k|        const __m256i src_mul_df = _mm256_mullo_epi16(src_mask, df_reg);
  804|   191k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
  805|   191k|        INIT_MH_VALUES(d_t + j + proc_wd)
  ------------------
  |  |  599|  1.15M|  for (int g = 0; g < wiener_win; g++) {                       \
  |  |  ------------------
  |  |  |  Branch (599:19): [True: 959k, False: 191k]
  |  |  ------------------
  |  |  600|   959k|    const __m256i dgds_0 =                                     \
  |  |  601|   959k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  602|   959k|    madd_and_accum_avx2(src_mul_df, dgds_0, &sum_m[g]);        \
  |  |  603|   959k|    madd_and_accum_avx2(dgd_mul_df, dgds_0, &sum_h[g]);        \
  |  |  604|   959k|  }
  ------------------
  806|   191k|      }
  807|   215k|      proc_ht += downsample_factor;
  808|   215k|      s_t += downsample_factor * s_stride;
  809|   215k|      d_t += downsample_factor * d_stride;
  810|   215k|    } while (proc_ht < v_end);
  ------------------
  |  Branch (810:14): [True: 178k, False: 37.5k]
  ------------------
  811|       |
  812|  37.5k|    const __m256i s_m =
  813|  37.5k|        hadd_four_32_to_64_avx2(sum_m[0], sum_m[1], &sum_m[2], &sum_m[3]);
  814|  37.5k|    const __m128i s_m_h = convert_32_to_64_add_avx2(sum_m[4], sum_h[4]);
  815|  37.5k|    _mm256_storeu_si256((__m256i *)(M + wiener_win * j), s_m);
  816|  37.5k|    _mm_storel_epi64((__m128i *)&M[wiener_win * j + 4], s_m_h);
  817|       |
  818|  37.5k|    const __m256i s_h =
  819|  37.5k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);
  820|  37.5k|    _mm256_storeu_si256((__m256i *)(H + wiener_win * j), s_h);
  821|  37.5k|    _mm_storeh_epi64((__m128i *)&H[wiener_win * j + 4], s_m_h);
  822|  37.5k|  } while (++j < wiener_win);
  ------------------
  |  Branch (822:12): [True: 30.0k, False: 7.50k]
  ------------------
  823|       |
  824|       |  // The below steps are designed to fill remaining rows of H buffer. Here, aim
  825|       |  // is to fill only upper triangle elements correspond to each row and lower
  826|       |  // triangle elements are copied from upper-triangle elements. Also, as
  827|       |  // mentioned in Step 1, the core function is designed to fill 5
  828|       |  // elements/stats/values of H buffer.
  829|       |  //
  830|       |  // Step 2: Here, the rows 1, 6, 11, 16 and 21 are filled. As we need to fill
  831|       |  // only upper-triangle elements, H10 from row1, H60-H64 and H65 from row6,etc,
  832|       |  // are need not be filled. As the core function process 5 values, in first
  833|       |  // iteration of 'j' only 4 values to be filled i.e., H11-H14 from row1,H66-H69
  834|       |  // from row6, etc.
  835|  45.0k|  for (int i = 1; i < wiener_win2; i += wiener_win) {
  ------------------
  |  Branch (835:19): [True: 37.5k, False: 7.50k]
  ------------------
  836|       |    // Update the dgd pointers appropriately and also derive the 'j'th iteration
  837|       |    // from where the H buffer filling needs to be started.
  838|  37.5k|    INITIALIZATION(WIENER_WIN_CHROMA)
  ------------------
  |  |  608|  37.5k|  j = i / (wiener_window_sz);                                            \
  |  |  609|  37.5k|  const int16_t *d_window = d + j;                                       \
  |  |  610|  37.5k|  const int16_t *d_current_row =                                         \
  |  |  611|  37.5k|      d + j + ((i % (wiener_window_sz)) * d_stride);                     \
  |  |  612|  37.5k|  int proc_ht = v_start;                                                 \
  |  |  613|  37.5k|  downsample_factor =                                                    \
  |  |  614|  37.5k|      use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1; \
  |  |  ------------------
  |  |  |  |  131|  37.5k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (614:7): [True: 37.5k, False: 0]
  |  |  ------------------
  |  |  615|  37.5k|  __m256i sum_h[wiener_window_sz];                                       \
  |  |  616|  37.5k|  memset(sum_h, 0, sizeof(sum_h));
  ------------------
  839|       |
  840|   215k|    do {
  841|   215k|      UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   215k|  int proc_wd = 0;                                            \
  |  |  621|   215k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 215k, False: 0]
  |  |  ------------------
  |  |  622|   215k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   215k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 23.6k, False: 192k]
  |  |  ------------------
  |  |  623|  23.6k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  23.6k|  }                                                           \
  |  |  625|   215k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
  842|       |
  843|       |      // Process the amount of width multiple of 16.
  844|   986k|      while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (844:14): [True: 770k, False: 215k]
  ------------------
  845|   770k|        const __m256i dgd =
  846|   770k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  847|   770k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
  848|   770k|        INIT_H_VALUES(d_window + proc_wd + (1 * d_stride), 4)
  ------------------
  |  |  591|  3.85M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 3.08M, False: 770k]
  |  |  ------------------
  |  |  592|  3.08M|    const __m256i dgd0 =                                       \
  |  |  593|  3.08M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|  3.08M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|  3.08M|  }
  ------------------
  849|       |
  850|   770k|        proc_wd += 16;
  851|   770k|      }
  852|       |
  853|       |      // Process the remaining width here.
  854|   215k|      if (wd_beyond_mul16) {
  ------------------
  |  Branch (854:11): [True: 191k, False: 23.8k]
  ------------------
  855|   191k|        const __m256i dgd =
  856|   191k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  857|   191k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
  858|   191k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
  859|   191k|        INIT_H_VALUES(d_window + proc_wd + (1 * d_stride), 4)
  ------------------
  |  |  591|   959k|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 767k, False: 191k]
  |  |  ------------------
  |  |  592|   767k|    const __m256i dgd0 =                                       \
  |  |  593|   767k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|   767k|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|   767k|  }
  ------------------
  860|   191k|      }
  861|   215k|      proc_ht += downsample_factor;
  862|   215k|      d_window += downsample_factor * d_stride;
  863|   215k|      d_current_row += downsample_factor * d_stride;
  864|   215k|    } while (proc_ht < v_end);
  ------------------
  |  Branch (864:14): [True: 178k, False: 37.5k]
  ------------------
  865|  37.5k|    const __m256i s_h =
  866|  37.5k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);
  867|  37.5k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + i), s_h);
  868|       |
  869|       |    // process the remaining 'j' iterations.
  870|  37.5k|    j++;
  871|  37.5k|    CALCULATE_REMAINING_H_WIN5
  ------------------
  |  |  628|   112k|  while (j < wiener_win) {                                                     \
  |  |  ------------------
  |  |  |  Branch (628:10): [True: 75.0k, False: 37.5k]
  |  |  ------------------
  |  |  629|  75.0k|    d_window = d;                                                              \
  |  |  630|  75.0k|    d_current_row = d + (i / wiener_win) + ((i % wiener_win) * d_stride);      \
  |  |  631|  75.0k|    const __m256i zero = _mm256_setzero_si256();                               \
  |  |  632|  75.0k|    sum_h[0] = zero;                                                           \
  |  |  633|  75.0k|    sum_h[1] = zero;                                                           \
  |  |  634|  75.0k|    sum_h[2] = zero;                                                           \
  |  |  635|  75.0k|    sum_h[3] = zero;                                                           \
  |  |  636|  75.0k|    sum_h[4] = zero;                                                           \
  |  |  637|  75.0k|                                                                               \
  |  |  638|  75.0k|    proc_ht = v_start;                                                         \
  |  |  639|  75.0k|    downsample_factor =                                                        \
  |  |  640|  75.0k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;     \
  |  |  ------------------
  |  |  |  |  131|  75.0k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (640:9): [True: 75.0k, False: 0]
  |  |  ------------------
  |  |  641|   431k|    do {                                                                       \
  |  |  642|   431k|      UPDATE_DOWNSAMPLE_FACTOR;                                                \
  |  |  ------------------
  |  |  |  |  620|   431k|  int proc_wd = 0;                                            \
  |  |  |  |  621|   431k|  if (use_downsampled_wiener_stats &&                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (621:7): [True: 431k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  622|   431k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   431k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (622:7): [True: 47.2k, False: 384k]
  |  |  |  |  ------------------
  |  |  |  |  623|  47.2k|    downsample_factor = v_end - proc_ht;                      \
  |  |  |  |  624|  47.2k|  }                                                           \
  |  |  |  |  625|   431k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  |  |  ------------------
  |  |  643|   431k|                                                                               \
  |  |  644|   431k|      /* Process the amount of width multiple of 16.*/                         \
  |  |  645|  1.97M|      while (proc_wd < wd_mul16) {                                             \
  |  |  ------------------
  |  |  |  Branch (645:14): [True: 1.54M, False: 431k]
  |  |  ------------------
  |  |  646|  1.54M|        const __m256i dgd =                                                    \
  |  |  647|  1.54M|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  648|  1.54M|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);            \
  |  |  649|  1.54M|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  9.24M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 7.70M, False: 1.54M]
  |  |  |  |  ------------------
  |  |  |  |  592|  7.70M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  7.70M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  7.70M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  7.70M|  }
  |  |  ------------------
  |  |  650|  1.54M|                                                                               \
  |  |  651|  1.54M|        proc_wd += 16;                                                         \
  |  |  652|  1.54M|      };                                                                       \
  |  |  653|   431k|                                                                               \
  |  |  654|   431k|      /* Process the remaining width here. */                                  \
  |  |  655|   431k|      if (wd_beyond_mul16) {                                                   \
  |  |  ------------------
  |  |  |  Branch (655:11): [True: 383k, False: 47.7k]
  |  |  ------------------
  |  |  656|   383k|        const __m256i dgd =                                                    \
  |  |  657|   383k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  658|   383k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);                  \
  |  |  659|   383k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);       \
  |  |  660|   383k|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  2.30M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 1.91M, False: 383k]
  |  |  |  |  ------------------
  |  |  |  |  592|  1.91M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  1.91M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  1.91M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  1.91M|  }
  |  |  ------------------
  |  |  661|   383k|      }                                                                        \
  |  |  662|   431k|      proc_ht += downsample_factor;                                            \
  |  |  663|   431k|      d_window += downsample_factor * d_stride;                                \
  |  |  664|   431k|      d_current_row += downsample_factor * d_stride;                           \
  |  |  665|   431k|    } while (proc_ht < v_end);                                                 \
  |  |  ------------------
  |  |  |  Branch (665:14): [True: 356k, False: 75.0k]
  |  |  ------------------
  |  |  666|  75.0k|    const __m256i s_h0 =                                                       \
  |  |  667|  75.0k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);     \
  |  |  668|  75.0k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + (wiener_win * j)), \
  |  |  669|  75.0k|                        s_h0);                                                 \
  |  |  670|  75.0k|    const __m256i s_m_h = convert_and_add_avx2(sum_h[4]);                      \
  |  |  671|  75.0k|    const __m128i s_m_h0 = add_64bit_lvl_avx2(s_m_h, s_m_h);                   \
  |  |  672|  75.0k|    _mm_storel_epi64(                                                          \
  |  |  673|  75.0k|        (__m128i *)(H + (i * wiener_win2) + (wiener_win * j) + 4), s_m_h0);    \
  |  |  674|  75.0k|    j++;                                                                       \
  |  |  675|  75.0k|  }
  ------------------
  872|  37.5k|  }
  873|       |
  874|       |  // Step 3: Here, the rows 2, 7, 12, 17 and 22 are filled. As we need to fill
  875|       |  // only upper-triangle elements, H20-H21 from row2, H70-H74 and H75-H76 from
  876|       |  // row7, etc, are need not be filled. As the core function process 5 values,
  877|       |  // in first iteration of 'j' only 3 values to be filled i.e., H22-H24 from
  878|       |  // row2, H77-H79 from row7, etc.
  879|  45.0k|  for (int i = 2; i < wiener_win2; i += wiener_win) {
  ------------------
  |  Branch (879:19): [True: 37.5k, False: 7.50k]
  ------------------
  880|       |    // Update the dgd pointers appropriately and also derive the 'j'th iteration
  881|       |    // from where the H buffer filling needs to be started.
  882|  37.5k|    INITIALIZATION(WIENER_WIN_CHROMA)
  ------------------
  |  |  608|  37.5k|  j = i / (wiener_window_sz);                                            \
  |  |  609|  37.5k|  const int16_t *d_window = d + j;                                       \
  |  |  610|  37.5k|  const int16_t *d_current_row =                                         \
  |  |  611|  37.5k|      d + j + ((i % (wiener_window_sz)) * d_stride);                     \
  |  |  612|  37.5k|  int proc_ht = v_start;                                                 \
  |  |  613|  37.5k|  downsample_factor =                                                    \
  |  |  614|  37.5k|      use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1; \
  |  |  ------------------
  |  |  |  |  131|  37.5k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (614:7): [True: 37.5k, False: 0]
  |  |  ------------------
  |  |  615|  37.5k|  __m256i sum_h[wiener_window_sz];                                       \
  |  |  616|  37.5k|  memset(sum_h, 0, sizeof(sum_h));
  ------------------
  883|       |
  884|   215k|    do {
  885|   215k|      UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   215k|  int proc_wd = 0;                                            \
  |  |  621|   215k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 215k, False: 0]
  |  |  ------------------
  |  |  622|   215k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   215k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 23.6k, False: 192k]
  |  |  ------------------
  |  |  623|  23.6k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  23.6k|  }                                                           \
  |  |  625|   215k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
  886|       |
  887|       |      // Process the amount of width multiple of 16.
  888|   986k|      while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (888:14): [True: 770k, False: 215k]
  ------------------
  889|   770k|        const __m256i dgd =
  890|   770k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  891|   770k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
  892|   770k|        INIT_H_VALUES(d_window + proc_wd + (2 * d_stride), 3)
  ------------------
  |  |  591|  3.08M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 2.31M, False: 770k]
  |  |  ------------------
  |  |  592|  2.31M|    const __m256i dgd0 =                                       \
  |  |  593|  2.31M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|  2.31M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|  2.31M|  }
  ------------------
  893|       |
  894|   770k|        proc_wd += 16;
  895|   770k|      }
  896|       |
  897|       |      // Process the remaining width here.
  898|   215k|      if (wd_beyond_mul16) {
  ------------------
  |  Branch (898:11): [True: 191k, False: 23.8k]
  ------------------
  899|   191k|        const __m256i dgd =
  900|   191k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  901|   191k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
  902|   191k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
  903|   191k|        INIT_H_VALUES(d_window + proc_wd + (2 * d_stride), 3)
  ------------------
  |  |  591|   767k|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 575k, False: 191k]
  |  |  ------------------
  |  |  592|   575k|    const __m256i dgd0 =                                       \
  |  |  593|   575k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|   575k|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|   575k|  }
  ------------------
  904|   191k|      }
  905|   215k|      proc_ht += downsample_factor;
  906|   215k|      d_window += downsample_factor * d_stride;
  907|   215k|      d_current_row += downsample_factor * d_stride;
  908|   215k|    } while (proc_ht < v_end);
  ------------------
  |  Branch (908:14): [True: 178k, False: 37.5k]
  ------------------
  909|  37.5k|    const __m256i s_h =
  910|  37.5k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);
  911|  37.5k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + i), s_h);
  912|       |
  913|       |    // process the remaining 'j' iterations.
  914|  37.5k|    j++;
  915|  37.5k|    CALCULATE_REMAINING_H_WIN5
  ------------------
  |  |  628|   112k|  while (j < wiener_win) {                                                     \
  |  |  ------------------
  |  |  |  Branch (628:10): [True: 75.0k, False: 37.5k]
  |  |  ------------------
  |  |  629|  75.0k|    d_window = d;                                                              \
  |  |  630|  75.0k|    d_current_row = d + (i / wiener_win) + ((i % wiener_win) * d_stride);      \
  |  |  631|  75.0k|    const __m256i zero = _mm256_setzero_si256();                               \
  |  |  632|  75.0k|    sum_h[0] = zero;                                                           \
  |  |  633|  75.0k|    sum_h[1] = zero;                                                           \
  |  |  634|  75.0k|    sum_h[2] = zero;                                                           \
  |  |  635|  75.0k|    sum_h[3] = zero;                                                           \
  |  |  636|  75.0k|    sum_h[4] = zero;                                                           \
  |  |  637|  75.0k|                                                                               \
  |  |  638|  75.0k|    proc_ht = v_start;                                                         \
  |  |  639|  75.0k|    downsample_factor =                                                        \
  |  |  640|  75.0k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;     \
  |  |  ------------------
  |  |  |  |  131|  75.0k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (640:9): [True: 75.0k, False: 0]
  |  |  ------------------
  |  |  641|   431k|    do {                                                                       \
  |  |  642|   431k|      UPDATE_DOWNSAMPLE_FACTOR;                                                \
  |  |  ------------------
  |  |  |  |  620|   431k|  int proc_wd = 0;                                            \
  |  |  |  |  621|   431k|  if (use_downsampled_wiener_stats &&                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (621:7): [True: 431k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  622|   431k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   431k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (622:7): [True: 47.2k, False: 384k]
  |  |  |  |  ------------------
  |  |  |  |  623|  47.2k|    downsample_factor = v_end - proc_ht;                      \
  |  |  |  |  624|  47.2k|  }                                                           \
  |  |  |  |  625|   431k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  |  |  ------------------
  |  |  643|   431k|                                                                               \
  |  |  644|   431k|      /* Process the amount of width multiple of 16.*/                         \
  |  |  645|  1.97M|      while (proc_wd < wd_mul16) {                                             \
  |  |  ------------------
  |  |  |  Branch (645:14): [True: 1.54M, False: 431k]
  |  |  ------------------
  |  |  646|  1.54M|        const __m256i dgd =                                                    \
  |  |  647|  1.54M|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  648|  1.54M|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);            \
  |  |  649|  1.54M|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  9.24M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 7.70M, False: 1.54M]
  |  |  |  |  ------------------
  |  |  |  |  592|  7.70M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  7.70M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  7.70M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  7.70M|  }
  |  |  ------------------
  |  |  650|  1.54M|                                                                               \
  |  |  651|  1.54M|        proc_wd += 16;                                                         \
  |  |  652|  1.54M|      };                                                                       \
  |  |  653|   431k|                                                                               \
  |  |  654|   431k|      /* Process the remaining width here. */                                  \
  |  |  655|   431k|      if (wd_beyond_mul16) {                                                   \
  |  |  ------------------
  |  |  |  Branch (655:11): [True: 383k, False: 47.7k]
  |  |  ------------------
  |  |  656|   383k|        const __m256i dgd =                                                    \
  |  |  657|   383k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  658|   383k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);                  \
  |  |  659|   383k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);       \
  |  |  660|   383k|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  2.30M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 1.91M, False: 383k]
  |  |  |  |  ------------------
  |  |  |  |  592|  1.91M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  1.91M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  1.91M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  1.91M|  }
  |  |  ------------------
  |  |  661|   383k|      }                                                                        \
  |  |  662|   431k|      proc_ht += downsample_factor;                                            \
  |  |  663|   431k|      d_window += downsample_factor * d_stride;                                \
  |  |  664|   431k|      d_current_row += downsample_factor * d_stride;                           \
  |  |  665|   431k|    } while (proc_ht < v_end);                                                 \
  |  |  ------------------
  |  |  |  Branch (665:14): [True: 356k, False: 75.0k]
  |  |  ------------------
  |  |  666|  75.0k|    const __m256i s_h0 =                                                       \
  |  |  667|  75.0k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);     \
  |  |  668|  75.0k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + (wiener_win * j)), \
  |  |  669|  75.0k|                        s_h0);                                                 \
  |  |  670|  75.0k|    const __m256i s_m_h = convert_and_add_avx2(sum_h[4]);                      \
  |  |  671|  75.0k|    const __m128i s_m_h0 = add_64bit_lvl_avx2(s_m_h, s_m_h);                   \
  |  |  672|  75.0k|    _mm_storel_epi64(                                                          \
  |  |  673|  75.0k|        (__m128i *)(H + (i * wiener_win2) + (wiener_win * j) + 4), s_m_h0);    \
  |  |  674|  75.0k|    j++;                                                                       \
  |  |  675|  75.0k|  }
  ------------------
  916|  37.5k|  }
  917|       |
  918|       |  // Step 4: Here, the rows 3, 8, 13, 18 and 23 are filled. As we need to fill
  919|       |  // only upper-triangle elements, H30-H32 from row3, H80-H84 and H85-H87 from
  920|       |  // row8, etc, are need not be filled. As the core function process 5 values,
  921|       |  // in first iteration of 'j' only 2 values to be filled i.e., H33-H34 from
  922|       |  // row3, H88-89 from row8, etc.
  923|  45.0k|  for (int i = 3; i < wiener_win2; i += wiener_win) {
  ------------------
  |  Branch (923:19): [True: 37.5k, False: 7.50k]
  ------------------
  924|       |    // Update the dgd pointers appropriately and also derive the 'j'th iteration
  925|       |    // from where the H buffer filling needs to be started.
  926|  37.5k|    INITIALIZATION(WIENER_WIN_CHROMA)
  ------------------
  |  |  608|  37.5k|  j = i / (wiener_window_sz);                                            \
  |  |  609|  37.5k|  const int16_t *d_window = d + j;                                       \
  |  |  610|  37.5k|  const int16_t *d_current_row =                                         \
  |  |  611|  37.5k|      d + j + ((i % (wiener_window_sz)) * d_stride);                     \
  |  |  612|  37.5k|  int proc_ht = v_start;                                                 \
  |  |  613|  37.5k|  downsample_factor =                                                    \
  |  |  614|  37.5k|      use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1; \
  |  |  ------------------
  |  |  |  |  131|  37.5k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (614:7): [True: 37.5k, False: 0]
  |  |  ------------------
  |  |  615|  37.5k|  __m256i sum_h[wiener_window_sz];                                       \
  |  |  616|  37.5k|  memset(sum_h, 0, sizeof(sum_h));
  ------------------
  927|       |
  928|   215k|    do {
  929|   215k|      UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   215k|  int proc_wd = 0;                                            \
  |  |  621|   215k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 215k, False: 0]
  |  |  ------------------
  |  |  622|   215k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   215k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 23.6k, False: 192k]
  |  |  ------------------
  |  |  623|  23.6k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  23.6k|  }                                                           \
  |  |  625|   215k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
  930|       |
  931|       |      // Process the amount of width multiple of 16.
  932|   986k|      while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (932:14): [True: 770k, False: 215k]
  ------------------
  933|   770k|        const __m256i dgd =
  934|   770k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  935|   770k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
  936|   770k|        INIT_H_VALUES(d_window + proc_wd + (3 * d_stride), 2)
  ------------------
  |  |  591|  2.31M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 1.54M, False: 770k]
  |  |  ------------------
  |  |  592|  1.54M|    const __m256i dgd0 =                                       \
  |  |  593|  1.54M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|  1.54M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|  1.54M|  }
  ------------------
  937|       |
  938|   770k|        proc_wd += 16;
  939|   770k|      }
  940|       |
  941|       |      // Process the remaining width here.
  942|   215k|      if (wd_beyond_mul16) {
  ------------------
  |  Branch (942:11): [True: 191k, False: 23.8k]
  ------------------
  943|   191k|        const __m256i dgd =
  944|   191k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  945|   191k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
  946|   191k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
  947|   191k|        INIT_H_VALUES(d_window + proc_wd + (3 * d_stride), 2)
  ------------------
  |  |  591|   575k|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 383k, False: 191k]
  |  |  ------------------
  |  |  592|   383k|    const __m256i dgd0 =                                       \
  |  |  593|   383k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|   383k|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|   383k|  }
  ------------------
  948|   191k|      }
  949|   215k|      proc_ht += downsample_factor;
  950|   215k|      d_window += downsample_factor * d_stride;
  951|   215k|      d_current_row += downsample_factor * d_stride;
  952|   215k|    } while (proc_ht < v_end);
  ------------------
  |  Branch (952:14): [True: 178k, False: 37.5k]
  ------------------
  953|  37.5k|    const __m128i s_h = convert_32_to_64_add_avx2(sum_h[0], sum_h[1]);
  954|  37.5k|    _mm_storeu_si128((__m128i *)(H + (i * wiener_win2) + i), s_h);
  955|       |
  956|       |    // process the remaining 'j' iterations.
  957|  37.5k|    j++;
  958|  37.5k|    CALCULATE_REMAINING_H_WIN5
  ------------------
  |  |  628|   112k|  while (j < wiener_win) {                                                     \
  |  |  ------------------
  |  |  |  Branch (628:10): [True: 75.0k, False: 37.5k]
  |  |  ------------------
  |  |  629|  75.0k|    d_window = d;                                                              \
  |  |  630|  75.0k|    d_current_row = d + (i / wiener_win) + ((i % wiener_win) * d_stride);      \
  |  |  631|  75.0k|    const __m256i zero = _mm256_setzero_si256();                               \
  |  |  632|  75.0k|    sum_h[0] = zero;                                                           \
  |  |  633|  75.0k|    sum_h[1] = zero;                                                           \
  |  |  634|  75.0k|    sum_h[2] = zero;                                                           \
  |  |  635|  75.0k|    sum_h[3] = zero;                                                           \
  |  |  636|  75.0k|    sum_h[4] = zero;                                                           \
  |  |  637|  75.0k|                                                                               \
  |  |  638|  75.0k|    proc_ht = v_start;                                                         \
  |  |  639|  75.0k|    downsample_factor =                                                        \
  |  |  640|  75.0k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;     \
  |  |  ------------------
  |  |  |  |  131|  75.0k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (640:9): [True: 75.0k, False: 0]
  |  |  ------------------
  |  |  641|   431k|    do {                                                                       \
  |  |  642|   431k|      UPDATE_DOWNSAMPLE_FACTOR;                                                \
  |  |  ------------------
  |  |  |  |  620|   431k|  int proc_wd = 0;                                            \
  |  |  |  |  621|   431k|  if (use_downsampled_wiener_stats &&                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (621:7): [True: 431k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  622|   431k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   431k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (622:7): [True: 47.2k, False: 384k]
  |  |  |  |  ------------------
  |  |  |  |  623|  47.2k|    downsample_factor = v_end - proc_ht;                      \
  |  |  |  |  624|  47.2k|  }                                                           \
  |  |  |  |  625|   431k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  |  |  ------------------
  |  |  643|   431k|                                                                               \
  |  |  644|   431k|      /* Process the amount of width multiple of 16.*/                         \
  |  |  645|  1.97M|      while (proc_wd < wd_mul16) {                                             \
  |  |  ------------------
  |  |  |  Branch (645:14): [True: 1.54M, False: 431k]
  |  |  ------------------
  |  |  646|  1.54M|        const __m256i dgd =                                                    \
  |  |  647|  1.54M|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  648|  1.54M|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);            \
  |  |  649|  1.54M|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  9.24M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 7.70M, False: 1.54M]
  |  |  |  |  ------------------
  |  |  |  |  592|  7.70M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  7.70M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  7.70M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  7.70M|  }
  |  |  ------------------
  |  |  650|  1.54M|                                                                               \
  |  |  651|  1.54M|        proc_wd += 16;                                                         \
  |  |  652|  1.54M|      };                                                                       \
  |  |  653|   431k|                                                                               \
  |  |  654|   431k|      /* Process the remaining width here. */                                  \
  |  |  655|   431k|      if (wd_beyond_mul16) {                                                   \
  |  |  ------------------
  |  |  |  Branch (655:11): [True: 383k, False: 47.7k]
  |  |  ------------------
  |  |  656|   383k|        const __m256i dgd =                                                    \
  |  |  657|   383k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  658|   383k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);                  \
  |  |  659|   383k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);       \
  |  |  660|   383k|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  2.30M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 1.91M, False: 383k]
  |  |  |  |  ------------------
  |  |  |  |  592|  1.91M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  1.91M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  1.91M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  1.91M|  }
  |  |  ------------------
  |  |  661|   383k|      }                                                                        \
  |  |  662|   431k|      proc_ht += downsample_factor;                                            \
  |  |  663|   431k|      d_window += downsample_factor * d_stride;                                \
  |  |  664|   431k|      d_current_row += downsample_factor * d_stride;                           \
  |  |  665|   431k|    } while (proc_ht < v_end);                                                 \
  |  |  ------------------
  |  |  |  Branch (665:14): [True: 356k, False: 75.0k]
  |  |  ------------------
  |  |  666|  75.0k|    const __m256i s_h0 =                                                       \
  |  |  667|  75.0k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);     \
  |  |  668|  75.0k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + (wiener_win * j)), \
  |  |  669|  75.0k|                        s_h0);                                                 \
  |  |  670|  75.0k|    const __m256i s_m_h = convert_and_add_avx2(sum_h[4]);                      \
  |  |  671|  75.0k|    const __m128i s_m_h0 = add_64bit_lvl_avx2(s_m_h, s_m_h);                   \
  |  |  672|  75.0k|    _mm_storel_epi64(                                                          \
  |  |  673|  75.0k|        (__m128i *)(H + (i * wiener_win2) + (wiener_win * j) + 4), s_m_h0);    \
  |  |  674|  75.0k|    j++;                                                                       \
  |  |  675|  75.0k|  }
  ------------------
  959|  37.5k|  }
  960|       |
  961|       |  // Step 5: Here, the rows 4, 9, 14, 19 and 24 are filled. As we need to fill
  962|       |  // only upper-triangle elements, H40-H43 from row4, H90-H94 and H95-H98 from
  963|       |  // row9, etc, are need not be filled. As the core function process 5 values,
  964|       |  // in first iteration of 'j' only 1 values to be filled i.e., H44 from row4,
  965|       |  // H99 from row9, etc.
  966|  45.0k|  for (int i = 4; i < wiener_win2; i += wiener_win) {
  ------------------
  |  Branch (966:19): [True: 37.5k, False: 7.50k]
  ------------------
  967|       |    // Update the dgd pointers appropriately and also derive the 'j'th iteration
  968|       |    // from where the H buffer filling needs to be started.
  969|  37.5k|    INITIALIZATION(WIENER_WIN_CHROMA)
  ------------------
  |  |  608|  37.5k|  j = i / (wiener_window_sz);                                            \
  |  |  609|  37.5k|  const int16_t *d_window = d + j;                                       \
  |  |  610|  37.5k|  const int16_t *d_current_row =                                         \
  |  |  611|  37.5k|      d + j + ((i % (wiener_window_sz)) * d_stride);                     \
  |  |  612|  37.5k|  int proc_ht = v_start;                                                 \
  |  |  613|  37.5k|  downsample_factor =                                                    \
  |  |  614|  37.5k|      use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1; \
  |  |  ------------------
  |  |  |  |  131|  37.5k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (614:7): [True: 37.5k, False: 0]
  |  |  ------------------
  |  |  615|  37.5k|  __m256i sum_h[wiener_window_sz];                                       \
  |  |  616|  37.5k|  memset(sum_h, 0, sizeof(sum_h));
  ------------------
  970|   215k|    do {
  971|   215k|      UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   215k|  int proc_wd = 0;                                            \
  |  |  621|   215k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 215k, False: 0]
  |  |  ------------------
  |  |  622|   215k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   215k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 23.6k, False: 192k]
  |  |  ------------------
  |  |  623|  23.6k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  23.6k|  }                                                           \
  |  |  625|   215k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
  972|       |
  973|       |      // Process the amount of width multiple of 16.
  974|   986k|      while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (974:14): [True: 770k, False: 215k]
  ------------------
  975|   770k|        const __m256i dgd =
  976|   770k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  977|   770k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
  978|   770k|        INIT_H_VALUES(d_window + proc_wd + (4 * d_stride), 1)
  ------------------
  |  |  591|  1.54M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 770k, False: 770k]
  |  |  ------------------
  |  |  592|   770k|    const __m256i dgd0 =                                       \
  |  |  593|   770k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|   770k|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|   770k|  }
  ------------------
  979|       |
  980|   770k|        proc_wd += 16;
  981|   770k|      }
  982|       |
  983|       |      // Process the remaining width here.
  984|   215k|      if (wd_beyond_mul16) {
  ------------------
  |  Branch (984:11): [True: 191k, False: 23.8k]
  ------------------
  985|   191k|        const __m256i dgd =
  986|   191k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
  987|   191k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
  988|   191k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
  989|   191k|        INIT_H_VALUES(d_window + proc_wd + (4 * d_stride), 1)
  ------------------
  |  |  591|   383k|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 191k, False: 191k]
  |  |  ------------------
  |  |  592|   191k|    const __m256i dgd0 =                                       \
  |  |  593|   191k|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|   191k|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|   191k|  }
  ------------------
  990|   191k|      }
  991|   215k|      proc_ht += downsample_factor;
  992|   215k|      d_window += downsample_factor * d_stride;
  993|   215k|      d_current_row += downsample_factor * d_stride;
  994|   215k|    } while (proc_ht < v_end);
  ------------------
  |  Branch (994:14): [True: 178k, False: 37.5k]
  ------------------
  995|  37.5k|    const __m128i s_h = convert_32_to_64_add_avx2(sum_h[0], sum_h[1]);
  996|  37.5k|    _mm_storeu_si128((__m128i *)(H + (i * wiener_win2) + i), s_h);
  997|       |
  998|       |    // process the remaining 'j' iterations.
  999|  37.5k|    j++;
 1000|  37.5k|    CALCULATE_REMAINING_H_WIN5
  ------------------
  |  |  628|   112k|  while (j < wiener_win) {                                                     \
  |  |  ------------------
  |  |  |  Branch (628:10): [True: 75.0k, False: 37.5k]
  |  |  ------------------
  |  |  629|  75.0k|    d_window = d;                                                              \
  |  |  630|  75.0k|    d_current_row = d + (i / wiener_win) + ((i % wiener_win) * d_stride);      \
  |  |  631|  75.0k|    const __m256i zero = _mm256_setzero_si256();                               \
  |  |  632|  75.0k|    sum_h[0] = zero;                                                           \
  |  |  633|  75.0k|    sum_h[1] = zero;                                                           \
  |  |  634|  75.0k|    sum_h[2] = zero;                                                           \
  |  |  635|  75.0k|    sum_h[3] = zero;                                                           \
  |  |  636|  75.0k|    sum_h[4] = zero;                                                           \
  |  |  637|  75.0k|                                                                               \
  |  |  638|  75.0k|    proc_ht = v_start;                                                         \
  |  |  639|  75.0k|    downsample_factor =                                                        \
  |  |  640|  75.0k|        use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;     \
  |  |  ------------------
  |  |  |  |  131|  75.0k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (640:9): [True: 75.0k, False: 0]
  |  |  ------------------
  |  |  641|   431k|    do {                                                                       \
  |  |  642|   431k|      UPDATE_DOWNSAMPLE_FACTOR;                                                \
  |  |  ------------------
  |  |  |  |  620|   431k|  int proc_wd = 0;                                            \
  |  |  |  |  621|   431k|  if (use_downsampled_wiener_stats &&                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (621:7): [True: 431k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  622|   431k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   431k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (622:7): [True: 47.2k, False: 384k]
  |  |  |  |  ------------------
  |  |  |  |  623|  47.2k|    downsample_factor = v_end - proc_ht;                      \
  |  |  |  |  624|  47.2k|  }                                                           \
  |  |  |  |  625|   431k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  |  |  ------------------
  |  |  643|   431k|                                                                               \
  |  |  644|   431k|      /* Process the amount of width multiple of 16.*/                         \
  |  |  645|  1.97M|      while (proc_wd < wd_mul16) {                                             \
  |  |  ------------------
  |  |  |  Branch (645:14): [True: 1.54M, False: 431k]
  |  |  ------------------
  |  |  646|  1.54M|        const __m256i dgd =                                                    \
  |  |  647|  1.54M|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  648|  1.54M|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);            \
  |  |  649|  1.54M|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  9.24M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 7.70M, False: 1.54M]
  |  |  |  |  ------------------
  |  |  |  |  592|  7.70M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  7.70M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  7.70M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  7.70M|  }
  |  |  ------------------
  |  |  650|  1.54M|                                                                               \
  |  |  651|  1.54M|        proc_wd += 16;                                                         \
  |  |  652|  1.54M|      };                                                                       \
  |  |  653|   431k|                                                                               \
  |  |  654|   431k|      /* Process the remaining width here. */                                  \
  |  |  655|   431k|      if (wd_beyond_mul16) {                                                   \
  |  |  ------------------
  |  |  |  Branch (655:11): [True: 383k, False: 47.7k]
  |  |  ------------------
  |  |  656|   383k|        const __m256i dgd =                                                    \
  |  |  657|   383k|            _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));          \
  |  |  658|   383k|        const __m256i dgd_mask = _mm256_and_si256(dgd, mask);                  \
  |  |  659|   383k|        const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);       \
  |  |  660|   383k|        INIT_H_VALUES(d_window + j + proc_wd, 5)                               \
  |  |  ------------------
  |  |  |  |  591|  2.30M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:19): [True: 1.91M, False: 383k]
  |  |  |  |  ------------------
  |  |  |  |  592|  1.91M|    const __m256i dgd0 =                                       \
  |  |  |  |  593|  1.91M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  |  |  594|  1.91M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  |  |  595|  1.91M|  }
  |  |  ------------------
  |  |  661|   383k|      }                                                                        \
  |  |  662|   431k|      proc_ht += downsample_factor;                                            \
  |  |  663|   431k|      d_window += downsample_factor * d_stride;                                \
  |  |  664|   431k|      d_current_row += downsample_factor * d_stride;                           \
  |  |  665|   431k|    } while (proc_ht < v_end);                                                 \
  |  |  ------------------
  |  |  |  Branch (665:14): [True: 356k, False: 75.0k]
  |  |  ------------------
  |  |  666|  75.0k|    const __m256i s_h0 =                                                       \
  |  |  667|  75.0k|        hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);     \
  |  |  668|  75.0k|    _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + (wiener_win * j)), \
  |  |  669|  75.0k|                        s_h0);                                                 \
  |  |  670|  75.0k|    const __m256i s_m_h = convert_and_add_avx2(sum_h[4]);                      \
  |  |  671|  75.0k|    const __m128i s_m_h0 = add_64bit_lvl_avx2(s_m_h, s_m_h);                   \
  |  |  672|  75.0k|    _mm_storel_epi64(                                                          \
  |  |  673|  75.0k|        (__m128i *)(H + (i * wiener_win2) + (wiener_win * j) + 4), s_m_h0);    \
  |  |  674|  75.0k|    j++;                                                                       \
  |  |  675|  75.0k|  }
  ------------------
 1001|  37.5k|  }
 1002|       |
 1003|       |  // Step 6: Here, the rows 5, 10, 15 and 20 are filled. As we need to fill only
 1004|       |  // upper-triangle elements, H50-H54 from row5, H100-H104 and H105-H109 from
 1005|       |  // row10,etc, are need not be filled. The first iteration of 'j' fills H55-H59
 1006|       |  // from row5 and H1010-H1014 from row10, etc.
 1007|  37.5k|  for (int i = 5; i < wiener_win2; i += wiener_win) {
  ------------------
  |  Branch (1007:19): [True: 30.0k, False: 7.50k]
  ------------------
 1008|       |    // Derive j'th iteration from where the H buffer filling needs to be
 1009|       |    // started.
 1010|  30.0k|    j = i / wiener_win;
 1011|  30.0k|    int shift = 0;
 1012|  75.0k|    do {
 1013|       |      // Update the dgd pointers appropriately.
 1014|  75.0k|      int proc_ht = v_start;
 1015|  75.0k|      const int16_t *d_window = d + (i / wiener_win);
 1016|  75.0k|      const int16_t *d_current_row =
 1017|  75.0k|          d + (i / wiener_win) + ((i % wiener_win) * d_stride);
 1018|  75.0k|      downsample_factor =
 1019|  75.0k|          use_downsampled_wiener_stats ? WIENER_STATS_DOWNSAMPLE_FACTOR : 1;
  ------------------
  |  |  131|  75.0k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  ------------------
  |  Branch (1019:11): [True: 75.0k, False: 0]
  ------------------
 1020|  75.0k|      __m256i sum_h[WIENER_WIN_CHROMA] = { _mm256_setzero_si256() };
 1021|   431k|      do {
 1022|   431k|        UPDATE_DOWNSAMPLE_FACTOR
  ------------------
  |  |  620|   431k|  int proc_wd = 0;                                            \
  |  |  621|   431k|  if (use_downsampled_wiener_stats &&                         \
  |  |  ------------------
  |  |  |  Branch (621:7): [True: 431k, False: 0]
  |  |  ------------------
  |  |  622|   431k|      ((v_end - proc_ht) < WIENER_STATS_DOWNSAMPLE_FACTOR)) { \
  |  |  ------------------
  |  |  |  |  131|   431k|#define WIENER_STATS_DOWNSAMPLE_FACTOR 4
  |  |  ------------------
  |  |  |  Branch (622:7): [True: 47.2k, False: 384k]
  |  |  ------------------
  |  |  623|  47.2k|    downsample_factor = v_end - proc_ht;                      \
  |  |  624|  47.2k|  }                                                           \
  |  |  625|   431k|  const __m256i df_reg = _mm256_set1_epi16(downsample_factor);
  ------------------
 1023|       |
 1024|       |        // Process the amount of width multiple of 16.
 1025|  1.97M|        while (proc_wd < wd_mul16) {
  ------------------
  |  Branch (1025:16): [True: 1.54M, False: 431k]
  ------------------
 1026|  1.54M|          const __m256i dgd =
 1027|  1.54M|              _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
 1028|  1.54M|          const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd, df_reg);
 1029|  1.54M|          INIT_H_VALUES(d_window + shift + proc_wd, 5)
  ------------------
  |  |  591|  9.24M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 7.70M, False: 1.54M]
  |  |  ------------------
  |  |  592|  7.70M|    const __m256i dgd0 =                                       \
  |  |  593|  7.70M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|  7.70M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|  7.70M|  }
  ------------------
 1030|       |
 1031|  1.54M|          proc_wd += 16;
 1032|  1.54M|        }
 1033|       |
 1034|       |        // Process the remaining width here.
 1035|   431k|        if (wd_beyond_mul16) {
  ------------------
  |  Branch (1035:13): [True: 383k, False: 47.7k]
  ------------------
 1036|   383k|          const __m256i dgd =
 1037|   383k|              _mm256_loadu_si256((__m256i *)(d_current_row + proc_wd));
 1038|   383k|          const __m256i dgd_mask = _mm256_and_si256(dgd, mask);
 1039|   383k|          const __m256i dgd_mul_df = _mm256_mullo_epi16(dgd_mask, df_reg);
 1040|   383k|          INIT_H_VALUES(d_window + shift + proc_wd, 5)
  ------------------
  |  |  591|  2.30M|  for (int g = 0; g < (loop_count); g++) {                     \
  |  |  ------------------
  |  |  |  Branch (591:19): [True: 1.91M, False: 383k]
  |  |  ------------------
  |  |  592|  1.91M|    const __m256i dgd0 =                                       \
  |  |  593|  1.91M|        _mm256_loadu_si256((__m256i *)((d) + (g * d_stride))); \
  |  |  594|  1.91M|    madd_and_accum_avx2(dgd_mul_df, dgd0, &sum_h[g]);          \
  |  |  595|  1.91M|  }
  ------------------
 1041|   383k|        }
 1042|   431k|        proc_ht += downsample_factor;
 1043|   431k|        d_window += downsample_factor * d_stride;
 1044|   431k|        d_current_row += downsample_factor * d_stride;
 1045|   431k|      } while (proc_ht < v_end);
  ------------------
  |  Branch (1045:16): [True: 356k, False: 75.0k]
  ------------------
 1046|       |
 1047|  75.0k|      const __m256i s_h =
 1048|  75.0k|          hadd_four_32_to_64_avx2(sum_h[0], sum_h[1], &sum_h[2], &sum_h[3]);
 1049|  75.0k|      _mm256_storeu_si256((__m256i *)(H + (i * wiener_win2) + (wiener_win * j)),
 1050|  75.0k|                          s_h);
 1051|  75.0k|      const __m256i s_m_h = convert_and_add_avx2(sum_h[4]);
 1052|  75.0k|      const __m128i s_m_h0 = add_64bit_lvl_avx2(s_m_h, s_m_h);
 1053|  75.0k|      _mm_storel_epi64(
 1054|  75.0k|          (__m128i *)(H + (i * wiener_win2) + (wiener_win * j) + 4), s_m_h0);
 1055|  75.0k|      shift++;
 1056|  75.0k|    } while (++j < wiener_win);
  ------------------
  |  Branch (1056:14): [True: 45.0k, False: 30.0k]
  ------------------
 1057|  30.0k|  }
 1058|       |
 1059|  7.50k|  fill_lower_triag_elements_avx2(wiener_win2, H);
 1060|  7.50k|}
pickrst_avx2.c:pair_set_epi16:
 1543|  47.2k|static inline __m256i pair_set_epi16(int a, int b) {
 1544|  47.2k|  return _mm256_set1_epi32(
 1545|  47.2k|      (int32_t)(((uint16_t)(a)) | (((uint32_t)(uint16_t)(b)) << 16)));
 1546|  47.2k|}
pickrst_avx2.c:load_shuffled_u8_dual8_to_epi16:
 1555|   323k|                                                      const uint8_t *ptrB) {
 1556|   323k|  const __m128i rawA = _mm_loadl_epi64((const __m128i *)ptrA);
 1557|   323k|  const __m128i rawB = _mm_loadl_epi64((const __m128i *)ptrB);
 1558|   323k|  const __m128i raw_AB = _mm_unpacklo_epi64(rawA, rawB);
 1559|       |  const __m128i shuffled = _mm_shuffle_epi32(raw_AB, _MM_SHUFFLE(3, 1, 2, 0));
 1560|   323k|  return _mm256_cvtepu8_epi16(shuffled);
 1561|   323k|}
pickrst_avx2.c:calc_proj_err_r0_r1_avx2:
 1566|  14.9M|    int shift) {
 1567|  14.9M|  const __m256i u0 = _mm256_slli_epi16(d0, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  14.9M|#define SGRPROJ_RST_BITS 4
  ------------------
 1568|  14.9M|  const __m256i v0 = _mm256_madd_epi16(
 1569|  14.9M|      xq_coeff, _mm256_unpacklo_epi16(_mm256_sub_epi16(flt0_16b, u0),
 1570|  14.9M|                                      _mm256_sub_epi16(flt1_16b, u0)));
 1571|  14.9M|  const __m256i v1 = _mm256_madd_epi16(
 1572|  14.9M|      xq_coeff, _mm256_unpackhi_epi16(_mm256_sub_epi16(flt0_16b, u0),
 1573|  14.9M|                                      _mm256_sub_epi16(flt1_16b, u0)));
 1574|  14.9M|  const __m256i vr = _mm256_packs_epi32(
 1575|  14.9M|      _mm256_srai_epi32(_mm256_add_epi32(v0, rounding), shift),
 1576|  14.9M|      _mm256_srai_epi32(_mm256_add_epi32(v1, rounding), shift));
 1577|  14.9M|  return _mm256_add_epi16(vr, _mm256_sub_epi16(d0, s0));
 1578|  14.9M|}
pickrst_avx2.c:load_shuffled_u8_to_epi16:
 1548|  29.4M|static inline __m256i load_shuffled_u8_to_epi16(const uint8_t *ptr) {
 1549|  29.4M|  const __m128i raw = xx_loadu_128(ptr);
 1550|       |  const __m128i shuffled = _mm_shuffle_epi32(raw, _MM_SHUFFLE(3, 1, 2, 0));
 1551|  29.4M|  return _mm256_cvtepu8_epi16(shuffled);
 1552|  29.4M|}
pickrst_avx2.c:calc_proj_params_r0_r1_avx2:
 2140|    416|    int32_t *flt1, int flt1_stride, int64_t H[2][2], int64_t C[2]) {
 2141|    416|  const int size = width * height;
 2142|    416|  const uint8_t *src = src8;
 2143|    416|  const uint8_t *dat = dat8;
 2144|    416|  __m256i h00, h01, h11, c0, c1;
 2145|    416|  const __m256i zero = _mm256_setzero_si256();
 2146|    416|  h01 = h11 = c0 = c1 = h00 = zero;
 2147|       |
 2148|  33.1k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (2148:19): [True: 32.6k, False: 416]
  ------------------
 2149|   296k|    for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (2149:21): [True: 263k, False: 32.6k]
  ------------------
 2150|   263k|      const __m256i u_load = _mm256_cvtepu8_epi32(
 2151|   263k|          _mm_loadl_epi64((__m128i *)(dat + i * dat_stride + j)));
 2152|   263k|      const __m256i s_load = _mm256_cvtepu8_epi32(
 2153|   263k|          _mm_loadl_epi64((__m128i *)(src + i * src_stride + j)));
 2154|   263k|      __m256i f1 = _mm256_loadu_si256((__m256i *)(flt0 + i * flt0_stride + j));
 2155|   263k|      __m256i f2 = _mm256_loadu_si256((__m256i *)(flt1 + i * flt1_stride + j));
 2156|   263k|      __m256i d = _mm256_slli_epi32(u_load, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   263k|#define SGRPROJ_RST_BITS 4
  ------------------
 2157|   263k|      __m256i s = _mm256_slli_epi32(s_load, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|   263k|#define SGRPROJ_RST_BITS 4
  ------------------
 2158|   263k|      s = _mm256_sub_epi32(s, d);
 2159|   263k|      f1 = _mm256_sub_epi32(f1, d);
 2160|   263k|      f2 = _mm256_sub_epi32(f2, d);
 2161|       |
 2162|   263k|      const __m256i h00_even = _mm256_mul_epi32(f1, f1);
 2163|   263k|      const __m256i h00_odd = _mm256_mul_epi32(_mm256_srli_epi64(f1, 32),
 2164|   263k|                                               _mm256_srli_epi64(f1, 32));
 2165|   263k|      h00 = _mm256_add_epi64(h00, h00_even);
 2166|   263k|      h00 = _mm256_add_epi64(h00, h00_odd);
 2167|       |
 2168|   263k|      const __m256i h01_even = _mm256_mul_epi32(f1, f2);
 2169|   263k|      const __m256i h01_odd = _mm256_mul_epi32(_mm256_srli_epi64(f1, 32),
 2170|   263k|                                               _mm256_srli_epi64(f2, 32));
 2171|   263k|      h01 = _mm256_add_epi64(h01, h01_even);
 2172|   263k|      h01 = _mm256_add_epi64(h01, h01_odd);
 2173|       |
 2174|   263k|      const __m256i h11_even = _mm256_mul_epi32(f2, f2);
 2175|   263k|      const __m256i h11_odd = _mm256_mul_epi32(_mm256_srli_epi64(f2, 32),
 2176|   263k|                                               _mm256_srli_epi64(f2, 32));
 2177|   263k|      h11 = _mm256_add_epi64(h11, h11_even);
 2178|   263k|      h11 = _mm256_add_epi64(h11, h11_odd);
 2179|       |
 2180|   263k|      const __m256i c0_even = _mm256_mul_epi32(f1, s);
 2181|   263k|      const __m256i c0_odd =
 2182|   263k|          _mm256_mul_epi32(_mm256_srli_epi64(f1, 32), _mm256_srli_epi64(s, 32));
 2183|   263k|      c0 = _mm256_add_epi64(c0, c0_even);
 2184|   263k|      c0 = _mm256_add_epi64(c0, c0_odd);
 2185|       |
 2186|   263k|      const __m256i c1_even = _mm256_mul_epi32(f2, s);
 2187|   263k|      const __m256i c1_odd =
 2188|   263k|          _mm256_mul_epi32(_mm256_srli_epi64(f2, 32), _mm256_srli_epi64(s, 32));
 2189|   263k|      c1 = _mm256_add_epi64(c1, c1_even);
 2190|   263k|      c1 = _mm256_add_epi64(c1, c1_odd);
 2191|   263k|    }
 2192|  32.6k|  }
 2193|       |
 2194|    416|  __m256i c_low = _mm256_unpacklo_epi64(c0, c1);
 2195|    416|  const __m256i c_high = _mm256_unpackhi_epi64(c0, c1);
 2196|    416|  c_low = _mm256_add_epi64(c_low, c_high);
 2197|    416|  const __m128i c_128bit = _mm_add_epi64(_mm256_extracti128_si256(c_low, 1),
 2198|    416|                                         _mm256_castsi256_si128(c_low));
 2199|       |
 2200|    416|  __m256i h0x_low = _mm256_unpacklo_epi64(h00, h01);
 2201|    416|  const __m256i h0x_high = _mm256_unpackhi_epi64(h00, h01);
 2202|    416|  h0x_low = _mm256_add_epi64(h0x_low, h0x_high);
 2203|    416|  const __m128i h0x_128bit = _mm_add_epi64(_mm256_extracti128_si256(h0x_low, 1),
 2204|    416|                                           _mm256_castsi256_si128(h0x_low));
 2205|       |
 2206|       |  // Using the symmetric properties of H,  calculations of H[1][0] are not
 2207|       |  // needed.
 2208|    416|  __m256i h1x_low = _mm256_unpacklo_epi64(zero, h11);
 2209|    416|  const __m256i h1x_high = _mm256_unpackhi_epi64(zero, h11);
 2210|    416|  h1x_low = _mm256_add_epi64(h1x_low, h1x_high);
 2211|    416|  const __m128i h1x_128bit = _mm_add_epi64(_mm256_extracti128_si256(h1x_low, 1),
 2212|    416|                                           _mm256_castsi256_si128(h1x_low));
 2213|       |
 2214|    416|  xx_storeu_128(C, c_128bit);
 2215|    416|  xx_storeu_128(H[0], h0x_128bit);
 2216|    416|  xx_storeu_128(H[1], h1x_128bit);
 2217|       |
 2218|    416|  H[0][0] /= size;
 2219|    416|  H[0][1] /= size;
 2220|    416|  H[1][1] /= size;
 2221|       |
 2222|       |  // Since H is a symmetric matrix
 2223|    416|  H[1][0] = H[0][1];
 2224|    416|  C[0] /= size;
 2225|    416|  C[1] /= size;
 2226|    416|}
pickrst_avx2.c:calc_proj_params_r0_r1_high_bd_avx2:
 2368|    148|    int32_t *flt1, int flt1_stride, int64_t H[2][2], int64_t C[2]) {
 2369|    148|  const int size = width * height;
 2370|    148|  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  ------------------
  |  |   79|    148|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 2371|    148|  const uint16_t *dat = CONVERT_TO_SHORTPTR(dat8);
  ------------------
  |  |   79|    148|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
 2372|    148|  __m256i h00, h01, h11, c0, c1;
 2373|    148|  const __m256i zero = _mm256_setzero_si256();
 2374|    148|  h01 = h11 = c0 = c1 = h00 = zero;
 2375|       |
 2376|  9.20k|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (2376:19): [True: 9.05k, False: 148]
  ------------------
 2377|  30.3k|    for (int j = 0; j < width; j += 8) {
  ------------------
  |  Branch (2377:21): [True: 21.3k, False: 9.05k]
  ------------------
 2378|  21.3k|      const __m256i u_load = _mm256_cvtepu16_epi32(
 2379|  21.3k|          _mm_load_si128((__m128i *)(dat + i * dat_stride + j)));
 2380|  21.3k|      const __m256i s_load = _mm256_cvtepu16_epi32(
 2381|  21.3k|          _mm_load_si128((__m128i *)(src + i * src_stride + j)));
 2382|  21.3k|      __m256i f1 = _mm256_loadu_si256((__m256i *)(flt0 + i * flt0_stride + j));
 2383|  21.3k|      __m256i f2 = _mm256_loadu_si256((__m256i *)(flt1 + i * flt1_stride + j));
 2384|  21.3k|      __m256i d = _mm256_slli_epi32(u_load, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  21.3k|#define SGRPROJ_RST_BITS 4
  ------------------
 2385|  21.3k|      __m256i s = _mm256_slli_epi32(s_load, SGRPROJ_RST_BITS);
  ------------------
  |  |  101|  21.3k|#define SGRPROJ_RST_BITS 4
  ------------------
 2386|  21.3k|      s = _mm256_sub_epi32(s, d);
 2387|  21.3k|      f1 = _mm256_sub_epi32(f1, d);
 2388|  21.3k|      f2 = _mm256_sub_epi32(f2, d);
 2389|       |
 2390|  21.3k|      const __m256i h00_even = _mm256_mul_epi32(f1, f1);
 2391|  21.3k|      const __m256i h00_odd = _mm256_mul_epi32(_mm256_srli_epi64(f1, 32),
 2392|  21.3k|                                               _mm256_srli_epi64(f1, 32));
 2393|  21.3k|      h00 = _mm256_add_epi64(h00, h00_even);
 2394|  21.3k|      h00 = _mm256_add_epi64(h00, h00_odd);
 2395|       |
 2396|  21.3k|      const __m256i h01_even = _mm256_mul_epi32(f1, f2);
 2397|  21.3k|      const __m256i h01_odd = _mm256_mul_epi32(_mm256_srli_epi64(f1, 32),
 2398|  21.3k|                                               _mm256_srli_epi64(f2, 32));
 2399|  21.3k|      h01 = _mm256_add_epi64(h01, h01_even);
 2400|  21.3k|      h01 = _mm256_add_epi64(h01, h01_odd);
 2401|       |
 2402|  21.3k|      const __m256i h11_even = _mm256_mul_epi32(f2, f2);
 2403|  21.3k|      const __m256i h11_odd = _mm256_mul_epi32(_mm256_srli_epi64(f2, 32),
 2404|  21.3k|                                               _mm256_srli_epi64(f2, 32));
 2405|  21.3k|      h11 = _mm256_add_epi64(h11, h11_even);
 2406|  21.3k|      h11 = _mm256_add_epi64(h11, h11_odd);
 2407|       |
 2408|  21.3k|      const __m256i c0_even = _mm256_mul_epi32(f1, s);
 2409|  21.3k|      const __m256i c0_odd =
 2410|  21.3k|          _mm256_mul_epi32(_mm256_srli_epi64(f1, 32), _mm256_srli_epi64(s, 32));
 2411|  21.3k|      c0 = _mm256_add_epi64(c0, c0_even);
 2412|  21.3k|      c0 = _mm256_add_epi64(c0, c0_odd);
 2413|       |
 2414|  21.3k|      const __m256i c1_even = _mm256_mul_epi32(f2, s);
 2415|  21.3k|      const __m256i c1_odd =
 2416|  21.3k|          _mm256_mul_epi32(_mm256_srli_epi64(f2, 32), _mm256_srli_epi64(s, 32));
 2417|  21.3k|      c1 = _mm256_add_epi64(c1, c1_even);
 2418|  21.3k|      c1 = _mm256_add_epi64(c1, c1_odd);
 2419|  21.3k|    }
 2420|  9.05k|  }
 2421|       |
 2422|    148|  __m256i c_low = _mm256_unpacklo_epi64(c0, c1);
 2423|    148|  const __m256i c_high = _mm256_unpackhi_epi64(c0, c1);
 2424|    148|  c_low = _mm256_add_epi64(c_low, c_high);
 2425|    148|  const __m128i c_128bit = _mm_add_epi64(_mm256_extracti128_si256(c_low, 1),
 2426|    148|                                         _mm256_castsi256_si128(c_low));
 2427|       |
 2428|    148|  __m256i h0x_low = _mm256_unpacklo_epi64(h00, h01);
 2429|    148|  const __m256i h0x_high = _mm256_unpackhi_epi64(h00, h01);
 2430|    148|  h0x_low = _mm256_add_epi64(h0x_low, h0x_high);
 2431|    148|  const __m128i h0x_128bit = _mm_add_epi64(_mm256_extracti128_si256(h0x_low, 1),
 2432|    148|                                           _mm256_castsi256_si128(h0x_low));
 2433|       |
 2434|       |  // Using the symmetric properties of H,  calculations of H[1][0] are not
 2435|       |  // needed.
 2436|    148|  __m256i h1x_low = _mm256_unpacklo_epi64(zero, h11);
 2437|    148|  const __m256i h1x_high = _mm256_unpackhi_epi64(zero, h11);
 2438|    148|  h1x_low = _mm256_add_epi64(h1x_low, h1x_high);
 2439|    148|  const __m128i h1x_128bit = _mm_add_epi64(_mm256_extracti128_si256(h1x_low, 1),
 2440|    148|                                           _mm256_castsi256_si128(h1x_low));
 2441|       |
 2442|    148|  xx_storeu_128(C, c_128bit);
 2443|    148|  xx_storeu_128(H[0], h0x_128bit);
 2444|    148|  xx_storeu_128(H[1], h1x_128bit);
 2445|       |
 2446|    148|  H[0][0] /= size;
 2447|    148|  H[0][1] /= size;
 2448|    148|  H[1][1] /= size;
 2449|       |
 2450|       |  // Since H is a symmetric matrix
 2451|    148|  H[1][0] = H[0][1];
 2452|    148|  C[0] /= size;
 2453|    148|  C[1] /= size;
 2454|    148|}

av1_get_horver_correlation_full_avx2:
   65|  1.06M|                                          float *vcorr) {
   66|       |  // The following notation is used:
   67|       |  // x - current pixel
   68|       |  // y - right neighbour pixel
   69|       |  // z - below neighbour pixel
   70|       |  // w - down-right neighbour pixel
   71|  1.06M|  int64_t xy_sum = 0, xz_sum = 0;
   72|  1.06M|  int64_t x_sum = 0, x2_sum = 0;
   73|       |
   74|       |  // Process horizontal and vertical correlations through the body in 4x4
   75|       |  // blocks.  This excludes the final row and column and possibly one extra
   76|       |  // column depending how 3 divides into width and height
   77|  1.06M|  int32_t xy_xz_tmp[8] = { 0 }, x_x2_tmp[8] = { 0 };
   78|  1.06M|  __m256i xy_sum_32 = _mm256_setzero_si256();
   79|  1.06M|  __m256i xz_sum_32 = _mm256_setzero_si256();
   80|  1.06M|  __m256i x_sum_32 = _mm256_setzero_si256();
   81|  1.06M|  __m256i x2_sum_32 = _mm256_setzero_si256();
   82|  3.11M|  for (int i = 0; i <= height - 4; i += 3) {
  ------------------
  |  Branch (82:19): [True: 2.04M, False: 1.06M]
  ------------------
   83|  6.41M|    for (int j = 0; j <= width - 4; j += 3) {
  ------------------
  |  Branch (83:21): [True: 4.36M, False: 2.04M]
  ------------------
   84|  4.36M|      horver_correlation_4x4(&diff[i * stride + j], stride, &xy_sum_32,
   85|  4.36M|                             &xz_sum_32, &x_sum_32, &x2_sum_32);
   86|  4.36M|    }
   87|  2.04M|    const __m256i hadd_xy_xz = _mm256_hadd_epi32(xy_sum_32, xz_sum_32);
   88|       |    // hadd_xy_xz = [ae+bf+cg ei+fj+gk ab+bc+cd ef+fg+gh]
   89|       |    //              [im+jn+ko mm+nn+oo ij+jk+kl mn+no+op] as i32
   90|  2.04M|    yy_storeu_256(xy_xz_tmp, hadd_xy_xz);
   91|  2.04M|    xy_sum += (int64_t)xy_xz_tmp[5] + xy_xz_tmp[4] + xy_xz_tmp[1];
   92|  2.04M|    xz_sum += (int64_t)xy_xz_tmp[7] + xy_xz_tmp[6] + xy_xz_tmp[3];
   93|       |
   94|  2.04M|    const __m256i hadd_x_x2 = _mm256_hadd_epi32(x_sum_32, x2_sum_32);
   95|       |    // hadd_x_x2 = [aa+bb+cc ee+ff+gg a+b+c e+f+g]
   96|       |    //             [ii+jj+kk mm+nn+oo i+j+k m+n+o] as i32
   97|  2.04M|    yy_storeu_256(x_x2_tmp, hadd_x_x2);
   98|  2.04M|    x_sum += (int64_t)x_x2_tmp[5] + x_x2_tmp[4] + x_x2_tmp[1];
   99|  2.04M|    x2_sum += (int64_t)x_x2_tmp[7] + x_x2_tmp[6] + x_x2_tmp[3];
  100|       |
  101|  2.04M|    xy_sum_32 = _mm256_setzero_si256();
  102|  2.04M|    xz_sum_32 = _mm256_setzero_si256();
  103|  2.04M|    x_sum_32 = _mm256_setzero_si256();
  104|  2.04M|    x2_sum_32 = _mm256_setzero_si256();
  105|  2.04M|  }
  106|       |
  107|       |  // x_sum now covers every pixel except the final 1-2 rows and 1-2 cols
  108|  1.06M|  int64_t x_finalrow = 0, x_finalcol = 0, x2_finalrow = 0, x2_finalcol = 0;
  109|       |
  110|       |  // Do we have 2 rows remaining or just the one?  Note that width and height
  111|       |  // are powers of 2, so each modulo 3 must be 1 or 2.
  112|  1.06M|  if (height % 3 == 1) {  // Just horiz corrs on the final row
  ------------------
  |  Branch (112:7): [True: 271k, False: 791k]
  ------------------
  113|   271k|    const int16_t x0 = diff[(height - 1) * stride];
  114|   271k|    x_sum += x0;
  115|   271k|    x_finalrow += x0;
  116|   271k|    x2_sum += x0 * x0;
  117|   271k|    x2_finalrow += x0 * x0;
  118|  1.71M|    for (int j = 0; j < width - 1; ++j) {
  ------------------
  |  Branch (118:21): [True: 1.43M, False: 271k]
  ------------------
  119|  1.43M|      const int16_t x = diff[(height - 1) * stride + j];
  120|  1.43M|      const int16_t y = diff[(height - 1) * stride + j + 1];
  121|  1.43M|      xy_sum += x * y;
  122|  1.43M|      x_sum += y;
  123|  1.43M|      x2_sum += y * y;
  124|  1.43M|      x_finalrow += y;
  125|  1.43M|      x2_finalrow += y * y;
  126|  1.43M|    }
  127|   791k|  } else {  // Two rows remaining to do
  128|   791k|    const int16_t x0 = diff[(height - 2) * stride];
  129|   791k|    const int16_t z0 = diff[(height - 1) * stride];
  130|   791k|    x_sum += x0 + z0;
  131|   791k|    x2_sum += x0 * x0 + z0 * z0;
  132|   791k|    x_finalrow += z0;
  133|   791k|    x2_finalrow += z0 * z0;
  134|  6.26M|    for (int j = 0; j < width - 1; ++j) {
  ------------------
  |  Branch (134:21): [True: 5.47M, False: 791k]
  ------------------
  135|  5.47M|      const int16_t x = diff[(height - 2) * stride + j];
  136|  5.47M|      const int16_t y = diff[(height - 2) * stride + j + 1];
  137|  5.47M|      const int16_t z = diff[(height - 1) * stride + j];
  138|  5.47M|      const int16_t w = diff[(height - 1) * stride + j + 1];
  139|       |
  140|       |      // Horizontal and vertical correlations for the penultimate row:
  141|  5.47M|      xy_sum += x * y;
  142|  5.47M|      xz_sum += x * z;
  143|       |
  144|       |      // Now just horizontal correlations for the final row:
  145|  5.47M|      xy_sum += z * w;
  146|       |
  147|  5.47M|      x_sum += y + w;
  148|  5.47M|      x2_sum += y * y + w * w;
  149|  5.47M|      x_finalrow += w;
  150|  5.47M|      x2_finalrow += w * w;
  151|  5.47M|    }
  152|   791k|  }
  153|       |
  154|       |  // Do we have 2 columns remaining or just the one?
  155|  1.06M|  if (width % 3 == 1) {  // Just vert corrs on the final col
  ------------------
  |  Branch (155:7): [True: 250k, False: 813k]
  ------------------
  156|   250k|    const int16_t x0 = diff[width - 1];
  157|   250k|    x_sum += x0;
  158|   250k|    x_finalcol += x0;
  159|   250k|    x2_sum += x0 * x0;
  160|   250k|    x2_finalcol += x0 * x0;
  161|  1.54M|    for (int i = 0; i < height - 1; ++i) {
  ------------------
  |  Branch (161:21): [True: 1.28M, False: 250k]
  ------------------
  162|  1.28M|      const int16_t x = diff[i * stride + width - 1];
  163|  1.28M|      const int16_t z = diff[(i + 1) * stride + width - 1];
  164|  1.28M|      xz_sum += x * z;
  165|  1.28M|      x_finalcol += z;
  166|  1.28M|      x2_finalcol += z * z;
  167|       |      // So the bottom-right elements don't get counted twice:
  168|  1.28M|      if (i < height - (height % 3 == 1 ? 2 : 3)) {
  ------------------
  |  Branch (168:11): [True: 998k, False: 291k]
  |  Branch (168:25): [True: 1.00M, False: 289k]
  ------------------
  169|   998k|        x_sum += z;
  170|   998k|        x2_sum += z * z;
  171|   998k|      }
  172|  1.28M|    }
  173|   813k|  } else {  // Two cols remaining
  174|   813k|    const int16_t x0 = diff[width - 2];
  175|   813k|    const int16_t y0 = diff[width - 1];
  176|   813k|    x_sum += x0 + y0;
  177|   813k|    x2_sum += x0 * x0 + y0 * y0;
  178|   813k|    x_finalcol += y0;
  179|   813k|    x2_finalcol += y0 * y0;
  180|  6.46M|    for (int i = 0; i < height - 1; ++i) {
  ------------------
  |  Branch (180:21): [True: 5.64M, False: 813k]
  ------------------
  181|  5.64M|      const int16_t x = diff[i * stride + width - 2];
  182|  5.64M|      const int16_t y = diff[i * stride + width - 1];
  183|  5.64M|      const int16_t z = diff[(i + 1) * stride + width - 2];
  184|  5.64M|      const int16_t w = diff[(i + 1) * stride + width - 1];
  185|       |
  186|       |      // Horizontal and vertical correlations for the penultimate col:
  187|       |      // Skip these on the last iteration of this loop if we also had two
  188|       |      // rows remaining, otherwise the final horizontal and vertical correlation
  189|       |      // get erroneously processed twice
  190|  5.64M|      if (i < height - 2 || height % 3 == 1) {
  ------------------
  |  Branch (190:11): [True: 4.83M, False: 812k]
  |  Branch (190:29): [True: 62.6k, False: 750k]
  ------------------
  191|  4.89M|        xy_sum += x * y;
  192|  4.89M|        xz_sum += x * z;
  193|  4.89M|      }
  194|       |
  195|  5.64M|      x_finalcol += w;
  196|  5.64M|      x2_finalcol += w * w;
  197|       |      // So the bottom-right elements don't get counted twice:
  198|  5.64M|      if (i < height - (height % 3 == 1 ? 2 : 3)) {
  ------------------
  |  Branch (198:11): [True: 4.08M, False: 1.56M]
  |  Branch (198:25): [True: 396k, False: 5.25M]
  ------------------
  199|  4.08M|        x_sum += z + w;
  200|  4.08M|        x2_sum += z * z + w * w;
  201|  4.08M|      }
  202|       |
  203|       |      // Now just vertical correlations for the final column:
  204|  5.64M|      xz_sum += y * w;
  205|  5.64M|    }
  206|   813k|  }
  207|       |
  208|       |  // Calculate the simple sums and squared-sums
  209|  1.06M|  int64_t x_firstrow = 0, x_firstcol = 0;
  210|  1.06M|  int64_t x2_firstrow = 0, x2_firstcol = 0;
  211|       |
  212|  9.03M|  for (int j = 0; j < width; ++j) {
  ------------------
  |  Branch (212:19): [True: 7.97M, False: 1.06M]
  ------------------
  213|  7.97M|    x_firstrow += diff[j];
  214|  7.97M|    x2_firstrow += diff[j] * diff[j];
  215|  7.97M|  }
  216|  9.06M|  for (int i = 0; i < height; ++i) {
  ------------------
  |  Branch (216:19): [True: 8.00M, False: 1.06M]
  ------------------
  217|  8.00M|    x_firstcol += diff[i * stride];
  218|  8.00M|    x2_firstcol += diff[i * stride] * diff[i * stride];
  219|  8.00M|  }
  220|       |
  221|  1.06M|  int64_t xhor_sum = x_sum - x_finalcol;
  222|  1.06M|  int64_t xver_sum = x_sum - x_finalrow;
  223|  1.06M|  int64_t y_sum = x_sum - x_firstcol;
  224|  1.06M|  int64_t z_sum = x_sum - x_firstrow;
  225|  1.06M|  int64_t x2hor_sum = x2_sum - x2_finalcol;
  226|  1.06M|  int64_t x2ver_sum = x2_sum - x2_finalrow;
  227|  1.06M|  int64_t y2_sum = x2_sum - x2_firstcol;
  228|  1.06M|  int64_t z2_sum = x2_sum - x2_firstrow;
  229|       |
  230|  1.06M|  const float num_hor = (float)(height * (width - 1));
  231|  1.06M|  const float num_ver = (float)((height - 1) * width);
  232|       |
  233|  1.06M|  const float xhor_var_n = x2hor_sum - (xhor_sum * xhor_sum) / num_hor;
  234|  1.06M|  const float xver_var_n = x2ver_sum - (xver_sum * xver_sum) / num_ver;
  235|       |
  236|  1.06M|  const float y_var_n = y2_sum - (y_sum * y_sum) / num_hor;
  237|  1.06M|  const float z_var_n = z2_sum - (z_sum * z_sum) / num_ver;
  238|       |
  239|  1.06M|  const float xy_var_n = xy_sum - (xhor_sum * y_sum) / num_hor;
  240|  1.06M|  const float xz_var_n = xz_sum - (xver_sum * z_sum) / num_ver;
  241|       |
  242|  1.06M|  if (xhor_var_n > 0 && y_var_n > 0) {
  ------------------
  |  Branch (242:7): [True: 1.06M, False: 48]
  |  Branch (242:25): [True: 1.06M, False: 727]
  ------------------
  243|  1.06M|    *hcorr = xy_var_n / sqrtf(xhor_var_n * y_var_n);
  244|  1.06M|    *hcorr = *hcorr < 0 ? 0 : *hcorr;
  ------------------
  |  Branch (244:14): [True: 250k, False: 812k]
  ------------------
  245|  1.06M|  } else {
  246|    766|    *hcorr = 1.0;
  247|    766|  }
  248|  1.06M|  if (xver_var_n > 0 && z_var_n > 0) {
  ------------------
  |  Branch (248:7): [True: 1.06M, False: 18.4E]
  |  Branch (248:25): [True: 1.06M, False: 560]
  ------------------
  249|  1.06M|    *vcorr = xz_var_n / sqrtf(xver_var_n * z_var_n);
  250|  1.06M|    *vcorr = *vcorr < 0 ? 0 : *vcorr;
  ------------------
  |  Branch (250:14): [True: 270k, False: 792k]
  ------------------
  251|  1.06M|  } else {
  252|    505|    *vcorr = 1.0;
  253|    505|  }
  254|  1.06M|}
rdopt_avx2.c:horver_correlation_4x4:
   27|  4.36M|                                          __m256i *x2_sum_32) {
   28|       |  // Pixels in this 4x4   [ a b c d ]
   29|       |  // are referred to as:  [ e f g h ]
   30|       |  //                      [ i j k l ]
   31|       |  //                      [ m n o p ]
   32|       |
   33|  4.36M|  const __m256i pixels = _mm256_set_epi64x(
   34|  4.36M|      loadu_int64(&diff[0 * stride]), loadu_int64(&diff[1 * stride]),
   35|  4.36M|      loadu_int64(&diff[2 * stride]), loadu_int64(&diff[3 * stride]));
   36|       |  // pixels = [d c b a h g f e] [l k j i p o n m] as i16
   37|       |
   38|  4.36M|  const __m256i slli = _mm256_slli_epi64(pixels, 16);
   39|       |  // slli = [c b a 0 g f e 0] [k j i 0 o n m 0] as i16
   40|       |
   41|  4.36M|  const __m256i madd_xy = _mm256_madd_epi16(pixels, slli);
   42|       |  // madd_xy = [bc+cd ab fg+gh ef] [jk+kl ij no+op mn] as i32
   43|  4.36M|  *xy_sum_32 = _mm256_add_epi32(*xy_sum_32, madd_xy);
   44|       |
   45|       |  // Permute control [3 2] [1 0] => [2 1] [0 0], 0b10010000 = 0x90
   46|  4.36M|  const __m256i perm = _mm256_permute4x64_epi64(slli, 0x90);
   47|       |  // perm = [g f e 0 k j i 0] [o n m 0 o n m 0] as i16
   48|       |
   49|  4.36M|  const __m256i madd_xz = _mm256_madd_epi16(slli, perm);
   50|       |  // madd_xz = [cg+bf ae gk+fj ei] [ko+jn im oo+nn mm] as i32
   51|  4.36M|  *xz_sum_32 = _mm256_add_epi32(*xz_sum_32, madd_xz);
   52|       |
   53|       |  // Sum every element in slli (and then also their squares)
   54|  4.36M|  const __m256i madd1_slli = _mm256_madd_epi16(slli, _mm256_set1_epi16(1));
   55|       |  // madd1_slli = [c+b a g+f e] [k+j i o+n m] as i32
   56|  4.36M|  *x_sum_32 = _mm256_add_epi32(*x_sum_32, madd1_slli);
   57|       |
   58|  4.36M|  const __m256i madd_slli = _mm256_madd_epi16(slli, slli);
   59|       |  // madd_slli = [cc+bb aa gg+ff ee] [kk+jj ii oo+nn mm] as i32
   60|  4.36M|  *x2_sum_32 = _mm256_add_epi32(*x2_sum_32, madd_slli);
   61|  4.36M|}

aom_upsampled_pred_sse2:
   37|  28.6M|                             int subpel_search) {
   38|  28.6M|  if (aom_upsampled_pred_scaled(xd, cm, mi_row, mi_col, mv, comp_pred, width,
  ------------------
  |  Branch (38:7): [True: 28.2M, False: 423k]
  ------------------
   39|  28.6M|                                height)) {
   40|  28.2M|    return;
   41|  28.2M|  }
   42|       |
   43|   423k|  const InterpFilterParams *filter = av1_get_filter(subpel_search);
   44|       |  // (TODO:yunqing) 2-tap case uses 4-tap functions since there is no SIMD for
   45|       |  // 2-tap yet.
   46|   423k|  int filter_taps = (subpel_search <= USE_4_TAPS) ? 4 : SUBPEL_TAPS;
  ------------------
  |  |   26|   423k|#define SUBPEL_TAPS 8
  ------------------
  |  Branch (46:21): [True: 0, False: 423k]
  ------------------
   47|       |
   48|   423k|  if (!subpel_x_q3 && !subpel_y_q3) {
  ------------------
  |  Branch (48:7): [True: 0, False: 423k]
  |  Branch (48:23): [True: 0, False: 0]
  ------------------
   49|      0|    if (width >= 16) {
  ------------------
  |  Branch (49:9): [True: 0, False: 0]
  ------------------
   50|      0|      int i;
   51|      0|      assert(!(width & 15));
   52|       |      /*Read 16 pixels one row at a time.*/
   53|      0|      for (i = 0; i < height; i++) {
  ------------------
  |  Branch (53:19): [True: 0, False: 0]
  ------------------
   54|      0|        int j;
   55|      0|        for (j = 0; j < width; j += 16) {
  ------------------
  |  Branch (55:21): [True: 0, False: 0]
  ------------------
   56|      0|          xx_storeu_128(comp_pred, xx_loadu_128(ref));
   57|      0|          comp_pred += 16;
   58|      0|          ref += 16;
   59|      0|        }
   60|      0|        ref += ref_stride - width;
   61|      0|      }
   62|      0|    } else if (width >= 8) {
  ------------------
  |  Branch (62:16): [True: 0, False: 0]
  ------------------
   63|      0|      int i;
   64|      0|      assert(!(width & 7));
   65|      0|      assert(!(height & 1));
   66|       |      /*Read 8 pixels two rows at a time.*/
   67|      0|      for (i = 0; i < height; i += 2) {
  ------------------
  |  Branch (67:19): [True: 0, False: 0]
  ------------------
   68|      0|        __m128i s0 = xx_loadl_64(ref + 0 * ref_stride);
   69|      0|        __m128i s1 = xx_loadl_64(ref + 1 * ref_stride);
   70|      0|        xx_storeu_128(comp_pred, _mm_unpacklo_epi64(s0, s1));
   71|      0|        comp_pred += 16;
   72|      0|        ref += 2 * ref_stride;
   73|      0|      }
   74|      0|    } else {
   75|      0|      int i;
   76|      0|      assert(!(width & 3));
   77|      0|      assert(!(height & 3));
   78|       |      /*Read 4 pixels four rows at a time.*/
   79|      0|      for (i = 0; i < height; i++) {
  ------------------
  |  Branch (79:19): [True: 0, False: 0]
  ------------------
   80|      0|        const __m128i row0 = xx_loadl_64(ref + 0 * ref_stride);
   81|      0|        const __m128i row1 = xx_loadl_64(ref + 1 * ref_stride);
   82|      0|        const __m128i row2 = xx_loadl_64(ref + 2 * ref_stride);
   83|      0|        const __m128i row3 = xx_loadl_64(ref + 3 * ref_stride);
   84|      0|        const __m128i reg = _mm_unpacklo_epi64(_mm_unpacklo_epi32(row0, row1),
   85|      0|                                               _mm_unpacklo_epi32(row2, row3));
   86|      0|        xx_storeu_128(comp_pred, reg);
   87|      0|        comp_pred += 16;
   88|      0|        ref += 4 * ref_stride;
   89|      0|      }
   90|      0|    }
   91|   423k|  } else if (!subpel_y_q3) {
  ------------------
  |  Branch (91:14): [True: 0, False: 423k]
  ------------------
   92|      0|    const int16_t *const kernel =
   93|      0|        av1_get_interp_filter_subpel_kernel(filter, subpel_x_q3 << 1);
   94|      0|    aom_convolve8_horiz(ref, ref_stride, comp_pred, width, kernel, 16, NULL, -1,
   95|      0|                        width, height);
   96|   423k|  } else if (!subpel_x_q3) {
  ------------------
  |  Branch (96:14): [True: 0, False: 423k]
  ------------------
   97|      0|    const int16_t *const kernel =
   98|      0|        av1_get_interp_filter_subpel_kernel(filter, subpel_y_q3 << 1);
   99|      0|    aom_convolve8_vert(ref, ref_stride, comp_pred, width, NULL, -1, kernel, 16,
  100|      0|                       width, height);
  101|   423k|  } else {
  102|   423k|    uint8_t *temp = comp_pred;
  103|   423k|    const int16_t *const kernel_x =
  104|   423k|        av1_get_interp_filter_subpel_kernel(filter, subpel_x_q3 << 1);
  105|   423k|    const int16_t *const kernel_y =
  106|   423k|        av1_get_interp_filter_subpel_kernel(filter, subpel_y_q3 << 1);
  107|   423k|    const uint8_t *ref_start = ref - ref_stride * ((filter_taps >> 1) - 1);
  108|   423k|    uint8_t *temp_start_horiz = (subpel_search <= USE_4_TAPS)
  ------------------
  |  Branch (108:33): [True: 0, False: 423k]
  ------------------
  109|   423k|                                    ? temp + (filter_taps >> 1) * MAX_SB_SIZE
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  110|   423k|                                    : temp;
  111|   423k|    uint8_t *temp_start_vert = temp + MAX_SB_SIZE * ((filter->taps >> 1) - 1);
  ------------------
  |  |   32|   423k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   423k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  112|   423k|    int intermediate_height =
  113|   423k|        (((height - 1) * 8 + subpel_y_q3) >> 3) + filter_taps;
  114|   423k|    assert(intermediate_height <= (MAX_SB_SIZE * 2 + 16) + 16);
  115|   423k|    aom_convolve8_horiz(ref_start, ref_stride, temp_start_horiz, MAX_SB_SIZE,
  ------------------
  |  |   32|   423k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   423k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  116|   423k|                        kernel_x, 16, NULL, -1, width, intermediate_height);
  117|   423k|    aom_convolve8_vert(temp_start_vert, MAX_SB_SIZE, comp_pred, width, NULL, -1,
  ------------------
  |  |   32|   423k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|   423k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  118|   423k|                       kernel_y, 16, width, height);
  119|   423k|  }
  120|   423k|}
aom_highbd_upsampled_pred_sse2:
  129|  12.8M|                                    int subpel_search) {
  130|  12.8M|  if (aom_upsampled_pred_scaled(xd, cm, mi_row, mi_col, mv, comp_pred8, width,
  ------------------
  |  Branch (130:7): [True: 12.7M, False: 34.1k]
  ------------------
  131|  12.8M|                                height)) {
  132|  12.7M|    return;
  133|  12.7M|  }
  134|       |
  135|  34.1k|  const InterpFilterParams *filter = av1_get_filter(subpel_search);
  136|  34.1k|  int filter_taps = (subpel_search <= USE_4_TAPS) ? 4 : SUBPEL_TAPS;
  ------------------
  |  |   26|  34.1k|#define SUBPEL_TAPS 8
  ------------------
  |  Branch (136:21): [True: 0, False: 34.1k]
  ------------------
  137|  34.1k|  if (!subpel_x_q3 && !subpel_y_q3) {
  ------------------
  |  Branch (137:7): [True: 0, False: 34.1k]
  |  Branch (137:23): [True: 0, False: 0]
  ------------------
  138|      0|    const uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);
  ------------------
  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  139|      0|    uint16_t *comp_pred = CONVERT_TO_SHORTPTR(comp_pred8);
  ------------------
  |  |   79|      0|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  140|      0|    if (width >= 8) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      int i;
  142|      0|      assert(!(width & 7));
  143|       |      /*Read 8 pixels one row at a time.*/
  144|      0|      for (i = 0; i < height; i++) {
  ------------------
  |  Branch (144:19): [True: 0, False: 0]
  ------------------
  145|      0|        int j;
  146|      0|        for (j = 0; j < width; j += 8) {
  ------------------
  |  Branch (146:21): [True: 0, False: 0]
  ------------------
  147|      0|          __m128i s0 = _mm_loadu_si128((const __m128i *)ref);
  148|      0|          _mm_storeu_si128((__m128i *)comp_pred, s0);
  149|      0|          comp_pred += 8;
  150|      0|          ref += 8;
  151|      0|        }
  152|      0|        ref += ref_stride - width;
  153|      0|      }
  154|      0|    } else {
  155|      0|      int i;
  156|      0|      assert(!(width & 3));
  157|       |      /*Read 4 pixels two rows at a time.*/
  158|      0|      for (i = 0; i < height; i += 2) {
  ------------------
  |  Branch (158:19): [True: 0, False: 0]
  ------------------
  159|      0|        __m128i s0 = _mm_loadl_epi64((const __m128i *)ref);
  160|      0|        __m128i s1 = _mm_loadl_epi64((const __m128i *)(ref + ref_stride));
  161|      0|        __m128i t0 = _mm_unpacklo_epi64(s0, s1);
  162|      0|        _mm_storeu_si128((__m128i *)comp_pred, t0);
  163|      0|        comp_pred += 8;
  164|      0|        ref += 2 * ref_stride;
  165|      0|      }
  166|      0|    }
  167|  34.1k|  } else if (!subpel_y_q3) {
  ------------------
  |  Branch (167:14): [True: 0, False: 34.1k]
  ------------------
  168|      0|    const int16_t *const kernel =
  169|      0|        av1_get_interp_filter_subpel_kernel(filter, subpel_x_q3 << 1);
  170|      0|    aom_highbd_convolve8_horiz(ref8, ref_stride, comp_pred8, width, kernel, 16,
  171|      0|                               NULL, -1, width, height, bd);
  172|  34.1k|  } else if (!subpel_x_q3) {
  ------------------
  |  Branch (172:14): [True: 0, False: 34.1k]
  ------------------
  173|      0|    const int16_t *const kernel =
  174|      0|        av1_get_interp_filter_subpel_kernel(filter, subpel_y_q3 << 1);
  175|      0|    aom_highbd_convolve8_vert(ref8, ref_stride, comp_pred8, width, NULL, -1,
  176|      0|                              kernel, 16, width, height, bd);
  177|  34.1k|  } else {
  178|  34.1k|    uint16_t *temp = CONVERT_TO_SHORTPTR(comp_pred8);
  ------------------
  |  |   79|  34.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  179|  34.1k|    const uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);
  ------------------
  |  |   79|  34.1k|#define CONVERT_TO_SHORTPTR(x) ((uint16_t *)(((uintptr_t)(x)) << 1))
  ------------------
  180|  34.1k|    const int16_t *const kernel_x =
  181|  34.1k|        av1_get_interp_filter_subpel_kernel(filter, subpel_x_q3 << 1);
  182|  34.1k|    const int16_t *const kernel_y =
  183|  34.1k|        av1_get_interp_filter_subpel_kernel(filter, subpel_y_q3 << 1);
  184|  34.1k|    const uint16_t *ref_start = ref - ref_stride * ((filter_taps >> 1) - 1);
  185|  34.1k|    uint16_t *temp_start_horiz = (subpel_search <= USE_4_TAPS)
  ------------------
  |  Branch (185:34): [True: 0, False: 34.1k]
  ------------------
  186|  34.1k|                                     ? temp + (filter_taps >> 1) * MAX_SB_SIZE
  ------------------
  |  |   32|      0|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|      0|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  187|  34.1k|                                     : temp;
  188|  34.1k|    uint16_t *temp_start_vert = temp + MAX_SB_SIZE * ((filter->taps >> 1) - 1);
  ------------------
  |  |   32|  34.1k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  34.1k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  189|  34.1k|    const int intermediate_height =
  190|  34.1k|        (((height - 1) * 8 + subpel_y_q3) >> 3) + filter_taps;
  191|  34.1k|    assert(intermediate_height <= (MAX_SB_SIZE * 2 + 16) + 16);
  192|  34.1k|    aom_highbd_convolve8_horiz(CONVERT_TO_BYTEPTR(ref_start), ref_stride,
  ------------------
  |  |   80|  34.1k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  193|  34.1k|                               CONVERT_TO_BYTEPTR(temp_start_horiz),
  ------------------
  |  |   80|  34.1k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
  194|  34.1k|                               MAX_SB_SIZE, kernel_x, 16, NULL, -1, width,
  ------------------
  |  |   32|  34.1k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  34.1k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  195|  34.1k|                               intermediate_height, bd);
  196|  34.1k|    aom_highbd_convolve8_vert(CONVERT_TO_BYTEPTR(temp_start_vert), MAX_SB_SIZE,
  ------------------
  |  |   80|  34.1k|#define CONVERT_TO_BYTEPTR(x) ((uint8_t *)(((uintptr_t)(x)) >> 1))
  ------------------
                  aom_highbd_convolve8_vert(CONVERT_TO_BYTEPTR(temp_start_vert), MAX_SB_SIZE,
  ------------------
  |  |   32|  34.1k|#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
  |  |  ------------------
  |  |  |  |   31|  34.1k|#define MAX_SB_SIZE_LOG2 7
  |  |  ------------------
  ------------------
  197|       |                              comp_pred8, width, NULL, -1, kernel_y, 16, width,
  198|  34.1k|                              height, bd);
  199|  34.1k|  }
  200|  34.1k|}

aom_dsp_rtcd.c:setup_rtcd_internal:
 5637|      1|{
 5638|      1|    int flags = x86_simd_caps();
 5639|       |
 5640|      1|    (void)flags;
 5641|       |
 5642|      1|    aom_avg_8x8_quad = aom_avg_8x8_quad_sse2;
 5643|      1|    if (flags & HAS_AVX2) aom_avg_8x8_quad = aom_avg_8x8_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5643:9): [True: 1, False: 0]
  ------------------
 5644|      1|    aom_blend_a64_hmask = aom_blend_a64_hmask_c;
 5645|      1|    if (flags & HAS_SSE4_1) aom_blend_a64_hmask = aom_blend_a64_hmask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5645:9): [True: 1, False: 0]
  ------------------
 5646|      1|    aom_blend_a64_mask = aom_blend_a64_mask_c;
 5647|      1|    if (flags & HAS_SSE4_1) aom_blend_a64_mask = aom_blend_a64_mask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5647:9): [True: 1, False: 0]
  ------------------
 5648|      1|    if (flags & HAS_AVX2) aom_blend_a64_mask = aom_blend_a64_mask_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5648:9): [True: 1, False: 0]
  ------------------
 5649|      1|    aom_blend_a64_vmask = aom_blend_a64_vmask_c;
 5650|      1|    if (flags & HAS_SSE4_1) aom_blend_a64_vmask = aom_blend_a64_vmask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5650:9): [True: 1, False: 0]
  ------------------
 5651|      1|    aom_calc_variance_stat = aom_calc_variance_stat_c;
 5652|      1|    if (flags & HAS_AVX2) aom_calc_variance_stat = aom_calc_variance_stat_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5652:9): [True: 1, False: 0]
  ------------------
 5653|      1|    aom_comp_avg_pred = aom_comp_avg_pred_c;
 5654|      1|    if (flags & HAS_AVX2) aom_comp_avg_pred = aom_comp_avg_pred_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5654:9): [True: 1, False: 0]
  ------------------
 5655|      1|    aom_comp_mask_pred = aom_comp_mask_pred_c;
 5656|      1|    if (flags & HAS_SSSE3) aom_comp_mask_pred = aom_comp_mask_pred_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5656:9): [True: 1, False: 0]
  ------------------
 5657|      1|    if (flags & HAS_AVX2) aom_comp_mask_pred = aom_comp_mask_pred_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5657:9): [True: 1, False: 0]
  ------------------
 5658|      1|    aom_compute_correlation = aom_compute_correlation_c;
 5659|      1|    if (flags & HAS_SSE4_1) aom_compute_correlation = aom_compute_correlation_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5659:9): [True: 1, False: 0]
  ------------------
 5660|      1|    if (flags & HAS_AVX2) aom_compute_correlation = aom_compute_correlation_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5660:9): [True: 1, False: 0]
  ------------------
 5661|      1|    aom_compute_flow_at_point = aom_compute_flow_at_point_c;
 5662|      1|    if (flags & HAS_SSE4_1) aom_compute_flow_at_point = aom_compute_flow_at_point_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5662:9): [True: 1, False: 0]
  ------------------
 5663|      1|    if (flags & HAS_AVX2) aom_compute_flow_at_point = aom_compute_flow_at_point_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5663:9): [True: 1, False: 0]
  ------------------
 5664|      1|    aom_compute_mean_stddev = aom_compute_mean_stddev_c;
 5665|      1|    if (flags & HAS_SSE4_1) aom_compute_mean_stddev = aom_compute_mean_stddev_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5665:9): [True: 1, False: 0]
  ------------------
 5666|      1|    if (flags & HAS_AVX2) aom_compute_mean_stddev = aom_compute_mean_stddev_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5666:9): [True: 1, False: 0]
  ------------------
 5667|      1|    aom_convolve8_horiz = aom_convolve8_horiz_c;
 5668|      1|    if (flags & HAS_SSSE3) aom_convolve8_horiz = aom_convolve8_horiz_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5668:9): [True: 1, False: 0]
  ------------------
 5669|      1|    if (flags & HAS_AVX2) aom_convolve8_horiz = aom_convolve8_horiz_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5669:9): [True: 1, False: 0]
  ------------------
 5670|      1|    aom_convolve8_vert = aom_convolve8_vert_c;
 5671|      1|    if (flags & HAS_SSSE3) aom_convolve8_vert = aom_convolve8_vert_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5671:9): [True: 1, False: 0]
  ------------------
 5672|      1|    if (flags & HAS_AVX2) aom_convolve8_vert = aom_convolve8_vert_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5672:9): [True: 1, False: 0]
  ------------------
 5673|      1|    aom_convolve_copy = aom_convolve_copy_sse2;
 5674|      1|    if (flags & HAS_AVX2) aom_convolve_copy = aom_convolve_copy_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5674:9): [True: 1, False: 0]
  ------------------
 5675|      1|    aom_dc_128_predictor_32x16 = aom_dc_128_predictor_32x16_sse2;
 5676|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_32x16 = aom_dc_128_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5676:9): [True: 1, False: 0]
  ------------------
 5677|      1|    aom_dc_128_predictor_32x32 = aom_dc_128_predictor_32x32_sse2;
 5678|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_32x32 = aom_dc_128_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5678:9): [True: 1, False: 0]
  ------------------
 5679|      1|    aom_dc_128_predictor_32x64 = aom_dc_128_predictor_32x64_sse2;
 5680|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_32x64 = aom_dc_128_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5680:9): [True: 1, False: 0]
  ------------------
 5681|      1|    aom_dc_128_predictor_64x16 = aom_dc_128_predictor_64x16_sse2;
 5682|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_64x16 = aom_dc_128_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5682:9): [True: 1, False: 0]
  ------------------
 5683|      1|    aom_dc_128_predictor_64x32 = aom_dc_128_predictor_64x32_sse2;
 5684|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_64x32 = aom_dc_128_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5684:9): [True: 1, False: 0]
  ------------------
 5685|      1|    aom_dc_128_predictor_64x64 = aom_dc_128_predictor_64x64_sse2;
 5686|      1|    if (flags & HAS_AVX2) aom_dc_128_predictor_64x64 = aom_dc_128_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5686:9): [True: 1, False: 0]
  ------------------
 5687|      1|    aom_dc_left_predictor_32x16 = aom_dc_left_predictor_32x16_sse2;
 5688|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_32x16 = aom_dc_left_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5688:9): [True: 1, False: 0]
  ------------------
 5689|      1|    aom_dc_left_predictor_32x32 = aom_dc_left_predictor_32x32_sse2;
 5690|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_32x32 = aom_dc_left_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5690:9): [True: 1, False: 0]
  ------------------
 5691|      1|    aom_dc_left_predictor_32x64 = aom_dc_left_predictor_32x64_sse2;
 5692|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_32x64 = aom_dc_left_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5692:9): [True: 1, False: 0]
  ------------------
 5693|      1|    aom_dc_left_predictor_64x16 = aom_dc_left_predictor_64x16_sse2;
 5694|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_64x16 = aom_dc_left_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5694:9): [True: 1, False: 0]
  ------------------
 5695|      1|    aom_dc_left_predictor_64x32 = aom_dc_left_predictor_64x32_sse2;
 5696|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_64x32 = aom_dc_left_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5696:9): [True: 1, False: 0]
  ------------------
 5697|      1|    aom_dc_left_predictor_64x64 = aom_dc_left_predictor_64x64_sse2;
 5698|      1|    if (flags & HAS_AVX2) aom_dc_left_predictor_64x64 = aom_dc_left_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5698:9): [True: 1, False: 0]
  ------------------
 5699|      1|    aom_dc_predictor_32x16 = aom_dc_predictor_32x16_sse2;
 5700|      1|    if (flags & HAS_AVX2) aom_dc_predictor_32x16 = aom_dc_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5700:9): [True: 1, False: 0]
  ------------------
 5701|      1|    aom_dc_predictor_32x32 = aom_dc_predictor_32x32_sse2;
 5702|      1|    if (flags & HAS_AVX2) aom_dc_predictor_32x32 = aom_dc_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5702:9): [True: 1, False: 0]
  ------------------
 5703|      1|    aom_dc_predictor_32x64 = aom_dc_predictor_32x64_sse2;
 5704|      1|    if (flags & HAS_AVX2) aom_dc_predictor_32x64 = aom_dc_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5704:9): [True: 1, False: 0]
  ------------------
 5705|      1|    aom_dc_predictor_64x16 = aom_dc_predictor_64x16_sse2;
 5706|      1|    if (flags & HAS_AVX2) aom_dc_predictor_64x16 = aom_dc_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5706:9): [True: 1, False: 0]
  ------------------
 5707|      1|    aom_dc_predictor_64x32 = aom_dc_predictor_64x32_sse2;
 5708|      1|    if (flags & HAS_AVX2) aom_dc_predictor_64x32 = aom_dc_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5708:9): [True: 1, False: 0]
  ------------------
 5709|      1|    aom_dc_predictor_64x64 = aom_dc_predictor_64x64_sse2;
 5710|      1|    if (flags & HAS_AVX2) aom_dc_predictor_64x64 = aom_dc_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5710:9): [True: 1, False: 0]
  ------------------
 5711|      1|    aom_dc_top_predictor_32x16 = aom_dc_top_predictor_32x16_sse2;
 5712|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_32x16 = aom_dc_top_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5712:9): [True: 1, False: 0]
  ------------------
 5713|      1|    aom_dc_top_predictor_32x32 = aom_dc_top_predictor_32x32_sse2;
 5714|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_32x32 = aom_dc_top_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5714:9): [True: 1, False: 0]
  ------------------
 5715|      1|    aom_dc_top_predictor_32x64 = aom_dc_top_predictor_32x64_sse2;
 5716|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_32x64 = aom_dc_top_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5716:9): [True: 1, False: 0]
  ------------------
 5717|      1|    aom_dc_top_predictor_64x16 = aom_dc_top_predictor_64x16_sse2;
 5718|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_64x16 = aom_dc_top_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5718:9): [True: 1, False: 0]
  ------------------
 5719|      1|    aom_dc_top_predictor_64x32 = aom_dc_top_predictor_64x32_sse2;
 5720|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_64x32 = aom_dc_top_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5720:9): [True: 1, False: 0]
  ------------------
 5721|      1|    aom_dc_top_predictor_64x64 = aom_dc_top_predictor_64x64_sse2;
 5722|      1|    if (flags & HAS_AVX2) aom_dc_top_predictor_64x64 = aom_dc_top_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5722:9): [True: 1, False: 0]
  ------------------
 5723|      1|    aom_fft16x16_float = aom_fft16x16_float_sse2;
 5724|      1|    if (flags & HAS_AVX2) aom_fft16x16_float = aom_fft16x16_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5724:9): [True: 1, False: 0]
  ------------------
 5725|      1|    aom_fft32x32_float = aom_fft32x32_float_sse2;
 5726|      1|    if (flags & HAS_AVX2) aom_fft32x32_float = aom_fft32x32_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5726:9): [True: 1, False: 0]
  ------------------
 5727|      1|    aom_fft8x8_float = aom_fft8x8_float_sse2;
 5728|      1|    if (flags & HAS_AVX2) aom_fft8x8_float = aom_fft8x8_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5728:9): [True: 1, False: 0]
  ------------------
 5729|      1|    aom_get_blk_sse_sum = aom_get_blk_sse_sum_sse2;
 5730|      1|    if (flags & HAS_AVX2) aom_get_blk_sse_sum = aom_get_blk_sse_sum_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5730:9): [True: 1, False: 0]
  ------------------
 5731|      1|    aom_get_var_sse_sum_16x16_dual = aom_get_var_sse_sum_16x16_dual_sse2;
 5732|      1|    if (flags & HAS_AVX2) aom_get_var_sse_sum_16x16_dual = aom_get_var_sse_sum_16x16_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5732:9): [True: 1, False: 0]
  ------------------
 5733|      1|    aom_get_var_sse_sum_8x8_quad = aom_get_var_sse_sum_8x8_quad_sse2;
 5734|      1|    if (flags & HAS_AVX2) aom_get_var_sse_sum_8x8_quad = aom_get_var_sse_sum_8x8_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5734:9): [True: 1, False: 0]
  ------------------
 5735|      1|    aom_h_predictor_32x32 = aom_h_predictor_32x32_sse2;
 5736|      1|    if (flags & HAS_AVX2) aom_h_predictor_32x32 = aom_h_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5736:9): [True: 1, False: 0]
  ------------------
 5737|      1|    aom_hadamard_16x16 = aom_hadamard_16x16_sse2;
 5738|      1|    if (flags & HAS_AVX2) aom_hadamard_16x16 = aom_hadamard_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5738:9): [True: 1, False: 0]
  ------------------
 5739|      1|    aom_hadamard_32x32 = aom_hadamard_32x32_sse2;
 5740|      1|    if (flags & HAS_AVX2) aom_hadamard_32x32 = aom_hadamard_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5740:9): [True: 1, False: 0]
  ------------------
 5741|      1|    aom_hadamard_lp_16x16 = aom_hadamard_lp_16x16_sse2;
 5742|      1|    if (flags & HAS_AVX2) aom_hadamard_lp_16x16 = aom_hadamard_lp_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5742:9): [True: 1, False: 0]
  ------------------
 5743|      1|    aom_hadamard_lp_8x8_dual = aom_hadamard_lp_8x8_dual_sse2;
 5744|      1|    if (flags & HAS_AVX2) aom_hadamard_lp_8x8_dual = aom_hadamard_lp_8x8_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5744:9): [True: 1, False: 0]
  ------------------
 5745|      1|    aom_highbd_10_masked_sub_pixel_variance128x128 = aom_highbd_10_masked_sub_pixel_variance128x128_c;
 5746|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance128x128 = aom_highbd_10_masked_sub_pixel_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5746:9): [True: 1, False: 0]
  ------------------
 5747|      1|    aom_highbd_10_masked_sub_pixel_variance128x64 = aom_highbd_10_masked_sub_pixel_variance128x64_c;
 5748|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance128x64 = aom_highbd_10_masked_sub_pixel_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5748:9): [True: 1, False: 0]
  ------------------
 5749|      1|    aom_highbd_10_masked_sub_pixel_variance16x16 = aom_highbd_10_masked_sub_pixel_variance16x16_c;
 5750|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance16x16 = aom_highbd_10_masked_sub_pixel_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5750:9): [True: 1, False: 0]
  ------------------
 5751|      1|    aom_highbd_10_masked_sub_pixel_variance16x32 = aom_highbd_10_masked_sub_pixel_variance16x32_c;
 5752|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance16x32 = aom_highbd_10_masked_sub_pixel_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5752:9): [True: 1, False: 0]
  ------------------
 5753|      1|    aom_highbd_10_masked_sub_pixel_variance16x4 = aom_highbd_10_masked_sub_pixel_variance16x4_c;
 5754|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance16x4 = aom_highbd_10_masked_sub_pixel_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5754:9): [True: 1, False: 0]
  ------------------
 5755|      1|    aom_highbd_10_masked_sub_pixel_variance16x64 = aom_highbd_10_masked_sub_pixel_variance16x64_c;
 5756|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance16x64 = aom_highbd_10_masked_sub_pixel_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5756:9): [True: 1, False: 0]
  ------------------
 5757|      1|    aom_highbd_10_masked_sub_pixel_variance16x8 = aom_highbd_10_masked_sub_pixel_variance16x8_c;
 5758|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance16x8 = aom_highbd_10_masked_sub_pixel_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5758:9): [True: 1, False: 0]
  ------------------
 5759|      1|    aom_highbd_10_masked_sub_pixel_variance32x16 = aom_highbd_10_masked_sub_pixel_variance32x16_c;
 5760|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance32x16 = aom_highbd_10_masked_sub_pixel_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5760:9): [True: 1, False: 0]
  ------------------
 5761|      1|    aom_highbd_10_masked_sub_pixel_variance32x32 = aom_highbd_10_masked_sub_pixel_variance32x32_c;
 5762|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance32x32 = aom_highbd_10_masked_sub_pixel_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5762:9): [True: 1, False: 0]
  ------------------
 5763|      1|    aom_highbd_10_masked_sub_pixel_variance32x64 = aom_highbd_10_masked_sub_pixel_variance32x64_c;
 5764|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance32x64 = aom_highbd_10_masked_sub_pixel_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5764:9): [True: 1, False: 0]
  ------------------
 5765|      1|    aom_highbd_10_masked_sub_pixel_variance32x8 = aom_highbd_10_masked_sub_pixel_variance32x8_c;
 5766|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance32x8 = aom_highbd_10_masked_sub_pixel_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5766:9): [True: 1, False: 0]
  ------------------
 5767|      1|    aom_highbd_10_masked_sub_pixel_variance4x16 = aom_highbd_10_masked_sub_pixel_variance4x16_c;
 5768|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance4x16 = aom_highbd_10_masked_sub_pixel_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5768:9): [True: 1, False: 0]
  ------------------
 5769|      1|    aom_highbd_10_masked_sub_pixel_variance4x4 = aom_highbd_10_masked_sub_pixel_variance4x4_c;
 5770|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance4x4 = aom_highbd_10_masked_sub_pixel_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5770:9): [True: 1, False: 0]
  ------------------
 5771|      1|    aom_highbd_10_masked_sub_pixel_variance4x8 = aom_highbd_10_masked_sub_pixel_variance4x8_c;
 5772|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance4x8 = aom_highbd_10_masked_sub_pixel_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5772:9): [True: 1, False: 0]
  ------------------
 5773|      1|    aom_highbd_10_masked_sub_pixel_variance64x128 = aom_highbd_10_masked_sub_pixel_variance64x128_c;
 5774|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance64x128 = aom_highbd_10_masked_sub_pixel_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5774:9): [True: 1, False: 0]
  ------------------
 5775|      1|    aom_highbd_10_masked_sub_pixel_variance64x16 = aom_highbd_10_masked_sub_pixel_variance64x16_c;
 5776|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance64x16 = aom_highbd_10_masked_sub_pixel_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5776:9): [True: 1, False: 0]
  ------------------
 5777|      1|    aom_highbd_10_masked_sub_pixel_variance64x32 = aom_highbd_10_masked_sub_pixel_variance64x32_c;
 5778|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance64x32 = aom_highbd_10_masked_sub_pixel_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5778:9): [True: 1, False: 0]
  ------------------
 5779|      1|    aom_highbd_10_masked_sub_pixel_variance64x64 = aom_highbd_10_masked_sub_pixel_variance64x64_c;
 5780|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance64x64 = aom_highbd_10_masked_sub_pixel_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5780:9): [True: 1, False: 0]
  ------------------
 5781|      1|    aom_highbd_10_masked_sub_pixel_variance8x16 = aom_highbd_10_masked_sub_pixel_variance8x16_c;
 5782|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance8x16 = aom_highbd_10_masked_sub_pixel_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5782:9): [True: 1, False: 0]
  ------------------
 5783|      1|    aom_highbd_10_masked_sub_pixel_variance8x32 = aom_highbd_10_masked_sub_pixel_variance8x32_c;
 5784|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance8x32 = aom_highbd_10_masked_sub_pixel_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5784:9): [True: 1, False: 0]
  ------------------
 5785|      1|    aom_highbd_10_masked_sub_pixel_variance8x4 = aom_highbd_10_masked_sub_pixel_variance8x4_c;
 5786|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance8x4 = aom_highbd_10_masked_sub_pixel_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5786:9): [True: 1, False: 0]
  ------------------
 5787|      1|    aom_highbd_10_masked_sub_pixel_variance8x8 = aom_highbd_10_masked_sub_pixel_variance8x8_c;
 5788|      1|    if (flags & HAS_SSSE3) aom_highbd_10_masked_sub_pixel_variance8x8 = aom_highbd_10_masked_sub_pixel_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5788:9): [True: 1, False: 0]
  ------------------
 5789|      1|    aom_highbd_10_mse16x16 = aom_highbd_10_mse16x16_sse2;
 5790|      1|    if (flags & HAS_AVX2) aom_highbd_10_mse16x16 = aom_highbd_10_mse16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5790:9): [True: 1, False: 0]
  ------------------
 5791|      1|    aom_highbd_10_obmc_variance128x128 = aom_highbd_10_obmc_variance128x128_c;
 5792|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance128x128 = aom_highbd_10_obmc_variance128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5792:9): [True: 1, False: 0]
  ------------------
 5793|      1|    aom_highbd_10_obmc_variance128x64 = aom_highbd_10_obmc_variance128x64_c;
 5794|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance128x64 = aom_highbd_10_obmc_variance128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5794:9): [True: 1, False: 0]
  ------------------
 5795|      1|    aom_highbd_10_obmc_variance16x16 = aom_highbd_10_obmc_variance16x16_c;
 5796|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance16x16 = aom_highbd_10_obmc_variance16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5796:9): [True: 1, False: 0]
  ------------------
 5797|      1|    aom_highbd_10_obmc_variance16x32 = aom_highbd_10_obmc_variance16x32_c;
 5798|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance16x32 = aom_highbd_10_obmc_variance16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5798:9): [True: 1, False: 0]
  ------------------
 5799|      1|    aom_highbd_10_obmc_variance16x4 = aom_highbd_10_obmc_variance16x4_c;
 5800|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance16x4 = aom_highbd_10_obmc_variance16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5800:9): [True: 1, False: 0]
  ------------------
 5801|      1|    aom_highbd_10_obmc_variance16x64 = aom_highbd_10_obmc_variance16x64_c;
 5802|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance16x64 = aom_highbd_10_obmc_variance16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5802:9): [True: 1, False: 0]
  ------------------
 5803|      1|    aom_highbd_10_obmc_variance16x8 = aom_highbd_10_obmc_variance16x8_c;
 5804|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance16x8 = aom_highbd_10_obmc_variance16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5804:9): [True: 1, False: 0]
  ------------------
 5805|      1|    aom_highbd_10_obmc_variance32x16 = aom_highbd_10_obmc_variance32x16_c;
 5806|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance32x16 = aom_highbd_10_obmc_variance32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5806:9): [True: 1, False: 0]
  ------------------
 5807|      1|    aom_highbd_10_obmc_variance32x32 = aom_highbd_10_obmc_variance32x32_c;
 5808|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance32x32 = aom_highbd_10_obmc_variance32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5808:9): [True: 1, False: 0]
  ------------------
 5809|      1|    aom_highbd_10_obmc_variance32x64 = aom_highbd_10_obmc_variance32x64_c;
 5810|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance32x64 = aom_highbd_10_obmc_variance32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5810:9): [True: 1, False: 0]
  ------------------
 5811|      1|    aom_highbd_10_obmc_variance32x8 = aom_highbd_10_obmc_variance32x8_c;
 5812|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance32x8 = aom_highbd_10_obmc_variance32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5812:9): [True: 1, False: 0]
  ------------------
 5813|      1|    aom_highbd_10_obmc_variance4x16 = aom_highbd_10_obmc_variance4x16_c;
 5814|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance4x16 = aom_highbd_10_obmc_variance4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5814:9): [True: 1, False: 0]
  ------------------
 5815|      1|    aom_highbd_10_obmc_variance4x4 = aom_highbd_10_obmc_variance4x4_c;
 5816|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance4x4 = aom_highbd_10_obmc_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5816:9): [True: 1, False: 0]
  ------------------
 5817|      1|    aom_highbd_10_obmc_variance4x8 = aom_highbd_10_obmc_variance4x8_c;
 5818|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance4x8 = aom_highbd_10_obmc_variance4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5818:9): [True: 1, False: 0]
  ------------------
 5819|      1|    aom_highbd_10_obmc_variance64x128 = aom_highbd_10_obmc_variance64x128_c;
 5820|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance64x128 = aom_highbd_10_obmc_variance64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5820:9): [True: 1, False: 0]
  ------------------
 5821|      1|    aom_highbd_10_obmc_variance64x16 = aom_highbd_10_obmc_variance64x16_c;
 5822|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance64x16 = aom_highbd_10_obmc_variance64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5822:9): [True: 1, False: 0]
  ------------------
 5823|      1|    aom_highbd_10_obmc_variance64x32 = aom_highbd_10_obmc_variance64x32_c;
 5824|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance64x32 = aom_highbd_10_obmc_variance64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5824:9): [True: 1, False: 0]
  ------------------
 5825|      1|    aom_highbd_10_obmc_variance64x64 = aom_highbd_10_obmc_variance64x64_c;
 5826|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance64x64 = aom_highbd_10_obmc_variance64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5826:9): [True: 1, False: 0]
  ------------------
 5827|      1|    aom_highbd_10_obmc_variance8x16 = aom_highbd_10_obmc_variance8x16_c;
 5828|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance8x16 = aom_highbd_10_obmc_variance8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5828:9): [True: 1, False: 0]
  ------------------
 5829|      1|    aom_highbd_10_obmc_variance8x32 = aom_highbd_10_obmc_variance8x32_c;
 5830|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance8x32 = aom_highbd_10_obmc_variance8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5830:9): [True: 1, False: 0]
  ------------------
 5831|      1|    aom_highbd_10_obmc_variance8x4 = aom_highbd_10_obmc_variance8x4_c;
 5832|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance8x4 = aom_highbd_10_obmc_variance8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5832:9): [True: 1, False: 0]
  ------------------
 5833|      1|    aom_highbd_10_obmc_variance8x8 = aom_highbd_10_obmc_variance8x8_c;
 5834|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_obmc_variance8x8 = aom_highbd_10_obmc_variance8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5834:9): [True: 1, False: 0]
  ------------------
 5835|      1|    aom_highbd_10_sub_pixel_avg_variance4x4 = aom_highbd_10_sub_pixel_avg_variance4x4_c;
 5836|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_sub_pixel_avg_variance4x4 = aom_highbd_10_sub_pixel_avg_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5836:9): [True: 1, False: 0]
  ------------------
 5837|      1|    aom_highbd_10_sub_pixel_variance128x128 = aom_highbd_10_sub_pixel_variance128x128_sse2;
 5838|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance128x128 = aom_highbd_10_sub_pixel_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5838:9): [True: 1, False: 0]
  ------------------
 5839|      1|    aom_highbd_10_sub_pixel_variance128x64 = aom_highbd_10_sub_pixel_variance128x64_sse2;
 5840|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance128x64 = aom_highbd_10_sub_pixel_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5840:9): [True: 1, False: 0]
  ------------------
 5841|      1|    aom_highbd_10_sub_pixel_variance16x16 = aom_highbd_10_sub_pixel_variance16x16_sse2;
 5842|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance16x16 = aom_highbd_10_sub_pixel_variance16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5842:9): [True: 1, False: 0]
  ------------------
 5843|      1|    aom_highbd_10_sub_pixel_variance16x32 = aom_highbd_10_sub_pixel_variance16x32_sse2;
 5844|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance16x32 = aom_highbd_10_sub_pixel_variance16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5844:9): [True: 1, False: 0]
  ------------------
 5845|      1|    aom_highbd_10_sub_pixel_variance16x8 = aom_highbd_10_sub_pixel_variance16x8_sse2;
 5846|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance16x8 = aom_highbd_10_sub_pixel_variance16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5846:9): [True: 1, False: 0]
  ------------------
 5847|      1|    aom_highbd_10_sub_pixel_variance32x16 = aom_highbd_10_sub_pixel_variance32x16_sse2;
 5848|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance32x16 = aom_highbd_10_sub_pixel_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5848:9): [True: 1, False: 0]
  ------------------
 5849|      1|    aom_highbd_10_sub_pixel_variance32x32 = aom_highbd_10_sub_pixel_variance32x32_sse2;
 5850|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance32x32 = aom_highbd_10_sub_pixel_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5850:9): [True: 1, False: 0]
  ------------------
 5851|      1|    aom_highbd_10_sub_pixel_variance32x64 = aom_highbd_10_sub_pixel_variance32x64_sse2;
 5852|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance32x64 = aom_highbd_10_sub_pixel_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5852:9): [True: 1, False: 0]
  ------------------
 5853|      1|    aom_highbd_10_sub_pixel_variance4x4 = aom_highbd_10_sub_pixel_variance4x4_c;
 5854|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_sub_pixel_variance4x4 = aom_highbd_10_sub_pixel_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5854:9): [True: 1, False: 0]
  ------------------
 5855|      1|    aom_highbd_10_sub_pixel_variance64x128 = aom_highbd_10_sub_pixel_variance64x128_sse2;
 5856|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance64x128 = aom_highbd_10_sub_pixel_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5856:9): [True: 1, False: 0]
  ------------------
 5857|      1|    aom_highbd_10_sub_pixel_variance64x32 = aom_highbd_10_sub_pixel_variance64x32_sse2;
 5858|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance64x32 = aom_highbd_10_sub_pixel_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5858:9): [True: 1, False: 0]
  ------------------
 5859|      1|    aom_highbd_10_sub_pixel_variance64x64 = aom_highbd_10_sub_pixel_variance64x64_sse2;
 5860|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance64x64 = aom_highbd_10_sub_pixel_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5860:9): [True: 1, False: 0]
  ------------------
 5861|      1|    aom_highbd_10_sub_pixel_variance8x16 = aom_highbd_10_sub_pixel_variance8x16_sse2;
 5862|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance8x16 = aom_highbd_10_sub_pixel_variance8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5862:9): [True: 1, False: 0]
  ------------------
 5863|      1|    aom_highbd_10_sub_pixel_variance8x8 = aom_highbd_10_sub_pixel_variance8x8_sse2;
 5864|      1|    if (flags & HAS_AVX2) aom_highbd_10_sub_pixel_variance8x8 = aom_highbd_10_sub_pixel_variance8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5864:9): [True: 1, False: 0]
  ------------------
 5865|      1|    aom_highbd_10_variance128x128 = aom_highbd_10_variance128x128_sse2;
 5866|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance128x128 = aom_highbd_10_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5866:9): [True: 1, False: 0]
  ------------------
 5867|      1|    aom_highbd_10_variance128x64 = aom_highbd_10_variance128x64_sse2;
 5868|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance128x64 = aom_highbd_10_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5868:9): [True: 1, False: 0]
  ------------------
 5869|      1|    aom_highbd_10_variance16x16 = aom_highbd_10_variance16x16_sse2;
 5870|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance16x16 = aom_highbd_10_variance16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5870:9): [True: 1, False: 0]
  ------------------
 5871|      1|    aom_highbd_10_variance16x32 = aom_highbd_10_variance16x32_sse2;
 5872|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance16x32 = aom_highbd_10_variance16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5872:9): [True: 1, False: 0]
  ------------------
 5873|      1|    aom_highbd_10_variance16x64 = aom_highbd_10_variance16x64_sse2;
 5874|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance16x64 = aom_highbd_10_variance16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5874:9): [True: 1, False: 0]
  ------------------
 5875|      1|    aom_highbd_10_variance16x8 = aom_highbd_10_variance16x8_sse2;
 5876|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance16x8 = aom_highbd_10_variance16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5876:9): [True: 1, False: 0]
  ------------------
 5877|      1|    aom_highbd_10_variance32x16 = aom_highbd_10_variance32x16_sse2;
 5878|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance32x16 = aom_highbd_10_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5878:9): [True: 1, False: 0]
  ------------------
 5879|      1|    aom_highbd_10_variance32x32 = aom_highbd_10_variance32x32_sse2;
 5880|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance32x32 = aom_highbd_10_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5880:9): [True: 1, False: 0]
  ------------------
 5881|      1|    aom_highbd_10_variance32x64 = aom_highbd_10_variance32x64_sse2;
 5882|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance32x64 = aom_highbd_10_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5882:9): [True: 1, False: 0]
  ------------------
 5883|      1|    aom_highbd_10_variance32x8 = aom_highbd_10_variance32x8_sse2;
 5884|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance32x8 = aom_highbd_10_variance32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5884:9): [True: 1, False: 0]
  ------------------
 5885|      1|    aom_highbd_10_variance4x4 = aom_highbd_10_variance4x4_c;
 5886|      1|    if (flags & HAS_SSE4_1) aom_highbd_10_variance4x4 = aom_highbd_10_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5886:9): [True: 1, False: 0]
  ------------------
 5887|      1|    aom_highbd_10_variance64x128 = aom_highbd_10_variance64x128_sse2;
 5888|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance64x128 = aom_highbd_10_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5888:9): [True: 1, False: 0]
  ------------------
 5889|      1|    aom_highbd_10_variance64x16 = aom_highbd_10_variance64x16_sse2;
 5890|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance64x16 = aom_highbd_10_variance64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5890:9): [True: 1, False: 0]
  ------------------
 5891|      1|    aom_highbd_10_variance64x32 = aom_highbd_10_variance64x32_sse2;
 5892|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance64x32 = aom_highbd_10_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5892:9): [True: 1, False: 0]
  ------------------
 5893|      1|    aom_highbd_10_variance64x64 = aom_highbd_10_variance64x64_sse2;
 5894|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance64x64 = aom_highbd_10_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5894:9): [True: 1, False: 0]
  ------------------
 5895|      1|    aom_highbd_10_variance8x16 = aom_highbd_10_variance8x16_sse2;
 5896|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance8x16 = aom_highbd_10_variance8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5896:9): [True: 1, False: 0]
  ------------------
 5897|      1|    aom_highbd_10_variance8x32 = aom_highbd_10_variance8x32_sse2;
 5898|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance8x32 = aom_highbd_10_variance8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5898:9): [True: 1, False: 0]
  ------------------
 5899|      1|    aom_highbd_10_variance8x8 = aom_highbd_10_variance8x8_sse2;
 5900|      1|    if (flags & HAS_AVX2) aom_highbd_10_variance8x8 = aom_highbd_10_variance8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (5900:9): [True: 1, False: 0]
  ------------------
 5901|      1|    aom_highbd_12_masked_sub_pixel_variance128x128 = aom_highbd_12_masked_sub_pixel_variance128x128_c;
 5902|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance128x128 = aom_highbd_12_masked_sub_pixel_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5902:9): [True: 1, False: 0]
  ------------------
 5903|      1|    aom_highbd_12_masked_sub_pixel_variance128x64 = aom_highbd_12_masked_sub_pixel_variance128x64_c;
 5904|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance128x64 = aom_highbd_12_masked_sub_pixel_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5904:9): [True: 1, False: 0]
  ------------------
 5905|      1|    aom_highbd_12_masked_sub_pixel_variance16x16 = aom_highbd_12_masked_sub_pixel_variance16x16_c;
 5906|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance16x16 = aom_highbd_12_masked_sub_pixel_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5906:9): [True: 1, False: 0]
  ------------------
 5907|      1|    aom_highbd_12_masked_sub_pixel_variance16x32 = aom_highbd_12_masked_sub_pixel_variance16x32_c;
 5908|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance16x32 = aom_highbd_12_masked_sub_pixel_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5908:9): [True: 1, False: 0]
  ------------------
 5909|      1|    aom_highbd_12_masked_sub_pixel_variance16x4 = aom_highbd_12_masked_sub_pixel_variance16x4_c;
 5910|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance16x4 = aom_highbd_12_masked_sub_pixel_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5910:9): [True: 1, False: 0]
  ------------------
 5911|      1|    aom_highbd_12_masked_sub_pixel_variance16x64 = aom_highbd_12_masked_sub_pixel_variance16x64_c;
 5912|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance16x64 = aom_highbd_12_masked_sub_pixel_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5912:9): [True: 1, False: 0]
  ------------------
 5913|      1|    aom_highbd_12_masked_sub_pixel_variance16x8 = aom_highbd_12_masked_sub_pixel_variance16x8_c;
 5914|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance16x8 = aom_highbd_12_masked_sub_pixel_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5914:9): [True: 1, False: 0]
  ------------------
 5915|      1|    aom_highbd_12_masked_sub_pixel_variance32x16 = aom_highbd_12_masked_sub_pixel_variance32x16_c;
 5916|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance32x16 = aom_highbd_12_masked_sub_pixel_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5916:9): [True: 1, False: 0]
  ------------------
 5917|      1|    aom_highbd_12_masked_sub_pixel_variance32x32 = aom_highbd_12_masked_sub_pixel_variance32x32_c;
 5918|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance32x32 = aom_highbd_12_masked_sub_pixel_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5918:9): [True: 1, False: 0]
  ------------------
 5919|      1|    aom_highbd_12_masked_sub_pixel_variance32x64 = aom_highbd_12_masked_sub_pixel_variance32x64_c;
 5920|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance32x64 = aom_highbd_12_masked_sub_pixel_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5920:9): [True: 1, False: 0]
  ------------------
 5921|      1|    aom_highbd_12_masked_sub_pixel_variance32x8 = aom_highbd_12_masked_sub_pixel_variance32x8_c;
 5922|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance32x8 = aom_highbd_12_masked_sub_pixel_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5922:9): [True: 1, False: 0]
  ------------------
 5923|      1|    aom_highbd_12_masked_sub_pixel_variance4x16 = aom_highbd_12_masked_sub_pixel_variance4x16_c;
 5924|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance4x16 = aom_highbd_12_masked_sub_pixel_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5924:9): [True: 1, False: 0]
  ------------------
 5925|      1|    aom_highbd_12_masked_sub_pixel_variance4x4 = aom_highbd_12_masked_sub_pixel_variance4x4_c;
 5926|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance4x4 = aom_highbd_12_masked_sub_pixel_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5926:9): [True: 1, False: 0]
  ------------------
 5927|      1|    aom_highbd_12_masked_sub_pixel_variance4x8 = aom_highbd_12_masked_sub_pixel_variance4x8_c;
 5928|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance4x8 = aom_highbd_12_masked_sub_pixel_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5928:9): [True: 1, False: 0]
  ------------------
 5929|      1|    aom_highbd_12_masked_sub_pixel_variance64x128 = aom_highbd_12_masked_sub_pixel_variance64x128_c;
 5930|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance64x128 = aom_highbd_12_masked_sub_pixel_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5930:9): [True: 1, False: 0]
  ------------------
 5931|      1|    aom_highbd_12_masked_sub_pixel_variance64x16 = aom_highbd_12_masked_sub_pixel_variance64x16_c;
 5932|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance64x16 = aom_highbd_12_masked_sub_pixel_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5932:9): [True: 1, False: 0]
  ------------------
 5933|      1|    aom_highbd_12_masked_sub_pixel_variance64x32 = aom_highbd_12_masked_sub_pixel_variance64x32_c;
 5934|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance64x32 = aom_highbd_12_masked_sub_pixel_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5934:9): [True: 1, False: 0]
  ------------------
 5935|      1|    aom_highbd_12_masked_sub_pixel_variance64x64 = aom_highbd_12_masked_sub_pixel_variance64x64_c;
 5936|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance64x64 = aom_highbd_12_masked_sub_pixel_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5936:9): [True: 1, False: 0]
  ------------------
 5937|      1|    aom_highbd_12_masked_sub_pixel_variance8x16 = aom_highbd_12_masked_sub_pixel_variance8x16_c;
 5938|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance8x16 = aom_highbd_12_masked_sub_pixel_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5938:9): [True: 1, False: 0]
  ------------------
 5939|      1|    aom_highbd_12_masked_sub_pixel_variance8x32 = aom_highbd_12_masked_sub_pixel_variance8x32_c;
 5940|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance8x32 = aom_highbd_12_masked_sub_pixel_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5940:9): [True: 1, False: 0]
  ------------------
 5941|      1|    aom_highbd_12_masked_sub_pixel_variance8x4 = aom_highbd_12_masked_sub_pixel_variance8x4_c;
 5942|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance8x4 = aom_highbd_12_masked_sub_pixel_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5942:9): [True: 1, False: 0]
  ------------------
 5943|      1|    aom_highbd_12_masked_sub_pixel_variance8x8 = aom_highbd_12_masked_sub_pixel_variance8x8_c;
 5944|      1|    if (flags & HAS_SSSE3) aom_highbd_12_masked_sub_pixel_variance8x8 = aom_highbd_12_masked_sub_pixel_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5944:9): [True: 1, False: 0]
  ------------------
 5945|      1|    aom_highbd_12_obmc_variance128x128 = aom_highbd_12_obmc_variance128x128_c;
 5946|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance128x128 = aom_highbd_12_obmc_variance128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5946:9): [True: 1, False: 0]
  ------------------
 5947|      1|    aom_highbd_12_obmc_variance128x64 = aom_highbd_12_obmc_variance128x64_c;
 5948|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance128x64 = aom_highbd_12_obmc_variance128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5948:9): [True: 1, False: 0]
  ------------------
 5949|      1|    aom_highbd_12_obmc_variance16x16 = aom_highbd_12_obmc_variance16x16_c;
 5950|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance16x16 = aom_highbd_12_obmc_variance16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5950:9): [True: 1, False: 0]
  ------------------
 5951|      1|    aom_highbd_12_obmc_variance16x32 = aom_highbd_12_obmc_variance16x32_c;
 5952|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance16x32 = aom_highbd_12_obmc_variance16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5952:9): [True: 1, False: 0]
  ------------------
 5953|      1|    aom_highbd_12_obmc_variance16x4 = aom_highbd_12_obmc_variance16x4_c;
 5954|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance16x4 = aom_highbd_12_obmc_variance16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5954:9): [True: 1, False: 0]
  ------------------
 5955|      1|    aom_highbd_12_obmc_variance16x64 = aom_highbd_12_obmc_variance16x64_c;
 5956|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance16x64 = aom_highbd_12_obmc_variance16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5956:9): [True: 1, False: 0]
  ------------------
 5957|      1|    aom_highbd_12_obmc_variance16x8 = aom_highbd_12_obmc_variance16x8_c;
 5958|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance16x8 = aom_highbd_12_obmc_variance16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5958:9): [True: 1, False: 0]
  ------------------
 5959|      1|    aom_highbd_12_obmc_variance32x16 = aom_highbd_12_obmc_variance32x16_c;
 5960|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance32x16 = aom_highbd_12_obmc_variance32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5960:9): [True: 1, False: 0]
  ------------------
 5961|      1|    aom_highbd_12_obmc_variance32x32 = aom_highbd_12_obmc_variance32x32_c;
 5962|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance32x32 = aom_highbd_12_obmc_variance32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5962:9): [True: 1, False: 0]
  ------------------
 5963|      1|    aom_highbd_12_obmc_variance32x64 = aom_highbd_12_obmc_variance32x64_c;
 5964|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance32x64 = aom_highbd_12_obmc_variance32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5964:9): [True: 1, False: 0]
  ------------------
 5965|      1|    aom_highbd_12_obmc_variance32x8 = aom_highbd_12_obmc_variance32x8_c;
 5966|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance32x8 = aom_highbd_12_obmc_variance32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5966:9): [True: 1, False: 0]
  ------------------
 5967|      1|    aom_highbd_12_obmc_variance4x16 = aom_highbd_12_obmc_variance4x16_c;
 5968|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance4x16 = aom_highbd_12_obmc_variance4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5968:9): [True: 1, False: 0]
  ------------------
 5969|      1|    aom_highbd_12_obmc_variance4x4 = aom_highbd_12_obmc_variance4x4_c;
 5970|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance4x4 = aom_highbd_12_obmc_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5970:9): [True: 1, False: 0]
  ------------------
 5971|      1|    aom_highbd_12_obmc_variance4x8 = aom_highbd_12_obmc_variance4x8_c;
 5972|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance4x8 = aom_highbd_12_obmc_variance4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5972:9): [True: 1, False: 0]
  ------------------
 5973|      1|    aom_highbd_12_obmc_variance64x128 = aom_highbd_12_obmc_variance64x128_c;
 5974|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance64x128 = aom_highbd_12_obmc_variance64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5974:9): [True: 1, False: 0]
  ------------------
 5975|      1|    aom_highbd_12_obmc_variance64x16 = aom_highbd_12_obmc_variance64x16_c;
 5976|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance64x16 = aom_highbd_12_obmc_variance64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5976:9): [True: 1, False: 0]
  ------------------
 5977|      1|    aom_highbd_12_obmc_variance64x32 = aom_highbd_12_obmc_variance64x32_c;
 5978|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance64x32 = aom_highbd_12_obmc_variance64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5978:9): [True: 1, False: 0]
  ------------------
 5979|      1|    aom_highbd_12_obmc_variance64x64 = aom_highbd_12_obmc_variance64x64_c;
 5980|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance64x64 = aom_highbd_12_obmc_variance64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5980:9): [True: 1, False: 0]
  ------------------
 5981|      1|    aom_highbd_12_obmc_variance8x16 = aom_highbd_12_obmc_variance8x16_c;
 5982|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance8x16 = aom_highbd_12_obmc_variance8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5982:9): [True: 1, False: 0]
  ------------------
 5983|      1|    aom_highbd_12_obmc_variance8x32 = aom_highbd_12_obmc_variance8x32_c;
 5984|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance8x32 = aom_highbd_12_obmc_variance8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5984:9): [True: 1, False: 0]
  ------------------
 5985|      1|    aom_highbd_12_obmc_variance8x4 = aom_highbd_12_obmc_variance8x4_c;
 5986|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance8x4 = aom_highbd_12_obmc_variance8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5986:9): [True: 1, False: 0]
  ------------------
 5987|      1|    aom_highbd_12_obmc_variance8x8 = aom_highbd_12_obmc_variance8x8_c;
 5988|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_obmc_variance8x8 = aom_highbd_12_obmc_variance8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5988:9): [True: 1, False: 0]
  ------------------
 5989|      1|    aom_highbd_12_sub_pixel_avg_variance4x4 = aom_highbd_12_sub_pixel_avg_variance4x4_c;
 5990|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_sub_pixel_avg_variance4x4 = aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5990:9): [True: 1, False: 0]
  ------------------
 5991|      1|    aom_highbd_12_sub_pixel_variance4x4 = aom_highbd_12_sub_pixel_variance4x4_c;
 5992|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_sub_pixel_variance4x4 = aom_highbd_12_sub_pixel_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5992:9): [True: 1, False: 0]
  ------------------
 5993|      1|    aom_highbd_12_variance4x4 = aom_highbd_12_variance4x4_c;
 5994|      1|    if (flags & HAS_SSE4_1) aom_highbd_12_variance4x4 = aom_highbd_12_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (5994:9): [True: 1, False: 0]
  ------------------
 5995|      1|    aom_highbd_8_masked_sub_pixel_variance128x128 = aom_highbd_8_masked_sub_pixel_variance128x128_c;
 5996|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance128x128 = aom_highbd_8_masked_sub_pixel_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5996:9): [True: 1, False: 0]
  ------------------
 5997|      1|    aom_highbd_8_masked_sub_pixel_variance128x64 = aom_highbd_8_masked_sub_pixel_variance128x64_c;
 5998|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance128x64 = aom_highbd_8_masked_sub_pixel_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (5998:9): [True: 1, False: 0]
  ------------------
 5999|      1|    aom_highbd_8_masked_sub_pixel_variance16x16 = aom_highbd_8_masked_sub_pixel_variance16x16_c;
 6000|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance16x16 = aom_highbd_8_masked_sub_pixel_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6000:9): [True: 1, False: 0]
  ------------------
 6001|      1|    aom_highbd_8_masked_sub_pixel_variance16x32 = aom_highbd_8_masked_sub_pixel_variance16x32_c;
 6002|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance16x32 = aom_highbd_8_masked_sub_pixel_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6002:9): [True: 1, False: 0]
  ------------------
 6003|      1|    aom_highbd_8_masked_sub_pixel_variance16x4 = aom_highbd_8_masked_sub_pixel_variance16x4_c;
 6004|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance16x4 = aom_highbd_8_masked_sub_pixel_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6004:9): [True: 1, False: 0]
  ------------------
 6005|      1|    aom_highbd_8_masked_sub_pixel_variance16x64 = aom_highbd_8_masked_sub_pixel_variance16x64_c;
 6006|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance16x64 = aom_highbd_8_masked_sub_pixel_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6006:9): [True: 1, False: 0]
  ------------------
 6007|      1|    aom_highbd_8_masked_sub_pixel_variance16x8 = aom_highbd_8_masked_sub_pixel_variance16x8_c;
 6008|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance16x8 = aom_highbd_8_masked_sub_pixel_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6008:9): [True: 1, False: 0]
  ------------------
 6009|      1|    aom_highbd_8_masked_sub_pixel_variance32x16 = aom_highbd_8_masked_sub_pixel_variance32x16_c;
 6010|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance32x16 = aom_highbd_8_masked_sub_pixel_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6010:9): [True: 1, False: 0]
  ------------------
 6011|      1|    aom_highbd_8_masked_sub_pixel_variance32x32 = aom_highbd_8_masked_sub_pixel_variance32x32_c;
 6012|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance32x32 = aom_highbd_8_masked_sub_pixel_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6012:9): [True: 1, False: 0]
  ------------------
 6013|      1|    aom_highbd_8_masked_sub_pixel_variance32x64 = aom_highbd_8_masked_sub_pixel_variance32x64_c;
 6014|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance32x64 = aom_highbd_8_masked_sub_pixel_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6014:9): [True: 1, False: 0]
  ------------------
 6015|      1|    aom_highbd_8_masked_sub_pixel_variance32x8 = aom_highbd_8_masked_sub_pixel_variance32x8_c;
 6016|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance32x8 = aom_highbd_8_masked_sub_pixel_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6016:9): [True: 1, False: 0]
  ------------------
 6017|      1|    aom_highbd_8_masked_sub_pixel_variance4x16 = aom_highbd_8_masked_sub_pixel_variance4x16_c;
 6018|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance4x16 = aom_highbd_8_masked_sub_pixel_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6018:9): [True: 1, False: 0]
  ------------------
 6019|      1|    aom_highbd_8_masked_sub_pixel_variance4x4 = aom_highbd_8_masked_sub_pixel_variance4x4_c;
 6020|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance4x4 = aom_highbd_8_masked_sub_pixel_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6020:9): [True: 1, False: 0]
  ------------------
 6021|      1|    aom_highbd_8_masked_sub_pixel_variance4x8 = aom_highbd_8_masked_sub_pixel_variance4x8_c;
 6022|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance4x8 = aom_highbd_8_masked_sub_pixel_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6022:9): [True: 1, False: 0]
  ------------------
 6023|      1|    aom_highbd_8_masked_sub_pixel_variance64x128 = aom_highbd_8_masked_sub_pixel_variance64x128_c;
 6024|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance64x128 = aom_highbd_8_masked_sub_pixel_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6024:9): [True: 1, False: 0]
  ------------------
 6025|      1|    aom_highbd_8_masked_sub_pixel_variance64x16 = aom_highbd_8_masked_sub_pixel_variance64x16_c;
 6026|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance64x16 = aom_highbd_8_masked_sub_pixel_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6026:9): [True: 1, False: 0]
  ------------------
 6027|      1|    aom_highbd_8_masked_sub_pixel_variance64x32 = aom_highbd_8_masked_sub_pixel_variance64x32_c;
 6028|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance64x32 = aom_highbd_8_masked_sub_pixel_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6028:9): [True: 1, False: 0]
  ------------------
 6029|      1|    aom_highbd_8_masked_sub_pixel_variance64x64 = aom_highbd_8_masked_sub_pixel_variance64x64_c;
 6030|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance64x64 = aom_highbd_8_masked_sub_pixel_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6030:9): [True: 1, False: 0]
  ------------------
 6031|      1|    aom_highbd_8_masked_sub_pixel_variance8x16 = aom_highbd_8_masked_sub_pixel_variance8x16_c;
 6032|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance8x16 = aom_highbd_8_masked_sub_pixel_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6032:9): [True: 1, False: 0]
  ------------------
 6033|      1|    aom_highbd_8_masked_sub_pixel_variance8x32 = aom_highbd_8_masked_sub_pixel_variance8x32_c;
 6034|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance8x32 = aom_highbd_8_masked_sub_pixel_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6034:9): [True: 1, False: 0]
  ------------------
 6035|      1|    aom_highbd_8_masked_sub_pixel_variance8x4 = aom_highbd_8_masked_sub_pixel_variance8x4_c;
 6036|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance8x4 = aom_highbd_8_masked_sub_pixel_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6036:9): [True: 1, False: 0]
  ------------------
 6037|      1|    aom_highbd_8_masked_sub_pixel_variance8x8 = aom_highbd_8_masked_sub_pixel_variance8x8_c;
 6038|      1|    if (flags & HAS_SSSE3) aom_highbd_8_masked_sub_pixel_variance8x8 = aom_highbd_8_masked_sub_pixel_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6038:9): [True: 1, False: 0]
  ------------------
 6039|      1|    aom_highbd_8_obmc_variance128x128 = aom_highbd_8_obmc_variance128x128_c;
 6040|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance128x128 = aom_highbd_8_obmc_variance128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6040:9): [True: 1, False: 0]
  ------------------
 6041|      1|    aom_highbd_8_obmc_variance128x64 = aom_highbd_8_obmc_variance128x64_c;
 6042|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance128x64 = aom_highbd_8_obmc_variance128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6042:9): [True: 1, False: 0]
  ------------------
 6043|      1|    aom_highbd_8_obmc_variance16x16 = aom_highbd_8_obmc_variance16x16_c;
 6044|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance16x16 = aom_highbd_8_obmc_variance16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6044:9): [True: 1, False: 0]
  ------------------
 6045|      1|    aom_highbd_8_obmc_variance16x32 = aom_highbd_8_obmc_variance16x32_c;
 6046|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance16x32 = aom_highbd_8_obmc_variance16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6046:9): [True: 1, False: 0]
  ------------------
 6047|      1|    aom_highbd_8_obmc_variance16x4 = aom_highbd_8_obmc_variance16x4_c;
 6048|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance16x4 = aom_highbd_8_obmc_variance16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6048:9): [True: 1, False: 0]
  ------------------
 6049|      1|    aom_highbd_8_obmc_variance16x64 = aom_highbd_8_obmc_variance16x64_c;
 6050|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance16x64 = aom_highbd_8_obmc_variance16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6050:9): [True: 1, False: 0]
  ------------------
 6051|      1|    aom_highbd_8_obmc_variance16x8 = aom_highbd_8_obmc_variance16x8_c;
 6052|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance16x8 = aom_highbd_8_obmc_variance16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6052:9): [True: 1, False: 0]
  ------------------
 6053|      1|    aom_highbd_8_obmc_variance32x16 = aom_highbd_8_obmc_variance32x16_c;
 6054|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance32x16 = aom_highbd_8_obmc_variance32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6054:9): [True: 1, False: 0]
  ------------------
 6055|      1|    aom_highbd_8_obmc_variance32x32 = aom_highbd_8_obmc_variance32x32_c;
 6056|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance32x32 = aom_highbd_8_obmc_variance32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6056:9): [True: 1, False: 0]
  ------------------
 6057|      1|    aom_highbd_8_obmc_variance32x64 = aom_highbd_8_obmc_variance32x64_c;
 6058|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance32x64 = aom_highbd_8_obmc_variance32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6058:9): [True: 1, False: 0]
  ------------------
 6059|      1|    aom_highbd_8_obmc_variance32x8 = aom_highbd_8_obmc_variance32x8_c;
 6060|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance32x8 = aom_highbd_8_obmc_variance32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6060:9): [True: 1, False: 0]
  ------------------
 6061|      1|    aom_highbd_8_obmc_variance4x16 = aom_highbd_8_obmc_variance4x16_c;
 6062|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance4x16 = aom_highbd_8_obmc_variance4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6062:9): [True: 1, False: 0]
  ------------------
 6063|      1|    aom_highbd_8_obmc_variance4x4 = aom_highbd_8_obmc_variance4x4_c;
 6064|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance4x4 = aom_highbd_8_obmc_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6064:9): [True: 1, False: 0]
  ------------------
 6065|      1|    aom_highbd_8_obmc_variance4x8 = aom_highbd_8_obmc_variance4x8_c;
 6066|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance4x8 = aom_highbd_8_obmc_variance4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6066:9): [True: 1, False: 0]
  ------------------
 6067|      1|    aom_highbd_8_obmc_variance64x128 = aom_highbd_8_obmc_variance64x128_c;
 6068|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance64x128 = aom_highbd_8_obmc_variance64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6068:9): [True: 1, False: 0]
  ------------------
 6069|      1|    aom_highbd_8_obmc_variance64x16 = aom_highbd_8_obmc_variance64x16_c;
 6070|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance64x16 = aom_highbd_8_obmc_variance64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6070:9): [True: 1, False: 0]
  ------------------
 6071|      1|    aom_highbd_8_obmc_variance64x32 = aom_highbd_8_obmc_variance64x32_c;
 6072|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance64x32 = aom_highbd_8_obmc_variance64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6072:9): [True: 1, False: 0]
  ------------------
 6073|      1|    aom_highbd_8_obmc_variance64x64 = aom_highbd_8_obmc_variance64x64_c;
 6074|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance64x64 = aom_highbd_8_obmc_variance64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6074:9): [True: 1, False: 0]
  ------------------
 6075|      1|    aom_highbd_8_obmc_variance8x16 = aom_highbd_8_obmc_variance8x16_c;
 6076|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance8x16 = aom_highbd_8_obmc_variance8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6076:9): [True: 1, False: 0]
  ------------------
 6077|      1|    aom_highbd_8_obmc_variance8x32 = aom_highbd_8_obmc_variance8x32_c;
 6078|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance8x32 = aom_highbd_8_obmc_variance8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6078:9): [True: 1, False: 0]
  ------------------
 6079|      1|    aom_highbd_8_obmc_variance8x4 = aom_highbd_8_obmc_variance8x4_c;
 6080|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance8x4 = aom_highbd_8_obmc_variance8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6080:9): [True: 1, False: 0]
  ------------------
 6081|      1|    aom_highbd_8_obmc_variance8x8 = aom_highbd_8_obmc_variance8x8_c;
 6082|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_obmc_variance8x8 = aom_highbd_8_obmc_variance8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6082:9): [True: 1, False: 0]
  ------------------
 6083|      1|    aom_highbd_8_sub_pixel_avg_variance4x4 = aom_highbd_8_sub_pixel_avg_variance4x4_c;
 6084|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_sub_pixel_avg_variance4x4 = aom_highbd_8_sub_pixel_avg_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6084:9): [True: 1, False: 0]
  ------------------
 6085|      1|    aom_highbd_8_sub_pixel_variance4x4 = aom_highbd_8_sub_pixel_variance4x4_c;
 6086|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_sub_pixel_variance4x4 = aom_highbd_8_sub_pixel_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6086:9): [True: 1, False: 0]
  ------------------
 6087|      1|    aom_highbd_8_variance4x4 = aom_highbd_8_variance4x4_c;
 6088|      1|    if (flags & HAS_SSE4_1) aom_highbd_8_variance4x4 = aom_highbd_8_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6088:9): [True: 1, False: 0]
  ------------------
 6089|      1|    aom_highbd_blend_a64_d16_mask = aom_highbd_blend_a64_d16_mask_c;
 6090|      1|    if (flags & HAS_SSE4_1) aom_highbd_blend_a64_d16_mask = aom_highbd_blend_a64_d16_mask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6090:9): [True: 1, False: 0]
  ------------------
 6091|      1|    if (flags & HAS_AVX2) aom_highbd_blend_a64_d16_mask = aom_highbd_blend_a64_d16_mask_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6091:9): [True: 1, False: 0]
  ------------------
 6092|      1|    aom_highbd_blend_a64_hmask = aom_highbd_blend_a64_hmask_c;
 6093|      1|    if (flags & HAS_SSE4_1) aom_highbd_blend_a64_hmask = aom_highbd_blend_a64_hmask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6093:9): [True: 1, False: 0]
  ------------------
 6094|      1|    aom_highbd_blend_a64_mask = aom_highbd_blend_a64_mask_c;
 6095|      1|    if (flags & HAS_SSE4_1) aom_highbd_blend_a64_mask = aom_highbd_blend_a64_mask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6095:9): [True: 1, False: 0]
  ------------------
 6096|      1|    aom_highbd_blend_a64_vmask = aom_highbd_blend_a64_vmask_c;
 6097|      1|    if (flags & HAS_SSE4_1) aom_highbd_blend_a64_vmask = aom_highbd_blend_a64_vmask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6097:9): [True: 1, False: 0]
  ------------------
 6098|      1|    aom_highbd_calc_variance_stat = aom_highbd_calc_variance_stat_c;
 6099|      1|    if (flags & HAS_AVX2) aom_highbd_calc_variance_stat = aom_highbd_calc_variance_stat_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6099:9): [True: 1, False: 0]
  ------------------
 6100|      1|    aom_highbd_comp_mask_pred = aom_highbd_comp_mask_pred_sse2;
 6101|      1|    if (flags & HAS_AVX2) aom_highbd_comp_mask_pred = aom_highbd_comp_mask_pred_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6101:9): [True: 1, False: 0]
  ------------------
 6102|      1|    aom_highbd_convolve8_horiz = aom_highbd_convolve8_horiz_sse2;
 6103|      1|    if (flags & HAS_AVX2) aom_highbd_convolve8_horiz = aom_highbd_convolve8_horiz_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6103:9): [True: 1, False: 0]
  ------------------
 6104|      1|    aom_highbd_convolve8_vert = aom_highbd_convolve8_vert_sse2;
 6105|      1|    if (flags & HAS_AVX2) aom_highbd_convolve8_vert = aom_highbd_convolve8_vert_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6105:9): [True: 1, False: 0]
  ------------------
 6106|      1|    aom_highbd_convolve_copy = aom_highbd_convolve_copy_sse2;
 6107|      1|    if (flags & HAS_AVX2) aom_highbd_convolve_copy = aom_highbd_convolve_copy_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6107:9): [True: 1, False: 0]
  ------------------
 6108|      1|    aom_highbd_hadamard_16x16 = aom_highbd_hadamard_16x16_c;
 6109|      1|    if (flags & HAS_AVX2) aom_highbd_hadamard_16x16 = aom_highbd_hadamard_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6109:9): [True: 1, False: 0]
  ------------------
 6110|      1|    aom_highbd_hadamard_32x32 = aom_highbd_hadamard_32x32_c;
 6111|      1|    if (flags & HAS_AVX2) aom_highbd_hadamard_32x32 = aom_highbd_hadamard_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6111:9): [True: 1, False: 0]
  ------------------
 6112|      1|    aom_highbd_hadamard_8x8 = aom_highbd_hadamard_8x8_c;
 6113|      1|    if (flags & HAS_AVX2) aom_highbd_hadamard_8x8 = aom_highbd_hadamard_8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6113:9): [True: 1, False: 0]
  ------------------
 6114|      1|    aom_highbd_lpf_horizontal_14_dual = aom_highbd_lpf_horizontal_14_dual_sse2;
 6115|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_horizontal_14_dual = aom_highbd_lpf_horizontal_14_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6115:9): [True: 1, False: 0]
  ------------------
 6116|      1|    aom_highbd_lpf_horizontal_4_dual = aom_highbd_lpf_horizontal_4_dual_sse2;
 6117|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_horizontal_4_dual = aom_highbd_lpf_horizontal_4_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6117:9): [True: 1, False: 0]
  ------------------
 6118|      1|    aom_highbd_lpf_horizontal_8_dual = aom_highbd_lpf_horizontal_8_dual_sse2;
 6119|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_horizontal_8_dual = aom_highbd_lpf_horizontal_8_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6119:9): [True: 1, False: 0]
  ------------------
 6120|      1|    aom_highbd_lpf_vertical_14_dual = aom_highbd_lpf_vertical_14_dual_sse2;
 6121|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_vertical_14_dual = aom_highbd_lpf_vertical_14_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6121:9): [True: 1, False: 0]
  ------------------
 6122|      1|    aom_highbd_lpf_vertical_4_dual = aom_highbd_lpf_vertical_4_dual_sse2;
 6123|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_vertical_4_dual = aom_highbd_lpf_vertical_4_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6123:9): [True: 1, False: 0]
  ------------------
 6124|      1|    aom_highbd_lpf_vertical_8_dual = aom_highbd_lpf_vertical_8_dual_sse2;
 6125|      1|    if (flags & HAS_AVX2) aom_highbd_lpf_vertical_8_dual = aom_highbd_lpf_vertical_8_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6125:9): [True: 1, False: 0]
  ------------------
 6126|      1|    aom_highbd_masked_sad128x128 = aom_highbd_masked_sad128x128_c;
 6127|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad128x128 = aom_highbd_masked_sad128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6127:9): [True: 1, False: 0]
  ------------------
 6128|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad128x128 = aom_highbd_masked_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6128:9): [True: 1, False: 0]
  ------------------
 6129|      1|    aom_highbd_masked_sad128x64 = aom_highbd_masked_sad128x64_c;
 6130|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad128x64 = aom_highbd_masked_sad128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6130:9): [True: 1, False: 0]
  ------------------
 6131|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad128x64 = aom_highbd_masked_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6131:9): [True: 1, False: 0]
  ------------------
 6132|      1|    aom_highbd_masked_sad16x16 = aom_highbd_masked_sad16x16_c;
 6133|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad16x16 = aom_highbd_masked_sad16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6133:9): [True: 1, False: 0]
  ------------------
 6134|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad16x16 = aom_highbd_masked_sad16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6134:9): [True: 1, False: 0]
  ------------------
 6135|      1|    aom_highbd_masked_sad16x32 = aom_highbd_masked_sad16x32_c;
 6136|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad16x32 = aom_highbd_masked_sad16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6136:9): [True: 1, False: 0]
  ------------------
 6137|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad16x32 = aom_highbd_masked_sad16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6137:9): [True: 1, False: 0]
  ------------------
 6138|      1|    aom_highbd_masked_sad16x4 = aom_highbd_masked_sad16x4_c;
 6139|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad16x4 = aom_highbd_masked_sad16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6139:9): [True: 1, False: 0]
  ------------------
 6140|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad16x4 = aom_highbd_masked_sad16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6140:9): [True: 1, False: 0]
  ------------------
 6141|      1|    aom_highbd_masked_sad16x64 = aom_highbd_masked_sad16x64_c;
 6142|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad16x64 = aom_highbd_masked_sad16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6142:9): [True: 1, False: 0]
  ------------------
 6143|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad16x64 = aom_highbd_masked_sad16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6143:9): [True: 1, False: 0]
  ------------------
 6144|      1|    aom_highbd_masked_sad16x8 = aom_highbd_masked_sad16x8_c;
 6145|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad16x8 = aom_highbd_masked_sad16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6145:9): [True: 1, False: 0]
  ------------------
 6146|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad16x8 = aom_highbd_masked_sad16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6146:9): [True: 1, False: 0]
  ------------------
 6147|      1|    aom_highbd_masked_sad32x16 = aom_highbd_masked_sad32x16_c;
 6148|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad32x16 = aom_highbd_masked_sad32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6148:9): [True: 1, False: 0]
  ------------------
 6149|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad32x16 = aom_highbd_masked_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6149:9): [True: 1, False: 0]
  ------------------
 6150|      1|    aom_highbd_masked_sad32x32 = aom_highbd_masked_sad32x32_c;
 6151|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad32x32 = aom_highbd_masked_sad32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6151:9): [True: 1, False: 0]
  ------------------
 6152|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad32x32 = aom_highbd_masked_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6152:9): [True: 1, False: 0]
  ------------------
 6153|      1|    aom_highbd_masked_sad32x64 = aom_highbd_masked_sad32x64_c;
 6154|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad32x64 = aom_highbd_masked_sad32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6154:9): [True: 1, False: 0]
  ------------------
 6155|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad32x64 = aom_highbd_masked_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6155:9): [True: 1, False: 0]
  ------------------
 6156|      1|    aom_highbd_masked_sad32x8 = aom_highbd_masked_sad32x8_c;
 6157|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad32x8 = aom_highbd_masked_sad32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6157:9): [True: 1, False: 0]
  ------------------
 6158|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad32x8 = aom_highbd_masked_sad32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6158:9): [True: 1, False: 0]
  ------------------
 6159|      1|    aom_highbd_masked_sad4x16 = aom_highbd_masked_sad4x16_c;
 6160|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad4x16 = aom_highbd_masked_sad4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6160:9): [True: 1, False: 0]
  ------------------
 6161|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad4x16 = aom_highbd_masked_sad4x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6161:9): [True: 1, False: 0]
  ------------------
 6162|      1|    aom_highbd_masked_sad4x4 = aom_highbd_masked_sad4x4_c;
 6163|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad4x4 = aom_highbd_masked_sad4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6163:9): [True: 1, False: 0]
  ------------------
 6164|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad4x4 = aom_highbd_masked_sad4x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6164:9): [True: 1, False: 0]
  ------------------
 6165|      1|    aom_highbd_masked_sad4x8 = aom_highbd_masked_sad4x8_c;
 6166|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad4x8 = aom_highbd_masked_sad4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6166:9): [True: 1, False: 0]
  ------------------
 6167|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad4x8 = aom_highbd_masked_sad4x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6167:9): [True: 1, False: 0]
  ------------------
 6168|      1|    aom_highbd_masked_sad64x128 = aom_highbd_masked_sad64x128_c;
 6169|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad64x128 = aom_highbd_masked_sad64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6169:9): [True: 1, False: 0]
  ------------------
 6170|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad64x128 = aom_highbd_masked_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6170:9): [True: 1, False: 0]
  ------------------
 6171|      1|    aom_highbd_masked_sad64x16 = aom_highbd_masked_sad64x16_c;
 6172|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad64x16 = aom_highbd_masked_sad64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6172:9): [True: 1, False: 0]
  ------------------
 6173|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad64x16 = aom_highbd_masked_sad64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6173:9): [True: 1, False: 0]
  ------------------
 6174|      1|    aom_highbd_masked_sad64x32 = aom_highbd_masked_sad64x32_c;
 6175|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad64x32 = aom_highbd_masked_sad64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6175:9): [True: 1, False: 0]
  ------------------
 6176|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad64x32 = aom_highbd_masked_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6176:9): [True: 1, False: 0]
  ------------------
 6177|      1|    aom_highbd_masked_sad64x64 = aom_highbd_masked_sad64x64_c;
 6178|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad64x64 = aom_highbd_masked_sad64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6178:9): [True: 1, False: 0]
  ------------------
 6179|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad64x64 = aom_highbd_masked_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6179:9): [True: 1, False: 0]
  ------------------
 6180|      1|    aom_highbd_masked_sad8x16 = aom_highbd_masked_sad8x16_c;
 6181|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad8x16 = aom_highbd_masked_sad8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6181:9): [True: 1, False: 0]
  ------------------
 6182|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad8x16 = aom_highbd_masked_sad8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6182:9): [True: 1, False: 0]
  ------------------
 6183|      1|    aom_highbd_masked_sad8x32 = aom_highbd_masked_sad8x32_c;
 6184|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad8x32 = aom_highbd_masked_sad8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6184:9): [True: 1, False: 0]
  ------------------
 6185|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad8x32 = aom_highbd_masked_sad8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6185:9): [True: 1, False: 0]
  ------------------
 6186|      1|    aom_highbd_masked_sad8x4 = aom_highbd_masked_sad8x4_c;
 6187|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad8x4 = aom_highbd_masked_sad8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6187:9): [True: 1, False: 0]
  ------------------
 6188|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad8x4 = aom_highbd_masked_sad8x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6188:9): [True: 1, False: 0]
  ------------------
 6189|      1|    aom_highbd_masked_sad8x8 = aom_highbd_masked_sad8x8_c;
 6190|      1|    if (flags & HAS_SSSE3) aom_highbd_masked_sad8x8 = aom_highbd_masked_sad8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6190:9): [True: 1, False: 0]
  ------------------
 6191|      1|    if (flags & HAS_AVX2) aom_highbd_masked_sad8x8 = aom_highbd_masked_sad8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6191:9): [True: 1, False: 0]
  ------------------
 6192|      1|    aom_highbd_obmc_sad128x128 = aom_highbd_obmc_sad128x128_c;
 6193|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad128x128 = aom_highbd_obmc_sad128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6193:9): [True: 1, False: 0]
  ------------------
 6194|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad128x128 = aom_highbd_obmc_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6194:9): [True: 1, False: 0]
  ------------------
 6195|      1|    aom_highbd_obmc_sad128x64 = aom_highbd_obmc_sad128x64_c;
 6196|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad128x64 = aom_highbd_obmc_sad128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6196:9): [True: 1, False: 0]
  ------------------
 6197|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad128x64 = aom_highbd_obmc_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6197:9): [True: 1, False: 0]
  ------------------
 6198|      1|    aom_highbd_obmc_sad16x16 = aom_highbd_obmc_sad16x16_c;
 6199|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad16x16 = aom_highbd_obmc_sad16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6199:9): [True: 1, False: 0]
  ------------------
 6200|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad16x16 = aom_highbd_obmc_sad16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6200:9): [True: 1, False: 0]
  ------------------
 6201|      1|    aom_highbd_obmc_sad16x32 = aom_highbd_obmc_sad16x32_c;
 6202|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad16x32 = aom_highbd_obmc_sad16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6202:9): [True: 1, False: 0]
  ------------------
 6203|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad16x32 = aom_highbd_obmc_sad16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6203:9): [True: 1, False: 0]
  ------------------
 6204|      1|    aom_highbd_obmc_sad16x4 = aom_highbd_obmc_sad16x4_c;
 6205|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad16x4 = aom_highbd_obmc_sad16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6205:9): [True: 1, False: 0]
  ------------------
 6206|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad16x4 = aom_highbd_obmc_sad16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6206:9): [True: 1, False: 0]
  ------------------
 6207|      1|    aom_highbd_obmc_sad16x64 = aom_highbd_obmc_sad16x64_c;
 6208|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad16x64 = aom_highbd_obmc_sad16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6208:9): [True: 1, False: 0]
  ------------------
 6209|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad16x64 = aom_highbd_obmc_sad16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6209:9): [True: 1, False: 0]
  ------------------
 6210|      1|    aom_highbd_obmc_sad16x8 = aom_highbd_obmc_sad16x8_c;
 6211|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad16x8 = aom_highbd_obmc_sad16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6211:9): [True: 1, False: 0]
  ------------------
 6212|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad16x8 = aom_highbd_obmc_sad16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6212:9): [True: 1, False: 0]
  ------------------
 6213|      1|    aom_highbd_obmc_sad32x16 = aom_highbd_obmc_sad32x16_c;
 6214|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad32x16 = aom_highbd_obmc_sad32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6214:9): [True: 1, False: 0]
  ------------------
 6215|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad32x16 = aom_highbd_obmc_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6215:9): [True: 1, False: 0]
  ------------------
 6216|      1|    aom_highbd_obmc_sad32x32 = aom_highbd_obmc_sad32x32_c;
 6217|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad32x32 = aom_highbd_obmc_sad32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6217:9): [True: 1, False: 0]
  ------------------
 6218|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad32x32 = aom_highbd_obmc_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6218:9): [True: 1, False: 0]
  ------------------
 6219|      1|    aom_highbd_obmc_sad32x64 = aom_highbd_obmc_sad32x64_c;
 6220|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad32x64 = aom_highbd_obmc_sad32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6220:9): [True: 1, False: 0]
  ------------------
 6221|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad32x64 = aom_highbd_obmc_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6221:9): [True: 1, False: 0]
  ------------------
 6222|      1|    aom_highbd_obmc_sad32x8 = aom_highbd_obmc_sad32x8_c;
 6223|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad32x8 = aom_highbd_obmc_sad32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6223:9): [True: 1, False: 0]
  ------------------
 6224|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad32x8 = aom_highbd_obmc_sad32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6224:9): [True: 1, False: 0]
  ------------------
 6225|      1|    aom_highbd_obmc_sad4x16 = aom_highbd_obmc_sad4x16_c;
 6226|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad4x16 = aom_highbd_obmc_sad4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6226:9): [True: 1, False: 0]
  ------------------
 6227|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad4x16 = aom_highbd_obmc_sad4x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6227:9): [True: 1, False: 0]
  ------------------
 6228|      1|    aom_highbd_obmc_sad4x4 = aom_highbd_obmc_sad4x4_c;
 6229|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad4x4 = aom_highbd_obmc_sad4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6229:9): [True: 1, False: 0]
  ------------------
 6230|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad4x4 = aom_highbd_obmc_sad4x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6230:9): [True: 1, False: 0]
  ------------------
 6231|      1|    aom_highbd_obmc_sad4x8 = aom_highbd_obmc_sad4x8_c;
 6232|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad4x8 = aom_highbd_obmc_sad4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6232:9): [True: 1, False: 0]
  ------------------
 6233|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad4x8 = aom_highbd_obmc_sad4x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6233:9): [True: 1, False: 0]
  ------------------
 6234|      1|    aom_highbd_obmc_sad64x128 = aom_highbd_obmc_sad64x128_c;
 6235|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad64x128 = aom_highbd_obmc_sad64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6235:9): [True: 1, False: 0]
  ------------------
 6236|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad64x128 = aom_highbd_obmc_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6236:9): [True: 1, False: 0]
  ------------------
 6237|      1|    aom_highbd_obmc_sad64x16 = aom_highbd_obmc_sad64x16_c;
 6238|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad64x16 = aom_highbd_obmc_sad64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6238:9): [True: 1, False: 0]
  ------------------
 6239|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad64x16 = aom_highbd_obmc_sad64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6239:9): [True: 1, False: 0]
  ------------------
 6240|      1|    aom_highbd_obmc_sad64x32 = aom_highbd_obmc_sad64x32_c;
 6241|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad64x32 = aom_highbd_obmc_sad64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6241:9): [True: 1, False: 0]
  ------------------
 6242|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad64x32 = aom_highbd_obmc_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6242:9): [True: 1, False: 0]
  ------------------
 6243|      1|    aom_highbd_obmc_sad64x64 = aom_highbd_obmc_sad64x64_c;
 6244|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad64x64 = aom_highbd_obmc_sad64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6244:9): [True: 1, False: 0]
  ------------------
 6245|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad64x64 = aom_highbd_obmc_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6245:9): [True: 1, False: 0]
  ------------------
 6246|      1|    aom_highbd_obmc_sad8x16 = aom_highbd_obmc_sad8x16_c;
 6247|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad8x16 = aom_highbd_obmc_sad8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6247:9): [True: 1, False: 0]
  ------------------
 6248|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad8x16 = aom_highbd_obmc_sad8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6248:9): [True: 1, False: 0]
  ------------------
 6249|      1|    aom_highbd_obmc_sad8x32 = aom_highbd_obmc_sad8x32_c;
 6250|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad8x32 = aom_highbd_obmc_sad8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6250:9): [True: 1, False: 0]
  ------------------
 6251|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad8x32 = aom_highbd_obmc_sad8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6251:9): [True: 1, False: 0]
  ------------------
 6252|      1|    aom_highbd_obmc_sad8x4 = aom_highbd_obmc_sad8x4_c;
 6253|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad8x4 = aom_highbd_obmc_sad8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6253:9): [True: 1, False: 0]
  ------------------
 6254|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad8x4 = aom_highbd_obmc_sad8x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6254:9): [True: 1, False: 0]
  ------------------
 6255|      1|    aom_highbd_obmc_sad8x8 = aom_highbd_obmc_sad8x8_c;
 6256|      1|    if (flags & HAS_SSE4_1) aom_highbd_obmc_sad8x8 = aom_highbd_obmc_sad8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6256:9): [True: 1, False: 0]
  ------------------
 6257|      1|    if (flags & HAS_AVX2) aom_highbd_obmc_sad8x8 = aom_highbd_obmc_sad8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6257:9): [True: 1, False: 0]
  ------------------
 6258|      1|    aom_highbd_quantize_b = aom_highbd_quantize_b_sse2;
 6259|      1|    if (flags & HAS_AVX2) aom_highbd_quantize_b = aom_highbd_quantize_b_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6259:9): [True: 1, False: 0]
  ------------------
 6260|      1|    aom_highbd_quantize_b_32x32 = aom_highbd_quantize_b_32x32_sse2;
 6261|      1|    if (flags & HAS_AVX2) aom_highbd_quantize_b_32x32 = aom_highbd_quantize_b_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6261:9): [True: 1, False: 0]
  ------------------
 6262|      1|    aom_highbd_quantize_b_32x32_adaptive = aom_highbd_quantize_b_32x32_adaptive_sse2;
 6263|      1|    if (flags & HAS_AVX2) aom_highbd_quantize_b_32x32_adaptive = aom_highbd_quantize_b_32x32_adaptive_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6263:9): [True: 1, False: 0]
  ------------------
 6264|      1|    aom_highbd_quantize_b_64x64 = aom_highbd_quantize_b_64x64_sse2;
 6265|      1|    if (flags & HAS_AVX2) aom_highbd_quantize_b_64x64 = aom_highbd_quantize_b_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6265:9): [True: 1, False: 0]
  ------------------
 6266|      1|    aom_highbd_quantize_b_adaptive = aom_highbd_quantize_b_adaptive_sse2;
 6267|      1|    if (flags & HAS_AVX2) aom_highbd_quantize_b_adaptive = aom_highbd_quantize_b_adaptive_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6267:9): [True: 1, False: 0]
  ------------------
 6268|      1|    aom_highbd_sad128x128 = aom_highbd_sad128x128_c;
 6269|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x128 = aom_highbd_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6269:9): [True: 1, False: 0]
  ------------------
 6270|      1|    aom_highbd_sad128x128_avg = aom_highbd_sad128x128_avg_c;
 6271|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x128_avg = aom_highbd_sad128x128_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6271:9): [True: 1, False: 0]
  ------------------
 6272|      1|    aom_highbd_sad128x128x3d = aom_highbd_sad128x128x3d_c;
 6273|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x128x3d = aom_highbd_sad128x128x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6273:9): [True: 1, False: 0]
  ------------------
 6274|      1|    aom_highbd_sad128x128x4d = aom_highbd_sad128x128x4d_c;
 6275|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x128x4d = aom_highbd_sad128x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6275:9): [True: 1, False: 0]
  ------------------
 6276|      1|    aom_highbd_sad128x64 = aom_highbd_sad128x64_c;
 6277|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x64 = aom_highbd_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6277:9): [True: 1, False: 0]
  ------------------
 6278|      1|    aom_highbd_sad128x64_avg = aom_highbd_sad128x64_avg_c;
 6279|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x64_avg = aom_highbd_sad128x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6279:9): [True: 1, False: 0]
  ------------------
 6280|      1|    aom_highbd_sad128x64x3d = aom_highbd_sad128x64x3d_c;
 6281|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x64x3d = aom_highbd_sad128x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6281:9): [True: 1, False: 0]
  ------------------
 6282|      1|    aom_highbd_sad128x64x4d = aom_highbd_sad128x64x4d_c;
 6283|      1|    if (flags & HAS_AVX2) aom_highbd_sad128x64x4d = aom_highbd_sad128x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6283:9): [True: 1, False: 0]
  ------------------
 6284|      1|    aom_highbd_sad16x16 = aom_highbd_sad16x16_sse2;
 6285|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x16 = aom_highbd_sad16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6285:9): [True: 1, False: 0]
  ------------------
 6286|      1|    aom_highbd_sad16x16_avg = aom_highbd_sad16x16_avg_sse2;
 6287|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x16_avg = aom_highbd_sad16x16_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6287:9): [True: 1, False: 0]
  ------------------
 6288|      1|    aom_highbd_sad16x16x3d = aom_highbd_sad16x16x3d_c;
 6289|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x16x3d = aom_highbd_sad16x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6289:9): [True: 1, False: 0]
  ------------------
 6290|      1|    aom_highbd_sad16x16x4d = aom_highbd_sad16x16x4d_sse2;
 6291|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x16x4d = aom_highbd_sad16x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6291:9): [True: 1, False: 0]
  ------------------
 6292|      1|    aom_highbd_sad16x32 = aom_highbd_sad16x32_sse2;
 6293|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x32 = aom_highbd_sad16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6293:9): [True: 1, False: 0]
  ------------------
 6294|      1|    aom_highbd_sad16x32_avg = aom_highbd_sad16x32_avg_sse2;
 6295|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x32_avg = aom_highbd_sad16x32_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6295:9): [True: 1, False: 0]
  ------------------
 6296|      1|    aom_highbd_sad16x32x3d = aom_highbd_sad16x32x3d_c;
 6297|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x32x3d = aom_highbd_sad16x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6297:9): [True: 1, False: 0]
  ------------------
 6298|      1|    aom_highbd_sad16x32x4d = aom_highbd_sad16x32x4d_sse2;
 6299|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x32x4d = aom_highbd_sad16x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6299:9): [True: 1, False: 0]
  ------------------
 6300|      1|    aom_highbd_sad16x4 = aom_highbd_sad16x4_sse2;
 6301|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x4 = aom_highbd_sad16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6301:9): [True: 1, False: 0]
  ------------------
 6302|      1|    aom_highbd_sad16x4x3d = aom_highbd_sad16x4x3d_c;
 6303|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x4x3d = aom_highbd_sad16x4x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6303:9): [True: 1, False: 0]
  ------------------
 6304|      1|    aom_highbd_sad16x4x4d = aom_highbd_sad16x4x4d_sse2;
 6305|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x4x4d = aom_highbd_sad16x4x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6305:9): [True: 1, False: 0]
  ------------------
 6306|      1|    aom_highbd_sad16x64 = aom_highbd_sad16x64_sse2;
 6307|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x64 = aom_highbd_sad16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6307:9): [True: 1, False: 0]
  ------------------
 6308|      1|    aom_highbd_sad16x64_avg = aom_highbd_sad16x64_avg_sse2;
 6309|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x64_avg = aom_highbd_sad16x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6309:9): [True: 1, False: 0]
  ------------------
 6310|      1|    aom_highbd_sad16x64x3d = aom_highbd_sad16x64x3d_c;
 6311|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x64x3d = aom_highbd_sad16x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6311:9): [True: 1, False: 0]
  ------------------
 6312|      1|    aom_highbd_sad16x64x4d = aom_highbd_sad16x64x4d_sse2;
 6313|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x64x4d = aom_highbd_sad16x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6313:9): [True: 1, False: 0]
  ------------------
 6314|      1|    aom_highbd_sad16x8 = aom_highbd_sad16x8_sse2;
 6315|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x8 = aom_highbd_sad16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6315:9): [True: 1, False: 0]
  ------------------
 6316|      1|    aom_highbd_sad16x8_avg = aom_highbd_sad16x8_avg_sse2;
 6317|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x8_avg = aom_highbd_sad16x8_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6317:9): [True: 1, False: 0]
  ------------------
 6318|      1|    aom_highbd_sad16x8x3d = aom_highbd_sad16x8x3d_c;
 6319|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x8x3d = aom_highbd_sad16x8x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6319:9): [True: 1, False: 0]
  ------------------
 6320|      1|    aom_highbd_sad16x8x4d = aom_highbd_sad16x8x4d_sse2;
 6321|      1|    if (flags & HAS_AVX2) aom_highbd_sad16x8x4d = aom_highbd_sad16x8x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6321:9): [True: 1, False: 0]
  ------------------
 6322|      1|    aom_highbd_sad32x16 = aom_highbd_sad32x16_sse2;
 6323|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x16 = aom_highbd_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6323:9): [True: 1, False: 0]
  ------------------
 6324|      1|    aom_highbd_sad32x16_avg = aom_highbd_sad32x16_avg_sse2;
 6325|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x16_avg = aom_highbd_sad32x16_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6325:9): [True: 1, False: 0]
  ------------------
 6326|      1|    aom_highbd_sad32x16x3d = aom_highbd_sad32x16x3d_c;
 6327|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x16x3d = aom_highbd_sad32x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6327:9): [True: 1, False: 0]
  ------------------
 6328|      1|    aom_highbd_sad32x16x4d = aom_highbd_sad32x16x4d_sse2;
 6329|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x16x4d = aom_highbd_sad32x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6329:9): [True: 1, False: 0]
  ------------------
 6330|      1|    aom_highbd_sad32x32 = aom_highbd_sad32x32_sse2;
 6331|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x32 = aom_highbd_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6331:9): [True: 1, False: 0]
  ------------------
 6332|      1|    aom_highbd_sad32x32_avg = aom_highbd_sad32x32_avg_sse2;
 6333|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x32_avg = aom_highbd_sad32x32_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6333:9): [True: 1, False: 0]
  ------------------
 6334|      1|    aom_highbd_sad32x32x3d = aom_highbd_sad32x32x3d_c;
 6335|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x32x3d = aom_highbd_sad32x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6335:9): [True: 1, False: 0]
  ------------------
 6336|      1|    aom_highbd_sad32x32x4d = aom_highbd_sad32x32x4d_sse2;
 6337|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x32x4d = aom_highbd_sad32x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6337:9): [True: 1, False: 0]
  ------------------
 6338|      1|    aom_highbd_sad32x64 = aom_highbd_sad32x64_sse2;
 6339|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x64 = aom_highbd_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6339:9): [True: 1, False: 0]
  ------------------
 6340|      1|    aom_highbd_sad32x64_avg = aom_highbd_sad32x64_avg_sse2;
 6341|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x64_avg = aom_highbd_sad32x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6341:9): [True: 1, False: 0]
  ------------------
 6342|      1|    aom_highbd_sad32x64x3d = aom_highbd_sad32x64x3d_c;
 6343|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x64x3d = aom_highbd_sad32x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6343:9): [True: 1, False: 0]
  ------------------
 6344|      1|    aom_highbd_sad32x64x4d = aom_highbd_sad32x64x4d_sse2;
 6345|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x64x4d = aom_highbd_sad32x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6345:9): [True: 1, False: 0]
  ------------------
 6346|      1|    aom_highbd_sad32x8 = aom_highbd_sad32x8_sse2;
 6347|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x8 = aom_highbd_sad32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6347:9): [True: 1, False: 0]
  ------------------
 6348|      1|    aom_highbd_sad32x8_avg = aom_highbd_sad32x8_avg_sse2;
 6349|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x8_avg = aom_highbd_sad32x8_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6349:9): [True: 1, False: 0]
  ------------------
 6350|      1|    aom_highbd_sad32x8x3d = aom_highbd_sad32x8x3d_c;
 6351|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x8x3d = aom_highbd_sad32x8x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6351:9): [True: 1, False: 0]
  ------------------
 6352|      1|    aom_highbd_sad32x8x4d = aom_highbd_sad32x8x4d_sse2;
 6353|      1|    if (flags & HAS_AVX2) aom_highbd_sad32x8x4d = aom_highbd_sad32x8x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6353:9): [True: 1, False: 0]
  ------------------
 6354|      1|    aom_highbd_sad64x128 = aom_highbd_sad64x128_c;
 6355|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x128 = aom_highbd_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6355:9): [True: 1, False: 0]
  ------------------
 6356|      1|    aom_highbd_sad64x128_avg = aom_highbd_sad64x128_avg_c;
 6357|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x128_avg = aom_highbd_sad64x128_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6357:9): [True: 1, False: 0]
  ------------------
 6358|      1|    aom_highbd_sad64x128x3d = aom_highbd_sad64x128x3d_c;
 6359|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x128x3d = aom_highbd_sad64x128x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6359:9): [True: 1, False: 0]
  ------------------
 6360|      1|    aom_highbd_sad64x128x4d = aom_highbd_sad64x128x4d_c;
 6361|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x128x4d = aom_highbd_sad64x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6361:9): [True: 1, False: 0]
  ------------------
 6362|      1|    aom_highbd_sad64x16 = aom_highbd_sad64x16_sse2;
 6363|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x16 = aom_highbd_sad64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6363:9): [True: 1, False: 0]
  ------------------
 6364|      1|    aom_highbd_sad64x16_avg = aom_highbd_sad64x16_avg_sse2;
 6365|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x16_avg = aom_highbd_sad64x16_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6365:9): [True: 1, False: 0]
  ------------------
 6366|      1|    aom_highbd_sad64x16x3d = aom_highbd_sad64x16x3d_c;
 6367|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x16x3d = aom_highbd_sad64x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6367:9): [True: 1, False: 0]
  ------------------
 6368|      1|    aom_highbd_sad64x16x4d = aom_highbd_sad64x16x4d_sse2;
 6369|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x16x4d = aom_highbd_sad64x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6369:9): [True: 1, False: 0]
  ------------------
 6370|      1|    aom_highbd_sad64x32 = aom_highbd_sad64x32_sse2;
 6371|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x32 = aom_highbd_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6371:9): [True: 1, False: 0]
  ------------------
 6372|      1|    aom_highbd_sad64x32_avg = aom_highbd_sad64x32_avg_sse2;
 6373|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x32_avg = aom_highbd_sad64x32_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6373:9): [True: 1, False: 0]
  ------------------
 6374|      1|    aom_highbd_sad64x32x3d = aom_highbd_sad64x32x3d_c;
 6375|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x32x3d = aom_highbd_sad64x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6375:9): [True: 1, False: 0]
  ------------------
 6376|      1|    aom_highbd_sad64x32x4d = aom_highbd_sad64x32x4d_sse2;
 6377|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x32x4d = aom_highbd_sad64x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6377:9): [True: 1, False: 0]
  ------------------
 6378|      1|    aom_highbd_sad64x64 = aom_highbd_sad64x64_sse2;
 6379|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x64 = aom_highbd_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6379:9): [True: 1, False: 0]
  ------------------
 6380|      1|    aom_highbd_sad64x64_avg = aom_highbd_sad64x64_avg_sse2;
 6381|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x64_avg = aom_highbd_sad64x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6381:9): [True: 1, False: 0]
  ------------------
 6382|      1|    aom_highbd_sad64x64x3d = aom_highbd_sad64x64x3d_c;
 6383|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x64x3d = aom_highbd_sad64x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6383:9): [True: 1, False: 0]
  ------------------
 6384|      1|    aom_highbd_sad64x64x4d = aom_highbd_sad64x64x4d_sse2;
 6385|      1|    if (flags & HAS_AVX2) aom_highbd_sad64x64x4d = aom_highbd_sad64x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6385:9): [True: 1, False: 0]
  ------------------
 6386|      1|    aom_highbd_sad_skip_128x128 = aom_highbd_sad_skip_128x128_c;
 6387|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_128x128 = aom_highbd_sad_skip_128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6387:9): [True: 1, False: 0]
  ------------------
 6388|      1|    aom_highbd_sad_skip_128x128x4d = aom_highbd_sad_skip_128x128x4d_c;
 6389|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_128x128x4d = aom_highbd_sad_skip_128x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6389:9): [True: 1, False: 0]
  ------------------
 6390|      1|    aom_highbd_sad_skip_128x64 = aom_highbd_sad_skip_128x64_c;
 6391|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_128x64 = aom_highbd_sad_skip_128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6391:9): [True: 1, False: 0]
  ------------------
 6392|      1|    aom_highbd_sad_skip_128x64x4d = aom_highbd_sad_skip_128x64x4d_c;
 6393|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_128x64x4d = aom_highbd_sad_skip_128x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6393:9): [True: 1, False: 0]
  ------------------
 6394|      1|    aom_highbd_sad_skip_16x16 = aom_highbd_sad_skip_16x16_sse2;
 6395|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x16 = aom_highbd_sad_skip_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6395:9): [True: 1, False: 0]
  ------------------
 6396|      1|    aom_highbd_sad_skip_16x16x4d = aom_highbd_sad_skip_16x16x4d_sse2;
 6397|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x16x4d = aom_highbd_sad_skip_16x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6397:9): [True: 1, False: 0]
  ------------------
 6398|      1|    aom_highbd_sad_skip_16x32 = aom_highbd_sad_skip_16x32_sse2;
 6399|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x32 = aom_highbd_sad_skip_16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6399:9): [True: 1, False: 0]
  ------------------
 6400|      1|    aom_highbd_sad_skip_16x32x4d = aom_highbd_sad_skip_16x32x4d_sse2;
 6401|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x32x4d = aom_highbd_sad_skip_16x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6401:9): [True: 1, False: 0]
  ------------------
 6402|      1|    aom_highbd_sad_skip_16x64 = aom_highbd_sad_skip_16x64_sse2;
 6403|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x64 = aom_highbd_sad_skip_16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6403:9): [True: 1, False: 0]
  ------------------
 6404|      1|    aom_highbd_sad_skip_16x64x4d = aom_highbd_sad_skip_16x64x4d_sse2;
 6405|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_16x64x4d = aom_highbd_sad_skip_16x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6405:9): [True: 1, False: 0]
  ------------------
 6406|      1|    aom_highbd_sad_skip_32x16 = aom_highbd_sad_skip_32x16_sse2;
 6407|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x16 = aom_highbd_sad_skip_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6407:9): [True: 1, False: 0]
  ------------------
 6408|      1|    aom_highbd_sad_skip_32x16x4d = aom_highbd_sad_skip_32x16x4d_sse2;
 6409|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x16x4d = aom_highbd_sad_skip_32x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6409:9): [True: 1, False: 0]
  ------------------
 6410|      1|    aom_highbd_sad_skip_32x32 = aom_highbd_sad_skip_32x32_sse2;
 6411|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x32 = aom_highbd_sad_skip_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6411:9): [True: 1, False: 0]
  ------------------
 6412|      1|    aom_highbd_sad_skip_32x32x4d = aom_highbd_sad_skip_32x32x4d_sse2;
 6413|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x32x4d = aom_highbd_sad_skip_32x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6413:9): [True: 1, False: 0]
  ------------------
 6414|      1|    aom_highbd_sad_skip_32x64 = aom_highbd_sad_skip_32x64_sse2;
 6415|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x64 = aom_highbd_sad_skip_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6415:9): [True: 1, False: 0]
  ------------------
 6416|      1|    aom_highbd_sad_skip_32x64x4d = aom_highbd_sad_skip_32x64x4d_sse2;
 6417|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_32x64x4d = aom_highbd_sad_skip_32x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6417:9): [True: 1, False: 0]
  ------------------
 6418|      1|    aom_highbd_sad_skip_64x128 = aom_highbd_sad_skip_64x128_c;
 6419|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x128 = aom_highbd_sad_skip_64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6419:9): [True: 1, False: 0]
  ------------------
 6420|      1|    aom_highbd_sad_skip_64x128x4d = aom_highbd_sad_skip_64x128x4d_c;
 6421|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x128x4d = aom_highbd_sad_skip_64x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6421:9): [True: 1, False: 0]
  ------------------
 6422|      1|    aom_highbd_sad_skip_64x16 = aom_highbd_sad_skip_64x16_sse2;
 6423|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x16 = aom_highbd_sad_skip_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6423:9): [True: 1, False: 0]
  ------------------
 6424|      1|    aom_highbd_sad_skip_64x16x4d = aom_highbd_sad_skip_64x16x4d_sse2;
 6425|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x16x4d = aom_highbd_sad_skip_64x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6425:9): [True: 1, False: 0]
  ------------------
 6426|      1|    aom_highbd_sad_skip_64x32 = aom_highbd_sad_skip_64x32_sse2;
 6427|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x32 = aom_highbd_sad_skip_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6427:9): [True: 1, False: 0]
  ------------------
 6428|      1|    aom_highbd_sad_skip_64x32x4d = aom_highbd_sad_skip_64x32x4d_sse2;
 6429|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x32x4d = aom_highbd_sad_skip_64x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6429:9): [True: 1, False: 0]
  ------------------
 6430|      1|    aom_highbd_sad_skip_64x64 = aom_highbd_sad_skip_64x64_sse2;
 6431|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x64 = aom_highbd_sad_skip_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6431:9): [True: 1, False: 0]
  ------------------
 6432|      1|    aom_highbd_sad_skip_64x64x4d = aom_highbd_sad_skip_64x64x4d_sse2;
 6433|      1|    if (flags & HAS_AVX2) aom_highbd_sad_skip_64x64x4d = aom_highbd_sad_skip_64x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6433:9): [True: 1, False: 0]
  ------------------
 6434|      1|    aom_highbd_sse = aom_highbd_sse_c;
 6435|      1|    if (flags & HAS_SSE4_1) aom_highbd_sse = aom_highbd_sse_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6435:9): [True: 1, False: 0]
  ------------------
 6436|      1|    if (flags & HAS_AVX2) aom_highbd_sse = aom_highbd_sse_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6436:9): [True: 1, False: 0]
  ------------------
 6437|      1|    aom_ifft16x16_float = aom_ifft16x16_float_sse2;
 6438|      1|    if (flags & HAS_AVX2) aom_ifft16x16_float = aom_ifft16x16_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6438:9): [True: 1, False: 0]
  ------------------
 6439|      1|    aom_ifft32x32_float = aom_ifft32x32_float_sse2;
 6440|      1|    if (flags & HAS_AVX2) aom_ifft32x32_float = aom_ifft32x32_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6440:9): [True: 1, False: 0]
  ------------------
 6441|      1|    aom_ifft8x8_float = aom_ifft8x8_float_sse2;
 6442|      1|    if (flags & HAS_AVX2) aom_ifft8x8_float = aom_ifft8x8_float_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6442:9): [True: 1, False: 0]
  ------------------
 6443|      1|    aom_int_pro_col = aom_int_pro_col_sse2;
 6444|      1|    if (flags & HAS_AVX2) aom_int_pro_col = aom_int_pro_col_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6444:9): [True: 1, False: 0]
  ------------------
 6445|      1|    aom_int_pro_row = aom_int_pro_row_sse2;
 6446|      1|    if (flags & HAS_AVX2) aom_int_pro_row = aom_int_pro_row_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6446:9): [True: 1, False: 0]
  ------------------
 6447|      1|    aom_lowbd_blend_a64_d16_mask = aom_lowbd_blend_a64_d16_mask_c;
 6448|      1|    if (flags & HAS_SSE4_1) aom_lowbd_blend_a64_d16_mask = aom_lowbd_blend_a64_d16_mask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6448:9): [True: 1, False: 0]
  ------------------
 6449|      1|    if (flags & HAS_AVX2) aom_lowbd_blend_a64_d16_mask = aom_lowbd_blend_a64_d16_mask_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6449:9): [True: 1, False: 0]
  ------------------
 6450|      1|    aom_lpf_horizontal_14_quad = aom_lpf_horizontal_14_quad_sse2;
 6451|      1|    if (flags & HAS_AVX2) aom_lpf_horizontal_14_quad = aom_lpf_horizontal_14_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6451:9): [True: 1, False: 0]
  ------------------
 6452|      1|    aom_lpf_horizontal_6_quad = aom_lpf_horizontal_6_quad_sse2;
 6453|      1|    if (flags & HAS_AVX2) aom_lpf_horizontal_6_quad = aom_lpf_horizontal_6_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6453:9): [True: 1, False: 0]
  ------------------
 6454|      1|    aom_lpf_horizontal_8_quad = aom_lpf_horizontal_8_quad_sse2;
 6455|      1|    if (flags & HAS_AVX2) aom_lpf_horizontal_8_quad = aom_lpf_horizontal_8_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6455:9): [True: 1, False: 0]
  ------------------
 6456|      1|    aom_lpf_vertical_14_quad = aom_lpf_vertical_14_quad_sse2;
 6457|      1|    if (flags & HAS_AVX2) aom_lpf_vertical_14_quad = aom_lpf_vertical_14_quad_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6457:9): [True: 1, False: 0]
  ------------------
 6458|      1|    aom_masked_sad128x128 = aom_masked_sad128x128_c;
 6459|      1|    if (flags & HAS_SSSE3) aom_masked_sad128x128 = aom_masked_sad128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6459:9): [True: 1, False: 0]
  ------------------
 6460|      1|    if (flags & HAS_AVX2) aom_masked_sad128x128 = aom_masked_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6460:9): [True: 1, False: 0]
  ------------------
 6461|      1|    aom_masked_sad128x64 = aom_masked_sad128x64_c;
 6462|      1|    if (flags & HAS_SSSE3) aom_masked_sad128x64 = aom_masked_sad128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6462:9): [True: 1, False: 0]
  ------------------
 6463|      1|    if (flags & HAS_AVX2) aom_masked_sad128x64 = aom_masked_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6463:9): [True: 1, False: 0]
  ------------------
 6464|      1|    aom_masked_sad16x16 = aom_masked_sad16x16_c;
 6465|      1|    if (flags & HAS_SSSE3) aom_masked_sad16x16 = aom_masked_sad16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6465:9): [True: 1, False: 0]
  ------------------
 6466|      1|    if (flags & HAS_AVX2) aom_masked_sad16x16 = aom_masked_sad16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6466:9): [True: 1, False: 0]
  ------------------
 6467|      1|    aom_masked_sad16x32 = aom_masked_sad16x32_c;
 6468|      1|    if (flags & HAS_SSSE3) aom_masked_sad16x32 = aom_masked_sad16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6468:9): [True: 1, False: 0]
  ------------------
 6469|      1|    if (flags & HAS_AVX2) aom_masked_sad16x32 = aom_masked_sad16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6469:9): [True: 1, False: 0]
  ------------------
 6470|      1|    aom_masked_sad16x4 = aom_masked_sad16x4_c;
 6471|      1|    if (flags & HAS_SSSE3) aom_masked_sad16x4 = aom_masked_sad16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6471:9): [True: 1, False: 0]
  ------------------
 6472|      1|    if (flags & HAS_AVX2) aom_masked_sad16x4 = aom_masked_sad16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6472:9): [True: 1, False: 0]
  ------------------
 6473|      1|    aom_masked_sad16x64 = aom_masked_sad16x64_c;
 6474|      1|    if (flags & HAS_SSSE3) aom_masked_sad16x64 = aom_masked_sad16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6474:9): [True: 1, False: 0]
  ------------------
 6475|      1|    if (flags & HAS_AVX2) aom_masked_sad16x64 = aom_masked_sad16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6475:9): [True: 1, False: 0]
  ------------------
 6476|      1|    aom_masked_sad16x8 = aom_masked_sad16x8_c;
 6477|      1|    if (flags & HAS_SSSE3) aom_masked_sad16x8 = aom_masked_sad16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6477:9): [True: 1, False: 0]
  ------------------
 6478|      1|    if (flags & HAS_AVX2) aom_masked_sad16x8 = aom_masked_sad16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6478:9): [True: 1, False: 0]
  ------------------
 6479|      1|    aom_masked_sad32x16 = aom_masked_sad32x16_c;
 6480|      1|    if (flags & HAS_SSSE3) aom_masked_sad32x16 = aom_masked_sad32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6480:9): [True: 1, False: 0]
  ------------------
 6481|      1|    if (flags & HAS_AVX2) aom_masked_sad32x16 = aom_masked_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6481:9): [True: 1, False: 0]
  ------------------
 6482|      1|    aom_masked_sad32x32 = aom_masked_sad32x32_c;
 6483|      1|    if (flags & HAS_SSSE3) aom_masked_sad32x32 = aom_masked_sad32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6483:9): [True: 1, False: 0]
  ------------------
 6484|      1|    if (flags & HAS_AVX2) aom_masked_sad32x32 = aom_masked_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6484:9): [True: 1, False: 0]
  ------------------
 6485|      1|    aom_masked_sad32x64 = aom_masked_sad32x64_c;
 6486|      1|    if (flags & HAS_SSSE3) aom_masked_sad32x64 = aom_masked_sad32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6486:9): [True: 1, False: 0]
  ------------------
 6487|      1|    if (flags & HAS_AVX2) aom_masked_sad32x64 = aom_masked_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6487:9): [True: 1, False: 0]
  ------------------
 6488|      1|    aom_masked_sad32x8 = aom_masked_sad32x8_c;
 6489|      1|    if (flags & HAS_SSSE3) aom_masked_sad32x8 = aom_masked_sad32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6489:9): [True: 1, False: 0]
  ------------------
 6490|      1|    if (flags & HAS_AVX2) aom_masked_sad32x8 = aom_masked_sad32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6490:9): [True: 1, False: 0]
  ------------------
 6491|      1|    aom_masked_sad4x16 = aom_masked_sad4x16_c;
 6492|      1|    if (flags & HAS_SSSE3) aom_masked_sad4x16 = aom_masked_sad4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6492:9): [True: 1, False: 0]
  ------------------
 6493|      1|    if (flags & HAS_AVX2) aom_masked_sad4x16 = aom_masked_sad4x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6493:9): [True: 1, False: 0]
  ------------------
 6494|      1|    aom_masked_sad4x4 = aom_masked_sad4x4_c;
 6495|      1|    if (flags & HAS_SSSE3) aom_masked_sad4x4 = aom_masked_sad4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6495:9): [True: 1, False: 0]
  ------------------
 6496|      1|    if (flags & HAS_AVX2) aom_masked_sad4x4 = aom_masked_sad4x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6496:9): [True: 1, False: 0]
  ------------------
 6497|      1|    aom_masked_sad4x8 = aom_masked_sad4x8_c;
 6498|      1|    if (flags & HAS_SSSE3) aom_masked_sad4x8 = aom_masked_sad4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6498:9): [True: 1, False: 0]
  ------------------
 6499|      1|    if (flags & HAS_AVX2) aom_masked_sad4x8 = aom_masked_sad4x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6499:9): [True: 1, False: 0]
  ------------------
 6500|      1|    aom_masked_sad64x128 = aom_masked_sad64x128_c;
 6501|      1|    if (flags & HAS_SSSE3) aom_masked_sad64x128 = aom_masked_sad64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6501:9): [True: 1, False: 0]
  ------------------
 6502|      1|    if (flags & HAS_AVX2) aom_masked_sad64x128 = aom_masked_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6502:9): [True: 1, False: 0]
  ------------------
 6503|      1|    aom_masked_sad64x16 = aom_masked_sad64x16_c;
 6504|      1|    if (flags & HAS_SSSE3) aom_masked_sad64x16 = aom_masked_sad64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6504:9): [True: 1, False: 0]
  ------------------
 6505|      1|    if (flags & HAS_AVX2) aom_masked_sad64x16 = aom_masked_sad64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6505:9): [True: 1, False: 0]
  ------------------
 6506|      1|    aom_masked_sad64x32 = aom_masked_sad64x32_c;
 6507|      1|    if (flags & HAS_SSSE3) aom_masked_sad64x32 = aom_masked_sad64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6507:9): [True: 1, False: 0]
  ------------------
 6508|      1|    if (flags & HAS_AVX2) aom_masked_sad64x32 = aom_masked_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6508:9): [True: 1, False: 0]
  ------------------
 6509|      1|    aom_masked_sad64x64 = aom_masked_sad64x64_c;
 6510|      1|    if (flags & HAS_SSSE3) aom_masked_sad64x64 = aom_masked_sad64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6510:9): [True: 1, False: 0]
  ------------------
 6511|      1|    if (flags & HAS_AVX2) aom_masked_sad64x64 = aom_masked_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6511:9): [True: 1, False: 0]
  ------------------
 6512|      1|    aom_masked_sad8x16 = aom_masked_sad8x16_c;
 6513|      1|    if (flags & HAS_SSSE3) aom_masked_sad8x16 = aom_masked_sad8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6513:9): [True: 1, False: 0]
  ------------------
 6514|      1|    if (flags & HAS_AVX2) aom_masked_sad8x16 = aom_masked_sad8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6514:9): [True: 1, False: 0]
  ------------------
 6515|      1|    aom_masked_sad8x32 = aom_masked_sad8x32_c;
 6516|      1|    if (flags & HAS_SSSE3) aom_masked_sad8x32 = aom_masked_sad8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6516:9): [True: 1, False: 0]
  ------------------
 6517|      1|    if (flags & HAS_AVX2) aom_masked_sad8x32 = aom_masked_sad8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6517:9): [True: 1, False: 0]
  ------------------
 6518|      1|    aom_masked_sad8x4 = aom_masked_sad8x4_c;
 6519|      1|    if (flags & HAS_SSSE3) aom_masked_sad8x4 = aom_masked_sad8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6519:9): [True: 1, False: 0]
  ------------------
 6520|      1|    if (flags & HAS_AVX2) aom_masked_sad8x4 = aom_masked_sad8x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6520:9): [True: 1, False: 0]
  ------------------
 6521|      1|    aom_masked_sad8x8 = aom_masked_sad8x8_c;
 6522|      1|    if (flags & HAS_SSSE3) aom_masked_sad8x8 = aom_masked_sad8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6522:9): [True: 1, False: 0]
  ------------------
 6523|      1|    if (flags & HAS_AVX2) aom_masked_sad8x8 = aom_masked_sad8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6523:9): [True: 1, False: 0]
  ------------------
 6524|      1|    aom_masked_sub_pixel_variance128x128 = aom_masked_sub_pixel_variance128x128_c;
 6525|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance128x128 = aom_masked_sub_pixel_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6525:9): [True: 1, False: 0]
  ------------------
 6526|      1|    aom_masked_sub_pixel_variance128x64 = aom_masked_sub_pixel_variance128x64_c;
 6527|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance128x64 = aom_masked_sub_pixel_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6527:9): [True: 1, False: 0]
  ------------------
 6528|      1|    aom_masked_sub_pixel_variance16x16 = aom_masked_sub_pixel_variance16x16_c;
 6529|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance16x16 = aom_masked_sub_pixel_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6529:9): [True: 1, False: 0]
  ------------------
 6530|      1|    aom_masked_sub_pixel_variance16x32 = aom_masked_sub_pixel_variance16x32_c;
 6531|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance16x32 = aom_masked_sub_pixel_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6531:9): [True: 1, False: 0]
  ------------------
 6532|      1|    aom_masked_sub_pixel_variance16x4 = aom_masked_sub_pixel_variance16x4_c;
 6533|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance16x4 = aom_masked_sub_pixel_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6533:9): [True: 1, False: 0]
  ------------------
 6534|      1|    aom_masked_sub_pixel_variance16x64 = aom_masked_sub_pixel_variance16x64_c;
 6535|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance16x64 = aom_masked_sub_pixel_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6535:9): [True: 1, False: 0]
  ------------------
 6536|      1|    aom_masked_sub_pixel_variance16x8 = aom_masked_sub_pixel_variance16x8_c;
 6537|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance16x8 = aom_masked_sub_pixel_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6537:9): [True: 1, False: 0]
  ------------------
 6538|      1|    aom_masked_sub_pixel_variance32x16 = aom_masked_sub_pixel_variance32x16_c;
 6539|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance32x16 = aom_masked_sub_pixel_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6539:9): [True: 1, False: 0]
  ------------------
 6540|      1|    aom_masked_sub_pixel_variance32x32 = aom_masked_sub_pixel_variance32x32_c;
 6541|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance32x32 = aom_masked_sub_pixel_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6541:9): [True: 1, False: 0]
  ------------------
 6542|      1|    aom_masked_sub_pixel_variance32x64 = aom_masked_sub_pixel_variance32x64_c;
 6543|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance32x64 = aom_masked_sub_pixel_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6543:9): [True: 1, False: 0]
  ------------------
 6544|      1|    aom_masked_sub_pixel_variance32x8 = aom_masked_sub_pixel_variance32x8_c;
 6545|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance32x8 = aom_masked_sub_pixel_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6545:9): [True: 1, False: 0]
  ------------------
 6546|      1|    aom_masked_sub_pixel_variance4x16 = aom_masked_sub_pixel_variance4x16_c;
 6547|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance4x16 = aom_masked_sub_pixel_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6547:9): [True: 1, False: 0]
  ------------------
 6548|      1|    aom_masked_sub_pixel_variance4x4 = aom_masked_sub_pixel_variance4x4_c;
 6549|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance4x4 = aom_masked_sub_pixel_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6549:9): [True: 1, False: 0]
  ------------------
 6550|      1|    aom_masked_sub_pixel_variance4x8 = aom_masked_sub_pixel_variance4x8_c;
 6551|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance4x8 = aom_masked_sub_pixel_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6551:9): [True: 1, False: 0]
  ------------------
 6552|      1|    aom_masked_sub_pixel_variance64x128 = aom_masked_sub_pixel_variance64x128_c;
 6553|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance64x128 = aom_masked_sub_pixel_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6553:9): [True: 1, False: 0]
  ------------------
 6554|      1|    aom_masked_sub_pixel_variance64x16 = aom_masked_sub_pixel_variance64x16_c;
 6555|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance64x16 = aom_masked_sub_pixel_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6555:9): [True: 1, False: 0]
  ------------------
 6556|      1|    aom_masked_sub_pixel_variance64x32 = aom_masked_sub_pixel_variance64x32_c;
 6557|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance64x32 = aom_masked_sub_pixel_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6557:9): [True: 1, False: 0]
  ------------------
 6558|      1|    aom_masked_sub_pixel_variance64x64 = aom_masked_sub_pixel_variance64x64_c;
 6559|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance64x64 = aom_masked_sub_pixel_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6559:9): [True: 1, False: 0]
  ------------------
 6560|      1|    aom_masked_sub_pixel_variance8x16 = aom_masked_sub_pixel_variance8x16_c;
 6561|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance8x16 = aom_masked_sub_pixel_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6561:9): [True: 1, False: 0]
  ------------------
 6562|      1|    aom_masked_sub_pixel_variance8x32 = aom_masked_sub_pixel_variance8x32_c;
 6563|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance8x32 = aom_masked_sub_pixel_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6563:9): [True: 1, False: 0]
  ------------------
 6564|      1|    aom_masked_sub_pixel_variance8x4 = aom_masked_sub_pixel_variance8x4_c;
 6565|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance8x4 = aom_masked_sub_pixel_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6565:9): [True: 1, False: 0]
  ------------------
 6566|      1|    aom_masked_sub_pixel_variance8x8 = aom_masked_sub_pixel_variance8x8_c;
 6567|      1|    if (flags & HAS_SSSE3) aom_masked_sub_pixel_variance8x8 = aom_masked_sub_pixel_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6567:9): [True: 1, False: 0]
  ------------------
 6568|      1|    aom_mse16x16 = aom_mse16x16_sse2;
 6569|      1|    if (flags & HAS_AVX2) aom_mse16x16 = aom_mse16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6569:9): [True: 1, False: 0]
  ------------------
 6570|      1|    aom_mse_16xh_16bit = aom_mse_16xh_16bit_sse2;
 6571|      1|    if (flags & HAS_AVX2) aom_mse_16xh_16bit = aom_mse_16xh_16bit_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6571:9): [True: 1, False: 0]
  ------------------
 6572|      1|    aom_mse_wxh_16bit = aom_mse_wxh_16bit_sse2;
 6573|      1|    if (flags & HAS_AVX2) aom_mse_wxh_16bit = aom_mse_wxh_16bit_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6573:9): [True: 1, False: 0]
  ------------------
 6574|      1|    aom_mse_wxh_16bit_highbd = aom_mse_wxh_16bit_highbd_sse2;
 6575|      1|    if (flags & HAS_AVX2) aom_mse_wxh_16bit_highbd = aom_mse_wxh_16bit_highbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6575:9): [True: 1, False: 0]
  ------------------
 6576|      1|    aom_obmc_sad128x128 = aom_obmc_sad128x128_c;
 6577|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad128x128 = aom_obmc_sad128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6577:9): [True: 1, False: 0]
  ------------------
 6578|      1|    if (flags & HAS_AVX2) aom_obmc_sad128x128 = aom_obmc_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6578:9): [True: 1, False: 0]
  ------------------
 6579|      1|    aom_obmc_sad128x64 = aom_obmc_sad128x64_c;
 6580|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad128x64 = aom_obmc_sad128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6580:9): [True: 1, False: 0]
  ------------------
 6581|      1|    if (flags & HAS_AVX2) aom_obmc_sad128x64 = aom_obmc_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6581:9): [True: 1, False: 0]
  ------------------
 6582|      1|    aom_obmc_sad16x16 = aom_obmc_sad16x16_c;
 6583|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad16x16 = aom_obmc_sad16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6583:9): [True: 1, False: 0]
  ------------------
 6584|      1|    if (flags & HAS_AVX2) aom_obmc_sad16x16 = aom_obmc_sad16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6584:9): [True: 1, False: 0]
  ------------------
 6585|      1|    aom_obmc_sad16x32 = aom_obmc_sad16x32_c;
 6586|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad16x32 = aom_obmc_sad16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6586:9): [True: 1, False: 0]
  ------------------
 6587|      1|    if (flags & HAS_AVX2) aom_obmc_sad16x32 = aom_obmc_sad16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6587:9): [True: 1, False: 0]
  ------------------
 6588|      1|    aom_obmc_sad16x4 = aom_obmc_sad16x4_c;
 6589|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad16x4 = aom_obmc_sad16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6589:9): [True: 1, False: 0]
  ------------------
 6590|      1|    if (flags & HAS_AVX2) aom_obmc_sad16x4 = aom_obmc_sad16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6590:9): [True: 1, False: 0]
  ------------------
 6591|      1|    aom_obmc_sad16x64 = aom_obmc_sad16x64_c;
 6592|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad16x64 = aom_obmc_sad16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6592:9): [True: 1, False: 0]
  ------------------
 6593|      1|    if (flags & HAS_AVX2) aom_obmc_sad16x64 = aom_obmc_sad16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6593:9): [True: 1, False: 0]
  ------------------
 6594|      1|    aom_obmc_sad16x8 = aom_obmc_sad16x8_c;
 6595|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad16x8 = aom_obmc_sad16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6595:9): [True: 1, False: 0]
  ------------------
 6596|      1|    if (flags & HAS_AVX2) aom_obmc_sad16x8 = aom_obmc_sad16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6596:9): [True: 1, False: 0]
  ------------------
 6597|      1|    aom_obmc_sad32x16 = aom_obmc_sad32x16_c;
 6598|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad32x16 = aom_obmc_sad32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6598:9): [True: 1, False: 0]
  ------------------
 6599|      1|    if (flags & HAS_AVX2) aom_obmc_sad32x16 = aom_obmc_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6599:9): [True: 1, False: 0]
  ------------------
 6600|      1|    aom_obmc_sad32x32 = aom_obmc_sad32x32_c;
 6601|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad32x32 = aom_obmc_sad32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6601:9): [True: 1, False: 0]
  ------------------
 6602|      1|    if (flags & HAS_AVX2) aom_obmc_sad32x32 = aom_obmc_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6602:9): [True: 1, False: 0]
  ------------------
 6603|      1|    aom_obmc_sad32x64 = aom_obmc_sad32x64_c;
 6604|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad32x64 = aom_obmc_sad32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6604:9): [True: 1, False: 0]
  ------------------
 6605|      1|    if (flags & HAS_AVX2) aom_obmc_sad32x64 = aom_obmc_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6605:9): [True: 1, False: 0]
  ------------------
 6606|      1|    aom_obmc_sad32x8 = aom_obmc_sad32x8_c;
 6607|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad32x8 = aom_obmc_sad32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6607:9): [True: 1, False: 0]
  ------------------
 6608|      1|    if (flags & HAS_AVX2) aom_obmc_sad32x8 = aom_obmc_sad32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6608:9): [True: 1, False: 0]
  ------------------
 6609|      1|    aom_obmc_sad4x16 = aom_obmc_sad4x16_c;
 6610|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad4x16 = aom_obmc_sad4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6610:9): [True: 1, False: 0]
  ------------------
 6611|      1|    if (flags & HAS_AVX2) aom_obmc_sad4x16 = aom_obmc_sad4x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6611:9): [True: 1, False: 0]
  ------------------
 6612|      1|    aom_obmc_sad4x4 = aom_obmc_sad4x4_c;
 6613|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad4x4 = aom_obmc_sad4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6613:9): [True: 1, False: 0]
  ------------------
 6614|      1|    if (flags & HAS_AVX2) aom_obmc_sad4x4 = aom_obmc_sad4x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6614:9): [True: 1, False: 0]
  ------------------
 6615|      1|    aom_obmc_sad4x8 = aom_obmc_sad4x8_c;
 6616|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad4x8 = aom_obmc_sad4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6616:9): [True: 1, False: 0]
  ------------------
 6617|      1|    if (flags & HAS_AVX2) aom_obmc_sad4x8 = aom_obmc_sad4x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6617:9): [True: 1, False: 0]
  ------------------
 6618|      1|    aom_obmc_sad64x128 = aom_obmc_sad64x128_c;
 6619|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad64x128 = aom_obmc_sad64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6619:9): [True: 1, False: 0]
  ------------------
 6620|      1|    if (flags & HAS_AVX2) aom_obmc_sad64x128 = aom_obmc_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6620:9): [True: 1, False: 0]
  ------------------
 6621|      1|    aom_obmc_sad64x16 = aom_obmc_sad64x16_c;
 6622|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad64x16 = aom_obmc_sad64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6622:9): [True: 1, False: 0]
  ------------------
 6623|      1|    if (flags & HAS_AVX2) aom_obmc_sad64x16 = aom_obmc_sad64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6623:9): [True: 1, False: 0]
  ------------------
 6624|      1|    aom_obmc_sad64x32 = aom_obmc_sad64x32_c;
 6625|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad64x32 = aom_obmc_sad64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6625:9): [True: 1, False: 0]
  ------------------
 6626|      1|    if (flags & HAS_AVX2) aom_obmc_sad64x32 = aom_obmc_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6626:9): [True: 1, False: 0]
  ------------------
 6627|      1|    aom_obmc_sad64x64 = aom_obmc_sad64x64_c;
 6628|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad64x64 = aom_obmc_sad64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6628:9): [True: 1, False: 0]
  ------------------
 6629|      1|    if (flags & HAS_AVX2) aom_obmc_sad64x64 = aom_obmc_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6629:9): [True: 1, False: 0]
  ------------------
 6630|      1|    aom_obmc_sad8x16 = aom_obmc_sad8x16_c;
 6631|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad8x16 = aom_obmc_sad8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6631:9): [True: 1, False: 0]
  ------------------
 6632|      1|    if (flags & HAS_AVX2) aom_obmc_sad8x16 = aom_obmc_sad8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6632:9): [True: 1, False: 0]
  ------------------
 6633|      1|    aom_obmc_sad8x32 = aom_obmc_sad8x32_c;
 6634|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad8x32 = aom_obmc_sad8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6634:9): [True: 1, False: 0]
  ------------------
 6635|      1|    if (flags & HAS_AVX2) aom_obmc_sad8x32 = aom_obmc_sad8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6635:9): [True: 1, False: 0]
  ------------------
 6636|      1|    aom_obmc_sad8x4 = aom_obmc_sad8x4_c;
 6637|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad8x4 = aom_obmc_sad8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6637:9): [True: 1, False: 0]
  ------------------
 6638|      1|    if (flags & HAS_AVX2) aom_obmc_sad8x4 = aom_obmc_sad8x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6638:9): [True: 1, False: 0]
  ------------------
 6639|      1|    aom_obmc_sad8x8 = aom_obmc_sad8x8_c;
 6640|      1|    if (flags & HAS_SSE4_1) aom_obmc_sad8x8 = aom_obmc_sad8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6640:9): [True: 1, False: 0]
  ------------------
 6641|      1|    if (flags & HAS_AVX2) aom_obmc_sad8x8 = aom_obmc_sad8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6641:9): [True: 1, False: 0]
  ------------------
 6642|      1|    aom_obmc_sub_pixel_variance128x128 = aom_obmc_sub_pixel_variance128x128_c;
 6643|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance128x128 = aom_obmc_sub_pixel_variance128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6643:9): [True: 1, False: 0]
  ------------------
 6644|      1|    aom_obmc_sub_pixel_variance128x64 = aom_obmc_sub_pixel_variance128x64_c;
 6645|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance128x64 = aom_obmc_sub_pixel_variance128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6645:9): [True: 1, False: 0]
  ------------------
 6646|      1|    aom_obmc_sub_pixel_variance16x16 = aom_obmc_sub_pixel_variance16x16_c;
 6647|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance16x16 = aom_obmc_sub_pixel_variance16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6647:9): [True: 1, False: 0]
  ------------------
 6648|      1|    aom_obmc_sub_pixel_variance16x32 = aom_obmc_sub_pixel_variance16x32_c;
 6649|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance16x32 = aom_obmc_sub_pixel_variance16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6649:9): [True: 1, False: 0]
  ------------------
 6650|      1|    aom_obmc_sub_pixel_variance16x4 = aom_obmc_sub_pixel_variance16x4_c;
 6651|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance16x4 = aom_obmc_sub_pixel_variance16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6651:9): [True: 1, False: 0]
  ------------------
 6652|      1|    aom_obmc_sub_pixel_variance16x64 = aom_obmc_sub_pixel_variance16x64_c;
 6653|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance16x64 = aom_obmc_sub_pixel_variance16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6653:9): [True: 1, False: 0]
  ------------------
 6654|      1|    aom_obmc_sub_pixel_variance16x8 = aom_obmc_sub_pixel_variance16x8_c;
 6655|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance16x8 = aom_obmc_sub_pixel_variance16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6655:9): [True: 1, False: 0]
  ------------------
 6656|      1|    aom_obmc_sub_pixel_variance32x16 = aom_obmc_sub_pixel_variance32x16_c;
 6657|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance32x16 = aom_obmc_sub_pixel_variance32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6657:9): [True: 1, False: 0]
  ------------------
 6658|      1|    aom_obmc_sub_pixel_variance32x32 = aom_obmc_sub_pixel_variance32x32_c;
 6659|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance32x32 = aom_obmc_sub_pixel_variance32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6659:9): [True: 1, False: 0]
  ------------------
 6660|      1|    aom_obmc_sub_pixel_variance32x64 = aom_obmc_sub_pixel_variance32x64_c;
 6661|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance32x64 = aom_obmc_sub_pixel_variance32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6661:9): [True: 1, False: 0]
  ------------------
 6662|      1|    aom_obmc_sub_pixel_variance32x8 = aom_obmc_sub_pixel_variance32x8_c;
 6663|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance32x8 = aom_obmc_sub_pixel_variance32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6663:9): [True: 1, False: 0]
  ------------------
 6664|      1|    aom_obmc_sub_pixel_variance4x16 = aom_obmc_sub_pixel_variance4x16_c;
 6665|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance4x16 = aom_obmc_sub_pixel_variance4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6665:9): [True: 1, False: 0]
  ------------------
 6666|      1|    aom_obmc_sub_pixel_variance4x4 = aom_obmc_sub_pixel_variance4x4_c;
 6667|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance4x4 = aom_obmc_sub_pixel_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6667:9): [True: 1, False: 0]
  ------------------
 6668|      1|    aom_obmc_sub_pixel_variance4x8 = aom_obmc_sub_pixel_variance4x8_c;
 6669|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance4x8 = aom_obmc_sub_pixel_variance4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6669:9): [True: 1, False: 0]
  ------------------
 6670|      1|    aom_obmc_sub_pixel_variance64x128 = aom_obmc_sub_pixel_variance64x128_c;
 6671|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance64x128 = aom_obmc_sub_pixel_variance64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6671:9): [True: 1, False: 0]
  ------------------
 6672|      1|    aom_obmc_sub_pixel_variance64x16 = aom_obmc_sub_pixel_variance64x16_c;
 6673|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance64x16 = aom_obmc_sub_pixel_variance64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6673:9): [True: 1, False: 0]
  ------------------
 6674|      1|    aom_obmc_sub_pixel_variance64x32 = aom_obmc_sub_pixel_variance64x32_c;
 6675|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance64x32 = aom_obmc_sub_pixel_variance64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6675:9): [True: 1, False: 0]
  ------------------
 6676|      1|    aom_obmc_sub_pixel_variance64x64 = aom_obmc_sub_pixel_variance64x64_c;
 6677|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance64x64 = aom_obmc_sub_pixel_variance64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6677:9): [True: 1, False: 0]
  ------------------
 6678|      1|    aom_obmc_sub_pixel_variance8x16 = aom_obmc_sub_pixel_variance8x16_c;
 6679|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance8x16 = aom_obmc_sub_pixel_variance8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6679:9): [True: 1, False: 0]
  ------------------
 6680|      1|    aom_obmc_sub_pixel_variance8x32 = aom_obmc_sub_pixel_variance8x32_c;
 6681|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance8x32 = aom_obmc_sub_pixel_variance8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6681:9): [True: 1, False: 0]
  ------------------
 6682|      1|    aom_obmc_sub_pixel_variance8x4 = aom_obmc_sub_pixel_variance8x4_c;
 6683|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance8x4 = aom_obmc_sub_pixel_variance8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6683:9): [True: 1, False: 0]
  ------------------
 6684|      1|    aom_obmc_sub_pixel_variance8x8 = aom_obmc_sub_pixel_variance8x8_c;
 6685|      1|    if (flags & HAS_SSE4_1) aom_obmc_sub_pixel_variance8x8 = aom_obmc_sub_pixel_variance8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6685:9): [True: 1, False: 0]
  ------------------
 6686|      1|    aom_obmc_variance128x128 = aom_obmc_variance128x128_c;
 6687|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance128x128 = aom_obmc_variance128x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6687:9): [True: 1, False: 0]
  ------------------
 6688|      1|    if (flags & HAS_AVX2) aom_obmc_variance128x128 = aom_obmc_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6688:9): [True: 1, False: 0]
  ------------------
 6689|      1|    aom_obmc_variance128x64 = aom_obmc_variance128x64_c;
 6690|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance128x64 = aom_obmc_variance128x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6690:9): [True: 1, False: 0]
  ------------------
 6691|      1|    if (flags & HAS_AVX2) aom_obmc_variance128x64 = aom_obmc_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6691:9): [True: 1, False: 0]
  ------------------
 6692|      1|    aom_obmc_variance16x16 = aom_obmc_variance16x16_c;
 6693|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance16x16 = aom_obmc_variance16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6693:9): [True: 1, False: 0]
  ------------------
 6694|      1|    if (flags & HAS_AVX2) aom_obmc_variance16x16 = aom_obmc_variance16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6694:9): [True: 1, False: 0]
  ------------------
 6695|      1|    aom_obmc_variance16x32 = aom_obmc_variance16x32_c;
 6696|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance16x32 = aom_obmc_variance16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6696:9): [True: 1, False: 0]
  ------------------
 6697|      1|    if (flags & HAS_AVX2) aom_obmc_variance16x32 = aom_obmc_variance16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6697:9): [True: 1, False: 0]
  ------------------
 6698|      1|    aom_obmc_variance16x4 = aom_obmc_variance16x4_c;
 6699|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance16x4 = aom_obmc_variance16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6699:9): [True: 1, False: 0]
  ------------------
 6700|      1|    if (flags & HAS_AVX2) aom_obmc_variance16x4 = aom_obmc_variance16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6700:9): [True: 1, False: 0]
  ------------------
 6701|      1|    aom_obmc_variance16x64 = aom_obmc_variance16x64_c;
 6702|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance16x64 = aom_obmc_variance16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6702:9): [True: 1, False: 0]
  ------------------
 6703|      1|    if (flags & HAS_AVX2) aom_obmc_variance16x64 = aom_obmc_variance16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6703:9): [True: 1, False: 0]
  ------------------
 6704|      1|    aom_obmc_variance16x8 = aom_obmc_variance16x8_c;
 6705|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance16x8 = aom_obmc_variance16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6705:9): [True: 1, False: 0]
  ------------------
 6706|      1|    if (flags & HAS_AVX2) aom_obmc_variance16x8 = aom_obmc_variance16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6706:9): [True: 1, False: 0]
  ------------------
 6707|      1|    aom_obmc_variance32x16 = aom_obmc_variance32x16_c;
 6708|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance32x16 = aom_obmc_variance32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6708:9): [True: 1, False: 0]
  ------------------
 6709|      1|    if (flags & HAS_AVX2) aom_obmc_variance32x16 = aom_obmc_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6709:9): [True: 1, False: 0]
  ------------------
 6710|      1|    aom_obmc_variance32x32 = aom_obmc_variance32x32_c;
 6711|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance32x32 = aom_obmc_variance32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6711:9): [True: 1, False: 0]
  ------------------
 6712|      1|    if (flags & HAS_AVX2) aom_obmc_variance32x32 = aom_obmc_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6712:9): [True: 1, False: 0]
  ------------------
 6713|      1|    aom_obmc_variance32x64 = aom_obmc_variance32x64_c;
 6714|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance32x64 = aom_obmc_variance32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6714:9): [True: 1, False: 0]
  ------------------
 6715|      1|    if (flags & HAS_AVX2) aom_obmc_variance32x64 = aom_obmc_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6715:9): [True: 1, False: 0]
  ------------------
 6716|      1|    aom_obmc_variance32x8 = aom_obmc_variance32x8_c;
 6717|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance32x8 = aom_obmc_variance32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6717:9): [True: 1, False: 0]
  ------------------
 6718|      1|    if (flags & HAS_AVX2) aom_obmc_variance32x8 = aom_obmc_variance32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6718:9): [True: 1, False: 0]
  ------------------
 6719|      1|    aom_obmc_variance4x16 = aom_obmc_variance4x16_c;
 6720|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance4x16 = aom_obmc_variance4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6720:9): [True: 1, False: 0]
  ------------------
 6721|      1|    if (flags & HAS_AVX2) aom_obmc_variance4x16 = aom_obmc_variance4x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6721:9): [True: 1, False: 0]
  ------------------
 6722|      1|    aom_obmc_variance4x4 = aom_obmc_variance4x4_c;
 6723|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance4x4 = aom_obmc_variance4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6723:9): [True: 1, False: 0]
  ------------------
 6724|      1|    if (flags & HAS_AVX2) aom_obmc_variance4x4 = aom_obmc_variance4x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6724:9): [True: 1, False: 0]
  ------------------
 6725|      1|    aom_obmc_variance4x8 = aom_obmc_variance4x8_c;
 6726|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance4x8 = aom_obmc_variance4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6726:9): [True: 1, False: 0]
  ------------------
 6727|      1|    if (flags & HAS_AVX2) aom_obmc_variance4x8 = aom_obmc_variance4x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6727:9): [True: 1, False: 0]
  ------------------
 6728|      1|    aom_obmc_variance64x128 = aom_obmc_variance64x128_c;
 6729|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance64x128 = aom_obmc_variance64x128_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6729:9): [True: 1, False: 0]
  ------------------
 6730|      1|    if (flags & HAS_AVX2) aom_obmc_variance64x128 = aom_obmc_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6730:9): [True: 1, False: 0]
  ------------------
 6731|      1|    aom_obmc_variance64x16 = aom_obmc_variance64x16_c;
 6732|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance64x16 = aom_obmc_variance64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6732:9): [True: 1, False: 0]
  ------------------
 6733|      1|    if (flags & HAS_AVX2) aom_obmc_variance64x16 = aom_obmc_variance64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6733:9): [True: 1, False: 0]
  ------------------
 6734|      1|    aom_obmc_variance64x32 = aom_obmc_variance64x32_c;
 6735|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance64x32 = aom_obmc_variance64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6735:9): [True: 1, False: 0]
  ------------------
 6736|      1|    if (flags & HAS_AVX2) aom_obmc_variance64x32 = aom_obmc_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6736:9): [True: 1, False: 0]
  ------------------
 6737|      1|    aom_obmc_variance64x64 = aom_obmc_variance64x64_c;
 6738|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance64x64 = aom_obmc_variance64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6738:9): [True: 1, False: 0]
  ------------------
 6739|      1|    if (flags & HAS_AVX2) aom_obmc_variance64x64 = aom_obmc_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6739:9): [True: 1, False: 0]
  ------------------
 6740|      1|    aom_obmc_variance8x16 = aom_obmc_variance8x16_c;
 6741|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance8x16 = aom_obmc_variance8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6741:9): [True: 1, False: 0]
  ------------------
 6742|      1|    if (flags & HAS_AVX2) aom_obmc_variance8x16 = aom_obmc_variance8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6742:9): [True: 1, False: 0]
  ------------------
 6743|      1|    aom_obmc_variance8x32 = aom_obmc_variance8x32_c;
 6744|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance8x32 = aom_obmc_variance8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6744:9): [True: 1, False: 0]
  ------------------
 6745|      1|    if (flags & HAS_AVX2) aom_obmc_variance8x32 = aom_obmc_variance8x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6745:9): [True: 1, False: 0]
  ------------------
 6746|      1|    aom_obmc_variance8x4 = aom_obmc_variance8x4_c;
 6747|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance8x4 = aom_obmc_variance8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6747:9): [True: 1, False: 0]
  ------------------
 6748|      1|    if (flags & HAS_AVX2) aom_obmc_variance8x4 = aom_obmc_variance8x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6748:9): [True: 1, False: 0]
  ------------------
 6749|      1|    aom_obmc_variance8x8 = aom_obmc_variance8x8_c;
 6750|      1|    if (flags & HAS_SSE4_1) aom_obmc_variance8x8 = aom_obmc_variance8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (6750:9): [True: 1, False: 0]
  ------------------
 6751|      1|    if (flags & HAS_AVX2) aom_obmc_variance8x8 = aom_obmc_variance8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6751:9): [True: 1, False: 0]
  ------------------
 6752|      1|    aom_paeth_predictor_16x16 = aom_paeth_predictor_16x16_c;
 6753|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_16x16 = aom_paeth_predictor_16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6753:9): [True: 1, False: 0]
  ------------------
 6754|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_16x16 = aom_paeth_predictor_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6754:9): [True: 1, False: 0]
  ------------------
 6755|      1|    aom_paeth_predictor_16x32 = aom_paeth_predictor_16x32_c;
 6756|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_16x32 = aom_paeth_predictor_16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6756:9): [True: 1, False: 0]
  ------------------
 6757|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_16x32 = aom_paeth_predictor_16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6757:9): [True: 1, False: 0]
  ------------------
 6758|      1|    aom_paeth_predictor_16x4 = aom_paeth_predictor_16x4_c;
 6759|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_16x4 = aom_paeth_predictor_16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6759:9): [True: 1, False: 0]
  ------------------
 6760|      1|    aom_paeth_predictor_16x64 = aom_paeth_predictor_16x64_c;
 6761|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_16x64 = aom_paeth_predictor_16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6761:9): [True: 1, False: 0]
  ------------------
 6762|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_16x64 = aom_paeth_predictor_16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6762:9): [True: 1, False: 0]
  ------------------
 6763|      1|    aom_paeth_predictor_16x8 = aom_paeth_predictor_16x8_c;
 6764|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_16x8 = aom_paeth_predictor_16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6764:9): [True: 1, False: 0]
  ------------------
 6765|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_16x8 = aom_paeth_predictor_16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6765:9): [True: 1, False: 0]
  ------------------
 6766|      1|    aom_paeth_predictor_32x16 = aom_paeth_predictor_32x16_c;
 6767|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_32x16 = aom_paeth_predictor_32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6767:9): [True: 1, False: 0]
  ------------------
 6768|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_32x16 = aom_paeth_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6768:9): [True: 1, False: 0]
  ------------------
 6769|      1|    aom_paeth_predictor_32x32 = aom_paeth_predictor_32x32_c;
 6770|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_32x32 = aom_paeth_predictor_32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6770:9): [True: 1, False: 0]
  ------------------
 6771|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_32x32 = aom_paeth_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6771:9): [True: 1, False: 0]
  ------------------
 6772|      1|    aom_paeth_predictor_32x64 = aom_paeth_predictor_32x64_c;
 6773|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_32x64 = aom_paeth_predictor_32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6773:9): [True: 1, False: 0]
  ------------------
 6774|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_32x64 = aom_paeth_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6774:9): [True: 1, False: 0]
  ------------------
 6775|      1|    aom_paeth_predictor_32x8 = aom_paeth_predictor_32x8_c;
 6776|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_32x8 = aom_paeth_predictor_32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6776:9): [True: 1, False: 0]
  ------------------
 6777|      1|    aom_paeth_predictor_4x16 = aom_paeth_predictor_4x16_c;
 6778|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_4x16 = aom_paeth_predictor_4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6778:9): [True: 1, False: 0]
  ------------------
 6779|      1|    aom_paeth_predictor_4x4 = aom_paeth_predictor_4x4_c;
 6780|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_4x4 = aom_paeth_predictor_4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6780:9): [True: 1, False: 0]
  ------------------
 6781|      1|    aom_paeth_predictor_4x8 = aom_paeth_predictor_4x8_c;
 6782|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_4x8 = aom_paeth_predictor_4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6782:9): [True: 1, False: 0]
  ------------------
 6783|      1|    aom_paeth_predictor_64x16 = aom_paeth_predictor_64x16_c;
 6784|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_64x16 = aom_paeth_predictor_64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6784:9): [True: 1, False: 0]
  ------------------
 6785|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_64x16 = aom_paeth_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6785:9): [True: 1, False: 0]
  ------------------
 6786|      1|    aom_paeth_predictor_64x32 = aom_paeth_predictor_64x32_c;
 6787|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_64x32 = aom_paeth_predictor_64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6787:9): [True: 1, False: 0]
  ------------------
 6788|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_64x32 = aom_paeth_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6788:9): [True: 1, False: 0]
  ------------------
 6789|      1|    aom_paeth_predictor_64x64 = aom_paeth_predictor_64x64_c;
 6790|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_64x64 = aom_paeth_predictor_64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6790:9): [True: 1, False: 0]
  ------------------
 6791|      1|    if (flags & HAS_AVX2) aom_paeth_predictor_64x64 = aom_paeth_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6791:9): [True: 1, False: 0]
  ------------------
 6792|      1|    aom_paeth_predictor_8x16 = aom_paeth_predictor_8x16_c;
 6793|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_8x16 = aom_paeth_predictor_8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6793:9): [True: 1, False: 0]
  ------------------
 6794|      1|    aom_paeth_predictor_8x32 = aom_paeth_predictor_8x32_c;
 6795|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_8x32 = aom_paeth_predictor_8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6795:9): [True: 1, False: 0]
  ------------------
 6796|      1|    aom_paeth_predictor_8x4 = aom_paeth_predictor_8x4_c;
 6797|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_8x4 = aom_paeth_predictor_8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6797:9): [True: 1, False: 0]
  ------------------
 6798|      1|    aom_paeth_predictor_8x8 = aom_paeth_predictor_8x8_c;
 6799|      1|    if (flags & HAS_SSSE3) aom_paeth_predictor_8x8 = aom_paeth_predictor_8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6799:9): [True: 1, False: 0]
  ------------------
 6800|      1|    aom_quantize_b = aom_quantize_b_sse2;
 6801|      1|    if (flags & HAS_SSSE3) aom_quantize_b = aom_quantize_b_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6801:9): [True: 1, False: 0]
  ------------------
 6802|      1|    if (flags & HAS_AVX) aom_quantize_b = aom_quantize_b_avx;
  ------------------
  |  |  167|      1|#define HAS_AVX 0x40
  ------------------
  |  Branch (6802:9): [True: 1, False: 0]
  ------------------
 6803|      1|    if (flags & HAS_AVX2) aom_quantize_b = aom_quantize_b_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6803:9): [True: 1, False: 0]
  ------------------
 6804|      1|    aom_quantize_b_32x32 = aom_quantize_b_32x32_c;
 6805|      1|    if (flags & HAS_SSSE3) aom_quantize_b_32x32 = aom_quantize_b_32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6805:9): [True: 1, False: 0]
  ------------------
 6806|      1|    if (flags & HAS_AVX) aom_quantize_b_32x32 = aom_quantize_b_32x32_avx;
  ------------------
  |  |  167|      1|#define HAS_AVX 0x40
  ------------------
  |  Branch (6806:9): [True: 1, False: 0]
  ------------------
 6807|      1|    if (flags & HAS_AVX2) aom_quantize_b_32x32 = aom_quantize_b_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6807:9): [True: 1, False: 0]
  ------------------
 6808|      1|    aom_quantize_b_64x64 = aom_quantize_b_64x64_c;
 6809|      1|    if (flags & HAS_SSSE3) aom_quantize_b_64x64 = aom_quantize_b_64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6809:9): [True: 1, False: 0]
  ------------------
 6810|      1|    if (flags & HAS_AVX2) aom_quantize_b_64x64 = aom_quantize_b_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6810:9): [True: 1, False: 0]
  ------------------
 6811|      1|    aom_quantize_b_adaptive = aom_quantize_b_adaptive_sse2;
 6812|      1|    if (flags & HAS_AVX2) aom_quantize_b_adaptive = aom_quantize_b_adaptive_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6812:9): [True: 1, False: 0]
  ------------------
 6813|      1|    aom_sad128x128 = aom_sad128x128_sse2;
 6814|      1|    if (flags & HAS_AVX2) aom_sad128x128 = aom_sad128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6814:9): [True: 1, False: 0]
  ------------------
 6815|      1|    aom_sad128x128_avg = aom_sad128x128_avg_sse2;
 6816|      1|    if (flags & HAS_AVX2) aom_sad128x128_avg = aom_sad128x128_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6816:9): [True: 1, False: 0]
  ------------------
 6817|      1|    aom_sad128x128x3d = aom_sad128x128x3d_c;
 6818|      1|    if (flags & HAS_AVX2) aom_sad128x128x3d = aom_sad128x128x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6818:9): [True: 1, False: 0]
  ------------------
 6819|      1|    aom_sad128x128x4d = aom_sad128x128x4d_sse2;
 6820|      1|    if (flags & HAS_AVX2) aom_sad128x128x4d = aom_sad128x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6820:9): [True: 1, False: 0]
  ------------------
 6821|      1|    aom_sad128x64 = aom_sad128x64_sse2;
 6822|      1|    if (flags & HAS_AVX2) aom_sad128x64 = aom_sad128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6822:9): [True: 1, False: 0]
  ------------------
 6823|      1|    aom_sad128x64_avg = aom_sad128x64_avg_sse2;
 6824|      1|    if (flags & HAS_AVX2) aom_sad128x64_avg = aom_sad128x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6824:9): [True: 1, False: 0]
  ------------------
 6825|      1|    aom_sad128x64x3d = aom_sad128x64x3d_c;
 6826|      1|    if (flags & HAS_AVX2) aom_sad128x64x3d = aom_sad128x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6826:9): [True: 1, False: 0]
  ------------------
 6827|      1|    aom_sad128x64x4d = aom_sad128x64x4d_sse2;
 6828|      1|    if (flags & HAS_AVX2) aom_sad128x64x4d = aom_sad128x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6828:9): [True: 1, False: 0]
  ------------------
 6829|      1|    aom_sad16x16x3d = aom_sad16x16x3d_c;
 6830|      1|    if (flags & HAS_AVX2) aom_sad16x16x3d = aom_sad16x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6830:9): [True: 1, False: 0]
  ------------------
 6831|      1|    aom_sad16x16x4d = aom_sad16x16x4d_sse2;
 6832|      1|    if (flags & HAS_AVX2) aom_sad16x16x4d = aom_sad16x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6832:9): [True: 1, False: 0]
  ------------------
 6833|      1|    aom_sad16x32x3d = aom_sad16x32x3d_c;
 6834|      1|    if (flags & HAS_AVX2) aom_sad16x32x3d = aom_sad16x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6834:9): [True: 1, False: 0]
  ------------------
 6835|      1|    aom_sad16x32x4d = aom_sad16x32x4d_sse2;
 6836|      1|    if (flags & HAS_AVX2) aom_sad16x32x4d = aom_sad16x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6836:9): [True: 1, False: 0]
  ------------------
 6837|      1|    aom_sad16x4x3d = aom_sad16x4x3d_c;
 6838|      1|    if (flags & HAS_AVX2) aom_sad16x4x3d = aom_sad16x4x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6838:9): [True: 1, False: 0]
  ------------------
 6839|      1|    aom_sad16x4x4d = aom_sad16x4x4d_sse2;
 6840|      1|    if (flags & HAS_AVX2) aom_sad16x4x4d = aom_sad16x4x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6840:9): [True: 1, False: 0]
  ------------------
 6841|      1|    aom_sad16x64x3d = aom_sad16x64x3d_c;
 6842|      1|    if (flags & HAS_AVX2) aom_sad16x64x3d = aom_sad16x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6842:9): [True: 1, False: 0]
  ------------------
 6843|      1|    aom_sad16x64x4d = aom_sad16x64x4d_sse2;
 6844|      1|    if (flags & HAS_AVX2) aom_sad16x64x4d = aom_sad16x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6844:9): [True: 1, False: 0]
  ------------------
 6845|      1|    aom_sad16x8x3d = aom_sad16x8x3d_c;
 6846|      1|    if (flags & HAS_AVX2) aom_sad16x8x3d = aom_sad16x8x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6846:9): [True: 1, False: 0]
  ------------------
 6847|      1|    aom_sad16x8x4d = aom_sad16x8x4d_sse2;
 6848|      1|    if (flags & HAS_AVX2) aom_sad16x8x4d = aom_sad16x8x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6848:9): [True: 1, False: 0]
  ------------------
 6849|      1|    aom_sad32x16 = aom_sad32x16_sse2;
 6850|      1|    if (flags & HAS_AVX2) aom_sad32x16 = aom_sad32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6850:9): [True: 1, False: 0]
  ------------------
 6851|      1|    aom_sad32x16_avg = aom_sad32x16_avg_sse2;
 6852|      1|    if (flags & HAS_AVX2) aom_sad32x16_avg = aom_sad32x16_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6852:9): [True: 1, False: 0]
  ------------------
 6853|      1|    aom_sad32x16x3d = aom_sad32x16x3d_c;
 6854|      1|    if (flags & HAS_AVX2) aom_sad32x16x3d = aom_sad32x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6854:9): [True: 1, False: 0]
  ------------------
 6855|      1|    aom_sad32x16x4d = aom_sad32x16x4d_sse2;
 6856|      1|    if (flags & HAS_AVX2) aom_sad32x16x4d = aom_sad32x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6856:9): [True: 1, False: 0]
  ------------------
 6857|      1|    aom_sad32x32 = aom_sad32x32_sse2;
 6858|      1|    if (flags & HAS_AVX2) aom_sad32x32 = aom_sad32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6858:9): [True: 1, False: 0]
  ------------------
 6859|      1|    aom_sad32x32_avg = aom_sad32x32_avg_sse2;
 6860|      1|    if (flags & HAS_AVX2) aom_sad32x32_avg = aom_sad32x32_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6860:9): [True: 1, False: 0]
  ------------------
 6861|      1|    aom_sad32x32x3d = aom_sad32x32x3d_c;
 6862|      1|    if (flags & HAS_AVX2) aom_sad32x32x3d = aom_sad32x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6862:9): [True: 1, False: 0]
  ------------------
 6863|      1|    aom_sad32x32x4d = aom_sad32x32x4d_sse2;
 6864|      1|    if (flags & HAS_AVX2) aom_sad32x32x4d = aom_sad32x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6864:9): [True: 1, False: 0]
  ------------------
 6865|      1|    aom_sad32x64 = aom_sad32x64_sse2;
 6866|      1|    if (flags & HAS_AVX2) aom_sad32x64 = aom_sad32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6866:9): [True: 1, False: 0]
  ------------------
 6867|      1|    aom_sad32x64_avg = aom_sad32x64_avg_sse2;
 6868|      1|    if (flags & HAS_AVX2) aom_sad32x64_avg = aom_sad32x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6868:9): [True: 1, False: 0]
  ------------------
 6869|      1|    aom_sad32x64x3d = aom_sad32x64x3d_c;
 6870|      1|    if (flags & HAS_AVX2) aom_sad32x64x3d = aom_sad32x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6870:9): [True: 1, False: 0]
  ------------------
 6871|      1|    aom_sad32x64x4d = aom_sad32x64x4d_sse2;
 6872|      1|    if (flags & HAS_AVX2) aom_sad32x64x4d = aom_sad32x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6872:9): [True: 1, False: 0]
  ------------------
 6873|      1|    aom_sad32x8x3d = aom_sad32x8x3d_c;
 6874|      1|    if (flags & HAS_AVX2) aom_sad32x8x3d = aom_sad32x8x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6874:9): [True: 1, False: 0]
  ------------------
 6875|      1|    aom_sad32x8x4d = aom_sad32x8x4d_sse2;
 6876|      1|    if (flags & HAS_AVX2) aom_sad32x8x4d = aom_sad32x8x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6876:9): [True: 1, False: 0]
  ------------------
 6877|      1|    aom_sad64x128 = aom_sad64x128_sse2;
 6878|      1|    if (flags & HAS_AVX2) aom_sad64x128 = aom_sad64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6878:9): [True: 1, False: 0]
  ------------------
 6879|      1|    aom_sad64x128_avg = aom_sad64x128_avg_sse2;
 6880|      1|    if (flags & HAS_AVX2) aom_sad64x128_avg = aom_sad64x128_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6880:9): [True: 1, False: 0]
  ------------------
 6881|      1|    aom_sad64x128x3d = aom_sad64x128x3d_c;
 6882|      1|    if (flags & HAS_AVX2) aom_sad64x128x3d = aom_sad64x128x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6882:9): [True: 1, False: 0]
  ------------------
 6883|      1|    aom_sad64x128x4d = aom_sad64x128x4d_sse2;
 6884|      1|    if (flags & HAS_AVX2) aom_sad64x128x4d = aom_sad64x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6884:9): [True: 1, False: 0]
  ------------------
 6885|      1|    aom_sad64x16x3d = aom_sad64x16x3d_c;
 6886|      1|    if (flags & HAS_AVX2) aom_sad64x16x3d = aom_sad64x16x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6886:9): [True: 1, False: 0]
  ------------------
 6887|      1|    aom_sad64x16x4d = aom_sad64x16x4d_sse2;
 6888|      1|    if (flags & HAS_AVX2) aom_sad64x16x4d = aom_sad64x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6888:9): [True: 1, False: 0]
  ------------------
 6889|      1|    aom_sad64x32 = aom_sad64x32_sse2;
 6890|      1|    if (flags & HAS_AVX2) aom_sad64x32 = aom_sad64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6890:9): [True: 1, False: 0]
  ------------------
 6891|      1|    aom_sad64x32_avg = aom_sad64x32_avg_sse2;
 6892|      1|    if (flags & HAS_AVX2) aom_sad64x32_avg = aom_sad64x32_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6892:9): [True: 1, False: 0]
  ------------------
 6893|      1|    aom_sad64x32x3d = aom_sad64x32x3d_c;
 6894|      1|    if (flags & HAS_AVX2) aom_sad64x32x3d = aom_sad64x32x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6894:9): [True: 1, False: 0]
  ------------------
 6895|      1|    aom_sad64x32x4d = aom_sad64x32x4d_sse2;
 6896|      1|    if (flags & HAS_AVX2) aom_sad64x32x4d = aom_sad64x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6896:9): [True: 1, False: 0]
  ------------------
 6897|      1|    aom_sad64x64 = aom_sad64x64_sse2;
 6898|      1|    if (flags & HAS_AVX2) aom_sad64x64 = aom_sad64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6898:9): [True: 1, False: 0]
  ------------------
 6899|      1|    aom_sad64x64_avg = aom_sad64x64_avg_sse2;
 6900|      1|    if (flags & HAS_AVX2) aom_sad64x64_avg = aom_sad64x64_avg_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6900:9): [True: 1, False: 0]
  ------------------
 6901|      1|    aom_sad64x64x3d = aom_sad64x64x3d_c;
 6902|      1|    if (flags & HAS_AVX2) aom_sad64x64x3d = aom_sad64x64x3d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6902:9): [True: 1, False: 0]
  ------------------
 6903|      1|    aom_sad64x64x4d = aom_sad64x64x4d_sse2;
 6904|      1|    if (flags & HAS_AVX2) aom_sad64x64x4d = aom_sad64x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6904:9): [True: 1, False: 0]
  ------------------
 6905|      1|    aom_sad_skip_128x128 = aom_sad_skip_128x128_sse2;
 6906|      1|    if (flags & HAS_AVX2) aom_sad_skip_128x128 = aom_sad_skip_128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6906:9): [True: 1, False: 0]
  ------------------
 6907|      1|    aom_sad_skip_128x128x4d = aom_sad_skip_128x128x4d_sse2;
 6908|      1|    if (flags & HAS_AVX2) aom_sad_skip_128x128x4d = aom_sad_skip_128x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6908:9): [True: 1, False: 0]
  ------------------
 6909|      1|    aom_sad_skip_128x64 = aom_sad_skip_128x64_sse2;
 6910|      1|    if (flags & HAS_AVX2) aom_sad_skip_128x64 = aom_sad_skip_128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6910:9): [True: 1, False: 0]
  ------------------
 6911|      1|    aom_sad_skip_128x64x4d = aom_sad_skip_128x64x4d_sse2;
 6912|      1|    if (flags & HAS_AVX2) aom_sad_skip_128x64x4d = aom_sad_skip_128x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6912:9): [True: 1, False: 0]
  ------------------
 6913|      1|    aom_sad_skip_16x16x4d = aom_sad_skip_16x16x4d_sse2;
 6914|      1|    if (flags & HAS_AVX2) aom_sad_skip_16x16x4d = aom_sad_skip_16x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6914:9): [True: 1, False: 0]
  ------------------
 6915|      1|    aom_sad_skip_16x32x4d = aom_sad_skip_16x32x4d_sse2;
 6916|      1|    if (flags & HAS_AVX2) aom_sad_skip_16x32x4d = aom_sad_skip_16x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6916:9): [True: 1, False: 0]
  ------------------
 6917|      1|    aom_sad_skip_16x64x4d = aom_sad_skip_16x64x4d_sse2;
 6918|      1|    if (flags & HAS_AVX2) aom_sad_skip_16x64x4d = aom_sad_skip_16x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6918:9): [True: 1, False: 0]
  ------------------
 6919|      1|    aom_sad_skip_32x16 = aom_sad_skip_32x16_sse2;
 6920|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x16 = aom_sad_skip_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6920:9): [True: 1, False: 0]
  ------------------
 6921|      1|    aom_sad_skip_32x16x4d = aom_sad_skip_32x16x4d_sse2;
 6922|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x16x4d = aom_sad_skip_32x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6922:9): [True: 1, False: 0]
  ------------------
 6923|      1|    aom_sad_skip_32x32 = aom_sad_skip_32x32_sse2;
 6924|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x32 = aom_sad_skip_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6924:9): [True: 1, False: 0]
  ------------------
 6925|      1|    aom_sad_skip_32x32x4d = aom_sad_skip_32x32x4d_sse2;
 6926|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x32x4d = aom_sad_skip_32x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6926:9): [True: 1, False: 0]
  ------------------
 6927|      1|    aom_sad_skip_32x64 = aom_sad_skip_32x64_sse2;
 6928|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x64 = aom_sad_skip_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6928:9): [True: 1, False: 0]
  ------------------
 6929|      1|    aom_sad_skip_32x64x4d = aom_sad_skip_32x64x4d_sse2;
 6930|      1|    if (flags & HAS_AVX2) aom_sad_skip_32x64x4d = aom_sad_skip_32x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6930:9): [True: 1, False: 0]
  ------------------
 6931|      1|    aom_sad_skip_64x128 = aom_sad_skip_64x128_sse2;
 6932|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x128 = aom_sad_skip_64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6932:9): [True: 1, False: 0]
  ------------------
 6933|      1|    aom_sad_skip_64x128x4d = aom_sad_skip_64x128x4d_sse2;
 6934|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x128x4d = aom_sad_skip_64x128x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6934:9): [True: 1, False: 0]
  ------------------
 6935|      1|    aom_sad_skip_64x16x4d = aom_sad_skip_64x16x4d_sse2;
 6936|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x16x4d = aom_sad_skip_64x16x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6936:9): [True: 1, False: 0]
  ------------------
 6937|      1|    aom_sad_skip_64x32 = aom_sad_skip_64x32_sse2;
 6938|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x32 = aom_sad_skip_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6938:9): [True: 1, False: 0]
  ------------------
 6939|      1|    aom_sad_skip_64x32x4d = aom_sad_skip_64x32x4d_sse2;
 6940|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x32x4d = aom_sad_skip_64x32x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6940:9): [True: 1, False: 0]
  ------------------
 6941|      1|    aom_sad_skip_64x64 = aom_sad_skip_64x64_sse2;
 6942|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x64 = aom_sad_skip_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6942:9): [True: 1, False: 0]
  ------------------
 6943|      1|    aom_sad_skip_64x64x4d = aom_sad_skip_64x64x4d_sse2;
 6944|      1|    if (flags & HAS_AVX2) aom_sad_skip_64x64x4d = aom_sad_skip_64x64x4d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6944:9): [True: 1, False: 0]
  ------------------
 6945|      1|    aom_satd = aom_satd_sse2;
 6946|      1|    if (flags & HAS_AVX2) aom_satd = aom_satd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6946:9): [True: 1, False: 0]
  ------------------
 6947|      1|    aom_satd_lp = aom_satd_lp_sse2;
 6948|      1|    if (flags & HAS_AVX2) aom_satd_lp = aom_satd_lp_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (6948:9): [True: 1, False: 0]
  ------------------
 6949|      1|    aom_scaled_2d = aom_scaled_2d_c;
 6950|      1|    if (flags & HAS_SSSE3) aom_scaled_2d = aom_scaled_2d_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6950:9): [True: 1, False: 0]
  ------------------
 6951|      1|    aom_smooth_h_predictor_16x16 = aom_smooth_h_predictor_16x16_c;
 6952|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_16x16 = aom_smooth_h_predictor_16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6952:9): [True: 1, False: 0]
  ------------------
 6953|      1|    aom_smooth_h_predictor_16x32 = aom_smooth_h_predictor_16x32_c;
 6954|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_16x32 = aom_smooth_h_predictor_16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6954:9): [True: 1, False: 0]
  ------------------
 6955|      1|    aom_smooth_h_predictor_16x4 = aom_smooth_h_predictor_16x4_c;
 6956|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_16x4 = aom_smooth_h_predictor_16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6956:9): [True: 1, False: 0]
  ------------------
 6957|      1|    aom_smooth_h_predictor_16x64 = aom_smooth_h_predictor_16x64_c;
 6958|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_16x64 = aom_smooth_h_predictor_16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6958:9): [True: 1, False: 0]
  ------------------
 6959|      1|    aom_smooth_h_predictor_16x8 = aom_smooth_h_predictor_16x8_c;
 6960|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_16x8 = aom_smooth_h_predictor_16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6960:9): [True: 1, False: 0]
  ------------------
 6961|      1|    aom_smooth_h_predictor_32x16 = aom_smooth_h_predictor_32x16_c;
 6962|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_32x16 = aom_smooth_h_predictor_32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6962:9): [True: 1, False: 0]
  ------------------
 6963|      1|    aom_smooth_h_predictor_32x32 = aom_smooth_h_predictor_32x32_c;
 6964|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_32x32 = aom_smooth_h_predictor_32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6964:9): [True: 1, False: 0]
  ------------------
 6965|      1|    aom_smooth_h_predictor_32x64 = aom_smooth_h_predictor_32x64_c;
 6966|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_32x64 = aom_smooth_h_predictor_32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6966:9): [True: 1, False: 0]
  ------------------
 6967|      1|    aom_smooth_h_predictor_32x8 = aom_smooth_h_predictor_32x8_c;
 6968|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_32x8 = aom_smooth_h_predictor_32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6968:9): [True: 1, False: 0]
  ------------------
 6969|      1|    aom_smooth_h_predictor_4x16 = aom_smooth_h_predictor_4x16_c;
 6970|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_4x16 = aom_smooth_h_predictor_4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6970:9): [True: 1, False: 0]
  ------------------
 6971|      1|    aom_smooth_h_predictor_4x4 = aom_smooth_h_predictor_4x4_c;
 6972|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_4x4 = aom_smooth_h_predictor_4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6972:9): [True: 1, False: 0]
  ------------------
 6973|      1|    aom_smooth_h_predictor_4x8 = aom_smooth_h_predictor_4x8_c;
 6974|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_4x8 = aom_smooth_h_predictor_4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6974:9): [True: 1, False: 0]
  ------------------
 6975|      1|    aom_smooth_h_predictor_64x16 = aom_smooth_h_predictor_64x16_c;
 6976|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_64x16 = aom_smooth_h_predictor_64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6976:9): [True: 1, False: 0]
  ------------------
 6977|      1|    aom_smooth_h_predictor_64x32 = aom_smooth_h_predictor_64x32_c;
 6978|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_64x32 = aom_smooth_h_predictor_64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6978:9): [True: 1, False: 0]
  ------------------
 6979|      1|    aom_smooth_h_predictor_64x64 = aom_smooth_h_predictor_64x64_c;
 6980|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_64x64 = aom_smooth_h_predictor_64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6980:9): [True: 1, False: 0]
  ------------------
 6981|      1|    aom_smooth_h_predictor_8x16 = aom_smooth_h_predictor_8x16_c;
 6982|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_8x16 = aom_smooth_h_predictor_8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6982:9): [True: 1, False: 0]
  ------------------
 6983|      1|    aom_smooth_h_predictor_8x32 = aom_smooth_h_predictor_8x32_c;
 6984|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_8x32 = aom_smooth_h_predictor_8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6984:9): [True: 1, False: 0]
  ------------------
 6985|      1|    aom_smooth_h_predictor_8x4 = aom_smooth_h_predictor_8x4_c;
 6986|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_8x4 = aom_smooth_h_predictor_8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6986:9): [True: 1, False: 0]
  ------------------
 6987|      1|    aom_smooth_h_predictor_8x8 = aom_smooth_h_predictor_8x8_c;
 6988|      1|    if (flags & HAS_SSSE3) aom_smooth_h_predictor_8x8 = aom_smooth_h_predictor_8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6988:9): [True: 1, False: 0]
  ------------------
 6989|      1|    aom_smooth_predictor_16x16 = aom_smooth_predictor_16x16_c;
 6990|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_16x16 = aom_smooth_predictor_16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6990:9): [True: 1, False: 0]
  ------------------
 6991|      1|    aom_smooth_predictor_16x32 = aom_smooth_predictor_16x32_c;
 6992|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_16x32 = aom_smooth_predictor_16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6992:9): [True: 1, False: 0]
  ------------------
 6993|      1|    aom_smooth_predictor_16x4 = aom_smooth_predictor_16x4_c;
 6994|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_16x4 = aom_smooth_predictor_16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6994:9): [True: 1, False: 0]
  ------------------
 6995|      1|    aom_smooth_predictor_16x64 = aom_smooth_predictor_16x64_c;
 6996|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_16x64 = aom_smooth_predictor_16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6996:9): [True: 1, False: 0]
  ------------------
 6997|      1|    aom_smooth_predictor_16x8 = aom_smooth_predictor_16x8_c;
 6998|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_16x8 = aom_smooth_predictor_16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (6998:9): [True: 1, False: 0]
  ------------------
 6999|      1|    aom_smooth_predictor_32x16 = aom_smooth_predictor_32x16_c;
 7000|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_32x16 = aom_smooth_predictor_32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7000:9): [True: 1, False: 0]
  ------------------
 7001|      1|    aom_smooth_predictor_32x32 = aom_smooth_predictor_32x32_c;
 7002|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_32x32 = aom_smooth_predictor_32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7002:9): [True: 1, False: 0]
  ------------------
 7003|      1|    aom_smooth_predictor_32x64 = aom_smooth_predictor_32x64_c;
 7004|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_32x64 = aom_smooth_predictor_32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7004:9): [True: 1, False: 0]
  ------------------
 7005|      1|    aom_smooth_predictor_32x8 = aom_smooth_predictor_32x8_c;
 7006|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_32x8 = aom_smooth_predictor_32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7006:9): [True: 1, False: 0]
  ------------------
 7007|      1|    aom_smooth_predictor_4x16 = aom_smooth_predictor_4x16_c;
 7008|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_4x16 = aom_smooth_predictor_4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7008:9): [True: 1, False: 0]
  ------------------
 7009|      1|    aom_smooth_predictor_4x4 = aom_smooth_predictor_4x4_c;
 7010|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_4x4 = aom_smooth_predictor_4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7010:9): [True: 1, False: 0]
  ------------------
 7011|      1|    aom_smooth_predictor_4x8 = aom_smooth_predictor_4x8_c;
 7012|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_4x8 = aom_smooth_predictor_4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7012:9): [True: 1, False: 0]
  ------------------
 7013|      1|    aom_smooth_predictor_64x16 = aom_smooth_predictor_64x16_c;
 7014|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_64x16 = aom_smooth_predictor_64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7014:9): [True: 1, False: 0]
  ------------------
 7015|      1|    aom_smooth_predictor_64x32 = aom_smooth_predictor_64x32_c;
 7016|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_64x32 = aom_smooth_predictor_64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7016:9): [True: 1, False: 0]
  ------------------
 7017|      1|    aom_smooth_predictor_64x64 = aom_smooth_predictor_64x64_c;
 7018|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_64x64 = aom_smooth_predictor_64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7018:9): [True: 1, False: 0]
  ------------------
 7019|      1|    aom_smooth_predictor_8x16 = aom_smooth_predictor_8x16_c;
 7020|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_8x16 = aom_smooth_predictor_8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7020:9): [True: 1, False: 0]
  ------------------
 7021|      1|    aom_smooth_predictor_8x32 = aom_smooth_predictor_8x32_c;
 7022|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_8x32 = aom_smooth_predictor_8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7022:9): [True: 1, False: 0]
  ------------------
 7023|      1|    aom_smooth_predictor_8x4 = aom_smooth_predictor_8x4_c;
 7024|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_8x4 = aom_smooth_predictor_8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7024:9): [True: 1, False: 0]
  ------------------
 7025|      1|    aom_smooth_predictor_8x8 = aom_smooth_predictor_8x8_c;
 7026|      1|    if (flags & HAS_SSSE3) aom_smooth_predictor_8x8 = aom_smooth_predictor_8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7026:9): [True: 1, False: 0]
  ------------------
 7027|      1|    aom_smooth_v_predictor_16x16 = aom_smooth_v_predictor_16x16_c;
 7028|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_16x16 = aom_smooth_v_predictor_16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7028:9): [True: 1, False: 0]
  ------------------
 7029|      1|    aom_smooth_v_predictor_16x32 = aom_smooth_v_predictor_16x32_c;
 7030|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_16x32 = aom_smooth_v_predictor_16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7030:9): [True: 1, False: 0]
  ------------------
 7031|      1|    aom_smooth_v_predictor_16x4 = aom_smooth_v_predictor_16x4_c;
 7032|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_16x4 = aom_smooth_v_predictor_16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7032:9): [True: 1, False: 0]
  ------------------
 7033|      1|    aom_smooth_v_predictor_16x64 = aom_smooth_v_predictor_16x64_c;
 7034|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_16x64 = aom_smooth_v_predictor_16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7034:9): [True: 1, False: 0]
  ------------------
 7035|      1|    aom_smooth_v_predictor_16x8 = aom_smooth_v_predictor_16x8_c;
 7036|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_16x8 = aom_smooth_v_predictor_16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7036:9): [True: 1, False: 0]
  ------------------
 7037|      1|    aom_smooth_v_predictor_32x16 = aom_smooth_v_predictor_32x16_c;
 7038|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_32x16 = aom_smooth_v_predictor_32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7038:9): [True: 1, False: 0]
  ------------------
 7039|      1|    aom_smooth_v_predictor_32x32 = aom_smooth_v_predictor_32x32_c;
 7040|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_32x32 = aom_smooth_v_predictor_32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7040:9): [True: 1, False: 0]
  ------------------
 7041|      1|    aom_smooth_v_predictor_32x64 = aom_smooth_v_predictor_32x64_c;
 7042|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_32x64 = aom_smooth_v_predictor_32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7042:9): [True: 1, False: 0]
  ------------------
 7043|      1|    aom_smooth_v_predictor_32x8 = aom_smooth_v_predictor_32x8_c;
 7044|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_32x8 = aom_smooth_v_predictor_32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7044:9): [True: 1, False: 0]
  ------------------
 7045|      1|    aom_smooth_v_predictor_4x16 = aom_smooth_v_predictor_4x16_c;
 7046|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_4x16 = aom_smooth_v_predictor_4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7046:9): [True: 1, False: 0]
  ------------------
 7047|      1|    aom_smooth_v_predictor_4x4 = aom_smooth_v_predictor_4x4_c;
 7048|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_4x4 = aom_smooth_v_predictor_4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7048:9): [True: 1, False: 0]
  ------------------
 7049|      1|    aom_smooth_v_predictor_4x8 = aom_smooth_v_predictor_4x8_c;
 7050|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_4x8 = aom_smooth_v_predictor_4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7050:9): [True: 1, False: 0]
  ------------------
 7051|      1|    aom_smooth_v_predictor_64x16 = aom_smooth_v_predictor_64x16_c;
 7052|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_64x16 = aom_smooth_v_predictor_64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7052:9): [True: 1, False: 0]
  ------------------
 7053|      1|    aom_smooth_v_predictor_64x32 = aom_smooth_v_predictor_64x32_c;
 7054|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_64x32 = aom_smooth_v_predictor_64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7054:9): [True: 1, False: 0]
  ------------------
 7055|      1|    aom_smooth_v_predictor_64x64 = aom_smooth_v_predictor_64x64_c;
 7056|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_64x64 = aom_smooth_v_predictor_64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7056:9): [True: 1, False: 0]
  ------------------
 7057|      1|    aom_smooth_v_predictor_8x16 = aom_smooth_v_predictor_8x16_c;
 7058|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_8x16 = aom_smooth_v_predictor_8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7058:9): [True: 1, False: 0]
  ------------------
 7059|      1|    aom_smooth_v_predictor_8x32 = aom_smooth_v_predictor_8x32_c;
 7060|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_8x32 = aom_smooth_v_predictor_8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7060:9): [True: 1, False: 0]
  ------------------
 7061|      1|    aom_smooth_v_predictor_8x4 = aom_smooth_v_predictor_8x4_c;
 7062|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_8x4 = aom_smooth_v_predictor_8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7062:9): [True: 1, False: 0]
  ------------------
 7063|      1|    aom_smooth_v_predictor_8x8 = aom_smooth_v_predictor_8x8_c;
 7064|      1|    if (flags & HAS_SSSE3) aom_smooth_v_predictor_8x8 = aom_smooth_v_predictor_8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7064:9): [True: 1, False: 0]
  ------------------
 7065|      1|    aom_sse = aom_sse_c;
 7066|      1|    if (flags & HAS_SSE4_1) aom_sse = aom_sse_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (7066:9): [True: 1, False: 0]
  ------------------
 7067|      1|    if (flags & HAS_AVX2) aom_sse = aom_sse_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7067:9): [True: 1, False: 0]
  ------------------
 7068|      1|    aom_sub_pixel_avg_variance128x128 = aom_sub_pixel_avg_variance128x128_c;
 7069|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance128x128 = aom_sub_pixel_avg_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7069:9): [True: 1, False: 0]
  ------------------
 7070|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance128x128 = aom_sub_pixel_avg_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7070:9): [True: 1, False: 0]
  ------------------
 7071|      1|    aom_sub_pixel_avg_variance128x64 = aom_sub_pixel_avg_variance128x64_c;
 7072|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance128x64 = aom_sub_pixel_avg_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7072:9): [True: 1, False: 0]
  ------------------
 7073|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance128x64 = aom_sub_pixel_avg_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7073:9): [True: 1, False: 0]
  ------------------
 7074|      1|    aom_sub_pixel_avg_variance16x16 = aom_sub_pixel_avg_variance16x16_c;
 7075|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance16x16 = aom_sub_pixel_avg_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7075:9): [True: 1, False: 0]
  ------------------
 7076|      1|    aom_sub_pixel_avg_variance16x32 = aom_sub_pixel_avg_variance16x32_c;
 7077|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance16x32 = aom_sub_pixel_avg_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7077:9): [True: 1, False: 0]
  ------------------
 7078|      1|    aom_sub_pixel_avg_variance16x4 = aom_sub_pixel_avg_variance16x4_c;
 7079|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance16x4 = aom_sub_pixel_avg_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7079:9): [True: 1, False: 0]
  ------------------
 7080|      1|    aom_sub_pixel_avg_variance16x64 = aom_sub_pixel_avg_variance16x64_c;
 7081|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance16x64 = aom_sub_pixel_avg_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7081:9): [True: 1, False: 0]
  ------------------
 7082|      1|    aom_sub_pixel_avg_variance16x8 = aom_sub_pixel_avg_variance16x8_c;
 7083|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance16x8 = aom_sub_pixel_avg_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7083:9): [True: 1, False: 0]
  ------------------
 7084|      1|    aom_sub_pixel_avg_variance32x16 = aom_sub_pixel_avg_variance32x16_c;
 7085|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance32x16 = aom_sub_pixel_avg_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7085:9): [True: 1, False: 0]
  ------------------
 7086|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance32x16 = aom_sub_pixel_avg_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7086:9): [True: 1, False: 0]
  ------------------
 7087|      1|    aom_sub_pixel_avg_variance32x32 = aom_sub_pixel_avg_variance32x32_c;
 7088|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance32x32 = aom_sub_pixel_avg_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7088:9): [True: 1, False: 0]
  ------------------
 7089|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance32x32 = aom_sub_pixel_avg_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7089:9): [True: 1, False: 0]
  ------------------
 7090|      1|    aom_sub_pixel_avg_variance32x64 = aom_sub_pixel_avg_variance32x64_c;
 7091|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance32x64 = aom_sub_pixel_avg_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7091:9): [True: 1, False: 0]
  ------------------
 7092|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance32x64 = aom_sub_pixel_avg_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7092:9): [True: 1, False: 0]
  ------------------
 7093|      1|    aom_sub_pixel_avg_variance32x8 = aom_sub_pixel_avg_variance32x8_c;
 7094|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance32x8 = aom_sub_pixel_avg_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7094:9): [True: 1, False: 0]
  ------------------
 7095|      1|    aom_sub_pixel_avg_variance4x16 = aom_sub_pixel_avg_variance4x16_c;
 7096|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance4x16 = aom_sub_pixel_avg_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7096:9): [True: 1, False: 0]
  ------------------
 7097|      1|    aom_sub_pixel_avg_variance4x4 = aom_sub_pixel_avg_variance4x4_c;
 7098|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance4x4 = aom_sub_pixel_avg_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7098:9): [True: 1, False: 0]
  ------------------
 7099|      1|    aom_sub_pixel_avg_variance4x8 = aom_sub_pixel_avg_variance4x8_c;
 7100|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance4x8 = aom_sub_pixel_avg_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7100:9): [True: 1, False: 0]
  ------------------
 7101|      1|    aom_sub_pixel_avg_variance64x128 = aom_sub_pixel_avg_variance64x128_c;
 7102|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance64x128 = aom_sub_pixel_avg_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7102:9): [True: 1, False: 0]
  ------------------
 7103|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance64x128 = aom_sub_pixel_avg_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7103:9): [True: 1, False: 0]
  ------------------
 7104|      1|    aom_sub_pixel_avg_variance64x16 = aom_sub_pixel_avg_variance64x16_c;
 7105|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance64x16 = aom_sub_pixel_avg_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7105:9): [True: 1, False: 0]
  ------------------
 7106|      1|    aom_sub_pixel_avg_variance64x32 = aom_sub_pixel_avg_variance64x32_c;
 7107|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance64x32 = aom_sub_pixel_avg_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7107:9): [True: 1, False: 0]
  ------------------
 7108|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance64x32 = aom_sub_pixel_avg_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7108:9): [True: 1, False: 0]
  ------------------
 7109|      1|    aom_sub_pixel_avg_variance64x64 = aom_sub_pixel_avg_variance64x64_c;
 7110|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance64x64 = aom_sub_pixel_avg_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7110:9): [True: 1, False: 0]
  ------------------
 7111|      1|    if (flags & HAS_AVX2) aom_sub_pixel_avg_variance64x64 = aom_sub_pixel_avg_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7111:9): [True: 1, False: 0]
  ------------------
 7112|      1|    aom_sub_pixel_avg_variance8x16 = aom_sub_pixel_avg_variance8x16_c;
 7113|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance8x16 = aom_sub_pixel_avg_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7113:9): [True: 1, False: 0]
  ------------------
 7114|      1|    aom_sub_pixel_avg_variance8x32 = aom_sub_pixel_avg_variance8x32_c;
 7115|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance8x32 = aom_sub_pixel_avg_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7115:9): [True: 1, False: 0]
  ------------------
 7116|      1|    aom_sub_pixel_avg_variance8x4 = aom_sub_pixel_avg_variance8x4_c;
 7117|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance8x4 = aom_sub_pixel_avg_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7117:9): [True: 1, False: 0]
  ------------------
 7118|      1|    aom_sub_pixel_avg_variance8x8 = aom_sub_pixel_avg_variance8x8_c;
 7119|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_avg_variance8x8 = aom_sub_pixel_avg_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7119:9): [True: 1, False: 0]
  ------------------
 7120|      1|    aom_sub_pixel_variance128x128 = aom_sub_pixel_variance128x128_c;
 7121|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance128x128 = aom_sub_pixel_variance128x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7121:9): [True: 1, False: 0]
  ------------------
 7122|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance128x128 = aom_sub_pixel_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7122:9): [True: 1, False: 0]
  ------------------
 7123|      1|    aom_sub_pixel_variance128x64 = aom_sub_pixel_variance128x64_c;
 7124|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance128x64 = aom_sub_pixel_variance128x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7124:9): [True: 1, False: 0]
  ------------------
 7125|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance128x64 = aom_sub_pixel_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7125:9): [True: 1, False: 0]
  ------------------
 7126|      1|    aom_sub_pixel_variance16x16 = aom_sub_pixel_variance16x16_c;
 7127|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance16x16 = aom_sub_pixel_variance16x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7127:9): [True: 1, False: 0]
  ------------------
 7128|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance16x16 = aom_sub_pixel_variance16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7128:9): [True: 1, False: 0]
  ------------------
 7129|      1|    aom_sub_pixel_variance16x32 = aom_sub_pixel_variance16x32_c;
 7130|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance16x32 = aom_sub_pixel_variance16x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7130:9): [True: 1, False: 0]
  ------------------
 7131|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance16x32 = aom_sub_pixel_variance16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7131:9): [True: 1, False: 0]
  ------------------
 7132|      1|    aom_sub_pixel_variance16x4 = aom_sub_pixel_variance16x4_c;
 7133|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance16x4 = aom_sub_pixel_variance16x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7133:9): [True: 1, False: 0]
  ------------------
 7134|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance16x4 = aom_sub_pixel_variance16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7134:9): [True: 1, False: 0]
  ------------------
 7135|      1|    aom_sub_pixel_variance16x64 = aom_sub_pixel_variance16x64_c;
 7136|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance16x64 = aom_sub_pixel_variance16x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7136:9): [True: 1, False: 0]
  ------------------
 7137|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance16x64 = aom_sub_pixel_variance16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7137:9): [True: 1, False: 0]
  ------------------
 7138|      1|    aom_sub_pixel_variance16x8 = aom_sub_pixel_variance16x8_c;
 7139|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance16x8 = aom_sub_pixel_variance16x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7139:9): [True: 1, False: 0]
  ------------------
 7140|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance16x8 = aom_sub_pixel_variance16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7140:9): [True: 1, False: 0]
  ------------------
 7141|      1|    aom_sub_pixel_variance32x16 = aom_sub_pixel_variance32x16_c;
 7142|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance32x16 = aom_sub_pixel_variance32x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7142:9): [True: 1, False: 0]
  ------------------
 7143|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance32x16 = aom_sub_pixel_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7143:9): [True: 1, False: 0]
  ------------------
 7144|      1|    aom_sub_pixel_variance32x32 = aom_sub_pixel_variance32x32_c;
 7145|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance32x32 = aom_sub_pixel_variance32x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7145:9): [True: 1, False: 0]
  ------------------
 7146|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance32x32 = aom_sub_pixel_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7146:9): [True: 1, False: 0]
  ------------------
 7147|      1|    aom_sub_pixel_variance32x64 = aom_sub_pixel_variance32x64_c;
 7148|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance32x64 = aom_sub_pixel_variance32x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7148:9): [True: 1, False: 0]
  ------------------
 7149|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance32x64 = aom_sub_pixel_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7149:9): [True: 1, False: 0]
  ------------------
 7150|      1|    aom_sub_pixel_variance32x8 = aom_sub_pixel_variance32x8_c;
 7151|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance32x8 = aom_sub_pixel_variance32x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7151:9): [True: 1, False: 0]
  ------------------
 7152|      1|    aom_sub_pixel_variance4x16 = aom_sub_pixel_variance4x16_c;
 7153|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance4x16 = aom_sub_pixel_variance4x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7153:9): [True: 1, False: 0]
  ------------------
 7154|      1|    aom_sub_pixel_variance4x4 = aom_sub_pixel_variance4x4_c;
 7155|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance4x4 = aom_sub_pixel_variance4x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7155:9): [True: 1, False: 0]
  ------------------
 7156|      1|    aom_sub_pixel_variance4x8 = aom_sub_pixel_variance4x8_c;
 7157|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance4x8 = aom_sub_pixel_variance4x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7157:9): [True: 1, False: 0]
  ------------------
 7158|      1|    aom_sub_pixel_variance64x128 = aom_sub_pixel_variance64x128_c;
 7159|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance64x128 = aom_sub_pixel_variance64x128_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7159:9): [True: 1, False: 0]
  ------------------
 7160|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance64x128 = aom_sub_pixel_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7160:9): [True: 1, False: 0]
  ------------------
 7161|      1|    aom_sub_pixel_variance64x16 = aom_sub_pixel_variance64x16_c;
 7162|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance64x16 = aom_sub_pixel_variance64x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7162:9): [True: 1, False: 0]
  ------------------
 7163|      1|    aom_sub_pixel_variance64x32 = aom_sub_pixel_variance64x32_c;
 7164|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance64x32 = aom_sub_pixel_variance64x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7164:9): [True: 1, False: 0]
  ------------------
 7165|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance64x32 = aom_sub_pixel_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7165:9): [True: 1, False: 0]
  ------------------
 7166|      1|    aom_sub_pixel_variance64x64 = aom_sub_pixel_variance64x64_c;
 7167|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance64x64 = aom_sub_pixel_variance64x64_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7167:9): [True: 1, False: 0]
  ------------------
 7168|      1|    if (flags & HAS_AVX2) aom_sub_pixel_variance64x64 = aom_sub_pixel_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7168:9): [True: 1, False: 0]
  ------------------
 7169|      1|    aom_sub_pixel_variance8x16 = aom_sub_pixel_variance8x16_c;
 7170|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance8x16 = aom_sub_pixel_variance8x16_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7170:9): [True: 1, False: 0]
  ------------------
 7171|      1|    aom_sub_pixel_variance8x32 = aom_sub_pixel_variance8x32_c;
 7172|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance8x32 = aom_sub_pixel_variance8x32_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7172:9): [True: 1, False: 0]
  ------------------
 7173|      1|    aom_sub_pixel_variance8x4 = aom_sub_pixel_variance8x4_c;
 7174|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance8x4 = aom_sub_pixel_variance8x4_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7174:9): [True: 1, False: 0]
  ------------------
 7175|      1|    aom_sub_pixel_variance8x8 = aom_sub_pixel_variance8x8_c;
 7176|      1|    if (flags & HAS_SSSE3) aom_sub_pixel_variance8x8 = aom_sub_pixel_variance8x8_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (7176:9): [True: 1, False: 0]
  ------------------
 7177|      1|    aom_subtract_block = aom_subtract_block_sse2;
 7178|      1|    if (flags & HAS_AVX2) aom_subtract_block = aom_subtract_block_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7178:9): [True: 1, False: 0]
  ------------------
 7179|      1|    aom_sum_squares_2d_i16 = aom_sum_squares_2d_i16_sse2;
 7180|      1|    if (flags & HAS_AVX2) aom_sum_squares_2d_i16 = aom_sum_squares_2d_i16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7180:9): [True: 1, False: 0]
  ------------------
 7181|      1|    aom_sum_sse_2d_i16 = aom_sum_sse_2d_i16_sse2;
 7182|      1|    if (flags & HAS_AVX2) aom_sum_sse_2d_i16 = aom_sum_sse_2d_i16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7182:9): [True: 1, False: 0]
  ------------------
 7183|      1|    aom_v_predictor_32x16 = aom_v_predictor_32x16_sse2;
 7184|      1|    if (flags & HAS_AVX2) aom_v_predictor_32x16 = aom_v_predictor_32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7184:9): [True: 1, False: 0]
  ------------------
 7185|      1|    aom_v_predictor_32x32 = aom_v_predictor_32x32_sse2;
 7186|      1|    if (flags & HAS_AVX2) aom_v_predictor_32x32 = aom_v_predictor_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7186:9): [True: 1, False: 0]
  ------------------
 7187|      1|    aom_v_predictor_32x64 = aom_v_predictor_32x64_sse2;
 7188|      1|    if (flags & HAS_AVX2) aom_v_predictor_32x64 = aom_v_predictor_32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7188:9): [True: 1, False: 0]
  ------------------
 7189|      1|    aom_v_predictor_64x16 = aom_v_predictor_64x16_sse2;
 7190|      1|    if (flags & HAS_AVX2) aom_v_predictor_64x16 = aom_v_predictor_64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7190:9): [True: 1, False: 0]
  ------------------
 7191|      1|    aom_v_predictor_64x32 = aom_v_predictor_64x32_sse2;
 7192|      1|    if (flags & HAS_AVX2) aom_v_predictor_64x32 = aom_v_predictor_64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7192:9): [True: 1, False: 0]
  ------------------
 7193|      1|    aom_v_predictor_64x64 = aom_v_predictor_64x64_sse2;
 7194|      1|    if (flags & HAS_AVX2) aom_v_predictor_64x64 = aom_v_predictor_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7194:9): [True: 1, False: 0]
  ------------------
 7195|      1|    aom_var_2d_u16 = aom_var_2d_u16_sse2;
 7196|      1|    if (flags & HAS_AVX2) aom_var_2d_u16 = aom_var_2d_u16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7196:9): [True: 1, False: 0]
  ------------------
 7197|      1|    aom_var_2d_u8 = aom_var_2d_u8_sse2;
 7198|      1|    if (flags & HAS_AVX2) aom_var_2d_u8 = aom_var_2d_u8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7198:9): [True: 1, False: 0]
  ------------------
 7199|      1|    aom_variance128x128 = aom_variance128x128_sse2;
 7200|      1|    if (flags & HAS_AVX2) aom_variance128x128 = aom_variance128x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7200:9): [True: 1, False: 0]
  ------------------
 7201|      1|    aom_variance128x64 = aom_variance128x64_sse2;
 7202|      1|    if (flags & HAS_AVX2) aom_variance128x64 = aom_variance128x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7202:9): [True: 1, False: 0]
  ------------------
 7203|      1|    aom_variance16x16 = aom_variance16x16_sse2;
 7204|      1|    if (flags & HAS_AVX2) aom_variance16x16 = aom_variance16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7204:9): [True: 1, False: 0]
  ------------------
 7205|      1|    aom_variance16x32 = aom_variance16x32_sse2;
 7206|      1|    if (flags & HAS_AVX2) aom_variance16x32 = aom_variance16x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7206:9): [True: 1, False: 0]
  ------------------
 7207|      1|    aom_variance16x4 = aom_variance16x4_sse2;
 7208|      1|    if (flags & HAS_AVX2) aom_variance16x4 = aom_variance16x4_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7208:9): [True: 1, False: 0]
  ------------------
 7209|      1|    aom_variance16x64 = aom_variance16x64_sse2;
 7210|      1|    if (flags & HAS_AVX2) aom_variance16x64 = aom_variance16x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7210:9): [True: 1, False: 0]
  ------------------
 7211|      1|    aom_variance16x8 = aom_variance16x8_sse2;
 7212|      1|    if (flags & HAS_AVX2) aom_variance16x8 = aom_variance16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7212:9): [True: 1, False: 0]
  ------------------
 7213|      1|    aom_variance32x16 = aom_variance32x16_sse2;
 7214|      1|    if (flags & HAS_AVX2) aom_variance32x16 = aom_variance32x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7214:9): [True: 1, False: 0]
  ------------------
 7215|      1|    aom_variance32x32 = aom_variance32x32_sse2;
 7216|      1|    if (flags & HAS_AVX2) aom_variance32x32 = aom_variance32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7216:9): [True: 1, False: 0]
  ------------------
 7217|      1|    aom_variance32x64 = aom_variance32x64_sse2;
 7218|      1|    if (flags & HAS_AVX2) aom_variance32x64 = aom_variance32x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7218:9): [True: 1, False: 0]
  ------------------
 7219|      1|    aom_variance32x8 = aom_variance32x8_sse2;
 7220|      1|    if (flags & HAS_AVX2) aom_variance32x8 = aom_variance32x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7220:9): [True: 1, False: 0]
  ------------------
 7221|      1|    aom_variance64x128 = aom_variance64x128_sse2;
 7222|      1|    if (flags & HAS_AVX2) aom_variance64x128 = aom_variance64x128_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7222:9): [True: 1, False: 0]
  ------------------
 7223|      1|    aom_variance64x16 = aom_variance64x16_sse2;
 7224|      1|    if (flags & HAS_AVX2) aom_variance64x16 = aom_variance64x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7224:9): [True: 1, False: 0]
  ------------------
 7225|      1|    aom_variance64x32 = aom_variance64x32_sse2;
 7226|      1|    if (flags & HAS_AVX2) aom_variance64x32 = aom_variance64x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7226:9): [True: 1, False: 0]
  ------------------
 7227|      1|    aom_variance64x64 = aom_variance64x64_sse2;
 7228|      1|    if (flags & HAS_AVX2) aom_variance64x64 = aom_variance64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7228:9): [True: 1, False: 0]
  ------------------
 7229|      1|    aom_vector_var = aom_vector_var_c;
 7230|      1|    if (flags & HAS_SSE4_1) aom_vector_var = aom_vector_var_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (7230:9): [True: 1, False: 0]
  ------------------
 7231|      1|    if (flags & HAS_AVX2) aom_vector_var = aom_vector_var_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (7231:9): [True: 1, False: 0]
  ------------------
 7232|      1|}

aom_scale_rtcd.c:setup_rtcd_internal:
   74|      1|{
   75|      1|    int flags = x86_simd_caps();
   76|       |
   77|      1|    (void)flags;
   78|       |
   79|      1|}

av1_rtcd.c:setup_rtcd_internal:
  810|      1|{
  811|      1|    int flags = x86_simd_caps();
  812|       |
  813|      1|    (void)flags;
  814|       |
  815|      1|    av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_c;
  816|      1|    if (flags & HAS_SSE4_1) av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (816:9): [True: 1, False: 0]
  ------------------
  817|      1|    if (flags & HAS_AVX2) av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (817:9): [True: 1, False: 0]
  ------------------
  818|      1|    av1_apply_temporal_filter = av1_apply_temporal_filter_sse2;
  819|      1|    if (flags & HAS_AVX2) av1_apply_temporal_filter = av1_apply_temporal_filter_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (819:9): [True: 1, False: 0]
  ------------------
  820|      1|    av1_block_error = av1_block_error_sse2;
  821|      1|    if (flags & HAS_AVX2) av1_block_error = av1_block_error_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (821:9): [True: 1, False: 0]
  ------------------
  822|      1|    av1_block_error_lp = av1_block_error_lp_sse2;
  823|      1|    if (flags & HAS_AVX2) av1_block_error_lp = av1_block_error_lp_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (823:9): [True: 1, False: 0]
  ------------------
  824|      1|    av1_build_compound_diffwtd_mask = av1_build_compound_diffwtd_mask_c;
  825|      1|    if (flags & HAS_SSE4_1) av1_build_compound_diffwtd_mask = av1_build_compound_diffwtd_mask_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (825:9): [True: 1, False: 0]
  ------------------
  826|      1|    if (flags & HAS_AVX2) av1_build_compound_diffwtd_mask = av1_build_compound_diffwtd_mask_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (826:9): [True: 1, False: 0]
  ------------------
  827|      1|    av1_build_compound_diffwtd_mask_d16 = av1_build_compound_diffwtd_mask_d16_c;
  828|      1|    if (flags & HAS_SSE4_1) av1_build_compound_diffwtd_mask_d16 = av1_build_compound_diffwtd_mask_d16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (828:9): [True: 1, False: 0]
  ------------------
  829|      1|    if (flags & HAS_AVX2) av1_build_compound_diffwtd_mask_d16 = av1_build_compound_diffwtd_mask_d16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (829:9): [True: 1, False: 0]
  ------------------
  830|      1|    av1_build_compound_diffwtd_mask_highbd = av1_build_compound_diffwtd_mask_highbd_c;
  831|      1|    if (flags & HAS_SSSE3) av1_build_compound_diffwtd_mask_highbd = av1_build_compound_diffwtd_mask_highbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (831:9): [True: 1, False: 0]
  ------------------
  832|      1|    if (flags & HAS_AVX2) av1_build_compound_diffwtd_mask_highbd = av1_build_compound_diffwtd_mask_highbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (832:9): [True: 1, False: 0]
  ------------------
  833|      1|    av1_calc_indices_dim1 = av1_calc_indices_dim1_sse2;
  834|      1|    if (flags & HAS_AVX2) av1_calc_indices_dim1 = av1_calc_indices_dim1_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (834:9): [True: 1, False: 0]
  ------------------
  835|      1|    av1_calc_indices_dim2 = av1_calc_indices_dim2_sse2;
  836|      1|    if (flags & HAS_AVX2) av1_calc_indices_dim2 = av1_calc_indices_dim2_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (836:9): [True: 1, False: 0]
  ------------------
  837|      1|    av1_calc_proj_params = av1_calc_proj_params_c;
  838|      1|    if (flags & HAS_SSE4_1) av1_calc_proj_params = av1_calc_proj_params_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (838:9): [True: 1, False: 0]
  ------------------
  839|      1|    if (flags & HAS_AVX2) av1_calc_proj_params = av1_calc_proj_params_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (839:9): [True: 1, False: 0]
  ------------------
  840|      1|    av1_calc_proj_params_high_bd = av1_calc_proj_params_high_bd_c;
  841|      1|    if (flags & HAS_SSE4_1) av1_calc_proj_params_high_bd = av1_calc_proj_params_high_bd_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (841:9): [True: 1, False: 0]
  ------------------
  842|      1|    if (flags & HAS_AVX2) av1_calc_proj_params_high_bd = av1_calc_proj_params_high_bd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (842:9): [True: 1, False: 0]
  ------------------
  843|      1|    av1_cnn_convolve_no_maxpool_padding_valid = av1_cnn_convolve_no_maxpool_padding_valid_c;
  844|      1|    if (flags & HAS_AVX2) av1_cnn_convolve_no_maxpool_padding_valid = av1_cnn_convolve_no_maxpool_padding_valid_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (844:9): [True: 1, False: 0]
  ------------------
  845|      1|    av1_compute_stats = av1_compute_stats_c;
  846|      1|    if (flags & HAS_SSE4_1) av1_compute_stats = av1_compute_stats_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (846:9): [True: 1, False: 0]
  ------------------
  847|      1|    if (flags & HAS_AVX2) av1_compute_stats = av1_compute_stats_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (847:9): [True: 1, False: 0]
  ------------------
  848|      1|    av1_compute_stats_highbd = av1_compute_stats_highbd_c;
  849|      1|    if (flags & HAS_SSE4_1) av1_compute_stats_highbd = av1_compute_stats_highbd_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (849:9): [True: 1, False: 0]
  ------------------
  850|      1|    if (flags & HAS_AVX2) av1_compute_stats_highbd = av1_compute_stats_highbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (850:9): [True: 1, False: 0]
  ------------------
  851|      1|    av1_convolve_2d_scale = av1_convolve_2d_scale_c;
  852|      1|    if (flags & HAS_SSE4_1) av1_convolve_2d_scale = av1_convolve_2d_scale_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (852:9): [True: 1, False: 0]
  ------------------
  853|      1|    av1_convolve_2d_sr = av1_convolve_2d_sr_sse2;
  854|      1|    if (flags & HAS_AVX2) av1_convolve_2d_sr = av1_convolve_2d_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (854:9): [True: 1, False: 0]
  ------------------
  855|      1|    av1_convolve_horiz_rs = av1_convolve_horiz_rs_c;
  856|      1|    if (flags & HAS_SSE4_1) av1_convolve_horiz_rs = av1_convolve_horiz_rs_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (856:9): [True: 1, False: 0]
  ------------------
  857|      1|    av1_convolve_x_sr = av1_convolve_x_sr_sse2;
  858|      1|    if (flags & HAS_AVX2) av1_convolve_x_sr = av1_convolve_x_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (858:9): [True: 1, False: 0]
  ------------------
  859|      1|    av1_convolve_y_sr = av1_convolve_y_sr_sse2;
  860|      1|    if (flags & HAS_AVX2) av1_convolve_y_sr = av1_convolve_y_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (860:9): [True: 1, False: 0]
  ------------------
  861|      1|    av1_dist_wtd_convolve_2d = av1_dist_wtd_convolve_2d_c;
  862|      1|    if (flags & HAS_SSSE3) av1_dist_wtd_convolve_2d = av1_dist_wtd_convolve_2d_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (862:9): [True: 1, False: 0]
  ------------------
  863|      1|    if (flags & HAS_AVX2) av1_dist_wtd_convolve_2d = av1_dist_wtd_convolve_2d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (863:9): [True: 1, False: 0]
  ------------------
  864|      1|    av1_dist_wtd_convolve_2d_copy = av1_dist_wtd_convolve_2d_copy_sse2;
  865|      1|    if (flags & HAS_AVX2) av1_dist_wtd_convolve_2d_copy = av1_dist_wtd_convolve_2d_copy_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (865:9): [True: 1, False: 0]
  ------------------
  866|      1|    av1_dist_wtd_convolve_x = av1_dist_wtd_convolve_x_sse2;
  867|      1|    if (flags & HAS_AVX2) av1_dist_wtd_convolve_x = av1_dist_wtd_convolve_x_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (867:9): [True: 1, False: 0]
  ------------------
  868|      1|    av1_dist_wtd_convolve_y = av1_dist_wtd_convolve_y_sse2;
  869|      1|    if (flags & HAS_AVX2) av1_dist_wtd_convolve_y = av1_dist_wtd_convolve_y_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (869:9): [True: 1, False: 0]
  ------------------
  870|      1|    av1_dr_prediction_z1 = av1_dr_prediction_z1_c;
  871|      1|    if (flags & HAS_SSE4_1) av1_dr_prediction_z1 = av1_dr_prediction_z1_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (871:9): [True: 1, False: 0]
  ------------------
  872|      1|    if (flags & HAS_AVX2) av1_dr_prediction_z1 = av1_dr_prediction_z1_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (872:9): [True: 1, False: 0]
  ------------------
  873|      1|    av1_dr_prediction_z2 = av1_dr_prediction_z2_c;
  874|      1|    if (flags & HAS_SSE4_1) av1_dr_prediction_z2 = av1_dr_prediction_z2_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (874:9): [True: 1, False: 0]
  ------------------
  875|      1|    if (flags & HAS_AVX2) av1_dr_prediction_z2 = av1_dr_prediction_z2_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (875:9): [True: 1, False: 0]
  ------------------
  876|      1|    av1_dr_prediction_z3 = av1_dr_prediction_z3_c;
  877|      1|    if (flags & HAS_SSE4_1) av1_dr_prediction_z3 = av1_dr_prediction_z3_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (877:9): [True: 1, False: 0]
  ------------------
  878|      1|    if (flags & HAS_AVX2) av1_dr_prediction_z3 = av1_dr_prediction_z3_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (878:9): [True: 1, False: 0]
  ------------------
  879|      1|    av1_estimate_noise_from_single_plane = av1_estimate_noise_from_single_plane_c;
  880|      1|    if (flags & HAS_AVX2) av1_estimate_noise_from_single_plane = av1_estimate_noise_from_single_plane_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (880:9): [True: 1, False: 0]
  ------------------
  881|      1|    av1_filter_intra_edge = av1_filter_intra_edge_c;
  882|      1|    if (flags & HAS_SSE4_1) av1_filter_intra_edge = av1_filter_intra_edge_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (882:9): [True: 1, False: 0]
  ------------------
  883|      1|    av1_filter_intra_predictor = av1_filter_intra_predictor_c;
  884|      1|    if (flags & HAS_SSE4_1) av1_filter_intra_predictor = av1_filter_intra_predictor_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (884:9): [True: 1, False: 0]
  ------------------
  885|      1|    av1_fwd_txfm2d_16x16 = av1_fwd_txfm2d_16x16_c;
  886|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_16x16 = av1_fwd_txfm2d_16x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (886:9): [True: 1, False: 0]
  ------------------
  887|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_16x16 = av1_fwd_txfm2d_16x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (887:9): [True: 1, False: 0]
  ------------------
  888|      1|    av1_fwd_txfm2d_16x32 = av1_fwd_txfm2d_16x32_c;
  889|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_16x32 = av1_fwd_txfm2d_16x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (889:9): [True: 1, False: 0]
  ------------------
  890|      1|    av1_fwd_txfm2d_16x4 = av1_fwd_txfm2d_16x4_c;
  891|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_16x4 = av1_fwd_txfm2d_16x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (891:9): [True: 1, False: 0]
  ------------------
  892|      1|    av1_fwd_txfm2d_16x64 = av1_fwd_txfm2d_16x64_c;
  893|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_16x64 = av1_fwd_txfm2d_16x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (893:9): [True: 1, False: 0]
  ------------------
  894|      1|    av1_fwd_txfm2d_16x8 = av1_fwd_txfm2d_16x8_c;
  895|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_16x8 = av1_fwd_txfm2d_16x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (895:9): [True: 1, False: 0]
  ------------------
  896|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_16x8 = av1_fwd_txfm2d_16x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (896:9): [True: 1, False: 0]
  ------------------
  897|      1|    av1_fwd_txfm2d_32x16 = av1_fwd_txfm2d_32x16_c;
  898|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_32x16 = av1_fwd_txfm2d_32x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (898:9): [True: 1, False: 0]
  ------------------
  899|      1|    av1_fwd_txfm2d_32x32 = av1_fwd_txfm2d_32x32_c;
  900|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_32x32 = av1_fwd_txfm2d_32x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (900:9): [True: 1, False: 0]
  ------------------
  901|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_32x32 = av1_fwd_txfm2d_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (901:9): [True: 1, False: 0]
  ------------------
  902|      1|    av1_fwd_txfm2d_32x64 = av1_fwd_txfm2d_32x64_c;
  903|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_32x64 = av1_fwd_txfm2d_32x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (903:9): [True: 1, False: 0]
  ------------------
  904|      1|    av1_fwd_txfm2d_32x8 = av1_fwd_txfm2d_32x8_c;
  905|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_32x8 = av1_fwd_txfm2d_32x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (905:9): [True: 1, False: 0]
  ------------------
  906|      1|    av1_fwd_txfm2d_4x16 = av1_fwd_txfm2d_4x16_c;
  907|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_4x16 = av1_fwd_txfm2d_4x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (907:9): [True: 1, False: 0]
  ------------------
  908|      1|    av1_fwd_txfm2d_4x4 = av1_fwd_txfm2d_4x4_c;
  909|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_4x4 = av1_fwd_txfm2d_4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (909:9): [True: 1, False: 0]
  ------------------
  910|      1|    av1_fwd_txfm2d_4x8 = av1_fwd_txfm2d_4x8_c;
  911|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_4x8 = av1_fwd_txfm2d_4x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (911:9): [True: 1, False: 0]
  ------------------
  912|      1|    av1_fwd_txfm2d_64x16 = av1_fwd_txfm2d_64x16_c;
  913|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_64x16 = av1_fwd_txfm2d_64x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (913:9): [True: 1, False: 0]
  ------------------
  914|      1|    av1_fwd_txfm2d_64x32 = av1_fwd_txfm2d_64x32_c;
  915|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_64x32 = av1_fwd_txfm2d_64x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (915:9): [True: 1, False: 0]
  ------------------
  916|      1|    av1_fwd_txfm2d_64x64 = av1_fwd_txfm2d_64x64_c;
  917|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_64x64 = av1_fwd_txfm2d_64x64_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (917:9): [True: 1, False: 0]
  ------------------
  918|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_64x64 = av1_fwd_txfm2d_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (918:9): [True: 1, False: 0]
  ------------------
  919|      1|    av1_fwd_txfm2d_8x16 = av1_fwd_txfm2d_8x16_c;
  920|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_8x16 = av1_fwd_txfm2d_8x16_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (920:9): [True: 1, False: 0]
  ------------------
  921|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_8x16 = av1_fwd_txfm2d_8x16_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (921:9): [True: 1, False: 0]
  ------------------
  922|      1|    av1_fwd_txfm2d_8x32 = av1_fwd_txfm2d_8x32_c;
  923|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_8x32 = av1_fwd_txfm2d_8x32_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (923:9): [True: 1, False: 0]
  ------------------
  924|      1|    av1_fwd_txfm2d_8x4 = av1_fwd_txfm2d_8x4_c;
  925|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_8x4 = av1_fwd_txfm2d_8x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (925:9): [True: 1, False: 0]
  ------------------
  926|      1|    av1_fwd_txfm2d_8x8 = av1_fwd_txfm2d_8x8_c;
  927|      1|    if (flags & HAS_SSE4_1) av1_fwd_txfm2d_8x8 = av1_fwd_txfm2d_8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (927:9): [True: 1, False: 0]
  ------------------
  928|      1|    if (flags & HAS_AVX2) av1_fwd_txfm2d_8x8 = av1_fwd_txfm2d_8x8_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (928:9): [True: 1, False: 0]
  ------------------
  929|      1|    av1_fwht4x4 = av1_fwht4x4_c;
  930|      1|    if (flags & HAS_SSE4_1) av1_fwht4x4 = av1_fwht4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (930:9): [True: 1, False: 0]
  ------------------
  931|      1|    av1_get_crc32c_value = av1_get_crc32c_value_c;
  932|      1|    if (flags & HAS_SSE4_2) av1_get_crc32c_value = av1_get_crc32c_value_sse4_2;
  ------------------
  |  |  169|      1|#define HAS_SSE4_2 0x100
  ------------------
  |  Branch (932:9): [True: 1, False: 0]
  ------------------
  933|      1|    av1_get_horver_correlation_full = av1_get_horver_correlation_full_c;
  934|      1|    if (flags & HAS_SSE4_1) av1_get_horver_correlation_full = av1_get_horver_correlation_full_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (934:9): [True: 1, False: 0]
  ------------------
  935|      1|    if (flags & HAS_AVX2) av1_get_horver_correlation_full = av1_get_horver_correlation_full_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (935:9): [True: 1, False: 0]
  ------------------
  936|      1|    av1_highbd_apply_temporal_filter = av1_highbd_apply_temporal_filter_sse2;
  937|      1|    if (flags & HAS_AVX2) av1_highbd_apply_temporal_filter = av1_highbd_apply_temporal_filter_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (937:9): [True: 1, False: 0]
  ------------------
  938|      1|    av1_highbd_block_error = av1_highbd_block_error_sse2;
  939|      1|    if (flags & HAS_AVX2) av1_highbd_block_error = av1_highbd_block_error_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (939:9): [True: 1, False: 0]
  ------------------
  940|      1|    av1_highbd_convolve_2d_scale = av1_highbd_convolve_2d_scale_c;
  941|      1|    if (flags & HAS_SSE4_1) av1_highbd_convolve_2d_scale = av1_highbd_convolve_2d_scale_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (941:9): [True: 1, False: 0]
  ------------------
  942|      1|    av1_highbd_convolve_2d_sr = av1_highbd_convolve_2d_sr_c;
  943|      1|    if (flags & HAS_SSSE3) av1_highbd_convolve_2d_sr = av1_highbd_convolve_2d_sr_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (943:9): [True: 1, False: 0]
  ------------------
  944|      1|    if (flags & HAS_AVX2) av1_highbd_convolve_2d_sr = av1_highbd_convolve_2d_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (944:9): [True: 1, False: 0]
  ------------------
  945|      1|    av1_highbd_convolve_horiz_rs = av1_highbd_convolve_horiz_rs_c;
  946|      1|    if (flags & HAS_SSE4_1) av1_highbd_convolve_horiz_rs = av1_highbd_convolve_horiz_rs_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (946:9): [True: 1, False: 0]
  ------------------
  947|      1|    av1_highbd_convolve_x_sr = av1_highbd_convolve_x_sr_c;
  948|      1|    if (flags & HAS_SSSE3) av1_highbd_convolve_x_sr = av1_highbd_convolve_x_sr_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (948:9): [True: 1, False: 0]
  ------------------
  949|      1|    if (flags & HAS_AVX2) av1_highbd_convolve_x_sr = av1_highbd_convolve_x_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (949:9): [True: 1, False: 0]
  ------------------
  950|      1|    av1_highbd_convolve_y_sr = av1_highbd_convolve_y_sr_c;
  951|      1|    if (flags & HAS_SSSE3) av1_highbd_convolve_y_sr = av1_highbd_convolve_y_sr_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (951:9): [True: 1, False: 0]
  ------------------
  952|      1|    if (flags & HAS_AVX2) av1_highbd_convolve_y_sr = av1_highbd_convolve_y_sr_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (952:9): [True: 1, False: 0]
  ------------------
  953|      1|    av1_highbd_dist_wtd_convolve_2d = av1_highbd_dist_wtd_convolve_2d_c;
  954|      1|    if (flags & HAS_SSE4_1) av1_highbd_dist_wtd_convolve_2d = av1_highbd_dist_wtd_convolve_2d_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (954:9): [True: 1, False: 0]
  ------------------
  955|      1|    if (flags & HAS_AVX2) av1_highbd_dist_wtd_convolve_2d = av1_highbd_dist_wtd_convolve_2d_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (955:9): [True: 1, False: 0]
  ------------------
  956|      1|    av1_highbd_dist_wtd_convolve_2d_copy = av1_highbd_dist_wtd_convolve_2d_copy_c;
  957|      1|    if (flags & HAS_SSE4_1) av1_highbd_dist_wtd_convolve_2d_copy = av1_highbd_dist_wtd_convolve_2d_copy_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (957:9): [True: 1, False: 0]
  ------------------
  958|      1|    if (flags & HAS_AVX2) av1_highbd_dist_wtd_convolve_2d_copy = av1_highbd_dist_wtd_convolve_2d_copy_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (958:9): [True: 1, False: 0]
  ------------------
  959|      1|    av1_highbd_dist_wtd_convolve_x = av1_highbd_dist_wtd_convolve_x_c;
  960|      1|    if (flags & HAS_SSE4_1) av1_highbd_dist_wtd_convolve_x = av1_highbd_dist_wtd_convolve_x_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (960:9): [True: 1, False: 0]
  ------------------
  961|      1|    if (flags & HAS_AVX2) av1_highbd_dist_wtd_convolve_x = av1_highbd_dist_wtd_convolve_x_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (961:9): [True: 1, False: 0]
  ------------------
  962|      1|    av1_highbd_dist_wtd_convolve_y = av1_highbd_dist_wtd_convolve_y_c;
  963|      1|    if (flags & HAS_SSE4_1) av1_highbd_dist_wtd_convolve_y = av1_highbd_dist_wtd_convolve_y_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (963:9): [True: 1, False: 0]
  ------------------
  964|      1|    if (flags & HAS_AVX2) av1_highbd_dist_wtd_convolve_y = av1_highbd_dist_wtd_convolve_y_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (964:9): [True: 1, False: 0]
  ------------------
  965|      1|    av1_highbd_dr_prediction_z1 = av1_highbd_dr_prediction_z1_c;
  966|      1|    if (flags & HAS_AVX2) av1_highbd_dr_prediction_z1 = av1_highbd_dr_prediction_z1_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (966:9): [True: 1, False: 0]
  ------------------
  967|      1|    av1_highbd_dr_prediction_z2 = av1_highbd_dr_prediction_z2_c;
  968|      1|    if (flags & HAS_AVX2) av1_highbd_dr_prediction_z2 = av1_highbd_dr_prediction_z2_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (968:9): [True: 1, False: 0]
  ------------------
  969|      1|    av1_highbd_dr_prediction_z3 = av1_highbd_dr_prediction_z3_c;
  970|      1|    if (flags & HAS_AVX2) av1_highbd_dr_prediction_z3 = av1_highbd_dr_prediction_z3_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (970:9): [True: 1, False: 0]
  ------------------
  971|      1|    av1_highbd_filter_intra_edge = av1_highbd_filter_intra_edge_c;
  972|      1|    if (flags & HAS_SSE4_1) av1_highbd_filter_intra_edge = av1_highbd_filter_intra_edge_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (972:9): [True: 1, False: 0]
  ------------------
  973|      1|    av1_highbd_inv_txfm_add = av1_highbd_inv_txfm_add_c;
  974|      1|    if (flags & HAS_SSE4_1) av1_highbd_inv_txfm_add = av1_highbd_inv_txfm_add_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (974:9): [True: 1, False: 0]
  ------------------
  975|      1|    if (flags & HAS_AVX2) av1_highbd_inv_txfm_add = av1_highbd_inv_txfm_add_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (975:9): [True: 1, False: 0]
  ------------------
  976|      1|    av1_highbd_iwht4x4_16_add = av1_highbd_iwht4x4_16_add_c;
  977|      1|    if (flags & HAS_SSE4_1) av1_highbd_iwht4x4_16_add = av1_highbd_iwht4x4_16_add_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (977:9): [True: 1, False: 0]
  ------------------
  978|      1|    av1_highbd_pixel_proj_error = av1_highbd_pixel_proj_error_c;
  979|      1|    if (flags & HAS_SSE4_1) av1_highbd_pixel_proj_error = av1_highbd_pixel_proj_error_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (979:9): [True: 1, False: 0]
  ------------------
  980|      1|    if (flags & HAS_AVX2) av1_highbd_pixel_proj_error = av1_highbd_pixel_proj_error_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (980:9): [True: 1, False: 0]
  ------------------
  981|      1|    av1_highbd_quantize_fp = av1_highbd_quantize_fp_c;
  982|      1|    if (flags & HAS_SSE4_1) av1_highbd_quantize_fp = av1_highbd_quantize_fp_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (982:9): [True: 1, False: 0]
  ------------------
  983|      1|    if (flags & HAS_AVX2) av1_highbd_quantize_fp = av1_highbd_quantize_fp_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (983:9): [True: 1, False: 0]
  ------------------
  984|      1|    av1_highbd_upsample_intra_edge = av1_highbd_upsample_intra_edge_c;
  985|      1|    if (flags & HAS_SSE4_1) av1_highbd_upsample_intra_edge = av1_highbd_upsample_intra_edge_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (985:9): [True: 1, False: 0]
  ------------------
  986|      1|    av1_highbd_warp_affine = av1_highbd_warp_affine_c;
  987|      1|    if (flags & HAS_SSE4_1) av1_highbd_warp_affine = av1_highbd_warp_affine_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (987:9): [True: 1, False: 0]
  ------------------
  988|      1|    if (flags & HAS_AVX2) av1_highbd_warp_affine = av1_highbd_warp_affine_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (988:9): [True: 1, False: 0]
  ------------------
  989|      1|    av1_highbd_wiener_convolve_add_src = av1_highbd_wiener_convolve_add_src_c;
  990|      1|    if (flags & HAS_SSSE3) av1_highbd_wiener_convolve_add_src = av1_highbd_wiener_convolve_add_src_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (990:9): [True: 1, False: 0]
  ------------------
  991|      1|    if (flags & HAS_AVX2) av1_highbd_wiener_convolve_add_src = av1_highbd_wiener_convolve_add_src_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (991:9): [True: 1, False: 0]
  ------------------
  992|      1|    av1_inv_txfm2d_add_4x4 = av1_inv_txfm2d_add_4x4_c;
  993|      1|    if (flags & HAS_SSE4_1) av1_inv_txfm2d_add_4x4 = av1_inv_txfm2d_add_4x4_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (993:9): [True: 1, False: 0]
  ------------------
  994|      1|    av1_inv_txfm2d_add_8x8 = av1_inv_txfm2d_add_8x8_c;
  995|      1|    if (flags & HAS_SSE4_1) av1_inv_txfm2d_add_8x8 = av1_inv_txfm2d_add_8x8_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (995:9): [True: 1, False: 0]
  ------------------
  996|      1|    av1_inv_txfm_add = av1_inv_txfm_add_c;
  997|      1|    if (flags & HAS_SSSE3) av1_inv_txfm_add = av1_inv_txfm_add_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (997:9): [True: 1, False: 0]
  ------------------
  998|      1|    if (flags & HAS_AVX2) av1_inv_txfm_add = av1_inv_txfm_add_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (998:9): [True: 1, False: 0]
  ------------------
  999|      1|    av1_lowbd_fwd_txfm = av1_lowbd_fwd_txfm_c;
 1000|      1|    if (flags & HAS_SSE4_1) av1_lowbd_fwd_txfm = av1_lowbd_fwd_txfm_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1000:9): [True: 1, False: 0]
  ------------------
 1001|      1|    if (flags & HAS_AVX2) av1_lowbd_fwd_txfm = av1_lowbd_fwd_txfm_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1001:9): [True: 1, False: 0]
  ------------------
 1002|      1|    av1_lowbd_pixel_proj_error = av1_lowbd_pixel_proj_error_c;
 1003|      1|    if (flags & HAS_SSE4_1) av1_lowbd_pixel_proj_error = av1_lowbd_pixel_proj_error_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1003:9): [True: 1, False: 0]
  ------------------
 1004|      1|    if (flags & HAS_AVX2) av1_lowbd_pixel_proj_error = av1_lowbd_pixel_proj_error_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1004:9): [True: 1, False: 0]
  ------------------
 1005|      1|    av1_nn_fast_softmax_16 = av1_nn_fast_softmax_16_c;
 1006|      1|    if (flags & HAS_SSE3) av1_nn_fast_softmax_16 = av1_nn_fast_softmax_16_sse3;
  ------------------
  |  |  164|      1|#define HAS_SSE3 0x08
  ------------------
  |  Branch (1006:9): [True: 1, False: 0]
  ------------------
 1007|      1|    av1_nn_predict = av1_nn_predict_c;
 1008|      1|    if (flags & HAS_SSE3) av1_nn_predict = av1_nn_predict_sse3;
  ------------------
  |  |  164|      1|#define HAS_SSE3 0x08
  ------------------
  |  Branch (1008:9): [True: 1, False: 0]
  ------------------
 1009|      1|    if (flags & HAS_AVX2) av1_nn_predict = av1_nn_predict_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1009:9): [True: 1, False: 0]
  ------------------
 1010|      1|    av1_quantize_fp = av1_quantize_fp_sse2;
 1011|      1|    if (flags & HAS_AVX2) av1_quantize_fp = av1_quantize_fp_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1011:9): [True: 1, False: 0]
  ------------------
 1012|      1|    av1_quantize_fp_32x32 = av1_quantize_fp_32x32_c;
 1013|      1|    if (flags & HAS_AVX2) av1_quantize_fp_32x32 = av1_quantize_fp_32x32_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1013:9): [True: 1, False: 0]
  ------------------
 1014|      1|    av1_quantize_fp_64x64 = av1_quantize_fp_64x64_c;
 1015|      1|    if (flags & HAS_AVX2) av1_quantize_fp_64x64 = av1_quantize_fp_64x64_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1015:9): [True: 1, False: 0]
  ------------------
 1016|      1|    av1_quantize_lp = av1_quantize_lp_sse2;
 1017|      1|    if (flags & HAS_AVX2) av1_quantize_lp = av1_quantize_lp_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1017:9): [True: 1, False: 0]
  ------------------
 1018|      1|    av1_resize_and_extend_frame = av1_resize_and_extend_frame_c;
 1019|      1|    if (flags & HAS_SSSE3) av1_resize_and_extend_frame = av1_resize_and_extend_frame_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1019:9): [True: 1, False: 0]
  ------------------
 1020|      1|    av1_resize_horz_dir = av1_resize_horz_dir_sse2;
 1021|      1|    if (flags & HAS_AVX2) av1_resize_horz_dir = av1_resize_horz_dir_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1021:9): [True: 1, False: 0]
  ------------------
 1022|      1|    av1_resize_vert_dir = av1_resize_vert_dir_sse2;
 1023|      1|    if (flags & HAS_AVX2) av1_resize_vert_dir = av1_resize_vert_dir_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1023:9): [True: 1, False: 0]
  ------------------
 1024|      1|    av1_round_shift_array = av1_round_shift_array_c;
 1025|      1|    if (flags & HAS_SSE4_1) av1_round_shift_array = av1_round_shift_array_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1025:9): [True: 1, False: 0]
  ------------------
 1026|      1|    av1_selfguided_restoration = av1_selfguided_restoration_c;
 1027|      1|    if (flags & HAS_SSE4_1) av1_selfguided_restoration = av1_selfguided_restoration_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1027:9): [True: 1, False: 0]
  ------------------
 1028|      1|    if (flags & HAS_AVX2) av1_selfguided_restoration = av1_selfguided_restoration_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1028:9): [True: 1, False: 0]
  ------------------
 1029|      1|    av1_txb_init_levels = av1_txb_init_levels_c;
 1030|      1|    if (flags & HAS_SSE4_1) av1_txb_init_levels = av1_txb_init_levels_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1030:9): [True: 1, False: 0]
  ------------------
 1031|      1|    if (flags & HAS_AVX2) av1_txb_init_levels = av1_txb_init_levels_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1031:9): [True: 1, False: 0]
  ------------------
 1032|      1|    av1_upsample_intra_edge = av1_upsample_intra_edge_c;
 1033|      1|    if (flags & HAS_SSE4_1) av1_upsample_intra_edge = av1_upsample_intra_edge_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1033:9): [True: 1, False: 0]
  ------------------
 1034|      1|    av1_warp_affine = av1_warp_affine_c;
 1035|      1|    if (flags & HAS_SSE4_1) av1_warp_affine = av1_warp_affine_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1035:9): [True: 1, False: 0]
  ------------------
 1036|      1|    if (flags & HAS_AVX2) av1_warp_affine = av1_warp_affine_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1036:9): [True: 1, False: 0]
  ------------------
 1037|      1|    av1_wedge_compute_delta_squares = av1_wedge_compute_delta_squares_sse2;
 1038|      1|    if (flags & HAS_AVX2) av1_wedge_compute_delta_squares = av1_wedge_compute_delta_squares_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1038:9): [True: 1, False: 0]
  ------------------
 1039|      1|    av1_wedge_sign_from_residuals = av1_wedge_sign_from_residuals_sse2;
 1040|      1|    if (flags & HAS_AVX2) av1_wedge_sign_from_residuals = av1_wedge_sign_from_residuals_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1040:9): [True: 1, False: 0]
  ------------------
 1041|      1|    av1_wedge_sse_from_residuals = av1_wedge_sse_from_residuals_sse2;
 1042|      1|    if (flags & HAS_AVX2) av1_wedge_sse_from_residuals = av1_wedge_sse_from_residuals_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1042:9): [True: 1, False: 0]
  ------------------
 1043|      1|    av1_wiener_convolve_add_src = av1_wiener_convolve_add_src_sse2;
 1044|      1|    if (flags & HAS_AVX2) av1_wiener_convolve_add_src = av1_wiener_convolve_add_src_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1044:9): [True: 1, False: 0]
  ------------------
 1045|      1|    cdef_copy_rect8_16bit_to_16bit = cdef_copy_rect8_16bit_to_16bit_c;
 1046|      1|    if (flags & HAS_SSE4_1) cdef_copy_rect8_16bit_to_16bit = cdef_copy_rect8_16bit_to_16bit_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1046:9): [True: 1, False: 0]
  ------------------
 1047|      1|    if (flags & HAS_AVX2) cdef_copy_rect8_16bit_to_16bit = cdef_copy_rect8_16bit_to_16bit_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1047:9): [True: 1, False: 0]
  ------------------
 1048|      1|    cdef_copy_rect8_8bit_to_16bit = cdef_copy_rect8_8bit_to_16bit_c;
 1049|      1|    if (flags & HAS_SSE4_1) cdef_copy_rect8_8bit_to_16bit = cdef_copy_rect8_8bit_to_16bit_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1049:9): [True: 1, False: 0]
  ------------------
 1050|      1|    if (flags & HAS_AVX2) cdef_copy_rect8_8bit_to_16bit = cdef_copy_rect8_8bit_to_16bit_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1050:9): [True: 1, False: 0]
  ------------------
 1051|      1|    cdef_filter_16_0 = cdef_filter_16_0_c;
 1052|      1|    if (flags & HAS_SSE4_1) cdef_filter_16_0 = cdef_filter_16_0_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1052:9): [True: 1, False: 0]
  ------------------
 1053|      1|    if (flags & HAS_AVX2) cdef_filter_16_0 = cdef_filter_16_0_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1053:9): [True: 1, False: 0]
  ------------------
 1054|      1|    cdef_filter_16_1 = cdef_filter_16_1_c;
 1055|      1|    if (flags & HAS_SSE4_1) cdef_filter_16_1 = cdef_filter_16_1_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1055:9): [True: 1, False: 0]
  ------------------
 1056|      1|    if (flags & HAS_AVX2) cdef_filter_16_1 = cdef_filter_16_1_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1056:9): [True: 1, False: 0]
  ------------------
 1057|      1|    cdef_filter_16_2 = cdef_filter_16_2_c;
 1058|      1|    if (flags & HAS_SSE4_1) cdef_filter_16_2 = cdef_filter_16_2_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1058:9): [True: 1, False: 0]
  ------------------
 1059|      1|    if (flags & HAS_AVX2) cdef_filter_16_2 = cdef_filter_16_2_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1059:9): [True: 1, False: 0]
  ------------------
 1060|      1|    cdef_filter_16_3 = cdef_filter_16_3_c;
 1061|      1|    if (flags & HAS_SSE4_1) cdef_filter_16_3 = cdef_filter_16_3_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1061:9): [True: 1, False: 0]
  ------------------
 1062|      1|    if (flags & HAS_AVX2) cdef_filter_16_3 = cdef_filter_16_3_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1062:9): [True: 1, False: 0]
  ------------------
 1063|      1|    cdef_filter_8_0 = cdef_filter_8_0_c;
 1064|      1|    if (flags & HAS_SSE4_1) cdef_filter_8_0 = cdef_filter_8_0_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1064:9): [True: 1, False: 0]
  ------------------
 1065|      1|    if (flags & HAS_AVX2) cdef_filter_8_0 = cdef_filter_8_0_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1065:9): [True: 1, False: 0]
  ------------------
 1066|      1|    cdef_filter_8_1 = cdef_filter_8_1_c;
 1067|      1|    if (flags & HAS_SSE4_1) cdef_filter_8_1 = cdef_filter_8_1_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1067:9): [True: 1, False: 0]
  ------------------
 1068|      1|    if (flags & HAS_AVX2) cdef_filter_8_1 = cdef_filter_8_1_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1068:9): [True: 1, False: 0]
  ------------------
 1069|      1|    cdef_filter_8_2 = cdef_filter_8_2_c;
 1070|      1|    if (flags & HAS_SSE4_1) cdef_filter_8_2 = cdef_filter_8_2_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1070:9): [True: 1, False: 0]
  ------------------
 1071|      1|    if (flags & HAS_AVX2) cdef_filter_8_2 = cdef_filter_8_2_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1071:9): [True: 1, False: 0]
  ------------------
 1072|      1|    cdef_filter_8_3 = cdef_filter_8_3_c;
 1073|      1|    if (flags & HAS_SSE4_1) cdef_filter_8_3 = cdef_filter_8_3_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1073:9): [True: 1, False: 0]
  ------------------
 1074|      1|    if (flags & HAS_AVX2) cdef_filter_8_3 = cdef_filter_8_3_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1074:9): [True: 1, False: 0]
  ------------------
 1075|      1|    cdef_find_dir = cdef_find_dir_c;
 1076|      1|    if (flags & HAS_SSE4_1) cdef_find_dir = cdef_find_dir_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1076:9): [True: 1, False: 0]
  ------------------
 1077|      1|    if (flags & HAS_AVX2) cdef_find_dir = cdef_find_dir_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1077:9): [True: 1, False: 0]
  ------------------
 1078|      1|    cdef_find_dir_dual = cdef_find_dir_dual_c;
 1079|      1|    if (flags & HAS_SSE4_1) cdef_find_dir_dual = cdef_find_dir_dual_sse4_1;
  ------------------
  |  |  166|      1|#define HAS_SSE4_1 0x20
  ------------------
  |  Branch (1079:9): [True: 1, False: 0]
  ------------------
 1080|      1|    if (flags & HAS_AVX2) cdef_find_dir_dual = cdef_find_dir_dual_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1080:9): [True: 1, False: 0]
  ------------------
 1081|      1|    cfl_get_luma_subsampling_420_hbd = cfl_get_luma_subsampling_420_hbd_c;
 1082|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_420_hbd = cfl_get_luma_subsampling_420_hbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1082:9): [True: 1, False: 0]
  ------------------
 1083|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_420_hbd = cfl_get_luma_subsampling_420_hbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1083:9): [True: 1, False: 0]
  ------------------
 1084|      1|    cfl_get_luma_subsampling_420_lbd = cfl_get_luma_subsampling_420_lbd_c;
 1085|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_420_lbd = cfl_get_luma_subsampling_420_lbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1085:9): [True: 1, False: 0]
  ------------------
 1086|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_420_lbd = cfl_get_luma_subsampling_420_lbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1086:9): [True: 1, False: 0]
  ------------------
 1087|      1|    cfl_get_luma_subsampling_422_hbd = cfl_get_luma_subsampling_422_hbd_c;
 1088|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_422_hbd = cfl_get_luma_subsampling_422_hbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1088:9): [True: 1, False: 0]
  ------------------
 1089|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_422_hbd = cfl_get_luma_subsampling_422_hbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1089:9): [True: 1, False: 0]
  ------------------
 1090|      1|    cfl_get_luma_subsampling_422_lbd = cfl_get_luma_subsampling_422_lbd_c;
 1091|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_422_lbd = cfl_get_luma_subsampling_422_lbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1091:9): [True: 1, False: 0]
  ------------------
 1092|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_422_lbd = cfl_get_luma_subsampling_422_lbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1092:9): [True: 1, False: 0]
  ------------------
 1093|      1|    cfl_get_luma_subsampling_444_hbd = cfl_get_luma_subsampling_444_hbd_c;
 1094|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_444_hbd = cfl_get_luma_subsampling_444_hbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1094:9): [True: 1, False: 0]
  ------------------
 1095|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_444_hbd = cfl_get_luma_subsampling_444_hbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1095:9): [True: 1, False: 0]
  ------------------
 1096|      1|    cfl_get_luma_subsampling_444_lbd = cfl_get_luma_subsampling_444_lbd_c;
 1097|      1|    if (flags & HAS_SSSE3) cfl_get_luma_subsampling_444_lbd = cfl_get_luma_subsampling_444_lbd_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1097:9): [True: 1, False: 0]
  ------------------
 1098|      1|    if (flags & HAS_AVX2) cfl_get_luma_subsampling_444_lbd = cfl_get_luma_subsampling_444_lbd_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1098:9): [True: 1, False: 0]
  ------------------
 1099|      1|    cfl_get_predict_hbd_fn = cfl_get_predict_hbd_fn_c;
 1100|      1|    if (flags & HAS_SSSE3) cfl_get_predict_hbd_fn = cfl_get_predict_hbd_fn_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1100:9): [True: 1, False: 0]
  ------------------
 1101|      1|    if (flags & HAS_AVX2) cfl_get_predict_hbd_fn = cfl_get_predict_hbd_fn_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1101:9): [True: 1, False: 0]
  ------------------
 1102|      1|    cfl_get_predict_lbd_fn = cfl_get_predict_lbd_fn_c;
 1103|      1|    if (flags & HAS_SSSE3) cfl_get_predict_lbd_fn = cfl_get_predict_lbd_fn_ssse3;
  ------------------
  |  |  165|      1|#define HAS_SSSE3 0x10
  ------------------
  |  Branch (1103:9): [True: 1, False: 0]
  ------------------
 1104|      1|    if (flags & HAS_AVX2) cfl_get_predict_lbd_fn = cfl_get_predict_lbd_fn_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1104:9): [True: 1, False: 0]
  ------------------
 1105|      1|    cfl_get_subtract_average_fn = cfl_get_subtract_average_fn_sse2;
 1106|      1|    if (flags & HAS_AVX2) cfl_get_subtract_average_fn = cfl_get_subtract_average_fn_avx2;
  ------------------
  |  |  168|      1|#define HAS_AVX2 0x80
  ------------------
  |  Branch (1106:9): [True: 1, False: 0]
  ------------------
 1107|      1|}

aom_fast9_detect_nonmax:
   38|  3.70k|{
   39|  3.70k|  xy* corners;
   40|  3.70k|  int num_corners;
   41|  3.70k|  int* scores;
   42|  3.70k|  xy* nonmax;
   43|       |
   44|  3.70k|  corners = aom_fast9_detect(im, xsize, ysize, stride, b, &num_corners);
   45|  3.70k|  if(!corners)
  ------------------
  |  Branch (45:6): [True: 0, False: 3.70k]
  ------------------
   46|      0|  {
   47|       |    // Memory allocation failure
   48|      0|    *ret_num_corners = -1;
   49|      0|    return NULL;
   50|      0|  }
   51|       |  // num_corners may be zero.
   52|  3.70k|  scores = aom_fast9_score(im, stride, corners, num_corners, b);
   53|  3.70k|  if(!scores && num_corners > 0)
  ------------------
  |  Branch (53:6): [True: 0, False: 3.70k]
  |  Branch (53:17): [True: 0, False: 0]
  ------------------
   54|      0|  {
   55|       |    // Memory allocation failure
   56|      0|    free(corners);
   57|      0|    *ret_num_corners = -1;
   58|      0|    return NULL;
   59|      0|  }
   60|  3.70k|  nonmax = aom_nonmax_suppression(corners, scores, num_corners, ret_scores, ret_num_corners);
   61|       |
   62|  3.70k|  free(corners);
   63|  3.70k|  free(scores);
   64|       |
   65|  3.70k|  return nonmax;
   66|  3.70k|}

aom_fast9_score:
 2990|  3.70k|{
 2991|  3.70k|  int* scores = (int*)malloc(sizeof(int)* num_corners);
 2992|  3.70k|  int n;
 2993|       |
 2994|  3.70k|  int pixel[16];
 2995|  3.70k|  if(!scores) return NULL;
  ------------------
  |  Branch (2995:6): [True: 0, False: 3.70k]
  ------------------
 2996|  3.70k|  make_offsets(pixel, stride);
 2997|       |
 2998|   111k|  for(n=0; n < num_corners; n++)
  ------------------
  |  Branch (2998:12): [True: 108k, False: 3.70k]
  ------------------
 2999|   108k|    scores[n] = fast9_corner_score(i + corners[n].y*stride + corners[n].x, pixel, b);
 3000|       |
 3001|  3.70k|  return scores;
 3002|  3.70k|}
aom_fast9_detect:
 3006|  3.70k|{
 3007|  3.70k|  int num_corners=0;
 3008|  3.70k|  xy* ret_corners;
 3009|  3.70k|  int rsize=512;
 3010|  3.70k|  int pixel[16];
 3011|  3.70k|  int x, y;
 3012|       |
 3013|  3.70k|  ret_corners = (xy*)malloc(sizeof(xy)*rsize);
 3014|  3.70k|  if(!ret_corners) return NULL;
  ------------------
  |  Branch (3014:6): [True: 0, False: 3.70k]
  ------------------
 3015|  3.70k|  make_offsets(pixel, stride);
 3016|       |
 3017|  74.5k|  for(y=3; y < ysize - 3; y++)
  ------------------
  |  Branch (3017:12): [True: 70.8k, False: 3.70k]
  ------------------
 3018|   810k|    for(x=3; x < xsize - 3; x++)
  ------------------
  |  Branch (3018:14): [True: 739k, False: 70.8k]
  ------------------
 3019|   739k|    {
 3020|   739k|      const byte* p = im + y*stride + x;
 3021|       |
 3022|   739k|      int cb = *p + b;
 3023|   739k|      int c_b= *p - b;
 3024|   739k|      if(p[pixel[0]] > cb)
  ------------------
  |  Branch (3024:10): [True: 214k, False: 524k]
  ------------------
 3025|   214k|        if(p[pixel[1]] > cb)
  ------------------
  |  Branch (3025:12): [True: 122k, False: 91.8k]
  ------------------
 3026|   122k|          if(p[pixel[2]] > cb)
  ------------------
  |  Branch (3026:14): [True: 79.0k, False: 43.6k]
  ------------------
 3027|  79.0k|            if(p[pixel[3]] > cb)
  ------------------
  |  Branch (3027:16): [True: 56.8k, False: 22.2k]
  ------------------
 3028|  56.8k|              if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3028:18): [True: 44.0k, False: 12.8k]
  ------------------
 3029|  44.0k|                if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3029:20): [True: 35.2k, False: 8.80k]
  ------------------
 3030|  35.2k|                  if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3030:22): [True: 28.8k, False: 6.39k]
  ------------------
 3031|  28.8k|                    if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3031:24): [True: 23.9k, False: 4.83k]
  ------------------
 3032|  23.9k|                      if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3032:26): [True: 20.4k, False: 3.53k]
  ------------------
 3033|  20.4k|                      {}
 3034|  3.53k|                      else
 3035|  3.53k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3035:28): [True: 2.77k, False: 763]
  ------------------
 3036|  2.77k|                        {}
 3037|    763|                        else
 3038|    763|                          continue;
 3039|  4.83k|                    else if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3039:29): [True: 833, False: 3.99k]
  ------------------
 3040|    833|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3040:26): [True: 585, False: 248]
  ------------------
 3041|    585|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3041:28): [True: 434, False: 151]
  ------------------
 3042|    434|                        {}
 3043|    151|                        else
 3044|    151|                          continue;
 3045|    248|                      else if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3045:31): [True: 79, False: 169]
  ------------------
 3046|     79|                        if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3046:28): [True: 21, False: 58]
  ------------------
 3047|     21|                          if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3047:30): [True: 7, False: 14]
  ------------------
 3048|      7|                            if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3048:32): [True: 3, False: 4]
  ------------------
 3049|      3|                              if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3049:34): [True: 3, False: 0]
  ------------------
 3050|      3|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3050:36): [True: 1, False: 2]
  ------------------
 3051|      1|                                  if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3051:38): [True: 1, False: 0]
  ------------------
 3052|      1|                                    if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3052:40): [True: 1, False: 0]
  ------------------
 3053|      1|                                    {}
 3054|      0|                                    else
 3055|      0|                                      continue;
 3056|      0|                                  else
 3057|      0|                                    continue;
 3058|      2|                                else
 3059|      2|                                  continue;
 3060|      0|                              else
 3061|      0|                                continue;
 3062|      4|                            else
 3063|      4|                              continue;
 3064|     14|                          else
 3065|     14|                            continue;
 3066|     58|                        else
 3067|     58|                          continue;
 3068|    169|                      else
 3069|    169|                        continue;
 3070|  3.99k|                    else
 3071|  3.99k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3071:26): [True: 3.05k, False: 944]
  ------------------
 3072|  3.05k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3072:28): [True: 2.45k, False: 598]
  ------------------
 3073|  2.45k|                        {}
 3074|    598|                        else
 3075|    598|                          continue;
 3076|    944|                      else
 3077|    944|                        continue;
 3078|  6.39k|                  else if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3078:27): [True: 1.14k, False: 5.24k]
  ------------------
 3079|  1.14k|                    if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3079:24): [True: 765, False: 380]
  ------------------
 3080|    765|                      if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3080:26): [True: 537, False: 228]
  ------------------
 3081|    537|                        if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3081:28): [True: 378, False: 159]
  ------------------
 3082|    378|                        {}
 3083|    159|                        else
 3084|    159|                          continue;
 3085|    228|                      else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3085:31): [True: 90, False: 138]
  ------------------
 3086|     90|                        if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3086:28): [True: 17, False: 73]
  ------------------
 3087|     17|                          if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3087:30): [True: 5, False: 12]
  ------------------
 3088|      5|                            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3088:32): [True: 1, False: 4]
  ------------------
 3089|      1|                              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3089:34): [True: 1, False: 0]
  ------------------
 3090|      1|                                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3090:36): [True: 1, False: 0]
  ------------------
 3091|      1|                                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3091:38): [True: 0, False: 1]
  ------------------
 3092|      0|                                    if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3092:40): [True: 0, False: 0]
  ------------------
 3093|      0|                                    {}
 3094|      0|                                    else
 3095|      0|                                      continue;
 3096|      1|                                  else
 3097|      1|                                    continue;
 3098|      0|                                else
 3099|      0|                                  continue;
 3100|      0|                              else
 3101|      0|                                continue;
 3102|      4|                            else
 3103|      4|                              continue;
 3104|     12|                          else
 3105|     12|                            continue;
 3106|     73|                        else
 3107|     73|                          continue;
 3108|    138|                      else
 3109|    138|                        continue;
 3110|    380|                    else
 3111|    380|                      if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3111:26): [True: 58, False: 322]
  ------------------
 3112|     58|                        if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3112:28): [True: 19, False: 39]
  ------------------
 3113|     19|                          if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3113:30): [True: 6, False: 13]
  ------------------
 3114|      6|                            if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3114:32): [True: 2, False: 4]
  ------------------
 3115|      2|                              if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3115:34): [True: 0, False: 2]
  ------------------
 3116|      0|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3116:36): [True: 0, False: 0]
  ------------------
 3117|      0|                                  if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3117:38): [True: 0, False: 0]
  ------------------
 3118|      0|                                    if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3118:40): [True: 0, False: 0]
  ------------------
 3119|      0|                                    {}
 3120|      0|                                    else
 3121|      0|                                      continue;
 3122|      0|                                  else
 3123|      0|                                    continue;
 3124|      0|                                else
 3125|      0|                                  continue;
 3126|      2|                              else
 3127|      2|                                continue;
 3128|      4|                            else
 3129|      4|                              continue;
 3130|     13|                          else
 3131|     13|                            continue;
 3132|     39|                        else
 3133|     39|                          continue;
 3134|    322|                      else
 3135|    322|                        continue;
 3136|  5.24k|                  else
 3137|  5.24k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3137:24): [True: 3.89k, False: 1.35k]
  ------------------
 3138|  3.89k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3138:26): [True: 2.95k, False: 935]
  ------------------
 3139|  2.95k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3139:28): [True: 2.30k, False: 655]
  ------------------
 3140|  2.30k|                        {}
 3141|    655|                        else
 3142|    655|                          continue;
 3143|    935|                      else
 3144|    935|                        continue;
 3145|  1.35k|                    else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3145:29): [True: 271, False: 1.08k]
  ------------------
 3146|    271|                      if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3146:26): [True: 31, False: 240]
  ------------------
 3147|     31|                        if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3147:28): [True: 8, False: 23]
  ------------------
 3148|      8|                          if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3148:30): [True: 0, False: 8]
  ------------------
 3149|      0|                            if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3149:32): [True: 0, False: 0]
  ------------------
 3150|      0|                              if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3150:34): [True: 0, False: 0]
  ------------------
 3151|      0|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3151:36): [True: 0, False: 0]
  ------------------
 3152|      0|                                  if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3152:38): [True: 0, False: 0]
  ------------------
 3153|      0|                                    if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3153:40): [True: 0, False: 0]
  ------------------
 3154|      0|                                    {}
 3155|      0|                                    else
 3156|      0|                                      continue;
 3157|      0|                                  else
 3158|      0|                                    continue;
 3159|      0|                                else
 3160|      0|                                  continue;
 3161|      0|                              else
 3162|      0|                                continue;
 3163|      0|                            else
 3164|      0|                              continue;
 3165|      8|                          else
 3166|      8|                            continue;
 3167|     23|                        else
 3168|     23|                          continue;
 3169|    240|                      else
 3170|    240|                        continue;
 3171|  1.08k|                    else
 3172|  1.08k|                      continue;
 3173|  8.80k|                else if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3173:25): [True: 1.68k, False: 7.11k]
  ------------------
 3174|  1.68k|                  if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3174:22): [True: 1.06k, False: 619]
  ------------------
 3175|  1.06k|                    if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3175:24): [True: 704, False: 365]
  ------------------
 3176|    704|                      if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3176:26): [True: 519, False: 185]
  ------------------
 3177|    519|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3177:28): [True: 372, False: 147]
  ------------------
 3178|    372|                        {}
 3179|    147|                        else
 3180|    147|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3180:30): [True: 85, False: 62]
  ------------------
 3181|     85|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3181:32): [True: 58, False: 27]
  ------------------
 3182|     58|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3182:34): [True: 41, False: 17]
  ------------------
 3183|     41|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3183:36): [True: 27, False: 14]
  ------------------
 3184|     27|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3184:38): [True: 21, False: 6]
  ------------------
 3185|     21|                                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3185:40): [True: 16, False: 5]
  ------------------
 3186|     16|                                    {}
 3187|      5|                                    else
 3188|      5|                                      continue;
 3189|      6|                                  else
 3190|      6|                                    continue;
 3191|     14|                                else
 3192|     14|                                  continue;
 3193|     17|                              else
 3194|     17|                                continue;
 3195|     27|                            else
 3196|     27|                              continue;
 3197|     62|                          else
 3198|     62|                            continue;
 3199|    185|                      else
 3200|    185|                        continue;
 3201|    365|                    else if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3201:29): [True: 127, False: 238]
  ------------------
 3202|    127|                      if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3202:26): [True: 25, False: 102]
  ------------------
 3203|     25|                        if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3203:28): [True: 7, False: 18]
  ------------------
 3204|      7|                          if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3204:30): [True: 3, False: 4]
  ------------------
 3205|      3|                            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3205:32): [True: 2, False: 1]
  ------------------
 3206|      2|                              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3206:34): [True: 0, False: 2]
  ------------------
 3207|      0|                                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3207:36): [True: 0, False: 0]
  ------------------
 3208|      0|                                  if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3208:38): [True: 0, False: 0]
  ------------------
 3209|      0|                                  {}
 3210|      0|                                  else
 3211|      0|                                    continue;
 3212|      0|                                else
 3213|      0|                                  continue;
 3214|      2|                              else
 3215|      2|                                continue;
 3216|      1|                            else
 3217|      1|                              continue;
 3218|      4|                          else
 3219|      4|                            continue;
 3220|     18|                        else
 3221|     18|                          continue;
 3222|    102|                      else
 3223|    102|                        continue;
 3224|    238|                    else
 3225|    238|                      continue;
 3226|    619|                  else if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3226:27): [True: 222, False: 397]
  ------------------
 3227|    222|                    if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3227:24): [True: 36, False: 186]
  ------------------
 3228|     36|                      if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3228:26): [True: 17, False: 19]
  ------------------
 3229|     17|                        if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3229:28): [True: 10, False: 7]
  ------------------
 3230|     10|                          if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3230:30): [True: 4, False: 6]
  ------------------
 3231|      4|                            if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3231:32): [True: 2, False: 2]
  ------------------
 3232|      2|                              if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3232:34): [True: 0, False: 2]
  ------------------
 3233|      0|                                if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3233:36): [True: 0, False: 0]
  ------------------
 3234|      0|                                  if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3234:38): [True: 0, False: 0]
  ------------------
 3235|      0|                                  {}
 3236|      0|                                  else
 3237|      0|                                    if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3237:40): [True: 0, False: 0]
  ------------------
 3238|      0|                                    {}
 3239|      0|                                    else
 3240|      0|                                      continue;
 3241|      0|                                else
 3242|      0|                                  continue;
 3243|      2|                              else
 3244|      2|                                continue;
 3245|      2|                            else
 3246|      2|                              continue;
 3247|      6|                          else
 3248|      6|                            continue;
 3249|      7|                        else
 3250|      7|                          continue;
 3251|     19|                      else
 3252|     19|                        continue;
 3253|    186|                    else
 3254|    186|                      continue;
 3255|    397|                  else
 3256|    397|                    if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3256:24): [True: 51, False: 346]
  ------------------
 3257|     51|                      if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3257:26): [True: 7, False: 44]
  ------------------
 3258|      7|                        if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3258:28): [True: 2, False: 5]
  ------------------
 3259|      2|                          if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3259:30): [True: 1, False: 1]
  ------------------
 3260|      1|                            if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3260:32): [True: 0, False: 1]
  ------------------
 3261|      0|                              if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3261:34): [True: 0, False: 0]
  ------------------
 3262|      0|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3262:36): [True: 0, False: 0]
  ------------------
 3263|      0|                                  if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3263:38): [True: 0, False: 0]
  ------------------
 3264|      0|                                  {}
 3265|      0|                                  else
 3266|      0|                                    continue;
 3267|      0|                                else
 3268|      0|                                  continue;
 3269|      0|                              else
 3270|      0|                                continue;
 3271|      1|                            else
 3272|      1|                              continue;
 3273|      1|                          else
 3274|      1|                            continue;
 3275|      5|                        else
 3276|      5|                          continue;
 3277|     44|                      else
 3278|     44|                        continue;
 3279|    346|                    else
 3280|    346|                      continue;
 3281|  7.11k|                else
 3282|  7.11k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3282:22): [True: 5.01k, False: 2.10k]
  ------------------
 3283|  5.01k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3283:24): [True: 3.85k, False: 1.16k]
  ------------------
 3284|  3.85k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3284:26): [True: 2.95k, False: 901]
  ------------------
 3285|  2.95k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3285:28): [True: 2.38k, False: 569]
  ------------------
 3286|  2.38k|                        {}
 3287|    569|                        else
 3288|    569|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3288:30): [True: 422, False: 147]
  ------------------
 3289|    422|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3289:32): [True: 332, False: 90]
  ------------------
 3290|    332|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3290:34): [True: 269, False: 63]
  ------------------
 3291|    269|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3291:36): [True: 210, False: 59]
  ------------------
 3292|    210|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3292:38): [True: 163, False: 47]
  ------------------
 3293|    163|                                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3293:40): [True: 132, False: 31]
  ------------------
 3294|    132|                                    {}
 3295|     31|                                    else
 3296|     31|                                      continue;
 3297|     47|                                  else
 3298|     47|                                    continue;
 3299|     59|                                else
 3300|     59|                                  continue;
 3301|     63|                              else
 3302|     63|                                continue;
 3303|     90|                            else
 3304|     90|                              continue;
 3305|    147|                          else
 3306|    147|                            continue;
 3307|    901|                      else
 3308|    901|                        continue;
 3309|  1.16k|                    else
 3310|  1.16k|                      continue;
 3311|  2.10k|                  else if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3311:27): [True: 453, False: 1.64k]
  ------------------
 3312|    453|                    if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3312:24): [True: 82, False: 371]
  ------------------
 3313|     82|                      if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3313:26): [True: 22, False: 60]
  ------------------
 3314|     22|                        if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3314:28): [True: 5, False: 17]
  ------------------
 3315|      5|                          if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3315:30): [True: 2, False: 3]
  ------------------
 3316|      2|                            if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3316:32): [True: 1, False: 1]
  ------------------
 3317|      1|                              if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3317:34): [True: 0, False: 1]
  ------------------
 3318|      0|                                if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3318:36): [True: 0, False: 0]
  ------------------
 3319|      0|                                  if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3319:38): [True: 0, False: 0]
  ------------------
 3320|      0|                                  {}
 3321|      0|                                  else
 3322|      0|                                    if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3322:40): [True: 0, False: 0]
  ------------------
 3323|      0|                                    {}
 3324|      0|                                    else
 3325|      0|                                      continue;
 3326|      0|                                else
 3327|      0|                                  continue;
 3328|      1|                              else
 3329|      1|                                continue;
 3330|      1|                            else
 3331|      1|                              continue;
 3332|      3|                          else
 3333|      3|                            continue;
 3334|     17|                        else
 3335|     17|                          continue;
 3336|     60|                      else
 3337|     60|                        continue;
 3338|    371|                    else
 3339|    371|                      continue;
 3340|  1.64k|                  else
 3341|  1.64k|                    continue;
 3342|  12.8k|              else if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (3342:23): [True: 2.70k, False: 10.1k]
  ------------------
 3343|  2.70k|                if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3343:20): [True: 1.62k, False: 1.08k]
  ------------------
 3344|  1.62k|                  if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3344:22): [True: 1.01k, False: 614]
  ------------------
 3345|  1.01k|                    if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3345:24): [True: 755, False: 259]
  ------------------
 3346|    755|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3346:26): [True: 536, False: 219]
  ------------------
 3347|    536|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3347:28): [True: 405, False: 131]
  ------------------
 3348|    405|                        {}
 3349|    131|                        else
 3350|    131|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3350:30): [True: 95, False: 36]
  ------------------
 3351|     95|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3351:32): [True: 71, False: 24]
  ------------------
 3352|     71|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3352:34): [True: 50, False: 21]
  ------------------
 3353|     50|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3353:36): [True: 33, False: 17]
  ------------------
 3354|     33|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3354:38): [True: 24, False: 9]
  ------------------
 3355|     24|                                  {}
 3356|      9|                                  else
 3357|      9|                                    continue;
 3358|     17|                                else
 3359|     17|                                  continue;
 3360|     21|                              else
 3361|     21|                                continue;
 3362|     24|                            else
 3363|     24|                              continue;
 3364|     36|                          else
 3365|     36|                            continue;
 3366|    219|                      else
 3367|    219|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3367:28): [True: 129, False: 90]
  ------------------
 3368|    129|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3368:30): [True: 82, False: 47]
  ------------------
 3369|     82|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3369:32): [True: 49, False: 33]
  ------------------
 3370|     49|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3370:34): [True: 39, False: 10]
  ------------------
 3371|     39|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3371:36): [True: 29, False: 10]
  ------------------
 3372|     29|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3372:38): [True: 20, False: 9]
  ------------------
 3373|     20|                                  {}
 3374|      9|                                  else
 3375|      9|                                    continue;
 3376|     10|                                else
 3377|     10|                                  continue;
 3378|     10|                              else
 3379|     10|                                continue;
 3380|     33|                            else
 3381|     33|                              continue;
 3382|     47|                          else
 3383|     47|                            continue;
 3384|     90|                        else
 3385|     90|                          continue;
 3386|    259|                    else
 3387|    259|                      continue;
 3388|    614|                  else if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3388:27): [True: 232, False: 382]
  ------------------
 3389|    232|                    if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3389:24): [True: 54, False: 178]
  ------------------
 3390|     54|                      if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3390:26): [True: 15, False: 39]
  ------------------
 3391|     15|                        if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3391:28): [True: 2, False: 13]
  ------------------
 3392|      2|                          if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3392:30): [True: 1, False: 1]
  ------------------
 3393|      1|                            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3393:32): [True: 0, False: 1]
  ------------------
 3394|      0|                              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3394:34): [True: 0, False: 0]
  ------------------
 3395|      0|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3395:36): [True: 0, False: 0]
  ------------------
 3396|      0|                                {}
 3397|      0|                                else
 3398|      0|                                  continue;
 3399|      0|                              else
 3400|      0|                                continue;
 3401|      1|                            else
 3402|      1|                              continue;
 3403|      1|                          else
 3404|      1|                            continue;
 3405|     13|                        else
 3406|     13|                          continue;
 3407|     39|                      else
 3408|     39|                        continue;
 3409|    178|                    else
 3410|    178|                      continue;
 3411|    382|                  else
 3412|    382|                    continue;
 3413|  1.08k|                else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3413:25): [True: 441, False: 639]
  ------------------
 3414|    441|                  if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3414:22): [True: 110, False: 331]
  ------------------
 3415|    110|                    if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3415:24): [True: 42, False: 68]
  ------------------
 3416|     42|                      if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3416:26): [True: 15, False: 27]
  ------------------
 3417|     15|                        if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3417:28): [True: 5, False: 10]
  ------------------
 3418|      5|                          if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3418:30): [True: 2, False: 3]
  ------------------
 3419|      2|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3419:32): [True: 0, False: 2]
  ------------------
 3420|      0|                              if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3420:34): [True: 0, False: 0]
  ------------------
 3421|      0|                                if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3421:36): [True: 0, False: 0]
  ------------------
 3422|      0|                                {}
 3423|      0|                                else
 3424|      0|                                  if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3424:38): [True: 0, False: 0]
  ------------------
 3425|      0|                                  {}
 3426|      0|                                  else
 3427|      0|                                    continue;
 3428|      0|                              else
 3429|      0|                                if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3429:36): [True: 0, False: 0]
  ------------------
 3430|      0|                                  if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3430:38): [True: 0, False: 0]
  ------------------
 3431|      0|                                  {}
 3432|      0|                                  else
 3433|      0|                                    continue;
 3434|      0|                                else
 3435|      0|                                  continue;
 3436|      2|                            else
 3437|      2|                              continue;
 3438|      3|                          else
 3439|      3|                            continue;
 3440|     10|                        else
 3441|     10|                          continue;
 3442|     27|                      else
 3443|     27|                        continue;
 3444|     68|                    else
 3445|     68|                      continue;
 3446|    331|                  else
 3447|    331|                    continue;
 3448|    639|                else
 3449|    639|                  if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3449:22): [True: 120, False: 519]
  ------------------
 3450|    120|                    if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3450:24): [True: 22, False: 98]
  ------------------
 3451|     22|                      if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3451:26): [True: 8, False: 14]
  ------------------
 3452|      8|                        if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3452:28): [True: 2, False: 6]
  ------------------
 3453|      2|                          if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3453:30): [True: 0, False: 2]
  ------------------
 3454|      0|                            if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3454:32): [True: 0, False: 0]
  ------------------
 3455|      0|                              if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3455:34): [True: 0, False: 0]
  ------------------
 3456|      0|                                if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3456:36): [True: 0, False: 0]
  ------------------
 3457|      0|                                {}
 3458|      0|                                else
 3459|      0|                                  continue;
 3460|      0|                              else
 3461|      0|                                continue;
 3462|      0|                            else
 3463|      0|                              continue;
 3464|      2|                          else
 3465|      2|                            continue;
 3466|      6|                        else
 3467|      6|                          continue;
 3468|     14|                      else
 3469|     14|                        continue;
 3470|     98|                    else
 3471|     98|                      continue;
 3472|    519|                  else
 3473|    519|                    continue;
 3474|  10.1k|              else
 3475|  10.1k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3475:20): [True: 6.82k, False: 3.31k]
  ------------------
 3476|  6.82k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3476:22): [True: 5.06k, False: 1.76k]
  ------------------
 3477|  5.06k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3477:24): [True: 3.75k, False: 1.30k]
  ------------------
 3478|  3.75k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3478:26): [True: 2.87k, False: 878]
  ------------------
 3479|  2.87k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3479:28): [True: 2.30k, False: 579]
  ------------------
 3480|  2.30k|                        {}
 3481|    579|                        else
 3482|    579|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3482:30): [True: 407, False: 172]
  ------------------
 3483|    407|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3483:32): [True: 309, False: 98]
  ------------------
 3484|    309|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3484:34): [True: 250, False: 59]
  ------------------
 3485|    250|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3485:36): [True: 198, False: 52]
  ------------------
 3486|    198|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3486:38): [True: 149, False: 49]
  ------------------
 3487|    149|                                  {}
 3488|     49|                                  else
 3489|     49|                                    continue;
 3490|     52|                                else
 3491|     52|                                  continue;
 3492|     59|                              else
 3493|     59|                                continue;
 3494|     98|                            else
 3495|     98|                              continue;
 3496|    172|                          else
 3497|    172|                            continue;
 3498|    878|                      else
 3499|    878|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3499:28): [True: 568, False: 310]
  ------------------
 3500|    568|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3500:30): [True: 434, False: 134]
  ------------------
 3501|    434|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3501:32): [True: 320, False: 114]
  ------------------
 3502|    320|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3502:34): [True: 262, False: 58]
  ------------------
 3503|    262|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3503:36): [True: 205, False: 57]
  ------------------
 3504|    205|                                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3504:38): [True: 163, False: 42]
  ------------------
 3505|    163|                                  {}
 3506|     42|                                  else
 3507|     42|                                    continue;
 3508|     57|                                else
 3509|     57|                                  continue;
 3510|     58|                              else
 3511|     58|                                continue;
 3512|    114|                            else
 3513|    114|                              continue;
 3514|    134|                          else
 3515|    134|                            continue;
 3516|    310|                        else
 3517|    310|                          continue;
 3518|  1.30k|                    else
 3519|  1.30k|                      continue;
 3520|  1.76k|                  else
 3521|  1.76k|                    continue;
 3522|  3.31k|                else if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3522:25): [True: 721, False: 2.59k]
  ------------------
 3523|    721|                  if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3523:22): [True: 131, False: 590]
  ------------------
 3524|    131|                    if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3524:24): [True: 36, False: 95]
  ------------------
 3525|     36|                      if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3525:26): [True: 12, False: 24]
  ------------------
 3526|     12|                        if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3526:28): [True: 7, False: 5]
  ------------------
 3527|      7|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3527:30): [True: 2, False: 5]
  ------------------
 3528|      2|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3528:32): [True: 0, False: 2]
  ------------------
 3529|      0|                              if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3529:34): [True: 0, False: 0]
  ------------------
 3530|      0|                                if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3530:36): [True: 0, False: 0]
  ------------------
 3531|      0|                                {}
 3532|      0|                                else
 3533|      0|                                  if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3533:38): [True: 0, False: 0]
  ------------------
 3534|      0|                                  {}
 3535|      0|                                  else
 3536|      0|                                    continue;
 3537|      0|                              else
 3538|      0|                                if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3538:36): [True: 0, False: 0]
  ------------------
 3539|      0|                                  if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3539:38): [True: 0, False: 0]
  ------------------
 3540|      0|                                  {}
 3541|      0|                                  else
 3542|      0|                                    continue;
 3543|      0|                                else
 3544|      0|                                  continue;
 3545|      2|                            else
 3546|      2|                              continue;
 3547|      5|                          else
 3548|      5|                            continue;
 3549|      5|                        else
 3550|      5|                          continue;
 3551|     24|                      else
 3552|     24|                        continue;
 3553|     95|                    else
 3554|     95|                      continue;
 3555|    590|                  else
 3556|    590|                    continue;
 3557|  2.59k|                else
 3558|  2.59k|                  continue;
 3559|  22.2k|            else if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (3559:21): [True: 5.33k, False: 16.8k]
  ------------------
 3560|  5.33k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3560:18): [True: 2.81k, False: 2.52k]
  ------------------
 3561|  2.81k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3561:20): [True: 1.74k, False: 1.07k]
  ------------------
 3562|  1.74k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3562:22): [True: 1.15k, False: 584]
  ------------------
 3563|  1.15k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3563:24): [True: 817, False: 339]
  ------------------
 3564|    817|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3564:26): [True: 554, False: 263]
  ------------------
 3565|    554|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3565:28): [True: 389, False: 165]
  ------------------
 3566|    389|                        {}
 3567|    165|                        else
 3568|    165|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3568:30): [True: 115, False: 50]
  ------------------
 3569|    115|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3569:32): [True: 82, False: 33]
  ------------------
 3570|     82|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3570:34): [True: 56, False: 26]
  ------------------
 3571|     56|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3571:36): [True: 49, False: 7]
  ------------------
 3572|     49|                                {}
 3573|      7|                                else
 3574|      7|                                  continue;
 3575|     26|                              else
 3576|     26|                                continue;
 3577|     33|                            else
 3578|     33|                              continue;
 3579|     50|                          else
 3580|     50|                            continue;
 3581|    263|                      else
 3582|    263|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3582:28): [True: 160, False: 103]
  ------------------
 3583|    160|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3583:30): [True: 112, False: 48]
  ------------------
 3584|    112|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3584:32): [True: 79, False: 33]
  ------------------
 3585|     79|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3585:34): [True: 57, False: 22]
  ------------------
 3586|     57|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3586:36): [True: 44, False: 13]
  ------------------
 3587|     44|                                {}
 3588|     13|                                else
 3589|     13|                                  continue;
 3590|     22|                              else
 3591|     22|                                continue;
 3592|     33|                            else
 3593|     33|                              continue;
 3594|     48|                          else
 3595|     48|                            continue;
 3596|    103|                        else
 3597|    103|                          continue;
 3598|    339|                    else
 3599|    339|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3599:26): [True: 190, False: 149]
  ------------------
 3600|    190|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3600:28): [True: 131, False: 59]
  ------------------
 3601|    131|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3601:30): [True: 90, False: 41]
  ------------------
 3602|     90|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3602:32): [True: 64, False: 26]
  ------------------
 3603|     64|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3603:34): [True: 43, False: 21]
  ------------------
 3604|     43|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3604:36): [True: 26, False: 17]
  ------------------
 3605|     26|                                {}
 3606|     17|                                else
 3607|     17|                                  continue;
 3608|     21|                              else
 3609|     21|                                continue;
 3610|     26|                            else
 3611|     26|                              continue;
 3612|     41|                          else
 3613|     41|                            continue;
 3614|     59|                        else
 3615|     59|                          continue;
 3616|    149|                      else
 3617|    149|                        continue;
 3618|    584|                  else
 3619|    584|                    continue;
 3620|  1.07k|                else
 3621|  1.07k|                  continue;
 3622|  2.52k|              else if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3622:23): [True: 1.06k, False: 1.46k]
  ------------------
 3623|  1.06k|                if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3623:20): [True: 320, False: 742]
  ------------------
 3624|    320|                  if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3624:22): [True: 144, False: 176]
  ------------------
 3625|    144|                    if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3625:24): [True: 74, False: 70]
  ------------------
 3626|     74|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3626:26): [True: 34, False: 40]
  ------------------
 3627|     34|                        if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3627:28): [True: 21, False: 13]
  ------------------
 3628|     21|                          if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3628:30): [True: 12, False: 9]
  ------------------
 3629|     12|                            if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (3629:32): [True: 8, False: 4]
  ------------------
 3630|      8|                            {}
 3631|      4|                            else
 3632|      4|                              if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3632:34): [True: 1, False: 3]
  ------------------
 3633|      1|                                if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3633:36): [True: 1, False: 0]
  ------------------
 3634|      1|                                {}
 3635|      0|                                else
 3636|      0|                                  continue;
 3637|      3|                              else
 3638|      3|                                continue;
 3639|      9|                          else
 3640|      9|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3640:32): [True: 6, False: 3]
  ------------------
 3641|      6|                              if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3641:34): [True: 4, False: 2]
  ------------------
 3642|      4|                                if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3642:36): [True: 2, False: 2]
  ------------------
 3643|      2|                                {}
 3644|      2|                                else
 3645|      2|                                  continue;
 3646|      2|                              else
 3647|      2|                                continue;
 3648|      3|                            else
 3649|      3|                              continue;
 3650|     13|                        else
 3651|     13|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3651:30): [True: 9, False: 4]
  ------------------
 3652|      9|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3652:32): [True: 4, False: 5]
  ------------------
 3653|      4|                              if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3653:34): [True: 3, False: 1]
  ------------------
 3654|      3|                                if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3654:36): [True: 1, False: 2]
  ------------------
 3655|      1|                                {}
 3656|      2|                                else
 3657|      2|                                  continue;
 3658|      1|                              else
 3659|      1|                                continue;
 3660|      5|                            else
 3661|      5|                              continue;
 3662|      4|                          else
 3663|      4|                            continue;
 3664|     40|                      else
 3665|     40|                        continue;
 3666|     70|                    else
 3667|     70|                      continue;
 3668|    176|                  else
 3669|    176|                    continue;
 3670|    742|                else
 3671|    742|                  continue;
 3672|  1.46k|              else
 3673|  1.46k|                continue;
 3674|  16.8k|            else
 3675|  16.8k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3675:18): [True: 10.4k, False: 6.46k]
  ------------------
 3676|  10.4k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3676:20): [True: 6.92k, False: 3.50k]
  ------------------
 3677|  6.92k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3677:22): [True: 5.09k, False: 1.82k]
  ------------------
 3678|  5.09k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3678:24): [True: 3.88k, False: 1.21k]
  ------------------
 3679|  3.88k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3679:26): [True: 2.95k, False: 927]
  ------------------
 3680|  2.95k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3680:28): [True: 2.37k, False: 579]
  ------------------
 3681|  2.37k|                        {}
 3682|    579|                        else
 3683|    579|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3683:30): [True: 418, False: 161]
  ------------------
 3684|    418|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3684:32): [True: 308, False: 110]
  ------------------
 3685|    308|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3685:34): [True: 254, False: 54]
  ------------------
 3686|    254|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3686:36): [True: 207, False: 47]
  ------------------
 3687|    207|                                {}
 3688|     47|                                else
 3689|     47|                                  continue;
 3690|     54|                              else
 3691|     54|                                continue;
 3692|    110|                            else
 3693|    110|                              continue;
 3694|    161|                          else
 3695|    161|                            continue;
 3696|    927|                      else
 3697|    927|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3697:28): [True: 661, False: 266]
  ------------------
 3698|    661|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3698:30): [True: 478, False: 183]
  ------------------
 3699|    478|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3699:32): [True: 369, False: 109]
  ------------------
 3700|    369|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3700:34): [True: 293, False: 76]
  ------------------
 3701|    293|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3701:36): [True: 222, False: 71]
  ------------------
 3702|    222|                                {}
 3703|     71|                                else
 3704|     71|                                  continue;
 3705|     76|                              else
 3706|     76|                                continue;
 3707|    109|                            else
 3708|    109|                              continue;
 3709|    183|                          else
 3710|    183|                            continue;
 3711|    266|                        else
 3712|    266|                          continue;
 3713|  1.21k|                    else
 3714|  1.21k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3714:26): [True: 760, False: 457]
  ------------------
 3715|    760|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3715:28): [True: 584, False: 176]
  ------------------
 3716|    584|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3716:30): [True: 427, False: 157]
  ------------------
 3717|    427|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3717:32): [True: 307, False: 120]
  ------------------
 3718|    307|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3718:34): [True: 240, False: 67]
  ------------------
 3719|    240|                                if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3719:36): [True: 186, False: 54]
  ------------------
 3720|    186|                                {}
 3721|     54|                                else
 3722|     54|                                  continue;
 3723|     67|                              else
 3724|     67|                                continue;
 3725|    120|                            else
 3726|    120|                              continue;
 3727|    157|                          else
 3728|    157|                            continue;
 3729|    176|                        else
 3730|    176|                          continue;
 3731|    457|                      else
 3732|    457|                        continue;
 3733|  1.82k|                  else
 3734|  1.82k|                    continue;
 3735|  3.50k|                else
 3736|  3.50k|                  continue;
 3737|  6.46k|              else if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3737:23): [True: 1.41k, False: 5.05k]
  ------------------
 3738|  1.41k|                if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3738:20): [True: 303, False: 1.10k]
  ------------------
 3739|    303|                  if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3739:22): [True: 106, False: 197]
  ------------------
 3740|    106|                    if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3740:24): [True: 38, False: 68]
  ------------------
 3741|     38|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3741:26): [True: 10, False: 28]
  ------------------
 3742|     10|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3742:28): [True: 9, False: 1]
  ------------------
 3743|      9|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3743:30): [True: 8, False: 1]
  ------------------
 3744|      8|                            if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3744:32): [True: 6, False: 2]
  ------------------
 3745|      6|                              if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (3745:34): [True: 4, False: 2]
  ------------------
 3746|      4|                              {}
 3747|      2|                              else
 3748|      2|                                if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3748:36): [True: 1, False: 1]
  ------------------
 3749|      1|                                {}
 3750|      1|                                else
 3751|      1|                                  continue;
 3752|      2|                            else
 3753|      2|                              if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3753:34): [True: 2, False: 0]
  ------------------
 3754|      2|                                if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3754:36): [True: 0, False: 2]
  ------------------
 3755|      0|                                {}
 3756|      2|                                else
 3757|      2|                                  continue;
 3758|      0|                              else
 3759|      0|                                continue;
 3760|      1|                          else
 3761|      1|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3761:32): [True: 0, False: 1]
  ------------------
 3762|      0|                              if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3762:34): [True: 0, False: 0]
  ------------------
 3763|      0|                                if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3763:36): [True: 0, False: 0]
  ------------------
 3764|      0|                                {}
 3765|      0|                                else
 3766|      0|                                  continue;
 3767|      0|                              else
 3768|      0|                                continue;
 3769|      1|                            else
 3770|      1|                              continue;
 3771|      1|                        else
 3772|      1|                          continue;
 3773|     28|                      else
 3774|     28|                        continue;
 3775|     68|                    else
 3776|     68|                      continue;
 3777|    197|                  else
 3778|    197|                    continue;
 3779|  1.10k|                else
 3780|  1.10k|                  continue;
 3781|  5.05k|              else
 3782|  5.05k|                continue;
 3783|  43.6k|          else if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (3783:19): [True: 11.9k, False: 31.6k]
  ------------------
 3784|  11.9k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3784:16): [True: 5.11k, False: 6.82k]
  ------------------
 3785|  5.11k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3785:18): [True: 2.70k, False: 2.41k]
  ------------------
 3786|  2.70k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3786:20): [True: 1.62k, False: 1.07k]
  ------------------
 3787|  1.62k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3787:22): [True: 1.06k, False: 561]
  ------------------
 3788|  1.06k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3788:24): [True: 738, False: 330]
  ------------------
 3789|    738|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3789:26): [True: 504, False: 234]
  ------------------
 3790|    504|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3790:28): [True: 369, False: 135]
  ------------------
 3791|    369|                        {}
 3792|    135|                        else
 3793|    135|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3793:30): [True: 93, False: 42]
  ------------------
 3794|     93|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3794:32): [True: 64, False: 29]
  ------------------
 3795|     64|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3795:34): [True: 46, False: 18]
  ------------------
 3796|     46|                              {}
 3797|     18|                              else
 3798|     18|                                continue;
 3799|     29|                            else
 3800|     29|                              continue;
 3801|     42|                          else
 3802|     42|                            continue;
 3803|    234|                      else
 3804|    234|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3804:28): [True: 144, False: 90]
  ------------------
 3805|    144|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3805:30): [True: 99, False: 45]
  ------------------
 3806|     99|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3806:32): [True: 69, False: 30]
  ------------------
 3807|     69|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3807:34): [True: 55, False: 14]
  ------------------
 3808|     55|                              {}
 3809|     14|                              else
 3810|     14|                                continue;
 3811|     30|                            else
 3812|     30|                              continue;
 3813|     45|                          else
 3814|     45|                            continue;
 3815|     90|                        else
 3816|     90|                          continue;
 3817|    330|                    else
 3818|    330|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3818:26): [True: 222, False: 108]
  ------------------
 3819|    222|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3819:28): [True: 144, False: 78]
  ------------------
 3820|    144|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3820:30): [True: 102, False: 42]
  ------------------
 3821|    102|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3821:32): [True: 74, False: 28]
  ------------------
 3822|     74|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3822:34): [True: 50, False: 24]
  ------------------
 3823|     50|                              {}
 3824|     24|                              else
 3825|     24|                                continue;
 3826|     28|                            else
 3827|     28|                              continue;
 3828|     42|                          else
 3829|     42|                            continue;
 3830|     78|                        else
 3831|     78|                          continue;
 3832|    108|                      else
 3833|    108|                        continue;
 3834|    561|                  else
 3835|    561|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (3835:24): [True: 314, False: 247]
  ------------------
 3836|    314|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3836:26): [True: 197, False: 117]
  ------------------
 3837|    197|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3837:28): [True: 120, False: 77]
  ------------------
 3838|    120|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3838:30): [True: 87, False: 33]
  ------------------
 3839|     87|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3839:32): [True: 58, False: 29]
  ------------------
 3840|     58|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3840:34): [True: 42, False: 16]
  ------------------
 3841|     42|                              {}
 3842|     16|                              else
 3843|     16|                                continue;
 3844|     29|                            else
 3845|     29|                              continue;
 3846|     33|                          else
 3847|     33|                            continue;
 3848|     77|                        else
 3849|     77|                          continue;
 3850|    117|                      else
 3851|    117|                        continue;
 3852|    247|                    else
 3853|    247|                      continue;
 3854|  1.07k|                else
 3855|  1.07k|                  continue;
 3856|  2.41k|              else
 3857|  2.41k|                continue;
 3858|  6.82k|            else if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (3858:21): [True: 3.32k, False: 3.49k]
  ------------------
 3859|  3.32k|              if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (3859:18): [True: 1.17k, False: 2.15k]
  ------------------
 3860|  1.17k|                if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (3860:20): [True: 654, False: 524]
  ------------------
 3861|    654|                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (3861:22): [True: 337, False: 317]
  ------------------
 3862|    337|                    if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (3862:24): [True: 185, False: 152]
  ------------------
 3863|    185|                      if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (3863:26): [True: 110, False: 75]
  ------------------
 3864|    110|                        if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (3864:28): [True: 78, False: 32]
  ------------------
 3865|     78|                          if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (3865:30): [True: 51, False: 27]
  ------------------
 3866|     51|                          {}
 3867|     27|                          else
 3868|     27|                            if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3868:32): [True: 20, False: 7]
  ------------------
 3869|     20|                              if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3869:34): [True: 16, False: 4]
  ------------------
 3870|     16|                              {}
 3871|      4|                              else
 3872|      4|                                continue;
 3873|      7|                            else
 3874|      7|                              continue;
 3875|     32|                        else
 3876|     32|                          if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3876:30): [True: 23, False: 9]
  ------------------
 3877|     23|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3877:32): [True: 16, False: 7]
  ------------------
 3878|     16|                              if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3878:34): [True: 9, False: 7]
  ------------------
 3879|      9|                              {}
 3880|      7|                              else
 3881|      7|                                continue;
 3882|      7|                            else
 3883|      7|                              continue;
 3884|      9|                          else
 3885|      9|                            continue;
 3886|     75|                      else
 3887|     75|                        if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3887:28): [True: 43, False: 32]
  ------------------
 3888|     43|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3888:30): [True: 27, False: 16]
  ------------------
 3889|     27|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3889:32): [True: 15, False: 12]
  ------------------
 3890|     15|                              if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3890:34): [True: 10, False: 5]
  ------------------
 3891|     10|                              {}
 3892|      5|                              else
 3893|      5|                                continue;
 3894|     12|                            else
 3895|     12|                              continue;
 3896|     16|                          else
 3897|     16|                            continue;
 3898|     32|                        else
 3899|     32|                          continue;
 3900|    152|                    else
 3901|    152|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (3901:26): [True: 83, False: 69]
  ------------------
 3902|     83|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (3902:28): [True: 54, False: 29]
  ------------------
 3903|     54|                          if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (3903:30): [True: 33, False: 21]
  ------------------
 3904|     33|                            if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (3904:32): [True: 20, False: 13]
  ------------------
 3905|     20|                              if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (3905:34): [True: 13, False: 7]
  ------------------
 3906|     13|                              {}
 3907|      7|                              else
 3908|      7|                                continue;
 3909|     13|                            else
 3910|     13|                              continue;
 3911|     21|                          else
 3912|     21|                            continue;
 3913|     29|                        else
 3914|     29|                          continue;
 3915|     69|                      else
 3916|     69|                        continue;
 3917|    317|                  else
 3918|    317|                    continue;
 3919|    524|                else
 3920|    524|                  continue;
 3921|  2.15k|              else
 3922|  2.15k|                continue;
 3923|  3.49k|            else
 3924|  3.49k|              continue;
 3925|  31.6k|          else
 3926|  31.6k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (3926:16): [True: 16.9k, False: 14.7k]
  ------------------
 3927|  16.9k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (3927:18): [True: 10.4k, False: 6.41k]
  ------------------
 3928|  10.4k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (3928:20): [True: 7.02k, False: 3.47k]
  ------------------
 3929|  7.02k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (3929:22): [True: 5.09k, False: 1.92k]
  ------------------
 3930|  5.09k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (3930:24): [True: 3.88k, False: 1.21k]
  ------------------
 3931|  3.88k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (3931:26): [True: 2.97k, False: 905]
  ------------------
 3932|  2.97k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (3932:28): [True: 2.35k, False: 617]
  ------------------
 3933|  2.35k|                        {}
 3934|    617|                        else
 3935|    617|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3935:30): [True: 468, False: 149]
  ------------------
 3936|    468|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3936:32): [True: 377, False: 91]
  ------------------
 3937|    377|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3937:34): [True: 295, False: 82]
  ------------------
 3938|    295|                              {}
 3939|     82|                              else
 3940|     82|                                continue;
 3941|     91|                            else
 3942|     91|                              continue;
 3943|    149|                          else
 3944|    149|                            continue;
 3945|    905|                      else
 3946|    905|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3946:28): [True: 624, False: 281]
  ------------------
 3947|    624|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3947:30): [True: 466, False: 158]
  ------------------
 3948|    466|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3948:32): [True: 338, False: 128]
  ------------------
 3949|    338|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3949:34): [True: 255, False: 83]
  ------------------
 3950|    255|                              {}
 3951|     83|                              else
 3952|     83|                                continue;
 3953|    128|                            else
 3954|    128|                              continue;
 3955|    158|                          else
 3956|    158|                            continue;
 3957|    281|                        else
 3958|    281|                          continue;
 3959|  1.21k|                    else
 3960|  1.21k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3960:26): [True: 825, False: 391]
  ------------------
 3961|    825|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3961:28): [True: 626, False: 199]
  ------------------
 3962|    626|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3962:30): [True: 469, False: 157]
  ------------------
 3963|    469|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3963:32): [True: 362, False: 107]
  ------------------
 3964|    362|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3964:34): [True: 305, False: 57]
  ------------------
 3965|    305|                              {}
 3966|     57|                              else
 3967|     57|                                continue;
 3968|    107|                            else
 3969|    107|                              continue;
 3970|    157|                          else
 3971|    157|                            continue;
 3972|    199|                        else
 3973|    199|                          continue;
 3974|    391|                      else
 3975|    391|                        continue;
 3976|  1.92k|                  else
 3977|  1.92k|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (3977:24): [True: 1.21k, False: 707]
  ------------------
 3978|  1.21k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (3978:26): [True: 887, False: 331]
  ------------------
 3979|    887|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (3979:28): [True: 642, False: 245]
  ------------------
 3980|    642|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (3980:30): [True: 459, False: 183]
  ------------------
 3981|    459|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (3981:32): [True: 345, False: 114]
  ------------------
 3982|    345|                              if(p[pixel[8]] > cb)
  ------------------
  |  Branch (3982:34): [True: 266, False: 79]
  ------------------
 3983|    266|                              {}
 3984|     79|                              else
 3985|     79|                                continue;
 3986|    114|                            else
 3987|    114|                              continue;
 3988|    183|                          else
 3989|    183|                            continue;
 3990|    245|                        else
 3991|    245|                          continue;
 3992|    331|                      else
 3993|    331|                        continue;
 3994|    707|                    else
 3995|    707|                      continue;
 3996|  3.47k|                else
 3997|  3.47k|                  continue;
 3998|  6.41k|              else
 3999|  6.41k|                continue;
 4000|  14.7k|            else if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4000:21): [True: 3.48k, False: 11.2k]
  ------------------
 4001|  3.48k|              if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4001:18): [True: 875, False: 2.61k]
  ------------------
 4002|    875|                if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4002:20): [True: 412, False: 463]
  ------------------
 4003|    412|                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4003:22): [True: 171, False: 241]
  ------------------
 4004|    171|                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4004:24): [True: 83, False: 88]
  ------------------
 4005|     83|                      if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4005:26): [True: 41, False: 42]
  ------------------
 4006|     41|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4006:28): [True: 24, False: 17]
  ------------------
 4007|     24|                          if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4007:30): [True: 16, False: 8]
  ------------------
 4008|     16|                            if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4008:32): [True: 9, False: 7]
  ------------------
 4009|      9|                            {}
 4010|      7|                            else
 4011|      7|                              if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4011:34): [True: 3, False: 4]
  ------------------
 4012|      3|                              {}
 4013|      4|                              else
 4014|      4|                                continue;
 4015|      8|                          else
 4016|      8|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4016:32): [True: 5, False: 3]
  ------------------
 4017|      5|                              if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4017:34): [True: 4, False: 1]
  ------------------
 4018|      4|                              {}
 4019|      1|                              else
 4020|      1|                                continue;
 4021|      3|                            else
 4022|      3|                              continue;
 4023|     17|                        else
 4024|     17|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4024:30): [True: 11, False: 6]
  ------------------
 4025|     11|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4025:32): [True: 7, False: 4]
  ------------------
 4026|      7|                              if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4026:34): [True: 5, False: 2]
  ------------------
 4027|      5|                              {}
 4028|      2|                              else
 4029|      2|                                continue;
 4030|      4|                            else
 4031|      4|                              continue;
 4032|      6|                          else
 4033|      6|                            continue;
 4034|     42|                      else
 4035|     42|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4035:28): [True: 19, False: 23]
  ------------------
 4036|     19|                          if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4036:30): [True: 11, False: 8]
  ------------------
 4037|     11|                            if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4037:32): [True: 5, False: 6]
  ------------------
 4038|      5|                              if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4038:34): [True: 3, False: 2]
  ------------------
 4039|      3|                              {}
 4040|      2|                              else
 4041|      2|                                continue;
 4042|      6|                            else
 4043|      6|                              continue;
 4044|      8|                          else
 4045|      8|                            continue;
 4046|     23|                        else
 4047|     23|                          continue;
 4048|     88|                    else
 4049|     88|                      continue;
 4050|    241|                  else
 4051|    241|                    continue;
 4052|    463|                else
 4053|    463|                  continue;
 4054|  2.61k|              else
 4055|  2.61k|                continue;
 4056|  11.2k|            else
 4057|  11.2k|              continue;
 4058|  91.8k|        else if(p[pixel[1]] < c_b)
  ------------------
  |  Branch (4058:17): [True: 27.5k, False: 64.2k]
  ------------------
 4059|  27.5k|          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4059:14): [True: 9.39k, False: 18.1k]
  ------------------
 4060|  9.39k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4060:16): [True: 4.75k, False: 4.63k]
  ------------------
 4061|  4.75k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4061:18): [True: 2.56k, False: 2.19k]
  ------------------
 4062|  2.56k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4062:20): [True: 1.52k, False: 1.03k]
  ------------------
 4063|  1.52k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4063:22): [True: 1.01k, False: 509]
  ------------------
 4064|  1.01k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4064:24): [True: 700, False: 314]
  ------------------
 4065|    700|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4065:26): [True: 499, False: 201]
  ------------------
 4066|    499|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4066:28): [True: 408, False: 91]
  ------------------
 4067|    408|                        {}
 4068|     91|                        else
 4069|     91|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4069:30): [True: 60, False: 31]
  ------------------
 4070|     60|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4070:32): [True: 38, False: 22]
  ------------------
 4071|     38|                            {}
 4072|     22|                            else
 4073|     22|                              continue;
 4074|     31|                          else
 4075|     31|                            continue;
 4076|    201|                      else
 4077|    201|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4077:28): [True: 123, False: 78]
  ------------------
 4078|    123|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4078:30): [True: 88, False: 35]
  ------------------
 4079|     88|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4079:32): [True: 61, False: 27]
  ------------------
 4080|     61|                            {}
 4081|     27|                            else
 4082|     27|                              continue;
 4083|     35|                          else
 4084|     35|                            continue;
 4085|     78|                        else
 4086|     78|                          continue;
 4087|    314|                    else
 4088|    314|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4088:26): [True: 205, False: 109]
  ------------------
 4089|    205|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4089:28): [True: 152, False: 53]
  ------------------
 4090|    152|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4090:30): [True: 101, False: 51]
  ------------------
 4091|    101|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4091:32): [True: 67, False: 34]
  ------------------
 4092|     67|                            {}
 4093|     34|                            else
 4094|     34|                              continue;
 4095|     51|                          else
 4096|     51|                            continue;
 4097|     53|                        else
 4098|     53|                          continue;
 4099|    109|                      else
 4100|    109|                        continue;
 4101|    509|                  else
 4102|    509|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4102:24): [True: 284, False: 225]
  ------------------
 4103|    284|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4103:26): [True: 193, False: 91]
  ------------------
 4104|    193|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4104:28): [True: 126, False: 67]
  ------------------
 4105|    126|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4105:30): [True: 90, False: 36]
  ------------------
 4106|     90|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4106:32): [True: 62, False: 28]
  ------------------
 4107|     62|                            {}
 4108|     28|                            else
 4109|     28|                              continue;
 4110|     36|                          else
 4111|     36|                            continue;
 4112|     67|                        else
 4113|     67|                          continue;
 4114|     91|                      else
 4115|     91|                        continue;
 4116|    225|                    else
 4117|    225|                      continue;
 4118|  1.03k|                else
 4119|  1.03k|                  if(p[pixel[2]] > cb)
  ------------------
  |  Branch (4119:22): [True: 512, False: 525]
  ------------------
 4120|    512|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4120:24): [True: 288, False: 224]
  ------------------
 4121|    288|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4121:26): [True: 182, False: 106]
  ------------------
 4122|    182|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4122:28): [True: 118, False: 64]
  ------------------
 4123|    118|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4123:30): [True: 77, False: 41]
  ------------------
 4124|     77|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4124:32): [True: 53, False: 24]
  ------------------
 4125|     53|                            {}
 4126|     24|                            else
 4127|     24|                              continue;
 4128|     41|                          else
 4129|     41|                            continue;
 4130|     64|                        else
 4131|     64|                          continue;
 4132|    106|                      else
 4133|    106|                        continue;
 4134|    224|                    else
 4135|    224|                      continue;
 4136|    525|                  else
 4137|    525|                    continue;
 4138|  2.19k|              else
 4139|  2.19k|                continue;
 4140|  4.63k|            else
 4141|  4.63k|              continue;
 4142|  18.1k|          else if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4142:19): [True: 9.93k, False: 8.24k]
  ------------------
 4143|  9.93k|            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4143:16): [True: 5.13k, False: 4.79k]
  ------------------
 4144|  5.13k|              if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4144:18): [True: 2.97k, False: 2.15k]
  ------------------
 4145|  2.97k|                if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4145:20): [True: 1.88k, False: 1.09k]
  ------------------
 4146|  1.88k|                  if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4146:22): [True: 1.22k, False: 658]
  ------------------
 4147|  1.22k|                    if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4147:24): [True: 872, False: 354]
  ------------------
 4148|    872|                      if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4148:26): [True: 680, False: 192]
  ------------------
 4149|    680|                        if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (4149:28): [True: 528, False: 152]
  ------------------
 4150|    528|                        {}
 4151|    152|                        else
 4152|    152|                          if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4152:30): [True: 93, False: 59]
  ------------------
 4153|     93|                            if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4153:32): [True: 67, False: 26]
  ------------------
 4154|     67|                            {}
 4155|     26|                            else
 4156|     26|                              continue;
 4157|     59|                          else
 4158|     59|                            continue;
 4159|    192|                      else
 4160|    192|                        if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4160:28): [True: 125, False: 67]
  ------------------
 4161|    125|                          if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4161:30): [True: 90, False: 35]
  ------------------
 4162|     90|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4162:32): [True: 66, False: 24]
  ------------------
 4163|     66|                            {}
 4164|     24|                            else
 4165|     24|                              continue;
 4166|     35|                          else
 4167|     35|                            continue;
 4168|     67|                        else
 4169|     67|                          continue;
 4170|    354|                    else
 4171|    354|                      if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4171:26): [True: 220, False: 134]
  ------------------
 4172|    220|                        if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4172:28): [True: 145, False: 75]
  ------------------
 4173|    145|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4173:30): [True: 102, False: 43]
  ------------------
 4174|    102|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4174:32): [True: 73, False: 29]
  ------------------
 4175|     73|                            {}
 4176|     29|                            else
 4177|     29|                              continue;
 4178|     43|                          else
 4179|     43|                            continue;
 4180|     75|                        else
 4181|     75|                          continue;
 4182|    134|                      else
 4183|    134|                        continue;
 4184|    658|                  else
 4185|    658|                    if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4185:24): [True: 386, False: 272]
  ------------------
 4186|    386|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4186:26): [True: 247, False: 139]
  ------------------
 4187|    247|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4187:28): [True: 169, False: 78]
  ------------------
 4188|    169|                          if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4188:30): [True: 119, False: 50]
  ------------------
 4189|    119|                            if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4189:32): [True: 87, False: 32]
  ------------------
 4190|     87|                            {}
 4191|     32|                            else
 4192|     32|                              continue;
 4193|     50|                          else
 4194|     50|                            continue;
 4195|     78|                        else
 4196|     78|                          continue;
 4197|    139|                      else
 4198|    139|                        continue;
 4199|    272|                    else
 4200|    272|                      continue;
 4201|  1.09k|                else
 4202|  1.09k|                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4202:22): [True: 577, False: 514]
  ------------------
 4203|    577|                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4203:24): [True: 348, False: 229]
  ------------------
 4204|    348|                      if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4204:26): [True: 226, False: 122]
  ------------------
 4205|    226|                        if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4205:28): [True: 167, False: 59]
  ------------------
 4206|    167|                          if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4206:30): [True: 120, False: 47]
  ------------------
 4207|    120|                            if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4207:32): [True: 81, False: 39]
  ------------------
 4208|     81|                            {}
 4209|     39|                            else
 4210|     39|                              continue;
 4211|     47|                          else
 4212|     47|                            continue;
 4213|     59|                        else
 4214|     59|                          continue;
 4215|    122|                      else
 4216|    122|                        continue;
 4217|    229|                    else
 4218|    229|                      continue;
 4219|    514|                  else
 4220|    514|                    continue;
 4221|  2.15k|              else
 4222|  2.15k|                continue;
 4223|  4.79k|            else
 4224|  4.79k|              continue;
 4225|  8.24k|          else
 4226|  8.24k|            continue;
 4227|  64.2k|        else
 4228|  64.2k|          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4228:14): [True: 27.0k, False: 37.2k]
  ------------------
 4229|  27.0k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4229:16): [True: 15.7k, False: 11.2k]
  ------------------
 4230|  15.7k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4230:18): [True: 9.68k, False: 6.11k]
  ------------------
 4231|  9.68k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4231:20): [True: 6.65k, False: 3.02k]
  ------------------
 4232|  6.65k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4232:22): [True: 4.90k, False: 1.75k]
  ------------------
 4233|  4.90k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4233:24): [True: 3.69k, False: 1.21k]
  ------------------
 4234|  3.69k|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4234:26): [True: 2.85k, False: 841]
  ------------------
 4235|  2.85k|                        if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4235:28): [True: 2.34k, False: 508]
  ------------------
 4236|  2.34k|                        {}
 4237|    508|                        else
 4238|    508|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4238:30): [True: 370, False: 138]
  ------------------
 4239|    370|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4239:32): [True: 281, False: 89]
  ------------------
 4240|    281|                            {}
 4241|     89|                            else
 4242|     89|                              continue;
 4243|    138|                          else
 4244|    138|                            continue;
 4245|    841|                      else
 4246|    841|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4246:28): [True: 594, False: 247]
  ------------------
 4247|    594|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4247:30): [True: 407, False: 187]
  ------------------
 4248|    407|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4248:32): [True: 315, False: 92]
  ------------------
 4249|    315|                            {}
 4250|     92|                            else
 4251|     92|                              continue;
 4252|    187|                          else
 4253|    187|                            continue;
 4254|    247|                        else
 4255|    247|                          continue;
 4256|  1.21k|                    else
 4257|  1.21k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4257:26): [True: 837, False: 375]
  ------------------
 4258|    837|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4258:28): [True: 610, False: 227]
  ------------------
 4259|    610|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4259:30): [True: 428, False: 182]
  ------------------
 4260|    428|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4260:32): [True: 320, False: 108]
  ------------------
 4261|    320|                            {}
 4262|    108|                            else
 4263|    108|                              continue;
 4264|    182|                          else
 4265|    182|                            continue;
 4266|    227|                        else
 4267|    227|                          continue;
 4268|    375|                      else
 4269|    375|                        continue;
 4270|  1.75k|                  else
 4271|  1.75k|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4271:24): [True: 1.14k, False: 606]
  ------------------
 4272|  1.14k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4272:26): [True: 768, False: 378]
  ------------------
 4273|    768|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4273:28): [True: 544, False: 224]
  ------------------
 4274|    544|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4274:30): [True: 408, False: 136]
  ------------------
 4275|    408|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4275:32): [True: 313, False: 95]
  ------------------
 4276|    313|                            {}
 4277|     95|                            else
 4278|     95|                              continue;
 4279|    136|                          else
 4280|    136|                            continue;
 4281|    224|                        else
 4282|    224|                          continue;
 4283|    378|                      else
 4284|    378|                        continue;
 4285|    606|                    else
 4286|    606|                      continue;
 4287|  3.02k|                else
 4288|  3.02k|                  if(p[pixel[2]] > cb)
  ------------------
  |  Branch (4288:22): [True: 1.70k, False: 1.32k]
  ------------------
 4289|  1.70k|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4289:24): [True: 1.11k, False: 586]
  ------------------
 4290|  1.11k|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4290:26): [True: 785, False: 329]
  ------------------
 4291|    785|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4291:28): [True: 571, False: 214]
  ------------------
 4292|    571|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4292:30): [True: 416, False: 155]
  ------------------
 4293|    416|                            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4293:32): [True: 306, False: 110]
  ------------------
 4294|    306|                            {}
 4295|    110|                            else
 4296|    110|                              continue;
 4297|    155|                          else
 4298|    155|                            continue;
 4299|    214|                        else
 4300|    214|                          continue;
 4301|    329|                      else
 4302|    329|                        continue;
 4303|    586|                    else
 4304|    586|                      continue;
 4305|  1.32k|                  else
 4306|  1.32k|                    continue;
 4307|  6.11k|              else
 4308|  6.11k|                continue;
 4309|  11.2k|            else
 4310|  11.2k|              continue;
 4311|  37.2k|          else if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4311:19): [True: 10.0k, False: 27.2k]
  ------------------
 4312|  10.0k|            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4312:16): [True: 3.85k, False: 6.16k]
  ------------------
 4313|  3.85k|              if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4313:18): [True: 1.74k, False: 2.10k]
  ------------------
 4314|  1.74k|                if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4314:20): [True: 885, False: 863]
  ------------------
 4315|    885|                  if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4315:22): [True: 513, False: 372]
  ------------------
 4316|    513|                    if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4316:24): [True: 326, False: 187]
  ------------------
 4317|    326|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4317:26): [True: 224, False: 102]
  ------------------
 4318|    224|                        if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4318:28): [True: 165, False: 59]
  ------------------
 4319|    165|                          if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (4319:30): [True: 118, False: 47]
  ------------------
 4320|    118|                          {}
 4321|     47|                          else
 4322|     47|                            if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4322:32): [True: 30, False: 17]
  ------------------
 4323|     30|                            {}
 4324|     17|                            else
 4325|     17|                              continue;
 4326|     59|                        else
 4327|     59|                          if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4327:30): [True: 39, False: 20]
  ------------------
 4328|     39|                            if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4328:32): [True: 33, False: 6]
  ------------------
 4329|     33|                            {}
 4330|      6|                            else
 4331|      6|                              continue;
 4332|     20|                          else
 4333|     20|                            continue;
 4334|    102|                      else
 4335|    102|                        if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4335:28): [True: 64, False: 38]
  ------------------
 4336|     64|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4336:30): [True: 47, False: 17]
  ------------------
 4337|     47|                            if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4337:32): [True: 27, False: 20]
  ------------------
 4338|     27|                            {}
 4339|     20|                            else
 4340|     20|                              continue;
 4341|     17|                          else
 4342|     17|                            continue;
 4343|     38|                        else
 4344|     38|                          continue;
 4345|    187|                    else
 4346|    187|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4346:26): [True: 95, False: 92]
  ------------------
 4347|     95|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4347:28): [True: 52, False: 43]
  ------------------
 4348|     52|                          if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4348:30): [True: 32, False: 20]
  ------------------
 4349|     32|                            if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4349:32): [True: 23, False: 9]
  ------------------
 4350|     23|                            {}
 4351|      9|                            else
 4352|      9|                              continue;
 4353|     20|                          else
 4354|     20|                            continue;
 4355|     43|                        else
 4356|     43|                          continue;
 4357|     92|                      else
 4358|     92|                        continue;
 4359|    372|                  else
 4360|    372|                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4360:24): [True: 189, False: 183]
  ------------------
 4361|    189|                      if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4361:26): [True: 105, False: 84]
  ------------------
 4362|    105|                        if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4362:28): [True: 58, False: 47]
  ------------------
 4363|     58|                          if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4363:30): [True: 42, False: 16]
  ------------------
 4364|     42|                            if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4364:32): [True: 31, False: 11]
  ------------------
 4365|     31|                            {}
 4366|     11|                            else
 4367|     11|                              continue;
 4368|     16|                          else
 4369|     16|                            continue;
 4370|     47|                        else
 4371|     47|                          continue;
 4372|     84|                      else
 4373|     84|                        continue;
 4374|    183|                    else
 4375|    183|                      continue;
 4376|    863|                else
 4377|    863|                  continue;
 4378|  2.10k|              else
 4379|  2.10k|                continue;
 4380|  6.16k|            else
 4381|  6.16k|              continue;
 4382|  27.2k|          else
 4383|  27.2k|            continue;
 4384|   524k|      else if(p[pixel[0]] < c_b)
  ------------------
  |  Branch (4384:15): [True: 215k, False: 309k]
  ------------------
 4385|   215k|        if(p[pixel[1]] > cb)
  ------------------
  |  Branch (4385:12): [True: 27.1k, False: 188k]
  ------------------
 4386|  27.1k|          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4386:14): [True: 9.55k, False: 17.5k]
  ------------------
 4387|  9.55k|            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4387:16): [True: 4.72k, False: 4.83k]
  ------------------
 4388|  4.72k|              if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4388:18): [True: 2.64k, False: 2.07k]
  ------------------
 4389|  2.64k|                if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4389:20): [True: 1.62k, False: 1.02k]
  ------------------
 4390|  1.62k|                  if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4390:22): [True: 1.07k, False: 553]
  ------------------
 4391|  1.07k|                    if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4391:24): [True: 739, False: 333]
  ------------------
 4392|    739|                      if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4392:26): [True: 523, False: 216]
  ------------------
 4393|    523|                        if(p[pixel[2]] > cb)
  ------------------
  |  Branch (4393:28): [True: 387, False: 136]
  ------------------
 4394|    387|                        {}
 4395|    136|                        else
 4396|    136|                          if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4396:30): [True: 94, False: 42]
  ------------------
 4397|     94|                            if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4397:32): [True: 78, False: 16]
  ------------------
 4398|     78|                            {}
 4399|     16|                            else
 4400|     16|                              continue;
 4401|     42|                          else
 4402|     42|                            continue;
 4403|    216|                      else
 4404|    216|                        if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4404:28): [True: 136, False: 80]
  ------------------
 4405|    136|                          if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4405:30): [True: 88, False: 48]
  ------------------
 4406|     88|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4406:32): [True: 57, False: 31]
  ------------------
 4407|     57|                            {}
 4408|     31|                            else
 4409|     31|                              continue;
 4410|     48|                          else
 4411|     48|                            continue;
 4412|     80|                        else
 4413|     80|                          continue;
 4414|    333|                    else
 4415|    333|                      if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4415:26): [True: 212, False: 121]
  ------------------
 4416|    212|                        if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4416:28): [True: 148, False: 64]
  ------------------
 4417|    148|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4417:30): [True: 108, False: 40]
  ------------------
 4418|    108|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4418:32): [True: 70, False: 38]
  ------------------
 4419|     70|                            {}
 4420|     38|                            else
 4421|     38|                              continue;
 4422|     40|                          else
 4423|     40|                            continue;
 4424|     64|                        else
 4425|     64|                          continue;
 4426|    121|                      else
 4427|    121|                        continue;
 4428|    553|                  else
 4429|    553|                    if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4429:24): [True: 339, False: 214]
  ------------------
 4430|    339|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4430:26): [True: 207, False: 132]
  ------------------
 4431|    207|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4431:28): [True: 140, False: 67]
  ------------------
 4432|    140|                          if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4432:30): [True: 99, False: 41]
  ------------------
 4433|     99|                            if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4433:32): [True: 65, False: 34]
  ------------------
 4434|     65|                            {}
 4435|     34|                            else
 4436|     34|                              continue;
 4437|     41|                          else
 4438|     41|                            continue;
 4439|     67|                        else
 4440|     67|                          continue;
 4441|    132|                      else
 4442|    132|                        continue;
 4443|    214|                    else
 4444|    214|                      continue;
 4445|  1.02k|                else
 4446|  1.02k|                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4446:22): [True: 535, False: 485]
  ------------------
 4447|    535|                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4447:24): [True: 306, False: 229]
  ------------------
 4448|    306|                      if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4448:26): [True: 187, False: 119]
  ------------------
 4449|    187|                        if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4449:28): [True: 117, False: 70]
  ------------------
 4450|    117|                          if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4450:30): [True: 87, False: 30]
  ------------------
 4451|     87|                            if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4451:32): [True: 56, False: 31]
  ------------------
 4452|     56|                            {}
 4453|     31|                            else
 4454|     31|                              continue;
 4455|     30|                          else
 4456|     30|                            continue;
 4457|     70|                        else
 4458|     70|                          continue;
 4459|    119|                      else
 4460|    119|                        continue;
 4461|    229|                    else
 4462|    229|                      continue;
 4463|    485|                  else
 4464|    485|                    continue;
 4465|  2.07k|              else
 4466|  2.07k|                continue;
 4467|  4.83k|            else
 4468|  4.83k|              continue;
 4469|  17.5k|          else if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4469:19): [True: 9.54k, False: 8.01k]
  ------------------
 4470|  9.54k|            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4470:16): [True: 4.89k, False: 4.64k]
  ------------------
 4471|  4.89k|              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4471:18): [True: 2.74k, False: 2.15k]
  ------------------
 4472|  2.74k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4472:20): [True: 1.66k, False: 1.08k]
  ------------------
 4473|  1.66k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4473:22): [True: 1.07k, False: 583]
  ------------------
 4474|  1.07k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4474:24): [True: 777, False: 301]
  ------------------
 4475|    777|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4475:26): [True: 539, False: 238]
  ------------------
 4476|    539|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4476:28): [True: 431, False: 108]
  ------------------
 4477|    431|                        {}
 4478|    108|                        else
 4479|    108|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4479:30): [True: 81, False: 27]
  ------------------
 4480|     81|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4480:32): [True: 60, False: 21]
  ------------------
 4481|     60|                            {}
 4482|     21|                            else
 4483|     21|                              continue;
 4484|     27|                          else
 4485|     27|                            continue;
 4486|    238|                      else
 4487|    238|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4487:28): [True: 157, False: 81]
  ------------------
 4488|    157|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4488:30): [True: 123, False: 34]
  ------------------
 4489|    123|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4489:32): [True: 84, False: 39]
  ------------------
 4490|     84|                            {}
 4491|     39|                            else
 4492|     39|                              continue;
 4493|     34|                          else
 4494|     34|                            continue;
 4495|     81|                        else
 4496|     81|                          continue;
 4497|    301|                    else
 4498|    301|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4498:26): [True: 191, False: 110]
  ------------------
 4499|    191|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4499:28): [True: 128, False: 63]
  ------------------
 4500|    128|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4500:30): [True: 91, False: 37]
  ------------------
 4501|     91|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4501:32): [True: 76, False: 15]
  ------------------
 4502|     76|                            {}
 4503|     15|                            else
 4504|     15|                              continue;
 4505|     37|                          else
 4506|     37|                            continue;
 4507|     63|                        else
 4508|     63|                          continue;
 4509|    110|                      else
 4510|    110|                        continue;
 4511|    583|                  else
 4512|    583|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4512:24): [True: 344, False: 239]
  ------------------
 4513|    344|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4513:26): [True: 200, False: 144]
  ------------------
 4514|    200|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4514:28): [True: 130, False: 70]
  ------------------
 4515|    130|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4515:30): [True: 94, False: 36]
  ------------------
 4516|     94|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4516:32): [True: 72, False: 22]
  ------------------
 4517|     72|                            {}
 4518|     22|                            else
 4519|     22|                              continue;
 4520|     36|                          else
 4521|     36|                            continue;
 4522|     70|                        else
 4523|     70|                          continue;
 4524|    144|                      else
 4525|    144|                        continue;
 4526|    239|                    else
 4527|    239|                      continue;
 4528|  1.08k|                else
 4529|  1.08k|                  if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (4529:22): [True: 556, False: 527]
  ------------------
 4530|    556|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4530:24): [True: 343, False: 213]
  ------------------
 4531|    343|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4531:26): [True: 231, False: 112]
  ------------------
 4532|    231|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4532:28): [True: 157, False: 74]
  ------------------
 4533|    157|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4533:30): [True: 102, False: 55]
  ------------------
 4534|    102|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4534:32): [True: 62, False: 40]
  ------------------
 4535|     62|                            {}
 4536|     40|                            else
 4537|     40|                              continue;
 4538|     55|                          else
 4539|     55|                            continue;
 4540|     74|                        else
 4541|     74|                          continue;
 4542|    112|                      else
 4543|    112|                        continue;
 4544|    213|                    else
 4545|    213|                      continue;
 4546|    527|                  else
 4547|    527|                    continue;
 4548|  2.15k|              else
 4549|  2.15k|                continue;
 4550|  4.64k|            else
 4551|  4.64k|              continue;
 4552|  8.01k|          else
 4553|  8.01k|            continue;
 4554|   188k|        else if(p[pixel[1]] < c_b)
  ------------------
  |  Branch (4554:17): [True: 124k, False: 63.9k]
  ------------------
 4555|   124k|          if(p[pixel[2]] > cb)
  ------------------
  |  Branch (4555:14): [True: 12.5k, False: 112k]
  ------------------
 4556|  12.5k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4556:16): [True: 3.34k, False: 9.20k]
  ------------------
 4557|  3.34k|              if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4557:18): [True: 1.18k, False: 2.16k]
  ------------------
 4558|  1.18k|                if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4558:20): [True: 634, False: 549]
  ------------------
 4559|    634|                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4559:22): [True: 317, False: 317]
  ------------------
 4560|    317|                    if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4560:24): [True: 184, False: 133]
  ------------------
 4561|    184|                      if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4561:26): [True: 113, False: 71]
  ------------------
 4562|    113|                        if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4562:28): [True: 67, False: 46]
  ------------------
 4563|     67|                          if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4563:30): [True: 51, False: 16]
  ------------------
 4564|     51|                          {}
 4565|     16|                          else
 4566|     16|                            if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4566:32): [True: 9, False: 7]
  ------------------
 4567|      9|                              if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4567:34): [True: 5, False: 4]
  ------------------
 4568|      5|                              {}
 4569|      4|                              else
 4570|      4|                                continue;
 4571|      7|                            else
 4572|      7|                              continue;
 4573|     46|                        else
 4574|     46|                          if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4574:30): [True: 28, False: 18]
  ------------------
 4575|     28|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4575:32): [True: 22, False: 6]
  ------------------
 4576|     22|                              if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4576:34): [True: 14, False: 8]
  ------------------
 4577|     14|                              {}
 4578|      8|                              else
 4579|      8|                                continue;
 4580|      6|                            else
 4581|      6|                              continue;
 4582|     18|                          else
 4583|     18|                            continue;
 4584|     71|                      else
 4585|     71|                        if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4585:28): [True: 43, False: 28]
  ------------------
 4586|     43|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4586:30): [True: 31, False: 12]
  ------------------
 4587|     31|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4587:32): [True: 23, False: 8]
  ------------------
 4588|     23|                              if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4588:34): [True: 13, False: 10]
  ------------------
 4589|     13|                              {}
 4590|     10|                              else
 4591|     10|                                continue;
 4592|      8|                            else
 4593|      8|                              continue;
 4594|     12|                          else
 4595|     12|                            continue;
 4596|     28|                        else
 4597|     28|                          continue;
 4598|    133|                    else
 4599|    133|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4599:26): [True: 64, False: 69]
  ------------------
 4600|     64|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4600:28): [True: 40, False: 24]
  ------------------
 4601|     40|                          if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4601:30): [True: 29, False: 11]
  ------------------
 4602|     29|                            if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4602:32): [True: 17, False: 12]
  ------------------
 4603|     17|                              if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4603:34): [True: 9, False: 8]
  ------------------
 4604|      9|                              {}
 4605|      8|                              else
 4606|      8|                                continue;
 4607|     12|                            else
 4608|     12|                              continue;
 4609|     11|                          else
 4610|     11|                            continue;
 4611|     24|                        else
 4612|     24|                          continue;
 4613|     69|                      else
 4614|     69|                        continue;
 4615|    317|                  else
 4616|    317|                    continue;
 4617|    549|                else
 4618|    549|                  continue;
 4619|  2.16k|              else
 4620|  2.16k|                continue;
 4621|  9.20k|            else if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4621:21): [True: 5.71k, False: 3.49k]
  ------------------
 4622|  5.71k|              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4622:18): [True: 3.01k, False: 2.70k]
  ------------------
 4623|  3.01k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4623:20): [True: 1.85k, False: 1.15k]
  ------------------
 4624|  1.85k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4624:22): [True: 1.25k, False: 602]
  ------------------
 4625|  1.25k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4625:24): [True: 874, False: 383]
  ------------------
 4626|    874|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4626:26): [True: 629, False: 245]
  ------------------
 4627|    629|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4627:28): [True: 475, False: 154]
  ------------------
 4628|    475|                        {}
 4629|    154|                        else
 4630|    154|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4630:30): [True: 113, False: 41]
  ------------------
 4631|    113|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4631:32): [True: 80, False: 33]
  ------------------
 4632|     80|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4632:34): [True: 65, False: 15]
  ------------------
 4633|     65|                              {}
 4634|     15|                              else
 4635|     15|                                continue;
 4636|     33|                            else
 4637|     33|                              continue;
 4638|     41|                          else
 4639|     41|                            continue;
 4640|    245|                      else
 4641|    245|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4641:28): [True: 167, False: 78]
  ------------------
 4642|    167|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4642:30): [True: 101, False: 66]
  ------------------
 4643|    101|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4643:32): [True: 74, False: 27]
  ------------------
 4644|     74|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4644:34): [True: 59, False: 15]
  ------------------
 4645|     59|                              {}
 4646|     15|                              else
 4647|     15|                                continue;
 4648|     27|                            else
 4649|     27|                              continue;
 4650|     66|                          else
 4651|     66|                            continue;
 4652|     78|                        else
 4653|     78|                          continue;
 4654|    383|                    else
 4655|    383|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4655:26): [True: 224, False: 159]
  ------------------
 4656|    224|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4656:28): [True: 150, False: 74]
  ------------------
 4657|    150|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4657:30): [True: 85, False: 65]
  ------------------
 4658|     85|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4658:32): [True: 61, False: 24]
  ------------------
 4659|     61|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4659:34): [True: 48, False: 13]
  ------------------
 4660|     48|                              {}
 4661|     13|                              else
 4662|     13|                                continue;
 4663|     24|                            else
 4664|     24|                              continue;
 4665|     65|                          else
 4666|     65|                            continue;
 4667|     74|                        else
 4668|     74|                          continue;
 4669|    159|                      else
 4670|    159|                        continue;
 4671|    602|                  else
 4672|    602|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4672:24): [True: 356, False: 246]
  ------------------
 4673|    356|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4673:26): [True: 239, False: 117]
  ------------------
 4674|    239|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4674:28): [True: 157, False: 82]
  ------------------
 4675|    157|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4675:30): [True: 109, False: 48]
  ------------------
 4676|    109|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4676:32): [True: 81, False: 28]
  ------------------
 4677|     81|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4677:34): [True: 55, False: 26]
  ------------------
 4678|     55|                              {}
 4679|     26|                              else
 4680|     26|                                continue;
 4681|     28|                            else
 4682|     28|                              continue;
 4683|     48|                          else
 4684|     48|                            continue;
 4685|     82|                        else
 4686|     82|                          continue;
 4687|    117|                      else
 4688|    117|                        continue;
 4689|    246|                    else
 4690|    246|                      continue;
 4691|  1.15k|                else
 4692|  1.15k|                  continue;
 4693|  2.70k|              else
 4694|  2.70k|                continue;
 4695|  3.49k|            else
 4696|  3.49k|              continue;
 4697|   112k|          else if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (4697:19): [True: 80.3k, False: 31.6k]
  ------------------
 4698|  80.3k|            if(p[pixel[3]] > cb)
  ------------------
  |  Branch (4698:16): [True: 5.95k, False: 74.4k]
  ------------------
 4699|  5.95k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4699:18): [True: 1.16k, False: 4.78k]
  ------------------
 4700|  1.16k|                if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4700:20): [True: 356, False: 813]
  ------------------
 4701|    356|                  if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4701:22): [True: 164, False: 192]
  ------------------
 4702|    164|                    if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4702:24): [True: 88, False: 76]
  ------------------
 4703|     88|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4703:26): [True: 43, False: 45]
  ------------------
 4704|     43|                        if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4704:28): [True: 18, False: 25]
  ------------------
 4705|     18|                          if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4705:30): [True: 10, False: 8]
  ------------------
 4706|     10|                            if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4706:32): [True: 9, False: 1]
  ------------------
 4707|      9|                            {}
 4708|      1|                            else
 4709|      1|                              if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4709:34): [True: 1, False: 0]
  ------------------
 4710|      1|                                if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4710:36): [True: 1, False: 0]
  ------------------
 4711|      1|                                {}
 4712|      0|                                else
 4713|      0|                                  continue;
 4714|      0|                              else
 4715|      0|                                continue;
 4716|      8|                          else
 4717|      8|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4717:32): [True: 3, False: 5]
  ------------------
 4718|      3|                              if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4718:34): [True: 2, False: 1]
  ------------------
 4719|      2|                                if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4719:36): [True: 1, False: 1]
  ------------------
 4720|      1|                                {}
 4721|      1|                                else
 4722|      1|                                  continue;
 4723|      1|                              else
 4724|      1|                                continue;
 4725|      5|                            else
 4726|      5|                              continue;
 4727|     25|                        else
 4728|     25|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4728:30): [True: 13, False: 12]
  ------------------
 4729|     13|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4729:32): [True: 7, False: 6]
  ------------------
 4730|      7|                              if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4730:34): [True: 0, False: 7]
  ------------------
 4731|      0|                                if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4731:36): [True: 0, False: 0]
  ------------------
 4732|      0|                                {}
 4733|      0|                                else
 4734|      0|                                  continue;
 4735|      7|                              else
 4736|      7|                                continue;
 4737|      6|                            else
 4738|      6|                              continue;
 4739|     12|                          else
 4740|     12|                            continue;
 4741|     45|                      else
 4742|     45|                        continue;
 4743|     76|                    else
 4744|     76|                      continue;
 4745|    192|                  else
 4746|    192|                    continue;
 4747|    813|                else
 4748|    813|                  continue;
 4749|  4.78k|              else if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4749:23): [True: 3.20k, False: 1.57k]
  ------------------
 4750|  3.20k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4750:20): [True: 1.96k, False: 1.24k]
  ------------------
 4751|  1.96k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4751:22): [True: 1.29k, False: 672]
  ------------------
 4752|  1.29k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4752:24): [True: 905, False: 389]
  ------------------
 4753|    905|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4753:26): [True: 660, False: 245]
  ------------------
 4754|    660|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4754:28): [True: 490, False: 170]
  ------------------
 4755|    490|                        {}
 4756|    170|                        else
 4757|    170|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4757:30): [True: 111, False: 59]
  ------------------
 4758|    111|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4758:32): [True: 70, False: 41]
  ------------------
 4759|     70|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4759:34): [True: 55, False: 15]
  ------------------
 4760|     55|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4760:36): [True: 37, False: 18]
  ------------------
 4761|     37|                                {}
 4762|     18|                                else
 4763|     18|                                  continue;
 4764|     15|                              else
 4765|     15|                                continue;
 4766|     41|                            else
 4767|     41|                              continue;
 4768|     59|                          else
 4769|     59|                            continue;
 4770|    245|                      else
 4771|    245|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4771:28): [True: 155, False: 90]
  ------------------
 4772|    155|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4772:30): [True: 102, False: 53]
  ------------------
 4773|    102|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4773:32): [True: 72, False: 30]
  ------------------
 4774|     72|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4774:34): [True: 57, False: 15]
  ------------------
 4775|     57|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4775:36): [True: 34, False: 23]
  ------------------
 4776|     34|                                {}
 4777|     23|                                else
 4778|     23|                                  continue;
 4779|     15|                              else
 4780|     15|                                continue;
 4781|     30|                            else
 4782|     30|                              continue;
 4783|     53|                          else
 4784|     53|                            continue;
 4785|     90|                        else
 4786|     90|                          continue;
 4787|    389|                    else
 4788|    389|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4788:26): [True: 199, False: 190]
  ------------------
 4789|    199|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4789:28): [True: 153, False: 46]
  ------------------
 4790|    153|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4790:30): [True: 102, False: 51]
  ------------------
 4791|    102|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4791:32): [True: 77, False: 25]
  ------------------
 4792|     77|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4792:34): [True: 58, False: 19]
  ------------------
 4793|     58|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4793:36): [True: 40, False: 18]
  ------------------
 4794|     40|                                {}
 4795|     18|                                else
 4796|     18|                                  continue;
 4797|     19|                              else
 4798|     19|                                continue;
 4799|     25|                            else
 4800|     25|                              continue;
 4801|     51|                          else
 4802|     51|                            continue;
 4803|     46|                        else
 4804|     46|                          continue;
 4805|    190|                      else
 4806|    190|                        continue;
 4807|    672|                  else
 4808|    672|                    continue;
 4809|  1.24k|                else
 4810|  1.24k|                  continue;
 4811|  1.57k|              else
 4812|  1.57k|                continue;
 4813|  74.4k|            else if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (4813:21): [True: 58.0k, False: 16.3k]
  ------------------
 4814|  58.0k|              if(p[pixel[4]] > cb)
  ------------------
  |  Branch (4814:18): [True: 3.04k, False: 55.0k]
  ------------------
 4815|  3.04k|                if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4815:20): [True: 502, False: 2.54k]
  ------------------
 4816|    502|                  if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4816:22): [True: 118, False: 384]
  ------------------
 4817|    118|                    if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4817:24): [True: 41, False: 77]
  ------------------
 4818|     41|                      if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4818:26): [True: 16, False: 25]
  ------------------
 4819|     16|                        if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4819:28): [True: 4, False: 12]
  ------------------
 4820|      4|                          if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4820:30): [True: 0, False: 4]
  ------------------
 4821|      0|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4821:32): [True: 0, False: 0]
  ------------------
 4822|      0|                              if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4822:34): [True: 0, False: 0]
  ------------------
 4823|      0|                                if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4823:36): [True: 0, False: 0]
  ------------------
 4824|      0|                                {}
 4825|      0|                                else
 4826|      0|                                  if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4826:38): [True: 0, False: 0]
  ------------------
 4827|      0|                                  {}
 4828|      0|                                  else
 4829|      0|                                    continue;
 4830|      0|                              else
 4831|      0|                                if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4831:36): [True: 0, False: 0]
  ------------------
 4832|      0|                                  if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4832:38): [True: 0, False: 0]
  ------------------
 4833|      0|                                  {}
 4834|      0|                                  else
 4835|      0|                                    continue;
 4836|      0|                                else
 4837|      0|                                  continue;
 4838|      0|                            else
 4839|      0|                              continue;
 4840|      4|                          else
 4841|      4|                            continue;
 4842|     12|                        else
 4843|     12|                          continue;
 4844|     25|                      else
 4845|     25|                        continue;
 4846|     77|                    else
 4847|     77|                      continue;
 4848|    384|                  else
 4849|    384|                    continue;
 4850|  2.54k|                else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (4850:25): [True: 1.87k, False: 662]
  ------------------
 4851|  1.87k|                  if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4851:22): [True: 275, False: 1.60k]
  ------------------
 4852|    275|                    if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4852:24): [True: 59, False: 216]
  ------------------
 4853|     59|                      if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4853:26): [True: 19, False: 40]
  ------------------
 4854|     19|                        if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4854:28): [True: 5, False: 14]
  ------------------
 4855|      5|                          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4855:30): [True: 3, False: 2]
  ------------------
 4856|      3|                            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4856:32): [True: 1, False: 2]
  ------------------
 4857|      1|                              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4857:34): [True: 0, False: 1]
  ------------------
 4858|      0|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4858:36): [True: 0, False: 0]
  ------------------
 4859|      0|                                {}
 4860|      0|                                else
 4861|      0|                                  continue;
 4862|      1|                              else
 4863|      1|                                continue;
 4864|      2|                            else
 4865|      2|                              continue;
 4866|      2|                          else
 4867|      2|                            continue;
 4868|     14|                        else
 4869|     14|                          continue;
 4870|     40|                      else
 4871|     40|                        continue;
 4872|    216|                    else
 4873|    216|                      continue;
 4874|  1.60k|                  else if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (4874:27): [True: 1.20k, False: 396]
  ------------------
 4875|  1.20k|                    if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (4875:24): [True: 876, False: 332]
  ------------------
 4876|    876|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4876:26): [True: 620, False: 256]
  ------------------
 4877|    620|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (4877:28): [True: 469, False: 151]
  ------------------
 4878|    469|                        {}
 4879|    151|                        else
 4880|    151|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4880:30): [True: 106, False: 45]
  ------------------
 4881|    106|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4881:32): [True: 75, False: 31]
  ------------------
 4882|     75|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4882:34): [True: 57, False: 18]
  ------------------
 4883|     57|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4883:36): [True: 39, False: 18]
  ------------------
 4884|     39|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4884:38): [True: 25, False: 14]
  ------------------
 4885|     25|                                  {}
 4886|     14|                                  else
 4887|     14|                                    continue;
 4888|     18|                                else
 4889|     18|                                  continue;
 4890|     18|                              else
 4891|     18|                                continue;
 4892|     31|                            else
 4893|     31|                              continue;
 4894|     45|                          else
 4895|     45|                            continue;
 4896|    256|                      else
 4897|    256|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (4897:28): [True: 144, False: 112]
  ------------------
 4898|    144|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (4898:30): [True: 101, False: 43]
  ------------------
 4899|    101|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (4899:32): [True: 76, False: 25]
  ------------------
 4900|     76|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (4900:34): [True: 53, False: 23]
  ------------------
 4901|     53|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (4901:36): [True: 40, False: 13]
  ------------------
 4902|     40|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (4902:38): [True: 24, False: 16]
  ------------------
 4903|     24|                                  {}
 4904|     16|                                  else
 4905|     16|                                    continue;
 4906|     13|                                else
 4907|     13|                                  continue;
 4908|     23|                              else
 4909|     23|                                continue;
 4910|     25|                            else
 4911|     25|                              continue;
 4912|     43|                          else
 4913|     43|                            continue;
 4914|    112|                        else
 4915|    112|                          continue;
 4916|    332|                    else
 4917|    332|                      continue;
 4918|    396|                  else
 4919|    396|                    continue;
 4920|    662|                else
 4921|    662|                  if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4921:22): [True: 128, False: 534]
  ------------------
 4922|    128|                    if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4922:24): [True: 38, False: 90]
  ------------------
 4923|     38|                      if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4923:26): [True: 13, False: 25]
  ------------------
 4924|     13|                        if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4924:28): [True: 4, False: 9]
  ------------------
 4925|      4|                          if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4925:30): [True: 3, False: 1]
  ------------------
 4926|      3|                            if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4926:32): [True: 2, False: 1]
  ------------------
 4927|      2|                              if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4927:34): [True: 1, False: 1]
  ------------------
 4928|      1|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4928:36): [True: 1, False: 0]
  ------------------
 4929|      1|                                {}
 4930|      0|                                else
 4931|      0|                                  continue;
 4932|      1|                              else
 4933|      1|                                continue;
 4934|      1|                            else
 4935|      1|                              continue;
 4936|      1|                          else
 4937|      1|                            continue;
 4938|      9|                        else
 4939|      9|                          continue;
 4940|     25|                      else
 4941|     25|                        continue;
 4942|     90|                    else
 4943|     90|                      continue;
 4944|    534|                  else
 4945|    534|                    continue;
 4946|  55.0k|              else if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (4946:23): [True: 45.2k, False: 9.77k]
  ------------------
 4947|  45.2k|                if(p[pixel[5]] > cb)
  ------------------
  |  Branch (4947:20): [True: 1.86k, False: 43.4k]
  ------------------
 4948|  1.86k|                  if(p[pixel[14]] > cb)
  ------------------
  |  Branch (4948:22): [True: 270, False: 1.59k]
  ------------------
 4949|    270|                    if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4949:24): [True: 55, False: 215]
  ------------------
 4950|     55|                      if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4950:26): [True: 21, False: 34]
  ------------------
 4951|     21|                        if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4951:28): [True: 7, False: 14]
  ------------------
 4952|      7|                          if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4952:30): [True: 5, False: 2]
  ------------------
 4953|      5|                            if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4953:32): [True: 2, False: 3]
  ------------------
 4954|      2|                              if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4954:34): [True: 2, False: 0]
  ------------------
 4955|      2|                                if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4955:36): [True: 1, False: 1]
  ------------------
 4956|      1|                                  if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4956:38): [True: 0, False: 1]
  ------------------
 4957|      0|                                  {}
 4958|      1|                                  else
 4959|      1|                                    if(p[pixel[15]] > cb)
  ------------------
  |  Branch (4959:40): [True: 0, False: 1]
  ------------------
 4960|      0|                                    {}
 4961|      1|                                    else
 4962|      1|                                      continue;
 4963|      1|                                else
 4964|      1|                                  continue;
 4965|      0|                              else
 4966|      0|                                continue;
 4967|      3|                            else
 4968|      3|                              continue;
 4969|      2|                          else
 4970|      2|                            continue;
 4971|     14|                        else
 4972|     14|                          continue;
 4973|     34|                      else
 4974|     34|                        continue;
 4975|    215|                    else
 4976|    215|                      continue;
 4977|  1.59k|                  else if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (4977:27): [True: 1.21k, False: 379]
  ------------------
 4978|  1.21k|                    if(p[pixel[12]] > cb)
  ------------------
  |  Branch (4978:24): [True: 125, False: 1.08k]
  ------------------
 4979|    125|                      if(p[pixel[6]] > cb)
  ------------------
  |  Branch (4979:26): [True: 21, False: 104]
  ------------------
 4980|     21|                        if(p[pixel[7]] > cb)
  ------------------
  |  Branch (4980:28): [True: 7, False: 14]
  ------------------
 4981|      7|                          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (4981:30): [True: 2, False: 5]
  ------------------
 4982|      2|                            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (4982:32): [True: 0, False: 2]
  ------------------
 4983|      0|                              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (4983:34): [True: 0, False: 0]
  ------------------
 4984|      0|                                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (4984:36): [True: 0, False: 0]
  ------------------
 4985|      0|                                  if(p[pixel[13]] > cb)
  ------------------
  |  Branch (4985:38): [True: 0, False: 0]
  ------------------
 4986|      0|                                  {}
 4987|      0|                                  else
 4988|      0|                                    continue;
 4989|      0|                                else
 4990|      0|                                  continue;
 4991|      0|                              else
 4992|      0|                                continue;
 4993|      2|                            else
 4994|      2|                              continue;
 4995|      5|                          else
 4996|      5|                            continue;
 4997|     14|                        else
 4998|     14|                          continue;
 4999|    104|                      else
 5000|    104|                        continue;
 5001|  1.08k|                    else if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5001:29): [True: 873, False: 213]
  ------------------
 5002|    873|                      if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5002:26): [True: 658, False: 215]
  ------------------
 5003|    658|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5003:28): [True: 489, False: 169]
  ------------------
 5004|    489|                        {}
 5005|    169|                        else
 5006|    169|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5006:30): [True: 104, False: 65]
  ------------------
 5007|    104|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5007:32): [True: 76, False: 28]
  ------------------
 5008|     76|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5008:34): [True: 55, False: 21]
  ------------------
 5009|     55|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5009:36): [True: 44, False: 11]
  ------------------
 5010|     44|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5010:38): [True: 33, False: 11]
  ------------------
 5011|     33|                                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5011:40): [True: 26, False: 7]
  ------------------
 5012|     26|                                    {}
 5013|      7|                                    else
 5014|      7|                                      continue;
 5015|     11|                                  else
 5016|     11|                                    continue;
 5017|     11|                                else
 5018|     11|                                  continue;
 5019|     21|                              else
 5020|     21|                                continue;
 5021|     28|                            else
 5022|     28|                              continue;
 5023|     65|                          else
 5024|     65|                            continue;
 5025|    215|                      else
 5026|    215|                        continue;
 5027|    213|                    else
 5028|    213|                      continue;
 5029|    379|                  else
 5030|    379|                    if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5030:24): [True: 55, False: 324]
  ------------------
 5031|     55|                      if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5031:26): [True: 10, False: 45]
  ------------------
 5032|     10|                        if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5032:28): [True: 4, False: 6]
  ------------------
 5033|      4|                          if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5033:30): [True: 2, False: 2]
  ------------------
 5034|      2|                            if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5034:32): [True: 2, False: 0]
  ------------------
 5035|      2|                              if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5035:34): [True: 1, False: 1]
  ------------------
 5036|      1|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5036:36): [True: 1, False: 0]
  ------------------
 5037|      1|                                  if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5037:38): [True: 0, False: 1]
  ------------------
 5038|      0|                                  {}
 5039|      1|                                  else
 5040|      1|                                    continue;
 5041|      0|                                else
 5042|      0|                                  continue;
 5043|      1|                              else
 5044|      1|                                continue;
 5045|      0|                            else
 5046|      0|                              continue;
 5047|      2|                          else
 5048|      2|                            continue;
 5049|      6|                        else
 5050|      6|                          continue;
 5051|     45|                      else
 5052|     45|                        continue;
 5053|    324|                    else
 5054|    324|                      continue;
 5055|  43.4k|                else if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5055:25): [True: 36.3k, False: 7.04k]
  ------------------
 5056|  36.3k|                  if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5056:22): [True: 1.24k, False: 35.1k]
  ------------------
 5057|  1.24k|                    if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5057:24): [True: 854, False: 389]
  ------------------
 5058|    854|                      if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5058:26): [True: 99, False: 755]
  ------------------
 5059|     99|                        if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5059:28): [True: 12, False: 87]
  ------------------
 5060|     12|                          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5060:30): [True: 1, False: 11]
  ------------------
 5061|      1|                            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5061:32): [True: 0, False: 1]
  ------------------
 5062|      0|                              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5062:34): [True: 0, False: 0]
  ------------------
 5063|      0|                                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5063:36): [True: 0, False: 0]
  ------------------
 5064|      0|                                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5064:38): [True: 0, False: 0]
  ------------------
 5065|      0|                                    if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5065:40): [True: 0, False: 0]
  ------------------
 5066|      0|                                    {}
 5067|      0|                                    else
 5068|      0|                                      continue;
 5069|      0|                                  else
 5070|      0|                                    continue;
 5071|      0|                                else
 5072|      0|                                  continue;
 5073|      0|                              else
 5074|      0|                                continue;
 5075|      1|                            else
 5076|      1|                              continue;
 5077|     11|                          else
 5078|     11|                            continue;
 5079|     87|                        else
 5080|     87|                          continue;
 5081|    755|                      else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5081:31): [True: 600, False: 155]
  ------------------
 5082|    600|                        if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5082:28): [True: 448, False: 152]
  ------------------
 5083|    448|                        {}
 5084|    152|                        else
 5085|    152|                          continue;
 5086|    155|                      else
 5087|    155|                        continue;
 5088|    389|                    else
 5089|    389|                      if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5089:26): [True: 78, False: 311]
  ------------------
 5090|     78|                        if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5090:28): [True: 21, False: 57]
  ------------------
 5091|     21|                          if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5091:30): [True: 5, False: 16]
  ------------------
 5092|      5|                            if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5092:32): [True: 0, False: 5]
  ------------------
 5093|      0|                              if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5093:34): [True: 0, False: 0]
  ------------------
 5094|      0|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5094:36): [True: 0, False: 0]
  ------------------
 5095|      0|                                  if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5095:38): [True: 0, False: 0]
  ------------------
 5096|      0|                                    if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5096:40): [True: 0, False: 0]
  ------------------
 5097|      0|                                    {}
 5098|      0|                                    else
 5099|      0|                                      continue;
 5100|      0|                                  else
 5101|      0|                                    continue;
 5102|      0|                                else
 5103|      0|                                  continue;
 5104|      0|                              else
 5105|      0|                                continue;
 5106|      5|                            else
 5107|      5|                              continue;
 5108|     16|                          else
 5109|     16|                            continue;
 5110|     57|                        else
 5111|     57|                          continue;
 5112|    311|                      else
 5113|    311|                        continue;
 5114|  35.1k|                  else if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5114:27): [True: 30.0k, False: 5.02k]
  ------------------
 5115|  30.0k|                    if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5115:24): [True: 835, False: 29.2k]
  ------------------
 5116|    835|                      if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5116:26): [True: 92, False: 743]
  ------------------
 5117|     92|                        if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5117:28): [True: 14, False: 78]
  ------------------
 5118|     14|                          if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5118:30): [True: 4, False: 10]
  ------------------
 5119|      4|                            if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5119:32): [True: 2, False: 2]
  ------------------
 5120|      2|                              if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5120:34): [True: 0, False: 2]
  ------------------
 5121|      0|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5121:36): [True: 0, False: 0]
  ------------------
 5122|      0|                                  if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5122:38): [True: 0, False: 0]
  ------------------
 5123|      0|                                    if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5123:40): [True: 0, False: 0]
  ------------------
 5124|      0|                                    {}
 5125|      0|                                    else
 5126|      0|                                      continue;
 5127|      0|                                  else
 5128|      0|                                    continue;
 5129|      0|                                else
 5130|      0|                                  continue;
 5131|      2|                              else
 5132|      2|                                continue;
 5133|      2|                            else
 5134|      2|                              continue;
 5135|     10|                          else
 5136|     10|                            continue;
 5137|     78|                        else
 5138|     78|                          continue;
 5139|    743|                      else if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5139:31): [True: 600, False: 143]
  ------------------
 5140|    600|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5140:28): [True: 459, False: 141]
  ------------------
 5141|    459|                        {}
 5142|    141|                        else
 5143|    141|                          continue;
 5144|    143|                      else
 5145|    143|                        continue;
 5146|  29.2k|                    else if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5146:29): [True: 25.6k, False: 3.64k]
  ------------------
 5147|  25.6k|                      if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5147:26): [True: 22.0k, False: 3.53k]
  ------------------
 5148|  22.0k|                      {}
 5149|  3.53k|                      else
 5150|  3.53k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5150:28): [True: 2.78k, False: 753]
  ------------------
 5151|  2.78k|                        {}
 5152|    753|                        else
 5153|    753|                          continue;
 5154|  3.64k|                    else
 5155|  3.64k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5155:26): [True: 2.82k, False: 827]
  ------------------
 5156|  2.82k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5156:28): [True: 2.24k, False: 575]
  ------------------
 5157|  2.24k|                        {}
 5158|    575|                        else
 5159|    575|                          continue;
 5160|    827|                      else
 5161|    827|                        continue;
 5162|  5.02k|                  else
 5163|  5.02k|                    if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5163:24): [True: 230, False: 4.79k]
  ------------------
 5164|    230|                      if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5164:26): [True: 29, False: 201]
  ------------------
 5165|     29|                        if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5165:28): [True: 8, False: 21]
  ------------------
 5166|      8|                          if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5166:30): [True: 3, False: 5]
  ------------------
 5167|      3|                            if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5167:32): [True: 2, False: 1]
  ------------------
 5168|      2|                              if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5168:34): [True: 1, False: 1]
  ------------------
 5169|      1|                                if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5169:36): [True: 0, False: 1]
  ------------------
 5170|      0|                                  if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5170:38): [True: 0, False: 0]
  ------------------
 5171|      0|                                    if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5171:40): [True: 0, False: 0]
  ------------------
 5172|      0|                                    {}
 5173|      0|                                    else
 5174|      0|                                      continue;
 5175|      0|                                  else
 5176|      0|                                    continue;
 5177|      1|                                else
 5178|      1|                                  continue;
 5179|      1|                              else
 5180|      1|                                continue;
 5181|      1|                            else
 5182|      1|                              continue;
 5183|      5|                          else
 5184|      5|                            continue;
 5185|     21|                        else
 5186|     21|                          continue;
 5187|    201|                      else
 5188|    201|                        continue;
 5189|  4.79k|                    else if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5189:29): [True: 3.73k, False: 1.06k]
  ------------------
 5190|  3.73k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5190:26): [True: 2.88k, False: 850]
  ------------------
 5191|  2.88k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5191:28): [True: 2.30k, False: 578]
  ------------------
 5192|  2.30k|                        {}
 5193|    578|                        else
 5194|    578|                          continue;
 5195|    850|                      else
 5196|    850|                        continue;
 5197|  1.06k|                    else
 5198|  1.06k|                      continue;
 5199|  7.04k|                else
 5200|  7.04k|                  if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5200:22): [True: 429, False: 6.61k]
  ------------------
 5201|    429|                    if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5201:24): [True: 79, False: 350]
  ------------------
 5202|     79|                      if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5202:26): [True: 20, False: 59]
  ------------------
 5203|     20|                        if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5203:28): [True: 5, False: 15]
  ------------------
 5204|      5|                          if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5204:30): [True: 1, False: 4]
  ------------------
 5205|      1|                            if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5205:32): [True: 1, False: 0]
  ------------------
 5206|      1|                              if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5206:34): [True: 1, False: 0]
  ------------------
 5207|      1|                                if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5207:36): [True: 0, False: 1]
  ------------------
 5208|      0|                                  if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5208:38): [True: 0, False: 0]
  ------------------
 5209|      0|                                  {}
 5210|      0|                                  else
 5211|      0|                                    if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5211:40): [True: 0, False: 0]
  ------------------
 5212|      0|                                    {}
 5213|      0|                                    else
 5214|      0|                                      continue;
 5215|      1|                                else
 5216|      1|                                  continue;
 5217|      0|                              else
 5218|      0|                                continue;
 5219|      0|                            else
 5220|      0|                              continue;
 5221|      4|                          else
 5222|      4|                            continue;
 5223|     15|                        else
 5224|     15|                          continue;
 5225|     59|                      else
 5226|     59|                        continue;
 5227|    350|                    else
 5228|    350|                      continue;
 5229|  6.61k|                  else if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5229:27): [True: 5.00k, False: 1.61k]
  ------------------
 5230|  5.00k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5230:24): [True: 3.84k, False: 1.15k]
  ------------------
 5231|  3.84k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5231:26): [True: 3.00k, False: 847]
  ------------------
 5232|  3.00k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5232:28): [True: 2.40k, False: 595]
  ------------------
 5233|  2.40k|                        {}
 5234|    595|                        else
 5235|    595|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5235:30): [True: 409, False: 186]
  ------------------
 5236|    409|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5236:32): [True: 321, False: 88]
  ------------------
 5237|    321|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5237:34): [True: 242, False: 79]
  ------------------
 5238|    242|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5238:36): [True: 203, False: 39]
  ------------------
 5239|    203|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5239:38): [True: 164, False: 39]
  ------------------
 5240|    164|                                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5240:40): [True: 128, False: 36]
  ------------------
 5241|    128|                                    {}
 5242|     36|                                    else
 5243|     36|                                      continue;
 5244|     39|                                  else
 5245|     39|                                    continue;
 5246|     39|                                else
 5247|     39|                                  continue;
 5248|     79|                              else
 5249|     79|                                continue;
 5250|     88|                            else
 5251|     88|                              continue;
 5252|    186|                          else
 5253|    186|                            continue;
 5254|    847|                      else
 5255|    847|                        continue;
 5256|  1.15k|                    else
 5257|  1.15k|                      continue;
 5258|  1.61k|                  else
 5259|  1.61k|                    continue;
 5260|  9.77k|              else
 5261|  9.77k|                if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5261:20): [True: 753, False: 9.02k]
  ------------------
 5262|    753|                  if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5262:22): [True: 156, False: 597]
  ------------------
 5263|    156|                    if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5263:24): [True: 46, False: 110]
  ------------------
 5264|     46|                      if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5264:26): [True: 18, False: 28]
  ------------------
 5265|     18|                        if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5265:28): [True: 7, False: 11]
  ------------------
 5266|      7|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5266:30): [True: 5, False: 2]
  ------------------
 5267|      5|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5267:32): [True: 4, False: 1]
  ------------------
 5268|      4|                              if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5268:34): [True: 0, False: 4]
  ------------------
 5269|      0|                                if(p[pixel[5]] > cb)
  ------------------
  |  Branch (5269:36): [True: 0, False: 0]
  ------------------
 5270|      0|                                {}
 5271|      0|                                else
 5272|      0|                                  if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5272:38): [True: 0, False: 0]
  ------------------
 5273|      0|                                  {}
 5274|      0|                                  else
 5275|      0|                                    continue;
 5276|      4|                              else
 5277|      4|                                if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5277:36): [True: 0, False: 4]
  ------------------
 5278|      0|                                  if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5278:38): [True: 0, False: 0]
  ------------------
 5279|      0|                                  {}
 5280|      0|                                  else
 5281|      0|                                    continue;
 5282|      4|                                else
 5283|      4|                                  continue;
 5284|      1|                            else
 5285|      1|                              continue;
 5286|      2|                          else
 5287|      2|                            continue;
 5288|     11|                        else
 5289|     11|                          continue;
 5290|     28|                      else
 5291|     28|                        continue;
 5292|    110|                    else
 5293|    110|                      continue;
 5294|    597|                  else
 5295|    597|                    continue;
 5296|  9.02k|                else if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5296:25): [True: 6.57k, False: 2.45k]
  ------------------
 5297|  6.57k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5297:22): [True: 4.82k, False: 1.74k]
  ------------------
 5298|  4.82k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5298:24): [True: 3.67k, False: 1.14k]
  ------------------
 5299|  3.67k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5299:26): [True: 2.82k, False: 855]
  ------------------
 5300|  2.82k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5300:28): [True: 2.28k, False: 538]
  ------------------
 5301|  2.28k|                        {}
 5302|    538|                        else
 5303|    538|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5303:30): [True: 389, False: 149]
  ------------------
 5304|    389|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5304:32): [True: 293, False: 96]
  ------------------
 5305|    293|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5305:34): [True: 234, False: 59]
  ------------------
 5306|    234|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5306:36): [True: 180, False: 54]
  ------------------
 5307|    180|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5307:38): [True: 145, False: 35]
  ------------------
 5308|    145|                                  {}
 5309|     35|                                  else
 5310|     35|                                    continue;
 5311|     54|                                else
 5312|     54|                                  continue;
 5313|     59|                              else
 5314|     59|                                continue;
 5315|     96|                            else
 5316|     96|                              continue;
 5317|    149|                          else
 5318|    149|                            continue;
 5319|    855|                      else
 5320|    855|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5320:28): [True: 558, False: 297]
  ------------------
 5321|    558|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5321:30): [True: 384, False: 174]
  ------------------
 5322|    384|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5322:32): [True: 297, False: 87]
  ------------------
 5323|    297|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5323:34): [True: 224, False: 73]
  ------------------
 5324|    224|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5324:36): [True: 176, False: 48]
  ------------------
 5325|    176|                                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5325:38): [True: 128, False: 48]
  ------------------
 5326|    128|                                  {}
 5327|     48|                                  else
 5328|     48|                                    continue;
 5329|     48|                                else
 5330|     48|                                  continue;
 5331|     73|                              else
 5332|     73|                                continue;
 5333|     87|                            else
 5334|     87|                              continue;
 5335|    174|                          else
 5336|    174|                            continue;
 5337|    297|                        else
 5338|    297|                          continue;
 5339|  1.14k|                    else
 5340|  1.14k|                      continue;
 5341|  1.74k|                  else
 5342|  1.74k|                    continue;
 5343|  2.45k|                else
 5344|  2.45k|                  continue;
 5345|  16.3k|            else
 5346|  16.3k|              if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5346:18): [True: 1.39k, False: 14.9k]
  ------------------
 5347|  1.39k|                if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5347:20): [True: 298, False: 1.09k]
  ------------------
 5348|    298|                  if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5348:22): [True: 110, False: 188]
  ------------------
 5349|    110|                    if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5349:24): [True: 43, False: 67]
  ------------------
 5350|     43|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5350:26): [True: 16, False: 27]
  ------------------
 5351|     16|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5351:28): [True: 13, False: 3]
  ------------------
 5352|     13|                          if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5352:30): [True: 2, False: 11]
  ------------------
 5353|      2|                            if(p[pixel[5]] > cb)
  ------------------
  |  Branch (5353:32): [True: 1, False: 1]
  ------------------
 5354|      1|                              if(p[pixel[4]] > cb)
  ------------------
  |  Branch (5354:34): [True: 0, False: 1]
  ------------------
 5355|      0|                              {}
 5356|      1|                              else
 5357|      1|                                if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5357:36): [True: 0, False: 1]
  ------------------
 5358|      0|                                {}
 5359|      1|                                else
 5360|      1|                                  continue;
 5361|      1|                            else
 5362|      1|                              if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5362:34): [True: 0, False: 1]
  ------------------
 5363|      0|                                if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5363:36): [True: 0, False: 0]
  ------------------
 5364|      0|                                {}
 5365|      0|                                else
 5366|      0|                                  continue;
 5367|      1|                              else
 5368|      1|                                continue;
 5369|     11|                          else
 5370|     11|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5370:32): [True: 9, False: 2]
  ------------------
 5371|      9|                              if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5371:34): [True: 3, False: 6]
  ------------------
 5372|      3|                                if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5372:36): [True: 3, False: 0]
  ------------------
 5373|      3|                                {}
 5374|      0|                                else
 5375|      0|                                  continue;
 5376|      6|                              else
 5377|      6|                                continue;
 5378|      2|                            else
 5379|      2|                              continue;
 5380|      3|                        else
 5381|      3|                          continue;
 5382|     27|                      else
 5383|     27|                        continue;
 5384|     67|                    else
 5385|     67|                      continue;
 5386|    188|                  else
 5387|    188|                    continue;
 5388|  1.09k|                else
 5389|  1.09k|                  continue;
 5390|  14.9k|              else if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5390:23): [True: 10.0k, False: 4.86k]
  ------------------
 5391|  10.0k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5391:20): [True: 6.84k, False: 3.24k]
  ------------------
 5392|  6.84k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5392:22): [True: 5.08k, False: 1.76k]
  ------------------
 5393|  5.08k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5393:24): [True: 3.82k, False: 1.26k]
  ------------------
 5394|  3.82k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5394:26): [True: 2.92k, False: 898]
  ------------------
 5395|  2.92k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5395:28): [True: 2.29k, False: 628]
  ------------------
 5396|  2.29k|                        {}
 5397|    628|                        else
 5398|    628|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5398:30): [True: 452, False: 176]
  ------------------
 5399|    452|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5399:32): [True: 336, False: 116]
  ------------------
 5400|    336|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5400:34): [True: 268, False: 68]
  ------------------
 5401|    268|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5401:36): [True: 208, False: 60]
  ------------------
 5402|    208|                                {}
 5403|     60|                                else
 5404|     60|                                  continue;
 5405|     68|                              else
 5406|     68|                                continue;
 5407|    116|                            else
 5408|    116|                              continue;
 5409|    176|                          else
 5410|    176|                            continue;
 5411|    898|                      else
 5412|    898|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5412:28): [True: 641, False: 257]
  ------------------
 5413|    641|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5413:30): [True: 458, False: 183]
  ------------------
 5414|    458|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5414:32): [True: 314, False: 144]
  ------------------
 5415|    314|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5415:34): [True: 239, False: 75]
  ------------------
 5416|    239|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5416:36): [True: 183, False: 56]
  ------------------
 5417|    183|                                {}
 5418|     56|                                else
 5419|     56|                                  continue;
 5420|     75|                              else
 5421|     75|                                continue;
 5422|    144|                            else
 5423|    144|                              continue;
 5424|    183|                          else
 5425|    183|                            continue;
 5426|    257|                        else
 5427|    257|                          continue;
 5428|  1.26k|                    else
 5429|  1.26k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5429:26): [True: 780, False: 483]
  ------------------
 5430|    780|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5430:28): [True: 587, False: 193]
  ------------------
 5431|    587|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5431:30): [True: 404, False: 183]
  ------------------
 5432|    404|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5432:32): [True: 310, False: 94]
  ------------------
 5433|    310|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5433:34): [True: 240, False: 70]
  ------------------
 5434|    240|                                if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5434:36): [True: 188, False: 52]
  ------------------
 5435|    188|                                {}
 5436|     52|                                else
 5437|     52|                                  continue;
 5438|     70|                              else
 5439|     70|                                continue;
 5440|     94|                            else
 5441|     94|                              continue;
 5442|    183|                          else
 5443|    183|                            continue;
 5444|    193|                        else
 5445|    193|                          continue;
 5446|    483|                      else
 5447|    483|                        continue;
 5448|  1.76k|                  else
 5449|  1.76k|                    continue;
 5450|  3.24k|                else
 5451|  3.24k|                  continue;
 5452|  4.86k|              else
 5453|  4.86k|                continue;
 5454|  31.6k|          else
 5455|  31.6k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5455:16): [True: 3.55k, False: 28.0k]
  ------------------
 5456|  3.55k|              if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5456:18): [True: 882, False: 2.67k]
  ------------------
 5457|    882|                if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5457:20): [True: 402, False: 480]
  ------------------
 5458|    402|                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5458:22): [True: 161, False: 241]
  ------------------
 5459|    161|                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5459:24): [True: 95, False: 66]
  ------------------
 5460|     95|                      if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5460:26): [True: 52, False: 43]
  ------------------
 5461|     52|                        if(p[pixel[5]] > cb)
  ------------------
  |  Branch (5461:28): [True: 30, False: 22]
  ------------------
 5462|     30|                          if(p[pixel[4]] > cb)
  ------------------
  |  Branch (5462:30): [True: 14, False: 16]
  ------------------
 5463|     14|                            if(p[pixel[3]] > cb)
  ------------------
  |  Branch (5463:32): [True: 9, False: 5]
  ------------------
 5464|      9|                            {}
 5465|      5|                            else
 5466|      5|                              if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5466:34): [True: 3, False: 2]
  ------------------
 5467|      3|                              {}
 5468|      2|                              else
 5469|      2|                                continue;
 5470|     16|                          else
 5471|     16|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5471:32): [True: 11, False: 5]
  ------------------
 5472|     11|                              if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5472:34): [True: 8, False: 3]
  ------------------
 5473|      8|                              {}
 5474|      3|                              else
 5475|      3|                                continue;
 5476|      5|                            else
 5477|      5|                              continue;
 5478|     22|                        else
 5479|     22|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5479:30): [True: 13, False: 9]
  ------------------
 5480|     13|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5480:32): [True: 8, False: 5]
  ------------------
 5481|      8|                              if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5481:34): [True: 6, False: 2]
  ------------------
 5482|      6|                              {}
 5483|      2|                              else
 5484|      2|                                continue;
 5485|      5|                            else
 5486|      5|                              continue;
 5487|      9|                          else
 5488|      9|                            continue;
 5489|     43|                      else
 5490|     43|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5490:28): [True: 21, False: 22]
  ------------------
 5491|     21|                          if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5491:30): [True: 10, False: 11]
  ------------------
 5492|     10|                            if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5492:32): [True: 6, False: 4]
  ------------------
 5493|      6|                              if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5493:34): [True: 4, False: 2]
  ------------------
 5494|      4|                              {}
 5495|      2|                              else
 5496|      2|                                continue;
 5497|      4|                            else
 5498|      4|                              continue;
 5499|     11|                          else
 5500|     11|                            continue;
 5501|     22|                        else
 5502|     22|                          continue;
 5503|     66|                    else
 5504|     66|                      continue;
 5505|    241|                  else
 5506|    241|                    continue;
 5507|    480|                else
 5508|    480|                  continue;
 5509|  2.67k|              else
 5510|  2.67k|                continue;
 5511|  28.0k|            else if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5511:21): [True: 16.8k, False: 11.2k]
  ------------------
 5512|  16.8k|              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5512:18): [True: 10.3k, False: 6.49k]
  ------------------
 5513|  10.3k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5513:20): [True: 6.97k, False: 3.33k]
  ------------------
 5514|  6.97k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5514:22): [True: 5.20k, False: 1.77k]
  ------------------
 5515|  5.20k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5515:24): [True: 3.90k, False: 1.29k]
  ------------------
 5516|  3.90k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5516:26): [True: 2.99k, False: 911]
  ------------------
 5517|  2.99k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5517:28): [True: 2.38k, False: 611]
  ------------------
 5518|  2.38k|                        {}
 5519|    611|                        else
 5520|    611|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5520:30): [True: 432, False: 179]
  ------------------
 5521|    432|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5521:32): [True: 317, False: 115]
  ------------------
 5522|    317|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5522:34): [True: 263, False: 54]
  ------------------
 5523|    263|                              {}
 5524|     54|                              else
 5525|     54|                                continue;
 5526|    115|                            else
 5527|    115|                              continue;
 5528|    179|                          else
 5529|    179|                            continue;
 5530|    911|                      else
 5531|    911|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5531:28): [True: 648, False: 263]
  ------------------
 5532|    648|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5532:30): [True: 467, False: 181]
  ------------------
 5533|    467|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5533:32): [True: 360, False: 107]
  ------------------
 5534|    360|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5534:34): [True: 263, False: 97]
  ------------------
 5535|    263|                              {}
 5536|     97|                              else
 5537|     97|                                continue;
 5538|    107|                            else
 5539|    107|                              continue;
 5540|    181|                          else
 5541|    181|                            continue;
 5542|    263|                        else
 5543|    263|                          continue;
 5544|  1.29k|                    else
 5545|  1.29k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5545:26): [True: 830, False: 465]
  ------------------
 5546|    830|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5546:28): [True: 605, False: 225]
  ------------------
 5547|    605|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5547:30): [True: 457, False: 148]
  ------------------
 5548|    457|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5548:32): [True: 336, False: 121]
  ------------------
 5549|    336|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5549:34): [True: 266, False: 70]
  ------------------
 5550|    266|                              {}
 5551|     70|                              else
 5552|     70|                                continue;
 5553|    121|                            else
 5554|    121|                              continue;
 5555|    148|                          else
 5556|    148|                            continue;
 5557|    225|                        else
 5558|    225|                          continue;
 5559|    465|                      else
 5560|    465|                        continue;
 5561|  1.77k|                  else
 5562|  1.77k|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (5562:24): [True: 1.10k, False: 671]
  ------------------
 5563|  1.10k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5563:26): [True: 794, False: 309]
  ------------------
 5564|    794|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5564:28): [True: 581, False: 213]
  ------------------
 5565|    581|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5565:30): [True: 426, False: 155]
  ------------------
 5566|    426|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5566:32): [True: 313, False: 113]
  ------------------
 5567|    313|                              if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5567:34): [True: 240, False: 73]
  ------------------
 5568|    240|                              {}
 5569|     73|                              else
 5570|     73|                                continue;
 5571|    113|                            else
 5572|    113|                              continue;
 5573|    155|                          else
 5574|    155|                            continue;
 5575|    213|                        else
 5576|    213|                          continue;
 5577|    309|                      else
 5578|    309|                        continue;
 5579|    671|                    else
 5580|    671|                      continue;
 5581|  3.33k|                else
 5582|  3.33k|                  continue;
 5583|  6.49k|              else
 5584|  6.49k|                continue;
 5585|  11.2k|            else
 5586|  11.2k|              continue;
 5587|  63.9k|        else
 5588|  63.9k|          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5588:14): [True: 10.0k, False: 53.8k]
  ------------------
 5589|  10.0k|            if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5589:16): [True: 3.82k, False: 6.26k]
  ------------------
 5590|  3.82k|              if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5590:18): [True: 1.71k, False: 2.11k]
  ------------------
 5591|  1.71k|                if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5591:20): [True: 873, False: 837]
  ------------------
 5592|    873|                  if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5592:22): [True: 497, False: 376]
  ------------------
 5593|    497|                    if(p[pixel[5]] > cb)
  ------------------
  |  Branch (5593:24): [True: 306, False: 191]
  ------------------
 5594|    306|                      if(p[pixel[4]] > cb)
  ------------------
  |  Branch (5594:26): [True: 203, False: 103]
  ------------------
 5595|    203|                        if(p[pixel[3]] > cb)
  ------------------
  |  Branch (5595:28): [True: 154, False: 49]
  ------------------
 5596|    154|                          if(p[pixel[2]] > cb)
  ------------------
  |  Branch (5596:30): [True: 112, False: 42]
  ------------------
 5597|    112|                          {}
 5598|     42|                          else
 5599|     42|                            if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5599:32): [True: 30, False: 12]
  ------------------
 5600|     30|                            {}
 5601|     12|                            else
 5602|     12|                              continue;
 5603|     49|                        else
 5604|     49|                          if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5604:30): [True: 26, False: 23]
  ------------------
 5605|     26|                            if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5605:32): [True: 16, False: 10]
  ------------------
 5606|     16|                            {}
 5607|     10|                            else
 5608|     10|                              continue;
 5609|     23|                          else
 5610|     23|                            continue;
 5611|    103|                      else
 5612|    103|                        if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5612:28): [True: 58, False: 45]
  ------------------
 5613|     58|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5613:30): [True: 42, False: 16]
  ------------------
 5614|     42|                            if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5614:32): [True: 29, False: 13]
  ------------------
 5615|     29|                            {}
 5616|     13|                            else
 5617|     13|                              continue;
 5618|     16|                          else
 5619|     16|                            continue;
 5620|     45|                        else
 5621|     45|                          continue;
 5622|    191|                    else
 5623|    191|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5623:26): [True: 111, False: 80]
  ------------------
 5624|    111|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5624:28): [True: 70, False: 41]
  ------------------
 5625|     70|                          if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5625:30): [True: 47, False: 23]
  ------------------
 5626|     47|                            if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5626:32): [True: 31, False: 16]
  ------------------
 5627|     31|                            {}
 5628|     16|                            else
 5629|     16|                              continue;
 5630|     23|                          else
 5631|     23|                            continue;
 5632|     41|                        else
 5633|     41|                          continue;
 5634|     80|                      else
 5635|     80|                        continue;
 5636|    376|                  else
 5637|    376|                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5637:24): [True: 197, False: 179]
  ------------------
 5638|    197|                      if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5638:26): [True: 113, False: 84]
  ------------------
 5639|    113|                        if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5639:28): [True: 74, False: 39]
  ------------------
 5640|     74|                          if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5640:30): [True: 52, False: 22]
  ------------------
 5641|     52|                            if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5641:32): [True: 34, False: 18]
  ------------------
 5642|     34|                            {}
 5643|     18|                            else
 5644|     18|                              continue;
 5645|     22|                          else
 5646|     22|                            continue;
 5647|     39|                        else
 5648|     39|                          continue;
 5649|     84|                      else
 5650|     84|                        continue;
 5651|    179|                    else
 5652|    179|                      continue;
 5653|    837|                else
 5654|    837|                  continue;
 5655|  2.11k|              else
 5656|  2.11k|                continue;
 5657|  6.26k|            else
 5658|  6.26k|              continue;
 5659|  53.8k|          else if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5659:19): [True: 26.7k, False: 27.0k]
  ------------------
 5660|  26.7k|            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5660:16): [True: 15.6k, False: 11.1k]
  ------------------
 5661|  15.6k|              if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5661:18): [True: 9.62k, False: 5.99k]
  ------------------
 5662|  9.62k|                if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5662:20): [True: 6.45k, False: 3.17k]
  ------------------
 5663|  6.45k|                  if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5663:22): [True: 4.79k, False: 1.65k]
  ------------------
 5664|  4.79k|                    if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5664:24): [True: 3.65k, False: 1.14k]
  ------------------
 5665|  3.65k|                      if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5665:26): [True: 2.80k, False: 853]
  ------------------
 5666|  2.80k|                        if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5666:28): [True: 2.33k, False: 471]
  ------------------
 5667|  2.33k|                        {}
 5668|    471|                        else
 5669|    471|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5669:30): [True: 350, False: 121]
  ------------------
 5670|    350|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5670:32): [True: 257, False: 93]
  ------------------
 5671|    257|                            {}
 5672|     93|                            else
 5673|     93|                              continue;
 5674|    121|                          else
 5675|    121|                            continue;
 5676|    853|                      else
 5677|    853|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5677:28): [True: 624, False: 229]
  ------------------
 5678|    624|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5678:30): [True: 474, False: 150]
  ------------------
 5679|    474|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5679:32): [True: 354, False: 120]
  ------------------
 5680|    354|                            {}
 5681|    120|                            else
 5682|    120|                              continue;
 5683|    150|                          else
 5684|    150|                            continue;
 5685|    229|                        else
 5686|    229|                          continue;
 5687|  1.14k|                    else
 5688|  1.14k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5688:26): [True: 765, False: 375]
  ------------------
 5689|    765|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5689:28): [True: 573, False: 192]
  ------------------
 5690|    573|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5690:30): [True: 409, False: 164]
  ------------------
 5691|    409|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5691:32): [True: 325, False: 84]
  ------------------
 5692|    325|                            {}
 5693|     84|                            else
 5694|     84|                              continue;
 5695|    164|                          else
 5696|    164|                            continue;
 5697|    192|                        else
 5698|    192|                          continue;
 5699|    375|                      else
 5700|    375|                        continue;
 5701|  1.65k|                  else
 5702|  1.65k|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (5702:24): [True: 1.07k, False: 586]
  ------------------
 5703|  1.07k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5703:26): [True: 756, False: 315]
  ------------------
 5704|    756|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5704:28): [True: 545, False: 211]
  ------------------
 5705|    545|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5705:30): [True: 400, False: 145]
  ------------------
 5706|    400|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5706:32): [True: 302, False: 98]
  ------------------
 5707|    302|                            {}
 5708|     98|                            else
 5709|     98|                              continue;
 5710|    145|                          else
 5711|    145|                            continue;
 5712|    211|                        else
 5713|    211|                          continue;
 5714|    315|                      else
 5715|    315|                        continue;
 5716|    586|                    else
 5717|    586|                      continue;
 5718|  3.17k|                else
 5719|  3.17k|                  if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (5719:22): [True: 1.82k, False: 1.34k]
  ------------------
 5720|  1.82k|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (5720:24): [True: 1.12k, False: 704]
  ------------------
 5721|  1.12k|                      if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5721:26): [True: 795, False: 329]
  ------------------
 5722|    795|                        if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5722:28): [True: 564, False: 231]
  ------------------
 5723|    564|                          if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5723:30): [True: 418, False: 146]
  ------------------
 5724|    418|                            if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5724:32): [True: 325, False: 93]
  ------------------
 5725|    325|                            {}
 5726|     93|                            else
 5727|     93|                              continue;
 5728|    146|                          else
 5729|    146|                            continue;
 5730|    231|                        else
 5731|    231|                          continue;
 5732|    329|                      else
 5733|    329|                        continue;
 5734|    704|                    else
 5735|    704|                      continue;
 5736|  1.34k|                  else
 5737|  1.34k|                    continue;
 5738|  5.99k|              else
 5739|  5.99k|                continue;
 5740|  11.1k|            else
 5741|  11.1k|              continue;
 5742|  27.0k|          else
 5743|  27.0k|            continue;
 5744|   309k|      else
 5745|   309k|        if(p[pixel[7]] > cb)
  ------------------
  |  Branch (5745:12): [True: 67.4k, False: 241k]
  ------------------
 5746|  67.4k|          if(p[pixel[8]] > cb)
  ------------------
  |  Branch (5746:14): [True: 32.1k, False: 35.3k]
  ------------------
 5747|  32.1k|            if(p[pixel[9]] > cb)
  ------------------
  |  Branch (5747:16): [True: 17.9k, False: 14.2k]
  ------------------
 5748|  17.9k|              if(p[pixel[6]] > cb)
  ------------------
  |  Branch (5748:18): [True: 10.9k, False: 6.94k]
  ------------------
 5749|  10.9k|                if(p[pixel[5]] > cb)
  ------------------
  |  Branch (5749:20): [True: 7.39k, False: 3.58k]
  ------------------
 5750|  7.39k|                  if(p[pixel[4]] > cb)
  ------------------
  |  Branch (5750:22): [True: 5.39k, False: 2.00k]
  ------------------
 5751|  5.39k|                    if(p[pixel[3]] > cb)
  ------------------
  |  Branch (5751:24): [True: 4.03k, False: 1.36k]
  ------------------
 5752|  4.03k|                      if(p[pixel[2]] > cb)
  ------------------
  |  Branch (5752:26): [True: 3.08k, False: 948]
  ------------------
 5753|  3.08k|                        if(p[pixel[1]] > cb)
  ------------------
  |  Branch (5753:28): [True: 2.26k, False: 817]
  ------------------
 5754|  2.26k|                        {}
 5755|    817|                        else
 5756|    817|                          if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5756:30): [True: 602, False: 215]
  ------------------
 5757|    602|                          {}
 5758|    215|                          else
 5759|    215|                            continue;
 5760|    948|                      else
 5761|    948|                        if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5761:28): [True: 665, False: 283]
  ------------------
 5762|    665|                          if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5762:30): [True: 455, False: 210]
  ------------------
 5763|    455|                          {}
 5764|    210|                          else
 5765|    210|                            continue;
 5766|    283|                        else
 5767|    283|                          continue;
 5768|  1.36k|                    else
 5769|  1.36k|                      if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5769:26): [True: 934, False: 428]
  ------------------
 5770|    934|                        if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5770:28): [True: 663, False: 271]
  ------------------
 5771|    663|                          if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5771:30): [True: 513, False: 150]
  ------------------
 5772|    513|                          {}
 5773|    150|                          else
 5774|    150|                            continue;
 5775|    271|                        else
 5776|    271|                          continue;
 5777|    428|                      else
 5778|    428|                        continue;
 5779|  2.00k|                  else
 5780|  2.00k|                    if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5780:24): [True: 1.27k, False: 728]
  ------------------
 5781|  1.27k|                      if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5781:26): [True: 868, False: 405]
  ------------------
 5782|    868|                        if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5782:28): [True: 607, False: 261]
  ------------------
 5783|    607|                          if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5783:30): [True: 459, False: 148]
  ------------------
 5784|    459|                          {}
 5785|    148|                          else
 5786|    148|                            continue;
 5787|    261|                        else
 5788|    261|                          continue;
 5789|    405|                      else
 5790|    405|                        continue;
 5791|    728|                    else
 5792|    728|                      continue;
 5793|  3.58k|                else
 5794|  3.58k|                  if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5794:22): [True: 2.06k, False: 1.51k]
  ------------------
 5795|  2.06k|                    if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5795:24): [True: 1.27k, False: 793]
  ------------------
 5796|  1.27k|                      if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5796:26): [True: 873, False: 401]
  ------------------
 5797|    873|                        if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5797:28): [True: 639, False: 234]
  ------------------
 5798|    639|                          if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5798:30): [True: 470, False: 169]
  ------------------
 5799|    470|                          {}
 5800|    169|                          else
 5801|    169|                            continue;
 5802|    234|                        else
 5803|    234|                          continue;
 5804|    401|                      else
 5805|    401|                        continue;
 5806|    793|                    else
 5807|    793|                      continue;
 5808|  1.51k|                  else
 5809|  1.51k|                    continue;
 5810|  6.94k|              else
 5811|  6.94k|                if(p[pixel[10]] > cb)
  ------------------
  |  Branch (5811:20): [True: 3.58k, False: 3.35k]
  ------------------
 5812|  3.58k|                  if(p[pixel[11]] > cb)
  ------------------
  |  Branch (5812:22): [True: 2.06k, False: 1.52k]
  ------------------
 5813|  2.06k|                    if(p[pixel[12]] > cb)
  ------------------
  |  Branch (5813:24): [True: 1.34k, False: 715]
  ------------------
 5814|  1.34k|                      if(p[pixel[13]] > cb)
  ------------------
  |  Branch (5814:26): [True: 873, False: 473]
  ------------------
 5815|    873|                        if(p[pixel[14]] > cb)
  ------------------
  |  Branch (5815:28): [True: 598, False: 275]
  ------------------
 5816|    598|                          if(p[pixel[15]] > cb)
  ------------------
  |  Branch (5816:30): [True: 370, False: 228]
  ------------------
 5817|    370|                          {}
 5818|    228|                          else
 5819|    228|                            continue;
 5820|    275|                        else
 5821|    275|                          continue;
 5822|    473|                      else
 5823|    473|                        continue;
 5824|    715|                    else
 5825|    715|                      continue;
 5826|  1.52k|                  else
 5827|  1.52k|                    continue;
 5828|  3.35k|                else
 5829|  3.35k|                  continue;
 5830|  14.2k|            else
 5831|  14.2k|              continue;
 5832|  35.3k|          else
 5833|  35.3k|            continue;
 5834|   241k|        else if(p[pixel[7]] < c_b)
  ------------------
  |  Branch (5834:17): [True: 66.7k, False: 174k]
  ------------------
 5835|  66.7k|          if(p[pixel[8]] < c_b)
  ------------------
  |  Branch (5835:14): [True: 31.7k, False: 35.0k]
  ------------------
 5836|  31.7k|            if(p[pixel[9]] < c_b)
  ------------------
  |  Branch (5836:16): [True: 17.5k, False: 14.2k]
  ------------------
 5837|  17.5k|              if(p[pixel[6]] < c_b)
  ------------------
  |  Branch (5837:18): [True: 10.7k, False: 6.75k]
  ------------------
 5838|  10.7k|                if(p[pixel[5]] < c_b)
  ------------------
  |  Branch (5838:20): [True: 7.17k, False: 3.59k]
  ------------------
 5839|  7.17k|                  if(p[pixel[4]] < c_b)
  ------------------
  |  Branch (5839:22): [True: 5.31k, False: 1.85k]
  ------------------
 5840|  5.31k|                    if(p[pixel[3]] < c_b)
  ------------------
  |  Branch (5840:24): [True: 4.04k, False: 1.27k]
  ------------------
 5841|  4.04k|                      if(p[pixel[2]] < c_b)
  ------------------
  |  Branch (5841:26): [True: 3.11k, False: 931]
  ------------------
 5842|  3.11k|                        if(p[pixel[1]] < c_b)
  ------------------
  |  Branch (5842:28): [True: 2.28k, False: 835]
  ------------------
 5843|  2.28k|                        {}
 5844|    835|                        else
 5845|    835|                          if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5845:30): [True: 624, False: 211]
  ------------------
 5846|    624|                          {}
 5847|    211|                          else
 5848|    211|                            continue;
 5849|    931|                      else
 5850|    931|                        if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5850:28): [True: 674, False: 257]
  ------------------
 5851|    674|                          if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5851:30): [True: 485, False: 189]
  ------------------
 5852|    485|                          {}
 5853|    189|                          else
 5854|    189|                            continue;
 5855|    257|                        else
 5856|    257|                          continue;
 5857|  1.27k|                    else
 5858|  1.27k|                      if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5858:26): [True: 866, False: 406]
  ------------------
 5859|    866|                        if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5859:28): [True: 633, False: 233]
  ------------------
 5860|    633|                          if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5860:30): [True: 443, False: 190]
  ------------------
 5861|    443|                          {}
 5862|    190|                          else
 5863|    190|                            continue;
 5864|    233|                        else
 5865|    233|                          continue;
 5866|    406|                      else
 5867|    406|                        continue;
 5868|  1.85k|                  else
 5869|  1.85k|                    if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5869:24): [True: 1.15k, False: 696]
  ------------------
 5870|  1.15k|                      if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5870:26): [True: 774, False: 383]
  ------------------
 5871|    774|                        if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5871:28): [True: 562, False: 212]
  ------------------
 5872|    562|                          if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5872:30): [True: 417, False: 145]
  ------------------
 5873|    417|                          {}
 5874|    145|                          else
 5875|    145|                            continue;
 5876|    212|                        else
 5877|    212|                          continue;
 5878|    383|                      else
 5879|    383|                        continue;
 5880|    696|                    else
 5881|    696|                      continue;
 5882|  3.59k|                else
 5883|  3.59k|                  if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5883:22): [True: 2.14k, False: 1.45k]
  ------------------
 5884|  2.14k|                    if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5884:24): [True: 1.37k, False: 769]
  ------------------
 5885|  1.37k|                      if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5885:26): [True: 975, False: 401]
  ------------------
 5886|    975|                        if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5886:28): [True: 672, False: 303]
  ------------------
 5887|    672|                          if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5887:30): [True: 472, False: 200]
  ------------------
 5888|    472|                          {}
 5889|    200|                          else
 5890|    200|                            continue;
 5891|    303|                        else
 5892|    303|                          continue;
 5893|    401|                      else
 5894|    401|                        continue;
 5895|    769|                    else
 5896|    769|                      continue;
 5897|  1.45k|                  else
 5898|  1.45k|                    continue;
 5899|  6.75k|              else
 5900|  6.75k|                if(p[pixel[10]] < c_b)
  ------------------
  |  Branch (5900:20): [True: 3.52k, False: 3.23k]
  ------------------
 5901|  3.52k|                  if(p[pixel[11]] < c_b)
  ------------------
  |  Branch (5901:22): [True: 2.06k, False: 1.45k]
  ------------------
 5902|  2.06k|                    if(p[pixel[12]] < c_b)
  ------------------
  |  Branch (5902:24): [True: 1.31k, False: 752]
  ------------------
 5903|  1.31k|                      if(p[pixel[13]] < c_b)
  ------------------
  |  Branch (5903:26): [True: 881, False: 432]
  ------------------
 5904|    881|                        if(p[pixel[14]] < c_b)
  ------------------
  |  Branch (5904:28): [True: 624, False: 257]
  ------------------
 5905|    624|                          if(p[pixel[15]] < c_b)
  ------------------
  |  Branch (5905:30): [True: 433, False: 191]
  ------------------
 5906|    433|                          {}
 5907|    191|                          else
 5908|    191|                            continue;
 5909|    257|                        else
 5910|    257|                          continue;
 5911|    432|                      else
 5912|    432|                        continue;
 5913|    752|                    else
 5914|    752|                      continue;
 5915|  1.45k|                  else
 5916|  1.45k|                    continue;
 5917|  3.23k|                else
 5918|  3.23k|                  continue;
 5919|  14.2k|            else
 5920|  14.2k|              continue;
 5921|  35.0k|          else
 5922|  35.0k|            continue;
 5923|   174k|        else
 5924|   174k|          continue;
 5925|   108k|      if(num_corners == rsize)
  ------------------
  |  Branch (5925:10): [True: 32, False: 108k]
  ------------------
 5926|     32|      {
 5927|     32|        rsize*=2;
 5928|     32|        xy* new_ret_corners = (xy*)realloc(ret_corners, sizeof(xy)*rsize);
 5929|     32|        if(!new_ret_corners)
  ------------------
  |  Branch (5929:12): [True: 0, False: 32]
  ------------------
 5930|      0|        {
 5931|      0|          free(ret_corners);
 5932|      0|          return NULL;
 5933|      0|        }
 5934|     32|        ret_corners = new_ret_corners;
 5935|     32|      }
 5936|   108k|      ret_corners[num_corners].x = x;
 5937|   108k|      ret_corners[num_corners].y = y;
 5938|   108k|      num_corners++;
 5939|       |
 5940|   108k|    }
 5941|       |
 5942|  3.70k|  *ret_num_corners = num_corners;
 5943|  3.70k|  return ret_corners;
 5944|       |
 5945|  3.70k|}
fast_9.c:make_offsets:
 2968|  7.40k|{
 2969|  7.40k|  pixel[0] = 0 + row_stride * 3;
 2970|  7.40k|  pixel[1] = 1 + row_stride * 3;
 2971|  7.40k|  pixel[2] = 2 + row_stride * 2;
 2972|  7.40k|  pixel[3] = 3 + row_stride * 1;
 2973|  7.40k|  pixel[4] = 3 + row_stride * 0;
 2974|  7.40k|  pixel[5] = 3 + row_stride * -1;
 2975|  7.40k|  pixel[6] = 2 + row_stride * -2;
 2976|  7.40k|  pixel[7] = 1 + row_stride * -3;
 2977|  7.40k|  pixel[8] = 0 + row_stride * -3;
 2978|  7.40k|  pixel[9] = -1 + row_stride * -3;
 2979|  7.40k|  pixel[10] = -2 + row_stride * -2;
 2980|  7.40k|  pixel[11] = -3 + row_stride * -1;
 2981|  7.40k|  pixel[12] = -3 + row_stride * 0;
 2982|  7.40k|  pixel[13] = -3 + row_stride * 1;
 2983|  7.40k|  pixel[14] = -2 + row_stride * 2;
 2984|  7.40k|  pixel[15] = -1 + row_stride * 3;
 2985|  7.40k|}
fast_9.c:fast9_corner_score:
   37|   108k|{
   38|   108k|  int bmin = bstart;
   39|   108k|  int bmax = 255;
   40|   108k|  int b = (bmax + bmin)/2;
   41|       |
   42|       |  /*Compute the score using binary search*/
   43|   108k|  for(;;)
   44|   851k|  {
   45|   851k|    int cb = *p + b;
   46|   851k|    int c_b= *p - b;
   47|       |
   48|       |
   49|   851k|    if( p[pixel[0]] > cb)
  ------------------
  |  Branch (49:9): [True: 252k, False: 599k]
  ------------------
   50|   252k|      if( p[pixel[1]] > cb)
  ------------------
  |  Branch (50:11): [True: 185k, False: 67.1k]
  ------------------
   51|   185k|        if( p[pixel[2]] > cb)
  ------------------
  |  Branch (51:13): [True: 139k, False: 45.5k]
  ------------------
   52|   139k|          if( p[pixel[3]] > cb)
  ------------------
  |  Branch (52:15): [True: 107k, False: 32.3k]
  ------------------
   53|   107k|            if( p[pixel[4]] > cb)
  ------------------
  |  Branch (53:17): [True: 83.9k, False: 23.5k]
  ------------------
   54|  83.9k|              if( p[pixel[5]] > cb)
  ------------------
  |  Branch (54:19): [True: 64.3k, False: 19.6k]
  ------------------
   55|  64.3k|                if( p[pixel[6]] > cb)
  ------------------
  |  Branch (55:21): [True: 48.6k, False: 15.7k]
  ------------------
   56|  48.6k|                  if( p[pixel[7]] > cb)
  ------------------
  |  Branch (56:23): [True: 35.1k, False: 13.4k]
  ------------------
   57|  35.1k|                    if( p[pixel[8]] > cb)
  ------------------
  |  Branch (57:25): [True: 25.1k, False: 9.95k]
  ------------------
   58|  25.1k|                      goto is_a_corner;
   59|  9.95k|                    else
   60|  9.95k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (60:27): [True: 7.73k, False: 2.22k]
  ------------------
   61|  7.73k|                        goto is_a_corner;
   62|  2.22k|                      else
   63|  2.22k|                        goto is_not_a_corner;
   64|  13.4k|                  else if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (64:28): [True: 543, False: 12.9k]
  ------------------
   65|    543|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (65:25): [True: 489, False: 54]
  ------------------
   66|    489|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (66:27): [True: 402, False: 87]
  ------------------
   67|    402|                        goto is_a_corner;
   68|     87|                      else
   69|     87|                        goto is_not_a_corner;
   70|     54|                    else if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (70:30): [True: 4, False: 50]
  ------------------
   71|      4|                      if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (71:27): [True: 2, False: 2]
  ------------------
   72|      2|                        if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (72:29): [True: 2, False: 0]
  ------------------
   73|      2|                          if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (73:31): [True: 2, False: 0]
  ------------------
   74|      2|                            if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (74:33): [True: 2, False: 0]
  ------------------
   75|      2|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (75:35): [True: 2, False: 0]
  ------------------
   76|      2|                                if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (76:37): [True: 2, False: 0]
  ------------------
   77|      2|                                  if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (77:39): [True: 2, False: 0]
  ------------------
   78|      2|                                    goto is_a_corner;
   79|      0|                                  else
   80|      0|                                    goto is_not_a_corner;
   81|      0|                                else
   82|      0|                                  goto is_not_a_corner;
   83|      0|                              else
   84|      0|                                goto is_not_a_corner;
   85|      0|                            else
   86|      0|                              goto is_not_a_corner;
   87|      0|                          else
   88|      0|                            goto is_not_a_corner;
   89|      0|                        else
   90|      0|                          goto is_not_a_corner;
   91|      2|                      else
   92|      2|                        goto is_not_a_corner;
   93|     50|                    else
   94|     50|                      goto is_not_a_corner;
   95|  12.9k|                  else
   96|  12.9k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (96:25): [True: 9.98k, False: 2.96k]
  ------------------
   97|  9.98k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (97:27): [True: 7.93k, False: 2.04k]
  ------------------
   98|  7.93k|                        goto is_a_corner;
   99|  2.04k|                      else
  100|  2.04k|                        goto is_not_a_corner;
  101|  2.96k|                    else
  102|  2.96k|                      goto is_not_a_corner;
  103|  15.7k|                else if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (103:26): [True: 438, False: 15.2k]
  ------------------
  104|    438|                  if( p[pixel[15]] > cb)
  ------------------
  |  Branch (104:23): [True: 400, False: 38]
  ------------------
  105|    400|                    if( p[pixel[13]] > cb)
  ------------------
  |  Branch (105:25): [True: 329, False: 71]
  ------------------
  106|    329|                      if( p[pixel[14]] > cb)
  ------------------
  |  Branch (106:27): [True: 290, False: 39]
  ------------------
  107|    290|                        goto is_a_corner;
  108|     39|                      else
  109|     39|                        goto is_not_a_corner;
  110|     71|                    else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (110:30): [True: 0, False: 71]
  ------------------
  111|      0|                      if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (111:27): [True: 0, False: 0]
  ------------------
  112|      0|                        if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (112:29): [True: 0, False: 0]
  ------------------
  113|      0|                          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (113:31): [True: 0, False: 0]
  ------------------
  114|      0|                            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (114:33): [True: 0, False: 0]
  ------------------
  115|      0|                              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (115:35): [True: 0, False: 0]
  ------------------
  116|      0|                                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (116:37): [True: 0, False: 0]
  ------------------
  117|      0|                                  if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (117:39): [True: 0, False: 0]
  ------------------
  118|      0|                                    goto is_a_corner;
  119|      0|                                  else
  120|      0|                                    goto is_not_a_corner;
  121|      0|                                else
  122|      0|                                  goto is_not_a_corner;
  123|      0|                              else
  124|      0|                                goto is_not_a_corner;
  125|      0|                            else
  126|      0|                              goto is_not_a_corner;
  127|      0|                          else
  128|      0|                            goto is_not_a_corner;
  129|      0|                        else
  130|      0|                          goto is_not_a_corner;
  131|      0|                      else
  132|      0|                        goto is_not_a_corner;
  133|     71|                    else
  134|     71|                      goto is_not_a_corner;
  135|     38|                  else
  136|     38|                    if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (136:25): [True: 3, False: 35]
  ------------------
  137|      3|                      if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (137:27): [True: 0, False: 3]
  ------------------
  138|      0|                        if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (138:29): [True: 0, False: 0]
  ------------------
  139|      0|                          if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (139:31): [True: 0, False: 0]
  ------------------
  140|      0|                            if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (140:33): [True: 0, False: 0]
  ------------------
  141|      0|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (141:35): [True: 0, False: 0]
  ------------------
  142|      0|                                if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (142:37): [True: 0, False: 0]
  ------------------
  143|      0|                                  if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (143:39): [True: 0, False: 0]
  ------------------
  144|      0|                                    goto is_a_corner;
  145|      0|                                  else
  146|      0|                                    goto is_not_a_corner;
  147|      0|                                else
  148|      0|                                  goto is_not_a_corner;
  149|      0|                              else
  150|      0|                                goto is_not_a_corner;
  151|      0|                            else
  152|      0|                              goto is_not_a_corner;
  153|      0|                          else
  154|      0|                            goto is_not_a_corner;
  155|      0|                        else
  156|      0|                          goto is_not_a_corner;
  157|      3|                      else
  158|      3|                        goto is_not_a_corner;
  159|     35|                    else
  160|     35|                      goto is_not_a_corner;
  161|  15.2k|                else
  162|  15.2k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (162:23): [True: 11.7k, False: 3.47k]
  ------------------
  163|  11.7k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (163:25): [True: 9.38k, False: 2.41k]
  ------------------
  164|  9.38k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (164:27): [True: 7.61k, False: 1.76k]
  ------------------
  165|  7.61k|                        goto is_a_corner;
  166|  1.76k|                      else
  167|  1.76k|                        goto is_not_a_corner;
  168|  2.41k|                    else
  169|  2.41k|                      goto is_not_a_corner;
  170|  3.47k|                  else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (170:28): [True: 83, False: 3.39k]
  ------------------
  171|     83|                    if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (171:25): [True: 8, False: 75]
  ------------------
  172|      8|                      if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (172:27): [True: 1, False: 7]
  ------------------
  173|      1|                        if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (173:29): [True: 1, False: 0]
  ------------------
  174|      1|                          if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (174:31): [True: 0, False: 1]
  ------------------
  175|      0|                            if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (175:33): [True: 0, False: 0]
  ------------------
  176|      0|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (176:35): [True: 0, False: 0]
  ------------------
  177|      0|                                if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (177:37): [True: 0, False: 0]
  ------------------
  178|      0|                                  if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (178:39): [True: 0, False: 0]
  ------------------
  179|      0|                                    goto is_a_corner;
  180|      0|                                  else
  181|      0|                                    goto is_not_a_corner;
  182|      0|                                else
  183|      0|                                  goto is_not_a_corner;
  184|      0|                              else
  185|      0|                                goto is_not_a_corner;
  186|      0|                            else
  187|      0|                              goto is_not_a_corner;
  188|      1|                          else
  189|      1|                            goto is_not_a_corner;
  190|      0|                        else
  191|      0|                          goto is_not_a_corner;
  192|      7|                      else
  193|      7|                        goto is_not_a_corner;
  194|     75|                    else
  195|     75|                      goto is_not_a_corner;
  196|  3.39k|                  else
  197|  3.39k|                    goto is_not_a_corner;
  198|  19.6k|              else if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (198:24): [True: 498, False: 19.1k]
  ------------------
  199|    498|                if( p[pixel[14]] > cb)
  ------------------
  |  Branch (199:21): [True: 469, False: 29]
  ------------------
  200|    469|                  if( p[pixel[12]] > cb)
  ------------------
  |  Branch (200:23): [True: 401, False: 68]
  ------------------
  201|    401|                    if( p[pixel[13]] > cb)
  ------------------
  |  Branch (201:25): [True: 365, False: 36]
  ------------------
  202|    365|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (202:27): [True: 304, False: 61]
  ------------------
  203|    304|                        goto is_a_corner;
  204|     61|                      else
  205|     61|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (205:29): [True: 46, False: 15]
  ------------------
  206|     46|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (206:31): [True: 40, False: 6]
  ------------------
  207|     40|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (207:33): [True: 30, False: 10]
  ------------------
  208|     30|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (208:35): [True: 18, False: 12]
  ------------------
  209|     18|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (209:37): [True: 17, False: 1]
  ------------------
  210|     17|                                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (210:39): [True: 15, False: 2]
  ------------------
  211|     15|                                    goto is_a_corner;
  212|      2|                                  else
  213|      2|                                    goto is_not_a_corner;
  214|      1|                                else
  215|      1|                                  goto is_not_a_corner;
  216|     12|                              else
  217|     12|                                goto is_not_a_corner;
  218|     10|                            else
  219|     10|                              goto is_not_a_corner;
  220|      6|                          else
  221|      6|                            goto is_not_a_corner;
  222|     15|                        else
  223|     15|                          goto is_not_a_corner;
  224|     36|                    else
  225|     36|                      goto is_not_a_corner;
  226|     68|                  else if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (226:28): [True: 0, False: 68]
  ------------------
  227|      0|                    if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (227:25): [True: 0, False: 0]
  ------------------
  228|      0|                      if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (228:27): [True: 0, False: 0]
  ------------------
  229|      0|                        if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (229:29): [True: 0, False: 0]
  ------------------
  230|      0|                          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (230:31): [True: 0, False: 0]
  ------------------
  231|      0|                            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (231:33): [True: 0, False: 0]
  ------------------
  232|      0|                              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (232:35): [True: 0, False: 0]
  ------------------
  233|      0|                                if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (233:37): [True: 0, False: 0]
  ------------------
  234|      0|                                  goto is_a_corner;
  235|      0|                                else
  236|      0|                                  goto is_not_a_corner;
  237|      0|                              else
  238|      0|                                goto is_not_a_corner;
  239|      0|                            else
  240|      0|                              goto is_not_a_corner;
  241|      0|                          else
  242|      0|                            goto is_not_a_corner;
  243|      0|                        else
  244|      0|                          goto is_not_a_corner;
  245|      0|                      else
  246|      0|                        goto is_not_a_corner;
  247|      0|                    else
  248|      0|                      goto is_not_a_corner;
  249|     68|                  else
  250|     68|                    goto is_not_a_corner;
  251|     29|                else if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (251:26): [True: 0, False: 29]
  ------------------
  252|      0|                  if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (252:23): [True: 0, False: 0]
  ------------------
  253|      0|                    if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (253:25): [True: 0, False: 0]
  ------------------
  254|      0|                      if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (254:27): [True: 0, False: 0]
  ------------------
  255|      0|                        if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (255:29): [True: 0, False: 0]
  ------------------
  256|      0|                          if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (256:31): [True: 0, False: 0]
  ------------------
  257|      0|                            if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (257:33): [True: 0, False: 0]
  ------------------
  258|      0|                              if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (258:35): [True: 0, False: 0]
  ------------------
  259|      0|                                if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (259:37): [True: 0, False: 0]
  ------------------
  260|      0|                                  goto is_a_corner;
  261|      0|                                else
  262|      0|                                  if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (262:39): [True: 0, False: 0]
  ------------------
  263|      0|                                    goto is_a_corner;
  264|      0|                                  else
  265|      0|                                    goto is_not_a_corner;
  266|      0|                              else
  267|      0|                                goto is_not_a_corner;
  268|      0|                            else
  269|      0|                              goto is_not_a_corner;
  270|      0|                          else
  271|      0|                            goto is_not_a_corner;
  272|      0|                        else
  273|      0|                          goto is_not_a_corner;
  274|      0|                      else
  275|      0|                        goto is_not_a_corner;
  276|      0|                    else
  277|      0|                      goto is_not_a_corner;
  278|      0|                  else
  279|      0|                    goto is_not_a_corner;
  280|     29|                else
  281|     29|                  if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (281:23): [True: 1, False: 28]
  ------------------
  282|      1|                    if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (282:25): [True: 0, False: 1]
  ------------------
  283|      0|                      if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (283:27): [True: 0, False: 0]
  ------------------
  284|      0|                        if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (284:29): [True: 0, False: 0]
  ------------------
  285|      0|                          if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (285:31): [True: 0, False: 0]
  ------------------
  286|      0|                            if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (286:33): [True: 0, False: 0]
  ------------------
  287|      0|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (287:35): [True: 0, False: 0]
  ------------------
  288|      0|                                if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (288:37): [True: 0, False: 0]
  ------------------
  289|      0|                                  goto is_a_corner;
  290|      0|                                else
  291|      0|                                  goto is_not_a_corner;
  292|      0|                              else
  293|      0|                                goto is_not_a_corner;
  294|      0|                            else
  295|      0|                              goto is_not_a_corner;
  296|      0|                          else
  297|      0|                            goto is_not_a_corner;
  298|      0|                        else
  299|      0|                          goto is_not_a_corner;
  300|      0|                      else
  301|      0|                        goto is_not_a_corner;
  302|      1|                    else
  303|      1|                      goto is_not_a_corner;
  304|     28|                  else
  305|     28|                    goto is_not_a_corner;
  306|  19.1k|              else
  307|  19.1k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (307:21): [True: 14.8k, False: 4.29k]
  ------------------
  308|  14.8k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (308:23): [True: 11.9k, False: 2.87k]
  ------------------
  309|  11.9k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (309:25): [True: 9.66k, False: 2.33k]
  ------------------
  310|  9.66k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (310:27): [True: 7.71k, False: 1.94k]
  ------------------
  311|  7.71k|                        goto is_a_corner;
  312|  1.94k|                      else
  313|  1.94k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (313:29): [True: 1.48k, False: 463]
  ------------------
  314|  1.48k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (314:31): [True: 1.23k, False: 251]
  ------------------
  315|  1.23k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (315:33): [True: 1.01k, False: 219]
  ------------------
  316|  1.01k|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (316:35): [True: 762, False: 250]
  ------------------
  317|    762|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (317:37): [True: 532, False: 230]
  ------------------
  318|    532|                                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (318:39): [True: 433, False: 99]
  ------------------
  319|    433|                                    goto is_a_corner;
  320|     99|                                  else
  321|     99|                                    goto is_not_a_corner;
  322|    230|                                else
  323|    230|                                  goto is_not_a_corner;
  324|    250|                              else
  325|    250|                                goto is_not_a_corner;
  326|    219|                            else
  327|    219|                              goto is_not_a_corner;
  328|    251|                          else
  329|    251|                            goto is_not_a_corner;
  330|    463|                        else
  331|    463|                          goto is_not_a_corner;
  332|  2.33k|                    else
  333|  2.33k|                      goto is_not_a_corner;
  334|  2.87k|                  else
  335|  2.87k|                    goto is_not_a_corner;
  336|  4.29k|                else if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (336:26): [True: 114, False: 4.18k]
  ------------------
  337|    114|                  if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (337:23): [True: 14, False: 100]
  ------------------
  338|     14|                    if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (338:25): [True: 6, False: 8]
  ------------------
  339|      6|                      if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (339:27): [True: 6, False: 0]
  ------------------
  340|      6|                        if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (340:29): [True: 6, False: 0]
  ------------------
  341|      6|                          if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (341:31): [True: 0, False: 6]
  ------------------
  342|      0|                            if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (342:33): [True: 0, False: 0]
  ------------------
  343|      0|                              if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (343:35): [True: 0, False: 0]
  ------------------
  344|      0|                                if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (344:37): [True: 0, False: 0]
  ------------------
  345|      0|                                  goto is_a_corner;
  346|      0|                                else
  347|      0|                                  if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (347:39): [True: 0, False: 0]
  ------------------
  348|      0|                                    goto is_a_corner;
  349|      0|                                  else
  350|      0|                                    goto is_not_a_corner;
  351|      0|                              else
  352|      0|                                goto is_not_a_corner;
  353|      0|                            else
  354|      0|                              goto is_not_a_corner;
  355|      6|                          else
  356|      6|                            goto is_not_a_corner;
  357|      0|                        else
  358|      0|                          goto is_not_a_corner;
  359|      0|                      else
  360|      0|                        goto is_not_a_corner;
  361|      8|                    else
  362|      8|                      goto is_not_a_corner;
  363|    100|                  else
  364|    100|                    goto is_not_a_corner;
  365|  4.18k|                else
  366|  4.18k|                  goto is_not_a_corner;
  367|  23.5k|            else if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (367:22): [True: 643, False: 22.9k]
  ------------------
  368|    643|              if( p[pixel[13]] > cb)
  ------------------
  |  Branch (368:19): [True: 577, False: 66]
  ------------------
  369|    577|                if( p[pixel[11]] > cb)
  ------------------
  |  Branch (369:21): [True: 510, False: 67]
  ------------------
  370|    510|                  if( p[pixel[12]] > cb)
  ------------------
  |  Branch (370:23): [True: 475, False: 35]
  ------------------
  371|    475|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (371:25): [True: 403, False: 72]
  ------------------
  372|    403|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (372:27): [True: 332, False: 71]
  ------------------
  373|    332|                        goto is_a_corner;
  374|     71|                      else
  375|     71|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (375:29): [True: 55, False: 16]
  ------------------
  376|     55|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (376:31): [True: 40, False: 15]
  ------------------
  377|     40|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (377:33): [True: 36, False: 4]
  ------------------
  378|     36|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (378:35): [True: 28, False: 8]
  ------------------
  379|     28|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (379:37): [True: 25, False: 3]
  ------------------
  380|     25|                                  goto is_a_corner;
  381|      3|                                else
  382|      3|                                  goto is_not_a_corner;
  383|      8|                              else
  384|      8|                                goto is_not_a_corner;
  385|      4|                            else
  386|      4|                              goto is_not_a_corner;
  387|     15|                          else
  388|     15|                            goto is_not_a_corner;
  389|     16|                        else
  390|     16|                          goto is_not_a_corner;
  391|     72|                    else
  392|     72|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (392:27): [True: 50, False: 22]
  ------------------
  393|     50|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (393:29): [True: 48, False: 2]
  ------------------
  394|     48|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (394:31): [True: 41, False: 7]
  ------------------
  395|     41|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (395:33): [True: 26, False: 15]
  ------------------
  396|     26|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (396:35): [True: 26, False: 0]
  ------------------
  397|     26|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (397:37): [True: 17, False: 9]
  ------------------
  398|     17|                                  goto is_a_corner;
  399|      9|                                else
  400|      9|                                  goto is_not_a_corner;
  401|      0|                              else
  402|      0|                                goto is_not_a_corner;
  403|     15|                            else
  404|     15|                              goto is_not_a_corner;
  405|      7|                          else
  406|      7|                            goto is_not_a_corner;
  407|      2|                        else
  408|      2|                          goto is_not_a_corner;
  409|     22|                      else
  410|     22|                        goto is_not_a_corner;
  411|     35|                  else
  412|     35|                    goto is_not_a_corner;
  413|     67|                else if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (413:26): [True: 0, False: 67]
  ------------------
  414|      0|                  if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (414:23): [True: 0, False: 0]
  ------------------
  415|      0|                    if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (415:25): [True: 0, False: 0]
  ------------------
  416|      0|                      if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|      0|                        if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (417:29): [True: 0, False: 0]
  ------------------
  418|      0|                          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (418:31): [True: 0, False: 0]
  ------------------
  419|      0|                            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (419:33): [True: 0, False: 0]
  ------------------
  420|      0|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (420:35): [True: 0, False: 0]
  ------------------
  421|      0|                                goto is_a_corner;
  422|      0|                              else
  423|      0|                                goto is_not_a_corner;
  424|      0|                            else
  425|      0|                              goto is_not_a_corner;
  426|      0|                          else
  427|      0|                            goto is_not_a_corner;
  428|      0|                        else
  429|      0|                          goto is_not_a_corner;
  430|      0|                      else
  431|      0|                        goto is_not_a_corner;
  432|      0|                    else
  433|      0|                      goto is_not_a_corner;
  434|      0|                  else
  435|      0|                    goto is_not_a_corner;
  436|     67|                else
  437|     67|                  goto is_not_a_corner;
  438|     66|              else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (438:24): [True: 0, False: 66]
  ------------------
  439|      0|                if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (439:21): [True: 0, False: 0]
  ------------------
  440|      0|                  if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (440:23): [True: 0, False: 0]
  ------------------
  441|      0|                    if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (441:25): [True: 0, False: 0]
  ------------------
  442|      0|                      if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (442:27): [True: 0, False: 0]
  ------------------
  443|      0|                        if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (443:29): [True: 0, False: 0]
  ------------------
  444|      0|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (444:31): [True: 0, False: 0]
  ------------------
  445|      0|                            if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (445:33): [True: 0, False: 0]
  ------------------
  446|      0|                              if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (446:35): [True: 0, False: 0]
  ------------------
  447|      0|                                goto is_a_corner;
  448|      0|                              else
  449|      0|                                if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (449:37): [True: 0, False: 0]
  ------------------
  450|      0|                                  goto is_a_corner;
  451|      0|                                else
  452|      0|                                  goto is_not_a_corner;
  453|      0|                            else
  454|      0|                              if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (454:35): [True: 0, False: 0]
  ------------------
  455|      0|                                if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (455:37): [True: 0, False: 0]
  ------------------
  456|      0|                                  goto is_a_corner;
  457|      0|                                else
  458|      0|                                  goto is_not_a_corner;
  459|      0|                              else
  460|      0|                                goto is_not_a_corner;
  461|      0|                          else
  462|      0|                            goto is_not_a_corner;
  463|      0|                        else
  464|      0|                          goto is_not_a_corner;
  465|      0|                      else
  466|      0|                        goto is_not_a_corner;
  467|      0|                    else
  468|      0|                      goto is_not_a_corner;
  469|      0|                  else
  470|      0|                    goto is_not_a_corner;
  471|      0|                else
  472|      0|                  goto is_not_a_corner;
  473|     66|              else
  474|     66|                if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (474:21): [True: 3, False: 63]
  ------------------
  475|      3|                  if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (475:23): [True: 0, False: 3]
  ------------------
  476|      0|                    if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (476:25): [True: 0, False: 0]
  ------------------
  477|      0|                      if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (477:27): [True: 0, False: 0]
  ------------------
  478|      0|                        if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (478:29): [True: 0, False: 0]
  ------------------
  479|      0|                          if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (479:31): [True: 0, False: 0]
  ------------------
  480|      0|                            if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (480:33): [True: 0, False: 0]
  ------------------
  481|      0|                              if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (481:35): [True: 0, False: 0]
  ------------------
  482|      0|                                goto is_a_corner;
  483|      0|                              else
  484|      0|                                goto is_not_a_corner;
  485|      0|                            else
  486|      0|                              goto is_not_a_corner;
  487|      0|                          else
  488|      0|                            goto is_not_a_corner;
  489|      0|                        else
  490|      0|                          goto is_not_a_corner;
  491|      0|                      else
  492|      0|                        goto is_not_a_corner;
  493|      0|                    else
  494|      0|                      goto is_not_a_corner;
  495|      3|                  else
  496|      3|                    goto is_not_a_corner;
  497|     63|                else
  498|     63|                  goto is_not_a_corner;
  499|  22.9k|            else
  500|  22.9k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (500:19): [True: 17.5k, False: 5.34k]
  ------------------
  501|  17.5k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (501:21): [True: 14.3k, False: 3.23k]
  ------------------
  502|  14.3k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (502:23): [True: 11.9k, False: 2.43k]
  ------------------
  503|  11.9k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (503:25): [True: 9.35k, False: 2.57k]
  ------------------
  504|  9.35k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (504:27): [True: 7.46k, False: 1.88k]
  ------------------
  505|  7.46k|                        goto is_a_corner;
  506|  1.88k|                      else
  507|  1.88k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (507:29): [True: 1.45k, False: 429]
  ------------------
  508|  1.45k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (508:31): [True: 1.16k, False: 287]
  ------------------
  509|  1.16k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (509:33): [True: 964, False: 201]
  ------------------
  510|    964|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (510:35): [True: 768, False: 196]
  ------------------
  511|    768|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (511:37): [True: 578, False: 190]
  ------------------
  512|    578|                                  goto is_a_corner;
  513|    190|                                else
  514|    190|                                  goto is_not_a_corner;
  515|    196|                              else
  516|    196|                                goto is_not_a_corner;
  517|    201|                            else
  518|    201|                              goto is_not_a_corner;
  519|    287|                          else
  520|    287|                            goto is_not_a_corner;
  521|    429|                        else
  522|    429|                          goto is_not_a_corner;
  523|  2.57k|                    else
  524|  2.57k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (524:27): [True: 1.86k, False: 708]
  ------------------
  525|  1.86k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (525:29): [True: 1.56k, False: 302]
  ------------------
  526|  1.56k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (526:31): [True: 1.33k, False: 230]
  ------------------
  527|  1.33k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (527:33): [True: 1.06k, False: 261]
  ------------------
  528|  1.06k|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (528:35): [True: 855, False: 214]
  ------------------
  529|    855|                                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (529:37): [True: 660, False: 195]
  ------------------
  530|    660|                                  goto is_a_corner;
  531|    195|                                else
  532|    195|                                  goto is_not_a_corner;
  533|    214|                              else
  534|    214|                                goto is_not_a_corner;
  535|    261|                            else
  536|    261|                              goto is_not_a_corner;
  537|    230|                          else
  538|    230|                            goto is_not_a_corner;
  539|    302|                        else
  540|    302|                          goto is_not_a_corner;
  541|    708|                      else
  542|    708|                        goto is_not_a_corner;
  543|  2.43k|                  else
  544|  2.43k|                    goto is_not_a_corner;
  545|  3.23k|                else
  546|  3.23k|                  goto is_not_a_corner;
  547|  5.34k|              else if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (547:24): [True: 128, False: 5.22k]
  ------------------
  548|    128|                if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (548:21): [True: 8, False: 120]
  ------------------
  549|      8|                  if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (549:23): [True: 0, False: 8]
  ------------------
  550|      0|                    if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (550:25): [True: 0, False: 0]
  ------------------
  551|      0|                      if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (551:27): [True: 0, False: 0]
  ------------------
  552|      0|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (552:29): [True: 0, False: 0]
  ------------------
  553|      0|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (553:31): [True: 0, False: 0]
  ------------------
  554|      0|                            if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (554:33): [True: 0, False: 0]
  ------------------
  555|      0|                              if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (555:35): [True: 0, False: 0]
  ------------------
  556|      0|                                goto is_a_corner;
  557|      0|                              else
  558|      0|                                if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (558:37): [True: 0, False: 0]
  ------------------
  559|      0|                                  goto is_a_corner;
  560|      0|                                else
  561|      0|                                  goto is_not_a_corner;
  562|      0|                            else
  563|      0|                              if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (563:35): [True: 0, False: 0]
  ------------------
  564|      0|                                if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (564:37): [True: 0, False: 0]
  ------------------
  565|      0|                                  goto is_a_corner;
  566|      0|                                else
  567|      0|                                  goto is_not_a_corner;
  568|      0|                              else
  569|      0|                                goto is_not_a_corner;
  570|      0|                          else
  571|      0|                            goto is_not_a_corner;
  572|      0|                        else
  573|      0|                          goto is_not_a_corner;
  574|      0|                      else
  575|      0|                        goto is_not_a_corner;
  576|      0|                    else
  577|      0|                      goto is_not_a_corner;
  578|      8|                  else
  579|      8|                    goto is_not_a_corner;
  580|    120|                else
  581|    120|                  goto is_not_a_corner;
  582|  5.22k|              else
  583|  5.22k|                goto is_not_a_corner;
  584|  32.3k|          else if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (584:20): [True: 908, False: 31.4k]
  ------------------
  585|    908|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (585:17): [True: 802, False: 106]
  ------------------
  586|    802|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (586:19): [True: 729, False: 73]
  ------------------
  587|    729|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (587:21): [True: 671, False: 58]
  ------------------
  588|    671|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (588:23): [True: 547, False: 124]
  ------------------
  589|    547|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (589:25): [True: 464, False: 83]
  ------------------
  590|    464|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (590:27): [True: 333, False: 131]
  ------------------
  591|    333|                        goto is_a_corner;
  592|    131|                      else
  593|    131|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (593:29): [True: 109, False: 22]
  ------------------
  594|    109|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (594:31): [True: 80, False: 29]
  ------------------
  595|     80|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (595:33): [True: 58, False: 22]
  ------------------
  596|     58|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (596:35): [True: 45, False: 13]
  ------------------
  597|     45|                                goto is_a_corner;
  598|     13|                              else
  599|     13|                                goto is_not_a_corner;
  600|     22|                            else
  601|     22|                              goto is_not_a_corner;
  602|     29|                          else
  603|     29|                            goto is_not_a_corner;
  604|     22|                        else
  605|     22|                          goto is_not_a_corner;
  606|     83|                    else
  607|     83|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (607:27): [True: 75, False: 8]
  ------------------
  608|     75|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (608:29): [True: 65, False: 10]
  ------------------
  609|     65|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (609:31): [True: 51, False: 14]
  ------------------
  610|     51|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (610:33): [True: 39, False: 12]
  ------------------
  611|     39|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (611:35): [True: 34, False: 5]
  ------------------
  612|     34|                                goto is_a_corner;
  613|      5|                              else
  614|      5|                                goto is_not_a_corner;
  615|     12|                            else
  616|     12|                              goto is_not_a_corner;
  617|     14|                          else
  618|     14|                            goto is_not_a_corner;
  619|     10|                        else
  620|     10|                          goto is_not_a_corner;
  621|      8|                      else
  622|      8|                        goto is_not_a_corner;
  623|    124|                  else
  624|    124|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (624:25): [True: 65, False: 59]
  ------------------
  625|     65|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (625:27): [True: 51, False: 14]
  ------------------
  626|     51|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (626:29): [True: 35, False: 16]
  ------------------
  627|     35|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (627:31): [True: 33, False: 2]
  ------------------
  628|     33|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (628:33): [True: 31, False: 2]
  ------------------
  629|     31|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (629:35): [True: 27, False: 4]
  ------------------
  630|     27|                                goto is_a_corner;
  631|      4|                              else
  632|      4|                                goto is_not_a_corner;
  633|      2|                            else
  634|      2|                              goto is_not_a_corner;
  635|      2|                          else
  636|      2|                            goto is_not_a_corner;
  637|     16|                        else
  638|     16|                          goto is_not_a_corner;
  639|     14|                      else
  640|     14|                        goto is_not_a_corner;
  641|     59|                    else
  642|     59|                      goto is_not_a_corner;
  643|     58|                else
  644|     58|                  goto is_not_a_corner;
  645|     73|              else
  646|     73|                goto is_not_a_corner;
  647|    106|            else if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (647:22): [True: 21, False: 85]
  ------------------
  648|     21|              if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (648:19): [True: 20, False: 1]
  ------------------
  649|     20|                if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (649:21): [True: 20, False: 0]
  ------------------
  650|     20|                  if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (650:23): [True: 18, False: 2]
  ------------------
  651|     18|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (651:25): [True: 18, False: 0]
  ------------------
  652|     18|                      if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (652:27): [True: 16, False: 2]
  ------------------
  653|     16|                        if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (653:29): [True: 11, False: 5]
  ------------------
  654|     11|                          if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (654:31): [True: 10, False: 1]
  ------------------
  655|     10|                            goto is_a_corner;
  656|      1|                          else
  657|      1|                            if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (657:33): [True: 0, False: 1]
  ------------------
  658|      0|                              if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (658:35): [True: 0, False: 0]
  ------------------
  659|      0|                                goto is_a_corner;
  660|      0|                              else
  661|      0|                                goto is_not_a_corner;
  662|      1|                            else
  663|      1|                              goto is_not_a_corner;
  664|      5|                        else
  665|      5|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (665:31): [True: 1, False: 4]
  ------------------
  666|      1|                            if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (666:33): [True: 1, False: 0]
  ------------------
  667|      1|                              if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (667:35): [True: 1, False: 0]
  ------------------
  668|      1|                                goto is_a_corner;
  669|      0|                              else
  670|      0|                                goto is_not_a_corner;
  671|      0|                            else
  672|      0|                              goto is_not_a_corner;
  673|      4|                          else
  674|      4|                            goto is_not_a_corner;
  675|      2|                      else
  676|      2|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (676:29): [True: 2, False: 0]
  ------------------
  677|      2|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (677:31): [True: 2, False: 0]
  ------------------
  678|      2|                            if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (678:33): [True: 2, False: 0]
  ------------------
  679|      2|                              if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (679:35): [True: 2, False: 0]
  ------------------
  680|      2|                                goto is_a_corner;
  681|      0|                              else
  682|      0|                                goto is_not_a_corner;
  683|      0|                            else
  684|      0|                              goto is_not_a_corner;
  685|      0|                          else
  686|      0|                            goto is_not_a_corner;
  687|      0|                        else
  688|      0|                          goto is_not_a_corner;
  689|      0|                    else
  690|      0|                      goto is_not_a_corner;
  691|      2|                  else
  692|      2|                    goto is_not_a_corner;
  693|      0|                else
  694|      0|                  goto is_not_a_corner;
  695|      1|              else
  696|      1|                goto is_not_a_corner;
  697|     85|            else
  698|     85|              goto is_not_a_corner;
  699|  31.4k|          else
  700|  31.4k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (700:17): [True: 23.5k, False: 7.86k]
  ------------------
  701|  23.5k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (701:19): [True: 18.8k, False: 4.74k]
  ------------------
  702|  18.8k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (702:21): [True: 15.5k, False: 3.26k]
  ------------------
  703|  15.5k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (703:23): [True: 12.4k, False: 3.13k]
  ------------------
  704|  12.4k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (704:25): [True: 9.75k, False: 2.69k]
  ------------------
  705|  9.75k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (705:27): [True: 7.69k, False: 2.05k]
  ------------------
  706|  7.69k|                        goto is_a_corner;
  707|  2.05k|                      else
  708|  2.05k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (708:29): [True: 1.61k, False: 440]
  ------------------
  709|  1.61k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (709:31): [True: 1.27k, False: 338]
  ------------------
  710|  1.27k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (710:33): [True: 1.05k, False: 228]
  ------------------
  711|  1.05k|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (711:35): [True: 818, False: 232]
  ------------------
  712|    818|                                goto is_a_corner;
  713|    232|                              else
  714|    232|                                goto is_not_a_corner;
  715|    228|                            else
  716|    228|                              goto is_not_a_corner;
  717|    338|                          else
  718|    338|                            goto is_not_a_corner;
  719|    440|                        else
  720|    440|                          goto is_not_a_corner;
  721|  2.69k|                    else
  722|  2.69k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (722:27): [True: 2.12k, False: 570]
  ------------------
  723|  2.12k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (723:29): [True: 1.72k, False: 403]
  ------------------
  724|  1.72k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (724:31): [True: 1.40k, False: 317]
  ------------------
  725|  1.40k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (725:33): [True: 1.14k, False: 258]
  ------------------
  726|  1.14k|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (726:35): [True: 901, False: 246]
  ------------------
  727|    901|                                goto is_a_corner;
  728|    246|                              else
  729|    246|                                goto is_not_a_corner;
  730|    258|                            else
  731|    258|                              goto is_not_a_corner;
  732|    317|                          else
  733|    317|                            goto is_not_a_corner;
  734|    403|                        else
  735|    403|                          goto is_not_a_corner;
  736|    570|                      else
  737|    570|                        goto is_not_a_corner;
  738|  3.13k|                  else
  739|  3.13k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (739:25): [True: 2.28k, False: 848]
  ------------------
  740|  2.28k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (740:27): [True: 1.91k, False: 370]
  ------------------
  741|  1.91k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (741:29): [True: 1.61k, False: 298]
  ------------------
  742|  1.61k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (742:31): [True: 1.32k, False: 299]
  ------------------
  743|  1.32k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (743:33): [True: 1.03k, False: 282]
  ------------------
  744|  1.03k|                              if( p[pixel[9]] > cb)
  ------------------
  |  Branch (744:35): [True: 807, False: 231]
  ------------------
  745|    807|                                goto is_a_corner;
  746|    231|                              else
  747|    231|                                goto is_not_a_corner;
  748|    282|                            else
  749|    282|                              goto is_not_a_corner;
  750|    299|                          else
  751|    299|                            goto is_not_a_corner;
  752|    298|                        else
  753|    298|                          goto is_not_a_corner;
  754|    370|                      else
  755|    370|                        goto is_not_a_corner;
  756|    848|                    else
  757|    848|                      goto is_not_a_corner;
  758|  3.26k|                else
  759|  3.26k|                  goto is_not_a_corner;
  760|  4.74k|              else
  761|  4.74k|                goto is_not_a_corner;
  762|  7.86k|            else if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (762:22): [True: 209, False: 7.65k]
  ------------------
  763|    209|              if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (763:19): [True: 24, False: 185]
  ------------------
  764|     24|                if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (764:21): [True: 8, False: 16]
  ------------------
  765|      8|                  if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (765:23): [True: 8, False: 0]
  ------------------
  766|      8|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (766:25): [True: 6, False: 2]
  ------------------
  767|      6|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (767:27): [True: 5, False: 1]
  ------------------
  768|      5|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (768:29): [True: 4, False: 1]
  ------------------
  769|      4|                          if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (769:31): [True: 4, False: 0]
  ------------------
  770|      4|                            if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (770:33): [True: 2, False: 2]
  ------------------
  771|      2|                              goto is_a_corner;
  772|      2|                            else
  773|      2|                              if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (773:35): [True: 0, False: 2]
  ------------------
  774|      0|                                goto is_a_corner;
  775|      2|                              else
  776|      2|                                goto is_not_a_corner;
  777|      0|                          else
  778|      0|                            if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (778:33): [True: 0, False: 0]
  ------------------
  779|      0|                              if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (779:35): [True: 0, False: 0]
  ------------------
  780|      0|                                goto is_a_corner;
  781|      0|                              else
  782|      0|                                goto is_not_a_corner;
  783|      0|                            else
  784|      0|                              goto is_not_a_corner;
  785|      1|                        else
  786|      1|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (786:31): [True: 0, False: 1]
  ------------------
  787|      0|                            if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (787:33): [True: 0, False: 0]
  ------------------
  788|      0|                              if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (788:35): [True: 0, False: 0]
  ------------------
  789|      0|                                goto is_a_corner;
  790|      0|                              else
  791|      0|                                goto is_not_a_corner;
  792|      0|                            else
  793|      0|                              goto is_not_a_corner;
  794|      1|                          else
  795|      1|                            goto is_not_a_corner;
  796|      1|                      else
  797|      1|                        goto is_not_a_corner;
  798|      2|                    else
  799|      2|                      goto is_not_a_corner;
  800|      0|                  else
  801|      0|                    goto is_not_a_corner;
  802|     16|                else
  803|     16|                  goto is_not_a_corner;
  804|    185|              else
  805|    185|                goto is_not_a_corner;
  806|  7.65k|            else
  807|  7.65k|              goto is_not_a_corner;
  808|  45.5k|        else if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (808:18): [True: 1.30k, False: 44.2k]
  ------------------
  809|  1.30k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (809:15): [True: 982, False: 324]
  ------------------
  810|    982|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (810:17): [True: 902, False: 80]
  ------------------
  811|    902|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (811:19): [True: 817, False: 85]
  ------------------
  812|    817|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (812:21): [True: 691, False: 126]
  ------------------
  813|    691|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (813:23): [True: 534, False: 157]
  ------------------
  814|    534|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (814:25): [True: 418, False: 116]
  ------------------
  815|    418|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (815:27): [True: 328, False: 90]
  ------------------
  816|    328|                        goto is_a_corner;
  817|     90|                      else
  818|     90|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (818:29): [True: 68, False: 22]
  ------------------
  819|     68|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (819:31): [True: 42, False: 26]
  ------------------
  820|     42|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (820:33): [True: 37, False: 5]
  ------------------
  821|     37|                              goto is_a_corner;
  822|      5|                            else
  823|      5|                              goto is_not_a_corner;
  824|     26|                          else
  825|     26|                            goto is_not_a_corner;
  826|     22|                        else
  827|     22|                          goto is_not_a_corner;
  828|    116|                    else
  829|    116|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (829:27): [True: 80, False: 36]
  ------------------
  830|     80|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (830:29): [True: 48, False: 32]
  ------------------
  831|     48|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (831:31): [True: 42, False: 6]
  ------------------
  832|     42|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (832:33): [True: 41, False: 1]
  ------------------
  833|     41|                              goto is_a_corner;
  834|      1|                            else
  835|      1|                              goto is_not_a_corner;
  836|      6|                          else
  837|      6|                            goto is_not_a_corner;
  838|     32|                        else
  839|     32|                          goto is_not_a_corner;
  840|     36|                      else
  841|     36|                        goto is_not_a_corner;
  842|    157|                  else
  843|    157|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (843:25): [True: 125, False: 32]
  ------------------
  844|    125|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (844:27): [True: 97, False: 28]
  ------------------
  845|     97|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (845:29): [True: 79, False: 18]
  ------------------
  846|     79|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (846:31): [True: 72, False: 7]
  ------------------
  847|     72|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (847:33): [True: 63, False: 9]
  ------------------
  848|     63|                              goto is_a_corner;
  849|      9|                            else
  850|      9|                              goto is_not_a_corner;
  851|      7|                          else
  852|      7|                            goto is_not_a_corner;
  853|     18|                        else
  854|     18|                          goto is_not_a_corner;
  855|     28|                      else
  856|     28|                        goto is_not_a_corner;
  857|     32|                    else
  858|     32|                      goto is_not_a_corner;
  859|    126|                else
  860|    126|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (860:23): [True: 99, False: 27]
  ------------------
  861|     99|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (861:25): [True: 89, False: 10]
  ------------------
  862|     89|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (862:27): [True: 75, False: 14]
  ------------------
  863|     75|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (863:29): [True: 65, False: 10]
  ------------------
  864|     65|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (864:31): [True: 56, False: 9]
  ------------------
  865|     56|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (865:33): [True: 44, False: 12]
  ------------------
  866|     44|                              goto is_a_corner;
  867|     12|                            else
  868|     12|                              goto is_not_a_corner;
  869|      9|                          else
  870|      9|                            goto is_not_a_corner;
  871|     10|                        else
  872|     10|                          goto is_not_a_corner;
  873|     14|                      else
  874|     14|                        goto is_not_a_corner;
  875|     10|                    else
  876|     10|                      goto is_not_a_corner;
  877|     27|                  else
  878|     27|                    goto is_not_a_corner;
  879|     85|              else
  880|     85|                goto is_not_a_corner;
  881|     80|            else
  882|     80|              goto is_not_a_corner;
  883|    324|          else if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (883:20): [True: 194, False: 130]
  ------------------
  884|    194|            if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (884:17): [True: 170, False: 24]
  ------------------
  885|    170|              if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (885:19): [True: 161, False: 9]
  ------------------
  886|    161|                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (886:21): [True: 155, False: 6]
  ------------------
  887|    155|                  if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (887:23): [True: 126, False: 29]
  ------------------
  888|    126|                    if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (888:25): [True: 93, False: 33]
  ------------------
  889|     93|                      if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (889:27): [True: 74, False: 19]
  ------------------
  890|     74|                        if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (890:29): [True: 50, False: 24]
  ------------------
  891|     50|                          goto is_a_corner;
  892|     24|                        else
  893|     24|                          if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (893:31): [True: 20, False: 4]
  ------------------
  894|     20|                            if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (894:33): [True: 17, False: 3]
  ------------------
  895|     17|                              goto is_a_corner;
  896|      3|                            else
  897|      3|                              goto is_not_a_corner;
  898|      4|                          else
  899|      4|                            goto is_not_a_corner;
  900|     19|                      else
  901|     19|                        if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (901:29): [True: 18, False: 1]
  ------------------
  902|     18|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (902:31): [True: 13, False: 5]
  ------------------
  903|     13|                            if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (903:33): [True: 10, False: 3]
  ------------------
  904|     10|                              goto is_a_corner;
  905|      3|                            else
  906|      3|                              goto is_not_a_corner;
  907|      5|                          else
  908|      5|                            goto is_not_a_corner;
  909|      1|                        else
  910|      1|                          goto is_not_a_corner;
  911|     33|                    else
  912|     33|                      if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (912:27): [True: 30, False: 3]
  ------------------
  913|     30|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (913:29): [True: 21, False: 9]
  ------------------
  914|     21|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (914:31): [True: 21, False: 0]
  ------------------
  915|     21|                            if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (915:33): [True: 21, False: 0]
  ------------------
  916|     21|                              goto is_a_corner;
  917|      0|                            else
  918|      0|                              goto is_not_a_corner;
  919|      0|                          else
  920|      0|                            goto is_not_a_corner;
  921|      9|                        else
  922|      9|                          goto is_not_a_corner;
  923|      3|                      else
  924|      3|                        goto is_not_a_corner;
  925|     29|                  else
  926|     29|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (926:25): [True: 29, False: 0]
  ------------------
  927|     29|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (927:27): [True: 19, False: 10]
  ------------------
  928|     19|                        if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (928:29): [True: 19, False: 0]
  ------------------
  929|     19|                          if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (929:31): [True: 14, False: 5]
  ------------------
  930|     14|                            if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (930:33): [True: 10, False: 4]
  ------------------
  931|     10|                              goto is_a_corner;
  932|      4|                            else
  933|      4|                              goto is_not_a_corner;
  934|      5|                          else
  935|      5|                            goto is_not_a_corner;
  936|      0|                        else
  937|      0|                          goto is_not_a_corner;
  938|     10|                      else
  939|     10|                        goto is_not_a_corner;
  940|      0|                    else
  941|      0|                      goto is_not_a_corner;
  942|      6|                else
  943|      6|                  goto is_not_a_corner;
  944|      9|              else
  945|      9|                goto is_not_a_corner;
  946|     24|            else
  947|     24|              goto is_not_a_corner;
  948|    130|          else
  949|    130|            goto is_not_a_corner;
  950|  44.2k|        else
  951|  44.2k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (951:15): [True: 32.1k, False: 12.1k]
  ------------------
  952|  32.1k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (952:17): [True: 25.1k, False: 6.96k]
  ------------------
  953|  25.1k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (953:19): [True: 20.5k, False: 4.62k]
  ------------------
  954|  20.5k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (954:21): [True: 16.0k, False: 4.48k]
  ------------------
  955|  16.0k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (955:23): [True: 12.5k, False: 3.53k]
  ------------------
  956|  12.5k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (956:25): [True: 9.78k, False: 2.75k]
  ------------------
  957|  9.78k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (957:27): [True: 7.61k, False: 2.17k]
  ------------------
  958|  7.61k|                        goto is_a_corner;
  959|  2.17k|                      else
  960|  2.17k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (960:29): [True: 1.65k, False: 515]
  ------------------
  961|  1.65k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (961:31): [True: 1.27k, False: 383]
  ------------------
  962|  1.27k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (962:33): [True: 1.06k, False: 210]
  ------------------
  963|  1.06k|                              goto is_a_corner;
  964|    210|                            else
  965|    210|                              goto is_not_a_corner;
  966|    383|                          else
  967|    383|                            goto is_not_a_corner;
  968|    515|                        else
  969|    515|                          goto is_not_a_corner;
  970|  2.75k|                    else
  971|  2.75k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (971:27): [True: 2.17k, False: 578]
  ------------------
  972|  2.17k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (972:29): [True: 1.73k, False: 443]
  ------------------
  973|  1.73k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (973:31): [True: 1.37k, False: 360]
  ------------------
  974|  1.37k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (974:33): [True: 1.08k, False: 292]
  ------------------
  975|  1.08k|                              goto is_a_corner;
  976|    292|                            else
  977|    292|                              goto is_not_a_corner;
  978|    360|                          else
  979|    360|                            goto is_not_a_corner;
  980|    443|                        else
  981|    443|                          goto is_not_a_corner;
  982|    578|                      else
  983|    578|                        goto is_not_a_corner;
  984|  3.53k|                  else
  985|  3.53k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (985:25): [True: 2.78k, False: 754]
  ------------------
  986|  2.78k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (986:27): [True: 2.27k, False: 509]
  ------------------
  987|  2.27k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (987:29): [True: 1.92k, False: 353]
  ------------------
  988|  1.92k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (988:31): [True: 1.53k, False: 384]
  ------------------
  989|  1.53k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (989:33): [True: 1.26k, False: 277]
  ------------------
  990|  1.26k|                              goto is_a_corner;
  991|    277|                            else
  992|    277|                              goto is_not_a_corner;
  993|    384|                          else
  994|    384|                            goto is_not_a_corner;
  995|    353|                        else
  996|    353|                          goto is_not_a_corner;
  997|    509|                      else
  998|    509|                        goto is_not_a_corner;
  999|    754|                    else
 1000|    754|                      goto is_not_a_corner;
 1001|  4.48k|                else
 1002|  4.48k|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1002:23): [True: 3.49k, False: 990]
  ------------------
 1003|  3.49k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1003:25): [True: 2.87k, False: 618]
  ------------------
 1004|  2.87k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1004:27): [True: 2.50k, False: 372]
  ------------------
 1005|  2.50k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1005:29): [True: 2.03k, False: 464]
  ------------------
 1006|  2.03k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1006:31): [True: 1.68k, False: 351]
  ------------------
 1007|  1.68k|                            if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1007:33): [True: 1.36k, False: 325]
  ------------------
 1008|  1.36k|                              goto is_a_corner;
 1009|    325|                            else
 1010|    325|                              goto is_not_a_corner;
 1011|    351|                          else
 1012|    351|                            goto is_not_a_corner;
 1013|    464|                        else
 1014|    464|                          goto is_not_a_corner;
 1015|    372|                      else
 1016|    372|                        goto is_not_a_corner;
 1017|    618|                    else
 1018|    618|                      goto is_not_a_corner;
 1019|    990|                  else
 1020|    990|                    goto is_not_a_corner;
 1021|  4.62k|              else
 1022|  4.62k|                goto is_not_a_corner;
 1023|  6.96k|            else
 1024|  6.96k|              goto is_not_a_corner;
 1025|  12.1k|          else if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1025:20): [True: 397, False: 11.7k]
  ------------------
 1026|    397|            if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1026:17): [True: 129, False: 268]
  ------------------
 1027|    129|              if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1027:19): [True: 107, False: 22]
  ------------------
 1028|    107|                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1028:21): [True: 80, False: 27]
  ------------------
 1029|     80|                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1029:23): [True: 71, False: 9]
  ------------------
 1030|     71|                    if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1030:25): [True: 49, False: 22]
  ------------------
 1031|     49|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1031:27): [True: 30, False: 19]
  ------------------
 1032|     30|                        if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1032:29): [True: 22, False: 8]
  ------------------
 1033|     22|                          if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1033:31): [True: 17, False: 5]
  ------------------
 1034|     17|                            goto is_a_corner;
 1035|      5|                          else
 1036|      5|                            if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1036:33): [True: 5, False: 0]
  ------------------
 1037|      5|                              goto is_a_corner;
 1038|      0|                            else
 1039|      0|                              goto is_not_a_corner;
 1040|      8|                        else
 1041|      8|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1041:31): [True: 5, False: 3]
  ------------------
 1042|      5|                            if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1042:33): [True: 4, False: 1]
  ------------------
 1043|      4|                              goto is_a_corner;
 1044|      1|                            else
 1045|      1|                              goto is_not_a_corner;
 1046|      3|                          else
 1047|      3|                            goto is_not_a_corner;
 1048|     19|                      else
 1049|     19|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1049:29): [True: 12, False: 7]
  ------------------
 1050|     12|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1050:31): [True: 12, False: 0]
  ------------------
 1051|     12|                            if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1051:33): [True: 11, False: 1]
  ------------------
 1052|     11|                              goto is_a_corner;
 1053|      1|                            else
 1054|      1|                              goto is_not_a_corner;
 1055|      0|                          else
 1056|      0|                            goto is_not_a_corner;
 1057|      7|                        else
 1058|      7|                          goto is_not_a_corner;
 1059|     22|                    else
 1060|     22|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1060:27): [True: 17, False: 5]
  ------------------
 1061|     17|                        if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1061:29): [True: 14, False: 3]
  ------------------
 1062|     14|                          if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1062:31): [True: 9, False: 5]
  ------------------
 1063|      9|                            if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1063:33): [True: 5, False: 4]
  ------------------
 1064|      5|                              goto is_a_corner;
 1065|      4|                            else
 1066|      4|                              goto is_not_a_corner;
 1067|      5|                          else
 1068|      5|                            goto is_not_a_corner;
 1069|      3|                        else
 1070|      3|                          goto is_not_a_corner;
 1071|      5|                      else
 1072|      5|                        goto is_not_a_corner;
 1073|      9|                  else
 1074|      9|                    goto is_not_a_corner;
 1075|     27|                else
 1076|     27|                  goto is_not_a_corner;
 1077|     22|              else
 1078|     22|                goto is_not_a_corner;
 1079|    268|            else
 1080|    268|              goto is_not_a_corner;
 1081|  11.7k|          else
 1082|  11.7k|            goto is_not_a_corner;
 1083|  67.1k|      else if( p[pixel[1]] < c_b)
  ------------------
  |  Branch (1083:16): [True: 3.57k, False: 63.5k]
  ------------------
 1084|  3.57k|        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1084:13): [True: 1.39k, False: 2.17k]
  ------------------
 1085|  1.39k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1085:15): [True: 1.27k, False: 126]
  ------------------
 1086|  1.27k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1086:17): [True: 1.14k, False: 129]
  ------------------
 1087|  1.14k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1087:19): [True: 968, False: 173]
  ------------------
 1088|    968|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1088:21): [True: 759, False: 209]
  ------------------
 1089|    759|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1089:23): [True: 576, False: 183]
  ------------------
 1090|    576|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1090:25): [True: 428, False: 148]
  ------------------
 1091|    428|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1091:27): [True: 354, False: 74]
  ------------------
 1092|    354|                        goto is_a_corner;
 1093|     74|                      else
 1094|     74|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1094:29): [True: 46, False: 28]
  ------------------
 1095|     46|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1095:31): [True: 30, False: 16]
  ------------------
 1096|     30|                            goto is_a_corner;
 1097|     16|                          else
 1098|     16|                            goto is_not_a_corner;
 1099|     28|                        else
 1100|     28|                          goto is_not_a_corner;
 1101|    148|                    else
 1102|    148|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1102:27): [True: 119, False: 29]
  ------------------
 1103|    119|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1103:29): [True: 95, False: 24]
  ------------------
 1104|     95|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1104:31): [True: 76, False: 19]
  ------------------
 1105|     76|                            goto is_a_corner;
 1106|     19|                          else
 1107|     19|                            goto is_not_a_corner;
 1108|     24|                        else
 1109|     24|                          goto is_not_a_corner;
 1110|     29|                      else
 1111|     29|                        goto is_not_a_corner;
 1112|    183|                  else
 1113|    183|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1113:25): [True: 123, False: 60]
  ------------------
 1114|    123|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1114:27): [True: 102, False: 21]
  ------------------
 1115|    102|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1115:29): [True: 96, False: 6]
  ------------------
 1116|     96|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1116:31): [True: 85, False: 11]
  ------------------
 1117|     85|                            goto is_a_corner;
 1118|     11|                          else
 1119|     11|                            goto is_not_a_corner;
 1120|      6|                        else
 1121|      6|                          goto is_not_a_corner;
 1122|     21|                      else
 1123|     21|                        goto is_not_a_corner;
 1124|     60|                    else
 1125|     60|                      goto is_not_a_corner;
 1126|    209|                else
 1127|    209|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1127:23): [True: 160, False: 49]
  ------------------
 1128|    160|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1128:25): [True: 148, False: 12]
  ------------------
 1129|    148|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1129:27): [True: 123, False: 25]
  ------------------
 1130|    123|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1130:29): [True: 110, False: 13]
  ------------------
 1131|    110|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1131:31): [True: 86, False: 24]
  ------------------
 1132|     86|                            goto is_a_corner;
 1133|     24|                          else
 1134|     24|                            goto is_not_a_corner;
 1135|     13|                        else
 1136|     13|                          goto is_not_a_corner;
 1137|     25|                      else
 1138|     25|                        goto is_not_a_corner;
 1139|     12|                    else
 1140|     12|                      goto is_not_a_corner;
 1141|     49|                  else
 1142|     49|                    goto is_not_a_corner;
 1143|    173|              else
 1144|    173|                if( p[pixel[2]] > cb)
  ------------------
  |  Branch (1144:21): [True: 153, False: 20]
  ------------------
 1145|    153|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1145:23): [True: 124, False: 29]
  ------------------
 1146|    124|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1146:25): [True: 105, False: 19]
  ------------------
 1147|    105|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1147:27): [True: 92, False: 13]
  ------------------
 1148|     92|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1148:29): [True: 83, False: 9]
  ------------------
 1149|     83|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1149:31): [True: 78, False: 5]
  ------------------
 1150|     78|                            goto is_a_corner;
 1151|      5|                          else
 1152|      5|                            goto is_not_a_corner;
 1153|      9|                        else
 1154|      9|                          goto is_not_a_corner;
 1155|     13|                      else
 1156|     13|                        goto is_not_a_corner;
 1157|     19|                    else
 1158|     19|                      goto is_not_a_corner;
 1159|     29|                  else
 1160|     29|                    goto is_not_a_corner;
 1161|     20|                else
 1162|     20|                  goto is_not_a_corner;
 1163|    129|            else
 1164|    129|              goto is_not_a_corner;
 1165|    126|          else
 1166|    126|            goto is_not_a_corner;
 1167|  2.17k|        else if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1167:18): [True: 1.84k, False: 334]
  ------------------
 1168|  1.84k|          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1168:15): [True: 1.68k, False: 157]
  ------------------
 1169|  1.68k|            if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1169:17): [True: 1.50k, False: 182]
  ------------------
 1170|  1.50k|              if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1170:19): [True: 1.22k, False: 286]
  ------------------
 1171|  1.22k|                if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1171:21): [True: 940, False: 280]
  ------------------
 1172|    940|                  if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1172:23): [True: 764, False: 176]
  ------------------
 1173|    764|                    if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1173:25): [True: 623, False: 141]
  ------------------
 1174|    623|                      if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (1174:27): [True: 471, False: 152]
  ------------------
 1175|    471|                        goto is_a_corner;
 1176|    152|                      else
 1177|    152|                        if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1177:29): [True: 117, False: 35]
  ------------------
 1178|    117|                          if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1178:31): [True: 88, False: 29]
  ------------------
 1179|     88|                            goto is_a_corner;
 1180|     29|                          else
 1181|     29|                            goto is_not_a_corner;
 1182|     35|                        else
 1183|     35|                          goto is_not_a_corner;
 1184|    141|                    else
 1185|    141|                      if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1185:27): [True: 123, False: 18]
  ------------------
 1186|    123|                        if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1186:29): [True: 111, False: 12]
  ------------------
 1187|    111|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1187:31): [True: 89, False: 22]
  ------------------
 1188|     89|                            goto is_a_corner;
 1189|     22|                          else
 1190|     22|                            goto is_not_a_corner;
 1191|     12|                        else
 1192|     12|                          goto is_not_a_corner;
 1193|     18|                      else
 1194|     18|                        goto is_not_a_corner;
 1195|    176|                  else
 1196|    176|                    if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1196:25): [True: 153, False: 23]
  ------------------
 1197|    153|                      if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1197:27): [True: 137, False: 16]
  ------------------
 1198|    137|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1198:29): [True: 113, False: 24]
  ------------------
 1199|    113|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1199:31): [True: 83, False: 30]
  ------------------
 1200|     83|                            goto is_a_corner;
 1201|     30|                          else
 1202|     30|                            goto is_not_a_corner;
 1203|     24|                        else
 1204|     24|                          goto is_not_a_corner;
 1205|     16|                      else
 1206|     16|                        goto is_not_a_corner;
 1207|     23|                    else
 1208|     23|                      goto is_not_a_corner;
 1209|    280|                else
 1210|    280|                  if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1210:23): [True: 228, False: 52]
  ------------------
 1211|    228|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1211:25): [True: 185, False: 43]
  ------------------
 1212|    185|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1212:27): [True: 161, False: 24]
  ------------------
 1213|    161|                        if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1213:29): [True: 146, False: 15]
  ------------------
 1214|    146|                          if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1214:31): [True: 123, False: 23]
  ------------------
 1215|    123|                            goto is_a_corner;
 1216|     23|                          else
 1217|     23|                            goto is_not_a_corner;
 1218|     15|                        else
 1219|     15|                          goto is_not_a_corner;
 1220|     24|                      else
 1221|     24|                        goto is_not_a_corner;
 1222|     43|                    else
 1223|     43|                      goto is_not_a_corner;
 1224|     52|                  else
 1225|     52|                    goto is_not_a_corner;
 1226|    286|              else
 1227|    286|                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1227:21): [True: 248, False: 38]
  ------------------
 1228|    248|                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1228:23): [True: 219, False: 29]
  ------------------
 1229|    219|                    if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1229:25): [True: 183, False: 36]
  ------------------
 1230|    183|                      if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1230:27): [True: 155, False: 28]
  ------------------
 1231|    155|                        if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1231:29): [True: 136, False: 19]
  ------------------
 1232|    136|                          if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1232:31): [True: 111, False: 25]
  ------------------
 1233|    111|                            goto is_a_corner;
 1234|     25|                          else
 1235|     25|                            goto is_not_a_corner;
 1236|     19|                        else
 1237|     19|                          goto is_not_a_corner;
 1238|     28|                      else
 1239|     28|                        goto is_not_a_corner;
 1240|     36|                    else
 1241|     36|                      goto is_not_a_corner;
 1242|     29|                  else
 1243|     29|                    goto is_not_a_corner;
 1244|     38|                else
 1245|     38|                  goto is_not_a_corner;
 1246|    182|            else
 1247|    182|              goto is_not_a_corner;
 1248|    157|          else
 1249|    157|            goto is_not_a_corner;
 1250|    334|        else
 1251|    334|          goto is_not_a_corner;
 1252|  63.5k|      else
 1253|  63.5k|        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1253:13): [True: 42.6k, False: 20.8k]
  ------------------
 1254|  42.6k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1254:15): [True: 33.1k, False: 9.49k]
  ------------------
 1255|  33.1k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1255:17): [True: 26.5k, False: 6.56k]
  ------------------
 1256|  26.5k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1256:19): [True: 20.7k, False: 5.83k]
  ------------------
 1257|  20.7k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1257:21): [True: 16.4k, False: 4.30k]
  ------------------
 1258|  16.4k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1258:23): [True: 12.5k, False: 3.87k]
  ------------------
 1259|  12.5k|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1259:25): [True: 9.56k, False: 3.01k]
  ------------------
 1260|  9.56k|                      if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1260:27): [True: 7.53k, False: 2.02k]
  ------------------
 1261|  7.53k|                        goto is_a_corner;
 1262|  2.02k|                      else
 1263|  2.02k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1263:29): [True: 1.53k, False: 497]
  ------------------
 1264|  1.53k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1264:31): [True: 1.15k, False: 377]
  ------------------
 1265|  1.15k|                            goto is_a_corner;
 1266|    377|                          else
 1267|    377|                            goto is_not_a_corner;
 1268|    497|                        else
 1269|    497|                          goto is_not_a_corner;
 1270|  3.01k|                    else
 1271|  3.01k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1271:27): [True: 2.30k, False: 708]
  ------------------
 1272|  2.30k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1272:29): [True: 1.83k, False: 471]
  ------------------
 1273|  1.83k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1273:31): [True: 1.51k, False: 319]
  ------------------
 1274|  1.51k|                            goto is_a_corner;
 1275|    319|                          else
 1276|    319|                            goto is_not_a_corner;
 1277|    471|                        else
 1278|    471|                          goto is_not_a_corner;
 1279|    708|                      else
 1280|    708|                        goto is_not_a_corner;
 1281|  3.87k|                  else
 1282|  3.87k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1282:25): [True: 2.96k, False: 908]
  ------------------
 1283|  2.96k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1283:27): [True: 2.42k, False: 539]
  ------------------
 1284|  2.42k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1284:29): [True: 1.96k, False: 466]
  ------------------
 1285|  1.96k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1285:31): [True: 1.60k, False: 354]
  ------------------
 1286|  1.60k|                            goto is_a_corner;
 1287|    354|                          else
 1288|    354|                            goto is_not_a_corner;
 1289|    466|                        else
 1290|    466|                          goto is_not_a_corner;
 1291|    539|                      else
 1292|    539|                        goto is_not_a_corner;
 1293|    908|                    else
 1294|    908|                      goto is_not_a_corner;
 1295|  4.30k|                else
 1296|  4.30k|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1296:23): [True: 3.18k, False: 1.11k]
  ------------------
 1297|  3.18k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1297:25): [True: 2.59k, False: 590]
  ------------------
 1298|  2.59k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1298:27): [True: 2.21k, False: 386]
  ------------------
 1299|  2.21k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1299:29): [True: 1.79k, False: 420]
  ------------------
 1300|  1.79k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1300:31): [True: 1.50k, False: 288]
  ------------------
 1301|  1.50k|                            goto is_a_corner;
 1302|    288|                          else
 1303|    288|                            goto is_not_a_corner;
 1304|    420|                        else
 1305|    420|                          goto is_not_a_corner;
 1306|    386|                      else
 1307|    386|                        goto is_not_a_corner;
 1308|    590|                    else
 1309|    590|                      goto is_not_a_corner;
 1310|  1.11k|                  else
 1311|  1.11k|                    goto is_not_a_corner;
 1312|  5.83k|              else
 1313|  5.83k|                if( p[pixel[2]] > cb)
  ------------------
  |  Branch (1313:21): [True: 4.37k, False: 1.45k]
  ------------------
 1314|  4.37k|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1314:23): [True: 3.51k, False: 855]
  ------------------
 1315|  3.51k|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1315:25): [True: 2.96k, False: 555]
  ------------------
 1316|  2.96k|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1316:27): [True: 2.47k, False: 489]
  ------------------
 1317|  2.47k|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1317:29): [True: 1.98k, False: 490]
  ------------------
 1318|  1.98k|                          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1318:31): [True: 1.63k, False: 354]
  ------------------
 1319|  1.63k|                            goto is_a_corner;
 1320|    354|                          else
 1321|    354|                            goto is_not_a_corner;
 1322|    490|                        else
 1323|    490|                          goto is_not_a_corner;
 1324|    489|                      else
 1325|    489|                        goto is_not_a_corner;
 1326|    555|                    else
 1327|    555|                      goto is_not_a_corner;
 1328|    855|                  else
 1329|    855|                    goto is_not_a_corner;
 1330|  1.45k|                else
 1331|  1.45k|                  goto is_not_a_corner;
 1332|  6.56k|            else
 1333|  6.56k|              goto is_not_a_corner;
 1334|  9.49k|          else
 1335|  9.49k|            goto is_not_a_corner;
 1336|  20.8k|        else if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1336:18): [True: 1.32k, False: 19.5k]
  ------------------
 1337|  1.32k|          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1337:15): [True: 972, False: 351]
  ------------------
 1338|    972|            if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1338:17): [True: 843, False: 129]
  ------------------
 1339|    843|              if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1339:19): [True: 714, False: 129]
  ------------------
 1340|    714|                if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1340:21): [True: 555, False: 159]
  ------------------
 1341|    555|                  if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1341:23): [True: 433, False: 122]
  ------------------
 1342|    433|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1342:25): [True: 333, False: 100]
  ------------------
 1343|    333|                      if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1343:27): [True: 224, False: 109]
  ------------------
 1344|    224|                        if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (1344:29): [True: 136, False: 88]
  ------------------
 1345|    136|                          goto is_a_corner;
 1346|     88|                        else
 1347|     88|                          if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1347:31): [True: 79, False: 9]
  ------------------
 1348|     79|                            goto is_a_corner;
 1349|      9|                          else
 1350|      9|                            goto is_not_a_corner;
 1351|    109|                      else
 1352|    109|                        if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1352:29): [True: 88, False: 21]
  ------------------
 1353|     88|                          if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1353:31): [True: 70, False: 18]
  ------------------
 1354|     70|                            goto is_a_corner;
 1355|     18|                          else
 1356|     18|                            goto is_not_a_corner;
 1357|     21|                        else
 1358|     21|                          goto is_not_a_corner;
 1359|    100|                    else
 1360|    100|                      if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1360:27): [True: 78, False: 22]
  ------------------
 1361|     78|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1361:29): [True: 64, False: 14]
  ------------------
 1362|     64|                          if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1362:31): [True: 52, False: 12]
  ------------------
 1363|     52|                            goto is_a_corner;
 1364|     12|                          else
 1365|     12|                            goto is_not_a_corner;
 1366|     14|                        else
 1367|     14|                          goto is_not_a_corner;
 1368|     22|                      else
 1369|     22|                        goto is_not_a_corner;
 1370|    122|                  else
 1371|    122|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1371:25): [True: 96, False: 26]
  ------------------
 1372|     96|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1372:27): [True: 78, False: 18]
  ------------------
 1373|     78|                        if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1373:29): [True: 67, False: 11]
  ------------------
 1374|     67|                          if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1374:31): [True: 55, False: 12]
  ------------------
 1375|     55|                            goto is_a_corner;
 1376|     12|                          else
 1377|     12|                            goto is_not_a_corner;
 1378|     11|                        else
 1379|     11|                          goto is_not_a_corner;
 1380|     18|                      else
 1381|     18|                        goto is_not_a_corner;
 1382|     26|                    else
 1383|     26|                      goto is_not_a_corner;
 1384|    159|                else
 1385|    159|                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1385:23): [True: 132, False: 27]
  ------------------
 1386|    132|                    if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1386:25): [True: 114, False: 18]
  ------------------
 1387|    114|                      if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1387:27): [True: 98, False: 16]
  ------------------
 1388|     98|                        if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1388:29): [True: 80, False: 18]
  ------------------
 1389|     80|                          if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1389:31): [True: 69, False: 11]
  ------------------
 1390|     69|                            goto is_a_corner;
 1391|     11|                          else
 1392|     11|                            goto is_not_a_corner;
 1393|     18|                        else
 1394|     18|                          goto is_not_a_corner;
 1395|     16|                      else
 1396|     16|                        goto is_not_a_corner;
 1397|     18|                    else
 1398|     18|                      goto is_not_a_corner;
 1399|     27|                  else
 1400|     27|                    goto is_not_a_corner;
 1401|    129|              else
 1402|    129|                goto is_not_a_corner;
 1403|    129|            else
 1404|    129|              goto is_not_a_corner;
 1405|    351|          else
 1406|    351|            goto is_not_a_corner;
 1407|  19.5k|        else
 1408|  19.5k|          goto is_not_a_corner;
 1409|   599k|    else if( p[pixel[0]] < c_b)
  ------------------
  |  Branch (1409:14): [True: 264k, False: 335k]
  ------------------
 1410|   264k|      if( p[pixel[1]] > cb)
  ------------------
  |  Branch (1410:11): [True: 3.40k, False: 260k]
  ------------------
 1411|  3.40k|        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1411:13): [True: 1.40k, False: 2.00k]
  ------------------
 1412|  1.40k|          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1412:15): [True: 1.27k, False: 128]
  ------------------
 1413|  1.27k|            if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1413:17): [True: 1.11k, False: 161]
  ------------------
 1414|  1.11k|              if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1414:19): [True: 900, False: 214]
  ------------------
 1415|    900|                if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1415:21): [True: 756, False: 144]
  ------------------
 1416|    756|                  if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1416:23): [True: 597, False: 159]
  ------------------
 1417|    597|                    if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1417:25): [True: 444, False: 153]
  ------------------
 1418|    444|                      if( p[pixel[2]] > cb)
  ------------------
  |  Branch (1418:27): [True: 300, False: 144]
  ------------------
 1419|    300|                        goto is_a_corner;
 1420|    144|                      else
 1421|    144|                        if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1421:29): [True: 113, False: 31]
  ------------------
 1422|    113|                          if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1422:31): [True: 87, False: 26]
  ------------------
 1423|     87|                            goto is_a_corner;
 1424|     26|                          else
 1425|     26|                            goto is_not_a_corner;
 1426|     31|                        else
 1427|     31|                          goto is_not_a_corner;
 1428|    153|                    else
 1429|    153|                      if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1429:27): [True: 123, False: 30]
  ------------------
 1430|    123|                        if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1430:29): [True: 96, False: 27]
  ------------------
 1431|     96|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1431:31): [True: 84, False: 12]
  ------------------
 1432|     84|                            goto is_a_corner;
 1433|     12|                          else
 1434|     12|                            goto is_not_a_corner;
 1435|     27|                        else
 1436|     27|                          goto is_not_a_corner;
 1437|     30|                      else
 1438|     30|                        goto is_not_a_corner;
 1439|    159|                  else
 1440|    159|                    if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1440:25): [True: 142, False: 17]
  ------------------
 1441|    142|                      if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1441:27): [True: 122, False: 20]
  ------------------
 1442|    122|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1442:29): [True: 112, False: 10]
  ------------------
 1443|    112|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1443:31): [True: 90, False: 22]
  ------------------
 1444|     90|                            goto is_a_corner;
 1445|     22|                          else
 1446|     22|                            goto is_not_a_corner;
 1447|     10|                        else
 1448|     10|                          goto is_not_a_corner;
 1449|     20|                      else
 1450|     20|                        goto is_not_a_corner;
 1451|     17|                    else
 1452|     17|                      goto is_not_a_corner;
 1453|    144|                else
 1454|    144|                  if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1454:23): [True: 124, False: 20]
  ------------------
 1455|    124|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1455:25): [True: 105, False: 19]
  ------------------
 1456|    105|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1456:27): [True: 91, False: 14]
  ------------------
 1457|     91|                        if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1457:29): [True: 81, False: 10]
  ------------------
 1458|     81|                          if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1458:31): [True: 69, False: 12]
  ------------------
 1459|     69|                            goto is_a_corner;
 1460|     12|                          else
 1461|     12|                            goto is_not_a_corner;
 1462|     10|                        else
 1463|     10|                          goto is_not_a_corner;
 1464|     14|                      else
 1465|     14|                        goto is_not_a_corner;
 1466|     19|                    else
 1467|     19|                      goto is_not_a_corner;
 1468|     20|                  else
 1469|     20|                    goto is_not_a_corner;
 1470|    214|              else
 1471|    214|                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1471:21): [True: 172, False: 42]
  ------------------
 1472|    172|                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1472:23): [True: 150, False: 22]
  ------------------
 1473|    150|                    if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1473:25): [True: 129, False: 21]
  ------------------
 1474|    129|                      if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1474:27): [True: 114, False: 15]
  ------------------
 1475|    114|                        if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1475:29): [True: 87, False: 27]
  ------------------
 1476|     87|                          if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1476:31): [True: 71, False: 16]
  ------------------
 1477|     71|                            goto is_a_corner;
 1478|     16|                          else
 1479|     16|                            goto is_not_a_corner;
 1480|     27|                        else
 1481|     27|                          goto is_not_a_corner;
 1482|     15|                      else
 1483|     15|                        goto is_not_a_corner;
 1484|     21|                    else
 1485|     21|                      goto is_not_a_corner;
 1486|     22|                  else
 1487|     22|                    goto is_not_a_corner;
 1488|     42|                else
 1489|     42|                  goto is_not_a_corner;
 1490|    161|            else
 1491|    161|              goto is_not_a_corner;
 1492|    128|          else
 1493|    128|            goto is_not_a_corner;
 1494|  2.00k|        else if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1494:18): [True: 1.67k, False: 332]
  ------------------
 1495|  1.67k|          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1495:15): [True: 1.54k, False: 125]
  ------------------
 1496|  1.54k|            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1496:17): [True: 1.39k, False: 156]
  ------------------
 1497|  1.39k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1497:19): [True: 1.12k, False: 271]
  ------------------
 1498|  1.12k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1498:21): [True: 848, False: 273]
  ------------------
 1499|    848|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1499:23): [True: 657, False: 191]
  ------------------
 1500|    657|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1500:25): [True: 484, False: 173]
  ------------------
 1501|    484|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1501:27): [True: 378, False: 106]
  ------------------
 1502|    378|                        goto is_a_corner;
 1503|    106|                      else
 1504|    106|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1504:29): [True: 81, False: 25]
  ------------------
 1505|     81|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1505:31): [True: 75, False: 6]
  ------------------
 1506|     75|                            goto is_a_corner;
 1507|      6|                          else
 1508|      6|                            goto is_not_a_corner;
 1509|     25|                        else
 1510|     25|                          goto is_not_a_corner;
 1511|    173|                    else
 1512|    173|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1512:27): [True: 146, False: 27]
  ------------------
 1513|    146|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1513:29): [True: 125, False: 21]
  ------------------
 1514|    125|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1514:31): [True: 106, False: 19]
  ------------------
 1515|    106|                            goto is_a_corner;
 1516|     19|                          else
 1517|     19|                            goto is_not_a_corner;
 1518|     21|                        else
 1519|     21|                          goto is_not_a_corner;
 1520|     27|                      else
 1521|     27|                        goto is_not_a_corner;
 1522|    191|                  else
 1523|    191|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1523:25): [True: 160, False: 31]
  ------------------
 1524|    160|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1524:27): [True: 142, False: 18]
  ------------------
 1525|    142|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1525:29): [True: 107, False: 35]
  ------------------
 1526|    107|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1526:31): [True: 93, False: 14]
  ------------------
 1527|     93|                            goto is_a_corner;
 1528|     14|                          else
 1529|     14|                            goto is_not_a_corner;
 1530|     35|                        else
 1531|     35|                          goto is_not_a_corner;
 1532|     18|                      else
 1533|     18|                        goto is_not_a_corner;
 1534|     31|                    else
 1535|     31|                      goto is_not_a_corner;
 1536|    273|                else
 1537|    273|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1537:23): [True: 178, False: 95]
  ------------------
 1538|    178|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1538:25): [True: 138, False: 40]
  ------------------
 1539|    138|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1539:27): [True: 120, False: 18]
  ------------------
 1540|    120|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1540:29): [True: 99, False: 21]
  ------------------
 1541|     99|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1541:31): [True: 89, False: 10]
  ------------------
 1542|     89|                            goto is_a_corner;
 1543|     10|                          else
 1544|     10|                            goto is_not_a_corner;
 1545|     21|                        else
 1546|     21|                          goto is_not_a_corner;
 1547|     18|                      else
 1548|     18|                        goto is_not_a_corner;
 1549|     40|                    else
 1550|     40|                      goto is_not_a_corner;
 1551|     95|                  else
 1552|     95|                    goto is_not_a_corner;
 1553|    271|              else
 1554|    271|                if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (1554:21): [True: 224, False: 47]
  ------------------
 1555|    224|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1555:23): [True: 176, False: 48]
  ------------------
 1556|    176|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1556:25): [True: 142, False: 34]
  ------------------
 1557|    142|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1557:27): [True: 130, False: 12]
  ------------------
 1558|    130|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1558:29): [True: 118, False: 12]
  ------------------
 1559|    118|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1559:31): [True: 110, False: 8]
  ------------------
 1560|    110|                            goto is_a_corner;
 1561|      8|                          else
 1562|      8|                            goto is_not_a_corner;
 1563|     12|                        else
 1564|     12|                          goto is_not_a_corner;
 1565|     12|                      else
 1566|     12|                        goto is_not_a_corner;
 1567|     34|                    else
 1568|     34|                      goto is_not_a_corner;
 1569|     48|                  else
 1570|     48|                    goto is_not_a_corner;
 1571|     47|                else
 1572|     47|                  goto is_not_a_corner;
 1573|    156|            else
 1574|    156|              goto is_not_a_corner;
 1575|    125|          else
 1576|    125|            goto is_not_a_corner;
 1577|    332|        else
 1578|    332|          goto is_not_a_corner;
 1579|   260k|      else if( p[pixel[1]] < c_b)
  ------------------
  |  Branch (1579:16): [True: 195k, False: 65.4k]
  ------------------
 1580|   195k|        if( p[pixel[2]] > cb)
  ------------------
  |  Branch (1580:13): [True: 1.78k, False: 193k]
  ------------------
 1581|  1.78k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1581:15): [True: 151, False: 1.63k]
  ------------------
 1582|    151|            if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1582:17): [True: 139, False: 12]
  ------------------
 1583|    139|              if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1583:19): [True: 121, False: 18]
  ------------------
 1584|    121|                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1584:21): [True: 118, False: 3]
  ------------------
 1585|    118|                  if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1585:23): [True: 93, False: 25]
  ------------------
 1586|     93|                    if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1586:25): [True: 64, False: 29]
  ------------------
 1587|     64|                      if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1587:27): [True: 47, False: 17]
  ------------------
 1588|     47|                        if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1588:29): [True: 38, False: 9]
  ------------------
 1589|     38|                          goto is_a_corner;
 1590|      9|                        else
 1591|      9|                          if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1591:31): [True: 9, False: 0]
  ------------------
 1592|      9|                            if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1592:33): [True: 8, False: 1]
  ------------------
 1593|      8|                              goto is_a_corner;
 1594|      1|                            else
 1595|      1|                              goto is_not_a_corner;
 1596|      0|                          else
 1597|      0|                            goto is_not_a_corner;
 1598|     17|                      else
 1599|     17|                        if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1599:29): [True: 15, False: 2]
  ------------------
 1600|     15|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1600:31): [True: 12, False: 3]
  ------------------
 1601|     12|                            if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1601:33): [True: 12, False: 0]
  ------------------
 1602|     12|                              goto is_a_corner;
 1603|      0|                            else
 1604|      0|                              goto is_not_a_corner;
 1605|      3|                          else
 1606|      3|                            goto is_not_a_corner;
 1607|      2|                        else
 1608|      2|                          goto is_not_a_corner;
 1609|     29|                    else
 1610|     29|                      if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1610:27): [True: 26, False: 3]
  ------------------
 1611|     26|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1611:29): [True: 24, False: 2]
  ------------------
 1612|     24|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1612:31): [True: 17, False: 7]
  ------------------
 1613|     17|                            if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1613:33): [True: 17, False: 0]
  ------------------
 1614|     17|                              goto is_a_corner;
 1615|      0|                            else
 1616|      0|                              goto is_not_a_corner;
 1617|      7|                          else
 1618|      7|                            goto is_not_a_corner;
 1619|      2|                        else
 1620|      2|                          goto is_not_a_corner;
 1621|      3|                      else
 1622|      3|                        goto is_not_a_corner;
 1623|     25|                  else
 1624|     25|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1624:25): [True: 25, False: 0]
  ------------------
 1625|     25|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1625:27): [True: 16, False: 9]
  ------------------
 1626|     16|                        if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1626:29): [True: 15, False: 1]
  ------------------
 1627|     15|                          if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1627:31): [True: 15, False: 0]
  ------------------
 1628|     15|                            if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1628:33): [True: 10, False: 5]
  ------------------
 1629|     10|                              goto is_a_corner;
 1630|      5|                            else
 1631|      5|                              goto is_not_a_corner;
 1632|      0|                          else
 1633|      0|                            goto is_not_a_corner;
 1634|      1|                        else
 1635|      1|                          goto is_not_a_corner;
 1636|      9|                      else
 1637|      9|                        goto is_not_a_corner;
 1638|      0|                    else
 1639|      0|                      goto is_not_a_corner;
 1640|      3|                else
 1641|      3|                  goto is_not_a_corner;
 1642|     18|              else
 1643|     18|                goto is_not_a_corner;
 1644|     12|            else
 1645|     12|              goto is_not_a_corner;
 1646|  1.63k|          else if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1646:20): [True: 1.45k, False: 183]
  ------------------
 1647|  1.45k|            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1647:17): [True: 1.29k, False: 162]
  ------------------
 1648|  1.29k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1648:19): [True: 1.15k, False: 137]
  ------------------
 1649|  1.15k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1649:21): [True: 1.00k, False: 156]
  ------------------
 1650|  1.00k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1650:23): [True: 806, False: 194]
  ------------------
 1651|    806|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1651:25): [True: 599, False: 207]
  ------------------
 1652|    599|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1652:27): [True: 472, False: 127]
  ------------------
 1653|    472|                        goto is_a_corner;
 1654|    127|                      else
 1655|    127|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1655:29): [True: 104, False: 23]
  ------------------
 1656|    104|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1656:31): [True: 84, False: 20]
  ------------------
 1657|     84|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1657:33): [True: 66, False: 18]
  ------------------
 1658|     66|                              goto is_a_corner;
 1659|     18|                            else
 1660|     18|                              goto is_not_a_corner;
 1661|     20|                          else
 1662|     20|                            goto is_not_a_corner;
 1663|     23|                        else
 1664|     23|                          goto is_not_a_corner;
 1665|    207|                    else
 1666|    207|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1666:27): [True: 167, False: 40]
  ------------------
 1667|    167|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1667:29): [True: 129, False: 38]
  ------------------
 1668|    129|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1668:31): [True: 106, False: 23]
  ------------------
 1669|    106|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1669:33): [True: 92, False: 14]
  ------------------
 1670|     92|                              goto is_a_corner;
 1671|     14|                            else
 1672|     14|                              goto is_not_a_corner;
 1673|     23|                          else
 1674|     23|                            goto is_not_a_corner;
 1675|     38|                        else
 1676|     38|                          goto is_not_a_corner;
 1677|     40|                      else
 1678|     40|                        goto is_not_a_corner;
 1679|    194|                  else
 1680|    194|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1680:25): [True: 140, False: 54]
  ------------------
 1681|    140|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1681:27): [True: 114, False: 26]
  ------------------
 1682|    114|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1682:29): [True: 95, False: 19]
  ------------------
 1683|     95|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1683:31): [True: 84, False: 11]
  ------------------
 1684|     84|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1684:33): [True: 72, False: 12]
  ------------------
 1685|     72|                              goto is_a_corner;
 1686|     12|                            else
 1687|     12|                              goto is_not_a_corner;
 1688|     11|                          else
 1689|     11|                            goto is_not_a_corner;
 1690|     19|                        else
 1691|     19|                          goto is_not_a_corner;
 1692|     26|                      else
 1693|     26|                        goto is_not_a_corner;
 1694|     54|                    else
 1695|     54|                      goto is_not_a_corner;
 1696|    156|                else
 1697|    156|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1697:23): [True: 115, False: 41]
  ------------------
 1698|    115|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1698:25): [True: 105, False: 10]
  ------------------
 1699|    105|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1699:27): [True: 91, False: 14]
  ------------------
 1700|     91|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1700:29): [True: 80, False: 11]
  ------------------
 1701|     80|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1701:31): [True: 65, False: 15]
  ------------------
 1702|     65|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1702:33): [True: 65, False: 0]
  ------------------
 1703|     65|                              goto is_a_corner;
 1704|      0|                            else
 1705|      0|                              goto is_not_a_corner;
 1706|     15|                          else
 1707|     15|                            goto is_not_a_corner;
 1708|     11|                        else
 1709|     11|                          goto is_not_a_corner;
 1710|     14|                      else
 1711|     14|                        goto is_not_a_corner;
 1712|     10|                    else
 1713|     10|                      goto is_not_a_corner;
 1714|     41|                  else
 1715|     41|                    goto is_not_a_corner;
 1716|    137|              else
 1717|    137|                goto is_not_a_corner;
 1718|    162|            else
 1719|    162|              goto is_not_a_corner;
 1720|    183|          else
 1721|    183|            goto is_not_a_corner;
 1722|   193k|        else if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (1722:18): [True: 147k, False: 45.6k]
  ------------------
 1723|   147k|          if( p[pixel[3]] > cb)
  ------------------
  |  Branch (1723:15): [True: 1.22k, False: 146k]
  ------------------
 1724|  1.22k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1724:17): [True: 12, False: 1.21k]
  ------------------
 1725|     12|              if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1725:19): [True: 10, False: 2]
  ------------------
 1726|     10|                if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1726:21): [True: 10, False: 0]
  ------------------
 1727|     10|                  if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1727:23): [True: 10, False: 0]
  ------------------
 1728|     10|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1728:25): [True: 10, False: 0]
  ------------------
 1729|     10|                      if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1729:27): [True: 9, False: 1]
  ------------------
 1730|      9|                        if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1730:29): [True: 7, False: 2]
  ------------------
 1731|      7|                          if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1731:31): [True: 5, False: 2]
  ------------------
 1732|      5|                            goto is_a_corner;
 1733|      2|                          else
 1734|      2|                            if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1734:33): [True: 0, False: 2]
  ------------------
 1735|      0|                              if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1735:35): [True: 0, False: 0]
  ------------------
 1736|      0|                                goto is_a_corner;
 1737|      0|                              else
 1738|      0|                                goto is_not_a_corner;
 1739|      2|                            else
 1740|      2|                              goto is_not_a_corner;
 1741|      2|                        else
 1742|      2|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1742:31): [True: 2, False: 0]
  ------------------
 1743|      2|                            if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1743:33): [True: 2, False: 0]
  ------------------
 1744|      2|                              if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1744:35): [True: 2, False: 0]
  ------------------
 1745|      2|                                goto is_a_corner;
 1746|      0|                              else
 1747|      0|                                goto is_not_a_corner;
 1748|      0|                            else
 1749|      0|                              goto is_not_a_corner;
 1750|      0|                          else
 1751|      0|                            goto is_not_a_corner;
 1752|      1|                      else
 1753|      1|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1753:29): [True: 1, False: 0]
  ------------------
 1754|      1|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1754:31): [True: 1, False: 0]
  ------------------
 1755|      1|                            if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1755:33): [True: 1, False: 0]
  ------------------
 1756|      1|                              if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1756:35): [True: 0, False: 1]
  ------------------
 1757|      0|                                goto is_a_corner;
 1758|      1|                              else
 1759|      1|                                goto is_not_a_corner;
 1760|      0|                            else
 1761|      0|                              goto is_not_a_corner;
 1762|      0|                          else
 1763|      0|                            goto is_not_a_corner;
 1764|      0|                        else
 1765|      0|                          goto is_not_a_corner;
 1766|      0|                    else
 1767|      0|                      goto is_not_a_corner;
 1768|      0|                  else
 1769|      0|                    goto is_not_a_corner;
 1770|      0|                else
 1771|      0|                  goto is_not_a_corner;
 1772|      2|              else
 1773|      2|                goto is_not_a_corner;
 1774|  1.21k|            else if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1774:22): [True: 1.09k, False: 123]
  ------------------
 1775|  1.09k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1775:19): [True: 992, False: 99]
  ------------------
 1776|    992|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1776:21): [True: 891, False: 101]
  ------------------
 1777|    891|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1777:23): [True: 715, False: 176]
  ------------------
 1778|    715|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1778:25): [True: 563, False: 152]
  ------------------
 1779|    563|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1779:27): [True: 449, False: 114]
  ------------------
 1780|    449|                        goto is_a_corner;
 1781|    114|                      else
 1782|    114|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1782:29): [True: 88, False: 26]
  ------------------
 1783|     88|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1783:31): [True: 68, False: 20]
  ------------------
 1784|     68|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1784:33): [True: 55, False: 13]
  ------------------
 1785|     55|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1785:35): [True: 38, False: 17]
  ------------------
 1786|     38|                                goto is_a_corner;
 1787|     17|                              else
 1788|     17|                                goto is_not_a_corner;
 1789|     13|                            else
 1790|     13|                              goto is_not_a_corner;
 1791|     20|                          else
 1792|     20|                            goto is_not_a_corner;
 1793|     26|                        else
 1794|     26|                          goto is_not_a_corner;
 1795|    152|                    else
 1796|    152|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1796:27): [True: 131, False: 21]
  ------------------
 1797|    131|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1797:29): [True: 103, False: 28]
  ------------------
 1798|    103|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1798:31): [True: 90, False: 13]
  ------------------
 1799|     90|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1799:33): [True: 61, False: 29]
  ------------------
 1800|     61|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1800:35): [True: 57, False: 4]
  ------------------
 1801|     57|                                goto is_a_corner;
 1802|      4|                              else
 1803|      4|                                goto is_not_a_corner;
 1804|     29|                            else
 1805|     29|                              goto is_not_a_corner;
 1806|     13|                          else
 1807|     13|                            goto is_not_a_corner;
 1808|     28|                        else
 1809|     28|                          goto is_not_a_corner;
 1810|     21|                      else
 1811|     21|                        goto is_not_a_corner;
 1812|    176|                  else
 1813|    176|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1813:25): [True: 119, False: 57]
  ------------------
 1814|    119|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1814:27): [True: 100, False: 19]
  ------------------
 1815|    100|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1815:29): [True: 83, False: 17]
  ------------------
 1816|     83|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1816:31): [True: 72, False: 11]
  ------------------
 1817|     72|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1817:33): [True: 65, False: 7]
  ------------------
 1818|     65|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1818:35): [True: 57, False: 8]
  ------------------
 1819|     57|                                goto is_a_corner;
 1820|      8|                              else
 1821|      8|                                goto is_not_a_corner;
 1822|      7|                            else
 1823|      7|                              goto is_not_a_corner;
 1824|     11|                          else
 1825|     11|                            goto is_not_a_corner;
 1826|     17|                        else
 1827|     17|                          goto is_not_a_corner;
 1828|     19|                      else
 1829|     19|                        goto is_not_a_corner;
 1830|     57|                    else
 1831|     57|                      goto is_not_a_corner;
 1832|    101|                else
 1833|    101|                  goto is_not_a_corner;
 1834|     99|              else
 1835|     99|                goto is_not_a_corner;
 1836|    123|            else
 1837|    123|              goto is_not_a_corner;
 1838|   146k|          else if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (1838:20): [True: 113k, False: 33.1k]
  ------------------
 1839|   113k|            if( p[pixel[4]] > cb)
  ------------------
  |  Branch (1839:17): [True: 928, False: 112k]
  ------------------
 1840|    928|              if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1840:19): [True: 0, False: 928]
  ------------------
 1841|      0|                if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1841:21): [True: 0, False: 0]
  ------------------
 1842|      0|                  if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1842:23): [True: 0, False: 0]
  ------------------
 1843|      0|                    if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1843:25): [True: 0, False: 0]
  ------------------
 1844|      0|                      if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1844:27): [True: 0, False: 0]
  ------------------
 1845|      0|                        if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1845:29): [True: 0, False: 0]
  ------------------
 1846|      0|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1846:31): [True: 0, False: 0]
  ------------------
 1847|      0|                            if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1847:33): [True: 0, False: 0]
  ------------------
 1848|      0|                              if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1848:35): [True: 0, False: 0]
  ------------------
 1849|      0|                                goto is_a_corner;
 1850|      0|                              else
 1851|      0|                                if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1851:37): [True: 0, False: 0]
  ------------------
 1852|      0|                                  goto is_a_corner;
 1853|      0|                                else
 1854|      0|                                  goto is_not_a_corner;
 1855|      0|                            else
 1856|      0|                              if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1856:35): [True: 0, False: 0]
  ------------------
 1857|      0|                                if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1857:37): [True: 0, False: 0]
  ------------------
 1858|      0|                                  goto is_a_corner;
 1859|      0|                                else
 1860|      0|                                  goto is_not_a_corner;
 1861|      0|                              else
 1862|      0|                                goto is_not_a_corner;
 1863|      0|                          else
 1864|      0|                            goto is_not_a_corner;
 1865|      0|                        else
 1866|      0|                          goto is_not_a_corner;
 1867|      0|                      else
 1868|      0|                        goto is_not_a_corner;
 1869|      0|                    else
 1870|      0|                      goto is_not_a_corner;
 1871|      0|                  else
 1872|      0|                    goto is_not_a_corner;
 1873|      0|                else
 1874|      0|                  goto is_not_a_corner;
 1875|    928|              else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (1875:24): [True: 869, False: 59]
  ------------------
 1876|    869|                if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1876:21): [True: 0, False: 869]
  ------------------
 1877|      0|                  if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1877:23): [True: 0, False: 0]
  ------------------
 1878|      0|                    if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1878:25): [True: 0, False: 0]
  ------------------
 1879|      0|                      if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1879:27): [True: 0, False: 0]
  ------------------
 1880|      0|                        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1880:29): [True: 0, False: 0]
  ------------------
 1881|      0|                          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1881:31): [True: 0, False: 0]
  ------------------
 1882|      0|                            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1882:33): [True: 0, False: 0]
  ------------------
 1883|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1883:35): [True: 0, False: 0]
  ------------------
 1884|      0|                                goto is_a_corner;
 1885|      0|                              else
 1886|      0|                                goto is_not_a_corner;
 1887|      0|                            else
 1888|      0|                              goto is_not_a_corner;
 1889|      0|                          else
 1890|      0|                            goto is_not_a_corner;
 1891|      0|                        else
 1892|      0|                          goto is_not_a_corner;
 1893|      0|                      else
 1894|      0|                        goto is_not_a_corner;
 1895|      0|                    else
 1896|      0|                      goto is_not_a_corner;
 1897|      0|                  else
 1898|      0|                    goto is_not_a_corner;
 1899|    869|                else if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (1899:26): [True: 775, False: 94]
  ------------------
 1900|    775|                  if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (1900:23): [True: 702, False: 73]
  ------------------
 1901|    702|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (1901:25): [True: 578, False: 124]
  ------------------
 1902|    578|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (1902:27): [True: 488, False: 90]
  ------------------
 1903|    488|                        goto is_a_corner;
 1904|     90|                      else
 1905|     90|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1905:29): [True: 61, False: 29]
  ------------------
 1906|     61|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1906:31): [True: 35, False: 26]
  ------------------
 1907|     35|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1907:33): [True: 28, False: 7]
  ------------------
 1908|     28|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1908:35): [True: 20, False: 8]
  ------------------
 1909|     20|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1909:37): [True: 13, False: 7]
  ------------------
 1910|     13|                                  goto is_a_corner;
 1911|      7|                                else
 1912|      7|                                  goto is_not_a_corner;
 1913|      8|                              else
 1914|      8|                                goto is_not_a_corner;
 1915|      7|                            else
 1916|      7|                              goto is_not_a_corner;
 1917|     26|                          else
 1918|     26|                            goto is_not_a_corner;
 1919|     29|                        else
 1920|     29|                          goto is_not_a_corner;
 1921|    124|                    else
 1922|    124|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (1922:27): [True: 78, False: 46]
  ------------------
 1923|     78|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (1923:29): [True: 63, False: 15]
  ------------------
 1924|     63|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (1924:31): [True: 60, False: 3]
  ------------------
 1925|     60|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (1925:33): [True: 54, False: 6]
  ------------------
 1926|     54|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (1926:35): [True: 36, False: 18]
  ------------------
 1927|     36|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (1927:37): [True: 28, False: 8]
  ------------------
 1928|     28|                                  goto is_a_corner;
 1929|      8|                                else
 1930|      8|                                  goto is_not_a_corner;
 1931|     18|                              else
 1932|     18|                                goto is_not_a_corner;
 1933|      6|                            else
 1934|      6|                              goto is_not_a_corner;
 1935|      3|                          else
 1936|      3|                            goto is_not_a_corner;
 1937|     15|                        else
 1938|     15|                          goto is_not_a_corner;
 1939|     46|                      else
 1940|     46|                        goto is_not_a_corner;
 1941|     73|                  else
 1942|     73|                    goto is_not_a_corner;
 1943|     94|                else
 1944|     94|                  goto is_not_a_corner;
 1945|     59|              else
 1946|     59|                if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1946:21): [True: 8, False: 51]
  ------------------
 1947|      8|                  if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1947:23): [True: 0, False: 8]
  ------------------
 1948|      0|                    if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1948:25): [True: 0, False: 0]
  ------------------
 1949|      0|                      if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1949:27): [True: 0, False: 0]
  ------------------
 1950|      0|                        if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1950:29): [True: 0, False: 0]
  ------------------
 1951|      0|                          if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1951:31): [True: 0, False: 0]
  ------------------
 1952|      0|                            if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1952:33): [True: 0, False: 0]
  ------------------
 1953|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1953:35): [True: 0, False: 0]
  ------------------
 1954|      0|                                goto is_a_corner;
 1955|      0|                              else
 1956|      0|                                goto is_not_a_corner;
 1957|      0|                            else
 1958|      0|                              goto is_not_a_corner;
 1959|      0|                          else
 1960|      0|                            goto is_not_a_corner;
 1961|      0|                        else
 1962|      0|                          goto is_not_a_corner;
 1963|      0|                      else
 1964|      0|                        goto is_not_a_corner;
 1965|      0|                    else
 1966|      0|                      goto is_not_a_corner;
 1967|      8|                  else
 1968|      8|                    goto is_not_a_corner;
 1969|     51|                else
 1970|     51|                  goto is_not_a_corner;
 1971|   112k|            else if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (1971:22): [True: 88.6k, False: 23.8k]
  ------------------
 1972|  88.6k|              if( p[pixel[5]] > cb)
  ------------------
  |  Branch (1972:19): [True: 768, False: 87.9k]
  ------------------
 1973|    768|                if( p[pixel[14]] > cb)
  ------------------
  |  Branch (1973:21): [True: 0, False: 768]
  ------------------
 1974|      0|                  if( p[pixel[7]] > cb)
  ------------------
  |  Branch (1974:23): [True: 0, False: 0]
  ------------------
 1975|      0|                    if( p[pixel[8]] > cb)
  ------------------
  |  Branch (1975:25): [True: 0, False: 0]
  ------------------
 1976|      0|                      if( p[pixel[9]] > cb)
  ------------------
  |  Branch (1976:27): [True: 0, False: 0]
  ------------------
 1977|      0|                        if( p[pixel[10]] > cb)
  ------------------
  |  Branch (1977:29): [True: 0, False: 0]
  ------------------
 1978|      0|                          if( p[pixel[11]] > cb)
  ------------------
  |  Branch (1978:31): [True: 0, False: 0]
  ------------------
 1979|      0|                            if( p[pixel[12]] > cb)
  ------------------
  |  Branch (1979:33): [True: 0, False: 0]
  ------------------
 1980|      0|                              if( p[pixel[13]] > cb)
  ------------------
  |  Branch (1980:35): [True: 0, False: 0]
  ------------------
 1981|      0|                                if( p[pixel[6]] > cb)
  ------------------
  |  Branch (1981:37): [True: 0, False: 0]
  ------------------
 1982|      0|                                  goto is_a_corner;
 1983|      0|                                else
 1984|      0|                                  if( p[pixel[15]] > cb)
  ------------------
  |  Branch (1984:39): [True: 0, False: 0]
  ------------------
 1985|      0|                                    goto is_a_corner;
 1986|      0|                                  else
 1987|      0|                                    goto is_not_a_corner;
 1988|      0|                              else
 1989|      0|                                goto is_not_a_corner;
 1990|      0|                            else
 1991|      0|                              goto is_not_a_corner;
 1992|      0|                          else
 1993|      0|                            goto is_not_a_corner;
 1994|      0|                        else
 1995|      0|                          goto is_not_a_corner;
 1996|      0|                      else
 1997|      0|                        goto is_not_a_corner;
 1998|      0|                    else
 1999|      0|                      goto is_not_a_corner;
 2000|      0|                  else
 2001|      0|                    goto is_not_a_corner;
 2002|    768|                else if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2002:26): [True: 675, False: 93]
  ------------------
 2003|    675|                  if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2003:23): [True: 0, False: 675]
  ------------------
 2004|      0|                    if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2004:25): [True: 0, False: 0]
  ------------------
 2005|      0|                      if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2005:27): [True: 0, False: 0]
  ------------------
 2006|      0|                        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2006:29): [True: 0, False: 0]
  ------------------
 2007|      0|                          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2007:31): [True: 0, False: 0]
  ------------------
 2008|      0|                            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2008:33): [True: 0, False: 0]
  ------------------
 2009|      0|                              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2009:35): [True: 0, False: 0]
  ------------------
 2010|      0|                                if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2010:37): [True: 0, False: 0]
  ------------------
 2011|      0|                                  goto is_a_corner;
 2012|      0|                                else
 2013|      0|                                  goto is_not_a_corner;
 2014|      0|                              else
 2015|      0|                                goto is_not_a_corner;
 2016|      0|                            else
 2017|      0|                              goto is_not_a_corner;
 2018|      0|                          else
 2019|      0|                            goto is_not_a_corner;
 2020|      0|                        else
 2021|      0|                          goto is_not_a_corner;
 2022|      0|                      else
 2023|      0|                        goto is_not_a_corner;
 2024|      0|                    else
 2025|      0|                      goto is_not_a_corner;
 2026|    675|                  else if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2026:28): [True: 582, False: 93]
  ------------------
 2027|    582|                    if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2027:25): [True: 525, False: 57]
  ------------------
 2028|    525|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2028:27): [True: 454, False: 71]
  ------------------
 2029|    454|                        goto is_a_corner;
 2030|     71|                      else
 2031|     71|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2031:29): [True: 47, False: 24]
  ------------------
 2032|     47|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2032:31): [True: 35, False: 12]
  ------------------
 2033|     35|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2033:33): [True: 23, False: 12]
  ------------------
 2034|     23|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2034:35): [True: 21, False: 2]
  ------------------
 2035|     21|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2035:37): [True: 20, False: 1]
  ------------------
 2036|     20|                                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2036:39): [True: 13, False: 7]
  ------------------
 2037|     13|                                    goto is_a_corner;
 2038|      7|                                  else
 2039|      7|                                    goto is_not_a_corner;
 2040|      1|                                else
 2041|      1|                                  goto is_not_a_corner;
 2042|      2|                              else
 2043|      2|                                goto is_not_a_corner;
 2044|     12|                            else
 2045|     12|                              goto is_not_a_corner;
 2046|     12|                          else
 2047|     12|                            goto is_not_a_corner;
 2048|     24|                        else
 2049|     24|                          goto is_not_a_corner;
 2050|     57|                    else
 2051|     57|                      goto is_not_a_corner;
 2052|     93|                  else
 2053|     93|                    goto is_not_a_corner;
 2054|     93|                else
 2055|     93|                  if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2055:23): [True: 9, False: 84]
  ------------------
 2056|      9|                    if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2056:25): [True: 1, False: 8]
  ------------------
 2057|      1|                      if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2057:27): [True: 0, False: 1]
  ------------------
 2058|      0|                        if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2058:29): [True: 0, False: 0]
  ------------------
 2059|      0|                          if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2059:31): [True: 0, False: 0]
  ------------------
 2060|      0|                            if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2060:33): [True: 0, False: 0]
  ------------------
 2061|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2061:35): [True: 0, False: 0]
  ------------------
 2062|      0|                                if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2062:37): [True: 0, False: 0]
  ------------------
 2063|      0|                                  goto is_a_corner;
 2064|      0|                                else
 2065|      0|                                  goto is_not_a_corner;
 2066|      0|                              else
 2067|      0|                                goto is_not_a_corner;
 2068|      0|                            else
 2069|      0|                              goto is_not_a_corner;
 2070|      0|                          else
 2071|      0|                            goto is_not_a_corner;
 2072|      0|                        else
 2073|      0|                          goto is_not_a_corner;
 2074|      1|                      else
 2075|      1|                        goto is_not_a_corner;
 2076|      8|                    else
 2077|      8|                      goto is_not_a_corner;
 2078|     84|                  else
 2079|     84|                    goto is_not_a_corner;
 2080|  87.9k|              else if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2080:24): [True: 67.9k, False: 19.9k]
  ------------------
 2081|  67.9k|                if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2081:21): [True: 566, False: 67.3k]
  ------------------
 2082|    566|                  if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2082:23): [True: 506, False: 60]
  ------------------
 2083|    506|                    if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2083:25): [True: 0, False: 506]
  ------------------
 2084|      0|                      if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2084:27): [True: 0, False: 0]
  ------------------
 2085|      0|                        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2085:29): [True: 0, False: 0]
  ------------------
 2086|      0|                          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2086:31): [True: 0, False: 0]
  ------------------
 2087|      0|                            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2087:33): [True: 0, False: 0]
  ------------------
 2088|      0|                              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2088:35): [True: 0, False: 0]
  ------------------
 2089|      0|                                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2089:37): [True: 0, False: 0]
  ------------------
 2090|      0|                                  if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2090:39): [True: 0, False: 0]
  ------------------
 2091|      0|                                    goto is_a_corner;
 2092|      0|                                  else
 2093|      0|                                    goto is_not_a_corner;
 2094|      0|                                else
 2095|      0|                                  goto is_not_a_corner;
 2096|      0|                              else
 2097|      0|                                goto is_not_a_corner;
 2098|      0|                            else
 2099|      0|                              goto is_not_a_corner;
 2100|      0|                          else
 2101|      0|                            goto is_not_a_corner;
 2102|      0|                        else
 2103|      0|                          goto is_not_a_corner;
 2104|      0|                      else
 2105|      0|                        goto is_not_a_corner;
 2106|    506|                    else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2106:30): [True: 443, False: 63]
  ------------------
 2107|    443|                      if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2107:27): [True: 387, False: 56]
  ------------------
 2108|    387|                        goto is_a_corner;
 2109|     56|                      else
 2110|     56|                        goto is_not_a_corner;
 2111|     63|                    else
 2112|     63|                      goto is_not_a_corner;
 2113|     60|                  else
 2114|     60|                    if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2114:25): [True: 6, False: 54]
  ------------------
 2115|      6|                      if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2115:27): [True: 0, False: 6]
  ------------------
 2116|      0|                        if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2116:29): [True: 0, False: 0]
  ------------------
 2117|      0|                          if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2117:31): [True: 0, False: 0]
  ------------------
 2118|      0|                            if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2118:33): [True: 0, False: 0]
  ------------------
 2119|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2119:35): [True: 0, False: 0]
  ------------------
 2120|      0|                                if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2120:37): [True: 0, False: 0]
  ------------------
 2121|      0|                                  if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2121:39): [True: 0, False: 0]
  ------------------
 2122|      0|                                    goto is_a_corner;
 2123|      0|                                  else
 2124|      0|                                    goto is_not_a_corner;
 2125|      0|                                else
 2126|      0|                                  goto is_not_a_corner;
 2127|      0|                              else
 2128|      0|                                goto is_not_a_corner;
 2129|      0|                            else
 2130|      0|                              goto is_not_a_corner;
 2131|      0|                          else
 2132|      0|                            goto is_not_a_corner;
 2133|      0|                        else
 2134|      0|                          goto is_not_a_corner;
 2135|      6|                      else
 2136|      6|                        goto is_not_a_corner;
 2137|     54|                    else
 2138|     54|                      goto is_not_a_corner;
 2139|  67.3k|                else if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2139:26): [True: 51.1k, False: 16.2k]
  ------------------
 2140|  51.1k|                  if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2140:23): [True: 572, False: 50.5k]
  ------------------
 2141|    572|                    if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2141:25): [True: 0, False: 572]
  ------------------
 2142|      0|                      if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2142:27): [True: 0, False: 0]
  ------------------
 2143|      0|                        if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2143:29): [True: 0, False: 0]
  ------------------
 2144|      0|                          if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2144:31): [True: 0, False: 0]
  ------------------
 2145|      0|                            if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2145:33): [True: 0, False: 0]
  ------------------
 2146|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2146:35): [True: 0, False: 0]
  ------------------
 2147|      0|                                if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2147:37): [True: 0, False: 0]
  ------------------
 2148|      0|                                  if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2148:39): [True: 0, False: 0]
  ------------------
 2149|      0|                                    goto is_a_corner;
 2150|      0|                                  else
 2151|      0|                                    goto is_not_a_corner;
 2152|      0|                                else
 2153|      0|                                  goto is_not_a_corner;
 2154|      0|                              else
 2155|      0|                                goto is_not_a_corner;
 2156|      0|                            else
 2157|      0|                              goto is_not_a_corner;
 2158|      0|                          else
 2159|      0|                            goto is_not_a_corner;
 2160|      0|                        else
 2161|      0|                          goto is_not_a_corner;
 2162|      0|                      else
 2163|      0|                        goto is_not_a_corner;
 2164|    572|                    else if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2164:30): [True: 511, False: 61]
  ------------------
 2165|    511|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2165:27): [True: 443, False: 68]
  ------------------
 2166|    443|                        goto is_a_corner;
 2167|     68|                      else
 2168|     68|                        goto is_not_a_corner;
 2169|     61|                    else
 2170|     61|                      goto is_not_a_corner;
 2171|  50.5k|                  else if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2171:28): [True: 37.7k, False: 12.8k]
  ------------------
 2172|  37.7k|                    if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2172:25): [True: 27.1k, False: 10.5k]
  ------------------
 2173|  27.1k|                      goto is_a_corner;
 2174|  10.5k|                    else
 2175|  10.5k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2175:27): [True: 8.33k, False: 2.22k]
  ------------------
 2176|  8.33k|                        goto is_a_corner;
 2177|  2.22k|                      else
 2178|  2.22k|                        goto is_not_a_corner;
 2179|  12.8k|                  else
 2180|  12.8k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2180:25): [True: 9.93k, False: 2.94k]
  ------------------
 2181|  9.93k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2181:27): [True: 7.98k, False: 1.94k]
  ------------------
 2182|  7.98k|                        goto is_a_corner;
 2183|  1.94k|                      else
 2184|  1.94k|                        goto is_not_a_corner;
 2185|  2.94k|                    else
 2186|  2.94k|                      goto is_not_a_corner;
 2187|  16.2k|                else
 2188|  16.2k|                  if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2188:23): [True: 134, False: 16.1k]
  ------------------
 2189|    134|                    if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2189:25): [True: 8, False: 126]
  ------------------
 2190|      8|                      if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2190:27): [True: 0, False: 8]
  ------------------
 2191|      0|                        if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2191:29): [True: 0, False: 0]
  ------------------
 2192|      0|                          if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2192:31): [True: 0, False: 0]
  ------------------
 2193|      0|                            if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2193:33): [True: 0, False: 0]
  ------------------
 2194|      0|                              if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2194:35): [True: 0, False: 0]
  ------------------
 2195|      0|                                if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2195:37): [True: 0, False: 0]
  ------------------
 2196|      0|                                  if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2196:39): [True: 0, False: 0]
  ------------------
 2197|      0|                                    goto is_a_corner;
 2198|      0|                                  else
 2199|      0|                                    goto is_not_a_corner;
 2200|      0|                                else
 2201|      0|                                  goto is_not_a_corner;
 2202|      0|                              else
 2203|      0|                                goto is_not_a_corner;
 2204|      0|                            else
 2205|      0|                              goto is_not_a_corner;
 2206|      0|                          else
 2207|      0|                            goto is_not_a_corner;
 2208|      0|                        else
 2209|      0|                          goto is_not_a_corner;
 2210|      8|                      else
 2211|      8|                        goto is_not_a_corner;
 2212|    126|                    else
 2213|    126|                      goto is_not_a_corner;
 2214|  16.1k|                  else if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2214:28): [True: 12.5k, False: 3.54k]
  ------------------
 2215|  12.5k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2215:25): [True: 10.0k, False: 2.55k]
  ------------------
 2216|  10.0k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2216:27): [True: 8.11k, False: 1.90k]
  ------------------
 2217|  8.11k|                        goto is_a_corner;
 2218|  1.90k|                      else
 2219|  1.90k|                        goto is_not_a_corner;
 2220|  2.55k|                    else
 2221|  2.55k|                      goto is_not_a_corner;
 2222|  3.54k|                  else
 2223|  3.54k|                    goto is_not_a_corner;
 2224|  19.9k|              else
 2225|  19.9k|                if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2225:21): [True: 121, False: 19.8k]
  ------------------
 2226|    121|                  if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2226:23): [True: 4, False: 117]
  ------------------
 2227|      4|                    if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2227:25): [True: 0, False: 4]
  ------------------
 2228|      0|                      if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2228:27): [True: 0, False: 0]
  ------------------
 2229|      0|                        if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2229:29): [True: 0, False: 0]
  ------------------
 2230|      0|                          if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2230:31): [True: 0, False: 0]
  ------------------
 2231|      0|                            if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2231:33): [True: 0, False: 0]
  ------------------
 2232|      0|                              if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2232:35): [True: 0, False: 0]
  ------------------
 2233|      0|                                if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2233:37): [True: 0, False: 0]
  ------------------
 2234|      0|                                  goto is_a_corner;
 2235|      0|                                else
 2236|      0|                                  if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2236:39): [True: 0, False: 0]
  ------------------
 2237|      0|                                    goto is_a_corner;
 2238|      0|                                  else
 2239|      0|                                    goto is_not_a_corner;
 2240|      0|                              else
 2241|      0|                                goto is_not_a_corner;
 2242|      0|                            else
 2243|      0|                              goto is_not_a_corner;
 2244|      0|                          else
 2245|      0|                            goto is_not_a_corner;
 2246|      0|                        else
 2247|      0|                          goto is_not_a_corner;
 2248|      0|                      else
 2249|      0|                        goto is_not_a_corner;
 2250|      4|                    else
 2251|      4|                      goto is_not_a_corner;
 2252|    117|                  else
 2253|    117|                    goto is_not_a_corner;
 2254|  19.8k|                else if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2254:26): [True: 15.2k, False: 4.59k]
  ------------------
 2255|  15.2k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2255:23): [True: 12.1k, False: 3.04k]
  ------------------
 2256|  12.1k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2256:25): [True: 9.89k, False: 2.30k]
  ------------------
 2257|  9.89k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2257:27): [True: 7.99k, False: 1.90k]
  ------------------
 2258|  7.99k|                        goto is_a_corner;
 2259|  1.90k|                      else
 2260|  1.90k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2260:29): [True: 1.44k, False: 465]
  ------------------
 2261|  1.44k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2261:31): [True: 1.17k, False: 270]
  ------------------
 2262|  1.17k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2262:33): [True: 968, False: 203]
  ------------------
 2263|    968|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2263:35): [True: 769, False: 199]
  ------------------
 2264|    769|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2264:37): [True: 628, False: 141]
  ------------------
 2265|    628|                                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2265:39): [True: 479, False: 149]
  ------------------
 2266|    479|                                    goto is_a_corner;
 2267|    149|                                  else
 2268|    149|                                    goto is_not_a_corner;
 2269|    141|                                else
 2270|    141|                                  goto is_not_a_corner;
 2271|    199|                              else
 2272|    199|                                goto is_not_a_corner;
 2273|    203|                            else
 2274|    203|                              goto is_not_a_corner;
 2275|    270|                          else
 2276|    270|                            goto is_not_a_corner;
 2277|    465|                        else
 2278|    465|                          goto is_not_a_corner;
 2279|  2.30k|                    else
 2280|  2.30k|                      goto is_not_a_corner;
 2281|  3.04k|                  else
 2282|  3.04k|                    goto is_not_a_corner;
 2283|  4.59k|                else
 2284|  4.59k|                  goto is_not_a_corner;
 2285|  23.8k|            else
 2286|  23.8k|              if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2286:19): [True: 226, False: 23.6k]
  ------------------
 2287|    226|                if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2287:21): [True: 7, False: 219]
  ------------------
 2288|      7|                  if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2288:23): [True: 2, False: 5]
  ------------------
 2289|      2|                    if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2289:25): [True: 0, False: 2]
  ------------------
 2290|      0|                      if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2290:27): [True: 0, False: 0]
  ------------------
 2291|      0|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2291:29): [True: 0, False: 0]
  ------------------
 2292|      0|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2292:31): [True: 0, False: 0]
  ------------------
 2293|      0|                            if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2293:33): [True: 0, False: 0]
  ------------------
 2294|      0|                              if( p[pixel[5]] > cb)
  ------------------
  |  Branch (2294:35): [True: 0, False: 0]
  ------------------
 2295|      0|                                goto is_a_corner;
 2296|      0|                              else
 2297|      0|                                if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2297:37): [True: 0, False: 0]
  ------------------
 2298|      0|                                  goto is_a_corner;
 2299|      0|                                else
 2300|      0|                                  goto is_not_a_corner;
 2301|      0|                            else
 2302|      0|                              if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2302:35): [True: 0, False: 0]
  ------------------
 2303|      0|                                if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2303:37): [True: 0, False: 0]
  ------------------
 2304|      0|                                  goto is_a_corner;
 2305|      0|                                else
 2306|      0|                                  goto is_not_a_corner;
 2307|      0|                              else
 2308|      0|                                goto is_not_a_corner;
 2309|      0|                          else
 2310|      0|                            goto is_not_a_corner;
 2311|      0|                        else
 2312|      0|                          goto is_not_a_corner;
 2313|      0|                      else
 2314|      0|                        goto is_not_a_corner;
 2315|      2|                    else
 2316|      2|                      goto is_not_a_corner;
 2317|      5|                  else
 2318|      5|                    goto is_not_a_corner;
 2319|    219|                else
 2320|    219|                  goto is_not_a_corner;
 2321|  23.6k|              else if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2321:24): [True: 18.3k, False: 5.30k]
  ------------------
 2322|  18.3k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2322:21): [True: 14.8k, False: 3.48k]
  ------------------
 2323|  14.8k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2323:23): [True: 12.1k, False: 2.65k]
  ------------------
 2324|  12.1k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2324:25): [True: 9.56k, False: 2.60k]
  ------------------
 2325|  9.56k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2325:27): [True: 7.74k, False: 1.82k]
  ------------------
 2326|  7.74k|                        goto is_a_corner;
 2327|  1.82k|                      else
 2328|  1.82k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2328:29): [True: 1.43k, False: 387]
  ------------------
 2329|  1.43k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2329:31): [True: 1.14k, False: 296]
  ------------------
 2330|  1.14k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2330:33): [True: 924, False: 216]
  ------------------
 2331|    924|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2331:35): [True: 728, False: 196]
  ------------------
 2332|    728|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2332:37): [True: 558, False: 170]
  ------------------
 2333|    558|                                  goto is_a_corner;
 2334|    170|                                else
 2335|    170|                                  goto is_not_a_corner;
 2336|    196|                              else
 2337|    196|                                goto is_not_a_corner;
 2338|    216|                            else
 2339|    216|                              goto is_not_a_corner;
 2340|    296|                          else
 2341|    296|                            goto is_not_a_corner;
 2342|    387|                        else
 2343|    387|                          goto is_not_a_corner;
 2344|  2.60k|                    else
 2345|  2.60k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2345:27): [True: 1.87k, False: 728]
  ------------------
 2346|  1.87k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2346:29): [True: 1.55k, False: 319]
  ------------------
 2347|  1.55k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2347:31): [True: 1.25k, False: 301]
  ------------------
 2348|  1.25k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2348:33): [True: 1.00k, False: 250]
  ------------------
 2349|  1.00k|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2349:35): [True: 752, False: 253]
  ------------------
 2350|    752|                                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2350:37): [True: 594, False: 158]
  ------------------
 2351|    594|                                  goto is_a_corner;
 2352|    158|                                else
 2353|    158|                                  goto is_not_a_corner;
 2354|    253|                              else
 2355|    253|                                goto is_not_a_corner;
 2356|    250|                            else
 2357|    250|                              goto is_not_a_corner;
 2358|    301|                          else
 2359|    301|                            goto is_not_a_corner;
 2360|    319|                        else
 2361|    319|                          goto is_not_a_corner;
 2362|    728|                      else
 2363|    728|                        goto is_not_a_corner;
 2364|  2.65k|                  else
 2365|  2.65k|                    goto is_not_a_corner;
 2366|  3.48k|                else
 2367|  3.48k|                  goto is_not_a_corner;
 2368|  5.30k|              else
 2369|  5.30k|                goto is_not_a_corner;
 2370|  33.1k|          else
 2371|  33.1k|            if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2371:17): [True: 283, False: 32.8k]
  ------------------
 2372|    283|              if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2372:19): [True: 16, False: 267]
  ------------------
 2373|     16|                if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2373:21): [True: 3, False: 13]
  ------------------
 2374|      3|                  if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2374:23): [True: 3, False: 0]
  ------------------
 2375|      3|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2375:25): [True: 2, False: 1]
  ------------------
 2376|      2|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2376:27): [True: 2, False: 0]
  ------------------
 2377|      2|                        if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2377:29): [True: 0, False: 2]
  ------------------
 2378|      0|                          if( p[pixel[5]] > cb)
  ------------------
  |  Branch (2378:31): [True: 0, False: 0]
  ------------------
 2379|      0|                            if( p[pixel[4]] > cb)
  ------------------
  |  Branch (2379:33): [True: 0, False: 0]
  ------------------
 2380|      0|                              goto is_a_corner;
 2381|      0|                            else
 2382|      0|                              if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2382:35): [True: 0, False: 0]
  ------------------
 2383|      0|                                goto is_a_corner;
 2384|      0|                              else
 2385|      0|                                goto is_not_a_corner;
 2386|      0|                          else
 2387|      0|                            if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2387:33): [True: 0, False: 0]
  ------------------
 2388|      0|                              if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2388:35): [True: 0, False: 0]
  ------------------
 2389|      0|                                goto is_a_corner;
 2390|      0|                              else
 2391|      0|                                goto is_not_a_corner;
 2392|      0|                            else
 2393|      0|                              goto is_not_a_corner;
 2394|      2|                        else
 2395|      2|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2395:31): [True: 2, False: 0]
  ------------------
 2396|      2|                            if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2396:33): [True: 2, False: 0]
  ------------------
 2397|      2|                              if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2397:35): [True: 2, False: 0]
  ------------------
 2398|      2|                                goto is_a_corner;
 2399|      0|                              else
 2400|      0|                                goto is_not_a_corner;
 2401|      0|                            else
 2402|      0|                              goto is_not_a_corner;
 2403|      0|                          else
 2404|      0|                            goto is_not_a_corner;
 2405|      0|                      else
 2406|      0|                        goto is_not_a_corner;
 2407|      1|                    else
 2408|      1|                      goto is_not_a_corner;
 2409|      0|                  else
 2410|      0|                    goto is_not_a_corner;
 2411|     13|                else
 2412|     13|                  goto is_not_a_corner;
 2413|    267|              else
 2414|    267|                goto is_not_a_corner;
 2415|  32.8k|            else if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2415:22): [True: 24.9k, False: 7.84k]
  ------------------
 2416|  24.9k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2416:19): [True: 20.0k, False: 4.89k]
  ------------------
 2417|  20.0k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2417:21): [True: 16.7k, False: 3.31k]
  ------------------
 2418|  16.7k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2418:23): [True: 13.3k, False: 3.45k]
  ------------------
 2419|  13.3k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2419:25): [True: 10.3k, False: 2.90k]
  ------------------
 2420|  10.3k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2420:27): [True: 8.31k, False: 2.08k]
  ------------------
 2421|  8.31k|                        goto is_a_corner;
 2422|  2.08k|                      else
 2423|  2.08k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2423:29): [True: 1.57k, False: 507]
  ------------------
 2424|  1.57k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2424:31): [True: 1.28k, False: 295]
  ------------------
 2425|  1.28k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2425:33): [True: 1.00k, False: 271]
  ------------------
 2426|  1.00k|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2426:35): [True: 804, False: 205]
  ------------------
 2427|    804|                                goto is_a_corner;
 2428|    205|                              else
 2429|    205|                                goto is_not_a_corner;
 2430|    271|                            else
 2431|    271|                              goto is_not_a_corner;
 2432|    295|                          else
 2433|    295|                            goto is_not_a_corner;
 2434|    507|                        else
 2435|    507|                          goto is_not_a_corner;
 2436|  2.90k|                    else
 2437|  2.90k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2437:27): [True: 2.25k, False: 651]
  ------------------
 2438|  2.25k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2438:29): [True: 1.80k, False: 447]
  ------------------
 2439|  1.80k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2439:31): [True: 1.52k, False: 285]
  ------------------
 2440|  1.52k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2440:33): [True: 1.18k, False: 339]
  ------------------
 2441|  1.18k|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2441:35): [True: 863, False: 318]
  ------------------
 2442|    863|                                goto is_a_corner;
 2443|    318|                              else
 2444|    318|                                goto is_not_a_corner;
 2445|    339|                            else
 2446|    339|                              goto is_not_a_corner;
 2447|    285|                          else
 2448|    285|                            goto is_not_a_corner;
 2449|    447|                        else
 2450|    447|                          goto is_not_a_corner;
 2451|    651|                      else
 2452|    651|                        goto is_not_a_corner;
 2453|  3.45k|                  else
 2454|  3.45k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2454:25): [True: 2.59k, False: 854]
  ------------------
 2455|  2.59k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2455:27): [True: 2.23k, False: 361]
  ------------------
 2456|  2.23k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2456:29): [True: 1.83k, False: 406]
  ------------------
 2457|  1.83k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2457:31): [True: 1.48k, False: 350]
  ------------------
 2458|  1.48k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2458:33): [True: 1.15k, False: 325]
  ------------------
 2459|  1.15k|                              if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2459:35): [True: 903, False: 253]
  ------------------
 2460|    903|                                goto is_a_corner;
 2461|    253|                              else
 2462|    253|                                goto is_not_a_corner;
 2463|    325|                            else
 2464|    325|                              goto is_not_a_corner;
 2465|    350|                          else
 2466|    350|                            goto is_not_a_corner;
 2467|    406|                        else
 2468|    406|                          goto is_not_a_corner;
 2469|    361|                      else
 2470|    361|                        goto is_not_a_corner;
 2471|    854|                    else
 2472|    854|                      goto is_not_a_corner;
 2473|  3.31k|                else
 2474|  3.31k|                  goto is_not_a_corner;
 2475|  4.89k|              else
 2476|  4.89k|                goto is_not_a_corner;
 2477|  7.84k|            else
 2478|  7.84k|              goto is_not_a_corner;
 2479|  45.6k|        else
 2480|  45.6k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2480:15): [True: 358, False: 45.3k]
  ------------------
 2481|    358|            if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2481:17): [True: 112, False: 246]
  ------------------
 2482|    112|              if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2482:19): [True: 86, False: 26]
  ------------------
 2483|     86|                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2483:21): [True: 75, False: 11]
  ------------------
 2484|     75|                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2484:23): [True: 61, False: 14]
  ------------------
 2485|     61|                    if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2485:25): [True: 46, False: 15]
  ------------------
 2486|     46|                      if( p[pixel[5]] > cb)
  ------------------
  |  Branch (2486:27): [True: 27, False: 19]
  ------------------
 2487|     27|                        if( p[pixel[4]] > cb)
  ------------------
  |  Branch (2487:29): [True: 10, False: 17]
  ------------------
 2488|     10|                          if( p[pixel[3]] > cb)
  ------------------
  |  Branch (2488:31): [True: 6, False: 4]
  ------------------
 2489|      6|                            goto is_a_corner;
 2490|      4|                          else
 2491|      4|                            if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2491:33): [True: 3, False: 1]
  ------------------
 2492|      3|                              goto is_a_corner;
 2493|      1|                            else
 2494|      1|                              goto is_not_a_corner;
 2495|     17|                        else
 2496|     17|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2496:31): [True: 17, False: 0]
  ------------------
 2497|     17|                            if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2497:33): [True: 15, False: 2]
  ------------------
 2498|     15|                              goto is_a_corner;
 2499|      2|                            else
 2500|      2|                              goto is_not_a_corner;
 2501|      0|                          else
 2502|      0|                            goto is_not_a_corner;
 2503|     19|                      else
 2504|     19|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2504:29): [True: 16, False: 3]
  ------------------
 2505|     16|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2505:31): [True: 9, False: 7]
  ------------------
 2506|      9|                            if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2506:33): [True: 9, False: 0]
  ------------------
 2507|      9|                              goto is_a_corner;
 2508|      0|                            else
 2509|      0|                              goto is_not_a_corner;
 2510|      7|                          else
 2511|      7|                            goto is_not_a_corner;
 2512|      3|                        else
 2513|      3|                          goto is_not_a_corner;
 2514|     15|                    else
 2515|     15|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2515:27): [True: 12, False: 3]
  ------------------
 2516|     12|                        if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2516:29): [True: 7, False: 5]
  ------------------
 2517|      7|                          if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2517:31): [True: 7, False: 0]
  ------------------
 2518|      7|                            if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2518:33): [True: 3, False: 4]
  ------------------
 2519|      3|                              goto is_a_corner;
 2520|      4|                            else
 2521|      4|                              goto is_not_a_corner;
 2522|      0|                          else
 2523|      0|                            goto is_not_a_corner;
 2524|      5|                        else
 2525|      5|                          goto is_not_a_corner;
 2526|      3|                      else
 2527|      3|                        goto is_not_a_corner;
 2528|     14|                  else
 2529|     14|                    goto is_not_a_corner;
 2530|     11|                else
 2531|     11|                  goto is_not_a_corner;
 2532|     26|              else
 2533|     26|                goto is_not_a_corner;
 2534|    246|            else
 2535|    246|              goto is_not_a_corner;
 2536|  45.3k|          else if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2536:20): [True: 33.3k, False: 11.9k]
  ------------------
 2537|  33.3k|            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2537:17): [True: 26.2k, False: 7.05k]
  ------------------
 2538|  26.2k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2538:19): [True: 21.3k, False: 4.92k]
  ------------------
 2539|  21.3k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2539:21): [True: 16.8k, False: 4.49k]
  ------------------
 2540|  16.8k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2540:23): [True: 13.4k, False: 3.38k]
  ------------------
 2541|  13.4k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2541:25): [True: 10.4k, False: 3.05k]
  ------------------
 2542|  10.4k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2542:27): [True: 8.13k, False: 2.28k]
  ------------------
 2543|  8.13k|                        goto is_a_corner;
 2544|  2.28k|                      else
 2545|  2.28k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2545:29): [True: 1.66k, False: 613]
  ------------------
 2546|  1.66k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2546:31): [True: 1.28k, False: 386]
  ------------------
 2547|  1.28k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2547:33): [True: 1.08k, False: 201]
  ------------------
 2548|  1.08k|                              goto is_a_corner;
 2549|    201|                            else
 2550|    201|                              goto is_not_a_corner;
 2551|    386|                          else
 2552|    386|                            goto is_not_a_corner;
 2553|    613|                        else
 2554|    613|                          goto is_not_a_corner;
 2555|  3.05k|                    else
 2556|  3.05k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2556:27): [True: 2.41k, False: 639]
  ------------------
 2557|  2.41k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2557:29): [True: 1.94k, False: 470]
  ------------------
 2558|  1.94k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2558:31): [True: 1.57k, False: 371]
  ------------------
 2559|  1.57k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2559:33): [True: 1.29k, False: 282]
  ------------------
 2560|  1.29k|                              goto is_a_corner;
 2561|    282|                            else
 2562|    282|                              goto is_not_a_corner;
 2563|    371|                          else
 2564|    371|                            goto is_not_a_corner;
 2565|    470|                        else
 2566|    470|                          goto is_not_a_corner;
 2567|    639|                      else
 2568|    639|                        goto is_not_a_corner;
 2569|  3.38k|                  else
 2570|  3.38k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2570:25): [True: 2.59k, False: 796]
  ------------------
 2571|  2.59k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2571:27): [True: 2.14k, False: 449]
  ------------------
 2572|  2.14k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2572:29): [True: 1.76k, False: 374]
  ------------------
 2573|  1.76k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2573:31): [True: 1.45k, False: 314]
  ------------------
 2574|  1.45k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2574:33): [True: 1.13k, False: 322]
  ------------------
 2575|  1.13k|                              goto is_a_corner;
 2576|    322|                            else
 2577|    322|                              goto is_not_a_corner;
 2578|    314|                          else
 2579|    314|                            goto is_not_a_corner;
 2580|    374|                        else
 2581|    374|                          goto is_not_a_corner;
 2582|    449|                      else
 2583|    449|                        goto is_not_a_corner;
 2584|    796|                    else
 2585|    796|                      goto is_not_a_corner;
 2586|  4.49k|                else
 2587|  4.49k|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (2587:23): [True: 3.47k, False: 1.02k]
  ------------------
 2588|  3.47k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2588:25): [True: 2.88k, False: 585]
  ------------------
 2589|  2.88k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2589:27): [True: 2.48k, False: 403]
  ------------------
 2590|  2.48k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2590:29): [True: 2.06k, False: 421]
  ------------------
 2591|  2.06k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2591:31): [True: 1.70k, False: 364]
  ------------------
 2592|  1.70k|                            if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2592:33): [True: 1.33k, False: 366]
  ------------------
 2593|  1.33k|                              goto is_a_corner;
 2594|    366|                            else
 2595|    366|                              goto is_not_a_corner;
 2596|    364|                          else
 2597|    364|                            goto is_not_a_corner;
 2598|    421|                        else
 2599|    421|                          goto is_not_a_corner;
 2600|    403|                      else
 2601|    403|                        goto is_not_a_corner;
 2602|    585|                    else
 2603|    585|                      goto is_not_a_corner;
 2604|  1.02k|                  else
 2605|  1.02k|                    goto is_not_a_corner;
 2606|  4.92k|              else
 2607|  4.92k|                goto is_not_a_corner;
 2608|  7.05k|            else
 2609|  7.05k|              goto is_not_a_corner;
 2610|  11.9k|          else
 2611|  11.9k|            goto is_not_a_corner;
 2612|  65.4k|      else
 2613|  65.4k|        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2613:13): [True: 1.31k, False: 64.0k]
  ------------------
 2614|  1.31k|          if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2614:15): [True: 947, False: 372]
  ------------------
 2615|    947|            if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2615:17): [True: 795, False: 152]
  ------------------
 2616|    795|              if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2616:19): [True: 700, False: 95]
  ------------------
 2617|    700|                if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2617:21): [True: 538, False: 162]
  ------------------
 2618|    538|                  if( p[pixel[5]] > cb)
  ------------------
  |  Branch (2618:23): [True: 400, False: 138]
  ------------------
 2619|    400|                    if( p[pixel[4]] > cb)
  ------------------
  |  Branch (2619:25): [True: 300, False: 100]
  ------------------
 2620|    300|                      if( p[pixel[3]] > cb)
  ------------------
  |  Branch (2620:27): [True: 226, False: 74]
  ------------------
 2621|    226|                        if( p[pixel[2]] > cb)
  ------------------
  |  Branch (2621:29): [True: 158, False: 68]
  ------------------
 2622|    158|                          goto is_a_corner;
 2623|     68|                        else
 2624|     68|                          if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2624:31): [True: 61, False: 7]
  ------------------
 2625|     61|                            goto is_a_corner;
 2626|      7|                          else
 2627|      7|                            goto is_not_a_corner;
 2628|     74|                      else
 2629|     74|                        if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2629:29): [True: 52, False: 22]
  ------------------
 2630|     52|                          if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2630:31): [True: 41, False: 11]
  ------------------
 2631|     41|                            goto is_a_corner;
 2632|     11|                          else
 2633|     11|                            goto is_not_a_corner;
 2634|     22|                        else
 2635|     22|                          goto is_not_a_corner;
 2636|    100|                    else
 2637|    100|                      if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2637:27): [True: 83, False: 17]
  ------------------
 2638|     83|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2638:29): [True: 72, False: 11]
  ------------------
 2639|     72|                          if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2639:31): [True: 61, False: 11]
  ------------------
 2640|     61|                            goto is_a_corner;
 2641|     11|                          else
 2642|     11|                            goto is_not_a_corner;
 2643|     11|                        else
 2644|     11|                          goto is_not_a_corner;
 2645|     17|                      else
 2646|     17|                        goto is_not_a_corner;
 2647|    138|                  else
 2648|    138|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2648:25): [True: 103, False: 35]
  ------------------
 2649|    103|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2649:27): [True: 84, False: 19]
  ------------------
 2650|     84|                        if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2650:29): [True: 69, False: 15]
  ------------------
 2651|     69|                          if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2651:31): [True: 58, False: 11]
  ------------------
 2652|     58|                            goto is_a_corner;
 2653|     11|                          else
 2654|     11|                            goto is_not_a_corner;
 2655|     15|                        else
 2656|     15|                          goto is_not_a_corner;
 2657|     19|                      else
 2658|     19|                        goto is_not_a_corner;
 2659|     35|                    else
 2660|     35|                      goto is_not_a_corner;
 2661|    162|                else
 2662|    162|                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2662:23): [True: 143, False: 19]
  ------------------
 2663|    143|                    if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2663:25): [True: 115, False: 28]
  ------------------
 2664|    115|                      if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2664:27): [True: 97, False: 18]
  ------------------
 2665|     97|                        if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2665:29): [True: 84, False: 13]
  ------------------
 2666|     84|                          if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2666:31): [True: 65, False: 19]
  ------------------
 2667|     65|                            goto is_a_corner;
 2668|     19|                          else
 2669|     19|                            goto is_not_a_corner;
 2670|     13|                        else
 2671|     13|                          goto is_not_a_corner;
 2672|     18|                      else
 2673|     18|                        goto is_not_a_corner;
 2674|     28|                    else
 2675|     28|                      goto is_not_a_corner;
 2676|     19|                  else
 2677|     19|                    goto is_not_a_corner;
 2678|     95|              else
 2679|     95|                goto is_not_a_corner;
 2680|    152|            else
 2681|    152|              goto is_not_a_corner;
 2682|    372|          else
 2683|    372|            goto is_not_a_corner;
 2684|  64.0k|        else if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2684:18): [True: 44.1k, False: 19.9k]
  ------------------
 2685|  44.1k|          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2685:15): [True: 34.7k, False: 9.36k]
  ------------------
 2686|  34.7k|            if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2686:17): [True: 28.0k, False: 6.73k]
  ------------------
 2687|  28.0k|              if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2687:19): [True: 21.4k, False: 6.56k]
  ------------------
 2688|  21.4k|                if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2688:21): [True: 16.9k, False: 4.47k]
  ------------------
 2689|  16.9k|                  if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2689:23): [True: 13.2k, False: 3.71k]
  ------------------
 2690|  13.2k|                    if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2690:25): [True: 9.96k, False: 3.31k]
  ------------------
 2691|  9.96k|                      if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2691:27): [True: 7.92k, False: 2.04k]
  ------------------
 2692|  7.92k|                        goto is_a_corner;
 2693|  2.04k|                      else
 2694|  2.04k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2694:29): [True: 1.52k, False: 520]
  ------------------
 2695|  1.52k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2695:31): [True: 1.24k, False: 285]
  ------------------
 2696|  1.24k|                            goto is_a_corner;
 2697|    285|                          else
 2698|    285|                            goto is_not_a_corner;
 2699|    520|                        else
 2700|    520|                          goto is_not_a_corner;
 2701|  3.31k|                    else
 2702|  3.31k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2702:27): [True: 2.55k, False: 754]
  ------------------
 2703|  2.55k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2703:29): [True: 2.06k, False: 499]
  ------------------
 2704|  2.06k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2704:31): [True: 1.67k, False: 386]
  ------------------
 2705|  1.67k|                            goto is_a_corner;
 2706|    386|                          else
 2707|    386|                            goto is_not_a_corner;
 2708|    499|                        else
 2709|    499|                          goto is_not_a_corner;
 2710|    754|                      else
 2711|    754|                        goto is_not_a_corner;
 2712|  3.71k|                  else
 2713|  3.71k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2713:25): [True: 2.90k, False: 804]
  ------------------
 2714|  2.90k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2714:27): [True: 2.40k, False: 506]
  ------------------
 2715|  2.40k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2715:29): [True: 2.02k, False: 378]
  ------------------
 2716|  2.02k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2716:31): [True: 1.58k, False: 435]
  ------------------
 2717|  1.58k|                            goto is_a_corner;
 2718|    435|                          else
 2719|    435|                            goto is_not_a_corner;
 2720|    378|                        else
 2721|    378|                          goto is_not_a_corner;
 2722|    506|                      else
 2723|    506|                        goto is_not_a_corner;
 2724|    804|                    else
 2725|    804|                      goto is_not_a_corner;
 2726|  4.47k|                else
 2727|  4.47k|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (2727:23): [True: 3.42k, False: 1.05k]
  ------------------
 2728|  3.42k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2728:25): [True: 2.77k, False: 651]
  ------------------
 2729|  2.77k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2729:27): [True: 2.28k, False: 492]
  ------------------
 2730|  2.28k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2730:29): [True: 1.90k, False: 378]
  ------------------
 2731|  1.90k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2731:31): [True: 1.53k, False: 367]
  ------------------
 2732|  1.53k|                            goto is_a_corner;
 2733|    367|                          else
 2734|    367|                            goto is_not_a_corner;
 2735|    378|                        else
 2736|    378|                          goto is_not_a_corner;
 2737|    492|                      else
 2738|    492|                        goto is_not_a_corner;
 2739|    651|                    else
 2740|    651|                      goto is_not_a_corner;
 2741|  1.05k|                  else
 2742|  1.05k|                    goto is_not_a_corner;
 2743|  6.56k|              else
 2744|  6.56k|                if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (2744:21): [True: 4.88k, False: 1.67k]
  ------------------
 2745|  4.88k|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (2745:23): [True: 3.83k, False: 1.04k]
  ------------------
 2746|  3.83k|                    if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2746:25): [True: 3.28k, False: 555]
  ------------------
 2747|  3.28k|                      if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2747:27): [True: 2.70k, False: 579]
  ------------------
 2748|  2.70k|                        if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2748:29): [True: 2.20k, False: 504]
  ------------------
 2749|  2.20k|                          if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2749:31): [True: 1.87k, False: 325]
  ------------------
 2750|  1.87k|                            goto is_a_corner;
 2751|    325|                          else
 2752|    325|                            goto is_not_a_corner;
 2753|    504|                        else
 2754|    504|                          goto is_not_a_corner;
 2755|    579|                      else
 2756|    579|                        goto is_not_a_corner;
 2757|    555|                    else
 2758|    555|                      goto is_not_a_corner;
 2759|  1.04k|                  else
 2760|  1.04k|                    goto is_not_a_corner;
 2761|  1.67k|                else
 2762|  1.67k|                  goto is_not_a_corner;
 2763|  6.73k|            else
 2764|  6.73k|              goto is_not_a_corner;
 2765|  9.36k|          else
 2766|  9.36k|            goto is_not_a_corner;
 2767|  19.9k|        else
 2768|  19.9k|          goto is_not_a_corner;
 2769|   335k|    else
 2770|   335k|      if( p[pixel[7]] > cb)
  ------------------
  |  Branch (2770:11): [True: 73.4k, False: 261k]
  ------------------
 2771|  73.4k|        if( p[pixel[8]] > cb)
  ------------------
  |  Branch (2771:13): [True: 54.2k, False: 19.1k]
  ------------------
 2772|  54.2k|          if( p[pixel[9]] > cb)
  ------------------
  |  Branch (2772:15): [True: 42.6k, False: 11.5k]
  ------------------
 2773|  42.6k|            if( p[pixel[6]] > cb)
  ------------------
  |  Branch (2773:17): [True: 32.7k, False: 9.84k]
  ------------------
 2774|  32.7k|              if( p[pixel[5]] > cb)
  ------------------
  |  Branch (2774:19): [True: 24.8k, False: 7.94k]
  ------------------
 2775|  24.8k|                if( p[pixel[4]] > cb)
  ------------------
  |  Branch (2775:21): [True: 19.2k, False: 5.55k]
  ------------------
 2776|  19.2k|                  if( p[pixel[3]] > cb)
  ------------------
  |  Branch (2776:23): [True: 14.3k, False: 4.92k]
  ------------------
 2777|  14.3k|                    if( p[pixel[2]] > cb)
  ------------------
  |  Branch (2777:25): [True: 10.7k, False: 3.61k]
  ------------------
 2778|  10.7k|                      if( p[pixel[1]] > cb)
  ------------------
  |  Branch (2778:27): [True: 7.19k, False: 3.56k]
  ------------------
 2779|  7.19k|                        goto is_a_corner;
 2780|  3.56k|                      else
 2781|  3.56k|                        if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2781:29): [True: 2.79k, False: 769]
  ------------------
 2782|  2.79k|                          goto is_a_corner;
 2783|    769|                        else
 2784|    769|                          goto is_not_a_corner;
 2785|  3.61k|                    else
 2786|  3.61k|                      if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2786:27): [True: 2.90k, False: 709]
  ------------------
 2787|  2.90k|                        if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2787:29): [True: 2.25k, False: 651]
  ------------------
 2788|  2.25k|                          goto is_a_corner;
 2789|    651|                        else
 2790|    651|                          goto is_not_a_corner;
 2791|    709|                      else
 2792|    709|                        goto is_not_a_corner;
 2793|  4.92k|                  else
 2794|  4.92k|                    if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2794:25): [True: 3.89k, False: 1.03k]
  ------------------
 2795|  3.89k|                      if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2795:27): [True: 3.15k, False: 735]
  ------------------
 2796|  3.15k|                        if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2796:29): [True: 2.48k, False: 667]
  ------------------
 2797|  2.48k|                          goto is_a_corner;
 2798|    667|                        else
 2799|    667|                          goto is_not_a_corner;
 2800|    735|                      else
 2801|    735|                        goto is_not_a_corner;
 2802|  1.03k|                    else
 2803|  1.03k|                      goto is_not_a_corner;
 2804|  5.55k|                else
 2805|  5.55k|                  if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2805:23): [True: 4.40k, False: 1.15k]
  ------------------
 2806|  4.40k|                    if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2806:25): [True: 3.45k, False: 948]
  ------------------
 2807|  3.45k|                      if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2807:27): [True: 2.77k, False: 677]
  ------------------
 2808|  2.77k|                        if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2808:29): [True: 2.24k, False: 533]
  ------------------
 2809|  2.24k|                          goto is_a_corner;
 2810|    533|                        else
 2811|    533|                          goto is_not_a_corner;
 2812|    677|                      else
 2813|    677|                        goto is_not_a_corner;
 2814|    948|                    else
 2815|    948|                      goto is_not_a_corner;
 2816|  1.15k|                  else
 2817|  1.15k|                    goto is_not_a_corner;
 2818|  7.94k|              else
 2819|  7.94k|                if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2819:21): [True: 6.19k, False: 1.75k]
  ------------------
 2820|  6.19k|                  if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2820:23): [True: 5.11k, False: 1.07k]
  ------------------
 2821|  5.11k|                    if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2821:25): [True: 4.34k, False: 771]
  ------------------
 2822|  4.34k|                      if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2822:27): [True: 3.51k, False: 830]
  ------------------
 2823|  3.51k|                        if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2823:29): [True: 2.79k, False: 723]
  ------------------
 2824|  2.79k|                          goto is_a_corner;
 2825|    723|                        else
 2826|    723|                          goto is_not_a_corner;
 2827|    830|                      else
 2828|    830|                        goto is_not_a_corner;
 2829|    771|                    else
 2830|    771|                      goto is_not_a_corner;
 2831|  1.07k|                  else
 2832|  1.07k|                    goto is_not_a_corner;
 2833|  1.75k|                else
 2834|  1.75k|                  goto is_not_a_corner;
 2835|  9.84k|            else
 2836|  9.84k|              if( p[pixel[10]] > cb)
  ------------------
  |  Branch (2836:19): [True: 7.36k, False: 2.48k]
  ------------------
 2837|  7.36k|                if( p[pixel[11]] > cb)
  ------------------
  |  Branch (2837:21): [True: 5.80k, False: 1.55k]
  ------------------
 2838|  5.80k|                  if( p[pixel[12]] > cb)
  ------------------
  |  Branch (2838:23): [True: 4.73k, False: 1.07k]
  ------------------
 2839|  4.73k|                    if( p[pixel[13]] > cb)
  ------------------
  |  Branch (2839:25): [True: 3.85k, False: 885]
  ------------------
 2840|  3.85k|                      if( p[pixel[14]] > cb)
  ------------------
  |  Branch (2840:27): [True: 3.10k, False: 741]
  ------------------
 2841|  3.10k|                        if( p[pixel[15]] > cb)
  ------------------
  |  Branch (2841:29): [True: 2.29k, False: 815]
  ------------------
 2842|  2.29k|                          goto is_a_corner;
 2843|    815|                        else
 2844|    815|                          goto is_not_a_corner;
 2845|    741|                      else
 2846|    741|                        goto is_not_a_corner;
 2847|    885|                    else
 2848|    885|                      goto is_not_a_corner;
 2849|  1.07k|                  else
 2850|  1.07k|                    goto is_not_a_corner;
 2851|  1.55k|                else
 2852|  1.55k|                  goto is_not_a_corner;
 2853|  2.48k|              else
 2854|  2.48k|                goto is_not_a_corner;
 2855|  11.5k|          else
 2856|  11.5k|            goto is_not_a_corner;
 2857|  19.1k|        else
 2858|  19.1k|          goto is_not_a_corner;
 2859|   261k|      else if( p[pixel[7]] < c_b)
  ------------------
  |  Branch (2859:16): [True: 76.0k, False: 185k]
  ------------------
 2860|  76.0k|        if( p[pixel[8]] < c_b)
  ------------------
  |  Branch (2860:13): [True: 56.1k, False: 19.8k]
  ------------------
 2861|  56.1k|          if( p[pixel[9]] < c_b)
  ------------------
  |  Branch (2861:15): [True: 44.3k, False: 11.8k]
  ------------------
 2862|  44.3k|            if( p[pixel[6]] < c_b)
  ------------------
  |  Branch (2862:17): [True: 33.9k, False: 10.3k]
  ------------------
 2863|  33.9k|              if( p[pixel[5]] < c_b)
  ------------------
  |  Branch (2863:19): [True: 25.7k, False: 8.16k]
  ------------------
 2864|  25.7k|                if( p[pixel[4]] < c_b)
  ------------------
  |  Branch (2864:21): [True: 19.8k, False: 5.89k]
  ------------------
 2865|  19.8k|                  if( p[pixel[3]] < c_b)
  ------------------
  |  Branch (2865:23): [True: 15.2k, False: 4.62k]
  ------------------
 2866|  15.2k|                    if( p[pixel[2]] < c_b)
  ------------------
  |  Branch (2866:25): [True: 11.2k, False: 3.94k]
  ------------------
 2867|  11.2k|                      if( p[pixel[1]] < c_b)
  ------------------
  |  Branch (2867:27): [True: 7.64k, False: 3.64k]
  ------------------
 2868|  7.64k|                        goto is_a_corner;
 2869|  3.64k|                      else
 2870|  3.64k|                        if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2870:29): [True: 2.96k, False: 678]
  ------------------
 2871|  2.96k|                          goto is_a_corner;
 2872|    678|                        else
 2873|    678|                          goto is_not_a_corner;
 2874|  3.94k|                    else
 2875|  3.94k|                      if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2875:27): [True: 3.06k, False: 874]
  ------------------
 2876|  3.06k|                        if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2876:29): [True: 2.35k, False: 717]
  ------------------
 2877|  2.35k|                          goto is_a_corner;
 2878|    717|                        else
 2879|    717|                          goto is_not_a_corner;
 2880|    874|                      else
 2881|    874|                        goto is_not_a_corner;
 2882|  4.62k|                  else
 2883|  4.62k|                    if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2883:25): [True: 3.72k, False: 900]
  ------------------
 2884|  3.72k|                      if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2884:27): [True: 3.04k, False: 679]
  ------------------
 2885|  3.04k|                        if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2885:29): [True: 2.38k, False: 669]
  ------------------
 2886|  2.38k|                          goto is_a_corner;
 2887|    669|                        else
 2888|    669|                          goto is_not_a_corner;
 2889|    679|                      else
 2890|    679|                        goto is_not_a_corner;
 2891|    900|                    else
 2892|    900|                      goto is_not_a_corner;
 2893|  5.89k|                else
 2894|  5.89k|                  if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2894:23): [True: 4.78k, False: 1.11k]
  ------------------
 2895|  4.78k|                    if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2895:25): [True: 3.89k, False: 883]
  ------------------
 2896|  3.89k|                      if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2896:27): [True: 3.16k, False: 731]
  ------------------
 2897|  3.16k|                        if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2897:29): [True: 2.45k, False: 712]
  ------------------
 2898|  2.45k|                          goto is_a_corner;
 2899|    712|                        else
 2900|    712|                          goto is_not_a_corner;
 2901|    731|                      else
 2902|    731|                        goto is_not_a_corner;
 2903|    883|                    else
 2904|    883|                      goto is_not_a_corner;
 2905|  1.11k|                  else
 2906|  1.11k|                    goto is_not_a_corner;
 2907|  8.16k|              else
 2908|  8.16k|                if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2908:21): [True: 6.46k, False: 1.69k]
  ------------------
 2909|  6.46k|                  if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2909:23): [True: 5.24k, False: 1.22k]
  ------------------
 2910|  5.24k|                    if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2910:25): [True: 4.35k, False: 895]
  ------------------
 2911|  4.35k|                      if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2911:27): [True: 3.55k, False: 799]
  ------------------
 2912|  3.55k|                        if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2912:29): [True: 2.77k, False: 780]
  ------------------
 2913|  2.77k|                          goto is_a_corner;
 2914|    780|                        else
 2915|    780|                          goto is_not_a_corner;
 2916|    799|                      else
 2917|    799|                        goto is_not_a_corner;
 2918|    895|                    else
 2919|    895|                      goto is_not_a_corner;
 2920|  1.22k|                  else
 2921|  1.22k|                    goto is_not_a_corner;
 2922|  1.69k|                else
 2923|  1.69k|                  goto is_not_a_corner;
 2924|  10.3k|            else
 2925|  10.3k|              if( p[pixel[10]] < c_b)
  ------------------
  |  Branch (2925:19): [True: 7.92k, False: 2.47k]
  ------------------
 2926|  7.92k|                if( p[pixel[11]] < c_b)
  ------------------
  |  Branch (2926:21): [True: 6.25k, False: 1.66k]
  ------------------
 2927|  6.25k|                  if( p[pixel[12]] < c_b)
  ------------------
  |  Branch (2927:23): [True: 5.09k, False: 1.16k]
  ------------------
 2928|  5.09k|                    if( p[pixel[13]] < c_b)
  ------------------
  |  Branch (2928:25): [True: 4.12k, False: 973]
  ------------------
 2929|  4.12k|                      if( p[pixel[14]] < c_b)
  ------------------
  |  Branch (2929:27): [True: 3.33k, False: 789]
  ------------------
 2930|  3.33k|                        if( p[pixel[15]] < c_b)
  ------------------
  |  Branch (2930:29): [True: 2.56k, False: 769]
  ------------------
 2931|  2.56k|                          goto is_a_corner;
 2932|    769|                        else
 2933|    769|                          goto is_not_a_corner;
 2934|    789|                      else
 2935|    789|                        goto is_not_a_corner;
 2936|    973|                    else
 2937|    973|                      goto is_not_a_corner;
 2938|  1.16k|                  else
 2939|  1.16k|                    goto is_not_a_corner;
 2940|  1.66k|                else
 2941|  1.66k|                  goto is_not_a_corner;
 2942|  2.47k|              else
 2943|  2.47k|                goto is_not_a_corner;
 2944|  11.8k|          else
 2945|  11.8k|            goto is_not_a_corner;
 2946|  19.8k|        else
 2947|  19.8k|          goto is_not_a_corner;
 2948|   185k|      else
 2949|   185k|        goto is_not_a_corner;
 2950|       |
 2951|   266k|is_a_corner:
 2952|   266k|    bmin=b;
 2953|   266k|    goto end_if;
 2954|       |
 2955|   585k|is_not_a_corner:
 2956|   585k|    bmax=b;
 2957|   585k|    goto end_if;
 2958|       |
 2959|   851k|end_if:
 2960|       |
 2961|   851k|    if(bmin == bmax - 1 || bmin == bmax)
  ------------------
  |  Branch (2961:8): [True: 108k, False: 743k]
  |  Branch (2961:28): [True: 0, False: 743k]
  ------------------
 2962|   108k|      return bmin;
 2963|   743k|    b = (bmin + bmax) / 2;
 2964|   743k|  }
 2965|   108k|}

aom_nonmax_suppression:
   41|  3.70k|{
   42|  3.70k|  int num_nonmax=0;
   43|  3.70k|  int last_row;
   44|  3.70k|  int* row_start;
   45|  3.70k|  int i, j;
   46|  3.70k|  xy* ret_nonmax;
   47|  3.70k|  int* nonmax_scores;
   48|  3.70k|  const int sz = (int)num_corners;
   49|       |
   50|       |  /*Point above points (roughly) to the pixel above the one of interest, if there
   51|       |    is a feature there.*/
   52|  3.70k|  int point_above = 0;
   53|  3.70k|  int point_below = 0;
   54|       |
   55|  3.70k|  *ret_scores = 0;
   56|  3.70k|  *ret_num_nonmax = -1;
   57|  3.70k|  if(!(corners && scores) || num_corners < 1)
  ------------------
  |  Branch (57:8): [True: 3.70k, False: 0]
  |  Branch (57:19): [True: 3.70k, False: 0]
  |  Branch (57:30): [True: 1.68k, False: 2.01k]
  ------------------
   58|  1.68k|  {
   59|  1.68k|    *ret_num_nonmax = 0;
   60|  1.68k|    return 0;
   61|  1.68k|  }
   62|       |
   63|  2.01k|  ret_nonmax = (xy*)malloc(num_corners * sizeof(xy));
   64|  2.01k|  if(!ret_nonmax)
  ------------------
  |  Branch (64:6): [True: 0, False: 2.01k]
  ------------------
   65|      0|  {
   66|      0|    return 0;
   67|      0|  }
   68|       |
   69|  2.01k|  nonmax_scores = (int*)malloc(num_corners * sizeof(*nonmax_scores));
   70|  2.01k|  if (!nonmax_scores)
  ------------------
  |  Branch (70:7): [True: 0, False: 2.01k]
  ------------------
   71|      0|  {
   72|      0|    free(ret_nonmax);
   73|      0|    return 0;
   74|      0|  }
   75|       |
   76|       |  /* Find where each row begins
   77|       |     (the corners are output in raster scan order). A beginning of -1 signifies
   78|       |     that there are no corners on that row. */
   79|  2.01k|  last_row = corners[num_corners-1].y;
   80|  2.01k|  row_start = (int*)malloc((last_row+1)*sizeof(int));
   81|  2.01k|  if(!row_start)
  ------------------
  |  Branch (81:6): [True: 0, False: 2.01k]
  ------------------
   82|      0|  {
   83|      0|    free(ret_nonmax);
   84|      0|    free(nonmax_scores);
   85|      0|    return 0;
   86|      0|  }
   87|       |
   88|  55.0k|  for(i=0; i < last_row+1; i++)
  ------------------
  |  Branch (88:12): [True: 53.0k, False: 2.01k]
  ------------------
   89|  53.0k|    row_start[i] = -1;
   90|       |
   91|  2.01k|  {
   92|  2.01k|    int prev_row = -1;
   93|   110k|    for(i=0; i< num_corners; i++)
  ------------------
  |  Branch (93:14): [True: 108k, False: 2.01k]
  ------------------
   94|   108k|      if(corners[i].y != prev_row)
  ------------------
  |  Branch (94:10): [True: 31.2k, False: 77.0k]
  ------------------
   95|  31.2k|      {
   96|  31.2k|        row_start[corners[i].y] = i;
   97|  31.2k|        prev_row = corners[i].y;
   98|  31.2k|      }
   99|  2.01k|  }
  100|       |
  101|       |
  102|       |
  103|   110k|  for(i=0; i < sz; i++)
  ------------------
  |  Branch (103:12): [True: 108k, False: 2.01k]
  ------------------
  104|   108k|  {
  105|   108k|    int score = scores[i];
  106|   108k|    xy pos = corners[i];
  107|   108k|    assert(pos.y <= last_row);
  108|       |
  109|       |    /*Check left */
  110|   108k|    if(i > 0)
  ------------------
  |  Branch (110:8): [True: 106k, False: 2.01k]
  ------------------
  111|   106k|      if(corners[i-1].x == pos.x-1 && corners[i-1].y == pos.y && Compare(scores[i-1], score))
  ------------------
  |  |   37|  20.9k|#define Compare(X, Y) ((X)>=(Y))
  |  |  ------------------
  |  |  |  Branch (37:23): [True: 10.7k, False: 10.2k]
  |  |  ------------------
  ------------------
  |  Branch (111:10): [True: 22.8k, False: 83.4k]
  |  Branch (111:39): [True: 20.9k, False: 1.81k]
  ------------------
  112|  10.7k|        continue;
  113|       |
  114|       |    /*Check right*/
  115|  97.5k|    if(i < (sz - 1))
  ------------------
  |  Branch (115:8): [True: 95.6k, False: 1.85k]
  ------------------
  116|  95.6k|      if(corners[i+1].x == pos.x+1 && corners[i+1].y == pos.y && Compare(scores[i+1], score))
  ------------------
  |  |   37|  18.7k|#define Compare(X, Y) ((X)>=(Y))
  |  |  ------------------
  |  |  |  Branch (37:23): [True: 9.22k, False: 9.47k]
  |  |  ------------------
  ------------------
  |  Branch (116:10): [True: 20.3k, False: 75.2k]
  |  Branch (116:39): [True: 18.7k, False: 1.69k]
  ------------------
  117|  9.22k|        continue;
  118|       |
  119|       |    /*Check above (if there is a valid row above)*/
  120|  88.3k|    if(pos.y > 0 && row_start[pos.y - 1] != -1)
  ------------------
  |  Branch (120:8): [True: 88.3k, False: 0]
  |  Branch (120:21): [True: 73.3k, False: 14.9k]
  ------------------
  121|  73.3k|    {
  122|       |      /*Make sure that current point_above is one
  123|       |        row above.*/
  124|  73.3k|      if(corners[point_above].y < pos.y - 1)
  ------------------
  |  Branch (124:10): [True: 15.9k, False: 57.3k]
  ------------------
  125|  15.9k|        point_above = row_start[pos.y-1];
  126|       |
  127|       |      /*Make point_above point to the first of the pixels above the current point,
  128|       |        if it exists.*/
  129|   138k|      for(; corners[point_above].y < pos.y && corners[point_above].x < pos.x - 1; point_above++)
  ------------------
  |  Branch (129:13): [True: 129k, False: 8.61k]
  |  Branch (129:47): [True: 64.8k, False: 64.7k]
  ------------------
  130|  64.8k|      {}
  131|       |
  132|       |
  133|  96.0k|      for(j=point_above; corners[j].y < pos.y && corners[j].x <= pos.x + 1; j++)
  ------------------
  |  Branch (133:26): [True: 81.3k, False: 14.6k]
  |  Branch (133:50): [True: 41.3k, False: 39.9k]
  ------------------
  134|  41.3k|      {
  135|  41.3k|        int x = corners[j].x;
  136|  41.3k|        if( (x == pos.x - 1 || x ==pos.x || x == pos.x+1) && Compare(scores[j], score))
  ------------------
  |  |   37|  41.3k|#define Compare(X, Y) ((X)>=(Y))
  |  |  ------------------
  |  |  |  Branch (37:23): [True: 18.6k, False: 22.6k]
  |  |  ------------------
  ------------------
  |  Branch (136:14): [True: 14.6k, False: 26.6k]
  |  Branch (136:32): [True: 15.0k, False: 11.6k]
  |  Branch (136:45): [True: 11.6k, False: 0]
  ------------------
  137|  18.6k|          goto cont;
  138|  41.3k|      }
  139|       |
  140|  73.3k|    }
  141|       |
  142|       |    /*Check below (if there is anything below)*/
  143|  69.6k|    if (pos.y + 1 < last_row+1 && row_start[pos.y + 1] != -1 && point_below < sz) /*Nothing below*/
  ------------------
  |  Branch (143:9): [True: 64.1k, False: 5.43k]
  |  Branch (143:35): [True: 57.5k, False: 6.68k]
  |  Branch (143:65): [True: 57.4k, False: 92]
  ------------------
  144|  57.4k|    {
  145|  57.4k|      if(corners[point_below].y < pos.y + 1)
  ------------------
  |  Branch (145:10): [True: 16.5k, False: 40.8k]
  ------------------
  146|  16.5k|        point_below = row_start[pos.y+1];
  147|       |
  148|       |      /* Make point below point to one of the pixels belowthe current point, if it
  149|       |         exists.*/
  150|   117k|      for(; point_below < sz && corners[point_below].y == pos.y+1 && corners[point_below].x < pos.x - 1; point_below++)
  ------------------
  |  Branch (150:13): [True: 116k, False: 301]
  |  Branch (150:33): [True: 110k, False: 6.39k]
  |  Branch (150:70): [True: 59.8k, False: 50.7k]
  ------------------
  151|  59.8k|      {}
  152|       |
  153|  76.6k|      for(j=point_below; j < sz && corners[j].y == pos.y+1 && corners[j].x <= pos.x + 1; j++)
  ------------------
  |  Branch (153:26): [True: 76.0k, False: 583]
  |  Branch (153:36): [True: 64.9k, False: 11.1k]
  |  Branch (153:63): [True: 32.4k, False: 32.5k]
  ------------------
  154|  32.4k|      {
  155|  32.4k|        int x = corners[j].x;
  156|  32.4k|        if( (x == pos.x - 1 || x ==pos.x || x == pos.x+1) && Compare(scores[j],score))
  ------------------
  |  |   37|  32.4k|#define Compare(X, Y) ((X)>=(Y))
  |  |  ------------------
  |  |  |  Branch (37:23): [True: 13.1k, False: 19.2k]
  |  |  ------------------
  ------------------
  |  Branch (156:14): [True: 11.0k, False: 21.3k]
  |  Branch (156:32): [True: 11.9k, False: 9.42k]
  |  Branch (156:45): [True: 9.42k, False: 0]
  ------------------
  157|  13.1k|          goto cont;
  158|  32.4k|      }
  159|  57.4k|    }
  160|       |
  161|  56.4k|    ret_nonmax[num_nonmax] = corners[i];
  162|  56.4k|    nonmax_scores[num_nonmax] = scores[i];
  163|  56.4k|    num_nonmax++;
  164|  88.3k|cont:
  165|  88.3k|    ;
  166|  88.3k|  }
  167|       |
  168|  2.01k|  free(row_start);
  169|  2.01k|  *ret_scores = nonmax_scores;
  170|  2.01k|  *ret_num_nonmax = num_nonmax;
  171|  2.01k|  return ret_nonmax;
  172|  2.01k|}

aom_vector_setup:
  167|   225k|int aom_vector_setup(Vector *vector, size_t capacity, size_t element_size) {
  168|   225k|  assert(vector != NULL);
  169|       |
  170|   225k|  if (vector == NULL) return VECTOR_ERROR;
  ------------------
  |  |   35|      0|#define VECTOR_ERROR -1
  ------------------
  |  Branch (170:7): [True: 0, False: 225k]
  ------------------
  171|       |
  172|   225k|  vector->size = 0;
  173|   225k|  vector->capacity = MAX(VECTOR_MINIMUM_CAPACITY, capacity);
  ------------------
  |  |   32|   225k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (32:20): [True: 0, False: 225k]
  |  |  ------------------
  ------------------
  174|   225k|  vector->element_size = element_size;
  175|   225k|  vector->data = malloc(vector->capacity * element_size);
  176|       |
  177|   225k|  return vector->data == NULL ? VECTOR_ERROR : VECTOR_SUCCESS;
  ------------------
  |  |   35|      0|#define VECTOR_ERROR -1
  ------------------
                return vector->data == NULL ? VECTOR_ERROR : VECTOR_SUCCESS;
  ------------------
  |  |   36|   225k|#define VECTOR_SUCCESS 0
  ------------------
  |  Branch (177:10): [True: 0, False: 225k]
  ------------------
  178|   225k|}
aom_vector_destroy:
  265|   225k|int aom_vector_destroy(Vector *vector) {
  266|   225k|  assert(vector != NULL);
  267|       |
  268|   225k|  if (vector == NULL) return VECTOR_ERROR;
  ------------------
  |  |   35|      0|#define VECTOR_ERROR -1
  ------------------
  |  Branch (268:7): [True: 0, False: 225k]
  ------------------
  269|       |
  270|   225k|  free(vector->data);
  271|   225k|  vector->data = NULL;
  272|       |
  273|   225k|  return VECTOR_SUCCESS;
  ------------------
  |  |   36|   225k|#define VECTOR_SUCCESS 0
  ------------------
  274|   225k|}
aom_vector_push_back:
  277|   227k|int aom_vector_push_back(Vector *vector, void *element) {
  278|   227k|  assert(vector != NULL);
  279|   227k|  assert(element != NULL);
  280|       |
  281|   227k|  if (_vector_should_grow(vector)) {
  ------------------
  |  Branch (281:7): [True: 0, False: 227k]
  ------------------
  282|      0|    if (_vector_adjust_capacity(vector) == VECTOR_ERROR) {
  ------------------
  |  |   35|      0|#define VECTOR_ERROR -1
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|      return VECTOR_ERROR;
  ------------------
  |  |   35|      0|#define VECTOR_ERROR -1
  ------------------
  284|      0|    }
  285|      0|  }
  286|       |
  287|   227k|  _vector_assign(vector, vector->size, element);
  288|       |
  289|   227k|  ++vector->size;
  290|       |
  291|   227k|  return VECTOR_SUCCESS;
  ------------------
  |  |   36|   227k|#define VECTOR_SUCCESS 0
  ------------------
  292|   227k|}
aom_vector_byte_size:
  424|   227k|size_t aom_vector_byte_size(const Vector *vector) {
  425|   227k|  return vector->size * vector->element_size;
  426|   227k|}
aom_vector_begin:
  469|    276|Iterator aom_vector_begin(Vector *vector) { return aom_vector_iterator(vector, 0); }
aom_vector_iterator:
  477|    276|Iterator aom_vector_iterator(Vector *vector, size_t index) {
  478|    276|  Iterator iterator = { NULL, 0 };
  479|       |
  480|    276|  assert(vector != NULL);
  481|    276|  assert(index <= vector->size);
  482|       |
  483|    276|  if (vector == NULL) return iterator;
  ------------------
  |  Branch (483:7): [True: 0, False: 276]
  ------------------
  484|    276|  if (index > vector->size) return iterator;
  ------------------
  |  Branch (484:7): [True: 0, False: 276]
  ------------------
  485|    276|  if (vector->element_size == 0) return iterator;
  ------------------
  |  Branch (485:7): [True: 0, False: 276]
  ------------------
  486|       |
  487|    276|  iterator.pointer = _vector_offset(vector, index);
  488|    276|  iterator.element_size = vector->element_size;
  489|       |
  490|    276|  return iterator;
  491|    276|}
aom_iterator_get:
  493|    552|void *aom_iterator_get(Iterator *iterator) { return iterator->pointer; }
aom_iterator_increment:
  509|    552|void aom_iterator_increment(Iterator *iterator) {
  510|    552|  assert(iterator != NULL);
  511|       |  // iterator->pointer += iterator->element_size;
  512|    552|  iterator->pointer =
  513|    552|      (unsigned char *)iterator->pointer + iterator->element_size;
  514|    552|}
vector.c:_vector_should_grow:
   34|   227k|static bool _vector_should_grow(Vector *vector) {
   35|       |  assert(vector->size <= vector->capacity);
   36|   227k|  return vector->size == vector->capacity;
   37|   227k|}
vector.c:_vector_assign:
   58|   227k|static void _vector_assign(Vector *vector, size_t index, void *element) {
   59|       |  /* Insert the element */
   60|   227k|  void *offset = _vector_offset(vector, index);
   61|   227k|  memcpy(offset, element, vector->element_size);
   62|   227k|}
vector.c:_vector_offset:
   46|   227k|static void *_vector_offset(Vector *vector, size_t index) {
   47|       |  // return vector->data + (index * vector->element_size);
   48|   227k|  return (unsigned char *)vector->data + (index * vector->element_size);
   49|   227k|}

obu.c:clz:
  186|  11.3k|static inline int clz(const unsigned int mask) {
  187|  11.3k|    return __builtin_clz(mask);
  188|  11.3k|}
thread_task.c:ctz:
  182|  56.8k|static inline int ctz(const unsigned int mask) {
  183|  56.8k|    return __builtin_ctz(mask);
  184|  56.8k|}
decode.c:ctz:
  182|  3.75k|static inline int ctz(const unsigned int mask) {
  183|  3.75k|    return __builtin_ctz(mask);
  184|  3.75k|}
decode.c:clz:
  186|  2.21M|static inline int clz(const unsigned int mask) {
  187|  2.21M|    return __builtin_clz(mask);
  188|  2.21M|}
lf_mask.c:clz:
  186|   685k|static inline int clz(const unsigned int mask) {
  187|   685k|    return __builtin_clz(mask);
  188|   685k|}
warpmv.c:clz:
  186|  5.00k|static inline int clz(const unsigned int mask) {
  187|  5.00k|    return __builtin_clz(mask);
  188|  5.00k|}
warpmv.c:clzll:
  190|  5.02k|static inline int clzll(const unsigned long long mask) {
  191|  5.02k|    return __builtin_clzll(mask);
  192|  5.02k|}
recon_tmpl.c:clz:
  186|  6.32M|static inline int clz(const unsigned int mask) {
  187|  6.32M|    return __builtin_clz(mask);
  188|  6.32M|}
cdef_apply_tmpl.c:clz:
  186|  1.03M|static inline int clz(const unsigned int mask) {
  187|  1.03M|    return __builtin_clz(mask);
  188|  1.03M|}
ipred_prepare_tmpl.c:clz:
  186|   264k|static inline int clz(const unsigned int mask) {
  187|   264k|    return __builtin_clz(mask);
  188|   264k|}

itx_tmpl.c:PXSTRIDE:
   79|  12.1k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  12.1k|    assert(!(x & 1));
  ------------------
  |  |  140|  12.1k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 12.1k]
  |  |  |  Branch (140:68): [Folded, False: 12.1k]
  |  |  ------------------
  ------------------
   81|  12.1k|    return x >> 1;
   82|  12.1k|}
recon_tmpl.c:PXSTRIDE:
   79|   709k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   709k|    assert(!(x & 1));
  ------------------
  |  |  140|   709k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 709k]
  |  |  |  Branch (140:68): [Folded, False: 709k]
  |  |  ------------------
  ------------------
   81|   709k|    return x >> 1;
   82|   709k|}
cdef_apply_tmpl.c:PXSTRIDE:
   79|  1.14M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.14M|    assert(!(x & 1));
  ------------------
  |  |  140|  1.14M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1.14M]
  |  |  |  Branch (140:68): [Folded, False: 1.14M]
  |  |  ------------------
  ------------------
   81|  1.14M|    return x >> 1;
   82|  1.14M|}
ipred_prepare_tmpl.c:PXSTRIDE:
   79|  1.12M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.12M|    assert(!(x & 1));
  ------------------
  |  |  140|  1.12M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1.12M]
  |  |  |  Branch (140:68): [Folded, False: 1.12M]
  |  |  ------------------
  ------------------
   81|  1.12M|    return x >> 1;
   82|  1.12M|}
ipred_prepare_tmpl.c:pixel_set:
   66|  67.1k|static inline void pixel_set(pixel *const dst, const int val, const int num) {
   67|   466k|    for (int n = 0; n < num; n++)
  ------------------
  |  Branch (67:21): [True: 398k, False: 67.1k]
  ------------------
   68|   398k|        dst[n] = val;
   69|  67.1k|}
lf_apply_tmpl.c:PXSTRIDE:
   79|   256k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   256k|    assert(!(x & 1));
  ------------------
  |  |  140|   256k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 256k]
  |  |  |  Branch (140:68): [Folded, False: 256k]
  |  |  ------------------
  ------------------
   81|   256k|    return x >> 1;
   82|   256k|}
lr_apply_tmpl.c:PXSTRIDE:
   79|    803|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|    803|    assert(!(x & 1));
  ------------------
  |  |  140|    803|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 803]
  |  |  |  Branch (140:68): [Folded, False: 803]
  |  |  ------------------
  ------------------
   81|    803|    return x >> 1;
   82|    803|}

lib.c:umin:
   47|  11.3k|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  11.3k|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 10.8k, False: 587]
  ------------------
   49|  11.3k|}
obu.c:ulog2:
   67|  11.3k|static inline int ulog2(const unsigned v) {
   68|  11.3k|    return 31 ^ clz(v);
   69|  11.3k|}
obu.c:imin:
   39|  91.0k|static inline int imin(const int a, const int b) {
   40|  91.0k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 91.0k, False: 0]
  ------------------
   41|  91.0k|}
obu.c:imax:
   35|  91.0k|static inline int imax(const int a, const int b) {
   36|  91.0k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 0, False: 91.0k]
  ------------------
   37|  91.0k|}
refmvs.c:imin:
   39|  4.64M|static inline int imin(const int a, const int b) {
   40|  4.64M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 1.61M, False: 3.03M]
  ------------------
   41|  4.64M|}
refmvs.c:imax:
   35|  2.50M|static inline int imax(const int a, const int b) {
   36|  2.50M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 7.46k, False: 2.50M]
  ------------------
   37|  2.50M|}
refmvs.c:iclip:
   51|  1.84M|static inline int iclip(const int v, const int min, const int max) {
   52|  1.84M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 1, False: 1.84M]
  |  Branch (52:28): [True: 718, False: 1.84M]
  ------------------
   53|  1.84M|}
thread_task.c:umin:
   47|   154k|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|   154k|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 0, False: 154k]
  ------------------
   49|   154k|}
wedge.c:imax:
   35|    256|static inline int imax(const int a, const int b) {
   36|    256|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 128, False: 128]
  ------------------
   37|    256|}
wedge.c:imin:
   39|  2.48k|static inline int imin(const int a, const int b) {
   40|  2.48k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 1.41k, False: 1.06k]
  ------------------
   41|  2.48k|}
cdf.c:imin:
   39|   546k|static inline int imin(const int a, const int b) {
   40|   546k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 136k, False: 409k]
  ------------------
   41|   546k|}
decode.c:iclip:
   51|   367k|static inline int iclip(const int v, const int min, const int max) {
   52|   367k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 4.71k, False: 362k]
  |  Branch (52:28): [True: 3.35k, False: 359k]
  ------------------
   53|   367k|}
decode.c:ulog2:
   67|  2.21M|static inline int ulog2(const unsigned v) {
   68|  2.21M|    return 31 ^ clz(v);
   69|  2.21M|}
decode.c:imax:
   35|  1.88M|static inline int imax(const int a, const int b) {
   36|  1.88M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 386k, False: 1.49M]
  ------------------
   37|  1.88M|}
decode.c:imin:
   39|  4.65M|static inline int imin(const int a, const int b) {
   40|  4.65M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 3.24M, False: 1.41M]
  ------------------
   41|  4.65M|}
decode.c:iclip_u8:
   55|   335k|static inline int iclip_u8(const int v) {
   56|   335k|    return iclip(v, 0, 255);
   57|   335k|}
lf_mask.c:imin:
   39|  5.50M|static inline int imin(const int a, const int b) {
   40|  5.50M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 768k, False: 4.73M]
  ------------------
   41|  5.50M|}
lf_mask.c:ulog2:
   67|   685k|static inline int ulog2(const unsigned v) {
   68|   685k|    return 31 ^ clz(v);
   69|   685k|}
lf_mask.c:imax:
   35|   756k|static inline int imax(const int a, const int b) {
   36|   756k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 714k, False: 41.7k]
  ------------------
   37|   756k|}
lf_mask.c:iclip:
   51|   752k|static inline int iclip(const int v, const int min, const int max) {
   52|   752k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 0, False: 752k]
  |  Branch (52:28): [True: 8.08k, False: 744k]
  ------------------
   53|   752k|}
msac.c:inv_recenter:
   75|  2.74k|static inline unsigned inv_recenter(const unsigned r, const unsigned v) {
   76|  2.74k|    if (v > (r << 1))
  ------------------
  |  Branch (76:9): [True: 10, False: 2.73k]
  ------------------
   77|     10|        return v;
   78|  2.73k|    else if ((v & 1) == 0)
  ------------------
  |  Branch (78:14): [True: 984, False: 1.75k]
  ------------------
   79|    984|        return (v >> 1) + r;
   80|  1.75k|    else
   81|  1.75k|        return r - ((v + 1) >> 1);
   82|  2.74k|}
warpmv.c:apply_sign:
   59|  24.9k|static inline int apply_sign(const int v, const int s) {
   60|  24.9k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 5.07k, False: 19.9k]
  ------------------
   61|  24.9k|}
warpmv.c:ulog2:
   67|  5.00k|static inline int ulog2(const unsigned v) {
   68|  5.00k|    return 31 ^ clz(v);
   69|  5.00k|}
warpmv.c:apply_sign64:
   63|  35.0k|static inline int apply_sign64(const int v, const int64_t s) {
   64|  35.0k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 2.68k, False: 32.3k]
  ------------------
   65|  35.0k|}
warpmv.c:iclip:
   51|  50.0k|static inline int iclip(const int v, const int min, const int max) {
   52|  50.0k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 1.06k, False: 48.9k]
  |  Branch (52:28): [True: 779, False: 48.1k]
  ------------------
   53|  50.0k|}
warpmv.c:u64log2:
   71|  5.02k|static inline int u64log2(const uint64_t v) {
   72|  5.02k|    return 63 ^ clzll(v);
   73|  5.02k|}
itx_tmpl.c:iclip:
   51|   678k|static inline int iclip(const int v, const int min, const int max) {
   52|   678k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 11.1k, False: 666k]
  |  Branch (52:28): [True: 4.64k, False: 662k]
  ------------------
   53|   678k|}
itx_tmpl.c:imin:
   39|    472|static inline int imin(const int a, const int b) {
   40|    472|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 76, False: 396]
  ------------------
   41|    472|}
recon_tmpl.c:ulog2:
   67|  6.32M|static inline int ulog2(const unsigned v) {
   68|  6.32M|    return 31 ^ clz(v);
   69|  6.32M|}
recon_tmpl.c:imin:
   39|  22.2M|static inline int imin(const int a, const int b) {
   40|  22.2M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 20.6M, False: 1.60M]
  ------------------
   41|  22.2M|}
recon_tmpl.c:imax:
   35|  3.00M|static inline int imax(const int a, const int b) {
   36|  3.00M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 2.88M, False: 120k]
  ------------------
   37|  3.00M|}
recon_tmpl.c:umin:
   47|   151M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|   151M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 107M, False: 43.8M]
  ------------------
   49|   151M|}
recon_tmpl.c:apply_sign64:
   63|   848k|static inline int apply_sign64(const int v, const int64_t s) {
   64|   848k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 84.3k, False: 764k]
  ------------------
   65|   848k|}
itx_1d.c:iclip:
   51|  1.93M|static inline int iclip(const int v, const int min, const int max) {
   52|  1.93M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 0, False: 1.93M]
  |  Branch (52:28): [True: 0, False: 1.93M]
  ------------------
   53|  1.93M|}
scan.c:imax:
   35|  3.34k|static inline int imax(const int a, const int b) {
   36|  3.34k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 2.82k, False: 523]
  ------------------
   37|  3.34k|}
cdef_apply_tmpl.c:imin:
   39|  2.64M|static inline int imin(const int a, const int b) {
   40|  2.64M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 1.82M, False: 816k]
  ------------------
   41|  2.64M|}
cdef_apply_tmpl.c:ulog2:
   67|  1.03M|static inline int ulog2(const unsigned v) {
   68|  1.03M|    return 31 ^ clz(v);
   69|  1.03M|}
ipred_prepare_tmpl.c:imin:
   39|  3.81M|static inline int imin(const int a, const int b) {
   40|  3.81M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 3.21M, False: 598k]
  ------------------
   41|  3.81M|}
lf_apply_tmpl.c:imin:
   39|   429k|static inline int imin(const int a, const int b) {
   40|   429k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 98.6k, False: 330k]
  ------------------
   41|   429k|}
lr_apply_tmpl.c:imin:
   39|  2.88k|static inline int imin(const int a, const int b) {
   40|  2.88k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 548, False: 2.33k]
  ------------------
   41|  2.88k|}

dav1d_cdef_brow_8bpc:
  102|  53.7k|{
  103|  53.7k|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  104|  53.7k|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (104:32): [True: 53.7k, Folded]
  ------------------
  105|  53.7k|    const Dav1dDSPContext *const dsp = f->dsp;
  106|  53.7k|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (106:52): [True: 21.6k, False: 32.1k]
  ------------------
  107|  53.7k|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  108|  53.7k|    const int sbsz = 16;
  109|  53.7k|    const int sb64w = f->sb128w << 1;
  110|  53.7k|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  111|  53.7k|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  112|  53.7k|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  113|  53.7k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  114|  53.7k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  115|  53.7k|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  116|  53.7k|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  117|  53.7k|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  118|  53.7k|    const int have_tt = f->c->n_tc > 1;
  119|  53.7k|    const int sb128 = f->seq_hdr->sb128;
  120|  53.7k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  121|  53.7k|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  53.7k|#define PXSTRIDE(x) (x)
  ------------------
  122|  53.7k|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  53.7k|#define PXSTRIDE(x) (x)
  ------------------
  123|       |
  124|   227k|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (124:38): [True: 173k, False: 54.0k]
  ------------------
  125|   173k|        const int tf = tc->top_pre_cdef_toggle;
  126|   173k|        const int by_idx = (by & 30) >> 1;
  127|   173k|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (127:13): [True: 32.1k, False: 141k]
  ------------------
  128|       |
  129|   173k|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (129:14): [True: 9.21k, False: 164k]
  |  Branch (129:26): [True: 10.1k, False: 153k]
  |  Branch (129:41): [True: 113k, False: 40.8k]
  ------------------
  130|   132k|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (130:13): [True: 131k, False: 1.53k]
  ------------------
  131|   131k|        {
  132|       |            // backup pre-filter data for next iteration
  133|   131k|            pixel *const cdef_top_bak[3] = {
  134|   131k|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  135|   131k|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  136|   131k|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  137|   131k|            };
  138|   131k|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout);
  139|   131k|        }
  140|       |
  141|   173k|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|   173k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   173k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  142|   173k|        pixel *iptrs[3] = { ptrs[0], ptrs[1], ptrs[2] };
  143|   173k|        edges &= ~CDEF_HAVE_LEFT;
  144|   173k|        edges |= CDEF_HAVE_RIGHT;
  145|   173k|        enum Backup2x8Flags prev_flag = 0;
  146|   605k|        for (int sbx = 0; sbx < sb64w; sbx++, edges |= CDEF_HAVE_LEFT) {
  ------------------
  |  Branch (146:27): [True: 431k, False: 173k]
  ------------------
  147|   431k|            const int sb128x = sbx >> 1;
  148|   431k|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  149|   431k|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  150|   431k|            if (cdef_idx == -1 ||
  ------------------
  |  Branch (150:17): [True: 3.14k, False: 428k]
  ------------------
  151|   428k|                (!f->frame_hdr->cdef.y_strength[cdef_idx] &&
  ------------------
  |  Branch (151:18): [True: 125k, False: 303k]
  ------------------
  152|   125k|                 !f->frame_hdr->cdef.uv_strength[cdef_idx]))
  ------------------
  |  Branch (152:18): [True: 121k, False: 4.10k]
  ------------------
  153|   124k|            {
  154|   124k|                prev_flag = 0;
  155|   124k|                goto next_sb;
  156|   124k|            }
  157|       |
  158|       |            // Create a complete 32-bit mask for the sb row ahead of time.
  159|   307k|            const uint16_t (*noskip_row)[2] = &lflvl[sb128x].noskip_mask[by_idx];
  160|   307k|            const unsigned noskip_mask = (unsigned) noskip_row[0][1] << 16 |
  161|   307k|                                                    noskip_row[0][0];
  162|       |
  163|   307k|            const int y_lvl = f->frame_hdr->cdef.y_strength[cdef_idx];
  164|   307k|            const int uv_lvl = f->frame_hdr->cdef.uv_strength[cdef_idx];
  165|   307k|            const enum Backup2x8Flags flag = !!y_lvl + (!!uv_lvl << 1);
  166|       |
  167|   307k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  168|   307k|            int y_sec_lvl = y_lvl & 3;
  169|   307k|            y_sec_lvl += y_sec_lvl == 3;
  170|   307k|            y_sec_lvl <<= bitdepth_min_8;
  171|       |
  172|   307k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  173|   307k|            int uv_sec_lvl = uv_lvl & 3;
  174|   307k|            uv_sec_lvl += uv_sec_lvl == 3;
  175|   307k|            uv_sec_lvl <<= bitdepth_min_8;
  176|       |
  177|   307k|            pixel *bptrs[3] = { iptrs[0], iptrs[1], iptrs[2] };
  178|  1.42M|            for (int bx = sbx * sbsz; bx < imin((sbx + 1) * sbsz, f->bw);
  ------------------
  |  Branch (178:39): [True: 1.11M, False: 312k]
  ------------------
  179|  1.12M|                 bx += 2, edges |= CDEF_HAVE_LEFT)
  180|  1.11M|            {
  181|  1.11M|                if (bx + 2 >= f->bw) edges &= ~CDEF_HAVE_RIGHT;
  ------------------
  |  Branch (181:21): [True: 125k, False: 990k]
  ------------------
  182|       |
  183|       |                // check if this 8x8 block had any coded coefficients; if not,
  184|       |                // go to the next block
  185|  1.11M|                const uint32_t bx_mask = 3U << (bx & 30);
  186|  1.11M|                if (!(noskip_mask & bx_mask)) {
  ------------------
  |  Branch (186:21): [True: 20.2k, False: 1.09M]
  ------------------
  187|  20.2k|                    prev_flag = 0;
  188|  20.2k|                    goto next_b;
  189|  20.2k|                }
  190|  1.09M|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  191|  1.09M|                prev_flag = flag;
  192|  1.09M|                if (do_left && edges & CDEF_HAVE_LEFT) {
  ------------------
  |  Branch (192:21): [True: 132k, False: 963k]
  |  Branch (192:32): [True: 12.2k, False: 120k]
  ------------------
  193|       |                    // we didn't backup the prefilter data because it wasn't
  194|       |                    // there, so do it here instead
  195|  12.2k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  196|  12.2k|                }
  197|  1.09M|                if (edges & CDEF_HAVE_RIGHT) {
  ------------------
  |  Branch (197:21): [True: 970k, False: 126k]
  ------------------
  198|       |                    // backup pre-filter data for next iteration
  199|   970k|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  200|   970k|                }
  201|       |
  202|  1.09M|                int dir;
  203|  1.09M|                unsigned variance;
  204|  1.09M|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (204:21): [True: 982k, False: 113k]
  |  Branch (204:34): [True: 13.4k, False: 100k]
  ------------------
  205|   989k|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  206|   989k|                                        &variance HIGHBD_CALL_SUFFIX);
  207|       |
  208|  1.09M|                const pixel *top, *bot;
  209|  1.09M|                ptrdiff_t offset;
  210|       |
  211|  1.09M|                if (!have_tt) goto st_y;
  ------------------
  |  Branch (211:21): [True: 57.7k, False: 1.03M]
  ------------------
  212|  1.03M|                if (sbrow_start && by == by_start) {
  ------------------
  |  Branch (212:21): [True: 80.6k, False: 957k]
  |  Branch (212:36): [True: 80.6k, False: 18.4E]
  ------------------
  213|  80.6k|                    if (resize) {
  ------------------
  |  Branch (213:25): [True: 0, False: 80.6k]
  ------------------
  214|      0|                        offset = (sby - 1) * 4 * y_stride + bx * 4;
  215|      0|                        top = &f->lf.cdef_lpf_line[0][offset];
  216|  80.6k|                    } else {
  217|  80.6k|                        offset = (sby * (4 << sb128) - 4) * y_stride + bx * 4;
  218|  80.6k|                        top = &f->lf.lr_lpf_line[0][offset];
  219|  80.6k|                    }
  220|  80.6k|                    bot = bptrs[0] + 8 * y_stride;
  221|   958k|                } else if (!sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (221:28): [True: 958k, False: 18.4E]
  |  Branch (221:44): [True: 202k, False: 755k]
  ------------------
  222|   202k|                    top = &f->lf.cdef_line[tf][0][sby * 4 * y_stride + bx * 4];
  223|   202k|                    if (resize) {
  ------------------
  |  Branch (223:25): [True: 0, False: 202k]
  ------------------
  224|      0|                        offset = (sby * 4 + 2) * y_stride + bx * 4;
  225|      0|                        bot = &f->lf.cdef_lpf_line[0][offset];
  226|   202k|                    } else {
  227|   202k|                        const int line = sby * (4 << sb128) + 4 * sb128 + 2;
  228|   202k|                        offset = line * y_stride + bx * 4;
  229|   202k|                        bot = &f->lf.lr_lpf_line[0][offset];
  230|   202k|                    }
  231|   754k|                } else {
  232|   817k|            st_y:;
  233|   817k|                    offset = sby * 4 * y_stride;
  234|   817k|                    top = &f->lf.cdef_line[tf][0][have_tt * offset + bx * 4];
  235|   817k|                    bot = bptrs[0] + 8 * y_stride;
  236|   817k|                }
  237|  1.10M|                if (y_pri_lvl) {
  ------------------
  |  Branch (237:21): [True: 978k, False: 121k]
  ------------------
  238|   978k|                    const int adj_y_pri_lvl = adjust_strength(y_pri_lvl, variance);
  239|   978k|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (239:25): [True: 945k, False: 33.7k]
  |  Branch (239:42): [True: 28.4k, False: 5.28k]
  ------------------
  240|   972k|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  241|   972k|                                        top, bot, adj_y_pri_lvl, y_sec_lvl,
  242|   972k|                                        dir, damping, edges HIGHBD_CALL_SUFFIX);
  243|   978k|                } else if (y_sec_lvl)
  ------------------
  |  Branch (243:28): [True: 98.7k, False: 22.9k]
  ------------------
  244|  98.7k|                    dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  245|  98.7k|                                    top, bot, 0, y_sec_lvl, 0, damping,
  246|  98.7k|                                    edges HIGHBD_CALL_SUFFIX);
  247|       |
  248|  1.10M|                if (!uv_lvl) goto skip_uv;
  ------------------
  |  Branch (248:21): [True: 768k, False: 332k]
  ------------------
  249|   332k|                assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  |  140|   332k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 332k]
  |  |  |  Branch (140:68): [Folded, False: 332k]
  |  |  ------------------
  ------------------
  250|       |
  251|   332k|                const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (251:35): [True: 291k, False: 40.2k]
  ------------------
  252|   997k|                for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (252:34): [True: 661k, False: 335k]
  ------------------
  253|   661k|                    if (!have_tt) goto st_uv;
  ------------------
  |  Branch (253:25): [True: 34.9k, False: 627k]
  ------------------
  254|   627k|                    if (sbrow_start && by == by_start) {
  ------------------
  |  Branch (254:25): [True: 46.9k, False: 580k]
  |  Branch (254:40): [True: 46.9k, False: 18.4E]
  ------------------
  255|  46.9k|                        if (resize) {
  ------------------
  |  Branch (255:29): [True: 0, False: 46.9k]
  ------------------
  256|      0|                            offset = (sby - 1) * 4 * uv_stride + (bx * 4 >> ss_hor);
  257|      0|                            top = &f->lf.cdef_lpf_line[pl][offset];
  258|  46.9k|                        } else {
  259|  46.9k|                            const int line = sby * (4 << sb128) - 4;
  260|  46.9k|                            offset = line * uv_stride + (bx * 4 >> ss_hor);
  261|  46.9k|                            top = &f->lf.lr_lpf_line[pl][offset];
  262|  46.9k|                        }
  263|  46.9k|                        bot = bptrs[pl] + (8 >> ss_ver) * uv_stride;
  264|   582k|                    } else if (!sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (264:32): [True: 582k, False: 18.4E]
  |  Branch (264:48): [True: 122k, False: 460k]
  ------------------
  265|   122k|                        const ptrdiff_t top_offset = sby * 8 * uv_stride +
  266|   122k|                                                     (bx * 4 >> ss_hor);
  267|   122k|                        top = &f->lf.cdef_line[tf][pl][top_offset];
  268|   122k|                        if (resize) {
  ------------------
  |  Branch (268:29): [True: 0, False: 122k]
  ------------------
  269|      0|                            offset = (sby * 4 + 2) * uv_stride + (bx * 4 >> ss_hor);
  270|      0|                            bot = &f->lf.cdef_lpf_line[pl][offset];
  271|   122k|                        } else {
  272|   122k|                            const int line = sby * (4 << sb128) + 4 * sb128 + 2;
  273|   122k|                            offset = line * uv_stride + (bx * 4 >> ss_hor);
  274|   122k|                            bot = &f->lf.lr_lpf_line[pl][offset];
  275|   122k|                        }
  276|   457k|                    } else {
  277|   496k|                st_uv:;
  278|   496k|                        const ptrdiff_t offset = sby * 8 * uv_stride;
  279|   496k|                        top = &f->lf.cdef_line[tf][pl][have_tt * offset + (bx * 4 >> ss_hor)];
  280|   496k|                        bot = bptrs[pl] + (8 >> ss_ver) * uv_stride;
  281|   496k|                    }
  282|   665k|                    dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1],
  283|   665k|                                         lr_bak[bit][pl], top, bot,
  284|   665k|                                         uv_pri_lvl, uv_sec_lvl, uvdir,
  285|   665k|                                         damping - 1, edges HIGHBD_CALL_SUFFIX);
  286|   665k|                }
  287|       |
  288|  1.10M|            skip_uv:
  289|  1.10M|                bit ^= 1;
  290|       |
  291|  1.12M|            next_b:
  292|  1.12M|                bptrs[0] += 8;
  293|  1.12M|                bptrs[1] += 8 >> ss_hor;
  294|  1.12M|                bptrs[2] += 8 >> ss_hor;
  295|  1.12M|            }
  296|       |
  297|   432k|        next_sb:
  298|   432k|            iptrs[0] += sbsz * 4;
  299|   432k|            iptrs[1] += sbsz * 4 >> ss_hor;
  300|   432k|            iptrs[2] += sbsz * 4 >> ss_hor;
  301|   432k|        }
  302|       |
  303|   173k|        ptrs[0] += 8 * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|   173k|#define PXSTRIDE(x) (x)
  ------------------
  304|   173k|        ptrs[1] += 8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver;
  ------------------
  |  |   53|   173k|#define PXSTRIDE(x) (x)
  ------------------
  305|   173k|        ptrs[2] += 8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver;
  ------------------
  |  |   53|   173k|#define PXSTRIDE(x) (x)
  ------------------
  306|   173k|        tc->top_pre_cdef_toggle ^= 1;
  307|   173k|    }
  308|  53.7k|}
cdef_apply_tmpl.c:backup2lines:
   44|   175k|{
   45|   175k|    const ptrdiff_t y_stride = PXSTRIDE(stride[0]);
  ------------------
  |  |   53|   175k|#define PXSTRIDE(x) (x)
  ------------------
   46|   175k|    if (y_stride < 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 175k]
  ------------------
   47|      0|        pixel_copy(dst[0] + y_stride, src[0] + 7 * y_stride, -2 * y_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   48|   175k|    else
   49|   175k|        pixel_copy(dst[0], src[0] + 6 * y_stride, 2 * y_stride);
  ------------------
  |  |   47|   175k|#define pixel_copy memcpy
  ------------------
   50|       |
   51|   175k|    if (layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (51:9): [True: 65.5k, False: 109k]
  ------------------
   52|  65.5k|        const ptrdiff_t uv_stride = PXSTRIDE(stride[1]);
  ------------------
  |  |   53|  65.5k|#define PXSTRIDE(x) (x)
  ------------------
   53|  65.5k|        if (uv_stride < 0) {
  ------------------
  |  Branch (53:13): [True: 0, False: 65.5k]
  ------------------
   54|      0|            const int uv_off = layout == DAV1D_PIXEL_LAYOUT_I420 ? 3 : 7;
  ------------------
  |  Branch (54:32): [True: 0, False: 0]
  ------------------
   55|      0|            pixel_copy(dst[1] + uv_stride, src[1] + uv_off * uv_stride, -2 * uv_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   56|      0|            pixel_copy(dst[2] + uv_stride, src[2] + uv_off * uv_stride, -2 * uv_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   57|  65.5k|        } else {
   58|  65.5k|            const int uv_off = layout == DAV1D_PIXEL_LAYOUT_I420 ? 2 : 6;
  ------------------
  |  Branch (58:32): [True: 32.3k, False: 33.2k]
  ------------------
   59|  65.5k|            pixel_copy(dst[1], src[1] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|  65.5k|#define pixel_copy memcpy
  ------------------
   60|  65.5k|            pixel_copy(dst[2], src[2] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|  65.5k|#define pixel_copy memcpy
  ------------------
   61|  65.5k|        }
   62|  65.5k|    }
   63|   175k|}
cdef_apply_tmpl.c:backup2x8:
   70|  1.06M|{
   71|  1.06M|    ptrdiff_t y_off = 0;
   72|  1.06M|    if (flag & BACKUP_2X8_Y) {
  ------------------
  |  Branch (72:9): [True: 1.04M, False: 17.1k]
  ------------------
   73|  9.41M|        for (int y = 0; y < 8; y++, y_off += PXSTRIDE(src_stride[0]))
  ------------------
  |  |   53|  8.37M|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (73:25): [True: 8.37M, False: 1.04M]
  ------------------
   74|  8.37M|            pixel_copy(dst[0][y], &src[0][y_off + x_off - 2], 2);
  ------------------
  |  |   47|  8.37M|#define pixel_copy memcpy
  ------------------
   75|  1.04M|    }
   76|       |
   77|  1.06M|    if (layout == DAV1D_PIXEL_LAYOUT_I400 || !(flag & BACKUP_2X8_UV))
  ------------------
  |  Branch (77:9): [True: 656k, False: 408k]
  |  Branch (77:46): [True: 81.6k, False: 326k]
  ------------------
   78|   737k|        return;
   79|       |
   80|   327k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   81|   327k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   82|       |
   83|   327k|    x_off >>= ss_hor;
   84|   327k|    y_off = 0;
   85|  2.34M|    for (int y = 0; y < (8 >> ss_ver); y++, y_off += PXSTRIDE(src_stride[1])) {
  ------------------
  |  |   53|  2.02M|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (85:21): [True: 2.02M, False: 327k]
  ------------------
   86|  2.02M|        pixel_copy(dst[1][y], &src[1][y_off + x_off - 2], 2);
  ------------------
  |  |   47|  2.02M|#define pixel_copy memcpy
  ------------------
   87|  2.02M|        pixel_copy(dst[2][y], &src[2][y_off + x_off - 2], 2);
  ------------------
  |  |   47|  2.02M|#define pixel_copy memcpy
  ------------------
   88|  2.02M|    }
   89|   327k|}
cdef_apply_tmpl.c:adjust_strength:
   91|  1.08M|static int adjust_strength(const int strength, const unsigned var) {
   92|  1.08M|    if (!var) return 0;
  ------------------
  |  Branch (92:9): [True: 31.1k, False: 1.05M]
  ------------------
   93|  1.05M|    const int i = var >> 6 ? imin(ulog2(var >> 6), 12) : 0;
  ------------------
  |  Branch (93:19): [True: 1.03M, False: 15.6k]
  ------------------
   94|  1.05M|    return (strength * (4 + i) + 8) >> 4;
   95|  1.08M|}
dav1d_cdef_brow_16bpc:
  102|  20.9k|{
  103|  20.9k|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  104|  20.9k|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (104:32): [Folded, False: 20.9k]
  ------------------
  105|  20.9k|    const Dav1dDSPContext *const dsp = f->dsp;
  106|  20.9k|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (106:52): [True: 7.54k, False: 13.4k]
  ------------------
  107|  20.9k|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  108|  20.9k|    const int sbsz = 16;
  109|  20.9k|    const int sb64w = f->sb128w << 1;
  110|  20.9k|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  111|  20.9k|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  112|  20.9k|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  113|  20.9k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  114|  20.9k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  115|  20.9k|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  116|  20.9k|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  117|  20.9k|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  118|  20.9k|    const int have_tt = f->c->n_tc > 1;
  119|  20.9k|    const int sb128 = f->seq_hdr->sb128;
  120|  20.9k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  121|  20.9k|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  122|  20.9k|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  123|       |
  124|  82.1k|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (124:38): [True: 61.1k, False: 21.0k]
  ------------------
  125|  61.1k|        const int tf = tc->top_pre_cdef_toggle;
  126|  61.1k|        const int by_idx = (by & 30) >> 1;
  127|  61.1k|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (127:13): [True: 13.4k, False: 47.7k]
  ------------------
  128|       |
  129|  61.1k|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (129:14): [True: 4.83k, False: 56.3k]
  |  Branch (129:26): [True: 3.43k, False: 52.8k]
  |  Branch (129:41): [True: 36.8k, False: 16.0k]
  ------------------
  130|  45.1k|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (130:13): [True: 44.3k, False: 822]
  ------------------
  131|  44.3k|        {
  132|       |            // backup pre-filter data for next iteration
  133|  44.3k|            pixel *const cdef_top_bak[3] = {
  134|  44.3k|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  135|  44.3k|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  136|  44.3k|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  137|  44.3k|            };
  138|  44.3k|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout);
  139|  44.3k|        }
  140|       |
  141|  61.1k|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|  61.1k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  61.1k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  142|  61.1k|        pixel *iptrs[3] = { ptrs[0], ptrs[1], ptrs[2] };
  143|  61.1k|        edges &= ~CDEF_HAVE_LEFT;
  144|  61.1k|        edges |= CDEF_HAVE_RIGHT;
  145|  61.1k|        enum Backup2x8Flags prev_flag = 0;
  146|   186k|        for (int sbx = 0; sbx < sb64w; sbx++, edges |= CDEF_HAVE_LEFT) {
  ------------------
  |  Branch (146:27): [True: 125k, False: 61.2k]
  ------------------
  147|   125k|            const int sb128x = sbx >> 1;
  148|   125k|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  149|   125k|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  150|   125k|            if (cdef_idx == -1 ||
  ------------------
  |  Branch (150:17): [True: 3.25k, False: 122k]
  ------------------
  151|   122k|                (!f->frame_hdr->cdef.y_strength[cdef_idx] &&
  ------------------
  |  Branch (151:18): [True: 37.9k, False: 84.4k]
  ------------------
  152|  37.9k|                 !f->frame_hdr->cdef.uv_strength[cdef_idx]))
  ------------------
  |  Branch (152:18): [True: 34.8k, False: 3.03k]
  ------------------
  153|  38.1k|            {
  154|  38.1k|                prev_flag = 0;
  155|  38.1k|                goto next_sb;
  156|  38.1k|            }
  157|       |
  158|       |            // Create a complete 32-bit mask for the sb row ahead of time.
  159|  87.5k|            const uint16_t (*noskip_row)[2] = &lflvl[sb128x].noskip_mask[by_idx];
  160|  87.5k|            const unsigned noskip_mask = (unsigned) noskip_row[0][1] << 16 |
  161|  87.5k|                                                    noskip_row[0][0];
  162|       |
  163|  87.5k|            const int y_lvl = f->frame_hdr->cdef.y_strength[cdef_idx];
  164|  87.5k|            const int uv_lvl = f->frame_hdr->cdef.uv_strength[cdef_idx];
  165|  87.5k|            const enum Backup2x8Flags flag = !!y_lvl + (!!uv_lvl << 1);
  166|       |
  167|  87.5k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  168|  87.5k|            int y_sec_lvl = y_lvl & 3;
  169|  87.5k|            y_sec_lvl += y_sec_lvl == 3;
  170|  87.5k|            y_sec_lvl <<= bitdepth_min_8;
  171|       |
  172|  87.5k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  173|  87.5k|            int uv_sec_lvl = uv_lvl & 3;
  174|  87.5k|            uv_sec_lvl += uv_sec_lvl == 3;
  175|  87.5k|            uv_sec_lvl <<= bitdepth_min_8;
  176|       |
  177|  87.5k|            pixel *bptrs[3] = { iptrs[0], iptrs[1], iptrs[2] };
  178|   215k|            for (int bx = sbx * sbsz; bx < imin((sbx + 1) * sbsz, f->bw);
  ------------------
  |  Branch (178:39): [True: 128k, False: 87.5k]
  ------------------
  179|   128k|                 bx += 2, edges |= CDEF_HAVE_LEFT)
  180|   128k|            {
  181|   128k|                if (bx + 2 >= f->bw) edges &= ~CDEF_HAVE_RIGHT;
  ------------------
  |  Branch (181:21): [True: 42.2k, False: 86.1k]
  ------------------
  182|       |
  183|       |                // check if this 8x8 block had any coded coefficients; if not,
  184|       |                // go to the next block
  185|   128k|                const uint32_t bx_mask = 3U << (bx & 30);
  186|   128k|                if (!(noskip_mask & bx_mask)) {
  ------------------
  |  Branch (186:21): [True: 3.93k, False: 124k]
  ------------------
  187|  3.93k|                    prev_flag = 0;
  188|  3.93k|                    goto next_b;
  189|  3.93k|                }
  190|   124k|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  191|   124k|                prev_flag = flag;
  192|   124k|                if (do_left && edges & CDEF_HAVE_LEFT) {
  ------------------
  |  Branch (192:21): [True: 42.2k, False: 82.1k]
  |  Branch (192:32): [True: 1.28k, False: 41.0k]
  ------------------
  193|       |                    // we didn't backup the prefilter data because it wasn't
  194|       |                    // there, so do it here instead
  195|  1.28k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  196|  1.28k|                }
  197|   124k|                if (edges & CDEF_HAVE_RIGHT) {
  ------------------
  |  Branch (197:21): [True: 82.7k, False: 41.6k]
  ------------------
  198|       |                    // backup pre-filter data for next iteration
  199|  82.7k|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  200|  82.7k|                }
  201|       |
  202|   124k|                int dir;
  203|   124k|                unsigned variance;
  204|   124k|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (204:21): [True: 104k, False: 19.5k]
  |  Branch (204:34): [True: 5.49k, False: 14.0k]
  ------------------
  205|   110k|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  206|   110k|                                        &variance HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   110k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  207|       |
  208|   124k|                const pixel *top, *bot;
  209|   124k|                ptrdiff_t offset;
  210|       |
  211|   124k|                if (!have_tt) goto st_y;
  ------------------
  |  Branch (211:21): [True: 10.0k, False: 114k]
  ------------------
  212|   114k|                if (sbrow_start && by == by_start) {
  ------------------
  |  Branch (212:21): [True: 4.84k, False: 109k]
  |  Branch (212:36): [True: 4.84k, False: 0]
  ------------------
  213|  4.84k|                    if (resize) {
  ------------------
  |  Branch (213:25): [True: 0, False: 4.84k]
  ------------------
  214|      0|                        offset = (sby - 1) * 4 * y_stride + bx * 4;
  215|      0|                        top = &f->lf.cdef_lpf_line[0][offset];
  216|  4.84k|                    } else {
  217|  4.84k|                        offset = (sby * (4 << sb128) - 4) * y_stride + bx * 4;
  218|  4.84k|                        top = &f->lf.lr_lpf_line[0][offset];
  219|  4.84k|                    }
  220|  4.84k|                    bot = bptrs[0] + 8 * y_stride;
  221|   109k|                } else if (!sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (221:28): [True: 109k, False: 18.4E]
  |  Branch (221:44): [True: 42.1k, False: 67.4k]
  ------------------
  222|  42.1k|                    top = &f->lf.cdef_line[tf][0][sby * 4 * y_stride + bx * 4];
  223|  42.1k|                    if (resize) {
  ------------------
  |  Branch (223:25): [True: 0, False: 42.1k]
  ------------------
  224|      0|                        offset = (sby * 4 + 2) * y_stride + bx * 4;
  225|      0|                        bot = &f->lf.cdef_lpf_line[0][offset];
  226|  42.1k|                    } else {
  227|  42.1k|                        const int line = sby * (4 << sb128) + 4 * sb128 + 2;
  228|  42.1k|                        offset = line * y_stride + bx * 4;
  229|  42.1k|                        bot = &f->lf.lr_lpf_line[0][offset];
  230|  42.1k|                    }
  231|  67.3k|                } else {
  232|  77.5k|            st_y:;
  233|  77.5k|                    offset = sby * 4 * y_stride;
  234|  77.5k|                    top = &f->lf.cdef_line[tf][0][have_tt * offset + bx * 4];
  235|  77.5k|                    bot = bptrs[0] + 8 * y_stride;
  236|  77.5k|                }
  237|   124k|                if (y_pri_lvl) {
  ------------------
  |  Branch (237:21): [True: 104k, False: 19.7k]
  ------------------
  238|   104k|                    const int adj_y_pri_lvl = adjust_strength(y_pri_lvl, variance);
  239|   104k|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (239:25): [True: 103k, False: 1.15k]
  |  Branch (239:42): [True: 900, False: 251]
  ------------------
  240|   104k|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  241|   104k|                                        top, bot, adj_y_pri_lvl, y_sec_lvl,
  242|   104k|                                        dir, damping, edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   104k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  243|   104k|                } else if (y_sec_lvl)
  ------------------
  |  Branch (243:28): [True: 15.4k, False: 4.27k]
  ------------------
  244|  15.4k|                    dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  245|  15.4k|                                    top, bot, 0, y_sec_lvl, 0, damping,
  246|  15.4k|                                    edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  15.4k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  247|       |
  248|   124k|                if (!uv_lvl) goto skip_uv;
  ------------------
  |  Branch (248:21): [True: 78.7k, False: 45.7k]
  ------------------
  249|  45.7k|                assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  |  140|  45.7k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 45.7k]
  |  |  |  Branch (140:68): [Folded, False: 45.7k]
  |  |  ------------------
  ------------------
  250|       |
  251|  45.7k|                const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (251:35): [True: 38.7k, False: 7.05k]
  ------------------
  252|   137k|                for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (252:34): [True: 91.4k, False: 45.8k]
  ------------------
  253|  91.4k|                    if (!have_tt) goto st_uv;
  ------------------
  |  Branch (253:25): [True: 6.15k, False: 85.2k]
  ------------------
  254|  85.2k|                    if (sbrow_start && by == by_start) {
  ------------------
  |  Branch (254:25): [True: 2.84k, False: 82.4k]
  |  Branch (254:40): [True: 2.84k, False: 0]
  ------------------
  255|  2.84k|                        if (resize) {
  ------------------
  |  Branch (255:29): [True: 0, False: 2.84k]
  ------------------
  256|      0|                            offset = (sby - 1) * 4 * uv_stride + (bx * 4 >> ss_hor);
  257|      0|                            top = &f->lf.cdef_lpf_line[pl][offset];
  258|  2.84k|                        } else {
  259|  2.84k|                            const int line = sby * (4 << sb128) - 4;
  260|  2.84k|                            offset = line * uv_stride + (bx * 4 >> ss_hor);
  261|  2.84k|                            top = &f->lf.lr_lpf_line[pl][offset];
  262|  2.84k|                        }
  263|  2.84k|                        bot = bptrs[pl] + (8 >> ss_ver) * uv_stride;
  264|  82.4k|                    } else if (!sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (264:32): [True: 82.4k, False: 18.4E]
  |  Branch (264:48): [True: 35.1k, False: 47.2k]
  ------------------
  265|  35.1k|                        const ptrdiff_t top_offset = sby * 8 * uv_stride +
  266|  35.1k|                                                     (bx * 4 >> ss_hor);
  267|  35.1k|                        top = &f->lf.cdef_line[tf][pl][top_offset];
  268|  35.1k|                        if (resize) {
  ------------------
  |  Branch (268:29): [True: 0, False: 35.1k]
  ------------------
  269|      0|                            offset = (sby * 4 + 2) * uv_stride + (bx * 4 >> ss_hor);
  270|      0|                            bot = &f->lf.cdef_lpf_line[pl][offset];
  271|  35.1k|                        } else {
  272|  35.1k|                            const int line = sby * (4 << sb128) + 4 * sb128 + 2;
  273|  35.1k|                            offset = line * uv_stride + (bx * 4 >> ss_hor);
  274|  35.1k|                            bot = &f->lf.lr_lpf_line[pl][offset];
  275|  35.1k|                        }
  276|  47.2k|                    } else {
  277|  53.4k|                st_uv:;
  278|  53.4k|                        const ptrdiff_t offset = sby * 8 * uv_stride;
  279|  53.4k|                        top = &f->lf.cdef_line[tf][pl][have_tt * offset + (bx * 4 >> ss_hor)];
  280|  53.4k|                        bot = bptrs[pl] + (8 >> ss_ver) * uv_stride;
  281|  53.4k|                    }
  282|  91.4k|                    dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1],
  283|  91.4k|                                         lr_bak[bit][pl], top, bot,
  284|  91.4k|                                         uv_pri_lvl, uv_sec_lvl, uvdir,
  285|  91.4k|                                         damping - 1, edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  91.4k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  286|  91.4k|                }
  287|       |
  288|   124k|            skip_uv:
  289|   124k|                bit ^= 1;
  290|       |
  291|   128k|            next_b:
  292|   128k|                bptrs[0] += 8;
  293|   128k|                bptrs[1] += 8 >> ss_hor;
  294|   128k|                bptrs[2] += 8 >> ss_hor;
  295|   128k|            }
  296|       |
  297|   125k|        next_sb:
  298|   125k|            iptrs[0] += sbsz * 4;
  299|   125k|            iptrs[1] += sbsz * 4 >> ss_hor;
  300|   125k|            iptrs[2] += sbsz * 4 >> ss_hor;
  301|   125k|        }
  302|       |
  303|  61.2k|        ptrs[0] += 8 * PXSTRIDE(f->cur.stride[0]);
  304|  61.2k|        ptrs[1] += 8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver;
  305|  61.2k|        ptrs[2] += 8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver;
  306|  61.2k|        tc->top_pre_cdef_toggle ^= 1;
  307|  61.2k|    }
  308|  20.9k|}

dav1d_cdef_dsp_init_8bpc:
  321|  8.03k|COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) {
  322|  8.03k|    c->dir = cdef_find_dir_c;
  323|  8.03k|    c->fb[0] = cdef_filter_block_8x8_c;
  324|  8.03k|    c->fb[1] = cdef_filter_block_4x8_c;
  325|  8.03k|    c->fb[2] = cdef_filter_block_4x4_c;
  326|       |
  327|  8.03k|#if HAVE_ASM
  328|       |#if ARCH_AARCH64 || ARCH_ARM
  329|       |    cdef_dsp_init_arm(c);
  330|       |#elif ARCH_PPC64LE
  331|       |    cdef_dsp_init_ppc(c);
  332|       |#elif ARCH_RISCV
  333|       |    cdef_dsp_init_riscv(c);
  334|       |#elif ARCH_X86
  335|       |    cdef_dsp_init_x86(c);
  336|       |#elif ARCH_LOONGARCH64
  337|       |    cdef_dsp_init_loongarch(c);
  338|       |#endif
  339|  8.03k|#endif
  340|  8.03k|}
dav1d_cdef_dsp_init_16bpc:
  321|  3.35k|COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) {
  322|  3.35k|    c->dir = cdef_find_dir_c;
  323|  3.35k|    c->fb[0] = cdef_filter_block_8x8_c;
  324|  3.35k|    c->fb[1] = cdef_filter_block_4x8_c;
  325|  3.35k|    c->fb[2] = cdef_filter_block_4x4_c;
  326|       |
  327|  3.35k|#if HAVE_ASM
  328|       |#if ARCH_AARCH64 || ARCH_ARM
  329|       |    cdef_dsp_init_arm(c);
  330|       |#elif ARCH_PPC64LE
  331|       |    cdef_dsp_init_ppc(c);
  332|       |#elif ARCH_RISCV
  333|       |    cdef_dsp_init_riscv(c);
  334|       |#elif ARCH_X86
  335|       |    cdef_dsp_init_x86(c);
  336|       |#elif ARCH_LOONGARCH64
  337|       |    cdef_dsp_init_loongarch(c);
  338|       |#endif
  339|  3.35k|#endif
  340|  3.35k|}

dav1d_cdf_thread_update:
 3918|  45.5k|{
 3919|  45.5k|#define update_cdf_1d(n1d, name) \
 3920|  45.5k|    do { \
 3921|  45.5k|        dst->name[n1d] = 0; \
 3922|  45.5k|    } while (0)
 3923|  45.5k|#define update_cdf_2d(n1d, n2d, name) \
 3924|  45.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
 3925|  45.5k|#define update_cdf_3d(n1d, n2d, n3d, name) \
 3926|  45.5k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
 3927|  45.5k|#define update_cdf_4d(n1d, n2d, n3d, n4d, name) \
 3928|  45.5k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
 3929|       |
 3930|  45.5k|    memcpy(dst, src, offsetof(CdfContext, m.intrabc));
 3931|       |
 3932|  45.5k|    update_cdf_3d(2, 2, 4, coef.eob_bin_16);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   182k|    do { \
  |  |  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 182k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3933|  45.5k|    update_cdf_3d(2, 2, 5, coef.eob_bin_32);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   182k|    do { \
  |  |  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 182k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3934|  45.5k|    update_cdf_3d(2, 2, 6, coef.eob_bin_64);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   182k|    do { \
  |  |  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 182k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3935|  45.5k|    update_cdf_3d(2, 2, 7, coef.eob_bin_128);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   182k|    do { \
  |  |  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 182k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3936|  45.5k|    update_cdf_3d(2, 2, 8, coef.eob_bin_256);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   182k|    do { \
  |  |  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 182k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3937|  45.5k|    update_cdf_2d(2, 9, coef.eob_bin_512);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  91.0k|    do { \
  |  |  |  | 3921|  91.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  91.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3938|  45.5k|    update_cdf_2d(2, 10, coef.eob_bin_1024);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  91.0k|    do { \
  |  |  |  | 3921|  91.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  91.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3939|  45.5k|    update_cdf_4d(N_TX_SIZES, 2, 4, 2, coef.eob_base_tok);
  ------------------
  |  | 3928|   273k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   683k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  2.27M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  1.82M|    do { \
  |  |  |  |  |  |  |  | 3921|  1.82M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  1.82M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.82M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 1.82M, False: 455k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 455k, False: 227k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 227k, False: 45.5k]
  |  |  ------------------
  ------------------
 3940|  45.5k|    update_cdf_4d(N_TX_SIZES, 2, 41 /*42*/, 3, coef.base_tok);
  ------------------
  |  | 3928|   273k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   683k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  19.1M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  18.6M|    do { \
  |  |  |  |  |  |  |  | 3921|  18.6M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  18.6M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 18.6M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 18.6M, False: 455k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 455k, False: 227k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 227k, False: 45.5k]
  |  |  ------------------
  ------------------
 3941|  45.5k|    update_cdf_4d(4, 2, 21, 3, coef.br_tok);
  ------------------
  |  | 3928|   227k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   546k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  8.01M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  7.65M|    do { \
  |  |  |  |  |  |  |  | 3921|  7.65M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  7.65M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 7.65M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 7.65M, False: 364k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 364k, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 182k, False: 45.5k]
  |  |  ------------------
  ------------------
 3942|  45.5k|    update_cdf_4d(N_TX_SIZES, 2, 9, 1, coef.eob_hi_bit);
  ------------------
  |  | 3928|   273k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   683k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  4.55M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  4.09M|    do { \
  |  |  |  |  |  |  |  | 3921|  4.09M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  4.09M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 4.09M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 4.09M, False: 455k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 455k, False: 227k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 227k, False: 45.5k]
  |  |  ------------------
  ------------------
 3943|  45.5k|    update_cdf_3d(N_TX_SIZES, 13, 1, coef.skip);
  ------------------
  |  | 3926|   273k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  3.18M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  2.96M|    do { \
  |  |  |  |  |  | 3921|  2.96M|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  2.96M|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 2.96M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 2.96M, False: 227k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 227k, False: 45.5k]
  |  |  ------------------
  ------------------
 3944|  45.5k|    update_cdf_3d(2, 3, 1, coef.dc_sign);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   364k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   273k|    do { \
  |  |  |  |  |  | 3921|   273k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   273k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 273k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 273k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3945|       |
 3946|  45.5k|    update_cdf_3d(2, N_INTRA_PRED_MODES, N_UV_INTRA_PRED_MODES - 1 - !k, m.uv_mode);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  1.27M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  1.18M|    do { \
  |  |  |  |  |  | 3921|  1.18M|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  1.18M|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 1.18M, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3947|  45.5k|    update_cdf_2d(4, N_PARTITIONS - 3, m.partition[BL_128X128]);
  ------------------
  |  | 3924|   227k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   182k|    do { \
  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 182k, False: 45.5k]
  |  |  ------------------
  ------------------
 3948|   182k|    for (int k = BL_64X64; k < BL_8X8; k++)
  ------------------
  |  Branch (3948:28): [True: 136k, False: 45.5k]
  ------------------
 3949|   136k|        update_cdf_2d(4, N_PARTITIONS - 1, m.partition[k]);
  ------------------
  |  | 3924|   683k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   546k|    do { \
  |  |  |  | 3921|   546k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   546k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 546k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 546k, False: 136k]
  |  |  ------------------
  ------------------
 3950|  45.5k|    update_cdf_2d(4, N_SUB8X8_PARTITIONS - 1, m.partition[BL_8X8]);
  ------------------
  |  | 3924|   227k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   182k|    do { \
  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 182k, False: 45.5k]
  |  |  ------------------
  ------------------
 3951|  45.5k|    update_cdf_2d(6, 15, m.cfl_alpha);
  ------------------
  |  | 3924|   318k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   273k|    do { \
  |  |  |  | 3921|   273k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   273k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 273k, False: 45.5k]
  |  |  ------------------
  ------------------
 3952|  45.5k|    update_cdf_2d(2, 15, m.txtp_inter1);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  91.0k|    do { \
  |  |  |  | 3921|  91.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  91.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3953|  45.5k|    update_cdf_1d(11, m.txtp_inter2);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3954|  45.5k|    update_cdf_3d(2, N_INTRA_PRED_MODES, 6, m.txtp_intra1);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  1.27M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  1.18M|    do { \
  |  |  |  |  |  | 3921|  1.18M|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  1.18M|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 1.18M, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3955|  45.5k|    update_cdf_3d(3, N_INTRA_PRED_MODES, 4, m.txtp_intra2);
  ------------------
  |  | 3926|   182k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  1.91M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  1.77M|    do { \
  |  |  |  |  |  | 3921|  1.77M|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  1.77M|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.77M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 1.77M, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 136k, False: 45.5k]
  |  |  ------------------
  ------------------
 3956|  45.5k|    update_cdf_1d(7, m.cfl_sign);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3957|  45.5k|    update_cdf_2d(8, 6, m.angle_delta);
  ------------------
  |  | 3924|   409k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   364k|    do { \
  |  |  |  | 3921|   364k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   364k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 364k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 364k, False: 45.5k]
  |  |  ------------------
  ------------------
 3958|  45.5k|    update_cdf_1d(4, m.filter_intra);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3959|  45.5k|    update_cdf_2d(3, DAV1D_MAX_SEGMENTS - 1, m.seg_id);
  ------------------
  |  | 3924|   182k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 45.5k]
  |  |  ------------------
  ------------------
 3960|  45.5k|    update_cdf_3d(2, 7, 6, m.pal_sz);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   728k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   637k|    do { \
  |  |  |  |  |  | 3921|   637k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   637k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 637k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 637k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3961|  45.5k|    update_cdf_4d(2, 7, 5, k + 1, m.color_map);
  ------------------
  |  | 3928|   136k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   728k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  3.82M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  3.18M|    do { \
  |  |  |  |  |  |  |  | 3921|  3.18M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  3.18M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 3.18M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 3.18M, False: 637k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 637k, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3962|  45.5k|    update_cdf_3d(N_TX_SIZES - 1, 3, imin(k + 1, 2), m.txsz);
  ------------------
  |  | 3926|   227k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   728k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   546k|    do { \
  |  |  |  |  |  | 3921|   546k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   546k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 546k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 546k, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 182k, False: 45.5k]
  |  |  ------------------
  ------------------
 3963|  45.5k|    update_cdf_1d(3, m.delta_q);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3964|  45.5k|    update_cdf_2d(5, 3, m.delta_lf);
  ------------------
  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   227k|    do { \
  |  |  |  | 3921|   227k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   227k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 227k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 227k, False: 45.5k]
  |  |  ------------------
  ------------------
 3965|  45.5k|    update_cdf_1d(2, m.restore_switchable);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3966|  45.5k|    update_cdf_1d(1, m.restore_wiener);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3967|  45.5k|    update_cdf_1d(1, m.restore_sgrproj);
  ------------------
  |  | 3920|  45.5k|    do { \
  |  | 3921|  45.5k|        dst->name[n1d] = 0; \
  |  | 3922|  45.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3968|  45.5k|    update_cdf_2d(4, 1, m.txtp_inter3);
  ------------------
  |  | 3924|   227k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   182k|    do { \
  |  |  |  | 3921|   182k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   182k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 182k, False: 45.5k]
  |  |  ------------------
  ------------------
 3969|  45.5k|    update_cdf_2d(N_BS_SIZES, 1, m.use_filter_intra);
  ------------------
  |  | 3924|  1.04M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  1.00M|    do { \
  |  |  |  | 3921|  1.00M|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  1.00M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.00M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 1.00M, False: 45.5k]
  |  |  ------------------
  ------------------
 3970|  45.5k|    update_cdf_3d(7, 3, 1, m.txpart);
  ------------------
  |  | 3926|   364k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  1.27M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   956k|    do { \
  |  |  |  |  |  | 3921|   956k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   956k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 956k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 956k, False: 318k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 318k, False: 45.5k]
  |  |  ------------------
  ------------------
 3971|  45.5k|    update_cdf_2d(3, 1, m.skip);
  ------------------
  |  | 3924|   182k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 45.5k]
  |  |  ------------------
  ------------------
 3972|  45.5k|    update_cdf_3d(7, 3, 1, m.pal_y);
  ------------------
  |  | 3926|   364k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  1.27M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   956k|    do { \
  |  |  |  |  |  | 3921|   956k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   956k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 956k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 956k, False: 318k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 318k, False: 45.5k]
  |  |  ------------------
  ------------------
 3973|  45.5k|    update_cdf_2d(2, 1, m.pal_uv);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  91.0k|    do { \
  |  |  |  | 3921|  91.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  91.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 91.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 91.0k, False: 45.5k]
  |  |  ------------------
  ------------------
 3974|       |
 3975|  45.5k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|  45.5k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 11.3k, False: 34.1k]
  |  |  ------------------
  ------------------
 3976|  11.3k|        return;
 3977|       |
 3978|  34.1k|    memcpy(dst->m.y_mode, src->m.y_mode,
 3979|  34.1k|           offsetof(CdfContext, kfym) - offsetof(CdfContext, m.y_mode));
 3980|       |
 3981|  34.1k|    update_cdf_2d(4, N_INTRA_PRED_MODES - 1, m.y_mode);
  ------------------
  |  | 3924|   170k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   170k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 34.1k]
  |  |  ------------------
  ------------------
 3982|  34.1k|    update_cdf_2d(9, 15, m.wedge_idx);
  ------------------
  |  | 3924|   341k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   341k|    do { \
  |  |  |  | 3921|   307k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   307k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 307k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 307k, False: 34.1k]
  |  |  ------------------
  ------------------
 3983|  34.1k|    update_cdf_2d(8, N_COMP_INTER_PRED_MODES - 1, m.comp_inter_mode);
  ------------------
  |  | 3924|   307k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   307k|    do { \
  |  |  |  | 3921|   273k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   273k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 273k, False: 34.1k]
  |  |  ------------------
  ------------------
 3984|  34.1k|    update_cdf_3d(2, 8, DAV1D_N_SWITCHABLE_FILTERS - 1, m.filter);
  ------------------
  |  | 3926|   102k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   614k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   580k|    do { \
  |  |  |  |  |  | 3921|   546k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   546k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 546k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 546k, False: 68.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 68.3k, False: 34.1k]
  |  |  ------------------
  ------------------
 3985|  34.1k|    update_cdf_2d(4, 3, m.interintra_mode);
  ------------------
  |  | 3924|   170k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   170k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 34.1k]
  |  |  ------------------
  ------------------
 3986|  34.1k|    update_cdf_2d(N_BS_SIZES, 2, m.motion_mode);
  ------------------
  |  | 3924|   785k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   785k|    do { \
  |  |  |  | 3921|   751k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   751k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 751k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 751k, False: 34.1k]
  |  |  ------------------
  ------------------
 3987|  34.1k|    update_cdf_2d(3, 1, m.skip_mode);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   102k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   102k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 102k, False: 34.1k]
  |  |  ------------------
  ------------------
 3988|  34.1k|    update_cdf_2d(6, 1, m.newmv_mode);
  ------------------
  |  | 3924|   239k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   239k|    do { \
  |  |  |  | 3921|   204k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   204k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 204k, False: 34.1k]
  |  |  ------------------
  ------------------
 3989|  34.1k|    update_cdf_2d(2, 1, m.globalmv_mode);
  ------------------
  |  | 3924|   102k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   102k|    do { \
  |  |  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  68.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 68.3k, False: 34.1k]
  |  |  ------------------
  ------------------
 3990|  34.1k|    update_cdf_2d(6, 1, m.refmv_mode);
  ------------------
  |  | 3924|   239k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   239k|    do { \
  |  |  |  | 3921|   204k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   204k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 204k, False: 34.1k]
  |  |  ------------------
  ------------------
 3991|  34.1k|    update_cdf_2d(3, 1, m.drl_bit);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   102k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   102k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 102k, False: 34.1k]
  |  |  ------------------
  ------------------
 3992|  34.1k|    update_cdf_2d(4, 1, m.intra);
  ------------------
  |  | 3924|   170k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   170k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 34.1k]
  |  |  ------------------
  ------------------
 3993|  34.1k|    update_cdf_2d(5, 1, m.comp);
  ------------------
  |  | 3924|   204k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   204k|    do { \
  |  |  |  | 3921|   170k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   170k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 170k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 170k, False: 34.1k]
  |  |  ------------------
  ------------------
 3994|  34.1k|    update_cdf_2d(5, 1, m.comp_dir);
  ------------------
  |  | 3924|   204k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   204k|    do { \
  |  |  |  | 3921|   170k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   170k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 170k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 170k, False: 34.1k]
  |  |  ------------------
  ------------------
 3995|  34.1k|    update_cdf_2d(6, 1, m.jnt_comp);
  ------------------
  |  | 3924|   239k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   239k|    do { \
  |  |  |  | 3921|   204k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   204k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 204k, False: 34.1k]
  |  |  ------------------
  ------------------
 3996|  34.1k|    update_cdf_2d(6, 1, m.mask_comp);
  ------------------
  |  | 3924|   239k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   239k|    do { \
  |  |  |  | 3921|   204k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   204k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 204k, False: 34.1k]
  |  |  ------------------
  ------------------
 3997|  34.1k|    update_cdf_2d(9, 1, m.wedge_comp);
  ------------------
  |  | 3924|   341k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   341k|    do { \
  |  |  |  | 3921|   307k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   307k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 307k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 307k, False: 34.1k]
  |  |  ------------------
  ------------------
 3998|  34.1k|    update_cdf_3d(6, 3, 1, m.ref);
  ------------------
  |  | 3926|   239k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   819k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   649k|    do { \
  |  |  |  |  |  | 3921|   614k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   614k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 614k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 614k, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 204k, False: 34.1k]
  |  |  ------------------
  ------------------
 3999|  34.1k|    update_cdf_3d(3, 3, 1, m.comp_fwd_ref);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   409k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   341k|    do { \
  |  |  |  |  |  | 3921|   307k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   307k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 307k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 307k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 102k, False: 34.1k]
  |  |  ------------------
  ------------------
 4000|  34.1k|    update_cdf_3d(2, 3, 1, m.comp_bwd_ref);
  ------------------
  |  | 3926|   102k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   239k|    do { \
  |  |  |  |  |  | 3921|   204k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   204k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 204k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 204k, False: 68.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 68.3k, False: 34.1k]
  |  |  ------------------
  ------------------
 4001|  34.1k|    update_cdf_3d(3, 3, 1, m.comp_uni_ref);
  ------------------
  |  | 3926|   136k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   409k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   341k|    do { \
  |  |  |  |  |  | 3921|   307k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   307k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 307k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 307k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 102k, False: 34.1k]
  |  |  ------------------
  ------------------
 4002|  34.1k|    update_cdf_2d(3, 1, m.seg_pred);
  ------------------
  |  | 3924|   136k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   102k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   102k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 102k, False: 34.1k]
  |  |  ------------------
  ------------------
 4003|  34.1k|    update_cdf_2d(4, 1, m.interintra);
  ------------------
  |  | 3924|   170k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   170k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 34.1k]
  |  |  ------------------
  ------------------
 4004|  34.1k|    update_cdf_2d(7, 1, m.interintra_wedge);
  ------------------
  |  | 3924|   273k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   273k|    do { \
  |  |  |  | 3921|   239k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   239k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 239k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 239k, False: 34.1k]
  |  |  ------------------
  ------------------
 4005|  34.1k|    update_cdf_2d(N_BS_SIZES, 1, m.obmc);
  ------------------
  |  | 3924|   785k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   785k|    do { \
  |  |  |  | 3921|   751k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   751k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 751k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 751k, False: 34.1k]
  |  |  ------------------
  ------------------
 4006|       |
 4007|   102k|    for (int k = 0; k < 2; k++) {
  ------------------
  |  Branch (4007:21): [True: 68.3k, False: 34.1k]
  ------------------
 4008|  68.3k|        update_cdf_1d(10, mv.comp[k].classes);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4009|  68.3k|        update_cdf_1d(1, mv.comp[k].sign);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4010|  68.3k|        update_cdf_1d(1, mv.comp[k].class0);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4011|  68.3k|        update_cdf_2d(2, 3, mv.comp[k].class0_fp);
  ------------------
  |  | 3924|   204k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   136k|    do { \
  |  |  |  | 3921|   136k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   136k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 136k, False: 68.3k]
  |  |  ------------------
  ------------------
 4012|  68.3k|        update_cdf_1d(1, mv.comp[k].class0_hp);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4013|  68.3k|        update_cdf_2d(10, 1, mv.comp[k].classN);
  ------------------
  |  | 3924|   751k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   683k|    do { \
  |  |  |  | 3921|   683k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   683k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 683k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 683k, False: 68.3k]
  |  |  ------------------
  ------------------
 4014|  68.3k|        update_cdf_1d(3, mv.comp[k].classN_fp);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4015|  68.3k|        update_cdf_1d(1, mv.comp[k].classN_hp);
  ------------------
  |  | 3920|  68.3k|    do { \
  |  | 3921|  68.3k|        dst->name[n1d] = 0; \
  |  | 3922|  68.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 4016|  68.3k|    }
 4017|  34.1k|    update_cdf_1d(N_MV_JOINTS - 1, mv.joint);
  ------------------
  |  | 3920|  34.1k|    do { \
  |  | 3921|  34.1k|        dst->name[n1d] = 0; \
  |  | 3922|  34.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 34.1k]
  |  |  ------------------
  ------------------
 4018|  34.1k|}
dav1d_cdf_thread_init_static:
 4023|  26.7k|void dav1d_cdf_thread_init_static(CdfThreadContext *const cdf, const unsigned qidx) {
 4024|       |    cdf->ref = NULL;
 4025|  26.7k|    cdf->data.qcat = (qidx > 20) + (qidx > 60) + (qidx > 120);
 4026|  26.7k|}
dav1d_cdf_thread_copy:
 4028|   118k|void dav1d_cdf_thread_copy(CdfContext *const dst, const CdfThreadContext *const src) {
 4029|   118k|    if (src->ref) {
  ------------------
  |  Branch (4029:9): [True: 54.3k, False: 63.8k]
  ------------------
 4030|  54.3k|        memcpy(dst, src->data.cdf, sizeof(*dst));
 4031|  63.8k|    } else {
 4032|  63.8k|        dst->coef = default_coef_cdf[src->data.qcat];
 4033|  63.8k|        memcpy(&dst->m, &default_cdf.m,
 4034|  63.8k|               offsetof(CdfDefaultContext, mv.joint));
 4035|  63.8k|        memcpy(&dst->mv.comp[1], &default_cdf.mv.comp,
 4036|       |               sizeof(default_cdf) - offsetof(CdfDefaultContext, mv.comp));
 4037|  63.8k|    }
 4038|   118k|}
dav1d_cdf_thread_alloc:
 4042|  45.5k|{
 4043|  45.5k|    cdf->ref = dav1d_ref_create_using_pool(c->cdf_pool,
 4044|  45.5k|                                           sizeof(CdfContext) + sizeof(atomic_uint));
 4045|  45.5k|    if (!cdf->ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (4045:9): [True: 0, False: 45.5k]
  ------------------
 4046|  45.5k|    cdf->data.cdf = cdf->ref->data;
 4047|  45.5k|    if (have_frame_mt) {
  ------------------
  |  Branch (4047:9): [True: 0, False: 45.5k]
  ------------------
 4048|      0|        cdf->progress = (atomic_uint *) &cdf->data.cdf[1];
 4049|       |        atomic_init(cdf->progress, 0);
 4050|      0|    }
 4051|  45.5k|    return 0;
 4052|  45.5k|}
dav1d_cdf_thread_ref:
 4056|   144k|{
 4057|   144k|    *dst = *src;
 4058|   144k|    if (src->ref)
  ------------------
  |  Branch (4058:9): [True: 144k, False: 0]
  ------------------
 4059|   144k|        dav1d_ref_inc(src->ref);
 4060|   144k|}
dav1d_cdf_thread_unref:
 4062|   484k|void dav1d_cdf_thread_unref(CdfThreadContext *const cdf) {
 4063|       |    memset(&cdf->data, 0, sizeof(*cdf) - offsetof(CdfThreadContext, data));
 4064|   484k|    dav1d_ref_dec(&cdf->ref);
 4065|   484k|}

dav1d_init_cpu:
   63|      1|COLD void dav1d_init_cpu(void) {
   64|      1|#if HAVE_ASM && !__has_feature(memory_sanitizer)
   65|       |// memory sanitizer is inherently incompatible with asm
   66|       |#if ARCH_AARCH64 || ARCH_ARM
   67|       |    dav1d_cpu_flags = dav1d_get_cpu_flags_arm();
   68|       |#elif ARCH_LOONGARCH
   69|       |    dav1d_cpu_flags = dav1d_get_cpu_flags_loongarch();
   70|       |#elif ARCH_PPC64LE
   71|       |    dav1d_cpu_flags = dav1d_get_cpu_flags_ppc();
   72|       |#elif ARCH_RISCV
   73|       |    dav1d_cpu_flags = dav1d_get_cpu_flags_riscv();
   74|       |#elif ARCH_X86
   75|       |    dav1d_cpu_flags = dav1d_get_cpu_flags_x86();
   76|      1|#endif
   77|      1|#endif
   78|      1|}

pal.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
pal.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
refmvs.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
refmvs.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
cpu.c:dav1d_get_default_cpu_flags:
   58|      1|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|      1|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|      1|#endif
  119|      1|#endif
  120|       |
  121|      1|    return flags;
  122|      1|}
msac.c:dav1d_get_cpu_flags:
  124|  72.6k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  72.6k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  72.6k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  72.6k|    flags |= dav1d_get_default_cpu_flags();
  131|  72.6k|#endif
  132|       |
  133|  72.6k|    return flags;
  134|  72.6k|}
msac.c:dav1d_get_default_cpu_flags:
   58|  72.6k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  72.6k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  72.6k|#endif
  119|  72.6k|#endif
  120|       |
  121|  72.6k|    return flags;
  122|  72.6k|}
cdef_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
cdef_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
filmgrain_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
filmgrain_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
ipred_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
ipred_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
itx_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
itx_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
loopfilter_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
loopfilter_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
looprestoration_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
looprestoration_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}
mc_tmpl.c:dav1d_get_cpu_flags:
  124|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.3k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|  11.3k|#if TRIM_DSP_FUNCTIONS
  128|       |/* Since this function is inlined, unconditionally setting a flag here will
  129|       | * enable dead code elimination in the calling function. */
  130|  11.3k|    flags |= dav1d_get_default_cpu_flags();
  131|  11.3k|#endif
  132|       |
  133|  11.3k|    return flags;
  134|  11.3k|}
mc_tmpl.c:dav1d_get_default_cpu_flags:
   58|  11.3k|static ALWAYS_INLINE unsigned dav1d_get_default_cpu_flags(void) {
   59|  11.3k|    unsigned flags = 0;
   60|       |
   61|       |#if ARCH_AARCH64 || ARCH_ARM
   62|       |#if defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32) || ARCH_AARCH64
   63|       |    flags |= DAV1D_ARM_CPU_FLAG_NEON;
   64|       |#endif
   65|       |#ifdef __ARM_FEATURE_DOTPROD
   66|       |    flags |= DAV1D_ARM_CPU_FLAG_DOTPROD;
   67|       |#endif
   68|       |#ifdef __ARM_FEATURE_MATMUL_INT8
   69|       |    flags |= DAV1D_ARM_CPU_FLAG_I8MM;
   70|       |#endif
   71|       |#if ARCH_AARCH64
   72|       |#ifdef __ARM_FEATURE_SVE
   73|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE;
   74|       |#endif
   75|       |#ifdef __ARM_FEATURE_SVE2
   76|       |    flags |= DAV1D_ARM_CPU_FLAG_SVE2;
   77|       |#endif
   78|       |#endif /* ARCH_AARCH64 */
   79|       |#elif ARCH_PPC64LE
   80|       |#if defined(__VSX__)
   81|       |    flags |= DAV1D_PPC_CPU_FLAG_VSX;
   82|       |#endif
   83|       |#if defined(__POWER9_VECTOR__)
   84|       |    flags |= DAV1D_PPC_CPU_FLAG_PWR9;
   85|       |#endif
   86|       |#elif ARCH_RISCV
   87|       |#if defined(__riscv_v)
   88|       |    flags |= DAV1D_RISCV_CPU_FLAG_V;
   89|       |#endif
   90|       |#elif ARCH_X86
   91|       |#if defined(__AVX512F__) && defined(__AVX512CD__) && \
   92|       |    defined(__AVX512BW__) && defined(__AVX512DQ__) && \
   93|       |    defined(__AVX512VL__) && defined(__AVX512VNNI__) && \
   94|       |    defined(__AVX512IFMA__) && defined(__AVX512VBMI__) && \
   95|       |    defined(__AVX512VBMI2__) && defined(__AVX512VPOPCNTDQ__) && \
   96|       |    defined(__AVX512BITALG__) && defined(__GFNI__) && \
   97|       |    defined(__VAES__) && defined(__VPCLMULQDQ__)
   98|       |    flags |= DAV1D_X86_CPU_FLAG_AVX512ICL |
   99|       |             DAV1D_X86_CPU_FLAG_AVX2 |
  100|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  101|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  102|       |             DAV1D_X86_CPU_FLAG_SSE2;
  103|       |#elif defined(__AVX2__)
  104|       |    flags |= DAV1D_X86_CPU_FLAG_AVX2 |
  105|       |             DAV1D_X86_CPU_FLAG_SSE41 |
  106|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  107|       |             DAV1D_X86_CPU_FLAG_SSE2;
  108|       |#elif defined(__SSE4_1__) || defined(__AVX__)
  109|       |    flags |= DAV1D_X86_CPU_FLAG_SSE41 |
  110|       |             DAV1D_X86_CPU_FLAG_SSSE3 |
  111|       |             DAV1D_X86_CPU_FLAG_SSE2;
  112|       |#elif defined(__SSSE3__)
  113|       |    flags |= DAV1D_X86_CPU_FLAG_SSSE3 |
  114|       |             DAV1D_X86_CPU_FLAG_SSE2;
  115|       |#elif ARCH_X86_64 || defined(__SSE2__) || \
  116|       |      (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
  117|       |    flags |= DAV1D_X86_CPU_FLAG_SSE2;
  118|  11.3k|#endif
  119|  11.3k|#endif
  120|       |
  121|  11.3k|    return flags;
  122|  11.3k|}

ctx.c:memset_w1:
   34|  4.10M|static void memset_w1(void *const ptr, const int value) {
   35|  4.10M|    set_ctx1((uint8_t *) ptr, 0, value);
  ------------------
  |  |   56|  4.10M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  ------------------
   36|  4.10M|}
ctx.c:memset_w2:
   38|  4.59M|static void memset_w2(void *const ptr, const int value) {
   39|  4.59M|    set_ctx2((uint8_t *) ptr, 0, value);
  ------------------
  |  |   58|  4.59M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  ------------------
   40|  4.59M|}
ctx.c:memset_w4:
   42|   359k|static void memset_w4(void *const ptr, const int value) {
   43|   359k|    set_ctx4((uint8_t *) ptr, 0, value);
  ------------------
  |  |   60|   359k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  ------------------
   44|   359k|}
ctx.c:memset_w8:
   46|  35.4k|static void memset_w8(void *const ptr, const int value) {
   47|  35.4k|    set_ctx8((uint8_t *) ptr, 0, value);
  ------------------
  |  |   62|  35.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  ------------------
   48|  35.4k|}
ctx.c:memset_w16:
   50|  2.89k|static void memset_w16(void *const ptr, const int value) {
   51|  2.89k|    set_ctx16((uint8_t *) ptr, 0, value);
  ------------------
  |  |   63|  2.89k|#define set_ctx16(var, off, val) do { \
  |  |   64|  2.89k|        memset(&(var)[off], val, 16); \
  |  |   65|  2.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (65:14): [Folded, False: 2.89k]
  |  |  ------------------
  ------------------
   52|  2.89k|}

lf_mask.c:dav1d_memset_likely_pow2:
   44|   692k|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|   692k|    assert(n >= 1 && n <= 32);
  ------------------
  |  |  140|  1.38M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 693k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 693k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 692k]
  |  |  ------------------
  ------------------
   46|   692k|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 685k, False: 7.47k]
  ------------------
   47|   685k|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|   685k|    } else {
   49|  7.47k|        memset(ptr, value, n);
   50|  7.47k|    }
   51|   692k|}
recon_tmpl.c:dav1d_memset_likely_pow2:
   44|  6.23M|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|  6.23M|    assert(n >= 1 && n <= 32);
  ------------------
  |  |  140|  12.4M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 6.24M, False: 18.4E]
  |  |  |  Branch (140:30): [True: 6.24M, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 6.23M]
  |  |  ------------------
  ------------------
   46|  6.24M|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 6.24M, False: 18.4E]
  ------------------
   47|  6.24M|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|  18.4E|    } else {
   49|  18.4E|        memset(ptr, value, n);
   50|  18.4E|    }
   51|  6.23M|}

dav1d_data_wrap_internal:
   62|  29.0k|{
   63|  29.0k|    validate_input_or_ret(buf != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  29.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 29.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
   64|  29.0k|    validate_input_or_ret(ptr != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  29.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 29.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
   65|  29.0k|    validate_input_or_ret(free_callback != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  29.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 29.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
   66|       |
   67|  29.0k|    if (sz > SIZE_MAX / 2) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (67:9): [True: 0, False: 29.0k]
  ------------------
   68|  29.0k|    Dav1dRef *const ref = dav1d_malloc(ALLOC_DAV1DDATA, sizeof(Dav1dRef));
  ------------------
  |  |  132|  29.0k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
   69|  29.0k|    if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (69:9): [True: 0, False: 29.0k]
  ------------------
   70|       |
   71|  29.0k|    buf->ref = dav1d_ref_init(ref, ptr, free_callback, cookie, 1);
   72|  29.0k|    buf->data = ptr;
   73|  29.0k|    buf->sz = sz;
   74|  29.0k|    dav1d_data_props_set_defaults(&buf->m);
   75|  29.0k|    buf->m.size = sz;
   76|       |
   77|  29.0k|    return 0;
   78|  29.0k|}
dav1d_data_ref:
   98|  74.5k|void dav1d_data_ref(Dav1dData *const dst, const Dav1dData *const src) {
   99|  74.5k|    assert(dst != NULL);
  ------------------
  |  |  140|  74.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 74.5k]
  |  |  |  Branch (140:68): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
  100|  74.5k|    assert(dst->data == NULL);
  ------------------
  |  |  140|  74.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 74.5k]
  |  |  |  Branch (140:68): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
  101|  74.5k|    assert(src != NULL);
  ------------------
  |  |  140|  74.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 74.5k]
  |  |  |  Branch (140:68): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
  102|       |
  103|  74.5k|    if (src->ref) {
  ------------------
  |  Branch (103:9): [True: 74.5k, False: 0]
  ------------------
  104|  74.5k|        assert(src->data != NULL);
  ------------------
  |  |  140|  74.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 74.5k]
  |  |  |  Branch (140:68): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
  105|  74.5k|        dav1d_ref_inc(src->ref);
  106|  74.5k|    }
  107|  74.5k|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (107:9): [True: 0, False: 74.5k]
  ------------------
  108|  74.5k|    *dst = *src;
  109|  74.5k|}
dav1d_data_props_copy:
  113|  45.5k|{
  114|  45.5k|    assert(dst != NULL);
  ------------------
  |  |  140|  45.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 45.5k]
  |  |  |  Branch (140:68): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
  115|  45.5k|    assert(src != NULL);
  ------------------
  |  |  140|  45.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 45.5k]
  |  |  |  Branch (140:68): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
  116|       |
  117|  45.5k|    dav1d_ref_dec(&dst->user_data.ref);
  118|  45.5k|    *dst = *src;
  119|  45.5k|    if (dst->user_data.ref) dav1d_ref_inc(dst->user_data.ref);
  ------------------
  |  Branch (119:9): [True: 0, False: 45.5k]
  ------------------
  120|  45.5k|}
dav1d_data_props_set_defaults:
  122|   840k|void dav1d_data_props_set_defaults(Dav1dDataProps *const props) {
  123|   840k|    assert(props != NULL);
  ------------------
  |  |  140|   840k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 840k]
  |  |  |  Branch (140:68): [Folded, False: 840k]
  |  |  ------------------
  ------------------
  124|       |
  125|   840k|    memset(props, 0, sizeof(*props));
  126|       |    props->timestamp = INT64_MIN;
  127|   840k|    props->offset = -1;
  128|   840k|}
dav1d_data_props_unref_internal:
  130|  11.3k|void dav1d_data_props_unref_internal(Dav1dDataProps *const props) {
  131|  11.3k|    validate_input(props != NULL);
  ------------------
  |  |   59|  11.3k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  11.3k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  132|       |
  133|  11.3k|    struct Dav1dRef *user_data_ref = props->user_data.ref;
  134|  11.3k|    dav1d_data_props_set_defaults(props);
  135|  11.3k|    dav1d_ref_dec(&user_data_ref);
  136|  11.3k|}
dav1d_data_unref_internal:
  138|   115k|void dav1d_data_unref_internal(Dav1dData *const buf) {
  139|   115k|    validate_input(buf != NULL);
  ------------------
  |  |   59|   115k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   115k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 115k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  140|       |
  141|   115k|    struct Dav1dRef *user_data_ref = buf->m.user_data.ref;
  142|   115k|    if (buf->ref) {
  ------------------
  |  Branch (142:9): [True: 103k, False: 11.3k]
  ------------------
  143|   103k|        validate_input(buf->data != NULL);
  ------------------
  |  |   59|   103k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   103k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 103k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  144|   103k|        dav1d_ref_dec(&buf->ref);
  145|   103k|    }
  146|   115k|    memset(buf, 0, sizeof(*buf));
  147|   115k|    dav1d_data_props_set_defaults(&buf->m);
  148|   115k|    dav1d_ref_dec(&user_data_ref);
  149|   115k|}

dav1d_decode_tile_sbrow:
 2597|  78.2k|int dav1d_decode_tile_sbrow(Dav1dTaskContext *const t) {
 2598|  78.2k|    const Dav1dFrameContext *const f = t->f;
 2599|  78.2k|    const enum BlockLevel root_bl = f->seq_hdr->sb128 ? BL_128X128 : BL_64X64;
  ------------------
  |  Branch (2599:37): [True: 0, False: 78.2k]
  ------------------
 2600|  78.2k|    Dav1dTileState *const ts = t->ts;
 2601|  78.2k|    const Dav1dContext *const c = f->c;
 2602|  78.2k|    const int sb_step = f->sb_step;
 2603|  78.2k|    const int tile_row = ts->tiling.row, tile_col = ts->tiling.col;
 2604|  78.2k|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2605|  78.2k|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2606|       |
 2607|  78.2k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|   156k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 63.3k, False: 14.8k]
  |  |  ------------------
  ------------------
  |  Branch (2607:45): [True: 0, False: 14.8k]
  ------------------
 2608|  63.3k|        dav1d_refmvs_tile_sbrow_init(&t->rt, &f->rf, ts->tiling.col_start,
 2609|  63.3k|                                     ts->tiling.col_end, ts->tiling.row_start,
 2610|  63.3k|                                     ts->tiling.row_end, t->by >> f->sb_shift,
 2611|  63.3k|                                     ts->tiling.row, t->frame_thread.pass);
 2612|  63.3k|    }
 2613|       |
 2614|  78.2k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) && c->n_fc > 1) {
  ------------------
  |  |   36|   156k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 63.3k, False: 14.8k]
  |  |  ------------------
  ------------------
  |  Branch (2614:45): [True: 0, False: 63.3k]
  ------------------
 2615|      0|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 2616|      0|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 2617|      0|        for (int n = 0; n < 7; n++)
  ------------------
  |  Branch (2617:25): [True: 0, False: 0]
  ------------------
 2618|      0|            for (int m = 0; m < 2; m++)
  ------------------
  |  Branch (2618:29): [True: 0, False: 0]
  ------------------
 2619|      0|                lowest_px[n][m] = INT_MIN;
 2620|      0|    }
 2621|       |
 2622|  78.2k|    reset_context(&t->l, IS_KEY_OR_INTRA(f->frame_hdr), t->frame_thread.pass);
  ------------------
  |  |   43|  78.2k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  78.2k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 2623|  78.2k|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2623:9): [True: 0, False: 78.2k]
  ------------------
 2624|      0|        const int off_2pass = c->n_tc > 1 ? f->sb128w * f->frame_hdr->tiling.rows : 0;
  ------------------
  |  Branch (2624:31): [True: 0, False: 0]
  ------------------
 2625|      0|        for (t->bx = ts->tiling.col_start,
 2626|      0|             t->a = f->a + off_2pass + col_sb128_start + tile_row * f->sb128w;
 2627|      0|             t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2627:14): [True: 0, False: 0]
  ------------------
 2628|      0|        {
 2629|      0|            if (atomic_load_explicit(c->flush, memory_order_acquire))
  ------------------
  |  Branch (2629:17): [True: 0, False: 0]
  ------------------
 2630|      0|                return 1;
 2631|      0|            if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2631:17): [True: 0, False: 0]
  ------------------
 2632|      0|                return 1;
 2633|      0|            if (t->bx & 16 || f->seq_hdr->sb128)
  ------------------
  |  Branch (2633:17): [True: 0, False: 0]
  |  Branch (2633:31): [True: 0, False: 0]
  ------------------
 2634|      0|                t->a++;
 2635|      0|        }
 2636|      0|        f->bd_fn.backup_ipred_edge(t);
 2637|      0|        return 0;
 2638|      0|    }
 2639|       |
 2640|  78.2k|    if (f->c->n_tc > 1 && f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (2640:9): [True: 73.9k, False: 4.28k]
  |  Branch (2640:27): [True: 59.8k, False: 14.0k]
  ------------------
 2641|  59.8k|        f->c->refmvs_dsp.load_tmvs(&f->rf, ts->tiling.row,
 2642|  59.8k|                                   ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2643|  59.8k|                                   t->by >> 1, (t->by + sb_step) >> 1);
 2644|  59.8k|    }
 2645|  78.2k|    memset(t->pal_sz_uv[1], 0, sizeof(*t->pal_sz_uv));
 2646|  78.2k|    const int sb128y = t->by >> 5;
 2647|  78.2k|    for (t->bx = ts->tiling.col_start, t->a = f->a + col_sb128_start + tile_row * f->sb128w,
 2648|  78.2k|         t->lf_mask = f->lf.mask + sb128y * f->sb128w + col_sb128_start;
 2649|   163k|         t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2649:10): [True: 85.5k, False: 78.2k]
  ------------------
 2650|  85.5k|    {
 2651|  85.5k|        if (atomic_load_explicit(c->flush, memory_order_acquire))
  ------------------
  |  Branch (2651:13): [True: 0, False: 85.5k]
  ------------------
 2652|      0|            return 1;
 2653|  85.5k|        if (root_bl == BL_128X128) {
  ------------------
  |  Branch (2653:13): [True: 0, False: 85.5k]
  ------------------
 2654|      0|            t->cur_sb_cdef_idx_ptr = t->lf_mask->cdef_idx;
 2655|      0|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2656|      0|            t->cur_sb_cdef_idx_ptr[1] = -1;
 2657|      0|            t->cur_sb_cdef_idx_ptr[2] = -1;
 2658|      0|            t->cur_sb_cdef_idx_ptr[3] = -1;
 2659|  85.5k|        } else {
 2660|  85.5k|            t->cur_sb_cdef_idx_ptr =
 2661|  85.5k|                &t->lf_mask->cdef_idx[((t->bx & 16) >> 4) +
 2662|  85.5k|                                      ((t->by & 16) >> 3)];
 2663|  85.5k|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2664|  85.5k|        }
 2665|       |        // Restoration filter
 2666|   342k|        for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2666:25): [True: 256k, False: 85.5k]
  ------------------
 2667|   256k|            if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2667:17): [True: 254k, False: 1.93k]
  ------------------
 2668|   254k|                continue;
 2669|       |
 2670|  1.93k|            const int ss_ver = p && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2670:32): [True: 175, False: 1.75k]
  |  Branch (2670:37): [True: 32, False: 143]
  ------------------
 2671|  1.93k|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2671:32): [True: 175, False: 1.75k]
  |  Branch (2671:37): [True: 80, False: 95]
  ------------------
 2672|  1.93k|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2673|  1.93k|            const int y = t->by * 4 >> ss_ver;
 2674|  1.93k|            const int h = (f->cur.p.h + ss_ver) >> ss_ver;
 2675|       |
 2676|  1.93k|            const int unit_size = 1 << unit_size_log2;
 2677|  1.93k|            const unsigned mask = unit_size - 1;
 2678|  1.93k|            if (y & mask) continue;
  ------------------
  |  Branch (2678:17): [True: 912, False: 1.02k]
  ------------------
 2679|  1.02k|            const int half_unit = unit_size >> 1;
 2680|       |            // Round half up at frame boundaries, if there's more than one
 2681|       |            // restoration unit
 2682|  1.02k|            if (y && y + half_unit > h) continue;
  ------------------
  |  Branch (2682:17): [True: 55, False: 965]
  |  Branch (2682:22): [True: 15, False: 40]
  ------------------
 2683|       |
 2684|  1.00k|            const enum Dav1dRestorationType frame_type = f->frame_hdr->restoration.type[p];
 2685|       |
 2686|  1.00k|            if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2686:17): [True: 0, False: 1.00k]
  ------------------
 2687|      0|                const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2688|      0|                const int n_units = imax(1, (w + half_unit) >> unit_size_log2);
 2689|       |
 2690|      0|                const int d = f->frame_hdr->super_res.width_scale_denominator;
 2691|      0|                const int rnd = unit_size * 8 - 1, shift = unit_size_log2 + 3;
 2692|      0|                const int x0 = ((4 *  t->bx            * d >> ss_hor) + rnd) >> shift;
 2693|      0|                const int x1 = ((4 * (t->bx + sb_step) * d >> ss_hor) + rnd) >> shift;
 2694|       |
 2695|      0|                for (int x = x0; x < imin(x1, n_units); x++) {
  ------------------
  |  Branch (2695:34): [True: 0, False: 0]
  ------------------
 2696|      0|                    const int px_x = x << (unit_size_log2 + ss_hor);
 2697|      0|                    const int sb_idx = (t->by >> 5) * f->sr_sb128w + (px_x >> 7);
 2698|      0|                    const int unit_idx = ((t->by & 16) >> 3) + ((px_x & 64) >> 6);
 2699|      0|                    Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2700|       |
 2701|      0|                    read_restoration_info(t, lr, p, frame_type);
 2702|      0|                }
 2703|  1.00k|            } else {
 2704|  1.00k|                const int x = 4 * t->bx >> ss_hor;
 2705|  1.00k|                if (x & mask) continue;
  ------------------
  |  Branch (2705:21): [True: 471, False: 534]
  ------------------
 2706|    534|                const int w = (f->cur.p.w + ss_hor) >> ss_hor;
 2707|       |                // Round half up at frame boundaries, if there's more than one
 2708|       |                // restoration unit
 2709|    534|                if (x && x + half_unit > w) continue;
  ------------------
  |  Branch (2709:21): [True: 13, False: 521]
  |  Branch (2709:26): [True: 3, False: 10]
  ------------------
 2710|    531|                const int sb_idx = (t->by >> 5) * f->sr_sb128w + (t->bx >> 5);
 2711|    531|                const int unit_idx = ((t->by & 16) >> 3) + ((t->bx & 16) >> 4);
 2712|    531|                Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2713|       |
 2714|    531|                read_restoration_info(t, lr, p, frame_type);
 2715|    531|            }
 2716|  1.00k|        }
 2717|  85.5k|        if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2717:13): [True: 0, False: 85.5k]
  ------------------
 2718|      0|            return 1;
 2719|  85.5k|        if (t->bx & 16 || f->seq_hdr->sb128) {
  ------------------
  |  Branch (2719:13): [True: 17.2k, False: 68.2k]
  |  Branch (2719:27): [True: 18.4E, False: 68.2k]
  ------------------
 2720|  17.2k|            t->a++;
 2721|  17.2k|            t->lf_mask++;
 2722|  17.2k|        }
 2723|  85.5k|    }
 2724|       |
 2725|  78.2k|    if (f->seq_hdr->ref_frame_mvs && f->c->n_tc > 1 && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  73.9k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 59.8k, False: 14.0k]
  |  |  ------------------
  ------------------
  |  Branch (2725:9): [True: 78.1k, False: 37]
  |  Branch (2725:38): [True: 73.9k, False: 4.28k]
  ------------------
 2726|  59.8k|        dav1d_refmvs_save_tmvs(&f->c->refmvs_dsp, &t->rt,
 2727|  59.8k|                               ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2728|  59.8k|                               t->by >> 1, (t->by + sb_step) >> 1);
 2729|  59.8k|    }
 2730|       |
 2731|       |    // backup pre-loopfilter pixels for intra prediction of the next sbrow
 2732|  78.2k|    if (t->frame_thread.pass != 1)
  ------------------
  |  Branch (2732:9): [True: 78.1k, False: 28]
  ------------------
 2733|  78.1k|        f->bd_fn.backup_ipred_edge(t);
 2734|       |
 2735|       |    // backup t->a/l.tx_lpf_y/uv at tile boundaries to use them to "fix"
 2736|       |    // up the initial value in neighbour tiles when running the loopfilter
 2737|  78.2k|    int align_h = (f->bh + 31) & ~31;
 2738|  78.2k|    memcpy(&f->lf.tx_lpf_right_edge[0][align_h * tile_col + t->by],
 2739|  78.2k|           &t->l.tx_lpf_y[t->by & 16], sb_step);
 2740|  78.2k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2741|  78.2k|    align_h >>= ss_ver;
 2742|  78.2k|    memcpy(&f->lf.tx_lpf_right_edge[1][align_h * tile_col + (t->by >> ss_ver)],
 2743|  78.2k|           &t->l.tx_lpf_uv[(t->by & 16) >> ss_ver], sb_step >> ss_ver);
 2744|       |
 2745|       |    // error out on symbol decoder overread
 2746|  78.2k|    if (ts->msac.cnt <= -15) return 1;
  ------------------
  |  Branch (2746:9): [True: 0, False: 78.2k]
  ------------------
 2747|       |
 2748|  78.2k|    return c->strict_std_compliance &&
  ------------------
  |  Branch (2748:12): [True: 0, False: 78.2k]
  ------------------
 2749|      0|           (t->by >> f->sb_shift) + 1 >= f->frame_hdr->tiling.row_start_sb[tile_row + 1] &&
  ------------------
  |  Branch (2749:12): [True: 0, False: 0]
  ------------------
 2750|      0|           check_trailing_bits_after_symbol_coder(&ts->msac);
  ------------------
  |  Branch (2750:12): [True: 0, False: 0]
  ------------------
 2751|  78.2k|}
dav1d_decode_frame_init:
 2753|  45.5k|int dav1d_decode_frame_init(Dav1dFrameContext *const f) {
 2754|  45.5k|    const Dav1dContext *const c = f->c;
 2755|  45.5k|    int retval = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|  45.5k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 2756|       |
 2757|  45.5k|    if (f->sbh > f->lf.start_of_tile_row_sz) {
  ------------------
  |  Branch (2757:9): [True: 15.1k, False: 30.3k]
  ------------------
 2758|  15.1k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  15.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2759|  15.1k|        f->lf.start_of_tile_row = dav1d_malloc(ALLOC_TILE, f->sbh * sizeof(uint8_t));
  ------------------
  |  |  132|  15.1k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2760|  15.1k|        if (!f->lf.start_of_tile_row) {
  ------------------
  |  Branch (2760:13): [True: 0, False: 15.1k]
  ------------------
 2761|      0|            f->lf.start_of_tile_row_sz = 0;
 2762|      0|            goto error;
 2763|      0|        }
 2764|  15.1k|        f->lf.start_of_tile_row_sz = f->sbh;
 2765|  15.1k|    }
 2766|  45.5k|    int sby = 0;
 2767|   101k|    for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2767:28): [True: 56.4k, False: 45.5k]
  ------------------
 2768|  56.4k|        f->lf.start_of_tile_row[sby++] = tile_row;
 2769|  60.1k|        while (sby < f->frame_hdr->tiling.row_start_sb[tile_row + 1])
  ------------------
  |  Branch (2769:16): [True: 3.71k, False: 56.4k]
  ------------------
 2770|  3.71k|            f->lf.start_of_tile_row[sby++] = 0;
 2771|  56.4k|    }
 2772|       |
 2773|  45.5k|    const int n_ts = f->frame_hdr->tiling.cols * f->frame_hdr->tiling.rows;
 2774|  45.5k|    if (n_ts != f->n_ts) {
  ------------------
  |  Branch (2774:9): [True: 16.2k, False: 29.2k]
  ------------------
 2775|  16.2k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (2775:13): [True: 0, False: 16.2k]
  ------------------
 2776|      0|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 2777|      0|            f->frame_thread.tile_start_off =
 2778|      0|                dav1d_malloc(ALLOC_TILE, sizeof(*f->frame_thread.tile_start_off) * n_ts);
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2779|      0|            if (!f->frame_thread.tile_start_off) {
  ------------------
  |  Branch (2779:17): [True: 0, False: 0]
  ------------------
 2780|      0|                f->n_ts = 0;
 2781|      0|                goto error;
 2782|      0|            }
 2783|      0|        }
 2784|  16.2k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  16.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2785|  16.2k|        f->ts = dav1d_alloc_aligned(ALLOC_TILE, sizeof(*f->ts) * n_ts, 32);
  ------------------
  |  |  134|  16.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2786|  16.2k|        if (!f->ts) goto error;
  ------------------
  |  Branch (2786:13): [True: 0, False: 16.2k]
  ------------------
 2787|  16.2k|        f->n_ts = n_ts;
 2788|  16.2k|    }
 2789|       |
 2790|  45.5k|    const int a_sz = f->sb128w * f->frame_hdr->tiling.rows * (1 + (c->n_fc > 1 && c->n_tc > 1));
  ------------------
  |  Branch (2790:68): [True: 0, False: 45.5k]
  |  Branch (2790:83): [True: 0, False: 0]
  ------------------
 2791|  45.5k|    if (a_sz != f->a_sz) {
  ------------------
  |  Branch (2791:9): [True: 15.3k, False: 30.1k]
  ------------------
 2792|  15.3k|        dav1d_free(f->a);
  ------------------
  |  |  135|  15.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2793|  15.3k|        f->a = dav1d_malloc(ALLOC_TILE, sizeof(*f->a) * a_sz);
  ------------------
  |  |  132|  15.3k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2794|  15.3k|        if (!f->a) {
  ------------------
  |  Branch (2794:13): [True: 0, False: 15.3k]
  ------------------
 2795|      0|            f->a_sz = 0;
 2796|      0|            goto error;
 2797|      0|        }
 2798|  15.3k|        f->a_sz = a_sz;
 2799|  15.3k|    }
 2800|       |
 2801|  45.5k|    const int num_sb128 = f->sb128w * f->sb128h;
 2802|  45.5k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2803|  45.5k|    const int hbd = !!f->seq_hdr->hbd;
 2804|  45.5k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (2804:9): [True: 0, False: 45.5k]
  ------------------
 2805|      0|        const unsigned sb_step4 = f->sb_step * 4;
 2806|      0|        int tile_idx = 0;
 2807|      0|        for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2807:32): [True: 0, False: 0]
  ------------------
 2808|      0|            const unsigned row_off = f->frame_hdr->tiling.row_start_sb[tile_row] *
 2809|      0|                                     sb_step4 * f->sb128w * 128;
 2810|      0|            const unsigned b_diff = (f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2811|      0|                                     f->frame_hdr->tiling.row_start_sb[tile_row]) * sb_step4;
 2812|      0|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2812:36): [True: 0, False: 0]
  ------------------
 2813|      0|                f->frame_thread.tile_start_off[tile_idx++] = row_off + b_diff *
 2814|      0|                    f->frame_hdr->tiling.col_start_sb[tile_col] * sb_step4;
 2815|      0|            }
 2816|      0|        }
 2817|       |
 2818|      0|        const int lowest_pixel_mem_sz = f->frame_hdr->tiling.cols * f->sbh;
 2819|      0|        if (lowest_pixel_mem_sz != f->tile_thread.lowest_pixel_mem_sz) {
  ------------------
  |  Branch (2819:13): [True: 0, False: 0]
  ------------------
 2820|      0|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 2821|      0|            f->tile_thread.lowest_pixel_mem =
 2822|      0|                dav1d_malloc(ALLOC_TILE, lowest_pixel_mem_sz *
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2823|      0|                             sizeof(*f->tile_thread.lowest_pixel_mem));
 2824|      0|            if (!f->tile_thread.lowest_pixel_mem) {
  ------------------
  |  Branch (2824:17): [True: 0, False: 0]
  ------------------
 2825|      0|                f->tile_thread.lowest_pixel_mem_sz = 0;
 2826|      0|                goto error;
 2827|      0|            }
 2828|      0|            f->tile_thread.lowest_pixel_mem_sz = lowest_pixel_mem_sz;
 2829|      0|        }
 2830|      0|        int (*lowest_pixel_ptr)[7][2] = f->tile_thread.lowest_pixel_mem;
 2831|      0|        for (int tile_row = 0, tile_row_base = 0; tile_row < f->frame_hdr->tiling.rows;
  ------------------
  |  Branch (2831:51): [True: 0, False: 0]
  ------------------
 2832|      0|             tile_row++, tile_row_base += f->frame_hdr->tiling.cols)
 2833|      0|        {
 2834|      0|            const int tile_row_sb_h = f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2835|      0|                                      f->frame_hdr->tiling.row_start_sb[tile_row];
 2836|      0|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2836:36): [True: 0, False: 0]
  ------------------
 2837|      0|                f->ts[tile_row_base + tile_col].lowest_pixel = lowest_pixel_ptr;
 2838|      0|                lowest_pixel_ptr += tile_row_sb_h;
 2839|      0|            }
 2840|      0|        }
 2841|       |
 2842|      0|        const int cbi_sz = num_sb128 * size_mul[0];
 2843|      0|        if (cbi_sz != f->frame_thread.cbi_sz) {
  ------------------
  |  Branch (2843:13): [True: 0, False: 0]
  ------------------
 2844|      0|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2845|      0|            f->frame_thread.cbi =
 2846|      0|                dav1d_alloc_aligned(ALLOC_BLOCK, sizeof(*f->frame_thread.cbi) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2847|      0|                                    cbi_sz * 32 * 32 / 4, 64);
 2848|      0|            if (!f->frame_thread.cbi) {
  ------------------
  |  Branch (2848:17): [True: 0, False: 0]
  ------------------
 2849|      0|                f->frame_thread.cbi_sz = 0;
 2850|      0|                goto error;
 2851|      0|            }
 2852|      0|            f->frame_thread.cbi_sz = cbi_sz;
 2853|      0|        }
 2854|       |
 2855|      0|        const int cf_sz = (num_sb128 * size_mul[0]) << hbd;
 2856|      0|        if (cf_sz != f->frame_thread.cf_sz) {
  ------------------
  |  Branch (2856:13): [True: 0, False: 0]
  ------------------
 2857|      0|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2858|      0|            f->frame_thread.cf =
 2859|      0|                dav1d_alloc_aligned(ALLOC_COEF, (size_t)cf_sz * 128 * 128 / 2, 64);
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2860|      0|            if (!f->frame_thread.cf) {
  ------------------
  |  Branch (2860:17): [True: 0, False: 0]
  ------------------
 2861|      0|                f->frame_thread.cf_sz = 0;
 2862|      0|                goto error;
 2863|      0|            }
 2864|      0|            memset(f->frame_thread.cf, 0, (size_t)cf_sz * 128 * 128 / 2);
 2865|      0|            f->frame_thread.cf_sz = cf_sz;
 2866|      0|        }
 2867|       |
 2868|      0|        if (f->frame_hdr->allow_screen_content_tools) {
  ------------------
  |  Branch (2868:13): [True: 0, False: 0]
  ------------------
 2869|      0|            const int pal_sz = num_sb128 << hbd;
 2870|      0|            if (pal_sz != f->frame_thread.pal_sz) {
  ------------------
  |  Branch (2870:17): [True: 0, False: 0]
  ------------------
 2871|      0|                dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2872|      0|                f->frame_thread.pal =
 2873|      0|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2874|      0|                                        pal_sz * 16 * 16, 64);
 2875|      0|                if (!f->frame_thread.pal) {
  ------------------
  |  Branch (2875:21): [True: 0, False: 0]
  ------------------
 2876|      0|                    f->frame_thread.pal_sz = 0;
 2877|      0|                    goto error;
 2878|      0|                }
 2879|      0|                f->frame_thread.pal_sz = pal_sz;
 2880|      0|            }
 2881|       |
 2882|      0|            const int pal_idx_sz = num_sb128 * size_mul[1];
 2883|      0|            if (pal_idx_sz != f->frame_thread.pal_idx_sz) {
  ------------------
  |  Branch (2883:17): [True: 0, False: 0]
  ------------------
 2884|      0|                dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2885|      0|                f->frame_thread.pal_idx =
 2886|      0|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal_idx) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2887|      0|                                        pal_idx_sz * 128 * 128 / 8, 64);
 2888|      0|                if (!f->frame_thread.pal_idx) {
  ------------------
  |  Branch (2888:21): [True: 0, False: 0]
  ------------------
 2889|      0|                    f->frame_thread.pal_idx_sz = 0;
 2890|      0|                    goto error;
 2891|      0|                }
 2892|      0|                f->frame_thread.pal_idx_sz = pal_idx_sz;
 2893|      0|            }
 2894|      0|        } else if (f->frame_thread.pal) {
  ------------------
  |  Branch (2894:20): [True: 0, False: 0]
  ------------------
 2895|      0|            dav1d_freep_aligned(&f->frame_thread.pal);
 2896|      0|            dav1d_freep_aligned(&f->frame_thread.pal_idx);
 2897|      0|            f->frame_thread.pal_sz = f->frame_thread.pal_idx_sz = 0;
 2898|      0|        }
 2899|      0|    }
 2900|       |
 2901|       |    // update allocation of block contexts for above
 2902|  45.5k|    ptrdiff_t y_stride = f->cur.stride[0], uv_stride = f->cur.stride[1];
 2903|  45.5k|    const int has_resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
 2904|  45.5k|    const int need_cdef_lpf_copy = c->n_tc > 1 && has_resize;
  ------------------
  |  Branch (2904:36): [True: 43.2k, False: 2.34k]
  |  Branch (2904:51): [True: 0, False: 43.2k]
  ------------------
 2905|  45.5k|    if (y_stride * f->sbh * 4 != f->lf.cdef_buf_plane_sz[0] ||
  ------------------
  |  Branch (2905:9): [True: 16.2k, False: 29.3k]
  ------------------
 2906|  29.3k|        uv_stride * f->sbh * 8 != f->lf.cdef_buf_plane_sz[1] ||
  ------------------
  |  Branch (2906:9): [True: 0, False: 29.3k]
  ------------------
 2907|  29.3k|        need_cdef_lpf_copy != f->lf.need_cdef_lpf_copy ||
  ------------------
  |  Branch (2907:9): [True: 0, False: 29.3k]
  ------------------
 2908|  29.3k|        f->sbh != f->lf.cdef_buf_sbh)
  ------------------
  |  Branch (2908:9): [True: 0, False: 29.3k]
  ------------------
 2909|  16.2k|    {
 2910|  16.2k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  16.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2911|  16.2k|        size_t alloc_sz = 64;
 2912|  16.2k|        alloc_sz += (size_t)llabs(y_stride) * 4 * f->sbh << need_cdef_lpf_copy;
 2913|  16.2k|        alloc_sz += (size_t)llabs(uv_stride) * 8 * f->sbh << need_cdef_lpf_copy;
 2914|  16.2k|        uint8_t *ptr = f->lf.cdef_line_buf = dav1d_alloc_aligned(ALLOC_CDEF, alloc_sz, 32);
  ------------------
  |  |  134|  16.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2915|  16.2k|        if (!ptr) {
  ------------------
  |  Branch (2915:13): [True: 0, False: 16.2k]
  ------------------
 2916|      0|            f->lf.cdef_buf_plane_sz[0] = f->lf.cdef_buf_plane_sz[1] = 0;
 2917|      0|            goto error;
 2918|      0|        }
 2919|       |
 2920|  16.2k|        ptr += 32;
 2921|  16.2k|        if (y_stride < 0) {
  ------------------
  |  Branch (2921:13): [True: 0, False: 16.2k]
  ------------------
 2922|      0|            f->lf.cdef_line[0][0] = ptr - y_stride * (f->sbh * 4 - 1);
 2923|      0|            f->lf.cdef_line[1][0] = ptr - y_stride * (f->sbh * 4 - 3);
 2924|  16.2k|        } else {
 2925|  16.2k|            f->lf.cdef_line[0][0] = ptr + y_stride * 0;
 2926|  16.2k|            f->lf.cdef_line[1][0] = ptr + y_stride * 2;
 2927|  16.2k|        }
 2928|  16.2k|        ptr += llabs(y_stride) * f->sbh * 4;
 2929|  16.2k|        if (uv_stride < 0) {
  ------------------
  |  Branch (2929:13): [True: 0, False: 16.2k]
  ------------------
 2930|      0|            f->lf.cdef_line[0][1] = ptr - uv_stride * (f->sbh * 8 - 1);
 2931|      0|            f->lf.cdef_line[0][2] = ptr - uv_stride * (f->sbh * 8 - 3);
 2932|      0|            f->lf.cdef_line[1][1] = ptr - uv_stride * (f->sbh * 8 - 5);
 2933|      0|            f->lf.cdef_line[1][2] = ptr - uv_stride * (f->sbh * 8 - 7);
 2934|  16.2k|        } else {
 2935|  16.2k|            f->lf.cdef_line[0][1] = ptr + uv_stride * 0;
 2936|  16.2k|            f->lf.cdef_line[0][2] = ptr + uv_stride * 2;
 2937|  16.2k|            f->lf.cdef_line[1][1] = ptr + uv_stride * 4;
 2938|  16.2k|            f->lf.cdef_line[1][2] = ptr + uv_stride * 6;
 2939|  16.2k|        }
 2940|       |
 2941|  16.2k|        if (need_cdef_lpf_copy) {
  ------------------
  |  Branch (2941:13): [True: 0, False: 16.2k]
  ------------------
 2942|      0|            ptr += llabs(uv_stride) * f->sbh * 8;
 2943|      0|            if (y_stride < 0)
  ------------------
  |  Branch (2943:17): [True: 0, False: 0]
  ------------------
 2944|      0|                f->lf.cdef_lpf_line[0] = ptr - y_stride * (f->sbh * 4 - 1);
 2945|      0|            else
 2946|      0|                f->lf.cdef_lpf_line[0] = ptr;
 2947|      0|            ptr += llabs(y_stride) * f->sbh * 4;
 2948|      0|            if (uv_stride < 0) {
  ------------------
  |  Branch (2948:17): [True: 0, False: 0]
  ------------------
 2949|      0|                f->lf.cdef_lpf_line[1] = ptr - uv_stride * (f->sbh * 4 - 1);
 2950|      0|                f->lf.cdef_lpf_line[2] = ptr - uv_stride * (f->sbh * 8 - 1);
 2951|      0|            } else {
 2952|      0|                f->lf.cdef_lpf_line[1] = ptr;
 2953|      0|                f->lf.cdef_lpf_line[2] = ptr + uv_stride * f->sbh * 4;
 2954|      0|            }
 2955|      0|        }
 2956|       |
 2957|  16.2k|        f->lf.cdef_buf_plane_sz[0] = (int) y_stride * f->sbh * 4;
 2958|  16.2k|        f->lf.cdef_buf_plane_sz[1] = (int) uv_stride * f->sbh * 8;
 2959|  16.2k|        f->lf.need_cdef_lpf_copy = need_cdef_lpf_copy;
 2960|  16.2k|        f->lf.cdef_buf_sbh = f->sbh;
 2961|  16.2k|    }
 2962|       |
 2963|  45.5k|    const int sb128 = f->seq_hdr->sb128;
 2964|  45.5k|    const int num_lines = c->n_tc > 1 ? f->sbh * 4 << sb128 : 12;
  ------------------
  |  Branch (2964:27): [True: 43.2k, False: 2.34k]
  ------------------
 2965|  45.5k|    y_stride = f->sr_cur.p.stride[0], uv_stride = f->sr_cur.p.stride[1];
 2966|  45.5k|    if (y_stride * num_lines != f->lf.lr_buf_plane_sz[0] ||
  ------------------
  |  Branch (2966:9): [True: 16.0k, False: 29.5k]
  ------------------
 2967|  29.5k|        uv_stride * num_lines * 2 != f->lf.lr_buf_plane_sz[1])
  ------------------
  |  Branch (2967:9): [True: 0, False: 29.5k]
  ------------------
 2968|  16.0k|    {
 2969|  16.0k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  16.0k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2970|       |        // lr simd may overread the input, so slightly over-allocate the lpf buffer
 2971|  16.0k|        size_t alloc_sz = 128;
 2972|  16.0k|        alloc_sz += (size_t)llabs(y_stride) * num_lines;
 2973|  16.0k|        alloc_sz += (size_t)llabs(uv_stride) * num_lines * 2;
 2974|  16.0k|        uint8_t *ptr = f->lf.lr_line_buf = dav1d_alloc_aligned(ALLOC_LR, alloc_sz, 64);
  ------------------
  |  |  134|  16.0k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2975|  16.0k|        if (!ptr) {
  ------------------
  |  Branch (2975:13): [True: 0, False: 16.0k]
  ------------------
 2976|      0|            f->lf.lr_buf_plane_sz[0] = f->lf.lr_buf_plane_sz[1] = 0;
 2977|      0|            goto error;
 2978|      0|        }
 2979|       |
 2980|  16.0k|        ptr += 64;
 2981|  16.0k|        if (y_stride < 0)
  ------------------
  |  Branch (2981:13): [True: 0, False: 16.0k]
  ------------------
 2982|      0|            f->lf.lr_lpf_line[0] = ptr - y_stride * (num_lines - 1);
 2983|  16.0k|        else
 2984|  16.0k|            f->lf.lr_lpf_line[0] = ptr;
 2985|  16.0k|        ptr += llabs(y_stride) * num_lines;
 2986|  16.0k|        if (uv_stride < 0) {
  ------------------
  |  Branch (2986:13): [True: 0, False: 16.0k]
  ------------------
 2987|      0|            f->lf.lr_lpf_line[1] = ptr - uv_stride * (num_lines * 1 - 1);
 2988|      0|            f->lf.lr_lpf_line[2] = ptr - uv_stride * (num_lines * 2 - 1);
 2989|  16.0k|        } else {
 2990|  16.0k|            f->lf.lr_lpf_line[1] = ptr;
 2991|  16.0k|            f->lf.lr_lpf_line[2] = ptr + uv_stride * num_lines;
 2992|  16.0k|        }
 2993|       |
 2994|  16.0k|        f->lf.lr_buf_plane_sz[0] = (int) y_stride * num_lines;
 2995|  16.0k|        f->lf.lr_buf_plane_sz[1] = (int) uv_stride * num_lines * 2;
 2996|  16.0k|    }
 2997|       |
 2998|       |    // update allocation for loopfilter masks
 2999|  45.5k|    if (num_sb128 != f->lf.mask_sz) {
  ------------------
  |  Branch (2999:9): [True: 14.0k, False: 31.5k]
  ------------------
 3000|  14.0k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  14.0k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3001|  14.0k|        dav1d_free(f->lf.level);
  ------------------
  |  |  135|  14.0k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3002|  14.0k|        f->lf.mask = dav1d_malloc(ALLOC_LF, sizeof(*f->lf.mask) * num_sb128);
  ------------------
  |  |  132|  14.0k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3003|       |        // over-allocate by 3 bytes since some of the SIMD implementations
 3004|       |        // index this from the level type and can thus over-read by up to 3
 3005|  14.0k|        f->lf.level = dav1d_malloc(ALLOC_LF, sizeof(*f->lf.level) * num_sb128 * 32 * 32 + 3);
  ------------------
  |  |  132|  14.0k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3006|  14.0k|        if (!f->lf.mask || !f->lf.level) {
  ------------------
  |  Branch (3006:13): [True: 0, False: 14.0k]
  |  Branch (3006:28): [True: 0, False: 14.0k]
  ------------------
 3007|      0|            f->lf.mask_sz = 0;
 3008|      0|            goto error;
 3009|      0|        }
 3010|  14.0k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (3010:13): [True: 0, False: 14.0k]
  ------------------
 3011|      0|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 3012|      0|            f->frame_thread.b = dav1d_malloc(ALLOC_BLOCK, sizeof(*f->frame_thread.b) *
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3013|      0|                                             num_sb128 * 32 * 32);
 3014|      0|            if (!f->frame_thread.b) {
  ------------------
  |  Branch (3014:17): [True: 0, False: 0]
  ------------------
 3015|      0|                f->lf.mask_sz = 0;
 3016|      0|                goto error;
 3017|      0|            }
 3018|      0|        }
 3019|  14.0k|        f->lf.mask_sz = num_sb128;
 3020|  14.0k|    }
 3021|       |
 3022|  45.5k|    f->sr_sb128w = (f->sr_cur.p.p.w + 127) >> 7;
 3023|  45.5k|    const int lr_mask_sz = f->sr_sb128w * f->sb128h;
 3024|  45.5k|    if (lr_mask_sz != f->lf.lr_mask_sz) {
  ------------------
  |  Branch (3024:9): [True: 14.0k, False: 31.5k]
  ------------------
 3025|  14.0k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  14.0k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3026|  14.0k|        f->lf.lr_mask = dav1d_malloc(ALLOC_LR, sizeof(*f->lf.lr_mask) * lr_mask_sz);
  ------------------
  |  |  132|  14.0k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3027|  14.0k|        if (!f->lf.lr_mask) {
  ------------------
  |  Branch (3027:13): [True: 0, False: 14.0k]
  ------------------
 3028|      0|            f->lf.lr_mask_sz = 0;
 3029|      0|            goto error;
 3030|      0|        }
 3031|  14.0k|        f->lf.lr_mask_sz = lr_mask_sz;
 3032|  14.0k|    }
 3033|  45.5k|    f->lf.restore_planes =
 3034|  45.5k|        ((f->frame_hdr->restoration.type[0] != DAV1D_RESTORATION_NONE) << 0) +
 3035|  45.5k|        ((f->frame_hdr->restoration.type[1] != DAV1D_RESTORATION_NONE) << 1) +
 3036|  45.5k|        ((f->frame_hdr->restoration.type[2] != DAV1D_RESTORATION_NONE) << 2);
 3037|  45.5k|    if (f->frame_hdr->loopfilter.sharpness != f->lf.last_sharpness) {
  ------------------
  |  Branch (3037:9): [True: 11.8k, False: 33.7k]
  ------------------
 3038|  11.8k|        dav1d_calc_eih(&f->lf.lim_lut, f->frame_hdr->loopfilter.sharpness);
 3039|  11.8k|        f->lf.last_sharpness = f->frame_hdr->loopfilter.sharpness;
 3040|  11.8k|    }
 3041|  45.5k|    dav1d_calc_lf_values(f->lf.lvl, f->frame_hdr, (int8_t[4]) { 0, 0, 0, 0 });
 3042|  45.5k|    memset(f->lf.mask, 0, sizeof(*f->lf.mask) * num_sb128);
 3043|       |
 3044|  45.5k|    const int ipred_edge_sz = f->sbh * f->sb128w << hbd;
 3045|  45.5k|    if (ipred_edge_sz != f->ipred_edge_sz) {
  ------------------
  |  Branch (3045:9): [True: 16.2k, False: 29.3k]
  ------------------
 3046|  16.2k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  16.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3047|  16.2k|        uint8_t *ptr = f->ipred_edge[0] =
 3048|  16.2k|            dav1d_alloc_aligned(ALLOC_IPRED, ipred_edge_sz * 128 * 3, 64);
  ------------------
  |  |  134|  16.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3049|  16.2k|        if (!ptr) {
  ------------------
  |  Branch (3049:13): [True: 0, False: 16.2k]
  ------------------
 3050|      0|            f->ipred_edge_sz = 0;
 3051|      0|            goto error;
 3052|      0|        }
 3053|  16.2k|        f->ipred_edge[1] = ptr + ipred_edge_sz * 128 * 1;
 3054|  16.2k|        f->ipred_edge[2] = ptr + ipred_edge_sz * 128 * 2;
 3055|  16.2k|        f->ipred_edge_sz = ipred_edge_sz;
 3056|  16.2k|    }
 3057|       |
 3058|  45.5k|    const int re_sz = f->sb128h * f->frame_hdr->tiling.cols;
 3059|  45.5k|    if (re_sz != f->lf.re_sz) {
  ------------------
  |  Branch (3059:9): [True: 15.0k, False: 30.5k]
  ------------------
 3060|  15.0k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  15.0k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3061|  15.0k|        f->lf.tx_lpf_right_edge[0] = dav1d_malloc(ALLOC_LF, re_sz * 32 * 2);
  ------------------
  |  |  132|  15.0k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3062|  15.0k|        if (!f->lf.tx_lpf_right_edge[0]) {
  ------------------
  |  Branch (3062:13): [True: 0, False: 15.0k]
  ------------------
 3063|      0|            f->lf.re_sz = 0;
 3064|      0|            goto error;
 3065|      0|        }
 3066|  15.0k|        f->lf.tx_lpf_right_edge[1] = f->lf.tx_lpf_right_edge[0] + re_sz * 32;
 3067|  15.0k|        f->lf.re_sz = re_sz;
 3068|  15.0k|    }
 3069|       |
 3070|       |    // init ref mvs
 3071|  45.5k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|  91.0k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 11.3k]
  |  |  ------------------
  ------------------
  |  Branch (3071:45): [True: 0, False: 11.3k]
  ------------------
 3072|  34.1k|        const int ret =
 3073|  34.1k|            dav1d_refmvs_init_frame(&f->rf, f->seq_hdr, f->frame_hdr,
 3074|  34.1k|                                    f->refpoc, f->mvs, f->refrefpoc, f->ref_mvs,
 3075|  34.1k|                                    f->c->n_tc, f->c->n_fc);
 3076|  34.1k|        if (ret < 0) goto error;
  ------------------
  |  Branch (3076:13): [True: 0, False: 34.1k]
  ------------------
 3077|  34.1k|    }
 3078|       |
 3079|       |    // setup dequant tables
 3080|  45.5k|    init_quant_tables(f->seq_hdr, f->frame_hdr, f->frame_hdr->quant.yac, f->dq);
 3081|  45.5k|    if (f->frame_hdr->quant.qm)
  ------------------
  |  Branch (3081:9): [True: 32.3k, False: 13.1k]
  ------------------
 3082|   647k|        for (int i = 0; i < N_RECT_TX_SIZES; i++) {
  ------------------
  |  Branch (3082:25): [True: 614k, False: 32.3k]
  ------------------
 3083|   614k|            f->qm[i][0] = dav1d_qm_tbl[f->frame_hdr->quant.qm_y][0][i];
 3084|   614k|            f->qm[i][1] = dav1d_qm_tbl[f->frame_hdr->quant.qm_u][1][i];
 3085|   614k|            f->qm[i][2] = dav1d_qm_tbl[f->frame_hdr->quant.qm_v][1][i];
 3086|   614k|        }
 3087|  13.1k|    else
 3088|  13.1k|        memset(f->qm, 0, sizeof(f->qm));
 3089|       |
 3090|       |    // setup jnt_comp weights
 3091|  45.5k|    if (f->frame_hdr->switchable_comp_refs) {
  ------------------
  |  Branch (3091:9): [True: 0, False: 45.5k]
  ------------------
 3092|      0|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3092:25): [True: 0, False: 0]
  ------------------
 3093|      0|            const unsigned ref0poc = f->refp[i].p.frame_hdr->frame_offset;
 3094|       |
 3095|      0|            for (int j = i + 1; j < 7; j++) {
  ------------------
  |  Branch (3095:33): [True: 0, False: 0]
  ------------------
 3096|      0|                const unsigned ref1poc = f->refp[j].p.frame_hdr->frame_offset;
 3097|       |
 3098|      0|                const unsigned d1 =
 3099|      0|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref0poc,
 3100|      0|                                          f->cur.frame_hdr->frame_offset)), 31);
 3101|      0|                const unsigned d0 =
 3102|      0|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref1poc,
 3103|      0|                                          f->cur.frame_hdr->frame_offset)), 31);
 3104|      0|                const int order = d0 <= d1;
 3105|       |
 3106|      0|                static const uint8_t quant_dist_weight[3][2] = {
 3107|      0|                    { 2, 3 }, { 2, 5 }, { 2, 7 }
 3108|      0|                };
 3109|      0|                static const uint8_t quant_dist_lookup_table[4][2] = {
 3110|      0|                    { 9, 7 }, { 11, 5 }, { 12, 4 }, { 13, 3 }
 3111|      0|                };
 3112|       |
 3113|      0|                int k;
 3114|      0|                for (k = 0; k < 3; k++) {
  ------------------
  |  Branch (3114:29): [True: 0, False: 0]
  ------------------
 3115|      0|                    const int c0 = quant_dist_weight[k][order];
 3116|      0|                    const int c1 = quant_dist_weight[k][!order];
 3117|      0|                    const int d0_c0 = d0 * c0;
 3118|      0|                    const int d1_c1 = d1 * c1;
 3119|      0|                    if ((d0 > d1 && d0_c0 < d1_c1) || (d0 <= d1 && d0_c0 > d1_c1)) break;
  ------------------
  |  Branch (3119:26): [True: 0, False: 0]
  |  Branch (3119:37): [True: 0, False: 0]
  |  Branch (3119:56): [True: 0, False: 0]
  |  Branch (3119:68): [True: 0, False: 0]
  ------------------
 3120|      0|                }
 3121|       |
 3122|      0|                f->jnt_weights[i][j] = quant_dist_lookup_table[k][order];
 3123|      0|            }
 3124|      0|        }
 3125|      0|    }
 3126|       |
 3127|       |    /* Init loopfilter pointers. Increasing NULL pointers is technically UB,
 3128|       |     * so just point the chroma pointers in 4:0:0 to the luma plane here to
 3129|       |     * avoid having additional in-loop branches in various places. We never
 3130|       |     * dereference those pointers so it doesn't really matter what they
 3131|       |     * point at, as long as the pointers are valid. */
 3132|  45.5k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 3133|  45.5k|    f->lf.p[0] = f->cur.data[0];
 3134|  45.5k|    f->lf.p[1] = f->cur.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3134:30): [True: 17.1k, False: 28.3k]
  ------------------
 3135|  45.5k|    f->lf.p[2] = f->cur.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3135:30): [True: 17.1k, False: 28.3k]
  ------------------
 3136|  45.5k|    f->lf.sr_p[0] = f->sr_cur.p.data[0];
 3137|  45.5k|    f->lf.sr_p[1] = f->sr_cur.p.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3137:38): [True: 17.1k, False: 28.3k]
  ------------------
 3138|  45.5k|    f->lf.sr_p[2] = f->sr_cur.p.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3138:38): [True: 17.1k, False: 28.3k]
  ------------------
 3139|       |
 3140|  45.5k|    retval = 0;
 3141|  45.5k|error:
 3142|  45.5k|    return retval;
 3143|  45.5k|}
dav1d_decode_frame_init_cdf:
 3145|  45.5k|int dav1d_decode_frame_init_cdf(Dav1dFrameContext *const f) {
 3146|  45.5k|    const Dav1dContext *const c = f->c;
 3147|  45.5k|    int retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  45.5k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3148|       |
 3149|  45.5k|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3149:9): [True: 45.5k, False: 0]
  ------------------
 3150|  45.5k|        dav1d_cdf_thread_copy(f->out_cdf.data.cdf, &f->in_cdf);
 3151|       |
 3152|       |    // parse individual tiles per tile group
 3153|  45.5k|    int tile_row = 0, tile_col = 0;
 3154|  45.5k|    f->task_thread.update_set = 0;
 3155|  91.0k|    for (int i = 0; i < f->n_tile_data; i++) {
  ------------------
  |  Branch (3155:21): [True: 45.5k, False: 45.5k]
  ------------------
 3156|  45.5k|        const uint8_t *data = f->tile[i].data.data;
 3157|  45.5k|        size_t size = f->tile[i].data.sz;
 3158|       |
 3159|   118k|        for (int j = f->tile[i].start; j <= f->tile[i].end; j++) {
  ------------------
  |  Branch (3159:40): [True: 72.6k, False: 45.5k]
  ------------------
 3160|  72.6k|            size_t tile_sz;
 3161|  72.6k|            if (j == f->tile[i].end) {
  ------------------
  |  Branch (3161:17): [True: 45.5k, False: 27.0k]
  ------------------
 3162|  45.5k|                tile_sz = size;
 3163|  45.5k|            } else {
 3164|  27.0k|                if (f->frame_hdr->tiling.n_bytes > size) goto error;
  ------------------
  |  Branch (3164:21): [True: 0, False: 27.0k]
  ------------------
 3165|  27.0k|                tile_sz = 0;
 3166|  72.2k|                for (unsigned k = 0; k < f->frame_hdr->tiling.n_bytes; k++)
  ------------------
  |  Branch (3166:38): [True: 45.1k, False: 27.0k]
  ------------------
 3167|  45.1k|                    tile_sz |= (unsigned)*data++ << (k * 8);
 3168|  27.0k|                tile_sz++;
 3169|  27.0k|                size -= f->frame_hdr->tiling.n_bytes;
 3170|  27.0k|                if (tile_sz > size) goto error;
  ------------------
  |  Branch (3170:21): [True: 0, False: 27.0k]
  ------------------
 3171|  27.0k|            }
 3172|       |
 3173|  72.6k|            setup_tile(&f->ts[j], f, data, tile_sz, tile_row, tile_col++,
 3174|  72.6k|                       c->n_fc > 1 ? f->frame_thread.tile_start_off[j] : 0);
  ------------------
  |  Branch (3174:24): [True: 0, False: 72.6k]
  ------------------
 3175|       |
 3176|  72.6k|            if (tile_col == f->frame_hdr->tiling.cols) {
  ------------------
  |  Branch (3176:17): [True: 56.4k, False: 16.2k]
  ------------------
 3177|  56.4k|                tile_col = 0;
 3178|  56.4k|                tile_row++;
 3179|  56.4k|            }
 3180|  72.6k|            if (j == f->frame_hdr->tiling.update && f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3180:17): [True: 45.5k, False: 27.0k]
  |  Branch (3180:53): [True: 45.5k, False: 0]
  ------------------
 3181|  45.5k|                f->task_thread.update_set = 1;
 3182|  72.6k|            data += tile_sz;
 3183|  72.6k|            size -= tile_sz;
 3184|  72.6k|        }
 3185|  45.5k|    }
 3186|       |
 3187|  45.5k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (3187:9): [True: 43.2k, False: 2.34k]
  ------------------
 3188|  43.2k|        const int uses_2pass = c->n_fc > 1;
 3189|   103k|        for (int n = 0; n < f->sb128w * f->frame_hdr->tiling.rows * (1 + uses_2pass); n++)
  ------------------
  |  Branch (3189:25): [True: 60.0k, False: 43.2k]
  ------------------
 3190|  60.0k|            reset_context(&f->a[n], IS_KEY_OR_INTRA(f->frame_hdr),
  ------------------
  |  |   43|  60.0k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  60.0k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 3191|  60.0k|                          uses_2pass ? 1 + (n >= f->sb128w * f->frame_hdr->tiling.rows) : 0);
  ------------------
  |  Branch (3191:27): [True: 0, False: 60.0k]
  ------------------
 3192|  43.2k|    }
 3193|       |
 3194|  45.5k|    retval = 0;
 3195|  45.5k|error:
 3196|  45.5k|    return retval;
 3197|  45.5k|}
dav1d_decode_frame_main:
 3199|  2.34k|int dav1d_decode_frame_main(Dav1dFrameContext *const f) {
 3200|  2.34k|    const Dav1dContext *const c = f->c;
 3201|  2.34k|    int retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  2.34k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3202|       |
 3203|  2.34k|    assert(f->c->n_tc == 1);
  ------------------
  |  |  140|  2.34k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 2.34k]
  |  |  |  Branch (140:68): [Folded, False: 2.34k]
  |  |  ------------------
  ------------------
 3204|       |
 3205|  2.34k|    Dav1dTaskContext *const t = &c->tc[f - c->fc];
 3206|  2.34k|    t->f = f;
 3207|  2.34k|    t->frame_thread.pass = 0;
 3208|       |
 3209|  5.69k|    for (int n = 0; n < f->sb128w * f->frame_hdr->tiling.rows; n++)
  ------------------
  |  Branch (3209:21): [True: 3.35k, False: 2.34k]
  ------------------
 3210|  3.35k|        reset_context(&f->a[n], IS_KEY_OR_INTRA(f->frame_hdr), 0);
  ------------------
  |  |   43|  3.35k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  3.35k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 3211|       |
 3212|       |    // no threading - we explicitly interleave tile/sbrow decoding
 3213|       |    // and post-filtering, so that the full process runs in-line
 3214|  5.33k|    for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (3214:28): [True: 2.98k, False: 2.34k]
  ------------------
 3215|  2.98k|        const int sbh_end =
 3216|  2.98k|            imin(f->frame_hdr->tiling.row_start_sb[tile_row + 1], f->sbh);
 3217|  2.98k|        for (int sby = f->frame_hdr->tiling.row_start_sb[tile_row];
 3218|  6.29k|             sby < sbh_end; sby++)
  ------------------
  |  Branch (3218:14): [True: 3.30k, False: 2.98k]
  ------------------
 3219|  3.30k|        {
 3220|  3.30k|            t->by = sby << (4 + f->seq_hdr->sb128);
 3221|  3.30k|            const int by_end = (t->by + f->sb_step) >> 1;
 3222|  3.30k|            if (f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (3222:17): [True: 2.59k, False: 710]
  ------------------
 3223|  2.59k|                f->c->refmvs_dsp.load_tmvs(&f->rf, tile_row,
 3224|  2.59k|                                           0, f->bw >> 1, t->by >> 1, by_end);
 3225|  2.59k|            }
 3226|  7.59k|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (3226:36): [True: 4.28k, False: 3.30k]
  ------------------
 3227|  4.28k|                t->ts = &f->ts[tile_row * f->frame_hdr->tiling.cols + tile_col];
 3228|  4.28k|                if (dav1d_decode_tile_sbrow(t)) goto error;
  ------------------
  |  Branch (3228:21): [True: 0, False: 4.28k]
  ------------------
 3229|  4.28k|            }
 3230|  3.30k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  3.30k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 2.59k, False: 710]
  |  |  ------------------
  ------------------
 3231|  2.59k|                dav1d_refmvs_save_tmvs(&f->c->refmvs_dsp, &t->rt,
 3232|  2.59k|                                       0, f->bw >> 1, t->by >> 1, by_end);
 3233|  2.59k|            }
 3234|       |
 3235|       |            // loopfilter + cdef + restoration
 3236|  3.30k|            f->bd_fn.filter_sbrow(f, sby);
 3237|  3.30k|        }
 3238|  2.98k|    }
 3239|       |
 3240|  2.34k|    retval = 0;
 3241|  2.34k|error:
 3242|  2.34k|    return retval;
 3243|  2.34k|}
dav1d_decode_frame_exit:
 3245|  88.7k|void dav1d_decode_frame_exit(Dav1dFrameContext *const f, int retval) {
 3246|  88.7k|    const Dav1dContext *const c = f->c;
 3247|       |
 3248|  88.7k|    if (f->sr_cur.p.data[0])
  ------------------
  |  Branch (3248:9): [True: 45.5k, False: 43.2k]
  ------------------
 3249|  88.7k|        atomic_init(&f->task_thread.error, 0);
 3250|       |
 3251|  88.7k|    if (c->n_fc > 1 && retval && f->frame_thread.cf) {
  ------------------
  |  Branch (3251:9): [True: 0, False: 88.7k]
  |  Branch (3251:24): [True: 0, False: 0]
  |  Branch (3251:34): [True: 0, False: 0]
  ------------------
 3252|      0|        memset(f->frame_thread.cf, 0,
 3253|      0|               (size_t)f->frame_thread.cf_sz * 128 * 128 / 2);
 3254|      0|    }
 3255|   709k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3255:21): [True: 621k, False: 88.7k]
  ------------------
 3256|   621k|        if (f->refp[i].p.frame_hdr) {
  ------------------
  |  Branch (3256:13): [True: 239k, False: 382k]
  ------------------
 3257|   239k|            if (!retval && c->n_fc > 1 && c->strict_std_compliance &&
  ------------------
  |  Branch (3257:17): [True: 239k, False: 0]
  |  Branch (3257:28): [True: 0, False: 239k]
  |  Branch (3257:43): [True: 0, False: 0]
  ------------------
 3258|   239k|                atomic_load(&f->refp[i].progress[1]) == FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (3258:17): [True: 0, False: 0]
  ------------------
 3259|      0|            {
 3260|      0|                retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3261|      0|                atomic_store(&f->task_thread.error, 1);
 3262|      0|                atomic_store(&f->sr_cur.progress[1], FRAME_ERROR);
 3263|      0|            }
 3264|   239k|            dav1d_thread_picture_unref(&f->refp[i]);
 3265|   239k|        }
 3266|   621k|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3267|   621k|    }
 3268|       |
 3269|  88.7k|    dav1d_picture_unref_internal(&f->cur);
 3270|  88.7k|    dav1d_thread_picture_unref(&f->sr_cur);
 3271|  88.7k|    dav1d_cdf_thread_unref(&f->in_cdf);
 3272|  88.7k|    if (f->frame_hdr && f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3272:9): [True: 88.7k, False: 0]
  |  Branch (3272:25): [True: 88.7k, False: 0]
  ------------------
 3273|  88.7k|        if (f->out_cdf.progress)
  ------------------
  |  Branch (3273:13): [True: 0, False: 88.7k]
  ------------------
 3274|  88.7k|            atomic_store(f->out_cdf.progress, retval == 0 ? 1 : TILE_ERROR);
  ------------------
  |  Branch (3274:13): [True: 0, False: 0]
  ------------------
 3275|  88.7k|        dav1d_cdf_thread_unref(&f->out_cdf);
 3276|  88.7k|    }
 3277|  88.7k|    dav1d_ref_dec(&f->cur_segmap_ref);
 3278|  88.7k|    dav1d_ref_dec(&f->prev_segmap_ref);
 3279|  88.7k|    dav1d_ref_dec(&f->mvs_ref);
 3280|  88.7k|    dav1d_ref_dec(&f->seq_hdr_ref);
 3281|  88.7k|    dav1d_ref_dec(&f->frame_hdr_ref);
 3282|       |
 3283|   134k|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3283:21): [True: 45.5k, False: 88.7k]
  ------------------
 3284|  45.5k|        dav1d_data_unref_internal(&f->tile[i].data);
 3285|  88.7k|    f->task_thread.retval = retval;
 3286|  88.7k|}
dav1d_decode_frame:
 3288|  45.5k|int dav1d_decode_frame(Dav1dFrameContext *const f) {
 3289|  45.5k|    assert(f->c->n_fc == 1);
  ------------------
  |  |  140|  45.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 45.5k]
  |  |  |  Branch (140:68): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 3290|       |    // if n_tc > 1 (but n_fc == 1), we could run init/exit in the task
 3291|       |    // threads also. Not sure it makes a measurable difference.
 3292|  45.5k|    int res = dav1d_decode_frame_init(f);
 3293|  45.5k|    if (!res) res = dav1d_decode_frame_init_cdf(f);
  ------------------
  |  Branch (3293:9): [True: 45.5k, False: 0]
  ------------------
 3294|       |    // wait until all threads have completed
 3295|  45.5k|    if (!res) {
  ------------------
  |  Branch (3295:9): [True: 45.5k, False: 0]
  ------------------
 3296|  45.5k|        if (f->c->n_tc > 1) {
  ------------------
  |  Branch (3296:13): [True: 43.2k, False: 2.34k]
  ------------------
 3297|  43.2k|            res = dav1d_task_create_tile_sbrow(f, 0, 1);
 3298|  43.2k|            pthread_mutex_lock(&f->task_thread.ttd->lock);
 3299|  43.2k|            pthread_cond_signal(&f->task_thread.ttd->cond);
 3300|  43.2k|            if (!res) {
  ------------------
  |  Branch (3300:17): [True: 43.2k, False: 0]
  ------------------
 3301|  86.3k|                while (!f->task_thread.done[0] ||
  ------------------
  |  Branch (3301:24): [True: 43.1k, False: 43.2k]
  ------------------
 3302|  86.3k|                       atomic_load(&f->task_thread.task_counter) > 0)
  ------------------
  |  Branch (3302:24): [True: 9, False: 43.2k]
  ------------------
 3303|  43.1k|                {
 3304|  43.1k|                    pthread_cond_wait(&f->task_thread.cond,
 3305|  43.1k|                                      &f->task_thread.ttd->lock);
 3306|  43.1k|                }
 3307|  43.2k|            }
 3308|  43.2k|            pthread_mutex_unlock(&f->task_thread.ttd->lock);
 3309|  43.2k|            res = f->task_thread.retval;
 3310|  43.2k|        } else {
 3311|  2.34k|            res = dav1d_decode_frame_main(f);
 3312|  2.34k|            if (!res && f->frame_hdr->refresh_context && f->task_thread.update_set) {
  ------------------
  |  Branch (3312:17): [True: 2.34k, False: 0]
  |  Branch (3312:25): [True: 2.34k, False: 0]
  |  Branch (3312:58): [True: 2.34k, False: 0]
  ------------------
 3313|  2.34k|                dav1d_cdf_thread_update(f->frame_hdr, f->out_cdf.data.cdf,
 3314|  2.34k|                                        &f->ts[f->frame_hdr->tiling.update].cdf);
 3315|  2.34k|            }
 3316|  2.34k|        }
 3317|  45.5k|    }
 3318|  45.5k|    dav1d_decode_frame_exit(f, res);
 3319|  45.5k|    res = f->task_thread.retval;
 3320|  45.5k|    f->n_tile_data = 0;
 3321|  45.5k|    return res;
 3322|  45.5k|}
dav1d_submit_frame:
 3330|  45.5k|int dav1d_submit_frame(Dav1dContext *const c) {
 3331|  45.5k|    Dav1dFrameContext *f;
 3332|  45.5k|    int res = -1;
 3333|       |
 3334|       |    // wait for c->out_delayed[next] and move into c->out if visible
 3335|  45.5k|    Dav1dThreadPicture *out_delayed;
 3336|  45.5k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (3336:9): [True: 0, False: 45.5k]
  ------------------
 3337|      0|        pthread_mutex_lock(&c->task_thread.lock);
 3338|      0|        const unsigned next = c->frame_thread.next++;
 3339|      0|        if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (3339:13): [True: 0, False: 0]
  ------------------
 3340|      0|            c->frame_thread.next = 0;
 3341|       |
 3342|      0|        f = &c->fc[next];
 3343|      0|        while (f->n_tile_data > 0)
  ------------------
  |  Branch (3343:16): [True: 0, False: 0]
  ------------------
 3344|      0|            pthread_cond_wait(&f->task_thread.cond,
 3345|      0|                              &c->task_thread.lock);
 3346|      0|        out_delayed = &c->frame_thread.out_delayed[next];
 3347|      0|        if (out_delayed->p.data[0] || atomic_load(&f->task_thread.error)) {
  ------------------
  |  Branch (3347:13): [True: 0, False: 0]
  |  Branch (3347:39): [True: 0, False: 0]
  ------------------
 3348|      0|            unsigned first = atomic_load(&c->task_thread.first);
 3349|      0|            if (first + 1U < c->n_fc)
  ------------------
  |  Branch (3349:17): [True: 0, False: 0]
  ------------------
 3350|      0|                atomic_fetch_add(&c->task_thread.first, 1U);
 3351|      0|            else
 3352|      0|                atomic_store(&c->task_thread.first, 0);
 3353|      0|            atomic_compare_exchange_strong(&c->task_thread.reset_task_cur,
 3354|      0|                                           &first, UINT_MAX);
 3355|      0|            if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (3355:17): [True: 0, False: 0]
  |  Branch (3355:39): [True: 0, False: 0]
  ------------------
 3356|      0|                c->task_thread.cur--;
 3357|      0|        }
 3358|      0|        const int error = f->task_thread.retval;
 3359|      0|        if (error) {
  ------------------
  |  Branch (3359:13): [True: 0, False: 0]
  ------------------
 3360|      0|            f->task_thread.retval = 0;
 3361|      0|            c->cached_error = error;
 3362|      0|            dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 3363|      0|            dav1d_thread_picture_unref(out_delayed);
 3364|      0|        } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (3364:20): [True: 0, False: 0]
  ------------------
 3365|      0|            const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 3366|      0|                                                           memory_order_relaxed);
 3367|      0|            if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (3367:18): [True: 0, False: 0]
  |  Branch (3367:42): [True: 0, False: 0]
  ------------------
 3368|      0|                progress != FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (3368:17): [True: 0, False: 0]
  ------------------
 3369|      0|            {
 3370|      0|                dav1d_thread_picture_ref(&c->out, out_delayed);
 3371|      0|                c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 3372|      0|            }
 3373|      0|            dav1d_thread_picture_unref(out_delayed);
 3374|      0|        }
 3375|  45.5k|    } else {
 3376|  45.5k|        f = c->fc;
 3377|  45.5k|    }
 3378|       |
 3379|  45.5k|    f->seq_hdr = c->seq_hdr;
 3380|  45.5k|    f->seq_hdr_ref = c->seq_hdr_ref;
 3381|  45.5k|    dav1d_ref_inc(f->seq_hdr_ref);
 3382|  45.5k|    f->frame_hdr = c->frame_hdr;
 3383|  45.5k|    f->frame_hdr_ref = c->frame_hdr_ref;
 3384|  45.5k|    c->frame_hdr = NULL;
 3385|  45.5k|    c->frame_hdr_ref = NULL;
 3386|  45.5k|    f->dsp = &c->dsp[f->seq_hdr->hbd];
 3387|       |
 3388|  45.5k|    const int bpc = 8 + 2 * f->seq_hdr->hbd;
 3389|       |
 3390|  45.5k|    if (!f->dsp->ipred.intra_pred[DC_PRED]) {
  ------------------
  |  Branch (3390:9): [True: 11.3k, False: 34.1k]
  ------------------
 3391|  11.3k|        Dav1dDSPContext *const dsp = &c->dsp[f->seq_hdr->hbd];
 3392|       |
 3393|  11.3k|        switch (bpc) {
 3394|      0|#define assign_bitdepth_case(bd) \
 3395|      0|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
 3396|      0|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
 3397|      0|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
 3398|      0|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
 3399|      0|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
 3400|      0|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
 3401|      0|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
 3402|      0|            break
 3403|      0|#if CONFIG_8BPC
 3404|  8.03k|        case 8:
  ------------------
  |  Branch (3404:9): [True: 8.03k, False: 3.35k]
  ------------------
 3405|  8.03k|            assign_bitdepth_case(8);
  ------------------
  |  | 3395|  8.03k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3396|  8.03k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3397|  8.03k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3398|  8.03k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3399|  8.03k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3400|  8.03k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3401|  8.03k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3402|  8.03k|            break
  ------------------
 3406|      0|#endif
 3407|      0|#if CONFIG_16BPC
 3408|  1.61k|        case 10:
  ------------------
  |  Branch (3408:9): [True: 1.61k, False: 9.77k]
  ------------------
 3409|  3.35k|        case 12:
  ------------------
  |  Branch (3409:9): [True: 1.73k, False: 9.65k]
  ------------------
 3410|  3.35k|            assign_bitdepth_case(16);
  ------------------
  |  | 3395|  3.35k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3396|  3.35k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3397|  3.35k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3398|  3.35k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3399|  3.35k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3400|  3.35k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3401|  3.35k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3402|  3.35k|            break
  ------------------
 3411|      0|#endif
 3412|      0|#undef assign_bitdepth_case
 3413|      0|        default:
  ------------------
  |  Branch (3413:9): [True: 0, False: 11.3k]
  ------------------
 3414|      0|            dav1d_log(c, "Compiled without support for %d-bit decoding\n",
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 3415|      0|                    8 + 2 * f->seq_hdr->hbd);
 3416|      0|            res = DAV1D_ERR(ENOPROTOOPT);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3417|      0|            goto error;
 3418|  11.3k|        }
 3419|  11.3k|    }
 3420|       |
 3421|  45.5k|#define assign_bitdepth_case(bd) \
 3422|  45.5k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
 3423|  45.5k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
 3424|  45.5k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
 3425|  45.5k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
 3426|  45.5k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
 3427|  45.5k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
 3428|  45.5k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
 3429|  45.5k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
 3430|  45.5k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
 3431|  45.5k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
 3432|  45.5k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
 3433|  45.5k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
 3434|  45.5k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
 3435|  45.5k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
 3436|  45.5k|    if (!f->seq_hdr->hbd) {
  ------------------
  |  Branch (3436:9): [True: 32.1k, False: 13.4k]
  ------------------
 3437|  32.1k|#if CONFIG_8BPC
 3438|  32.1k|        assign_bitdepth_case(8);
  ------------------
  |  | 3422|  32.1k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3423|  32.1k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3424|  32.1k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3425|  32.1k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3426|  32.1k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3427|  32.1k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3428|  32.1k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3429|  32.1k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3430|  32.1k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3431|  32.1k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3432|  32.1k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3433|  32.1k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3434|  32.1k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3435|  32.1k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3439|  32.1k|#endif
 3440|  32.1k|    } else {
 3441|  13.4k|#if CONFIG_16BPC
 3442|  13.4k|        assign_bitdepth_case(16);
  ------------------
  |  | 3422|  13.4k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3423|  13.4k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3424|  13.4k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3425|  13.4k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3426|  13.4k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3427|  13.4k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3428|  13.4k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3429|  13.4k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3430|  13.4k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3431|  13.4k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3432|  13.4k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3433|  13.4k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3434|  13.4k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3435|  13.4k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3443|  13.4k|#endif
 3444|  13.4k|    }
 3445|  45.5k|#undef assign_bitdepth_case
 3446|       |
 3447|  45.5k|    int ref_coded_width[7];
 3448|  45.5k|    if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 11.3k]
  |  |  ------------------
  ------------------
 3449|  34.1k|        if (f->frame_hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  34.1k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3449:13): [True: 18.8k, False: 15.3k]
  ------------------
 3450|  18.8k|            const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3451|  18.8k|            if (!c->refs[pri_ref].p.p.data[0]) {
  ------------------
  |  Branch (3451:17): [True: 0, False: 18.8k]
  ------------------
 3452|      0|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3453|      0|                goto error;
 3454|      0|            }
 3455|  18.8k|        }
 3456|   273k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3456:25): [True: 239k, False: 34.1k]
  ------------------
 3457|   239k|            const int refidx = f->frame_hdr->refidx[i];
 3458|   239k|            if (!c->refs[refidx].p.p.data[0] ||
  ------------------
  |  Branch (3458:17): [True: 0, False: 239k]
  ------------------
 3459|   239k|                f->frame_hdr->width[0] * 2 < c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3459:17): [True: 0, False: 239k]
  ------------------
 3460|   239k|                f->frame_hdr->height * 2 < c->refs[refidx].p.p.p.h ||
  ------------------
  |  Branch (3460:17): [True: 0, False: 239k]
  ------------------
 3461|   239k|                f->frame_hdr->width[0] > c->refs[refidx].p.p.p.w * 16 ||
  ------------------
  |  Branch (3461:17): [True: 0, False: 239k]
  ------------------
 3462|   239k|                f->frame_hdr->height > c->refs[refidx].p.p.p.h * 16 ||
  ------------------
  |  Branch (3462:17): [True: 0, False: 239k]
  ------------------
 3463|   239k|                f->seq_hdr->layout != c->refs[refidx].p.p.p.layout ||
  ------------------
  |  Branch (3463:17): [True: 0, False: 239k]
  ------------------
 3464|   239k|                bpc != c->refs[refidx].p.p.p.bpc)
  ------------------
  |  Branch (3464:17): [True: 0, False: 239k]
  ------------------
 3465|      0|            {
 3466|      0|                for (int j = 0; j < i; j++)
  ------------------
  |  Branch (3466:33): [True: 0, False: 0]
  ------------------
 3467|      0|                    dav1d_thread_picture_unref(&f->refp[j]);
 3468|      0|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3469|      0|                goto error;
 3470|      0|            }
 3471|   239k|            dav1d_thread_picture_ref(&f->refp[i], &c->refs[refidx].p);
 3472|   239k|            ref_coded_width[i] = c->refs[refidx].p.p.frame_hdr->width[0];
 3473|   239k|            if (f->frame_hdr->width[0] != c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3473:17): [True: 159k, False: 79.2k]
  ------------------
 3474|  79.2k|                f->frame_hdr->height != c->refs[refidx].p.p.p.h)
  ------------------
  |  Branch (3474:17): [True: 34.7k, False: 44.5k]
  ------------------
 3475|   194k|            {
 3476|   194k|#define scale_fac(ref_sz, this_sz) \
 3477|   194k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
 3478|   194k|                f->svc[i][0].scale = scale_fac(c->refs[refidx].p.p.p.w,
  ------------------
  |  | 3477|   194k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3479|   194k|                                               f->frame_hdr->width[0]);
 3480|   194k|                f->svc[i][1].scale = scale_fac(c->refs[refidx].p.p.p.h,
  ------------------
  |  | 3477|   194k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3481|   194k|                                               f->frame_hdr->height);
 3482|   194k|                f->svc[i][0].step = (f->svc[i][0].scale + 8) >> 4;
 3483|   194k|                f->svc[i][1].step = (f->svc[i][1].scale + 8) >> 4;
 3484|   194k|            } else {
 3485|  44.5k|                f->svc[i][0].scale = f->svc[i][1].scale = 0;
 3486|  44.5k|            }
 3487|   239k|            f->gmv_warp_allowed[i] = f->frame_hdr->gmv[i].type > DAV1D_WM_TYPE_TRANSLATION &&
  ------------------
  |  Branch (3487:38): [True: 0, False: 239k]
  ------------------
 3488|      0|                                     !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (3488:38): [True: 0, False: 0]
  ------------------
 3489|      0|                                     !dav1d_get_shear_params(&f->frame_hdr->gmv[i]) &&
  ------------------
  |  Branch (3489:38): [True: 0, False: 0]
  ------------------
 3490|      0|                                     !f->svc[i][0].scale;
  ------------------
  |  Branch (3490:38): [True: 0, False: 0]
  ------------------
 3491|   239k|        }
 3492|  34.1k|    }
 3493|       |
 3494|       |    // setup entropy
 3495|  45.5k|    if (f->frame_hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  45.5k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3495:9): [True: 26.7k, False: 18.8k]
  ------------------
 3496|  26.7k|        dav1d_cdf_thread_init_static(&f->in_cdf, f->frame_hdr->quant.yac);
 3497|  26.7k|    } else {
 3498|  18.8k|        const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3499|  18.8k|        dav1d_cdf_thread_ref(&f->in_cdf, &c->cdf[pri_ref]);
 3500|  18.8k|    }
 3501|  45.5k|    if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3501:9): [True: 45.5k, False: 0]
  ------------------
 3502|  45.5k|        res = dav1d_cdf_thread_alloc(c, &f->out_cdf, c->n_fc > 1);
 3503|  45.5k|        if (res < 0) goto error;
  ------------------
  |  Branch (3503:13): [True: 0, False: 45.5k]
  ------------------
 3504|  45.5k|    }
 3505|       |
 3506|       |    // FIXME qsort so tiles are in order (for frame threading)
 3507|  45.5k|    if (f->n_tile_data_alloc < c->n_tile_data) {
  ------------------
  |  Branch (3507:9): [True: 11.3k, False: 34.1k]
  ------------------
 3508|  11.3k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3509|  11.3k|        assert(c->n_tile_data < INT_MAX / (int)sizeof(*f->tile));
  ------------------
  |  |  140|  11.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 11.3k]
  |  |  |  Branch (140:68): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
 3510|  11.3k|        f->tile = dav1d_malloc(ALLOC_TILE, c->n_tile_data * sizeof(*f->tile));
  ------------------
  |  |  132|  11.3k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3511|  11.3k|        if (!f->tile) {
  ------------------
  |  Branch (3511:13): [True: 0, False: 11.3k]
  ------------------
 3512|      0|            f->n_tile_data_alloc = f->n_tile_data = 0;
 3513|      0|            res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3514|      0|            goto error;
 3515|      0|        }
 3516|  11.3k|        f->n_tile_data_alloc = c->n_tile_data;
 3517|  11.3k|    }
 3518|  45.5k|    memcpy(f->tile, c->tile, c->n_tile_data * sizeof(*f->tile));
 3519|  45.5k|    memset(c->tile, 0, c->n_tile_data * sizeof(*c->tile));
 3520|  45.5k|    f->n_tile_data = c->n_tile_data;
 3521|  45.5k|    c->n_tile_data = 0;
 3522|       |
 3523|       |    // allocate frame
 3524|  45.5k|    res = dav1d_thread_picture_alloc(c, f, bpc);
 3525|  45.5k|    if (res < 0) goto error;
  ------------------
  |  Branch (3525:9): [True: 0, False: 45.5k]
  ------------------
 3526|       |
 3527|  45.5k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3527:9): [True: 0, False: 45.5k]
  ------------------
 3528|      0|        res = dav1d_picture_alloc_copy(c, &f->cur, f->frame_hdr->width[0], &f->sr_cur.p);
 3529|      0|        if (res < 0) goto error;
  ------------------
  |  Branch (3529:13): [True: 0, False: 0]
  ------------------
 3530|  45.5k|    } else {
 3531|  45.5k|        dav1d_picture_ref(&f->cur, &f->sr_cur.p);
 3532|  45.5k|    }
 3533|       |
 3534|  45.5k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3534:9): [True: 0, False: 45.5k]
  ------------------
 3535|      0|        f->resize_step[0] = scale_fac(f->cur.p.w, f->sr_cur.p.p.w);
  ------------------
  |  | 3477|      0|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3536|      0|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 3537|      0|        const int in_cw = (f->cur.p.w + ss_hor) >> ss_hor;
 3538|      0|        const int out_cw = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 3539|      0|        f->resize_step[1] = scale_fac(in_cw, out_cw);
  ------------------
  |  | 3477|      0|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3540|      0|#undef scale_fac
 3541|      0|        f->resize_start[0] = get_upscale_x0(f->cur.p.w, f->sr_cur.p.p.w, f->resize_step[0]);
 3542|      0|        f->resize_start[1] = get_upscale_x0(in_cw, out_cw, f->resize_step[1]);
 3543|      0|    }
 3544|       |
 3545|       |    // move f->cur into output queue
 3546|  45.5k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3546:9): [True: 45.5k, False: 0]
  ------------------
 3547|  45.5k|        if (f->frame_hdr->show_frame || c->output_invisible_frames) {
  ------------------
  |  Branch (3547:13): [True: 45.5k, False: 0]
  |  Branch (3547:41): [True: 0, False: 0]
  ------------------
 3548|  45.5k|            dav1d_thread_picture_ref(&c->out, &f->sr_cur);
 3549|  45.5k|            c->event_flags |= dav1d_picture_get_event_flags(&f->sr_cur);
 3550|  45.5k|        }
 3551|  45.5k|    } else {
 3552|      0|        dav1d_thread_picture_ref(out_delayed, &f->sr_cur);
 3553|      0|    }
 3554|       |
 3555|  45.5k|    f->w4 = (f->frame_hdr->width[0] + 3) >> 2;
 3556|  45.5k|    f->h4 = (f->frame_hdr->height + 3) >> 2;
 3557|  45.5k|    f->bw = ((f->frame_hdr->width[0] + 7) >> 3) << 1;
 3558|  45.5k|    f->bh = ((f->frame_hdr->height + 7) >> 3) << 1;
 3559|  45.5k|    f->sb128w = (f->bw + 31) >> 5;
 3560|  45.5k|    f->sb128h = (f->bh + 31) >> 5;
 3561|  45.5k|    f->sb_shift = 4 + f->seq_hdr->sb128;
 3562|  45.5k|    f->sb_step = 16 << f->seq_hdr->sb128;
 3563|  45.5k|    f->sbh = (f->bh + f->sb_step - 1) >> f->sb_shift;
 3564|  45.5k|    f->b4_stride = (f->bw + 31) & ~31;
 3565|  45.5k|    f->bitdepth_max = (1 << f->cur.p.bpc) - 1;
 3566|  45.5k|    atomic_init(&f->task_thread.error, 0);
 3567|  45.5k|    const int uses_2pass = c->n_fc > 1;
 3568|  45.5k|    const int cols = f->frame_hdr->tiling.cols;
 3569|  45.5k|    const int rows = f->frame_hdr->tiling.rows;
 3570|  45.5k|    atomic_store(&f->task_thread.task_counter,
 3571|  45.5k|                 (cols * rows + f->sbh) << uses_2pass);
 3572|       |
 3573|       |    // ref_mvs
 3574|  45.5k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|  91.0k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 11.3k]
  |  |  ------------------
  ------------------
  |  Branch (3574:45): [True: 0, False: 11.3k]
  ------------------
 3575|  34.1k|        f->mvs_ref = dav1d_ref_create_using_pool(c->refmvs_pool,
 3576|  34.1k|            sizeof(*f->mvs) * f->sb128h * 16 * (f->b4_stride >> 1));
 3577|  34.1k|        if (!f->mvs_ref) {
  ------------------
  |  Branch (3577:13): [True: 0, False: 34.1k]
  ------------------
 3578|      0|            res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3579|      0|            goto error;
 3580|      0|        }
 3581|  34.1k|        f->mvs = f->mvs_ref->data;
 3582|  34.1k|        if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3582:13): [True: 34.1k, False: 0]
  ------------------
 3583|   273k|            for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (3583:29): [True: 239k, False: 34.1k]
  ------------------
 3584|   239k|                f->refpoc[i] = f->refp[i].p.frame_hdr->frame_offset;
 3585|  34.1k|        } else {
 3586|      0|            memset(f->refpoc, 0, sizeof(f->refpoc));
 3587|      0|        }
 3588|  34.1k|        if (f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (3588:13): [True: 34.1k, False: 0]
  ------------------
 3589|   273k|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3589:29): [True: 239k, False: 34.1k]
  ------------------
 3590|   239k|                const int refidx = f->frame_hdr->refidx[i];
 3591|   239k|                const int ref_w = ((ref_coded_width[i] + 7) >> 3) << 1;
 3592|   239k|                const int ref_h = ((f->refp[i].p.p.h + 7) >> 3) << 1;
 3593|   239k|                if (c->refs[refidx].refmvs != NULL &&
  ------------------
  |  Branch (3593:21): [True: 159k, False: 79.7k]
  ------------------
 3594|   159k|                    ref_w == f->bw && ref_h == f->bh)
  ------------------
  |  Branch (3594:21): [True: 93.5k, False: 65.8k]
  |  Branch (3594:39): [True: 66.9k, False: 26.6k]
  ------------------
 3595|  66.9k|                {
 3596|  66.9k|                    f->ref_mvs_ref[i] = c->refs[refidx].refmvs;
 3597|  66.9k|                    dav1d_ref_inc(f->ref_mvs_ref[i]);
 3598|  66.9k|                    f->ref_mvs[i] = c->refs[refidx].refmvs->data;
 3599|   172k|                } else {
 3600|   172k|                    f->ref_mvs[i] = NULL;
 3601|   172k|                    f->ref_mvs_ref[i] = NULL;
 3602|   172k|                }
 3603|   239k|                memcpy(f->refrefpoc[i], c->refs[refidx].refpoc,
 3604|   239k|                       sizeof(*f->refrefpoc));
 3605|   239k|            }
 3606|  34.1k|        } else {
 3607|      0|            memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3608|      0|        }
 3609|  34.1k|    } else {
 3610|  11.3k|        f->mvs_ref = NULL;
 3611|  11.3k|        memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3612|  11.3k|    }
 3613|       |
 3614|       |    // segmap
 3615|  45.5k|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (3615:9): [True: 0, False: 45.5k]
  ------------------
 3616|       |        // By default, the previous segmentation map is not initialised.
 3617|      0|        f->prev_segmap_ref = NULL;
 3618|      0|        f->prev_segmap = NULL;
 3619|       |
 3620|       |        // We might need a previous frame's segmentation map. This
 3621|       |        // happens if there is either no update or a temporal update.
 3622|      0|        if (f->frame_hdr->segmentation.temporal || !f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3622:13): [True: 0, False: 0]
  |  Branch (3622:52): [True: 0, False: 0]
  ------------------
 3623|      0|            const int pri_ref = f->frame_hdr->primary_ref_frame;
 3624|      0|            assert(pri_ref != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3625|      0|            const int ref_w = ((ref_coded_width[pri_ref] + 7) >> 3) << 1;
 3626|      0|            const int ref_h = ((f->refp[pri_ref].p.p.h + 7) >> 3) << 1;
 3627|      0|            if (ref_w == f->bw && ref_h == f->bh) {
  ------------------
  |  Branch (3627:17): [True: 0, False: 0]
  |  Branch (3627:35): [True: 0, False: 0]
  ------------------
 3628|      0|                f->prev_segmap_ref = c->refs[f->frame_hdr->refidx[pri_ref]].segmap;
 3629|      0|                if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3629:21): [True: 0, False: 0]
  ------------------
 3630|      0|                    dav1d_ref_inc(f->prev_segmap_ref);
 3631|      0|                    f->prev_segmap = f->prev_segmap_ref->data;
 3632|      0|                }
 3633|      0|            }
 3634|      0|        }
 3635|       |
 3636|      0|        if (f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3636:13): [True: 0, False: 0]
  ------------------
 3637|       |            // We're updating an existing map, but need somewhere to
 3638|       |            // put the new values. Allocate them here (the data
 3639|       |            // actually gets set elsewhere)
 3640|      0|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool,
 3641|      0|                sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h);
 3642|      0|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3642:17): [True: 0, False: 0]
  ------------------
 3643|      0|                dav1d_ref_dec(&f->prev_segmap_ref);
 3644|      0|                res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3645|      0|                goto error;
 3646|      0|            }
 3647|      0|            f->cur_segmap = f->cur_segmap_ref->data;
 3648|      0|        } else if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3648:20): [True: 0, False: 0]
  ------------------
 3649|       |            // We're not updating an existing map, and we have a valid
 3650|       |            // reference. Use that.
 3651|      0|            f->cur_segmap_ref = f->prev_segmap_ref;
 3652|      0|            dav1d_ref_inc(f->cur_segmap_ref);
 3653|      0|            f->cur_segmap = f->prev_segmap_ref->data;
 3654|      0|        } else {
 3655|       |            // We need to make a new map. Allocate one here and zero it out.
 3656|      0|            const size_t segmap_size = sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h;
 3657|      0|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool, segmap_size);
 3658|      0|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3658:17): [True: 0, False: 0]
  ------------------
 3659|      0|                res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3660|      0|                goto error;
 3661|      0|            }
 3662|      0|            f->cur_segmap = f->cur_segmap_ref->data;
 3663|      0|            memset(f->cur_segmap, 0, segmap_size);
 3664|      0|        }
 3665|  45.5k|    } else {
 3666|  45.5k|        f->cur_segmap = NULL;
 3667|  45.5k|        f->cur_segmap_ref = NULL;
 3668|  45.5k|        f->prev_segmap_ref = NULL;
 3669|  45.5k|    }
 3670|       |
 3671|       |    // update references etc.
 3672|  45.5k|    const unsigned refresh_frame_flags = f->frame_hdr->refresh_frame_flags;
 3673|   409k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3673:21): [True: 364k, False: 45.5k]
  ------------------
 3674|   364k|        if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3674:13): [True: 125k, False: 239k]
  ------------------
 3675|   125k|            if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3675:17): [True: 34.1k, False: 91.0k]
  ------------------
 3676|  34.1k|                dav1d_thread_picture_unref(&c->refs[i].p);
 3677|   125k|            dav1d_thread_picture_ref(&c->refs[i].p, &f->sr_cur);
 3678|       |
 3679|   125k|            dav1d_cdf_thread_unref(&c->cdf[i]);
 3680|   125k|            if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3680:17): [True: 125k, False: 0]
  ------------------
 3681|   125k|                dav1d_cdf_thread_ref(&c->cdf[i], &f->out_cdf);
 3682|   125k|            } else {
 3683|      0|                dav1d_cdf_thread_ref(&c->cdf[i], &f->in_cdf);
 3684|      0|            }
 3685|       |
 3686|   125k|            dav1d_ref_dec(&c->refs[i].segmap);
 3687|   125k|            c->refs[i].segmap = f->cur_segmap_ref;
 3688|   125k|            if (f->cur_segmap_ref)
  ------------------
  |  Branch (3688:17): [True: 0, False: 125k]
  ------------------
 3689|      0|                dav1d_ref_inc(f->cur_segmap_ref);
 3690|   125k|            dav1d_ref_dec(&c->refs[i].refmvs);
 3691|   125k|            if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3691:17): [True: 125k, False: 0]
  ------------------
 3692|   125k|                c->refs[i].refmvs = f->mvs_ref;
 3693|   125k|                if (f->mvs_ref)
  ------------------
  |  Branch (3693:21): [True: 34.1k, False: 91.0k]
  ------------------
 3694|  34.1k|                    dav1d_ref_inc(f->mvs_ref);
 3695|   125k|            }
 3696|   125k|            memcpy(c->refs[i].refpoc, f->refpoc, sizeof(f->refpoc));
 3697|   125k|        }
 3698|   364k|    }
 3699|       |
 3700|  45.5k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3700:9): [True: 45.5k, False: 0]
  ------------------
 3701|  45.5k|        if ((res = dav1d_decode_frame(f)) < 0) {
  ------------------
  |  Branch (3701:13): [True: 0, False: 45.5k]
  ------------------
 3702|      0|            dav1d_thread_picture_unref(&c->out);
 3703|      0|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3703:29): [True: 0, False: 0]
  ------------------
 3704|      0|                if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3704:21): [True: 0, False: 0]
  ------------------
 3705|      0|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3705:25): [True: 0, False: 0]
  ------------------
 3706|      0|                        dav1d_thread_picture_unref(&c->refs[i].p);
 3707|      0|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 3708|      0|                    dav1d_ref_dec(&c->refs[i].segmap);
 3709|      0|                    dav1d_ref_dec(&c->refs[i].refmvs);
 3710|      0|                }
 3711|      0|            }
 3712|      0|            goto error;
 3713|      0|        }
 3714|  45.5k|    } else {
 3715|      0|        dav1d_task_frame_init(f);
 3716|      0|        pthread_mutex_unlock(&c->task_thread.lock);
 3717|      0|    }
 3718|       |
 3719|  45.5k|    return 0;
 3720|      0|error:
 3721|      0|    atomic_init(&f->task_thread.error, 1);
 3722|      0|    dav1d_cdf_thread_unref(&f->in_cdf);
 3723|      0|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3723:9): [True: 0, False: 0]
  ------------------
 3724|      0|        dav1d_cdf_thread_unref(&f->out_cdf);
 3725|      0|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3725:21): [True: 0, False: 0]
  ------------------
 3726|      0|        if (f->refp[i].p.frame_hdr)
  ------------------
  |  Branch (3726:13): [True: 0, False: 0]
  ------------------
 3727|      0|            dav1d_thread_picture_unref(&f->refp[i]);
 3728|      0|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3729|      0|    }
 3730|      0|    if (c->n_fc == 1)
  ------------------
  |  Branch (3730:9): [True: 0, False: 0]
  ------------------
 3731|      0|        dav1d_thread_picture_unref(&c->out);
 3732|      0|    else
 3733|      0|        dav1d_thread_picture_unref(out_delayed);
 3734|      0|    dav1d_picture_unref_internal(&f->cur);
 3735|      0|    dav1d_thread_picture_unref(&f->sr_cur);
 3736|      0|    dav1d_ref_dec(&f->mvs_ref);
 3737|      0|    dav1d_ref_dec(&f->seq_hdr_ref);
 3738|      0|    dav1d_ref_dec(&f->frame_hdr_ref);
 3739|      0|    dav1d_data_props_copy(&c->cached_error_props, &c->in.m);
 3740|       |
 3741|      0|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3741:21): [True: 0, False: 0]
  ------------------
 3742|      0|        dav1d_data_unref_internal(&f->tile[i].data);
 3743|      0|    f->n_tile_data = 0;
 3744|       |
 3745|      0|    if (c->n_fc > 1)
  ------------------
  |  Branch (3745:9): [True: 0, False: 0]
  ------------------
 3746|      0|        pthread_mutex_unlock(&c->task_thread.lock);
 3747|       |
 3748|      0|    return res;
 3749|  45.5k|}
decode.c:reset_context:
 2392|   141k|static void reset_context(BlockContext *const ctx, const int keyframe, const int pass) {
 2393|   141k|    memset(ctx->intra, keyframe, sizeof(ctx->intra));
 2394|   141k|    memset(ctx->uvmode, DC_PRED, sizeof(ctx->uvmode));
 2395|   141k|    if (keyframe)
  ------------------
  |  Branch (2395:9): [True: 28.0k, False: 113k]
  ------------------
 2396|  28.0k|        memset(ctx->mode, DC_PRED, sizeof(ctx->mode));
 2397|       |
 2398|   141k|    if (pass == 2) return;
  ------------------
  |  Branch (2398:9): [True: 0, False: 141k]
  ------------------
 2399|       |
 2400|   141k|    memset(ctx->partition, 0, sizeof(ctx->partition));
 2401|   141k|    memset(ctx->skip, 0, sizeof(ctx->skip));
 2402|   141k|    memset(ctx->skip_mode, 0, sizeof(ctx->skip_mode));
 2403|   141k|    memset(ctx->tx_lpf_y, 2, sizeof(ctx->tx_lpf_y));
 2404|   141k|    memset(ctx->tx_lpf_uv, 1, sizeof(ctx->tx_lpf_uv));
 2405|   141k|    memset(ctx->tx_intra, -1, sizeof(ctx->tx_intra));
 2406|   141k|    memset(ctx->tx, TX_64X64, sizeof(ctx->tx));
 2407|   141k|    if (!keyframe) {
  ------------------
  |  Branch (2407:9): [True: 113k, False: 28.0k]
  ------------------
 2408|   113k|        memset(ctx->ref, -1, sizeof(ctx->ref));
 2409|   113k|        memset(ctx->comp_type, 0, sizeof(ctx->comp_type));
 2410|   113k|        memset(ctx->mode, NEARESTMV, sizeof(ctx->mode));
 2411|   113k|    }
 2412|   141k|    memset(ctx->lcoef, 0x40, sizeof(ctx->lcoef));
 2413|   141k|    memset(ctx->ccoef, 0x40, sizeof(ctx->ccoef));
 2414|   141k|    memset(ctx->filter, DAV1D_N_SWITCHABLE_FILTERS, sizeof(ctx->filter));
 2415|   141k|    memset(ctx->seg_pred, 0, sizeof(ctx->seg_pred));
 2416|   141k|    memset(ctx->pal_sz, 0, sizeof(ctx->pal_sz));
 2417|   141k|}
decode.c:decode_sb:
 2121|  1.79M|{
 2122|  1.79M|    const Dav1dFrameContext *const f = t->f;
 2123|  1.79M|    Dav1dTileState *const ts = t->ts;
 2124|  1.79M|    const int hsz = 16 >> bl;
 2125|  1.79M|    const int have_h_split = f->bw > t->bx + hsz;
 2126|  1.79M|    const int have_v_split = f->bh > t->by + hsz;
 2127|       |
 2128|  1.79M|    if (!have_h_split && !have_v_split) {
  ------------------
  |  Branch (2128:9): [True: 176k, False: 1.61M]
  |  Branch (2128:26): [True: 75.0k, False: 101k]
  ------------------
 2129|  75.0k|        assert(bl < BL_8X8);
  ------------------
  |  |  140|  75.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 75.0k]
  |  |  |  Branch (140:68): [Folded, False: 75.0k]
  |  |  ------------------
  ------------------
 2130|  75.0k|        return decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0));
  ------------------
  |  |   51|  75.0k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
 2131|  75.0k|    }
 2132|       |
 2133|  1.71M|    uint16_t *pc;
 2134|  1.71M|    enum BlockPartition bp;
 2135|  1.71M|    int ctx, bx8, by8;
 2136|  1.71M|    if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (2136:9): [True: 1.71M, False: 18.4E]
  ------------------
 2137|  1.71M|        if (0 && bl == BL_64X64)
  ------------------
  |  Branch (2137:13): [Folded, False: 1.71M]
  |  Branch (2137:18): [True: 0, False: 0]
  ------------------
 2138|      0|            printf("poc=%d,y=%d,x=%d,bl=%d,r=%d\n",
 2139|      0|                   f->frame_hdr->frame_offset, t->by, t->bx, bl, ts->msac.rng);
 2140|  1.71M|        bx8 = (t->bx & 31) >> 1;
 2141|  1.71M|        by8 = (t->by & 31) >> 1;
 2142|  1.71M|        ctx = get_partition_ctx(t->a, &t->l, bl, by8, bx8);
 2143|  1.71M|        pc = ts->cdf.m.partition[bl][ctx];
 2144|  1.71M|    }
 2145|       |
 2146|  1.71M|    if (have_h_split && have_v_split) {
  ------------------
  |  Branch (2146:9): [True: 1.61M, False: 101k]
  |  Branch (2146:25): [True: 1.51M, False: 98.6k]
  ------------------
 2147|  1.51M|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2147:13): [True: 0, False: 1.51M]
  ------------------
 2148|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2149|      0|            bp = b->bl == bl ? b->bp : PARTITION_SPLIT;
  ------------------
  |  Branch (2149:18): [True: 0, False: 0]
  ------------------
 2150|  1.51M|        } else {
 2151|  1.51M|            bp = dav1d_msac_decode_symbol_adapt16(&ts->msac, pc,
  ------------------
  |  |   57|  1.51M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 2152|  1.51M|                                                  dav1d_partition_type_count[bl]);
 2153|  1.51M|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 &&
  ------------------
  |  Branch (2153:17): [True: 153k, False: 1.36M]
  ------------------
 2154|   153k|                (bp == PARTITION_V || bp == PARTITION_V4 ||
  ------------------
  |  Branch (2154:18): [True: 18.4E, False: 153k]
  |  Branch (2154:39): [True: 19, False: 153k]
  ------------------
 2155|   153k|                 bp == PARTITION_T_LEFT_SPLIT || bp == PARTITION_T_RIGHT_SPLIT))
  ------------------
  |  Branch (2155:18): [True: 18.4E, False: 153k]
  |  Branch (2155:50): [True: 18.4E, False: 153k]
  ------------------
 2156|      0|            {
 2157|      0|                return 1;
 2158|      0|            }
 2159|  1.51M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.51M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.51M]
  |  |  ------------------
  |  |   35|  1.51M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.51M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2160|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2161|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx, bp,
 2162|      0|                       ts->msac.rng);
 2163|  1.51M|        }
 2164|  1.51M|        const uint8_t *const b = dav1d_block_sizes[bl][bp];
 2165|       |
 2166|  1.51M|        switch (bp) {
 2167|  1.18M|        case PARTITION_NONE:
  ------------------
  |  Branch (2167:9): [True: 1.18M, False: 334k]
  ------------------
 2168|  1.18M|            if (decode_b(t, bl, b[0], PARTITION_NONE, node->o))
  ------------------
  |  Branch (2168:17): [True: 0, False: 1.18M]
  ------------------
 2169|      0|                return -1;
 2170|  1.18M|            break;
 2171|  1.18M|        case PARTITION_H:
  ------------------
  |  Branch (2171:9): [True: 4.59k, False: 1.51M]
  ------------------
 2172|  4.59k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[0]))
  ------------------
  |  Branch (2172:17): [True: 0, False: 4.59k]
  ------------------
 2173|      0|                return -1;
 2174|  4.59k|            t->by += hsz;
 2175|  4.59k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[1]))
  ------------------
  |  Branch (2175:17): [True: 0, False: 4.59k]
  ------------------
 2176|      0|                return -1;
 2177|  4.59k|            t->by -= hsz;
 2178|  4.59k|            break;
 2179|  3.21k|        case PARTITION_V:
  ------------------
  |  Branch (2179:9): [True: 3.21k, False: 1.51M]
  ------------------
 2180|  3.21k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[0]))
  ------------------
  |  Branch (2180:17): [True: 0, False: 3.21k]
  ------------------
 2181|      0|                return -1;
 2182|  3.21k|            t->bx += hsz;
 2183|  3.21k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[1]))
  ------------------
  |  Branch (2183:17): [True: 0, False: 3.21k]
  ------------------
 2184|      0|                return -1;
 2185|  3.21k|            t->bx -= hsz;
 2186|  3.21k|            break;
 2187|   330k|        case PARTITION_SPLIT:
  ------------------
  |  Branch (2187:9): [True: 330k, False: 1.18M]
  ------------------
 2188|   330k|            if (bl == BL_8X8) {
  ------------------
  |  Branch (2188:17): [True: 5.98k, False: 324k]
  ------------------
 2189|  5.98k|                const EdgeTip *const tip = (const EdgeTip *) node;
 2190|  5.98k|                assert(hsz == 1);
  ------------------
  |  |  140|  5.98k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 5.98k]
  |  |  |  Branch (140:68): [Folded, False: 5.98k]
  |  |  ------------------
  ------------------
 2191|  5.98k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2191:21): [True: 0, False: 5.98k]
  ------------------
 2192|      0|                    return -1;
 2193|  5.98k|                const enum Filter2d tl_filter = t->tl_4x4_filter;
 2194|  5.98k|                t->bx++;
 2195|  5.98k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[0]))
  ------------------
  |  Branch (2195:21): [True: 0, False: 5.98k]
  ------------------
 2196|      0|                    return -1;
 2197|  5.98k|                t->bx--;
 2198|  5.98k|                t->by++;
 2199|  5.98k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[1]))
  ------------------
  |  Branch (2199:21): [True: 0, False: 5.98k]
  ------------------
 2200|      0|                    return -1;
 2201|  5.98k|                t->bx++;
 2202|  5.98k|                t->tl_4x4_filter = tl_filter;
 2203|  5.98k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[2]))
  ------------------
  |  Branch (2203:21): [True: 0, False: 5.98k]
  ------------------
 2204|      0|                    return -1;
 2205|  5.98k|                t->bx--;
 2206|  5.98k|                t->by--;
 2207|  5.98k|#if ARCH_X86_64
 2208|  5.98k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (2208:21): [True: 0, False: 5.98k]
  ------------------
 2209|       |                    /* In 8-bit mode with 2-pass decoding the coefficient buffer
 2210|       |                     * can end up misaligned due to skips here. Work around
 2211|       |                     * the issue by explicitly realigning the buffer. */
 2212|      0|                    const int p = t->frame_thread.pass & 1;
 2213|      0|                    ts->frame_thread[p].cf =
 2214|      0|                        (void*)(((uintptr_t)ts->frame_thread[p].cf + 63) & ~63);
 2215|      0|                }
 2216|  5.98k|#endif
 2217|   324k|            } else {
 2218|   324k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0)))
  ------------------
  |  |   51|   324k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2218:21): [True: 0, False: 324k]
  ------------------
 2219|      0|                    return 1;
 2220|   324k|                t->bx += hsz;
 2221|   324k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1)))
  ------------------
  |  |   51|   324k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2221:21): [True: 0, False: 324k]
  ------------------
 2222|      0|                    return 1;
 2223|   324k|                t->bx -= hsz;
 2224|   324k|                t->by += hsz;
 2225|   324k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2)))
  ------------------
  |  |   51|   324k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2225:21): [True: 0, False: 324k]
  ------------------
 2226|      0|                    return 1;
 2227|   324k|                t->bx += hsz;
 2228|   324k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 3)))
  ------------------
  |  |   51|   324k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2228:21): [True: 0, False: 324k]
  ------------------
 2229|      0|                    return 1;
 2230|   324k|                t->bx -= hsz;
 2231|   324k|                t->by -= hsz;
 2232|   324k|            }
 2233|   330k|            break;
 2234|   330k|        case PARTITION_T_TOP_SPLIT: {
  ------------------
  |  Branch (2234:9): [True: 0, False: 1.51M]
  ------------------
 2235|      0|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2235:17): [True: 0, False: 0]
  ------------------
 2236|      0|                return -1;
 2237|      0|            t->bx += hsz;
 2238|      0|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, node->v[1]))
  ------------------
  |  Branch (2238:17): [True: 0, False: 0]
  ------------------
 2239|      0|                return -1;
 2240|      0|            t->bx -= hsz;
 2241|      0|            t->by += hsz;
 2242|      0|            if (decode_b(t, bl, b[1], PARTITION_T_TOP_SPLIT, node->h[1]))
  ------------------
  |  Branch (2242:17): [True: 0, False: 0]
  ------------------
 2243|      0|                return -1;
 2244|      0|            t->by -= hsz;
 2245|      0|            break;
 2246|      0|        }
 2247|      0|        case PARTITION_T_BOTTOM_SPLIT: {
  ------------------
  |  Branch (2247:9): [True: 0, False: 1.51M]
  ------------------
 2248|      0|            if (decode_b(t, bl, b[0], PARTITION_T_BOTTOM_SPLIT, node->h[0]))
  ------------------
  |  Branch (2248:17): [True: 0, False: 0]
  ------------------
 2249|      0|                return -1;
 2250|      0|            t->by += hsz;
 2251|      0|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, node->v[0]))
  ------------------
  |  Branch (2251:17): [True: 0, False: 0]
  ------------------
 2252|      0|                return -1;
 2253|      0|            t->bx += hsz;
 2254|      0|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, 0))
  ------------------
  |  Branch (2254:17): [True: 0, False: 0]
  ------------------
 2255|      0|                return -1;
 2256|      0|            t->bx -= hsz;
 2257|      0|            t->by -= hsz;
 2258|      0|            break;
 2259|      0|        }
 2260|      0|        case PARTITION_T_LEFT_SPLIT: {
  ------------------
  |  Branch (2260:9): [True: 0, False: 1.51M]
  ------------------
 2261|      0|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2261:17): [True: 0, False: 0]
  ------------------
 2262|      0|                return -1;
 2263|      0|            t->by += hsz;
 2264|      0|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, node->h[1]))
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|                return -1;
 2266|      0|            t->by -= hsz;
 2267|      0|            t->bx += hsz;
 2268|      0|            if (decode_b(t, bl, b[1], PARTITION_T_LEFT_SPLIT, node->v[1]))
  ------------------
  |  Branch (2268:17): [True: 0, False: 0]
  ------------------
 2269|      0|                return -1;
 2270|      0|            t->bx -= hsz;
 2271|      0|            break;
 2272|      0|        }
 2273|      0|        case PARTITION_T_RIGHT_SPLIT: {
  ------------------
  |  Branch (2273:9): [True: 0, False: 1.51M]
  ------------------
 2274|      0|            if (decode_b(t, bl, b[0], PARTITION_T_RIGHT_SPLIT, node->v[0]))
  ------------------
  |  Branch (2274:17): [True: 0, False: 0]
  ------------------
 2275|      0|                return -1;
 2276|      0|            t->bx += hsz;
 2277|      0|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, node->h[0]))
  ------------------
  |  Branch (2277:17): [True: 0, False: 0]
  ------------------
 2278|      0|                return -1;
 2279|      0|            t->by += hsz;
 2280|      0|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, 0))
  ------------------
  |  Branch (2280:17): [True: 0, False: 0]
  ------------------
 2281|      0|                return -1;
 2282|      0|            t->by -= hsz;
 2283|      0|            t->bx -= hsz;
 2284|      0|            break;
 2285|      0|        }
 2286|      0|        case PARTITION_H4: {
  ------------------
  |  Branch (2286:9): [True: 0, False: 1.51M]
  ------------------
 2287|      0|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2288|      0|            if (decode_b(t, bl, b[0], PARTITION_H4, node->h[0]))
  ------------------
  |  Branch (2288:17): [True: 0, False: 0]
  ------------------
 2289|      0|                return -1;
 2290|      0|            t->by += hsz >> 1;
 2291|      0|            if (decode_b(t, bl, b[0], PARTITION_H4, branch->h4))
  ------------------
  |  Branch (2291:17): [True: 0, False: 0]
  ------------------
 2292|      0|                return -1;
 2293|      0|            t->by += hsz >> 1;
 2294|      0|            if (decode_b(t, bl, b[0], PARTITION_H4, EDGE_ALL_LEFT_HAS_BOTTOM))
  ------------------
  |  Branch (2294:17): [True: 0, False: 0]
  ------------------
 2295|      0|                return -1;
 2296|      0|            t->by += hsz >> 1;
 2297|      0|            if (t->by < f->bh)
  ------------------
  |  Branch (2297:17): [True: 0, False: 0]
  ------------------
 2298|      0|                if (decode_b(t, bl, b[0], PARTITION_H4, node->h[1]))
  ------------------
  |  Branch (2298:21): [True: 0, False: 0]
  ------------------
 2299|      0|                    return -1;
 2300|      0|            t->by -= hsz * 3 >> 1;
 2301|      0|            break;
 2302|      0|        }
 2303|      0|        case PARTITION_V4: {
  ------------------
  |  Branch (2303:9): [True: 0, False: 1.51M]
  ------------------
 2304|      0|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2305|      0|            if (decode_b(t, bl, b[0], PARTITION_V4, node->v[0]))
  ------------------
  |  Branch (2305:17): [True: 0, False: 0]
  ------------------
 2306|      0|                return -1;
 2307|      0|            t->bx += hsz >> 1;
 2308|      0|            if (decode_b(t, bl, b[0], PARTITION_V4, branch->v4))
  ------------------
  |  Branch (2308:17): [True: 0, False: 0]
  ------------------
 2309|      0|                return -1;
 2310|      0|            t->bx += hsz >> 1;
 2311|      0|            if (decode_b(t, bl, b[0], PARTITION_V4, EDGE_ALL_TOP_HAS_RIGHT))
  ------------------
  |  Branch (2311:17): [True: 0, False: 0]
  ------------------
 2312|      0|                return -1;
 2313|      0|            t->bx += hsz >> 1;
 2314|      0|            if (t->bx < f->bw)
  ------------------
  |  Branch (2314:17): [True: 0, False: 0]
  ------------------
 2315|      0|                if (decode_b(t, bl, b[0], PARTITION_V4, node->v[1]))
  ------------------
  |  Branch (2315:21): [True: 0, False: 0]
  ------------------
 2316|      0|                    return -1;
 2317|      0|            t->bx -= hsz * 3 >> 1;
 2318|      0|            break;
 2319|      0|        }
 2320|      0|        default: assert(0);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2320:9): [True: 0, False: 1.51M]
  ------------------
 2321|  1.51M|        }
 2322|  1.51M|    } else if (have_h_split) {
  ------------------
  |  Branch (2322:16): [True: 99.3k, False: 100k]
  ------------------
 2323|  99.3k|        unsigned is_split;
 2324|  99.3k|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2324:13): [True: 0, False: 99.3k]
  ------------------
 2325|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2326|      0|            is_split = b->bl != bl;
 2327|  99.3k|        } else {
 2328|  99.3k|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|  99.3k|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2329|  99.3k|                           gather_top_partition_prob(pc, bl));
 2330|  99.3k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  99.3k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 99.3k]
  |  |  ------------------
  |  |   35|  99.3k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  99.3k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2331|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2332|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx,
 2333|      0|                       is_split ? PARTITION_SPLIT : PARTITION_H, ts->msac.rng);
  ------------------
  |  Branch (2333:24): [True: 0, False: 0]
  ------------------
 2334|  99.3k|        }
 2335|       |
 2336|  99.3k|        assert(bl < BL_8X8);
  ------------------
  |  |  140|  99.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 99.3k]
  |  |  |  Branch (140:68): [Folded, False: 99.3k]
  |  |  ------------------
  ------------------
 2337|  99.3k|        if (is_split) {
  ------------------
  |  Branch (2337:13): [True: 86.2k, False: 13.1k]
  ------------------
 2338|  86.2k|            bp = PARTITION_SPLIT;
 2339|  86.2k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|  86.2k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2339:17): [True: 0, False: 86.2k]
  ------------------
 2340|  86.2k|            t->bx += hsz;
 2341|  86.2k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1))) return 1;
  ------------------
  |  |   51|  86.2k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2341:17): [True: 0, False: 86.2k]
  ------------------
 2342|  86.2k|            t->bx -= hsz;
 2343|  86.2k|        } else {
 2344|  13.1k|            bp = PARTITION_H;
 2345|  13.1k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_H][0],
  ------------------
  |  Branch (2345:17): [True: 0, False: 13.1k]
  ------------------
 2346|  13.1k|                         PARTITION_H, node->h[0]))
 2347|      0|                return -1;
 2348|  13.1k|        }
 2349|   100k|    } else {
 2350|   100k|        assert(have_v_split);
  ------------------
  |  |  140|   100k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 100k]
  |  |  |  Branch (140:68): [Folded, False: 100k]
  |  |  ------------------
  ------------------
 2351|   100k|        unsigned is_split;
 2352|   100k|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2352:13): [True: 0, False: 100k]
  ------------------
 2353|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2354|      0|            is_split = b->bl != bl;
 2355|   100k|        } else {
 2356|   100k|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|   100k|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2357|   100k|                           gather_left_partition_prob(pc, bl));
 2358|   100k|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 && !is_split)
  ------------------
  |  Branch (2358:17): [True: 10.5k, False: 89.6k]
  |  Branch (2358:63): [True: 0, False: 10.5k]
  ------------------
 2359|      0|                return 1;
 2360|   100k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   100k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 100k]
  |  |  ------------------
  |  |   35|   100k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   100k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2361|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2362|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx,
 2363|      0|                       is_split ? PARTITION_SPLIT : PARTITION_V, ts->msac.rng);
  ------------------
  |  Branch (2363:24): [True: 0, False: 0]
  ------------------
 2364|   100k|        }
 2365|       |
 2366|   100k|        assert(bl < BL_8X8);
  ------------------
  |  |  140|   100k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 100k]
  |  |  |  Branch (140:68): [Folded, False: 100k]
  |  |  ------------------
  ------------------
 2367|   100k|        if (is_split) {
  ------------------
  |  Branch (2367:13): [True: 85.0k, False: 15.1k]
  ------------------
 2368|  85.0k|            bp = PARTITION_SPLIT;
 2369|  85.0k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|  85.0k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2369:17): [True: 0, False: 85.0k]
  ------------------
 2370|  85.0k|            t->by += hsz;
 2371|  85.0k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2))) return 1;
  ------------------
  |  |   51|  85.0k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2371:17): [True: 0, False: 85.0k]
  ------------------
 2372|  85.0k|            t->by -= hsz;
 2373|  85.0k|        } else {
 2374|  15.1k|            bp = PARTITION_V;
 2375|  15.1k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_V][0],
  ------------------
  |  Branch (2375:17): [True: 0, False: 15.1k]
  ------------------
 2376|  15.1k|                         PARTITION_V, node->v[0]))
 2377|      0|                return -1;
 2378|  15.1k|        }
 2379|   100k|    }
 2380|       |
 2381|  1.72M|    if (t->frame_thread.pass != 2 && (bp != PARTITION_SPLIT || bl == BL_8X8)) {
  ------------------
  |  Branch (2381:9): [True: 1.72M, False: 18.4E]
  |  Branch (2381:39): [True: 1.21M, False: 502k]
  |  Branch (2381:64): [True: 5.97k, False: 496k]
  ------------------
 2382|  1.22M|#define set_ctx(rep_macro) \
 2383|  1.22M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
 2384|  1.22M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
 2385|  1.22M|        case_set_upto16(ulog2(hsz));
  ------------------
  |  |   80|  1.22M|    switch (var) { \
  |  |   81|  1.09M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 2383|  1.09M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  1.09M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.09M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2384|  1.09M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  1.09M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.09M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 1.09M, False: 133k]
  |  |  ------------------
  |  |   82|   117k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 2383|   117k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   117k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   117k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2384|   117k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   117k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   117k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 117k, False: 1.11M]
  |  |  ------------------
  |  |   83|  14.5k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 2383|  14.5k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  14.5k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  14.5k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2384|  14.5k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  14.5k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  14.5k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 14.5k, False: 1.21M]
  |  |  ------------------
  |  |   84|  1.70k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 2383|  1.70k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.70k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.70k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2384|  1.70k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.70k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.70k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 1.70k, False: 1.22M]
  |  |  ------------------
  |  |   85|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 2383|      0|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2384|      0|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 0, False: 1.22M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 1.22M]
  |  |  ------------------
  |  |   87|  1.22M|    }
  ------------------
 2386|  1.22M|#undef set_ctx
 2387|  1.22M|    }
 2388|       |
 2389|  1.71M|    return 0;
 2390|  1.72M|}
decode.c:decode_b:
  687|  1.25M|                    const enum EdgeFlags intra_edge_flags) {
  688|  1.25M|    Dav1dTileState *const ts = t->ts;
  689|  1.25M|    const Dav1dFrameContext *const f = t->f;
  690|  1.25M|    Av1Block b_mem, *const b = t->frame_thread.pass ?
  ------------------
  |  Branch (690:32): [True: 0, False: 1.25M]
  ------------------
  691|  1.25M|        &f->frame_thread.b[t->by * f->b4_stride + t->bx] : &b_mem;
  692|  1.25M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  693|  1.25M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  694|  1.25M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  695|  1.25M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  696|  1.25M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
  697|  1.25M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  698|  1.25M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
  699|  1.25M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
  700|  1.25M|    const int have_left = t->bx > ts->tiling.col_start;
  701|  1.25M|    const int have_top = t->by > ts->tiling.row_start;
  702|  1.25M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (702:28): [True: 484k, False: 766k]
  ------------------
  703|   484k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (703:29): [True: 472k, False: 12.2k]
  |  Branch (703:45): [True: 6.11k, False: 6.11k]
  ------------------
  704|   478k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (704:29): [True: 475k, False: 3.68k]
  |  Branch (704:45): [True: 1.84k, False: 1.84k]
  ------------------
  705|       |
  706|  1.25M|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (706:9): [True: 0, False: 1.25M]
  ------------------
  707|      0|        if (b->intra) {
  ------------------
  |  Branch (707:13): [True: 0, False: 0]
  ------------------
  708|      0|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
  709|       |
  710|      0|            const enum IntraPredMode y_mode_nofilt =
  711|      0|                b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (711:17): [True: 0, False: 0]
  ------------------
  712|      0|#define set_ctx(rep_macro) \
  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  714|      0|            rep_macro(edge->intra, off, 1)
  715|      0|            BlockContext *edge = t->a;
  716|      0|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (716:40): [True: 0, False: 0]
  ------------------
  717|      0|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  713|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  714|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
  718|      0|            }
  719|      0|#undef set_ctx
  720|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  721|      0|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  722|      0|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (722:33): [True: 0, False: 0]
  ------------------
  723|      0|                    r[x].ref.ref[0] = 0;
  724|      0|                    r[x].bs = bs;
  725|      0|                }
  726|      0|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  727|      0|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (727:33): [True: 0, False: 0]
  ------------------
  728|      0|                    rr[y][t->bx + bw4 - 1].ref.ref[0] = 0;
  729|      0|                    rr[y][t->bx + bw4 - 1].bs = bs;
  730|      0|                }
  731|      0|            }
  732|       |
  733|      0|            if (has_chroma) {
  ------------------
  |  Branch (733:17): [True: 0, False: 0]
  ------------------
  734|      0|                uint8_t uv_mode = b->uv_mode;
  735|      0|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
  736|      0|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
  737|      0|            }
  738|      0|        } else {
  739|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr) /* not intrabc */ &&
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  740|      0|                b->comp_type == COMP_INTER_NONE && b->motion_mode == MM_WARP)
  ------------------
  |  Branch (740:17): [True: 0, False: 0]
  |  Branch (740:52): [True: 0, False: 0]
  ------------------
  741|      0|            {
  742|      0|                if (b->matrix[0] == INT16_MIN) {
  ------------------
  |  Branch (742:21): [True: 0, False: 0]
  ------------------
  743|      0|                    t->warpmv.type = DAV1D_WM_TYPE_IDENTITY;
  744|      0|                } else {
  745|      0|                    t->warpmv.type = DAV1D_WM_TYPE_AFFINE;
  746|      0|                    t->warpmv.matrix[2] = b->matrix[0] + 0x10000;
  747|      0|                    t->warpmv.matrix[3] = b->matrix[1];
  748|      0|                    t->warpmv.matrix[4] = b->matrix[2];
  749|      0|                    t->warpmv.matrix[5] = b->matrix[3] + 0x10000;
  750|      0|                    dav1d_set_affine_mv2d(bw4, bh4, b->mv2d, &t->warpmv,
  751|      0|                                          t->bx, t->by);
  752|      0|                    dav1d_get_shear_params(&t->warpmv);
  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  754|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  755|      0|                        printf("[ %c%x %c%x %c%x\n  %c%x %c%x %c%x ]\n"
  756|      0|                               "alpha=%c%x, beta=%c%x, gamma=%c%x, delta=%c%x, mv=y:%d,x:%d\n",
  757|      0|                               signabs(t->warpmv.matrix[0]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  758|      0|                               signabs(t->warpmv.matrix[1]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  759|      0|                               signabs(t->warpmv.matrix[2]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  760|      0|                               signabs(t->warpmv.matrix[3]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  761|      0|                               signabs(t->warpmv.matrix[4]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  762|      0|                               signabs(t->warpmv.matrix[5]),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  763|      0|                               signabs(t->warpmv.u.p.alpha),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  764|      0|                               signabs(t->warpmv.u.p.beta),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  765|      0|                               signabs(t->warpmv.u.p.gamma),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  766|      0|                               signabs(t->warpmv.u.p.delta),
  ------------------
  |  |  753|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (753:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  767|      0|                               b->mv2d.y, b->mv2d.x);
  768|      0|#undef signabs
  769|      0|                }
  770|      0|            }
  771|      0|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (771:17): [True: 0, False: 0]
  ------------------
  772|       |
  773|      0|            const uint8_t *const filter = dav1d_filter_dir[b->filter2d];
  774|      0|            BlockContext *edge = t->a;
  775|      0|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (775:40): [True: 0, False: 0]
  ------------------
  776|      0|#define set_ctx(rep_macro) \
  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  779|      0|                rep_macro(edge->intra, off, 0)
  780|      0|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  777|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  778|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  779|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
  781|      0|#undef set_ctx
  782|      0|            }
  783|       |
  784|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  785|      0|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  786|      0|                const int ref1 = b->ref[0] + 1;
  787|      0|                const union mv mv1 = b->mv[0];
  788|      0|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (788:33): [True: 0, False: 0]
  ------------------
  789|      0|                    r[x].ref.ref[0] = ref1;
  790|      0|                    r[x].mv.mv[0] = mv1;
  791|      0|                    r[x].bs = bs;
  792|      0|                }
  793|      0|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  794|      0|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (794:33): [True: 0, False: 0]
  ------------------
  795|      0|                    rr[y][t->bx + bw4 - 1].ref.ref[0] = ref1;
  796|      0|                    rr[y][t->bx + bw4 - 1].mv.mv[0] = mv1;
  797|      0|                    rr[y][t->bx + bw4 - 1].bs = bs;
  798|      0|                }
  799|      0|            }
  800|       |
  801|      0|            if (has_chroma) {
  ------------------
  |  Branch (801:17): [True: 0, False: 0]
  ------------------
  802|      0|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
  803|      0|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
  804|      0|            }
  805|      0|        }
  806|      0|        return 0;
  807|      0|    }
  808|       |
  809|  1.25M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
  810|       |
  811|  1.25M|    b->bl = bl;
  812|  1.25M|    b->bp = bp;
  813|  1.25M|    b->bs = bs;
  814|       |
  815|  1.25M|    const Dav1dSegmentationData *seg = NULL;
  816|       |
  817|       |    // segment_id (if seg_feature for skip/ref/gmv is enabled)
  818|  1.25M|    int seg_pred = 0;
  819|  1.25M|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (819:9): [True: 0, False: 1.25M]
  ------------------
  820|      0|        if (!f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (820:13): [True: 0, False: 0]
  ------------------
  821|      0|            if (f->prev_segmap) {
  ------------------
  |  Branch (821:17): [True: 0, False: 0]
  ------------------
  822|      0|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  823|      0|                                                       f->prev_segmap,
  824|      0|                                                       f->b4_stride);
  825|      0|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (825:21): [True: 0, False: 0]
  ------------------
  826|      0|                b->seg_id = seg_id;
  827|      0|            } else {
  828|      0|                b->seg_id = 0;
  829|      0|            }
  830|      0|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  831|      0|        } else if (f->frame_hdr->segmentation.seg_data.preskip) {
  ------------------
  |  Branch (831:20): [True: 0, False: 0]
  ------------------
  832|      0|            if (f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (832:17): [True: 0, False: 0]
  ------------------
  833|      0|                (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (833:17): [True: 0, False: 0]
  ------------------
  834|      0|                                ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  835|      0|                                t->l.seg_pred[by4]])))
  836|      0|            {
  837|       |                // temporal predicted seg_id
  838|      0|                if (f->prev_segmap) {
  ------------------
  |  Branch (838:21): [True: 0, False: 0]
  ------------------
  839|      0|                    unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx,
  840|      0|                                                           w4, h4,
  841|      0|                                                           f->prev_segmap,
  842|      0|                                                           f->b4_stride);
  843|      0|                    if (seg_id >= 8) return -1;
  ------------------
  |  Branch (843:25): [True: 0, False: 0]
  ------------------
  844|      0|                    b->seg_id = seg_id;
  845|      0|                } else {
  846|      0|                    b->seg_id = 0;
  847|      0|                }
  848|      0|            } else {
  849|      0|                int seg_ctx;
  850|      0|                const unsigned pred_seg_id =
  851|      0|                    get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  852|      0|                                        &seg_ctx, f->cur_segmap, f->b4_stride);
  853|      0|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|      0|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  854|      0|                                          ts->cdf.m.seg_id[seg_ctx],
  855|      0|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|      0|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  856|      0|                const unsigned last_active_seg_id =
  857|      0|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  858|      0|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  859|      0|                                             last_active_seg_id + 1);
  860|      0|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (860:21): [True: 0, False: 0]
  ------------------
  861|      0|                if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|      0|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (861:21): [True: 0, False: 0]
  ------------------
  862|      0|            }
  863|       |
  864|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  865|      0|                printf("Post-segid[preskip;%d]: r=%d\n",
  866|      0|                       b->seg_id, ts->msac.rng);
  867|       |
  868|      0|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  869|      0|        }
  870|  1.25M|    } else {
  871|  1.25M|        b->seg_id = 0;
  872|  1.25M|    }
  873|       |
  874|       |    // skip_mode
  875|  1.25M|    if ((!seg || (!seg->globalmv && seg->ref == -1 && !seg->skip)) &&
  ------------------
  |  Branch (875:10): [True: 1.25M, False: 0]
  |  Branch (875:19): [True: 0, False: 0]
  |  Branch (875:37): [True: 0, False: 0]
  |  Branch (875:55): [True: 0, False: 0]
  ------------------
  876|  1.25M|        f->frame_hdr->skip_mode_enabled && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (876:9): [True: 0, False: 1.25M]
  |  Branch (876:44): [True: 0, False: 0]
  ------------------
  877|      0|    {
  878|      0|        const int smctx = t->a->skip_mode[bx4] + t->l.skip_mode[by4];
  879|      0|        b->skip_mode = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  880|      0|                           ts->cdf.m.skip_mode[smctx]);
  881|      0|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  882|      0|            printf("Post-skipmode[%d]: r=%d\n", b->skip_mode, ts->msac.rng);
  883|  1.25M|    } else {
  884|  1.25M|        b->skip_mode = 0;
  885|  1.25M|    }
  886|       |
  887|       |    // skip
  888|  1.25M|    if (b->skip_mode || (seg && seg->skip)) {
  ------------------
  |  Branch (888:9): [True: 808, False: 1.25M]
  |  Branch (888:26): [True: 0, False: 1.25M]
  |  Branch (888:33): [True: 0, False: 0]
  ------------------
  889|      0|        b->skip = 1;
  890|  1.25M|    } else {
  891|  1.25M|        const int sctx = t->a->skip[bx4] + t->l.skip[by4];
  892|  1.25M|        b->skip = dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.skip[sctx]);
  ------------------
  |  |   52|  1.25M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  893|  1.25M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.25M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.25M]
  |  |  ------------------
  |  |   35|  1.25M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.25M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  894|      0|            printf("Post-skip[%d]: r=%d\n", b->skip, ts->msac.rng);
  895|  1.25M|    }
  896|       |
  897|       |    // segment_id
  898|  1.25M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (898:9): [True: 0, False: 1.25M]
  ------------------
  899|      0|        f->frame_hdr->segmentation.update_map &&
  ------------------
  |  Branch (899:9): [True: 0, False: 0]
  ------------------
  900|      0|        !f->frame_hdr->segmentation.seg_data.preskip)
  ------------------
  |  Branch (900:9): [True: 0, False: 0]
  ------------------
  901|      0|    {
  902|      0|        if (!b->skip && f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (902:13): [True: 0, False: 0]
  |  Branch (902:25): [True: 0, False: 0]
  ------------------
  903|      0|            (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (903:13): [True: 0, False: 0]
  ------------------
  904|      0|                            ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  905|      0|                            t->l.seg_pred[by4]])))
  906|      0|        {
  907|       |            // temporal predicted seg_id
  908|      0|            if (f->prev_segmap) {
  ------------------
  |  Branch (908:17): [True: 0, False: 0]
  ------------------
  909|      0|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  910|      0|                                                       f->prev_segmap,
  911|      0|                                                       f->b4_stride);
  912|      0|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (912:21): [True: 0, False: 0]
  ------------------
  913|      0|                b->seg_id = seg_id;
  914|      0|            } else {
  915|      0|                b->seg_id = 0;
  916|      0|            }
  917|      0|        } else {
  918|      0|            int seg_ctx;
  919|      0|            const unsigned pred_seg_id =
  920|      0|                get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  921|      0|                                    &seg_ctx, f->cur_segmap, f->b4_stride);
  922|      0|            if (b->skip) {
  ------------------
  |  Branch (922:17): [True: 0, False: 0]
  ------------------
  923|      0|                b->seg_id = pred_seg_id;
  924|      0|            } else {
  925|      0|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|      0|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  926|      0|                                          ts->cdf.m.seg_id[seg_ctx],
  927|      0|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|      0|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  928|      0|                const unsigned last_active_seg_id =
  929|      0|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  930|      0|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  931|      0|                                             last_active_seg_id + 1);
  932|      0|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (932:21): [True: 0, False: 0]
  ------------------
  933|      0|            }
  934|      0|            if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|      0|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (934:17): [True: 0, False: 0]
  ------------------
  935|      0|        }
  936|       |
  937|      0|        seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  938|       |
  939|      0|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  940|      0|            printf("Post-segid[postskip;%d]: r=%d\n",
  941|      0|                   b->seg_id, ts->msac.rng);
  942|      0|    }
  943|       |
  944|       |    // cdef index
  945|  1.25M|    if (!b->skip) {
  ------------------
  |  Branch (945:9): [True: 1.22M, False: 27.8k]
  ------------------
  946|  1.22M|        const int idx = f->seq_hdr->sb128 ? ((t->bx & 16) >> 4) +
  ------------------
  |  Branch (946:25): [True: 0, False: 1.22M]
  ------------------
  947|  1.22M|                                           ((t->by & 16) >> 3) : 0;
  948|  1.22M|        if (t->cur_sb_cdef_idx_ptr[idx] == -1) {
  ------------------
  |  Branch (948:13): [True: 83.8k, False: 1.13M]
  ------------------
  949|  83.8k|            const int v = dav1d_msac_decode_bools(&ts->msac,
  950|  83.8k|                              f->frame_hdr->cdef.n_bits);
  951|  83.8k|            t->cur_sb_cdef_idx_ptr[idx] = v;
  952|  83.8k|            if (bw4 > 16) t->cur_sb_cdef_idx_ptr[idx + 1] = v;
  ------------------
  |  Branch (952:17): [True: 0, False: 83.8k]
  ------------------
  953|  83.8k|            if (bh4 > 16) t->cur_sb_cdef_idx_ptr[idx + 2] = v;
  ------------------
  |  Branch (953:17): [True: 0, False: 83.8k]
  ------------------
  954|  83.8k|            if (bw4 == 32 && bh4 == 32) t->cur_sb_cdef_idx_ptr[idx + 3] = v;
  ------------------
  |  Branch (954:17): [True: 0, False: 83.8k]
  |  Branch (954:30): [True: 0, False: 0]
  ------------------
  955|       |
  956|  83.8k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  83.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 83.8k]
  |  |  ------------------
  |  |   35|  83.8k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  83.8k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  957|      0|                printf("Post-cdef_idx[%d]: r=%d\n",
  958|      0|                        *t->cur_sb_cdef_idx_ptr, ts->msac.rng);
  959|  83.8k|        }
  960|  1.22M|    }
  961|       |
  962|       |    // delta-q/lf
  963|  1.25M|    if (!((t->bx | t->by) & (31 >> !f->seq_hdr->sb128))) {
  ------------------
  |  Branch (963:9): [True: 85.5k, False: 1.16M]
  ------------------
  964|  85.5k|        const int prev_qidx = ts->last_qidx;
  965|  85.5k|        const int have_delta_q = f->frame_hdr->delta.q.present &&
  ------------------
  |  Branch (965:34): [True: 26.4k, False: 59.0k]
  ------------------
  966|  26.4k|            (bs != (f->seq_hdr->sb128 ? BS_128x128 : BS_64x64) || !b->skip);
  ------------------
  |  Branch (966:14): [True: 26.2k, False: 219]
  |  Branch (966:21): [True: 0, False: 26.4k]
  |  Branch (966:67): [True: 207, False: 12]
  ------------------
  967|       |
  968|  85.5k|        uint32_t prev_delta_lf = ts->last_delta_lf.u32;
  969|       |
  970|  85.5k|        if (have_delta_q) {
  ------------------
  |  Branch (970:13): [True: 26.4k, False: 59.0k]
  ------------------
  971|  26.4k|            int delta_q = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|  26.4k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  972|  26.4k|                                                          ts->cdf.m.delta_q, 3);
  973|  26.4k|            if (delta_q == 3) {
  ------------------
  |  Branch (973:17): [True: 15.1k, False: 11.2k]
  ------------------
  974|  15.1k|                const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
  975|  15.1k|                delta_q = dav1d_msac_decode_bools(&ts->msac, n_bits) +
  976|  15.1k|                          1 + (1 << n_bits);
  977|  15.1k|            }
  978|  26.4k|            if (delta_q) {
  ------------------
  |  Branch (978:17): [True: 21.6k, False: 4.81k]
  ------------------
  979|  21.6k|                if (dav1d_msac_decode_bool_equi(&ts->msac)) delta_q = -delta_q;
  ------------------
  |  |   53|  21.6k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (979:21): [True: 21.5k, False: 62]
  ------------------
  980|  21.6k|                delta_q *= 1 << f->frame_hdr->delta.q.res_log2;
  981|  21.6k|            }
  982|  26.4k|            ts->last_qidx = iclip(ts->last_qidx + delta_q, 1, 255);
  983|  26.4k|            if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  26.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 26.4k]
  |  |  ------------------
  |  |   35|  26.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  26.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (983:17): [True: 26.4k, False: 18.4E]
  ------------------
  984|      0|                printf("Post-delta_q[%d->%d]: r=%d\n",
  985|      0|                       delta_q, ts->last_qidx, ts->msac.rng);
  986|       |
  987|  26.4k|            if (f->frame_hdr->delta.lf.present) {
  ------------------
  |  Branch (987:17): [True: 0, False: 26.4k]
  ------------------
  988|      0|                const int n_lfs = f->frame_hdr->delta.lf.multi ?
  ------------------
  |  Branch (988:35): [True: 0, False: 0]
  ------------------
  989|      0|                    f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 ? 4 : 2 : 1;
  ------------------
  |  Branch (989:21): [True: 0, False: 0]
  ------------------
  990|       |
  991|      0|                for (int i = 0; i < n_lfs; i++) {
  ------------------
  |  Branch (991:33): [True: 0, False: 0]
  ------------------
  992|      0|                    int delta_lf = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|      0|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  993|      0|                        ts->cdf.m.delta_lf[i + f->frame_hdr->delta.lf.multi], 3);
  994|      0|                    if (delta_lf == 3) {
  ------------------
  |  Branch (994:25): [True: 0, False: 0]
  ------------------
  995|      0|                        const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
  996|      0|                        delta_lf = dav1d_msac_decode_bools(&ts->msac, n_bits) +
  997|      0|                                   1 + (1 << n_bits);
  998|      0|                    }
  999|      0|                    if (delta_lf) {
  ------------------
  |  Branch (999:25): [True: 0, False: 0]
  ------------------
 1000|      0|                        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|      0|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (1000:29): [True: 0, False: 0]
  ------------------
 1001|      0|                            delta_lf = -delta_lf;
 1002|      0|                        delta_lf *= 1 << f->frame_hdr->delta.lf.res_log2;
 1003|      0|                    }
 1004|      0|                    ts->last_delta_lf.i8[i] =
 1005|      0|                        iclip(ts->last_delta_lf.i8[i] + delta_lf, -63, 63);
 1006|      0|                    if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1006:25): [True: 0, False: 0]
  ------------------
 1007|      0|                        printf("Post-delta_lf[%d:%d]: r=%d\n", i, delta_lf,
 1008|      0|                               ts->msac.rng);
 1009|      0|                }
 1010|      0|            }
 1011|  26.4k|        }
 1012|  85.5k|        if (ts->last_qidx == f->frame_hdr->quant.yac) {
  ------------------
  |  Branch (1012:13): [True: 63.1k, False: 22.3k]
  ------------------
 1013|       |            // assign frame-wide q values to this sb
 1014|  63.1k|            ts->dq = f->dq;
 1015|  63.1k|        } else if (ts->last_qidx != prev_qidx) {
  ------------------
  |  Branch (1015:20): [True: 21.5k, False: 812]
  ------------------
 1016|       |            // find sb-specific quant parameters
 1017|  21.5k|            init_quant_tables(f->seq_hdr, f->frame_hdr, ts->last_qidx, ts->dqmem);
 1018|  21.5k|            ts->dq = ts->dqmem;
 1019|  21.5k|        }
 1020|  85.5k|        if (!ts->last_delta_lf.u32) {
  ------------------
  |  Branch (1020:13): [True: 85.5k, False: 2]
  ------------------
 1021|       |            // assign frame-wide lf values to this sb
 1022|  85.5k|            ts->lflvl = f->lf.lvl;
 1023|  85.5k|        } else if (ts->last_delta_lf.u32 != prev_delta_lf) {
  ------------------
  |  Branch (1023:20): [True: 0, False: 2]
  ------------------
 1024|       |            // find sb-specific lf lvl parameters
 1025|      0|            ts->lflvl = ts->lflvlmem;
 1026|      0|            dav1d_calc_lf_values(ts->lflvlmem, f->frame_hdr, ts->last_delta_lf.i8);
 1027|      0|        }
 1028|  85.5k|    }
 1029|       |
 1030|  1.25M|    if (b->skip_mode) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 1.25M]
  ------------------
 1031|      0|        b->intra = 0;
 1032|  1.25M|    } else if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  1.25M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 1.14M, False: 103k]
  |  |  ------------------
  ------------------
 1033|  1.14M|        if (seg && (seg->ref >= 0 || seg->globalmv)) {
  ------------------
  |  Branch (1033:13): [True: 0, False: 1.14M]
  |  Branch (1033:21): [True: 0, False: 0]
  |  Branch (1033:38): [True: 0, False: 0]
  ------------------
 1034|      0|            b->intra = !seg->ref;
 1035|  1.14M|        } else {
 1036|  1.14M|            const int ictx = get_intra_ctx(t->a, &t->l, by4, bx4,
 1037|  1.14M|                                           have_top, have_left);
 1038|  1.14M|            b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.14M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1039|  1.14M|                            ts->cdf.m.intra[ictx]);
 1040|  1.14M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.14M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.14M]
  |  |  ------------------
  |  |   35|  1.14M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.14M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1041|      0|                printf("Post-intra[%d]: r=%d\n", b->intra, ts->msac.rng);
 1042|  1.14M|        }
 1043|  1.14M|    } else if (f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (1043:16): [True: 0, False: 103k]
  ------------------
 1044|      0|        b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.intrabc);
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1045|      0|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1046|      0|            printf("Post-intrabcflag[%d]: r=%d\n", b->intra, ts->msac.rng);
 1047|   103k|    } else {
 1048|   103k|        b->intra = 1;
 1049|   103k|    }
 1050|       |
 1051|       |    // intra/inter-specific stuff
 1052|  1.25M|    if (b->intra) {
  ------------------
  |  Branch (1052:9): [True: 932k, False: 318k]
  ------------------
 1053|   932k|        uint16_t *const ymode_cdf = IS_INTER_OR_SWITCH(f->frame_hdr) ?
  ------------------
  |  |   36|   932k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 830k, False: 101k]
  |  |  ------------------
  ------------------
 1054|   830k|            ts->cdf.m.y_mode[dav1d_ymode_size_context[bs]] :
 1055|   932k|            ts->cdf.kfym[dav1d_intra_mode_context[t->a->mode[bx4]]]
 1056|   101k|                        [dav1d_intra_mode_context[t->l.mode[by4]]];
 1057|   932k|        b->y_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, ymode_cdf,
  ------------------
  |  |   57|   932k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1058|   932k|                                                     N_INTRA_PRED_MODES - 1);
 1059|   932k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   932k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 932k]
  |  |  ------------------
  |  |   35|   932k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   932k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1060|      0|            printf("Post-ymode[%d]: r=%d\n", b->y_mode, ts->msac.rng);
 1061|       |
 1062|       |        // angle delta
 1063|   932k|        if (b_dim[2] + b_dim[3] >= 2 && b->y_mode >= VERT_PRED &&
  ------------------
  |  Branch (1063:13): [True: 900k, False: 31.6k]
  |  Branch (1063:41): [True: 82.8k, False: 817k]
  ------------------
 1064|  82.8k|            b->y_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1064:13): [True: 66.8k, False: 15.9k]
  ------------------
 1065|  66.8k|        {
 1066|  66.8k|            uint16_t *const acdf = ts->cdf.m.angle_delta[b->y_mode - VERT_PRED];
 1067|  66.8k|            const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|  66.8k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1068|  66.8k|            b->y_angle = angle - 3;
 1069|   865k|        } else {
 1070|   865k|            b->y_angle = 0;
 1071|   865k|        }
 1072|       |
 1073|   932k|        if (has_chroma) {
  ------------------
  |  Branch (1073:13): [True: 394k, False: 538k]
  ------------------
 1074|   394k|            const int cfl_allowed = f->frame_hdr->segmentation.lossless[b->seg_id] ?
  ------------------
  |  Branch (1074:37): [True: 6.99k, False: 387k]
  ------------------
 1075|   387k|                cbw4 == 1 && cbh4 == 1 : !!(cfl_allowed_mask & (1 << bs));
  ------------------
  |  Branch (1075:17): [True: 5.24k, False: 1.74k]
  |  Branch (1075:30): [True: 2.76k, False: 2.48k]
  ------------------
 1076|   394k|            uint16_t *const uvmode_cdf = ts->cdf.m.uv_mode[cfl_allowed][b->y_mode];
 1077|   394k|            b->uv_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, uvmode_cdf,
  ------------------
  |  |   57|   394k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1078|   394k|                             N_UV_INTRA_PRED_MODES - 1 - !cfl_allowed);
 1079|   394k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   394k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 394k]
  |  |  ------------------
  |  |   35|   394k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   394k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1080|      0|                printf("Post-uvmode[%d]: r=%d\n", b->uv_mode, ts->msac.rng);
 1081|       |
 1082|   394k|            b->uv_angle = 0;
 1083|   394k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1083:17): [True: 138k, False: 255k]
  ------------------
 1084|   138k|#define SIGN(a) (!!(a) + ((a) > 0))
 1085|   138k|                const int sign = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   138k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1086|   138k|                                     ts->cdf.m.cfl_sign, 7) + 1;
 1087|   138k|                const int sign_u = sign * 0x56 >> 8, sign_v = sign - sign_u * 3;
 1088|   138k|                assert(sign_u == sign / 3);
  ------------------
  |  |  140|   138k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 138k]
  |  |  |  Branch (140:68): [Folded, False: 138k]
  |  |  ------------------
  ------------------
 1089|   138k|                if (sign_u) {
  ------------------
  |  Branch (1089:21): [True: 128k, False: 9.87k]
  ------------------
 1090|   128k|                    const int ctx = (sign_u == 2) * 3 + sign_v;
 1091|   128k|                    b->cfl_alpha[0] = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   128k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1092|   128k|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1093|   128k|                    if (sign_u == 1) b->cfl_alpha[0] = -b->cfl_alpha[0];
  ------------------
  |  Branch (1093:25): [True: 69.2k, False: 59.6k]
  ------------------
 1094|   128k|                } else {
 1095|  9.87k|                    b->cfl_alpha[0] = 0;
 1096|  9.87k|                }
 1097|   138k|                if (sign_v) {
  ------------------
  |  Branch (1097:21): [True: 123k, False: 15.7k]
  ------------------
 1098|   123k|                    const int ctx = (sign_v == 2) * 3 + sign_u;
 1099|   123k|                    b->cfl_alpha[1] = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   123k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1100|   123k|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1101|   123k|                    if (sign_v == 1) b->cfl_alpha[1] = -b->cfl_alpha[1];
  ------------------
  |  Branch (1101:25): [True: 62.7k, False: 60.3k]
  ------------------
 1102|   123k|                } else {
 1103|  15.7k|                    b->cfl_alpha[1] = 0;
 1104|  15.7k|                }
 1105|   138k|#undef SIGN
 1106|   138k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   138k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 138k]
  |  |  ------------------
  |  |   35|   138k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   138k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1107|      0|                    printf("Post-uvalphas[%d/%d]: r=%d\n",
 1108|      0|                           b->cfl_alpha[0], b->cfl_alpha[1], ts->msac.rng);
 1109|   255k|            } else if (b_dim[2] + b_dim[3] >= 2 && b->uv_mode >= VERT_PRED &&
  ------------------
  |  Branch (1109:24): [True: 244k, False: 10.4k]
  |  Branch (1109:52): [True: 112k, False: 132k]
  ------------------
 1110|   112k|                       b->uv_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1110:24): [True: 27.6k, False: 84.7k]
  ------------------
 1111|  27.6k|            {
 1112|  27.6k|                uint16_t *const acdf = ts->cdf.m.angle_delta[b->uv_mode - VERT_PRED];
 1113|  27.6k|                const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|  27.6k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1114|  27.6k|                b->uv_angle = angle - 3;
 1115|  27.6k|            }
 1116|   394k|        }
 1117|       |
 1118|   932k|        b->pal_sz[0] = b->pal_sz[1] = 0;
 1119|   932k|        if (f->frame_hdr->allow_screen_content_tools &&
  ------------------
  |  Branch (1119:13): [True: 70.1k, False: 862k]
  ------------------
 1120|  70.1k|            imax(bw4, bh4) <= 16 && bw4 + bh4 >= 4)
  ------------------
  |  Branch (1120:13): [True: 70.1k, False: 37]
  |  Branch (1120:37): [True: 38.4k, False: 31.6k]
  ------------------
 1121|  38.4k|        {
 1122|  38.4k|            const int sz_ctx = b_dim[2] + b_dim[3] - 2;
 1123|  38.4k|            if (b->y_mode == DC_PRED) {
  ------------------
  |  Branch (1123:17): [True: 36.8k, False: 1.57k]
  ------------------
 1124|  36.8k|                const int pal_ctx = (t->a->pal_sz[bx4] > 0) + (t->l.pal_sz[by4] > 0);
 1125|  36.8k|                const int use_y_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  36.8k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1126|  36.8k|                                          ts->cdf.m.pal_y[sz_ctx][pal_ctx]);
 1127|  36.8k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  36.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 36.8k]
  |  |  ------------------
  |  |   35|  36.8k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  36.8k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1128|      0|                    printf("Post-y_pal[%d]: r=%d\n", use_y_pal, ts->msac.rng);
 1129|  36.8k|                if (use_y_pal)
  ------------------
  |  Branch (1129:21): [True: 26.1k, False: 10.6k]
  ------------------
 1130|  26.1k|                    f->bd_fn.read_pal_plane(t, b, 0, sz_ctx, bx4, by4);
 1131|  36.8k|            }
 1132|       |
 1133|  38.4k|            if (has_chroma && b->uv_mode == DC_PRED) {
  ------------------
  |  Branch (1133:17): [True: 28.5k, False: 9.90k]
  |  Branch (1133:31): [True: 20.4k, False: 8.06k]
  ------------------
 1134|  20.4k|                const int pal_ctx = b->pal_sz[0] > 0;
 1135|  20.4k|                const int use_uv_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  20.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1136|  20.4k|                                           ts->cdf.m.pal_uv[pal_ctx]);
 1137|  20.4k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  20.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 20.4k]
  |  |  ------------------
  |  |   35|  20.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  20.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1138|      0|                    printf("Post-uv_pal[%d]: r=%d\n", use_uv_pal, ts->msac.rng);
 1139|  20.4k|                if (use_uv_pal) // see aomedia bug 2183 for why we use luma coordinates
  ------------------
  |  Branch (1139:21): [True: 15.4k, False: 4.98k]
  ------------------
 1140|  15.4k|                    f->bd_fn.read_pal_uv(t, b, sz_ctx, bx4, by4);
 1141|  20.4k|            }
 1142|  38.4k|        }
 1143|       |
 1144|   932k|        if (b->y_mode == DC_PRED && !b->pal_sz[0] &&
  ------------------
  |  Branch (1144:13): [True: 840k, False: 91.3k]
  |  Branch (1144:37): [True: 814k, False: 26.0k]
  ------------------
 1145|   814k|            imax(b_dim[2], b_dim[3]) <= 3 && f->seq_hdr->filter_intra)
  ------------------
  |  Branch (1145:13): [True: 813k, False: 1.28k]
  |  Branch (1145:46): [True: 813k, False: 18.4E]
  ------------------
 1146|   813k|        {
 1147|   813k|            const int is_filter = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   813k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1148|   813k|                                      ts->cdf.m.use_filter_intra[bs]);
 1149|   813k|            if (is_filter) {
  ------------------
  |  Branch (1149:17): [True: 374k, False: 439k]
  ------------------
 1150|   374k|                b->y_mode = FILTER_PRED;
 1151|   374k|                b->y_angle = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   374k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1152|   374k|                                 ts->cdf.m.filter_intra, 4);
 1153|   374k|            }
 1154|   813k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   813k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 813k]
  |  |  ------------------
  |  |   35|   813k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   813k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1155|      0|                printf("Post-filterintramode[%d/%d]: r=%d\n",
 1156|      0|                       b->y_mode, b->y_angle, ts->msac.rng);
 1157|   813k|        }
 1158|       |
 1159|   932k|        if (b->pal_sz[0]) {
  ------------------
  |  Branch (1159:13): [True: 26.2k, False: 906k]
  ------------------
 1160|  26.2k|            uint8_t *pal_idx;
 1161|  26.2k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1161:17): [True: 0, False: 26.2k]
  ------------------
 1162|      0|                const int p = t->frame_thread.pass & 1;
 1163|      0|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1164|      0|                pal_idx = ts->frame_thread[p].pal_idx;
 1165|      0|                ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1166|      0|            } else
 1167|  26.2k|                pal_idx = t->scratch.pal_idx_y;
 1168|  26.2k|            read_pal_indices(t, pal_idx, b->pal_sz[0], 0, w4, h4, bw4, bh4);
 1169|  26.2k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  26.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 26.2k]
  |  |  ------------------
  |  |   35|  26.2k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  26.2k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1170|      0|                printf("Post-y-pal-indices: r=%d\n", ts->msac.rng);
 1171|  26.2k|        }
 1172|       |
 1173|   932k|        if (has_chroma && b->pal_sz[1]) {
  ------------------
  |  Branch (1173:13): [True: 394k, False: 538k]
  |  Branch (1173:27): [True: 15.4k, False: 378k]
  ------------------
 1174|  15.4k|            uint8_t *pal_idx;
 1175|  15.4k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1175:17): [True: 0, False: 15.4k]
  ------------------
 1176|      0|                const int p = t->frame_thread.pass & 1;
 1177|      0|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1178|      0|                pal_idx = ts->frame_thread[p].pal_idx;
 1179|      0|                ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1180|      0|            } else
 1181|  15.4k|                pal_idx = t->scratch.pal_idx_uv;
 1182|  15.4k|            read_pal_indices(t, pal_idx, b->pal_sz[1], 1, cw4, ch4, cbw4, cbh4);
 1183|  15.4k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  15.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.4k]
  |  |  ------------------
  |  |   35|  15.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  15.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1184|      0|                printf("Post-uv-pal-indices: r=%d\n", ts->msac.rng);
 1185|  15.4k|        }
 1186|       |
 1187|   932k|        const TxfmInfo *t_dim;
 1188|   932k|        if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1188:13): [True: 21.6k, False: 910k]
  ------------------
 1189|  21.6k|            b->tx = b->uvtx = (int) TX_4X4;
 1190|  21.6k|            t_dim = &dav1d_txfm_dimensions[TX_4X4];
 1191|   910k|        } else {
 1192|   910k|            b->tx = dav1d_max_txfm_size_for_bs[bs][0];
 1193|   910k|            b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
 1194|   910k|            t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   910k|            if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE && t_dim->max > TX_4X4) {
  ------------------
  |  Branch (1195:17): [True: 822k, False: 88.2k]
  |  Branch (1195:67): [True: 804k, False: 18.0k]
  ------------------
 1196|   804k|                const int tctx = get_tx_ctx(t->a, &t->l, t_dim, by4, bx4);
 1197|   804k|                uint16_t *const tx_cdf = ts->cdf.m.txsz[t_dim->max - 1][tctx];
 1198|   804k|                int depth = dav1d_msac_decode_symbol_adapt4(&ts->msac, tx_cdf,
  ------------------
  |  |   47|   804k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1199|   804k|                                imin(t_dim->max, 2));
 1200|       |
 1201|  1.02M|                while (depth--) {
  ------------------
  |  Branch (1201:24): [True: 218k, False: 804k]
  ------------------
 1202|   218k|                    b->tx = t_dim->sub;
 1203|   218k|                    t_dim = &dav1d_txfm_dimensions[b->tx];
 1204|   218k|                }
 1205|   804k|            }
 1206|   910k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   910k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 910k]
  |  |  ------------------
  |  |   35|   910k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   910k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1207|      0|                printf("Post-tx[%d]: r=%d\n", b->tx, ts->msac.rng);
 1208|   910k|        }
 1209|       |
 1210|       |        // reconstruction
 1211|   932k|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1211:13): [True: 0, False: 932k]
  ------------------
 1212|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1213|   932k|        } else {
 1214|   932k|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
 1215|   932k|        }
 1216|       |
 1217|   932k|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1217:13): [True: 212k, False: 720k]
  ------------------
 1218|   720k|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1218:13): [True: 18.4E, False: 720k]
  ------------------
 1219|   207k|        {
 1220|   207k|            dav1d_create_lf_mask_intra(t->lf_mask, f->lf.level, f->b4_stride,
 1221|   207k|                                       (const uint8_t (*)[8][2])
 1222|   207k|                                       &ts->lflvl[b->seg_id][0][0][0],
 1223|   207k|                                       t->bx, t->by, f->w4, f->h4, bs,
 1224|   207k|                                       b->tx, b->uvtx, f->cur.p.layout,
 1225|   207k|                                       &t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
 1226|   207k|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1226:40): [True: 80.3k, False: 126k]
  ------------------
 1227|   207k|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1227:40): [True: 80.3k, False: 126k]
  ------------------
 1228|   207k|        }
 1229|       |        // update contexts
 1230|   932k|        const enum IntraPredMode y_mode_nofilt =
 1231|   932k|            b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (1231:13): [True: 373k, False: 559k]
  ------------------
 1232|   932k|        BlockContext *edge = t->a;
 1233|  2.78M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1233:36): [True: 1.85M, False: 934k]
  ------------------
 1234|  1.85M|            int t_lsz = ((uint8_t *) &t_dim->lw)[i]; // lw then lh
 1235|  1.85M|#define set_ctx(rep_macro) \
 1236|  1.85M|            rep_macro(edge->tx_intra, off, t_lsz); \
 1237|  1.85M|            rep_macro(edge->tx, off, t_lsz); \
 1238|  1.85M|            rep_macro(edge->mode, off, y_mode_nofilt); \
 1239|  1.85M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
 1240|  1.85M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1241|  1.85M|            rep_macro(edge->skip_mode, off, 0); \
 1242|  1.85M|            rep_macro(edge->intra, off, 1); \
 1243|  1.85M|            rep_macro(edge->skip, off, b->skip); \
 1244|       |            /* see aomedia bug 2183 for why we use luma coordinates here */ \
 1245|  1.85M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
 1246|  1.85M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
 1247|  1.85M|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
 1248|  1.85M|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
 1249|  1.85M|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
 1250|  1.85M|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1251|  1.85M|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1252|  1.85M|            }
 1253|  1.85M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  1.85M|    switch (var) { \
  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1236|  53.4k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|  53.4k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  53.4k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|  53.4k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|  53.4k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|  53.4k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|  53.4k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|  53.4k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  53.4k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|  53.4k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|  53.4k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  53.4k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   106k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (56:43): [True: 30.8k, False: 22.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|  53.4k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  53.4k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 45.0k, False: 8.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|  45.0k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  45.0k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  45.0k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|  45.0k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  45.0k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  45.0k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|  45.0k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  45.0k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  45.0k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|  45.0k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  45.0k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  45.0k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|  45.0k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  45.0k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  45.0k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|  45.0k|            }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 53.4k, False: 1.79M]
  |  |  ------------------
  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1236|  1.66M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|  1.66M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  1.66M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|  1.66M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|  1.66M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|  1.66M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|  1.66M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|  1.66M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.66M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|  1.66M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|  1.66M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.66M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  3.32M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (58:45): [True: 698k, False: 962k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|  1.66M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.66M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 1.50M, False: 160k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|  1.50M|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.50M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|  1.50M|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.50M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|  1.50M|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.50M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|  1.50M|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.50M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|  1.50M|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.50M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|  1.50M|            }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 1.66M, False: 190k]
  |  |  ------------------
  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1236|   121k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|   121k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|   121k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|   121k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|   121k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|   121k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|   121k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|   121k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   121k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|   121k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|   121k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   121k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   242k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:45): [True: 47.7k, False: 73.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|   121k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   121k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 95.1k, False: 26.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|  95.1k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  95.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  95.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|  95.1k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  95.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  95.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|  95.1k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  95.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  95.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|  95.1k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  95.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  95.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|  95.1k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  95.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  95.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|  95.1k|            }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 121k, False: 1.73M]
  |  |  ------------------
  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1236|  16.1k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|  16.1k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  16.1k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|  16.1k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|  16.1k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|  16.1k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|  16.1k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|  16.1k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  16.1k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|  16.1k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|  16.1k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  16.1k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  32.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (62:45): [True: 5.41k, False: 10.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|  16.1k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  16.1k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 9.58k, False: 6.60k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|  9.58k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  9.58k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  9.58k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|  9.58k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  9.58k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  9.58k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|  9.58k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  9.58k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  9.58k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|  9.58k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  9.58k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  9.58k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|  9.58k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  9.58k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  9.58k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|  9.58k|            }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 16.1k, False: 1.83M]
  |  |  ------------------
  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1236|  1.18k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|  1.18k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  1.18k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|  1.18k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|  1.18k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|  1.18k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|  1.18k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|  1.18k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.18k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|  1.18k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|  1.18k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.18k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.18k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.37k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:29): [True: 265, False: 924]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   65|  1.18k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|  1.18k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.18k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 452, False: 737]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|    452|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    452|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    452|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|    452|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|    452|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|    452|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    452|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    452|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|    452|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|    452|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|    452|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    452|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    452|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|    452|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|    452|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|    452|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    452|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    452|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|    452|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|    452|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|    452|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    452|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|    452|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|    452|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|    452|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|    452|            }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 1.18k, False: 1.85M]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1236|      0|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1237|      0|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1239|      0|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1240|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1241|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1242|      0|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1243|      0|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1244|      0|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1245|      0|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (67:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1251|      0|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1252|      0|            }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 1.85M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 1.85M]
  |  |  ------------------
  |  |   78|  1.85M|    }
  ------------------
 1254|  1.85M|#undef set_ctx
 1255|  1.85M|        }
 1256|   934k|        if (b->pal_sz[0])
  ------------------
  |  Branch (1256:13): [True: 26.1k, False: 908k]
  ------------------
 1257|  26.1k|            f->bd_fn.copy_pal_block_y(t, bx4, by4, bw4, bh4);
 1258|   934k|        if (has_chroma) {
  ------------------
  |  Branch (1258:13): [True: 393k, False: 541k]
  ------------------
 1259|   393k|            uint8_t uv_mode = b->uv_mode;
 1260|   393k|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
 1261|   393k|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
 1262|   393k|            if (b->pal_sz[1])
  ------------------
  |  Branch (1262:17): [True: 15.4k, False: 377k]
  ------------------
 1263|  15.4k|                f->bd_fn.copy_pal_block_uv(t, bx4, by4, bw4, bh4);
 1264|   393k|        }
 1265|   934k|        if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc)
  ------------------
  |  |   36|  1.86M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 832k, False: 101k]
  |  |  ------------------
  ------------------
  |  Branch (1265:49): [True: 18.4E, False: 101k]
  ------------------
 1266|   826k|            splat_intraref(f->c, t, bs, bw4, bh4);
 1267|   934k|    } else if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|   318k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   318k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 0, False: 318k]
  |  |  ------------------
  ------------------
 1268|       |        // intra block copy
 1269|      0|        refmvs_candidate mvstack[8];
 1270|      0|        int n_mvs, ctx;
 1271|      0|        dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1272|      0|                          (union refmvs_refpair) { .ref = { 0, -1 }},
 1273|      0|                          bs, intra_edge_flags, t->by, t->bx);
 1274|       |
 1275|      0|        if (mvstack[0].mv.mv[0].n)
  ------------------
  |  Branch (1275:13): [True: 0, False: 0]
  ------------------
 1276|      0|            b->mv[0] = mvstack[0].mv.mv[0];
 1277|      0|        else if (mvstack[1].mv.mv[0].n)
  ------------------
  |  Branch (1277:18): [True: 0, False: 0]
  ------------------
 1278|      0|            b->mv[0] = mvstack[1].mv.mv[0];
 1279|      0|        else {
 1280|      0|            if (t->by - (16 << f->seq_hdr->sb128) < ts->tiling.row_start) {
  ------------------
  |  Branch (1280:17): [True: 0, False: 0]
  ------------------
 1281|      0|                b->mv[0].y = 0;
 1282|      0|                b->mv[0].x = -(512 << f->seq_hdr->sb128) - 2048;
 1283|      0|            } else {
 1284|      0|                b->mv[0].y = -(512 << f->seq_hdr->sb128);
 1285|      0|                b->mv[0].x = 0;
 1286|      0|            }
 1287|      0|        }
 1288|       |
 1289|      0|        const union mv ref = b->mv[0];
 1290|      0|        read_mv_residual(ts, &b->mv[0], -1);
 1291|       |
 1292|       |        // clip intrabc motion vector to decoded parts of current tile
 1293|      0|        int border_left = ts->tiling.col_start * 4;
 1294|      0|        int border_top  = ts->tiling.row_start * 4;
 1295|      0|        if (has_chroma) {
  ------------------
  |  Branch (1295:13): [True: 0, False: 0]
  ------------------
 1296|      0|            if (bw4 < 2 &&  ss_hor)
  ------------------
  |  Branch (1296:17): [True: 0, False: 0]
  |  Branch (1296:29): [True: 0, False: 0]
  ------------------
 1297|      0|                border_left += 4;
 1298|      0|            if (bh4 < 2 &&  ss_ver)
  ------------------
  |  Branch (1298:17): [True: 0, False: 0]
  |  Branch (1298:29): [True: 0, False: 0]
  ------------------
 1299|      0|                border_top  += 4;
 1300|      0|        }
 1301|      0|        int src_left   = t->bx * 4 + (b->mv[0].x >> 3);
 1302|      0|        int src_top    = t->by * 4 + (b->mv[0].y >> 3);
 1303|      0|        int src_right  = src_left + bw4 * 4;
 1304|      0|        int src_bottom = src_top  + bh4 * 4;
 1305|      0|        const int border_right = ((ts->tiling.col_end + (bw4 - 1)) & ~(bw4 - 1)) * 4;
 1306|       |
 1307|       |        // check against left or right tile boundary and adjust if necessary
 1308|      0|        if (src_left < border_left) {
  ------------------
  |  Branch (1308:13): [True: 0, False: 0]
  ------------------
 1309|      0|            src_right += border_left - src_left;
 1310|      0|            src_left  += border_left - src_left;
 1311|      0|        } else if (src_right > border_right) {
  ------------------
  |  Branch (1311:20): [True: 0, False: 0]
  ------------------
 1312|      0|            src_left  -= src_right - border_right;
 1313|      0|            src_right -= src_right - border_right;
 1314|      0|        }
 1315|       |        // check against top tile boundary and adjust if necessary
 1316|      0|        if (src_top < border_top) {
  ------------------
  |  Branch (1316:13): [True: 0, False: 0]
  ------------------
 1317|      0|            src_bottom += border_top - src_top;
 1318|      0|            src_top    += border_top - src_top;
 1319|      0|        }
 1320|       |
 1321|      0|        const int sbx = (t->bx >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1322|      0|        const int sby = (t->by >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1323|      0|        const int sb_size = 1 << (6 + f->seq_hdr->sb128);
 1324|       |        // check for overlap with current superblock
 1325|      0|        if (src_bottom > sby && src_right > sbx) {
  ------------------
  |  Branch (1325:13): [True: 0, False: 0]
  |  Branch (1325:33): [True: 0, False: 0]
  ------------------
 1326|      0|            if (src_top - border_top >= src_bottom - sby) {
  ------------------
  |  Branch (1326:17): [True: 0, False: 0]
  ------------------
 1327|       |                // if possible move src up into the previous suberblock row
 1328|      0|                src_top    -= src_bottom - sby;
 1329|      0|                src_bottom -= src_bottom - sby;
 1330|      0|            } else if (src_left - border_left >= src_right - sbx) {
  ------------------
  |  Branch (1330:24): [True: 0, False: 0]
  ------------------
 1331|       |                // if possible move src left into the previous suberblock
 1332|      0|                src_left  -= src_right - sbx;
 1333|      0|                src_right -= src_right - sbx;
 1334|      0|            }
 1335|      0|        }
 1336|       |        // move src up if it is below current superblock row
 1337|      0|        if (src_bottom > sby + sb_size) {
  ------------------
  |  Branch (1337:13): [True: 0, False: 0]
  ------------------
 1338|      0|            src_top    -= src_bottom - (sby + sb_size);
 1339|      0|            src_bottom -= src_bottom - (sby + sb_size);
 1340|      0|        }
 1341|       |        // error out if mv still overlaps with the current superblock
 1342|      0|        if (src_bottom > sby && src_right > sbx)
  ------------------
  |  Branch (1342:13): [True: 0, False: 0]
  |  Branch (1342:33): [True: 0, False: 0]
  ------------------
 1343|      0|            return -1;
 1344|       |
 1345|      0|        b->mv[0].x = (src_left - t->bx * 4) * 8;
 1346|      0|        b->mv[0].y = (src_top  - t->by * 4) * 8;
 1347|       |
 1348|      0|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1349|      0|            printf("Post-dmv[%d/%d,ref=%d/%d|%d/%d]: r=%d\n",
 1350|      0|                   b->mv[0].y, b->mv[0].x, ref.y, ref.x,
 1351|      0|                   mvstack[0].mv.mv[0].y, mvstack[0].mv.mv[0].x, ts->msac.rng);
 1352|      0|        read_vartx_tree(t, b, bs, bx4, by4);
 1353|       |
 1354|       |        // reconstruction
 1355|      0|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1355:13): [True: 0, False: 0]
  ------------------
 1356|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1357|      0|            b->filter2d = FILTER_2D_BILINEAR;
 1358|      0|        } else {
 1359|      0|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1359:17): [True: 0, False: 0]
  ------------------
 1360|      0|        }
 1361|       |
 1362|      0|        splat_intrabc_mv(f->c, t, bs, b, bw4, bh4);
 1363|      0|        BlockContext *edge = t->a;
 1364|      0|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1364:36): [True: 0, False: 0]
  ------------------
 1365|      0|#define set_ctx(rep_macro) \
 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
 1369|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
 1373|      0|            rep_macro(edge->intra, off, 0); \
 1374|      0|            rep_macro(edge->skip, off, b->skip)
 1375|      0|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1366|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1368|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1370|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1373|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1374|      0|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
 1376|      0|#undef set_ctx
 1377|      0|        }
 1378|      0|        if (has_chroma) {
  ------------------
  |  Branch (1378:13): [True: 0, False: 0]
  ------------------
 1379|      0|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1380|      0|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1381|      0|        }
 1382|   318k|    } else {
 1383|       |        // inter-specific mode/mv coding
 1384|   318k|        int is_comp, has_subpel_filter;
 1385|       |
 1386|   318k|        if (b->skip_mode) {
  ------------------
  |  Branch (1386:13): [True: 0, False: 318k]
  ------------------
 1387|      0|            is_comp = 1;
 1388|   318k|        } else if ((!seg || (seg->ref == -1 && !seg->globalmv && !seg->skip)) &&
  ------------------
  |  Branch (1388:21): [True: 318k, False: 0]
  |  Branch (1388:30): [True: 0, False: 0]
  |  Branch (1388:48): [True: 0, False: 0]
  |  Branch (1388:66): [True: 0, False: 0]
  ------------------
 1389|   318k|                   f->frame_hdr->switchable_comp_refs && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (1389:20): [True: 0, False: 318k]
  |  Branch (1389:58): [True: 0, False: 0]
  ------------------
 1390|      0|        {
 1391|      0|            const int ctx = get_comp_ctx(t->a, &t->l, by4, bx4,
 1392|      0|                                         have_top, have_left);
 1393|      0|            is_comp = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1394|      0|                          ts->cdf.m.comp[ctx]);
 1395|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1396|      0|                printf("Post-compflag[%d]: r=%d\n", is_comp, ts->msac.rng);
 1397|   318k|        } else {
 1398|   318k|            is_comp = 0;
 1399|   318k|        }
 1400|       |
 1401|   318k|        if (b->skip_mode) {
  ------------------
  |  Branch (1401:13): [True: 0, False: 318k]
  ------------------
 1402|      0|            b->ref[0] = f->frame_hdr->skip_mode_refs[0];
 1403|      0|            b->ref[1] = f->frame_hdr->skip_mode_refs[1];
 1404|      0|            b->comp_type = COMP_INTER_AVG;
 1405|      0|            b->inter_mode = NEARESTMV_NEARESTMV;
 1406|      0|            b->drl_idx = NEAREST_DRL;
 1407|      0|            has_subpel_filter = 0;
 1408|       |
 1409|      0|            refmvs_candidate mvstack[8];
 1410|      0|            int n_mvs, ctx;
 1411|      0|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1412|      0|                              (union refmvs_refpair) { .ref = {
 1413|      0|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1414|      0|                              bs, intra_edge_flags, t->by, t->bx);
 1415|       |
 1416|      0|            b->mv[0] = mvstack[0].mv.mv[0];
 1417|      0|            b->mv[1] = mvstack[0].mv.mv[1];
 1418|      0|            fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1419|      0|            fix_mv_precision(f->frame_hdr, &b->mv[1]);
 1420|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1421|      0|                printf("Post-skipmodeblock[mv=1:y=%d,x=%d,2:y=%d,x=%d,refs=%d+%d\n",
 1422|      0|                       b->mv[0].y, b->mv[0].x, b->mv[1].y, b->mv[1].x,
 1423|      0|                       b->ref[0], b->ref[1]);
 1424|   318k|        } else if (is_comp) {
  ------------------
  |  Branch (1424:20): [True: 0, False: 318k]
  ------------------
 1425|      0|            const int dir_ctx = get_comp_dir_ctx(t->a, &t->l, by4, bx4,
 1426|      0|                                                 have_top, have_left);
 1427|      0|            if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1427:17): [True: 0, False: 0]
  ------------------
 1428|      0|                    ts->cdf.m.comp_dir[dir_ctx]))
 1429|      0|            {
 1430|       |                // bidir - first reference (fw)
 1431|      0|                const int ctx1 = av1_get_fwd_ref_ctx(t->a, &t->l, by4, bx4,
 1432|      0|                                                     have_top, have_left);
 1433|      0|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1433:21): [True: 0, False: 0]
  ------------------
 1434|      0|                        ts->cdf.m.comp_fwd_ref[0][ctx1]))
 1435|      0|                {
 1436|      0|                    const int ctx2 = av1_get_fwd_ref_2_ctx(t->a, &t->l, by4, bx4,
 1437|      0|                                                           have_top, have_left);
 1438|      0|                    b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1439|      0|                                        ts->cdf.m.comp_fwd_ref[2][ctx2]);
 1440|      0|                } else {
 1441|      0|                    const int ctx2 = av1_get_fwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1442|      0|                                                           have_top, have_left);
 1443|      0|                    b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1444|      0|                                    ts->cdf.m.comp_fwd_ref[1][ctx2]);
 1445|      0|                }
 1446|       |
 1447|       |                // second reference (bw)
 1448|      0|                const int ctx3 = av1_get_bwd_ref_ctx(t->a, &t->l, by4, bx4,
 1449|      0|                                                     have_top, have_left);
 1450|      0|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1450:21): [True: 0, False: 0]
  ------------------
 1451|      0|                        ts->cdf.m.comp_bwd_ref[0][ctx3]))
 1452|      0|                {
 1453|      0|                    b->ref[1] = 6;
 1454|      0|                } else {
 1455|      0|                    const int ctx4 = av1_get_bwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1456|      0|                                                           have_top, have_left);
 1457|      0|                    b->ref[1] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1458|      0|                                        ts->cdf.m.comp_bwd_ref[1][ctx4]);
 1459|      0|                }
 1460|      0|            } else {
 1461|       |                // unidir
 1462|      0|                const int uctx_p = av1_get_uni_p_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  280|      0|#define av1_get_uni_p_ctx av1_get_ref_ctx
  ------------------
 1463|      0|                                                     have_top, have_left);
 1464|      0|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1464:21): [True: 0, False: 0]
  ------------------
 1465|      0|                        ts->cdf.m.comp_uni_ref[0][uctx_p]))
 1466|      0|                {
 1467|      0|                    b->ref[0] = 4;
 1468|      0|                    b->ref[1] = 6;
 1469|      0|                } else {
 1470|      0|                    const int uctx_p1 = av1_get_uni_p1_ctx(t->a, &t->l, by4, bx4,
 1471|      0|                                                           have_top, have_left);
 1472|      0|                    b->ref[0] = 0;
 1473|      0|                    b->ref[1] = 1 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1474|      0|                                        ts->cdf.m.comp_uni_ref[1][uctx_p1]);
 1475|      0|                    if (b->ref[1] == 2) {
  ------------------
  |  Branch (1475:25): [True: 0, False: 0]
  ------------------
 1476|      0|                        const int uctx_p2 = av1_get_uni_p2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  281|      0|#define av1_get_uni_p2_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1477|      0|                                                               have_top, have_left);
 1478|      0|                        b->ref[1] += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1479|      0|                                         ts->cdf.m.comp_uni_ref[2][uctx_p2]);
 1480|      0|                    }
 1481|      0|                }
 1482|      0|            }
 1483|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1484|      0|                printf("Post-refs[%d/%d]: r=%d\n",
 1485|      0|                       b->ref[0], b->ref[1], ts->msac.rng);
 1486|       |
 1487|      0|            refmvs_candidate mvstack[8];
 1488|      0|            int n_mvs, ctx;
 1489|      0|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1490|      0|                              (union refmvs_refpair) { .ref = {
 1491|      0|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1492|      0|                              bs, intra_edge_flags, t->by, t->bx);
 1493|       |
 1494|      0|            b->inter_mode = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|      0|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1495|      0|                                ts->cdf.m.comp_inter_mode[ctx],
 1496|      0|                                N_COMP_INTER_PRED_MODES - 1);
 1497|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1498|      0|                printf("Post-compintermode[%d,ctx=%d,n_mvs=%d]: r=%d\n",
 1499|      0|                       b->inter_mode, ctx, n_mvs, ts->msac.rng);
 1500|       |
 1501|      0|            const uint8_t *const im = dav1d_comp_inter_pred_modes[b->inter_mode];
 1502|      0|            b->drl_idx = NEAREST_DRL;
 1503|      0|            if (b->inter_mode == NEWMV_NEWMV) {
  ------------------
  |  Branch (1503:17): [True: 0, False: 0]
  ------------------
 1504|      0|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1504:21): [True: 0, False: 0]
  ------------------
 1505|      0|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1506|      0|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1507|      0|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1508|      0|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) {
  ------------------
  |  Branch (1508:25): [True: 0, False: 0]
  |  Branch (1508:53): [True: 0, False: 0]
  ------------------
 1509|      0|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1510|      0|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1511|      0|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1512|      0|                    }
 1513|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1514|      0|                        printf("Post-drlidx[%d,n_mvs=%d]: r=%d\n",
 1515|      0|                               b->drl_idx, n_mvs, ts->msac.rng);
 1516|      0|                }
 1517|      0|            } else if (im[0] == NEARMV || im[1] == NEARMV) {
  ------------------
  |  Branch (1517:24): [True: 0, False: 0]
  |  Branch (1517:43): [True: 0, False: 0]
  ------------------
 1518|      0|                b->drl_idx = NEARER_DRL;
 1519|      0|                if (n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1519:21): [True: 0, False: 0]
  ------------------
 1520|      0|                    const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1521|      0|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1522|      0|                                      ts->cdf.m.drl_bit[drl_ctx_v2]);
 1523|      0|                    if (b->drl_idx == NEAR_DRL && n_mvs > 3) {
  ------------------
  |  Branch (1523:25): [True: 0, False: 0]
  |  Branch (1523:51): [True: 0, False: 0]
  ------------------
 1524|      0|                        const int drl_ctx_v3 = get_drl_context(mvstack, 2);
 1525|      0|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1526|      0|                                          ts->cdf.m.drl_bit[drl_ctx_v3]);
 1527|      0|                    }
 1528|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1529|      0|                        printf("Post-drlidx[%d,n_mvs=%d]: r=%d\n",
 1530|      0|                               b->drl_idx, n_mvs, ts->msac.rng);
 1531|      0|                }
 1532|      0|            }
 1533|      0|            assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1534|       |
 1535|      0|#define assign_comp_mv(idx) \
 1536|      0|            switch (im[idx]) { \
 1537|      0|            case NEARMV: \
 1538|      0|            case NEARESTMV: \
 1539|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1540|      0|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
 1541|      0|                break; \
 1542|      0|            case GLOBALMV: \
 1543|      0|                has_subpel_filter |= \
 1544|      0|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
 1545|      0|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
 1546|      0|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
 1547|      0|                break; \
 1548|      0|            case NEWMV: \
 1549|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1550|      0|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
 1551|      0|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
 1552|      0|                break; \
 1553|      0|            }
 1554|      0|            has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1554:33): [True: 0, False: 0]
  ------------------
 1555|      0|                                b->inter_mode != GLOBALMV_GLOBALMV;
  ------------------
  |  Branch (1555:33): [True: 0, False: 0]
  ------------------
 1556|      0|            assign_comp_mv(0);
  ------------------
  |  | 1536|      0|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1536:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 1537|      0|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1537:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1538|      0|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1538:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1539|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1540|      0|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1541|      0|                break; \
  |  | 1542|      0|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1542:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1543|      0|                has_subpel_filter |= \
  |  | 1544|      0|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1545|      0|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1546|      0|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1547|      0|                break; \
  |  | 1548|      0|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1548:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1549|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1550|      0|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1551|      0|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1552|      0|                break; \
  |  | 1553|      0|            }
  ------------------
 1557|      0|            assign_comp_mv(1);
  ------------------
  |  | 1536|      0|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1536:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 1537|      0|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1537:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1538|      0|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1538:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1539|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1540|      0|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1541|      0|                break; \
  |  | 1542|      0|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1542:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1543|      0|                has_subpel_filter |= \
  |  | 1544|      0|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1545|      0|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1546|      0|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1547|      0|                break; \
  |  | 1548|      0|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1548:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1549|      0|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1550|      0|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1551|      0|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1552|      0|                break; \
  |  | 1553|      0|            }
  ------------------
 1558|      0|#undef assign_comp_mv
 1559|      0|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1560|      0|                printf("Post-residual_mv[1:y=%d,x=%d,2:y=%d,x=%d]: r=%d\n",
 1561|      0|                       b->mv[0].y, b->mv[0].x, b->mv[1].y, b->mv[1].x,
 1562|      0|                       ts->msac.rng);
 1563|       |
 1564|       |            // jnt_comp vs. seg vs. wedge
 1565|      0|            int is_segwedge = 0;
 1566|      0|            if (f->seq_hdr->masked_compound) {
  ------------------
  |  Branch (1566:17): [True: 0, False: 0]
  ------------------
 1567|      0|                const int mask_ctx = get_mask_comp_ctx(t->a, &t->l, by4, bx4);
 1568|       |
 1569|      0|                is_segwedge = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1570|      0|                                  ts->cdf.m.mask_comp[mask_ctx]);
 1571|      0|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1572|      0|                    printf("Post-segwedge_vs_jntavg[%d,ctx=%d]: r=%d\n",
 1573|      0|                           is_segwedge, mask_ctx, ts->msac.rng);
 1574|      0|            }
 1575|       |
 1576|      0|            if (!is_segwedge) {
  ------------------
  |  Branch (1576:17): [True: 0, False: 0]
  ------------------
 1577|      0|                if (f->seq_hdr->jnt_comp) {
  ------------------
  |  Branch (1577:21): [True: 0, False: 0]
  ------------------
 1578|      0|                    const int jnt_ctx =
 1579|      0|                        get_jnt_comp_ctx(f->seq_hdr->order_hint_n_bits,
 1580|      0|                                         f->cur.frame_hdr->frame_offset,
 1581|      0|                                         f->refp[b->ref[0]].p.frame_hdr->frame_offset,
 1582|      0|                                         f->refp[b->ref[1]].p.frame_hdr->frame_offset,
 1583|      0|                                         t->a, &t->l, by4, bx4);
 1584|      0|                    b->comp_type = COMP_INTER_WEIGHTED_AVG +
 1585|      0|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1586|      0|                                       ts->cdf.m.jnt_comp[jnt_ctx]);
 1587|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1588|      0|                        printf("Post-jnt_comp[%d,ctx=%d[ac:%d,ar:%d,lc:%d,lr:%d]]: r=%d\n",
 1589|      0|                               b->comp_type == COMP_INTER_AVG,
 1590|      0|                               jnt_ctx, t->a->comp_type[bx4], t->a->ref[0][bx4],
 1591|      0|                               t->l.comp_type[by4], t->l.ref[0][by4],
 1592|      0|                               ts->msac.rng);
 1593|      0|                } else {
 1594|      0|                    b->comp_type = COMP_INTER_AVG;
 1595|      0|                }
 1596|      0|            } else {
 1597|      0|                if (wedge_allowed_mask & (1 << bs)) {
  ------------------
  |  Branch (1597:21): [True: 0, False: 0]
  ------------------
 1598|      0|                    const int ctx = dav1d_wedge_ctx_lut[bs];
 1599|      0|                    b->comp_type = COMP_INTER_WEDGE -
 1600|      0|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1601|      0|                                       ts->cdf.m.wedge_comp[ctx]);
 1602|      0|                    if (b->comp_type == COMP_INTER_WEDGE)
  ------------------
  |  Branch (1602:25): [True: 0, False: 0]
  ------------------
 1603|      0|                        b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|      0|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1604|      0|                                           ts->cdf.m.wedge_idx[ctx], 15);
 1605|      0|                } else {
 1606|      0|                    b->comp_type = COMP_INTER_SEG;
 1607|      0|                }
 1608|      0|                b->mask_sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|      0|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1609|      0|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1610|      0|                    printf("Post-seg/wedge[%d,wedge_idx=%d,sign=%d]: r=%d\n",
 1611|      0|                           b->comp_type == COMP_INTER_WEDGE,
 1612|      0|                           b->wedge_idx, b->mask_sign, ts->msac.rng);
 1613|      0|            }
 1614|   318k|        } else {
 1615|   318k|            b->comp_type = COMP_INTER_NONE;
 1616|       |
 1617|       |            // ref
 1618|   318k|            if (seg && seg->ref > 0) {
  ------------------
  |  Branch (1618:17): [True: 0, False: 318k]
  |  Branch (1618:24): [True: 0, False: 0]
  ------------------
 1619|      0|                b->ref[0] = seg->ref - 1;
 1620|   318k|            } else if (seg && (seg->globalmv || seg->skip)) {
  ------------------
  |  Branch (1620:24): [True: 0, False: 318k]
  |  Branch (1620:32): [True: 0, False: 0]
  |  Branch (1620:49): [True: 0, False: 0]
  ------------------
 1621|      0|                b->ref[0] = 0;
 1622|   318k|            } else {
 1623|   318k|                const int ctx1 = av1_get_ref_ctx(t->a, &t->l, by4, bx4,
 1624|   318k|                                                 have_top, have_left);
 1625|   318k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   318k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1625:21): [True: 0, False: 318k]
  ------------------
 1626|   318k|                                                 ts->cdf.m.ref[0][ctx1]))
 1627|      0|                {
 1628|      0|                    const int ctx2 = av1_get_ref_2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  275|      0|#define av1_get_ref_2_ctx av1_get_bwd_ref_ctx
  ------------------
 1629|      0|                                                       have_top, have_left);
 1630|      0|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1630:25): [True: 0, False: 0]
  ------------------
 1631|      0|                                                     ts->cdf.m.ref[1][ctx2]))
 1632|      0|                    {
 1633|      0|                        b->ref[0] = 6;
 1634|      0|                    } else {
 1635|      0|                        const int ctx3 = av1_get_ref_6_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  279|      0|#define av1_get_ref_6_ctx av1_get_bwd_ref_1_ctx
  ------------------
 1636|      0|                                                           have_top, have_left);
 1637|      0|                        b->ref[0] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1638|      0|                                            ts->cdf.m.ref[5][ctx3]);
 1639|      0|                    }
 1640|   318k|                } else {
 1641|   318k|                    const int ctx2 = av1_get_ref_3_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  276|   318k|#define av1_get_ref_3_ctx av1_get_fwd_ref_ctx
  ------------------
 1642|   318k|                                                       have_top, have_left);
 1643|   318k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   318k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1643:25): [True: 0, False: 318k]
  ------------------
 1644|   318k|                                                     ts->cdf.m.ref[2][ctx2]))
 1645|      0|                    {
 1646|      0|                        const int ctx3 = av1_get_ref_5_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  278|      0|#define av1_get_ref_5_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1647|      0|                                                           have_top, have_left);
 1648|      0|                        b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1649|      0|                                            ts->cdf.m.ref[4][ctx3]);
 1650|   318k|                    } else {
 1651|   318k|                        const int ctx3 = av1_get_ref_4_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  277|   318k|#define av1_get_ref_4_ctx av1_get_fwd_ref_1_ctx
  ------------------
 1652|   318k|                                                           have_top, have_left);
 1653|   318k|                        b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   318k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1654|   318k|                                        ts->cdf.m.ref[3][ctx3]);
 1655|   318k|                    }
 1656|   318k|                }
 1657|   318k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   318k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 318k]
  |  |  ------------------
  |  |   35|   318k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   318k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1658|      0|                    printf("Post-ref[%d]: r=%d\n", b->ref[0], ts->msac.rng);
 1659|   318k|            }
 1660|   318k|            b->ref[1] = -1;
 1661|       |
 1662|   318k|            refmvs_candidate mvstack[8];
 1663|   318k|            int n_mvs, ctx;
 1664|   318k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1665|   318k|                              (union refmvs_refpair) { .ref = { b->ref[0] + 1, -1 }},
 1666|   318k|                              bs, intra_edge_flags, t->by, t->bx);
 1667|       |
 1668|       |            // mode parsing and mv derivation from ref_mvs
 1669|   318k|            if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1669:18): [True: 0, False: 318k]
  |  Branch (1669:26): [True: 0, False: 0]
  |  Branch (1669:39): [True: 0, False: 0]
  ------------------
 1670|   318k|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   318k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1670:17): [True: 147k, False: 171k]
  ------------------
 1671|   318k|                                             ts->cdf.m.newmv_mode[ctx & 7]))
 1672|   147k|            {
 1673|   147k|                if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1673:22): [True: 0, False: 147k]
  |  Branch (1673:30): [True: 0, False: 0]
  |  Branch (1673:43): [True: 0, False: 0]
  ------------------
 1674|   147k|                    !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   147k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1674:21): [True: 8.66k, False: 139k]
  ------------------
 1675|   147k|                         ts->cdf.m.globalmv_mode[(ctx >> 3) & 1]))
 1676|  8.74k|                {
 1677|  8.74k|                    b->inter_mode = GLOBALMV;
 1678|  8.74k|                    b->mv[0] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[0]],
 1679|  8.74k|                                          t->bx, t->by, bw4, bh4, f->frame_hdr);
 1680|  8.74k|                    has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1680:41): [True: 10, False: 8.73k]
  ------------------
 1681|  8.73k|                        f->frame_hdr->gmv[b->ref[0]].type == DAV1D_WM_TYPE_TRANSLATION;
  ------------------
  |  Branch (1681:25): [True: 18.4E, False: 8.73k]
  ------------------
 1682|   138k|                } else {
 1683|   138k|                    has_subpel_filter = 1;
 1684|   138k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   138k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1684:25): [True: 37.8k, False: 101k]
  ------------------
 1685|   138k|                            ts->cdf.m.refmv_mode[(ctx >> 4) & 15]))
 1686|  37.8k|                    { // NEAREST, NEARER, NEAR or NEARISH
 1687|  37.8k|                        b->inter_mode = NEARMV;
 1688|  37.8k|                        b->drl_idx = NEARER_DRL;
 1689|  37.8k|                        if (n_mvs > 2) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1689:29): [True: 22.4k, False: 15.4k]
  ------------------
 1690|  22.4k|                            const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1691|  22.4k|                            b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  22.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1692|  22.4k|                                              ts->cdf.m.drl_bit[drl_ctx_v2]);
 1693|  22.4k|                            if (b->drl_idx == NEAR_DRL && n_mvs > 3) { // NEAR or NEARISH
  ------------------
  |  Branch (1693:33): [True: 1.35k, False: 21.0k]
  |  Branch (1693:59): [True: 968, False: 384]
  ------------------
 1694|    968|                                const int drl_ctx_v3 =
 1695|    968|                                    get_drl_context(mvstack, 2);
 1696|    968|                                b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|    968|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1697|    968|                                                  ts->cdf.m.drl_bit[drl_ctx_v3]);
 1698|    968|                            }
 1699|  22.4k|                        }
 1700|   101k|                    } else {
 1701|   101k|                        b->inter_mode = NEARESTMV;
 1702|   101k|                        b->drl_idx = NEAREST_DRL;
 1703|   101k|                    }
 1704|   138k|                    assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  |  140|   277k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 139k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 139k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 138k]
  |  |  ------------------
  ------------------
 1705|   138k|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1706|   138k|                    if (b->drl_idx < NEAR_DRL)
  ------------------
  |  Branch (1706:25): [True: 137k, False: 1.13k]
  ------------------
 1707|   137k|                        fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1708|   138k|                }
 1709|       |
 1710|   147k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   147k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 147k]
  |  |  ------------------
  |  |   35|   147k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   147k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1711|      0|                    printf("Post-intermode[%d,drl=%d,mv=y:%d,x:%d,n_mvs=%d]: r=%d\n",
 1712|      0|                           b->inter_mode, b->drl_idx, b->mv[0].y, b->mv[0].x, n_mvs,
 1713|      0|                           ts->msac.rng);
 1714|   170k|            } else {
 1715|   170k|                has_subpel_filter = 1;
 1716|   170k|                b->inter_mode = NEWMV;
 1717|   170k|                b->drl_idx = NEAREST_DRL;
 1718|   170k|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1718:21): [True: 110k, False: 60.8k]
  ------------------
 1719|   110k|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1720|   110k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   110k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1721|   110k|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1722|   110k|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1722:25): [True: 9.22k, False: 100k]
  |  Branch (1722:53): [True: 6.36k, False: 2.85k]
  ------------------
 1723|  6.36k|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1724|  6.36k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  6.36k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1725|  6.36k|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1726|  6.36k|                    }
 1727|   110k|                }
 1728|   170k|                assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  |  140|   342k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 171k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 171k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 170k]
  |  |  ------------------
  ------------------
 1729|   170k|                if (n_mvs > 1) {
  ------------------
  |  Branch (1729:21): [True: 110k, False: 60.8k]
  ------------------
 1730|   110k|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1731|   110k|                } else {
 1732|  60.8k|                    assert(!b->drl_idx);
  ------------------
  |  |  140|  60.8k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 60.8k]
  |  |  |  Branch (140:68): [Folded, False: 60.8k]
  |  |  ------------------
  ------------------
 1733|  60.8k|                    b->mv[0] = mvstack[0].mv.mv[0];
 1734|  60.8k|                    fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1735|  60.8k|                }
 1736|   170k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   170k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 170k]
  |  |  ------------------
  |  |   35|   170k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   170k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1737|      0|                    printf("Post-intermode[%d,drl=%d]: r=%d\n",
 1738|      0|                           b->inter_mode, b->drl_idx, ts->msac.rng);
 1739|   170k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv;
 1740|   170k|                read_mv_residual(ts, &b->mv[0], mv_prec);
 1741|   170k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   170k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 170k]
  |  |  ------------------
  |  |   35|   170k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   170k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1742|      0|                    printf("Post-residualmv[mv=y:%d,x:%d]: r=%d\n",
 1743|      0|                           b->mv[0].y, b->mv[0].x, ts->msac.rng);
 1744|   170k|            }
 1745|       |
 1746|       |            // interintra flags
 1747|   318k|            const int ii_sz_grp = dav1d_ymode_size_context[bs];
 1748|   318k|            if (f->seq_hdr->inter_intra &&
  ------------------
  |  Branch (1748:17): [True: 0, False: 318k]
  ------------------
 1749|      0|                interintra_allowed_mask & (1 << bs) &&
  ------------------
  |  Branch (1749:17): [True: 0, False: 0]
  ------------------
 1750|      0|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1750:17): [True: 0, False: 0]
  ------------------
 1751|      0|                                             ts->cdf.m.interintra[ii_sz_grp]))
 1752|      0|            {
 1753|      0|                b->interintra_mode = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|      0|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1754|      0|                                         ts->cdf.m.interintra_mode[ii_sz_grp],
 1755|      0|                                         N_INTER_INTRA_PRED_MODES - 1);
 1756|      0|                const int wedge_ctx = dav1d_wedge_ctx_lut[bs];
 1757|      0|                b->interintra_type = INTER_INTRA_BLEND +
 1758|      0|                                     dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|      0|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1759|      0|                                         ts->cdf.m.interintra_wedge[wedge_ctx]);
 1760|      0|                if (b->interintra_type == INTER_INTRA_WEDGE)
  ------------------
  |  Branch (1760:21): [True: 0, False: 0]
  ------------------
 1761|      0|                    b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|      0|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1762|      0|                                       ts->cdf.m.wedge_idx[wedge_ctx], 15);
 1763|   318k|            } else {
 1764|   318k|                b->interintra_type = INTER_INTRA_NONE;
 1765|   318k|            }
 1766|   318k|            if (DEBUG_BLOCK_INFO && f->seq_hdr->inter_intra &&
  ------------------
  |  |   34|   318k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 318k]
  |  |  ------------------
  |  |   35|   318k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   318k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1766:37): [True: 0, False: 0]
  ------------------
 1767|      0|                interintra_allowed_mask & (1 << bs))
  ------------------
  |  Branch (1767:17): [True: 0, False: 0]
  ------------------
 1768|      0|            {
 1769|      0|                printf("Post-interintra[t=%d,m=%d,w=%d]: r=%d\n",
 1770|      0|                       b->interintra_type, b->interintra_mode,
 1771|      0|                       b->wedge_idx, ts->msac.rng);
 1772|      0|            }
 1773|       |
 1774|       |            // motion variation
 1775|   318k|            if (f->frame_hdr->switchable_motion_mode &&
  ------------------
  |  Branch (1775:17): [True: 319k, False: 18.4E]
  ------------------
 1776|   319k|                b->interintra_type == INTER_INTRA_NONE && imin(bw4, bh4) >= 2 &&
  ------------------
  |  Branch (1776:17): [True: 319k, False: 18.4E]
  |  Branch (1776:59): [True: 315k, False: 3.46k]
  ------------------
 1777|       |                // is not warped global motion
 1778|   315k|                !(!f->frame_hdr->force_integer_mv && b->inter_mode == GLOBALMV &&
  ------------------
  |  Branch (1778:19): [True: 315k, False: 18.4E]
  |  Branch (1778:54): [True: 8.72k, False: 306k]
  ------------------
 1779|  8.72k|                  f->frame_hdr->gmv[b->ref[0]].type > DAV1D_WM_TYPE_TRANSLATION) &&
  ------------------
  |  Branch (1779:19): [True: 0, False: 8.72k]
  ------------------
 1780|       |                // has overlappable neighbours
 1781|   315k|                ((have_left && findoddzero(&t->l.intra[by4 + 1], h4 >> 1)) ||
  ------------------
  |  Branch (1781:19): [True: 248k, False: 67.6k]
  |  Branch (1781:32): [True: 158k, False: 89.2k]
  ------------------
 1782|   157k|                 (have_top && findoddzero(&t->a->intra[bx4 + 1], w4 >> 1))))
  ------------------
  |  Branch (1782:19): [True: 121k, False: 35.9k]
  |  Branch (1782:31): [True: 69.9k, False: 51.2k]
  ------------------
 1783|   228k|            {
 1784|       |                // reaching here means the block allows obmc - check warp by
 1785|       |                // finding matching-ref blocks in top/left edges
 1786|   228k|                uint64_t mask[2] = { 0, 0 };
 1787|   228k|                find_matching_ref(t, intra_edge_flags, bw4, bh4, w4, h4,
 1788|   228k|                                  have_left, have_top, b->ref[0], mask);
 1789|   228k|                const int allow_warp = !f->svc[b->ref[0]][0].scale &&
  ------------------
  |  Branch (1789:40): [True: 25.5k, False: 202k]
  ------------------
 1790|  25.5k|                    !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (1790:21): [True: 25.5k, False: 0]
  ------------------
 1791|  25.5k|                    f->frame_hdr->warp_motion && (mask[0] | mask[1]);
  ------------------
  |  Branch (1791:21): [True: 25.5k, False: 18.4E]
  |  Branch (1791:50): [True: 25.6k, False: 18.4E]
  ------------------
 1792|       |
 1793|   228k|                b->motion_mode = allow_warp ?
  ------------------
  |  Branch (1793:34): [True: 25.6k, False: 202k]
  ------------------
 1794|  25.6k|                    dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|  25.6k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1795|  25.6k|                        ts->cdf.m.motion_mode[bs], 2) :
 1796|   228k|                    dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.obmc[bs]);
  ------------------
  |  |   52|   202k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1797|   228k|                if (b->motion_mode == MM_WARP) {
  ------------------
  |  Branch (1797:21): [True: 5.04k, False: 223k]
  ------------------
 1798|  5.04k|                    has_subpel_filter = 0;
 1799|  5.04k|                    derive_warpmv(t, bw4, bh4, mask, b->mv[0], &t->warpmv);
 1800|  5.04k|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
 1801|  5.04k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  5.04k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.04k]
  |  |  ------------------
  |  |   35|  5.04k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  5.04k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1802|      0|                        printf("[ %c%x %c%x %c%x\n  %c%x %c%x %c%x ]\n"
 1803|      0|                               "alpha=%c%x, beta=%c%x, gamma=%c%x, delta=%c%x, "
 1804|      0|                               "mv=y:%d,x:%d\n",
 1805|      0|                               signabs(t->warpmv.matrix[0]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1806|      0|                               signabs(t->warpmv.matrix[1]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1807|      0|                               signabs(t->warpmv.matrix[2]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1808|      0|                               signabs(t->warpmv.matrix[3]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1809|      0|                               signabs(t->warpmv.matrix[4]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1810|      0|                               signabs(t->warpmv.matrix[5]),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1811|      0|                               signabs(t->warpmv.u.p.alpha),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1812|      0|                               signabs(t->warpmv.u.p.beta),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1813|      0|                               signabs(t->warpmv.u.p.gamma),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1814|      0|                               signabs(t->warpmv.u.p.delta),
  ------------------
  |  | 1800|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1800:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1815|      0|                               b->mv[0].y, b->mv[0].x);
 1816|  5.04k|#undef signabs
 1817|  5.04k|                    if (t->frame_thread.pass) {
  ------------------
  |  Branch (1817:25): [True: 0, False: 5.04k]
  ------------------
 1818|      0|                        if (t->warpmv.type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1818:29): [True: 0, False: 0]
  ------------------
 1819|      0|                            b->matrix[0] = t->warpmv.matrix[2] - 0x10000;
 1820|      0|                            b->matrix[1] = t->warpmv.matrix[3];
 1821|      0|                            b->matrix[2] = t->warpmv.matrix[4];
 1822|      0|                            b->matrix[3] = t->warpmv.matrix[5] - 0x10000;
 1823|      0|                        } else {
 1824|      0|                            b->matrix[0] = INT16_MIN;
 1825|      0|                        }
 1826|      0|                    }
 1827|  5.04k|                }
 1828|       |
 1829|   228k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   228k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 228k]
  |  |  ------------------
  |  |   35|   228k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   228k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1830|      0|                    printf("Post-motionmode[%d]: r=%d [mask: 0x%" PRIx64 "/0x%"
 1831|      0|                           PRIx64 "]\n", b->motion_mode, ts->msac.rng, mask[0],
 1832|      0|                            mask[1]);
 1833|   228k|            } else {
 1834|  90.1k|                b->motion_mode = MM_TRANSLATION;
 1835|  90.1k|            }
 1836|   318k|        }
 1837|       |
 1838|       |        // subpel filter
 1839|   318k|        enum Dav1dFilterMode filter[2];
 1840|   318k|        if (f->frame_hdr->subpel_filter_mode == DAV1D_FILTER_SWITCHABLE) {
  ------------------
  |  Branch (1840:13): [True: 177k, False: 141k]
  ------------------
 1841|   177k|            if (has_subpel_filter) {
  ------------------
  |  Branch (1841:17): [True: 169k, False: 7.61k]
  ------------------
 1842|   169k|                const int comp = b->comp_type != COMP_INTER_NONE;
 1843|   169k|                const int ctx1 = get_filter_ctx(t->a, &t->l, comp, 0, b->ref[0],
 1844|   169k|                                                by4, bx4);
 1845|   169k|                filter[0] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   169k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1846|   169k|                               ts->cdf.m.filter[0][ctx1],
 1847|   169k|                               DAV1D_N_SWITCHABLE_FILTERS - 1);
 1848|   169k|                if (f->seq_hdr->dual_filter) {
  ------------------
  |  Branch (1848:21): [True: 0, False: 169k]
  ------------------
 1849|      0|                    const int ctx2 = get_filter_ctx(t->a, &t->l, comp, 1,
 1850|      0|                                                    b->ref[0], by4, bx4);
 1851|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1852|      0|                        printf("Post-subpel_filter1[%d,ctx=%d]: r=%d\n",
 1853|      0|                               filter[0], ctx1, ts->msac.rng);
 1854|      0|                    filter[1] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|      0|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1855|      0|                                    ts->cdf.m.filter[1][ctx2],
 1856|      0|                                    DAV1D_N_SWITCHABLE_FILTERS - 1);
 1857|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1858|      0|                        printf("Post-subpel_filter2[%d,ctx=%d]: r=%d\n",
 1859|      0|                               filter[1], ctx2, ts->msac.rng);
 1860|   169k|                } else {
 1861|   169k|                    filter[1] = filter[0];
 1862|   169k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   169k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 169k]
  |  |  ------------------
  |  |   35|   169k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   169k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1863|      0|                        printf("Post-subpel_filter[%d,ctx=%d]: r=%d\n",
 1864|      0|                               filter[0], ctx1, ts->msac.rng);
 1865|   169k|                }
 1866|   169k|            } else {
 1867|  7.61k|                filter[0] = filter[1] = DAV1D_FILTER_8TAP_REGULAR;
 1868|  7.61k|            }
 1869|   177k|        } else {
 1870|   141k|            filter[0] = filter[1] = f->frame_hdr->subpel_filter_mode;
 1871|   141k|        }
 1872|   318k|        b->filter2d = dav1d_filter_2d[filter[1]][filter[0]];
 1873|       |
 1874|   318k|        read_vartx_tree(t, b, bs, bx4, by4);
 1875|       |
 1876|       |        // reconstruction
 1877|   318k|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1877:13): [True: 0, False: 318k]
  ------------------
 1878|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1879|   318k|        } else {
 1880|   318k|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1880:17): [True: 0, False: 318k]
  ------------------
 1881|   318k|        }
 1882|       |
 1883|   318k|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1883:13): [True: 205k, False: 113k]
  ------------------
 1884|   113k|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1884:13): [True: 7, False: 113k]
  ------------------
 1885|   204k|        {
 1886|   204k|            const int is_globalmv =
 1887|   204k|                b->inter_mode == (is_comp ? GLOBALMV_GLOBALMV : GLOBALMV);
  ------------------
  |  Branch (1887:35): [True: 0, False: 204k]
  ------------------
 1888|   204k|            const uint8_t (*const lf_lvls)[8][2] = (const uint8_t (*)[8][2])
 1889|   204k|                &ts->lflvl[b->seg_id][0][b->ref[0] + 1][!is_globalmv];
 1890|   204k|            const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1891|   204k|            enum RectTxfmSize ytx = b->max_ytx, uvtx = b->uvtx;
 1892|   204k|            if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1892:17): [True: 0, False: 204k]
  ------------------
 1893|      0|                ytx  = (enum RectTxfmSize) TX_4X4;
 1894|      0|                uvtx = (enum RectTxfmSize) TX_4X4;
 1895|      0|            }
 1896|   204k|            dav1d_create_lf_mask_inter(t->lf_mask, f->lf.level, f->b4_stride, lf_lvls,
 1897|   204k|                                       t->bx, t->by, f->w4, f->h4, b->skip, bs,
 1898|   204k|                                       ytx, tx_split, uvtx, f->cur.p.layout,
 1899|   204k|                                       &t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
 1900|   204k|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1900:40): [True: 61.7k, False: 143k]
  ------------------
 1901|   204k|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1901:40): [True: 61.7k, False: 143k]
  ------------------
 1902|   204k|        }
 1903|       |
 1904|       |        // context updates
 1905|   318k|        if (is_comp)
  ------------------
  |  Branch (1905:13): [True: 0, False: 318k]
  ------------------
 1906|      0|            splat_tworef_mv(f->c, t, bs, b, bw4, bh4);
 1907|   318k|        else
 1908|   318k|            splat_oneref_mv(f->c, t, bs, b, bw4, bh4);
 1909|   318k|        BlockContext *edge = t->a;
 1910|   954k|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1910:36): [True: 637k, False: 317k]
  ------------------
 1911|   637k|#define set_ctx(rep_macro) \
 1912|   637k|            rep_macro(edge->seg_pred, off, seg_pred); \
 1913|   637k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
 1914|   637k|            rep_macro(edge->intra, off, 0); \
 1915|   637k|            rep_macro(edge->skip, off, b->skip); \
 1916|   637k|            rep_macro(edge->pal_sz, off, 0); \
 1917|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1918|   637k|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1919|   637k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1920|   637k|            rep_macro(edge->comp_type, off, b->comp_type); \
 1921|   637k|            rep_macro(edge->filter[0], off, filter[0]); \
 1922|   637k|            rep_macro(edge->filter[1], off, filter[1]); \
 1923|   637k|            rep_macro(edge->mode, off, b->inter_mode); \
 1924|   637k|            rep_macro(edge->ref[0], off, b->ref[0]); \
 1925|   637k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
 1926|   637k|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|   637k|    switch (var) { \
  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1912|  5.45k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|  5.45k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|  5.45k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|  5.45k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|  5.45k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|  5.45k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|  5.45k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|  5.45k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|  5.45k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|  5.45k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|  5.45k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|  5.45k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|  5.45k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|  5.45k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  5.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  5.45k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 5.45k, False: 631k]
  |  |  ------------------
  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1912|   530k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|   530k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|   530k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|   530k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|   530k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|   530k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|   530k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|   530k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|   530k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|   530k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|   530k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|   530k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|   530k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|   530k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   530k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   530k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 530k, False: 106k]
  |  |  ------------------
  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1912|  88.0k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|  88.0k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|  88.0k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|  88.0k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|  88.0k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|  88.0k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|  88.0k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|  88.0k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|  88.0k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|  88.0k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|  88.0k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|  88.0k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|  88.0k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|  88.0k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  88.0k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  88.0k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 88.0k, False: 548k]
  |  |  ------------------
  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1912|  11.4k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|  11.4k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|  11.4k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|  11.4k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|  11.4k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|  11.4k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|  11.4k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|  11.4k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|  11.4k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|  11.4k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|  11.4k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|  11.4k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|  11.4k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|  11.4k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  11.4k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  11.4k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 11.4k, False: 625k]
  |  |  ------------------
  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1912|  1.67k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|  1.67k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|  1.67k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|  1.67k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|  1.67k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|  1.67k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|  1.67k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|  1.67k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|  1.67k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|  1.67k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|  1.67k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|  1.67k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|  1.67k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|  1.67k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.67k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.67k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.67k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.67k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.67k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 1.67k, False: 635k]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1912|      0|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1913|      0|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1914|      0|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1915|      0|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1916|      0|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1917|      0|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1918|      0|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1919|      0|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1920|      0|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1921|      0|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1922|      0|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1923|      0|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1924|      0|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1925|      0|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 637k]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 637k]
  |  |  ------------------
  |  |   78|   637k|    }
  ------------------
 1927|   636k|#undef set_ctx
 1928|   636k|        }
 1929|   317k|        if (has_chroma) {
  ------------------
  |  Branch (1929:13): [True: 82.5k, False: 235k]
  ------------------
 1930|  82.5k|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1931|  82.5k|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1932|  82.5k|        }
 1933|   317k|    }
 1934|       |
 1935|       |    // update contexts
 1936|  1.25M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (1936:9): [True: 0, False: 1.25M]
  ------------------
 1937|      0|        f->frame_hdr->segmentation.update_map)
  ------------------
  |  Branch (1937:9): [True: 0, False: 0]
  ------------------
 1938|      0|    {
 1939|      0|        uint8_t *seg_ptr = &f->cur_segmap[t->by * f->b4_stride + t->bx];
 1940|      0|#define set_ctx(rep_macro) \
 1941|      0|        for (int y = 0; y < bh4; y++) { \
 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
 1943|      0|            seg_ptr += f->b4_stride; \
 1944|      0|        }
 1945|      0|        case_set(b_dim[2]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1941|      0|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1941:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1942|      0|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1943|      0|            seg_ptr += f->b4_stride; \
  |  |  |  | 1944|      0|        }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
 1946|      0|#undef set_ctx
 1947|      0|    }
 1948|  1.25M|    if (!b->skip) {
  ------------------
  |  Branch (1948:9): [True: 1.22M, False: 25.1k]
  ------------------
 1949|  1.22M|        uint16_t (*noskip_mask)[2] = &t->lf_mask->noskip_mask[by4 >> 1];
 1950|  1.22M|        const unsigned mask = (~0U >> (32 - bw4)) << (bx4 & 15);
 1951|  1.22M|        const int bx_idx = (bx4 & 16) >> 4;
 1952|  2.60M|        for (int y = 0; y < bh4; y += 2, noskip_mask++) {
  ------------------
  |  Branch (1952:25): [True: 1.37M, False: 1.22M]
  ------------------
 1953|  1.37M|            (*noskip_mask)[bx_idx] |= mask;
 1954|  1.37M|            if (bw4 == 32) // this should be mask >> 16, but it's 0xffffffff anyway
  ------------------
  |  Branch (1954:17): [True: 0, False: 1.37M]
  ------------------
 1955|      0|                (*noskip_mask)[1] |= mask;
 1956|  1.37M|        }
 1957|  1.22M|    }
 1958|       |
 1959|  1.25M|    if (t->frame_thread.pass == 1 && !b->intra && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1959:9): [True: 0, False: 1.25M]
  |  Branch (1959:38): [True: 0, False: 0]
  ------------------
 1960|      0|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 1961|      0|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 1962|       |
 1963|       |        // keep track of motion vectors for each reference
 1964|      0|        if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1964:13): [True: 0, False: 0]
  ------------------
 1965|       |            // y
 1966|      0|            if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1966:17): [True: 0, False: 0]
  ------------------
 1967|      0|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1967:19): [True: 0, False: 0]
  |  Branch (1967:48): [True: 0, False: 0]
  ------------------
 1968|      0|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1968:19): [True: 0, False: 0]
  |  Branch (1968:48): [True: 0, False: 0]
  ------------------
 1969|      0|            {
 1970|      0|                affine_lowest_px_luma(t, &lowest_px[b->ref[0]][0], b_dim,
 1971|      0|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1971:39): [True: 0, False: 0]
  ------------------
 1972|      0|                                      &f->frame_hdr->gmv[b->ref[0]]);
 1973|      0|            } else {
 1974|      0|                mc_lowest_px(&lowest_px[b->ref[0]][0], t->by, bh4, b->mv[0].y,
 1975|      0|                             0, &f->svc[b->ref[0]][1]);
 1976|      0|                if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1976:21): [True: 0, False: 0]
  ------------------
 1977|      0|                    obmc_lowest_px(t, lowest_px, 0, b_dim, bx4, by4, w4, h4);
 1978|      0|                }
 1979|      0|            }
 1980|       |
 1981|       |            // uv
 1982|      0|            if (has_chroma) {
  ------------------
  |  Branch (1982:17): [True: 0, False: 0]
  ------------------
 1983|       |                // sub8x8 derivation
 1984|      0|                int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1984:33): [True: 0, False: 0]
  |  Branch (1984:50): [True: 0, False: 0]
  ------------------
 1985|      0|                refmvs_block *const *r;
 1986|      0|                if (is_sub8x8) {
  ------------------
  |  Branch (1986:21): [True: 0, False: 0]
  ------------------
 1987|      0|                    assert(ss_hor == 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1988|      0|                    r = &t->rt.r[(t->by & 31) + 5];
 1989|      0|                    if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1989:25): [True: 0, False: 0]
  ------------------
 1990|      0|                    if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1990:25): [True: 0, False: 0]
  ------------------
 1991|      0|                    if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1991:25): [True: 0, False: 0]
  |  Branch (1991:37): [True: 0, False: 0]
  ------------------
 1992|      0|                        is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1993|      0|                }
 1994|       |
 1995|       |                // chroma prediction
 1996|      0|                if (is_sub8x8) {
  ------------------
  |  Branch (1996:21): [True: 0, False: 0]
  ------------------
 1997|      0|                    assert(ss_hor == 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1998|      0|                    if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1998:25): [True: 0, False: 0]
  |  Branch (1998:37): [True: 0, False: 0]
  ------------------
 1999|      0|                        const refmvs_block *const rr = &r[-1][t->bx - 1];
 2000|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2001|      0|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2002|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2003|      0|                    }
 2004|      0|                    if (bw4 == 1) {
  ------------------
  |  Branch (2004:25): [True: 0, False: 0]
  ------------------
 2005|      0|                        const refmvs_block *const rr = &r[0][t->bx - 1];
 2006|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2007|      0|                                     t->by, bh4, rr->mv.mv[0].y, ss_ver,
 2008|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2009|      0|                    }
 2010|      0|                    if (bh4 == ss_ver) {
  ------------------
  |  Branch (2010:25): [True: 0, False: 0]
  ------------------
 2011|      0|                        const refmvs_block *const rr = &r[-1][t->bx];
 2012|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2013|      0|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2014|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2015|      0|                    }
 2016|      0|                    mc_lowest_px(&lowest_px[b->ref[0]][1], t->by, bh4,
 2017|      0|                                 b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2018|      0|                } else {
 2019|      0|                    if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (2019:25): [True: 0, False: 0]
  ------------------
 2020|      0|                        ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (2020:27): [True: 0, False: 0]
  |  Branch (2020:56): [True: 0, False: 0]
  ------------------
 2021|      0|                         (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (2021:27): [True: 0, False: 0]
  |  Branch (2021:56): [True: 0, False: 0]
  ------------------
 2022|      0|                    {
 2023|      0|                        affine_lowest_px_chroma(t, &lowest_px[b->ref[0]][1], b_dim,
 2024|      0|                                                b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (2024:49): [True: 0, False: 0]
  ------------------
 2025|      0|                                                &f->frame_hdr->gmv[b->ref[0]]);
 2026|      0|                    } else {
 2027|      0|                        mc_lowest_px(&lowest_px[b->ref[0]][1],
 2028|      0|                                     t->by & ~ss_ver, bh4 << (bh4 == ss_ver),
 2029|      0|                                     b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2030|      0|                        if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (2030:29): [True: 0, False: 0]
  ------------------
 2031|      0|                            obmc_lowest_px(t, lowest_px, 1, b_dim, bx4, by4, w4, h4);
 2032|      0|                        }
 2033|      0|                    }
 2034|      0|                }
 2035|      0|            }
 2036|      0|        } else {
 2037|       |            // y
 2038|      0|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2038:29): [True: 0, False: 0]
  ------------------
 2039|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (2039:21): [True: 0, False: 0]
  |  Branch (2039:59): [True: 0, False: 0]
  ------------------
 2040|      0|                    affine_lowest_px_luma(t, &lowest_px[b->ref[i]][0], b_dim,
 2041|      0|                                          &f->frame_hdr->gmv[b->ref[i]]);
 2042|      0|                } else {
 2043|      0|                    mc_lowest_px(&lowest_px[b->ref[i]][0], t->by, bh4,
 2044|      0|                                 b->mv[i].y, 0, &f->svc[b->ref[i]][1]);
 2045|      0|                }
 2046|      0|            }
 2047|       |
 2048|       |            // uv
 2049|      0|            if (has_chroma) for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2049:17): [True: 0, False: 0]
  |  Branch (2049:45): [True: 0, False: 0]
  ------------------
 2050|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (2050:21): [True: 0, False: 0]
  ------------------
 2051|      0|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (2051:21): [True: 0, False: 0]
  |  Branch (2051:45): [True: 0, False: 0]
  ------------------
 2052|      0|                {
 2053|      0|                    affine_lowest_px_chroma(t, &lowest_px[b->ref[i]][1], b_dim,
 2054|      0|                                            &f->frame_hdr->gmv[b->ref[i]]);
 2055|      0|                } else {
 2056|      0|                    mc_lowest_px(&lowest_px[b->ref[i]][1], t->by, bh4,
 2057|      0|                                 b->mv[i].y, ss_ver, &f->svc[b->ref[i]][1]);
 2058|      0|                }
 2059|      0|            }
 2060|      0|        }
 2061|      0|    }
 2062|       |
 2063|  1.25M|    return 0;
 2064|  1.25M|}
decode.c:read_pal_indices:
  419|  41.5k|{
  420|  41.5k|    Dav1dTileState *const ts = t->ts;
  421|  41.5k|    const ptrdiff_t stride = bw4 * 4;
  422|  41.5k|    assert(pal_idx);
  ------------------
  |  |  140|  41.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 41.5k]
  |  |  |  Branch (140:68): [Folded, False: 41.5k]
  |  |  ------------------
  ------------------
  423|  41.5k|    uint8_t *const pal_tmp = t->scratch.pal_idx_uv;
  424|  41.5k|    pal_tmp[0] = dav1d_msac_decode_uniform(&ts->msac, pal_sz);
  425|  41.5k|    uint16_t (*const color_map_cdf)[8] =
  426|  41.5k|        ts->cdf.m.color_map[pl][pal_sz - 2];
  427|  41.5k|    uint8_t (*const order)[8] = t->scratch.pal_order;
  428|  41.5k|    uint8_t *const ctx = t->scratch.pal_ctx;
  429|   565k|    for (int i = 1; i < 4 * (w4 + h4) - 1; i++) {
  ------------------
  |  Branch (429:21): [True: 523k, False: 41.5k]
  ------------------
  430|       |        // top/left-to-bottom/right diagonals ("wave-front")
  431|   523k|        const int first = imin(i, w4 * 4 - 1);
  432|   523k|        const int last = imax(0, i - h4 * 4 + 1);
  433|   523k|        order_palette(pal_tmp, stride, i, first, last, order, ctx);
  434|  2.66M|        for (int j = first, m = 0; j >= last; j--, m++) {
  ------------------
  |  Branch (434:36): [True: 2.13M, False: 523k]
  ------------------
  435|  2.13M|            const int color_idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  2.13M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  436|  2.13M|                                      color_map_cdf[ctx[m]], pal_sz - 1);
  437|  2.13M|            pal_tmp[(i - j) * stride + j] = order[m][color_idx];
  438|  2.13M|        }
  439|   523k|    }
  440|       |
  441|  41.5k|    t->c->pal_dsp.pal_idx_finish(pal_idx, pal_tmp, bw4 * 4, bh4 * 4,
  442|  41.5k|                                 w4 * 4, h4 * 4);
  443|  41.5k|}
decode.c:order_palette:
  356|   519k|{
  357|   519k|    int have_top = i > first;
  358|       |
  359|   519k|    assert(pal_idx);
  ------------------
  |  |  140|   519k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 519k]
  |  |  |  Branch (140:68): [Folded, False: 519k]
  |  |  ------------------
  ------------------
  360|   519k|    pal_idx += first + (i - first) * stride;
  361|  2.57M|    for (int j = first, n = 0; j >= last; have_top = 1, j--, n++, pal_idx += stride - 1) {
  ------------------
  |  Branch (361:32): [True: 2.05M, False: 519k]
  ------------------
  362|  2.05M|        const int have_left = j > 0;
  363|       |
  364|  2.05M|        assert(have_left || have_top);
  ------------------
  |  |  140|  2.31M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 1.78M, False: 266k]
  |  |  |  Branch (140:30): [True: 266k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 2.05M]
  |  |  ------------------
  ------------------
  365|       |
  366|  2.05M|#define add(v_in) do { \
  367|  2.05M|        const int v = v_in; \
  368|  2.05M|        assert((unsigned)v < 8U); \
  369|  2.05M|        order[n][o_idx++] = v; \
  370|  2.05M|        mask |= 1 << v; \
  371|  2.05M|    } while (0)
  372|       |
  373|  2.05M|        unsigned mask = 0;
  374|  2.05M|        int o_idx = 0;
  375|  2.05M|        if (!have_left) {
  ------------------
  |  Branch (375:13): [True: 266k, False: 1.78M]
  ------------------
  376|   266k|            ctx[n] = 0;
  377|   266k|            add(pal_idx[-stride]);
  ------------------
  |  |  366|   266k|#define add(v_in) do { \
  |  |  367|   266k|        const int v = v_in; \
  |  |  368|   266k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   266k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 266k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 266k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   266k|        order[n][o_idx++] = v; \
  |  |  370|   266k|        mask |= 1 << v; \
  |  |  371|   266k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 266k]
  |  |  ------------------
  ------------------
  378|  1.78M|        } else if (!have_top) {
  ------------------
  |  Branch (378:20): [True: 250k, False: 1.53M]
  ------------------
  379|   250k|            ctx[n] = 0;
  380|   250k|            add(pal_idx[-1]);
  ------------------
  |  |  366|   250k|#define add(v_in) do { \
  |  |  367|   250k|        const int v = v_in; \
  |  |  368|   250k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   250k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 250k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 250k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   250k|        order[n][o_idx++] = v; \
  |  |  370|   250k|        mask |= 1 << v; \
  |  |  371|   250k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 250k]
  |  |  ------------------
  ------------------
  381|  1.53M|        } else {
  382|  1.53M|            const int l = pal_idx[-1], t = pal_idx[-stride], tl = pal_idx[-(stride + 1)];
  383|  1.53M|            const int same_t_l = t == l;
  384|  1.53M|            const int same_t_tl = t == tl;
  385|  1.53M|            const int same_l_tl = l == tl;
  386|  1.53M|            const int same_all = same_t_l & same_t_tl & same_l_tl;
  387|       |
  388|  1.53M|            if (same_all) {
  ------------------
  |  Branch (388:17): [True: 404k, False: 1.13M]
  ------------------
  389|   404k|                ctx[n] = 4;
  390|   404k|                add(t);
  ------------------
  |  |  366|   404k|#define add(v_in) do { \
  |  |  367|   404k|        const int v = v_in; \
  |  |  368|   404k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   404k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 404k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 404k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   404k|        order[n][o_idx++] = v; \
  |  |  370|   404k|        mask |= 1 << v; \
  |  |  371|   404k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 404k]
  |  |  ------------------
  ------------------
  391|  1.13M|            } else if (same_t_l) {
  ------------------
  |  Branch (391:24): [True: 213k, False: 917k]
  ------------------
  392|   213k|                ctx[n] = 3;
  393|   213k|                add(t);
  ------------------
  |  |  366|   213k|#define add(v_in) do { \
  |  |  367|   213k|        const int v = v_in; \
  |  |  368|   213k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   213k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 213k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   213k|        order[n][o_idx++] = v; \
  |  |  370|   213k|        mask |= 1 << v; \
  |  |  371|   213k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 213k]
  |  |  ------------------
  ------------------
  394|   213k|                add(tl);
  ------------------
  |  |  366|   213k|#define add(v_in) do { \
  |  |  367|   213k|        const int v = v_in; \
  |  |  368|   213k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   213k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 213k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   213k|        order[n][o_idx++] = v; \
  |  |  370|   213k|        mask |= 1 << v; \
  |  |  371|   213k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 213k]
  |  |  ------------------
  ------------------
  395|   917k|            } else if (same_t_tl | same_l_tl) {
  ------------------
  |  Branch (395:24): [True: 787k, False: 130k]
  ------------------
  396|   787k|                ctx[n] = 2;
  397|   787k|                add(tl);
  ------------------
  |  |  366|   787k|#define add(v_in) do { \
  |  |  367|   787k|        const int v = v_in; \
  |  |  368|   787k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   787k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 787k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 787k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   787k|        order[n][o_idx++] = v; \
  |  |  370|   787k|        mask |= 1 << v; \
  |  |  371|   787k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 787k]
  |  |  ------------------
  ------------------
  398|   787k|                add(same_t_tl ? l : t);
  ------------------
  |  |  366|   787k|#define add(v_in) do { \
  |  |  367|  1.57M|        const int v = v_in; \
  |  |  ------------------
  |  |  |  Branch (367:23): [True: 413k, False: 373k]
  |  |  ------------------
  |  |  368|   787k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   787k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 787k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 787k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   787k|        order[n][o_idx++] = v; \
  |  |  370|   787k|        mask |= 1 << v; \
  |  |  371|   787k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 787k]
  |  |  ------------------
  ------------------
  399|   787k|            } else {
  400|   130k|                ctx[n] = 1;
  401|   130k|                add(imin(t, l));
  ------------------
  |  |  366|   130k|#define add(v_in) do { \
  |  |  367|   130k|        const int v = v_in; \
  |  |  368|   130k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   130k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 130k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   130k|        order[n][o_idx++] = v; \
  |  |  370|   130k|        mask |= 1 << v; \
  |  |  371|   130k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 130k]
  |  |  ------------------
  ------------------
  402|   130k|                add(imax(t, l));
  ------------------
  |  |  366|   130k|#define add(v_in) do { \
  |  |  367|   130k|        const int v = v_in; \
  |  |  368|   130k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   130k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 130k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   130k|        order[n][o_idx++] = v; \
  |  |  370|   130k|        mask |= 1 << v; \
  |  |  371|   130k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 130k]
  |  |  ------------------
  ------------------
  403|   130k|                add(tl);
  ------------------
  |  |  366|   130k|#define add(v_in) do { \
  |  |  367|   130k|        const int v = v_in; \
  |  |  368|   130k|        assert((unsigned)v < 8U); \
  |  |  ------------------
  |  |  |  |  140|   130k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, False: 130k]
  |  |  |  |  |  Branch (140:68): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  369|   130k|        order[n][o_idx++] = v; \
  |  |  370|   130k|        mask |= 1 << v; \
  |  |  371|   130k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (371:14): [Folded, False: 130k]
  |  |  ------------------
  ------------------
  404|   130k|            }
  405|  1.53M|        }
  406|  18.3M|        for (unsigned m = 1, bit = 0; m < 0x100; m <<= 1, bit++)
  ------------------
  |  Branch (406:39): [True: 16.2M, False: 2.05M]
  ------------------
  407|  16.2M|            if (!(mask & m))
  ------------------
  |  Branch (407:17): [True: 12.8M, False: 3.46M]
  ------------------
  408|  12.8M|                order[n][o_idx++] = bit;
  409|  2.05M|        assert(o_idx == 8);
  ------------------
  |  |  140|  2.05M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 2.05M]
  |  |  |  Branch (140:68): [Folded, False: 2.05M]
  |  |  ------------------
  ------------------
  410|  2.05M|#undef add
  411|  2.05M|    }
  412|   519k|}
decode.c:splat_intraref:
  566|   826k|{
  567|   826k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  568|   826k|        .ref.ref = { 0, -1 },
  569|   826k|        .mv.mv[0].n = INVALID_MV,
  ------------------
  |  |   40|   826k|#define INVALID_MV 0x80008000
  ------------------
  570|   826k|        .bs = bs,
  571|   826k|        .mf = 0,
  572|   826k|    };
  573|   826k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  574|   826k|}
decode.c:read_mv_residual:
  109|   171k|{
  110|   171k|    MsacContext *const msac = &ts->msac;
  111|   171k|    const enum MVJoint mv_joint =
  112|   171k|        dav1d_msac_decode_symbol_adapt4(msac, ts->cdf.mv.joint, N_MV_JOINTS - 1);
  ------------------
  |  |   47|   171k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  113|   171k|    if (mv_joint & MV_JOINT_V)
  ------------------
  |  Branch (113:9): [True: 156k, False: 14.7k]
  ------------------
  114|   156k|        ref_mv->y += read_mv_component_diff(msac, &ts->cdf.mv.comp[0], mv_prec);
  115|   171k|    if (mv_joint & MV_JOINT_H)
  ------------------
  |  Branch (115:9): [True: 155k, False: 15.3k]
  ------------------
  116|   155k|        ref_mv->x += read_mv_component_diff(msac, &ts->cdf.mv.comp[1], mv_prec);
  117|   171k|}
decode.c:read_mv_component_diff:
   79|   312k|{
   80|   312k|    const int sign = dav1d_msac_decode_bool_adapt(msac, mv_comp->sign);
  ------------------
  |  |   52|   312k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   81|   312k|    const int cl = dav1d_msac_decode_symbol_adapt16(msac, mv_comp->classes, 10);
  ------------------
  |  |   57|   312k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
   82|   312k|    int up, fp = 3, hp = 1;
   83|       |
   84|   312k|    if (!cl) {
  ------------------
  |  Branch (84:9): [True: 194k, False: 117k]
  ------------------
   85|   194k|        up = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0);
  ------------------
  |  |   52|   194k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   86|   194k|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (86:13): [True: 194k, False: 18.4E]
  ------------------
   87|   194k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->class0_fp[up], 3);
  ------------------
  |  |   47|   194k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   88|   194k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (88:17): [True: 115k, False: 79.5k]
  ------------------
   89|   115k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0_hp);
  ------------------
  |  |   52|   115k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   90|   194k|        }
   91|   194k|    } else {
   92|   117k|        up = 1 << cl;
   93|   337k|        for (int n = 0; n < cl; n++)
  ------------------
  |  Branch (93:25): [True: 219k, False: 117k]
  ------------------
   94|   219k|            up |= dav1d_msac_decode_bool_adapt(msac, mv_comp->classN[n]) << n;
  ------------------
  |  |   52|   219k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   95|   118k|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (95:13): [True: 118k, False: 18.4E]
  ------------------
   96|   118k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->classN_fp, 3);
  ------------------
  |  |   47|   118k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   97|   118k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (97:17): [True: 72.2k, False: 46.0k]
  ------------------
   98|  72.2k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->classN_hp);
  ------------------
  |  |   52|  72.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   99|   118k|        }
  100|   117k|    }
  101|       |
  102|   312k|    const int diff = ((up << 3) | (fp << 1) | hp) + 1;
  103|       |
  104|   312k|    return sign ? -diff : diff;
  ------------------
  |  Branch (104:12): [True: 155k, False: 156k]
  ------------------
  105|   312k|}
decode.c:read_vartx_tree:
  448|   318k|{
  449|   318k|    const Dav1dFrameContext *const f = t->f;
  450|   318k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  451|   318k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  452|       |
  453|       |    // var-tx tree coding
  454|   318k|    uint16_t tx_split[2] = { 0 };
  455|   318k|    b->max_ytx = dav1d_max_txfm_size_for_bs[bs][0];
  456|   318k|    if (!b->skip && (f->frame_hdr->segmentation.lossless[b->seg_id] ||
  ------------------
  |  Branch (456:9): [True: 292k, False: 26.4k]
  |  Branch (456:22): [True: 22.7k, False: 269k]
  ------------------
  457|   269k|                     b->max_ytx == TX_4X4))
  ------------------
  |  Branch (457:22): [True: 2.10k, False: 267k]
  ------------------
  458|  24.9k|    {
  459|  24.9k|        b->max_ytx = b->uvtx = TX_4X4;
  460|  24.9k|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (460:13): [True: 1.68k, False: 23.2k]
  ------------------
  461|  1.68k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], TX_4X4);
  462|  1.68k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], TX_4X4);
  463|  1.68k|        }
  464|   293k|    } else if (f->frame_hdr->txfm_mode != DAV1D_TX_SWITCHABLE || b->skip) {
  ------------------
  |  Branch (464:16): [True: 72.6k, False: 221k]
  |  Branch (464:66): [True: 13.6k, False: 207k]
  ------------------
  465|  86.3k|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (465:13): [True: 13.7k, False: 72.6k]
  ------------------
  466|  13.7k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], b_dim[2 + 0]);
  467|  13.7k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], b_dim[2 + 1]);
  468|  13.7k|        }
  469|  86.3k|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  470|   207k|    } else {
  471|   207k|        assert(bw4 <= 16 || bh4 <= 16 || b->max_ytx == TX_64X64);
  ------------------
  |  |  140|   415k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 207k, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 207k]
  |  |  ------------------
  ------------------
  472|   207k|        int y, x, y_off, x_off;
  473|   207k|        const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
  474|   415k|        for (y = 0, y_off = 0; y < bh4; y += ytx->h, y_off++) {
  ------------------
  |  Branch (474:32): [True: 207k, False: 207k]
  ------------------
  475|   415k|            for (x = 0, x_off = 0; x < bw4; x += ytx->w, x_off++) {
  ------------------
  |  Branch (475:36): [True: 207k, False: 207k]
  ------------------
  476|   207k|                read_tx_tree(t, b->max_ytx, 0, tx_split, x_off, y_off);
  477|       |                // contexts are updated inside read_tx_tree()
  478|   207k|                t->bx += ytx->w;
  479|   207k|            }
  480|   207k|            t->bx -= x;
  481|   207k|            t->by += ytx->h;
  482|   207k|        }
  483|   207k|        t->by -= y;
  484|   207k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   207k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 207k]
  |  |  ------------------
  |  |   35|   207k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   207k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  485|      0|            printf("Post-vartxtree[%x/%x]: r=%d\n",
  486|      0|                   tx_split[0], tx_split[1], t->ts->msac.rng);
  487|   207k|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  488|   207k|    }
  489|   318k|    assert(!(tx_split[0] & ~0x33));
  ------------------
  |  |  140|   318k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 318k]
  |  |  |  Branch (140:68): [Folded, False: 318k]
  |  |  ------------------
  ------------------
  490|   318k|    b->tx_split0 = (uint8_t)tx_split[0];
  491|   318k|    b->tx_split1 = tx_split[1];
  492|   318k|}
decode.c:read_tx_tree:
  123|   455k|{
  124|   455k|    const Dav1dFrameContext *const f = t->f;
  125|   455k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  126|   455k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
  127|   455k|    const int txw = t_dim->lw, txh = t_dim->lh;
  128|   455k|    int is_split;
  129|       |
  130|   455k|    if (depth < 2 && from > (int) TX_4X4) {
  ------------------
  |  Branch (130:9): [True: 381k, False: 74.2k]
  |  Branch (130:22): [True: 381k, False: 18.4E]
  ------------------
  131|   381k|        const int cat = 2 * (TX_64X64 - t_dim->max) - depth;
  132|   381k|        const int a = t->a->tx[bx4] < txw;
  133|   381k|        const int l = t->l.tx[by4] < txh;
  134|       |
  135|   381k|        is_split = dav1d_msac_decode_bool_adapt(&t->ts->msac,
  ------------------
  |  |   52|   381k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  136|   381k|                       t->ts->cdf.m.txpart[cat][a + l]);
  137|   381k|        if (is_split)
  ------------------
  |  Branch (137:13): [True: 72.8k, False: 308k]
  ------------------
  138|  72.8k|            masks[depth] |= 1 << (y_off * 4 + x_off);
  139|   381k|    } else {
  140|  74.2k|        is_split = 0;
  141|  74.2k|    }
  142|       |
  143|   455k|    if (is_split && t_dim->max > TX_8X8) {
  ------------------
  |  Branch (143:9): [True: 72.8k, False: 382k]
  |  Branch (143:21): [True: 69.3k, False: 3.49k]
  ------------------
  144|  69.3k|        const enum RectTxfmSize sub = t_dim->sub;
  145|  69.3k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  146|  69.3k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  147|       |
  148|  69.3k|        read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 0);
  149|  69.3k|        t->bx += txsw;
  150|  69.3k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (150:13): [True: 63.4k, False: 5.89k]
  |  Branch (150:27): [True: 62.3k, False: 1.11k]
  ------------------
  151|  62.3k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 1, y_off * 2 + 0);
  152|  69.3k|        t->bx -= txsw;
  153|  69.3k|        t->by += txsh;
  154|  69.3k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (154:13): [True: 62.7k, False: 6.62k]
  |  Branch (154:27): [True: 61.8k, False: 818]
  ------------------
  155|  61.8k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 1);
  156|  61.8k|            t->bx += txsw;
  157|  61.8k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (157:17): [True: 56.0k, False: 5.83k]
  |  Branch (157:31): [True: 55.0k, False: 1.04k]
  ------------------
  158|  55.0k|                read_tx_tree(t, sub, depth + 1, masks,
  159|  55.0k|                             x_off * 2 + 1, y_off * 2 + 1);
  160|  61.8k|            t->bx -= txsw;
  161|  61.8k|        }
  162|  69.3k|        t->by -= txsh;
  163|   386k|    } else {
  164|   386k|        dav1d_memset_pow2[t_dim->lw](&t->a->tx[bx4], is_split ? TX_4X4 : txw);
  ------------------
  |  Branch (164:54): [True: 3.49k, False: 382k]
  ------------------
  165|   386k|        dav1d_memset_pow2[t_dim->lh](&t->l.tx[by4], is_split ? TX_4X4 : txh);
  ------------------
  |  Branch (165:53): [True: 3.49k, False: 382k]
  ------------------
  166|   386k|    }
  167|   455k|}
decode.c:findoddzero:
  339|   368k|static inline int findoddzero(const uint8_t *buf, int len) {
  340|   532k|    for (int n = 0; n < len; n++)
  ------------------
  |  Branch (340:21): [True: 392k, False: 140k]
  ------------------
  341|   392k|        if (!buf[n * 2]) return 1;
  ------------------
  |  Branch (341:13): [True: 228k, False: 163k]
  ------------------
  342|   140k|    return 0;
  343|   368k|}
decode.c:find_matching_ref:
  197|   228k|{
  198|   228k|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  199|   228k|    int count = 0;
  200|   228k|    int have_topleft = have_top && have_left;
  ------------------
  |  Branch (200:24): [True: 195k, False: 32.9k]
  |  Branch (200:36): [True: 163k, False: 32.2k]
  ------------------
  201|   228k|    int have_topright = imax(bw4, bh4) < 32 &&
  ------------------
  |  Branch (201:25): [True: 228k, False: 66]
  ------------------
  202|   228k|                        have_top && t->bx + bw4 < t->ts->tiling.col_end &&
  ------------------
  |  Branch (202:25): [True: 195k, False: 32.9k]
  |  Branch (202:37): [True: 154k, False: 40.4k]
  ------------------
  203|   154k|                        (intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  ------------------
  |  Branch (203:25): [True: 108k, False: 46.4k]
  ------------------
  204|       |
  205|   228k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  206|   228k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  207|       |
  208|   228k|    if (have_top) {
  ------------------
  |  Branch (208:9): [True: 195k, False: 32.9k]
  ------------------
  209|   195k|        const refmvs_block *r2 = &r[-1][t->bx];
  210|   195k|        if (matches(r2)) {
  ------------------
  |  |  206|   195k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 157k, False: 38.1k]
  |  |  |  Branch (206:53): [True: 157k, False: 18.4E]
  |  |  ------------------
  ------------------
  211|   157k|            masks[0] |= 1;
  212|   157k|            count = 1;
  213|   157k|        }
  214|   195k|        int aw4 = bs(r2)[0];
  ------------------
  |  |  205|   195k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  215|   195k|        if (aw4 >= bw4) {
  ------------------
  |  Branch (215:13): [True: 193k, False: 2.31k]
  ------------------
  216|   193k|            const int off = t->bx & (aw4 - 1);
  217|   193k|            if (off) have_topleft = 0;
  ------------------
  |  Branch (217:17): [True: 4.99k, False: 188k]
  ------------------
  218|   193k|            if (aw4 - off > bw4) have_topright = 0;
  ------------------
  |  Branch (218:17): [True: 4.07k, False: 189k]
  ------------------
  219|   193k|        } else {
  220|  2.31k|            unsigned mask = 1 << aw4;
  221|  4.87k|            for (int x = aw4; x < w4; x += aw4) {
  ------------------
  |  Branch (221:31): [True: 2.56k, False: 2.30k]
  ------------------
  222|  2.56k|                r2 += aw4;
  223|  2.56k|                if (matches(r2)) {
  ------------------
  |  |  206|  2.56k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 1.98k, False: 582]
  |  |  |  Branch (206:53): [True: 1.98k, False: 0]
  |  |  ------------------
  ------------------
  224|  1.98k|                    masks[0] |= mask;
  225|  1.98k|                    if (++count >= 8) return;
  ------------------
  |  Branch (225:25): [True: 4, False: 1.98k]
  ------------------
  226|  1.98k|                }
  227|  2.56k|                aw4 = bs(r2)[0];
  ------------------
  |  |  205|  2.56k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  228|  2.56k|                mask <<= aw4;
  229|  2.56k|            }
  230|  2.31k|        }
  231|   195k|    }
  232|   228k|    if (have_left) {
  ------------------
  |  Branch (232:9): [True: 196k, False: 32.1k]
  ------------------
  233|   196k|        /*const*/ refmvs_block *const *r2 = r;
  234|   196k|        if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  206|   196k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 158k, False: 37.9k]
  |  |  |  Branch (206:53): [True: 158k, False: 18.4E]
  |  |  ------------------
  ------------------
  235|   158k|            masks[1] |= 1;
  236|   158k|            if (++count >= 8) return;
  ------------------
  |  Branch (236:17): [True: 5, False: 158k]
  ------------------
  237|   158k|        }
  238|   196k|        int lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  205|   196k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  239|   196k|        if (lh4 >= bh4) {
  ------------------
  |  Branch (239:13): [True: 193k, False: 2.46k]
  ------------------
  240|   193k|            if (t->by & (lh4 - 1)) have_topleft = 0;
  ------------------
  |  Branch (240:17): [True: 5.27k, False: 188k]
  ------------------
  241|   193k|        } else {
  242|  2.46k|            unsigned mask = 1 << lh4;
  243|  5.07k|            for (int y = lh4; y < h4; y += lh4) {
  ------------------
  |  Branch (243:31): [True: 2.61k, False: 2.45k]
  ------------------
  244|  2.61k|                r2 += lh4;
  245|  2.61k|                if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  206|  2.61k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 1.99k, False: 615]
  |  |  |  Branch (206:53): [True: 1.99k, False: 0]
  |  |  ------------------
  ------------------
  246|  1.99k|                    masks[1] |= mask;
  247|  1.99k|                    if (++count >= 8) return;
  ------------------
  |  Branch (247:25): [True: 4, False: 1.99k]
  ------------------
  248|  1.99k|                }
  249|  2.60k|                lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  205|  2.60k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  250|  2.60k|                mask <<= lh4;
  251|  2.60k|            }
  252|  2.46k|        }
  253|   196k|    }
  254|   228k|    if (have_topleft && matches(&r[-1][t->bx - 1])) {
  ------------------
  |  |  206|   153k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 102k, False: 50.1k]
  |  |  |  Branch (206:53): [True: 102k, False: 18.4E]
  |  |  ------------------
  ------------------
  |  Branch (254:9): [True: 153k, False: 75.3k]
  ------------------
  255|   102k|        masks[1] |= 1ULL << 32;
  256|   102k|        if (++count >= 8) return;
  ------------------
  |  Branch (256:13): [True: 3, False: 102k]
  ------------------
  257|   102k|    }
  258|   228k|    if (have_topright && matches(&r[-1][t->bx + bw4])) {
  ------------------
  |  |  206|   104k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (206:22): [True: 70.7k, False: 33.7k]
  |  |  |  Branch (206:53): [True: 70.7k, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (258:9): [True: 104k, False: 123k]
  ------------------
  259|  70.7k|        masks[0] |= 1ULL << 32;
  260|  70.7k|    }
  261|   228k|#undef matches
  262|   228k|}
decode.c:derive_warpmv:
  268|  5.03k|{
  269|  5.03k|    int pts[8][2 /* in, out */][2 /* x, y */], np = 0;
  270|  5.03k|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  271|       |
  272|  5.03k|#define add_sample(dx, dy, sx, sy, rp) do { \
  273|  5.03k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  274|  5.03k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  275|  5.03k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  276|  5.03k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  277|  5.03k|    np++; \
  278|  5.03k|} while (0)
  279|       |
  280|       |    // use masks[] to find the projectable motion vectors in the edges
  281|  5.03k|    if ((unsigned) masks[0] == 1 && !(masks[1] >> 32)) {
  ------------------
  |  Branch (281:9): [True: 3.33k, False: 1.70k]
  |  Branch (281:37): [True: 1.47k, False: 1.85k]
  ------------------
  282|  1.47k|        const int off = t->bx & (bs(&r[-1][t->bx])[0] - 1);
  ------------------
  |  |  205|  1.47k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  283|  1.47k|        add_sample(-off, 0, 1, -1, &r[-1][t->bx]);
  ------------------
  |  |  272|  1.47k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  1.47k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.47k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  1.47k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.47k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  1.47k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  1.47k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  1.47k|    np++; \
  |  |  278|  1.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 1.47k]
  |  |  ------------------
  ------------------
  284|  5.42k|    } else for (unsigned off = 0, xmask = (uint32_t) masks[0]; np < 8 && xmask;) { // top
  ------------------
  |  Branch (284:64): [True: 5.40k, False: 14]
  |  Branch (284:74): [True: 1.85k, False: 3.55k]
  ------------------
  285|  1.85k|        const int tz = ctz(xmask);
  286|  1.85k|        off += tz;
  287|  1.85k|        xmask >>= tz;
  288|  1.85k|        add_sample(off, 0, 1, -1, &r[-1][t->bx + off]);
  ------------------
  |  |  272|  1.85k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  1.85k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.85k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  1.85k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.85k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  1.85k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  1.85k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  1.85k|    np++; \
  |  |  278|  1.85k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 1.85k]
  |  |  ------------------
  ------------------
  289|  1.85k|        xmask &= ~1;
  290|  1.85k|    }
  291|  5.03k|    if (np < 8 && masks[1] == 1) {
  ------------------
  |  Branch (291:9): [True: 5.03k, False: 7]
  |  Branch (291:19): [True: 1.75k, False: 3.27k]
  ------------------
  292|  1.75k|        const int off = t->by & (bs(&r[0][t->bx - 1])[1] - 1);
  ------------------
  |  |  205|  1.75k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  293|  1.75k|        add_sample(0, -off, -1, 1, &r[-off][t->bx - 1]);
  ------------------
  |  |  272|  1.75k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  1.75k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.75k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  1.75k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.75k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  1.75k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  1.75k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  1.75k|    np++; \
  |  |  278|  1.75k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 1.75k]
  |  |  ------------------
  ------------------
  294|  5.18k|    } else for (unsigned off = 0, ymask = (uint32_t) masks[1]; np < 8 && ymask;) { // left
  ------------------
  |  Branch (294:64): [True: 5.17k, False: 5]
  |  Branch (294:74): [True: 1.90k, False: 3.27k]
  ------------------
  295|  1.89k|        const int tz = ctz(ymask);
  296|  1.89k|        off += tz;
  297|  1.89k|        ymask >>= tz;
  298|  1.89k|        add_sample(0, off, -1, 1, &r[off][t->bx - 1]);
  ------------------
  |  |  272|  1.89k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  1.89k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.89k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  1.89k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.89k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  1.89k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  1.89k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  1.89k|    np++; \
  |  |  278|  1.89k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 1.89k]
  |  |  ------------------
  ------------------
  299|  1.89k|        ymask &= ~1;
  300|  1.89k|    }
  301|  5.03k|    if (np < 8 && masks[1] >> 32) // top/left
  ------------------
  |  Branch (301:9): [True: 5.02k, False: 10]
  |  Branch (301:19): [True: 2.07k, False: 2.95k]
  ------------------
  302|  2.07k|        add_sample(0, 0, -1, -1, &r[-1][t->bx - 1]);
  ------------------
  |  |  272|  2.07k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  2.07k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  2.07k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  2.07k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  2.07k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  2.07k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  2.07k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  2.07k|    np++; \
  |  |  278|  2.07k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 2.07k]
  |  |  ------------------
  ------------------
  303|  5.03k|    if (np < 8 && masks[0] >> 32) // top/right
  ------------------
  |  Branch (303:9): [True: 5.02k, False: 10]
  |  Branch (303:19): [True: 1.43k, False: 3.59k]
  ------------------
  304|  1.43k|        add_sample(bw4, 0, 1, -1, &r[-1][t->bx + bw4]);
  ------------------
  |  |  272|  1.43k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  273|  1.43k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.43k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  1.43k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  205|  1.43k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  275|  1.43k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  276|  1.43k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  277|  1.43k|    np++; \
  |  |  278|  1.43k|} while (0)
  |  |  ------------------
  |  |  |  Branch (278:10): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
  305|  5.03k|    assert(np > 0 && np <= 8);
  ------------------
  |  |  140|  10.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 5.02k, False: 10]
  |  |  |  Branch (140:30): [True: 5.02k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 5.03k]
  |  |  ------------------
  ------------------
  306|  5.03k|#undef bs
  307|       |
  308|       |    // select according to motion vector difference against a threshold
  309|  5.03k|    int mvd[8], ret = 0;
  310|  5.03k|    const int thresh = 4 * iclip(imax(bw4, bh4), 4, 28);
  311|  15.5k|    for (int i = 0; i < np; i++) {
  ------------------
  |  Branch (311:21): [True: 10.4k, False: 5.03k]
  ------------------
  312|  10.4k|        mvd[i] = abs(pts[i][1][0] - pts[i][0][0] - mv.x) +
  313|  10.4k|                 abs(pts[i][1][1] - pts[i][0][1] - mv.y);
  314|  10.4k|        if (mvd[i] > thresh)
  ------------------
  |  Branch (314:13): [True: 4.11k, False: 6.35k]
  ------------------
  315|  4.11k|            mvd[i] = -1;
  316|  6.35k|        else
  317|  6.35k|            ret++;
  318|  10.4k|    }
  319|  5.03k|    if (!ret) {
  ------------------
  |  Branch (319:9): [True: 970, False: 4.06k]
  ------------------
  320|    970|        ret = 1;
  321|  4.86k|    } else for (int i = 0, j = np - 1, k = 0; k < np - ret; k++, i++, j--) {
  ------------------
  |  Branch (321:47): [True: 1.92k, False: 2.94k]
  ------------------
  322|  3.24k|        while (mvd[i] != -1) i++;
  ------------------
  |  Branch (322:16): [True: 1.31k, False: 1.92k]
  ------------------
  323|  3.53k|        while (mvd[j] == -1) j--;
  ------------------
  |  Branch (323:16): [True: 1.61k, False: 1.92k]
  ------------------
  324|  1.92k|        assert(i != j);
  ------------------
  |  |  140|  1.92k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1.92k]
  |  |  |  Branch (140:68): [Folded, False: 1.92k]
  |  |  ------------------
  ------------------
  325|  1.92k|        if (i > j) break;
  ------------------
  |  Branch (325:13): [True: 1.12k, False: 801]
  ------------------
  326|       |        // replace the discarded samples;
  327|    801|        mvd[i] = mvd[j];
  328|    801|        memcpy(pts[i], pts[j], sizeof(*pts));
  329|    801|    }
  330|       |
  331|  5.03k|    if (!dav1d_find_affine_int(pts, ret, bw4, bh4, mv, wmp, t->bx, t->by) &&
  ------------------
  |  Branch (331:9): [True: 5.01k, False: 23]
  ------------------
  332|  5.01k|        !dav1d_get_shear_params(wmp))
  ------------------
  |  Branch (332:9): [True: 5.00k, False: 6]
  ------------------
  333|  5.00k|    {
  334|  5.00k|        wmp->type = DAV1D_WM_TYPE_AFFINE;
  335|  5.00k|    } else
  336|     30|        wmp->type = DAV1D_WM_TYPE_IDENTITY;
  337|  5.03k|}
decode.c:splat_oneref_mv:
  519|   318k|{
  520|   318k|    const enum InterPredMode mode = b->inter_mode;
  521|   318k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  522|   318k|        .ref.ref = { b->ref[0] + 1, b->interintra_type ? 0 : -1 },
  ------------------
  |  Branch (522:37): [True: 0, False: 318k]
  ------------------
  523|   318k|        .mv.mv[0] = b->mv[0],
  524|   318k|        .bs = bs,
  525|   318k|        .mf = (mode == GLOBALMV && imin(bw4, bh4) >= 2) | ((mode == NEWMV) * 2),
  ------------------
  |  Branch (525:16): [True: 8.74k, False: 309k]
  |  Branch (525:36): [True: 8.73k, False: 9]
  ------------------
  526|   318k|    };
  527|   318k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  528|   318k|}
decode.c:read_restoration_info:
 2516|    529|{
 2517|    529|    const Dav1dFrameContext *const f = t->f;
 2518|    529|    Dav1dTileState *const ts = t->ts;
 2519|    529|    const Av1RestorationUnit *const lr_ref = ts->lr_ref[p];
 2520|       |
 2521|    529|    if (frame_type == DAV1D_RESTORATION_SWITCHABLE) {
  ------------------
  |  Branch (2521:9): [True: 0, False: 529]
  ------------------
 2522|      0|        const int filter = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|      0|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 2523|      0|                               ts->cdf.m.restore_switchable, 2);
 2524|      0|        lr->type = filter + !!filter; /* NONE/WIENER/SGRPROJ */
 2525|    529|    } else {
 2526|    529|        const unsigned type =
 2527|    529|            dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|    529|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 2528|    529|                frame_type == DAV1D_RESTORATION_WIENER ?
  ------------------
  |  Branch (2528:17): [True: 503, False: 26]
  ------------------
 2529|    503|                ts->cdf.m.restore_wiener : ts->cdf.m.restore_sgrproj);
 2530|    529|        lr->type = type ? frame_type : DAV1D_RESTORATION_NONE;
  ------------------
  |  Branch (2530:20): [True: 503, False: 26]
  ------------------
 2531|    529|    }
 2532|       |
 2533|    529|    if (lr->type == DAV1D_RESTORATION_WIENER) {
  ------------------
  |  Branch (2533:9): [True: 477, False: 52]
  ------------------
 2534|    477|        lr->filter_v[0] = p ? 0 :
  ------------------
  |  Branch (2534:27): [True: 85, False: 392]
  ------------------
 2535|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2536|    392|                lr_ref->filter_v[0] + 5, 16, 1) - 5;
 2537|    477|        lr->filter_v[1] =
 2538|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2539|    477|                lr_ref->filter_v[1] + 23, 32, 2) - 23;
 2540|    477|        lr->filter_v[2] =
 2541|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2542|    477|                lr_ref->filter_v[2] + 17, 64, 3) - 17;
 2543|       |
 2544|    477|        lr->filter_h[0] = p ? 0 :
  ------------------
  |  Branch (2544:27): [True: 85, False: 392]
  ------------------
 2545|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2546|    392|                lr_ref->filter_h[0] + 5, 16, 1) - 5;
 2547|    477|        lr->filter_h[1] =
 2548|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2549|    477|                lr_ref->filter_h[1] + 23, 32, 2) - 23;
 2550|    477|        lr->filter_h[2] =
 2551|    477|            dav1d_msac_decode_subexp(&ts->msac,
 2552|    477|                lr_ref->filter_h[2] + 17, 64, 3) - 17;
 2553|    477|        memcpy(lr->sgr_weights, lr_ref->sgr_weights, sizeof(lr->sgr_weights));
 2554|    477|        ts->lr_ref[p] = lr;
 2555|    477|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|    477|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 477]
  |  |  ------------------
  |  |   35|    477|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|    477|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2556|      0|            printf("Post-lr_wiener[pl=%d,v[%d,%d,%d],h[%d,%d,%d]]: r=%d\n",
 2557|      0|                   p, lr->filter_v[0], lr->filter_v[1],
 2558|      0|                   lr->filter_v[2], lr->filter_h[0],
 2559|      0|                   lr->filter_h[1], lr->filter_h[2], ts->msac.rng);
 2560|    477|    } else if (lr->type == DAV1D_RESTORATION_SGRPROJ) {
  ------------------
  |  Branch (2560:16): [True: 26, False: 26]
  ------------------
 2561|     26|        const unsigned idx = dav1d_msac_decode_bools(&ts->msac, 4);
 2562|     26|        const uint16_t *const sgr_params = dav1d_sgr_params[idx];
 2563|     26|        lr->type += idx;
 2564|     26|        lr->sgr_weights[0] = sgr_params[0] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2564:30): [True: 26, False: 0]
  ------------------
 2565|     26|            lr_ref->sgr_weights[0] + 96, 128, 4) - 96 : 0;
 2566|     26|        lr->sgr_weights[1] = sgr_params[1] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2566:30): [True: 26, False: 0]
  ------------------
 2567|     26|            lr_ref->sgr_weights[1] + 32, 128, 4) - 32 : 95;
 2568|     26|        memcpy(lr->filter_v, lr_ref->filter_v, sizeof(lr->filter_v));
 2569|     26|        memcpy(lr->filter_h, lr_ref->filter_h, sizeof(lr->filter_h));
 2570|     26|        ts->lr_ref[p] = lr;
 2571|     26|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|     26|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 26]
  |  |  ------------------
  |  |   35|     26|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|     26|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2572|      0|            printf("Post-lr_sgrproj[pl=%d,idx=%d,w[%d,%d]]: r=%d\n",
 2573|      0|                   p, idx, lr->sgr_weights[0],
 2574|      0|                   lr->sgr_weights[1], ts->msac.rng);
 2575|     26|    }
 2576|    529|}
decode.c:init_quant_tables:
   57|  67.1k|{
   58|   134k|    for (int i = 0; i < (frame_hdr->segmentation.enabled ? 8 : 1); i++) {
  ------------------
  |  Branch (58:21): [True: 67.1k, False: 67.1k]
  |  Branch (58:26): [True: 0, False: 134k]
  ------------------
   59|  67.1k|        const int yac = frame_hdr->segmentation.enabled ?
  ------------------
  |  Branch (59:25): [True: 0, False: 67.1k]
  ------------------
   60|  67.1k|            iclip_u8(qidx + frame_hdr->segmentation.seg_data.d[i].delta_q) : qidx;
   61|  67.1k|        const int ydc = iclip_u8(yac + frame_hdr->quant.ydc_delta);
   62|  67.1k|        const int uac = iclip_u8(yac + frame_hdr->quant.uac_delta);
   63|  67.1k|        const int udc = iclip_u8(yac + frame_hdr->quant.udc_delta);
   64|  67.1k|        const int vac = iclip_u8(yac + frame_hdr->quant.vac_delta);
   65|  67.1k|        const int vdc = iclip_u8(yac + frame_hdr->quant.vdc_delta);
   66|       |
   67|  67.1k|        dq[i][0][0] = dav1d_dq_tbl[seq_hdr->hbd][ydc][0];
   68|  67.1k|        dq[i][0][1] = dav1d_dq_tbl[seq_hdr->hbd][yac][1];
   69|  67.1k|        dq[i][1][0] = dav1d_dq_tbl[seq_hdr->hbd][udc][0];
   70|  67.1k|        dq[i][1][1] = dav1d_dq_tbl[seq_hdr->hbd][uac][1];
   71|  67.1k|        dq[i][2][0] = dav1d_dq_tbl[seq_hdr->hbd][vdc][0];
   72|  67.1k|        dq[i][2][1] = dav1d_dq_tbl[seq_hdr->hbd][vac][1];
   73|  67.1k|    }
   74|  67.1k|}
decode.c:setup_tile:
 2432|  72.6k|{
 2433|  72.6k|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2434|  72.6k|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2435|  72.6k|    const int col_sb_end = f->frame_hdr->tiling.col_start_sb[tile_col + 1];
 2436|  72.6k|    const int row_sb_start = f->frame_hdr->tiling.row_start_sb[tile_row];
 2437|  72.6k|    const int row_sb_end = f->frame_hdr->tiling.row_start_sb[tile_row + 1];
 2438|  72.6k|    const int sb_shift = f->sb_shift;
 2439|       |
 2440|  72.6k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2441|   217k|    for (int p = 0; p < 2; p++) {
  ------------------
  |  Branch (2441:21): [True: 145k, False: 72.6k]
  ------------------
 2442|   145k|        ts->frame_thread[p].pal_idx = f->frame_thread.pal_idx ?
  ------------------
  |  Branch (2442:39): [True: 0, False: 145k]
  ------------------
 2443|      0|            &f->frame_thread.pal_idx[(size_t)tile_start_off * size_mul[1] / 8] :
 2444|   145k|            NULL;
 2445|   145k|        ts->frame_thread[p].cbi = f->frame_thread.cbi ?
  ------------------
  |  Branch (2445:35): [True: 0, False: 145k]
  ------------------
 2446|      0|            &f->frame_thread.cbi[(size_t)tile_start_off * size_mul[0] / 64] :
 2447|   145k|            NULL;
 2448|   145k|        ts->frame_thread[p].cf = f->frame_thread.cf ?
  ------------------
  |  Branch (2448:34): [True: 0, False: 145k]
  ------------------
 2449|      0|            (uint8_t*)f->frame_thread.cf +
 2450|      0|                (((size_t)tile_start_off * size_mul[0]) >> !f->seq_hdr->hbd) :
 2451|   145k|            NULL;
 2452|   145k|    }
 2453|       |
 2454|  72.6k|    dav1d_cdf_thread_copy(&ts->cdf, &f->in_cdf);
 2455|  72.6k|    ts->last_qidx = f->frame_hdr->quant.yac;
 2456|  72.6k|    ts->last_delta_lf.u32 = 0;
 2457|       |
 2458|  72.6k|    dav1d_msac_init(&ts->msac, data, sz, f->frame_hdr->disable_cdf_update);
 2459|       |
 2460|  72.6k|    ts->tiling.row = tile_row;
 2461|  72.6k|    ts->tiling.col = tile_col;
 2462|  72.6k|    ts->tiling.col_start = col_sb_start << sb_shift;
 2463|  72.6k|    ts->tiling.col_end = imin(col_sb_end << sb_shift, f->bw);
 2464|  72.6k|    ts->tiling.row_start = row_sb_start << sb_shift;
 2465|  72.6k|    ts->tiling.row_end = imin(row_sb_end << sb_shift, f->bh);
 2466|       |
 2467|       |    // Reference Restoration Unit (used for exp coding)
 2468|  72.6k|    int sb_idx, unit_idx;
 2469|  72.6k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2469:9): [True: 0, False: 72.6k]
  ------------------
 2470|       |        // vertical components only
 2471|      0|        sb_idx = (ts->tiling.row_start >> 5) * f->sr_sb128w;
 2472|      0|        unit_idx = (ts->tiling.row_start & 16) >> 3;
 2473|  72.6k|    } else {
 2474|  72.6k|        sb_idx = (ts->tiling.row_start >> 5) * f->sb128w + col_sb128_start;
 2475|  72.6k|        unit_idx = ((ts->tiling.row_start & 16) >> 3) +
 2476|  72.6k|                   ((ts->tiling.col_start & 16) >> 4);
 2477|  72.6k|    }
 2478|   290k|    for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2478:21): [True: 217k, False: 72.6k]
  ------------------
 2479|   217k|        if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2479:13): [True: 216k, False: 1.41k]
  ------------------
 2480|   216k|            continue;
 2481|       |
 2482|  1.41k|        if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2482:13): [True: 0, False: 1.41k]
  ------------------
 2483|      0|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2483:32): [True: 0, False: 0]
  |  Branch (2483:37): [True: 0, False: 0]
  ------------------
 2484|      0|            const int d = f->frame_hdr->super_res.width_scale_denominator;
 2485|      0|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2486|      0|            const int rnd = (8 << unit_size_log2) - 1, shift = unit_size_log2 + 3;
 2487|      0|            const int x = ((4 * ts->tiling.col_start * d >> ss_hor) + rnd) >> shift;
 2488|      0|            const int px_x = x << (unit_size_log2 + ss_hor);
 2489|      0|            const int u_idx = unit_idx + ((px_x & 64) >> 6);
 2490|      0|            const int sb128x = px_x >> 7;
 2491|      0|            if (sb128x >= f->sr_sb128w) continue;
  ------------------
  |  Branch (2491:17): [True: 0, False: 0]
  ------------------
 2492|      0|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx + sb128x].lr[p][u_idx];
 2493|  1.41k|        } else {
 2494|  1.41k|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2495|  1.41k|        }
 2496|       |
 2497|  1.41k|        ts->lr_ref[p]->filter_v[0] = 3;
 2498|  1.41k|        ts->lr_ref[p]->filter_v[1] = -7;
 2499|  1.41k|        ts->lr_ref[p]->filter_v[2] = 15;
 2500|  1.41k|        ts->lr_ref[p]->filter_h[0] = 3;
 2501|  1.41k|        ts->lr_ref[p]->filter_h[1] = -7;
 2502|  1.41k|        ts->lr_ref[p]->filter_h[2] = 15;
 2503|  1.41k|        ts->lr_ref[p]->sgr_weights[0] = -32;
 2504|  1.41k|        ts->lr_ref[p]->sgr_weights[1] = 31;
 2505|  1.41k|    }
 2506|       |
 2507|  72.6k|    if (f->c->n_tc > 1) {
  ------------------
  |  Branch (2507:9): [True: 68.8k, False: 3.79k]
  ------------------
 2508|   206k|        for (int p = 0; p < 2; p++)
  ------------------
  |  Branch (2508:25): [True: 137k, False: 68.8k]
  ------------------
 2509|   137k|            atomic_init(&ts->progress[p], row_sb_start);
 2510|  68.8k|    }
 2511|  72.6k|}

refmvs.c:get_gmv_2d:
  482|   317k|{
  483|   317k|    switch (gmv->type) {
  484|      0|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 0, False: 317k]
  ------------------
  485|      0|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  486|      0|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  487|       |        // fall-through
  488|      0|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 317k]
  ------------------
  489|      0|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 0, False: 317k]
  ------------------
  490|      0|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|      0|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|      0|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|      0|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|      0|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|      0|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|      0|        const int shift = 16 - (3 - !hdr->hp);
  497|      0|        const int round = (1 << shift) >> 1;
  498|      0|        mv res = (mv) {
  499|      0|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|      0|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|      0|        };
  502|      0|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      0|            fix_int_mv_precision(&res);
  504|      0|        return res;
  505|      0|    }
  506|      0|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 0, False: 317k]
  ------------------
  507|      0|        mv res = (mv) {
  508|      0|            .y = gmv->matrix[0] >> 13,
  509|      0|            .x = gmv->matrix[1] >> 13,
  510|      0|        };
  511|      0|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  ------------------
  512|      0|            fix_int_mv_precision(&res);
  513|      0|        return res;
  514|      0|    }
  515|   317k|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 317k, False: 1]
  ------------------
  516|   317k|        return (mv) { .x = 0, .y = 0 };
  517|   317k|    }
  518|   317k|}
refmvs.c:fix_mv_precision:
  469|  50.8k|{
  470|  50.8k|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 0, False: 50.8k]
  ------------------
  471|      0|        fix_int_mv_precision(mv);
  472|  50.8k|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 32.1k, False: 18.6k]
  ------------------
  473|  32.1k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|  32.1k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|  32.1k|    }
  476|  50.8k|}
refmvs.c:get_poc_diff:
  239|   659k|{
  240|   659k|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 0, False: 659k]
  ------------------
  241|   659k|    const int mask = 1 << (order_hint_n_bits - 1);
  242|   659k|    const int diff = poc0 - poc1;
  243|   659k|    return (diff & (mask - 1)) - (diff & mask);
  244|   659k|}
decode.c:get_partition_ctx:
   87|  1.71M|{
   88|  1.71M|    return ((a->partition[xb8] >> (4 - bl)) & 1) +
   89|  1.71M|          (((l->partition[yb8] >> (4 - bl)) & 1) << 1);
   90|  1.71M|}
decode.c:get_intra_ctx:
   63|  1.14M|{
   64|  1.14M|    if (have_left) {
  ------------------
  |  Branch (64:9): [True: 917k, False: 230k]
  ------------------
   65|   917k|        if (have_top) {
  ------------------
  |  Branch (65:13): [True: 740k, False: 176k]
  ------------------
   66|   740k|            const int ctx = l->intra[yb4] + a->intra[xb4];
   67|   740k|            return ctx + (ctx == 2);
   68|   740k|        } else
   69|   176k|            return l->intra[yb4] * 2;
   70|   917k|    } else {
   71|   230k|        return have_top ? a->intra[xb4] * 2 : 0;
  ------------------
  |  Branch (71:16): [True: 174k, False: 55.8k]
  ------------------
   72|   230k|    }
   73|  1.14M|}
decode.c:get_tx_ctx:
   79|   804k|{
   80|   804k|    return (l->tx_intra[yb4] >= max_tx->lh) + (a->tx_intra[xb4] >= max_tx->lw);
   81|   804k|}
decode.c:fix_mv_precision:
  469|   198k|{
  470|   198k|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 0, False: 198k]
  ------------------
  471|      0|        fix_int_mv_precision(mv);
  472|   198k|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 130k, False: 68.5k]
  ------------------
  473|   130k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|   130k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|   130k|    }
  476|   198k|}
decode.c:av1_get_fwd_ref_ctx:
  307|   318k|{
  308|   318k|    int cnt[4] = { 0 };
  309|       |
  310|   318k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (310:9): [True: 248k, False: 70.0k]
  |  Branch (310:21): [True: 158k, False: 89.7k]
  ------------------
  311|   158k|        if (a->ref[0][xb4] < 4) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (311:13): [True: 158k, False: 18.4E]
  ------------------
  312|   158k|        if (a->comp_type[xb4] && a->ref[1][xb4] < 4) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (312:13): [True: 0, False: 158k]
  |  Branch (312:34): [True: 0, False: 0]
  ------------------
  313|   158k|    }
  314|       |
  315|   318k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (315:9): [True: 249k, False: 68.6k]
  |  Branch (315:22): [True: 159k, False: 90.0k]
  ------------------
  316|   159k|        if (l->ref[0][yb4] < 4) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (316:13): [True: 159k, False: 18.4E]
  ------------------
  317|   159k|        if (l->comp_type[yb4] && l->ref[1][yb4] < 4) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (317:13): [True: 0, False: 159k]
  |  Branch (317:34): [True: 0, False: 0]
  ------------------
  318|   159k|    }
  319|       |
  320|   318k|    cnt[0] += cnt[1];
  321|   318k|    cnt[2] += cnt[3];
  322|       |
  323|   318k|    return cnt[0] == cnt[2] ? 1 : cnt[0] < cnt[2] ? 0 : 2;
  ------------------
  |  Branch (323:12): [True: 88.6k, False: 229k]
  |  Branch (323:35): [True: 0, False: 229k]
  ------------------
  324|   318k|}
decode.c:av1_get_fwd_ref_1_ctx:
  330|   318k|{
  331|   318k|    int cnt[2] = { 0 };
  332|       |
  333|   318k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (333:9): [True: 248k, False: 69.9k]
  |  Branch (333:21): [True: 158k, False: 89.7k]
  ------------------
  334|   158k|        if (a->ref[0][xb4] < 2) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (334:13): [True: 158k, False: 18.4E]
  ------------------
  335|   158k|        if (a->comp_type[xb4] && a->ref[1][xb4] < 2) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (335:13): [True: 0, False: 158k]
  |  Branch (335:34): [True: 0, False: 0]
  ------------------
  336|   158k|    }
  337|       |
  338|   318k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (338:9): [True: 249k, False: 68.6k]
  |  Branch (338:22): [True: 159k, False: 90.0k]
  ------------------
  339|   159k|        if (l->ref[0][yb4] < 2) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (339:13): [True: 159k, False: 18.4E]
  ------------------
  340|   159k|        if (l->comp_type[yb4] && l->ref[1][yb4] < 2) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (340:13): [True: 0, False: 159k]
  |  Branch (340:34): [True: 0, False: 0]
  ------------------
  341|   159k|    }
  342|       |
  343|   318k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (343:12): [True: 88.6k, False: 229k]
  |  Branch (343:35): [True: 0, False: 229k]
  ------------------
  344|   318k|}
decode.c:av1_get_ref_ctx:
  287|   318k|{
  288|   318k|    int cnt[2] = { 0 };
  289|       |
  290|   318k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (290:9): [True: 248k, False: 70.0k]
  |  Branch (290:21): [True: 158k, False: 89.7k]
  ------------------
  291|   158k|        cnt[a->ref[0][xb4] >= 4]++;
  292|   158k|        if (a->comp_type[xb4]) cnt[a->ref[1][xb4] >= 4]++;
  ------------------
  |  Branch (292:13): [True: 0, False: 158k]
  ------------------
  293|   158k|    }
  294|       |
  295|   318k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (295:9): [True: 249k, False: 68.6k]
  |  Branch (295:22): [True: 159k, False: 90.0k]
  ------------------
  296|   159k|        cnt[l->ref[0][yb4] >= 4]++;
  297|   159k|        if (l->comp_type[yb4]) cnt[l->ref[1][yb4] >= 4]++;
  ------------------
  |  Branch (297:13): [True: 0, False: 159k]
  ------------------
  298|   159k|    }
  299|       |
  300|   318k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (300:12): [True: 88.6k, False: 229k]
  |  Branch (300:35): [True: 0, False: 229k]
  ------------------
  301|   318k|}
decode.c:get_drl_context:
  432|   139k|{
  433|   139k|    if (ref_mv_stack[ref_idx].weight >= 640)
  ------------------
  |  Branch (433:9): [True: 122k, False: 17.2k]
  ------------------
  434|   122k|        return ref_mv_stack[ref_idx + 1].weight < 640;
  435|       |
  436|  18.4E|    return ref_mv_stack[ref_idx + 1].weight < 640 ? 2 : 0;
  ------------------
  |  Branch (436:12): [True: 17.2k, False: 18.4E]
  ------------------
  437|   139k|}
decode.c:get_gmv_2d:
  482|  8.74k|{
  483|  8.74k|    switch (gmv->type) {
  484|      0|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 0, False: 8.74k]
  ------------------
  485|      0|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  486|      0|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  487|       |        // fall-through
  488|      0|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 8.74k]
  ------------------
  489|      0|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 0, False: 8.74k]
  ------------------
  490|      0|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|      0|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|      0|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|      0|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|      0|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|      0|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|      0|        const int shift = 16 - (3 - !hdr->hp);
  497|      0|        const int round = (1 << shift) >> 1;
  498|      0|        mv res = (mv) {
  499|      0|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|      0|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|      0|        };
  502|      0|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      0|            fix_int_mv_precision(&res);
  504|      0|        return res;
  505|      0|    }
  506|      0|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 0, False: 8.74k]
  ------------------
  507|      0|        mv res = (mv) {
  508|      0|            .y = gmv->matrix[0] >> 13,
  509|      0|            .x = gmv->matrix[1] >> 13,
  510|      0|        };
  511|      0|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  ------------------
  512|      0|            fix_int_mv_precision(&res);
  513|      0|        return res;
  514|      0|    }
  515|  8.73k|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 8.73k, False: 2]
  ------------------
  516|  8.73k|        return (mv) { .x = 0, .y = 0 };
  517|  8.74k|    }
  518|  8.74k|}
decode.c:get_filter_ctx:
  139|   169k|{
  140|   169k|    const int a_filter = (a->ref[0][xb4] == ref || a->ref[1][xb4] == ref) ?
  ------------------
  |  Branch (140:27): [True: 96.0k, False: 73.8k]
  |  Branch (140:52): [True: 18.4E, False: 73.8k]
  ------------------
  141|  96.3k|                         a->filter[dir][xb4] : DAV1D_N_SWITCHABLE_FILTERS;
  142|   169k|    const int l_filter = (l->ref[0][yb4] == ref || l->ref[1][yb4] == ref) ?
  ------------------
  |  Branch (142:27): [True: 95.4k, False: 74.5k]
  |  Branch (142:52): [True: 3, False: 74.4k]
  ------------------
  143|  95.7k|                         l->filter[dir][yb4] : DAV1D_N_SWITCHABLE_FILTERS;
  144|       |
  145|   169k|    if (a_filter == l_filter) {
  ------------------
  |  Branch (145:9): [True: 77.9k, False: 91.9k]
  ------------------
  146|  77.9k|        return comp * 4 + a_filter;
  147|  91.9k|    } else if (a_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (147:16): [True: 40.1k, False: 51.8k]
  ------------------
  148|  40.1k|        return comp * 4 + l_filter;
  149|  51.8k|    } else if (l_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (149:16): [True: 40.7k, False: 11.0k]
  ------------------
  150|  40.7k|        return comp * 4 + a_filter;
  151|  40.7k|    } else {
  152|  11.0k|        return comp * 4 + DAV1D_N_SWITCHABLE_FILTERS;
  153|  11.0k|    }
  154|   169k|}
decode.c:gather_top_partition_prob:
  106|  99.3k|{
  107|       |    // Exploit the fact that cdfs for PARTITION_V, PARTITION_SPLIT and
  108|       |    // PARTITION_T_TOP_SPLIT are neighbors.
  109|  99.3k|    unsigned out = in[PARTITION_V - 1] - in[PARTITION_T_TOP_SPLIT];
  110|       |    // Exploit the facts that cdfs for PARTITION_T_LEFT_SPLIT and
  111|       |    // PARTITION_T_RIGHT_SPLIT are neighbors, the probability for
  112|       |    // PARTITION_V4 is always zero, and the probability for
  113|       |    // PARTITION_T_RIGHT_SPLIT is zero in 128x128 blocks.
  114|  99.3k|    out += in[PARTITION_T_LEFT_SPLIT - 1];
  115|  99.3k|    if (bl != BL_128X128)
  ------------------
  |  Branch (115:9): [True: 99.3k, False: 18.4E]
  ------------------
  116|  99.3k|        out += in[PARTITION_V4 - 1] - in[PARTITION_T_RIGHT_SPLIT];
  117|  99.3k|    return out;
  118|  99.3k|}
decode.c:gather_left_partition_prob:
   94|   101k|{
   95|   101k|    unsigned out = in[PARTITION_H - 1] - in[PARTITION_H];
   96|       |    // Exploit the fact that cdfs for PARTITION_SPLIT, PARTITION_T_TOP_SPLIT,
   97|       |    // PARTITION_T_BOTTOM_SPLIT and PARTITION_T_LEFT_SPLIT are neighbors.
   98|   101k|    out += in[PARTITION_SPLIT - 1] - in[PARTITION_T_LEFT_SPLIT];
   99|   101k|    if (bl != BL_128X128)
  ------------------
  |  Branch (99:9): [True: 101k, False: 18.4E]
  ------------------
  100|   101k|        out += in[PARTITION_H4 - 1] - in[PARTITION_H4];
  101|   101k|    return out;
  102|   101k|}
recon_tmpl.c:get_uv_inter_txtp:
  122|   143k|{
  123|   143k|    if (uvt_dim->max == TX_32X32)
  ------------------
  |  Branch (123:9): [True: 3.15k, False: 140k]
  ------------------
  124|  3.15k|        return ytxtp == IDTX ? IDTX : DCT_DCT;
  ------------------
  |  Branch (124:16): [True: 64, False: 3.09k]
  ------------------
  125|   140k|    if (uvt_dim->min == TX_16X16 &&
  ------------------
  |  Branch (125:9): [True: 7.20k, False: 133k]
  ------------------
  126|  7.20k|        ((1 << ytxtp) & ((1 << H_FLIPADST) | (1 << V_FLIPADST) |
  ------------------
  |  Branch (126:9): [True: 0, False: 7.20k]
  ------------------
  127|  7.20k|                         (1 << H_ADST) | (1 << V_ADST))))
  128|      0|    {
  129|      0|        return DCT_DCT;
  130|      0|    }
  131|       |
  132|   140k|    return ytxtp;
  133|   140k|}

dav1d_film_grain_dsp_init_8bpc:
  425|  8.03k|COLD void bitfn(dav1d_film_grain_dsp_init)(Dav1dFilmGrainDSPContext *const c) {
  426|  8.03k|    c->generate_grain_y = generate_grain_y_c;
  427|  8.03k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = generate_grain_uv_420_c;
  428|  8.03k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = generate_grain_uv_422_c;
  429|  8.03k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = generate_grain_uv_444_c;
  430|       |
  431|  8.03k|    c->fgy_32x32xn = fgy_32x32xn_c;
  432|  8.03k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = fguv_32x32xn_420_c;
  433|  8.03k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = fguv_32x32xn_422_c;
  434|  8.03k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = fguv_32x32xn_444_c;
  435|       |
  436|  8.03k|#if HAVE_ASM
  437|       |#if ARCH_AARCH64 || ARCH_ARM
  438|       |    film_grain_dsp_init_arm(c);
  439|       |#elif ARCH_X86
  440|       |    film_grain_dsp_init_x86(c);
  441|       |#elif ARCH_RISCV
  442|       |    film_grain_dsp_init_riscv(c);
  443|       |#endif
  444|  8.03k|#endif
  445|  8.03k|}
dav1d_film_grain_dsp_init_16bpc:
  425|  3.35k|COLD void bitfn(dav1d_film_grain_dsp_init)(Dav1dFilmGrainDSPContext *const c) {
  426|  3.35k|    c->generate_grain_y = generate_grain_y_c;
  427|  3.35k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = generate_grain_uv_420_c;
  428|  3.35k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = generate_grain_uv_422_c;
  429|  3.35k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = generate_grain_uv_444_c;
  430|       |
  431|  3.35k|    c->fgy_32x32xn = fgy_32x32xn_c;
  432|  3.35k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = fguv_32x32xn_420_c;
  433|  3.35k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = fguv_32x32xn_422_c;
  434|  3.35k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = fguv_32x32xn_444_c;
  435|       |
  436|  3.35k|#if HAVE_ASM
  437|       |#if ARCH_AARCH64 || ARCH_ARM
  438|       |    film_grain_dsp_init_arm(c);
  439|       |#elif ARCH_X86
  440|       |    film_grain_dsp_init_x86(c);
  441|       |#elif ARCH_RISCV
  442|       |    film_grain_dsp_init_riscv(c);
  443|       |#endif
  444|  3.35k|#endif
  445|  3.35k|}

dav1d_init_get_bits:
   38|  68.3k|{
   39|  68.3k|    assert(sz);
  ------------------
  |  |  140|  68.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 68.3k]
  |  |  |  Branch (140:68): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
   40|  68.3k|    c->ptr = c->ptr_start = data;
   41|  68.3k|    c->ptr_end = &c->ptr_start[sz];
   42|  68.3k|    c->state = 0;
   43|  68.3k|    c->bits_left = 0;
   44|  68.3k|    c->error = 0;
   45|  68.3k|}
dav1d_get_bit:
   47|  2.01M|unsigned dav1d_get_bit(GetBits *const c) {
   48|  2.01M|    if (!c->bits_left) {
  ------------------
  |  Branch (48:9): [True: 316k, False: 1.70M]
  ------------------
   49|   316k|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (49:13): [True: 0, False: 316k]
  ------------------
   50|      0|            c->error = 1;
   51|   316k|        } else {
   52|   316k|            const unsigned state = *c->ptr++;
   53|   316k|            c->bits_left = 7;
   54|   316k|            c->state = (uint64_t) state << 57;
   55|   316k|            return state >> 7;
   56|   316k|        }
   57|   316k|    }
   58|       |
   59|  1.70M|    const uint64_t state = c->state;
   60|  1.70M|    c->bits_left--;
   61|  1.70M|    c->state = state << 1;
   62|  1.70M|    return (unsigned) (state >> 63);
   63|  2.01M|}
dav1d_get_bits:
   81|  1.50M|type name(GetBits *const c, const int n) {      \
   82|  1.50M|    assert(n > 0 && n <= 32);                   \
  ------------------
  |  |  140|  3.00M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 1.50M, False: 0]
  |  |  |  Branch (140:30): [True: 1.50M, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 1.50M]
  |  |  ------------------
  ------------------
   83|  1.50M|    /* Unsigned cast avoids refill after eob */ \
   84|  1.50M|    if ((unsigned) n > (unsigned) c->bits_left) \
  ------------------
  |  Branch (84:9): [True: 785k, False: 715k]
  ------------------
   85|  1.50M|        refill(c, n);                           \
   86|  1.50M|    const uint64_t state = c->state;            \
   87|  1.50M|    c->bits_left -= n;                          \
   88|  1.50M|    c->state = state << n;                      \
   89|  1.50M|    return (type) ((type64) state >> (64 - n)); \
   90|  1.50M|}
dav1d_get_sbits:
   81|  22.6k|type name(GetBits *const c, const int n) {      \
   82|  22.6k|    assert(n > 0 && n <= 32);                   \
  ------------------
  |  |  140|  45.2k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 22.6k, False: 0]
  |  |  |  Branch (140:30): [True: 22.6k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 22.6k]
  |  |  ------------------
  ------------------
   83|  22.6k|    /* Unsigned cast avoids refill after eob */ \
   84|  22.6k|    if ((unsigned) n > (unsigned) c->bits_left) \
  ------------------
  |  Branch (84:9): [True: 18.1k, False: 4.47k]
  ------------------
   85|  22.6k|        refill(c, n);                           \
   86|  22.6k|    const uint64_t state = c->state;            \
   87|  22.6k|    c->bits_left -= n;                          \
   88|  22.6k|    c->state = state << n;                      \
   89|  22.6k|    return (type) ((type64) state >> (64 - n)); \
   90|  22.6k|}
dav1d_get_uleb128:
   95|  68.3k|unsigned dav1d_get_uleb128(GetBits *const c) {
   96|  68.3k|    uint64_t val = 0;
   97|  68.3k|    unsigned i = 0, more;
   98|       |
   99|  89.0k|    do {
  100|  89.0k|        const int v = dav1d_get_bits(c, 8);
  101|  89.0k|        more = v & 0x80;
  102|  89.0k|        val |= ((uint64_t) (v & 0x7F)) << i;
  103|  89.0k|        i += 7;
  104|  89.0k|    } while (more && i < 56);
  ------------------
  |  Branch (104:14): [True: 20.7k, False: 68.3k]
  |  Branch (104:22): [True: 20.7k, False: 0]
  ------------------
  105|       |
  106|  68.3k|    if (val > UINT32_MAX || more) {
  ------------------
  |  Branch (106:9): [True: 0, False: 68.3k]
  |  Branch (106:29): [True: 0, False: 68.3k]
  ------------------
  107|      0|        c->error = 1;
  108|      0|        return 0;
  109|      0|    }
  110|       |
  111|  68.3k|    return (unsigned) val;
  112|  68.3k|}
getbits.c:refill:
   65|   803k|static inline void refill(GetBits *const c, const int n) {
   66|   803k|    assert(c->bits_left >= 0 && c->bits_left < 32);
  ------------------
  |  |  140|  1.60M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 803k, False: 0]
  |  |  |  Branch (140:30): [True: 803k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 803k]
  |  |  ------------------
  ------------------
   67|   803k|    unsigned state = 0;
   68|   892k|    do {
   69|   892k|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (69:13): [True: 0, False: 892k]
  ------------------
   70|      0|            c->error = 1;
   71|      0|            if (state) break;
  ------------------
  |  Branch (71:17): [True: 0, False: 0]
  ------------------
   72|      0|            return;
   73|      0|        }
   74|   892k|        state = (state << 8) | *c->ptr++;
   75|   892k|        c->bits_left += 8;
   76|   892k|    } while (n > c->bits_left);
  ------------------
  |  Branch (76:14): [True: 89.7k, False: 803k]
  ------------------
   77|   803k|    c->state |= (uint64_t) state << (64 - c->bits_left);
   78|   803k|}

obu.c:dav1d_bytealign_get_bits:
   52|  91.0k|static inline void dav1d_bytealign_get_bits(GetBits *c) {
   53|       |    // bits_left is never more than 7, because it is only incremented
   54|       |    // by refill(), called by dav1d_get_bits and that never reads more
   55|       |    // than 7 bits more than it needs.
   56|       |    //
   57|       |    // If this wasn't true, we would need to work out how many bits to
   58|       |    // discard (bits_left % 8), subtract that from bits_left and then
   59|       |    // shift state right by that amount.
   60|  91.0k|    assert(c->bits_left <= 7);
  ------------------
  |  |  140|  91.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 91.0k]
  |  |  |  Branch (140:68): [Folded, False: 91.0k]
  |  |  ------------------
  ------------------
   61|       |
   62|  91.0k|    c->bits_left = 0;
   63|  91.0k|    c->state = 0;
   64|  91.0k|}

dav1d_init_intra_edge_tree:
  126|      1|COLD void dav1d_init_intra_edge_tree(void) {
  127|       |    // This function is guaranteed to be called only once
  128|      1|    struct ModeSelMem mem;
  129|       |
  130|      1|    mem.nwc[BL_128X128] = &nodes.branch_sb128[1];
  131|      1|    mem.nwc[BL_64X64] = &nodes.branch_sb128[1 + 4];
  132|      1|    mem.nwc[BL_32X32] = &nodes.branch_sb128[1 + 4 + 16];
  133|      1|    mem.nt = nodes.tip_sb128;
  134|      1|    init_mode_node(nodes.branch_sb128, BL_128X128, &mem, 1, 0);
  135|      1|    assert(mem.nwc[BL_128X128] == &nodes.branch_sb128[1 + 4]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  136|      1|    assert(mem.nwc[BL_64X64] == &nodes.branch_sb128[1 + 4 + 16]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  137|      1|    assert(mem.nwc[BL_32X32] == &nodes.branch_sb128[1 + 4 + 16 + 64]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  138|      1|    assert(mem.nt == &nodes.tip_sb128[256]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  139|       |
  140|      1|    mem.nwc[BL_128X128] = NULL;
  141|      1|    mem.nwc[BL_64X64] = &nodes.branch_sb64[1];
  142|      1|    mem.nwc[BL_32X32] = &nodes.branch_sb64[1 + 4];
  143|      1|    mem.nt = nodes.tip_sb64;
  144|      1|    init_mode_node(nodes.branch_sb64, BL_64X64, &mem, 1, 0);
  145|      1|    assert(mem.nwc[BL_64X64] == &nodes.branch_sb64[1 + 4]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  146|      1|    assert(mem.nwc[BL_32X32] == &nodes.branch_sb64[1 + 4 + 16]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  147|      1|    assert(mem.nt == &nodes.tip_sb64[64]);
  ------------------
  |  |  140|      1|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1]
  |  |  |  Branch (140:68): [Folded, False: 1]
  |  |  ------------------
  ------------------
  148|      1|}
intra_edge.c:init_mode_node:
  101|    106|{
  102|    106|    init_edges(&nwc->node, bl,
  103|    106|               (top_has_right ? EDGE_ALL_TOP_HAS_RIGHT : 0) |
  ------------------
  |  Branch (103:17): [True: 73, False: 33]
  ------------------
  104|    106|               (left_has_bottom ? EDGE_ALL_LEFT_HAS_BOTTOM : 0));
  ------------------
  |  Branch (104:17): [True: 33, False: 73]
  ------------------
  105|    106|    if (bl == BL_16X16) {
  ------------------
  |  Branch (105:9): [True: 80, False: 26]
  ------------------
  106|    400|        for (int n = 0; n < 4; n++) {
  ------------------
  |  Branch (106:25): [True: 320, False: 80]
  ------------------
  107|    320|            EdgeTip *const nt = mem->nt++;
  108|    320|            nwc->split_offset[n] = PTR_OFFSET(nwc, nt);
  ------------------
  |  |   94|    320|#define PTR_OFFSET(a, b) ((uint16_t)((uintptr_t)(b) - (uintptr_t)(a)))
  ------------------
  109|    320|            init_edges(&nt->node, bl + 1,
  110|    320|                       ((n == 3 || (n == 1 && !top_has_right)) ? 0 :
  ------------------
  |  Branch (110:26): [True: 80, False: 240]
  |  Branch (110:37): [True: 80, False: 160]
  |  Branch (110:47): [True: 26, False: 54]
  ------------------
  111|    320|                        EDGE_ALL_TOP_HAS_RIGHT) |
  112|    320|                       (!(n == 0 || (n == 2 && left_has_bottom)) ? 0 :
  ------------------
  |  Branch (112:27): [True: 80, False: 240]
  |  Branch (112:38): [True: 80, False: 160]
  |  Branch (112:48): [True: 26, False: 54]
  ------------------
  113|    320|                        EDGE_ALL_LEFT_HAS_BOTTOM));
  114|    320|        }
  115|     80|    } else {
  116|    130|        for (int n = 0; n < 4; n++) {
  ------------------
  |  Branch (116:25): [True: 104, False: 26]
  ------------------
  117|    104|            EdgeBranch *const nwc_child = mem->nwc[bl]++;
  118|    104|            nwc->split_offset[n] = PTR_OFFSET(nwc, nwc_child);
  ------------------
  |  |   94|    104|#define PTR_OFFSET(a, b) ((uint16_t)((uintptr_t)(b) - (uintptr_t)(a)))
  ------------------
  119|    104|            init_mode_node(nwc_child, bl + 1, mem,
  120|    104|                           !(n == 3 || (n == 1 && !top_has_right)),
  ------------------
  |  Branch (120:30): [True: 26, False: 78]
  |  Branch (120:41): [True: 26, False: 52]
  |  Branch (120:51): [True: 7, False: 19]
  ------------------
  121|    104|                           n == 0 || (n == 2 && left_has_bottom));
  ------------------
  |  Branch (121:28): [True: 26, False: 78]
  |  Branch (121:39): [True: 26, False: 52]
  |  Branch (121:49): [True: 7, False: 19]
  ------------------
  122|    104|        }
  123|     26|    }
  124|    106|}
intra_edge.c:init_edges:
   58|    426|{
   59|    426|    node->o = edge_flags;
   60|    426|    node->h[0] = edge_flags | EDGE_ALL_LEFT_HAS_BOTTOM;
   61|    426|    node->v[0] = edge_flags | EDGE_ALL_TOP_HAS_RIGHT;
   62|       |
   63|    426|    if (bl == BL_8X8) {
  ------------------
  |  Branch (63:9): [True: 320, False: 106]
  ------------------
   64|    320|        EdgeTip *const nt = (EdgeTip *) node;
   65|       |
   66|    320|        node->h[1] = edge_flags & (EDGE_ALL_LEFT_HAS_BOTTOM |
   67|    320|                                   EDGE_I420_TOP_HAS_RIGHT);
   68|    320|        node->v[1] = edge_flags & (EDGE_ALL_TOP_HAS_RIGHT |
   69|    320|                                   EDGE_I420_LEFT_HAS_BOTTOM |
   70|    320|                                   EDGE_I422_LEFT_HAS_BOTTOM);
   71|       |
   72|    320|        nt->split[0] = (edge_flags & EDGE_ALL_TOP_HAS_RIGHT) |
   73|    320|                       EDGE_I422_LEFT_HAS_BOTTOM;
   74|    320|        nt->split[1] = edge_flags | EDGE_I444_TOP_HAS_RIGHT;
   75|    320|        nt->split[2] = edge_flags & (EDGE_I420_TOP_HAS_RIGHT |
   76|    320|                                     EDGE_I420_LEFT_HAS_BOTTOM |
   77|    320|                                     EDGE_I422_LEFT_HAS_BOTTOM);
   78|    320|    } else {
   79|    106|        EdgeBranch *const nwc = (EdgeBranch *) node;
   80|       |
   81|    106|        node->h[1] = edge_flags & EDGE_ALL_LEFT_HAS_BOTTOM;
   82|    106|        node->v[1] = edge_flags & EDGE_ALL_TOP_HAS_RIGHT;
   83|       |
   84|    106|        nwc->h4 = EDGE_ALL_LEFT_HAS_BOTTOM;
   85|    106|        nwc->v4 = EDGE_ALL_TOP_HAS_RIGHT;
   86|    106|        if (bl == BL_16X16) {
  ------------------
  |  Branch (86:13): [True: 80, False: 26]
  ------------------
   87|     80|            nwc->h4 |= edge_flags & EDGE_I420_TOP_HAS_RIGHT;
   88|     80|            nwc->v4 |= edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM |
   89|     80|                                     EDGE_I422_LEFT_HAS_BOTTOM);
   90|     80|        }
   91|    106|    }
   92|    426|}

recon_tmpl.c:sm_flag:
   95|  1.86M|static inline int sm_flag(const BlockContext *const b, const int idx) {
   96|  1.86M|    if (!b->intra[idx]) return 0;
  ------------------
  |  Branch (96:9): [True: 501k, False: 1.35M]
  ------------------
   97|  1.35M|    const enum IntraPredMode m = b->mode[idx];
   98|  1.36M|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (98:13): [True: 18.4E, False: 1.36M]
  |  Branch (98:33): [True: 18.4E, False: 1.36M]
  ------------------
   99|  1.36M|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|    994|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (99:13): [True: 18.4E, False: 1.36M]
  ------------------
  100|  1.86M|}
recon_tmpl.c:sm_uv_flag:
  102|   784k|static inline int sm_uv_flag(const BlockContext *const b, const int idx) {
  103|   784k|    const enum IntraPredMode m = b->uvmode[idx];
  104|   784k|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (104:13): [True: 54.0k, False: 730k]
  |  Branch (104:33): [True: 32.7k, False: 697k]
  ------------------
  105|   697k|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|   120k|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (105:13): [True: 31.5k, False: 666k]
  ------------------
  106|   784k|}

dav1d_prepare_intra_edges_8bpc:
   86|  2.09M|{
   87|  2.09M|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   58|  2.09M|#define bitdepth_from_max(x) 8
  ------------------
   88|  2.09M|    assert(y < h && x < w);
  ------------------
  |  |  140|  4.20M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 2.10M, False: 18.4E]
  |  |  |  Branch (140:30): [True: 2.10M, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 2.09M]
  |  |  ------------------
  ------------------
   89|       |
   90|  2.09M|    switch (mode) {
   91|  51.1k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 51.1k, False: 2.04M]
  ------------------
   92|   112k|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 61.4k, False: 2.03M]
  ------------------
   93|   119k|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 7.04k, False: 2.09M]
  ------------------
   94|   126k|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 7.14k, False: 2.09M]
  ------------------
   95|   132k|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 5.40k, False: 2.09M]
  ------------------
   96|   138k|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 6.00k, False: 2.09M]
  ------------------
   97|   149k|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 10.8k, False: 2.08M]
  ------------------
   98|   155k|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 6.35k, False: 2.09M]
  ------------------
   99|   155k|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|   155k|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 53.7k, False: 101k]
  ------------------
  102|  53.7k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 24.4k, False: 29.3k]
  |  Branch (102:35): [True: 23.9k, False: 452]
  ------------------
  103|   101k|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 46.4k, False: 55.1k]
  ------------------
  104|  46.4k|            mode = Z2_PRED;
  105|  55.1k|        else
  106|  55.1k|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 22.4k, False: 32.7k]
  |  Branch (106:36): [True: 22.0k, False: 409]
  ------------------
  107|   155k|        break;
  108|   149k|    }
  109|  1.22M|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 1.22M, False: 878k]
  ------------------
  110|  1.26M|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 41.8k, False: 2.05M]
  ------------------
  111|  1.26M|        mode = av1_mode_conv[mode][have_left][have_top];
  112|  1.26M|        break;
  113|   704k|    default:
  ------------------
  |  Branch (113:5): [True: 704k, False: 1.39M]
  ------------------
  114|   704k|        break;
  115|  2.09M|    }
  116|       |
  117|  2.09M|    const pixel *dst_top;
  118|  2.09M|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 1.77M, False: 317k]
  ------------------
  119|  1.77M|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 1.72M, False: 45.4k]
  ------------------
  120|  45.4k|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 18.1k, False: 27.2k]
  ------------------
  121|  27.2k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 27.2k, False: 0]
  |  Branch (121:58): [True: 6.97k, False: 20.3k]
  ------------------
  122|  1.75M|    {
  123|  1.75M|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 36.2k, False: 1.71M]
  ------------------
  124|  36.2k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|  1.71M|        } else {
  126|  1.71M|            dst_top = &dst[-PXSTRIDE(stride)];
  ------------------
  |  |   53|  1.71M|#define PXSTRIDE(x) (x)
  ------------------
  127|  1.71M|        }
  128|  1.75M|    }
  129|       |
  130|  2.09M|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 1.86M, False: 226k]
  ------------------
  131|  1.86M|        const int sz = th << 2;
  132|  1.86M|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|  1.86M|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 1.74M, False: 120k]
  ------------------
  135|  1.74M|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  12.1M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 10.4M, False: 1.74M]
  ------------------
  138|  10.4M|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  ------------------
  |  |   53|  10.4M|#define PXSTRIDE(x) (x)
  ------------------
  139|  1.74M|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 669, False: 1.74M]
  ------------------
  140|    669|                pixel_set(left, left[sz - px_have], sz - px_have);
  ------------------
  |  |   48|    669|#define pixel_set memset
  ------------------
  141|  1.74M|        } else {
  142|   120k|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  |   48|   120k|#define pixel_set memset
  ------------------
  |  Branch (142:29): [True: 94.0k, False: 26.8k]
  ------------------
  143|   120k|        }
  144|       |
  145|  1.86M|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 22.0k, False: 1.84M]
  ------------------
  146|  22.0k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 0, False: 22.0k]
  |  Branch (146:56): [True: 2.23k, False: 19.7k]
  ------------------
  147|  22.0k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|  22.0k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 6.62k, False: 15.3k]
  ------------------
  150|  6.62k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|  43.0k|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 36.4k, False: 6.62k]
  ------------------
  153|  36.4k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  ------------------
  |  |   53|  36.4k|#define PXSTRIDE(x) (x)
  ------------------
  154|  6.62k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 8, False: 6.61k]
  ------------------
  155|      8|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  ------------------
  |  |   48|      8|#define pixel_set memset
  ------------------
  156|  15.3k|            } else {
  157|  15.3k|                pixel_set(left - sz, left[0], sz);
  ------------------
  |  |   48|  15.3k|#define pixel_set memset
  ------------------
  158|  15.3k|            }
  159|  22.0k|        }
  160|  1.86M|    }
  161|       |
  162|  2.09M|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 1.85M, False: 241k]
  ------------------
  163|  1.85M|        const int sz = tw << 2;
  164|  1.85M|        pixel *const top = &topleft_out[1];
  165|       |
  166|  1.85M|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 1.72M, False: 123k]
  ------------------
  167|  1.72M|            const int px_have = imin(sz, (w - x) << 2);
  168|  1.72M|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   47|  1.72M|#define pixel_copy memcpy
  ------------------
  169|  1.72M|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 597, False: 1.72M]
  ------------------
  170|    597|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  ------------------
  |  |   48|    597|#define pixel_set memset
  ------------------
  171|  1.72M|        } else {
  172|   123k|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  |   48|   123k|#define pixel_set memset
  ------------------
  |  Branch (172:28): [True: 96.2k, False: 27.0k]
  ------------------
  173|   123k|        }
  174|       |
  175|  1.85M|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 23.9k, False: 1.82M]
  ------------------
  176|  23.9k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 0, False: 23.9k]
  |  Branch (176:53): [True: 2.37k, False: 21.6k]
  ------------------
  177|  23.9k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|  23.9k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 15.9k, False: 7.99k]
  ------------------
  180|  15.9k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|  15.9k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   47|  15.9k|#define pixel_copy memcpy
  ------------------
  183|  15.9k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 10, False: 15.9k]
  ------------------
  184|     10|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  ------------------
  |  |   48|     10|#define pixel_set memset
  ------------------
  185|     10|                              sz - px_have);
  186|  15.9k|            } else {
  187|  7.99k|                pixel_set(top + sz, top[sz - 1], sz);
  ------------------
  |  |   48|  7.99k|#define pixel_set memset
  ------------------
  188|  7.99k|            }
  189|  23.9k|        }
  190|  1.85M|    }
  191|       |
  192|  2.09M|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 683k, False: 1.40M]
  ------------------
  193|   683k|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 592k, False: 91.2k]
  ------------------
  194|   592k|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 519k, False: 72.6k]
  ------------------
  195|  91.2k|        else
  196|  91.2k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 72.0k, False: 19.1k]
  ------------------
  197|       |
  198|   683k|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 46.4k, False: 637k]
  |  Branch (198:32): [True: 481, False: 45.9k]
  |  Branch (198:48): [True: 481, False: 0]
  ------------------
  199|    481|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|    481|                            topleft_out[0] * 6 + 8) >> 4;
  201|   683k|    }
  202|       |
  203|  2.09M|    return mode;
  204|  2.09M|}
dav1d_prepare_intra_edges_16bpc:
   86|   264k|{
   87|   264k|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   75|   264k|#define bitdepth_from_max(bitdepth_max) (32 - clz(bitdepth_max))
  ------------------
   88|   264k|    assert(y < h && x < w);
  ------------------
  |  |  140|   528k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 264k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 264k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 264k]
  |  |  ------------------
  ------------------
   89|       |
   90|   264k|    switch (mode) {
   91|  13.3k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 13.3k, False: 250k]
  ------------------
   92|  29.1k|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 15.8k, False: 248k]
  ------------------
   93|  31.0k|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 1.91k, False: 262k]
  ------------------
   94|  32.7k|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 1.73k, False: 262k]
  ------------------
   95|  34.0k|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 1.26k, False: 262k]
  ------------------
   96|  35.5k|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 1.52k, False: 262k]
  ------------------
   97|  37.7k|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 2.17k, False: 261k]
  ------------------
   98|  39.3k|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 1.54k, False: 262k]
  ------------------
   99|  39.3k|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|  39.3k|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 15.6k, False: 23.6k]
  ------------------
  102|  15.6k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 4.64k, False: 10.9k]
  |  Branch (102:35): [True: 4.34k, False: 297]
  ------------------
  103|  23.6k|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 7.60k, False: 16.0k]
  ------------------
  104|  7.60k|            mode = Z2_PRED;
  105|  16.0k|        else
  106|  16.0k|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 3.76k, False: 12.2k]
  |  Branch (106:36): [True: 3.63k, False: 136]
  ------------------
  107|  39.3k|        break;
  108|  37.7k|    }
  109|   128k|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 128k, False: 135k]
  ------------------
  110|   138k|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 9.64k, False: 254k]
  ------------------
  111|   138k|        mode = av1_mode_conv[mode][have_left][have_top];
  112|   138k|        break;
  113|  87.5k|    default:
  ------------------
  |  Branch (113:5): [True: 87.5k, False: 176k]
  ------------------
  114|  87.5k|        break;
  115|   264k|    }
  116|       |
  117|   264k|    const pixel *dst_top;
  118|   264k|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 189k, False: 74.2k]
  ------------------
  119|   189k|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 177k, False: 12.7k]
  ------------------
  120|  12.7k|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 2.39k, False: 10.3k]
  ------------------
  121|  10.3k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 10.3k, False: 0]
  |  Branch (121:58): [True: 2.88k, False: 7.46k]
  ------------------
  122|   182k|    {
  123|   182k|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 1.90k, False: 180k]
  ------------------
  124|  1.90k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|   180k|        } else {
  126|   180k|            dst_top = &dst[-PXSTRIDE(stride)];
  127|   180k|        }
  128|   182k|    }
  129|       |
  130|   264k|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 205k, False: 58.8k]
  ------------------
  131|   205k|        const int sz = th << 2;
  132|   205k|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|   205k|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 172k, False: 32.3k]
  ------------------
  135|   172k|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  1.11M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 940k, False: 172k]
  ------------------
  138|   940k|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  139|   172k|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 73, False: 172k]
  ------------------
  140|     73|                pixel_set(left, left[sz - px_have], sz - px_have);
  141|   172k|        } else {
  142|  32.3k|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  Branch (142:29): [True: 23.4k, False: 8.87k]
  ------------------
  143|  32.3k|        }
  144|       |
  145|   205k|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 3.63k, False: 201k]
  ------------------
  146|  3.63k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 0, False: 3.63k]
  |  Branch (146:56): [True: 635, False: 2.99k]
  ------------------
  147|  3.63k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|  3.63k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 1.16k, False: 2.46k]
  ------------------
  150|  1.16k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|  6.21k|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 5.04k, False: 1.16k]
  ------------------
  153|  5.04k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  154|  1.16k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 1, False: 1.16k]
  ------------------
  155|      1|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  156|  2.46k|            } else {
  157|  2.46k|                pixel_set(left - sz, left[0], sz);
  158|  2.46k|            }
  159|  3.63k|        }
  160|   205k|    }
  161|       |
  162|   264k|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 206k, False: 57.2k]
  ------------------
  163|   206k|        const int sz = tw << 2;
  164|   206k|        pixel *const top = &topleft_out[1];
  165|       |
  166|   206k|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 176k, False: 29.9k]
  ------------------
  167|   176k|            const int px_have = imin(sz, (w - x) << 2);
  168|   176k|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   65|   176k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  169|   176k|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 96, False: 176k]
  ------------------
  170|     96|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  171|   176k|        } else {
  172|  29.9k|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  Branch (172:28): [True: 21.4k, False: 8.46k]
  ------------------
  173|  29.9k|        }
  174|       |
  175|   206k|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 4.34k, False: 202k]
  ------------------
  176|  4.34k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 0, False: 4.34k]
  |  Branch (176:53): [True: 924, False: 3.42k]
  ------------------
  177|  4.34k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|  4.34k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 2.53k, False: 1.81k]
  ------------------
  180|  2.53k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|  2.53k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   65|  2.53k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  183|  2.53k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 5, False: 2.53k]
  ------------------
  184|      5|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  185|      5|                              sz - px_have);
  186|  2.53k|            } else {
  187|  1.81k|                pixel_set(top + sz, top[sz - 1], sz);
  188|  1.81k|            }
  189|  4.34k|        }
  190|   206k|    }
  191|       |
  192|   264k|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 91.9k, False: 172k]
  ------------------
  193|  91.9k|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 68.3k, False: 23.5k]
  ------------------
  194|  68.3k|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 52.3k, False: 16.0k]
  ------------------
  195|  23.5k|        else
  196|  23.5k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 17.9k, False: 5.63k]
  ------------------
  197|       |
  198|  91.9k|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 7.60k, False: 84.3k]
  |  Branch (198:32): [True: 45, False: 7.55k]
  |  Branch (198:48): [True: 45, False: 0]
  ------------------
  199|     45|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|     45|                            topleft_out[0] * 6 + 8) >> 4;
  201|  91.9k|    }
  202|       |
  203|   264k|    return mode;
  204|   264k|}

dav1d_intra_pred_dsp_init_8bpc:
  744|  8.03k|COLD void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) {
  745|  8.03k|    c->intra_pred[DC_PRED      ] = ipred_dc_c;
  746|  8.03k|    c->intra_pred[DC_128_PRED  ] = ipred_dc_128_c;
  747|  8.03k|    c->intra_pred[TOP_DC_PRED  ] = ipred_dc_top_c;
  748|  8.03k|    c->intra_pred[LEFT_DC_PRED ] = ipred_dc_left_c;
  749|  8.03k|    c->intra_pred[HOR_PRED     ] = ipred_h_c;
  750|  8.03k|    c->intra_pred[VERT_PRED    ] = ipred_v_c;
  751|  8.03k|    c->intra_pred[PAETH_PRED   ] = ipred_paeth_c;
  752|  8.03k|    c->intra_pred[SMOOTH_PRED  ] = ipred_smooth_c;
  753|  8.03k|    c->intra_pred[SMOOTH_V_PRED] = ipred_smooth_v_c;
  754|  8.03k|    c->intra_pred[SMOOTH_H_PRED] = ipred_smooth_h_c;
  755|  8.03k|    c->intra_pred[Z1_PRED      ] = ipred_z1_c;
  756|  8.03k|    c->intra_pred[Z2_PRED      ] = ipred_z2_c;
  757|  8.03k|    c->intra_pred[Z3_PRED      ] = ipred_z3_c;
  758|  8.03k|    c->intra_pred[FILTER_PRED  ] = ipred_filter_c;
  759|       |
  760|  8.03k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I420 - 1] = cfl_ac_420_c;
  761|  8.03k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I422 - 1] = cfl_ac_422_c;
  762|  8.03k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I444 - 1] = cfl_ac_444_c;
  763|       |
  764|  8.03k|    c->cfl_pred[DC_PRED     ] = ipred_cfl_c;
  765|  8.03k|    c->cfl_pred[DC_128_PRED ] = ipred_cfl_128_c;
  766|  8.03k|    c->cfl_pred[TOP_DC_PRED ] = ipred_cfl_top_c;
  767|  8.03k|    c->cfl_pred[LEFT_DC_PRED] = ipred_cfl_left_c;
  768|       |
  769|  8.03k|    c->pal_pred = pal_pred_c;
  770|       |
  771|  8.03k|#if HAVE_ASM
  772|       |#if ARCH_AARCH64 || ARCH_ARM
  773|       |    intra_pred_dsp_init_arm(c);
  774|       |#elif ARCH_RISCV
  775|       |    intra_pred_dsp_init_riscv(c);
  776|       |#elif ARCH_X86
  777|       |    intra_pred_dsp_init_x86(c);
  778|       |#elif ARCH_LOONGARCH64
  779|       |    intra_pred_dsp_init_loongarch(c);
  780|       |#endif
  781|  8.03k|#endif
  782|  8.03k|}
dav1d_intra_pred_dsp_init_16bpc:
  744|  3.35k|COLD void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) {
  745|  3.35k|    c->intra_pred[DC_PRED      ] = ipred_dc_c;
  746|  3.35k|    c->intra_pred[DC_128_PRED  ] = ipred_dc_128_c;
  747|  3.35k|    c->intra_pred[TOP_DC_PRED  ] = ipred_dc_top_c;
  748|  3.35k|    c->intra_pred[LEFT_DC_PRED ] = ipred_dc_left_c;
  749|  3.35k|    c->intra_pred[HOR_PRED     ] = ipred_h_c;
  750|  3.35k|    c->intra_pred[VERT_PRED    ] = ipred_v_c;
  751|  3.35k|    c->intra_pred[PAETH_PRED   ] = ipred_paeth_c;
  752|  3.35k|    c->intra_pred[SMOOTH_PRED  ] = ipred_smooth_c;
  753|  3.35k|    c->intra_pred[SMOOTH_V_PRED] = ipred_smooth_v_c;
  754|  3.35k|    c->intra_pred[SMOOTH_H_PRED] = ipred_smooth_h_c;
  755|  3.35k|    c->intra_pred[Z1_PRED      ] = ipred_z1_c;
  756|  3.35k|    c->intra_pred[Z2_PRED      ] = ipred_z2_c;
  757|  3.35k|    c->intra_pred[Z3_PRED      ] = ipred_z3_c;
  758|  3.35k|    c->intra_pred[FILTER_PRED  ] = ipred_filter_c;
  759|       |
  760|  3.35k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I420 - 1] = cfl_ac_420_c;
  761|  3.35k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I422 - 1] = cfl_ac_422_c;
  762|  3.35k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I444 - 1] = cfl_ac_444_c;
  763|       |
  764|  3.35k|    c->cfl_pred[DC_PRED     ] = ipred_cfl_c;
  765|  3.35k|    c->cfl_pred[DC_128_PRED ] = ipred_cfl_128_c;
  766|  3.35k|    c->cfl_pred[TOP_DC_PRED ] = ipred_cfl_top_c;
  767|  3.35k|    c->cfl_pred[LEFT_DC_PRED] = ipred_cfl_left_c;
  768|       |
  769|  3.35k|    c->pal_pred = pal_pred_c;
  770|       |
  771|  3.35k|#if HAVE_ASM
  772|       |#if ARCH_AARCH64 || ARCH_ARM
  773|       |    intra_pred_dsp_init_arm(c);
  774|       |#elif ARCH_RISCV
  775|       |    intra_pred_dsp_init_riscv(c);
  776|       |#elif ARCH_X86
  777|       |    intra_pred_dsp_init_x86(c);
  778|       |#elif ARCH_LOONGARCH64
  779|       |    intra_pred_dsp_init_loongarch(c);
  780|       |#endif
  781|  3.35k|#endif
  782|  3.35k|}

itx_1d.c:inv_dct4_1d_internal_c:
   68|  13.7k|{
   69|  13.7k|    assert(stride > 0);
  ------------------
  |  |  140|  13.7k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 13.7k]
  |  |  |  Branch (140:68): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
   70|  13.7k|    const int in0 = c[0 * stride], in1 = c[1 * stride];
   71|       |
   72|  13.7k|    int t0, t1, t2, t3;
   73|  13.7k|    if (tx64) {
  ------------------
  |  Branch (73:9): [True: 2.54k, False: 11.1k]
  ------------------
   74|  2.54k|        t0 = t1 = (in0 * 181 + 128) >> 8;
   75|  2.54k|        t2 = (in1 * 1567 + 2048) >> 12;
   76|  2.54k|        t3 = (in1 * 3784 + 2048) >> 12;
   77|  11.1k|    } else {
   78|  11.1k|        const int in2 = c[2 * stride], in3 = c[3 * stride];
   79|       |
   80|  11.1k|        t0 = ((in0 + in2) * 181 + 128) >> 8;
   81|  11.1k|        t1 = ((in0 - in2) * 181 + 128) >> 8;
   82|  11.1k|        t2 = ((in1 *  1567         - in3 * (3784 - 4096) + 2048) >> 12) - in3;
   83|  11.1k|        t3 = ((in1 * (3784 - 4096) + in3 *  1567         + 2048) >> 12) + in1;
   84|  11.1k|    }
   85|       |
   86|  13.7k|    c[0 * stride] = CLIP(t0 + t3);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
   87|  13.7k|    c[1 * stride] = CLIP(t1 + t2);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
   88|  13.7k|    c[2 * stride] = CLIP(t1 - t2);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
   89|  13.7k|    c[3 * stride] = CLIP(t0 - t3);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
   90|  13.7k|}
itx_1d.c:inv_dct8_1d_internal_c:
  101|  13.6k|{
  102|  13.6k|    assert(stride > 0);
  ------------------
  |  |  140|  13.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 13.6k]
  |  |  |  Branch (140:68): [Folded, False: 13.6k]
  |  |  ------------------
  ------------------
  103|  13.6k|    inv_dct4_1d_internal_c(c, stride << 1, min, max, tx64);
  104|       |
  105|  13.6k|    const int in1 = c[1 * stride], in3 = c[3 * stride];
  106|       |
  107|  13.6k|    int t4a, t5a, t6a, t7a;
  108|  13.6k|    if (tx64) {
  ------------------
  |  Branch (108:9): [True: 2.55k, False: 11.1k]
  ------------------
  109|  2.55k|        t4a = (in1 *   799 + 2048) >> 12;
  110|  2.55k|        t5a = (in3 * -2276 + 2048) >> 12;
  111|  2.55k|        t6a = (in3 *  3406 + 2048) >> 12;
  112|  2.55k|        t7a = (in1 *  4017 + 2048) >> 12;
  113|  11.1k|    } else {
  114|  11.1k|        const int in5 = c[5 * stride], in7 = c[7 * stride];
  115|       |
  116|  11.1k|        t4a = ((in1 *   799         - in7 * (4017 - 4096) + 2048) >> 12) - in7;
  117|  11.1k|        t5a =  (in5 *  1703         - in3 *  1138         + 1024) >> 11;
  118|  11.1k|        t6a =  (in5 *  1138         + in3 *  1703         + 1024) >> 11;
  119|  11.1k|        t7a = ((in1 * (4017 - 4096) + in7 *  799          + 2048) >> 12) + in1;
  120|  11.1k|    }
  121|       |
  122|  13.6k|    const int t4  = CLIP(t4a + t5a);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  123|  13.6k|              t5a = CLIP(t4a - t5a);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  124|  13.6k|    const int t7  = CLIP(t7a + t6a);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  125|  13.6k|              t6a = CLIP(t7a - t6a);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  126|       |
  127|  13.6k|    const int t5  = ((t6a - t5a) * 181 + 128) >> 8;
  128|  13.6k|    const int t6  = ((t6a + t5a) * 181 + 128) >> 8;
  129|       |
  130|  13.6k|    const int t0 = c[0 * stride];
  131|  13.6k|    const int t1 = c[2 * stride];
  132|  13.6k|    const int t2 = c[4 * stride];
  133|  13.6k|    const int t3 = c[6 * stride];
  134|       |
  135|  13.6k|    c[0 * stride] = CLIP(t0 + t7);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  136|  13.6k|    c[1 * stride] = CLIP(t1 + t6);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  137|  13.6k|    c[2 * stride] = CLIP(t2 + t5);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  138|  13.6k|    c[3 * stride] = CLIP(t3 + t4);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  139|  13.6k|    c[4 * stride] = CLIP(t3 - t4);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  140|  13.6k|    c[5 * stride] = CLIP(t2 - t5);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  141|  13.6k|    c[6 * stride] = CLIP(t1 - t6);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  142|  13.6k|    c[7 * stride] = CLIP(t0 - t7);
  ------------------
  |  |   37|  13.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  143|  13.6k|}
itx_1d.c:inv_dct16_1d_c:
  242|  2.09k|{
  243|  2.09k|    inv_dct16_1d_internal_c(c, stride, min, max, 0);
  244|  2.09k|}
itx_1d.c:inv_dct16_1d_internal_c:
  154|  13.7k|{
  155|  13.7k|    assert(stride > 0);
  ------------------
  |  |  140|  13.7k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 13.7k]
  |  |  |  Branch (140:68): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  156|  13.7k|    inv_dct8_1d_internal_c(c, stride << 1, min, max, tx64);
  157|       |
  158|  13.7k|    const int in1 = c[1 * stride], in3 = c[3 * stride];
  159|  13.7k|    const int in5 = c[5 * stride], in7 = c[7 * stride];
  160|       |
  161|  13.7k|    int t8a, t9a, t10a, t11a, t12a, t13a, t14a, t15a;
  162|  13.7k|    if (tx64) {
  ------------------
  |  Branch (162:9): [True: 2.54k, False: 11.1k]
  ------------------
  163|  2.54k|        t8a  = (in1 *   401 + 2048) >> 12;
  164|  2.54k|        t9a  = (in7 * -2598 + 2048) >> 12;
  165|  2.54k|        t10a = (in5 *  1931 + 2048) >> 12;
  166|  2.54k|        t11a = (in3 * -1189 + 2048) >> 12;
  167|  2.54k|        t12a = (in3 *  3920 + 2048) >> 12;
  168|  2.54k|        t13a = (in5 *  3612 + 2048) >> 12;
  169|  2.54k|        t14a = (in7 *  3166 + 2048) >> 12;
  170|  2.54k|        t15a = (in1 *  4076 + 2048) >> 12;
  171|  11.1k|    } else {
  172|  11.1k|        const int in9  = c[ 9 * stride], in11 = c[11 * stride];
  173|  11.1k|        const int in13 = c[13 * stride], in15 = c[15 * stride];
  174|       |
  175|  11.1k|        t8a  = ((in1  *   401         - in15 * (4076 - 4096) + 2048) >> 12) - in15;
  176|  11.1k|        t9a  =  (in9  *  1583         - in7  *  1299         + 1024) >> 11;
  177|  11.1k|        t10a = ((in5  *  1931         - in11 * (3612 - 4096) + 2048) >> 12) - in11;
  178|  11.1k|        t11a = ((in13 * (3920 - 4096) - in3  *  1189         + 2048) >> 12) + in13;
  179|  11.1k|        t12a = ((in13 *  1189         + in3  * (3920 - 4096) + 2048) >> 12) + in3;
  180|  11.1k|        t13a = ((in5  * (3612 - 4096) + in11 *  1931         + 2048) >> 12) + in5;
  181|  11.1k|        t14a =  (in9  *  1299         + in7  *  1583         + 1024) >> 11;
  182|  11.1k|        t15a = ((in1  * (4076 - 4096) + in15 *   401         + 2048) >> 12) + in1;
  183|  11.1k|    }
  184|       |
  185|  13.7k|    int t8  = CLIP(t8a  + t9a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  186|  13.7k|    int t9  = CLIP(t8a  - t9a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  187|  13.7k|    int t10 = CLIP(t11a - t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  188|  13.7k|    int t11 = CLIP(t11a + t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  189|  13.7k|    int t12 = CLIP(t12a + t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  190|  13.7k|    int t13 = CLIP(t12a - t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  191|  13.7k|    int t14 = CLIP(t15a - t14a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  192|  13.7k|    int t15 = CLIP(t15a + t14a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  193|       |
  194|  13.7k|    t9a  = ((  t14 *  1567         - t9  * (3784 - 4096)  + 2048) >> 12) - t9;
  195|  13.7k|    t14a = ((  t14 * (3784 - 4096) + t9  *  1567          + 2048) >> 12) + t14;
  196|  13.7k|    t10a = ((-(t13 * (3784 - 4096) + t10 *  1567)         + 2048) >> 12) - t13;
  197|  13.7k|    t13a = ((  t13 *  1567         - t10 * (3784 - 4096)  + 2048) >> 12) - t10;
  198|       |
  199|  13.7k|    t8a  = CLIP(t8   + t11);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  200|  13.7k|    t9   = CLIP(t9a  + t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  201|  13.7k|    t10  = CLIP(t9a  - t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  202|  13.7k|    t11a = CLIP(t8   - t11);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  203|  13.7k|    t12a = CLIP(t15  - t12);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  204|  13.7k|    t13  = CLIP(t14a - t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  205|  13.7k|    t14  = CLIP(t14a + t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  206|  13.7k|    t15a = CLIP(t15  + t12);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  207|       |
  208|  13.7k|    t10a = ((t13  - t10)  * 181 + 128) >> 8;
  209|  13.7k|    t13a = ((t13  + t10)  * 181 + 128) >> 8;
  210|  13.7k|    t11  = ((t12a - t11a) * 181 + 128) >> 8;
  211|  13.7k|    t12  = ((t12a + t11a) * 181 + 128) >> 8;
  212|       |
  213|  13.7k|    const int t0 = c[ 0 * stride];
  214|  13.7k|    const int t1 = c[ 2 * stride];
  215|  13.7k|    const int t2 = c[ 4 * stride];
  216|  13.7k|    const int t3 = c[ 6 * stride];
  217|  13.7k|    const int t4 = c[ 8 * stride];
  218|  13.7k|    const int t5 = c[10 * stride];
  219|  13.7k|    const int t6 = c[12 * stride];
  220|  13.7k|    const int t7 = c[14 * stride];
  221|       |
  222|  13.7k|    c[ 0 * stride] = CLIP(t0 + t15a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  223|  13.7k|    c[ 1 * stride] = CLIP(t1 + t14);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  224|  13.7k|    c[ 2 * stride] = CLIP(t2 + t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  225|  13.7k|    c[ 3 * stride] = CLIP(t3 + t12);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  226|  13.7k|    c[ 4 * stride] = CLIP(t4 + t11);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  227|  13.7k|    c[ 5 * stride] = CLIP(t5 + t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  228|  13.7k|    c[ 6 * stride] = CLIP(t6 + t9);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  229|  13.7k|    c[ 7 * stride] = CLIP(t7 + t8a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  230|  13.7k|    c[ 8 * stride] = CLIP(t7 - t8a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  231|  13.7k|    c[ 9 * stride] = CLIP(t6 - t9);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  232|  13.7k|    c[10 * stride] = CLIP(t5 - t10a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  233|  13.7k|    c[11 * stride] = CLIP(t4 - t11);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  234|  13.7k|    c[12 * stride] = CLIP(t3 - t12);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  235|  13.7k|    c[13 * stride] = CLIP(t2 - t13a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  236|  13.7k|    c[14 * stride] = CLIP(t1 - t14);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  237|  13.7k|    c[15 * stride] = CLIP(t0 - t15a);
  ------------------
  |  |   37|  13.7k|#define CLIP(a) iclip(a, min, max)
  ------------------
  238|  13.7k|}
itx_1d.c:inv_dct32_1d_c:
  432|  9.08k|{
  433|  9.08k|    inv_dct32_1d_internal_c(c, stride, min, max, 0);
  434|  9.08k|}
itx_1d.c:inv_dct32_1d_internal_c:
  249|  11.6k|{
  250|  11.6k|    assert(stride > 0);
  ------------------
  |  |  140|  11.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 11.6k]
  |  |  |  Branch (140:68): [Folded, False: 11.6k]
  |  |  ------------------
  ------------------
  251|  11.6k|    inv_dct16_1d_internal_c(c, stride << 1, min, max, tx64);
  252|       |
  253|  11.6k|    const int in1  = c[ 1 * stride], in3  = c[ 3 * stride];
  254|  11.6k|    const int in5  = c[ 5 * stride], in7  = c[ 7 * stride];
  255|  11.6k|    const int in9  = c[ 9 * stride], in11 = c[11 * stride];
  256|  11.6k|    const int in13 = c[13 * stride], in15 = c[15 * stride];
  257|       |
  258|  11.6k|    int t16a, t17a, t18a, t19a, t20a, t21a, t22a, t23a;
  259|  11.6k|    int t24a, t25a, t26a, t27a, t28a, t29a, t30a, t31a;
  260|  11.6k|    if (tx64) {
  ------------------
  |  Branch (260:9): [True: 2.55k, False: 9.06k]
  ------------------
  261|  2.55k|        t16a = (in1  *   201 + 2048) >> 12;
  262|  2.55k|        t17a = (in15 * -2751 + 2048) >> 12;
  263|  2.55k|        t18a = (in9  *  1751 + 2048) >> 12;
  264|  2.55k|        t19a = (in7  * -1380 + 2048) >> 12;
  265|  2.55k|        t20a = (in5  *   995 + 2048) >> 12;
  266|  2.55k|        t21a = (in11 * -2106 + 2048) >> 12;
  267|  2.55k|        t22a = (in13 *  2440 + 2048) >> 12;
  268|  2.55k|        t23a = (in3  *  -601 + 2048) >> 12;
  269|  2.55k|        t24a = (in3  *  4052 + 2048) >> 12;
  270|  2.55k|        t25a = (in13 *  3290 + 2048) >> 12;
  271|  2.55k|        t26a = (in11 *  3513 + 2048) >> 12;
  272|  2.55k|        t27a = (in5  *  3973 + 2048) >> 12;
  273|  2.55k|        t28a = (in7  *  3857 + 2048) >> 12;
  274|  2.55k|        t29a = (in9  *  3703 + 2048) >> 12;
  275|  2.55k|        t30a = (in15 *  3035 + 2048) >> 12;
  276|  2.55k|        t31a = (in1  *  4091 + 2048) >> 12;
  277|  9.06k|    } else {
  278|  9.06k|        const int in17 = c[17 * stride], in19 = c[19 * stride];
  279|  9.06k|        const int in21 = c[21 * stride], in23 = c[23 * stride];
  280|  9.06k|        const int in25 = c[25 * stride], in27 = c[27 * stride];
  281|  9.06k|        const int in29 = c[29 * stride], in31 = c[31 * stride];
  282|       |
  283|  9.06k|        t16a = ((in1  *   201         - in31 * (4091 - 4096) + 2048) >> 12) - in31;
  284|  9.06k|        t17a = ((in17 * (3035 - 4096) - in15 *  2751         + 2048) >> 12) + in17;
  285|  9.06k|        t18a = ((in9  *  1751         - in23 * (3703 - 4096) + 2048) >> 12) - in23;
  286|  9.06k|        t19a = ((in25 * (3857 - 4096) - in7  *  1380         + 2048) >> 12) + in25;
  287|  9.06k|        t20a = ((in5  *   995         - in27 * (3973 - 4096) + 2048) >> 12) - in27;
  288|  9.06k|        t21a = ((in21 * (3513 - 4096) - in11 *  2106         + 2048) >> 12) + in21;
  289|  9.06k|        t22a =  (in13 *  1220         - in19 *  1645         + 1024) >> 11;
  290|  9.06k|        t23a = ((in29 * (4052 - 4096) - in3  *   601         + 2048) >> 12) + in29;
  291|  9.06k|        t24a = ((in29 *   601         + in3  * (4052 - 4096) + 2048) >> 12) + in3;
  292|  9.06k|        t25a =  (in13 *  1645         + in19 *  1220         + 1024) >> 11;
  293|  9.06k|        t26a = ((in21 *  2106         + in11 * (3513 - 4096) + 2048) >> 12) + in11;
  294|  9.06k|        t27a = ((in5  * (3973 - 4096) + in27 *   995         + 2048) >> 12) + in5;
  295|  9.06k|        t28a = ((in25 *  1380         + in7  * (3857 - 4096) + 2048) >> 12) + in7;
  296|  9.06k|        t29a = ((in9  * (3703 - 4096) + in23 *  1751         + 2048) >> 12) + in9;
  297|  9.06k|        t30a = ((in17 *  2751         + in15 * (3035 - 4096) + 2048) >> 12) + in15;
  298|  9.06k|        t31a = ((in1  * (4091 - 4096) + in31 *   201         + 2048) >> 12) + in1;
  299|  9.06k|    }
  300|       |
  301|  11.6k|    int t16 = CLIP(t16a + t17a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  302|  11.6k|    int t17 = CLIP(t16a - t17a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  303|  11.6k|    int t18 = CLIP(t19a - t18a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  304|  11.6k|    int t19 = CLIP(t19a + t18a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  305|  11.6k|    int t20 = CLIP(t20a + t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  306|  11.6k|    int t21 = CLIP(t20a - t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  307|  11.6k|    int t22 = CLIP(t23a - t22a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  308|  11.6k|    int t23 = CLIP(t23a + t22a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  309|  11.6k|    int t24 = CLIP(t24a + t25a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  310|  11.6k|    int t25 = CLIP(t24a - t25a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  311|  11.6k|    int t26 = CLIP(t27a - t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  312|  11.6k|    int t27 = CLIP(t27a + t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  313|  11.6k|    int t28 = CLIP(t28a + t29a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  314|  11.6k|    int t29 = CLIP(t28a - t29a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  315|  11.6k|    int t30 = CLIP(t31a - t30a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  316|  11.6k|    int t31 = CLIP(t31a + t30a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  317|       |
  318|  11.6k|    t17a = ((  t30 *   799         - t17 * (4017 - 4096)  + 2048) >> 12) - t17;
  319|  11.6k|    t30a = ((  t30 * (4017 - 4096) + t17 *   799          + 2048) >> 12) + t30;
  320|  11.6k|    t18a = ((-(t29 * (4017 - 4096) + t18 *   799)         + 2048) >> 12) - t29;
  321|  11.6k|    t29a = ((  t29 *   799         - t18 * (4017 - 4096)  + 2048) >> 12) - t18;
  322|  11.6k|    t21a =  (  t26 *  1703         - t21 *  1138          + 1024) >> 11;
  323|  11.6k|    t26a =  (  t26 *  1138         + t21 *  1703          + 1024) >> 11;
  324|  11.6k|    t22a =  (-(t25 *  1138         + t22 *  1703        ) + 1024) >> 11;
  325|  11.6k|    t25a =  (  t25 *  1703         - t22 *  1138          + 1024) >> 11;
  326|       |
  327|  11.6k|    t16a = CLIP(t16  + t19);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  328|  11.6k|    t17  = CLIP(t17a + t18a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  329|  11.6k|    t18  = CLIP(t17a - t18a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  330|  11.6k|    t19a = CLIP(t16  - t19);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  331|  11.6k|    t20a = CLIP(t23  - t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  332|  11.6k|    t21  = CLIP(t22a - t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  333|  11.6k|    t22  = CLIP(t22a + t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  334|  11.6k|    t23a = CLIP(t23  + t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  335|  11.6k|    t24a = CLIP(t24  + t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  336|  11.6k|    t25  = CLIP(t25a + t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  337|  11.6k|    t26  = CLIP(t25a - t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  338|  11.6k|    t27a = CLIP(t24  - t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  339|  11.6k|    t28a = CLIP(t31  - t28);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  340|  11.6k|    t29  = CLIP(t30a - t29a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  341|  11.6k|    t30  = CLIP(t30a + t29a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  342|  11.6k|    t31a = CLIP(t31  + t28);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  343|       |
  344|  11.6k|    t18a = ((  t29  *  1567         - t18  * (3784 - 4096)  + 2048) >> 12) - t18;
  345|  11.6k|    t29a = ((  t29  * (3784 - 4096) + t18  *  1567          + 2048) >> 12) + t29;
  346|  11.6k|    t19  = ((  t28a *  1567         - t19a * (3784 - 4096)  + 2048) >> 12) - t19a;
  347|  11.6k|    t28  = ((  t28a * (3784 - 4096) + t19a *  1567          + 2048) >> 12) + t28a;
  348|  11.6k|    t20  = ((-(t27a * (3784 - 4096) + t20a *  1567)         + 2048) >> 12) - t27a;
  349|  11.6k|    t27  = ((  t27a *  1567         - t20a * (3784 - 4096)  + 2048) >> 12) - t20a;
  350|  11.6k|    t21a = ((-(t26  * (3784 - 4096) + t21  *  1567)         + 2048) >> 12) - t26;
  351|  11.6k|    t26a = ((  t26  *  1567         - t21  * (3784 - 4096)  + 2048) >> 12) - t21;
  352|       |
  353|  11.6k|    t16  = CLIP(t16a + t23a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  354|  11.6k|    t17a = CLIP(t17  + t22);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  355|  11.6k|    t18  = CLIP(t18a + t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  356|  11.6k|    t19a = CLIP(t19  + t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  357|  11.6k|    t20a = CLIP(t19  - t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  358|  11.6k|    t21  = CLIP(t18a - t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  359|  11.6k|    t22a = CLIP(t17  - t22);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  360|  11.6k|    t23  = CLIP(t16a - t23a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  361|  11.6k|    t24  = CLIP(t31a - t24a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  362|  11.6k|    t25a = CLIP(t30  - t25);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  363|  11.6k|    t26  = CLIP(t29a - t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  364|  11.6k|    t27a = CLIP(t28  - t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  365|  11.6k|    t28a = CLIP(t28  + t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  366|  11.6k|    t29  = CLIP(t29a + t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  367|  11.6k|    t30a = CLIP(t30  + t25);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  368|  11.6k|    t31  = CLIP(t31a + t24a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  369|       |
  370|  11.6k|    t20  = ((t27a - t20a) * 181 + 128) >> 8;
  371|  11.6k|    t27  = ((t27a + t20a) * 181 + 128) >> 8;
  372|  11.6k|    t21a = ((t26  - t21 ) * 181 + 128) >> 8;
  373|  11.6k|    t26a = ((t26  + t21 ) * 181 + 128) >> 8;
  374|  11.6k|    t22  = ((t25a - t22a) * 181 + 128) >> 8;
  375|  11.6k|    t25  = ((t25a + t22a) * 181 + 128) >> 8;
  376|  11.6k|    t23a = ((t24  - t23 ) * 181 + 128) >> 8;
  377|  11.6k|    t24a = ((t24  + t23 ) * 181 + 128) >> 8;
  378|       |
  379|  11.6k|    const int t0  = c[ 0 * stride];
  380|  11.6k|    const int t1  = c[ 2 * stride];
  381|  11.6k|    const int t2  = c[ 4 * stride];
  382|  11.6k|    const int t3  = c[ 6 * stride];
  383|  11.6k|    const int t4  = c[ 8 * stride];
  384|  11.6k|    const int t5  = c[10 * stride];
  385|  11.6k|    const int t6  = c[12 * stride];
  386|  11.6k|    const int t7  = c[14 * stride];
  387|  11.6k|    const int t8  = c[16 * stride];
  388|  11.6k|    const int t9  = c[18 * stride];
  389|  11.6k|    const int t10 = c[20 * stride];
  390|  11.6k|    const int t11 = c[22 * stride];
  391|  11.6k|    const int t12 = c[24 * stride];
  392|  11.6k|    const int t13 = c[26 * stride];
  393|  11.6k|    const int t14 = c[28 * stride];
  394|  11.6k|    const int t15 = c[30 * stride];
  395|       |
  396|  11.6k|    c[ 0 * stride] = CLIP(t0  + t31);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  397|  11.6k|    c[ 1 * stride] = CLIP(t1  + t30a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  398|  11.6k|    c[ 2 * stride] = CLIP(t2  + t29);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  399|  11.6k|    c[ 3 * stride] = CLIP(t3  + t28a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  400|  11.6k|    c[ 4 * stride] = CLIP(t4  + t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  401|  11.6k|    c[ 5 * stride] = CLIP(t5  + t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  402|  11.6k|    c[ 6 * stride] = CLIP(t6  + t25);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  403|  11.6k|    c[ 7 * stride] = CLIP(t7  + t24a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  404|  11.6k|    c[ 8 * stride] = CLIP(t8  + t23a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  405|  11.6k|    c[ 9 * stride] = CLIP(t9  + t22);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  406|  11.6k|    c[10 * stride] = CLIP(t10 + t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  407|  11.6k|    c[11 * stride] = CLIP(t11 + t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  408|  11.6k|    c[12 * stride] = CLIP(t12 + t19a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  409|  11.6k|    c[13 * stride] = CLIP(t13 + t18);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  410|  11.6k|    c[14 * stride] = CLIP(t14 + t17a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  411|  11.6k|    c[15 * stride] = CLIP(t15 + t16);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  412|  11.6k|    c[16 * stride] = CLIP(t15 - t16);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  413|  11.6k|    c[17 * stride] = CLIP(t14 - t17a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  414|  11.6k|    c[18 * stride] = CLIP(t13 - t18);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  415|  11.6k|    c[19 * stride] = CLIP(t12 - t19a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  416|  11.6k|    c[20 * stride] = CLIP(t11 - t20);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  417|  11.6k|    c[21 * stride] = CLIP(t10 - t21a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  418|  11.6k|    c[22 * stride] = CLIP(t9  - t22);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  419|  11.6k|    c[23 * stride] = CLIP(t8  - t23a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  420|  11.6k|    c[24 * stride] = CLIP(t7  - t24a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  421|  11.6k|    c[25 * stride] = CLIP(t6  - t25);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  422|  11.6k|    c[26 * stride] = CLIP(t5  - t26a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  423|  11.6k|    c[27 * stride] = CLIP(t4  - t27);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  424|  11.6k|    c[28 * stride] = CLIP(t3  - t28a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  425|  11.6k|    c[29 * stride] = CLIP(t2  - t29);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  426|  11.6k|    c[30 * stride] = CLIP(t1  - t30a);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  427|  11.6k|    c[31 * stride] = CLIP(t0  - t31);
  ------------------
  |  |   37|  11.6k|#define CLIP(a) iclip(a, min, max)
  ------------------
  428|  11.6k|}
itx_1d.c:inv_dct64_1d_c:
  438|  2.54k|{
  439|  2.54k|    assert(stride > 0);
  ------------------
  |  |  140|  2.54k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 2.54k]
  |  |  |  Branch (140:68): [Folded, False: 2.54k]
  |  |  ------------------
  ------------------
  440|  2.54k|    inv_dct32_1d_internal_c(c, stride << 1, min, max, 1);
  441|       |
  442|  2.54k|    const int in1  = c[ 1 * stride], in3  = c[ 3 * stride];
  443|  2.54k|    const int in5  = c[ 5 * stride], in7  = c[ 7 * stride];
  444|  2.54k|    const int in9  = c[ 9 * stride], in11 = c[11 * stride];
  445|  2.54k|    const int in13 = c[13 * stride], in15 = c[15 * stride];
  446|  2.54k|    const int in17 = c[17 * stride], in19 = c[19 * stride];
  447|  2.54k|    const int in21 = c[21 * stride], in23 = c[23 * stride];
  448|  2.54k|    const int in25 = c[25 * stride], in27 = c[27 * stride];
  449|  2.54k|    const int in29 = c[29 * stride], in31 = c[31 * stride];
  450|       |
  451|  2.54k|    int t32a = (in1  *   101 + 2048) >> 12;
  452|  2.54k|    int t33a = (in31 * -2824 + 2048) >> 12;
  453|  2.54k|    int t34a = (in17 *  1660 + 2048) >> 12;
  454|  2.54k|    int t35a = (in15 * -1474 + 2048) >> 12;
  455|  2.54k|    int t36a = (in9  *   897 + 2048) >> 12;
  456|  2.54k|    int t37a = (in23 * -2191 + 2048) >> 12;
  457|  2.54k|    int t38a = (in25 *  2359 + 2048) >> 12;
  458|  2.54k|    int t39a = (in7  *  -700 + 2048) >> 12;
  459|  2.54k|    int t40a = (in5  *   501 + 2048) >> 12;
  460|  2.54k|    int t41a = (in27 * -2520 + 2048) >> 12;
  461|  2.54k|    int t42a = (in21 *  2019 + 2048) >> 12;
  462|  2.54k|    int t43a = (in11 * -1092 + 2048) >> 12;
  463|  2.54k|    int t44a = (in13 *  1285 + 2048) >> 12;
  464|  2.54k|    int t45a = (in19 * -1842 + 2048) >> 12;
  465|  2.54k|    int t46a = (in29 *  2675 + 2048) >> 12;
  466|  2.54k|    int t47a = (in3  *  -301 + 2048) >> 12;
  467|  2.54k|    int t48a = (in3  *  4085 + 2048) >> 12;
  468|  2.54k|    int t49a = (in29 *  3102 + 2048) >> 12;
  469|  2.54k|    int t50a = (in19 *  3659 + 2048) >> 12;
  470|  2.54k|    int t51a = (in13 *  3889 + 2048) >> 12;
  471|  2.54k|    int t52a = (in11 *  3948 + 2048) >> 12;
  472|  2.54k|    int t53a = (in21 *  3564 + 2048) >> 12;
  473|  2.54k|    int t54a = (in27 *  3229 + 2048) >> 12;
  474|  2.54k|    int t55a = (in5  *  4065 + 2048) >> 12;
  475|  2.54k|    int t56a = (in7  *  4036 + 2048) >> 12;
  476|  2.54k|    int t57a = (in25 *  3349 + 2048) >> 12;
  477|  2.54k|    int t58a = (in23 *  3461 + 2048) >> 12;
  478|  2.54k|    int t59a = (in9  *  3996 + 2048) >> 12;
  479|  2.54k|    int t60a = (in15 *  3822 + 2048) >> 12;
  480|  2.54k|    int t61a = (in17 *  3745 + 2048) >> 12;
  481|  2.54k|    int t62a = (in31 *  2967 + 2048) >> 12;
  482|  2.54k|    int t63a = (in1  *  4095 + 2048) >> 12;
  483|       |
  484|  2.54k|    int t32 = CLIP(t32a + t33a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  485|  2.54k|    int t33 = CLIP(t32a - t33a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  486|  2.54k|    int t34 = CLIP(t35a - t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  487|  2.54k|    int t35 = CLIP(t35a + t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  488|  2.54k|    int t36 = CLIP(t36a + t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  489|  2.54k|    int t37 = CLIP(t36a - t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  490|  2.54k|    int t38 = CLIP(t39a - t38a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  491|  2.54k|    int t39 = CLIP(t39a + t38a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  492|  2.54k|    int t40 = CLIP(t40a + t41a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  493|  2.54k|    int t41 = CLIP(t40a - t41a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  494|  2.54k|    int t42 = CLIP(t43a - t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  495|  2.54k|    int t43 = CLIP(t43a + t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  496|  2.54k|    int t44 = CLIP(t44a + t45a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  497|  2.54k|    int t45 = CLIP(t44a - t45a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  498|  2.54k|    int t46 = CLIP(t47a - t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  499|  2.54k|    int t47 = CLIP(t47a + t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  500|  2.54k|    int t48 = CLIP(t48a + t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  501|  2.54k|    int t49 = CLIP(t48a - t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  502|  2.54k|    int t50 = CLIP(t51a - t50a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  503|  2.54k|    int t51 = CLIP(t51a + t50a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  504|  2.54k|    int t52 = CLIP(t52a + t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  505|  2.54k|    int t53 = CLIP(t52a - t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  506|  2.54k|    int t54 = CLIP(t55a - t54a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  507|  2.54k|    int t55 = CLIP(t55a + t54a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  508|  2.54k|    int t56 = CLIP(t56a + t57a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  509|  2.54k|    int t57 = CLIP(t56a - t57a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  510|  2.54k|    int t58 = CLIP(t59a - t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  511|  2.54k|    int t59 = CLIP(t59a + t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  512|  2.54k|    int t60 = CLIP(t60a + t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  513|  2.54k|    int t61 = CLIP(t60a - t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  514|  2.54k|    int t62 = CLIP(t63a - t62a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  515|  2.54k|    int t63 = CLIP(t63a + t62a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  516|       |
  517|  2.54k|    t33a = ((t33 * (4096 - 4076) + t62 *   401         + 2048) >> 12) - t33;
  518|  2.54k|    t34a = ((t34 *  -401         + t61 * (4096 - 4076) + 2048) >> 12) - t61;
  519|  2.54k|    t37a =  (t37 * -1299         + t58 *  1583         + 1024) >> 11;
  520|  2.54k|    t38a =  (t38 * -1583         + t57 * -1299         + 1024) >> 11;
  521|  2.54k|    t41a = ((t41 * (4096 - 3612) + t54 *  1931         + 2048) >> 12) - t41;
  522|  2.54k|    t42a = ((t42 * -1931         + t53 * (4096 - 3612) + 2048) >> 12) - t53;
  523|  2.54k|    t45a = ((t45 * -1189         + t50 * (3920 - 4096) + 2048) >> 12) + t50;
  524|  2.54k|    t46a = ((t46 * (4096 - 3920) + t49 * -1189         + 2048) >> 12) - t46;
  525|  2.54k|    t49a = ((t46 * -1189         + t49 * (3920 - 4096) + 2048) >> 12) + t49;
  526|  2.54k|    t50a = ((t45 * (3920 - 4096) + t50 *  1189         + 2048) >> 12) + t45;
  527|  2.54k|    t53a = ((t42 * (4096 - 3612) + t53 *  1931         + 2048) >> 12) - t42;
  528|  2.54k|    t54a = ((t41 *  1931         + t54 * (3612 - 4096) + 2048) >> 12) + t54;
  529|  2.54k|    t57a =  (t38 * -1299         + t57 *  1583         + 1024) >> 11;
  530|  2.54k|    t58a =  (t37 *  1583         + t58 *  1299         + 1024) >> 11;
  531|  2.54k|    t61a = ((t34 * (4096 - 4076) + t61 *   401         + 2048) >> 12) - t34;
  532|  2.54k|    t62a = ((t33 *   401         + t62 * (4076 - 4096) + 2048) >> 12) + t62;
  533|       |
  534|  2.54k|    t32a = CLIP(t32  + t35);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  535|  2.54k|    t33  = CLIP(t33a + t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  536|  2.54k|    t34  = CLIP(t33a - t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  537|  2.54k|    t35a = CLIP(t32  - t35);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  538|  2.54k|    t36a = CLIP(t39  - t36);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  539|  2.54k|    t37  = CLIP(t38a - t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  540|  2.54k|    t38  = CLIP(t38a + t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  541|  2.54k|    t39a = CLIP(t39  + t36);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  542|  2.54k|    t40a = CLIP(t40  + t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  543|  2.54k|    t41  = CLIP(t41a + t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  544|  2.54k|    t42  = CLIP(t41a - t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  545|  2.54k|    t43a = CLIP(t40  - t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  546|  2.54k|    t44a = CLIP(t47  - t44);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  547|  2.54k|    t45  = CLIP(t46a - t45a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  548|  2.54k|    t46  = CLIP(t46a + t45a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  549|  2.54k|    t47a = CLIP(t47  + t44);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  550|  2.54k|    t48a = CLIP(t48  + t51);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  551|  2.54k|    t49  = CLIP(t49a + t50a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  552|  2.54k|    t50  = CLIP(t49a - t50a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  553|  2.54k|    t51a = CLIP(t48  - t51);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  554|  2.54k|    t52a = CLIP(t55  - t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  555|  2.54k|    t53  = CLIP(t54a - t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  556|  2.54k|    t54  = CLIP(t54a + t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  557|  2.54k|    t55a = CLIP(t55  + t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  558|  2.54k|    t56a = CLIP(t56  + t59);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  559|  2.54k|    t57  = CLIP(t57a + t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  560|  2.54k|    t58  = CLIP(t57a - t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  561|  2.54k|    t59a = CLIP(t56  - t59);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  562|  2.54k|    t60a = CLIP(t63  - t60);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  563|  2.54k|    t61  = CLIP(t62a - t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  564|  2.54k|    t62  = CLIP(t62a + t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  565|  2.54k|    t63a = CLIP(t63  + t60);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  566|       |
  567|  2.54k|    t34a = ((t34  * (4096 - 4017) + t61  *   799         + 2048) >> 12) - t34;
  568|  2.54k|    t35  = ((t35a * (4096 - 4017) + t60a *   799         + 2048) >> 12) - t35a;
  569|  2.54k|    t36  = ((t36a *  -799         + t59a * (4096 - 4017) + 2048) >> 12) - t59a;
  570|  2.54k|    t37a = ((t37  *  -799         + t58  * (4096 - 4017) + 2048) >> 12) - t58;
  571|  2.54k|    t42a =  (t42  * -1138         + t53  *  1703         + 1024) >> 11;
  572|  2.54k|    t43  =  (t43a * -1138         + t52a *  1703         + 1024) >> 11;
  573|  2.54k|    t44  =  (t44a * -1703         + t51a * -1138         + 1024) >> 11;
  574|  2.54k|    t45a =  (t45  * -1703         + t50  * -1138         + 1024) >> 11;
  575|  2.54k|    t50a =  (t45  * -1138         + t50  *  1703         + 1024) >> 11;
  576|  2.54k|    t51  =  (t44a * -1138         + t51a *  1703         + 1024) >> 11;
  577|  2.54k|    t52  =  (t43a *  1703         + t52a *  1138         + 1024) >> 11;
  578|  2.54k|    t53a =  (t42  *  1703         + t53  *  1138         + 1024) >> 11;
  579|  2.54k|    t58a = ((t37  * (4096 - 4017) + t58  *   799         + 2048) >> 12) - t37;
  580|  2.54k|    t59  = ((t36a * (4096 - 4017) + t59a *   799         + 2048) >> 12) - t36a;
  581|  2.54k|    t60  = ((t35a *   799         + t60a * (4017 - 4096) + 2048) >> 12) + t60a;
  582|  2.54k|    t61a = ((t34  *   799         + t61  * (4017 - 4096) + 2048) >> 12) + t61;
  583|       |
  584|  2.54k|    t32  = CLIP(t32a + t39a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  585|  2.54k|    t33a = CLIP(t33  + t38);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  586|  2.54k|    t34  = CLIP(t34a + t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  587|  2.54k|    t35a = CLIP(t35  + t36);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  588|  2.54k|    t36a = CLIP(t35  - t36);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  589|  2.54k|    t37  = CLIP(t34a - t37a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  590|  2.54k|    t38a = CLIP(t33  - t38);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  591|  2.54k|    t39  = CLIP(t32a - t39a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  592|  2.54k|    t40  = CLIP(t47a - t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  593|  2.54k|    t41a = CLIP(t46  - t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  594|  2.54k|    t42  = CLIP(t45a - t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  595|  2.54k|    t43a = CLIP(t44  - t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  596|  2.54k|    t44a = CLIP(t44  + t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  597|  2.54k|    t45  = CLIP(t45a + t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  598|  2.54k|    t46a = CLIP(t46  + t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  599|  2.54k|    t47  = CLIP(t47a + t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  600|  2.54k|    t48  = CLIP(t48a + t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  601|  2.54k|    t49a = CLIP(t49  + t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  602|  2.54k|    t50  = CLIP(t50a + t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  603|  2.54k|    t51a = CLIP(t51  + t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  604|  2.54k|    t52a = CLIP(t51  - t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  605|  2.54k|    t53  = CLIP(t50a - t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  606|  2.54k|    t54a = CLIP(t49  - t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  607|  2.54k|    t55  = CLIP(t48a - t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  608|  2.54k|    t56  = CLIP(t63a - t56a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  609|  2.54k|    t57a = CLIP(t62  - t57);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  610|  2.54k|    t58  = CLIP(t61a - t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  611|  2.54k|    t59a = CLIP(t60  - t59);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  612|  2.54k|    t60a = CLIP(t60  + t59);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  613|  2.54k|    t61  = CLIP(t61a + t58a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  614|  2.54k|    t62a = CLIP(t62  + t57);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  615|  2.54k|    t63  = CLIP(t63a + t56a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  616|       |
  617|  2.54k|    t36  = ((t36a * (4096 - 3784) + t59a *  1567         + 2048) >> 12) - t36a;
  618|  2.54k|    t37a = ((t37  * (4096 - 3784) + t58  *  1567         + 2048) >> 12) - t37;
  619|  2.54k|    t38  = ((t38a * (4096 - 3784) + t57a *  1567         + 2048) >> 12) - t38a;
  620|  2.54k|    t39a = ((t39  * (4096 - 3784) + t56  *  1567         + 2048) >> 12) - t39;
  621|  2.54k|    t40a = ((t40  * -1567         + t55  * (4096 - 3784) + 2048) >> 12) - t55;
  622|  2.54k|    t41  = ((t41a * -1567         + t54a * (4096 - 3784) + 2048) >> 12) - t54a;
  623|  2.54k|    t42a = ((t42  * -1567         + t53  * (4096 - 3784) + 2048) >> 12) - t53;
  624|  2.54k|    t43  = ((t43a * -1567         + t52a * (4096 - 3784) + 2048) >> 12) - t52a;
  625|  2.54k|    t52  = ((t43a * (4096 - 3784) + t52a *  1567         + 2048) >> 12) - t43a;
  626|  2.54k|    t53a = ((t42  * (4096 - 3784) + t53  *  1567         + 2048) >> 12) - t42;
  627|  2.54k|    t54  = ((t41a * (4096 - 3784) + t54a *  1567         + 2048) >> 12) - t41a;
  628|  2.54k|    t55a = ((t40  * (4096 - 3784) + t55  *  1567         + 2048) >> 12) - t40;
  629|  2.54k|    t56a = ((t39  *  1567         + t56  * (3784 - 4096) + 2048) >> 12) + t56;
  630|  2.54k|    t57  = ((t38a *  1567         + t57a * (3784 - 4096) + 2048) >> 12) + t57a;
  631|  2.54k|    t58a = ((t37  *  1567         + t58  * (3784 - 4096) + 2048) >> 12) + t58;
  632|  2.54k|    t59  = ((t36a *  1567         + t59a * (3784 - 4096) + 2048) >> 12) + t59a;
  633|       |
  634|  2.54k|    t32a = CLIP(t32  + t47);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  635|  2.54k|    t33  = CLIP(t33a + t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  636|  2.54k|    t34a = CLIP(t34  + t45);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  637|  2.54k|    t35  = CLIP(t35a + t44a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  638|  2.54k|    t36a = CLIP(t36  + t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  639|  2.54k|    t37  = CLIP(t37a + t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  640|  2.54k|    t38a = CLIP(t38  + t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  641|  2.54k|    t39  = CLIP(t39a + t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  642|  2.54k|    t40  = CLIP(t39a - t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  643|  2.54k|    t41a = CLIP(t38  - t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  644|  2.54k|    t42  = CLIP(t37a - t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  645|  2.54k|    t43a = CLIP(t36  - t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  646|  2.54k|    t44  = CLIP(t35a - t44a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  647|  2.54k|    t45a = CLIP(t34  - t45);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  648|  2.54k|    t46  = CLIP(t33a - t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  649|  2.54k|    t47a = CLIP(t32  - t47);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  650|  2.54k|    t48a = CLIP(t63  - t48);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  651|  2.54k|    t49  = CLIP(t62a - t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  652|  2.54k|    t50a = CLIP(t61  - t50);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  653|  2.54k|    t51  = CLIP(t60a - t51a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  654|  2.54k|    t52a = CLIP(t59  - t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  655|  2.54k|    t53  = CLIP(t58a - t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  656|  2.54k|    t54a = CLIP(t57  - t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  657|  2.54k|    t55  = CLIP(t56a - t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  658|  2.54k|    t56  = CLIP(t56a + t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  659|  2.54k|    t57a = CLIP(t57  + t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  660|  2.54k|    t58  = CLIP(t58a + t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  661|  2.54k|    t59a = CLIP(t59  + t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  662|  2.54k|    t60  = CLIP(t60a + t51a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  663|  2.54k|    t61a = CLIP(t61  + t50);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  664|  2.54k|    t62  = CLIP(t62a + t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  665|  2.54k|    t63a = CLIP(t63  + t48);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  666|       |
  667|  2.54k|    t40a = ((t55  - t40 ) * 181 + 128) >> 8;
  668|  2.54k|    t41  = ((t54a - t41a) * 181 + 128) >> 8;
  669|  2.54k|    t42a = ((t53  - t42 ) * 181 + 128) >> 8;
  670|  2.54k|    t43  = ((t52a - t43a) * 181 + 128) >> 8;
  671|  2.54k|    t44a = ((t51  - t44 ) * 181 + 128) >> 8;
  672|  2.54k|    t45  = ((t50a - t45a) * 181 + 128) >> 8;
  673|  2.54k|    t46a = ((t49  - t46 ) * 181 + 128) >> 8;
  674|  2.54k|    t47  = ((t48a - t47a) * 181 + 128) >> 8;
  675|  2.54k|    t48  = ((t47a + t48a) * 181 + 128) >> 8;
  676|  2.54k|    t49a = ((t46  + t49 ) * 181 + 128) >> 8;
  677|  2.54k|    t50  = ((t45a + t50a) * 181 + 128) >> 8;
  678|  2.54k|    t51a = ((t44  + t51 ) * 181 + 128) >> 8;
  679|  2.54k|    t52  = ((t43a + t52a) * 181 + 128) >> 8;
  680|  2.54k|    t53a = ((t42  + t53 ) * 181 + 128) >> 8;
  681|  2.54k|    t54  = ((t41a + t54a) * 181 + 128) >> 8;
  682|  2.54k|    t55a = ((t40  + t55 ) * 181 + 128) >> 8;
  683|       |
  684|  2.54k|    const int t0  = c[ 0 * stride];
  685|  2.54k|    const int t1  = c[ 2 * stride];
  686|  2.54k|    const int t2  = c[ 4 * stride];
  687|  2.54k|    const int t3  = c[ 6 * stride];
  688|  2.54k|    const int t4  = c[ 8 * stride];
  689|  2.54k|    const int t5  = c[10 * stride];
  690|  2.54k|    const int t6  = c[12 * stride];
  691|  2.54k|    const int t7  = c[14 * stride];
  692|  2.54k|    const int t8  = c[16 * stride];
  693|  2.54k|    const int t9  = c[18 * stride];
  694|  2.54k|    const int t10 = c[20 * stride];
  695|  2.54k|    const int t11 = c[22 * stride];
  696|  2.54k|    const int t12 = c[24 * stride];
  697|  2.54k|    const int t13 = c[26 * stride];
  698|  2.54k|    const int t14 = c[28 * stride];
  699|  2.54k|    const int t15 = c[30 * stride];
  700|  2.54k|    const int t16 = c[32 * stride];
  701|  2.54k|    const int t17 = c[34 * stride];
  702|  2.54k|    const int t18 = c[36 * stride];
  703|  2.54k|    const int t19 = c[38 * stride];
  704|  2.54k|    const int t20 = c[40 * stride];
  705|  2.54k|    const int t21 = c[42 * stride];
  706|  2.54k|    const int t22 = c[44 * stride];
  707|  2.54k|    const int t23 = c[46 * stride];
  708|  2.54k|    const int t24 = c[48 * stride];
  709|  2.54k|    const int t25 = c[50 * stride];
  710|  2.54k|    const int t26 = c[52 * stride];
  711|  2.54k|    const int t27 = c[54 * stride];
  712|  2.54k|    const int t28 = c[56 * stride];
  713|  2.54k|    const int t29 = c[58 * stride];
  714|  2.54k|    const int t30 = c[60 * stride];
  715|  2.54k|    const int t31 = c[62 * stride];
  716|       |
  717|  2.54k|    c[ 0 * stride] = CLIP(t0  + t63a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  718|  2.54k|    c[ 1 * stride] = CLIP(t1  + t62);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  719|  2.54k|    c[ 2 * stride] = CLIP(t2  + t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  720|  2.54k|    c[ 3 * stride] = CLIP(t3  + t60);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  721|  2.54k|    c[ 4 * stride] = CLIP(t4  + t59a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  722|  2.54k|    c[ 5 * stride] = CLIP(t5  + t58);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  723|  2.54k|    c[ 6 * stride] = CLIP(t6  + t57a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  724|  2.54k|    c[ 7 * stride] = CLIP(t7  + t56);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  725|  2.54k|    c[ 8 * stride] = CLIP(t8  + t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  726|  2.54k|    c[ 9 * stride] = CLIP(t9  + t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  727|  2.54k|    c[10 * stride] = CLIP(t10 + t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  728|  2.54k|    c[11 * stride] = CLIP(t11 + t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  729|  2.54k|    c[12 * stride] = CLIP(t12 + t51a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  730|  2.54k|    c[13 * stride] = CLIP(t13 + t50);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  731|  2.54k|    c[14 * stride] = CLIP(t14 + t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  732|  2.54k|    c[15 * stride] = CLIP(t15 + t48);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  733|  2.54k|    c[16 * stride] = CLIP(t16 + t47);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  734|  2.54k|    c[17 * stride] = CLIP(t17 + t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  735|  2.54k|    c[18 * stride] = CLIP(t18 + t45);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  736|  2.54k|    c[19 * stride] = CLIP(t19 + t44a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  737|  2.54k|    c[20 * stride] = CLIP(t20 + t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  738|  2.54k|    c[21 * stride] = CLIP(t21 + t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  739|  2.54k|    c[22 * stride] = CLIP(t22 + t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  740|  2.54k|    c[23 * stride] = CLIP(t23 + t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  741|  2.54k|    c[24 * stride] = CLIP(t24 + t39);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  742|  2.54k|    c[25 * stride] = CLIP(t25 + t38a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  743|  2.54k|    c[26 * stride] = CLIP(t26 + t37);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  744|  2.54k|    c[27 * stride] = CLIP(t27 + t36a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  745|  2.54k|    c[28 * stride] = CLIP(t28 + t35);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  746|  2.54k|    c[29 * stride] = CLIP(t29 + t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  747|  2.54k|    c[30 * stride] = CLIP(t30 + t33);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  748|  2.54k|    c[31 * stride] = CLIP(t31 + t32a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  749|  2.54k|    c[32 * stride] = CLIP(t31 - t32a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  750|  2.54k|    c[33 * stride] = CLIP(t30 - t33);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  751|  2.54k|    c[34 * stride] = CLIP(t29 - t34a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  752|  2.54k|    c[35 * stride] = CLIP(t28 - t35);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  753|  2.54k|    c[36 * stride] = CLIP(t27 - t36a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  754|  2.54k|    c[37 * stride] = CLIP(t26 - t37);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  755|  2.54k|    c[38 * stride] = CLIP(t25 - t38a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  756|  2.54k|    c[39 * stride] = CLIP(t24 - t39);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  757|  2.54k|    c[40 * stride] = CLIP(t23 - t40a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  758|  2.54k|    c[41 * stride] = CLIP(t22 - t41);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  759|  2.54k|    c[42 * stride] = CLIP(t21 - t42a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  760|  2.54k|    c[43 * stride] = CLIP(t20 - t43);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  761|  2.54k|    c[44 * stride] = CLIP(t19 - t44a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  762|  2.54k|    c[45 * stride] = CLIP(t18 - t45);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  763|  2.54k|    c[46 * stride] = CLIP(t17 - t46a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  764|  2.54k|    c[47 * stride] = CLIP(t16 - t47);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  765|  2.54k|    c[48 * stride] = CLIP(t15 - t48);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  766|  2.54k|    c[49 * stride] = CLIP(t14 - t49a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  767|  2.54k|    c[50 * stride] = CLIP(t13 - t50);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  768|  2.54k|    c[51 * stride] = CLIP(t12 - t51a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  769|  2.54k|    c[52 * stride] = CLIP(t11 - t52);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  770|  2.54k|    c[53 * stride] = CLIP(t10 - t53a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  771|  2.54k|    c[54 * stride] = CLIP(t9  - t54);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  772|  2.54k|    c[55 * stride] = CLIP(t8  - t55a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  773|  2.54k|    c[56 * stride] = CLIP(t7  - t56);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  774|  2.54k|    c[57 * stride] = CLIP(t6  - t57a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  775|  2.54k|    c[58 * stride] = CLIP(t5  - t58);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  776|  2.54k|    c[59 * stride] = CLIP(t4  - t59a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  777|  2.54k|    c[60 * stride] = CLIP(t3  - t60);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  778|  2.54k|    c[61 * stride] = CLIP(t2  - t61a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  779|  2.54k|    c[62 * stride] = CLIP(t1  - t62);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  780|  2.54k|    c[63 * stride] = CLIP(t0  - t63a);
  ------------------
  |  |   37|  2.54k|#define CLIP(a) iclip(a, min, max)
  ------------------
  781|  2.54k|}

dav1d_itx_dsp_init_8bpc:
  220|  8.03k|COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
  221|  8.03k|#define assign_itx_all_fn64(w, h, pfx) \
  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  224|       |
  225|  8.03k|#define assign_itx_all_fn32(w, h, pfx) \
  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  229|       |
  230|  8.03k|#define assign_itx_all_fn16(w, h, pfx) \
  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  252|       |
  253|  8.03k|#define assign_itx_all_fn84(w, h, pfx) \
  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  263|  8.03k|
  264|  8.03k|#if !(HAVE_ASM && TRIM_DSP_FUNCTIONS && ( \
  265|  8.03k|  ARCH_AARCH64 || \
  266|  8.03k|  (ARCH_ARM && (defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32))) \
  267|  8.03k|))
  268|  8.03k|    c->itxfm_add[TX_4X4][WHT_WHT] = inv_txfm_add_wht_wht_4x4_c;
  269|  8.03k|#endif
  270|  8.03k|    assign_itx_all_fn84( 4,  4, );
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  271|  8.03k|    assign_itx_all_fn84( 4,  8, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  272|  8.03k|    assign_itx_all_fn84( 4, 16, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  273|  8.03k|    assign_itx_all_fn84( 8,  4, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  274|  8.03k|    assign_itx_all_fn84( 8,  8, );
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  275|  8.03k|    assign_itx_all_fn84( 8, 16, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  276|  8.03k|    assign_itx_all_fn32( 8, 32, R);
  ------------------
  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  277|  8.03k|    assign_itx_all_fn84(16,  4, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  278|  8.03k|    assign_itx_all_fn84(16,  8, R);
  ------------------
  |  |  254|  8.03k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.03k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.03k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.03k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.03k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  279|  8.03k|    assign_itx_all_fn16(16, 16, );
  ------------------
  |  |  231|  8.03k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  ------------------
  |  |  232|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  233|  8.03k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  234|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  235|  8.03k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  236|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  237|  8.03k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  238|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  239|  8.03k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  240|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  241|  8.03k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  242|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  243|  8.03k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  244|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  245|  8.03k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  246|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  247|  8.03k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  248|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  249|  8.03k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  250|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  251|  8.03k|        inv_txfm_add_identity_dct_##w##x##h##_c
  ------------------
  280|  8.03k|    assign_itx_all_fn32(16, 32, R);
  ------------------
  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  281|  8.03k|    assign_itx_all_fn64(16, 64, R);
  ------------------
  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  282|  8.03k|    assign_itx_all_fn32(32,  8, R);
  ------------------
  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  283|  8.03k|    assign_itx_all_fn32(32, 16, R);
  ------------------
  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  284|  8.03k|    assign_itx_all_fn32(32, 32, );
  ------------------
  |  |  226|  8.03k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.03k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  285|  8.03k|    assign_itx_all_fn64(32, 64, R);
  ------------------
  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  286|  8.03k|    assign_itx_all_fn64(64, 16, R);
  ------------------
  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  287|  8.03k|    assign_itx_all_fn64(64, 32, R);
  ------------------
  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  288|  8.03k|    assign_itx_all_fn64(64, 64, );
  ------------------
  |  |  222|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.03k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  289|       |
  290|  8.03k|    int all_simd = 0;
  291|  8.03k|#if HAVE_ASM
  292|       |#if ARCH_AARCH64 || ARCH_ARM
  293|       |    itx_dsp_init_arm(c, bpc, &all_simd);
  294|       |#endif
  295|       |#if ARCH_LOONGARCH64
  296|       |    itx_dsp_init_loongarch(c, bpc);
  297|       |#endif
  298|       |#if ARCH_PPC64LE
  299|       |    itx_dsp_init_ppc(c, bpc);
  300|       |#endif
  301|       |#if ARCH_RISCV
  302|       |    itx_dsp_init_riscv(c, bpc);
  303|       |#endif
  304|  8.03k|#if ARCH_X86
  305|  8.03k|    itx_dsp_init_x86(c, bpc, &all_simd);
  306|  8.03k|#endif
  307|  8.03k|#endif
  308|       |
  309|  8.03k|    if (!all_simd)
  ------------------
  |  Branch (309:9): [True: 0, False: 8.03k]
  ------------------
  310|      0|        dav1d_init_last_nonzero_col_from_eob_tables();
  311|  8.03k|}
itx_tmpl.c:inv_txfm_add_c:
   47|    343|{
   48|    343|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
   49|    343|    const int w = 4 * t_dim->w, h = 4 * t_dim->h;
   50|    343|    const int has_dconly = txtp == DCT_DCT;
   51|    343|    assert(w >= 4 && w <= 64);
  ------------------
  |  |  140|    686|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 343, False: 0]
  |  |  |  Branch (140:30): [True: 343, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 343]
  |  |  ------------------
  ------------------
   52|    343|    assert(h >= 4 && h <= 64);
  ------------------
  |  |  140|    686|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 343, False: 0]
  |  |  |  Branch (140:30): [True: 343, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 343]
  |  |  ------------------
  ------------------
   53|    343|    assert(eob >= 0);
  ------------------
  |  |  140|    343|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 343]
  |  |  |  Branch (140:68): [Folded, False: 343]
  |  |  ------------------
  ------------------
   54|       |
   55|    343|    const int is_rect2 = w * 2 == h || h * 2 == w;
  ------------------
  |  Branch (55:26): [True: 89, False: 254]
  |  Branch (55:40): [True: 81, False: 173]
  ------------------
   56|    343|    const int rnd = (1 << shift) >> 1;
   57|       |
   58|    343|    if (eob < has_dconly) {
  ------------------
  |  Branch (58:9): [True: 107, False: 236]
  ------------------
   59|    107|        int dc = coeff[0];
   60|    107|        coeff[0] = 0;
   61|    107|        if (is_rect2)
  ------------------
  |  Branch (61:13): [True: 93, False: 14]
  ------------------
   62|     93|            dc = (dc * 181 + 128) >> 8;
   63|    107|        dc = (dc * 181 + 128) >> 8;
   64|    107|        dc = (dc + rnd) >> shift;
   65|    107|        dc = (dc * 181 + 128 + 2048) >> 12;
   66|  4.35k|        for (int y = 0; y < h; y++, dst += PXSTRIDE(stride))
  ------------------
  |  |   53|  4.24k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (66:25): [True: 4.24k, False: 107]
  ------------------
   67|   168k|            for (int x = 0; x < w; x++)
  ------------------
  |  Branch (67:29): [True: 164k, False: 4.24k]
  ------------------
   68|   164k|                dst[x] = iclip_pixel(dst[x] + dc);
  ------------------
  |  |   49|   164k|#define iclip_pixel iclip_u8
  ------------------
   69|    107|        return;
   70|    107|    }
   71|       |
   72|    236|    const uint8_t *const txtps = dav1d_tx1d_types[txtp];
   73|    236|    const itx_1d_fn first_1d_fn = dav1d_tx1d_fns[t_dim->lw][txtps[0]];
   74|    236|    const itx_1d_fn second_1d_fn = dav1d_tx1d_fns[t_dim->lh][txtps[1]];
   75|    236|    const int sh = imin(h, 32), sw = imin(w, 32);
   76|    236|#if BITDEPTH == 8
   77|    236|    const int row_clip_min = INT16_MIN;
   78|    236|    const int col_clip_min = INT16_MIN;
   79|       |#else
   80|       |    const int row_clip_min = (int) ((unsigned) ~bitdepth_max << 7);
   81|       |    const int col_clip_min = (int) ((unsigned) ~bitdepth_max << 5);
   82|       |#endif
   83|    236|    const int row_clip_max = ~row_clip_min;
   84|    236|    const int col_clip_max = ~col_clip_min;
   85|       |
   86|    236|    int32_t tmp[64 * 64], *c = tmp;
   87|    236|    int last_nonzero_col; // in first 1d itx
   88|    236|    if (txtps[1] == IDENTITY && txtps[0] != IDENTITY) {
  ------------------
  |  Branch (88:9): [True: 0, False: 236]
  |  Branch (88:33): [True: 0, False: 0]
  ------------------
   89|      0|        last_nonzero_col = imin(sh - 1, eob);
   90|    236|    } else if (txtps[0] == IDENTITY && txtps[1] != IDENTITY) {
  ------------------
  |  Branch (90:16): [True: 0, False: 236]
  |  Branch (90:40): [True: 0, False: 0]
  ------------------
   91|      0|        last_nonzero_col = eob >> (t_dim->lw + 2);
   92|    236|    } else {
   93|    236|        last_nonzero_col = dav1d_last_nonzero_col_from_eob[tx][eob];
   94|    236|    }
   95|    236|    assert(last_nonzero_col < sh);
  ------------------
  |  |  140|    236|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 236]
  |  |  |  Branch (140:68): [Folded, False: 236]
  |  |  ------------------
  ------------------
   96|  6.26k|    for (int y = 0; y <= last_nonzero_col; y++, c += w) {
  ------------------
  |  Branch (96:21): [True: 6.03k, False: 236]
  ------------------
   97|  6.03k|        if (is_rect2)
  ------------------
  |  Branch (97:13): [True: 1.46k, False: 4.56k]
  ------------------
   98|  31.4k|            for (int x = 0; x < sw; x++)
  ------------------
  |  Branch (98:29): [True: 29.9k, False: 1.46k]
  ------------------
   99|  29.9k|                c[x] = (coeff[y + x * sh] * 181 + 128) >> 8;
  100|  4.56k|        else
  101|   146k|            for (int x = 0; x < sw; x++)
  ------------------
  |  Branch (101:29): [True: 142k, False: 4.56k]
  ------------------
  102|   142k|                c[x] = coeff[y + x * sh];
  103|  6.03k|        first_1d_fn(c, 1, row_clip_min, row_clip_max);
  104|  6.03k|    }
  105|    236|    if (last_nonzero_col + 1 < sh)
  ------------------
  |  Branch (105:9): [True: 109, False: 127]
  ------------------
  106|    109|        memset(c, 0, sizeof(*c) * (sh - last_nonzero_col - 1) * w);
  107|       |
  108|    236|    memset(coeff, 0, sizeof(*coeff) * sw * sh);
  109|   231k|    for (int i = 0; i < w * sh; i++)
  ------------------
  |  Branch (109:21): [True: 231k, False: 236]
  ------------------
  110|   231k|        tmp[i] = iclip((tmp[i] + rnd) >> shift, col_clip_min, col_clip_max);
  111|       |
  112|  7.97k|    for (int x = 0; x < w; x++)
  ------------------
  |  Branch (112:21): [True: 7.73k, False: 236]
  ------------------
  113|  7.73k|        second_1d_fn(&tmp[x], w, col_clip_min, col_clip_max);
  114|       |
  115|    236|    c = tmp;
  116|  8.10k|    for (int y = 0; y < h; y++, dst += PXSTRIDE(stride))
  ------------------
  |  |   53|  7.87k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (116:21): [True: 7.87k, False: 236]
  ------------------
  117|   292k|        for (int x = 0; x < w; x++)
  ------------------
  |  Branch (117:25): [True: 284k, False: 7.87k]
  ------------------
  118|   284k|            dst[x] = iclip_pixel(dst[x] + ((*c++ + 8) >> 4));
  ------------------
  |  |   49|   284k|#define iclip_pixel iclip_u8
  ------------------
  119|    236|}
itx_tmpl.c:inv_txfm_add_dct_dct_16x32_c:
  127|     57|                                               HIGHBD_DECL_SUFFIX) \
  128|     57|{ \
  129|     57|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|     57|                   HIGHBD_TAIL_SUFFIX); \
  131|     57|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x16_c:
  127|     44|                                               HIGHBD_DECL_SUFFIX) \
  128|     44|{ \
  129|     44|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|     44|                   HIGHBD_TAIL_SUFFIX); \
  131|     44|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x32_c:
  127|    146|                                               HIGHBD_DECL_SUFFIX) \
  128|    146|{ \
  129|    146|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|    146|                   HIGHBD_TAIL_SUFFIX); \
  131|    146|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x64_c:
  127|     32|                                               HIGHBD_DECL_SUFFIX) \
  128|     32|{ \
  129|     32|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|     32|                   HIGHBD_TAIL_SUFFIX); \
  131|     32|}
itx_tmpl.c:inv_txfm_add_dct_dct_64x32_c:
  127|     37|                                               HIGHBD_DECL_SUFFIX) \
  128|     37|{ \
  129|     37|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|     37|                   HIGHBD_TAIL_SUFFIX); \
  131|     37|}
itx_tmpl.c:inv_txfm_add_dct_dct_64x64_c:
  127|     27|                                               HIGHBD_DECL_SUFFIX) \
  128|     27|{ \
  129|     27|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|     27|                   HIGHBD_TAIL_SUFFIX); \
  131|     27|}
dav1d_itx_dsp_init_16bpc:
  220|  3.35k|COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
  221|  3.35k|#define assign_itx_all_fn64(w, h, pfx) \
  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  224|       |
  225|  3.35k|#define assign_itx_all_fn32(w, h, pfx) \
  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  229|       |
  230|  3.35k|#define assign_itx_all_fn16(w, h, pfx) \
  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  252|       |
  253|  3.35k|#define assign_itx_all_fn84(w, h, pfx) \
  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  263|  3.35k|
  264|  3.35k|#if !(HAVE_ASM && TRIM_DSP_FUNCTIONS && ( \
  265|  3.35k|  ARCH_AARCH64 || \
  266|  3.35k|  (ARCH_ARM && (defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32))) \
  267|  3.35k|))
  268|  3.35k|    c->itxfm_add[TX_4X4][WHT_WHT] = inv_txfm_add_wht_wht_4x4_c;
  269|  3.35k|#endif
  270|  3.35k|    assign_itx_all_fn84( 4,  4, );
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  271|  3.35k|    assign_itx_all_fn84( 4,  8, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  272|  3.35k|    assign_itx_all_fn84( 4, 16, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  273|  3.35k|    assign_itx_all_fn84( 8,  4, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  274|  3.35k|    assign_itx_all_fn84( 8,  8, );
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  275|  3.35k|    assign_itx_all_fn84( 8, 16, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  276|  3.35k|    assign_itx_all_fn32( 8, 32, R);
  ------------------
  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  277|  3.35k|    assign_itx_all_fn84(16,  4, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  278|  3.35k|    assign_itx_all_fn84(16,  8, R);
  ------------------
  |  |  254|  3.35k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  3.35k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  3.35k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  3.35k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  3.35k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  279|  3.35k|    assign_itx_all_fn16(16, 16, );
  ------------------
  |  |  231|  3.35k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  ------------------
  |  |  232|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  233|  3.35k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  234|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  235|  3.35k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  236|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  237|  3.35k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  238|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  239|  3.35k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  240|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  241|  3.35k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  242|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  243|  3.35k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  244|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  245|  3.35k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  246|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  247|  3.35k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  248|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  249|  3.35k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  250|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  251|  3.35k|        inv_txfm_add_identity_dct_##w##x##h##_c
  ------------------
  280|  3.35k|    assign_itx_all_fn32(16, 32, R);
  ------------------
  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  281|  3.35k|    assign_itx_all_fn64(16, 64, R);
  ------------------
  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  282|  3.35k|    assign_itx_all_fn32(32,  8, R);
  ------------------
  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  283|  3.35k|    assign_itx_all_fn32(32, 16, R);
  ------------------
  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  284|  3.35k|    assign_itx_all_fn32(32, 32, );
  ------------------
  |  |  226|  3.35k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  3.35k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  285|  3.35k|    assign_itx_all_fn64(32, 64, R);
  ------------------
  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  286|  3.35k|    assign_itx_all_fn64(64, 16, R);
  ------------------
  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  287|  3.35k|    assign_itx_all_fn64(64, 32, R);
  ------------------
  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  288|  3.35k|    assign_itx_all_fn64(64, 64, );
  ------------------
  |  |  222|  3.35k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  3.35k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  289|       |
  290|  3.35k|    int all_simd = 0;
  291|  3.35k|#if HAVE_ASM
  292|       |#if ARCH_AARCH64 || ARCH_ARM
  293|       |    itx_dsp_init_arm(c, bpc, &all_simd);
  294|       |#endif
  295|       |#if ARCH_LOONGARCH64
  296|       |    itx_dsp_init_loongarch(c, bpc);
  297|       |#endif
  298|       |#if ARCH_PPC64LE
  299|       |    itx_dsp_init_ppc(c, bpc);
  300|       |#endif
  301|       |#if ARCH_RISCV
  302|       |    itx_dsp_init_riscv(c, bpc);
  303|       |#endif
  304|  3.35k|#if ARCH_X86
  305|  3.35k|    itx_dsp_init_x86(c, bpc, &all_simd);
  306|  3.35k|#endif
  307|  3.35k|#endif
  308|       |
  309|  3.35k|    if (!all_simd)
  ------------------
  |  Branch (309:9): [True: 1.73k, False: 1.61k]
  ------------------
  310|  1.73k|        dav1d_init_last_nonzero_col_from_eob_tables();
  311|  3.35k|}

dav1d_copy_lpf_8bpc:
  106|  42.9k|{
  107|  42.9k|    const int have_tt = f->c->n_tc > 1;
  108|  42.9k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|  42.9k|    const int offset = 8 * !!sby;
  110|  42.9k|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|  42.9k|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|  42.9k|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|  42.9k|    pixel *const dst[3] = {
  114|  42.9k|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
  115|  42.9k|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
  116|  42.9k|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
  117|  42.9k|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|  42.9k|    const int restore_planes = f->lf.restore_planes;
  121|       |
  122|  42.9k|    if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (122:9): [True: 42.9k, False: 0]
  |  Branch (122:29): [True: 0, False: 0]
  ------------------
  123|  42.9k|        const int h = f->cur.p.h;
  124|  42.9k|        const int w = f->bw << 2;
  125|  42.9k|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  126|  42.9k|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  127|  42.9k|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (127:13): [True: 588, False: 42.3k]
  |  Branch (127:46): [True: 42.3k, False: 0]
  ------------------
  128|  42.9k|            backup_lpf(f, dst[0], lr_stride[0],
  129|  42.9k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
  130|  42.9k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  131|  42.9k|        if (have_tt && resize) {
  ------------------
  |  Branch (131:13): [True: 40.8k, False: 2.14k]
  |  Branch (131:24): [True: 0, False: 40.8k]
  ------------------
  132|      0|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  133|      0|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  134|      0|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  135|      0|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  136|      0|        }
  137|  42.9k|    }
  138|  42.9k|    if ((f->seq_hdr->cdef || restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) &&
  ------------------
  |  Branch (138:10): [True: 42.9k, False: 0]
  |  Branch (138:30): [True: 0, False: 0]
  ------------------
  139|  42.9k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (139:9): [True: 15.2k, False: 27.7k]
  ------------------
  140|  15.2k|    {
  141|  15.2k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  142|  15.2k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  143|  15.2k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  144|  15.2k|        const int w = f->bw << (2 - ss_hor);
  145|  15.2k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  146|  15.2k|        const int offset_uv = offset >> ss_ver;
  147|  15.2k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  148|  15.2k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  ------------------
  |  |   53|  15.2k|#define PXSTRIDE(x) (x)
  ------------------
  149|  15.2k|        if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_U) {
  ------------------
  |  Branch (149:13): [True: 15.2k, False: 0]
  |  Branch (149:33): [True: 0, False: 0]
  ------------------
  150|  15.2k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (150:17): [True: 52, False: 15.1k]
  |  Branch (150:50): [True: 15.1k, False: 0]
  ------------------
  151|  15.2k|                backup_lpf(f, dst[1], lr_stride[1],
  152|  15.2k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  15.2k|#define PXSTRIDE(x) (x)
  ------------------
  153|  15.2k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  154|  15.2k|                           row_h, w, h, ss_hor, 1);
  155|  15.2k|            if (have_tt && resize)
  ------------------
  |  Branch (155:17): [True: 14.4k, False: 749]
  |  Branch (155:28): [True: 0, False: 14.4k]
  ------------------
  156|      0|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  157|      0|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  158|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  159|      0|                           row_h, w, h, ss_hor, 0);
  160|  15.2k|        }
  161|  15.2k|        if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_V) {
  ------------------
  |  Branch (161:13): [True: 15.2k, False: 0]
  |  Branch (161:33): [True: 0, False: 0]
  ------------------
  162|  15.2k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (162:17): [True: 48, False: 15.1k]
  |  Branch (162:50): [True: 15.1k, False: 0]
  ------------------
  163|  15.2k|                backup_lpf(f, dst[2], lr_stride[1],
  164|  15.2k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  15.2k|#define PXSTRIDE(x) (x)
  ------------------
  165|  15.2k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  166|  15.2k|                           row_h, w, h, ss_hor, 1);
  167|  15.2k|            if (have_tt && resize)
  ------------------
  |  Branch (167:17): [True: 14.4k, False: 749]
  |  Branch (167:28): [True: 0, False: 14.4k]
  ------------------
  168|      0|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  169|      0|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  170|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  171|      0|                           row_h, w, h, ss_hor, 0);
  172|  15.2k|        }
  173|  15.2k|    }
  174|  42.9k|}
dav1d_loopfilter_sbrow_cols_8bpc:
  316|  17.5k|{
  317|  17.5k|    int x, have_left;
  318|       |    // Don't filter outside the frame
  319|  17.5k|    const int is_sb64 = !f->seq_hdr->sb128;
  320|  17.5k|    const int starty4 = (sby & is_sb64) << 4;
  321|  17.5k|    const int sbsz = 32 >> is_sb64;
  322|  17.5k|    const int sbl2 = 5 - is_sb64;
  323|  17.5k|    const int halign = (f->bh + 31) & ~31;
  324|  17.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  325|  17.5k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  326|  17.5k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  327|  17.5k|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  328|  17.5k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  329|  17.5k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  330|       |
  331|       |    // fix lpf strength at tile col boundaries
  332|  17.5k|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  333|  17.5k|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  334|  24.9k|    for (int tile_col = 1;; tile_col++) {
  335|  24.9k|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  336|  24.9k|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (336:13): [True: 17.5k, False: 7.41k]
  ------------------
  337|  7.41k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (337:25): [True: 4.67k, False: 2.73k]
  ------------------
  338|  7.41k|        x >>= is_sb64;
  339|       |
  340|  7.41k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  341|  92.6k|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (341:51): [True: 85.2k, False: 7.41k]
  ------------------
  342|  85.2k|            const int sidx = mask >= 0x10000U;
  343|  85.2k|            const unsigned smask = mask >> (sidx << 4);
  344|  85.2k|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  345|  85.2k|                                !!(y_hmask[1][sidx] & smask);
  346|  85.2k|            y_hmask[2][sidx] &= ~smask;
  347|  85.2k|            y_hmask[1][sidx] &= ~smask;
  348|  85.2k|            y_hmask[0][sidx] &= ~smask;
  349|  85.2k|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  350|  85.2k|        }
  351|       |
  352|  7.41k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (352:13): [True: 2.62k, False: 4.79k]
  ------------------
  353|  2.62k|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  354|  24.4k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (354:68): [True: 21.8k, False: 2.62k]
  ------------------
  355|  21.8k|                 y++, uv_mask <<= 1)
  356|  21.8k|            {
  357|  21.8k|                const int sidx = uv_mask >= vmax;
  358|  21.8k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  359|  21.8k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  360|  21.8k|                uv_hmask[1][sidx] &= ~smask;
  361|  21.8k|                uv_hmask[0][sidx] &= ~smask;
  362|  21.8k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  363|  21.8k|            }
  364|  2.62k|        }
  365|  7.41k|        lpf_y  += halign;
  366|  7.41k|        lpf_uv += halign >> ss_ver;
  367|  7.41k|    }
  368|       |
  369|       |    // fix lpf strength at tile row boundaries
  370|  17.5k|    if (start_of_tile_row) {
  ------------------
  |  Branch (370:9): [True: 3.62k, False: 13.9k]
  ------------------
  371|  3.62k|        const BlockContext *a;
  372|  3.62k|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  373|  8.52k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (373:14): [True: 4.90k, False: 3.62k]
  ------------------
  374|  4.90k|        {
  375|  4.90k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  376|  4.90k|            const unsigned w = imin(32, f->w4 - (x << 5));
  377|  90.0k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (377:44): [True: 85.1k, False: 4.90k]
  ------------------
  378|  85.1k|                const int sidx = mask >= 0x10000U;
  379|  85.1k|                const unsigned smask = mask >> (sidx << 4);
  380|  85.1k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  381|  85.1k|                                    !!(y_vmask[1][sidx] & smask);
  382|  85.1k|                y_vmask[2][sidx] &= ~smask;
  383|  85.1k|                y_vmask[1][sidx] &= ~smask;
  384|  85.1k|                y_vmask[0][sidx] &= ~smask;
  385|  85.1k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  386|  85.1k|            }
  387|       |
  388|  4.90k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (388:17): [True: 1.79k, False: 3.10k]
  ------------------
  389|  1.79k|                const unsigned cw = (w + ss_hor) >> ss_hor;
  390|  1.79k|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  391|  19.7k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (391:51): [True: 17.9k, False: 1.79k]
  ------------------
  392|  17.9k|                    const int sidx = uv_mask >= hmax;
  393|  17.9k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  394|  17.9k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  395|  17.9k|                    uv_vmask[1][sidx] &= ~smask;
  396|  17.9k|                    uv_vmask[0][sidx] &= ~smask;
  397|  17.9k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  398|  17.9k|                }
  399|  1.79k|            }
  400|  4.90k|        }
  401|  3.62k|    }
  402|       |
  403|  17.5k|    pixel *ptr;
  404|  17.5k|    uint8_t (*level_ptr)[4] = f->lf.level + f->b4_stride * sby * sbsz;
  405|  38.5k|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (405:44): [True: 21.0k, False: 17.5k]
  ------------------
  406|  21.0k|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  407|  21.0k|    {
  408|  21.0k|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  409|  21.0k|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  410|  21.0k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  411|  21.0k|    }
  412|       |
  413|  17.5k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (413:9): [True: 12.0k, False: 5.54k]
  |  Branch (413:46): [True: 11.7k, False: 269]
  ------------------
  414|  11.7k|        return;
  415|       |
  416|  5.81k|    ptrdiff_t uv_off;
  417|  5.81k|    level_ptr = f->lf.level + f->b4_stride * (sby * sbsz >> ss_ver);
  418|  12.7k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (418:44): [True: 6.92k, False: 5.81k]
  ------------------
  419|  6.92k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  420|  6.92k|    {
  421|  6.92k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  422|  6.92k|                             lflvl[x].filter_uv[0],
  423|  6.92k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  424|  6.92k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  425|  6.92k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  426|  6.92k|    }
  427|  5.81k|}
dav1d_loopfilter_sbrow_rows_8bpc:
  432|  17.5k|{
  433|  17.5k|    int x;
  434|       |    // Don't filter outside the frame
  435|  17.5k|    const int have_top = sby > 0;
  436|  17.5k|    const int is_sb64 = !f->seq_hdr->sb128;
  437|  17.5k|    const int starty4 = (sby & is_sb64) << 4;
  438|  17.5k|    const int sbsz = 32 >> is_sb64;
  439|  17.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  440|  17.5k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  441|  17.5k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  442|  17.5k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  443|       |
  444|  17.5k|    pixel *ptr;
  445|  17.5k|    uint8_t (*level_ptr)[4] = f->lf.level + f->b4_stride * sby * sbsz;
  446|  38.5k|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (446:29): [True: 21.0k, False: 17.5k]
  ------------------
  447|  21.0k|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  448|  21.0k|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  449|  21.0k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  450|  21.0k|    }
  451|       |
  452|  17.5k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (452:9): [True: 12.0k, False: 5.54k]
  |  Branch (452:46): [True: 11.7k, False: 269]
  ------------------
  453|  11.7k|        return;
  454|       |
  455|  5.81k|    ptrdiff_t uv_off;
  456|  5.81k|    level_ptr = f->lf.level + f->b4_stride * (sby * sbsz >> ss_ver);
  457|  12.7k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (457:29): [True: 6.92k, False: 5.81k]
  ------------------
  458|  6.92k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  459|  6.92k|    {
  460|  6.92k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  461|  6.92k|                             lflvl[x].filter_uv[1],
  462|  6.92k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  463|  6.92k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  464|  6.92k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  465|  6.92k|    }
  466|  5.81k|}
lf_apply_tmpl.c:backup_lpf:
   47|   105k|{
   48|   105k|    const int cdef_backup = !lr_backup;
   49|   105k|    const int dst_w = f->frame_hdr->super_res.enabled ?
  ------------------
  |  Branch (49:23): [True: 0, False: 105k]
  ------------------
   50|   105k|                      (f->frame_hdr->width[1] + ss_hor) >> ss_hor : src_w;
   51|       |
   52|       |    // The first stripe of the frame is shorter by 8 luma pixel rows.
   53|   105k|    int stripe_h = ((64 << (cdef_backup & sb128)) - 8 * !row) >> ss_ver;
   54|   105k|    src += (stripe_h - 2) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|   105k|#define PXSTRIDE(x) (x)
  ------------------
   55|       |
   56|   105k|    if (f->c->n_tc == 1) {
  ------------------
  |  Branch (56:9): [True: 5.73k, False: 99.8k]
  ------------------
   57|  5.73k|        if (row) {
  ------------------
  |  Branch (57:13): [True: 1.61k, False: 4.12k]
  ------------------
   58|  1.61k|            const int top = 4 << sb128;
   59|       |            // Copy the top part of the stored loop filtered pixels from the
   60|       |            // previous sb row needed above the first stripe of this sb row.
   61|  1.61k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   47|  1.61k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   62|  1.61k|                       &dst[PXSTRIDE(dst_stride) *  top],      dst_w);
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   63|  1.61k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   47|  1.61k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   64|  1.61k|                       &dst[PXSTRIDE(dst_stride) * (top + 1)], dst_w);
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   65|  1.61k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   47|  1.61k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   66|  1.61k|                       &dst[PXSTRIDE(dst_stride) * (top + 2)], dst_w);
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   67|  1.61k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   47|  1.61k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   68|  1.61k|                       &dst[PXSTRIDE(dst_stride) * (top + 3)], dst_w);
  ------------------
  |  |   53|  1.61k|#define PXSTRIDE(x) (x)
  ------------------
   69|  1.61k|        }
   70|  5.73k|        dst += 4 * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  5.73k|#define PXSTRIDE(x) (x)
  ------------------
   71|  5.73k|    }
   72|       |
   73|   105k|    if (lr_backup && (f->frame_hdr->width[0] != f->frame_hdr->width[1])) {
  ------------------
  |  Branch (73:9): [True: 105k, False: 0]
  |  Branch (73:22): [True: 0, False: 105k]
  ------------------
   74|      0|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (74:16): [True: 0, False: 0]
  ------------------
   75|      0|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   76|      0|            f->dsp->mc.resize(dst, dst_stride, src, src_stride,
   77|      0|                              dst_w, n_lines, src_w, f->resize_step[ss_hor],
   78|      0|                              f->resize_start[ss_hor] HIGHBD_CALL_SUFFIX);
   79|      0|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   80|      0|            stripe_h = 64 >> ss_ver;
   81|      0|            src += stripe_h * PXSTRIDE(src_stride);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   82|      0|            dst += n_lines * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   83|      0|            if (n_lines == 3) {
  ------------------
  |  Branch (83:17): [True: 0, False: 0]
  ------------------
   84|      0|                pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   85|      0|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   86|      0|            }
   87|      0|        }
   88|   105k|    } else {
   89|   135k|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (89:16): [True: 29.9k, False: 105k]
  ------------------
   90|  29.9k|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   91|   149k|            for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (91:29): [True: 119k, False: 29.9k]
  ------------------
   92|   119k|                pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   47|   119k|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   53|    455|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (92:33): [True: 455, False: 119k]
  ------------------
   93|   119k|                                               src, src_w);
   94|   119k|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|   119k|#define PXSTRIDE(x) (x)
  ------------------
   95|   119k|                src += PXSTRIDE(src_stride);
  ------------------
  |  |   53|   119k|#define PXSTRIDE(x) (x)
  ------------------
   96|   119k|            }
   97|  29.9k|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   98|  29.9k|            stripe_h = 64 >> ss_ver;
   99|  29.9k|            src += (stripe_h - 4) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  29.9k|#define PXSTRIDE(x) (x)
  ------------------
  100|  29.9k|        }
  101|   105k|    }
  102|   105k|}
lf_apply_tmpl.c:filter_plane_cols_y:
  184|  27.1k|{
  185|  27.1k|    const Dav1dDSPContext *const dsp = f->dsp;
  186|       |
  187|       |    // filter edges between columns (e.g. block1 | block2)
  188|   341k|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (188:21): [True: 314k, False: 27.1k]
  ------------------
  189|   314k|        if (!have_left && !x) continue;
  ------------------
  |  Branch (189:13): [True: 257k, False: 57.0k]
  |  Branch (189:27): [True: 23.3k, False: 234k]
  ------------------
  190|   291k|        uint32_t hmask[4];
  191|   291k|        if (!starty4) {
  ------------------
  |  Branch (191:13): [True: 212k, False: 78.7k]
  ------------------
  192|   212k|            hmask[0] = mask[x][0][0];
  193|   212k|            hmask[1] = mask[x][1][0];
  194|   212k|            hmask[2] = mask[x][2][0];
  195|   212k|            if (endy4 > 16) {
  ------------------
  |  Branch (195:17): [True: 0, False: 212k]
  ------------------
  196|      0|                hmask[0] |= (unsigned) mask[x][0][1] << 16;
  197|      0|                hmask[1] |= (unsigned) mask[x][1][1] << 16;
  198|      0|                hmask[2] |= (unsigned) mask[x][2][1] << 16;
  199|      0|            }
  200|   212k|        } else {
  201|  78.7k|            hmask[0] = mask[x][0][1];
  202|  78.7k|            hmask[1] = mask[x][1][1];
  203|  78.7k|            hmask[2] = mask[x][2][1];
  204|  78.7k|        }
  205|   291k|        hmask[3] = 0;
  206|   291k|        dsp->lf.loop_filter_sb[0][0](&dst[x * 4], ls, hmask,
  207|   291k|                                     (const uint8_t(*)[4]) &lvl[x][0], b4_stride,
  208|   291k|                                     &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  209|   291k|    }
  210|  27.1k|}
lf_apply_tmpl.c:filter_plane_cols_uv:
  251|  9.12k|{
  252|  9.12k|    const Dav1dDSPContext *const dsp = f->dsp;
  253|       |
  254|       |    // filter edges between columns (e.g. block1 | block2)
  255|  76.0k|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (255:21): [True: 66.9k, False: 9.12k]
  ------------------
  256|  66.9k|        if (!have_left && !x) continue;
  ------------------
  |  Branch (256:13): [True: 55.7k, False: 11.1k]
  |  Branch (256:27): [True: 7.84k, False: 47.9k]
  ------------------
  257|  59.0k|        uint32_t hmask[3];
  258|  59.0k|        if (!starty4) {
  ------------------
  |  Branch (258:13): [True: 43.4k, False: 15.6k]
  ------------------
  259|  43.4k|            hmask[0] = mask[x][0][0];
  260|  43.4k|            hmask[1] = mask[x][1][0];
  261|  43.4k|            if (endy4 > (16 >> ss_ver)) {
  ------------------
  |  Branch (261:17): [True: 0, False: 43.4k]
  ------------------
  262|      0|                hmask[0] |= (unsigned) mask[x][0][1] << (16 >> ss_ver);
  263|      0|                hmask[1] |= (unsigned) mask[x][1][1] << (16 >> ss_ver);
  264|      0|            }
  265|  43.4k|        } else {
  266|  15.6k|            hmask[0] = mask[x][0][1];
  267|  15.6k|            hmask[1] = mask[x][1][1];
  268|  15.6k|        }
  269|  59.0k|        hmask[2] = 0;
  270|  59.0k|        dsp->lf.loop_filter_sb[1][0](&u[x * 4], ls, hmask,
  271|  59.0k|                                     (const uint8_t(*)[4]) &lvl[x][2], b4_stride,
  272|  59.0k|                                     &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  273|  59.0k|        dsp->lf.loop_filter_sb[1][0](&v[x * 4], ls, hmask,
  274|  59.0k|                                     (const uint8_t(*)[4]) &lvl[x][3], b4_stride,
  275|  59.0k|                                     &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  276|  59.0k|    }
  277|  9.12k|}
lf_apply_tmpl.c:filter_plane_rows_y:
  220|  27.1k|{
  221|  27.1k|    const Dav1dDSPContext *const dsp = f->dsp;
  222|       |
  223|       |    //                                 block1
  224|       |    // filter edges between rows (e.g. ------)
  225|       |    //                                 block2
  226|   256k|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (226:27): [True: 229k, False: 27.1k]
  ------------------
  227|   229k|         y++, dst += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|   229k|#define PXSTRIDE(x) (x)
  ------------------
  228|   229k|    {
  229|   229k|        if (!have_top && !y) continue;
  ------------------
  |  Branch (229:13): [True: 133k, False: 95.9k]
  |  Branch (229:26): [True: 18.8k, False: 114k]
  ------------------
  230|   210k|        const uint32_t vmask[4] = {
  231|   210k|            mask[y][0][0] | ((unsigned) mask[y][0][1] << 16),
  232|   210k|            mask[y][1][0] | ((unsigned) mask[y][1][1] << 16),
  233|   210k|            mask[y][2][0] | ((unsigned) mask[y][2][1] << 16),
  234|   210k|            0,
  235|   210k|        };
  236|   210k|        dsp->lf.loop_filter_sb[0][1](dst, ls, vmask,
  237|   210k|                                     (const uint8_t(*)[4]) &lvl[0][1], b4_stride,
  238|   210k|                                     &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  239|   210k|    }
  240|  27.1k|}
lf_apply_tmpl.c:filter_plane_rows_uv:
  288|  9.12k|{
  289|  9.12k|    const Dav1dDSPContext *const dsp = f->dsp;
  290|  9.12k|    ptrdiff_t off_l = 0;
  291|       |
  292|       |    //                                 block1
  293|       |    // filter edges between rows (e.g. ------)
  294|       |    //                                 block2
  295|  67.7k|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (295:27): [True: 58.6k, False: 9.12k]
  ------------------
  296|  58.6k|         y++, off_l += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|  58.6k|#define PXSTRIDE(x) (x)
  ------------------
  297|  58.6k|    {
  298|  58.6k|        if (!have_top && !y) continue;
  ------------------
  |  Branch (298:13): [True: 34.5k, False: 24.1k]
  |  Branch (298:26): [True: 6.30k, False: 28.2k]
  ------------------
  299|  52.3k|        const uint32_t vmask[3] = {
  300|  52.3k|            mask[y][0][0] | ((unsigned) mask[y][0][1] << (16 >> ss_hor)),
  301|  52.3k|            mask[y][1][0] | ((unsigned) mask[y][1][1] << (16 >> ss_hor)),
  302|  52.3k|            0,
  303|  52.3k|        };
  304|  52.3k|        dsp->lf.loop_filter_sb[1][1](&u[off_l], ls, vmask,
  305|  52.3k|                                     (const uint8_t(*)[4]) &lvl[0][2], b4_stride,
  306|  52.3k|                                     &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  307|  52.3k|        dsp->lf.loop_filter_sb[1][1](&v[off_l], ls, vmask,
  308|  52.3k|                                     (const uint8_t(*)[4]) &lvl[0][3], b4_stride,
  309|  52.3k|                                     &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  310|  52.3k|    }
  311|  9.12k|}
dav1d_copy_lpf_16bpc:
  106|  17.1k|{
  107|  17.1k|    const int have_tt = f->c->n_tc > 1;
  108|  17.1k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|  17.1k|    const int offset = 8 * !!sby;
  110|  17.1k|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|  17.1k|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|  17.1k|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|  17.1k|    pixel *const dst[3] = {
  114|  17.1k|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  115|  17.1k|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  116|  17.1k|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  117|  17.1k|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|  17.1k|    const int restore_planes = f->lf.restore_planes;
  121|       |
  122|  17.1k|    if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (122:9): [True: 17.1k, False: 0]
  |  Branch (122:29): [True: 0, False: 0]
  ------------------
  123|  17.1k|        const int h = f->cur.p.h;
  124|  17.1k|        const int w = f->bw << 2;
  125|  17.1k|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  126|  17.1k|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  127|  17.1k|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (127:13): [True: 252, False: 16.9k]
  |  Branch (127:46): [True: 16.9k, False: 0]
  ------------------
  128|  17.1k|            backup_lpf(f, dst[0], lr_stride[0],
  129|  17.1k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  130|  17.1k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  131|  17.1k|        if (have_tt && resize) {
  ------------------
  |  Branch (131:13): [True: 16.0k, False: 1.16k]
  |  Branch (131:24): [True: 0, False: 16.0k]
  ------------------
  132|      0|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  133|      0|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  134|      0|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  135|      0|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  136|      0|        }
  137|  17.1k|    }
  138|  17.1k|    if ((f->seq_hdr->cdef || restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) &&
  ------------------
  |  Branch (138:10): [True: 17.1k, False: 0]
  |  Branch (138:30): [True: 0, False: 0]
  ------------------
  139|  17.1k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (139:9): [True: 7.50k, False: 9.67k]
  ------------------
  140|  7.50k|    {
  141|  7.50k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  142|  7.50k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  143|  7.50k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  144|  7.50k|        const int w = f->bw << (2 - ss_hor);
  145|  7.50k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  146|  7.50k|        const int offset_uv = offset >> ss_ver;
  147|  7.50k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  148|  7.50k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  149|  7.50k|        if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_U) {
  ------------------
  |  Branch (149:13): [True: 7.50k, False: 0]
  |  Branch (149:33): [True: 0, False: 0]
  ------------------
  150|  7.50k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (150:17): [True: 14, False: 7.48k]
  |  Branch (150:50): [True: 7.48k, False: 0]
  ------------------
  151|  7.50k|                backup_lpf(f, dst[1], lr_stride[1],
  152|  7.50k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  153|  7.50k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  154|  7.50k|                           row_h, w, h, ss_hor, 1);
  155|  7.50k|            if (have_tt && resize)
  ------------------
  |  Branch (155:17): [True: 7.03k, False: 467]
  |  Branch (155:28): [True: 0, False: 7.03k]
  ------------------
  156|      0|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  157|      0|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  158|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  159|      0|                           row_h, w, h, ss_hor, 0);
  160|  7.50k|        }
  161|  7.50k|        if (f->seq_hdr->cdef || restore_planes & LR_RESTORE_V) {
  ------------------
  |  Branch (161:13): [True: 7.50k, False: 0]
  |  Branch (161:33): [True: 0, False: 0]
  ------------------
  162|  7.50k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (162:17): [True: 15, False: 7.48k]
  |  Branch (162:50): [True: 7.48k, False: 0]
  ------------------
  163|  7.50k|                backup_lpf(f, dst[2], lr_stride[1],
  164|  7.50k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  165|  7.50k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  166|  7.50k|                           row_h, w, h, ss_hor, 1);
  167|  7.50k|            if (have_tt && resize)
  ------------------
  |  Branch (167:17): [True: 7.03k, False: 467]
  |  Branch (167:28): [True: 0, False: 7.03k]
  ------------------
  168|      0|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  169|      0|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  170|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  171|      0|                           row_h, w, h, ss_hor, 0);
  172|  7.50k|        }
  173|  7.50k|    }
  174|  17.1k|}
dav1d_loopfilter_sbrow_cols_16bpc:
  316|  5.74k|{
  317|  5.74k|    int x, have_left;
  318|       |    // Don't filter outside the frame
  319|  5.74k|    const int is_sb64 = !f->seq_hdr->sb128;
  320|  5.74k|    const int starty4 = (sby & is_sb64) << 4;
  321|  5.74k|    const int sbsz = 32 >> is_sb64;
  322|  5.74k|    const int sbl2 = 5 - is_sb64;
  323|  5.74k|    const int halign = (f->bh + 31) & ~31;
  324|  5.74k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  325|  5.74k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  326|  5.74k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  327|  5.74k|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  328|  5.74k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  329|  5.74k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  330|       |
  331|       |    // fix lpf strength at tile col boundaries
  332|  5.74k|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  333|  5.74k|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  334|  6.84k|    for (int tile_col = 1;; tile_col++) {
  335|  6.84k|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  336|  6.84k|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (336:13): [True: 5.74k, False: 1.09k]
  ------------------
  337|  1.09k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (337:25): [True: 766, False: 333]
  ------------------
  338|  1.09k|        x >>= is_sb64;
  339|       |
  340|  1.09k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  341|  5.42k|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (341:51): [True: 4.32k, False: 1.09k]
  ------------------
  342|  4.32k|            const int sidx = mask >= 0x10000U;
  343|  4.32k|            const unsigned smask = mask >> (sidx << 4);
  344|  4.32k|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  345|  4.32k|                                !!(y_hmask[1][sidx] & smask);
  346|  4.32k|            y_hmask[2][sidx] &= ~smask;
  347|  4.32k|            y_hmask[1][sidx] &= ~smask;
  348|  4.32k|            y_hmask[0][sidx] &= ~smask;
  349|  4.32k|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  350|  4.32k|        }
  351|       |
  352|  1.09k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (352:13): [True: 553, False: 546]
  ------------------
  353|    553|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  354|  2.09k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (354:68): [True: 1.54k, False: 553]
  ------------------
  355|  1.54k|                 y++, uv_mask <<= 1)
  356|  1.54k|            {
  357|  1.54k|                const int sidx = uv_mask >= vmax;
  358|  1.54k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  359|  1.54k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  360|  1.54k|                uv_hmask[1][sidx] &= ~smask;
  361|  1.54k|                uv_hmask[0][sidx] &= ~smask;
  362|  1.54k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  363|  1.54k|            }
  364|    553|        }
  365|  1.09k|        lpf_y  += halign;
  366|  1.09k|        lpf_uv += halign >> ss_ver;
  367|  1.09k|    }
  368|       |
  369|       |    // fix lpf strength at tile row boundaries
  370|  5.74k|    if (start_of_tile_row) {
  ------------------
  |  Branch (370:9): [True: 1.14k, False: 4.60k]
  ------------------
  371|  1.14k|        const BlockContext *a;
  372|  1.14k|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  373|  2.28k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (373:14): [True: 1.14k, False: 1.14k]
  ------------------
  374|  1.14k|        {
  375|  1.14k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  376|  1.14k|            const unsigned w = imin(32, f->w4 - (x << 5));
  377|  5.77k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (377:44): [True: 4.63k, False: 1.14k]
  ------------------
  378|  4.63k|                const int sidx = mask >= 0x10000U;
  379|  4.63k|                const unsigned smask = mask >> (sidx << 4);
  380|  4.63k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  381|  4.63k|                                    !!(y_vmask[1][sidx] & smask);
  382|  4.63k|                y_vmask[2][sidx] &= ~smask;
  383|  4.63k|                y_vmask[1][sidx] &= ~smask;
  384|  4.63k|                y_vmask[0][sidx] &= ~smask;
  385|  4.63k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  386|  4.63k|            }
  387|       |
  388|  1.14k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (388:17): [True: 508, False: 635]
  ------------------
  389|    508|                const unsigned cw = (w + ss_hor) >> ss_hor;
  390|    508|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  391|  1.65k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (391:51): [True: 1.14k, False: 508]
  ------------------
  392|  1.14k|                    const int sidx = uv_mask >= hmax;
  393|  1.14k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  394|  1.14k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  395|  1.14k|                    uv_vmask[1][sidx] &= ~smask;
  396|  1.14k|                    uv_vmask[0][sidx] &= ~smask;
  397|  1.14k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  398|  1.14k|                }
  399|    508|            }
  400|  1.14k|        }
  401|  1.14k|    }
  402|       |
  403|  5.74k|    pixel *ptr;
  404|  5.74k|    uint8_t (*level_ptr)[4] = f->lf.level + f->b4_stride * sby * sbsz;
  405|  11.9k|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (405:44): [True: 6.16k, False: 5.74k]
  ------------------
  406|  6.16k|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  407|  6.16k|    {
  408|  6.16k|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  409|  6.16k|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  410|  6.16k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  411|  6.16k|    }
  412|       |
  413|  5.74k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (413:9): [True: 3.86k, False: 1.87k]
  |  Branch (413:46): [True: 3.72k, False: 148]
  ------------------
  414|  3.72k|        return;
  415|       |
  416|  2.02k|    ptrdiff_t uv_off;
  417|  2.02k|    level_ptr = f->lf.level + f->b4_stride * (sby * sbsz >> ss_ver);
  418|  4.22k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (418:44): [True: 2.19k, False: 2.02k]
  ------------------
  419|  2.19k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  420|  2.19k|    {
  421|  2.19k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  422|  2.19k|                             lflvl[x].filter_uv[0],
  423|  2.19k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  424|  2.19k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  425|  2.19k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  426|  2.19k|    }
  427|  2.02k|}
dav1d_loopfilter_sbrow_rows_16bpc:
  432|  5.74k|{
  433|  5.74k|    int x;
  434|       |    // Don't filter outside the frame
  435|  5.74k|    const int have_top = sby > 0;
  436|  5.74k|    const int is_sb64 = !f->seq_hdr->sb128;
  437|  5.74k|    const int starty4 = (sby & is_sb64) << 4;
  438|  5.74k|    const int sbsz = 32 >> is_sb64;
  439|  5.74k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  440|  5.74k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  441|  5.74k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  442|  5.74k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  443|       |
  444|  5.74k|    pixel *ptr;
  445|  5.74k|    uint8_t (*level_ptr)[4] = f->lf.level + f->b4_stride * sby * sbsz;
  446|  11.9k|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (446:29): [True: 6.16k, False: 5.74k]
  ------------------
  447|  6.16k|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  448|  6.16k|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  449|  6.16k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  450|  6.16k|    }
  451|       |
  452|  5.74k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (452:9): [True: 3.86k, False: 1.87k]
  |  Branch (452:46): [True: 3.72k, False: 148]
  ------------------
  453|  3.72k|        return;
  454|       |
  455|  2.02k|    ptrdiff_t uv_off;
  456|  2.02k|    level_ptr = f->lf.level + f->b4_stride * (sby * sbsz >> ss_ver);
  457|  4.22k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (457:29): [True: 2.19k, False: 2.02k]
  ------------------
  458|  2.19k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  459|  2.19k|    {
  460|  2.19k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  461|  2.19k|                             lflvl[x].filter_uv[1],
  462|  2.19k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  463|  2.19k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  464|  2.19k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  465|  2.19k|    }
  466|  2.02k|}

dav1d_create_lf_mask_intra:
  271|   207k|{
  272|   207k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  273|   207k|    const int bw4 = imin(iw - bx, b_dim[0]);
  274|   207k|    const int bh4 = imin(ih - by, b_dim[1]);
  275|   207k|    const int bx4 = bx & 31;
  276|   207k|    const int by4 = by & 31;
  277|   207k|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  |  140|   414k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 207k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 207k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 207k]
  |  |  ------------------
  ------------------
  278|       |
  279|   207k|    if (bw4 && bh4) {
  ------------------
  |  Branch (279:9): [True: 206k, False: 465]
  |  Branch (279:16): [True: 206k, False: 559]
  ------------------
  280|   206k|        uint8_t (*level_cache_ptr)[4] = level_cache + by * b4_stride + bx;
  281|   719k|        for (int y = 0; y < bh4; y++) {
  ------------------
  |  Branch (281:25): [True: 513k, False: 206k]
  ------------------
  282|  2.11M|            for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (282:29): [True: 1.60M, False: 513k]
  ------------------
  283|  1.60M|                level_cache_ptr[x][0] = filter_level[0][0][0];
  284|  1.60M|                level_cache_ptr[x][1] = filter_level[1][0][0];
  285|  1.60M|            }
  286|   513k|            level_cache_ptr += b4_stride;
  287|   513k|        }
  288|       |
  289|   206k|        mask_edges_intra(lflvl->filter_y, by4, bx4, bw4, bh4, ytx, ay, ly);
  290|   206k|    }
  291|       |
  292|   207k|    if (!auv) return;
  ------------------
  |  Branch (292:9): [True: 126k, False: 80.5k]
  ------------------
  293|       |
  294|  80.5k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  295|  80.5k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  296|  80.5k|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  297|  80.5k|                          (b_dim[0] + ss_hor) >> ss_hor);
  298|  80.5k|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  299|  80.5k|                          (b_dim[1] + ss_ver) >> ss_ver);
  300|  80.5k|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  |  140|   160k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 80.3k, False: 214]
  |  |  |  Branch (140:30): [True: 80.3k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 80.5k]
  |  |  ------------------
  ------------------
  301|       |
  302|  80.5k|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (302:9): [True: 585, False: 79.9k]
  |  Branch (302:18): [True: 446, False: 79.5k]
  ------------------
  303|       |
  304|  79.7k|    const int cbx4 = bx4 >> ss_hor;
  305|  79.7k|    const int cby4 = by4 >> ss_ver;
  306|       |
  307|  79.7k|    uint8_t (*level_cache_ptr)[4] =
  308|  79.7k|        level_cache + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  309|   221k|    for (int y = 0; y < cbh4; y++) {
  ------------------
  |  Branch (309:21): [True: 142k, False: 79.7k]
  ------------------
  310|   417k|        for (int x = 0; x < cbw4; x++) {
  ------------------
  |  Branch (310:25): [True: 274k, False: 142k]
  ------------------
  311|   274k|            level_cache_ptr[x][2] = filter_level[2][0][0];
  312|   274k|            level_cache_ptr[x][3] = filter_level[3][0][0];
  313|   274k|        }
  314|   142k|        level_cache_ptr += b4_stride;
  315|   142k|    }
  316|       |
  317|  79.7k|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, 0, uvtx,
  318|  79.7k|                      auv, luv, ss_hor, ss_ver);
  319|  79.7k|}
dav1d_create_lf_mask_inter:
  334|   205k|{
  335|   205k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  336|   205k|    const int bw4 = imin(iw - bx, b_dim[0]);
  337|   205k|    const int bh4 = imin(ih - by, b_dim[1]);
  338|   205k|    const int bx4 = bx & 31;
  339|   205k|    const int by4 = by & 31;
  340|   205k|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  |  140|   410k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 205k, False: 20]
  |  |  |  Branch (140:30): [True: 205k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 205k]
  |  |  ------------------
  ------------------
  341|       |
  342|   205k|    if (bw4 && bh4) {
  ------------------
  |  Branch (342:9): [True: 205k, False: 8]
  |  Branch (342:16): [True: 205k, False: 18.4E]
  ------------------
  343|   205k|        uint8_t (*level_cache_ptr)[4] = level_cache + by * b4_stride + bx;
  344|   708k|        for (int y = 0; y < bh4; y++) {
  ------------------
  |  Branch (344:25): [True: 503k, False: 205k]
  ------------------
  345|  1.99M|            for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (345:29): [True: 1.49M, False: 503k]
  ------------------
  346|  1.49M|                level_cache_ptr[x][0] = filter_level[0][0][0];
  347|  1.49M|                level_cache_ptr[x][1] = filter_level[1][0][0];
  348|  1.49M|            }
  349|   503k|            level_cache_ptr += b4_stride;
  350|   503k|        }
  351|       |
  352|   205k|        mask_edges_inter(lflvl->filter_y, by4, bx4, bw4, bh4, skip,
  353|   205k|                         max_ytx, tx_masks, ay, ly);
  354|   205k|    }
  355|       |
  356|   205k|    if (!auv) return;
  ------------------
  |  Branch (356:9): [True: 143k, False: 62.2k]
  ------------------
  357|       |
  358|  62.2k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  359|  62.2k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  360|  62.2k|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  361|  62.2k|                          (b_dim[0] + ss_hor) >> ss_hor);
  362|  62.2k|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  363|  62.2k|                          (b_dim[1] + ss_ver) >> ss_ver);
  364|  62.2k|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  |  140|   123k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 61.7k, False: 545]
  |  |  |  Branch (140:30): [True: 61.7k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
  365|       |
  366|  62.2k|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (366:9): [True: 537, False: 61.7k]
  |  Branch (366:18): [True: 18.4E, False: 61.7k]
  ------------------
  367|       |
  368|  62.2k|    const int cbx4 = bx4 >> ss_hor;
  369|  62.2k|    const int cby4 = by4 >> ss_ver;
  370|       |
  371|  62.2k|    uint8_t (*level_cache_ptr)[4] =
  372|  62.2k|        level_cache + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  373|   181k|    for (int y = 0; y < cbh4; y++) {
  ------------------
  |  Branch (373:21): [True: 119k, False: 62.2k]
  ------------------
  374|   373k|        for (int x = 0; x < cbw4; x++) {
  ------------------
  |  Branch (374:25): [True: 254k, False: 119k]
  ------------------
  375|   254k|            level_cache_ptr[x][2] = filter_level[2][0][0];
  376|   254k|            level_cache_ptr[x][3] = filter_level[3][0][0];
  377|   254k|        }
  378|   119k|        level_cache_ptr += b4_stride;
  379|   119k|    }
  380|       |
  381|  62.2k|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, skip, uvtx,
  382|  62.2k|                      auv, luv, ss_hor, ss_ver);
  383|  62.2k|}
dav1d_calc_eih:
  385|  11.8k|void dav1d_calc_eih(Av1FilterLUT *const lim_lut, const int filter_sharpness) {
  386|       |    // set E/I/H values from loopfilter level
  387|  11.8k|    const int sharp = filter_sharpness;
  388|   768k|    for (int level = 0; level < 64; level++) {
  ------------------
  |  Branch (388:25): [True: 756k, False: 11.8k]
  ------------------
  389|   756k|        int limit = level;
  390|       |
  391|   756k|        if (sharp > 0) {
  ------------------
  |  Branch (391:13): [True: 242k, False: 513k]
  ------------------
  392|   242k|            limit >>= (sharp + 3) >> 2;
  393|   242k|            limit = imin(limit, 9 - sharp);
  394|   242k|        }
  395|   756k|        limit = imax(limit, 1);
  396|       |
  397|   756k|        lim_lut->i[level] = limit;
  398|   756k|        lim_lut->e[level] = 2 * (level + 2) + limit;
  399|   756k|    }
  400|  11.8k|    lim_lut->sharp[0] = (sharp + 3) >> 2;
  401|  11.8k|    lim_lut->sharp[1] = sharp ? 9 - sharp : 0xff;
  ------------------
  |  Branch (401:25): [True: 3.79k, False: 8.02k]
  ------------------
  402|  11.8k|}
dav1d_calc_lf_values:
  441|  45.5k|{
  442|  45.5k|    const int n_seg = hdr->segmentation.enabled ? 8 : 1;
  ------------------
  |  Branch (442:23): [True: 0, False: 45.5k]
  ------------------
  443|       |
  444|  45.5k|    if (!hdr->loopfilter.level_y[0] && !hdr->loopfilter.level_y[1]) {
  ------------------
  |  Branch (444:9): [True: 28.7k, False: 16.8k]
  |  Branch (444:40): [True: 28.7k, False: 0]
  ------------------
  445|  28.7k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * n_seg);
  446|  28.7k|        return;
  447|  28.7k|    }
  448|       |
  449|  16.8k|    const Dav1dLoopfilterModeRefDeltas *const mr_deltas =
  450|  16.8k|        hdr->loopfilter.mode_ref_delta_enabled ?
  ------------------
  |  Branch (450:9): [True: 16.8k, False: 0]
  ------------------
  451|  16.8k|        &hdr->loopfilter.mode_ref_deltas : NULL;
  452|  33.6k|    for (int s = 0; s < n_seg; s++) {
  ------------------
  |  Branch (452:21): [True: 16.8k, False: 16.8k]
  ------------------
  453|  16.8k|        const Dav1dSegmentationData *const segd =
  454|  16.8k|            hdr->segmentation.enabled ? &hdr->segmentation.seg_data.d[s] : NULL;
  ------------------
  |  Branch (454:13): [True: 0, False: 16.8k]
  ------------------
  455|       |
  456|  16.8k|        calc_lf_value(lflvl_values[s][0], hdr->loopfilter.level_y[0],
  457|  16.8k|                      lf_delta[0], segd ? segd->delta_lf_y_v : 0, mr_deltas);
  ------------------
  |  Branch (457:36): [True: 0, False: 16.8k]
  ------------------
  458|  16.8k|        calc_lf_value(lflvl_values[s][1], hdr->loopfilter.level_y[1],
  459|  16.8k|                      lf_delta[hdr->delta.lf.multi ? 1 : 0],
  ------------------
  |  Branch (459:32): [True: 0, False: 16.8k]
  ------------------
  460|  16.8k|                      segd ? segd->delta_lf_y_h : 0, mr_deltas);
  ------------------
  |  Branch (460:23): [True: 0, False: 16.8k]
  ------------------
  461|  16.8k|        calc_lf_value_chroma(lflvl_values[s][2], hdr->loopfilter.level_u,
  462|  16.8k|                             lf_delta[hdr->delta.lf.multi ? 2 : 0],
  ------------------
  |  Branch (462:39): [True: 0, False: 16.8k]
  ------------------
  463|  16.8k|                             segd ? segd->delta_lf_u : 0, mr_deltas);
  ------------------
  |  Branch (463:30): [True: 0, False: 16.8k]
  ------------------
  464|  16.8k|        calc_lf_value_chroma(lflvl_values[s][3], hdr->loopfilter.level_v,
  465|  16.8k|                             lf_delta[hdr->delta.lf.multi ? 3 : 0],
  ------------------
  |  Branch (465:39): [True: 0, False: 16.8k]
  ------------------
  466|  16.8k|                             segd ? segd->delta_lf_v : 0, mr_deltas);
  ------------------
  |  Branch (466:30): [True: 0, False: 16.8k]
  ------------------
  467|  16.8k|    }
  468|  16.8k|}
lf_mask.c:mask_edges_intra:
  152|   206k|{
  153|   206k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  154|   206k|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  155|   206k|    const int twl4c = imin(2, twl4), thl4c = imin(2, thl4);
  156|   206k|    int y, x;
  157|       |
  158|       |    // left block edge
  159|   206k|    unsigned mask = 1U << by4;
  160|   719k|    for (y = 0; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (160:17): [True: 513k, False: 206k]
  ------------------
  161|   513k|        const int sidx = mask >= 0x10000;
  162|   513k|        const unsigned smask = mask >> (sidx << 4);
  163|   513k|        masks[0][bx4][imin(twl4c, l[y])][sidx] |= smask;
  164|   513k|    }
  165|       |
  166|       |    // top block edge
  167|   719k|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (167:35): [True: 513k, False: 206k]
  ------------------
  168|   513k|        const int sidx = mask >= 0x10000;
  169|   513k|        const unsigned smask = mask >> (sidx << 4);
  170|   513k|        masks[1][by4][imin(thl4c, a[x])][sidx] |= smask;
  171|   513k|    }
  172|       |
  173|       |    // inner (tx) left|right edges
  174|   206k|    const int hstep = t_dim->w;
  175|   206k|    unsigned t = 1U << by4;
  176|   206k|    unsigned inner = (unsigned) ((((uint64_t) t) << h4) - t);
  177|   206k|    unsigned inner1 = inner & 0xffff, inner2 = inner >> 16;
  178|   231k|    for (x = hstep; x < w4; x += hstep) {
  ------------------
  |  Branch (178:21): [True: 24.7k, False: 206k]
  ------------------
  179|  24.7k|        if (inner1) masks[0][bx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (179:13): [True: 19.3k, False: 5.36k]
  ------------------
  180|  24.7k|        if (inner2) masks[0][bx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (180:13): [True: 5.37k, False: 19.3k]
  ------------------
  181|  24.7k|    }
  182|       |
  183|       |    //            top
  184|       |    // inner (tx) --- edges
  185|       |    //           bottom
  186|   206k|    const int vstep = t_dim->h;
  187|   206k|    t = 1U << bx4;
  188|   206k|    inner = (unsigned) ((((uint64_t) t) << w4) - t);
  189|   206k|    inner1 = inner & 0xffff;
  190|   206k|    inner2 = inner >> 16;
  191|   230k|    for (y = vstep; y < h4; y += vstep) {
  ------------------
  |  Branch (191:21): [True: 24.2k, False: 206k]
  ------------------
  192|  24.2k|        if (inner1) masks[1][by4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (192:13): [True: 18.7k, False: 5.50k]
  ------------------
  193|  24.2k|        if (inner2) masks[1][by4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (193:13): [True: 5.52k, False: 18.7k]
  ------------------
  194|  24.2k|    }
  195|       |
  196|   206k|    dav1d_memset_likely_pow2(a, thl4c, w4);
  197|   206k|    dav1d_memset_likely_pow2(l, twl4c, h4);
  198|   206k|}
lf_mask.c:mask_edges_chroma:
  207|   141k|{
  208|   141k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  209|   141k|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  210|   141k|    const int twl4c = !!twl4, thl4c = !!thl4;
  211|   141k|    int y, x;
  212|   141k|    const int vbits = 4 - ss_ver, hbits = 4 - ss_hor;
  213|   141k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  214|   141k|    const unsigned vmax = 1 << vmask, hmax = 1 << hmask;
  215|       |
  216|       |    // left block edge
  217|   141k|    unsigned mask = 1U << cby4;
  218|   402k|    for (y = 0; y < ch4; y++, mask <<= 1) {
  ------------------
  |  Branch (218:17): [True: 261k, False: 141k]
  ------------------
  219|   261k|        const int sidx = mask >= vmax;
  220|   261k|        const unsigned smask = mask >> (sidx << vbits);
  221|   261k|        masks[0][cbx4][imin(twl4c, l[y])][sidx] |= smask;
  222|   261k|    }
  223|       |
  224|       |    // top block edge
  225|   359k|    for (x = 0, mask = 1U << cbx4; x < cw4; x++, mask <<= 1) {
  ------------------
  |  Branch (225:36): [True: 218k, False: 141k]
  ------------------
  226|   218k|        const int sidx = mask >= hmax;
  227|   218k|        const unsigned smask = mask >> (sidx << hbits);
  228|   218k|        masks[1][cby4][imin(thl4c, a[x])][sidx] |= smask;
  229|   218k|    }
  230|       |
  231|   141k|    if (!skip_inter) {
  ------------------
  |  Branch (231:9): [True: 140k, False: 986]
  ------------------
  232|       |        // inner (tx) left|right edges
  233|   140k|        const int hstep = t_dim->w;
  234|   140k|        unsigned t = 1U << cby4;
  235|   140k|        unsigned inner = (unsigned) ((((uint64_t) t) << ch4) - t);
  236|   140k|        unsigned inner1 = inner & ((1 << vmask) - 1), inner2 = inner >> vmask;
  237|   140k|        for (x = hstep; x < cw4; x += hstep) {
  ------------------
  |  Branch (237:25): [True: 30, False: 140k]
  ------------------
  238|     30|            if (inner1) masks[0][cbx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (238:17): [True: 21, False: 9]
  ------------------
  239|     30|            if (inner2) masks[0][cbx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (239:17): [True: 9, False: 21]
  ------------------
  240|     30|        }
  241|       |
  242|       |        //            top
  243|       |        // inner (tx) --- edges
  244|       |        //           bottom
  245|   140k|        const int vstep = t_dim->h;
  246|   140k|        t = 1U << cbx4;
  247|   140k|        inner = (unsigned) ((((uint64_t) t) << cw4) - t);
  248|   140k|        inner1 = inner & ((1 << hmask) - 1), inner2 = inner >> hmask;
  249|   140k|        for (y = vstep; y < ch4; y += vstep) {
  ------------------
  |  Branch (249:25): [True: 64, False: 140k]
  ------------------
  250|     64|            if (inner1) masks[1][cby4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (250:17): [True: 39, False: 25]
  ------------------
  251|     64|            if (inner2) masks[1][cby4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (251:17): [True: 25, False: 39]
  ------------------
  252|     64|        }
  253|   140k|    }
  254|       |
  255|   141k|    dav1d_memset_likely_pow2(a, thl4c, cw4);
  256|   141k|    dav1d_memset_likely_pow2(l, twl4c, ch4);
  257|   141k|}
lf_mask.c:mask_edges_inter:
   85|   205k|{
   86|   205k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[max_tx];
   87|   205k|    int y, x;
   88|       |
   89|   205k|    ALIGN_STK_16(uint8_t, txa, 2 /* edge */, [2 /* txsz, step */][32 /* y */][32 /* x */]);
  ------------------
  |  |  100|   205k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   205k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
   90|   410k|    for (int y_off = 0, y = 0; y < h4; y += t_dim->h, y_off++)
  ------------------
  |  Branch (90:32): [True: 205k, False: 205k]
  ------------------
   91|   410k|        for (int x_off = 0, x = 0; x < w4; x += t_dim->w, x_off++)
  ------------------
  |  Branch (91:36): [True: 205k, False: 205k]
  ------------------
   92|   205k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][y][x],
   93|   205k|                      max_tx, 0, y_off, x_off, tx_masks);
   94|       |
   95|       |    // left block edge
   96|   205k|    unsigned mask = 1U << by4;
   97|   708k|    for (y = 0; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (97:17): [True: 503k, False: 205k]
  ------------------
   98|   503k|        const int sidx = mask >= 0x10000;
   99|   503k|        const unsigned smask = mask >> (sidx << 4);
  100|   503k|        masks[0][bx4][imin(txa[0][0][y][0], l[y])][sidx] |= smask;
  101|   503k|    }
  102|       |
  103|       |    // top block edge
  104|   707k|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (104:35): [True: 502k, False: 205k]
  ------------------
  105|   502k|        const int sidx = mask >= 0x10000;
  106|   502k|        const unsigned smask = mask >> (sidx << 4);
  107|   502k|        masks[1][by4][imin(txa[1][0][0][x], a[x])][sidx] |= smask;
  108|   502k|    }
  109|       |
  110|   205k|    if (!skip) {
  ------------------
  |  Branch (110:9): [True: 200k, False: 4.24k]
  ------------------
  111|       |        // inner (tx) left|right edges
  112|   692k|        for (y = 0, mask = 1U << by4; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (112:39): [True: 491k, False: 200k]
  ------------------
  113|   491k|            const int sidx = mask >= 0x10000U;
  114|   491k|            const unsigned smask = mask >> (sidx << 4);
  115|   491k|            int ltx = txa[0][0][y][0];
  116|   491k|            int step = txa[0][1][y][0];
  117|   737k|            for (x = step; x < w4; x += step) {
  ------------------
  |  Branch (117:28): [True: 245k, False: 491k]
  ------------------
  118|   245k|                const int rtx = txa[0][0][y][x];
  119|   245k|                masks[0][bx4 + x][imin(rtx, ltx)][sidx] |= smask;
  120|   245k|                ltx = rtx;
  121|   245k|                step = txa[0][1][y][x];
  122|   245k|            }
  123|   491k|        }
  124|       |
  125|       |        //            top
  126|       |        // inner (tx) --- edges
  127|       |        //           bottom
  128|   691k|        for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (128:39): [True: 491k, False: 200k]
  ------------------
  129|   491k|            const int sidx = mask >= 0x10000U;
  130|   491k|            const unsigned smask = mask >> (sidx << 4);
  131|   491k|            int ttx = txa[1][0][0][x];
  132|   491k|            int step = txa[1][1][0][x];
  133|   735k|            for (y = step; y < h4; y += step) {
  ------------------
  |  Branch (133:28): [True: 244k, False: 491k]
  ------------------
  134|   244k|                const int btx = txa[1][0][y][x];
  135|   244k|                masks[1][by4 + y][imin(ttx, btx)][sidx] |= smask;
  136|   244k|                ttx = btx;
  137|   244k|                step = txa[1][1][y][x];
  138|   244k|            }
  139|   491k|        }
  140|   200k|    }
  141|       |
  142|   707k|    for (y = 0; y < h4; y++)
  ------------------
  |  Branch (142:17): [True: 502k, False: 205k]
  ------------------
  143|   502k|        l[y] = txa[0][0][y][w4 - 1];
  144|   205k|    memcpy(a, txa[1][0][h4 - 1], w4);
  145|   205k|}
lf_mask.c:decomp_tx:
   44|   459k|{
   45|   459k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
   46|   459k|    const int is_split = (from == (int) TX_4X4 || depth > 1) ? 0 :
  ------------------
  |  Branch (46:27): [True: 3.36k, False: 456k]
  |  Branch (46:51): [True: 77.8k, False: 378k]
  ------------------
   47|   459k|        (tx_masks[depth] >> (y_off * 4 + x_off)) & 1;
   48|       |
   49|   459k|    if (is_split) {
  ------------------
  |  Branch (49:9): [True: 69.9k, False: 389k]
  ------------------
   50|  69.9k|        const enum RectTxfmSize sub = t_dim->sub;
   51|  69.9k|        const int htw4 = t_dim->w >> 1, hth4 = t_dim->h >> 1;
   52|       |
   53|  69.9k|        decomp_tx(txa, sub, depth + 1, y_off * 2 + 0, x_off * 2 + 0, tx_masks);
   54|  69.9k|        if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (54:13): [True: 64.0k, False: 5.87k]
  ------------------
   55|  64.0k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][0][htw4],
   56|  64.0k|                      sub, depth + 1, y_off * 2 + 0, x_off * 2 + 1, tx_masks);
   57|  69.9k|        if (t_dim->h >= t_dim->w) {
  ------------------
  |  Branch (57:13): [True: 63.3k, False: 6.61k]
  ------------------
   58|  63.3k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][0],
   59|  63.3k|                      sub, depth + 1, y_off * 2 + 1, x_off * 2 + 0, tx_masks);
   60|  63.3k|            if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (60:17): [True: 57.4k, False: 5.84k]
  ------------------
   61|  57.4k|                decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][htw4],
   62|  57.4k|                          sub, depth + 1, y_off * 2 + 1, x_off * 2 + 1, tx_masks);
   63|  63.3k|        }
   64|   389k|    } else {
   65|   389k|        const int lw = imin(2, t_dim->lw), lh = imin(2, t_dim->lh);
   66|       |
   67|   389k|#define set_ctx(rep_macro) \
   68|   389k|        for (int y = 0; y < t_dim->h; y++) { \
   69|   389k|            rep_macro(txa[0][0][y], 0, lw); \
   70|   389k|            rep_macro(txa[1][0][y], 0, lh); \
   71|   389k|            txa[0][1][y][0] = t_dim->w; \
   72|   389k|        }
   73|   389k|        case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|   389k|    switch (var) { \
  |  |   81|  3.45k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |   68|  6.94k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:25): [True: 3.49k, False: 3.45k]
  |  |  |  |  ------------------
  |  |  |  |   69|  3.49k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  3.49k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.49k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   70|  3.49k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  3.49k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.49k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.49k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   72|  3.49k|        }
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 3.45k, False: 386k]
  |  |  ------------------
  |  |   82|   384k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |   68|  1.15M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:25): [True: 769k, False: 384k]
  |  |  |  |  ------------------
  |  |  |  |   69|   769k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   769k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   769k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   70|   769k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   769k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   769k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|   769k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   72|   769k|        }
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 384k, False: 5.05k]
  |  |  ------------------
  |  |   83|  1.23k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |   68|  5.76k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:25): [True: 4.53k, False: 1.23k]
  |  |  |  |  ------------------
  |  |  |  |   69|  4.53k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.53k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  4.53k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   70|  4.53k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.53k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  4.53k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  4.53k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   72|  4.53k|        }
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 1.23k, False: 388k]
  |  |  ------------------
  |  |   84|    483|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |   68|  4.29k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:25): [True: 3.81k, False: 483]
  |  |  |  |  ------------------
  |  |  |  |   69|  3.81k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  3.81k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  3.81k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   70|  3.81k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  3.81k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  3.81k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  3.81k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   72|  3.81k|        }
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 483, False: 388k]
  |  |  ------------------
  |  |   85|    115|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |   68|  1.92k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (68:25): [True: 1.80k, False: 115]
  |  |  |  |  ------------------
  |  |  |  |   69|  1.80k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  1.80k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.80k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.80k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.80k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   70|  1.80k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  1.80k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.80k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.80k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.80k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   71|  1.80k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   72|  1.80k|        }
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 115, False: 389k]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 389k]
  |  |  ------------------
  |  |   87|   389k|    }
  ------------------
   74|   389k|#undef set_ctx
   75|   389k|        dav1d_memset_pow2[t_dim->lw](txa[1][1][0], t_dim->h);
   76|   389k|    }
   77|   459k|}
lf_mask.c:calc_lf_value:
  408|  44.2k|{
  409|  44.2k|    const int base = iclip(iclip(base_lvl + lf_delta, 0, 63) + seg_delta, 0, 63);
  410|       |
  411|  44.2k|    if (!mr_delta) {
  ------------------
  |  Branch (411:9): [True: 0, False: 44.2k]
  ------------------
  412|      0|        memset(lflvl_values, base, sizeof(*lflvl_values) * 8);
  413|  44.2k|    } else {
  414|  44.2k|        const int sh = base >= 32;
  415|  44.2k|        lflvl_values[0][0] = lflvl_values[0][1] =
  416|  44.2k|            iclip(base + (mr_delta->ref_delta[0] * (1 << sh)), 0, 63);
  417|   354k|        for (int r = 1; r < 8; r++) {
  ------------------
  |  Branch (417:25): [True: 309k, False: 44.2k]
  ------------------
  418|   929k|            for (int m = 0; m < 2; m++) {
  ------------------
  |  Branch (418:29): [True: 619k, False: 309k]
  ------------------
  419|   619k|                const int delta =
  420|   619k|                    mr_delta->mode_delta[m] + mr_delta->ref_delta[r];
  421|   619k|                lflvl_values[r][m] = iclip(base + (delta * (1 << sh)), 0, 63);
  422|   619k|            }
  423|   309k|        }
  424|  44.2k|    }
  425|  44.2k|}
lf_mask.c:calc_lf_value_chroma:
  431|  33.6k|{
  432|  33.6k|    if (!base_lvl)
  ------------------
  |  Branch (432:9): [True: 22.9k, False: 10.6k]
  ------------------
  433|  22.9k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * 8);
  434|  10.6k|    else
  435|  10.6k|        calc_lf_value(lflvl_values, base_lvl, lf_delta, seg_delta, mr_delta);
  436|  33.6k|}

dav1d_default_settings:
   71|  11.3k|COLD void dav1d_default_settings(Dav1dSettings *const s) {
   72|  11.3k|    s->n_threads = 0;
   73|  11.3k|    s->max_frame_delay = 0;
   74|  11.3k|    s->apply_grain = 1;
   75|  11.3k|    s->allocator.cookie = NULL;
   76|  11.3k|    s->allocator.alloc_picture_callback = dav1d_default_picture_alloc;
   77|  11.3k|    s->allocator.release_picture_callback = dav1d_default_picture_release;
   78|       |    s->logger.cookie = NULL;
   79|  11.3k|    s->logger.callback = dav1d_log_default_callback;
   80|  11.3k|    s->operating_point = 0;
   81|  11.3k|    s->all_layers = 1; // just until the tests are adjusted
   82|  11.3k|    s->frame_size_limit = 0;
   83|  11.3k|    s->strict_std_compliance = 0;
   84|  11.3k|    s->output_invisible_frames = 0;
   85|  11.3k|    s->inloop_filters = DAV1D_INLOOPFILTER_ALL;
   86|  11.3k|    s->decode_frame_type = DAV1D_DECODEFRAMETYPE_ALL;
   87|  11.3k|}
dav1d_open:
  140|  11.3k|COLD int dav1d_open(Dav1dContext **const c_out, const Dav1dSettings *const s) {
  141|  11.3k|    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  142|  11.3k|    pthread_once(&initted, init_internal);
  143|       |
  144|  11.3k|    validate_input_or_ret(c_out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  11.3k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  145|  11.3k|    validate_input_or_ret(s != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  11.3k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  146|  11.3k|    validate_input_or_ret(s->n_threads >= 0 &&
  ------------------
  |  |   52|  22.7k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  147|  11.3k|                          s->n_threads <= DAV1D_MAX_THREADS, DAV1D_ERR(EINVAL));
  148|  11.3k|    validate_input_or_ret(s->max_frame_delay >= 0 &&
  ------------------
  |  |   52|  22.7k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  149|  11.3k|                          s->max_frame_delay <= DAV1D_MAX_FRAME_DELAY, DAV1D_ERR(EINVAL));
  150|  11.3k|    validate_input_or_ret(s->allocator.alloc_picture_callback != NULL,
  ------------------
  |  |   52|  11.3k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  151|  11.3k|                          DAV1D_ERR(EINVAL));
  152|  11.3k|    validate_input_or_ret(s->allocator.release_picture_callback != NULL,
  ------------------
  |  |   52|  11.3k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  153|  11.3k|                          DAV1D_ERR(EINVAL));
  154|  11.3k|    validate_input_or_ret(s->operating_point >= 0 &&
  ------------------
  |  |   52|  22.7k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  155|  11.3k|                          s->operating_point <= 31, DAV1D_ERR(EINVAL));
  156|  11.3k|    validate_input_or_ret(s->decode_frame_type >= DAV1D_DECODEFRAMETYPE_ALL &&
  ------------------
  |  |   52|  22.7k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  |  Branch (52:11): [True: 11.3k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  157|  11.3k|                          s->decode_frame_type <= DAV1D_DECODEFRAMETYPE_KEY, DAV1D_ERR(EINVAL));
  158|       |
  159|  11.3k|    pthread_attr_t thread_attr;
  160|  11.3k|    if (pthread_attr_init(&thread_attr)) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (160:9): [True: 0, False: 11.3k]
  ------------------
  161|  11.3k|    size_t stack_size = 1024 * 1024 + get_stack_size_internal(&thread_attr);
  162|       |
  163|  11.3k|    pthread_attr_setstacksize(&thread_attr, stack_size);
  164|       |
  165|  11.3k|    Dav1dContext *const c = *c_out = dav1d_alloc_aligned(ALLOC_COMMON_CTX, sizeof(*c), 64);
  ------------------
  |  |  134|  11.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  166|  11.3k|    if (!c) goto error;
  ------------------
  |  Branch (166:9): [True: 0, False: 11.3k]
  ------------------
  167|  11.3k|    memset(c, 0, sizeof(*c));
  168|       |
  169|  11.3k|    c->allocator = s->allocator;
  170|  11.3k|    c->logger = s->logger;
  171|  11.3k|    c->apply_grain = s->apply_grain;
  172|  11.3k|    c->operating_point = s->operating_point;
  173|  11.3k|    c->all_layers = s->all_layers;
  174|  11.3k|    c->frame_size_limit = s->frame_size_limit;
  175|  11.3k|    c->strict_std_compliance = s->strict_std_compliance;
  176|  11.3k|    c->output_invisible_frames = s->output_invisible_frames;
  177|  11.3k|    c->inloop_filters = s->inloop_filters;
  178|  11.3k|    c->decode_frame_type = s->decode_frame_type;
  179|       |
  180|  11.3k|    dav1d_data_props_set_defaults(&c->cached_error_props);
  181|       |
  182|  11.3k|    if (dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->seq_hdr_pool) ||
  ------------------
  |  |  131|  22.7k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  183|  11.3k|        dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->frame_hdr_pool) ||
  ------------------
  |  |  131|  22.7k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  184|  11.3k|        dav1d_mem_pool_init(ALLOC_SEGMAP, &c->segmap_pool) ||
  ------------------
  |  |  131|  22.7k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  185|  11.3k|        dav1d_mem_pool_init(ALLOC_REFMVS, &c->refmvs_pool) ||
  ------------------
  |  |  131|  22.7k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  186|  11.3k|        dav1d_mem_pool_init(ALLOC_PIC_CTX, &c->pic_ctx_pool) ||
  ------------------
  |  |  131|  22.7k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  187|  11.3k|        dav1d_mem_pool_init(ALLOC_CDF, &c->cdf_pool))
  ------------------
  |  |  131|  11.3k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  188|      0|    {
  189|      0|        goto error;
  190|      0|    }
  191|       |
  192|  11.3k|    if (c->allocator.alloc_picture_callback   == dav1d_default_picture_alloc &&
  ------------------
  |  Branch (192:9): [True: 11.3k, False: 0]
  ------------------
  193|  11.3k|        c->allocator.release_picture_callback == dav1d_default_picture_release)
  ------------------
  |  Branch (193:9): [True: 11.3k, False: 0]
  ------------------
  194|  11.3k|    {
  195|  11.3k|        if (c->allocator.cookie) goto error;
  ------------------
  |  Branch (195:13): [True: 0, False: 11.3k]
  ------------------
  196|  11.3k|        if (dav1d_mem_pool_init(ALLOC_PIC, &c->picture_pool)) goto error;
  ------------------
  |  |  131|  11.3k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
  197|  11.3k|        c->allocator.cookie = c->picture_pool;
  198|  11.3k|    } else if (c->allocator.alloc_picture_callback   == dav1d_default_picture_alloc ||
  ------------------
  |  Branch (198:16): [True: 0, False: 0]
  ------------------
  199|      0|               c->allocator.release_picture_callback == dav1d_default_picture_release)
  ------------------
  |  Branch (199:16): [True: 0, False: 0]
  ------------------
  200|      0|    {
  201|      0|        goto error;
  202|      0|    }
  203|       |
  204|       |    /* On 32-bit systems extremely large frame sizes can cause overflows in
  205|       |     * dav1d_decode_frame() malloc size calculations. Prevent that from occuring
  206|       |     * by enforcing a maximum frame size limit, chosen to roughly correspond to
  207|       |     * the largest size possible to decode without exhausting virtual memory. */
  208|  11.3k|    if (sizeof(size_t) < 8 && s->frame_size_limit - 1 >= 8192 * 8192) {
  ------------------
  |  Branch (208:9): [Folded, False: 11.3k]
  |  Branch (208:31): [True: 0, False: 0]
  ------------------
  209|      0|        c->frame_size_limit = 8192 * 8192;
  210|      0|        if (s->frame_size_limit)
  ------------------
  |  Branch (210:13): [True: 0, False: 0]
  ------------------
  211|      0|            dav1d_log(c, "Frame size limit reduced from %u to %u.\n",
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
  212|      0|                      s->frame_size_limit, c->frame_size_limit);
  213|      0|    }
  214|       |
  215|  11.3k|    c->flush = &c->flush_mem;
  216|  11.3k|    atomic_init(c->flush, 0);
  217|       |
  218|  11.3k|    get_num_threads(c, s, &c->n_tc, &c->n_fc);
  219|       |
  220|  11.3k|    c->fc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->fc) * c->n_fc, 32);
  ------------------
  |  |  134|  11.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  221|  11.3k|    if (!c->fc) goto error;
  ------------------
  |  Branch (221:9): [True: 0, False: 11.3k]
  ------------------
  222|  11.3k|    memset(c->fc, 0, sizeof(*c->fc) * c->n_fc);
  223|       |
  224|  11.3k|    c->tc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->tc) * c->n_tc, 64);
  ------------------
  |  |  134|  11.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  225|  11.3k|    if (!c->tc) goto error;
  ------------------
  |  Branch (225:9): [True: 0, False: 11.3k]
  ------------------
  226|  11.3k|    memset(c->tc, 0, sizeof(*c->tc) * c->n_tc);
  227|  11.3k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (227:9): [True: 10.8k, False: 587]
  ------------------
  228|  10.8k|        if (pthread_mutex_init(&c->task_thread.lock, NULL)) goto error;
  ------------------
  |  Branch (228:13): [True: 0, False: 10.8k]
  ------------------
  229|  10.8k|        if (pthread_cond_init(&c->task_thread.cond, NULL)) {
  ------------------
  |  Branch (229:13): [True: 0, False: 10.8k]
  ------------------
  230|      0|            pthread_mutex_destroy(&c->task_thread.lock);
  231|      0|            goto error;
  232|      0|        }
  233|  10.8k|        if (pthread_cond_init(&c->task_thread.delayed_fg.cond, NULL)) {
  ------------------
  |  Branch (233:13): [True: 0, False: 10.8k]
  ------------------
  234|      0|            pthread_cond_destroy(&c->task_thread.cond);
  235|      0|            pthread_mutex_destroy(&c->task_thread.lock);
  236|      0|            goto error;
  237|      0|        }
  238|  10.8k|        c->task_thread.cur = c->n_fc;
  239|  10.8k|        atomic_init(&c->task_thread.reset_task_cur, UINT_MAX);
  240|  10.8k|        atomic_init(&c->task_thread.cond_signaled, 0);
  241|  10.8k|        c->task_thread.inited = 1;
  242|  10.8k|    }
  243|       |
  244|  11.3k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (244:9): [True: 0, False: 11.3k]
  ------------------
  245|      0|        const size_t out_delayed_sz = sizeof(*c->frame_thread.out_delayed) * c->n_fc;
  246|      0|        c->frame_thread.out_delayed =
  247|      0|            dav1d_malloc(ALLOC_THREAD_CTX, out_delayed_sz);
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
  248|      0|        if (!c->frame_thread.out_delayed) goto error;
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|        memset(c->frame_thread.out_delayed, 0, out_delayed_sz);
  250|      0|    }
  251|  22.7k|    for (unsigned n = 0; n < c->n_fc; n++) {
  ------------------
  |  Branch (251:26): [True: 11.3k, False: 11.3k]
  ------------------
  252|  11.3k|        Dav1dFrameContext *const f = &c->fc[n];
  253|  11.3k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (253:13): [True: 10.8k, False: 587]
  ------------------
  254|  10.8k|            if (pthread_mutex_init(&f->task_thread.lock, NULL)) goto error;
  ------------------
  |  Branch (254:17): [True: 0, False: 10.8k]
  ------------------
  255|  10.8k|            if (pthread_cond_init(&f->task_thread.cond, NULL)) {
  ------------------
  |  Branch (255:17): [True: 0, False: 10.8k]
  ------------------
  256|      0|                pthread_mutex_destroy(&f->task_thread.lock);
  257|      0|                goto error;
  258|      0|            }
  259|  10.8k|            if (pthread_mutex_init(&f->task_thread.pending_tasks.lock, NULL)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 10.8k]
  ------------------
  260|      0|                pthread_cond_destroy(&f->task_thread.cond);
  261|      0|                pthread_mutex_destroy(&f->task_thread.lock);
  262|      0|                goto error;
  263|      0|            }
  264|  10.8k|        }
  265|  11.3k|        f->c = c;
  266|  11.3k|        f->task_thread.ttd = &c->task_thread;
  267|  11.3k|        f->lf.last_sharpness = -1;
  268|  11.3k|    }
  269|       |
  270|   356k|    for (unsigned m = 0; m < c->n_tc; m++) {
  ------------------
  |  Branch (270:26): [True: 344k, False: 11.3k]
  ------------------
  271|   344k|        Dav1dTaskContext *const t = &c->tc[m];
  272|   344k|        t->f = &c->fc[0];
  273|   344k|        t->task_thread.ttd = &c->task_thread;
  274|   344k|        t->c = c;
  275|   344k|        memset(t->cf_16bpc, 0, sizeof(t->cf_16bpc));
  276|   344k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (276:13): [True: 344k, False: 587]
  ------------------
  277|   344k|            if (pthread_mutex_init(&t->task_thread.td.lock, NULL)) goto error;
  ------------------
  |  Branch (277:17): [True: 0, False: 344k]
  ------------------
  278|   344k|            if (pthread_cond_init(&t->task_thread.td.cond, NULL)) {
  ------------------
  |  Branch (278:17): [True: 0, False: 344k]
  ------------------
  279|      0|                pthread_mutex_destroy(&t->task_thread.td.lock);
  280|      0|                goto error;
  281|      0|            }
  282|   344k|            if (pthread_create(&t->task_thread.td.thread, &thread_attr, dav1d_worker_task, t)) {
  ------------------
  |  Branch (282:17): [True: 0, False: 344k]
  ------------------
  283|      0|                pthread_cond_destroy(&t->task_thread.td.cond);
  284|      0|                pthread_mutex_destroy(&t->task_thread.td.lock);
  285|      0|                goto error;
  286|      0|            }
  287|   344k|            t->task_thread.td.inited = 1;
  288|   344k|        }
  289|   344k|    }
  290|  11.3k|    dav1d_pal_dsp_init(&c->pal_dsp);
  291|  11.3k|    dav1d_refmvs_dsp_init(&c->refmvs_dsp);
  292|       |
  293|  11.3k|    pthread_attr_destroy(&thread_attr);
  294|       |
  295|  11.3k|    return 0;
  296|       |
  297|      0|error:
  298|      0|    if (c) close_internal(c_out, 0);
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|      0|    pthread_attr_destroy(&thread_attr);
  300|      0|    return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  301|  11.3k|}
dav1d_send_data:
  439|  29.0k|{
  440|  29.0k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  29.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 29.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  441|  29.0k|    validate_input_or_ret(in != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  29.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 29.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  442|       |
  443|  29.0k|    if (in->data) {
  ------------------
  |  Branch (443:9): [True: 29.0k, False: 0]
  ------------------
  444|  29.0k|        validate_input_or_ret(in->sz > 0 && in->sz <= SIZE_MAX / 2, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  58.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 29.0k, False: 0]
  |  |  |  Branch (52:11): [True: 29.0k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  445|  29.0k|        c->drain = 0;
  446|  29.0k|    }
  447|  29.0k|    if (c->in.data)
  ------------------
  |  Branch (447:9): [True: 0, False: 29.0k]
  ------------------
  448|      0|        return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  449|  29.0k|    dav1d_data_ref(&c->in, in);
  450|       |
  451|  29.0k|    int res = gen_picture(c);
  452|  29.0k|    if (!res)
  ------------------
  |  Branch (452:9): [True: 29.0k, False: 0]
  ------------------
  453|  29.0k|        dav1d_data_unref_internal(in);
  454|       |
  455|  29.0k|    return res;
  456|  29.0k|}
dav1d_get_picture:
  459|  58.0k|{
  460|  58.0k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  58.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 58.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  461|  58.0k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  58.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 58.0k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  462|       |
  463|  58.0k|    const int drain = c->drain;
  464|  58.0k|    c->drain = 1;
  465|       |
  466|  58.0k|    int res = gen_picture(c);
  467|  58.0k|    if (res < 0)
  ------------------
  |  Branch (467:9): [True: 0, False: 58.0k]
  ------------------
  468|      0|        return res;
  469|       |
  470|  58.0k|    if (c->cached_error) {
  ------------------
  |  Branch (470:9): [True: 0, False: 58.0k]
  ------------------
  471|      0|        const int res = c->cached_error;
  472|      0|        c->cached_error = 0;
  473|      0|        return res;
  474|      0|    }
  475|       |
  476|  58.0k|    if (output_picture_ready(c, c->n_fc == 1))
  ------------------
  |  Branch (476:9): [True: 29.0k, False: 29.0k]
  ------------------
  477|  29.0k|        return output_image(c, out);
  478|       |
  479|  29.0k|    if (c->n_fc > 1 && drain)
  ------------------
  |  Branch (479:9): [True: 0, False: 29.0k]
  |  Branch (479:24): [True: 0, False: 0]
  ------------------
  480|      0|        return drain_picture(c, out);
  481|       |
  482|  29.0k|    return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  29.0k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  483|  29.0k|}
dav1d_flush:
  526|  11.3k|void dav1d_flush(Dav1dContext *const c) {
  527|  11.3k|    dav1d_data_unref_internal(&c->in);
  528|  11.3k|    if (c->out.p.frame_hdr)
  ------------------
  |  Branch (528:9): [True: 0, False: 11.3k]
  ------------------
  529|      0|        dav1d_thread_picture_unref(&c->out);
  530|  11.3k|    if (c->cache.p.frame_hdr)
  ------------------
  |  Branch (530:9): [True: 0, False: 11.3k]
  ------------------
  531|      0|        dav1d_thread_picture_unref(&c->cache);
  532|       |
  533|  11.3k|    c->drain = 0;
  534|  11.3k|    c->cached_error = 0;
  535|       |
  536|   102k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (536:21): [True: 91.0k, False: 11.3k]
  ------------------
  537|  91.0k|        if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (537:13): [True: 91.0k, False: 0]
  ------------------
  538|  91.0k|            dav1d_thread_picture_unref(&c->refs[i].p);
  539|  91.0k|        dav1d_ref_dec(&c->refs[i].segmap);
  540|  91.0k|        dav1d_ref_dec(&c->refs[i].refmvs);
  541|  91.0k|        dav1d_cdf_thread_unref(&c->cdf[i]);
  542|  91.0k|    }
  543|  11.3k|    c->frame_hdr = NULL;
  544|  11.3k|    c->seq_hdr = NULL;
  545|  11.3k|    dav1d_ref_dec(&c->seq_hdr_ref);
  546|       |
  547|  11.3k|    c->mastering_display = NULL;
  548|  11.3k|    c->content_light = NULL;
  549|  11.3k|    c->itut_t35 = NULL;
  550|  11.3k|    c->n_itut_t35 = 0;
  551|  11.3k|    dav1d_ref_dec(&c->mastering_display_ref);
  552|  11.3k|    dav1d_ref_dec(&c->content_light_ref);
  553|  11.3k|    dav1d_ref_dec(&c->itut_t35_ref);
  554|       |
  555|  11.3k|    dav1d_data_props_unref_internal(&c->cached_error_props);
  556|       |
  557|  11.3k|    if (c->n_fc == 1 && c->n_tc == 1) return;
  ------------------
  |  Branch (557:9): [True: 11.3k, False: 0]
  |  Branch (557:25): [True: 587, False: 10.8k]
  ------------------
  558|  11.3k|    atomic_store(c->flush, 1);
  559|       |
  560|  10.8k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (560:9): [True: 10.8k, False: 0]
  ------------------
  561|  10.8k|        pthread_mutex_lock(&c->task_thread.lock);
  562|       |        // stop running tasks in worker threads
  563|   354k|        for (unsigned i = 0; i < c->n_tc; i++) {
  ------------------
  |  Branch (563:30): [True: 344k, False: 10.8k]
  ------------------
  564|   344k|            Dav1dTaskContext *const tc = &c->tc[i];
  565|   345k|            while (!tc->task_thread.flushed) {
  ------------------
  |  Branch (565:20): [True: 971, False: 344k]
  ------------------
  566|    971|                pthread_cond_wait(&tc->task_thread.td.cond, &c->task_thread.lock);
  567|    971|            }
  568|   344k|        }
  569|  21.6k|        for (unsigned i = 0; i < c->n_fc; i++) {
  ------------------
  |  Branch (569:30): [True: 10.8k, False: 10.8k]
  ------------------
  570|  10.8k|            c->fc[i].task_thread.task_head = NULL;
  571|  10.8k|            c->fc[i].task_thread.task_tail = NULL;
  572|  10.8k|            c->fc[i].task_thread.task_cur_prev = NULL;
  573|  10.8k|            c->fc[i].task_thread.pending_tasks.head = NULL;
  574|  10.8k|            c->fc[i].task_thread.pending_tasks.tail = NULL;
  575|  10.8k|            atomic_init(&c->fc[i].task_thread.pending_tasks.merge, 0);
  576|  10.8k|        }
  577|  10.8k|        atomic_init(&c->task_thread.first, 0);
  578|  10.8k|        c->task_thread.cur = c->n_fc;
  579|  10.8k|        atomic_store(&c->task_thread.reset_task_cur, UINT_MAX);
  580|  10.8k|        atomic_store(&c->task_thread.cond_signaled, 0);
  581|  10.8k|        pthread_mutex_unlock(&c->task_thread.lock);
  582|  10.8k|    }
  583|       |
  584|  10.8k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (584:9): [True: 0, False: 10.8k]
  ------------------
  585|      0|        for (unsigned n = 0, next = c->frame_thread.next; n < c->n_fc; n++, next++) {
  ------------------
  |  Branch (585:59): [True: 0, False: 0]
  ------------------
  586|      0|            if (next == c->n_fc) next = 0;
  ------------------
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|            Dav1dFrameContext *const f = &c->fc[next];
  588|      0|            dav1d_decode_frame_exit(f, -1);
  589|      0|            f->n_tile_data = 0;
  590|      0|            f->task_thread.retval = 0;
  591|      0|            f->task_thread.error = 0;
  592|      0|            Dav1dThreadPicture *out_delayed = &c->frame_thread.out_delayed[next];
  593|      0|            if (out_delayed->p.frame_hdr) {
  ------------------
  |  Branch (593:17): [True: 0, False: 0]
  ------------------
  594|      0|                dav1d_thread_picture_unref(out_delayed);
  595|      0|            }
  596|      0|        }
  597|      0|        c->frame_thread.next = 0;
  598|      0|    }
  599|       |    atomic_store(c->flush, 0);
  600|  10.8k|}
dav1d_close:
  602|  11.3k|COLD void dav1d_close(Dav1dContext **const c_out) {
  603|  11.3k|    validate_input(c_out != NULL);
  ------------------
  |  |   59|  11.3k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  11.3k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 11.3k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  604|       |#if TRACK_HEAP_ALLOCATIONS
  605|       |    dav1d_log_alloc_stats(*c_out);
  606|       |#endif
  607|  11.3k|    close_internal(c_out, 1);
  608|  11.3k|}
dav1d_picture_unref:
  727|  40.4k|void dav1d_picture_unref(Dav1dPicture *const p) {
  728|  40.4k|    dav1d_picture_unref_internal(p);
  729|  40.4k|}
dav1d_data_wrap:
  740|  29.0k|{
  741|  29.0k|    return dav1d_data_wrap_internal(buf, ptr, sz, free_callback, user_data);
  742|  29.0k|}
lib.c:get_num_threads:
  111|  11.3k|{
  112|       |    /* ceil(sqrt(n)) */
  113|  11.3k|    static const uint8_t fc_lut[49] = {
  114|  11.3k|        1,                                     /*     1 */
  115|  11.3k|        2, 2, 2,                               /*  2- 4 */
  116|  11.3k|        3, 3, 3, 3, 3,                         /*  5- 9 */
  117|  11.3k|        4, 4, 4, 4, 4, 4, 4,                   /* 10-16 */
  118|  11.3k|        5, 5, 5, 5, 5, 5, 5, 5, 5,             /* 17-25 */
  119|  11.3k|        6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,       /* 26-36 */
  120|  11.3k|        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 37-49 */
  121|  11.3k|    };
  122|  11.3k|    *n_tc = s->n_threads ? s->n_threads :
  ------------------
  |  Branch (122:13): [True: 11.3k, False: 0]
  ------------------
  123|  11.3k|        iclip(dav1d_num_logical_processors(c), 1, DAV1D_MAX_THREADS);
  ------------------
  |  |   46|      0|#define DAV1D_MAX_THREADS 256
  ------------------
  124|  11.3k|    *n_fc = s->max_frame_delay ? umin(s->max_frame_delay, *n_tc) :
  ------------------
  |  Branch (124:13): [True: 11.3k, False: 0]
  ------------------
  125|  11.3k|            *n_tc < 50 ? fc_lut[*n_tc - 1] : 8; // min(8, ceil(sqrt(n)))
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|  11.3k|}
lib.c:init_internal:
   53|      1|static COLD void init_internal(void) {
   54|      1|    dav1d_init_cpu();
   55|      1|    dav1d_init_ii_wedge_masks();
   56|      1|    dav1d_init_intra_edge_tree();
   57|      1|    dav1d_init_qm_tables();
   58|      1|    dav1d_init_thread();
  ------------------
  |  |  144|      1|#define dav1d_init_thread() do {} while (0)
  |  |  ------------------
  |  |  |  Branch (144:42): [Folded, False: 1]
  |  |  ------------------
  ------------------
   59|      1|}
lib.c:get_stack_size_internal:
   93|  11.3k|static COLD size_t get_stack_size_internal(const pthread_attr_t *const thread_attr) {
   94|       |    /* glibc has an issue where the size of the TLS is subtracted from the stack
   95|       |     * size instead of allocated separately. As a result the specified stack
   96|       |     * size may be insufficient when used in an application with large amounts
   97|       |     * of TLS data. The following is a workaround to compensate for that.
   98|       |     * See https://sourceware.org/bugzilla/show_bug.cgi?id=11787 */
   99|  11.3k|    size_t (*const get_minstack)(const pthread_attr_t*) =
  100|  11.3k|        dlsym(RTLD_DEFAULT, "__pthread_get_minstack");
  101|  11.3k|    if (get_minstack)
  ------------------
  |  Branch (101:9): [True: 11.3k, False: 0]
  ------------------
  102|  11.3k|        return get_minstack(thread_attr) - PTHREAD_STACK_MIN;
  103|      0|    return 0;
  104|  11.3k|}
lib.c:gen_picture:
  413|  87.1k|{
  414|  87.1k|    Dav1dData *const in = &c->in;
  415|       |
  416|  87.1k|    if (output_picture_ready(c, 0))
  ------------------
  |  Branch (416:9): [True: 23.5k, False: 63.5k]
  ------------------
  417|  23.5k|        return 0;
  418|       |
  419|   108k|    while (in->sz > 0) {
  ------------------
  |  Branch (419:12): [True: 68.3k, False: 40.0k]
  ------------------
  420|  68.3k|        const ptrdiff_t res = dav1d_parse_obus(c, in);
  421|  68.3k|        if (res < 0) {
  ------------------
  |  Branch (421:13): [True: 0, False: 68.3k]
  ------------------
  422|      0|            dav1d_data_unref_internal(in);
  423|  68.3k|        } else {
  424|  68.3k|            assert((size_t)res <= in->sz);
  ------------------
  |  |  140|  68.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 68.3k]
  |  |  |  Branch (140:68): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
  425|  68.3k|            in->sz -= res;
  426|  68.3k|            in->data += res;
  427|  68.3k|            if (!in->sz) dav1d_data_unref_internal(in);
  ------------------
  |  Branch (427:17): [True: 29.0k, False: 39.2k]
  ------------------
  428|  68.3k|        }
  429|  68.3k|        if (output_picture_ready(c, 0))
  ------------------
  |  Branch (429:13): [True: 23.5k, False: 44.7k]
  ------------------
  430|  23.5k|            break;
  431|  44.7k|        if (res < 0)
  ------------------
  |  Branch (431:13): [True: 0, False: 44.7k]
  ------------------
  432|      0|            return (int)res;
  433|  44.7k|    }
  434|       |
  435|  63.5k|    return 0;
  436|  63.5k|}
lib.c:output_picture_ready:
  332|   213k|static int output_picture_ready(Dav1dContext *const c, const int drain) {
  333|   213k|    if (c->cached_error) return 1;
  ------------------
  |  Branch (333:9): [True: 0, False: 213k]
  ------------------
  334|   213k|    if (!c->all_layers && c->max_spatial_id) {
  ------------------
  |  Branch (334:9): [True: 60.5k, False: 152k]
  |  Branch (334:27): [True: 49.5k, False: 11.0k]
  ------------------
  335|  49.5k|        if (c->out.p.data[0] && c->cache.p.data[0]) {
  ------------------
  |  Branch (335:13): [True: 22.0k, False: 27.5k]
  |  Branch (335:33): [True: 16.5k, False: 5.50k]
  ------------------
  336|  16.5k|            if (c->max_spatial_id == c->cache.p.frame_hdr->spatial_id ||
  ------------------
  |  Branch (336:17): [True: 0, False: 16.5k]
  ------------------
  337|  16.5k|                c->out.flags & PICTURE_FLAG_NEW_TEMPORAL_UNIT)
  ------------------
  |  Branch (337:17): [True: 0, False: 16.5k]
  ------------------
  338|      0|                return 1;
  339|  16.5k|            dav1d_thread_picture_unref(&c->cache);
  340|  16.5k|            dav1d_thread_picture_move_ref(&c->cache, &c->out);
  341|  16.5k|            return 0;
  342|  33.0k|        } else if (c->cache.p.data[0] && drain) {
  ------------------
  |  Branch (342:20): [True: 11.0k, False: 22.0k]
  |  Branch (342:42): [True: 5.50k, False: 5.50k]
  ------------------
  343|  5.50k|            return 1;
  344|  27.5k|        } else if (c->out.p.data[0]) {
  ------------------
  |  Branch (344:20): [True: 5.50k, False: 22.0k]
  ------------------
  345|  5.50k|            dav1d_thread_picture_move_ref(&c->cache, &c->out);
  346|  5.50k|            return 0;
  347|  5.50k|        }
  348|  49.5k|    }
  349|       |
  350|   186k|    return !!c->out.p.data[0];
  351|   213k|}
lib.c:output_image:
  312|  29.0k|{
  313|  29.0k|    int res = 0;
  314|       |
  315|  29.0k|    Dav1dThreadPicture *const in = (c->all_layers || !c->max_spatial_id)
  ------------------
  |  Branch (315:37): [True: 23.5k, False: 5.50k]
  |  Branch (315:54): [True: 0, False: 5.50k]
  ------------------
  316|  29.0k|                                   ? &c->out : &c->cache;
  317|  29.0k|    if (!c->apply_grain || !has_grain(&in->p)) {
  ------------------
  |  Branch (317:9): [True: 0, False: 29.0k]
  |  Branch (317:28): [True: 29.0k, False: 0]
  ------------------
  318|  29.0k|        dav1d_picture_move_ref(out, &in->p);
  319|  29.0k|        dav1d_thread_picture_unref(in);
  320|  29.0k|        goto end;
  321|  29.0k|    }
  322|       |
  323|      0|    res = dav1d_apply_grain(c, out, &in->p);
  324|      0|    dav1d_thread_picture_unref(in);
  325|  29.0k|end:
  326|  29.0k|    if (!c->all_layers && c->max_spatial_id && c->out.p.data[0]) {
  ------------------
  |  Branch (326:9): [True: 5.50k, False: 23.5k]
  |  Branch (326:27): [True: 5.50k, False: 0]
  |  Branch (326:48): [True: 0, False: 5.50k]
  ------------------
  327|      0|        dav1d_thread_picture_move_ref(in, &c->out);
  328|      0|    }
  329|  29.0k|    return res;
  330|      0|}
lib.c:has_grain:
  304|  29.0k|{
  305|  29.0k|    const Dav1dFilmGrainData *fgdata = &pic->frame_hdr->film_grain.data;
  306|  29.0k|    return fgdata->num_y_points || fgdata->num_uv_points[0] ||
  ------------------
  |  Branch (306:12): [True: 0, False: 29.0k]
  |  Branch (306:36): [True: 0, False: 29.0k]
  ------------------
  307|  29.0k|           fgdata->num_uv_points[1] || (fgdata->clip_to_restricted_range &&
  ------------------
  |  Branch (307:12): [True: 0, False: 29.0k]
  |  Branch (307:41): [True: 0, False: 29.0k]
  ------------------
  308|      0|                                        fgdata->chroma_scaling_from_luma);
  ------------------
  |  Branch (308:41): [True: 0, False: 0]
  ------------------
  309|  29.0k|}
lib.c:close_internal:
  610|  11.3k|static COLD void close_internal(Dav1dContext **const c_out, int flush) {
  611|  11.3k|    Dav1dContext *const c = *c_out;
  612|  11.3k|    if (!c) return;
  ------------------
  |  Branch (612:9): [True: 0, False: 11.3k]
  ------------------
  613|       |
  614|  11.3k|    if (flush) dav1d_flush(c);
  ------------------
  |  Branch (614:9): [True: 11.3k, False: 0]
  ------------------
  615|       |
  616|  11.3k|    if (c->tc) {
  ------------------
  |  Branch (616:9): [True: 11.3k, False: 0]
  ------------------
  617|  11.3k|        struct TaskThreadData *ttd = &c->task_thread;
  618|  11.3k|        if (ttd->inited) {
  ------------------
  |  Branch (618:13): [True: 10.8k, False: 587]
  ------------------
  619|  10.8k|            pthread_mutex_lock(&ttd->lock);
  620|   354k|            for (unsigned n = 0; n < c->n_tc && c->tc[n].task_thread.td.inited; n++)
  ------------------
  |  Branch (620:34): [True: 344k, False: 10.8k]
  |  Branch (620:49): [True: 344k, False: 0]
  ------------------
  621|   344k|                c->tc[n].task_thread.die = 1;
  622|  10.8k|            pthread_cond_broadcast(&ttd->cond);
  623|  10.8k|            pthread_mutex_unlock(&ttd->lock);
  624|   354k|            for (unsigned n = 0; n < c->n_tc; n++) {
  ------------------
  |  Branch (624:34): [True: 344k, False: 10.8k]
  ------------------
  625|   344k|                Dav1dTaskContext *const pf = &c->tc[n];
  626|   344k|                if (!pf->task_thread.td.inited) break;
  ------------------
  |  Branch (626:21): [True: 0, False: 344k]
  ------------------
  627|   344k|                pthread_join(pf->task_thread.td.thread, NULL);
  628|   344k|                pthread_cond_destroy(&pf->task_thread.td.cond);
  629|   344k|                pthread_mutex_destroy(&pf->task_thread.td.lock);
  630|   344k|            }
  631|  10.8k|            pthread_cond_destroy(&ttd->delayed_fg.cond);
  632|  10.8k|            pthread_cond_destroy(&ttd->cond);
  633|  10.8k|            pthread_mutex_destroy(&ttd->lock);
  634|  10.8k|        }
  635|  11.3k|        dav1d_free_aligned(c->tc);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  636|  11.3k|    }
  637|       |
  638|  22.7k|    for (unsigned n = 0; c->fc && n < c->n_fc; n++) {
  ------------------
  |  Branch (638:26): [True: 22.7k, False: 0]
  |  Branch (638:35): [True: 11.3k, False: 11.3k]
  ------------------
  639|  11.3k|        Dav1dFrameContext *const f = &c->fc[n];
  640|       |
  641|       |        // clean-up threading stuff
  642|  11.3k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (642:13): [True: 0, False: 11.3k]
  ------------------
  643|      0|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  644|      0|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  645|      0|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  646|      0|            dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  647|      0|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  648|      0|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  649|      0|            dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  650|      0|        }
  651|  11.3k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (651:13): [True: 10.8k, False: 587]
  ------------------
  652|  10.8k|            pthread_mutex_destroy(&f->task_thread.pending_tasks.lock);
  653|  10.8k|            pthread_cond_destroy(&f->task_thread.cond);
  654|  10.8k|            pthread_mutex_destroy(&f->task_thread.lock);
  655|  10.8k|        }
  656|  11.3k|        dav1d_free(f->frame_thread.frame_progress);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  657|  11.3k|        dav1d_free(f->task_thread.tasks);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  658|  11.3k|        dav1d_free(f->task_thread.tile_tasks[0]);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  659|  11.3k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  660|  11.3k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  661|  11.3k|        dav1d_free(f->a);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  662|  11.3k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  663|  11.3k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  664|  11.3k|        dav1d_free(f->lf.level);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  665|  11.3k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  666|  11.3k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  667|  11.3k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  668|  11.3k|        dav1d_free_aligned(f->rf.r);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  669|  11.3k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  670|  11.3k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  671|  11.3k|    }
  672|  11.3k|    dav1d_free_aligned(c->fc);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  673|  11.3k|    if (c->n_fc > 1 && c->frame_thread.out_delayed) {
  ------------------
  |  Branch (673:9): [True: 0, False: 11.3k]
  |  Branch (673:24): [True: 0, False: 0]
  ------------------
  674|      0|        for (unsigned n = 0; n < c->n_fc; n++)
  ------------------
  |  Branch (674:30): [True: 0, False: 0]
  ------------------
  675|      0|            if (c->frame_thread.out_delayed[n].p.frame_hdr)
  ------------------
  |  Branch (675:17): [True: 0, False: 0]
  ------------------
  676|      0|                dav1d_thread_picture_unref(&c->frame_thread.out_delayed[n]);
  677|      0|        dav1d_free(c->frame_thread.out_delayed);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  678|      0|    }
  679|  11.3k|    for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (679:21): [True: 0, False: 11.3k]
  ------------------
  680|      0|        dav1d_data_unref_internal(&c->tile[n].data);
  681|  11.3k|    dav1d_free(c->tile);
  ------------------
  |  |  135|  11.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
  682|   102k|    for (int n = 0; n < 8; n++) {
  ------------------
  |  Branch (682:21): [True: 91.0k, False: 11.3k]
  ------------------
  683|  91.0k|        dav1d_cdf_thread_unref(&c->cdf[n]);
  684|  91.0k|        if (c->refs[n].p.p.frame_hdr)
  ------------------
  |  Branch (684:13): [True: 0, False: 91.0k]
  ------------------
  685|      0|            dav1d_thread_picture_unref(&c->refs[n].p);
  686|  91.0k|        dav1d_ref_dec(&c->refs[n].refmvs);
  687|  91.0k|        dav1d_ref_dec(&c->refs[n].segmap);
  688|  91.0k|    }
  689|  11.3k|    dav1d_ref_dec(&c->seq_hdr_ref);
  690|  11.3k|    dav1d_ref_dec(&c->frame_hdr_ref);
  691|       |
  692|  11.3k|    dav1d_ref_dec(&c->mastering_display_ref);
  693|  11.3k|    dav1d_ref_dec(&c->content_light_ref);
  694|  11.3k|    dav1d_ref_dec(&c->itut_t35_ref);
  695|       |
  696|  11.3k|    dav1d_mem_pool_end(c->seq_hdr_pool);
  697|  11.3k|    dav1d_mem_pool_end(c->frame_hdr_pool);
  698|  11.3k|    dav1d_mem_pool_end(c->segmap_pool);
  699|  11.3k|    dav1d_mem_pool_end(c->refmvs_pool);
  700|  11.3k|    dav1d_mem_pool_end(c->cdf_pool);
  701|  11.3k|    dav1d_mem_pool_end(c->picture_pool);
  702|  11.3k|    dav1d_mem_pool_end(c->pic_ctx_pool);
  703|       |
  704|  11.3k|    dav1d_freep_aligned(c_out);
  705|  11.3k|}

dav1d_loop_filter_dsp_init_8bpc:
  259|  8.03k|COLD void bitfn(dav1d_loop_filter_dsp_init)(Dav1dLoopFilterDSPContext *const c) {
  260|  8.03k|    c->loop_filter_sb[0][0] = loop_filter_h_sb128y_c;
  261|  8.03k|    c->loop_filter_sb[0][1] = loop_filter_v_sb128y_c;
  262|  8.03k|    c->loop_filter_sb[1][0] = loop_filter_h_sb128uv_c;
  263|  8.03k|    c->loop_filter_sb[1][1] = loop_filter_v_sb128uv_c;
  264|       |
  265|  8.03k|#if HAVE_ASM
  266|       |#if ARCH_AARCH64 || ARCH_ARM
  267|       |    loop_filter_dsp_init_arm(c);
  268|       |#elif ARCH_LOONGARCH64
  269|       |    loop_filter_dsp_init_loongarch(c);
  270|       |#elif ARCH_PPC64LE
  271|       |    loop_filter_dsp_init_ppc(c);
  272|       |#elif ARCH_X86
  273|       |    loop_filter_dsp_init_x86(c);
  274|  8.03k|#endif
  275|  8.03k|#endif
  276|  8.03k|}
dav1d_loop_filter_dsp_init_16bpc:
  259|  3.35k|COLD void bitfn(dav1d_loop_filter_dsp_init)(Dav1dLoopFilterDSPContext *const c) {
  260|  3.35k|    c->loop_filter_sb[0][0] = loop_filter_h_sb128y_c;
  261|  3.35k|    c->loop_filter_sb[0][1] = loop_filter_v_sb128y_c;
  262|  3.35k|    c->loop_filter_sb[1][0] = loop_filter_h_sb128uv_c;
  263|  3.35k|    c->loop_filter_sb[1][1] = loop_filter_v_sb128uv_c;
  264|       |
  265|  3.35k|#if HAVE_ASM
  266|       |#if ARCH_AARCH64 || ARCH_ARM
  267|       |    loop_filter_dsp_init_arm(c);
  268|       |#elif ARCH_LOONGARCH64
  269|       |    loop_filter_dsp_init_loongarch(c);
  270|       |#elif ARCH_PPC64LE
  271|       |    loop_filter_dsp_init_ppc(c);
  272|       |#elif ARCH_X86
  273|       |    loop_filter_dsp_init_x86(c);
  274|  3.35k|#endif
  275|  3.35k|#endif
  276|  3.35k|}

dav1d_loop_restoration_dsp_init_8bpc:
 1367|  8.03k|{
 1368|  8.03k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1369|  8.03k|    c->sgr[0] = sgr_5x5_c;
 1370|  8.03k|    c->sgr[1] = sgr_3x3_c;
 1371|  8.03k|    c->sgr[2] = sgr_mix_c;
 1372|       |
 1373|  8.03k|#if HAVE_ASM
 1374|       |#if ARCH_AARCH64 || ARCH_ARM
 1375|       |    loop_restoration_dsp_init_arm(c, bpc);
 1376|       |#elif ARCH_LOONGARCH64
 1377|       |    loop_restoration_dsp_init_loongarch(c, bpc);
 1378|       |#elif ARCH_PPC64LE
 1379|       |    loop_restoration_dsp_init_ppc(c, bpc);
 1380|       |#elif ARCH_X86
 1381|       |    loop_restoration_dsp_init_x86(c, bpc);
 1382|  8.03k|#endif
 1383|  8.03k|#endif
 1384|  8.03k|}
dav1d_loop_restoration_dsp_init_16bpc:
 1367|  3.35k|{
 1368|  3.35k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1369|  3.35k|    c->sgr[0] = sgr_5x5_c;
 1370|  3.35k|    c->sgr[1] = sgr_3x3_c;
 1371|  3.35k|    c->sgr[2] = sgr_mix_c;
 1372|       |
 1373|  3.35k|#if HAVE_ASM
 1374|       |#if ARCH_AARCH64 || ARCH_ARM
 1375|       |    loop_restoration_dsp_init_arm(c, bpc);
 1376|       |#elif ARCH_LOONGARCH64
 1377|       |    loop_restoration_dsp_init_loongarch(c, bpc);
 1378|       |#elif ARCH_PPC64LE
 1379|       |    loop_restoration_dsp_init_ppc(c, bpc);
 1380|       |#elif ARCH_X86
 1381|       |    loop_restoration_dsp_init_x86(c, bpc);
 1382|  3.35k|#endif
 1383|  3.35k|#endif
 1384|  3.35k|}

dav1d_lr_sbrow_8bpc:
  171|    646|{
  172|    646|    const int offset_y = 8 * !!sby;
  173|    646|    const ptrdiff_t *const dst_stride = f->sr_cur.p.stride;
  174|    646|    const int restore_planes = f->lf.restore_planes;
  175|    646|    const int sb128 = f->seq_hdr->sb128;
  176|    646|    const int not_last = sby + 1 < f->sbh;
  177|       |
  178|    646|    if (restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (178:9): [True: 588, False: 58]
  ------------------
  179|    588|        const int h = f->sr_cur.p.p.h;
  180|    588|        const int w = f->sr_cur.p.p.w;
  181|    588|        const int next_row_y = (sby + 1) << (6 + sb128);
  182|    588|        const int row_h = imin(next_row_y - 8 * not_last, h);
  183|    588|        const int y_stripe = (sby << (6 + sb128)) - offset_y;
  184|    588|        lr_sbrow(f, dst[0] - offset_y * PXSTRIDE(dst_stride[0]), y_stripe, w,
  ------------------
  |  |   53|    588|#define PXSTRIDE(x) (x)
  ------------------
  185|    588|                 h, row_h, 0);
  186|    588|    }
  187|    646|    if (restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) {
  ------------------
  |  Branch (187:9): [True: 69, False: 577]
  ------------------
  188|     69|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  189|     69|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  190|     69|        const int h = (f->sr_cur.p.p.h + ss_ver) >> ss_ver;
  191|     69|        const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
  192|     69|        const int next_row_y = (sby + 1) << ((6 - ss_ver) + sb128);
  193|     69|        const int row_h = imin(next_row_y - (8 >> ss_ver) * not_last, h);
  194|     69|        const int offset_uv = offset_y >> ss_ver;
  195|     69|        const int y_stripe = (sby << ((6 - ss_ver) + sb128)) - offset_uv;
  196|     69|        if (restore_planes & LR_RESTORE_U)
  ------------------
  |  Branch (196:13): [True: 52, False: 17]
  ------------------
  197|     52|            lr_sbrow(f, dst[1] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  ------------------
  |  |   53|     52|#define PXSTRIDE(x) (x)
  ------------------
  198|     52|                     w, h, row_h, 1);
  199|       |
  200|     69|        if (restore_planes & LR_RESTORE_V)
  ------------------
  |  Branch (200:13): [True: 48, False: 21]
  ------------------
  201|     48|            lr_sbrow(f, dst[2] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  ------------------
  |  |   53|     48|#define PXSTRIDE(x) (x)
  ------------------
  202|     48|                     w, h, row_h, 2);
  203|     69|    }
  204|    646|}
lr_apply_tmpl.c:lr_sbrow:
  109|    969|{
  110|    969|    const int chroma = !!plane;
  111|    969|    const int ss_ver = chroma & (f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420);
  112|    969|    const int ss_hor = chroma & (f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444);
  113|    969|    const ptrdiff_t p_stride = f->sr_cur.p.stride[chroma];
  114|       |
  115|    969|    const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!plane];
  116|    969|    const int unit_size = 1 << unit_size_log2;
  117|    969|    const int half_unit_size = unit_size >> 1;
  118|    969|    const int max_unit_size = unit_size + half_unit_size;
  119|       |
  120|       |    // Y coordinate of the sbrow (y is 8 luma pixel rows above row_y)
  121|    969|    const int row_y = y + ((8 >> ss_ver) * !!y);
  122|       |
  123|       |    // FIXME This is an ugly hack to lookup the proper AV1Filter unit for
  124|       |    // chroma planes. Question: For Multithreaded decoding, is it better
  125|       |    // to store the chroma LR information with collocated Luma information?
  126|       |    // In other words. For a chroma restoration unit locate at 128,128 and
  127|       |    // with a 4:2:0 chroma subsampling, do we store the filter information at
  128|       |    // the AV1Filter unit located at (128,128) or (256,256)
  129|       |    // TODO Support chroma subsampling.
  130|    969|    const int shift_hor = 7 - ss_hor;
  131|       |
  132|       |    /* maximum sbrow height is 128 + 8 rows offset */
  133|    969|    ALIGN_STK_16(pixel, pre_lr_border, 2, [128 + 8][4]);
  ------------------
  |  |  100|    969|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|    969|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  134|    969|    const Av1RestorationUnit *lr[2];
  135|       |
  136|    969|    enum LrEdgeFlags edges = (y > 0 ? LR_HAVE_TOP : 0) | LR_HAVE_RIGHT;
  ------------------
  |  Branch (136:31): [True: 484, False: 485]
  ------------------
  137|       |
  138|    969|    int aligned_unit_pos = row_y & ~(unit_size - 1);
  139|    969|    if (aligned_unit_pos && aligned_unit_pos + half_unit_size > h)
  ------------------
  |  Branch (139:9): [True: 74, False: 895]
  |  Branch (139:29): [True: 10, False: 64]
  ------------------
  140|     10|        aligned_unit_pos -= unit_size;
  141|    969|    aligned_unit_pos <<= ss_ver;
  142|    969|    const int sb_idx = (aligned_unit_pos >> 7) * f->sr_sb128w;
  143|    969|    const int unit_idx = ((aligned_unit_pos >> 6) & 1) << 1;
  144|    969|    lr[0] = &f->lf.lr_mask[sb_idx].lr[plane][unit_idx];
  145|    969|    int restore = lr[0]->type != DAV1D_RESTORATION_NONE;
  146|    969|    int x = 0, bit = 0;
  147|    969|    const int backup_h = row_h - y;
  148|    984|    for (; x + max_unit_size <= w; p += unit_size, edges |= LR_HAVE_LEFT, bit ^= 1) {
  ------------------
  |  Branch (148:12): [True: 15, False: 969]
  ------------------
  149|     15|        const int next_x = x + unit_size;
  150|     15|        const int next_u_idx = unit_idx + ((next_x >> (shift_hor - 1)) & 1);
  151|     15|        lr[!bit] =
  152|     15|            &f->lf.lr_mask[sb_idx + (next_x >> shift_hor)].lr[plane][next_u_idx];
  153|     15|        const int restore_next = lr[!bit]->type != DAV1D_RESTORATION_NONE;
  154|     15|        if (restore_next)
  ------------------
  |  Branch (154:13): [True: 11, False: 4]
  ------------------
  155|     11|            backup4xU(pre_lr_border[bit], p + unit_size - 4, p_stride, backup_h);
  156|     15|        if (restore)
  ------------------
  |  Branch (156:13): [True: 12, False: 3]
  ------------------
  157|     12|            lr_stripe(f, p, pre_lr_border[!bit], x, y, plane, unit_size, row_h,
  158|     12|                      lr[bit], edges);
  159|     15|        x = next_x;
  160|     15|        restore = restore_next;
  161|     15|    }
  162|    969|    if (restore) {
  ------------------
  |  Branch (162:9): [True: 925, False: 44]
  ------------------
  163|    925|        edges &= ~LR_HAVE_RIGHT;
  164|    925|        const int unit_w = w - x;
  165|    925|        lr_stripe(f, p, pre_lr_border[!bit], x, y, plane, unit_w, row_h, lr[bit], edges);
  166|    925|    }
  167|    969|}
lr_apply_tmpl.c:backup4xU:
  102|     11|{
  103|    560|    for (; u > 0; u--, dst++, src += PXSTRIDE(src_stride))
  ------------------
  |  |   53|    549|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (103:12): [True: 549, False: 11]
  ------------------
  104|    549|        pixel_copy(dst, src, 4);
  ------------------
  |  |   47|    549|#define pixel_copy memcpy
  ------------------
  105|     11|}
lr_apply_tmpl.c:lr_stripe:
   40|    937|{
   41|    937|    const Dav1dDSPContext *const dsp = f->dsp;
   42|    937|    const int chroma = !!plane;
   43|    937|    const int ss_ver = chroma & (f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420);
   44|    937|    const ptrdiff_t stride = f->sr_cur.p.stride[chroma];
   45|    937|    const int sby = (y + (y ? 8 << ss_ver : 0)) >> (6 - ss_ver + f->seq_hdr->sb128);
  ------------------
  |  Branch (45:27): [True: 451, False: 486]
  ------------------
   46|    937|    const int have_tt = f->c->n_tc > 1;
   47|    937|    const pixel *lpf = f->lf.lr_lpf_line[plane] +
   48|    937|        have_tt * (sby * (4 << f->seq_hdr->sb128) - 4) * PXSTRIDE(stride) + x;
  ------------------
  |  |   53|    937|#define PXSTRIDE(x) (x)
  ------------------
   49|       |
   50|       |    // The first stripe of the frame is shorter by 8 luma pixel rows.
   51|    937|    int stripe_h = imin((64 - 8 * !y) >> ss_ver, row_h - y);
   52|       |
   53|    937|    looprestorationfilter_fn lr_fn;
   54|    937|    LooprestorationParams params;
   55|    937|    if (lr->type == DAV1D_RESTORATION_WIENER) {
  ------------------
  |  Branch (55:9): [True: 899, False: 38]
  ------------------
   56|    899|        int16_t (*const filter)[8] = params.filter;
   57|    899|        filter[0][0] = filter[0][6] = lr->filter_h[0];
   58|    899|        filter[0][1] = filter[0][5] = lr->filter_h[1];
   59|    899|        filter[0][2] = filter[0][4] = lr->filter_h[2];
   60|    899|        filter[0][3] = -(filter[0][0] + filter[0][1] + filter[0][2]) * 2;
   61|       |#if BITDEPTH != 8
   62|       |        /* For 8-bit SIMD it's beneficial to handle the +128 separately
   63|       |         * in order to avoid overflows. */
   64|       |        filter[0][3] += 128;
   65|       |#endif
   66|       |
   67|    899|        filter[1][0] = filter[1][6] = lr->filter_v[0];
   68|    899|        filter[1][1] = filter[1][5] = lr->filter_v[1];
   69|    899|        filter[1][2] = filter[1][4] = lr->filter_v[2];
   70|    899|        filter[1][3] = 128 - (filter[1][0] + filter[1][1] + filter[1][2]) * 2;
   71|       |
   72|    899|        lr_fn = dsp->lr.wiener[!(filter[0][0] | filter[1][0])];
   73|    899|    } else {
   74|     38|        assert(lr->type >= DAV1D_RESTORATION_SGRPROJ);
  ------------------
  |  |  140|     38|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 38]
  |  |  |  Branch (140:68): [Folded, False: 38]
  |  |  ------------------
  ------------------
   75|     38|        const int sgr_idx = lr->type - DAV1D_RESTORATION_SGRPROJ;
   76|     38|        const uint16_t *const sgr_params = dav1d_sgr_params[sgr_idx];
   77|     38|        params.sgr.s0 = sgr_params[0];
   78|     38|        params.sgr.s1 = sgr_params[1];
   79|     38|        params.sgr.w0 = lr->sgr_weights[0];
   80|     38|        params.sgr.w1 = 128 - (lr->sgr_weights[0] + lr->sgr_weights[1]);
   81|       |
   82|     38|        lr_fn = dsp->lr.sgr[!!sgr_params[0] + !!sgr_params[1] * 2 - 1];
   83|     38|    }
   84|       |
   85|  1.01k|    while (y + stripe_h <= row_h) {
  ------------------
  |  Branch (85:12): [True: 1.01k, False: 0]
  ------------------
   86|       |        // Change the HAVE_BOTTOM bit in edges to (sby + 1 != f->sbh || y + stripe_h != row_h)
   87|  1.01k|        edges ^= (-(sby + 1 != f->sbh || y + stripe_h != row_h) ^ edges) & LR_HAVE_BOTTOM;
  ------------------
  |  Branch (87:21): [True: 466, False: 550]
  |  Branch (87:42): [True: 79, False: 471]
  ------------------
   88|  1.01k|        lr_fn(p, stride, left, lpf, unit_w, stripe_h, &params, edges HIGHBD_CALL_SUFFIX);
   89|       |
   90|  1.01k|        left += stripe_h;
   91|  1.01k|        y += stripe_h;
   92|  1.01k|        p += stripe_h * PXSTRIDE(stride);
  ------------------
  |  |   53|  1.01k|#define PXSTRIDE(x) (x)
  ------------------
   93|  1.01k|        edges |= LR_HAVE_TOP;
   94|  1.01k|        stripe_h = imin(64 >> ss_ver, row_h - y);
   95|  1.01k|        if (stripe_h == 0) break;
  ------------------
  |  Branch (95:13): [True: 937, False: 79]
  ------------------
   96|     79|        lpf += 4 * PXSTRIDE(stride);
  ------------------
  |  |   53|     79|#define PXSTRIDE(x) (x)
  ------------------
   97|     79|    }
   98|    937|}
dav1d_lr_sbrow_16bpc:
  171|    267|{
  172|    267|    const int offset_y = 8 * !!sby;
  173|    267|    const ptrdiff_t *const dst_stride = f->sr_cur.p.stride;
  174|    267|    const int restore_planes = f->lf.restore_planes;
  175|    267|    const int sb128 = f->seq_hdr->sb128;
  176|    267|    const int not_last = sby + 1 < f->sbh;
  177|       |
  178|    267|    if (restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (178:9): [True: 252, False: 15]
  ------------------
  179|    252|        const int h = f->sr_cur.p.p.h;
  180|    252|        const int w = f->sr_cur.p.p.w;
  181|    252|        const int next_row_y = (sby + 1) << (6 + sb128);
  182|    252|        const int row_h = imin(next_row_y - 8 * not_last, h);
  183|    252|        const int y_stripe = (sby << (6 + sb128)) - offset_y;
  184|    252|        lr_sbrow(f, dst[0] - offset_y * PXSTRIDE(dst_stride[0]), y_stripe, w,
  185|    252|                 h, row_h, 0);
  186|    252|    }
  187|    267|    if (restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) {
  ------------------
  |  Branch (187:9): [True: 19, False: 248]
  ------------------
  188|     19|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  189|     19|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  190|     19|        const int h = (f->sr_cur.p.p.h + ss_ver) >> ss_ver;
  191|     19|        const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
  192|     19|        const int next_row_y = (sby + 1) << ((6 - ss_ver) + sb128);
  193|     19|        const int row_h = imin(next_row_y - (8 >> ss_ver) * not_last, h);
  194|     19|        const int offset_uv = offset_y >> ss_ver;
  195|     19|        const int y_stripe = (sby << ((6 - ss_ver) + sb128)) - offset_uv;
  196|     19|        if (restore_planes & LR_RESTORE_U)
  ------------------
  |  Branch (196:13): [True: 14, False: 5]
  ------------------
  197|     14|            lr_sbrow(f, dst[1] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  198|     14|                     w, h, row_h, 1);
  199|       |
  200|     19|        if (restore_planes & LR_RESTORE_V)
  ------------------
  |  Branch (200:13): [True: 15, False: 4]
  ------------------
  201|     15|            lr_sbrow(f, dst[2] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  202|     15|                     w, h, row_h, 2);
  203|     19|    }
  204|    267|}

dav1d_mc_dsp_init_8bpc:
  960|  8.03k|COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
  961|  8.03k|#define init_mc_fns(type, name) do { \
  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  966|  8.03k|} while (0)
  967|       |
  968|  8.03k|    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  969|  8.03k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  970|  8.03k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  971|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  972|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  973|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  974|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  975|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  976|  8.03k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  977|  8.03k|    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
  ------------------
  |  |  961|  8.03k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.03k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.03k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.03k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.03k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.03k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
  978|       |
  979|  8.03k|    c->avg      = avg_c;
  980|  8.03k|    c->w_avg    = w_avg_c;
  981|  8.03k|    c->mask     = mask_c;
  982|  8.03k|    c->blend    = blend_c;
  983|  8.03k|    c->blend_v  = blend_v_c;
  984|  8.03k|    c->blend_h  = blend_h_c;
  985|  8.03k|    c->w_mask[0] = w_mask_444_c;
  986|  8.03k|    c->w_mask[1] = w_mask_422_c;
  987|  8.03k|    c->w_mask[2] = w_mask_420_c;
  988|  8.03k|    c->warp8x8  = warp_affine_8x8_c;
  989|  8.03k|    c->warp8x8t = warp_affine_8x8t_c;
  990|  8.03k|    c->emu_edge = emu_edge_c;
  991|  8.03k|    c->resize   = resize_c;
  992|       |
  993|  8.03k|#if HAVE_ASM
  994|       |#if ARCH_AARCH64 || ARCH_ARM
  995|       |    mc_dsp_init_arm(c);
  996|       |#elif ARCH_LOONGARCH64
  997|       |    mc_dsp_init_loongarch(c);
  998|       |#elif ARCH_PPC64LE
  999|       |    mc_dsp_init_ppc(c);
 1000|       |#elif ARCH_RISCV
 1001|       |    mc_dsp_init_riscv(c);
 1002|       |#elif ARCH_X86
 1003|       |    mc_dsp_init_x86(c);
 1004|  8.03k|#endif
 1005|  8.03k|#endif
 1006|  8.03k|}
dav1d_mc_dsp_init_16bpc:
  960|  3.35k|COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
  961|  3.35k|#define init_mc_fns(type, name) do { \
  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  966|  3.35k|} while (0)
  967|       |
  968|  3.35k|    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  969|  3.35k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  970|  3.35k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  971|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  972|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  973|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  974|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  975|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  976|  3.35k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  977|  3.35k|    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
  ------------------
  |  |  961|  3.35k|#define init_mc_fns(type, name) do { \
  |  |  962|  3.35k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  3.35k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  3.35k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  3.35k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  3.35k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  978|       |
  979|  3.35k|    c->avg      = avg_c;
  980|  3.35k|    c->w_avg    = w_avg_c;
  981|  3.35k|    c->mask     = mask_c;
  982|  3.35k|    c->blend    = blend_c;
  983|  3.35k|    c->blend_v  = blend_v_c;
  984|  3.35k|    c->blend_h  = blend_h_c;
  985|  3.35k|    c->w_mask[0] = w_mask_444_c;
  986|  3.35k|    c->w_mask[1] = w_mask_422_c;
  987|  3.35k|    c->w_mask[2] = w_mask_420_c;
  988|  3.35k|    c->warp8x8  = warp_affine_8x8_c;
  989|  3.35k|    c->warp8x8t = warp_affine_8x8t_c;
  990|  3.35k|    c->emu_edge = emu_edge_c;
  991|  3.35k|    c->resize   = resize_c;
  992|       |
  993|  3.35k|#if HAVE_ASM
  994|       |#if ARCH_AARCH64 || ARCH_ARM
  995|       |    mc_dsp_init_arm(c);
  996|       |#elif ARCH_LOONGARCH64
  997|       |    mc_dsp_init_loongarch(c);
  998|       |#elif ARCH_PPC64LE
  999|       |    mc_dsp_init_ppc(c);
 1000|       |#elif ARCH_RISCV
 1001|       |    mc_dsp_init_riscv(c);
 1002|       |#elif ARCH_X86
 1003|       |    mc_dsp_init_x86(c);
 1004|  3.35k|#endif
 1005|  3.35k|#endif
 1006|  3.35k|}

dav1d_mem_pool_push:
  224|   227k|void dav1d_mem_pool_push(Dav1dMemPool *const pool, void *const ptr) {
  225|   227k|    pthread_mutex_lock(&pool->lock);
  226|   227k|    Dav1dMemPoolBuffer *const buf = (Dav1dMemPoolBuffer*)((uintptr_t)ptr - 64);
  227|   227k|    const int ref_cnt = --pool->ref_cnt;
  228|   227k|    if (!pool->end) {
  ------------------
  |  Branch (228:9): [True: 227k, False: 0]
  ------------------
  229|   227k|        buf->next = pool->buf;
  230|   227k|        pool->buf = buf;
  231|   227k|        pthread_mutex_unlock(&pool->lock);
  232|   227k|        assert(ref_cnt > 0);
  ------------------
  |  |  140|   227k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 227k]
  |  |  |  Branch (140:68): [Folded, False: 227k]
  |  |  ------------------
  ------------------
  233|   227k|    } else {
  234|      0|        pthread_mutex_unlock(&pool->lock);
  235|      0|        dav1d_free_aligned(buf);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  236|      0|        if (!ref_cnt) mem_pool_destroy(pool);
  ------------------
  |  Branch (236:13): [True: 0, False: 0]
  ------------------
  237|      0|    }
  238|   227k|}
dav1d_mem_pool_pop:
  240|   227k|void *dav1d_mem_pool_pop(Dav1dMemPool *const pool, const size_t size) {
  241|   227k|    pthread_mutex_lock(&pool->lock);
  242|   227k|    Dav1dMemPoolBuffer *buf = pool->buf;
  243|   227k|    pool->ref_cnt++;
  244|       |
  245|   227k|    if (buf) {
  ------------------
  |  Branch (245:9): [True: 56.9k, False: 170k]
  ------------------
  246|  56.9k|        pool->buf = buf->next;
  247|  56.9k|        pthread_mutex_unlock(&pool->lock);
  248|  56.9k|        if (buf->size != size) {
  ------------------
  |  Branch (248:13): [True: 3.52k, False: 53.4k]
  ------------------
  249|       |            /* Reallocate if the size has changed */
  250|  3.52k|            dav1d_free_aligned(buf);
  ------------------
  |  |  136|  3.52k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  251|  3.52k|            goto alloc;
  252|  3.52k|        }
  253|       |#if TRACK_HEAP_ALLOCATIONS
  254|       |        dav1d_track_reuse(pool->type);
  255|       |#endif
  256|   170k|    } else {
  257|   170k|        pthread_mutex_unlock(&pool->lock);
  258|   174k|alloc:
  259|   174k|        buf = dav1d_alloc_aligned(pool->type, size + 64, 64);
  ------------------
  |  |  134|   174k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  260|   174k|        if (!buf) {
  ------------------
  |  Branch (260:13): [True: 0, False: 174k]
  ------------------
  261|      0|            pthread_mutex_lock(&pool->lock);
  262|      0|            const int ref_cnt = --pool->ref_cnt;
  263|      0|            pthread_mutex_unlock(&pool->lock);
  264|      0|            if (!ref_cnt) mem_pool_destroy(pool);
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|            return NULL;
  266|      0|        }
  267|   174k|        buf->size = size;
  268|   174k|    }
  269|       |
  270|   227k|    return (void*)((uintptr_t)buf + 64);
  271|   227k|}
dav1d_mem_pool_init:
  275|  79.7k|{
  276|  79.7k|    Dav1dMemPool *const pool = dav1d_malloc(ALLOC_COMMON_CTX,
  ------------------
  |  |  132|  79.7k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
  277|  79.7k|                                            sizeof(Dav1dMemPool));
  278|  79.7k|    if (pool) {
  ------------------
  |  Branch (278:9): [True: 79.7k, False: 0]
  ------------------
  279|  79.7k|        if (!pthread_mutex_init(&pool->lock, NULL)) {
  ------------------
  |  Branch (279:13): [True: 79.7k, False: 0]
  ------------------
  280|  79.7k|            pool->buf = NULL;
  281|  79.7k|            pool->ref_cnt = 1;
  282|  79.7k|            pool->end = 0;
  283|       |#if TRACK_HEAP_ALLOCATIONS
  284|       |            pool->type = type;
  285|       |#endif
  286|  79.7k|            *ppool = pool;
  287|  79.7k|            return 0;
  288|  79.7k|        }
  289|      0|        dav1d_free(pool);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  290|      0|    }
  291|      0|    *ppool = NULL;
  292|      0|    return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  293|  79.7k|}
dav1d_mem_pool_end:
  295|  79.7k|COLD void dav1d_mem_pool_end(Dav1dMemPool *const pool) {
  296|  79.7k|    if (pool) {
  ------------------
  |  Branch (296:9): [True: 79.7k, False: 0]
  ------------------
  297|  79.7k|        pthread_mutex_lock(&pool->lock);
  298|  79.7k|        Dav1dMemPoolBuffer *buf = pool->buf;
  299|  79.7k|        const int ref_cnt = --pool->ref_cnt;
  300|  79.7k|        pool->buf = NULL;
  301|  79.7k|        pool->end = 1;
  302|  79.7k|        pthread_mutex_unlock(&pool->lock);
  303|       |
  304|   250k|        while (buf) {
  ------------------
  |  Branch (304:16): [True: 170k, False: 79.7k]
  ------------------
  305|   170k|            void *const ptr = buf;
  306|   170k|            buf = buf->next;
  307|   170k|            dav1d_free_aligned(ptr);
  ------------------
  |  |  136|   170k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  308|   170k|        }
  309|  79.7k|        if (!ref_cnt) mem_pool_destroy(pool);
  ------------------
  |  Branch (309:13): [True: 79.7k, False: 0]
  ------------------
  310|  79.7k|    }
  311|  79.7k|}
mem.c:mem_pool_destroy:
  219|  79.7k|static COLD void mem_pool_destroy(Dav1dMemPool *const pool) {
  220|  79.7k|    pthread_mutex_destroy(&pool->lock);
  221|  79.7k|    dav1d_free(pool);
  ------------------
  |  |  135|  79.7k|#define dav1d_free(ptr) free(ptr)
  ------------------
  222|  79.7k|}

lib.c:dav1d_alloc_aligned_internal:
   89|  34.1k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|  34.1k|    assert(!(align & (align - 1)));
  ------------------
  |  |  140|  34.1k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 34.1k]
  |  |  |  Branch (140:68): [Folded, False: 34.1k]
  |  |  ------------------
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|  34.1k|    void *ptr;
   95|  34.1k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 34.1k]
  ------------------
   96|  34.1k|    return ptr;
   97|       |#elif HAVE_MEMALIGN
   98|       |    return memalign(align, sz);
   99|       |#elif HAVE_ALIGNED_ALLOC
  100|       |    // The C11 standard specifies that the size parameter
  101|       |    // must be an integral multiple of alignment.
  102|       |    return aligned_alloc(align, ROUND_UP(sz, align));
  103|       |#else
  104|       |    void *const buf = malloc(sz + align + sizeof(void *));
  105|       |    if (!buf) return NULL;
  106|       |
  107|       |    void *const ptr = (void *)(((uintptr_t)buf + sizeof(void *) + align - 1) & ~(align - 1));
  108|       |    ((void **)ptr)[-1] = buf;
  109|       |    return ptr;
  110|       |#endif
  111|  34.1k|}
lib.c:dav1d_free_aligned_internal:
  113|  91.0k|static inline void dav1d_free_aligned_internal(void *ptr) {
  114|       |#ifdef _WIN32
  115|       |    _aligned_free(ptr);
  116|       |#elif HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_ALIGNED_ALLOC
  117|       |    free(ptr);
  118|       |#else
  119|       |    if (ptr) free(((void **)ptr)[-1]);
  120|       |#endif
  121|  91.0k|}
lib.c:dav1d_freep_aligned:
  144|  11.3k|static inline void dav1d_freep_aligned(void *ptr) {
  145|  11.3k|    void **mem = (void **) ptr;
  146|  11.3k|    if (*mem) {
  ------------------
  |  Branch (146:9): [True: 11.3k, False: 0]
  ------------------
  147|  11.3k|        dav1d_free_aligned(*mem);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  148|       |        *mem = NULL;
  149|  11.3k|    }
  150|  11.3k|}
mem.c:dav1d_free_aligned_internal:
  113|   174k|static inline void dav1d_free_aligned_internal(void *ptr) {
  114|       |#ifdef _WIN32
  115|       |    _aligned_free(ptr);
  116|       |#elif HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_ALIGNED_ALLOC
  117|       |    free(ptr);
  118|       |#else
  119|       |    if (ptr) free(((void **)ptr)[-1]);
  120|       |#endif
  121|   174k|}
mem.c:dav1d_alloc_aligned_internal:
   89|   174k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|   174k|    assert(!(align & (align - 1)));
  ------------------
  |  |  140|   174k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 174k]
  |  |  |  Branch (140:68): [Folded, False: 174k]
  |  |  ------------------
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|   174k|    void *ptr;
   95|   174k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 174k]
  ------------------
   96|   174k|    return ptr;
   97|       |#elif HAVE_MEMALIGN
   98|       |    return memalign(align, sz);
   99|       |#elif HAVE_ALIGNED_ALLOC
  100|       |    // The C11 standard specifies that the size parameter
  101|       |    // must be an integral multiple of alignment.
  102|       |    return aligned_alloc(align, ROUND_UP(sz, align));
  103|       |#else
  104|       |    void *const buf = malloc(sz + align + sizeof(void *));
  105|       |    if (!buf) return NULL;
  106|       |
  107|       |    void *const ptr = (void *)(((uintptr_t)buf + sizeof(void *) + align - 1) & ~(align - 1));
  108|       |    ((void **)ptr)[-1] = buf;
  109|       |    return ptr;
  110|       |#endif
  111|   174k|}
refmvs.c:dav1d_free_aligned_internal:
  113|  14.2k|static inline void dav1d_free_aligned_internal(void *ptr) {
  114|       |#ifdef _WIN32
  115|       |    _aligned_free(ptr);
  116|       |#elif HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_ALIGNED_ALLOC
  117|       |    free(ptr);
  118|       |#else
  119|       |    if (ptr) free(((void **)ptr)[-1]);
  120|       |#endif
  121|  14.2k|}
refmvs.c:dav1d_alloc_aligned_internal:
   89|  14.2k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|  14.2k|    assert(!(align & (align - 1)));
  ------------------
  |  |  140|  14.2k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 14.2k]
  |  |  |  Branch (140:68): [Folded, False: 14.2k]
  |  |  ------------------
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|  14.2k|    void *ptr;
   95|  14.2k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 14.2k]
  ------------------
   96|  14.2k|    return ptr;
   97|       |#elif HAVE_MEMALIGN
   98|       |    return memalign(align, sz);
   99|       |#elif HAVE_ALIGNED_ALLOC
  100|       |    // The C11 standard specifies that the size parameter
  101|       |    // must be an integral multiple of alignment.
  102|       |    return aligned_alloc(align, ROUND_UP(sz, align));
  103|       |#else
  104|       |    void *const buf = malloc(sz + align + sizeof(void *));
  105|       |    if (!buf) return NULL;
  106|       |
  107|       |    void *const ptr = (void *)(((uintptr_t)buf + sizeof(void *) + align - 1) & ~(align - 1));
  108|       |    ((void **)ptr)[-1] = buf;
  109|       |    return ptr;
  110|       |#endif
  111|  14.2k|}
decode.c:dav1d_free_aligned_internal:
  113|  64.7k|static inline void dav1d_free_aligned_internal(void *ptr) {
  114|       |#ifdef _WIN32
  115|       |    _aligned_free(ptr);
  116|       |#elif HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_ALIGNED_ALLOC
  117|       |    free(ptr);
  118|       |#else
  119|       |    if (ptr) free(((void **)ptr)[-1]);
  120|       |#endif
  121|  64.7k|}
decode.c:dav1d_alloc_aligned_internal:
   89|  64.7k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|  64.7k|    assert(!(align & (align - 1)));
  ------------------
  |  |  140|  64.7k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 64.7k]
  |  |  |  Branch (140:68): [Folded, False: 64.7k]
  |  |  ------------------
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|  64.7k|    void *ptr;
   95|  64.7k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 64.7k]
  ------------------
   96|  64.7k|    return ptr;
   97|       |#elif HAVE_MEMALIGN
   98|       |    return memalign(align, sz);
   99|       |#elif HAVE_ALIGNED_ALLOC
  100|       |    // The C11 standard specifies that the size parameter
  101|       |    // must be an integral multiple of alignment.
  102|       |    return aligned_alloc(align, ROUND_UP(sz, align));
  103|       |#else
  104|       |    void *const buf = malloc(sz + align + sizeof(void *));
  105|       |    if (!buf) return NULL;
  106|       |
  107|       |    void *const ptr = (void *)(((uintptr_t)buf + sizeof(void *) + align - 1) & ~(align - 1));
  108|       |    ((void **)ptr)[-1] = buf;
  109|       |    return ptr;
  110|       |#endif
  111|  64.7k|}

dav1d_msac_decode_subexp:
   62|  2.74k|{
   63|  2.74k|    assert(n >> k == 8);
  ------------------
  |  |  140|  2.74k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 2.74k]
  |  |  |  Branch (140:68): [Folded, False: 2.74k]
  |  |  ------------------
  ------------------
   64|       |
   65|  2.74k|    unsigned a = 0;
   66|  2.74k|    if (dav1d_msac_decode_bool_equi(s)) {
  ------------------
  |  |   53|  2.74k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (66:9): [True: 2.68k, False: 62]
  ------------------
   67|  2.68k|        if (dav1d_msac_decode_bool_equi(s))
  ------------------
  |  |   53|  2.68k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (67:13): [True: 2.61k, False: 65]
  ------------------
   68|  2.61k|            k += dav1d_msac_decode_bool_equi(s) + 1;
  ------------------
  |  |   53|  2.61k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   69|  2.68k|        a = 1 << k;
   70|  2.68k|    }
   71|  2.74k|    const unsigned v = dav1d_msac_decode_bools(s, k) + a;
   72|  2.74k|    return ref * 2 <= n ? inv_recenter(ref, v) :
  ------------------
  |  Branch (72:12): [True: 2.74k, False: 2]
  ------------------
   73|  2.74k|                          n - 1 - inv_recenter(n - 1 - ref, v);
   74|  2.74k|}
dav1d_msac_init:
  206|  72.6k|{
  207|  72.6k|    s->buf_pos = data;
  208|  72.6k|    s->buf_end = data + sz;
  209|  72.6k|    s->dif = 0;
  210|  72.6k|    s->rng = 0x8000;
  211|  72.6k|    s->cnt = -15;
  212|  72.6k|    s->allow_update_cdf = !disable_cdf_update_flag;
  213|  72.6k|    ctx_refill(s);
  214|       |
  215|  72.6k|#if ARCH_X86_64 && HAVE_ASM
  216|  72.6k|    s->symbol_adapt16 = dav1d_msac_decode_symbol_adapt_c;
  217|       |
  218|  72.6k|    msac_init_x86(s);
  219|  72.6k|#endif
  220|  72.6k|}
msac.c:ctx_refill:
   41|  72.6k|static inline void ctx_refill(MsacContext *const s) {
   42|  72.6k|    const uint8_t *buf_pos = s->buf_pos;
   43|  72.6k|    const uint8_t *buf_end = s->buf_end;
   44|  72.6k|    int c = EC_WIN_SIZE - s->cnt - 24;
  ------------------
  |  |   39|  72.6k|#define EC_WIN_SIZE (sizeof(ec_win) << 3)
  ------------------
   45|  72.6k|    ec_win dif = s->dif;
   46|   498k|    do {
   47|   498k|        if (buf_pos >= buf_end) {
  ------------------
  |  Branch (47:13): [True: 4.04k, False: 494k]
  ------------------
   48|       |            // set remaining bits to 1;
   49|  4.04k|            dif |= ~(~(ec_win)0xff << c);
   50|  4.04k|            break;
   51|  4.04k|        }
   52|   494k|        dif |= (ec_win)(*buf_pos++ ^ 0xff) << c;
   53|   494k|        c -= 8;
   54|   494k|    } while (c >= 0);
  ------------------
  |  Branch (54:14): [True: 426k, False: 68.5k]
  ------------------
   55|  72.6k|    s->dif = dif;
   56|  72.6k|    s->cnt = EC_WIN_SIZE - c - 24;
  ------------------
  |  |   39|  72.6k|#define EC_WIN_SIZE (sizeof(ec_win) << 3)
  ------------------
   57|  72.6k|    s->buf_pos = buf_pos;
   58|  72.6k|}

decode.c:dav1d_msac_decode_bools:
   94|   155k|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|   155k|    unsigned v = 0;
   96|   323k|    while (n--)
  ------------------
  |  Branch (96:12): [True: 167k, False: 155k]
  ------------------
   97|   167k|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|   167k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|   155k|    return v;
   99|   155k|}
decode.c:dav1d_msac_decode_uniform:
  101|  41.5k|static inline int dav1d_msac_decode_uniform(MsacContext *const s, const unsigned n) {
  102|  41.5k|    assert(n > 0);
  ------------------
  |  |  140|  41.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 41.5k]
  |  |  |  Branch (140:68): [Folded, False: 41.5k]
  |  |  ------------------
  ------------------
  103|  41.5k|    const int l = ulog2(n) + 1;
  104|  41.5k|    assert(l > 1);
  ------------------
  |  |  140|  41.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 41.5k]
  |  |  |  Branch (140:68): [Folded, False: 41.5k]
  |  |  ------------------
  ------------------
  105|  41.5k|    const unsigned m = (1 << l) - n;
  106|  41.5k|    const unsigned v = dav1d_msac_decode_bools(s, l - 1);
  107|  41.5k|    return v < m ? v : (v << 1) - m + dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  9.63k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (107:12): [True: 31.9k, False: 9.63k]
  ------------------
  108|  41.5k|}
msac.c:dav1d_msac_decode_bools:
   94|  2.74k|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|  2.74k|    unsigned v = 0;
   96|  11.8k|    while (n--)
  ------------------
  |  Branch (96:12): [True: 9.11k, False: 2.74k]
  ------------------
   97|  9.11k|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  9.11k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|  2.74k|    return v;
   99|  2.74k|}
recon_tmpl.c:dav1d_msac_decode_bools:
   94|  3.05M|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|  3.05M|    unsigned v = 0;
   96|  12.5M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 9.53M, False: 3.05M]
  ------------------
   97|  9.53M|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  9.53M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|  3.05M|    return v;
   99|  3.05M|}

dav1d_parse_obus:
 1169|  68.3k|ptrdiff_t dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
 1170|  68.3k|    GetBits gb;
 1171|  68.3k|    int res;
 1172|       |
 1173|  68.3k|    dav1d_init_get_bits(&gb, in->data, in->sz);
 1174|       |
 1175|       |    // obu header
 1176|  68.3k|    const int obu_forbidden_bit = dav1d_get_bit(&gb);
 1177|  68.3k|    if (c->strict_std_compliance && obu_forbidden_bit) goto error;
  ------------------
  |  Branch (1177:9): [True: 0, False: 68.3k]
  |  Branch (1177:37): [True: 0, False: 0]
  ------------------
 1178|  68.3k|    const enum Dav1dObuType type = dav1d_get_bits(&gb, 4);
 1179|  68.3k|    const int has_extension = dav1d_get_bit(&gb);
 1180|  68.3k|    const int has_length_field = dav1d_get_bit(&gb);
 1181|  68.3k|    dav1d_get_bit(&gb); // reserved
 1182|       |
 1183|  68.3k|    int temporal_id = 0, spatial_id = 0;
 1184|  68.3k|    if (has_extension) {
  ------------------
  |  Branch (1184:9): [True: 45.5k, False: 22.7k]
  ------------------
 1185|  45.5k|        temporal_id = dav1d_get_bits(&gb, 3);
 1186|  45.5k|        spatial_id = dav1d_get_bits(&gb, 2);
 1187|  45.5k|        dav1d_get_bits(&gb, 3); // reserved
 1188|  45.5k|    }
 1189|       |
 1190|  68.3k|    if (has_length_field) {
  ------------------
  |  Branch (1190:9): [True: 68.3k, False: 0]
  ------------------
 1191|  68.3k|        const size_t len = dav1d_get_uleb128(&gb);
 1192|  68.3k|        if (len > (size_t)(gb.ptr_end - gb.ptr)) goto error;
  ------------------
  |  Branch (1192:13): [True: 0, False: 68.3k]
  ------------------
 1193|  68.3k|        gb.ptr_end = gb.ptr + len;
 1194|  68.3k|    }
 1195|  68.3k|    if (gb.error) goto error;
  ------------------
  |  Branch (1195:9): [True: 0, False: 68.3k]
  ------------------
 1196|       |
 1197|       |    // We must have read a whole number of bytes at this point (1 byte
 1198|       |    // for the header and whole bytes at a time when reading the
 1199|       |    // leb128 length field).
 1200|  68.3k|    assert(gb.bits_left == 0);
  ------------------
  |  |  140|  68.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 68.3k]
  |  |  |  Branch (140:68): [Folded, False: 68.3k]
  |  |  ------------------
  ------------------
 1201|       |
 1202|       |    // skip obu not belonging to the selected temporal/spatial layer
 1203|  68.3k|    if (type != DAV1D_OBU_SEQ_HDR && type != DAV1D_OBU_TD &&
  ------------------
  |  Branch (1203:9): [True: 56.9k, False: 11.3k]
  |  Branch (1203:38): [True: 45.5k, False: 11.3k]
  ------------------
 1204|  45.5k|        has_extension && c->operating_point_idc != 0)
  ------------------
  |  Branch (1204:9): [True: 45.5k, False: 0]
  |  Branch (1204:26): [True: 45.5k, False: 0]
  ------------------
 1205|  45.5k|    {
 1206|  45.5k|        const int in_temporal_layer = (c->operating_point_idc >> temporal_id) & 1;
 1207|  45.5k|        const int in_spatial_layer = (c->operating_point_idc >> (spatial_id + 8)) & 1;
 1208|  45.5k|        if (!in_temporal_layer || !in_spatial_layer)
  ------------------
  |  Branch (1208:13): [True: 0, False: 45.5k]
  |  Branch (1208:35): [True: 0, False: 45.5k]
  ------------------
 1209|      0|            return gb.ptr_end - gb.ptr_start;
 1210|  45.5k|    }
 1211|       |
 1212|  68.3k|    switch (type) {
 1213|  11.3k|    case DAV1D_OBU_SEQ_HDR: {
  ------------------
  |  Branch (1213:5): [True: 11.3k, False: 56.9k]
  ------------------
 1214|  11.3k|        Dav1dRef *ref = dav1d_ref_create_using_pool(c->seq_hdr_pool,
 1215|  11.3k|                                                    sizeof(Dav1dSequenceHeader));
 1216|  11.3k|        if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1216:13): [True: 0, False: 11.3k]
  ------------------
 1217|  11.3k|        Dav1dSequenceHeader *seq_hdr = ref->data;
 1218|  11.3k|        if ((res = parse_seq_hdr(seq_hdr, &gb, c->strict_std_compliance)) < 0) {
  ------------------
  |  Branch (1218:13): [True: 0, False: 11.3k]
  ------------------
 1219|      0|            dav1d_log(c, "Error parsing sequence header\n");
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1220|      0|            dav1d_ref_dec(&ref);
 1221|      0|            goto error;
 1222|      0|        }
 1223|       |
 1224|  11.3k|        const int op_idx =
 1225|  11.3k|            c->operating_point < seq_hdr->num_operating_points ? c->operating_point : 0;
  ------------------
  |  Branch (1225:13): [True: 11.3k, False: 0]
  ------------------
 1226|  11.3k|        c->operating_point_idc = seq_hdr->operating_points[op_idx].idc;
 1227|  11.3k|        const unsigned spatial_mask = c->operating_point_idc >> 8;
 1228|  11.3k|        c->max_spatial_id = spatial_mask ? ulog2(spatial_mask) : 0;
  ------------------
  |  Branch (1228:29): [True: 11.3k, False: 0]
  ------------------
 1229|       |
 1230|       |        // If we have read a sequence header which is different from
 1231|       |        // the old one, this is a new video sequence and can't use any
 1232|       |        // previous state. Free that state.
 1233|       |
 1234|  11.3k|        if (!c->seq_hdr) {
  ------------------
  |  Branch (1234:13): [True: 11.3k, False: 0]
  ------------------
 1235|  11.3k|            c->frame_hdr = NULL;
 1236|  11.3k|            c->frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
 1237|       |        // see 7.5, operating_parameter_info is allowed to change in
 1238|       |        // sequence headers of a single sequence
 1239|  11.3k|        } else if (memcmp(seq_hdr, c->seq_hdr, offsetof(Dav1dSequenceHeader, operating_parameter_info))) {
  ------------------
  |  Branch (1239:20): [True: 0, False: 0]
  ------------------
 1240|      0|            c->frame_hdr = NULL;
 1241|      0|            c->mastering_display = NULL;
 1242|      0|            c->content_light = NULL;
 1243|      0|            dav1d_ref_dec(&c->mastering_display_ref);
 1244|      0|            dav1d_ref_dec(&c->content_light_ref);
 1245|      0|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1245:29): [True: 0, False: 0]
  ------------------
 1246|      0|                if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1246:21): [True: 0, False: 0]
  ------------------
 1247|      0|                    dav1d_thread_picture_unref(&c->refs[i].p);
 1248|      0|                dav1d_ref_dec(&c->refs[i].segmap);
 1249|      0|                dav1d_ref_dec(&c->refs[i].refmvs);
 1250|      0|                dav1d_cdf_thread_unref(&c->cdf[i]);
 1251|      0|            }
 1252|      0|            c->frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
 1253|       |        // If operating_parameter_info changed, signal it
 1254|      0|        } else if (memcmp(seq_hdr->operating_parameter_info, c->seq_hdr->operating_parameter_info,
  ------------------
  |  Branch (1254:20): [True: 0, False: 0]
  ------------------
 1255|      0|                          sizeof(seq_hdr->operating_parameter_info)))
 1256|      0|        {
 1257|      0|            c->frame_flags |= PICTURE_FLAG_NEW_OP_PARAMS_INFO;
 1258|      0|        }
 1259|  11.3k|        dav1d_ref_dec(&c->seq_hdr_ref);
 1260|  11.3k|        c->seq_hdr_ref = ref;
 1261|  11.3k|        c->seq_hdr = seq_hdr;
 1262|  11.3k|        break;
 1263|  11.3k|    }
 1264|      0|    case DAV1D_OBU_REDUNDANT_FRAME_HDR:
  ------------------
  |  Branch (1264:5): [True: 0, False: 68.3k]
  ------------------
 1265|      0|        if (c->frame_hdr) break;
  ------------------
  |  Branch (1265:13): [True: 0, False: 0]
  ------------------
 1266|       |        // fall-through
 1267|  45.5k|    case DAV1D_OBU_FRAME:
  ------------------
  |  Branch (1267:5): [True: 45.5k, False: 22.7k]
  ------------------
 1268|  45.5k|    case DAV1D_OBU_FRAME_HDR:
  ------------------
  |  Branch (1268:5): [True: 0, False: 68.3k]
  ------------------
 1269|  45.5k|        if (!c->seq_hdr) goto error;
  ------------------
  |  Branch (1269:13): [True: 0, False: 45.5k]
  ------------------
 1270|  45.5k|        if (!c->frame_hdr_ref) {
  ------------------
  |  Branch (1270:13): [True: 45.5k, False: 0]
  ------------------
 1271|  45.5k|            c->frame_hdr_ref = dav1d_ref_create_using_pool(c->frame_hdr_pool,
 1272|  45.5k|                                                           sizeof(Dav1dFrameHeader));
 1273|  45.5k|            if (!c->frame_hdr_ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1273:17): [True: 0, False: 45.5k]
  ------------------
 1274|  45.5k|        }
 1275|       |#ifndef NDEBUG
 1276|       |        // ensure that the reference is writable
 1277|       |        assert(dav1d_ref_is_writable(c->frame_hdr_ref));
 1278|       |#endif
 1279|  45.5k|        c->frame_hdr = c->frame_hdr_ref->data;
 1280|  45.5k|        memset(c->frame_hdr, 0, sizeof(*c->frame_hdr));
 1281|  45.5k|        c->frame_hdr->temporal_id = temporal_id;
 1282|  45.5k|        c->frame_hdr->spatial_id = spatial_id;
 1283|  45.5k|        if ((res = parse_frame_hdr(c, &gb)) < 0) {
  ------------------
  |  Branch (1283:13): [True: 0, False: 45.5k]
  ------------------
 1284|      0|            c->frame_hdr = NULL;
 1285|      0|            goto error;
 1286|      0|        }
 1287|  45.5k|        for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (1287:25): [True: 0, False: 45.5k]
  ------------------
 1288|      0|            dav1d_data_unref_internal(&c->tile[n].data);
 1289|  45.5k|        c->n_tile_data = 0;
 1290|  45.5k|        c->n_tiles = 0;
 1291|  45.5k|        if (type != DAV1D_OBU_FRAME) {
  ------------------
  |  Branch (1291:13): [True: 0, False: 45.5k]
  ------------------
 1292|       |            // This is actually a frame header OBU so read the
 1293|       |            // trailing bit and check for overrun.
 1294|      0|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1294:17): [True: 0, False: 0]
  ------------------
 1295|      0|                c->frame_hdr = NULL;
 1296|      0|                goto error;
 1297|      0|            }
 1298|      0|        }
 1299|       |
 1300|  45.5k|        if (c->frame_size_limit && (int64_t)c->frame_hdr->width[1] *
  ------------------
  |  Branch (1300:13): [True: 45.5k, False: 0]
  |  Branch (1300:36): [True: 0, False: 45.5k]
  ------------------
 1301|  45.5k|            c->frame_hdr->height > c->frame_size_limit)
 1302|      0|        {
 1303|      0|            dav1d_log(c, "Frame size %dx%d exceeds limit %u\n", c->frame_hdr->width[1],
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1304|      0|                      c->frame_hdr->height, c->frame_size_limit);
 1305|      0|            c->frame_hdr = NULL;
 1306|      0|            return DAV1D_ERR(ERANGE);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1307|      0|        }
 1308|       |
 1309|  45.5k|        if (type != DAV1D_OBU_FRAME)
  ------------------
  |  Branch (1309:13): [True: 0, False: 45.5k]
  ------------------
 1310|      0|            break;
 1311|       |        // OBU_FRAMEs shouldn't be signaled with show_existing_frame
 1312|  45.5k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1312:13): [True: 0, False: 45.5k]
  ------------------
 1313|      0|            c->frame_hdr = NULL;
 1314|      0|            goto error;
 1315|      0|        }
 1316|       |
 1317|       |        // This is the frame header at the start of a frame OBU.
 1318|       |        // There's no trailing bit at the end to skip, but we do need
 1319|       |        // to align to the next byte.
 1320|  45.5k|        dav1d_bytealign_get_bits(&gb);
 1321|       |        // fall-through
 1322|  45.5k|    case DAV1D_OBU_TILE_GRP: {
  ------------------
  |  Branch (1322:5): [True: 0, False: 68.3k]
  ------------------
 1323|  45.5k|        if (!c->frame_hdr) goto error;
  ------------------
  |  Branch (1323:13): [True: 0, False: 45.5k]
  ------------------
 1324|  45.5k|        if (c->n_tile_data_alloc < c->n_tile_data + 1) {
  ------------------
  |  Branch (1324:13): [True: 11.3k, False: 34.1k]
  ------------------
 1325|  11.3k|            if ((c->n_tile_data + 1) > INT_MAX / (int)sizeof(*c->tile)) goto error;
  ------------------
  |  Branch (1325:17): [True: 0, False: 11.3k]
  ------------------
 1326|  11.3k|            struct Dav1dTileGroup *tile = dav1d_realloc(ALLOC_TILE, c->tile,
  ------------------
  |  |  133|  11.3k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1327|  11.3k|                                                        (c->n_tile_data + 1) * sizeof(*c->tile));
 1328|  11.3k|            if (!tile) goto error;
  ------------------
  |  Branch (1328:17): [True: 0, False: 11.3k]
  ------------------
 1329|  11.3k|            c->tile = tile;
 1330|  11.3k|            memset(c->tile + c->n_tile_data, 0, sizeof(*c->tile));
 1331|  11.3k|            c->n_tile_data_alloc = c->n_tile_data + 1;
 1332|  11.3k|        }
 1333|  45.5k|        parse_tile_hdr(c, &gb);
 1334|       |        // Align to the next byte boundary and check for overrun.
 1335|  45.5k|        dav1d_bytealign_get_bits(&gb);
 1336|  45.5k|        if (gb.error) goto error;
  ------------------
  |  Branch (1336:13): [True: 0, False: 45.5k]
  ------------------
 1337|       |
 1338|  45.5k|        dav1d_data_ref(&c->tile[c->n_tile_data].data, in);
 1339|  45.5k|        c->tile[c->n_tile_data].data.data = gb.ptr;
 1340|  45.5k|        c->tile[c->n_tile_data].data.sz = (size_t)(gb.ptr_end - gb.ptr);
 1341|       |        // ensure tile groups are in order and sane, see 6.10.1
 1342|  45.5k|        if (c->tile[c->n_tile_data].start > c->tile[c->n_tile_data].end ||
  ------------------
  |  Branch (1342:13): [True: 0, False: 45.5k]
  ------------------
 1343|  45.5k|            c->tile[c->n_tile_data].start != c->n_tiles)
  ------------------
  |  Branch (1343:13): [True: 0, False: 45.5k]
  ------------------
 1344|      0|        {
 1345|      0|            for (int i = 0; i <= c->n_tile_data; i++)
  ------------------
  |  Branch (1345:29): [True: 0, False: 0]
  ------------------
 1346|      0|                dav1d_data_unref_internal(&c->tile[i].data);
 1347|      0|            c->n_tile_data = 0;
 1348|      0|            c->n_tiles = 0;
 1349|      0|            goto error;
 1350|      0|        }
 1351|  45.5k|        c->n_tiles += 1 + c->tile[c->n_tile_data].end -
 1352|  45.5k|                          c->tile[c->n_tile_data].start;
 1353|  45.5k|        c->n_tile_data++;
 1354|  45.5k|        break;
 1355|  45.5k|    }
 1356|      0|    case DAV1D_OBU_METADATA: {
  ------------------
  |  Branch (1356:5): [True: 0, False: 68.3k]
  ------------------
 1357|      0|#define DEBUG_OBU_METADATA 0
 1358|       |#if DEBUG_OBU_METADATA
 1359|       |        const uint8_t *const init_ptr = gb.ptr;
 1360|       |#endif
 1361|       |        // obu metadta type field
 1362|      0|        const enum ObuMetaType meta_type = dav1d_get_uleb128(&gb);
 1363|      0|        if (gb.error) goto error;
  ------------------
  |  Branch (1363:13): [True: 0, False: 0]
  ------------------
 1364|       |
 1365|      0|        switch (meta_type) {
 1366|      0|        case OBU_META_HDR_CLL: {
  ------------------
  |  Branch (1366:9): [True: 0, False: 0]
  ------------------
 1367|      0|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|      0|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1368|      0|                                             sizeof(Dav1dContentLightLevel));
 1369|      0|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1369:17): [True: 0, False: 0]
  ------------------
 1370|      0|            Dav1dContentLightLevel *const content_light = ref->data;
 1371|       |
 1372|      0|            content_light->max_content_light_level = dav1d_get_bits(&gb, 16);
 1373|       |#if DEBUG_OBU_METADATA
 1374|       |            printf("CLLOBU: max-content-light-level: %d [off=%td]\n",
 1375|       |                   content_light->max_content_light_level,
 1376|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1377|       |#endif
 1378|      0|            content_light->max_frame_average_light_level = dav1d_get_bits(&gb, 16);
 1379|       |#if DEBUG_OBU_METADATA
 1380|       |            printf("CLLOBU: max-frame-average-light-level: %d [off=%td]\n",
 1381|       |                   content_light->max_frame_average_light_level,
 1382|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1383|       |#endif
 1384|       |
 1385|      0|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1385:17): [True: 0, False: 0]
  ------------------
 1386|      0|                dav1d_ref_dec(&ref);
 1387|      0|                goto error;
 1388|      0|            }
 1389|       |
 1390|      0|            dav1d_ref_dec(&c->content_light_ref);
 1391|      0|            c->content_light = content_light;
 1392|      0|            c->content_light_ref = ref;
 1393|      0|            break;
 1394|      0|        }
 1395|      0|        case OBU_META_HDR_MDCV: {
  ------------------
  |  Branch (1395:9): [True: 0, False: 0]
  ------------------
 1396|      0|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|      0|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1397|      0|                                             sizeof(Dav1dMasteringDisplay));
 1398|      0|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1398:17): [True: 0, False: 0]
  ------------------
 1399|      0|            Dav1dMasteringDisplay *const mastering_display = ref->data;
 1400|       |
 1401|      0|            for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1401:29): [True: 0, False: 0]
  ------------------
 1402|      0|                mastering_display->primaries[i][0] = dav1d_get_bits(&gb, 16);
 1403|      0|                mastering_display->primaries[i][1] = dav1d_get_bits(&gb, 16);
 1404|       |#if DEBUG_OBU_METADATA
 1405|       |                printf("MDCVOBU: primaries[%d]: (%d, %d) [off=%td]\n", i,
 1406|       |                       mastering_display->primaries[i][0],
 1407|       |                       mastering_display->primaries[i][1],
 1408|       |                       (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1409|       |#endif
 1410|      0|            }
 1411|      0|            mastering_display->white_point[0] = dav1d_get_bits(&gb, 16);
 1412|       |#if DEBUG_OBU_METADATA
 1413|       |            printf("MDCVOBU: white-point-x: %d [off=%td]\n",
 1414|       |                   mastering_display->white_point[0],
 1415|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1416|       |#endif
 1417|      0|            mastering_display->white_point[1] = dav1d_get_bits(&gb, 16);
 1418|       |#if DEBUG_OBU_METADATA
 1419|       |            printf("MDCVOBU: white-point-y: %d [off=%td]\n",
 1420|       |                   mastering_display->white_point[1],
 1421|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1422|       |#endif
 1423|      0|            mastering_display->max_luminance = dav1d_get_bits(&gb, 32);
 1424|       |#if DEBUG_OBU_METADATA
 1425|       |            printf("MDCVOBU: max-luminance: %d [off=%td]\n",
 1426|       |                   mastering_display->max_luminance,
 1427|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1428|       |#endif
 1429|      0|            mastering_display->min_luminance = dav1d_get_bits(&gb, 32);
 1430|       |#if DEBUG_OBU_METADATA
 1431|       |            printf("MDCVOBU: min-luminance: %d [off=%td]\n",
 1432|       |                   mastering_display->min_luminance,
 1433|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1434|       |#endif
 1435|      0|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1435:17): [True: 0, False: 0]
  ------------------
 1436|      0|                dav1d_ref_dec(&ref);
 1437|      0|                goto error;
 1438|      0|            }
 1439|       |
 1440|      0|            dav1d_ref_dec(&c->mastering_display_ref);
 1441|      0|            c->mastering_display = mastering_display;
 1442|      0|            c->mastering_display_ref = ref;
 1443|      0|            break;
 1444|      0|        }
 1445|      0|        case OBU_META_ITUT_T35: {
  ------------------
  |  Branch (1445:9): [True: 0, False: 0]
  ------------------
 1446|      0|            ptrdiff_t payload_size = gb.ptr_end - gb.ptr;
 1447|       |            // Don't take into account all the trailing bits for payload_size
 1448|      0|            while (payload_size > 0 && !gb.ptr[payload_size - 1])
  ------------------
  |  Branch (1448:20): [True: 0, False: 0]
  |  Branch (1448:40): [True: 0, False: 0]
  ------------------
 1449|      0|                payload_size--; // trailing_zero_bit x 8
 1450|      0|            payload_size--; // trailing_one_bit + trailing_zero_bit x 7
 1451|       |
 1452|      0|            int country_code_extension_byte = 0;
 1453|      0|            const int country_code = dav1d_get_bits(&gb, 8);
 1454|      0|            payload_size--;
 1455|      0|            if (country_code == 0xFF) {
  ------------------
  |  Branch (1455:17): [True: 0, False: 0]
  ------------------
 1456|      0|                country_code_extension_byte = dav1d_get_bits(&gb, 8);
 1457|      0|                payload_size--;
 1458|      0|            }
 1459|       |
 1460|      0|            if (payload_size <= 0 || gb.ptr[payload_size] != 0x80) {
  ------------------
  |  Branch (1460:17): [True: 0, False: 0]
  |  Branch (1460:38): [True: 0, False: 0]
  ------------------
 1461|      0|                dav1d_log(c, "Malformed ITU-T T.35 metadata message format\n");
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1462|      0|                break;
 1463|      0|            }
 1464|       |
 1465|      0|            if ((c->n_itut_t35 + 1) > INT_MAX / (int)sizeof(*c->itut_t35)) goto error;
  ------------------
  |  Branch (1465:17): [True: 0, False: 0]
  ------------------
 1466|      0|            struct Dav1dITUTT35 *itut_t35 = dav1d_realloc(ALLOC_OBU_META, c->itut_t35,
  ------------------
  |  |  133|      0|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1467|      0|                                                          (c->n_itut_t35 + 1) * sizeof(*c->itut_t35));
 1468|      0|            if (!itut_t35) goto error;
  ------------------
  |  Branch (1468:17): [True: 0, False: 0]
  ------------------
 1469|      0|            c->itut_t35 = itut_t35;
 1470|      0|            memset(c->itut_t35 + c->n_itut_t35, 0, sizeof(*c->itut_t35));
 1471|       |
 1472|      0|            struct itut_t35_ctx_context *itut_t35_ctx;
 1473|      0|            if (!c->n_itut_t35) {
  ------------------
  |  Branch (1473:17): [True: 0, False: 0]
  ------------------
 1474|      0|                assert(!c->itut_t35_ref);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1475|      0|                itut_t35_ctx = dav1d_malloc(ALLOC_OBU_META, sizeof(struct itut_t35_ctx_context));
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1476|      0|                if (!itut_t35_ctx) goto error;
  ------------------
  |  Branch (1476:21): [True: 0, False: 0]
  ------------------
 1477|      0|                c->itut_t35_ref = dav1d_ref_init(&itut_t35_ctx->ref, c->itut_t35,
 1478|      0|                                                 dav1d_picture_free_itut_t35, itut_t35_ctx, 0);
 1479|      0|            } else {
 1480|      0|                assert(c->itut_t35_ref && atomic_load(&c->itut_t35_ref->ref_cnt) == 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1481|      0|                itut_t35_ctx = c->itut_t35_ref->user_data;
 1482|      0|                c->itut_t35_ref->const_data = (uint8_t *)c->itut_t35;
 1483|      0|            }
 1484|      0|            itut_t35_ctx->itut_t35 = c->itut_t35;
 1485|      0|            itut_t35_ctx->n_itut_t35 = c->n_itut_t35 + 1;
 1486|       |
 1487|      0|            Dav1dITUTT35 *const itut_t35_metadata = &c->itut_t35[c->n_itut_t35];
 1488|      0|            itut_t35_metadata->payload = dav1d_malloc(ALLOC_OBU_META, payload_size);
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1489|      0|            if (!itut_t35_metadata->payload) goto error;
  ------------------
  |  Branch (1489:17): [True: 0, False: 0]
  ------------------
 1490|       |
 1491|      0|            itut_t35_metadata->country_code = country_code;
 1492|      0|            itut_t35_metadata->country_code_extension_byte = country_code_extension_byte;
 1493|      0|            itut_t35_metadata->payload_size = payload_size;
 1494|       |
 1495|       |            // We know that we've read a whole number of bytes and that the
 1496|       |            // payload is within the OBU boundaries, so just use memcpy()
 1497|      0|            assert(gb.bits_left == 0);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1498|      0|            memcpy(itut_t35_metadata->payload, gb.ptr, payload_size);
 1499|       |
 1500|      0|            c->n_itut_t35++;
 1501|      0|            break;
 1502|      0|        }
 1503|      0|        case OBU_META_SCALABILITY:
  ------------------
  |  Branch (1503:9): [True: 0, False: 0]
  ------------------
 1504|      0|        case OBU_META_TIMECODE:
  ------------------
  |  Branch (1504:9): [True: 0, False: 0]
  ------------------
 1505|       |            // ignore metadata OBUs we don't care about
 1506|      0|            break;
 1507|      0|        default:
  ------------------
  |  Branch (1507:9): [True: 0, False: 0]
  ------------------
 1508|       |            // print a warning but don't fail for unknown types
 1509|      0|            if (meta_type > 31) // Types 6 to 31 are "Unregistered user private", so ignore them.
  ------------------
  |  Branch (1509:17): [True: 0, False: 0]
  ------------------
 1510|      0|                dav1d_log(c, "Unknown Metadata OBU type %d\n", meta_type);
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1511|      0|            break;
 1512|      0|        }
 1513|       |
 1514|      0|        break;
 1515|      0|    }
 1516|  11.3k|    case DAV1D_OBU_TD:
  ------------------
  |  Branch (1516:5): [True: 11.3k, False: 56.9k]
  ------------------
 1517|  11.3k|        c->frame_flags |= PICTURE_FLAG_NEW_TEMPORAL_UNIT;
 1518|  11.3k|        break;
 1519|      0|    case DAV1D_OBU_PADDING:
  ------------------
  |  Branch (1519:5): [True: 0, False: 68.3k]
  ------------------
 1520|       |        // ignore OBUs we don't care about
 1521|      0|        break;
 1522|      0|    default:
  ------------------
  |  Branch (1522:5): [True: 0, False: 68.3k]
  ------------------
 1523|       |        // print a warning but don't fail for unknown types
 1524|      0|        dav1d_log(c, "Unknown OBU type %d of size %td\n", type, gb.ptr_end - gb.ptr);
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1525|      0|        break;
 1526|  68.3k|    }
 1527|       |
 1528|  68.3k|    if (c->seq_hdr && c->frame_hdr) {
  ------------------
  |  Branch (1528:9): [True: 56.9k, False: 11.3k]
  |  Branch (1528:23): [True: 45.5k, False: 11.3k]
  ------------------
 1529|  45.5k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1529:13): [True: 0, False: 45.5k]
  ------------------
 1530|      0|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1530:17): [True: 0, False: 0]
  ------------------
 1531|      0|            switch (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type) {
 1532|      0|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1532:13): [True: 0, False: 0]
  ------------------
 1533|      0|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1533:13): [True: 0, False: 0]
  ------------------
 1534|      0|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE)
  ------------------
  |  Branch (1534:21): [True: 0, False: 0]
  ------------------
 1535|      0|                    goto skip;
 1536|      0|                break;
 1537|      0|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1537:13): [True: 0, False: 0]
  ------------------
 1538|      0|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA)
  ------------------
  |  Branch (1538:21): [True: 0, False: 0]
  ------------------
 1539|      0|                    goto skip;
 1540|       |                // fall-through
 1541|      0|            default:
  ------------------
  |  Branch (1541:13): [True: 0, False: 0]
  ------------------
 1542|      0|                break;
 1543|      0|            }
 1544|      0|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.data[0]) goto error;
  ------------------
  |  Branch (1544:17): [True: 0, False: 0]
  ------------------
 1545|      0|            if (c->strict_std_compliance &&
  ------------------
  |  Branch (1545:17): [True: 0, False: 0]
  ------------------
 1546|      0|                !c->refs[c->frame_hdr->existing_frame_idx].p.showable)
  ------------------
  |  Branch (1546:17): [True: 0, False: 0]
  ------------------
 1547|      0|            {
 1548|      0|                goto error;
 1549|      0|            }
 1550|      0|            if (c->n_fc == 1) {
  ------------------
  |  Branch (1550:17): [True: 0, False: 0]
  ------------------
 1551|      0|                dav1d_thread_picture_ref(&c->out,
 1552|      0|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1553|      0|                dav1d_picture_copy_props(&c->out.p,
 1554|      0|                                         c->content_light, c->content_light_ref,
 1555|      0|                                         c->mastering_display, c->mastering_display_ref,
 1556|      0|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1557|      0|                                         &in->m);
 1558|       |                // Must be removed from the context after being attached to the frame
 1559|      0|                dav1d_ref_dec(&c->itut_t35_ref);
 1560|      0|                c->itut_t35 = NULL;
 1561|      0|                c->n_itut_t35 = 0;
 1562|      0|                c->event_flags |= dav1d_picture_get_event_flags(&c->refs[c->frame_hdr->existing_frame_idx].p);
 1563|      0|            } else {
 1564|      0|                pthread_mutex_lock(&c->task_thread.lock);
 1565|       |                // need to append this to the frame output queue
 1566|      0|                const unsigned next = c->frame_thread.next++;
 1567|      0|                if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (1567:21): [True: 0, False: 0]
  ------------------
 1568|      0|                    c->frame_thread.next = 0;
 1569|       |
 1570|      0|                Dav1dFrameContext *const f = &c->fc[next];
 1571|      0|                while (f->n_tile_data > 0)
  ------------------
  |  Branch (1571:24): [True: 0, False: 0]
  ------------------
 1572|      0|                    pthread_cond_wait(&f->task_thread.cond,
 1573|      0|                                      &f->task_thread.ttd->lock);
 1574|      0|                Dav1dThreadPicture *const out_delayed =
 1575|      0|                    &c->frame_thread.out_delayed[next];
 1576|      0|                if (out_delayed->p.data[0] || atomic_load(&f->task_thread.error)) {
  ------------------
  |  Branch (1576:21): [True: 0, False: 0]
  |  Branch (1576:47): [True: 0, False: 0]
  ------------------
 1577|      0|                    unsigned first = atomic_load(&c->task_thread.first);
 1578|      0|                    if (first + 1U < c->n_fc)
  ------------------
  |  Branch (1578:25): [True: 0, False: 0]
  ------------------
 1579|      0|                        atomic_fetch_add(&c->task_thread.first, 1U);
 1580|      0|                    else
 1581|      0|                        atomic_store(&c->task_thread.first, 0);
 1582|      0|                    atomic_compare_exchange_strong(&c->task_thread.reset_task_cur,
 1583|      0|                                                   &first, UINT_MAX);
 1584|      0|                    if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (1584:25): [True: 0, False: 0]
  |  Branch (1584:47): [True: 0, False: 0]
  ------------------
 1585|      0|                        c->task_thread.cur--;
 1586|      0|                }
 1587|      0|                const int error = f->task_thread.retval;
 1588|      0|                if (error) {
  ------------------
  |  Branch (1588:21): [True: 0, False: 0]
  ------------------
 1589|      0|                    c->cached_error = error;
 1590|      0|                    f->task_thread.retval = 0;
 1591|      0|                    dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 1592|      0|                    dav1d_thread_picture_unref(out_delayed);
 1593|      0|                } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (1593:28): [True: 0, False: 0]
  ------------------
 1594|      0|                    const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 1595|      0|                                                                   memory_order_relaxed);
 1596|      0|                    if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (1596:26): [True: 0, False: 0]
  |  Branch (1596:50): [True: 0, False: 0]
  ------------------
 1597|      0|                        progress != FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (1597:25): [True: 0, False: 0]
  ------------------
 1598|      0|                    {
 1599|      0|                        dav1d_thread_picture_ref(&c->out, out_delayed);
 1600|      0|                        c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 1601|      0|                    }
 1602|      0|                    dav1d_thread_picture_unref(out_delayed);
 1603|      0|                }
 1604|      0|                dav1d_thread_picture_ref(out_delayed,
 1605|      0|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1606|      0|                out_delayed->visible = 1;
 1607|      0|                dav1d_picture_copy_props(&out_delayed->p,
 1608|      0|                                         c->content_light, c->content_light_ref,
 1609|      0|                                         c->mastering_display, c->mastering_display_ref,
 1610|      0|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1611|      0|                                         &in->m);
 1612|       |                // Must be removed from the context after being attached to the frame
 1613|      0|                dav1d_ref_dec(&c->itut_t35_ref);
 1614|      0|                c->itut_t35 = NULL;
 1615|      0|                c->n_itut_t35 = 0;
 1616|       |
 1617|      0|                pthread_mutex_unlock(&c->task_thread.lock);
 1618|      0|            }
 1619|      0|            if (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY) {
  ------------------
  |  Branch (1619:17): [True: 0, False: 0]
  ------------------
 1620|      0|                const int r = c->frame_hdr->existing_frame_idx;
 1621|      0|                c->refs[r].p.showable = 0;
 1622|      0|                for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1622:33): [True: 0, False: 0]
  ------------------
 1623|      0|                    if (i == r) continue;
  ------------------
  |  Branch (1623:25): [True: 0, False: 0]
  ------------------
 1624|       |
 1625|      0|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1625:25): [True: 0, False: 0]
  ------------------
 1626|      0|                        dav1d_thread_picture_unref(&c->refs[i].p);
 1627|      0|                    dav1d_thread_picture_ref(&c->refs[i].p, &c->refs[r].p);
 1628|       |
 1629|      0|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 1630|      0|                    dav1d_cdf_thread_ref(&c->cdf[i], &c->cdf[r]);
 1631|       |
 1632|      0|                    dav1d_ref_dec(&c->refs[i].segmap);
 1633|      0|                    c->refs[i].segmap = c->refs[r].segmap;
 1634|      0|                    if (c->refs[r].segmap)
  ------------------
  |  Branch (1634:25): [True: 0, False: 0]
  ------------------
 1635|      0|                        dav1d_ref_inc(c->refs[r].segmap);
 1636|      0|                    dav1d_ref_dec(&c->refs[i].refmvs);
 1637|      0|                }
 1638|      0|            }
 1639|      0|            c->frame_hdr = NULL;
 1640|  45.5k|        } else if (c->n_tiles == c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows) {
  ------------------
  |  Branch (1640:20): [True: 45.5k, False: 0]
  ------------------
 1641|  45.5k|            switch (c->frame_hdr->frame_type) {
 1642|  34.1k|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1642:13): [True: 34.1k, False: 11.3k]
  ------------------
 1643|  34.1k|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1643:13): [True: 0, False: 45.5k]
  ------------------
 1644|  34.1k|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE ||
  ------------------
  |  Branch (1644:21): [True: 0, False: 34.1k]
  ------------------
 1645|  34.1k|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1645:22): [True: 0, False: 34.1k]
  ------------------
 1646|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1646:22): [True: 0, False: 0]
  ------------------
 1647|      0|                    goto skip;
 1648|  34.1k|                break;
 1649|  34.1k|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1649:13): [True: 0, False: 45.5k]
  ------------------
 1650|      0|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA ||
  ------------------
  |  Branch (1650:21): [True: 0, False: 0]
  ------------------
 1651|      0|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1651:22): [True: 0, False: 0]
  ------------------
 1652|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1652:22): [True: 0, False: 0]
  ------------------
 1653|      0|                    goto skip;
 1654|       |                // fall-through
 1655|  11.3k|            default:
  ------------------
  |  Branch (1655:13): [True: 11.3k, False: 34.1k]
  ------------------
 1656|  11.3k|                break;
 1657|  45.5k|            }
 1658|  45.5k|            if (!c->n_tile_data)
  ------------------
  |  Branch (1658:17): [True: 0, False: 45.5k]
  ------------------
 1659|      0|                goto error;
 1660|  45.5k|            if ((res = dav1d_submit_frame(c)) < 0)
  ------------------
  |  Branch (1660:17): [True: 0, False: 45.5k]
  ------------------
 1661|      0|                return res;
 1662|  45.5k|            assert(!c->n_tile_data);
  ------------------
  |  |  140|  45.5k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 45.5k]
  |  |  |  Branch (140:68): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
 1663|  45.5k|            c->frame_hdr = NULL;
 1664|  45.5k|            c->n_tiles = 0;
 1665|  45.5k|        }
 1666|  45.5k|    }
 1667|       |
 1668|  68.3k|    return gb.ptr_end - gb.ptr_start;
 1669|       |
 1670|      0|skip:
 1671|       |    // update refs with only the headers in case we skip the frame
 1672|      0|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1672:21): [True: 0, False: 0]
  ------------------
 1673|      0|        if (c->frame_hdr->refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (1673:13): [True: 0, False: 0]
  ------------------
 1674|      0|            dav1d_thread_picture_unref(&c->refs[i].p);
 1675|      0|            c->refs[i].p.p.frame_hdr = c->frame_hdr;
 1676|      0|            c->refs[i].p.p.seq_hdr = c->seq_hdr;
 1677|      0|            c->refs[i].p.p.frame_hdr_ref = c->frame_hdr_ref;
 1678|      0|            c->refs[i].p.p.seq_hdr_ref = c->seq_hdr_ref;
 1679|      0|            dav1d_ref_inc(c->frame_hdr_ref);
 1680|      0|            dav1d_ref_inc(c->seq_hdr_ref);
 1681|      0|        }
 1682|      0|    }
 1683|       |
 1684|      0|    dav1d_ref_dec(&c->frame_hdr_ref);
 1685|      0|    c->frame_hdr = NULL;
 1686|      0|    c->n_tiles = 0;
 1687|       |
 1688|      0|    return gb.ptr_end - gb.ptr_start;
 1689|       |
 1690|      0|error:
 1691|      0|    dav1d_data_props_copy(&c->cached_error_props, &in->m);
 1692|      0|    dav1d_log(c, gb.error ? "Overrun in OBU bit buffer\n" :
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
  |  Branch (1692:18): [True: 0, False: 0]
  ------------------
 1693|      0|                            "Error parsing OBU data\n");
 1694|      0|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1695|  68.3k|}
obu.c:parse_seq_hdr:
   75|  11.3k|{
   76|  11.3k|#define DEBUG_SEQ_HDR 0
   77|       |
   78|       |#if DEBUG_SEQ_HDR
   79|       |    const unsigned init_bit_pos = dav1d_get_bits_pos(gb);
   80|       |#endif
   81|       |
   82|  11.3k|    memset(hdr, 0, sizeof(*hdr));
   83|  11.3k|    hdr->profile = dav1d_get_bits(gb, 3);
   84|  11.3k|    if (hdr->profile > 2) goto error;
  ------------------
  |  Branch (84:9): [True: 0, False: 11.3k]
  ------------------
   85|       |#if DEBUG_SEQ_HDR
   86|       |    printf("SEQHDR: post-profile: off=%u\n",
   87|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
   88|       |#endif
   89|       |
   90|  11.3k|    hdr->still_picture = dav1d_get_bit(gb);
   91|  11.3k|    hdr->reduced_still_picture_header = dav1d_get_bit(gb);
   92|  11.3k|    if (hdr->reduced_still_picture_header && !hdr->still_picture) goto error;
  ------------------
  |  Branch (92:9): [True: 0, False: 11.3k]
  |  Branch (92:46): [True: 0, False: 0]
  ------------------
   93|       |#if DEBUG_SEQ_HDR
   94|       |    printf("SEQHDR: post-stillpicture_flags: off=%u\n",
   95|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
   96|       |#endif
   97|       |
   98|  11.3k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (98:9): [True: 0, False: 11.3k]
  ------------------
   99|      0|        hdr->num_operating_points = 1;
  100|      0|        hdr->operating_points[0].major_level = dav1d_get_bits(gb, 3);
  101|      0|        hdr->operating_points[0].minor_level = dav1d_get_bits(gb, 2);
  102|      0|        hdr->operating_points[0].initial_display_delay = 10;
  103|  11.3k|    } else {
  104|  11.3k|        hdr->timing_info_present = dav1d_get_bit(gb);
  105|  11.3k|        if (hdr->timing_info_present) {
  ------------------
  |  Branch (105:13): [True: 0, False: 11.3k]
  ------------------
  106|      0|            hdr->num_units_in_tick = dav1d_get_bits(gb, 32);
  107|      0|            hdr->time_scale = dav1d_get_bits(gb, 32);
  108|      0|            if (strict_std_compliance && (!hdr->num_units_in_tick || !hdr->time_scale))
  ------------------
  |  Branch (108:17): [True: 0, False: 0]
  |  Branch (108:43): [True: 0, False: 0]
  |  Branch (108:70): [True: 0, False: 0]
  ------------------
  109|      0|                goto error;
  110|      0|            hdr->equal_picture_interval = dav1d_get_bit(gb);
  111|      0|            if (hdr->equal_picture_interval) {
  ------------------
  |  Branch (111:17): [True: 0, False: 0]
  ------------------
  112|      0|                const unsigned num_ticks_per_picture = dav1d_get_vlc(gb);
  113|      0|                if (num_ticks_per_picture == UINT32_MAX)
  ------------------
  |  Branch (113:21): [True: 0, False: 0]
  ------------------
  114|      0|                    goto error;
  115|      0|                hdr->num_ticks_per_picture = num_ticks_per_picture + 1;
  116|      0|            }
  117|       |
  118|      0|            hdr->decoder_model_info_present = dav1d_get_bit(gb);
  119|      0|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (119:17): [True: 0, False: 0]
  ------------------
  120|      0|                hdr->encoder_decoder_buffer_delay_length = dav1d_get_bits(gb, 5) + 1;
  121|      0|                hdr->num_units_in_decoding_tick = dav1d_get_bits(gb, 32);
  122|      0|                if (strict_std_compliance && !hdr->num_units_in_decoding_tick)
  ------------------
  |  Branch (122:21): [True: 0, False: 0]
  |  Branch (122:46): [True: 0, False: 0]
  ------------------
  123|      0|                    goto error;
  124|      0|                hdr->buffer_removal_delay_length = dav1d_get_bits(gb, 5) + 1;
  125|      0|                hdr->frame_presentation_delay_length = dav1d_get_bits(gb, 5) + 1;
  126|      0|            }
  127|      0|        }
  128|       |#if DEBUG_SEQ_HDR
  129|       |        printf("SEQHDR: post-timinginfo: off=%u\n",
  130|       |               dav1d_get_bits_pos(gb) - init_bit_pos);
  131|       |#endif
  132|       |
  133|  11.3k|        hdr->display_model_info_present = dav1d_get_bit(gb);
  134|  11.3k|        hdr->num_operating_points = dav1d_get_bits(gb, 5) + 1;
  135|  56.9k|        for (int i = 0; i < hdr->num_operating_points; i++) {
  ------------------
  |  Branch (135:25): [True: 45.5k, False: 11.3k]
  ------------------
  136|  45.5k|            struct Dav1dSequenceHeaderOperatingPoint *const op =
  137|  45.5k|                &hdr->operating_points[i];
  138|  45.5k|            op->idc = dav1d_get_bits(gb, 12);
  139|  45.5k|            if (op->idc && (!(op->idc & 0xff) || !(op->idc & 0xf00)))
  ------------------
  |  Branch (139:17): [True: 45.5k, False: 0]
  |  Branch (139:29): [True: 0, False: 45.5k]
  |  Branch (139:50): [True: 0, False: 45.5k]
  ------------------
  140|      0|                goto error;
  141|  45.5k|            op->major_level = 2 + dav1d_get_bits(gb, 3);
  142|  45.5k|            op->minor_level = dav1d_get_bits(gb, 2);
  143|  45.5k|            if (op->major_level > 3)
  ------------------
  |  Branch (143:17): [True: 0, False: 45.5k]
  ------------------
  144|      0|                op->tier = dav1d_get_bit(gb);
  145|  45.5k|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (145:17): [True: 0, False: 45.5k]
  ------------------
  146|      0|                op->decoder_model_param_present = dav1d_get_bit(gb);
  147|      0|                if (op->decoder_model_param_present) {
  ------------------
  |  Branch (147:21): [True: 0, False: 0]
  ------------------
  148|      0|                    struct Dav1dSequenceHeaderOperatingParameterInfo *const opi =
  149|      0|                        &hdr->operating_parameter_info[i];
  150|      0|                    opi->decoder_buffer_delay =
  151|      0|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  152|      0|                    opi->encoder_buffer_delay =
  153|      0|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  154|      0|                    opi->low_delay_mode = dav1d_get_bit(gb);
  155|      0|                }
  156|      0|            }
  157|  45.5k|            if (hdr->display_model_info_present)
  ------------------
  |  Branch (157:17): [True: 0, False: 45.5k]
  ------------------
  158|      0|                op->display_model_param_present = dav1d_get_bit(gb);
  159|  45.5k|            op->initial_display_delay =
  160|  45.5k|                op->display_model_param_present ? dav1d_get_bits(gb, 4) + 1 : 10;
  ------------------
  |  Branch (160:17): [True: 0, False: 45.5k]
  ------------------
  161|  45.5k|        }
  162|       |#if DEBUG_SEQ_HDR
  163|       |        printf("SEQHDR: post-operating-points: off=%u\n",
  164|       |               dav1d_get_bits_pos(gb) - init_bit_pos);
  165|       |#endif
  166|  11.3k|    }
  167|       |
  168|  11.3k|    hdr->width_n_bits = dav1d_get_bits(gb, 4) + 1;
  169|  11.3k|    hdr->height_n_bits = dav1d_get_bits(gb, 4) + 1;
  170|  11.3k|    hdr->max_width = dav1d_get_bits(gb, hdr->width_n_bits) + 1;
  171|  11.3k|    hdr->max_height = dav1d_get_bits(gb, hdr->height_n_bits) + 1;
  172|       |#if DEBUG_SEQ_HDR
  173|       |    printf("SEQHDR: post-size: off=%u\n",
  174|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
  175|       |#endif
  176|  11.3k|    if (!hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (176:9): [True: 11.3k, False: 0]
  ------------------
  177|  11.3k|        hdr->frame_id_numbers_present = dav1d_get_bit(gb);
  178|  11.3k|        if (hdr->frame_id_numbers_present) {
  ------------------
  |  Branch (178:13): [True: 0, False: 11.3k]
  ------------------
  179|      0|            hdr->delta_frame_id_n_bits = dav1d_get_bits(gb, 4) + 2;
  180|      0|            hdr->frame_id_n_bits = dav1d_get_bits(gb, 3) + hdr->delta_frame_id_n_bits + 1;
  181|      0|        }
  182|  11.3k|    }
  183|       |#if DEBUG_SEQ_HDR
  184|       |    printf("SEQHDR: post-frame-id-numbers-present: off=%u\n",
  185|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
  186|       |#endif
  187|       |
  188|  11.3k|    hdr->sb128 = dav1d_get_bit(gb);
  189|  11.3k|    hdr->filter_intra = dav1d_get_bit(gb);
  190|  11.3k|    hdr->intra_edge_filter = dav1d_get_bit(gb);
  191|  11.3k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (191:9): [True: 0, False: 11.3k]
  ------------------
  192|      0|        hdr->screen_content_tools = DAV1D_ADAPTIVE;
  193|      0|        hdr->force_integer_mv = DAV1D_ADAPTIVE;
  194|  11.3k|    } else {
  195|  11.3k|        hdr->inter_intra = dav1d_get_bit(gb);
  196|  11.3k|        hdr->masked_compound = dav1d_get_bit(gb);
  197|  11.3k|        hdr->warped_motion = dav1d_get_bit(gb);
  198|  11.3k|        hdr->dual_filter = dav1d_get_bit(gb);
  199|  11.3k|        hdr->order_hint = dav1d_get_bit(gb);
  200|  11.3k|        if (hdr->order_hint) {
  ------------------
  |  Branch (200:13): [True: 11.3k, False: 0]
  ------------------
  201|  11.3k|            hdr->jnt_comp = dav1d_get_bit(gb);
  202|  11.3k|            hdr->ref_frame_mvs = dav1d_get_bit(gb);
  203|  11.3k|        }
  204|  11.3k|        hdr->screen_content_tools = dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb);
  ------------------
  |  Branch (204:37): [True: 11.3k, False: 0]
  ------------------
  205|       |    #if DEBUG_SEQ_HDR
  206|       |        printf("SEQHDR: post-screentools: off=%u\n",
  207|       |               dav1d_get_bits_pos(gb) - init_bit_pos);
  208|       |    #endif
  209|  11.3k|        hdr->force_integer_mv = hdr->screen_content_tools ?
  ------------------
  |  Branch (209:33): [True: 11.3k, False: 0]
  ------------------
  210|  11.3k|                                dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb) : 2;
  ------------------
  |  Branch (210:33): [True: 11.3k, False: 0]
  ------------------
  211|  11.3k|        if (hdr->order_hint)
  ------------------
  |  Branch (211:13): [True: 11.3k, False: 0]
  ------------------
  212|  11.3k|            hdr->order_hint_n_bits = dav1d_get_bits(gb, 3) + 1;
  213|  11.3k|    }
  214|  11.3k|    hdr->super_res = dav1d_get_bit(gb);
  215|  11.3k|    hdr->cdef = dav1d_get_bit(gb);
  216|  11.3k|    hdr->restoration = dav1d_get_bit(gb);
  217|       |#if DEBUG_SEQ_HDR
  218|       |    printf("SEQHDR: post-featurebits: off=%u\n",
  219|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
  220|       |#endif
  221|       |
  222|  11.3k|    hdr->hbd = dav1d_get_bit(gb);
  223|  11.3k|    if (hdr->profile == 2 && hdr->hbd)
  ------------------
  |  Branch (223:9): [True: 2.72k, False: 8.66k]
  |  Branch (223:30): [True: 1.95k, False: 762]
  ------------------
  224|  1.95k|        hdr->hbd += dav1d_get_bit(gb);
  225|  11.3k|    if (hdr->profile != 1)
  ------------------
  |  Branch (225:9): [True: 10.6k, False: 739]
  ------------------
  226|  10.6k|        hdr->monochrome = dav1d_get_bit(gb);
  227|  11.3k|    hdr->color_description_present = dav1d_get_bit(gb);
  228|  11.3k|    if (hdr->color_description_present) {
  ------------------
  |  Branch (228:9): [True: 0, False: 11.3k]
  ------------------
  229|      0|        hdr->pri = dav1d_get_bits(gb, 8);
  230|      0|        hdr->trc = dav1d_get_bits(gb, 8);
  231|      0|        hdr->mtrx = dav1d_get_bits(gb, 8);
  232|  11.3k|    } else {
  233|  11.3k|        hdr->pri = DAV1D_COLOR_PRI_UNKNOWN;
  234|  11.3k|        hdr->trc = DAV1D_TRC_UNKNOWN;
  235|  11.3k|        hdr->mtrx = DAV1D_MC_UNKNOWN;
  236|  11.3k|    }
  237|  11.3k|    if (hdr->monochrome) {
  ------------------
  |  Branch (237:9): [True: 7.09k, False: 4.29k]
  ------------------
  238|  7.09k|        hdr->color_range = dav1d_get_bit(gb);
  239|  7.09k|        hdr->layout = DAV1D_PIXEL_LAYOUT_I400;
  240|  7.09k|        hdr->ss_hor = hdr->ss_ver = 1;
  241|  7.09k|        hdr->chr = DAV1D_CHR_UNKNOWN;
  242|  7.09k|    } else if (hdr->pri == DAV1D_COLOR_PRI_BT709 &&
  ------------------
  |  Branch (242:16): [True: 0, False: 4.29k]
  ------------------
  243|      0|               hdr->trc == DAV1D_TRC_SRGB &&
  ------------------
  |  Branch (243:16): [True: 0, False: 0]
  ------------------
  244|      0|               hdr->mtrx == DAV1D_MC_IDENTITY)
  ------------------
  |  Branch (244:16): [True: 0, False: 0]
  ------------------
  245|      0|    {
  246|      0|        hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  247|      0|        hdr->color_range = 1;
  248|      0|        if (hdr->profile != 1 && !(hdr->profile == 2 && hdr->hbd == 2))
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  |  Branch (248:36): [True: 0, False: 0]
  |  Branch (248:57): [True: 0, False: 0]
  ------------------
  249|      0|            goto error;
  250|  4.29k|    } else {
  251|  4.29k|        hdr->color_range = dav1d_get_bit(gb);
  252|  4.29k|        switch (hdr->profile) {
  ------------------
  |  Branch (252:17): [True: 4.29k, False: 0]
  ------------------
  253|  1.75k|        case 0: hdr->layout = DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (253:9): [True: 1.75k, False: 2.54k]
  ------------------
  254|  1.75k|                hdr->ss_hor = hdr->ss_ver = 1;
  255|  1.75k|                break;
  256|    739|        case 1: hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (256:9): [True: 739, False: 3.55k]
  ------------------
  257|    739|                break;
  258|  1.80k|        case 2:
  ------------------
  |  Branch (258:9): [True: 1.80k, False: 2.49k]
  ------------------
  259|  1.80k|            if (hdr->hbd == 2) {
  ------------------
  |  Branch (259:17): [True: 824, False: 983]
  ------------------
  260|    824|                hdr->ss_hor = dav1d_get_bit(gb);
  261|    824|                if (hdr->ss_hor)
  ------------------
  |  Branch (261:21): [True: 646, False: 178]
  ------------------
  262|    646|                    hdr->ss_ver = dav1d_get_bit(gb);
  263|    824|            } else
  264|    983|                hdr->ss_hor = 1;
  265|  1.80k|            hdr->layout = hdr->ss_hor ?
  ------------------
  |  Branch (265:27): [True: 1.62k, False: 178]
  ------------------
  266|  1.62k|                          hdr->ss_ver ? DAV1D_PIXEL_LAYOUT_I420 :
  ------------------
  |  Branch (266:27): [True: 460, False: 1.16k]
  ------------------
  267|  1.62k|                                        DAV1D_PIXEL_LAYOUT_I422 :
  268|  1.80k|                                        DAV1D_PIXEL_LAYOUT_I444;
  269|  1.80k|            break;
  270|  4.29k|        }
  271|  4.29k|        hdr->chr = (hdr->ss_hor & hdr->ss_ver) ?
  ------------------
  |  Branch (271:20): [True: 2.21k, False: 2.08k]
  ------------------
  272|  2.21k|                   dav1d_get_bits(gb, 2) : DAV1D_CHR_UNKNOWN;
  273|  4.29k|    }
  274|  11.3k|    if (strict_std_compliance &&
  ------------------
  |  Branch (274:9): [True: 0, False: 11.3k]
  ------------------
  275|      0|        hdr->mtrx == DAV1D_MC_IDENTITY && hdr->layout != DAV1D_PIXEL_LAYOUT_I444)
  ------------------
  |  Branch (275:9): [True: 0, False: 0]
  |  Branch (275:43): [True: 0, False: 0]
  ------------------
  276|      0|    {
  277|      0|        goto error;
  278|      0|    }
  279|  11.3k|    if (!hdr->monochrome)
  ------------------
  |  Branch (279:9): [True: 4.29k, False: 7.09k]
  ------------------
  280|  4.29k|        hdr->separate_uv_delta_q = dav1d_get_bit(gb);
  281|       |#if DEBUG_SEQ_HDR
  282|       |    printf("SEQHDR: post-colorinfo: off=%u\n",
  283|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
  284|       |#endif
  285|       |
  286|  11.3k|    hdr->film_grain_present = dav1d_get_bit(gb);
  287|       |#if DEBUG_SEQ_HDR
  288|       |    printf("SEQHDR: post-filmgrain: off=%u\n",
  289|       |           dav1d_get_bits_pos(gb) - init_bit_pos);
  290|       |#endif
  291|       |
  292|       |    // We needn't bother flushing the OBU here: we'll check we didn't
  293|       |    // overrun in the caller and will then discard gb, so there's no
  294|       |    // point in setting its position properly.
  295|       |
  296|  11.3k|    return check_trailing_bits(gb, strict_std_compliance);
  297|       |
  298|      0|error:
  299|      0|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  300|  11.3k|}
obu.c:parse_frame_hdr:
  409|  45.5k|static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) {
  410|  45.5k|#define DEBUG_FRAME_HDR 0
  411|       |
  412|       |#if DEBUG_FRAME_HDR
  413|       |    const uint8_t *const init_ptr = gb->ptr;
  414|       |#endif
  415|  45.5k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  416|  45.5k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  417|       |
  418|  45.5k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (418:9): [True: 45.5k, False: 0]
  ------------------
  419|  45.5k|        hdr->show_existing_frame = dav1d_get_bit(gb);
  420|       |#if DEBUG_FRAME_HDR
  421|       |    printf("HDR: post-show_existing_frame: off=%td\n",
  422|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  423|       |#endif
  424|  45.5k|    if (hdr->show_existing_frame) {
  ------------------
  |  Branch (424:9): [True: 0, False: 45.5k]
  ------------------
  425|      0|        hdr->existing_frame_idx = dav1d_get_bits(gb, 3);
  426|      0|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (426:13): [True: 0, False: 0]
  |  Branch (426:51): [True: 0, False: 0]
  ------------------
  427|      0|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  428|      0|        if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (428:13): [True: 0, False: 0]
  ------------------
  429|      0|            hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  430|      0|            Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->existing_frame_idx].p.p.frame_hdr;
  431|      0|            if (!ref_frame_hdr || ref_frame_hdr->frame_id != hdr->frame_id) goto error;
  ------------------
  |  Branch (431:17): [True: 0, False: 0]
  |  Branch (431:35): [True: 0, False: 0]
  ------------------
  432|      0|        }
  433|      0|        return 0;
  434|      0|    }
  435|       |
  436|  45.5k|    if (seqhdr->reduced_still_picture_header) {
  ------------------
  |  Branch (436:9): [True: 0, False: 45.5k]
  ------------------
  437|      0|        hdr->frame_type = DAV1D_FRAME_TYPE_KEY;
  438|      0|        hdr->show_frame = 1;
  439|  45.5k|    } else {
  440|  45.5k|        hdr->frame_type = dav1d_get_bits(gb, 2);
  441|  45.5k|        hdr->show_frame = dav1d_get_bit(gb);
  442|  45.5k|    }
  443|  45.5k|    if (hdr->show_frame) {
  ------------------
  |  Branch (443:9): [True: 45.5k, False: 0]
  ------------------
  444|  45.5k|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (444:13): [True: 0, False: 45.5k]
  |  Branch (444:51): [True: 0, False: 0]
  ------------------
  445|      0|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  446|  45.5k|        hdr->showable_frame = hdr->frame_type != DAV1D_FRAME_TYPE_KEY;
  447|  45.5k|    } else
  448|      0|        hdr->showable_frame = dav1d_get_bit(gb);
  449|  45.5k|    hdr->error_resilient_mode =
  450|  45.5k|        (hdr->frame_type == DAV1D_FRAME_TYPE_KEY && hdr->show_frame) ||
  ------------------
  |  Branch (450:10): [True: 11.3k, False: 34.1k]
  |  Branch (450:53): [True: 11.3k, False: 0]
  ------------------
  451|  34.1k|        hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ||
  ------------------
  |  Branch (451:9): [True: 0, False: 34.1k]
  ------------------
  452|  34.1k|        seqhdr->reduced_still_picture_header || dav1d_get_bit(gb);
  ------------------
  |  Branch (452:9): [True: 0, False: 34.1k]
  |  Branch (452:49): [True: 0, False: 34.1k]
  ------------------
  453|       |#if DEBUG_FRAME_HDR
  454|       |    printf("HDR: post-frametype_bits: off=%td\n",
  455|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  456|       |#endif
  457|  45.5k|    hdr->disable_cdf_update = dav1d_get_bit(gb);
  458|  45.5k|    hdr->allow_screen_content_tools = seqhdr->screen_content_tools == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (458:39): [True: 45.5k, False: 0]
  ------------------
  459|  45.5k|                                      dav1d_get_bit(gb) : seqhdr->screen_content_tools;
  460|  45.5k|    if (hdr->allow_screen_content_tools)
  ------------------
  |  Branch (460:9): [True: 4.90k, False: 40.6k]
  ------------------
  461|  4.90k|        hdr->force_integer_mv = seqhdr->force_integer_mv == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (461:33): [True: 4.90k, False: 0]
  ------------------
  462|  4.90k|                                dav1d_get_bit(gb) : seqhdr->force_integer_mv;
  463|       |
  464|  45.5k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|  45.5k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 11.3k, False: 34.1k]
  |  |  ------------------
  ------------------
  465|  11.3k|        hdr->force_integer_mv = 1;
  466|       |
  467|  45.5k|    if (seqhdr->frame_id_numbers_present)
  ------------------
  |  Branch (467:9): [True: 0, False: 45.5k]
  ------------------
  468|      0|        hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  469|       |
  470|  45.5k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (470:9): [True: 45.5k, False: 0]
  ------------------
  471|  45.5k|        hdr->frame_size_override = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 1 : dav1d_get_bit(gb);
  ------------------
  |  Branch (471:36): [True: 0, False: 45.5k]
  ------------------
  472|       |#if DEBUG_FRAME_HDR
  473|       |    printf("HDR: post-frame_size_override_flag: off=%td\n",
  474|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  475|       |#endif
  476|  45.5k|    if (seqhdr->order_hint)
  ------------------
  |  Branch (476:9): [True: 45.5k, False: 0]
  ------------------
  477|  45.5k|        hdr->frame_offset = dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  478|  45.5k|    hdr->primary_ref_frame = !hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) ?
  ------------------
  |  |   36|  34.1k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (478:30): [True: 34.1k, False: 11.3k]
  ------------------
  479|  34.1k|                             dav1d_get_bits(gb, 3) : DAV1D_PRIMARY_REF_NONE;
  ------------------
  |  |   45|  56.9k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  480|       |
  481|  45.5k|    if (seqhdr->decoder_model_info_present) {
  ------------------
  |  Branch (481:9): [True: 0, False: 45.5k]
  ------------------
  482|      0|        hdr->buffer_removal_time_present = dav1d_get_bit(gb);
  483|      0|        if (hdr->buffer_removal_time_present) {
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            for (int i = 0; i < c->seq_hdr->num_operating_points; i++) {
  ------------------
  |  Branch (484:29): [True: 0, False: 0]
  ------------------
  485|      0|                const struct Dav1dSequenceHeaderOperatingPoint *const seqop = &seqhdr->operating_points[i];
  486|      0|                struct Dav1dFrameHeaderOperatingPoint *const op = &hdr->operating_points[i];
  487|      0|                if (seqop->decoder_model_param_present) {
  ------------------
  |  Branch (487:21): [True: 0, False: 0]
  ------------------
  488|      0|                    int in_temporal_layer = (seqop->idc >> hdr->temporal_id) & 1;
  489|      0|                    int in_spatial_layer  = (seqop->idc >> (hdr->spatial_id + 8)) & 1;
  490|      0|                    if (!seqop->idc || (in_temporal_layer && in_spatial_layer))
  ------------------
  |  Branch (490:25): [True: 0, False: 0]
  |  Branch (490:41): [True: 0, False: 0]
  |  Branch (490:62): [True: 0, False: 0]
  ------------------
  491|      0|                        op->buffer_removal_time = dav1d_get_bits(gb, seqhdr->buffer_removal_delay_length);
  492|      0|                }
  493|      0|            }
  494|      0|        }
  495|      0|    }
  496|       |
  497|  45.5k|    if (IS_KEY_OR_INTRA(hdr)) {
  ------------------
  |  |   43|  45.5k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 11.3k, False: 34.1k]
  |  |  ------------------
  ------------------
  498|  11.3k|        hdr->refresh_frame_flags = (hdr->frame_type == DAV1D_FRAME_TYPE_KEY &&
  ------------------
  |  Branch (498:37): [True: 11.3k, False: 0]
  ------------------
  499|  11.3k|                                    hdr->show_frame) ? 0xff : dav1d_get_bits(gb, 8);
  ------------------
  |  Branch (499:37): [True: 11.3k, False: 0]
  ------------------
  500|  11.3k|        if (hdr->refresh_frame_flags != 0xff && hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (500:13): [True: 0, False: 11.3k]
  |  Branch (500:49): [True: 0, False: 0]
  |  Branch (500:78): [True: 0, False: 0]
  ------------------
  501|      0|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (501:29): [True: 0, False: 0]
  ------------------
  502|      0|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  503|  11.3k|        if (c->strict_std_compliance &&
  ------------------
  |  Branch (503:13): [True: 0, False: 11.3k]
  ------------------
  504|      0|            hdr->frame_type == DAV1D_FRAME_TYPE_INTRA && hdr->refresh_frame_flags == 0xff)
  ------------------
  |  Branch (504:13): [True: 0, False: 0]
  |  Branch (504:58): [True: 0, False: 0]
  ------------------
  505|      0|        {
  506|      0|            goto error;
  507|      0|        }
  508|  11.3k|        if (read_frame_size(c, gb, 0) < 0) goto error;
  ------------------
  |  Branch (508:13): [True: 0, False: 11.3k]
  ------------------
  509|  11.3k|        if (hdr->allow_screen_content_tools && !hdr->super_res.enabled)
  ------------------
  |  Branch (509:13): [True: 1.22k, False: 10.1k]
  |  Branch (509:48): [True: 1.22k, False: 0]
  ------------------
  510|  1.22k|            hdr->allow_intrabc = dav1d_get_bit(gb);
  511|  34.1k|    } else {
  512|  34.1k|        hdr->refresh_frame_flags = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 0xff :
  ------------------
  |  Branch (512:36): [True: 0, False: 34.1k]
  ------------------
  513|  34.1k|                                   dav1d_get_bits(gb, 8);
  514|  34.1k|        if (hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (514:13): [True: 0, False: 34.1k]
  |  Branch (514:42): [True: 0, False: 0]
  ------------------
  515|      0|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (515:29): [True: 0, False: 0]
  ------------------
  516|      0|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  517|  34.1k|        if (seqhdr->order_hint) {
  ------------------
  |  Branch (517:13): [True: 34.1k, False: 0]
  ------------------
  518|  34.1k|            hdr->frame_ref_short_signaling = dav1d_get_bit(gb);
  519|  34.1k|            if (hdr->frame_ref_short_signaling) {
  ------------------
  |  Branch (519:17): [True: 0, False: 34.1k]
  ------------------
  520|      0|                hdr->refidx[0] = dav1d_get_bits(gb, 3);
  521|      0|                hdr->refidx[1] = hdr->refidx[2] = -1;
  522|      0|                hdr->refidx[3] = dav1d_get_bits(gb, 3);
  523|       |
  524|       |                /* +1 allows for unconditional stores, as unused
  525|       |                 * values can be dumped into frame_offset[-1]. */
  526|      0|                int frame_offset_mem[8+1];
  527|      0|                int *const frame_offset = &frame_offset_mem[1];
  528|      0|                int earliest_ref = -1;
  529|      0|                for (int i = 0, earliest_offset = INT_MAX; i < 8; i++) {
  ------------------
  |  Branch (529:60): [True: 0, False: 0]
  ------------------
  530|      0|                    const Dav1dFrameHeader *const refhdr = c->refs[i].p.p.frame_hdr;
  531|      0|                    if (!refhdr) goto error;
  ------------------
  |  Branch (531:25): [True: 0, False: 0]
  ------------------
  532|      0|                    const int diff = get_poc_diff(seqhdr->order_hint_n_bits,
  533|      0|                                                  refhdr->frame_offset,
  534|      0|                                                  hdr->frame_offset);
  535|      0|                    frame_offset[i] = diff;
  536|      0|                    if (diff < earliest_offset) {
  ------------------
  |  Branch (536:25): [True: 0, False: 0]
  ------------------
  537|      0|                        earliest_offset = diff;
  538|      0|                        earliest_ref = i;
  539|      0|                    }
  540|      0|                }
  541|      0|                frame_offset[hdr->refidx[0]] = INT_MIN; // = reference frame is used
  542|      0|                frame_offset[hdr->refidx[3]] = INT_MIN;
  543|      0|                assert(earliest_ref >= 0);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  544|       |
  545|      0|                int refidx = -1;
  546|      0|                for (int i = 0, latest_offset = 0; i < 8; i++) {
  ------------------
  |  Branch (546:52): [True: 0, False: 0]
  ------------------
  547|      0|                    const int hint = frame_offset[i];
  548|      0|                    if (hint >= latest_offset) {
  ------------------
  |  Branch (548:25): [True: 0, False: 0]
  ------------------
  549|      0|                        latest_offset = hint;
  550|      0|                        refidx = i;
  551|      0|                    }
  552|      0|                }
  553|      0|                frame_offset[refidx] = INT_MIN;
  554|      0|                hdr->refidx[6] = refidx;
  555|       |
  556|      0|                for (int i = 4; i < 6; i++) {
  ------------------
  |  Branch (556:33): [True: 0, False: 0]
  ------------------
  557|       |                    /* Unsigned compares to handle negative values. */
  558|      0|                    unsigned earliest_offset = UINT8_MAX;
  559|      0|                    refidx = -1;
  560|      0|                    for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (560:37): [True: 0, False: 0]
  ------------------
  561|      0|                        const unsigned hint = frame_offset[j];
  562|      0|                        if (hint < earliest_offset) {
  ------------------
  |  Branch (562:29): [True: 0, False: 0]
  ------------------
  563|      0|                            earliest_offset = hint;
  564|      0|                            refidx = j;
  565|      0|                        }
  566|      0|                    }
  567|      0|                    frame_offset[refidx] = INT_MIN;
  568|      0|                    hdr->refidx[i] = refidx;
  569|      0|                }
  570|       |
  571|      0|                for (int i = 1; i < 7; i++) {
  ------------------
  |  Branch (571:33): [True: 0, False: 0]
  ------------------
  572|      0|                    refidx = hdr->refidx[i];
  573|      0|                    if (refidx < 0) {
  ------------------
  |  Branch (573:25): [True: 0, False: 0]
  ------------------
  574|      0|                        unsigned latest_offset = ~UINT8_MAX;
  575|      0|                        for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (575:41): [True: 0, False: 0]
  ------------------
  576|      0|                            const unsigned hint = frame_offset[j];
  577|      0|                            if (hint >= latest_offset) {
  ------------------
  |  Branch (577:33): [True: 0, False: 0]
  ------------------
  578|      0|                                latest_offset = hint;
  579|      0|                                refidx = j;
  580|      0|                            }
  581|      0|                        }
  582|      0|                        frame_offset[refidx] = INT_MIN;
  583|      0|                        hdr->refidx[i] = refidx >= 0 ? refidx : earliest_ref;
  ------------------
  |  Branch (583:42): [True: 0, False: 0]
  ------------------
  584|      0|                    }
  585|      0|                }
  586|      0|            }
  587|  34.1k|        }
  588|   273k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (588:25): [True: 239k, False: 34.1k]
  ------------------
  589|   239k|            if (!hdr->frame_ref_short_signaling)
  ------------------
  |  Branch (589:17): [True: 239k, False: 0]
  ------------------
  590|   239k|                hdr->refidx[i] = dav1d_get_bits(gb, 3);
  591|   239k|            if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (591:17): [True: 0, False: 239k]
  ------------------
  592|      0|                const unsigned delta_ref_frame_id = dav1d_get_bits(gb, seqhdr->delta_frame_id_n_bits) + 1;
  593|      0|                const unsigned ref_frame_id = (hdr->frame_id + (1 << seqhdr->frame_id_n_bits) - delta_ref_frame_id) & ((1 << seqhdr->frame_id_n_bits) - 1);
  594|      0|                Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->refidx[i]].p.p.frame_hdr;
  595|      0|                if (!ref_frame_hdr || ref_frame_hdr->frame_id != ref_frame_id) goto error;
  ------------------
  |  Branch (595:21): [True: 0, False: 0]
  |  Branch (595:39): [True: 0, False: 0]
  ------------------
  596|      0|            }
  597|   239k|        }
  598|  34.1k|        const int use_ref = !hdr->error_resilient_mode &&
  ------------------
  |  Branch (598:29): [True: 34.1k, False: 0]
  ------------------
  599|  34.1k|                            hdr->frame_size_override;
  ------------------
  |  Branch (599:29): [True: 22.7k, False: 11.3k]
  ------------------
  600|  34.1k|        if (read_frame_size(c, gb, use_ref) < 0) goto error;
  ------------------
  |  Branch (600:13): [True: 0, False: 34.1k]
  ------------------
  601|  34.1k|        if (!hdr->force_integer_mv)
  ------------------
  |  Branch (601:13): [True: 34.1k, False: 0]
  ------------------
  602|  34.1k|            hdr->hp = dav1d_get_bit(gb);
  603|  34.1k|        hdr->subpel_filter_mode = dav1d_get_bit(gb) ? DAV1D_FILTER_SWITCHABLE :
  ------------------
  |  Branch (603:35): [True: 18.1k, False: 15.9k]
  ------------------
  604|  34.1k|                                                      dav1d_get_bits(gb, 2);
  605|  34.1k|        hdr->switchable_motion_mode = dav1d_get_bit(gb);
  606|  34.1k|        if (!hdr->error_resilient_mode && seqhdr->ref_frame_mvs &&
  ------------------
  |  Branch (606:13): [True: 34.1k, False: 0]
  |  Branch (606:43): [True: 34.1k, False: 0]
  ------------------
  607|  34.1k|            seqhdr->order_hint && IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|  34.1k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (607:13): [True: 34.1k, False: 0]
  ------------------
  608|  34.1k|        {
  609|  34.1k|            hdr->use_ref_frame_mvs = dav1d_get_bit(gb);
  610|  34.1k|        }
  611|  34.1k|    }
  612|       |#if DEBUG_FRAME_HDR
  613|       |    printf("HDR: post-frametype-specific-bits: off=%td\n",
  614|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  615|       |#endif
  616|       |
  617|  45.5k|    if (!seqhdr->reduced_still_picture_header && !hdr->disable_cdf_update)
  ------------------
  |  Branch (617:9): [True: 45.5k, False: 0]
  |  Branch (617:50): [True: 45.5k, False: 0]
  ------------------
  618|  45.5k|        hdr->refresh_context = !dav1d_get_bit(gb);
  619|       |#if DEBUG_FRAME_HDR
  620|       |    printf("HDR: post-refresh_context: off=%td\n",
  621|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  622|       |#endif
  623|       |
  624|       |    // tile data
  625|  45.5k|    hdr->tiling.uniform = dav1d_get_bit(gb);
  626|  45.5k|    const int sbsz_min1 = (64 << seqhdr->sb128) - 1;
  627|  45.5k|    const int sbsz_log2 = 6 + seqhdr->sb128;
  628|  45.5k|    const int sbw = (hdr->width[0] + sbsz_min1) >> sbsz_log2;
  629|  45.5k|    const int sbh = (hdr->height + sbsz_min1) >> sbsz_log2;
  630|  45.5k|    const int max_tile_width_sb = 4096 >> sbsz_log2;
  631|  45.5k|    const int max_tile_area_sb = 4096 * 2304 >> (2 * sbsz_log2);
  632|  45.5k|    hdr->tiling.min_log2_cols = tile_log2(max_tile_width_sb, sbw);
  633|  45.5k|    hdr->tiling.max_log2_cols = tile_log2(1, imin(sbw, DAV1D_MAX_TILE_COLS));
  ------------------
  |  |   41|  45.5k|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  634|  45.5k|    hdr->tiling.max_log2_rows = tile_log2(1, imin(sbh, DAV1D_MAX_TILE_ROWS));
  ------------------
  |  |   42|  45.5k|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  635|  45.5k|    const int min_log2_tiles = imax(tile_log2(max_tile_area_sb, sbw * sbh),
  636|  45.5k|                              hdr->tiling.min_log2_cols);
  637|  45.5k|    if (hdr->tiling.uniform) {
  ------------------
  |  Branch (637:9): [True: 45.5k, False: 0]
  ------------------
  638|  45.5k|        for (hdr->tiling.log2_cols = hdr->tiling.min_log2_cols;
  639|  54.8k|             hdr->tiling.log2_cols < hdr->tiling.max_log2_cols && dav1d_get_bit(gb);
  ------------------
  |  Branch (639:14): [True: 11.8k, False: 42.9k]
  |  Branch (639:67): [True: 9.27k, False: 2.56k]
  ------------------
  640|  45.5k|             hdr->tiling.log2_cols++) ;
  641|  45.5k|        const int tile_w = 1 + ((sbw - 1) >> hdr->tiling.log2_cols);
  642|  45.5k|        hdr->tiling.cols = 0;
  643|   101k|        for (int sbx = 0; sbx < sbw; sbx += tile_w, hdr->tiling.cols++)
  ------------------
  |  Branch (643:27): [True: 55.8k, False: 45.5k]
  ------------------
  644|  55.8k|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  645|  45.5k|        hdr->tiling.min_log2_rows =
  646|  45.5k|            imax(min_log2_tiles - hdr->tiling.log2_cols, 0);
  647|       |
  648|  45.5k|        for (hdr->tiling.log2_rows = hdr->tiling.min_log2_rows;
  649|  55.3k|             hdr->tiling.log2_rows < hdr->tiling.max_log2_rows && dav1d_get_bit(gb);
  ------------------
  |  Branch (649:14): [True: 12.1k, False: 43.2k]
  |  Branch (649:67): [True: 9.80k, False: 2.33k]
  ------------------
  650|  45.5k|             hdr->tiling.log2_rows++) ;
  651|  45.5k|        const int tile_h = 1 + ((sbh - 1) >> hdr->tiling.log2_rows);
  652|  45.5k|        hdr->tiling.rows = 0;
  653|   101k|        for (int sby = 0; sby < sbh; sby += tile_h, hdr->tiling.rows++)
  ------------------
  |  Branch (653:27): [True: 56.4k, False: 45.5k]
  ------------------
  654|  56.4k|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  655|  45.5k|    } else {
  656|      0|        hdr->tiling.cols = 0;
  657|      0|        int widest_tile = 0, max_tile_area_sb = sbw * sbh;
  658|      0|        for (int sbx = 0; sbx < sbw && hdr->tiling.cols < DAV1D_MAX_TILE_COLS; hdr->tiling.cols++) {
  ------------------
  |  |   41|      0|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  |  Branch (658:27): [True: 0, False: 0]
  |  Branch (658:40): [True: 0, False: 0]
  ------------------
  659|      0|            const int tile_width_sb = imin(sbw - sbx, max_tile_width_sb);
  660|      0|            const int tile_w = (tile_width_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_width_sb) : 1;
  ------------------
  |  Branch (660:32): [True: 0, False: 0]
  ------------------
  661|      0|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  662|      0|            sbx += tile_w;
  663|      0|            widest_tile = imax(widest_tile, tile_w);
  664|      0|        }
  665|      0|        hdr->tiling.log2_cols = tile_log2(1, hdr->tiling.cols);
  666|      0|        if (min_log2_tiles) max_tile_area_sb >>= min_log2_tiles + 1;
  ------------------
  |  Branch (666:13): [True: 0, False: 0]
  ------------------
  667|      0|        const int max_tile_height_sb = imax(max_tile_area_sb / widest_tile, 1);
  668|       |
  669|      0|        hdr->tiling.rows = 0;
  670|      0|        for (int sby = 0; sby < sbh && hdr->tiling.rows < DAV1D_MAX_TILE_ROWS; hdr->tiling.rows++) {
  ------------------
  |  |   42|      0|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  |  Branch (670:27): [True: 0, False: 0]
  |  Branch (670:40): [True: 0, False: 0]
  ------------------
  671|      0|            const int tile_height_sb = imin(sbh - sby, max_tile_height_sb);
  672|      0|            const int tile_h = (tile_height_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_height_sb) : 1;
  ------------------
  |  Branch (672:32): [True: 0, False: 0]
  ------------------
  673|      0|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  674|      0|            sby += tile_h;
  675|      0|        }
  676|      0|        hdr->tiling.log2_rows = tile_log2(1, hdr->tiling.rows);
  677|      0|    }
  678|  45.5k|    hdr->tiling.col_start_sb[hdr->tiling.cols] = sbw;
  679|  45.5k|    hdr->tiling.row_start_sb[hdr->tiling.rows] = sbh;
  680|  45.5k|    if (hdr->tiling.log2_cols || hdr->tiling.log2_rows) {
  ------------------
  |  Branch (680:9): [True: 6.53k, False: 39.0k]
  |  Branch (680:34): [True: 4.92k, False: 34.0k]
  ------------------
  681|  11.4k|        hdr->tiling.update = dav1d_get_bits(gb, hdr->tiling.log2_cols + hdr->tiling.log2_rows);
  682|  11.4k|        if (hdr->tiling.update >= hdr->tiling.cols * hdr->tiling.rows)
  ------------------
  |  Branch (682:13): [True: 0, False: 11.4k]
  ------------------
  683|      0|            goto error;
  684|  11.4k|        hdr->tiling.n_bytes = dav1d_get_bits(gb, 2) + 1;
  685|  11.4k|    }
  686|       |#if DEBUG_FRAME_HDR
  687|       |    printf("HDR: post-tiling: off=%td\n",
  688|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  689|       |#endif
  690|       |
  691|       |    // quant data
  692|  45.5k|    hdr->quant.yac = dav1d_get_bits(gb, 8);
  693|  45.5k|    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (693:9): [True: 0, False: 45.5k]
  ------------------
  694|      0|        hdr->quant.ydc_delta = dav1d_get_sbits(gb, 7);
  695|  45.5k|    if (!seqhdr->monochrome) {
  ------------------
  |  Branch (695:9): [True: 17.1k, False: 28.3k]
  ------------------
  696|       |        // If the sequence header says that delta_q might be different
  697|       |        // for U, V, we must check whether it actually is for this
  698|       |        // frame.
  699|  17.1k|        const int diff_uv_delta = seqhdr->separate_uv_delta_q ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (699:35): [True: 0, False: 17.1k]
  ------------------
  700|  17.1k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (700:13): [True: 7.36k, False: 9.82k]
  ------------------
  701|  7.36k|            hdr->quant.udc_delta = dav1d_get_sbits(gb, 7);
  702|  17.1k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (702:13): [True: 15.2k, False: 1.94k]
  ------------------
  703|  15.2k|            hdr->quant.uac_delta = dav1d_get_sbits(gb, 7);
  704|  17.1k|        if (diff_uv_delta) {
  ------------------
  |  Branch (704:13): [True: 0, False: 17.1k]
  ------------------
  705|      0|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (705:17): [True: 0, False: 0]
  ------------------
  706|      0|                hdr->quant.vdc_delta = dav1d_get_sbits(gb, 7);
  707|      0|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (707:17): [True: 0, False: 0]
  ------------------
  708|      0|                hdr->quant.vac_delta = dav1d_get_sbits(gb, 7);
  709|  17.1k|        } else {
  710|  17.1k|            hdr->quant.vdc_delta = hdr->quant.udc_delta;
  711|  17.1k|            hdr->quant.vac_delta = hdr->quant.uac_delta;
  712|  17.1k|        }
  713|  17.1k|    }
  714|       |#if DEBUG_FRAME_HDR
  715|       |    printf("HDR: post-quant: off=%td\n",
  716|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  717|       |#endif
  718|  45.5k|    hdr->quant.qm = dav1d_get_bit(gb);
  719|  45.5k|    if (hdr->quant.qm) {
  ------------------
  |  Branch (719:9): [True: 32.3k, False: 13.1k]
  ------------------
  720|  32.3k|        hdr->quant.qm_y = dav1d_get_bits(gb, 4);
  721|  32.3k|        hdr->quant.qm_u = dav1d_get_bits(gb, 4);
  722|  32.3k|        hdr->quant.qm_v = seqhdr->separate_uv_delta_q ? dav1d_get_bits(gb, 4) :
  ------------------
  |  Branch (722:27): [True: 0, False: 32.3k]
  ------------------
  723|  32.3k|                                                        hdr->quant.qm_u;
  724|  32.3k|    }
  725|       |#if DEBUG_FRAME_HDR
  726|       |    printf("HDR: post-qm: off=%td\n",
  727|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  728|       |#endif
  729|       |
  730|       |    // segmentation data
  731|  45.5k|    hdr->segmentation.enabled = dav1d_get_bit(gb);
  732|  45.5k|    if (hdr->segmentation.enabled) {
  ------------------
  |  Branch (732:9): [True: 0, False: 45.5k]
  ------------------
  733|      0|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|      0|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (733:13): [True: 0, False: 0]
  ------------------
  734|      0|            hdr->segmentation.update_map = 1;
  735|      0|            hdr->segmentation.update_data = 1;
  736|      0|        } else {
  737|      0|            hdr->segmentation.update_map = dav1d_get_bit(gb);
  738|      0|            if (hdr->segmentation.update_map)
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|      0|                hdr->segmentation.temporal = dav1d_get_bit(gb);
  740|      0|            hdr->segmentation.update_data = dav1d_get_bit(gb);
  741|      0|        }
  742|       |
  743|      0|        if (hdr->segmentation.update_data) {
  ------------------
  |  Branch (743:13): [True: 0, False: 0]
  ------------------
  744|      0|            hdr->segmentation.seg_data.last_active_segid = -1;
  745|      0|            for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|      0|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (745:29): [True: 0, False: 0]
  ------------------
  746|      0|                Dav1dSegmentationData *const seg =
  747|      0|                    &hdr->segmentation.seg_data.d[i];
  748|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (748:21): [True: 0, False: 0]
  ------------------
  749|      0|                    seg->delta_q = dav1d_get_sbits(gb, 9);
  750|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  751|      0|                }
  752|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (752:21): [True: 0, False: 0]
  ------------------
  753|      0|                    seg->delta_lf_y_v = dav1d_get_sbits(gb, 7);
  754|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  755|      0|                }
  756|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (756:21): [True: 0, False: 0]
  ------------------
  757|      0|                    seg->delta_lf_y_h = dav1d_get_sbits(gb, 7);
  758|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  759|      0|                }
  760|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (760:21): [True: 0, False: 0]
  ------------------
  761|      0|                    seg->delta_lf_u = dav1d_get_sbits(gb, 7);
  762|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  763|      0|                }
  764|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (764:21): [True: 0, False: 0]
  ------------------
  765|      0|                    seg->delta_lf_v = dav1d_get_sbits(gb, 7);
  766|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  767|      0|                }
  768|      0|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (768:21): [True: 0, False: 0]
  ------------------
  769|      0|                    seg->ref = dav1d_get_bits(gb, 3);
  770|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  771|      0|                    hdr->segmentation.seg_data.preskip = 1;
  772|      0|                } else {
  773|      0|                    seg->ref = -1;
  774|      0|                }
  775|      0|                if ((seg->skip = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (775:21): [True: 0, False: 0]
  ------------------
  776|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  777|      0|                    hdr->segmentation.seg_data.preskip = 1;
  778|      0|                }
  779|      0|                if ((seg->globalmv = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (779:21): [True: 0, False: 0]
  ------------------
  780|      0|                    hdr->segmentation.seg_data.last_active_segid = i;
  781|      0|                    hdr->segmentation.seg_data.preskip = 1;
  782|      0|                }
  783|      0|            }
  784|      0|        } else {
  785|       |            // segmentation.update_data was false so we should copy
  786|       |            // segmentation data from the reference frame.
  787|      0|            assert(hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  788|      0|            const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
  789|      0|            if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (789:17): [True: 0, False: 0]
  ------------------
  790|      0|            hdr->segmentation.seg_data =
  791|      0|                c->refs[pri_ref].p.p.frame_hdr->segmentation.seg_data;
  792|      0|        }
  793|  45.5k|    } else {
  794|   409k|        for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++)
  ------------------
  |  |   43|   409k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (794:25): [True: 364k, False: 45.5k]
  ------------------
  795|   364k|            hdr->segmentation.seg_data.d[i].ref = -1;
  796|  45.5k|    }
  797|       |#if DEBUG_FRAME_HDR
  798|       |    printf("HDR: post-segmentation: off=%td\n",
  799|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  800|       |#endif
  801|       |
  802|       |    // delta q
  803|  45.5k|    if (hdr->quant.yac) {
  ------------------
  |  Branch (803:9): [True: 43.4k, False: 2.13k]
  ------------------
  804|  43.4k|        hdr->delta.q.present = dav1d_get_bit(gb);
  805|  43.4k|        if (hdr->delta.q.present) {
  ------------------
  |  Branch (805:13): [True: 19.2k, False: 24.1k]
  ------------------
  806|  19.2k|            hdr->delta.q.res_log2 = dav1d_get_bits(gb, 2);
  807|  19.2k|            if (!hdr->allow_intrabc) {
  ------------------
  |  Branch (807:17): [True: 19.2k, False: 0]
  ------------------
  808|  19.2k|                hdr->delta.lf.present = dav1d_get_bit(gb);
  809|  19.2k|                if (hdr->delta.lf.present) {
  ------------------
  |  Branch (809:21): [True: 0, False: 19.2k]
  ------------------
  810|      0|                    hdr->delta.lf.res_log2 = dav1d_get_bits(gb, 2);
  811|      0|                    hdr->delta.lf.multi = dav1d_get_bit(gb);
  812|      0|                }
  813|  19.2k|            }
  814|  19.2k|        }
  815|  43.4k|    }
  816|       |#if DEBUG_FRAME_HDR
  817|       |    printf("HDR: post-delta_q_lf_flags: off=%td\n",
  818|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  819|       |#endif
  820|       |
  821|       |    // derive lossless flags
  822|  45.5k|    const int delta_lossless = !hdr->quant.ydc_delta && !hdr->quant.udc_delta &&
  ------------------
  |  Branch (822:32): [True: 45.5k, False: 0]
  |  Branch (822:57): [True: 38.1k, False: 7.36k]
  ------------------
  823|  38.1k|        !hdr->quant.uac_delta && !hdr->quant.vdc_delta && !hdr->quant.vac_delta;
  ------------------
  |  Branch (823:9): [True: 30.3k, False: 7.88k]
  |  Branch (823:34): [True: 30.3k, False: 0]
  |  Branch (823:59): [True: 30.3k, False: 0]
  ------------------
  824|  45.5k|    hdr->all_lossless = 1;
  825|   409k|    for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|   409k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (825:21): [True: 364k, False: 45.5k]
  ------------------
  826|   364k|        hdr->segmentation.qidx[i] = hdr->segmentation.enabled ?
  ------------------
  |  Branch (826:37): [True: 0, False: 364k]
  ------------------
  827|      0|            iclip_u8(hdr->quant.yac + hdr->segmentation.seg_data.d[i].delta_q) :
  828|   364k|            hdr->quant.yac;
  829|   364k|        hdr->segmentation.lossless[i] =
  830|   364k|            !hdr->segmentation.qidx[i] && delta_lossless;
  ------------------
  |  Branch (830:13): [True: 17.0k, False: 347k]
  |  Branch (830:43): [True: 17.0k, False: 0]
  ------------------
  831|   364k|        hdr->all_lossless &= hdr->segmentation.lossless[i];
  832|   364k|    }
  833|       |
  834|       |    // loopfilter
  835|  45.5k|    if (hdr->all_lossless || hdr->allow_intrabc) {
  ------------------
  |  Branch (835:9): [True: 2.13k, False: 43.4k]
  |  Branch (835:30): [True: 0, False: 43.4k]
  ------------------
  836|  2.13k|        hdr->loopfilter.mode_ref_delta_enabled = 1;
  837|  2.13k|        hdr->loopfilter.mode_ref_delta_update = 1;
  838|  2.13k|        hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  839|  43.4k|    } else {
  840|  43.4k|        hdr->loopfilter.level_y[0] = dav1d_get_bits(gb, 6);
  841|  43.4k|        hdr->loopfilter.level_y[1] = dav1d_get_bits(gb, 6);
  842|  43.4k|        if (!seqhdr->monochrome &&
  ------------------
  |  Branch (842:13): [True: 16.2k, False: 27.1k]
  ------------------
  843|  16.2k|            (hdr->loopfilter.level_y[0] || hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (843:14): [True: 6.19k, False: 10.1k]
  |  Branch (843:44): [True: 0, False: 10.1k]
  ------------------
  844|  6.19k|        {
  845|  6.19k|            hdr->loopfilter.level_u = dav1d_get_bits(gb, 6);
  846|  6.19k|            hdr->loopfilter.level_v = dav1d_get_bits(gb, 6);
  847|  6.19k|        }
  848|  43.4k|        hdr->loopfilter.sharpness = dav1d_get_bits(gb, 3);
  849|       |
  850|  43.4k|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  43.4k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (850:13): [True: 25.4k, False: 18.0k]
  ------------------
  851|  25.4k|            hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  852|  25.4k|        } else {
  853|  18.0k|            const int ref = hdr->refidx[hdr->primary_ref_frame];
  854|  18.0k|            if (!c->refs[ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (854:17): [True: 0, False: 18.0k]
  ------------------
  855|  18.0k|            hdr->loopfilter.mode_ref_deltas =
  856|  18.0k|                c->refs[ref].p.p.frame_hdr->loopfilter.mode_ref_deltas;
  857|  18.0k|        }
  858|  43.4k|        hdr->loopfilter.mode_ref_delta_enabled = dav1d_get_bit(gb);
  859|  43.4k|        if (hdr->loopfilter.mode_ref_delta_enabled) {
  ------------------
  |  Branch (859:13): [True: 43.4k, False: 0]
  ------------------
  860|  43.4k|            hdr->loopfilter.mode_ref_delta_update = dav1d_get_bit(gb);
  861|  43.4k|            if (hdr->loopfilter.mode_ref_delta_update) {
  ------------------
  |  Branch (861:17): [True: 0, False: 43.4k]
  ------------------
  862|      0|                for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (862:33): [True: 0, False: 0]
  ------------------
  863|      0|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (863:25): [True: 0, False: 0]
  ------------------
  864|      0|                        hdr->loopfilter.mode_ref_deltas.ref_delta[i] =
  865|      0|                            dav1d_get_sbits(gb, 7);
  866|      0|                for (int i = 0; i < 2; i++)
  ------------------
  |  Branch (866:33): [True: 0, False: 0]
  ------------------
  867|      0|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (867:25): [True: 0, False: 0]
  ------------------
  868|      0|                        hdr->loopfilter.mode_ref_deltas.mode_delta[i] =
  869|      0|                            dav1d_get_sbits(gb, 7);
  870|      0|            }
  871|  43.4k|        }
  872|  43.4k|    }
  873|       |#if DEBUG_FRAME_HDR
  874|       |    printf("HDR: post-lpf: off=%td\n",
  875|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  876|       |#endif
  877|       |
  878|       |    // cdef
  879|  45.5k|    if (!hdr->all_lossless && seqhdr->cdef && !hdr->allow_intrabc) {
  ------------------
  |  Branch (879:9): [True: 43.4k, False: 2.13k]
  |  Branch (879:31): [True: 43.4k, False: 0]
  |  Branch (879:47): [True: 43.4k, False: 0]
  ------------------
  880|  43.4k|        hdr->cdef.damping = dav1d_get_bits(gb, 2) + 3;
  881|  43.4k|        hdr->cdef.n_bits = dav1d_get_bits(gb, 2);
  882|  93.1k|        for (int i = 0; i < (1 << hdr->cdef.n_bits); i++) {
  ------------------
  |  Branch (882:25): [True: 49.7k, False: 43.4k]
  ------------------
  883|  49.7k|            hdr->cdef.y_strength[i] = dav1d_get_bits(gb, 6);
  884|  49.7k|            if (!seqhdr->monochrome)
  ------------------
  |  Branch (884:17): [True: 19.4k, False: 30.3k]
  ------------------
  885|  19.4k|                hdr->cdef.uv_strength[i] = dav1d_get_bits(gb, 6);
  886|  49.7k|        }
  887|  43.4k|    }
  888|       |#if DEBUG_FRAME_HDR
  889|       |    printf("HDR: post-cdef: off=%td\n",
  890|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  891|       |#endif
  892|       |
  893|       |    // restoration
  894|  45.5k|    if ((!hdr->all_lossless || hdr->super_res.enabled) &&
  ------------------
  |  Branch (894:10): [True: 43.4k, False: 2.13k]
  |  Branch (894:32): [True: 0, False: 2.13k]
  ------------------
  895|  43.4k|        seqhdr->restoration && !hdr->allow_intrabc)
  ------------------
  |  Branch (895:9): [True: 6.39k, False: 37.0k]
  |  Branch (895:32): [True: 6.39k, False: 0]
  ------------------
  896|  6.39k|    {
  897|  6.39k|        hdr->restoration.type[0] = dav1d_get_bits(gb, 2);
  898|  6.39k|        if (!seqhdr->monochrome) {
  ------------------
  |  Branch (898:13): [True: 2.29k, False: 4.10k]
  ------------------
  899|  2.29k|            hdr->restoration.type[1] = dav1d_get_bits(gb, 2);
  900|  2.29k|            hdr->restoration.type[2] = dav1d_get_bits(gb, 2);
  901|  2.29k|        }
  902|       |
  903|  6.39k|        if (hdr->restoration.type[0] || hdr->restoration.type[1] ||
  ------------------
  |  Branch (903:13): [True: 392, False: 6.00k]
  |  Branch (903:41): [True: 40, False: 5.96k]
  ------------------
  904|  5.96k|            hdr->restoration.type[2])
  ------------------
  |  Branch (904:13): [True: 21, False: 5.94k]
  ------------------
  905|    453|        {
  906|       |            // Log2 of the restoration unit size.
  907|    453|            hdr->restoration.unit_size[0] = 6 + seqhdr->sb128;
  908|    453|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (908:17): [True: 453, False: 0]
  ------------------
  909|    453|                hdr->restoration.unit_size[0]++;
  910|    453|                if (!seqhdr->sb128)
  ------------------
  |  Branch (910:21): [True: 453, False: 0]
  ------------------
  911|    453|                    hdr->restoration.unit_size[0] += dav1d_get_bit(gb);
  912|    453|            }
  913|    453|            hdr->restoration.unit_size[1] = hdr->restoration.unit_size[0];
  914|    453|            if ((hdr->restoration.type[1] || hdr->restoration.type[2]) &&
  ------------------
  |  Branch (914:18): [True: 46, False: 407]
  |  Branch (914:46): [True: 21, False: 386]
  ------------------
  915|     67|                seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1)
  ------------------
  |  Branch (915:17): [True: 17, False: 50]
  |  Branch (915:40): [True: 8, False: 9]
  ------------------
  916|      8|            {
  917|      8|                hdr->restoration.unit_size[1] -= dav1d_get_bit(gb);
  918|      8|            }
  919|  5.94k|        } else {
  920|  5.94k|            hdr->restoration.unit_size[0] = 8;
  921|  5.94k|        }
  922|  6.39k|    }
  923|       |#if DEBUG_FRAME_HDR
  924|       |    printf("HDR: post-restoration: off=%td\n",
  925|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  926|       |#endif
  927|       |
  928|  45.5k|    if (!hdr->all_lossless)
  ------------------
  |  Branch (928:9): [True: 43.4k, False: 2.13k]
  ------------------
  929|  43.4k|        hdr->txfm_mode = dav1d_get_bit(gb) ? DAV1D_TX_SWITCHABLE : DAV1D_TX_LARGEST;
  ------------------
  |  Branch (929:26): [True: 27.2k, False: 16.1k]
  ------------------
  930|       |#if DEBUG_FRAME_HDR
  931|       |    printf("HDR: post-txfmmode: off=%td\n",
  932|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  933|       |#endif
  934|  45.5k|    if (IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 11.3k]
  |  |  ------------------
  ------------------
  935|  34.1k|        hdr->switchable_comp_refs = dav1d_get_bit(gb);
  936|       |#if DEBUG_FRAME_HDR
  937|       |    printf("HDR: post-refmode: off=%td\n",
  938|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  939|       |#endif
  940|  45.5k|    if (hdr->switchable_comp_refs && IS_INTER_OR_SWITCH(hdr) && seqhdr->order_hint) {
  ------------------
  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (940:9): [True: 0, False: 45.5k]
  |  Branch (940:65): [True: 0, False: 0]
  ------------------
  941|      0|        const int poc = hdr->frame_offset;
  942|      0|        int off_before = -1, off_after = -1;
  943|      0|        int off_before_idx, off_after_idx;
  944|      0|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (944:25): [True: 0, False: 0]
  ------------------
  945|      0|            if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (945:17): [True: 0, False: 0]
  ------------------
  946|      0|            const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  947|       |
  948|      0|            const int diff = get_poc_diff(seqhdr->order_hint_n_bits, refpoc, poc);
  949|      0|            if (diff > 0) {
  ------------------
  |  Branch (949:17): [True: 0, False: 0]
  ------------------
  950|      0|                if (off_after < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (950:21): [True: 0, False: 0]
  |  Branch (950:38): [True: 0, False: 0]
  ------------------
  951|      0|                                                  off_after, refpoc) > 0)
  952|      0|                {
  953|      0|                    off_after = refpoc;
  954|      0|                    off_after_idx = i;
  955|      0|                }
  956|      0|            } else if (diff < 0 && (off_before < 0 ||
  ------------------
  |  Branch (956:24): [True: 0, False: 0]
  |  Branch (956:37): [True: 0, False: 0]
  ------------------
  957|      0|                                    get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (957:37): [True: 0, False: 0]
  ------------------
  958|      0|                                                 refpoc, off_before) > 0))
  959|      0|            {
  960|      0|                off_before = refpoc;
  961|      0|                off_before_idx = i;
  962|      0|            }
  963|      0|        }
  964|       |
  965|      0|        if ((off_before | off_after) >= 0) {
  ------------------
  |  Branch (965:13): [True: 0, False: 0]
  ------------------
  966|      0|            hdr->skip_mode_refs[0] = imin(off_before_idx, off_after_idx);
  967|      0|            hdr->skip_mode_refs[1] = imax(off_before_idx, off_after_idx);
  968|      0|            hdr->skip_mode_allowed = 1;
  969|      0|        } else if (off_before >= 0) {
  ------------------
  |  Branch (969:20): [True: 0, False: 0]
  ------------------
  970|      0|            int off_before2 = -1;
  971|      0|            int off_before2_idx;
  972|      0|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (972:29): [True: 0, False: 0]
  ------------------
  973|      0|                if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (973:21): [True: 0, False: 0]
  ------------------
  974|      0|                const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  975|      0|                if (get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (975:21): [True: 0, False: 0]
  ------------------
  976|      0|                                 refpoc, off_before) < 0) {
  977|      0|                    if (off_before2 < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (977:25): [True: 0, False: 0]
  |  Branch (977:44): [True: 0, False: 0]
  ------------------
  978|      0|                                                        refpoc, off_before2) > 0)
  979|      0|                    {
  980|      0|                        off_before2 = refpoc;
  981|      0|                        off_before2_idx = i;
  982|      0|                    }
  983|      0|                }
  984|      0|            }
  985|       |
  986|      0|            if (off_before2 >= 0) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  ------------------
  987|      0|                hdr->skip_mode_refs[0] = imin(off_before_idx, off_before2_idx);
  988|      0|                hdr->skip_mode_refs[1] = imax(off_before_idx, off_before2_idx);
  989|      0|                hdr->skip_mode_allowed = 1;
  990|      0|            }
  991|      0|        }
  992|      0|    }
  993|  45.5k|    if (hdr->skip_mode_allowed)
  ------------------
  |  Branch (993:9): [True: 0, False: 45.5k]
  ------------------
  994|      0|        hdr->skip_mode_enabled = dav1d_get_bit(gb);
  995|       |#if DEBUG_FRAME_HDR
  996|       |    printf("HDR: post-extskip: off=%td\n",
  997|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  998|       |#endif
  999|  45.5k|    if (!hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) && seqhdr->warped_motion)
  ------------------
  |  |   36|  79.7k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (999:9): [True: 34.1k, False: 11.3k]
  |  Branch (999:66): [True: 34.1k, False: 0]
  ------------------
 1000|  34.1k|        hdr->warp_motion = dav1d_get_bit(gb);
 1001|       |#if DEBUG_FRAME_HDR
 1002|       |    printf("HDR: post-warpmotionbit: off=%td\n",
 1003|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1004|       |#endif
 1005|  45.5k|    hdr->reduced_txtp_set = dav1d_get_bit(gb);
 1006|       |#if DEBUG_FRAME_HDR
 1007|       |    printf("HDR: post-reducedtxtpset: off=%td\n",
 1008|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1009|       |#endif
 1010|       |
 1011|   364k|    for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (1011:21): [True: 318k, False: 45.5k]
  ------------------
 1012|   318k|        hdr->gmv[i] = dav1d_default_wm_params;
 1013|       |
 1014|  45.5k|    if (IS_INTER_OR_SWITCH(hdr)) {
  ------------------
  |  |   36|  45.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 34.1k, False: 11.3k]
  |  |  ------------------
  ------------------
 1015|   273k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (1015:25): [True: 239k, False: 34.1k]
  ------------------
 1016|   239k|            hdr->gmv[i].type = !dav1d_get_bit(gb) ? DAV1D_WM_TYPE_IDENTITY :
  ------------------
  |  Branch (1016:32): [True: 239k, False: 0]
  ------------------
 1017|   239k|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_ROT_ZOOM :
  ------------------
  |  Branch (1017:33): [True: 0, False: 0]
  ------------------
 1018|      0|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_TRANSLATION :
  ------------------
  |  Branch (1018:33): [True: 0, False: 0]
  ------------------
 1019|      0|                                                    DAV1D_WM_TYPE_AFFINE;
 1020|       |
 1021|   239k|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_IDENTITY) continue;
  ------------------
  |  Branch (1021:17): [True: 239k, False: 0]
  ------------------
 1022|       |
 1023|      0|            const Dav1dWarpedMotionParams *ref_gmv;
 1024|      0|            if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|      0|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1024:17): [True: 0, False: 0]
  ------------------
 1025|      0|                ref_gmv = &dav1d_default_wm_params;
 1026|      0|            } else {
 1027|      0|                const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
 1028|      0|                if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1028:21): [True: 0, False: 0]
  ------------------
 1029|      0|                ref_gmv = &c->refs[pri_ref].p.p.frame_hdr->gmv[i];
 1030|      0|            }
 1031|      0|            int32_t *const mat = hdr->gmv[i].matrix;
 1032|      0|            const int32_t *const ref_mat = ref_gmv->matrix;
 1033|      0|            int bits, shift;
 1034|       |
 1035|      0|            if (hdr->gmv[i].type >= DAV1D_WM_TYPE_ROT_ZOOM) {
  ------------------
  |  Branch (1035:17): [True: 0, False: 0]
  ------------------
 1036|      0|                mat[2] = (1 << 16) + 2 *
 1037|      0|                    dav1d_get_bits_subexp(gb, (ref_mat[2] - (1 << 16)) >> 1, 12);
 1038|      0|                mat[3] = 2 * dav1d_get_bits_subexp(gb, ref_mat[3] >> 1, 12);
 1039|       |
 1040|      0|                bits = 12;
 1041|      0|                shift = 10;
 1042|      0|            } else {
 1043|      0|                bits = 9 - !hdr->hp;
 1044|      0|                shift = 13 + !hdr->hp;
 1045|      0|            }
 1046|       |
 1047|      0|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1047:17): [True: 0, False: 0]
  ------------------
 1048|      0|                mat[4] = 2 * dav1d_get_bits_subexp(gb, ref_mat[4] >> 1, 12);
 1049|      0|                mat[5] = (1 << 16) + 2 *
 1050|      0|                    dav1d_get_bits_subexp(gb, (ref_mat[5] - (1 << 16)) >> 1, 12);
 1051|      0|            } else {
 1052|      0|                mat[4] = -mat[3];
 1053|      0|                mat[5] = mat[2];
 1054|      0|            }
 1055|       |
 1056|      0|            mat[0] = dav1d_get_bits_subexp(gb, ref_mat[0] >> shift, bits) * (1 << shift);
 1057|      0|            mat[1] = dav1d_get_bits_subexp(gb, ref_mat[1] >> shift, bits) * (1 << shift);
 1058|      0|        }
 1059|  34.1k|    }
 1060|       |#if DEBUG_FRAME_HDR
 1061|       |    printf("HDR: post-gmv: off=%td\n",
 1062|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1063|       |#endif
 1064|       |
 1065|  45.5k|    if (seqhdr->film_grain_present && (hdr->show_frame || hdr->showable_frame)) {
  ------------------
  |  Branch (1065:9): [True: 0, False: 45.5k]
  |  Branch (1065:40): [True: 0, False: 0]
  |  Branch (1065:59): [True: 0, False: 0]
  ------------------
 1066|      0|        hdr->film_grain.present = dav1d_get_bit(gb);
 1067|      0|        if (hdr->film_grain.present) {
  ------------------
  |  Branch (1067:13): [True: 0, False: 0]
  ------------------
 1068|      0|            const unsigned seed = dav1d_get_bits(gb, 16);
 1069|      0|            hdr->film_grain.update = hdr->frame_type != DAV1D_FRAME_TYPE_INTER || dav1d_get_bit(gb);
  ------------------
  |  Branch (1069:38): [True: 0, False: 0]
  |  Branch (1069:83): [True: 0, False: 0]
  ------------------
 1070|      0|            if (!hdr->film_grain.update) {
  ------------------
  |  Branch (1070:17): [True: 0, False: 0]
  ------------------
 1071|      0|                const int refidx = dav1d_get_bits(gb, 3);
 1072|      0|                int i;
 1073|      0|                for (i = 0; i < 7; i++)
  ------------------
  |  Branch (1073:29): [True: 0, False: 0]
  ------------------
 1074|      0|                    if (hdr->refidx[i] == refidx)
  ------------------
  |  Branch (1074:25): [True: 0, False: 0]
  ------------------
 1075|      0|                        break;
 1076|      0|                if (i == 7 || !c->refs[refidx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1076:21): [True: 0, False: 0]
  |  Branch (1076:31): [True: 0, False: 0]
  ------------------
 1077|      0|                hdr->film_grain.data = c->refs[refidx].p.p.frame_hdr->film_grain.data;
 1078|      0|                hdr->film_grain.data.seed = seed;
 1079|      0|            } else {
 1080|      0|                Dav1dFilmGrainData *const fgd = &hdr->film_grain.data;
 1081|      0|                fgd->seed = seed;
 1082|       |
 1083|      0|                fgd->num_y_points = dav1d_get_bits(gb, 4);
 1084|      0|                if (fgd->num_y_points > 14) goto error;
  ------------------
  |  Branch (1084:21): [True: 0, False: 0]
  ------------------
 1085|      0|                for (int i = 0; i < fgd->num_y_points; i++) {
  ------------------
  |  Branch (1085:33): [True: 0, False: 0]
  ------------------
 1086|      0|                    fgd->y_points[i][0] = dav1d_get_bits(gb, 8);
 1087|      0|                    if (i && fgd->y_points[i - 1][0] >= fgd->y_points[i][0])
  ------------------
  |  Branch (1087:25): [True: 0, False: 0]
  |  Branch (1087:30): [True: 0, False: 0]
  ------------------
 1088|      0|                        goto error;
 1089|      0|                    fgd->y_points[i][1] = dav1d_get_bits(gb, 8);
 1090|      0|                }
 1091|       |
 1092|      0|                if (!seqhdr->monochrome)
  ------------------
  |  Branch (1092:21): [True: 0, False: 0]
  ------------------
 1093|      0|                    fgd->chroma_scaling_from_luma = dav1d_get_bit(gb);
 1094|      0|                if (seqhdr->monochrome || fgd->chroma_scaling_from_luma ||
  ------------------
  |  Branch (1094:21): [True: 0, False: 0]
  |  Branch (1094:43): [True: 0, False: 0]
  ------------------
 1095|      0|                    (seqhdr->ss_ver == 1 && seqhdr->ss_hor == 1 && !fgd->num_y_points))
  ------------------
  |  Branch (1095:22): [True: 0, False: 0]
  |  Branch (1095:45): [True: 0, False: 0]
  |  Branch (1095:68): [True: 0, False: 0]
  ------------------
 1096|      0|                {
 1097|      0|                    fgd->num_uv_points[0] = fgd->num_uv_points[1] = 0;
 1098|      0|                } else for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1098:41): [True: 0, False: 0]
  ------------------
 1099|      0|                    fgd->num_uv_points[pl] = dav1d_get_bits(gb, 4);
 1100|      0|                    if (fgd->num_uv_points[pl] > 10) goto error;
  ------------------
  |  Branch (1100:25): [True: 0, False: 0]
  ------------------
 1101|      0|                    for (int i = 0; i < fgd->num_uv_points[pl]; i++) {
  ------------------
  |  Branch (1101:37): [True: 0, False: 0]
  ------------------
 1102|      0|                        fgd->uv_points[pl][i][0] = dav1d_get_bits(gb, 8);
 1103|      0|                        if (i && fgd->uv_points[pl][i - 1][0] >= fgd->uv_points[pl][i][0])
  ------------------
  |  Branch (1103:29): [True: 0, False: 0]
  |  Branch (1103:34): [True: 0, False: 0]
  ------------------
 1104|      0|                            goto error;
 1105|      0|                        fgd->uv_points[pl][i][1] = dav1d_get_bits(gb, 8);
 1106|      0|                    }
 1107|      0|                }
 1108|       |
 1109|      0|                if (seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1 &&
  ------------------
  |  Branch (1109:21): [True: 0, False: 0]
  |  Branch (1109:44): [True: 0, False: 0]
  ------------------
 1110|      0|                    !!fgd->num_uv_points[0] != !!fgd->num_uv_points[1])
  ------------------
  |  Branch (1110:21): [True: 0, False: 0]
  ------------------
 1111|      0|                {
 1112|      0|                    goto error;
 1113|      0|                }
 1114|       |
 1115|      0|                fgd->scaling_shift = dav1d_get_bits(gb, 2) + 8;
 1116|      0|                fgd->ar_coeff_lag = dav1d_get_bits(gb, 2);
 1117|      0|                const int num_y_pos = 2 * fgd->ar_coeff_lag * (fgd->ar_coeff_lag + 1);
 1118|      0|                if (fgd->num_y_points)
  ------------------
  |  Branch (1118:21): [True: 0, False: 0]
  ------------------
 1119|      0|                    for (int i = 0; i < num_y_pos; i++)
  ------------------
  |  Branch (1119:37): [True: 0, False: 0]
  ------------------
 1120|      0|                        fgd->ar_coeffs_y[i] = dav1d_get_bits(gb, 8) - 128;
 1121|      0|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1121:34): [True: 0, False: 0]
  ------------------
 1122|      0|                    if (fgd->num_uv_points[pl] || fgd->chroma_scaling_from_luma) {
  ------------------
  |  Branch (1122:25): [True: 0, False: 0]
  |  Branch (1122:51): [True: 0, False: 0]
  ------------------
 1123|      0|                        const int num_uv_pos = num_y_pos + !!fgd->num_y_points;
 1124|      0|                        for (int i = 0; i < num_uv_pos; i++)
  ------------------
  |  Branch (1124:41): [True: 0, False: 0]
  ------------------
 1125|      0|                            fgd->ar_coeffs_uv[pl][i] = dav1d_get_bits(gb, 8) - 128;
 1126|      0|                        if (!fgd->num_y_points)
  ------------------
  |  Branch (1126:29): [True: 0, False: 0]
  ------------------
 1127|      0|                            fgd->ar_coeffs_uv[pl][num_uv_pos] = 0;
 1128|      0|                    }
 1129|      0|                fgd->ar_coeff_shift = dav1d_get_bits(gb, 2) + 6;
 1130|      0|                fgd->grain_scale_shift = dav1d_get_bits(gb, 2);
 1131|      0|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1131:34): [True: 0, False: 0]
  ------------------
 1132|      0|                    if (fgd->num_uv_points[pl]) {
  ------------------
  |  Branch (1132:25): [True: 0, False: 0]
  ------------------
 1133|      0|                        fgd->uv_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1134|      0|                        fgd->uv_luma_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1135|      0|                        fgd->uv_offset[pl] = dav1d_get_bits(gb, 9) - 256;
 1136|      0|                    }
 1137|      0|                fgd->overlap_flag = dav1d_get_bit(gb);
 1138|      0|                fgd->clip_to_restricted_range = dav1d_get_bit(gb);
 1139|      0|            }
 1140|      0|        }
 1141|      0|    }
 1142|       |#if DEBUG_FRAME_HDR
 1143|       |    printf("HDR: post-filmgrain: off=%td\n",
 1144|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1145|       |#endif
 1146|       |
 1147|  45.5k|    return 0;
 1148|       |
 1149|      0|error:
 1150|      0|    dav1d_log(c, "Error parsing frame header\n");
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
 1151|      0|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1152|  45.5k|}
obu.c:read_frame_size:
  343|  45.5k|{
  344|  45.5k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  345|  45.5k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  346|       |
  347|  45.5k|    if (use_ref) {
  ------------------
  |  Branch (347:9): [True: 22.7k, False: 22.7k]
  ------------------
  348|   137k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (348:25): [True: 121k, False: 16.4k]
  ------------------
  349|   121k|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (349:17): [True: 6.35k, False: 114k]
  ------------------
  350|  6.35k|                const Dav1dThreadPicture *const ref =
  351|  6.35k|                    &c->refs[c->frame_hdr->refidx[i]].p;
  352|  6.35k|                if (!ref->p.frame_hdr) return -1;
  ------------------
  |  Branch (352:21): [True: 0, False: 6.35k]
  ------------------
  353|  6.35k|                hdr->width[1] = ref->p.frame_hdr->width[1];
  354|  6.35k|                hdr->height = ref->p.frame_hdr->height;
  355|  6.35k|                hdr->render_width = ref->p.frame_hdr->render_width;
  356|  6.35k|                hdr->render_height = ref->p.frame_hdr->render_height;
  357|  6.35k|                hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (357:42): [True: 0, False: 6.35k]
  |  Branch (357:63): [True: 0, False: 0]
  ------------------
  358|  6.35k|                if (hdr->super_res.enabled) {
  ------------------
  |  Branch (358:21): [True: 0, False: 6.35k]
  ------------------
  359|      0|                    const int d = hdr->super_res.width_scale_denominator =
  360|      0|                        9 + dav1d_get_bits(gb, 3);
  361|      0|                    hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d,
  362|      0|                                         imin(16, hdr->width[1]));
  363|  6.35k|                } else {
  364|  6.35k|                    hdr->super_res.width_scale_denominator = 8;
  365|  6.35k|                    hdr->width[0] = hdr->width[1];
  366|  6.35k|                }
  367|  6.35k|                return 0;
  368|  6.35k|            }
  369|   121k|        }
  370|  22.7k|    }
  371|       |
  372|  39.1k|    if (hdr->frame_size_override) {
  ------------------
  |  Branch (372:9): [True: 27.8k, False: 11.3k]
  ------------------
  373|  27.8k|        hdr->width[1] = dav1d_get_bits(gb, seqhdr->width_n_bits) + 1;
  374|  27.8k|        hdr->height = dav1d_get_bits(gb, seqhdr->height_n_bits) + 1;
  375|  27.8k|    } else {
  376|  11.3k|        hdr->width[1] = seqhdr->max_width;
  377|  11.3k|        hdr->height = seqhdr->max_height;
  378|  11.3k|    }
  379|  39.1k|    hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (379:30): [True: 0, False: 39.1k]
  |  Branch (379:51): [True: 0, False: 0]
  ------------------
  380|  39.1k|    if (hdr->super_res.enabled) {
  ------------------
  |  Branch (380:9): [True: 0, False: 39.1k]
  ------------------
  381|      0|        const int d = hdr->super_res.width_scale_denominator = 9 + dav1d_get_bits(gb, 3);
  382|      0|        hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d, imin(16, hdr->width[1]));
  383|  39.1k|    } else {
  384|  39.1k|        hdr->super_res.width_scale_denominator = 8;
  385|  39.1k|        hdr->width[0] = hdr->width[1];
  386|  39.1k|    }
  387|  39.1k|    hdr->have_render_size = dav1d_get_bit(gb);
  388|  39.1k|    if (hdr->have_render_size) {
  ------------------
  |  Branch (388:9): [True: 27.8k, False: 11.3k]
  ------------------
  389|  27.8k|        hdr->render_width = dav1d_get_bits(gb, 16) + 1;
  390|  27.8k|        hdr->render_height = dav1d_get_bits(gb, 16) + 1;
  391|  27.8k|    } else {
  392|  11.3k|        hdr->render_width = hdr->width[1];
  393|  11.3k|        hdr->render_height = hdr->height;
  394|  11.3k|    }
  395|  39.1k|    return 0;
  396|  45.5k|}
obu.c:tile_log2:
  398|   182k|static inline int tile_log2(const int sz, const int tgt) {
  399|   182k|    int k;
  400|   207k|    for (k = 0; (sz << k) < tgt; k++) ;
  ------------------
  |  Branch (400:17): [True: 25.7k, False: 182k]
  ------------------
  401|   182k|    return k;
  402|   182k|}
obu.c:check_trailing_bits:
   50|  11.3k|{
   51|  11.3k|    const int trailing_one_bit = dav1d_get_bit(gb);
   52|       |
   53|  11.3k|    if (gb->error)
  ------------------
  |  Branch (53:9): [True: 0, False: 11.3k]
  ------------------
   54|      0|        return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
   55|       |
   56|  11.3k|    if (!strict_std_compliance)
  ------------------
  |  Branch (56:9): [True: 11.3k, False: 0]
  ------------------
   57|  11.3k|        return 0;
   58|       |
   59|      0|    if (!trailing_one_bit || gb->state)
  ------------------
  |  Branch (59:9): [True: 0, False: 0]
  |  Branch (59:30): [True: 0, False: 0]
  ------------------
   60|      0|        return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
   61|       |
   62|      0|    ptrdiff_t size = gb->ptr_end - gb->ptr;
   63|      0|    while (size > 0 && gb->ptr[size - 1] == 0)
  ------------------
  |  Branch (63:12): [True: 0, False: 0]
  |  Branch (63:24): [True: 0, False: 0]
  ------------------
   64|      0|        size--;
   65|       |
   66|      0|    if (size)
  ------------------
  |  Branch (66:9): [True: 0, False: 0]
  ------------------
   67|      0|        return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
   68|       |
   69|      0|    return 0;
   70|      0|}
obu.c:parse_tile_hdr:
 1154|  45.5k|static void parse_tile_hdr(Dav1dContext *const c, GetBits *const gb) {
 1155|  45.5k|    const int n_tiles = c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows;
 1156|  45.5k|    const int have_tile_pos = n_tiles > 1 ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (1156:31): [True: 11.4k, False: 34.0k]
  ------------------
 1157|       |
 1158|  45.5k|    if (have_tile_pos) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 45.5k]
  ------------------
 1159|      0|        const int n_bits = c->frame_hdr->tiling.log2_cols +
 1160|      0|                           c->frame_hdr->tiling.log2_rows;
 1161|      0|        c->tile[c->n_tile_data].start = dav1d_get_bits(gb, n_bits);
 1162|      0|        c->tile[c->n_tile_data].end = dav1d_get_bits(gb, n_bits);
 1163|  45.5k|    } else {
 1164|  45.5k|        c->tile[c->n_tile_data].start = 0;
 1165|  45.5k|        c->tile[c->n_tile_data].end = n_tiles - 1;
 1166|  45.5k|    }
 1167|  45.5k|}

dav1d_pal_dsp_init:
   71|  11.3k|COLD void dav1d_pal_dsp_init(Dav1dPalDSPContext *const c) {
   72|  11.3k|    c->pal_idx_finish = pal_idx_finish_c;
   73|       |
   74|  11.3k|#if HAVE_ASM
   75|       |#if ARCH_RISCV
   76|       |    pal_dsp_init_riscv(c);
   77|       |#elif ARCH_X86
   78|       |    pal_dsp_init_x86(c);
   79|  11.3k|#endif
   80|  11.3k|#endif
   81|  11.3k|}

dav1d_default_picture_alloc:
   46|  45.5k|int dav1d_default_picture_alloc(Dav1dPicture *const p, void *const cookie) {
   47|  45.5k|    const int hbd = p->p.bpc > 8;
   48|  45.5k|    const int aligned_w = (p->p.w + 127) & ~127;
   49|  45.5k|    const int aligned_h = (p->p.h + 127) & ~127;
   50|  45.5k|    const int has_chroma = p->p.layout != DAV1D_PIXEL_LAYOUT_I400;
   51|  45.5k|    const int ss_ver = p->p.layout == DAV1D_PIXEL_LAYOUT_I420;
   52|  45.5k|    const int ss_hor = p->p.layout != DAV1D_PIXEL_LAYOUT_I444;
   53|  45.5k|    ptrdiff_t y_stride = aligned_w << hbd;
   54|  45.5k|    ptrdiff_t uv_stride = has_chroma ? y_stride >> ss_hor : 0;
  ------------------
  |  Branch (54:27): [True: 17.1k, False: 28.3k]
  ------------------
   55|       |    /* Due to how mapping of addresses to sets works in most L1 and L2 cache
   56|       |     * implementations, strides of multiples of certain power-of-two numbers
   57|       |     * may cause multiple rows of the same superblock to map to the same set,
   58|       |     * causing evictions of previous rows resulting in a reduction in cache
   59|       |     * hit rate. Avoid that by slightly padding the stride when necessary. */
   60|  45.5k|    if (!(y_stride & 1023))
  ------------------
  |  Branch (60:9): [True: 0, False: 45.5k]
  ------------------
   61|      0|        y_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|      0|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   62|  45.5k|    if (!(uv_stride & 1023) && has_chroma)
  ------------------
  |  Branch (62:9): [True: 28.3k, False: 17.1k]
  |  Branch (62:32): [True: 0, False: 28.3k]
  ------------------
   63|      0|        uv_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|      0|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   64|  45.5k|    p->stride[0] = y_stride;
   65|  45.5k|    p->stride[1] = uv_stride;
   66|  45.5k|    const size_t y_sz = y_stride * aligned_h;
   67|  45.5k|    const size_t uv_sz = uv_stride * (aligned_h >> ss_ver);
   68|  45.5k|    const size_t pic_size = y_sz + 2 * uv_sz;
   69|       |
   70|  45.5k|    uint8_t *const buf = dav1d_mem_pool_pop(cookie, pic_size + DAV1D_PICTURE_ALIGNMENT);
  ------------------
  |  |   44|  45.5k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   71|  45.5k|    if (!buf) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (71:9): [True: 0, False: 45.5k]
  ------------------
   72|  45.5k|    p->allocator_data = buf;
   73|  45.5k|    p->data[0] = buf;
   74|  45.5k|    p->data[1] = has_chroma ? buf + y_sz : NULL;
  ------------------
  |  Branch (74:18): [True: 17.1k, False: 28.3k]
  ------------------
   75|  45.5k|    p->data[2] = has_chroma ? buf + y_sz + uv_sz : NULL;
  ------------------
  |  Branch (75:18): [True: 17.1k, False: 28.3k]
  ------------------
   76|       |
   77|  45.5k|    return 0;
   78|  45.5k|}
dav1d_default_picture_release:
   80|  45.5k|void dav1d_default_picture_release(Dav1dPicture *const p, void *const cookie) {
   81|  45.5k|    dav1d_mem_pool_push(cookie, p->allocator_data);
   82|  45.5k|}
dav1d_picture_copy_props:
  164|  45.5k|{
  165|  45.5k|    dav1d_data_props_copy(&p->m, props);
  166|       |
  167|  45.5k|    dav1d_ref_dec(&p->content_light_ref);
  168|  45.5k|    p->content_light_ref = content_light_ref;
  169|  45.5k|    p->content_light = content_light;
  170|  45.5k|    if (content_light_ref) dav1d_ref_inc(content_light_ref);
  ------------------
  |  Branch (170:9): [True: 0, False: 45.5k]
  ------------------
  171|       |
  172|  45.5k|    dav1d_ref_dec(&p->mastering_display_ref);
  173|  45.5k|    p->mastering_display_ref = mastering_display_ref;
  174|  45.5k|    p->mastering_display = mastering_display;
  175|  45.5k|    if (mastering_display_ref) dav1d_ref_inc(mastering_display_ref);
  ------------------
  |  Branch (175:9): [True: 0, False: 45.5k]
  ------------------
  176|       |
  177|  45.5k|    dav1d_ref_dec(&p->itut_t35_ref);
  178|  45.5k|    p->itut_t35_ref = itut_t35_ref;
  179|  45.5k|    p->itut_t35 = itut_t35;
  180|  45.5k|    p->n_itut_t35 = n_itut_t35;
  181|  45.5k|    if (itut_t35_ref) dav1d_ref_inc(itut_t35_ref);
  ------------------
  |  Branch (181:9): [True: 0, False: 45.5k]
  ------------------
  182|  45.5k|}
dav1d_thread_picture_alloc:
  186|  45.5k|{
  187|  45.5k|    Dav1dThreadPicture *const p = &f->sr_cur;
  188|       |
  189|  45.5k|    const int res = picture_alloc(c, &p->p, f->frame_hdr->width[1], f->frame_hdr->height,
  190|  45.5k|                                  f->seq_hdr, f->seq_hdr_ref,
  191|  45.5k|                                  f->frame_hdr, f->frame_hdr_ref,
  192|  45.5k|                                  bpc, &f->tile[0].data.m, &c->allocator,
  193|  45.5k|                                  (void **) &p->progress);
  194|  45.5k|    if (res) return res;
  ------------------
  |  Branch (194:9): [True: 0, False: 45.5k]
  ------------------
  195|       |
  196|       |    // Don't clear these flags from c->frame_flags if the frame is not going to be output.
  197|       |    // This way they will be added to the next visible frame too.
  198|  45.5k|    const int flags_mask = ((f->frame_hdr->show_frame || c->output_invisible_frames) &&
  ------------------
  |  Branch (198:30): [True: 45.5k, False: 0]
  |  Branch (198:58): [True: 0, False: 0]
  ------------------
  199|  45.5k|                            c->max_spatial_id == f->frame_hdr->spatial_id)
  ------------------
  |  Branch (199:29): [True: 11.3k, False: 34.1k]
  ------------------
  200|  45.5k|                           ? 0 : (PICTURE_FLAG_NEW_SEQUENCE | PICTURE_FLAG_NEW_OP_PARAMS_INFO);
  201|  45.5k|    p->flags = c->frame_flags;
  202|  45.5k|    c->frame_flags &= flags_mask;
  203|       |
  204|  45.5k|    p->visible = f->frame_hdr->show_frame;
  205|  45.5k|    p->showable = f->frame_hdr->showable_frame;
  206|       |
  207|  45.5k|    if (p->visible) {
  ------------------
  |  Branch (207:9): [True: 45.5k, False: 0]
  ------------------
  208|       |        // Only add HDR10+ and T35 metadata when show frame flag is enabled
  209|  45.5k|        dav1d_picture_copy_props(&p->p, c->content_light, c->content_light_ref,
  210|  45.5k|                                 c->mastering_display, c->mastering_display_ref,
  211|  45.5k|                                 c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
  212|  45.5k|                                 &f->tile[0].data.m);
  213|       |
  214|       |        // Must be removed from the context after being attached to the frame
  215|  45.5k|        dav1d_ref_dec(&c->itut_t35_ref);
  216|  45.5k|        c->itut_t35 = NULL;
  217|  45.5k|        c->n_itut_t35 = 0;
  218|  45.5k|    } else {
  219|      0|        dav1d_data_props_copy(&p->p.m, &f->tile[0].data.m);
  220|      0|    }
  221|       |
  222|  45.5k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (222:9): [True: 0, False: 45.5k]
  ------------------
  223|      0|        atomic_init(&p->progress[0], 0);
  224|       |        atomic_init(&p->progress[1], 0);
  225|      0|    }
  226|  45.5k|    return res;
  227|  45.5k|}
dav1d_picture_ref:
  248|   455k|void dav1d_picture_ref(Dav1dPicture *const dst, const Dav1dPicture *const src) {
  249|   455k|    assert(dst != NULL);
  ------------------
  |  |  140|   455k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 455k]
  |  |  |  Branch (140:68): [Folded, False: 455k]
  |  |  ------------------
  ------------------
  250|   455k|    assert(dst->data[0] == NULL);
  ------------------
  |  |  140|   455k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 455k]
  |  |  |  Branch (140:68): [Folded, False: 455k]
  |  |  ------------------
  ------------------
  251|   455k|    assert(src != NULL);
  ------------------
  |  |  140|   455k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 455k]
  |  |  |  Branch (140:68): [Folded, False: 455k]
  |  |  ------------------
  ------------------
  252|       |
  253|   455k|    if (src->ref) {
  ------------------
  |  Branch (253:9): [True: 455k, False: 0]
  ------------------
  254|   455k|        assert(src->data[0] != NULL);
  ------------------
  |  |  140|   455k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 455k]
  |  |  |  Branch (140:68): [Folded, False: 455k]
  |  |  ------------------
  ------------------
  255|   455k|        dav1d_ref_inc(src->ref);
  256|   455k|    }
  257|   455k|    if (src->frame_hdr_ref) dav1d_ref_inc(src->frame_hdr_ref);
  ------------------
  |  Branch (257:9): [True: 455k, False: 0]
  ------------------
  258|   455k|    if (src->seq_hdr_ref) dav1d_ref_inc(src->seq_hdr_ref);
  ------------------
  |  Branch (258:9): [True: 455k, False: 0]
  ------------------
  259|   455k|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (259:9): [True: 0, False: 455k]
  ------------------
  260|   455k|    if (src->content_light_ref) dav1d_ref_inc(src->content_light_ref);
  ------------------
  |  Branch (260:9): [True: 0, False: 455k]
  ------------------
  261|   455k|    if (src->mastering_display_ref) dav1d_ref_inc(src->mastering_display_ref);
  ------------------
  |  Branch (261:9): [True: 0, False: 455k]
  ------------------
  262|   455k|    if (src->itut_t35_ref) dav1d_ref_inc(src->itut_t35_ref);
  ------------------
  |  Branch (262:9): [True: 0, False: 455k]
  ------------------
  263|   455k|    *dst = *src;
  264|   455k|}
dav1d_picture_move_ref:
  266|  51.0k|void dav1d_picture_move_ref(Dav1dPicture *const dst, Dav1dPicture *const src) {
  267|  51.0k|    assert(dst != NULL);
  ------------------
  |  |  140|  51.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 51.0k]
  |  |  |  Branch (140:68): [Folded, False: 51.0k]
  |  |  ------------------
  ------------------
  268|  51.0k|    assert(dst->data[0] == NULL);
  ------------------
  |  |  140|  51.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 51.0k]
  |  |  |  Branch (140:68): [Folded, False: 51.0k]
  |  |  ------------------
  ------------------
  269|  51.0k|    assert(src != NULL);
  ------------------
  |  |  140|  51.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 51.0k]
  |  |  |  Branch (140:68): [Folded, False: 51.0k]
  |  |  ------------------
  ------------------
  270|       |
  271|  51.0k|    if (src->ref)
  ------------------
  |  Branch (271:9): [True: 51.0k, False: 0]
  ------------------
  272|  51.0k|        assert(src->data[0] != NULL);
  ------------------
  |  |  140|  51.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 51.0k]
  |  |  |  Branch (140:68): [Folded, False: 51.0k]
  |  |  ------------------
  ------------------
  273|       |
  274|  51.0k|    *dst = *src;
  275|  51.0k|    memset(src, 0, sizeof(*src));
  276|  51.0k|}
dav1d_thread_picture_ref:
  280|   409k|{
  281|   409k|    dav1d_picture_ref(&dst->p, &src->p);
  282|   409k|    dst->visible = src->visible;
  283|   409k|    dst->showable = src->showable;
  284|   409k|    dst->progress = src->progress;
  285|   409k|    dst->flags = src->flags;
  286|   409k|}
dav1d_thread_picture_move_ref:
  290|  22.0k|{
  291|  22.0k|    dav1d_picture_move_ref(&dst->p, &src->p);
  292|  22.0k|    dst->visible = src->visible;
  293|  22.0k|    dst->showable = src->showable;
  294|  22.0k|    dst->progress = src->progress;
  295|  22.0k|    dst->flags = src->flags;
  296|  22.0k|    memset(src, 0, sizeof(*src));
  297|  22.0k|}
dav1d_picture_unref_internal:
  299|   627k|void dav1d_picture_unref_internal(Dav1dPicture *const p) {
  300|   627k|    validate_input(p != NULL);
  ------------------
  |  |   59|   627k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   627k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 627k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  301|       |
  302|   627k|    if (p->ref) {
  ------------------
  |  Branch (302:9): [True: 501k, False: 126k]
  ------------------
  303|   501k|        validate_input(p->data[0] != NULL);
  ------------------
  |  |   59|   501k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   501k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 501k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|      0|#define debug_print(...) do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (35:39): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define debug_abort() do {} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:36): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  304|   501k|        dav1d_ref_dec(&p->ref);
  305|   501k|    }
  306|   627k|    dav1d_ref_dec(&p->seq_hdr_ref);
  307|   627k|    dav1d_ref_dec(&p->frame_hdr_ref);
  308|   627k|    dav1d_ref_dec(&p->m.user_data.ref);
  309|   627k|    dav1d_ref_dec(&p->content_light_ref);
  310|   627k|    dav1d_ref_dec(&p->mastering_display_ref);
  311|   627k|    dav1d_ref_dec(&p->itut_t35_ref);
  312|   627k|    memset(p, 0, sizeof(*p));
  313|   627k|    dav1d_data_props_set_defaults(&p->m);
  314|   627k|}
dav1d_thread_picture_unref:
  316|   498k|void dav1d_thread_picture_unref(Dav1dThreadPicture *const p) {
  317|   498k|    dav1d_picture_unref_internal(&p->p);
  318|       |
  319|       |    p->progress = NULL;
  320|   498k|}
dav1d_picture_get_event_flags:
  322|  45.5k|enum Dav1dEventFlags dav1d_picture_get_event_flags(const Dav1dThreadPicture *const p) {
  323|  45.5k|    if (!p->flags)
  ------------------
  |  Branch (323:9): [True: 0, False: 45.5k]
  ------------------
  324|      0|        return 0;
  325|       |
  326|  45.5k|    enum Dav1dEventFlags flags = 0;
  327|  45.5k|    if (p->flags & PICTURE_FLAG_NEW_SEQUENCE)
  ------------------
  |  Branch (327:9): [True: 45.5k, False: 0]
  ------------------
  328|  45.5k|       flags |= DAV1D_EVENT_FLAG_NEW_SEQUENCE;
  329|  45.5k|    if (p->flags & PICTURE_FLAG_NEW_OP_PARAMS_INFO)
  ------------------
  |  Branch (329:9): [True: 0, False: 45.5k]
  ------------------
  330|      0|       flags |= DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO;
  331|       |
  332|  45.5k|    return flags;
  333|  45.5k|}
picture.c:picture_alloc:
  117|  45.5k|{
  118|  45.5k|    if (p->data[0]) {
  ------------------
  |  Branch (118:9): [True: 0, False: 45.5k]
  ------------------
  119|      0|        dav1d_log(c, "Picture already allocated!\n");
  ------------------
  |  |   39|      0|#define dav1d_log dav1d_log
  ------------------
  120|      0|        return -1;
  121|      0|    }
  122|  45.5k|    assert(bpc > 0 && bpc <= 16);
  ------------------
  |  |  140|  91.0k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 45.5k, False: 0]
  |  |  |  Branch (140:30): [True: 45.5k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 45.5k]
  |  |  ------------------
  ------------------
  123|       |
  124|  45.5k|    size_t extra = c->n_fc > 1 ? sizeof(atomic_int) * 2 : 0;
  ------------------
  |  Branch (124:20): [True: 0, False: 45.5k]
  ------------------
  125|  45.5k|    struct pic_ctx_context *pic_ctx = dav1d_mem_pool_pop(c->pic_ctx_pool, extra +
  126|  45.5k|                                                         sizeof(struct pic_ctx_context));
  127|  45.5k|    if (!pic_ctx)
  ------------------
  |  Branch (127:9): [True: 0, False: 45.5k]
  ------------------
  128|      0|        return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  129|       |
  130|  45.5k|    p->p.w = w;
  131|  45.5k|    p->p.h = h;
  132|  45.5k|    p->seq_hdr = seq_hdr;
  133|  45.5k|    p->frame_hdr = frame_hdr;
  134|  45.5k|    p->p.layout = seq_hdr->layout;
  135|  45.5k|    p->p.bpc = bpc;
  136|  45.5k|    dav1d_data_props_set_defaults(&p->m);
  137|  45.5k|    const int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
  138|  45.5k|    if (res < 0) {
  ------------------
  |  Branch (138:9): [True: 0, False: 45.5k]
  ------------------
  139|      0|        dav1d_mem_pool_push(c->pic_ctx_pool, pic_ctx);
  140|      0|        return res;
  141|      0|    }
  142|       |
  143|  45.5k|    pic_ctx->allocator = *p_allocator;
  144|  45.5k|    pic_ctx->pic = *p;
  145|  45.5k|    p->ref = dav1d_ref_init(&pic_ctx->ref, pic_ctx, free_buffer, c->pic_ctx_pool, 0);
  146|       |
  147|  45.5k|    p->seq_hdr_ref = seq_hdr_ref;
  148|  45.5k|    if (seq_hdr_ref) dav1d_ref_inc(seq_hdr_ref);
  ------------------
  |  Branch (148:9): [True: 45.5k, False: 0]
  ------------------
  149|       |
  150|  45.5k|    p->frame_hdr_ref = frame_hdr_ref;
  151|  45.5k|    if (frame_hdr_ref) dav1d_ref_inc(frame_hdr_ref);
  ------------------
  |  Branch (151:9): [True: 45.5k, False: 0]
  ------------------
  152|       |
  153|  45.5k|    if (extra && extra_ptr)
  ------------------
  |  Branch (153:9): [True: 0, False: 45.5k]
  |  Branch (153:18): [True: 0, False: 0]
  ------------------
  154|      0|        *extra_ptr = &pic_ctx->extra_data;
  155|       |
  156|  45.5k|    return 0;
  157|  45.5k|}
picture.c:free_buffer:
   91|  45.5k|static void free_buffer(const uint8_t *const data, void *const user_data) {
   92|  45.5k|    struct pic_ctx_context *pic_ctx = (struct pic_ctx_context*)data;
   93|       |
   94|  45.5k|    pic_ctx->allocator.release_picture_callback(&pic_ctx->pic,
   95|  45.5k|                                                pic_ctx->allocator.cookie);
   96|  45.5k|    dav1d_mem_pool_push(user_data, pic_ctx);
   97|  45.5k|}

dav1d_init_qm_tables:
 4684|      1|COLD void dav1d_init_qm_tables(void) {
 4685|       |    // This function is guaranteed to be called only once
 4686|       |
 4687|     16|    for (int i = 0; i < 15; i++)
  ------------------
  |  Branch (4687:21): [True: 15, False: 1]
  ------------------
 4688|     45|        for (int j = 0; j < 2; j++) {
  ------------------
  |  Branch (4688:25): [True: 30, False: 15]
  ------------------
 4689|       |            // note that the w/h in the assignment is inverted, this is on purpose
 4690|       |            // because we store coefficients transposed
 4691|     30|            dav1d_qm_tbl[i][j][RTX_4X8  ] = qm_tbl_8x4[i][j];
 4692|     30|            dav1d_qm_tbl[i][j][RTX_8X4  ] = qm_tbl_4x8[i][j];
 4693|     30|            dav1d_qm_tbl[i][j][RTX_4X16 ] = qm_tbl_16x4[i][j];
 4694|     30|            dav1d_qm_tbl[i][j][RTX_16X4 ] = qm_tbl_4x16[i][j];
 4695|     30|            dav1d_qm_tbl[i][j][RTX_8X16 ] = qm_tbl_16x8[i][j];
 4696|     30|            dav1d_qm_tbl[i][j][RTX_16X8 ] = qm_tbl_8x16[i][j];
 4697|     30|            dav1d_qm_tbl[i][j][RTX_8X32 ] = qm_tbl_32x8[i][j];
 4698|     30|            dav1d_qm_tbl[i][j][RTX_32X8 ] = qm_tbl_8x32[i][j];
 4699|     30|            dav1d_qm_tbl[i][j][RTX_16X32] = qm_tbl_32x16[i][j];
 4700|     30|            dav1d_qm_tbl[i][j][RTX_32X16] = qm_tbl_16x32[i][j];
 4701|       |
 4702|     30|            dav1d_qm_tbl[i][j][ TX_4X4  ] = qm_tbl_4x4[i][j];
 4703|     30|            dav1d_qm_tbl[i][j][ TX_8X8  ] = qm_tbl_8x8[i][j];
 4704|     30|            dav1d_qm_tbl[i][j][ TX_16X16] = qm_tbl_16x16[i][j];
 4705|     30|            dav1d_qm_tbl[i][j][ TX_32X32] = qm_tbl_32x32[i][j];
 4706|       |
 4707|     30|            dav1d_qm_tbl[i][j][ TX_64X64] = dav1d_qm_tbl[i][j][ TX_32X32];
 4708|     30|            dav1d_qm_tbl[i][j][RTX_64X32] = dav1d_qm_tbl[i][j][ TX_32X32];
 4709|     30|            dav1d_qm_tbl[i][j][RTX_64X16] = dav1d_qm_tbl[i][j][RTX_32X16];
 4710|     30|            dav1d_qm_tbl[i][j][RTX_32X64] = dav1d_qm_tbl[i][j][ TX_32X32];
 4711|     30|            dav1d_qm_tbl[i][j][RTX_16X64] = dav1d_qm_tbl[i][j][RTX_16X32];
 4712|     30|        }
 4713|       |
 4714|       |    // dav1d_qm_tbl[15][*][*] == NULL
 4715|      1|}

dav1d_recon_b_intra_8bpc:
 1179|   796k|{
 1180|   796k|    Dav1dTileState *const ts = t->ts;
 1181|   796k|    const Dav1dFrameContext *const f = t->f;
 1182|   796k|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|   796k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|   796k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|   796k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|   796k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|   796k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|   796k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|   796k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|   796k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|   796k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 331k, False: 465k]
  ------------------
 1192|   331k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 331k, False: 0]
  |  Branch (1192:45): [True: 0, False: 0]
  ------------------
 1193|   331k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 331k, False: 0]
  |  Branch (1193:45): [True: 0, False: 0]
  ------------------
 1194|   796k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   796k|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|   796k|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   51|   796k|#define bitfn(x) x##_8bpc
  ------------------
 1199|   796k|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|   796k|    const int intra_edge_filter_flag = f->seq_hdr->intra_edge_filter << 10;
 1202|       |
 1203|  1.61M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (1203:26): [True: 798k, False: 820k]
  ------------------
 1204|   798k|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|   798k|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|  1.61M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 796k, False: 821k]
  ------------------
 1207|   796k|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 0, False: 796k]
  ------------------
 1208|      0|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|      0|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1210|      0|                const uint8_t *pal_idx;
 1211|      0|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 0, False: 0]
  ------------------
 1212|      0|                    const int p = t->frame_thread.pass & 1;
 1213|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1214|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|      0|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|      0|                } else {
 1217|      0|                    pal_idx = t->scratch.pal_idx_y;
 1218|      0|                }
 1219|      0|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 0, False: 0]
  ------------------
 1220|      0|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|      0|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|      0|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1223|      0|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|      0|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|      0|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1226|      0|                    hex_dump(dst, PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1227|      0|                             bw4 * 4, bh4 * 4, "y-pal-pred");
 1228|      0|            }
 1229|       |
 1230|   796k|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|   796k|                                     sm_flag(&t->l, by4) |
 1232|   796k|                                     intra_edge_filter_flag);
 1233|   796k|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 0, False: 796k]
  |  Branch (1233:58): [True: 0, False: 796k]
  ------------------
 1234|   796k|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|   796k|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 0, False: 796k]
  |  Branch (1235:48): [True: 0, False: 796k]
  ------------------
 1236|   796k|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|   796k|            int y, x;
 1238|   796k|            const int sub_w4 = imin(w4, init_x + 16);
 1239|  1.81M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 995k, False: 814k]
  ------------------
 1240|  1.01M|                 y += t_dim->h, t->by += t_dim->h)
 1241|   995k|            {
 1242|   995k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|   995k|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
  ------------------
  |  |   53|   995k|#define PXSTRIDE(x) (x)
  ------------------
 1244|   995k|                                    t->bx + init_x);
 1245|  2.42M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 1.41M, False: 1.01M]
  ------------------
 1246|  1.43M|                     x += t_dim->w, t->bx += t_dim->w)
 1247|  1.41M|                {
 1248|  1.41M|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 0, False: 1.41M]
  ------------------
 1249|       |
 1250|  1.41M|                    int angle = b->y_angle;
 1251|  1.41M|                    const enum EdgeFlags edge_flags =
 1252|  1.41M|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 420k, False: 996k]
  |  Branch (1252:42): [True: 266k, False: 729k]
  |  Branch (1252:57): [True: 420k, False: 280k]
  ------------------
 1253|  1.00M|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|  1.41M|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 420k, False: 996k]
  |  Branch (1254:42): [True: 607k, False: 389k]
  |  Branch (1254:56): [True: 483k, False: 124k]
  ------------------
 1255|   905k|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|  1.41M|                    const pixel *top_sb_edge = NULL;
 1257|  1.41M|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 221k, False: 1.19M]
  ------------------
 1258|   221k|                        top_sb_edge = f->ipred_edge[0];
 1259|   221k|                        const int sby = t->by >> f->sb_shift;
 1260|   221k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|   221k|                    }
 1262|  1.41M|                    const enum IntraPredMode m =
 1263|  1.41M|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|  1.41M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  1.41M|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1264|  1.41M|                                                          t->bx > ts->tiling.col_start,
 1265|  1.41M|                                                          t->by,
 1266|  1.41M|                                                          t->by > ts->tiling.row_start,
 1267|  1.41M|                                                          ts->tiling.col_end,
 1268|  1.41M|                                                          ts->tiling.row_end,
 1269|  1.41M|                                                          edge_flags, dst,
 1270|  1.41M|                                                          f->cur.stride[0], top_sb_edge,
 1271|  1.41M|                                                          b->y_mode, &angle,
 1272|  1.41M|                                                          t_dim->w, t_dim->h,
 1273|  1.41M|                                                          f->seq_hdr->intra_edge_filter,
 1274|  1.41M|                                                          edge HIGHBD_CALL_SUFFIX);
 1275|  1.41M|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|  1.41M|                                             t_dim->w * 4, t_dim->h * 4,
 1277|  1.41M|                                             angle | intra_flags,
 1278|  1.41M|                                             4 * f->bw - 4 * t->bx,
 1279|  1.41M|                                             4 * f->bh - 4 * t->by
 1280|  1.41M|                                             HIGHBD_CALL_SUFFIX);
 1281|       |
 1282|  1.41M|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  1.41M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.41M]
  |  |  ------------------
  |  |   35|  1.41M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.41M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                  if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1283|      0|                        hex_dump(edge - t_dim->h * 4, t_dim->h * 4,
 1284|      0|                                 t_dim->h * 4, 2, "l");
 1285|      0|                        hex_dump(edge, 0, 1, 1, "tl");
 1286|      0|                        hex_dump(edge + 1, t_dim->w * 4,
 1287|      0|                                 t_dim->w * 4, 2, "t");
 1288|      0|                        hex_dump(dst, f->cur.stride[0],
 1289|      0|                                 t_dim->w * 4, t_dim->h * 4, "y-intra-pred");
 1290|      0|                    }
 1291|       |
 1292|  1.43M|                skip_y_pred: {}
 1293|  1.43M|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 1.43M, False: 18.4E]
  ------------------
 1294|  1.43M|                        coef *cf;
 1295|  1.43M|                        int eob;
 1296|  1.43M|                        enum TxfmType txtp;
 1297|  1.43M|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 0, False: 1.43M]
  ------------------
 1298|      0|                            const int p = t->frame_thread.pass & 1;
 1299|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|      0|                            cf = ts->frame_thread[p].cf;
 1301|      0|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|      0|                            eob  = cbi >> 5;
 1303|      0|                            txtp = cbi & 0x1f;
 1304|  1.43M|                        } else {
 1305|  1.43M|                            uint8_t cf_ctx;
 1306|  1.43M|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|  1.43M|#define bitfn(x) x##_8bpc
  ------------------
 1307|  1.43M|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|  1.43M|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|  1.43M|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|  1.43M|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.43M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.43M]
  |  |  ------------------
  |  |   35|  1.43M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.43M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1311|      0|                                printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
 1312|      0|                                       b->tx, txtp, eob, ts->msac.rng);
 1313|  1.43M|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|  1.43M|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|  1.43M|                        }
 1316|  1.43M|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 1.35M, False: 77.4k]
  ------------------
 1317|  1.35M|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  1.35M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.35M]
  |  |  ------------------
  |  |   35|  1.35M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.35M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1318|      0|                                coef_dump(cf, imin(t_dim->h, 8) * 4,
 1319|      0|                                          imin(t_dim->w, 8) * 4, 3, "dq");
 1320|  1.35M|                            dsp->itx.itxfm_add[b->tx]
 1321|  1.35M|                                              [txtp](dst,
 1322|  1.35M|                                                     f->cur.stride[0],
 1323|  1.35M|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1324|  1.35M|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  1.35M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.35M]
  |  |  ------------------
  |  |   35|  1.35M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  1.35M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1325|      0|                                hex_dump(dst, f->cur.stride[0],
 1326|      0|                                         t_dim->w * 4, t_dim->h * 4, "recon");
 1327|  1.35M|                        }
 1328|  18.4E|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 0, False: 18.4E]
  ------------------
 1329|      0|                        dav1d_memset_pow2[t_dim->lw](&t->a->lcoef[bx4 + x], 0x40);
 1330|      0|                        dav1d_memset_pow2[t_dim->lh](&t->l.lcoef[by4 + y], 0x40);
 1331|      0|                    }
 1332|  1.43M|                    dst += 4 * t_dim->w;
 1333|  1.43M|                }
 1334|  1.01M|                t->bx -= x;
 1335|  1.01M|            }
 1336|   814k|            t->by -= y;
 1337|       |
 1338|   814k|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 463k, False: 351k]
  ------------------
 1339|       |
 1340|   351k|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|   351k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 123k, False: 228k]
  ------------------
 1343|   123k|                assert(!init_x && !init_y);
  ------------------
  |  |  140|   246k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 123k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 123k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 123k]
  |  |  ------------------
  ------------------
 1344|       |
 1345|   123k|                int16_t *const ac = t->scratch.ac;
 1346|   123k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|   123k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|   123k|#define PXSTRIDE(x) (x)
  ------------------
 1348|   123k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|   123k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
  ------------------
  |  |   53|   123k|#define PXSTRIDE(x) (x)
  ------------------
 1350|   123k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|   123k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|   123k|                const int furthest_r =
 1354|   123k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|   123k|                const int furthest_b =
 1356|   123k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|   123k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|   123k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|   123k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|   123k|                                                         cbw4 * 4, cbh4 * 4);
 1361|   370k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 246k, False: 123k]
  ------------------
 1362|   246k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 23.0k, False: 223k]
  ------------------
 1363|   223k|                    int angle = 0;
 1364|   223k|                    const pixel *top_sb_edge = NULL;
 1365|   223k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 43.3k, False: 180k]
  ------------------
 1366|  43.3k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|  43.3k|                        const int sby = t->by >> f->sb_shift;
 1368|  43.3k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|  43.3k|                    }
 1370|   223k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|   223k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|   223k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|   223k|                    const enum IntraPredMode m =
 1374|   223k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|   223k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   223k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1375|   223k|                                                          ypos, ypos > ystart,
 1376|   223k|                                                          ts->tiling.col_end >> ss_hor,
 1377|   223k|                                                          ts->tiling.row_end >> ss_ver,
 1378|   223k|                                                          0, uv_dst[pl], stride,
 1379|   223k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|   223k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|   223k|                                                          edge HIGHBD_CALL_SUFFIX);
 1382|   223k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|   223k|                                           uv_t_dim->w * 4,
 1384|   223k|                                           uv_t_dim->h * 4,
 1385|   223k|                                           ac, b->cfl_alpha[pl]
 1386|   223k|                                           HIGHBD_CALL_SUFFIX);
 1387|   223k|                }
 1388|   123k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   123k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 123k]
  |  |  ------------------
  |  |   35|   123k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   123k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1389|      0|                    ac_dump(ac, 4*cbw4, 4*cbh4, "ac");
 1390|      0|                    hex_dump(uv_dst[0], stride, cbw4 * 4, cbh4 * 4, "u-cfl-pred");
 1391|      0|                    hex_dump(uv_dst[1], stride, cbw4 * 4, cbh4 * 4, "v-cfl-pred");
 1392|      0|                }
 1393|   228k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 0, False: 228k]
  ------------------
 1394|      0|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|      0|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1396|      0|                const pixel (*pal)[8];
 1397|      0|                const uint8_t *pal_idx;
 1398|      0|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 0, False: 0]
  ------------------
 1399|      0|                    const int p = t->frame_thread.pass & 1;
 1400|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1401|      0|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|      0|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|      0|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|      0|                } else {
 1406|      0|                    pal = bytefn(t->scratch.pal);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1407|      0|                    pal_idx = t->scratch.pal_idx_uv;
 1408|      0|                }
 1409|       |
 1410|      0|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|      0|                                       f->cur.stride[1], pal[1],
 1412|      0|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|      0|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|      0|                                       f->cur.stride[1], pal[2],
 1415|      0|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|      0|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1417|      0|                    hex_dump(((pixel *) f->cur.data[1]) + uv_dstoff,
 1418|      0|                             PXSTRIDE(f->cur.stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1419|      0|                             cbw4 * 4, cbh4 * 4, "u-pal-pred");
 1420|      0|                    hex_dump(((pixel *) f->cur.data[2]) + uv_dstoff,
 1421|      0|                             PXSTRIDE(f->cur.stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1422|      0|                             cbw4 * 4, cbh4 * 4, "v-pal-pred");
 1423|      0|                }
 1424|      0|            }
 1425|       |
 1426|   351k|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|   351k|                                 sm_uv_flag(&t->l, cby4);
 1428|   351k|            const int uv_sb_has_tr =
 1429|   351k|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 0, False: 351k]
  |  Branch (1429:55): [True: 0, False: 351k]
  ------------------
 1430|   351k|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|   351k|            const int uv_sb_has_bl =
 1432|   351k|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 0, False: 351k]
  |  Branch (1432:30): [True: 0, False: 351k]
  ------------------
 1433|   351k|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|   351k|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|  1.00M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 651k, False: 356k]
  ------------------
 1436|  1.31M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 662k, False: 656k]
  ------------------
 1437|   668k|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|   662k|                {
 1439|   662k|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|   662k|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
  ------------------
  |  |   53|   662k|#define PXSTRIDE(x) (x)
  ------------------
 1441|   662k|                                        ((t->bx + init_x) >> ss_hor));
 1442|  1.35M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 683k, False: 668k]
  ------------------
 1443|   689k|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|   683k|                    {
 1445|   683k|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 246k, False: 437k]
  |  Branch (1445:56): [True: 223k, False: 22.8k]
  ------------------
 1446|   463k|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 18.4E, False: 463k]
  ------------------
 1447|   223k|                        {
 1448|   223k|                            goto skip_uv_pred;
 1449|   223k|                        }
 1450|       |
 1451|   460k|                        int angle = b->uv_angle;
 1452|       |                        // this probably looks weird because we're using
 1453|       |                        // luma flags in a chroma loop, but that's because
 1454|       |                        // prepare_intra_edges() expects luma flags as input
 1455|   460k|                        const enum EdgeFlags edge_flags =
 1456|   460k|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 19.3k, False: 440k]
  |  Branch (1456:58): [True: 117k, False: 323k]
  ------------------
 1457|   145k|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 129k, False: 15.1k]
  ------------------
 1458|   331k|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|   460k|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 13.8k, False: 446k]
  ------------------
 1460|   446k|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 272k, False: 173k]
  |  Branch (1460:49): [True: 266k, False: 5.81k]
  ------------------
 1461|   283k|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|   460k|                        const pixel *top_sb_edge = NULL;
 1463|   460k|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 98.7k, False: 361k]
  ------------------
 1464|  98.7k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|  98.7k|                            const int sby = t->by >> f->sb_shift;
 1466|  98.7k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|  98.7k|                        }
 1468|   460k|                        const enum IntraPredMode uv_mode =
 1469|   460k|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 23.0k, False: 436k]
  ------------------
 1470|   460k|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|   460k|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|   460k|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|   460k|                        const enum IntraPredMode m =
 1474|   460k|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|   460k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   460k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1475|   460k|                                                              ypos, ypos > ystart,
 1476|   460k|                                                              ts->tiling.col_end >> ss_hor,
 1477|   460k|                                                              ts->tiling.row_end >> ss_ver,
 1478|   460k|                                                              edge_flags, dst, stride,
 1479|   460k|                                                              top_sb_edge, uv_mode,
 1480|   460k|                                                              &angle, uv_t_dim->w,
 1481|   460k|                                                              uv_t_dim->h,
 1482|   460k|                                                              f->seq_hdr->intra_edge_filter,
 1483|   460k|                                                              edge HIGHBD_CALL_SUFFIX);
 1484|   460k|                        angle |= intra_edge_filter_flag;
 1485|   460k|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|   460k|                                                 uv_t_dim->w * 4,
 1487|   460k|                                                 uv_t_dim->h * 4,
 1488|   460k|                                                 angle | sm_uv_fl,
 1489|   460k|                                                 (4 * f->bw + ss_hor -
 1490|   460k|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|   460k|                                                 (4 * f->bh + ss_ver -
 1492|   460k|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|   460k|                                                 HIGHBD_CALL_SUFFIX);
 1494|   460k|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   460k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 460k]
  |  |  ------------------
  |  |   35|   460k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   460k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                      if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1495|      0|                            hex_dump(edge - uv_t_dim->h * 4, uv_t_dim->h * 4,
 1496|      0|                                     uv_t_dim->h * 4, 2, "l");
 1497|      0|                            hex_dump(edge, 0, 1, 1, "tl");
 1498|      0|                            hex_dump(edge + 1, uv_t_dim->w * 4,
 1499|      0|                                     uv_t_dim->w * 4, 2, "t");
 1500|      0|                            hex_dump(dst, stride, uv_t_dim->w * 4,
 1501|      0|                                     uv_t_dim->h * 4, pl ? "v-intra-pred" : "u-intra-pred");
  ------------------
  |  Branch (1501:55): [True: 0, False: 0]
  ------------------
 1502|      0|                        }
 1503|       |
 1504|   689k|                    skip_uv_pred: {}
 1505|   689k|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 689k, False: 18.4E]
  ------------------
 1506|   689k|                            enum TxfmType txtp;
 1507|   689k|                            int eob;
 1508|   689k|                            coef *cf;
 1509|   689k|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 0, False: 689k]
  ------------------
 1510|      0|                                const int p = t->frame_thread.pass & 1;
 1511|      0|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|      0|                                cf = ts->frame_thread[p].cf;
 1513|      0|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|      0|                                eob  = cbi >> 5;
 1515|      0|                                txtp = cbi & 0x1f;
 1516|   689k|                            } else {
 1517|   689k|                                uint8_t cf_ctx;
 1518|   689k|                                cf = bitfn(t->cf);
  ------------------
  |  |   51|   689k|#define bitfn(x) x##_8bpc
  ------------------
 1519|   689k|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|   689k|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|   689k|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|   689k|                                                   &txtp, &cf_ctx);
 1523|   689k|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   689k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 689k]
  |  |  ------------------
  |  |   35|   689k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   689k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1524|      0|                                    printf("Post-uv-cf-blk[pl=%d,tx=%d,"
 1525|      0|                                           "txtp=%d,eob=%d]: r=%d [x=%d,cbx4=%d]\n",
 1526|      0|                                           pl, b->uvtx, txtp, eob, ts->msac.rng, x, cbx4);
 1527|   689k|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|   689k|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|   689k|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|   689k|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|   689k|                            }
 1532|   689k|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 629k, False: 59.5k]
  ------------------
 1533|   629k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   629k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 629k]
  |  |  ------------------
  |  |   35|   629k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   629k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1534|      0|                                    coef_dump(cf, uv_t_dim->h * 4,
 1535|      0|                                              uv_t_dim->w * 4, 3, "dq");
 1536|   629k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   629k|                                                  [txtp](dst, stride,
 1538|   629k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
 1539|   629k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   629k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 629k]
  |  |  ------------------
  |  |   35|   629k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   629k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1540|      0|                                    hex_dump(dst, stride, uv_t_dim->w * 4,
 1541|      0|                                             uv_t_dim->h * 4, "recon");
 1542|   629k|                            }
 1543|  18.4E|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 0, False: 18.4E]
  ------------------
 1544|      0|                            dav1d_memset_pow2[uv_t_dim->lw](&t->a->ccoef[pl][cbx4 + x], 0x40);
 1545|      0|                            dav1d_memset_pow2[uv_t_dim->lh](&t->l.ccoef[pl][cby4 + y], 0x40);
 1546|      0|                        }
 1547|   689k|                        dst += uv_t_dim->w * 4;
 1548|   689k|                    }
 1549|   668k|                    t->bx -= x << ss_hor;
 1550|   668k|                }
 1551|   656k|                t->by -= y << ss_ver;
 1552|   656k|            }
 1553|   351k|        }
 1554|   798k|    }
 1555|   796k|}
dav1d_recon_b_inter_8bpc:
 1559|   284k|{
 1560|   284k|    Dav1dTileState *const ts = t->ts;
 1561|   284k|    const Dav1dFrameContext *const f = t->f;
 1562|   284k|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|   284k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|   284k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|   284k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|   284k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|   284k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|   284k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|   284k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|   284k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 71.5k, False: 213k]
  ------------------
 1571|  71.5k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 71.5k, False: 0]
  |  Branch (1571:45): [True: 0, False: 0]
  ------------------
 1572|  71.5k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 71.5k, False: 0]
  |  Branch (1572:45): [True: 0, False: 0]
  ------------------
 1573|   284k|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 213k, False: 71.6k]
  ------------------
 1574|   284k|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|   284k|    int res;
 1576|       |
 1577|       |    // prediction
 1578|   284k|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|   284k|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|   284k|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|   284k|#define PXSTRIDE(x) (x)
  ------------------
 1581|   284k|    const ptrdiff_t uvdstoff =
 1582|   284k|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|   284k|#define PXSTRIDE(x) (x)
  ------------------
 1583|   284k|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|   284k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   284k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 0, False: 284k]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|      0|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1586|      0|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|      0|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|      0|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 0]
  ------------------
 1589|      0|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 0, False: 0]
  |  Branch (1589:42): [True: 0, False: 0]
  ------------------
 1590|      0|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|      0|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|      0|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|      0|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|      0|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 0]
  ------------------
 1595|      0|        }
 1596|   284k|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 284k, False: 144]
  ------------------
 1597|   284k|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|   284k|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|   284k|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 284k, False: 247]
  ------------------
 1601|   284k|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 8.16k, False: 276k]
  |  Branch (1601:44): [True: 0, False: 8.16k]
  ------------------
 1602|   284k|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 3.89k, False: 280k]
  |  Branch (1602:44): [True: 3.89k, False: 1]
  ------------------
 1603|  3.89k|        {
 1604|  3.89k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|  3.89k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 3.89k, False: 18.4E]
  ------------------
 1606|  18.4E|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|  3.89k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 3.89k]
  ------------------
 1608|   280k|        } else {
 1609|   280k|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|   280k|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|   280k|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 280k]
  ------------------
 1612|   280k|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 0, False: 280k]
  ------------------
 1613|      0|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|      0|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 0]
  ------------------
 1615|      0|            }
 1616|   280k|        }
 1617|   284k|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 0, False: 284k]
  ------------------
 1618|      0|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|      0|#define bitfn(x) x##_8bpc
  ------------------
 1619|      0|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 0, False: 0]
  ------------------
 1620|      0|                                   SMOOTH_PRED : b->interintra_mode;
 1621|      0|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|      0|#define bitfn(x) x##_8bpc
  ------------------
 1622|      0|            int angle = 0;
 1623|      0|            const pixel *top_sb_edge = NULL;
 1624|      0|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 0, False: 0]
  ------------------
 1625|      0|                top_sb_edge = f->ipred_edge[0];
 1626|      0|                const int sby = t->by >> f->sb_shift;
 1627|      0|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|      0|            }
 1629|      0|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1630|      0|                                                  t->by, t->by > ts->tiling.row_start,
 1631|      0|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|      0|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|      0|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|      0|                                                  HIGHBD_CALL_SUFFIX);
 1635|      0|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|      0|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|      0|                                     HIGHBD_CALL_SUFFIX);
 1638|      0|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|      0|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|      0|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|      0|        }
 1641|       |
 1642|   284k|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 213k, False: 71.3k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|  71.6k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 18.4E, False: 71.6k]
  |  Branch (1645:42): [True: 18.4E, False: 71.6k]
  ------------------
 1646|  71.3k|        refmvs_block *const *r;
 1647|  71.3k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 71.3k]
  ------------------
 1648|      0|            assert(ss_hor == 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1649|      0|            r = &t->rt.r[(t->by & 31) + 5];
 1650|      0|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 0, False: 0]
  ------------------
 1651|      0|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 0, False: 0]
  ------------------
 1652|      0|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 0, False: 0]
  |  Branch (1652:29): [True: 0, False: 0]
  ------------------
 1653|      0|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|      0|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|  71.3k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 0, False: 71.3k]
  ------------------
 1658|      0|            assert(ss_hor == 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1659|      0|            ptrdiff_t h_off = 0, v_off = 0;
 1660|      0|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 0, False: 0]
  |  Branch (1660:29): [True: 0, False: 0]
  ------------------
 1661|      0|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 0, False: 0]
  ------------------
 1662|      0|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|      0|                             NULL, f->cur.stride[1],
 1664|      0|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|      0|                             r[-1][t->bx - 1].mv.mv[0],
 1666|      0|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|      0|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|      0|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 0, False: 0]
  ------------------
 1669|      0|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|      0|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 0]
  ------------------
 1671|      0|                }
 1672|      0|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1673|      0|                h_off = 2;
 1674|      0|            }
 1675|      0|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 0, False: 0]
  ------------------
 1676|      0|                const enum Filter2d left_filter_2d =
 1677|      0|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|      0|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 0, False: 0]
  ------------------
 1679|      0|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|      0|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|      0|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|      0|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|      0|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|      0|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 0, False: 0]
  ------------------
 1685|      0|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|      0|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 0]
  ------------------
 1687|      0|                }
 1688|      0|                h_off = 2;
 1689|      0|            }
 1690|      0|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 0, False: 0]
  ------------------
 1691|      0|                const enum Filter2d top_filter_2d =
 1692|      0|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|      0|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 0, False: 0]
  ------------------
 1694|      0|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|      0|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|      0|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|      0|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|      0|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|      0|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 0, False: 0]
  ------------------
 1700|      0|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|      0|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 0]
  ------------------
 1702|      0|                }
 1703|      0|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
 1704|      0|            }
 1705|      0|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 0, False: 0]
  ------------------
 1706|      0|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|      0|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|      0|                         refp, b->ref[0], filter_2d);
 1709|      0|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 0]
  ------------------
 1710|      0|            }
 1711|  71.3k|        } else {
 1712|  71.3k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 26.9k, False: 44.4k]
  ------------------
 1713|  26.9k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 962, False: 25.9k]
  |  Branch (1713:48): [True: 0, False: 962]
  ------------------
 1714|  26.9k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 937, False: 25.9k]
  |  Branch (1714:48): [True: 937, False: 0]
  ------------------
 1715|    937|            {
 1716|  2.80k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 1.87k, False: 937]
  ------------------
 1717|  1.87k|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|  1.87k|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|  1.87k|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 1.87k, False: 18.4E]
  ------------------
 1720|  18.4E|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|  1.87k|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 1.87k]
  ------------------
 1722|  1.87k|                }
 1723|  70.4k|            } else {
 1724|   211k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 141k, False: 70.4k]
  ------------------
 1725|   141k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|   141k|                             NULL, f->cur.stride[1],
 1727|   141k|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|   141k|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|   141k|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|   141k|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 141k]
  ------------------
 1731|   141k|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 0, False: 141k]
  ------------------
 1732|      0|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|      0|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|      0|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 0]
  ------------------
 1735|      0|                    }
 1736|   141k|                }
 1737|  70.4k|            }
 1738|  71.3k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 0, False: 71.3k]
  ------------------
 1739|       |                // FIXME for 8x32 with 4:2:2 subsampling, this probably does
 1740|       |                // the wrong thing since it will select 4x16, not 4x32, as a
 1741|       |                // transform size...
 1742|      0|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|      0|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|      0|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 0, False: 0]
  ------------------
 1745|      0|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|      0|#define bitfn(x) x##_8bpc
  ------------------
 1746|      0|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|      0|#define bitfn(x) x##_8bpc
  ------------------
 1747|      0|                    enum IntraPredMode m =
 1748|      0|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 0, False: 0]
  ------------------
 1749|      0|                        SMOOTH_PRED : b->interintra_mode;
 1750|      0|                    int angle = 0;
 1751|      0|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|      0|                    const pixel *top_sb_edge = NULL;
 1753|      0|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 0, False: 0]
  ------------------
 1754|      0|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|      0|                        const int sby = t->by >> f->sb_shift;
 1756|      0|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|      0|                    }
 1758|      0|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1759|      0|                                                          (t->bx >> ss_hor) >
 1760|      0|                                                              (ts->tiling.col_start >> ss_hor),
 1761|      0|                                                          t->by >> ss_ver,
 1762|      0|                                                          (t->by >> ss_ver) >
 1763|      0|                                                              (ts->tiling.row_start >> ss_ver),
 1764|      0|                                                          ts->tiling.col_end >> ss_hor,
 1765|      0|                                                          ts->tiling.row_end >> ss_ver,
 1766|      0|                                                          0, uvdst, f->cur.stride[1],
 1767|      0|                                                          top_sb_edge, m,
 1768|      0|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|      0|                                                          HIGHBD_CALL_SUFFIX);
 1770|      0|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|      0|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|      0|                                             HIGHBD_CALL_SUFFIX);
 1773|      0|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|      0|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|      0|                }
 1776|      0|            }
 1777|  71.3k|        }
 1778|       |
 1779|   284k|    skip_inter_chroma_pred: {}
 1780|   284k|        t->tl_4x4_filter = filter_2d;
 1781|   284k|    } else {
 1782|    144|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|    144|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|    144|        int jnt_weight;
 1786|    144|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|    144|        const uint8_t *mask;
 1788|       |
 1789|    144|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 0, False: 144]
  ------------------
 1790|      0|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|      0|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 0, False: 0]
  |  Branch (1792:55): [True: 0, False: 0]
  ------------------
 1793|      0|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|      0|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|      0|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 0]
  ------------------
 1796|      0|            } else {
 1797|      0|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|      0|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|      0|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 0]
  ------------------
 1800|      0|            }
 1801|      0|        }
 1802|    144|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 0, False: 144]
  ------------------
 1803|      0|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 0, False: 144]
  ------------------
 1804|      0|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|      0|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
 1806|      0|            break;
 1807|      0|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 0, False: 144]
  ------------------
 1808|      0|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|      0|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|      0|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
 1811|      0|            break;
 1812|      0|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 0, False: 144]
  ------------------
 1813|      0|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|      0|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|      0|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|      0|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
 1817|      0|            mask = seg_mask;
 1818|      0|            break;
 1819|      0|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 0, False: 144]
  ------------------
 1820|      0|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|      0|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|      0|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|      0|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|      0|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
 1824|      0|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 0, False: 0]
  ------------------
 1825|      0|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|      0|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|      0|            break;
 1827|    144|        }
 1828|       |
 1829|       |        // chroma
 1830|      0|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 0, False: 0]
  |  Branch (1830:42): [True: 0, False: 0]
  ------------------
 1831|      0|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 0, False: 0]
  ------------------
 1832|      0|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 0, False: 0]
  ------------------
 1834|      0|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 0, False: 0]
  |  Branch (1834:45): [True: 0, False: 0]
  ------------------
 1835|      0|                {
 1836|      0|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|      0|                                      b_dim, 1 + pl,
 1838|      0|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|      0|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 0]
  ------------------
 1840|      0|                } else {
 1841|      0|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|      0|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|      0|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 0]
  ------------------
 1844|      0|                }
 1845|      0|            }
 1846|      0|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|      0|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 0, False: 0]
  ------------------
 1848|      0|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 0, False: 0]
  ------------------
 1849|      0|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|      0|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|      0|                            HIGHBD_CALL_SUFFIX);
 1852|      0|                break;
 1853|      0|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 0, False: 0]
  ------------------
 1854|      0|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|      0|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|      0|                              HIGHBD_CALL_SUFFIX);
 1857|      0|                break;
 1858|      0|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 0, False: 0]
  ------------------
 1859|      0|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 0, False: 0]
  ------------------
 1860|      0|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|      0|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|      0|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|      0|                             HIGHBD_CALL_SUFFIX);
 1864|      0|                break;
 1865|      0|            }
 1866|      0|        }
 1867|      0|    }
 1868|       |
 1869|   284k|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   284k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 284k]
  |  |  ------------------
  |  |   35|   284k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   284k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1870|      0|        hex_dump(dst, f->cur.stride[0], b_dim[0] * 4, b_dim[1] * 4, "y-pred");
 1871|      0|        if (has_chroma) {
  ------------------
  |  Branch (1871:13): [True: 0, False: 0]
  ------------------
 1872|      0|            hex_dump(&((pixel *) f->cur.data[1])[uvdstoff], f->cur.stride[1],
 1873|      0|                     cbw4 * 4, cbh4 * 4, "u-pred");
 1874|      0|            hex_dump(&((pixel *) f->cur.data[2])[uvdstoff], f->cur.stride[1],
 1875|      0|                     cbw4 * 4, cbh4 * 4, "v-pred");
 1876|      0|        }
 1877|      0|    }
 1878|       |
 1879|   284k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|   284k|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 17.5k, False: 267k]
  ------------------
 1882|       |        // reset coef contexts
 1883|  17.5k|        BlockContext *const a = t->a;
 1884|  17.5k|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|  17.5k|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|  17.5k|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 334, False: 17.1k]
  ------------------
 1887|    334|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|    334|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|    334|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|    334|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|    334|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|    334|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|    334|        }
 1894|  17.5k|        return 0;
 1895|  17.5k|    }
 1896|       |
 1897|   267k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|   267k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|   267k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|   534k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 267k, False: 267k]
  ------------------
 1902|   534k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 267k, False: 267k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|   267k|            int y_off = !!init_y, y;
 1905|   267k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
  ------------------
  |  |   53|   267k|#define PXSTRIDE(x) (x)
  ------------------
 1906|   558k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 291k, False: 267k]
  ------------------
 1907|   291k|                 y += ytx->h, y_off++)
 1908|   291k|            {
 1909|   291k|                int x, x_off = !!init_x;
 1910|   636k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 345k, False: 291k]
  ------------------
 1911|   345k|                     x += ytx->w, x_off++)
 1912|   345k|                {
 1913|   345k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|   345k|                                   x_off, y_off, &dst[x * 4]);
 1915|   345k|                    t->bx += ytx->w;
 1916|   345k|                }
 1917|   291k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
  ------------------
  |  |   53|   291k|#define PXSTRIDE(x) (x)
  ------------------
 1918|   291k|                t->bx -= x;
 1919|   291k|                t->by += ytx->h;
 1920|   291k|            }
 1921|   267k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
  ------------------
  |  |   53|   267k|#define PXSTRIDE(x) (x)
  ------------------
 1922|   267k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|   267k|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 71.2k, False: 196k]
  |  Branch (1925:46): [True: 141k, False: 71.2k]
  ------------------
 1926|   141k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|   141k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
  ------------------
  |  |   53|   141k|#define PXSTRIDE(x) (x)
  ------------------
 1928|   141k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|   291k|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 149k, False: 141k]
  ------------------
 1930|   149k|                {
 1931|   149k|                    int x;
 1932|   149k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|   308k|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 158k, False: 149k]
  ------------------
 1934|   158k|                    {
 1935|   158k|                        coef *cf;
 1936|   158k|                        int eob;
 1937|   158k|                        enum TxfmType txtp;
 1938|   158k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 0, False: 158k]
  ------------------
 1939|      0|                            const int p = t->frame_thread.pass & 1;
 1940|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|      0|                            cf = ts->frame_thread[p].cf;
 1942|      0|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|      0|                            eob  = cbi >> 5;
 1944|      0|                            txtp = cbi & 0x1f;
 1945|   158k|                        } else {
 1946|   158k|                            uint8_t cf_ctx;
 1947|   158k|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|   158k|#define bitfn(x) x##_8bpc
  ------------------
 1948|   158k|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|   158k|                                                        bx4 + (x << ss_hor)];
 1950|   158k|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|   158k|                                               &t->l.ccoef[pl][cby4 + y],
 1952|   158k|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|   158k|                                               cf, &txtp, &cf_ctx);
 1954|   158k|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   158k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 158k]
  |  |  ------------------
  |  |   35|   158k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   158k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1955|      0|                                printf("Post-uv-cf-blk[pl=%d,tx=%d,"
 1956|      0|                                       "txtp=%d,eob=%d]: r=%d\n",
 1957|      0|                                       pl, b->uvtx, txtp, eob, ts->msac.rng);
 1958|   158k|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|   158k|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|   158k|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|   158k|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|   158k|                        }
 1963|   158k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 155k, False: 3.23k]
  ------------------
 1964|   155k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   155k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 155k]
  |  |  ------------------
  |  |   35|   155k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   155k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1965|      0|                                coef_dump(cf, uvtx->h * 4, uvtx->w * 4, 3, "dq");
 1966|   155k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|   155k|                                              [txtp](&uvdst[4 * x],
 1968|   155k|                                                     f->cur.stride[1],
 1969|   155k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1970|   155k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   155k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 155k]
  |  |  ------------------
  |  |   35|   155k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   155k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1971|      0|                                hex_dump(&uvdst[4 * x], f->cur.stride[1],
 1972|      0|                                         uvtx->w * 4, uvtx->h * 4, "recon");
 1973|   155k|                        }
 1974|   158k|                        t->bx += uvtx->w << ss_hor;
 1975|   158k|                    }
 1976|   149k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
  ------------------
  |  |   53|   149k|#define PXSTRIDE(x) (x)
  ------------------
 1977|   149k|                    t->bx -= x << ss_hor;
 1978|   149k|                    t->by += uvtx->h << ss_ver;
 1979|   149k|                }
 1980|   141k|                t->by -= y << ss_ver;
 1981|   141k|            }
 1982|   267k|        }
 1983|   267k|    }
 1984|   267k|    return 0;
 1985|   284k|}
dav1d_filter_sbrow_deblock_cols_8bpc:
 1987|  18.6k|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|  18.6k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 0, False: 18.6k]
  ------------------
 1989|  18.6k|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 1.12k, False: 17.5k]
  |  Branch (1989:50): [True: 1.12k, False: 0]
  ------------------
 1990|  1.12k|    {
 1991|  1.12k|        return;
 1992|  1.12k|    }
 1993|  17.5k|    const int y = sby * f->sb_step * 4;
 1994|  17.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|  17.5k|    pixel *const p[3] = {
 1996|  17.5k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  17.5k|#define PXSTRIDE(x) (x)
  ------------------
 1997|  17.5k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  17.5k|#define PXSTRIDE(x) (x)
  ------------------
 1998|  17.5k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  17.5k|#define PXSTRIDE(x) (x)
  ------------------
 1999|  17.5k|    };
 2000|  17.5k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|  17.5k|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|  17.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  17.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2002|  17.5k|                                        f->lf.start_of_tile_row[sby]);
 2003|  17.5k|}
dav1d_filter_sbrow_deblock_rows_8bpc:
 2005|  42.9k|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|  42.9k|    const int y = sby * f->sb_step * 4;
 2007|  42.9k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|  42.9k|    pixel *const p[3] = {
 2009|  42.9k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2010|  42.9k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2011|  42.9k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2012|  42.9k|    };
 2013|  42.9k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|  42.9k|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 42.9k, False: 0]
  ------------------
 2015|  42.9k|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 17.5k, False: 25.3k]
  |  Branch (2015:49): [True: 0, False: 25.3k]
  ------------------
 2016|  17.5k|    {
 2017|  17.5k|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|  17.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  17.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2018|  17.5k|    }
 2019|  42.9k|    if (f->seq_hdr->cdef || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 42.9k, False: 0]
  |  Branch (2019:29): [True: 0, False: 0]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|  42.9k|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|  42.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  42.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2022|  42.9k|    }
 2023|  42.9k|}
dav1d_filter_sbrow_cdef_8bpc:
 2025|  42.9k|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  42.9k|    const Dav1dFrameContext *const f = tc->f;
 2027|  42.9k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_CDEF)) return;
  ------------------
  |  Branch (2027:9): [True: 0, False: 42.9k]
  ------------------
 2028|  42.9k|    const int sbsz = f->sb_step;
 2029|  42.9k|    const int y = sby * sbsz * 4;
 2030|  42.9k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2031|  42.9k|    pixel *const p[3] = {
 2032|  42.9k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2033|  42.9k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2034|  42.9k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  42.9k|#define PXSTRIDE(x) (x)
  ------------------
 2035|  42.9k|    };
 2036|  42.9k|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  42.9k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2038|  42.9k|    const int start = sby * sbsz;
 2039|  42.9k|    if (sby) {
  ------------------
  |  Branch (2039:9): [True: 10.8k, False: 32.1k]
  ------------------
 2040|  10.8k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2041|  10.8k|        pixel *p_up[3] = {
 2042|  10.8k|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  10.8k|#define PXSTRIDE(x) (x)
  ------------------
 2043|  10.8k|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  10.8k|#define PXSTRIDE(x) (x)
  ------------------
 2044|  10.8k|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  10.8k|#define PXSTRIDE(x) (x)
  ------------------
 2045|  10.8k|        };
 2046|  10.8k|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  10.8k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  10.8k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2047|  10.8k|    }
 2048|  42.9k|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2049|  42.9k|    const int end = imin(start + n_blks, f->bh);
 2050|  42.9k|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  42.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  42.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2051|  42.9k|}
dav1d_filter_sbrow_lr_8bpc:
 2088|    646|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2089|    646|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2089:9): [True: 0, False: 646]
  ------------------
 2090|    646|    const int y = sby * f->sb_step * 4;
 2091|    646|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2092|    646|    pixel *const sr_p[3] = {
 2093|    646|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
  ------------------
  |  |   53|    646|#define PXSTRIDE(x) (x)
  ------------------
 2094|    646|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
  ------------------
  |  |   53|    646|#define PXSTRIDE(x) (x)
  ------------------
 2095|    646|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
  ------------------
  |  |   53|    646|#define PXSTRIDE(x) (x)
  ------------------
 2096|    646|    };
 2097|    646|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|    646|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|    646|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2098|    646|}
dav1d_filter_sbrow_8bpc:
 2100|  2.14k|void bytefn(dav1d_filter_sbrow)(Dav1dFrameContext *const f, const int sby) {
 2101|  2.14k|    bytefn(dav1d_filter_sbrow_deblock_cols)(f, sby);
  ------------------
  |  |   87|  2.14k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  2.14k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2102|  2.14k|    bytefn(dav1d_filter_sbrow_deblock_rows)(f, sby);
  ------------------
  |  |   87|  2.14k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  2.14k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2103|  2.14k|    if (f->seq_hdr->cdef)
  ------------------
  |  Branch (2103:9): [True: 2.14k, False: 0]
  ------------------
 2104|  2.14k|        bytefn(dav1d_filter_sbrow_cdef)(f->c->tc, sby);
  ------------------
  |  |   87|  2.14k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  2.14k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2105|  2.14k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (2105:9): [True: 0, False: 2.14k]
  ------------------
 2106|      0|        bytefn(dav1d_filter_sbrow_resize)(f, sby);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2107|  2.14k|    if (f->lf.restore_planes)
  ------------------
  |  Branch (2107:9): [True: 43, False: 2.10k]
  ------------------
 2108|     43|        bytefn(dav1d_filter_sbrow_lr)(f, sby);
  ------------------
  |  |   87|     43|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|     43|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2109|  2.14k|}
dav1d_backup_ipred_edge_8bpc:
 2111|  58.3k|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2112|  58.3k|    const Dav1dFrameContext *const f = t->f;
 2113|  58.3k|    Dav1dTileState *const ts = t->ts;
 2114|  58.3k|    const int sby = t->by >> f->sb_shift;
 2115|  58.3k|    const int sby_off = f->sb128w * 128 * sby;
 2116|  58.3k|    const int x_off = ts->tiling.col_start;
 2117|       |
 2118|  58.3k|    const pixel *const y =
 2119|  58.3k|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2120|  58.3k|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  58.3k|#define PXSTRIDE(x) (x)
  ------------------
 2121|  58.3k|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   47|  58.3k|#define pixel_copy memcpy
  ------------------
 2122|  58.3k|               4 * (ts->tiling.col_end - x_off));
 2123|       |
 2124|  58.3k|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2124:9): [True: 20.9k, False: 37.4k]
  ------------------
 2125|  20.9k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2126|  20.9k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2127|       |
 2128|  20.9k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2129|  20.9k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  20.9k|#define PXSTRIDE(x) (x)
  ------------------
 2130|  62.8k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2130:26): [True: 41.8k, False: 20.9k]
  ------------------
 2131|  41.8k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   47|  41.8k|#define pixel_copy memcpy
  ------------------
 2132|  41.8k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2133|  41.8k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2134|  20.9k|    }
 2135|  58.3k|}
recon_tmpl.c:read_coef_tree:
  736|   631k|{
  737|   631k|    const Dav1dFrameContext *const f = t->f;
  738|   631k|    Dav1dTileState *const ts = t->ts;
  739|   631k|    const Dav1dDSPContext *const dsp = f->dsp;
  740|   631k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[ytx];
  741|   631k|    const int txw = t_dim->w, txh = t_dim->h;
  742|       |
  743|       |    /* y_off can be larger than 3 since lossless blocks use TX_4X4 but can't
  744|       |     * be splitted. Aviods an undefined left shift. */
  745|   631k|    if (depth < 2 && tx_split[depth] &&
  ------------------
  |  Branch (745:9): [True: 558k, False: 72.7k]
  |  Branch (745:22): [True: 72.6k, False: 486k]
  ------------------
  746|  72.6k|        tx_split[depth] & (1 << (y_off * 4 + x_off)))
  ------------------
  |  Branch (746:9): [True: 72.6k, False: 18.4E]
  ------------------
  747|  72.6k|    {
  748|  72.6k|        const enum RectTxfmSize sub = t_dim->sub;
  749|  72.6k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  750|  72.6k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  751|       |
  752|  72.6k|        read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  753|  72.6k|                       x_off * 2 + 0, y_off * 2 + 0, dst);
  754|  72.6k|        t->bx += txsw;
  755|  72.6k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (755:13): [True: 66.6k, False: 6.00k]
  |  Branch (755:27): [True: 65.5k, False: 1.10k]
  ------------------
  756|  65.5k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  757|  65.5k|                           y_off * 2 + 0, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (757:43): [True: 65.5k, False: 2]
  ------------------
  758|  72.6k|        t->bx -= txsw;
  759|  72.6k|        t->by += txsh;
  760|  72.6k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (760:13): [True: 65.9k, False: 6.69k]
  |  Branch (760:27): [True: 65.1k, False: 809]
  ------------------
  761|  65.1k|            if (dst)
  ------------------
  |  Branch (761:17): [True: 65.1k, False: 18.4E]
  ------------------
  762|  65.1k|                dst += 4 * txsh * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  65.1k|#define PXSTRIDE(x) (x)
  ------------------
  763|  65.1k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  764|  65.1k|                           x_off * 2 + 0, y_off * 2 + 1, dst);
  765|  65.1k|            t->bx += txsw;
  766|  65.1k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (766:17): [True: 59.2k, False: 5.89k]
  |  Branch (766:31): [True: 58.2k, False: 1.02k]
  ------------------
  767|  58.2k|                read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  768|  58.2k|                               y_off * 2 + 1, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (768:47): [True: 58.2k, False: 18.4E]
  ------------------
  769|  65.1k|            t->bx -= txsw;
  770|  65.1k|        }
  771|  72.6k|        t->by -= txsh;
  772|   558k|    } else {
  773|   558k|        const int bx4 = t->bx & 31, by4 = t->by & 31;
  774|   558k|        enum TxfmType txtp;
  775|   558k|        uint8_t cf_ctx;
  776|   558k|        int eob;
  777|   558k|        coef *cf;
  778|       |
  779|   558k|        if (t->frame_thread.pass) {
  ------------------
  |  Branch (779:13): [True: 0, False: 558k]
  ------------------
  780|      0|            const int p = t->frame_thread.pass & 1;
  781|      0|            assert(ts->frame_thread[p].cf);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  782|      0|            cf = ts->frame_thread[p].cf;
  783|      0|            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
  784|   558k|        } else {
  785|   558k|            cf = bitfn(t->cf);
  ------------------
  |  |   51|   558k|#define bitfn(x) x##_8bpc
  ------------------
  786|   558k|        }
  787|   559k|        if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (787:13): [True: 559k, False: 18.4E]
  ------------------
  788|   559k|            eob = decode_coefs(t, &t->a->lcoef[bx4], &t->l.lcoef[by4],
  789|   559k|                               ytx, bs, b, 0, 0, cf, &txtp, &cf_ctx);
  790|   559k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   559k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 559k]
  |  |  ------------------
  |  |   35|   559k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   559k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  791|      0|                printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
  792|      0|                       ytx, txtp, eob, ts->msac.rng);
  793|   559k|            dav1d_memset_likely_pow2(&t->a->lcoef[bx4], cf_ctx, imin(txw, f->bw - t->bx));
  794|   559k|            dav1d_memset_likely_pow2(&t->l.lcoef[by4], cf_ctx, imin(txh, f->bh - t->by));
  795|   559k|#define set_ctx(rep_macro) \
  796|   559k|            for (int y = 0; y < txh; y++) { \
  797|   559k|                rep_macro(txtp_map, 0, txtp); \
  798|   559k|                txtp_map += 32; \
  799|   559k|            }
  800|   559k|            uint8_t *txtp_map = &t->scratch.txtp_map[by4 * 32 + bx4];
  801|   559k|            case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|   559k|    switch (var) { \
  |  |   81|   118k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  796|   237k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 118k, False: 118k]
  |  |  |  |  ------------------
  |  |  |  |  797|   118k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   118k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   118k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   118k|                txtp_map += 32; \
  |  |  |  |  799|   118k|            }
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 118k, False: 440k]
  |  |  ------------------
  |  |   82|   436k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  796|  1.30M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 873k, False: 436k]
  |  |  |  |  ------------------
  |  |  |  |  797|   873k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   873k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   873k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   873k|                txtp_map += 32; \
  |  |  |  |  799|   873k|            }
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 436k, False: 123k]
  |  |  ------------------
  |  |   83|    626|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  796|  3.11k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 2.49k, False: 626]
  |  |  |  |  ------------------
  |  |  |  |  797|  2.49k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.49k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.49k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  2.49k|                txtp_map += 32; \
  |  |  |  |  799|  2.49k|            }
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 626, False: 558k]
  |  |  ------------------
  |  |   84|    401|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  796|  3.61k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 3.21k, False: 401]
  |  |  |  |  ------------------
  |  |  |  |  797|  3.21k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  3.21k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  3.21k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  3.21k|                txtp_map += 32; \
  |  |  |  |  799|  3.21k|            }
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 401, False: 559k]
  |  |  ------------------
  |  |   85|    559|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  796|  9.50k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 8.94k, False: 559]
  |  |  |  |  ------------------
  |  |  |  |  797|  8.94k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.94k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  8.94k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  8.94k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  8.94k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 8.94k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  8.94k|                txtp_map += 32; \
  |  |  |  |  799|  8.94k|            }
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 559, False: 558k]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 559k]
  |  |  ------------------
  |  |   87|   559k|    }
  ------------------
  802|   557k|#undef set_ctx
  803|   557k|            if (t->frame_thread.pass == 1)
  ------------------
  |  Branch (803:17): [True: 0, False: 557k]
  ------------------
  804|      0|                *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  805|  18.4E|        } else {
  806|  18.4E|            const int cbi = *ts->frame_thread[0].cbi++;
  807|  18.4E|            eob  = cbi >> 5;
  808|  18.4E|            txtp = cbi & 0x1f;
  809|  18.4E|        }
  810|   557k|        if (!(t->frame_thread.pass & 1)) {
  ------------------
  |  Branch (810:13): [True: 557k, False: 18.4E]
  ------------------
  811|   557k|            assert(dst);
  ------------------
  |  |  140|   557k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 557k]
  |  |  |  Branch (140:68): [Folded, False: 557k]
  |  |  ------------------
  ------------------
  812|   557k|            if (eob >= 0) {
  ------------------
  |  Branch (812:17): [True: 537k, False: 19.5k]
  ------------------
  813|   537k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   537k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 537k]
  |  |  ------------------
  |  |   35|   537k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   537k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
  814|      0|                    coef_dump(cf, imin(t_dim->h, 8) * 4, imin(t_dim->w, 8) * 4, 3, "dq");
  815|   537k|                dsp->itx.itxfm_add[ytx][txtp](dst, f->cur.stride[0], cf, eob
  816|   537k|                                              HIGHBD_CALL_SUFFIX);
  817|   537k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   537k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 537k]
  |  |  ------------------
  |  |   35|   537k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   537k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
  818|      0|                    hex_dump(dst, f->cur.stride[0], t_dim->w * 4, t_dim->h * 4, "recon");
  819|   537k|            }
  820|   557k|        }
  821|   556k|    }
  822|   631k|}
recon_tmpl.c:decode_coefs:
  327|  3.20M|{
  328|  3.20M|    Dav1dTileState *const ts = t->ts;
  329|  3.20M|    const int chroma = !!plane;
  330|  3.20M|    const Dav1dFrameContext *const f = t->f;
  331|  3.20M|    const int lossless = f->frame_hdr->segmentation.lossless[b->seg_id];
  332|  3.20M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  333|  3.20M|    const int dbg = DEBUG_BLOCK_INFO && plane && 0;
  ------------------
  |  |   34|  3.20M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 3.20M]
  |  |  ------------------
  |  |   35|  3.20M|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  3.20M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (333:41): [True: 0, False: 0]
  |  Branch (333:50): [Folded, False: 0]
  ------------------
  334|       |
  335|  3.20M|    if (dbg)
  ------------------
  |  Branch (335:9): [Folded, False: 3.20M]
  ------------------
  336|      0|        printf("Start: r=%d\n", ts->msac.rng);
  337|       |
  338|       |    // does this block have any non-zero coefficients
  339|  3.20M|    const int sctx = get_skip_ctx(t_dim, bs, a, l, chroma, f->cur.p.layout);
  340|  3.20M|    const int all_skip = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  3.20M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  341|  3.20M|                             ts->cdf.coef.skip[t_dim->ctx][sctx]);
  342|  3.20M|    if (dbg)
  ------------------
  |  Branch (342:9): [Folded, False: 3.20M]
  ------------------
  343|      0|        printf("Post-non-zero[%d][%d][%d]: r=%d\n",
  344|      0|               t_dim->ctx, sctx, all_skip, ts->msac.rng);
  345|  3.20M|    if (all_skip) {
  ------------------
  |  Branch (345:9): [True: 185k, False: 3.01M]
  ------------------
  346|   185k|        *res_ctx = 0x40;
  347|   185k|        *txtp = lossless * WHT_WHT; /* lossless ? WHT_WHT : DCT_DCT */
  348|   185k|        return -1;
  349|   185k|    }
  350|       |
  351|       |    // transform type (chroma: derived, luma: explicitly coded)
  352|  3.01M|    if (lossless) {
  ------------------
  |  Branch (352:9): [True: 291k, False: 2.72M]
  ------------------
  353|   291k|        assert(t_dim->max == TX_4X4);
  ------------------
  |  |  140|   291k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 291k]
  |  |  |  Branch (140:68): [Folded, False: 291k]
  |  |  ------------------
  ------------------
  354|   291k|        *txtp = WHT_WHT;
  355|  2.72M|    } else if (t_dim->max + intra >= TX_64X64) {
  ------------------
  |  Branch (355:16): [True: 5.95k, False: 2.71M]
  ------------------
  356|  5.95k|        *txtp = DCT_DCT;
  357|  2.71M|    } else if (chroma) {
  ------------------
  |  Branch (357:16): [True: 845k, False: 1.87M]
  ------------------
  358|       |        // inferred from either the luma txtp (inter) or a LUT (intra)
  359|   845k|        *txtp = intra ? dav1d_txtp_from_uvmode[b->uv_mode] :
  ------------------
  |  Branch (359:17): [True: 702k, False: 143k]
  ------------------
  360|   845k|                        get_uv_inter_txtp(t_dim, *txtp);
  361|  1.87M|    } else if (!f->frame_hdr->segmentation.qidx[b->seg_id]) {
  ------------------
  |  Branch (361:16): [True: 0, False: 1.87M]
  ------------------
  362|       |        // In libaom, lossless is checked by a literal qidx == 0, but not all
  363|       |        // such blocks are actually lossless. The remainder gets an implicit
  364|       |        // transform type (for luma)
  365|      0|        *txtp = DCT_DCT;
  366|  1.87M|    } else {
  367|  1.87M|        unsigned idx;
  368|  1.87M|        if (intra) {
  ------------------
  |  Branch (368:13): [True: 1.44M, False: 426k]
  ------------------
  369|  1.44M|            const enum IntraPredMode y_mode_nofilt = b->y_mode == FILTER_PRED ?
  ------------------
  |  Branch (369:54): [True: 592k, False: 854k]
  ------------------
  370|   854k|                dav1d_filter_mode_to_y_mode[b->y_angle] : b->y_mode;
  371|  1.44M|            if (f->frame_hdr->reduced_txtp_set || t_dim->min == TX_16X16) {
  ------------------
  |  Branch (371:17): [True: 18.4E, False: 1.44M]
  |  Branch (371:51): [True: 65.9k, False: 1.38M]
  ------------------
  372|  66.2k|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  66.2k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  373|  66.2k|                          ts->cdf.m.txtp_intra2[t_dim->min][y_mode_nofilt], 4);
  374|  66.2k|                *txtp = dav1d_tx_types_per_set[idx + 0];
  375|  1.38M|            } else {
  376|  1.38M|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  1.38M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  377|  1.38M|                          ts->cdf.m.txtp_intra1[t_dim->min][y_mode_nofilt], 6);
  378|  1.38M|                *txtp = dav1d_tx_types_per_set[idx + 5];
  379|  1.38M|            }
  380|  1.44M|            if (dbg)
  ------------------
  |  Branch (380:17): [Folded, False: 1.44M]
  ------------------
  381|      0|                printf("Post-txtp-intra[%d->%d][%d][%d->%d]: r=%d\n",
  382|      0|                       tx, t_dim->min, y_mode_nofilt, idx, *txtp, ts->msac.rng);
  383|  1.44M|        } else {
  384|   435k|            if (f->frame_hdr->reduced_txtp_set || t_dim->max == TX_32X32) {
  ------------------
  |  Branch (384:17): [True: 18.4E, False: 435k]
  |  Branch (384:51): [True: 382, False: 435k]
  ------------------
  385|    399|                idx = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|    399|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  386|    399|                          ts->cdf.m.txtp_inter3[t_dim->min]);
  387|    399|                *txtp = (idx - 1) & IDTX; /* idx ? DCT_DCT : IDTX */
  388|   426k|            } else if (t_dim->min == TX_16X16) {
  ------------------
  |  Branch (388:24): [True: 555, False: 425k]
  ------------------
  389|    555|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|    555|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  390|    555|                          ts->cdf.m.txtp_inter2, 11);
  391|    555|                *txtp = dav1d_tx_types_per_set[idx + 12];
  392|   425k|            } else {
  393|   425k|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   425k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  394|   425k|                          ts->cdf.m.txtp_inter1[t_dim->min], 15);
  395|   425k|                *txtp = dav1d_tx_types_per_set[idx + 24];
  396|   425k|            }
  397|   426k|            if (dbg)
  ------------------
  |  Branch (397:17): [Folded, False: 426k]
  ------------------
  398|      0|                printf("Post-txtp-inter[%d->%d][%d->%d]: r=%d\n",
  399|      0|                       tx, t_dim->min, idx, *txtp, ts->msac.rng);
  400|   426k|        }
  401|  1.87M|    }
  402|       |
  403|       |    // find end-of-block (eob)
  404|  3.01M|    int eob;
  405|  3.01M|    const int slw = imin(t_dim->lw, TX_32X32), slh = imin(t_dim->lh, TX_32X32);
  406|  3.01M|    const int tx2dszctx = slw + slh;
  407|  3.01M|    const enum TxClass tx_class = dav1d_tx_type_class[*txtp];
  408|  3.01M|    const int is_1d = tx_class != TX_CLASS_2D;
  409|  3.01M|    switch (tx2dszctx) {
  ------------------
  |  Branch (409:13): [True: 3.02M, False: 18.4E]
  ------------------
  410|      0|#define case_sz(sz, bin, ns, is_1d) \
  411|      0|    case sz: { \
  412|      0|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  413|      0|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  414|      0|        break; \
  415|      0|    }
  416|  1.49M|    case_sz(0,   16,  8, [is_1d]);
  ------------------
  |  |  411|  1.49M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 1.49M, False: 1.52M]
  |  |  ------------------
  |  |  412|  1.49M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  1.49M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  1.49M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  1.49M|        break; \
  |  |  415|  1.49M|    }
  ------------------
  417|   205k|    case_sz(1,   32,  8, [is_1d]);
  ------------------
  |  |  411|   205k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 205k, False: 2.81M]
  |  |  ------------------
  |  |  412|   205k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   205k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|   205k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|   205k|        break; \
  |  |  415|   205k|    }
  ------------------
  418|  1.19M|    case_sz(2,   64,  8, [is_1d]);
  ------------------
  |  |  411|  1.19M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 1.19M, False: 1.82M]
  |  |  ------------------
  |  |  412|  1.19M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  1.19M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  1.19M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  1.19M|        break; \
  |  |  415|  1.19M|    }
  ------------------
  419|  33.9k|    case_sz(3,  128,  8, [is_1d]);
  ------------------
  |  |  411|  33.9k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 33.9k, False: 2.98M]
  |  |  ------------------
  |  |  412|  33.9k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  33.9k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  33.9k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  33.9k|        break; \
  |  |  415|  33.9k|    }
  ------------------
  420|  80.4k|    case_sz(4,  256, 16, [is_1d]);
  ------------------
  |  |  411|  80.4k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 80.4k, False: 2.93M]
  |  |  ------------------
  |  |  412|  80.4k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  80.4k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|  80.4k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|  80.4k|        break; \
  |  |  415|  80.4k|    }
  ------------------
  421|  3.20k|    case_sz(5,  512, 16,        );
  ------------------
  |  |  411|  3.20k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 3.20k, False: 3.01M]
  |  |  ------------------
  |  |  412|  3.20k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  3.20k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|  3.20k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|  3.20k|        break; \
  |  |  415|  3.20k|    }
  ------------------
  422|  6.29k|    case_sz(6, 1024, 16,        );
  ------------------
  |  |  411|  6.29k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 6.29k, False: 3.01M]
  |  |  ------------------
  |  |  412|  6.29k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  6.29k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|  6.29k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|  6.29k|        break; \
  |  |  415|  6.29k|    }
  ------------------
  423|  3.01M|#undef case_sz
  424|  3.01M|    }
  425|  3.00M|    if (dbg)
  ------------------
  |  Branch (425:9): [Folded, False: 3.00M]
  ------------------
  426|      0|        printf("Post-eob_bin_%d[%d][%d][%d]: r=%d\n",
  427|      0|               16 << tx2dszctx, chroma, is_1d, eob, ts->msac.rng);
  428|  3.00M|    if (eob > 1) {
  ------------------
  |  Branch (428:9): [True: 2.82M, False: 180k]
  ------------------
  429|  2.82M|        const int eob_bin = eob - 2;
  430|  2.82M|        uint16_t *const eob_hi_bit_cdf =
  431|  2.82M|            ts->cdf.coef.eob_hi_bit[t_dim->ctx][chroma][eob_bin];
  432|  2.82M|        const int eob_hi_bit = dav1d_msac_decode_bool_adapt(&ts->msac, eob_hi_bit_cdf);
  ------------------
  |  |   52|  2.82M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  433|  2.82M|        if (dbg)
  ------------------
  |  Branch (433:13): [Folded, False: 2.82M]
  ------------------
  434|      0|            printf("Post-eob_hi_bit[%d][%d][%d][%d]: r=%d\n",
  435|      0|                   t_dim->ctx, chroma, eob_bin, eob_hi_bit, ts->msac.rng);
  436|  2.82M|        eob = ((eob_hi_bit | 2) << eob_bin) | dav1d_msac_decode_bools(&ts->msac, eob_bin);
  437|  2.82M|        if (dbg)
  ------------------
  |  Branch (437:13): [Folded, False: 2.82M]
  ------------------
  438|      0|            printf("Post-eob[%d]: r=%d\n", eob, ts->msac.rng);
  439|  2.82M|    }
  440|  3.00M|    assert(eob >= 0);
  ------------------
  |  |  140|  3.00M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 3.00M]
  |  |  |  Branch (140:68): [Folded, False: 3.00M]
  |  |  ------------------
  ------------------
  441|       |
  442|       |    // base tokens
  443|  3.00M|    uint16_t (*const eob_cdf)[4] = ts->cdf.coef.eob_base_tok[t_dim->ctx][chroma];
  444|  3.00M|    uint16_t (*const hi_cdf)[4] = ts->cdf.coef.br_tok[imin(t_dim->ctx, 3)][chroma];
  445|  3.00M|    unsigned rc, dc_tok;
  446|       |
  447|  3.00M|    if (eob) {
  ------------------
  |  Branch (447:9): [True: 2.85M, False: 149k]
  ------------------
  448|  2.85M|        uint16_t (*const lo_cdf)[4] = ts->cdf.coef.base_tok[t_dim->ctx][chroma];
  449|  2.85M|        uint8_t *const levels = t->scratch.levels; // bits 0-5: tok, 6-7: lo_tok
  450|       |
  451|       |        /* eob */
  452|  2.85M|        unsigned ctx = 1 + (eob > 2 << tx2dszctx) + (eob > 4 << tx2dszctx);
  453|  2.85M|        int eob_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[ctx], 2);
  ------------------
  |  |   47|  2.85M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  454|  2.85M|        int tok = eob_tok + 1;
  455|  2.85M|        int level_tok = tok * 0x41;
  456|  2.85M|        unsigned mag;
  457|       |
  458|  2.85M|#define DECODE_COEFS_CLASS(tx_class) \
  459|  2.85M|        unsigned x, y; \
  460|  2.85M|        uint8_t *level; \
  461|  2.85M|        if (tx_class == TX_CLASS_2D) \
  462|  2.85M|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  463|  2.85M|        else if (tx_class == TX_CLASS_H) \
  464|       |            /* Transposing reduces the stride and padding requirements */ \
  465|  2.85M|            x = eob & mask, y = eob >> shift, rc = eob; \
  466|  2.85M|        else /* tx_class == TX_CLASS_V */ \
  467|  2.85M|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  468|  2.85M|        if (dbg) \
  469|  2.85M|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  470|  2.85M|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  471|  2.85M|        if (eob_tok == 2) { \
  472|  2.85M|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  473|  2.85M|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  474|  2.85M|            level_tok = tok + (3 << 6); \
  475|  2.85M|            if (dbg) \
  476|  2.85M|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  477|  2.85M|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  478|  2.85M|                       ts->msac.rng); \
  479|  2.85M|        } \
  480|  2.85M|        cf[rc] = tok << 11; \
  481|  2.85M|        if (tx_class == TX_CLASS_2D) \
  482|  2.85M|            level = levels + rc; \
  483|  2.85M|        else \
  484|  2.85M|            level = levels + x * stride + y; \
  485|  2.85M|        *level = (uint8_t) level_tok; \
  486|  2.85M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  487|  2.85M|            unsigned rc_i; \
  488|  2.85M|            if (tx_class == TX_CLASS_2D) \
  489|  2.85M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  490|  2.85M|            else if (tx_class == TX_CLASS_H) \
  491|  2.85M|                x = i & mask, y = i >> shift, rc_i = i; \
  492|  2.85M|            else /* tx_class == TX_CLASS_V */ \
  493|  2.85M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  494|  2.85M|            assert(x < 32 && y < 32); \
  495|  2.85M|            if (tx_class == TX_CLASS_2D) \
  496|  2.85M|                level = levels + rc_i; \
  497|  2.85M|            else \
  498|  2.85M|                level = levels + x * stride + y; \
  499|  2.85M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  500|  2.85M|            if (tx_class == TX_CLASS_2D) \
  501|  2.85M|                y |= x; \
  502|  2.85M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  503|  2.85M|            if (dbg) \
  504|  2.85M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  505|  2.85M|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  506|  2.85M|            if (tok == 3) { \
  507|  2.85M|                mag &= 63; \
  508|  2.85M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  509|  2.85M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  510|  2.85M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  511|  2.85M|                if (dbg) \
  512|  2.85M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  513|  2.85M|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  514|  2.85M|                           ts->msac.rng); \
  515|  2.85M|                *level = (uint8_t) (tok + (3 << 6)); \
  516|  2.85M|                cf[rc_i] = (tok << 11) | rc; \
  517|  2.85M|                rc = rc_i; \
  518|  2.85M|            } else { \
  519|       |                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  520|  2.85M|                tok *= 0x17ff41; \
  521|  2.85M|                *level = (uint8_t) tok; \
  522|       |                /* tok ? (tok << 11) | rc : 0 */ \
  523|  2.85M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  524|  2.85M|                if (tok) rc = rc_i; \
  525|  2.85M|                cf[rc_i] = tok; \
  526|  2.85M|            } \
  527|  2.85M|        } \
  528|       |        /* dc */ \
  529|  2.85M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  530|  2.85M|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  531|  2.85M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  532|  2.85M|        if (dbg) \
  533|  2.85M|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  534|  2.85M|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  535|  2.85M|        if (dc_tok == 3) { \
  536|  2.85M|            if (tx_class == TX_CLASS_2D) \
  537|  2.85M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  538|  2.85M|                      levels[1 * stride + 1]; \
  539|  2.85M|            mag &= 63; \
  540|  2.85M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  541|  2.85M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  542|  2.85M|            if (dbg) \
  543|  2.85M|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  544|  2.85M|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  545|  2.85M|        } \
  546|  2.85M|        break
  547|       |
  548|  2.85M|        const uint16_t *scan;
  549|  2.85M|        switch (tx_class) {
  550|  2.67M|        case TX_CLASS_2D: {
  ------------------
  |  Branch (550:9): [True: 2.67M, False: 185k]
  ------------------
  551|  2.67M|            const unsigned nonsquare_tx = tx >= RTX_4X8;
  552|  2.67M|            const uint8_t (*const lo_ctx_offsets)[5] =
  553|  2.67M|                dav1d_lo_ctx_offsets[nonsquare_tx + (tx & nonsquare_tx)];
  554|  2.67M|            scan = dav1d_scans[tx];
  555|  2.67M|            const ptrdiff_t stride = 4 << slh;
  556|  2.67M|            const unsigned shift = slh + 2, shift2 = 0;
  557|  2.67M|            const unsigned mask = (4 << slh) - 1;
  558|  2.67M|            memset(levels, 0, stride * ((4 << slw) + 2));
  559|  2.67M|            DECODE_COEFS_CLASS(TX_CLASS_2D);
  ------------------
  |  |  459|  2.67M|        unsigned x, y; \
  |  |  460|  2.67M|        uint8_t *level; \
  |  |  461|  2.67M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [True: 2.68M, Folded]
  |  |  ------------------
  |  |  462|  2.68M|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|  18.4E|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [Folded, False: 18.4E]
  |  |  ------------------
  |  |  464|  18.4E|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|  18.4E|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|  18.4E|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|  18.4E|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|  2.67M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 2.67M]
  |  |  ------------------
  |  |  469|  2.67M|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  470|      0|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  |  |  471|  2.67M|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 850k, False: 1.82M]
  |  |  ------------------
  |  |  472|   850k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 849k, False: 1.23k]
  |  |  |  Branch (472:20): [True: 847k, Folded]
  |  |  ------------------
  |  |  473|   850k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|   850k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|   850k|            level_tok = tok + (3 << 6); \
  |  |  475|   850k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 850k]
  |  |  ------------------
  |  |  476|   850k|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  477|      0|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  |  |  478|      0|                       ts->msac.rng); \
  |  |  479|   850k|        } \
  |  |  480|  2.67M|        cf[rc] = tok << 11; \
  |  |  481|  2.67M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [True: 2.67M, Folded]
  |  |  ------------------
  |  |  482|  2.67M|            level = levels + rc; \
  |  |  483|  2.67M|        else \
  |  |  484|  18.4E|            level = levels + x * stride + y; \
  |  |  485|  2.67M|        *level = (uint8_t) level_tok; \
  |  |  486|  64.7M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 62.0M, False: 2.67M]
  |  |  ------------------
  |  |  487|  62.0M|            unsigned rc_i; \
  |  |  488|  62.0M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [True: 62.1M, Folded]
  |  |  ------------------
  |  |  489|  62.1M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  18.4E|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [Folded, False: 18.4E]
  |  |  ------------------
  |  |  491|  18.4E|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  18.4E|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  18.4E|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  62.0M|            assert(x < 32 && y < 32); \
  |  |  ------------------
  |  |  |  |  140|   123M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:30): [True: 61.8M, False: 270k]
  |  |  |  |  |  Branch (140:30): [True: 61.9M, False: 18.4E]
  |  |  |  |  |  Branch (140:68): [Folded, False: 62.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  495|  62.0M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [True: 62.0M, Folded]
  |  |  ------------------
  |  |  496|  62.0M|                level = levels + rc_i; \
  |  |  497|  62.0M|            else \
  |  |  498|  62.0M|                level = levels + x * stride + y; \
  |  |  499|  62.0M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  62.0M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [True: 61.1M, Folded]
  |  |  ------------------
  |  |  501|  62.0M|                y |= x; \
  |  |  502|  62.0M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  62.0M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  62.0M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 62.0M]
  |  |  ------------------
  |  |  504|  62.0M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  505|      0|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  |  |  506|  62.0M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 22.0M, False: 39.9M]
  |  |  ------------------
  |  |  507|  22.0M|                mag &= 63; \
  |  |  508|  22.0M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 19.3M, False: 2.74M]
  |  |  ------------------
  |  |  509|  22.0M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 12.0M, False: 10.0M]
  |  |  ------------------
  |  |  510|  22.0M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  22.0M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  22.0M|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 22.0M]
  |  |  ------------------
  |  |  512|  22.0M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  513|      0|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  |  |  514|      0|                           ts->msac.rng); \
  |  |  515|  22.0M|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  22.0M|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  22.0M|                rc = rc_i; \
  |  |  518|  39.9M|            } else { \
  |  |  519|  39.9M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  39.9M|                tok *= 0x17ff41; \
  |  |  521|  39.9M|                *level = (uint8_t) tok; \
  |  |  522|  39.9M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  39.9M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  39.9M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 20.5M, False: 19.4M]
  |  |  ------------------
  |  |  525|  39.9M|                cf[rc_i] = tok; \
  |  |  526|  39.9M|            } \
  |  |  527|  62.0M|        } \
  |  |  528|  2.67M|        /* dc */ \
  |  |  529|  2.67M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [True: 2.63M, Folded]
  |  |  ------------------
  |  |  530|  2.67M|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|  2.67M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  2.67M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|  2.67M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 2.67M]
  |  |  ------------------
  |  |  533|  2.67M|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  |  |  534|      0|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  |  |  535|  2.67M|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 1.64M, False: 1.02M]
  |  |  ------------------
  |  |  536|  1.64M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [True: 1.64M, Folded]
  |  |  ------------------
  |  |  537|  1.64M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|  1.64M|                      levels[1 * stride + 1]; \
  |  |  539|  1.64M|            mag &= 63; \
  |  |  540|  1.64M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 891k, False: 755k]
  |  |  ------------------
  |  |  541|  1.64M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  1.64M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  1.64M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 1.64M]
  |  |  ------------------
  |  |  543|  1.64M|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  |  |  544|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  |  |  545|  1.64M|        } \
  |  |  546|  2.67M|        break
  ------------------
  560|  2.67M|        }
  561|   146k|        case TX_CLASS_H: {
  ------------------
  |  Branch (561:9): [True: 146k, False: 2.71M]
  ------------------
  562|   146k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  563|   146k|            const ptrdiff_t stride = 16;
  564|   146k|            const unsigned shift = slh + 2, shift2 = 0;
  565|   146k|            const unsigned mask = (4 << slh) - 1;
  566|   146k|            memset(levels, 0, stride * ((4 << slh) + 2));
  567|   146k|            DECODE_COEFS_CLASS(TX_CLASS_H);
  ------------------
  |  |  459|   146k|        unsigned x, y; \
  |  |  460|   146k|        uint8_t *level; \
  |  |  461|   146k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 146k]
  |  |  ------------------
  |  |  462|   146k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|   146k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [True: 146k, Folded]
  |  |  ------------------
  |  |  464|   146k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|   146k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|   146k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|  18.4E|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|   146k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 146k]
  |  |  ------------------
  |  |  469|   146k|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  470|      0|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  |  |  471|   146k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 70.5k, False: 75.5k]
  |  |  ------------------
  |  |  472|  70.5k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 61.6k, False: 8.93k]
  |  |  |  Branch (472:20): [Folded, False: 70.5k]
  |  |  ------------------
  |  |  473|  70.5k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  70.5k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  70.5k|            level_tok = tok + (3 << 6); \
  |  |  475|  70.5k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 70.5k]
  |  |  ------------------
  |  |  476|  70.5k|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  477|      0|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  |  |  478|      0|                       ts->msac.rng); \
  |  |  479|  70.5k|        } \
  |  |  480|   146k|        cf[rc] = tok << 11; \
  |  |  481|   146k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 146k]
  |  |  ------------------
  |  |  482|   146k|            level = levels + rc; \
  |  |  483|   146k|        else \
  |  |  484|   146k|            level = levels + x * stride + y; \
  |  |  485|   146k|        *level = (uint8_t) level_tok; \
  |  |  486|  4.18M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 4.03M, False: 146k]
  |  |  ------------------
  |  |  487|  4.03M|            unsigned rc_i; \
  |  |  488|  4.03M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 4.03M]
  |  |  ------------------
  |  |  489|  4.03M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  4.03M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [True: 4.04M, Folded]
  |  |  ------------------
  |  |  491|  4.04M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  4.03M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  18.4E|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  4.03M|            assert(x < 32 && y < 32); \
  |  |  ------------------
  |  |  |  |  140|  8.08M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:30): [True: 4.04M, False: 18.4E]
  |  |  |  |  |  Branch (140:30): [True: 4.04M, False: 18.4E]
  |  |  |  |  |  Branch (140:68): [Folded, False: 4.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  495|  4.03M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 4.03M]
  |  |  ------------------
  |  |  496|  4.03M|                level = levels + rc_i; \
  |  |  497|  4.03M|            else \
  |  |  498|  4.03M|                level = levels + x * stride + y; \
  |  |  499|  4.03M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  4.03M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 4.03M]
  |  |  ------------------
  |  |  501|  4.03M|                y |= x; \
  |  |  502|  4.03M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  4.03M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  4.03M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 4.03M]
  |  |  ------------------
  |  |  504|  4.03M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  505|      0|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  |  |  506|  4.03M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 1.93M, False: 2.10M]
  |  |  ------------------
  |  |  507|  1.93M|                mag &= 63; \
  |  |  508|  1.93M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 1.59M, False: 335k]
  |  |  ------------------
  |  |  509|  1.93M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 1.38M, False: 551k]
  |  |  ------------------
  |  |  510|  1.93M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  1.93M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  1.93M|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 1.93M]
  |  |  ------------------
  |  |  512|  1.93M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  513|      0|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  |  |  514|      0|                           ts->msac.rng); \
  |  |  515|  1.93M|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  1.93M|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  1.93M|                rc = rc_i; \
  |  |  518|  2.10M|            } else { \
  |  |  519|  2.10M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  2.10M|                tok *= 0x17ff41; \
  |  |  521|  2.10M|                *level = (uint8_t) tok; \
  |  |  522|  2.10M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  2.10M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  2.10M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 1.06M, False: 1.04M]
  |  |  ------------------
  |  |  525|  2.10M|                cf[rc_i] = tok; \
  |  |  526|  2.10M|            } \
  |  |  527|  4.03M|        } \
  |  |  528|   146k|        /* dc */ \
  |  |  529|   146k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 146k]
  |  |  ------------------
  |  |  530|   146k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|   146k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|   146k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|   146k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 146k]
  |  |  ------------------
  |  |  533|   146k|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  |  |  534|      0|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  |  |  535|   146k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 81.6k, False: 64.4k]
  |  |  ------------------
  |  |  536|  81.6k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 81.6k]
  |  |  ------------------
  |  |  537|  81.6k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  81.6k|            mag &= 63; \
  |  |  540|  81.6k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 58.0k, False: 23.6k]
  |  |  ------------------
  |  |  541|  81.6k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  81.6k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  81.6k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 81.6k]
  |  |  ------------------
  |  |  543|  81.6k|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  |  |  544|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  |  |  545|  81.6k|        } \
  |  |  546|   146k|        break
  ------------------
  568|   146k|        }
  569|  55.4k|        case TX_CLASS_V: {
  ------------------
  |  Branch (569:9): [True: 55.4k, False: 2.80M]
  ------------------
  570|  55.4k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  571|  55.4k|            const ptrdiff_t stride = 16;
  572|  55.4k|            const unsigned shift = slw + 2, shift2 = slh + 2;
  573|  55.4k|            const unsigned mask = (4 << slw) - 1;
  574|  55.4k|            memset(levels, 0, stride * ((4 << slw) + 2));
  575|  55.4k|            DECODE_COEFS_CLASS(TX_CLASS_V);
  ------------------
  |  |  459|  55.4k|        unsigned x, y; \
  |  |  460|  55.4k|        uint8_t *level; \
  |  |  461|  55.4k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  462|  55.4k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|  55.4k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  464|  55.4k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|  55.4k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|  55.4k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|  55.4k|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|  55.4k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  469|  55.4k|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  470|      0|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  |  |  471|  55.4k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 30.9k, False: 24.5k]
  |  |  ------------------
  |  |  472|  30.9k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 27.1k, False: 3.76k]
  |  |  |  Branch (472:20): [Folded, False: 30.9k]
  |  |  ------------------
  |  |  473|  30.9k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  30.9k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  30.9k|            level_tok = tok + (3 << 6); \
  |  |  475|  30.9k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 30.9k]
  |  |  ------------------
  |  |  476|  30.9k|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  477|      0|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  |  |  478|      0|                       ts->msac.rng); \
  |  |  479|  30.9k|        } \
  |  |  480|  55.4k|        cf[rc] = tok << 11; \
  |  |  481|  55.4k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  482|  55.4k|            level = levels + rc; \
  |  |  483|  55.4k|        else \
  |  |  484|  55.4k|            level = levels + x * stride + y; \
  |  |  485|  55.4k|        *level = (uint8_t) level_tok; \
  |  |  486|  1.84M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 1.79M, False: 55.4k]
  |  |  ------------------
  |  |  487|  1.79M|            unsigned rc_i; \
  |  |  488|  1.79M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 1.79M]
  |  |  ------------------
  |  |  489|  1.79M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  1.79M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [Folded, False: 1.79M]
  |  |  ------------------
  |  |  491|  1.79M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  1.79M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  1.79M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  1.79M|            assert(x < 32 && y < 32); \
  |  |  ------------------
  |  |  |  |  140|  3.57M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:30): [True: 1.78M, False: 2.09k]
  |  |  |  |  |  Branch (140:30): [True: 1.78M, False: 18.4E]
  |  |  |  |  |  Branch (140:68): [Folded, False: 1.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  495|  1.79M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 1.79M]
  |  |  ------------------
  |  |  496|  1.79M|                level = levels + rc_i; \
  |  |  497|  1.79M|            else \
  |  |  498|  1.79M|                level = levels + x * stride + y; \
  |  |  499|  1.79M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  1.79M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 1.79M]
  |  |  ------------------
  |  |  501|  1.79M|                y |= x; \
  |  |  502|  1.79M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  1.79M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  1.79M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 1.79M]
  |  |  ------------------
  |  |  504|  1.79M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  505|      0|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  |  |  506|  1.79M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 1.05M, False: 735k]
  |  |  ------------------
  |  |  507|  1.05M|                mag &= 63; \
  |  |  508|  1.05M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 882k, False: 172k]
  |  |  ------------------
  |  |  509|  1.05M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 833k, False: 220k]
  |  |  ------------------
  |  |  510|  1.05M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  1.05M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  1.05M|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 1.05M]
  |  |  ------------------
  |  |  512|  1.05M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  513|      0|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  |  |  514|      0|                           ts->msac.rng); \
  |  |  515|  1.05M|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  1.05M|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  1.05M|                rc = rc_i; \
  |  |  518|  1.05M|            } else { \
  |  |  519|   735k|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|   735k|                tok *= 0x17ff41; \
  |  |  521|   735k|                *level = (uint8_t) tok; \
  |  |  522|   735k|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|   735k|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|   735k|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 389k, False: 346k]
  |  |  ------------------
  |  |  525|   735k|                cf[rc_i] = tok; \
  |  |  526|   735k|            } \
  |  |  527|  1.79M|        } \
  |  |  528|  55.4k|        /* dc */ \
  |  |  529|  55.4k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  530|  55.4k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|  55.4k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  55.4k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|  55.4k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 55.4k]
  |  |  ------------------
  |  |  533|  55.4k|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  |  |  534|      0|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  |  |  535|  55.4k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 37.4k, False: 18.0k]
  |  |  ------------------
  |  |  536|  37.4k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 37.4k]
  |  |  ------------------
  |  |  537|  37.4k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  37.4k|            mag &= 63; \
  |  |  540|  37.4k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 29.0k, False: 8.37k]
  |  |  ------------------
  |  |  541|  37.4k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  37.4k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  37.4k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 37.4k]
  |  |  ------------------
  |  |  543|  37.4k|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  |  |  544|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  |  |  545|  37.4k|        } \
  |  |  546|  55.4k|        break
  ------------------
  576|  55.4k|        }
  577|      0|#undef DECODE_COEFS_CLASS
  578|      0|        default: assert(0);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (578:9): [True: 0, False: 2.85M]
  ------------------
  579|  2.85M|        }
  580|  2.85M|    } else { // dc-only
  581|   149k|        int tok_br = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[0], 2);
  ------------------
  |  |   47|   149k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  582|   149k|        dc_tok = 1 + tok_br;
  583|   149k|        if (dbg)
  ------------------
  |  Branch (583:13): [Folded, False: 149k]
  ------------------
  584|      0|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n",
  585|      0|                   t_dim->ctx, chroma, 0, dc_tok, ts->msac.rng);
  586|   149k|        if (tok_br == 2) {
  ------------------
  |  Branch (586:13): [True: 23.6k, False: 125k]
  ------------------
  587|  23.6k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[0]);
  ------------------
  |  |   49|  23.6k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  ------------------
  588|  23.6k|            if (dbg)
  ------------------
  |  Branch (588:17): [Folded, False: 23.6k]
  ------------------
  589|      0|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n",
  590|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng);
  591|  23.6k|        }
  592|   149k|        rc = 0;
  593|   149k|    }
  594|       |
  595|       |    // residual and sign
  596|  3.01M|    const uint16_t *const dq_tbl = ts->dq[b->seg_id][plane];
  597|  3.01M|    const uint8_t *const qm_tbl = *txtp < IDTX ? f->qm[tx][plane] : NULL;
  ------------------
  |  Branch (597:35): [True: 2.50M, False: 509k]
  ------------------
  598|  3.01M|    const int dq_shift = imax(0, t_dim->ctx - 2);
  599|  3.01M|    const int cf_max = ~(~127U << (BITDEPTH == 8 ? 8 : f->cur.p.bpc));
  ------------------
  |  Branch (599:36): [True: 2.63M, Folded]
  ------------------
  600|  3.01M|    unsigned cul_level, dc_sign_level;
  601|       |
  602|  3.01M|    if (!dc_tok) {
  ------------------
  |  Branch (602:9): [True: 364k, False: 2.64M]
  ------------------
  603|   364k|        cul_level = 0;
  604|   364k|        dc_sign_level = 1 << 6;
  605|   364k|        if (qm_tbl) goto ac_qm;
  ------------------
  |  Branch (605:13): [True: 259k, False: 105k]
  ------------------
  606|   105k|        goto ac_noqm;
  607|   364k|    }
  608|       |
  609|  2.64M|    const int dc_sign_ctx = get_dc_sign_ctx(tx, a, l);
  610|  2.64M|    uint16_t *const dc_sign_cdf = ts->cdf.coef.dc_sign[chroma][dc_sign_ctx];
  611|  2.64M|    const int dc_sign = dav1d_msac_decode_bool_adapt(&ts->msac, dc_sign_cdf);
  ------------------
  |  |   52|  2.64M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  612|  2.64M|    if (dbg)
  ------------------
  |  Branch (612:9): [Folded, False: 2.64M]
  ------------------
  613|      0|        printf("Post-dc_sign[%d][%d][%d]: r=%d\n",
  614|      0|               chroma, dc_sign_ctx, dc_sign, ts->msac.rng);
  615|       |
  616|  2.64M|    int dc_dq = dq_tbl[0];
  617|  2.64M|    dc_sign_level = (dc_sign - 1) & (2 << 6);
  618|       |
  619|  2.64M|    if (qm_tbl) {
  ------------------
  |  Branch (619:9): [True: 1.78M, False: 863k]
  ------------------
  620|  1.78M|        dc_dq = (dc_dq * qm_tbl[0] + 16) >> 5;
  621|       |
  622|  1.78M|        if (dc_tok == 15) {
  ------------------
  |  Branch (622:13): [True: 355k, False: 1.42M]
  ------------------
  623|   355k|            dc_tok = read_golomb(&ts->msac) + 15;
  624|   355k|            if (dbg)
  ------------------
  |  Branch (624:17): [Folded, False: 355k]
  ------------------
  625|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  626|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  627|       |
  628|   355k|            dc_tok &= 0xfffff;
  629|   355k|            dc_dq = (dc_dq * dc_tok) & 0xffffff;
  630|  1.42M|        } else {
  631|  1.42M|            dc_dq *= dc_tok;
  632|  1.42M|            assert(dc_dq <= 0xffffff);
  ------------------
  |  |  140|  1.42M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 1.42M]
  |  |  |  Branch (140:68): [Folded, False: 1.42M]
  |  |  ------------------
  ------------------
  633|  1.42M|        }
  634|  1.78M|        cul_level = dc_tok;
  635|  1.78M|        dc_dq >>= dq_shift;
  636|  1.78M|        dc_dq = umin(dc_dq, cf_max + dc_sign);
  637|  1.78M|        cf[0] = (coef) (dc_sign ? -dc_dq : dc_dq);
  ------------------
  |  Branch (637:25): [True: 909k, False: 874k]
  ------------------
  638|       |
  639|  3.53M|        if (rc) ac_qm: {
  ------------------
  |  Branch (639:13): [True: 1.64M, False: 143k]
  ------------------
  640|  3.53M|            const unsigned ac_dq = dq_tbl[1];
  641|  31.4M|            do {
  642|  31.4M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  31.4M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  643|  31.4M|                if (dbg)
  ------------------
  |  Branch (643:21): [Folded, False: 31.4M]
  ------------------
  644|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  645|  31.4M|                const unsigned rc_tok = cf[rc];
  646|  31.4M|                unsigned tok, dq = (ac_dq * qm_tbl[rc] + 16) >> 5;
  647|  31.4M|                int dq_sat;
  648|       |
  649|  31.4M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (649:21): [True: 2.16M, False: 29.3M]
  ------------------
  650|  2.16M|                    tok = read_golomb(&ts->msac) + 15;
  651|  2.16M|                    if (dbg)
  ------------------
  |  Branch (651:25): [Folded, False: 2.16M]
  ------------------
  652|      0|                        printf("Post-residual[%d=%d->%d]: r=%d\n",
  653|      0|                               rc, tok - 15, tok, ts->msac.rng);
  654|       |
  655|  2.16M|                    tok &= 0xfffff;
  656|  2.16M|                    dq = (dq * tok) & 0xffffff;
  657|  29.3M|                } else {
  658|  29.3M|                    tok = rc_tok >> 11;
  659|  29.3M|                    dq *= tok;
  660|  29.3M|                    assert(dq <= 0xffffff);
  ------------------
  |  |  140|  29.3M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 29.3M]
  |  |  |  Branch (140:68): [Folded, False: 29.3M]
  |  |  ------------------
  ------------------
  661|  29.3M|                }
  662|  31.4M|                cul_level += tok;
  663|  31.4M|                dq >>= dq_shift;
  664|  31.4M|                dq_sat = umin(dq, cf_max + sign);
  665|  31.4M|                cf[rc] = (coef) (sign ? -dq_sat : dq_sat);
  ------------------
  |  Branch (665:34): [True: 15.8M, False: 15.6M]
  ------------------
  666|       |
  667|  31.4M|                rc = rc_tok & 0x3ff;
  668|  31.4M|            } while (rc);
  ------------------
  |  Branch (668:22): [True: 29.6M, False: 1.89M]
  ------------------
  669|  3.53M|        }
  670|  1.78M|    } else {
  671|       |        // non-qmatrix is the common case and allows for additional optimizations
  672|   863k|        if (dc_tok == 15) {
  ------------------
  |  Branch (672:13): [True: 412k, False: 451k]
  ------------------
  673|   412k|            dc_tok = read_golomb(&ts->msac) + 15;
  674|   412k|            if (dbg)
  ------------------
  |  Branch (674:17): [Folded, False: 412k]
  ------------------
  675|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  676|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  677|       |
  678|   412k|            dc_tok &= 0xfffff;
  679|   412k|            dc_dq = ((dc_dq * dc_tok) & 0xffffff) >> dq_shift;
  680|   412k|            dc_dq = umin(dc_dq, cf_max + dc_sign);
  681|   451k|        } else {
  682|   451k|            dc_dq = ((dc_dq * dc_tok) >> dq_shift);
  683|   451k|            assert(dc_dq <= cf_max);
  ------------------
  |  |  140|   451k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 451k]
  |  |  |  Branch (140:68): [Folded, False: 451k]
  |  |  ------------------
  ------------------
  684|   451k|        }
  685|   863k|        cul_level = dc_tok;
  686|   863k|        cf[0] = (coef) (dc_sign ? -dc_dq : dc_dq);
  ------------------
  |  Branch (686:25): [True: 442k, False: 420k]
  ------------------
  687|       |
  688|  1.84M|        if (rc) ac_noqm: {
  ------------------
  |  Branch (688:13): [True: 867k, False: 18.4E]
  ------------------
  689|  1.84M|            const unsigned ac_dq = dq_tbl[1];
  690|  24.3M|            do {
  691|  24.3M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  24.3M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  692|  24.3M|                if (dbg)
  ------------------
  |  Branch (692:21): [Folded, False: 24.3M]
  ------------------
  693|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  694|  24.3M|                const unsigned rc_tok = cf[rc];
  695|  24.3M|                unsigned tok;
  696|  24.3M|                int dq;
  697|       |
  698|       |                // residual
  699|  24.3M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (699:21): [True: 6.24M, False: 18.1M]
  ------------------
  700|  6.24M|                    tok = read_golomb(&ts->msac) + 15;
  701|  6.24M|                    if (dbg)
  ------------------
  |  Branch (701:25): [Folded, False: 6.24M]
  ------------------
  702|      0|                        printf("Post-residual[%d=%d->%d]: r=%d\n",
  703|      0|                               rc, tok - 15, tok, ts->msac.rng);
  704|       |
  705|       |                    // coefficient parsing, see 5.11.39
  706|  6.24M|                    tok &= 0xfffff;
  707|       |
  708|       |                    // dequant, see 7.12.3
  709|  6.24M|                    dq = ((ac_dq * tok) & 0xffffff) >> dq_shift;
  710|  6.24M|                    dq = umin(dq, cf_max + sign);
  711|  18.1M|                } else {
  712|       |                    // cannot exceed cf_max, so we can avoid the clipping
  713|  18.1M|                    tok = rc_tok >> 11;
  714|  18.1M|                    dq = ((ac_dq * tok) >> dq_shift);
  715|  18.1M|                    assert(dq <= cf_max);
  ------------------
  |  |  140|  18.1M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 18.1M]
  |  |  |  Branch (140:68): [Folded, False: 18.1M]
  |  |  ------------------
  ------------------
  716|  18.1M|                }
  717|  24.3M|                cul_level += tok;
  718|  24.3M|                cf[rc] = (coef) (sign ? -dq : dq);
  ------------------
  |  Branch (718:34): [True: 12.3M, False: 12.0M]
  ------------------
  719|       |
  720|  24.3M|                rc = rc_tok & 0x3ff; // next non-zero rc, zero if eob
  721|  24.3M|            } while (rc);
  ------------------
  |  Branch (721:22): [True: 23.4M, False: 972k]
  ------------------
  722|  1.84M|        }
  723|   863k|    }
  724|       |
  725|       |    // context
  726|  3.00M|    *res_ctx = umin(cul_level, 63) | dc_sign_level;
  727|       |
  728|  3.00M|    return eob;
  729|  2.64M|}
recon_tmpl.c:get_skip_ctx:
   65|  3.19M|{
   66|  3.19M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
   67|       |
   68|  3.19M|    if (chroma) {
  ------------------
  |  Branch (68:9): [True: 989k, False: 2.20M]
  ------------------
   69|   989k|        const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   70|   989k|        const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   71|   989k|        const int not_one_blk = b_dim[2] - (!!b_dim[2] && ss_hor) > t_dim->lw ||
  ------------------
  |  Branch (71:33): [True: 48.1k, False: 941k]
  |  Branch (71:45): [True: 958k, False: 31.3k]
  |  Branch (71:59): [True: 755k, False: 202k]
  ------------------
   72|   941k|                                b_dim[3] - (!!b_dim[3] && ss_ver) > t_dim->lh;
  ------------------
  |  Branch (72:33): [True: 20.3k, False: 921k]
  |  Branch (72:45): [True: 904k, False: 36.9k]
  |  Branch (72:59): [True: 485k, False: 419k]
  ------------------
   73|   989k|        unsigned ca, cl;
   74|       |
   75|   989k|#define MERGE_CTX(dir, type, no_val) \
   76|   989k|        c##dir = *(const type *) dir != no_val; \
   77|   989k|        break
   78|       |
   79|   989k|        switch (t_dim->lw) {
   80|       |        /* For some reason the MSVC CRT _wassert() function is not flagged as
   81|       |         * __declspec(noreturn), so when using those headers the compiler will
   82|       |         * expect execution to continue after an assertion has been triggered
   83|       |         * and will therefore complain about the use of uninitialized variables
   84|       |         * when compiled in debug mode if we put the default case at the end. */
   85|      0|        default: assert(0); /* fall-through */
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (85:9): [True: 0, False: 989k]
  ------------------
   86|   741k|        case TX_4X4:   MERGE_CTX(a, uint8_t,  0x40);
  ------------------
  |  |   76|   741k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   741k|        break
  ------------------
  |  Branch (86:9): [True: 741k, False: 248k]
  ------------------
   87|   219k|        case TX_8X8:   MERGE_CTX(a, uint16_t, 0x4040);
  ------------------
  |  |   76|   219k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   219k|        break
  ------------------
  |  Branch (87:9): [True: 219k, False: 769k]
  ------------------
   88|  22.8k|        case TX_16X16: MERGE_CTX(a, uint32_t, 0x40404040U);
  ------------------
  |  |   76|  22.8k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  22.8k|        break
  ------------------
  |  Branch (88:9): [True: 22.8k, False: 966k]
  ------------------
   89|  3.35k|        case TX_32X32: MERGE_CTX(a, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  3.35k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  3.35k|        break
  ------------------
  |  Branch (89:9): [True: 3.35k, False: 986k]
  ------------------
   90|   989k|        }
   91|   987k|        switch (t_dim->lh) {
   92|      0|        default: assert(0); /* fall-through */
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 0, False: 987k]
  ------------------
   93|   538k|        case TX_4X4:   MERGE_CTX(l, uint8_t,  0x40);
  ------------------
  |  |   76|   538k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   538k|        break
  ------------------
  |  Branch (93:9): [True: 538k, False: 448k]
  ------------------
   94|   403k|        case TX_8X8:   MERGE_CTX(l, uint16_t, 0x4040);
  ------------------
  |  |   76|   403k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   403k|        break
  ------------------
  |  Branch (94:9): [True: 403k, False: 583k]
  ------------------
   95|  39.1k|        case TX_16X16: MERGE_CTX(l, uint32_t, 0x40404040U);
  ------------------
  |  |   76|  39.1k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  39.1k|        break
  ------------------
  |  Branch (95:9): [True: 39.1k, False: 947k]
  ------------------
   96|  6.15k|        case TX_32X32: MERGE_CTX(l, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  6.15k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  6.15k|        break
  ------------------
  |  Branch (96:9): [True: 6.15k, False: 980k]
  ------------------
   97|   987k|        }
   98|   986k|#undef MERGE_CTX
   99|       |
  100|   986k|        return 7 + not_one_blk * 3 + ca + cl;
  101|  2.20M|    } else if (b_dim[2] == t_dim->lw && b_dim[3] == t_dim->lh) {
  ------------------
  |  Branch (101:16): [True: 926k, False: 1.27M]
  |  Branch (101:41): [True: 907k, False: 19.2k]
  ------------------
  102|   907k|        return 0;
  103|  1.29M|    } else {
  104|  1.29M|        unsigned la, ll;
  105|       |
  106|  1.29M|#define MERGE_CTX(dir, type, tx) \
  107|  1.29M|        if (tx == TX_64X64) { \
  108|  1.29M|            uint64_t tmp = *(const uint64_t *) dir; \
  109|  1.29M|            tmp |= *(const uint64_t *) &dir[8]; \
  110|  1.29M|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  111|  1.29M|        } else \
  112|  1.29M|            l##dir = *(const type *) dir; \
  113|  1.29M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  114|  1.29M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  115|  1.29M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  116|  1.29M|        break
  117|       |
  118|  1.29M|        switch (t_dim->lw) {
  119|      0|        default: assert(0); /* fall-through */
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 1.29M]
  ------------------
  120|  1.04M|        case TX_4X4:   MERGE_CTX(a, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  1.04M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  1.04M|            l##dir = *(const type *) dir; \
  |  |  113|  1.04M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  114|  1.04M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  115|  1.04M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  116|  1.04M|        break
  ------------------
  |  Branch (120:9): [True: 1.04M, False: 250k]
  ------------------
  121|   253k|        case TX_8X8:   MERGE_CTX(a, uint16_t, TX_8X8);
  ------------------
  |  |  107|   253k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|   253k|            l##dir = *(const type *) dir; \
  |  |  113|   253k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  114|   253k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  115|   253k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 253k, Folded]
  |  |  ------------------
  |  |  116|   253k|        break
  ------------------
  |  Branch (121:9): [True: 253k, False: 1.04M]
  ------------------
  122|  21.6k|        case TX_16X16: MERGE_CTX(a, uint32_t, TX_16X16);
  ------------------
  |  |  107|  21.6k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 21.6k]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  21.6k|            l##dir = *(const type *) dir; \
  |  |  113|  21.6k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 21.6k]
  |  |  ------------------
  |  |  114|  21.6k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 21.6k, Folded]
  |  |  ------------------
  |  |  115|  21.6k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21.6k, Folded]
  |  |  ------------------
  |  |  116|  21.6k|        break
  ------------------
  |  Branch (122:9): [True: 21.6k, False: 1.27M]
  ------------------
  123|    982|        case TX_32X32: MERGE_CTX(a, uint32_t, TX_32X32);
  ------------------
  |  |  107|    982|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 982]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|    982|            l##dir = *(const type *) dir; \
  |  |  113|    982|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 982, Folded]
  |  |  ------------------
  |  |  114|    982|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 982, Folded]
  |  |  ------------------
  |  |  115|    982|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 982, Folded]
  |  |  ------------------
  |  |  116|    982|        break
  ------------------
  |  Branch (123:9): [True: 982, False: 1.29M]
  ------------------
  124|      0|        case TX_64X64: MERGE_CTX(a, uint32_t, TX_64X64);
  ------------------
  |  |  107|      0|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 0, Folded]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|      0|            l##dir = *(const type *) dir; \
  |  |  113|      0|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 0]
  |  |  ------------------
  |  |  114|      0|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 0, Folded]
  |  |  ------------------
  |  |  115|      0|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  ------------------
  |  |  116|      0|        break
  ------------------
  |  Branch (124:9): [True: 0, False: 1.29M]
  ------------------
  125|  1.29M|        }
  126|  1.32M|        switch (t_dim->lh) {
  127|      0|        default: assert(0); /* fall-through */
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (127:9): [True: 0, False: 1.32M]
  ------------------
  128|  1.04M|        case TX_4X4:   MERGE_CTX(l, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  1.04M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  1.04M|            l##dir = *(const type *) dir; \
  |  |  113|  1.04M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  114|  1.04M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  115|  1.04M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 1.04M]
  |  |  ------------------
  |  |  116|  1.04M|        break
  ------------------
  |  Branch (128:9): [True: 1.04M, False: 276k]
  ------------------
  129|   253k|        case TX_8X8:   MERGE_CTX(l, uint16_t, TX_8X8);
  ------------------
  |  |  107|   253k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|   253k|            l##dir = *(const type *) dir; \
  |  |  113|   253k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  114|   253k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 253k]
  |  |  ------------------
  |  |  115|   253k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 253k, Folded]
  |  |  ------------------
  |  |  116|   253k|        break
  ------------------
  |  Branch (129:9): [True: 253k, False: 1.06M]
  ------------------
  130|  21.6k|        case TX_16X16: MERGE_CTX(l, uint32_t, TX_16X16);
  ------------------
  |  |  107|  21.6k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 21.6k]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  21.6k|            l##dir = *(const type *) dir; \
  |  |  113|  21.6k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 21.6k]
  |  |  ------------------
  |  |  114|  21.6k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 21.6k, Folded]
  |  |  ------------------
  |  |  115|  21.6k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21.6k, Folded]
  |  |  ------------------
  |  |  116|  21.6k|        break
  ------------------
  |  Branch (130:9): [True: 21.6k, False: 1.30M]
  ------------------
  131|    982|        case TX_32X32: MERGE_CTX(l, uint32_t, TX_32X32);
  ------------------
  |  |  107|    982|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 982]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|    982|            l##dir = *(const type *) dir; \
  |  |  113|    982|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 982, Folded]
  |  |  ------------------
  |  |  114|    982|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 982, Folded]
  |  |  ------------------
  |  |  115|    982|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 982, Folded]
  |  |  ------------------
  |  |  116|    982|        break
  ------------------
  |  Branch (131:9): [True: 982, False: 1.32M]
  ------------------
  132|      0|        case TX_64X64: MERGE_CTX(l, uint32_t, TX_64X64);
  ------------------
  |  |  107|      0|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 0, Folded]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|      0|            l##dir = *(const type *) dir; \
  |  |  113|      0|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 0]
  |  |  ------------------
  |  |  114|      0|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 0, Folded]
  |  |  ------------------
  |  |  115|      0|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  ------------------
  |  |  116|      0|        break
  ------------------
  |  Branch (132:9): [True: 0, False: 1.32M]
  ------------------
  133|  1.32M|        }
  134|  1.32M|#undef MERGE_CTX
  135|       |
  136|  1.32M|        return dav1d_skip_ctx[umin(la & 0x3F, 4)][umin(ll & 0x3F, 4)];
  137|  1.32M|    }
  138|  3.19M|}
recon_tmpl.c:get_lo_ctx:
  304|  66.4M|{
  305|  66.4M|    unsigned mag = levels[0 * stride + 1] + levels[1 * stride + 0];
  306|  66.4M|    unsigned offset;
  307|  66.4M|    if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (307:9): [True: 61.9M, False: 4.57M]
  ------------------
  308|  61.9M|        mag += levels[1 * stride + 1];
  309|  61.9M|        *hi_mag = mag;
  310|  61.9M|        mag += levels[0 * stride + 2] + levels[2 * stride + 0];
  311|  61.9M|        offset = ctx_offsets[umin(y, 4)][umin(x, 4)];
  312|  61.9M|    } else {
  313|  4.57M|        mag += levels[0 * stride + 2];
  314|  4.57M|        *hi_mag = mag;
  315|  4.57M|        mag += levels[0 * stride + 3] + levels[0 * stride + 4];
  316|  4.57M|        offset = 26 + (y > 1 ? 10 : y * 5);
  ------------------
  |  Branch (316:24): [True: 3.85M, False: 715k]
  ------------------
  317|  4.57M|    }
  318|  66.4M|    return offset + (mag > 512 ? 4 : (mag + 64) >> 7);
  ------------------
  |  Branch (318:22): [True: 21.8M, False: 44.6M]
  ------------------
  319|  66.4M|}
recon_tmpl.c:get_dc_sign_ctx:
  143|  2.65M|{
  144|  2.65M|    uint64_t mask = 0xC0C0C0C0C0C0C0C0ULL, mul = 0x0101010101010101ULL;
  145|  2.65M|    int s;
  146|       |
  147|  2.65M|#if ARCH_X86_64 && defined(__GNUC__)
  148|       |    /* Coerce compilers into producing better code. For some reason
  149|       |     * every x86-64 compiler is awful at handling 64-bit constants. */
  150|  2.65M|    __asm__("" : "+r"(mask), "+r"(mul));
  151|  2.65M|#endif
  152|       |
  153|  2.65M|    switch(tx) {
  154|      0|    default: assert(0); /* fall-through */
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, Folded]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (154:5): [True: 0, False: 2.65M]
  ------------------
  155|  1.38M|    case TX_4X4: {
  ------------------
  |  Branch (155:5): [True: 1.38M, False: 1.27M]
  ------------------
  156|  1.38M|        int t = *(const uint8_t *) a >> 6;
  157|  1.38M|        t    += *(const uint8_t *) l >> 6;
  158|  1.38M|        s = t - 1 - 1;
  159|  1.38M|        break;
  160|      0|    }
  161|  1.01M|    case TX_8X8: {
  ------------------
  |  Branch (161:5): [True: 1.01M, False: 1.64M]
  ------------------
  162|  1.01M|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  163|  1.01M|        t         += *(const uint16_t *) l & (uint32_t) mask;
  164|  1.01M|        t *= 0x04040404U;
  165|  1.01M|        s = (int) (t >> 24) - 2 - 2;
  166|  1.01M|        break;
  167|      0|    }
  168|  63.5k|    case TX_16X16: {
  ------------------
  |  Branch (168:5): [True: 63.5k, False: 2.59M]
  ------------------
  169|  63.5k|        uint32_t t = (*(const uint32_t *) a & (uint32_t) mask) >> 6;
  170|  63.5k|        t         += (*(const uint32_t *) l & (uint32_t) mask) >> 6;
  171|  63.5k|        t *= (uint32_t) mul;
  172|  63.5k|        s = (int) (t >> 24) - 4 - 4;
  173|  63.5k|        break;
  174|      0|    }
  175|  3.93k|    case TX_32X32: {
  ------------------
  |  Branch (175:5): [True: 3.93k, False: 2.64M]
  ------------------
  176|  3.93k|        uint64_t t = (*(const uint64_t *) a & mask) >> 6;
  177|  3.93k|        t         += (*(const uint64_t *) l & mask) >> 6;
  178|  3.93k|        t *= mul;
  179|  3.93k|        s = (int) (t >> 56) - 8 - 8;
  180|  3.93k|        break;
  181|      0|    }
  182|    553|    case TX_64X64: {
  ------------------
  |  Branch (182:5): [True: 553, False: 2.65M]
  ------------------
  183|    553|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  184|    553|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  185|    553|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  186|    553|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  187|    553|        t *= mul;
  188|    553|        s = (int) (t >> 56) - 16 - 16;
  189|    553|        break;
  190|      0|    }
  191|   170k|    case RTX_4X8: {
  ------------------
  |  Branch (191:5): [True: 170k, False: 2.48M]
  ------------------
  192|   170k|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  193|   170k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  194|   170k|        t *= 0x04040404U;
  195|   170k|        s = (int) (t >> 24) - 1 - 2;
  196|   170k|        break;
  197|      0|    }
  198|  11.0k|    case RTX_8X4: {
  ------------------
  |  Branch (198:5): [True: 11.0k, False: 2.64M]
  ------------------
  199|  11.0k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  200|  11.0k|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  201|  11.0k|        t *= 0x04040404U;
  202|  11.0k|        s = (int) (t >> 24) - 2 - 1;
  203|  11.0k|        break;
  204|      0|    }
  205|  19.8k|    case RTX_8X16: {
  ------------------
  |  Branch (205:5): [True: 19.8k, False: 2.63M]
  ------------------
  206|  19.8k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  207|  19.8k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  208|  19.8k|        t = (t >> 6) * (uint32_t) mul;
  209|  19.8k|        s = (int) (t >> 24) - 2 - 4;
  210|  19.8k|        break;
  211|      0|    }
  212|  6.80k|    case RTX_16X8: {
  ------------------
  |  Branch (212:5): [True: 6.80k, False: 2.64M]
  ------------------
  213|  6.80k|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  214|  6.80k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  215|  6.80k|        t = (t >> 6) * (uint32_t) mul;
  216|  6.80k|        s = (int) (t >> 24) - 4 - 2;
  217|  6.80k|        break;
  218|      0|    }
  219|  1.75k|    case RTX_16X32: {
  ------------------
  |  Branch (219:5): [True: 1.75k, False: 2.65M]
  ------------------
  220|  1.75k|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  221|  1.75k|        t         += *(const uint64_t *) l & mask;
  222|  1.75k|        t = (t >> 6) * mul;
  223|  1.75k|        s = (int) (t >> 56) - 4 - 8;
  224|  1.75k|        break;
  225|      0|    }
  226|    332|    case RTX_32X16: {
  ------------------
  |  Branch (226:5): [True: 332, False: 2.65M]
  ------------------
  227|    332|        uint64_t t = *(const uint64_t *) a & mask;
  228|    332|        t         += *(const uint32_t *) l & (uint32_t) mask;
  229|    332|        t = (t >> 6) * mul;
  230|    332|        s = (int) (t >> 56) - 8 - 4;
  231|    332|        break;
  232|      0|    }
  233|     97|    case RTX_32X64: {
  ------------------
  |  Branch (233:5): [True: 97, False: 2.65M]
  ------------------
  234|     97|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  235|     97|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  236|     97|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  237|     97|        t *= mul;
  238|     97|        s = (int) (t >> 56) - 8 - 16;
  239|     97|        break;
  240|      0|    }
  241|     98|    case RTX_64X32: {
  ------------------
  |  Branch (241:5): [True: 98, False: 2.65M]
  ------------------
  242|     98|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  243|     98|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  244|     98|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  245|     98|        t *= mul;
  246|     98|        s = (int) (t >> 56) - 16 - 8;
  247|     98|        break;
  248|      0|    }
  249|      0|    case RTX_4X16: {
  ------------------
  |  Branch (249:5): [True: 0, False: 2.65M]
  ------------------
  250|      0|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  251|      0|        t         += *(const uint32_t *) l & (uint32_t) mask;
  252|      0|        t = (t >> 6) * (uint32_t) mul;
  253|      0|        s = (int) (t >> 24) - 1 - 4;
  254|      0|        break;
  255|      0|    }
  256|      0|    case RTX_16X4: {
  ------------------
  |  Branch (256:5): [True: 0, False: 2.65M]
  ------------------
  257|      0|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  258|      0|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  259|      0|        t = (t >> 6) * (uint32_t) mul;
  260|      0|        s = (int) (t >> 24) - 4 - 1;
  261|      0|        break;
  262|      0|    }
  263|      0|    case RTX_8X32: {
  ------------------
  |  Branch (263:5): [True: 0, False: 2.65M]
  ------------------
  264|      0|        uint64_t t = *(const uint16_t *) a & (uint32_t) mask;
  265|      0|        t         += *(const uint64_t *) l & mask;
  266|      0|        t = (t >> 6) * mul;
  267|      0|        s = (int) (t >> 56) - 2 - 8;
  268|      0|        break;
  269|      0|    }
  270|      0|    case RTX_32X8: {
  ------------------
  |  Branch (270:5): [True: 0, False: 2.65M]
  ------------------
  271|      0|        uint64_t t = *(const uint64_t *) a & mask;
  272|      0|        t         += *(const uint16_t *) l & (uint32_t) mask;
  273|      0|        t = (t >> 6) * mul;
  274|      0|        s = (int) (t >> 56) - 8 - 2;
  275|      0|        break;
  276|      0|    }
  277|      0|    case RTX_16X64: {
  ------------------
  |  Branch (277:5): [True: 0, False: 2.65M]
  ------------------
  278|      0|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  279|      0|        t         += *(const uint64_t *) &l[0] & mask;
  280|      0|        t = (t >> 6) + ((*(const uint64_t *) &l[8] & mask) >> 6);
  281|      0|        t *= mul;
  282|      0|        s = (int) (t >> 56) - 4 - 16;
  283|      0|        break;
  284|      0|    }
  285|      0|    case RTX_64X16: {
  ------------------
  |  Branch (285:5): [True: 0, False: 2.65M]
  ------------------
  286|      0|        uint64_t t = *(const uint64_t *) &a[0] & mask;
  287|      0|        t         += *(const uint32_t *) l & (uint32_t) mask;
  288|      0|        t = (t >> 6) + ((*(const uint64_t *) &a[8] & mask) >> 6);
  289|      0|        t *= mul;
  290|      0|        s = (int) (t >> 56) - 16 - 4;
  291|      0|        break;
  292|      0|    }
  293|  2.65M|    }
  294|       |
  295|  2.65M|    return (s != 0) + (s > 0);
  296|  2.65M|}
recon_tmpl.c:read_golomb:
   49|  8.80M|static inline unsigned read_golomb(MsacContext *const msac) {
   50|  8.80M|    int len = 0;
   51|  8.80M|    unsigned val = 1;
   52|       |
   53|  39.6M|    while (!dav1d_msac_decode_bool_equi(msac) && len < 32) len++;
  ------------------
  |  |   53|  39.6M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (53:12): [True: 30.8M, False: 8.82M]
  |  Branch (53:50): [True: 30.8M, False: 18.4E]
  ------------------
   54|  39.6M|    while (len--) val = (val << 1) + dav1d_msac_decode_bool_equi(msac);
  ------------------
  |  |   53|  30.8M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (54:12): [True: 30.8M, False: 8.80M]
  ------------------
   55|       |
   56|  8.80M|    return val - 1;
   57|  8.80M|}
recon_tmpl.c:mc:
  944|   475k|{
  945|   475k|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  |  140|   475k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 475k]
  |  |  |  Branch (140:68): [Folded, False: 475k]
  |  |  ------------------
  ------------------
  946|   475k|    const Dav1dFrameContext *const f = t->f;
  947|   475k|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (947:24): [True: 163k, False: 312k]
  |  Branch (947:32): [True: 84.3k, False: 78.8k]
  ------------------
  948|   475k|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (948:24): [True: 163k, False: 312k]
  |  Branch (948:32): [True: 129k, False: 33.9k]
  ------------------
  949|   475k|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
  950|   475k|    const int mvx = mv.x, mvy = mv.y;
  951|   475k|    const int mx = mvx & (15 >> !ss_hor), my = mvy & (15 >> !ss_ver);
  952|   475k|    ptrdiff_t ref_stride = refp->p.stride[!!pl];
  953|   475k|    const pixel *ref;
  954|       |
  955|   475k|    if (refp->p.p.w == f->cur.p.w && refp->p.p.h == f->cur.p.h) {
  ------------------
  |  Branch (955:9): [True: 98.4k, False: 377k]
  |  Branch (955:38): [True: 51.0k, False: 47.3k]
  ------------------
  956|  51.0k|        const int dx = bx * h_mul + (mvx >> (3 + ss_hor));
  957|  51.0k|        const int dy = by * v_mul + (mvy >> (3 + ss_ver));
  958|  51.0k|        int w, h;
  959|       |
  960|  51.1k|        if (refp->p.data[0] != f->cur.data[0]) { // i.e. not for intrabc
  ------------------
  |  Branch (960:13): [True: 51.1k, False: 18.4E]
  ------------------
  961|  51.1k|            w = (f->cur.p.w + ss_hor) >> ss_hor;
  962|  51.1k|            h = (f->cur.p.h + ss_ver) >> ss_ver;
  963|  18.4E|        } else {
  964|  18.4E|            w = f->bw * 4 >> ss_hor;
  965|  18.4E|            h = f->bh * 4 >> ss_ver;
  966|  18.4E|        }
  967|  51.0k|        if (dx < !!mx * 3 || dy < !!my * 3 ||
  ------------------
  |  Branch (967:13): [True: 7.11k, False: 43.9k]
  |  Branch (967:30): [True: 5.00k, False: 38.9k]
  ------------------
  968|  38.9k|            dx + bw4 * h_mul + !!mx * 4 > w ||
  ------------------
  |  Branch (968:13): [True: 9.68k, False: 29.2k]
  ------------------
  969|  29.2k|            dy + bh4 * v_mul + !!my * 4 > h)
  ------------------
  |  Branch (969:13): [True: 5.97k, False: 23.3k]
  ------------------
  970|  27.8k|        {
  971|  27.8k|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|  27.8k|#define bitfn(x) x##_8bpc
  ------------------
  972|  27.8k|            f->dsp->mc.emu_edge(bw4 * h_mul + !!mx * 7, bh4 * v_mul + !!my * 7,
  973|  27.8k|                                w, h, dx - !!mx * 3, dy - !!my * 3,
  974|  27.8k|                                emu_edge_buf, 192 * sizeof(pixel),
  975|  27.8k|                                refp->p.data[pl], ref_stride);
  976|  27.8k|            ref = &emu_edge_buf[192 * !!my * 3 + !!mx * 3];
  977|  27.8k|            ref_stride = 192 * sizeof(pixel);
  978|  27.8k|        } else {
  979|  23.2k|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|  23.2k|#define PXSTRIDE(x) (x)
  ------------------
  980|  23.2k|        }
  981|       |
  982|  51.1k|        if (dst8 != NULL) {
  ------------------
  |  Branch (982:13): [True: 51.1k, False: 18.4E]
  ------------------
  983|  51.1k|            f->dsp->mc.mc[filter_2d](dst8, dst_stride, ref, ref_stride, bw4 * h_mul,
  984|  51.1k|                                     bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  985|  51.1k|                                     HIGHBD_CALL_SUFFIX);
  986|  18.4E|        } else {
  987|  18.4E|            f->dsp->mc.mct[filter_2d](dst16, ref, ref_stride, bw4 * h_mul,
  988|  18.4E|                                      bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  989|  18.4E|                                      HIGHBD_CALL_SUFFIX);
  990|  18.4E|        }
  991|   424k|    } else {
  992|   424k|        assert(refp != &f->sr_cur);
  ------------------
  |  |  140|   424k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 424k]
  |  |  |  Branch (140:68): [Folded, False: 424k]
  |  |  ------------------
  ------------------
  993|       |
  994|   424k|        const int orig_pos_y = (by * v_mul << 4) + mvy * (1 << !ss_ver);
  995|   424k|        const int orig_pos_x = (bx * h_mul << 4) + mvx * (1 << !ss_hor);
  996|   424k|#define scale_mv(res, val, scale) do { \
  997|   424k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  998|   424k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  999|   424k|        } while (0)
 1000|   424k|        int pos_y, pos_x;
 1001|   424k|        scale_mv(pos_x, orig_pos_x, f->svc[refidx][0].scale);
  ------------------
  |  |  996|   424k|#define scale_mv(res, val, scale) do { \
  |  |  997|   424k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|   424k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|   424k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 424k]
  |  |  ------------------
  ------------------
 1002|   424k|        scale_mv(pos_y, orig_pos_y, f->svc[refidx][1].scale);
  ------------------
  |  |  996|   424k|#define scale_mv(res, val, scale) do { \
  |  |  997|   424k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|   424k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|   424k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 424k]
  |  |  ------------------
  ------------------
 1003|   424k|#undef scale_mv
 1004|   424k|        const int left = pos_x >> 10;
 1005|   424k|        const int top = pos_y >> 10;
 1006|   424k|        const int right =
 1007|   424k|            ((pos_x + (bw4 * h_mul - 1) * f->svc[refidx][0].step) >> 10) + 1;
 1008|   424k|        const int bottom =
 1009|   424k|            ((pos_y + (bh4 * v_mul - 1) * f->svc[refidx][1].step) >> 10) + 1;
 1010|       |
 1011|   424k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   424k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 424k]
  |  |  ------------------
  |  |   35|   424k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   424k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1012|      0|            printf("Off %dx%d [%d,%d,%d], size %dx%d [%d,%d]\n",
 1013|      0|                   left, top, orig_pos_x, f->svc[refidx][0].scale, refidx,
 1014|      0|                   right-left, bottom-top,
 1015|      0|                   f->svc[refidx][0].step, f->svc[refidx][1].step);
 1016|       |
 1017|   424k|        const int w = (refp->p.p.w + ss_hor) >> ss_hor;
 1018|   424k|        const int h = (refp->p.p.h + ss_ver) >> ss_ver;
 1019|   424k|        if (left < 3 || top < 3 || right + 4 > w || bottom + 4 > h) {
  ------------------
  |  Branch (1019:13): [True: 75.7k, False: 348k]
  |  Branch (1019:25): [True: 56.0k, False: 292k]
  |  Branch (1019:36): [True: 52.7k, False: 240k]
  |  Branch (1019:53): [True: 39.1k, False: 200k]
  ------------------
 1020|   224k|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|   224k|#define bitfn(x) x##_8bpc
  ------------------
 1021|   224k|            f->dsp->mc.emu_edge(right - left + 7, bottom - top + 7,
 1022|   224k|                                w, h, left - 3, top - 3,
 1023|   224k|                                emu_edge_buf, 320 * sizeof(pixel),
 1024|   224k|                                refp->p.data[pl], ref_stride);
 1025|   224k|            ref = &emu_edge_buf[320 * 3 + 3];
 1026|   224k|            ref_stride = 320 * sizeof(pixel);
 1027|   224k|            if (DEBUG_BLOCK_INFO) printf("Emu\n");
  ------------------
  |  |   34|   224k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 224k]
  |  |  ------------------
  |  |   35|   224k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   224k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1028|   224k|        } else {
 1029|   200k|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * top + left;
  ------------------
  |  |   53|   200k|#define PXSTRIDE(x) (x)
  ------------------
 1030|   200k|        }
 1031|       |
 1032|   424k|        if (dst8 != NULL) {
  ------------------
  |  Branch (1032:13): [True: 424k, False: 18.4E]
  ------------------
 1033|   424k|            f->dsp->mc.mc_scaled[filter_2d](dst8, dst_stride, ref, ref_stride,
 1034|   424k|                                            bw4 * h_mul, bh4 * v_mul,
 1035|   424k|                                            pos_x & 0x3ff, pos_y & 0x3ff,
 1036|   424k|                                            f->svc[refidx][0].step,
 1037|   424k|                                            f->svc[refidx][1].step
 1038|   424k|                                            HIGHBD_CALL_SUFFIX);
 1039|  18.4E|        } else {
 1040|  18.4E|            f->dsp->mc.mct_scaled[filter_2d](dst16, ref, ref_stride,
 1041|  18.4E|                                             bw4 * h_mul, bh4 * v_mul,
 1042|  18.4E|                                             pos_x & 0x3ff, pos_y & 0x3ff,
 1043|  18.4E|                                             f->svc[refidx][0].step,
 1044|  18.4E|                                             f->svc[refidx][1].step
 1045|  18.4E|                                             HIGHBD_CALL_SUFFIX);
 1046|  18.4E|        }
 1047|   424k|    }
 1048|       |
 1049|   475k|    return 0;
 1050|   475k|}
recon_tmpl.c:warp_affine:
 1120|  7.15k|{
 1121|  7.15k|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  |  140|  7.15k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 7.15k]
  |  |  |  Branch (140:68): [Folded, False: 7.15k]
  |  |  ------------------
  ------------------
 1122|  7.15k|    const Dav1dFrameContext *const f = t->f;
 1123|  7.15k|    const Dav1dDSPContext *const dsp = f->dsp;
 1124|  7.15k|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (1124:24): [True: 2.15k, False: 4.99k]
  |  Branch (1124:32): [True: 14, False: 2.14k]
  ------------------
 1125|  7.15k|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (1125:24): [True: 2.16k, False: 4.99k]
  |  Branch (1125:32): [True: 32, False: 2.12k]
  ------------------
 1126|  7.15k|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
 1127|  7.15k|    assert(!((b_dim[0] * h_mul) & 7) && !((b_dim[1] * v_mul) & 7));
  ------------------
  |  |  140|  14.3k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 7.15k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 7.15k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 7.15k]
  |  |  ------------------
  ------------------
 1128|  7.15k|    const int32_t *const mat = wmp->matrix;
 1129|  7.15k|    const int width = (refp->p.p.w + ss_hor) >> ss_hor;
 1130|  7.15k|    const int height = (refp->p.p.h + ss_ver) >> ss_ver;
 1131|       |
 1132|  14.7k|    for (int y = 0; y < b_dim[1] * v_mul; y += 8) {
  ------------------
  |  Branch (1132:21): [True: 7.60k, False: 7.15k]
  ------------------
 1133|  7.60k|        const int src_y = t->by * 4 + ((y + 4) << ss_ver);
 1134|  7.60k|        const int64_t mat3_y = (int64_t) mat[3] * src_y + mat[0];
 1135|  7.60k|        const int64_t mat5_y = (int64_t) mat[5] * src_y + mat[1];
 1136|  16.0k|        for (int x = 0; x < b_dim[0] * h_mul; x += 8) {
  ------------------
  |  Branch (1136:25): [True: 8.47k, False: 7.60k]
  ------------------
 1137|       |            // calculate transformation relative to center of 8x8 block in
 1138|       |            // luma pixel units
 1139|  8.47k|            const int src_x = t->bx * 4 + ((x + 4) << ss_hor);
 1140|  8.47k|            const int64_t mvx = ((int64_t) mat[2] * src_x + mat3_y) >> ss_hor;
 1141|  8.47k|            const int64_t mvy = ((int64_t) mat[4] * src_x + mat5_y) >> ss_ver;
 1142|       |
 1143|  8.47k|            const int dx = (int) (mvx >> 16) - 4;
 1144|  8.47k|            const int mx = (((int) mvx & 0xffff) - wmp->u.p.alpha * 4 -
 1145|  8.47k|                                                   wmp->u.p.beta  * 7) & ~0x3f;
 1146|  8.47k|            const int dy = (int) (mvy >> 16) - 4;
 1147|  8.47k|            const int my = (((int) mvy & 0xffff) - wmp->u.p.gamma * 4 -
 1148|  8.47k|                                                   wmp->u.p.delta * 4) & ~0x3f;
 1149|       |
 1150|  8.47k|            const pixel *ref_ptr;
 1151|  8.47k|            ptrdiff_t ref_stride = refp->p.stride[!!pl];
 1152|       |
 1153|  8.47k|            if (dx < 3 || dx + 8 + 4 > width || dy < 3 || dy + 8 + 4 > height) {
  ------------------
  |  Branch (1153:17): [True: 1.66k, False: 6.80k]
  |  Branch (1153:27): [True: 1.88k, False: 4.92k]
  |  Branch (1153:49): [True: 1.19k, False: 3.73k]
  |  Branch (1153:59): [True: 686, False: 3.05k]
  ------------------
 1154|  5.44k|                pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|  5.44k|#define bitfn(x) x##_8bpc
  ------------------
 1155|  5.44k|                f->dsp->mc.emu_edge(15, 15, width, height, dx - 3, dy - 3,
 1156|  5.44k|                                    emu_edge_buf, 32 * sizeof(pixel),
 1157|  5.44k|                                    refp->p.data[pl], ref_stride);
 1158|  5.44k|                ref_ptr = &emu_edge_buf[32 * 3 + 3];
 1159|  5.44k|                ref_stride = 32 * sizeof(pixel);
 1160|  5.44k|            } else {
 1161|  3.02k|                ref_ptr = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|  3.02k|#define PXSTRIDE(x) (x)
  ------------------
 1162|  3.02k|            }
 1163|  8.47k|            if (dst16 != NULL)
  ------------------
  |  Branch (1163:17): [True: 0, False: 8.47k]
  ------------------
 1164|      0|                dsp->mc.warp8x8t(&dst16[x], dstride, ref_ptr, ref_stride,
 1165|      0|                                 wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1166|  8.47k|            else
 1167|  8.47k|                dsp->mc.warp8x8(&dst8[x], dstride, ref_ptr, ref_stride,
 1168|  8.47k|                                wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1169|  8.47k|        }
 1170|  7.62k|        if (dst8) dst8  += 8 * PXSTRIDE(dstride);
  ------------------
  |  |   53|  7.62k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (1170:13): [True: 7.62k, False: 18.4E]
  ------------------
 1171|  18.4E|        else      dst16 += 8 * dstride;
 1172|  7.60k|    }
 1173|  7.15k|    return 0;
 1174|  7.15k|}
dav1d_recon_b_intra_16bpc:
 1179|   134k|{
 1180|   134k|    Dav1dTileState *const ts = t->ts;
 1181|   134k|    const Dav1dFrameContext *const f = t->f;
 1182|   134k|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|   134k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|   134k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|   134k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|   134k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|   134k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|   134k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|   134k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|   134k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|   134k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 69.1k, False: 65.7k]
  ------------------
 1192|  69.1k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 57.9k, False: 11.2k]
  |  Branch (1192:45): [True: 5.74k, False: 5.48k]
  ------------------
 1193|  63.6k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 60.1k, False: 3.52k]
  |  Branch (1193:45): [True: 1.80k, False: 1.72k]
  ------------------
 1194|   134k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   134k|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|   134k|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   77|   134k|#define bitfn(x) x##_16bpc
  ------------------
 1199|   134k|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|   134k|    const int intra_edge_filter_flag = f->seq_hdr->intra_edge_filter << 10;
 1202|       |
 1203|   270k|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (1203:26): [True: 134k, False: 135k]
  ------------------
 1204|   134k|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|   134k|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|   270k|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 134k, False: 135k]
  ------------------
 1207|   134k|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 26.2k, False: 108k]
  ------------------
 1208|  26.2k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|  26.2k|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1210|  26.2k|                const uint8_t *pal_idx;
 1211|  26.2k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 0, False: 26.2k]
  ------------------
 1212|      0|                    const int p = t->frame_thread.pass & 1;
 1213|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1214|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|      0|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|  26.2k|                } else {
 1217|  26.2k|                    pal_idx = t->scratch.pal_idx_y;
 1218|  26.2k|                }
 1219|  26.2k|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 0, False: 26.2k]
  ------------------
 1220|      0|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|      0|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|  26.2k|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  26.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  26.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1223|  26.2k|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|  26.2k|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|  26.2k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  26.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 26.2k]
  |  |  ------------------
  |  |   35|  26.2k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  26.2k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1226|      0|                    hex_dump(dst, PXSTRIDE(f->cur.stride[0]),
 1227|      0|                             bw4 * 4, bh4 * 4, "y-pal-pred");
 1228|  26.2k|            }
 1229|       |
 1230|   134k|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|   134k|                                     sm_flag(&t->l, by4) |
 1232|   134k|                                     intra_edge_filter_flag);
 1233|   134k|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 0, False: 134k]
  |  Branch (1233:58): [True: 0, False: 134k]
  ------------------
 1234|   134k|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|   134k|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 0, False: 134k]
  |  Branch (1235:48): [True: 0, False: 134k]
  ------------------
 1236|   134k|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|   134k|            int y, x;
 1238|   134k|            const int sub_w4 = imin(w4, init_x + 16);
 1239|   305k|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 169k, False: 135k]
  ------------------
 1240|   170k|                 y += t_dim->h, t->by += t_dim->h)
 1241|   169k|            {
 1242|   169k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|   169k|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
 1244|   169k|                                    t->bx + init_x);
 1245|   409k|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 239k, False: 170k]
  ------------------
 1246|   240k|                     x += t_dim->w, t->bx += t_dim->w)
 1247|   239k|                {
 1248|   239k|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 72.1k, False: 167k]
  ------------------
 1249|       |
 1250|   167k|                    int angle = b->y_angle;
 1251|   167k|                    const enum EdgeFlags edge_flags =
 1252|   167k|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 39.1k, False: 128k]
  |  Branch (1252:42): [True: 26.5k, False: 101k]
  |  Branch (1252:57): [True: 42.4k, False: 23.9k]
  ------------------
 1253|   125k|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|   167k|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 39.2k, False: 128k]
  |  Branch (1254:42): [True: 63.5k, False: 64.5k]
  |  Branch (1254:56): [True: 53.9k, False: 9.61k]
  ------------------
 1255|  93.4k|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|   167k|                    const pixel *top_sb_edge = NULL;
 1257|   167k|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 43.5k, False: 123k]
  ------------------
 1258|  43.5k|                        top_sb_edge = f->ipred_edge[0];
 1259|  43.5k|                        const int sby = t->by >> f->sb_shift;
 1260|  43.5k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|  43.5k|                    }
 1262|   167k|                    const enum IntraPredMode m =
 1263|   167k|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|   167k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   167k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1264|   167k|                                                          t->bx > ts->tiling.col_start,
 1265|   167k|                                                          t->by,
 1266|   167k|                                                          t->by > ts->tiling.row_start,
 1267|   167k|                                                          ts->tiling.col_end,
 1268|   167k|                                                          ts->tiling.row_end,
 1269|   167k|                                                          edge_flags, dst,
 1270|   167k|                                                          f->cur.stride[0], top_sb_edge,
 1271|   167k|                                                          b->y_mode, &angle,
 1272|   167k|                                                          t_dim->w, t_dim->h,
 1273|   167k|                                                          f->seq_hdr->intra_edge_filter,
 1274|   167k|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   167k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1275|   167k|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|   167k|                                             t_dim->w * 4, t_dim->h * 4,
 1277|   167k|                                             angle | intra_flags,
 1278|   167k|                                             4 * f->bw - 4 * t->bx,
 1279|   167k|                                             4 * f->bh - 4 * t->by
 1280|   167k|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   167k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1281|       |
 1282|   167k|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   167k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 167k]
  |  |  ------------------
  |  |   35|   167k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   167k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                  if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1283|      0|                        hex_dump(edge - t_dim->h * 4, t_dim->h * 4,
 1284|      0|                                 t_dim->h * 4, 2, "l");
 1285|      0|                        hex_dump(edge, 0, 1, 1, "tl");
 1286|      0|                        hex_dump(edge + 1, t_dim->w * 4,
 1287|      0|                                 t_dim->w * 4, 2, "t");
 1288|      0|                        hex_dump(dst, f->cur.stride[0],
 1289|      0|                                 t_dim->w * 4, t_dim->h * 4, "y-intra-pred");
 1290|      0|                    }
 1291|       |
 1292|   240k|                skip_y_pred: {}
 1293|   240k|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 240k, False: 18.4E]
  ------------------
 1294|   240k|                        coef *cf;
 1295|   240k|                        int eob;
 1296|   240k|                        enum TxfmType txtp;
 1297|   240k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 0, False: 240k]
  ------------------
 1298|      0|                            const int p = t->frame_thread.pass & 1;
 1299|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|      0|                            cf = ts->frame_thread[p].cf;
 1301|      0|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|      0|                            eob  = cbi >> 5;
 1303|      0|                            txtp = cbi & 0x1f;
 1304|   240k|                        } else {
 1305|   240k|                            uint8_t cf_ctx;
 1306|   240k|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|   240k|#define bitfn(x) x##_16bpc
  ------------------
 1307|   240k|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|   240k|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|   240k|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|   240k|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   240k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 240k]
  |  |  ------------------
  |  |   35|   240k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   240k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1311|      0|                                printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
 1312|      0|                                       b->tx, txtp, eob, ts->msac.rng);
 1313|   240k|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|   240k|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|   240k|                        }
 1316|   240k|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 193k, False: 46.5k]
  ------------------
 1317|   193k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   193k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 193k]
  |  |  ------------------
  |  |   35|   193k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   193k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1318|      0|                                coef_dump(cf, imin(t_dim->h, 8) * 4,
 1319|      0|                                          imin(t_dim->w, 8) * 4, 3, "dq");
 1320|   193k|                            dsp->itx.itxfm_add[b->tx]
 1321|   193k|                                              [txtp](dst,
 1322|   193k|                                                     f->cur.stride[0],
 1323|   193k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   193k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1324|   193k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   193k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 193k]
  |  |  ------------------
  |  |   35|   193k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   193k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1325|      0|                                hex_dump(dst, f->cur.stride[0],
 1326|      0|                                         t_dim->w * 4, t_dim->h * 4, "recon");
 1327|   193k|                        }
 1328|  18.4E|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 0, False: 18.4E]
  ------------------
 1329|      0|                        dav1d_memset_pow2[t_dim->lw](&t->a->lcoef[bx4 + x], 0x40);
 1330|      0|                        dav1d_memset_pow2[t_dim->lh](&t->l.lcoef[by4 + y], 0x40);
 1331|      0|                    }
 1332|   240k|                    dst += 4 * t_dim->w;
 1333|   240k|                }
 1334|   170k|                t->bx -= x;
 1335|   170k|            }
 1336|   135k|            t->by -= y;
 1337|       |
 1338|   135k|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 72.8k, False: 62.6k]
  ------------------
 1339|       |
 1340|  62.6k|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|  62.6k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 15.4k, False: 47.1k]
  ------------------
 1343|  15.4k|                assert(!init_x && !init_y);
  ------------------
  |  |  140|  30.8k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 15.4k, False: 0]
  |  |  |  Branch (140:30): [True: 15.4k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
 1344|       |
 1345|  15.4k|                int16_t *const ac = t->scratch.ac;
 1346|  15.4k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|  15.4k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
 1348|  15.4k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|  15.4k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
 1350|  15.4k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|  15.4k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|  15.4k|                const int furthest_r =
 1354|  15.4k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|  15.4k|                const int furthest_b =
 1356|  15.4k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|  15.4k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|  15.4k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|  15.4k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|  15.4k|                                                         cbw4 * 4, cbh4 * 4);
 1361|  46.3k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 30.8k, False: 15.4k]
  ------------------
 1362|  30.8k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 2.79k, False: 28.0k]
  ------------------
 1363|  28.0k|                    int angle = 0;
 1364|  28.0k|                    const pixel *top_sb_edge = NULL;
 1365|  28.0k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 9.84k, False: 18.2k]
  ------------------
 1366|  9.84k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|  9.84k|                        const int sby = t->by >> f->sb_shift;
 1368|  9.84k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|  9.84k|                    }
 1370|  28.0k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|  28.0k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|  28.0k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|  28.0k|                    const enum IntraPredMode m =
 1374|  28.0k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  28.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  28.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1375|  28.0k|                                                          ypos, ypos > ystart,
 1376|  28.0k|                                                          ts->tiling.col_end >> ss_hor,
 1377|  28.0k|                                                          ts->tiling.row_end >> ss_ver,
 1378|  28.0k|                                                          0, uv_dst[pl], stride,
 1379|  28.0k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|  28.0k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|  28.0k|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  28.0k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1382|  28.0k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|  28.0k|                                           uv_t_dim->w * 4,
 1384|  28.0k|                                           uv_t_dim->h * 4,
 1385|  28.0k|                                           ac, b->cfl_alpha[pl]
 1386|  28.0k|                                           HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  28.0k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1387|  28.0k|                }
 1388|  15.4k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  15.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.4k]
  |  |  ------------------
  |  |   35|  15.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  15.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1389|      0|                    ac_dump(ac, 4*cbw4, 4*cbh4, "ac");
 1390|      0|                    hex_dump(uv_dst[0], stride, cbw4 * 4, cbh4 * 4, "u-cfl-pred");
 1391|      0|                    hex_dump(uv_dst[1], stride, cbw4 * 4, cbh4 * 4, "v-cfl-pred");
 1392|      0|                }
 1393|  47.1k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 15.4k, False: 31.7k]
  ------------------
 1394|  15.4k|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|  15.4k|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1396|  15.4k|                const pixel (*pal)[8];
 1397|  15.4k|                const uint8_t *pal_idx;
 1398|  15.4k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 0, False: 15.4k]
  ------------------
 1399|      0|                    const int p = t->frame_thread.pass & 1;
 1400|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1401|      0|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|      0|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|      0|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|  15.4k|                } else {
 1406|  15.4k|                    pal = bytefn(t->scratch.pal);
  ------------------
  |  |   87|  15.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  15.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1407|  15.4k|                    pal_idx = t->scratch.pal_idx_uv;
 1408|  15.4k|                }
 1409|       |
 1410|  15.4k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|  15.4k|                                       f->cur.stride[1], pal[1],
 1412|  15.4k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|  15.4k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|  15.4k|                                       f->cur.stride[1], pal[2],
 1415|  15.4k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|  15.4k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  15.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.4k]
  |  |  ------------------
  |  |   35|  15.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  15.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1417|      0|                    hex_dump(((pixel *) f->cur.data[1]) + uv_dstoff,
 1418|      0|                             PXSTRIDE(f->cur.stride[1]),
 1419|      0|                             cbw4 * 4, cbh4 * 4, "u-pal-pred");
 1420|      0|                    hex_dump(((pixel *) f->cur.data[2]) + uv_dstoff,
 1421|      0|                             PXSTRIDE(f->cur.stride[1]),
 1422|      0|                             cbw4 * 4, cbh4 * 4, "v-pal-pred");
 1423|      0|                }
 1424|  15.4k|            }
 1425|       |
 1426|  62.6k|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|  62.6k|                                 sm_uv_flag(&t->l, cby4);
 1428|  62.6k|            const int uv_sb_has_tr =
 1429|  62.6k|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 0, False: 62.6k]
  |  Branch (1429:55): [True: 0, False: 62.6k]
  ------------------
 1430|  62.6k|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|  62.6k|            const int uv_sb_has_bl =
 1432|  62.6k|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 0, False: 62.6k]
  |  Branch (1432:30): [True: 0, False: 62.6k]
  ------------------
 1433|  62.6k|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|  62.6k|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|   186k|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 123k, False: 62.7k]
  ------------------
 1436|   248k|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 125k, False: 123k]
  ------------------
 1437|   125k|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|   125k|                {
 1439|   125k|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|   125k|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
 1441|   125k|                                        ((t->bx + init_x) >> ss_hor));
 1442|   252k|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 127k, False: 125k]
  ------------------
 1443|   127k|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|   127k|                    {
 1445|   127k|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 30.8k, False: 96.6k]
  |  Branch (1445:56): [True: 28.0k, False: 2.78k]
  ------------------
 1446|  99.6k|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 30.7k, False: 68.9k]
  ------------------
 1447|  58.8k|                        {
 1448|  58.8k|                            goto skip_uv_pred;
 1449|  58.8k|                        }
 1450|       |
 1451|  68.6k|                        int angle = b->uv_angle;
 1452|       |                        // this probably looks weird because we're using
 1453|       |                        // luma flags in a chroma loop, but that's because
 1454|       |                        // prepare_intra_edges() expects luma flags as input
 1455|  68.6k|                        const enum EdgeFlags edge_flags =
 1456|  68.6k|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 3.20k, False: 65.4k]
  |  Branch (1456:58): [True: 16.1k, False: 49.3k]
  ------------------
 1457|  19.6k|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 17.9k, False: 1.73k]
  ------------------
 1458|  50.7k|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|  68.6k|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 2.00k, False: 66.6k]
  ------------------
 1460|  66.6k|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 30.7k, False: 35.9k]
  |  Branch (1460:49): [True: 30.0k, False: 716]
  ------------------
 1461|  36.4k|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|  68.6k|                        const pixel *top_sb_edge = NULL;
 1463|  68.6k|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 23.4k, False: 45.2k]
  ------------------
 1464|  23.4k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|  23.4k|                            const int sby = t->by >> f->sb_shift;
 1466|  23.4k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|  23.4k|                        }
 1468|  68.6k|                        const enum IntraPredMode uv_mode =
 1469|  68.6k|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 2.79k, False: 65.8k]
  ------------------
 1470|  68.6k|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|  68.6k|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|  68.6k|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|  68.6k|                        const enum IntraPredMode m =
 1474|  68.6k|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  68.6k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  68.6k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1475|  68.6k|                                                              ypos, ypos > ystart,
 1476|  68.6k|                                                              ts->tiling.col_end >> ss_hor,
 1477|  68.6k|                                                              ts->tiling.row_end >> ss_ver,
 1478|  68.6k|                                                              edge_flags, dst, stride,
 1479|  68.6k|                                                              top_sb_edge, uv_mode,
 1480|  68.6k|                                                              &angle, uv_t_dim->w,
 1481|  68.6k|                                                              uv_t_dim->h,
 1482|  68.6k|                                                              f->seq_hdr->intra_edge_filter,
 1483|  68.6k|                                                              edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  68.6k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1484|  68.6k|                        angle |= intra_edge_filter_flag;
 1485|  68.6k|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|  68.6k|                                                 uv_t_dim->w * 4,
 1487|  68.6k|                                                 uv_t_dim->h * 4,
 1488|  68.6k|                                                 angle | sm_uv_fl,
 1489|  68.6k|                                                 (4 * f->bw + ss_hor -
 1490|  68.6k|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|  68.6k|                                                 (4 * f->bh + ss_ver -
 1492|  68.6k|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|  68.6k|                                                 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  68.6k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1494|  68.6k|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  68.6k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 68.6k]
  |  |  ------------------
  |  |   35|  68.6k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  68.6k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                      if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1495|      0|                            hex_dump(edge - uv_t_dim->h * 4, uv_t_dim->h * 4,
 1496|      0|                                     uv_t_dim->h * 4, 2, "l");
 1497|      0|                            hex_dump(edge, 0, 1, 1, "tl");
 1498|      0|                            hex_dump(edge + 1, uv_t_dim->w * 4,
 1499|      0|                                     uv_t_dim->w * 4, 2, "t");
 1500|      0|                            hex_dump(dst, stride, uv_t_dim->w * 4,
 1501|      0|                                     uv_t_dim->h * 4, pl ? "v-intra-pred" : "u-intra-pred");
  ------------------
  |  Branch (1501:55): [True: 0, False: 0]
  ------------------
 1502|      0|                        }
 1503|       |
 1504|   127k|                    skip_uv_pred: {}
 1505|   127k|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 127k, False: 18.4E]
  ------------------
 1506|   127k|                            enum TxfmType txtp;
 1507|   127k|                            int eob;
 1508|   127k|                            coef *cf;
 1509|   127k|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 0, False: 127k]
  ------------------
 1510|      0|                                const int p = t->frame_thread.pass & 1;
 1511|      0|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|      0|                                cf = ts->frame_thread[p].cf;
 1513|      0|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|      0|                                eob  = cbi >> 5;
 1515|      0|                                txtp = cbi & 0x1f;
 1516|   127k|                            } else {
 1517|   127k|                                uint8_t cf_ctx;
 1518|   127k|                                cf = bitfn(t->cf);
  ------------------
  |  |   77|   127k|#define bitfn(x) x##_16bpc
  ------------------
 1519|   127k|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|   127k|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|   127k|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|   127k|                                                   &txtp, &cf_ctx);
 1523|   127k|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   127k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 127k]
  |  |  ------------------
  |  |   35|   127k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   127k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1524|      0|                                    printf("Post-uv-cf-blk[pl=%d,tx=%d,"
 1525|      0|                                           "txtp=%d,eob=%d]: r=%d [x=%d,cbx4=%d]\n",
 1526|      0|                                           pl, b->uvtx, txtp, eob, ts->msac.rng, x, cbx4);
 1527|   127k|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|   127k|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|   127k|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|   127k|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|   127k|                            }
 1532|   127k|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 108k, False: 19.2k]
  ------------------
 1533|   108k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   108k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 108k]
  |  |  ------------------
  |  |   35|   108k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   108k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1534|      0|                                    coef_dump(cf, uv_t_dim->h * 4,
 1535|      0|                                              uv_t_dim->w * 4, 3, "dq");
 1536|   108k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   108k|                                                  [txtp](dst, stride,
 1538|   108k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   108k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1539|   108k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   108k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 108k]
  |  |  ------------------
  |  |   35|   108k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   108k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1540|      0|                                    hex_dump(dst, stride, uv_t_dim->w * 4,
 1541|      0|                                             uv_t_dim->h * 4, "recon");
 1542|   108k|                            }
 1543|  18.4E|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 0, False: 18.4E]
  ------------------
 1544|      0|                            dav1d_memset_pow2[uv_t_dim->lw](&t->a->ccoef[pl][cbx4 + x], 0x40);
 1545|      0|                            dav1d_memset_pow2[uv_t_dim->lh](&t->l.ccoef[pl][cby4 + y], 0x40);
 1546|      0|                        }
 1547|   127k|                        dst += uv_t_dim->w * 4;
 1548|   127k|                    }
 1549|   125k|                    t->bx -= x << ss_hor;
 1550|   125k|                }
 1551|   123k|                t->by -= y << ss_ver;
 1552|   123k|            }
 1553|  62.6k|        }
 1554|   134k|    }
 1555|   134k|}
dav1d_recon_b_inter_16bpc:
 1559|  33.8k|{
 1560|  33.8k|    Dav1dTileState *const ts = t->ts;
 1561|  33.8k|    const Dav1dFrameContext *const f = t->f;
 1562|  33.8k|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|  33.8k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|  33.8k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|  33.8k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|  33.8k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|  33.8k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|  33.8k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|  33.8k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|  33.8k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 11.7k, False: 22.1k]
  ------------------
 1571|  11.7k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 10.7k, False: 981]
  |  Branch (1571:45): [True: 357, False: 624]
  ------------------
 1572|  11.1k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 10.9k, False: 159]
  |  Branch (1572:45): [True: 37, False: 122]
  ------------------
 1573|  33.8k|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 22.1k, False: 11.7k]
  ------------------
 1574|  33.8k|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|  33.8k|    int res;
 1576|       |
 1577|       |    // prediction
 1578|  33.8k|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|  33.8k|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|  33.8k|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1581|  33.8k|    const ptrdiff_t uvdstoff =
 1582|  33.8k|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1583|  33.8k|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  33.8k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  33.8k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 0, False: 33.8k]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|      0|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1586|      0|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|      0|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|      0|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 0]
  ------------------
 1589|      0|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 0, False: 0]
  |  Branch (1589:42): [True: 0, False: 0]
  ------------------
 1590|      0|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|      0|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|      0|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|      0|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|      0|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 0]
  ------------------
 1595|      0|        }
 1596|  33.8k|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 33.8k, False: 16]
  ------------------
 1597|  33.8k|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|  33.8k|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|  33.8k|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 30.5k, False: 3.34k]
  ------------------
 1601|  30.5k|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 566, False: 29.9k]
  |  Branch (1601:44): [True: 0, False: 566]
  ------------------
 1602|  30.5k|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 1.11k, False: 29.4k]
  |  Branch (1602:44): [True: 1.11k, False: 0]
  ------------------
 1603|  1.11k|        {
 1604|  1.11k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|  1.11k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 1.11k, False: 0]
  ------------------
 1606|  1.11k|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|  1.11k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 1.11k]
  ------------------
 1608|  32.7k|        } else {
 1609|  32.7k|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|  32.7k|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|  32.7k|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 32.7k]
  ------------------
 1612|  32.7k|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 0, False: 32.7k]
  ------------------
 1613|      0|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|      0|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 0]
  ------------------
 1615|      0|            }
 1616|  32.7k|        }
 1617|  33.8k|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 0, False: 33.8k]
  ------------------
 1618|      0|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|      0|#define bitfn(x) x##_16bpc
  ------------------
 1619|      0|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 0, False: 0]
  ------------------
 1620|      0|                                   SMOOTH_PRED : b->interintra_mode;
 1621|      0|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|      0|#define bitfn(x) x##_16bpc
  ------------------
 1622|      0|            int angle = 0;
 1623|      0|            const pixel *top_sb_edge = NULL;
 1624|      0|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 0, False: 0]
  ------------------
 1625|      0|                top_sb_edge = f->ipred_edge[0];
 1626|      0|                const int sby = t->by >> f->sb_shift;
 1627|      0|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|      0|            }
 1629|      0|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|      0|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1630|      0|                                                  t->by, t->by > ts->tiling.row_start,
 1631|      0|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|      0|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|      0|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|      0|                                                  HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1635|      0|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|      0|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|      0|                                     HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1638|      0|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|      0|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|      0|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|      0|        }
 1641|       |
 1642|  33.8k|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 22.8k, False: 10.9k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|  10.9k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 283, False: 10.6k]
  |  Branch (1645:42): [True: 10, False: 10.6k]
  ------------------
 1646|  10.9k|        refmvs_block *const *r;
 1647|  10.9k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 319, False: 10.6k]
  ------------------
 1648|    319|            assert(ss_hor == 1);
  ------------------
  |  |  140|    319|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 319]
  |  |  |  Branch (140:68): [Folded, False: 319]
  |  |  ------------------
  ------------------
 1649|    319|            r = &t->rt.r[(t->by & 31) + 5];
 1650|    319|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 308, False: 11]
  ------------------
 1651|    319|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 37, False: 282]
  ------------------
 1652|    319|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 308, False: 11]
  |  Branch (1652:29): [True: 26, False: 282]
  ------------------
 1653|     26|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|    319|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|  10.9k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 197, False: 10.7k]
  ------------------
 1658|    197|            assert(ss_hor == 1);
  ------------------
  |  |  140|    197|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 197]
  |  |  |  Branch (140:68): [Folded, False: 197]
  |  |  ------------------
  ------------------
 1659|    197|            ptrdiff_t h_off = 0, v_off = 0;
 1660|    197|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 190, False: 7]
  |  Branch (1660:29): [True: 3, False: 187]
  ------------------
 1661|      9|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 6, False: 3]
  ------------------
 1662|      6|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|      6|                             NULL, f->cur.stride[1],
 1664|      6|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|      6|                             r[-1][t->bx - 1].mv.mv[0],
 1666|      6|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|      6|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|      6|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 6, False: 0]
  ------------------
 1669|      6|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|      6|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 6]
  ------------------
 1671|      6|                }
 1672|      3|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1673|      3|                h_off = 2;
 1674|      3|            }
 1675|    197|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 190, False: 7]
  ------------------
 1676|    190|                const enum Filter2d left_filter_2d =
 1677|    190|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|    570|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 380, False: 190]
  ------------------
 1679|    380|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|    380|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|    380|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|    380|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|    380|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|    380|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 380, False: 0]
  ------------------
 1685|    380|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|    380|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 380]
  ------------------
 1687|    380|                }
 1688|    190|                h_off = 2;
 1689|    190|            }
 1690|    197|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 10, False: 187]
  ------------------
 1691|     10|                const enum Filter2d top_filter_2d =
 1692|     10|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|     30|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 20, False: 10]
  ------------------
 1694|     20|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|     20|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|     20|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|     20|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|     20|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|     20|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 20, False: 0]
  ------------------
 1700|     20|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|     20|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 20]
  ------------------
 1702|     20|                }
 1703|     10|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1704|     10|            }
 1705|    591|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 394, False: 197]
  ------------------
 1706|    394|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|    394|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|    394|                         refp, b->ref[0], filter_2d);
 1709|    394|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 394]
  ------------------
 1710|    394|            }
 1711|  10.7k|        } else {
 1712|  10.7k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 3.38k, False: 7.39k]
  ------------------
 1713|  3.38k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 76, False: 3.31k]
  |  Branch (1713:48): [True: 0, False: 76]
  ------------------
 1714|  3.38k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 144, False: 3.24k]
  |  Branch (1714:48): [True: 144, False: 0]
  ------------------
 1715|    144|            {
 1716|    432|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 288, False: 144]
  ------------------
 1717|    288|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|    288|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|    288|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 288, False: 0]
  ------------------
 1720|    288|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|    288|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 288]
  ------------------
 1722|    288|                }
 1723|  10.6k|            } else {
 1724|  31.9k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 21.2k, False: 10.6k]
  ------------------
 1725|  21.2k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|  21.2k|                             NULL, f->cur.stride[1],
 1727|  21.2k|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|  21.2k|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|  21.2k|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|  21.2k|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 21.2k]
  ------------------
 1731|  21.2k|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 0, False: 21.2k]
  ------------------
 1732|      0|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|      0|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|      0|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 0]
  ------------------
 1735|      0|                    }
 1736|  21.2k|                }
 1737|  10.6k|            }
 1738|  10.7k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 0, False: 10.7k]
  ------------------
 1739|       |                // FIXME for 8x32 with 4:2:2 subsampling, this probably does
 1740|       |                // the wrong thing since it will select 4x16, not 4x32, as a
 1741|       |                // transform size...
 1742|      0|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|      0|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|      0|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|      0|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 0, False: 0]
  ------------------
 1745|      0|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|      0|#define bitfn(x) x##_16bpc
  ------------------
 1746|      0|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|      0|#define bitfn(x) x##_16bpc
  ------------------
 1747|      0|                    enum IntraPredMode m =
 1748|      0|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 0, False: 0]
  ------------------
 1749|      0|                        SMOOTH_PRED : b->interintra_mode;
 1750|      0|                    int angle = 0;
 1751|      0|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|      0|                    const pixel *top_sb_edge = NULL;
 1753|      0|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 0, False: 0]
  ------------------
 1754|      0|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|      0|                        const int sby = t->by >> f->sb_shift;
 1756|      0|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|      0|                    }
 1758|      0|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|      0|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1759|      0|                                                          (t->bx >> ss_hor) >
 1760|      0|                                                              (ts->tiling.col_start >> ss_hor),
 1761|      0|                                                          t->by >> ss_ver,
 1762|      0|                                                          (t->by >> ss_ver) >
 1763|      0|                                                              (ts->tiling.row_start >> ss_ver),
 1764|      0|                                                          ts->tiling.col_end >> ss_hor,
 1765|      0|                                                          ts->tiling.row_end >> ss_ver,
 1766|      0|                                                          0, uvdst, f->cur.stride[1],
 1767|      0|                                                          top_sb_edge, m,
 1768|      0|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|      0|                                                          HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1770|      0|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|      0|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|      0|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1773|      0|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|      0|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|      0|                }
 1776|      0|            }
 1777|  10.7k|        }
 1778|       |
 1779|  33.9k|    skip_inter_chroma_pred: {}
 1780|  33.9k|        t->tl_4x4_filter = filter_2d;
 1781|  33.9k|    } else {
 1782|     16|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|     16|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|     16|        int jnt_weight;
 1786|     16|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|     16|        const uint8_t *mask;
 1788|       |
 1789|     16|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 0, False: 16]
  ------------------
 1790|      0|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|      0|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 0, False: 0]
  |  Branch (1792:55): [True: 0, False: 0]
  ------------------
 1793|      0|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|      0|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|      0|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 0]
  ------------------
 1796|      0|            } else {
 1797|      0|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|      0|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|      0|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 0]
  ------------------
 1800|      0|            }
 1801|      0|        }
 1802|     16|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 0, False: 16]
  ------------------
 1803|      0|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 0, False: 16]
  ------------------
 1804|      0|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|      0|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1806|      0|            break;
 1807|      0|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 0, False: 16]
  ------------------
 1808|      0|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|      0|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|      0|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1811|      0|            break;
 1812|      0|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 0, False: 16]
  ------------------
 1813|      0|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|      0|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|      0|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|      0|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1817|      0|            mask = seg_mask;
 1818|      0|            break;
 1819|      0|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 0, False: 16]
  ------------------
 1820|      0|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|      0|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|      0|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|      0|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|      0|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1824|      0|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 0, False: 0]
  ------------------
 1825|      0|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|      0|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|      0|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|      0|            break;
 1827|     16|        }
 1828|       |
 1829|       |        // chroma
 1830|      0|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 0, False: 0]
  |  Branch (1830:42): [True: 0, False: 0]
  ------------------
 1831|      0|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 0, False: 0]
  ------------------
 1832|      0|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 0, False: 0]
  ------------------
 1834|      0|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 0, False: 0]
  |  Branch (1834:45): [True: 0, False: 0]
  ------------------
 1835|      0|                {
 1836|      0|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|      0|                                      b_dim, 1 + pl,
 1838|      0|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|      0|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 0]
  ------------------
 1840|      0|                } else {
 1841|      0|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|      0|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|      0|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 0]
  ------------------
 1844|      0|                }
 1845|      0|            }
 1846|      0|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|      0|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 0, False: 0]
  ------------------
 1848|      0|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 0, False: 0]
  ------------------
 1849|      0|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|      0|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|      0|                            HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1852|      0|                break;
 1853|      0|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 0, False: 0]
  ------------------
 1854|      0|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|      0|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|      0|                              HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1857|      0|                break;
 1858|      0|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 0, False: 0]
  ------------------
 1859|      0|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 0, False: 0]
  ------------------
 1860|      0|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|      0|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|      0|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|      0|                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|      0|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1864|      0|                break;
 1865|      0|            }
 1866|      0|        }
 1867|      0|    }
 1868|       |
 1869|  33.9k|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  33.9k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 33.9k]
  |  |  ------------------
  |  |   35|  33.9k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  33.9k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1870|      0|        hex_dump(dst, f->cur.stride[0], b_dim[0] * 4, b_dim[1] * 4, "y-pred");
 1871|      0|        if (has_chroma) {
  ------------------
  |  Branch (1871:13): [True: 0, False: 0]
  ------------------
 1872|      0|            hex_dump(&((pixel *) f->cur.data[1])[uvdstoff], f->cur.stride[1],
 1873|      0|                     cbw4 * 4, cbh4 * 4, "u-pred");
 1874|      0|            hex_dump(&((pixel *) f->cur.data[2])[uvdstoff], f->cur.stride[1],
 1875|      0|                     cbw4 * 4, cbh4 * 4, "v-pred");
 1876|      0|        }
 1877|      0|    }
 1878|       |
 1879|  33.9k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|  33.9k|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 9.04k, False: 24.8k]
  ------------------
 1882|       |        // reset coef contexts
 1883|  9.04k|        BlockContext *const a = t->a;
 1884|  9.04k|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|  9.04k|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|  9.04k|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 2.97k, False: 6.07k]
  ------------------
 1887|  2.97k|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|  2.97k|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|  2.97k|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|  2.97k|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|  2.97k|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|  2.97k|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|  2.97k|        }
 1894|  9.04k|        return 0;
 1895|  9.04k|    }
 1896|       |
 1897|  24.8k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|  24.8k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|  24.8k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|  49.7k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 24.8k, False: 24.8k]
  ------------------
 1902|  49.6k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 24.8k, False: 24.8k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|  24.8k|            int y_off = !!init_y, y;
 1905|  24.8k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
 1906|  50.2k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 25.3k, False: 24.8k]
  ------------------
 1907|  25.3k|                 y += ytx->h, y_off++)
 1908|  25.3k|            {
 1909|  25.3k|                int x, x_off = !!init_x;
 1910|  51.9k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 26.5k, False: 25.3k]
  ------------------
 1911|  26.5k|                     x += ytx->w, x_off++)
 1912|  26.5k|                {
 1913|  26.5k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|  26.5k|                                   x_off, y_off, &dst[x * 4]);
 1915|  26.5k|                    t->bx += ytx->w;
 1916|  26.5k|                }
 1917|  25.3k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
 1918|  25.3k|                t->bx -= x;
 1919|  25.3k|                t->by += ytx->h;
 1920|  25.3k|            }
 1921|  24.8k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
 1922|  24.8k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|  24.8k|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 8.02k, False: 16.8k]
  |  Branch (1925:46): [True: 16.0k, False: 8.02k]
  ------------------
 1926|  16.0k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|  16.0k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
 1928|  16.0k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|  32.3k|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 16.3k, False: 16.0k]
  ------------------
 1930|  16.3k|                {
 1931|  16.3k|                    int x;
 1932|  16.3k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|  32.9k|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 16.6k, False: 16.3k]
  ------------------
 1934|  16.6k|                    {
 1935|  16.6k|                        coef *cf;
 1936|  16.6k|                        int eob;
 1937|  16.6k|                        enum TxfmType txtp;
 1938|  16.6k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 0, False: 16.6k]
  ------------------
 1939|      0|                            const int p = t->frame_thread.pass & 1;
 1940|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|      0|                            cf = ts->frame_thread[p].cf;
 1942|      0|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|      0|                            eob  = cbi >> 5;
 1944|      0|                            txtp = cbi & 0x1f;
 1945|  16.6k|                        } else {
 1946|  16.6k|                            uint8_t cf_ctx;
 1947|  16.6k|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|  16.6k|#define bitfn(x) x##_16bpc
  ------------------
 1948|  16.6k|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|  16.6k|                                                        bx4 + (x << ss_hor)];
 1950|  16.6k|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|  16.6k|                                               &t->l.ccoef[pl][cby4 + y],
 1952|  16.6k|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|  16.6k|                                               cf, &txtp, &cf_ctx);
 1954|  16.6k|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  16.6k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 16.6k]
  |  |  ------------------
  |  |   35|  16.6k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  16.6k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1955|      0|                                printf("Post-uv-cf-blk[pl=%d,tx=%d,"
 1956|      0|                                       "txtp=%d,eob=%d]: r=%d\n",
 1957|      0|                                       pl, b->uvtx, txtp, eob, ts->msac.rng);
 1958|  16.6k|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|  16.6k|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|  16.6k|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|  16.6k|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|  16.6k|                        }
 1963|  16.6k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 16.3k, False: 267]
  ------------------
 1964|  16.3k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  16.3k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 16.3k]
  |  |  ------------------
  |  |   35|  16.3k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  16.3k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1965|      0|                                coef_dump(cf, uvtx->h * 4, uvtx->w * 4, 3, "dq");
 1966|  16.3k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|  16.3k|                                              [txtp](&uvdst[4 * x],
 1968|  16.3k|                                                     f->cur.stride[1],
 1969|  16.3k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  16.3k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1970|  16.3k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  16.3k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 16.3k]
  |  |  ------------------
  |  |   35|  16.3k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  16.3k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1971|      0|                                hex_dump(&uvdst[4 * x], f->cur.stride[1],
 1972|      0|                                         uvtx->w * 4, uvtx->h * 4, "recon");
 1973|  16.3k|                        }
 1974|  16.6k|                        t->bx += uvtx->w << ss_hor;
 1975|  16.6k|                    }
 1976|  16.3k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
 1977|  16.3k|                    t->bx -= x << ss_hor;
 1978|  16.3k|                    t->by += uvtx->h << ss_ver;
 1979|  16.3k|                }
 1980|  16.0k|                t->by -= y << ss_ver;
 1981|  16.0k|            }
 1982|  24.8k|        }
 1983|  24.8k|    }
 1984|  24.8k|    return 0;
 1985|  33.9k|}
dav1d_filter_sbrow_deblock_cols_16bpc:
 1987|  6.41k|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|  6.41k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 0, False: 6.41k]
  ------------------
 1989|  6.41k|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 671, False: 5.74k]
  |  Branch (1989:50): [True: 671, False: 0]
  ------------------
 1990|    671|    {
 1991|    671|        return;
 1992|    671|    }
 1993|  5.74k|    const int y = sby * f->sb_step * 4;
 1994|  5.74k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|  5.74k|    pixel *const p[3] = {
 1996|  5.74k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 1997|  5.74k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 1998|  5.74k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 1999|  5.74k|    };
 2000|  5.74k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|  5.74k|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|  5.74k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  5.74k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2002|  5.74k|                                        f->lf.start_of_tile_row[sby]);
 2003|  5.74k|}
dav1d_filter_sbrow_deblock_rows_16bpc:
 2005|  17.1k|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|  17.1k|    const int y = sby * f->sb_step * 4;
 2007|  17.1k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|  17.1k|    pixel *const p[3] = {
 2009|  17.1k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2010|  17.1k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2011|  17.1k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2012|  17.1k|    };
 2013|  17.1k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|  17.1k|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 17.1k, False: 1]
  ------------------
 2015|  17.1k|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 5.74k, False: 11.4k]
  |  Branch (2015:49): [True: 0, False: 11.4k]
  ------------------
 2016|  5.74k|    {
 2017|  5.74k|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|  5.74k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  5.74k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2018|  5.74k|    }
 2019|  17.1k|    if (f->seq_hdr->cdef || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 17.1k, False: 0]
  |  Branch (2019:29): [True: 0, False: 0]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|  17.1k|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|  17.1k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  17.1k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2022|  17.1k|    }
 2023|  17.1k|}
dav1d_filter_sbrow_cdef_16bpc:
 2025|  17.1k|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  17.1k|    const Dav1dFrameContext *const f = tc->f;
 2027|  17.1k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_CDEF)) return;
  ------------------
  |  Branch (2027:9): [True: 0, False: 17.1k]
  ------------------
 2028|  17.1k|    const int sbsz = f->sb_step;
 2029|  17.1k|    const int y = sby * sbsz * 4;
 2030|  17.1k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2031|  17.1k|    pixel *const p[3] = {
 2032|  17.1k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2033|  17.1k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2034|  17.1k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2035|  17.1k|    };
 2036|  17.1k|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  17.1k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2038|  17.1k|    const int start = sby * sbsz;
 2039|  17.1k|    if (sby) {
  ------------------
  |  Branch (2039:9): [True: 3.77k, False: 13.4k]
  ------------------
 2040|  3.77k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2041|  3.77k|        pixel *p_up[3] = {
 2042|  3.77k|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
 2043|  3.77k|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2044|  3.77k|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2045|  3.77k|        };
 2046|  3.77k|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  3.77k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  3.77k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2047|  3.77k|    }
 2048|  17.1k|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2049|  17.1k|    const int end = imin(start + n_blks, f->bh);
 2050|  17.1k|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  17.1k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  17.1k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2051|  17.1k|}
dav1d_filter_sbrow_lr_16bpc:
 2088|    267|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2089|    267|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2089:9): [True: 0, False: 267]
  ------------------
 2090|    267|    const int y = sby * f->sb_step * 4;
 2091|    267|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2092|    267|    pixel *const sr_p[3] = {
 2093|    267|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
 2094|    267|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
 2095|    267|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
 2096|    267|    };
 2097|    267|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|    267|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|    267|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2098|    267|}
dav1d_filter_sbrow_16bpc:
 2100|  1.16k|void bytefn(dav1d_filter_sbrow)(Dav1dFrameContext *const f, const int sby) {
 2101|  1.16k|    bytefn(dav1d_filter_sbrow_deblock_cols)(f, sby);
  ------------------
  |  |   87|  1.16k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  1.16k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2102|  1.16k|    bytefn(dav1d_filter_sbrow_deblock_rows)(f, sby);
  ------------------
  |  |   87|  1.16k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  1.16k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2103|  1.16k|    if (f->seq_hdr->cdef)
  ------------------
  |  Branch (2103:9): [True: 1.16k, False: 0]
  ------------------
 2104|  1.16k|        bytefn(dav1d_filter_sbrow_cdef)(f->c->tc, sby);
  ------------------
  |  |   87|  1.16k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  1.16k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2105|  1.16k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (2105:9): [True: 0, False: 1.16k]
  ------------------
 2106|      0|        bytefn(dav1d_filter_sbrow_resize)(f, sby);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|      0|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2107|  1.16k|    if (f->lf.restore_planes)
  ------------------
  |  Branch (2107:9): [True: 48, False: 1.11k]
  ------------------
 2108|     48|        bytefn(dav1d_filter_sbrow_lr)(f, sby);
  ------------------
  |  |   87|     48|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|     48|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2109|  1.16k|}
dav1d_backup_ipred_edge_16bpc:
 2111|  19.8k|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2112|  19.8k|    const Dav1dFrameContext *const f = t->f;
 2113|  19.8k|    Dav1dTileState *const ts = t->ts;
 2114|  19.8k|    const int sby = t->by >> f->sb_shift;
 2115|  19.8k|    const int sby_off = f->sb128w * 128 * sby;
 2116|  19.8k|    const int x_off = ts->tiling.col_start;
 2117|       |
 2118|  19.8k|    const pixel *const y =
 2119|  19.8k|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2120|  19.8k|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
 2121|  19.8k|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   65|  19.8k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2122|  19.8k|               4 * (ts->tiling.col_end - x_off));
 2123|       |
 2124|  19.8k|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2124:9): [True: 8.81k, False: 11.0k]
  ------------------
 2125|  8.81k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2126|  8.81k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2127|       |
 2128|  8.81k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2129|  8.81k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
 2130|  26.4k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2130:26): [True: 17.6k, False: 8.81k]
  ------------------
 2131|  17.6k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   65|  17.6k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2132|  8.81k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2133|  8.81k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2134|  8.81k|    }
 2135|  19.8k|}
dav1d_copy_pal_block_y_16bpc:
 2141|  26.1k|{
 2142|  26.1k|    const Dav1dFrameContext *const f = t->f;
 2143|  26.1k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2143:24): [True: 0, False: 26.1k]
  ------------------
 2144|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2145|      0|                            ((t->bx >> 1) + (t->by & 1))][0] :
 2146|  26.1k|        bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  26.1k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  26.1k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2147|  78.6k|    for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2147:21): [True: 52.5k, False: 26.1k]
  ------------------
 2148|  52.5k|        memcpy(bytefn(t->al_pal)[0][bx4 + x][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|  52.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  52.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2149|  78.7k|    for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2149:21): [True: 52.5k, False: 26.1k]
  ------------------
 2150|  52.5k|        memcpy(bytefn(t->al_pal)[1][by4 + y][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|  52.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  52.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2151|  26.1k|}
dav1d_copy_pal_block_uv_16bpc:
 2157|  15.4k|{
 2158|  15.4k|    const Dav1dFrameContext *const f = t->f;
 2159|  15.4k|    const pixel (*const pal)[8] = t->frame_thread.pass ?
  ------------------
  |  Branch (2159:35): [True: 0, False: 15.4k]
  ------------------
 2160|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2161|      0|                            ((t->bx >> 1) + (t->by & 1))] :
 2162|  15.4k|        bytefn(t->scratch.pal);
  ------------------
  |  |   87|  15.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  15.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2163|       |    // see aomedia bug 2183 for why we use luma coordinates here
 2164|  46.2k|    for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (2164:22): [True: 30.8k, False: 15.4k]
  ------------------
 2165|  93.2k|        for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2165:25): [True: 62.4k, False: 30.8k]
  ------------------
 2166|  62.4k|            memcpy(bytefn(t->al_pal)[0][bx4 + x][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|  62.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  62.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2167|  93.0k|        for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2167:25): [True: 62.2k, False: 30.8k]
  ------------------
 2168|  62.2k|            memcpy(bytefn(t->al_pal)[1][by4 + y][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|  62.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  62.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2169|  30.8k|    }
 2170|  15.4k|}
dav1d_read_pal_plane_16bpc:
 2175|  41.5k|{
 2176|  41.5k|    Dav1dTileState *const ts = t->ts;
 2177|  41.5k|    const Dav1dFrameContext *const f = t->f;
 2178|  41.5k|    const int pal_sz = b->pal_sz[pl] = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  41.5k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 2179|  41.5k|                                           ts->cdf.m.pal_sz[pl][sz_ctx], 6) + 2;
 2180|  41.5k|    pixel cache[16], used_cache[8];
 2181|  41.5k|    int l_cache = pl ? t->pal_sz_uv[1][by4] : t->l.pal_sz[by4];
  ------------------
  |  Branch (2181:19): [True: 15.4k, False: 26.0k]
  ------------------
 2182|  41.5k|    int n_cache = 0;
 2183|       |    // don't reuse above palette outside SB64 boundaries
 2184|  41.5k|    int a_cache = by4 & 15 ? pl ? t->pal_sz_uv[0][bx4] : t->a->pal_sz[bx4] : 0;
  ------------------
  |  Branch (2184:19): [True: 26.8k, False: 14.6k]
  |  Branch (2184:30): [True: 9.87k, False: 17.0k]
  ------------------
 2185|  41.5k|    const pixel *l = bytefn(t->al_pal)[1][by4][pl];
  ------------------
  |  |   87|  41.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  41.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2186|  41.5k|    const pixel *a = bytefn(t->al_pal)[0][bx4][pl];
  ------------------
  |  |   87|  41.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  41.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2187|       |
 2188|       |    // fill/sort cache
 2189|   134k|    while (l_cache && a_cache) {
  ------------------
  |  Branch (2189:12): [True: 106k, False: 27.7k]
  |  Branch (2189:23): [True: 92.7k, False: 13.8k]
  ------------------
 2190|  92.7k|        if (*l < *a) {
  ------------------
  |  Branch (2190:13): [True: 38.8k, False: 53.9k]
  ------------------
 2191|  38.8k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2191:17): [True: 2.67k, False: 36.1k]
  |  Branch (2191:29): [True: 34.4k, False: 1.65k]
  ------------------
 2192|  37.1k|                cache[n_cache++] = *l;
 2193|  38.8k|            l++;
 2194|  38.8k|            l_cache--;
 2195|  53.9k|        } else {
 2196|  53.9k|            if (*a == *l) {
  ------------------
  |  Branch (2196:17): [True: 16.8k, False: 37.0k]
  ------------------
 2197|  16.8k|                l++;
 2198|  16.8k|                l_cache--;
 2199|  16.8k|            }
 2200|  53.9k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2200:17): [True: 10.1k, False: 43.7k]
  |  Branch (2200:29): [True: 41.5k, False: 2.28k]
  ------------------
 2201|  51.6k|                cache[n_cache++] = *a;
 2202|  53.9k|            a++;
 2203|  53.9k|            a_cache--;
 2204|  53.9k|        }
 2205|  92.7k|    }
 2206|  41.5k|    if (l_cache) {
  ------------------
  |  Branch (2206:9): [True: 13.8k, False: 27.6k]
  ------------------
 2207|  54.4k|        do {
 2208|  54.4k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2208:17): [True: 10.3k, False: 44.0k]
  |  Branch (2208:29): [True: 41.1k, False: 2.91k]
  ------------------
 2209|  51.5k|                cache[n_cache++] = *l;
 2210|  54.4k|            l++;
 2211|  54.4k|        } while (--l_cache > 0);
  ------------------
  |  Branch (2211:18): [True: 40.5k, False: 13.8k]
  ------------------
 2212|  27.6k|    } else if (a_cache) {
  ------------------
  |  Branch (2212:16): [True: 13.8k, False: 13.8k]
  ------------------
 2213|  58.6k|        do {
 2214|  58.6k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2214:17): [True: 10.7k, False: 47.8k]
  |  Branch (2214:29): [True: 45.1k, False: 2.75k]
  ------------------
 2215|  55.8k|                cache[n_cache++] = *a;
 2216|  58.6k|            a++;
 2217|  58.6k|        } while (--a_cache > 0);
  ------------------
  |  Branch (2217:18): [True: 44.7k, False: 13.8k]
  ------------------
 2218|  13.8k|    }
 2219|       |
 2220|       |    // find reused cache entries
 2221|  41.5k|    int i = 0;
 2222|   237k|    for (int n = 0; n < n_cache && i < pal_sz; n++)
  ------------------
  |  Branch (2222:21): [True: 195k, False: 41.2k]
  |  Branch (2222:36): [True: 195k, False: 247]
  ------------------
 2223|   195k|        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|   195k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2223:13): [True: 69.2k, False: 126k]
  ------------------
 2224|  69.2k|            used_cache[i++] = cache[n];
 2225|  41.5k|    const int n_used_cache = i;
 2226|       |
 2227|       |    // parse new entries
 2228|  41.5k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2228:24): [True: 0, False: 41.5k]
  ------------------
 2229|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2230|      0|                            ((t->bx >> 1) + (t->by & 1))][pl] :
 2231|  41.5k|        bytefn(t->scratch.pal)[pl];
  ------------------
  |  |   87|  41.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  41.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2232|  41.5k|    if (i < pal_sz) {
  ------------------
  |  Branch (2232:9): [True: 36.8k, False: 4.73k]
  ------------------
 2233|  36.8k|        const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2233:25): [Folded, False: 36.8k]
  ------------------
 2234|  36.8k|        int prev = pal[i++] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2235|       |
 2236|  36.8k|        if (i < pal_sz) {
  ------------------
  |  Branch (2236:13): [True: 30.9k, False: 5.81k]
  ------------------
 2237|  30.9k|            int bits = bpc - 3 + dav1d_msac_decode_bools(&ts->msac, 2);
 2238|  30.9k|            const int max = (1 << bpc) - 1;
 2239|       |
 2240|  84.3k|            do {
 2241|  84.3k|                const int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2242|  84.3k|                prev = pal[i++] = imin(prev + delta + !pl, max);
 2243|  84.3k|                if (prev + !pl >= max) {
  ------------------
  |  Branch (2243:21): [True: 4.73k, False: 79.6k]
  ------------------
 2244|  5.77k|                    for (; i < pal_sz; i++)
  ------------------
  |  Branch (2244:28): [True: 1.04k, False: 4.73k]
  ------------------
 2245|  1.04k|                        pal[i] = max;
 2246|  4.73k|                    break;
 2247|  4.73k|                }
 2248|  79.6k|                bits = imin(bits, 1 + ulog2(max - prev - !pl));
 2249|  79.6k|            } while (i < pal_sz);
  ------------------
  |  Branch (2249:22): [True: 53.3k, False: 26.2k]
  ------------------
 2250|  30.9k|        }
 2251|       |
 2252|       |        // merge cache+new entries
 2253|  36.8k|        int n = 0, m = n_used_cache;
 2254|   217k|        for (i = 0; i < pal_sz; i++) {
  ------------------
  |  Branch (2254:21): [True: 181k, False: 36.8k]
  ------------------
 2255|   181k|            if (n < n_used_cache && (m >= pal_sz || used_cache[n] <= pal[m])) {
  ------------------
  |  Branch (2255:17): [True: 113k, False: 67.1k]
  |  Branch (2255:38): [True: 19.2k, False: 94.5k]
  |  Branch (2255:53): [True: 39.6k, False: 54.9k]
  ------------------
 2256|  58.9k|                pal[i] = used_cache[n++];
 2257|   122k|            } else {
 2258|   122k|                assert(m < pal_sz);
  ------------------
  |  |  140|   122k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 122k]
  |  |  |  Branch (140:68): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 2259|   122k|                pal[i] = pal[m++];
 2260|   122k|            }
 2261|   181k|        }
 2262|  36.8k|    } else {
 2263|  4.73k|        memcpy(pal, used_cache, n_used_cache * sizeof(*used_cache));
 2264|  4.73k|    }
 2265|       |
 2266|  41.5k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  41.5k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 41.5k]
  |  |  ------------------
  |  |   35|  41.5k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  41.5k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2267|      0|        printf("Post-pal[pl=%d,sz=%d,cache_size=%d,used_cache=%d]: r=%d, cache=",
 2268|      0|               pl, pal_sz, n_cache, n_used_cache, ts->msac.rng);
 2269|      0|        for (int n = 0; n < n_cache; n++)
  ------------------
  |  Branch (2269:25): [True: 0, False: 0]
  ------------------
 2270|      0|            printf("%c%02x", n ? ' ' : '[', cache[n]);
  ------------------
  |  Branch (2270:30): [True: 0, False: 0]
  ------------------
 2271|      0|        printf("%s, pal=", n_cache ? "]" : "[]");
  ------------------
  |  Branch (2271:28): [True: 0, False: 0]
  ------------------
 2272|      0|        for (int n = 0; n < pal_sz; n++)
  ------------------
  |  Branch (2272:25): [True: 0, False: 0]
  ------------------
 2273|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2273:30): [True: 0, False: 0]
  ------------------
 2274|      0|        printf("]\n");
 2275|      0|    }
 2276|  41.5k|}
dav1d_read_pal_uv_16bpc:
 2280|  15.4k|{
 2281|  15.4k|    bytefn(dav1d_read_pal_plane)(t, b, 1, sz_ctx, bx4, by4);
  ------------------
  |  |   87|  15.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  15.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2282|       |
 2283|       |    // V pal coding
 2284|  15.4k|    Dav1dTileState *const ts = t->ts;
 2285|  15.4k|    const Dav1dFrameContext *const f = t->f;
 2286|  15.4k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2286:24): [True: 0, False: 15.4k]
  ------------------
 2287|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2288|      0|                            ((t->bx >> 1) + (t->by & 1))][2] :
 2289|  15.4k|        bytefn(t->scratch.pal)[2];
  ------------------
  |  |   87|  15.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  15.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2290|  15.4k|    const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2290:21): [Folded, False: 15.4k]
  ------------------
 2291|  15.4k|    if (dav1d_msac_decode_bool_equi(&ts->msac)) {
  ------------------
  |  |   53|  15.4k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2291:9): [True: 5.15k, False: 10.3k]
  ------------------
 2292|  5.15k|        const int bits = bpc - 4 + dav1d_msac_decode_bools(&ts->msac, 2);
 2293|  5.15k|        int prev = pal[0] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2294|  5.15k|        const int max = (1 << bpc) - 1;
 2295|  21.1k|        for (int i = 1; i < b->pal_sz[1]; i++) {
  ------------------
  |  Branch (2295:25): [True: 16.0k, False: 5.15k]
  ------------------
 2296|  16.0k|            int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2297|  16.0k|            if (delta && dav1d_msac_decode_bool_equi(&ts->msac)) delta = -delta;
  ------------------
  |  |   53|  15.0k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2297:17): [True: 15.0k, False: 961]
  |  Branch (2297:26): [True: 7.80k, False: 7.26k]
  ------------------
 2298|  16.0k|            prev = pal[i] = (prev + delta) & max;
 2299|  16.0k|        }
 2300|  10.3k|    } else {
 2301|  65.8k|        for (int i = 0; i < b->pal_sz[1]; i++)
  ------------------
  |  Branch (2301:25): [True: 55.5k, False: 10.3k]
  ------------------
 2302|  55.5k|            pal[i] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2303|  10.3k|    }
 2304|  15.4k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  15.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.4k]
  |  |  ------------------
  |  |   35|  15.4k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  15.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2305|      0|        printf("Post-pal[pl=2]: r=%d ", ts->msac.rng);
 2306|      0|        for (int n = 0; n < b->pal_sz[1]; n++)
  ------------------
  |  Branch (2306:25): [True: 0, False: 0]
  ------------------
 2307|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2307:30): [True: 0, False: 0]
  ------------------
 2308|      0|        printf("]\n");
 2309|      0|    }
 2310|  15.4k|}

dav1d_ref_create_using_pool:
   56|   136k|Dav1dRef *dav1d_ref_create_using_pool(Dav1dMemPool *const pool, size_t size) {
   57|   136k|    void *const buf = dav1d_mem_pool_pop(pool, size);
   58|   136k|    if (!buf) return NULL;
  ------------------
  |  Branch (58:9): [True: 0, False: 136k]
  ------------------
   59|       |
   60|       |    /* Store Dav1dRef inside the Dav1dMemPoolBuffer alignment padding */
   61|   136k|    assert(sizeof(Dav1dMemPoolBuffer) + sizeof(Dav1dRef) <= 64);
  ------------------
  |  |  140|   136k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [Folded, False: 136k]
  |  |  |  Branch (140:68): [Folded, False: 136k]
  |  |  ------------------
  ------------------
   62|   136k|    Dav1dRef *const res = &((Dav1dRef*)buf)[-1];
   63|   136k|    res->data = buf;
   64|   136k|    res->const_data = pool;
   65|   136k|    atomic_init(&res->ref_cnt, 1);
   66|   136k|    res->free_ref = 0;
   67|   136k|    res->free_callback = pool_free_callback;
   68|   136k|    res->user_data = buf;
   69|       |
   70|   136k|    return res;
   71|   136k|}
dav1d_ref_dec:
   73|  7.00M|void dav1d_ref_dec(Dav1dRef **const pref) {
   74|  7.00M|    assert(pref != NULL);
  ------------------
  |  |  140|  7.00M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 7.00M]
  |  |  |  Branch (140:68): [Folded, False: 7.00M]
  |  |  ------------------
  ------------------
   75|       |
   76|  7.00M|    Dav1dRef *const ref = *pref;
   77|  7.00M|    if (!ref) return;
  ------------------
  |  Branch (77:9): [True: 4.97M, False: 2.03M]
  ------------------
   78|       |
   79|  2.03M|    *pref = NULL;
   80|  2.03M|    if (atomic_fetch_sub(&ref->ref_cnt, 1) == 1) {
  ------------------
  |  Branch (80:9): [True: 211k, False: 1.82M]
  ------------------
   81|   211k|        const int free_ref = ref->free_ref;
   82|   211k|        ref->free_callback(ref->const_data, ref->user_data);
   83|   211k|        if (free_ref) dav1d_free(ref);
  ------------------
  |  |  135|  29.0k|#define dav1d_free(ptr) free(ptr)
  ------------------
  |  Branch (83:13): [True: 29.0k, False: 182k]
  ------------------
   84|   211k|    }
   85|  2.03M|}
ref.c:pool_free_callback:
   52|   136k|static void pool_free_callback(const uint8_t *const data, void *const user_data) {
   53|   136k|    dav1d_mem_pool_push((Dav1dMemPool*)data, user_data);
   54|   136k|}

picture.c:dav1d_ref_inc:
   69|  1.45M|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|  1.45M|}
picture.c:dav1d_ref_init:
   59|  45.5k|{
   60|  45.5k|    ref->data = NULL;
   61|  45.5k|    ref->const_data = ptr;
   62|       |    atomic_init(&ref->ref_cnt, 1);
   63|  45.5k|    ref->free_ref = free_ref;
   64|  45.5k|    ref->free_callback = free_callback;
   65|  45.5k|    ref->user_data = user_data;
   66|  45.5k|    return ref;
   67|  45.5k|}
cdf.c:dav1d_ref_inc:
   69|   144k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|   144k|}
data.c:dav1d_ref_init:
   59|  29.0k|{
   60|  29.0k|    ref->data = NULL;
   61|  29.0k|    ref->const_data = ptr;
   62|       |    atomic_init(&ref->ref_cnt, 1);
   63|  29.0k|    ref->free_ref = free_ref;
   64|  29.0k|    ref->free_callback = free_callback;
   65|  29.0k|    ref->user_data = user_data;
   66|  29.0k|    return ref;
   67|  29.0k|}
data.c:dav1d_ref_inc:
   69|  74.5k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|  74.5k|}
decode.c:dav1d_ref_inc:
   69|   146k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|   146k|}

dav1d_refmvs_find:
  354|   318k|{
  355|   318k|    const refmvs_frame *const rf = rt->rf;
  356|   318k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  357|   318k|    const int bw4 = b_dim[0], w4 = imin(imin(bw4, 16), rt->tile_col.end - bx4);
  358|   318k|    const int bh4 = b_dim[1], h4 = imin(imin(bh4, 16), rt->tile_row.end - by4);
  359|   318k|    mv gmv[2], tgmv[2];
  360|       |
  361|   318k|    *cnt = 0;
  362|   318k|    assert(ref.ref[0] >=  0 && ref.ref[0] <= 8 &&
  ------------------
  |  |  140|  1.90M|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 318k, False: 432]
  |  |  |  Branch (140:30): [True: 318k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 317k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 318k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 318k]
  |  |  ------------------
  ------------------
  363|   318k|           ref.ref[1] >= -1 && ref.ref[1] <= 8);
  364|   318k|    if (ref.ref[0] > 0) {
  ------------------
  |  Branch (364:9): [True: 317k, False: 497]
  ------------------
  365|   317k|        tgmv[0] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[0] - 1],
  366|   317k|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  367|   317k|        gmv[0] = rf->frm_hdr->gmv[ref.ref[0] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (367:18): [True: 0, False: 317k]
  ------------------
  368|   317k|                 tgmv[0] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|   317k|#define INVALID_MV 0x80008000
  ------------------
  369|   317k|    } else {
  370|    497|        tgmv[0] = (mv) { .n = 0 };
  371|    497|        gmv[0] = (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|    497|#define INVALID_MV 0x80008000
  ------------------
  372|    497|    }
  373|   318k|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (373:9): [True: 0, False: 318k]
  ------------------
  374|      0|        tgmv[1] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[1] - 1],
  375|      0|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  376|      0|        gmv[1] = rf->frm_hdr->gmv[ref.ref[1] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (376:18): [True: 0, False: 0]
  ------------------
  377|      0|                 tgmv[1] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|      0|#define INVALID_MV 0x80008000
  ------------------
  378|      0|    }
  379|       |
  380|       |    // top
  381|   318k|    int have_newmv = 0, have_col_mvs = 0, have_row_mvs = 0;
  382|   318k|    unsigned max_rows = 0, n_rows = ~0;
  383|   318k|    const refmvs_block *b_top;
  384|   318k|    if (by4 > rt->tile_row.start) {
  ------------------
  |  Branch (384:9): [True: 248k, False: 70.3k]
  ------------------
  385|   248k|        max_rows = imin((by4 - rt->tile_row.start + 1) >> 1, 2 + (bh4 > 1));
  386|   248k|        b_top = &rt->r[(by4 & 31) - 1 + 5][bx4];
  387|   248k|        n_rows = scan_row(mvstack, cnt, ref, gmv, b_top,
  388|   248k|                          bw4, w4, max_rows, bw4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (388:46): [True: 107, False: 248k]
  ------------------
  389|   248k|                          &have_newmv, &have_row_mvs);
  390|   248k|    }
  391|       |
  392|       |    // left
  393|   318k|    unsigned max_cols = 0, n_cols = ~0U;
  394|   318k|    refmvs_block *const *b_left;
  395|   318k|    if (bx4 > rt->tile_col.start) {
  ------------------
  |  Branch (395:9): [True: 249k, False: 68.8k]
  ------------------
  396|   249k|        max_cols = imin((bx4 - rt->tile_col.start + 1) >> 1, 2 + (bw4 > 1));
  397|   249k|        b_left = &rt->r[(by4 & 31) + 5];
  398|   249k|        n_cols = scan_col(mvstack, cnt, ref, gmv, b_left,
  399|   249k|                          bh4, h4, bx4 - 1, max_cols, bh4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (399:55): [True: 141, False: 249k]
  ------------------
  400|   249k|                          &have_newmv, &have_col_mvs);
  401|   249k|    }
  402|       |
  403|       |    // top/right
  404|   318k|    if (n_rows != ~0U && edge_flags & EDGE_I444_TOP_HAS_RIGHT &&
  ------------------
  |  Branch (404:9): [True: 248k, False: 70.1k]
  |  Branch (404:26): [True: 169k, False: 78.7k]
  ------------------
  405|   169k|        imax(bw4, bh4) <= 16 && bw4 + bx4 < rt->tile_col.end)
  ------------------
  |  Branch (405:9): [True: 169k, False: 68]
  |  Branch (405:33): [True: 141k, False: 27.8k]
  ------------------
  406|   141k|    {
  407|   141k|        add_spatial_candidate(mvstack, cnt, 4, &b_top[bw4], ref, gmv,
  408|   141k|                              &have_newmv, &have_row_mvs);
  409|   141k|    }
  410|       |
  411|   318k|    const int nearest_match = have_col_mvs + have_row_mvs;
  412|   318k|    const int nearest_cnt = *cnt;
  413|   682k|    for (int n = 0; n < nearest_cnt; n++)
  ------------------
  |  Branch (413:21): [True: 363k, False: 318k]
  ------------------
  414|   363k|        mvstack[n].weight += 640;
  415|       |
  416|       |    // temporal
  417|   318k|    int globalmv_ctx = rf->frm_hdr->use_ref_frame_mvs;
  418|   318k|    if (rf->use_ref_frame_mvs) {
  ------------------
  |  Branch (418:9): [True: 26.2k, False: 292k]
  ------------------
  419|  26.2k|        const ptrdiff_t stride = rf->rp_stride;
  420|  26.2k|        const int by8 = by4 >> 1, bx8 = bx4 >> 1;
  421|  26.2k|        const refmvs_temporal_block *const rbi = &rt->rp_proj[(by8 & 15) * stride + bx8];
  422|  26.2k|        const refmvs_temporal_block *rb = rbi;
  423|  26.2k|        const int step_h = bw4 >= 16 ? 2 : 1, step_v = bh4 >= 16 ? 2 : 1;
  ------------------
  |  Branch (423:28): [True: 92, False: 26.1k]
  |  Branch (423:56): [True: 109, False: 26.1k]
  ------------------
  424|  26.2k|        const int w8 = imin((w4 + 1) >> 1, 8), h8 = imin((h4 + 1) >> 1, 8);
  425|  57.0k|        for (int y = 0; y < h8; y += step_v) {
  ------------------
  |  Branch (425:25): [True: 30.7k, False: 26.2k]
  ------------------
  426|  70.8k|            for (int x = 0; x < w8; x+= step_h) {
  ------------------
  |  Branch (426:29): [True: 40.1k, False: 30.7k]
  ------------------
  427|  40.1k|                add_temporal_candidate(rf, mvstack, cnt, &rb[x], ref,
  428|  40.1k|                                       !(x | y) ? &globalmv_ctx : NULL, tgmv);
  ------------------
  |  Branch (428:40): [True: 26.2k, False: 13.8k]
  ------------------
  429|  40.1k|            }
  430|  30.7k|            rb += stride * step_v;
  431|  30.7k|        }
  432|  26.2k|        if (imin(bw4, bh4) >= 2 && imax(bw4, bh4) < 16) {
  ------------------
  |  Branch (432:13): [True: 26.1k, False: 160]
  |  Branch (432:36): [True: 25.9k, False: 117]
  ------------------
  433|  26.0k|            const int bh8 = bh4 >> 1, bw8 = bw4 >> 1;
  434|  26.0k|            rb = &rbi[bh8 * stride];
  435|  26.0k|            const int has_bottom = by8 + bh8 < imin(rt->tile_row.end >> 1,
  436|  26.0k|                                                    (by8 & ~7) + 8);
  437|  26.0k|            if (has_bottom && bx8 - 1 >= imax(rt->tile_col.start >> 1, bx8 & ~7)) {
  ------------------
  |  Branch (437:17): [True: 16.4k, False: 9.60k]
  |  Branch (437:31): [True: 11.7k, False: 4.66k]
  ------------------
  438|  11.7k|                add_temporal_candidate(rf, mvstack, cnt, &rb[-1], ref,
  439|  11.7k|                                       NULL, NULL);
  440|  11.7k|            }
  441|  26.0k|            if (bx8 + bw8 < imin(rt->tile_col.end >> 1, (bx8 & ~7) + 8)) {
  ------------------
  |  Branch (441:17): [True: 16.7k, False: 9.25k]
  ------------------
  442|  16.7k|                if (has_bottom) {
  ------------------
  |  Branch (442:21): [True: 11.1k, False: 5.59k]
  ------------------
  443|  11.1k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8], ref,
  444|  11.1k|                                           NULL, NULL);
  445|  11.1k|                }
  446|  16.7k|                if (by8 + bh8 - 1 < imin(rt->tile_row.end >> 1, (by8 & ~7) + 8)) {
  ------------------
  |  Branch (446:21): [True: 16.7k, False: 17]
  ------------------
  447|  16.7k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8 - stride],
  448|  16.7k|                                           ref, NULL, NULL);
  449|  16.7k|                }
  450|  16.7k|            }
  451|  26.0k|        }
  452|  26.2k|    }
  453|   318k|    assert(*cnt <= 8);
  ------------------
  |  |  140|   318k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 318k]
  |  |  |  Branch (140:68): [Folded, False: 318k]
  |  |  ------------------
  ------------------
  454|       |
  455|       |    // top/left (which, confusingly, is part of "secondary" references)
  456|   318k|    int have_dummy_newmv_match;
  457|   318k|    if ((n_rows | n_cols) != ~0U) {
  ------------------
  |  Branch (457:9): [True: 197k, False: 120k]
  ------------------
  458|   197k|        add_spatial_candidate(mvstack, cnt, 4, &b_top[-1], ref, gmv,
  459|   197k|                              &have_dummy_newmv_match, &have_row_mvs);
  460|   197k|    }
  461|       |
  462|       |    // "secondary" (non-direct neighbour) top & left edges
  463|       |    // what is different about secondary is that everything is now in 8x8 resolution
  464|   954k|    for (int n = 2; n <= 3; n++) {
  ------------------
  |  Branch (464:21): [True: 635k, False: 318k]
  ------------------
  465|   635k|        if ((unsigned) n > n_rows && (unsigned) n <= max_rows) {
  ------------------
  |  Branch (465:13): [True: 437k, False: 198k]
  |  Branch (465:38): [True: 330k, False: 107k]
  ------------------
  466|   330k|            n_rows += scan_row(mvstack, cnt, ref, gmv,
  467|   330k|                               &rt->r[(((by4 & 31) - 2 * n + 1) | 1) + 5][bx4 | 1],
  468|   330k|                               bw4, w4, 1 + max_rows - n, bw4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (468:59): [True: 120, False: 330k]
  ------------------
  469|   330k|                               &have_dummy_newmv_match, &have_row_mvs);
  470|   330k|        }
  471|       |
  472|   635k|        if ((unsigned) n > n_cols && (unsigned) n <= max_cols) {
  ------------------
  |  Branch (472:13): [True: 440k, False: 195k]
  |  Branch (472:38): [True: 333k, False: 107k]
  ------------------
  473|   333k|            n_cols += scan_col(mvstack, cnt, ref, gmv, &rt->r[((by4 & 31) | 1) + 5],
  474|   333k|                               bh4, h4, (bx4 - n * 2 + 1) | 1,
  475|   333k|                               1 + max_cols - n, bh4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (475:50): [True: 146, False: 332k]
  ------------------
  476|   333k|                               &have_dummy_newmv_match, &have_col_mvs);
  477|   333k|        }
  478|   635k|    }
  479|   318k|    assert(*cnt <= 8);
  ------------------
  |  |  140|   318k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 318k]
  |  |  |  Branch (140:68): [Folded, False: 318k]
  |  |  ------------------
  ------------------
  480|       |
  481|   318k|    const int ref_match_count = have_col_mvs + have_row_mvs;
  482|       |
  483|       |    // context build-up
  484|   318k|    int refmv_ctx, newmv_ctx;
  485|   318k|    switch (nearest_match) {
  ------------------
  |  Branch (485:13): [True: 319k, False: 18.4E]
  ------------------
  486|  75.8k|    case 0:
  ------------------
  |  Branch (486:5): [True: 75.8k, False: 242k]
  ------------------
  487|  75.8k|        refmv_ctx = imin(2, ref_match_count);
  488|  75.8k|        newmv_ctx = ref_match_count > 0;
  489|  75.8k|        break;
  490|   143k|    case 1:
  ------------------
  |  Branch (490:5): [True: 143k, False: 174k]
  ------------------
  491|   143k|        refmv_ctx = imin(ref_match_count * 3, 4);
  492|   143k|        newmv_ctx = 3 - have_newmv;
  493|   143k|        break;
  494|  99.6k|    case 2:
  ------------------
  |  Branch (494:5): [True: 99.6k, False: 218k]
  ------------------
  495|  99.6k|        refmv_ctx = 5;
  496|  99.6k|        newmv_ctx = 5 - have_newmv;
  497|  99.6k|        break;
  498|   318k|    }
  499|       |
  500|       |    // sorting (nearest, then "secondary")
  501|   318k|    int len = nearest_cnt;
  502|   580k|    while (len) {
  ------------------
  |  Branch (502:12): [True: 262k, False: 318k]
  ------------------
  503|   262k|        int last = 0;
  504|   385k|        for (int n = 1; n < len; n++) {
  ------------------
  |  Branch (504:25): [True: 123k, False: 262k]
  ------------------
  505|   123k|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (505:17): [True: 19.5k, False: 103k]
  ------------------
  506|  19.5k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  507|  19.5k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  506|  19.5k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (506:80): [Folded, False: 19.5k]
  |  |  ------------------
  ------------------
  508|  19.5k|                last = n;
  509|  19.5k|            }
  510|   123k|        }
  511|   262k|        len = last;
  512|   262k|    }
  513|   318k|    len = *cnt;
  514|   538k|    while (len > nearest_cnt) {
  ------------------
  |  Branch (514:12): [True: 219k, False: 318k]
  ------------------
  515|   219k|        int last = nearest_cnt;
  516|   442k|        for (int n = nearest_cnt + 1; n < len; n++) {
  ------------------
  |  Branch (516:39): [True: 222k, False: 219k]
  ------------------
  517|   222k|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (517:17): [True: 41.5k, False: 181k]
  ------------------
  518|  41.5k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  506|  41.5k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (506:80): [Folded, False: 41.5k]
  |  |  ------------------
  ------------------
  519|  41.5k|#undef EXCHANGE
  520|  41.5k|                last = n;
  521|  41.5k|            }
  522|   222k|        }
  523|   219k|        len = last;
  524|   219k|    }
  525|       |
  526|   318k|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (526:9): [True: 0, False: 318k]
  ------------------
  527|      0|        if (*cnt < 2) {
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|            const int sign0 = rf->sign_bias[ref.ref[0] - 1];
  529|      0|            const int sign1 = rf->sign_bias[ref.ref[1] - 1];
  530|      0|            const int sz4 = imin(w4, h4);
  531|      0|            refmvs_candidate *const same = &mvstack[*cnt];
  532|      0|            int same_count[4] = { 0 };
  533|       |
  534|       |            // non-self references in top
  535|      0|            if (n_rows != ~0U) for (int x = 0; x < sz4;) {
  ------------------
  |  Branch (535:17): [True: 0, False: 0]
  |  Branch (535:48): [True: 0, False: 0]
  ------------------
  536|      0|                const refmvs_block *const cand_b = &b_top[x];
  537|      0|                add_compound_extended_candidate(same, same_count, cand_b,
  538|      0|                                                sign0, sign1, ref, rf->sign_bias);
  539|      0|                x += dav1d_block_dimensions[cand_b->bs][0];
  540|      0|            }
  541|       |
  542|       |            // non-self references in left
  543|      0|            if (n_cols != ~0U) for (int y = 0; y < sz4;) {
  ------------------
  |  Branch (543:17): [True: 0, False: 0]
  |  Branch (543:48): [True: 0, False: 0]
  ------------------
  544|      0|                const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  545|      0|                add_compound_extended_candidate(same, same_count, cand_b,
  546|      0|                                                sign0, sign1, ref, rf->sign_bias);
  547|      0|                y += dav1d_block_dimensions[cand_b->bs][1];
  548|      0|            }
  549|       |
  550|      0|            refmvs_candidate *const diff = &same[2];
  551|      0|            const int *const diff_count = &same_count[2];
  552|       |
  553|       |            // merge together
  554|      0|            for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (554:29): [True: 0, False: 0]
  ------------------
  555|      0|                int m = same_count[n];
  556|       |
  557|      0|                if (m >= 2) continue;
  ------------------
  |  Branch (557:21): [True: 0, False: 0]
  ------------------
  558|       |
  559|      0|                const int l = diff_count[n];
  560|      0|                if (l) {
  ------------------
  |  Branch (560:21): [True: 0, False: 0]
  ------------------
  561|      0|                    same[m].mv.mv[n] = diff[0].mv.mv[n];
  562|      0|                    if (++m == 2) continue;
  ------------------
  |  Branch (562:25): [True: 0, False: 0]
  ------------------
  563|      0|                    if (l == 2) {
  ------------------
  |  Branch (563:25): [True: 0, False: 0]
  ------------------
  564|      0|                        same[1].mv.mv[n] = diff[1].mv.mv[n];
  565|      0|                        continue;
  566|      0|                    }
  567|      0|                }
  568|      0|                do {
  569|      0|                    same[m].mv.mv[n] = tgmv[n];
  570|      0|                } while (++m < 2);
  ------------------
  |  Branch (570:26): [True: 0, False: 0]
  ------------------
  571|      0|            }
  572|       |
  573|       |            // if the first extended was the same as the non-extended one,
  574|       |            // then replace it with the second extended one
  575|      0|            int n = *cnt;
  576|      0|            if (n == 1 && mvstack[0].mv.n == same[0].mv.n)
  ------------------
  |  Branch (576:17): [True: 0, False: 0]
  |  Branch (576:27): [True: 0, False: 0]
  ------------------
  577|      0|                mvstack[1].mv = mvstack[2].mv;
  578|      0|            do {
  579|      0|                mvstack[n].weight = 2;
  580|      0|            } while (++n < 2);
  ------------------
  |  Branch (580:22): [True: 0, False: 0]
  ------------------
  581|      0|            *cnt = 2;
  582|      0|        }
  583|       |
  584|       |        // clamping
  585|      0|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  586|      0|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  587|      0|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  588|      0|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  589|       |
  590|      0|        const int n_refmvs = *cnt;
  591|      0|        int n = 0;
  592|      0|        do {
  593|      0|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  594|      0|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  595|      0|            mvstack[n].mv.mv[1].x = iclip(mvstack[n].mv.mv[1].x, left, right);
  596|      0|            mvstack[n].mv.mv[1].y = iclip(mvstack[n].mv.mv[1].y, top, bottom);
  597|      0|        } while (++n < n_refmvs);
  ------------------
  |  Branch (597:18): [True: 0, False: 0]
  ------------------
  598|       |
  599|      0|        switch (refmv_ctx >> 1) {
  ------------------
  |  Branch (599:17): [True: 0, False: 0]
  ------------------
  600|      0|        case 0:
  ------------------
  |  Branch (600:9): [True: 0, False: 0]
  ------------------
  601|      0|            *ctx = imin(newmv_ctx, 1);
  602|      0|            break;
  603|      0|        case 1:
  ------------------
  |  Branch (603:9): [True: 0, False: 0]
  ------------------
  604|      0|            *ctx = 1 + imin(newmv_ctx, 3);
  605|      0|            break;
  606|      0|        case 2:
  ------------------
  |  Branch (606:9): [True: 0, False: 0]
  ------------------
  607|      0|            *ctx = iclip(3 + newmv_ctx, 4, 7);
  608|      0|            break;
  609|      0|        }
  610|       |
  611|      0|        return;
  612|   318k|    } else if (*cnt < 2 && ref.ref[0] > 0) {
  ------------------
  |  Branch (612:16): [True: 128k, False: 190k]
  |  Branch (612:28): [True: 128k, False: 18.4E]
  ------------------
  613|   128k|        const int sign = rf->sign_bias[ref.ref[0] - 1];
  614|   128k|        const int sz4 = imin(w4, h4);
  615|       |
  616|       |        // non-self references in top
  617|   150k|        if (n_rows != ~0U) for (int x = 0; x < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (617:13): [True: 75.1k, False: 53.3k]
  |  Branch (617:44): [True: 75.6k, False: 75.1k]
  |  Branch (617:55): [True: 75.6k, False: 18.4E]
  ------------------
  618|  75.6k|            const refmvs_block *const cand_b = &b_top[x];
  619|  75.6k|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  620|  75.6k|            x += dav1d_block_dimensions[cand_b->bs][0];
  621|  75.6k|        }
  622|       |
  623|       |        // non-self references in left
  624|   166k|        if (n_cols != ~0U) for (int y = 0; y < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (624:13): [True: 82.7k, False: 45.8k]
  |  Branch (624:44): [True: 83.3k, False: 82.7k]
  |  Branch (624:55): [True: 83.3k, False: 18.4E]
  ------------------
  625|  83.3k|            const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  626|  83.3k|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  627|  83.3k|            y += dav1d_block_dimensions[cand_b->bs][1];
  628|  83.3k|        }
  629|   128k|    }
  630|   318k|    assert(*cnt <= 8);
  ------------------
  |  |  140|   318k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 318k]
  |  |  |  Branch (140:68): [Folded, False: 318k]
  |  |  ------------------
  ------------------
  631|       |
  632|       |    // clamping
  633|   318k|    int n_refmvs = *cnt;
  634|   318k|    if (n_refmvs) {
  ------------------
  |  Branch (634:9): [True: 274k, False: 44.3k]
  ------------------
  635|   274k|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  636|   274k|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  637|   274k|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  638|   274k|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  639|       |
  640|   274k|        int n = 0;
  641|   752k|        do {
  642|   752k|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  643|   752k|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  644|   752k|        } while (++n < n_refmvs);
  ------------------
  |  Branch (644:18): [True: 478k, False: 274k]
  ------------------
  645|   274k|    }
  646|       |
  647|   491k|    for (int n = *cnt; n < 2; n++)
  ------------------
  |  Branch (647:24): [True: 172k, False: 318k]
  ------------------
  648|   172k|        mvstack[n].mv.mv[0] = tgmv[0];
  649|       |
  650|   318k|    *ctx = (refmv_ctx << 4) | (globalmv_ctx << 3) | newmv_ctx;
  651|   318k|}
dav1d_refmvs_tile_sbrow_init:
  657|  63.3k|{
  658|  63.3k|    if (rf->n_tile_threads == 1) tile_row_idx = 0;
  ------------------
  |  Branch (658:9): [True: 3.48k, False: 59.8k]
  ------------------
  659|  63.3k|    rt->rp_proj = &rf->rp_proj[16 * rf->rp_stride * tile_row_idx];
  660|  63.3k|    const ptrdiff_t r_stride = rf->rp_stride * 2;
  661|  63.3k|    const ptrdiff_t pass_off = (rf->n_frame_threads > 1 && pass == 2) ?
  ------------------
  |  Branch (661:33): [True: 0, False: 63.3k]
  |  Branch (661:60): [True: 0, False: 0]
  ------------------
  662|  63.3k|        35 * 2 * rf->n_blocks : 0;
  663|  63.3k|    refmvs_block *r = &rf->r[35 * r_stride * tile_row_idx + pass_off];
  664|  63.3k|    const int sbsz = rf->sbsz;
  665|  63.3k|    const int off = (sbsz * sby) & 16;
  666|  1.07M|    for (int i = 0; i < sbsz; i++, r += r_stride)
  ------------------
  |  Branch (666:21): [True: 1.01M, False: 63.3k]
  ------------------
  667|  1.01M|        rt->r[off + 5 + i] = r;
  668|  63.3k|    rt->r[off + 0] = r;
  669|  63.3k|    r += r_stride;
  670|  63.3k|    rt->r[off + 1] = NULL;
  671|  63.3k|    rt->r[off + 2] = r;
  672|  63.3k|    r += r_stride;
  673|  63.3k|    rt->r[off + 3] = NULL;
  674|  63.3k|    rt->r[off + 4] = r;
  675|  63.3k|    if (sby & 1) {
  ------------------
  |  Branch (675:9): [True: 13.8k, False: 49.5k]
  ------------------
  676|  13.8k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  677|  13.8k|        EXCHANGE(rt->r[off + 0], rt->r[off + sbsz + 0]);
  ------------------
  |  |  676|  13.8k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (676:75): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  678|  13.8k|        EXCHANGE(rt->r[off + 2], rt->r[off + sbsz + 2]);
  ------------------
  |  |  676|  13.8k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (676:75): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  679|  13.8k|        EXCHANGE(rt->r[off + 4], rt->r[off + sbsz + 4]);
  ------------------
  |  |  676|  13.8k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (676:75): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  680|  13.8k|#undef EXCHANGE
  681|  13.8k|    }
  682|       |
  683|  63.3k|    rt->rf = rf;
  684|  63.3k|    rt->tile_row.start = tile_row_start4;
  685|  63.3k|    rt->tile_row.end = imin(tile_row_end4, rf->ih4);
  686|  63.3k|    rt->tile_col.start = tile_col_start4;
  687|  63.3k|    rt->tile_col.end = imin(tile_col_end4, rf->iw4);
  688|  63.3k|}
dav1d_refmvs_init_frame:
  812|  34.1k|{
  813|  34.1k|    const int rp_stride = ((frm_hdr->width[0] + 127) & ~127) >> 3;
  814|  34.1k|    const int n_tile_rows = n_tile_threads > 1 ? frm_hdr->tiling.rows : 1;
  ------------------
  |  Branch (814:29): [True: 32.4k, False: 1.76k]
  ------------------
  815|  34.1k|    const int n_blocks = rp_stride * n_tile_rows;
  816|       |
  817|  34.1k|    rf->sbsz = 16 << seq_hdr->sb128;
  818|  34.1k|    rf->frm_hdr = frm_hdr;
  819|  34.1k|    rf->iw8 = (frm_hdr->width[0] + 7) >> 3;
  820|  34.1k|    rf->ih8 = (frm_hdr->height + 7) >> 3;
  821|  34.1k|    rf->iw4 = rf->iw8 << 1;
  822|  34.1k|    rf->ih4 = rf->ih8 << 1;
  823|  34.1k|    rf->rp = rp;
  824|  34.1k|    rf->rp_stride = rp_stride;
  825|  34.1k|    rf->n_tile_threads = n_tile_threads;
  826|  34.1k|    rf->n_frame_threads = n_frame_threads;
  827|       |
  828|  34.1k|    if (n_blocks != rf->n_blocks) {
  ------------------
  |  Branch (828:9): [True: 14.2k, False: 19.9k]
  ------------------
  829|  14.2k|        const size_t r_sz = sizeof(*rf->r) * 35 * 2 * n_blocks * (1 + (n_frame_threads > 1));
  830|  14.2k|        const size_t rp_proj_sz = sizeof(*rf->rp_proj) * 16 * n_blocks;
  831|       |        /* Note that sizeof(*rf->r) == 12, but it's accessed using 16-byte unaligned
  832|       |         * loads in save_tmvs() asm which can overread 4 bytes into rp_proj. */
  833|  14.2k|        dav1d_free_aligned(rf->r);
  ------------------
  |  |  136|  14.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  834|  14.2k|        rf->r = dav1d_alloc_aligned(ALLOC_REFMVS, r_sz + rp_proj_sz, 64);
  ------------------
  |  |  134|  14.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  835|  14.2k|        if (!rf->r) {
  ------------------
  |  Branch (835:13): [True: 0, False: 14.2k]
  ------------------
  836|      0|            rf->n_blocks = 0;
  837|      0|            return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  838|      0|        }
  839|       |
  840|  14.2k|        rf->rp_proj = (refmvs_temporal_block*)((uintptr_t)rf->r + r_sz);
  841|  14.2k|        rf->n_blocks = n_blocks;
  842|  14.2k|    }
  843|       |
  844|  34.1k|    const int poc = frm_hdr->frame_offset;
  845|   273k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (845:21): [True: 239k, False: 34.1k]
  ------------------
  846|   239k|        const int poc_diff = get_poc_diff(seq_hdr->order_hint_n_bits,
  847|   239k|                                          ref_poc[i], poc);
  848|   239k|        rf->sign_bias[i] = poc_diff > 0;
  849|   239k|        rf->mfmv_sign[i] = poc_diff < 0;
  850|   239k|        rf->pocdiff[i] = iclip(get_poc_diff(seq_hdr->order_hint_n_bits,
  851|   239k|                                            poc, ref_poc[i]), -31, 31);
  852|   239k|    }
  853|       |
  854|       |    // temporal MV setup
  855|  34.1k|    rf->n_mfmvs = 0;
  856|  34.1k|    rf->rp_ref = rp_ref;
  857|  34.1k|    if (frm_hdr->use_ref_frame_mvs && seq_hdr->order_hint_n_bits) {
  ------------------
  |  Branch (857:9): [True: 34.1k, False: 0]
  |  Branch (857:39): [True: 34.1k, False: 0]
  ------------------
  858|  34.1k|        int total = 2;
  859|  34.1k|        if (rp_ref[0] && ref_ref_poc[0][6] != ref_poc[3] /* alt-of-last != gold */) {
  ------------------
  |  Branch (859:13): [True: 9.56k, False: 24.6k]
  |  Branch (859:26): [True: 9.56k, False: 0]
  ------------------
  860|  9.56k|            rf->mfmv_ref[rf->n_mfmvs++] = 0; // last
  861|  9.56k|            total = 3;
  862|  9.56k|        }
  863|  34.1k|        if (rp_ref[4] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[4],
  ------------------
  |  Branch (863:13): [True: 9.56k, False: 24.6k]
  |  Branch (863:26): [True: 0, False: 9.56k]
  ------------------
  864|  9.56k|                                      frm_hdr->frame_offset) > 0)
  865|      0|        {
  866|      0|            rf->mfmv_ref[rf->n_mfmvs++] = 4; // bwd
  867|      0|        }
  868|  34.1k|        if (rp_ref[5] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[5],
  ------------------
  |  Branch (868:13): [True: 9.56k, False: 24.6k]
  |  Branch (868:26): [True: 0, False: 9.56k]
  ------------------
  869|  9.56k|                                      frm_hdr->frame_offset) > 0)
  870|      0|        {
  871|      0|            rf->mfmv_ref[rf->n_mfmvs++] = 5; // altref2
  872|      0|        }
  873|  34.1k|        if (rf->n_mfmvs < total && rp_ref[6] &&
  ------------------
  |  Branch (873:13): [True: 34.1k, False: 0]
  |  Branch (873:36): [True: 9.56k, False: 24.6k]
  ------------------
  874|  9.56k|            get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[6],
  ------------------
  |  Branch (874:13): [True: 0, False: 9.56k]
  ------------------
  875|  9.56k|                         frm_hdr->frame_offset) > 0)
  876|      0|        {
  877|      0|            rf->mfmv_ref[rf->n_mfmvs++] = 6; // altref
  878|      0|        }
  879|  34.1k|        if (rf->n_mfmvs < total && rp_ref[1])
  ------------------
  |  Branch (879:13): [True: 34.1k, False: 0]
  |  Branch (879:36): [True: 9.56k, False: 24.6k]
  ------------------
  880|  9.56k|            rf->mfmv_ref[rf->n_mfmvs++] = 1; // last2
  881|       |
  882|  53.2k|        for (int n = 0; n < rf->n_mfmvs; n++) {
  ------------------
  |  Branch (882:25): [True: 19.1k, False: 34.1k]
  ------------------
  883|  19.1k|            const int rpoc = ref_poc[rf->mfmv_ref[n]];
  884|  19.1k|            const int diff1 = get_poc_diff(seq_hdr->order_hint_n_bits,
  885|  19.1k|                                           rpoc, frm_hdr->frame_offset);
  886|  19.1k|            if (abs(diff1) > 31) {
  ------------------
  |  Branch (886:17): [True: 0, False: 19.1k]
  ------------------
  887|      0|                rf->mfmv_ref2cur[n] = INVALID_REF2CUR;
  ------------------
  |  |   41|      0|#define INVALID_REF2CUR (-32)
  ------------------
  888|  19.1k|            } else {
  889|  19.1k|                rf->mfmv_ref2cur[n] = rf->mfmv_ref[n] < 4 ? -diff1 : diff1;
  ------------------
  |  Branch (889:39): [True: 19.1k, False: 0]
  ------------------
  890|   152k|                for (int m = 0; m < 7; m++) {
  ------------------
  |  Branch (890:33): [True: 133k, False: 19.1k]
  ------------------
  891|   133k|                    const int rrpoc = ref_ref_poc[rf->mfmv_ref[n]][m];
  892|   133k|                    const int diff2 = get_poc_diff(seq_hdr->order_hint_n_bits,
  893|   133k|                                                   rpoc, rrpoc);
  894|       |                    // unsigned comparison also catches the < 0 case
  895|   133k|                    rf->mfmv_ref2ref[n][m] = (unsigned) diff2 > 31U ? 0 : diff2;
  ------------------
  |  Branch (895:46): [True: 0, False: 133k]
  ------------------
  896|   133k|                }
  897|  19.1k|            }
  898|  19.1k|        }
  899|  34.1k|    }
  900|  34.1k|    rf->use_ref_frame_mvs = rf->n_mfmvs > 0;
  901|       |
  902|  34.1k|    return 0;
  903|  34.1k|}
dav1d_refmvs_dsp_init:
  926|  11.3k|{
  927|  11.3k|    c->load_tmvs = load_tmvs_c;
  928|  11.3k|    c->save_tmvs = save_tmvs_c;
  929|  11.3k|    c->splat_mv = splat_mv_c;
  930|       |
  931|  11.3k|#if HAVE_ASM
  932|       |#if ARCH_AARCH64 || ARCH_ARM
  933|       |    refmvs_dsp_init_arm(c);
  934|       |#elif ARCH_LOONGARCH64
  935|       |    refmvs_dsp_init_loongarch(c);
  936|       |#elif ARCH_X86
  937|       |    refmvs_dsp_init_x86(c);
  938|  11.3k|#endif
  939|  11.3k|#endif
  940|  11.3k|}
refmvs.c:scan_row:
  102|   578k|{
  103|   578k|    const refmvs_block *cand_b = b;
  104|   578k|    const enum BlockSize first_cand_bs = cand_b->bs;
  105|   578k|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  106|   578k|    int cand_bw4 = first_cand_b_dim[0];
  107|   578k|    int len = imax(step, imin(bw4, cand_bw4));
  108|       |
  109|   578k|    if (bw4 <= cand_bw4) {
  ------------------
  |  Branch (109:9): [True: 570k, False: 7.55k]
  ------------------
  110|       |        // FIXME weight can be higher for odd blocks (bx4 & 1), but then the
  111|       |        // position of the first block has to be odd already, i.e. not just
  112|       |        // for row_offset=-3/-5
  113|       |        // FIXME why can this not be cand_bw4?
  114|   570k|        const int weight = bw4 == 1 ? 2 :
  ------------------
  |  Branch (114:28): [True: 2.89k, False: 567k]
  ------------------
  115|   570k|                           imax(2, imin(2 * max_rows, first_cand_b_dim[1]));
  116|   570k|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  117|   570k|                              have_newmv_match, have_refmv_match);
  118|   570k|        return weight >> 1;
  119|   570k|    }
  120|       |
  121|  14.3k|    for (int x = 0;;) {
  122|       |        // FIXME if we overhang above, we could fill a bitmask so we don't have
  123|       |        // to repeat the add_spatial_candidate() for the next row, but just increase
  124|       |        // the weight here
  125|  14.3k|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  126|  14.3k|                              have_newmv_match, have_refmv_match);
  127|  14.3k|        x += len;
  128|  14.3k|        if (x >= w4) return 1;
  ------------------
  |  Branch (128:13): [True: 7.08k, False: 7.27k]
  ------------------
  129|  7.27k|        cand_b = &b[x];
  130|  7.27k|        cand_bw4 = dav1d_block_dimensions[cand_b->bs][0];
  131|  7.27k|        assert(cand_bw4 < bw4);
  ------------------
  |  |  140|  7.27k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 7.27k]
  |  |  |  Branch (140:68): [Folded, False: 7.27k]
  |  |  ------------------
  ------------------
  132|  7.27k|        len = imax(step, cand_bw4);
  133|  7.27k|    }
  134|  7.55k|}
refmvs.c:scan_col:
  141|   581k|{
  142|   581k|    const refmvs_block *cand_b = &b[0][bx4];
  143|   581k|    const enum BlockSize first_cand_bs = cand_b->bs;
  144|   581k|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  145|   581k|    int cand_bh4 = first_cand_b_dim[1];
  146|   581k|    int len = imax(step, imin(bh4, cand_bh4));
  147|       |
  148|   581k|    if (bh4 <= cand_bh4) {
  ------------------
  |  Branch (148:9): [True: 574k, False: 7.72k]
  ------------------
  149|       |        // FIXME weight can be higher for odd blocks (by4 & 1), but then the
  150|       |        // position of the first block has to be odd already, i.e. not just
  151|       |        // for col_offset=-3/-5
  152|       |        // FIXME why can this not be cand_bh4?
  153|   574k|        const int weight = bh4 == 1 ? 2 :
  ------------------
  |  Branch (153:28): [True: 3.66k, False: 570k]
  ------------------
  154|   574k|                           imax(2, imin(2 * max_cols, first_cand_b_dim[0]));
  155|   574k|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  156|   574k|                            have_newmv_match, have_refmv_match);
  157|   574k|        return weight >> 1;
  158|   574k|    }
  159|       |
  160|  15.1k|    for (int y = 0;;) {
  161|       |        // FIXME if we overhang above, we could fill a bitmask so we don't have
  162|       |        // to repeat the add_spatial_candidate() for the next row, but just increase
  163|       |        // the weight here
  164|  15.1k|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  165|  15.1k|                              have_newmv_match, have_refmv_match);
  166|  15.1k|        y += len;
  167|  15.1k|        if (y >= h4) return 1;
  ------------------
  |  Branch (167:13): [True: 7.41k, False: 7.71k]
  ------------------
  168|  7.71k|        cand_b = &b[y][bx4];
  169|  7.71k|        cand_bh4 = dav1d_block_dimensions[cand_b->bs][1];
  170|  7.71k|        assert(cand_bh4 < bh4);
  ------------------
  |  |  140|  7.71k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 7.71k]
  |  |  |  Branch (140:68): [Folded, False: 7.71k]
  |  |  ------------------
  ------------------
  171|  7.71k|        len = imax(step, cand_bh4);
  172|  7.71k|    }
  173|  7.72k|}
refmvs.c:add_spatial_candidate:
   46|  1.50M|{
   47|  1.50M|    if (b->mv.mv[0].n == INVALID_MV) return; // intra block, no intrabc
  ------------------
  |  |   40|  1.50M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (47:9): [True: 575k, False: 929k]
  ------------------
   48|       |
   49|   933k|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (49:9): [True: 933k, False: 18.4E]
  ------------------
   50|  18.4E|        for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (50:25): [True: 933k, False: 18.4E]
  ------------------
   51|   934k|            if (b->ref.ref[n] == ref.ref[0]) {
  ------------------
  |  Branch (51:17): [True: 934k, False: 18.4E]
  ------------------
   52|   934k|                const mv cand_mv = ((b->mf & 1) && gmv[0].n != INVALID_MV) ?
  ------------------
  |  |   40|  27.7k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (52:37): [True: 27.7k, False: 906k]
  |  Branch (52:52): [True: 0, False: 27.7k]
  ------------------
   53|   934k|                                   gmv[0] : b->mv.mv[n];
   54|       |
   55|   934k|                *have_refmv_match = 1;
   56|   934k|                *have_newmv_match |= b->mf >> 1;
   57|       |
   58|   934k|                const int last = *cnt;
   59|  2.01M|                for (int m = 0; m < last; m++)
  ------------------
  |  Branch (59:33): [True: 1.29M, False: 717k]
  ------------------
   60|  1.29M|                    if (mvstack[m].mv.mv[0].n == cand_mv.n) {
  ------------------
  |  Branch (60:25): [True: 216k, False: 1.07M]
  ------------------
   61|   216k|                        mvstack[m].weight += weight;
   62|   216k|                        return;
   63|   216k|                    }
   64|       |
   65|   719k|                if (last < 8) {
  ------------------
  |  Branch (65:21): [True: 719k, False: 18.4E]
  ------------------
   66|   719k|                    mvstack[last].mv.mv[0] = cand_mv;
   67|   719k|                    mvstack[last].weight = weight;
   68|   719k|                    *cnt = last + 1;
   69|   719k|                }
   70|   717k|                return;
   71|   934k|            }
   72|   933k|        }
   73|  18.4E|    } else if (b->ref.pair == ref.pair) {
  ------------------
  |  Branch (73:16): [True: 0, False: 18.4E]
  ------------------
   74|      0|        const refmvs_mvpair cand_mv = { .mv = {
   75|      0|            [0] = ((b->mf & 1) && gmv[0].n != INVALID_MV) ? gmv[0] : b->mv.mv[0],
  ------------------
  |  |   40|      0|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (75:20): [True: 0, False: 0]
  |  Branch (75:35): [True: 0, False: 0]
  ------------------
   76|      0|            [1] = ((b->mf & 1) && gmv[1].n != INVALID_MV) ? gmv[1] : b->mv.mv[1],
  ------------------
  |  |   40|      0|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (76:20): [True: 0, False: 0]
  |  Branch (76:35): [True: 0, False: 0]
  ------------------
   77|      0|        }};
   78|       |
   79|      0|        *have_refmv_match = 1;
   80|      0|        *have_newmv_match |= b->mf >> 1;
   81|       |
   82|      0|        const int last = *cnt;
   83|      0|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (83:25): [True: 0, False: 0]
  ------------------
   84|      0|            if (mvstack[n].mv.n == cand_mv.n) {
  ------------------
  |  Branch (84:17): [True: 0, False: 0]
  ------------------
   85|      0|                mvstack[n].weight += weight;
   86|      0|                return;
   87|      0|            }
   88|       |
   89|      0|        if (last < 8) {
  ------------------
  |  Branch (89:13): [True: 0, False: 0]
  ------------------
   90|      0|            mvstack[last].mv = cand_mv;
   91|      0|            mvstack[last].weight = weight;
   92|      0|            *cnt = last + 1;
   93|      0|        }
   94|      0|    }
   95|   929k|}
refmvs.c:add_temporal_candidate:
  198|  79.3k|{
  199|  79.3k|    if (rb->mv.n == INVALID_MV) return;
  ------------------
  |  |   40|  79.3k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (199:9): [True: 28.8k, False: 50.5k]
  ------------------
  200|       |
  201|  50.5k|    union mv mv = mv_projection(rb->mv, rf->pocdiff[ref.ref[0] - 1], rb->ref);
  202|  50.5k|    fix_mv_precision(rf->frm_hdr, &mv);
  203|       |
  204|  50.5k|    const int last = *cnt;
  205|  50.8k|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (205:9): [True: 50.8k, False: 18.4E]
  ------------------
  206|  50.8k|        if (globalmv_ctx)
  ------------------
  |  Branch (206:13): [True: 16.8k, False: 33.9k]
  ------------------
  207|  16.8k|            *globalmv_ctx = (abs(mv.x - gmv[0].x) | abs(mv.y - gmv[0].y)) >= 16;
  208|       |
  209|   111k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (209:25): [True: 81.6k, False: 29.9k]
  ------------------
  210|  81.6k|            if (mvstack[n].mv.mv[0].n == mv.n) {
  ------------------
  |  Branch (210:17): [True: 20.8k, False: 60.7k]
  ------------------
  211|  20.8k|                mvstack[n].weight += 2;
  212|  20.8k|                return;
  213|  20.8k|            }
  214|  30.0k|        if (last < 8) {
  ------------------
  |  Branch (214:13): [True: 30.0k, False: 18.4E]
  ------------------
  215|  30.0k|            mvstack[last].mv.mv[0] = mv;
  216|  30.0k|            mvstack[last].weight = 2;
  217|  30.0k|            *cnt = last + 1;
  218|  30.0k|        }
  219|  18.4E|    } else {
  220|  18.4E|        refmvs_mvpair mvp = { .mv = {
  221|  18.4E|            [0] = mv,
  222|  18.4E|            [1] = mv_projection(rb->mv, rf->pocdiff[ref.ref[1] - 1], rb->ref),
  223|  18.4E|        }};
  224|  18.4E|        fix_mv_precision(rf->frm_hdr, &mvp.mv[1]);
  225|       |
  226|  18.4E|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (226:25): [True: 0, False: 18.4E]
  ------------------
  227|      0|            if (mvstack[n].mv.n == mvp.n) {
  ------------------
  |  Branch (227:17): [True: 0, False: 0]
  ------------------
  228|      0|                mvstack[n].weight += 2;
  229|      0|                return;
  230|      0|            }
  231|  18.4E|        if (last < 8) {
  ------------------
  |  Branch (231:13): [True: 0, False: 18.4E]
  ------------------
  232|      0|            mvstack[last].mv = mvp;
  233|      0|            mvstack[last].weight = 2;
  234|      0|            *cnt = last + 1;
  235|      0|        }
  236|  18.4E|    }
  237|  50.5k|}
refmvs.c:mv_projection:
  175|  50.7k|static inline union mv mv_projection(const union mv mv, const int num, const int den) {
  176|  50.7k|    static const uint16_t div_mult[32] = {
  177|  50.7k|           0, 16384, 8192, 5461, 4096, 3276, 2730, 2340,
  178|  50.7k|        2048,  1820, 1638, 1489, 1365, 1260, 1170, 1092,
  179|  50.7k|        1024,   963,  910,  862,  819,  780,  744,  712,
  180|  50.7k|         682,   655,  630,  606,  585,  564,  546,  528
  181|  50.7k|    };
  182|  50.7k|    assert(den > 0 && den < 32);
  ------------------
  |  |  140|   101k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 50.7k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 50.7k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 50.7k]
  |  |  ------------------
  ------------------
  183|  50.7k|    assert(num > -32 && num < 32);
  ------------------
  |  |  140|   101k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 50.7k, False: 18.4E]
  |  |  |  Branch (140:30): [True: 50.7k, False: 18.4E]
  |  |  |  Branch (140:68): [Folded, False: 50.7k]
  |  |  ------------------
  ------------------
  184|  50.7k|    const int frac = num * div_mult[den];
  185|  50.7k|    const int y = mv.y * frac, x = mv.x * frac;
  186|       |    // Round and clip according to AV1 spec section 7.9.3
  187|  50.7k|    return (union mv) { // 0x3fff == (1 << 14) - 1
  188|  50.7k|        .y = iclip((y + 8192 + (y >> 31)) >> 14, -0x3fff, 0x3fff),
  189|  50.7k|        .x = iclip((x + 8192 + (x >> 31)) >> 14, -0x3fff, 0x3fff)
  190|  50.7k|    };
  191|  50.7k|}
refmvs.c:add_single_extended_candidate:
  299|   158k|{
  300|   230k|    for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (300:21): [True: 230k, False: 18.4E]
  ------------------
  301|   230k|        const int cand_ref = cand_b->ref.ref[n];
  302|       |
  303|   230k|        if (cand_ref <= 0) break;
  ------------------
  |  Branch (303:13): [True: 158k, False: 71.6k]
  ------------------
  304|       |        // we need to continue even if cand_ref == ref.ref[0], since
  305|       |        // the candidate could have been added as a globalmv variant,
  306|       |        // which changes the value
  307|       |        // FIXME if scan_{row,col}() returned a mask for the nearest
  308|       |        // edge, we could skip the appropriate ones here
  309|       |
  310|  71.6k|        mv cand_mv = cand_b->mv.mv[n];
  311|  71.6k|        if (sign ^ sign_bias[cand_ref - 1]) {
  ------------------
  |  Branch (311:13): [True: 0, False: 71.6k]
  ------------------
  312|      0|            cand_mv.y = -cand_mv.y;
  313|      0|            cand_mv.x = -cand_mv.x;
  314|      0|        }
  315|       |
  316|  71.6k|        int m;
  317|  71.6k|        const int last = *cnt;
  318|  18.4E|        for (m = 0; m < last; m++)
  ------------------
  |  Branch (318:21): [True: 71.7k, False: 18.4E]
  ------------------
  319|  71.7k|            if (cand_mv.n == mvstack[m].mv.mv[0].n)
  ------------------
  |  Branch (319:17): [True: 71.7k, False: 18.4E]
  ------------------
  320|  71.7k|                break;
  321|  71.6k|        if (m == last) {
  ------------------
  |  Branch (321:13): [True: 0, False: 71.6k]
  ------------------
  322|      0|            mvstack[m].mv.mv[0] = cand_mv;
  323|      0|            mvstack[m].weight = 2; // "minimal"
  324|      0|            *cnt = last + 1;
  325|      0|        }
  326|  71.6k|    }
  327|   158k|}

decode.c:dav1d_refmvs_save_tmvs:
  145|  62.4k|{
  146|  62.4k|    const refmvs_frame *const rf = rt->rf;
  147|       |
  148|  62.4k|    assert(row_start8 >= 0);
  ------------------
  |  |  140|  62.4k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 62.4k]
  |  |  |  Branch (140:68): [Folded, False: 62.4k]
  |  |  ------------------
  ------------------
  149|  62.4k|    assert((unsigned) (row_end8 - row_start8) <= 16U);
  ------------------
  |  |  140|  62.4k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 62.4k]
  |  |  |  Branch (140:68): [Folded, False: 62.4k]
  |  |  ------------------
  ------------------
  150|  62.4k|    row_end8 = imin(row_end8, rf->ih8);
  151|  62.4k|    col_end8 = imin(col_end8, rf->iw8);
  152|       |
  153|  62.4k|    const ptrdiff_t stride = rf->rp_stride;
  154|  62.4k|    const uint8_t *const ref_sign = rf->mfmv_sign;
  155|  62.4k|    refmvs_temporal_block *rp = &rf->rp[row_start8 * stride];
  156|       |
  157|  62.4k|    dsp->save_tmvs(rp, stride, rt->r + 6, ref_sign,
  158|  62.4k|                   col_end8, row_end8, col_start8, row_start8);
  159|  62.4k|}

dav1d_init_last_nonzero_col_from_eob_tables:
  350|  1.73k|COLD void dav1d_init_last_nonzero_col_from_eob_tables(void) {
  351|       |    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  352|  1.73k|    pthread_once(&initted, init_internal);
  353|  1.73k|}
scan.c:init_internal:
  333|      1|static COLD void init_internal(void) {
  334|      1|    init_tbl(last_nonzero_col_from_eob_4x4,   scan_4x4,    4,  4);
  335|      1|    init_tbl(last_nonzero_col_from_eob_8x8,   scan_8x8,    8,  8);
  336|      1|    init_tbl(last_nonzero_col_from_eob_16x16, scan_16x16, 16, 16);
  337|      1|    init_tbl(last_nonzero_col_from_eob_32x32, scan_32x32, 32, 32);
  338|      1|    init_tbl(last_nonzero_col_from_eob_4x8,   scan_4x8,    4,  8);
  339|      1|    init_tbl(last_nonzero_col_from_eob_8x4,   scan_8x4,    8,  4);
  340|      1|    init_tbl(last_nonzero_col_from_eob_8x16,  scan_8x16,   8, 16);
  341|      1|    init_tbl(last_nonzero_col_from_eob_16x8,  scan_16x8,  16,  8);
  342|      1|    init_tbl(last_nonzero_col_from_eob_16x32, scan_16x32, 16, 32);
  343|      1|    init_tbl(last_nonzero_col_from_eob_32x16, scan_32x16, 32, 16);
  344|      1|    init_tbl(last_nonzero_col_from_eob_4x16,  scan_4x16,   4, 16);
  345|      1|    init_tbl(last_nonzero_col_from_eob_16x4,  scan_16x4,  16,  4);
  346|      1|    init_tbl(last_nonzero_col_from_eob_8x32,  scan_8x32,   8, 32);
  347|      1|    init_tbl(last_nonzero_col_from_eob_32x8,  scan_32x8,  32,  8);
  348|      1|}
scan.c:init_tbl:
  321|     14|{
  322|     14|    int max_col = 0;
  323|    218|    for (int y = 0, n = 0; y < h; y++) {
  ------------------
  |  Branch (323:28): [True: 204, False: 14]
  ------------------
  324|  3.54k|        for (int x = 0; x < w; x++, n++) {
  ------------------
  |  Branch (324:25): [True: 3.34k, False: 204]
  ------------------
  325|  3.34k|            const int rc = scan[n];
  326|  3.34k|            const int rcx = rc & (h - 1);
  327|  3.34k|            max_col = imax(max_col, rcx);
  328|  3.34k|            last_nonzero_col_from_eob[n] = max_col;
  329|  3.34k|        }
  330|    204|    }
  331|     14|}

thread_task.c:dav1d_set_thread_name:
  152|   343k|static inline void dav1d_set_thread_name(const char *const name) {
  153|       |    prctl(PR_SET_NAME, name);
  154|   343k|}

dav1d_task_create_tile_sbrow:
  270|  43.2k|{
  271|  43.2k|    Dav1dTask *tasks = f->task_thread.tile_tasks[0];
  272|  43.2k|    const int uses_2pass = f->c->n_fc > 1;
  273|  43.2k|    const int n_tasks_per_pass = f->frame_hdr->tiling.cols * f->frame_hdr->tiling.rows;
  274|  43.2k|    const int n_tasks = n_tasks_per_pass * (1 + uses_2pass);
  275|  43.2k|    if (pass < 2) {
  ------------------
  |  Branch (275:9): [True: 43.2k, False: 0]
  ------------------
  276|  43.2k|        if (n_tasks > f->task_thread.num_tile_tasks) {
  ------------------
  |  Branch (276:13): [True: 15.4k, False: 27.7k]
  ------------------
  277|  15.4k|            const size_t size = sizeof(Dav1dTask) * n_tasks;
  278|  15.4k|            tasks = dav1d_realloc(ALLOC_COMMON_CTX, f->task_thread.tile_tasks[0], size);
  ------------------
  |  |  133|  15.4k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  279|  15.4k|            if (!tasks) return -1;
  ------------------
  |  Branch (279:17): [True: 0, False: 15.4k]
  ------------------
  280|  15.4k|            memset(tasks, 0, size);
  281|  15.4k|            f->task_thread.tile_tasks[0] = tasks;
  282|  15.4k|            f->task_thread.num_tile_tasks = n_tasks;
  283|  15.4k|        }
  284|  43.2k|        f->task_thread.tile_tasks[1] = tasks + n_tasks_per_pass;
  285|  43.2k|    }
  286|  43.2k|    assert(n_tasks <= f->task_thread.num_tile_tasks);
  ------------------
  |  |  140|  43.2k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 43.2k]
  |  |  |  Branch (140:68): [Folded, False: 43.2k]
  |  |  ------------------
  ------------------
  287|       |
  288|  43.2k|    Dav1dTask *pf_t;
  289|  43.2k|    if (create_filter_sbrow(f, pass, &pf_t))
  ------------------
  |  Branch (289:9): [True: 0, False: 43.2k]
  ------------------
  290|      0|        return -1;
  291|       |
  292|  43.2k|    Dav1dTask *const p1_tasks = f->task_thread.tile_tasks[1];
  293|  43.2k|    Dav1dTask *prev_t = NULL;
  294|  43.2k|    if (pass == 2) {
  ------------------
  |  Branch (294:9): [True: 0, False: 43.2k]
  ------------------
  295|      0|        prev_t = &p1_tasks[n_tasks_per_pass - 1];
  296|       |        // PF task is scheduled after the last sby=0 TILE task
  297|      0|        if (f->frame_hdr->tiling.rows == 1)
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|            prev_t = prev_t->next;
  299|      0|    }
  300|  43.2k|    tasks += (pass & 1) * n_tasks_per_pass;
  301|   112k|    for (int tile_idx = 0; tile_idx < n_tasks_per_pass; tile_idx++) {
  ------------------
  |  Branch (301:28): [True: 68.8k, False: 43.2k]
  ------------------
  302|  68.8k|        Dav1dTileState *const ts = &f->ts[tile_idx];
  303|  68.8k|        Dav1dTask *t = &tasks[tile_idx];
  304|  68.8k|        t->sby = ts->tiling.row_start >> f->sb_shift;
  305|  68.8k|        if (pf_t && t->sby) {
  ------------------
  |  Branch (305:13): [True: 59.4k, False: 9.41k]
  |  Branch (305:21): [True: 6.51k, False: 52.9k]
  ------------------
  306|  6.51k|            prev_t->next = pf_t;
  307|  6.51k|            prev_t = pf_t;
  308|  6.51k|            pf_t = NULL;
  309|  6.51k|        }
  310|  68.8k|        t->recon_progress = 0;
  311|  68.8k|        t->deblock_progress = 0;
  312|  68.8k|        t->deps_skip = 0;
  313|  68.8k|        t->type = pass != 1 ? DAV1D_TASK_TYPE_TILE_RECONSTRUCTION :
  ------------------
  |  Branch (313:19): [True: 68.8k, False: 0]
  ------------------
  314|  68.8k|                              DAV1D_TASK_TYPE_TILE_ENTROPY;
  315|  68.8k|        t->frame_idx = (int)(f - f->c->fc);
  316|  68.8k|        if (prev_t) prev_t->next = t;
  ------------------
  |  Branch (316:13): [True: 25.6k, False: 43.2k]
  ------------------
  317|  68.8k|        prev_t = t;
  318|  68.8k|    }
  319|  43.2k|    if (pf_t) {
  ------------------
  |  Branch (319:9): [True: 36.6k, False: 6.51k]
  ------------------
  320|  36.6k|        prev_t->next = pf_t;
  321|  36.6k|        prev_t = pf_t;
  322|  36.6k|    }
  323|  43.2k|    prev_t->next = NULL;
  324|       |
  325|  43.2k|    atomic_store(&f->task_thread.done[pass & 1], 0);
  326|       |
  327|       |    // XXX in theory this could be done locklessly, at this point they are no
  328|       |    // tasks in the frameQ, so no other runner should be using this lock, but
  329|       |    // we must add both passes at once
  330|  43.2k|    if (!(pass & 1)) {
  ------------------
  |  Branch (330:9): [True: 43.2k, False: 0]
  ------------------
  331|  43.2k|        pthread_mutex_lock(&f->task_thread.pending_tasks.lock);
  332|  43.2k|        assert(f->task_thread.pending_tasks.head == NULL);
  ------------------
  |  |  140|  43.2k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 43.2k]
  |  |  |  Branch (140:68): [Folded, False: 43.2k]
  |  |  ------------------
  ------------------
  333|  43.2k|        f->task_thread.pending_tasks.head = f->task_thread.tile_tasks[pass == 2];
  334|  43.2k|        f->task_thread.pending_tasks.tail = prev_t;
  335|  43.2k|        atomic_store(&f->task_thread.pending_tasks.merge, 1);
  336|  43.2k|        atomic_store(&f->task_thread.init_done, 1);
  337|  43.2k|        pthread_mutex_unlock(&f->task_thread.pending_tasks.lock);
  338|  43.2k|    }
  339|  43.2k|    return 0;
  340|  43.2k|}
dav1d_worker_task:
  556|   343k|void *dav1d_worker_task(void *data) {
  557|   343k|    Dav1dTaskContext *const tc = data;
  558|   343k|    const Dav1dContext *const c = tc->c;
  559|   343k|    struct TaskThreadData *const ttd = tc->task_thread.ttd;
  560|       |
  561|   343k|    dav1d_set_thread_name("dav1d-worker");
  562|       |
  563|   343k|    pthread_mutex_lock(&ttd->lock);
  564|  1.06M|    for (;;) {
  565|  1.06M|        if (tc->task_thread.die) break;
  ------------------
  |  Branch (565:13): [True: 344k, False: 725k]
  ------------------
  566|   725k|        if (atomic_load(c->flush)) goto park;
  ------------------
  |  Branch (566:13): [True: 4.39k, False: 720k]
  ------------------
  567|       |
  568|   720k|        merge_pending(c);
  569|   720k|        if (ttd->delayed_fg.exec) { // run delayed film grain first
  ------------------
  |  Branch (569:13): [True: 0, False: 720k]
  ------------------
  570|      0|            delayed_fg_task(c, ttd);
  571|      0|            continue;
  572|      0|        }
  573|   720k|        Dav1dFrameContext *f;
  574|   720k|        Dav1dTask *t, *prev_t = NULL;
  575|   720k|        if (c->n_fc > 1) { // run init tasks second
  ------------------
  |  Branch (575:13): [True: 0, False: 720k]
  ------------------
  576|      0|            for (unsigned i = 0; i < c->n_fc; i++) {
  ------------------
  |  Branch (576:34): [True: 0, False: 0]
  ------------------
  577|      0|                const unsigned first = atomic_load(&ttd->first);
  578|      0|                f = &c->fc[(first + i) % c->n_fc];
  579|      0|                if (atomic_load(&f->task_thread.init_done)) continue;
  ------------------
  |  Branch (579:21): [True: 0, False: 0]
  ------------------
  580|      0|                t = f->task_thread.task_head;
  581|      0|                if (!t) continue;
  ------------------
  |  Branch (581:21): [True: 0, False: 0]
  ------------------
  582|      0|                if (t->type == DAV1D_TASK_TYPE_INIT) goto found;
  ------------------
  |  Branch (582:21): [True: 0, False: 0]
  ------------------
  583|      0|                if (t->type == DAV1D_TASK_TYPE_INIT_CDF) {
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|       |                    // XXX This can be a simple else, if adding tasks of both
  585|       |                    // passes at once (in dav1d_task_create_tile_sbrow).
  586|       |                    // Adding the tasks to the pending Q can result in a
  587|       |                    // thread merging them before setting init_done.
  588|       |                    // We will need to set init_done before adding to the
  589|       |                    // pending Q, so maybe return the tasks, set init_done,
  590|       |                    // and add to pending Q only then.
  591|      0|                    const int p1 = f->in_cdf.progress ?
  ------------------
  |  Branch (591:36): [True: 0, False: 0]
  ------------------
  592|      0|                        atomic_load(f->in_cdf.progress) : 1;
  593|      0|                    if (p1) {
  ------------------
  |  Branch (593:25): [True: 0, False: 0]
  ------------------
  594|      0|                        atomic_fetch_or(&f->task_thread.error, p1 == TILE_ERROR);
  595|      0|                        goto found;
  596|      0|                    }
  597|      0|                }
  598|      0|            }
  599|      0|        }
  600|   802k|        while (ttd->cur < c->n_fc) { // run decoding tasks last
  ------------------
  |  Branch (600:16): [True: 212k, False: 589k]
  ------------------
  601|   212k|            const unsigned first = atomic_load(&ttd->first);
  602|   212k|            f = &c->fc[(first + ttd->cur) % c->n_fc];
  603|   212k|            merge_pending_frame(f);
  604|   212k|            prev_t = f->task_thread.task_cur_prev;
  605|   212k|            t = prev_t ? prev_t->next : f->task_thread.task_head;
  ------------------
  |  Branch (605:17): [True: 11.2k, False: 201k]
  ------------------
  606|   276k|            while (t) {
  ------------------
  |  Branch (606:20): [True: 195k, False: 81.5k]
  ------------------
  607|   195k|                if (t->type == DAV1D_TASK_TYPE_INIT_CDF) goto next;
  ------------------
  |  Branch (607:21): [True: 0, False: 195k]
  ------------------
  608|   195k|                else if (t->type == DAV1D_TASK_TYPE_TILE_ENTROPY ||
  ------------------
  |  Branch (608:26): [True: 0, False: 195k]
  ------------------
  609|   195k|                         t->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION)
  ------------------
  |  Branch (609:26): [True: 73.9k, False: 121k]
  ------------------
  610|  73.9k|                {
  611|       |                    // if not bottom sbrow of tile, this task will be re-added
  612|       |                    // after it's finished
  613|  73.9k|                    if (!check_tile(t, f, c->n_fc > 1))
  ------------------
  |  Branch (613:25): [True: 73.9k, False: 0]
  ------------------
  614|  73.9k|                        goto found;
  615|   121k|                } else if (t->recon_progress) {
  ------------------
  |  Branch (615:28): [True: 120k, False: 713]
  ------------------
  616|   120k|                    const int p = t->type == DAV1D_TASK_TYPE_ENTROPY_PROGRESS;
  617|   120k|                    int error = atomic_load(&f->task_thread.error);
  618|   120k|                    assert(!atomic_load(&f->task_thread.done[p]) || error);
  ------------------
  |  |  140|   120k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 120k, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 120k]
  |  |  ------------------
  ------------------
  619|   120k|                    const int tile_row_base = f->frame_hdr->tiling.cols *
  620|   120k|                                              f->frame_thread.next_tile_row[p];
  621|   120k|                    if (p) {
  ------------------
  |  Branch (621:25): [True: 0, False: 120k]
  ------------------
  622|      0|                        atomic_int *const prog = &f->frame_thread.entropy_progress;
  623|      0|                        const int p1 = atomic_load(prog);
  624|      0|                        if (p1 < t->sby) goto next;
  ------------------
  |  Branch (624:29): [True: 0, False: 0]
  ------------------
  625|      0|                        atomic_fetch_or(&f->task_thread.error, p1 == TILE_ERROR);
  626|      0|                    }
  627|   207k|                    for (int tc = 0; tc < f->frame_hdr->tiling.cols; tc++) {
  ------------------
  |  Branch (627:38): [True: 150k, False: 56.8k]
  ------------------
  628|   150k|                        Dav1dTileState *const ts = &f->ts[tile_row_base + tc];
  629|   150k|                        const int p2 = atomic_load(&ts->progress[p]);
  630|   150k|                        if (p2 < t->recon_progress) goto next;
  ------------------
  |  Branch (630:29): [True: 63.9k, False: 86.4k]
  ------------------
  631|   150k|                        atomic_fetch_or(&f->task_thread.error, p2 == TILE_ERROR);
  632|  86.4k|                    }
  633|  56.8k|                    if (t->sby + 1 < f->sbh) {
  ------------------
  |  Branch (633:25): [True: 13.6k, False: 43.2k]
  ------------------
  634|       |                        // add sby+1 to list to replace this one
  635|  13.6k|                        Dav1dTask *next_t = &t[1];
  636|  13.6k|                        *next_t = *t;
  637|  13.6k|                        next_t->sby++;
  638|  13.6k|                        const int ntr = f->frame_thread.next_tile_row[p] + 1;
  639|  13.6k|                        const int start = f->frame_hdr->tiling.row_start_sb[ntr];
  640|  13.6k|                        if (next_t->sby == start)
  ------------------
  |  Branch (640:29): [True: 10.2k, False: 3.40k]
  ------------------
  641|  10.2k|                            f->frame_thread.next_tile_row[p] = ntr;
  642|  13.6k|                        next_t->recon_progress = next_t->sby + 1;
  643|  13.6k|                        insert_task(f, next_t, 0);
  644|  13.6k|                    }
  645|  56.8k|                    goto found;
  646|   120k|                } else if (t->type == DAV1D_TASK_TYPE_CDEF) {
  ------------------
  |  Branch (646:28): [True: 244, False: 469]
  ------------------
  647|    244|                    atomic_uint *prog = f->frame_thread.copy_lpf_progress;
  648|    244|                    const int p1 = atomic_load(&prog[(t->sby - 1) >> 5]);
  649|    244|                    if (p1 & (1U << ((t->sby - 1) & 31)))
  ------------------
  |  Branch (649:25): [True: 119, False: 125]
  ------------------
  650|    119|                        goto found;
  651|    469|                } else {
  652|    469|                    assert(t->deblock_progress);
  ------------------
  |  |  140|    469|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 469]
  |  |  |  Branch (140:68): [Folded, False: 469]
  |  |  ------------------
  ------------------
  653|    469|                    const int p1 = atomic_load(&f->frame_thread.deblock_progress);
  654|    469|                    if (p1 >= t->deblock_progress) {
  ------------------
  |  Branch (654:25): [True: 228, False: 241]
  ------------------
  655|    228|                        atomic_fetch_or(&f->task_thread.error, p1 == TILE_ERROR);
  656|    228|                        goto found;
  657|    228|                    }
  658|    469|                }
  659|  64.3k|            next:
  660|  64.3k|                prev_t = t;
  661|  64.3k|                t = t->next;
  662|  64.3k|                f->task_thread.task_cur_prev = prev_t;
  663|  64.3k|            }
  664|  81.5k|            ttd->cur++;
  665|  81.5k|        }
  666|   589k|        if (reset_task_cur(c, ttd, UINT_MAX)) continue;
  ------------------
  |  Branch (666:13): [True: 1.47k, False: 588k]
  ------------------
  667|   588k|        if (merge_pending(c)) continue;
  ------------------
  |  Branch (667:13): [True: 64, False: 587k]
  ------------------
  668|   592k|    park:
  669|   592k|        tc->task_thread.flushed = 1;
  670|   592k|        pthread_cond_signal(&tc->task_thread.td.cond);
  671|       |        // we want to be woken up next time progress is signaled
  672|   592k|        atomic_store(&ttd->cond_signaled, 0);
  673|   592k|        pthread_cond_wait(&ttd->cond, &ttd->lock);
  674|   592k|        tc->task_thread.flushed = 0;
  675|   592k|        reset_task_cur(c, ttd, UINT_MAX);
  676|   592k|        continue;
  677|       |
  678|   131k|    found:
  679|       |        // remove t from list
  680|   131k|        if (prev_t) prev_t->next = t->next;
  ------------------
  |  Branch (680:13): [True: 15.7k, False: 115k]
  ------------------
  681|   115k|        else f->task_thread.task_head = t->next;
  682|   131k|        if (!t->next) f->task_thread.task_tail = prev_t;
  ------------------
  |  Branch (682:13): [True: 50.6k, False: 80.4k]
  ------------------
  683|   131k|        if (t->type > DAV1D_TASK_TYPE_INIT_CDF && !f->task_thread.task_head)
  ------------------
  |  Branch (683:13): [True: 131k, False: 0]
  |  Branch (683:51): [True: 43.4k, False: 87.6k]
  ------------------
  684|  43.4k|            ttd->cur++;
  685|   131k|        t->next = NULL;
  686|       |        // we don't need to check cond_signaled here, since we found a task
  687|       |        // after the last signal so we want to re-signal the next waiting thread
  688|       |        // and again won't need to signal after that
  689|   131k|        atomic_store(&ttd->cond_signaled, 1);
  690|   131k|        pthread_cond_signal(&ttd->cond);
  691|   131k|        pthread_mutex_unlock(&ttd->lock);
  692|   131k|    found_unlocked:;
  693|   131k|        const int flush = atomic_load(c->flush);
  694|   131k|        int error = atomic_fetch_or(&f->task_thread.error, flush) | flush;
  695|       |
  696|       |        // run it
  697|   131k|        tc->f = f;
  698|   131k|        int sby = t->sby;
  699|   131k|        switch (t->type) {
  700|      0|        case DAV1D_TASK_TYPE_INIT: {
  ------------------
  |  Branch (700:9): [True: 0, False: 131k]
  ------------------
  701|      0|            assert(c->n_fc > 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  702|      0|            int res = dav1d_decode_frame_init(f);
  703|      0|            int p1 = f->in_cdf.progress ? atomic_load(f->in_cdf.progress) : 1;
  ------------------
  |  Branch (703:22): [True: 0, False: 0]
  ------------------
  704|      0|            if (res || p1 == TILE_ERROR) {
  ------------------
  |  |   36|      0|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (704:17): [True: 0, False: 0]
  |  Branch (704:24): [True: 0, False: 0]
  ------------------
  705|      0|                pthread_mutex_lock(&ttd->lock);
  706|      0|                abort_frame(f, res ? res : DAV1D_ERR(EINVAL));
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (706:32): [True: 0, False: 0]
  ------------------
  707|      0|                reset_task_cur(c, ttd, t->frame_idx);
  708|      0|            } else {
  709|      0|                t->type = DAV1D_TASK_TYPE_INIT_CDF;
  710|      0|                if (p1) goto found_unlocked;
  ------------------
  |  Branch (710:21): [True: 0, False: 0]
  ------------------
  711|      0|                add_pending(f, t);
  712|      0|                pthread_mutex_lock(&ttd->lock);
  713|      0|            }
  714|      0|            continue;
  715|      0|        }
  716|      0|        case DAV1D_TASK_TYPE_INIT_CDF: {
  ------------------
  |  Branch (716:9): [True: 0, False: 131k]
  ------------------
  717|      0|            assert(c->n_fc > 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  718|      0|            int res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  719|      0|            if (!atomic_load(&f->task_thread.error))
  ------------------
  |  Branch (719:17): [True: 0, False: 0]
  ------------------
  720|      0|                res = dav1d_decode_frame_init_cdf(f);
  721|      0|            if (f->frame_hdr->refresh_context && !f->task_thread.update_set)
  ------------------
  |  Branch (721:17): [True: 0, False: 0]
  |  Branch (721:50): [True: 0, False: 0]
  ------------------
  722|      0|                atomic_store(f->out_cdf.progress, res < 0 ? TILE_ERROR : 1);
  ------------------
  |  Branch (722:17): [True: 0, False: 0]
  ------------------
  723|      0|            for (int p = 1; p <= 2 && !res; p++)
  ------------------
  |  Branch (723:29): [True: 0, False: 0]
  |  Branch (723:39): [True: 0, False: 0]
  ------------------
  724|      0|                res = dav1d_task_create_tile_sbrow(f, p, 0);
  725|      0|            pthread_mutex_lock(&ttd->lock);
  726|      0|            if (res) {
  ------------------
  |  Branch (726:17): [True: 0, False: 0]
  ------------------
  727|      0|                abort_frame(f, DAV1D_ERR(ENOMEM));
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  728|      0|                reset_task_cur(c, ttd, t->frame_idx);
  729|      0|                atomic_store(&f->task_thread.init_done, 1);
  730|      0|            }
  731|      0|            continue;
  732|      0|        }
  733|      0|        case DAV1D_TASK_TYPE_TILE_ENTROPY:
  ------------------
  |  Branch (733:9): [True: 0, False: 131k]
  ------------------
  734|  73.9k|        case DAV1D_TASK_TYPE_TILE_RECONSTRUCTION: {
  ------------------
  |  Branch (734:9): [True: 73.9k, False: 57.1k]
  ------------------
  735|  73.9k|            const int p = t->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  736|  73.9k|            const int tile_idx = (int)(t - f->task_thread.tile_tasks[p]);
  737|  73.9k|            Dav1dTileState *const ts = &f->ts[tile_idx];
  738|       |
  739|  73.9k|            tc->ts = ts;
  740|  73.9k|            tc->by = sby << f->sb_shift;
  741|  73.9k|            const int uses_2pass = c->n_fc > 1;
  742|  73.9k|            tc->frame_thread.pass = !uses_2pass ? 0 :
  ------------------
  |  Branch (742:37): [True: 73.9k, False: 18.4E]
  ------------------
  743|  18.4E|                1 + (t->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION);
  744|  73.9k|            if (!error) error = dav1d_decode_tile_sbrow(tc);
  ------------------
  |  Branch (744:17): [True: 73.9k, False: 0]
  ------------------
  745|  73.9k|            const int progress = error ? TILE_ERROR : 1 + sby;
  ------------------
  |  |   36|      0|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (745:34): [True: 0, False: 73.9k]
  ------------------
  746|       |
  747|       |            // signal progress
  748|  73.9k|            atomic_fetch_or(&f->task_thread.error, error);
  749|  73.9k|            if (((sby + 1) << f->sb_shift) < ts->tiling.row_end) {
  ------------------
  |  Branch (749:17): [True: 5.10k, False: 68.8k]
  ------------------
  750|  5.10k|                t->sby++;
  751|  5.10k|                t->deps_skip = 0;
  752|  5.10k|                if (!check_tile(t, f, uses_2pass)) {
  ------------------
  |  Branch (752:21): [True: 0, False: 5.10k]
  ------------------
  753|      0|                    atomic_store(&ts->progress[p], progress);
  754|      0|                    reset_task_cur_async(ttd, t->frame_idx, c->n_fc);
  755|      0|                    if (!atomic_fetch_or(&ttd->cond_signaled, 1))
  ------------------
  |  Branch (755:25): [True: 0, False: 0]
  ------------------
  756|      0|                        pthread_cond_signal(&ttd->cond);
  757|      0|                    goto found_unlocked;
  758|      0|                }
  759|  5.10k|                atomic_store(&ts->progress[p], progress);
  760|  5.10k|                add_pending(f, t);
  761|  5.10k|                pthread_mutex_lock(&ttd->lock);
  762|  68.8k|            } else {
  763|  68.8k|                pthread_mutex_lock(&ttd->lock);
  764|  68.8k|                atomic_store(&ts->progress[p], progress);
  765|  68.8k|                reset_task_cur(c, ttd, t->frame_idx);
  766|  68.8k|                error = atomic_load(&f->task_thread.error);
  767|  68.8k|                if (f->frame_hdr->refresh_context &&
  ------------------
  |  Branch (767:21): [True: 68.8k, False: 18.4E]
  ------------------
  768|  68.8k|                    tc->frame_thread.pass <= 1 && f->task_thread.update_set &&
  ------------------
  |  Branch (768:21): [True: 68.8k, False: 0]
  |  Branch (768:51): [True: 68.8k, False: 0]
  ------------------
  769|  68.8k|                    f->frame_hdr->tiling.update == tile_idx)
  ------------------
  |  Branch (769:21): [True: 43.2k, False: 25.6k]
  ------------------
  770|  43.2k|                {
  771|  43.2k|                    if (!error)
  ------------------
  |  Branch (771:25): [True: 43.2k, False: 0]
  ------------------
  772|  43.2k|                        dav1d_cdf_thread_update(f->frame_hdr, f->out_cdf.data.cdf,
  773|  43.2k|                                                &f->ts[f->frame_hdr->tiling.update].cdf);
  774|  43.2k|                    if (c->n_fc > 1)
  ------------------
  |  Branch (774:25): [True: 0, False: 43.2k]
  ------------------
  775|  43.2k|                        atomic_store(f->out_cdf.progress, error ? TILE_ERROR : 1);
  ------------------
  |  Branch (775:25): [True: 0, False: 0]
  ------------------
  776|  43.2k|                }
  777|  68.8k|                if (atomic_fetch_sub(&f->task_thread.task_counter, 1) - 1 == 0 &&
  ------------------
  |  Branch (777:21): [True: 0, False: 68.8k]
  ------------------
  778|  68.8k|                    atomic_load(&f->task_thread.done[0]) &&
  ------------------
  |  Branch (778:21): [True: 0, False: 0]
  ------------------
  779|      0|                    (!uses_2pass || atomic_load(&f->task_thread.done[1])))
  ------------------
  |  Branch (779:22): [True: 0, False: 0]
  |  Branch (779:37): [True: 0, False: 0]
  ------------------
  780|      0|                {
  781|      0|                    error = atomic_load(&f->task_thread.error);
  782|      0|                    dav1d_decode_frame_exit(f, error == 1 ? DAV1D_ERR(EINVAL) :
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (782:48): [True: 0, False: 0]
  ------------------
  783|      0|                                            error ? DAV1D_ERR(ENOMEM) : 0);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (783:45): [True: 0, False: 0]
  ------------------
  784|      0|                    f->n_tile_data = 0;
  785|      0|                    pthread_cond_signal(&f->task_thread.cond);
  786|      0|                }
  787|  68.8k|                assert(atomic_load(&f->task_thread.task_counter) >= 0);
  ------------------
  |  |  140|  68.8k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 68.8k]
  |  |  |  Branch (140:68): [Folded, False: 68.8k]
  |  |  ------------------
  ------------------
  788|  68.8k|                if (!atomic_fetch_or(&ttd->cond_signaled, 1))
  ------------------
  |  Branch (788:21): [True: 52.1k, False: 16.6k]
  ------------------
  789|  52.1k|                    pthread_cond_signal(&ttd->cond);
  790|  68.8k|            }
  791|  73.9k|            continue;
  792|  73.9k|        }
  793|  73.9k|        case DAV1D_TASK_TYPE_DEBLOCK_COLS:
  ------------------
  |  Branch (793:9): [True: 21.8k, False: 109k]
  ------------------
  794|  21.8k|            if (!atomic_load(&f->task_thread.error))
  ------------------
  |  Branch (794:17): [True: 21.8k, False: 0]
  ------------------
  795|  21.8k|                f->bd_fn.filter_sbrow_deblock_cols(f, sby);
  796|  21.8k|            if (ensure_progress(ttd, f, t, DAV1D_TASK_TYPE_DEBLOCK_ROWS,
  ------------------
  |  Branch (796:17): [True: 228, False: 21.5k]
  ------------------
  797|  21.8k|                                &f->frame_thread.deblock_progress,
  798|  21.8k|                                &t->deblock_progress)) continue;
  799|       |            // fall-through
  800|  56.8k|        case DAV1D_TASK_TYPE_DEBLOCK_ROWS:
  ------------------
  |  Branch (800:9): [True: 35.2k, False: 95.8k]
  ------------------
  801|  56.8k|            if (!atomic_load(&f->task_thread.error))
  ------------------
  |  Branch (801:17): [True: 56.8k, False: 0]
  ------------------
  802|  56.8k|                f->bd_fn.filter_sbrow_deblock_rows(f, sby);
  803|       |            // signal deblock progress
  804|  56.8k|            if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (804:17): [True: 21.8k, False: 35.0k]
  ------------------
  805|  35.0k|                f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (805:17): [True: 18.4E, False: 35.0k]
  ------------------
  806|  21.8k|            {
  807|  21.8k|                error = atomic_load(&f->task_thread.error);
  808|  21.8k|                atomic_store(&f->frame_thread.deblock_progress,
  ------------------
  |  Branch (808:17): [True: 0, False: 21.8k]
  ------------------
  809|  21.8k|                             error ? TILE_ERROR : sby + 1);
  810|  21.8k|                reset_task_cur_async(ttd, t->frame_idx, c->n_fc);
  811|  21.8k|                if (!atomic_fetch_or(&ttd->cond_signaled, 1))
  ------------------
  |  Branch (811:21): [True: 7.92k, False: 13.8k]
  ------------------
  812|  7.92k|                    pthread_cond_signal(&ttd->cond);
  813|  35.0k|            } else if (f->seq_hdr->cdef || f->lf.restore_planes) {
  ------------------
  |  Branch (813:24): [True: 35.0k, False: 0]
  |  Branch (813:44): [True: 0, False: 0]
  ------------------
  814|  35.0k|                atomic_fetch_or(&f->frame_thread.copy_lpf_progress[sby >> 5],
  815|  35.0k|                                1U << (sby & 31));
  816|       |                // CDEF needs the top buffer to be saved by lr_copy_lpf of the
  817|       |                // previous sbrow
  818|  35.0k|                if (sby) {
  ------------------
  |  Branch (818:21): [True: 7.61k, False: 27.4k]
  ------------------
  819|  7.61k|                    int prog = atomic_load(&f->frame_thread.copy_lpf_progress[(sby - 1) >> 5]);
  820|  7.61k|                    if (~prog & (1U << ((sby - 1) & 31))) {
  ------------------
  |  Branch (820:25): [True: 119, False: 7.49k]
  ------------------
  821|    119|                        t->type = DAV1D_TASK_TYPE_CDEF;
  822|    119|                        t->recon_progress = t->deblock_progress = 0;
  823|    119|                        add_pending(f, t);
  824|    119|                        pthread_mutex_lock(&ttd->lock);
  825|    119|                        continue;
  826|    119|                    }
  827|  7.61k|                }
  828|  35.0k|            }
  829|       |            // fall-through
  830|  56.8k|        case DAV1D_TASK_TYPE_CDEF:
  ------------------
  |  Branch (830:9): [True: 119, False: 130k]
  ------------------
  831|  56.8k|            if (f->seq_hdr->cdef) {
  ------------------
  |  Branch (831:17): [True: 56.8k, False: 1]
  ------------------
  832|  56.8k|                if (!atomic_load(&f->task_thread.error))
  ------------------
  |  Branch (832:21): [True: 56.8k, False: 0]
  ------------------
  833|  56.8k|                    f->bd_fn.filter_sbrow_cdef(tc, sby);
  834|  56.8k|                reset_task_cur_async(ttd, t->frame_idx, c->n_fc);
  835|  56.8k|                if (!atomic_fetch_or(&ttd->cond_signaled, 1))
  ------------------
  |  Branch (835:21): [True: 22.8k, False: 33.9k]
  ------------------
  836|  22.8k|                    pthread_cond_signal(&ttd->cond);
  837|  56.8k|            }
  838|       |            // fall-through
  839|  56.8k|        case DAV1D_TASK_TYPE_SUPER_RESOLUTION:
  ------------------
  |  Branch (839:9): [True: 0, False: 131k]
  ------------------
  840|  56.8k|            if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (840:17): [True: 0, False: 56.8k]
  ------------------
  841|      0|                if (!atomic_load(&f->task_thread.error))
  ------------------
  |  Branch (841:21): [True: 0, False: 0]
  ------------------
  842|      0|                    f->bd_fn.filter_sbrow_resize(f, sby);
  843|       |            // fall-through
  844|  56.8k|        case DAV1D_TASK_TYPE_LOOP_RESTORATION:
  ------------------
  |  Branch (844:9): [True: 0, False: 131k]
  ------------------
  845|  56.8k|            if (!atomic_load(&f->task_thread.error) && f->lf.restore_planes)
  ------------------
  |  Branch (845:17): [True: 56.8k, False: 5]
  |  Branch (845:56): [True: 822, False: 56.0k]
  ------------------
  846|    822|                f->bd_fn.filter_sbrow_lr(f, sby);
  847|       |            // fall-through
  848|  56.8k|        case DAV1D_TASK_TYPE_RECONSTRUCTION_PROGRESS:
  ------------------
  |  Branch (848:9): [True: 0, False: 131k]
  ------------------
  849|       |            // dummy to cover for no post-filters
  850|  56.8k|        case DAV1D_TASK_TYPE_ENTROPY_PROGRESS:
  ------------------
  |  Branch (850:9): [True: 0, False: 131k]
  ------------------
  851|       |            // dummy to convert tile progress to frame
  852|  56.8k|            break;
  853|      0|        default: abort();
  ------------------
  |  Branch (853:9): [True: 0, False: 131k]
  ------------------
  854|   131k|        }
  855|       |        // if task completed [typically LR], signal picture progress as per below
  856|  56.8k|        const int uses_2pass = c->n_fc > 1;
  857|  56.8k|        const int sbh = f->sbh;
  858|  56.8k|        const int sbsz = f->sb_step * 4;
  859|  56.8k|        if (t->type == DAV1D_TASK_TYPE_ENTROPY_PROGRESS) {
  ------------------
  |  Branch (859:13): [True: 0, False: 56.8k]
  ------------------
  860|      0|            error = atomic_load(&f->task_thread.error);
  861|      0|            const unsigned y = sby + 1 == sbh ? UINT_MAX : (unsigned)(sby + 1) * sbsz;
  ------------------
  |  Branch (861:32): [True: 0, False: 0]
  ------------------
  862|      0|            assert(c->n_fc > 1);
  ------------------
  |  |  140|      0|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 0]
  |  |  ------------------
  ------------------
  863|      0|            if (f->sr_cur.p.data[0] /* upon flush, this can be free'ed already */)
  ------------------
  |  Branch (863:17): [True: 0, False: 0]
  ------------------
  864|      0|                atomic_store(&f->sr_cur.progress[0], error ? FRAME_ERROR : y);
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|            atomic_store(&f->frame_thread.entropy_progress,
  ------------------
  |  Branch (865:13): [True: 0, False: 0]
  ------------------
  866|      0|                         error ? TILE_ERROR : sby + 1);
  867|      0|            if (sby + 1 == sbh)
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|                atomic_store(&f->task_thread.done[1], 1);
  869|      0|            pthread_mutex_lock(&ttd->lock);
  870|      0|            const int num_tasks = atomic_fetch_sub(&f->task_thread.task_counter, 1) - 1;
  871|      0|            if (sby + 1 < sbh && num_tasks) {
  ------------------
  |  Branch (871:17): [True: 0, False: 0]
  |  Branch (871:34): [True: 0, False: 0]
  ------------------
  872|      0|                reset_task_cur(c, ttd, t->frame_idx);
  873|      0|                continue;
  874|      0|            }
  875|      0|            if (!num_tasks && atomic_load(&f->task_thread.done[0]) &&
  ------------------
  |  Branch (875:17): [True: 0, False: 0]
  |  Branch (875:31): [True: 0, False: 0]
  ------------------
  876|      0|                atomic_load(&f->task_thread.done[1]))
  ------------------
  |  Branch (876:17): [True: 0, False: 0]
  ------------------
  877|      0|            {
  878|      0|                error = atomic_load(&f->task_thread.error);
  879|      0|                dav1d_decode_frame_exit(f, error == 1 ? DAV1D_ERR(EINVAL) :
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (879:44): [True: 0, False: 0]
  ------------------
  880|      0|                                        error ? DAV1D_ERR(ENOMEM) : 0);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (880:41): [True: 0, False: 0]
  ------------------
  881|      0|                f->n_tile_data = 0;
  882|      0|                pthread_cond_signal(&f->task_thread.cond);
  883|      0|            }
  884|      0|            reset_task_cur(c, ttd, t->frame_idx);
  885|      0|            continue;
  886|      0|        }
  887|       |    // t->type != DAV1D_TASK_TYPE_ENTROPY_PROGRESS
  888|  56.8k|        atomic_fetch_or(&f->frame_thread.frame_progress[sby >> 5],
  889|  56.8k|                        1U << (sby & 31));
  890|  56.8k|        pthread_mutex_lock(&f->task_thread.lock);
  891|  56.8k|        sby = get_frame_progress(c, f);
  892|  56.8k|        error = atomic_load(&f->task_thread.error);
  893|  56.8k|        const unsigned y = sby + 1 == sbh ? UINT_MAX : (unsigned)(sby + 1) * sbsz;
  ------------------
  |  Branch (893:28): [True: 43.2k, False: 13.6k]
  ------------------
  894|  56.8k|        if (c->n_fc > 1 && f->sr_cur.p.data[0] /* upon flush, this can be free'ed already */)
  ------------------
  |  Branch (894:13): [True: 0, False: 56.8k]
  |  Branch (894:28): [True: 0, False: 0]
  ------------------
  895|  56.8k|            atomic_store(&f->sr_cur.progress[1], error ? FRAME_ERROR : y);
  ------------------
  |  Branch (895:13): [True: 0, False: 0]
  ------------------
  896|  56.8k|        pthread_mutex_unlock(&f->task_thread.lock);
  897|  56.8k|        if (sby + 1 == sbh)
  ------------------
  |  Branch (897:13): [True: 43.2k, False: 13.6k]
  ------------------
  898|  56.8k|            atomic_store(&f->task_thread.done[0], 1);
  899|  56.8k|        pthread_mutex_lock(&ttd->lock);
  900|  56.8k|        const int num_tasks = atomic_fetch_sub(&f->task_thread.task_counter, 1) - 1;
  901|  56.8k|        if (sby + 1 < sbh && num_tasks) {
  ------------------
  |  Branch (901:13): [True: 13.6k, False: 43.2k]
  |  Branch (901:30): [True: 12.6k, False: 995]
  ------------------
  902|  12.6k|            reset_task_cur(c, ttd, t->frame_idx);
  903|  12.6k|            continue;
  904|  12.6k|        }
  905|  44.1k|        if (!num_tasks && atomic_load(&f->task_thread.done[0]) &&
  ------------------
  |  Branch (905:13): [True: 43.2k, False: 999]
  |  Branch (905:27): [True: 43.2k, False: 0]
  ------------------
  906|  43.2k|            (!uses_2pass || atomic_load(&f->task_thread.done[1])))
  ------------------
  |  Branch (906:14): [True: 43.2k, False: 0]
  |  Branch (906:29): [True: 0, False: 0]
  ------------------
  907|  43.2k|        {
  908|  43.2k|            error = atomic_load(&f->task_thread.error);
  909|  43.2k|            dav1d_decode_frame_exit(f, error == 1 ? DAV1D_ERR(EINVAL) :
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (909:40): [True: 0, False: 43.2k]
  ------------------
  910|  43.2k|                                    error ? DAV1D_ERR(ENOMEM) : 0);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (910:37): [True: 0, False: 43.2k]
  ------------------
  911|  43.2k|            f->n_tile_data = 0;
  912|  43.2k|            pthread_cond_signal(&f->task_thread.cond);
  913|  43.2k|        }
  914|  44.1k|        reset_task_cur(c, ttd, t->frame_idx);
  915|  44.1k|    }
  916|   343k|    pthread_mutex_unlock(&ttd->lock);
  917|       |
  918|       |    return NULL;
  919|   343k|}
thread_task.c:create_filter_sbrow:
  215|  43.2k|{
  216|  43.2k|    const int has_deblock = f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (216:29): [True: 15.7k, False: 27.4k]
  ------------------
  217|  27.4k|                            f->frame_hdr->loopfilter.level_y[1];
  ------------------
  |  Branch (217:29): [True: 0, False: 27.4k]
  ------------------
  218|  43.2k|    const int has_cdef = f->seq_hdr->cdef;
  219|  43.2k|    const int has_resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  220|  43.2k|    const int has_lr = f->lf.restore_planes;
  221|       |
  222|  43.2k|    Dav1dTask *tasks = f->task_thread.tasks;
  223|  43.2k|    const int uses_2pass = f->c->n_fc > 1;
  224|  43.2k|    int num_tasks = f->sbh * (1 + uses_2pass);
  225|  43.2k|    if (num_tasks > f->task_thread.num_tasks) {
  ------------------
  |  Branch (225:9): [True: 14.3k, False: 28.8k]
  ------------------
  226|  14.3k|        const size_t size = sizeof(Dav1dTask) * num_tasks;
  227|  14.3k|        tasks = dav1d_realloc(ALLOC_COMMON_CTX, f->task_thread.tasks, size);
  ------------------
  |  |  133|  14.3k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  228|  14.3k|        if (!tasks) return -1;
  ------------------
  |  Branch (228:13): [True: 0, False: 14.3k]
  ------------------
  229|  14.3k|        memset(tasks, 0, size);
  230|  14.3k|        f->task_thread.tasks = tasks;
  231|  14.3k|        f->task_thread.num_tasks = num_tasks;
  232|  14.3k|    }
  233|  43.2k|    tasks += f->sbh * (pass & 1);
  234|       |
  235|  43.2k|    if (pass & 1) {
  ------------------
  |  Branch (235:9): [True: 0, False: 43.2k]
  ------------------
  236|      0|        f->frame_thread.entropy_progress = 0;
  237|  43.2k|    } else {
  238|  43.2k|        const int prog_sz = ((f->sbh + 31) & ~31) >> 5;
  239|  43.2k|        if (prog_sz > f->frame_thread.prog_sz) {
  ------------------
  |  Branch (239:13): [True: 10.8k, False: 32.4k]
  ------------------
  240|  10.8k|            atomic_uint *const prog = dav1d_realloc(ALLOC_COMMON_CTX, f->frame_thread.frame_progress,
  ------------------
  |  |  133|  10.8k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  241|  10.8k|                                                    2 * prog_sz * sizeof(*prog));
  242|  10.8k|            if (!prog) return -1;
  ------------------
  |  Branch (242:17): [True: 0, False: 10.8k]
  ------------------
  243|  10.8k|            f->frame_thread.frame_progress = prog;
  244|  10.8k|            f->frame_thread.copy_lpf_progress = prog + prog_sz;
  245|  10.8k|        }
  246|  43.2k|        f->frame_thread.prog_sz = prog_sz;
  247|  43.2k|        memset(f->frame_thread.frame_progress, 0, prog_sz * sizeof(atomic_uint));
  248|  43.2k|        memset(f->frame_thread.copy_lpf_progress, 0, prog_sz * sizeof(atomic_uint));
  249|  43.2k|        atomic_store(&f->frame_thread.deblock_progress, 0);
  250|  43.2k|    }
  251|  43.2k|    f->frame_thread.next_tile_row[pass & 1] = 0;
  252|       |
  253|  43.2k|    Dav1dTask *t = &tasks[0];
  254|  43.2k|    t->sby = 0;
  255|  43.2k|    t->recon_progress = 1;
  256|  43.2k|    t->deblock_progress = 0;
  257|  43.2k|    t->type = pass == 1 ? DAV1D_TASK_TYPE_ENTROPY_PROGRESS :
  ------------------
  |  Branch (257:15): [True: 0, False: 43.2k]
  ------------------
  258|  43.2k|              has_deblock ? DAV1D_TASK_TYPE_DEBLOCK_COLS :
  ------------------
  |  Branch (258:15): [True: 15.7k, False: 27.4k]
  ------------------
  259|  43.2k|              has_cdef || has_lr /* i.e. LR backup */ ? DAV1D_TASK_TYPE_DEBLOCK_ROWS :
  ------------------
  |  Branch (259:15): [True: 27.4k, False: 0]
  |  Branch (259:27): [True: 0, False: 0]
  ------------------
  260|  27.4k|              has_resize ? DAV1D_TASK_TYPE_SUPER_RESOLUTION :
  ------------------
  |  Branch (260:15): [True: 0, False: 0]
  ------------------
  261|      0|              DAV1D_TASK_TYPE_RECONSTRUCTION_PROGRESS;
  262|  43.2k|    t->frame_idx = (int)(f - f->c->fc);
  263|       |
  264|  43.2k|    *res_t = t;
  265|  43.2k|    return 0;
  266|  43.2k|}
thread_task.c:insert_task:
  172|   131k|{
  173|   131k|    insert_tasks(f, t, t, cond_signal);
  174|   131k|}
thread_task.c:insert_tasks:
  118|   131k|{
  119|       |    // insert task back into task queue
  120|   131k|    Dav1dTask *t_ptr, *prev_t = NULL;
  121|   131k|    for (t_ptr = f->task_thread.task_head;
  122|   300k|         t_ptr; prev_t = t_ptr, t_ptr = t_ptr->next)
  ------------------
  |  Branch (122:10): [True: 170k, False: 129k]
  ------------------
  123|   170k|    {
  124|       |        // entropy coding precedes other steps
  125|   170k|        if (t_ptr->type == DAV1D_TASK_TYPE_TILE_ENTROPY) {
  ------------------
  |  Branch (125:13): [True: 0, False: 170k]
  ------------------
  126|      0|            if (first->type > DAV1D_TASK_TYPE_TILE_ENTROPY) continue;
  ------------------
  |  Branch (126:17): [True: 0, False: 0]
  ------------------
  127|       |            // both are entropy
  128|      0|            if (first->sby > t_ptr->sby) continue;
  ------------------
  |  Branch (128:17): [True: 0, False: 0]
  ------------------
  129|      0|            if (first->sby < t_ptr->sby) {
  ------------------
  |  Branch (129:17): [True: 0, False: 0]
  ------------------
  130|      0|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  131|      0|                return;
  132|      0|            }
  133|       |            // same sby
  134|   170k|        } else {
  135|   170k|            if (first->type == DAV1D_TASK_TYPE_TILE_ENTROPY) {
  ------------------
  |  Branch (135:17): [True: 0, False: 170k]
  ------------------
  136|      0|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  137|      0|                return;
  138|      0|            }
  139|   170k|            if (first->sby > t_ptr->sby) continue;
  ------------------
  |  Branch (139:17): [True: 87.1k, False: 83.4k]
  ------------------
  140|  83.4k|            if (first->sby < t_ptr->sby) {
  ------------------
  |  Branch (140:17): [True: 1.58k, False: 81.8k]
  ------------------
  141|  1.58k|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  142|  1.58k|                return;
  143|  1.58k|            }
  144|       |            // same sby
  145|  81.8k|            if (first->type > t_ptr->type) continue;
  ------------------
  |  Branch (145:17): [True: 58.2k, False: 23.6k]
  ------------------
  146|  23.6k|            if (first->type < t_ptr->type) {
  ------------------
  |  Branch (146:17): [True: 7, False: 23.6k]
  ------------------
  147|      7|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  148|      7|                return;
  149|      7|            }
  150|       |            // same task type
  151|  23.6k|        }
  152|       |
  153|       |        // sort by tile-id
  154|  23.6k|        assert(first->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION ||
  ------------------
  |  |  140|  23.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 23.6k, False: 0]
  |  |  |  Branch (140:30): [True: 0, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
  155|  23.6k|               first->type == DAV1D_TASK_TYPE_TILE_ENTROPY);
  156|  23.6k|        assert(first->type == t_ptr->type);
  ------------------
  |  |  140|  23.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 23.6k]
  |  |  |  Branch (140:68): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
  157|  23.6k|        assert(t_ptr->sby == first->sby);
  ------------------
  |  |  140|  23.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 23.6k]
  |  |  |  Branch (140:68): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
  158|  23.6k|        const int p = first->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  159|  23.6k|        const int t_tile_idx = (int) (first - f->task_thread.tile_tasks[p]);
  160|  23.6k|        const int p_tile_idx = (int) (t_ptr - f->task_thread.tile_tasks[p]);
  161|  23.6k|        assert(t_tile_idx != p_tile_idx);
  ------------------
  |  |  140|  23.6k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 23.6k]
  |  |  |  Branch (140:68): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
  162|  23.6k|        if (t_tile_idx > p_tile_idx) continue;
  ------------------
  |  Branch (162:13): [True: 23.5k, False: 44]
  ------------------
  163|     44|        insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  164|     44|        return;
  165|  23.6k|    }
  166|       |    // append at the end
  167|   129k|    insert_tasks_between(f, first, last, prev_t, NULL, cond_signal);
  168|   129k|}
thread_task.c:insert_tasks_between:
  102|   131k|{
  103|   131k|    struct TaskThreadData *const ttd = f->task_thread.ttd;
  104|   131k|    if (atomic_load(f->c->flush)) return;
  ------------------
  |  Branch (104:9): [True: 0, False: 131k]
  ------------------
  105|   131k|    assert(!a || a->next == b);
  ------------------
  |  |  140|   218k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:30): [True: 43.5k, False: 87.5k]
  |  |  |  Branch (140:30): [True: 87.5k, False: 0]
  |  |  |  Branch (140:68): [Folded, False: 131k]
  |  |  ------------------
  ------------------
  106|   131k|    if (!a) f->task_thread.task_head = first;
  ------------------
  |  Branch (106:9): [True: 43.5k, False: 87.5k]
  ------------------
  107|  87.5k|    else a->next = first;
  108|   131k|    if (!b) f->task_thread.task_tail = last;
  ------------------
  |  Branch (108:9): [True: 129k, False: 1.63k]
  ------------------
  109|   131k|    last->next = b;
  110|   131k|    reset_task_cur(f->c, ttd, first->frame_idx);
  111|   131k|    if (cond_signal && !atomic_fetch_or(&ttd->cond_signaled, 1))
  ------------------
  |  Branch (111:9): [True: 0, False: 131k]
  |  Branch (111:24): [True: 0, False: 0]
  ------------------
  112|      0|        pthread_cond_signal(&ttd->cond);
  113|   131k|}
thread_task.c:merge_pending:
  206|  1.30M|static inline int merge_pending(const Dav1dContext *const c) {
  207|  1.30M|    int res = 0;
  208|  2.61M|    for (unsigned i = 0; i < c->n_fc; i++)
  ------------------
  |  Branch (208:26): [True: 1.30M, False: 1.30M]
  ------------------
  209|  1.30M|        res |= merge_pending_frame(&c->fc[i]);
  210|  1.30M|    return res;
  211|  1.30M|}
thread_task.c:merge_pending_frame:
  188|  1.52M|static inline int merge_pending_frame(Dav1dFrameContext *const f) {
  189|  1.52M|    int const merge = atomic_load(&f->task_thread.pending_tasks.merge);
  190|  1.52M|    if (merge) {
  ------------------
  |  Branch (190:9): [True: 48.5k, False: 1.47M]
  ------------------
  191|  48.5k|        pthread_mutex_lock(&f->task_thread.pending_tasks.lock);
  192|  48.5k|        Dav1dTask *t = f->task_thread.pending_tasks.head;
  193|  48.5k|        f->task_thread.pending_tasks.head = NULL;
  194|  48.5k|        f->task_thread.pending_tasks.tail = NULL;
  195|  48.5k|        atomic_store(&f->task_thread.pending_tasks.merge, 0);
  196|  48.5k|        pthread_mutex_unlock(&f->task_thread.pending_tasks.lock);
  197|   166k|        while (t) {
  ------------------
  |  Branch (197:16): [True: 117k, False: 48.5k]
  ------------------
  198|   117k|            Dav1dTask *const tmp = t->next;
  199|   117k|            insert_task(f, t, 0);
  200|   117k|            t = tmp;
  201|   117k|        }
  202|  48.5k|    }
  203|  1.52M|    return merge;
  204|  1.52M|}
thread_task.c:check_tile:
  395|  79.0k|{
  396|  79.0k|    const int tp = t->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  397|  79.0k|    const int tile_idx = (int)(t - f->task_thread.tile_tasks[tp]);
  398|  79.0k|    Dav1dTileState *const ts = &f->ts[tile_idx];
  399|  79.0k|    const int p1 = atomic_load(&ts->progress[tp]);
  400|  79.0k|    if (p1 < t->sby) return 1;
  ------------------
  |  Branch (400:9): [True: 5.10k, False: 73.9k]
  ------------------
  401|  73.9k|    int error = p1 == TILE_ERROR;
  ------------------
  |  |   36|  73.9k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  402|  73.9k|    error |= atomic_fetch_or(&f->task_thread.error, error);
  403|  73.9k|    if (!error && frame_mt && !tp) {
  ------------------
  |  Branch (403:9): [True: 73.9k, False: 18.4E]
  |  Branch (403:19): [True: 0, False: 73.9k]
  |  Branch (403:31): [True: 0, False: 0]
  ------------------
  404|      0|        const int p2 = atomic_load(&ts->progress[1]);
  405|      0|        if (p2 <= t->sby) return 1;
  ------------------
  |  Branch (405:13): [True: 0, False: 0]
  ------------------
  406|      0|        error = p2 == TILE_ERROR;
  ------------------
  |  |   36|      0|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  407|      0|        error |= atomic_fetch_or(&f->task_thread.error, error);
  408|      0|    }
  409|  73.9k|    if (!error && frame_mt && !IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|      0|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
  |  Branch (409:9): [True: 73.9k, False: 18.4E]
  |  Branch (409:19): [True: 0, False: 73.9k]
  |  Branch (409:31): [True: 0, False: 0]
  ------------------
  410|       |        // check reference state
  411|      0|        const Dav1dThreadPicture *p = &f->sr_cur;
  412|      0|        const int ss_ver = p->p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  413|      0|        const unsigned p_b = (t->sby + 1) << (f->sb_shift + 2);
  414|      0|        const int tile_sby = t->sby - (ts->tiling.row_start >> f->sb_shift);
  415|      0|        const int (*const lowest_px)[2] = ts->lowest_pixel[tile_sby];
  416|      0|        for (int n = t->deps_skip; n < 7; n++, t->deps_skip++) {
  ------------------
  |  Branch (416:36): [True: 0, False: 0]
  ------------------
  417|      0|            unsigned lowest;
  418|      0|            if (tp) {
  ------------------
  |  Branch (418:17): [True: 0, False: 0]
  ------------------
  419|       |                // if temporal mv refs are disabled, we only need this
  420|       |                // for the primary ref; if segmentation is disabled, we
  421|       |                // don't even need that
  422|      0|                lowest = p_b;
  423|      0|            } else {
  424|       |                // +8 is postfilter-induced delay
  425|      0|                const int y = lowest_px[n][0] == INT_MIN ? INT_MIN :
  ------------------
  |  Branch (425:31): [True: 0, False: 0]
  ------------------
  426|      0|                              lowest_px[n][0] + 8;
  427|      0|                const int uv = lowest_px[n][1] == INT_MIN ? INT_MIN :
  ------------------
  |  Branch (427:32): [True: 0, False: 0]
  ------------------
  428|      0|                               lowest_px[n][1] * (1 << ss_ver) + 8;
  429|      0|                const int max = imax(y, uv);
  430|      0|                if (max == INT_MIN) continue;
  ------------------
  |  Branch (430:21): [True: 0, False: 0]
  ------------------
  431|      0|                lowest = iclip(max, 1, f->refp[n].p.p.h);
  432|      0|            }
  433|      0|            const unsigned p3 = atomic_load(&f->refp[n].progress[!tp]);
  434|      0|            if (p3 < lowest) return 1;
  ------------------
  |  Branch (434:17): [True: 0, False: 0]
  ------------------
  435|      0|            atomic_fetch_or(&f->task_thread.error, p3 == FRAME_ERROR);
  436|      0|        }
  437|      0|    }
  438|  73.9k|    return 0;
  439|  73.9k|}
thread_task.c:reset_task_cur:
   50|  1.43M|{
   51|  1.43M|    const unsigned first = atomic_load(&ttd->first);
   52|  1.43M|    unsigned reset_frame_idx = atomic_exchange(&ttd->reset_task_cur, UINT_MAX);
   53|  1.43M|    if (reset_frame_idx < first) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1.43M]
  ------------------
   54|      0|        if (frame_idx == UINT_MAX) return 0;
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|        reset_frame_idx = UINT_MAX;
   56|      0|    }
   57|  1.43M|    if (!ttd->cur && c->fc[first].task_thread.task_cur_prev == NULL)
  ------------------
  |  Branch (57:9): [True: 169k, False: 1.26M]
  |  Branch (57:22): [True: 153k, False: 15.5k]
  ------------------
   58|   153k|        return 0;
   59|  1.28M|    if (reset_frame_idx != UINT_MAX) {
  ------------------
  |  Branch (59:9): [True: 58.1k, False: 1.22M]
  ------------------
   60|  58.1k|        if (frame_idx == UINT_MAX) {
  ------------------
  |  Branch (60:13): [True: 23.1k, False: 35.0k]
  ------------------
   61|  23.1k|            if (reset_frame_idx > first + ttd->cur)
  ------------------
  |  Branch (61:17): [True: 0, False: 23.1k]
  ------------------
   62|      0|                return 0;
   63|  23.1k|            ttd->cur = reset_frame_idx - first;
   64|  23.1k|            goto cur_found;
   65|  23.1k|        }
   66|  1.22M|    } else if (frame_idx == UINT_MAX)
  ------------------
  |  Branch (66:16): [True: 1.10M, False: 119k]
  ------------------
   67|  1.10M|        return 0;
   68|   154k|    if (frame_idx < first) frame_idx += c->n_fc;
  ------------------
  |  Branch (68:9): [True: 0, False: 154k]
  ------------------
   69|   154k|    const unsigned min_frame_idx = umin(reset_frame_idx, frame_idx);
   70|   154k|    const unsigned cur_frame_idx = first + ttd->cur;
   71|   154k|    if (ttd->cur < c->n_fc && cur_frame_idx < min_frame_idx)
  ------------------
  |  Branch (71:9): [True: 4.44k, False: 150k]
  |  Branch (71:31): [True: 0, False: 4.44k]
  ------------------
   72|      0|        return 0;
   73|   203k|    for (ttd->cur = min_frame_idx - first; ttd->cur < c->n_fc; ttd->cur++)
  ------------------
  |  Branch (73:44): [True: 154k, False: 48.3k]
  ------------------
   74|   154k|        if (c->fc[(first + ttd->cur) % c->n_fc].task_thread.task_head)
  ------------------
  |  Branch (74:13): [True: 106k, False: 48.3k]
  ------------------
   75|   106k|            break;
   76|   177k|cur_found:
   77|   307k|    for (unsigned i = ttd->cur; i < c->n_fc; i++)
  ------------------
  |  Branch (77:33): [True: 129k, False: 177k]
  ------------------
   78|   129k|        c->fc[(first + i) % c->n_fc].task_thread.task_cur_prev = NULL;
   79|   177k|    return 1;
   80|   154k|}
thread_task.c:add_pending:
  176|  5.44k|static inline void add_pending(Dav1dFrameContext *const f, Dav1dTask *const t) {
  177|  5.44k|    pthread_mutex_lock(&f->task_thread.pending_tasks.lock);
  178|  5.44k|    t->next = NULL;
  179|  5.44k|    if (!f->task_thread.pending_tasks.head)
  ------------------
  |  Branch (179:9): [True: 5.39k, False: 55]
  ------------------
  180|  5.39k|        f->task_thread.pending_tasks.head = t;
  181|     55|    else
  182|     55|        f->task_thread.pending_tasks.tail->next = t;
  183|  5.44k|    f->task_thread.pending_tasks.tail = t;
  184|       |    atomic_store(&f->task_thread.pending_tasks.merge, 1);
  185|  5.44k|    pthread_mutex_unlock(&f->task_thread.pending_tasks.lock);
  186|  5.44k|}
thread_task.c:reset_task_cur_async:
   84|  78.6k|{
   85|  78.6k|    const unsigned first = atomic_load(&ttd->first);
   86|  78.6k|    if (frame_idx < first) frame_idx += n_frames;
  ------------------
  |  Branch (86:9): [True: 0, False: 78.6k]
  ------------------
   87|  78.6k|    unsigned last_idx = frame_idx;
   88|  78.6k|    do {
   89|  78.6k|        frame_idx = last_idx;
   90|  78.6k|        last_idx = atomic_exchange(&ttd->reset_task_cur, frame_idx);
   91|  78.6k|    } while (last_idx < frame_idx);
  ------------------
  |  Branch (91:14): [True: 0, False: 78.6k]
  ------------------
   92|  78.6k|    if (frame_idx == first && atomic_load(&ttd->first) != first) {
  ------------------
  |  Branch (92:9): [True: 78.6k, False: 1]
  |  Branch (92:31): [True: 0, False: 78.6k]
  ------------------
   93|      0|        unsigned expected = frame_idx;
   94|       |        atomic_compare_exchange_strong(&ttd->reset_task_cur, &expected, UINT_MAX);
   95|      0|    }
   96|  78.6k|}
thread_task.c:ensure_progress:
  378|  21.8k|{
  379|       |    // deblock_rows (non-LR portion) depends on deblock of previous sbrow,
  380|       |    // so ensure that completed. if not, re-add to task-queue; else, fall-through
  381|  21.8k|    int p1 = atomic_load(state);
  382|  21.8k|    if (p1 < t->sby) {
  ------------------
  |  Branch (382:9): [True: 228, False: 21.5k]
  ------------------
  383|    228|        t->type = type;
  384|    228|        t->recon_progress = t->deblock_progress = 0;
  385|    228|        *target = t->sby;
  386|    228|        add_pending(f, t);
  387|    228|        pthread_mutex_lock(&ttd->lock);
  388|    228|        return 1;
  389|    228|    }
  390|  21.5k|    return 0;
  391|  21.8k|}
thread_task.c:get_frame_progress:
  443|  56.8k|{
  444|  56.8k|    unsigned frame_prog = c->n_fc > 1 ? atomic_load(&f->sr_cur.progress[1]) : 0;
  ------------------
  |  Branch (444:27): [True: 0, False: 56.8k]
  ------------------
  445|  56.8k|    if (frame_prog >= FRAME_ERROR)
  ------------------
  |  |   35|  56.8k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (445:9): [True: 0, False: 56.8k]
  ------------------
  446|      0|        return f->sbh - 1;
  447|  56.8k|    int idx = frame_prog >> (f->sb_shift + 7);
  448|  56.8k|    int prog;
  449|  56.8k|    do {
  450|  56.8k|        atomic_uint *state = &f->frame_thread.frame_progress[idx];
  451|  56.8k|        const unsigned val = ~atomic_load(state);
  452|  56.8k|        prog = val ? ctz(val) : 32;
  ------------------
  |  Branch (452:16): [True: 56.8k, False: 0]
  ------------------
  453|  56.8k|        if (prog != 32) break;
  ------------------
  |  Branch (453:13): [True: 56.8k, False: 0]
  ------------------
  454|      0|        prog = 0;
  455|      0|    } while (++idx < f->frame_thread.prog_sz);
  ------------------
  |  Branch (455:14): [True: 0, False: 0]
  ------------------
  456|  56.8k|    return ((idx << 5) | prog) - 1;
  457|  56.8k|}

dav1d_get_shear_params:
   80|  5.00k|int dav1d_get_shear_params(Dav1dWarpedMotionParams *const wm) {
   81|  5.00k|    const int32_t *const mat = wm->matrix;
   82|       |
   83|  5.00k|    if (mat[2] <= 0) return 1;
  ------------------
  |  Branch (83:9): [True: 0, False: 5.00k]
  ------------------
   84|       |
   85|  5.00k|    wm->u.p.alpha = iclip_wmp(mat[2] - 0x10000);
   86|  5.00k|    wm->u.p.beta = iclip_wmp(mat[3]);
   87|       |
   88|  5.00k|    int shift;
   89|  5.00k|    const int y = apply_sign(resolve_divisor_32(abs(mat[2]), &shift), mat[2]);
   90|  5.00k|    const int64_t v1 = ((int64_t) mat[4] * 0x10000) * y;
   91|  5.00k|    const int rnd = (1 << shift) >> 1;
   92|  5.00k|    wm->u.p.gamma = iclip_wmp(apply_sign64((int) ((llabs(v1) + rnd) >> shift), v1));
   93|  5.00k|    const int64_t v2 = ((int64_t) mat[3] * mat[4]) * y;
   94|  5.00k|    wm->u.p.delta = iclip_wmp(mat[5] -
   95|  5.00k|                          apply_sign64((int) ((llabs(v2) + rnd) >> shift), v2) -
   96|  5.00k|                          0x10000);
   97|       |
   98|  5.00k|    return (4 * abs(wm->u.p.alpha) + 7 * abs(wm->u.p.beta) >= 0x10000) ||
  ------------------
  |  Branch (98:12): [True: 18.4E, False: 5.00k]
  ------------------
   99|  5.00k|           (4 * abs(wm->u.p.gamma) + 4 * abs(wm->u.p.delta) >= 0x10000);
  ------------------
  |  Branch (99:12): [True: 18.4E, False: 5.00k]
  ------------------
  100|  5.00k|}
dav1d_find_affine_int:
  153|  5.02k|{
  154|  5.02k|    int32_t *const mat = wm->matrix;
  155|  5.02k|    int a[2][2] = { { 0, 0 }, { 0, 0 } };
  156|  5.02k|    int bx[2] = { 0, 0 };
  157|  5.02k|    int by[2] = { 0, 0 };
  158|  5.02k|    const int rsuy = 2 * bh4 - 1;
  159|  5.02k|    const int rsux = 2 * bw4 - 1;
  160|  5.02k|    const int suy = rsuy * 8;
  161|  5.02k|    const int sux = rsux * 8;
  162|  5.02k|    const int duy = suy + mv.y;
  163|  5.02k|    const int dux = sux + mv.x;
  164|  5.02k|    const int isuy = by4 * 4 + rsuy;
  165|  5.02k|    const int isux = bx4 * 4 + rsux;
  166|       |
  167|  12.3k|    for (int i = 0; i < np; i++) {
  ------------------
  |  Branch (167:21): [True: 7.32k, False: 5.02k]
  ------------------
  168|  7.32k|        const int dx = pts[i][1][0] - dux;
  169|  7.32k|        const int dy = pts[i][1][1] - duy;
  170|  7.32k|        const int sx = pts[i][0][0] - sux;
  171|  7.32k|        const int sy = pts[i][0][1] - suy;
  172|  7.32k|        if (abs(sx - dx) < 256 && abs(sy - dy) < 256) {
  ------------------
  |  Branch (172:13): [True: 7.31k, False: 6]
  |  Branch (172:35): [True: 7.31k, False: 2]
  ------------------
  173|  7.31k|            a[0][0] += ((sx * sx) >> 2) + sx * 2 + 8;
  174|  7.31k|            a[0][1] += ((sx * sy) >> 2) + sx + sy + 4;
  175|  7.31k|            a[1][1] += ((sy * sy) >> 2) + sy * 2 + 8;
  176|  7.31k|            bx[0] += ((sx * dx) >> 2) + sx + dx + 8;
  177|  7.31k|            bx[1] += ((sy * dx) >> 2) + sy + dx + 4;
  178|  7.31k|            by[0] += ((sx * dy) >> 2) + sx + dy + 4;
  179|  7.31k|            by[1] += ((sy * dy) >> 2) + sy + dy + 8;
  180|  7.31k|        }
  181|  7.32k|    }
  182|       |
  183|       |    // compute determinant of a
  184|  5.02k|    const int64_t det = (int64_t) a[0][0] * a[1][1] - (int64_t) a[0][1] * a[0][1];
  185|  5.02k|    if (det == 0) return 1;
  ------------------
  |  Branch (185:9): [True: 0, False: 5.02k]
  ------------------
  186|  5.02k|    int shift, idet = apply_sign64(resolve_divisor_64(llabs(det), &shift), det);
  187|  5.02k|    shift -= 16;
  188|  5.02k|    if (shift < 0) {
  ------------------
  |  Branch (188:9): [True: 0, False: 5.02k]
  ------------------
  189|      0|        idet <<= -shift;
  190|      0|        shift = 0;
  191|      0|    }
  192|       |
  193|       |    // solve the least-squares
  194|  5.02k|    mat[2] = get_mult_shift_diag((int64_t) a[1][1] * bx[0] -
  195|  5.02k|                                 (int64_t) a[0][1] * bx[1], idet, shift);
  196|  5.02k|    mat[3] = get_mult_shift_ndiag((int64_t) a[0][0] * bx[1] -
  197|  5.02k|                                  (int64_t) a[0][1] * bx[0], idet, shift);
  198|  5.02k|    mat[4] = get_mult_shift_ndiag((int64_t) a[1][1] * by[0] -
  199|  5.02k|                                  (int64_t) a[0][1] * by[1], idet, shift);
  200|  5.02k|    mat[5] = get_mult_shift_diag((int64_t) a[0][0] * by[1] -
  201|  5.02k|                                 (int64_t) a[0][1] * by[0], idet, shift);
  202|       |
  203|  5.02k|    mat[0] = iclip(mv.x * 0x2000 - (isux * (mat[2] - 0x10000) + isuy * mat[3]),
  204|  5.02k|                   -0x800000, 0x7fffff);
  205|  5.02k|    mat[1] = iclip(mv.y * 0x2000 - (isux * mat[4] + isuy * (mat[5] - 0x10000)),
  206|  5.02k|                   -0x800000, 0x7fffff);
  207|       |
  208|  5.02k|    return 0;
  209|  5.02k|}
warpmv.c:iclip_wmp:
   63|  19.9k|static inline int iclip_wmp(const int v) {
   64|  19.9k|    const int cv = iclip(v, INT16_MIN, INT16_MAX);
   65|       |
   66|  19.9k|    return apply_sign((abs(cv) + 32) >> 6, cv) * (1 << 6);
   67|  19.9k|}
warpmv.c:resolve_divisor_32:
   69|  5.00k|static inline int resolve_divisor_32(const unsigned d, int *const shift) {
   70|  5.00k|    *shift = ulog2(d);
   71|  5.00k|    const int e = d - (1 << *shift);
   72|  5.00k|    const int f = *shift > 8 ? (e + (1 << (*shift - 9))) >> (*shift - 8) :
  ------------------
  |  Branch (72:19): [True: 5.00k, False: 0]
  ------------------
   73|  5.00k|                               e << (8 - *shift);
   74|  5.00k|    assert(f <= 256);
  ------------------
  |  |  140|  5.00k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 5.00k]
  |  |  |  Branch (140:68): [Folded, False: 5.00k]
  |  |  ------------------
  ------------------
   75|  5.00k|    *shift += 14;
   76|       |    // Use f as lookup into the precomputed table of multipliers
   77|  5.00k|    return div_lut[f];
   78|  5.00k|}
warpmv.c:resolve_divisor_64:
  102|  5.02k|static int resolve_divisor_64(const uint64_t d, int *const shift) {
  103|  5.02k|    *shift = u64log2(d);
  104|  5.02k|    const int64_t e = d - (1LL << *shift);
  105|  5.02k|    const int64_t f = *shift > 8 ? (e + (1LL << (*shift - 9))) >> (*shift - 8) :
  ------------------
  |  Branch (105:23): [True: 5.02k, False: 18.4E]
  ------------------
  106|  18.4E|                                   e << (8 - *shift);
  107|  5.02k|    assert(f <= 256);
  ------------------
  |  |  140|  5.02k|#define assert(x) do { if (!(x)) __builtin_unreachable(); } while (0)
  |  |  ------------------
  |  |  |  Branch (140:28): [True: 0, False: 5.02k]
  |  |  |  Branch (140:68): [Folded, False: 5.02k]
  |  |  ------------------
  ------------------
  108|  5.02k|    *shift += 14;
  109|       |    // Use f as lookup into the precomputed table of multipliers
  110|  5.02k|    return div_lut[f];
  111|  5.02k|}
warpmv.c:get_mult_shift_diag:
  125|  10.0k|{
  126|  10.0k|    const int64_t v1 = px * idet;
  127|  10.0k|    const int v2 = apply_sign64((int) ((llabs(v1) +
  128|  10.0k|                                        ((1LL << shift) >> 1)) >> shift),
  129|  10.0k|                                v1);
  130|  10.0k|    return iclip(v2, 0xe001, 0x11fff);
  131|  10.0k|}
warpmv.c:get_mult_shift_ndiag:
  115|  10.0k|{
  116|  10.0k|    const int64_t v1 = px * idet;
  117|  10.0k|    const int v2 = apply_sign64((int) ((llabs(v1) +
  118|  10.0k|                                        ((1LL << shift) >> 1)) >> shift),
  119|  10.0k|                                v1);
  120|  10.0k|    return iclip(v2, -0x1fff, 0x1fff);
  121|  10.0k|}

dav1d_init_ii_wedge_masks:
  207|      1|COLD void dav1d_init_ii_wedge_masks(void) {
  208|       |    // This function is guaranteed to be called only once
  209|       |
  210|      1|    enum WedgeMasterLineType {
  211|      1|        WEDGE_MASTER_LINE_ODD,
  212|      1|        WEDGE_MASTER_LINE_EVEN,
  213|      1|        WEDGE_MASTER_LINE_VERT,
  214|      1|        N_WEDGE_MASTER_LINES,
  215|      1|    };
  216|      1|    static const uint8_t wedge_master_border[N_WEDGE_MASTER_LINES][8] = {
  217|      1|        [WEDGE_MASTER_LINE_ODD]  = {  1,  2,  6, 18, 37, 53, 60, 63 },
  218|      1|        [WEDGE_MASTER_LINE_EVEN] = {  1,  4, 11, 27, 46, 58, 62, 63 },
  219|      1|        [WEDGE_MASTER_LINE_VERT] = {  0,  2,  7, 21, 43, 57, 62, 64 },
  220|      1|    };
  221|      1|    uint8_t master[6][64 * 64];
  222|       |
  223|       |    // create master templates
  224|     65|    for (int y = 0, off = 0; y < 64; y++, off += 64)
  ------------------
  |  Branch (224:30): [True: 64, False: 1]
  ------------------
  225|     64|        insert_border(&master[WEDGE_VERTICAL][off],
  226|     64|                      wedge_master_border[WEDGE_MASTER_LINE_VERT], 32);
  227|     33|    for (int y = 0, off = 0, ctr = 48; y < 64; y += 2, off += 128, ctr--)
  ------------------
  |  Branch (227:40): [True: 32, False: 1]
  ------------------
  228|     32|    {
  229|     32|        insert_border(&master[WEDGE_OBLIQUE63][off],
  230|     32|                      wedge_master_border[WEDGE_MASTER_LINE_EVEN], ctr);
  231|     32|        insert_border(&master[WEDGE_OBLIQUE63][off + 64],
  232|     32|                      wedge_master_border[WEDGE_MASTER_LINE_ODD], ctr - 1);
  233|     32|    }
  234|       |
  235|      1|    transpose(master[WEDGE_OBLIQUE27], master[WEDGE_OBLIQUE63]);
  236|      1|    transpose(master[WEDGE_HORIZONTAL], master[WEDGE_VERTICAL]);
  237|      1|    hflip(master[WEDGE_OBLIQUE117], master[WEDGE_OBLIQUE63]);
  238|      1|    hflip(master[WEDGE_OBLIQUE153], master[WEDGE_OBLIQUE27]);
  239|       |
  240|      1|#define fill(w, h, sz_422, sz_420, hvsw, signs) \
  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  242|      1|                master, wedge_codebook_16_##hvsw, \
  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  246|       |
  247|      1|    fill(32, 32, 16x32, 16x16, heqw, 0x7bfb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  248|      1|    fill(32, 16, 16x16, 16x8,  hltw, 0x7beb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  249|      1|    fill(32,  8, 16x8,  16x4,  hltw, 0x6beb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  250|      1|    fill(16, 32,  8x32,  8x16, hgtw, 0x7beb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  251|      1|    fill(16, 16,  8x16,  8x8,  heqw, 0x7bfb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  252|      1|    fill(16,  8,  8x8,   8x4,  hltw, 0x7beb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  253|      1|    fill( 8, 32,  4x32,  4x16, hgtw, 0x7aeb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  254|      1|    fill( 8, 16,  4x16,  4x8,  hgtw, 0x7beb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  255|      1|    fill( 8,  8,  4x8,   4x4,  heqw, 0x7bfb);
  ------------------
  |  |  241|      1|    fill2d_16x2(w, h, BS_##w##x##h - BS_32x32, \
  |  |  242|      1|                master, wedge_codebook_16_##hvsw, \
  |  |  243|      1|                dav1d_masks.wedge_444_##w##x##h, \
  |  |  244|      1|                dav1d_masks.wedge_422_##sz_422, \
  |  |  245|      1|                dav1d_masks.wedge_420_##sz_420, signs)
  ------------------
  256|      1|#undef fill
  257|       |
  258|      1|    memset(dav1d_masks.ii_dc, 32, 32 * 32);
  259|      4|    for (int c = 0; c < 3; c++) {
  ------------------
  |  Branch (259:21): [True: 3, False: 1]
  ------------------
  260|      3|        dav1d_masks.offsets[c][BS_32x32-BS_32x32].ii[II_DC_PRED] =
  261|      3|        dav1d_masks.offsets[c][BS_32x16-BS_32x32].ii[II_DC_PRED] =
  262|      3|        dav1d_masks.offsets[c][BS_16x32-BS_32x32].ii[II_DC_PRED] =
  263|      3|        dav1d_masks.offsets[c][BS_16x16-BS_32x32].ii[II_DC_PRED] =
  264|      3|        dav1d_masks.offsets[c][BS_16x8 -BS_32x32].ii[II_DC_PRED] =
  265|      3|        dav1d_masks.offsets[c][BS_8x16 -BS_32x32].ii[II_DC_PRED] =
  266|      3|        dav1d_masks.offsets[c][BS_8x8  -BS_32x32].ii[II_DC_PRED] =
  267|      3|            MASK_OFFSET(dav1d_masks.ii_dc);
  ------------------
  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  ------------------
  268|      3|    }
  269|       |
  270|      1|#define BUILD_NONDC_II_MASKS(w, h, step) \
  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  272|       |
  273|      1|#define ASSIGN_NONDC_II_OFFSET(bs, w444, h444, w422, h422, w420, h420) \
  274|      1|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  275|      1|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  276|      1|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  277|      1|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  278|      1|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  279|      1|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  280|       |
  281|      1|    BUILD_NONDC_II_MASKS(32, 32, 1);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  282|      1|    BUILD_NONDC_II_MASKS(16, 32, 1);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  283|      1|    BUILD_NONDC_II_MASKS(16, 16, 2);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  284|      1|    BUILD_NONDC_II_MASKS( 8, 32, 1);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  285|      1|    BUILD_NONDC_II_MASKS( 8, 16, 2);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  286|      1|    BUILD_NONDC_II_MASKS( 8,  8, 4);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  287|      1|    BUILD_NONDC_II_MASKS( 4, 16, 2);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  288|      1|    BUILD_NONDC_II_MASKS( 4,  8, 4);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  289|      1|    BUILD_NONDC_II_MASKS( 4,  4, 8);
  ------------------
  |  |  271|      1|    build_nondc_ii_masks(dav1d_masks.ii_nondc_##w##x##h, w, h, step)
  ------------------
  290|      4|    for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (290:21): [True: 3, False: 1]
  ------------------
  291|      3|        ASSIGN_NONDC_II_OFFSET(BS_32x32, 32, 32, 16, 32, 16, 16);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  292|      3|        ASSIGN_NONDC_II_OFFSET(BS_32x16, 32, 32, 16, 16, 16, 16);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  293|      3|        ASSIGN_NONDC_II_OFFSET(BS_16x32, 16, 32,  8, 32,  8, 16);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  294|      3|        ASSIGN_NONDC_II_OFFSET(BS_16x16, 16, 16,  8, 16,  8,  8);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  295|      3|        ASSIGN_NONDC_II_OFFSET(BS_16x8,  16, 16,  8,  8,  8,  8);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  296|      3|        ASSIGN_NONDC_II_OFFSET(BS_8x16,   8, 16,  4, 16,  4,  8);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  297|      3|        ASSIGN_NONDC_II_OFFSET(BS_8x8,    8,  8,  4,  8,  4,  4);
  ------------------
  |  |  274|      3|    dav1d_masks.offsets[0][bs-BS_32x32].ii[p + 1] = \
  |  |  275|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w444##x##h444[p*w444*h444]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  276|      3|    dav1d_masks.offsets[1][bs-BS_32x32].ii[p + 1] = \
  |  |  277|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w422##x##h422[p*w422*h422]); \
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  |  |  278|      3|    dav1d_masks.offsets[2][bs-BS_32x32].ii[p + 1] = \
  |  |  279|      3|        MASK_OFFSET(&dav1d_masks.ii_nondc_##w420##x##h420[p*w420*h420])
  |  |  ------------------
  |  |  |  |  129|      3|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  |  |  ------------------
  ------------------
  298|      3|    }
  299|      1|}
wedge.c:insert_border:
   90|    128|{
   91|    128|    if (ctr > 4) memset(dst, 0, ctr - 4);
  ------------------
  |  Branch (91:9): [True: 128, False: 0]
  ------------------
   92|    128|    memcpy(dst + imax(ctr, 4) - 4, src + imax(4 - ctr, 0), imin(64 - ctr, 8));
   93|    128|    if (ctr < 64 - 4)
  ------------------
  |  Branch (93:9): [True: 128, False: 0]
  ------------------
   94|    128|        memset(dst + ctr + 4, 64, 64 - 4 - ctr);
   95|    128|}
wedge.c:transpose:
   97|      2|static void transpose(uint8_t *const dst, const uint8_t *const src) {
   98|    130|    for (int y = 0, y_off = 0; y < 64; y++, y_off += 64)
  ------------------
  |  Branch (98:32): [True: 128, False: 2]
  ------------------
   99|  8.32k|        for (int x = 0, x_off = 0; x < 64; x++, x_off += 64)
  ------------------
  |  Branch (99:36): [True: 8.19k, False: 128]
  ------------------
  100|  8.19k|            dst[x_off + y] = src[y_off + x];
  101|      2|}
wedge.c:hflip:
  103|      2|static void hflip(uint8_t *const dst, const uint8_t *const src) {
  104|    130|    for (int y = 0, y_off = 0; y < 64; y++, y_off += 64)
  ------------------
  |  Branch (104:32): [True: 128, False: 2]
  ------------------
  105|  8.32k|        for (int x = 0; x < 64; x++)
  ------------------
  |  Branch (105:25): [True: 8.19k, False: 128]
  ------------------
  106|  8.19k|            dst[y_off + 64 - 1 - x] = src[y_off + x];
  107|      2|}
wedge.c:fill2d_16x2:
  153|      9|{
  154|      9|    const int n_stride_444 = (w * h);
  155|      9|    const int n_stride_422 = n_stride_444 >> 1;
  156|      9|    const int n_stride_420 = n_stride_444 >> 2;
  157|      9|    const int sign_stride_422 = 16 * n_stride_422;
  158|      9|    const int sign_stride_420 = 16 * n_stride_420;
  159|       |
  160|       |    // assign pointer offsets in lookup table
  161|    153|    for (int n = 0; n < 16; n++) {
  ------------------
  |  Branch (161:21): [True: 144, False: 9]
  ------------------
  162|    144|        const int sign = signs & 1;
  163|       |
  164|    144|        copy2d(masks_444, master[cb[n].direction], sign, w, h,
  165|    144|               32 - (w * cb[n].x_offset >> 3), 32 - (h * cb[n].y_offset >> 3));
  166|       |
  167|       |        // not using !sign is intentional here, since 444 does not require
  168|       |        // any rounding since no chroma subsampling is applied.
  169|    144|        dav1d_masks.offsets[0][bs].wedge[0][n] =
  170|    144|        dav1d_masks.offsets[0][bs].wedge[1][n] = MASK_OFFSET(masks_444);
  ------------------
  |  |  129|    144|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  ------------------
  171|       |
  172|    144|        dav1d_masks.offsets[1][bs].wedge[0][n] =
  173|    144|            init_chroma(&masks_422[ sign * sign_stride_422], masks_444, 0, w, h, 0);
  174|    144|        dav1d_masks.offsets[1][bs].wedge[1][n] =
  175|    144|            init_chroma(&masks_422[!sign * sign_stride_422], masks_444, 1, w, h, 0);
  176|    144|        dav1d_masks.offsets[2][bs].wedge[0][n] =
  177|    144|            init_chroma(&masks_420[ sign * sign_stride_420], masks_444, 0, w, h, 1);
  178|    144|        dav1d_masks.offsets[2][bs].wedge[1][n] =
  179|    144|            init_chroma(&masks_420[!sign * sign_stride_420], masks_444, 1, w, h, 1);
  180|       |
  181|    144|        signs >>= 1;
  182|    144|        masks_444 += n_stride_444;
  183|    144|        masks_422 += n_stride_422;
  184|    144|        masks_420 += n_stride_420;
  185|    144|    }
  186|      9|}
wedge.c:copy2d:
  111|    144|{
  112|    144|    src += y_off * 64 + x_off;
  113|    144|    if (sign) {
  ------------------
  |  Branch (113:9): [True: 109, False: 35]
  ------------------
  114|  2.14k|        for (int y = 0; y < h; y++) {
  ------------------
  |  Branch (114:25): [True: 2.03k, False: 109]
  ------------------
  115|  40.4k|            for (int x = 0; x < w; x++)
  ------------------
  |  Branch (115:29): [True: 38.4k, False: 2.03k]
  ------------------
  116|  38.4k|                dst[x] = 64 - src[x];
  117|  2.03k|            src += 64;
  118|  2.03k|            dst += w;
  119|  2.03k|        }
  120|    109|    } else {
  121|    691|        for (int y = 0; y < h; y++) {
  ------------------
  |  Branch (121:25): [True: 656, False: 35]
  ------------------
  122|    656|            memcpy(dst, src, w);
  123|    656|            src += 64;
  124|    656|            dst += w;
  125|    656|        }
  126|     35|    }
  127|    144|}
wedge.c:init_chroma:
  134|    576|{
  135|    576|    const uint16_t offset = MASK_OFFSET(chroma);
  ------------------
  |  |  129|    576|#define MASK_OFFSET(x) ((uint16_t)(((uintptr_t)(x) - (uintptr_t)&dav1d_masks) >> 3))
  ------------------
  136|  8.64k|    for (int y = 0; y < h; y += 1 + ss_ver) {
  ------------------
  |  Branch (136:21): [True: 8.06k, False: 576]
  ------------------
  137|  83.3k|        for (int x = 0; x < w; x += 2) {
  ------------------
  |  Branch (137:25): [True: 75.2k, False: 8.06k]
  ------------------
  138|  75.2k|            int sum = luma[x] + luma[x + 1] + 1;
  139|  75.2k|            if (ss_ver) sum += luma[w + x] + luma[w + x + 1] + 1;
  ------------------
  |  Branch (139:17): [True: 25.0k, False: 50.1k]
  ------------------
  140|  75.2k|            chroma[x >> 1] = (sum - sign) >> (1 + ss_ver);
  141|  75.2k|        }
  142|  8.06k|        luma += w << ss_ver;
  143|  8.06k|        chroma += w >> 1;
  144|  8.06k|    }
  145|    576|    return offset;
  146|    576|}
wedge.c:build_nondc_ii_masks:
  190|      9|{
  191|      9|    static const uint8_t ii_weights_1d[32] = {
  192|      9|        60, 52, 45, 39, 34, 30, 26, 22, 19, 17, 15, 13, 11, 10,  8,  7,
  193|      9|         6,  6,  5,  4,  4,  3,  3,  2,  2,  2,  2,  1,  1,  1,  1,  1,
  194|      9|    };
  195|       |
  196|      9|    uint8_t *const mask_h  = &mask_v[w * h];
  197|      9|    uint8_t *const mask_sm = &mask_h[w * h];
  198|    173|    for (int y = 0, off = 0; y < h; y++, off += w) {
  ------------------
  |  Branch (198:30): [True: 164, False: 9]
  ------------------
  199|    164|        memset(&mask_v[off], ii_weights_1d[y * step], w);
  200|  2.51k|        for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (200:25): [True: 2.35k, False: 164]
  ------------------
  201|  2.35k|            mask_sm[off + x] = ii_weights_1d[imin(x, y) * step];
  202|  2.35k|            mask_h[off + x] = ii_weights_1d[x * step];
  203|  2.35k|        }
  204|    164|    }
  205|      9|}

cdef_tmpl.c:cdef_dsp_init_x86:
   46|  8.03k|static ALWAYS_INLINE void cdef_dsp_init_x86(Dav1dCdefDSPContext *const c) {
   47|  8.03k|    const unsigned flags = dav1d_get_cpu_flags();
   48|       |
   49|  8.03k|#if BITDEPTH == 8
   50|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (50:9): [True: 0, False: 8.03k]
  ------------------
   51|       |
   52|  8.03k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, sse2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   53|  8.03k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, sse2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   54|  8.03k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, sse2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  8.03k|#endif
   56|       |
   57|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (57:9): [True: 0, False: 8.03k]
  ------------------
   58|       |
   59|  8.03k|    c->dir = BF(dav1d_cdef_dir, ssse3);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   60|  8.03k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, ssse3);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   61|  8.03k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, ssse3);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   62|  8.03k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, ssse3);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   63|       |
   64|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (64:9): [True: 0, False: 8.03k]
  ------------------
   65|       |
   66|  8.03k|    c->dir = BF(dav1d_cdef_dir, sse4);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   67|  8.03k|#if BITDEPTH == 8
   68|  8.03k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, sse4);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   69|  8.03k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, sse4);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   70|  8.03k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, sse4);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   71|  8.03k|#endif
   72|       |
   73|  8.03k|#if ARCH_X86_64
   74|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (74:9): [True: 0, False: 8.03k]
  ------------------
   75|       |
   76|  8.03k|    c->dir = BF(dav1d_cdef_dir, avx2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   77|  8.03k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, avx2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   78|  8.03k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, avx2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   79|  8.03k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, avx2);
  ------------------
  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   80|       |
   81|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (81:9): [True: 8.03k, False: 0]
  ------------------
   82|       |
   83|      0|    c->fb[0] = BF(dav1d_cdef_filter_8x8, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   84|      0|    c->fb[1] = BF(dav1d_cdef_filter_4x8, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   85|      0|    c->fb[2] = BF(dav1d_cdef_filter_4x4, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   86|      0|#endif
   87|      0|}

dav1d_get_cpu_flags_x86:
   47|      1|COLD unsigned dav1d_get_cpu_flags_x86(void) {
   48|      1|    union {
   49|      1|        CpuidRegisters r;
   50|      1|        struct {
   51|      1|            uint32_t max_leaf;
   52|      1|            char vendor[12];
   53|      1|        };
   54|      1|    } cpu;
   55|      1|    dav1d_cpu_cpuid(&cpu.r, 0, 0);
   56|      1|    unsigned flags = dav1d_get_default_cpu_flags();
   57|       |
   58|      1|    if (cpu.max_leaf >= 1) {
  ------------------
  |  Branch (58:9): [True: 1, False: 0]
  ------------------
   59|      1|        CpuidRegisters r;
   60|      1|        dav1d_cpu_cpuid(&r, 1, 0);
   61|      1|        const unsigned family = ((r.eax >> 8) & 0x0f) + ((r.eax >> 20) & 0xff);
   62|       |
   63|      1|        if (X(r.edx, 0x06008000)) /* CMOV/SSE/SSE2 */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   64|      1|            flags |= DAV1D_X86_CPU_FLAG_SSE2;
   65|      1|            if (X(r.ecx, 0x00000201)) /* SSE3/SSSE3 */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   66|      1|                flags |= DAV1D_X86_CPU_FLAG_SSSE3;
   67|      1|                if (X(r.ecx, 0x00080000)) /* SSE4.1 */
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   68|      1|                    flags |= DAV1D_X86_CPU_FLAG_SSE41;
   69|      1|            }
   70|      1|        }
   71|      1|#if ARCH_X86_64
   72|       |        /* We only support >128-bit SIMD on x86-64. */
   73|      1|        if (X(r.ecx, 0x18000000)) /* OSXSAVE/AVX */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   74|      1|            const uint64_t xcr0 = dav1d_cpu_xgetbv(0);
   75|      1|            if (X(xcr0, 0x00000006)) /* XMM/YMM */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   76|      1|                if (cpu.max_leaf >= 7) {
  ------------------
  |  Branch (76:21): [True: 1, False: 0]
  ------------------
   77|      1|                    dav1d_cpu_cpuid(&r, 7, 0);
   78|      1|                    if (X(r.ebx, 0x00000128)) /* BMI1/BMI2/AVX2 */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   79|      1|                        flags |= DAV1D_X86_CPU_FLAG_AVX2;
   80|      1|                        if (X(xcr0, 0x000000e0)) /* ZMM/OPMASK */ {
  ------------------
  |  |   45|      1|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 1]
  |  |  ------------------
  ------------------
   81|      0|                            if (X(r.ebx, 0xd0230000) && X(r.ecx, 0x00005f42))
  ------------------
  |  |   45|      0|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (X(r.ebx, 0xd0230000) && X(r.ecx, 0x00005f42))
  ------------------
  |  |   45|      0|#define X(reg, mask) (((reg) & (mask)) == (mask))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   82|      0|                                flags |= DAV1D_X86_CPU_FLAG_AVX512ICL;
   83|      0|                        }
   84|      1|                    }
   85|      1|                }
   86|      1|            }
   87|      1|        }
   88|      1|#endif
   89|      1|        if (!memcmp(cpu.vendor, "AuthenticAMD", sizeof(cpu.vendor))) {
  ------------------
  |  Branch (89:13): [True: 0, False: 1]
  ------------------
   90|      0|            if ((flags & DAV1D_X86_CPU_FLAG_AVX2) && family <= 0x19) {
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  |  Branch (90:54): [True: 0, False: 0]
  ------------------
   91|       |                /* Excavator, Zen, Zen+, Zen 2, Zen 3, Zen 3+, Zen 4 */
   92|      0|                flags |= DAV1D_X86_CPU_FLAG_SLOW_GATHER;
   93|      0|            }
   94|      0|        }
   95|      1|    }
   96|       |
   97|      1|    return flags;
   98|      1|}

filmgrain_tmpl.c:film_grain_dsp_init_x86:
   45|  11.3k|static ALWAYS_INLINE void film_grain_dsp_init_x86(Dav1dFilmGrainDSPContext *const c) {
   46|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   47|       |
   48|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (48:9): [True: 0, False: 11.3k]
  ------------------
   49|       |
   50|  11.3k|    c->generate_grain_y = BF(dav1d_generate_grain_y, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   51|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_generate_grain_uv_420, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   52|  11.3k|    c->fgy_32x32xn = BF(dav1d_fgy_32x32xn, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   53|  11.3k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_fguv_32x32xn_i420, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   54|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_generate_grain_uv_422, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_generate_grain_uv_444, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  11.3k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_fguv_32x32xn_i422, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  11.3k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_fguv_32x32xn_i444, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   58|       |
   59|  11.3k|#if ARCH_X86_64
   60|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (60:9): [True: 0, False: 11.3k]
  ------------------
   61|       |
   62|  11.3k|    c->generate_grain_y = BF(dav1d_generate_grain_y, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   63|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_generate_grain_uv_420, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   64|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_generate_grain_uv_422, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   65|  11.3k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_generate_grain_uv_444, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   66|       |
   67|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SLOW_GATHER)) {
  ------------------
  |  Branch (67:9): [True: 11.3k, False: 0]
  ------------------
   68|  11.3k|        c->fgy_32x32xn = BF(dav1d_fgy_32x32xn, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   69|  11.3k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_fguv_32x32xn_i420, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   70|  11.3k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_fguv_32x32xn_i422, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   71|  11.3k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_fguv_32x32xn_i444, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   72|  11.3k|    }
   73|       |
   74|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (74:9): [True: 11.3k, False: 0]
  ------------------
   75|       |
   76|      0|    if (BITDEPTH == 8 || !(flags & DAV1D_X86_CPU_FLAG_SLOW_GATHER)) {
  ------------------
  |  Branch (76:9): [True: 0, Folded]
  |  Branch (76:26): [True: 0, False: 0]
  ------------------
   77|      0|        c->fgy_32x32xn = BF(dav1d_fgy_32x32xn, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   78|      0|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_fguv_32x32xn_i420, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   79|      0|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_fguv_32x32xn_i422, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   80|      0|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_fguv_32x32xn_i444, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   81|      0|    }
   82|      0|#endif
   83|      0|}

ipred_tmpl.c:intra_pred_dsp_init_x86:
   71|  11.3k|static ALWAYS_INLINE void intra_pred_dsp_init_x86(Dav1dIntraPredDSPContext *const c) {
   72|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   73|       |
   74|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (74:9): [True: 0, False: 11.3k]
  ------------------
   75|       |
   76|  11.3k|    init_angular_ipred_fn(DC_PRED,       ipred_dc,       ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  11.3k|    init_angular_ipred_fn(DC_128_PRED,   ipred_dc_128,   ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|  11.3k|    init_angular_ipred_fn(TOP_DC_PRED,   ipred_dc_top,   ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|  11.3k|    init_angular_ipred_fn(LEFT_DC_PRED,  ipred_dc_left,  ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  11.3k|    init_angular_ipred_fn(HOR_PRED,      ipred_h,        ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  11.3k|    init_angular_ipred_fn(VERT_PRED,     ipred_v,        ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|  11.3k|    init_angular_ipred_fn(PAETH_PRED,    ipred_paeth,    ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  11.3k|    init_angular_ipred_fn(SMOOTH_PRED,   ipred_smooth,   ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  11.3k|    init_angular_ipred_fn(SMOOTH_H_PRED, ipred_smooth_h, ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|  11.3k|    init_angular_ipred_fn(SMOOTH_V_PRED, ipred_smooth_v, ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|  11.3k|    init_angular_ipred_fn(Z1_PRED,       ipred_z1,       ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|  11.3k|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  11.3k|    init_angular_ipred_fn(Z3_PRED,       ipred_z3,       ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|  11.3k|    init_angular_ipred_fn(FILTER_PRED,   ipred_filter,   ssse3);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|       |
   91|  11.3k|    init_cfl_pred_fn(DC_PRED,      ipred_cfl,      ssse3);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|  11.3k|    init_cfl_pred_fn(DC_128_PRED,  ipred_cfl_128,  ssse3);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|  11.3k|    init_cfl_pred_fn(TOP_DC_PRED,  ipred_cfl_top,  ssse3);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  11.3k|    init_cfl_pred_fn(LEFT_DC_PRED, ipred_cfl_left, ssse3);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|       |
   96|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I420 - 1, ipred_cfl_ac_420, ssse3);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I422 - 1, ipred_cfl_ac_422, ssse3);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I444 - 1, ipred_cfl_ac_444, ssse3);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|       |
  100|  11.3k|    c->pal_pred = BF(dav1d_pal_pred, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  101|       |
  102|  11.3k|#if ARCH_X86_64
  103|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (103:9): [True: 0, False: 11.3k]
  ------------------
  104|       |
  105|  11.3k|    init_angular_ipred_fn(DC_PRED,       ipred_dc,       avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  11.3k|    init_angular_ipred_fn(DC_128_PRED,   ipred_dc_128,   avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|  11.3k|    init_angular_ipred_fn(TOP_DC_PRED,   ipred_dc_top,   avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|  11.3k|    init_angular_ipred_fn(LEFT_DC_PRED,  ipred_dc_left,  avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|  11.3k|    init_angular_ipred_fn(HOR_PRED,      ipred_h,        avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|  11.3k|    init_angular_ipred_fn(VERT_PRED,     ipred_v,        avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|  11.3k|    init_angular_ipred_fn(PAETH_PRED,    ipred_paeth,    avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|  11.3k|    init_angular_ipred_fn(SMOOTH_PRED,   ipred_smooth,   avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  11.3k|    init_angular_ipred_fn(SMOOTH_H_PRED, ipred_smooth_h, avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|  11.3k|    init_angular_ipred_fn(SMOOTH_V_PRED, ipred_smooth_v, avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|  11.3k|    init_angular_ipred_fn(Z1_PRED,       ipred_z1,       avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|  11.3k|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|  11.3k|    init_angular_ipred_fn(Z3_PRED,       ipred_z3,       avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  118|  11.3k|    init_angular_ipred_fn(FILTER_PRED,   ipred_filter,   avx2);
  ------------------
  |  |   39|  11.3k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|       |
  120|  11.3k|    init_cfl_pred_fn(DC_PRED,      ipred_cfl,      avx2);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|  11.3k|    init_cfl_pred_fn(DC_128_PRED,  ipred_cfl_128,  avx2);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  11.3k|    init_cfl_pred_fn(TOP_DC_PRED,  ipred_cfl_top,  avx2);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|  11.3k|    init_cfl_pred_fn(LEFT_DC_PRED, ipred_cfl_left, avx2);
  ------------------
  |  |   41|  11.3k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I420 - 1, ipred_cfl_ac_420, avx2);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I422 - 1, ipred_cfl_ac_422, avx2);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  11.3k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I444 - 1, ipred_cfl_ac_444, avx2);
  ------------------
  |  |   43|  11.3k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|       |
  129|  11.3k|    c->pal_pred = BF(dav1d_pal_pred, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  130|       |
  131|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (131:9): [True: 11.3k, False: 0]
  ------------------
  132|       |
  133|      0|#if BITDEPTH == 8
  134|      0|    init_angular_ipred_fn(DC_PRED,       ipred_dc,       avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  11.3k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|      0|    init_angular_ipred_fn(DC_128_PRED,   ipred_dc_128,   avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|      0|    init_angular_ipred_fn(TOP_DC_PRED,   ipred_dc_top,   avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|      0|    init_angular_ipred_fn(LEFT_DC_PRED,  ipred_dc_left,  avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|      0|    init_angular_ipred_fn(HOR_PRED,      ipred_h,        avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|      0|    init_angular_ipred_fn(VERT_PRED,     ipred_v,        avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|      0|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|      0|#endif
  142|      0|    init_angular_ipred_fn(PAETH_PRED,    ipred_paeth,    avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|      0|    init_angular_ipred_fn(SMOOTH_PRED,   ipred_smooth,   avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|      0|    init_angular_ipred_fn(SMOOTH_H_PRED, ipred_smooth_h, avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|      0|    init_angular_ipred_fn(SMOOTH_V_PRED, ipred_smooth_v, avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      0|    init_angular_ipred_fn(Z1_PRED,       ipred_z1,       avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|      0|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  148|      0|    init_angular_ipred_fn(Z3_PRED,       ipred_z3,       avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|      0|    init_angular_ipred_fn(FILTER_PRED,   ipred_filter,   avx512icl);
  ------------------
  |  |   39|      0|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|      0|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|       |
  151|      0|    c->pal_pred = BF(dav1d_pal_pred, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  152|      0|#endif
  153|      0|}

itx_tmpl.c:itx_dsp_init_x86:
  112|  8.03k|{
  113|  8.03k|#define assign_itx_bpc_fn(pfx, w, h, type, type_enum, bpc, ext) \
  114|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  115|  8.03k|        BF_BPC(dav1d_inv_txfm_add_##type##_##w##x##h, bpc, ext)
  116|       |
  117|  8.03k|#define assign_itx1_bpc_fn(pfx, w, h, bpc, ext) \
  118|  8.03k|    assign_itx_bpc_fn(pfx, w, h, dct_dct,           DCT_DCT,           bpc, ext)
  119|       |
  120|  8.03k|#define assign_itx2_bpc_fn(pfx, w, h, bpc, ext) \
  121|  8.03k|    assign_itx1_bpc_fn(pfx, w, h, bpc, ext); \
  122|  8.03k|    assign_itx_bpc_fn(pfx, w, h, identity_identity, IDTX,              bpc, ext)
  123|       |
  124|  8.03k|#define assign_itx12_bpc_fn(pfx, w, h, bpc, ext) \
  125|  8.03k|    assign_itx2_bpc_fn(pfx, w, h, bpc, ext); \
  126|  8.03k|    assign_itx_bpc_fn(pfx, w, h, dct_adst,          ADST_DCT,          bpc, ext); \
  127|  8.03k|    assign_itx_bpc_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      bpc, ext); \
  128|  8.03k|    assign_itx_bpc_fn(pfx, w, h, dct_identity,      H_DCT,             bpc, ext); \
  129|  8.03k|    assign_itx_bpc_fn(pfx, w, h, adst_dct,          DCT_ADST,          bpc, ext); \
  130|  8.03k|    assign_itx_bpc_fn(pfx, w, h, adst_adst,         ADST_ADST,         bpc, ext); \
  131|  8.03k|    assign_itx_bpc_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     bpc, ext); \
  132|  8.03k|    assign_itx_bpc_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      bpc, ext); \
  133|  8.03k|    assign_itx_bpc_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     bpc, ext); \
  134|  8.03k|    assign_itx_bpc_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, bpc, ext); \
  135|  8.03k|    assign_itx_bpc_fn(pfx, w, h, identity_dct,      V_DCT,             bpc, ext)
  136|       |
  137|  8.03k|#define assign_itx16_bpc_fn(pfx, w, h, bpc, ext) \
  138|  8.03k|    assign_itx12_bpc_fn(pfx, w, h, bpc, ext); \
  139|  8.03k|    assign_itx_bpc_fn(pfx, w, h, adst_identity,     H_ADST,            bpc, ext); \
  140|  8.03k|    assign_itx_bpc_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        bpc, ext); \
  141|  8.03k|    assign_itx_bpc_fn(pfx, w, h, identity_adst,     V_ADST,            bpc, ext); \
  142|  8.03k|    assign_itx_bpc_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        bpc, ext)
  143|       |
  144|  8.03k|    const unsigned flags = dav1d_get_cpu_flags();
  145|       |
  146|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (146:9): [True: 0, False: 8.03k]
  ------------------
  147|       |
  148|  8.03k|    assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, sse2);
  ------------------
  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  ------------------
  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  149|       |
  150|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (150:9): [True: 0, False: 8.03k]
  ------------------
  151|       |
  152|  8.03k|#if BITDEPTH == 8
  153|  8.03k|    assign_itx16_fn(,   4,  4, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|  8.03k|    assign_itx16_fn(R,  4,  8, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|  8.03k|    assign_itx16_fn(R,  8,  4, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  156|  8.03k|    assign_itx16_fn(,   8,  8, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|  8.03k|    assign_itx16_fn(R,  4, 16, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  8.03k|    assign_itx16_fn(R, 16,  4, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|  8.03k|    assign_itx16_fn(R,  8, 16, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|  8.03k|    assign_itx16_fn(R, 16,  8, ssse3);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|  8.03k|    assign_itx12_fn(,  16, 16, ssse3);
  ------------------
  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|  8.03k|    assign_itx2_fn (R,  8, 32, ssse3);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  8.03k|    assign_itx2_fn (R, 32,  8, ssse3);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|  8.03k|    assign_itx2_fn (R, 16, 32, ssse3);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  8.03k|    assign_itx2_fn (R, 32, 16, ssse3);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  8.03k|    assign_itx2_fn (,  32, 32, ssse3);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  8.03k|    assign_itx1_fn (R, 16, 64, ssse3);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  8.03k|    assign_itx1_fn (R, 32, 64, ssse3);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  8.03k|    assign_itx1_fn (R, 64, 16, ssse3);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|  8.03k|    assign_itx1_fn (R, 64, 32, ssse3);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|  8.03k|    assign_itx1_fn ( , 64, 64, ssse3);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  8.03k|    *all_simd = 1;
  173|  8.03k|#endif
  174|       |
  175|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (175:9): [True: 0, False: 8.03k]
  ------------------
  176|       |
  177|       |#if BITDEPTH == 16
  178|       |    if (bpc == 10) {
  179|       |        assign_itx16_fn(,   4,  4, sse4);
  180|       |        assign_itx16_fn(R,  4,  8, sse4);
  181|       |        assign_itx16_fn(R,  4, 16, sse4);
  182|       |        assign_itx16_fn(R,  8,  4, sse4);
  183|       |        assign_itx16_fn(,   8,  8, sse4);
  184|       |        assign_itx16_fn(R,  8, 16, sse4);
  185|       |        assign_itx16_fn(R, 16,  4, sse4);
  186|       |        assign_itx16_fn(R, 16,  8, sse4);
  187|       |        assign_itx12_fn(,  16, 16, sse4);
  188|       |        assign_itx2_fn (R,  8, 32, sse4);
  189|       |        assign_itx2_fn (R, 32,  8, sse4);
  190|       |        assign_itx2_fn (R, 16, 32, sse4);
  191|       |        assign_itx2_fn (R, 32, 16, sse4);
  192|       |        assign_itx2_fn (,  32, 32, sse4);
  193|       |        assign_itx1_fn (R, 16, 64, sse4);
  194|       |        assign_itx1_fn (R, 32, 64, sse4);
  195|       |        assign_itx1_fn (R, 64, 16, sse4);
  196|       |        assign_itx1_fn (R, 64, 32, sse4);
  197|       |        assign_itx1_fn (,  64, 64, sse4);
  198|       |        *all_simd = 1;
  199|       |    }
  200|       |#endif
  201|       |
  202|  8.03k|#if ARCH_X86_64
  203|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (203:9): [True: 0, False: 8.03k]
  ------------------
  204|       |
  205|  8.03k|    assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, avx2);
  ------------------
  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  ------------------
  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  206|       |
  207|  8.03k|#if BITDEPTH == 8
  208|  8.03k|    assign_itx16_fn( ,  4,  4, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  8.03k|    assign_itx16_fn(R,  4,  8, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  8.03k|    assign_itx16_fn(R,  4, 16, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  8.03k|    assign_itx16_fn(R,  8,  4, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|  8.03k|    assign_itx16_fn( ,  8,  8, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|  8.03k|    assign_itx16_fn(R,  8, 16, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  8.03k|    assign_itx2_fn (R,  8, 32, avx2);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|  8.03k|    assign_itx16_fn(R, 16,  4, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  8.03k|    assign_itx16_fn(R, 16,  8, avx2);
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  8.03k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  8.03k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  8.03k|    assign_itx12_fn( , 16, 16, avx2);
  ------------------
  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   89|  8.03k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|  8.03k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|  8.03k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|  8.03k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|  8.03k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|  8.03k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   96|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|  8.03k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  8.03k|    assign_itx2_fn (R, 16, 32, avx2);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|  8.03k|    assign_itx1_fn (R, 16, 64, avx2);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  8.03k|    assign_itx2_fn (R, 32,  8, avx2);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  8.03k|    assign_itx2_fn (R, 32, 16, avx2);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  8.03k|    assign_itx2_fn ( , 32, 32, avx2);
  ------------------
  |  |   84|  8.03k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  8.03k|    assign_itx1_fn (R, 32, 64, avx2);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  8.03k|    assign_itx1_fn (R, 64, 16, avx2);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  8.03k|    assign_itx1_fn (R, 64, 32, avx2);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  8.03k|    assign_itx1_fn ( , 64, 64, avx2);
  ------------------
  |  |   81|  8.03k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|       |#else
  228|       |    if (bpc == 10) {
  229|       |        assign_itx16_bpc_fn( ,  4,  4, 10, avx2);
  230|       |        assign_itx16_bpc_fn(R,  4,  8, 10, avx2);
  231|       |        assign_itx16_bpc_fn(R,  4, 16, 10, avx2);
  232|       |        assign_itx16_bpc_fn(R,  8,  4, 10, avx2);
  233|       |        assign_itx16_bpc_fn( ,  8,  8, 10, avx2);
  234|       |        assign_itx16_bpc_fn(R,  8, 16, 10, avx2);
  235|       |        assign_itx2_bpc_fn (R,  8, 32, 10, avx2);
  236|       |        assign_itx16_bpc_fn(R, 16,  4, 10, avx2);
  237|       |        assign_itx16_bpc_fn(R, 16,  8, 10, avx2);
  238|       |        assign_itx12_bpc_fn( , 16, 16, 10, avx2);
  239|       |        assign_itx2_bpc_fn (R, 16, 32, 10, avx2);
  240|       |        assign_itx1_bpc_fn (R, 16, 64, 10, avx2);
  241|       |        assign_itx2_bpc_fn (R, 32,  8, 10, avx2);
  242|       |        assign_itx2_bpc_fn (R, 32, 16, 10, avx2);
  243|       |        assign_itx2_bpc_fn ( , 32, 32, 10, avx2);
  244|       |        assign_itx1_bpc_fn (R, 32, 64, 10, avx2);
  245|       |        assign_itx1_bpc_fn (R, 64, 16, 10, avx2);
  246|       |        assign_itx1_bpc_fn (R, 64, 32, 10, avx2);
  247|       |        assign_itx1_bpc_fn ( , 64, 64, 10, avx2);
  248|       |    } else {
  249|       |        assign_itx16_bpc_fn( ,  4,  4, 12, avx2);
  250|       |        assign_itx16_bpc_fn(R,  4,  8, 12, avx2);
  251|       |        assign_itx16_bpc_fn(R,  4, 16, 12, avx2);
  252|       |        assign_itx16_bpc_fn(R,  8,  4, 12, avx2);
  253|       |        assign_itx16_bpc_fn( ,  8,  8, 12, avx2);
  254|       |        assign_itx16_bpc_fn(R,  8, 16, 12, avx2);
  255|       |        assign_itx2_bpc_fn (R,  8, 32, 12, avx2);
  256|       |        assign_itx16_bpc_fn(R, 16,  4, 12, avx2);
  257|       |        assign_itx16_bpc_fn(R, 16,  8, 12, avx2);
  258|       |        assign_itx12_bpc_fn( , 16, 16, 12, avx2);
  259|       |        assign_itx2_bpc_fn (R, 32,  8, 12, avx2);
  260|       |        assign_itx_bpc_fn(R, 16, 32, identity_identity, IDTX, 12, avx2);
  261|       |        assign_itx_bpc_fn(R, 32, 16, identity_identity, IDTX, 12, avx2);
  262|       |        assign_itx_bpc_fn( , 32, 32, identity_identity, IDTX, 12, avx2);
  263|       |    }
  264|       |#endif
  265|       |
  266|  8.03k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (266:9): [True: 8.03k, False: 0]
  ------------------
  267|       |
  268|      0|#if BITDEPTH == 8
  269|  8.03k|    assign_itx16_fn( ,  4,  4, avx512icl); // no wht
  ------------------
  |  |  101|  8.03k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  8.03k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  8.03k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  8.03k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  8.03k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  8.03k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  8.03k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  8.03k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|      0|    assign_itx16_fn(R,  4,  8, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|    assign_itx16_fn(R,  4, 16, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|      0|    assign_itx16_fn(R,  8,  4, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|      0|    assign_itx16_fn( ,  8,  8, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|      0|    assign_itx16_fn(R,  8, 16, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|      0|    assign_itx2_fn (R,  8, 32, avx512icl);
  ------------------
  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|      0|    assign_itx16_fn(R, 16,  4, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|      0|    assign_itx16_fn(R, 16,  8, avx512icl);
  ------------------
  |  |  101|      0|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|      0|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|      0|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|      0|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|      0|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  278|      0|    assign_itx12_fn( , 16, 16, avx512icl);
  ------------------
  |  |   88|      0|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   89|      0|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|      0|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      0|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|      0|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|      0|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|      0|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   96|      0|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|      0|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|      0|    assign_itx2_fn (R, 16, 32, avx512icl);
  ------------------
  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|      0|    assign_itx1_fn (R, 16, 64, avx512icl);
  ------------------
  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|      0|    assign_itx2_fn (R, 32,  8, avx512icl);
  ------------------
  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|      0|    assign_itx2_fn (R, 32, 16, avx512icl);
  ------------------
  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|      0|    assign_itx2_fn ( , 32, 32, avx512icl);
  ------------------
  |  |   84|      0|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|      0|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|      0|    assign_itx1_fn (R, 32, 64, avx512icl);
  ------------------
  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|      0|    assign_itx1_fn (R, 64, 16, avx512icl);
  ------------------
  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|      0|    assign_itx1_fn (R, 64, 32, avx512icl);
  ------------------
  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|      0|    assign_itx1_fn ( , 64, 64, avx512icl);
  ------------------
  |  |   81|      0|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|      0|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|      0|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|       |#else
  289|       |    if (bpc == 10) {
  290|       |        assign_itx16_bpc_fn( ,  8,  8, 10, avx512icl);
  291|       |        assign_itx16_bpc_fn(R,  8, 16, 10, avx512icl);
  292|       |        assign_itx2_bpc_fn (R,  8, 32, 10, avx512icl);
  293|       |        assign_itx16_bpc_fn(R, 16,  8, 10, avx512icl);
  294|       |        assign_itx12_bpc_fn( , 16, 16, 10, avx512icl);
  295|       |        assign_itx2_bpc_fn (R, 16, 32, 10, avx512icl);
  296|       |        assign_itx2_bpc_fn (R, 32,  8, 10, avx512icl);
  297|       |        assign_itx2_bpc_fn (R, 32, 16, 10, avx512icl);
  298|       |        assign_itx2_bpc_fn ( , 32, 32, 10, avx512icl);
  299|       |        assign_itx1_bpc_fn (R, 16, 64, 10, avx512icl);
  300|       |        assign_itx1_bpc_fn (R, 32, 64, 10, avx512icl);
  301|       |        assign_itx1_bpc_fn (R, 64, 16, 10, avx512icl);
  302|       |        assign_itx1_bpc_fn (R, 64, 32, 10, avx512icl);
  303|       |        assign_itx1_bpc_fn ( , 64, 64, 10, avx512icl);
  304|       |    }
  305|       |#endif
  306|      0|#endif
  307|      0|}

loopfilter_tmpl.c:loop_filter_dsp_init_x86:
   41|  11.3k|static ALWAYS_INLINE void loop_filter_dsp_init_x86(Dav1dLoopFilterDSPContext *const c) {
   42|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   43|       |
   44|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (44:9): [True: 0, False: 11.3k]
  ------------------
   45|       |
   46|  11.3k|    c->loop_filter_sb[0][0] = BF(dav1d_lpf_h_sb_y, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   47|  11.3k|    c->loop_filter_sb[0][1] = BF(dav1d_lpf_v_sb_y, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   48|  11.3k|    c->loop_filter_sb[1][0] = BF(dav1d_lpf_h_sb_uv, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   49|  11.3k|    c->loop_filter_sb[1][1] = BF(dav1d_lpf_v_sb_uv, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   50|       |
   51|  11.3k|#if ARCH_X86_64
   52|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (52:9): [True: 0, False: 11.3k]
  ------------------
   53|       |
   54|  11.3k|    c->loop_filter_sb[0][0] = BF(dav1d_lpf_h_sb_y, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  11.3k|    c->loop_filter_sb[0][1] = BF(dav1d_lpf_v_sb_y, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  11.3k|    c->loop_filter_sb[1][0] = BF(dav1d_lpf_h_sb_uv, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  11.3k|    c->loop_filter_sb[1][1] = BF(dav1d_lpf_v_sb_uv, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   58|       |
   59|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (59:9): [True: 11.3k, False: 0]
  ------------------
   60|       |
   61|      0|    c->loop_filter_sb[0][1] = BF(dav1d_lpf_v_sb_y, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   62|      0|    c->loop_filter_sb[1][1] = BF(dav1d_lpf_v_sb_uv, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   63|       |
   64|      0|    if (!(flags & DAV1D_X86_CPU_FLAG_SLOW_GATHER)) {
  ------------------
  |  Branch (64:9): [True: 0, False: 0]
  ------------------
   65|      0|        c->loop_filter_sb[0][0] = BF(dav1d_lpf_h_sb_y, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   66|      0|        c->loop_filter_sb[1][0] = BF(dav1d_lpf_h_sb_uv, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   67|      0|    }
   68|      0|#endif
   69|      0|}

looprestoration_tmpl.c:loop_restoration_dsp_init_x86:
   50|  11.3k|static ALWAYS_INLINE void loop_restoration_dsp_init_x86(Dav1dLoopRestorationDSPContext *const c, const int bpc) {
   51|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   52|       |
   53|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (53:9): [True: 0, False: 11.3k]
  ------------------
   54|  11.3k|#if BITDEPTH == 8
   55|  11.3k|    c->wiener[0] = BF(dav1d_wiener_filter7, sse2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  11.3k|    c->wiener[1] = BF(dav1d_wiener_filter5, sse2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  11.3k|#endif
   58|       |
   59|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (59:9): [True: 0, False: 11.3k]
  ------------------
   60|  11.3k|    c->wiener[0] = BF(dav1d_wiener_filter7, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   61|  11.3k|    c->wiener[1] = BF(dav1d_wiener_filter5, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   62|  11.3k|    if (BITDEPTH == 8 || bpc == 10) {
  ------------------
  |  Branch (62:9): [True: 8.03k, Folded]
  |  Branch (62:26): [True: 1.61k, False: 1.73k]
  ------------------
   63|  9.65k|        c->sgr[0] = BF(dav1d_sgr_filter_5x5, ssse3);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   64|  9.65k|        c->sgr[1] = BF(dav1d_sgr_filter_3x3, ssse3);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   65|  9.65k|        c->sgr[2] = BF(dav1d_sgr_filter_mix, ssse3);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   66|  9.65k|    }
   67|       |
   68|  11.3k|#if ARCH_X86_64
   69|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (69:9): [True: 0, False: 11.3k]
  ------------------
   70|       |
   71|  11.3k|    c->wiener[0] = BF(dav1d_wiener_filter7, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   72|  11.3k|    c->wiener[1] = BF(dav1d_wiener_filter5, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   73|  11.3k|    if (BITDEPTH == 8 || bpc == 10) {
  ------------------
  |  Branch (73:9): [True: 8.03k, Folded]
  |  Branch (73:26): [True: 1.61k, False: 1.73k]
  ------------------
   74|  9.65k|        c->sgr[0] = BF(dav1d_sgr_filter_5x5, avx2);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   75|  9.65k|        c->sgr[1] = BF(dav1d_sgr_filter_3x3, avx2);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   76|  9.65k|        c->sgr[2] = BF(dav1d_sgr_filter_mix, avx2);
  ------------------
  |  |   52|  9.65k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   77|  9.65k|    }
   78|       |
   79|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (79:9): [True: 11.3k, False: 0]
  ------------------
   80|       |
   81|      0|    c->wiener[0] = BF(dav1d_wiener_filter7, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   82|      0|#if BITDEPTH == 8
   83|       |    /* With VNNI we don't need a 5-tap version. */
   84|      0|    c->wiener[1] = c->wiener[0];
   85|       |#else
   86|       |    c->wiener[1] = BF(dav1d_wiener_filter5, avx512icl);
   87|       |#endif
   88|      0|    if (BITDEPTH == 8 || bpc == 10) {
  ------------------
  |  Branch (88:9): [True: 0, Folded]
  |  Branch (88:26): [True: 0, False: 0]
  ------------------
   89|      0|        c->sgr[0] = BF(dav1d_sgr_filter_5x5, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   90|      0|        c->sgr[1] = BF(dav1d_sgr_filter_3x3, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   91|      0|        c->sgr[2] = BF(dav1d_sgr_filter_mix, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   92|      0|    }
   93|      0|#endif
   94|      0|}

mc_tmpl.c:mc_dsp_init_x86:
   92|  11.3k|static ALWAYS_INLINE void mc_dsp_init_x86(Dav1dMCDSPContext *const c) {
   93|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   94|       |
   95|  11.3k|    if(!(flags & DAV1D_X86_CPU_FLAG_SSSE3))
  ------------------
  |  Branch (95:8): [True: 0, False: 11.3k]
  ------------------
   96|      0|        return;
   97|       |
   98|  11.3k|    init_8tap_fns(ssse3);
  ------------------
  |  |  143|  11.3k|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|  11.3k|    init_8tap_gen(mct, opt)
  |  |  ------------------
  |  |  |  |  132|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|       |
  100|  11.3k|    init_mc_fn(FILTER_2D_BILINEAR,             bilin,               ssse3);
  ------------------
  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  101|  11.3k|    init_mct_fn(FILTER_2D_BILINEAR,            bilin,               ssse3);
  ------------------
  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  102|       |
  103|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  104|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  105|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  106|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  107|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  108|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  109|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  110|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  111|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  112|  11.3k|    init_mc_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               ssse3);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  113|       |
  114|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  115|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  116|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  117|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  118|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  119|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  120|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  121|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  122|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  123|  11.3k|    init_mct_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               ssse3);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  124|       |
  125|  11.3k|    c->avg = BF(dav1d_avg, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  126|  11.3k|    c->w_avg = BF(dav1d_w_avg, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  127|  11.3k|    c->mask = BF(dav1d_mask, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  128|  11.3k|    c->w_mask[0] = BF(dav1d_w_mask_444, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  129|  11.3k|    c->w_mask[1] = BF(dav1d_w_mask_422, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  130|  11.3k|    c->w_mask[2] = BF(dav1d_w_mask_420, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  131|  11.3k|    c->blend = BF(dav1d_blend, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  132|  11.3k|    c->blend_v = BF(dav1d_blend_v, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  133|  11.3k|    c->blend_h = BF(dav1d_blend_h, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  134|  11.3k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  135|  11.3k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  136|  11.3k|    c->emu_edge = BF(dav1d_emu_edge, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  137|  11.3k|    c->resize = BF(dav1d_resize, ssse3);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  138|       |
  139|  11.3k|    if(!(flags & DAV1D_X86_CPU_FLAG_SSE41))
  ------------------
  |  Branch (139:8): [True: 0, False: 11.3k]
  ------------------
  140|      0|        return;
  141|       |
  142|  11.3k|#if BITDEPTH == 8
  143|  11.3k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, sse4);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  144|  11.3k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, sse4);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  145|  11.3k|#endif
  146|       |
  147|  11.3k|#if ARCH_X86_64
  148|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2))
  ------------------
  |  Branch (148:9): [True: 0, False: 11.3k]
  ------------------
  149|      0|        return;
  150|       |
  151|  11.3k|    init_8tap_fns(avx2);
  ------------------
  |  |  143|  11.3k|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|  11.3k|    init_8tap_gen(mct, opt)
  |  |  ------------------
  |  |  |  |  132|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|       |
  153|  11.3k|    init_mc_fn(FILTER_2D_BILINEAR,            bilin,               avx2);
  ------------------
  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  154|  11.3k|    init_mct_fn(FILTER_2D_BILINEAR,           bilin,               avx2);
  ------------------
  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  155|       |
  156|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  157|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  158|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  159|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  160|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  161|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  162|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  163|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  164|  11.3k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  165|  11.3k|    init_mc_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               avx2);
  ------------------
  |  |   40|  11.3k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  166|       |
  167|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  168|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  169|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  170|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  171|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  172|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  173|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  174|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  175|  11.3k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  176|  11.3k|    init_mct_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               avx2);
  ------------------
  |  |   42|  11.3k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  177|       |
  178|  11.3k|    c->avg = BF(dav1d_avg, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  179|  11.3k|    c->w_avg = BF(dav1d_w_avg, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  180|  11.3k|    c->mask = BF(dav1d_mask, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  181|  11.3k|    c->w_mask[0] = BF(dav1d_w_mask_444, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  182|  11.3k|    c->w_mask[1] = BF(dav1d_w_mask_422, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  183|  11.3k|    c->w_mask[2] = BF(dav1d_w_mask_420, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  184|  11.3k|    c->blend = BF(dav1d_blend, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  185|  11.3k|    c->blend_v = BF(dav1d_blend_v, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  186|  11.3k|    c->blend_h = BF(dav1d_blend_h, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  187|  11.3k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  188|  11.3k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  189|  11.3k|    c->emu_edge = BF(dav1d_emu_edge, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  190|  11.3k|    c->resize = BF(dav1d_resize, avx2);
  ------------------
  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  191|       |
  192|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL))
  ------------------
  |  Branch (192:9): [True: 11.3k, False: 0]
  ------------------
  193|  11.3k|        return;
  194|       |
  195|  11.3k|    init_8tap_fns(avx512icl);
  ------------------
  |  |  143|      0|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|      0|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|      0|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|      0|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|      0|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|      0|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|      0|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|      0|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|      0|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  11.3k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|      0|    init_8tap_gen(mct, opt)
  |  |  ------------------
  |  |  |  |  132|      0|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  11.3k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  11.3k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  11.3k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|       |
  197|      0|    init_mc_fn (FILTER_2D_BILINEAR,            bilin,               avx512icl);
  ------------------
  |  |   36|      0|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  198|      0|    init_mct_fn(FILTER_2D_BILINEAR,            bilin,               avx512icl);
  ------------------
  |  |   38|      0|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  199|       |
  200|      0|    c->avg = BF(dav1d_avg, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  201|      0|    c->w_avg = BF(dav1d_w_avg, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  202|      0|    c->mask = BF(dav1d_mask, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  203|      0|    c->w_mask[0] = BF(dav1d_w_mask_444, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  204|      0|    c->w_mask[1] = BF(dav1d_w_mask_422, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  205|      0|    c->w_mask[2] = BF(dav1d_w_mask_420, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  206|      0|    c->blend = BF(dav1d_blend, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  207|      0|    c->blend_v = BF(dav1d_blend_v, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  208|      0|    c->blend_h = BF(dav1d_blend_h, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  209|       |
  210|      0|    if (!(flags & DAV1D_X86_CPU_FLAG_SLOW_GATHER)) {
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  ------------------
  211|      0|        c->resize = BF(dav1d_resize, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  212|      0|        c->warp8x8  = BF(dav1d_warp_affine_8x8, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  213|      0|        c->warp8x8t = BF(dav1d_warp_affine_8x8t, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  214|      0|    }
  215|      0|#endif
  216|      0|}

msac.c:msac_init_x86:
   59|  72.6k|static ALWAYS_INLINE void msac_init_x86(MsacContext *const s) {
   60|  72.6k|    const unsigned flags = dav1d_get_cpu_flags();
   61|       |
   62|  72.6k|    if (flags & DAV1D_X86_CPU_FLAG_SSE2) {
  ------------------
  |  Branch (62:9): [True: 72.6k, False: 0]
  ------------------
   63|  72.6k|        s->symbol_adapt16 = dav1d_msac_decode_symbol_adapt16_sse2;
   64|  72.6k|    }
   65|       |
   66|  72.6k|    if (flags & DAV1D_X86_CPU_FLAG_AVX2) {
  ------------------
  |  Branch (66:9): [True: 72.6k, False: 0]
  ------------------
   67|  72.6k|        s->symbol_adapt16 = dav1d_msac_decode_symbol_adapt16_avx2;
   68|  72.6k|    }
   69|  72.6k|}

pal.c:pal_dsp_init_x86:
   34|  11.3k|static ALWAYS_INLINE void pal_dsp_init_x86(Dav1dPalDSPContext *const c) {
   35|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   36|       |
   37|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (37:9): [True: 0, False: 11.3k]
  ------------------
   38|       |
   39|  11.3k|    c->pal_idx_finish = dav1d_pal_idx_finish_ssse3;
   40|       |
   41|  11.3k|#if ARCH_X86_64
   42|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (42:9): [True: 0, False: 11.3k]
  ------------------
   43|       |
   44|  11.3k|    c->pal_idx_finish = dav1d_pal_idx_finish_avx2;
   45|       |
   46|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (46:9): [True: 11.3k, False: 0]
  ------------------
   47|       |
   48|      0|    c->pal_idx_finish = dav1d_pal_idx_finish_avx512icl;
   49|      0|#endif
   50|      0|}

refmvs.c:refmvs_dsp_init_x86:
   41|  11.3k|static ALWAYS_INLINE void refmvs_dsp_init_x86(Dav1dRefmvsDSPContext *const c) {
   42|  11.3k|    const unsigned flags = dav1d_get_cpu_flags();
   43|       |
   44|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (44:9): [True: 0, False: 11.3k]
  ------------------
   45|       |
   46|  11.3k|    c->splat_mv = dav1d_splat_mv_sse2;
   47|       |
   48|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (48:9): [True: 0, False: 11.3k]
  ------------------
   49|       |
   50|  11.3k|    c->save_tmvs = dav1d_save_tmvs_ssse3;
   51|       |
   52|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (52:9): [True: 0, False: 11.3k]
  ------------------
   53|  11.3k|#if ARCH_X86_64
   54|  11.3k|    c->load_tmvs = dav1d_load_tmvs_sse4;
   55|       |
   56|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (56:9): [True: 0, False: 11.3k]
  ------------------
   57|       |
   58|  11.3k|    c->save_tmvs = dav1d_save_tmvs_avx2;
   59|  11.3k|    c->splat_mv = dav1d_splat_mv_avx2;
   60|       |
   61|  11.3k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (61:9): [True: 11.3k, False: 0]
  ------------------
   62|       |
   63|      0|    c->save_tmvs = dav1d_save_tmvs_avx512icl;
   64|      0|    c->splat_mv = dav1d_splat_mv_avx512icl;
   65|      0|#endif
   66|      0|}

cpu_id.cc:_ZN6libyuvL11SetCpuFlagsEi:
  128|      1|static __inline void SetCpuFlags(int cpu_flags) {
  129|      1|  LIBYUV_API extern int cpu_info_;
  130|      1|#ifdef __ATOMIC_RELAXED
  131|      1|  __atomic_store_n(&cpu_info_, cpu_flags, __ATOMIC_RELAXED);
  132|       |#else
  133|       |  cpu_info_ = cpu_flags;
  134|       |#endif
  135|      1|}
planar_functions.cc:_ZN6libyuvL11TestCpuFlagEi:
   78|    264|static __inline int TestCpuFlag(int test_flag) {
   79|    264|  LIBYUV_API extern int cpu_info_;
   80|    264|#ifdef __ATOMIC_RELAXED
   81|    264|  int cpu_info = __atomic_load_n(&cpu_info_, __ATOMIC_RELAXED);
   82|       |#else
   83|       |  int cpu_info = cpu_info_;
   84|       |#endif
   85|    264|  return (!cpu_info ? InitCpuFlags() : cpu_info) & test_flag;
  ------------------
  |  Branch (85:11): [True: 0, False: 264]
  ------------------
   86|    264|}
scale.cc:_ZN6libyuvL11TestCpuFlagEi:
   78|  80.2k|static __inline int TestCpuFlag(int test_flag) {
   79|  80.2k|  LIBYUV_API extern int cpu_info_;
   80|  80.2k|#ifdef __ATOMIC_RELAXED
   81|  80.2k|  int cpu_info = __atomic_load_n(&cpu_info_, __ATOMIC_RELAXED);
   82|       |#else
   83|       |  int cpu_info = cpu_info_;
   84|       |#endif
   85|  80.2k|  return (!cpu_info ? InitCpuFlags() : cpu_info) & test_flag;
  ------------------
  |  Branch (85:11): [True: 1, False: 80.2k]
  ------------------
   86|  80.2k|}
scale_common.cc:_ZN6libyuvL11TestCpuFlagEi:
   78|    400|static __inline int TestCpuFlag(int test_flag) {
   79|    400|  LIBYUV_API extern int cpu_info_;
   80|    400|#ifdef __ATOMIC_RELAXED
   81|    400|  int cpu_info = __atomic_load_n(&cpu_info_, __ATOMIC_RELAXED);
   82|       |#else
   83|       |  int cpu_info = cpu_info_;
   84|       |#endif
   85|    400|  return (!cpu_info ? InitCpuFlags() : cpu_info) & test_flag;
  ------------------
  |  Branch (85:11): [True: 0, False: 400]
  ------------------
   86|    400|}

CpuId:
   64|      5|void CpuId(int info_eax, int info_ecx, int* cpu_info) {
   65|       |#if defined(_MSC_VER)
   66|       |// Visual C version uses intrinsic or inline x86 assembly.
   67|       |#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219)
   68|       |  __cpuidex(cpu_info, info_eax, info_ecx);
   69|       |#elif defined(_M_IX86)
   70|       |  __asm {
   71|       |    mov        eax, info_eax
   72|       |    mov        ecx, info_ecx
   73|       |    mov        edi, cpu_info
   74|       |    cpuid
   75|       |    mov        [edi], eax
   76|       |    mov        [edi + 4], ebx
   77|       |    mov        [edi + 8], ecx
   78|       |    mov        [edi + 12], edx
   79|       |  }
   80|       |#else  // Visual C but not x86
   81|       |  if (info_ecx == 0) {
   82|       |    __cpuid(cpu_info, info_eax);
   83|       |  } else {
   84|       |    cpu_info[3] = cpu_info[2] = cpu_info[1] = cpu_info[0] = 0u;
   85|       |  }
   86|       |#endif
   87|       |// GCC version uses inline x86 assembly.
   88|       |#else  // defined(_MSC_VER)
   89|      5|  int info_ebx, info_edx;
   90|      5|  asm volatile(
   91|       |#if defined(__i386__) && defined(__PIC__)
   92|       |      // Preserve ebx for fpic 32 bit.
   93|       |      "mov         %%ebx, %%edi                  \n"
   94|       |      "cpuid                                     \n"
   95|       |      "xchg        %%edi, %%ebx                  \n"
   96|       |      : "=D"(info_ebx),
   97|       |#else
   98|      5|      "cpuid                                     \n"
   99|      5|      : "=b"(info_ebx),
  100|      5|#endif  //  defined( __i386__) && defined(__PIC__)
  101|      5|        "+a"(info_eax), "+c"(info_ecx), "=d"(info_edx));
  102|      5|  cpu_info[0] = info_eax;
  103|      5|  cpu_info[1] = info_ebx;
  104|      5|  cpu_info[2] = info_ecx;
  105|      5|  cpu_info[3] = info_edx;
  106|      5|#endif  // defined(_MSC_VER)
  107|      5|}
MaskCpuFlags:
  492|      1|int MaskCpuFlags(int enable_flags) {
  493|      1|  int cpu_info = GetCpuFlags() & enable_flags;
  494|      1|  SetCpuFlags(cpu_info);
  495|      1|  return cpu_info;
  496|      1|}
InitCpuFlags:
  499|      1|int InitCpuFlags(void) {
  500|      1|  return MaskCpuFlags(-1);
  501|      1|}
cpu_id.cc:_ZN6libyuvL11GetCpuFlagsEv:
  390|      1|static SAFEBUFFERS int GetCpuFlags(void) {
  391|      1|  int cpu_info = 0;
  392|      1|#if !defined(__pnacl__) && !defined(__CLR_VER) &&                   \
  393|      1|    (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
  394|      1|     defined(_M_IX86))
  395|      1|  int cpu_info0[4] = {0, 0, 0, 0};
  396|      1|  int cpu_info1[4] = {0, 0, 0, 0};
  397|      1|  int cpu_info7[4] = {0, 0, 0, 0};
  398|      1|  int cpu_einfo7[4] = {0, 0, 0, 0};
  399|      1|  int cpu_info24[4] = {0, 0, 0, 0};
  400|      1|  int cpu_info21[4] = {0, 0, 0, 0};
  401|      1|  int cpu_amdinfo21[4] = {0, 0, 0, 0};
  402|      1|  CpuId(0, 0, cpu_info0);
  403|      1|  CpuId(1, 0, cpu_info1);
  404|      1|  if (cpu_info0[0] >= 7) {
  ------------------
  |  Branch (404:7): [True: 1, False: 0]
  ------------------
  405|      1|    CpuId(7, 0, cpu_info7);
  406|      1|    CpuId(7, 1, cpu_einfo7);
  407|      1|    CpuId(0x80000021, 0, cpu_amdinfo21);
  408|      1|  }
  409|      1|  if (cpu_info0[0] >= 0x21) {
  ------------------
  |  Branch (409:7): [True: 0, False: 1]
  ------------------
  410|      0|    CpuId(0x21, 0, cpu_info21);
  411|      0|  }
  412|      1|  if (cpu_info0[0] >= 0x24) {
  ------------------
  |  Branch (412:7): [True: 0, False: 1]
  ------------------
  413|      0|    CpuId(0x24, 0, cpu_info24);
  414|      0|  }
  415|      1|  cpu_info = kCpuHasX86 | ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) |
  ------------------
  |  Branch (415:28): [True: 1, False: 0]
  ------------------
  416|      1|             ((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) |
  ------------------
  |  Branch (416:15): [True: 1, False: 0]
  ------------------
  417|      1|             ((cpu_info1[2] & 0x00080000) ? kCpuHasSSE41 : 0) |
  ------------------
  |  Branch (417:15): [True: 1, False: 0]
  ------------------
  418|      1|             ((cpu_info1[2] & 0x00100000) ? kCpuHasSSE42 : 0) |
  ------------------
  |  Branch (418:15): [True: 1, False: 0]
  ------------------
  419|      1|             ((cpu_info7[1] & 0x00000200) ? kCpuHasERMS : 0) |
  ------------------
  |  Branch (419:15): [True: 1, False: 0]
  ------------------
  420|      1|             ((cpu_info7[3] & 0x00000010) ? kCpuHasFSMR : 0);
  ------------------
  |  Branch (420:15): [True: 0, False: 1]
  ------------------
  421|       |
  422|       |  // AVX requires OS saves YMM registers.
  423|      1|  if (((cpu_info1[2] & 0x1c000000) == 0x1c000000) &&  // AVX and OSXSave
  ------------------
  |  Branch (423:7): [True: 1, False: 0]
  ------------------
  424|      1|      ((GetXCR0() & 6) == 6)) {  // Test OS saves YMM registers
  ------------------
  |  Branch (424:7): [True: 1, False: 0]
  ------------------
  425|      1|    cpu_info |= kCpuHasAVX | ((cpu_info7[1] & 0x00000020) ? kCpuHasAVX2 : 0) |
  ------------------
  |  Branch (425:31): [True: 1, False: 0]
  ------------------
  426|      1|                ((cpu_info1[2] & 0x00001000) ? kCpuHasFMA3 : 0) |
  ------------------
  |  Branch (426:18): [True: 1, False: 0]
  ------------------
  427|      1|                ((cpu_info1[2] & 0x20000000) ? kCpuHasF16C : 0) |
  ------------------
  |  Branch (427:18): [True: 1, False: 0]
  ------------------
  428|      1|                ((cpu_einfo7[0] & 0x00000010) ? kCpuHasAVXVNNI : 0) |
  ------------------
  |  Branch (428:18): [True: 0, False: 1]
  ------------------
  429|      1|                ((cpu_einfo7[3] & 0x00000010) ? kCpuHasAVXVNNIINT8 : 0);
  ------------------
  |  Branch (429:18): [True: 0, False: 1]
  ------------------
  430|       |
  431|      1|    cpu_info |= ((cpu_amdinfo21[0] & 0x00008000) ? kCpuHasERMS : 0);
  ------------------
  |  Branch (431:18): [True: 0, False: 1]
  ------------------
  432|       |
  433|       |    // Detect AVX512bw
  434|      1|    if ((GetXCR0() & 0xe0) == 0xe0 && (cpu_info7[1] & 0x00010000)) {
  ------------------
  |  Branch (434:9): [True: 0, False: 1]
  |  Branch (434:39): [True: 0, False: 0]
  ------------------
  435|      0|      cpu_info |= ((cpu_info7[1] & 0x40000000) ? kCpuHasAVX512BW : 0) |
  ------------------
  |  Branch (435:20): [True: 0, False: 0]
  ------------------
  436|      0|                  ((cpu_info7[1] & 0x80000000) ? kCpuHasAVX512VL : 0) |
  ------------------
  |  Branch (436:20): [True: 0, False: 0]
  ------------------
  437|      0|                  ((cpu_info7[2] & 0x00000002) ? kCpuHasAVX512VBMI : 0) |
  ------------------
  |  Branch (437:20): [True: 0, False: 0]
  ------------------
  438|      0|                  ((cpu_info7[2] & 0x00000040) ? kCpuHasAVX512VBMI2 : 0) |
  ------------------
  |  Branch (438:20): [True: 0, False: 0]
  ------------------
  439|      0|                  ((cpu_info7[2] & 0x00000800) ? kCpuHasAVX512VNNI : 0) |
  ------------------
  |  Branch (439:20): [True: 0, False: 0]
  ------------------
  440|      0|                  ((cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0) |
  ------------------
  |  Branch (440:20): [True: 0, False: 0]
  ------------------
  441|      0|                  ((cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0) |
  ------------------
  |  Branch (441:20): [True: 0, False: 0]
  ------------------
  442|      0|                  ((cpu_info7[3] & 0x02000000) ? kCpuHasAMXINT8 : 0) |
  ------------------
  |  Branch (442:20): [True: 0, False: 0]
  ------------------
  443|      0|                  ((cpu_info21[0] & 0x00800000) ? kCpuHasAVX512BMM : 0);
  ------------------
  |  Branch (443:20): [True: 0, False: 0]
  ------------------
  444|      0|      if (cpu_info0[0] >= 0x24 && (cpu_einfo7[3] & 0x00080000)) {
  ------------------
  |  Branch (444:11): [True: 0, False: 0]
  |  Branch (444:35): [True: 0, False: 0]
  ------------------
  445|      0|        cpu_info |= ((cpu_info24[1] & 0xFF) >= 2) ? kCpuHasAVX10_2 : 0;
  ------------------
  |  Branch (445:21): [True: 0, False: 0]
  ------------------
  446|      0|      }
  447|      0|    }
  448|      1|  }
  449|      1|#endif
  450|       |#if defined(__loongarch__) && defined(__linux__)
  451|       |  cpu_info = LoongArchCpuCaps();
  452|       |  cpu_info |= kCpuHasLOONGARCH;
  453|       |#endif
  454|       |#if defined(__aarch64__)
  455|       |#if defined(__linux__)
  456|       |  // getauxval is supported since Android SDK version 18, minimum at time of
  457|       |  // writing is 21, so should be safe to always use this. If getauxval is
  458|       |  // somehow disabled then getauxval returns 0, which will leave Neon enabled
  459|       |  // since Neon is mandatory on AArch64.
  460|       |  unsigned long hwcap = getauxval(AT_HWCAP);
  461|       |  unsigned long hwcap2 = getauxval(AT_HWCAP2);
  462|       |  cpu_info = AArch64CpuCaps(hwcap, hwcap2);
  463|       |#else
  464|       |  cpu_info = AArch64CpuCaps();
  465|       |#endif
  466|       |  cpu_info |= kCpuHasARM;
  467|       |#endif  // __aarch64__
  468|       |#if defined(__arm__)
  469|       |  // gcc -mfpu=neon defines __ARM_NEON__
  470|       |  // __ARM_NEON__ generates code that requires Neon.  NaCL also requires Neon.
  471|       |  // For Linux, /proc/cpuinfo can be tested but without that assume Neon.
  472|       |  // Linux arm parse text file for neon detect.
  473|       |#if defined(__linux__)
  474|       |  cpu_info = ArmCpuCaps("/proc/cpuinfo");
  475|       |#elif defined(__ARM_NEON__)
  476|       |  cpu_info = kCpuHasNEON;
  477|       |#else
  478|       |  cpu_info = 0;
  479|       |#endif
  480|       |  cpu_info |= kCpuHasARM;
  481|       |#endif  // __arm__
  482|       |#if defined(__riscv) && defined(__linux__)
  483|       |  cpu_info = RiscvCpuCaps("/proc/cpuinfo");
  484|       |  cpu_info |= kCpuHasRISCV;
  485|       |#endif  // __riscv
  486|      1|  cpu_info |= kCpuInitialized;
  487|      1|  return cpu_info;
  488|      1|}
cpu_id.cc:_ZN6libyuvL7GetXCR0Ev:
  133|      2|static int GetXCR0() {
  134|      2|  int xcr0 = 0;
  135|       |#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219)
  136|       |  xcr0 = (int)_xgetbv(0);  // VS2010 SP1 required.  NOLINT
  137|       |#elif defined(__i386__) || defined(__x86_64__)
  138|       |  asm(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr0) : "c"(0) : "%edx");
  139|      2|#endif  // defined(__i386__) || defined(__x86_64__)
  140|      2|  return xcr0;
  141|      2|}

CopyPlane:
   34|     66|               int height) {
   35|     66|  int y;
   36|     66|  void (*CopyRow)(const uint8_t* src, uint8_t* dst, int width) = CopyRow_C;
   37|     66|  if (width <= 0 || height == 0 || height == INT_MIN) {
  ------------------
  |  Branch (37:7): [True: 0, False: 66]
  |  Branch (37:21): [True: 0, False: 66]
  |  Branch (37:36): [True: 0, False: 66]
  ------------------
   38|      0|    return;
   39|      0|  }
   40|       |  // Negative height means invert the image.
   41|     66|  if (height < 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 66]
  ------------------
   42|      0|    height = -height;
   43|      0|    dst_y = dst_y + (ptrdiff_t)(height - 1) * dst_stride_y;
   44|      0|    dst_stride_y = -dst_stride_y;
   45|      0|  }
   46|       |  // Coalesce rows.
   47|     66|  if (src_stride_y == width && dst_stride_y == width &&
  ------------------
  |  Branch (47:7): [True: 0, False: 66]
  |  Branch (47:32): [True: 0, False: 0]
  ------------------
   48|      0|      (ptrdiff_t)width * height <= INT_MAX) {
  ------------------
  |  Branch (48:7): [True: 0, False: 0]
  ------------------
   49|      0|    width *= height;
   50|      0|    height = 1;
   51|      0|    src_stride_y = dst_stride_y = 0;
   52|      0|  }
   53|       |  // Nothing to do.
   54|     66|  if (src_y == dst_y && src_stride_y == dst_stride_y) {
  ------------------
  |  Branch (54:7): [True: 0, False: 66]
  |  Branch (54:25): [True: 0, False: 0]
  ------------------
   55|      0|    return;
   56|      0|  }
   57|       |
   58|     66|#if defined(HAS_COPYROW_SSE2)
   59|     66|  if (TestCpuFlag(kCpuHasSSE2)) {
  ------------------
  |  Branch (59:7): [True: 66, False: 0]
  ------------------
   60|     66|    CopyRow = IS_ALIGNED(width, 32) ? CopyRow_SSE2 : CopyRow_Any_SSE2;
  ------------------
  |  | 1002|     66|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 0, False: 66]
  |  |  ------------------
  ------------------
   61|     66|  }
   62|     66|#endif
   63|     66|#if defined(HAS_COPYROW_AVX)
   64|     66|  if (TestCpuFlag(kCpuHasAVX)) {
  ------------------
  |  Branch (64:7): [True: 66, False: 0]
  ------------------
   65|     66|    CopyRow = IS_ALIGNED(width, 64) ? CopyRow_AVX : CopyRow_Any_AVX;
  ------------------
  |  | 1002|     66|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 0, False: 66]
  |  |  ------------------
  ------------------
   66|     66|  }
   67|     66|#endif
   68|     66|#if defined(HAS_COPYROW_AVX512BW)
   69|     66|  if (TestCpuFlag(kCpuHasAVX512BW)) {
  ------------------
  |  Branch (69:7): [True: 0, False: 66]
  ------------------
   70|      0|    CopyRow = IS_ALIGNED(width, 128) ? CopyRow_AVX512BW : CopyRow_Any_AVX512BW;
  ------------------
  |  | 1002|      0|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   71|      0|  }
   72|     66|#endif
   73|     66|#if defined(HAS_COPYROW_ERMS)
   74|     66|  if (TestCpuFlag(kCpuHasERMS)) {
  ------------------
  |  Branch (74:7): [True: 66, False: 0]
  ------------------
   75|     66|    CopyRow = CopyRow_ERMS;
   76|     66|  }
   77|     66|#endif
   78|       |#if defined(HAS_COPYROW_NEON)
   79|       |  if (TestCpuFlag(kCpuHasNEON)) {
   80|       |    CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON;
   81|       |  }
   82|       |#endif
   83|       |#if defined(HAS_COPYROW_SVE2)
   84|       |  if (TestCpuFlag(kCpuHasSVE2)) {
   85|       |    CopyRow = CopyRow_SVE2;
   86|       |  }
   87|       |#endif
   88|       |#if defined(HAS_COPYROW_SME)
   89|       |  if (TestCpuFlag(kCpuHasSME)) {
   90|       |    CopyRow = CopyRow_SME;
   91|       |  }
   92|       |#endif
   93|       |#if defined(HAS_COPYROW_RVV)
   94|       |  if (TestCpuFlag(kCpuHasRVV)) {
   95|       |    CopyRow = CopyRow_RVV;
   96|       |  }
   97|       |#endif
   98|       |
   99|       |  // Copy plane
  100|    330|  for (y = 0; y < height; ++y) {
  ------------------
  |  Branch (100:15): [True: 264, False: 66]
  ------------------
  101|    264|    CopyRow(src_y, dst_y, width);
  102|    264|    src_y += src_stride_y;
  103|    264|    dst_y += dst_stride_y;
  104|    264|  }
  105|     66|}
CopyPlane_16:
  113|     32|                  int height) {
  114|     32|  CopyPlane((const uint8_t*)src_y, src_stride_y * 2, (uint8_t*)dst_y,
  115|     32|            dst_stride_y * 2, width * 2, height);
  116|     32|}

InterpolateRow_Any_AVX2:
 1707|  1.53M|               int width, int source_y_fraction) {                   \
 1708|  1.53M|    SIMD_ALIGNED(TS vin[64 * 2]);                                    \
  ------------------
  |  |  927|  1.53M|#define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
  ------------------
 1709|  1.53M|    static_assert((MASK + 1) * SBPP * sizeof(TS) <= sizeof(vin) / 2, \
 1710|  1.53M|                  "vin buffer too small");                           \
 1711|  1.53M|    SIMD_ALIGNED(TD vout[64]);                                       \
  ------------------
  |  |  927|  1.53M|#define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
  ------------------
 1712|  1.53M|    static_assert((MASK + 1) * BPP * sizeof(TD) <= sizeof(vout),     \
 1713|  1.53M|                  "vout buffer too small");                          \
 1714|  1.53M|    memset(vin, 0, sizeof(vin)); /* for msan */                      \
 1715|  1.53M|    int r = width & MASK;                                            \
 1716|  1.53M|    int n = width & ~MASK;                                           \
 1717|  1.53M|    if (n > 0) {                                                     \
  ------------------
  |  Branch (1717:9): [True: 906k, False: 630k]
  ------------------
 1718|   906k|      ANY_SIMD(dst_ptr, src_ptr, src_stride, n, source_y_fraction);  \
 1719|   906k|    }                                                                \
 1720|  1.53M|    ptrdiff_t np = n;                                                \
 1721|  1.53M|    memcpy(vin, src_ptr + np * SBPP, r * SBPP * sizeof(TS));         \
 1722|  1.53M|    if (source_y_fraction) {                                         \
  ------------------
  |  Branch (1722:9): [True: 1.49M, False: 37.9k]
  ------------------
 1723|  1.49M|      memcpy(vin + 64, src_ptr + src_stride + np * SBPP,             \
 1724|  1.49M|             r * SBPP * sizeof(TS));                                 \
 1725|  1.49M|    }                                                                \
 1726|  1.53M|    ANY_SIMD(vout, vin, 64, MASK + 1, source_y_fraction);            \
 1727|  1.53M|    memcpy(dst_ptr + np * BPP, vout, r * BPP * sizeof(TD));          \
 1728|  1.53M|  }
InterpolateRow_16_Any_AVX2:
 1707|   540k|               int width, int source_y_fraction) {                   \
 1708|   540k|    SIMD_ALIGNED(TS vin[64 * 2]);                                    \
  ------------------
  |  |  927|   540k|#define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
  ------------------
 1709|   540k|    static_assert((MASK + 1) * SBPP * sizeof(TS) <= sizeof(vin) / 2, \
 1710|   540k|                  "vin buffer too small");                           \
 1711|   540k|    SIMD_ALIGNED(TD vout[64]);                                       \
  ------------------
  |  |  927|   540k|#define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
  ------------------
 1712|   540k|    static_assert((MASK + 1) * BPP * sizeof(TD) <= sizeof(vout),     \
 1713|   540k|                  "vout buffer too small");                          \
 1714|   540k|    memset(vin, 0, sizeof(vin)); /* for msan */                      \
 1715|   540k|    int r = width & MASK;                                            \
 1716|   540k|    int n = width & ~MASK;                                           \
 1717|   540k|    if (n > 0) {                                                     \
  ------------------
  |  Branch (1717:9): [True: 119k, False: 420k]
  ------------------
 1718|   119k|      ANY_SIMD(dst_ptr, src_ptr, src_stride, n, source_y_fraction);  \
 1719|   119k|    }                                                                \
 1720|   540k|    ptrdiff_t np = n;                                                \
 1721|   540k|    memcpy(vin, src_ptr + np * SBPP, r * SBPP * sizeof(TS));         \
 1722|   540k|    if (source_y_fraction) {                                         \
  ------------------
  |  Branch (1722:9): [True: 525k, False: 15.0k]
  ------------------
 1723|   525k|      memcpy(vin + 64, src_ptr + src_stride + np * SBPP,             \
 1724|   525k|             r * SBPP * sizeof(TS));                                 \
 1725|   525k|    }                                                                \
 1726|   540k|    ANY_SIMD(vout, vin, 64, MASK + 1, source_y_fraction);            \
 1727|   540k|    memcpy(dst_ptr + np * BPP, vout, r * BPP * sizeof(TD));          \
 1728|   540k|  }

CopyRow_ERMS:
 6919|    264|void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width) {
 6920|    264|  size_t width_tmp = (size_t)(width);
 6921|    264|  asm volatile("rep         movsb                         \n"
 6922|    264|               : "+S"(src),       // %0
 6923|    264|                 "+D"(dst),       // %1
 6924|    264|                 "+c"(width_tmp)  // %2
 6925|    264|               :
 6926|    264|               : "memory", "cc");
 6927|    264|}
InterpolateRow_AVX2:
 9035|  2.51M|                         int source_y_fraction) {
 9036|  2.51M|  asm volatile(
 9037|  2.51M|      "sub         %1,%0                         \n"
 9038|  2.51M|      "cmp         $0x0,%3                       \n"
 9039|  2.51M|      "je          100f                          \n"
 9040|  2.51M|      "cmp         $0x80,%3                      \n"
 9041|  2.51M|      "je          50f                           \n"
 9042|       |
 9043|  2.51M|      "vmovd       %3,%%xmm0                     \n"
 9044|  2.51M|      "neg         %3                            \n"
 9045|  2.51M|      "add         $0x100,%3                     \n"
 9046|  2.51M|      "vmovd       %3,%%xmm5                     \n"
 9047|  2.51M|      "vpunpcklbw  %%xmm0,%%xmm5,%%xmm5          \n"
 9048|  2.51M|      "vpunpcklwd  %%xmm5,%%xmm5,%%xmm5          \n"
 9049|  2.51M|      "vbroadcastss %%xmm5,%%ymm5                \n"
 9050|  2.51M|      "mov         $0x80808080,%%eax             \n"
 9051|  2.51M|      "vmovd       %%eax,%%xmm4                  \n"
 9052|  2.51M|      "vbroadcastss %%xmm4,%%ymm4                \n"
 9053|       |
 9054|       |      // General purpose row blend.
 9055|  2.51M|      LABELALIGN
 9056|  2.51M|      "1:          \n"
 9057|  2.51M|      "vmovdqu     (%1),%%ymm0                   \n"
 9058|  2.51M|      "vmovdqu     0x00(%1,%4,1),%%ymm2          \n"
 9059|  2.51M|      "vpunpckhbw  %%ymm2,%%ymm0,%%ymm1          \n"
 9060|  2.51M|      "vpunpcklbw  %%ymm2,%%ymm0,%%ymm0          \n"
 9061|  2.51M|      "vpsubb      %%ymm4,%%ymm1,%%ymm1          \n"
 9062|  2.51M|      "vpsubb      %%ymm4,%%ymm0,%%ymm0          \n"
 9063|  2.51M|      "vpmaddubsw  %%ymm1,%%ymm5,%%ymm1          \n"
 9064|  2.51M|      "vpmaddubsw  %%ymm0,%%ymm5,%%ymm0          \n"
 9065|  2.51M|      "vpaddw      %%ymm4,%%ymm1,%%ymm1          \n"
 9066|  2.51M|      "vpaddw      %%ymm4,%%ymm0,%%ymm0          \n"
 9067|  2.51M|      "vpsrlw      $0x8,%%ymm1,%%ymm1            \n"
 9068|  2.51M|      "vpsrlw      $0x8,%%ymm0,%%ymm0            \n"
 9069|  2.51M|      "vpackuswb   %%ymm1,%%ymm0,%%ymm0          \n"
 9070|  2.51M|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9071|  2.51M|      "lea         0x20(%1),%1                   \n"
 9072|  2.51M|      "sub         $0x20,%2                      \n"
 9073|  2.51M|      "jg          1b                            \n"
 9074|  2.51M|      "jmp         99f                           \n"
 9075|       |
 9076|       |      // Blend 50 / 50.
 9077|  2.51M|      LABELALIGN
 9078|  2.51M|      "50:         \n"
 9079|  2.51M|      "vmovdqu     (%1),%%ymm0                   \n"
 9080|  2.51M|      "vpavgb      0x00(%1,%4,1),%%ymm0,%%ymm0   \n"
 9081|  2.51M|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9082|  2.51M|      "lea         0x20(%1),%1                   \n"
 9083|  2.51M|      "sub         $0x20,%2                      \n"
 9084|  2.51M|      "jg          50b                           \n"
 9085|  2.51M|      "jmp         99f                           \n"
 9086|       |
 9087|       |      // Blend 100 / 0 - Copy row unchanged.
 9088|  2.51M|      LABELALIGN
 9089|  2.51M|      "100:        \n"
 9090|  2.51M|      "vmovdqu     (%1),%%ymm0                   \n"
 9091|  2.51M|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9092|  2.51M|      "lea         0x20(%1),%1                   \n"
 9093|  2.51M|      "sub         $0x20,%2                      \n"
 9094|  2.51M|      "jg          100b                          \n"
 9095|       |
 9096|  2.51M|      "99:         \n"
 9097|  2.51M|      "vzeroupper  \n"
 9098|  2.51M|      : "+r"(dst_ptr),           // %0
 9099|  2.51M|        "+r"(src_ptr),           // %1
 9100|  2.51M|        "+r"(width),             // %2
 9101|  2.51M|        "+r"(source_y_fraction)  // %3
 9102|  2.51M|      : "r"(src_stride)          // %4
 9103|  2.51M|      : "memory", "cc", "eax", "xmm0", "xmm1", "xmm2", "xmm4", "xmm5");
 9104|  2.51M|}
InterpolateRow_16_AVX2:
 9113|   664k|                            int source_y_fraction) {
 9114|   664k|  asm volatile(
 9115|   664k|      "sub         %1,%0                         \n"
 9116|   664k|      "cmp         $0x0,%3                       \n"
 9117|   664k|      "je          100f                          \n"
 9118|   664k|      "cmp         $0x80,%3                      \n"
 9119|   664k|      "je          50f                           \n"
 9120|       |
 9121|   664k|      "vmovd       %3,%%xmm0                     \n"
 9122|   664k|      "neg         %3                            \n"
 9123|   664k|      "add         $0x100,%3                     \n"
 9124|   664k|      "vmovd       %3,%%xmm5                     \n"
 9125|   664k|      "vpunpcklwd  %%xmm0,%%xmm5,%%xmm5          \n"
 9126|   664k|      "vpbroadcastd %%xmm5,%%ymm5                \n"
 9127|   664k|      "mov         $0x80008000,%%eax             \n"  // 0x80008000 used to bias
 9128|       |                                                      // unsigned words to
 9129|       |                                                      // signed range for
 9130|       |                                                      // vpmaddwd.
 9131|   664k|      "vmovd       %%eax,%%xmm4                  \n"
 9132|   664k|      "vbroadcastss %%xmm4,%%ymm4                \n"
 9133|   664k|      "mov         $8388736,%%eax                \n"  // 32768 * 256 + 128
 9134|       |                                                      // rounding constant.
 9135|   664k|      "vmovd       %%eax,%%xmm3                  \n"
 9136|   664k|      "vbroadcastss %%xmm3,%%ymm3                \n"
 9137|       |
 9138|   664k|      LABELALIGN
 9139|   664k|      "1:          \n"
 9140|   664k|      "vmovdqu     (%1),%%ymm0                   \n"
 9141|   664k|      "vmovdqu     (%1,%4,2),%%ymm1              \n"
 9142|   664k|      "vpunpckhwd  %%ymm1,%%ymm0,%%ymm2          \n"
 9143|   664k|      "vpunpcklwd  %%ymm1,%%ymm0,%%ymm0          \n"
 9144|   664k|      "vpsubw      %%ymm4,%%ymm2,%%ymm2          \n"
 9145|   664k|      "vpsubw      %%ymm4,%%ymm0,%%ymm0          \n"
 9146|   664k|      "vpmaddwd    %%ymm5,%%ymm2,%%ymm2          \n"
 9147|   664k|      "vpmaddwd    %%ymm5,%%ymm0,%%ymm0          \n"
 9148|   664k|      "vpaddd      %%ymm3,%%ymm2,%%ymm2          \n"
 9149|   664k|      "vpaddd      %%ymm3,%%ymm0,%%ymm0          \n"
 9150|   664k|      "vpsrad      $0x8,%%ymm2,%%ymm2            \n"
 9151|   664k|      "vpsrad      $0x8,%%ymm0,%%ymm0            \n"
 9152|   664k|      "vpackusdw   %%ymm2,%%ymm0,%%ymm0          \n"
 9153|   664k|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9154|   664k|      "lea         0x20(%1),%1                   \n"
 9155|   664k|      "sub         $0x10,%2                      \n"
 9156|   664k|      "jg          1b                            \n"
 9157|   664k|      "jmp         99f                           \n"
 9158|       |
 9159|   664k|      "50:         \n" LABELALIGN
 9160|   664k|      "2:          \n"
 9161|   664k|      "vmovdqu     (%1),%%ymm0                   \n"
 9162|   664k|      "vpavgw      (%1,%4,2),%%ymm0,%%ymm0       \n"
 9163|   664k|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9164|   664k|      "lea         0x20(%1),%1                   \n"
 9165|   664k|      "sub         $0x10,%2                      \n"
 9166|   664k|      "jg          2b                            \n"
 9167|   664k|      "jmp         99f                           \n"
 9168|       |
 9169|   664k|      "100:        \n" LABELALIGN
 9170|   664k|      "3:          \n"
 9171|   664k|      "vmovdqu     (%1),%%ymm0                   \n"
 9172|   664k|      "vmovdqu     %%ymm0,0x00(%1,%0,1)          \n"
 9173|   664k|      "lea         0x20(%1),%1                   \n"
 9174|   664k|      "sub         $0x10,%2                      \n"
 9175|   664k|      "jg          3b                            \n"
 9176|       |
 9177|   664k|      "99:         \n"
 9178|   664k|      "vzeroupper  \n"
 9179|   664k|      : "+r"(dst_ptr),           // %0
 9180|   664k|        "+r"(src_ptr),           // %1
 9181|   664k|        "+r"(width),             // %2
 9182|   664k|        "+r"(source_y_fraction)  // %3
 9183|   664k|      : "r"(src_stride)          // %4
 9184|   664k|      : "memory", "cc", "eax", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5");
 9185|   664k|}

ScalePlane:
 1939|  34.6k|               enum FilterMode filtering) {
 1940|       |  // Reject dimensions larger than 32768 (or smaller than -32768 for height).
 1941|       |  // This prevents FixedDiv signed integer overflows that can lead to division
 1942|       |  // by zero/overflow crashes (SIGFPE on x86) or incorrect step calculations.
 1943|  34.6k|  if (!src || src_width <= 0 || src_height == 0 || src_width > 32768 ||
  ------------------
  |  Branch (1943:7): [True: 0, False: 34.6k]
  |  Branch (1943:15): [True: 0, False: 34.6k]
  |  Branch (1943:33): [True: 0, False: 34.6k]
  |  Branch (1943:52): [True: 0, False: 34.6k]
  ------------------
 1944|  34.6k|      src_height < -32768 || src_height > 32768 || !dst || dst_width <= 0 ||
  ------------------
  |  Branch (1944:7): [True: 0, False: 34.6k]
  |  Branch (1944:30): [True: 0, False: 34.6k]
  |  Branch (1944:52): [True: 0, False: 34.6k]
  |  Branch (1944:60): [True: 0, False: 34.6k]
  ------------------
 1945|  34.6k|      dst_height <= 0) {
  ------------------
  |  Branch (1945:7): [True: 0, False: 34.6k]
  ------------------
 1946|      0|    return -1;
 1947|      0|  }
 1948|       |  // Simplify filtering when possible.
 1949|  34.6k|  filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height,
 1950|  34.6k|                                filtering);
 1951|       |
 1952|       |  // Negative height means invert the image.
 1953|  34.6k|  if (src_height < 0) {
  ------------------
  |  Branch (1953:7): [True: 0, False: 34.6k]
  ------------------
 1954|      0|    src_height = -src_height;
 1955|      0|    src = src + (src_height - 1) * (ptrdiff_t)src_stride;
 1956|      0|    src_stride = -src_stride;
 1957|      0|  }
 1958|       |  // Use specialized scales to improve performance for common resolutions.
 1959|       |  // For example, all the 1/2 scalings will use ScalePlaneDown2()
 1960|  34.6k|  if (dst_width == src_width && dst_height == src_height) {
  ------------------
  |  Branch (1960:7): [True: 282, False: 34.3k]
  |  Branch (1960:33): [True: 34, False: 248]
  ------------------
 1961|       |    // Straight copy.
 1962|     34|    CopyPlane(src, src_stride, dst, dst_stride, dst_width, dst_height);
 1963|     34|    return 0;
 1964|     34|  }
 1965|  34.6k|  if (dst_width == src_width && filtering != kFilterBox) {
  ------------------
  |  Branch (1965:7): [True: 248, False: 34.3k]
  |  Branch (1965:33): [True: 248, False: 0]
  ------------------
 1966|    248|    int dy = 0;
 1967|    248|    int y = 0;
 1968|       |    // When scaling down, use the center 2 rows to filter.
 1969|       |    // When scaling up, last row of destination uses the last 2 source rows.
 1970|    248|    if (dst_height <= src_height) {
  ------------------
  |  Branch (1970:9): [True: 0, False: 248]
  ------------------
 1971|      0|      dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1972|      0|      y = CENTERSTART(dy, -32768);  // Subtract 0.5 (32768) to center filter.
  ------------------
  |  |   33|      0|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (33:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1973|    248|    } else if (src_height > 1 && dst_height > 1) {
  ------------------
  |  Branch (1973:16): [True: 216, False: 32]
  |  Branch (1973:34): [True: 216, False: 0]
  ------------------
 1974|    216|      dy = FixedDiv1(src_height, dst_height);
  ------------------
  |  |  242|    216|#define FixedDiv1 FixedDiv1_X86
  ------------------
 1975|    216|    }
 1976|       |    // Arbitrary scale vertically, but unscaled horizontally.
 1977|    248|    ScalePlaneVertical(src_height, dst_width, dst_height, src_stride,
 1978|    248|                       dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering);
 1979|    248|    return 0;
 1980|    248|  }
 1981|  34.3k|  if (dst_width <= Abs(src_width) && dst_height <= src_height) {
  ------------------
  |  Branch (1981:7): [True: 0, False: 34.3k]
  |  Branch (1981:38): [True: 0, False: 0]
  ------------------
 1982|       |    // Scale down.
 1983|      0|    if (4 * dst_width == 3 * src_width && 4 * dst_height == 3 * src_height) {
  ------------------
  |  Branch (1983:9): [True: 0, False: 0]
  |  Branch (1983:43): [True: 0, False: 0]
  ------------------
 1984|       |      // optimized, 3/4
 1985|      0|      ScalePlaneDown34(src_width, src_height, dst_width, dst_height, src_stride,
 1986|      0|                       dst_stride, src, dst, filtering);
 1987|      0|      return 0;
 1988|      0|    }
 1989|      0|    if (2 * dst_width == src_width && 2 * dst_height == src_height) {
  ------------------
  |  Branch (1989:9): [True: 0, False: 0]
  |  Branch (1989:39): [True: 0, False: 0]
  ------------------
 1990|       |      // optimized, 1/2
 1991|      0|      ScalePlaneDown2(src_width, src_height, dst_width, dst_height, src_stride,
 1992|      0|                      dst_stride, src, dst, filtering);
 1993|      0|      return 0;
 1994|      0|    }
 1995|       |    // 3/8 rounded up for odd sized chroma height.
 1996|      0|    if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) {
  ------------------
  |  Branch (1996:9): [True: 0, False: 0]
  |  Branch (1996:43): [True: 0, False: 0]
  ------------------
 1997|       |      // optimized, 3/8
 1998|      0|      ScalePlaneDown38(src_width, src_height, dst_width, dst_height, src_stride,
 1999|      0|                       dst_stride, src, dst, filtering);
 2000|      0|      return 0;
 2001|      0|    }
 2002|      0|    if (4 * dst_width == src_width && 4 * dst_height == src_height &&
  ------------------
  |  Branch (2002:9): [True: 0, False: 0]
  |  Branch (2002:39): [True: 0, False: 0]
  ------------------
 2003|      0|        (filtering == kFilterBox || filtering == kFilterNone)) {
  ------------------
  |  Branch (2003:10): [True: 0, False: 0]
  |  Branch (2003:37): [True: 0, False: 0]
  ------------------
 2004|       |      // optimized, 1/4
 2005|      0|      ScalePlaneDown4(src_width, src_height, dst_width, dst_height, src_stride,
 2006|      0|                      dst_stride, src, dst, filtering);
 2007|      0|      return 0;
 2008|      0|    }
 2009|      0|  }
 2010|  34.3k|  if (filtering == kFilterBox && dst_height * 2 < src_height) {
  ------------------
  |  Branch (2010:7): [True: 0, False: 34.3k]
  |  Branch (2010:34): [True: 0, False: 0]
  ------------------
 2011|      0|    return ScalePlaneBox(src_width, src_height, dst_width, dst_height,
 2012|      0|                         src_stride, dst_stride, src, dst);
 2013|      0|  }
 2014|  34.3k|  if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) {
  ------------------
  |  Branch (2014:7): [True: 5.00k, False: 29.3k]
  |  Branch (2014:43): [True: 318, False: 4.68k]
  ------------------
 2015|    318|    ScalePlaneUp2_Linear(src_width, src_height, dst_width, dst_height,
 2016|    318|                         src_stride, dst_stride, src, dst);
 2017|    318|    return 0;
 2018|    318|  }
 2019|  34.0k|  if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width &&
  ------------------
  |  Branch (2019:7): [True: 4.64k, False: 29.4k]
  |  Branch (2019:45): [True: 985, False: 3.66k]
  ------------------
 2020|    985|      (filtering == kFilterBilinear || filtering == kFilterBox)) {
  ------------------
  |  Branch (2020:8): [True: 985, False: 0]
  |  Branch (2020:40): [True: 0, False: 0]
  ------------------
 2021|    985|    ScalePlaneUp2_Bilinear(src_width, src_height, dst_width, dst_height,
 2022|    985|                           src_stride, dst_stride, src, dst);
 2023|    985|    return 0;
 2024|    985|  }
 2025|  33.0k|  if (filtering && dst_height > src_height) {
  ------------------
  |  Branch (2025:7): [True: 30.8k, False: 2.20k]
  |  Branch (2025:20): [True: 30.6k, False: 180]
  ------------------
 2026|  30.6k|    return ScalePlaneBilinearUp(src_width, src_height, dst_width, dst_height,
 2027|  30.6k|                                src_stride, dst_stride, src, dst, filtering);
 2028|  30.6k|  }
 2029|  2.38k|  if (filtering) {
  ------------------
  |  Branch (2029:7): [True: 180, False: 2.20k]
  ------------------
 2030|    180|    return ScalePlaneBilinearDown(src_width, src_height, dst_width, dst_height,
 2031|    180|                                  src_stride, dst_stride, src, dst, filtering);
 2032|    180|  }
 2033|  2.20k|  ScalePlaneSimple(src_width, src_height, dst_width, dst_height, src_stride,
 2034|  2.20k|                   dst_stride, src, dst);
 2035|  2.20k|  return 0;
 2036|  2.38k|}
ScalePlane_16:
 2047|  14.4k|                  enum FilterMode filtering) {
 2048|       |  // Reject dimensions larger than 32768 (or smaller than -32768 for height).
 2049|       |  // This prevents FixedDiv signed integer overflows that can lead to division
 2050|       |  // by zero/overflow crashes (SIGFPE on x86) or incorrect step calculations.
 2051|  14.4k|  if (!src || src_width <= 0 || src_height == 0 || src_width > 32768 ||
  ------------------
  |  Branch (2051:7): [True: 0, False: 14.4k]
  |  Branch (2051:15): [True: 0, False: 14.4k]
  |  Branch (2051:33): [True: 0, False: 14.4k]
  |  Branch (2051:52): [True: 0, False: 14.4k]
  ------------------
 2052|  14.4k|      src_height < -32768 || src_height > 32768 || !dst || dst_width <= 0 ||
  ------------------
  |  Branch (2052:7): [True: 0, False: 14.4k]
  |  Branch (2052:30): [True: 0, False: 14.4k]
  |  Branch (2052:52): [True: 0, False: 14.4k]
  |  Branch (2052:60): [True: 0, False: 14.4k]
  ------------------
 2053|  14.4k|      dst_height <= 0) {
  ------------------
  |  Branch (2053:7): [True: 0, False: 14.4k]
  ------------------
 2054|      0|    return -1;
 2055|      0|  }
 2056|       |  // Simplify filtering when possible.
 2057|  14.4k|  filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height,
 2058|  14.4k|                                filtering);
 2059|       |
 2060|       |  // Negative height means invert the image.
 2061|  14.4k|  if (src_height < 0) {
  ------------------
  |  Branch (2061:7): [True: 0, False: 14.4k]
  ------------------
 2062|      0|    src_height = -src_height;
 2063|      0|    src = src + (src_height - 1) * (ptrdiff_t)src_stride;
 2064|      0|    src_stride = -src_stride;
 2065|      0|  }
 2066|       |  // Use specialized scales to improve performance for common resolutions.
 2067|       |  // For example, all the 1/2 scalings will use ScalePlaneDown2()
 2068|  14.4k|  if (dst_width == src_width && dst_height == src_height) {
  ------------------
  |  Branch (2068:7): [True: 184, False: 14.3k]
  |  Branch (2068:33): [True: 32, False: 152]
  ------------------
 2069|       |    // Straight copy.
 2070|     32|    CopyPlane_16(src, src_stride, dst, dst_stride, dst_width, dst_height);
 2071|     32|    return 0;
 2072|     32|  }
 2073|  14.4k|  if (dst_width == src_width && filtering != kFilterBox) {
  ------------------
  |  Branch (2073:7): [True: 152, False: 14.3k]
  |  Branch (2073:33): [True: 152, False: 0]
  ------------------
 2074|    152|    int dy = 0;
 2075|    152|    int y = 0;
 2076|       |    // When scaling down, use the center 2 rows to filter.
 2077|       |    // When scaling up, last row of destination uses the last 2 source rows.
 2078|    152|    if (dst_height <= src_height) {
  ------------------
  |  Branch (2078:9): [True: 0, False: 152]
  ------------------
 2079|      0|      dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 2080|      0|      y = CENTERSTART(dy, -32768);  // Subtract 0.5 (32768) to center filter.
  ------------------
  |  |   33|      0|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (33:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2081|       |      // When scaling up, ensure the last row of destination uses the last
 2082|       |      // source. Avoid divide by zero for dst_height but will do no scaling
 2083|       |      // later.
 2084|    152|    } else if (src_height > 1 && dst_height > 1) {
  ------------------
  |  Branch (2084:16): [True: 114, False: 38]
  |  Branch (2084:34): [True: 114, False: 0]
  ------------------
 2085|    114|      dy = FixedDiv1(src_height, dst_height);
  ------------------
  |  |  242|    114|#define FixedDiv1 FixedDiv1_X86
  ------------------
 2086|    114|    }
 2087|       |    // Arbitrary scale vertically, but unscaled horizontally.
 2088|    152|    ScalePlaneVertical_16(src_height, dst_width, dst_height, src_stride,
 2089|    152|                          dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering);
 2090|    152|    return 0;
 2091|    152|  }
 2092|  14.3k|  if (dst_width <= Abs(src_width) && dst_height <= src_height) {
  ------------------
  |  Branch (2092:7): [True: 0, False: 14.3k]
  |  Branch (2092:38): [True: 0, False: 0]
  ------------------
 2093|       |    // Scale down.
 2094|      0|    if (4 * dst_width == 3 * src_width && 4 * dst_height == 3 * src_height) {
  ------------------
  |  Branch (2094:9): [True: 0, False: 0]
  |  Branch (2094:43): [True: 0, False: 0]
  ------------------
 2095|       |      // optimized, 3/4
 2096|      0|      ScalePlaneDown34_16(src_width, src_height, dst_width, dst_height,
 2097|      0|                          src_stride, dst_stride, src, dst, filtering);
 2098|      0|      return 0;
 2099|      0|    }
 2100|      0|    if (2 * dst_width == src_width && 2 * dst_height == src_height) {
  ------------------
  |  Branch (2100:9): [True: 0, False: 0]
  |  Branch (2100:39): [True: 0, False: 0]
  ------------------
 2101|       |      // optimized, 1/2
 2102|      0|      ScalePlaneDown2_16(src_width, src_height, dst_width, dst_height,
 2103|      0|                         src_stride, dst_stride, src, dst, filtering);
 2104|      0|      return 0;
 2105|      0|    }
 2106|       |    // 3/8 rounded up for odd sized chroma height.
 2107|      0|    if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) {
  ------------------
  |  Branch (2107:9): [True: 0, False: 0]
  |  Branch (2107:43): [True: 0, False: 0]
  ------------------
 2108|       |      // optimized, 3/8
 2109|      0|      ScalePlaneDown38_16(src_width, src_height, dst_width, dst_height,
 2110|      0|                          src_stride, dst_stride, src, dst, filtering);
 2111|      0|      return 0;
 2112|      0|    }
 2113|      0|    if (4 * dst_width == src_width && 4 * dst_height == src_height &&
  ------------------
  |  Branch (2113:9): [True: 0, False: 0]
  |  Branch (2113:39): [True: 0, False: 0]
  ------------------
 2114|      0|        (filtering == kFilterBox || filtering == kFilterNone)) {
  ------------------
  |  Branch (2114:10): [True: 0, False: 0]
  |  Branch (2114:37): [True: 0, False: 0]
  ------------------
 2115|       |      // optimized, 1/4
 2116|      0|      ScalePlaneDown4_16(src_width, src_height, dst_width, dst_height,
 2117|      0|                         src_stride, dst_stride, src, dst, filtering);
 2118|      0|      return 0;
 2119|      0|    }
 2120|      0|  }
 2121|  14.3k|  if (filtering == kFilterBox && dst_height * 2 < src_height) {
  ------------------
  |  Branch (2121:7): [True: 0, False: 14.3k]
  |  Branch (2121:34): [True: 0, False: 0]
  ------------------
 2122|      0|    return ScalePlaneBox_16(src_width, src_height, dst_width, dst_height,
 2123|      0|                            src_stride, dst_stride, src, dst);
 2124|      0|  }
 2125|  14.3k|  if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) {
  ------------------
  |  Branch (2125:7): [True: 2.26k, False: 12.0k]
  |  Branch (2125:43): [True: 0, False: 2.26k]
  ------------------
 2126|      0|    ScalePlaneUp2_16_Linear(src_width, src_height, dst_width, dst_height,
 2127|      0|                            src_stride, dst_stride, src, dst);
 2128|      0|    return 0;
 2129|      0|  }
 2130|  14.3k|  if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width &&
  ------------------
  |  Branch (2130:7): [True: 1.81k, False: 12.4k]
  |  Branch (2130:45): [True: 0, False: 1.81k]
  ------------------
 2131|      0|      (filtering == kFilterBilinear || filtering == kFilterBox)) {
  ------------------
  |  Branch (2131:8): [True: 0, False: 0]
  |  Branch (2131:40): [True: 0, False: 0]
  ------------------
 2132|      0|    ScalePlaneUp2_16_Bilinear(src_width, src_height, dst_width, dst_height,
 2133|      0|                              src_stride, dst_stride, src, dst);
 2134|      0|    return 0;
 2135|      0|  }
 2136|  14.3k|  if (filtering && dst_height > src_height) {
  ------------------
  |  Branch (2136:7): [True: 13.1k, False: 1.20k]
  |  Branch (2136:20): [True: 13.0k, False: 72]
  ------------------
 2137|  13.0k|    return ScalePlaneBilinearUp_16(src_width, src_height, dst_width, dst_height,
 2138|  13.0k|                                   src_stride, dst_stride, src, dst, filtering);
 2139|  13.0k|  }
 2140|  1.27k|  if (filtering) {
  ------------------
  |  Branch (2140:7): [True: 72, False: 1.20k]
  ------------------
 2141|     72|    return ScalePlaneBilinearDown_16(src_width, src_height, dst_width,
 2142|     72|                                     dst_height, src_stride, dst_stride, src,
 2143|     72|                                     dst, filtering);
 2144|     72|  }
 2145|  1.20k|  ScalePlaneSimple_16(src_width, src_height, dst_width, dst_height, src_stride,
 2146|  1.20k|                      dst_stride, src, dst);
 2147|  1.20k|  return 0;
 2148|  1.27k|}
ScalePlane_12:
 2159|  15.2k|                  enum FilterMode filtering) {
 2160|       |  // Reject dimensions larger than 32768 (or smaller than -32768 for height).
 2161|       |  // This prevents FixedDiv signed integer overflows that can lead to division
 2162|       |  // by zero/overflow crashes (SIGFPE on x86) or incorrect step calculations.
 2163|  15.2k|  if (!src || src_width <= 0 || src_height == 0 || src_width > 32768 ||
  ------------------
  |  Branch (2163:7): [True: 0, False: 15.2k]
  |  Branch (2163:15): [True: 0, False: 15.2k]
  |  Branch (2163:33): [True: 0, False: 15.2k]
  |  Branch (2163:52): [True: 0, False: 15.2k]
  ------------------
 2164|  15.2k|      src_height < -32768 || src_height > 32768 || !dst || dst_width <= 0 ||
  ------------------
  |  Branch (2164:7): [True: 0, False: 15.2k]
  |  Branch (2164:30): [True: 0, False: 15.2k]
  |  Branch (2164:52): [True: 0, False: 15.2k]
  |  Branch (2164:60): [True: 0, False: 15.2k]
  ------------------
 2165|  15.2k|      dst_height <= 0) {
  ------------------
  |  Branch (2165:7): [True: 0, False: 15.2k]
  ------------------
 2166|      0|    return -1;
 2167|      0|  }
 2168|       |  // Simplify filtering when possible.
 2169|  15.2k|  filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height,
 2170|  15.2k|                                filtering);
 2171|       |
 2172|       |  // Negative height means invert the image.
 2173|  15.2k|  if (src_height < 0) {
  ------------------
  |  Branch (2173:7): [True: 0, False: 15.2k]
  ------------------
 2174|      0|    src_height = -src_height;
 2175|      0|    src = src + (src_height - 1) * (ptrdiff_t)src_stride;
 2176|      0|    src_stride = -src_stride;
 2177|      0|  }
 2178|       |
 2179|  15.2k|  if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) {
  ------------------
  |  Branch (2179:7): [True: 3.00k, False: 12.2k]
  |  Branch (2179:43): [True: 226, False: 2.77k]
  ------------------
 2180|    226|    ScalePlaneUp2_12_Linear(src_width, src_height, dst_width, dst_height,
 2181|    226|                            src_stride, dst_stride, src, dst);
 2182|    226|    return 0;
 2183|    226|  }
 2184|  15.0k|  if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width &&
  ------------------
  |  Branch (2184:7): [True: 2.33k, False: 12.6k]
  |  Branch (2184:45): [True: 514, False: 1.82k]
  ------------------
 2185|    514|      (filtering == kFilterBilinear || filtering == kFilterBox)) {
  ------------------
  |  Branch (2185:8): [True: 514, False: 0]
  |  Branch (2185:40): [True: 0, False: 0]
  ------------------
 2186|    514|    ScalePlaneUp2_12_Bilinear(src_width, src_height, dst_width, dst_height,
 2187|    514|                              src_stride, dst_stride, src, dst);
 2188|    514|    return 0;
 2189|    514|  }
 2190|       |
 2191|  14.4k|  return ScalePlane_16(src, src_stride, src_width, src_height, dst, dst_stride,
 2192|  14.4k|                       dst_width, dst_height, filtering);
 2193|  15.0k|}
scale.cc:_ZN6libyuvL3AbsEi:
   28|  96.0k|static __inline int Abs(int v) {
   29|  96.0k|  return v >= 0 ? v : -v;
  ------------------
  |  Branch (29:10): [True: 96.0k, False: 0]
  ------------------
   30|  96.0k|}
scale.cc:_ZN6libyuvL20ScalePlaneUp2_LinearEiiiillPKhPh:
 1385|    318|                                 uint8_t* dst_ptr) {
 1386|    318|  void (*ScaleRowUp)(const uint8_t* src_ptr, uint8_t* dst_ptr, int dst_width) =
 1387|    318|      ScaleRowUp2_Linear_Any_C;
 1388|    318|  int i;
 1389|    318|  int y;
 1390|    318|  int dy;
 1391|       |
 1392|    318|  (void)src_width;
 1393|       |  // This function can only scale up by 2 times horizontally.
 1394|    318|  assert(src_width == ((dst_width + 1) / 2));
 1395|       |
 1396|    318|#ifdef HAS_SCALEROWUP2_LINEAR_SSE2
 1397|    318|  if (TestCpuFlag(kCpuHasSSE2)) {
  ------------------
  |  Branch (1397:7): [True: 318, False: 0]
  ------------------
 1398|    318|    ScaleRowUp = ScaleRowUp2_Linear_Any_SSE2;
 1399|    318|  }
 1400|    318|#endif
 1401|       |
 1402|    318|#ifdef HAS_SCALEROWUP2_LINEAR_SSSE3
 1403|    318|  if (TestCpuFlag(kCpuHasSSSE3)) {
  ------------------
  |  Branch (1403:7): [True: 318, False: 0]
  ------------------
 1404|    318|    ScaleRowUp = ScaleRowUp2_Linear_Any_SSSE3;
 1405|    318|  }
 1406|    318|#endif
 1407|       |
 1408|    318|#ifdef HAS_SCALEROWUP2_LINEAR_AVX2
 1409|    318|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1409:7): [True: 318, False: 0]
  ------------------
 1410|    318|    ScaleRowUp = ScaleRowUp2_Linear_Any_AVX2;
 1411|    318|  }
 1412|    318|#endif
 1413|       |
 1414|       |#ifdef HAS_SCALEROWUP2_LINEAR_NEON
 1415|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1416|       |    ScaleRowUp = ScaleRowUp2_Linear_Any_NEON;
 1417|       |  }
 1418|       |#endif
 1419|       |#ifdef HAS_SCALEROWUP2_LINEAR_RVV
 1420|       |  if (TestCpuFlag(kCpuHasRVV)) {
 1421|       |    ScaleRowUp = ScaleRowUp2_Linear_RVV;
 1422|       |  }
 1423|       |#endif
 1424|       |
 1425|    318|  if (dst_height == 1) {
  ------------------
  |  Branch (1425:7): [True: 0, False: 318]
  ------------------
 1426|      0|    ScaleRowUp(src_ptr + ((src_height - 1) / 2) * src_stride, dst_ptr,
 1427|      0|               dst_width);
 1428|    318|  } else {
 1429|    318|    dy = FixedDiv(src_height - 1, dst_height - 1);
  ------------------
  |  |  241|    318|#define FixedDiv FixedDiv_X86
  ------------------
 1430|    318|    y = (1 << 15) - 1;
 1431|  2.37k|    for (i = 0; i < dst_height; ++i) {
  ------------------
  |  Branch (1431:17): [True: 2.05k, False: 318]
  ------------------
 1432|  2.05k|      ScaleRowUp(src_ptr + (y >> 16) * src_stride, dst_ptr, dst_width);
 1433|  2.05k|      dst_ptr += dst_stride;
 1434|  2.05k|      y += dy;
 1435|  2.05k|    }
 1436|    318|  }
 1437|    318|}
scale.cc:_ZN6libyuvL22ScalePlaneUp2_BilinearEiiiillPKhPh:
 1450|    985|                                   uint8_t* dst_ptr) {
 1451|    985|  void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride,
 1452|    985|                      uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) =
 1453|    985|      ScaleRowUp2_Bilinear_Any_C;
 1454|    985|  int x;
 1455|       |
 1456|    985|  (void)src_width;
 1457|       |  // This function can only scale up by 2 times.
 1458|    985|  assert(src_width == ((dst_width + 1) / 2));
 1459|    985|  assert(src_height == ((dst_height + 1) / 2));
 1460|       |
 1461|    985|#ifdef HAS_SCALEROWUP2_BILINEAR_SSE2
 1462|    985|  if (TestCpuFlag(kCpuHasSSE2)) {
  ------------------
  |  Branch (1462:7): [True: 985, False: 0]
  ------------------
 1463|    985|    Scale2RowUp = ScaleRowUp2_Bilinear_Any_SSE2;
 1464|    985|  }
 1465|    985|#endif
 1466|       |
 1467|    985|#ifdef HAS_SCALEROWUP2_BILINEAR_SSSE3
 1468|    985|  if (TestCpuFlag(kCpuHasSSSE3)) {
  ------------------
  |  Branch (1468:7): [True: 985, False: 0]
  ------------------
 1469|    985|    Scale2RowUp = ScaleRowUp2_Bilinear_Any_SSSE3;
 1470|    985|  }
 1471|    985|#endif
 1472|       |
 1473|    985|#ifdef HAS_SCALEROWUP2_BILINEAR_AVX2
 1474|    985|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1474:7): [True: 985, False: 0]
  ------------------
 1475|    985|    Scale2RowUp = ScaleRowUp2_Bilinear_Any_AVX2;
 1476|    985|  }
 1477|    985|#endif
 1478|       |
 1479|       |#ifdef HAS_SCALEROWUP2_BILINEAR_NEON
 1480|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1481|       |    Scale2RowUp = ScaleRowUp2_Bilinear_Any_NEON;
 1482|       |  }
 1483|       |#endif
 1484|       |#ifdef HAS_SCALEROWUP2_BILINEAR_RVV
 1485|       |  if (TestCpuFlag(kCpuHasRVV)) {
 1486|       |    Scale2RowUp = ScaleRowUp2_Bilinear_RVV;
 1487|       |  }
 1488|       |#endif
 1489|       |
 1490|    985|  Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width);
 1491|    985|  dst_ptr += dst_stride;
 1492|  28.5k|  for (x = 0; x < src_height - 1; ++x) {
  ------------------
  |  Branch (1492:15): [True: 27.5k, False: 985]
  ------------------
 1493|  27.5k|    Scale2RowUp(src_ptr, src_stride, dst_ptr, dst_stride, dst_width);
 1494|  27.5k|    src_ptr += src_stride;
 1495|       |    // TODO(fbarchard): Test performance of writing one row of destination at a
 1496|       |    // time.
 1497|  27.5k|    dst_ptr += 2 * dst_stride;
 1498|  27.5k|  }
 1499|    985|  if (!(dst_height & 1)) {
  ------------------
  |  Branch (1499:7): [True: 603, False: 382]
  ------------------
 1500|    603|    Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width);
 1501|    603|  }
 1502|    985|}
scale.cc:_ZN6libyuvL20ScalePlaneBilinearUpEiiiillPKhPhNS_10FilterModeE:
 1221|  30.6k|                                enum FilterMode filtering) {
 1222|  30.6k|  assert(src_width > 0);
 1223|  30.6k|  assert(src_height > 0);
 1224|  30.6k|  assert(dst_width > 0);
 1225|  30.6k|  assert(dst_height > 0);
 1226|       |
 1227|  30.6k|  int j;
 1228|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1229|  30.6k|  int x = 0;
 1230|  30.6k|  int y = 0;
 1231|  30.6k|  int dx = 0;
 1232|  30.6k|  int dy = 0;
 1233|  30.6k|  const int max_y = (src_height - 1) << 16;
 1234|  30.6k|  void (*InterpolateRow)(uint8_t* dst_ptr, const uint8_t* src_ptr,
 1235|  30.6k|                         ptrdiff_t src_stride, int dst_width,
 1236|  30.6k|                         int source_y_fraction) = InterpolateRow_C;
 1237|  30.6k|  void (*ScaleFilterCols)(uint8_t* dst_ptr, const uint8_t* src_ptr,
 1238|  30.6k|                          int dst_width, int x, int dx) =
 1239|  30.6k|      filtering ? ScaleFilterCols_C : ScaleCols_C;
  ------------------
  |  Branch (1239:7): [True: 30.6k, False: 0]
  ------------------
 1240|  30.6k|  ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, &x, &y,
 1241|  30.6k|             &dx, &dy);
 1242|  30.6k|  assert(dy <= 65536);
 1243|  30.6k|  src_width = Abs(src_width);
 1244|       |
 1245|  30.6k|#if defined(HAS_INTERPOLATEROW_AVX2)
 1246|  30.6k|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1246:7): [True: 30.6k, False: 0]
  ------------------
 1247|  30.6k|    InterpolateRow = InterpolateRow_Any_AVX2;
 1248|  30.6k|    if (IS_ALIGNED(dst_width, 32)) {
  ------------------
  |  | 1002|  30.6k|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 857, False: 29.8k]
  |  |  ------------------
  ------------------
 1249|    857|      InterpolateRow = InterpolateRow_AVX2;
 1250|    857|    }
 1251|  30.6k|  }
 1252|  30.6k|#endif
 1253|       |#if defined(HAS_INTERPOLATEROW_NEON)
 1254|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1255|       |    InterpolateRow = InterpolateRow_Any_NEON;
 1256|       |    if (IS_ALIGNED(dst_width, 16)) {
 1257|       |      InterpolateRow = InterpolateRow_NEON;
 1258|       |    }
 1259|       |  }
 1260|       |#endif
 1261|       |#if defined(HAS_INTERPOLATEROW_SVE2)
 1262|       |  if (TestCpuFlag(kCpuHasSVE2)) {
 1263|       |    InterpolateRow = InterpolateRow_SVE2;
 1264|       |  }
 1265|       |#endif
 1266|       |#if defined(HAS_INTERPOLATEROW_SME)
 1267|       |  if (TestCpuFlag(kCpuHasSME)) {
 1268|       |    InterpolateRow = InterpolateRow_SME;
 1269|       |  }
 1270|       |#endif
 1271|       |#if defined(HAS_INTERPOLATEROW_RVV)
 1272|       |  if (TestCpuFlag(kCpuHasRVV)) {
 1273|       |    InterpolateRow = InterpolateRow_RVV;
 1274|       |  }
 1275|       |#endif
 1276|       |
 1277|  30.6k|  if (filtering && src_width >= 32768) {
  ------------------
  |  Branch (1277:7): [True: 30.6k, False: 0]
  |  Branch (1277:20): [True: 0, False: 30.6k]
  ------------------
 1278|      0|    ScaleFilterCols = ScaleFilterCols64_C;
 1279|      0|  }
 1280|  30.6k|#if defined(HAS_SCALEFILTERCOLS_SSSE3)
 1281|  30.6k|  if (filtering && TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
  ------------------
  |  Branch (1281:7): [True: 30.6k, False: 0]
  |  Branch (1281:20): [True: 30.6k, False: 0]
  |  Branch (1281:49): [True: 30.6k, False: 0]
  ------------------
 1282|  30.6k|    ScaleFilterCols = ScaleFilterCols_SSSE3;
 1283|  30.6k|  }
 1284|  30.6k|#endif
 1285|       |#if defined(HAS_SCALEFILTERCOLS_NEON)
 1286|       |  if (filtering && TestCpuFlag(kCpuHasNEON) && src_width < 32768) {
 1287|       |    ScaleFilterCols = ScaleFilterCols_Any_NEON;
 1288|       |    if (IS_ALIGNED(dst_width, 8)) {
 1289|       |      ScaleFilterCols = ScaleFilterCols_NEON;
 1290|       |    }
 1291|       |  }
 1292|       |#endif
 1293|       |#if defined(HAS_SCALEFILTERCOLS_LSX)
 1294|       |  if (filtering && TestCpuFlag(kCpuHasLSX) && src_width < 32768) {
 1295|       |    ScaleFilterCols = ScaleFilterCols_Any_LSX;
 1296|       |    if (IS_ALIGNED(dst_width, 16)) {
 1297|       |      ScaleFilterCols = ScaleFilterCols_LSX;
 1298|       |    }
 1299|       |  }
 1300|       |#endif
 1301|  30.6k|  if (!filtering && src_width * 2 == dst_width && x < 0x8000) {
  ------------------
  |  Branch (1301:7): [True: 0, False: 30.6k]
  |  Branch (1301:21): [True: 0, False: 0]
  |  Branch (1301:51): [True: 0, False: 0]
  ------------------
 1302|      0|    ScaleFilterCols = ScaleColsUp2_C;
 1303|       |#if defined(HAS_SCALECOLS_SSE2)
 1304|       |    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
 1305|       |      ScaleFilterCols = ScaleColsUp2_SSE2;
 1306|       |    }
 1307|       |#endif
 1308|      0|  }
 1309|       |
 1310|  30.6k|  if (y > max_y) {
  ------------------
  |  Branch (1310:7): [True: 1.30k, False: 29.3k]
  ------------------
 1311|  1.30k|    y = max_y;
 1312|  1.30k|  }
 1313|  30.6k|  {
 1314|  30.6k|    int yi = y >> 16;
 1315|  30.6k|    const uint8_t* src = src_ptr + yi * src_stride;
 1316|       |
 1317|       |    // Allocate 2 row buffers.
 1318|  30.6k|    const int row_size = (dst_width + 31) & ~31;
 1319|  30.6k|    align_buffer_64(row, row_size * 2);
  ------------------
  |  | 1005|  30.6k|  size_t var##_mem_size = (size); /* NOLINT */                             \
  |  | 1006|  30.6k|  void* var##_mem = (var##_mem_size > SIZE_MAX - 63)                       \
  |  |  ------------------
  |  |  |  Branch (1006:21): [True: 0, False: 30.6k]
  |  |  ------------------
  |  | 1007|  30.6k|                        ? NULL                                             \
  |  | 1008|  30.6k|                        : malloc(var##_mem_size + 63);        /* NOLINT */ \
  |  | 1009|  30.6k|  uint8_t* var = (uint8_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */
  ------------------
 1320|  30.6k|    if (!row)
  ------------------
  |  Branch (1320:9): [True: 0, False: 30.6k]
  ------------------
 1321|      0|      return 1;
 1322|       |
 1323|  30.6k|    uint8_t* rowptr = row;
 1324|  30.6k|    ptrdiff_t rowstride = row_size;
 1325|  30.6k|    int lasty = yi;
 1326|       |
 1327|  30.6k|    ScaleFilterCols(rowptr, src, dst_width, x, dx);
 1328|  30.6k|    if (src_height > 1) {
  ------------------
  |  Branch (1328:9): [True: 29.3k, False: 1.30k]
  ------------------
 1329|  29.3k|      src += src_stride;
 1330|  29.3k|    }
 1331|  30.6k|    ScaleFilterCols(rowptr + rowstride, src, dst_width, x, dx);
 1332|  30.6k|    if (src_height > 2) {
  ------------------
  |  Branch (1332:9): [True: 27.3k, False: 3.32k]
  ------------------
 1333|  27.3k|      src += src_stride;
 1334|  27.3k|    }
 1335|       |
 1336|       |    // 2-row rolling buffer:
 1337|       |    // rowptr and (rowptr + rowstride) hold the scaled rows for yi and yi + 1.
 1338|       |    // Because dy <= 65536 (dy <= 1.0 in 16.16), yi advances in unit steps.
 1339|       |    // When yi != lasty:
 1340|       |    // 1. Scale the next source row into the older buffer (rowptr).
 1341|       |    // 2. Swap buffer pointers (rowptr += rowstride; rowstride = -rowstride;)
 1342|       |    //    so rowptr points to yi and (rowptr + rowstride) points to yi + 1.
 1343|       |    // 3. Advance src by 1 row if row yi + 2 exists ((y + 65536) < max_y),
 1344|       |    //    otherwise clamp src at (src_height - 1) to avoid reading out of bounds.
 1345|  1.63M|    for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1345:17): [True: 1.60M, False: 30.6k]
  ------------------
 1346|  1.60M|      if (y > max_y) {
  ------------------
  |  Branch (1346:11): [True: 7.50k, False: 1.60M]
  ------------------
 1347|  7.50k|        y = max_y;
 1348|  7.50k|      }
 1349|  1.60M|      yi = y >> 16;
 1350|  1.60M|      if (yi != lasty) {
  ------------------
  |  Branch (1350:11): [True: 914k, False: 694k]
  ------------------
 1351|   914k|        ScaleFilterCols(rowptr, src, dst_width, x, dx);
 1352|   914k|        rowptr += rowstride;
 1353|   914k|        rowstride = -rowstride;
 1354|   914k|        lasty = yi;
 1355|   914k|        if ((y + 65536) < max_y) {
  ------------------
  |  Branch (1355:13): [True: 886k, False: 27.3k]
  ------------------
 1356|   886k|          src += src_stride;
 1357|   886k|        }
 1358|   914k|      }
 1359|  1.60M|      if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1359:11): [True: 8.80k, False: 1.59M]
  ------------------
 1360|  8.80k|        InterpolateRow(dst_ptr, rowptr, 0, dst_width, 0);
 1361|  1.59M|      } else {
 1362|  1.59M|        int yf = (y >> 8) & 255;
 1363|  1.59M|        InterpolateRow(dst_ptr, rowptr, rowstride, dst_width, yf);
 1364|  1.59M|      }
 1365|  1.60M|      dst_ptr += dst_stride;
 1366|  1.60M|      y += dy;
 1367|  1.60M|    }
 1368|  30.6k|    free_aligned_buffer_64(row);
  ------------------
  |  | 1012|  30.6k|  free(var##_mem);                  \
  |  | 1013|  30.6k|  var = NULL
  ------------------
 1369|  30.6k|  }
 1370|      0|  return 0;
 1371|  30.6k|}
scale.cc:_ZN6libyuvL22ScalePlaneBilinearDownEiiiillPKhPhNS_10FilterModeE:
 1012|    180|                                  enum FilterMode filtering) {
 1013|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1014|    180|  int x = 0;
 1015|    180|  int y = 0;
 1016|    180|  int dx = 0;
 1017|    180|  int dy = 0;
 1018|       |  // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear.
 1019|       |  // Allocate a row buffer.
 1020|    180|  align_buffer_64(row, src_width);
  ------------------
  |  | 1005|    180|  size_t var##_mem_size = (size); /* NOLINT */                             \
  |  | 1006|    180|  void* var##_mem = (var##_mem_size > SIZE_MAX - 63)                       \
  |  |  ------------------
  |  |  |  Branch (1006:21): [True: 0, False: 180]
  |  |  ------------------
  |  | 1007|    180|                        ? NULL                                             \
  |  | 1008|    180|                        : malloc(var##_mem_size + 63);        /* NOLINT */ \
  |  | 1009|    180|  uint8_t* var = (uint8_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */
  ------------------
 1021|    180|  if (!row)
  ------------------
  |  Branch (1021:7): [True: 0, False: 180]
  ------------------
 1022|      0|    return 1;
 1023|       |
 1024|    180|  const int max_y = (src_height - 1) << 16;
 1025|    180|  int j;
 1026|    180|  void (*ScaleFilterCols)(uint8_t* dst_ptr, const uint8_t* src_ptr,
 1027|    180|                          int dst_width, int x, int dx) =
 1028|    180|      (src_width >= 32768) ? ScaleFilterCols64_C : ScaleFilterCols_C;
  ------------------
  |  Branch (1028:7): [True: 0, False: 180]
  ------------------
 1029|    180|  void (*InterpolateRow)(uint8_t* dst_ptr, const uint8_t* src_ptr,
 1030|    180|                         ptrdiff_t src_stride, int dst_width,
 1031|    180|                         int source_y_fraction) = InterpolateRow_C;
 1032|    180|  ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, &x, &y,
 1033|    180|             &dx, &dy);
 1034|    180|  src_width = Abs(src_width);
 1035|       |
 1036|    180|#if defined(HAS_INTERPOLATEROW_AVX2)
 1037|    180|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1037:7): [True: 180, False: 0]
  ------------------
 1038|    180|    InterpolateRow = InterpolateRow_Any_AVX2;
 1039|    180|    if (IS_ALIGNED(src_width, 32)) {
  ------------------
  |  | 1002|    180|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 2, False: 178]
  |  |  ------------------
  ------------------
 1040|      2|      InterpolateRow = InterpolateRow_AVX2;
 1041|      2|    }
 1042|    180|  }
 1043|    180|#endif
 1044|       |#if defined(HAS_INTERPOLATEROW_NEON)
 1045|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1046|       |    InterpolateRow = InterpolateRow_Any_NEON;
 1047|       |    if (IS_ALIGNED(src_width, 16)) {
 1048|       |      InterpolateRow = InterpolateRow_NEON;
 1049|       |    }
 1050|       |  }
 1051|       |#endif
 1052|       |#if defined(HAS_INTERPOLATEROW_SVE2)
 1053|       |  if (TestCpuFlag(kCpuHasSVE2)) {
 1054|       |    InterpolateRow = InterpolateRow_SVE2;
 1055|       |  }
 1056|       |#endif
 1057|       |#if defined(HAS_INTERPOLATEROW_SME)
 1058|       |  if (TestCpuFlag(kCpuHasSME)) {
 1059|       |    InterpolateRow = InterpolateRow_SME;
 1060|       |  }
 1061|       |#endif
 1062|       |#if defined(HAS_INTERPOLATEROW_LSX)
 1063|       |  if (TestCpuFlag(kCpuHasLSX)) {
 1064|       |    InterpolateRow = InterpolateRow_Any_LSX;
 1065|       |    if (IS_ALIGNED(src_width, 32)) {
 1066|       |      InterpolateRow = InterpolateRow_LSX;
 1067|       |    }
 1068|       |  }
 1069|       |#endif
 1070|       |#if defined(HAS_INTERPOLATEROW_RVV)
 1071|       |  if (TestCpuFlag(kCpuHasRVV)) {
 1072|       |    InterpolateRow = InterpolateRow_RVV;
 1073|       |  }
 1074|       |#endif
 1075|       |
 1076|    180|#if defined(HAS_SCALEFILTERCOLS_SSSE3)
 1077|    180|  if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
  ------------------
  |  Branch (1077:7): [True: 180, False: 0]
  |  Branch (1077:36): [True: 180, False: 0]
  ------------------
 1078|    180|    ScaleFilterCols = ScaleFilterCols_SSSE3;
 1079|    180|  }
 1080|    180|#endif
 1081|       |#if defined(HAS_SCALEFILTERCOLS_NEON)
 1082|       |  if (TestCpuFlag(kCpuHasNEON) && src_width < 32768) {
 1083|       |    ScaleFilterCols = ScaleFilterCols_Any_NEON;
 1084|       |    if (IS_ALIGNED(dst_width, 8)) {
 1085|       |      ScaleFilterCols = ScaleFilterCols_NEON;
 1086|       |    }
 1087|       |  }
 1088|       |#endif
 1089|       |#if defined(HAS_SCALEFILTERCOLS_LSX)
 1090|       |  if (TestCpuFlag(kCpuHasLSX) && src_width < 32768) {
 1091|       |    ScaleFilterCols = ScaleFilterCols_Any_LSX;
 1092|       |    if (IS_ALIGNED(dst_width, 16)) {
 1093|       |      ScaleFilterCols = ScaleFilterCols_LSX;
 1094|       |    }
 1095|       |  }
 1096|       |#endif
 1097|    180|  if (y > max_y) {
  ------------------
  |  Branch (1097:7): [True: 0, False: 180]
  ------------------
 1098|      0|    y = max_y;
 1099|      0|  }
 1100|       |
 1101|    900|  for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1101:15): [True: 720, False: 180]
  ------------------
 1102|    720|    int yi = y >> 16;
 1103|    720|    const uint8_t* src = src_ptr + yi * src_stride;
 1104|    720|    if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1104:9): [True: 720, False: 0]
  ------------------
 1105|    720|      ScaleFilterCols(dst_ptr, src, dst_width, x, dx);
 1106|    720|    } else {
 1107|      0|      int yf = (y >> 8) & 255;
 1108|      0|      InterpolateRow(row, src, src_stride, src_width, yf);
 1109|      0|      ScaleFilterCols(dst_ptr, row, dst_width, x, dx);
 1110|      0|    }
 1111|    720|    dst_ptr += dst_stride;
 1112|    720|    y += dy;
 1113|    720|    if (y > max_y) {
  ------------------
  |  Branch (1113:9): [True: 360, False: 360]
  ------------------
 1114|    360|      y = max_y;
 1115|    360|    }
 1116|    720|  }
 1117|       |  free_aligned_buffer_64(row);
  ------------------
  |  | 1012|    180|  free(var##_mem);                  \
  |  | 1013|    180|  var = NULL
  ------------------
 1118|    180|  return 0;
 1119|    180|}
scale.cc:_ZN6libyuvL16ScalePlaneSimpleEiiiillPKhPh:
 1863|  2.20k|                             uint8_t* dst_ptr) {
 1864|  2.20k|  int i;
 1865|  2.20k|  void (*ScaleCols)(uint8_t* dst_ptr, const uint8_t* src_ptr, int dst_width,
 1866|  2.20k|                    int x, int dx) = ScaleCols_C;
 1867|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1868|  2.20k|  int x = 0;
 1869|  2.20k|  int y = 0;
 1870|  2.20k|  int dx = 0;
 1871|  2.20k|  int dy = 0;
 1872|  2.20k|  ScaleSlope(src_width, src_height, dst_width, dst_height, kFilterNone, &x, &y,
 1873|  2.20k|             &dx, &dy);
 1874|  2.20k|  src_width = Abs(src_width);
 1875|       |
 1876|  2.20k|  if (src_width * 2 == dst_width && x < 0x8000) {
  ------------------
  |  Branch (1876:7): [True: 0, False: 2.20k]
  |  Branch (1876:37): [True: 0, False: 0]
  ------------------
 1877|      0|    ScaleCols = ScaleColsUp2_C;
 1878|       |#if defined(HAS_SCALECOLS_SSE2)
 1879|       |    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
 1880|       |      ScaleCols = ScaleColsUp2_SSE2;
 1881|       |    }
 1882|       |#endif
 1883|      0|  }
 1884|       |
 1885|  77.8k|  for (i = 0; i < dst_height; ++i) {
  ------------------
  |  Branch (1885:15): [True: 75.6k, False: 2.20k]
  ------------------
 1886|  75.6k|    ScaleCols(dst_ptr, src_ptr + (y >> 16) * src_stride, dst_width, x, dx);
 1887|  75.6k|    dst_ptr += dst_stride;
 1888|  75.6k|    y += dy;
 1889|  75.6k|  }
 1890|  2.20k|}
scale.cc:_ZN6libyuvL23ScalePlaneBilinearUp_16EiiiillPKtPtNS_10FilterModeE:
 1718|  13.0k|                                   enum FilterMode filtering) {
 1719|  13.0k|  assert(src_width > 0);
 1720|  13.0k|  assert(src_height > 0);
 1721|  13.0k|  assert(dst_width > 0);
 1722|  13.0k|  assert(dst_height > 0);
 1723|       |
 1724|  13.0k|  int j;
 1725|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1726|  13.0k|  int x = 0;
 1727|  13.0k|  int y = 0;
 1728|  13.0k|  int dx = 0;
 1729|  13.0k|  int dy = 0;
 1730|  13.0k|  const int max_y = (src_height - 1) << 16;
 1731|  13.0k|  void (*InterpolateRow)(uint16_t* dst_ptr, const uint16_t* src_ptr,
 1732|  13.0k|                         ptrdiff_t src_stride, int dst_width,
 1733|  13.0k|                         int source_y_fraction) = InterpolateRow_16_C;
 1734|  13.0k|  void (*ScaleFilterCols)(uint16_t* dst_ptr, const uint16_t* src_ptr,
 1735|  13.0k|                          int dst_width, int x, int dx) =
 1736|  13.0k|      filtering ? ScaleFilterCols_16_C : ScaleCols_16_C;
  ------------------
  |  Branch (1736:7): [True: 13.0k, False: 0]
  ------------------
 1737|  13.0k|  ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, &x, &y,
 1738|  13.0k|             &dx, &dy);
 1739|  13.0k|  assert(dy <= 65536);
 1740|  13.0k|  src_width = Abs(src_width);
 1741|       |
 1742|       |#if defined(HAS_INTERPOLATEROW_16_SSSE3)
 1743|       |  if (TestCpuFlag(kCpuHasSSSE3)) {
 1744|       |    InterpolateRow = InterpolateRow_16_Any_SSSE3;
 1745|       |    if (IS_ALIGNED(dst_width, 16)) {
 1746|       |      InterpolateRow = InterpolateRow_16_SSSE3;
 1747|       |    }
 1748|       |  }
 1749|       |#endif
 1750|  13.0k|#if defined(HAS_INTERPOLATEROW_16_AVX2)
 1751|  13.0k|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1751:7): [True: 13.0k, False: 0]
  ------------------
 1752|  13.0k|    InterpolateRow = InterpolateRow_16_Any_AVX2;
 1753|  13.0k|    if (IS_ALIGNED(dst_width, 32)) {
  ------------------
  |  | 1002|  13.0k|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 450, False: 12.5k]
  |  |  ------------------
  ------------------
 1754|    450|      InterpolateRow = InterpolateRow_16_AVX2;
 1755|    450|    }
 1756|  13.0k|  }
 1757|  13.0k|#endif
 1758|       |#if defined(HAS_INTERPOLATEROW_16_NEON)
 1759|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1760|       |    InterpolateRow = InterpolateRow_16_Any_NEON;
 1761|       |    if (IS_ALIGNED(dst_width, 16)) {
 1762|       |      InterpolateRow = InterpolateRow_16_NEON;
 1763|       |    }
 1764|       |  }
 1765|       |#endif
 1766|       |#if defined(HAS_INTERPOLATEROW_16_SME)
 1767|       |  if (TestCpuFlag(kCpuHasSME)) {
 1768|       |    InterpolateRow = InterpolateRow_16_SME;
 1769|       |  }
 1770|       |#endif
 1771|       |
 1772|  13.0k|  if (filtering && src_width >= 32768) {
  ------------------
  |  Branch (1772:7): [True: 13.0k, False: 0]
  |  Branch (1772:20): [True: 0, False: 13.0k]
  ------------------
 1773|      0|    ScaleFilterCols = ScaleFilterCols64_16_C;
 1774|      0|  }
 1775|       |#if defined(HAS_SCALEFILTERCOLS_16_SSSE3)
 1776|       |  if (filtering && TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
 1777|       |    ScaleFilterCols = ScaleFilterCols_16_SSSE3;
 1778|       |  }
 1779|       |#endif
 1780|  13.0k|  if (!filtering && src_width * 2 == dst_width && x < 0x8000) {
  ------------------
  |  Branch (1780:7): [True: 0, False: 13.0k]
  |  Branch (1780:21): [True: 0, False: 0]
  |  Branch (1780:51): [True: 0, False: 0]
  ------------------
 1781|      0|    ScaleFilterCols = ScaleColsUp2_16_C;
 1782|       |#if defined(HAS_SCALECOLS_16_SSE2)
 1783|       |    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
 1784|       |      ScaleFilterCols = ScaleColsUp2_16_SSE2;
 1785|       |    }
 1786|       |#endif
 1787|      0|  }
 1788|       |
 1789|  13.0k|  if (y > max_y) {
  ------------------
  |  Branch (1789:7): [True: 442, False: 12.5k]
  ------------------
 1790|    442|    y = max_y;
 1791|    442|  }
 1792|  13.0k|  {
 1793|  13.0k|    int yi = y >> 16;
 1794|  13.0k|    const uint16_t* src = src_ptr + yi * src_stride;
 1795|       |
 1796|       |    // Allocate 2 row buffers.
 1797|  13.0k|    const int row_size = (dst_width + 31) & ~31;
 1798|  13.0k|    align_buffer_64(row, row_size * 4);
  ------------------
  |  | 1005|  13.0k|  size_t var##_mem_size = (size); /* NOLINT */                             \
  |  | 1006|  13.0k|  void* var##_mem = (var##_mem_size > SIZE_MAX - 63)                       \
  |  |  ------------------
  |  |  |  Branch (1006:21): [True: 0, False: 13.0k]
  |  |  ------------------
  |  | 1007|  13.0k|                        ? NULL                                             \
  |  | 1008|  13.0k|                        : malloc(var##_mem_size + 63);        /* NOLINT */ \
  |  | 1009|  13.0k|  uint8_t* var = (uint8_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */
  ------------------
 1799|  13.0k|    ptrdiff_t rowstride = row_size;
 1800|  13.0k|    int lasty = yi;
 1801|  13.0k|    uint16_t* rowptr = (uint16_t*)row;
 1802|  13.0k|    if (!row)
  ------------------
  |  Branch (1802:9): [True: 0, False: 13.0k]
  ------------------
 1803|      0|      return 1;
 1804|       |
 1805|  13.0k|    ScaleFilterCols(rowptr, src, dst_width, x, dx);
 1806|  13.0k|    if (src_height > 1) {
  ------------------
  |  Branch (1806:9): [True: 12.5k, False: 442]
  ------------------
 1807|  12.5k|      src += src_stride;
 1808|  12.5k|    }
 1809|  13.0k|    ScaleFilterCols(rowptr + rowstride, src, dst_width, x, dx);
 1810|  13.0k|    if (src_height > 2) {
  ------------------
  |  Branch (1810:9): [True: 11.3k, False: 1.73k]
  ------------------
 1811|  11.3k|      src += src_stride;
 1812|  11.3k|    }
 1813|       |
 1814|       |    // 2-row rolling buffer:
 1815|       |    // rowptr and (rowptr + rowstride) hold the scaled rows for yi and yi + 1.
 1816|       |    // Because dy <= 65536 (dy <= 1.0 in 16.16), yi advances in unit steps.
 1817|       |    // When yi != lasty:
 1818|       |    // 1. Scale the next source row into the older buffer (rowptr).
 1819|       |    // 2. Swap buffer pointers (rowptr += rowstride; rowstride = -rowstride;)
 1820|       |    //    so rowptr points to yi and (rowptr + rowstride) points to yi + 1.
 1821|       |    // 3. Advance src by 1 row if row yi + 2 exists ((y + 65536) < max_y),
 1822|       |    //    otherwise clamp src at (src_height - 1) to avoid reading out of bounds.
 1823|   553k|    for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1823:17): [True: 540k, False: 13.0k]
  ------------------
 1824|   540k|      if (y > max_y) {
  ------------------
  |  Branch (1824:11): [True: 2.58k, False: 537k]
  ------------------
 1825|  2.58k|        y = max_y;
 1826|  2.58k|      }
 1827|   540k|      yi = y >> 16;
 1828|   540k|      if (yi != lasty) {
  ------------------
  |  Branch (1828:11): [True: 274k, False: 266k]
  ------------------
 1829|   274k|        ScaleFilterCols(rowptr, src, dst_width, x, dx);
 1830|   274k|        rowptr += rowstride;
 1831|   274k|        rowstride = -rowstride;
 1832|   274k|        lasty = yi;
 1833|   274k|        if ((y + 65536) < max_y) {
  ------------------
  |  Branch (1833:13): [True: 262k, False: 11.3k]
  ------------------
 1834|   262k|          src += src_stride;
 1835|   262k|        }
 1836|   274k|      }
 1837|   540k|      if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1837:11): [True: 3.02k, False: 537k]
  ------------------
 1838|  3.02k|        InterpolateRow(dst_ptr, rowptr, 0, dst_width, 0);
 1839|   537k|      } else {
 1840|   537k|        int yf = (y >> 8) & 255;
 1841|   537k|        InterpolateRow(dst_ptr, rowptr, rowstride, dst_width, yf);
 1842|   537k|      }
 1843|   540k|      dst_ptr += dst_stride;
 1844|   540k|      y += dy;
 1845|   540k|    }
 1846|  13.0k|    free_aligned_buffer_64(row);
  ------------------
  |  | 1012|  13.0k|  free(var##_mem);                  \
  |  | 1013|  13.0k|  var = NULL
  ------------------
 1847|  13.0k|  }
 1848|      0|  return 0;
 1849|  13.0k|}
scale.cc:_ZN6libyuvL25ScalePlaneBilinearDown_16EiiiillPKtPtNS_10FilterModeE:
 1129|     72|                                     enum FilterMode filtering) {
 1130|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1131|     72|  int x = 0;
 1132|     72|  int y = 0;
 1133|     72|  int dx = 0;
 1134|     72|  int dy = 0;
 1135|       |  // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear.
 1136|       |  // Allocate a row buffer.
 1137|     72|  align_buffer_64(row, src_width * 2);
  ------------------
  |  | 1005|     72|  size_t var##_mem_size = (size); /* NOLINT */                             \
  |  | 1006|     72|  void* var##_mem = (var##_mem_size > SIZE_MAX - 63)                       \
  |  |  ------------------
  |  |  |  Branch (1006:21): [True: 0, False: 72]
  |  |  ------------------
  |  | 1007|     72|                        ? NULL                                             \
  |  | 1008|     72|                        : malloc(var##_mem_size + 63);        /* NOLINT */ \
  |  | 1009|     72|  uint8_t* var = (uint8_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */
  ------------------
 1138|     72|  if (!row)
  ------------------
  |  Branch (1138:7): [True: 0, False: 72]
  ------------------
 1139|      0|    return 1;
 1140|       |
 1141|     72|  const int max_y = (src_height - 1) << 16;
 1142|     72|  int j;
 1143|     72|  void (*ScaleFilterCols)(uint16_t* dst_ptr, const uint16_t* src_ptr,
 1144|     72|                          int dst_width, int x, int dx) =
 1145|     72|      (src_width >= 32768) ? ScaleFilterCols64_16_C : ScaleFilterCols_16_C;
  ------------------
  |  Branch (1145:7): [True: 0, False: 72]
  ------------------
 1146|     72|  void (*InterpolateRow)(uint16_t* dst_ptr, const uint16_t* src_ptr,
 1147|     72|                         ptrdiff_t src_stride, int dst_width,
 1148|     72|                         int source_y_fraction) = InterpolateRow_16_C;
 1149|     72|  ScaleSlope(src_width, src_height, dst_width, dst_height, filtering, &x, &y,
 1150|     72|             &dx, &dy);
 1151|     72|  src_width = Abs(src_width);
 1152|       |
 1153|       |#if defined(HAS_INTERPOLATEROW_16_SSSE3)
 1154|       |  if (TestCpuFlag(kCpuHasSSSE3)) {
 1155|       |    InterpolateRow = InterpolateRow_16_Any_SSSE3;
 1156|       |    if (IS_ALIGNED(src_width, 16)) {
 1157|       |      InterpolateRow = InterpolateRow_16_SSSE3;
 1158|       |    }
 1159|       |  }
 1160|       |#endif
 1161|     72|#if defined(HAS_INTERPOLATEROW_16_AVX2)
 1162|     72|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1162:7): [True: 72, False: 0]
  ------------------
 1163|     72|    InterpolateRow = InterpolateRow_16_Any_AVX2;
 1164|     72|    if (IS_ALIGNED(src_width, 32)) {
  ------------------
  |  | 1002|     72|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 10, False: 62]
  |  |  ------------------
  ------------------
 1165|     10|      InterpolateRow = InterpolateRow_16_AVX2;
 1166|     10|    }
 1167|     72|  }
 1168|     72|#endif
 1169|       |#if defined(HAS_INTERPOLATEROW_16_NEON)
 1170|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1171|       |    InterpolateRow = InterpolateRow_16_Any_NEON;
 1172|       |    if (IS_ALIGNED(src_width, 16)) {
 1173|       |      InterpolateRow = InterpolateRow_16_NEON;
 1174|       |    }
 1175|       |  }
 1176|       |#endif
 1177|       |#if defined(HAS_INTERPOLATEROW_16_SME)
 1178|       |  if (TestCpuFlag(kCpuHasSME)) {
 1179|       |    InterpolateRow = InterpolateRow_16_SME;
 1180|       |  }
 1181|       |#endif
 1182|       |
 1183|       |#if defined(HAS_SCALEFILTERCOLS_16_SSSE3)
 1184|       |  if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
 1185|       |    ScaleFilterCols = ScaleFilterCols_16_SSSE3;
 1186|       |  }
 1187|       |#endif
 1188|     72|  if (y > max_y) {
  ------------------
  |  Branch (1188:7): [True: 0, False: 72]
  ------------------
 1189|      0|    y = max_y;
 1190|      0|  }
 1191|       |
 1192|    360|  for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1192:15): [True: 288, False: 72]
  ------------------
 1193|    288|    int yi = y >> 16;
 1194|    288|    const uint16_t* src = src_ptr + yi * src_stride;
 1195|    288|    if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1195:9): [True: 288, False: 0]
  ------------------
 1196|    288|      ScaleFilterCols(dst_ptr, src, dst_width, x, dx);
 1197|    288|    } else {
 1198|      0|      int yf = (y >> 8) & 255;
 1199|      0|      InterpolateRow((uint16_t*)row, src, src_stride, src_width, yf);
 1200|      0|      ScaleFilterCols(dst_ptr, (uint16_t*)row, dst_width, x, dx);
 1201|      0|    }
 1202|    288|    dst_ptr += dst_stride;
 1203|    288|    y += dy;
 1204|    288|    if (y > max_y) {
  ------------------
  |  Branch (1204:9): [True: 144, False: 144]
  ------------------
 1205|    144|      y = max_y;
 1206|    144|    }
 1207|    288|  }
 1208|       |  free_aligned_buffer_64(row);
  ------------------
  |  | 1012|     72|  free(var##_mem);                  \
  |  | 1013|     72|  var = NULL
  ------------------
 1209|     72|  return 0;
 1210|     72|}
scale.cc:_ZN6libyuvL19ScalePlaneSimple_16EiiiillPKtPt:
 1899|  1.20k|                                uint16_t* dst_ptr) {
 1900|  1.20k|  int i;
 1901|  1.20k|  void (*ScaleCols)(uint16_t* dst_ptr, const uint16_t* src_ptr, int dst_width,
 1902|  1.20k|                    int x, int dx) = ScaleCols_16_C;
 1903|       |  // Initial source x/y coordinate and step values as 16.16 fixed point.
 1904|  1.20k|  int x = 0;
 1905|  1.20k|  int y = 0;
 1906|  1.20k|  int dx = 0;
 1907|  1.20k|  int dy = 0;
 1908|  1.20k|  ScaleSlope(src_width, src_height, dst_width, dst_height, kFilterNone, &x, &y,
 1909|  1.20k|             &dx, &dy);
 1910|  1.20k|  src_width = Abs(src_width);
 1911|       |
 1912|  1.20k|  if (src_width * 2 == dst_width && x < 0x8000) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 1.20k]
  |  Branch (1912:37): [True: 0, False: 0]
  ------------------
 1913|      0|    ScaleCols = ScaleColsUp2_16_C;
 1914|       |#if defined(HAS_SCALECOLS_16_SSE2)
 1915|       |    if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(dst_width, 8)) {
 1916|       |      ScaleCols = ScaleColsUp2_16_SSE2;
 1917|       |    }
 1918|       |#endif
 1919|      0|  }
 1920|       |
 1921|  61.5k|  for (i = 0; i < dst_height; ++i) {
  ------------------
  |  Branch (1921:15): [True: 60.3k, False: 1.20k]
  ------------------
 1922|  60.3k|    ScaleCols(dst_ptr, src_ptr + (y >> 16) * src_stride, dst_width, x, dx);
 1923|  60.3k|    dst_ptr += dst_stride;
 1924|  60.3k|    y += dy;
 1925|  60.3k|  }
 1926|  1.20k|}
scale.cc:_ZN6libyuvL23ScalePlaneUp2_12_LinearEiiiillPKtPt:
 1516|    226|                                    uint16_t* dst_ptr) {
 1517|    226|  void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr,
 1518|    226|                     int dst_width) = ScaleRowUp2_Linear_16_Any_C;
 1519|    226|  int i;
 1520|    226|  int y;
 1521|    226|  int dy;
 1522|       |
 1523|    226|  (void)src_width;
 1524|       |  // This function can only scale up by 2 times horizontally.
 1525|    226|  assert(src_width == ((dst_width + 1) / 2));
 1526|       |
 1527|    226|#ifdef HAS_SCALEROWUP2_LINEAR_12_SSSE3
 1528|    226|  if (TestCpuFlag(kCpuHasSSSE3)) {
  ------------------
  |  Branch (1528:7): [True: 226, False: 0]
  ------------------
 1529|    226|    ScaleRowUp = ScaleRowUp2_Linear_12_Any_SSSE3;
 1530|    226|  }
 1531|    226|#endif
 1532|       |
 1533|    226|#ifdef HAS_SCALEROWUP2_LINEAR_12_AVX2
 1534|    226|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1534:7): [True: 226, False: 0]
  ------------------
 1535|    226|    ScaleRowUp = ScaleRowUp2_Linear_12_Any_AVX2;
 1536|    226|  }
 1537|    226|#endif
 1538|       |
 1539|       |#ifdef HAS_SCALEROWUP2_LINEAR_12_NEON
 1540|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1541|       |    ScaleRowUp = ScaleRowUp2_Linear_12_Any_NEON;
 1542|       |  }
 1543|       |#endif
 1544|       |
 1545|    226|  if (dst_height == 1) {
  ------------------
  |  Branch (1545:7): [True: 0, False: 226]
  ------------------
 1546|      0|    ScaleRowUp(src_ptr + ((src_height - 1) / 2) * src_stride, dst_ptr,
 1547|      0|               dst_width);
 1548|    226|  } else {
 1549|    226|    dy = FixedDiv(src_height - 1, dst_height - 1);
  ------------------
  |  |  241|    226|#define FixedDiv FixedDiv_X86
  ------------------
 1550|    226|    y = (1 << 15) - 1;
 1551|  1.57k|    for (i = 0; i < dst_height; ++i) {
  ------------------
  |  Branch (1551:17): [True: 1.35k, False: 226]
  ------------------
 1552|  1.35k|      ScaleRowUp(src_ptr + (y >> 16) * src_stride, dst_ptr, dst_width);
 1553|  1.35k|      dst_ptr += dst_stride;
 1554|  1.35k|      y += dy;
 1555|  1.35k|    }
 1556|    226|  }
 1557|    226|}
scale.cc:_ZN6libyuvL25ScalePlaneUp2_12_BilinearEiiiillPKtPt:
 1571|    514|                                      uint16_t* dst_ptr) {
 1572|    514|  void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride,
 1573|    514|                      uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) =
 1574|    514|      ScaleRowUp2_Bilinear_16_Any_C;
 1575|    514|  int x;
 1576|       |
 1577|    514|  (void)src_width;
 1578|       |  // This function can only scale up by 2 times.
 1579|    514|  assert(src_width == ((dst_width + 1) / 2));
 1580|    514|  assert(src_height == ((dst_height + 1) / 2));
 1581|       |
 1582|    514|#ifdef HAS_SCALEROWUP2_BILINEAR_12_SSSE3
 1583|    514|  if (TestCpuFlag(kCpuHasSSSE3)) {
  ------------------
  |  Branch (1583:7): [True: 514, False: 0]
  ------------------
 1584|    514|    Scale2RowUp = ScaleRowUp2_Bilinear_12_Any_SSSE3;
 1585|    514|  }
 1586|    514|#endif
 1587|       |
 1588|    514|#ifdef HAS_SCALEROWUP2_BILINEAR_12_AVX2
 1589|    514|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1589:7): [True: 514, False: 0]
  ------------------
 1590|    514|    Scale2RowUp = ScaleRowUp2_Bilinear_12_Any_AVX2;
 1591|    514|  }
 1592|    514|#endif
 1593|       |
 1594|       |#ifdef HAS_SCALEROWUP2_BILINEAR_12_NEON
 1595|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1596|       |    Scale2RowUp = ScaleRowUp2_Bilinear_12_Any_NEON;
 1597|       |  }
 1598|       |#endif
 1599|       |
 1600|    514|  Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width);
 1601|    514|  dst_ptr += dst_stride;
 1602|  9.92k|  for (x = 0; x < src_height - 1; ++x) {
  ------------------
  |  Branch (1602:15): [True: 9.41k, False: 514]
  ------------------
 1603|  9.41k|    Scale2RowUp(src_ptr, src_stride, dst_ptr, dst_stride, dst_width);
 1604|  9.41k|    src_ptr += src_stride;
 1605|  9.41k|    dst_ptr += 2 * dst_stride;
 1606|  9.41k|  }
 1607|    514|  if (!(dst_height & 1)) {
  ------------------
  |  Branch (1607:7): [True: 264, False: 250]
  ------------------
 1608|    264|    Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width);
 1609|    264|  }
 1610|    514|}

ScaleRowUp2_Linear_Any_AVX2:
  571|  2.05k|  void NAME(const PTYPE* src_ptr, PTYPE* dst_ptr, int dst_width) { \
  572|  2.05k|    int work_width = (dst_width - 1) & ~1;                         \
  573|  2.05k|    int r = work_width & MASK;                                     \
  574|  2.05k|    int n = work_width & ~MASK;                                    \
  575|  2.05k|    dst_ptr[0] = src_ptr[0];                                       \
  576|  2.05k|    if (work_width > 0) {                                          \
  ------------------
  |  Branch (576:9): [True: 2.05k, False: 0]
  ------------------
  577|  2.05k|      if (n != 0) {                                                \
  ------------------
  |  Branch (577:11): [True: 464, False: 1.59k]
  ------------------
  578|    464|        SIMD(src_ptr, dst_ptr + 1, n);                             \
  579|    464|      }                                                            \
  580|  2.05k|      C(src_ptr + (n / 2), dst_ptr + n + 1, r);                    \
  581|  2.05k|    }                                                              \
  582|  2.05k|    dst_ptr[dst_width - 1] = src_ptr[(dst_width - 1) / 2];         \
  583|  2.05k|  }
ScaleRowUp2_Linear_12_Any_AVX2:
  571|  1.35k|  void NAME(const PTYPE* src_ptr, PTYPE* dst_ptr, int dst_width) { \
  572|  1.35k|    int work_width = (dst_width - 1) & ~1;                         \
  573|  1.35k|    int r = work_width & MASK;                                     \
  574|  1.35k|    int n = work_width & ~MASK;                                    \
  575|  1.35k|    dst_ptr[0] = src_ptr[0];                                       \
  576|  1.35k|    if (work_width > 0) {                                          \
  ------------------
  |  Branch (576:9): [True: 1.35k, False: 0]
  ------------------
  577|  1.35k|      if (n != 0) {                                                \
  ------------------
  |  Branch (577:11): [True: 350, False: 1.00k]
  ------------------
  578|    350|        SIMD(src_ptr, dst_ptr + 1, n);                             \
  579|    350|      }                                                            \
  580|  1.35k|      C(src_ptr + (n / 2), dst_ptr + n + 1, r);                    \
  581|  1.35k|    }                                                              \
  582|  1.35k|    dst_ptr[dst_width - 1] = src_ptr[(dst_width - 1) / 2];         \
  583|  1.35k|  }
ScaleRowUp2_Bilinear_Any_AVX2:
  694|  29.1k|            ptrdiff_t dst_stride, int dst_width) {                        \
  695|  29.1k|    int work_width = (dst_width - 1) & ~1;                                \
  696|  29.1k|    int r = work_width & MASK;                                            \
  697|  29.1k|    int n = work_width & ~MASK;                                           \
  698|  29.1k|    const PTYPE* sa = src_ptr;                                            \
  699|  29.1k|    const PTYPE* sb = src_ptr + src_stride;                               \
  700|  29.1k|    PTYPE* da = dst_ptr;                                                  \
  701|  29.1k|    PTYPE* db = dst_ptr + dst_stride;                                     \
  702|  29.1k|    da[0] = (3 * sa[0] + sb[0] + 2) >> 2;                                 \
  703|  29.1k|    db[0] = (sa[0] + 3 * sb[0] + 2) >> 2;                                 \
  704|  29.1k|    if (work_width > 0) {                                                 \
  ------------------
  |  Branch (704:9): [True: 29.1k, False: 0]
  ------------------
  705|  29.1k|      if (n != 0) {                                                       \
  ------------------
  |  Branch (705:11): [True: 18.2k, False: 10.9k]
  ------------------
  706|  18.2k|        SIMD(sa, sb - sa, da + 1, db - da, n);                            \
  707|  18.2k|      }                                                                   \
  708|  29.1k|      C(sa + (n / 2), sb - sa, da + n + 1, db - da, r);                   \
  709|  29.1k|    }                                                                     \
  710|  29.1k|    da[dst_width - 1] =                                                   \
  711|  29.1k|        (3 * sa[(dst_width - 1) / 2] + sb[(dst_width - 1) / 2] + 2) >> 2; \
  712|  29.1k|    db[dst_width - 1] =                                                   \
  713|  29.1k|        (sa[(dst_width - 1) / 2] + 3 * sb[(dst_width - 1) / 2] + 2) >> 2; \
  714|  29.1k|  }
ScaleRowUp2_Bilinear_12_Any_AVX2:
  694|  10.1k|            ptrdiff_t dst_stride, int dst_width) {                        \
  695|  10.1k|    int work_width = (dst_width - 1) & ~1;                                \
  696|  10.1k|    int r = work_width & MASK;                                            \
  697|  10.1k|    int n = work_width & ~MASK;                                           \
  698|  10.1k|    const PTYPE* sa = src_ptr;                                            \
  699|  10.1k|    const PTYPE* sb = src_ptr + src_stride;                               \
  700|  10.1k|    PTYPE* da = dst_ptr;                                                  \
  701|  10.1k|    PTYPE* db = dst_ptr + dst_stride;                                     \
  702|  10.1k|    da[0] = (3 * sa[0] + sb[0] + 2) >> 2;                                 \
  703|  10.1k|    db[0] = (sa[0] + 3 * sb[0] + 2) >> 2;                                 \
  704|  10.1k|    if (work_width > 0) {                                                 \
  ------------------
  |  Branch (704:9): [True: 10.1k, False: 0]
  ------------------
  705|  10.1k|      if (n != 0) {                                                       \
  ------------------
  |  Branch (705:11): [True: 1.49k, False: 8.69k]
  ------------------
  706|  1.49k|        SIMD(sa, sb - sa, da + 1, db - da, n);                            \
  707|  1.49k|      }                                                                   \
  708|  10.1k|      C(sa + (n / 2), sb - sa, da + n + 1, db - da, r);                   \
  709|  10.1k|    }                                                                     \
  710|  10.1k|    da[dst_width - 1] =                                                   \
  711|  10.1k|        (3 * sa[(dst_width - 1) / 2] + sb[(dst_width - 1) / 2] + 2) >> 2; \
  712|  10.1k|    db[dst_width - 1] =                                                   \
  713|  10.1k|        (sa[(dst_width - 1) / 2] + 3 * sb[(dst_width - 1) / 2] + 2) >> 2; \
  714|  10.1k|  }

ScaleRowUp2_Linear_C:
  417|  2.05k|                          int dst_width) {
  418|  2.05k|  int src_width = dst_width >> 1;
  419|  2.05k|  int x;
  420|  2.05k|  assert((dst_width % 2 == 0) && (dst_width >= 0));
  421|  12.3k|  for (x = 0; x < src_width; ++x) {
  ------------------
  |  Branch (421:15): [True: 10.3k, False: 2.05k]
  ------------------
  422|  10.3k|    dst_ptr[2 * x + 0] = (src_ptr[x + 0] * 3 + src_ptr[x + 1] * 1 + 2) >> 2;
  423|  10.3k|    dst_ptr[2 * x + 1] = (src_ptr[x + 0] * 1 + src_ptr[x + 1] * 3 + 2) >> 2;
  424|  10.3k|  }
  425|  2.05k|}
ScaleRowUp2_Bilinear_C:
  441|  29.1k|                            int dst_width) {
  442|  29.1k|  const uint8_t* s = src_ptr;
  443|  29.1k|  const uint8_t* t = src_ptr + src_stride;
  444|  29.1k|  uint8_t* d = dst_ptr;
  445|  29.1k|  uint8_t* e = dst_ptr + dst_stride;
  446|  29.1k|  int src_width = dst_width >> 1;
  447|  29.1k|  int x;
  448|  29.1k|  assert((dst_width % 2 == 0) && (dst_width >= 0));
  449|   224k|  for (x = 0; x < src_width; ++x) {
  ------------------
  |  Branch (449:15): [True: 195k, False: 29.1k]
  ------------------
  450|   195k|    d[2 * x + 0] =
  451|   195k|        (s[x + 0] * 9 + s[x + 1] * 3 + t[x + 0] * 3 + t[x + 1] * 1 + 8) >> 4;
  452|   195k|    d[2 * x + 1] =
  453|   195k|        (s[x + 0] * 3 + s[x + 1] * 9 + t[x + 0] * 1 + t[x + 1] * 3 + 8) >> 4;
  454|   195k|    e[2 * x + 0] =
  455|   195k|        (s[x + 0] * 3 + s[x + 1] * 1 + t[x + 0] * 9 + t[x + 1] * 3 + 8) >> 4;
  456|   195k|    e[2 * x + 1] =
  457|   195k|        (s[x + 0] * 1 + s[x + 1] * 3 + t[x + 0] * 3 + t[x + 1] * 9 + 8) >> 4;
  458|   195k|  }
  459|  29.1k|}
ScaleRowUp2_Linear_16_C:
  464|  1.35k|                             int dst_width) {
  465|  1.35k|  int src_width = dst_width >> 1;
  466|  1.35k|  int x;
  467|  1.35k|  assert((dst_width % 2 == 0) && (dst_width >= 0));
  468|  6.15k|  for (x = 0; x < src_width; ++x) {
  ------------------
  |  Branch (468:15): [True: 4.80k, False: 1.35k]
  ------------------
  469|  4.80k|    dst_ptr[2 * x + 0] = (src_ptr[x + 0] * 3 + src_ptr[x + 1] * 1 + 2) >> 2;
  470|  4.80k|    dst_ptr[2 * x + 1] = (src_ptr[x + 0] * 1 + src_ptr[x + 1] * 3 + 2) >> 2;
  471|  4.80k|  }
  472|  1.35k|}
ScaleRowUp2_Bilinear_16_C:
  479|  10.1k|                               int dst_width) {
  480|  10.1k|  const uint16_t* s = src_ptr;
  481|  10.1k|  const uint16_t* t = src_ptr + src_stride;
  482|  10.1k|  uint16_t* d = dst_ptr;
  483|  10.1k|  uint16_t* e = dst_ptr + dst_stride;
  484|  10.1k|  int src_width = dst_width >> 1;
  485|  10.1k|  int x;
  486|  10.1k|  assert((dst_width % 2 == 0) && (dst_width >= 0));
  487|  42.5k|  for (x = 0; x < src_width; ++x) {
  ------------------
  |  Branch (487:15): [True: 32.3k, False: 10.1k]
  ------------------
  488|  32.3k|    d[2 * x + 0] =
  489|  32.3k|        (s[x + 0] * 9 + s[x + 1] * 3 + t[x + 0] * 3 + t[x + 1] * 1 + 8) >> 4;
  490|  32.3k|    d[2 * x + 1] =
  491|  32.3k|        (s[x + 0] * 3 + s[x + 1] * 9 + t[x + 0] * 1 + t[x + 1] * 3 + 8) >> 4;
  492|  32.3k|    e[2 * x + 0] =
  493|  32.3k|        (s[x + 0] * 3 + s[x + 1] * 1 + t[x + 0] * 9 + t[x + 1] * 3 + 8) >> 4;
  494|  32.3k|    e[2 * x + 1] =
  495|  32.3k|        (s[x + 0] * 1 + s[x + 1] * 3 + t[x + 0] * 3 + t[x + 1] * 9 + 8) >> 4;
  496|  32.3k|  }
  497|  10.1k|}
ScaleCols_C:
  504|  75.6k|                 int dx) {
  505|  75.6k|  int j;
  506|   332k|  for (j = 0; j < dst_width - 1; j += 2) {
  ------------------
  |  Branch (506:15): [True: 257k, False: 75.6k]
  ------------------
  507|   257k|    dst_ptr[0] = src_ptr[x >> 16];
  508|   257k|    x += dx;
  509|   257k|    dst_ptr[1] = src_ptr[x >> 16];
  510|   257k|    x += dx;
  511|   257k|    dst_ptr += 2;
  512|   257k|  }
  513|  75.6k|  if (dst_width & 1) {
  ------------------
  |  Branch (513:7): [True: 9.54k, False: 66.1k]
  ------------------
  514|  9.54k|    dst_ptr[0] = src_ptr[x >> 16];
  515|  9.54k|  }
  516|  75.6k|}
ScaleCols_16_C:
  522|  60.3k|                    int dx) {
  523|  60.3k|  int j;
  524|   243k|  for (j = 0; j < dst_width - 1; j += 2) {
  ------------------
  |  Branch (524:15): [True: 183k, False: 60.3k]
  ------------------
  525|   183k|    dst_ptr[0] = src_ptr[x >> 16];
  526|   183k|    x += dx;
  527|   183k|    dst_ptr[1] = src_ptr[x >> 16];
  528|   183k|    x += dx;
  529|   183k|    dst_ptr += 2;
  530|   183k|  }
  531|  60.3k|  if (dst_width & 1) {
  ------------------
  |  Branch (531:7): [True: 9.31k, False: 51.0k]
  ------------------
  532|  9.31k|    dst_ptr[0] = src_ptr[x >> 16];
  533|  9.31k|  }
  534|  60.3k|}
ScaleFilterCols_16_C:
  649|   300k|                          int dx) {
  650|   300k|  int j;
  651|  3.65M|  for (j = 0; j < dst_width - 1; j += 2) {
  ------------------
  |  Branch (651:15): [True: 3.35M, False: 300k]
  ------------------
  652|  3.35M|    int xi = x >> 16;
  653|  3.35M|    int a = src_ptr[xi];
  654|  3.35M|    int b = src_ptr[xi + 1];
  655|  3.35M|    dst_ptr[0] = BLENDER(a, b, x & 0xffff);
  ------------------
  |  |  641|  3.35M|  (uint16_t)((int)(a) +                                                       \
  |  |  642|  3.35M|             (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> \
  |  |  643|  3.35M|                   16))
  ------------------
  656|  3.35M|    x += dx;
  657|  3.35M|    xi = x >> 16;
  658|  3.35M|    a = src_ptr[xi];
  659|  3.35M|    b = src_ptr[xi + 1];
  660|  3.35M|    dst_ptr[1] = BLENDER(a, b, x & 0xffff);
  ------------------
  |  |  641|  3.35M|  (uint16_t)((int)(a) +                                                       \
  |  |  642|  3.35M|             (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> \
  |  |  643|  3.35M|                   16))
  ------------------
  661|  3.35M|    x += dx;
  662|  3.35M|    dst_ptr += 2;
  663|  3.35M|  }
  664|   300k|  if (dst_width & 1) {
  ------------------
  |  Branch (664:7): [True: 144k, False: 156k]
  ------------------
  665|   144k|    int xi = x >> 16;
  666|   144k|    int a = src_ptr[xi];
  667|   144k|    int b = src_ptr[xi + 1];
  668|   144k|    dst_ptr[0] = BLENDER(a, b, x & 0xffff);
  ------------------
  |  |  641|   144k|  (uint16_t)((int)(a) +                                                       \
  |  |  642|   144k|             (int)((((int64_t)((f)) * ((int64_t)(b) - (int)(a))) + 0x8000) >> \
  |  |  643|   144k|                   16))
  ------------------
  669|   144k|  }
  670|   300k|}
ScalePlaneVertical:
 1471|    248|                        enum FilterMode filtering) {
 1472|       |  // TODO(fbarchard): Allow higher bpp.
 1473|    248|  int dst_width_bytes = dst_width * bpp;
 1474|    248|  void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb,
 1475|    248|                         ptrdiff_t src_stride, int dst_width,
 1476|    248|                         int source_y_fraction) = InterpolateRow_C;
 1477|    248|  const int64_t max_y =
 1478|    248|      (src_height > 1) ? (((int64_t)src_height - 1) << 16) - 1 : 0;
  ------------------
  |  Branch (1478:7): [True: 216, False: 32]
  ------------------
 1479|    248|  int64_t y64 = y;
 1480|    248|  int j;
 1481|    248|  assert(bpp >= 1 && bpp <= 4);
 1482|    248|  assert(src_height != 0);
 1483|    248|  assert(dst_width > 0);
 1484|    248|  assert(dst_height > 0);
 1485|    248|  src_argb += (x >> 16) * bpp;
 1486|    248|#if defined(HAS_INTERPOLATEROW_AVX2)
 1487|    248|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1487:7): [True: 248, False: 0]
  ------------------
 1488|    248|    InterpolateRow = InterpolateRow_Any_AVX2;
 1489|    248|    if (IS_ALIGNED(dst_width_bytes, 32)) {
  ------------------
  |  | 1002|    248|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 0, False: 248]
  |  |  ------------------
  ------------------
 1490|      0|      InterpolateRow = InterpolateRow_AVX2;
 1491|      0|    }
 1492|    248|  }
 1493|    248|#endif
 1494|       |#if defined(HAS_INTERPOLATEROW_NEON)
 1495|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1496|       |    InterpolateRow = InterpolateRow_Any_NEON;
 1497|       |    if (IS_ALIGNED(dst_width_bytes, 16)) {
 1498|       |      InterpolateRow = InterpolateRow_NEON;
 1499|       |    }
 1500|       |  }
 1501|       |#endif
 1502|       |#if defined(HAS_INTERPOLATEROW_SVE2)
 1503|       |  if (TestCpuFlag(kCpuHasSVE2)) {
 1504|       |    InterpolateRow = InterpolateRow_SVE2;
 1505|       |  }
 1506|       |#endif
 1507|       |#if defined(HAS_INTERPOLATEROW_SME)
 1508|       |  if (TestCpuFlag(kCpuHasSME)) {
 1509|       |    InterpolateRow = InterpolateRow_SME;
 1510|       |  }
 1511|       |#endif
 1512|       |#if defined(HAS_INTERPOLATEROW_LSX)
 1513|       |  if (TestCpuFlag(kCpuHasLSX)) {
 1514|       |    InterpolateRow = InterpolateRow_Any_LSX;
 1515|       |    if (IS_ALIGNED(dst_width_bytes, 32)) {
 1516|       |      InterpolateRow = InterpolateRow_LSX;
 1517|       |    }
 1518|       |  }
 1519|       |#endif
 1520|       |#if defined(HAS_INTERPOLATEROW_RVV)
 1521|       |  if (TestCpuFlag(kCpuHasRVV)) {
 1522|       |    InterpolateRow = InterpolateRow_RVV;
 1523|       |  }
 1524|       |#endif
 1525|       |
 1526|  3.70k|  for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1526:15): [True: 3.45k, False: 248]
  ------------------
 1527|  3.45k|    int yi;
 1528|  3.45k|    int yf;
 1529|  3.45k|    if (y64 > max_y) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 3.45k]
  ------------------
 1530|      0|      y64 = max_y;
 1531|      0|    }
 1532|  3.45k|    yi = (int)(y64 >> 16);
 1533|  3.45k|    yf = filtering ? (int)((y64 >> 8) & 255) : 0;
  ------------------
  |  Branch (1533:10): [True: 3.29k, False: 168]
  ------------------
 1534|  3.45k|    InterpolateRow(dst_argb, src_argb + yi * (ptrdiff_t)src_stride, src_stride,
 1535|  3.45k|                   dst_width_bytes, yf);
 1536|  3.45k|    dst_argb += dst_stride;
 1537|  3.45k|    y64 += dy;
 1538|  3.45k|  }
 1539|    248|}
ScalePlaneVertical_16:
 1552|    152|                           enum FilterMode filtering) {
 1553|       |  // TODO(fbarchard): Allow higher wpp.
 1554|    152|  int dst_width_words = dst_width * wpp;
 1555|    152|  void (*InterpolateRow)(uint16_t* dst_argb, const uint16_t* src_argb,
 1556|    152|                         ptrdiff_t src_stride, int dst_width,
 1557|    152|                         int source_y_fraction) = InterpolateRow_16_C;
 1558|    152|  const int64_t max_y =
 1559|    152|      (src_height > 1) ? (((int64_t)src_height - 1) << 16) - 1 : 0;
  ------------------
  |  Branch (1559:7): [True: 114, False: 38]
  ------------------
 1560|    152|  int64_t y64 = y;
 1561|    152|  int j;
 1562|    152|  assert(wpp >= 1 && wpp <= 2);
 1563|    152|  assert(src_height != 0);
 1564|    152|  assert(dst_width > 0);
 1565|    152|  assert(dst_height > 0);
 1566|    152|  src_argb += (x >> 16) * wpp;
 1567|       |#if defined(HAS_INTERPOLATEROW_16_SSSE3)
 1568|       |  if (TestCpuFlag(kCpuHasSSSE3)) {
 1569|       |    InterpolateRow = InterpolateRow_16_Any_SSSE3;
 1570|       |    if (IS_ALIGNED(dst_width_words, 16)) {
 1571|       |      InterpolateRow = InterpolateRow_16_SSSE3;
 1572|       |    }
 1573|       |  }
 1574|       |#endif
 1575|    152|#if defined(HAS_INTERPOLATEROW_16_AVX2)
 1576|    152|  if (TestCpuFlag(kCpuHasAVX2)) {
  ------------------
  |  Branch (1576:7): [True: 152, False: 0]
  ------------------
 1577|    152|    InterpolateRow = InterpolateRow_16_Any_AVX2;
 1578|    152|    if (IS_ALIGNED(dst_width_words, 32)) {
  ------------------
  |  | 1002|    152|#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
  |  |  ------------------
  |  |  |  Branch (1002:26): [True: 0, False: 152]
  |  |  ------------------
  ------------------
 1579|      0|      InterpolateRow = InterpolateRow_16_AVX2;
 1580|      0|    }
 1581|    152|  }
 1582|    152|#endif
 1583|       |#if defined(HAS_INTERPOLATEROW_16_NEON)
 1584|       |  if (TestCpuFlag(kCpuHasNEON)) {
 1585|       |    InterpolateRow = InterpolateRow_16_Any_NEON;
 1586|       |    if (IS_ALIGNED(dst_width_words, 8)) {
 1587|       |      InterpolateRow = InterpolateRow_16_NEON;
 1588|       |    }
 1589|       |  }
 1590|       |#endif
 1591|       |#if defined(HAS_INTERPOLATEROW_16_SME)
 1592|       |  if (TestCpuFlag(kCpuHasSME)) {
 1593|       |    InterpolateRow = InterpolateRow_16_SME;
 1594|       |  }
 1595|       |#endif
 1596|  4.27k|  for (j = 0; j < dst_height; ++j) {
  ------------------
  |  Branch (1596:15): [True: 4.12k, False: 152]
  ------------------
 1597|  4.12k|    int yi;
 1598|  4.12k|    int yf;
 1599|  4.12k|    if (y64 > max_y) {
  ------------------
  |  Branch (1599:9): [True: 0, False: 4.12k]
  ------------------
 1600|      0|      y64 = max_y;
 1601|      0|    }
 1602|  4.12k|    yi = (int)(y64 >> 16);
 1603|  4.12k|    yf = filtering ? (int)((y64 >> 8) & 255) : 0;
  ------------------
  |  Branch (1603:10): [True: 3.92k, False: 204]
  ------------------
 1604|  4.12k|    InterpolateRow(dst_argb, src_argb + yi * (ptrdiff_t)src_stride, src_stride,
 1605|  4.12k|                   dst_width_words, yf);
 1606|  4.12k|    dst_argb += dst_stride;
 1607|  4.12k|    y64 += dy;
 1608|  4.12k|  }
 1609|    152|}
ScaleFilterReduce:
 1616|  64.3k|                                  enum FilterMode filtering) {
 1617|  64.3k|  if (src_width < 0) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 64.3k]
  ------------------
 1618|      0|    src_width = -src_width;
 1619|      0|  }
 1620|  64.3k|  if (src_height < 0) {
  ------------------
  |  Branch (1620:7): [True: 0, False: 64.3k]
  ------------------
 1621|      0|    src_height = -src_height;
 1622|      0|  }
 1623|  64.3k|  if (filtering == kFilterBox) {
  ------------------
  |  Branch (1623:7): [True: 49.8k, False: 14.4k]
  ------------------
 1624|       |    // If scaling either axis to 0.5 or larger, switch from Box to Bilinear.
 1625|  49.8k|    if (dst_width * 2 >= src_width || dst_height * 2 >= src_height) {
  ------------------
  |  Branch (1625:9): [True: 49.8k, False: 0]
  |  Branch (1625:39): [True: 0, False: 0]
  ------------------
 1626|  49.8k|      filtering = kFilterBilinear;
 1627|  49.8k|    }
 1628|  49.8k|  }
 1629|  64.3k|  if (filtering == kFilterBilinear) {
  ------------------
  |  Branch (1629:7): [True: 62.5k, False: 1.78k]
  ------------------
 1630|  62.5k|    if (src_height == 1) {
  ------------------
  |  Branch (1630:9): [True: 3.11k, False: 59.4k]
  ------------------
 1631|  3.11k|      filtering = kFilterLinear;
 1632|  3.11k|    }
 1633|       |    // TODO(fbarchard): Detect any odd scale factor and reduce to Linear.
 1634|  62.5k|    if (dst_height == src_height || dst_height * 3 == src_height) {
  ------------------
  |  Branch (1634:9): [True: 404, False: 62.1k]
  |  Branch (1634:37): [True: 0, False: 62.1k]
  ------------------
 1635|    404|      filtering = kFilterLinear;
 1636|    404|    }
 1637|       |    // TODO(fbarchard): Remove 1 pixel wide filter restriction, which is to
 1638|       |    // avoid reading 2 pixels horizontally that causes memory exception.
 1639|  62.5k|    if (src_width == 1) {
  ------------------
  |  Branch (1639:9): [True: 3.40k, False: 59.1k]
  ------------------
 1640|  3.40k|      filtering = kFilterNone;
 1641|  3.40k|    }
 1642|  62.5k|  }
 1643|  64.3k|  if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1643:7): [True: 3.18k, False: 61.1k]
  ------------------
 1644|  3.18k|    if (src_width == 1) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 3.18k]
  ------------------
 1645|      0|      filtering = kFilterNone;
 1646|      0|    }
 1647|       |    // TODO(fbarchard): Detect any odd scale factor and reduce to None.
 1648|  3.18k|    if (dst_width == src_width || dst_width * 3 == src_width) {
  ------------------
  |  Branch (1648:9): [True: 136, False: 3.05k]
  |  Branch (1648:35): [True: 0, False: 3.05k]
  ------------------
 1649|    136|      filtering = kFilterNone;
 1650|    136|    }
 1651|  3.18k|  }
 1652|  64.3k|  return filtering;
 1653|  64.3k|}
ScaleSlope:
 1676|  47.3k|                int* dy) {
 1677|  47.3k|  assert(x != NULL);
 1678|  47.3k|  assert(y != NULL);
 1679|  47.3k|  assert(dx != NULL);
 1680|  47.3k|  assert(dy != NULL);
 1681|  47.3k|  assert(src_width != 0);
 1682|  47.3k|  assert(src_height != 0);
 1683|  47.3k|  assert(dst_width > 0);
 1684|  47.3k|  assert(dst_height > 0);
 1685|       |  // Check for 1 pixel and avoid FixedDiv overflow.
 1686|  47.3k|  if (dst_width == 1 && src_width >= 32768) {
  ------------------
  |  Branch (1686:7): [True: 0, False: 47.3k]
  |  Branch (1686:25): [True: 0, False: 0]
  ------------------
 1687|      0|    dst_width = src_width;
 1688|      0|  }
 1689|  47.3k|  if (dst_height == 1 && src_height >= 32768) {
  ------------------
  |  Branch (1689:7): [True: 0, False: 47.3k]
  |  Branch (1689:26): [True: 0, False: 0]
  ------------------
 1690|      0|    dst_height = src_height;
 1691|      0|  }
 1692|  47.3k|  if (filtering == kFilterBox) {
  ------------------
  |  Branch (1692:7): [True: 0, False: 47.3k]
  ------------------
 1693|       |    // Scale step for point sampling duplicates all pixels equally.
 1694|      0|    *dx = FixedDiv(Abs(src_width), dst_width);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1695|      0|    *dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1696|      0|    *x = 0;
 1697|      0|    *y = 0;
 1698|  47.3k|  } else if (filtering == kFilterBilinear) {
  ------------------
  |  Branch (1698:14): [True: 41.9k, False: 5.40k]
  ------------------
 1699|       |    // Scale step for bilinear sampling renders last pixel once for upsample.
 1700|  41.9k|    if (dst_width <= Abs(src_width)) {
  ------------------
  |  Branch (1700:9): [True: 0, False: 41.9k]
  ------------------
 1701|      0|      *dx = FixedDiv(Abs(src_width), dst_width);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1702|      0|      *x = CENTERSTART(*dx, -32768);  // Subtract 0.5 (32768) to center filter.
  ------------------
  |  | 1665|      0|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (1665:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1703|  41.9k|    } else if (src_width > 1 && dst_width > 1) {
  ------------------
  |  Branch (1703:16): [True: 41.9k, False: 0]
  |  Branch (1703:33): [True: 41.9k, False: 0]
  ------------------
 1704|  41.9k|      *dx = FixedDiv1(Abs(src_width), dst_width);
  ------------------
  |  |  242|  41.9k|#define FixedDiv1 FixedDiv1_X86
  ------------------
 1705|  41.9k|      *x = 0;
 1706|  41.9k|    }
 1707|  41.9k|    if (dst_height <= src_height) {
  ------------------
  |  Branch (1707:9): [True: 0, False: 41.9k]
  ------------------
 1708|      0|      *dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1709|      0|      *y = CENTERSTART(*dy, -32768);  // Subtract 0.5 (32768) to center filter.
  ------------------
  |  | 1665|      0|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (1665:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1710|  41.9k|    } else if (src_height > 1 && dst_height > 1) {
  ------------------
  |  Branch (1710:16): [True: 41.9k, False: 0]
  |  Branch (1710:34): [True: 41.9k, False: 0]
  ------------------
 1711|  41.9k|      *dy = FixedDiv1(src_height, dst_height);
  ------------------
  |  |  242|  41.9k|#define FixedDiv1 FixedDiv1_X86
  ------------------
 1712|  41.9k|      *y = 0;
 1713|  41.9k|    }
 1714|  41.9k|  } else if (filtering == kFilterLinear) {
  ------------------
  |  Branch (1714:14): [True: 1.99k, False: 3.40k]
  ------------------
 1715|       |    // Scale step for bilinear sampling renders last pixel once for upsample.
 1716|  1.99k|    if (dst_width <= Abs(src_width)) {
  ------------------
  |  Branch (1716:9): [True: 0, False: 1.99k]
  ------------------
 1717|      0|      *dx = FixedDiv(Abs(src_width), dst_width);
  ------------------
  |  |  241|      0|#define FixedDiv FixedDiv_X86
  ------------------
 1718|      0|      *x = CENTERSTART(*dx, -32768);  // Subtract 0.5 (32768) to center filter.
  ------------------
  |  | 1665|      0|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (1665:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1719|  1.99k|    } else if (src_width > 1 && dst_width > 1) {
  ------------------
  |  Branch (1719:16): [True: 1.99k, False: 0]
  |  Branch (1719:33): [True: 1.99k, False: 0]
  ------------------
 1720|  1.99k|      *dx = FixedDiv1(Abs(src_width), dst_width);
  ------------------
  |  |  242|  1.99k|#define FixedDiv1 FixedDiv1_X86
  ------------------
 1721|  1.99k|      *x = 0;
 1722|  1.99k|    }
 1723|  1.99k|    *dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|  1.99k|#define FixedDiv FixedDiv_X86
  ------------------
 1724|  1.99k|    *y = *dy >> 1;
 1725|  3.40k|  } else {
 1726|       |    // Scale step for point sampling duplicates all pixels equally.
 1727|  3.40k|    *dx = FixedDiv(Abs(src_width), dst_width);
  ------------------
  |  |  241|  3.40k|#define FixedDiv FixedDiv_X86
  ------------------
 1728|  3.40k|    *dy = FixedDiv(src_height, dst_height);
  ------------------
  |  |  241|  3.40k|#define FixedDiv FixedDiv_X86
  ------------------
 1729|  3.40k|    *x = CENTERSTART(*dx, 0);
  ------------------
  |  | 1665|  3.40k|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (1665:28): [True: 0, False: 3.40k]
  |  |  ------------------
  ------------------
 1730|  3.40k|    *y = CENTERSTART(*dy, 0);
  ------------------
  |  | 1665|  3.40k|#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
  |  |  ------------------
  |  |  |  Branch (1665:28): [True: 0, False: 3.40k]
  |  |  ------------------
  ------------------
 1731|  3.40k|  }
 1732|       |  // Negative src_width means horizontally mirror.
 1733|  47.3k|  if (src_width < 0) {
  ------------------
  |  Branch (1733:7): [True: 0, False: 47.3k]
  ------------------
 1734|      0|    *x += (dst_width - 1) * *dx;
 1735|      0|    *dx = -*dx;
 1736|       |    // src_width = -src_width;   // Caller must do this.
 1737|      0|  }
 1738|  47.3k|}
scale_common.cc:_ZN6libyuvL3AbsEi:
   32|  91.3k|static __inline int Abs(int v) {
   33|  91.3k|  return v >= 0 ? v : -v;
  ------------------
  |  Branch (33:10): [True: 91.3k, False: 0]
  ------------------
   34|  91.3k|}

ScaleRowUp2_Linear_AVX2:
 1388|    464|                             int dst_width) {
 1389|    464|  asm volatile(
 1390|    464|      "vpcmpeqw    %%ymm4,%%ymm4,%%ymm4          \n"
 1391|    464|      "vpsrlw      $15,%%ymm4,%%ymm4             \n"
 1392|    464|      "vpsllw      $1,%%ymm4,%%ymm4              \n"  // all 2
 1393|    464|      "vbroadcastf128 %3,%%ymm3                  \n"
 1394|       |
 1395|    464|      LABELALIGN
 1396|    464|      "1:          \n"
 1397|    464|      "vmovdqu     (%0),%%xmm0                   \n"  // 0123456789ABCDEF
 1398|    464|      "vmovdqu     1(%0),%%xmm1                  \n"  // 123456789ABCDEF0
 1399|    464|      "vpermq      $0b11011000,%%ymm0,%%ymm0     \n"
 1400|    464|      "vpermq      $0b11011000,%%ymm1,%%ymm1     \n"
 1401|    464|      "vpunpcklwd  %%ymm0,%%ymm0,%%ymm0          \n"
 1402|    464|      "vpunpcklwd  %%ymm1,%%ymm1,%%ymm1          \n"
 1403|    464|      "vpunpckhdq  %%ymm1,%%ymm0,%%ymm2          \n"
 1404|    464|      "vpunpckldq  %%ymm1,%%ymm0,%%ymm0          \n"
 1405|    464|      "vpmaddubsw  %%ymm3,%%ymm2,%%ymm1          \n"  // 3*near+far (hi)
 1406|    464|      "vpmaddubsw  %%ymm3,%%ymm0,%%ymm0          \n"  // 3*near+far (lo)
 1407|    464|      "vpaddw      %%ymm4,%%ymm0,%%ymm0          \n"  // 3*near+far+2 (lo)
 1408|    464|      "vpaddw      %%ymm4,%%ymm1,%%ymm1          \n"  // 3*near+far+2 (hi)
 1409|    464|      "vpsrlw      $2,%%ymm0,%%ymm0              \n"  // 3/4*near+1/4*far (lo)
 1410|    464|      "vpsrlw      $2,%%ymm1,%%ymm1              \n"  // 3/4*near+1/4*far (hi)
 1411|    464|      "vpackuswb   %%ymm1,%%ymm0,%%ymm0          \n"
 1412|    464|      "vmovdqu     %%ymm0,(%1)                   \n"
 1413|       |
 1414|    464|      "lea         0x10(%0),%0                   \n"
 1415|    464|      "lea         0x20(%1),%1                   \n"  // 16 sample to 32 sample
 1416|    464|      "sub         $0x20,%2                      \n"
 1417|    464|      "jg          1b                            \n"
 1418|    464|      "vzeroupper  \n"
 1419|    464|      : "+r"(src_ptr),      // %0
 1420|    464|        "+r"(dst_ptr),      // %1
 1421|    464|        "+r"(dst_width)     // %2
 1422|    464|      : "m"(kLinearMadd31)  // %3
 1423|    464|      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4");
 1424|    464|}
ScaleRowUp2_Bilinear_AVX2:
 1432|  18.2k|                               int dst_width) {
 1433|  18.2k|  asm volatile(
 1434|  18.2k|      "vpcmpeqw    %%ymm6,%%ymm6,%%ymm6          \n"
 1435|  18.2k|      "vpsrlw      $15,%%ymm6,%%ymm6             \n"
 1436|  18.2k|      "vpsllw      $3,%%ymm6,%%ymm6              \n"  // all 8
 1437|  18.2k|      "vbroadcastf128 %5,%%ymm7                  \n"
 1438|       |
 1439|  18.2k|      LABELALIGN
 1440|  18.2k|      "1:          \n"
 1441|  18.2k|      "vmovdqu     (%0),%%xmm0                   \n"  // 0123456789ABCDEF
 1442|  18.2k|      "vmovdqu     1(%0),%%xmm1                  \n"  // 123456789ABCDEF0
 1443|  18.2k|      "vpermq      $0b11011000,%%ymm0,%%ymm0     \n"
 1444|  18.2k|      "vpermq      $0b11011000,%%ymm1,%%ymm1     \n"
 1445|  18.2k|      "vpunpcklwd  %%ymm0,%%ymm0,%%ymm0          \n"
 1446|  18.2k|      "vpunpcklwd  %%ymm1,%%ymm1,%%ymm1          \n"
 1447|  18.2k|      "vpunpckhdq  %%ymm1,%%ymm0,%%ymm2          \n"
 1448|  18.2k|      "vpunpckldq  %%ymm1,%%ymm0,%%ymm0          \n"
 1449|  18.2k|      "vpmaddubsw  %%ymm7,%%ymm2,%%ymm1          \n"  // 3*near+far (1, hi)
 1450|  18.2k|      "vpmaddubsw  %%ymm7,%%ymm0,%%ymm0          \n"  // 3*near+far (1, lo)
 1451|       |
 1452|  18.2k|      "vmovdqu     (%0,%3),%%xmm2                \n"  // 0123456789ABCDEF
 1453|  18.2k|      "vmovdqu     1(%0,%3),%%xmm3               \n"  // 123456789ABCDEF0
 1454|  18.2k|      "vpermq      $0b11011000,%%ymm2,%%ymm2     \n"
 1455|  18.2k|      "vpermq      $0b11011000,%%ymm3,%%ymm3     \n"
 1456|  18.2k|      "vpunpcklwd  %%ymm2,%%ymm2,%%ymm2          \n"
 1457|  18.2k|      "vpunpcklwd  %%ymm3,%%ymm3,%%ymm3          \n"
 1458|  18.2k|      "vpunpckhdq  %%ymm3,%%ymm2,%%ymm4          \n"
 1459|  18.2k|      "vpunpckldq  %%ymm3,%%ymm2,%%ymm2          \n"
 1460|  18.2k|      "vpmaddubsw  %%ymm7,%%ymm4,%%ymm3          \n"  // 3*near+far (2, hi)
 1461|  18.2k|      "vpmaddubsw  %%ymm7,%%ymm2,%%ymm2          \n"  // 3*near+far (2, lo)
 1462|       |
 1463|       |      // ymm0 ymm1
 1464|       |      // ymm2 ymm3
 1465|       |
 1466|  18.2k|      "vpaddw      %%ymm0,%%ymm0,%%ymm4          \n"  // 6*near+2*far (1, lo)
 1467|  18.2k|      "vpaddw      %%ymm6,%%ymm2,%%ymm5          \n"  // 3*near+far+8 (2, lo)
 1468|  18.2k|      "vpaddw      %%ymm4,%%ymm0,%%ymm4          \n"  // 9*near+3*far (1, lo)
 1469|  18.2k|      "vpaddw      %%ymm4,%%ymm5,%%ymm4          \n"  // 9 3 3 1 + 8 (1, lo)
 1470|  18.2k|      "vpsrlw      $4,%%ymm4,%%ymm4              \n"  // ^ div by 16 (1, lo)
 1471|       |
 1472|  18.2k|      "vpaddw      %%ymm2,%%ymm2,%%ymm5          \n"  // 6*near+2*far (2, lo)
 1473|  18.2k|      "vpaddw      %%ymm6,%%ymm0,%%ymm0          \n"  // 3*near+far+8 (1, lo)
 1474|  18.2k|      "vpaddw      %%ymm5,%%ymm2,%%ymm5          \n"  // 9*near+3*far (2, lo)
 1475|  18.2k|      "vpaddw      %%ymm5,%%ymm0,%%ymm5          \n"  // 9 3 3 1 + 8 (2, lo)
 1476|  18.2k|      "vpsrlw      $4,%%ymm5,%%ymm5              \n"  // ^ div by 16 (2, lo)
 1477|       |
 1478|  18.2k|      "vpaddw      %%ymm1,%%ymm1,%%ymm0          \n"  // 6*near+2*far (1, hi)
 1479|  18.2k|      "vpaddw      %%ymm6,%%ymm3,%%ymm2          \n"  // 3*near+far+8 (2, hi)
 1480|  18.2k|      "vpaddw      %%ymm0,%%ymm1,%%ymm0          \n"  // 9*near+3*far (1, hi)
 1481|  18.2k|      "vpaddw      %%ymm0,%%ymm2,%%ymm0          \n"  // 9 3 3 1 + 8 (1, hi)
 1482|  18.2k|      "vpsrlw      $4,%%ymm0,%%ymm0              \n"  // ^ div by 16 (1, hi)
 1483|       |
 1484|  18.2k|      "vpaddw      %%ymm3,%%ymm3,%%ymm2          \n"  // 6*near+2*far (2, hi)
 1485|  18.2k|      "vpaddw      %%ymm6,%%ymm1,%%ymm1          \n"  // 3*near+far+8 (1, hi)
 1486|  18.2k|      "vpaddw      %%ymm2,%%ymm3,%%ymm2          \n"  // 9*near+3*far (2, hi)
 1487|  18.2k|      "vpaddw      %%ymm2,%%ymm1,%%ymm2          \n"  // 9 3 3 1 + 8 (2, hi)
 1488|  18.2k|      "vpsrlw      $4,%%ymm2,%%ymm2              \n"  // ^ div by 16 (2, hi)
 1489|       |
 1490|  18.2k|      "vpackuswb   %%ymm0,%%ymm4,%%ymm4          \n"
 1491|  18.2k|      "vmovdqu     %%ymm4,(%1)                   \n"  // store above
 1492|  18.2k|      "vpackuswb   %%ymm2,%%ymm5,%%ymm5          \n"
 1493|  18.2k|      "vmovdqu     %%ymm5,(%1,%4)                \n"  // store below
 1494|       |
 1495|  18.2k|      "lea         0x10(%0),%0                   \n"
 1496|  18.2k|      "lea         0x20(%1),%1                   \n"  // 16 sample to 32 sample
 1497|  18.2k|      "sub         $0x20,%2                      \n"
 1498|  18.2k|      "jg          1b                            \n"
 1499|  18.2k|      "vzeroupper  \n"
 1500|  18.2k|      : "+r"(src_ptr),      // %0
 1501|  18.2k|        "+r"(dst_ptr),      // %1
 1502|  18.2k|        "+r"(dst_width)     // %2
 1503|  18.2k|      : "r"(src_stride),    // %3
 1504|  18.2k|        "r"(dst_stride),    // %4
 1505|  18.2k|        "m"(kLinearMadd31)  // %5
 1506|  18.2k|      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
 1507|  18.2k|        "xmm7");
 1508|  18.2k|}
ScaleRowUp2_Linear_12_AVX2:
 1514|    350|                                int dst_width) {
 1515|    350|  asm volatile(
 1516|    350|      "vbroadcastf128 %3,%%ymm5                  \n"
 1517|    350|      "vpcmpeqw    %%ymm4,%%ymm4,%%ymm4          \n"
 1518|    350|      "vpsrlw      $15,%%ymm4,%%ymm4             \n"
 1519|    350|      "vpsllw      $1,%%ymm4,%%ymm4              \n"  // all 2
 1520|       |
 1521|    350|      LABELALIGN
 1522|    350|      "1:          \n"
 1523|    350|      "vmovdqu     (%0),%%ymm0                   \n"  // 0123456789ABCDEF (16b)
 1524|    350|      "vmovdqu     2(%0),%%ymm1                  \n"  // 123456789ABCDEF0 (16b)
 1525|       |
 1526|    350|      "vpermq      $0b11011000,%%ymm0,%%ymm0     \n"  // 012389AB4567CDEF
 1527|    350|      "vpermq      $0b11011000,%%ymm1,%%ymm1     \n"  // 12349ABC5678DEF0
 1528|       |
 1529|    350|      "vpunpckhwd  %%ymm1,%%ymm0,%%ymm2          \n"  // 899AABBCCDDEEFF0 (near)
 1530|    350|      "vpunpcklwd  %%ymm1,%%ymm0,%%ymm0          \n"  // 0112233445566778 (near)
 1531|    350|      "vpshufb     %%ymm5,%%ymm2,%%ymm3          \n"  // 98A9BACBDCEDFE0F (far)
 1532|    350|      "vpshufb     %%ymm5,%%ymm0,%%ymm1          \n"  // 1021324354657687 (far)
 1533|       |
 1534|    350|      "vpaddw      %%ymm4,%%ymm1,%%ymm1          \n"  // far+2
 1535|    350|      "vpaddw      %%ymm4,%%ymm3,%%ymm3          \n"  // far+2
 1536|    350|      "vpaddw      %%ymm0,%%ymm1,%%ymm1          \n"  // near+far+2
 1537|    350|      "vpaddw      %%ymm2,%%ymm3,%%ymm3          \n"  // near+far+2
 1538|    350|      "vpaddw      %%ymm0,%%ymm0,%%ymm0          \n"  // 2*near
 1539|    350|      "vpaddw      %%ymm2,%%ymm2,%%ymm2          \n"  // 2*near
 1540|    350|      "vpaddw      %%ymm0,%%ymm1,%%ymm0          \n"  // 3*near+far+2
 1541|    350|      "vpaddw      %%ymm2,%%ymm3,%%ymm2          \n"  // 3*near+far+2
 1542|       |
 1543|    350|      "vpsrlw      $2,%%ymm0,%%ymm0              \n"  // 3/4*near+1/4*far
 1544|    350|      "vpsrlw      $2,%%ymm2,%%ymm2              \n"  // 3/4*near+1/4*far
 1545|    350|      "vmovdqu     %%ymm0,(%1)                   \n"
 1546|    350|      "vmovdqu     %%ymm2,32(%1)                 \n"
 1547|       |
 1548|    350|      "lea         0x20(%0),%0                   \n"
 1549|    350|      "lea         0x40(%1),%1                   \n"  // 16 sample to 32 sample
 1550|    350|      "sub         $0x20,%2                      \n"
 1551|    350|      "jg          1b                            \n"
 1552|    350|      "vzeroupper  \n"
 1553|    350|      : "+r"(src_ptr),          // %0
 1554|    350|        "+r"(dst_ptr),          // %1
 1555|    350|        "+r"(dst_width)         // %2
 1556|    350|      : "m"(kLinearShuffleFar)  // %3
 1557|    350|      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5");
 1558|    350|}
ScaleRowUp2_Bilinear_12_AVX2:
 1566|  1.49k|                                  int dst_width) {
 1567|  1.49k|  asm volatile(
 1568|  1.49k|      "vbroadcastf128 %5,%%ymm5                  \n"
 1569|  1.49k|      "vpcmpeqw    %%ymm4,%%ymm4,%%ymm4          \n"
 1570|  1.49k|      "vpsrlw      $15,%%ymm4,%%ymm4             \n"
 1571|  1.49k|      "vpsllw      $3,%%ymm4,%%ymm4              \n"  // all 8
 1572|       |
 1573|  1.49k|      LABELALIGN
 1574|  1.49k|      "1:          \n"
 1575|       |
 1576|  1.49k|      "vmovdqu     (%0),%%xmm0                   \n"  // 01234567 (16b)
 1577|  1.49k|      "vmovdqu     2(%0),%%xmm1                  \n"  // 12345678 (16b)
 1578|  1.49k|      "vpermq      $0b11011000,%%ymm0,%%ymm0     \n"  // 0123000045670000
 1579|  1.49k|      "vpermq      $0b11011000,%%ymm1,%%ymm1     \n"  // 1234000056780000
 1580|  1.49k|      "vpunpcklwd  %%ymm1,%%ymm0,%%ymm0          \n"  // 0112233445566778 (near)
 1581|  1.49k|      "vpshufb     %%ymm5,%%ymm0,%%ymm1          \n"  // 1021324354657687 (far)
 1582|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm1          \n"  // near+far
 1583|  1.49k|      "vpaddw      %%ymm0,%%ymm0,%%ymm0          \n"  // 2*near
 1584|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm2          \n"  // 3*near+far (1)
 1585|       |
 1586|  1.49k|      "vmovdqu     (%0,%3,2),%%xmm0              \n"  // 01234567 (16b)
 1587|  1.49k|      "vmovdqu     2(%0,%3,2),%%xmm1             \n"  // 12345678 (16b)
 1588|  1.49k|      "vpermq      $0b11011000,%%ymm0,%%ymm0     \n"  // 0123000045670000
 1589|  1.49k|      "vpermq      $0b11011000,%%ymm1,%%ymm1     \n"  // 1234000056780000
 1590|  1.49k|      "vpunpcklwd  %%ymm1,%%ymm0,%%ymm0          \n"  // 0112233445566778 (near)
 1591|  1.49k|      "vpshufb     %%ymm5,%%ymm0,%%ymm1          \n"  // 1021324354657687 (far)
 1592|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm1          \n"  // near+far
 1593|  1.49k|      "vpaddw      %%ymm0,%%ymm0,%%ymm0          \n"  // 2*near
 1594|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm3          \n"  // 3*near+far (2)
 1595|       |
 1596|  1.49k|      "vpaddw      %%ymm2,%%ymm2,%%ymm0          \n"  // 6*near+2*far (1)
 1597|  1.49k|      "vpaddw      %%ymm4,%%ymm3,%%ymm1          \n"  // 3*near+far+8 (2)
 1598|  1.49k|      "vpaddw      %%ymm0,%%ymm2,%%ymm0          \n"  // 9*near+3*far (1)
 1599|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm0          \n"  // 9 3 3 1 + 8 (1)
 1600|  1.49k|      "vpsrlw      $4,%%ymm0,%%ymm0              \n"  // ^ div by 16
 1601|  1.49k|      "vmovdqu     %%ymm0,(%1)                   \n"  // store above
 1602|       |
 1603|  1.49k|      "vpaddw      %%ymm3,%%ymm3,%%ymm0          \n"  // 6*near+2*far (2)
 1604|  1.49k|      "vpaddw      %%ymm4,%%ymm2,%%ymm1          \n"  // 3*near+far+8 (1)
 1605|  1.49k|      "vpaddw      %%ymm0,%%ymm3,%%ymm0          \n"  // 9*near+3*far (2)
 1606|  1.49k|      "vpaddw      %%ymm0,%%ymm1,%%ymm0          \n"  // 9 3 3 1 + 8 (2)
 1607|  1.49k|      "vpsrlw      $4,%%ymm0,%%ymm0              \n"  // ^ div by 16
 1608|  1.49k|      "vmovdqu     %%ymm0,(%1,%4,2)              \n"  // store below
 1609|       |
 1610|  1.49k|      "lea         0x10(%0),%0                   \n"
 1611|  1.49k|      "lea         0x20(%1),%1                   \n"  // 8 sample to 16 sample
 1612|  1.49k|      "sub         $0x10,%2                      \n"
 1613|  1.49k|      "jg          1b                            \n"
 1614|  1.49k|      "vzeroupper  \n"
 1615|  1.49k|      : "+r"(src_ptr),          // %0
 1616|  1.49k|        "+r"(dst_ptr),          // %1
 1617|  1.49k|        "+r"(dst_width)         // %2
 1618|  1.49k|      : "r"(src_stride),        // %3
 1619|  1.49k|        "r"(dst_stride),        // %4
 1620|  1.49k|        "m"(kLinearShuffleFar)  // %5
 1621|  1.49k|      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5");
 1622|  1.49k|}
ScaleFilterCols_SSSE3:
 1826|   976k|                           int dx) {
 1827|   976k|  intptr_t x0, x1, temp_pixel;
 1828|   976k|  asm volatile(
 1829|   976k|      "movd        %6,%%xmm2                     \n"
 1830|   976k|      "movd        %7,%%xmm3                     \n"
 1831|   976k|      "movl        $0x04040000,%k2               \n"
 1832|   976k|      "movd        %k2,%%xmm5                    \n"
 1833|   976k|      "pcmpeqb     %%xmm6,%%xmm6                 \n"
 1834|   976k|      "psrlw       $0x9,%%xmm6                   \n"  // 0x007f007f
 1835|   976k|      "pcmpeqb     %%xmm7,%%xmm7                 \n"  // 0x00ff mask for
 1836|       |                                                      // extracting 'a'
 1837|   976k|      "psrlw       $8,%%xmm7                     \n"
 1838|       |
 1839|   976k|      "pextrw      $0x1,%%xmm2,%k3               \n"
 1840|   976k|      "subl        $0x2,%5                       \n"
 1841|   976k|      "jl          29f                           \n"
 1842|   976k|      "movdqa      %%xmm2,%%xmm0                 \n"
 1843|   976k|      "paddd       %%xmm3,%%xmm0                 \n"
 1844|   976k|      "punpckldq   %%xmm0,%%xmm2                 \n"
 1845|   976k|      "punpckldq   %%xmm3,%%xmm3                 \n"
 1846|   976k|      "paddd       %%xmm3,%%xmm3                 \n"
 1847|   976k|      "pextrw      $0x3,%%xmm2,%k4               \n"
 1848|       |
 1849|   976k|      LABELALIGN
 1850|   976k|      "2:          \n"
 1851|   976k|      "movdqa      %%xmm2,%%xmm1                 \n"
 1852|   976k|      "paddd       %%xmm3,%%xmm2                 \n"
 1853|   976k|      "movzwl      0x00(%1,%3,1),%k2             \n"
 1854|   976k|      "movd        %k2,%%xmm0                    \n"
 1855|   976k|      "psrlw       $0x9,%%xmm1                   \n"
 1856|   976k|      "movzwl      0x00(%1,%4,1),%k2             \n"
 1857|   976k|      "movd        %k2,%%xmm4                    \n"
 1858|   976k|      "pshufb      %%xmm5,%%xmm1                 \n"
 1859|   976k|      "punpcklwd   %%xmm4,%%xmm0                 \n"
 1860|   976k|      "pxor        %%xmm6,%%xmm1                 \n"
 1861|   976k|      "movdqa      %%xmm0,%%xmm4                 \n"  // Copy pixels.
 1862|   976k|      "pmaddubsw   %%xmm1,%%xmm0                 \n"  // a * (127 - f) + b * f
 1863|   976k|      "pand        %%xmm7,%%xmm4                 \n"  // Extract left pixels
 1864|       |                                                      // 'a'.
 1865|   976k|      "paddw       %%xmm4,%%xmm0                 \n"  // a * 128 + f * (b - a)
 1866|   976k|      "pextrw      $0x1,%%xmm2,%k3               \n"
 1867|   976k|      "paddw       %8,%%xmm0                     \n"  // add rounding bias 64.
 1868|   976k|      "pextrw      $0x3,%%xmm2,%k4               \n"
 1869|   976k|      "psrlw       $0x7,%%xmm0                   \n"
 1870|   976k|      "packuswb    %%xmm0,%%xmm0                 \n"
 1871|   976k|      "movd        %%xmm0,%k2                    \n"
 1872|   976k|      "mov         %w2,(%0)                      \n"
 1873|   976k|      "lea         0x2(%0),%0                    \n"
 1874|   976k|      "subl        $0x2,%5                       \n"
 1875|   976k|      "jge         2b                            \n"
 1876|       |
 1877|   976k|      LABELALIGN
 1878|   976k|      "29:         \n"
 1879|   976k|      "addl        $0x1,%5                       \n"
 1880|   976k|      "jl          99f                           \n"
 1881|   976k|      "movzwl      0x00(%1,%3,1),%k2             \n"
 1882|   976k|      "movd        %k2,%%xmm0                    \n"
 1883|   976k|      "psrlw       $0x9,%%xmm2                   \n"
 1884|   976k|      "pshufb      %%xmm5,%%xmm2                 \n"
 1885|   976k|      "pxor        %%xmm6,%%xmm2                 \n"
 1886|   976k|      "movdqa      %%xmm0,%%xmm4                 \n"  // Copy pixels.
 1887|   976k|      "pmaddubsw   %%xmm2,%%xmm0                 \n"  // a * (127 - f) + b * f
 1888|   976k|      "pand        %%xmm7,%%xmm4                 \n"  // Extract left pixel 'a'.
 1889|   976k|      "paddw       %%xmm4,%%xmm0                 \n"  // a * 128 + f * (b - a)
 1890|   976k|      "paddw       %8,%%xmm0                     \n"  // add rounding bias 64.
 1891|   976k|      "psrlw       $0x7,%%xmm0                   \n"
 1892|   976k|      "packuswb    %%xmm0,%%xmm0                 \n"
 1893|   976k|      "movd        %%xmm0,%k2                    \n"
 1894|   976k|      "mov         %b2,(%0)                      \n"
 1895|   976k|      "99:         \n"
 1896|   976k|      : "+r"(dst_ptr),      // %0
 1897|   976k|        "+r"(src_ptr),      // %1
 1898|   976k|        "=&a"(temp_pixel),  // %2
 1899|   976k|        "=&r"(x0),          // %3
 1900|   976k|        "=&r"(x1),          // %4
 1901|   976k|#if defined(__x86_64__)
 1902|   976k|        "+rm"(dst_width)  // %5
 1903|       |#else
 1904|       |        "+m"(dst_width)  // %5
 1905|       |#endif
 1906|   976k|      : "rm"(x),   // %6
 1907|   976k|        "rm"(dx),  // %7
 1908|   976k|#if defined(__x86_64__)
 1909|   976k|        "x"(kFadd40)  // %8
 1910|       |#else
 1911|       |        "m"(kFadd40)  // %8
 1912|       |#endif
 1913|   976k|      : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
 1914|   976k|        "xmm7");
 1915|   976k|}
FixedDiv_X86:
 2289|  9.35k|int FixedDiv_X86(int num, int div) {
 2290|  9.35k|  asm volatile(
 2291|  9.35k|      "cdq         \n"
 2292|  9.35k|      "shld        $0x10,%%eax,%%edx             \n"
 2293|  9.35k|      "shl         $0x10,%%eax                   \n"
 2294|  9.35k|      "idiv        %1                            \n"
 2295|  9.35k|      "mov         %0, %%eax                     \n"
 2296|  9.35k|      : "+a"(num)  // %0
 2297|  9.35k|      : "c"(div)   // %1
 2298|  9.35k|      : "memory", "cc", "edx");
 2299|  9.35k|  return num;
 2300|  9.35k|}
FixedDiv1_X86:
 2303|  86.2k|int FixedDiv1_X86(int num, int div) {
 2304|  86.2k|  asm volatile(
 2305|  86.2k|      "cdq         \n"
 2306|  86.2k|      "shld        $0x10,%%eax,%%edx             \n"
 2307|  86.2k|      "shl         $0x10,%%eax                   \n"
 2308|  86.2k|      "sub         $0x10001,%%eax                \n"
 2309|  86.2k|      "sbb         $0x0,%%edx                    \n"
 2310|  86.2k|      "sub         $0x1,%1                       \n"
 2311|  86.2k|      "idiv        %1                            \n"
 2312|  86.2k|      "mov         %0, %%eax                     \n"
 2313|  86.2k|      : "+a"(num)  // %0
 2314|  86.2k|      : "c"(div)   // %1
 2315|  86.2k|      : "memory", "cc", "edx");
 2316|  86.2k|  return num;
 2317|  86.2k|}

_ZNK4avif16UniquePtrDeleterclEP9avifImage:
   24|  55.1k|    void operator()(avifImage * image) const { avifImageDestroy(image); }
_ZNK4avif16UniquePtrDeleterclEP11avifEncoder:
   22|  13.7k|    void operator()(avifEncoder * encoder) const { avifEncoderDestroy(encoder); }
_ZNK4avif16UniquePtrDeleterclEP11avifDecoder:
   21|  13.7k|    void operator()(avifDecoder * decoder) const { avifDecoderDestroy(decoder); }

avifGetPixelFormatInfo:
   40|   401k|{
   41|   401k|    memset(info, 0, sizeof(avifPixelFormatInfo));
   42|       |
   43|   401k|    switch (format) {
   44|  48.6k|        case AVIF_PIXEL_FORMAT_YUV444:
  ------------------
  |  Branch (44:9): [True: 48.6k, False: 352k]
  ------------------
   45|  48.6k|            info->chromaShiftX = 0;
   46|  48.6k|            info->chromaShiftY = 0;
   47|  48.6k|            break;
   48|       |
   49|  57.9k|        case AVIF_PIXEL_FORMAT_YUV422:
  ------------------
  |  Branch (49:9): [True: 57.9k, False: 343k]
  ------------------
   50|  57.9k|            info->chromaShiftX = 1;
   51|  57.9k|            info->chromaShiftY = 0;
   52|  57.9k|            break;
   53|       |
   54|   111k|        case AVIF_PIXEL_FORMAT_YUV420:
  ------------------
  |  Branch (54:9): [True: 111k, False: 289k]
  ------------------
   55|   111k|            info->chromaShiftX = 1;
   56|   111k|            info->chromaShiftY = 1;
   57|   111k|            break;
   58|       |
   59|   168k|        case AVIF_PIXEL_FORMAT_YUV400:
  ------------------
  |  Branch (59:9): [True: 168k, False: 232k]
  ------------------
   60|   168k|            info->monochrome = AVIF_TRUE;
  ------------------
  |  |   88|   168k|#define AVIF_TRUE 1
  ------------------
   61|       |            // The nonexistent chroma is considered as subsampled in each dimension
   62|       |            // according to the AV1 specification. See sections 5.5.2 and 6.4.2.
   63|   168k|            info->chromaShiftX = 1;
   64|   168k|            info->chromaShiftY = 1;
   65|   168k|            break;
   66|       |
   67|  14.3k|        case AVIF_PIXEL_FORMAT_NONE:
  ------------------
  |  Branch (67:9): [True: 14.3k, False: 387k]
  ------------------
   68|  14.3k|        case AVIF_PIXEL_FORMAT_COUNT:
  ------------------
  |  Branch (68:9): [True: 0, False: 401k]
  ------------------
   69|  14.3k|        default:
  ------------------
  |  Branch (69:9): [True: 0, False: 401k]
  ------------------
   70|  14.3k|            break;
   71|   401k|    }
   72|   401k|}
avifImageSetDefaults:
  135|   114k|{
  136|   114k|    memset(image, 0, sizeof(avifImage));
  137|   114k|    image->yuvRange = AVIF_RANGE_FULL;
  138|   114k|    image->colorPrimaries = AVIF_COLOR_PRIMARIES_UNSPECIFIED;
  139|   114k|    image->transferCharacteristics = AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED;
  140|   114k|    image->matrixCoefficients = AVIF_MATRIX_COEFFICIENTS_UNSPECIFIED;
  141|   114k|}
avifImageCreate:
  144|   114k|{
  145|       |    // width and height are checked when actually used, for example by avifImageAllocatePlanes().
  146|   114k|    AVIF_CHECKERR(depth <= 16, NULL); // avifImage only supports up to 16 bits per sample. See avifImageUsesU16().
  ------------------
  |  |   45|   114k|    do {                        \
  |  |   46|   114k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 114k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  147|       |    // Cast to silence "comparison of unsigned expression is always true" warning.
  148|   114k|    AVIF_CHECKERR((int)yuvFormat >= AVIF_PIXEL_FORMAT_NONE && yuvFormat < AVIF_PIXEL_FORMAT_COUNT, NULL);
  ------------------
  |  |   45|   114k|    do {                        \
  |  |   46|   229k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 114k, False: 0]
  |  |  |  Branch (46:15): [True: 114k, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  149|       |
  150|   114k|    avifImage * image = (avifImage *)avifAlloc(sizeof(avifImage));
  151|   114k|    AVIF_CHECKERR(image, NULL);
  ------------------
  |  |   45|   114k|    do {                        \
  |  |   46|   114k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 114k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  152|   114k|    avifImageSetDefaults(image);
  153|   114k|    image->width = width;
  154|   114k|    image->height = height;
  155|   114k|    image->depth = depth;
  156|   114k|    image->yuvFormat = yuvFormat;
  157|   114k|    return image;
  158|   114k|}
avifImageCreateEmpty:
  161|  59.7k|{
  162|  59.7k|    return avifImageCreate(0, 0, 0, AVIF_PIXEL_FORMAT_NONE);
  163|  59.7k|}
avifImageCopyNoAlloc:
  166|  13.7k|{
  167|  13.7k|    dstImage->width = srcImage->width;
  168|  13.7k|    dstImage->height = srcImage->height;
  169|  13.7k|    dstImage->depth = srcImage->depth;
  170|  13.7k|    dstImage->yuvFormat = srcImage->yuvFormat;
  171|  13.7k|    dstImage->yuvRange = srcImage->yuvRange;
  172|  13.7k|    dstImage->yuvChromaSamplePosition = srcImage->yuvChromaSamplePosition;
  173|  13.7k|    dstImage->alphaPremultiplied = srcImage->alphaPremultiplied;
  174|       |
  175|  13.7k|    dstImage->colorPrimaries = srcImage->colorPrimaries;
  176|  13.7k|    dstImage->transferCharacteristics = srcImage->transferCharacteristics;
  177|  13.7k|    dstImage->matrixCoefficients = srcImage->matrixCoefficients;
  178|  13.7k|    dstImage->clli = srcImage->clli;
  179|       |
  180|  13.7k|    dstImage->transformFlags = srcImage->transformFlags;
  181|  13.7k|    dstImage->pasp = srcImage->pasp;
  182|  13.7k|    dstImage->clap = srcImage->clap;
  183|  13.7k|    dstImage->irot = srcImage->irot;
  184|  13.7k|    dstImage->imir = srcImage->imir;
  185|  13.7k|}
avifImageCopySamples:
  188|  13.7k|{
  189|  13.7k|    assert(srcImage->depth == dstImage->depth);
  190|  13.7k|    if (planes & AVIF_PLANES_YUV) {
  ------------------
  |  Branch (190:9): [True: 0, False: 13.7k]
  ------------------
  191|      0|        assert(srcImage->yuvFormat == dstImage->yuvFormat);
  192|       |        // Note that there may be a mismatch between srcImage->yuvRange and dstImage->yuvRange
  193|       |        // because libavif allows for 'colr' and AV1 OBU video range values to differ.
  194|      0|    }
  195|  13.7k|    const size_t bytesPerPixel = avifImageUsesU16(srcImage) ? 2 : 1;
  ------------------
  |  Branch (195:34): [True: 3.87k, False: 9.91k]
  ------------------
  196|       |
  197|  13.7k|    const avifBool skipColor = !(planes & AVIF_PLANES_YUV);
  198|  13.7k|    const avifBool skipAlpha = !(planes & AVIF_PLANES_A);
  199|  68.9k|    for (int c = AVIF_CHAN_Y; c <= AVIF_CHAN_A; ++c) {
  ------------------
  |  Branch (199:31): [True: 55.1k, False: 13.7k]
  ------------------
  200|  55.1k|        const avifBool alpha = c == AVIF_CHAN_A;
  201|  55.1k|        if ((skipColor && !alpha) || (skipAlpha && alpha)) {
  ------------------
  |  Branch (201:14): [True: 55.1k, False: 0]
  |  Branch (201:27): [True: 41.3k, False: 13.7k]
  |  Branch (201:39): [True: 13.7k, False: 0]
  |  Branch (201:52): [True: 13.7k, False: 0]
  ------------------
  202|  55.1k|            continue;
  203|  55.1k|        }
  204|       |
  205|      0|        const uint32_t planeWidth = avifImagePlaneWidth(srcImage, c);
  206|      0|        const uint32_t planeHeight = avifImagePlaneHeight(srcImage, c);
  207|      0|        const uint8_t * srcRow = avifImagePlane(srcImage, c);
  208|      0|        uint8_t * dstRow = avifImagePlane(dstImage, c);
  209|      0|        const uint32_t srcRowBytes = avifImagePlaneRowBytes(srcImage, c);
  210|      0|        const uint32_t dstRowBytes = avifImagePlaneRowBytes(dstImage, c);
  211|      0|        assert(!srcRow == !dstRow);
  212|      0|        if (!srcRow) {
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            continue;
  214|      0|        }
  215|      0|        assert(planeWidth == avifImagePlaneWidth(dstImage, c));
  216|      0|        assert(planeHeight == avifImagePlaneHeight(dstImage, c));
  217|       |
  218|      0|        const size_t planeWidthBytes = planeWidth * bytesPerPixel;
  219|      0|        for (uint32_t y = 0; y < planeHeight; ++y) {
  ------------------
  |  Branch (219:30): [True: 0, False: 0]
  ------------------
  220|      0|            memcpy(dstRow, srcRow, planeWidthBytes);
  221|      0|            srcRow += srcRowBytes;
  222|      0|            dstRow += dstRowBytes;
  223|      0|        }
  224|      0|    }
  225|  13.7k|}
avifImageCopy:
  252|  13.7k|{
  253|       |    // Disallow self copy even though it could be supported easily. Self copy is
  254|       |    // unlikely to be needed, so it almost always indicates a programming error.
  255|  13.7k|    AVIF_CHECKERR(dstImage != srcImage, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  256|  13.7k|    avifImageFreePlanes(dstImage, AVIF_PLANES_ALL);
  257|  13.7k|    avifImageCopyNoAlloc(dstImage, srcImage);
  258|       |
  259|  13.7k|    AVIF_CHECKRES(avifImageSetProfileICC(dstImage, srcImage->icc.data, srcImage->icc.size));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  260|       |
  261|  13.7k|    AVIF_CHECKRES(avifRWDataSet(&dstImage->exif, srcImage->exif.data, srcImage->exif.size));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  262|  13.7k|    AVIF_CHECKRES(avifImageSetMetadataXMP(dstImage, srcImage->xmp.data, srcImage->xmp.size));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  263|       |
  264|  13.7k|    AVIF_CHECKRES(avifImageCopyProperties(dstImage, srcImage));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  265|       |
  266|  13.7k|    if ((planes & AVIF_PLANES_YUV) && srcImage->yuvPlanes[AVIF_CHAN_Y]) {
  ------------------
  |  Branch (266:9): [True: 0, False: 13.7k]
  |  Branch (266:39): [True: 0, False: 0]
  ------------------
  267|      0|        if ((srcImage->yuvFormat != AVIF_PIXEL_FORMAT_YUV400) &&
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|            (!srcImage->yuvPlanes[AVIF_CHAN_U] || !srcImage->yuvPlanes[AVIF_CHAN_V])) {
  ------------------
  |  Branch (268:14): [True: 0, False: 0]
  |  Branch (268:51): [True: 0, False: 0]
  ------------------
  269|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
  270|      0|        }
  271|      0|        const avifResult allocationResult = avifImageAllocatePlanes(dstImage, AVIF_PLANES_YUV);
  272|      0|        if (allocationResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (272:13): [True: 0, False: 0]
  ------------------
  273|      0|            return allocationResult;
  274|      0|        }
  275|      0|    }
  276|  13.7k|    if ((planes & AVIF_PLANES_A) && srcImage->alphaPlane) {
  ------------------
  |  Branch (276:9): [True: 0, False: 13.7k]
  |  Branch (276:37): [True: 0, False: 0]
  ------------------
  277|      0|        const avifResult allocationResult = avifImageAllocatePlanes(dstImage, AVIF_PLANES_A);
  278|      0|        if (allocationResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|            return allocationResult;
  280|      0|        }
  281|      0|    }
  282|  13.7k|    avifImageCopySamples(dstImage, srcImage, planes);
  283|       |
  284|  13.7k|    if (srcImage->gainMap) {
  ------------------
  |  Branch (284:9): [True: 0, False: 13.7k]
  ------------------
  285|      0|        if (!dstImage->gainMap) {
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            dstImage->gainMap = avifGainMapCreate();
  287|      0|            AVIF_CHECKERR(dstImage->gainMap, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  288|      0|        }
  289|      0|        for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (289:25): [True: 0, False: 0]
  ------------------
  290|      0|            dstImage->gainMap->gainMapMin[c] = srcImage->gainMap->gainMapMin[c];
  291|      0|            dstImage->gainMap->gainMapMax[c] = srcImage->gainMap->gainMapMax[c];
  292|      0|            dstImage->gainMap->gainMapGamma[c] = srcImage->gainMap->gainMapGamma[c];
  293|      0|            dstImage->gainMap->baseOffset[c] = srcImage->gainMap->baseOffset[c];
  294|      0|            dstImage->gainMap->alternateOffset[c] = srcImage->gainMap->alternateOffset[c];
  295|      0|        }
  296|      0|        dstImage->gainMap->baseHdrHeadroom = srcImage->gainMap->baseHdrHeadroom;
  297|      0|        dstImage->gainMap->alternateHdrHeadroom = srcImage->gainMap->alternateHdrHeadroom;
  298|      0|        dstImage->gainMap->useBaseColorSpace = srcImage->gainMap->useBaseColorSpace;
  299|      0|        AVIF_CHECKRES(avifRWDataSet(&dstImage->gainMap->altICC, srcImage->gainMap->altICC.data, srcImage->gainMap->altICC.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  300|      0|        dstImage->gainMap->altColorPrimaries = srcImage->gainMap->altColorPrimaries;
  301|      0|        dstImage->gainMap->altTransferCharacteristics = srcImage->gainMap->altTransferCharacteristics;
  302|      0|        dstImage->gainMap->altMatrixCoefficients = srcImage->gainMap->altMatrixCoefficients;
  303|      0|        dstImage->gainMap->altDepth = srcImage->gainMap->altDepth;
  304|      0|        dstImage->gainMap->altPlaneCount = srcImage->gainMap->altPlaneCount;
  305|      0|        dstImage->gainMap->altCLLI = srcImage->gainMap->altCLLI;
  306|       |
  307|      0|        if (srcImage->gainMap->image) {
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  ------------------
  308|      0|            if (!dstImage->gainMap->image) {
  ------------------
  |  Branch (308:17): [True: 0, False: 0]
  ------------------
  309|      0|                dstImage->gainMap->image = avifImageCreateEmpty();
  310|      0|                AVIF_CHECKERR(dstImage->gainMap->image, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  311|      0|            }
  312|      0|            AVIF_CHECKRES(avifImageCopy(dstImage->gainMap->image, srcImage->gainMap->image, planes));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  313|      0|        } else if (dstImage->gainMap->image) {
  ------------------
  |  Branch (313:20): [True: 0, False: 0]
  ------------------
  314|      0|            avifImageDestroy(dstImage->gainMap->image);
  315|      0|            dstImage->gainMap->image = NULL;
  316|      0|        }
  317|  13.7k|    } else if (dstImage->gainMap) {
  ------------------
  |  Branch (317:16): [True: 0, False: 13.7k]
  ------------------
  318|      0|        avifGainMapDestroy(dstImage->gainMap);
  319|      0|        dstImage->gainMap = NULL;
  320|      0|    }
  321|       |
  322|  13.7k|    return AVIF_RESULT_OK;
  323|  13.7k|}
avifImageDestroy:
  361|   114k|{
  362|   114k|    if (image->gainMap) {
  ------------------
  |  Branch (362:9): [True: 0, False: 114k]
  ------------------
  363|      0|        avifGainMapDestroy(image->gainMap);
  364|      0|    }
  365|   114k|    avifImageFreePlanes(image, AVIF_PLANES_ALL);
  366|   114k|    avifRWDataFree(&image->icc);
  367|   114k|    avifRWDataFree(&image->exif);
  368|   114k|    avifRWDataFree(&image->xmp);
  369|   114k|    for (size_t i = 0; i < image->numProperties; ++i) {
  ------------------
  |  Branch (369:24): [True: 0, False: 114k]
  ------------------
  370|      0|        avifRWDataFree(&image->properties[i].boxPayload);
  371|      0|    }
  372|   114k|    avifFree(image->properties);
  373|       |    image->properties = NULL;
  374|   114k|    image->numProperties = 0;
  375|   114k|    avifFree(image);
  376|   114k|}
avifImageSetProfileICC:
  379|  13.7k|{
  380|  13.7k|    return avifRWDataSet(&image->icc, icc, iccSize);
  381|  13.7k|}
avifImageSetMetadataXMP:
  384|  13.7k|{
  385|  13.7k|    return avifRWDataSet(&image->xmp, xmp, xmpSize);
  386|  13.7k|}
avifImageAllocatePlanes:
  432|  83.4k|{
  433|  83.4k|    if (image->width == 0 || image->height == 0 || image->depth == 0 || image->depth > 16) {
  ------------------
  |  Branch (433:9): [True: 0, False: 83.4k]
  |  Branch (433:30): [True: 0, False: 83.4k]
  |  Branch (433:52): [True: 0, False: 83.4k]
  |  Branch (433:73): [True: 0, False: 83.4k]
  ------------------
  434|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
  435|      0|    }
  436|  83.4k|    const uint32_t channelSize = avifImageUsesU16(image) ? 2 : 1;
  ------------------
  |  Branch (436:34): [True: 23.4k, False: 60.0k]
  ------------------
  437|  83.4k|    if (image->width > UINT32_MAX / channelSize) {
  ------------------
  |  Branch (437:9): [True: 0, False: 83.4k]
  ------------------
  438|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
  439|      0|    }
  440|  83.4k|    const uint32_t fullRowBytes = channelSize * image->width;
  441|  83.4k|    if (image->height > PTRDIFF_MAX / fullRowBytes) {
  ------------------
  |  Branch (441:9): [True: 0, False: 83.4k]
  ------------------
  442|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
  443|      0|    }
  444|  83.4k|    const size_t fullSize = (size_t)fullRowBytes * image->height;
  445|       |
  446|  83.4k|    if ((planes & AVIF_PLANES_YUV) && (image->yuvFormat != AVIF_PIXEL_FORMAT_NONE)) {
  ------------------
  |  Branch (446:9): [True: 76.3k, False: 7.16k]
  |  Branch (446:39): [True: 76.3k, False: 0]
  ------------------
  447|  76.3k|        avifPixelFormatInfo info;
  448|  76.3k|        avifGetPixelFormatInfo(image->yuvFormat, &info);
  449|       |
  450|  76.3k|        image->imageOwnsYUVPlanes = AVIF_TRUE;
  ------------------
  |  |   88|  76.3k|#define AVIF_TRUE 1
  ------------------
  451|  76.3k|        if (!image->yuvPlanes[AVIF_CHAN_Y]) {
  ------------------
  |  Branch (451:13): [True: 76.3k, False: 0]
  ------------------
  452|  76.3k|            image->yuvPlanes[AVIF_CHAN_Y] = (uint8_t *)avifAlloc(fullSize);
  453|  76.3k|            if (!image->yuvPlanes[AVIF_CHAN_Y]) {
  ------------------
  |  Branch (453:17): [True: 0, False: 76.3k]
  ------------------
  454|      0|                return AVIF_RESULT_OUT_OF_MEMORY;
  455|      0|            }
  456|  76.3k|            image->yuvRowBytes[AVIF_CHAN_Y] = fullRowBytes;
  457|  76.3k|        }
  458|       |
  459|  76.3k|        if (!info.monochrome) {
  ------------------
  |  Branch (459:13): [True: 38.7k, False: 37.5k]
  ------------------
  460|       |            // Intermediary computation as 64 bits in case width or height is exactly UINT32_MAX.
  461|  38.7k|            const uint32_t shiftedW = (uint32_t)(((uint64_t)image->width + info.chromaShiftX) >> info.chromaShiftX);
  462|  38.7k|            const uint32_t shiftedH = (uint32_t)(((uint64_t)image->height + info.chromaShiftY) >> info.chromaShiftY);
  463|       |
  464|       |            // These are less than or equal to fullRowBytes/fullSize. No need to check overflows.
  465|  38.7k|            const uint32_t uvRowBytes = channelSize * shiftedW;
  466|  38.7k|            const size_t uvSize = (size_t)uvRowBytes * shiftedH;
  467|       |
  468|   116k|            for (int uvPlane = AVIF_CHAN_U; uvPlane <= AVIF_CHAN_V; ++uvPlane) {
  ------------------
  |  Branch (468:45): [True: 77.5k, False: 38.7k]
  ------------------
  469|  77.5k|                if (!image->yuvPlanes[uvPlane]) {
  ------------------
  |  Branch (469:21): [True: 77.5k, False: 0]
  ------------------
  470|  77.5k|                    image->yuvPlanes[uvPlane] = (uint8_t *)avifAlloc(uvSize);
  471|  77.5k|                    if (!image->yuvPlanes[uvPlane]) {
  ------------------
  |  Branch (471:25): [True: 0, False: 77.5k]
  ------------------
  472|      0|                        return AVIF_RESULT_OUT_OF_MEMORY;
  473|      0|                    }
  474|  77.5k|                    image->yuvRowBytes[uvPlane] = uvRowBytes;
  475|  77.5k|                }
  476|  77.5k|            }
  477|  38.7k|        }
  478|  76.3k|    }
  479|  83.4k|    if (planes & AVIF_PLANES_A) {
  ------------------
  |  Branch (479:9): [True: 25.6k, False: 57.8k]
  ------------------
  480|  25.6k|        image->imageOwnsAlphaPlane = AVIF_TRUE;
  ------------------
  |  |   88|  25.6k|#define AVIF_TRUE 1
  ------------------
  481|  25.6k|        if (!image->alphaPlane) {
  ------------------
  |  Branch (481:13): [True: 25.6k, False: 0]
  ------------------
  482|  25.6k|            image->alphaPlane = (uint8_t *)avifAlloc(fullSize);
  483|  25.6k|            if (!image->alphaPlane) {
  ------------------
  |  Branch (483:17): [True: 0, False: 25.6k]
  ------------------
  484|      0|                return AVIF_RESULT_OUT_OF_MEMORY;
  485|      0|            }
  486|  25.6k|            image->alphaRowBytes = fullRowBytes;
  487|  25.6k|        }
  488|  25.6k|    }
  489|  83.4k|    return AVIF_RESULT_OK;
  490|  83.4k|}
avifImageFreePlanes:
  493|   240k|{
  494|   240k|    if ((planes & AVIF_PLANES_YUV) && (image->yuvFormat != AVIF_PIXEL_FORMAT_NONE)) {
  ------------------
  |  Branch (494:9): [True: 217k, False: 23.5k]
  |  Branch (494:39): [True: 166k, False: 50.6k]
  ------------------
  495|   166k|        if (image->imageOwnsYUVPlanes) {
  ------------------
  |  Branch (495:13): [True: 76.3k, False: 90.0k]
  ------------------
  496|  76.3k|            avifFree(image->yuvPlanes[AVIF_CHAN_Y]);
  497|  76.3k|            avifFree(image->yuvPlanes[AVIF_CHAN_U]);
  498|  76.3k|            avifFree(image->yuvPlanes[AVIF_CHAN_V]);
  499|  76.3k|        }
  500|   166k|        image->yuvPlanes[AVIF_CHAN_Y] = NULL;
  501|   166k|        image->yuvRowBytes[AVIF_CHAN_Y] = 0;
  502|   166k|        image->yuvPlanes[AVIF_CHAN_U] = NULL;
  503|   166k|        image->yuvRowBytes[AVIF_CHAN_U] = 0;
  504|   166k|        image->yuvPlanes[AVIF_CHAN_V] = NULL;
  505|   166k|        image->yuvRowBytes[AVIF_CHAN_V] = 0;
  506|   166k|        image->imageOwnsYUVPlanes = AVIF_FALSE;
  ------------------
  |  |   89|   166k|#define AVIF_FALSE 0
  ------------------
  507|   166k|    }
  508|   240k|    if (planes & AVIF_PLANES_A) {
  ------------------
  |  Branch (508:9): [True: 170k, False: 69.8k]
  ------------------
  509|   170k|        if (image->imageOwnsAlphaPlane) {
  ------------------
  |  Branch (509:13): [True: 25.6k, False: 145k]
  ------------------
  510|  25.6k|            avifFree(image->alphaPlane);
  511|  25.6k|        }
  512|   170k|        image->alphaPlane = NULL;
  513|   170k|        image->alphaRowBytes = 0;
  514|   170k|        image->imageOwnsAlphaPlane = AVIF_FALSE;
  ------------------
  |  |   89|   170k|#define AVIF_FALSE 0
  ------------------
  515|   170k|    }
  516|   240k|}
avifImageStealPlanes:
  519|  46.7k|{
  520|  46.7k|    avifImageFreePlanes(dstImage, planes);
  521|       |
  522|  46.7k|    if (planes & AVIF_PLANES_YUV) {
  ------------------
  |  Branch (522:9): [True: 34.9k, False: 11.7k]
  ------------------
  523|  34.9k|        dstImage->yuvPlanes[AVIF_CHAN_Y] = srcImage->yuvPlanes[AVIF_CHAN_Y];
  524|  34.9k|        dstImage->yuvRowBytes[AVIF_CHAN_Y] = srcImage->yuvRowBytes[AVIF_CHAN_Y];
  525|  34.9k|        dstImage->yuvPlanes[AVIF_CHAN_U] = srcImage->yuvPlanes[AVIF_CHAN_U];
  526|  34.9k|        dstImage->yuvRowBytes[AVIF_CHAN_U] = srcImage->yuvRowBytes[AVIF_CHAN_U];
  527|  34.9k|        dstImage->yuvPlanes[AVIF_CHAN_V] = srcImage->yuvPlanes[AVIF_CHAN_V];
  528|  34.9k|        dstImage->yuvRowBytes[AVIF_CHAN_V] = srcImage->yuvRowBytes[AVIF_CHAN_V];
  529|       |
  530|  34.9k|        srcImage->yuvPlanes[AVIF_CHAN_Y] = NULL;
  531|  34.9k|        srcImage->yuvRowBytes[AVIF_CHAN_Y] = 0;
  532|  34.9k|        srcImage->yuvPlanes[AVIF_CHAN_U] = NULL;
  533|  34.9k|        srcImage->yuvRowBytes[AVIF_CHAN_U] = 0;
  534|  34.9k|        srcImage->yuvPlanes[AVIF_CHAN_V] = NULL;
  535|  34.9k|        srcImage->yuvRowBytes[AVIF_CHAN_V] = 0;
  536|       |
  537|  34.9k|        dstImage->yuvFormat = srcImage->yuvFormat;
  538|  34.9k|        dstImage->imageOwnsYUVPlanes = srcImage->imageOwnsYUVPlanes;
  539|  34.9k|        srcImage->imageOwnsYUVPlanes = AVIF_FALSE;
  ------------------
  |  |   89|  34.9k|#define AVIF_FALSE 0
  ------------------
  540|  34.9k|    }
  541|  46.7k|    if (planes & AVIF_PLANES_A) {
  ------------------
  |  Branch (541:9): [True: 11.7k, False: 34.9k]
  ------------------
  542|  11.7k|        dstImage->alphaPlane = srcImage->alphaPlane;
  543|  11.7k|        dstImage->alphaRowBytes = srcImage->alphaRowBytes;
  544|       |
  545|  11.7k|        srcImage->alphaPlane = NULL;
  546|  11.7k|        srcImage->alphaRowBytes = 0;
  547|       |
  548|  11.7k|        dstImage->imageOwnsAlphaPlane = srcImage->imageOwnsAlphaPlane;
  549|  11.7k|        srcImage->imageOwnsAlphaPlane = AVIF_FALSE;
  ------------------
  |  |   89|  11.7k|#define AVIF_FALSE 0
  ------------------
  550|  11.7k|    }
  551|  46.7k|}
avifImageUsesU16:
  554|  97.2k|{
  555|  97.2k|    return (image->depth > 8);
  556|  97.2k|}
avifImagePlane:
  587|   220k|{
  588|   220k|    if ((channel == AVIF_CHAN_Y) || (channel == AVIF_CHAN_U) || (channel == AVIF_CHAN_V)) {
  ------------------
  |  Branch (588:9): [True: 55.1k, False: 165k]
  |  Branch (588:37): [True: 55.1k, False: 110k]
  |  Branch (588:65): [True: 55.1k, False: 55.1k]
  ------------------
  589|   165k|        return image->yuvPlanes[channel];
  590|   165k|    }
  591|  55.1k|    if (channel == AVIF_CHAN_A) {
  ------------------
  |  Branch (591:9): [True: 55.1k, False: 0]
  ------------------
  592|  55.1k|        return image->alphaPlane;
  593|  55.1k|    }
  594|      0|    return NULL;
  595|  55.1k|}
avifImagePlaneRowBytes:
  598|   220k|{
  599|   220k|    if ((channel == AVIF_CHAN_Y) || (channel == AVIF_CHAN_U) || (channel == AVIF_CHAN_V)) {
  ------------------
  |  Branch (599:9): [True: 55.1k, False: 165k]
  |  Branch (599:37): [True: 55.1k, False: 110k]
  |  Branch (599:65): [True: 55.1k, False: 55.1k]
  ------------------
  600|   165k|        return image->yuvRowBytes[channel];
  601|   165k|    }
  602|  55.1k|    if (channel == AVIF_CHAN_A) {
  ------------------
  |  Branch (602:9): [True: 55.1k, False: 0]
  ------------------
  603|  55.1k|        return image->alphaRowBytes;
  604|  55.1k|    }
  605|      0|    return 0;
  606|  55.1k|}
avifImagePlaneWidth:
  609|  71.0k|{
  610|  71.0k|    if (channel == AVIF_CHAN_Y) {
  ------------------
  |  Branch (610:9): [True: 21.1k, False: 49.8k]
  ------------------
  611|  21.1k|        return image->width;
  612|  21.1k|    }
  613|  49.8k|    if ((channel == AVIF_CHAN_U) || (channel == AVIF_CHAN_V)) {
  ------------------
  |  Branch (613:9): [True: 39.0k, False: 10.7k]
  |  Branch (613:37): [True: 10.7k, False: 0]
  ------------------
  614|  49.8k|        avifPixelFormatInfo formatInfo;
  615|  49.8k|        avifGetPixelFormatInfo(image->yuvFormat, &formatInfo);
  616|  49.8k|        if (formatInfo.monochrome) {
  ------------------
  |  Branch (616:13): [True: 10.3k, False: 39.5k]
  ------------------
  617|  10.3k|            return 0;
  618|  10.3k|        }
  619|  39.5k|        return (image->width + formatInfo.chromaShiftX) >> formatInfo.chromaShiftX;
  620|  49.8k|    }
  621|      0|    if ((channel == AVIF_CHAN_A) && image->alphaPlane) {
  ------------------
  |  Branch (621:9): [True: 0, False: 0]
  |  Branch (621:37): [True: 0, False: 0]
  ------------------
  622|      0|        return image->width;
  623|      0|    }
  624|      0|    return 0;
  625|      0|}
avifImagePlaneHeight:
  628|   291k|{
  629|   291k|    if (channel == AVIF_CHAN_Y) {
  ------------------
  |  Branch (629:9): [True: 76.3k, False: 215k]
  ------------------
  630|  76.3k|        return image->height;
  631|  76.3k|    }
  632|   215k|    if ((channel == AVIF_CHAN_U) || (channel == AVIF_CHAN_V)) {
  ------------------
  |  Branch (632:9): [True: 94.2k, False: 121k]
  |  Branch (632:37): [True: 65.9k, False: 55.1k]
  ------------------
  633|   160k|        avifPixelFormatInfo formatInfo;
  634|   160k|        avifGetPixelFormatInfo(image->yuvFormat, &formatInfo);
  635|   160k|        if (formatInfo.monochrome) {
  ------------------
  |  Branch (635:13): [True: 64.6k, False: 95.5k]
  ------------------
  636|  64.6k|            return 0;
  637|  64.6k|        }
  638|  95.5k|        return (image->height + formatInfo.chromaShiftY) >> formatInfo.chromaShiftY;
  639|   160k|    }
  640|  55.1k|    if ((channel == AVIF_CHAN_A) && image->alphaPlane) {
  ------------------
  |  Branch (640:9): [True: 55.1k, False: 0]
  |  Branch (640:37): [True: 18.4k, False: 36.7k]
  ------------------
  641|  18.4k|        return image->height;
  642|  18.4k|    }
  643|  36.7k|    return 0;
  644|  55.1k|}
avifDimensionsTooLarge:
  647|  46.7k|{
  648|  46.7k|    if ((imageSizeLimit != 0) && (width > (imageSizeLimit / height))) {
  ------------------
  |  Branch (648:9): [True: 46.7k, False: 0]
  |  Branch (648:34): [True: 0, False: 46.7k]
  ------------------
  649|      0|        return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  650|      0|    }
  651|  46.7k|    if ((imageDimensionLimit != 0) && ((width > imageDimensionLimit) || (height > imageDimensionLimit))) {
  ------------------
  |  Branch (651:9): [True: 46.7k, False: 0]
  |  Branch (651:40): [True: 0, False: 46.7k]
  |  Branch (651:73): [True: 0, False: 46.7k]
  ------------------
  652|      0|        return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  653|      0|    }
  654|  46.7k|    return AVIF_FALSE;
  ------------------
  |  |   89|  46.7k|#define AVIF_FALSE 0
  ------------------
  655|  46.7k|}
avifCodecDestroy:
  660|  36.8k|{
  661|  36.8k|    if (codec && codec->destroyInternal) {
  ------------------
  |  Branch (661:9): [True: 36.8k, False: 0]
  |  Branch (661:18): [True: 36.8k, False: 0]
  ------------------
  662|  36.8k|        codec->destroyInternal(codec);
  663|  36.8k|    }
  664|  36.8k|    avifFree(codec);
  665|  36.8k|}
avifIsAlpha:
 1021|   324k|{
 1022|   324k|    if (itemCategory == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (1022:9): [True: 81.4k, False: 242k]
  ------------------
 1023|  81.4k|        return AVIF_TRUE;
  ------------------
  |  |   88|  81.4k|#define AVIF_TRUE 1
  ------------------
 1024|  81.4k|    }
 1025|   242k|    if (itemCategory >= AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA &&
  ------------------
  |  Branch (1025:9): [True: 0, False: 242k]
  ------------------
 1026|      0|        itemCategory < AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA + AVIF_SAMPLE_TRANSFORM_MAX_NUM_EXTRA_INPUT_IMAGE_ITEMS) {
  ------------------
  |  |  431|      0|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA - AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR)
  ------------------
  |  Branch (1026:9): [True: 0, False: 0]
  ------------------
 1027|      0|        return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1028|      0|    }
 1029|   242k|    return AVIF_FALSE;
  ------------------
  |  |   89|   242k|#define AVIF_FALSE 0
  ------------------
 1030|   242k|}
avifCodecSpecificOptionsCreate:
 1093|  13.7k|{
 1094|  13.7k|    avifCodecSpecificOptions * ava = (avifCodecSpecificOptions *)avifAlloc(sizeof(avifCodecSpecificOptions));
 1095|  13.7k|    if (!ava || !avifArrayCreate(ava, sizeof(avifCodecSpecificOption), 4)) {
  ------------------
  |  Branch (1095:9): [True: 0, False: 13.7k]
  |  Branch (1095:17): [True: 0, False: 13.7k]
  ------------------
 1096|      0|        goto error;
 1097|      0|    }
 1098|  13.7k|    return ava;
 1099|       |
 1100|      0|error:
 1101|      0|    avifFree(ava);
 1102|       |    return NULL;
 1103|  13.7k|}
avifCodecSpecificOptionsClear:
 1106|  68.9k|{
 1107|  68.9k|    for (uint32_t i = 0; i < csOptions->count; ++i) {
  ------------------
  |  Branch (1107:26): [True: 0, False: 68.9k]
  ------------------
 1108|      0|        avifCodecSpecificOption * entry = &csOptions->entries[i];
 1109|      0|        avifFree(entry->key);
 1110|      0|        avifFree(entry->value);
 1111|      0|    }
 1112|       |
 1113|  68.9k|    csOptions->count = 0;
 1114|  68.9k|}
avifCodecSpecificOptionsDestroy:
 1117|  13.7k|{
 1118|  13.7k|    avifCodecSpecificOptionsClear(csOptions);
 1119|  13.7k|    avifArrayDestroy(csOptions);
 1120|  13.7k|    avifFree(csOptions);
 1121|  13.7k|}
avifCodecName:
 1246|  68.9k|{
 1247|  68.9k|    struct AvailableCodec * availableCodec = findAvailableCodec(choice, requiredFlags);
 1248|  68.9k|    if (availableCodec) {
  ------------------
  |  Branch (1248:9): [True: 68.9k, False: 0]
  ------------------
 1249|  68.9k|        return availableCodec->name;
 1250|  68.9k|    }
 1251|      0|    return NULL;
 1252|  68.9k|}
avifCodecTypeFromChoice:
 1255|  87.3k|{
 1256|  87.3k|    struct AvailableCodec * availableCodec = findAvailableCodec(choice, requiredFlags);
 1257|  87.3k|    if (availableCodec) {
  ------------------
  |  Branch (1257:9): [True: 87.3k, False: 0]
  ------------------
 1258|  87.3k|        return availableCodec->type;
 1259|  87.3k|    }
 1260|      0|    return AVIF_CODEC_TYPE_UNKNOWN;
 1261|  87.3k|}
avifCodecCreate:
 1274|  36.8k|{
 1275|  36.8k|    *codec = NULL;
 1276|  36.8k|    struct AvailableCodec * availableCodec = findAvailableCodec(choice, requiredFlags);
 1277|  36.8k|    AVIF_CHECKERR(availableCodec != NULL, AVIF_RESULT_NO_CODEC_AVAILABLE);
  ------------------
  |  |   45|  36.8k|    do {                        \
  |  |   46|  36.8k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 36.8k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  36.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 36.8k]
  |  |  ------------------
  ------------------
 1278|  36.8k|    *codec = availableCodec->create();
 1279|  36.8k|    AVIF_CHECKERR(*codec != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  36.8k|    do {                        \
  |  |   46|  36.8k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 36.8k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  36.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 36.8k]
  |  |  ------------------
  ------------------
 1280|  36.8k|    return AVIF_RESULT_OK;
 1281|  36.8k|}
avif.c:avifImageCopyProperties:
  228|  13.7k|{
  229|  13.7k|    for (size_t i = 0; i < dstImage->numProperties; ++i) {
  ------------------
  |  Branch (229:24): [True: 0, False: 13.7k]
  ------------------
  230|      0|        avifRWDataFree(&dstImage->properties[i].boxPayload);
  231|      0|    }
  232|  13.7k|    avifFree(dstImage->properties);
  233|  13.7k|    dstImage->properties = NULL;
  234|  13.7k|    dstImage->numProperties = 0;
  235|       |
  236|  13.7k|    if (srcImage->numProperties != 0) {
  ------------------
  |  Branch (236:9): [True: 0, False: 13.7k]
  ------------------
  237|      0|        dstImage->properties = (avifImageItemProperty *)avifCalloc(srcImage->numProperties, sizeof(srcImage->properties[0]));
  238|      0|        AVIF_CHECKERR(dstImage->properties != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  239|      0|        dstImage->numProperties = srcImage->numProperties;
  240|      0|        for (size_t i = 0; i < srcImage->numProperties; ++i) {
  ------------------
  |  Branch (240:28): [True: 0, False: 0]
  ------------------
  241|      0|            memcpy(dstImage->properties[i].boxtype, srcImage->properties[i].boxtype, sizeof(srcImage->properties[i].boxtype));
  242|      0|            memcpy(dstImage->properties[i].usertype, srcImage->properties[i].usertype, sizeof(srcImage->properties[i].usertype));
  243|      0|            AVIF_CHECKRES(avifRWDataSet(&dstImage->properties[i].boxPayload,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  244|      0|                                        srcImage->properties[i].boxPayload.data,
  245|      0|                                        srcImage->properties[i].boxPayload.size));
  246|      0|        }
  247|      0|    }
  248|  13.7k|    return AVIF_RESULT_OK;
  249|  13.7k|}
avif.c:findAvailableCodec:
 1228|   193k|{
 1229|   363k|    for (int i = 0; i < availableCodecsCount; ++i) {
  ------------------
  |  Branch (1229:21): [True: 363k, False: 0]
  ------------------
 1230|   363k|        if ((choice != AVIF_CODEC_CHOICE_AUTO) && (availableCodecs[i].choice != choice)) {
  ------------------
  |  Branch (1230:13): [True: 352k, False: 11.3k]
  |  Branch (1230:51): [True: 170k, False: 181k]
  ------------------
 1231|   170k|            continue;
 1232|   170k|        }
 1233|   193k|        if (requiredFlags && ((availableCodecs[i].flags & requiredFlags) != requiredFlags)) {
  ------------------
  |  Branch (1233:13): [True: 193k, False: 0]
  |  Branch (1233:30): [True: 0, False: 193k]
  ------------------
 1234|      0|            continue;
 1235|      0|        }
 1236|   193k|        if ((choice == AVIF_CODEC_CHOICE_AUTO) && (availableCodecs[i].choice == AVIF_CODEC_CHOICE_AVM)) {
  ------------------
  |  Branch (1236:13): [True: 11.3k, False: 181k]
  |  Branch (1236:51): [True: 0, False: 11.3k]
  ------------------
 1237|       |            // AV2 is experimental and cannot be the default, it must be explicitly selected.
 1238|      0|            continue;
 1239|      0|        }
 1240|   193k|        return &availableCodecs[i];
 1241|   193k|    }
 1242|      0|    return NULL;
 1243|   193k|}

avifCodecCreateAOM:
 1390|  25.4k|{
 1391|  25.4k|    avifCodec * codec = (avifCodec *)avifCalloc(1, sizeof(avifCodec));
 1392|  25.4k|    if (codec == NULL) {
  ------------------
  |  Branch (1392:9): [True: 0, False: 25.4k]
  ------------------
 1393|      0|        return NULL;
 1394|      0|    }
 1395|       |
 1396|  25.4k|#if defined(AVIF_CODEC_AOM_DECODE)
 1397|  25.4k|    codec->getNextImage = aomCodecGetNextImage;
 1398|  25.4k|#endif
 1399|       |
 1400|  25.4k|#if defined(AVIF_CODEC_AOM_ENCODE)
 1401|  25.4k|    codec->encodeImage = aomCodecEncodeImage;
 1402|  25.4k|    codec->encodeFinish = aomCodecEncodeFinish;
 1403|  25.4k|#endif
 1404|       |
 1405|  25.4k|    codec->destroyInternal = aomCodecDestroyInternal;
 1406|  25.4k|    codec->internal = (struct avifCodecInternal *)avifCalloc(1, sizeof(struct avifCodecInternal));
 1407|  25.4k|    if (codec->internal == NULL) {
  ------------------
  |  Branch (1407:9): [True: 0, False: 25.4k]
  ------------------
 1408|      0|        avifFree(codec);
 1409|      0|        return NULL;
 1410|      0|    }
 1411|  25.4k|    return codec;
 1412|  25.4k|}
codec_aom.c:aomCodecGetNextImage:
  108|  17.6k|{
  109|  17.6k|    assert(sample);
  110|       |
  111|  17.6k|    aom_codec_iface_t * const decoderInterface = aom_codec_av1_dx();
  112|       |#if !defined(AOM_CTRL_AOMD_SET_FRAME_SIZE_LIMIT)
  113|       |    // The AOMD_SET_FRAME_SIZE_LIMIT codec control (added in libaom v3.14.0)
  114|       |    // can be used to impose a maximum on AV1 frame size. When
  115|       |    // AOMD_SET_FRAME_SIZE_LIMIT is not available, approximate it with
  116|       |    // aom_codec_peek_stream_info() and avifDimensionsTooLarge().
  117|       |    struct aom_codec_stream_info streamInfo = { 0 };
  118|       |    aom_codec_err_t err = aom_codec_peek_stream_info(decoderInterface, sample->data.data, sample->data.size, &streamInfo);
  119|       |    if (err != AOM_CODEC_OK) {
  120|       |        avifDiagnosticsPrintf(codec->diag, "aom_codec_peek_stream_info() failed: %s", aom_codec_err_to_string(err));
  121|       |        return AVIF_FALSE;
  122|       |    }
  123|       |    if (streamInfo.w == 0 || streamInfo.h == 0) {
  124|       |        // The sequence header was not found.
  125|       |        if (!codec->internal->decoderInitialized) {
  126|       |            // Treat it as an error if the first frame isn't preceded by a sequence header.
  127|       |            return AVIF_FALSE;
  128|       |        }
  129|       |    } else {
  130|       |        if (avifDimensionsTooLarge(streamInfo.w, streamInfo.h, codec->imageSizeLimit, codec->imageDimensionLimit)) {
  131|       |            avifDiagnosticsPrintf(codec->diag, "Image dimensions too large: %dx%d", streamInfo.w, streamInfo.h);
  132|       |            return AVIF_FALSE;
  133|       |        }
  134|       |    }
  135|       |#endif // !defined(AOM_CTRL_AOMD_SET_FRAME_SIZE_LIMIT)
  136|       |
  137|  17.6k|    if (!codec->internal->decoderInitialized) {
  ------------------
  |  Branch (137:9): [True: 7.01k, False: 10.6k]
  ------------------
  138|  7.01k|        aom_codec_dec_cfg_t cfg;
  139|  7.01k|        memset(&cfg, 0, sizeof(aom_codec_dec_cfg_t));
  140|  7.01k|        cfg.threads = codec->maxThreads;
  141|  7.01k|        cfg.allow_lowbitdepth = 1;
  142|       |
  143|  7.01k|        if (aom_codec_dec_init(&codec->internal->decoder, decoderInterface, &cfg, 0)) {
  ------------------
  |  Branch (143:13): [True: 0, False: 7.01k]
  ------------------
  144|      0|            aomDiagPrintf(codec->diag, "aom_codec_dec_init()", &codec->internal->decoder);
  145|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  146|      0|        }
  147|  7.01k|        codec->internal->decoderInitialized = AVIF_TRUE;
  ------------------
  |  |   88|  7.01k|#define AVIF_TRUE 1
  ------------------
  148|       |
  149|  7.01k|#if defined(AOM_CTRL_AOMD_SET_FRAME_SIZE_LIMIT)
  150|  7.01k|        if (codec->imageSizeLimit != 0 && aom_codec_control(&codec->internal->decoder, AOMD_SET_FRAME_SIZE_LIMIT, codec->imageSizeLimit)) {
  ------------------
  |  Branch (150:13): [True: 7.01k, False: 0]
  |  Branch (150:43): [True: 0, False: 7.01k]
  ------------------
  151|      0|            aomDiagPrintf(codec->diag, "aom_codec_control(AOMD_SET_FRAME_SIZE_LIMIT)", &codec->internal->decoder);
  152|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  153|      0|        }
  154|  7.01k|#endif // defined(AOM_CTRL_AOMD_SET_FRAME_SIZE_LIMIT)
  155|  7.01k|        if (aom_codec_control(&codec->internal->decoder, AV1D_SET_OUTPUT_ALL_LAYERS, codec->allLayers)) {
  ------------------
  |  Branch (155:13): [True: 0, False: 7.01k]
  ------------------
  156|      0|            aomDiagPrintf(codec->diag, "aom_codec_control(AV1D_SET_OUTPUT_ALL_LAYERS)", &codec->internal->decoder);
  157|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  158|      0|        }
  159|  7.01k|        if (aom_codec_control(&codec->internal->decoder, AV1D_SET_OPERATING_POINT, codec->operatingPoint)) {
  ------------------
  |  Branch (159:13): [True: 0, False: 7.01k]
  ------------------
  160|      0|            aomDiagPrintf(codec->diag, "aom_codec_control(AV1D_SET_OPERATING_POINT)", &codec->internal->decoder);
  161|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  162|      0|        }
  163|       |
  164|  7.01k|        codec->internal->iter = NULL;
  165|  7.01k|    }
  166|       |
  167|  17.6k|    aom_image_t * nextFrame = NULL;
  168|  17.6k|    uint8_t spatialID = AVIF_SPATIAL_ID_UNSET;
  ------------------
  |  |  468|  17.6k|#define AVIF_SPATIAL_ID_UNSET 0xff
  ------------------
  169|  35.3k|    for (;;) {
  170|  35.3k|        nextFrame = aom_codec_get_frame(&codec->internal->decoder, &codec->internal->iter);
  171|  35.3k|        if (nextFrame) {
  ------------------
  |  Branch (171:13): [True: 17.6k, False: 17.6k]
  ------------------
  172|  17.6k|            if (spatialID != AVIF_SPATIAL_ID_UNSET) {
  ------------------
  |  |  468|  17.6k|#define AVIF_SPATIAL_ID_UNSET 0xff
  ------------------
  |  Branch (172:17): [True: 0, False: 17.6k]
  ------------------
  173|       |                // This requires libaom v3.1.2 or later, which has the fix for
  174|       |                // https://crbug.com/aomedia/2993.
  175|      0|                if (spatialID == nextFrame->spatial_id) {
  ------------------
  |  Branch (175:21): [True: 0, False: 0]
  ------------------
  176|       |                    // Found the correct spatial_id.
  177|      0|                    break;
  178|      0|                }
  179|  17.6k|            } else {
  180|       |                // Got an image!
  181|  17.6k|                break;
  182|  17.6k|            }
  183|  17.6k|        } else if (sample) {
  ------------------
  |  Branch (183:20): [True: 17.6k, False: 0]
  ------------------
  184|  17.6k|            codec->internal->iter = NULL;
  185|  17.6k|            if (aom_codec_decode(&codec->internal->decoder, sample->data.data, sample->data.size, NULL)) {
  ------------------
  |  Branch (185:17): [True: 0, False: 17.6k]
  ------------------
  186|      0|                aomDiagPrintf(codec->diag, "aom_codec_decode()", &codec->internal->decoder);
  187|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  188|      0|            }
  189|  17.6k|            spatialID = sample->spatialID;
  190|  17.6k|            sample = NULL;
  191|  17.6k|        } else {
  192|      0|            break;
  193|      0|        }
  194|  35.3k|    }
  195|       |
  196|  17.6k|    if (nextFrame) {
  ------------------
  |  Branch (196:9): [True: 17.6k, False: 0]
  ------------------
  197|  17.6k|        codec->internal->image = nextFrame;
  198|  17.6k|    } else {
  199|      0|        if (alpha && codec->internal->image) {
  ------------------
  |  Branch (199:13): [True: 0, False: 0]
  |  Branch (199:22): [True: 0, False: 0]
  ------------------
  200|       |            // Special case: reuse last alpha frame
  201|      0|        } else {
  202|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  203|      0|        }
  204|      0|    }
  205|       |
  206|  17.6k|    avifBool isColor = !alpha;
  207|  17.6k|    if (isColor) {
  ------------------
  |  Branch (207:9): [True: 13.2k, False: 4.44k]
  ------------------
  208|       |        // Color (YUV) planes - set image to correct size / format, fill color
  209|       |
  210|  13.2k|        avifPixelFormat yuvFormat = AVIF_PIXEL_FORMAT_NONE;
  211|  13.2k|        switch (codec->internal->image->fmt) {
  212|  7.56k|            case AOM_IMG_FMT_I420:
  ------------------
  |  Branch (212:13): [True: 7.56k, False: 5.66k]
  ------------------
  213|  9.90k|            case AOM_IMG_FMT_I42016:
  ------------------
  |  Branch (213:13): [True: 2.33k, False: 10.8k]
  ------------------
  214|  9.90k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV420;
  215|  9.90k|                break;
  216|  1.23k|            case AOM_IMG_FMT_I422:
  ------------------
  |  Branch (216:13): [True: 1.23k, False: 11.9k]
  ------------------
  217|  1.75k|            case AOM_IMG_FMT_I42216:
  ------------------
  |  Branch (217:13): [True: 516, False: 12.7k]
  ------------------
  218|  1.75k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV422;
  219|  1.75k|                break;
  220|  1.13k|            case AOM_IMG_FMT_I444:
  ------------------
  |  Branch (220:13): [True: 1.13k, False: 12.0k]
  ------------------
  221|  1.57k|            case AOM_IMG_FMT_I44416:
  ------------------
  |  Branch (221:13): [True: 443, False: 12.7k]
  ------------------
  222|  1.57k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
  223|  1.57k|                break;
  224|      0|            case AOM_IMG_FMT_NONE:
  ------------------
  |  Branch (224:13): [True: 0, False: 13.2k]
  ------------------
  225|      0|#if defined(AOM_HAVE_IMG_FMT_NV12)
  226|       |            // Although the libaom encoder supports the NV12 image format as an input format, the
  227|       |            // libaom decoder does not support NV12 as an output format.
  228|      0|            case AOM_IMG_FMT_NV12:
  ------------------
  |  Branch (228:13): [True: 0, False: 13.2k]
  ------------------
  229|      0|#endif
  230|      0|            case AOM_IMG_FMT_YV12:
  ------------------
  |  Branch (230:13): [True: 0, False: 13.2k]
  ------------------
  231|      0|            case AOM_IMG_FMT_YV1216:
  ------------------
  |  Branch (231:13): [True: 0, False: 13.2k]
  ------------------
  232|      0|            default:
  ------------------
  |  Branch (232:13): [True: 0, False: 13.2k]
  ------------------
  233|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  234|  13.2k|        }
  235|  13.2k|        if (codec->internal->image->monochrome) {
  ------------------
  |  Branch (235:13): [True: 6.46k, False: 6.76k]
  ------------------
  236|  6.46k|            yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
  237|  6.46k|        }
  238|       |
  239|  13.2k|        image->width = codec->internal->image->d_w;
  240|  13.2k|        image->height = codec->internal->image->d_h;
  241|  13.2k|        image->depth = codec->internal->image->bit_depth;
  242|       |
  243|  13.2k|        image->yuvFormat = yuvFormat;
  244|  13.2k|        image->yuvRange = (codec->internal->image->range == AOM_CR_STUDIO_RANGE) ? AVIF_RANGE_LIMITED : AVIF_RANGE_FULL;
  ------------------
  |  Branch (244:27): [True: 0, False: 13.2k]
  ------------------
  245|  13.2k|        image->yuvChromaSamplePosition = (avifChromaSamplePosition)codec->internal->image->csp;
  246|       |
  247|  13.2k|        image->colorPrimaries = (avifColorPrimaries)codec->internal->image->cp;
  248|  13.2k|        image->transferCharacteristics = (avifTransferCharacteristics)codec->internal->image->tc;
  249|  13.2k|        image->matrixCoefficients = (avifMatrixCoefficients)codec->internal->image->mc;
  250|       |
  251|       |        // Steal the pointers from the decoder's image directly
  252|  13.2k|        avifImageFreePlanes(image, AVIF_PLANES_YUV);
  253|  13.2k|        int yuvPlaneCount = (yuvFormat == AVIF_PIXEL_FORMAT_YUV400) ? 1 : 3;
  ------------------
  |  Branch (253:29): [True: 6.46k, False: 6.76k]
  ------------------
  254|  39.9k|        for (int yuvPlane = 0; yuvPlane < yuvPlaneCount; ++yuvPlane) {
  ------------------
  |  Branch (254:32): [True: 26.7k, False: 13.2k]
  ------------------
  255|  26.7k|            image->yuvPlanes[yuvPlane] = codec->internal->image->planes[yuvPlane];
  256|  26.7k|            image->yuvRowBytes[yuvPlane] = codec->internal->image->stride[yuvPlane];
  257|  26.7k|        }
  258|  13.2k|        image->imageOwnsYUVPlanes = AVIF_FALSE;
  ------------------
  |  |   89|  13.2k|#define AVIF_FALSE 0
  ------------------
  259|  13.2k|    } else {
  260|       |        // Alpha plane - set image to correct size, fill alpha
  261|       |
  262|  4.44k|        image->width = codec->internal->image->d_w;
  263|  4.44k|        image->height = codec->internal->image->d_h;
  264|  4.44k|        image->depth = codec->internal->image->bit_depth;
  265|       |
  266|  4.44k|        avifImageFreePlanes(image, AVIF_PLANES_A);
  267|  4.44k|        image->alphaPlane = codec->internal->image->planes[0];
  268|  4.44k|        image->alphaRowBytes = codec->internal->image->stride[0];
  269|  4.44k|        *isLimitedRangeAlpha = (codec->internal->image->range == AOM_CR_STUDIO_RANGE);
  270|  4.44k|        image->imageOwnsAlphaPlane = AVIF_FALSE;
  ------------------
  |  |   89|  4.44k|#define AVIF_FALSE 0
  ------------------
  271|  4.44k|    }
  272|       |
  273|  17.6k|    return AVIF_TRUE;
  ------------------
  |  |   88|  17.6k|#define AVIF_TRUE 1
  ------------------
  274|  17.6k|}
codec_aom.c:aomCodecEncodeImage:
  667|  73.6k|{
  668|       |    // Save the quality of the first layer because it's useful for further decision making
  669|  73.6k|    if (encoder->extraLayerCount > 0 && codec->internal->currentLayer == 0) {
  ------------------
  |  Branch (669:9): [True: 73.6k, False: 0]
  |  Branch (669:41): [True: 18.4k, False: 55.2k]
  ------------------
  670|  18.4k|        codec->internal->qualityFirstLayer = quality;
  671|  18.4k|    }
  672|       |
  673|       |    // Determine whether the encoder should be configured to use intra frames only, either by setting aomUsage to
  674|       |    // AOM_USAGE_ALL_INTRA, or by manually configuring the encoder so all frames will be key frames (if AOM_USAGE_ALL_INTRA isn't
  675|       |    // available).
  676|       |
  677|       |    // For libaom versions older than 3.14.0, all-intra encoding is beneficial when encoding a two-layer image item and the
  678|       |    // quality of the first layer is very low. Switching to all-intra encoding comes with the following benefits:
  679|       |    // - The first layer will be smaller than the second layer (which is often not the case with inter encoding)
  680|       |    // - Outputs have predictable file sizes: the sum of the first layer (quality <= 10) plus the second layer (quality set by
  681|       |    //   the caller)
  682|       |    // - Because the first layer is very small, layered encoding overhead is also smaller and more stable (about 5-8% for quality
  683|       |    //   40 and 2-4% for quality 60)
  684|       |    // Note: libaom 3.14.0 introduces a mechanism to completely control each layer's QP, and extends tune IQ to inter-frame
  685|       |    // encoding modes (AOM_USAGE_GOOD_QUALITY and AOM_USAGE_REALTIME), so there's no need to use all-intra encoding for layered.
  686|       |
  687|       |    // aom_codec.h says: aom_codec_version() == (major<<16 | minor<<8 | patch)
  688|  73.6k|    static const int aomVersion_3_14_0 = (3 << 16) | (14 << 8);
  689|  73.6k|    const int aomVersion = aom_codec_version();
  690|  73.6k|    avifBool useAllIntraForLayered = aomVersion < aomVersion_3_14_0 && encoder->extraLayerCount == 1 &&
  ------------------
  |  Branch (690:38): [True: 0, False: 73.6k]
  |  Branch (690:72): [True: 0, False: 0]
  ------------------
  691|      0|                                     codec->internal->qualityFirstLayer <= TWO_LAYER_ALL_INTRA_QUALITY_THRESHOLD;
  ------------------
  |  |   53|      0|#define TWO_LAYER_ALL_INTRA_QUALITY_THRESHOLD 10
  ------------------
  |  Branch (691:38): [True: 0, False: 0]
  ------------------
  692|       |    // Also use all-intra encoding when encoding still images.
  693|  73.6k|    avifBool useAllIntra = (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) || useAllIntraForLayered;
  ------------------
  |  Branch (693:28): [True: 0, False: 73.6k]
  |  Branch (693:76): [True: 0, False: 73.6k]
  ------------------
  694|       |
  695|       |    // Map encoder speed to AOM usage + CpuUsed:
  696|       |    // Speed  0: GoodQuality CpuUsed 0
  697|       |    // Speed  1: GoodQuality CpuUsed 1
  698|       |    // Speed  2: GoodQuality CpuUsed 2
  699|       |    // Speed  3: GoodQuality CpuUsed 3
  700|       |    // Speed  4: GoodQuality CpuUsed 4
  701|       |    // Speed  5: GoodQuality CpuUsed 5
  702|       |    // Speed  6: GoodQuality CpuUsed 6
  703|       |    // Speed  7: RealTime    CpuUsed 7
  704|       |    // Speed  8: RealTime    CpuUsed 8
  705|       |    // Speed  9: RealTime    CpuUsed 9
  706|       |    // Speed 10: RealTime    CpuUsed 9
  707|  73.6k|    unsigned int aomUsage = AOM_USAGE_GOOD_QUALITY;
  708|       |    // Use AOM_USAGE_ALL_INTRA (added in https://crbug.com/aomedia/2959) if available.
  709|  73.6k|#if defined(AOM_USAGE_ALL_INTRA)
  710|  73.6k|    if (useAllIntra) {
  ------------------
  |  Branch (710:9): [True: 0, False: 73.6k]
  ------------------
  711|      0|        aomUsage = AOM_USAGE_ALL_INTRA;
  712|      0|    }
  713|  73.6k|#endif
  714|  73.6k|    int aomCpuUsed = -1;
  715|  73.6k|    if (encoder->speed != AVIF_SPEED_DEFAULT) {
  ------------------
  |  |  114|  73.6k|#define AVIF_SPEED_DEFAULT -1
  ------------------
  |  Branch (715:9): [True: 73.6k, False: 0]
  ------------------
  716|  73.6k|        aomCpuUsed = AVIF_CLAMP(encoder->speed, 0, 9);
  ------------------
  |  |   18|  73.6k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 73.6k]
  |  |  |  Branch (18:60): [True: 4.54k, False: 69.0k]
  |  |  ------------------
  ------------------
  717|  73.6k|        if (aomCpuUsed >= 7) {
  ------------------
  |  Branch (717:13): [True: 24.4k, False: 49.2k]
  ------------------
  718|  24.4k|#if defined(AOM_USAGE_ALL_INTRA) && defined(ALL_INTRA_HAS_SPEEDS_7_TO_9)
  719|  24.4k|            if (!useAllIntra) {
  ------------------
  |  Branch (719:17): [True: 24.4k, False: 0]
  ------------------
  720|  24.4k|                aomUsage = AOM_USAGE_REALTIME;
  721|  24.4k|            }
  722|       |#else
  723|       |            aomUsage = AOM_USAGE_REALTIME;
  724|       |#endif
  725|  24.4k|        }
  726|  73.6k|    }
  727|       |
  728|  73.6k|    static const int aomVersion_2_0_0 = (2 << 16);
  729|  73.6k|    if (aomVersion <= aomVersion_2_0_0) {
  ------------------
  |  Branch (729:9): [True: 0, False: 73.6k]
  ------------------
  730|       |        // Issue with v1.0.0-errata1-avif: https://github.com/AOMediaCodec/libavif/issues/56
  731|       |        // Issue with v2.0.0: https://aomedia-review.googlesource.com/q/I26a39791f820b4d4e1d63ff7141f594c3c7181f5
  732|       |        // v2.0.1 was released on 2020-11-25.
  733|      0|        avifDiagnosticsPrintf(codec->diag, "a libaom version strictly greater than 2.0.0 is required");
  734|      0|        return AVIF_RESULT_UNKNOWN_ERROR;
  735|      0|    }
  736|       |
  737|  73.6k|    avifBool useLibavifDefaultTuneMetric = AVIF_FALSE;        // If true, override libaom's default tune option.
  ------------------
  |  |   89|  73.6k|#define AVIF_FALSE 0
  ------------------
  738|  73.6k|    aom_tune_metric libavifDefaultTuneMetric = AOM_TUNE_PSNR; // Meaningless unless useLibavifDefaultTuneMetric.
  739|       |
  740|       |    // True if libavif knows that tune=iq is used, either set by libavif by default, or set by the user explicitly.
  741|       |    // False otherwise (including if libaom uses tune=iq by default, which is not the case as of v3.14.1 and earlier versions).
  742|  73.6k|    avifBool useTuneIq;
  743|       |
  744|  73.6k|    if (avifAOMOptionsContainExplicitTuning(codec, alpha, &useTuneIq)) {
  ------------------
  |  Branch (744:9): [True: 0, False: 73.6k]
  ------------------
  745|       |        // avifAOMOptionsContainExplicitTuning() has set useTuneIq.
  746|  73.6k|    } else if (!codec->internal->encoderInitialized) {
  ------------------
  |  Branch (746:16): [True: 18.4k, False: 55.2k]
  ------------------
  747|       |        // libavif only needs to set the default tune metric for the first frame,
  748|       |        // because libaom will persist that setting until explicitly changed.
  749|       |
  750|  18.4k|        if (quality == AVIF_QUALITY_LOSSLESS) {
  ------------------
  |  |  106|  18.4k|#define AVIF_QUALITY_LOSSLESS 100
  ------------------
  |  Branch (750:13): [True: 788, False: 17.6k]
  ------------------
  751|       |            // AOM_TUNE_IQ is not libaom's default tune option as of v3.14.1.
  752|       |            // Even if it was, it does not matter for lossless.
  753|    788|            useTuneIq = AVIF_FALSE;
  ------------------
  |  |   89|    788|#define AVIF_FALSE 0
  ------------------
  754|  17.6k|        } else {
  755|  17.6k|            useLibavifDefaultTuneMetric = AVIF_TRUE;
  ------------------
  |  |   88|  17.6k|#define AVIF_TRUE 1
  ------------------
  756|  17.6k|            if (alpha) {
  ------------------
  |  Branch (756:17): [True: 4.52k, False: 13.0k]
  ------------------
  757|       |                // Minimize ringing for alpha.
  758|  4.52k|                libavifDefaultTuneMetric = AOM_TUNE_PSNR;
  759|  13.0k|            } else {
  760|  13.0k|                libavifDefaultTuneMetric = AOM_TUNE_SSIM;
  761|  13.0k|#if defined(AOM_HAVE_TUNE_IQ)
  762|       |                // AOM_TUNE_IQ has been tuned for the YCbCr family of color spaces, and is favored for
  763|       |                // its low perceptual distortion. AOM_TUNE_IQ partially generalizes to, and benefits
  764|       |                // from other "YUV-like" spaces (e.g. YCgCo and ICtCp) including monochrome (luma only).
  765|       |                //
  766|       |                // AOM_TUNE_IQ was introduced in libaom v3.12.0 but it has significantly different bit
  767|       |                // allocation characteristics compared to v3.13.0. AOM_TUNE_IQ is used by default
  768|       |                // starting with v3.13.0 for fewer behavior changes in libavif.
  769|       |                //
  770|       |                // Starting with libaom v3.14.0, AOM_TUNE_IQ supports all-intra, good-quality and
  771|       |                // realtime modes (for single and layered images). Prior to v3.14.0, AOM_TUNE_IQ is only
  772|       |                // supported in all-intra mode.
  773|  13.0k|                static const int aomVersion_3_13_0 = (3 << 16) | (13 << 8);
  774|  13.0k|                if (image->matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_IDENTITY &&
  ------------------
  |  Branch (774:21): [True: 13.0k, False: 0]
  ------------------
  775|  13.0k|                    ((aomUsage == AOM_USAGE_ALL_INTRA && aomVersion >= aomVersion_3_13_0) ||
  ------------------
  |  Branch (775:23): [True: 0, False: 13.0k]
  |  Branch (775:58): [True: 0, False: 0]
  ------------------
  776|  13.0k|                     (encoder->extraLayerCount > 0 && aomVersion >= aomVersion_3_14_0))) {
  ------------------
  |  Branch (776:23): [True: 13.0k, False: 0]
  |  Branch (776:55): [True: 13.0k, False: 0]
  ------------------
  777|  13.0k|                    libavifDefaultTuneMetric = AOM_TUNE_IQ;
  778|  13.0k|                }
  779|  13.0k|#endif
  780|  13.0k|            }
  781|  17.6k|            useTuneIq = (libavifDefaultTuneMetric == AOM_TUNE_IQ);
  782|  17.6k|        }
  783|  55.2k|    } else {
  784|       |        // The tune option persists across frames in libaom until explicitly set to another value.
  785|  55.2k|        useTuneIq = codec->internal->previousFrameUsedTuneIq;
  786|  55.2k|    }
  787|       |    // Remember the current tune option for the next frame.
  788|  73.6k|    codec->internal->previousFrameUsedTuneIq = useTuneIq;
  789|       |
  790|  73.6k|    struct aom_codec_enc_cfg * cfg = &codec->internal->cfg;
  791|  73.6k|    avifBool quantizerUpdated = AVIF_FALSE;
  ------------------
  |  |   89|  73.6k|#define AVIF_FALSE 0
  ------------------
  792|  73.6k|    const int quantizer = aomQualityToQuantizer(quality, useTuneIq);
  793|       |
  794|       |    // For encoder->scalingMode.horizontal and encoder->scalingMode.vertical to take effect in AOM
  795|       |    // encoder, config should be applied for each frame, so we don't care about changes on these
  796|       |    // two fields.
  797|  73.6k|    encoderChanges &= ~AVIF_ENCODER_CHANGE_SCALING_MODE;
  798|       |
  799|  73.6k|    if (!codec->internal->encoderInitialized) {
  ------------------
  |  Branch (799:9): [True: 18.4k, False: 55.2k]
  ------------------
  800|  18.4k|        codec->internal->aomFormat = avifImageCalcAOMFmt(image, alpha);
  801|  18.4k|        if (codec->internal->aomFormat == AOM_IMG_FMT_NONE) {
  ------------------
  |  Branch (801:13): [True: 0, False: 18.4k]
  ------------------
  802|      0|            return AVIF_RESULT_UNKNOWN_ERROR;
  803|      0|        }
  804|       |
  805|  18.4k|        avifGetPixelFormatInfo(image->yuvFormat, &codec->internal->formatInfo);
  806|       |
  807|  18.4k|        aom_codec_iface_t * encoderInterface = aom_codec_av1_cx();
  808|  18.4k|        aom_codec_err_t err = aom_codec_enc_config_default(encoderInterface, cfg, aomUsage);
  809|  18.4k|        if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (809:13): [True: 0, False: 18.4k]
  ------------------
  810|      0|            avifDiagnosticsPrintf(codec->diag, "aom_codec_enc_config_default() failed: %s", aom_codec_err_to_string(err));
  811|      0|            return AVIF_RESULT_UNKNOWN_ERROR;
  812|      0|        }
  813|       |
  814|       |        // Set our own default cfg->rc_end_usage value, which may differ from libaom's default.
  815|  18.4k|        switch (aomUsage) {
  ------------------
  |  Branch (815:17): [True: 18.4k, False: 0]
  ------------------
  816|  12.3k|            case AOM_USAGE_GOOD_QUALITY:
  ------------------
  |  Branch (816:13): [True: 12.3k, False: 6.10k]
  ------------------
  817|       |                // libaom's default is AOM_VBR. Change the default to AOM_Q since we don't need to
  818|       |                // hit a certain target bit rate. It's easier to control the worst quality in Q
  819|       |                // mode.
  820|  12.3k|                cfg->rc_end_usage = AOM_Q;
  821|  12.3k|                break;
  822|  6.10k|            case AOM_USAGE_REALTIME:
  ------------------
  |  Branch (822:13): [True: 6.10k, False: 12.3k]
  ------------------
  823|       |                // For real-time mode we need to use CBR rate control mode. AOM_Q doesn't fit the
  824|       |                // rate control requirements for real-time mode. CBR does.
  825|  6.10k|                cfg->rc_end_usage = AOM_CBR;
  826|  6.10k|                break;
  827|      0|#if defined(AOM_USAGE_ALL_INTRA)
  828|      0|            case AOM_USAGE_ALL_INTRA:
  ------------------
  |  Branch (828:13): [True: 0, False: 18.4k]
  ------------------
  829|      0|                cfg->rc_end_usage = AOM_Q;
  830|      0|                break;
  831|  18.4k|#endif
  832|  18.4k|        }
  833|       |
  834|       |        // Profile 0.  8-bit and 10-bit 4:2:0 and 4:0:0 only.
  835|       |        // Profile 1.  8-bit and 10-bit 4:4:4
  836|       |        // Profile 2.  8-bit and 10-bit 4:2:2
  837|       |        //            12-bit 4:0:0, 4:2:0, 4:2:2 and 4:4:4
  838|  18.4k|        uint8_t seqProfile = 0;
  839|  18.4k|        if (image->depth == 12) {
  ------------------
  |  Branch (839:13): [True: 2.66k, False: 15.7k]
  ------------------
  840|       |            // Only seqProfile 2 can handle 12 bit
  841|  2.66k|            seqProfile = 2;
  842|  15.7k|        } else {
  843|       |            // 8-bit or 10-bit
  844|       |
  845|  15.7k|            if (alpha) {
  ------------------
  |  Branch (845:17): [True: 3.96k, False: 11.7k]
  ------------------
  846|  3.96k|                seqProfile = 0;
  847|  11.7k|            } else {
  848|  11.7k|                switch (image->yuvFormat) {
  849|  1.28k|                    case AVIF_PIXEL_FORMAT_YUV444:
  ------------------
  |  Branch (849:21): [True: 1.28k, False: 10.4k]
  ------------------
  850|  1.28k|                        seqProfile = 1;
  851|  1.28k|                        break;
  852|  1.59k|                    case AVIF_PIXEL_FORMAT_YUV422:
  ------------------
  |  Branch (852:21): [True: 1.59k, False: 10.1k]
  ------------------
  853|  1.59k|                        seqProfile = 2;
  854|  1.59k|                        break;
  855|  2.87k|                    case AVIF_PIXEL_FORMAT_YUV420:
  ------------------
  |  Branch (855:21): [True: 2.87k, False: 8.90k]
  ------------------
  856|  2.87k|                        seqProfile = 0;
  857|  2.87k|                        break;
  858|  6.02k|                    case AVIF_PIXEL_FORMAT_YUV400:
  ------------------
  |  Branch (858:21): [True: 6.02k, False: 5.75k]
  ------------------
  859|  6.02k|                        seqProfile = 0;
  860|  6.02k|                        break;
  861|      0|                    case AVIF_PIXEL_FORMAT_NONE:
  ------------------
  |  Branch (861:21): [True: 0, False: 11.7k]
  ------------------
  862|      0|                    case AVIF_PIXEL_FORMAT_COUNT:
  ------------------
  |  Branch (862:21): [True: 0, False: 11.7k]
  ------------------
  863|      0|                    default:
  ------------------
  |  Branch (863:21): [True: 0, False: 11.7k]
  ------------------
  864|      0|                        break;
  865|  11.7k|                }
  866|  11.7k|            }
  867|  15.7k|        }
  868|       |
  869|  18.4k|        cfg->g_profile = seqProfile;
  870|  18.4k|        cfg->g_bit_depth = image->depth;
  871|  18.4k|        cfg->g_input_bit_depth = image->depth;
  872|  18.4k|        cfg->g_w = image->width;
  873|  18.4k|        cfg->g_h = image->height;
  874|  18.4k|        cfg->g_forced_max_frame_width = encoder->width;
  875|  18.4k|        cfg->g_forced_max_frame_height = encoder->height;
  876|       |
  877|       |        // Detect the libaom v3.6.0 bug described in
  878|       |        // https://crbug.com/aomedia/2871#c12. See the changes to
  879|       |        // av1/encoder/encoder.c in
  880|       |        // https://aomedia-review.googlesource.com/c/aom/+/174421.
  881|  18.4k|        static const int aomVersion_3_6_0 = (3 << 16) | (6 << 8);
  882|  18.4k|        if (aomVersion == aomVersion_3_6_0) {
  ------------------
  |  Branch (882:13): [True: 0, False: 18.4k]
  ------------------
  883|       |            // Detect the use of levels 7.x and 8.x, which use a larger max
  884|       |            // tile area (4096 * 4608) than MAX_TILE_AREA (4096 * 2304). The
  885|       |            // larger max tile area may not result in a different bitstream
  886|       |            // (see the tile_info() function in the AV1 spec, Section 5.9.15),
  887|       |            // so this is just a necessary condition for the bug.
  888|      0|            if (!doesLevelMatch(image->width, image->height, 8192, 4352, 2) &&
  ------------------
  |  Branch (888:17): [True: 0, False: 0]
  ------------------
  889|      0|                (doesLevelMatch(image->width, image->height, 16384, 8704, 2) ||
  ------------------
  |  Branch (889:18): [True: 0, False: 0]
  ------------------
  890|      0|                 doesLevelMatch(image->width, image->height, 32768, 17408, 2))) {
  ------------------
  |  Branch (890:18): [True: 0, False: 0]
  ------------------
  891|      0|                avifDiagnosticsPrintf(codec->diag, "Detected libaom v3.6.0 bug with large images. Upgrade to libaom v3.6.1 or later.");
  892|      0|                return AVIF_RESULT_UNKNOWN_ERROR;
  893|      0|            }
  894|      0|        }
  895|       |
  896|  18.4k|        if (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) {
  ------------------
  |  Branch (896:13): [True: 0, False: 18.4k]
  ------------------
  897|       |            // Set the maximum number of frames to encode to 1. This instructs
  898|       |            // libaom to set still_picture and reduced_still_picture_header to
  899|       |            // 1 in AV1 sequence headers.
  900|      0|            cfg->g_limit = 1;
  901|      0|        }
  902|  18.4k|        if (useAllIntra) {
  ------------------
  |  Branch (902:13): [True: 0, False: 18.4k]
  ------------------
  903|       |#if !defined(AOM_USAGE_ALL_INTRA)
  904|       |            // Use the default settings of the new AOM_USAGE_ALL_INTRA (added in
  905|       |            // https://crbug.com/aomedia/2959).
  906|       |            //
  907|       |            // Set g_lag_in_frames to 0 to reduce the number of frame buffers
  908|       |            // (from 20 to 2) in libaom's lookahead structure. This reduces
  909|       |            // memory consumption when encoding a single image.
  910|       |            cfg->g_lag_in_frames = 0;
  911|       |            // Disable automatic placement of key frames by the encoder.
  912|       |            cfg->kf_mode = AOM_KF_DISABLED;
  913|       |            // Tell libaom that all frames will be key frames.
  914|       |            cfg->kf_max_dist = 0;
  915|       |#endif
  916|  18.4k|        } else {
  917|  18.4k|            if (encoder->keyframeInterval > 0) {
  ------------------
  |  Branch (917:17): [True: 0, False: 18.4k]
  ------------------
  918|      0|                cfg->kf_max_dist = encoder->keyframeInterval;
  919|      0|            }
  920|  18.4k|        }
  921|  18.4k|        if (encoder->extraLayerCount > 0) {
  ------------------
  |  Branch (921:13): [True: 18.4k, False: 0]
  ------------------
  922|  18.4k|            cfg->g_limit = encoder->extraLayerCount + 1;
  923|       |            // For layered image, disable lagged encoding to always get output
  924|       |            // frame for each input frame.
  925|  18.4k|            cfg->g_lag_in_frames = 0;
  926|       |
  927|  18.4k|            if (aomVersion >= aomVersion_3_14_0) {
  ------------------
  |  Branch (927:17): [True: 18.4k, False: 0]
  ------------------
  928|       |                // Disable QP offsets, so CQ level = frame QP for every frame.
  929|       |                // This feature requires libaom 3.14.0 or later.
  930|  18.4k|                if (cfg->rc_end_usage == AOM_Q) {
  ------------------
  |  Branch (930:21): [True: 12.3k, False: 6.10k]
  ------------------
  931|  12.3k|                    cfg->use_fixed_qp_offsets = 2;
  932|  12.3k|                }
  933|  18.4k|            }
  934|  18.4k|        }
  935|  18.4k|        if (disableLaggedOutput) {
  ------------------
  |  Branch (935:13): [True: 9.23k, False: 9.17k]
  ------------------
  936|  9.23k|            cfg->g_lag_in_frames = 0;
  937|  9.23k|        }
  938|  18.4k|        if ((encoder->width || encoder->height) && (cfg->g_lag_in_frames > 1)) {
  ------------------
  |  Branch (938:14): [True: 0, False: 18.4k]
  |  Branch (938:32): [True: 0, False: 18.4k]
  |  Branch (938:52): [True: 0, False: 0]
  ------------------
  939|       |            // aom_codec_enc_config_set() does not allow changing frame dimensions if
  940|       |            // g_lag_in_frames > 1.
  941|      0|            cfg->g_lag_in_frames = 1;
  942|      0|        }
  943|  18.4k|        if (encoder->maxThreads > 1) {
  ------------------
  |  Branch (943:13): [True: 17.0k, False: 1.34k]
  ------------------
  944|       |            // libaom fails if cfg->g_threads is greater than 64 threads. See MAX_NUM_THREADS in
  945|       |            // aom/aom_util/aom_thread.h.
  946|  17.0k|            cfg->g_threads = AVIF_MIN(encoder->maxThreads, 64);
  ------------------
  |  |   19|  17.0k|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 16.7k, False: 314]
  |  |  ------------------
  ------------------
  947|       |
  948|       |            // Detect the libaom bug before v3.15.2 described in
  949|       |            // https://issues.oss-fuzz.com/issues/559019046. See the changes in
  950|       |            // https://aomedia-review.googlesource.com/c/aom/+/216921.
  951|  17.0k|            static const int aomVersion_3_15_2 = (3 << 16) | (15 << 8) | 2;
  952|  17.0k|            if (aom_codec_version() < aomVersion_3_15_2) {
  ------------------
  |  Branch (952:17): [True: 0, False: 17.0k]
  ------------------
  953|       |                // When creating extra worker threads during encoding (which can
  954|       |                // happen when the new frame is larger), libaom may skip
  955|       |                // allocating the pixel_gradient_info buffers needed by
  956|       |                // GOOD_QUALITY mode. Work around the bug by disabling
  957|       |                // multithreading.
  958|      0|                if (aomUsage == AOM_USAGE_GOOD_QUALITY && (encoder->width || encoder->height)) {
  ------------------
  |  Branch (958:21): [True: 0, False: 0]
  |  Branch (958:60): [True: 0, False: 0]
  |  Branch (958:78): [True: 0, False: 0]
  ------------------
  959|      0|                    cfg->g_threads = 1;
  960|      0|                }
  961|      0|            }
  962|  17.0k|        }
  963|       |
  964|       |        // Encode alpha as 4:0:0.
  965|       |        // AVIF specification, Section 4 "Auxiliary Image Items and Sequences":
  966|       |        //   The mono_chrome field in the Sequence Header OBU shall be set to 1.
  967|  18.4k|        if (alpha || (image->yuvFormat == AVIF_PIXEL_FORMAT_YUV400)) {
  ------------------
  |  Branch (967:13): [True: 4.61k, False: 13.7k]
  |  Branch (967:22): [True: 6.79k, False: 6.99k]
  ------------------
  968|  11.4k|            cfg->monochrome = 1;
  969|  11.4k|        }
  970|       |
  971|  18.4k|        if (!avifProcessAOMOptionsPreInit(codec, alpha, cfg)) {
  ------------------
  |  Branch (971:13): [True: 0, False: 18.4k]
  ------------------
  972|      0|            return AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION;
  973|      0|        }
  974|       |
  975|  18.4k|        int minQuantizer;
  976|  18.4k|        int maxQuantizer;
  977|  18.4k|        if (alpha) {
  ------------------
  |  Branch (977:13): [True: 4.61k, False: 13.7k]
  ------------------
  978|  4.61k|            minQuantizer = encoder->minQuantizerAlpha;
  979|  4.61k|            maxQuantizer = encoder->maxQuantizerAlpha;
  980|  13.7k|        } else {
  981|  13.7k|            minQuantizer = encoder->minQuantizer;
  982|  13.7k|            maxQuantizer = encoder->maxQuantizer;
  983|  13.7k|        }
  984|  18.4k|        minQuantizer = AVIF_CLAMP(minQuantizer, 0, 63);
  ------------------
  |  |   18|  18.4k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 18.4k]
  |  |  |  Branch (18:60): [True: 0, False: 18.4k]
  |  |  ------------------
  ------------------
  985|  18.4k|        maxQuantizer = AVIF_CLAMP(maxQuantizer, 0, 63);
  ------------------
  |  |   18|  18.4k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 18.4k]
  |  |  |  Branch (18:60): [True: 0, False: 18.4k]
  |  |  ------------------
  ------------------
  986|  18.4k|        if ((cfg->rc_end_usage == AOM_VBR) || (cfg->rc_end_usage == AOM_CBR)) {
  ------------------
  |  Branch (986:13): [True: 0, False: 18.4k]
  |  Branch (986:47): [True: 6.10k, False: 12.3k]
  ------------------
  987|       |            // cq-level is ignored in these two end-usage modes, so adjust minQuantizer and
  988|       |            // maxQuantizer to the target quantizer.
  989|  6.10k|            if (quantizer == AVIF_QUANTIZER_LOSSLESS) {
  ------------------
  |  |  108|  6.10k|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
  |  Branch (989:17): [True: 236, False: 5.86k]
  ------------------
  990|    236|                minQuantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|    236|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
  991|    236|                maxQuantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|    236|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
  992|  5.86k|            } else {
  993|  5.86k|                minQuantizer = AVIF_MAX(quantizer - 4, minQuantizer);
  ------------------
  |  |   20|  5.86k|#define AVIF_MAX(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (20:25): [True: 5.46k, False: 398]
  |  |  ------------------
  ------------------
  994|  5.86k|                maxQuantizer = AVIF_MIN(quantizer + 4, maxQuantizer);
  ------------------
  |  |   19|  5.86k|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 4.39k, False: 1.47k]
  |  |  ------------------
  ------------------
  995|  5.86k|            }
  996|  6.10k|        }
  997|  18.4k|        cfg->rc_min_quantizer = minQuantizer;
  998|  18.4k|        cfg->rc_max_quantizer = maxQuantizer;
  999|  18.4k|        quantizerUpdated = AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 1000|       |
 1001|  18.4k|        aom_codec_flags_t encoderFlags = 0;
 1002|  18.4k|        if (image->depth > 8) {
  ------------------
  |  Branch (1002:13): [True: 5.12k, False: 13.2k]
  ------------------
 1003|  5.12k|            encoderFlags |= AOM_CODEC_USE_HIGHBITDEPTH;
 1004|  5.12k|        }
 1005|  18.4k|        if (aom_codec_enc_init(&codec->internal->encoder, encoderInterface, cfg, encoderFlags) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1005:13): [True: 0, False: 18.4k]
  ------------------
 1006|      0|            aomDiagPrintf(codec->diag, "aom_codec_enc_init()", &codec->internal->encoder);
 1007|      0|            return AVIF_RESULT_UNKNOWN_ERROR;
 1008|      0|        }
 1009|  18.4k|        codec->internal->encoderInitialized = AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 1010|       |
 1011|  18.4k|        if ((cfg->rc_end_usage == AOM_CQ) || (cfg->rc_end_usage == AOM_Q)) {
  ------------------
  |  Branch (1011:13): [True: 0, False: 18.4k]
  |  Branch (1011:46): [True: 12.3k, False: 6.10k]
  ------------------
 1012|  12.3k|            aom_codec_control(&codec->internal->encoder, AOME_SET_CQ_LEVEL, quantizer);
 1013|  12.3k|        }
 1014|  18.4k|        avifBool lossless = (quantizer == AVIF_QUANTIZER_LOSSLESS);
  ------------------
  |  |  108|  18.4k|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 1015|  18.4k|        if (lossless) {
  ------------------
  |  Branch (1015:13): [True: 788, False: 17.6k]
  ------------------
 1016|    788|            aom_codec_control(&codec->internal->encoder, AV1E_SET_LOSSLESS, 1);
 1017|    788|        }
 1018|  18.4k|        if (tileRowsLog2 != 0) {
  ------------------
  |  Branch (1018:13): [True: 15.2k, False: 3.11k]
  ------------------
 1019|  15.2k|            aom_codec_control(&codec->internal->encoder, AV1E_SET_TILE_ROWS, tileRowsLog2);
 1020|  15.2k|        }
 1021|  18.4k|        if (tileColsLog2 != 0) {
  ------------------
  |  Branch (1021:13): [True: 15.0k, False: 3.32k]
  ------------------
 1022|  15.0k|            aom_codec_control(&codec->internal->encoder, AV1E_SET_TILE_COLUMNS, tileColsLog2);
 1023|  15.0k|        }
 1024|  18.4k|        if (encoder->extraLayerCount > 0) {
  ------------------
  |  Branch (1024:13): [True: 18.4k, False: 0]
  ------------------
 1025|  18.4k|            int layerCount = encoder->extraLayerCount + 1;
 1026|  18.4k|            if (aom_codec_control(&codec->internal->encoder, AOME_SET_NUMBER_SPATIAL_LAYERS, layerCount) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1026:17): [True: 0, False: 18.4k]
  ------------------
 1027|      0|                aomDiagPrintf(codec->diag, "aom_codec_control(AOME_SET_NUMBER_SPATIAL_LAYERS)", &codec->internal->encoder);
 1028|      0|                return AVIF_RESULT_UNKNOWN_ERROR;
 1029|      0|            }
 1030|  18.4k|        }
 1031|  18.4k|        if (aomCpuUsed != -1) {
  ------------------
  |  Branch (1031:13): [True: 18.4k, False: 0]
  ------------------
 1032|  18.4k|            if (aom_codec_control(&codec->internal->encoder, AOME_SET_CPUUSED, aomCpuUsed) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1032:17): [True: 0, False: 18.4k]
  ------------------
 1033|      0|                aomDiagPrintf(codec->diag, "aom_codec_control(AOME_SET_CPUUSED)", &codec->internal->encoder);
 1034|      0|                return AVIF_RESULT_UNKNOWN_ERROR;
 1035|      0|            }
 1036|  18.4k|        }
 1037|       |
 1038|       |        // Set color_config() in the sequence header OBU.
 1039|  18.4k|        if (alpha) {
  ------------------
  |  Branch (1039:13): [True: 4.61k, False: 13.7k]
  ------------------
 1040|       |            // AVIF specification, Section 4 "Auxiliary Image Items and Sequences":
 1041|       |            //   The color_range field in the Sequence Header OBU shall be set to 1.
 1042|  4.61k|            aom_codec_control(&codec->internal->encoder, AV1E_SET_COLOR_RANGE, AOM_CR_FULL_RANGE);
 1043|       |
 1044|       |            // Keep the default AOM_CSP_UNKNOWN value.
 1045|       |
 1046|       |            // CICP (CP/TC/MC) does not apply to the alpha auxiliary image.
 1047|       |            // Keep default Unspecified (2) colour primaries, transfer characteristics,
 1048|       |            // and matrix coefficients.
 1049|  13.7k|        } else {
 1050|       |            // AVIF specification, Section 2.2.1. "AV1 Item Configuration Property":
 1051|       |            //   The values of the fields in the AV1CodecConfigurationBox shall match those
 1052|       |            //   of the Sequence Header OBU in the AV1 Image Item Data.
 1053|       |            // CICP values could be set to 2/2/2 (Unspecified) in the Sequence Header OBU for
 1054|       |            // simplicity and to save 3 bytes, but some decoders ignore the colr box and rely
 1055|       |            // on the OBU contents instead. See #2850.
 1056|       |            // libaom's defaults are AOM_CICP_CP_UNSPECIFIED, AOM_CICP_TC_UNSPECIFIED,
 1057|       |            // AOM_CICP_MC_UNSPECIFIED, AOM_CSP_UNKNOWN, and 0 (studio/limited range). Call
 1058|       |            // aom_codec_control() only if the values are not the defaults.
 1059|  13.7k|            if (image->colorPrimaries != AVIF_COLOR_PRIMARIES_UNSPECIFIED) {
  ------------------
  |  Branch (1059:17): [True: 0, False: 13.7k]
  ------------------
 1060|      0|                aom_codec_control(&codec->internal->encoder, AV1E_SET_COLOR_PRIMARIES, (int)image->colorPrimaries);
 1061|      0|            }
 1062|  13.7k|            if (image->transferCharacteristics != AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED) {
  ------------------
  |  Branch (1062:17): [True: 0, False: 13.7k]
  ------------------
 1063|      0|                aom_codec_control(&codec->internal->encoder, AV1E_SET_TRANSFER_CHARACTERISTICS, (int)image->transferCharacteristics);
 1064|      0|            }
 1065|  13.7k|            if (image->matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_UNSPECIFIED) {
  ------------------
  |  Branch (1065:17): [True: 0, False: 13.7k]
  ------------------
 1066|      0|                aom_codec_control(&codec->internal->encoder, AV1E_SET_MATRIX_COEFFICIENTS, (int)image->matrixCoefficients);
 1067|      0|            }
 1068|  13.7k|            if (image->yuvChromaSamplePosition != AVIF_CHROMA_SAMPLE_POSITION_UNKNOWN) {
  ------------------
  |  Branch (1068:17): [True: 0, False: 13.7k]
  ------------------
 1069|      0|                aom_codec_control(&codec->internal->encoder, AV1E_SET_CHROMA_SAMPLE_POSITION, (int)image->yuvChromaSamplePosition);
 1070|      0|            }
 1071|       |
 1072|       |            // AV1-ISOBMFF specification, Section 2.3.4:
 1073|       |            //   The value of full_range_flag in the 'colr' box SHALL match the color_range
 1074|       |            //   flag in the Sequence Header OBU.
 1075|  13.7k|            if (image->yuvRange != AVIF_RANGE_LIMITED) {
  ------------------
  |  Branch (1075:17): [True: 13.7k, False: 0]
  ------------------
 1076|  13.7k|                aom_codec_control(&codec->internal->encoder, AV1E_SET_COLOR_RANGE, (int)image->yuvRange);
 1077|  13.7k|            }
 1078|  13.7k|        }
 1079|       |
 1080|  18.4k|#if defined(AOM_CTRL_AV1E_SET_SKIP_POSTPROC_FILTERING)
 1081|  18.4k|        if (cfg->g_usage == AOM_USAGE_ALL_INTRA) {
  ------------------
  |  Branch (1081:13): [True: 0, False: 18.4k]
  ------------------
 1082|       |            // Enable AV1E_SET_SKIP_POSTPROC_FILTERING for still-picture encoding, which is
 1083|       |            // disabled by default.
 1084|      0|            aom_codec_control(&codec->internal->encoder, AV1E_SET_SKIP_POSTPROC_FILTERING, 1);
 1085|      0|        }
 1086|  18.4k|#endif
 1087|       |
 1088|  18.4k|        if (useLibavifDefaultTuneMetric &&
  ------------------
  |  Branch (1088:13): [True: 17.6k, False: 788]
  ------------------
 1089|  17.6k|            aom_codec_control(&codec->internal->encoder, AOME_SET_TUNING, libavifDefaultTuneMetric) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1089:13): [True: 0, False: 17.6k]
  ------------------
 1090|      0|            aomDiagPrintf(codec->diag, "aom_codec_control(AOME_SET_TUNING)", &codec->internal->encoder);
 1091|      0|            return AVIF_RESULT_UNKNOWN_ERROR;
 1092|      0|        }
 1093|  18.4k|        if (!avifProcessAOMOptionsPostInit(codec, alpha)) {
  ------------------
  |  Branch (1093:13): [True: 0, False: 18.4k]
  ------------------
 1094|      0|            return AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION;
 1095|      0|        }
 1096|       |
 1097|  18.4k|        if (image->depth == 12) {
  ------------------
  |  Branch (1097:13): [True: 2.66k, False: 15.7k]
  ------------------
 1098|       |            // The encoder may produce integer overflows with 12-bit input when loop restoration is enabled. See crbug.com/aomedia/42302587.
 1099|  2.66k|            if (aom_codec_control(&codec->internal->encoder, AV1E_SET_ENABLE_RESTORATION, 0) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1099:17): [True: 0, False: 2.66k]
  ------------------
 1100|      0|                aomDiagPrintf(codec->diag, "aom_codec_control(AV1E_SET_ENABLE_RESTORATION)", &codec->internal->encoder);
 1101|      0|                return AVIF_RESULT_UNKNOWN_ERROR;
 1102|      0|            }
 1103|  2.66k|        }
 1104|  55.2k|    } else {
 1105|  55.2k|        avifBool dimensionsChanged = AVIF_FALSE;
  ------------------
  |  |   89|  55.2k|#define AVIF_FALSE 0
  ------------------
 1106|  55.2k|        if ((cfg->g_w != image->width) || (cfg->g_h != image->height)) {
  ------------------
  |  Branch (1106:13): [True: 0, False: 55.2k]
  |  Branch (1106:43): [True: 0, False: 55.2k]
  ------------------
 1107|      0|            cfg->g_w = image->width;
 1108|      0|            cfg->g_h = image->height;
 1109|      0|            dimensionsChanged = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1110|      0|        }
 1111|  55.2k|        if (alpha) {
  ------------------
  |  Branch (1111:13): [True: 13.8k, False: 41.3k]
  ------------------
 1112|  13.8k|            if (encoderChanges & (AVIF_ENCODER_CHANGE_MIN_QUANTIZER_ALPHA | AVIF_ENCODER_CHANGE_MAX_QUANTIZER_ALPHA)) {
  ------------------
  |  Branch (1112:17): [True: 0, False: 13.8k]
  ------------------
 1113|      0|                cfg->rc_min_quantizer = AVIF_CLAMP(encoder->minQuantizerAlpha, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1114|      0|                cfg->rc_max_quantizer = AVIF_CLAMP(encoder->maxQuantizerAlpha, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1115|      0|                quantizerUpdated = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1116|      0|            }
 1117|  41.3k|        } else {
 1118|  41.3k|            if (encoderChanges & (AVIF_ENCODER_CHANGE_MIN_QUANTIZER | AVIF_ENCODER_CHANGE_MAX_QUANTIZER)) {
  ------------------
  |  Branch (1118:17): [True: 0, False: 41.3k]
  ------------------
 1119|      0|                cfg->rc_min_quantizer = AVIF_CLAMP(encoder->minQuantizer, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1120|      0|                cfg->rc_max_quantizer = AVIF_CLAMP(encoder->maxQuantizer, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1121|      0|                quantizerUpdated = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1122|      0|            }
 1123|  41.3k|        }
 1124|  55.2k|        const int qualityChangedBit = alpha ? AVIF_ENCODER_CHANGE_QUALITY_ALPHA : AVIF_ENCODER_CHANGE_QUALITY;
  ------------------
  |  Branch (1124:39): [True: 13.8k, False: 41.3k]
  ------------------
 1125|  55.2k|        if (encoderChanges & qualityChangedBit) {
  ------------------
  |  Branch (1125:13): [True: 0, False: 55.2k]
  ------------------
 1126|      0|            if ((cfg->rc_end_usage == AOM_VBR) || (cfg->rc_end_usage == AOM_CBR)) {
  ------------------
  |  Branch (1126:17): [True: 0, False: 0]
  |  Branch (1126:51): [True: 0, False: 0]
  ------------------
 1127|       |                // cq-level is ignored in these two end-usage modes, so adjust minQuantizer and
 1128|       |                // maxQuantizer to the target quantizer.
 1129|      0|                if (quantizer == AVIF_QUANTIZER_LOSSLESS) {
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
  |  Branch (1129:21): [True: 0, False: 0]
  ------------------
 1130|      0|                    cfg->rc_min_quantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 1131|      0|                    cfg->rc_max_quantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 1132|      0|                } else {
 1133|      0|                    int minQuantizer;
 1134|      0|                    int maxQuantizer;
 1135|      0|                    if (alpha) {
  ------------------
  |  Branch (1135:25): [True: 0, False: 0]
  ------------------
 1136|      0|                        minQuantizer = encoder->minQuantizerAlpha;
 1137|      0|                        maxQuantizer = encoder->maxQuantizerAlpha;
 1138|      0|                    } else {
 1139|      0|                        minQuantizer = encoder->minQuantizer;
 1140|      0|                        maxQuantizer = encoder->maxQuantizer;
 1141|      0|                    }
 1142|      0|                    minQuantizer = AVIF_CLAMP(minQuantizer, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1143|      0|                    maxQuantizer = AVIF_CLAMP(maxQuantizer, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1144|      0|                    cfg->rc_min_quantizer = AVIF_MAX(quantizer - 4, minQuantizer);
  ------------------
  |  |   20|      0|#define AVIF_MAX(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (20:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1145|      0|                    cfg->rc_max_quantizer = AVIF_MIN(quantizer + 4, maxQuantizer);
  ------------------
  |  |   19|      0|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1146|      0|                }
 1147|      0|                quantizerUpdated = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1148|      0|            }
 1149|      0|        }
 1150|  55.2k|        if (quantizerUpdated || dimensionsChanged) {
  ------------------
  |  Branch (1150:13): [True: 0, False: 55.2k]
  |  Branch (1150:33): [True: 0, False: 55.2k]
  ------------------
 1151|      0|            aom_codec_err_t err = aom_codec_enc_config_set(&codec->internal->encoder, cfg);
 1152|      0|            if (err != AOM_CODEC_OK) {
  ------------------
  |  Branch (1152:17): [True: 0, False: 0]
  ------------------
 1153|      0|                aomDiagPrintf(codec->diag, "aom_codec_enc_config_set()", &codec->internal->encoder);
 1154|      0|                return AVIF_RESULT_UNKNOWN_ERROR;
 1155|      0|            }
 1156|      0|        }
 1157|  55.2k|        if (encoderChanges & AVIF_ENCODER_CHANGE_TILE_ROWS_LOG2) {
  ------------------
  |  Branch (1157:13): [True: 0, False: 55.2k]
  ------------------
 1158|      0|            aom_codec_control(&codec->internal->encoder, AV1E_SET_TILE_ROWS, tileRowsLog2);
 1159|      0|        }
 1160|  55.2k|        if (encoderChanges & AVIF_ENCODER_CHANGE_TILE_COLS_LOG2) {
  ------------------
  |  Branch (1160:13): [True: 0, False: 55.2k]
  ------------------
 1161|      0|            aom_codec_control(&codec->internal->encoder, AV1E_SET_TILE_COLUMNS, tileColsLog2);
 1162|      0|        }
 1163|  55.2k|        if (encoderChanges & qualityChangedBit) {
  ------------------
  |  Branch (1163:13): [True: 0, False: 55.2k]
  ------------------
 1164|      0|            if ((cfg->rc_end_usage == AOM_CQ) || (cfg->rc_end_usage == AOM_Q)) {
  ------------------
  |  Branch (1164:17): [True: 0, False: 0]
  |  Branch (1164:50): [True: 0, False: 0]
  ------------------
 1165|      0|                aom_codec_control(&codec->internal->encoder, AOME_SET_CQ_LEVEL, quantizer);
 1166|      0|            }
 1167|      0|            avifBool lossless = (quantizer == AVIF_QUANTIZER_LOSSLESS);
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 1168|      0|            aom_codec_control(&codec->internal->encoder, AV1E_SET_LOSSLESS, lossless);
 1169|      0|        }
 1170|  55.2k|        if (encoderChanges & AVIF_ENCODER_CHANGE_CODEC_SPECIFIC) {
  ------------------
  |  Branch (1170:13): [True: 0, False: 55.2k]
  ------------------
 1171|      0|            if (!avifProcessAOMOptionsPostInit(codec, alpha)) {
  ------------------
  |  Branch (1171:17): [True: 0, False: 0]
  ------------------
 1172|      0|                return AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION;
 1173|      0|            }
 1174|      0|        }
 1175|  55.2k|    }
 1176|       |
 1177|  73.6k|    if (codec->internal->currentLayer > encoder->extraLayerCount) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 73.6k]
  ------------------
 1178|      0|        avifDiagnosticsPrintf(codec->diag,
 1179|      0|                              "Too many layers sent. Expected %u layers, but got %u layers.",
 1180|      0|                              encoder->extraLayerCount + 1,
 1181|      0|                              codec->internal->currentLayer + 1);
 1182|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1183|      0|    }
 1184|  73.6k|    if (encoder->extraLayerCount > 0) {
  ------------------
  |  Branch (1184:9): [True: 73.6k, False: 0]
  ------------------
 1185|  73.6k|        aom_codec_control(&codec->internal->encoder, AOME_SET_SPATIAL_LAYER_ID, codec->internal->currentLayer);
 1186|  73.6k|    }
 1187|       |
 1188|  73.6k|    aom_scaling_mode_t aomScalingMode;
 1189|  73.6k|    if (!avifFindAOMScalingMode(&encoder->scalingMode.horizontal, &aomScalingMode.h_scaling_mode)) {
  ------------------
  |  Branch (1189:9): [True: 0, False: 73.6k]
  ------------------
 1190|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 1191|      0|    }
 1192|  73.6k|    if (!avifFindAOMScalingMode(&encoder->scalingMode.vertical, &aomScalingMode.v_scaling_mode)) {
  ------------------
  |  Branch (1192:9): [True: 0, False: 73.6k]
  ------------------
 1193|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 1194|      0|    }
 1195|  73.6k|    if ((aomScalingMode.h_scaling_mode != AOME_NORMAL) || (aomScalingMode.v_scaling_mode != AOME_NORMAL)) {
  ------------------
  |  Branch (1195:9): [True: 55.2k, False: 18.4k]
  |  Branch (1195:59): [True: 0, False: 18.4k]
  ------------------
 1196|       |        // AOME_SET_SCALEMODE only applies to next frame (layer), so we have to set it every time.
 1197|  55.2k|        aom_codec_control(&codec->internal->encoder, AOME_SET_SCALEMODE, &aomScalingMode);
 1198|       |
 1199|       |        // Check if we need to avoid a multithreading crash in loop restoration
 1200|       |        // code in libaom < 3.13.3 when the first layer of a layered image is
 1201|       |        // scaled. See https://aomedia-review.googlesource.com/208901.
 1202|  55.2k|        static const int aomVersion_3_13_3 = (3 << 16) | (13 << 8) | 3;
 1203|  55.2k|        if (aomVersion < aomVersion_3_13_3 && encoder->maxThreads > 1 && encoder->extraLayerCount > 0 &&
  ------------------
  |  Branch (1203:13): [True: 0, False: 55.2k]
  |  Branch (1203:47): [True: 0, False: 0]
  |  Branch (1203:74): [True: 0, False: 0]
  ------------------
 1204|      0|            codec->internal->currentLayer == 0) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 0]
  ------------------
 1205|      0|            aom_codec_control(&codec->internal->encoder, AV1E_SET_ENABLE_RESTORATION, 0);
 1206|      0|        }
 1207|  55.2k|    }
 1208|       |
 1209|  73.6k|    aom_image_t aomImage;
 1210|       |    // We prefer to simply set the aomImage.planes[] pointers to the plane buffers in 'image'. When
 1211|       |    // doing this, we set aomImage.w equal to aomImage.d_w and aomImage.h equal to aomImage.d_h and
 1212|       |    // do not "align" aomImage.w and aomImage.h. Unfortunately this exposes a bug in libaom
 1213|       |    // (https://crbug.com/aomedia/3113) if chroma is subsampled and image->width or image->height is
 1214|       |    // equal to 1. To work around this libaom bug, we allocate the aomImage.planes[] buffers and
 1215|       |    // copy the image YUV data if image->width or image->height is equal to 1. This bug has been
 1216|       |    // fixed in libaom v3.1.3.
 1217|       |    //
 1218|       |    // Note: The exact condition for the bug is
 1219|       |    //   ((image->width == 1) && (chroma is subsampled horizontally)) ||
 1220|       |    //   ((image->height == 1) && (chroma is subsampled vertically))
 1221|       |    // Since an image width or height of 1 is uncommon in practice, we test an inexact but simpler
 1222|       |    // condition.
 1223|  73.6k|    avifBool aomImageAllocated = (image->width == 1) || (image->height == 1);
  ------------------
  |  Branch (1223:34): [True: 0, False: 73.6k]
  |  Branch (1223:57): [True: 0, False: 73.6k]
  ------------------
 1224|  73.6k|    if (aomImageAllocated) {
  ------------------
  |  Branch (1224:9): [True: 0, False: 73.6k]
  ------------------
 1225|      0|        aom_img_alloc(&aomImage, codec->internal->aomFormat, image->width, image->height, 16);
 1226|  73.6k|    } else {
 1227|  73.6k|        memset(&aomImage, 0, sizeof(aomImage));
 1228|  73.6k|        aomImage.fmt = codec->internal->aomFormat;
 1229|  73.6k|        aomImage.bit_depth = (image->depth > 8) ? 16 : 8;
  ------------------
  |  Branch (1229:30): [True: 20.4k, False: 53.1k]
  ------------------
 1230|  73.6k|        aomImage.w = image->width;
 1231|  73.6k|        aomImage.h = image->height;
 1232|  73.6k|        aomImage.d_w = image->width;
 1233|  73.6k|        aomImage.d_h = image->height;
 1234|       |        // Get sample size for this format.
 1235|  73.6k|        unsigned int bps;
 1236|  73.6k|        if (codec->internal->aomFormat == AOM_IMG_FMT_I420) {
  ------------------
  |  Branch (1236:13): [True: 43.9k, False: 29.6k]
  ------------------
 1237|  43.9k|            bps = 12;
 1238|  43.9k|        } else if (codec->internal->aomFormat == AOM_IMG_FMT_I422) {
  ------------------
  |  Branch (1238:20): [True: 4.99k, False: 24.6k]
  ------------------
 1239|  4.99k|            bps = 16;
 1240|  24.6k|        } else if (codec->internal->aomFormat == AOM_IMG_FMT_I444) {
  ------------------
  |  Branch (1240:20): [True: 4.17k, False: 20.4k]
  ------------------
 1241|  4.17k|            bps = 24;
 1242|  20.4k|        } else if (codec->internal->aomFormat == AOM_IMG_FMT_I42016) {
  ------------------
  |  Branch (1242:20): [True: 16.0k, False: 4.43k]
  ------------------
 1243|  16.0k|            bps = 24;
 1244|  16.0k|        } else if (codec->internal->aomFormat == AOM_IMG_FMT_I42216) {
  ------------------
  |  Branch (1244:20): [True: 2.40k, False: 2.02k]
  ------------------
 1245|  2.40k|            bps = 32;
 1246|  2.40k|        } else if (codec->internal->aomFormat == AOM_IMG_FMT_I44416) {
  ------------------
  |  Branch (1246:20): [True: 2.02k, False: 0]
  ------------------
 1247|  2.02k|            bps = 48;
 1248|  2.02k|        } else {
 1249|      0|            bps = 16;
 1250|      0|        }
 1251|  73.6k|        aomImage.bps = bps;
 1252|       |        // See avifImageCalcAOMFmt(). libaom doesn't have AOM_IMG_FMT_I400, so we use AOM_IMG_FMT_I420 as a substitute for monochrome.
 1253|  73.6k|        aomImage.x_chroma_shift = (alpha || codec->internal->formatInfo.monochrome) ? 1 : codec->internal->formatInfo.chromaShiftX;
  ------------------
  |  Branch (1253:36): [True: 18.4k, False: 55.1k]
  |  Branch (1253:45): [True: 27.1k, False: 27.9k]
  ------------------
 1254|  73.6k|        aomImage.y_chroma_shift = (alpha || codec->internal->formatInfo.monochrome) ? 1 : codec->internal->formatInfo.chromaShiftY;
  ------------------
  |  Branch (1254:36): [True: 18.4k, False: 55.1k]
  |  Branch (1254:45): [True: 27.1k, False: 27.9k]
  ------------------
 1255|  73.6k|    }
 1256|       |
 1257|  73.6k|    if (alpha) {
  ------------------
  |  Branch (1257:9): [True: 18.4k, False: 55.1k]
  ------------------
 1258|  18.4k|        if (aomImageAllocated) {
  ------------------
  |  Branch (1258:13): [True: 0, False: 18.4k]
  ------------------
 1259|      0|            const uint32_t bytesPerRow = ((image->depth > 8) ? 2 : 1) * image->width;
  ------------------
  |  Branch (1259:43): [True: 0, False: 0]
  ------------------
 1260|      0|            for (uint32_t j = 0; j < image->height; ++j) {
  ------------------
  |  Branch (1260:34): [True: 0, False: 0]
  ------------------
 1261|      0|                const uint8_t * srcAlphaRow = &image->alphaPlane[(size_t)j * image->alphaRowBytes];
 1262|      0|                uint8_t * dstAlphaRow = &aomImage.planes[0][(size_t)j * aomImage.stride[0]];
 1263|      0|                memcpy(dstAlphaRow, srcAlphaRow, bytesPerRow);
 1264|      0|            }
 1265|  18.4k|        } else {
 1266|  18.4k|            aomImage.planes[0] = image->alphaPlane;
 1267|  18.4k|            aomImage.stride[0] = image->alphaRowBytes;
 1268|  18.4k|        }
 1269|       |
 1270|       |        // Ignore UV planes when monochrome. Keep the default AOM_CSP_UNKNOWN value.
 1271|  55.1k|    } else {
 1272|  55.1k|        int yuvPlaneCount = 3;
 1273|  55.1k|        if (image->yuvFormat == AVIF_PIXEL_FORMAT_YUV400) {
  ------------------
  |  Branch (1273:13): [True: 27.1k, False: 27.9k]
  ------------------
 1274|  27.1k|            yuvPlaneCount = 1; // Ignore UV planes when monochrome
 1275|  27.1k|        }
 1276|  55.1k|        if (aomImageAllocated) {
  ------------------
  |  Branch (1276:13): [True: 0, False: 55.1k]
  ------------------
 1277|      0|            uint32_t bytesPerPixel = (image->depth > 8) ? 2 : 1;
  ------------------
  |  Branch (1277:38): [True: 0, False: 0]
  ------------------
 1278|      0|            for (int yuvPlane = 0; yuvPlane < yuvPlaneCount; ++yuvPlane) {
  ------------------
  |  Branch (1278:36): [True: 0, False: 0]
  ------------------
 1279|      0|                uint32_t planeWidth = avifImagePlaneWidth(image, yuvPlane);
 1280|      0|                uint32_t planeHeight = avifImagePlaneHeight(image, yuvPlane);
 1281|      0|                uint32_t bytesPerRow = bytesPerPixel * planeWidth;
 1282|       |
 1283|      0|                for (uint32_t j = 0; j < planeHeight; ++j) {
  ------------------
  |  Branch (1283:38): [True: 0, False: 0]
  ------------------
 1284|      0|                    const uint8_t * srcRow = &image->yuvPlanes[yuvPlane][(size_t)j * image->yuvRowBytes[yuvPlane]];
 1285|      0|                    uint8_t * dstRow = &aomImage.planes[yuvPlane][(size_t)j * aomImage.stride[yuvPlane]];
 1286|      0|                    memcpy(dstRow, srcRow, bytesPerRow);
 1287|      0|                }
 1288|      0|            }
 1289|  55.1k|        } else {
 1290|   166k|            for (int yuvPlane = 0; yuvPlane < yuvPlaneCount; ++yuvPlane) {
  ------------------
  |  Branch (1290:36): [True: 111k, False: 55.1k]
  ------------------
 1291|   111k|                aomImage.planes[yuvPlane] = image->yuvPlanes[yuvPlane];
 1292|   111k|                aomImage.stride[yuvPlane] = image->yuvRowBytes[yuvPlane];
 1293|   111k|            }
 1294|  55.1k|        }
 1295|  55.1k|    }
 1296|       |
 1297|  73.6k|    aom_enc_frame_flags_t encodeFlags = 0;
 1298|  73.6k|    if (addImageFlags & AVIF_ADD_IMAGE_FLAG_FORCE_KEYFRAME) {
  ------------------
  |  Branch (1298:9): [True: 0, False: 73.6k]
  ------------------
 1299|      0|        encodeFlags |= AOM_EFLAG_FORCE_KF;
 1300|      0|    }
 1301|  73.6k|    if (codec->internal->currentLayer > 0) {
  ------------------
  |  Branch (1301:9): [True: 55.2k, False: 18.4k]
  ------------------
 1302|  55.2k|        encodeFlags |= AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
 1303|  55.2k|                       AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF;
 1304|  55.2k|    }
 1305|  73.6k|    aom_codec_err_t encodeErr = aom_codec_encode(&codec->internal->encoder, &aomImage, 0, 1, encodeFlags);
 1306|  73.6k|    if (aomImageAllocated) {
  ------------------
  |  Branch (1306:9): [True: 0, False: 73.6k]
  ------------------
 1307|      0|        aom_img_free(&aomImage);
 1308|      0|    }
 1309|  73.6k|    if (encodeErr != AOM_CODEC_OK) {
  ------------------
  |  Branch (1309:9): [True: 0, False: 73.6k]
  ------------------
 1310|      0|        aomDiagPrintf(codec->diag, "aom_codec_encode()", &codec->internal->encoder);
 1311|      0|        return AVIF_RESULT_UNKNOWN_ERROR;
 1312|      0|    }
 1313|       |
 1314|  73.6k|    aom_codec_iter_t iter = NULL;
 1315|   147k|    for (;;) {
 1316|   147k|        const aom_codec_cx_pkt_t * pkt = aom_codec_get_cx_data(&codec->internal->encoder, &iter);
 1317|   147k|        if (pkt == NULL) {
  ------------------
  |  Branch (1317:13): [True: 73.6k, False: 73.6k]
  ------------------
 1318|  73.6k|            break;
 1319|  73.6k|        }
 1320|  73.6k|        if (pkt->kind == AOM_CODEC_CX_FRAME_PKT) {
  ------------------
  |  Branch (1320:13): [True: 73.6k, False: 0]
  ------------------
 1321|  73.6k|            AVIF_CHECKRES(
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 1322|  73.6k|                avifCodecEncodeOutputAddSample(output, pkt->data.frame.buf, pkt->data.frame.sz, (pkt->data.frame.flags & AOM_FRAME_IS_KEY)));
 1323|  73.6k|        }
 1324|  73.6k|    }
 1325|       |
 1326|  73.6k|    if ((addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) ||
  ------------------
  |  Branch (1326:9): [True: 0, False: 73.6k]
  ------------------
 1327|  73.6k|        ((encoder->extraLayerCount > 0) && (encoder->extraLayerCount == codec->internal->currentLayer))) {
  ------------------
  |  Branch (1327:10): [True: 73.6k, False: 0]
  |  Branch (1327:44): [True: 18.4k, False: 55.2k]
  ------------------
 1328|       |        // Flush and clean up encoder resources early to save on overhead when encoding alpha or grid images,
 1329|       |        // as encoding is finished now. For layered image, encoding finishes when the last layer is encoded.
 1330|       |
 1331|  18.4k|        if (!aomCodecEncodeFinish(codec, output)) {
  ------------------
  |  Branch (1331:13): [True: 0, False: 18.4k]
  ------------------
 1332|      0|            return AVIF_RESULT_UNKNOWN_ERROR;
 1333|      0|        }
 1334|  18.4k|        aom_codec_destroy(&codec->internal->encoder);
 1335|  18.4k|        codec->internal->encoderInitialized = AVIF_FALSE;
  ------------------
  |  |   89|  18.4k|#define AVIF_FALSE 0
  ------------------
 1336|  18.4k|    }
 1337|  73.6k|    if (encoder->extraLayerCount > 0) {
  ------------------
  |  Branch (1337:9): [True: 73.6k, False: 0]
  ------------------
 1338|  73.6k|        ++codec->internal->currentLayer;
 1339|  73.6k|    }
 1340|  73.6k|    return AVIF_RESULT_OK;
 1341|  73.6k|}
codec_aom.c:avifAOMOptionsContainExplicitTuning:
  402|  73.6k|{
  403|  73.6k|    *useTuneIq = AVIF_FALSE;
  ------------------
  |  |   89|  73.6k|#define AVIF_FALSE 0
  ------------------
  404|  73.6k|    avifBool isAnyTuneDefined = AVIF_FALSE;
  ------------------
  |  |   89|  73.6k|#define AVIF_FALSE 0
  ------------------
  405|       |
  406|       |    // If there are multiple "tune" options specified, honor the last one.
  407|       |    // For consistent behavior, handle both cases where tune was either specified as a string (e.g. tune=iq),
  408|       |    // or as an enum value (e.g. tune=10).
  409|  73.6k|    for (uint32_t i = 0; i < codec->csOptions->count; ++i) {
  ------------------
  |  Branch (409:26): [True: 0, False: 73.6k]
  ------------------
  410|      0|        const avifCodecSpecificOption * entry = &codec->csOptions->entries[i];
  411|      0|        if (avifKeyEqualsName(entry->key, "tune", alpha)) {
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            isAnyTuneDefined = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  413|       |
  414|      0|            int val;
  415|      0|            if (aomOptionParseEnum(entry->value, tuneIqEnum, &val)) {
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                assert(val == AOM_TUNE_IQ);
  417|      0|                *useTuneIq = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  418|      0|            } else {
  419|      0|                *useTuneIq = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  420|      0|            }
  421|      0|        }
  422|      0|    }
  423|  73.6k|    return isAnyTuneDefined;
  424|  73.6k|}
codec_aom.c:aomQualityToQuantizer:
  644|  73.6k|{
  645|  73.6k|    int quantizer;
  646|       |
  647|  73.6k|    if (isTuneIq) {
  ------------------
  |  Branch (647:9): [True: 52.3k, False: 21.2k]
  ------------------
  648|  52.3k|        quantizer = tuneIqQualityToQuantizer[quality];
  649|  52.3k|    } else {
  650|  21.2k|        quantizer = ((100 - quality) * 63 + 50) / 100;
  651|  21.2k|    }
  652|       |
  653|  73.6k|    return quantizer;
  654|  73.6k|}
codec_aom.c:avifImageCalcAOMFmt:
  280|  18.4k|{
  281|  18.4k|    aom_img_fmt_t fmt;
  282|  18.4k|    if (alpha) {
  ------------------
  |  Branch (282:9): [True: 4.61k, False: 13.7k]
  ------------------
  283|       |        // We're going monochrome, who cares about chroma quality
  284|  4.61k|        fmt = AOM_IMG_FMT_I420;
  285|  13.7k|    } else {
  286|  13.7k|        switch (image->yuvFormat) {
  287|  1.55k|            case AVIF_PIXEL_FORMAT_YUV444:
  ------------------
  |  Branch (287:13): [True: 1.55k, False: 12.2k]
  ------------------
  288|  1.55k|                fmt = AOM_IMG_FMT_I444;
  289|  1.55k|                break;
  290|  1.85k|            case AVIF_PIXEL_FORMAT_YUV422:
  ------------------
  |  Branch (290:13): [True: 1.85k, False: 11.9k]
  ------------------
  291|  1.85k|                fmt = AOM_IMG_FMT_I422;
  292|  1.85k|                break;
  293|  3.59k|            case AVIF_PIXEL_FORMAT_YUV420:
  ------------------
  |  Branch (293:13): [True: 3.59k, False: 10.1k]
  ------------------
  294|  10.3k|            case AVIF_PIXEL_FORMAT_YUV400:
  ------------------
  |  Branch (294:13): [True: 6.79k, False: 6.99k]
  ------------------
  295|  10.3k|                fmt = AOM_IMG_FMT_I420;
  296|  10.3k|                break;
  297|      0|            case AVIF_PIXEL_FORMAT_NONE:
  ------------------
  |  Branch (297:13): [True: 0, False: 13.7k]
  ------------------
  298|      0|            case AVIF_PIXEL_FORMAT_COUNT:
  ------------------
  |  Branch (298:13): [True: 0, False: 13.7k]
  ------------------
  299|      0|            default:
  ------------------
  |  Branch (299:13): [True: 0, False: 13.7k]
  ------------------
  300|      0|                return AOM_IMG_FMT_NONE;
  301|  13.7k|        }
  302|  13.7k|    }
  303|       |
  304|  18.4k|    if (image->depth > 8) {
  ------------------
  |  Branch (304:9): [True: 5.12k, False: 13.2k]
  ------------------
  305|  5.12k|        fmt |= AOM_IMG_FMT_HIGHBITDEPTH;
  306|  5.12k|    }
  307|       |
  308|  18.4k|    return fmt;
  309|  18.4k|}
codec_aom.c:avifProcessAOMOptionsPreInit:
  427|  18.4k|{
  428|  18.4k|    for (uint32_t i = 0; i < codec->csOptions->count; ++i) {
  ------------------
  |  Branch (428:26): [True: 0, False: 18.4k]
  ------------------
  429|      0|        const avifCodecSpecificOption * entry = &codec->csOptions->entries[i];
  430|      0|        int val;
  431|      0|        if (avifKeyEqualsName(entry->key, "end-usage", alpha)) { // Rate control mode
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            if (!aomOptionParseEnum(entry->value, endUsageEnum, &val)) {
  ------------------
  |  Branch (432:17): [True: 0, False: 0]
  ------------------
  433|      0|                avifDiagnosticsPrintf(codec->diag, "Invalid value for end-usage: %s", entry->value);
  434|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  435|      0|            }
  436|      0|            cfg->rc_end_usage = val;
  437|      0|        }
  438|      0|    }
  439|  18.4k|    return AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
  440|  18.4k|}
codec_aom.c:avifProcessAOMOptionsPostInit:
  489|  18.4k|{
  490|  18.4k|    for (uint32_t i = 0; i < codec->csOptions->count; ++i) {
  ------------------
  |  Branch (490:26): [True: 0, False: 18.4k]
  ------------------
  491|      0|        const avifCodecSpecificOption * entry = &codec->csOptions->entries[i];
  492|       |        // Skip options for the other kind of plane.
  493|      0|        const char * otherPrefix = alpha ? "color:" : "alpha:";
  ------------------
  |  Branch (493:36): [True: 0, False: 0]
  ------------------
  494|      0|        size_t otherPrefixLen = 6;
  495|      0|        const char * otherShortPrefix = alpha ? "c:" : "a:";
  ------------------
  |  Branch (495:41): [True: 0, False: 0]
  ------------------
  496|      0|        size_t otherShortPrefixLen = 2;
  497|      0|        if (!strncmp(entry->key, otherPrefix, otherPrefixLen) || !strncmp(entry->key, otherShortPrefix, otherShortPrefixLen)) {
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  |  Branch (497:66): [True: 0, False: 0]
  ------------------
  498|      0|            continue;
  499|      0|        }
  500|       |
  501|       |        // Skip options processed by avifProcessAOMOptionsPreInit.
  502|      0|        if (avifKeyEqualsName(entry->key, "end-usage", alpha)) {
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      0|            continue;
  504|      0|        }
  505|       |
  506|      0|#if defined(HAVE_AOM_CODEC_SET_OPTION)
  507|      0|        const char * prefix = alpha ? "alpha:" : "color:";
  ------------------
  |  Branch (507:31): [True: 0, False: 0]
  ------------------
  508|      0|        size_t prefixLen = 6;
  509|      0|        const char * shortPrefix = alpha ? "a:" : "c:";
  ------------------
  |  Branch (509:36): [True: 0, False: 0]
  ------------------
  510|      0|        size_t shortPrefixLen = 2;
  511|      0|        const char * key = entry->key;
  512|      0|        if (!strncmp(key, prefix, prefixLen)) {
  ------------------
  |  Branch (512:13): [True: 0, False: 0]
  ------------------
  513|      0|            key += prefixLen;
  514|      0|        } else if (!strncmp(key, shortPrefix, shortPrefixLen)) {
  ------------------
  |  Branch (514:20): [True: 0, False: 0]
  ------------------
  515|      0|            key += shortPrefixLen;
  516|      0|        }
  517|      0|        if (aom_codec_set_option(&codec->internal->encoder, key, entry->value) != AOM_CODEC_OK) {
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            const char * error_detail = aom_codec_error_detail(&codec->internal->encoder);
  519|      0|            avifDiagnosticsPrintf(codec->diag,
  520|      0|                                  "aom_codec_set_option(\"%s\", \"%s\") failed: %s: %s",
  521|      0|                                  key,
  522|      0|                                  entry->value,
  523|      0|                                  aom_codec_error(&codec->internal->encoder),
  524|      0|                                  error_detail ? error_detail : "no error detail");
  ------------------
  |  Branch (524:35): [True: 0, False: 0]
  ------------------
  525|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  526|      0|        }
  527|       |#else  // !defined(HAVE_AOM_CODEC_SET_OPTION)
  528|       |        avifBool match = AVIF_FALSE;
  529|       |        for (int j = 0; aomOptionDefs[j].name; ++j) {
  530|       |            if (avifKeyEqualsName(entry->key, aomOptionDefs[j].name, alpha)) {
  531|       |                match = AVIF_TRUE;
  532|       |                avifBool success = AVIF_FALSE;
  533|       |                int valInt;
  534|       |                unsigned int valUInt;
  535|       |                switch (aomOptionDefs[j].type) {
  536|       |                    case AVIF_AOM_OPTION_NUL:
  537|       |                        success = AVIF_FALSE;
  538|       |                        break;
  539|       |                    case AVIF_AOM_OPTION_STR:
  540|       |                        success = aom_codec_control(&codec->internal->encoder, aomOptionDefs[j].controlId, entry->value) == AOM_CODEC_OK;
  541|       |                        break;
  542|       |                    case AVIF_AOM_OPTION_INT:
  543|       |                        success = aomOptionParseInt(entry->value, &valInt) &&
  544|       |                                  aom_codec_control(&codec->internal->encoder, aomOptionDefs[j].controlId, valInt) == AOM_CODEC_OK;
  545|       |                        break;
  546|       |                    case AVIF_AOM_OPTION_UINT:
  547|       |                        success = aomOptionParseUInt(entry->value, &valUInt) &&
  548|       |                                  aom_codec_control(&codec->internal->encoder, aomOptionDefs[j].controlId, valUInt) == AOM_CODEC_OK;
  549|       |                        break;
  550|       |                    case AVIF_AOM_OPTION_ENUM:
  551|       |                        success = aomOptionParseEnum(entry->value, aomOptionDefs[j].enums, &valInt) &&
  552|       |                                  aom_codec_control(&codec->internal->encoder, aomOptionDefs[j].controlId, valInt) == AOM_CODEC_OK;
  553|       |                        break;
  554|       |                }
  555|       |                if (!success) {
  556|       |                    return AVIF_FALSE;
  557|       |                }
  558|       |                break;
  559|       |            }
  560|       |        }
  561|       |        if (!match) {
  562|       |            return AVIF_FALSE;
  563|       |        }
  564|       |#endif // defined(HAVE_AOM_CODEC_SET_OPTION)
  565|      0|    }
  566|  18.4k|    return AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
  567|  18.4k|}
codec_aom.c:avifFindAOMScalingMode:
  583|   147k|{
  584|   147k|    avifFraction simplifiedFraction = *avifMode;
  585|   147k|    avifFractionSimplify(&simplifiedFraction);
  586|   572k|    for (int i = 0; i < scalingModeMapSize; ++i) {
  ------------------
  |  Branch (586:21): [True: 572k, False: 0]
  ------------------
  587|   572k|        if (scalingModeMap[i].avifMode.n == simplifiedFraction.n && scalingModeMap[i].avifMode.d == simplifiedFraction.d) {
  ------------------
  |  Branch (587:13): [True: 250k, False: 322k]
  |  Branch (587:69): [True: 147k, False: 102k]
  ------------------
  588|   147k|            *aomMode = scalingModeMap[i].aomMode;
  589|   147k|            return AVIF_TRUE;
  ------------------
  |  |   88|   147k|#define AVIF_TRUE 1
  ------------------
  590|   147k|        }
  591|   572k|    }
  592|       |
  593|      0|    return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  594|   147k|}
codec_aom.c:aomCodecEncodeFinish:
 1344|  36.8k|{
 1345|  36.8k|    if (!codec->internal->encoderInitialized) {
  ------------------
  |  Branch (1345:9): [True: 18.4k, False: 18.4k]
  ------------------
 1346|  18.4k|        return AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 1347|  18.4k|    }
 1348|  18.4k|    for (;;) {
 1349|       |        // flush encoder
 1350|  18.4k|        if (aom_codec_encode(&codec->internal->encoder, NULL, 0, 1, 0) != AOM_CODEC_OK) {
  ------------------
  |  Branch (1350:13): [True: 0, False: 18.4k]
  ------------------
 1351|      0|            aomDiagPrintf(codec->diag, "aom_codec_encode() with img=NULL", &codec->internal->encoder);
 1352|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 1353|      0|        }
 1354|       |
 1355|  18.4k|        avifBool gotPacket = AVIF_FALSE;
  ------------------
  |  |   89|  18.4k|#define AVIF_FALSE 0
  ------------------
 1356|  18.4k|        aom_codec_iter_t iter = NULL;
 1357|  18.4k|        for (;;) {
 1358|  18.4k|            const aom_codec_cx_pkt_t * pkt = aom_codec_get_cx_data(&codec->internal->encoder, &iter);
 1359|  18.4k|            if (pkt == NULL) {
  ------------------
  |  Branch (1359:17): [True: 18.4k, False: 0]
  ------------------
 1360|  18.4k|                break;
 1361|  18.4k|            }
 1362|      0|            if (pkt->kind == AOM_CODEC_CX_FRAME_PKT) {
  ------------------
  |  Branch (1362:17): [True: 0, False: 0]
  ------------------
 1363|      0|                gotPacket = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1364|      0|                const avifResult result = avifCodecEncodeOutputAddSample(output,
 1365|      0|                                                                         pkt->data.frame.buf,
 1366|      0|                                                                         pkt->data.frame.sz,
 1367|      0|                                                                         (pkt->data.frame.flags & AOM_FRAME_IS_KEY));
 1368|      0|                if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (1368:21): [True: 0, False: 0]
  ------------------
 1369|      0|                    avifDiagnosticsPrintf(codec->diag, "avifCodecEncodeOutputAddSample() failed: %s", avifResultToString(result));
 1370|      0|                    return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 1371|      0|                }
 1372|      0|            }
 1373|      0|        }
 1374|       |
 1375|  18.4k|        if (!gotPacket) {
  ------------------
  |  Branch (1375:13): [True: 18.4k, False: 0]
  ------------------
 1376|  18.4k|            break;
 1377|  18.4k|        }
 1378|  18.4k|    }
 1379|  18.4k|    return AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 1380|  18.4k|}
codec_aom.c:aomCodecDestroyInternal:
   77|  25.4k|{
   78|  25.4k|#if defined(AVIF_CODEC_AOM_DECODE)
   79|  25.4k|    if (codec->internal->decoderInitialized) {
  ------------------
  |  Branch (79:9): [True: 7.01k, False: 18.4k]
  ------------------
   80|  7.01k|        aom_codec_destroy(&codec->internal->decoder);
   81|  7.01k|    }
   82|  25.4k|#endif
   83|       |
   84|  25.4k|#if defined(AVIF_CODEC_AOM_ENCODE)
   85|  25.4k|    if (codec->internal->encoderInitialized) {
  ------------------
  |  Branch (85:9): [True: 0, False: 25.4k]
  ------------------
   86|      0|        aom_codec_destroy(&codec->internal->encoder);
   87|      0|    }
   88|  25.4k|#endif
   89|       |
   90|  25.4k|    avifFree(codec->internal);
   91|  25.4k|}

avifCodecCreateDav1d:
  234|  11.3k|{
  235|  11.3k|    avifCodec * codec = (avifCodec *)avifCalloc(1, sizeof(avifCodec));
  236|  11.3k|    if (codec == NULL) {
  ------------------
  |  Branch (236:9): [True: 0, False: 11.3k]
  ------------------
  237|      0|        return NULL;
  238|      0|    }
  239|  11.3k|    codec->getNextImage = dav1dCodecGetNextImage;
  240|  11.3k|    codec->destroyInternal = dav1dCodecDestroyInternal;
  241|       |
  242|  11.3k|    codec->internal = (struct avifCodecInternal *)avifCalloc(1, sizeof(struct avifCodecInternal));
  243|  11.3k|    if (codec->internal == NULL) {
  ------------------
  |  Branch (243:9): [True: 0, False: 11.3k]
  ------------------
  244|      0|        avifFree(codec);
  245|      0|        return NULL;
  246|      0|    }
  247|  11.3k|    return codec;
  248|  11.3k|}
codec_dav1d.c:dav1dCodecGetNextImage:
   63|  29.0k|{
   64|  29.0k|    if (codec->internal->dav1dContext == NULL) {
  ------------------
  |  Branch (64:9): [True: 11.3k, False: 17.6k]
  ------------------
   65|  11.3k|        Dav1dSettings dav1dSettings;
   66|  11.3k|        dav1d_default_settings(&dav1dSettings);
   67|       |        // Give all available threads to decode a single frame as fast as possible
   68|  11.3k|#if DAV1D_API_VERSION_MAJOR >= 6
   69|  11.3k|        dav1dSettings.max_frame_delay = 1;
   70|  11.3k|        dav1dSettings.n_threads = AVIF_CLAMP(codec->maxThreads, 1, DAV1D_MAX_THREADS);
  ------------------
  |  |   18|  11.3k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 300, False: 11.0k]
  |  |  |  Branch (18:60): [True: 0, False: 11.0k]
  |  |  ------------------
  ------------------
   71|       |#else
   72|       |        dav1dSettings.n_frame_threads = 1;
   73|       |        dav1dSettings.n_tile_threads = AVIF_CLAMP(codec->maxThreads, 1, DAV1D_MAX_TILE_THREADS);
   74|       |#endif // DAV1D_API_VERSION_MAJOR >= 6
   75|       |        // Set a maximum frame size limit to avoid OOM'ing fuzzers. In 32-bit builds, if
   76|       |        // frame_size_limit > 8192 * 8192, dav1d reduces frame_size_limit to 8192 * 8192 and logs
   77|       |        // a message, so we set frame_size_limit to at most 8192 * 8192 to avoid the dav1d_log
   78|       |        // message.
   79|  11.3k|        dav1dSettings.frame_size_limit = (sizeof(size_t) < 8) ? AVIF_MIN(codec->imageSizeLimit, 8192 * 8192) : codec->imageSizeLimit;
  ------------------
  |  |   19|      0|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:42): [Folded, False: 11.3k]
  ------------------
   80|  11.3k|        dav1dSettings.logger.cookie = codec;
   81|  11.3k|        dav1dSettings.logger.callback = avifDav1dLogCallback;
   82|  11.3k|        dav1dSettings.operating_point = codec->operatingPoint;
   83|  11.3k|        dav1dSettings.all_layers = codec->allLayers;
   84|       |
   85|  11.3k|        if (dav1d_open(&codec->internal->dav1dContext, &dav1dSettings) != 0) {
  ------------------
  |  Branch (85:13): [True: 0, False: 11.3k]
  ------------------
   86|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
   87|      0|        }
   88|  11.3k|    }
   89|       |
   90|  29.0k|    avifBool gotPicture = AVIF_FALSE;
  ------------------
  |  |   89|  29.0k|#define AVIF_FALSE 0
  ------------------
   91|  29.0k|    Dav1dPicture nextFrame;
   92|  29.0k|    memset(&nextFrame, 0, sizeof(Dav1dPicture));
   93|       |
   94|  29.0k|    Dav1dData dav1dData;
   95|  29.0k|    if (dav1d_data_wrap(&dav1dData, sample->data.data, sample->data.size, avifDav1dFreeCallback, NULL) != 0) {
  ------------------
  |  Branch (95:9): [True: 0, False: 29.0k]
  ------------------
   96|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
   97|      0|    }
   98|       |
   99|  29.0k|    int res;
  100|  29.0k|    for (;;) {
  101|  29.0k|        if (dav1dData.data) {
  ------------------
  |  Branch (101:13): [True: 29.0k, False: 0]
  ------------------
  102|  29.0k|            res = dav1d_send_data(codec->internal->dav1dContext, &dav1dData);
  103|  29.0k|            if ((res < 0) && (res != DAV1D_ERR(EAGAIN))) {
  ------------------
  |  Branch (103:17): [True: 0, False: 29.0k]
  |  Branch (103:30): [True: 0, False: 0]
  ------------------
  104|      0|                dav1d_data_unref(&dav1dData);
  105|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  106|      0|            }
  107|  29.0k|        }
  108|       |
  109|  29.0k|        res = dav1d_get_picture(codec->internal->dav1dContext, &nextFrame);
  110|  29.0k|        if (res == DAV1D_ERR(EAGAIN)) {
  ------------------
  |  Branch (110:13): [True: 0, False: 29.0k]
  ------------------
  111|      0|            if (dav1dData.data) {
  ------------------
  |  Branch (111:17): [True: 0, False: 0]
  ------------------
  112|       |                // send more data
  113|      0|                continue;
  114|      0|            }
  115|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  116|  29.0k|        } else if (res < 0) {
  ------------------
  |  Branch (116:20): [True: 0, False: 29.0k]
  ------------------
  117|       |            // No more frames
  118|      0|            if (dav1dData.data) {
  ------------------
  |  Branch (118:17): [True: 0, False: 0]
  ------------------
  119|      0|                dav1d_data_unref(&dav1dData);
  120|      0|            }
  121|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  122|  29.0k|        } else {
  123|       |            // Got a picture!
  124|  29.0k|            if ((sample->spatialID != AVIF_SPATIAL_ID_UNSET) && (sample->spatialID != nextFrame.frame_hdr->spatial_id)) {
  ------------------
  |  |  468|  29.0k|#define AVIF_SPATIAL_ID_UNSET 0xff
  ------------------
  |  Branch (124:17): [True: 0, False: 29.0k]
  |  Branch (124:65): [True: 0, False: 0]
  ------------------
  125|       |                // Layer selection: skip this unwanted layer
  126|      0|                dav1d_picture_unref(&nextFrame);
  127|  29.0k|            } else {
  128|  29.0k|                gotPicture = AVIF_TRUE;
  ------------------
  |  |   88|  29.0k|#define AVIF_TRUE 1
  ------------------
  129|  29.0k|                break;
  130|  29.0k|            }
  131|  29.0k|        }
  132|  29.0k|    }
  133|  29.0k|    if (dav1dData.data) {
  ------------------
  |  Branch (133:9): [True: 0, False: 29.0k]
  ------------------
  134|      0|        dav1d_data_unref(&dav1dData);
  135|      0|    }
  136|       |
  137|       |    // Drain all buffered frames in the decoder.
  138|       |    //
  139|       |    // The sample should have only one frame of the desired layer. If there are more frames after
  140|       |    // that frame, we need to discard them so that they won't be mistakenly output when the decoder
  141|       |    // is used to decode another sample.
  142|  29.0k|    Dav1dPicture bufferedFrame;
  143|  29.0k|    memset(&bufferedFrame, 0, sizeof(Dav1dPicture));
  144|  29.0k|    do {
  145|  29.0k|        res = dav1d_get_picture(codec->internal->dav1dContext, &bufferedFrame);
  146|  29.0k|        if (res < 0) {
  ------------------
  |  Branch (146:13): [True: 29.0k, False: 0]
  ------------------
  147|  29.0k|            if (res != DAV1D_ERR(EAGAIN)) {
  ------------------
  |  Branch (147:17): [True: 0, False: 29.0k]
  ------------------
  148|      0|                if (gotPicture) {
  ------------------
  |  Branch (148:21): [True: 0, False: 0]
  ------------------
  149|      0|                    dav1d_picture_unref(&nextFrame);
  150|      0|                }
  151|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  152|      0|            }
  153|  29.0k|        } else {
  154|      0|            dav1d_picture_unref(&bufferedFrame);
  155|      0|        }
  156|  29.0k|    } while (res == 0);
  ------------------
  |  Branch (156:14): [True: 0, False: 29.0k]
  ------------------
  157|       |
  158|  29.0k|    if (gotPicture) {
  ------------------
  |  Branch (158:9): [True: 29.0k, False: 0]
  ------------------
  159|  29.0k|        dav1d_picture_unref(&codec->internal->dav1dPicture);
  160|  29.0k|        codec->internal->dav1dPicture = nextFrame;
  161|  29.0k|        codec->internal->colorRange = codec->internal->dav1dPicture.seq_hdr->color_range ? AVIF_RANGE_FULL : AVIF_RANGE_LIMITED;
  ------------------
  |  Branch (161:39): [True: 29.0k, False: 0]
  ------------------
  162|  29.0k|        codec->internal->hasPicture = AVIF_TRUE;
  ------------------
  |  |   88|  29.0k|#define AVIF_TRUE 1
  ------------------
  163|  29.0k|    } else {
  164|      0|        if (alpha && codec->internal->hasPicture) {
  ------------------
  |  Branch (164:13): [True: 0, False: 0]
  |  Branch (164:22): [True: 0, False: 0]
  ------------------
  165|       |            // Special case: reuse last alpha frame
  166|      0|        } else {
  167|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  168|      0|        }
  169|      0|    }
  170|       |
  171|  29.0k|    Dav1dPicture * dav1dImage = &codec->internal->dav1dPicture;
  172|  29.0k|    avifBool isColor = !alpha;
  173|  29.0k|    if (isColor) {
  ------------------
  |  Branch (173:9): [True: 21.7k, False: 7.33k]
  ------------------
  174|       |        // Color (YUV) planes - set image to correct size / format, fill color
  175|       |
  176|  21.7k|        avifPixelFormat yuvFormat = AVIF_PIXEL_FORMAT_NONE;
  177|  21.7k|        switch (dav1dImage->p.layout) {
  ------------------
  |  Branch (177:17): [True: 21.7k, False: 0]
  ------------------
  178|  10.6k|            case DAV1D_PIXEL_LAYOUT_I400:
  ------------------
  |  Branch (178:13): [True: 10.6k, False: 11.0k]
  ------------------
  179|  10.6k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
  180|  10.6k|                break;
  181|  5.62k|            case DAV1D_PIXEL_LAYOUT_I420:
  ------------------
  |  Branch (181:13): [True: 5.62k, False: 16.0k]
  ------------------
  182|  5.62k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV420;
  183|  5.62k|                break;
  184|  3.00k|            case DAV1D_PIXEL_LAYOUT_I422:
  ------------------
  |  Branch (184:13): [True: 3.00k, False: 18.7k]
  ------------------
  185|  3.00k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV422;
  186|  3.00k|                break;
  187|  2.38k|            case DAV1D_PIXEL_LAYOUT_I444:
  ------------------
  |  Branch (187:13): [True: 2.38k, False: 19.3k]
  ------------------
  188|  2.38k|                yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
  189|  2.38k|                break;
  190|  21.7k|        }
  191|       |
  192|  21.7k|        image->width = dav1dImage->p.w;
  193|  21.7k|        image->height = dav1dImage->p.h;
  194|  21.7k|        image->depth = dav1dImage->p.bpc;
  195|       |
  196|  21.7k|        image->yuvFormat = yuvFormat;
  197|  21.7k|        image->yuvRange = codec->internal->colorRange;
  198|  21.7k|        image->yuvChromaSamplePosition = (avifChromaSamplePosition)dav1dImage->seq_hdr->chr;
  199|       |
  200|  21.7k|        image->colorPrimaries = (avifColorPrimaries)dav1dImage->seq_hdr->pri;
  201|  21.7k|        image->transferCharacteristics = (avifTransferCharacteristics)dav1dImage->seq_hdr->trc;
  202|  21.7k|        image->matrixCoefficients = (avifMatrixCoefficients)dav1dImage->seq_hdr->mtrx;
  203|       |
  204|       |        // Steal the pointers from the decoder's image directly
  205|  21.7k|        avifImageFreePlanes(image, AVIF_PLANES_YUV);
  206|  21.7k|        int yuvPlaneCount = (yuvFormat == AVIF_PIXEL_FORMAT_YUV400) ? 1 : 3;
  ------------------
  |  Branch (206:29): [True: 10.6k, False: 11.0k]
  ------------------
  207|  65.4k|        for (int yuvPlane = 0; yuvPlane < yuvPlaneCount; ++yuvPlane) {
  ------------------
  |  Branch (207:32): [True: 43.7k, False: 21.7k]
  ------------------
  208|  43.7k|            image->yuvPlanes[yuvPlane] = dav1dImage->data[yuvPlane];
  209|  43.7k|            image->yuvRowBytes[yuvPlane] = (uint32_t)dav1dImage->stride[(yuvPlane == AVIF_CHAN_Y) ? 0 : 1];
  ------------------
  |  Branch (209:73): [True: 21.7k, False: 22.0k]
  ------------------
  210|  43.7k|        }
  211|  21.7k|        image->imageOwnsYUVPlanes = AVIF_FALSE;
  ------------------
  |  |   89|  21.7k|#define AVIF_FALSE 0
  ------------------
  212|  21.7k|    } else {
  213|       |        // Alpha plane - set image to correct size, fill alpha
  214|       |
  215|  7.33k|        image->width = dav1dImage->p.w;
  216|  7.33k|        image->height = dav1dImage->p.h;
  217|  7.33k|        image->depth = dav1dImage->p.bpc;
  218|       |
  219|  7.33k|        avifImageFreePlanes(image, AVIF_PLANES_A);
  220|  7.33k|        image->alphaPlane = dav1dImage->data[0];
  221|  7.33k|        image->alphaRowBytes = (uint32_t)dav1dImage->stride[0];
  222|  7.33k|        *isLimitedRangeAlpha = (codec->internal->colorRange == AVIF_RANGE_LIMITED);
  223|  7.33k|        image->imageOwnsAlphaPlane = AVIF_FALSE;
  ------------------
  |  |   89|  7.33k|#define AVIF_FALSE 0
  ------------------
  224|  7.33k|    }
  225|  29.0k|    return AVIF_TRUE;
  ------------------
  |  |   88|  29.0k|#define AVIF_TRUE 1
  ------------------
  226|  29.0k|}
codec_dav1d.c:avifDav1dFreeCallback:
   35|  29.0k|{
   36|       |    // This data is owned by the decoder; nothing to free here
   37|  29.0k|    (void)buf;
   38|  29.0k|    (void)cookie;
   39|  29.0k|}
codec_dav1d.c:dav1dCodecDestroyInternal:
   48|  11.3k|{
   49|  11.3k|    if (codec->internal->hasPicture) {
  ------------------
  |  Branch (49:9): [True: 11.3k, False: 0]
  ------------------
   50|  11.3k|        dav1d_picture_unref(&codec->internal->dav1dPicture);
   51|  11.3k|    }
   52|  11.3k|    if (codec->internal->dav1dContext) {
  ------------------
  |  Branch (52:9): [True: 11.3k, False: 0]
  ------------------
   53|  11.3k|        dav1d_close(&codec->internal->dav1dContext);
   54|  11.3k|    }
   55|  11.3k|    avifFree(codec->internal);
   56|  11.3k|}

avifDiagnosticsClearError:
   11|   172k|{
   12|   172k|    *diag->error = '\0';
   13|   172k|}

avifIODestroy:
   85|  27.5k|{
   86|  27.5k|    if (io && io->destroy) {
  ------------------
  |  Branch (86:9): [True: 13.7k, False: 13.7k]
  |  Branch (86:15): [True: 13.7k, False: 0]
  ------------------
   87|  13.7k|        io->destroy(io);
   88|  13.7k|    }
   89|  27.5k|}
avifIOCreateMemoryReader:
  134|  13.7k|{
  135|  13.7k|    avifIOMemoryReader * reader = (avifIOMemoryReader *)avifCalloc(1, sizeof(avifIOMemoryReader));
  136|  13.7k|    if (reader == NULL) {
  ------------------
  |  Branch (136:9): [True: 0, False: 13.7k]
  ------------------
  137|      0|        return NULL;
  138|      0|    }
  139|  13.7k|    reader->io.destroy = avifIOMemoryReaderDestroy;
  140|  13.7k|    reader->io.read = avifIOMemoryReaderRead;
  141|  13.7k|    reader->io.sizeHint = size;
  142|  13.7k|    reader->io.persistent = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
  143|  13.7k|    reader->rodata.data = data;
  144|  13.7k|    reader->rodata.size = size;
  145|  13.7k|    return (avifIO *)reader;
  146|  13.7k|}
io.c:avifIOMemoryReaderDestroy:
  129|  13.7k|{
  130|  13.7k|    avifFree(io);
  131|  13.7k|}
io.c:avifIOMemoryReaderRead:
  101|   185k|{
  102|       |    // printf("avifIOMemoryReaderRead offset %" PRIu64 " size %zu\n", offset, size);
  103|       |
  104|   185k|    if (readFlags != 0) {
  ------------------
  |  Branch (104:9): [True: 0, False: 185k]
  ------------------
  105|       |        // Unsupported readFlags
  106|      0|        return AVIF_RESULT_IO_ERROR;
  107|      0|    }
  108|       |
  109|   185k|    avifIOMemoryReader * reader = (avifIOMemoryReader *)io;
  110|       |
  111|       |    // Sanitize/clamp incoming request
  112|   185k|    if (offset > reader->rodata.size) {
  ------------------
  |  Branch (112:9): [True: 0, False: 185k]
  ------------------
  113|       |        // The offset is past the end of the buffer.
  114|      0|        return AVIF_RESULT_IO_ERROR;
  115|      0|    }
  116|   185k|    uint64_t availableSize = reader->rodata.size - offset;
  117|   185k|    if (size > availableSize) {
  ------------------
  |  Branch (117:9): [True: 0, False: 185k]
  ------------------
  118|      0|        size = (size_t)availableSize;
  119|      0|    }
  120|       |
  121|       |    // Prevent the offset addition from triggering an undefined behavior
  122|       |    // sanitizer error if data is NULL (happens even with offset zero).
  123|   185k|    out->data = offset ? reader->rodata.data + offset : reader->rodata.data;
  ------------------
  |  Branch (123:17): [True: 171k, False: 13.7k]
  ------------------
  124|   185k|    out->size = size;
  125|   185k|    return AVIF_RESULT_OK;
  126|   185k|}

avifAlloc:
    9|  1.03M|{
   10|       |    // malloc(0) is implementation-defined (see
   11|       |    // https://en.cppreference.com/w/cpp/memory/c/malloc), so collapse the
   12|       |    // zero-size case to a deterministic NULL return. Callers must either treat
   13|       |    // 0 as an allocation failure or guard against it before calling.
   14|  1.03M|    if (size == 0) {
  ------------------
  |  Branch (14:9): [True: 0, False: 1.03M]
  ------------------
   15|      0|        return NULL;
   16|      0|    }
   17|  1.03M|    return malloc(size);
   18|  1.03M|}
avifCalloc:
   21|  87.4k|{
   22|  87.4k|    return calloc(count, size);
   23|  87.4k|}
avifFree:
   26|  1.86M|{
   27|  1.86M|    free(p);
   28|  1.86M|}

avifSequenceHeaderParse:
  713|  18.4k|{
  714|  18.4k|    switch (codecType) {
  715|  18.4k|        case AVIF_CODEC_TYPE_AV1:
  ------------------
  |  Branch (715:9): [True: 18.4k, False: 0]
  ------------------
  716|  18.4k|            return av1SequenceHeaderParse(header, sample);
  717|       |#if defined(AVIF_CODEC_AVM)
  718|       |        case AVIF_CODEC_TYPE_AV2:
  719|       |            return av2SequenceHeaderParse(header, sample);
  720|       |#endif
  721|      0|        default:
  ------------------
  |  Branch (721:9): [True: 0, False: 18.4k]
  ------------------
  722|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  723|  18.4k|    }
  724|  18.4k|}
obu.c:av1SequenceHeaderParse:
  597|  18.4k|{
  598|  18.4k|    avifROData obus = *sample;
  599|       |
  600|       |    // Find the sequence header OBU
  601|  36.8k|    while (obus.size > 0) {
  ------------------
  |  Branch (601:12): [True: 36.8k, False: 0]
  ------------------
  602|  36.8k|        avifBits bits;
  603|  36.8k|        avifBitsInit(&bits, obus.data, obus.size);
  604|       |
  605|       |        // obu_header()
  606|  36.8k|        const uint32_t obu_forbidden_bit = avifBitsRead(&bits, 1);
  607|  36.8k|        if (obu_forbidden_bit != 0) {
  ------------------
  |  Branch (607:13): [True: 0, False: 36.8k]
  ------------------
  608|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  609|      0|        }
  610|  36.8k|        const uint32_t obu_type = avifBitsRead(&bits, 4);
  611|  36.8k|        const uint32_t obu_extension_flag = avifBitsRead(&bits, 1);
  612|  36.8k|        const uint32_t obu_has_size_field = avifBitsRead(&bits, 1);
  613|  36.8k|        avifBitsRead(&bits, 1); // obu_reserved_1bit
  614|       |
  615|  36.8k|        if (obu_extension_flag) {   // obu_extension_header()
  ------------------
  |  Branch (615:13): [True: 0, False: 36.8k]
  ------------------
  616|      0|            avifBitsRead(&bits, 8); // temporal_id, spatial_id, extension_header_reserved_3bits
  617|      0|        }
  618|       |
  619|  36.8k|        uint32_t obu_size = 0;
  620|  36.8k|        if (obu_has_size_field)
  ------------------
  |  Branch (620:13): [True: 36.8k, False: 0]
  ------------------
  621|  36.8k|            obu_size = avifBitsReadUleb128(&bits);
  622|      0|        else
  623|      0|            obu_size = (int)obus.size - 1 - obu_extension_flag;
  624|       |
  625|  36.8k|        if (bits.error) {
  ------------------
  |  Branch (625:13): [True: 0, False: 36.8k]
  ------------------
  626|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  627|      0|        }
  628|       |
  629|  36.8k|        const uint32_t init_bit_pos = avifBitsReadPos(&bits);
  630|  36.8k|        const uint32_t init_byte_pos = init_bit_pos >> 3;
  631|  36.8k|        if (obu_size > obus.size - init_byte_pos)
  ------------------
  |  Branch (631:13): [True: 0, False: 36.8k]
  ------------------
  632|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  633|       |
  634|  36.8k|        if (obu_type == 1) { // Sequence Header
  ------------------
  |  Branch (634:13): [True: 18.4k, False: 18.4k]
  ------------------
  635|  18.4k|            avifBits seqHdrBits;
  636|  18.4k|            avifBitsInit(&seqHdrBits, obus.data + init_byte_pos, obu_size);
  637|  18.4k|            return parseAV1SequenceHeader(&seqHdrBits, header);
  638|  18.4k|        }
  639|       |
  640|       |        // Skip this OBU
  641|  18.4k|        obus.data += (size_t)obu_size + init_byte_pos;
  642|  18.4k|        obus.size -= (size_t)obu_size + init_byte_pos;
  643|  18.4k|    }
  644|      0|    return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  645|  18.4k|}
obu.c:avifBitsInit:
   63|  55.2k|{
   64|  55.2k|    bits->ptr = bits->start = data;
   65|  55.2k|    bits->end = &bits->start[size];
   66|  55.2k|    bits->bitsLeft = 0;
   67|  55.2k|    bits->state = 0;
   68|  55.2k|    bits->error = 0;
   69|  55.2k|    bits->eof = (size == 0);
   70|  55.2k|}
obu.c:avifBitsRead:
   89|   842k|{
   90|   842k|    if (n > bits->bitsLeft)
  ------------------
  |  Branch (90:9): [True: 309k, False: 533k]
  ------------------
   91|   309k|        avifBitsRefill(bits, n);
   92|       |
   93|   842k|    const uint64_t state = bits->state;
   94|   842k|    bits->bitsLeft -= n;
   95|   842k|    bits->state <<= n;
   96|       |
   97|   842k|    return (uint32_t)(state >> (64 - n));
   98|   842k|}
obu.c:avifBitsRefill:
   73|   309k|{
   74|   309k|    uint64_t state = 0;
   75|   364k|    do {
   76|   364k|        state <<= 8;
   77|   364k|        bits->bitsLeft += 8;
   78|   364k|        if (!bits->eof)
  ------------------
  |  Branch (78:13): [True: 364k, False: 0]
  ------------------
   79|   364k|            state |= *bits->ptr++;
   80|   364k|        if (bits->ptr >= bits->end) {
  ------------------
  |  Branch (80:13): [True: 15.2k, False: 349k]
  ------------------
   81|  15.2k|            bits->error = bits->eof;
   82|  15.2k|            bits->eof = 1;
   83|  15.2k|        }
   84|   364k|    } while (n > bits->bitsLeft);
  ------------------
  |  Branch (84:14): [True: 55.2k, False: 309k]
  ------------------
   85|   309k|    bits->state |= state << (64 - bits->bitsLeft);
   86|   309k|}
obu.c:avifBitsReadUleb128:
  101|  36.8k|{
  102|  36.8k|    uint64_t val = 0;
  103|  36.8k|    uint32_t more;
  104|  36.8k|    uint32_t i = 0;
  105|       |
  106|  36.8k|    do {
  107|  36.8k|        const uint32_t v = avifBitsRead(bits, 8);
  108|  36.8k|        more = v & 0x80;
  109|  36.8k|        val |= ((uint64_t)(v & 0x7F)) << i;
  110|  36.8k|        i += 7;
  111|  36.8k|    } while (more && i < 56);
  ------------------
  |  Branch (111:14): [True: 0, False: 36.8k]
  |  Branch (111:22): [True: 0, False: 0]
  ------------------
  112|       |
  113|  36.8k|    if (val > UINT32_MAX || more) {
  ------------------
  |  Branch (113:9): [True: 0, False: 36.8k]
  |  Branch (113:29): [True: 0, False: 36.8k]
  ------------------
  114|      0|        bits->error = 1;
  115|      0|        return 0;
  116|      0|    }
  117|       |
  118|  36.8k|    return (uint32_t)val;
  119|  36.8k|}
obu.c:avifBitsReadPos:
   58|  36.8k|{
   59|  36.8k|    return (uint32_t)(bits->ptr - bits->start) * 8 - bits->bitsLeft;
   60|  36.8k|}
obu.c:parseAV1SequenceHeader:
  446|  18.4k|{
  447|  18.4k|    AVIF_CHECK(parseAV1SequenceHeaderProfile(bits, header));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  448|  18.4k|    AVIF_CHECK(parseSequenceHeaderLevelIdxAndTier(bits, header));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  449|       |
  450|  18.4k|    AVIF_CHECK(parseSequenceHeaderFrameMaxDimensions(bits, header));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  451|  18.4k|    avifBitsRead(bits, 1); // use_128x128_superblock
  452|  18.4k|    AVIF_CHECK(parseSequenceHeaderEnabledFeatures(bits, header));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  453|       |
  454|  18.4k|    avifBitsRead(bits, 3); // enable_superres, enable_cdef, enable_restoration
  455|       |
  456|  18.4k|    AVIF_CHECK(parseAV1SequenceHeaderColorConfig(bits, header));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  457|  18.4k|    if (!header->av1C.monochrome) {
  ------------------
  |  Branch (457:9): [True: 6.99k, False: 11.4k]
  ------------------
  458|  6.99k|        avifBitsRead(bits, 1); // separate_uv_delta_q
  459|  6.99k|    }
  460|       |
  461|  18.4k|    avifBitsRead(bits, 1); // film_grain_params_present
  462|  18.4k|    return !bits->error;
  463|  18.4k|}
obu.c:parseAV1SequenceHeaderProfile:
  153|  18.4k|{
  154|  18.4k|    uint32_t seq_profile = avifBitsRead(bits, 3);
  155|  18.4k|    if (seq_profile > 2) {
  ------------------
  |  Branch (155:9): [True: 0, False: 18.4k]
  ------------------
  156|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  157|      0|    }
  158|  18.4k|    header->av1C.seqProfile = (uint8_t)seq_profile;
  159|  18.4k|    return !bits->error;
  160|  18.4k|}
obu.c:parseSequenceHeaderLevelIdxAndTier:
  175|  18.4k|{
  176|  18.4k|    uint32_t still_picture = avifBitsRead(bits, 1);
  177|  18.4k|    header->reduced_still_picture_header = (uint8_t)avifBitsRead(bits, 1);
  178|  18.4k|    if (header->reduced_still_picture_header && !still_picture) {
  ------------------
  |  Branch (178:9): [True: 0, False: 18.4k]
  |  Branch (178:49): [True: 0, False: 0]
  ------------------
  179|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  180|      0|    }
  181|       |
  182|  18.4k|    if (header->reduced_still_picture_header) {
  ------------------
  |  Branch (182:9): [True: 0, False: 18.4k]
  ------------------
  183|      0|        header->av1C.seqLevelIdx0 = (uint8_t)avifBitsRead(bits, 5);
  184|      0|        header->av1C.seqTier0 = 0;
  185|  18.4k|    } else {
  186|  18.4k|        uint32_t timing_info_present_flag = avifBitsRead(bits, 1);
  187|  18.4k|        uint32_t decoder_model_info_present_flag = 0;
  188|  18.4k|        uint32_t buffer_delay_length = 0;
  189|  18.4k|        if (timing_info_present_flag) { // timing_info()
  ------------------
  |  Branch (189:13): [True: 0, False: 18.4k]
  ------------------
  190|      0|            avifBitsRead(bits, 32);     // num_units_in_display_tick
  191|      0|            avifBitsRead(bits, 32);     // time_scale
  192|      0|            uint32_t equal_picture_interval = avifBitsRead(bits, 1);
  193|      0|            if (equal_picture_interval) {
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                uint32_t num_ticks_per_picture_minus_1 = avifBitsReadVLC(bits);
  195|      0|                if (num_ticks_per_picture_minus_1 == 0xFFFFFFFFU)
  ------------------
  |  Branch (195:21): [True: 0, False: 0]
  ------------------
  196|      0|                    return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  197|      0|            }
  198|       |
  199|      0|            decoder_model_info_present_flag = avifBitsRead(bits, 1);
  200|      0|            if (decoder_model_info_present_flag) { // decoder_model_info()
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  ------------------
  201|      0|                buffer_delay_length = avifBitsRead(bits, 5) + 1;
  202|      0|                avifBitsRead(bits, 32); // num_units_in_decoding_tick
  203|      0|                avifBitsRead(bits, 10); // buffer_removal_time_length_minus_1, frame_presentation_time_length_minus_1
  204|      0|            }
  205|      0|        }
  206|       |
  207|  18.4k|        uint32_t initial_display_delay_present_flag = avifBitsRead(bits, 1);
  208|  18.4k|        uint32_t operating_points_cnt = avifBitsRead(bits, 5) + 1;
  209|  92.0k|        for (uint32_t i = 0; i < operating_points_cnt; i++) {
  ------------------
  |  Branch (209:30): [True: 73.6k, False: 18.4k]
  ------------------
  210|  73.6k|            avifBitsRead(bits, 12); // operating_point_idc
  211|  73.6k|            uint32_t seq_level_idx = avifBitsRead(bits, 5);
  212|  73.6k|            if (i == 0) {
  ------------------
  |  Branch (212:17): [True: 18.4k, False: 55.2k]
  ------------------
  213|  18.4k|                header->av1C.seqLevelIdx0 = (uint8_t)seq_level_idx;
  214|  18.4k|                header->av1C.seqTier0 = 0;
  215|  18.4k|            }
  216|  73.6k|            if (seq_level_idx > 7) {
  ------------------
  |  Branch (216:17): [True: 0, False: 73.6k]
  ------------------
  217|      0|                uint32_t seq_tier = avifBitsRead(bits, 1);
  218|      0|                if (i == 0) {
  ------------------
  |  Branch (218:21): [True: 0, False: 0]
  ------------------
  219|      0|                    header->av1C.seqTier0 = (uint8_t)seq_tier;
  220|      0|                }
  221|      0|            }
  222|  73.6k|            if (decoder_model_info_present_flag) {
  ------------------
  |  Branch (222:17): [True: 0, False: 73.6k]
  ------------------
  223|      0|                uint32_t decoder_model_present_for_this_op = avifBitsRead(bits, 1);
  224|      0|                if (decoder_model_present_for_this_op) {     // operating_parameters_info()
  ------------------
  |  Branch (224:21): [True: 0, False: 0]
  ------------------
  225|      0|                    avifBitsRead(bits, buffer_delay_length); // decoder_buffer_delay
  226|      0|                    avifBitsRead(bits, buffer_delay_length); // encoder_buffer_delay
  227|      0|                    avifBitsRead(bits, 1);                   // low_delay_mode_flag
  228|      0|                }
  229|      0|            }
  230|  73.6k|            if (initial_display_delay_present_flag) {
  ------------------
  |  Branch (230:17): [True: 0, False: 73.6k]
  ------------------
  231|      0|                uint32_t initial_display_delay_present_for_this_op = avifBitsRead(bits, 1);
  232|      0|                if (initial_display_delay_present_for_this_op) {
  ------------------
  |  Branch (232:21): [True: 0, False: 0]
  ------------------
  233|      0|                    avifBitsRead(bits, 4); // initial_display_delay_minus_1
  234|      0|                }
  235|      0|            }
  236|  73.6k|        }
  237|  18.4k|    }
  238|  18.4k|    return !bits->error;
  239|  18.4k|}
obu.c:parseSequenceHeaderFrameMaxDimensions:
  242|  18.4k|{
  243|  18.4k|    uint32_t frame_width_bits = avifBitsRead(bits, 4) + 1;
  244|  18.4k|    uint32_t frame_height_bits = avifBitsRead(bits, 4) + 1;
  245|  18.4k|    header->maxWidth = avifBitsRead(bits, frame_width_bits) + 1;   // max_frame_width
  246|  18.4k|    header->maxHeight = avifBitsRead(bits, frame_height_bits) + 1; // max_frame_height
  247|  18.4k|    uint32_t frame_id_numbers_present_flag = 0;
  248|  18.4k|    if (!header->reduced_still_picture_header) {
  ------------------
  |  Branch (248:9): [True: 18.4k, False: 0]
  ------------------
  249|  18.4k|        frame_id_numbers_present_flag = avifBitsRead(bits, 1);
  250|  18.4k|    }
  251|  18.4k|    if (frame_id_numbers_present_flag) {
  ------------------
  |  Branch (251:9): [True: 0, False: 18.4k]
  ------------------
  252|      0|        avifBitsRead(bits, 7); // delta_frame_id_length_minus_2, additional_frame_id_length_minus_1
  253|      0|    }
  254|  18.4k|    return !bits->error;
  255|  18.4k|}
obu.c:parseSequenceHeaderEnabledFeatures:
  258|  18.4k|{
  259|  18.4k|    avifBitsRead(bits, 2); // enable_filter_intra, enable_intra_edge_filter
  260|       |
  261|  18.4k|    if (!header->reduced_still_picture_header) {
  ------------------
  |  Branch (261:9): [True: 18.4k, False: 0]
  ------------------
  262|  18.4k|        avifBitsRead(bits, 4); // enable_interintra_compound, enable_masked_compound, enable_warped_motion, enable_dual_filter
  263|  18.4k|        uint32_t enable_order_hint = avifBitsRead(bits, 1);
  264|  18.4k|        if (enable_order_hint) {
  ------------------
  |  Branch (264:13): [True: 18.4k, False: 0]
  ------------------
  265|  18.4k|            avifBitsRead(bits, 2); // enable_jnt_comp, enable_ref_frame_mvs
  266|  18.4k|        }
  267|       |
  268|  18.4k|        uint32_t seq_force_screen_content_tools = 0;
  269|  18.4k|        uint32_t seq_choose_screen_content_tools = avifBitsRead(bits, 1);
  270|  18.4k|        if (seq_choose_screen_content_tools) {
  ------------------
  |  Branch (270:13): [True: 18.4k, False: 0]
  ------------------
  271|  18.4k|            seq_force_screen_content_tools = 2;
  272|  18.4k|        } else {
  273|      0|            seq_force_screen_content_tools = avifBitsRead(bits, 1);
  274|      0|        }
  275|  18.4k|        if (seq_force_screen_content_tools > 0) {
  ------------------
  |  Branch (275:13): [True: 18.4k, False: 0]
  ------------------
  276|  18.4k|            uint32_t seq_choose_integer_mv = avifBitsRead(bits, 1);
  277|  18.4k|            if (!seq_choose_integer_mv) {
  ------------------
  |  Branch (277:17): [True: 0, False: 18.4k]
  ------------------
  278|      0|                avifBitsRead(bits, 1); // seq_force_integer_mv
  279|      0|            }
  280|  18.4k|        }
  281|  18.4k|        if (enable_order_hint) {
  ------------------
  |  Branch (281:13): [True: 18.4k, False: 0]
  ------------------
  282|  18.4k|            avifBitsRead(bits, 3); // order_hint_bits_minus_1
  283|  18.4k|        }
  284|  18.4k|    }
  285|       |
  286|  18.4k|    return !bits->error;
  287|  18.4k|}
obu.c:parseAV1SequenceHeaderColorConfig:
  291|  18.4k|{
  292|  18.4k|    header->bitDepth = 8;
  293|  18.4k|    header->chromaSamplePosition = AVIF_CHROMA_SAMPLE_POSITION_UNKNOWN;
  294|  18.4k|    header->av1C.chromaSamplePosition = (uint8_t)header->chromaSamplePosition;
  295|  18.4k|    uint32_t high_bitdepth = avifBitsRead(bits, 1);
  296|  18.4k|    header->av1C.highBitdepth = (uint8_t)high_bitdepth;
  297|  18.4k|    if ((header->av1C.seqProfile == 2) && high_bitdepth) {
  ------------------
  |  Branch (297:9): [True: 4.26k, False: 14.1k]
  |  Branch (297:43): [True: 3.01k, False: 1.24k]
  ------------------
  298|  3.01k|        uint32_t twelve_bit = avifBitsRead(bits, 1);
  299|  3.01k|        header->bitDepth = twelve_bit ? 12 : 10;
  ------------------
  |  Branch (299:28): [True: 2.66k, False: 346]
  ------------------
  300|  3.01k|        header->av1C.twelveBit = (uint8_t)twelve_bit;
  301|  15.3k|    } else /* if (seq_profile <= 2) */ {
  302|  15.3k|        header->bitDepth = high_bitdepth ? 10 : 8;
  ------------------
  |  Branch (302:28): [True: 2.11k, False: 13.2k]
  ------------------
  303|  15.3k|        header->av1C.twelveBit = 0;
  304|  15.3k|    }
  305|  18.4k|    uint32_t mono_chrome = 0;
  306|  18.4k|    if (header->av1C.seqProfile != 1) {
  ------------------
  |  Branch (306:9): [True: 17.1k, False: 1.28k]
  ------------------
  307|  17.1k|        mono_chrome = avifBitsRead(bits, 1);
  308|  17.1k|    }
  309|  18.4k|    header->av1C.monochrome = (uint8_t)mono_chrome;
  310|  18.4k|    uint32_t color_description_present_flag = avifBitsRead(bits, 1);
  311|  18.4k|    if (color_description_present_flag) {
  ------------------
  |  Branch (311:9): [True: 0, False: 18.4k]
  ------------------
  312|      0|        header->colorPrimaries = (avifColorPrimaries)avifBitsRead(bits, 8);                   // color_primaries
  313|      0|        header->transferCharacteristics = (avifTransferCharacteristics)avifBitsRead(bits, 8); // transfer_characteristics
  314|      0|        header->matrixCoefficients = (avifMatrixCoefficients)avifBitsRead(bits, 8);           // matrix_coefficients
  315|  18.4k|    } else {
  316|  18.4k|        header->colorPrimaries = AVIF_COLOR_PRIMARIES_UNSPECIFIED;
  317|  18.4k|        header->transferCharacteristics = AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED;
  318|  18.4k|        header->matrixCoefficients = AVIF_MATRIX_COEFFICIENTS_UNSPECIFIED;
  319|  18.4k|    }
  320|  18.4k|    if (mono_chrome) {
  ------------------
  |  Branch (320:9): [True: 11.4k, False: 6.99k]
  ------------------
  321|  11.4k|        header->range = avifBitsRead(bits, 1) ? AVIF_RANGE_FULL : AVIF_RANGE_LIMITED; // color_range
  ------------------
  |  Branch (321:25): [True: 11.4k, False: 0]
  ------------------
  322|  11.4k|        header->av1C.chromaSubsamplingX = 1;
  323|  11.4k|        header->av1C.chromaSubsamplingY = 1;
  324|  11.4k|        header->yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
  325|  11.4k|    } else if (header->colorPrimaries == AVIF_COLOR_PRIMARIES_BT709 &&
  ------------------
  |  Branch (325:16): [True: 0, False: 6.99k]
  ------------------
  326|      0|               header->transferCharacteristics == AVIF_TRANSFER_CHARACTERISTICS_SRGB &&
  ------------------
  |  Branch (326:16): [True: 0, False: 0]
  ------------------
  327|      0|               header->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_IDENTITY) {
  ------------------
  |  Branch (327:16): [True: 0, False: 0]
  ------------------
  328|      0|        header->range = AVIF_RANGE_FULL;
  329|      0|        header->av1C.chromaSubsamplingX = 0;
  330|      0|        header->av1C.chromaSubsamplingY = 0;
  331|      0|        header->yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
  332|  6.99k|    } else {
  333|  6.99k|        uint32_t subsampling_x = 0;
  334|  6.99k|        uint32_t subsampling_y = 0;
  335|  6.99k|        header->range = avifBitsRead(bits, 1) ? AVIF_RANGE_FULL : AVIF_RANGE_LIMITED; // color_range
  ------------------
  |  Branch (335:25): [True: 6.99k, False: 0]
  ------------------
  336|  6.99k|        switch (header->av1C.seqProfile) {
  337|  2.87k|            case 0:
  ------------------
  |  Branch (337:13): [True: 2.87k, False: 4.12k]
  ------------------
  338|  2.87k|                subsampling_x = 1;
  339|  2.87k|                subsampling_y = 1;
  340|  2.87k|                header->yuvFormat = AVIF_PIXEL_FORMAT_YUV420;
  341|  2.87k|                break;
  342|  1.28k|            case 1:
  ------------------
  |  Branch (342:13): [True: 1.28k, False: 5.71k]
  ------------------
  343|  1.28k|                subsampling_x = 0;
  344|  1.28k|                subsampling_y = 0;
  345|  1.28k|                header->yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
  346|  1.28k|                break;
  347|  2.83k|            case 2:
  ------------------
  |  Branch (347:13): [True: 2.83k, False: 4.16k]
  ------------------
  348|  2.83k|                if (header->bitDepth == 12) {
  ------------------
  |  Branch (348:21): [True: 1.24k, False: 1.59k]
  ------------------
  349|  1.24k|                    subsampling_x = avifBitsRead(bits, 1);
  350|  1.24k|                    if (subsampling_x) {
  ------------------
  |  Branch (350:25): [True: 978, False: 266]
  ------------------
  351|    978|                        subsampling_y = avifBitsRead(bits, 1);
  352|    978|                    }
  353|  1.59k|                } else {
  354|  1.59k|                    subsampling_x = 1;
  355|  1.59k|                    subsampling_y = 0;
  356|  1.59k|                }
  357|  2.83k|                if (subsampling_x) {
  ------------------
  |  Branch (357:21): [True: 2.57k, False: 266]
  ------------------
  358|  2.57k|                    header->yuvFormat = subsampling_y ? AVIF_PIXEL_FORMAT_YUV420 : AVIF_PIXEL_FORMAT_YUV422;
  ------------------
  |  Branch (358:41): [True: 722, False: 1.85k]
  ------------------
  359|  2.57k|                } else {
  360|    266|                    header->yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
  361|    266|                }
  362|  2.83k|                break;
  363|      0|            default:
  ------------------
  |  Branch (363:13): [True: 0, False: 6.99k]
  ------------------
  364|      0|                return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  365|  6.99k|        }
  366|       |
  367|  6.99k|        if (subsampling_x && subsampling_y) {
  ------------------
  |  Branch (367:13): [True: 5.44k, False: 1.55k]
  |  Branch (367:30): [True: 3.59k, False: 1.85k]
  ------------------
  368|  3.59k|            header->chromaSamplePosition = (avifChromaSamplePosition)avifBitsRead(bits, 2); // chroma_sample_position
  369|  3.59k|            header->av1C.chromaSamplePosition = (uint8_t)header->chromaSamplePosition;
  370|  3.59k|        }
  371|  6.99k|        header->av1C.chromaSubsamplingX = (uint8_t)subsampling_x;
  372|  6.99k|        header->av1C.chromaSubsamplingY = (uint8_t)subsampling_y;
  373|  6.99k|    }
  374|       |
  375|  18.4k|    return !bits->error;
  376|  18.4k|}

avifRWDataRealloc:
    9|   147k|{
   10|   147k|    if (raw->size != newSize) {
  ------------------
  |  Branch (10:9): [True: 119k, False: 28.3k]
  ------------------
   11|   119k|        if (newSize == 0) {
  ------------------
  |  Branch (11:13): [True: 0, False: 119k]
  ------------------
   12|       |            // avifAlloc(0) returns NULL, so handle the shrink-to-zero case by freeing the buffer.
   13|      0|            avifRWDataFree(raw);
   14|      0|            return AVIF_RESULT_OK;
   15|      0|        }
   16|   119k|        uint8_t * newData = (uint8_t *)avifAlloc(newSize);
   17|   119k|        AVIF_CHECKERR(newData, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|   119k|    do {                        \
  |  |   46|   119k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 119k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   119k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 119k]
  |  |  ------------------
  ------------------
   18|   119k|        if (raw->size) {
  ------------------
  |  Branch (18:13): [True: 0, False: 119k]
  ------------------
   19|      0|            memcpy(newData, raw->data, AVIF_MIN(raw->size, newSize));
  ------------------
  |  |   19|      0|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   20|      0|        }
   21|   119k|        avifFree(raw->data);
   22|   119k|        raw->data = newData;
   23|   119k|        raw->size = newSize;
   24|   119k|    }
   25|   147k|    return AVIF_RESULT_OK;
   26|   147k|}
avifRWDataSet:
   29|   114k|{
   30|   114k|    if (len) {
  ------------------
  |  Branch (30:9): [True: 73.6k, False: 41.3k]
  ------------------
   31|  73.6k|        AVIF_CHECKRES(avifRWDataRealloc(raw, len));
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
   32|  73.6k|        memcpy(raw->data, data, len);
   33|  73.6k|    } else {
   34|  41.3k|        avifRWDataFree(raw);
   35|  41.3k|    }
   36|   114k|    return AVIF_RESULT_OK;
   37|   114k|}
avifRWDataFree:
   40|   537k|{
   41|   537k|    avifFree(raw->data);
   42|       |    raw->data = NULL;
   43|   537k|    raw->size = 0;
   44|   537k|}

avifCodecDecodeInputCreate:
  554|  18.4k|{
  555|  18.4k|    avifCodecDecodeInput * decodeInput = (avifCodecDecodeInput *)avifAlloc(sizeof(avifCodecDecodeInput));
  556|  18.4k|    if (decodeInput == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 18.4k]
  ------------------
  557|      0|        return NULL;
  558|      0|    }
  559|  18.4k|    memset(decodeInput, 0, sizeof(avifCodecDecodeInput));
  560|  18.4k|    if (!avifArrayCreate(&decodeInput->samples, sizeof(avifDecodeSample), 1)) {
  ------------------
  |  Branch (560:9): [True: 0, False: 18.4k]
  ------------------
  561|      0|        avifFree(decodeInput);
  562|      0|        return NULL;
  563|      0|    }
  564|  18.4k|    return decodeInput;
  565|  18.4k|}
avifCodecDecodeInputDestroy:
  568|  18.4k|{
  569|  65.1k|    for (uint32_t sampleIndex = 0; sampleIndex < decodeInput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (569:36): [True: 46.7k, False: 18.4k]
  ------------------
  570|  46.7k|        avifDecodeSample * sample = &decodeInput->samples.sample[sampleIndex];
  571|  46.7k|        if (sample->ownsData) {
  ------------------
  |  Branch (571:13): [True: 0, False: 46.7k]
  ------------------
  572|      0|            avifRWDataFree((avifRWData *)&sample->data);
  573|      0|        }
  574|  46.7k|    }
  575|  18.4k|    avifArrayDestroy(&decodeInput->samples);
  576|  18.4k|    avifFree(decodeInput);
  577|  18.4k|}
avifDecoderCreate:
 5186|  13.7k|{
 5187|  13.7k|    avifDecoder * decoder = (avifDecoder *)avifAlloc(sizeof(avifDecoder));
 5188|  13.7k|    if (decoder == NULL) {
  ------------------
  |  Branch (5188:9): [True: 0, False: 13.7k]
  ------------------
 5189|      0|        return NULL;
 5190|      0|    }
 5191|  13.7k|    memset(decoder, 0, sizeof(avifDecoder));
 5192|  13.7k|    decoder->maxThreads = 1;
 5193|  13.7k|    decoder->imageSizeLimit = AVIF_DEFAULT_IMAGE_SIZE_LIMIT;
  ------------------
  |  |   95|  13.7k|#define AVIF_DEFAULT_IMAGE_SIZE_LIMIT (16384 * 16384)
  ------------------
 5194|  13.7k|    decoder->imageDimensionLimit = AVIF_DEFAULT_IMAGE_DIMENSION_LIMIT;
  ------------------
  |  |   98|  13.7k|#define AVIF_DEFAULT_IMAGE_DIMENSION_LIMIT 32768
  ------------------
 5195|  13.7k|    decoder->imageCountLimit = AVIF_DEFAULT_IMAGE_COUNT_LIMIT;
  ------------------
  |  |  101|  13.7k|#define AVIF_DEFAULT_IMAGE_COUNT_LIMIT (12 * 3600 * 60)
  ------------------
 5196|  13.7k|    decoder->strictFlags = AVIF_STRICT_ENABLED;
 5197|  13.7k|    decoder->imageContentToDecode = AVIF_IMAGE_CONTENT_DECODE_DEFAULT;
 5198|  13.7k|    return decoder;
 5199|  13.7k|}
avifDecoderDestroy:
 5216|  13.7k|{
 5217|  13.7k|    avifDecoderCleanup(decoder);
 5218|  13.7k|    avifIODestroy(decoder->io);
 5219|  13.7k|    avifFree(decoder);
 5220|  13.7k|}
avifDecoderSetIO:
 5229|  13.7k|{
 5230|  13.7k|    avifIODestroy(decoder->io);
 5231|  13.7k|    decoder->io = io;
 5232|  13.7k|}
avifDecoderSetIOMemory:
 5235|  13.7k|{
 5236|  13.7k|    avifIO * io = avifIOCreateMemoryReader(data, size);
 5237|  13.7k|    AVIF_CHECKERR(io != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5238|  13.7k|    avifDecoderSetIO(decoder, io);
 5239|  13.7k|    return AVIF_RESULT_OK;
 5240|  13.7k|}
avifDecoderParse:
 5401|  13.7k|{
 5402|  13.7k|    avifDiagnosticsClearError(&decoder->diag);
 5403|       |
 5404|       |    // Alpha only is not currently supported.
 5405|  13.7k|    if ((decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA) == AVIF_IMAGE_CONTENT_ALPHA) {
  ------------------
  |  Branch (5405:9): [True: 0, False: 13.7k]
  ------------------
 5406|      0|        avifDiagnosticsPrintf(&decoder->diag, "imageContentToDecode set to only alpha is not supported");
 5407|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 5408|      0|    }
 5409|  13.7k|    if (!decoder->io || !decoder->io->read) {
  ------------------
  |  Branch (5409:9): [True: 0, False: 13.7k]
  |  Branch (5409:25): [True: 0, False: 13.7k]
  ------------------
 5410|      0|        return AVIF_RESULT_IO_NOT_SET;
 5411|      0|    }
 5412|       |
 5413|       |    // Cleanup anything lingering in the decoder
 5414|  13.7k|    avifDecoderCleanup(decoder);
 5415|       |
 5416|       |    // -----------------------------------------------------------------------
 5417|       |    // Parse BMFF boxes
 5418|       |
 5419|  13.7k|    decoder->data = avifDecoderDataCreate();
 5420|  13.7k|    AVIF_CHECKERR(decoder->data != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5421|  13.7k|    decoder->data->diag = &decoder->diag;
 5422|       |
 5423|  13.7k|    AVIF_CHECKRES(avifParse(decoder));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5424|       |
 5425|       |    // Walk the decoded items (if any) and harvest ispe
 5426|  13.7k|    avifDecoderData * data = decoder->data;
 5427|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < data->meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (5427:34): [True: 18.4k, False: 13.7k]
  ------------------
 5428|  18.4k|        avifDecoderItem * item = data->meta->items.item[itemIndex];
 5429|  18.4k|        if (avifDecoderItemShouldBeSkipped(item)) {
  ------------------
  |  Branch (5429:13): [True: 0, False: 18.4k]
  ------------------
 5430|      0|            continue;
 5431|      0|        }
 5432|       |
 5433|  18.4k|        const avifProperty * ispeProp = avifPropertyArrayFind(&item->properties, "ispe");
 5434|  18.4k|        if (ispeProp) {
  ------------------
  |  Branch (5434:13): [True: 18.4k, False: 0]
  ------------------
 5435|  18.4k|            item->width = ispeProp->u.ispe.width;
 5436|  18.4k|            item->height = ispeProp->u.ispe.height;
 5437|       |
 5438|  18.4k|            if ((item->width == 0) || (item->height == 0)) {
  ------------------
  |  Branch (5438:17): [True: 0, False: 18.4k]
  |  Branch (5438:39): [True: 0, False: 18.4k]
  ------------------
 5439|      0|                avifDiagnosticsPrintf(data->diag, "Item ID [%u] has an invalid size [%ux%u]", item->id, item->width, item->height);
 5440|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5441|      0|            }
 5442|  18.4k|            if (avifDimensionsTooLarge(item->width, item->height, decoder->imageSizeLimit, decoder->imageDimensionLimit)) {
  ------------------
  |  Branch (5442:17): [True: 0, False: 18.4k]
  ------------------
 5443|      0|                avifDiagnosticsPrintf(data->diag, "Item ID [%u] dimensions are too large [%ux%u]", item->id, item->width, item->height);
 5444|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5445|      0|            }
 5446|  18.4k|        } else {
 5447|      0|            const avifProperty * auxCProp = avifPropertyArrayFind(&item->properties, "auxC");
 5448|      0|            if (auxCProp && isAlphaURN(auxCProp->u.auxC.auxType)) {
  ------------------
  |  Branch (5448:17): [True: 0, False: 0]
  |  Branch (5448:29): [True: 0, False: 0]
  ------------------
 5449|      0|                if (decoder->strictFlags & AVIF_STRICT_ALPHA_ISPE_REQUIRED) {
  ------------------
  |  Branch (5449:21): [True: 0, False: 0]
  ------------------
 5450|      0|                    avifDiagnosticsPrintf(data->diag,
 5451|      0|                                          "[Strict] Alpha auxiliary image item ID [%u] is missing a mandatory ispe property",
 5452|      0|                                          item->id);
 5453|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 5454|      0|                }
 5455|      0|            } else {
 5456|      0|                avifDiagnosticsPrintf(data->diag, "Item ID [%u] is missing a mandatory ispe property", item->id);
 5457|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5458|      0|            }
 5459|      0|        }
 5460|  18.4k|    }
 5461|  13.7k|    return avifDecoderReset(decoder);
 5462|  13.7k|}
avifDecoderReset:
 6192|  13.7k|{
 6193|  13.7k|    avifDiagnosticsClearError(&decoder->diag);
 6194|       |
 6195|  13.7k|    avifDecoderData * data = decoder->data;
 6196|  13.7k|    if (!data) {
  ------------------
  |  Branch (6196:9): [True: 0, False: 13.7k]
  ------------------
 6197|       |        // Nothing to reset.
 6198|      0|        return AVIF_RESULT_OK;
 6199|      0|    }
 6200|       |
 6201|   124k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (6201:21): [True: 110k, False: 13.7k]
  ------------------
 6202|   110k|        memset(&data->tileInfos[c].grid, 0, sizeof(data->tileInfos[c].grid));
 6203|   110k|    }
 6204|  13.7k|    avifDecoderDataClearTiles(data);
 6205|  13.7k|    data->sampleTransformNumInputImageItems = 0;
 6206|  13.7k|    avifArrayDestroy(&data->meta->sampleTransformExpression);
 6207|  13.7k|    data->meta->sampleTransformDepth = 0;
 6208|       |
 6209|       |    // Prepare / cleanup decoded image state
 6210|  13.7k|    if (decoder->image) {
  ------------------
  |  Branch (6210:9): [True: 0, False: 13.7k]
  ------------------
 6211|      0|        avifImageDestroy(decoder->image);
 6212|      0|    }
 6213|  13.7k|    decoder->image = avifImageCreateEmpty();
 6214|  13.7k|    AVIF_CHECKERR(decoder->image, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6215|  13.7k|    decoder->progressiveState = AVIF_PROGRESSIVE_STATE_UNAVAILABLE;
 6216|  13.7k|    data->cicpSet = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 6217|       |
 6218|  13.7k|    memset(&decoder->ioStats, 0, sizeof(decoder->ioStats));
 6219|       |
 6220|       |    // Alpha only is not currently supported.
 6221|  13.7k|    if ((decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA) == AVIF_IMAGE_CONTENT_ALPHA) {
  ------------------
  |  Branch (6221:9): [True: 0, False: 13.7k]
  ------------------
 6222|      0|        avifDiagnosticsPrintf(&decoder->diag, "imageContentToDecode set to only alpha is not supported");
 6223|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 6224|      0|    }
 6225|       |
 6226|       |    // -----------------------------------------------------------------------
 6227|       |    // Build decode input
 6228|       |
 6229|  13.7k|    data->sourceSampleTable = NULL; // Reset
 6230|  13.7k|    if (decoder->requestedSource == AVIF_DECODER_SOURCE_AUTO) {
  ------------------
  |  Branch (6230:9): [True: 6.90k, False: 6.89k]
  ------------------
 6231|       |        // Honor the major brand (avif or avis) if present, otherwise prefer avis (tracks) if possible.
 6232|  6.90k|        if (!memcmp(data->majorBrand, "avis", 4)) {
  ------------------
  |  Branch (6232:13): [True: 0, False: 6.90k]
  ------------------
 6233|      0|            data->source = AVIF_DECODER_SOURCE_TRACKS;
 6234|  6.90k|        } else if (!memcmp(data->majorBrand, "avif", 4)) {
  ------------------
  |  Branch (6234:20): [True: 6.90k, False: 0]
  ------------------
 6235|  6.90k|            data->source = AVIF_DECODER_SOURCE_PRIMARY_ITEM;
 6236|  6.90k|        } else if (data->tracks.count > 0) {
  ------------------
  |  Branch (6236:20): [True: 0, False: 0]
  ------------------
 6237|      0|            data->source = AVIF_DECODER_SOURCE_TRACKS;
 6238|      0|        } else {
 6239|      0|            data->source = AVIF_DECODER_SOURCE_PRIMARY_ITEM;
 6240|      0|        }
 6241|  6.90k|    } else {
 6242|  6.89k|        data->source = decoder->requestedSource;
 6243|  6.89k|    }
 6244|       |
 6245|  13.7k|    avifCodecType colorCodecType = AVIF_CODEC_TYPE_UNKNOWN;
 6246|  13.7k|    const avifPropertyArray * colorProperties = NULL;
 6247|  13.7k|    const avifPropertyArray * alphaProperties = NULL;
 6248|  13.7k|    const avifPropertyArray * gainMapProperties = NULL;
 6249|  13.7k|    if (data->source == AVIF_DECODER_SOURCE_TRACKS) {
  ------------------
  |  Branch (6249:9): [True: 0, False: 13.7k]
  ------------------
 6250|      0|        avifTrack * colorTrack = NULL;
 6251|      0|        avifTrack * alphaTrack = NULL;
 6252|       |
 6253|       |        // Find primary track - this probably needs some better detection
 6254|      0|        uint32_t colorTrackIndex = 0;
 6255|      0|        for (; colorTrackIndex < data->tracks.count; ++colorTrackIndex) {
  ------------------
  |  Branch (6255:16): [True: 0, False: 0]
  ------------------
 6256|      0|            avifTrack * track = &data->tracks.track[colorTrackIndex];
 6257|      0|            if (!track->sampleTable) {
  ------------------
  |  Branch (6257:17): [True: 0, False: 0]
  ------------------
 6258|      0|                continue;
 6259|      0|            }
 6260|      0|            if (!track->id) { // trak box might be missing a tkhd box inside, skip it
  ------------------
  |  Branch (6260:17): [True: 0, False: 0]
  ------------------
 6261|      0|                continue;
 6262|      0|            }
 6263|      0|            if (!track->sampleTable->chunks.count) {
  ------------------
  |  Branch (6263:17): [True: 0, False: 0]
  ------------------
 6264|      0|                continue;
 6265|      0|            }
 6266|      0|            colorCodecType = avifSampleTableGetCodecType(track->sampleTable);
 6267|      0|            if (colorCodecType == AVIF_CODEC_TYPE_UNKNOWN) {
  ------------------
  |  Branch (6267:17): [True: 0, False: 0]
  ------------------
 6268|      0|                continue;
 6269|      0|            }
 6270|      0|            if (avifHasReference(&track->references, "auxl")) {
  ------------------
  |  Branch (6270:17): [True: 0, False: 0]
  ------------------
 6271|      0|                continue;
 6272|      0|            }
 6273|       |            // HEIF (ISO/IEC 23008-12:2022), Section 7.1:
 6274|       |            //   In order to distinguish image sequences from video, the handler type in the
 6275|       |            //   HandlerBox of the track is 'pict' to indicate an image sequence track.
 6276|       |            // But we do not check the handler type because it may break some existing files.
 6277|       |
 6278|       |            // Found one!
 6279|      0|            break;
 6280|      0|        }
 6281|      0|        if (colorTrackIndex == data->tracks.count) {
  ------------------
  |  Branch (6281:13): [True: 0, False: 0]
  ------------------
 6282|      0|            avifDiagnosticsPrintf(&decoder->diag, "Failed to find AV1 color track");
 6283|      0|            return AVIF_RESULT_NO_CONTENT;
 6284|      0|        }
 6285|      0|        colorTrack = &data->tracks.track[colorTrackIndex];
 6286|       |
 6287|      0|        colorProperties = avifSampleTableGetProperties(colorTrack->sampleTable, colorCodecType);
 6288|      0|        if (!colorProperties) {
  ------------------
  |  Branch (6288:13): [True: 0, False: 0]
  ------------------
 6289|      0|            avifDiagnosticsPrintf(&decoder->diag, "Failed to find AV1 color track's color properties");
 6290|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 6291|      0|        }
 6292|       |
 6293|       |        // Find Exif and/or XMP metadata, if any
 6294|      0|        if (colorTrack->meta) {
  ------------------
  |  Branch (6294:13): [True: 0, False: 0]
  ------------------
 6295|       |            // See the comment above avifDecoderFindMetadata() for the explanation of using 0 here
 6296|      0|            avifResult findResult = avifDecoderFindMetadata(decoder, colorTrack->meta, decoder->image, 0);
 6297|      0|            if (findResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (6297:17): [True: 0, False: 0]
  ------------------
 6298|      0|                return findResult;
 6299|      0|            }
 6300|      0|        }
 6301|       |
 6302|      0|        uint32_t alphaTrackIndex = 0;
 6303|      0|        avifCodecType alphaCodecType = AVIF_CODEC_TYPE_UNKNOWN;
 6304|      0|        for (; alphaTrackIndex < data->tracks.count; ++alphaTrackIndex) {
  ------------------
  |  Branch (6304:16): [True: 0, False: 0]
  ------------------
 6305|      0|            avifTrack * track = &data->tracks.track[alphaTrackIndex];
 6306|      0|            if (!track->sampleTable) {
  ------------------
  |  Branch (6306:17): [True: 0, False: 0]
  ------------------
 6307|      0|                continue;
 6308|      0|            }
 6309|      0|            if (!track->id) {
  ------------------
  |  Branch (6309:17): [True: 0, False: 0]
  ------------------
 6310|      0|                continue;
 6311|      0|            }
 6312|      0|            if (!track->sampleTable->chunks.count) {
  ------------------
  |  Branch (6312:17): [True: 0, False: 0]
  ------------------
 6313|      0|                continue;
 6314|      0|            }
 6315|      0|            alphaCodecType = avifSampleTableGetCodecType(track->sampleTable);
 6316|      0|            if (alphaCodecType == AVIF_CODEC_TYPE_UNKNOWN) {
  ------------------
  |  Branch (6316:17): [True: 0, False: 0]
  ------------------
 6317|      0|                continue;
 6318|      0|            }
 6319|      0|            const avifPropertyArray * properties = avifSampleTableGetProperties(track->sampleTable, alphaCodecType);
 6320|      0|            const avifProperty * auxiProp = properties ? avifPropertyArrayFind(properties, "auxi") : NULL;
  ------------------
  |  Branch (6320:45): [True: 0, False: 0]
  ------------------
 6321|       |            // If auxi is present, check that it contains the alpha URN.
 6322|       |            // If auxi is not present, assume that the track is alpha. This is for backward compatibility with
 6323|       |            // old versions of libavif that did not write this property, see
 6324|       |            // https://github.com/AOMediaCodec/libavif/commit/98faa17
 6325|      0|            if (auxiProp && !isAlphaURN(auxiProp->u.auxC.auxType)) {
  ------------------
  |  Branch (6325:17): [True: 0, False: 0]
  |  Branch (6325:29): [True: 0, False: 0]
  ------------------
 6326|      0|                continue;
 6327|      0|            }
 6328|       |            // Do not check the track's handlerType. It should be "auxv" according to
 6329|       |            // HEIF (ISO/IEC 23008-12:2022), Section 7.5.3.1, but old versions of libavif used to write
 6330|       |            // "pict" instead. See https://github.com/AOMediaCodec/libavif/commit/65d0af9
 6331|       |
 6332|      0|            if (avifReferences(&track->references, "auxl", colorTrack->id)) {
  ------------------
  |  Branch (6332:17): [True: 0, False: 0]
  ------------------
 6333|       |                // Found it!
 6334|      0|                alphaProperties = properties;
 6335|      0|                break;
 6336|      0|            }
 6337|      0|        }
 6338|      0|        if (alphaTrackIndex != data->tracks.count) {
  ------------------
  |  Branch (6338:13): [True: 0, False: 0]
  ------------------
 6339|      0|            alphaTrack = &data->tracks.track[alphaTrackIndex];
 6340|      0|        }
 6341|       |
 6342|      0|        const uint8_t operatingPoint = 0; // No way to set operating point via tracks
 6343|      0|        avifTile * colorTile = NULL;
 6344|      0|        if (decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR) {
  ------------------
  |  Branch (6344:13): [True: 0, False: 0]
  ------------------
 6345|      0|            colorTile = avifDecoderDataCreateTile(data, colorCodecType, colorTrack->width, colorTrack->height, operatingPoint);
 6346|      0|            AVIF_CHECKERR(colorTile != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6347|      0|            AVIF_CHECKRES(avifCodecDecodeInputFillFromSampleTable(colorTile->input,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6348|      0|                                                                  colorTrack->sampleTable,
 6349|      0|                                                                  decoder->imageCountLimit,
 6350|      0|                                                                  decoder->io->sizeHint,
 6351|      0|                                                                  data->diag));
 6352|      0|            data->tileInfos[AVIF_ITEM_COLOR].tileCount = 1;
 6353|      0|        }
 6354|       |
 6355|      0|        if (alphaTrack && (decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_ALPHA)) {
  ------------------
  |  Branch (6355:13): [True: 0, False: 0]
  |  Branch (6355:27): [True: 0, False: 0]
  ------------------
 6356|      0|            avifTile * alphaTile = avifDecoderDataCreateTile(data, alphaCodecType, alphaTrack->width, alphaTrack->height, operatingPoint);
 6357|      0|            AVIF_CHECKERR(alphaTile != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6358|      0|            AVIF_CHECKRES(avifCodecDecodeInputFillFromSampleTable(alphaTile->input,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6359|      0|                                                                  alphaTrack->sampleTable,
 6360|      0|                                                                  decoder->imageCountLimit,
 6361|      0|                                                                  decoder->io->sizeHint,
 6362|      0|                                                                  data->diag));
 6363|      0|            alphaTile->input->itemCategory = AVIF_ITEM_ALPHA;
 6364|      0|            data->tileInfos[AVIF_ITEM_ALPHA].tileCount = 1;
 6365|      0|        }
 6366|       |
 6367|       |        // Stash off sample table for future timing information
 6368|      0|        data->sourceSampleTable = colorTrack->sampleTable;
 6369|       |
 6370|       |        // Image sequence timing
 6371|      0|        decoder->imageIndex = -1;
 6372|      0|        uint32_t imageCount;
 6373|      0|        if (colorTile) {
  ------------------
  |  Branch (6373:13): [True: 0, False: 0]
  ------------------
 6374|      0|            imageCount = colorTile->input->samples.count;
 6375|      0|        } else {
 6376|      0|            imageCount = 0;
 6377|      0|            for (uint32_t chunkIndex = 0; chunkIndex < colorTrack->sampleTable->chunks.count; ++chunkIndex) {
  ------------------
  |  Branch (6377:43): [True: 0, False: 0]
  ------------------
 6378|       |                // First, figure out how many samples are in this chunk
 6379|      0|                uint32_t sampleCount = avifGetSampleCountOfChunk(&colorTrack->sampleTable->sampleToChunks, chunkIndex);
 6380|      0|                if (sampleCount == 0) {
  ------------------
  |  Branch (6380:21): [True: 0, False: 0]
  ------------------
 6381|       |                    // chunks with 0 samples are invalid
 6382|      0|                    avifDiagnosticsPrintf(data->diag, "Sample table contains a chunk with 0 samples");
 6383|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 6384|      0|                }
 6385|      0|                if (imageCount > UINT32_MAX - sampleCount) {
  ------------------
  |  Branch (6385:21): [True: 0, False: 0]
  ------------------
 6386|      0|                    avifDiagnosticsPrintf(data->diag, "Total number of samples exceeds UINT32_MAX");
 6387|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 6388|      0|                }
 6389|      0|                imageCount += sampleCount;
 6390|      0|            }
 6391|      0|        }
 6392|      0|        if (imageCount > INT_MAX) {
  ------------------
  |  Branch (6392:13): [True: 0, False: 0]
  ------------------
 6393|      0|            avifDiagnosticsPrintf(data->diag, "Total number of samples exceeds INT_MAX");
 6394|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 6395|      0|        }
 6396|      0|        decoder->imageCount = (int)imageCount;
 6397|      0|        decoder->timescale = colorTrack->mediaTimescale;
 6398|      0|        decoder->durationInTimescales = colorTrack->mediaDuration;
 6399|      0|        if (colorTrack->mediaTimescale) {
  ------------------
  |  Branch (6399:13): [True: 0, False: 0]
  ------------------
 6400|      0|            decoder->duration = (double)decoder->durationInTimescales / (double)colorTrack->mediaTimescale;
 6401|      0|        } else {
 6402|      0|            decoder->duration = 0;
 6403|      0|        }
 6404|       |        // If the alphaTrack->repetitionCount and colorTrack->repetitionCount are different, we will simply use the
 6405|       |        // colorTrack's repetitionCount.
 6406|      0|        decoder->repetitionCount = colorTrack->repetitionCount;
 6407|       |
 6408|      0|        memset(&decoder->imageTiming, 0, sizeof(decoder->imageTiming)); // to be set in avifDecoderNextImage()
 6409|       |
 6410|      0|        decoder->image->width = colorTrack->width;
 6411|      0|        decoder->image->height = colorTrack->height;
 6412|      0|        decoder->alphaPresent = (alphaTrack != NULL);
 6413|      0|        decoder->image->alphaPremultiplied = decoder->alphaPresent && avifReferences(&colorTrack->references, "prem", alphaTrack->id);
  ------------------
  |  Branch (6413:46): [True: 0, False: 0]
  |  Branch (6413:71): [True: 0, False: 0]
  ------------------
 6414|  13.7k|    } else {
 6415|       |        // Create from items
 6416|       |
 6417|  13.7k|        if (data->meta->primaryItemID == 0) {
  ------------------
  |  Branch (6417:13): [True: 0, False: 13.7k]
  ------------------
 6418|       |            // A primary item is required
 6419|      0|            avifDiagnosticsPrintf(&decoder->diag, "Primary item not specified");
 6420|      0|            return AVIF_RESULT_MISSING_IMAGE_ITEM;
 6421|      0|        }
 6422|       |
 6423|       |        // Main item of each group category (top-level item such as grid or single tile), if any.
 6424|  13.7k|        avifDecoderItem * mainItems[AVIF_ITEM_CATEGORY_COUNT];
 6425|  13.7k|        avifCodecType codecType[AVIF_ITEM_CATEGORY_COUNT];
 6426|   124k|        for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (6426:25): [True: 110k, False: 13.7k]
  ------------------
 6427|   110k|            mainItems[c] = NULL;
 6428|   110k|            codecType[c] = AVIF_CODEC_TYPE_UNKNOWN;
 6429|   110k|        }
 6430|       |
 6431|       |        // Mandatory primary color item
 6432|  13.7k|        mainItems[AVIF_ITEM_COLOR] = avifMetaFindColorItem(data->meta);
 6433|  13.7k|        if (!mainItems[AVIF_ITEM_COLOR]) {
  ------------------
  |  Branch (6433:13): [True: 0, False: 13.7k]
  ------------------
 6434|      0|            avifDiagnosticsPrintf(&decoder->diag, "Primary item not found");
 6435|      0|            return AVIF_RESULT_MISSING_IMAGE_ITEM;
 6436|      0|        }
 6437|  13.7k|        AVIF_CHECKRES(avifDecoderItemReadAndParse(decoder,
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6438|  13.7k|                                                  mainItems[AVIF_ITEM_COLOR],
 6439|  13.7k|                                                  /*isItemInInput=*/AVIF_TRUE,
 6440|  13.7k|                                                  &data->tileInfos[AVIF_ITEM_COLOR].grid,
 6441|  13.7k|                                                  &codecType[AVIF_ITEM_COLOR]));
 6442|  13.7k|        colorProperties = &mainItems[AVIF_ITEM_COLOR]->properties;
 6443|  13.7k|        colorCodecType = codecType[AVIF_ITEM_COLOR];
 6444|       |
 6445|       |        // Optional alpha auxiliary item
 6446|  13.7k|        avifBool isAlphaItemInInput;
 6447|  13.7k|        AVIF_CHECKRES(avifMetaFindAlphaItem(data->meta,
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6448|  13.7k|                                            mainItems[AVIF_ITEM_COLOR],
 6449|  13.7k|                                            &data->tileInfos[AVIF_ITEM_COLOR],
 6450|  13.7k|                                            &mainItems[AVIF_ITEM_ALPHA],
 6451|  13.7k|                                            &data->tileInfos[AVIF_ITEM_ALPHA],
 6452|  13.7k|                                            &isAlphaItemInInput));
 6453|  13.7k|        if (mainItems[AVIF_ITEM_ALPHA]) {
  ------------------
  |  Branch (6453:13): [True: 4.61k, False: 9.17k]
  ------------------
 6454|  4.61k|            AVIF_CHECKRES(avifDecoderItemReadAndParse(decoder,
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 6455|  4.61k|                                                      mainItems[AVIF_ITEM_ALPHA],
 6456|  4.61k|                                                      isAlphaItemInInput,
 6457|  4.61k|                                                      &data->tileInfos[AVIF_ITEM_ALPHA].grid,
 6458|  4.61k|                                                      &codecType[AVIF_ITEM_ALPHA]));
 6459|  4.61k|        }
 6460|       |
 6461|       |        // Section 10.2.6 of 23008-12:2024/AMD 1:2024(E):
 6462|       |        //   'tmap' brand
 6463|       |        //   This brand enables file players to identify and decode HEIF files containing tone-map derived image
 6464|       |        //   items. When present, this brand shall be among the brands included in the compatible_brands
 6465|       |        //   array of the FileTypeBox.
 6466|       |        //
 6467|       |        // If the file contains a 'tmap' item but doesn't have the 'tmap' brand, it is technically invalid.
 6468|       |        // However, we don't report any error because in order to do detect this case consistently, we would
 6469|       |        // need to remove the early exit in avifParse() to check if a 'tmap' item might be present
 6470|       |        // further down the file. Instead, we simply ignore tmap items in files that lack the 'tmap' brand.
 6471|  13.7k|        if (avifBrandArrayHasBrand(&data->compatibleBrands, "tmap")) {
  ------------------
  |  Branch (6471:13): [True: 0, False: 13.7k]
  ------------------
 6472|      0|            avifDecoderItem * gainMapItem;
 6473|      0|            avifCodecType gainMapCodecType;
 6474|      0|            AVIF_CHECKRES(avifDecoderFindGainMapItem(decoder, mainItems[AVIF_ITEM_COLOR], &gainMapItem, &gainMapCodecType));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6475|      0|            if (gainMapItem != NULL && decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_GAIN_MAP) {
  ------------------
  |  Branch (6475:17): [True: 0, False: 0]
  |  Branch (6475:40): [True: 0, False: 0]
  ------------------
 6476|      0|                mainItems[AVIF_ITEM_GAIN_MAP] = gainMapItem;
 6477|      0|                codecType[AVIF_ITEM_GAIN_MAP] = gainMapCodecType;
 6478|      0|            }
 6479|      0|        }
 6480|       |
 6481|       |        // AVIF_ITEM_SAMPLE_TRANSFORM (not used through mainItems because not a coded item (well grids are not coded items either but it's different)).
 6482|  13.7k|        avifDecoderItem * const sampleTransformItem = avifDecoderDataFindSampleTransformImageItem(data);
 6483|  13.7k|        if ((decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR) &&
  ------------------
  |  Branch (6483:13): [True: 13.7k, False: 0]
  ------------------
 6484|  13.7k|            (decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS) && sampleTransformItem != NULL) {
  ------------------
  |  Branch (6484:13): [True: 6.89k, False: 6.89k]
  |  Branch (6484:87): [True: 0, False: 6.89k]
  ------------------
 6485|      0|            AVIF_ASSERT_OR_RETURN(data->sampleTransformNumInputImageItems == 0);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6486|       |
 6487|      0|            for (uint32_t i = 0; i < data->meta->items.count; ++i) {
  ------------------
  |  Branch (6487:34): [True: 0, False: 0]
  ------------------
 6488|      0|                avifDecoderItem * inputImageItem = data->meta->items.item[i];
 6489|      0|                if (avifIsDimgInput(sampleTransformItem, inputImageItem->id, NULL)) {
  ------------------
  |  Branch (6489:21): [True: 0, False: 0]
  ------------------
 6490|      0|                    ++data->sampleTransformNumInputImageItems;
 6491|      0|                }
 6492|      0|            }
 6493|       |            // A 'sato' derived image item must reference at least one input image item via 'iref dimg'.
 6494|      0|            if (data->sampleTransformNumInputImageItems == 0) {
  ------------------
  |  Branch (6494:17): [True: 0, False: 0]
  ------------------
 6495|      0|                avifDiagnosticsPrintf(data->diag, "Box[sato] item %u has no input image items", sampleTransformItem->id);
 6496|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 6497|      0|            }
 6498|       |            // Check max number of input items allowed by the format.
 6499|      0|            if (data->sampleTransformNumInputImageItems > 32) {
  ------------------
  |  Branch (6499:17): [True: 0, False: 0]
  ------------------
 6500|      0|                avifDiagnosticsPrintf(data->diag,
 6501|      0|                                      "Box[sato] too many input items, format allows up to 32, got %d",
 6502|      0|                                      data->sampleTransformNumInputImageItems);
 6503|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 6504|      0|            }
 6505|       |            // Check max number of input items supported by this implementation.
 6506|      0|            AVIF_CHECKERR(data->sampleTransformNumInputImageItems <= AVIF_SAMPLE_TRANSFORM_MAX_NUM_INPUT_IMAGE_ITEMS,
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6507|      0|                          AVIF_RESULT_NOT_IMPLEMENTED);
 6508|       |
 6509|      0|            uint32_t numExtraInputImageItems = 0;
 6510|      0|            for (uint32_t i = 0; i < data->meta->items.count; ++i) {
  ------------------
  |  Branch (6510:34): [True: 0, False: 0]
  ------------------
 6511|      0|                avifDecoderItem * inputImageItem = data->meta->items.item[i];
 6512|      0|                uint32_t inputDimgIdx;
 6513|      0|                if (!avifIsDimgInput(sampleTransformItem, inputImageItem->id, &inputDimgIdx)) {
  ------------------
  |  Branch (6513:21): [True: 0, False: 0]
  ------------------
 6514|      0|                    continue;
 6515|      0|                }
 6516|      0|                if (avifDecoderItemShouldBeSkipped(inputImageItem)) {
  ------------------
  |  Branch (6516:21): [True: 0, False: 0]
  ------------------
 6517|      0|                    avifDiagnosticsPrintf(data->diag, "Box[sato] input item %u is not a supported image type", inputImageItem->id);
 6518|      0|                    return AVIF_RESULT_DECODE_SAMPLE_TRANSFORM_FAILED;
 6519|      0|                }
 6520|       |
 6521|      0|                AVIF_ASSERT_OR_RETURN(inputDimgIdx < AVIF_SAMPLE_TRANSFORM_MAX_NUM_INPUT_IMAGE_ITEMS);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6522|      0|                avifItemCategory * category = &data->sampleTransformInputImageItems[inputDimgIdx];
 6523|      0|                avifBool foundItem = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 6524|      0|                for (int c = AVIF_ITEM_COLOR; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (6524:47): [True: 0, False: 0]
  ------------------
 6525|      0|                    if (mainItems[c] && inputImageItem->id == mainItems[c]->id) {
  ------------------
  |  Branch (6525:25): [True: 0, False: 0]
  |  Branch (6525:41): [True: 0, False: 0]
  ------------------
 6526|      0|                        *category = c;
 6527|      0|                        AVIF_CHECKERR(*category == AVIF_ITEM_COLOR, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6528|      0|                        foundItem = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 6529|      0|                        break;
 6530|      0|                    }
 6531|      0|                }
 6532|      0|                if (foundItem) {
  ------------------
  |  Branch (6532:21): [True: 0, False: 0]
  ------------------
 6533|      0|                    continue;
 6534|      0|                }
 6535|      0|                AVIF_CHECKERR(numExtraInputImageItems < AVIF_SAMPLE_TRANSFORM_MAX_NUM_EXTRA_INPUT_IMAGE_ITEMS, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6536|      0|                *category = (avifItemCategory)(AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR + numExtraInputImageItems);
 6537|      0|                const avifItemCategory alphaCategory =
 6538|      0|                    (avifItemCategory)(AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA + numExtraInputImageItems);
 6539|      0|                mainItems[*category] = inputImageItem;
 6540|      0|                ++numExtraInputImageItems;
 6541|       |
 6542|      0|                AVIF_CHECKRES(avifDecoderItemReadAndParse(decoder,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6543|      0|                                                          inputImageItem,
 6544|      0|                                                          /*isItemInInput=*/AVIF_TRUE,
 6545|      0|                                                          &data->tileInfos[*category].grid,
 6546|      0|                                                          &codecType[*category]));
 6547|       |
 6548|       |                // Optional alpha auxiliary item
 6549|      0|                if (!(decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_ALPHA)) {
  ------------------
  |  Branch (6549:21): [True: 0, False: 0]
  ------------------
 6550|      0|                    continue;
 6551|      0|                }
 6552|      0|                avifBool isAlphaInputImageItemInInput = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 6553|      0|                AVIF_CHECKRES(avifMetaFindAlphaItem(data->meta,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6554|      0|                                                    mainItems[*category],
 6555|      0|                                                    &data->tileInfos[*category],
 6556|      0|                                                    &mainItems[alphaCategory],
 6557|      0|                                                    &data->tileInfos[alphaCategory],
 6558|      0|                                                    &isAlphaInputImageItemInInput));
 6559|       |
 6560|      0|                AVIF_CHECKERR(!mainItems[alphaCategory] == !mainItems[AVIF_ITEM_ALPHA], AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6561|      0|                if (mainItems[alphaCategory] != NULL) {
  ------------------
  |  Branch (6561:21): [True: 0, False: 0]
  ------------------
 6562|      0|                    AVIF_CHECKERR(isAlphaInputImageItemInInput == isAlphaItemInInput, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6563|      0|                    AVIF_CHECKERR(avifReferences(&mainItems[*category]->references, "prem", mainItems[alphaCategory]->id) ==
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6564|      0|                                      avifReferences(&mainItems[AVIF_ITEM_COLOR]->references, "prem", mainItems[AVIF_ITEM_ALPHA]->id),
 6565|      0|                                  AVIF_RESULT_NOT_IMPLEMENTED);
 6566|      0|                    AVIF_CHECKRES(avifDecoderItemReadAndParse(decoder,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6567|      0|                                                              mainItems[alphaCategory],
 6568|      0|                                                              isAlphaInputImageItemInInput,
 6569|      0|                                                              &data->tileInfos[alphaCategory].grid,
 6570|      0|                                                              &codecType[alphaCategory]));
 6571|      0|                }
 6572|      0|            }
 6573|       |
 6574|      0|            AVIF_ASSERT_OR_RETURN(data->meta->sampleTransformExpression.tokens == NULL);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6575|      0|            avifROData satoData;
 6576|      0|            AVIF_CHECKRES(avifDecoderItemRead(sampleTransformItem, decoder->io, &satoData, 0, 0, data->diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6577|      0|            AVIF_CHECKRES(avifParseSampleTransformImageBox(satoData.data,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6578|      0|                                                           satoData.size,
 6579|      0|                                                           data->sampleTransformNumInputImageItems,
 6580|      0|                                                           &data->meta->sampleTransformExpression,
 6581|      0|                                                           data->diag));
 6582|      0|            AVIF_CHECKRES(avifDecoderSampleTransformItemValidateProperties(sampleTransformItem, data->diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6583|      0|            const avifProperty * pixiProp = avifPropertyArrayFind(&sampleTransformItem->properties, "pixi");
 6584|      0|            AVIF_ASSERT_OR_RETURN(pixiProp != NULL);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6585|      0|            data->meta->sampleTransformDepth = pixiProp->u.pixi.planeDepths[0];
 6586|      0|        }
 6587|       |
 6588|       |        // Find Exif and/or XMP metadata, if any
 6589|  13.7k|        AVIF_CHECKRES(avifDecoderFindMetadata(decoder, data->meta, decoder->image, mainItems[AVIF_ITEM_COLOR]->id));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6590|       |
 6591|       |        // Set all counts and timing to safe-but-uninteresting values
 6592|  13.7k|        decoder->imageIndex = -1;
 6593|  13.7k|        decoder->imageCount = 1;
 6594|  13.7k|        decoder->imageTiming.timescale = 1;
 6595|  13.7k|        decoder->imageTiming.pts = 0;
 6596|  13.7k|        decoder->imageTiming.ptsInTimescales = 0;
 6597|  13.7k|        decoder->imageTiming.duration = 1;
 6598|  13.7k|        decoder->imageTiming.durationInTimescales = 1;
 6599|  13.7k|        decoder->timescale = 1;
 6600|  13.7k|        decoder->duration = 1;
 6601|  13.7k|        decoder->durationInTimescales = 1;
 6602|       |
 6603|   124k|        for (int c = AVIF_ITEM_COLOR; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (6603:39): [True: 110k, False: 13.7k]
  ------------------
 6604|   110k|            if (!mainItems[c]) {
  ------------------
  |  Branch (6604:17): [True: 91.9k, False: 18.4k]
  ------------------
 6605|  91.9k|                continue;
 6606|  91.9k|            }
 6607|  18.4k|            AVIF_ASSERT_OR_RETURN(c != AVIF_ITEM_SAMPLE_TRANSFORM); // See sampleTransformItem.
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6608|       |
 6609|  18.4k|            if (avifIsAlpha((avifItemCategory)c) && !mainItems[c]->width && !mainItems[c]->height) {
  ------------------
  |  Branch (6609:17): [True: 4.61k, False: 13.7k]
  |  Branch (6609:53): [True: 0, False: 4.61k]
  |  Branch (6609:77): [True: 0, False: 0]
  ------------------
 6610|       |                // NON-STANDARD: Alpha subimage does not have an ispe property; adopt width/height from color item
 6611|      0|                AVIF_ASSERT_OR_RETURN(!(decoder->strictFlags & AVIF_STRICT_ALPHA_ISPE_REQUIRED));
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6612|      0|                mainItems[c]->width = mainItems[AVIF_ITEM_COLOR]->width;
 6613|      0|                mainItems[c]->height = mainItems[AVIF_ITEM_COLOR]->height;
 6614|      0|            }
 6615|       |
 6616|  18.4k|            AVIF_CHECKRES(avifDecoderAdoptGridTileCodecTypeIfNeeded(decoder, mainItems[c], &data->tileInfos[c]));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6617|       |
 6618|  18.4k|            if (c == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (6618:17): [True: 13.7k, False: 4.61k]
  ------------------
 6619|  13.7k|                if (!(decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR)) {
  ------------------
  |  Branch (6619:21): [True: 0, False: 13.7k]
  ------------------
 6620|      0|                    continue;
 6621|      0|                }
 6622|  13.7k|            } else if (c == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (6622:24): [True: 4.61k, False: 0]
  ------------------
 6623|  4.61k|                if (!(decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_ALPHA)) {
  ------------------
  |  Branch (6623:21): [True: 0, False: 4.61k]
  ------------------
 6624|      0|                    continue;
 6625|      0|                }
 6626|  4.61k|            } else if (c == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR || c == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_1_COLOR) {
  ------------------
  |  Branch (6626:24): [True: 0, False: 0]
  |  Branch (6626:73): [True: 0, False: 0]
  ------------------
 6627|      0|                AVIF_ASSERT_OR_RETURN((decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR) &&
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6628|      0|                                      (decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS));
 6629|      0|            } else if (c == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA || c == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_1_ALPHA) {
  ------------------
  |  Branch (6629:24): [True: 0, False: 0]
  |  Branch (6629:73): [True: 0, False: 0]
  ------------------
 6630|      0|                AVIF_ASSERT_OR_RETURN((decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_ALPHA) &&
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6631|      0|                                      (decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS));
 6632|      0|            } else {
 6633|      0|                AVIF_ASSERT_OR_RETURN(c == AVIF_ITEM_GAIN_MAP);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6634|      0|                if (!(decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_GAIN_MAP)) {
  ------------------
  |  Branch (6634:21): [True: 0, False: 0]
  ------------------
 6635|      0|                    continue;
 6636|      0|                }
 6637|      0|            }
 6638|       |
 6639|  18.4k|            AVIF_CHECKRES(avifDecoderGenerateImageTiles(decoder, &data->tileInfos[c], mainItems[c], (avifItemCategory)c));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6640|       |
 6641|  18.4k|            avifStrictFlags strictFlags = decoder->strictFlags;
 6642|  18.4k|            if (avifIsAlpha((avifItemCategory)c) && !isAlphaItemInInput) {
  ------------------
  |  Branch (6642:17): [True: 4.61k, False: 13.7k]
  |  Branch (6642:53): [True: 0, False: 4.61k]
  ------------------
 6643|       |                // In this case, the made up grid item will not have an associated pixi property. So validate everything else
 6644|       |                // but the pixi property.
 6645|      0|                strictFlags &= ~(avifStrictFlags)AVIF_STRICT_PIXI_REQUIRED;
 6646|      0|            }
 6647|  18.4k|            AVIF_CHECKRES(
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6648|  18.4k|                avifDecoderItemValidateProperties(mainItems[c], avifGetConfigurationPropertyName(codecType[c]), &decoder->diag, strictFlags));
 6649|  18.4k|        }
 6650|       |
 6651|  13.7k|        if (mainItems[AVIF_ITEM_COLOR]->progressive) {
  ------------------
  |  Branch (6651:13): [True: 13.7k, False: 0]
  ------------------
 6652|  13.7k|            decoder->progressiveState = AVIF_PROGRESSIVE_STATE_AVAILABLE;
 6653|       |            // data->tileInfos[AVIF_ITEM_COLOR].firstTileIndex is not yet defined but will be set to 0 a few lines below.
 6654|  13.7k|            const avifTile * colorTile = &data->tiles.tile[0];
 6655|  13.7k|            if (colorTile->input->samples.count > 1) {
  ------------------
  |  Branch (6655:17): [True: 7.04k, False: 6.74k]
  ------------------
 6656|  7.04k|                decoder->progressiveState = AVIF_PROGRESSIVE_STATE_ACTIVE;
 6657|  7.04k|                decoder->imageCount = (int)colorTile->input->samples.count;
 6658|  7.04k|            }
 6659|  13.7k|        }
 6660|       |
 6661|  13.7k|        decoder->image->width = mainItems[AVIF_ITEM_COLOR]->width;
 6662|  13.7k|        decoder->image->height = mainItems[AVIF_ITEM_COLOR]->height;
 6663|  13.7k|        decoder->alphaPresent = (mainItems[AVIF_ITEM_ALPHA] != NULL);
 6664|  13.7k|        decoder->image->alphaPremultiplied =
 6665|  13.7k|            decoder->alphaPresent && avifReferences(&mainItems[AVIF_ITEM_COLOR]->references, "prem", mainItems[AVIF_ITEM_ALPHA]->id);
  ------------------
  |  Branch (6665:13): [True: 4.61k, False: 9.17k]
  |  Branch (6665:38): [True: 0, False: 4.61k]
  ------------------
 6666|       |
 6667|  13.7k|        if (mainItems[AVIF_ITEM_ALPHA]) {
  ------------------
  |  Branch (6667:13): [True: 4.61k, False: 9.17k]
  ------------------
 6668|  4.61k|            alphaProperties = &mainItems[AVIF_ITEM_ALPHA]->properties;
 6669|  4.61k|        }
 6670|  13.7k|        if (mainItems[AVIF_ITEM_GAIN_MAP]) {
  ------------------
  |  Branch (6670:13): [True: 0, False: 13.7k]
  ------------------
 6671|      0|            AVIF_ASSERT_OR_RETURN(decoder->image->gainMap && decoder->image->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6672|      0|            decoder->image->gainMap->image->width = mainItems[AVIF_ITEM_GAIN_MAP]->width;
 6673|      0|            decoder->image->gainMap->image->height = mainItems[AVIF_ITEM_GAIN_MAP]->height;
 6674|       |            // Must be called after avifDecoderAdoptGridTileCodecType() which among other things copies the
 6675|       |            // codec config property from the first tile of a grid to the grid item (when grids are used).
 6676|      0|            AVIF_CHECKRES(avifReadCodecConfigProperty(decoder->image->gainMap->image,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6677|      0|                                                      &mainItems[AVIF_ITEM_GAIN_MAP]->properties,
 6678|      0|                                                      codecType[AVIF_ITEM_GAIN_MAP]));
 6679|      0|            gainMapProperties = &mainItems[AVIF_ITEM_GAIN_MAP]->properties;
 6680|      0|        }
 6681|  13.7k|    }
 6682|       |
 6683|  13.7k|    uint32_t firstTileIndex = 0;
 6684|   124k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (6684:21): [True: 110k, False: 13.7k]
  ------------------
 6685|   110k|        data->tileInfos[c].firstTileIndex = firstTileIndex;
 6686|   110k|        firstTileIndex += data->tileInfos[c].tileCount;
 6687|   110k|    }
 6688|       |
 6689|       |    // Sanity check tiles
 6690|  32.1k|    for (uint32_t tileIndex = 0; tileIndex < data->tiles.count; ++tileIndex) {
  ------------------
  |  Branch (6690:34): [True: 18.4k, False: 13.7k]
  ------------------
 6691|  18.4k|        avifTile * tile = &data->tiles.tile[tileIndex];
 6692|  65.1k|        for (uint32_t sampleIndex = 0; sampleIndex < tile->input->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (6692:40): [True: 46.7k, False: 18.4k]
  ------------------
 6693|  46.7k|            avifDecodeSample * sample = &tile->input->samples.sample[sampleIndex];
 6694|  46.7k|            if (!sample->size) {
  ------------------
  |  Branch (6694:17): [True: 0, False: 46.7k]
  ------------------
 6695|       |                // Every sample must have some data
 6696|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 6697|      0|            }
 6698|       |
 6699|  46.7k|            if (tile->input->itemCategory == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (6699:17): [True: 34.9k, False: 11.7k]
  ------------------
 6700|  34.9k|                decoder->ioStats.colorOBUSize += sample->size;
 6701|  34.9k|            } else if (tile->input->itemCategory == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (6701:24): [True: 11.7k, False: 0]
  ------------------
 6702|  11.7k|                decoder->ioStats.alphaOBUSize += sample->size;
 6703|  11.7k|            }
 6704|  46.7k|        }
 6705|  18.4k|    }
 6706|       |
 6707|  13.7k|    AVIF_CHECKRES(avifReadColorProperties(decoder->io,
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  27.5k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6708|  13.7k|                                          colorProperties,
 6709|  13.7k|                                          decoder->ignoreICC ? NULL : &decoder->image->icc,
 6710|  13.7k|                                          &decoder->image->colorPrimaries,
 6711|  13.7k|                                          &decoder->image->transferCharacteristics,
 6712|  13.7k|                                          &decoder->image->matrixCoefficients,
 6713|  13.7k|                                          &decoder->image->yuvRange,
 6714|  13.7k|                                          &data->cicpSet));
 6715|       |
 6716|  13.7k|    const avifProperty * clliProp = avifPropertyArrayFind(colorProperties, "clli");
 6717|  13.7k|    if (clliProp) {
  ------------------
  |  Branch (6717:9): [True: 0, False: 13.7k]
  ------------------
 6718|      0|        decoder->image->clli = clliProp->u.clli;
 6719|      0|    }
 6720|       |
 6721|       |    // Transformations
 6722|  13.7k|    const avifProperty * paspProp = avifPropertyArrayFind(colorProperties, "pasp");
 6723|  13.7k|    if (paspProp) {
  ------------------
  |  Branch (6723:9): [True: 0, False: 13.7k]
  ------------------
 6724|      0|        decoder->image->transformFlags |= AVIF_TRANSFORM_PASP;
 6725|      0|        decoder->image->pasp = paspProp->u.pasp;
 6726|      0|    }
 6727|  13.7k|    const avifProperty * clapProp = avifPropertyArrayFind(colorProperties, "clap");
 6728|  13.7k|    if (clapProp) {
  ------------------
  |  Branch (6728:9): [True: 0, False: 13.7k]
  ------------------
 6729|      0|        decoder->image->transformFlags |= AVIF_TRANSFORM_CLAP;
 6730|      0|        decoder->image->clap = clapProp->u.clap;
 6731|      0|    }
 6732|  13.7k|    const avifProperty * irotProp = avifPropertyArrayFind(colorProperties, "irot");
 6733|  13.7k|    if (irotProp) {
  ------------------
  |  Branch (6733:9): [True: 0, False: 13.7k]
  ------------------
 6734|      0|        decoder->image->transformFlags |= AVIF_TRANSFORM_IROT;
 6735|      0|        decoder->image->irot = irotProp->u.irot;
 6736|      0|    }
 6737|  13.7k|    const avifProperty * imirProp = avifPropertyArrayFind(colorProperties, "imir");
 6738|  13.7k|    if (imirProp) {
  ------------------
  |  Branch (6738:9): [True: 0, False: 13.7k]
  ------------------
 6739|      0|        decoder->image->transformFlags |= AVIF_TRANSFORM_IMIR;
 6740|      0|        decoder->image->imir = imirProp->u.imir;
 6741|      0|    }
 6742|  13.7k|    if (alphaProperties) {
  ------------------
  |  Branch (6742:9): [True: 4.61k, False: 9.17k]
  ------------------
 6743|  4.61k|        AVIF_CHECKRES(avifDecoderCheckAlphaProperties(decoder, alphaProperties));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 6744|  4.61k|    }
 6745|  13.7k|    if (gainMapProperties) {
  ------------------
  |  Branch (6745:9): [True: 0, False: 13.7k]
  ------------------
 6746|      0|        AVIF_CHECKRES(avifDecoderCheckGainMapProperties(decoder, gainMapProperties));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6747|      0|    }
 6748|       |
 6749|  13.7k|    if (!data->cicpSet && (data->tiles.count > 0)) {
  ------------------
  |  Branch (6749:9): [True: 0, False: 13.7k]
  |  Branch (6749:27): [True: 0, False: 0]
  ------------------
 6750|      0|        avifTile * firstTile = &data->tiles.tile[0];
 6751|      0|        if (firstTile->input->samples.count > 0) {
  ------------------
  |  Branch (6751:13): [True: 0, False: 0]
  ------------------
 6752|      0|            avifDecodeSample * sample = &firstTile->input->samples.sample[0];
 6753|       |
 6754|       |            // Harvest CICP from the AV1's sequence header, which should be very close to the front
 6755|       |            // of the first sample. Read in successively larger chunks until we successfully parse the sequence.
 6756|      0|            static const size_t searchSampleChunkIncrement = 64;
 6757|      0|            static const size_t searchSampleSizeMax = 4096;
 6758|      0|            size_t searchSampleSize = 0;
 6759|      0|            do {
 6760|      0|                searchSampleSize += searchSampleChunkIncrement;
 6761|      0|                if (searchSampleSize > sample->size) {
  ------------------
  |  Branch (6761:21): [True: 0, False: 0]
  ------------------
 6762|      0|                    searchSampleSize = sample->size;
 6763|      0|                }
 6764|       |
 6765|      0|                avifResult prepareResult = avifDecoderPrepareSample(decoder, sample, searchSampleSize);
 6766|      0|                if (prepareResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (6766:21): [True: 0, False: 0]
  ------------------
 6767|      0|                    return prepareResult;
 6768|      0|                }
 6769|       |
 6770|      0|                avifSequenceHeader sequenceHeader;
 6771|      0|                if (avifSequenceHeaderParse(&sequenceHeader, &sample->data, firstTile->codecType)) {
  ------------------
  |  Branch (6771:21): [True: 0, False: 0]
  ------------------
 6772|      0|                    data->cicpSet = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 6773|      0|                    decoder->image->colorPrimaries = sequenceHeader.colorPrimaries;
 6774|      0|                    decoder->image->transferCharacteristics = sequenceHeader.transferCharacteristics;
 6775|      0|                    decoder->image->matrixCoefficients = sequenceHeader.matrixCoefficients;
 6776|      0|                    decoder->image->yuvRange = sequenceHeader.range;
 6777|      0|                    break;
 6778|      0|                }
 6779|      0|            } while (searchSampleSize != sample->size && searchSampleSize < searchSampleSizeMax);
  ------------------
  |  Branch (6779:22): [True: 0, False: 0]
  |  Branch (6779:58): [True: 0, False: 0]
  ------------------
 6780|      0|        }
 6781|      0|    }
 6782|       |
 6783|  13.7k|    AVIF_CHECKRES(avifReadCodecConfigProperty(decoder->image, colorProperties, colorCodecType));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 6784|  13.7k|    if (decoder->data->meta->sampleTransformExpression.count > 0) {
  ------------------
  |  Branch (6784:9): [True: 0, False: 13.7k]
  ------------------
 6785|      0|        AVIF_ASSERT_OR_RETURN(decoder->data->meta->sampleTransformDepth != 0);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6786|      0|        decoder->image->depth = decoder->data->meta->sampleTransformDepth;
 6787|      0|    }
 6788|       |
 6789|       |    // Expose as raw bytes all other properties that libavif does not care about.
 6790|  82.7k|    for (size_t i = 0; i < colorProperties->count; ++i) {
  ------------------
  |  Branch (6790:24): [True: 68.9k, False: 13.7k]
  ------------------
 6791|  68.9k|        const avifProperty * property = &colorProperties->prop[i];
 6792|  68.9k|        if (property->isOpaque) {
  ------------------
  |  Branch (6792:13): [True: 0, False: 68.9k]
  ------------------
 6793|      0|            AVIF_CHECKRES(avifImagePushProperty(decoder->image,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6794|      0|                                                property->type,
 6795|      0|                                                property->u.opaque.usertype,
 6796|      0|                                                property->u.opaque.boxPayload.data,
 6797|      0|                                                property->u.opaque.boxPayload.size));
 6798|      0|        }
 6799|  68.9k|    }
 6800|       |
 6801|  13.7k|    if (gainMapProperties) {
  ------------------
  |  Branch (6801:9): [True: 0, False: 13.7k]
  ------------------
 6802|      0|        for (size_t i = 0; i < gainMapProperties->count; ++i) {
  ------------------
  |  Branch (6802:28): [True: 0, False: 0]
  ------------------
 6803|      0|            const avifProperty * property = &gainMapProperties->prop[i];
 6804|      0|            if (property->isOpaque) {
  ------------------
  |  Branch (6804:17): [True: 0, False: 0]
  ------------------
 6805|      0|                AVIF_CHECKRES(avifImagePushProperty(decoder->image->gainMap->image,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6806|      0|                                                    property->type,
 6807|      0|                                                    property->u.opaque.usertype,
 6808|      0|                                                    property->u.opaque.boxPayload.data,
 6809|      0|                                                    property->u.opaque.boxPayload.size));
 6810|      0|            }
 6811|      0|        }
 6812|      0|    }
 6813|  13.7k|    return AVIF_RESULT_OK;
 6814|  13.7k|}
avifDecoderNextImage:
 7134|  48.7k|{
 7135|  48.7k|    avifDiagnosticsClearError(&decoder->diag);
 7136|       |
 7137|  48.7k|    if (!decoder->data || decoder->data->tiles.count == 0) {
  ------------------
  |  Branch (7137:9): [True: 0, False: 48.7k]
  |  Branch (7137:27): [True: 0, False: 48.7k]
  ------------------
 7138|       |        // Nothing has been parsed yet
 7139|      0|        return AVIF_RESULT_NO_CONTENT;
 7140|      0|    }
 7141|       |
 7142|  48.7k|    if (!decoder->io || !decoder->io->read) {
  ------------------
  |  Branch (7142:9): [True: 0, False: 48.7k]
  |  Branch (7142:25): [True: 0, False: 48.7k]
  ------------------
 7143|      0|        return AVIF_RESULT_IO_NOT_SET;
 7144|      0|    }
 7145|       |
 7146|  48.7k|    if (avifDecoderDataFrameFullyDecoded(decoder->data)) {
  ------------------
  |  Branch (7146:9): [True: 34.9k, False: 13.7k]
  ------------------
 7147|       |        // A frame was decoded during the last avifDecoderNextImage() call.
 7148|   314k|        for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7148:25): [True: 279k, False: 34.9k]
  ------------------
 7149|   279k|            decoder->data->tileInfos[c].decodedTileCount = 0;
 7150|   279k|        }
 7151|  34.9k|    }
 7152|       |
 7153|  48.7k|    AVIF_ASSERT_OR_RETURN(decoder->data->tiles.count == (decoder->data->tileInfos[AVIF_ITEM_CATEGORY_COUNT - 1].firstTileIndex +
  ------------------
  |  |   64|  48.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  48.7k|    do {                        \
  |  |  |  |   46|  48.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 48.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  48.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 48.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7154|  48.7k|                                                         decoder->data->tileInfos[AVIF_ITEM_CATEGORY_COUNT - 1].tileCount));
 7155|       |
 7156|  48.7k|    const uint32_t nextImageIndex = (uint32_t)(decoder->imageIndex + 1);
 7157|       |
 7158|       |    // Ensure that we have created the codecs before proceeding with the decoding.
 7159|  48.7k|    if (!decoder->data->tiles.tile[0].codec) {
  ------------------
  |  Branch (7159:9): [True: 13.7k, False: 34.9k]
  ------------------
 7160|  13.7k|        AVIF_CHECKRES(avifDecoderCreateCodecs(decoder));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 7161|  13.7k|    }
 7162|       |
 7163|       |    // Acquire all sample data for the current image first, allowing for any read call to bail out
 7164|       |    // with AVIF_RESULT_WAITING_ON_IO harmlessly / idempotently, unless decoder->allowIncremental.
 7165|  48.7k|    avifResult prepareTileResult[AVIF_ITEM_CATEGORY_COUNT];
 7166|   328k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7166:21): [True: 293k, False: 34.9k]
  ------------------
 7167|   293k|        prepareTileResult[c] = avifDecoderPrepareTiles(decoder, nextImageIndex, &decoder->data->tileInfos[c]);
 7168|   293k|        if (!decoder->allowIncremental || (prepareTileResult[c] != AVIF_RESULT_WAITING_ON_IO)) {
  ------------------
  |  Branch (7168:13): [True: 148k, False: 144k]
  |  Branch (7168:43): [True: 144k, False: 0]
  ------------------
 7169|   293k|            AVIF_CHECKRES(prepareTileResult[c]);
  ------------------
  |  |   54|   293k|    do {                                  \
  |  |   55|   293k|        const avifResult result__ = (A);  \
  |  |   56|   293k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 13.7k, False: 279k]
  |  |  ------------------
  |  |   57|  13.7k|            avifBreakOnError();           \
  |  |   58|  13.7k|            return result__;              \
  |  |   59|  13.7k|        }                                 \
  |  |   60|   293k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 279k]
  |  |  ------------------
  ------------------
 7170|   293k|        }
 7171|   293k|    }
 7172|       |
 7173|       |    // Decode all available color tiles now, then all available alpha tiles, then all available bit
 7174|       |    // depth extension tiles. The order of appearance of the tiles in the bitstream is left to the
 7175|       |    // encoder's choice, and decoding as many as possible of each category in parallel is beneficial
 7176|       |    // for incremental decoding, as pixel rows need all channels to be decoded before being
 7177|       |    // accessible to the user.
 7178|   314k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7178:21): [True: 279k, False: 34.9k]
  ------------------
 7179|   279k|        AVIF_CHECKRES(avifDecoderDecodeTiles(decoder, nextImageIndex, &decoder->data->tileInfos[c]));
  ------------------
  |  |   54|   279k|    do {                                  \
  |  |   55|   279k|        const avifResult result__ = (A);  \
  |  |   56|   279k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 279k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   279k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 279k]
  |  |  ------------------
  ------------------
 7180|   279k|    }
 7181|       |
 7182|  34.9k|    if (!avifDecoderDataFrameFullyDecoded(decoder->data)) {
  ------------------
  |  Branch (7182:9): [True: 0, False: 34.9k]
  ------------------
 7183|      0|        AVIF_ASSERT_OR_RETURN(decoder->allowIncremental);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7184|       |        // The image is not completely decoded. There should be no error unrelated to missing bytes,
 7185|       |        // and at least some missing bytes.
 7186|      0|        avifResult firstNonOkResult = AVIF_RESULT_OK;
 7187|      0|        for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7187:25): [True: 0, False: 0]
  ------------------
 7188|      0|            AVIF_ASSERT_OR_RETURN(prepareTileResult[c] == AVIF_RESULT_OK || prepareTileResult[c] == AVIF_RESULT_WAITING_ON_IO);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7189|      0|            if (firstNonOkResult == AVIF_RESULT_OK) {
  ------------------
  |  Branch (7189:17): [True: 0, False: 0]
  ------------------
 7190|      0|                firstNonOkResult = prepareTileResult[c];
 7191|      0|            }
 7192|      0|        }
 7193|      0|        AVIF_ASSERT_OR_RETURN(firstNonOkResult != AVIF_RESULT_OK);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7194|       |        // Return the "not enough bytes" status now instead of moving on to the next frame.
 7195|      0|        return AVIF_RESULT_WAITING_ON_IO;
 7196|      0|    }
 7197|   314k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7197:21): [True: 279k, False: 34.9k]
  ------------------
 7198|   279k|        AVIF_ASSERT_OR_RETURN(prepareTileResult[c] == AVIF_RESULT_OK);
  ------------------
  |  |   64|   279k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   279k|    do {                        \
  |  |  |  |   46|   279k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 279k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   279k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 279k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7199|   279k|    }
 7200|       |
 7201|       |    // If decoder->data->tileInfos[AVIF_ITEM_COLOR].tileCount == 0, it means
 7202|       |    // decoder->imageContentToDecode & AVIF_IMAGE_CONTENT_COLOR was equal to 0.
 7203|       |    // Only apply Sample Transforms if there is a color item to apply it onto.
 7204|  34.9k|    if (decoder->data->tileInfos[AVIF_ITEM_COLOR].tileCount != 0 && decoder->data->meta->sampleTransformExpression.count > 0) {
  ------------------
  |  Branch (7204:9): [True: 34.9k, False: 0]
  |  Branch (7204:69): [True: 0, False: 34.9k]
  ------------------
 7205|      0|        AVIF_CHECKRES(avifDecoderApplySampleTransform(decoder, decoder->image));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7206|      0|    }
 7207|       |
 7208|       |    // Only advance decoder->imageIndex once the image is completely decoded, so that
 7209|       |    // avifDecoderNthImage(decoder, decoder->imageIndex + 1) is equivalent to avifDecoderNextImage(decoder)
 7210|       |    // if the previous call to avifDecoderNextImage() returned AVIF_RESULT_WAITING_ON_IO.
 7211|  34.9k|    decoder->imageIndex = (int)nextImageIndex;
 7212|       |    // The decoded tile counts will be reset to 0 the next time avifDecoderNextImage() is called,
 7213|       |    // for avifDecoderDecodedRowCount() to work until then.
 7214|  34.9k|    if (decoder->data->sourceSampleTable) {
  ------------------
  |  Branch (7214:9): [True: 0, False: 34.9k]
  ------------------
 7215|       |        // Decoding from a track! Provide timing information.
 7216|       |
 7217|      0|        avifResult timingResult = avifDecoderNthImageTiming(decoder, decoder->imageIndex, &decoder->imageTiming);
 7218|      0|        if (timingResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (7218:13): [True: 0, False: 0]
  ------------------
 7219|      0|            return timingResult;
 7220|      0|        }
 7221|      0|    }
 7222|  34.9k|    return AVIF_RESULT_OK;
 7223|  34.9k|}
read.c:avifParseFileTypeBox:
 4891|  13.7k|{
 4892|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[ftyp]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 4893|       |
 4894|  13.7k|    AVIF_CHECK(avifROStreamRead(&s, ftyp->majorBrand, 4));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 4895|  13.7k|    AVIF_CHECK(avifROStreamRead(&s, ftyp->minorVersion, 4));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 4896|       |
 4897|  13.7k|    size_t compatibleBrandsBytes = avifROStreamRemainingBytes(&s);
 4898|  13.7k|    if ((compatibleBrandsBytes % 4) != 0) {
  ------------------
  |  Branch (4898:9): [True: 0, False: 13.7k]
  ------------------
 4899|      0|        avifDiagnosticsPrintf(diag, "Box[ftyp] contains a compatible brands section that isn't divisible by 4 [%zu]", compatibleBrandsBytes);
 4900|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 4901|      0|    }
 4902|  13.7k|    ftyp->compatibleBrands = avifROStreamCurrent(&s);
 4903|  13.7k|    AVIF_CHECK(avifROStreamSkip(&s, compatibleBrandsBytes));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 4904|  13.7k|    ftyp->compatibleBrandsCount = (int)compatibleBrandsBytes / 4;
 4905|       |
 4906|  13.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 4907|  13.7k|}
read.c:avifFileTypeIsCompatible:
 5141|  13.7k|{
 5142|  13.7k|    return avifFileTypeHasBrand(ftyp, "avif") || avifFileTypeHasBrand(ftyp, "avis")
  ------------------
  |  Branch (5142:12): [True: 13.7k, False: 0]
  |  Branch (5142:50): [True: 0, False: 0]
  ------------------
 5143|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5144|       |           || avifFileTypeHasBrand(ftyp, "mif3")
 5145|       |#endif // AVIF_ENABLE_EXPERIMENTAL_MINI
 5146|  13.7k|        ;
 5147|  13.7k|}
read.c:avifFileTypeHasBrand:
 5126|  55.1k|{
 5127|  55.1k|    if (!memcmp(ftyp->majorBrand, brand, 4)) {
  ------------------
  |  Branch (5127:9): [True: 27.5k, False: 27.5k]
  ------------------
 5128|  27.5k|        return AVIF_TRUE;
  ------------------
  |  |   88|  27.5k|#define AVIF_TRUE 1
  ------------------
 5129|  27.5k|    }
 5130|       |
 5131|   118k|    for (int compatibleBrandIndex = 0; compatibleBrandIndex < ftyp->compatibleBrandsCount; ++compatibleBrandIndex) {
  ------------------
  |  Branch (5131:40): [True: 91.0k, False: 27.5k]
  ------------------
 5132|  91.0k|        const uint8_t * compatibleBrand = &ftyp->compatibleBrands[4 * compatibleBrandIndex];
 5133|  91.0k|        if (!memcmp(compatibleBrand, brand, 4)) {
  ------------------
  |  Branch (5133:13): [True: 0, False: 91.0k]
  ------------------
 5134|      0|            return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5135|      0|        }
 5136|  91.0k|    }
 5137|  27.5k|    return AVIF_FALSE;
  ------------------
  |  |   89|  27.5k|#define AVIF_FALSE 0
  ------------------
 5138|  27.5k|}
read.c:avifDecoderCleanup:
 5202|  27.5k|{
 5203|  27.5k|    if (decoder->data) {
  ------------------
  |  Branch (5203:9): [True: 13.7k, False: 13.7k]
  ------------------
 5204|  13.7k|        avifDecoderDataDestroy(decoder->data);
 5205|  13.7k|        decoder->data = NULL;
 5206|  13.7k|    }
 5207|       |
 5208|  27.5k|    if (decoder->image) {
  ------------------
  |  Branch (5208:9): [True: 13.7k, False: 13.7k]
  ------------------
 5209|  13.7k|        avifImageDestroy(decoder->image);
 5210|       |        decoder->image = NULL;
 5211|  13.7k|    }
 5212|  27.5k|    avifDiagnosticsClearError(&decoder->diag);
 5213|  27.5k|}
read.c:avifDecoderDataDestroy:
 1216|  13.7k|{
 1217|  13.7k|    if (data->meta) {
  ------------------
  |  Branch (1217:9): [True: 13.7k, False: 0]
  ------------------
 1218|  13.7k|        avifMetaDestroy(data->meta);
 1219|  13.7k|    }
 1220|  13.7k|    for (uint32_t i = 0; i < data->tracks.count; ++i) {
  ------------------
  |  Branch (1220:26): [True: 0, False: 13.7k]
  ------------------
 1221|      0|        avifTrack * track = &data->tracks.track[i];
 1222|      0|        if (track->sampleTable) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 0]
  ------------------
 1223|      0|            avifSampleTableDestroy(track->sampleTable);
 1224|      0|        }
 1225|      0|        if (track->meta) {
  ------------------
  |  Branch (1225:13): [True: 0, False: 0]
  ------------------
 1226|      0|            avifMetaDestroy(track->meta);
 1227|      0|        }
 1228|      0|        avifArrayDestroy(&track->references);
 1229|      0|    }
 1230|  13.7k|    avifArrayDestroy(&data->tracks);
 1231|  13.7k|    avifDecoderDataClearTiles(data);
 1232|  13.7k|    avifArrayDestroy(&data->tiles);
 1233|  13.7k|    avifArrayDestroy(&data->compatibleBrands);
 1234|  13.7k|    avifFree(data);
 1235|  13.7k|}
read.c:avifMetaDestroy:
  940|  13.7k|{
  941|  32.1k|    for (uint32_t i = 0; i < meta->items.count; ++i) {
  ------------------
  |  Branch (941:26): [True: 18.4k, False: 13.7k]
  ------------------
  942|  18.4k|        avifDecoderItem * item = meta->items.item[i];
  943|  18.4k|        avifPropertyArrayDestroy(&item->properties);
  944|  18.4k|        avifArrayDestroy(&item->extents);
  945|  18.4k|        avifArrayDestroy(&item->references);
  946|  18.4k|        avifArrayDestroy(&item->dimgInputs);
  947|  18.4k|        if (item->ownsMergedExtents) {
  ------------------
  |  Branch (947:13): [True: 18.4k, False: 0]
  ------------------
  948|  18.4k|            avifRWDataFree(&item->mergedExtents);
  949|  18.4k|        }
  950|  18.4k|        avifFree(item);
  951|  18.4k|    }
  952|  13.7k|    avifArrayDestroy(&meta->items);
  953|  13.7k|    avifPropertyArrayDestroy(&meta->properties);
  954|  13.7k|    avifRWDataFree(&meta->idat);
  955|  13.7k|    avifArrayDestroy(&meta->sampleTransformExpression);
  956|  13.7k|    for (uint32_t i = 0; i < meta->entityToGroups.count; ++i) {
  ------------------
  |  Branch (956:26): [True: 0, False: 13.7k]
  ------------------
  957|      0|        avifArrayDestroy(&meta->entityToGroups.groups[i].entityIDs);
  958|      0|    }
  959|  13.7k|    avifArrayDestroy(&meta->entityToGroups);
  960|  13.7k|    avifFree(meta);
  961|  13.7k|}
read.c:avifPropertyArrayDestroy:
  402|  32.1k|{
  403|   207k|    for (size_t i = 0; i < array->count; ++i) {
  ------------------
  |  Branch (403:24): [True: 175k, False: 32.1k]
  ------------------
  404|   175k|        if (array->prop[i].isOpaque) {
  ------------------
  |  Branch (404:13): [True: 0, False: 175k]
  ------------------
  405|      0|            avifRWDataFree(&array->prop[i].u.opaque.boxPayload);
  406|      0|        }
  407|   175k|    }
  408|  32.1k|    avifArrayDestroy(array);
  409|  32.1k|}
read.c:avifMetaFindOrCreateItem:
  981|   106k|{
  982|   106k|    *item = NULL;
  983|   106k|    AVIF_ASSERT_OR_RETURN(itemID != 0);
  ------------------
  |  |   64|   106k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   106k|    do {                        \
  |  |  |  |   46|   106k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   106k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 106k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  984|       |
  985|   136k|    for (uint32_t i = 0; i < meta->items.count; ++i) {
  ------------------
  |  Branch (985:26): [True: 118k, False: 18.4k]
  ------------------
  986|   118k|        if (meta->items.item[i]->id == itemID) {
  ------------------
  |  Branch (986:13): [True: 88.1k, False: 30.2k]
  ------------------
  987|  88.1k|            *item = meta->items.item[i];
  988|  88.1k|            return AVIF_RESULT_OK;
  989|  88.1k|        }
  990|   118k|    }
  991|       |
  992|  18.4k|    avifDecoderItem ** itemPtr = (avifDecoderItem **)avifArrayPush(&meta->items);
  993|  18.4k|    AVIF_CHECKERR(itemPtr != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  994|  18.4k|    *item = (avifDecoderItem *)avifAlloc(sizeof(avifDecoderItem));
  995|  18.4k|    if (*item == NULL) {
  ------------------
  |  Branch (995:9): [True: 0, False: 18.4k]
  ------------------
  996|      0|        avifArrayPop(&meta->items);
  997|      0|        return AVIF_RESULT_OUT_OF_MEMORY;
  998|      0|    }
  999|  18.4k|    memset(*item, 0, sizeof(avifDecoderItem));
 1000|       |
 1001|  18.4k|    *itemPtr = *item;
 1002|  18.4k|    if (!avifArrayCreate(&(*item)->properties, sizeof(avifProperty), 16)) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 18.4k]
  ------------------
 1003|      0|        avifFree(*item);
 1004|      0|        *item = NULL;
 1005|      0|        avifArrayPop(&meta->items);
 1006|      0|        return AVIF_RESULT_OUT_OF_MEMORY;
 1007|      0|    }
 1008|  18.4k|    if (!avifArrayCreate(&(*item)->extents, sizeof(avifExtent), 1)) {
  ------------------
  |  Branch (1008:9): [True: 0, False: 18.4k]
  ------------------
 1009|      0|        avifPropertyArrayDestroy(&(*item)->properties);
 1010|      0|        avifFree(*item);
 1011|      0|        *item = NULL;
 1012|      0|        avifArrayPop(&meta->items);
 1013|      0|        return AVIF_RESULT_OUT_OF_MEMORY;
 1014|      0|    }
 1015|  18.4k|    if (!avifArrayCreate(&(*item)->references, sizeof(avifItemReference), 1)) {
  ------------------
  |  Branch (1015:9): [True: 0, False: 18.4k]
  ------------------
 1016|      0|        avifArrayDestroy(&(*item)->extents);
 1017|      0|        avifPropertyArrayDestroy(&(*item)->properties);
 1018|      0|        avifFree(*item);
 1019|      0|        *item = NULL;
 1020|      0|        avifArrayPop(&meta->items);
 1021|      0|        return AVIF_RESULT_OUT_OF_MEMORY;
 1022|      0|    }
 1023|  18.4k|    if (!avifArrayCreate(&(*item)->dimgInputs, sizeof(uint32_t), 1)) {
  ------------------
  |  Branch (1023:9): [True: 0, False: 18.4k]
  ------------------
 1024|      0|        avifArrayDestroy(&(*item)->references);
 1025|      0|        avifArrayDestroy(&(*item)->extents);
 1026|      0|        avifPropertyArrayDestroy(&(*item)->properties);
 1027|      0|        avifFree(*item);
 1028|      0|        *item = NULL;
 1029|      0|        avifArrayPop(&meta->items);
 1030|      0|        return AVIF_RESULT_OUT_OF_MEMORY;
 1031|      0|    }
 1032|  18.4k|    (*item)->id = itemID;
 1033|  18.4k|    (*item)->meta = meta;
 1034|  18.4k|    return AVIF_RESULT_OK;
 1035|  18.4k|}
read.c:avifDecoderDataCreate:
 1087|  13.7k|{
 1088|  13.7k|    avifDecoderData * data = (avifDecoderData *)avifAlloc(sizeof(avifDecoderData));
 1089|  13.7k|    if (data == NULL) {
  ------------------
  |  Branch (1089:9): [True: 0, False: 13.7k]
  ------------------
 1090|      0|        return NULL;
 1091|      0|    }
 1092|  13.7k|    memset(data, 0, sizeof(avifDecoderData));
 1093|  13.7k|    data->meta = avifMetaCreate();
 1094|  13.7k|    if (data->meta == NULL || !avifArrayCreate(&data->tracks, sizeof(avifTrack), 2) ||
  ------------------
  |  Branch (1094:9): [True: 0, False: 13.7k]
  |  Branch (1094:31): [True: 0, False: 13.7k]
  ------------------
 1095|  13.7k|        !avifArrayCreate(&data->tiles, sizeof(avifTile), 8)) {
  ------------------
  |  Branch (1095:9): [True: 0, False: 13.7k]
  ------------------
 1096|      0|        avifDecoderDataDestroy(data);
 1097|      0|        return NULL;
 1098|      0|    }
 1099|  13.7k|    return data;
 1100|  13.7k|}
read.c:avifMetaCreate:
  925|  13.7k|{
  926|  13.7k|    avifMeta * meta = (avifMeta *)avifAlloc(sizeof(avifMeta));
  927|  13.7k|    if (meta == NULL) {
  ------------------
  |  Branch (927:9): [True: 0, False: 13.7k]
  ------------------
  928|      0|        return NULL;
  929|      0|    }
  930|  13.7k|    memset(meta, 0, sizeof(avifMeta));
  931|  13.7k|    if (!avifArrayCreate(&meta->items, sizeof(avifDecoderItem *), 8) || !avifArrayCreate(&meta->properties, sizeof(avifProperty), 16) ||
  ------------------
  |  Branch (931:9): [True: 0, False: 13.7k]
  |  Branch (931:73): [True: 0, False: 13.7k]
  ------------------
  932|  13.7k|        !avifArrayCreate(&meta->entityToGroups, sizeof(avifEntityToGroup), 1)) {
  ------------------
  |  Branch (932:9): [True: 0, False: 13.7k]
  ------------------
  933|      0|        avifMetaDestroy(meta);
  934|      0|        return NULL;
  935|      0|    }
  936|  13.7k|    return meta;
  937|  13.7k|}
read.c:avifParse:
 4913|  13.7k|{
 4914|       |    // Note: this top-level function is the only avifParse*() function that returns avifResult instead of avifBool.
 4915|       |    // Be sure to use AVIF_CHECKERR() in this function with an explicit error result instead of simply using AVIF_CHECK().
 4916|       |
 4917|  13.7k|    avifResult readResult;
 4918|  13.7k|    uint64_t parseOffset = 0;
 4919|  13.7k|    avifDecoderData * data = decoder->data;
 4920|  13.7k|    avifBool ftypSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4921|  13.7k|    avifBool metaSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4922|  13.7k|    avifBool metaIsSizeZero = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4923|  13.7k|    avifBool moovSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4924|  13.7k|    avifBool needsMeta = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4925|  13.7k|    avifBool needsMoov = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4926|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 4927|       |    avifBool miniSeen = AVIF_FALSE;
 4928|       |    avifBool needsMini = AVIF_FALSE;
 4929|       |#endif
 4930|  13.7k|    avifBool needsTmap = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4931|  13.7k|    avifBool tmapSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 4932|  13.7k|    avifFileType ftyp = { 0 };
 4933|       |
 4934|  27.5k|    for (;;) {
 4935|       |        // Read just enough to get the next box header (a max of 32 bytes)
 4936|  27.5k|        avifROData headerContents;
 4937|  27.5k|        if ((decoder->io->sizeHint > 0) && (parseOffset > decoder->io->sizeHint)) {
  ------------------
  |  Branch (4937:13): [True: 27.5k, False: 0]
  |  Branch (4937:44): [True: 0, False: 27.5k]
  ------------------
 4938|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 4939|      0|        }
 4940|  27.5k|        readResult = decoder->io->read(decoder->io, 0, parseOffset, 32, &headerContents);
 4941|  27.5k|        if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (4941:13): [True: 0, False: 27.5k]
  ------------------
 4942|      0|            return readResult;
 4943|      0|        }
 4944|  27.5k|        if (!headerContents.size) {
  ------------------
  |  Branch (4944:13): [True: 0, False: 27.5k]
  ------------------
 4945|       |            // If we got AVIF_RESULT_OK from the reader but received 0 bytes,
 4946|       |            // we've reached the end of the file with no errors. Hooray!
 4947|      0|            break;
 4948|      0|        }
 4949|       |
 4950|       |        // Parse the header, and find out how many bytes it actually was
 4951|  27.5k|        BEGIN_STREAM(headerStream, headerContents.data, headerContents.size, &decoder->diag, "File-level box header");
  ------------------
  |  |  810|  27.5k|    avifROStream VARNAME;                               \
  |  |  811|  27.5k|    avifROData VARNAME##_roData;                        \
  |  |  812|  27.5k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  27.5k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  27.5k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 4952|  27.5k|        avifBoxHeader header;
 4953|  27.5k|        AVIF_CHECKERR(avifROStreamReadBoxHeaderPartial(&headerStream, &header, /*topLevel=*/AVIF_TRUE), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  27.5k|    do {                        \
  |  |   46|  27.5k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  27.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
 4954|  27.5k|        parseOffset += avifROStreamOffset(&headerStream);
 4955|  27.5k|        AVIF_ASSERT_OR_RETURN(decoder->io->sizeHint == 0 || parseOffset <= decoder->io->sizeHint);
  ------------------
  |  |   64|  27.5k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  27.5k|    do {                        \
  |  |  |  |   46|  55.1k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (46:15): [True: 27.5k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  27.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 27.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4956|       |
 4957|       |        // Try to get the remainder of the box, if necessary
 4958|  27.5k|        uint64_t boxOffset = 0;
 4959|  27.5k|        avifROData boxContents = AVIF_DATA_EMPTY;
  ------------------
  |  |  254|  27.5k|#define AVIF_DATA_EMPTY { NULL, 0 }
  ------------------
 4960|       |
 4961|  27.5k|        avifBool isFtyp = AVIF_FALSE, isMeta = AVIF_FALSE, isMoov = AVIF_FALSE;
  ------------------
  |  |   89|  27.5k|#define AVIF_FALSE 0
  ------------------
                      avifBool isFtyp = AVIF_FALSE, isMeta = AVIF_FALSE, isMoov = AVIF_FALSE;
  ------------------
  |  |   89|  27.5k|#define AVIF_FALSE 0
  ------------------
                      avifBool isFtyp = AVIF_FALSE, isMeta = AVIF_FALSE, isMoov = AVIF_FALSE;
  ------------------
  |  |   89|  27.5k|#define AVIF_FALSE 0
  ------------------
 4962|  27.5k|        avifBool isNonSkippableVariableLengthBox = AVIF_FALSE;
  ------------------
  |  |   89|  27.5k|#define AVIF_FALSE 0
  ------------------
 4963|  27.5k|        if (!memcmp(header.type, "ftyp", 4)) {
  ------------------
  |  Branch (4963:13): [True: 13.7k, False: 13.7k]
  ------------------
 4964|  13.7k|            isFtyp = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 4965|  13.7k|            isNonSkippableVariableLengthBox = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 4966|  13.7k|        } else if (!memcmp(header.type, "meta", 4)) {
  ------------------
  |  Branch (4966:20): [True: 13.7k, False: 0]
  ------------------
 4967|  13.7k|            isMeta = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 4968|  13.7k|            isNonSkippableVariableLengthBox = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 4969|  13.7k|            metaIsSizeZero = header.isSizeZeroBox;
 4970|  13.7k|        } else if (!memcmp(header.type, "moov", 4)) {
  ------------------
  |  Branch (4970:20): [True: 0, False: 0]
  ------------------
 4971|      0|            isMoov = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 4972|      0|            isNonSkippableVariableLengthBox = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 4973|      0|        }
 4974|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 4975|       |        avifBool isMini = AVIF_FALSE;
 4976|       |        if (!isNonSkippableVariableLengthBox && !memcmp(header.type, "mini", 4)) {
 4977|       |            isMini = AVIF_TRUE;
 4978|       |            isNonSkippableVariableLengthBox = AVIF_TRUE;
 4979|       |        }
 4980|       |#endif
 4981|       |
 4982|  27.5k|        if (!isFtyp && (isNonSkippableVariableLengthBox || !memcmp(header.type, "free", 4) || !memcmp(header.type, "skip", 4) ||
  ------------------
  |  Branch (4982:13): [True: 13.7k, False: 13.7k]
  |  Branch (4982:25): [True: 13.7k, False: 0]
  |  Branch (4982:60): [True: 0, False: 0]
  |  Branch (4982:95): [True: 0, False: 0]
  ------------------
 4983|  13.7k|                        !memcmp(header.type, "mdat", 4))) {
  ------------------
  |  Branch (4983:25): [True: 0, False: 0]
  ------------------
 4984|       |            // Section 6.3.4 of ISO/IEC 14496-12:
 4985|       |            //   The FileTypeBox shall occur before any variable-length box (e.g. movie, free space, media data).
 4986|  13.7k|            AVIF_CHECKERR(ftypSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 4987|  13.7k|        }
 4988|       |
 4989|  27.5k|        if (isNonSkippableVariableLengthBox) {
  ------------------
  |  Branch (4989:13): [True: 27.5k, False: 0]
  ------------------
 4990|  27.5k|            boxOffset = parseOffset;
 4991|  27.5k|            size_t sizeToRead;
 4992|  27.5k|            if (header.isSizeZeroBox) {
  ------------------
  |  Branch (4992:17): [True: 0, False: 27.5k]
  ------------------
 4993|       |                // The box body goes till the end of the file.
 4994|      0|                if (decoder->io->sizeHint != 0 && decoder->io->sizeHint - parseOffset < SIZE_MAX) {
  ------------------
  |  Branch (4994:21): [True: 0, False: 0]
  |  Branch (4994:51): [True: 0, False: 0]
  ------------------
 4995|      0|                    sizeToRead = (size_t)(decoder->io->sizeHint - parseOffset);
 4996|      0|                } else {
 4997|      0|                    sizeToRead = SIZE_MAX; // This will get truncated. See the documentation of avifIOReadFunc.
 4998|      0|                }
 4999|  27.5k|            } else {
 5000|  27.5k|                sizeToRead = header.size;
 5001|  27.5k|            }
 5002|  27.5k|            readResult = decoder->io->read(decoder->io, 0, parseOffset, sizeToRead, &boxContents);
 5003|  27.5k|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (5003:17): [True: 0, False: 27.5k]
  ------------------
 5004|      0|                return readResult;
 5005|      0|            }
 5006|  27.5k|            if (header.isSizeZeroBox) {
  ------------------
  |  Branch (5006:17): [True: 0, False: 27.5k]
  ------------------
 5007|      0|                header.size = boxContents.size;
 5008|  27.5k|            } else if (boxContents.size != header.size) {
  ------------------
  |  Branch (5008:24): [True: 0, False: 27.5k]
  ------------------
 5009|       |                // A truncated box, bail out
 5010|      0|                return AVIF_RESULT_TRUNCATED_DATA;
 5011|      0|            }
 5012|  27.5k|        } else if (header.isSizeZeroBox) {
  ------------------
  |  Branch (5012:20): [True: 0, False: 0]
  ------------------
 5013|       |            // An unknown top level box with size 0 was found. If we reach here it means we haven't completed parsing successfully
 5014|       |            // since there are no further boxes left.
 5015|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 5016|      0|        } else if (header.size > (UINT64_MAX - parseOffset)) {
  ------------------
  |  Branch (5016:20): [True: 0, False: 0]
  ------------------
 5017|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 5018|      0|        }
 5019|  27.5k|        parseOffset += header.size;
 5020|       |
 5021|  27.5k|        if (isFtyp) {
  ------------------
  |  Branch (5021:13): [True: 13.7k, False: 13.7k]
  ------------------
 5022|  13.7k|            AVIF_CHECKERR(!ftypSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5023|  13.7k|            AVIF_CHECKERR(avifParseFileTypeBox(&ftyp, boxContents.data, boxContents.size, data->diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5024|  13.7k|            AVIF_CHECKERR(avifFileTypeIsCompatible(&ftyp), AVIF_RESULT_INVALID_FTYP);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5025|  13.7k|            ftypSeen = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 5026|  13.7k|            memcpy(data->majorBrand, ftyp.majorBrand, 4); // Remember the major brand for future AVIF_DECODER_SOURCE_AUTO decisions
 5027|  13.7k|            if (ftyp.compatibleBrandsCount > 0) {
  ------------------
  |  Branch (5027:17): [True: 13.7k, False: 0]
  ------------------
 5028|  13.7k|                AVIF_CHECKERR(avifArrayCreate(&data->compatibleBrands, sizeof(avifBrand), ftyp.compatibleBrandsCount),
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5029|  13.7k|                              AVIF_RESULT_OUT_OF_MEMORY);
 5030|  13.7k|                memcpy(data->compatibleBrands.brand, ftyp.compatibleBrands, sizeof(avifBrand) * ftyp.compatibleBrandsCount);
 5031|  13.7k|                data->compatibleBrands.count = ftyp.compatibleBrandsCount;
 5032|  13.7k|            }
 5033|  13.7k|            needsMeta = avifFileTypeHasBrand(&ftyp, "avif");
 5034|  13.7k|            needsMoov = avifFileTypeHasBrand(&ftyp, "avis");
 5035|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5036|       |            needsMini = avifFileTypeHasBrand(&ftyp, "mif3");
 5037|       |            if (needsMini) {
 5038|       |                AVIF_CHECKERR(!needsMeta, AVIF_RESULT_INVALID_FTYP);
 5039|       |                // Section O.2.1.2 of ISO/IEC 23008-12:2014, CDAM 2:
 5040|       |                //   When the 'mif3' brand is present as the major_brand of the FileTypeBox,
 5041|       |                //   the minor_version of the FileTypeBox shall be 0 or a brand that is either
 5042|       |                //   structurally compatible with the 'mif3' brand, such as a codec brand
 5043|       |                //   complying with the 'mif3' structural brand, or a brand to which the file
 5044|       |                //   conforms after the equivalent MetaBox has been transformed from
 5045|       |                //   MinimizedImageBox as specified in Clause O.4.
 5046|       |                AVIF_CHECKERR(!memcmp(ftyp.minorVersion, "\0\0\0\0", 4) || !memcmp(ftyp.minorVersion, "avif", 4),
 5047|       |                              AVIF_RESULT_BMFF_PARSE_FAILED);
 5048|       |            }
 5049|       |#endif // AVIF_ENABLE_EXPERIMENTAL_MINI
 5050|  13.7k|            needsTmap = avifFileTypeHasBrand(&ftyp, "tmap");
 5051|  13.7k|            if (needsTmap) {
  ------------------
  |  Branch (5051:17): [True: 0, False: 13.7k]
  ------------------
 5052|      0|                needsMeta = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5053|      0|            }
 5054|  13.7k|        } else if (isMeta) {
  ------------------
  |  Branch (5054:20): [True: 13.7k, False: 0]
  ------------------
 5055|  13.7k|            AVIF_CHECKERR(!metaSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5056|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5057|       |            AVIF_CHECKERR(!miniSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
 5058|       |#endif
 5059|  13.7k|            AVIF_CHECKRES(avifParseMetaBox(data->meta, boxOffset, boxContents.data, boxContents.size, data->diag));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 5060|  13.7k|            metaSeen = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 5061|       |
 5062|  32.1k|            for (uint32_t itemIndex = 0; itemIndex < data->meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (5062:42): [True: 18.4k, False: 13.7k]
  ------------------
 5063|  18.4k|                if (!memcmp(data->meta->items.item[itemIndex]->type, "tmap", 4)) {
  ------------------
  |  Branch (5063:21): [True: 0, False: 18.4k]
  ------------------
 5064|      0|                    tmapSeen = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5065|      0|                    break;
 5066|      0|                }
 5067|  18.4k|            }
 5068|       |
 5069|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5070|       |        } else if (isMini) {
 5071|       |            AVIF_CHECKERR(!metaSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
 5072|       |            AVIF_CHECKERR(!miniSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
 5073|       |            const avifBool isAvifAccordingToMinorVersion = !memcmp(ftyp.minorVersion, "avif", 4);
 5074|       |            AVIF_CHECKRES(
 5075|       |                avifParseMinimizedImageBox(data, boxOffset, boxContents.data, boxContents.size, isAvifAccordingToMinorVersion, data->diag));
 5076|       |            miniSeen = AVIF_TRUE;
 5077|       |#endif
 5078|  13.7k|        } else if (isMoov) {
  ------------------
  |  Branch (5078:20): [True: 0, False: 0]
  ------------------
 5079|      0|            AVIF_CHECKERR(!moovSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5080|      0|            AVIF_CHECKRES(
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5081|      0|                avifParseMovieBox(data, boxOffset, boxContents.data, boxContents.size, decoder->imageSizeLimit, decoder->imageDimensionLimit));
 5082|      0|            moovSeen = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5083|      0|            decoder->imageSequenceTrackPresent = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5084|      0|        }
 5085|       |
 5086|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5087|       |        if (ftypSeen && !needsMini) {
 5088|       |            // When MinimizedImageBox is present in a file, the 'mif3' brand or a derived brand that implies the 'mif3'
 5089|       |            // brand shall be the major brand or present among the compatible brands in the FileTypeBox.
 5090|       |            AVIF_CHECKERR(!miniSeen, AVIF_RESULT_BMFF_PARSE_FAILED);
 5091|       |        }
 5092|       |#endif // AVIF_ENABLE_EXPERIMENTAL_MINI
 5093|       |
 5094|       |        // See if there is enough information to consider Parse() a success and early-out:
 5095|       |        // * If the brand 'avif' is present, require a meta box
 5096|       |        // * If the brand 'avis' is present, require a moov box
 5097|       |        // * If AVIF_ENABLE_EXPERIMENTAL_MINI is defined and the brand 'mif3' is present, require a mini box
 5098|  27.5k|        avifBool sawEverythingNeeded = ftypSeen && (!needsMeta || metaSeen) && (!needsMoov || moovSeen) && (!needsTmap || tmapSeen);
  ------------------
  |  Branch (5098:40): [True: 27.5k, False: 0]
  |  Branch (5098:53): [True: 0, False: 27.5k]
  |  Branch (5098:67): [True: 13.7k, False: 13.7k]
  |  Branch (5098:81): [True: 13.7k, False: 0]
  |  Branch (5098:95): [True: 0, False: 0]
  |  Branch (5098:109): [True: 13.7k, False: 0]
  |  Branch (5098:123): [True: 0, False: 0]
  ------------------
 5099|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5100|       |        sawEverythingNeeded = sawEverythingNeeded && (!needsMini || miniSeen);
 5101|       |#endif
 5102|  27.5k|        if (sawEverythingNeeded) {
  ------------------
  |  Branch (5102:13): [True: 13.7k, False: 13.7k]
  ------------------
 5103|  13.7k|            return AVIF_RESULT_OK;
 5104|  13.7k|        }
 5105|  27.5k|    }
 5106|      0|    if (!ftypSeen) {
  ------------------
  |  Branch (5106:9): [True: 0, False: 0]
  ------------------
 5107|      0|        return AVIF_RESULT_INVALID_FTYP;
 5108|      0|    }
 5109|      0|    if ((needsMeta && !metaSeen) || (needsMoov && !moovSeen)) {
  ------------------
  |  Branch (5109:10): [True: 0, False: 0]
  |  Branch (5109:23): [True: 0, False: 0]
  |  Branch (5109:38): [True: 0, False: 0]
  |  Branch (5109:51): [True: 0, False: 0]
  ------------------
 5110|      0|        return AVIF_RESULT_TRUNCATED_DATA;
 5111|      0|    }
 5112|      0|    if (needsTmap && !tmapSeen) {
  ------------------
  |  Branch (5112:9): [True: 0, False: 0]
  |  Branch (5112:22): [True: 0, False: 0]
  ------------------
 5113|      0|        return metaIsSizeZero ? AVIF_RESULT_TRUNCATED_DATA : AVIF_RESULT_BMFF_PARSE_FAILED;
  ------------------
  |  Branch (5113:16): [True: 0, False: 0]
  ------------------
 5114|      0|    }
 5115|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 5116|       |    if (needsMini && !miniSeen) {
 5117|       |        return AVIF_RESULT_TRUNCATED_DATA;
 5118|       |    }
 5119|       |#endif
 5120|      0|    return AVIF_RESULT_OK;
 5121|      0|}
read.c:avifParseMetaBox:
 3553|  13.7k|{
 3554|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[meta]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3555|       |
 3556|  13.7k|    uint32_t flags;
 3557|  13.7k|    AVIF_CHECKERR(avifROStreamReadAndEnforceVersion(&s, 0, &flags), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3558|       |
 3559|  13.7k|    ++meta->idatID; // for tracking idat
 3560|       |
 3561|  13.7k|    avifBool firstBox = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 3562|  13.7k|    uint32_t uniqueBoxFlags = 0;
 3563|  87.3k|    while (avifROStreamHasBytesLeft(&s, 1)) {
  ------------------
  |  Branch (3563:12): [True: 73.5k, False: 13.7k]
  ------------------
 3564|  73.5k|        avifBoxHeader header;
 3565|  73.5k|        AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &header), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  73.5k|    do {                        \
  |  |   46|  73.5k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.5k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.5k]
  |  |  ------------------
  ------------------
 3566|       |
 3567|  73.5k|        if (firstBox) {
  ------------------
  |  Branch (3567:13): [True: 13.7k, False: 59.7k]
  ------------------
 3568|  13.7k|            if (!memcmp(header.type, "hdlr", 4)) {
  ------------------
  |  Branch (3568:17): [True: 13.7k, False: 0]
  ------------------
 3569|  13.7k|                uint8_t handlerType[4];
 3570|  13.7k|                AVIF_CHECKERR(avifParseHandlerBox(avifROStreamCurrent(&s), header.size, handlerType, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3571|       |                // HEIF (ISO/IEC 23008-12:2022), Section 6.2:
 3572|       |                //   The handler type for the MetaBox shall be 'pict'.
 3573|  13.7k|                if (memcmp(handlerType, "pict", 4) != 0) {
  ------------------
  |  Branch (3573:21): [True: 0, False: 13.7k]
  ------------------
 3574|      0|                    avifDiagnosticsPrintf(diag, "Box[hdlr] handler_type is not 'pict'");
 3575|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 3576|      0|                }
 3577|  13.7k|                firstBox = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 3578|  13.7k|            } else {
 3579|       |                // hdlr must be the first box!
 3580|      0|                avifDiagnosticsPrintf(diag, "Box[meta] does not have a Box[hdlr] as its first child box");
 3581|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 3582|      0|            }
 3583|  59.7k|        } else if (!memcmp(header.type, "hdlr", 4)) {
  ------------------
  |  Branch (3583:20): [True: 0, False: 59.7k]
  ------------------
 3584|      0|            avifDiagnosticsPrintf(diag, "Box[meta] contains a duplicate unique box of type 'hdlr'");
 3585|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3586|  59.7k|        } else if (!memcmp(header.type, "iloc", 4)) {
  ------------------
  |  Branch (3586:20): [True: 13.7k, False: 45.9k]
  ------------------
 3587|  13.7k|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_ILOC, "meta", "iloc", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3588|  13.7k|            AVIF_CHECKRES(avifParseItemLocationBox(meta, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3589|  45.9k|        } else if (!memcmp(header.type, "pitm", 4)) {
  ------------------
  |  Branch (3589:20): [True: 13.7k, False: 32.1k]
  ------------------
 3590|  13.7k|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_PITM, "meta", "pitm", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3591|  13.7k|            AVIF_CHECKERR(avifParsePrimaryItemBox(meta, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3592|  32.1k|        } else if (!memcmp(header.type, "idat", 4)) {
  ------------------
  |  Branch (3592:20): [True: 0, False: 32.1k]
  ------------------
 3593|      0|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_IDAT, "meta", "idat", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3594|      0|            AVIF_CHECKERR(avifParseItemDataBox(meta, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3595|  32.1k|        } else if (!memcmp(header.type, "iprp", 4)) {
  ------------------
  |  Branch (3595:20): [True: 13.7k, False: 18.4k]
  ------------------
 3596|  13.7k|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_IPRP, "meta", "iprp", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3597|  13.7k|            AVIF_CHECKRES(avifParseItemPropertiesBox(meta, rawOffset + avifROStreamOffset(&s), avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3598|  18.4k|        } else if (!memcmp(header.type, "iinf", 4)) {
  ------------------
  |  Branch (3598:20): [True: 13.7k, False: 4.61k]
  ------------------
 3599|  13.7k|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_IINF, "meta", "iinf", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3600|  13.7k|            AVIF_CHECKRES(avifParseItemInfoBox(meta, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3601|  13.7k|        } else if (!memcmp(header.type, "iref", 4)) {
  ------------------
  |  Branch (3601:20): [True: 4.61k, False: 0]
  ------------------
 3602|  4.61k|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_IREF, "meta", "iref", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3603|  4.61k|            AVIF_CHECKRES(avifParseItemReferenceBox(meta, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3604|  4.61k|        } else if (!memcmp(header.type, "grpl", 4)) {
  ------------------
  |  Branch (3604:20): [True: 0, False: 0]
  ------------------
 3605|      0|            AVIF_CHECKERR(uniqueBoxSeen(&uniqueBoxFlags, AVIF_UNIQUE_GRPL, "meta", "grpl", diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3606|      0|            AVIF_CHECKRES(avifParseGroupsListBox(meta, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3607|      0|        }
 3608|       |
 3609|  73.5k|        AVIF_CHECKERR(avifROStreamSkip(&s, header.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  73.5k|    do {                        \
  |  |   46|  73.5k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.5k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.5k]
  |  |  ------------------
  ------------------
 3610|  73.5k|    }
 3611|  13.7k|    if (firstBox) {
  ------------------
  |  Branch (3611:9): [True: 0, False: 13.7k]
  ------------------
 3612|       |        // The meta box must not be empty (it must contain at least a hdlr box)
 3613|      0|        avifDiagnosticsPrintf(diag, "Box[meta] has no child boxes");
 3614|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 3615|      0|    }
 3616|  13.7k|    return AVIF_RESULT_OK;
 3617|  13.7k|}
read.c:avifParseHandlerBox:
 2052|  13.7k|{
 2053|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[hdlr]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2054|       |
 2055|  13.7k|    AVIF_CHECK(avifROStreamReadAndEnforceVersion(&s, /*enforcedVersion=*/0, /*flags=*/NULL));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2056|       |
 2057|  13.7k|    uint32_t predefined;
 2058|  13.7k|    AVIF_CHECK(avifROStreamReadU32(&s, &predefined)); // unsigned int(32) pre_defined = 0;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2059|  13.7k|    if (predefined != 0) {
  ------------------
  |  Branch (2059:9): [True: 0, False: 13.7k]
  ------------------
 2060|      0|        avifDiagnosticsPrintf(diag, "Box[hdlr] contains a pre_defined value that is nonzero");
 2061|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2062|      0|    }
 2063|       |
 2064|  13.7k|    AVIF_CHECK(avifROStreamRead(&s, handlerType, 4)); // unsigned int(32) handler_type;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2065|       |
 2066|  55.1k|    for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (2066:21): [True: 41.3k, False: 13.7k]
  ------------------
 2067|  41.3k|        uint32_t reserved;
 2068|  41.3k|        AVIF_CHECK(avifROStreamReadU32(&s, &reserved)); // const unsigned int(32)[3] reserved = 0;
  ------------------
  |  |   36|  41.3k|    do {                        \
  |  |   37|  41.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 41.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  41.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 41.3k]
  |  |  ------------------
  ------------------
 2069|  41.3k|    }
 2070|       |
 2071|       |    // Verify that a valid string is here, but don't bother to store it
 2072|  13.7k|    AVIF_CHECK(avifROStreamReadString(&s, NULL, 0)); // string name;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2073|  13.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 2074|  13.7k|}
read.c:uniqueBoxSeen:
  835|  59.7k|{
  836|  59.7k|    const uint32_t flag = 1 << whichFlag;
  837|  59.7k|    if (*uniqueBoxFlags & flag) {
  ------------------
  |  Branch (837:9): [True: 0, False: 59.7k]
  ------------------
  838|       |        // This box has already been seen. Error!
  839|      0|        avifDiagnosticsPrintf(diagnostics, "Box[%s] contains a duplicate unique box of type '%s'", parentBoxType, boxType);
  840|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  841|      0|    }
  842|       |
  843|       |    // Mark this box as seen.
  844|  59.7k|    *uniqueBoxFlags |= flag;
  845|  59.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  59.7k|#define AVIF_TRUE 1
  ------------------
  846|  59.7k|}
read.c:avifParseItemLocationBox:
 2077|  13.7k|{
 2078|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[iloc]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2079|       |
 2080|       |    // Section 8.11.3.2 of ISO/IEC 14496-12.
 2081|  13.7k|    uint8_t version;
 2082|  13.7k|    AVIF_CHECKERR(avifROStreamReadVersionAndFlags(&s, &version, NULL), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2083|  13.7k|    if (version > 2) {
  ------------------
  |  Branch (2083:9): [True: 0, False: 13.7k]
  ------------------
 2084|      0|        avifDiagnosticsPrintf(diag, "Box[iloc] has an unsupported version [%u]", version);
 2085|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 2086|      0|    }
 2087|       |
 2088|  13.7k|    uint8_t offsetSize, lengthSize, baseOffsetSize, indexSize = 0;
 2089|  13.7k|    uint32_t reserved;
 2090|  13.7k|    AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &offsetSize, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) offset_size;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2091|  13.7k|    AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &lengthSize, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) length_size;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2092|  13.7k|    AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &baseOffsetSize, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) base_offset_size;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2093|  13.7k|    if (version == 1 || version == 2) {
  ------------------
  |  Branch (2093:9): [True: 0, False: 13.7k]
  |  Branch (2093:25): [True: 0, False: 13.7k]
  ------------------
 2094|      0|        AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &indexSize, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) index_size;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2095|  13.7k|    } else {
 2096|  13.7k|        AVIF_CHECKERR(avifROStreamReadBitsU32(&s, &reserved, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) reserved;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2097|  13.7k|    }
 2098|       |
 2099|       |    // Section 8.11.3.3 of ISO/IEC 14496-12.
 2100|  13.7k|    if ((offsetSize != 0 && offsetSize != 4 && offsetSize != 8) || (lengthSize != 0 && lengthSize != 4 && lengthSize != 8) ||
  ------------------
  |  Branch (2100:10): [True: 13.7k, False: 0]
  |  Branch (2100:29): [True: 0, False: 13.7k]
  |  Branch (2100:48): [True: 0, False: 0]
  |  Branch (2100:69): [True: 13.7k, False: 0]
  |  Branch (2100:88): [True: 0, False: 13.7k]
  |  Branch (2100:107): [True: 0, False: 0]
  ------------------
 2101|  13.7k|        (baseOffsetSize != 0 && baseOffsetSize != 4 && baseOffsetSize != 8) || (indexSize != 0 && indexSize != 4 && indexSize != 8)) {
  ------------------
  |  Branch (2101:10): [True: 0, False: 13.7k]
  |  Branch (2101:33): [True: 0, False: 0]
  |  Branch (2101:56): [True: 0, False: 0]
  |  Branch (2101:81): [True: 0, False: 13.7k]
  |  Branch (2101:99): [True: 0, False: 0]
  |  Branch (2101:117): [True: 0, False: 0]
  ------------------
 2102|      0|        avifDiagnosticsPrintf(diag, "Box[iloc] has an invalid size");
 2103|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 2104|      0|    }
 2105|       |
 2106|  13.7k|    uint16_t tmp16;
 2107|  13.7k|    uint32_t itemCount;
 2108|  13.7k|    if (version < 2) {
  ------------------
  |  Branch (2108:9): [True: 13.7k, False: 0]
  ------------------
 2109|  13.7k|        AVIF_CHECKERR(avifROStreamReadU16(&s, &tmp16), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) item_count;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2110|  13.7k|        itemCount = tmp16;
 2111|  13.7k|    } else {
 2112|      0|        AVIF_CHECKERR(avifROStreamReadU32(&s, &itemCount), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) item_count;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2113|      0|    }
 2114|  32.1k|    for (uint32_t i = 0; i < itemCount; ++i) {
  ------------------
  |  Branch (2114:26): [True: 18.4k, False: 13.7k]
  ------------------
 2115|  18.4k|        uint32_t itemID;
 2116|  18.4k|        if (version < 2) {
  ------------------
  |  Branch (2116:13): [True: 18.4k, False: 0]
  ------------------
 2117|  18.4k|            AVIF_CHECKERR(avifROStreamReadU16(&s, &tmp16), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) item_ID;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2118|  18.4k|            itemID = tmp16;
 2119|  18.4k|        } else {
 2120|      0|            AVIF_CHECKERR(avifROStreamReadU32(&s, &itemID), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) item_ID;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2121|      0|        }
 2122|  18.4k|        AVIF_CHECKRES(avifCheckItemID("iloc", itemID, diag));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2123|       |
 2124|  18.4k|        avifDecoderItem * item;
 2125|  18.4k|        AVIF_CHECKRES(avifMetaFindOrCreateItem(meta, itemID, &item));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2126|  18.4k|        if (item->extents.count > 0) {
  ------------------
  |  Branch (2126:13): [True: 0, False: 18.4k]
  ------------------
 2127|       |            // This item has already been given extents via this iloc box. This is invalid.
 2128|      0|            avifDiagnosticsPrintf(diag, "Item ID [%u] contains duplicate sets of extents", itemID);
 2129|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 2130|      0|        }
 2131|       |
 2132|  18.4k|        if (version == 1 || version == 2) {
  ------------------
  |  Branch (2132:13): [True: 0, False: 18.4k]
  |  Branch (2132:29): [True: 0, False: 18.4k]
  ------------------
 2133|      0|            AVIF_CHECKERR(avifROStreamReadBitsU32(&s, &reserved, /*bitCount=*/12), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(12) reserved = 0;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2134|      0|            if (reserved) {
  ------------------
  |  Branch (2134:17): [True: 0, False: 0]
  ------------------
 2135|      0|                avifDiagnosticsPrintf(diag, "Box[iloc] has a non null reserved field [%u]", reserved);
 2136|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2137|      0|            }
 2138|      0|            uint8_t constructionMethod;
 2139|      0|            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &constructionMethod, /*bitCount=*/4),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2140|      0|                          AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) construction_method;
 2141|      0|            if (constructionMethod != 0 /* file offset */ && constructionMethod != 1 /* idat offset */) {
  ------------------
  |  Branch (2141:17): [True: 0, False: 0]
  |  Branch (2141:62): [True: 0, False: 0]
  ------------------
 2142|       |                // construction method 2 (item offset) unsupported
 2143|      0|                avifDiagnosticsPrintf(diag, "Box[iloc] has an unsupported construction method [%u]", constructionMethod);
 2144|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2145|      0|            }
 2146|      0|            if (constructionMethod == 1) {
  ------------------
  |  Branch (2146:17): [True: 0, False: 0]
  ------------------
 2147|      0|                item->idatStored = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 2148|      0|            }
 2149|      0|        }
 2150|       |
 2151|  18.4k|        uint16_t dataReferenceIndex;
 2152|  18.4k|        AVIF_CHECKERR(avifROStreamReadU16(&s, &dataReferenceIndex), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) data_reference_index;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2153|  18.4k|        uint64_t baseOffset;
 2154|  18.4k|        AVIF_CHECKERR(avifROStreamReadUX8(&s, &baseOffset, baseOffsetSize), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(base_offset_size*8) base_offset;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2155|  18.4k|        uint16_t extentCount;
 2156|  18.4k|        AVIF_CHECKERR(avifROStreamReadU16(&s, &extentCount), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) extent_count;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2157|  92.0k|        for (int extentIter = 0; extentIter < extentCount; ++extentIter) {
  ------------------
  |  Branch (2157:34): [True: 73.6k, False: 18.4k]
  ------------------
 2158|  73.6k|            if ((version == 1 || version == 2) && indexSize > 0) {
  ------------------
  |  Branch (2158:18): [True: 0, False: 73.6k]
  |  Branch (2158:34): [True: 0, False: 73.6k]
  |  Branch (2158:51): [True: 0, False: 0]
  ------------------
 2159|       |                // Section 8.11.3.1 of ISO/IEC 14496-12:
 2160|       |                //   The item_reference_index is only used for the method item_offset; it indicates the 1-based index
 2161|       |                //   of the item reference with referenceType 'iloc' linked from this item. If index_size is 0, then
 2162|       |                //   the value 1 is implied; the value 0 is reserved.
 2163|      0|                uint64_t itemReferenceIndex; // Ignored unless construction_method=2 which is unsupported, but still read it.
 2164|      0|                AVIF_CHECKERR(avifROStreamReadUX8(&s, &itemReferenceIndex, indexSize),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2165|      0|                              AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(index_size*8) item_reference_index;
 2166|      0|            }
 2167|       |
 2168|  73.6k|            uint64_t extentOffset;
 2169|  73.6k|            AVIF_CHECKERR(avifROStreamReadUX8(&s, &extentOffset, offsetSize), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(offset_size*8) extent_offset;
  ------------------
  |  |   45|  73.6k|    do {                        \
  |  |   46|  73.6k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2170|  73.6k|            uint64_t extentLength;
 2171|  73.6k|            AVIF_CHECKERR(avifROStreamReadUX8(&s, &extentLength, lengthSize), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(length_size*8) extent_length;
  ------------------
  |  |   45|  73.6k|    do {                        \
  |  |   46|  73.6k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2172|       |
 2173|  73.6k|            avifExtent * extent = (avifExtent *)avifArrayPush(&item->extents);
 2174|  73.6k|            AVIF_CHECKERR(extent != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  73.6k|    do {                        \
  |  |   46|  73.6k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2175|  73.6k|            if (extentOffset > UINT64_MAX - baseOffset) {
  ------------------
  |  Branch (2175:17): [True: 0, False: 73.6k]
  ------------------
 2176|      0|                avifDiagnosticsPrintf(diag,
 2177|      0|                                      "Item ID [%u] contains an extent offset which overflows: [base: %" PRIu64 " offset:%" PRIu64 "]",
 2178|      0|                                      itemID,
 2179|      0|                                      baseOffset,
 2180|      0|                                      extentOffset);
 2181|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2182|      0|            }
 2183|  73.6k|            uint64_t offset = baseOffset + extentOffset;
 2184|  73.6k|            extent->offset = offset;
 2185|       |#if UINT64_MAX > SIZE_MAX
 2186|       |            if (extentLength > SIZE_MAX) {
 2187|       |                avifDiagnosticsPrintf(diag, "Item ID [%u] contains an extent length which overflows: [%" PRIu64 "]", itemID, extentLength);
 2188|       |                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2189|       |            }
 2190|       |#endif
 2191|  73.6k|            extent->size = (size_t)extentLength;
 2192|  73.6k|            if (extent->size > SIZE_MAX - item->size) {
  ------------------
  |  Branch (2192:17): [True: 0, False: 73.6k]
  ------------------
 2193|      0|                avifDiagnosticsPrintf(diag,
 2194|      0|                                      "Item ID [%u] contains an extent length which overflows the item size: [%zu, %zu]",
 2195|      0|                                      itemID,
 2196|      0|                                      extent->size,
 2197|      0|                                      item->size);
 2198|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2199|      0|            }
 2200|  73.6k|            item->size += extent->size;
 2201|  73.6k|        }
 2202|  18.4k|    }
 2203|  13.7k|    return AVIF_RESULT_OK;
 2204|  13.7k|}
read.c:avifCheckItemID:
  964|  64.4k|{
  965|       |    // Section 8.11.1.1 of ISO/IEC 14496-12 about MetaBox definition:
  966|       |    //   The item_ID value of 0 should not be used
  967|       |    // Section 8.11.6 of ISO/IEC 14496-12 about ItemInfoEntry syntax and semantics:
  968|       |    //   item_ID contains either 0 for the primary resource (e.g. the XML contained in an XMLBox)
  969|       |    //   or the ID of the item for which the following information is defined.
  970|       |    // Assuming 'infe' is the only way to properly define an item in AVIF, a compliant item cannot have an ID of zero.
  971|       |    // One way to bypass that rule would be to have 'infe' with item_ID being 0, referring to "the primary resource",
  972|       |    // and 'pitm' defining "the primary resource" as the item with an item_ID of 0. libavif considers that as invalid.
  973|  64.4k|    if (itemID == 0) {
  ------------------
  |  Branch (973:9): [True: 0, False: 64.4k]
  ------------------
  974|      0|        avifDiagnosticsPrintf(diag, "Box[%.4s] has an invalid item ID [%u]", boxFourcc, itemID);
  975|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
  976|      0|    }
  977|  64.4k|    return AVIF_RESULT_OK;
  978|  64.4k|}
read.c:avifParsePrimaryItemBox:
 3248|  13.7k|{
 3249|  13.7k|    if (meta->primaryItemID > 0) {
  ------------------
  |  Branch (3249:9): [True: 0, False: 13.7k]
  ------------------
 3250|       |        // Illegal to have multiple pitm boxes, bail out
 3251|      0|        avifDiagnosticsPrintf(diag, "Multiple boxes of unique Box[pitm] found");
 3252|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 3253|      0|    }
 3254|       |
 3255|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[pitm]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3256|       |
 3257|  13.7k|    uint8_t version;
 3258|  13.7k|    AVIF_CHECK(avifROStreamReadVersionAndFlags(&s, &version, NULL));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3259|       |
 3260|  13.7k|    if (version == 0) {
  ------------------
  |  Branch (3260:9): [True: 13.7k, False: 0]
  ------------------
 3261|  13.7k|        uint16_t tmp16;
 3262|  13.7k|        AVIF_CHECK(avifROStreamReadU16(&s, &tmp16)); // unsigned int(16) item_ID;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3263|  13.7k|        meta->primaryItemID = tmp16;
 3264|  13.7k|    } else {
 3265|      0|        AVIF_CHECK(avifROStreamReadU32(&s, &meta->primaryItemID)); // unsigned int(32) item_ID;
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3266|      0|    }
 3267|  13.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 3268|  13.7k|}
read.c:avifParseItemPropertiesBox:
 3289|  13.7k|{
 3290|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[iprp]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3291|       |
 3292|  13.7k|    avifBoxHeader ipcoHeader;
 3293|  13.7k|    AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &ipcoHeader), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3294|  13.7k|    if (memcmp(ipcoHeader.type, "ipco", 4)) {
  ------------------
  |  Branch (3294:9): [True: 0, False: 13.7k]
  ------------------
 3295|      0|        avifDiagnosticsPrintf(diag, "Failed to find Box[ipco] as the first box in Box[iprp]");
 3296|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 3297|      0|    }
 3298|       |
 3299|       |    // Read all item properties inside of ItemPropertyContainerBox
 3300|  13.7k|    AVIF_CHECKRES(avifParseItemPropertyContainerBox(&meta->properties,
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3301|  13.7k|                                                    rawOffset + avifROStreamOffset(&s),
 3302|  13.7k|                                                    avifROStreamCurrent(&s),
 3303|  13.7k|                                                    ipcoHeader.size,
 3304|  13.7k|                                                    /*isTrack=*/AVIF_FALSE,
 3305|  13.7k|                                                    diag));
 3306|  13.7k|    AVIF_CHECKERR(avifROStreamSkip(&s, ipcoHeader.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3307|       |
 3308|  13.7k|    uint32_t versionAndFlagsSeen[MAX_IPMA_VERSION_AND_FLAGS_SEEN];
 3309|  13.7k|    uint32_t versionAndFlagsSeenCount = 0;
 3310|       |
 3311|       |    // Now read all ItemPropertyAssociation until the end of the box, and make associations
 3312|  27.5k|    while (avifROStreamHasBytesLeft(&s, 1)) {
  ------------------
  |  Branch (3312:12): [True: 13.7k, False: 13.7k]
  ------------------
 3313|  13.7k|        avifBoxHeader ipmaHeader;
 3314|  13.7k|        AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &ipmaHeader), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3315|       |
 3316|  13.7k|        if (!memcmp(ipmaHeader.type, "ipma", 4)) {
  ------------------
  |  Branch (3316:13): [True: 13.7k, False: 0]
  ------------------
 3317|  13.7k|            uint32_t versionAndFlags;
 3318|  13.7k|            AVIF_CHECKRES(avifParseItemPropertyAssociation(meta, avifROStreamCurrent(&s), ipmaHeader.size, diag, &versionAndFlags));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3319|  13.7k|            for (uint32_t i = 0; i < versionAndFlagsSeenCount; ++i) {
  ------------------
  |  Branch (3319:34): [True: 0, False: 13.7k]
  ------------------
 3320|      0|                if (versionAndFlagsSeen[i] == versionAndFlags) {
  ------------------
  |  Branch (3320:21): [True: 0, False: 0]
  ------------------
 3321|       |                    // BMFF (ISO/IEC 14496-12:2022) 8.11.14.1 - There shall be at most one
 3322|       |                    // ItemPropertyAssociationBox with a given pair of values of version and
 3323|       |                    // flags.
 3324|      0|                    avifDiagnosticsPrintf(diag, "Multiple Box[ipma] with a given pair of values of version and flags. See BMFF (ISO/IEC 14496-12:2022) 8.11.14.1");
 3325|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 3326|      0|                }
 3327|      0|            }
 3328|  13.7k|            if (versionAndFlagsSeenCount == MAX_IPMA_VERSION_AND_FLAGS_SEEN) {
  ------------------
  |  |   39|  13.7k|#define MAX_IPMA_VERSION_AND_FLAGS_SEEN 4
  ------------------
  |  Branch (3328:17): [True: 0, False: 13.7k]
  ------------------
 3329|      0|                avifDiagnosticsPrintf(diag, "Exceeded possible count of unique ipma version and flags tuples");
 3330|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 3331|      0|            }
 3332|  13.7k|            versionAndFlagsSeen[versionAndFlagsSeenCount] = versionAndFlags;
 3333|  13.7k|            ++versionAndFlagsSeenCount;
 3334|  13.7k|        } else {
 3335|       |            // These must all be type ipma
 3336|      0|            avifDiagnosticsPrintf(diag, "Box[iprp] contains a box that isn't type 'ipma'");
 3337|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3338|      0|        }
 3339|       |
 3340|  13.7k|        AVIF_CHECKERR(avifROStreamSkip(&s, ipmaHeader.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3341|  13.7k|    }
 3342|  13.7k|    return AVIF_RESULT_OK;
 3343|  13.7k|}
read.c:avifParseItemPropertyContainerBox:
 3018|  13.7k|{
 3019|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[ipco]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3020|       |
 3021|  97.1k|    while (avifROStreamHasBytesLeft(&s, 1)) {
  ------------------
  |  Branch (3021:12): [True: 83.3k, False: 13.7k]
  ------------------
 3022|  83.3k|        avifBoxHeader header;
 3023|  83.3k|        AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &header), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  83.3k|    do {                        \
  |  |   46|  83.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
 3024|       |
 3025|  83.3k|        avifProperty * prop = (avifProperty *)avifArrayPush(properties);
 3026|  83.3k|        AVIF_CHECKERR(prop != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  83.3k|    do {                        \
  |  |   46|  83.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
 3027|  83.3k|        memcpy(prop->type, header.type, 4);
 3028|  83.3k|        prop->isOpaque = AVIF_FALSE;
  ------------------
  |  |   89|  83.3k|#define AVIF_FALSE 0
  ------------------
 3029|  83.3k|        if (!memcmp(header.type, "ispe", 4)) {
  ------------------
  |  Branch (3029:13): [True: 13.7k, False: 69.5k]
  ------------------
 3030|  13.7k|            AVIF_CHECKERR(avifParseImageSpatialExtentsProperty(prop, avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3031|  13.7k|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3032|  69.5k|        } else if ((!memcmp(header.type, "auxC", 4) && !isTrack) || (!memcmp(header.type, "auxi", 4) && isTrack)) {
  ------------------
  |  Branch (3032:21): [True: 4.61k, False: 64.9k]
  |  Branch (3032:56): [True: 4.61k, False: 0]
  |  Branch (3032:70): [True: 0, False: 64.9k]
  |  Branch (3032:105): [True: 0, False: 0]
  ------------------
 3033|  4.61k|            AVIF_CHECKERR(avifParseAuxiliaryTypeProperty(prop, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3034|  64.9k|        } else if (!memcmp(header.type, "colr", 4)) {
  ------------------
  |  Branch (3034:20): [True: 13.7k, False: 51.1k]
  ------------------
 3035|  13.7k|            AVIF_CHECKERR(avifParseColourInformationBox(prop, rawOffset + avifROStreamOffset(&s), avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3036|  13.7k|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3037|  51.1k|        } else if (!memcmp(header.type, "av1C", 4)) {
  ------------------
  |  Branch (3037:20): [True: 16.3k, False: 34.7k]
  ------------------
 3038|  16.3k|            AVIF_CHECKERR(avifParseCodecConfigurationBoxProperty(prop, avifROStreamCurrent(&s), header.size, "av1C", diag),
  ------------------
  |  |   45|  16.3k|    do {                        \
  |  |   46|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 3039|  16.3k|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3040|       |#if defined(AVIF_CODEC_AVM)
 3041|       |        } else if (!memcmp(header.type, "av2C", 4)) {
 3042|       |            AVIF_CHECKERR(avifParseCodecConfigurationBoxProperty(prop, avifROStreamCurrent(&s), header.size, "av2C", diag),
 3043|       |                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3044|       |#endif
 3045|  34.7k|        } else if (!memcmp(header.type, "pasp", 4)) {
  ------------------
  |  Branch (3045:20): [True: 0, False: 34.7k]
  ------------------
 3046|      0|            AVIF_CHECKERR(avifParsePixelAspectRatioBoxProperty(prop, avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3047|      0|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3048|  34.7k|        } else if (!memcmp(header.type, "clap", 4)) {
  ------------------
  |  Branch (3048:20): [True: 0, False: 34.7k]
  ------------------
 3049|      0|            AVIF_CHECKERR(avifParseCleanApertureBoxProperty(prop, avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3050|      0|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3051|  34.7k|        } else if (!memcmp(header.type, "irot", 4)) {
  ------------------
  |  Branch (3051:20): [True: 0, False: 34.7k]
  ------------------
 3052|      0|            AVIF_CHECKERR(avifParseImageRotationProperty(prop, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3053|  34.7k|        } else if (!memcmp(header.type, "imir", 4)) {
  ------------------
  |  Branch (3053:20): [True: 0, False: 34.7k]
  ------------------
 3054|      0|            AVIF_CHECKERR(avifParseImageMirrorProperty(prop, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3055|  34.7k|        } else if (!memcmp(header.type, "pixi", 4)) {
  ------------------
  |  Branch (3055:20): [True: 16.3k, False: 18.4k]
  ------------------
 3056|  16.3k|            AVIF_CHECKRES(avifParsePixelInformationProperty(prop, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|  16.3k|    do {                                  \
  |  |   55|  16.3k|        const avifResult result__ = (A);  \
  |  |   56|  16.3k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 3057|  18.4k|        } else if (!memcmp(header.type, "a1op", 4)) {
  ------------------
  |  Branch (3057:20): [True: 0, False: 18.4k]
  ------------------
 3058|      0|            AVIF_CHECKERR(avifParseOperatingPointSelectorProperty(prop, avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3059|      0|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3060|  18.4k|        } else if (!memcmp(header.type, "lsel", 4)) {
  ------------------
  |  Branch (3060:20): [True: 0, False: 18.4k]
  ------------------
 3061|      0|            AVIF_CHECKERR(avifParseLayerSelectorProperty(prop, avifROStreamCurrent(&s), header.size, diag), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3062|  18.4k|        } else if (!memcmp(header.type, "a1lx", 4)) {
  ------------------
  |  Branch (3062:20): [True: 18.4k, False: 0]
  ------------------
 3063|  18.4k|            AVIF_CHECKERR(avifParseAV1LayeredImageIndexingProperty(prop, avifROStreamCurrent(&s), header.size, diag),
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3064|  18.4k|                          AVIF_RESULT_BMFF_PARSE_FAILED);
 3065|  18.4k|        } else if (!memcmp(header.type, "clli", 4)) {
  ------------------
  |  Branch (3065:20): [True: 0, False: 0]
  ------------------
 3066|      0|            AVIF_CHECKRES(avifParseContentLightLevelInformationBox(prop, avifROStreamCurrent(&s), header.size, diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3067|      0|        } else {
 3068|      0|            prop->isOpaque = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3069|      0|            memset(&prop->u.opaque, 0, sizeof(prop->u.opaque));
 3070|      0|            memcpy(prop->u.opaque.usertype, header.usertype, sizeof(prop->u.opaque.usertype));
 3071|      0|            AVIF_CHECKRES(avifRWDataSet(&prop->u.opaque.boxPayload, avifROStreamCurrent(&s), header.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3072|      0|        }
 3073|       |
 3074|  83.3k|        AVIF_CHECKERR(avifROStreamSkip(&s, header.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  83.3k|    do {                        \
  |  |   46|  83.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
 3075|  83.3k|    }
 3076|  13.7k|    return AVIF_RESULT_OK;
 3077|  13.7k|}
read.c:avifParseImageSpatialExtentsProperty:
 2571|  13.7k|{
 2572|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[ispe]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2573|  13.7k|    AVIF_CHECK(avifROStreamReadAndEnforceVersion(&s, /*enforcedVersion=*/0, /*flags=*/NULL));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2574|       |
 2575|  13.7k|    avifImageSpatialExtents * ispe = &prop->u.ispe;
 2576|  13.7k|    AVIF_CHECK(avifROStreamReadU32(&s, &ispe->width));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2577|  13.7k|    AVIF_CHECK(avifROStreamReadU32(&s, &ispe->height));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2578|  13.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 2579|  13.7k|}
read.c:avifParseAuxiliaryTypeProperty:
 2582|  4.61k|{
 2583|  4.61k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[auxC]");
  ------------------
  |  |  810|  4.61k|    avifROStream VARNAME;                               \
  |  |  811|  4.61k|    avifROData VARNAME##_roData;                        \
  |  |  812|  4.61k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  4.61k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  4.61k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2584|  4.61k|    AVIF_CHECK(avifROStreamReadAndEnforceVersion(&s, /*enforcedVersion=*/0, /*flags=*/NULL));
  ------------------
  |  |   36|  4.61k|    do {                        \
  |  |   37|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 2585|       |
 2586|  4.61k|    AVIF_CHECK(avifROStreamReadString(&s, prop->u.auxC.auxType, AUXTYPE_SIZE));
  ------------------
  |  |   36|  4.61k|    do {                        \
  |  |   37|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 2587|  4.61k|    return AVIF_TRUE;
  ------------------
  |  |   88|  4.61k|#define AVIF_TRUE 1
  ------------------
 2588|  4.61k|}
read.c:avifParseColourInformationBox:
 2591|  13.7k|{
 2592|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[colr]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2593|       |
 2594|  13.7k|    avifColourInformationBox * colr = &prop->u.colr;
 2595|  13.7k|    colr->hasICC = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 2596|  13.7k|    colr->hasNCLX = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 2597|       |
 2598|  13.7k|    uint8_t colorType[4]; // unsigned int(32) colour_type;
 2599|  13.7k|    AVIF_CHECK(avifROStreamRead(&s, colorType, 4));
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2600|  13.7k|    if (!memcmp(colorType, "rICC", 4) || !memcmp(colorType, "prof", 4)) {
  ------------------
  |  Branch (2600:9): [True: 0, False: 13.7k]
  |  Branch (2600:42): [True: 0, False: 13.7k]
  ------------------
 2601|       |        // Remember the offset of the ICC payload relative to the beginning of the stream. A direct pointer cannot be stored
 2602|       |        // because decoder->io->persistent could have been AVIF_FALSE when obtaining raw through decoder->io->read().
 2603|       |        // The bytes could be copied now instead of remembering the offset, but it is as invasive as passing rawOffset everywhere.
 2604|      0|        colr->iccOffset = rawOffset + avifROStreamOffset(&s);
 2605|      0|        colr->iccSize = avifROStreamRemainingBytes(&s);
 2606|      0|        if (colr->iccSize == 0) {
  ------------------
  |  Branch (2606:13): [True: 0, False: 0]
  ------------------
 2607|      0|            avifDiagnosticsPrintf(diag, "Box[colr] contains empty ICC_profile");
 2608|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2609|      0|        }
 2610|      0|        colr->hasICC = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 2611|  13.7k|    } else if (!memcmp(colorType, "nclx", 4)) {
  ------------------
  |  Branch (2611:16): [True: 13.7k, False: 0]
  ------------------
 2612|  13.7k|        AVIF_CHECK(avifROStreamReadU16(&s, &colr->colorPrimaries));          // unsigned int(16) colour_primaries;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2613|  13.7k|        AVIF_CHECK(avifROStreamReadU16(&s, &colr->transferCharacteristics)); // unsigned int(16) transfer_characteristics;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2614|  13.7k|        AVIF_CHECK(avifROStreamReadU16(&s, &colr->matrixCoefficients));      // unsigned int(16) matrix_coefficients;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2615|  13.7k|        uint8_t full_range_flag;
 2616|  13.7k|        AVIF_CHECK(avifROStreamReadBitsU8(&s, &full_range_flag, /*bitCount=*/1)); // unsigned int(1) full_range_flag;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2617|  13.7k|        colr->range = full_range_flag ? AVIF_RANGE_FULL : AVIF_RANGE_LIMITED;
  ------------------
  |  Branch (2617:23): [True: 13.7k, False: 0]
  ------------------
 2618|  13.7k|        uint8_t reserved;
 2619|  13.7k|        AVIF_CHECK(avifROStreamReadBitsU8(&s, &reserved, /*bitCount=*/7)); // unsigned int(7) reserved = 0;
  ------------------
  |  |   36|  13.7k|    do {                        \
  |  |   37|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2620|  13.7k|        if (reserved) {
  ------------------
  |  Branch (2620:13): [True: 0, False: 13.7k]
  ------------------
 2621|      0|            avifDiagnosticsPrintf(diag, "Box[colr] contains nonzero reserved bits [%u]", reserved);
 2622|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2623|      0|        }
 2624|  13.7k|        colr->hasNCLX = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 2625|  13.7k|    }
 2626|  13.7k|    return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 2627|  13.7k|}
read.c:avifParseCodecConfigurationBoxProperty:
 2802|  16.3k|{
 2803|  16.3k|    char diagContext[10];
 2804|  16.3k|    snprintf(diagContext, sizeof(diagContext), "Box[%.4s]", configPropName); // "Box[av1C]" or "Box[av2C]"
 2805|  16.3k|    BEGIN_STREAM(s, raw, rawLen, diag, diagContext);
  ------------------
  |  |  810|  16.3k|    avifROStream VARNAME;                               \
  |  |  811|  16.3k|    avifROData VARNAME##_roData;                        \
  |  |  812|  16.3k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  16.3k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  16.3k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2806|  16.3k|    return avifParseCodecConfiguration(&s, &prop->u.av1C, configPropName, diag);
 2807|  16.3k|}
read.c:avifParseCodecConfiguration:
 2748|  16.3k|{
 2749|  16.3k|    const size_t av1COffset = avifROStreamOffset(s);
 2750|       |
 2751|  16.3k|    uint32_t marker, version;
 2752|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU32(s, &marker, /*bitCount=*/1)); // unsigned int (1) marker = 1;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2753|  16.3k|    if (!marker) {
  ------------------
  |  Branch (2753:9): [True: 0, False: 16.3k]
  ------------------
 2754|      0|        avifDiagnosticsPrintf(diag, "%.4s contains illegal marker: [%u]", configPropName, marker);
 2755|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2756|      0|    }
 2757|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU32(s, &version, /*bitCount=*/7)); // unsigned int (7) version = 1;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2758|  16.3k|    if (version != 1) {
  ------------------
  |  Branch (2758:9): [True: 0, False: 16.3k]
  ------------------
 2759|      0|        avifDiagnosticsPrintf(diag, "%.4s contains illegal version: [%u]", configPropName, version);
 2760|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2761|      0|    }
 2762|       |
 2763|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->seqProfile, /*bitCount=*/3));         // unsigned int (3) seq_profile;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2764|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->seqLevelIdx0, /*bitCount=*/5));       // unsigned int (5) seq_level_idx_0;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2765|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->seqTier0, /*bitCount=*/1));           // unsigned int (1) seq_tier_0;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2766|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->highBitdepth, /*bitCount=*/1));       // unsigned int (1) high_bitdepth;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2767|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->twelveBit, /*bitCount=*/1));          // unsigned int (1) twelve_bit;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2768|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->monochrome, /*bitCount=*/1));         // unsigned int (1) monochrome;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2769|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->chromaSubsamplingX, /*bitCount=*/1)); // unsigned int (1) chroma_subsampling_x;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2770|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->chromaSubsamplingY, /*bitCount=*/1)); // unsigned int (1) chroma_subsampling_y;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2771|  16.3k|    AVIF_CHECK(avifROStreamReadBitsU8(s, &config->chromaSamplePosition, /*bitCount=*/2)); // unsigned int (2) chroma_sample_position;
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2772|       |
 2773|       |    // unsigned int (3) reserved = 0;
 2774|       |    // unsigned int (1) initial_presentation_delay_present;
 2775|       |    // if (initial_presentation_delay_present) {
 2776|       |    //   unsigned int (4) initial_presentation_delay_minus_one;
 2777|       |    // } else {
 2778|       |    //   unsigned int (4) reserved = 0;
 2779|       |    // }
 2780|  16.3k|    AVIF_CHECK(avifROStreamSkip(s, /*byteCount=*/1));
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2781|       |
 2782|       |    // According to section 2.2.1 of AV1 Image File Format specification v1.1.0:
 2783|       |    //   - Sequence Header OBUs should not be present in the AV1CodecConfigurationBox.
 2784|       |    //   - If a Sequence Header OBU is present in the AV1CodecConfigurationBox,
 2785|       |    //     it shall match the Sequence Header OBU in the AV1 Image Item Data.
 2786|       |    //   - Metadata OBUs, if present, shall match the values given in other item properties,
 2787|       |    //     such as the PixelInformationProperty or ColourInformationBox.
 2788|       |    // See https://aomediacodec.github.io/av1-avif/v1.1.0.html#av1-configuration-item-property.
 2789|       |    // For simplicity, the constraints above are not enforced.
 2790|       |    // The following is skipped by avifParseItemPropertyContainerBox().
 2791|       |    // unsigned int (8) configOBUs[];
 2792|       |
 2793|  16.3k|    AVIF_CHECK(avifROStreamOffset(s) - av1COffset == 4); // Make sure avifParseCodecConfiguration() reads exactly 4 bytes.
  ------------------
  |  |   36|  16.3k|    do {                        \
  |  |   37|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2794|  16.3k|    return AVIF_TRUE;
  ------------------
  |  |   88|  16.3k|#define AVIF_TRUE 1
  ------------------
 2795|  16.3k|}
read.c:avifParsePixelInformationProperty:
 2866|  16.3k|{
 2867|  16.3k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[pixi]");
  ------------------
  |  |  810|  16.3k|    avifROStream VARNAME;                               \
  |  |  811|  16.3k|    avifROData VARNAME##_roData;                        \
  |  |  812|  16.3k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  16.3k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  16.3k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2868|  16.3k|    uint32_t flags = 0; // px_flags
 2869|  16.3k|    AVIF_CHECKERR(avifROStreamReadAndEnforceVersion(&s, /*enforcedVersion=*/0, &flags), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  16.3k|    do {                        \
  |  |   46|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2870|       |
 2871|  16.3k|    avifPixelInformationProperty * pixi = &prop->u.pixi;
 2872|  16.3k|    AVIF_CHECKERR(avifROStreamRead(&s, &pixi->planeCount, 1), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int (8) num_channels;
  ------------------
  |  |   45|  16.3k|    do {                        \
  |  |   46|  16.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 2873|  16.3k|    if (pixi->planeCount < 1 || pixi->planeCount > MAX_PIXI_PLANE_DEPTHS) {
  ------------------
  |  |  122|  16.3k|#define MAX_PIXI_PLANE_DEPTHS 4
  ------------------
  |  Branch (2873:9): [True: 0, False: 16.3k]
  |  Branch (2873:33): [True: 0, False: 16.3k]
  ------------------
 2874|      0|        avifDiagnosticsPrintf(diag, "Box[pixi] contains unsupported plane count [%u]", pixi->planeCount);
 2875|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 2876|      0|    }
 2877|  46.7k|    for (uint8_t i = 0; i < pixi->planeCount; ++i) {
  ------------------
  |  Branch (2877:25): [True: 30.3k, False: 16.3k]
  ------------------
 2878|  30.3k|        AVIF_CHECKERR(avifROStreamRead(&s, &pixi->planeDepths[i], 1), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int (8) bits_per_channel;
  ------------------
  |  |   45|  30.3k|    do {                        \
  |  |   46|  30.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 30.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  30.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 30.3k]
  |  |  ------------------
  ------------------
 2879|  30.3k|        if (pixi->planeDepths[i] == 0) {
  ------------------
  |  Branch (2879:13): [True: 0, False: 30.3k]
  ------------------
 2880|      0|            avifDiagnosticsPrintf(diag, "Box[pixi] plane depth shall not be 0 for channel %u", i);
 2881|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 2882|      0|        }
 2883|  30.3k|        if (pixi->planeDepths[i] > 16) {
  ------------------
  |  Branch (2883:13): [True: 0, False: 30.3k]
  ------------------
 2884|      0|            avifDiagnosticsPrintf(diag, "Box[pixi] plane depth %d is not supported", (int)pixi->planeDepths[i]);
 2885|      0|            return AVIF_RESULT_NOT_IMPLEMENTED;
 2886|      0|        }
 2887|  30.3k|        if (pixi->planeDepths[i] != pixi->planeDepths[0]) {
  ------------------
  |  Branch (2887:13): [True: 0, False: 30.3k]
  ------------------
 2888|      0|            avifDiagnosticsPrintf(diag,
 2889|      0|                                  "Box[pixi] contains unsupported mismatched plane depths [%u != %u]",
 2890|      0|                                  pixi->planeDepths[i],
 2891|      0|                                  pixi->planeDepths[0]);
 2892|      0|            return AVIF_RESULT_NOT_IMPLEMENTED;
 2893|      0|        }
 2894|  30.3k|    }
 2895|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI)
 2896|       |    if (flags & 1) {
 2897|       |        for (uint8_t i = 0; i < pixi->planeCount; ++i) {
 2898|       |            uint8_t channelIdc, reserved, componentFormat, channelLabelFlag;
 2899|       |            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &channelIdc, /*bitCount=*/3), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(3) channel_idc;
 2900|       |            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &reserved, /*bitCount=*/1), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(1) reserved = 0;
 2901|       |            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &componentFormat, /*bitCount=*/2), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(2) component_format;
 2902|       |            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &pixi->subsamplingFlag[i], /*bitCount=*/1),
 2903|       |                          AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(1) subsampling_flag;
 2904|       |            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &channelLabelFlag, /*bitCount=*/1),
 2905|       |                          AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(1) channel_label_flag;
 2906|       |            if (pixi->subsamplingFlag[i]) {
 2907|       |                AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &pixi->subsamplingType[i], /*bitCount=*/4),
 2908|       |                              AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) subsampling_type;
 2909|       |                AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &pixi->subsamplingLocation[i], /*bitCount=*/4),
 2910|       |                              AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) subsampling_location;
 2911|       |            }
 2912|       |
 2913|       |            // ISO/IEC 23008-12:2024/CDAM 2:2025 section 6.5.6.3:
 2914|       |            //   This field indicates the contents of the channel. A value of 0 indicates colour/grayscale. A value of
 2915|       |            //   1 indicates alpha. A value of 2 indicates depth. Values 3-7 are reserved for future use. At most one
 2916|       |            //   channel shall have a channel_idc of 1.
 2917|       |            if (channelIdc != 0) {
 2918|       |                avifDiagnosticsPrintf(diag, "Box[pixi] contains unsupported channel_idc %u for channel %u", channelIdc, i);
 2919|       |                return AVIF_RESULT_NOT_IMPLEMENTED;
 2920|       |            }
 2921|       |            if (reserved != 0) {
 2922|       |                avifDiagnosticsPrintf(diag, "Box[pixi] contains non-zero reserved field %u for channel %u", reserved, i);
 2923|       |                return AVIF_RESULT_BMFF_PARSE_FAILED;
 2924|       |            }
 2925|       |            // ISO/IEC 23008-12:2024/CDAM 2:2025 section 6.5.6.3:
 2926|       |            //   component_format: This field indicates the data type of the channel as defined by the component_format
 2927|       |            //   values in ISO/IEC 23001-17 where component_bit_depth is considered to be equal to bits_per_channel.
 2928|       |            // ISO/IEC 23001-17 section 5.2.1.2:
 2929|       |            //   component_format: When equal to 0, component value is an unsigned integer coded on component_bit_depth bits.
 2930|       |            if (componentFormat != 0) {
 2931|       |                avifDiagnosticsPrintf(diag, "Box[pixi] contains unsupported component_format %u for channel %u", componentFormat, i);
 2932|       |                return AVIF_RESULT_NOT_IMPLEMENTED;
 2933|       |            }
 2934|       |            if (pixi->subsamplingFlag[i]) {
 2935|       |                if (pixi->subsamplingType[i] >= AVIF_PIXI_SUBSAMPLING_RESERVED) {
 2936|       |                    avifDiagnosticsPrintf(diag,
 2937|       |                                          "Box[pixi] contains reserved subsampling_type %u for channel %u",
 2938|       |                                          pixi->subsamplingType[i],
 2939|       |                                          i);
 2940|       |                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 2941|       |                }
 2942|       |                if (pixi->subsamplingLocation[i] > 4) {
 2943|       |                    avifDiagnosticsPrintf(diag,
 2944|       |                                          "Box[pixi] contains reserved subsampling_location %u for channel %u",
 2945|       |                                          pixi->subsamplingLocation[i],
 2946|       |                                          i);
 2947|       |                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 2948|       |                }
 2949|       |            }
 2950|       |            if (channelLabelFlag) {
 2951|       |                AVIF_CHECKERR(avifROStreamReadString(&s, NULL, 0), AVIF_RESULT_BMFF_PARSE_FAILED); // utf8string channel_label; (skipped)
 2952|       |            }
 2953|       |        }
 2954|       |    }
 2955|       |#endif // AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI
 2956|  16.3k|    return AVIF_RESULT_OK;
 2957|  16.3k|}
read.c:avifParseAV1LayeredImageIndexingProperty:
 2986|  18.4k|{
 2987|  18.4k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[a1lx]");
  ------------------
  |  |  810|  18.4k|    avifROStream VARNAME;                               \
  |  |  811|  18.4k|    avifROData VARNAME##_roData;                        \
  |  |  812|  18.4k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  18.4k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  18.4k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2988|       |
 2989|  18.4k|    avifAV1LayeredImageIndexingProperty * a1lx = &prop->u.a1lx;
 2990|       |
 2991|  18.4k|    uint8_t largeSize = 0;
 2992|  18.4k|    AVIF_CHECK(avifROStreamRead(&s, &largeSize, 1));
  ------------------
  |  |   36|  18.4k|    do {                        \
  |  |   37|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2993|  18.4k|    if (largeSize & 0xFE) {
  ------------------
  |  Branch (2993:9): [True: 0, False: 18.4k]
  ------------------
 2994|      0|        avifDiagnosticsPrintf(diag, "Box[a1lx] has bits set in the reserved section [%u]", largeSize);
 2995|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2996|      0|    }
 2997|       |
 2998|  73.6k|    for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (2998:21): [True: 55.2k, False: 18.4k]
  ------------------
 2999|  55.2k|        if (largeSize) {
  ------------------
  |  Branch (2999:13): [True: 6, False: 55.2k]
  ------------------
 3000|      6|            AVIF_CHECK(avifROStreamReadU32(&s, &a1lx->layerSize[i]));
  ------------------
  |  |   36|      6|    do {                        \
  |  |   37|      6|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 6]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
 3001|  55.2k|        } else {
 3002|  55.2k|            uint16_t layerSize16;
 3003|  55.2k|            AVIF_CHECK(avifROStreamReadU16(&s, &layerSize16));
  ------------------
  |  |   36|  55.2k|    do {                        \
  |  |   37|  55.2k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 55.2k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  55.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 55.2k]
  |  |  ------------------
  ------------------
 3004|  55.2k|            a1lx->layerSize[i] = (uint32_t)layerSize16;
 3005|  55.2k|        }
 3006|  55.2k|    }
 3007|       |
 3008|       |    // Layer sizes will be validated later (when the item's size is known)
 3009|  18.4k|    return AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 3010|  18.4k|}
read.c:avifParseItemPropertyAssociation:
 3080|  13.7k|{
 3081|       |    // NOTE: If this function ever adds support for versions other than [0,1] or flags other than
 3082|       |    //       [0,1], please increase the value of MAX_IPMA_VERSION_AND_FLAGS_SEEN accordingly.
 3083|       |
 3084|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[ipma]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3085|       |
 3086|  13.7k|    uint8_t version;
 3087|  13.7k|    uint32_t flags;
 3088|  13.7k|    AVIF_CHECKERR(avifROStreamReadVersionAndFlags(&s, &version, &flags), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3089|  13.7k|    avifBool propertyIndexIsU15 = ((flags & 0x1) != 0);
 3090|  13.7k|    *outVersionAndFlags = ((uint32_t)version << 24) | flags;
 3091|       |
 3092|  13.7k|    uint32_t entryCount;
 3093|  13.7k|    AVIF_CHECKERR(avifROStreamReadU32(&s, &entryCount), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3094|  13.7k|    unsigned int prevItemID = 0;
 3095|  32.1k|    for (uint32_t entryIndex = 0; entryIndex < entryCount; ++entryIndex) {
  ------------------
  |  Branch (3095:35): [True: 18.4k, False: 13.7k]
  ------------------
 3096|       |        // ISO/IEC 14496-12, Seventh edition, 2022-01, Section 8.11.14.1:
 3097|       |        //   Each ItemPropertyAssociationBox shall be ordered by increasing item_ID, and there shall
 3098|       |        //   be at most one occurrence of a given item_ID, in the set of ItemPropertyAssociationBox
 3099|       |        //   boxes.
 3100|  18.4k|        unsigned int itemID;
 3101|  18.4k|        if (version < 1) {
  ------------------
  |  Branch (3101:13): [True: 18.4k, False: 0]
  ------------------
 3102|  18.4k|            uint16_t tmp;
 3103|  18.4k|            AVIF_CHECKERR(avifROStreamReadU16(&s, &tmp), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3104|  18.4k|            itemID = tmp;
 3105|  18.4k|        } else {
 3106|      0|            AVIF_CHECKERR(avifROStreamReadU32(&s, &itemID), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3107|      0|        }
 3108|  18.4k|        AVIF_CHECKRES(avifCheckItemID("ipma", itemID, diag));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3109|  18.4k|        if (itemID <= prevItemID) {
  ------------------
  |  Branch (3109:13): [True: 0, False: 18.4k]
  ------------------
 3110|      0|            avifDiagnosticsPrintf(diag, "Box[ipma] item IDs are not ordered by increasing ID");
 3111|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3112|      0|        }
 3113|  18.4k|        prevItemID = itemID;
 3114|       |
 3115|  18.4k|        avifDecoderItem * item;
 3116|  18.4k|        AVIF_CHECKRES(avifMetaFindOrCreateItem(meta, itemID, &item));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3117|  18.4k|        if (item->ipmaSeen) {
  ------------------
  |  Branch (3117:13): [True: 0, False: 18.4k]
  ------------------
 3118|      0|            avifDiagnosticsPrintf(diag, "Duplicate Box[ipma] for item ID [%u]", itemID);
 3119|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3120|      0|        }
 3121|  18.4k|        item->ipmaSeen = AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 3122|       |
 3123|  18.4k|        uint8_t associationCount;
 3124|  18.4k|        AVIF_CHECKERR(avifROStreamRead(&s, &associationCount, 1), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3125|   110k|        for (uint8_t associationIndex = 0; associationIndex < associationCount; ++associationIndex) {
  ------------------
  |  Branch (3125:44): [True: 92.0k, False: 18.4k]
  ------------------
 3126|  92.0k|            uint8_t essential;
 3127|  92.0k|            AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &essential, /*bitCount=*/1), AVIF_RESULT_BMFF_PARSE_FAILED); // bit(1) essential;
  ------------------
  |  |   45|  92.0k|    do {                        \
  |  |   46|  92.0k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
 3128|  92.0k|            uint32_t propertyIndex;
 3129|  92.0k|            AVIF_CHECKERR(avifROStreamReadBitsU32(&s, &propertyIndex, /*bitCount=*/propertyIndexIsU15 ? 15 : 7),
  ------------------
  |  |   45|  92.0k|    do {                        \
  |  |   46|   184k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 92.0k]
  |  |  |  Branch (46:15): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
 3130|  92.0k|                          AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(7/15) property_index;
 3131|       |
 3132|       |            // ISO/IEC 14496-12 Section 8.11.14.3:
 3133|       |            //   0 indicating that no property is associated (the essential indicator shall also be 0)
 3134|  92.0k|            if (propertyIndex == 0) {
  ------------------
  |  Branch (3134:17): [True: 0, False: 92.0k]
  ------------------
 3135|      0|                if (essential) {
  ------------------
  |  Branch (3135:21): [True: 0, False: 0]
  ------------------
 3136|      0|                    avifDiagnosticsPrintf(diag, "Box[ipma] for item ID [%u] contains an illegal essential property index 0", itemID);
 3137|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 3138|      0|                }
 3139|      0|                continue;
 3140|      0|            }
 3141|  92.0k|            --propertyIndex; // 1-indexed
 3142|       |
 3143|  92.0k|            if (propertyIndex >= meta->properties.count) {
  ------------------
  |  Branch (3143:17): [True: 0, False: 92.0k]
  ------------------
 3144|      0|                avifDiagnosticsPrintf(diag,
 3145|      0|                                      "Box[ipma] for item ID [%u] contains an illegal property index [%u] (out of [%u] properties)",
 3146|      0|                                      itemID,
 3147|      0|                                      propertyIndex,
 3148|      0|                                      meta->properties.count);
 3149|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 3150|      0|            }
 3151|       |
 3152|       |            // Copy property to item
 3153|  92.0k|            const avifProperty * srcProp = &meta->properties.prop[propertyIndex];
 3154|       |
 3155|       |            // Some properties are supported and parsed by libavif.
 3156|       |            // Other properties are forwarded to the user as opaque blobs.
 3157|  92.0k|            const avifBool supportedType = !srcProp->isOpaque;
 3158|  92.0k|            if (supportedType) {
  ------------------
  |  Branch (3158:17): [True: 92.0k, False: 0]
  ------------------
 3159|  92.0k|                if (essential) {
  ------------------
  |  Branch (3159:21): [True: 18.4k, False: 73.6k]
  ------------------
 3160|       |                    // Verify that it is legal for this property to be flagged as essential. Any
 3161|       |                    // types in this list are *required* in the spec to not be flagged as essential
 3162|       |                    // when associated with an item.
 3163|  18.4k|                    static const char * const nonessentialTypes[] = {
 3164|       |
 3165|       |                        // AVIF: Section 2.3.2.3.2: "If associated, it shall not be marked as essential."
 3166|  18.4k|                        "a1lx"
 3167|       |
 3168|  18.4k|                    };
 3169|  18.4k|                    size_t nonessentialTypesCount = sizeof(nonessentialTypes) / sizeof(nonessentialTypes[0]);
 3170|  36.8k|                    for (size_t i = 0; i < nonessentialTypesCount; ++i) {
  ------------------
  |  Branch (3170:40): [True: 18.4k, False: 18.4k]
  ------------------
 3171|  18.4k|                        if (!memcmp(srcProp->type, nonessentialTypes[i], 4)) {
  ------------------
  |  Branch (3171:29): [True: 0, False: 18.4k]
  ------------------
 3172|      0|                            avifDiagnosticsPrintf(diag,
 3173|      0|                                                  "Item ID [%u] has a %s property association which must not be marked essential, but is",
 3174|      0|                                                  itemID,
 3175|      0|                                                  nonessentialTypes[i]);
 3176|      0|                            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3177|      0|                        }
 3178|  18.4k|                    }
 3179|  73.6k|                } else {
 3180|       |                    // Verify that it is legal for this property to not be flagged as essential. Any
 3181|       |                    // types in this list are *required* in the spec to be flagged as essential when
 3182|       |                    // associated with an item.
 3183|  73.6k|                    static const char * const essentialTypes[] = {
 3184|       |
 3185|       |                        // AVIF: Section 2.3.2.1.1: "If associated, it shall be marked as essential."
 3186|  73.6k|                        "a1op",
 3187|       |
 3188|       |                        // HEIF: Section 6.5.11.1: "essential shall be equal to 1 for an 'lsel' item property."
 3189|  73.6k|                        "lsel",
 3190|       |
 3191|       |                        // MIAF 2019/Amd. 2:2021: Section 7.3.9:
 3192|       |                        //   All transformative properties associated with coded and derived images shall be
 3193|       |                        //   marked as essential
 3194|       |                        // It makes no sense to allow for non-essential crop/orientation associated with an item
 3195|       |                        // that is not a coded or derived image, so for simplicity 'item' is not checked here.
 3196|  73.6k|                        "clap",
 3197|  73.6k|                        "irot",
 3198|  73.6k|                        "imir"
 3199|       |
 3200|  73.6k|                    };
 3201|  73.6k|                    size_t essentialTypesCount = sizeof(essentialTypes) / sizeof(essentialTypes[0]);
 3202|   441k|                    for (size_t i = 0; i < essentialTypesCount; ++i) {
  ------------------
  |  Branch (3202:40): [True: 368k, False: 73.6k]
  ------------------
 3203|   368k|                        if (!memcmp(srcProp->type, essentialTypes[i], 4)) {
  ------------------
  |  Branch (3203:29): [True: 0, False: 368k]
  ------------------
 3204|      0|                            avifDiagnosticsPrintf(diag,
 3205|      0|                                                  "Item ID [%u] has a %s property association which must be marked essential, but is not",
 3206|      0|                                                  itemID,
 3207|      0|                                                  essentialTypes[i]);
 3208|      0|                            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3209|      0|                        }
 3210|   368k|                    }
 3211|  73.6k|                }
 3212|       |
 3213|       |                // Supported and valid; associate it with this item.
 3214|  92.0k|                avifProperty * dstProp = (avifProperty *)avifArrayPush(&item->properties);
 3215|  92.0k|                AVIF_CHECKERR(dstProp != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  92.0k|    do {                        \
  |  |   46|  92.0k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
 3216|  92.0k|                *dstProp = *srcProp;
 3217|  92.0k|            } else {
 3218|      0|                if (essential) {
  ------------------
  |  Branch (3218:21): [True: 0, False: 0]
  ------------------
 3219|       |                    // ISO/IEC 23008-12 Section 10.2.1:
 3220|       |                    //   Under any brand, the primary item (or an alternative if alternative support is required)
 3221|       |                    //   shall be processable by a reader implementing only the required features of that brand.
 3222|       |                    //   Specifically, given that each brand has a set of properties that a reader is required to
 3223|       |                    //   support: the item shall not have properties that are marked as essential and are outside
 3224|       |                    //   this set.
 3225|       |                    // It is assumed that this rule also applies to items the primary item depends on (such as
 3226|       |                    // the cells of a grid).
 3227|       |
 3228|       |                    // Discovered an essential item property that libavif doesn't support!
 3229|       |                    // Make a note to ignore this item later.
 3230|      0|                    item->hasUnsupportedEssentialProperty = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3231|      0|                }
 3232|       |
 3233|       |                // Will be forwarded to the user through avifImage::properties.
 3234|      0|                avifProperty * dstProp = (avifProperty *)avifArrayPush(&item->properties);
 3235|      0|                AVIF_CHECKERR(dstProp != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3236|      0|                dstProp->isOpaque = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3237|      0|                memcpy(dstProp->type, srcProp->type, sizeof(dstProp->type));
 3238|      0|                memcpy(dstProp->u.opaque.usertype, srcProp->u.opaque.usertype, sizeof(dstProp->u.opaque.usertype));
 3239|      0|                AVIF_CHECKRES(
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3240|      0|                    avifRWDataSet(&dstProp->u.opaque.boxPayload, srcProp->u.opaque.boxPayload.data, srcProp->u.opaque.boxPayload.size));
 3241|      0|            }
 3242|  92.0k|        }
 3243|  18.4k|    }
 3244|  13.7k|    return AVIF_RESULT_OK;
 3245|  13.7k|}
read.c:avifParseItemInfoBox:
 3397|  13.7k|{
 3398|  13.7k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[iinf]");
  ------------------
  |  |  810|  13.7k|    avifROStream VARNAME;                               \
  |  |  811|  13.7k|    avifROData VARNAME##_roData;                        \
  |  |  812|  13.7k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  13.7k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  13.7k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3399|       |
 3400|  13.7k|    uint8_t version;
 3401|  13.7k|    AVIF_CHECKERR(avifROStreamReadVersionAndFlags(&s, &version, NULL), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3402|  13.7k|    uint32_t entryCount;
 3403|  13.7k|    if (version == 0) {
  ------------------
  |  Branch (3403:9): [True: 13.7k, False: 0]
  ------------------
 3404|  13.7k|        uint16_t tmp;
 3405|  13.7k|        AVIF_CHECKERR(avifROStreamReadU16(&s, &tmp), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) entry_count;
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3406|  13.7k|        entryCount = tmp;
 3407|  13.7k|    } else if (version == 1) {
  ------------------
  |  Branch (3407:16): [True: 0, False: 0]
  ------------------
 3408|      0|        AVIF_CHECKERR(avifROStreamReadU32(&s, &entryCount), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) entry_count;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3409|      0|    } else {
 3410|      0|        avifDiagnosticsPrintf(diag, "Box[iinf] has an unsupported version %u", version);
 3411|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 3412|      0|    }
 3413|       |
 3414|  32.1k|    for (uint32_t entryIndex = 0; entryIndex < entryCount; ++entryIndex) {
  ------------------
  |  Branch (3414:35): [True: 18.4k, False: 13.7k]
  ------------------
 3415|  18.4k|        avifBoxHeader infeHeader;
 3416|  18.4k|        AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &infeHeader), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3417|       |
 3418|  18.4k|        if (!memcmp(infeHeader.type, "infe", 4)) {
  ------------------
  |  Branch (3418:13): [True: 18.4k, False: 0]
  ------------------
 3419|  18.4k|            AVIF_CHECKRES(avifParseItemInfoEntry(meta, avifROStreamCurrent(&s), infeHeader.size, diag));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3420|  18.4k|        } else {
 3421|       |            // These must all be type infe
 3422|      0|            avifDiagnosticsPrintf(diag, "Box[iinf] contains a box that isn't type 'infe'");
 3423|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
 3424|      0|        }
 3425|       |
 3426|  18.4k|        AVIF_CHECKERR(avifROStreamSkip(&s, infeHeader.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3427|  18.4k|    }
 3428|       |
 3429|  13.7k|    return AVIF_RESULT_OK;
 3430|  13.7k|}
read.c:avifParseItemInfoEntry:
 3346|  18.4k|{
 3347|       |    // Section 8.11.6.2 of ISO/IEC 14496-12.
 3348|  18.4k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[infe]");
  ------------------
  |  |  810|  18.4k|    avifROStream VARNAME;                               \
  |  |  811|  18.4k|    avifROData VARNAME##_roData;                        \
  |  |  812|  18.4k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  18.4k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  18.4k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3349|       |
 3350|  18.4k|    uint8_t version;
 3351|  18.4k|    uint32_t flags;
 3352|  18.4k|    AVIF_CHECKERR(avifROStreamReadVersionAndFlags(&s, &version, &flags), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3353|       |    // Version 2+ is required for item_type
 3354|  18.4k|    if (version != 2 && version != 3) {
  ------------------
  |  Branch (3354:9): [True: 0, False: 18.4k]
  |  Branch (3354:25): [True: 0, False: 0]
  ------------------
 3355|      0|        avifDiagnosticsPrintf(s.diag, "%s: Expecting box version 2 or 3, got version %u", s.diagContext, version);
 3356|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 3357|      0|    }
 3358|       |    // Ignore flags&1. A value of 1 corresponds to a hidden image item (not intended to be displayed).
 3359|       |    // There could be files wrongly setting that flag to 1 for items output as "to be displayed"
 3360|       |    // by libavif so far, so keep that lenient behavior for simplicity and backward compatibility.
 3361|       |
 3362|  18.4k|    uint32_t itemID;
 3363|  18.4k|    if (version == 2) {
  ------------------
  |  Branch (3363:9): [True: 18.4k, False: 0]
  ------------------
 3364|  18.4k|        uint16_t tmp;
 3365|  18.4k|        AVIF_CHECKERR(avifROStreamReadU16(&s, &tmp), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) item_ID;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3366|  18.4k|        itemID = tmp;
 3367|  18.4k|    } else {
 3368|      0|        AVIF_ASSERT_OR_RETURN(version == 3);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3369|      0|        AVIF_CHECKERR(avifROStreamReadU32(&s, &itemID), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) item_ID;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3370|      0|    }
 3371|  18.4k|    AVIF_CHECKRES(avifCheckItemID("infe", itemID, diag));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3372|  18.4k|    uint16_t itemProtectionIndex;
 3373|  18.4k|    AVIF_CHECKERR(avifROStreamReadU16(&s, &itemProtectionIndex), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) item_protection_index;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3374|  18.4k|    uint8_t itemType[4];
 3375|  18.4k|    AVIF_CHECKERR(avifROStreamRead(&s, itemType, 4), AVIF_RESULT_BMFF_PARSE_FAILED);   // unsigned int(32) item_type;
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3376|  18.4k|    AVIF_CHECKERR(avifROStreamReadString(&s, NULL, 0), AVIF_RESULT_BMFF_PARSE_FAILED); // utf8string item_name; (skipped)
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3377|  18.4k|    avifContentType contentType;
 3378|  18.4k|    if (!memcmp(itemType, "mime", 4)) {
  ------------------
  |  Branch (3378:9): [True: 0, False: 18.4k]
  ------------------
 3379|      0|        AVIF_CHECKERR(avifROStreamReadString(&s, contentType.contentType, CONTENTTYPE_SIZE), AVIF_RESULT_BMFF_PARSE_FAILED); // utf8string content_type;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3380|       |        // utf8string content_encoding; //optional
 3381|  18.4k|    } else {
 3382|       |        // if (item_type == 'uri ') {
 3383|       |        //  utf8string item_uri_type;
 3384|       |        // }
 3385|  18.4k|        memset(&contentType, 0, sizeof(contentType));
 3386|  18.4k|    }
 3387|       |
 3388|  18.4k|    avifDecoderItem * item;
 3389|  18.4k|    AVIF_CHECKRES(avifMetaFindOrCreateItem(meta, itemID, &item));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3390|       |
 3391|  18.4k|    memcpy(item->type, itemType, sizeof(itemType));
 3392|  18.4k|    item->contentType = contentType;
 3393|  18.4k|    return AVIF_RESULT_OK;
 3394|  18.4k|}
read.c:avifParseItemReferenceBox:
 3433|  4.61k|{
 3434|  4.61k|    BEGIN_STREAM(s, raw, rawLen, diag, "Box[iref]");
  ------------------
  |  |  810|  4.61k|    avifROStream VARNAME;                               \
  |  |  811|  4.61k|    avifROData VARNAME##_roData;                        \
  |  |  812|  4.61k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  4.61k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  4.61k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3435|       |
 3436|  4.61k|    uint8_t version;
 3437|  4.61k|    AVIF_CHECKERR(avifROStreamReadVersionAndFlags(&s, &version, NULL), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3438|  4.61k|    if (version > 1) {
  ------------------
  |  Branch (3438:9): [True: 0, False: 4.61k]
  ------------------
 3439|       |        // iref versions > 1 are not supported. Skip it.
 3440|      0|        return AVIF_RESULT_OK;
 3441|      0|    }
 3442|       |
 3443|  9.23k|    while (avifROStreamHasBytesLeft(&s, 1)) {
  ------------------
  |  Branch (3443:12): [True: 4.61k, False: 4.61k]
  ------------------
 3444|  4.61k|        avifBoxHeader irefHeader;
 3445|  4.61k|        AVIF_CHECKERR(avifROStreamReadBoxHeader(&s, &irefHeader), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3446|       |
 3447|  4.61k|        BEGIN_STREAM(refStream, avifROStreamCurrent(&s), irefHeader.size, diag, "Box[iref] SingleItemTypeReference");
  ------------------
  |  |  810|  4.61k|    avifROStream VARNAME;                               \
  |  |  811|  4.61k|    avifROData VARNAME##_roData;                        \
  |  |  812|  4.61k|    VARNAME##_roData.data = PTR;                        \
  |  |  813|  4.61k|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|  4.61k|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 3448|       |
 3449|  4.61k|        uint32_t fromID = 0;
 3450|  4.61k|        if (version == 0) {
  ------------------
  |  Branch (3450:13): [True: 4.61k, False: 0]
  ------------------
 3451|  4.61k|            uint16_t tmp;
 3452|  4.61k|            AVIF_CHECKERR(avifROStreamReadU16(&refStream, &tmp), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) from_item_ID;
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3453|  4.61k|            fromID = tmp;
 3454|  4.61k|        } else {
 3455|       |            // version == 1
 3456|      0|            AVIF_CHECKERR(avifROStreamReadU32(&refStream, &fromID), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) from_item_ID;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3457|      0|        }
 3458|       |        // ISO 14496-12 section 8.11.12.1: "index values start at 1"
 3459|  4.61k|        AVIF_CHECKRES(avifCheckItemID("iref", fromID, diag));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3460|       |
 3461|  4.61k|        avifDecoderItem * item;
 3462|  4.61k|        AVIF_CHECKRES(avifMetaFindOrCreateItem(meta, fromID, &item));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3463|  4.61k|        if (!memcmp(irefHeader.type, "dimg", 4)) {
  ------------------
  |  Branch (3463:13): [True: 0, False: 4.61k]
  ------------------
 3464|      0|            if (item->hasDimgFrom) {
  ------------------
  |  Branch (3464:17): [True: 0, False: 0]
  ------------------
 3465|       |                // ISO/IEC 23008-12 (HEIF) 6.6.1: The number of SingleItemTypeReferenceBoxes with the box type 'dimg'
 3466|       |                // and with the same value of from_item_ID shall not be greater than 1.
 3467|      0|                avifDiagnosticsPrintf(diag, "Box[iinf] contains duplicate boxes of type 'dimg' with the same from_item_ID value %u", fromID);
 3468|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 3469|      0|            }
 3470|      0|            item->hasDimgFrom = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3471|      0|        }
 3472|       |
 3473|  4.61k|        uint16_t referenceCount = 0;
 3474|  4.61k|        AVIF_CHECKERR(avifROStreamReadU16(&refStream, &referenceCount), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) reference_count;
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3475|       |
 3476|  9.23k|        for (uint16_t refIndex = 0; refIndex < referenceCount; ++refIndex) {
  ------------------
  |  Branch (3476:37): [True: 4.61k, False: 4.61k]
  ------------------
 3477|  4.61k|            uint32_t toID = 0;
 3478|  4.61k|            if (version == 0) {
  ------------------
  |  Branch (3478:17): [True: 4.61k, False: 0]
  ------------------
 3479|  4.61k|                uint16_t tmp;
 3480|  4.61k|                AVIF_CHECKERR(avifROStreamReadU16(&refStream, &tmp), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(16) to_item_ID;
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3481|  4.61k|                toID = tmp;
 3482|  4.61k|            } else {
 3483|       |                // version == 1
 3484|      0|                AVIF_CHECKERR(avifROStreamReadU32(&refStream, &toID), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(32) to_item_ID;
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3485|      0|            }
 3486|  4.61k|            AVIF_CHECKRES(avifCheckItemID("iref", toID, diag));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3487|       |
 3488|       |            // Read this reference as "{fromID} is a {irefType} for {toID}"
 3489|  4.61k|            if (!memcmp(irefHeader.type, "thmb", 4) || !memcmp(irefHeader.type, "auxl", 4) ||
  ------------------
  |  Branch (3489:17): [True: 0, False: 4.61k]
  |  Branch (3489:56): [True: 4.61k, False: 0]
  ------------------
 3490|  4.61k|                !memcmp(irefHeader.type, "cdsc", 4) || !memcmp(irefHeader.type, "prem", 4)) {
  ------------------
  |  Branch (3490:17): [True: 0, False: 0]
  |  Branch (3490:56): [True: 0, False: 0]
  ------------------
 3491|       |                // Section 8.11.12.1 of ISO/IEC 14496-12:
 3492|       |                //   The items linked to are then represented by an array of to_item_IDs;
 3493|       |                //   within a given array, a given value shall occur at most once.
 3494|       |                // That last requirement is not checked for these reference types.
 3495|       |                // Several boxes of the same type may also share a from_item_ID, so an item can
 3496|       |                // be the source of more than one reference of a given type. Every target is kept.
 3497|  4.61k|                AVIF_CHECKRES(avifAddReference(&item->references, (const char *)irefHeader.type, toID));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3498|  4.61k|            } else if (!memcmp(irefHeader.type, "dimg", 4)) {
  ------------------
  |  Branch (3498:24): [True: 0, False: 0]
  ------------------
 3499|       |                // derived images refer in the opposite direction
 3500|      0|                avifDecoderItem * dimgInput;
 3501|      0|                AVIF_CHECKRES(avifMetaFindOrCreateItem(meta, toID, &dimgInput));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3502|       |
 3503|       |                // Section 8.11.12.1 of ISO/IEC 14496-12:
 3504|       |                //   The items linked to are then represented by an array of to_item_IDs;
 3505|       |                //   within a given array, a given value shall occur at most once.
 3506|      0|                AVIF_CHECKERR(!avifIsDimgInput(item, toID, NULL), AVIF_RESULT_INVALID_IMAGE_GRID);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3507|      0|                AVIF_CHECKRES(avifAddDimgInput(item, dimgInput));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3508|      0|            }
 3509|  4.61k|        }
 3510|       |
 3511|  4.61k|        AVIF_CHECKERR(avifROStreamSkip(&s, irefHeader.size), AVIF_RESULT_BMFF_PARSE_FAILED);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3512|  4.61k|    }
 3513|       |
 3514|  4.61k|    return AVIF_RESULT_OK;
 3515|  4.61k|}
read.c:avifAddReference:
  286|  4.61k|{
  287|  4.61k|    avifItemReference * reference = (avifItemReference *)avifArrayPush(references);
  288|  4.61k|    AVIF_CHECKERR(reference != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  4.61k|    do {                        \
  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
  289|  4.61k|    memcpy(reference->type, type, 4);
  290|  4.61k|    reference->toID = toID;
  291|  4.61k|    return AVIF_RESULT_OK;
  292|  4.61k|}
read.c:avifGetCodecType:
   45|  87.4k|{
   46|  87.4k|    if (!memcmp(fourcc, "av01", 4)) {
  ------------------
  |  Branch (46:9): [True: 87.4k, False: 0]
  ------------------
   47|  87.4k|        return AVIF_CODEC_TYPE_AV1;
   48|  87.4k|    }
   49|       |#if defined(AVIF_CODEC_AVM)
   50|       |    if (!memcmp(fourcc, "av02", 4)) {
   51|       |        return AVIF_CODEC_TYPE_AV2;
   52|       |    }
   53|       |#endif
   54|      0|    return AVIF_CODEC_TYPE_UNKNOWN;
   55|  87.4k|}
read.c:avifDecoderItemShouldBeSkipped:
 5394|  50.6k|{
 5395|  50.6k|    return !item->size || item->hasUnsupportedEssentialProperty ||
  ------------------
  |  Branch (5395:12): [True: 0, False: 50.6k]
  |  Branch (5395:27): [True: 0, False: 50.6k]
  ------------------
 5396|  50.6k|           (avifGetCodecType(item->type) == AVIF_CODEC_TYPE_UNKNOWN && memcmp(item->type, "grid", 4)) ||
  ------------------
  |  Branch (5396:13): [True: 0, False: 50.6k]
  |  Branch (5396:72): [True: 0, False: 0]
  ------------------
 5397|  50.6k|           avifHasReference(&item->references, "thmb");
  ------------------
  |  Branch (5397:12): [True: 0, False: 50.6k]
  ------------------
 5398|  50.6k|}
read.c:avifPropertyArrayFind:
  200|   220k|{
  201|  1.03M|    for (uint32_t propertyIndex = 0; propertyIndex < properties->count; ++propertyIndex) {
  ------------------
  |  Branch (201:38): [True: 905k, False: 128k]
  ------------------
  202|   905k|        const avifProperty * prop = &properties->prop[propertyIndex];
  203|   905k|        if (!memcmp(prop->type, type, 4)) {
  ------------------
  |  Branch (203:13): [True: 92.0k, False: 813k]
  ------------------
  204|  92.0k|            return prop;
  205|  92.0k|        }
  206|   905k|    }
  207|   128k|    return NULL;
  208|   220k|}
read.c:isAlphaURN:
 2044|  4.61k|{
 2045|  4.61k|    return !strcmp(urn, AVIF_URN_ALPHA0) || !strcmp(urn, AVIF_URN_ALPHA1);
  ------------------
  |  |   78|  4.61k|#define AVIF_URN_ALPHA0 "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha"
  ------------------
                  return !strcmp(urn, AVIF_URN_ALPHA0) || !strcmp(urn, AVIF_URN_ALPHA1);
  ------------------
  |  |   79|      0|#define AVIF_URN_ALPHA1 "urn:mpeg:hevc:2015:auxid:1"
  ------------------
  |  Branch (2045:12): [True: 4.61k, False: 0]
  |  Branch (2045:45): [True: 0, False: 0]
  ------------------
 2046|  4.61k|}
read.c:avifDecoderDataClearTiles:
 1181|  27.5k|{
 1182|  45.9k|    for (unsigned int i = 0; i < data->tiles.count; ++i) {
  ------------------
  |  Branch (1182:30): [True: 18.4k, False: 27.5k]
  ------------------
 1183|  18.4k|        avifTile * tile = &data->tiles.tile[i];
 1184|  18.4k|        if (tile->input) {
  ------------------
  |  Branch (1184:13): [True: 18.4k, False: 0]
  ------------------
 1185|  18.4k|            avifCodecDecodeInputDestroy(tile->input);
 1186|  18.4k|            tile->input = NULL;
 1187|  18.4k|        }
 1188|  18.4k|        if (tile->codec) {
  ------------------
  |  Branch (1188:13): [True: 18.4k, False: 0]
  ------------------
 1189|       |            // Check if tile->codec was created separately and destroy it in that case.
 1190|  18.4k|            if (tile->codec != data->codec && tile->codec != data->codecAlpha) {
  ------------------
  |  Branch (1190:17): [True: 9.23k, False: 9.17k]
  |  Branch (1190:47): [True: 9.23k, False: 0]
  ------------------
 1191|  9.23k|                avifCodecDestroy(tile->codec);
 1192|  9.23k|            }
 1193|  18.4k|            tile->codec = NULL;
 1194|  18.4k|        }
 1195|  18.4k|        if (tile->image) {
  ------------------
  |  Branch (1195:13): [True: 18.4k, False: 0]
  ------------------
 1196|  18.4k|            avifImageDestroy(tile->image);
 1197|  18.4k|            tile->image = NULL;
 1198|  18.4k|        }
 1199|  18.4k|    }
 1200|  27.5k|    data->tiles.count = 0;
 1201|   248k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (1201:21): [True: 220k, False: 27.5k]
  ------------------
 1202|   220k|        data->tileInfos[c].tileCount = 0;
 1203|   220k|        data->tileInfos[c].decodedTileCount = 0;
 1204|   220k|    }
 1205|  27.5k|    if (data->codec) {
  ------------------
  |  Branch (1205:9): [True: 9.17k, False: 18.4k]
  ------------------
 1206|  9.17k|        avifCodecDestroy(data->codec);
 1207|  9.17k|        data->codec = NULL;
 1208|  9.17k|    }
 1209|  27.5k|    if (data->codecAlpha) {
  ------------------
  |  Branch (1209:9): [True: 0, False: 27.5k]
  ------------------
 1210|      0|        avifCodecDestroy(data->codecAlpha);
 1211|       |        data->codecAlpha = NULL;
 1212|      0|    }
 1213|  27.5k|}
read.c:avifHasReference:
  308|  50.6k|{
  309|  59.8k|    for (uint32_t i = 0; i < references->count; ++i) {
  ------------------
  |  Branch (309:26): [True: 9.23k, False: 50.6k]
  ------------------
  310|  9.23k|        if (!memcmp(references->ref[i].type, type, 4)) {
  ------------------
  |  Branch (310:13): [True: 0, False: 9.23k]
  ------------------
  311|      0|            return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  312|      0|        }
  313|  9.23k|    }
  314|  50.6k|    return AVIF_FALSE;
  ------------------
  |  |   89|  50.6k|#define AVIF_FALSE 0
  ------------------
  315|  50.6k|}
read.c:avifDecoderFindMetadata:
 1980|  13.7k|{
 1981|  13.7k|    if (decoder->ignoreExif && decoder->ignoreXMP) {
  ------------------
  |  Branch (1981:9): [True: 6.90k, False: 6.88k]
  |  Branch (1981:32): [True: 3.97k, False: 2.92k]
  ------------------
 1982|       |        // Nothing to do!
 1983|  3.97k|        return AVIF_RESULT_OK;
 1984|  3.97k|    }
 1985|       |
 1986|  22.8k|    for (uint32_t itemIndex = 0; itemIndex < meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (1986:34): [True: 12.9k, False: 9.81k]
  ------------------
 1987|  12.9k|        avifDecoderItem * item = meta->items.item[itemIndex];
 1988|  12.9k|        if (!item->size) {
  ------------------
  |  Branch (1988:13): [True: 0, False: 12.9k]
  ------------------
 1989|      0|            continue;
 1990|      0|        }
 1991|  12.9k|        if (item->hasUnsupportedEssentialProperty) {
  ------------------
  |  Branch (1991:13): [True: 0, False: 12.9k]
  ------------------
 1992|       |            // An essential property isn't supported by libavif; ignore the item.
 1993|      0|            continue;
 1994|      0|        }
 1995|       |
 1996|  12.9k|        if ((colorId > 0) && !avifReferences(&item->references, "cdsc", colorId)) {
  ------------------
  |  Branch (1996:13): [True: 12.9k, False: 0]
  |  Branch (1996:30): [True: 12.9k, False: 0]
  ------------------
 1997|       |            // Not a content description (metadata) for the colorOBU, skip it
 1998|  12.9k|            continue;
 1999|  12.9k|        }
 2000|       |
 2001|      0|        if (!decoder->ignoreExif && !memcmp(item->type, "Exif", 4)) {
  ------------------
  |  Branch (2001:13): [True: 0, False: 0]
  |  Branch (2001:37): [True: 0, False: 0]
  ------------------
 2002|      0|            avifROData exifContents;
 2003|      0|            avifResult readResult = avifDecoderItemRead(item, decoder->io, &exifContents, 0, 0, &decoder->diag);
 2004|      0|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (2004:17): [True: 0, False: 0]
  ------------------
 2005|      0|                return readResult;
 2006|      0|            }
 2007|       |
 2008|       |            // Advance past Annex A.2.1's header
 2009|      0|            BEGIN_STREAM(exifBoxStream, exifContents.data, exifContents.size, &decoder->diag, "Exif header");
  ------------------
  |  |  810|      0|    avifROStream VARNAME;                               \
  |  |  811|      0|    avifROData VARNAME##_roData;                        \
  |  |  812|      0|    VARNAME##_roData.data = PTR;                        \
  |  |  813|      0|    VARNAME##_roData.size = SIZE;                       \
  |  |  814|      0|    avifROStreamStart(&VARNAME, &VARNAME##_roData, DIAG, CONTEXT)
  ------------------
 2010|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 2011|       |            // The MinimizedImageBox does not signal the exifTiffHeaderOffset.
 2012|       |            if (!meta->fromMiniBox)
 2013|       |#endif
 2014|      0|            {
 2015|      0|                uint32_t exifTiffHeaderOffset;
 2016|      0|                AVIF_CHECKERR(avifROStreamReadU32(&exifBoxStream, &exifTiffHeaderOffset),
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2017|      0|                              AVIF_RESULT_INVALID_EXIF_PAYLOAD); // unsigned int(32) exif_tiff_header_offset;
 2018|      0|                size_t expectedExifTiffHeaderOffset;
 2019|      0|                AVIF_CHECKRES(avifGetExifTiffHeaderOffset(avifROStreamCurrent(&exifBoxStream),
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2020|      0|                                                          avifROStreamRemainingBytes(&exifBoxStream),
 2021|      0|                                                          &expectedExifTiffHeaderOffset));
 2022|      0|                AVIF_CHECKERR(exifTiffHeaderOffset == expectedExifTiffHeaderOffset, AVIF_RESULT_INVALID_EXIF_PAYLOAD);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2023|      0|            }
 2024|       |
 2025|      0|            AVIF_CHECKRES(avifRWDataSet(&image->exif, avifROStreamCurrent(&exifBoxStream), avifROStreamRemainingBytes(&exifBoxStream)));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2026|      0|        } else if (!decoder->ignoreXMP && !memcmp(item->type, "mime", 4) &&
  ------------------
  |  Branch (2026:20): [True: 0, False: 0]
  |  Branch (2026:43): [True: 0, False: 0]
  ------------------
 2027|      0|                   !strcmp(item->contentType.contentType, AVIF_CONTENT_TYPE_XMP)) {
  ------------------
  |  |   81|      0|#define AVIF_CONTENT_TYPE_XMP "application/rdf+xml"
  ------------------
  |  Branch (2027:20): [True: 0, False: 0]
  ------------------
 2028|      0|            avifROData xmpContents;
 2029|      0|            avifResult readResult = avifDecoderItemRead(item, decoder->io, &xmpContents, 0, 0, &decoder->diag);
 2030|      0|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (2030:17): [True: 0, False: 0]
  ------------------
 2031|      0|                return readResult;
 2032|      0|            }
 2033|       |
 2034|      0|            AVIF_CHECKRES(avifImageSetMetadataXMP(image, xmpContents.data, xmpContents.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2035|      0|        }
 2036|      0|    }
 2037|  9.81k|    return AVIF_RESULT_OK;
 2038|  9.81k|}
read.c:avifReferences:
  296|  36.0k|{
  297|  39.1k|    for (uint32_t i = 0; i < references->count; ++i) {
  ------------------
  |  Branch (297:26): [True: 7.79k, False: 31.3k]
  ------------------
  298|  7.79k|        const avifItemReference * reference = &references->ref[i];
  299|  7.79k|        if (!memcmp(reference->type, type, 4) && reference->toID == toID) {
  ------------------
  |  Branch (299:13): [True: 4.61k, False: 3.17k]
  |  Branch (299:50): [True: 4.61k, False: 0]
  ------------------
  300|  4.61k|            return AVIF_TRUE;
  ------------------
  |  |   88|  4.61k|#define AVIF_TRUE 1
  ------------------
  301|  4.61k|        }
  302|  7.79k|    }
  303|  31.3k|    return AVIF_FALSE;
  ------------------
  |  |   89|  31.3k|#define AVIF_FALSE 0
  ------------------
  304|  36.0k|}
read.c:avifDecoderDataCreateTile:
 1131|  18.4k|{
 1132|  18.4k|    avifTile * tile = (avifTile *)avifArrayPush(&data->tiles);
 1133|  18.4k|    if (tile == NULL) {
  ------------------
  |  Branch (1133:9): [True: 0, False: 18.4k]
  ------------------
 1134|      0|        return NULL;
 1135|      0|    }
 1136|  18.4k|    tile->codecType = codecType;
 1137|  18.4k|    tile->image = avifImageCreateEmpty();
 1138|  18.4k|    if (!tile->image) {
  ------------------
  |  Branch (1138:9): [True: 0, False: 18.4k]
  ------------------
 1139|      0|        goto error;
 1140|      0|    }
 1141|  18.4k|    tile->input = avifCodecDecodeInputCreate();
 1142|  18.4k|    if (!tile->input) {
  ------------------
  |  Branch (1142:9): [True: 0, False: 18.4k]
  ------------------
 1143|      0|        goto error;
 1144|      0|    }
 1145|  18.4k|    tile->width = width;
 1146|  18.4k|    tile->height = height;
 1147|  18.4k|    tile->operatingPoint = operatingPoint;
 1148|  18.4k|    return tile;
 1149|       |
 1150|      0|error:
 1151|      0|    if (tile->input) {
  ------------------
  |  Branch (1151:9): [True: 0, False: 0]
  ------------------
 1152|      0|        avifCodecDecodeInputDestroy(tile->input);
 1153|      0|    }
 1154|      0|    if (tile->image) {
  ------------------
  |  Branch (1154:9): [True: 0, False: 0]
  ------------------
 1155|      0|        avifImageDestroy(tile->image);
 1156|      0|    }
 1157|      0|    avifArrayPop(&data->tiles);
 1158|       |    return NULL;
 1159|  18.4k|}
read.c:avifMetaFindColorItem:
 5578|  13.7k|{
 5579|  13.7k|    for (uint32_t itemIndex = 0; itemIndex < meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (5579:34): [True: 13.7k, False: 0]
  ------------------
 5580|  13.7k|        avifDecoderItem * item = meta->items.item[itemIndex];
 5581|  13.7k|        if (avifDecoderItemShouldBeSkipped(item)) {
  ------------------
  |  Branch (5581:13): [True: 0, False: 13.7k]
  ------------------
 5582|      0|            continue;
 5583|      0|        }
 5584|  13.7k|        if (item->id == meta->primaryItemID) {
  ------------------
  |  Branch (5584:13): [True: 13.7k, False: 0]
  ------------------
 5585|  13.7k|            return item;
 5586|  13.7k|        }
 5587|  13.7k|    }
 5588|      0|    return NULL;
 5589|  13.7k|}
read.c:avifDecoderItemReadAndParse:
 2537|  18.4k|{
 2538|  18.4k|    if (!memcmp(item->type, "grid", 4)) {
  ------------------
  |  Branch (2538:9): [True: 0, False: 18.4k]
  ------------------
 2539|      0|        if (isItemInInput) {
  ------------------
  |  Branch (2539:13): [True: 0, False: 0]
  ------------------
 2540|      0|            avifROData readData;
 2541|      0|            AVIF_CHECKRES(avifDecoderItemRead(item, decoder->io, &readData, 0, 0, decoder->data->diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2542|      0|            AVIF_CHECKRES(avifParseImageGridBox(grid,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2543|      0|                                                readData.data,
 2544|      0|                                                readData.size,
 2545|      0|                                                decoder->imageSizeLimit,
 2546|      0|                                                decoder->imageDimensionLimit,
 2547|      0|                                                decoder->data->diag));
 2548|       |            // Validate that there are exactly the same number of dimg items to form the grid.
 2549|      0|            uint32_t dimgItemCount = 0;
 2550|      0|            for (uint32_t i = 0; i < item->meta->items.count; ++i) {
  ------------------
  |  Branch (2550:34): [True: 0, False: 0]
  ------------------
 2551|      0|                if (avifIsDimgInput(item, item->meta->items.item[i]->id, NULL)) {
  ------------------
  |  Branch (2551:21): [True: 0, False: 0]
  ------------------
 2552|      0|                    ++dimgItemCount;
 2553|      0|                }
 2554|      0|            }
 2555|      0|            AVIF_CHECKERR(dimgItemCount == grid->rows * grid->columns, AVIF_RESULT_INVALID_IMAGE_GRID);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2556|      0|        } else {
 2557|       |            // item was generated for convenience and is not part of the bitstream.
 2558|       |            // grid information should already be set.
 2559|      0|            AVIF_ASSERT_OR_RETURN(grid->rows > 0 && grid->columns > 0);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2560|      0|        }
 2561|      0|        *codecType = avifDecoderItemGetGridCodecType(item);
 2562|      0|        AVIF_CHECKERR(*codecType != AVIF_CODEC_TYPE_UNKNOWN, AVIF_RESULT_INVALID_IMAGE_GRID);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2563|  18.4k|    } else {
 2564|  18.4k|        *codecType = avifGetCodecType(item->type);
 2565|  18.4k|        AVIF_ASSERT_OR_RETURN(*codecType != AVIF_CODEC_TYPE_UNKNOWN);
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2566|  18.4k|    }
 2567|  18.4k|    return AVIF_RESULT_OK;
 2568|  18.4k|}
read.c:avifMetaFindAlphaItem:
 5613|  13.7k|{
 5614|  27.5k|    for (uint32_t itemIndex = 0; itemIndex < meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (5614:34): [True: 18.4k, False: 9.17k]
  ------------------
 5615|  18.4k|        avifDecoderItem * item = meta->items.item[itemIndex];
 5616|  18.4k|        if (avifDecoderItemShouldBeSkipped(item)) {
  ------------------
  |  Branch (5616:13): [True: 0, False: 18.4k]
  ------------------
 5617|      0|            continue;
 5618|      0|        }
 5619|  18.4k|        if (avifDecoderItemIsAlphaAux(item, colorItem->id)) {
  ------------------
  |  Branch (5619:13): [True: 4.61k, False: 13.7k]
  ------------------
 5620|  4.61k|            *alphaItem = item;
 5621|  4.61k|            *isAlphaItemInInput = AVIF_TRUE;
  ------------------
  |  |   88|  4.61k|#define AVIF_TRUE 1
  ------------------
 5622|  4.61k|            return AVIF_RESULT_OK;
 5623|  4.61k|        }
 5624|  18.4k|    }
 5625|  9.17k|    if (memcmp(colorItem->type, "grid", 4)) {
  ------------------
  |  Branch (5625:9): [True: 9.17k, False: 0]
  ------------------
 5626|  9.17k|        *alphaItem = NULL;
 5627|  9.17k|        *isAlphaItemInInput = AVIF_FALSE;
  ------------------
  |  |   89|  9.17k|#define AVIF_FALSE 0
  ------------------
 5628|  9.17k|        return AVIF_RESULT_OK;
 5629|  9.17k|    }
 5630|       |    // If color item is a grid, check if there is an alpha channel which is represented as an auxl item to each color tile item.
 5631|      0|    const uint32_t tileCount = colorInfo->grid.rows * colorInfo->grid.columns;
 5632|      0|    if (tileCount == 0) {
  ------------------
  |  Branch (5632:9): [True: 0, False: 0]
  ------------------
 5633|      0|        *alphaItem = NULL;
 5634|      0|        *isAlphaItemInInput = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5635|      0|        return AVIF_RESULT_OK;
 5636|      0|    }
 5637|       |    // Keep the same 'dimg' order as it defines where each tile is located in the reconstructed image.
 5638|      0|    uint32_t * dimgIdxToAlphaItemIdx = (uint32_t *)avifAlloc(tileCount * sizeof(uint32_t));
 5639|      0|    AVIF_CHECKERR(dimgIdxToAlphaItemIdx != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5640|      0|    const uint32_t itemIndexNotSet = UINT32_MAX;
 5641|      0|    for (uint32_t dimgIdx = 0; dimgIdx < tileCount; ++dimgIdx) {
  ------------------
  |  Branch (5641:32): [True: 0, False: 0]
  ------------------
 5642|      0|        dimgIdxToAlphaItemIdx[dimgIdx] = itemIndexNotSet;
 5643|      0|    }
 5644|      0|    uint32_t alphaItemCount = 0;
 5645|      0|    for (uint32_t i = 0; i < meta->items.count; ++i) {
  ------------------
  |  Branch (5645:26): [True: 0, False: 0]
  ------------------
 5646|      0|        const avifDecoderItem * const item = meta->items.item[i];
 5647|      0|        uint32_t colorTileIdx;
 5648|      0|        if (avifIsDimgInput(colorItem, item->id, &colorTileIdx)) {
  ------------------
  |  Branch (5648:13): [True: 0, False: 0]
  ------------------
 5649|      0|            avifBool seenAlphaForCurrentItem = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5650|      0|            for (uint32_t j = 0; j < meta->items.count; ++j) {
  ------------------
  |  Branch (5650:34): [True: 0, False: 0]
  ------------------
 5651|      0|                avifDecoderItem * auxlItem = meta->items.item[j];
 5652|      0|                if (avifDecoderItemIsAlphaAux(auxlItem, item->id)) {
  ------------------
  |  Branch (5652:21): [True: 0, False: 0]
  ------------------
 5653|      0|                    if (seenAlphaForCurrentItem || colorTileIdx >= tileCount || dimgIdxToAlphaItemIdx[colorTileIdx] != itemIndexNotSet) {
  ------------------
  |  Branch (5653:25): [True: 0, False: 0]
  |  Branch (5653:52): [True: 0, False: 0]
  |  Branch (5653:81): [True: 0, False: 0]
  ------------------
 5654|       |                        // One of the following invalid cases:
 5655|       |                        // * Multiple items are claiming to be the alpha auxiliary of the current item.
 5656|       |                        // * There are too many items in the dimg array (also checked later in avifFillDimgIdxToItemIdxArray()).
 5657|       |                        // * There is a repetition in the dimg array (also checked later in avifFillDimgIdxToItemIdxArray()).
 5658|      0|                        avifFree(dimgIdxToAlphaItemIdx);
 5659|      0|                        return AVIF_RESULT_INVALID_IMAGE_GRID;
 5660|      0|                    }
 5661|      0|                    dimgIdxToAlphaItemIdx[colorTileIdx] = j;
 5662|      0|                    ++alphaItemCount;
 5663|      0|                    seenAlphaForCurrentItem = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5664|      0|                }
 5665|      0|            }
 5666|      0|            if (!seenAlphaForCurrentItem) {
  ------------------
  |  Branch (5666:17): [True: 0, False: 0]
  ------------------
 5667|       |                // No alpha auxiliary item was found for the current item. Treat this as an image without alpha.
 5668|      0|                avifFree(dimgIdxToAlphaItemIdx);
 5669|      0|                *alphaItem = NULL;
 5670|      0|                *isAlphaItemInInput = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5671|      0|                return AVIF_RESULT_OK;
 5672|      0|            }
 5673|      0|        }
 5674|      0|    }
 5675|      0|    if (alphaItemCount != tileCount) {
  ------------------
  |  Branch (5675:9): [True: 0, False: 0]
  ------------------
 5676|      0|        avifFree(dimgIdxToAlphaItemIdx);
 5677|      0|        return AVIF_RESULT_INVALID_IMAGE_GRID;
 5678|      0|    }
 5679|       |    // Find an unused ID.
 5680|      0|    avifResult result;
 5681|      0|    if (meta->items.count >= UINT32_MAX - 1) {
  ------------------
  |  Branch (5681:9): [True: 0, False: 0]
  ------------------
 5682|       |        // In the improbable case where all IDs are used.
 5683|      0|        result = AVIF_RESULT_DECODE_ALPHA_FAILED;
 5684|      0|    } else {
 5685|      0|        uint32_t newItemID = 0;
 5686|      0|        avifBool isUsed;
 5687|      0|        do {
 5688|      0|            ++newItemID;
 5689|      0|            isUsed = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5690|      0|            for (uint32_t i = 0; i < meta->items.count; ++i) {
  ------------------
  |  Branch (5690:34): [True: 0, False: 0]
  ------------------
 5691|      0|                if (meta->items.item[i]->id == newItemID) {
  ------------------
  |  Branch (5691:21): [True: 0, False: 0]
  ------------------
 5692|      0|                    isUsed = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5693|      0|                    break;
 5694|      0|                }
 5695|      0|            }
 5696|      0|        } while (isUsed && newItemID != 0);
  ------------------
  |  Branch (5696:18): [True: 0, False: 0]
  |  Branch (5696:28): [True: 0, False: 0]
  ------------------
 5697|      0|        result = avifMetaFindOrCreateItem(meta, newItemID, alphaItem); // Create new empty item.
 5698|      0|    }
 5699|      0|    if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (5699:9): [True: 0, False: 0]
  ------------------
 5700|      0|        avifFree(dimgIdxToAlphaItemIdx);
 5701|      0|        return result;
 5702|      0|    }
 5703|      0|    memcpy((*alphaItem)->type, "grid", 4); // Make it a grid and register alpha items as its tiles.
 5704|      0|    (*alphaItem)->width = colorItem->width;
 5705|      0|    (*alphaItem)->height = colorItem->height;
 5706|      0|    for (uint32_t dimgIdx = 0; dimgIdx < tileCount; ++dimgIdx) {
  ------------------
  |  Branch (5706:32): [True: 0, False: 0]
  ------------------
 5707|      0|        if (dimgIdxToAlphaItemIdx[dimgIdx] >= meta->items.count) {
  ------------------
  |  Branch (5707:13): [True: 0, False: 0]
  ------------------
 5708|      0|            avifFree(dimgIdxToAlphaItemIdx);
 5709|      0|            AVIF_ASSERT_NOT_REACHED_OR_RETURN;
  ------------------
  |  |   66|      0|    do {                                   \
  |  |   67|      0|        avifBreakOnError();                \
  |  |   68|      0|        return AVIF_RESULT_INTERNAL_ERROR; \
  |  |   69|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (69:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5710|      0|        }
 5711|      0|        avifDecoderItem * alphaTileItem = meta->items.item[dimgIdxToAlphaItemIdx[dimgIdx]];
 5712|       |        // The alpha grid is synthesized here rather than read from a file, so one item
 5713|       |        // may stand in for several cells: an auxiliary item can be the alpha of more
 5714|       |        // than one color tile.
 5715|      0|        const avifResult addResult = avifAddDimgInput(*alphaItem, alphaTileItem);
 5716|      0|        if (addResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (5716:13): [True: 0, False: 0]
  ------------------
 5717|      0|            avifFree(dimgIdxToAlphaItemIdx);
 5718|      0|            return addResult;
 5719|      0|        }
 5720|      0|    }
 5721|      0|    avifFree(dimgIdxToAlphaItemIdx);
 5722|      0|    *isAlphaItemInInput = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5723|      0|    alphaInfo->grid = colorInfo->grid;
 5724|      0|    return AVIF_RESULT_OK;
 5725|      0|}
read.c:avifDecoderItemIsAlphaAux:
 5594|  18.4k|{
 5595|  18.4k|    if (!avifReferences(&item->references, "auxl", colorItemId))
  ------------------
  |  Branch (5595:9): [True: 13.7k, False: 4.61k]
  ------------------
 5596|  13.7k|        return AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 5597|  4.61k|    const avifProperty * auxCProp = avifPropertyArrayFind(&item->properties, "auxC");
 5598|  4.61k|    return auxCProp && isAlphaURN(auxCProp->u.auxC.auxType);
  ------------------
  |  Branch (5598:12): [True: 4.61k, False: 0]
  |  Branch (5598:24): [True: 4.61k, False: 0]
  ------------------
 5599|  18.4k|}
read.c:avifBrandArrayHasBrand:
 5174|  13.7k|{
 5175|  59.3k|    for (uint32_t brandIndex = 0; brandIndex < brands->count; ++brandIndex) {
  ------------------
  |  Branch (5175:35): [True: 45.5k, False: 13.7k]
  ------------------
 5176|  45.5k|        if (!memcmp(brands->brand[brandIndex], brand, 4)) {
  ------------------
  |  Branch (5176:13): [True: 0, False: 45.5k]
  ------------------
 5177|      0|            return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5178|      0|        }
 5179|  45.5k|    }
 5180|  13.7k|    return AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 5181|  13.7k|}
read.c:avifReadColorNclxProperty:
 5743|  13.7k|{
 5744|  13.7k|    assert(cicpSet == NULL || *cicpSet == AVIF_FALSE);
 5745|  13.7k|    avifBool colrNCLXSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 5746|  82.7k|    for (uint32_t propertyIndex = 0; propertyIndex < properties->count; ++propertyIndex) {
  ------------------
  |  Branch (5746:38): [True: 68.9k, False: 13.7k]
  ------------------
 5747|  68.9k|        avifProperty * prop = &properties->prop[propertyIndex];
 5748|  68.9k|        if (!memcmp(prop->type, "colr", 4) && prop->u.colr.hasNCLX) {
  ------------------
  |  Branch (5748:13): [True: 13.7k, False: 55.1k]
  |  Branch (5748:47): [True: 13.7k, False: 0]
  ------------------
 5749|  13.7k|            if (colrNCLXSeen) {
  ------------------
  |  Branch (5749:17): [True: 0, False: 13.7k]
  ------------------
 5750|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5751|      0|            }
 5752|  13.7k|            colrNCLXSeen = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 5753|  13.7k|            if (cicpSet != NULL) {
  ------------------
  |  Branch (5753:17): [True: 13.7k, False: 0]
  ------------------
 5754|  13.7k|                *cicpSet = AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
 5755|  13.7k|            }
 5756|  13.7k|            *colorPrimaries = prop->u.colr.colorPrimaries;
 5757|  13.7k|            *transferCharacteristics = prop->u.colr.transferCharacteristics;
 5758|  13.7k|            *matrixCoefficients = prop->u.colr.matrixCoefficients;
 5759|  13.7k|            *yuvRange = prop->u.colr.range;
 5760|  13.7k|        }
 5761|  68.9k|    }
 5762|  13.7k|    return AVIF_RESULT_OK;
 5763|  13.7k|}
read.c:avifDecoderDataFindSampleTransformImageItem:
 6120|  13.7k|{
 6121|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < data->meta->items.count; ++itemIndex) {
  ------------------
  |  Branch (6121:34): [True: 18.4k, False: 13.7k]
  ------------------
 6122|  18.4k|        avifDecoderItem * item = data->meta->items.item[itemIndex];
 6123|  18.4k|        if (!memcmp(item->type, "sato", 4) && item->id != data->meta->primaryItemID && item->size != 0 &&
  ------------------
  |  Branch (6123:13): [True: 0, False: 18.4k]
  |  Branch (6123:47): [True: 0, False: 0]
  |  Branch (6123:88): [True: 0, False: 0]
  ------------------
 6124|      0|            !item->hasUnsupportedEssentialProperty && !avifHasReference(&item->references, "thmb") &&
  ------------------
  |  Branch (6124:13): [True: 0, False: 0]
  |  Branch (6124:55): [True: 0, False: 0]
  ------------------
 6125|      0|            avifIsPreferredAlternativeTo(data, item->id, data->meta->primaryItemID)) {
  ------------------
  |  Branch (6125:13): [True: 0, False: 0]
  ------------------
 6126|      0|            return item;
 6127|      0|        }
 6128|  18.4k|    }
 6129|  13.7k|    return NULL;
 6130|  13.7k|}
read.c:avifDecoderItemRead:
 1521|  46.7k|{
 1522|  46.7k|    if (item->mergedExtents.data && !item->partialMergedExtents) {
  ------------------
  |  Branch (1522:9): [True: 28.3k, False: 18.4k]
  |  Branch (1522:37): [True: 0, False: 28.3k]
  ------------------
 1523|       |        // Multiple extents have already been concatenated for this item, just return it
 1524|      0|        if (offset >= item->mergedExtents.size) {
  ------------------
  |  Branch (1524:13): [True: 0, False: 0]
  ------------------
 1525|      0|            avifDiagnosticsPrintf(diag, "Item ID %u read has overflowing offset", item->id);
 1526|      0|            return AVIF_RESULT_TRUNCATED_DATA;
 1527|      0|        }
 1528|      0|        outData->data = item->mergedExtents.data + offset;
 1529|      0|        outData->size = item->mergedExtents.size - offset;
 1530|      0|        return AVIF_RESULT_OK;
 1531|      0|    }
 1532|       |
 1533|  46.7k|    if (item->extents.count == 0) {
  ------------------
  |  Branch (1533:9): [True: 0, False: 46.7k]
  ------------------
 1534|      0|        avifDiagnosticsPrintf(diag, "Item ID %u has zero extents", item->id);
 1535|      0|        return AVIF_RESULT_TRUNCATED_DATA;
 1536|      0|    }
 1537|       |
 1538|       |    // Find this item's source of all extents' data, based on the construction method
 1539|  46.7k|    const avifRWData * idatBuffer = NULL;
 1540|  46.7k|    if (item->idatStored) {
  ------------------
  |  Branch (1540:9): [True: 0, False: 46.7k]
  ------------------
 1541|       |        // construction_method: idat(1)
 1542|       |
 1543|      0|        if (item->meta->idat.size > 0) {
  ------------------
  |  Branch (1543:13): [True: 0, False: 0]
  ------------------
 1544|      0|            idatBuffer = &item->meta->idat;
 1545|      0|        } else {
 1546|       |            // no associated idat box was found in the meta box, bail out
 1547|      0|            avifDiagnosticsPrintf(diag, "Item ID %u is stored in an idat, but no associated idat box was found", item->id);
 1548|      0|            return AVIF_RESULT_NO_CONTENT;
 1549|      0|        }
 1550|      0|    }
 1551|       |
 1552|       |    // Merge extents into a single contiguous buffer
 1553|  46.7k|    if ((io->sizeHint > 0) && (item->size > io->sizeHint)) {
  ------------------
  |  Branch (1553:9): [True: 46.7k, False: 0]
  |  Branch (1553:31): [True: 0, False: 46.7k]
  ------------------
 1554|       |        // Sanity check: somehow the sum of extents exceeds the entire file or idat size!
 1555|      0|        avifDiagnosticsPrintf(diag, "Item ID %u reported size failed size hint sanity check. Truncated data?", item->id);
 1556|      0|        return AVIF_RESULT_TRUNCATED_DATA;
 1557|      0|    }
 1558|       |
 1559|  46.7k|    if (offset >= item->size) {
  ------------------
  |  Branch (1559:9): [True: 0, False: 46.7k]
  ------------------
 1560|      0|        avifDiagnosticsPrintf(diag, "Item ID %u read has overflowing offset", item->id);
 1561|      0|        return AVIF_RESULT_TRUNCATED_DATA;
 1562|      0|    }
 1563|  46.7k|    const size_t maxOutputSize = item->size - offset;
 1564|  46.7k|    const size_t readOutputSize = (partialByteCount && (partialByteCount < maxOutputSize)) ? partialByteCount : maxOutputSize;
  ------------------
  |  Branch (1564:36): [True: 46.7k, False: 0]
  |  Branch (1564:56): [True: 28.3k, False: 18.4k]
  ------------------
 1565|  46.7k|    const size_t totalBytesToRead = offset + readOutputSize;
 1566|       |
 1567|       |    // If there is a single extent for this item and the source of the read buffer is going to be
 1568|       |    // persistent for the lifetime of the avifDecoder (whether it comes from its own internal
 1569|       |    // idatBuffer or from a known-persistent IO), we can avoid buffer duplication and just use the
 1570|       |    // preexisting buffer.
 1571|  46.7k|    avifBool singlePersistentBuffer = ((item->extents.count == 1) && (idatBuffer || io->persistent));
  ------------------
  |  Branch (1571:40): [True: 0, False: 46.7k]
  |  Branch (1571:71): [True: 0, False: 0]
  |  Branch (1571:85): [True: 0, False: 0]
  ------------------
 1572|  46.7k|    if (!singlePersistentBuffer) {
  ------------------
  |  Branch (1572:9): [True: 46.7k, False: 0]
  ------------------
 1573|       |        // Always allocate the item's full size here, as progressive image decodes will do partial
 1574|       |        // reads into this buffer and begin feeding the buffer to the underlying AV1 decoder, but
 1575|       |        // will then write more into this buffer without flushing the AV1 decoder (which is still
 1576|       |        // holding the address of the previous allocation of this buffer). This strategy avoids
 1577|       |        // use-after-free issues in the AV1 decoder and unnecessary reallocs as a typical
 1578|       |        // progressive decode use case will eventually decode the final layer anyway.
 1579|  46.7k|        AVIF_CHECKRES(avifRWDataRealloc(&item->mergedExtents, item->size));
  ------------------
  |  |   54|  46.7k|    do {                                  \
  |  |   55|  46.7k|        const avifResult result__ = (A);  \
  |  |   56|  46.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 46.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  46.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 46.7k]
  |  |  ------------------
  ------------------
 1580|  46.7k|        item->ownsMergedExtents = AVIF_TRUE;
  ------------------
  |  |   88|  46.7k|#define AVIF_TRUE 1
  ------------------
 1581|  46.7k|    }
 1582|       |
 1583|       |    // Set this until we manage to fill the entire mergedExtents buffer
 1584|  46.7k|    item->partialMergedExtents = AVIF_TRUE;
  ------------------
  |  |   88|  46.7k|#define AVIF_TRUE 1
  ------------------
 1585|       |
 1586|  46.7k|    size_t writeOffset = 0; // Write offset for item->mergedExtents.data
 1587|  46.7k|    size_t remainingBytes = totalBytesToRead;
 1588|   130k|    for (uint32_t extentIter = 0; extentIter < item->extents.count; ++extentIter) {
  ------------------
  |  Branch (1588:35): [True: 130k, False: 0]
  ------------------
 1589|   130k|        avifExtent * extent = &item->extents.extent[extentIter];
 1590|       |
 1591|   130k|        size_t bytesToRead = extent->size;
 1592|   130k|        if (bytesToRead > remainingBytes) {
  ------------------
  |  Branch (1592:13): [True: 0, False: 130k]
  ------------------
 1593|      0|            bytesToRead = remainingBytes;
 1594|      0|        }
 1595|       |
 1596|   130k|        avifROData offsetBuffer;
 1597|   130k|        if (idatBuffer) {
  ------------------
  |  Branch (1597:13): [True: 0, False: 130k]
  ------------------
 1598|      0|            if (extent->offset > idatBuffer->size) {
  ------------------
  |  Branch (1598:17): [True: 0, False: 0]
  ------------------
 1599|      0|                avifDiagnosticsPrintf(diag, "Item ID %u has impossible extent offset in idat buffer", item->id);
 1600|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1601|      0|            }
 1602|       |            // Since extent->offset (a uint64_t) is not bigger than idatBuffer->size (a size_t),
 1603|       |            // it is safe to cast extent->offset to size_t.
 1604|      0|            const size_t extentOffset = (size_t)extent->offset;
 1605|      0|            if (extent->size > idatBuffer->size - extentOffset) {
  ------------------
  |  Branch (1605:17): [True: 0, False: 0]
  ------------------
 1606|      0|                avifDiagnosticsPrintf(diag, "Item ID %u has impossible extent size in idat buffer", item->id);
 1607|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1608|      0|            }
 1609|      0|            offsetBuffer.data = idatBuffer->data + extentOffset;
 1610|      0|            offsetBuffer.size = idatBuffer->size - extentOffset;
 1611|   130k|        } else {
 1612|       |            // construction_method: file(0)
 1613|       |
 1614|   130k|            if ((io->sizeHint > 0) && (extent->offset > io->sizeHint)) {
  ------------------
  |  Branch (1614:17): [True: 130k, False: 0]
  |  Branch (1614:39): [True: 0, False: 130k]
  ------------------
 1615|      0|                avifDiagnosticsPrintf(diag, "Item ID %u extent offset failed size hint sanity check. Truncated data?", item->id);
 1616|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1617|      0|            }
 1618|   130k|            avifResult readResult = io->read(io, 0, extent->offset, bytesToRead, &offsetBuffer);
 1619|   130k|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (1619:17): [True: 0, False: 130k]
  ------------------
 1620|      0|                return readResult;
 1621|      0|            }
 1622|   130k|            if (bytesToRead != offsetBuffer.size) {
  ------------------
  |  Branch (1622:17): [True: 0, False: 130k]
  ------------------
 1623|      0|                avifDiagnosticsPrintf(diag,
 1624|      0|                                      "Item ID %u tried to read %zu bytes, but only received %zu bytes",
 1625|      0|                                      item->id,
 1626|      0|                                      bytesToRead,
 1627|      0|                                      offsetBuffer.size);
 1628|      0|                return AVIF_RESULT_TRUNCATED_DATA;
 1629|      0|            }
 1630|   130k|        }
 1631|       |
 1632|   130k|        if (singlePersistentBuffer) {
  ------------------
  |  Branch (1632:13): [True: 0, False: 130k]
  ------------------
 1633|      0|            item->mergedExtents.data = (uint8_t *)offsetBuffer.data; // const_cast
 1634|      0|            AVIF_ASSERT_OR_RETURN(bytesToRead <= offsetBuffer.size);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1635|      0|            item->mergedExtents.size = bytesToRead;
 1636|   130k|        } else {
 1637|   130k|            AVIF_ASSERT_OR_RETURN(item->ownsMergedExtents);
  ------------------
  |  |   64|   130k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   130k|    do {                        \
  |  |  |  |   46|   130k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 130k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   130k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1638|   130k|            AVIF_ASSERT_OR_RETURN(writeOffset < item->mergedExtents.size);
  ------------------
  |  |   64|   130k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   130k|    do {                        \
  |  |  |  |   46|   130k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 130k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   130k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1639|   130k|            AVIF_ASSERT_OR_RETURN(bytesToRead <= item->mergedExtents.size - writeOffset);
  ------------------
  |  |   64|   130k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   130k|    do {                        \
  |  |  |  |   46|   130k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 130k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   130k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 130k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|   130k|            memcpy(item->mergedExtents.data + writeOffset, offsetBuffer.data, bytesToRead);
 1641|   130k|            writeOffset += bytesToRead;
 1642|   130k|        }
 1643|       |
 1644|   130k|        remainingBytes -= bytesToRead;
 1645|   130k|        if (remainingBytes == 0) {
  ------------------
  |  Branch (1645:13): [True: 46.7k, False: 83.5k]
  ------------------
 1646|       |            // This happens when partialByteCount is set
 1647|  46.7k|            break;
 1648|  46.7k|        }
 1649|   130k|    }
 1650|  46.7k|    if (remainingBytes != 0) {
  ------------------
  |  Branch (1650:9): [True: 0, False: 46.7k]
  ------------------
 1651|       |        // This should be impossible?
 1652|      0|        avifDiagnosticsPrintf(diag, "Item ID %u has %zu unexpected trailing bytes", item->id, remainingBytes);
 1653|      0|        return AVIF_RESULT_TRUNCATED_DATA;
 1654|      0|    }
 1655|       |
 1656|  46.7k|    outData->data = item->mergedExtents.data + offset;
 1657|  46.7k|    outData->size = readOutputSize;
 1658|  46.7k|    item->partialMergedExtents = (item->size != totalBytesToRead);
 1659|  46.7k|    return AVIF_RESULT_OK;
 1660|  46.7k|}
read.c:avifDecoderAdoptGridTileCodecTypeIfNeeded:
 1775|  18.4k|{
 1776|  18.4k|    if ((info->grid.rows > 0) && (info->grid.columns > 0)) {
  ------------------
  |  Branch (1776:9): [True: 0, False: 18.4k]
  |  Branch (1776:34): [True: 0, False: 0]
  ------------------
 1777|       |        // The number of tiles was verified in avifDecoderItemReadAndParse().
 1778|      0|        const uint32_t numTiles = info->grid.rows * info->grid.columns;
 1779|      0|        uint32_t * dimgIdxToItemIdx = (uint32_t *)avifAlloc(numTiles * sizeof(uint32_t));
 1780|      0|        AVIF_CHECKERR(dimgIdxToItemIdx != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1781|      0|        avifResult result = avifFillDimgIdxToItemIdxArray(dimgIdxToItemIdx, numTiles, item);
 1782|      0|        if (result == AVIF_RESULT_OK) {
  ------------------
  |  Branch (1782:13): [True: 0, False: 0]
  ------------------
 1783|      0|            result = avifDecoderAdoptGridTileCodecType(decoder, item, dimgIdxToItemIdx, numTiles);
 1784|      0|        }
 1785|      0|        avifFree(dimgIdxToItemIdx);
 1786|      0|        AVIF_CHECKRES(result);
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1787|      0|    }
 1788|  18.4k|    return AVIF_RESULT_OK;
 1789|  18.4k|}
read.c:avifDecoderGenerateImageTiles:
 6133|  18.4k|{
 6134|  18.4k|    const uint32_t previousTileCount = decoder->data->tiles.count;
 6135|  18.4k|    if ((info->grid.rows > 0) && (info->grid.columns > 0)) {
  ------------------
  |  Branch (6135:9): [True: 0, False: 18.4k]
  |  Branch (6135:34): [True: 0, False: 0]
  ------------------
 6136|       |        // The number of tiles was verified in avifDecoderItemReadAndParse().
 6137|      0|        const uint32_t numTiles = info->grid.rows * info->grid.columns;
 6138|      0|        uint32_t * dimgIdxToItemIdx = (uint32_t *)avifAlloc(numTiles * sizeof(uint32_t));
 6139|      0|        AVIF_CHECKERR(dimgIdxToItemIdx != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6140|      0|        avifResult result = avifFillDimgIdxToItemIdxArray(dimgIdxToItemIdx, numTiles, item);
 6141|      0|        if (result == AVIF_RESULT_OK) {
  ------------------
  |  Branch (6141:13): [True: 0, False: 0]
  ------------------
 6142|      0|            result = avifDecoderGenerateImageGridTiles(decoder, item, itemCategory, dimgIdxToItemIdx, numTiles);
 6143|      0|        }
 6144|      0|        avifFree(dimgIdxToItemIdx);
 6145|      0|        AVIF_CHECKRES(result);
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6146|  18.4k|    } else {
 6147|  18.4k|        AVIF_CHECKERR(item->size != 0, AVIF_RESULT_MISSING_IMAGE_ITEM);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6148|       |
 6149|  18.4k|        const avifCodecType codecType = avifGetCodecType(item->type);
 6150|  18.4k|        AVIF_ASSERT_OR_RETURN(codecType != AVIF_CODEC_TYPE_UNKNOWN);
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6151|  18.4k|        avifTile * tile =
 6152|  18.4k|            avifDecoderDataCreateTile(decoder->data, codecType, item->width, item->height, avifDecoderItemOperatingPoint(item));
 6153|  18.4k|        AVIF_CHECKERR(tile, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6154|  18.4k|        AVIF_CHECKRES(avifCodecDecodeInputFillFromDecoderItem(tile->input,
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 6155|  18.4k|                                                              item,
 6156|  18.4k|                                                              decoder->allowProgressive,
 6157|  18.4k|                                                              decoder->imageCountLimit,
 6158|  18.4k|                                                              decoder->io->sizeHint,
 6159|  18.4k|                                                              &decoder->diag));
 6160|  18.4k|        tile->input->itemCategory = itemCategory;
 6161|  18.4k|    }
 6162|  18.4k|    info->tileCount = decoder->data->tiles.count - previousTileCount;
 6163|  18.4k|    return AVIF_RESULT_OK;
 6164|  18.4k|}
read.c:avifDecoderItemOperatingPoint:
 1329|  18.4k|{
 1330|  18.4k|    const avifProperty * a1opProp = avifPropertyArrayFind(&item->properties, "a1op");
 1331|  18.4k|    if (a1opProp) {
  ------------------
  |  Branch (1331:9): [True: 0, False: 18.4k]
  ------------------
 1332|      0|        return a1opProp->u.a1op.opIndex;
 1333|      0|    }
 1334|  18.4k|    return 0; // default
 1335|  18.4k|}
read.c:avifCodecDecodeInputFillFromDecoderItem:
  691|  18.4k|{
  692|  18.4k|    if (sizeHint && (item->size > sizeHint)) {
  ------------------
  |  Branch (692:9): [True: 18.4k, False: 0]
  |  Branch (692:21): [True: 0, False: 18.4k]
  ------------------
  693|      0|        avifDiagnosticsPrintf(diag, "Exceeded avifIO's sizeHint, possibly truncated data");
  694|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
  695|      0|    }
  696|       |
  697|  18.4k|    uint8_t layerCount = 0;
  698|  18.4k|    size_t layerSizes[4] = { 0 };
  699|  18.4k|    const avifProperty * a1lxProp = avifPropertyArrayFind(&item->properties, "a1lx");
  700|  18.4k|    if (a1lxProp) {
  ------------------
  |  Branch (700:9): [True: 18.4k, False: 0]
  ------------------
  701|       |        // Calculate layer count and all layer sizes from the a1lx box, and then validate
  702|       |
  703|  18.4k|        size_t remainingSize = item->size;
  704|  73.6k|        for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (704:25): [True: 55.2k, False: 18.4k]
  ------------------
  705|  55.2k|            ++layerCount;
  706|       |
  707|  55.2k|            const size_t layerSize = (size_t)a1lxProp->u.a1lx.layerSize[i];
  708|  55.2k|            if (layerSize) {
  ------------------
  |  Branch (708:17): [True: 55.2k, False: 0]
  ------------------
  709|  55.2k|                if (layerSize >= remainingSize) { // >= instead of > because there must be room for the last layer
  ------------------
  |  Branch (709:21): [True: 0, False: 55.2k]
  ------------------
  710|      0|                    avifDiagnosticsPrintf(diag, "a1lx layer index [%d] does not fit in item size", i);
  711|      0|                    return AVIF_RESULT_BMFF_PARSE_FAILED;
  712|      0|                }
  713|  55.2k|                layerSizes[i] = layerSize;
  714|  55.2k|                remainingSize -= layerSize;
  715|  55.2k|            } else {
  716|      0|                layerSizes[i] = remainingSize;
  717|      0|                remainingSize = 0;
  718|      0|                break;
  719|      0|            }
  720|  55.2k|        }
  721|  18.4k|        if (remainingSize > 0) {
  ------------------
  |  Branch (721:13): [True: 18.4k, False: 0]
  ------------------
  722|  18.4k|            AVIF_ASSERT_OR_RETURN(layerCount == 3);
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  18.4k|            ++layerCount;
  724|  18.4k|            layerSizes[3] = remainingSize;
  725|  18.4k|        }
  726|  18.4k|    }
  727|       |
  728|  18.4k|    const avifProperty * lselProp = avifPropertyArrayFind(&item->properties, "lsel");
  729|       |    // Progressive images offer layers via the a1lxProp, but don't specify a layer selection with lsel.
  730|       |    //
  731|       |    // For backward compatibility with earlier drafts of AVIF spec v1.1.0, treat an absent lsel as
  732|       |    // equivalent to layer_id == 0xFFFF during the transitional period. Remove !lselProp when the test
  733|       |    // images have been updated to the v1.1.0 spec.
  734|  18.4k|    item->progressive = (a1lxProp && (!lselProp || (lselProp->u.lsel.layerID == 0xFFFF)));
  ------------------
  |  Branch (734:26): [True: 18.4k, False: 0]
  |  Branch (734:39): [True: 18.4k, False: 0]
  |  Branch (734:52): [True: 0, False: 0]
  ------------------
  735|  18.4k|    if (lselProp && (lselProp->u.lsel.layerID != 0xFFFF)) {
  ------------------
  |  Branch (735:9): [True: 0, False: 18.4k]
  |  Branch (735:21): [True: 0, False: 0]
  ------------------
  736|       |        // Layer selection. This requires that the underlying AV1 codec decodes all layers,
  737|       |        // and then only returns the requested layer as a single frame. To the user of libavif,
  738|       |        // this appears to be a single frame.
  739|       |
  740|      0|        decodeInput->allLayers = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  741|       |
  742|      0|        size_t sampleSize = 0;
  743|      0|        if (layerCount > 0) {
  ------------------
  |  Branch (743:13): [True: 0, False: 0]
  ------------------
  744|       |            // Optimization: If we're selecting a layer that doesn't require the entire image's payload (hinted via the a1lx box)
  745|       |
  746|      0|            if (lselProp->u.lsel.layerID >= layerCount) {
  ------------------
  |  Branch (746:17): [True: 0, False: 0]
  ------------------
  747|      0|                avifDiagnosticsPrintf(diag,
  748|      0|                                      "lsel property requests layer index [%u] which isn't present in a1lx property ([%u] layers)",
  749|      0|                                      lselProp->u.lsel.layerID,
  750|      0|                                      layerCount);
  751|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
  752|      0|            }
  753|       |
  754|      0|            for (uint8_t i = 0; i <= lselProp->u.lsel.layerID; ++i) {
  ------------------
  |  Branch (754:33): [True: 0, False: 0]
  ------------------
  755|      0|                sampleSize += layerSizes[i];
  756|      0|            }
  757|      0|        } else {
  758|       |            // This layer's payload subsection is unknown, just use the whole payload
  759|      0|            sampleSize = item->size;
  760|      0|        }
  761|       |
  762|      0|        avifDecodeSample * sample = (avifDecodeSample *)avifArrayPush(&decodeInput->samples);
  763|      0|        AVIF_CHECKERR(sample != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  764|      0|        sample->itemID = item->id;
  765|      0|        sample->offset = 0;
  766|      0|        sample->size = sampleSize;
  767|      0|        AVIF_ASSERT_OR_RETURN(lselProp->u.lsel.layerID < AVIF_MAX_AV1_LAYER_COUNT);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  768|      0|        sample->spatialID = (uint8_t)lselProp->u.lsel.layerID;
  769|      0|        sample->sync = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  770|  18.4k|    } else if (allowProgressive && item->progressive) {
  ------------------
  |  Branch (770:16): [True: 9.43k, False: 8.96k]
  |  Branch (770:36): [True: 9.43k, False: 0]
  ------------------
  771|       |        // Progressive image. Decode all layers and expose them all to the user.
  772|       |
  773|  9.43k|        if (imageCountLimit && (layerCount > imageCountLimit)) {
  ------------------
  |  Branch (773:13): [True: 9.43k, False: 0]
  |  Branch (773:32): [True: 0, False: 9.43k]
  ------------------
  774|      0|            avifDiagnosticsPrintf(diag, "Exceeded avifDecoder's imageCountLimit (progressive)");
  775|      0|            return AVIF_RESULT_BMFF_PARSE_FAILED;
  776|      0|        }
  777|       |
  778|  9.43k|        decodeInput->allLayers = AVIF_TRUE;
  ------------------
  |  |   88|  9.43k|#define AVIF_TRUE 1
  ------------------
  779|       |
  780|  9.43k|        size_t offset = 0;
  781|  47.1k|        for (int i = 0; i < layerCount; ++i) {
  ------------------
  |  Branch (781:25): [True: 37.7k, False: 9.43k]
  ------------------
  782|  37.7k|            avifDecodeSample * sample = (avifDecodeSample *)avifArrayPush(&decodeInput->samples);
  783|  37.7k|            AVIF_CHECKERR(sample != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  37.7k|    do {                        \
  |  |   46|  37.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 37.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  37.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 37.7k]
  |  |  ------------------
  ------------------
  784|  37.7k|            sample->itemID = item->id;
  785|  37.7k|            sample->offset = offset;
  786|  37.7k|            sample->size = layerSizes[i];
  787|  37.7k|            sample->spatialID = AVIF_SPATIAL_ID_UNSET;
  ------------------
  |  |  468|  37.7k|#define AVIF_SPATIAL_ID_UNSET 0xff
  ------------------
  788|  37.7k|            sample->sync = (i == 0); // Assume all layers depend on the first layer
  789|       |
  790|  37.7k|            offset += layerSizes[i];
  791|  37.7k|        }
  792|  9.43k|    } else {
  793|       |        // Typical case: Use the entire item's payload for a single frame output
  794|       |
  795|  8.96k|        avifDecodeSample * sample = (avifDecodeSample *)avifArrayPush(&decodeInput->samples);
  796|  8.96k|        AVIF_CHECKERR(sample != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  8.96k|    do {                        \
  |  |   46|  8.96k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 8.96k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  8.96k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 8.96k]
  |  |  ------------------
  ------------------
  797|  8.96k|        sample->itemID = item->id;
  798|  8.96k|        sample->offset = 0;
  799|  8.96k|        sample->size = item->size;
  800|  8.96k|        sample->spatialID = AVIF_SPATIAL_ID_UNSET;
  ------------------
  |  |  468|  8.96k|#define AVIF_SPATIAL_ID_UNSET 0xff
  ------------------
  801|  8.96k|        sample->sync = AVIF_TRUE;
  ------------------
  |  |   88|  8.96k|#define AVIF_TRUE 1
  ------------------
  802|  8.96k|    }
  803|  18.4k|    return AVIF_RESULT_OK;
  804|  18.4k|}
read.c:avifDecoderItemValidateProperties:
 1341|  18.4k|{
 1342|  18.4k|    const avifProperty * const configProp = avifPropertyArrayFind(&item->properties, configPropName);
 1343|  18.4k|    if (!configProp) {
  ------------------
  |  Branch (1343:9): [True: 0, False: 18.4k]
  ------------------
 1344|       |        // An item configuration property box is mandatory in all valid AVIF configurations. Bail out.
 1345|      0|        avifDiagnosticsPrintf(diag, "Item ID %u of type '%.4s' is missing mandatory %s property", item->id, (const char *)item->type, configPropName);
 1346|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 1347|      0|    }
 1348|       |
 1349|  18.4k|    if (!memcmp(item->type, "grid", 4)) {
  ------------------
  |  Branch (1349:9): [True: 0, False: 18.4k]
  ------------------
 1350|      0|        for (uint32_t i = 0; i < item->meta->items.count; ++i) {
  ------------------
  |  Branch (1350:30): [True: 0, False: 0]
  ------------------
 1351|      0|            avifDecoderItem * tile = item->meta->items.item[i];
 1352|      0|            if (!avifIsDimgInput(item, tile->id, NULL)) {
  ------------------
  |  Branch (1352:17): [True: 0, False: 0]
  ------------------
 1353|      0|                continue;
 1354|      0|            }
 1355|       |            // Tile item types were checked in avifDecoderGenerateImageTiles(), no need to do it here.
 1356|       |
 1357|       |            // MIAF (ISO 23000-22:2019), Section 7.3.11.4.1:
 1358|       |            //   All input images of a grid image item shall use the same [...] chroma sampling format,
 1359|       |            //   and the same decoder configuration (see 7.3.6.2).
 1360|       |
 1361|       |            // The chroma sampling format is part of the decoder configuration.
 1362|      0|            const avifProperty * tileConfigProp = avifPropertyArrayFind(&tile->properties, configPropName);
 1363|      0|            if (!tileConfigProp) {
  ------------------
  |  Branch (1363:17): [True: 0, False: 0]
  ------------------
 1364|      0|                avifDiagnosticsPrintf(diag,
 1365|      0|                                      "Tile item ID %u of type '%.4s' is missing mandatory %s property",
 1366|      0|                                      tile->id,
 1367|      0|                                      (const char *)tile->type,
 1368|      0|                                      configPropName);
 1369|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1370|      0|            }
 1371|       |            // configProp was copied from a tile item to the grid item. Comparing tileConfigProp with it
 1372|       |            // is equivalent to comparing tileConfigProp with the configPropName from the first tile.
 1373|      0|            if ((tileConfigProp->u.av1C.seqProfile != configProp->u.av1C.seqProfile) ||
  ------------------
  |  Branch (1373:17): [True: 0, False: 0]
  ------------------
 1374|      0|                (tileConfigProp->u.av1C.seqLevelIdx0 != configProp->u.av1C.seqLevelIdx0) ||
  ------------------
  |  Branch (1374:17): [True: 0, False: 0]
  ------------------
 1375|      0|                (tileConfigProp->u.av1C.seqTier0 != configProp->u.av1C.seqTier0) ||
  ------------------
  |  Branch (1375:17): [True: 0, False: 0]
  ------------------
 1376|      0|                (tileConfigProp->u.av1C.highBitdepth != configProp->u.av1C.highBitdepth) ||
  ------------------
  |  Branch (1376:17): [True: 0, False: 0]
  ------------------
 1377|      0|                (tileConfigProp->u.av1C.twelveBit != configProp->u.av1C.twelveBit) ||
  ------------------
  |  Branch (1377:17): [True: 0, False: 0]
  ------------------
 1378|      0|                (tileConfigProp->u.av1C.monochrome != configProp->u.av1C.monochrome) ||
  ------------------
  |  Branch (1378:17): [True: 0, False: 0]
  ------------------
 1379|      0|                (tileConfigProp->u.av1C.chromaSubsamplingX != configProp->u.av1C.chromaSubsamplingX) ||
  ------------------
  |  Branch (1379:17): [True: 0, False: 0]
  ------------------
 1380|      0|                (tileConfigProp->u.av1C.chromaSubsamplingY != configProp->u.av1C.chromaSubsamplingY) ||
  ------------------
  |  Branch (1380:17): [True: 0, False: 0]
  ------------------
 1381|      0|                (tileConfigProp->u.av1C.chromaSamplePosition != configProp->u.av1C.chromaSamplePosition)) {
  ------------------
  |  Branch (1381:17): [True: 0, False: 0]
  ------------------
 1382|      0|                avifDiagnosticsPrintf(diag,
 1383|      0|                                      "The fields of the %s property of tile item ID %u of type '%.4s' differs from other tiles",
 1384|      0|                                      configPropName,
 1385|      0|                                      tile->id,
 1386|      0|                                      (const char *)tile->type);
 1387|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1388|      0|            }
 1389|      0|        }
 1390|      0|    }
 1391|       |
 1392|  18.4k|    const avifProperty * pixiProp = avifPropertyArrayFind(&item->properties, "pixi");
 1393|  18.4k|    if (!pixiProp && (strictFlags & AVIF_STRICT_PIXI_REQUIRED)) {
  ------------------
  |  Branch (1393:9): [True: 0, False: 18.4k]
  |  Branch (1393:22): [True: 0, False: 0]
  ------------------
 1394|       |        // A pixi box is mandatory in all valid AVIF configurations. Bail out.
 1395|      0|        avifDiagnosticsPrintf(diag,
 1396|      0|                              "[Strict] Item ID %u of type '%.4s' is missing mandatory pixi property",
 1397|      0|                              item->id,
 1398|      0|                              (const char *)item->type);
 1399|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 1400|      0|    }
 1401|       |
 1402|  18.4k|    if (pixiProp) {
  ------------------
  |  Branch (1402:9): [True: 18.4k, False: 0]
  ------------------
 1403|  18.4k|        const uint32_t configDepth = avifCodecConfigurationBoxGetDepth(&configProp->u.av1C);
 1404|  50.8k|        for (uint8_t i = 0; i < pixiProp->u.pixi.planeCount; ++i) {
  ------------------
  |  Branch (1404:29): [True: 32.4k, False: 18.4k]
  ------------------
 1405|  32.4k|            if (pixiProp->u.pixi.planeDepths[i] != configDepth) {
  ------------------
  |  Branch (1405:17): [True: 0, False: 32.4k]
  ------------------
 1406|       |                // pixi depth must match configuration property depth
 1407|      0|                avifDiagnosticsPrintf(diag,
 1408|      0|                                      "Item ID %u depth specified by pixi property [%u] does not match %s property depth [%u]",
 1409|      0|                                      item->id,
 1410|      0|                                      pixiProp->u.pixi.planeDepths[i],
 1411|      0|                                      configPropName,
 1412|      0|                                      configDepth);
 1413|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1414|      0|            }
 1415|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI)
 1416|       |            if (pixiProp->u.pixi.subsamplingFlag[i]) {
 1417|       |                if (pixiProp->u.pixi.subsamplingType[i] != avifCodecConfigurationBoxGetSubsamplingType(&configProp->u.av1C, i)) {
 1418|       |                    avifDiagnosticsPrintf(diag,
 1419|       |                                          "Item ID %u subsampling type specified by pixi property [%u] for channel %u does not match %s property [%u,%u]",
 1420|       |                                          item->id,
 1421|       |                                          pixiProp->u.pixi.subsamplingType[i],
 1422|       |                                          i,
 1423|       |                                          configPropName,
 1424|       |                                          configProp->u.av1C.chromaSubsamplingX,
 1425|       |                                          configProp->u.av1C.chromaSubsamplingY);
 1426|       |                    return AVIF_RESULT_BMFF_PARSE_FAILED;
 1427|       |                }
 1428|       |                if (configProp->u.av1C.chromaSamplePosition != AVIF_CHROMA_SAMPLE_POSITION_UNKNOWN) {
 1429|       |                    const avifChromaSamplePosition expectedChromaSamplePosition =
 1430|       |                        i == AVIF_CHAN_Y ? AVIF_CHROMA_SAMPLE_POSITION_COLOCATED : configProp->u.av1C.chromaSamplePosition;
 1431|       |                    if (avifSubsamplingLocationToChromaSamplePosition(pixiProp->u.pixi.subsamplingType[i],
 1432|       |                                                                      pixiProp->u.pixi.subsamplingLocation[i]) !=
 1433|       |                        expectedChromaSamplePosition) {
 1434|       |                        avifDiagnosticsPrintf(diag,
 1435|       |                                              "Item ID %u subsampling type and location specified by pixi property [%u,%u] for channel %u does not match %s property chroma sample position [%u]",
 1436|       |                                              item->id,
 1437|       |                                              pixiProp->u.pixi.subsamplingType[i],
 1438|       |                                              pixiProp->u.pixi.subsamplingLocation[i],
 1439|       |                                              i,
 1440|       |                                              configPropName,
 1441|       |                                              configProp->u.av1C.chromaSamplePosition);
 1442|       |                        return AVIF_RESULT_BMFF_PARSE_FAILED;
 1443|       |                    }
 1444|       |                }
 1445|       |            }
 1446|       |#endif // AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI
 1447|  32.4k|        }
 1448|  18.4k|    }
 1449|       |
 1450|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 1451|       |    if (item->miniBoxPixelFormat != AVIF_PIXEL_FORMAT_NONE) {
 1452|       |        // This is a MinimizedImageBox ('mini').
 1453|       |
 1454|       |        avifPixelFormat av1CPixelFormat;
 1455|       |        if (configProp->u.av1C.monochrome) {
 1456|       |            av1CPixelFormat = AVIF_PIXEL_FORMAT_YUV400;
 1457|       |        } else if (configProp->u.av1C.chromaSubsamplingY == 1) {
 1458|       |            av1CPixelFormat = AVIF_PIXEL_FORMAT_YUV420;
 1459|       |        } else if (configProp->u.av1C.chromaSubsamplingX == 1) {
 1460|       |            av1CPixelFormat = AVIF_PIXEL_FORMAT_YUV422;
 1461|       |        } else {
 1462|       |            av1CPixelFormat = AVIF_PIXEL_FORMAT_YUV444;
 1463|       |        }
 1464|       |        if (item->miniBoxPixelFormat != av1CPixelFormat) {
 1465|       |            avifDiagnosticsPrintf(diag,
 1466|       |                                  "Item ID %u format [%s] specified by MinimizedImageBox does not match %s property format [%s]",
 1467|       |                                  item->id,
 1468|       |                                  avifPixelFormatToString(item->miniBoxPixelFormat),
 1469|       |                                  configPropName,
 1470|       |                                  avifPixelFormatToString(av1CPixelFormat));
 1471|       |            return AVIF_RESULT_BMFF_PARSE_FAILED;
 1472|       |        }
 1473|       |
 1474|       |        if (configProp->u.av1C.chromaSamplePosition == /*CSP_UNKNOWN=*/0) {
 1475|       |            // Section 6.4.2. Color config semantics of AV1 specification says:
 1476|       |            //   CSP_UNKNOWN - the source video transfer function must be signaled outside the AV1 bitstream
 1477|       |            // See https://aomediacodec.github.io/av1-spec/#color-config-semantics
 1478|       |
 1479|       |            // So item->miniBoxChromaSamplePosition can differ and will override the AV1 value.
 1480|       |        } else if ((uint8_t)item->miniBoxChromaSamplePosition != configProp->u.av1C.chromaSamplePosition) {
 1481|       |            avifDiagnosticsPrintf(diag,
 1482|       |                                  "Item ID %u chroma sample position [%u] specified by MinimizedImageBox does not match %s property chroma sample position [%u]",
 1483|       |                                  item->id,
 1484|       |                                  (uint32_t)item->miniBoxChromaSamplePosition,
 1485|       |                                  configPropName,
 1486|       |                                  configProp->u.av1C.chromaSamplePosition);
 1487|       |            return AVIF_RESULT_BMFF_PARSE_FAILED;
 1488|       |        }
 1489|       |    }
 1490|       |#endif // AVIF_ENABLE_EXPERIMENTAL_MINI
 1491|       |
 1492|  18.4k|    if (strictFlags & AVIF_STRICT_CLAP_VALID) {
  ------------------
  |  Branch (1492:9): [True: 9.06k, False: 9.33k]
  ------------------
 1493|  9.06k|        const avifProperty * clapProp = avifPropertyArrayFind(&item->properties, "clap");
 1494|  9.06k|        if (clapProp) {
  ------------------
  |  Branch (1494:13): [True: 0, False: 9.06k]
  ------------------
 1495|      0|            const avifProperty * ispeProp = avifPropertyArrayFind(&item->properties, "ispe");
 1496|      0|            if (!ispeProp) {
  ------------------
  |  Branch (1496:17): [True: 0, False: 0]
  ------------------
 1497|      0|                avifDiagnosticsPrintf(diag,
 1498|      0|                                      "[Strict] Item ID %u is missing an ispe property, so its clap property cannot be validated",
 1499|      0|                                      item->id);
 1500|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1501|      0|            }
 1502|       |
 1503|      0|            avifCropRect cropRect;
 1504|      0|            const uint32_t imageW = ispeProp->u.ispe.width;
 1505|      0|            const uint32_t imageH = ispeProp->u.ispe.height;
 1506|      0|            const avifBool validClap = avifCropRectFromCleanApertureBox(&cropRect, &clapProp->u.clap, imageW, imageH, diag);
 1507|      0|            if (!validClap) {
  ------------------
  |  Branch (1507:17): [True: 0, False: 0]
  ------------------
 1508|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 1509|      0|            }
 1510|      0|        }
 1511|  9.06k|    }
 1512|  18.4k|    return AVIF_RESULT_OK;
 1513|  18.4k|}
read.c:avifCodecConfigurationBoxGetDepth:
  453|  32.1k|{
  454|  32.1k|    if (av1C->twelveBit) {
  ------------------
  |  Branch (454:9): [True: 4.67k, False: 27.5k]
  ------------------
  455|  4.67k|        return 12;
  456|  27.5k|    } else if (av1C->highBitdepth) {
  ------------------
  |  Branch (456:16): [True: 4.32k, False: 23.1k]
  ------------------
  457|  4.32k|        return 10;
  458|  4.32k|    }
  459|  23.1k|    return 8;
  460|  32.1k|}
read.c:avifGetConfigurationPropertyName:
   58|  32.1k|{
   59|  32.1k|    static const char kUnknown[] = "****";
   60|  32.1k|    switch (codecType) {
   61|  32.1k|        case AVIF_CODEC_TYPE_AV1:
  ------------------
  |  Branch (61:9): [True: 32.1k, False: 0]
  ------------------
   62|  32.1k|            return "av1C";
   63|       |#if defined(AVIF_CODEC_AVM)
   64|       |        case AVIF_CODEC_TYPE_AV2:
   65|       |            return "av2C";
   66|       |#endif
   67|      0|        default:
  ------------------
  |  Branch (67:9): [True: 0, False: 32.1k]
  ------------------
   68|       |            assert(AVIF_FALSE);
   69|      0|            return kUnknown; // Easier to deal with than NULL.
   70|  32.1k|    }
   71|  32.1k|}
read.c:avifReadCodecConfigProperty:
 6168|  13.7k|{
 6169|  13.7k|    const avifProperty * configProp = avifPropertyArrayFind(properties, avifGetConfigurationPropertyName(codecType));
 6170|  13.7k|    if (configProp) {
  ------------------
  |  Branch (6170:9): [True: 13.7k, False: 0]
  ------------------
 6171|  13.7k|        image->depth = avifCodecConfigurationBoxGetDepth(&configProp->u.av1C);
 6172|  13.7k|        if (configProp->u.av1C.monochrome) {
  ------------------
  |  Branch (6172:13): [True: 6.79k, False: 6.99k]
  ------------------
 6173|  6.79k|            image->yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
 6174|  6.99k|        } else {
 6175|  6.99k|            if (configProp->u.av1C.chromaSubsamplingX && configProp->u.av1C.chromaSubsamplingY) {
  ------------------
  |  Branch (6175:17): [True: 5.44k, False: 1.55k]
  |  Branch (6175:58): [True: 3.59k, False: 1.85k]
  ------------------
 6176|  3.59k|                image->yuvFormat = AVIF_PIXEL_FORMAT_YUV420;
 6177|  3.59k|            } else if (configProp->u.av1C.chromaSubsamplingX) {
  ------------------
  |  Branch (6177:24): [True: 1.85k, False: 1.55k]
  ------------------
 6178|  1.85k|                image->yuvFormat = AVIF_PIXEL_FORMAT_YUV422;
 6179|  1.85k|            } else {
 6180|  1.55k|                image->yuvFormat = AVIF_PIXEL_FORMAT_YUV444;
 6181|  1.55k|            }
 6182|  6.99k|        }
 6183|  13.7k|        image->yuvChromaSamplePosition = (avifChromaSamplePosition)configProp->u.av1C.chromaSamplePosition;
 6184|  13.7k|    } else {
 6185|       |        // A configuration property box is mandatory in all valid AVIF configurations. Bail out.
 6186|      0|        return AVIF_RESULT_BMFF_PARSE_FAILED;
 6187|      0|    }
 6188|  13.7k|    return AVIF_RESULT_OK;
 6189|  13.7k|}
read.c:avifReadColorProperties:
 5780|  13.7k|{
 5781|       |    // Find and adopt all colr boxes "at most one for a given value of colour type" (HEIF 6.5.5.1, from Amendment 3)
 5782|       |    // Accept one of each type, and bail out if more than one of a given type is provided.
 5783|  13.7k|    avifBool colrICCSeen = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 5784|  82.7k|    for (uint32_t propertyIndex = 0; propertyIndex < properties->count; ++propertyIndex) {
  ------------------
  |  Branch (5784:38): [True: 68.9k, False: 13.7k]
  ------------------
 5785|  68.9k|        avifProperty * prop = &properties->prop[propertyIndex];
 5786|  68.9k|        if (!memcmp(prop->type, "colr", 4) && prop->u.colr.hasICC) {
  ------------------
  |  Branch (5786:13): [True: 13.7k, False: 55.1k]
  |  Branch (5786:47): [True: 0, False: 13.7k]
  ------------------
 5787|      0|            if (colrICCSeen) {
  ------------------
  |  Branch (5787:17): [True: 0, False: 0]
  ------------------
 5788|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5789|      0|            }
 5790|      0|            if (icc) {
  ------------------
  |  Branch (5790:17): [True: 0, False: 0]
  ------------------
 5791|      0|                avifROData iccRead;
 5792|      0|                AVIF_CHECKRES(io->read(io, 0, prop->u.colr.iccOffset, prop->u.colr.iccSize, &iccRead));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5793|      0|                AVIF_CHECKRES(avifRWDataSet(icc, iccRead.data, iccRead.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5794|      0|            }
 5795|      0|            colrICCSeen = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5796|      0|        }
 5797|  68.9k|    }
 5798|  13.7k|    return avifReadColorNclxProperty(properties, colorPrimaries, transferCharacteristics, matrixCoefficients, yuvRange, cicpSet);
 5799|  13.7k|}
read.c:avifDecoderCheckAlphaProperties:
 6036|  4.61k|{
 6037|  4.61k|    const avifImage * image = decoder->image;
 6038|       |    // The 'clap', 'irot' and 'imir' transformative properties should be applied to the alpha
 6039|       |    // auxiliary image item before considering it a plane of the color image item.
 6040|       |    // Alternatively, inequality with the transformative properties attached to the color image item
 6041|       |    // should be treated as AVIF_RESULT_NOT_IMPLEMENTED.
 6042|       |    // The latter is easier and is the behavior of libavif.
 6043|       |
 6044|  4.61k|    const avifProperty * clapProp = avifPropertyArrayFind(alphaProperties, "clap");
 6045|  4.61k|    const avifProperty * irotProp = avifPropertyArrayFind(alphaProperties, "irot");
 6046|  4.61k|    const avifProperty * imirProp = avifPropertyArrayFind(alphaProperties, "imir");
 6047|  4.61k|    if (clapProp == NULL && irotProp == NULL && imirProp == NULL) {
  ------------------
  |  Branch (6047:9): [True: 4.61k, False: 0]
  |  Branch (6047:29): [True: 4.61k, False: 0]
  |  Branch (6047:49): [True: 4.61k, False: 0]
  ------------------
 6048|       |        // However, libavif up to version 1.3.0 generated images lacking transformative property
 6049|       |        // associations with alpha auxiliary image items, so be lenient on their absence for
 6050|       |        // backward compatibility with previously generated images.
 6051|  4.61k|        return AVIF_RESULT_OK;
 6052|  4.61k|    }
 6053|       |
 6054|       |    // HEIF (ISO/IEC 23008-12), Section 6.9.1:
 6055|       |    //   When the width or the height of the alpha plane differs from the width or the height of the
 6056|       |    //   master image, respectively, the alpha plane is resized to have the same width and height as
 6057|       |    //   those of the master image.
 6058|       |    // There is no need to enforce specific 'ispe' values describing the alpha item because
 6059|       |    // the alpha item must be resized to the dimensions of the associated color item.
 6060|       |
 6061|      0|    if (!clapProp != !(image->transformFlags & AVIF_TRANSFORM_CLAP) ||
  ------------------
  |  Branch (6061:9): [True: 0, False: 0]
  ------------------
 6062|      0|        (clapProp && (clapProp->u.clap.widthN != image->clap.widthN || clapProp->u.clap.widthD != image->clap.widthD ||
  ------------------
  |  Branch (6062:10): [True: 0, False: 0]
  |  Branch (6062:23): [True: 0, False: 0]
  |  Branch (6062:72): [True: 0, False: 0]
  ------------------
 6063|      0|                      clapProp->u.clap.heightN != image->clap.heightN || clapProp->u.clap.heightD != image->clap.heightD ||
  ------------------
  |  Branch (6063:23): [True: 0, False: 0]
  |  Branch (6063:74): [True: 0, False: 0]
  ------------------
 6064|      0|                      clapProp->u.clap.horizOffN != image->clap.horizOffN || clapProp->u.clap.horizOffD != image->clap.horizOffD ||
  ------------------
  |  Branch (6064:23): [True: 0, False: 0]
  |  Branch (6064:78): [True: 0, False: 0]
  ------------------
 6065|      0|                      clapProp->u.clap.vertOffN != image->clap.vertOffN || clapProp->u.clap.vertOffD != image->clap.vertOffD))) {
  ------------------
  |  Branch (6065:23): [True: 0, False: 0]
  |  Branch (6065:76): [True: 0, False: 0]
  ------------------
 6066|      0|        avifDiagnosticsPrintf(&decoder->diag, "Clean aperture property mismatch between alpha auxiliary image item and color item");
 6067|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 6068|      0|    }
 6069|      0|    if (!irotProp != !(image->transformFlags & AVIF_TRANSFORM_IROT) || (irotProp && irotProp->u.irot.angle != image->irot.angle)) {
  ------------------
  |  Branch (6069:9): [True: 0, False: 0]
  |  Branch (6069:73): [True: 0, False: 0]
  |  Branch (6069:85): [True: 0, False: 0]
  ------------------
 6070|      0|        avifDiagnosticsPrintf(&decoder->diag, "Rotation property mismatch between alpha auxiliary image item and color item");
 6071|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 6072|      0|    }
 6073|      0|    if (!imirProp != !(image->transformFlags & AVIF_TRANSFORM_IMIR) || (imirProp && imirProp->u.imir.axis != image->imir.axis)) {
  ------------------
  |  Branch (6073:9): [True: 0, False: 0]
  |  Branch (6073:73): [True: 0, False: 0]
  |  Branch (6073:85): [True: 0, False: 0]
  ------------------
 6074|      0|        avifDiagnosticsPrintf(&decoder->diag, "Mirroring property mismatch between alpha auxiliary image item and color item");
 6075|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 6076|      0|    }
 6077|      0|    return AVIF_RESULT_OK;
 6078|      0|}
read.c:avifDecoderPrepareSample:
 5330|  46.7k|{
 5331|  46.7k|    if (!sample->data.size || sample->partialData) {
  ------------------
  |  Branch (5331:9): [True: 46.7k, False: 0]
  |  Branch (5331:31): [True: 0, False: 0]
  ------------------
 5332|       |        // This sample hasn't been read from IO or had its extents fully merged yet.
 5333|       |
 5334|  46.7k|        size_t bytesToRead = sample->size;
 5335|  46.7k|        if (partialByteCount && (bytesToRead > partialByteCount)) {
  ------------------
  |  Branch (5335:13): [True: 0, False: 46.7k]
  |  Branch (5335:33): [True: 0, False: 0]
  ------------------
 5336|      0|            bytesToRead = partialByteCount;
 5337|      0|        }
 5338|       |
 5339|  46.7k|        if (sample->itemID) {
  ------------------
  |  Branch (5339:13): [True: 46.7k, False: 0]
  ------------------
 5340|       |            // The data comes from an item. Let avifDecoderItemRead() do the heavy lifting.
 5341|       |
 5342|  46.7k|            avifDecoderItem * item;
 5343|  46.7k|            AVIF_CHECKRES(avifMetaFindOrCreateItem(decoder->data->meta, sample->itemID, &item));
  ------------------
  |  |   54|  46.7k|    do {                                  \
  |  |   55|  46.7k|        const avifResult result__ = (A);  \
  |  |   56|  46.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 46.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  46.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 46.7k]
  |  |  ------------------
  ------------------
 5344|  46.7k|            avifROData itemContents;
 5345|       |#if UINT64_MAX > SIZE_MAX
 5346|       |            if (sample->offset > SIZE_MAX) {
 5347|       |                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5348|       |            }
 5349|       |#endif
 5350|  46.7k|            size_t offset = (size_t)sample->offset;
 5351|  46.7k|            avifResult readResult = avifDecoderItemRead(item, decoder->io, &itemContents, offset, bytesToRead, &decoder->diag);
 5352|  46.7k|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (5352:17): [True: 0, False: 46.7k]
  ------------------
 5353|      0|                return readResult;
 5354|      0|            }
 5355|       |
 5356|       |            // avifDecoderItemRead is guaranteed to already be persisted by either the underlying IO
 5357|       |            // or by mergedExtents; just reuse the buffer here.
 5358|  46.7k|            sample->data = itemContents;
 5359|  46.7k|            sample->ownsData = AVIF_FALSE;
  ------------------
  |  |   89|  46.7k|#define AVIF_FALSE 0
  ------------------
 5360|  46.7k|            sample->partialData = item->partialMergedExtents;
 5361|  46.7k|        } else {
 5362|       |            // The data likely comes from a sample table. Pull the sample and make a copy if necessary.
 5363|       |
 5364|      0|            avifROData sampleContents;
 5365|      0|            if ((decoder->io->sizeHint > 0) && (sample->offset > decoder->io->sizeHint)) {
  ------------------
  |  Branch (5365:17): [True: 0, False: 0]
  |  Branch (5365:48): [True: 0, False: 0]
  ------------------
 5366|      0|                return AVIF_RESULT_BMFF_PARSE_FAILED;
 5367|      0|            }
 5368|      0|            avifResult readResult = decoder->io->read(decoder->io, 0, sample->offset, bytesToRead, &sampleContents);
 5369|      0|            if (readResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (5369:17): [True: 0, False: 0]
  ------------------
 5370|      0|                return readResult;
 5371|      0|            }
 5372|      0|            if (sampleContents.size != bytesToRead) {
  ------------------
  |  Branch (5372:17): [True: 0, False: 0]
  ------------------
 5373|      0|                return AVIF_RESULT_TRUNCATED_DATA;
 5374|      0|            }
 5375|       |
 5376|      0|            sample->ownsData = !decoder->io->persistent;
 5377|      0|            sample->partialData = (bytesToRead != sample->size);
 5378|      0|            if (decoder->io->persistent) {
  ------------------
  |  Branch (5378:17): [True: 0, False: 0]
  ------------------
 5379|      0|                sample->data = sampleContents;
 5380|      0|            } else {
 5381|      0|                AVIF_CHECKRES(avifRWDataSet((avifRWData *)&sample->data, sampleContents.data, sampleContents.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5382|      0|            }
 5383|      0|        }
 5384|  46.7k|    }
 5385|  46.7k|    return AVIF_RESULT_OK;
 5386|  46.7k|}
read.c:avifDecoderDataFrameFullyDecoded:
 7018|  83.6k|{
 7019|   642k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (7019:21): [True: 572k, False: 69.8k]
  ------------------
 7020|   572k|        if (data->tileInfos[c].decodedTileCount != data->tileInfos[c].tileCount) {
  ------------------
  |  Branch (7020:13): [True: 13.7k, False: 558k]
  ------------------
 7021|  13.7k|            return AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 7022|  13.7k|        }
 7023|   572k|    }
 7024|  69.8k|    return AVIF_TRUE;
  ------------------
  |  |   88|  69.8k|#define AVIF_TRUE 1
  ------------------
 7025|  83.6k|}
read.c:avifDecoderCreateCodecs:
 5531|  13.7k|{
 5532|  13.7k|    avifDecoderData * data = decoder->data;
 5533|  13.7k|    avifDecoderDataResetCodec(data);
 5534|       |
 5535|  13.7k|    if (data->source == AVIF_DECODER_SOURCE_TRACKS) {
  ------------------
  |  Branch (5535:9): [True: 0, False: 13.7k]
  ------------------
 5536|       |        // In this case, we will use at most two codec instances (one for the color planes and one for the alpha plane).
 5537|       |        // Gain maps are not supported.
 5538|      0|        AVIF_CHECKRES(avifCodecCreateInternal(decoder->codecChoice, &decoder->data->tiles.tile[0], &decoder->diag, &data->codec));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5539|      0|        data->tiles.tile[0].codec = data->codec;
 5540|      0|        if (data->tiles.count > 1) {
  ------------------
  |  Branch (5540:13): [True: 0, False: 0]
  ------------------
 5541|      0|            AVIF_CHECKRES(avifCodecCreateInternal(decoder->codecChoice, &decoder->data->tiles.tile[1], &decoder->diag, &data->codecAlpha));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5542|      0|            data->tiles.tile[1].codec = data->codecAlpha;
 5543|      0|        }
 5544|  13.7k|    } else {
 5545|       |        // In this case, we will use one codec instance when there is only one tile or when all of the following conditions are
 5546|       |        // met:
 5547|       |        //   - The image must have exactly one layer (i.e. decoder->imageCount == 1).
 5548|       |        //   - All the tiles must have the same operating point (because the codecs take operating point once at initialization
 5549|       |        //     and do not allow it to be changed later).
 5550|       |        //   - All the tiles must have the same value for allLayers (because the codecs take allLayers once at initialization
 5551|       |        //     and do not allow it to be changed later).
 5552|       |        //   - If the image has a single tile, it must not have a single tile alpha plane (in this case we will steal the planes
 5553|       |        //     from the decoder, so we cannot use the same decoder for both the color and the alpha planes).
 5554|       |        //   - All tiles have the same type (AV1 or AV2).
 5555|       |        //   - No tile buffer access after another tile was decoded (i.e. no Sample Transform compositing because it happens
 5556|       |        //     after decoding all tiles).
 5557|       |        // Otherwise, we will use |tiles.count| decoder instances (one instance for each tile).
 5558|  13.7k|        const avifBool canUseSingleCodecInstance =
 5559|  13.7k|            ((data->tiles.count == 1) || (decoder->imageCount == 1 && avifTilesCanBeDecodedWithSameCodecInstance(data))) &&
  ------------------
  |  Branch (5559:14): [True: 9.17k, False: 4.61k]
  |  Branch (5559:43): [True: 2.22k, False: 2.38k]
  |  Branch (5559:71): [True: 0, False: 2.22k]
  ------------------
 5560|  9.17k|            data->sampleTransformNumInputImageItems == 0;
  ------------------
  |  Branch (5560:13): [True: 9.17k, False: 0]
  ------------------
 5561|  13.7k|        if (canUseSingleCodecInstance) {
  ------------------
  |  Branch (5561:13): [True: 9.17k, False: 4.61k]
  ------------------
 5562|  9.17k|            AVIF_CHECKRES(avifCodecCreateInternal(decoder->codecChoice, &decoder->data->tiles.tile[0], &decoder->diag, &data->codec));
  ------------------
  |  |   54|  9.17k|    do {                                  \
  |  |   55|  9.17k|        const avifResult result__ = (A);  \
  |  |   56|  9.17k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 9.17k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  9.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 9.17k]
  |  |  ------------------
  ------------------
 5563|  18.3k|            for (unsigned int i = 0; i < decoder->data->tiles.count; ++i) {
  ------------------
  |  Branch (5563:38): [True: 9.17k, False: 9.17k]
  ------------------
 5564|  9.17k|                decoder->data->tiles.tile[i].codec = data->codec;
 5565|  9.17k|            }
 5566|  9.17k|        } else {
 5567|  13.8k|            for (unsigned int i = 0; i < decoder->data->tiles.count; ++i) {
  ------------------
  |  Branch (5567:38): [True: 9.23k, False: 4.61k]
  ------------------
 5568|  9.23k|                avifTile * tile = &decoder->data->tiles.tile[i];
 5569|  9.23k|                AVIF_CHECKRES(avifCodecCreateInternal(decoder->codecChoice, tile, &decoder->diag, &tile->codec));
  ------------------
  |  |   54|  9.23k|    do {                                  \
  |  |   55|  9.23k|        const avifResult result__ = (A);  \
  |  |   56|  9.23k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 9.23k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  9.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 9.23k]
  |  |  ------------------
  ------------------
 5570|  9.23k|            }
 5571|  4.61k|        }
 5572|  13.7k|    }
 5573|  13.7k|    return AVIF_RESULT_OK;
 5574|  13.7k|}
read.c:avifCodecCreateInternal:
 5465|  18.4k|{
 5466|       |#if defined(AVIF_CODEC_AVM)
 5467|       |    // AVIF_CODEC_CHOICE_AUTO leads to AVIF_CODEC_TYPE_AV1 by default. Reroute correctly.
 5468|       |    if (choice == AVIF_CODEC_CHOICE_AUTO && tile->codecType == AVIF_CODEC_TYPE_AV2) {
 5469|       |        choice = AVIF_CODEC_CHOICE_AVM;
 5470|       |    }
 5471|       |#endif
 5472|       |
 5473|  18.4k|    const avifCodecType codecTypeFromChoice = avifCodecTypeFromChoice(choice, AVIF_CODEC_FLAG_CAN_DECODE);
 5474|  18.4k|    if (codecTypeFromChoice == AVIF_CODEC_TYPE_UNKNOWN) {
  ------------------
  |  Branch (5474:9): [True: 0, False: 18.4k]
  ------------------
 5475|      0|        avifDiagnosticsPrintf(diag,
 5476|      0|                              "Tile type is %s but there is no compatible codec available to decode it",
 5477|      0|                              avifGetConfigurationPropertyName(tile->codecType));
 5478|      0|        return AVIF_RESULT_NO_CODEC_AVAILABLE;
 5479|  18.4k|    } else if (choice != AVIF_CODEC_CHOICE_AUTO && codecTypeFromChoice != tile->codecType) {
  ------------------
  |  Branch (5479:16): [True: 12.7k, False: 5.67k]
  |  Branch (5479:52): [True: 0, False: 12.7k]
  ------------------
 5480|      0|        avifDiagnosticsPrintf(diag,
 5481|      0|                              "Tile type is %s but incompatible %s codec was explicitly set as decoding implementation",
 5482|      0|                              avifGetConfigurationPropertyName(tile->codecType),
 5483|      0|                              avifCodecName(choice, AVIF_CODEC_FLAG_CAN_DECODE));
 5484|      0|        return AVIF_RESULT_DECODE_COLOR_FAILED;
 5485|      0|    }
 5486|       |
 5487|  18.4k|    AVIF_CHECKRES(avifCodecCreate(choice, AVIF_CODEC_FLAG_CAN_DECODE, codec));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 5488|  18.4k|    AVIF_CHECKERR(*codec, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 5489|  18.4k|    (*codec)->diag = diag;
 5490|  18.4k|    (*codec)->operatingPoint = tile->operatingPoint;
 5491|  18.4k|    (*codec)->allLayers = tile->input->allLayers;
 5492|  18.4k|    return AVIF_RESULT_OK;
 5493|  18.4k|}
read.c:avifTilesCanBeDecodedWithSameCodecInstance:
 5496|  2.22k|{
 5497|  2.22k|    int32_t numImageBuffers = 0, numStolenImageBuffers = 0;
 5498|  20.0k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (5498:21): [True: 17.8k, False: 2.22k]
  ------------------
 5499|  17.8k|        if (data->tileInfos[c].tileCount > 0) {
  ------------------
  |  Branch (5499:13): [True: 4.45k, False: 13.3k]
  ------------------
 5500|  4.45k|            ++numImageBuffers;
 5501|  4.45k|        }
 5502|       |        // The sample operations require multiple buffers for compositing so no plane is stolen
 5503|       |        // when there is a 'sato' Sample Transform derived image item.
 5504|  17.8k|        if (c >= AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY && c <= AVIF_SAMPLE_TRANSFORM_MAX_CATEGORY && data->tileInfos[c].tileCount > 0) {
  ------------------
  |  |  435|  35.6k|#define AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR
  ------------------
                      if (c >= AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY && c <= AVIF_SAMPLE_TRANSFORM_MAX_CATEGORY && data->tileInfos[c].tileCount > 0) {
  ------------------
  |  |  437|  26.7k|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA + AVIF_SAMPLE_TRANSFORM_MAX_NUM_EXTRA_INPUT_IMAGE_ITEMS - 1)
  |  |  ------------------
  |  |  |  |  431|  8.91k|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA - AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR)
  |  |  ------------------
  ------------------
  |  Branch (5504:13): [True: 8.91k, False: 8.91k]
  |  Branch (5504:56): [True: 8.91k, False: 0]
  |  Branch (5504:99): [True: 0, False: 8.91k]
  ------------------
 5505|      0|            continue;
 5506|      0|        }
 5507|  17.8k|        if (data->tileInfos[c].tileCount == 1) {
  ------------------
  |  Branch (5507:13): [True: 4.45k, False: 13.3k]
  ------------------
 5508|  4.45k|            ++numStolenImageBuffers;
 5509|  4.45k|        }
 5510|  17.8k|    }
 5511|  2.22k|    if (numStolenImageBuffers > 0 && numImageBuffers > 1) {
  ------------------
  |  Branch (5511:9): [True: 2.22k, False: 0]
  |  Branch (5511:38): [True: 2.22k, False: 0]
  ------------------
 5512|       |        // Single tile image with single tile alpha plane or gain map. In this case each tile needs its own decoder since the planes will be
 5513|       |        // "stolen". Stealing either the color or the alpha plane (or gain map) will invalidate the other ones when decode is called the second
 5514|       |        // (or third) time.
 5515|  2.22k|        return AVIF_FALSE;
  ------------------
  |  |   89|  2.22k|#define AVIF_FALSE 0
  ------------------
 5516|  2.22k|    }
 5517|      0|    const uint8_t firstTileOperatingPoint = data->tiles.tile[0].operatingPoint;
 5518|      0|    const avifBool firstTileAllLayers = data->tiles.tile[0].input->allLayers;
 5519|      0|    for (unsigned int i = 1; i < data->tiles.count; ++i) {
  ------------------
  |  Branch (5519:30): [True: 0, False: 0]
  ------------------
 5520|      0|        const avifTile * tile = &data->tiles.tile[i];
 5521|      0|        if (tile->operatingPoint != firstTileOperatingPoint || tile->input->allLayers != firstTileAllLayers) {
  ------------------
  |  Branch (5521:13): [True: 0, False: 0]
  |  Branch (5521:64): [True: 0, False: 0]
  ------------------
 5522|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 5523|      0|        }
 5524|       |        // avifDecoderItemValidateProperties() verified during avifDecoderParse() that all tiles
 5525|       |        // share the same coding format so no need to check for codecType equality here.
 5526|      0|    }
 5527|      0|    return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 5528|      0|}
read.c:avifDecoderPrepareTiles:
 6817|   293k|{
 6818|   339k|    for (unsigned int tileIndex = info->decodedTileCount; tileIndex < info->tileCount; ++tileIndex) {
  ------------------
  |  Branch (6818:59): [True: 60.5k, False: 279k]
  ------------------
 6819|  60.5k|        avifTile * tile = &decoder->data->tiles.tile[info->firstTileIndex + tileIndex];
 6820|       |
 6821|  60.5k|        if (nextImageIndex >= tile->input->samples.count) {
  ------------------
  |  Branch (6821:13): [True: 13.7k, False: 46.7k]
  ------------------
 6822|  13.7k|            return AVIF_RESULT_NO_IMAGES_REMAINING;
 6823|  13.7k|        }
 6824|       |
 6825|  46.7k|        avifDecodeSample * sample = &tile->input->samples.sample[nextImageIndex];
 6826|  46.7k|        avifResult prepareResult = avifDecoderPrepareSample(decoder, sample, 0);
 6827|  46.7k|        if (prepareResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (6827:13): [True: 0, False: 46.7k]
  ------------------
 6828|      0|            return prepareResult;
 6829|      0|        }
 6830|  46.7k|    }
 6831|   279k|    return AVIF_RESULT_OK;
 6832|   293k|}
read.c:avifDecoderDecodeTiles:
 6888|   279k|{
 6889|   279k|    const unsigned int oldDecodedTileCount = info->decodedTileCount;
 6890|   326k|    for (unsigned int tileIndex = oldDecodedTileCount; tileIndex < info->tileCount; ++tileIndex) {
  ------------------
  |  Branch (6890:56): [True: 46.7k, False: 279k]
  ------------------
 6891|  46.7k|        avifTile * tile = &decoder->data->tiles.tile[info->firstTileIndex + tileIndex];
 6892|       |
 6893|  46.7k|        const avifDecodeSample * sample = &tile->input->samples.sample[nextImageIndex];
 6894|  46.7k|        if (sample->data.size < sample->size) {
  ------------------
  |  Branch (6894:13): [True: 0, False: 46.7k]
  ------------------
 6895|      0|            AVIF_ASSERT_OR_RETURN(decoder->allowIncremental);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6896|       |            // Data is missing but there is no error yet. Output available pixel rows.
 6897|      0|            return AVIF_RESULT_OK;
 6898|      0|        }
 6899|       |
 6900|  46.7k|        avifBool isLimitedRangeAlpha = AVIF_FALSE;
  ------------------
  |  |   89|  46.7k|#define AVIF_FALSE 0
  ------------------
 6901|  46.7k|        tile->codec->maxThreads = decoder->maxThreads;
 6902|  46.7k|        tile->codec->imageSizeLimit = decoder->imageSizeLimit;
 6903|  46.7k|        tile->codec->imageDimensionLimit = decoder->imageDimensionLimit;
 6904|  46.7k|        if (!tile->codec->getNextImage(tile->codec, sample, avifIsAlpha(tile->input->itemCategory), &isLimitedRangeAlpha, tile->image)) {
  ------------------
  |  Branch (6904:13): [True: 0, False: 46.7k]
  ------------------
 6905|      0|            avifDiagnosticsPrintf(&decoder->diag, "tile->codec->getNextImage() failed");
 6906|      0|            return avifGetErrorForItemCategory(tile->input->itemCategory);
 6907|      0|        }
 6908|       |
 6909|       |        // Section 2.3.4 of AV1 Codec ISO Media File Format Binding v1.2.0 says:
 6910|       |        //   the full_range_flag in the colr box shall match the color_range
 6911|       |        //   flag in the Sequence Header OBU.
 6912|       |        // See https://aomediacodec.github.io/av1-isobmff/v1.2.0.html#av1codecconfigurationbox-semantics.
 6913|       |        // If a 'colr' box of colour_type 'nclx' was parsed, a mismatch between
 6914|       |        // the 'colr' decoder->image->yuvRange and the AV1 OBU
 6915|       |        // tile->image->yuvRange should be treated as an error.
 6916|       |        // However codec_svt.c was not encoding the color_range field for
 6917|       |        // multiple years, so there probably are files in the wild that will
 6918|       |        // fail decoding if this is enforced. Thus this pattern is allowed.
 6919|       |        // Section 12.1.5.1 of ISO 14496-12 (ISOBMFF) says:
 6920|       |        //   If colour information is supplied in both this [colr] box, and also
 6921|       |        //   in the video bitstream, this box takes precedence, and over-rides
 6922|       |        //   the information in the bitstream.
 6923|       |        // So decoder->image->yuvRange is kept because it was either the 'colr'
 6924|       |        // value set when the 'colr' box was parsed, or it was the AV1 OBU value
 6925|       |        // extracted from the sequence header OBU of the first tile of the first
 6926|       |        // frame (if no 'colr' box of colour_type 'nclx' was found).
 6927|       |
 6928|       |        // Alpha plane with limited range is not allowed by the latest revision
 6929|       |        // of the specification. However, it was allowed in version 1.0.0 of the
 6930|       |        // specification. To allow such files, simply convert the alpha plane to
 6931|       |        // full range.
 6932|  46.7k|        if (avifIsAlpha(tile->input->itemCategory) && isLimitedRangeAlpha) {
  ------------------
  |  Branch (6932:13): [True: 11.7k, False: 34.9k]
  |  Branch (6932:55): [True: 0, False: 11.7k]
  ------------------
 6933|      0|            avifResult result = avifImageLimitedToFullAlpha(tile->image);
 6934|      0|            if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (6934:17): [True: 0, False: 0]
  ------------------
 6935|      0|                avifDiagnosticsPrintf(&decoder->diag, "avifImageLimitedToFullAlpha failed");
 6936|      0|                return result;
 6937|      0|            }
 6938|      0|        }
 6939|       |
 6940|       |        // Scale the decoded image so that it corresponds to this tile's output dimensions
 6941|  46.7k|        if ((tile->width != tile->image->width) || (tile->height != tile->image->height)) {
  ------------------
  |  Branch (6941:13): [True: 28.3k, False: 18.4k]
  |  Branch (6941:52): [True: 0, False: 18.4k]
  ------------------
 6942|  28.3k|            if (avifImageScaleWithLimit(tile->image,
  ------------------
  |  Branch (6942:17): [True: 0, False: 28.3k]
  ------------------
 6943|  28.3k|                                        tile->width,
 6944|  28.3k|                                        tile->height,
 6945|  28.3k|                                        decoder->imageSizeLimit,
 6946|  28.3k|                                        decoder->imageDimensionLimit,
 6947|  28.3k|                                        &decoder->diag) != AVIF_RESULT_OK) {
 6948|      0|                return avifGetErrorForItemCategory(tile->input->itemCategory);
 6949|      0|            }
 6950|  28.3k|        }
 6951|       |
 6952|  46.7k|        ++info->decodedTileCount;
 6953|       |
 6954|  46.7k|        const avifBool isGrid = (info->grid.rows > 0) && (info->grid.columns > 0);
  ------------------
  |  Branch (6954:33): [True: 0, False: 46.7k]
  |  Branch (6954:58): [True: 0, False: 0]
  ------------------
 6955|  46.7k|        avifBool stealPlanes = !isGrid;
 6956|  46.7k|        if (decoder->data->meta->sampleTransformExpression.count > 0) {
  ------------------
  |  Branch (6956:13): [True: 0, False: 46.7k]
  ------------------
 6957|       |            // Keep everything as a copy for now.
 6958|      0|            stealPlanes = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 6959|      0|        }
 6960|  46.7k|        if (tile->input->itemCategory >= AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY &&
  ------------------
  |  |  435|  93.4k|#define AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR
  ------------------
  |  Branch (6960:13): [True: 0, False: 46.7k]
  ------------------
 6961|      0|            tile->input->itemCategory <= AVIF_SAMPLE_TRANSFORM_MAX_CATEGORY) {
  ------------------
  |  |  437|      0|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA + AVIF_SAMPLE_TRANSFORM_MAX_NUM_EXTRA_INPUT_IMAGE_ITEMS - 1)
  |  |  ------------------
  |  |  |  |  431|      0|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA - AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR)
  |  |  ------------------
  ------------------
  |  Branch (6961:13): [True: 0, False: 0]
  ------------------
 6962|       |            // Keep Sample Transform input image item samples in tiles.
 6963|       |            // The expression will be applied in avifDecoderNextImage() below instead, once all the tiles are available.
 6964|      0|            continue;
 6965|      0|        }
 6966|       |
 6967|  46.7k|        if (!stealPlanes) {
  ------------------
  |  Branch (6967:13): [True: 0, False: 46.7k]
  ------------------
 6968|      0|            avifImage * dstImage = decoder->image;
 6969|      0|            if (tile->input->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (6969:17): [True: 0, False: 0]
  ------------------
 6970|      0|                AVIF_ASSERT_OR_RETURN(dstImage->gainMap && dstImage->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6971|      0|                dstImage = dstImage->gainMap->image;
 6972|      0|            }
 6973|      0|            if (tileIndex == 0) {
  ------------------
  |  Branch (6973:17): [True: 0, False: 0]
  ------------------
 6974|      0|                AVIF_CHECKRES(avifDecoderDataAllocateImagePlanes(decoder->data, info, dstImage, &decoder->data->cicpSet));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6975|      0|            }
 6976|      0|            AVIF_CHECKRES(avifDecoderDataCopyTileToImage(decoder->data, info, dstImage, tile, tileIndex));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6977|  46.7k|        } else {
 6978|  46.7k|            AVIF_ASSERT_OR_RETURN(info->tileCount == 1);
  ------------------
  |  |   64|  46.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  46.7k|    do {                        \
  |  |  |  |   46|  46.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 46.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  46.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 46.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6979|  46.7k|            AVIF_ASSERT_OR_RETURN(tileIndex == 0);
  ------------------
  |  |   64|  46.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  46.7k|    do {                        \
  |  |  |  |   46|  46.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 46.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  46.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 46.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6980|  46.7k|            avifImage * src = tile->image;
 6981|       |
 6982|  46.7k|            if (tile->input->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (6982:17): [True: 0, False: 46.7k]
  ------------------
 6983|      0|                AVIF_ASSERT_OR_RETURN(decoder->image->gainMap && decoder->image->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6984|      0|                decoder->image->gainMap->image->width = src->width;
 6985|      0|                decoder->image->gainMap->image->height = src->height;
 6986|      0|                decoder->image->gainMap->image->depth = src->depth;
 6987|  46.7k|            } else {
 6988|  46.7k|                if ((decoder->image->width != src->width) || (decoder->image->height != src->height) ||
  ------------------
  |  Branch (6988:21): [True: 0, False: 46.7k]
  |  Branch (6988:62): [True: 0, False: 46.7k]
  ------------------
 6989|  46.7k|                    (decoder->image->depth != src->depth)) {
  ------------------
  |  Branch (6989:21): [True: 0, False: 46.7k]
  ------------------
 6990|      0|                    if (avifIsAlpha(tile->input->itemCategory)) {
  ------------------
  |  Branch (6990:25): [True: 0, False: 0]
  ------------------
 6991|      0|                        avifDiagnosticsPrintf(&decoder->diag,
 6992|      0|                                              "The color image item does not match the alpha image item in width, height, or bit depth");
 6993|      0|                        return AVIF_RESULT_DECODE_ALPHA_FAILED;
 6994|      0|                    }
 6995|      0|                    avifImageFreePlanes(decoder->image, AVIF_PLANES_ALL);
 6996|       |
 6997|      0|                    decoder->image->width = src->width;
 6998|      0|                    decoder->image->height = src->height;
 6999|      0|                    decoder->image->depth = src->depth;
 7000|      0|                }
 7001|  46.7k|            }
 7002|       |
 7003|  46.7k|            if (avifIsAlpha(tile->input->itemCategory)) {
  ------------------
  |  Branch (7003:17): [True: 11.7k, False: 34.9k]
  ------------------
 7004|  11.7k|                avifImageStealPlanes(decoder->image, src, AVIF_PLANES_A);
 7005|  34.9k|            } else if (tile->input->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (7005:24): [True: 0, False: 34.9k]
  ------------------
 7006|      0|                AVIF_ASSERT_OR_RETURN(decoder->image->gainMap && decoder->image->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7007|      0|                avifImageStealPlanes(decoder->image->gainMap->image, src, AVIF_PLANES_YUV);
 7008|  34.9k|            } else { // AVIF_ITEM_COLOR
 7009|  34.9k|                avifImageStealPlanes(decoder->image, src, AVIF_PLANES_YUV);
 7010|  34.9k|            }
 7011|  46.7k|        }
 7012|  46.7k|    }
 7013|   279k|    return AVIF_RESULT_OK;
 7014|   279k|}
read.c:avifDecoderDataResetCodec:
 1103|  13.7k|{
 1104|  32.1k|    for (unsigned int i = 0; i < data->tiles.count; ++i) {
  ------------------
  |  Branch (1104:30): [True: 18.4k, False: 13.7k]
  ------------------
 1105|  18.4k|        avifTile * tile = &data->tiles.tile[i];
 1106|  18.4k|        if (tile->image) {
  ------------------
  |  Branch (1106:13): [True: 18.4k, False: 0]
  ------------------
 1107|  18.4k|            avifImageFreePlanes(tile->image, AVIF_PLANES_ALL); // forget any pointers into codec image buffers
 1108|  18.4k|        }
 1109|  18.4k|        if (tile->codec) {
  ------------------
  |  Branch (1109:13): [True: 0, False: 18.4k]
  ------------------
 1110|       |            // Check if tile->codec was created separately and destroy it in that case.
 1111|      0|            if (tile->codec != data->codec && tile->codec != data->codecAlpha) {
  ------------------
  |  Branch (1111:17): [True: 0, False: 0]
  |  Branch (1111:47): [True: 0, False: 0]
  ------------------
 1112|      0|                avifCodecDestroy(tile->codec);
 1113|      0|            }
 1114|      0|            tile->codec = NULL;
 1115|      0|        }
 1116|  18.4k|    }
 1117|   124k|    for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) {
  ------------------
  |  Branch (1117:21): [True: 110k, False: 13.7k]
  ------------------
 1118|   110k|        data->tileInfos[c].decodedTileCount = 0;
 1119|   110k|    }
 1120|  13.7k|    if (data->codec) {
  ------------------
  |  Branch (1120:9): [True: 0, False: 13.7k]
  ------------------
 1121|      0|        avifCodecDestroy(data->codec);
 1122|      0|        data->codec = NULL;
 1123|      0|    }
 1124|  13.7k|    if (data->codecAlpha) {
  ------------------
  |  Branch (1124:9): [True: 0, False: 13.7k]
  ------------------
 1125|      0|        avifCodecDestroy(data->codecAlpha);
 1126|       |        data->codecAlpha = NULL;
 1127|      0|    }
 1128|  13.7k|}

avifLibYUVVersion:
 1182|  13.7k|{
 1183|       |    return (unsigned int)LIBYUV_VERSION;
 1184|  13.7k|}

avifImageScaleWithLimit:
   30|  28.3k|{
   31|  28.3k|    if ((image->width == dstWidth) && (image->height == dstHeight)) {
  ------------------
  |  Branch (31:9): [True: 0, False: 28.3k]
  |  Branch (31:39): [True: 0, False: 0]
  ------------------
   32|       |        // Nothing to do
   33|      0|        return AVIF_RESULT_OK;
   34|      0|    }
   35|       |
   36|  28.3k|    if ((dstWidth == 0) || (dstHeight == 0)) {
  ------------------
  |  Branch (36:9): [True: 0, False: 28.3k]
  |  Branch (36:28): [True: 0, False: 28.3k]
  ------------------
   37|      0|        avifDiagnosticsPrintf(diag, "avifImageScaleWithLimit requested invalid dst dimensions [%ux%u]", dstWidth, dstHeight);
   38|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
   39|      0|    }
   40|  28.3k|    if (avifDimensionsTooLarge(dstWidth, dstHeight, imageSizeLimit, imageDimensionLimit)) {
  ------------------
  |  Branch (40:9): [True: 0, False: 28.3k]
  ------------------
   41|      0|        avifDiagnosticsPrintf(diag, "avifImageScaleWithLimit requested dst dimensions that are too large [%ux%u]", dstWidth, dstHeight);
   42|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
   43|      0|    }
   44|       |
   45|  28.3k|    uint8_t * srcYUVPlanes[AVIF_PLANE_COUNT_YUV];
   46|  28.3k|    uint32_t srcYUVRowBytes[AVIF_PLANE_COUNT_YUV];
   47|   113k|    for (int i = 0; i < AVIF_PLANE_COUNT_YUV; ++i) {
  ------------------
  |  |  112|   113k|#define AVIF_PLANE_COUNT_YUV 3
  ------------------
  |  Branch (47:21): [True: 84.9k, False: 28.3k]
  ------------------
   48|  84.9k|        srcYUVPlanes[i] = image->yuvPlanes[i];
   49|  84.9k|        image->yuvPlanes[i] = NULL;
   50|  84.9k|        srcYUVRowBytes[i] = image->yuvRowBytes[i];
   51|  84.9k|        image->yuvRowBytes[i] = 0;
   52|  84.9k|    }
   53|  28.3k|    const avifBool srcImageOwnsYUVPlanes = image->imageOwnsYUVPlanes;
   54|  28.3k|    image->imageOwnsYUVPlanes = AVIF_FALSE;
  ------------------
  |  |   89|  28.3k|#define AVIF_FALSE 0
  ------------------
   55|       |
   56|  28.3k|    uint8_t * srcAlphaPlane = image->alphaPlane;
   57|  28.3k|    image->alphaPlane = NULL;
   58|  28.3k|    uint32_t srcAlphaRowBytes = image->alphaRowBytes;
   59|  28.3k|    image->alphaRowBytes = 0;
   60|  28.3k|    const avifBool srcImageOwnsAlphaPlane = image->imageOwnsAlphaPlane;
   61|  28.3k|    image->imageOwnsAlphaPlane = AVIF_FALSE;
  ------------------
  |  |   89|  28.3k|#define AVIF_FALSE 0
  ------------------
   62|       |
   63|  28.3k|    const uint32_t srcWidth = image->width;
   64|  28.3k|    const uint32_t srcHeight = image->height;
   65|  28.3k|    const uint32_t srcUVWidth = avifImagePlaneWidth(image, AVIF_CHAN_U);
   66|  28.3k|    const uint32_t srcUVHeight = avifImagePlaneHeight(image, AVIF_CHAN_U);
   67|  28.3k|    image->width = dstWidth;
   68|  28.3k|    image->height = dstHeight;
   69|       |
   70|  28.3k|    avifResult result = AVIF_RESULT_OK;
   71|  28.3k|    if (srcYUVPlanes[0] || srcAlphaPlane) {
  ------------------
  |  Branch (71:9): [True: 21.1k, False: 7.16k]
  |  Branch (71:28): [True: 7.16k, False: 0]
  ------------------
   72|       |        // A simple conservative check to avoid integer overflows in libyuv's ScalePlane() and
   73|       |        // ScalePlane_12() functions.
   74|  28.3k|        if (srcWidth > 16384) {
  ------------------
  |  Branch (74:13): [True: 0, False: 28.3k]
  ------------------
   75|      0|            avifDiagnosticsPrintf(diag, "avifImageScaleWithLimit requested invalid width scale for libyuv [%u -> %u]", srcWidth, dstWidth);
   76|      0|            result = AVIF_RESULT_NOT_IMPLEMENTED;
   77|      0|            goto cleanup;
   78|      0|        }
   79|  28.3k|        if (srcHeight > 16384) {
  ------------------
  |  Branch (79:13): [True: 0, False: 28.3k]
  ------------------
   80|      0|            avifDiagnosticsPrintf(diag, "avifImageScaleWithLimit requested invalid height scale for libyuv [%u -> %u]", srcHeight, dstHeight);
   81|      0|            result = AVIF_RESULT_NOT_IMPLEMENTED;
   82|      0|            goto cleanup;
   83|      0|        }
   84|  28.3k|    }
   85|       |
   86|  28.3k|    if (srcYUVPlanes[0]) {
  ------------------
  |  Branch (86:9): [True: 21.1k, False: 7.16k]
  ------------------
   87|  21.1k|        const avifResult allocationResult = avifImageAllocatePlanes(image, AVIF_PLANES_YUV);
   88|  21.1k|        if (allocationResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (88:13): [True: 0, False: 21.1k]
  ------------------
   89|      0|            avifDiagnosticsPrintf(diag, "Allocation of YUV planes failed: %s", avifResultToString(allocationResult));
   90|      0|            result = AVIF_RESULT_OUT_OF_MEMORY;
   91|      0|            goto cleanup;
   92|      0|        }
   93|       |
   94|  84.5k|        for (int i = 0; i < AVIF_PLANE_COUNT_YUV; ++i) {
  ------------------
  |  |  112|  84.5k|#define AVIF_PLANE_COUNT_YUV 3
  ------------------
  |  Branch (94:25): [True: 63.4k, False: 21.1k]
  ------------------
   95|  63.4k|            if (!srcYUVPlanes[i]) {
  ------------------
  |  Branch (95:17): [True: 20.7k, False: 42.7k]
  ------------------
   96|  20.7k|                continue;
   97|  20.7k|            }
   98|       |
   99|  42.7k|            const uint32_t srcW = (i == AVIF_CHAN_Y) ? srcWidth : srcUVWidth;
  ------------------
  |  Branch (99:35): [True: 21.1k, False: 21.5k]
  ------------------
  100|  42.7k|            const uint32_t srcH = (i == AVIF_CHAN_Y) ? srcHeight : srcUVHeight;
  ------------------
  |  Branch (100:35): [True: 21.1k, False: 21.5k]
  ------------------
  101|  42.7k|            const uint32_t dstW = avifImagePlaneWidth(image, i);
  102|  42.7k|            const uint32_t dstH = avifImagePlaneHeight(image, i);
  103|  42.7k|            if (image->depth > 8) {
  ------------------
  |  Branch (103:17): [True: 13.2k, False: 29.4k]
  ------------------
  104|  13.2k|                uint16_t * const srcPlane = (uint16_t *)srcYUVPlanes[i];
  105|  13.2k|                const uint32_t srcStride = srcYUVRowBytes[i] / 2;
  106|  13.2k|                uint16_t * const dstPlane = (uint16_t *)image->yuvPlanes[i];
  107|  13.2k|                const uint32_t dstStride = image->yuvRowBytes[i] / 2;
  108|  13.2k|#if LIBYUV_VERSION >= 1880
  109|  13.2k|                const int failure =
  110|  13.2k|                    ScalePlane_12(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE);
  ------------------
  |  |   22|  13.2k|#define AVIF_LIBYUV_FILTER_MODE kFilterBox
  ------------------
  111|  13.2k|                if (failure) {
  ------------------
  |  Branch (111:21): [True: 0, False: 13.2k]
  ------------------
  112|      0|                    avifDiagnosticsPrintf(diag, "ScalePlane_12() failed (%d)", failure);
  113|      0|                    result = (failure == 1) ? AVIF_RESULT_OUT_OF_MEMORY : AVIF_RESULT_UNKNOWN_ERROR;
  ------------------
  |  Branch (113:30): [True: 0, False: 0]
  ------------------
  114|      0|                    goto cleanup;
  115|      0|                }
  116|       |#elif LIBYUV_VERSION >= 1774
  117|       |                ScalePlane_12(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE);
  118|       |#else
  119|       |                ScalePlane_16(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE);
  120|       |#endif
  121|  29.4k|            } else {
  122|  29.4k|                uint8_t * const srcPlane = srcYUVPlanes[i];
  123|  29.4k|                const uint32_t srcStride = srcYUVRowBytes[i];
  124|  29.4k|                uint8_t * const dstPlane = image->yuvPlanes[i];
  125|  29.4k|                const uint32_t dstStride = image->yuvRowBytes[i];
  126|  29.4k|#if LIBYUV_VERSION >= 1880
  127|  29.4k|                const int failure = ScalePlane(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE);
  ------------------
  |  |   22|  29.4k|#define AVIF_LIBYUV_FILTER_MODE kFilterBox
  ------------------
  128|  29.4k|                if (failure) {
  ------------------
  |  Branch (128:21): [True: 0, False: 29.4k]
  ------------------
  129|      0|                    avifDiagnosticsPrintf(diag, "ScalePlane() failed (%d)", failure);
  130|      0|                    result = (failure == 1) ? AVIF_RESULT_OUT_OF_MEMORY : AVIF_RESULT_UNKNOWN_ERROR;
  ------------------
  |  Branch (130:30): [True: 0, False: 0]
  ------------------
  131|      0|                    goto cleanup;
  132|      0|                }
  133|       |#else
  134|       |                ScalePlane(srcPlane, srcStride, srcW, srcH, dstPlane, dstStride, dstW, dstH, AVIF_LIBYUV_FILTER_MODE);
  135|       |#endif
  136|  29.4k|            }
  137|  42.7k|        }
  138|  21.1k|    }
  139|       |
  140|  28.3k|    if (srcAlphaPlane) {
  ------------------
  |  Branch (140:9): [True: 7.16k, False: 21.1k]
  ------------------
  141|  7.16k|        const avifResult allocationResult = avifImageAllocatePlanes(image, AVIF_PLANES_A);
  142|  7.16k|        if (allocationResult != AVIF_RESULT_OK) {
  ------------------
  |  Branch (142:13): [True: 0, False: 7.16k]
  ------------------
  143|      0|            avifDiagnosticsPrintf(diag, "Allocation of alpha plane failed: %s", avifResultToString(allocationResult));
  144|      0|            result = AVIF_RESULT_OUT_OF_MEMORY;
  145|      0|            goto cleanup;
  146|      0|        }
  147|       |
  148|  7.16k|        if (image->depth > 8) {
  ------------------
  |  Branch (148:13): [True: 1.94k, False: 5.21k]
  ------------------
  149|  1.94k|            uint16_t * const srcPlane = (uint16_t *)srcAlphaPlane;
  150|  1.94k|            const uint32_t srcStride = srcAlphaRowBytes / 2;
  151|  1.94k|            uint16_t * const dstPlane = (uint16_t *)image->alphaPlane;
  152|  1.94k|            const uint32_t dstStride = image->alphaRowBytes / 2;
  153|  1.94k|#if LIBYUV_VERSION >= 1880
  154|  1.94k|            const int failure =
  155|  1.94k|                ScalePlane_12(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE);
  ------------------
  |  |   22|  1.94k|#define AVIF_LIBYUV_FILTER_MODE kFilterBox
  ------------------
  156|  1.94k|            if (failure) {
  ------------------
  |  Branch (156:17): [True: 0, False: 1.94k]
  ------------------
  157|      0|                avifDiagnosticsPrintf(diag, "ScalePlane_12() failed (%d)", failure);
  158|      0|                result = (failure == 1) ? AVIF_RESULT_OUT_OF_MEMORY : AVIF_RESULT_UNKNOWN_ERROR;
  ------------------
  |  Branch (158:26): [True: 0, False: 0]
  ------------------
  159|      0|                goto cleanup;
  160|      0|            }
  161|       |#elif LIBYUV_VERSION >= 1774
  162|       |            ScalePlane_12(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE);
  163|       |#else
  164|       |            ScalePlane_16(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE);
  165|       |#endif
  166|  5.21k|        } else {
  167|  5.21k|            uint8_t * const srcPlane = srcAlphaPlane;
  168|  5.21k|            const uint32_t srcStride = srcAlphaRowBytes;
  169|  5.21k|            uint8_t * const dstPlane = image->alphaPlane;
  170|  5.21k|            const uint32_t dstStride = image->alphaRowBytes;
  171|  5.21k|#if LIBYUV_VERSION >= 1880
  172|  5.21k|            const int failure =
  173|  5.21k|                ScalePlane(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE);
  ------------------
  |  |   22|  5.21k|#define AVIF_LIBYUV_FILTER_MODE kFilterBox
  ------------------
  174|  5.21k|            if (failure) {
  ------------------
  |  Branch (174:17): [True: 0, False: 5.21k]
  ------------------
  175|      0|                avifDiagnosticsPrintf(diag, "ScalePlane() failed (%d)", failure);
  176|      0|                result = (failure == 1) ? AVIF_RESULT_OUT_OF_MEMORY : AVIF_RESULT_UNKNOWN_ERROR;
  ------------------
  |  Branch (176:26): [True: 0, False: 0]
  ------------------
  177|      0|                goto cleanup;
  178|      0|            }
  179|       |#else
  180|       |            ScalePlane(srcPlane, srcStride, srcWidth, srcHeight, dstPlane, dstStride, dstWidth, dstHeight, AVIF_LIBYUV_FILTER_MODE);
  181|       |#endif
  182|  5.21k|        }
  183|  7.16k|    }
  184|       |
  185|  28.3k|cleanup:
  186|  28.3k|    if (srcYUVPlanes[0] && srcImageOwnsYUVPlanes) {
  ------------------
  |  Branch (186:9): [True: 21.1k, False: 7.16k]
  |  Branch (186:28): [True: 0, False: 21.1k]
  ------------------
  187|      0|        for (int i = 0; i < AVIF_PLANE_COUNT_YUV; ++i) {
  ------------------
  |  |  112|      0|#define AVIF_PLANE_COUNT_YUV 3
  ------------------
  |  Branch (187:25): [True: 0, False: 0]
  ------------------
  188|      0|            avifFree(srcYUVPlanes[i]);
  189|      0|        }
  190|      0|    }
  191|  28.3k|    if (srcAlphaPlane && srcImageOwnsAlphaPlane) {
  ------------------
  |  Branch (191:9): [True: 7.16k, False: 21.1k]
  |  Branch (191:26): [True: 0, False: 7.16k]
  ------------------
  192|      0|        avifFree(srcAlphaPlane);
  193|      0|    }
  194|  28.3k|    return result;
  195|  28.3k|}

avifROStreamCurrent:
   15|   258k|{
   16|   258k|    return stream->raw->data + stream->offset;
   17|   258k|}
avifROStreamStart:
   20|   262k|{
   21|   262k|    stream->raw = raw;
   22|   262k|    stream->offset = 0;
   23|   262k|    stream->numUsedBitsInPartialByte = 0;
   24|   262k|    stream->diag = diag;
   25|   262k|    stream->diagContext = diagContext;
   26|       |
   27|       |    // If diag is non-NULL, diagContext must also be non-NULL
   28|       |    assert(!stream->diag || stream->diagContext);
   29|   262k|}
avifROStreamHasBytesLeft:
   32|  2.12M|{
   33|  2.12M|    return byteCount <= (stream->raw->size - stream->offset);
   34|  2.12M|}
avifROStreamRemainingBytes:
   37|  50.6k|{
   38|  50.6k|    return stream->raw->size - stream->offset;
   39|  50.6k|}
avifROStreamOffset:
   42|   101k|{
   43|   101k|    return stream->offset;
   44|   101k|}
avifROStreamSkip:
   56|   420k|{
   57|   420k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
   58|   420k|    if (!avifROStreamHasBytesLeft(stream, byteCount)) {
  ------------------
  |  Branch (58:9): [True: 0, False: 420k]
  ------------------
   59|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Failed to skip %zu bytes, truncated data?", stream->diagContext, byteCount);
   60|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
   61|      0|    }
   62|   420k|    stream->offset += byteCount;
   63|   420k|    return AVIF_TRUE;
  ------------------
  |  |   88|   420k|#define AVIF_TRUE 1
  ------------------
   64|   420k|}
avifROStreamRead:
   67|  1.27M|{
   68|  1.27M|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
   69|  1.27M|    if (!avifROStreamHasBytesLeft(stream, size)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 1.27M]
  ------------------
   70|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Failed to read %zu bytes, truncated data?", stream->diagContext, size);
   71|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
   72|      0|    }
   73|       |
   74|  1.27M|    memcpy(data, stream->raw->data + stream->offset, size);
   75|  1.27M|    stream->offset += size;
   76|  1.27M|    return AVIF_TRUE;
  ------------------
  |  |   88|  1.27M|#define AVIF_TRUE 1
  ------------------
   77|  1.27M|}
avifROStreamReadUX8:
   80|   165k|{
   81|   165k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
   82|   165k|    if (factor == 0) {
  ------------------
  |  Branch (82:9): [True: 18.4k, False: 147k]
  ------------------
   83|       |        // Don't read anything, just set to 0
   84|  18.4k|        *v = 0;
   85|   147k|    } else if (factor == 1) {
  ------------------
  |  Branch (85:16): [True: 0, False: 147k]
  ------------------
   86|      0|        uint8_t tmp;
   87|      0|        AVIF_CHECK(avifROStreamRead(stream, &tmp, 1));
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   88|      0|        *v = tmp;
   89|   147k|    } else if (factor == 2) {
  ------------------
  |  Branch (89:16): [True: 0, False: 147k]
  ------------------
   90|      0|        uint16_t tmp;
   91|      0|        AVIF_CHECK(avifROStreamReadU16(stream, &tmp));
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   92|      0|        *v = tmp;
   93|   147k|    } else if (factor == 4) {
  ------------------
  |  Branch (93:16): [True: 147k, False: 0]
  ------------------
   94|   147k|        uint32_t tmp;
   95|   147k|        AVIF_CHECK(avifROStreamReadU32(stream, &tmp));
  ------------------
  |  |   36|   147k|    do {                        \
  |  |   37|   147k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 147k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   147k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 147k]
  |  |  ------------------
  ------------------
   96|   147k|        *v = tmp;
   97|   147k|    } else if (factor == 8) {
  ------------------
  |  Branch (97:16): [True: 0, False: 0]
  ------------------
   98|      0|        uint64_t tmp;
   99|      0|        AVIF_CHECK(avifROStreamReadU64(stream, &tmp));
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  100|      0|        *v = tmp;
  101|      0|    } else {
  102|       |        // Unsupported factor
  103|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Failed to read UX8 value; Unsupported UX8 factor [%" PRIu64 "]", stream->diagContext, factor);
  104|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  105|      0|    }
  106|   165k|    return AVIF_TRUE;
  ------------------
  |  |   88|   165k|#define AVIF_TRUE 1
  ------------------
  107|   165k|}
avifROStreamReadU16:
  110|   262k|{
  111|   262k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  112|   262k|    AVIF_CHECK(avifROStreamRead(stream, (uint8_t *)v, sizeof(uint16_t)));
  ------------------
  |  |   36|   262k|    do {                        \
  |  |   37|   262k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 262k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   262k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 262k]
  |  |  ------------------
  ------------------
  113|   262k|    *v = avifNTOHS(*v);
  114|   262k|    return AVIF_TRUE;
  ------------------
  |  |   88|   262k|#define AVIF_TRUE 1
  ------------------
  115|   262k|}
avifROStreamReadU32:
  126|   478k|{
  127|   478k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  128|   478k|    AVIF_CHECK(avifROStreamRead(stream, (uint8_t *)v, sizeof(uint32_t)));
  ------------------
  |  |   36|   478k|    do {                        \
  |  |   37|   478k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 478k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   478k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 478k]
  |  |  ------------------
  ------------------
  129|   478k|    *v = avifNTOHL(*v);
  130|   478k|    return AVIF_TRUE;
  ------------------
  |  |   88|   478k|#define AVIF_TRUE 1
  ------------------
  131|   478k|}
avifROStreamReadBitsU8:
  167|   308k|{
  168|   308k|    AVIF_CHECK(bitCount <= sizeof(*v) * 8);
  ------------------
  |  |   36|   308k|    do {                        \
  |  |   37|   308k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 308k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   308k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 308k]
  |  |  ------------------
  ------------------
  169|   308k|    uint32_t vU32;
  170|   308k|    AVIF_CHECK(avifROStreamReadBitsU32(stream, &vU32, bitCount));
  ------------------
  |  |   36|   308k|    do {                        \
  |  |   37|   308k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 308k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   308k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 308k]
  |  |  ------------------
  ------------------
  171|   308k|    *v = (uint8_t)vU32;
  172|   308k|    return AVIF_TRUE;
  ------------------
  |  |   88|   308k|#define AVIF_TRUE 1
  ------------------
  173|   308k|}
avifROStreamReadBitsU32:
  185|   446k|{
  186|   446k|    AVIF_CHECK(bitCount <= sizeof(*v) * 8);
  ------------------
  |  |   36|   446k|    do {                        \
  |  |   37|   446k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 446k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   446k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 446k]
  |  |  ------------------
  ------------------
  187|   446k|    *v = 0;
  188|   893k|    while (bitCount) {
  ------------------
  |  Branch (188:12): [True: 446k, False: 446k]
  ------------------
  189|   446k|        if (stream->numUsedBitsInPartialByte == 0) {
  ------------------
  |  Branch (189:13): [True: 182k, False: 264k]
  ------------------
  190|   182k|            AVIF_CHECK(avifROStreamSkip(stream, sizeof(uint8_t))); // Book a new partial byte in the stream.
  ------------------
  |  |   36|   182k|    do {                        \
  |  |   37|   182k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 182k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   182k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 182k]
  |  |  ------------------
  ------------------
  191|   182k|        }
  192|   446k|        assert(stream->offset > 0);
  193|   446k|        const uint8_t * packedBits = stream->raw->data + stream->offset - 1;
  194|       |
  195|   446k|        const size_t numBits = AVIF_MIN(bitCount, 8 - stream->numUsedBitsInPartialByte);
  ------------------
  |  |   19|   446k|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 264k, False: 182k]
  |  |  ------------------
  ------------------
  196|   446k|        stream->numUsedBitsInPartialByte += numBits;
  197|   446k|        bitCount -= numBits;
  198|       |        // The stream bits are packed starting with the most significant bit of the first input byte.
  199|       |        // This way, packed bits can be found in the same order in the bit stream.
  200|   446k|        const uint32_t bits = (*packedBits >> (8 - stream->numUsedBitsInPartialByte)) & ((1 << numBits) - 1);
  201|       |        // The value bits are ordered from the most significant bit to the least significant bit.
  202|       |        // In the case where avifROStreamReadBitsU32() is used to parse the unsigned integer value *v
  203|       |        // over multiple aligned bytes, this order corresponds to big endianness.
  204|   446k|        *v |= bits << bitCount;
  205|       |
  206|   446k|        if (stream->numUsedBitsInPartialByte == 8) {
  ------------------
  |  Branch (206:13): [True: 182k, False: 264k]
  ------------------
  207|       |            // Start a new partial byte the next time a bit is needed.
  208|   182k|            stream->numUsedBitsInPartialByte = 0;
  209|   182k|        }
  210|   446k|    }
  211|   446k|    return AVIF_TRUE;
  ------------------
  |  |   88|   446k|#define AVIF_TRUE 1
  ------------------
  212|   446k|}
avifROStreamReadString:
  215|  36.8k|{
  216|  36.8k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  217|       |
  218|       |    // Check for the presence of a null terminator in the stream.
  219|  36.8k|    size_t remainingBytes = avifROStreamRemainingBytes(stream);
  220|  36.8k|    const uint8_t * p = avifROStreamCurrent(stream);
  221|  36.8k|    avifBool foundNullTerminator = AVIF_FALSE;
  ------------------
  |  |   89|  36.8k|#define AVIF_FALSE 0
  ------------------
  222|   327k|    for (size_t i = 0; i < remainingBytes; ++i) {
  ------------------
  |  Branch (222:24): [True: 327k, False: 0]
  ------------------
  223|   327k|        if (p[i] == 0) {
  ------------------
  |  Branch (223:13): [True: 36.8k, False: 290k]
  ------------------
  224|  36.8k|            foundNullTerminator = AVIF_TRUE;
  ------------------
  |  |   88|  36.8k|#define AVIF_TRUE 1
  ------------------
  225|  36.8k|            break;
  226|  36.8k|        }
  227|   327k|    }
  228|  36.8k|    if (!foundNullTerminator) {
  ------------------
  |  Branch (228:9): [True: 0, False: 36.8k]
  ------------------
  229|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Failed to find a NULL terminator when reading a string", stream->diagContext);
  230|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  231|      0|    }
  232|       |
  233|  36.8k|    const char * streamString = (const char *)p;
  234|  36.8k|    size_t stringLen = strlen(streamString);
  235|  36.8k|    stream->offset += stringLen + 1; // update the stream to have read the "whole string" in
  236|       |
  237|  36.8k|    if (output && outputSize) {
  ------------------
  |  Branch (237:9): [True: 4.61k, False: 32.1k]
  |  Branch (237:19): [True: 4.61k, False: 0]
  ------------------
  238|       |        // clamp to our output buffer
  239|  4.61k|        if (stringLen >= outputSize) {
  ------------------
  |  Branch (239:13): [True: 0, False: 4.61k]
  ------------------
  240|      0|            stringLen = outputSize - 1;
  241|      0|        }
  242|  4.61k|        memcpy(output, streamString, stringLen);
  243|  4.61k|        output[stringLen] = 0;
  244|  4.61k|    }
  245|  36.8k|    return AVIF_TRUE;
  ------------------
  |  |   88|  36.8k|#define AVIF_TRUE 1
  ------------------
  246|  36.8k|}
avifROStreamReadBoxHeaderPartial:
  249|   235k|{
  250|       |    // Section 4.2.2 of ISO/IEC 14496-12.
  251|   235k|    size_t startOffset = stream->offset;
  252|       |
  253|   235k|    uint32_t smallSize;
  254|   235k|    AVIF_CHECK(avifROStreamReadU32(stream, &smallSize));   // unsigned int(32) size;
  ------------------
  |  |   36|   235k|    do {                        \
  |  |   37|   235k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 235k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   235k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 235k]
  |  |  ------------------
  ------------------
  255|   235k|    AVIF_CHECK(avifROStreamRead(stream, header->type, 4)); // unsigned int(32) type = boxtype;
  ------------------
  |  |   36|   235k|    do {                        \
  |  |   37|   235k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 235k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   235k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 235k]
  |  |  ------------------
  ------------------
  256|       |
  257|   235k|    uint64_t size = smallSize;
  258|   235k|    if (size == 1) {
  ------------------
  |  Branch (258:9): [True: 0, False: 235k]
  ------------------
  259|      0|        AVIF_CHECK(avifROStreamReadU64(stream, &size)); // unsigned int(64) largesize;
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  260|      0|    }
  261|       |
  262|   235k|    if (!memcmp(header->type, "uuid", 4)) {
  ------------------
  |  Branch (262:9): [True: 0, False: 235k]
  ------------------
  263|      0|        AVIF_CHECK(avifROStreamRead(stream, header->usertype, 16)); // unsigned int(8) usertype[16] = extended_type;
  ------------------
  |  |   36|      0|    do {                        \
  |  |   37|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  264|   235k|    } else {
  265|   235k|        memset(header->usertype, 0, sizeof(header->usertype));
  266|   235k|    }
  267|       |
  268|   235k|    size_t bytesRead = stream->offset - startOffset;
  269|   235k|    if (size == 0) {
  ------------------
  |  Branch (269:9): [True: 0, False: 235k]
  ------------------
  270|       |        // Section 4.2.2 of ISO/IEC 14496-12.
  271|       |        //   if size is 0, then this box shall be in a top-level box (i.e. not contained in another
  272|       |        //   box), and be the last box in its 'file', and its payload extends to the end of that
  273|       |        //   enclosing 'file'. This is normally only used for a MediaDataBox ('mdat').
  274|      0|        if (!topLevel) {
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            avifDiagnosticsPrintf(stream->diag, "%s: Non-top-level box with size 0", stream->diagContext);
  276|      0|            return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  277|      0|        }
  278|       |
  279|       |        // The given stream may be incomplete and there is no guarantee that sizeHint is available and accurate.
  280|       |        // Otherwise size could be set to avifROStreamRemainingBytes(stream) + (stream->offset - startOffset) right now.
  281|       |
  282|       |        // Wait for avifIOReadFunc() to return AVIF_RESULT_OK.
  283|      0|        header->isSizeZeroBox = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  284|      0|        header->size = 0;
  285|      0|        return AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
  286|      0|    }
  287|       |
  288|   235k|    if ((size < bytesRead) || ((size - bytesRead) > SIZE_MAX)) {
  ------------------
  |  Branch (288:9): [True: 0, False: 235k]
  |  Branch (288:31): [True: 0, False: 235k]
  ------------------
  289|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Header size overflow check failure", stream->diagContext);
  290|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  291|      0|    }
  292|   235k|    header->isSizeZeroBox = AVIF_FALSE;
  ------------------
  |  |   89|   235k|#define AVIF_FALSE 0
  ------------------
  293|   235k|    header->size = (size_t)(size - bytesRead);
  294|   235k|    return AVIF_TRUE;
  ------------------
  |  |   88|   235k|#define AVIF_TRUE 1
  ------------------
  295|   235k|}
avifROStreamReadBoxHeader:
  298|   207k|{
  299|   207k|    AVIF_CHECK(avifROStreamReadBoxHeaderPartial(stream, header, /*topLevel=*/AVIF_FALSE));
  ------------------
  |  |   36|   207k|    do {                        \
  |  |   37|   207k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 207k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   207k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 207k]
  |  |  ------------------
  ------------------
  300|   207k|    if (!avifROStreamHasBytesLeft(stream, header->size)) {
  ------------------
  |  Branch (300:9): [True: 0, False: 207k]
  ------------------
  301|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Child box too large, possibly truncated data", stream->diagContext);
  302|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  303|      0|    }
  304|   207k|    return AVIF_TRUE;
  ------------------
  |  |   88|   207k|#define AVIF_TRUE 1
  ------------------
  305|   207k|}
avifROStreamReadVersionAndFlags:
  308|   140k|{
  309|   140k|    uint8_t versionAndFlags[4];
  310|   140k|    AVIF_CHECK(avifROStreamRead(stream, versionAndFlags, 4));
  ------------------
  |  |   36|   140k|    do {                        \
  |  |   37|   140k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 140k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|   140k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 140k]
  |  |  ------------------
  ------------------
  311|   140k|    if (version) {
  ------------------
  |  Branch (311:9): [True: 140k, False: 0]
  ------------------
  312|   140k|        *version = versionAndFlags[0];
  313|   140k|    }
  314|   140k|    if (flags) {
  ------------------
  |  Branch (314:9): [True: 62.3k, False: 78.1k]
  ------------------
  315|  62.3k|        *flags = (versionAndFlags[1] << 16) + (versionAndFlags[2] << 8) + (versionAndFlags[3] << 0);
  316|  62.3k|    }
  317|   140k|    return AVIF_TRUE;
  ------------------
  |  |   88|   140k|#define AVIF_TRUE 1
  ------------------
  318|   140k|}
avifROStreamReadAndEnforceVersion:
  321|  62.3k|{
  322|  62.3k|    uint8_t version;
  323|  62.3k|    AVIF_CHECK(avifROStreamReadVersionAndFlags(stream, &version, flags));
  ------------------
  |  |   36|  62.3k|    do {                        \
  |  |   37|  62.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (37:13): [True: 0, False: 62.3k]
  |  |  ------------------
  |  |   38|      0|            avifBreakOnError(); \
  |  |   39|      0|            return AVIF_FALSE;  \
  |  |  ------------------
  |  |  |  |   89|      0|#define AVIF_FALSE 0
  |  |  ------------------
  |  |   40|      0|        }                       \
  |  |   41|  62.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (41:14): [Folded, False: 62.3k]
  |  |  ------------------
  ------------------
  324|  62.3k|    if (version != enforcedVersion) {
  ------------------
  |  Branch (324:9): [True: 0, False: 62.3k]
  ------------------
  325|      0|        avifDiagnosticsPrintf(stream->diag, "%s: Expecting box version %u, got version %u", stream->diagContext, enforcedVersion, version);
  326|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  327|      0|    }
  328|  62.3k|    return AVIF_TRUE;
  ------------------
  |  |   88|  62.3k|#define AVIF_TRUE 1
  ------------------
  329|  62.3k|}
avifRWStreamStart:
  351|   105k|{
  352|   105k|    stream->raw = raw;
  353|   105k|    stream->offset = 0;
  354|   105k|    stream->numUsedBitsInPartialByte = 0;
  355|   105k|}
avifRWStreamOffset:
  358|   483k|{
  359|   483k|    return stream->offset;
  360|   483k|}
avifRWStreamSetOffset:
  363|   147k|{
  364|   147k|    stream->offset = offset;
  365|   147k|    if (stream->offset > stream->raw->size) {
  ------------------
  |  Branch (365:9): [True: 0, False: 147k]
  ------------------
  366|      0|        stream->offset = stream->raw->size;
  367|      0|    }
  368|   147k|}
avifRWStreamFinishWrite:
  371|  13.7k|{
  372|  13.7k|    if (stream->raw->size != stream->offset) {
  ------------------
  |  Branch (372:9): [True: 13.7k, False: 0]
  ------------------
  373|  13.7k|        if (stream->offset) {
  ------------------
  |  Branch (373:13): [True: 13.7k, False: 0]
  ------------------
  374|  13.7k|            stream->raw->size = stream->offset;
  375|  13.7k|        } else {
  376|      0|            avifRWDataFree(stream->raw);
  377|      0|        }
  378|  13.7k|    }
  379|  13.7k|}
avifRWStreamWrite:
  382|   299k|{
  383|   299k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  384|   299k|    if (size) {
  ------------------
  |  Branch (384:9): [True: 299k, False: 0]
  ------------------
  385|   299k|        AVIF_CHECKRES(makeRoom(stream, size));
  ------------------
  |  |   54|   299k|    do {                                  \
  |  |   55|   299k|        const avifResult result__ = (A);  \
  |  |   56|   299k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 299k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   299k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 299k]
  |  |  ------------------
  ------------------
  386|   299k|        memcpy(stream->raw->data + stream->offset, data, size);
  387|   299k|        stream->offset += size;
  388|   299k|    }
  389|   299k|    return AVIF_RESULT_OK;
  390|   299k|}
avifRWStreamWriteChars:
  393|   123k|{
  394|   123k|    return avifRWStreamWrite(stream, chars, size);
  395|   123k|}
avifRWStreamWriteFullBox:
  398|   257k|{
  399|   257k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  400|   257k|    if (marker) {
  ------------------
  |  Branch (400:9): [True: 243k, False: 13.7k]
  ------------------
  401|   243k|        *marker = stream->offset;
  402|   243k|    }
  403|   257k|    size_t headerSize = sizeof(uint32_t) + 4 /* size of type */;
  404|   257k|    if (version != -1) {
  ------------------
  |  Branch (404:9): [True: 147k, False: 110k]
  ------------------
  405|   147k|        headerSize += 4;
  406|   147k|    }
  407|       |
  408|   257k|    AVIF_CHECKRES(makeRoom(stream, headerSize));
  ------------------
  |  |   54|   257k|    do {                                  \
  |  |   55|   257k|        const avifResult result__ = (A);  \
  |  |   56|   257k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 257k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   257k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 257k]
  |  |  ------------------
  ------------------
  409|   257k|    memset(stream->raw->data + stream->offset, 0, headerSize);
  410|   257k|    uint32_t noSize = avifHTONL((uint32_t)(headerSize + contentSize));
  411|   257k|    memcpy(stream->raw->data + stream->offset, &noSize, sizeof(uint32_t));
  412|   257k|    memcpy(stream->raw->data + stream->offset + 4, type, 4);
  413|   257k|    if (version != -1) {
  ------------------
  |  Branch (413:9): [True: 147k, False: 110k]
  ------------------
  414|   147k|        stream->raw->data[stream->offset + 8] = (uint8_t)version;
  415|   147k|        stream->raw->data[stream->offset + 9] = (uint8_t)((flags >> 16) & 0xff);
  416|   147k|        stream->raw->data[stream->offset + 10] = (uint8_t)((flags >> 8) & 0xff);
  417|   147k|        stream->raw->data[stream->offset + 11] = (uint8_t)((flags >> 0) & 0xff);
  418|   147k|    }
  419|   257k|    stream->offset += headerSize;
  420|       |
  421|   257k|    return AVIF_RESULT_OK;
  422|   257k|}
avifRWStreamWriteBox:
  425|   110k|{
  426|   110k|    return avifRWStreamWriteFullBox(stream, type, contentSize, -1, 0, marker);
  427|   110k|}
avifRWStreamFinishBox:
  430|   243k|{
  431|   243k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  432|   243k|    size_t boxSize = stream->offset - marker;
  433|       |    // Since marker comes from a previous avifRWStreamWriteBox() or
  434|       |    // avifRWStreamWriteFullBox() call, boxSize must be >= the size of the size
  435|       |    // and type fields. This implies that boxSize cannot be equal to the two
  436|       |    // special values 0 and 1.
  437|   243k|    AVIF_ASSERT_OR_RETURN(boxSize >= sizeof(uint32_t) + 4);
  ------------------
  |  |   64|   243k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|   243k|    do {                        \
  |  |  |  |   46|   243k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 243k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|   243k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 243k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|   243k|    AVIF_CHECKERR(boxSize <= UINT32_MAX, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|   243k|    do {                        \
  |  |   46|   243k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 243k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   243k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 243k]
  |  |  ------------------
  ------------------
  439|   243k|    uint32_t noSize = avifHTONL((uint32_t)boxSize);
  440|   243k|    memcpy(stream->raw->data + marker, &noSize, sizeof(uint32_t));
  441|   243k|    return AVIF_RESULT_OK;
  442|   243k|}
avifRWStreamWriteU8:
  445|  69.2k|{
  446|  69.2k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  447|  69.2k|    AVIF_CHECKRES(makeRoom(stream, 1));
  ------------------
  |  |   54|  69.2k|    do {                                  \
  |  |   55|  69.2k|        const avifResult result__ = (A);  \
  |  |   56|  69.2k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 69.2k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  69.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 69.2k]
  |  |  ------------------
  ------------------
  448|  69.2k|    stream->raw->data[stream->offset] = v;
  449|  69.2k|    stream->offset += 1;
  450|  69.2k|    return AVIF_RESULT_OK;
  451|  69.2k|}
avifRWStreamWriteU16:
  454|   262k|{
  455|   262k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  456|   262k|    const size_t size = sizeof(uint16_t);
  457|   262k|    AVIF_CHECKRES(makeRoom(stream, size));
  ------------------
  |  |   54|   262k|    do {                                  \
  |  |   55|   262k|        const avifResult result__ = (A);  \
  |  |   56|   262k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 262k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   262k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 262k]
  |  |  ------------------
  ------------------
  458|   262k|    v = avifHTONS(v);
  459|   262k|    memcpy(stream->raw->data + stream->offset, &v, size);
  460|   262k|    stream->offset += size;
  461|   262k|    return AVIF_RESULT_OK;
  462|   262k|}
avifRWStreamWriteU32:
  465|   299k|{
  466|   299k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  467|   299k|    const size_t size = sizeof(uint32_t);
  468|   299k|    AVIF_CHECKRES(makeRoom(stream, size));
  ------------------
  |  |   54|   299k|    do {                                  \
  |  |   55|   299k|        const avifResult result__ = (A);  \
  |  |   56|   299k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 299k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   299k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 299k]
  |  |  ------------------
  ------------------
  469|   299k|    v = avifHTONL(v);
  470|   299k|    memcpy(stream->raw->data + stream->offset, &v, size);
  471|   299k|    stream->offset += size;
  472|   299k|    return AVIF_RESULT_OK;
  473|   299k|}
avifRWStreamWriteZeros:
  487|  13.7k|{
  488|  13.7k|    assert(stream->numUsedBitsInPartialByte == 0); // Byte alignment is required.
  489|  13.7k|    AVIF_CHECKRES(makeRoom(stream, byteCount));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  490|  13.7k|    memset(stream->raw->data + stream->offset, 0, byteCount);
  491|  13.7k|    stream->offset += byteCount;
  492|  13.7k|    return AVIF_RESULT_OK;
  493|  13.7k|}
avifRWStreamWriteBits:
  496|   561k|{
  497|   561k|    AVIF_CHECKERR(bitCount >= 32 || (v >> bitCount) == 0, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|   561k|    do {                        \
  |  |   46|  1.12M|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 0, False: 561k]
  |  |  |  Branch (46:15): [True: 561k, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|   561k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 561k]
  |  |  ------------------
  ------------------
  498|  1.12M|    while (bitCount) {
  ------------------
  |  Branch (498:12): [True: 561k, False: 561k]
  ------------------
  499|   561k|        if (stream->numUsedBitsInPartialByte == 0) {
  ------------------
  |  Branch (499:13): [True: 225k, False: 335k]
  ------------------
  500|   225k|            AVIF_CHECKRES(makeRoom(stream, 1)); // Book a new partial byte in the stream.
  ------------------
  |  |   54|   225k|    do {                                  \
  |  |   55|   225k|        const avifResult result__ = (A);  \
  |  |   56|   225k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 225k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|   225k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 225k]
  |  |  ------------------
  ------------------
  501|   225k|            stream->raw->data[stream->offset] = 0;
  502|   225k|            stream->offset += 1;
  503|   225k|        }
  504|   561k|        assert(stream->offset > 0);
  505|   561k|        uint8_t * packedBits = stream->raw->data + stream->offset - 1;
  506|       |
  507|   561k|        const size_t numBits = AVIF_MIN(bitCount, 8 - stream->numUsedBitsInPartialByte);
  ------------------
  |  |   19|   561k|#define AVIF_MIN(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (19:25): [True: 335k, False: 225k]
  |  |  ------------------
  ------------------
  508|   561k|        stream->numUsedBitsInPartialByte += numBits;
  509|   561k|        bitCount -= numBits;
  510|       |        // Order the input bits from the most significant bit to the least significant bit.
  511|       |        // In the case where avifRWStreamWriteBits() is used to write the unsigned integer value v
  512|       |        // over multiple aligned bytes, this order corresponds to big endianness.
  513|   561k|        const uint32_t bits = (v >> bitCount) & ((1 << numBits) - 1);
  514|       |        // Pack bits starting with the most significant bit of the first output byte.
  515|       |        // This way, packed bits can be found in the same order in the bit stream.
  516|   561k|        *packedBits |= bits << (8 - stream->numUsedBitsInPartialByte);
  517|       |
  518|   561k|        if (stream->numUsedBitsInPartialByte == 8) {
  ------------------
  |  Branch (518:13): [True: 225k, False: 335k]
  ------------------
  519|       |            // Start a new partial byte the next time a bit is needed.
  520|   225k|            stream->numUsedBitsInPartialByte = 0;
  521|   225k|        }
  522|   561k|    }
  523|   561k|    return AVIF_RESULT_OK;
  524|   561k|}
stream.c:makeRoom:
  336|  1.42M|{
  337|  1.42M|    AVIF_CHECKERR(size <= SIZE_MAX - stream->offset, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  1.42M|    do {                        \
  |  |   46|  1.42M|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 1.42M]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  1.42M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 1.42M]
  |  |  ------------------
  ------------------
  338|  1.42M|    size_t newSize = stream->offset + size;
  339|  1.42M|    if (newSize <= stream->raw->size) {
  ------------------
  |  Branch (339:9): [True: 1.41M, False: 13.7k]
  ------------------
  340|  1.41M|        return AVIF_RESULT_OK;
  341|  1.41M|    }
  342|       |    // Make newSize a multiple of AVIF_STREAM_BUFFER_INCREMENT.
  343|  13.7k|    size_t rem = newSize % AVIF_STREAM_BUFFER_INCREMENT;
  ------------------
  |  |  334|  13.7k|#define AVIF_STREAM_BUFFER_INCREMENT (1024 * 1024)
  ------------------
  344|  13.7k|    size_t padding = (rem == 0) ? 0 : AVIF_STREAM_BUFFER_INCREMENT - rem;
  ------------------
  |  |  334|  13.7k|#define AVIF_STREAM_BUFFER_INCREMENT (1024 * 1024)
  ------------------
  |  Branch (344:22): [True: 0, False: 13.7k]
  ------------------
  345|  13.7k|    AVIF_CHECKERR(newSize <= SIZE_MAX - padding, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  346|  13.7k|    newSize += padding;
  347|  13.7k|    return avifRWDataRealloc(stream->raw, newSize);
  348|  13.7k|}

avifHTONS:
   19|   262k|{
   20|   262k|    uint16_t result = 0;
   21|   262k|    uint8_t * data = (uint8_t *)&result;
   22|   262k|    data[0] = (s >> 8) & 0xff;
   23|   262k|    data[1] = (s >> 0) & 0xff;
   24|   262k|    return result;
   25|   262k|}
avifNTOHS:
   28|   262k|{
   29|   262k|    const uint8_t * data = (const uint8_t *)&s;
   30|   262k|    return (uint16_t)((data[1] << 0) | (data[0] << 8));
   31|   262k|}
avifHTONL:
   40|   800k|{
   41|   800k|    uint32_t result = 0;
   42|   800k|    uint8_t * data = (uint8_t *)&result;
   43|   800k|    data[0] = (l >> 24) & 0xff;
   44|   800k|    data[1] = (l >> 16) & 0xff;
   45|   800k|    data[2] = (l >> 8) & 0xff;
   46|   800k|    data[3] = (l >> 0) & 0xff;
   47|   800k|    return result;
   48|   800k|}
avifNTOHL:
   51|   478k|{
   52|   478k|    const uint8_t * data = (const uint8_t *)&l;
   53|   478k|    return ((uint32_t)data[3] << 0) | ((uint32_t)data[2] << 8) | ((uint32_t)data[1] << 16) | ((uint32_t)data[0] << 24);
   54|   478k|}
avifArrayCreate:
   88|   326k|{
   89|   326k|    avifArrayInternal * arr = (avifArrayInternal *)arrayStruct;
   90|   326k|    arr->elementSize = elementSize ? elementSize : 1;
  ------------------
  |  Branch (90:24): [True: 326k, False: 0]
  ------------------
   91|   326k|    arr->count = 0;
   92|   326k|    arr->capacity = initialCapacity;
   93|   326k|    if (arr->capacity > SIZE_MAX / arr->elementSize) {
  ------------------
  |  Branch (93:9): [True: 0, False: 326k]
  ------------------
   94|      0|        arr->ptr = NULL;
   95|      0|        arr->capacity = 0;
   96|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
   97|      0|    }
   98|   326k|    size_t byteCount = (size_t)arr->elementSize * arr->capacity;
   99|   326k|    arr->ptr = (uint8_t *)avifAlloc(byteCount);
  100|   326k|    if (!arr->ptr) {
  ------------------
  |  Branch (100:9): [True: 0, False: 326k]
  ------------------
  101|      0|        arr->capacity = 0;
  102|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  103|      0|    }
  104|   326k|    memset(arr->ptr, 0, byteCount);
  105|   326k|    return AVIF_TRUE;
  ------------------
  |  |   88|   326k|#define AVIF_TRUE 1
  ------------------
  106|   326k|}
avifArrayPush:
  109|   751k|{
  110|   751k|    avifArrayInternal * arr = (avifArrayInternal *)arrayStruct;
  111|   751k|    if (arr->count == arr->capacity) {
  ------------------
  |  Branch (111:9): [True: 141k, False: 610k]
  ------------------
  112|   141k|        uint8_t * oldPtr = arr->ptr;
  113|   141k|        size_t oldByteCount = (size_t)arr->elementSize * arr->capacity;
  114|   141k|        if (oldByteCount > SIZE_MAX / 2 || arr->capacity > UINT32_MAX / 2) {
  ------------------
  |  Branch (114:13): [True: 0, False: 141k]
  |  Branch (114:44): [True: 0, False: 141k]
  ------------------
  115|      0|            return NULL;
  116|      0|        }
  117|   141k|        size_t newByteCount = oldByteCount * 2;
  118|   141k|        uint8_t * newPtr = (uint8_t *)avifAlloc(newByteCount);
  119|   141k|        if (newPtr == NULL) {
  ------------------
  |  Branch (119:13): [True: 0, False: 141k]
  ------------------
  120|      0|            return NULL;
  121|      0|        }
  122|   141k|        arr->ptr = newPtr;
  123|   141k|        memset(arr->ptr + oldByteCount, 0, oldByteCount);
  124|   141k|        memcpy(arr->ptr, oldPtr, oldByteCount);
  125|   141k|        arr->capacity *= 2;
  126|   141k|        avifFree(oldPtr);
  127|   141k|    }
  128|   751k|    ++arr->count;
  129|   751k|    return &arr->ptr[(arr->count - 1) * (size_t)arr->elementSize];
  130|   751k|}
avifArrayDestroy:
  141|   354k|{
  142|   354k|    avifArrayInternal * arr = (avifArrayInternal *)arrayStruct;
  143|   354k|    if (arr->ptr) {
  ------------------
  |  Branch (143:9): [True: 326k, False: 27.5k]
  ------------------
  144|   326k|        avifFree(arr->ptr);
  145|       |        arr->ptr = NULL;
  146|   326k|    }
  147|   354k|    memset(arr, 0, sizeof(avifArrayInternal));
  148|   354k|}
avifFractionSimplify:
  169|   147k|{
  170|   147k|    int64_t gcd = calcGCD(f->n, f->d);
  171|   147k|    if (gcd > 1) {
  ------------------
  |  Branch (171:9): [True: 0, False: 147k]
  ------------------
  172|      0|        f->n = (int32_t)(f->n / gcd);
  173|      0|        f->d = (int32_t)(f->d / gcd);
  174|      0|    }
  175|   147k|}
utils.c:calcGCD:
  153|   147k|{
  154|   147k|    if (a < 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 147k]
  ------------------
  155|      0|        a *= -1;
  156|      0|    }
  157|   147k|    if (b < 0) {
  ------------------
  |  Branch (157:9): [True: 0, False: 147k]
  ------------------
  158|      0|        b *= -1;
  159|      0|    }
  160|   489k|    while (b != 0) {
  ------------------
  |  Branch (160:12): [True: 341k, False: 147k]
  ------------------
  161|   341k|        int64_t r = a % b;
  162|   341k|        a = b;
  163|   341k|        b = r;
  164|   341k|    }
  165|   147k|    return a;
  166|   147k|}

avifCodecEncodeOutputCreate:
  125|  18.4k|{
  126|  18.4k|    avifCodecEncodeOutput * encodeOutput = (avifCodecEncodeOutput *)avifAlloc(sizeof(avifCodecEncodeOutput));
  127|  18.4k|    if (encodeOutput == NULL) {
  ------------------
  |  Branch (127:9): [True: 0, False: 18.4k]
  ------------------
  128|      0|        return NULL;
  129|      0|    }
  130|  18.4k|    memset(encodeOutput, 0, sizeof(avifCodecEncodeOutput));
  131|  18.4k|    if (!avifArrayCreate(&encodeOutput->samples, sizeof(avifEncodeSample), 1)) {
  ------------------
  |  Branch (131:9): [True: 0, False: 18.4k]
  ------------------
  132|      0|        avifCodecEncodeOutputDestroy(encodeOutput);
  133|      0|        return NULL;
  134|      0|    }
  135|  18.4k|    return encodeOutput;
  136|  18.4k|}
avifCodecEncodeOutputAddSample:
  139|  73.6k|{
  140|  73.6k|    avifEncodeSample * sample = (avifEncodeSample *)avifArrayPush(&encodeOutput->samples);
  141|  73.6k|    AVIF_CHECKERR(sample, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  73.6k|    do {                        \
  |  |   46|  73.6k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
  142|  73.6k|    const avifResult result = avifRWDataSet(&sample->data, data, len);
  143|  73.6k|    if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (143:9): [True: 0, False: 73.6k]
  ------------------
  144|      0|        avifArrayPop(&encodeOutput->samples);
  145|      0|        return result;
  146|      0|    }
  147|  73.6k|    sample->sync = sync;
  148|  73.6k|    return AVIF_RESULT_OK;
  149|  73.6k|}
avifCodecEncodeOutputDestroy:
  152|  18.4k|{
  153|  92.0k|    for (uint32_t sampleIndex = 0; sampleIndex < encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (153:36): [True: 73.6k, False: 18.4k]
  ------------------
  154|  73.6k|        avifRWDataFree(&encodeOutput->samples.sample[sampleIndex].data);
  155|  73.6k|    }
  156|  18.4k|    avifArrayDestroy(&encodeOutput->samples);
  157|  18.4k|    avifFree(encodeOutput);
  158|  18.4k|}
avifEncoderCreate:
  520|  13.7k|{
  521|  13.7k|    avifEncoder * encoder = (avifEncoder *)avifAlloc(sizeof(avifEncoder));
  522|  13.7k|    if (!encoder) {
  ------------------
  |  Branch (522:9): [True: 0, False: 13.7k]
  ------------------
  523|      0|        return NULL;
  524|      0|    }
  525|  13.7k|    memset(encoder, 0, sizeof(avifEncoder));
  526|  13.7k|    encoder->codecChoice = AVIF_CODEC_CHOICE_AUTO;
  527|  13.7k|    encoder->maxThreads = 1;
  528|  13.7k|    encoder->speed = AVIF_SPEED_DEFAULT;
  ------------------
  |  |  114|  13.7k|#define AVIF_SPEED_DEFAULT -1
  ------------------
  529|  13.7k|    encoder->keyframeInterval = 0;
  530|  13.7k|    encoder->timescale = 1;
  531|  13.7k|    encoder->repetitionCount = AVIF_REPETITION_COUNT_INFINITE;
  ------------------
  |  |  119|  13.7k|#define AVIF_REPETITION_COUNT_INFINITE -1
  ------------------
  532|  13.7k|    encoder->quality = AVIF_QUALITY_DEFAULT;
  ------------------
  |  |  103|  13.7k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
  533|  13.7k|    encoder->qualityAlpha = AVIF_QUALITY_DEFAULT;
  ------------------
  |  |  103|  13.7k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
  534|  13.7k|    encoder->qualityGainMap = AVIF_QUALITY_DEFAULT;
  ------------------
  |  |  103|  13.7k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
  535|  13.7k|    encoder->minQuantizer = AVIF_QUANTIZER_BEST_QUALITY;
  ------------------
  |  |  109|  13.7k|#define AVIF_QUANTIZER_BEST_QUALITY 0
  ------------------
  536|  13.7k|    encoder->maxQuantizer = AVIF_QUANTIZER_WORST_QUALITY;
  ------------------
  |  |  110|  13.7k|#define AVIF_QUANTIZER_WORST_QUALITY 63
  ------------------
  537|  13.7k|    encoder->minQuantizerAlpha = AVIF_QUANTIZER_BEST_QUALITY;
  ------------------
  |  |  109|  13.7k|#define AVIF_QUANTIZER_BEST_QUALITY 0
  ------------------
  538|  13.7k|    encoder->maxQuantizerAlpha = AVIF_QUANTIZER_WORST_QUALITY;
  ------------------
  |  |  110|  13.7k|#define AVIF_QUANTIZER_WORST_QUALITY 63
  ------------------
  539|  13.7k|    encoder->tileRowsLog2 = 0;
  540|  13.7k|    encoder->tileColsLog2 = 0;
  541|  13.7k|    encoder->autoTiling = AVIF_FALSE;
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
  542|  13.7k|    encoder->scalingMode = noScaling;
  543|  13.7k|    encoder->data = avifEncoderDataCreate();
  544|  13.7k|    encoder->csOptions = avifCodecSpecificOptionsCreate();
  545|  13.7k|    if (!encoder->data || !encoder->csOptions) {
  ------------------
  |  Branch (545:9): [True: 0, False: 13.7k]
  |  Branch (545:27): [True: 0, False: 13.7k]
  ------------------
  546|      0|        avifEncoderDestroy(encoder);
  547|      0|        return NULL;
  548|      0|    }
  549|  13.7k|    encoder->headerFormat = AVIF_HEADER_DEFAULT;
  550|  13.7k|    encoder->creationTime = 0;
  551|  13.7k|    encoder->modificationTime = 0;
  552|  13.7k|    encoder->sampleTransformRecipe = AVIF_SAMPLE_TRANSFORM_NONE;
  553|  13.7k|    encoder->width = 0;
  554|  13.7k|    encoder->height = 0;
  555|  13.7k|    return encoder;
  556|  13.7k|}
avifEncoderDestroy:
  559|  13.7k|{
  560|  13.7k|    if (encoder->csOptions) {
  ------------------
  |  Branch (560:9): [True: 13.7k, False: 0]
  ------------------
  561|  13.7k|        avifCodecSpecificOptionsDestroy(encoder->csOptions);
  562|  13.7k|    }
  563|  13.7k|    if (encoder->data) {
  ------------------
  |  Branch (563:9): [True: 13.7k, False: 0]
  ------------------
  564|  13.7k|        avifEncoderDataDestroy(encoder->data);
  565|  13.7k|    }
  566|  13.7k|    avifFree(encoder);
  567|  13.7k|}
avifEncoderAddImage:
 2350|  55.1k|{
 2351|  55.1k|    avifDiagnosticsClearError(&encoder->diag);
 2352|  55.1k|    return avifEncoderAddImageInternal(encoder, 1, 1, &image, durationInTimescales, addImageFlags);
 2353|  55.1k|}
avifEncoderFinish:
 3380|  13.7k|{
 3381|  13.7k|    avifDiagnosticsClearError(&encoder->diag);
 3382|  13.7k|    if (encoder->data->items.count == 0) {
  ------------------
  |  Branch (3382:9): [True: 0, False: 13.7k]
  ------------------
 3383|      0|        return AVIF_RESULT_NO_CONTENT;
 3384|      0|    }
 3385|       |
 3386|  13.7k|    const avifCodecType codecType = avifEncoderGetCodecType(encoder);
 3387|  13.7k|    if (codecType == AVIF_CODEC_TYPE_UNKNOWN) {
  ------------------
  |  Branch (3387:9): [True: 0, False: 13.7k]
  ------------------
 3388|      0|        return AVIF_RESULT_NO_CODEC_AVAILABLE;
 3389|      0|    }
 3390|       |
 3391|       |    // -----------------------------------------------------------------------
 3392|       |    // Finish up encoding
 3393|       |
 3394|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3394:34): [True: 18.4k, False: 13.7k]
  ------------------
 3395|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3396|  18.4k|        if (item->codec) {
  ------------------
  |  Branch (3396:13): [True: 18.4k, False: 0]
  ------------------
 3397|  18.4k|            if (!item->codec->encodeFinish(item->codec, item->encodeOutput)) {
  ------------------
  |  Branch (3397:17): [True: 0, False: 18.4k]
  ------------------
 3398|      0|                return avifGetErrorForItemCategory(item->itemCategory);
 3399|      0|            }
 3400|       |
 3401|  18.4k|            if (item->encodeOutput->samples.count != encoder->data->frames.count) {
  ------------------
  |  Branch (3401:17): [True: 0, False: 18.4k]
  ------------------
 3402|      0|                return avifGetErrorForItemCategory(item->itemCategory);
 3403|      0|            }
 3404|       |
 3405|  18.4k|            if ((item->extraLayerCount > 0) && (item->encodeOutput->samples.count != item->extraLayerCount + 1)) {
  ------------------
  |  Branch (3405:17): [True: 18.4k, False: 0]
  |  Branch (3405:48): [True: 0, False: 18.4k]
  ------------------
 3406|       |                // Check whether user has sent enough frames to encoder.
 3407|      0|                avifDiagnosticsPrintf(&encoder->diag,
 3408|      0|                                      "Expected %u frames given to avifEncoderAddImage() to encode this layered image according to extraLayerCount, but got %u frames.",
 3409|      0|                                      item->extraLayerCount + 1,
 3410|      0|                                      item->encodeOutput->samples.count);
 3411|      0|                return AVIF_RESULT_INVALID_ARGUMENT;
 3412|      0|            }
 3413|  18.4k|        }
 3414|  18.4k|    }
 3415|       |
 3416|       |    // -----------------------------------------------------------------------
 3417|       |    // Harvest configuration properties from sequence headers
 3418|       |
 3419|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3419:34): [True: 18.4k, False: 13.7k]
  ------------------
 3420|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3421|  18.4k|        if (item->encodeOutput->samples.count > 0) {
  ------------------
  |  Branch (3421:13): [True: 18.4k, False: 0]
  ------------------
 3422|  18.4k|            const avifEncodeSample * firstSample = &item->encodeOutput->samples.sample[0];
 3423|  18.4k|            avifSequenceHeader sequenceHeader;
 3424|  18.4k|            AVIF_CHECKERR(avifSequenceHeaderParse(&sequenceHeader, (const avifROData *)&firstSample->data, codecType),
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3425|  18.4k|                          avifGetErrorForItemCategory(item->itemCategory));
 3426|  18.4k|            item->av1C = sequenceHeader.av1C;
 3427|  18.4k|        }
 3428|  18.4k|    }
 3429|       |
 3430|       |    // -----------------------------------------------------------------------
 3431|       |    // Begin write stream
 3432|       |
 3433|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_MINI)
 3434|       |    // Decide whether to go for a reduced MinimizedImageBox or a full regular MetaBox.
 3435|       |    if ((encoder->headerFormat & AVIF_HEADER_MINI) && avifEncoderIsMiniCompatible(encoder)) {
 3436|       |        AVIF_CHECKRES(avifEncoderWriteFileTypeBoxAndMiniBox(encoder, output));
 3437|       |        return AVIF_RESULT_OK;
 3438|       |    }
 3439|       |#endif // AVIF_ENABLE_EXPERIMENTAL_MINI
 3440|       |
 3441|  13.7k|    const avifImage * imageMetadata = encoder->data->imageMetadata;
 3442|  13.7k|    uint64_t now = (uint64_t)time(NULL);
 3443|  13.7k|    uint64_t modificationTime = (encoder->modificationTime != 0) ? encoder->modificationTime : now;
  ------------------
  |  Branch (3443:33): [True: 0, False: 13.7k]
  ------------------
 3444|  13.7k|    uint64_t creationTime = (encoder->creationTime != 0) ? encoder->creationTime : modificationTime;
  ------------------
  |  Branch (3444:29): [True: 0, False: 13.7k]
  ------------------
 3445|       |    // The epoch for creation_time and modification_time is midnight, Jan. 1,
 3446|       |    // 1904, in UTC time. Add the number of seconds between that epoch and the
 3447|       |    // Unix epoch.
 3448|  13.7k|    creationTime += 2082844800;
 3449|  13.7k|    modificationTime += 2082844800;
 3450|       |
 3451|  13.7k|    avifRWStream s;
 3452|  13.7k|    avifRWStreamStart(&s, output);
 3453|       |
 3454|       |    // -----------------------------------------------------------------------
 3455|       |    // Write ftyp
 3456|       |
 3457|       |    // Layered sequence is not supported for now.
 3458|  13.7k|    const avifBool isSequence = (encoder->extraLayerCount == 0) && (encoder->data->frames.count > 1);
  ------------------
  |  Branch (3458:33): [True: 0, False: 13.7k]
  |  Branch (3458:68): [True: 0, False: 0]
  ------------------
 3459|       |
 3460|  13.7k|    const char * majorBrand = "avif";
 3461|  13.7k|    if (isSequence) {
  ------------------
  |  Branch (3461:9): [True: 0, False: 13.7k]
  ------------------
 3462|      0|        majorBrand = "avis";
 3463|      0|    }
 3464|       |
 3465|  13.7k|    uint32_t minorVersion = 0;
 3466|       |#if defined(AVIF_CODEC_AVM)
 3467|       |    if (codecType == AVIF_CODEC_TYPE_AV2) {
 3468|       |        // TODO(yguyon): Experimental AV2-AVIF is AVIF version 2 for now (change once it is ratified).
 3469|       |        minorVersion = 2;
 3470|       |    }
 3471|       |#endif
 3472|       |
 3473|       |    // According to section 5.2 of AV1 Image File Format specification v1.1.0:
 3474|       |    //   If the primary item or all the items referenced by the primary item are AV1 image items made only
 3475|       |    //   of Intra Frames, the brand "avio" should be used in the compatible_brands field of the FileTypeBox.
 3476|       |    // See https://aomediacodec.github.io/av1-avif/v1.1.0.html#image-and-image-collection-brand.
 3477|       |    // This rule corresponds to using the "avio" brand in all cases except for layered images, because:
 3478|       |    //  - Non-layered still images are always Intra Frames, even with grids;
 3479|       |    //  - Sequences cannot be combined with layers or grids, and the first frame of the sequence
 3480|       |    //    (referred to by the primary image item) is always an Intra Frame.
 3481|  13.7k|    avifBool useAvioBrand;
 3482|  13.7k|    if (isSequence) {
  ------------------
  |  Branch (3482:9): [True: 0, False: 13.7k]
  ------------------
 3483|       |        // According to section 5.3 of AV1 Image File Format specification v1.1.0:
 3484|       |        //   Additionally, if a file contains AV1 image sequences and the brand avio is used in the
 3485|       |        //   compatible_brands field of the FileTypeBox, the item constraints for this brand shall be met
 3486|       |        //   and at least one of the AV1 image sequences shall be made only of AV1 Samples marked as sync.
 3487|       |        // See https://aomediacodec.github.io/av1-avif/v1.1.0.html#image-sequence-brand.
 3488|      0|        useAvioBrand = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 3489|      0|        for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3489:38): [True: 0, False: 0]
  ------------------
 3490|      0|            avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3491|      0|            if (item->encodeOutput->samples.count == 0) {
  ------------------
  |  Branch (3491:17): [True: 0, False: 0]
  ------------------
 3492|      0|                continue; // Not a track.
 3493|      0|            }
 3494|      0|            avifBool onlySyncSamples = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3495|      0|            for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (3495:44): [True: 0, False: 0]
  ------------------
 3496|      0|                if (!item->encodeOutput->samples.sample[sampleIndex].sync) {
  ------------------
  |  Branch (3496:21): [True: 0, False: 0]
  ------------------
 3497|      0|                    onlySyncSamples = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 3498|      0|                    break;
 3499|      0|                }
 3500|      0|            }
 3501|      0|            if (onlySyncSamples) {
  ------------------
  |  Branch (3501:17): [True: 0, False: 0]
  ------------------
 3502|      0|                useAvioBrand = AVIF_TRUE; // at least one of the AV1 image sequences is made only of sync samples
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3503|      0|                break;
 3504|      0|            }
 3505|      0|        }
 3506|  13.7k|    } else {
 3507|       |        // The gpac/ComplianceWarden tool only warns about the lack of the "avio" brand for sequences,
 3508|       |        // and the specification says the brand "should" be used, not "shall". Leverage that opportunity
 3509|       |        // to save four bytes for still images.
 3510|  13.7k|        useAvioBrand = AVIF_FALSE; // Should be (encoder->extraLayerCount == 0) to be fully compliant.
  ------------------
  |  |   89|  13.7k|#define AVIF_FALSE 0
  ------------------
 3511|  13.7k|    }
 3512|       |
 3513|  13.7k|    avifBoxMarker ftyp;
 3514|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBox(&s, "ftyp", AVIF_BOX_SIZE_TBD, &ftyp));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3515|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(&s, majorBrand, 4)); // unsigned int(32) major_brand;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3516|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteU32(&s, minorVersion));    // unsigned int(32) minor_version;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3517|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(&s, "avif", 4));     // unsigned int(32) compatible_brands[];
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3518|  13.7k|    if (useAvioBrand) {
  ------------------
  |  Branch (3518:9): [True: 0, False: 13.7k]
  ------------------
 3519|      0|        AVIF_CHECKRES(avifRWStreamWriteChars(&s, "avio", 4)); // ... compatible_brands[]
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3520|      0|    }
 3521|  13.7k|    if (isSequence) {
  ------------------
  |  Branch (3521:9): [True: 0, False: 13.7k]
  ------------------
 3522|      0|        AVIF_CHECKRES(avifRWStreamWriteChars(&s, "avis", 4)); // ... compatible_brands[]
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3523|      0|        AVIF_CHECKRES(avifRWStreamWriteChars(&s, "msf1", 4)); // ... compatible_brands[]
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3524|      0|        AVIF_CHECKRES(avifRWStreamWriteChars(&s, "iso8", 4)); // ... compatible_brands[]
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3525|      0|    }
 3526|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(&s, "mif1", 4));                  // ... compatible_brands[]
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3527|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(&s, "miaf", 4));                  // ... compatible_brands[]
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3528|  13.7k|    if ((imageMetadata->depth == 8) || (imageMetadata->depth == 10)) {     //
  ------------------
  |  Branch (3528:9): [True: 9.91k, False: 3.87k]
  |  Branch (3528:40): [True: 1.86k, False: 2.01k]
  ------------------
 3529|  11.7k|        if (imageMetadata->yuvFormat == AVIF_PIXEL_FORMAT_YUV420) {        //
  ------------------
  |  Branch (3529:13): [True: 2.87k, False: 8.90k]
  ------------------
 3530|  2.87k|            AVIF_CHECKRES(avifRWStreamWriteChars(&s, "MA1B", 4));          // ... compatible_brands[]
  ------------------
  |  |   54|  2.87k|    do {                                  \
  |  |   55|  2.87k|        const avifResult result__ = (A);  \
  |  |   56|  2.87k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 2.87k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  2.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 2.87k]
  |  |  ------------------
  ------------------
 3531|  8.90k|        } else if (imageMetadata->yuvFormat == AVIF_PIXEL_FORMAT_YUV444) { //
  ------------------
  |  Branch (3531:20): [True: 1.28k, False: 7.61k]
  ------------------
 3532|  1.28k|            AVIF_CHECKRES(avifRWStreamWriteChars(&s, "MA1A", 4));          // ... compatible_brands[]
  ------------------
  |  |   54|  1.28k|    do {                                  \
  |  |   55|  1.28k|        const avifResult result__ = (A);  \
  |  |   56|  1.28k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 1.28k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  1.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 3533|  1.28k|        }
 3534|  11.7k|    }
 3535|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3535:34): [True: 18.4k, False: 13.7k]
  ------------------
 3536|  18.4k|        if (!memcmp(encoder->data->items.item[itemIndex].type, "tmap", 4)) {
  ------------------
  |  Branch (3536:13): [True: 0, False: 18.4k]
  ------------------
 3537|       |            // ISO/IEC 23008-12:2024/AMD 1:2024(E)
 3538|       |            // This brand enables file players to identify and decode HEIF files containing tone-map derived image
 3539|       |            // items. When present, this brand shall be among the brands included in the compatible_brands
 3540|       |            // array of the FileTypeBox.
 3541|      0|            AVIF_CHECKRES(avifRWStreamWriteChars(&s, "tmap", 4)); // ... compatible_brands[]
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3542|      0|            break;
 3543|      0|        }
 3544|  18.4k|    }
 3545|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, ftyp));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3546|       |
 3547|       |    // -----------------------------------------------------------------------
 3548|       |    // Start meta
 3549|       |
 3550|  13.7k|    avifBoxMarker meta;
 3551|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "meta", AVIF_BOX_SIZE_TBD, 0, 0, &meta));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3552|       |
 3553|       |    // -----------------------------------------------------------------------
 3554|       |    // Write hdlr
 3555|       |
 3556|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteHandlerBox(&s, "pict"));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3557|       |
 3558|       |    // -----------------------------------------------------------------------
 3559|       |    // Write pitm
 3560|       |
 3561|       |    // Use the 32-bit item ID variants of the 'pitm', 'iloc', 'iinf', 'infe', 'iref' and
 3562|       |    // 'ipma' boxes below if any item ID or the item count exceeds the 16-bit space, i.e. if
 3563|       |    // there are more than 65535 items (item IDs are sequential and start at 1).
 3564|  13.7k|    const avifBool largeItemIDs = encoder->data->lastItemID > UINT16_MAX || encoder->data->items.count > UINT16_MAX;
  ------------------
  |  Branch (3564:35): [True: 0, False: 13.7k]
  |  Branch (3564:77): [True: 0, False: 13.7k]
  ------------------
 3565|       |
 3566|  13.7k|    if (encoder->data->primaryItemID != 0) {
  ------------------
  |  Branch (3566:9): [True: 13.7k, False: 0]
  ------------------
 3567|  13.7k|        if (largeItemIDs) {
  ------------------
  |  Branch (3567:13): [True: 0, False: 13.7k]
  ------------------
 3568|       |            // 'pitm' version 1 contains a 32-bit item_ID field, whereas version 0 contains a 16-bit item_ID field.
 3569|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "pitm", sizeof(uint32_t), 1, 0, /*marker=*/NULL));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3570|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, encoder->data->primaryItemID)); //  unsigned int(32) item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3571|  13.7k|        } else {
 3572|  13.7k|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "pitm", sizeof(uint16_t), 0, 0, /*marker=*/NULL));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3573|  13.7k|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)encoder->data->primaryItemID)); //  unsigned int(16) item_ID;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3574|  13.7k|        }
 3575|  13.7k|    }
 3576|       |
 3577|       |    // -----------------------------------------------------------------------
 3578|       |    // Write iloc
 3579|       |
 3580|  13.7k|    avifBoxMarker iloc;
 3581|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "iloc", AVIF_BOX_SIZE_TBD, largeItemIDs ? 2 : 0, 0, &iloc));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  27.5k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3582|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(&s, 4, /*bitCount=*/4)); // unsigned int(4) offset_size;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3583|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(&s, 4, /*bitCount=*/4)); // unsigned int(4) length_size;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3584|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/4)); // unsigned int(4) base_offset_size;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3585|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/4)); // unsigned int(4) index_size, or reserved if version < 1;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3586|  13.7k|    if (largeItemIDs) {
  ------------------
  |  Branch (3586:9): [True: 0, False: 13.7k]
  ------------------
 3587|       |        // 'iloc' version 2 contains a 32-bit item_count field, whereas versions 0 and 1 contain a 16-bit item_count field.
 3588|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, encoder->data->items.count)); // unsigned int(32) item_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3589|  13.7k|    } else {
 3590|  13.7k|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)encoder->data->items.count)); // unsigned int(16) item_count;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3591|  13.7k|    }
 3592|       |
 3593|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3593:34): [True: 18.4k, False: 13.7k]
  ------------------
 3594|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3595|  18.4k|        if (largeItemIDs) {
  ------------------
  |  Branch (3595:13): [True: 0, False: 18.4k]
  ------------------
 3596|       |            // 'iloc' version 2 contains a 32-bit item_ID field, whereas versions 0 and 1 contain a 16-bit item_ID field.
 3597|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->id));            // unsigned int(32) item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3598|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/12)); // unsigned int(12) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3599|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/4)); // unsigned int(4) construction_method = 0 (file offset);
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3600|  18.4k|        } else {
 3601|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->id)); // unsigned int(16) item_ID;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3602|  18.4k|        }
 3603|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0)); // unsigned int(16) data_reference_index;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3604|       |
 3605|       |        // Layered Image, write location for all samples
 3606|  18.4k|        if (item->extraLayerCount > 0) {
  ------------------
  |  Branch (3606:13): [True: 18.4k, False: 0]
  ------------------
 3607|  18.4k|            uint32_t layerCount = item->extraLayerCount + 1;
 3608|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)layerCount)); // unsigned int(16) extent_count;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3609|  92.0k|            for (uint32_t i = 0; i < layerCount; ++i) {
  ------------------
  |  Branch (3609:34): [True: 73.6k, False: 18.4k]
  ------------------
 3610|  73.6k|                AVIF_CHECKRES(avifEncoderItemAddMdatFixup(item, &s));
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 3611|  73.6k|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0 /* set later */)); // unsigned int(offset_size*8) extent_offset;
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 3612|  73.6k|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)item->encodeOutput->samples.sample[i].data.size)); // unsigned int(length_size*8) extent_length;
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 3613|  73.6k|            }
 3614|  18.4k|            continue;
 3615|  18.4k|        }
 3616|       |
 3617|      0|        uint32_t contentSize = (uint32_t)item->metadataPayload.size;
 3618|      0|        if (item->encodeOutput->samples.count > 0) {
  ------------------
  |  Branch (3618:13): [True: 0, False: 0]
  ------------------
 3619|       |            // This is choosing sample 0's size as there are two cases here:
 3620|       |            // * This is a single image, in which case this is correct
 3621|       |            // * This is an image sequence, but this file should still be a valid single-image avif,
 3622|       |            //   so there must still be a primary item pointing at a sync sample. Since the first
 3623|       |            //   frame of the image sequence is guaranteed to be a sync sample, it is chosen here.
 3624|      0|            contentSize = (uint32_t)item->encodeOutput->samples.sample[0].data.size;
 3625|      0|        }
 3626|       |
 3627|      0|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));                     // unsigned int(16) extent_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3628|      0|        AVIF_CHECKRES(avifEncoderItemAddMdatFixup(item, &s));           //
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3629|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0 /* set later */));     // unsigned int(offset_size*8) extent_offset;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3630|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)contentSize)); // unsigned int(length_size*8) extent_length;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3631|      0|    }
 3632|       |
 3633|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, iloc));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3634|       |
 3635|       |    // -----------------------------------------------------------------------
 3636|       |    // Write iinf
 3637|       |
 3638|       |    // Section 8.11.6.2 of ISO/IEC 14496-12.
 3639|  13.7k|    avifBoxMarker iinf;
 3640|       |    // 'iinf' version 1 contains a 32-bit entry_count field, whereas version 0 contains a 16-bit entry_count field.
 3641|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "iinf", AVIF_BOX_SIZE_TBD, largeItemIDs ? 1 : 0, 0, &iinf));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  27.5k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3642|  13.7k|    if (largeItemIDs) {
  ------------------
  |  Branch (3642:9): [True: 0, False: 13.7k]
  ------------------
 3643|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, encoder->data->items.count)); //  unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3644|  13.7k|    } else {
 3645|  13.7k|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)encoder->data->items.count)); //  unsigned int(16) entry_count;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3646|  13.7k|    }
 3647|       |
 3648|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3648:34): [True: 18.4k, False: 13.7k]
  ------------------
 3649|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3650|       |
 3651|  18.4k|        uint32_t flags = item->hiddenImage ? 1 : 0;
  ------------------
  |  Branch (3651:26): [True: 0, False: 18.4k]
  ------------------
 3652|  18.4k|        avifBoxMarker infe;
 3653|       |        // 'infe' version 3 contains a 32-bit item_ID field, whereas version 2 contains a 16-bit item_ID field.
 3654|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "infe", AVIF_BOX_SIZE_TBD, largeItemIDs ? 3 : 2, flags, &infe));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  36.8k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3655|  18.4k|        if (largeItemIDs) {
  ------------------
  |  Branch (3655:13): [True: 0, False: 18.4k]
  ------------------
 3656|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->id)); // unsigned int(32) item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3657|  18.4k|        } else {
 3658|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->id)); // unsigned int(16) item_ID;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3659|  18.4k|        }
 3660|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                                    // unsigned int(16) item_protection_index;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3661|  18.4k|        AVIF_CHECKRES(avifRWStreamWrite(&s, item->type, 4));                           // unsigned int(32) item_type;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3662|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteChars(&s, item->infeName, item->infeNameSize)); // utf8string item_name; (writing null terminator)
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3663|  18.4k|        if (!memcmp(item->type, "mime", 4)) {
  ------------------
  |  Branch (3663:13): [True: 0, False: 18.4k]
  ------------------
 3664|      0|            AVIF_CHECKRES(avifRWStreamWriteChars(&s, item->infeContentType, item->infeContentTypeSize)); // utf8string content_type; (writing null terminator)
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3665|       |            // utf8string content_encoding; //optional
 3666|  18.4k|        } else if (!memcmp(item->type, "uri ", 4)) {
  ------------------
  |  Branch (3666:20): [True: 0, False: 18.4k]
  ------------------
 3667|       |            // utf8string item_uri_type;
 3668|      0|            return AVIF_RESULT_NOT_IMPLEMENTED;
 3669|      0|        }
 3670|  18.4k|        AVIF_CHECKRES(avifRWStreamFinishBox(&s, infe));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3671|  18.4k|    }
 3672|       |
 3673|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, iinf));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3674|       |
 3675|       |    // -----------------------------------------------------------------------
 3676|       |    // Write iref boxes
 3677|       |
 3678|  13.7k|    avifBoxMarker iref = 0;
 3679|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3679:34): [True: 18.4k, False: 13.7k]
  ------------------
 3680|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3681|       |
 3682|       |        // Count how many other items refer to this item with dimgFromID
 3683|  18.4k|        uint16_t dimgCount = 0;
 3684|  46.0k|        for (uint32_t dimgIndex = 0; dimgIndex < encoder->data->items.count; ++dimgIndex) {
  ------------------
  |  Branch (3684:38): [True: 27.6k, False: 18.4k]
  ------------------
 3685|  27.6k|            avifEncoderItem * dimgItem = &encoder->data->items.item[dimgIndex];
 3686|  27.6k|            if (dimgItem->dimgFromID == item->id) {
  ------------------
  |  Branch (3686:17): [True: 0, False: 27.6k]
  ------------------
 3687|      0|                ++dimgCount;
 3688|      0|            }
 3689|  27.6k|        }
 3690|       |
 3691|  18.4k|        if (dimgCount > 0) {
  ------------------
  |  Branch (3691:13): [True: 0, False: 18.4k]
  ------------------
 3692|      0|            if (!iref) {
  ------------------
  |  Branch (3692:17): [True: 0, False: 0]
  ------------------
 3693|       |                // 'iref' version 1 contains 32-bit item_ID fields, whereas version 0 contains 16-bit item_ID fields.
 3694|      0|                AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "iref", AVIF_BOX_SIZE_TBD, largeItemIDs ? 1 : 0, 0, &iref));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 0]
  |  |  ------------------
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3695|      0|            }
 3696|      0|            avifBoxMarker refType;
 3697|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "dimg", AVIF_BOX_SIZE_TBD, &refType));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3698|      0|            if (largeItemIDs) {
  ------------------
  |  Branch (3698:17): [True: 0, False: 0]
  ------------------
 3699|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->id)); // unsigned int(32) from_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3700|      0|            } else {
 3701|      0|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->id)); // unsigned int(16) from_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3702|      0|            }
 3703|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, dimgCount)); // unsigned int(16) reference_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3704|      0|            for (uint32_t dimgIndex = 0; dimgIndex < encoder->data->items.count; ++dimgIndex) {
  ------------------
  |  Branch (3704:42): [True: 0, False: 0]
  ------------------
 3705|      0|                avifEncoderItem * dimgItem = &encoder->data->items.item[dimgIndex];
 3706|      0|                if (dimgItem->dimgFromID == item->id) {
  ------------------
  |  Branch (3706:21): [True: 0, False: 0]
  ------------------
 3707|      0|                    if (largeItemIDs) {
  ------------------
  |  Branch (3707:25): [True: 0, False: 0]
  ------------------
 3708|      0|                        AVIF_CHECKRES(avifRWStreamWriteU32(&s, dimgItem->id)); // unsigned int(32) to_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3709|      0|                    } else {
 3710|      0|                        AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)dimgItem->id)); // unsigned int(16) to_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3711|      0|                    }
 3712|      0|                }
 3713|      0|            }
 3714|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, refType));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3715|      0|        }
 3716|       |
 3717|  18.4k|        if (item->irefToID != 0) {
  ------------------
  |  Branch (3717:13): [True: 4.61k, False: 13.7k]
  ------------------
 3718|  4.61k|            if (!iref) {
  ------------------
  |  Branch (3718:17): [True: 4.61k, False: 0]
  ------------------
 3719|       |                // 'iref' version 1 contains 32-bit item_ID fields, whereas version 0 contains 16-bit item_ID fields.
 3720|  4.61k|                AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "iref", AVIF_BOX_SIZE_TBD, largeItemIDs ? 1 : 0, 0, &iref));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  9.23k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3721|  4.61k|            }
 3722|  4.61k|            avifBoxMarker refType;
 3723|  4.61k|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, item->irefType, AVIF_BOX_SIZE_TBD, &refType));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3724|  4.61k|            if (largeItemIDs) {
  ------------------
  |  Branch (3724:17): [True: 0, False: 4.61k]
  ------------------
 3725|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->id));       // unsigned int(32) from_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3726|      0|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));              // unsigned int(16) reference_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3727|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->irefToID)); // unsigned int(32) to_item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3728|  4.61k|            } else {
 3729|  4.61k|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->id));       // unsigned int(16) from_item_ID;
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3730|  4.61k|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));                        // unsigned int(16) reference_count;
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3731|  4.61k|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->irefToID)); // unsigned int(16) to_item_ID;
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3732|  4.61k|            }
 3733|  4.61k|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, refType));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3734|  4.61k|        }
 3735|  18.4k|    }
 3736|  13.7k|    if (iref) {
  ------------------
  |  Branch (3736:9): [True: 4.61k, False: 9.17k]
  ------------------
 3737|  4.61k|        AVIF_CHECKRES(avifRWStreamFinishBox(&s, iref));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3738|  4.61k|    }
 3739|       |
 3740|       |    // -----------------------------------------------------------------------
 3741|       |    // Write iprp -> ipco/ipma
 3742|       |
 3743|  13.7k|    avifBoxMarker iprp;
 3744|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBox(&s, "iprp", AVIF_BOX_SIZE_TBD, &iprp));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3745|       |
 3746|  13.7k|    avifItemPropertyDedup * dedup = avifItemPropertyDedupCreate();
 3747|  13.7k|    AVIF_CHECKERR(dedup != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3748|  13.7k|    avifBoxMarker ipco;
 3749|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBox(&s, "ipco", AVIF_BOX_SIZE_TBD, &ipco));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3750|  13.7k|    avifImage * altImageMetadata = NULL;
 3751|  13.7k|    altImageMetadata = encoder->data->altImageMetadata;
 3752|  13.7k|    avifResult result = avifRWStreamWriteProperties(dedup, &s, encoder, imageMetadata, altImageMetadata);
 3753|  13.7k|    avifItemPropertyDedupDestroy(dedup);
 3754|  13.7k|    dedup = NULL;
 3755|  13.7k|    AVIF_CHECKRES(result);
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3756|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, ipco));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3757|       |
 3758|  13.7k|    avifBoxMarker ipma;
 3759|       |    // 'ipma' version 1 contains a 32-bit item_ID field, whereas version 0 contains a 16-bit item_ID field.
 3760|       |    // Note: the flags remain 0, meaning the property_index fields stay 7-bit wide.
 3761|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "ipma", AVIF_BOX_SIZE_TBD, largeItemIDs ? 1 : 0, 0, &ipma));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  27.5k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3762|  13.7k|    {
 3763|  13.7k|        uint32_t ipmaCount = 0;
 3764|  32.1k|        for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3764:38): [True: 18.4k, False: 13.7k]
  ------------------
 3765|  18.4k|            avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3766|  18.4k|            if (item->associations.count > 0) {
  ------------------
  |  Branch (3766:17): [True: 18.4k, False: 0]
  ------------------
 3767|  18.4k|                AVIF_CHECKERR(ipmaCount < UINT32_MAX, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3768|  18.4k|                ++ipmaCount;
 3769|  18.4k|            }
 3770|  18.4k|        }
 3771|  13.7k|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, ipmaCount)); // unsigned int(32) entry_count;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3772|       |
 3773|  32.1k|        for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3773:38): [True: 18.4k, False: 13.7k]
  ------------------
 3774|  18.4k|            avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3775|  18.4k|            if (item->associations.count == 0) {
  ------------------
  |  Branch (3775:17): [True: 0, False: 18.4k]
  ------------------
 3776|      0|                continue;
 3777|      0|            }
 3778|       |
 3779|  18.4k|            if (largeItemIDs) {
  ------------------
  |  Branch (3779:17): [True: 0, False: 18.4k]
  ------------------
 3780|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->id)); // unsigned int(32) item_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3781|  18.4k|            } else {
 3782|  18.4k|                AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)item->id)); // unsigned int(16) item_ID;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3783|  18.4k|            }
 3784|  18.4k|            AVIF_ASSERT_OR_RETURN(item->associations.count < (1 << 8));
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3785|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteU8(&s, (uint8_t)item->associations.count)); // unsigned int(8) association_count;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3786|   110k|            for (uint32_t i = 0; i < item->associations.count; ++i) {
  ------------------
  |  Branch (3786:34): [True: 92.0k, False: 18.4k]
  ------------------
 3787|  92.0k|                const avifItemPropertyAssociation * association = &item->associations.association[i];
 3788|  92.0k|                AVIF_CHECKRES(avifRWStreamWriteBits(&s, association->essential ? 1 : 0, /*bitCount=*/1)); // bit(1) essential;
  ------------------
  |  |   54|  92.0k|    do {                                  \
  |  |   55|   184k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 18.4k, False: 73.6k]
  |  |  ------------------
  |  |   56|  92.0k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
 3789|  92.0k|                AVIF_ASSERT_OR_RETURN(association->property_index <= MAX_PROPERTY_INDEX);
  ------------------
  |  |   64|  92.0k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  92.0k|    do {                        \
  |  |  |  |   46|  92.0k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 92.0k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  92.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 92.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3790|  92.0k|                AVIF_CHECKRES(avifRWStreamWriteBits(&s, association->property_index, /*bitCount=*/7)); // unsigned int(7) property_index;
  ------------------
  |  |   54|  92.0k|    do {                                  \
  |  |   55|  92.0k|        const avifResult result__ = (A);  \
  |  |   56|  92.0k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
 3791|  92.0k|            }
 3792|  18.4k|        }
 3793|  13.7k|    }
 3794|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, ipma));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3795|       |
 3796|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, iprp));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3797|       |
 3798|       |    // -----------------------------------------------------------------------
 3799|       |    // Write grpl/altr box
 3800|       |
 3801|  13.7k|    if (encoder->data->alternativeItemIDs.count) {
  ------------------
  |  Branch (3801:9): [True: 0, False: 13.7k]
  ------------------
 3802|       |        // Section 8.18.3.3 of ISO 14496-12 (ISOBMFF) says:
 3803|       |        //   group_id is a non-negative integer assigned to the particular grouping that shall not be equal to any
 3804|       |        //   group_id value of any other EntityToGroupBox, any item_ID value of the hierarchy level
 3805|       |        //   (file, movie. or track) that contains the GroupsListBox, or any track_ID value (when the
 3806|       |        //   GroupsListBox is contained in the file level).
 3807|      0|        AVIF_ASSERT_OR_RETURN(encoder->data->lastItemID < UINT32_MAX);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3808|      0|        ++encoder->data->lastItemID;
 3809|      0|        const uint32_t groupID = encoder->data->lastItemID;
 3810|      0|        AVIF_CHECKRES(avifWriteAltrGroup(&s, groupID, &encoder->data->alternativeItemIDs));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3811|      0|    }
 3812|       |
 3813|       |    // -----------------------------------------------------------------------
 3814|       |    // Finish meta box
 3815|       |
 3816|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(&s, meta));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3817|       |
 3818|       |    // -----------------------------------------------------------------------
 3819|       |    // Write tracks (if an image sequence)
 3820|       |
 3821|  13.7k|    if (isSequence) {
  ------------------
  |  Branch (3821:9): [True: 0, False: 13.7k]
  ------------------
 3822|      0|        static const uint8_t unityMatrix[9][4] = {
 3823|       |            /* clang-format off */
 3824|      0|            { 0x00, 0x01, 0x00, 0x00 },
 3825|      0|            { 0 },
 3826|      0|            { 0 },
 3827|      0|            { 0 },
 3828|      0|            { 0x00, 0x01, 0x00, 0x00 },
 3829|      0|            { 0 },
 3830|      0|            { 0 },
 3831|      0|            { 0 },
 3832|      0|            { 0x40, 0x00, 0x00, 0x00 } /* clang-format on */
 3833|      0|        };
 3834|       |
 3835|      0|        if (encoder->repetitionCount < 0 && encoder->repetitionCount != AVIF_REPETITION_COUNT_INFINITE) {
  ------------------
  |  |  119|      0|#define AVIF_REPETITION_COUNT_INFINITE -1
  ------------------
  |  Branch (3835:13): [True: 0, False: 0]
  |  Branch (3835:45): [True: 0, False: 0]
  ------------------
 3836|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 3837|      0|        }
 3838|       |
 3839|      0|        uint64_t framesDurationInTimescales = 0;
 3840|      0|        for (uint32_t frameIndex = 0; frameIndex < encoder->data->frames.count; ++frameIndex) {
  ------------------
  |  Branch (3840:39): [True: 0, False: 0]
  ------------------
 3841|      0|            const avifEncoderFrame * frame = &encoder->data->frames.frame[frameIndex];
 3842|      0|            framesDurationInTimescales += frame->durationInTimescales;
 3843|      0|        }
 3844|      0|        uint64_t durationInTimescales;
 3845|      0|        if (encoder->repetitionCount == AVIF_REPETITION_COUNT_INFINITE) {
  ------------------
  |  |  119|      0|#define AVIF_REPETITION_COUNT_INFINITE -1
  ------------------
  |  Branch (3845:13): [True: 0, False: 0]
  ------------------
 3846|      0|            durationInTimescales = AVIF_INDEFINITE_DURATION64;
  ------------------
  |  |  842|      0|#define AVIF_INDEFINITE_DURATION64 UINT64_MAX
  ------------------
 3847|      0|        } else {
 3848|      0|            uint64_t loopCount = encoder->repetitionCount + 1;
 3849|      0|            AVIF_ASSERT_OR_RETURN(framesDurationInTimescales != 0);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3850|      0|            if (loopCount > UINT64_MAX / framesDurationInTimescales) {
  ------------------
  |  Branch (3850:17): [True: 0, False: 0]
  ------------------
 3851|       |                // The multiplication will overflow uint64_t.
 3852|      0|                return AVIF_RESULT_INVALID_ARGUMENT;
 3853|      0|            }
 3854|      0|            durationInTimescales = framesDurationInTimescales * loopCount;
 3855|      0|        }
 3856|       |
 3857|       |        // -------------------------------------------------------------------
 3858|       |        // Start moov
 3859|       |
 3860|      0|        avifBoxMarker moov;
 3861|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(&s, "moov", AVIF_BOX_SIZE_TBD, &moov));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3862|       |
 3863|      0|        avifBoxMarker mvhd;
 3864|      0|        AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "mvhd", AVIF_BOX_SIZE_TBD, 1, 0, &mvhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3865|      0|        AVIF_CHECKRES(avifRWStreamWriteU64(&s, creationTime));                 // unsigned int(64) creation_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3866|      0|        AVIF_CHECKRES(avifRWStreamWriteU64(&s, modificationTime));             // unsigned int(64) modification_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3867|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)encoder->timescale)); // unsigned int(32) timescale;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3868|      0|        AVIF_CHECKRES(avifRWStreamWriteU64(&s, durationInTimescales));         // unsigned int(64) duration;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3869|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0x00010000)); // template int(32) rate = 0x00010000; // typically 1.0
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3870|      0|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0x0100));     // template int(16) volume = 0x0100; // typically, full volume
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3871|      0|        AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));          // const bit(16) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3872|      0|        AVIF_CHECKRES(avifRWStreamWriteZeros(&s, 8));        // const unsigned int(32)[2] reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3873|      0|        AVIF_CHECKRES(avifRWStreamWrite(&s, unityMatrix, sizeof(unityMatrix)));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3874|      0|        AVIF_CHECKRES(avifRWStreamWriteZeros(&s, 24));                       // bit(32)[6] pre_defined = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3875|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(&s, encoder->data->items.count)); // unsigned int(32) next_track_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3876|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(&s, mvhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3877|       |
 3878|       |        // -------------------------------------------------------------------
 3879|       |        // Write tracks
 3880|       |
 3881|      0|        for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3881:38): [True: 0, False: 0]
  ------------------
 3882|      0|            avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3883|      0|            if (item->encodeOutput->samples.count == 0) {
  ------------------
  |  Branch (3883:17): [True: 0, False: 0]
  ------------------
 3884|      0|                continue;
 3885|      0|            }
 3886|       |
 3887|      0|            uint32_t syncSamplesCount = 0;
 3888|      0|            for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (3888:44): [True: 0, False: 0]
  ------------------
 3889|      0|                avifEncodeSample * sample = &item->encodeOutput->samples.sample[sampleIndex];
 3890|      0|                if (sample->sync) {
  ------------------
  |  Branch (3890:21): [True: 0, False: 0]
  ------------------
 3891|      0|                    ++syncSamplesCount;
 3892|      0|                }
 3893|      0|            }
 3894|       |
 3895|      0|            avifBoxMarker trak;
 3896|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "trak", AVIF_BOX_SIZE_TBD, &trak));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3897|       |
 3898|      0|            avifBoxMarker tkhd;
 3899|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "tkhd", AVIF_BOX_SIZE_TBD, 1, 1, &tkhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3900|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, creationTime));           // unsigned int(64) creation_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3901|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, modificationTime));       // unsigned int(64) modification_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3902|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, itemIndex + 1));          // unsigned int(32) track_ID;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3903|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0));                      // const unsigned int(32) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3904|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, durationInTimescales));   // unsigned int(64) duration;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3905|      0|            AVIF_CHECKRES(avifRWStreamWriteZeros(&s, sizeof(uint32_t) * 2)); // const unsigned int(32)[2] reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3906|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                      // template int(16) layer = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3907|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                      // template int(16) alternate_group = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3908|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0)); // template int(16) volume = {if track_is_audio 0x0100 else 0};
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3909|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0)); // const unsigned int(16) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3910|      0|            AVIF_CHECKRES(avifRWStreamWrite(&s, unityMatrix, sizeof(unityMatrix))); // template int(32)[9] matrix= // { 0x00010000,0,0,0,0x00010000,0,0,0,0x40000000 };
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3911|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, imageMetadata->width << 16));  // unsigned int(32) width;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3912|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, imageMetadata->height << 16)); // unsigned int(32) height;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3913|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, tkhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3914|       |
 3915|      0|            if (item->irefToID != 0) {
  ------------------
  |  Branch (3915:17): [True: 0, False: 0]
  ------------------
 3916|      0|                avifBoxMarker tref;
 3917|      0|                AVIF_CHECKRES(avifRWStreamWriteBox(&s, "tref", AVIF_BOX_SIZE_TBD, &tref));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3918|      0|                avifBoxMarker refType;
 3919|      0|                AVIF_CHECKRES(avifRWStreamWriteBox(&s, item->irefType, AVIF_BOX_SIZE_TBD, &refType));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3920|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)item->irefToID));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3921|      0|                AVIF_CHECKRES(avifRWStreamFinishBox(&s, refType));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3922|      0|                AVIF_CHECKRES(avifRWStreamFinishBox(&s, tref));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3923|      0|            }
 3924|       |
 3925|      0|            avifBoxMarker edts;
 3926|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "edts", AVIF_BOX_SIZE_TBD, &edts));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3927|      0|            uint32_t elstFlags = (encoder->repetitionCount != 0);
 3928|      0|            avifBoxMarker elst;
 3929|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "elst", AVIF_BOX_SIZE_TBD, 1, elstFlags, &elst));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3930|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1));                          // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3931|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, framesDurationInTimescales)); // unsigned int(64) segment_duration;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3932|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, 0));                          // int(64) media_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3933|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));                          // int(16) media_rate_integer;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3934|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                          // int(16) media_rate_fraction = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3935|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, elst));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3936|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, edts));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3937|       |
 3938|      0|            if (item->itemCategory != AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (3938:17): [True: 0, False: 0]
  ------------------
 3939|      0|                AVIF_CHECKRES(avifEncoderWriteTrackMetaBox(encoder, &s));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3940|      0|            }
 3941|       |
 3942|      0|            avifBoxMarker mdia;
 3943|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "mdia", AVIF_BOX_SIZE_TBD, &mdia));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3944|       |
 3945|      0|            avifBoxMarker mdhd;
 3946|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "mdhd", AVIF_BOX_SIZE_TBD, 1, 0, &mdhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3947|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, creationTime));                 // unsigned int(64) creation_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3948|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, modificationTime));             // unsigned int(64) modification_time;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3949|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)encoder->timescale)); // unsigned int(32) timescale;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3950|      0|            AVIF_CHECKRES(avifRWStreamWriteU64(&s, framesDurationInTimescales));   // unsigned int(64) duration;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3951|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 21956)); // bit(1) pad = 0; unsigned int(5)[3] language; ("und")
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3952|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));     // unsigned int(16) pre_defined = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3953|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, mdhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3954|       |
 3955|      0|            AVIF_CHECKRES(avifRWStreamWriteHandlerBox(&s, (item->itemCategory == AVIF_ITEM_ALPHA) ? "auxv" : "pict"));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 0]
  |  |  ------------------
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3956|       |
 3957|      0|            avifBoxMarker minf;
 3958|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "minf", AVIF_BOX_SIZE_TBD, &minf));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3959|       |
 3960|      0|            avifBoxMarker vmhd;
 3961|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "vmhd", AVIF_BOX_SIZE_TBD, 0, 1, &vmhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3962|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0)); // template unsigned int(16) graphicsmode = 0; (copy over the existing image)
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3963|      0|            AVIF_CHECKRES(avifRWStreamWriteZeros(&s, 6)); // template unsigned int(16)[3] opcolor = {0, 0, 0};
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3964|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, vmhd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3965|       |
 3966|      0|            avifBoxMarker dinf;
 3967|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "dinf", AVIF_BOX_SIZE_TBD, &dinf));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3968|      0|            avifBoxMarker dref;
 3969|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "dref", AVIF_BOX_SIZE_TBD, 0, 0, &dref));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3970|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1)); // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3971|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "url ", /*contentSize=*/0, 0, 1, /*marker=*/NULL)); // flags:1 means data is in this file
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3972|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, dref));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3973|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, dinf));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3974|       |
 3975|       |            // The boxes within the "stbl" box are ordered using the following recommendation in ISO/IEC 14496-12, Section 6.2.3:
 3976|       |            // 4) It is recommended that the boxes within the Sample Table Box be in the following order: Sample Description
 3977|       |            // (stsd), Time to Sample (stts), Sample to Chunk (stsc), Sample Size (stsz), Chunk Offset (stco).
 3978|       |            //
 3979|       |            // Any boxes not listed in the above line are placed in the end (after the "stco" box).
 3980|      0|            avifBoxMarker stbl;
 3981|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, "stbl", AVIF_BOX_SIZE_TBD, &stbl));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3982|       |
 3983|      0|            avifBoxMarker stsd;
 3984|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stsd", AVIF_BOX_SIZE_TBD, 0, 0, &stsd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3985|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1)); // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3986|      0|            avifBoxMarker imageItem;
 3987|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&s, encoder->data->imageItemType, AVIF_BOX_SIZE_TBD, &imageItem));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3988|      0|            AVIF_CHECKRES(avifRWStreamWriteZeros(&s, 6));                             // const unsigned int(8)[6] reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3989|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));                               // unsigned int(16) data_reference_index;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3990|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                               // unsigned int(16) pre_defined = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3991|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0));                               // const unsigned int(16) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3992|      0|            AVIF_CHECKRES(avifRWStreamWriteZeros(&s, sizeof(uint32_t) * 3));          // unsigned int(32)[3] pre_defined = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3993|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)imageMetadata->width));  // unsigned int(16) width;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3994|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)imageMetadata->height)); // unsigned int(16) height;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3995|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0x00480000));                      // template unsigned int(32) horizresolution
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3996|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0x00480000));                      // template unsigned int(32) vertresolution
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3997|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0));                               // const unsigned int(32) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3998|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 1));                      // template unsigned int(16) frame_count = 1;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3999|      0|            AVIF_CHECKRES(avifRWStreamWriteChars(&s, "\012AOM Coding", 11)); // string[32] compressorname;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4000|      0|            AVIF_CHECKRES(avifRWStreamWriteZeros(&s, 32 - 11));              //
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4001|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, 0x0018));                 // template unsigned int(16) depth = 0x0018;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4002|      0|            AVIF_CHECKRES(avifRWStreamWriteU16(&s, (uint16_t)0xffff));       // int(16) pre_defined = -1;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4003|      0|            AVIF_CHECKRES(writeConfigBox(&s, &item->av1C, encoder->data->configPropName));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4004|      0|            if (item->itemCategory == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (4004:17): [True: 0, False: 0]
  ------------------
 4005|      0|                AVIF_CHECKRES(avifEncoderWriteColorProperties(&s, imageMetadata, NULL, NULL));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4006|      0|                AVIF_CHECKRES(avifEncoderWriteHDRProperties(NULL, &s, imageMetadata, NULL, NULL));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4007|      0|                AVIF_CHECKRES(avifEncoderWriteTransformativeProperties(NULL, &s, imageMetadata, NULL, NULL));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4008|      0|            }
 4009|       |
 4010|      0|            avifBoxMarker ccst;
 4011|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "ccst", AVIF_BOX_SIZE_TBD, 0, 0, &ccst));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4012|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/1));  // unsigned int(1) all_ref_pics_intra;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4013|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 1, /*bitCount=*/1));  // unsigned int(1) intra_pred_used;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4014|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 15, /*bitCount=*/4)); // unsigned int(4) max_ref_per_pic;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4015|      0|            AVIF_CHECKRES(avifRWStreamWriteBits(&s, 0, /*bitCount=*/26)); // unsigned int(26) reserved;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4016|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, ccst));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4017|       |
 4018|      0|            if (item->itemCategory == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (4018:17): [True: 0, False: 0]
  ------------------
 4019|      0|                avifBoxMarker auxi;
 4020|      0|                AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "auxi", AVIF_BOX_SIZE_TBD, 0, 0, &auxi));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4021|      0|                AVIF_CHECKRES(avifRWStreamWriteChars(&s, alphaURN, alphaURNSize)); //  string aux_track_type;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4022|      0|                AVIF_CHECKRES(avifRWStreamFinishBox(&s, auxi));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4023|      0|            }
 4024|       |
 4025|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, imageItem));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4026|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stsd));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4027|       |
 4028|      0|            avifBoxMarker stts;
 4029|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stts", AVIF_BOX_SIZE_TBD, 0, 0, &stts));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4030|      0|            size_t sttsEntryCountOffset = avifRWStreamOffset(&s);
 4031|      0|            uint32_t sttsEntryCount = 0;
 4032|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0)); // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4033|      0|            for (uint32_t sampleCount = 0, frameIndex = 0; frameIndex < encoder->data->frames.count; ++frameIndex) {
  ------------------
  |  Branch (4033:60): [True: 0, False: 0]
  ------------------
 4034|      0|                avifEncoderFrame * frame = &encoder->data->frames.frame[frameIndex];
 4035|      0|                ++sampleCount;
 4036|      0|                if (frameIndex < (encoder->data->frames.count - 1)) {
  ------------------
  |  Branch (4036:21): [True: 0, False: 0]
  ------------------
 4037|      0|                    avifEncoderFrame * nextFrame = &encoder->data->frames.frame[frameIndex + 1];
 4038|      0|                    if (frame->durationInTimescales == nextFrame->durationInTimescales) {
  ------------------
  |  Branch (4038:25): [True: 0, False: 0]
  ------------------
 4039|      0|                        continue;
 4040|      0|                    }
 4041|      0|                }
 4042|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, sampleCount));                           // unsigned int(32) sample_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4043|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)frame->durationInTimescales)); // unsigned int(32) sample_delta;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4044|      0|                sampleCount = 0;
 4045|      0|                ++sttsEntryCount;
 4046|      0|            }
 4047|      0|            size_t prevOffset = avifRWStreamOffset(&s);
 4048|      0|            avifRWStreamSetOffset(&s, sttsEntryCountOffset);
 4049|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, sttsEntryCount));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4050|      0|            avifRWStreamSetOffset(&s, prevOffset);
 4051|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stts));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4052|       |
 4053|      0|            avifBoxMarker stsc;
 4054|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stsc", AVIF_BOX_SIZE_TBD, 0, 0, &stsc));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4055|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1));                                 // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4056|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1));                                 // unsigned int(32) first_chunk;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4057|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->encodeOutput->samples.count)); // unsigned int(32) samples_per_chunk;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4058|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1)); // unsigned int(32) sample_description_index;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4059|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stsc));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4060|       |
 4061|      0|            avifBoxMarker stsz;
 4062|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stsz", AVIF_BOX_SIZE_TBD, 0, 0, &stsz));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4063|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 0));                                 // unsigned int(32) sample_size;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4064|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, item->encodeOutput->samples.count)); // unsigned int(32) sample_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4065|      0|            for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (4065:44): [True: 0, False: 0]
  ------------------
 4066|      0|                avifEncodeSample * sample = &item->encodeOutput->samples.sample[sampleIndex];
 4067|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, (uint32_t)sample->data.size)); // unsigned int(32) entry_size;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4068|      0|            }
 4069|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stsz));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4070|       |
 4071|      0|            avifBoxMarker stco;
 4072|      0|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stco", AVIF_BOX_SIZE_TBD, 0, 0, &stco));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4073|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1));           // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4074|      0|            AVIF_CHECKRES(avifEncoderItemAddMdatFixup(item, &s)); //
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4075|      0|            AVIF_CHECKRES(avifRWStreamWriteU32(&s, 1));           // unsigned int(32) chunk_offset; (set later)
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4076|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stco));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4077|       |
 4078|      0|            avifBool hasNonSyncSample = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 4079|      0|            for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (4079:44): [True: 0, False: 0]
  ------------------
 4080|      0|                if (!item->encodeOutput->samples.sample[sampleIndex].sync) {
  ------------------
  |  Branch (4080:21): [True: 0, False: 0]
  ------------------
 4081|      0|                    hasNonSyncSample = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 4082|      0|                    break;
 4083|      0|                }
 4084|      0|            }
 4085|       |            // ISO/IEC 14496-12, Section 8.6.2.1:
 4086|       |            //   If the SyncSampleBox is not present, every sample is a sync sample.
 4087|      0|            if (hasNonSyncSample) {
  ------------------
  |  Branch (4087:17): [True: 0, False: 0]
  ------------------
 4088|      0|                avifBoxMarker stss;
 4089|      0|                AVIF_CHECKRES(avifRWStreamWriteFullBox(&s, "stss", AVIF_BOX_SIZE_TBD, 0, 0, &stss));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4090|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(&s, syncSamplesCount)); // unsigned int(32) entry_count;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4091|      0|                for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (4091:48): [True: 0, False: 0]
  ------------------
 4092|      0|                    avifEncodeSample * sample = &item->encodeOutput->samples.sample[sampleIndex];
 4093|      0|                    if (sample->sync) {
  ------------------
  |  Branch (4093:25): [True: 0, False: 0]
  ------------------
 4094|      0|                        AVIF_CHECKRES(avifRWStreamWriteU32(&s, sampleIndex + 1)); // unsigned int(32) sample_number;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4095|      0|                    }
 4096|      0|                }
 4097|      0|                AVIF_CHECKRES(avifRWStreamFinishBox(&s, stss));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4098|      0|            }
 4099|       |
 4100|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, stbl));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4101|       |
 4102|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, minf));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4103|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, mdia));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4104|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&s, trak));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4105|      0|        }
 4106|       |
 4107|       |        // -------------------------------------------------------------------
 4108|       |        // Finish moov box
 4109|       |
 4110|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(&s, moov));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4111|      0|    }
 4112|       |
 4113|       |    // -----------------------------------------------------------------------
 4114|       |    // Write mdat
 4115|       |
 4116|  13.7k|    avifEncoderItemReferenceArray layeredColorItems;
 4117|  13.7k|    avifEncoderItemReferenceArray layeredAlphaItems;
 4118|  13.7k|    if (!avifArrayCreate(&layeredColorItems, sizeof(avifEncoderItemReference), 1)) {
  ------------------
  |  Branch (4118:9): [True: 0, False: 13.7k]
  ------------------
 4119|      0|        result = AVIF_RESULT_OUT_OF_MEMORY;
 4120|      0|    }
 4121|  13.7k|    if (!avifArrayCreate(&layeredAlphaItems, sizeof(avifEncoderItemReference), 1)) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 13.7k]
  ------------------
 4122|      0|        result = AVIF_RESULT_OUT_OF_MEMORY;
 4123|      0|    }
 4124|  13.7k|    if (result == AVIF_RESULT_OK) {
  ------------------
  |  Branch (4124:9): [True: 13.7k, False: 0]
  ------------------
 4125|  13.7k|        result = avifEncoderWriteMediaDataBox(encoder, &s, &layeredColorItems, &layeredAlphaItems);
 4126|  13.7k|    }
 4127|  13.7k|    avifArrayDestroy(&layeredColorItems);
 4128|  13.7k|    avifArrayDestroy(&layeredAlphaItems);
 4129|  13.7k|    AVIF_CHECKRES(result);
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 4130|       |
 4131|       |    // -----------------------------------------------------------------------
 4132|       |    // Finish up stream
 4133|       |
 4134|  13.7k|    avifRWStreamFinishWrite(&s);
 4135|       |
 4136|       |#if defined(AVIF_ENABLE_COMPLIANCE_WARDEN)
 4137|       |    AVIF_CHECKRES(avifIsCompliant(output->data, output->size));
 4138|       |#endif
 4139|       |
 4140|  13.7k|    return AVIF_RESULT_OK;
 4141|  13.7k|}
write.c:avifEncoderDataCreate:
  261|  13.7k|{
  262|  13.7k|    avifEncoderData * data = (avifEncoderData *)avifAlloc(sizeof(avifEncoderData));
  263|  13.7k|    if (!data) {
  ------------------
  |  Branch (263:9): [True: 0, False: 13.7k]
  ------------------
  264|      0|        return NULL;
  265|      0|    }
  266|  13.7k|    memset(data, 0, sizeof(avifEncoderData));
  267|  13.7k|    data->imageMetadata = avifImageCreateEmpty();
  268|  13.7k|    if (!data->imageMetadata) {
  ------------------
  |  Branch (268:9): [True: 0, False: 13.7k]
  ------------------
  269|      0|        goto error;
  270|      0|    }
  271|  13.7k|    data->altImageMetadata = avifImageCreateEmpty();
  272|  13.7k|    if (!data->altImageMetadata) {
  ------------------
  |  Branch (272:9): [True: 0, False: 13.7k]
  ------------------
  273|      0|        goto error;
  274|      0|    }
  275|  13.7k|    if (!avifArrayCreate(&data->items, sizeof(avifEncoderItem), 8)) {
  ------------------
  |  Branch (275:9): [True: 0, False: 13.7k]
  ------------------
  276|      0|        goto error;
  277|      0|    }
  278|  13.7k|    if (!avifArrayCreate(&data->frames, sizeof(avifEncoderFrame), 1)) {
  ------------------
  |  Branch (278:9): [True: 0, False: 13.7k]
  ------------------
  279|      0|        goto error;
  280|      0|    }
  281|  13.7k|    if (!avifArrayCreate(&data->alternativeItemIDs, sizeof(uint32_t), 1)) {
  ------------------
  |  Branch (281:9): [True: 0, False: 13.7k]
  ------------------
  282|      0|        goto error;
  283|      0|    }
  284|  13.7k|    return data;
  285|       |
  286|      0|error:
  287|      0|    avifEncoderDataDestroy(data);
  288|       |    return NULL;
  289|  13.7k|}
write.c:avifEncoderDataDestroy:
  348|  13.7k|{
  349|  32.1k|    for (uint32_t i = 0; i < data->items.count; ++i) {
  ------------------
  |  Branch (349:26): [True: 18.4k, False: 13.7k]
  ------------------
  350|  18.4k|        avifEncoderItem * item = &data->items.item[i];
  351|  18.4k|        if (item->codec) {
  ------------------
  |  Branch (351:13): [True: 18.4k, False: 0]
  ------------------
  352|  18.4k|            avifCodecDestroy(item->codec);
  353|  18.4k|        }
  354|  18.4k|        avifCodecEncodeOutputDestroy(item->encodeOutput);
  355|  18.4k|        avifRWDataFree(&item->metadataPayload);
  356|  18.4k|        avifArrayDestroy(&item->mdatFixups);
  357|  18.4k|        avifArrayDestroy(&item->associations);
  358|  18.4k|    }
  359|  13.7k|    if (data->imageMetadata) {
  ------------------
  |  Branch (359:9): [True: 13.7k, False: 0]
  ------------------
  360|  13.7k|        avifImageDestroy(data->imageMetadata);
  361|  13.7k|    }
  362|  13.7k|    if (data->altImageMetadata) {
  ------------------
  |  Branch (362:9): [True: 13.7k, False: 0]
  ------------------
  363|  13.7k|        avifImageDestroy(data->altImageMetadata);
  364|  13.7k|    }
  365|  13.7k|    avifArrayDestroy(&data->items);
  366|  13.7k|    avifArrayDestroy(&data->frames);
  367|  13.7k|    avifArrayDestroy(&data->alternativeItemIDs);
  368|  13.7k|    avifFree(data);
  369|  13.7k|}
write.c:avifEncoderAddImageInternal:
 1908|  55.1k|{
 1909|       |    // -----------------------------------------------------------------------
 1910|       |    // Verify encoding is possible
 1911|       |
 1912|  55.1k|    if (!avifCodecName(encoder->codecChoice, AVIF_CODEC_FLAG_CAN_ENCODE)) {
  ------------------
  |  Branch (1912:9): [True: 0, False: 55.1k]
  ------------------
 1913|      0|        return AVIF_RESULT_NO_CODEC_AVAILABLE;
 1914|      0|    }
 1915|       |
 1916|  55.1k|    if (encoder->extraLayerCount >= AVIF_MAX_AV1_LAYER_COUNT) {
  ------------------
  |  |  125|  55.1k|#define AVIF_MAX_AV1_LAYER_COUNT 4
  ------------------
  |  Branch (1916:9): [True: 0, False: 55.1k]
  ------------------
 1917|      0|        avifDiagnosticsPrintf(&encoder->diag, "extraLayerCount [%u] must be less than %d", encoder->extraLayerCount, AVIF_MAX_AV1_LAYER_COUNT);
  ------------------
  |  |  125|      0|#define AVIF_MAX_AV1_LAYER_COUNT 4
  ------------------
 1918|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1919|      0|    }
 1920|       |
 1921|       |    // -----------------------------------------------------------------------
 1922|       |    // Validate images
 1923|       |
 1924|  55.1k|    const uint32_t cellCount = gridCols * gridRows;
 1925|  55.1k|    if (cellCount == 0) {
  ------------------
  |  Branch (1925:9): [True: 0, False: 55.1k]
  ------------------
 1926|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1927|      0|    }
 1928|       |
 1929|  55.1k|    const avifImage * firstCell = cellImages[0];
 1930|  55.1k|    const avifImage * bottomRightCell = cellImages[cellCount - 1];
 1931|  55.1k|    AVIF_CHECKERR(firstCell->depth == 8 || firstCell->depth == 10 || firstCell->depth == 12 ||
  ------------------
  |  |   45|  55.1k|    do {                        \
  |  |   46|   189k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 39.6k, False: 15.5k]
  |  |  |  Branch (46:15): [True: 7.46k, False: 8.04k]
  |  |  |  Branch (46:15): [True: 8.04k, False: 0]
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  55.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
 1932|  55.1k|                      (firstCell->depth == 16 && encoder->sampleTransformRecipe != AVIF_SAMPLE_TRANSFORM_NONE),
 1933|  55.1k|                  AVIF_RESULT_UNSUPPORTED_DEPTH);
 1934|  55.1k|    AVIF_CHECKERR(firstCell->yuvFormat != AVIF_PIXEL_FORMAT_NONE, AVIF_RESULT_NO_YUV_FORMAT_SELECTED);
  ------------------
  |  |   45|  55.1k|    do {                        \
  |  |   46|  55.1k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 55.1k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  55.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
 1935|  55.1k|    if (!firstCell->width || !firstCell->height || !bottomRightCell->width || !bottomRightCell->height) {
  ------------------
  |  Branch (1935:9): [True: 0, False: 55.1k]
  |  Branch (1935:30): [True: 0, False: 55.1k]
  |  Branch (1935:52): [True: 0, False: 55.1k]
  |  Branch (1935:79): [True: 0, False: 55.1k]
  ------------------
 1936|      0|        return AVIF_RESULT_NO_CONTENT;
 1937|      0|    }
 1938|       |
 1939|  55.1k|    AVIF_CHECKRES(avifEncoderValidateSize(encoder, gridCols, gridRows, firstCell));
  ------------------
  |  |   54|  55.1k|    do {                                  \
  |  |   55|  55.1k|        const avifResult result__ = (A);  \
  |  |   56|  55.1k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 55.1k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  55.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
 1940|       |
 1941|  55.1k|    AVIF_CHECKRES(avifValidateGrid(gridCols, gridRows, cellImages, /*validateGainMap=*/AVIF_FALSE, &encoder->diag));
  ------------------
  |  |   54|  55.1k|    do {                                  \
  |  |   55|  55.1k|        const avifResult result__ = (A);  \
  |  |   56|  55.1k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 55.1k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  55.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
 1942|       |
 1943|  55.1k|    const avifBool hasGainMap = (firstCell->gainMap && firstCell->gainMap->image != NULL);
  ------------------
  |  Branch (1943:34): [True: 0, False: 55.1k]
  |  Branch (1943:56): [True: 0, False: 0]
  ------------------
 1944|       |
 1945|       |    // Check that either all cells have a gain map, or none of them do.
 1946|       |    // If a gain map is present, check that they all have the same gain map metadata.
 1947|   110k|    for (uint32_t cellIndex = 0; cellIndex < cellCount; ++cellIndex) {
  ------------------
  |  Branch (1947:34): [True: 55.1k, False: 55.1k]
  ------------------
 1948|  55.1k|        const avifImage * cellImage = cellImages[cellIndex];
 1949|  55.1k|        const avifBool cellHasGainMap = (cellImage->gainMap && cellImage->gainMap->image);
  ------------------
  |  Branch (1949:42): [True: 0, False: 55.1k]
  |  Branch (1949:64): [True: 0, False: 0]
  ------------------
 1950|  55.1k|        if (cellHasGainMap != hasGainMap) {
  ------------------
  |  Branch (1950:13): [True: 0, False: 55.1k]
  ------------------
 1951|      0|            avifDiagnosticsPrintf(&encoder->diag, "cells should either all have a gain map image, or none of them should, found a mix");
 1952|      0|            return AVIF_RESULT_INVALID_IMAGE_GRID;
 1953|      0|        }
 1954|  55.1k|        if (hasGainMap) {
  ------------------
  |  Branch (1954:13): [True: 0, False: 55.1k]
  ------------------
 1955|      0|            if (!avifSameGainMapAltMetadata(firstCell->gainMap, cellImage->gainMap)) {
  ------------------
  |  Branch (1955:17): [True: 0, False: 0]
  ------------------
 1956|      0|                avifDiagnosticsPrintf(&encoder->diag, "all cells should have the same alternate image metadata in the gain map");
 1957|      0|                return AVIF_RESULT_INVALID_IMAGE_GRID;
 1958|      0|            }
 1959|      0|            if (!avifSameGainMapMetadata(firstCell->gainMap, cellImage->gainMap)) {
  ------------------
  |  Branch (1959:17): [True: 0, False: 0]
  ------------------
 1960|      0|                avifDiagnosticsPrintf(&encoder->diag, "all cells should have the same gain map metadata");
 1961|      0|                return AVIF_RESULT_INVALID_IMAGE_GRID;
 1962|      0|            }
 1963|      0|        }
 1964|  55.1k|    }
 1965|       |
 1966|  55.1k|    if (hasGainMap) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 55.1k]
  ------------------
 1967|       |        // AVIF supports 16-bit images through sample transforms used as bit depth extensions,
 1968|       |        // but this is not implemented for gain maps for now. Stick to at most 12 bits.
 1969|      0|        AVIF_CHECKERR(firstCell->gainMap->image->depth == 8 || firstCell->gainMap->image->depth == 10 ||
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1970|      0|                          firstCell->gainMap->image->depth == 12,
 1971|      0|                      AVIF_RESULT_UNSUPPORTED_DEPTH);
 1972|      0|        AVIF_CHECKERR(firstCell->gainMap->image->yuvFormat != AVIF_PIXEL_FORMAT_NONE, AVIF_RESULT_NO_YUV_FORMAT_SELECTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1973|      0|        AVIF_CHECKRES(avifValidateGrid(gridCols, gridRows, cellImages, /*validateGainMap=*/AVIF_TRUE, &encoder->diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1974|      0|        if (firstCell->gainMap->image->colorPrimaries != AVIF_COLOR_PRIMARIES_UNSPECIFIED ||
  ------------------
  |  Branch (1974:13): [True: 0, False: 0]
  ------------------
 1975|      0|            firstCell->gainMap->image->transferCharacteristics != AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED) {
  ------------------
  |  Branch (1975:13): [True: 0, False: 0]
  ------------------
 1976|      0|            avifDiagnosticsPrintf(&encoder->diag, "the gain map image must have colorPrimaries = 2 and transferCharacteristics = 2");
 1977|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1978|      0|        }
 1979|      0|    }
 1980|       |
 1981|       |    // -----------------------------------------------------------------------
 1982|       |    // Validate flags
 1983|       |
 1984|  55.1k|    if (encoder->data->singleImage) {
  ------------------
  |  Branch (1984:9): [True: 0, False: 55.1k]
  ------------------
 1985|       |        // The previous call to avifEncoderAddImage() set AVIF_ADD_IMAGE_FLAG_SINGLE.
 1986|       |        // avifEncoderAddImage() cannot be called again for this encode.
 1987|      0|        return AVIF_RESULT_ENCODE_COLOR_FAILED;
 1988|      0|    }
 1989|       |
 1990|  55.1k|    if (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) {
  ------------------
  |  Branch (1990:9): [True: 0, False: 55.1k]
  ------------------
 1991|      0|        encoder->data->singleImage = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1992|       |
 1993|      0|        if (encoder->extraLayerCount > 0) {
  ------------------
  |  Branch (1993:13): [True: 0, False: 0]
  ------------------
 1994|       |            // AVIF_ADD_IMAGE_FLAG_SINGLE may not be set for a layered image.
 1995|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1996|      0|        }
 1997|       |
 1998|      0|        if (encoder->data->items.count > 0) {
  ------------------
  |  Branch (1998:13): [True: 0, False: 0]
  ------------------
 1999|       |            // AVIF_ADD_IMAGE_FLAG_SINGLE may only be set on the first and only image.
 2000|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 2001|      0|        }
 2002|      0|    }
 2003|       |
 2004|       |    // -----------------------------------------------------------------------
 2005|       |    // Choose AV1 or AV2
 2006|       |
 2007|  55.1k|    const avifCodecType codecType = avifEncoderGetCodecType(encoder);
 2008|  55.1k|    switch (codecType) {
 2009|  55.1k|        case AVIF_CODEC_TYPE_AV1:
  ------------------
  |  Branch (2009:9): [True: 55.1k, False: 0]
  ------------------
 2010|  55.1k|            encoder->data->imageItemType = "av01";
 2011|  55.1k|            encoder->data->configPropName = "av1C";
 2012|  55.1k|            break;
 2013|       |#if defined(AVIF_CODEC_AVM)
 2014|       |        case AVIF_CODEC_TYPE_AV2:
 2015|       |            encoder->data->imageItemType = "av02";
 2016|       |            encoder->data->configPropName = "av2C";
 2017|       |            break;
 2018|       |#endif
 2019|      0|        default:
  ------------------
  |  Branch (2019:9): [True: 0, False: 55.1k]
  ------------------
 2020|      0|            return AVIF_RESULT_NO_CODEC_AVAILABLE;
 2021|  55.1k|    }
 2022|       |
 2023|       |    // -----------------------------------------------------------------------
 2024|       |    // Populate encoder data (color) quality, qualityAlpha and qualityGainMap.
 2025|  55.1k|    encoder->data->quality = avifGetQuality(encoder->quality, encoder->minQuantizer, encoder->maxQuantizer);
 2026|       |
 2027|       |    // If alpha quality, and min and max alpha quantizer have their default values, default to the same quality as color.
 2028|  55.1k|    if (encoder->qualityAlpha == AVIF_QUALITY_DEFAULT && encoder->minQuantizerAlpha == AVIF_QUANTIZER_BEST_QUALITY &&
  ------------------
  |  |  103|   110k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
                  if (encoder->qualityAlpha == AVIF_QUALITY_DEFAULT && encoder->minQuantizerAlpha == AVIF_QUANTIZER_BEST_QUALITY &&
  ------------------
  |  |  109|  55.1k|#define AVIF_QUANTIZER_BEST_QUALITY 0
  ------------------
  |  Branch (2028:9): [True: 0, False: 55.1k]
  |  Branch (2028:58): [True: 0, False: 0]
  ------------------
 2029|      0|        encoder->maxQuantizerAlpha == AVIF_QUANTIZER_WORST_QUALITY) {
  ------------------
  |  |  110|      0|#define AVIF_QUANTIZER_WORST_QUALITY 63
  ------------------
  |  Branch (2029:9): [True: 0, False: 0]
  ------------------
 2030|      0|        encoder->data->qualityAlpha = encoder->data->quality;
 2031|  55.1k|    } else {
 2032|  55.1k|        encoder->data->qualityAlpha = avifGetQuality(encoder->qualityAlpha, encoder->minQuantizerAlpha, encoder->maxQuantizerAlpha);
 2033|  55.1k|    }
 2034|  55.1k|    if (encoder->qualityGainMap == AVIF_QUALITY_DEFAULT) {
  ------------------
  |  |  103|  55.1k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
  |  Branch (2034:9): [True: 55.1k, False: 0]
  ------------------
 2035|  55.1k|        encoder->data->qualityGainMap = encoder->data->quality; // Default to the same quality as color.
 2036|  55.1k|    } else {
 2037|      0|        encoder->data->qualityGainMap =
 2038|      0|            avifGetQuality(encoder->qualityGainMap, AVIF_QUANTIZER_BEST_QUALITY, AVIF_QUANTIZER_WORST_QUALITY);
  ------------------
  |  |  109|      0|#define AVIF_QUANTIZER_BEST_QUALITY 0
  ------------------
                          avifGetQuality(encoder->qualityGainMap, AVIF_QUANTIZER_BEST_QUALITY, AVIF_QUANTIZER_WORST_QUALITY);
  ------------------
  |  |  110|      0|#define AVIF_QUANTIZER_WORST_QUALITY 63
  ------------------
 2039|      0|    }
 2040|       |
 2041|       |    // -----------------------------------------------------------------------
 2042|       |    // Handle automatic tiling
 2043|       |
 2044|  55.1k|    encoder->data->tileRowsLog2 = AVIF_CLAMP(encoder->tileRowsLog2, 0, 6);
  ------------------
  |  |   18|  55.1k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 55.1k]
  |  |  |  Branch (18:60): [True: 0, False: 55.1k]
  |  |  ------------------
  ------------------
 2045|  55.1k|    encoder->data->tileColsLog2 = AVIF_CLAMP(encoder->tileColsLog2, 0, 6);
  ------------------
  |  |   18|  55.1k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 55.1k]
  |  |  |  Branch (18:60): [True: 0, False: 55.1k]
  |  |  ------------------
  ------------------
 2046|  55.1k|    if (encoder->autoTiling) {
  ------------------
  |  Branch (2046:9): [True: 0, False: 55.1k]
  ------------------
 2047|       |        // Use as many tiles as allowed by the minimum tile area requirement and impose a maximum
 2048|       |        // of 8 tiles.
 2049|      0|        const int threads = 8;
 2050|      0|        avifSetTileConfiguration(threads, firstCell->width, firstCell->height, &encoder->data->tileRowsLog2, &encoder->data->tileColsLog2);
 2051|      0|    }
 2052|       |
 2053|       |    // -----------------------------------------------------------------------
 2054|       |    // All encoder settings are known now. Detect changes.
 2055|       |
 2056|  55.1k|    avifEncoderChanges encoderChanges;
 2057|  55.1k|    if (!avifEncoderDetectChanges(encoder, &encoderChanges)) {
  ------------------
  |  Branch (2057:9): [True: 0, False: 55.1k]
  ------------------
 2058|      0|        return AVIF_RESULT_CANNOT_CHANGE_SETTING;
 2059|      0|    }
 2060|  55.1k|    avifEncoderBackupSettings(encoder);
 2061|       |
 2062|       |    // -----------------------------------------------------------------------
 2063|       |
 2064|  55.1k|    if (durationInTimescales == 0) {
  ------------------
  |  Branch (2064:9): [True: 0, False: 55.1k]
  ------------------
 2065|      0|        durationInTimescales = 1;
 2066|      0|    }
 2067|       |
 2068|  55.1k|    if (encoder->data->items.count == 0) {
  ------------------
  |  Branch (2068:9): [True: 13.7k, False: 41.3k]
  ------------------
 2069|       |        // Make a copy of the first image's metadata (sans pixels) for future writing/validation
 2070|  13.7k|        AVIF_CHECKRES(avifImageCopy(encoder->data->imageMetadata, firstCell, 0));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2071|  13.7k|        if (avifEncoderSizeIsSet(encoder)) {
  ------------------
  |  Branch (2071:13): [True: 0, False: 13.7k]
  ------------------
 2072|      0|            encoder->data->imageMetadata->width = encoder->width;
 2073|      0|            encoder->data->imageMetadata->height = encoder->height;
 2074|      0|        }
 2075|       |
 2076|  13.7k|        const uint32_t gridWidth = avifGridWidth(gridCols, firstCell, bottomRightCell);
 2077|  13.7k|        const uint32_t gridHeight = avifGridHeight(gridRows, firstCell, bottomRightCell);
 2078|       |
 2079|  13.7k|        if (hasGainMap) {
  ------------------
  |  Branch (2079:13): [True: 0, False: 13.7k]
  ------------------
 2080|      0|            AVIF_CHECKRES(
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2081|      0|                avifImageCopyAltImageMetadata(encoder->data->altImageMetadata, encoder->data->imageMetadata, gridWidth, gridHeight));
 2082|      0|        }
 2083|       |
 2084|       |        // Prepare all AV1 items
 2085|  13.7k|        uint32_t colorItemID;
 2086|  13.7k|        AVIF_CHECKRES(avifEncoderAddImageItems(encoder, gridCols, gridRows, gridWidth, gridHeight, AVIF_ITEM_COLOR, &colorItemID));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2087|  13.7k|        encoder->data->primaryItemID = colorItemID;
 2088|       |
 2089|  13.7k|        encoder->data->alphaPresent = (firstCell->alphaPlane != NULL);
 2090|  13.7k|        if (encoder->data->alphaPresent && (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE)) {
  ------------------
  |  Branch (2090:13): [True: 4.61k, False: 9.17k]
  |  Branch (2090:44): [True: 0, False: 4.61k]
  ------------------
 2091|       |            // If encoding a single image in which the alpha plane exists but is entirely opaque,
 2092|       |            // simply skip writing an alpha AV1 payload entirely, as it'll be interpreted as opaque
 2093|       |            // and is less bytes.
 2094|       |            //
 2095|       |            // However, if encoding an image sequence, the first frame's alpha plane being entirely
 2096|       |            // opaque could be a false positive for removing the alpha AV1 payload, as it might simply
 2097|       |            // be a fade out later in the sequence. This is why avifImageIsOpaque() is only called
 2098|       |            // when encoding a single image.
 2099|       |
 2100|      0|            encoder->data->alphaPresent = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 2101|      0|            for (uint32_t cellIndex = 0; cellIndex < cellCount; ++cellIndex) {
  ------------------
  |  Branch (2101:42): [True: 0, False: 0]
  ------------------
 2102|      0|                const avifImage * cellImage = cellImages[cellIndex];
 2103|      0|                if (!avifImageIsOpaque(cellImage)) {
  ------------------
  |  Branch (2103:21): [True: 0, False: 0]
  ------------------
 2104|      0|                    encoder->data->alphaPresent = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 2105|      0|                    break;
 2106|      0|                }
 2107|      0|            }
 2108|      0|        }
 2109|       |
 2110|  13.7k|        if (encoder->data->alphaPresent) {
  ------------------
  |  Branch (2110:13): [True: 4.61k, False: 9.17k]
  ------------------
 2111|  4.61k|            uint32_t alphaItemID;
 2112|  4.61k|            AVIF_CHECKRES(avifEncoderAddImageItems(encoder, gridCols, gridRows, gridWidth, gridHeight, AVIF_ITEM_ALPHA, &alphaItemID));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 2113|  4.61k|            avifEncoderItem * alphaItem = avifEncoderDataFindItemByID(encoder->data, alphaItemID);
 2114|  4.61k|            AVIF_ASSERT_OR_RETURN(alphaItem);
  ------------------
  |  |   64|  4.61k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  4.61k|    do {                        \
  |  |  |  |   46|  4.61k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 4.61k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  4.61k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 4.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2115|  4.61k|            alphaItem->irefType = "auxl";
 2116|  4.61k|            alphaItem->irefToID = colorItemID;
 2117|  4.61k|            if (encoder->data->imageMetadata->alphaPremultiplied) {
  ------------------
  |  Branch (2117:17): [True: 0, False: 4.61k]
  ------------------
 2118|      0|                avifEncoderItem * colorItem = avifEncoderDataFindItemByID(encoder->data, colorItemID);
 2119|      0|                AVIF_ASSERT_OR_RETURN(colorItem);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2120|      0|                colorItem->irefType = "prem";
 2121|      0|                colorItem->irefToID = alphaItemID;
 2122|      0|            }
 2123|  4.61k|        }
 2124|       |
 2125|  13.7k|        if (firstCell->gainMap && firstCell->gainMap->image) {
  ------------------
  |  Branch (2125:13): [True: 0, False: 13.7k]
  |  Branch (2125:35): [True: 0, False: 0]
  ------------------
 2126|      0|            avifEncoderItem * toneMappedItem;
 2127|      0|            AVIF_CHECKRES(avifEncoderDataCreateItem(encoder->data,
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2128|      0|                                                    "tmap",
 2129|      0|                                                    infeNameGainMap,
 2130|      0|                                                    /*infeNameSize=*/strlen(infeNameGainMap) + 1,
 2131|      0|                                                    /*cellIndex=*/0,
 2132|      0|                                                    &toneMappedItem));
 2133|      0|            AVIF_CHECKRES(avifWriteToneMappedImagePayload(&toneMappedItem->metadataPayload, firstCell->gainMap, &encoder->diag));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2134|       |            // Even though the 'tmap' item is related to the gain map, it represents a color image and its metadata is more similar to the color item.
 2135|      0|            toneMappedItem->itemCategory = AVIF_ITEM_COLOR;
 2136|      0|            uint32_t toneMappedItemID = toneMappedItem->id;
 2137|       |
 2138|      0|            AVIF_ASSERT_OR_RETURN(encoder->data->alternativeItemIDs.count == 0);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2139|      0|            uint32_t * alternativeItemID = (uint32_t *)avifArrayPush(&encoder->data->alternativeItemIDs);
 2140|      0|            AVIF_CHECKERR(alternativeItemID != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2141|      0|            *alternativeItemID = toneMappedItemID;
 2142|       |
 2143|      0|            alternativeItemID = (uint32_t *)avifArrayPush(&encoder->data->alternativeItemIDs);
 2144|      0|            AVIF_CHECKERR(alternativeItemID != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2145|      0|            *alternativeItemID = colorItemID;
 2146|       |
 2147|      0|            const uint32_t gainMapGridWidth =
 2148|      0|                avifGridWidth(gridCols, cellImages[0]->gainMap->image, cellImages[gridCols * gridRows - 1]->gainMap->image);
 2149|      0|            const uint32_t gainMapGridHeight =
 2150|      0|                avifGridHeight(gridRows, cellImages[0]->gainMap->image, cellImages[gridCols * gridRows - 1]->gainMap->image);
 2151|       |
 2152|      0|            uint32_t gainMapItemID;
 2153|      0|            AVIF_CHECKRES(
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2154|      0|                avifEncoderAddImageItems(encoder, gridCols, gridRows, gainMapGridWidth, gainMapGridHeight, AVIF_ITEM_GAIN_MAP, &gainMapItemID));
 2155|      0|            avifEncoderItem * gainMapItem = avifEncoderDataFindItemByID(encoder->data, gainMapItemID);
 2156|      0|            AVIF_ASSERT_OR_RETURN(gainMapItem);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2157|      0|            gainMapItem->hiddenImage = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 2158|       |
 2159|       |            // Set the color item and gain map item's dimgFromID value to point to the tone mapped item.
 2160|       |            // The color item shall be first, and the gain map second. avifEncoderFinish() writes the
 2161|       |            // dimg item references in item id order, so as long as colorItemID < gainMapItemID, the order
 2162|       |            // will be correct.
 2163|      0|            AVIF_ASSERT_OR_RETURN(colorItemID < gainMapItemID);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2164|      0|            avifEncoderItem * colorItem = avifEncoderDataFindItemByID(encoder->data, colorItemID);
 2165|      0|            AVIF_ASSERT_OR_RETURN(colorItem);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2166|      0|            AVIF_ASSERT_OR_RETURN(colorItem->dimgFromID == 0); // Our internal API only allows one dimg value per item.
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2167|      0|            colorItem->dimgFromID = toneMappedItemID;
 2168|      0|            gainMapItem->dimgFromID = toneMappedItemID;
 2169|      0|        }
 2170|       |
 2171|  13.7k|        if (encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_8B_8B ||
  ------------------
  |  Branch (2171:13): [True: 0, False: 13.7k]
  ------------------
 2172|  13.7k|            encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_4B ||
  ------------------
  |  Branch (2172:13): [True: 0, False: 13.7k]
  ------------------
 2173|  13.7k|            encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_8B_OVERLAP_4B) {
  ------------------
  |  Branch (2173:13): [True: 0, False: 13.7k]
  ------------------
 2174|       |            // For now, only 16-bit depth is supported.
 2175|      0|            AVIF_CHECKERR(firstCell->depth == 16, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2176|       |            // For now, gain maps are not supported in the same file as Sample Transforms ('altr' group conflict).
 2177|      0|            AVIF_CHECKERR(!firstCell->gainMap, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2178|      0|            AVIF_CHECKRES(avifEncoderCreateBitDepthExtensionItems(encoder, gridCols, gridRows, gridWidth, gridHeight, colorItemID));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2179|  13.7k|        } else {
 2180|  13.7k|            AVIF_CHECKERR(encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_NONE, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2181|  13.7k|        }
 2182|       |
 2183|       |        // -----------------------------------------------------------------------
 2184|       |        // Create metadata items (Exif, XMP)
 2185|       |
 2186|  13.7k|        if (firstCell->exif.size > 0) {
  ------------------
  |  Branch (2186:13): [True: 0, False: 13.7k]
  ------------------
 2187|      0|            const avifResult result = avifEncoderDataCreateExifItem(encoder->data, &firstCell->exif);
 2188|      0|            if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (2188:17): [True: 0, False: 0]
  ------------------
 2189|      0|                return result;
 2190|      0|            }
 2191|      0|        }
 2192|       |
 2193|  13.7k|        if (firstCell->xmp.size > 0) {
  ------------------
  |  Branch (2193:13): [True: 0, False: 13.7k]
  ------------------
 2194|      0|            const avifResult result = avifEncoderDataCreateXMPItem(encoder->data, &firstCell->xmp);
 2195|      0|            if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (2195:17): [True: 0, False: 0]
  ------------------
 2196|      0|                return result;
 2197|      0|            }
 2198|      0|        }
 2199|  41.3k|    } else {
 2200|       |        // Another frame in an image sequence, or layer in a layered image
 2201|       |
 2202|  41.3k|        if (hasGainMap) {
  ------------------
  |  Branch (2202:13): [True: 0, False: 41.3k]
  ------------------
 2203|      0|            avifDiagnosticsPrintf(&encoder->diag, "gain maps are not supported for image sequences or layered images");
 2204|      0|            return AVIF_RESULT_NOT_IMPLEMENTED;
 2205|      0|        }
 2206|       |
 2207|  41.3k|        const avifImage * imageMetadata = encoder->data->imageMetadata;
 2208|       |        // Image metadata that are copied to the configuration property and nclx boxes are not allowed to change.
 2209|       |        // If the first image in the sequence had an alpha plane (even if fully opaque), all
 2210|       |        // subsequent images must have alpha as well.
 2211|  41.3k|        if ((imageMetadata->depth != firstCell->depth) || (imageMetadata->yuvFormat != firstCell->yuvFormat) ||
  ------------------
  |  Branch (2211:13): [True: 0, False: 41.3k]
  |  Branch (2211:59): [True: 0, False: 41.3k]
  ------------------
 2212|  41.3k|            (imageMetadata->yuvRange != firstCell->yuvRange) ||
  ------------------
  |  Branch (2212:13): [True: 0, False: 41.3k]
  ------------------
 2213|  41.3k|            (imageMetadata->yuvChromaSamplePosition != firstCell->yuvChromaSamplePosition) ||
  ------------------
  |  Branch (2213:13): [True: 0, False: 41.3k]
  ------------------
 2214|  41.3k|            (imageMetadata->colorPrimaries != firstCell->colorPrimaries) ||
  ------------------
  |  Branch (2214:13): [True: 0, False: 41.3k]
  ------------------
 2215|  41.3k|            (imageMetadata->transferCharacteristics != firstCell->transferCharacteristics) ||
  ------------------
  |  Branch (2215:13): [True: 0, False: 41.3k]
  ------------------
 2216|  41.3k|            (imageMetadata->matrixCoefficients != firstCell->matrixCoefficients) ||
  ------------------
  |  Branch (2216:13): [True: 0, False: 41.3k]
  ------------------
 2217|  41.3k|            (imageMetadata->alphaPremultiplied != firstCell->alphaPremultiplied) ||
  ------------------
  |  Branch (2217:13): [True: 0, False: 41.3k]
  ------------------
 2218|  41.3k|            (encoder->data->alphaPresent && !firstCell->alphaPlane)) {
  ------------------
  |  Branch (2218:14): [True: 13.8k, False: 27.5k]
  |  Branch (2218:45): [True: 0, False: 13.8k]
  ------------------
 2219|      0|            return AVIF_RESULT_INCOMPATIBLE_IMAGE;
 2220|      0|        }
 2221|  41.3k|    }
 2222|       |
 2223|  55.1k|    if (encoder->data->frames.count == 1) {
  ------------------
  |  Branch (2223:9): [True: 13.7k, False: 41.3k]
  ------------------
 2224|       |        // We will be writing an image sequence. When writing the AV1SampleEntry (derived from
 2225|       |        // VisualSampleEntry) in the stsd box, we need to cast imageMetadata->width and
 2226|       |        // imageMetadata->height to uint16_t:
 2227|       |        //     class VisualSampleEntry(codingname) extends SampleEntry (codingname){
 2228|       |        //        ...
 2229|       |        //        unsigned int(16) width;
 2230|       |        //        unsigned int(16) height;
 2231|       |        //        ...
 2232|       |        //     }
 2233|       |        // Check whether it is safe to cast width and height to uint16_t. The maximum width and
 2234|       |        // height of an AV1 frame are 65536, which just exceeds uint16_t.
 2235|  13.7k|        AVIF_ASSERT_OR_RETURN(encoder->data->items.count > 0);
  ------------------
  |  |   64|  13.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  13.7k|    do {                        \
  |  |  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  13.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2236|  13.7k|        const avifImage * imageMetadata = encoder->data->imageMetadata;
 2237|  13.7k|        AVIF_CHECKERR(imageMetadata->width <= 65535 && imageMetadata->height <= 65535, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|  13.7k|    do {                        \
  |  |   46|  27.5k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 13.7k, False: 0]
  |  |  |  Branch (46:15): [True: 13.7k, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2238|  13.7k|    }
 2239|       |
 2240|       |    // -----------------------------------------------------------------------
 2241|       |    // Encode AV1 OBUs
 2242|       |
 2243|   128k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (2243:34): [True: 73.6k, False: 55.1k]
  ------------------
 2244|  73.6k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 2245|  73.6k|        if (item->codec) {
  ------------------
  |  Branch (2245:13): [True: 73.6k, False: 0]
  ------------------
 2246|  73.6k|            const avifImage * cellImage = cellImages[item->cellIndex];
 2247|  73.6k|            avifImage * cellImagePlaceholder = NULL; // May be used as a temporary, modified cellImage. Left as NULL otherwise.
 2248|  73.6k|            const avifImage * firstCellImage = firstCell;
 2249|       |
 2250|  73.6k|            if (item->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (2250:17): [True: 0, False: 73.6k]
  ------------------
 2251|      0|                AVIF_ASSERT_OR_RETURN(cellImage->gainMap && cellImage->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2252|      0|                cellImage = cellImage->gainMap->image;
 2253|      0|                AVIF_ASSERT_OR_RETURN(firstCell->gainMap && firstCell->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|      0|                firstCellImage = firstCell->gainMap->image;
 2255|      0|            }
 2256|       |
 2257|  73.6k|            if ((cellImage->width != firstCellImage->width) || (cellImage->height != firstCellImage->height)) {
  ------------------
  |  Branch (2257:17): [True: 0, False: 73.6k]
  |  Branch (2257:64): [True: 0, False: 73.6k]
  ------------------
 2258|       |                // Pad the right-most and/or bottom-most tiles so that all tiles share the same dimensions.
 2259|      0|                cellImagePlaceholder = avifImageCreateEmpty();
 2260|      0|                AVIF_CHECKERR(cellImagePlaceholder, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2261|      0|                const avifResult result =
 2262|      0|                    avifImageCopyAndPad(cellImagePlaceholder, cellImage, firstCellImage->width, firstCellImage->height);
 2263|      0|                if (result != AVIF_RESULT_OK) {
  ------------------
  |  Branch (2263:21): [True: 0, False: 0]
  ------------------
 2264|      0|                    avifImageDestroy(cellImagePlaceholder);
 2265|      0|                    return result;
 2266|      0|                }
 2267|      0|                cellImage = cellImagePlaceholder;
 2268|      0|            }
 2269|       |
 2270|  73.6k|            const avifBool isAlpha = avifIsAlpha(item->itemCategory);
 2271|  73.6k|            int quality = isAlpha                                      ? encoder->data->qualityAlpha
  ------------------
  |  Branch (2271:27): [True: 18.4k, False: 55.1k]
  ------------------
 2272|  73.6k|                          : (item->itemCategory == AVIF_ITEM_GAIN_MAP) ? encoder->data->qualityGainMap
  ------------------
  |  Branch (2272:29): [True: 0, False: 55.1k]
  ------------------
 2273|  55.1k|                                                                       : encoder->data->quality;
 2274|       |
 2275|       |            // Remember original quantizer values in case they change, to reset them afterwards.
 2276|  73.6k|            int * encoderMinQuantizer = isAlpha ? &encoder->minQuantizerAlpha : &encoder->minQuantizer;
  ------------------
  |  Branch (2276:41): [True: 18.4k, False: 55.1k]
  ------------------
 2277|  73.6k|            int * encoderMaxQuantizer = isAlpha ? &encoder->maxQuantizerAlpha : &encoder->maxQuantizer;
  ------------------
  |  Branch (2277:41): [True: 18.4k, False: 55.1k]
  ------------------
 2278|  73.6k|            const int originalMinQuantizer = *encoderMinQuantizer;
 2279|  73.6k|            const int originalMaxQuantizer = *encoderMaxQuantizer;
 2280|       |
 2281|  73.6k|            if (encoder->sampleTransformRecipe != AVIF_SAMPLE_TRANSFORM_NONE) {
  ------------------
  |  Branch (2281:17): [True: 0, False: 73.6k]
  ------------------
 2282|      0|                if ((encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_8B_8B ||
  ------------------
  |  Branch (2282:22): [True: 0, False: 0]
  ------------------
 2283|      0|                     encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_4B) &&
  ------------------
  |  Branch (2283:22): [True: 0, False: 0]
  ------------------
 2284|      0|                    (item->itemCategory == AVIF_ITEM_COLOR || item->itemCategory == AVIF_ITEM_ALPHA)) {
  ------------------
  |  Branch (2284:22): [True: 0, False: 0]
  |  Branch (2284:63): [True: 0, False: 0]
  ------------------
 2285|       |                    // Encoding the least significant bits of a sample does not make any sense if the
 2286|       |                    // other bits are lossily compressed. Encode the most significant bits losslessly.
 2287|      0|                    quality = AVIF_QUALITY_LOSSLESS;
  ------------------
  |  |  106|      0|#define AVIF_QUALITY_LOSSLESS 100
  ------------------
 2288|      0|                    *encoderMinQuantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 2289|      0|                    *encoderMaxQuantizer = AVIF_QUANTIZER_LOSSLESS;
  ------------------
  |  |  108|      0|#define AVIF_QUANTIZER_LOSSLESS 0
  ------------------
 2290|      0|                    if (!avifEncoderDetectChanges(encoder, &encoderChanges)) {
  ------------------
  |  Branch (2290:25): [True: 0, False: 0]
  ------------------
 2291|      0|                        assert(AVIF_FALSE);
 2292|      0|                    }
 2293|      0|                }
 2294|       |
 2295|       |                // Replace cellImage by the first or second input to the AVIF_ITEM_SAMPLE_TRANSFORM derived image item.
 2296|      0|                const avifBool itemWillBeEncodedLosslessly = (quality == AVIF_QUALITY_LOSSLESS);
  ------------------
  |  |  106|      0|#define AVIF_QUALITY_LOSSLESS 100
  ------------------
 2297|      0|                avifImage * sampleTransformedImage = NULL;
 2298|      0|                if (cellImagePlaceholder) {
  ------------------
  |  Branch (2298:21): [True: 0, False: 0]
  ------------------
 2299|      0|                    avifImageDestroy(cellImagePlaceholder); // Replaced by sampleTransformedImage.
 2300|      0|                    cellImagePlaceholder = NULL;
 2301|      0|                }
 2302|      0|                AVIF_CHECKRES(
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2303|      0|                    avifEncoderCreateBitDepthExtensionImage(encoder, item, itemWillBeEncodedLosslessly, cellImage, &sampleTransformedImage));
 2304|      0|                assert(cellImagePlaceholder == NULL);
 2305|      0|                cellImagePlaceholder = sampleTransformedImage; // Transfer ownership.
 2306|      0|                cellImage = cellImagePlaceholder;
 2307|      0|            }
 2308|       |
 2309|       |            // If alpha channel is present, set disableLaggedOutput to AVIF_TRUE. If the encoder supports it, this enables
 2310|       |            // avifEncoderDataShouldForceKeyframeForAlpha to force a keyframe in the alpha channel whenever a keyframe has been
 2311|       |            // encoded in the color channel for animated images.
 2312|  73.6k|            avifResult encodeResult = item->codec->encodeImage(item->codec,
 2313|  73.6k|                                                               encoder,
 2314|  73.6k|                                                               cellImage,
 2315|  73.6k|                                                               isAlpha,
 2316|  73.6k|                                                               encoder->data->tileRowsLog2,
 2317|  73.6k|                                                               encoder->data->tileColsLog2,
 2318|  73.6k|                                                               quality,
 2319|  73.6k|                                                               encoderChanges,
 2320|  73.6k|                                                               /*disableLaggedOutput=*/encoder->data->alphaPresent,
 2321|  73.6k|                                                               addImageFlags,
 2322|  73.6k|                                                               item->encodeOutput);
 2323|       |            // Revert quality settings if they changed.
 2324|  73.6k|            if (*encoderMinQuantizer != originalMinQuantizer || *encoderMaxQuantizer != originalMaxQuantizer) {
  ------------------
  |  Branch (2324:17): [True: 0, False: 73.6k]
  |  Branch (2324:65): [True: 0, False: 73.6k]
  ------------------
 2325|      0|                avifEncoderBackupSettings(encoder); // Remember last encoding settings for next avifEncoderDetectChanges().
 2326|      0|                *encoderMinQuantizer = originalMinQuantizer;
 2327|      0|                *encoderMaxQuantizer = originalMaxQuantizer;
 2328|      0|            }
 2329|  73.6k|            if (cellImagePlaceholder) {
  ------------------
  |  Branch (2329:17): [True: 0, False: 73.6k]
  ------------------
 2330|      0|                avifImageDestroy(cellImagePlaceholder);
 2331|      0|            }
 2332|  73.6k|            if (encodeResult == AVIF_RESULT_UNKNOWN_ERROR) {
  ------------------
  |  Branch (2332:17): [True: 0, False: 73.6k]
  ------------------
 2333|      0|                encodeResult = avifGetErrorForItemCategory(item->itemCategory);
 2334|      0|            }
 2335|  73.6k|            AVIF_CHECKRES(encodeResult);
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2336|  73.6k|            if (itemIndex == 0 && avifEncoderDataShouldForceKeyframeForAlpha(encoder->data, item, addImageFlags)) {
  ------------------
  |  Branch (2336:17): [True: 55.1k, False: 18.4k]
  |  Branch (2336:35): [True: 0, False: 55.1k]
  ------------------
 2337|      0|                addImageFlags |= AVIF_ADD_IMAGE_FLAG_FORCE_KEYFRAME;
 2338|      0|            }
 2339|  73.6k|        }
 2340|  73.6k|    }
 2341|       |
 2342|  55.1k|    avifEncoderFrame * frame = (avifEncoderFrame *)avifArrayPush(&encoder->data->frames);
 2343|  55.1k|    AVIF_CHECKERR(frame != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  55.1k|    do {                        \
  |  |   46|  55.1k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 55.1k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  55.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
 2344|  55.1k|    frame->durationInTimescales = durationInTimescales;
 2345|  55.1k|    avifCodecSpecificOptionsClear(encoder->csOptions);
 2346|  55.1k|    return AVIF_RESULT_OK;
 2347|  55.1k|}
write.c:avifEncoderValidateSize:
 1635|  55.1k|{
 1636|  55.1k|    if (!avifEncoderSizeIsSet(encoder)) {
  ------------------
  |  Branch (1636:9): [True: 55.1k, False: 0]
  ------------------
 1637|       |        // First image, encoder->data->imageMetadata not initialized yet, nothing to check against.
 1638|  55.1k|        if (encoder->data->items.count == 0) {
  ------------------
  |  Branch (1638:13): [True: 13.7k, False: 41.3k]
  ------------------
 1639|  13.7k|            return AVIF_RESULT_OK;
 1640|  13.7k|        }
 1641|       |
 1642|       |        // For animation, the encoder verifies the input size never changes, so this check is redundant.
 1643|       |        // But for a layered image, the encoder relaxes the check to allow layers to have different sizes.
 1644|       |        // We support 2 ways to produce different sized layers:
 1645|       |        // 1. Send full sized inputs and let the encoder scale them via scalingMode
 1646|       |        // 2. Declare the full size via width/height and send pre-scaled inputs
 1647|       |        // To avoid confusion, we require the user to consistently use only one of the 2 ways,
 1648|       |        // and this check blocks the attempt to start with method 1 and try to switch to method 2.
 1649|  41.3k|        if ((firstCell->width != encoder->data->imageMetadata->width) || (firstCell->height != encoder->data->imageMetadata->height)) {
  ------------------
  |  Branch (1649:13): [True: 0, False: 41.3k]
  |  Branch (1649:74): [True: 0, False: 41.3k]
  ------------------
 1650|      0|            avifDiagnosticsPrintf(&encoder->diag, "All images must have the same width/height unless avifEncoder.width/height is set");
 1651|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1652|      0|        }
 1653|       |
 1654|       |        // According to section 2.2.2 of AV1 Image File Format specification v1.2.0:
 1655|       |        //   [...] the values of image_width and image_height shall respectively equal the values of
 1656|       |        //   UpscaledWidth and FrameHeight as defined in [AV1] but for a specific frame in the item
 1657|       |        //   payload. [...]
 1658|       |        //   In the absence of a 'lsel' property associated with the item, or if it is present and its
 1659|       |        //   layer_id value is set to 0xFFFF:
 1660|       |        //     If no OperatingPointSelectorProperty is associated with the item, the 'ispe' property
 1661|       |        //     shall document the dimensions of the last frame decoded when processing the operating
 1662|       |        //     point whose index is 0.
 1663|       |        //   NOTE: The dimensions of possible intermediate output images might not match the ones given
 1664|       |        //   in the 'ispe' property. If renderers display these intermediate images, they are expected
 1665|       |        //   to scale the output image to match the 'ispe' property.
 1666|       |        // See https://aomediacodec.github.io/av1-avif/v1.2.0.html#image-spatial-extents-property.
 1667|       |        //
 1668|       |        // Therefore the last layer must not have any scaling.
 1669|  41.3k|        if ((encoder->data->frames.count == encoder->extraLayerCount) && !avifScalingModeIsNoScaling(&encoder->scalingMode)) {
  ------------------
  |  Branch (1669:13): [True: 13.7k, False: 27.5k]
  |  Branch (1669:74): [True: 0, False: 13.7k]
  ------------------
 1670|      0|            avifDiagnosticsPrintf(&encoder->diag,
 1671|      0|                                  "The last layer must not be scaled, but got scalingMode=(%d/%d, %d/%d)",
 1672|      0|                                  encoder->scalingMode.horizontal.n,
 1673|      0|                                  encoder->scalingMode.horizontal.d,
 1674|      0|                                  encoder->scalingMode.vertical.n,
 1675|      0|                                  encoder->scalingMode.vertical.d);
 1676|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1677|      0|        }
 1678|  41.3k|        return AVIF_RESULT_OK;
 1679|  41.3k|    }
 1680|       |
 1681|      0|    if ((encoder->width == 0) || (encoder->height == 0)) {
  ------------------
  |  Branch (1681:9): [True: 0, False: 0]
  |  Branch (1681:34): [True: 0, False: 0]
  ------------------
 1682|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width and avifEncoder.height must either both be zero or both be nonzero");
 1683|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1684|      0|    }
 1685|       |
 1686|      0|    if ((gridCols > 1) || (gridRows > 1)) {
  ------------------
  |  Branch (1686:9): [True: 0, False: 0]
  |  Branch (1686:27): [True: 0, False: 0]
  ------------------
 1687|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width/height cannot be set with grid images");
 1688|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 1689|      0|    }
 1690|       |
 1691|       |    // This blocks the attempt to use both ways to produce different sized layers together,
 1692|       |    // or start with method 2 and try to switch to method 1,
 1693|       |    // so the result is INVALID_ARGUMENT. See the comment above for the detail.
 1694|      0|    if (!avifScalingModeIsNoScaling(&encoder->scalingMode)) {
  ------------------
  |  Branch (1694:9): [True: 0, False: 0]
  ------------------
 1695|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width/height cannot be set together with encoder->scalingMode");
 1696|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1697|      0|    }
 1698|       |
 1699|      0|    if (encoder->sampleTransformRecipe != AVIF_SAMPLE_TRANSFORM_NONE) {
  ------------------
  |  Branch (1699:9): [True: 0, False: 0]
  ------------------
 1700|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width/height cannot be set with sample transforms");
 1701|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 1702|      0|    }
 1703|       |
 1704|      0|    if (firstCell->gainMap && firstCell->gainMap->image) {
  ------------------
  |  Branch (1704:9): [True: 0, False: 0]
  |  Branch (1704:31): [True: 0, False: 0]
  ------------------
 1705|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width/height cannot be set with gain maps");
 1706|      0|        return AVIF_RESULT_NOT_IMPLEMENTED;
 1707|      0|    }
 1708|       |
 1709|       |    // These 3 checks below are based on section 2.2.2 of AV1 Image File Format specification v1.2.0.
 1710|       |    // See the comment above for the detail.
 1711|       |    // Only a layered image can have frames of different sizes, so reject otherwise.
 1712|      0|    if (encoder->extraLayerCount == 0) {
  ------------------
  |  Branch (1712:9): [True: 0, False: 0]
  ------------------
 1713|      0|        avifDiagnosticsPrintf(&encoder->diag, "avifEncoder.width/height can only be set for layered images (extraLayerCount > 0)");
 1714|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1715|      0|    }
 1716|       |
 1717|       |    // The spec allows arbitrary sizes. We tighten the rule to "earlier layers shall be smaller" due to encoder restrictions.
 1718|      0|    if ((encoder->width < firstCell->width) || (encoder->height < firstCell->height)) {
  ------------------
  |  Branch (1718:9): [True: 0, False: 0]
  |  Branch (1718:48): [True: 0, False: 0]
  ------------------
 1719|      0|        avifDiagnosticsPrintf(&encoder->diag,
 1720|      0|                              "avifEncoder.width/height %ux%u must be at least the coded image size %ux%u",
 1721|      0|                              encoder->width,
 1722|      0|                              encoder->height,
 1723|      0|                              firstCell->width,
 1724|      0|                              firstCell->height);
 1725|      0|        return AVIF_RESULT_INCOMPATIBLE_IMAGE;
 1726|      0|    }
 1727|       |
 1728|       |    // The declared width/height must exactly match the coded size of the last layer.
 1729|      0|    if ((encoder->data->frames.count == encoder->extraLayerCount) &&
  ------------------
  |  Branch (1729:9): [True: 0, False: 0]
  ------------------
 1730|      0|        ((encoder->width != firstCell->width) || (encoder->height != firstCell->height))) {
  ------------------
  |  Branch (1730:10): [True: 0, False: 0]
  |  Branch (1730:50): [True: 0, False: 0]
  ------------------
 1731|      0|        avifDiagnosticsPrintf(&encoder->diag,
 1732|      0|                              "avifEncoder.width/height %ux%u must exactly match the coded size %ux%u of the last layer",
 1733|      0|                              encoder->width,
 1734|      0|                              encoder->height,
 1735|      0|                              firstCell->width,
 1736|      0|                              firstCell->height);
 1737|      0|        return AVIF_RESULT_INCOMPATIBLE_IMAGE;
 1738|      0|    }
 1739|       |
 1740|      0|    if (firstCell->transformFlags & AVIF_TRANSFORM_CLAP) {
  ------------------
  |  Branch (1740:9): [True: 0, False: 0]
  ------------------
 1741|      0|        avifCropRect cropRect;
 1742|      0|        if (!avifCropRectFromCleanApertureBox(&cropRect, &firstCell->clap, encoder->width, encoder->height, &encoder->diag)) {
  ------------------
  |  Branch (1742:13): [True: 0, False: 0]
  ------------------
 1743|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1744|      0|        }
 1745|      0|    }
 1746|       |
 1747|      0|    if ((encoder->data->items.count > 0) && (encoder->extraLayerCount > 0) &&
  ------------------
  |  Branch (1747:9): [True: 0, False: 0]
  |  Branch (1747:45): [True: 0, False: 0]
  ------------------
 1748|      0|        !avifImageHasEquivalentTransformProperties(firstCell, encoder->data->imageMetadata)) {
  ------------------
  |  Branch (1748:9): [True: 0, False: 0]
  ------------------
 1749|      0|        avifDiagnosticsPrintf(&encoder->diag,
 1750|      0|                              "When avifEncoder.width/height is set, 'pasp', 'clap', 'irot' and 'imir' must match across layers");
 1751|      0|        return AVIF_RESULT_INCOMPATIBLE_IMAGE;
 1752|      0|    }
 1753|       |
 1754|      0|    return AVIF_RESULT_OK;
 1755|      0|}
write.c:avifScalingModeIsNoScaling:
  486|  13.7k|{
  487|  13.7k|    return (scalingMode->horizontal.n == scalingMode->horizontal.d) && (scalingMode->vertical.n == scalingMode->vertical.d);
  ------------------
  |  Branch (487:12): [True: 13.7k, False: 0]
  |  Branch (487:72): [True: 13.7k, False: 0]
  ------------------
  488|  13.7k|}
write.c:avifValidateGrid:
 1813|  55.1k|{
 1814|  55.1k|    const uint32_t cellCount = gridCols * gridRows;
 1815|  55.1k|    const avifImage * firstCell = cellImages[0];
 1816|  55.1k|    const avifImage * bottomRightCell = cellImages[cellCount - 1];
 1817|  55.1k|    if (validateGainMap) {
  ------------------
  |  Branch (1817:9): [True: 0, False: 55.1k]
  ------------------
 1818|      0|        AVIF_ASSERT_OR_RETURN(firstCell->gainMap && firstCell->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1819|      0|        firstCell = firstCell->gainMap->image;
 1820|      0|        AVIF_ASSERT_OR_RETURN(bottomRightCell->gainMap && bottomRightCell->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1821|      0|        bottomRightCell = bottomRightCell->gainMap->image;
 1822|      0|    }
 1823|  55.1k|    const uint32_t tileWidth = firstCell->width;
 1824|  55.1k|    const uint32_t tileHeight = firstCell->height;
 1825|  55.1k|    if ((tileWidth > 65536) || (tileHeight > 65536)) {
  ------------------
  |  Branch (1825:9): [True: 0, False: 55.1k]
  |  Branch (1825:32): [True: 0, False: 55.1k]
  ------------------
 1826|      0|        avifDiagnosticsPrintf(diag,
 1827|      0|                              "the first %s cell has invalid dimensions for AV1 and AV2: %ux%u",
 1828|      0|                              validateGainMap ? "gain map" : "image",
  ------------------
  |  Branch (1828:31): [True: 0, False: 0]
  ------------------
 1829|      0|                              tileWidth,
 1830|      0|                              tileHeight);
 1831|      0|        return AVIF_RESULT_INVALID_ARGUMENT;
 1832|      0|    }
 1833|   110k|    for (uint32_t cellIndex = 0; cellIndex < cellCount; ++cellIndex) {
  ------------------
  |  Branch (1833:34): [True: 55.1k, False: 55.1k]
  ------------------
 1834|  55.1k|        const avifImage * cellImage = cellImages[cellIndex];
 1835|  55.1k|        if (validateGainMap) {
  ------------------
  |  Branch (1835:13): [True: 0, False: 55.1k]
  ------------------
 1836|      0|            AVIF_ASSERT_OR_RETURN(cellImage->gainMap && cellImage->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1837|      0|            cellImage = cellImage->gainMap->image;
 1838|      0|        }
 1839|  55.1k|        const uint32_t expectedCellWidth = ((cellIndex + 1) % gridCols) ? tileWidth : bottomRightCell->width;
  ------------------
  |  Branch (1839:44): [True: 0, False: 55.1k]
  ------------------
 1840|  55.1k|        const uint32_t expectedCellHeight = (cellIndex < (cellCount - gridCols)) ? tileHeight : bottomRightCell->height;
  ------------------
  |  Branch (1840:45): [True: 0, False: 55.1k]
  ------------------
 1841|  55.1k|        if ((cellImage->width != expectedCellWidth) || (cellImage->height != expectedCellHeight)) {
  ------------------
  |  Branch (1841:13): [True: 0, False: 55.1k]
  |  Branch (1841:56): [True: 0, False: 55.1k]
  ------------------
 1842|      0|            avifDiagnosticsPrintf(diag,
 1843|      0|                                  "%s cell %u has invalid dimensions: expected %ux%u found %ux%u",
 1844|      0|                                  validateGainMap ? "gain map" : "image",
  ------------------
  |  Branch (1844:35): [True: 0, False: 0]
  ------------------
 1845|      0|                                  cellIndex,
 1846|      0|                                  expectedCellWidth,
 1847|      0|                                  expectedCellHeight,
 1848|      0|                                  cellImage->width,
 1849|      0|                                  cellImage->height);
 1850|      0|            return AVIF_RESULT_INVALID_IMAGE_GRID;
 1851|      0|        }
 1852|       |
 1853|       |        // MIAF (ISO 23000-22:2019), Section 7.3.11.4.1:
 1854|       |        //   All input images of a grid image item shall use the same coding format, chroma sampling format, and the
 1855|       |        //   same decoder configuration (see 7.3.6.2).
 1856|  55.1k|        if ((cellImage->depth != firstCell->depth) || (cellImage->yuvFormat != firstCell->yuvFormat) ||
  ------------------
  |  Branch (1856:13): [True: 0, False: 55.1k]
  |  Branch (1856:55): [True: 0, False: 55.1k]
  ------------------
 1857|  55.1k|            (cellImage->yuvRange != firstCell->yuvRange) || (cellImage->colorPrimaries != firstCell->colorPrimaries) ||
  ------------------
  |  Branch (1857:13): [True: 0, False: 55.1k]
  |  Branch (1857:61): [True: 0, False: 55.1k]
  ------------------
 1858|  55.1k|            (cellImage->transferCharacteristics != firstCell->transferCharacteristics) ||
  ------------------
  |  Branch (1858:13): [True: 0, False: 55.1k]
  ------------------
 1859|  55.1k|            (cellImage->matrixCoefficients != firstCell->matrixCoefficients) || (!!cellImage->alphaPlane != !!firstCell->alphaPlane) ||
  ------------------
  |  Branch (1859:13): [True: 0, False: 55.1k]
  |  Branch (1859:81): [True: 0, False: 55.1k]
  ------------------
 1860|  55.1k|            (cellImage->alphaPremultiplied != firstCell->alphaPremultiplied)) {
  ------------------
  |  Branch (1860:13): [True: 0, False: 55.1k]
  ------------------
 1861|      0|            avifDiagnosticsPrintf(diag,
 1862|      0|                                  "all grid cells should have the same value for: depth, yuvFormat, yuvRange, colorPrimaries, "
 1863|      0|                                  "transferCharacteristics, matrixCoefficients, alphaPlane presence, alphaPremultiplied");
 1864|      0|            return AVIF_RESULT_INVALID_IMAGE_GRID;
 1865|      0|        }
 1866|       |
 1867|       |        // AV1 (Version 1.0.0 with Errata 1), Section 6.4.2. Color config semantics
 1868|       |        //   If matrix_coefficients is equal to MC_IDENTITY, it is a requirement of bitstream conformance that
 1869|       |        //   subsampling_x is equal to 0 and subsampling_y is equal to 0.
 1870|       |        // Although matrix_coefficients in the Sequence Header OBU is set to Undefined (2), the requirement
 1871|       |        // is still enforced here between what is written in the ColourInformationProperty of colour_type 'nclx'
 1872|       |        // and the subsampling information in the Sequence Header OBU.
 1873|  55.1k|        if (cellImage->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_IDENTITY && cellImage->yuvFormat != AVIF_PIXEL_FORMAT_YUV444) {
  ------------------
  |  Branch (1873:13): [True: 0, False: 55.1k]
  |  Branch (1873:83): [True: 0, False: 0]
  ------------------
 1874|      0|            avifDiagnosticsPrintf(diag, "subsampling must be 0 (4:4:4) with identity matrix coefficients");
 1875|      0|            return AVIF_RESULT_INVALID_ARGUMENT;
 1876|      0|        }
 1877|       |
 1878|  55.1k|        if (!cellImage->yuvPlanes[AVIF_CHAN_Y]) {
  ------------------
  |  Branch (1878:13): [True: 0, False: 55.1k]
  ------------------
 1879|      0|            return AVIF_RESULT_NO_CONTENT;
 1880|      0|        }
 1881|  55.1k|    }
 1882|       |
 1883|  55.1k|    if ((bottomRightCell->width > tileWidth) || (bottomRightCell->height > tileHeight)) {
  ------------------
  |  Branch (1883:9): [True: 0, False: 55.1k]
  |  Branch (1883:49): [True: 0, False: 55.1k]
  ------------------
 1884|      0|        avifDiagnosticsPrintf(diag,
 1885|      0|                              "the last %s cell can be smaller but not larger than the other cells which are %ux%u, found %ux%u",
 1886|      0|                              validateGainMap ? "gain map" : "image",
  ------------------
  |  Branch (1886:31): [True: 0, False: 0]
  ------------------
 1887|      0|                              tileWidth,
 1888|      0|                              tileHeight,
 1889|      0|                              bottomRightCell->width,
 1890|      0|                              bottomRightCell->height);
 1891|      0|        return AVIF_RESULT_INVALID_IMAGE_GRID;
 1892|      0|    }
 1893|  55.1k|    const uint32_t gridWidth = avifGridWidth(gridCols, firstCell, bottomRightCell);
 1894|  55.1k|    const uint32_t gridHeight = avifGridHeight(gridRows, firstCell, bottomRightCell);
 1895|  55.1k|    if ((cellCount > 1) && !avifAreGridDimensionsValid(firstCell->yuvFormat, gridWidth, gridHeight, tileWidth, tileHeight, diag)) {
  ------------------
  |  Branch (1895:9): [True: 0, False: 55.1k]
  |  Branch (1895:28): [True: 0, False: 0]
  ------------------
 1896|      0|        return AVIF_RESULT_INVALID_IMAGE_GRID;
 1897|      0|    }
 1898|       |
 1899|  55.1k|    return AVIF_RESULT_OK;
 1900|  55.1k|}
write.c:avifGetQuality:
 1286|   110k|{
 1287|   110k|    int quantizer;
 1288|       |
 1289|   110k|    if (quality == AVIF_QUALITY_DEFAULT) {
  ------------------
  |  |  103|   110k|#define AVIF_QUALITY_DEFAULT -1
  ------------------
  |  Branch (1289:9): [True: 0, False: 110k]
  ------------------
 1290|       |        // In older libavif releases, avifEncoder didn't have the quality and qualityAlpha fields.
 1291|       |        // Supply a default value for quality.
 1292|      0|        quantizer = (minQuantizer + maxQuantizer) / 2;
 1293|      0|        quantizer = AVIF_CLAMP(quantizer, 0, 63);
  ------------------
  |  |   18|      0|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 0]
  |  |  |  Branch (18:60): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1294|      0|        quality = ((63 - quantizer) * 100 + 31) / 63;
 1295|   110k|    } else {
 1296|   110k|        quality = AVIF_CLAMP(quality, 0, 100);
  ------------------
  |  |   18|   110k|#define AVIF_CLAMP(x, low, high) (((x) < (low)) ? (low) : (((high) < (x)) ? (high) : (x)))
  |  |  ------------------
  |  |  |  Branch (18:35): [True: 0, False: 110k]
  |  |  |  Branch (18:60): [True: 0, False: 110k]
  |  |  ------------------
  ------------------
 1297|   110k|    }
 1298|       |
 1299|   110k|    return quality;
 1300|   110k|}
write.c:avifEncoderDetectChanges:
  606|  55.1k|{
  607|  55.1k|    const avifEncoder * lastEncoder = &encoder->data->lastEncoder;
  608|  55.1k|    *encoderChanges = 0;
  609|       |
  610|  55.1k|    if (!lastEncoder->data) {
  ------------------
  |  Branch (610:9): [True: 13.7k, False: 41.3k]
  ------------------
  611|       |        // lastEncoder is not initialized.
  612|  13.7k|        return AVIF_TRUE;
  ------------------
  |  |   88|  13.7k|#define AVIF_TRUE 1
  ------------------
  613|  13.7k|    }
  614|       |
  615|  41.3k|    if ((lastEncoder->codecChoice != encoder->codecChoice) || (lastEncoder->maxThreads != encoder->maxThreads) ||
  ------------------
  |  Branch (615:9): [True: 0, False: 41.3k]
  |  Branch (615:63): [True: 0, False: 41.3k]
  ------------------
  616|  41.3k|        (lastEncoder->speed != encoder->speed) || (lastEncoder->keyframeInterval != encoder->keyframeInterval) ||
  ------------------
  |  Branch (616:9): [True: 0, False: 41.3k]
  |  Branch (616:51): [True: 0, False: 41.3k]
  ------------------
  617|  41.3k|        (lastEncoder->timescale != encoder->timescale) || (lastEncoder->repetitionCount != encoder->repetitionCount) ||
  ------------------
  |  Branch (617:9): [True: 0, False: 41.3k]
  |  Branch (617:59): [True: 0, False: 41.3k]
  ------------------
  618|  41.3k|        (lastEncoder->extraLayerCount != encoder->extraLayerCount) || (lastEncoder->width != encoder->width) ||
  ------------------
  |  Branch (618:9): [True: 0, False: 41.3k]
  |  Branch (618:71): [True: 0, False: 41.3k]
  ------------------
  619|  41.3k|        (lastEncoder->height != encoder->height)) {
  ------------------
  |  Branch (619:9): [True: 0, False: 41.3k]
  ------------------
  620|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  621|      0|    }
  622|       |
  623|  41.3k|    if (encoder->data->lastQuality != encoder->data->quality) {
  ------------------
  |  Branch (623:9): [True: 0, False: 41.3k]
  ------------------
  624|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_QUALITY;
  625|      0|    }
  626|  41.3k|    if (encoder->data->lastQualityAlpha != encoder->data->qualityAlpha) {
  ------------------
  |  Branch (626:9): [True: 0, False: 41.3k]
  ------------------
  627|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_QUALITY_ALPHA;
  628|      0|    }
  629|  41.3k|    if (lastEncoder->minQuantizer != encoder->minQuantizer) {
  ------------------
  |  Branch (629:9): [True: 0, False: 41.3k]
  ------------------
  630|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_MIN_QUANTIZER;
  631|      0|    }
  632|  41.3k|    if (lastEncoder->maxQuantizer != encoder->maxQuantizer) {
  ------------------
  |  Branch (632:9): [True: 0, False: 41.3k]
  ------------------
  633|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_MAX_QUANTIZER;
  634|      0|    }
  635|  41.3k|    if (lastEncoder->minQuantizerAlpha != encoder->minQuantizerAlpha) {
  ------------------
  |  Branch (635:9): [True: 0, False: 41.3k]
  ------------------
  636|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_MIN_QUANTIZER_ALPHA;
  637|      0|    }
  638|  41.3k|    if (lastEncoder->maxQuantizerAlpha != encoder->maxQuantizerAlpha) {
  ------------------
  |  Branch (638:9): [True: 0, False: 41.3k]
  ------------------
  639|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_MAX_QUANTIZER_ALPHA;
  640|      0|    }
  641|  41.3k|    if (encoder->data->lastTileRowsLog2 != encoder->data->tileRowsLog2) {
  ------------------
  |  Branch (641:9): [True: 0, False: 41.3k]
  ------------------
  642|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_TILE_ROWS_LOG2;
  643|      0|    }
  644|  41.3k|    if (encoder->data->lastTileColsLog2 != encoder->data->tileColsLog2) {
  ------------------
  |  Branch (644:9): [True: 0, False: 41.3k]
  ------------------
  645|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_TILE_COLS_LOG2;
  646|      0|    }
  647|  41.3k|    if (memcmp(&lastEncoder->scalingMode, &encoder->scalingMode, sizeof(avifScalingMode)) != 0) {
  ------------------
  |  Branch (647:9): [True: 34.2k, False: 7.16k]
  ------------------
  648|  34.2k|        *encoderChanges |= AVIF_ENCODER_CHANGE_SCALING_MODE;
  649|  34.2k|    }
  650|  41.3k|    if (encoder->csOptions->count > 0) {
  ------------------
  |  Branch (650:9): [True: 0, False: 41.3k]
  ------------------
  651|      0|        *encoderChanges |= AVIF_ENCODER_CHANGE_CODEC_SPECIFIC;
  652|      0|    }
  653|       |
  654|  41.3k|    if (lastEncoder->sampleTransformRecipe != encoder->sampleTransformRecipe) {
  ------------------
  |  Branch (654:9): [True: 0, False: 41.3k]
  ------------------
  655|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
  656|      0|    }
  657|       |
  658|  41.3k|    return AVIF_TRUE;
  ------------------
  |  |   88|  41.3k|#define AVIF_TRUE 1
  ------------------
  659|  41.3k|}
write.c:avifEncoderBackupSettings:
  575|  55.1k|{
  576|  55.1k|    avifEncoder * lastEncoder = &encoder->data->lastEncoder;
  577|       |
  578|       |    // lastEncoder->data is only used to mark that lastEncoder is initialized. lastEncoder->data
  579|       |    // must not be dereferenced.
  580|  55.1k|    lastEncoder->data = encoder->data;
  581|  55.1k|    lastEncoder->codecChoice = encoder->codecChoice;
  582|  55.1k|    lastEncoder->maxThreads = encoder->maxThreads;
  583|  55.1k|    lastEncoder->speed = encoder->speed;
  584|  55.1k|    lastEncoder->keyframeInterval = encoder->keyframeInterval;
  585|  55.1k|    lastEncoder->timescale = encoder->timescale;
  586|  55.1k|    lastEncoder->repetitionCount = encoder->repetitionCount;
  587|  55.1k|    lastEncoder->extraLayerCount = encoder->extraLayerCount;
  588|  55.1k|    lastEncoder->minQuantizer = encoder->minQuantizer;
  589|  55.1k|    lastEncoder->maxQuantizer = encoder->maxQuantizer;
  590|  55.1k|    lastEncoder->minQuantizerAlpha = encoder->minQuantizerAlpha;
  591|  55.1k|    lastEncoder->maxQuantizerAlpha = encoder->maxQuantizerAlpha;
  592|  55.1k|    encoder->data->lastQuality = encoder->data->quality;
  593|  55.1k|    encoder->data->lastQualityAlpha = encoder->data->qualityAlpha;
  594|  55.1k|    encoder->data->lastTileRowsLog2 = encoder->data->tileRowsLog2;
  595|  55.1k|    encoder->data->lastTileColsLog2 = encoder->data->tileColsLog2;
  596|  55.1k|    lastEncoder->scalingMode = encoder->scalingMode;
  597|  55.1k|    lastEncoder->sampleTransformRecipe = encoder->sampleTransformRecipe;
  598|  55.1k|    lastEncoder->width = encoder->width;
  599|  55.1k|    lastEncoder->height = encoder->height;
  600|  55.1k|}
write.c:avifEncoderSizeIsSet:
  481|  68.9k|{
  482|  68.9k|    return (encoder->width != 0) || (encoder->height != 0);
  ------------------
  |  Branch (482:12): [True: 0, False: 68.9k]
  |  Branch (482:37): [True: 0, False: 68.9k]
  ------------------
  483|  68.9k|}
write.c:avifGridWidth:
 1799|  68.9k|{
 1800|  68.9k|    return (gridCols - 1) * firstCell->width + bottomRightCell->width;
 1801|  68.9k|}
write.c:avifGridHeight:
 1804|  68.9k|{
 1805|  68.9k|    return (gridRows - 1) * firstCell->height + bottomRightCell->height;
 1806|  68.9k|}
write.c:avifEncoderAddImageItems:
 1332|  18.4k|{
 1333|  18.4k|    const uint32_t cellCount = gridCols * gridRows;
 1334|  18.4k|    const char * infeName = getInfeName(itemCategory);
 1335|  18.4k|    const size_t infeNameSize = strlen(infeName) + 1;
 1336|       |
 1337|  18.4k|    if (cellCount > 1) {
  ------------------
  |  Branch (1337:9): [True: 0, False: 18.4k]
  ------------------
 1338|      0|        avifEncoderItem * gridItem;
 1339|      0|        AVIF_CHECKRES(avifEncoderDataCreateItem(encoder->data, "grid", infeName, infeNameSize, 0, &gridItem));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1340|      0|        AVIF_CHECKRES(avifWriteGridPayload(&gridItem->metadataPayload, gridCols, gridRows, gridWidth, gridHeight));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1341|      0|        gridItem->itemCategory = itemCategory;
 1342|      0|        gridItem->gridCols = gridCols;
 1343|      0|        gridItem->gridRows = gridRows;
 1344|      0|        gridItem->gridWidth = gridWidth;
 1345|      0|        gridItem->gridHeight = gridHeight;
 1346|      0|        *topLevelItemID = gridItem->id;
 1347|      0|    }
 1348|       |
 1349|  36.8k|    for (uint32_t cellIndex = 0; cellIndex < cellCount; ++cellIndex) {
  ------------------
  |  Branch (1349:34): [True: 18.4k, False: 18.4k]
  ------------------
 1350|  18.4k|        avifEncoderItem * item;
 1351|  18.4k|        AVIF_CHECKRES(avifEncoderDataCreateItem(encoder->data, encoder->data->imageItemType, infeName, infeNameSize, cellIndex, &item));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 1352|  18.4k|        AVIF_CHECKRES(avifCodecCreate(encoder->codecChoice, AVIF_CODEC_FLAG_CAN_ENCODE, &item->codec));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 1353|  18.4k|        item->codec->csOptions = encoder->csOptions;
 1354|  18.4k|        item->codec->diag = &encoder->diag;
 1355|  18.4k|        item->itemCategory = itemCategory;
 1356|  18.4k|        item->extraLayerCount = encoder->extraLayerCount;
 1357|       |
 1358|  18.4k|        if (cellCount > 1) {
  ------------------
  |  Branch (1358:13): [True: 0, False: 18.4k]
  ------------------
 1359|      0|            item->dimgFromID = *topLevelItemID;
 1360|      0|            item->hiddenImage = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 1361|  18.4k|        } else {
 1362|  18.4k|            *topLevelItemID = item->id;
 1363|  18.4k|        }
 1364|  18.4k|    }
 1365|  18.4k|    return AVIF_RESULT_OK;
 1366|  18.4k|}
write.c:getInfeName:
 1308|  18.4k|{
 1309|  18.4k|    if (avifIsAlpha(itemCategory)) {
  ------------------
  |  Branch (1309:9): [True: 4.61k, False: 13.7k]
  ------------------
 1310|  4.61k|        return infeNameAlpha;
 1311|  4.61k|    }
 1312|  13.7k|    if (itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (1312:9): [True: 0, False: 13.7k]
  ------------------
 1313|      0|        return infeNameGainMap;
 1314|      0|    }
 1315|  13.7k|    if (itemCategory >= AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY && itemCategory <= AVIF_SAMPLE_TRANSFORM_MAX_CATEGORY) {
  ------------------
  |  |  435|  27.5k|#define AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR
  ------------------
                  if (itemCategory >= AVIF_SAMPLE_TRANSFORM_MIN_CATEGORY && itemCategory <= AVIF_SAMPLE_TRANSFORM_MAX_CATEGORY) {
  ------------------
  |  |  437|      0|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA + AVIF_SAMPLE_TRANSFORM_MAX_NUM_EXTRA_INPUT_IMAGE_ITEMS - 1)
  |  |  ------------------
  |  |  |  |  431|      0|    (AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA - AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR)
  |  |  ------------------
  ------------------
  |  Branch (1315:9): [True: 0, False: 13.7k]
  |  Branch (1315:63): [True: 0, False: 0]
  ------------------
 1316|      0|        return infeNameSampleTransform;
 1317|      0|    }
 1318|  13.7k|    return infeNameColor;
 1319|  13.7k|}
write.c:avifEncoderDataFindItemByID:
  337|  4.61k|{
  338|  9.23k|    for (uint32_t itemIndex = 0; itemIndex < data->items.count; ++itemIndex) {
  ------------------
  |  Branch (338:34): [True: 9.23k, False: 0]
  ------------------
  339|  9.23k|        avifEncoderItem * item = &data->items.item[itemIndex];
  340|  9.23k|        if (item->id == id) {
  ------------------
  |  Branch (340:13): [True: 4.61k, False: 4.61k]
  ------------------
  341|  4.61k|            return item;
  342|  4.61k|        }
  343|  9.23k|    }
  344|      0|    return NULL;
  345|  4.61k|}
write.c:avifEncoderDataCreateItem:
  300|  18.4k|{
  301|       |    // All item IDs are taken. This is unreachable in practice but avoid a wrap-around of
  302|       |    // item IDs, which would silently truncate or duplicate them.
  303|  18.4k|    AVIF_ASSERT_OR_RETURN(data->lastItemID != UINT32_MAX);
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  304|       |
  305|  18.4k|    avifEncoderItem * item = (avifEncoderItem *)avifArrayPush(&data->items);
  306|  18.4k|    AVIF_CHECKERR(item != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  307|  18.4k|    ++data->lastItemID;
  308|  18.4k|    item->id = data->lastItemID;
  309|  18.4k|    memcpy(item->type, type, sizeof(item->type));
  310|  18.4k|    item->infeName = infeName;
  311|  18.4k|    item->infeNameSize = infeNameSize;
  312|  18.4k|    item->encodeOutput = avifCodecEncodeOutputCreate();
  313|  18.4k|    if (item->encodeOutput == NULL) {
  ------------------
  |  Branch (313:9): [True: 0, False: 18.4k]
  ------------------
  314|      0|        goto error;
  315|      0|    }
  316|  18.4k|    item->cellIndex = cellIndex;
  317|  18.4k|    if (!avifArrayCreate(&item->mdatFixups, sizeof(avifOffsetFixup), 4)) {
  ------------------
  |  Branch (317:9): [True: 0, False: 18.4k]
  ------------------
  318|      0|        goto error;
  319|      0|    }
  320|  18.4k|    if (!avifArrayCreate(&item->associations, sizeof(avifItemPropertyAssociation), 4)) {
  ------------------
  |  Branch (320:9): [True: 0, False: 18.4k]
  ------------------
  321|      0|        goto error;
  322|      0|    }
  323|  18.4k|    *itemPtr = item;
  324|  18.4k|    return AVIF_RESULT_OK;
  325|       |
  326|      0|error:
  327|      0|    if (item->encodeOutput != NULL) {
  ------------------
  |  Branch (327:9): [True: 0, False: 0]
  ------------------
  328|      0|        avifCodecEncodeOutputDestroy(item->encodeOutput);
  329|      0|    }
  330|      0|    avifArrayDestroy(&item->mdatFixups);
  331|      0|    --data->lastItemID;
  332|      0|    avifArrayPop(&data->items);
  333|      0|    return AVIF_RESULT_OUT_OF_MEMORY;
  334|  18.4k|}
write.c:avifEncoderDataShouldForceKeyframeForAlpha:
 1762|  55.1k|{
 1763|  55.1k|    if (!data->alphaPresent) {
  ------------------
  |  Branch (1763:9): [True: 36.7k, False: 18.4k]
  ------------------
 1764|       |        // There is no alpha plane.
 1765|  36.7k|        return AVIF_FALSE;
  ------------------
  |  |   89|  36.7k|#define AVIF_FALSE 0
  ------------------
 1766|  36.7k|    }
 1767|  18.4k|    if (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) {
  ------------------
  |  Branch (1767:9): [True: 0, False: 18.4k]
  ------------------
 1768|       |        // Not an animated image.
 1769|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 1770|      0|    }
 1771|  18.4k|    if (data->frames.count == 0) {
  ------------------
  |  Branch (1771:9): [True: 4.61k, False: 13.8k]
  ------------------
 1772|       |        // data->frames.count is the number of frames that have been encoded so far by previous calls to avifEncoderAddImage. If
 1773|       |        // this is the first frame, there is no need to force keyframe.
 1774|  4.61k|        return AVIF_FALSE;
  ------------------
  |  |   89|  4.61k|#define AVIF_FALSE 0
  ------------------
 1775|  4.61k|    }
 1776|  13.8k|    const uint32_t colorFramesOutputSoFar = colorItem->encodeOutput->samples.count;
 1777|  13.8k|    const avifBool isLaggedOutput = (data->frames.count + 1) != colorFramesOutputSoFar;
 1778|  13.8k|    if (isLaggedOutput) {
  ------------------
  |  Branch (1778:9): [True: 0, False: 13.8k]
  ------------------
 1779|       |        // If the encoder is operating with lag, then there is no way to determine if the last encoded frame was a keyframe until
 1780|       |        // the encoder outputs it (after the lag). So do not force keyframe for alpha channel in this case.
 1781|      0|        return AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 1782|      0|    }
 1783|  13.8k|    return colorItem->encodeOutput->samples.sample[colorFramesOutputSoFar - 1].sync;
 1784|  13.8k|}
write.c:avifEncoderGetCodecType:
 1627|  68.9k|{
 1628|       |    // This asserts that images cannot be encoded with AVM unless AVIF_CODEC_CHOICE_AVM is explicitly selected.
 1629|       |    assert((encoder->codecChoice != AVIF_CODEC_CHOICE_AUTO) ||
 1630|  68.9k|           (strcmp(avifCodecName(encoder->codecChoice, AVIF_CODEC_FLAG_CAN_ENCODE), "avm") != 0));
 1631|  68.9k|    return avifCodecTypeFromChoice(encoder->codecChoice, AVIF_CODEC_FLAG_CAN_ENCODE);
 1632|  68.9k|}
write.c:avifRWStreamWriteHandlerBox:
  898|  13.7k|{
  899|  13.7k|    avifBoxMarker hdlr;
  900|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteFullBox(s, "hdlr", AVIF_BOX_SIZE_TBD, 0, 0, &hdlr));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  901|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteU32(s, 0));                // unsigned int(32) pre_defined = 0;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  902|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(s, handlerType, 4)); // unsigned int(32) handler_type;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  903|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteZeros(s, 12));             // const unsigned int(32)[3] reserved = 0;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  904|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(s, "", 1));          // string name; (writing null terminator)
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  905|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(s, hdlr));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  906|  13.7k|    return AVIF_RESULT_OK;
  907|  13.7k|}
write.c:avifEncoderItemAddMdatFixup:
  372|  73.6k|{
  373|  73.6k|    avifOffsetFixup * fixup = (avifOffsetFixup *)avifArrayPush(&item->mdatFixups);
  374|  73.6k|    AVIF_CHECKERR(fixup != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  73.6k|    do {                        \
  |  |   46|  73.6k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
  375|  73.6k|    fixup->offset = avifRWStreamOffset(s);
  376|  73.6k|    return AVIF_RESULT_OK;
  377|  73.6k|}
write.c:avifItemPropertyDedupCreate:
  399|  13.7k|{
  400|  13.7k|    avifItemPropertyDedup * dedup = (avifItemPropertyDedup *)avifAlloc(sizeof(avifItemPropertyDedup));
  401|  13.7k|    if (dedup == NULL) {
  ------------------
  |  Branch (401:9): [True: 0, False: 13.7k]
  ------------------
  402|      0|        return NULL;
  403|      0|    }
  404|  13.7k|    memset(dedup, 0, sizeof(avifItemPropertyDedup));
  405|  13.7k|    if (!avifArrayCreate(&dedup->properties, sizeof(avifItemProperty), 8)) {
  ------------------
  |  Branch (405:9): [True: 0, False: 13.7k]
  ------------------
  406|      0|        avifFree(dedup);
  407|      0|        return NULL;
  408|      0|    }
  409|  13.7k|    if (avifRWDataRealloc(&dedup->buffer, 2048) != AVIF_RESULT_OK) {
  ------------------
  |  Branch (409:9): [True: 0, False: 13.7k]
  ------------------
  410|      0|        avifArrayDestroy(&dedup->properties);
  411|      0|        avifFree(dedup);
  412|      0|        return NULL;
  413|      0|    }
  414|  13.7k|    return dedup;
  415|  13.7k|}
write.c:avifRWStreamWriteProperties:
 3092|  13.7k|{
 3093|  32.1k|    for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (3093:34): [True: 18.4k, False: 13.7k]
  ------------------
 3094|  18.4k|        avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 3095|  18.4k|        const avifBool isGrid = (item->gridCols > 0);
 3096|       |        // Whether there is ipma to write for this item.
 3097|  18.4k|        avifBool hasIpmaToWrite = item->codec || isGrid;
  ------------------
  |  Branch (3097:35): [True: 18.4k, False: 0]
  |  Branch (3097:50): [True: 0, False: 0]
  ------------------
 3098|  18.4k|        const avifBool isToneMappedImage = !memcmp(item->type, "tmap", 4);
 3099|  18.4k|        if (isToneMappedImage) {
  ------------------
  |  Branch (3099:13): [True: 0, False: 18.4k]
  ------------------
 3100|      0|            hasIpmaToWrite = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3101|      0|        }
 3102|  18.4k|        const avifBool isSampleTransformImage = !memcmp(item->type, "sato", 4);
 3103|  18.4k|        if (isSampleTransformImage) {
  ------------------
  |  Branch (3103:13): [True: 0, False: 18.4k]
  ------------------
 3104|      0|            hasIpmaToWrite = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3105|      0|        }
 3106|  18.4k|        item->associations.count = 0;
 3107|  18.4k|        if (!hasIpmaToWrite) {
  ------------------
  |  Branch (3107:13): [True: 0, False: 18.4k]
  ------------------
 3108|      0|            continue;
 3109|      0|        }
 3110|       |
 3111|  18.4k|        if (item->dimgFromID && (item->extraLayerCount == 0)) {
  ------------------
  |  Branch (3111:13): [True: 0, False: 18.4k]
  |  Branch (3111:33): [True: 0, False: 0]
  ------------------
 3112|      0|            avifEncoderItem * parentItem = avifEncoderDataFindItemByID(encoder->data, item->dimgFromID);
 3113|      0|            if (parentItem && !memcmp(parentItem->type, "grid", 4)) {
  ------------------
  |  Branch (3113:17): [True: 0, False: 0]
  |  Branch (3113:31): [True: 0, False: 0]
  ------------------
 3114|       |                // All image cells from a grid should share the exact same properties unless they are
 3115|       |                // layered image which have different al1x, so see if we've already written properties
 3116|       |                // out for another cell in this grid, and if so, just steal their ipma and move on.
 3117|       |                // This is a sneaky way to provide iprp deduplication.
 3118|       |
 3119|      0|                avifBool foundPreviousCell = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 3120|      0|                for (uint32_t dedupIndex = 0; dedupIndex < itemIndex; ++dedupIndex) {
  ------------------
  |  Branch (3120:47): [True: 0, False: 0]
  ------------------
 3121|      0|                    avifEncoderItem * dedupItem = &encoder->data->items.item[dedupIndex];
 3122|      0|                    if ((item->dimgFromID == dedupItem->dimgFromID) && (dedupItem->extraLayerCount == 0)) {
  ------------------
  |  Branch (3122:25): [True: 0, False: 0]
  |  Branch (3122:72): [True: 0, False: 0]
  ------------------
 3123|       |                        // We've already written dedup's items out. Steal their ipma indices and move on!
 3124|      0|                        item->associations.count = 0;
 3125|      0|                        for (uint32_t associationIndex = 0; associationIndex < dedupItem->associations.count; ++associationIndex) {
  ------------------
  |  Branch (3125:61): [True: 0, False: 0]
  ------------------
 3126|      0|                            avifItemPropertyAssociation * association = (avifItemPropertyAssociation *)avifArrayPush(&item->associations);
 3127|      0|                            AVIF_CHECKERR(association != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3128|      0|                            *association = dedupItem->associations.association[associationIndex];
 3129|      0|                        }
 3130|      0|                        foundPreviousCell = AVIF_TRUE;
  ------------------
  |  |   88|      0|#define AVIF_TRUE 1
  ------------------
 3131|      0|                        break;
 3132|      0|                    }
 3133|      0|                }
 3134|      0|                if (foundPreviousCell) {
  ------------------
  |  Branch (3134:21): [True: 0, False: 0]
  ------------------
 3135|      0|                    continue;
 3136|      0|                }
 3137|      0|            }
 3138|      0|        }
 3139|       |
 3140|  18.4k|        const avifImage * itemMetadata = imageMetadata;
 3141|  18.4k|        if (isToneMappedImage) {
  ------------------
  |  Branch (3141:13): [True: 0, False: 18.4k]
  ------------------
 3142|      0|            itemMetadata = altImageMetadata;
 3143|  18.4k|        } else if (item->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (3143:20): [True: 0, False: 18.4k]
  ------------------
 3144|      0|            AVIF_ASSERT_OR_RETURN(itemMetadata->gainMap && itemMetadata->gainMap->image);
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3145|      0|            itemMetadata = itemMetadata->gainMap->image;
 3146|      0|        }
 3147|  18.4k|        uint32_t imageWidth = itemMetadata->width;
 3148|  18.4k|        uint32_t imageHeight = itemMetadata->height;
 3149|  18.4k|        if (isGrid) {
  ------------------
  |  Branch (3149:13): [True: 0, False: 18.4k]
  ------------------
 3150|      0|            imageWidth = item->gridWidth;
 3151|      0|            imageHeight = item->gridHeight;
 3152|      0|        }
 3153|       |
 3154|       |        // ISO/IEC 23008-12:2024 section 6.5.1:
 3155|       |        //   Writers should arrange the descriptive properties specified in 6.5 prior to any other properties
 3156|       |        //   in the sequence associating properties with an item.
 3157|       |        // For each item, write the descriptive properties first (and thus associate them before the
 3158|       |        // transformative properties).
 3159|       |
 3160|       |        // Properties all image items need (coded and derived)
 3161|       |        // ispe = image spatial extent (width, height)
 3162|  18.4k|        avifItemPropertyDedupStart(dedup);
 3163|  18.4k|        avifBoxMarker ispe;
 3164|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteFullBox(&dedup->s, "ispe", AVIF_BOX_SIZE_TBD, 0, 0, &ispe));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3165|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteU32(&dedup->s, imageWidth));  // unsigned int(32) image_width;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3166|  18.4k|        AVIF_CHECKRES(avifRWStreamWriteU32(&dedup->s, imageHeight)); // unsigned int(32) image_height;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3167|  18.4k|        AVIF_CHECKRES(avifRWStreamFinishBox(&dedup->s, ispe));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3168|  18.4k|        AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3169|       |
 3170|       |        // pixi = pixel information (depth, channel count)
 3171|  18.4k|        avifBool hasPixi = AVIF_TRUE;
  ------------------
  |  |   88|  18.4k|#define AVIF_TRUE 1
  ------------------
 3172|       |        // Pixi is optional for the 'tmap' item.
 3173|  18.4k|        if (isToneMappedImage && imageMetadata->gainMap->altDepth == 0 && imageMetadata->gainMap->altPlaneCount == 0) {
  ------------------
  |  Branch (3173:13): [True: 0, False: 18.4k]
  |  Branch (3173:34): [True: 0, False: 0]
  |  Branch (3173:75): [True: 0, False: 0]
  ------------------
 3174|      0|            hasPixi = AVIF_FALSE;
  ------------------
  |  |   89|      0|#define AVIF_FALSE 0
  ------------------
 3175|      0|        }
 3176|  18.4k|        const avifBool isAlpha = avifIsAlpha(item->itemCategory);
 3177|  18.4k|        uint8_t depth = (uint8_t)itemMetadata->depth;
 3178|  18.4k|        if (encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_8B_8B ||
  ------------------
  |  Branch (3178:13): [True: 0, False: 18.4k]
  ------------------
 3179|  18.4k|            encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_4B ||
  ------------------
  |  Branch (3179:13): [True: 0, False: 18.4k]
  ------------------
 3180|  18.4k|            encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_8B_OVERLAP_4B) {
  ------------------
  |  Branch (3180:13): [True: 0, False: 18.4k]
  ------------------
 3181|      0|            if (item->itemCategory == AVIF_ITEM_SAMPLE_TRANSFORM) {
  ------------------
  |  Branch (3181:17): [True: 0, False: 0]
  ------------------
 3182|      0|                AVIF_ASSERT_OR_RETURN(depth == 16); // Only 16-bit depth is supported for now.
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3183|      0|            } else if (encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_8B_8B) {
  ------------------
  |  Branch (3183:24): [True: 0, False: 0]
  ------------------
 3184|      0|                depth = 8;
 3185|      0|            } else {
 3186|      0|                if (item->itemCategory == AVIF_ITEM_COLOR || item->itemCategory == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (3186:21): [True: 0, False: 0]
  |  Branch (3186:62): [True: 0, False: 0]
  ------------------
 3187|      0|                    depth = 12;
 3188|      0|                } else {
 3189|      0|                    AVIF_ASSERT_OR_RETURN(item->itemCategory == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_COLOR ||
  ------------------
  |  |   64|      0|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|      0|    do {                        \
  |  |  |  |   46|      0|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3190|      0|                                          item->itemCategory == AVIF_ITEM_SAMPLE_TRANSFORM_INPUT_0_ALPHA);
 3191|       |                    // Will be shifted to 4-bit samples at decoding for AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_4B.
 3192|      0|                    depth = 8;
 3193|      0|                }
 3194|      0|            }
 3195|  18.4k|        } else {
 3196|  18.4k|            AVIF_CHECKERR(encoder->sampleTransformRecipe == AVIF_SAMPLE_TRANSFORM_NONE, AVIF_RESULT_NOT_IMPLEMENTED);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3197|  18.4k|        }
 3198|  18.4k|        assert(isSampleTransformImage == (item->itemCategory == AVIF_ITEM_SAMPLE_TRANSFORM));
 3199|       |
 3200|  18.4k|        if (hasPixi) {
  ------------------
  |  Branch (3200:13): [True: 18.4k, False: 0]
  ------------------
 3201|  18.4k|            avifItemPropertyDedupStart(dedup);
 3202|  18.4k|            uint8_t channelCount = (isAlpha || (itemMetadata->yuvFormat == AVIF_PIXEL_FORMAT_YUV400)) ? 1 : 3;
  ------------------
  |  Branch (3202:37): [True: 4.61k, False: 13.7k]
  |  Branch (3202:48): [True: 6.79k, False: 6.99k]
  ------------------
 3203|       |            // See ISO/IEC 23008-12:2024/CDAM 2:2025 section 6.5.6.3.
 3204|  18.4k|            avifBoxMarker pixi;
 3205|  18.4k|            uint32_t flags = 0;
 3206|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI)
 3207|       |            if (encoder->headerFormat & AVIF_HEADER_EXTENDED_PIXI) {
 3208|       |                flags |= 1;
 3209|       |            }
 3210|       |#endif // AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI
 3211|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&dedup->s, "pixi", AVIF_BOX_SIZE_TBD, 0, flags, &pixi));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3212|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteU8(&dedup->s, channelCount)); // unsigned int (8) num_channels;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3213|  50.8k|            for (uint8_t chan = 0; chan < channelCount; ++chan) {
  ------------------
  |  Branch (3213:36): [True: 32.4k, False: 18.4k]
  ------------------
 3214|  32.4k|                AVIF_CHECKRES(avifRWStreamWriteU8(&dedup->s, depth)); // unsigned int (8) bits_per_channel;
  ------------------
  |  |   54|  32.4k|    do {                                  \
  |  |   55|  32.4k|        const avifResult result__ = (A);  \
  |  |   56|  32.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 32.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  32.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 32.4k]
  |  |  ------------------
  ------------------
 3215|  32.4k|            }
 3216|       |#if defined(AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI)
 3217|       |            if (flags & 1) {
 3218|       |                AVIF_ASSERT_OR_RETURN(item->av1C.chromaSamplePosition != AVIF_CHROMA_SAMPLE_POSITION_RESERVED);
 3219|       |                // Do not signal any subsampling information if the sample position is unknown because the 'pixi' box
 3220|       |                // does not have an enum entry for "unknown subsampling location".
 3221|       |                const uint8_t subsampling_flag = item->av1C.chromaSamplePosition == AVIF_CHROMA_SAMPLE_POSITION_VERTICAL ||
 3222|       |                                                 item->av1C.chromaSamplePosition == AVIF_CHROMA_SAMPLE_POSITION_COLOCATED;
 3223|       |                for (uint8_t chan = 0; chan < channelCount; ++chan) {
 3224|       |                    AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, 0, /*bitCount=*/3)); // unsigned int(3) channel_idc;
 3225|       |                    AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, 0, /*bitCount=*/1)); // unsigned int(1) reserved;
 3226|       |                    AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, 0, /*bitCount=*/2)); // unsigned int(2) component_format;
 3227|       |                    AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, subsampling_flag, /*bitCount=*/1)); // unsigned int(1) subsampling_flag;
 3228|       |                    AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, 0, /*bitCount=*/1)); // unsigned int(1) channel_label_flag;
 3229|       |                    if (subsampling_flag) {
 3230|       |                        const uint8_t subsamplingType = avifCodecConfigurationBoxGetSubsamplingType(&item->av1C, chan);
 3231|       |                        const uint8_t subsamplingLocation = subsamplingType == AVIF_PIXI_444 ? 0
 3232|       |                                                            : item->av1C.chromaSamplePosition == AVIF_CHROMA_SAMPLE_POSITION_VERTICAL
 3233|       |                                                                ? 0
 3234|       |                                                                : 2;
 3235|       |                        AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, subsamplingType, /*bitCount=*/4)); // unsigned int(4) subsampling_type;
 3236|       |                        AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, subsamplingLocation, /*bitCount=*/4)); // unsigned int(4) subsampling_location;
 3237|       |                    }
 3238|       |                }
 3239|       |            }
 3240|       |#endif // AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI
 3241|  18.4k|            AVIF_CHECKRES(avifRWStreamFinishBox(&dedup->s, pixi));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3242|  18.4k|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3243|  18.4k|        }
 3244|       |
 3245|       |        // Codec configuration box ('av1C' or 'av2C')
 3246|  18.4k|        if (item->codec) {
  ------------------
  |  Branch (3246:13): [True: 18.4k, False: 0]
  ------------------
 3247|  18.4k|            avifItemPropertyDedupStart(dedup);
 3248|  18.4k|            AVIF_CHECKRES(writeConfigBox(&dedup->s, &item->av1C, encoder->data->configPropName));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3249|  18.4k|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_TRUE));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3250|  18.4k|        }
 3251|       |
 3252|  18.4k|        if (isAlpha) {
  ------------------
  |  Branch (3252:13): [True: 4.61k, False: 13.7k]
  ------------------
 3253|       |            // Alpha specific properties
 3254|       |
 3255|  4.61k|            avifItemPropertyDedupStart(dedup);
 3256|  4.61k|            avifBoxMarker auxC;
 3257|  4.61k|            AVIF_CHECKRES(avifRWStreamWriteFullBox(&dedup->s, "auxC", AVIF_BOX_SIZE_TBD, 0, 0, &auxC));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3258|  4.61k|            AVIF_CHECKRES(avifRWStreamWriteChars(&dedup->s, alphaURN, alphaURNSize)); //  string aux_type;
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3259|  4.61k|            AVIF_CHECKRES(avifRWStreamFinishBox(&dedup->s, auxC));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3260|  4.61k|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3261|  13.7k|        } else if (item->itemCategory == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (3261:20): [True: 13.7k, False: 0]
  ------------------
 3262|       |            // Color specific properties
 3263|       |            // Note the 'tmap' (tone mapped image) item when a gain map is present also has itemCategory AVIF_ITEM_COLOR.
 3264|       |
 3265|  13.7k|            AVIF_CHECKRES(avifEncoderWriteColorProperties(s, itemMetadata, &item->associations, dedup));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3266|  13.7k|            AVIF_CHECKRES(avifEncoderWriteHDRProperties(&dedup->s, s, itemMetadata, &item->associations, dedup));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3267|  13.7k|        } else if (item->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (3267:20): [True: 0, False: 0]
  ------------------
 3268|       |            // Gain map specific properties
 3269|       |
 3270|       |            // Write the colr nclx box.
 3271|      0|            AVIF_CHECKRES(avifEncoderWriteNclxProperty(&dedup->s, s, itemMetadata, &item->associations, dedup));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3272|       |
 3273|      0|            AVIF_CHECKRES(avifEncoderWritePaspProperty(&dedup->s, s, imageMetadata, &item->associations, dedup));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3274|      0|        }
 3275|       |
 3276|  18.4k|        if (item->extraLayerCount > 0) {
  ------------------
  |  Branch (3276:13): [True: 18.4k, False: 0]
  ------------------
 3277|       |            // Layered Image Indexing Property
 3278|       |
 3279|  18.4k|            avifItemPropertyDedupStart(dedup);
 3280|  18.4k|            avifBoxMarker a1lx;
 3281|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteBox(&dedup->s, "a1lx", AVIF_BOX_SIZE_TBD, &a1lx));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3282|  18.4k|            uint32_t layerSize[AVIF_MAX_AV1_LAYER_COUNT - 1] = { 0 };
 3283|  18.4k|            avifBool largeSize = AVIF_FALSE;
  ------------------
  |  |   89|  18.4k|#define AVIF_FALSE 0
  ------------------
 3284|       |
 3285|  73.6k|            for (uint32_t validLayer = 0; validLayer < item->extraLayerCount; ++validLayer) {
  ------------------
  |  Branch (3285:43): [True: 55.2k, False: 18.4k]
  ------------------
 3286|  55.2k|                uint32_t size = (uint32_t)item->encodeOutput->samples.sample[validLayer].data.size;
 3287|  55.2k|                layerSize[validLayer] = size;
 3288|  55.2k|                if (size > 0xffff) {
  ------------------
  |  Branch (3288:21): [True: 3, False: 55.2k]
  ------------------
 3289|      3|                    largeSize = AVIF_TRUE;
  ------------------
  |  |   88|      3|#define AVIF_TRUE 1
  ------------------
 3290|      3|                }
 3291|  55.2k|            }
 3292|       |
 3293|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, 0, /*bitCount=*/7));                 // unsigned int(7) reserved = 0;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3294|  18.4k|            AVIF_CHECKRES(avifRWStreamWriteBits(&dedup->s, largeSize ? 1 : 0, /*bitCount=*/1)); // unsigned int(1) large_size;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  36.8k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 2, False: 18.4k]
  |  |  ------------------
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3295|       |
 3296|       |            // FieldLength = (large_size + 1) * 16;
 3297|       |            // unsigned int(FieldLength) layer_size[3];
 3298|  73.6k|            for (uint32_t layer = 0; layer < AVIF_MAX_AV1_LAYER_COUNT - 1; ++layer) {
  ------------------
  |  |  125|  73.6k|#define AVIF_MAX_AV1_LAYER_COUNT 4
  ------------------
  |  Branch (3298:38): [True: 55.2k, False: 18.4k]
  ------------------
 3299|  55.2k|                if (largeSize) {
  ------------------
  |  Branch (3299:21): [True: 6, False: 55.2k]
  ------------------
 3300|      6|                    AVIF_CHECKRES(avifRWStreamWriteU32(&dedup->s, layerSize[layer]));
  ------------------
  |  |   54|      6|    do {                                  \
  |  |   55|      6|        const avifResult result__ = (A);  \
  |  |   56|      6|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 6]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
 3301|  55.2k|                } else {
 3302|  55.2k|                    AVIF_CHECKRES(avifRWStreamWriteU16(&dedup->s, (uint16_t)layerSize[layer]));
  ------------------
  |  |   54|  55.2k|    do {                                  \
  |  |   55|  55.2k|        const avifResult result__ = (A);  \
  |  |   56|  55.2k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 55.2k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  55.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 55.2k]
  |  |  ------------------
  ------------------
 3303|  55.2k|                }
 3304|  55.2k|            }
 3305|  18.4k|            AVIF_CHECKRES(avifRWStreamFinishBox(&dedup->s, a1lx));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3306|  18.4k|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 3307|       |
 3308|       |            // We don't add an 'lsel' property since many decoders do not support it and will reject the image,
 3309|       |            // see https://github.com/AOMediaCodec/libavif/pull/2429.
 3310|       |            // Firefox 155 or later will support an 'lsel' property whose layer_id is 0xFFFF,
 3311|       |            // see https://bugzilla.mozilla.org/show_bug.cgi?id=2055813.
 3312|  18.4k|        }
 3313|       |
 3314|       |        // Write out any opaque properties from avifImageAddOpaqueProperty() or avifImageAddUUIDProperty().
 3315|  18.4k|        for (size_t i = 0; i < itemMetadata->numProperties; i++) {
  ------------------
  |  Branch (3315:28): [True: 0, False: 18.4k]
  ------------------
 3316|      0|            avifItemPropertyDedupStart(dedup);
 3317|      0|            const avifImageItemProperty * prop = &itemMetadata->properties[i];
 3318|      0|            avifBoxMarker propMarker;
 3319|      0|            AVIF_CHECKRES(avifRWStreamWriteBox(&dedup->s, (const char *)prop->boxtype, AVIF_BOX_SIZE_TBD, &propMarker));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3320|      0|            if (memcmp(prop->boxtype, "uuid", 4) == 0) {
  ------------------
  |  Branch (3320:17): [True: 0, False: 0]
  ------------------
 3321|      0|                AVIF_CHECKRES(avifRWStreamWrite(&dedup->s, prop->usertype, 16));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3322|      0|            }
 3323|      0|            AVIF_CHECKRES(avifRWStreamWrite(&dedup->s, prop->boxPayload.data, prop->boxPayload.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3324|      0|            AVIF_CHECKRES(avifRWStreamFinishBox(&dedup->s, propMarker));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3325|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, s, &item->associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3326|      0|        }
 3327|       |
 3328|       |        // Also write the transformative properties.
 3329|       |
 3330|  18.4k|        if (item->itemCategory == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (3330:13): [True: 13.7k, False: 4.61k]
  ------------------
 3331|       |            // Color specific properties
 3332|       |            // Note the 'tmap' (tone mapped image) item when a gain map is present also has itemCategory AVIF_ITEM_COLOR.
 3333|  13.7k|            AVIF_CHECKRES(avifEncoderWriteTransformativeProperties(&dedup->s, s, itemMetadata, &item->associations, dedup));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 3334|  13.7k|        } else if (item->itemCategory == AVIF_ITEM_ALPHA) {
  ------------------
  |  Branch (3334:20): [True: 4.61k, False: 0]
  ------------------
 3335|       |            // Cropping, rotation and mirroring must also be applied to alpha auxiliary items.
 3336|  4.61k|            AVIF_CHECKRES(avifEncoderWriteTransformativeProperties(&dedup->s, s, itemMetadata, &item->associations, dedup));
  ------------------
  |  |   54|  4.61k|    do {                                  \
  |  |   55|  4.61k|        const avifResult result__ = (A);  \
  |  |   56|  4.61k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 4.61k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
 3337|  4.61k|        } else if (item->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (3337:20): [True: 0, False: 0]
  ------------------
 3338|       |            // Gain map specific properties
 3339|       |
 3340|       |            // For the orientation, it could be done in multiple ways:
 3341|       |            // - Bake the orientation in the base and gain map images.
 3342|       |            //   This does not allow for orientation changes without recompression.
 3343|       |            // - Associate 'irot'/'imir' with the 'tmap' derived image item only.
 3344|       |            //   If so, decoding only the base image would give a different orientation than
 3345|       |            //   decoding the tone-mapped image.
 3346|       |            // - Wrap the base image in an 'iden' derived image item and associate 'irot'/'imir'
 3347|       |            //   with the 'tmap' and 'iden' derived image items. 'iden' is not currently supported
 3348|       |            //   by libavif, reducing the backward compatibility of this solution.
 3349|       |            // - Associate 'irot'/'imir' with the base and gain map image items.
 3350|       |            //   Do not associate 'irot'/'imir' with the 'tmap' derived image item.
 3351|       |            //   These transformative properties are supposed to be applied at decoding on
 3352|       |            //   image items before these are used as input to a derived image item.
 3353|       |            //   libavif uses this pattern at encoding and requires it at decoding.
 3354|       |            //   As of today, this is forbidden by the AVIF specification:
 3355|       |            //     https://aomediacodec.github.io/av1-avif/v1.1.0.html#file-constraints
 3356|       |            //   That rule was written before 'tmap' was proposed and may be relaxed for 'tmap'.
 3357|       |
 3358|       |            // 'clap' is treated as 'irot'/'imir', although it could differ between the base and
 3359|       |            // gain map image items if these have different dimensions.
 3360|      0|            if (imageMetadata->transformFlags & AVIF_TRANSFORM_CLAP) {
  ------------------
  |  Branch (3360:17): [True: 0, False: 0]
  ------------------
 3361|      0|                AVIF_CHECKERR(imageMetadata->width != itemMetadata->width || imageMetadata->height != itemMetadata->height,
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  |  Branch (46:15): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3362|      0|                              AVIF_RESULT_NOT_IMPLEMENTED);
 3363|      0|            }
 3364|       |
 3365|       |            // 'pasp' is not a transformative property (despite AVIF_TRANSFORM_PASP being part of
 3366|       |            // avifTransformFlag) but it is assumed to apply to the gain map in the same way as
 3367|       |            // the transformative properties above.
 3368|       |
 3369|       |            // Based on the explanation above, 'clap', 'irot', 'imir' and 'pasp' have to match between the base and
 3370|       |            // gain map image items in the container part of the encoded file.
 3371|       |            // To enforce that, the transformative and 'pasp' properties of the gain map cannot be set explicitly in the API.
 3372|      0|            AVIF_CHECKERR(itemMetadata->transformFlags == AVIF_TRANSFORM_NONE, AVIF_RESULT_ENCODE_GAIN_MAP_FAILED);
  ------------------
  |  |   45|      0|    do {                        \
  |  |   46|      0|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3373|      0|            AVIF_CHECKRES(avifEncoderWriteTransformativeProperties(&dedup->s, s, imageMetadata, &item->associations, dedup));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3374|      0|        }
 3375|  18.4k|    }
 3376|  13.7k|    return AVIF_RESULT_OK;
 3377|  13.7k|}
write.c:avifItemPropertyDedupStart:
  426|  92.0k|{
  427|  92.0k|    avifRWStreamStart(&dedup->s, &dedup->buffer);
  428|  92.0k|}
write.c:avifItemPropertyDedupFinish:
  442|  92.0k|{
  443|  92.0k|    uint8_t propertyIndex = 0;
  444|  92.0k|    const size_t newPropertySize = avifRWStreamOffset(&dedup->s);
  445|       |
  446|   325k|    for (size_t i = 0; i < dedup->properties.count; ++i) {
  ------------------
  |  Branch (446:24): [True: 242k, False: 83.3k]
  ------------------
  447|   242k|        avifItemProperty * property = &dedup->properties.property[i];
  448|   242k|        if ((property->size == newPropertySize) &&
  ------------------
  |  Branch (448:13): [True: 15.8k, False: 226k]
  ------------------
  449|  15.8k|            !memcmp(&outputStream->raw->data[property->offset], dedup->buffer.data, newPropertySize)) {
  ------------------
  |  Branch (449:13): [True: 8.68k, False: 7.19k]
  ------------------
  450|       |            // We've already written this exact property, reuse it
  451|  8.68k|            propertyIndex = property->index;
  452|  8.68k|            AVIF_ASSERT_OR_RETURN(propertyIndex != 0);
  ------------------
  |  |   64|  8.68k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  8.68k|    do {                        \
  |  |  |  |   46|  8.68k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 8.68k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  8.68k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 8.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|  8.68k|            break;
  454|  8.68k|        }
  455|   242k|    }
  456|       |
  457|  92.0k|    if (propertyIndex == 0) {
  ------------------
  |  Branch (457:9): [True: 83.3k, False: 8.68k]
  ------------------
  458|       |        // Write a new property, and remember its location in the output stream for future deduplication
  459|  83.3k|        avifItemProperty * property = (avifItemProperty *)avifArrayPush(&dedup->properties);
  460|  83.3k|        AVIF_CHECKERR(property != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  83.3k|    do {                        \
  |  |   46|  83.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
  461|  83.3k|        AVIF_CHECKERR(dedup->nextIndex < MAX_PROPERTY_INDEX, AVIF_RESULT_INVALID_ARGUMENT);
  ------------------
  |  |   45|  83.3k|    do {                        \
  |  |   46|  83.3k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
  462|  83.3k|        property->index = ++dedup->nextIndex; // preincrement so the first new index is 1 (as ipma is 1-indexed)
  463|  83.3k|        property->size = newPropertySize;
  464|  83.3k|        property->offset = avifRWStreamOffset(outputStream);
  465|  83.3k|        AVIF_CHECKRES(avifRWStreamWrite(outputStream, dedup->buffer.data, newPropertySize));
  ------------------
  |  |   54|  83.3k|    do {                                  \
  |  |   55|  83.3k|        const avifResult result__ = (A);  \
  |  |   56|  83.3k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 83.3k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  83.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 83.3k]
  |  |  ------------------
  ------------------
  466|  83.3k|        propertyIndex = property->index;
  467|  83.3k|    }
  468|       |
  469|  92.0k|    avifItemPropertyAssociation * association = (avifItemPropertyAssociation *)avifArrayPush(associations);
  470|  92.0k|    AVIF_CHECKERR(association != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  92.0k|    do {                        \
  |  |   46|  92.0k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 92.0k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  92.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 92.0k]
  |  |  ------------------
  ------------------
  471|  92.0k|    association->property_index = propertyIndex;
  472|  92.0k|    association->essential = essential;
  473|  92.0k|    return AVIF_RESULT_OK;
  474|  92.0k|}
write.c:avifEncoderWriteNclxProperty:
  667|  13.7k|{
  668|  13.7k|    if (dedup) {
  ------------------
  |  Branch (668:9): [True: 13.7k, False: 0]
  ------------------
  669|  13.7k|        avifItemPropertyDedupStart(dedup);
  670|  13.7k|    }
  671|  13.7k|    avifBoxMarker colr;
  672|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "colr", AVIF_BOX_SIZE_TBD, &colr));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  673|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteChars(dedupStream, "nclx", 4));                   // unsigned int(32) colour_type;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  674|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteU16(dedupStream, imageMetadata->colorPrimaries)); // unsigned int(16) colour_primaries;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  675|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteU16(dedupStream, imageMetadata->transferCharacteristics)); // unsigned int(16) transfer_characteristics;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  676|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteU16(dedupStream, imageMetadata->matrixCoefficients)); // unsigned int(16) matrix_coefficients;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  677|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, (imageMetadata->yuvRange == AVIF_RANGE_FULL) ? 1 : 0, /*bitCount=*/1)); // unsigned int(1) full_range_flag;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  27.5k|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 13.7k, False: 0]
  |  |  ------------------
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  678|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, 0, /*bitCount=*/7)); // unsigned int(7) reserved = 0;
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  679|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, colr));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  680|  13.7k|    if (dedup) {
  ------------------
  |  Branch (680:9): [True: 13.7k, False: 0]
  ------------------
  681|  13.7k|        AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  682|  13.7k|    }
  683|  13.7k|    return AVIF_RESULT_OK;
  684|  13.7k|}
write.c:avifEncoderWritePaspProperty:
  826|  13.7k|{
  827|  13.7k|    if (imageMetadata->transformFlags & AVIF_TRANSFORM_PASP) {
  ------------------
  |  Branch (827:9): [True: 0, False: 13.7k]
  ------------------
  828|      0|        if (dedup) {
  ------------------
  |  Branch (828:13): [True: 0, False: 0]
  ------------------
  829|      0|            avifItemPropertyDedupStart(dedup);
  830|      0|        }
  831|      0|        avifBoxMarker pasp;
  832|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "pasp", AVIF_BOX_SIZE_TBD, &pasp));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  833|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->pasp.hSpacing)); // unsigned int(32) hSpacing;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  834|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->pasp.vSpacing)); // unsigned int(32) vSpacing;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  835|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, pasp));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  836|      0|        if (dedup) {
  ------------------
  |  Branch (836:13): [True: 0, False: 0]
  ------------------
  837|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  838|      0|        }
  839|      0|    }
  840|  13.7k|    return AVIF_RESULT_OK;
  841|  13.7k|}
write.c:avifItemPropertyDedupDestroy:
  418|  13.7k|{
  419|  13.7k|    avifArrayDestroy(&dedup->properties);
  420|  13.7k|    avifRWDataFree(&dedup->buffer);
  421|  13.7k|    avifFree(dedup);
  422|  13.7k|}
write.c:avifEncoderWriteColorProperties:
  712|  13.7k|{
  713|       |    // outputStream is the final bitstream that will be output by the libavif encoder API.
  714|       |    // dedupStream is either equal to outputStream or to &dedup->s which is a temporary stream used
  715|       |    // to store parts of the final bitstream; these parts may be discarded if they are a duplicate
  716|       |    // of an already stored property.
  717|  13.7k|    avifRWStream * dedupStream = outputStream;
  718|  13.7k|    if (dedup) {
  ------------------
  |  Branch (718:9): [True: 13.7k, False: 0]
  ------------------
  719|  13.7k|        AVIF_ASSERT_OR_RETURN(associations);
  ------------------
  |  |   64|  13.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  13.7k|    do {                        \
  |  |  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  13.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|       |
  721|       |        // Use the dedup's temporary stream for box writes.
  722|  13.7k|        dedupStream = &dedup->s;
  723|  13.7k|    }
  724|       |
  725|  13.7k|    if (imageMetadata->icc.size > 0) {
  ------------------
  |  Branch (725:9): [True: 0, False: 13.7k]
  ------------------
  726|      0|        if (dedup) {
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|            avifItemPropertyDedupStart(dedup);
  728|      0|        }
  729|      0|        avifBoxMarker colr;
  730|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "colr", AVIF_BOX_SIZE_TBD, &colr));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  731|      0|        AVIF_CHECKRES(avifRWStreamWriteChars(dedupStream, "prof", 4)); // unsigned int(32) colour_type;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  732|      0|        AVIF_CHECKRES(avifRWStreamWrite(dedupStream, imageMetadata->icc.data, imageMetadata->icc.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  733|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, colr));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  734|      0|        if (dedup) {
  ------------------
  |  Branch (734:13): [True: 0, False: 0]
  ------------------
  735|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  736|      0|        }
  737|      0|    }
  738|       |
  739|       |    // HEIF 6.5.5.1, from Amendment 3 allows multiple colr boxes: "at most one for a given value of colour type"
  740|       |    // Therefore, *always* writing an nclx box, even if a prof box was already written above.
  741|  13.7k|    AVIF_CHECKRES(avifEncoderWriteNclxProperty(dedupStream, outputStream, imageMetadata, associations, dedup));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  742|       |
  743|  13.7k|    AVIF_CHECKRES(avifEncoderWritePaspProperty(dedupStream, outputStream, imageMetadata, associations, dedup));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  744|       |
  745|  13.7k|    return AVIF_RESULT_OK;
  746|  13.7k|}
write.c:avifEncoderWriteHDRProperties:
  762|  13.7k|{
  763|       |    // Write Content Light Level Information, if present
  764|  13.7k|    if (imageMetadata->clli.maxCLL || imageMetadata->clli.maxPALL) {
  ------------------
  |  Branch (764:9): [True: 0, False: 13.7k]
  |  Branch (764:39): [True: 0, False: 13.7k]
  ------------------
  765|      0|        if (dedup) {
  ------------------
  |  Branch (765:13): [True: 0, False: 0]
  ------------------
  766|      0|            avifItemPropertyDedupStart(dedup);
  767|      0|        }
  768|      0|        avifBoxMarker clli;
  769|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "clli", AVIF_BOX_SIZE_TBD, &clli));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  770|      0|        AVIF_CHECKRES(avifEncoderWriteContentLightLevelInformation(dedupStream, &imageMetadata->clli));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  771|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, clli));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  772|      0|        if (dedup) {
  ------------------
  |  Branch (772:13): [True: 0, False: 0]
  ------------------
  773|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_FALSE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  774|      0|        }
  775|      0|    }
  776|       |
  777|       |    // TODO(maryla): add other HDR boxes: mdcv, cclv, etc. (in avifEncoderWriteMiniHDRProperties() too)
  778|       |
  779|  13.7k|    return AVIF_RESULT_OK;
  780|  13.7k|}
write.c:avifEncoderWriteTransformativeProperties:
  848|  18.4k|{
  849|  18.4k|    if (imageMetadata->transformFlags & AVIF_TRANSFORM_CLAP) {
  ------------------
  |  Branch (849:9): [True: 0, False: 18.4k]
  ------------------
  850|      0|        if (dedup) {
  ------------------
  |  Branch (850:13): [True: 0, False: 0]
  ------------------
  851|      0|            avifItemPropertyDedupStart(dedup);
  852|      0|        }
  853|      0|        avifBoxMarker clap;
  854|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "clap", AVIF_BOX_SIZE_TBD, &clap));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  855|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.widthN));    // unsigned int(32) cleanApertureWidthN;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  856|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.widthD));    // unsigned int(32) cleanApertureWidthD;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  857|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.heightN));   // unsigned int(32) cleanApertureHeightN;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  858|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.heightD));   // unsigned int(32) cleanApertureHeightD;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  859|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.horizOffN)); // unsigned int(32) horizOffN;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  860|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.horizOffD)); // unsigned int(32) horizOffD;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  861|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.vertOffN));  // unsigned int(32) vertOffN;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  862|      0|        AVIF_CHECKRES(avifRWStreamWriteU32(dedupStream, imageMetadata->clap.vertOffD));  // unsigned int(32) vertOffD;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  863|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, clap));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  864|      0|        if (dedup) {
  ------------------
  |  Branch (864:13): [True: 0, False: 0]
  ------------------
  865|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_TRUE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  866|      0|        }
  867|      0|    }
  868|  18.4k|    if (imageMetadata->transformFlags & AVIF_TRANSFORM_IROT) {
  ------------------
  |  Branch (868:9): [True: 0, False: 18.4k]
  ------------------
  869|      0|        if (dedup) {
  ------------------
  |  Branch (869:13): [True: 0, False: 0]
  ------------------
  870|      0|            avifItemPropertyDedupStart(dedup);
  871|      0|        }
  872|      0|        avifBoxMarker irot;
  873|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "irot", AVIF_BOX_SIZE_TBD, &irot));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  874|      0|        AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, 0, /*bitCount=*/6)); // unsigned int (6) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  875|      0|        AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, imageMetadata->irot.angle & 0x3, /*bitCount=*/2)); // unsigned int (2) angle;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  876|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, irot));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  877|      0|        if (dedup) {
  ------------------
  |  Branch (877:13): [True: 0, False: 0]
  ------------------
  878|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_TRUE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  879|      0|        }
  880|      0|    }
  881|  18.4k|    if (imageMetadata->transformFlags & AVIF_TRANSFORM_IMIR) {
  ------------------
  |  Branch (881:9): [True: 0, False: 18.4k]
  ------------------
  882|      0|        if (dedup) {
  ------------------
  |  Branch (882:13): [True: 0, False: 0]
  ------------------
  883|      0|            avifItemPropertyDedupStart(dedup);
  884|      0|        }
  885|      0|        avifBoxMarker imir;
  886|      0|        AVIF_CHECKRES(avifRWStreamWriteBox(dedupStream, "imir", AVIF_BOX_SIZE_TBD, &imir));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  887|      0|        AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, 0, /*bitCount=*/7)); // unsigned int(7) reserved = 0;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  888|      0|        AVIF_CHECKRES(avifRWStreamWriteBits(dedupStream, imageMetadata->imir.axis ? 1 : 0, /*bitCount=*/1)); // unsigned int(1) axis;
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |  ------------------
  |  |  |  Branch (55:38): [True: 0, False: 0]
  |  |  ------------------
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  889|      0|        AVIF_CHECKRES(avifRWStreamFinishBox(dedupStream, imir));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  890|      0|        if (dedup) {
  ------------------
  |  Branch (890:13): [True: 0, False: 0]
  ------------------
  891|      0|            AVIF_CHECKRES(avifItemPropertyDedupFinish(dedup, outputStream, associations, /*essential=*/AVIF_TRUE));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  892|      0|        }
  893|      0|    }
  894|  18.4k|    return AVIF_RESULT_OK;
  895|  18.4k|}
write.c:avifEncoderWriteMediaDataBox:
 2408|  13.7k|{
 2409|  13.7k|    encoder->ioStats.colorOBUSize = 0;
 2410|  13.7k|    encoder->ioStats.alphaOBUSize = 0;
 2411|  13.7k|    encoder->data->gainMapSizeBytes = 0;
 2412|       |
 2413|  13.7k|    avifBoxMarker mdat;
 2414|  13.7k|    AVIF_CHECKRES(avifRWStreamWriteBox(s, "mdat", AVIF_BOX_SIZE_TBD, &mdat));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2415|  13.7k|    const size_t mdatStartOffset = avifRWStreamOffset(s);
 2416|  55.1k|    for (uint32_t itemPasses = 0; itemPasses < 3; ++itemPasses) {
  ------------------
  |  Branch (2416:35): [True: 41.3k, False: 13.7k]
  ------------------
 2417|       |        // Use multiple passes to pack in the following order:
 2418|       |        //   * Pass 0: metadata (Exif/XMP/gain map metadata)
 2419|       |        //   * Pass 1: alpha, gain map image (AV1)
 2420|       |        //   * Pass 2: all other item data (AV1 color)
 2421|       |        //
 2422|       |        // See here for the discussion on alpha coming before color:
 2423|       |        // https://github.com/AOMediaCodec/libavif/issues/287
 2424|       |        //
 2425|       |        // Exif and XMP are packed first as they're required to be fully available
 2426|       |        // by avifDecoderParse() before it returns AVIF_RESULT_OK, unless ignoreXMP
 2427|       |        // and ignoreExif are enabled.
 2428|       |        //
 2429|  41.3k|        const avifBool metadataPass = (itemPasses == 0);
 2430|  41.3k|        const avifBool alphaAndGainMapPass = (itemPasses == 1);
 2431|       |
 2432|  96.5k|        for (uint32_t itemIndex = 0; itemIndex < encoder->data->items.count; ++itemIndex) {
  ------------------
  |  Branch (2432:38): [True: 55.2k, False: 41.3k]
  ------------------
 2433|  55.2k|            avifEncoderItem * item = &encoder->data->items.item[itemIndex];
 2434|  55.2k|            if ((item->metadataPayload.size == 0) && (item->encodeOutput->samples.count == 0)) {
  ------------------
  |  Branch (2434:17): [True: 55.2k, False: 0]
  |  Branch (2434:54): [True: 0, False: 55.2k]
  ------------------
 2435|       |                // this item has nothing for the mdat box
 2436|      0|                continue;
 2437|      0|            }
 2438|  55.2k|            const avifBool isMetadata = !memcmp(item->type, "mime", 4) || !memcmp(item->type, "Exif", 4) ||
  ------------------
  |  Branch (2438:41): [True: 0, False: 55.2k]
  |  Branch (2438:75): [True: 0, False: 55.2k]
  ------------------
 2439|  55.2k|                                        !memcmp(item->type, "tmap", 4);
  ------------------
  |  Branch (2439:41): [True: 0, False: 55.2k]
  ------------------
 2440|  55.2k|            if (metadataPass != isMetadata) {
  ------------------
  |  Branch (2440:17): [True: 18.4k, False: 36.8k]
  ------------------
 2441|       |                // only process metadata (XMP/Exif) payloads when metadataPass is true
 2442|  18.4k|                continue;
 2443|  18.4k|            }
 2444|  36.8k|            const avifBool isAlpha = avifIsAlpha(item->itemCategory);
 2445|  36.8k|            const avifBool isAlphaOrGainMap = isAlpha || item->itemCategory == AVIF_ITEM_GAIN_MAP;
  ------------------
  |  Branch (2445:47): [True: 9.23k, False: 27.5k]
  |  Branch (2445:58): [True: 0, False: 27.5k]
  ------------------
 2446|  36.8k|            if (alphaAndGainMapPass != isAlphaOrGainMap) {
  ------------------
  |  Branch (2446:17): [True: 18.4k, False: 18.4k]
  ------------------
 2447|       |                // only process alpha payloads when alphaPass is true
 2448|  18.4k|                continue;
 2449|  18.4k|            }
 2450|       |
 2451|  18.4k|            if ((encoder->extraLayerCount > 0) && (item->encodeOutput->samples.count > 0)) {
  ------------------
  |  Branch (2451:17): [True: 18.4k, False: 0]
  |  Branch (2451:51): [True: 18.4k, False: 0]
  ------------------
 2452|       |                // Interleave - Pick out AV1 items and interleave them later.
 2453|       |                // We always interleave all AV1 items for layered images.
 2454|  18.4k|                AVIF_ASSERT_OR_RETURN(item->encodeOutput->samples.count == item->mdatFixups.count);
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2455|       |
 2456|  18.4k|                avifEncoderItemReference * ref =
 2457|  18.4k|                    (avifEncoderItemReference *)avifArrayPush(isAlpha ? layeredAlphaItems : layeredColorItems);
  ------------------
  |  Branch (2457:63): [True: 4.61k, False: 13.7k]
  ------------------
 2458|  18.4k|                AVIF_CHECKERR(ref != NULL, AVIF_RESULT_OUT_OF_MEMORY);
  ------------------
  |  |   45|  18.4k|    do {                        \
  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  ------------------
  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   47|      0|            avifBreakOnError(); \
  |  |   48|      0|            return ERR;         \
  |  |   49|      0|        }                       \
  |  |   50|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 2459|  18.4k|                *ref = item;
 2460|  18.4k|                continue;
 2461|  18.4k|            }
 2462|       |
 2463|      0|            size_t chunkOffset = 0;
 2464|       |
 2465|       |            // Deduplication - See if an identical chunk to this has already been written.
 2466|       |            // Doing it when item->encodeOutput->samples.count > 1 would require contiguous memory.
 2467|      0|            if (item->encodeOutput->samples.count == 1) {
  ------------------
  |  Branch (2467:17): [True: 0, False: 0]
  ------------------
 2468|      0|                avifEncodeSample * sample = &item->encodeOutput->samples.sample[0];
 2469|      0|                chunkOffset = avifEncoderFindExistingChunk(s, mdatStartOffset, sample->data.data, sample->data.size);
 2470|      0|            } else if (item->encodeOutput->samples.count == 0) {
  ------------------
  |  Branch (2470:24): [True: 0, False: 0]
  ------------------
 2471|      0|                chunkOffset = avifEncoderFindExistingChunk(s, mdatStartOffset, item->metadataPayload.data, item->metadataPayload.size);
 2472|      0|            }
 2473|       |
 2474|      0|            if (!chunkOffset) {
  ------------------
  |  Branch (2474:17): [True: 0, False: 0]
  ------------------
 2475|       |                // We've never seen this chunk before; write it out
 2476|      0|                chunkOffset = avifRWStreamOffset(s);
 2477|      0|                if (item->encodeOutput->samples.count > 0) {
  ------------------
  |  Branch (2477:21): [True: 0, False: 0]
  ------------------
 2478|      0|                    for (uint32_t sampleIndex = 0; sampleIndex < item->encodeOutput->samples.count; ++sampleIndex) {
  ------------------
  |  Branch (2478:52): [True: 0, False: 0]
  ------------------
 2479|      0|                        avifEncodeSample * sample = &item->encodeOutput->samples.sample[sampleIndex];
 2480|      0|                        AVIF_CHECKRES(avifRWStreamWrite(s, sample->data.data, sample->data.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2481|       |
 2482|      0|                        if (isAlpha) {
  ------------------
  |  Branch (2482:29): [True: 0, False: 0]
  ------------------
 2483|      0|                            encoder->ioStats.alphaOBUSize += sample->data.size;
 2484|      0|                        } else if (item->itemCategory == AVIF_ITEM_COLOR) {
  ------------------
  |  Branch (2484:36): [True: 0, False: 0]
  ------------------
 2485|      0|                            encoder->ioStats.colorOBUSize += sample->data.size;
 2486|      0|                        } else if (item->itemCategory == AVIF_ITEM_GAIN_MAP) {
  ------------------
  |  Branch (2486:36): [True: 0, False: 0]
  ------------------
 2487|      0|                            encoder->data->gainMapSizeBytes += sample->data.size;
 2488|      0|                        }
 2489|      0|                    }
 2490|      0|                } else {
 2491|      0|                    AVIF_CHECKRES(avifRWStreamWrite(s, item->metadataPayload.data, item->metadataPayload.size));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2492|      0|                }
 2493|      0|            }
 2494|       |
 2495|      0|            for (uint32_t fixupIndex = 0; fixupIndex < item->mdatFixups.count; ++fixupIndex) {
  ------------------
  |  Branch (2495:43): [True: 0, False: 0]
  ------------------
 2496|      0|                avifOffsetFixup * fixup = &item->mdatFixups.fixup[fixupIndex];
 2497|      0|                size_t prevOffset = avifRWStreamOffset(s);
 2498|      0|                avifRWStreamSetOffset(s, fixup->offset);
 2499|      0|                AVIF_CHECKRES(avifRWStreamWriteU32(s, (uint32_t)chunkOffset));
  ------------------
  |  |   54|      0|    do {                                  \
  |  |   55|      0|        const avifResult result__ = (A);  \
  |  |   56|      0|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2500|      0|                avifRWStreamSetOffset(s, prevOffset);
 2501|      0|            }
 2502|      0|        }
 2503|  41.3k|    }
 2504|       |
 2505|  13.7k|    uint32_t layeredItemCount = AVIF_MAX(layeredColorItems->count, layeredAlphaItems->count);
  ------------------
  |  |   20|  13.7k|#define AVIF_MAX(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (20:25): [True: 9.17k, False: 4.61k]
  |  |  ------------------
  ------------------
 2506|  13.7k|    if (layeredItemCount > 0) {
  ------------------
  |  Branch (2506:9): [True: 13.7k, False: 0]
  ------------------
 2507|       |        // Interleave samples of all AV1 items.
 2508|       |        // We first write the first layer of all items,
 2509|       |        // in which we write first layer of each cell,
 2510|       |        // in which we write alpha first and then color.
 2511|  13.7k|        avifBool hasMoreSample;
 2512|  13.7k|        uint32_t layerIndex = 0;
 2513|  55.1k|        do {
 2514|  55.1k|            hasMoreSample = AVIF_FALSE;
  ------------------
  |  |   89|  55.1k|#define AVIF_FALSE 0
  ------------------
 2515|   110k|            for (uint32_t itemIndex = 0; itemIndex < layeredItemCount; ++itemIndex) {
  ------------------
  |  Branch (2515:42): [True: 55.1k, False: 55.1k]
  ------------------
 2516|   165k|                for (int samplePass = 0; samplePass < 2; ++samplePass) {
  ------------------
  |  Branch (2516:42): [True: 110k, False: 55.1k]
  ------------------
 2517|       |                    // Alpha coming before color
 2518|   110k|                    avifEncoderItemReferenceArray * currentItems = (samplePass == 0) ? layeredAlphaItems : layeredColorItems;
  ------------------
  |  Branch (2518:68): [True: 55.1k, False: 55.1k]
  ------------------
 2519|   110k|                    if (itemIndex >= currentItems->count) {
  ------------------
  |  Branch (2519:25): [True: 36.7k, False: 73.6k]
  ------------------
 2520|  36.7k|                        continue;
 2521|  36.7k|                    }
 2522|       |
 2523|       |                    // There is no way to select which grid cell should be written first for now.
 2524|  73.6k|                    avifEncoderItem * item = currentItems->ref[itemIndex];
 2525|  73.6k|                    if (item->encodeOutput->samples.count <= layerIndex) {
  ------------------
  |  Branch (2525:25): [True: 0, False: 73.6k]
  ------------------
 2526|       |                        // We've already written all samples of this item
 2527|      0|                        continue;
 2528|  73.6k|                    } else if (item->encodeOutput->samples.count > layerIndex + 1) {
  ------------------
  |  Branch (2528:32): [True: 55.2k, False: 18.4k]
  ------------------
 2529|  55.2k|                        hasMoreSample = AVIF_TRUE;
  ------------------
  |  |   88|  55.2k|#define AVIF_TRUE 1
  ------------------
 2530|  55.2k|                    }
 2531|  73.6k|                    avifRWData * data = &item->encodeOutput->samples.sample[layerIndex].data;
 2532|  73.6k|                    size_t chunkOffset = avifEncoderFindExistingChunk(s, mdatStartOffset, data->data, data->size);
 2533|  73.6k|                    if (!chunkOffset) {
  ------------------
  |  Branch (2533:25): [True: 73.6k, False: 0]
  ------------------
 2534|       |                        // We've never seen this chunk before; write it out
 2535|  73.6k|                        chunkOffset = avifRWStreamOffset(s);
 2536|  73.6k|                        AVIF_CHECKRES(avifRWStreamWrite(s, data->data, data->size));
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2537|  73.6k|                        if (samplePass == 0) {
  ------------------
  |  Branch (2537:29): [True: 18.4k, False: 55.1k]
  ------------------
 2538|  18.4k|                            encoder->ioStats.alphaOBUSize += data->size;
 2539|  55.1k|                        } else {
 2540|  55.1k|                            encoder->ioStats.colorOBUSize += data->size;
 2541|  55.1k|                        }
 2542|  73.6k|                    }
 2543|       |
 2544|  73.6k|                    size_t prevOffset = avifRWStreamOffset(s);
 2545|  73.6k|                    avifRWStreamSetOffset(s, item->mdatFixups.fixup[layerIndex].offset);
 2546|  73.6k|                    AVIF_CHECKRES(avifRWStreamWriteU32(s, (uint32_t)chunkOffset));
  ------------------
  |  |   54|  73.6k|    do {                                  \
  |  |   55|  73.6k|        const avifResult result__ = (A);  \
  |  |   56|  73.6k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 73.6k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  73.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 73.6k]
  |  |  ------------------
  ------------------
 2547|  73.6k|                    avifRWStreamSetOffset(s, prevOffset);
 2548|  73.6k|                }
 2549|  55.1k|            }
 2550|  55.1k|            ++layerIndex;
 2551|  55.1k|        } while (hasMoreSample);
  ------------------
  |  Branch (2551:18): [True: 41.3k, False: 13.7k]
  ------------------
 2552|       |
 2553|  13.7k|        AVIF_ASSERT_OR_RETURN(layerIndex <= AVIF_MAX_AV1_LAYER_COUNT);
  ------------------
  |  |   64|  13.7k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  13.7k|    do {                        \
  |  |  |  |   46|  13.7k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 13.7k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  13.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 13.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2554|  13.7k|    }
 2555|  13.7k|    AVIF_CHECKRES(avifRWStreamFinishBox(s, mdat));
  ------------------
  |  |   54|  13.7k|    do {                                  \
  |  |   55|  13.7k|        const avifResult result__ = (A);  \
  |  |   56|  13.7k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2556|  13.7k|    return AVIF_RESULT_OK;
 2557|  13.7k|}
write.c:avifEncoderFindExistingChunk:
 2389|  73.6k|{
 2390|  73.6k|    const size_t mdatCurrentOffset = avifRWStreamOffset(s);
 2391|  73.6k|    const size_t mdatSearchSize = mdatCurrentOffset - mdatStartOffset;
 2392|  73.6k|    if (mdatSearchSize < size) {
  ------------------
  |  Branch (2392:9): [True: 27.3k, False: 46.2k]
  ------------------
 2393|  27.3k|        return 0;
 2394|  27.3k|    }
 2395|  46.2k|    const size_t mdatEndSearchOffset = mdatCurrentOffset - size;
 2396|  68.9M|    for (size_t searchOffset = mdatStartOffset; searchOffset <= mdatEndSearchOffset; ++searchOffset) {
  ------------------
  |  Branch (2396:49): [True: 68.8M, False: 46.2k]
  ------------------
 2397|  68.8M|        if (!memcmp(data, &s->raw->data[searchOffset], size)) {
  ------------------
  |  Branch (2397:13): [True: 0, False: 68.8M]
  ------------------
 2398|      0|            return searchOffset;
 2399|      0|        }
 2400|  68.8M|    }
 2401|  46.2k|    return 0;
 2402|  46.2k|}
write.c:writeConfigBox:
 4186|  18.4k|{
 4187|  18.4k|    avifBoxMarker configBox;
 4188|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBox(s, configPropName, AVIF_BOX_SIZE_TBD, &configBox));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4189|  18.4k|    AVIF_CHECKRES(writeCodecConfig(s, cfg));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4190|  18.4k|    AVIF_CHECKRES(avifRWStreamFinishBox(s, configBox));
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4191|  18.4k|    return AVIF_RESULT_OK;
 4192|  18.4k|}
write.c:writeCodecConfig:
 4155|  18.4k|{
 4156|  18.4k|    const size_t av1COffset = s->offset;
 4157|       |
 4158|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, 1, /*bitCount=*/1)); // unsigned int (1) marker = 1;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4159|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, 1, /*bitCount=*/7)); // unsigned int (7) version = 1;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4160|       |
 4161|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->seqProfile, /*bitCount=*/3));   // unsigned int (3) seq_profile;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4162|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->seqLevelIdx0, /*bitCount=*/5)); // unsigned int (5) seq_level_idx_0;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4163|       |
 4164|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->seqTier0, /*bitCount=*/1));             // unsigned int (1) seq_tier_0;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4165|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->highBitdepth, /*bitCount=*/1));         // unsigned int (1) high_bitdepth;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4166|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->twelveBit, /*bitCount=*/1));            // unsigned int (1) twelve_bit;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4167|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->monochrome, /*bitCount=*/1));           // unsigned int (1) monochrome;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4168|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->chromaSubsamplingX, /*bitCount=*/1));   // unsigned int (1) chroma_subsampling_x;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4169|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->chromaSubsamplingY, /*bitCount=*/1));   // unsigned int (1) chroma_subsampling_y;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4170|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, cfg->chromaSamplePosition, /*bitCount=*/2)); // unsigned int (2) chroma_sample_position;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4171|       |
 4172|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, 0, /*bitCount=*/3)); // unsigned int (3) reserved = 0;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4173|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, 0, /*bitCount=*/1)); // unsigned int (1) initial_presentation_delay_present;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4174|  18.4k|    AVIF_CHECKRES(avifRWStreamWriteBits(s, 0, /*bitCount=*/4)); // unsigned int (4) reserved = 0;
  ------------------
  |  |   54|  18.4k|    do {                                  \
  |  |   55|  18.4k|        const avifResult result__ = (A);  \
  |  |   56|  18.4k|        if (result__ != AVIF_RESULT_OK) { \
  |  |  ------------------
  |  |  |  Branch (56:13): [True: 0, False: 18.4k]
  |  |  ------------------
  |  |   57|      0|            avifBreakOnError();           \
  |  |   58|      0|            return result__;              \
  |  |   59|      0|        }                                 \
  |  |   60|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (60:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
 4175|       |
 4176|       |    // According to section 2.2.1 of AV1 Image File Format specification v1.1.0,
 4177|       |    // there is no need to write any OBU here.
 4178|       |    // See https://aomediacodec.github.io/av1-avif/v1.1.0.html#av1-configuration-item-property.
 4179|       |    // unsigned int (8) configOBUs[];
 4180|       |
 4181|  18.4k|    AVIF_ASSERT_OR_RETURN(s->offset - av1COffset == 4); // Make sure writeCodecConfig() writes exactly 4 bytes.
  ------------------
  |  |   64|  18.4k|#define AVIF_ASSERT_OR_RETURN(A) AVIF_CHECKERR((A), AVIF_RESULT_INTERNAL_ERROR)
  |  |  ------------------
  |  |  |  |   45|  18.4k|    do {                        \
  |  |  |  |   46|  18.4k|        if (!(A)) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|            avifBreakOnError(); \
  |  |  |  |   48|      0|            return ERR;         \
  |  |  |  |   49|      0|        }                       \
  |  |  |  |   50|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (50:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4182|  18.4k|    return AVIF_RESULT_OK;
 4183|  18.4k|}

avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_127EncodeDecodeDimensionChangeENSt3__16vectorINS2_10unique_ptrI9avifImageNS_16UniquePtrDeleterEEENS2_9allocatorIS7_EEEERKNS2_5arrayI15avifScalingModeLm4EEENS4_I11avifEncoderS6_EENS4_I11avifDecoderS6_EE:
  182|  13.7k|    EncoderPtr encoder, DecoderPtr decoder) {
  183|  13.7k|  ASSERT_EQ(layers.size(), kLayerCount);
  ------------------
  |  Branch (183:3): [True: 13.7k, False: 0]
  |  Branch (183:3): [True: 0, False: 13.7k]
  |  Branch (183:3): [True: 13.7k, False: 0]
  ------------------
  184|  13.7k|  ASSERT_NE(layers.back().get(), nullptr);
  ------------------
  |  Branch (184:3): [True: 13.7k, False: 0]
  |  Branch (184:3): [True: 0, False: 13.7k]
  |  Branch (184:3): [True: 13.7k, False: 0]
  ------------------
  185|  13.7k|  const uint32_t expected_width = layers.back()->width;
  186|  13.7k|  const uint32_t expected_height = layers.back()->height;
  187|  13.7k|  EncodeDecodeLayered(std::move(layers), scaling_modes,
  188|  13.7k|                      /*expected_width=*/expected_width,
  189|  13.7k|                      /*expected_height=*/expected_height,
  190|  13.7k|                      /*set_last_layer_size=*/false, std::move(encoder),
  191|  13.7k|                      std::move(decoder));
  192|  13.7k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_119EncodeDecodeLayeredENSt3__16vectorINS2_10unique_ptrI9avifImageNS_16UniquePtrDeleterEEENS2_9allocatorIS7_EEEERKNS2_5arrayI15avifScalingModeLm4EEEjjbNS4_I11avifEncoderS6_EENS4_I11avifDecoderS6_EE:
  106|  13.7k|    EncoderPtr encoder, DecoderPtr decoder) {
  107|  13.7k|  ASSERT_EQ(layers.size(), kLayerCount);
  ------------------
  |  Branch (107:3): [True: 13.7k, False: 0]
  |  Branch (107:3): [True: 0, False: 13.7k]
  |  Branch (107:3): [True: 13.7k, False: 0]
  ------------------
  108|  13.7k|  ASSERT_NE(encoder, nullptr);
  ------------------
  |  Branch (108:3): [True: 13.7k, False: 0]
  |  Branch (108:3): [True: 0, False: 13.7k]
  |  Branch (108:3): [True: 13.7k, False: 0]
  ------------------
  109|  13.7k|  ASSERT_NE(decoder, nullptr);
  ------------------
  |  Branch (109:3): [True: 13.7k, False: 0]
  |  Branch (109:3): [True: 0, False: 13.7k]
  |  Branch (109:3): [True: 13.7k, False: 0]
  ------------------
  110|       |
  111|  13.7k|  if (avifCodecName(AVIF_CODEC_CHOICE_AOM, AVIF_CODEC_FLAG_CAN_ENCODE) ==
  ------------------
  |  Branch (111:7): [True: 0, False: 13.7k]
  ------------------
  112|  13.7k|      nullptr) {
  113|      0|    return;
  114|      0|  }
  115|  13.7k|  if (avifLibYUVVersion() == 0) {
  ------------------
  |  Branch (115:7): [True: 0, False: 13.7k]
  ------------------
  116|      0|    return;
  117|      0|  }
  118|       |
  119|  13.7k|  const avifImage* const reference = layers.front().get();
  120|  13.7k|  ASSERT_NE(reference, nullptr);
  ------------------
  |  Branch (120:3): [True: 13.7k, False: 0]
  |  Branch (120:3): [True: 0, False: 13.7k]
  |  Branch (120:3): [True: 13.7k, False: 0]
  ------------------
  121|       |
  122|  13.7k|  encoder->codecChoice = AVIF_CODEC_CHOICE_AOM;
  123|  13.7k|  encoder->extraLayerCount = static_cast<uint32_t>(layers.size() - 1);
  124|  13.7k|  if (set_last_layer_size) {
  ------------------
  |  Branch (124:7): [True: 0, False: 13.7k]
  ------------------
  125|      0|    encoder->width = expected_width;
  126|      0|    encoder->height = expected_height;
  127|      0|  }
  128|       |
  129|  68.9k|  for (size_t i = 0; i < layers.size(); ++i) {
  ------------------
  |  Branch (129:22): [True: 55.1k, False: 13.7k]
  ------------------
  130|  55.1k|    ASSERT_NE(layers[i].get(), nullptr);
  ------------------
  |  Branch (130:5): [True: 55.1k, False: 0]
  |  Branch (130:5): [True: 0, False: 55.1k]
  |  Branch (130:5): [True: 55.1k, False: 0]
  ------------------
  131|  55.1k|    encoder->scalingMode = scaling_modes[i];
  132|  55.1k|    const avifResult result = avifEncoderAddImage(
  133|  55.1k|        encoder.get(), layers[i].get(),
  134|  55.1k|        /*durationInTimescales=*/1, AVIF_ADD_IMAGE_FLAG_NONE);
  135|   110k|    ASSERT_EQ(result, AVIF_RESULT_OK)
  ------------------
  |  Branch (135:5): [True: 55.1k, False: 0]
  |  Branch (135:5): [True: 0, False: 55.1k]
  |  Branch (135:5): [True: 55.1k, False: 0]
  ------------------
  136|   110k|        << " layer " << i << ": " << avifResultToString(result) << ": "
  137|   110k|        << encoder->diag.error;
  138|  55.1k|  }
  139|       |
  140|  13.7k|  AvifRwData encoded_data;
  141|  13.7k|  avifResult result = avifEncoderFinish(encoder.get(), &encoded_data);
  142|  27.5k|  ASSERT_EQ(result, AVIF_RESULT_OK)
  ------------------
  |  Branch (142:3): [True: 13.7k, False: 0]
  |  Branch (142:3): [True: 0, False: 13.7k]
  |  Branch (142:3): [True: 13.7k, False: 0]
  ------------------
  143|  27.5k|      << avifResultToString(result) << ": " << encoder->diag.error;
  144|       |
  145|  13.7k|  result = avifDecoderSetIOMemory(decoder.get(), encoded_data.data,
  146|  13.7k|                                  encoded_data.size);
  147|  27.5k|  ASSERT_EQ(result, AVIF_RESULT_OK)
  ------------------
  |  Branch (147:3): [True: 13.7k, False: 0]
  |  Branch (147:3): [True: 0, False: 13.7k]
  |  Branch (147:3): [True: 13.7k, False: 0]
  ------------------
  148|  27.5k|      << avifResultToString(result) << ": " << decoder->diag.error;
  149|       |
  150|  13.7k|  result = avifDecoderParse(decoder.get());
  151|  27.5k|  ASSERT_EQ(result, AVIF_RESULT_OK)
  ------------------
  |  Branch (151:3): [True: 13.7k, False: 0]
  |  Branch (151:3): [True: 0, False: 13.7k]
  |  Branch (151:3): [True: 13.7k, False: 0]
  ------------------
  152|  27.5k|      << avifResultToString(result) << ": " << decoder->diag.error;
  153|       |
  154|  13.7k|  const int num_decodes =
  155|  13.7k|      decoder->allowProgressive ? static_cast<int>(layers.size()) : 1;
  ------------------
  |  Branch (155:7): [True: 7.04k, False: 6.74k]
  ------------------
  156|  13.7k|  if (decoder->allowProgressive) {
  ------------------
  |  Branch (156:7): [True: 7.04k, False: 6.74k]
  ------------------
  157|  7.04k|    EXPECT_EQ(decoder->progressiveState, AVIF_PROGRESSIVE_STATE_ACTIVE);
  ------------------
  |  Branch (157:5): [True: 7.04k, False: 0]
  |  Branch (157:5): [True: 0, False: 7.04k]
  |  Branch (157:5): [True: 7.04k, False: 0]
  ------------------
  158|  7.04k|    ASSERT_EQ(decoder->imageCount, static_cast<int>(layers.size()));
  ------------------
  |  Branch (158:5): [True: 7.04k, False: 0]
  |  Branch (158:5): [True: 0, False: 7.04k]
  |  Branch (158:5): [True: 7.04k, False: 0]
  ------------------
  159|  7.04k|  } else {
  160|  6.74k|    EXPECT_EQ(decoder->progressiveState, AVIF_PROGRESSIVE_STATE_AVAILABLE);
  ------------------
  |  Branch (160:5): [True: 6.74k, False: 0]
  |  Branch (160:5): [True: 0, False: 6.74k]
  |  Branch (160:5): [True: 6.74k, False: 0]
  ------------------
  161|  6.74k|    ASSERT_EQ(decoder->imageCount, 1);
  ------------------
  |  Branch (161:5): [True: 6.74k, False: 0]
  |  Branch (161:5): [True: 0, False: 6.74k]
  |  Branch (161:5): [True: 6.74k, False: 0]
  ------------------
  162|  6.74k|  }
  163|       |
  164|  48.7k|  for (int i = 0; i < num_decodes; ++i) {
  ------------------
  |  Branch (164:19): [True: 34.9k, False: 13.7k]
  ------------------
  165|  34.9k|    result = avifDecoderNextImage(decoder.get());
  166|  69.8k|    ASSERT_EQ(result, AVIF_RESULT_OK)
  ------------------
  |  Branch (166:5): [True: 34.9k, False: 0]
  |  Branch (166:5): [True: 0, False: 34.9k]
  |  Branch (166:5): [True: 34.9k, False: 0]
  ------------------
  167|  69.8k|        << " layer " << i << ": " << avifResultToString(result) << ": "
  168|  69.8k|        << decoder->diag.error;
  169|  34.9k|    EXPECT_EQ(decoder->image->width, expected_width);
  ------------------
  |  Branch (169:5): [True: 34.9k, False: 0]
  |  Branch (169:5): [True: 0, False: 34.9k]
  |  Branch (169:5): [True: 34.9k, False: 0]
  ------------------
  170|  34.9k|    EXPECT_EQ(decoder->image->height, expected_height);
  ------------------
  |  Branch (170:5): [True: 34.9k, False: 0]
  |  Branch (170:5): [True: 0, False: 34.9k]
  |  Branch (170:5): [True: 34.9k, False: 0]
  ------------------
  171|  34.9k|    EXPECT_EQ(decoder->image->depth, reference->depth);
  ------------------
  |  Branch (171:5): [True: 34.9k, False: 0]
  |  Branch (171:5): [True: 0, False: 34.9k]
  |  Branch (171:5): [True: 34.9k, False: 0]
  ------------------
  172|  34.9k|    EXPECT_EQ(decoder->image->yuvFormat, reference->yuvFormat);
  ------------------
  |  Branch (172:5): [True: 34.9k, False: 0]
  |  Branch (172:5): [True: 0, False: 34.9k]
  |  Branch (172:5): [True: 34.9k, False: 0]
  ------------------
  173|  34.9k|  }
  174|  13.7k|  result = avifDecoderNextImage(decoder.get());
  175|  27.5k|  ASSERT_EQ(result, AVIF_RESULT_NO_IMAGES_REMAINING)
  ------------------
  |  Branch (175:3): [True: 13.7k, False: 0]
  |  Branch (175:3): [True: 0, False: 13.7k]
  |  Branch (175:3): [True: 13.7k, False: 0]
  ------------------
  176|  27.5k|      << avifResultToString(result) << ": " << decoder->diag.error;
  177|  13.7k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_121ArbitraryScalingModesEv:
   94|      2|inline auto ArbitraryScalingModes() {
   95|      2|  constexpr int kMaxCombinationIndex =
   96|      2|      static_cast<int>(kScalingModeCombinationCount - 1);
   97|      2|  return fuzztest::Map(MakeRandomScalingModes,
   98|      2|                       fuzztest::InRange<int>(0, kMaxCombinationIndex),
   99|      2|                       fuzztest::InRange<int>(0, kMaxCombinationIndex));
  100|      2|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_122MakeRandomScalingModesEii:
   82|  13.7k|    int horizontal_combination_index, int vertical_combination_index) {
   83|  13.7k|  const auto horizontal_combination =
   84|  13.7k|      GetScalingModeCombination(horizontal_combination_index);
   85|  13.7k|  const auto vertical_combination =
   86|  13.7k|      GetScalingModeCombination(vertical_combination_index);
   87|  13.7k|  return std::array<avifScalingMode, kLayerCount>{
   88|  13.7k|      MakeScalingMode(horizontal_combination[0], vertical_combination[0]),
   89|  13.7k|      MakeScalingMode(horizontal_combination[1], vertical_combination[1]),
   90|  13.7k|      MakeScalingMode(horizontal_combination[2], vertical_combination[2]),
   91|  13.7k|      kNoScalingMode};
   92|  13.7k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_125GetScalingModeCombinationEm:
   60|  27.5k|    size_t combination_index) {
   61|  27.5k|  std::array<avifFraction, kRandomScalingModeCount> combination = {};
   62|  27.5k|  size_t remaining_index = combination_index;
   63|  27.5k|  size_t next_candidate = 0;
   64|   110k|  for (size_t slot = 0; slot < combination.size(); ++slot) {
  ------------------
  |  Branch (64:25): [True: 82.7k, False: 27.5k]
  ------------------
   65|  82.7k|    const size_t remaining_slots = combination.size() - slot - 1;
   66|  82.7k|    for (size_t candidate = next_candidate;
   67|   191k|         candidate < kSupportedScalingModes.size(); ++candidate) {
  ------------------
  |  Branch (67:10): [True: 191k, False: 0]
  ------------------
   68|   191k|      const size_t combinations_with_candidate = CombinationCountWithRepetition(
   69|   191k|          kSupportedScalingModes.size() - candidate, remaining_slots);
   70|   191k|      if (remaining_index < combinations_with_candidate) {
  ------------------
  |  Branch (70:11): [True: 82.7k, False: 108k]
  ------------------
   71|  82.7k|        combination[slot] = kSupportedScalingModes[candidate];
   72|  82.7k|        next_candidate = candidate;
   73|  82.7k|        break;
   74|  82.7k|      }
   75|   108k|      remaining_index -= combinations_with_candidate;
   76|   108k|    }
   77|  82.7k|  }
   78|  27.5k|  return combination;
   79|  27.5k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_130CombinationCountWithRepetitionEmm:
   52|   191k|                                                size_t pick_count) {
   53|   191k|  return BinomialCoefficient(value_count + pick_count - 1, pick_count);
   54|   191k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_119BinomialCoefficientEmm:
   37|   191k|constexpr size_t BinomialCoefficient(size_t n, size_t k) {
   38|   191k|  if (k > n) {
  ------------------
  |  Branch (38:7): [True: 0, False: 191k]
  ------------------
   39|      0|    return 0;
   40|      0|  }
   41|   191k|  if (k > (n - k)) {
  ------------------
  |  Branch (41:7): [True: 13.2k, False: 177k]
  ------------------
   42|  13.2k|    k = n - k;
   43|  13.2k|  }
   44|   191k|  size_t coefficient = 1;
   45|   392k|  for (size_t i = 1; i <= k; ++i) {
  ------------------
  |  Branch (45:22): [True: 201k, False: 191k]
  ------------------
   46|   201k|    coefficient = (coefficient * (n - k + i)) / i;
   47|   201k|  }
   48|   191k|  return coefficient;
   49|   191k|}
avif_fuzztest_enc_dec_layered.cc:_ZN4avif8testutil12_GLOBAL__N_115MakeScalingModeE12avifFractionS2_:
   33|  41.3k|                                          avifFraction vertical) {
   34|  41.3k|  return {horizontal, vertical};
   35|  41.3k|}

_ZN4avif8testutil16CreateAvifAnim8bEmmm15avifPixelFormatbRKNSt3__16vectorIhNS2_9allocatorIhEEEE:
  104|  9.91k|                                       const std::vector<uint8_t>& samples) {
  105|  9.91k|  std::vector<ImagePtr> frames;
  106|  9.91k|  frames.reserve(num_frames);
  107|  9.91k|  const uint8_t* frame_samples = samples.data();
  108|  49.5k|  for (size_t i = 0; i < num_frames; ++i) {
  ------------------
  |  Branch (108:22): [True: 39.6k, False: 9.91k]
  ------------------
  109|  39.6k|    frames.push_back(CreateAvifImage(width, height, 8, pixel_format, has_alpha,
  110|  39.6k|                                     frame_samples));
  111|  39.6k|    frame_samples +=
  112|  39.6k|        GetNumSamples(/*num_frames=*/1, width, height, pixel_format, has_alpha);
  113|  39.6k|  }
  114|  9.91k|  return frames;
  115|  9.91k|}
_ZN4avif8testutil17CreateAvifAnim16bEmmmi15avifPixelFormatbRKNSt3__16vectorItNS2_9allocatorItEEEE:
  121|  3.87k|                                        const std::vector<uint16_t>& samples) {
  122|  3.87k|  std::vector<ImagePtr> frames;
  123|  3.87k|  frames.reserve(num_frames);
  124|  3.87k|  const uint16_t* frame_samples = samples.data();
  125|  19.3k|  for (size_t i = 0; i < num_frames; ++i) {
  ------------------
  |  Branch (125:22): [True: 15.5k, False: 3.87k]
  ------------------
  126|  15.5k|    frames.push_back(
  127|  15.5k|        CreateAvifImage(width, height, depth, pixel_format, has_alpha,
  128|  15.5k|                        reinterpret_cast<const uint8_t*>(frame_samples)));
  129|  15.5k|    frame_samples +=
  130|  15.5k|        GetNumSamples(/*num_frames=*/1, width, height, pixel_format, has_alpha);
  131|  15.5k|  }
  132|  3.87k|  return frames;
  133|  3.87k|}
_ZN4avif8testutil19CreateAvifLayered8bEmm15avifPixelFormatbRKNSt3__16vectorIhNS2_9allocatorIhEEEE:
  138|  9.91k|                                          const std::vector<uint8_t>& samples) {
  139|  9.91k|  return CreateAvifAnim8b(kMaxNumLayers, width, height, pixel_format, has_alpha,
  140|  9.91k|                          samples);
  141|  9.91k|}
_ZN4avif8testutil20CreateAvifLayered16bEmmi15avifPixelFormatbRKNSt3__16vectorItNS2_9allocatorItEEEE:
  145|  3.87k|    bool has_alpha, const std::vector<uint16_t>& samples) {
  146|  3.87k|  return CreateAvifAnim16b(kMaxNumLayers, width, height, depth, pixel_format,
  147|  3.87k|                           has_alpha, samples);
  148|  3.87k|}
_ZN4avif8testutil17CreateAvifEncoderE15avifCodecChoiceiiiiii:
  207|  13.7k|                             int tile_cols_log2, int speed) {
  208|  13.7k|  EncoderPtr encoder(avifEncoderCreate());
  209|  13.7k|  if (encoder.get() == nullptr) {
  ------------------
  |  Branch (209:7): [True: 0, False: 13.7k]
  ------------------
  210|      0|    return encoder;
  211|      0|  }
  212|  13.7k|  encoder->codecChoice = codec_choice;
  213|  13.7k|  encoder->maxThreads = max_threads;
  214|  13.7k|  encoder->quality = quality;
  215|  13.7k|  encoder->qualityAlpha = quality_alpha;
  216|  13.7k|  encoder->tileRowsLog2 = tile_rows_log2;
  217|  13.7k|  encoder->tileColsLog2 = tile_cols_log2;
  218|  13.7k|  encoder->speed = speed;
  219|  13.7k|  return encoder;
  220|  13.7k|}
_ZN4avif8testutil17CreateAvifDecoderE15avifCodecChoicei17avifDecoderSourcebbbbjjjj:
  229|  13.7k|                             avifStrictFlags strict_flags) {
  230|  13.7k|  DecoderPtr decoder(avifDecoderCreate());
  231|  13.7k|  if (decoder.get() == nullptr) {
  ------------------
  |  Branch (231:7): [True: 0, False: 13.7k]
  ------------------
  232|      0|    return decoder;
  233|      0|  }
  234|  13.7k|  decoder->codecChoice = codec_choice;
  235|  13.7k|  decoder->maxThreads = max_threads;
  236|  13.7k|  decoder->requestedSource = requested_source;
  237|  13.7k|  decoder->allowProgressive = allow_progressive;
  238|  13.7k|  decoder->allowIncremental = allow_incremental;
  239|  13.7k|  decoder->ignoreExif = ignore_exif;
  240|  13.7k|  decoder->ignoreXMP = ignore_xmp;
  241|  13.7k|  decoder->imageSizeLimit = image_size_limit;
  242|  13.7k|  decoder->imageDimensionLimit = image_dimension_limit;
  243|  13.7k|  decoder->imageCountLimit = image_count_limit;
  244|  13.7k|  decoder->strictFlags = strict_flags;
  245|  13.7k|  return decoder;
  246|  13.7k|}
_ZN4avif8testutil26AddGainMapOptionsToDecoderENSt3__110unique_ptrI11avifDecoderNS_16UniquePtrDeleterEEEj:
  251|  13.7k|    DecoderPtr decoder, avifImageContentTypeFlags image_content_to_decode) {
  252|  13.7k|  decoder->imageContentToDecode = image_content_to_decode;
  253|  13.7k|  return decoder;
  254|  13.7k|}
_ZN4avif8testutil13GetNumSamplesEmmm15avifPixelFormatb:
  309|  96.6k|                     avifPixelFormat pixel_format, bool has_alpha) {
  310|  96.6k|  const size_t num_luma_samples = width * height;
  311|       |
  312|  96.6k|  avifPixelFormatInfo pixel_format_info;
  313|  96.6k|  avifGetPixelFormatInfo(pixel_format, &pixel_format_info);
  314|  96.6k|  size_t num_chroma_samples = 0;
  315|  96.6k|  if (!pixel_format_info.monochrome) {
  ------------------
  |  Branch (315:7): [True: 49.0k, False: 47.5k]
  ------------------
  316|  49.0k|    num_chroma_samples = 2 *
  317|  49.0k|                         ((width + pixel_format_info.chromaShiftX) >>
  318|  49.0k|                          pixel_format_info.chromaShiftX) *
  319|  49.0k|                         ((height + pixel_format_info.chromaShiftY) >>
  320|  49.0k|                          pixel_format_info.chromaShiftY);
  321|  49.0k|  }
  322|       |
  323|  96.6k|  size_t num_alpha_samples = 0;
  324|  96.6k|  if (has_alpha) {
  ------------------
  |  Branch (324:7): [True: 32.3k, False: 64.2k]
  ------------------
  325|  32.3k|    num_alpha_samples = width * height;
  326|  32.3k|  }
  327|       |
  328|  96.6k|  return num_frames *
  329|  96.6k|         (num_luma_samples + num_chroma_samples + num_alpha_samples);
  330|  96.6k|}
avif_fuzztest_helpers.cc:_ZN4avif8testutil12_GLOBAL__N_115CreateAvifImageEmmi15avifPixelFormatbPKh:
   55|  55.1k|                         const uint8_t* samples) {
   56|  55.1k|  ImagePtr image(avifImageCreate(static_cast<uint32_t>(width),
   57|  55.1k|                                 static_cast<uint32_t>(height), depth,
   58|  55.1k|                                 pixel_format));
   59|  55.1k|  if (image.get() == nullptr) {
  ------------------
  |  Branch (59:7): [True: 0, False: 55.1k]
  ------------------
   60|      0|    return image;
   61|      0|  }
   62|  55.1k|  if (avifImageAllocatePlanes(image.get(),
  ------------------
  |  Branch (62:7): [True: 0, False: 55.1k]
  ------------------
   63|  55.1k|                              has_alpha ? AVIF_PLANES_ALL : AVIF_PLANES_YUV) !=
  ------------------
  |  Branch (63:31): [True: 18.4k, False: 36.7k]
  ------------------
   64|  55.1k|      AVIF_RESULT_OK) {
   65|      0|    return nullptr;
   66|      0|  }
   67|       |
   68|  55.1k|  for (avifChannelIndex c :
  ------------------
  |  Branch (68:27): [True: 220k, False: 55.1k]
  ------------------
   69|   220k|       {AVIF_CHAN_Y, AVIF_CHAN_U, AVIF_CHAN_V, AVIF_CHAN_A}) {
   70|   220k|    const size_t plane_height = avifImagePlaneHeight(image.get(), c);
   71|   220k|    uint8_t* row = avifImagePlane(image.get(), c);
   72|   220k|    const uint32_t row_bytes = avifImagePlaneRowBytes(image.get(), c);
   73|   220k|    assert(row_bytes == avifImagePlaneWidth(image.get(), c) *
   74|   220k|                            (avifImageUsesU16(image.get()) ? 2 : 1));
   75|  6.43M|    for (size_t y = 0; y < plane_height; ++y) {
  ------------------
  |  Branch (75:24): [True: 6.21M, False: 220k]
  ------------------
   76|  6.21M|      std::copy(samples, samples + row_bytes, row);
   77|  6.21M|      row += row_bytes;
   78|  6.21M|      samples += row_bytes;
   79|  6.21M|    }
   80|   220k|  }
   81|  55.1k|  return image;
   82|  55.1k|}

_ZN4avif8testutil20ArbitraryPixelFormatEv:
  118|      8|inline auto ArbitraryPixelFormat() {
  119|      8|  return fuzztest::ElementOf<avifPixelFormat>(
  120|      8|      {AVIF_PIXEL_FORMAT_YUV444, AVIF_PIXEL_FORMAT_YUV422,
  121|      8|       AVIF_PIXEL_FORMAT_YUV420, AVIF_PIXEL_FORMAT_YUV400});
  122|      8|}
_ZN4avif8testutil22ArbitraryAvifLayered8bEv:
  215|      2|inline auto ArbitraryAvifLayered8b() {
  216|      2|  constexpr uint16_t kMinLayerDimension = 8;
  217|      2|  constexpr uint16_t kMaxLayerDimension =
  218|      2|      kMaxDimension / kMaxNumFramesSquareRoot;
  219|      2|  return fuzztest::FlatMap(
  220|      2|      [](size_t width, size_t height, avifPixelFormat pixel_format,
  221|      2|         bool has_alpha) {
  222|      2|        return fuzztest::Map(
  223|      2|            CreateAvifLayered8b, fuzztest::Just(width), fuzztest::Just(height),
  224|      2|            fuzztest::Just(pixel_format), fuzztest::Just(has_alpha),
  225|      2|            fuzztest::Arbitrary<std::vector<uint8_t>>().WithSize(GetNumSamples(
  226|      2|                kMaxNumLayers, width, height, pixel_format, has_alpha)));
  227|      2|      },
  228|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  229|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  230|      2|      ArbitraryPixelFormat(), fuzztest::Arbitrary<bool>());
  231|      2|}
_ZN4avif8testutil23ArbitraryAvifLayered16bEv:
  235|      2|inline auto ArbitraryAvifLayered16b() {
  236|      2|  constexpr uint16_t kMinLayerDimension = 8;
  237|      2|  constexpr uint16_t kMaxLayerDimension =
  238|      2|      kMaxDimension / kMaxNumFramesSquareRoot;
  239|      2|  return fuzztest::FlatMap(
  240|      2|      [](size_t width, size_t height, int depth, avifPixelFormat pixel_format,
  241|      2|         bool has_alpha) {
  242|      2|        return fuzztest::Map(
  243|      2|            CreateAvifLayered16b, fuzztest::Just(width), fuzztest::Just(height),
  244|      2|            fuzztest::Just(depth), fuzztest::Just(pixel_format),
  245|      2|            fuzztest::Just(has_alpha),
  246|      2|            fuzztest::ContainerOf<std::vector<uint16_t>>(
  247|      2|                fuzztest::InRange<uint16_t>(0, (1 << depth) - 1))
  248|      2|                .WithSize(GetNumSamples(kMaxNumLayers, width, height,
  249|      2|                                        pixel_format, has_alpha)));
  250|      2|      },
  251|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  252|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  253|      2|      fuzztest::ElementOf({10, 12}), ArbitraryPixelFormat(),
  254|      2|      fuzztest::Arbitrary<bool>());
  255|      2|}
_ZN4avif8testutil20ArbitraryAvifLayeredEv:
  258|      2|inline auto ArbitraryAvifLayered() {
  259|      2|  return fuzztest::OneOf(ArbitraryAvifLayered8b(), ArbitraryAvifLayered16b());
  260|      2|}
_ZN4avif8testutil29ArbitraryAvifLayeredRandDim8bEv:
  264|      2|inline auto ArbitraryAvifLayeredRandDim8b() {
  265|      2|  constexpr uint16_t kMinLayerDimension = 8;
  266|      2|  constexpr uint16_t kMaxLayerDimension =
  267|      2|      kMaxDimension / kMaxNumFramesSquareRoot;
  268|      2|  return fuzztest::FlatMap(
  269|      2|      [](size_t last_layer_width, size_t last_layer_height,
  270|      2|         avifPixelFormat pixel_format, bool has_alpha) {
  271|      2|        return fuzztest::Map(
  272|      2|            CreateAvifLayeredRandDim8b, fuzztest::Just(last_layer_width),
  273|      2|            fuzztest::Just(last_layer_height), fuzztest::Just(pixel_format),
  274|      2|            fuzztest::Just(has_alpha),
  275|      2|            fuzztest::Arbitrary<std::vector<uint8_t>>().WithSize(
  276|      2|                GetNumSamplesLayeredRandDim(last_layer_width, last_layer_height,
  277|      2|                                            pixel_format, has_alpha)));
  278|      2|      },
  279|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  280|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  281|      2|      ArbitraryPixelFormat(), fuzztest::Arbitrary<bool>());
  282|      2|}
_ZN4avif8testutil30ArbitraryAvifLayeredRandDim16bEv:
  286|      2|inline auto ArbitraryAvifLayeredRandDim16b() {
  287|      2|  constexpr uint16_t kMinLayerDimension = 8;
  288|      2|  constexpr uint16_t kMaxLayerDimension =
  289|      2|      kMaxDimension / kMaxNumFramesSquareRoot;
  290|      2|  return fuzztest::FlatMap(
  291|      2|      [](size_t last_layer_width, size_t last_layer_height, int depth,
  292|      2|         avifPixelFormat pixel_format, bool has_alpha) {
  293|      2|        return fuzztest::Map(
  294|      2|            CreateAvifLayeredRandDim16b, fuzztest::Just(last_layer_width),
  295|      2|            fuzztest::Just(last_layer_height), fuzztest::Just(depth),
  296|      2|            fuzztest::Just(pixel_format), fuzztest::Just(has_alpha),
  297|      2|            fuzztest::ContainerOf<std::vector<uint16_t>>(
  298|      2|                fuzztest::InRange<uint16_t>(0, (1 << depth) - 1))
  299|      2|                .WithSize(GetNumSamplesLayeredRandDim(
  300|      2|                    last_layer_width, last_layer_height, pixel_format,
  301|      2|                    has_alpha)));
  302|      2|      },
  303|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  304|      2|      fuzztest::InRange<uint16_t>(kMinLayerDimension, kMaxLayerDimension),
  305|      2|      fuzztest::ElementOf({10, 12}), ArbitraryPixelFormat(),
  306|      2|      fuzztest::Arbitrary<bool>());
  307|      2|}
_ZN4avif8testutil27ArbitraryAvifLayeredRandDimEv:
  310|      2|inline auto ArbitraryAvifLayeredRandDim() {
  311|      2|  return fuzztest::OneOf(ArbitraryAvifLayeredRandDim8b(),
  312|      2|                         ArbitraryAvifLayeredRandDim16b());
  313|      2|}
_ZN4avif8testutil20ArbitraryAvifEncoderEv:
  384|      4|inline auto ArbitraryAvifEncoder() {
  385|      4|  const auto codec_choice = fuzztest::ElementOf<avifCodecChoice>(
  386|      4|      {AVIF_CODEC_CHOICE_AUTO, AVIF_CODEC_CHOICE_AOM});
  387|       |  // MAX_NUM_THREADS from libaom/aom_util/aom_thread.h
  388|      4|  const auto max_threads = fuzztest::InRange(0, 64);
  389|      4|  const auto quality = fuzztest::InRange(AVIF_QUALITY_WORST, AVIF_QUALITY_BEST);
  ------------------
  |  |  104|      4|#define AVIF_QUALITY_WORST 0
  ------------------
                const auto quality = fuzztest::InRange(AVIF_QUALITY_WORST, AVIF_QUALITY_BEST);
  ------------------
  |  |  105|      4|#define AVIF_QUALITY_BEST 100
  ------------------
  390|      4|  const auto quality_alpha =
  391|      4|      fuzztest::InRange(AVIF_QUALITY_WORST, AVIF_QUALITY_BEST);
  ------------------
  |  |  104|      4|#define AVIF_QUALITY_WORST 0
  ------------------
                    fuzztest::InRange(AVIF_QUALITY_WORST, AVIF_QUALITY_BEST);
  ------------------
  |  |  105|      4|#define AVIF_QUALITY_BEST 100
  ------------------
  392|      4|  const auto tile_rows_log2 = fuzztest::InRange(0, 6);
  393|      4|  const auto tile_cols_log2 = fuzztest::InRange(0, 6);
  394|       |  // Fuzz only a small range of 'speed' values to avoid slowing down the fuzzer
  395|       |  // too much. The main goal is to fuzz libavif, not the underlying AV1 encoder.
  396|      4|  const auto speed = fuzztest::InRange(6, AVIF_SPEED_FASTEST);
  ------------------
  |  |  116|      4|#define AVIF_SPEED_FASTEST 10
  ------------------
  397|      4|  return fuzztest::Map(CreateAvifEncoder, codec_choice, max_threads, quality,
  398|      4|                       quality_alpha, tile_rows_log2, tile_cols_log2, speed);
  399|      4|}
_ZN4avif8testutil24ArbitraryBaseAvifDecoderEv:
  403|      4|inline auto ArbitraryBaseAvifDecoder() {
  404|       |  // MAX_NUM_THREADS from libaom/aom_util/aom_thread.h
  405|      4|  const auto max_threads = fuzztest::InRange(0, 64);
  406|      4|  return fuzztest::Map(
  407|      4|      CreateAvifDecoder,
  408|      4|      fuzztest::ElementOf<avifCodecChoice>({AVIF_CODEC_CHOICE_AUTO,
  409|      4|                                            AVIF_CODEC_CHOICE_AOM,
  410|      4|                                            AVIF_CODEC_CHOICE_DAV1D}),
  411|      4|      max_threads,
  412|       |      /*requested_source=*/
  413|      4|      fuzztest::ElementOf(
  414|      4|          {AVIF_DECODER_SOURCE_AUTO, AVIF_DECODER_SOURCE_PRIMARY_ITEM}),
  415|      4|      /*allow_progressive=*/fuzztest::Arbitrary<bool>(),
  416|      4|      /*allow_incremental=*/fuzztest::Arbitrary<bool>(),
  417|      4|      /*ignore_exif=*/fuzztest::Arbitrary<bool>(),
  418|      4|      /*ignore_xmp=*/fuzztest::Arbitrary<bool>(),
  419|      4|      /*image_size_limit=*/fuzztest::Just(kMaxDimension * kMaxDimension),
  420|      4|      /*image_dimension_limit=*/fuzztest::Just(kMaxDimension),
  421|      4|      /*image_count_limit=*/fuzztest::Just(10),
  422|       |      /*strict_flags=*/
  423|      4|      fuzztest::BitFlagCombinationOf<avifStrictFlags>(
  424|      4|          {AVIF_STRICT_PIXI_REQUIRED, AVIF_STRICT_CLAP_VALID,
  425|      4|           AVIF_STRICT_ALPHA_ISPE_REQUIRED}));
  426|      4|}
_ZN4avif8testutil38ArbitraryAvifDecoderWithGainMapOptionsEv:
  430|      4|inline auto ArbitraryAvifDecoderWithGainMapOptions() {
  431|       |  // Always decode at least color+alpha, since most tests
  432|       |  // assume that if the file/buffer is successfully decoded.
  433|      4|  return fuzztest::Map(
  434|      4|      AddGainMapOptionsToDecoder, ArbitraryBaseAvifDecoder(),
  435|      4|      fuzztest::ElementOf<avifImageContentTypeFlags>(
  436|      4|          {AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA,
  437|      4|           AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA | AVIF_IMAGE_CONTENT_GAIN_MAP,
  438|      4|           AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA |
  439|      4|               AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS,
  440|      4|           AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA | AVIF_IMAGE_CONTENT_GAIN_MAP |
  441|      4|               AVIF_IMAGE_CONTENT_SAMPLE_TRANSFORMS}));
  442|      4|}
_ZN4avif8testutil20ArbitraryAvifDecoderEv:
  445|      4|inline auto ArbitraryAvifDecoder() {
  446|      4|  return ArbitraryAvifDecoderWithGainMapOptions();
  447|      4|}
_ZZN4avif8testutil22ArbitraryAvifLayered8bEvENKUlmm15avifPixelFormatbE_clEmmS1_b:
  221|  29.8k|         bool has_alpha) {
  222|  29.8k|        return fuzztest::Map(
  223|  29.8k|            CreateAvifLayered8b, fuzztest::Just(width), fuzztest::Just(height),
  224|  29.8k|            fuzztest::Just(pixel_format), fuzztest::Just(has_alpha),
  225|  29.8k|            fuzztest::Arbitrary<std::vector<uint8_t>>().WithSize(GetNumSamples(
  226|  29.8k|                kMaxNumLayers, width, height, pixel_format, has_alpha)));
  227|  29.8k|      },
_ZZN4avif8testutil23ArbitraryAvifLayered16bEvENKUlmmi15avifPixelFormatbE_clEmmiS1_b:
  241|  11.6k|         bool has_alpha) {
  242|  11.6k|        return fuzztest::Map(
  243|  11.6k|            CreateAvifLayered16b, fuzztest::Just(width), fuzztest::Just(height),
  244|  11.6k|            fuzztest::Just(depth), fuzztest::Just(pixel_format),
  245|  11.6k|            fuzztest::Just(has_alpha),
  246|  11.6k|            fuzztest::ContainerOf<std::vector<uint16_t>>(
  247|  11.6k|                fuzztest::InRange<uint16_t>(0, (1 << depth) - 1))
  248|  11.6k|                .WithSize(GetNumSamples(kMaxNumLayers, width, height,
  249|  11.6k|                                        pixel_format, has_alpha)));
  250|  11.6k|      },

_ZN4avif8testutil10AvifRwDataC2Ev:
   89|  13.7k|  AvifRwData() : avifRWData{nullptr, 0} {}
_ZN4avif8testutil10AvifRwDataD2Ev:
   92|  13.7k|  ~AvifRwData() { avifRWDataFree(this); }

